From beb102cf822a5d3108b129c64d3913d4e48ae3eb Mon Sep 17 00:00:00 2001 From: support Date: Thu, 23 Jun 2022 17:13:00 +0000 Subject: [PATCH] Built motion from commit 84aa71fc.|2.6.11 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- legacy-libs/node-pre-gyp/CHANGELOG.md | 453 ++++ legacy-libs/node-pre-gyp/LICENSE | 27 + legacy-libs/node-pre-gyp/README.md | 693 ++++++ legacy-libs/node-pre-gyp/appveyor.yml | 30 + legacy-libs/node-pre-gyp/bin/node-pre-gyp | 134 ++ legacy-libs/node-pre-gyp/bin/node-pre-gyp.cmd | 2 + legacy-libs/node-pre-gyp/contributing.md | 10 + legacy-libs/node-pre-gyp/lib/build.js | 51 + legacy-libs/node-pre-gyp/lib/clean.js | 32 + legacy-libs/node-pre-gyp/lib/configure.js | 52 + legacy-libs/node-pre-gyp/lib/info.js | 40 + legacy-libs/node-pre-gyp/lib/install.js | 285 +++ legacy-libs/node-pre-gyp/lib/node-pre-gyp.js | 203 ++ legacy-libs/node-pre-gyp/lib/package.js | 56 + legacy-libs/node-pre-gyp/lib/pre-binding.js | 30 + legacy-libs/node-pre-gyp/lib/publish.js | 79 + legacy-libs/node-pre-gyp/lib/rebuild.js | 21 + legacy-libs/node-pre-gyp/lib/reinstall.js | 20 + legacy-libs/node-pre-gyp/lib/reveal.js | 33 + legacy-libs/node-pre-gyp/lib/testbinary.js | 81 + legacy-libs/node-pre-gyp/lib/testpackage.js | 55 + legacy-libs/node-pre-gyp/lib/unpublish.js | 43 + .../node-pre-gyp/lib/util/abi_crosswalk.json | 2302 ++++++++++++++++++++ legacy-libs/node-pre-gyp/lib/util/compile.js | 87 + .../node-pre-gyp/lib/util/handle_gyp_opts.js | 103 + legacy-libs/node-pre-gyp/lib/util/napi.js | 205 ++ .../node-pre-gyp/lib/util/nw-pre-gyp/index.html | 26 + .../node-pre-gyp/lib/util/nw-pre-gyp/package.json | 9 + legacy-libs/node-pre-gyp/lib/util/s3_setup.js | 27 + legacy-libs/node-pre-gyp/lib/util/versioning.js | 331 +++ .../node-pre-gyp/node_modules/minimist/LICENSE | 18 + .../node_modules/minimist/example/parse.js | 2 + .../node-pre-gyp/node_modules/minimist/index.js | 245 +++ .../node_modules/minimist/package.json | 118 + .../node_modules/minimist/readme.markdown | 95 + .../node_modules/minimist/test/all_bool.js | 32 + .../node_modules/minimist/test/bool.js | 178 ++ .../node_modules/minimist/test/dash.js | 31 + .../node_modules/minimist/test/default_bool.js | 35 + .../node_modules/minimist/test/dotted.js | 22 + .../node_modules/minimist/test/kv_short.js | 16 + .../node_modules/minimist/test/long.js | 31 + .../node-pre-gyp/node_modules/minimist/test/num.js | 36 + .../node_modules/minimist/test/parse.js | 197 ++ .../node_modules/minimist/test/parse_modified.js | 9 + .../node_modules/minimist/test/proto.js | 44 + .../node_modules/minimist/test/short.js | 67 + .../node_modules/minimist/test/stop_early.js | 15 + .../node_modules/minimist/test/unknown.js | 102 + .../node_modules/minimist/test/whitespace.js | 8 + .../node-pre-gyp/node_modules/mkdirp/LICENSE | 21 + .../node-pre-gyp/node_modules/mkdirp/bin/cmd.js | 33 + .../node-pre-gyp/node_modules/mkdirp/bin/usage.txt | 12 + .../node-pre-gyp/node_modules/mkdirp/index.js | 99 + .../node-pre-gyp/node_modules/mkdirp/package.json | 107 + .../node_modules/mkdirp/readme.markdown | 100 + .../node-pre-gyp/node_modules/nopt/CHANGELOG.md | 58 + legacy-libs/node-pre-gyp/node_modules/nopt/LICENSE | 15 + .../node-pre-gyp/node_modules/nopt/README.md | 213 ++ .../node-pre-gyp/node_modules/nopt/bin/nopt.js | 54 + .../node-pre-gyp/node_modules/nopt/lib/nopt.js | 441 ++++ .../node-pre-gyp/node_modules/nopt/package.json | 125 ++ .../node-pre-gyp/node_modules/safe-buffer/LICENSE | 21 + .../node_modules/safe-buffer/README.md | 584 +++++ .../node_modules/safe-buffer/index.d.ts | 187 ++ .../node-pre-gyp/node_modules/safe-buffer/index.js | 65 + .../node_modules/safe-buffer/package.json | 121 + legacy-libs/node-pre-gyp/node_modules/tar/LICENSE | 15 + .../node-pre-gyp/node_modules/tar/README.md | 954 ++++++++ legacy-libs/node-pre-gyp/node_modules/tar/index.js | 18 + .../node-pre-gyp/node_modules/tar/lib/buffer.js | 11 + .../node-pre-gyp/node_modules/tar/lib/create.js | 105 + .../node-pre-gyp/node_modules/tar/lib/extract.js | 112 + .../node-pre-gyp/node_modules/tar/lib/header.js | 289 +++ .../node_modules/tar/lib/high-level-opt.js | 29 + .../node_modules/tar/lib/large-numbers.js | 97 + .../node-pre-gyp/node_modules/tar/lib/list.js | 130 ++ .../node-pre-gyp/node_modules/tar/lib/mkdir.js | 206 ++ .../node-pre-gyp/node_modules/tar/lib/mode-fix.js | 14 + .../node-pre-gyp/node_modules/tar/lib/pack.js | 404 ++++ .../node-pre-gyp/node_modules/tar/lib/parse.js | 428 ++++ .../node-pre-gyp/node_modules/tar/lib/pax.js | 146 ++ .../node_modules/tar/lib/read-entry.js | 98 + .../node-pre-gyp/node_modules/tar/lib/replace.js | 220 ++ .../node-pre-gyp/node_modules/tar/lib/types.js | 44 + .../node-pre-gyp/node_modules/tar/lib/unpack.js | 621 ++++++ .../node-pre-gyp/node_modules/tar/lib/update.js | 36 + .../node_modules/tar/lib/warn-mixin.js | 14 + .../node-pre-gyp/node_modules/tar/lib/winchars.js | 23 + .../node_modules/tar/lib/write-entry.js | 422 ++++ .../node-pre-gyp/node_modules/tar/package.json | 150 ++ .../node-pre-gyp/node_modules/yallist/LICENSE | 15 + .../node-pre-gyp/node_modules/yallist/README.md | 204 ++ .../node-pre-gyp/node_modules/yallist/iterator.js | 8 + .../node-pre-gyp/node_modules/yallist/package.json | 109 + .../node-pre-gyp/node_modules/yallist/yallist.js | 426 ++++ legacy-libs/node-pre-gyp/package.json | 161 ++ 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/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1300 files changed, 15789 insertions(+), 1203 deletions(-) create mode 100644 legacy-libs/node-pre-gyp/CHANGELOG.md create mode 100644 legacy-libs/node-pre-gyp/LICENSE create mode 100644 legacy-libs/node-pre-gyp/README.md create mode 100644 legacy-libs/node-pre-gyp/appveyor.yml create mode 100644 legacy-libs/node-pre-gyp/bin/node-pre-gyp create mode 100644 legacy-libs/node-pre-gyp/bin/node-pre-gyp.cmd create mode 100644 legacy-libs/node-pre-gyp/contributing.md create mode 100644 legacy-libs/node-pre-gyp/lib/build.js create mode 100644 legacy-libs/node-pre-gyp/lib/clean.js create mode 100644 legacy-libs/node-pre-gyp/lib/configure.js create mode 100644 legacy-libs/node-pre-gyp/lib/info.js create mode 100644 legacy-libs/node-pre-gyp/lib/install.js create mode 100644 legacy-libs/node-pre-gyp/lib/node-pre-gyp.js create mode 100644 legacy-libs/node-pre-gyp/lib/package.js create mode 100644 legacy-libs/node-pre-gyp/lib/pre-binding.js create mode 100644 legacy-libs/node-pre-gyp/lib/publish.js create mode 100644 legacy-libs/node-pre-gyp/lib/rebuild.js create mode 100644 legacy-libs/node-pre-gyp/lib/reinstall.js create mode 100644 legacy-libs/node-pre-gyp/lib/reveal.js create mode 100644 legacy-libs/node-pre-gyp/lib/testbinary.js create mode 100644 legacy-libs/node-pre-gyp/lib/testpackage.js create mode 100644 legacy-libs/node-pre-gyp/lib/unpublish.js create mode 100644 legacy-libs/node-pre-gyp/lib/util/abi_crosswalk.json create mode 100644 legacy-libs/node-pre-gyp/lib/util/compile.js create mode 100644 legacy-libs/node-pre-gyp/lib/util/handle_gyp_opts.js create mode 100644 legacy-libs/node-pre-gyp/lib/util/napi.js create mode 100644 legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/index.html create mode 100644 legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/package.json create mode 100644 legacy-libs/node-pre-gyp/lib/util/s3_setup.js create mode 100644 legacy-libs/node-pre-gyp/lib/util/versioning.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/example/parse.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/index.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/readme.markdown create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/all_bool.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/bool.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/dash.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/default_bool.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/dotted.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/kv_short.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/long.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/num.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/parse.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/parse_modified.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/proto.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/short.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/stop_early.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/unknown.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/minimist/test/whitespace.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/cmd.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/usage.txt create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/index.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/mkdirp/readme.markdown create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/CHANGELOG.md create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/README.md create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/bin/nopt.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/lib/nopt.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/nopt/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/safe-buffer/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/safe-buffer/README.md create mode 100644 legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.d.ts create mode 100644 legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/safe-buffer/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/README.md create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/index.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/buffer.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/create.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/extract.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/header.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/high-level-opt.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/large-numbers.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/list.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/mkdir.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/mode-fix.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/pack.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/parse.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/pax.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/read-entry.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/replace.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/types.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/unpack.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/update.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/warn-mixin.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/winchars.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/lib/write-entry.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/tar/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/yallist/LICENSE create mode 100644 legacy-libs/node-pre-gyp/node_modules/yallist/README.md create mode 100644 legacy-libs/node-pre-gyp/node_modules/yallist/iterator.js create mode 100644 legacy-libs/node-pre-gyp/node_modules/yallist/package.json create mode 100644 legacy-libs/node-pre-gyp/node_modules/yallist/yallist.js create mode 100644 legacy-libs/node-pre-gyp/package.json diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 07dd1bf..7e596a1 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-23T16:45:08.982Z", + "time": "2022-06-23T17:04:56.422Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 1d7a040..d5ebecb 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-23T16:45:08.982Z", + "time": "2022-06-23T17:04:56.422Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/node-pre-gyp/CHANGELOG.md b/legacy-libs/node-pre-gyp/CHANGELOG.md new file mode 100644 index 0000000..83836fd --- /dev/null +++ b/legacy-libs/node-pre-gyp/CHANGELOG.md @@ -0,0 +1,453 @@ +# node-pre-gyp changelog + +## 0.16.0 + +- Added Node 15 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/520) + +## 0.15.0 + +- Bump dependency on `mkdirp` from `^0.5.1` to `^0.5.3` (https://github.com/mapbox/node-pre-gyp/pull/492) +- Bump dependency on `needle` from `^2.2.1` to `^2.5.0` (https://github.com/mapbox/node-pre-gyp/pull/502) +- Added Node 14 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/501) + +## 0.14.0 + +- Defer modules requires in napi.js (https://github.com/mapbox/node-pre-gyp/pull/434) +- Bump dependency on `tar` from `^4` to `^4.4.2` (https://github.com/mapbox/node-pre-gyp/pull/454) +- Support extracting compiled binary from local offline mirror (https://github.com/mapbox/node-pre-gyp/pull/459) +- Added Node 13 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/483) + +## 0.13.0 + +- Added Node 12 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/449) + +## 0.12.0 + +- Fixed double-build problem with node v10 (https://github.com/mapbox/node-pre-gyp/pull/428) +- Added node 11 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/422) + +## 0.11.0 + +- Fixed double-install problem with node v10 +- Significant N-API improvements (https://github.com/mapbox/node-pre-gyp/pull/405) + +## 0.10.3 + +- Now will use `request` over `needle` if request is installed. By default `needle` is used for `https`. This should unbreak proxy support that regressed in v0.9.0 + +## 0.10.2 + +- Fixed rc/deep-extent security vulnerability +- Fixed broken reinstall script do to incorrectly named get_best_napi_version + +## 0.10.1 + +- Fix needle error event (@medns) + +## 0.10.0 + +- Allow for a single-level module path when packing @allenluce (https://github.com/mapbox/node-pre-gyp/pull/371) +- Log warnings instead of errors when falling back @xzyfer (https://github.com/mapbox/node-pre-gyp/pull/366) +- Add Node.js v10 support to tests (https://github.com/mapbox/node-pre-gyp/pull/372) +- Remove retire.js from CI (https://github.com/mapbox/node-pre-gyp/pull/372) +- Remove support for Node.js v4 due to [EOL on April 30th, 2018](https://github.com/nodejs/Release/blob/7dd52354049cae99eed0e9fe01345b0722a86fde/schedule.json#L14) +- Update appveyor tests to install default NPM version instead of NPM v2.x for all Windows builds (https://github.com/mapbox/node-pre-gyp/pull/375) + +## 0.9.1 + +- Fixed regression (in v0.9.0) with support for http redirects @allenluce (https://github.com/mapbox/node-pre-gyp/pull/361) + +## 0.9.0 + +- Switched from using `request` to `needle` to reduce size of module deps (https://github.com/mapbox/node-pre-gyp/pull/350) + +## 0.8.0 + +- N-API support (@inspiredware) + +## 0.7.1 + +- Upgraded to tar v4.x + +## 0.7.0 + + - Updated request and hawk (#347) + - Dropped node v0.10.x support + +## 0.6.40 + + - Improved error reporting if an install fails + +## 0.6.39 + + - Support for node v9 + - Support for versioning on `{libc}` to allow binaries to work on non-glic linux systems like alpine linux + + +## 0.6.38 + + - Maintaining compatibility (for v0.6.x series) with node v0.10.x + +## 0.6.37 + + - Solved one part of #276: now now deduce the node ABI from the major version for node >= 2 even when not stored in the abi_crosswalk.json + - Fixed docs to avoid mentioning the deprecated and dangerous `prepublish` in package.json (#291) + - Add new node versions to crosswalk + - Ported tests to use tape instead of mocha + - Got appveyor tests passing by downgrading npm and node-gyp + +## 0.6.36 + + - Removed the running of `testbinary` during install. Because this was regressed for so long, it is too dangerous to re-enable by default. Developers needing validation can call `node-pre-gyp testbinary` directory. + - Fixed regression in v0.6.35 for electron installs (now skipping binary validation which is not yet supported for electron) + +## 0.6.35 + + - No longer recommending `npm ls` in `prepublish` (#291) + - Fixed testbinary command (#283) @szdavid92 + +## 0.6.34 + + - Added new node versions to crosswalk, including v8 + - Upgraded deps to latest versions, started using `^` instead of `~` for all deps. + +## 0.6.33 + + - Improved support for yarn + +## 0.6.32 + + - Honor npm configuration for CA bundles (@heikkipora) + - Add node-pre-gyp and npm versions to user agent (@addaleax) + - Updated various deps + - Add known node version for v7.x + +## 0.6.31 + + - Updated various deps + +## 0.6.30 + + - Update to npmlog@4.x and semver@5.3.x + - Add known node version for v6.5.0 + +## 0.6.29 + + - Add known node versions for v0.10.45, v0.12.14, v4.4.4, v5.11.1, and v6.1.0 + +## 0.6.28 + + - Now more verbose when remote binaries are not available. This is needed since npm is increasingly more quiet by default + and users need to know why builds are falling back to source compiles that might then error out. + +## 0.6.27 + + - Add known node version for node v6 + - Stopped bundling dependencies + - Documented method for module authors to avoid bundling node-pre-gyp + - See https://github.com/mapbox/node-pre-gyp/tree/master#configuring for details + +## 0.6.26 + + - Skip validation for nw runtime (https://github.com/mapbox/node-pre-gyp/pull/181) via @fleg + +## 0.6.25 + + - Improved support for auto-detection of electron runtime in `node-pre-gyp.find()` + - Pull request from @enlight - https://github.com/mapbox/node-pre-gyp/pull/187 + - Add known node version for 4.4.1 and 5.9.1 + +## 0.6.24 + + - Add known node version for 5.8.0, 5.9.0, and 4.4.0. + +## 0.6.23 + + - Add known node version for 0.10.43, 0.12.11, 4.3.2, and 5.7.1. + +## 0.6.22 + + - Add known node version for 4.3.1, and 5.7.0. + +## 0.6.21 + + - Add known node version for 0.10.42, 0.12.10, 4.3.0, and 5.6.0. + +## 0.6.20 + + - Add known node version for 4.2.5, 4.2.6, 5.4.0, 5.4.1,and 5.5.0. + +## 0.6.19 + + - Add known node version for 4.2.4 + +## 0.6.18 + + - Add new known node versions for 0.10.x, 0.12.x, 4.x, and 5.x + +## 0.6.17 + + - Re-tagged to fix packaging problem of `Error: Cannot find module 'isarray'` + +## 0.6.16 + + - Added known version in crosswalk for 5.1.0. + +## 0.6.15 + + - Upgraded tar-pack (https://github.com/mapbox/node-pre-gyp/issues/182) + - Support custom binary hosting mirror (https://github.com/mapbox/node-pre-gyp/pull/170) + - Added known version in crosswalk for 4.2.2. + +## 0.6.14 + + - Added node 5.x version + +## 0.6.13 + + - Added more known node 4.x versions + +## 0.6.12 + + - Added support for [Electron](http://electron.atom.io/). Just pass the `--runtime=electron` flag when building/installing. Thanks @zcbenz + +## 0.6.11 + + - Added known node and io.js versions including more 3.x and 4.x versions + +## 0.6.10 + + - Added known node and io.js versions including 3.x and 4.x versions + - Upgraded `tar` dep + +## 0.6.9 + + - Upgraded `rc` dep + - Updated known io.js version: v2.4.0 + +## 0.6.8 + + - Upgraded `semver` and `rimraf` deps + - Updated known node and io.js versions + +## 0.6.7 + + - Fixed `node_abi` versions for io.js 1.1.x -> 1.8.x (should be 43, but was stored as 42) (refs https://github.com/iojs/build/issues/94) + +## 0.6.6 + + - Updated with known io.js 2.0.0 version + +## 0.6.5 + + - Now respecting `npm_config_node_gyp` (https://github.com/npm/npm/pull/4887) + - Updated to semver@4.3.2 + - Updated known node v0.12.x versions and io.js 1.x versions. + +## 0.6.4 + + - Improved support for `io.js` (@fengmk2) + - Test coverage improvements (@mikemorris) + - Fixed support for `--dist-url` that regressed in 0.6.3 + +## 0.6.3 + + - Added support for passing raw options to node-gyp using `--` separator. Flags passed after + the `--` to `node-pre-gyp configure` will be passed directly to gyp while flags passed + after the `--` will be passed directly to make/visual studio. + - Added `node-pre-gyp configure` command to be able to call `node-gyp configure` directly + - Fix issue with require validation not working on windows 7 (@edgarsilva) + +## 0.6.2 + + - Support for io.js >= v1.0.2 + - Deferred require of `request` and `tar` to help speed up command line usage of `node-pre-gyp`. + +## 0.6.1 + + - Fixed bundled `tar` version + +## 0.6.0 + + - BREAKING: node odd releases like v0.11.x now use `major.minor.patch` for `{node_abi}` instead of `NODE_MODULE_VERSION` (#124) + - Added support for `toolset` option in versioning. By default is an empty string but `--toolset` can be passed to publish or install to select alternative binaries that target a custom toolset like C++11. For example to target Visual Studio 2014 modules like node-sqlite3 use `--toolset=v140`. + - Added support for `--no-rollback` option to request that a failed binary test does not remove the binary module leaves it in place. + - Added support for `--update-binary` option to request an existing binary be re-installed and the check for a valid local module be skipped. + - Added support for passing build options from `npm` through `node-pre-gyp` to `node-gyp`: `--nodedir`, `--disturl`, `--python`, and `--msvs_version` + +## 0.5.31 + + - Added support for deducing node_abi for node.js runtime from previous release if the series is even + - Added support for --target=0.10.33 + +## 0.5.30 + + - Repackaged with latest bundled deps + +## 0.5.29 + + - Added support for semver `build`. + - Fixed support for downloading from urls that include `+`. + +## 0.5.28 + + - Now reporting unix style paths only in reveal command + +## 0.5.27 + + - Fixed support for auto-detecting s3 bucket name when it contains `.` - @taavo + - Fixed support for installing when path contains a `'` - @halfdan + - Ported tests to mocha + +## 0.5.26 + + - Fix node-webkit support when `--target` option is not provided + +## 0.5.25 + + - Fix bundling of deps + +## 0.5.24 + + - Updated ABI crosswalk to incldue node v0.10.30 and v0.10.31 + +## 0.5.23 + + - Added `reveal` command. Pass no options to get all versioning data as json. Pass a second arg to grab a single versioned property value + - Added support for `--silent` (shortcut for `--loglevel=silent`) + +## 0.5.22 + + - Fixed node-webkit versioning name (NOTE: node-webkit support still experimental) + +## 0.5.21 + + - New package to fix `shasum check failed` error with v0.5.20 + +## 0.5.20 + + - Now versioning node-webkit binaries based on major.minor.patch - assuming no compatible ABI across versions (#90) + +## 0.5.19 + + - Updated to know about more node-webkit releases + +## 0.5.18 + + - Updated to know about more node-webkit releases + +## 0.5.17 + + - Updated to know about node v0.10.29 release + +## 0.5.16 + + - Now supporting all aws-sdk configuration parameters (http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) (#86) + +## 0.5.15 + + - Fixed installation of windows packages sub directories on unix systems (#84) + +## 0.5.14 + + - Finished support for cross building using `--target_platform` option (#82) + - Now skipping binary validation on install if target arch/platform do not match the host. + - Removed multi-arch validing for OS X since it required a FAT node.js binary + +## 0.5.13 + + - Fix problem in 0.5.12 whereby the wrong versions of mkdirp and semver where bundled. + +## 0.5.12 + + - Improved support for node-webkit (@Mithgol) + +## 0.5.11 + + - Updated target versions listing + +## 0.5.10 + + - Fixed handling of `-debug` flag passed directory to node-pre-gyp (#72) + - Added optional second arg to `node_pre_gyp.find` to customize the default versioning options used to locate the runtime binary + - Failed install due to `testbinary` check failure no longer leaves behind binary (#70) + +## 0.5.9 + + - Fixed regression in `testbinary` command causing installs to fail on windows with 0.5.7 (#60) + +## 0.5.8 + + - Started bundling deps + +## 0.5.7 + + - Fixed the `testbinary` check, which is used to determine whether to re-download or source compile, to work even in complex dependency situations (#63) + - Exposed the internal `testbinary` command in node-pre-gyp command line tool + - Fixed minor bug so that `fallback_to_build` option is always respected + +## 0.5.6 + + - Added support for versioning on the `name` value in `package.json` (#57). + - Moved to using streams for reading tarball when publishing (#52) + +## 0.5.5 + + - Improved binary validation that also now works with node-webkit (@Mithgol) + - Upgraded test apps to work with node v0.11.x + - Improved test coverage + +## 0.5.4 + + - No longer depends on external install of node-gyp for compiling builds. + +## 0.5.3 + + - Reverted fix for debian/nodejs since it broke windows (#45) + +## 0.5.2 + + - Support for debian systems where the node binary is named `nodejs` (#45) + - Added `bin/node-pre-gyp.cmd` to be able to run command on windows locally (npm creates an .npm automatically when globally installed) + - Updated abi-crosswalk with node v0.10.26 entry. + +## 0.5.1 + + - Various minor bug fixes, several improving windows support for publishing. + +## 0.5.0 + + - Changed property names in `binary` object: now required are `module_name`, `module_path`, and `host`. + - Now `module_path` supports versioning, which allows developers to opt-in to using a versioned install path (#18). + - Added `remote_path` which also supports versioning. + - Changed `remote_uri` to `host`. + +## 0.4.2 + + - Added support for `--target` flag to request cross-compile against a specific node/node-webkit version. + - Added preliminary support for node-webkit + - Fixed support for `--target_arch` option being respected in all cases. + +## 0.4.1 + + - Fixed exception when only stderr is available in binary test (@bendi / #31) + +## 0.4.0 + + - Enforce only `https:` based remote publishing access. + - Added `node-pre-gyp info` command to display listing of published binaries + - Added support for changing the directory node-pre-gyp should build in with the `-C/--directory` option. + - Added support for S3 prefixes. + +## 0.3.1 + + - Added `unpublish` command. + - Fixed module path construction in tests. + - Added ability to disable falling back to build behavior via `npm install --fallback-to-build=false` which overrides setting in a depedencies package.json `install` target. + +## 0.3.0 + + - Support for packaging all files in `module_path` directory - see `app4` for example + - Added `testpackage` command. + - Changed `clean` command to only delete `.node` not entire `build` directory since node-gyp will handle that. + - `.node` modules must be in a folder of there own since tar-pack will remove everything when it unpacks. diff --git a/legacy-libs/node-pre-gyp/LICENSE b/legacy-libs/node-pre-gyp/LICENSE new file mode 100644 index 0000000..8f5fce9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/LICENSE @@ -0,0 +1,27 @@ +Copyright (c), Mapbox + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of node-pre-gyp nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/legacy-libs/node-pre-gyp/README.md b/legacy-libs/node-pre-gyp/README.md new file mode 100644 index 0000000..088f2af --- /dev/null +++ b/legacy-libs/node-pre-gyp/README.md @@ -0,0 +1,693 @@ +# node-pre-gyp + +#### node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries + +[![NPM](https://nodei.co/npm/node-pre-gyp.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-pre-gyp/) + +[![Build Status](https://api.travis-ci.org/mapbox/node-pre-gyp.svg)](https://travis-ci.org/mapbox/node-pre-gyp) +[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp) +[![Dependencies](https://david-dm.org/mapbox/node-pre-gyp.svg)](https://david-dm.org/mapbox/node-pre-gyp) + +`node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment. + +### Features + + - A command line tool called `node-pre-gyp` that can install your package's C++ module from a binary. + - A variety of developer targeted commands for packaging, testing, and publishing binaries. + - A JavaScript module that can dynamically require your installed binary: `require('node-pre-gyp').find` + +For a hello world example of a module packaged with `node-pre-gyp` see and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples. + +## Credits + + - The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate) + - Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost). + - Development is sponsored by [Mapbox](https://www.mapbox.com/) + +## FAQ + +See the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ). + +## Depends + + - Node.js >= node v6.x + +## Install + +`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like: + + ./node_modules/.bin/node-pre-gyp --help + +But you can also install it globally: + + npm install node-pre-gyp -g + +## Usage + +### Commands + +View all possible commands: + + node-pre-gyp --help + +- clean - Remove the entire folder containing the compiled .node module +- install - Install pre-built binary for module +- reinstall - Run "clean" and "install" at once +- build - Compile the module by dispatching to node-gyp or nw-gyp +- rebuild - Run "clean" and "build" at once +- package - Pack binary into tarball +- testpackage - Test that the staged package is valid +- publish - Publish pre-built binary +- unpublish - Unpublish pre-built binary +- info - Fetch info on published binaries + +You can also chain commands: + + node-pre-gyp clean build unpublish publish info + +### Options + +Options include: + + - `-C/--directory`: run the command in this directory + - `--build-from-source`: build from source instead of using pre-built binary + - `--update-binary`: reinstall by replacing previously installed local binary with remote binary + - `--runtime=node-webkit`: customize the runtime: `node`, `electron` and `node-webkit` are the valid options + - `--fallback-to-build`: fallback to building from source if pre-built binary is not available + - `--target=0.4.0`: Pass the target node or node-webkit version to compile against + - `--target_arch=ia32`: Pass the target arch and override the host `arch`. Valid values are 'ia32','x64', or `arm`. + - `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`. + +Both `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module. + +For example: `npm install --build-from-source=myapp`. This is useful if: + + - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`. + - The larger app also depends on other modules installed with `node-pre-gyp` + - You only want to trigger a source compile for `myapp` and the other modules. + +### Configuring + +This is a guide to configuring your module to use node-pre-gyp. + +#### 1) Add new entries to your `package.json` + + - Add `node-pre-gyp` to `dependencies` + - Add `aws-sdk` as a `devDependency` + - Add a custom `install` script + - Declare a `binary` object + +This looks like: + +```js + "dependencies" : { + "node-pre-gyp": "0.6.x" + }, + "devDependencies": { + "aws-sdk": "2.x" + } + "scripts": { + "install": "node-pre-gyp install --fallback-to-build" + }, + "binary": { + "module_name": "your_module", + "module_path": "./lib/binding/", + "host": "https://your_module.s3-us-west-1.amazonaws.com" + } +``` + +For a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/master/package.json). + +Let's break this down: + + - Dependencies need to list `node-pre-gyp` + - Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries + - Your `scripts` section should override the `install` target with `"install": "node-pre-gyp install --fallback-to-build"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly. + - Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below. + +Note: in the past we recommended putting `node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908. + +##### The `binary` object has three required properties + +###### module_name + +The name of your native node module. This value must: + + - Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world) + - Must be a valid C variable name (e.g. it cannot contain `-`) + - Should not include the `.node` extension. + +###### module_path + +The location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball. + +Note: This property supports variables based on [Versioning](#versioning). + +###### host + +A url to the remote location where you've published tarball binaries (must be `https` not `http`). + +It is highly recommended that you use Amazon S3. The reasons are: + + - Various node-pre-gyp commands like `publish` and `info` only work with an S3 host. + - S3 is a very solid hosting platform for distributing large files. + - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp. + +Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible. + +It should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```. + +##### The `binary` object has two optional properties + +###### remote_path + +It **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `""` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`. + +Note: This property supports variables based on [Versioning](#versioning). + +###### package_name + +It is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`. + +Avoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like: + +```sh +aws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/ +``` + +Note: This property supports variables based on [Versioning](#versioning). + +#### 2) Add a new target to binding.gyp + +`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path). + +A new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`. + +Add a target like this at the end of your `targets` list: + +```js + { + "target_name": "action_after_build", + "type": "none", + "dependencies": [ "<(module_name)" ], + "copies": [ + { + "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], + "destination": "<(module_path)" + } + ] + } +``` + +For a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp). + +#### 3) Dynamically require your `.node` + +Inside the main js file that requires your addon module you are likely currently doing: + +```js +var binding = require('../build/Release/binding.node'); +``` + +or: + +```js +var bindings = require('./bindings') +``` + +Change those lines to: + +```js +var binary = require('node-pre-gyp'); +var path = require('path'); +var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); +var binding = require(binding_path); +``` + +For a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4) + +#### 4) Build and package your app + +Now build your module from source: + + npm install --build-from-source + +The `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build. + +Now `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`. + +#### 5) Test + +Now `npm test` should work just as it did before. + +#### 6) Publish the tarball + +Then package your app: + + ./node_modules/.bin/node-pre-gyp package + +Once packaged, now you can publish: + + ./node_modules/.bin/node-pre-gyp publish + +Currently the `publish` command pushes your binary to S3. This requires: + + - You have installed `aws-sdk` with `npm install aws-sdk` + - You have created a bucket already. + - The `host` points to an S3 http or https endpoint. + - You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details). + +You can also host your binaries elsewhere. To do this requires: + + - You manually publish the binary created by the `package` command to an `https` endpoint + - Ensure that the `host` value points to your custom `https` endpoint. + +#### 7) Automate builds + +Now you need to publish builds for all the platforms and node versions you wish to support. This is best automated. + + - See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows. + - See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux. + +#### 8) You're done! + +Now publish your module to the npm registry. Users will now be able to install your module from a binary. + +What will happen is this: + +1. `npm install ` will pull from the npm registry +2. npm will run the `install` script which will call out to `node-pre-gyp` +3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place +4. Assuming that all worked, you are done + +If a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module. + +## N-API Considerations + +[N-API](https://nodejs.org/api/n-api.html#n_api_n_api) is an ABI-stable alternative to previous technologies such as [nan](https://github.com/nodejs/nan) which are tied to a specific Node runtime engine. N-API is Node runtime engine agnostic and guarantees modules created today will continue to run, without changes, into the future. + +Using `node-pre-gyp` with N-API projects requires a handful of additional configuration values and imposes some additional requirements. + +The most significant difference is that an N-API module can be coded to target multiple N-API versions. Therefore, an N-API module must declare in its `package.json` file which N-API versions the module is designed to run against. In addition, since multiple builds may be required for a single module, path and file names must be specified in way that avoids naming conflicts. + +### The `napi_versions` array property + +An N-API modules must declare in its `package.json` file, the N-API versions the module is intended to support. This is accomplished by including an `napi-versions` array property in the `binary` object. For example: + +```js +"binary": { + "module_name": "your_module", + "module_path": "your_module_path", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +If the `napi_versions` array property is *not* present, `node-pre-gyp` operates as it always has. Including the `napi_versions` array property instructs `node-pre-gyp` that this is a N-API module build. + +When the `napi_versions` array property is present, `node-pre-gyp` fires off multiple operations, one for each of the N-API versions in the array. In the example above, two operations are initiated, one for N-API version 1 and second for N-API version 3. How this version number is communicated is described next. + +### The `napi_build_version` value + +For each of the N-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately. + +This value is of importance in two areas: + +1. The C/C++ code which needs to know against which N-API version it should compile. +2. `node-pre-gyp` itself which must assign appropriate path and file names to avoid collisions. + +### Defining `NAPI_VERSION` for the C/C++ code + +The `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file: + +``` +"defines": [ + "NAPI_VERSION=<(napi_build_version)", +] +``` + +This ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build. + +> Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is prefered because it used by the N-API C/C++ headers to configure the specific N-API veriosn being requested. + +### Path and file naming requirements in `package.json` + +Since `node-pre-gyp` fires off multiple operations for each request, it is essential that path and file names be created in such a way as to avoid collisions. This is accomplished by imposing additional path and file naming requirements. + +Specifically, when performing N-API builds, the `{napi_build_version}` text configuration value *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.) + +Here's an example: + +```js +"binary": { + "module_name": "your_module", + "module_path": "./lib/binding/napi-v{napi_build_version}", + "remote_path": "./{module_name}/v{version}/{configuration}/", + "package_name": "{platform}-{arch}-napi-v{napi_build_version}.tar.gz", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +## Supporting both N-API and NAN builds + +You may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support N-API, as you add N-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property. + +Placing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, `node-pre-gyp` will request a traditional, non-N-API build. + +The configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For N-API builds, the string contains the N-API version nad has values like `napi-v3`. For traditional, non-N-API builds, the string contains the ABI version with values like `node-v46`. + +Here's how the `binary` configuration above might be changed to support both N-API and NAN builds: + +```js +"binary": { + "module_name": "your_module", + "module_path": "./lib/binding/{node_napi_label}", + "remote_path": "./{module_name}/v{version}/{configuration}/", + "package_name": "{platform}-{arch}-{node_napi_label}.tar.gz", + "host": "https://your_bucket.s3-us-west-1.amazonaws.com", + "napi_versions": [1,3] + } +``` + +The C/C++ symbol `NAPI_VERSION` can be used to distinguish N-API and non-N-API builds. The value of `NAPI_VERSION` is set to the integer N-API version for N-API builds and is set to `0` for non-N-API builds. + +For example: + +```C +#if NAPI_VERSION +// N-API code goes here +#else +// NAN code goes here +#endif +``` + +### Two additional configuration values + +The following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above. + +1. `napi_version` If N-API is supported by the currently executing Node instance, this value is the N-API version number supported by Node. If N-API is not supported, this value is an empty string. + +2. `node_abi_napi` If the value returned for `napi_version` is non empty, this value is `'napi'`. If the value returned for `napi_version` is empty, this value is the value returned for `node_abi`. + +These values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substituion in the `binary` properties of the `package.json` file. + +## S3 Hosting + +You can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [Travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu, and with [Appveyor](http://appveyor.com) to automate builds for Windows. Here is an approach to do this: + +First, get setup locally and test the workflow: + +#### 1) Create an S3 bucket + +And have your **key** and **secret key** ready for writing to the bucket. + +It is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like: + +```js +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "Stmt1394587197000", + "Effect": "Allow", + "Action": [ + "s3:DeleteObject", + "s3:GetObject", + "s3:GetObjectAcl", + "s3:ListBucket", + "s3:PutObject", + "s3:PutObjectAcl" + ], + "Resource": [ + "arn:aws:s3:::node-pre-gyp-tests/*" + ] + } + ] +} +``` + +#### 2) Install node-pre-gyp + +Either install it globally: + + npm install node-pre-gyp -g + +Or put the local version on your PATH + + export PATH=`pwd`/node_modules/.bin/:$PATH + +#### 3) Configure AWS credentials + +There are several ways to do this. + +You can use any of the methods described at http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html. + +Or you can create a `~/.node_pre_gyprc` + +Or pass options in any way supported by [RC](https://github.com/dominictarr/rc#standards) + +A `~/.node_pre_gyprc` looks like: + +```js +{ + "accessKeyId": "xxx", + "secretAccessKey": "xxx" +} +``` + +Another way is to use your environment: + + export node_pre_gyp_accessKeyId=xxx + export node_pre_gyp_secretAccessKey=xxx + +You may also need to specify the `region` if it is not explicit in the `host` value you use. The `bucket` can also be specified but it is optional because `node-pre-gyp` will detect it from the `host` value. + +#### 4) Package and publish your build + +Install the `aws-sdk`: + + npm install aws-sdk + +Then publish: + + node-pre-gyp package publish + +Note: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config. + +## Appveyor Automation + +[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports: + + - Windows Visual Studio 2013 and related compilers + - Both 64 bit (x64) and 32 bit (x86) build configurations + - Multiple Node.js versions + +For an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml). + +Below is a guide to getting set up: + +#### 1) Create a free Appveyor account + +Go to https://ci.appveyor.com/signup/free and sign in with your GitHub account. + +#### 2) Create a new project + +Go to https://ci.appveyor.com/projects/new and select the GitHub repo for your module + +#### 3) Add appveyor.yml and push it + +Once you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your GitHub repo and pushed it AppVeyor should automatically start building your project. + +#### 4) Create secure variables + +Encrypt your S3 AWS keys by going to and hitting the `encrypt` button. + +Then paste the result into your `appveyor.yml` + +```yml +environment: + node_pre_gyp_accessKeyId: + secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA= + node_pre_gyp_secretAccessKey: + secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL +``` + +NOTE: keys are per account but not per repo (this is difference than Travis where keys are per repo but not related to the account used to encrypt them). + +#### 5) Hook up publishing + +Just put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`. + +#### 6) Publish when you want + +You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`: + + SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE% + if not "%CM%" == "%CM:[publish binary]=%" node-pre-gyp --msvs_version=2013 publish + +If your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`: + + ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish } + +Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. + +## Travis Automation + +[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both: + + - Ubuntu Precise and OS X (64 bit) + - Multiple Node.js versions + +For an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml). + +Note: if you need 32 bit binaries, this can be done from a 64 bit Travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74). + +Below is a guide to getting set up: + +#### 1) Install the Travis gem + + gem install travis + +#### 2) Create secure variables + +Make sure you run this command from within the directory of your module. + +Use `travis-encrypt` like: + + travis encrypt node_pre_gyp_accessKeyId=${node_pre_gyp_accessKeyId} + travis encrypt node_pre_gyp_secretAccessKey=${node_pre_gyp_secretAccessKey} + +Then put those values in your `.travis.yml` like: + +```yaml +env: + global: + - secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M= + - secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI= +``` + +More details on Travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/. + +#### 3) Hook up publishing + +Just put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`. + +##### OS X publishing + +If you want binaries for OS X in addition to linux you can enable [multi-os for Travis](http://docs.travis-ci.com/user/multi-os/#Setting-.travis.yml) + +Use a configuration like: + +```yml + +language: cpp + +os: +- linux +- osx + +env: + matrix: + - NODE_VERSION="4" + - NODE_VERSION="6" + +before_install: +- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm +- source ~/.nvm/nvm.sh +- nvm install $NODE_VERSION +- nvm use $NODE_VERSION +``` + +See [Travis OS X Gotchas](#travis-os-x-gotchas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix. + +Also create platform specific sections for any deps that need install. For example if you need libpng: + +```yml +- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi; +- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi; +``` + +For detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml). + +##### Travis OS X Gotchas + +First, unlike the Travis Linux machines, the OS X machines do not put `node-pre-gyp` on PATH by default. To do so you will need to: + +```sh +export PATH=$(pwd)/node_modules/.bin:${PATH} +``` + +Second, the OS X machines do not support using a matrix for installing different Node.js versions. So you need to bootstrap the installation of Node.js in a cross platform way. + +By doing: + +```yml +env: + matrix: + - NODE_VERSION="4" + - NODE_VERSION="6" + +before_install: + - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm + - source ~/.nvm/nvm.sh + - nvm install $NODE_VERSION + - nvm use $NODE_VERSION +``` + +You can easily recreate the previous behavior of this matrix: + +```yml +node_js: + - "4" + - "6" +``` + +#### 4) Publish when you want + +You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`: + + COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\n') + if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp publish; fi; + +Then you can trigger new binaries to be built like: + + git commit -a -m "[publish binary]" + +Or, if you don't have any changes to make simply run: + + git commit --allow-empty -m "[publish binary]" + +WARNING: if you are working in a pull request and publishing binaries from there then you will want to avoid double publishing when Travis CI builds both the `push` and `pr`. You only want to run the publish on the `push` commit. See https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/is_pr_merge.sh which is called from https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/publish.sh for an example of how to do this. + +Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on Travis see http://about.travis-ci.org/docs/user/deployment/npm/ + +# Versioning + +The `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed. + + - `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version. + - `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override. + - `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override. + - `libc` matches `require('detect-libc').family` like `glibc` or `musl` unless the user passes the `--target_libc` option to override. + - `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build. + - `module_name` - the `binary.module_name` attribute from `package.json`. + - `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property). + - `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version` + - `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that` + - `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta` + + +The options are visible in the code at + +# Download binary files from a mirror + +S3 is broken in China for the well known reason. + +Using the `npm` config argument: `--{module_name}_binary_host_mirror` can download binary files through a mirror. + +e.g.: Install [v8-profiler](https://www.npmjs.com/package/v8-profiler) from `npm`. + +```bash +$ npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ +``` diff --git a/legacy-libs/node-pre-gyp/appveyor.yml b/legacy-libs/node-pre-gyp/appveyor.yml new file mode 100644 index 0000000..2e74dbc --- /dev/null +++ b/legacy-libs/node-pre-gyp/appveyor.yml @@ -0,0 +1,30 @@ +os: Visual Studio 2015 + +environment: + matrix: + - nodejs_version: 6 + - nodejs_version: 10 + +platform: + - x64 + - x86 + +shallow_clone: true + +install: + - ps: Install-Product node $env:nodejs_version $env:Platform + - ps: Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force + - npm config get + - node --version + - npm --version + - node -e "console.log(process.arch);" + - IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH% + - IF /I "%PLATFORM%" == "x86" SET PATH=C:\python27;%PATH% + - IF /I "%PLATFORM%" == "x64" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 + - IF /I "%PLATFORM%" == "x86" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 + - npm install + - npm test + +build: off +test: off +deploy: off diff --git a/legacy-libs/node-pre-gyp/bin/node-pre-gyp b/legacy-libs/node-pre-gyp/bin/node-pre-gyp new file mode 100644 index 0000000..737b002 --- /dev/null +++ b/legacy-libs/node-pre-gyp/bin/node-pre-gyp @@ -0,0 +1,134 @@ +#!/usr/bin/env node + +"use strict"; + +/** + * Set the title. + */ + +process.title = 'node-pre-gyp'; + +/** + * Module dependencies. + */ + +var node_pre_gyp = require('../'); +var log = require('npmlog'); + +/** + * Process and execute the selected commands. + */ + +var prog = new node_pre_gyp.Run(); +var completed = false; +prog.parseArgv(process.argv); + +if (prog.todo.length === 0) { + if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) { + console.log('v%s', prog.version); + return process.exit(0); + } else if (~process.argv.indexOf('-h') || ~process.argv.indexOf('--help')) { + console.log('%s', prog.usage()); + return process.exit(0); + } + console.log('%s', prog.usage()); + return process.exit(1); +} + +// if --no-color is passed +if (prog.opts && prog.opts.hasOwnProperty('color') && !prog.opts.color) { + log.disableColor(); +} + +log.info('it worked if it ends with', 'ok'); +log.verbose('cli', process.argv); +log.info('using', process.title + '@%s', prog.version); +log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch); + + +/** + * Change dir if -C/--directory was passed. + */ + +var dir = prog.opts.directory; +if (dir) { + var fs = require('fs'); + try { + var stat = fs.statSync(dir); + if (stat.isDirectory()) { + log.info('chdir', dir); + process.chdir(dir); + } else { + log.warn('chdir', dir + ' is not a directory'); + } + } catch (e) { + if (e.code === 'ENOENT') { + log.warn('chdir', dir + ' is not a directory'); + } else { + log.warn('chdir', 'error during chdir() "%s"', e.message); + } + } +} + +function run () { + var command = prog.todo.shift(); + if (!command) { + // done! + completed = true; + log.info('ok'); + return; + } + + prog.commands[command.name](command.args, function (err) { + if (err) { + log.error(command.name + ' error'); + log.error('stack', err.stack); + errorMessage(); + log.error('not ok'); + console.log(err.message); + return process.exit(1); + } + var args_array = [].slice.call(arguments, 1); + if (args_array.length) { + console.log.apply(console, args_array); + } + // now run the next command in the queue + process.nextTick(run); + }); +} + +process.on('exit', function (code) { + if (!completed && !code) { + log.error('Completion callback never invoked!'); + issueMessage(); + process.exit(6); + } +}); + +process.on('uncaughtException', function (err) { + log.error('UNCAUGHT EXCEPTION'); + log.error('stack', err.stack); + issueMessage(); + process.exit(7); +}); + +function errorMessage () { + // copied from npm's lib/util/error-handler.js + var os = require('os'); + log.error('System', os.type() + ' ' + os.release()); + log.error('command', process.argv.map(JSON.stringify).join(' ')); + log.error('cwd', process.cwd()); + log.error('node -v', process.version); + log.error(process.title+' -v', 'v' + prog.package.version); +} + +function issueMessage () { + errorMessage(); + log.error('', [ 'This is a bug in `'+process.title+'`.', + 'Try to update '+process.title+' and file an issue if it does not help:', + ' ', + ].join('\n')); +} + +// start running the given commands! +run(); diff --git a/legacy-libs/node-pre-gyp/bin/node-pre-gyp.cmd b/legacy-libs/node-pre-gyp/bin/node-pre-gyp.cmd new file mode 100644 index 0000000..46e14b5 --- /dev/null +++ b/legacy-libs/node-pre-gyp/bin/node-pre-gyp.cmd @@ -0,0 +1,2 @@ +@echo off +node "%~dp0\node-pre-gyp" %* diff --git a/legacy-libs/node-pre-gyp/contributing.md b/legacy-libs/node-pre-gyp/contributing.md new file mode 100644 index 0000000..4038fa6 --- /dev/null +++ b/legacy-libs/node-pre-gyp/contributing.md @@ -0,0 +1,10 @@ +# Contributing + + +### Releasing a new version: + +- Ensure tests are passing on travis and appveyor +- Run `node scripts/abi_crosswalk.js` and commit any changes +- Update the changelog +- Tag a new release like: `git tag -a v0.6.34 -m "tagging v0.6.34" && git push --tags` +- Run `npm publish` diff --git a/legacy-libs/node-pre-gyp/lib/build.js b/legacy-libs/node-pre-gyp/lib/build.js new file mode 100644 index 0000000..43c137e --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/build.js @@ -0,0 +1,51 @@ +"use strict"; + +module.exports = exports = build; + +exports.usage = 'Attempts to compile the module by dispatching to node-gyp or nw-gyp'; + +var napi = require('./util/napi.js'); +var compile = require('./util/compile.js'); +var handle_gyp_opts = require('./util/handle_gyp_opts.js'); +var configure = require('./configure.js'); + +function do_build(gyp,argv,callback) { + handle_gyp_opts(gyp,argv,function(err,result) { + var final_args = ['build'].concat(result.gyp).concat(result.pre); + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + if (!err && result.opts.napi_build_version) { + napi.swap_build_dir_in(result.opts.napi_build_version); + } + compile.run_gyp(final_args,result.opts,function(err) { + if (result.opts.napi_build_version) { + napi.swap_build_dir_out(result.opts.napi_build_version); + } + return callback(err); + }); + }); +} + +function build(gyp, argv, callback) { + + // Form up commands to pass to node-gyp: + // We map `node-pre-gyp build` to `node-gyp configure build` so that we do not + // trigger a clean and therefore do not pay the penalty of a full recompile + if (argv.length && (argv.indexOf('rebuild') > -1)) { + argv.shift(); // remove `rebuild` + // here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means + // "clean + configure + build" and triggers a full recompile + compile.run_gyp(['clean'],{},function(err) { + if (err) return callback(err); + configure(gyp,argv,function(err) { + if (err) return callback(err); + return do_build(gyp,argv,callback); + }); + }); + } else { + return do_build(gyp,argv,callback); + } +} diff --git a/legacy-libs/node-pre-gyp/lib/clean.js b/legacy-libs/node-pre-gyp/lib/clean.js new file mode 100644 index 0000000..e2da17b --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/clean.js @@ -0,0 +1,32 @@ +"use strict"; + +module.exports = exports = clean; + +exports.usage = 'Removes the entire folder containing the compiled .node module'; + +var fs = require('fs'); +var rm = require('rimraf'); +var exists = require('fs').exists || require('path').exists; +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var path = require('path'); + +function clean (gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + var to_delete = opts.module_path; + if (!to_delete) { + return callback(new Error("module_path is empty, refusing to delete")); + } else if (path.normalize(to_delete) == path.normalize(process.cwd())) { + return callback(new Error("module_path is not set, refusing to delete")); + } else { + exists(to_delete, function(found) { + if (found) { + if (!gyp.opts.silent_clean) console.log('['+package_json.name+'] Removing "%s"', to_delete); + return rm(to_delete, callback); + } + return callback(); + }); + } +} diff --git a/legacy-libs/node-pre-gyp/lib/configure.js b/legacy-libs/node-pre-gyp/lib/configure.js new file mode 100644 index 0000000..a6e3438 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/configure.js @@ -0,0 +1,52 @@ +"use strict"; + +module.exports = exports = configure; + +exports.usage = 'Attempts to configure node-gyp or nw-gyp build'; + +var napi = require('./util/napi.js'); +var compile = require('./util/compile.js'); +var handle_gyp_opts = require('./util/handle_gyp_opts.js'); + +function configure(gyp, argv, callback) { + handle_gyp_opts(gyp,argv,function(err,result) { + var final_args = result.gyp.concat(result.pre); + // pull select node-gyp configure options out of the npm environ + var known_gyp_args = ['dist-url','python','nodedir','msvs_version']; + known_gyp_args.forEach(function(key) { + var val = gyp.opts[key] || gyp.opts[key.replace('-','_')]; + if (val) { + final_args.push('--'+key+'='+val); + } + }); + // --ensure=false tell node-gyp to re-install node development headers + // but it is only respected by node-gyp install, so we have to call install + // as a separate step if the user passes it + if (gyp.opts.ensure === false) { + var install_args = final_args.concat(['install','--ensure=false']); + compile.run_gyp(install_args,result.opts,function(err) { + if (err) return callback(err); + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) { + return callback(err); + }); + }); + } else { + if (result.unparsed.length > 0) { + final_args = final_args. + concat(['--']). + concat(result.unparsed); + } + compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) { + if (!err && result.opts.napi_build_version) { + napi.swap_build_dir_out(result.opts.napi_build_version); + } + return callback(err); + }); + } + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/info.js b/legacy-libs/node-pre-gyp/lib/info.js new file mode 100644 index 0000000..aff9bf8 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/info.js @@ -0,0 +1,40 @@ +"use strict"; + +module.exports = exports = unpublish; + +exports.usage = 'Lists all published binaries (requires aws-sdk)'; + +var fs = require('fs'); +var log = require('npmlog'); +var versioning = require('./util/versioning.js'); +var s3_setup = require('./util/s3_setup.js'); +var config = require('rc')("node_pre_gyp",{acl:"public-read"}); + +function unpublish(gyp, argv, callback) { + var AWS = require("aws-sdk"); + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var opts = versioning.evaluate(package_json, gyp.opts); + s3_setup.detect(opts.hosted_path,config); + AWS.config.update(config); + var s3 = new AWS.S3(); + var s3_opts = { Bucket: config.bucket, + Prefix: config.prefix + }; + s3.listObjects(s3_opts, function(err, meta){ + if (err && err.code == 'NotFound') { + return callback(new Error('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix)); + } else if(err) { + return callback(err); + } else { + log.verbose(JSON.stringify(meta,null,1)); + if (meta && meta.Contents) { + meta.Contents.forEach(function(obj) { + console.log(obj.Key); + }); + } else { + console.error('['+package_json.name+'] No objects found at https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix ); + } + return callback(); + } + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/install.js b/legacy-libs/node-pre-gyp/lib/install.js new file mode 100644 index 0000000..37a435a --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/install.js @@ -0,0 +1,285 @@ +"use strict"; + +module.exports = exports = install; + +exports.usage = 'Attempts to install pre-built binary for module'; + +var fs = require('fs'); +var path = require('path'); +var log = require('npmlog'); +var existsAsync = fs.exists || path.exists; +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var mkdirp = require('mkdirp'); + +var npgVersion = 'unknown'; +try { + // Read own package.json to get the current node-pre-pyp version. + var ownPackageJSON = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'); + npgVersion = JSON.parse(ownPackageJSON).version; +} catch (e) {} + +var http_get = { + impl: undefined, + type: undefined +}; + +try { + http_get.impl = require('request'); + http_get.type = 'request'; + log.warn("Using request for node-pre-gyp https download"); +} catch (e) { + http_get.impl = require('needle'); + http_get.type = 'needle'; + log.warn("Using needle for node-pre-gyp https download"); +} + +function download(uri,opts,callback) { + log.http('GET', uri); + + var req = null; + + // Try getting version info from the currently running npm. + var envVersionInfo = process.env.npm_config_user_agent || + 'node ' + process.version; + + var requestOpts = { + uri: uri.replace('+','%2B'), + headers: { + 'User-Agent': 'node-pre-gyp (v' + npgVersion + ', ' + envVersionInfo + ')' + }, + follow_max: 10, + }; + + if (opts.cafile) { + try { + requestOpts.ca = fs.readFileSync(opts.cafile); + } catch (e) { + return callback(e); + } + } else if (opts.ca) { + requestOpts.ca = opts.ca; + } + + var proxyUrl = opts.proxy || + process.env.http_proxy || + process.env.HTTP_PROXY || + process.env.npm_config_proxy; + if (proxyUrl) { + if (/^https?:\/\//i.test(proxyUrl)) { + log.verbose('download', 'using proxy url: "%s"', proxyUrl); + requestOpts.proxy = proxyUrl; + } else { + log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl); + } + } + try { + req = http_get.impl.get(requestOpts.uri, requestOpts); + } catch (e) { + return callback(e); + } + if (req) { + req.on('response', function (res) { + log.http(res.statusCode, uri); + }); + } + return callback(null,req); +} + +function place_binary(from,to,opts,callback) { + download(from,opts,function(err,req) { + if (err) return callback(err); + if (!req) return callback(new Error("empty req")); + var badDownload = false; + var hasResponse = false; + + function afterExtract(err, extractCount) { + if (err) return callback(err); + if (badDownload) return callback(new Error("bad download")); + if (extractCount === 0) { + return callback(new Error('There was a fatal problem while downloading/extracting the tarball')); + } + log.info('tarball', 'done parsing tarball'); + callback(); + } + + // for request compatibility + req.on('error', function(err) { + badDownload = true; + if (!hasResponse) { + hasResponse = true; + return callback(err); + } + }); + + // for needle compatibility + req.on('err', function(err) { + badDownload = true; + if (!hasResponse) { + hasResponse = true; + return callback(err); + } + }); + + req.on('close', function () { + if (!hasResponse) { + hasResponse = true; + return callback(new Error('Connection closed while downloading tarball file')); + } + }); + + req.on('response', function(res) { + // ignore redirects, needle handles these automatically. + if (http_get.type === 'needle' && res.headers.hasOwnProperty('location') && res.headers.location !== '') { + return; + } + if (hasResponse) { + return; + } + hasResponse = true; + if (res.statusCode !== 200) { + badDownload = true; + var err = new Error(res.statusCode + ' status code downloading tarball ' + from); + err.statusCode = res.statusCode; + return callback(err); + } + // start unzipping and untaring + req.pipe(extract(to, afterExtract)); + }); + }); +} + +function extract_from_local(from, to, callback) { + if (!fs.existsSync(from)) { + return callback(new Error('Cannot find file ' + from)); + } + log.info('Found local file to extract from ' + from); + function afterExtract(err, extractCount) { + if (err) return callback(err); + if (extractCount === 0) { + return callback(new Error('There was a fatal problem while extracting the tarball')); + } + log.info('tarball', 'done parsing tarball'); + callback(); + } + fs.createReadStream(from).pipe(extract(to, afterExtract)); +} + +function extract(to, callback) { + var extractCount = 0; + function filter_func(entry) { + log.info('install','unpacking ' + entry.path); + extractCount++; + } + + function afterTarball(err) { + callback(err, extractCount); + } + + var tar = require('tar'); + return tar.extract({ + cwd: to, + strip: 1, + onentry: filter_func + }).on('close', afterTarball).on('error', callback); +} + + +function do_build(gyp,argv,callback) { + var args = ['rebuild'].concat(argv); + gyp.todo.push( { name: 'build', args: args } ); + process.nextTick(callback); +} + +function print_fallback_error(err,opts,package_json) { + var fallback_message = ' (falling back to source compile with node-gyp)'; + var full_message = ''; + if (err.statusCode !== undefined) { + // If we got a network response it but failed to download + // it means remote binaries are not available, so let's try to help + // the user/developer with the info to debug why + full_message = "Pre-built binaries not found for " + package_json.name + "@" + package_json.version; + full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")"; + full_message += fallback_message; + log.warn("Tried to download(" + err.statusCode + "): " + opts.hosted_tarball); + log.warn(full_message); + log.http(err.message); + } else { + // If we do not have a statusCode that means an unexpected error + // happened and prevented an http response, so we output the exact error + full_message = "Pre-built binaries not installable for " + package_json.name + "@" + package_json.version; + full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")"; + full_message += fallback_message; + log.warn(full_message); + log.warn("Hit error " + err.message); + } +} + +function install(gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var source_build = gyp.opts['build-from-source'] || gyp.opts.build_from_source; + var update_binary = gyp.opts['update-binary'] || gyp.opts.update_binary; + var should_do_source_build = source_build === package_json.name || (source_build === true || source_build === 'true'); + if (should_do_source_build) { + log.info('build','requesting source compile'); + return do_build(gyp,argv,callback); + } else { + var fallback_to_build = gyp.opts['fallback-to-build'] || gyp.opts.fallback_to_build; + var should_do_fallback_build = fallback_to_build === package_json.name || (fallback_to_build === true || fallback_to_build === 'true'); + // but allow override from npm + if (process.env.npm_config_argv) { + var cooked = JSON.parse(process.env.npm_config_argv).cooked; + var match = cooked.indexOf("--fallback-to-build"); + if (match > -1 && cooked.length > match && cooked[match+1] == "false") { + should_do_fallback_build = false; + log.info('install','Build fallback disabled via npm flag: --fallback-to-build=false'); + } + } + var opts; + try { + opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + } catch (err) { + return callback(err); + } + + opts.ca = gyp.opts.ca; + opts.cafile = gyp.opts.cafile; + + var from = opts.hosted_tarball; + var to = opts.module_path; + var binary_module = path.join(to,opts.module_name + '.node'); + existsAsync(binary_module,function(found) { + if (found && !update_binary) { + console.log('['+package_json.name+'] Success: "' + binary_module + '" already installed'); + console.log('Pass --update-binary to reinstall or --build-from-source to recompile'); + return callback(); + } else { + if (!update_binary) log.info('check','checked for "' + binary_module + '" (not found)'); + mkdirp(to,function(err) { + if (err) { + after_place(err); + } else { + var fileName = from.startsWith('file://') && from.replace(/^file:\/\//, ''); + if (fileName) { + extract_from_local(fileName, to, after_place); + } else { + place_binary(from,to,opts,after_place); + } + } + }); + } + function after_place(err) { + if (err && should_do_fallback_build) { + print_fallback_error(err,opts,package_json); + return do_build(gyp,argv,callback); + } else if (err) { + return callback(err); + } else { + console.log('['+package_json.name+'] Success: "' + binary_module + '" is installed via remote'); + return callback(); + } + } + }); + } +} diff --git a/legacy-libs/node-pre-gyp/lib/node-pre-gyp.js b/legacy-libs/node-pre-gyp/lib/node-pre-gyp.js new file mode 100644 index 0000000..7d09b5f --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/node-pre-gyp.js @@ -0,0 +1,203 @@ +"use strict"; + +/** + * Module exports. + */ + +module.exports = exports; + +/** + * Module dependencies. + */ + +var fs = require('fs'); +var path = require('path'); +var nopt = require('nopt'); +var log = require('npmlog'); +log.disableProgress(); +var napi = require('./util/napi.js'); + +var EE = require('events').EventEmitter; +var inherits = require('util').inherits; +var commands = [ + 'clean', + 'install', + 'reinstall', + 'build', + 'rebuild', + 'package', + 'testpackage', + 'publish', + 'unpublish', + 'info', + 'testbinary', + 'reveal', + 'configure' + ]; +var aliases = {}; + +// differentiate node-pre-gyp's logs from npm's +log.heading = 'node-pre-gyp'; + +exports.find = require('./pre-binding').find; + +function Run() { + var self = this; + + this.commands = {}; + + commands.forEach(function (command) { + self.commands[command] = function (argv, callback) { + log.verbose('command', command, argv); + return require('./' + command)(self, argv, callback); + }; + }); +} +inherits(Run, EE); +exports.Run = Run; +var proto = Run.prototype; + +/** + * Export the contents of the package.json. + */ + +proto.package = require('../package.json'); + +/** + * nopt configuration definitions + */ + +proto.configDefs = { + help: Boolean, // everywhere + arch: String, // 'configure' + debug: Boolean, // 'build' + directory: String, // bin + proxy: String, // 'install' + loglevel: String, // everywhere +}; + +/** + * nopt shorthands + */ + +proto.shorthands = { + release: '--no-debug', + C: '--directory', + debug: '--debug', + j: '--jobs', + silent: '--loglevel=silent', + silly: '--loglevel=silly', + verbose: '--loglevel=verbose', +}; + +/** + * expose the command aliases for the bin file to use. + */ + +proto.aliases = aliases; + +/** + * Parses the given argv array and sets the 'opts', + * 'argv' and 'command' properties. + */ + +proto.parseArgv = function parseOpts (argv) { + this.opts = nopt(this.configDefs, this.shorthands, argv); + this.argv = this.opts.argv.remain.slice(); + var commands = this.todo = []; + + // create a copy of the argv array with aliases mapped + argv = this.argv.map(function (arg) { + // is this an alias? + if (arg in this.aliases) { + arg = this.aliases[arg]; + } + return arg; + }, this); + + // process the mapped args into "command" objects ("name" and "args" props) + argv.slice().forEach(function (arg) { + if (arg in this.commands) { + var args = argv.splice(0, argv.indexOf(arg)); + argv.shift(); + if (commands.length > 0) { + commands[commands.length - 1].args = args; + } + commands.push({ name: arg, args: [] }); + } + }, this); + if (commands.length > 0) { + commands[commands.length - 1].args = argv.splice(0); + } + + // expand commands entries for multiple napi builds + var dir = this.opts.directory; + if (dir == null) dir = process.cwd(); + var package_json = JSON.parse(fs.readFileSync(path.join(dir,'package.json'))); + + this.todo = napi.expand_commands (package_json, this.opts, commands); + + // support for inheriting config env variables from npm + var npm_config_prefix = 'npm_config_'; + Object.keys(process.env).forEach(function (name) { + if (name.indexOf(npm_config_prefix) !== 0) return; + var val = process.env[name]; + if (name === npm_config_prefix + 'loglevel') { + log.level = val; + } else { + // add the user-defined options to the config + name = name.substring(npm_config_prefix.length); + // avoid npm argv clobber already present args + // which avoids problem of 'npm test' calling + // script that runs unique npm install commands + if (name === 'argv') { + if (this.opts.argv && + this.opts.argv.remain && + this.opts.argv.remain.length) { + // do nothing + } else { + this.opts[name] = val; + } + } else { + this.opts[name] = val; + } + } + }, this); + + if (this.opts.loglevel) { + log.level = this.opts.loglevel; + } + log.resume(); +}; + +/** + * Returns the usage instructions for node-pre-gyp. + */ + +proto.usage = function usage () { + var str = [ + '', + ' Usage: node-pre-gyp [options]', + '', + ' where is one of:', + commands.map(function (c) { + return ' - ' + c + ' - ' + require('./' + c).usage; + }).join('\n'), + '', + 'node-pre-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'), + 'node@' + process.versions.node + ].join('\n'); + return str; +}; + +/** + * Version number getter. + */ + +Object.defineProperty(proto, 'version', { + get: function () { + return this.package.version; + }, + enumerable: true +}); + diff --git a/legacy-libs/node-pre-gyp/lib/package.js b/legacy-libs/node-pre-gyp/lib/package.js new file mode 100644 index 0000000..4959265 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/package.js @@ -0,0 +1,56 @@ +"use strict"; + +module.exports = exports = _package; + +exports.usage = 'Packs binary (and enclosing directory) into locally staged tarball'; + +var fs = require('fs'); +var path = require('path'); +var log = require('npmlog'); +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var write = require('fs').createWriteStream; +var existsAsync = fs.exists || path.exists; +var mkdirp = require('mkdirp'); +var tar = require('tar'); + +function _package(gyp, argv, callback) { + var packlist = require('npm-packlist'); + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + var from = opts.module_path; + var binary_module = path.join(from,opts.module_name + '.node'); + existsAsync(binary_module,function(found) { + if (!found) { + return callback(new Error("Cannot package because " + binary_module + " missing: run `node-pre-gyp rebuild` first")); + } + var tarball = opts.staged_tarball; + var filter_func = function(entry) { + // ensure directories are +x + // https://github.com/mapnik/node-mapnik/issues/262 + log.info('package','packing ' + entry.path); + return true; + }; + mkdirp(path.dirname(tarball),function(err) { + if (err) return callback(err); + packlist({ path: from }).then(function(files) { + var base = path.basename(from); + files = files.map(function(file) { + return path.join(base, file); + }); + tar.create({ + portable: true, + gzip: true, + onentry: filter_func, + file: tarball, + cwd: path.dirname(from) + }, files, function(err) { + if (err) console.error('['+package_json.name+'] ' + err.message); + else log.info('package','Binary staged at "' + tarball + '"'); + return callback(err); + }); + }, callback); + }); + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/pre-binding.js b/legacy-libs/node-pre-gyp/lib/pre-binding.js new file mode 100644 index 0000000..09e076d --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/pre-binding.js @@ -0,0 +1,30 @@ +"use strict"; + +var versioning = require('../lib/util/versioning.js'); +var napi = require('../lib/util/napi.js'); +var existsSync = require('fs').existsSync || require('path').existsSync; +var path = require('path'); + +module.exports = exports; + +exports.usage = 'Finds the require path for the node-pre-gyp installed module'; + +exports.validate = function(package_json,opts) { + versioning.validate_config(package_json,opts); +}; + +exports.find = function(package_json_path,opts) { + if (!existsSync(package_json_path)) { + throw new Error("package.json does not exist at " + package_json_path); + } + var package_json = require(package_json_path); + versioning.validate_config(package_json,opts); + var napi_build_version; + if (napi.get_napi_build_versions (package_json, opts)) { + napi_build_version = napi.get_best_napi_build_version(package_json, opts); + } + opts = opts || {}; + if (!opts.module_root) opts.module_root = path.dirname(package_json_path); + var meta = versioning.evaluate(package_json,opts,napi_build_version); + return meta.module; +}; diff --git a/legacy-libs/node-pre-gyp/lib/publish.js b/legacy-libs/node-pre-gyp/lib/publish.js new file mode 100644 index 0000000..376e398 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/publish.js @@ -0,0 +1,79 @@ +"use strict"; + +module.exports = exports = publish; + +exports.usage = 'Publishes pre-built binary (requires aws-sdk)'; + +var fs = require('fs'); +var path = require('path'); +var log = require('npmlog'); +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var s3_setup = require('./util/s3_setup.js'); +var existsAsync = fs.exists || path.exists; +var url = require('url'); +var config = require('rc')("node_pre_gyp",{acl:"public-read"}); + +function publish(gyp, argv, callback) { + var AWS = require("aws-sdk"); + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + var tarball = opts.staged_tarball; + existsAsync(tarball,function(found) { + if (!found) { + return callback(new Error("Cannot publish because " + tarball + " missing: run `node-pre-gyp package` first")); + } + log.info('publish', 'Detecting s3 credentials'); + s3_setup.detect(opts.hosted_path,config); + var key_name = url.resolve(config.prefix,opts.package_name); + log.info('publish', 'Authenticating with s3'); + AWS.config.update(config); + var s3 = new AWS.S3(); + var s3_opts = { Bucket: config.bucket, + Key: key_name + }; + var remote_package = 'https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key; + log.info('publish', 'Checking for existing binary at ' + remote_package); + s3.headObject(s3_opts, function(err, meta){ + if (meta) log.info('publish', JSON.stringify(meta)); + if (err && err.code == 'NotFound') { + // we are safe to publish because + // the object does not already exist + log.info('publish', 'Preparing to put object'); + var s3_put = new AWS.S3(); + var s3_put_opts = { ACL: config.acl, + Body: fs.createReadStream(tarball), + Bucket: config.bucket, + Key: key_name + }; + log.info('publish', 'Putting object'); + try { + s3_put.putObject(s3_put_opts, function(err, resp){ + log.info('publish', 'returned from putting object'); + if(err) { + log.info('publish', 's3 putObject error: "' + err + '"'); + return callback(err); + } + if (resp) log.info('publish', 's3 putObject response: "' + JSON.stringify(resp) + '"'); + log.info('publish', 'successfully put object'); + console.log('['+package_json.name+'] published to ' + remote_package); + return callback(); + }); + } catch (err) { + log.info('publish', 's3 putObject error: "' + err + '"'); + return callback(err); + } + } else if (err) { + log.info('publish', 's3 headObject error: "' + err + '"'); + return callback(err); + } else { + log.error('publish','Cannot publish over existing version'); + log.error('publish',"Update the 'version' field in package.json and try again"); + log.error('publish','If the previous version was published in error see:'); + log.error('publish','\t node-pre-gyp unpublish'); + return callback(new Error('Failed publishing to ' + remote_package)); + } + }); + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/rebuild.js b/legacy-libs/node-pre-gyp/lib/rebuild.js new file mode 100644 index 0000000..615a524 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/rebuild.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = exports = rebuild; + +exports.usage = 'Runs "clean" and "build" at once'; + +var fs = require('fs'); +var napi = require('./util/napi.js'); + +function rebuild (gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var commands = [ + { name: 'clean', args: [] }, + { name: 'build', args: ['rebuild'] } + ]; + commands = napi.expand_commands(package_json, gyp.opts, commands); + for (var i = commands.length; i !== 0; i--) { + gyp.todo.unshift(commands[i-1]); + } + process.nextTick(callback); +} diff --git a/legacy-libs/node-pre-gyp/lib/reinstall.js b/legacy-libs/node-pre-gyp/lib/reinstall.js new file mode 100644 index 0000000..10e85fc --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/reinstall.js @@ -0,0 +1,20 @@ +"use strict"; + +module.exports = exports = rebuild; + +exports.usage = 'Runs "clean" and "install" at once'; + +var fs = require('fs'); +var napi = require('./util/napi.js'); + +function rebuild (gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var installArgs = []; + var napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts); + if (napi_build_version != null) installArgs = [ napi.get_command_arg (napi_build_version) ]; + gyp.todo.unshift( + { name: 'clean', args: [] }, + { name: 'install', args: installArgs } + ); + process.nextTick(callback); +} diff --git a/legacy-libs/node-pre-gyp/lib/reveal.js b/legacy-libs/node-pre-gyp/lib/reveal.js new file mode 100644 index 0000000..13d2f72 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/reveal.js @@ -0,0 +1,33 @@ +"use strict"; + +module.exports = exports = reveal; + +exports.usage = 'Reveals data on the versioned binary'; + +var fs = require('fs'); +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); + +function unix_paths(key, val) { + return val && val.replace ? val.replace(/\\/g, '/') : val; +} + +function reveal(gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + var hit = false; + // if a second arg is passed look to see + // if it is a known option + //console.log(JSON.stringify(gyp.opts,null,1)) + var remain = gyp.opts.argv.remain[gyp.opts.argv.remain.length-1]; + if (remain && opts.hasOwnProperty(remain)) { + console.log(opts[remain].replace(/\\/g, '/')); + hit = true; + } + // otherwise return all options as json + if (!hit) { + console.log(JSON.stringify(opts,unix_paths,2)); + } + return callback(); +} diff --git a/legacy-libs/node-pre-gyp/lib/testbinary.js b/legacy-libs/node-pre-gyp/lib/testbinary.js new file mode 100644 index 0000000..453987c --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/testbinary.js @@ -0,0 +1,81 @@ +"use strict"; + +module.exports = exports = testbinary; + +exports.usage = 'Tests that the binary.node can be required'; + +var fs = require('fs'); +var path = require('path'); +var log = require('npmlog'); +var cp = require('child_process'); +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var path = require('path'); + +function testbinary(gyp, argv, callback) { + var args = []; + var options = {}; + var shell_cmd = process.execPath; + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + // skip validation for runtimes we don't explicitly support (like electron) + if (opts.runtime && + opts.runtime !== 'node-webkit' && + opts.runtime !== 'node') { + return callback(); + } + var nw = (opts.runtime && opts.runtime === 'node-webkit'); + // ensure on windows that / are used for require path + var binary_module = opts.module.replace(/\\/g, '/'); + if ((process.arch != opts.target_arch) || + (process.platform != opts.target_platform)) { + var msg = "skipping validation since host platform/arch ("; + msg += process.platform+'/'+process.arch+")"; + msg += " does not match target ("; + msg += opts.target_platform+'/'+opts.target_arch+")"; + log.info('validate', msg); + return callback(); + } + if (nw) { + options.timeout = 5000; + if (process.platform === 'darwin') { + shell_cmd = 'node-webkit'; + } else if (process.platform === 'win32') { + shell_cmd = 'nw.exe'; + } else { + shell_cmd = 'nw'; + } + var modulePath = path.resolve(binary_module); + var appDir = path.join(__dirname, 'util', 'nw-pre-gyp'); + args.push(appDir); + args.push(modulePath); + log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); + cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) { + // check for normal timeout for node-webkit + if (err) { + if (err.killed === true && err.signal && err.signal.indexOf('SIG') > -1) { + return callback(); + } + var stderrLog = stderr.toString(); + log.info('stderr', stderrLog); + if( /^\s*Xlib:\s*extension\s*"RANDR"\s*missing\s*on\s*display\s*":\d+\.\d+"\.\s*$/.test(stderrLog) ){ + log.info('RANDR', 'stderr contains only RANDR error, ignored'); + return callback(); + } + return callback(err); + } + return callback(); + }); + return; + } + args.push('--eval'); + args.push("require('" + binary_module.replace(/'/g, '\'') +"')"); + log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'"); + cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) { + if (err) { + return callback(err, { stdout:stdout, stderr:stderr}); + } + return callback(); + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/testpackage.js b/legacy-libs/node-pre-gyp/lib/testpackage.js new file mode 100644 index 0000000..9091bc3 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/testpackage.js @@ -0,0 +1,55 @@ +"use strict"; + +module.exports = exports = testpackage; + +exports.usage = 'Tests that the staged package is valid'; + +var fs = require('fs'); +var path = require('path'); +var log = require('npmlog'); +var existsAsync = fs.exists || path.exists; +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var testbinary = require('./testbinary.js'); +var tar = require('tar'); +var mkdirp = require('mkdirp'); + +function testpackage(gyp, argv, callback) { + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + var tarball = opts.staged_tarball; + existsAsync(tarball, function(found) { + if (!found) { + return callback(new Error("Cannot test package because " + tarball + " missing: run `node-pre-gyp package` first")); + } + var to = opts.module_path; + function filter_func(entry) { + log.info('install','unpacking [' + entry.path + ']'); + } + + mkdirp(to, function(err) { + if (err) { + return callback(err); + } else { + tar.extract({ + file: tarball, + cwd: to, + strip: 1, + onentry: filter_func + }).then(after_extract, callback); + } + }); + + function after_extract() { + testbinary(gyp,argv,function(err) { + if (err) { + return callback(err); + } else { + console.log('['+package_json.name+'] Package appears valid'); + return callback(); + } + }); + } + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/unpublish.js b/legacy-libs/node-pre-gyp/lib/unpublish.js new file mode 100644 index 0000000..94c93dd --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/unpublish.js @@ -0,0 +1,43 @@ +"use strict"; + +module.exports = exports = unpublish; + +exports.usage = 'Unpublishes pre-built binary (requires aws-sdk)'; + +var fs = require('fs'); +var log = require('npmlog'); +var versioning = require('./util/versioning.js'); +var napi = require('./util/napi.js'); +var s3_setup = require('./util/s3_setup.js'); +var url = require('url'); +var config = require('rc')("node_pre_gyp",{acl:"public-read"}); + +function unpublish(gyp, argv, callback) { + var AWS = require("aws-sdk"); + var package_json = JSON.parse(fs.readFileSync('./package.json')); + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version); + s3_setup.detect(opts.hosted_path,config); + AWS.config.update(config); + var key_name = url.resolve(config.prefix,opts.package_name); + var s3 = new AWS.S3(); + var s3_opts = { Bucket: config.bucket, + Key: key_name + }; + s3.headObject(s3_opts, function(err, meta) { + if (err && err.code == 'NotFound') { + console.log('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key); + return callback(); + } else if(err) { + return callback(err); + } else { + log.info('unpublish', JSON.stringify(meta)); + s3.deleteObject(s3_opts, function(err, resp) { + if (err) return callback(err); + log.info(JSON.stringify(resp)); + console.log('['+package_json.name+'] Success: removed https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key); + return callback(); + }); + } + }); +} diff --git a/legacy-libs/node-pre-gyp/lib/util/abi_crosswalk.json b/legacy-libs/node-pre-gyp/lib/util/abi_crosswalk.json new file mode 100644 index 0000000..39d0d23 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/abi_crosswalk.json @@ -0,0 +1,2302 @@ +{ + "0.1.14": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.15": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.16": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.17": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.18": { + "node_abi": null, + "v8": "1.3" + }, + "0.1.19": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.20": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.21": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.22": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.23": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.24": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.25": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.26": { + "node_abi": null, + "v8": "2.0" + }, + "0.1.27": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.28": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.29": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.30": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.31": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.32": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.33": { + "node_abi": null, + "v8": "2.1" + }, + "0.1.90": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.91": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.92": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.93": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.94": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.95": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.96": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.97": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.98": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.99": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.100": { + "node_abi": null, + "v8": "2.2" + }, + "0.1.101": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.102": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.103": { + "node_abi": null, + "v8": "2.3" + }, + "0.1.104": { + "node_abi": null, + "v8": "2.3" + }, + "0.2.0": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.1": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.2": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.3": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.4": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.5": { + "node_abi": 1, + "v8": "2.3" + }, + "0.2.6": { + "node_abi": 1, + "v8": "2.3" + }, + "0.3.0": { + "node_abi": 1, + "v8": "2.5" + }, + "0.3.1": { + "node_abi": 1, + "v8": "2.5" + }, + "0.3.2": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.3": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.4": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.5": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.6": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.7": { + "node_abi": 1, + "v8": "3.0" + }, + "0.3.8": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.0": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.1": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.2": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.3": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.4": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.5": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.6": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.7": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.8": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.9": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.10": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.11": { + "node_abi": 1, + "v8": "3.1" + }, + "0.4.12": { + "node_abi": 1, + "v8": "3.1" + }, + "0.5.0": { + "node_abi": 1, + "v8": "3.1" + }, + "0.5.1": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.2": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.3": { + "node_abi": 1, + "v8": "3.4" + }, + "0.5.4": { + "node_abi": 1, + "v8": "3.5" + }, + "0.5.5": { + "node_abi": 1, + "v8": "3.5" + }, + "0.5.6": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.7": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.8": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.9": { + "node_abi": 1, + "v8": "3.6" + }, + "0.5.10": { + "node_abi": 1, + "v8": "3.7" + }, + "0.6.0": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.1": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.2": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.3": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.4": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.5": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.6": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.7": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.8": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.9": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.10": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.11": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.12": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.13": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.14": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.15": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.16": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.17": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.18": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.19": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.20": { + "node_abi": 1, + "v8": "3.6" + }, + "0.6.21": { + "node_abi": 1, + "v8": "3.6" + }, + "0.7.0": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.1": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.2": { + "node_abi": 1, + "v8": "3.8" + }, + "0.7.3": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.4": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.5": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.6": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.7": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.8": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.9": { + "node_abi": 1, + "v8": "3.11" + }, + "0.7.10": { + "node_abi": 1, + "v8": "3.9" + }, + "0.7.11": { + "node_abi": 1, + "v8": "3.11" + }, + "0.7.12": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.0": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.1": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.2": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.3": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.4": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.5": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.6": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.7": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.8": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.9": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.10": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.11": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.12": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.13": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.14": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.15": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.16": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.17": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.18": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.19": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.20": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.21": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.22": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.23": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.24": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.25": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.26": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.27": { + "node_abi": 1, + "v8": "3.11" + }, + "0.8.28": { + "node_abi": 1, + "v8": "3.11" + }, + "0.9.0": { + "node_abi": 1, + "v8": "3.11" + }, + "0.9.1": { + "node_abi": 10, + "v8": "3.11" + }, + "0.9.2": { + "node_abi": 10, + "v8": "3.11" + }, + "0.9.3": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.4": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.5": { + "node_abi": 10, + "v8": "3.13" + }, + "0.9.6": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.7": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.8": { + "node_abi": 10, + "v8": "3.15" + }, + "0.9.9": { + "node_abi": 11, + "v8": "3.15" + }, + "0.9.10": { + "node_abi": 11, + "v8": "3.15" + }, + "0.9.11": { + "node_abi": 11, + "v8": "3.14" + }, + "0.9.12": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.0": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.1": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.2": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.3": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.4": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.5": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.6": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.7": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.8": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.9": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.10": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.11": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.12": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.13": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.14": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.15": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.16": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.17": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.18": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.19": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.20": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.21": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.22": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.23": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.24": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.25": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.26": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.27": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.28": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.29": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.30": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.31": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.32": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.33": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.34": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.35": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.36": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.37": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.38": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.39": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.40": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.41": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.42": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.43": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.44": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.45": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.46": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.47": { + "node_abi": 11, + "v8": "3.14" + }, + "0.10.48": { + "node_abi": 11, + "v8": "3.14" + }, + "0.11.0": { + "node_abi": 12, + "v8": "3.17" + }, + "0.11.1": { + "node_abi": 12, + "v8": "3.18" + }, + "0.11.2": { + "node_abi": 12, + "v8": "3.19" + }, + "0.11.3": { + "node_abi": 12, + "v8": "3.19" + }, + "0.11.4": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.5": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.6": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.7": { + "node_abi": 12, + "v8": "3.20" + }, + "0.11.8": { + "node_abi": 13, + "v8": "3.21" + }, + "0.11.9": { + "node_abi": 13, + "v8": "3.22" + }, + "0.11.10": { + "node_abi": 13, + "v8": "3.22" + }, + "0.11.11": { + "node_abi": 14, + "v8": "3.22" + }, + "0.11.12": { + "node_abi": 14, + "v8": "3.22" + }, + "0.11.13": { + "node_abi": 14, + "v8": "3.25" + }, + "0.11.14": { + "node_abi": 14, + "v8": "3.26" + }, + "0.11.15": { + "node_abi": 14, + "v8": "3.28" + }, + "0.11.16": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.0": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.1": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.2": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.3": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.4": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.5": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.6": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.7": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.8": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.9": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.10": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.11": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.12": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.13": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.14": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.15": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.16": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.17": { + "node_abi": 14, + "v8": "3.28" + }, + "0.12.18": { + "node_abi": 14, + "v8": "3.28" + }, + "1.0.0": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.1": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.2": { + "node_abi": 42, + "v8": "3.31" + }, + "1.0.3": { + "node_abi": 42, + "v8": "4.1" + }, + "1.0.4": { + "node_abi": 42, + "v8": "4.1" + }, + "1.1.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.2.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.3.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.4.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.5.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.5.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.0": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.6.4": { + "node_abi": 43, + "v8": "4.1" + }, + "1.7.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.1": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.2": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.3": { + "node_abi": 43, + "v8": "4.1" + }, + "1.8.4": { + "node_abi": 43, + "v8": "4.1" + }, + "2.0.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.0.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.0.2": { + "node_abi": 44, + "v8": "4.2" + }, + "2.1.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.2.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.2.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.1": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.2": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.3": { + "node_abi": 44, + "v8": "4.2" + }, + "2.3.4": { + "node_abi": 44, + "v8": "4.2" + }, + "2.4.0": { + "node_abi": 44, + "v8": "4.2" + }, + "2.5.0": { + "node_abi": 44, + "v8": "4.2" + }, + "3.0.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.1.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.2.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.3.0": { + "node_abi": 45, + "v8": "4.4" + }, + "3.3.1": { + "node_abi": 45, + "v8": "4.4" + }, + "4.0.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.1.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.2.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.3.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.4.7": { + "node_abi": 46, + "v8": "4.5" + }, + "4.5.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.6.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.7.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.1": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.2": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.3": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.4": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.5": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.6": { + "node_abi": 46, + "v8": "4.5" + }, + "4.8.7": { + "node_abi": 46, + "v8": "4.5" + }, + "4.9.0": { + "node_abi": 46, + "v8": "4.5" + }, + "4.9.1": { + "node_abi": 46, + "v8": "4.5" + }, + "5.0.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.1.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.1.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.2.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.3.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.4.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.4.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.5.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.6.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.7.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.7.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.8.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.9.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.9.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.10.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.10.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.11.0": { + "node_abi": 47, + "v8": "4.6" + }, + "5.11.1": { + "node_abi": 47, + "v8": "4.6" + }, + "5.12.0": { + "node_abi": 47, + "v8": "4.6" + }, + "6.0.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.1.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.1": { + "node_abi": 48, + "v8": "5.0" + }, + "6.2.2": { + "node_abi": 48, + "v8": "5.0" + }, + "6.3.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.3.1": { + "node_abi": 48, + "v8": "5.0" + }, + "6.4.0": { + "node_abi": 48, + "v8": "5.0" + }, + "6.5.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.6.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.7.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.8.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.8.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.9.5": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.10.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.11.5": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.12.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.13.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.13.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.2": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.3": { + "node_abi": 48, + "v8": "5.1" + }, + "6.14.4": { + "node_abi": 48, + "v8": "5.1" + }, + "6.15.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.15.1": { + "node_abi": 48, + "v8": "5.1" + }, + "6.16.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.17.0": { + "node_abi": 48, + "v8": "5.1" + }, + "6.17.1": { + "node_abi": 48, + "v8": "5.1" + }, + "7.0.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.1.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.2.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.2.1": { + "node_abi": 51, + "v8": "5.4" + }, + "7.3.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.4.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.5.0": { + "node_abi": 51, + "v8": "5.4" + }, + "7.6.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.1": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.2": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.3": { + "node_abi": 51, + "v8": "5.5" + }, + "7.7.4": { + "node_abi": 51, + "v8": "5.5" + }, + "7.8.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.9.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.10.0": { + "node_abi": 51, + "v8": "5.5" + }, + "7.10.1": { + "node_abi": 51, + "v8": "5.5" + }, + "8.0.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.1": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.2": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.3": { + "node_abi": 57, + "v8": "5.8" + }, + "8.1.4": { + "node_abi": 57, + "v8": "5.8" + }, + "8.2.0": { + "node_abi": 57, + "v8": "5.8" + }, + "8.2.1": { + "node_abi": 57, + "v8": "5.8" + }, + "8.3.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.4.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.5.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.6.0": { + "node_abi": 57, + "v8": "6.0" + }, + "8.7.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.8.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.8.1": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.0": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.1": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.2": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.3": { + "node_abi": 57, + "v8": "6.1" + }, + "8.9.4": { + "node_abi": 57, + "v8": "6.1" + }, + "8.10.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.2": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.3": { + "node_abi": 57, + "v8": "6.2" + }, + "8.11.4": { + "node_abi": 57, + "v8": "6.2" + }, + "8.12.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.13.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.14.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.14.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.15.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.15.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.0": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.1": { + "node_abi": 57, + "v8": "6.2" + }, + "8.16.2": { + "node_abi": 57, + "v8": "6.2" + }, + "8.17.0": { + "node_abi": 57, + "v8": "6.2" + }, + "9.0.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.1.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.2.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.2.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.3.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.4.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.5.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.6.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.6.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.7.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.7.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.8.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.9.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.10.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.10.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.0": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.1": { + "node_abi": 59, + "v8": "6.2" + }, + "9.11.2": { + "node_abi": 59, + "v8": "6.2" + }, + "10.0.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.1.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.2.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.2.1": { + "node_abi": 64, + "v8": "6.6" + }, + "10.3.0": { + "node_abi": 64, + "v8": "6.6" + }, + "10.4.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.4.1": { + "node_abi": 64, + "v8": "6.7" + }, + "10.5.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.6.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.7.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.8.0": { + "node_abi": 64, + "v8": "6.7" + }, + "10.9.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.10.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.11.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.12.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.13.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.14.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.15.3": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.2": { + "node_abi": 64, + "v8": "6.8" + }, + "10.16.3": { + "node_abi": 64, + "v8": "6.8" + }, + "10.17.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.18.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.18.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.19.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.20.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.20.1": { + "node_abi": 64, + "v8": "6.8" + }, + "10.21.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.22.0": { + "node_abi": 64, + "v8": "6.8" + }, + "10.22.1": { + "node_abi": 64, + "v8": "6.8" + }, + "11.0.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.1.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.2.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.3.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.4.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.5.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.6.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.7.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.8.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.9.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.10.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.10.1": { + "node_abi": 67, + "v8": "7.0" + }, + "11.11.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.12.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.13.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.14.0": { + "node_abi": 67, + "v8": "7.0" + }, + "11.15.0": { + "node_abi": 67, + "v8": "7.0" + }, + "12.0.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.1.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.2.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.3.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.3.1": { + "node_abi": 72, + "v8": "7.4" + }, + "12.4.0": { + "node_abi": 72, + "v8": "7.4" + }, + "12.5.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.6.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.7.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.8.0": { + "node_abi": 72, + "v8": "7.5" + }, + "12.8.1": { + "node_abi": 72, + "v8": "7.5" + }, + "12.9.0": { + "node_abi": 72, + "v8": "7.6" + }, + "12.9.1": { + "node_abi": 72, + "v8": "7.6" + }, + "12.10.0": { + "node_abi": 72, + "v8": "7.6" + }, + "12.11.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.11.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.12.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.13.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.13.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.14.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.14.1": { + "node_abi": 72, + "v8": "7.7" + }, + "12.15.0": { + "node_abi": 72, + "v8": "7.7" + }, + "12.16.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.16.3": { + "node_abi": 72, + "v8": "7.8" + }, + "12.17.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.0": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.1": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.2": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.3": { + "node_abi": 72, + "v8": "7.8" + }, + "12.18.4": { + "node_abi": 72, + "v8": "7.8" + }, + "12.19.0": { + "node_abi": 72, + "v8": "7.8" + }, + "13.0.0": { + "node_abi": 79, + "v8": "7.8" + }, + "13.0.1": { + "node_abi": 79, + "v8": "7.8" + }, + "13.1.0": { + "node_abi": 79, + "v8": "7.8" + }, + "13.2.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.3.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.4.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.5.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.6.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.7.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.8.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.9.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.10.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.10.1": { + "node_abi": 79, + "v8": "7.9" + }, + "13.11.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.12.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.13.0": { + "node_abi": 79, + "v8": "7.9" + }, + "13.14.0": { + "node_abi": 79, + "v8": "7.9" + }, + "14.0.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.1.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.2.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.3.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.4.0": { + "node_abi": 83, + "v8": "8.1" + }, + "14.5.0": { + "node_abi": 83, + "v8": "8.3" + }, + "14.6.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.7.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.8.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.9.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.10.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.10.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.11.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.12.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.13.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.13.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.14.0": { + "node_abi": 83, + "v8": "8.4" + }, + "15.0.0": { + "node_abi": 88, + "v8": "8.6" + }, + "15.0.1": { + "node_abi": 88, + "v8": "8.6" + } +} \ No newline at end of file diff --git a/legacy-libs/node-pre-gyp/lib/util/compile.js b/legacy-libs/node-pre-gyp/lib/util/compile.js new file mode 100644 index 0000000..0dc460c --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/compile.js @@ -0,0 +1,87 @@ +"use strict"; + +module.exports = exports; + +var fs = require('fs'); +var path = require('path'); +var win = process.platform == 'win32'; +var existsSync = fs.existsSync || path.existsSync; +var cp = require('child_process'); + +// try to build up the complete path to node-gyp +/* priority: + - node-gyp on ENV:npm_config_node_gyp (https://github.com/npm/npm/pull/4887) + - node-gyp on NODE_PATH + - node-gyp inside npm on NODE_PATH (ignore on iojs) + - node-gyp inside npm beside node exe +*/ +function which_node_gyp() { + var node_gyp_bin; + if (process.env.npm_config_node_gyp) { + try { + node_gyp_bin = process.env.npm_config_node_gyp; + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { } + } + try { + var node_gyp_main = require.resolve('node-gyp'); + node_gyp_bin = path.join(path.dirname( + path.dirname(node_gyp_main)), + 'bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { } + if (process.execPath.indexOf('iojs') === -1) { + try { + var npm_main = require.resolve('npm'); + node_gyp_bin = path.join(path.dirname( + path.dirname(npm_main)), + 'node_modules/node-gyp/bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } + } catch (err) { } + } + var npm_base = path.join(path.dirname( + path.dirname(process.execPath)), + 'lib/node_modules/npm/'); + node_gyp_bin = path.join(npm_base, 'node_modules/node-gyp/bin/node-gyp.js'); + if (existsSync(node_gyp_bin)) { + return node_gyp_bin; + } +} + +module.exports.run_gyp = function(args,opts,callback) { + var shell_cmd = ''; + var cmd_args = []; + if (opts.runtime && opts.runtime == 'node-webkit') { + shell_cmd = 'nw-gyp'; + if (win) shell_cmd += '.cmd'; + } else { + var node_gyp_path = which_node_gyp(); + if (node_gyp_path) { + shell_cmd = process.execPath; + cmd_args.push(node_gyp_path); + } else { + shell_cmd = 'node-gyp'; + if (win) shell_cmd += '.cmd'; + } + } + var final_args = cmd_args.concat(args); + var cmd = cp.spawn(shell_cmd, final_args, {cwd: undefined, env: process.env, stdio: [ 0, 1, 2]}); + cmd.on('error', function (err) { + if (err) { + return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + err + ")")); + } + callback(null,opts); + }); + cmd.on('close', function (code) { + if (code && code !== 0) { + return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + code + ")")); + } + callback(null,opts); + }); +}; diff --git a/legacy-libs/node-pre-gyp/lib/util/handle_gyp_opts.js b/legacy-libs/node-pre-gyp/lib/util/handle_gyp_opts.js new file mode 100644 index 0000000..9f76ea3 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/handle_gyp_opts.js @@ -0,0 +1,103 @@ +"use strict"; + +module.exports = exports = handle_gyp_opts; + +var fs = require('fs'); +var versioning = require('./versioning.js'); +var napi = require('./napi.js'); + +/* + +Here we gather node-pre-gyp generated options (from versioning) and pass them along to node-gyp. + +We massage the args and options slightly to account for differences in what commands mean between +node-pre-gyp and node-gyp (e.g. see the difference between "build" and "rebuild" below) + +Keep in mind: the values inside `argv` and `gyp.opts` below are different depending on whether +node-pre-gyp is called directory, or if it is called in a `run-script` phase of npm. + +We also try to preserve any command line options that might have been passed to npm or node-pre-gyp. +But this is fairly difficult without passing way to much through. For example `gyp.opts` contains all +the process.env and npm pushes a lot of variables into process.env which node-pre-gyp inherits. So we have +to be very selective about what we pass through. + +For example: + +`npm install --build-from-source` will give: + +argv == [ 'rebuild' ] +gyp.opts.argv == { remain: [ 'install' ], + cooked: [ 'install', '--fallback-to-build' ], + original: [ 'install', '--fallback-to-build' ] } + +`./bin/node-pre-gyp build` will give: + +argv == [] +gyp.opts.argv == { remain: [ 'build' ], + cooked: [ 'build' ], + original: [ '-C', 'test/app1', 'build' ] } + +*/ + +// select set of node-pre-gyp versioning info +// to share with node-gyp +var share_with_node_gyp = [ + 'module', + 'module_name', + 'module_path', + 'napi_version', + 'node_abi_napi', + 'napi_build_version', + 'node_napi_label' +]; + +function handle_gyp_opts(gyp, argv, callback) { + + // Collect node-pre-gyp specific variables to pass to node-gyp + var node_pre_gyp_options = []; + // generate custom node-pre-gyp versioning info + var napi_build_version = napi.get_napi_build_version_from_command_args(argv); + var opts = versioning.evaluate(JSON.parse(fs.readFileSync('./package.json')), gyp.opts, napi_build_version); + share_with_node_gyp.forEach(function(key) { + var val = opts[key]; + if (val) { + node_pre_gyp_options.push('--' + key + '=' + val); + } else if (key === 'napi_build_version') { + node_pre_gyp_options.push('--' + key + '=0'); + } else { + if (key !== 'napi_version' && key !== 'node_abi_napi') + return callback(new Error("Option " + key + " required but not found by node-pre-gyp")); + } + }); + + // Collect options that follow the special -- which disables nopt parsing + var unparsed_options = []; + var double_hyphen_found = false; + gyp.opts.argv.original.forEach(function(opt) { + if (double_hyphen_found) { + unparsed_options.push(opt); + } + if (opt == '--') { + double_hyphen_found = true; + } + }); + + // We try respect and pass through remaining command + // line options (like --foo=bar) to node-gyp + var cooked = gyp.opts.argv.cooked; + var node_gyp_options = []; + cooked.forEach(function(value) { + if (value.length > 2 && value.slice(0,2) == '--') { + var key = value.slice(2); + var val = cooked[cooked.indexOf(value)+1]; + if (val && val.indexOf('--') === -1) { // handle '--foo=bar' or ['--foo','bar'] + node_gyp_options.push('--' + key + '=' + val); + } else { // pass through --foo + node_gyp_options.push(value); + } + } + }); + + var result = {'opts':opts,'gyp':node_gyp_options,'pre':node_pre_gyp_options,'unparsed':unparsed_options}; + return callback(null,result); +} diff --git a/legacy-libs/node-pre-gyp/lib/util/napi.js b/legacy-libs/node-pre-gyp/lib/util/napi.js new file mode 100644 index 0000000..a9d1e20 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/napi.js @@ -0,0 +1,205 @@ +"use strict"; + +var fs = require('fs'); + +module.exports = exports; + +var versionArray = process.version + .substr(1) + .replace(/-.*$/, '') + .split('.') + .map(function(item) { + return +item; + }); + +var napi_multiple_commands = [ + 'build', + 'clean', + 'configure', + 'package', + 'publish', + 'reveal', + 'testbinary', + 'testpackage', + 'unpublish' +]; + +var napi_build_version_tag = 'napi_build_version='; + +module.exports.get_napi_version = function(target) { // target may be undefined + // returns the non-zero numeric napi version or undefined if napi is not supported. + // correctly supporting target requires an updated cross-walk + var version = process.versions.napi; // can be undefined + if (!version) { // this code should never need to be updated + if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+ + else if (versionArray[0] === 8) version = 1; // 8.0.0+ + } + return version; +}; + +module.exports.get_napi_version_as_string = function(target) { + // returns the napi version as a string or an empty string if napi is not supported. + var version = module.exports.get_napi_version(target); + return version ? ''+version : ''; +}; + +module.exports.validate_package_json = function(package_json, opts) { // throws Error + + var binary = package_json.binary; + var module_path_ok = pathOK(binary.module_path); + var remote_path_ok = pathOK(binary.remote_path); + var package_name_ok = pathOK(binary.package_name); + var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true); + var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json); + + if (napi_build_versions) { + napi_build_versions.forEach(function(napi_build_version){ + if (!(parseInt(napi_build_version,10) === napi_build_version && napi_build_version > 0)) { + throw new Error("All values specified in napi_versions must be positive integers."); + } + }); + } + + if (napi_build_versions && (!module_path_ok || (!remote_path_ok && !package_name_ok))) { + throw new Error("When napi_versions is specified; module_path and either remote_path or " + + "package_name must contain the substitution string '{napi_build_version}`."); + } + + if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) { + throw new Error("When the substitution string '{napi_build_version}` is specified in " + + "module_path, remote_path, or package_name; napi_versions must also be specified."); + } + + if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) && + module.exports.build_napi_only(package_json)) { + throw new Error( + 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' + + 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' + + 'This Node instance cannot run this module.'); + } + + if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) { + throw new Error( + 'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' + + 'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' + + 'This Node instance cannot run this module.'); + } + +}; + +function pathOK (path) { + return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1); +} + +module.exports.expand_commands = function(package_json, opts, commands) { + var expanded_commands = []; + var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts); + commands.forEach(function(command){ + if (napi_build_versions && command.name === 'install') { + var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts); + var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ]; + expanded_commands.push ({ name: command.name, args: args }); + } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) { + napi_build_versions.forEach(function(napi_build_version){ + var args = command.args.slice(); + args.push (napi_build_version_tag+napi_build_version); + expanded_commands.push ({ name: command.name, args: args }); + }); + } else { + expanded_commands.push (command); + } + }); + return expanded_commands; +}; + +module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined + var log = require('npmlog'); + var napi_build_versions = []; + var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined); + // remove duplicates, verify each napi version can actaully be built + if (package_json.binary && package_json.binary.napi_versions) { + package_json.binary.napi_versions.forEach(function(napi_version) { + var duplicated = napi_build_versions.indexOf(napi_version) !== -1; + if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) { + napi_build_versions.push(napi_version); + } else if (warnings && !duplicated && supported_napi_version) { + log.info('This Node instance does not support builds for N-API version', napi_version); + } + }); + } + if (opts && opts["build-latest-napi-version-only"]) { + var latest_version = 0; + napi_build_versions.forEach(function(napi_version) { + if (napi_version > latest_version) latest_version = napi_version; + }); + napi_build_versions = latest_version ? [ latest_version ] : []; + } + return napi_build_versions.length ? napi_build_versions : undefined; +}; + +module.exports.get_napi_build_versions_raw = function(package_json) { + var napi_build_versions = []; + // remove duplicates + if (package_json.binary && package_json.binary.napi_versions) { + package_json.binary.napi_versions.forEach(function(napi_version) { + if (napi_build_versions.indexOf(napi_version) === -1) { + napi_build_versions.push(napi_version); + } + }); + } + return napi_build_versions.length ? napi_build_versions : undefined; +}; + +module.exports.get_command_arg = function(napi_build_version) { + return napi_build_version_tag + napi_build_version; +}; + +module.exports.get_napi_build_version_from_command_args = function(command_args) { + for (var i = 0; i < command_args.length; i++) { + var arg = command_args[i]; + if (arg.indexOf(napi_build_version_tag) === 0) { + return parseInt(arg.substr(napi_build_version_tag.length),10); + } + } + return undefined; +}; + +module.exports.swap_build_dir_out = function(napi_build_version) { + if (napi_build_version) { + var rm = require('rimraf'); + rm.sync(module.exports.get_build_dir(napi_build_version)); + fs.renameSync('build', module.exports.get_build_dir(napi_build_version)); + } +}; + +module.exports.swap_build_dir_in = function(napi_build_version) { + if (napi_build_version) { + var rm = require('rimraf'); + rm.sync('build'); + fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build'); + } +}; + +module.exports.get_build_dir = function(napi_build_version) { + return 'build-tmp-napi-v'+napi_build_version; +}; + +module.exports.get_best_napi_build_version = function(package_json, opts) { + var best_napi_build_version = 0; + var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts); + if (napi_build_versions) { + var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined); + napi_build_versions.forEach(function(napi_build_version){ + if (napi_build_version > best_napi_build_version && + napi_build_version <= our_napi_version) { + best_napi_build_version = napi_build_version; + } + }); + } + return best_napi_build_version === 0 ? undefined : best_napi_build_version; +}; + +module.exports.build_napi_only = function(package_json) { + return package_json.binary && package_json.binary.package_name && + package_json.binary.package_name.indexOf('{node_napi_label}') === -1; +}; \ No newline at end of file diff --git a/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/index.html b/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/index.html new file mode 100644 index 0000000..244466c --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/index.html @@ -0,0 +1,26 @@ + + + + +Node-webkit-based module test + + + +

Node-webkit-based module test

+ + diff --git a/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/package.json b/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/package.json new file mode 100644 index 0000000..71d03f8 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/nw-pre-gyp/package.json @@ -0,0 +1,9 @@ +{ +"main": "index.html", +"name": "nw-pre-gyp-module-test", +"description": "Node-webkit-based module test.", +"version": "0.0.1", +"window": { + "show": false +} +} diff --git a/legacy-libs/node-pre-gyp/lib/util/s3_setup.js b/legacy-libs/node-pre-gyp/lib/util/s3_setup.js new file mode 100644 index 0000000..5bc42e9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/s3_setup.js @@ -0,0 +1,27 @@ +"use strict"; + +module.exports = exports; + +var url = require('url'); + +var URI_REGEX="^(.*)\.(s3(?:-.*)?)\.amazonaws\.com$"; + +module.exports.detect = function(to,config) { + var uri = url.parse(to); + var hostname_matches = uri.hostname.match(URI_REGEX); + config.prefix = (!uri.pathname || uri.pathname == '/') ? '' : uri.pathname.replace('/',''); + if(!hostname_matches) { + return; + } + if (!config.bucket) { + config.bucket = hostname_matches[1]; + } + if (!config.region) { + var s3_domain = hostname_matches[2]; + if (s3_domain.slice(0,3) == 's3-' && + s3_domain.length >= 3) { + // it appears the region is explicit in the url + config.region = s3_domain.replace('s3-',''); + } + } +}; diff --git a/legacy-libs/node-pre-gyp/lib/util/versioning.js b/legacy-libs/node-pre-gyp/lib/util/versioning.js new file mode 100644 index 0000000..fafb0da --- /dev/null +++ b/legacy-libs/node-pre-gyp/lib/util/versioning.js @@ -0,0 +1,331 @@ +"use strict"; + +module.exports = exports; + +var path = require('path'); +var semver = require('semver'); +var url = require('url'); +var detect_libc = require('detect-libc'); +var napi = require('./napi.js'); + +var abi_crosswalk; + +// This is used for unit testing to provide a fake +// ABI crosswalk that emulates one that is not updated +// for the current version +if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) { + abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK); +} else { + abi_crosswalk = require('./abi_crosswalk.json'); +} + +var major_versions = {}; +Object.keys(abi_crosswalk).forEach(function(v) { + var major = v.split('.')[0]; + if (!major_versions[major]) { + major_versions[major] = v; + } +}); + +function get_electron_abi(runtime, target_version) { + if (!runtime) { + throw new Error("get_electron_abi requires valid runtime arg"); + } + if (typeof target_version === 'undefined') { + // erroneous CLI call + throw new Error("Empty target version is not supported if electron is the target."); + } + // Electron guarantees that patch version update won't break native modules. + var sem_ver = semver.parse(target_version); + return runtime + '-v' + sem_ver.major + '.' + sem_ver.minor; +} +module.exports.get_electron_abi = get_electron_abi; + +function get_node_webkit_abi(runtime, target_version) { + if (!runtime) { + throw new Error("get_node_webkit_abi requires valid runtime arg"); + } + if (typeof target_version === 'undefined') { + // erroneous CLI call + throw new Error("Empty target version is not supported if node-webkit is the target."); + } + return runtime + '-v' + target_version; +} +module.exports.get_node_webkit_abi = get_node_webkit_abi; + +function get_node_abi(runtime, versions) { + if (!runtime) { + throw new Error("get_node_abi requires valid runtime arg"); + } + if (!versions) { + throw new Error("get_node_abi requires valid process.versions object"); + } + var sem_ver = semver.parse(versions.node); + if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series + // https://github.com/mapbox/node-pre-gyp/issues/124 + return runtime+'-v'+versions.node; + } else { + // process.versions.modules added in >= v0.10.4 and v0.11.7 + // https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e + return versions.modules ? runtime+'-v' + (+versions.modules) : + 'v8-' + versions.v8.split('.').slice(0,2).join('.'); + } +} +module.exports.get_node_abi = get_node_abi; + +function get_runtime_abi(runtime, target_version) { + if (!runtime) { + throw new Error("get_runtime_abi requires valid runtime arg"); + } + if (runtime === 'node-webkit') { + return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']); + } else if (runtime === 'electron') { + return get_electron_abi(runtime, target_version || process.versions.electron); + } else { + if (runtime != 'node') { + throw new Error("Unknown Runtime: '" + runtime + "'"); + } + if (!target_version) { + return get_node_abi(runtime,process.versions); + } else { + var cross_obj; + // abi_crosswalk generated with ./scripts/abi_crosswalk.js + if (abi_crosswalk[target_version]) { + cross_obj = abi_crosswalk[target_version]; + } else { + var target_parts = target_version.split('.').map(function(i) { return +i; }); + if (target_parts.length != 3) { // parse failed + throw new Error("Unknown target version: " + target_version); + } + /* + The below code tries to infer the last known ABI compatible version + that we have recorded in the abi_crosswalk.json when an exact match + is not possible. The reasons for this to exist are complicated: + + - We support passing --target to be able to allow developers to package binaries for versions of node + that are not the same one as they are running. This might also be used in combination with the + --target_arch or --target_platform flags to also package binaries for alternative platforms + - When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node + version that is running in memory + - So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look + this info up for all versions + - But we cannot easily predict what the future ABI will be for released versions + - And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly + by being fully available at install time. + - So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release + need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if + you want the `--target` flag to keep working for the latest version + - Which is impractical ^^ + - Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding. + + In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that + only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be + ABI compatible with v0.10.33). + + TODO: use semver module instead of custom version parsing + */ + var major = target_parts[0]; + var minor = target_parts[1]; + var patch = target_parts[2]; + // io.js: yeah if node.js ever releases 1.x this will break + // but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616 + if (major === 1) { + // look for last release that is the same major version + // e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0 + while (true) { + if (minor > 0) --minor; + if (patch > 0) --patch; + var new_iojs_target = '' + major + '.' + minor + '.' + patch; + if (abi_crosswalk[new_iojs_target]) { + cross_obj = abi_crosswalk[new_iojs_target]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target'); + break; + } + if (minor === 0 && patch === 0) { + break; + } + } + } else if (major >= 2) { + // look for last release that is the same major version + if (major_versions[major]) { + cross_obj = abi_crosswalk[major_versions[major]]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + major_versions[major] + ' as ABI compatible target'); + } + } else if (major === 0) { // node.js + if (target_parts[1] % 2 === 0) { // for stable/even node.js series + // look for the last release that is the same minor release + // e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0 + while (--patch > 0) { + var new_node_target = '' + major + '.' + minor + '.' + patch; + if (abi_crosswalk[new_node_target]) { + cross_obj = abi_crosswalk[new_node_target]; + console.log('Warning: node-pre-gyp could not find exact match for ' + target_version); + console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target'); + break; + } + } + } + } + } + if (!cross_obj) { + throw new Error("Unsupported target version: " + target_version); + } + // emulate process.versions + var versions_obj = { + node: target_version, + v8: cross_obj.v8+'.0', + // abi_crosswalk uses 1 for node versions lacking process.versions.modules + // process.versions.modules added in >= v0.10.4 and v0.11.7 + modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined + }; + return get_node_abi(runtime, versions_obj); + } + } +} +module.exports.get_runtime_abi = get_runtime_abi; + +var required_parameters = [ + 'module_name', + 'module_path', + 'host' +]; + +function validate_config(package_json,opts) { + var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n'; + var missing = []; + if (!package_json.main) { + missing.push('main'); + } + if (!package_json.version) { + missing.push('version'); + } + if (!package_json.name) { + missing.push('name'); + } + if (!package_json.binary) { + missing.push('binary'); + } + var o = package_json.binary; + required_parameters.forEach(function(p) { + if (missing.indexOf('binary') > -1) { + missing.pop('binary'); + } + if (!o || o[p] === undefined || o[p] === "") { + missing.push('binary.' + p); + } + }); + if (missing.length >= 1) { + throw new Error(msg+"package.json must declare these properties: \n" + missing.join('\n')); + } + if (o) { + // enforce https over http + var protocol = url.parse(o.host).protocol; + if (protocol === 'http:') { + throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted"); + } + } + napi.validate_package_json(package_json,opts); +} + +module.exports.validate_config = validate_config; + +function eval_template(template,opts) { + Object.keys(opts).forEach(function(key) { + var pattern = '{'+key+'}'; + while (template.indexOf(pattern) > -1) { + template = template.replace(pattern,opts[key]); + } + }); + return template; +} + +// url.resolve needs single trailing slash +// to behave correctly, otherwise a double slash +// may end up in the url which breaks requests +// and a lacking slash may not lead to proper joining +function fix_slashes(pathname) { + if (pathname.slice(-1) != '/') { + return pathname + '/'; + } + return pathname; +} + +// remove double slashes +// note: path.normalize will not work because +// it will convert forward to back slashes +function drop_double_slashes(pathname) { + return pathname.replace(/\/\//g,'/'); +} + +function get_process_runtime(versions) { + var runtime = 'node'; + if (versions['node-webkit']) { + runtime = 'node-webkit'; + } else if (versions.electron) { + runtime = 'electron'; + } + return runtime; +} + +module.exports.get_process_runtime = get_process_runtime; + +var default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz'; +var default_remote_path = ''; + +module.exports.evaluate = function(package_json,options,napi_build_version) { + options = options || {}; + validate_config(package_json,options); // options is a suitable substitute for opts in this case + var v = package_json.version; + var module_version = semver.parse(v); + var runtime = options.runtime || get_process_runtime(process.versions); + var opts = { + name: package_json.name, + configuration: Boolean(options.debug) ? 'Debug' : 'Release', + debug: options.debug, + module_name: package_json.binary.module_name, + version: module_version.version, + prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '', + build: module_version.build.length ? module_version.build.join('.') : '', + major: module_version.major, + minor: module_version.minor, + patch: module_version.patch, + runtime: runtime, + node_abi: get_runtime_abi(runtime,options.target), + node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target), + napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported + napi_build_version: napi_build_version || '', + node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target), + target: options.target || '', + platform: options.target_platform || process.platform, + target_platform: options.target_platform || process.platform, + arch: options.target_arch || process.arch, + target_arch: options.target_arch || process.arch, + libc: options.target_libc || detect_libc.family || 'unknown', + module_main: package_json.main, + toolset : options.toolset || '' // address https://github.com/mapbox/node-pre-gyp/issues/119 + }; + // support host mirror with npm config `--{module_name}_binary_host_mirror` + // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25 + // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ + var host = process.env['npm_config_' + opts.module_name + '_binary_host_mirror'] || package_json.binary.host; + opts.host = fix_slashes(eval_template(host,opts)); + opts.module_path = eval_template(package_json.binary.module_path,opts); + // now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably + if (options.module_root) { + // resolve relative to known module root: works for pre-binding require + opts.module_path = path.join(options.module_root,opts.module_path); + } else { + // resolve relative to current working directory: works for node-pre-gyp commands + opts.module_path = path.resolve(opts.module_path); + } + opts.module = path.join(opts.module_path,opts.module_name + '.node'); + opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path,opts))) : default_remote_path; + var package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name; + opts.package_name = eval_template(package_name,opts); + opts.staged_tarball = path.join('build/stage',opts.remote_path,opts.package_name); + opts.hosted_path = url.resolve(opts.host,opts.remote_path); + opts.hosted_tarball = url.resolve(opts.hosted_path,opts.package_name); + return opts; +}; diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/LICENSE b/legacy-libs/node-pre-gyp/node_modules/minimist/LICENSE new file mode 100644 index 0000000..ee27ba4 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/example/parse.js b/legacy-libs/node-pre-gyp/node_modules/minimist/example/parse.js new file mode 100644 index 0000000..f7c8d49 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.log(argv); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/index.js b/legacy-libs/node-pre-gyp/node_modules/minimist/index.js new file mode 100644 index 0000000..d2afe5e --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/index.js @@ -0,0 +1,245 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {}, unknownFn: null }; + + if (typeof opts['unknown'] === 'function') { + flags.unknownFn = opts['unknown']; + } + + if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { + flags.allBools = true; + } else { + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + } + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function argDefined(key, arg) { + return (flags.allBools && /^--[^=]+$/.test(arg)) || + flags.strings[key] || flags.bools[key] || aliases[key]; + } + + function setArg (key, val, arg) { + if (arg && flags.unknownFn && !argDefined(key, arg)) { + if (flags.unknownFn(arg) === false) return; + } + + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + function setKey (obj, keys, value) { + var o = obj; + for (var i = 0; i < keys.length-1; i++) { + var key = keys[i]; + if (key === '__proto__') return; + if (o[key] === undefined) o[key] = {}; + if (o[key] === Object.prototype || o[key] === Number.prototype + || o[key] === String.prototype) o[key] = {}; + if (o[key] === Array.prototype) o[key] = []; + o = o[key]; + } + + var key = keys[keys.length - 1]; + if (key === '__proto__') return; + if (o === Object.prototype || o === Number.prototype + || o === String.prototype) o = {}; + if (o === Array.prototype) o = []; + if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } + } + + function aliasIsBoolean(key) { + return aliases[key].some(function (x) { + return flags.bools[x]; + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + var key = m[1]; + var value = m[2]; + if (flags.bools[key]) { + value = value !== 'false'; + } + setArg(key, value, arg); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false, arg); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && !flags.allBools + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, next, arg); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next, arg) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { + setArg(letters[j], next.split('=')[1], arg); + broken = true; + break; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next, arg); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2), arg); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !aliasIsBoolean(key) : true)) { + setArg(key, args[i+1], arg); + i++; + } + else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { + setArg(key, args[i+1] === 'true', arg); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true, arg); + } + } + } + else { + if (!flags.unknownFn || flags.unknownFn(arg) !== false) { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + if (opts.stopEarly) { + argv._.push.apply(argv._, args.slice(i + 1)); + break; + } + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + if (opts['--']) { + argv['--'] = new Array(); + notFlags.forEach(function(key) { + argv['--'].push(key); + }); + } + else { + notFlags.forEach(function(key) { + argv._.push(key); + }); + } + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/package.json b/legacy-libs/node-pre-gyp/node_modules/minimist/package.json new file mode 100644 index 0000000..8a6cd7b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "minimist@^1.2.5", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^1.2.5", + "spec": ">=1.2.5 <2.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/mkdirp" + ] + ], + "_from": "minimist@>=1.2.5 <2.0.0", + "_hasShrinkwrap": false, + "_id": "minimist@1.2.5", + "_inCache": true, + "_location": "/node-pre-gyp/minimist", + "_nodeVersion": "12.16.1", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/minimist_1.2.5_1584051379289_0.11145357496686259" + }, + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "_npmVersion": "6.13.4", + "_phantomChildren": {}, + "_requested": { + "raw": "minimist@^1.2.5", + "scope": null, + "escapedName": "minimist", + "name": "minimist", + "rawSpec": "^1.2.5", + "spec": ">=1.2.5 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp/mkdirp" + ], + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "_shasum": "67d66014b66a6a8aaa0c083c5fd58df4e4e97602", + "_shrinkwrap": null, + "_spec": "minimist@^1.2.5", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/mkdirp", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "dependencies": {}, + "description": "parse argument options", + "devDependencies": { + "covert": "^1.0.0", + "tap": "~0.4.0", + "tape": "^3.5.0" + }, + "directories": {}, + "dist": { + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "shasum": "67d66014b66a6a8aaa0c083c5fd58df4e4e97602", + "tarball": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "fileCount": 21, + "unpackedSize": 32384, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJearSzCRA9TVsSAnZWagAAdXQP/37gxveGMGnYPLHEtnLE\nxGoFFRWU82yPya40/uMK45UZl5S48tCIJF+QgifQl4dnRJ0pvPBobZtovjQ3\n9kD9E9my/JJEvytLoM3rIhyaMpfpr68zABVYA8MUVUHsDOIjn6HVr1UR6B7L\nj8AfsLdtmO6Sy6nb8t5TfBuDprsLbGCKqXyUXWOMOJc/9fQN5PEKMJ9bZa2d\nT5gcJ3wxWKJYRt4Wiv6ddQ5xN+4Tnc7pA9yqxz73bn6aaRgLq3c2vam0leGE\nxjVC9OX8riWiPVMJNUqGwC7qa8u59QFos1TZQ8HpBiJLP9L33UdHcYbDNAoZ\nRSSBw3gM3H+eRWIN369POOO8AFrdbAGovSmWcS9RFLDjSm8rWmB+Jx22Z1Na\nc54umOQDXuuAS8TbWsVyLvjKd+UwxHRc0h8e/gMQO2AGFQzTlJAgarCanTrz\nZBAcjJNsE6MKANRqWHobiE38viQOOGqVnCgQ5L4CwcMI7BMH7MFc4ntMLVIO\nxZPbBXHzYi5dfWucd8C11ZTN5Id4D+mdRZbUe8jePZ0WsD/xjABokZuhZziW\n90inv759CQn4JjnDKPQrZlBt+/6L3a+QQHhmNf+WWFKKPdDIpSZ395Kxmqov\nVLunRv2RigRd0r7GQGthStV+sxjCmy/ZgV56PpeFj1j1d/GvUu6/jYwG+J8X\nMbJT\r\n=myam\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "aeb3e27dae0412de5c0494e9563a5f10c82cc7a9", + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "emilbayes", + "email": "github@tixz.dk" + }, + { + "name": "substack", + "email": "substack@gmail.com" + } + ], + "name": "minimist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "scripts": { + "coverage": "covert test/*.js", + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "version": "1.2.5" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/readme.markdown b/legacy-libs/node-pre-gyp/node_modules/minimist/readme.markdown new file mode 100644 index 0000000..5fd97ab --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/readme.markdown @@ -0,0 +1,95 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.log(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# security + +Previous versions had a prototype pollution bug that could cause privilege +escalation in some circumstances when handling untrusted user input. + +Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a boolean, string or array of strings to always treat as +booleans. if `true` will treat all double hyphenated arguments without equal signs +as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values +* `opts.stopEarly` - when true, populate `argv._` with everything after the +first non-option +* `opts['--']` - when true, populate `argv._` with everything before the `--` +and `argv['--']` with everything after the `--`. Here's an example: + + ``` + > require('./')('one two three -- four five --six'.split(' '), { '--': true }) + { _: [ 'one', 'two', 'three' ], + '--': [ 'four', 'five', '--six' ] } + ``` + + Note that with `opts['--']` set, parsing for arguments still stops after the + `--`. + +* `opts.unknown` - a function which is invoked with a command line parameter not +defined in the `opts` configuration object. If the function returns `false`, the +unknown option is not added to `argv`. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/all_bool.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/all_bool.js new file mode 100644 index 0000000..ac83548 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/all_bool.js @@ -0,0 +1,32 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean true (default all --args to boolean)', function (t) { + var argv = parse(['moo', '--honk', 'cow'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); + +test('flag boolean true only affects double hyphen arguments without equals signs', function (t) { + var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], { + boolean: true + }); + + t.deepEqual(argv, { + honk: true, + tacos: 'good', + p: 55, + _: ['moo', 'cow'] + }); + + t.deepEqual(typeof argv.honk, 'boolean'); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/bool.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/bool.js new file mode 100644 index 0000000..5f7dbde --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/bool.js @@ -0,0 +1,178 @@ +var parse = require('../'); +var test = require('tape'); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias array with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var alt = [ '--harp', 'derp' ]; + var opts = { + alias: { 'h': ['herp', 'harp'] }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var altPropertyArgv = parse(alt, opts); + var expected = { + harp: true, + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.same(altPropertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); + +test('boolean --boool=true', function (t) { + var parsed = parse(['--boool=true'], { + default: { + boool: false + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, true); + t.end(); +}); + +test('boolean --boool=false', function (t) { + var parsed = parse(['--boool=false'], { + default: { + boool: true + }, + boolean: ['boool'] + }); + + t.same(parsed.boool, false); + t.end(); +}); + +test('boolean using something similar to true', function (t) { + var opts = { boolean: 'h' }; + var result = parse(['-h', 'true.txt'], opts); + var expected = { + h: true, + '_': ['true.txt'] + }; + + t.same(result, expected); + t.end(); +}); \ No newline at end of file diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/dash.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/dash.js new file mode 100644 index 0000000..5a4fa5b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/dash.js @@ -0,0 +1,31 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); + +test('move arguments after the -- into their own `--` array', function(t) { + t.plan(1); + t.deepEqual( + parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }), + { name: 'John', _: [ 'before' ], '--': [ 'after' ] }); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/default_bool.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/default_bool.js new file mode 100644 index 0000000..780a311 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/default_bool.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); + +test('boolean default to null', function (t) { + var argv = parse([], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, null); + var argv = parse(['--maybe'], { + boolean: 'maybe', + default: { maybe: null } + }); + t.equal(argv.maybe, true); + t.end(); + +}) diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/dotted.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/dotted.js new file mode 100644 index 0000000..d8b3e85 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/dotted.js @@ -0,0 +1,22 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); + +test('dotted default with no alias', function (t) { + var argv = parse('', {default: {'a.b': 11}}); + t.equal(argv.a.b, 11); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/kv_short.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/kv_short.js new file mode 100644 index 0000000..f813b30 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/kv_short.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-b=123' ]); + t.deepEqual(argv, { b: 123, _: [] }); +}); + +test('multi short -k=v' , function (t) { + t.plan(1); + + var argv = parse([ '-a=whatever', '-b=robots' ]); + t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] }); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/long.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/long.js new file mode 100644 index 0000000..5d3a1e0 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/num.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/num.js new file mode 100644 index 0000000..2cc77f4 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/num.js @@ -0,0 +1,36 @@ +var parse = require('../'); +var test = require('tape'); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('already a number', function (t) { + var argv = parse([ '-x', 1234, 789 ]); + t.deepEqual(argv, { x : 1234, _ : [ 789 ] }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse.js new file mode 100644 index 0000000..7b4a2a1 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse.js @@ -0,0 +1,197 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('string and alias', function(t) { + var x = parse([ '--str', '000123' ], { + string: 's', + alias: { s: 'str' } + }); + + t.equal(x.str, '000123'); + t.equal(typeof x.str, 'string'); + t.equal(x.s, '000123'); + t.equal(typeof x.s, 'string'); + + var y = parse([ '-s', '000123' ], { + string: 'str', + alias: { str: 's' } + }); + + t.equal(y.str, '000123'); + t.equal(typeof y.str, 'string'); + t.equal(y.s, '000123'); + t.equal(typeof y.s, 'string'); + t.end(); +}); + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse_modified.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse_modified.js new file mode 100644 index 0000000..ab620dc --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: [123] }); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/proto.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/proto.js new file mode 100644 index 0000000..8649107 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/proto.js @@ -0,0 +1,44 @@ +var parse = require('../'); +var test = require('tape'); + +test('proto pollution', function (t) { + var argv = parse(['--__proto__.x','123']); + t.equal({}.x, undefined); + t.equal(argv.__proto__.x, undefined); + t.equal(argv.x, undefined); + t.end(); +}); + +test('proto pollution (array)', function (t) { + var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']); + t.equal({}.z, undefined); + t.deepEqual(argv.x, [4,5]); + t.equal(argv.x.z, undefined); + t.equal(argv.x.__proto__.z, undefined); + t.end(); +}); + +test('proto pollution (number)', function (t) { + var argv = parse(['--x','5','--x.__proto__.z','100']); + t.equal({}.z, undefined); + t.equal((4).z, undefined); + t.equal(argv.x, 5); + t.equal(argv.x.z, undefined); + t.end(); +}); + +test('proto pollution (string)', function (t) { + var argv = parse(['--x','abc','--x.__proto__.z','def']); + t.equal({}.z, undefined); + t.equal('...'.z, undefined); + t.equal(argv.x, 'abc'); + t.equal(argv.x.z, undefined); + t.end(); +}); + +test('proto pollution (constructor)', function (t) { + var argv = parse(['--constructor.prototype.y','123']); + t.equal({}.y, undefined); + t.equal(argv.y, undefined); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/short.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/short.js new file mode 100644 index 0000000..d513a1c --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/stop_early.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/stop_early.js new file mode 100644 index 0000000..bdf9fbc --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/stop_early.js @@ -0,0 +1,15 @@ +var parse = require('../'); +var test = require('tape'); + +test('stops parsing on the first non-option when stopEarly is set', function (t) { + var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], { + stopEarly: true + }); + + t.deepEqual(argv, { + aaa: 'bbb', + _: ['ccc', '--ddd'] + }); + + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/unknown.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/unknown.js new file mode 100644 index 0000000..462a36b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/unknown.js @@ -0,0 +1,102 @@ +var parse = require('../'); +var test = require('tape'); + +test('boolean and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'true', '--derp', 'true' ]; + var regular = [ '--herp', 'true', '-d', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('flag boolean true any double hyphen argument is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { + boolean: true, + unknown: unknownFn + }); + t.same(unknown, ['--tacos=good', 'cow', '-p']); + t.same(argv, { + honk: true, + _: [] + }); + t.end(); +}); + +test('string and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; + var regular = [ '--herp', 'hello', '-d', 'moon' ]; + var opts = { + alias: { h: 'herp' }, + string: 'h', + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, ['--derp', '-d']); + t.end(); +}); + +test('default and alias is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '-h', 'hello' ]; + var regular = [ '--herp', 'hello' ]; + var opts = { + default: { 'h': 'bar' }, + alias: { 'h': 'herp' }, + unknown: unknownFn + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + + t.same(unknown, []); + t.end(); + unknownFn(); // exercise fn for 100% coverage +}); + +test('value following -- is not unknown', function (t) { + var unknown = []; + function unknownFn(arg) { + unknown.push(arg); + return false; + } + var aliased = [ '--bad', '--', 'good', 'arg' ]; + var opts = { + '--': true, + unknown: unknownFn + }; + var argv = parse(aliased, opts); + + t.same(unknown, ['--bad']); + t.same(argv, { + '--': ['good', 'arg'], + '_': [] + }) + t.end(); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/minimist/test/whitespace.js b/legacy-libs/node-pre-gyp/node_modules/minimist/test/whitespace.js new file mode 100644 index 0000000..8a52a58 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/LICENSE b/legacy-libs/node-pre-gyp/node_modules/mkdirp/LICENSE new file mode 100644 index 0000000..432d1ae --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/cmd.js b/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/cmd.js new file mode 100644 index 0000000..d95de15 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/cmd.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var mkdirp = require('../'); +var minimist = require('minimist'); +var fs = require('fs'); + +var argv = minimist(process.argv.slice(2), { + alias: { m: 'mode', h: 'help' }, + string: [ 'mode' ] +}); +if (argv.help) { + fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); + return; +} + +var paths = argv._.slice(); +var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; + +(function next () { + if (paths.length === 0) return; + var p = paths.shift(); + + if (mode === undefined) mkdirp(p, cb) + else mkdirp(p, mode, cb) + + function cb (err) { + if (err) { + console.error(err.message); + process.exit(1); + } + else next(); + } +})(); diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/usage.txt b/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/usage.txt new file mode 100644 index 0000000..f952aa2 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/bin/usage.txt @@ -0,0 +1,12 @@ +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/index.js b/legacy-libs/node-pre-gyp/node_modules/mkdirp/index.js new file mode 100644 index 0000000..468d7cd --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/index.js @@ -0,0 +1,99 @@ +var path = require('path'); +var fs = require('fs'); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + var cb = f || function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return cb(er); + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/package.json b/legacy-libs/node-pre-gyp/node_modules/mkdirp/package.json new file mode 100644 index 0000000..86e9629 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + { + "raw": "mkdirp@^0.5.3", + "scope": null, + "escapedName": "mkdirp", + "name": "mkdirp", + "rawSpec": "^0.5.3", + "spec": ">=0.5.3 <0.6.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp" + ] + ], + "_from": "mkdirp@>=0.5.3 <0.6.0", + "_hasShrinkwrap": false, + "_id": "mkdirp@0.5.5", + "_inCache": true, + "_location": "/node-pre-gyp/mkdirp", + "_nodeVersion": "13.10.1", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/mkdirp_0.5.5_1585933946291_0.6504650567992927" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "6.14.4", + "_phantomChildren": {}, + "_requested": { + "raw": "mkdirp@^0.5.3", + "scope": null, + "escapedName": "mkdirp", + "name": "mkdirp", + "rawSpec": "^0.5.3", + "spec": ">=0.5.3 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp", + "/node-pre-gyp/tar" + ], + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "_shasum": "d91cefd62d1436ca0f41620e251288d420099def", + "_shrinkwrap": null, + "_spec": "mkdirp@^0.5.3", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "bugs": { + "url": "https://github.com/substack/node-mkdirp/issues" + }, + "dependencies": { + "minimist": "^1.2.5" + }, + "description": "Recursively mkdir, like `mkdir -p`", + "devDependencies": { + "mock-fs": "^3.7.0", + "tap": "^5.4.2" + }, + "directories": {}, + "dist": { + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "shasum": "d91cefd62d1436ca0f41620e251288d420099def", + "tarball": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "fileCount": 6, + "unpackedSize": 7531, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh256CRA9TVsSAnZWagAAlzoP/iLuWMWGqLMB70xGqJjf\nCnzJKbwcC2F1ek5f5gL7VLncqA5AoOER5pGmiLw9AhDFU/CK40uutHnujivh\nBNuO+uoweFrBsgS0bKCUBdSWzVABItvv3eJ2l6j7s9mbhiZgmu7weOT0WMcs\nZi1nmsMDeyqxCZUIwz2FJFOlU3QdaiuaXCnW8L/VaxdwUgy7rlLbu4qCKYlP\n8IdkkSUpXksaw6KE7QfFOmc+lM62CaNxIzto/B03ovHaUAUQrAeow8Ly/n8j\nhg+CiTScKeBvjKwMskoeYdV56cDsMQLyLLivlQt+AMN2KcHcE0qqvsvgxGwe\nBXTfvW9hpVsYLj6rICcMkU9yHSRlRkQ4fAInXSwvpzzzIPfavd9zSuFbyMsF\nzcZBEgZu0gbilehWhwwvTZ3Bd8WwxliKnkfgVLN+cOO69JSXJCXwIA7n3N06\nGQVKrGqDkLfKD6nSHy8krDknY0MvOhCDcwy2fNh1IdWMFnmF80x5Huhmxr55\npTkwxQr3IGOyePRqu5B2pXIW7HscnAerXAkccyX/FzmUlw3UIaPlPjNnUJDR\nopPRUYOAMHkg0LtrtVnPQCK0YU+siUzIDSjXnYV/fR0416r+RQXhemdgO6Ey\nqx8tIHVSvdKBLOaCzZYuqkDOIJgWC/qwCudv3Hxbj1gwEcCb3X5IvoK/1ok3\nt18G\r\n=XnRj\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "049cf185c9e91727bc505b796a2d16a4fe70d64d", + "homepage": "https://github.com/substack/node-mkdirp#readme", + "keywords": [ + "mkdir", + "directory" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "mkdirp", + "optionalDependencies": {}, + "publishConfig": { + "tag": "legacy" + }, + "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "repository": { + "type": "git", + "url": "git+https://github.com/substack/node-mkdirp.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "0.5.5" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/mkdirp/readme.markdown b/legacy-libs/node-pre-gyp/node_modules/mkdirp/readme.markdown new file mode 100644 index 0000000..fc314bf --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/mkdirp/readme.markdown @@ -0,0 +1,100 @@ +# mkdirp + +Like `mkdir -p`, but in node.js! + +[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) + +# example + +## pow.js + +```js +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); +``` + +Output + +``` +pow! +``` + +And now /tmp/foo/bar/baz exists, huzzah! + +# methods + +```js +var mkdirp = require('mkdirp'); +``` + +## mkdirp(dir, opts, cb) + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `opts.mode`. If `opts` is a non-object, it will be treated as +the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777`. + +`cb(err, made)` fires with the error or the first directory `made` +that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and +`opts.fs.stat(path, cb)`. + +## mkdirp.sync(dir, opts) + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `opts.mode`. If `opts` is a non-object, it will be +treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777`. + +Returns the first directory that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and +`opts.fs.statSync(path)`. + +# usage + +This package also ships with a `mkdirp` command. + +``` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + +``` + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install mkdirp +``` + +to get the library, or + +``` +npm install -g mkdirp +``` + +to get the command. + +# license + +MIT diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/CHANGELOG.md b/legacy-libs/node-pre-gyp/node_modules/nopt/CHANGELOG.md new file mode 100644 index 0000000..82a09fb --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/CHANGELOG.md @@ -0,0 +1,58 @@ +### v4.0.1 (2016-12-14) + +#### WHOOPS + +* [`fb9b1ce`](https://github.com/npm/nopt/commit/fb9b1ce57b3c69b4f7819015be87719204f77ef6) + Merged so many patches at once that the code fencing + ([@adius](https://github.com/adius)) added got broken. Sorry, + ([@adius](https://github.com/adius))! + ([@othiym23](https://github.com/othiym23)) + +### v4.0.0 (2016-12-13) + +#### BREAKING CHANGES + +* [`651d447`](https://github.com/npm/nopt/commit/651d4473946096d341a480bbe56793de3fc706aa) + When parsing String-typed arguments, if the next value is `""`, don't simply + swallow it. ([@samjonester](https://github.com/samjonester)) + +#### PERFORMANCE TWEAKS + +* [`3370ce8`](https://github.com/npm/nopt/commit/3370ce87a7618ba228883861db84ddbcdff252a9) + Simplify initialization. ([@elidoran](https://github.com/elidoran)) +* [`356e58e`](https://github.com/npm/nopt/commit/356e58e3b3b431a4b1af7fd7bdee44c2c0526a09) + Store `Array.isArray(types[arg])` for reuse. + ([@elidoran](https://github.com/elidoran)) +* [`0d95e90`](https://github.com/npm/nopt/commit/0d95e90515844f266015b56d2c80b94e5d14a07e) + Interpret single-item type arrays as a single type. + ([@samjonester](https://github.com/samjonester)) +* [`07c69d3`](https://github.com/npm/nopt/commit/07c69d38b5186450941fbb505550becb78a0e925) + Simplify key-value extraction. ([@elidoran](https://github.com/elidoran)) +* [`39b6e5c`](https://github.com/npm/nopt/commit/39b6e5c65ac47f60cd43a1fbeece5cd4c834c254) + Only call `Date.parse(val)` once. ([@elidoran](https://github.com/elidoran)) +* [`934943d`](https://github.com/npm/nopt/commit/934943dffecb55123a2b15959fe2a359319a5dbd) + Use `osenv.home()` to find a user's home directory instead of assuming it's + always `$HOME`. ([@othiym23](https://github.com/othiym23)) + +#### TEST & CI IMPROVEMENTS + +* [`326ffff`](https://github.com/npm/nopt/commit/326ffff7f78a00bcd316adecf69075f8a8093619) + Fix `/tmp` test to work on Windows. + ([@elidoran](https://github.com/elidoran)) +* [`c89d31a`](https://github.com/npm/nopt/commit/c89d31a49d14f2238bc6672db08da697bbc57f1b) + Only run Windows tests on Windows, only run Unix tests on a Unix. + ([@elidoran](https://github.com/elidoran)) +* [`affd3d1`](https://github.com/npm/nopt/commit/affd3d1d0addffa93006397b2013b18447339366) + Refresh Travis to run the tests against the currently-supported batch of npm + versions. ([@helio](https://github.com/helio)-frota) +* [`55f9449`](https://github.com/npm/nopt/commit/55f94497d163ed4d16dd55fd6c4fb95cc440e66d) + `tap@8.0.1` ([@othiym23](https://github.com/othiym23)) + +#### DOC TWEAKS + +* [`5271229`](https://github.com/npm/nopt/commit/5271229ee7c810217dd51616c086f5d9ab224581) + Use JavaScript code block for syntax highlighting. + ([@adius](https://github.com/adius)) +* [`c0d156f`](https://github.com/npm/nopt/commit/c0d156f229f9994c5dfcec4a8886eceff7a07682) + The code sample in the README had `many2: [ oneThing ]`, and now it has + `many2: [ two, things ]`. ([@silkentrance](https://github.com/silkentrance)) diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/LICENSE b/legacy-libs/node-pre-gyp/node_modules/nopt/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/README.md b/legacy-libs/node-pre-gyp/node_modules/nopt/README.md new file mode 100644 index 0000000..a99531c --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/README.md @@ -0,0 +1,213 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + +```javascript +// my-program.js +var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path, Array] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) +console.log(parsed) +``` + +This would give you support for any of the following: + +```console +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/bin/nopt.js b/legacy-libs/node-pre-gyp/node_modules/nopt/bin/nopt.js new file mode 100644 index 0000000..3232d4c --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/lib/nopt.js b/legacy-libs/node-pre-gyp/node_modules/nopt/lib/nopt.js new file mode 100644 index 0000000..0ec5753 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/lib/nopt.js @@ -0,0 +1,441 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + , osenv = require("osenv") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , argv = { + remain: [], + cooked: args, + original: args.slice(0) + } + + parse(args, data, argv.remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = argv + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + // if we allow Array specifically, then an empty array is how we + // express 'no value here', not null. Allow it. + if (!val.length && type.indexOf(Array) === -1) { + debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array)) + delete data[k] + } + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + + var isWin = process.platform === 'win32' + , homePattern = isWin ? /^~(\/|\\)/ : /^~\// + , home = osenv.home() + + if (home && val.match(homePattern)) { + data[k] = path.resolve(home, val.substr(2)) + } else { + data[k] = path.resolve(val) + } + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + var s = Date.parse(val) + debug("validate Date %j %j %j", k, val, s) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + var at = arg.indexOf('=') + if (at > -1) { + hadEq = true + var v = arg.substr(at + 1) + arg = arg.substr(0, at) + args.splice(i, 1, arg, v) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var argType = types[arg] + var isTypeArray = Array.isArray(argType) + if (isTypeArray && argType.length === 1) { + isTypeArray = false + argType = argType[0] + } + + var isArray = argType === Array || + isTypeArray && argType.indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + argType === Boolean || + isTypeArray && argType.indexOf(Boolean) !== -1 || + (typeof argType === 'undefined' && !hadEq) || + (la === "false" && + (argType === null || + isTypeArray && ~argType.indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (isTypeArray && la) { + if (~argType.indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~argType.indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~argType.indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (argType === String) { + if (la === undefined) { + la = "" + } else if (la.match(/^-{1,2}[^-]+/)) { + la = "" + i -- + } + } + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/legacy-libs/node-pre-gyp/node_modules/nopt/package.json b/legacy-libs/node-pre-gyp/node_modules/nopt/package.json new file mode 100644 index 0000000..e480d6e --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/nopt/package.json @@ -0,0 +1,125 @@ +{ + "_args": [ + [ + { + "raw": "nopt@^4.0.1", + "scope": null, + "escapedName": "nopt", + "name": "nopt", + "rawSpec": "^4.0.1", + "spec": ">=4.0.1 <5.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp" + ] + ], + "_from": "nopt@>=4.0.1 <5.0.0", + "_hasShrinkwrap": false, + "_id": "nopt@4.0.3", + "_inCache": true, + "_location": "/node-pre-gyp/nopt", + "_nodeVersion": "13.9.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/nopt_4.0.3_1583704435982_0.1350573274257274" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "6.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "nopt@^4.0.1", + "scope": null, + "escapedName": "nopt", + "name": "nopt", + "rawSpec": "^4.0.1", + "spec": ">=4.0.1 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp" + ], + "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "_shasum": "a375cad9d02fd921278d954c2254d5aa57e15e48", + "_shrinkwrap": null, + "_spec": "nopt@^4.0.1", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "bugs": { + "url": "https://github.com/npm/nopt/issues" + }, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "devDependencies": { + "tap": "^14.10.6" + }, + "directories": {}, + "dist": { + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "shasum": "a375cad9d02fd921278d954c2254d5aa57e15e48", + "tarball": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "fileCount": 6, + "unpackedSize": 25815, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeZWl0CRA9TVsSAnZWagAAwAYP/jratQa5m7DIaS1qetL/\n0ECOaoClnnuJS4D4Tuc/+6FOaidSGyjdjUgsBR6F+RN9wcvRAwh9s7rC3mz6\nsPO2D40RI7yeX9kKhKCwNpH6q3SM/BL5DG0VA5Xf4iJ7fa1Cox7/qlgrRib3\nB01yvqX9XO1tpDEfQAi3B9JxCE5IWuEmOR2v6i69pPQbw1HaJf6SCuIjInjc\nuj1jTLOB/vtD21CuQOKEOj+gKg18eyuQcgXOKHWDAeYfps79ucP9VKHWvnMT\neB9N2PB+VeAfoO8jgDYxc+mPFP6tlOCV6sn/+c9Ak/mUanzhmQYJbkf7TYtC\n9e+zAc0AcvqM+SQEkzkcPwVxmC7M0rQOFoxQ/p7L1buU0gxBFAqUDIE+aDmu\n74aMO0Qocbq7YpwL92GNfU8rcfoRIPZwmAhgTZn2rdsrcpA5dSqUPzCi1c/K\nVeNNoTeBDb2J3Hu/ZACX1Z+7VjlxS49irDqJDRnE/93Sg1wZU7bVfG66+KVK\nwanHViGa77G8SgpO9OiJy84ElpiPnL91s25BCGhLhhawCJxHrak6sutdV9BW\nnF4dtzDO5TUIaPrPMEgBAGsvkVdrLPTO5FvBOQPRqf7h2NsOf4/U6P2yZOI6\n+Mkd6Rif2TdaqtoujHFncKm3LmE3jiIJSbb/R1r9+vvE0mxmuj7fSOF8uuIR\nrzwT\r\n=udJ+\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "2b1ef35dfaaee7a79a7e1b5ed83dcda2853214d4", + "homepage": "https://github.com/npm/nopt#readme", + "license": "ISC", + "main": "lib/nopt.js", + "maintainers": [ + { + "name": "adam_baldwin", + "email": "evilpacket@gmail.com" + }, + { + "name": "ahmadnassri", + "email": "ahmad@ahmadnassri.com" + }, + { + "name": "claudiahdz", + "email": "cghr1990@gmail.com" + }, + { + "name": "darcyclarke", + "email": "darcy@darcyclarke.me" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "mikemimik", + "email": "mike@mikecorp.ca" + }, + { + "name": "ruyadorno", + "email": "ruyadorno@hotmail.com" + } + ], + "name": "nopt", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/nopt.git" + }, + "scripts": { + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "preversion": "npm test", + "test": "tap test/*.js" + }, + "version": "4.0.3" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/safe-buffer/LICENSE b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/safe-buffer/README.md b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.d.ts b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.js b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..f8d3ec9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/safe-buffer/package.json b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..5cba56a --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/safe-buffer/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + { + "raw": "safe-buffer@^5.1.2", + "scope": null, + "escapedName": "safe-buffer", + "name": "safe-buffer", + "rawSpec": "^5.1.2", + "spec": ">=5.1.2 <6.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/tar" + ] + ], + "_from": "safe-buffer@>=5.1.2 <6.0.0", + "_hasShrinkwrap": false, + "_id": "safe-buffer@5.2.1", + "_inCache": true, + "_location": "/node-pre-gyp/safe-buffer", + "_nodeVersion": "14.2.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/safe-buffer_5.2.1_1589128650648_0.9327019726340318" + }, + "_npmUser": { + "name": "feross", + "email": "feross@feross.org" + }, + "_npmVersion": "6.14.5", + "_phantomChildren": {}, + "_requested": { + "raw": "safe-buffer@^5.1.2", + "scope": null, + "escapedName": "safe-buffer", + "name": "safe-buffer", + "rawSpec": "^5.1.2", + "spec": ">=5.1.2 <6.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp/tar" + ], + "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "_shasum": "1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", + "_shrinkwrap": null, + "_spec": "safe-buffer@^5.1.2", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/tar", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "dependencies": {}, + "description": "Safer Node.js Buffer API", + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "directories": {}, + "dist": { + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "shasum": "1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6", + "tarball": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "fileCount": 5, + "unpackedSize": 32101, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuC3LCRA9TVsSAnZWagAA92oP+wTbxk5kLetvO9lp2gMy\nZUYhmm7VY3AO5juqtmAesac386vdk95/HMCVAg/97R2DU0VMavfmGB9cmj8A\ntI6Y34m0ulBECS/wjfbLfJI7iL0VkSPgzjkS6fqlDS6s2jOMy2BH/YghMGKh\n8Df0WtQdcGQuJ09cJLJ4RJeT860aONJHaZ4ogcCT+VLOTFOoTSSSgwmaPQg1\n/WaX/DA8FykZkt8xuv8N/v4kA+UKMgSN/e1anbYo6VEcmkLtespr0zzB+Sxg\nokylqRPsRxSVurScbju/rWcic7PyOez40gAiuklilD88P7U3Y1t0Rl/HIioH\n5hU8e18vT5zKlSXP65jq7HCNX15USJeWx6RrcL+/nIABBs3LiJt3iwNzOcPX\nNPE5b/36ZIXnR0xTy3fC9ofdZU99od4rcGuBxiGLmE5I/0LVeW7qk5HoNdbc\nLvzeFEPUU5/iCTfDK4JyRRM2jaorfpG08fgmbpSBDKxGKam2vf933Ah8sXX5\nGLPB0V7x9fb6OC4BwNZooCnVOZvX66++JoIuUyPKKGoYuKNpiNq+AXTOmg4l\nLTkTD8FW/iSkfosNxNhVz3ToEhD32E+dMv1/pQRjZKA0o2sbtA0RcKe0TF5G\nYmSbvYmitk9Xne+dvQQtto30rxGjOJHKgVP/TtD/4zMHNhG+Zh0T+pDmP0VC\n43rI\r\n=qAuV\r\n-----END PGP SIGNATURE-----\r\n" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "gitHead": "89d3d5b4abd6308c6008499520373d204ada694b", + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "feross", + "email": "feross@feross.org" + }, + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "safe-buffer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "types": "index.d.ts", + "version": "5.2.1" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/LICENSE b/legacy-libs/node-pre-gyp/node_modules/tar/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/README.md b/legacy-libs/node-pre-gyp/node_modules/tar/README.md new file mode 100644 index 0000000..034e486 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/README.md @@ -0,0 +1,954 @@ +# node-tar + +[![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar) + +[Fast](./benchmarks) and full-featured Tar for Node.js + +The API is designed to mimic the behavior of `tar(1)` on unix systems. +If you are familiar with how tar works, most of this will hopefully be +straightforward for you. If not, then hopefully this module can teach +you useful unix skills that may come in handy someday :) + +## Background + +A "tar file" or "tarball" is an archive of file system entries +(directories, files, links, etc.) The name comes from "tape archive". +If you run `man tar` on almost any Unix command line, you'll learn +quite a bit about what it can do, and its history. + +Tar has 5 main top-level commands: + +* `c` Create an archive +* `r` Replace entries within an archive +* `u` Update entries within an archive (ie, replace if they're newer) +* `t` List out the contents of an archive +* `x` Extract an archive to disk + +The other flags and options modify how this top level function works. + +## High-Level API + +These 5 functions are the high-level API. All of them have a +single-character name (for unix nerds familiar with `tar(1)`) as well +as a long name (for everyone else). + +All the high-level functions take the following arguments, all three +of which are optional and may be omitted. + +1. `options` - An optional object specifying various options +2. `paths` - An array of paths to add or extract +3. `callback` - Called when the command is completed, if async. (If + sync or no file specified, providing a callback throws a + `TypeError`.) + +If the command is sync (ie, if `options.sync=true`), then the +callback is not allowed, since the action will be completed immediately. + +If a `file` argument is specified, and the command is async, then a +`Promise` is returned. In this case, if async, a callback may be +provided which is called when the command is completed. + +If a `file` option is not specified, then a stream is returned. For +`create`, this is a readable stream of the generated archive. For +`list` and `extract` this is a writable stream that an archive should +be written into. If a file is not specified, then a callback is not +allowed, because you're already getting a stream to work with. + +`replace` and `update` only work on existing archives, and so require +a `file` argument. + +Sync commands without a file argument return a stream that acts on its +input immediately in the same tick. For readable streams, this means +that all of the data is immediately available by calling +`stream.read()`. For writable streams, it will be acted upon as soon +as it is provided, but this can be at any time. + +### Warnings + +Some things cause tar to emit a warning, but should usually not cause +the entire operation to fail. There are three ways to handle +warnings: + +1. **Ignore them** (default) Invalid entries won't be put in the + archive, and invalid entries won't be unpacked. This is usually + fine, but can hide failures that you might care about. +2. **Notice them** Add an `onwarn` function to the options, or listen + to the `'warn'` event on any tar stream. The function will get + called as `onwarn(message, data)`. Handle as appropriate. +3. **Explode them.** Set `strict: true` in the options object, and + `warn` messages will be emitted as `'error'` events instead. If + there's no `error` handler, this causes the program to crash. If + used with a promise-returning/callback-taking method, then it'll + send the error to the promise/callback. + +### Examples + +The API mimics the `tar(1)` command line functionality, with aliases +for more human-readable option and function names. The goal is that +if you know how to use `tar(1)` in Unix, then you know how to use +`require('tar')` in JavaScript. + +To replicate `tar czf my-tarball.tgz files and folders`, you'd do: + +```js +tar.c( + { + gzip: , + file: 'my-tarball.tgz' + }, + ['some', 'files', 'and', 'folders'] +).then(_ => { .. tarball has been created .. }) +``` + +To replicate `tar cz files and folders > my-tarball.tgz`, you'd do: + +```js +tar.c( // or tar.create + { + gzip: + }, + ['some', 'files', 'and', 'folders'] +).pipe(fs.createWriteStream('my-tarball.tgz')) +``` + +To replicate `tar xf my-tarball.tgz` you'd do: + +```js +tar.x( // or tar.extract( + { + file: 'my-tarball.tgz' + } +).then(_=> { .. tarball has been dumped in cwd .. }) +``` + +To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`: + +```js +fs.createReadStream('my-tarball.tgz').pipe( + tar.x({ + strip: 1, + C: 'some-dir' // alias for cwd:'some-dir', also ok + }) +) +``` + +To replicate `tar tf my-tarball.tgz`, do this: + +```js +tar.t({ + file: 'my-tarball.tgz', + onentry: entry => { .. do whatever with it .. } +}) +``` + +To replicate `cat my-tarball.tgz | tar t` do: + +```js +fs.createReadStream('my-tarball.tgz') + .pipe(tar.t()) + .on('entry', entry => { .. do whatever with it .. }) +``` + +To do anything synchronous, add `sync: true` to the options. Note +that sync functions don't take a callback and don't return a promise. +When the function returns, it's already done. Sync methods without a +file argument return a sync stream, which flushes immediately. But, +of course, it still won't be done until you `.end()` it. + +To filter entries, add `filter: ` to the options. +Tar-creating methods call the filter with `filter(path, stat)`. +Tar-reading methods (including extraction) call the filter with +`filter(path, entry)`. The filter is called in the `this`-context of +the `Pack` or `Unpack` stream object. + +The arguments list to `tar t` and `tar x` specify a list of filenames +to extract or list, so they're equivalent to a filter that tests if +the file is in the list. + +For those who _aren't_ fans of tar's single-character command names: + +``` +tar.c === tar.create +tar.r === tar.replace (appends to archive, file is required) +tar.u === tar.update (appends if newer, file is required) +tar.x === tar.extract +tar.t === tar.list +``` + +Keep reading for all the command descriptions and options, as well as +the low-level API that they are built on. + +### tar.c(options, fileList, callback) [alias: tar.create] + +Create a tarball archive. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Write the tarball archive to the specified filename. If this + is specified, then the callback will be fired when the file has been + written, and a promise will be returned that resolves when the file + is written. If a filename is not specified, then a Readable Stream + will be returned which will emit the file data. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. If this is set, + and a file is not provided, then the resulting stream will already + have the data ready to `read` or `emit('data')` as soon as you + request it. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `mode` The mode to set on the created file archive +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + + +The following options are mostly internal, but can be modified in some +advanced use cases, such as re-using caches between runs. + +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `readdirCache` A Map object that caches calls to `readdir`. +- `jobs` A number specifying how many concurrent jobs to run. + Defaults to 4. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. + +### tar.x(options, fileList, callback) [alias: tar.extract] + +Extract a tarball archive. + +The `fileList` is an array of paths to extract from the tarball. If +no paths are provided, then all the entries are extracted. + +If the archive is gzipped, then tar will detect this and unzip it. + +Note that all directories that are created will be forced to be +writable, readable, and listable by their owner, to avoid cases where +a directory prevents extraction of child entries by virtue of its +mode. + +Most extraction errors will cause a `warn` event to be emitted. If +the `cwd` is missing, or not a directory, then the extraction will +fail completely. + +The following options are supported: + +- `cwd` Extract files relative to the specified directory. Defaults + to `process.cwd()`. If provided, this must exist and must be a + directory. [Alias: `C`] +- `file` The archive file to extract. If not specified, then a + Writable stream is returned where the archive data should be + written. [Alias: `f`] +- `sync` Create files and directories synchronously. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being unpacked. Return `true` to unpack the entry from the + archive, or `false` to skip it. +- `newer` Set to true to keep the existing file on disk if it's newer + than the file in the archive. [Alias: `keep-newer`, + `keep-newer-files`] +- `keep` Do not overwrite existing files. In particular, if a file + appears more than once in an archive, later copies will not + overwrite earlier copies. [Alias: `k`, `keep-existing`] +- `preservePaths` Allow absolute paths, paths containing `..`, and + extracting through symbolic links. By default, `/` is stripped from + absolute paths, `..` paths are not extracted, and any file whose + location would be modified by a symbolic link is not extracted. + [Alias: `P`] +- `unlink` Unlink files before creating them. Without this option, + tar overwrites existing files, which preserves existing hardlinks. + With this option, existing hardlinks will be broken, as will any + symlink that would affect the location of an extracted file. [Alias: + `U`] +- `strip` Remove the specified number of leading path elements. + Pathnames with fewer elements will be silently skipped. Note that + the pathname is edited after applying the filter, but before + security checks. [Alias: `strip-components`, `stripComponents`] +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `preserveOwner` If true, tar will set the `uid` and `gid` of + extracted entries to the `uid` and `gid` fields in the archive. + This defaults to true when run as root, and false otherwise. If + false, then files and directories will be set with the owner and + group of the user running the process. This is similar to `-p` in + `tar(1)`, but ACLs and other system-specific data is never unpacked + in this implementation, and modes are set by default already. + [Alias: `p`] +- `uid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified user id, regardless of the `uid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `gid` option. +- `gid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified group id, regardless of the `gid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `uid` option. +- `noMtime` Set to true to omit writing `mtime` value for extracted + entries. [Alias: `m`, `no-mtime`] +- `transform` Provide a function that takes an `entry` object, and + returns a stream, or any falsey value. If a stream is provided, + then that stream's data will be written instead of the contents of + the archive entry. If a falsey value is provided, then the entry is + written to disk as normal. (To exclude items from extraction, use + the `filter` option described above.) +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. + +The following options are mostly internal, but can be modified in some +advanced use cases, such as re-using caches between runs. + +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `umask` Filter the modes of entries like `process.umask()`. +- `dmode` Default mode for directories +- `fmode` Default mode for files +- `dirCache` A Map object of which directories exist. +- `maxMetaEntrySize` The maximum size of meta entries that is + supported. Defaults to 1 MB. + +Note that using an asynchronous stream type with the `transform` +option will cause undefined behavior in sync extractions. +[MiniPass](http://npm.im/minipass)-based streams are designed for this +use case. + +### tar.t(options, fileList, callback) [alias: tar.list] + +List the contents of a tarball archive. + +The `fileList` is an array of paths to list from the tarball. If +no paths are provided, then all the entries are listed. + +If the archive is gzipped, then tar will detect this and unzip it. + +Returns an event emitter that emits `entry` events with +`tar.ReadEntry` objects. However, they don't emit `'data'` or `'end'` +events. (If you want to get actual readable entries, use the +`tar.Parse` class instead.) + +The following options are supported: + +- `cwd` Extract files relative to the specified directory. Defaults + to `process.cwd()`. [Alias: `C`] +- `file` The archive file to list. If not specified, then a + Writable stream is returned where the archive data should be + written. [Alias: `f`] +- `sync` Read the specified file synchronously. (This has no effect + when a file option isn't specified, because entries are emitted as + fast as they are parsed from the stream anyway.) +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being listed. Return `true` to emit the entry from the + archive, or `false` to skip it. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. This is important for when both `file` and + `sync` are set, because it will be called synchronously. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noResume` By default, `entry` streams are resumed immediately after + the call to `onentry`. Set `noResume: true` to suppress this + behavior. Note that by opting into this, the stream will never + complete until the entry data is consumed. + +### tar.u(options, fileList, callback) [alias: tar.update] + +Add files to an archive if they are newer than the entry already in +the tarball archive. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Required. Write the tarball archive to the specified + filename. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for adding entries to the + archive. Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + +### tar.r(options, fileList, callback) [alias: tar.replace] + +Add files to an existing archive. Because later entries override +earlier entries, this effectively replaces any existing entries. + +The `fileList` is an array of paths to add to the tarball. Adding a +directory also adds its children recursively. + +An entry in `fileList` that starts with an `@` symbol is a tar archive +whose entries will be added. To add a file that starts with `@`, +prepend it with `./`. + +The following options are supported: + +- `file` Required. Write the tarball archive to the specified + filename. [Alias: `f`] +- `sync` Act synchronously. If this is set, then any provided file + will be fully written after the call to `tar.c`. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for adding entries to the + archive. Defaults to `process.cwd()`. [Alias: `C`] +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` [Alias: `z`] +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. [Alias: `P`] +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. [Alias: `n`] +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. [Alias: `L`, `h`] +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + [Alias: `m`, `no-mtime`] +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + + +## Low-Level API + +### class tar.Pack + +A readable tar stream. + +Has all the standard readable stream interface stuff. `'data'` and +`'end'` events, `read()` method, `pause()` and `resume()`, etc. + +#### constructor(options) + +The following options are supported: + +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `prefix` A path portion to prefix onto the entries in the archive. +- `gzip` Set to any truthy value to create a gzipped archive, or an + object with settings for `zlib.Gzip()` +- `filter` A function that gets called with `(path, stat)` for each + entry being added. Return `true` to add the entry to the archive, + or `false` to omit it. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `readdirCache` A Map object that caches calls to `readdir`. +- `jobs` A number specifying how many concurrent jobs to run. + Defaults to 4. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 16 MB. +- `noDirRecurse` Do not recursively archive the contents of + directories. +- `follow` Set to true to pack the targets of symbolic links. Without + this option, symbolic links are archived as such. +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. +- `mtime` Set to a `Date` object to force a specific `mtime` for + everything added to the archive. Overridden by `noMtime`. + +#### add(path) + +Adds an entry to the archive. Returns the Pack stream. + +#### write(path) + +Adds an entry to the archive. Returns true if flushed. + +#### end() + +Finishes the archive. + +### class tar.Pack.Sync + +Synchronous version of `tar.Pack`. + +### class tar.Unpack + +A writable stream that unpacks a tar archive onto the file system. + +All the normal writable stream stuff is supported. `write()` and +`end()` methods, `'drain'` events, etc. + +Note that all directories that are created will be forced to be +writable, readable, and listable by their owner, to avoid cases where +a directory prevents extraction of child entries by virtue of its +mode. + +`'close'` is emitted when it's done writing stuff to the file system. + +Most unpack errors will cause a `warn` event to be emitted. If the +`cwd` is missing, or not a directory, then an error will be emitted. + +#### constructor(options) + +- `cwd` Extract files relative to the specified directory. Defaults + to `process.cwd()`. If provided, this must exist and must be a + directory. +- `filter` A function that gets called with `(path, entry)` for each + entry being unpacked. Return `true` to unpack the entry from the + archive, or `false` to skip it. +- `newer` Set to true to keep the existing file on disk if it's newer + than the file in the archive. +- `keep` Do not overwrite existing files. In particular, if a file + appears more than once in an archive, later copies will not + overwrite earlier copies. +- `preservePaths` Allow absolute paths, paths containing `..`, and + extracting through symbolic links. By default, `/` is stripped from + absolute paths, `..` paths are not extracted, and any file whose + location would be modified by a symbolic link is not extracted. +- `unlink` Unlink files before creating them. Without this option, + tar overwrites existing files, which preserves existing hardlinks. + With this option, existing hardlinks will be broken, as will any + symlink that would affect the location of an extracted file. +- `strip` Remove the specified number of leading path elements. + Pathnames with fewer elements will be silently skipped. Note that + the pathname is edited after applying the filter, but before + security checks. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `umask` Filter the modes of entries like `process.umask()`. +- `dmode` Default mode for directories +- `fmode` Default mode for files +- `dirCache` A Map object of which directories exist. +- `maxMetaEntrySize` The maximum size of meta entries that is + supported. Defaults to 1 MB. +- `preserveOwner` If true, tar will set the `uid` and `gid` of + extracted entries to the `uid` and `gid` fields in the archive. + This defaults to true when run as root, and false otherwise. If + false, then files and directories will be set with the owner and + group of the user running the process. This is similar to `-p` in + `tar(1)`, but ACLs and other system-specific data is never unpacked + in this implementation, and modes are set by default already. +- `win32` True if on a windows platform. Causes behavior where + filenames containing `<|>?` chars are converted to + windows-compatible values while being unpacked. +- `uid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified user id, regardless of the `uid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `gid` option. +- `gid` Set to a number to force ownership of all extracted files and + folders, and all implicitly created directories, to be owned by the + specified group id, regardless of the `gid` field in the archive. + Cannot be used along with `preserveOwner`. Requires also setting a + `uid` option. +- `noMtime` Set to true to omit writing `mtime` value for extracted + entries. +- `transform` Provide a function that takes an `entry` object, and + returns a stream, or any falsey value. If a stream is provided, + then that stream's data will be written instead of the contents of + the archive entry. If a falsey value is provided, then the entry is + written to disk as normal. (To exclude items from extraction, use + the `filter` option described above.) +- `strict` Treat warnings as crash-worthy errors. Default false. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. + +### class tar.Unpack.Sync + +Synchronous version of `tar.Unpack`. + +Note that using an asynchronous stream type with the `transform` +option will cause undefined behavior in sync unpack streams. +[MiniPass](http://npm.im/minipass)-based streams are designed for this +use case. + +### class tar.Parse + +A writable stream that parses a tar archive stream. All the standard +writable stream stuff is supported. + +If the archive is gzipped, then tar will detect this and unzip it. + +Emits `'entry'` events with `tar.ReadEntry` objects, which are +themselves readable streams that you can pipe wherever. + +Each `entry` will not emit until the one before it is flushed through, +so make sure to either consume the data (with `on('data', ...)` or +`.pipe(...)`) or throw it away with `.resume()` to keep the stream +flowing. + +#### constructor(options) + +Returns an event emitter that emits `entry` events with +`tar.ReadEntry` objects. + +The following options are supported: + +- `strict` Treat warnings as crash-worthy errors. Default false. +- `filter` A function that gets called with `(path, entry)` for each + entry being listed. Return `true` to emit the entry from the + archive, or `false` to skip it. +- `onentry` A function that gets called with `(entry)` for each entry + that passes the filter. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. + +#### abort(message, error) + +Stop all parsing activities. This is called when there are zlib +errors. It also emits a warning with the message and error provided. + +### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass) + +A representation of an entry that is being read out of a tar archive. + +It has the following fields: + +- `extended` The extended metadata object provided to the constructor. +- `globalExtended` The global extended metadata object provided to the + constructor. +- `remain` The number of bytes remaining to be written into the + stream. +- `blockRemain` The number of 512-byte blocks remaining to be written + into the stream. +- `ignore` Whether this entry should be ignored. +- `meta` True if this represents metadata about the next entry, false + if it represents a filesystem object. +- All the fields from the header, extended header, and global extended + header are added to the ReadEntry object. So it has `path`, `type`, + `size, `mode`, and so on. + +#### constructor(header, extended, globalExtended) + +Create a new ReadEntry object with the specified header, extended +header, and global extended header values. + +### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass) + +A representation of an entry that is being written from the file +system into a tar archive. + +Emits data for the Header, and for the Pax Extended Header if one is +required, as well as any body data. + +Creating a WriteEntry for a directory does not also create +WriteEntry objects for all of the directory contents. + +It has the following fields: + +- `path` The path field that will be written to the archive. By + default, this is also the path from the cwd to the file system + object. +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `myuid` If supported, the uid of the user running the current + process. +- `myuser` The `env.USER` string if set, or `''`. Set as the entry + `uname` field if the file's `uid` matches `this.myuid`. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 1 MB. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `absolute` The absolute path to the entry on the filesystem. By + default, this is `path.resolve(this.cwd, this.path)`, but it can be + overridden explicitly. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `win32` True if on a windows platform. Causes behavior where paths + replace `\` with `/` and filenames containing the windows-compatible + forms of `<|>?:` characters are converted to actual `<|>?:` characters + in the archive. +- `noPax` Suppress pax extended headers. Note that this means that + long paths and linkpaths will be truncated, and large or negative + numeric values may be interpreted incorrectly. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + + +#### constructor(path, options) + +`path` is the path of the entry as it is written in the archive. + +The following options are supported: + +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `maxReadSize` The maximum buffer size for `fs.read()` operations. + Defaults to 1 MB. +- `linkCache` A Map object containing the device and inode value for + any file whose nlink is > 1, to identify hard links. +- `statCache` A Map object that caches calls `lstat`. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `cwd` The current working directory for creating the archive. + Defaults to `process.cwd()`. +- `absolute` The absolute path to the entry on the filesystem. By + default, this is `path.resolve(this.cwd, this.path)`, but it can be + overridden explicitly. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `win32` True if on a windows platform. Causes behavior where paths + replace `\` with `/`. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. +- `umask` Set to restrict the modes on the entries in the archive, + somewhat like how umask works on file creation. Defaults to + `process.umask()` on unix systems, or `0o22` on Windows. + +#### warn(message, data) + +If strict, emit an error with the provided message. + +Othewise, emit a `'warn'` event with the provided message and data. + +### class tar.WriteEntry.Sync + +Synchronous version of tar.WriteEntry + +### class tar.WriteEntry.Tar + +A version of tar.WriteEntry that gets its data from a tar.ReadEntry +instead of from the filesystem. + +#### constructor(readEntry, options) + +`readEntry` is the entry being read out of another archive. + +The following options are supported: + +- `portable` Omit metadata that is system-specific: `ctime`, `atime`, + `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`. Note + that `mtime` is still included, because this is necessary other + time-based operations. +- `preservePaths` Allow absolute paths. By default, `/` is stripped + from absolute paths. +- `strict` Treat warnings as crash-worthy errors. Default false. +- `onwarn` A function that will get called with `(message, data)` for + any warnings encountered. +- `noMtime` Set to true to omit writing `mtime` values for entries. + Note that this prevents using other mtime-based features like + `tar.update` or the `keepNewer` option with the resulting tar archive. + +### class tar.Header + +A class for reading and writing header blocks. + +It has the following fields: + +- `nullBlock` True if decoding a block which is entirely composed of + `0x00` null bytes. (Useful because tar files are terminated by + at least 2 null blocks.) +- `cksumValid` True if the checksum in the header is valid, false + otherwise. +- `needPax` True if the values, as encoded, will require a Pax + extended header. +- `path` The path of the entry. +- `mode` The 4 lowest-order octal digits of the file mode. That is, + read/write/execute permissions for world, group, and owner, and the + setuid, setgid, and sticky bits. +- `uid` Numeric user id of the file owner +- `gid` Numeric group id of the file owner +- `size` Size of the file in bytes +- `mtime` Modified time of the file +- `cksum` The checksum of the header. This is generated by adding all + the bytes of the header block, treating the checksum field itself as + all ascii space characters (that is, `0x20`). +- `type` The human-readable name of the type of entry this represents, + or the alphanumeric key if unknown. +- `typeKey` The alphanumeric key for the type of entry this header + represents. +- `linkpath` The target of Link and SymbolicLink entries. +- `uname` Human-readable user name of the file owner +- `gname` Human-readable group name of the file owner +- `devmaj` The major portion of the device number. Always `0` for + files, directories, and links. +- `devmin` The minor portion of the device number. Always `0` for + files, directories, and links. +- `atime` File access time. +- `ctime` File change time. + +#### constructor(data, [offset=0]) + +`data` is optional. It is either a Buffer that should be interpreted +as a tar Header starting at the specified offset and continuing for +512 bytes, or a data object of keys and values to set on the header +object, and eventually encode as a tar Header. + +#### decode(block, offset) + +Decode the provided buffer starting at the specified offset. + +Buffer length must be greater than 512 bytes. + +#### set(data) + +Set the fields in the data object. + +#### encode(buffer, offset) + +Encode the header fields into the buffer at the specified offset. + +Returns `this.needPax` to indicate whether a Pax Extended Header is +required to properly encode the specified data. + +### class tar.Pax + +An object representing a set of key-value pairs in an Pax extended +header entry. + +It has the following fields. Where the same name is used, they have +the same semantics as the tar.Header field of the same name. + +- `global` True if this represents a global extended header, or false + if it is for a single entry. +- `atime` +- `charset` +- `comment` +- `ctime` +- `gid` +- `gname` +- `linkpath` +- `mtime` +- `path` +- `size` +- `uid` +- `uname` +- `dev` +- `ino` +- `nlink` + +#### constructor(object, global) + +Set the fields set in the object. `global` is a boolean that defaults +to false. + +#### encode() + +Return a Buffer containing the header and body for the Pax extended +header entry, or `null` if there is nothing to encode. + +#### encodeBody() + +Return a string representing the body of the pax extended header +entry. + +#### encodeField(fieldName) + +Return a string representing the key/value encoding for the specified +fieldName, or `''` if the field is unset. + +### tar.Pax.parse(string, extended, global) + +Return a new Pax object created by parsing the contents of the string +provided. + +If the `extended` object is set, then also add the fields from that +object. (This is necessary because multiple metadata entries can +occur in sequence.) + +### tar.types + +A translation table for the `type` field in tar headers. + +#### tar.types.name.get(code) + +Get the human-readable name for a given alphanumeric code. + +#### tar.types.code.get(name) + +Get the alphanumeric code for a given human-readable name. diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/index.js b/legacy-libs/node-pre-gyp/node_modules/tar/index.js new file mode 100644 index 0000000..c9ae06e --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/index.js @@ -0,0 +1,18 @@ +'use strict' + +// high-level commands +exports.c = exports.create = require('./lib/create.js') +exports.r = exports.replace = require('./lib/replace.js') +exports.t = exports.list = require('./lib/list.js') +exports.u = exports.update = require('./lib/update.js') +exports.x = exports.extract = require('./lib/extract.js') + +// classes +exports.Pack = require('./lib/pack.js') +exports.Unpack = require('./lib/unpack.js') +exports.Parse = require('./lib/parse.js') +exports.ReadEntry = require('./lib/read-entry.js') +exports.WriteEntry = require('./lib/write-entry.js') +exports.Header = require('./lib/header.js') +exports.Pax = require('./lib/pax.js') +exports.types = require('./lib/types.js') diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/buffer.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/buffer.js new file mode 100644 index 0000000..7876d5b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/buffer.js @@ -0,0 +1,11 @@ +'use strict' + +// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from +// or Buffer.alloc, and Buffer in node 10 deprecated the ctor. +// .M, this is fine .\^/M.. +let B = Buffer +/* istanbul ignore next */ +if (!B.alloc) { + B = require('safe-buffer').Buffer +} +module.exports = B diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/create.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/create.js new file mode 100644 index 0000000..a37aa52 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/create.js @@ -0,0 +1,105 @@ +'use strict' + +// tar -c +const hlo = require('./high-level-opt.js') + +const Pack = require('./pack.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const t = require('./list.js') +const path = require('path') + +const c = module.exports = (opt_, files, cb) => { + if (typeof files === 'function') + cb = files + + if (Array.isArray(opt_)) + files = opt_, opt_ = {} + + if (!files || !Array.isArray(files) || !files.length) + throw new TypeError('no files or directories specified') + + files = Array.from(files) + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') + throw new TypeError('callback not supported for sync tar functions') + + if (!opt.file && typeof cb === 'function') + throw new TypeError('callback only supported with file option') + + return opt.file && opt.sync ? createFileSync(opt, files) + : opt.file ? createFile(opt, files, cb) + : opt.sync ? createSync(opt, files) + : create(opt, files) +} + +const createFileSync = (opt, files) => { + const p = new Pack.Sync(opt) + const stream = new fsm.WriteStreamSync(opt.file, { + mode: opt.mode || 0o666 + }) + p.pipe(stream) + addFilesSync(p, files) +} + +const createFile = (opt, files, cb) => { + const p = new Pack(opt) + const stream = new fsm.WriteStream(opt.file, { + mode: opt.mode || 0o666 + }) + p.pipe(stream) + + const promise = new Promise((res, rej) => { + stream.on('error', rej) + stream.on('close', res) + p.on('error', rej) + }) + + addFilesAsync(p, files) + + return cb ? promise.then(cb, cb) : promise +} + +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') + t({ + file: path.resolve(p.cwd, file.substr(1)), + sync: true, + noResume: true, + onentry: entry => p.add(entry) + }) + else + p.add(file) + }) + p.end() +} + +const addFilesAsync = (p, files) => { + while (files.length) { + const file = files.shift() + if (file.charAt(0) === '@') + return t({ + file: path.resolve(p.cwd, file.substr(1)), + noResume: true, + onentry: entry => p.add(entry) + }).then(_ => addFilesAsync(p, files)) + else + p.add(file) + } + p.end() +} + +const createSync = (opt, files) => { + const p = new Pack.Sync(opt) + addFilesSync(p, files) + return p +} + +const create = (opt, files) => { + const p = new Pack(opt) + addFilesAsync(p, files) + return p +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/extract.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/extract.js new file mode 100644 index 0000000..cbb458a --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/extract.js @@ -0,0 +1,112 @@ +'use strict' + +// tar -x +const hlo = require('./high-level-opt.js') +const Unpack = require('./unpack.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') + +const x = module.exports = (opt_, files, cb) => { + if (typeof opt_ === 'function') + cb = opt_, files = null, opt_ = {} + else if (Array.isArray(opt_)) + files = opt_, opt_ = {} + + if (typeof files === 'function') + cb = files, files = null + + if (!files) + files = [] + else + files = Array.from(files) + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') + throw new TypeError('callback not supported for sync tar functions') + + if (!opt.file && typeof cb === 'function') + throw new TypeError('callback only supported with file option') + + if (files.length) + filesFilter(opt, files) + + return opt.file && opt.sync ? extractFileSync(opt) + : opt.file ? extractFile(opt, cb) + : opt.sync ? extractSync(opt) + : extract(opt) +} + +// construct a filter that limits the file entries listed +// include child entries if a dir is included +const filesFilter = (opt, files) => { + const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) + const filter = opt.filter + + const mapHas = (file, r) => { + const root = r || path.parse(file).root || '.' + const ret = file === root ? false + : map.has(file) ? map.get(file) + : mapHas(path.dirname(file), root) + + map.set(file, ret) + return ret + } + + opt.filter = filter + ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) + : file => mapHas(file.replace(/\/+$/, '')) +} + +const extractFileSync = opt => { + const u = new Unpack.Sync(opt) + + const file = opt.file + let threw = true + let fd + const stat = fs.statSync(file) + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + const readSize = opt.maxReadSize || 16*1024*1024 + const stream = new fsm.ReadStreamSync(file, { + readSize: readSize, + size: stat.size + }) + stream.pipe(u) +} + +const extractFile = (opt, cb) => { + const u = new Unpack(opt) + const readSize = opt.maxReadSize || 16*1024*1024 + + const file = opt.file + const p = new Promise((resolve, reject) => { + u.on('error', reject) + u.on('close', resolve) + + // This trades a zero-byte read() syscall for a stat + // However, it will usually result in less memory allocation + fs.stat(file, (er, stat) => { + if (er) + reject(er) + else { + const stream = new fsm.ReadStream(file, { + readSize: readSize, + size: stat.size + }) + stream.on('error', reject) + stream.pipe(u) + } + }) + }) + return cb ? p.then(cb, cb) : p +} + +const extractSync = opt => { + return new Unpack.Sync(opt) +} + +const extract = opt => { + return new Unpack(opt) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/header.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/header.js new file mode 100644 index 0000000..d29c3b9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/header.js @@ -0,0 +1,289 @@ +'use strict' +// parse a 512-byte header block to a data object, or vice-versa +// encode returns `true` if a pax extended header is needed, because +// the data could not be faithfully encoded in a simple header. +// (Also, check header.needPax to see if it needs a pax header.) + +const Buffer = require('./buffer.js') +const types = require('./types.js') +const pathModule = require('path').posix +const large = require('./large-numbers.js') + +const SLURP = Symbol('slurp') +const TYPE = Symbol('type') + +class Header { + constructor (data, off, ex, gex) { + this.cksumValid = false + this.needPax = false + this.nullBlock = false + + this.block = null + this.path = null + this.mode = null + this.uid = null + this.gid = null + this.size = null + this.mtime = null + this.cksum = null + this[TYPE] = '0' + this.linkpath = null + this.uname = null + this.gname = null + this.devmaj = 0 + this.devmin = 0 + this.atime = null + this.ctime = null + + if (Buffer.isBuffer(data)) + this.decode(data, off || 0, ex, gex) + else if (data) + this.set(data) + } + + decode (buf, off, ex, gex) { + if (!off) + off = 0 + + if (!buf || !(buf.length >= off + 512)) + throw new Error('need 512 bytes for header') + + this.path = decString(buf, off, 100) + this.mode = decNumber(buf, off + 100, 8) + this.uid = decNumber(buf, off + 108, 8) + this.gid = decNumber(buf, off + 116, 8) + this.size = decNumber(buf, off + 124, 12) + this.mtime = decDate(buf, off + 136, 12) + this.cksum = decNumber(buf, off + 148, 12) + + // if we have extended or global extended headers, apply them now + // See https://github.com/npm/node-tar/pull/187 + this[SLURP](ex) + this[SLURP](gex, true) + + // old tar versions marked dirs as a file with a trailing / + this[TYPE] = decString(buf, off + 156, 1) + if (this[TYPE] === '') + this[TYPE] = '0' + if (this[TYPE] === '0' && this.path.substr(-1) === '/') + this[TYPE] = '5' + + // tar implementations sometimes incorrectly put the stat(dir).size + // as the size in the tarball, even though Directory entries are + // not able to have any body at all. In the very rare chance that + // it actually DOES have a body, we weren't going to do anything with + // it anyway, and it'll just be a warning about an invalid header. + if (this[TYPE] === '5') + this.size = 0 + + this.linkpath = decString(buf, off + 157, 100) + if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') { + this.uname = decString(buf, off + 265, 32) + this.gname = decString(buf, off + 297, 32) + this.devmaj = decNumber(buf, off + 329, 8) + this.devmin = decNumber(buf, off + 337, 8) + if (buf[off + 475] !== 0) { + // definitely a prefix, definitely >130 chars. + const prefix = decString(buf, off + 345, 155) + this.path = prefix + '/' + this.path + } else { + const prefix = decString(buf, off + 345, 130) + if (prefix) + this.path = prefix + '/' + this.path + this.atime = decDate(buf, off + 476, 12) + this.ctime = decDate(buf, off + 488, 12) + } + } + + let sum = 8 * 0x20 + for (let i = off; i < off + 148; i++) { + sum += buf[i] + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i] + } + this.cksumValid = sum === this.cksum + if (this.cksum === null && sum === 8 * 0x20) + this.nullBlock = true + } + + [SLURP] (ex, global) { + for (let k in ex) { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. + if (ex[k] !== null && ex[k] !== undefined && + !(global && k === 'path')) + this[k] = ex[k] + } + } + + encode (buf, off) { + if (!buf) { + buf = this.block = Buffer.alloc(512) + off = 0 + } + + if (!off) + off = 0 + + if (!(buf.length >= off + 512)) + throw new Error('need 512 bytes for header') + + const prefixSize = this.ctime || this.atime ? 130 : 155 + const split = splitPrefix(this.path || '', prefixSize) + const path = split[0] + const prefix = split[1] + this.needPax = split[2] + + this.needPax = encString(buf, off, 100, path) || this.needPax + this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax + this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax + this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax + this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax + this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax + buf[off + 156] = this[TYPE].charCodeAt(0) + this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax + buf.write('ustar\u000000', off + 257, 8) + this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax + this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax + this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax + this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax + this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax + if (buf[off + 475] !== 0) + this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax + else { + this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax + this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax + this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax + } + + let sum = 8 * 0x20 + for (let i = off; i < off + 148; i++) { + sum += buf[i] + } + for (let i = off + 156; i < off + 512; i++) { + sum += buf[i] + } + this.cksum = sum + encNumber(buf, off + 148, 8, this.cksum) + this.cksumValid = true + + return this.needPax + } + + set (data) { + for (let i in data) { + if (data[i] !== null && data[i] !== undefined) + this[i] = data[i] + } + } + + get type () { + return types.name.get(this[TYPE]) || this[TYPE] + } + + get typeKey () { + return this[TYPE] + } + + set type (type) { + if (types.code.has(type)) + this[TYPE] = types.code.get(type) + else + this[TYPE] = type + } +} + +const splitPrefix = (p, prefixSize) => { + const pathSize = 100 + let pp = p + let prefix = '' + let ret + const root = pathModule.parse(p).root || '.' + + if (Buffer.byteLength(pp) < pathSize) + ret = [pp, prefix, false] + else { + // first set prefix to the dir, and path to the base + prefix = pathModule.dirname(pp) + pp = pathModule.basename(pp) + + do { + // both fit! + if (Buffer.byteLength(pp) <= pathSize && + Buffer.byteLength(prefix) <= prefixSize) + ret = [pp, prefix, false] + + // prefix fits in prefix, but path doesn't fit in path + else if (Buffer.byteLength(pp) > pathSize && + Buffer.byteLength(prefix) <= prefixSize) + ret = [pp.substr(0, pathSize - 1), prefix, true] + + else { + // make path take a bit from prefix + pp = pathModule.join(pathModule.basename(prefix), pp) + prefix = pathModule.dirname(prefix) + } + } while (prefix !== root && !ret) + + // at this point, found no resolution, just truncate + if (!ret) + ret = [p.substr(0, pathSize - 1), '', true] + } + return ret +} + +const decString = (buf, off, size) => + buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '') + +const decDate = (buf, off, size) => + numToDate(decNumber(buf, off, size)) + +const numToDate = num => num === null ? null : new Date(num * 1000) + +const decNumber = (buf, off, size) => + buf[off] & 0x80 ? large.parse(buf.slice(off, off + size)) + : decSmallNumber(buf, off, size) + +const nanNull = value => isNaN(value) ? null : value + +const decSmallNumber = (buf, off, size) => + nanNull(parseInt( + buf.slice(off, off + size) + .toString('utf8').replace(/\0.*$/, '').trim(), 8)) + +// the maximum encodable as a null-terminated octal, by field size +const MAXNUM = { + 12: 0o77777777777, + 8 : 0o7777777 +} + +const encNumber = (buf, off, size, number) => + number === null ? false : + number > MAXNUM[size] || number < 0 + ? (large.encode(number, buf.slice(off, off + size)), true) + : (encSmallNumber(buf, off, size, number), false) + +const encSmallNumber = (buf, off, size, number) => + buf.write(octalString(number, size), off, size, 'ascii') + +const octalString = (number, size) => + padOctal(Math.floor(number).toString(8), size) + +const padOctal = (string, size) => + (string.length === size - 1 ? string + : new Array(size - string.length - 1).join('0') + string + ' ') + '\0' + +const encDate = (buf, off, size, date) => + date === null ? false : + encNumber(buf, off, size, date.getTime() / 1000) + +// enough to fill the longest string we've got +const NULLS = new Array(156).join('\0') +// pad with nulls, return true if it's longer or non-ascii +const encString = (buf, off, size, string) => + string === null ? false : + (buf.write(string + NULLS, off, size, 'utf8'), + string.length !== Buffer.byteLength(string) || string.length > size) + +module.exports = Header diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/high-level-opt.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/high-level-opt.js new file mode 100644 index 0000000..7333db9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/high-level-opt.js @@ -0,0 +1,29 @@ +'use strict' + +// turn tar(1) style args like `C` into the more verbose things like `cwd` + +const argmap = new Map([ + ['C', 'cwd'], + ['f', 'file'], + ['z', 'gzip'], + ['P', 'preservePaths'], + ['U', 'unlink'], + ['strip-components', 'strip'], + ['stripComponents', 'strip'], + ['keep-newer', 'newer'], + ['keepNewer', 'newer'], + ['keep-newer-files', 'newer'], + ['keepNewerFiles', 'newer'], + ['k', 'keep'], + ['keep-existing', 'keep'], + ['keepExisting', 'keep'], + ['m', 'noMtime'], + ['no-mtime', 'noMtime'], + ['p', 'preserveOwner'], + ['L', 'follow'], + ['h', 'follow'] +]) + +const parse = module.exports = opt => opt ? Object.keys(opt).map(k => [ + argmap.has(k) ? argmap.get(k) : k, opt[k] +]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/large-numbers.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/large-numbers.js new file mode 100644 index 0000000..3e5c992 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/large-numbers.js @@ -0,0 +1,97 @@ +'use strict' +// Tar can encode large and negative numbers using a leading byte of +// 0xff for negative, and 0x80 for positive. + +const encode = exports.encode = (num, buf) => { + if (!Number.isSafeInteger(num)) + // The number is so large that javascript cannot represent it with integer + // precision. + throw TypeError('cannot encode number outside of javascript safe integer range') + else if (num < 0) + encodeNegative(num, buf) + else + encodePositive(num, buf) + return buf +} + +const encodePositive = (num, buf) => { + buf[0] = 0x80 + + for (var i = buf.length; i > 1; i--) { + buf[i-1] = num & 0xff + num = Math.floor(num / 0x100) + } +} + +const encodeNegative = (num, buf) => { + buf[0] = 0xff + var flipped = false + num = num * -1 + for (var i = buf.length; i > 1; i--) { + var byte = num & 0xff + num = Math.floor(num / 0x100) + if (flipped) + buf[i-1] = onesComp(byte) + else if (byte === 0) + buf[i-1] = 0 + else { + flipped = true + buf[i-1] = twosComp(byte) + } + } +} + +const parse = exports.parse = (buf) => { + var post = buf[buf.length - 1] + var pre = buf[0] + var value; + if (pre === 0x80) + value = pos(buf.slice(1, buf.length)) + else if (pre === 0xff) + value = twos(buf) + else + throw TypeError('invalid base256 encoding') + + if (!Number.isSafeInteger(value)) + // The number is so large that javascript cannot represent it with integer + // precision. + throw TypeError('parsed number outside of javascript safe integer range') + + return value +} + +const twos = (buf) => { + var len = buf.length + var sum = 0 + var flipped = false + for (var i = len - 1; i > -1; i--) { + var byte = buf[i] + var f + if (flipped) + f = onesComp(byte) + else if (byte === 0) + f = byte + else { + flipped = true + f = twosComp(byte) + } + if (f !== 0) + sum -= f * Math.pow(256, len - i - 1) + } + return sum +} + +const pos = (buf) => { + var len = buf.length + var sum = 0 + for (var i = len - 1; i > -1; i--) { + var byte = buf[i] + if (byte !== 0) + sum += byte * Math.pow(256, len - i - 1) + } + return sum +} + +const onesComp = byte => (0xff ^ byte) & 0xff + +const twosComp = byte => ((0xff ^ byte) + 1) & 0xff diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/list.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/list.js new file mode 100644 index 0000000..250ebe0 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/list.js @@ -0,0 +1,130 @@ +'use strict' + +const Buffer = require('./buffer.js') + +// XXX: This shares a lot in common with extract.js +// maybe some DRY opportunity here? + +// tar -t +const hlo = require('./high-level-opt.js') +const Parser = require('./parse.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') + +const t = module.exports = (opt_, files, cb) => { + if (typeof opt_ === 'function') + cb = opt_, files = null, opt_ = {} + else if (Array.isArray(opt_)) + files = opt_, opt_ = {} + + if (typeof files === 'function') + cb = files, files = null + + if (!files) + files = [] + else + files = Array.from(files) + + const opt = hlo(opt_) + + if (opt.sync && typeof cb === 'function') + throw new TypeError('callback not supported for sync tar functions') + + if (!opt.file && typeof cb === 'function') + throw new TypeError('callback only supported with file option') + + if (files.length) + filesFilter(opt, files) + + if (!opt.noResume) + onentryFunction(opt) + + return opt.file && opt.sync ? listFileSync(opt) + : opt.file ? listFile(opt, cb) + : list(opt) +} + +const onentryFunction = opt => { + const onentry = opt.onentry + opt.onentry = onentry ? e => { + onentry(e) + e.resume() + } : e => e.resume() +} + +// construct a filter that limits the file entries listed +// include child entries if a dir is included +const filesFilter = (opt, files) => { + const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true])) + const filter = opt.filter + + const mapHas = (file, r) => { + const root = r || path.parse(file).root || '.' + const ret = file === root ? false + : map.has(file) ? map.get(file) + : mapHas(path.dirname(file), root) + + map.set(file, ret) + return ret + } + + opt.filter = filter + ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, '')) + : file => mapHas(file.replace(/\/+$/, '')) +} + +const listFileSync = opt => { + const p = list(opt) + const file = opt.file + let threw = true + let fd + try { + const stat = fs.statSync(file) + const readSize = opt.maxReadSize || 16*1024*1024 + if (stat.size < readSize) { + p.end(fs.readFileSync(file)) + } else { + let pos = 0 + const buf = Buffer.allocUnsafe(readSize) + fd = fs.openSync(file, 'r') + while (pos < stat.size) { + let bytesRead = fs.readSync(fd, buf, 0, readSize, pos) + pos += bytesRead + p.write(buf.slice(0, bytesRead)) + } + p.end() + } + threw = false + } finally { + if (threw && fd) + try { fs.closeSync(fd) } catch (er) {} + } +} + +const listFile = (opt, cb) => { + const parse = new Parser(opt) + const readSize = opt.maxReadSize || 16*1024*1024 + + const file = opt.file + const p = new Promise((resolve, reject) => { + parse.on('error', reject) + parse.on('end', resolve) + + fs.stat(file, (er, stat) => { + if (er) + reject(er) + else { + const stream = new fsm.ReadStream(file, { + readSize: readSize, + size: stat.size + }) + stream.on('error', reject) + stream.pipe(parse) + } + }) + }) + return cb ? p.then(cb, cb) : p +} + +const list = opt => new Parser(opt) diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/mkdir.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/mkdir.js new file mode 100644 index 0000000..c6a154c --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/mkdir.js @@ -0,0 +1,206 @@ +'use strict' +// wrapper around mkdirp for tar's needs. + +// TODO: This should probably be a class, not functionally +// passing around state in a gazillion args. + +const mkdirp = require('mkdirp') +const fs = require('fs') +const path = require('path') +const chownr = require('chownr') + +class SymlinkError extends Error { + constructor (symlink, path) { + super('Cannot extract through symbolic link') + this.path = path + this.symlink = symlink + } + + get name () { + return 'SylinkError' + } +} + +class CwdError extends Error { + constructor (path, code) { + super(code + ': Cannot cd into \'' + path + '\'') + this.path = path + this.code = code + } + + get name () { + return 'CwdError' + } +} + +const mkdir = module.exports = (dir, opt, cb) => { + // if there's any overlap between mask and mode, + // then we'll need an explicit chmod + const umask = opt.umask + const mode = opt.mode | 0o0700 + const needChmod = (mode & umask) !== 0 + + const uid = opt.uid + const gid = opt.gid + const doChown = typeof uid === 'number' && + typeof gid === 'number' && + ( uid !== opt.processUid || gid !== opt.processGid ) + + const preserve = opt.preserve + const unlink = opt.unlink + const cache = opt.cache + const cwd = opt.cwd + + const done = (er, created) => { + if (er) + cb(er) + else { + cache.set(dir, true) + if (created && doChown) + chownr(created, uid, gid, er => done(er)) + else if (needChmod) + fs.chmod(dir, mode, cb) + else + cb() + } + } + + if (cache && cache.get(dir) === true) + return done() + + if (dir === cwd) + return fs.stat(dir, (er, st) => { + if (er || !st.isDirectory()) + er = new CwdError(dir, er && er.code || 'ENOTDIR') + done(er) + }) + + if (preserve) + return mkdirp(dir, mode, done) + + const sub = path.relative(cwd, dir) + const parts = sub.split(/\/|\\/) + mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done) +} + +const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => { + if (!parts.length) + return cb(null, created) + const p = parts.shift() + const part = base + '/' + p + if (cache.get(part)) + return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) +} + +const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => { + if (er) { + if (er.path && path.dirname(er.path) === cwd && + (er.code === 'ENOTDIR' || er.code === 'ENOENT')) + return cb(new CwdError(cwd, er.code)) + + fs.lstat(part, (statEr, st) => { + if (statEr) + cb(statEr) + else if (st.isDirectory()) + mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + else if (unlink) + fs.unlink(part, er => { + if (er) + return cb(er) + fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb)) + }) + else if (st.isSymbolicLink()) + return cb(new SymlinkError(part, part + '/' + parts.join('/'))) + else + cb(er) + }) + } else { + created = created || part + mkdir_(part, parts, mode, cache, unlink, cwd, created, cb) + } +} + +const mkdirSync = module.exports.sync = (dir, opt) => { + // if there's any overlap between mask and mode, + // then we'll need an explicit chmod + const umask = opt.umask + const mode = opt.mode | 0o0700 + const needChmod = (mode & umask) !== 0 + + const uid = opt.uid + const gid = opt.gid + const doChown = typeof uid === 'number' && + typeof gid === 'number' && + ( uid !== opt.processUid || gid !== opt.processGid ) + + const preserve = opt.preserve + const unlink = opt.unlink + const cache = opt.cache + const cwd = opt.cwd + + const done = (created) => { + cache.set(dir, true) + if (created && doChown) + chownr.sync(created, uid, gid) + if (needChmod) + fs.chmodSync(dir, mode) + } + + if (cache && cache.get(dir) === true) + return done() + + if (dir === cwd) { + let ok = false + let code = 'ENOTDIR' + try { + ok = fs.statSync(dir).isDirectory() + } catch (er) { + code = er.code + } finally { + if (!ok) + throw new CwdError(dir, code) + } + done() + return + } + + if (preserve) + return done(mkdirp.sync(dir, mode)) + + const sub = path.relative(cwd, dir) + const parts = sub.split(/\/|\\/) + let created = null + for (let p = parts.shift(), part = cwd; + p && (part += '/' + p); + p = parts.shift()) { + + if (cache.get(part)) + continue + + try { + fs.mkdirSync(part, mode) + created = created || part + cache.set(part, true) + } catch (er) { + if (er.path && path.dirname(er.path) === cwd && + (er.code === 'ENOTDIR' || er.code === 'ENOENT')) + return new CwdError(cwd, er.code) + + const st = fs.lstatSync(part) + if (st.isDirectory()) { + cache.set(part, true) + continue + } else if (unlink) { + fs.unlinkSync(part) + fs.mkdirSync(part, mode) + created = created || part + cache.set(part, true) + continue + } else if (st.isSymbolicLink()) + return new SymlinkError(part, part + '/' + parts.join('/')) + } + } + + return done(created) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/mode-fix.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/mode-fix.js new file mode 100644 index 0000000..3363a3b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/mode-fix.js @@ -0,0 +1,14 @@ +'use strict' +module.exports = (mode, isDir) => { + mode &= 0o7777 + // if dirs are readable, then they should be listable + if (isDir) { + if (mode & 0o400) + mode |= 0o100 + if (mode & 0o40) + mode |= 0o10 + if (mode & 0o4) + mode |= 0o1 + } + return mode +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/pack.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/pack.js new file mode 100644 index 0000000..857cea9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/pack.js @@ -0,0 +1,404 @@ +'use strict' + +const Buffer = require('./buffer.js') + +// A readable tar stream creator +// Technically, this is a transform stream that you write paths into, +// and tar format comes out of. +// The `add()` method is like `write()` but returns this, +// and end() return `this` as well, so you can +// do `new Pack(opt).add('files').add('dir').end().pipe(output) +// You could also do something like: +// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar')) + +class PackJob { + constructor (path, absolute) { + this.path = path || './' + this.absolute = absolute + this.entry = null + this.stat = null + this.readdir = null + this.pending = false + this.ignore = false + this.piped = false + } +} + +const MiniPass = require('minipass') +const zlib = require('minizlib') +const ReadEntry = require('./read-entry.js') +const WriteEntry = require('./write-entry.js') +const WriteEntrySync = WriteEntry.Sync +const WriteEntryTar = WriteEntry.Tar +const Yallist = require('yallist') +const EOF = Buffer.alloc(1024) +const ONSTAT = Symbol('onStat') +const ENDED = Symbol('ended') +const QUEUE = Symbol('queue') +const CURRENT = Symbol('current') +const PROCESS = Symbol('process') +const PROCESSING = Symbol('processing') +const PROCESSJOB = Symbol('processJob') +const JOBS = Symbol('jobs') +const JOBDONE = Symbol('jobDone') +const ADDFSENTRY = Symbol('addFSEntry') +const ADDTARENTRY = Symbol('addTarEntry') +const STAT = Symbol('stat') +const READDIR = Symbol('readdir') +const ONREADDIR = Symbol('onreaddir') +const PIPE = Symbol('pipe') +const ENTRY = Symbol('entry') +const ENTRYOPT = Symbol('entryOpt') +const WRITEENTRYCLASS = Symbol('writeEntryClass') +const WRITE = Symbol('write') +const ONDRAIN = Symbol('ondrain') + +const fs = require('fs') +const path = require('path') +const warner = require('./warn-mixin.js') + +const Pack = warner(class Pack extends MiniPass { + constructor (opt) { + super(opt) + opt = opt || Object.create(null) + this.opt = opt + this.cwd = opt.cwd || process.cwd() + this.maxReadSize = opt.maxReadSize + this.preservePaths = !!opt.preservePaths + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.prefix = (opt.prefix || '').replace(/(\\|\/)+$/, '') + this.linkCache = opt.linkCache || new Map() + this.statCache = opt.statCache || new Map() + this.readdirCache = opt.readdirCache || new Map() + + this[WRITEENTRYCLASS] = WriteEntry + if (typeof opt.onwarn === 'function') + this.on('warn', opt.onwarn) + + this.zip = null + if (opt.gzip) { + if (typeof opt.gzip !== 'object') + opt.gzip = {} + this.zip = new zlib.Gzip(opt.gzip) + this.zip.on('data', chunk => super.write(chunk)) + this.zip.on('end', _ => super.end()) + this.zip.on('drain', _ => this[ONDRAIN]()) + this.on('resume', _ => this.zip.resume()) + } else + this.on('drain', this[ONDRAIN]) + + this.portable = !!opt.portable + this.noDirRecurse = !!opt.noDirRecurse + this.follow = !!opt.follow + this.noMtime = !!opt.noMtime + this.mtime = opt.mtime || null + + this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true + + this[QUEUE] = new Yallist + this[JOBS] = 0 + this.jobs = +opt.jobs || 4 + this[PROCESSING] = false + this[ENDED] = false + } + + [WRITE] (chunk) { + return super.write(chunk) + } + + add (path) { + this.write(path) + return this + } + + end (path) { + if (path) + this.write(path) + this[ENDED] = true + this[PROCESS]() + return this + } + + write (path) { + if (this[ENDED]) + throw new Error('write after end') + + if (path instanceof ReadEntry) + this[ADDTARENTRY](path) + else + this[ADDFSENTRY](path) + return this.flowing + } + + [ADDTARENTRY] (p) { + const absolute = path.resolve(this.cwd, p.path) + if (this.prefix) + p.path = this.prefix + '/' + p.path.replace(/^\.(\/+|$)/, '') + + // in this case, we don't have to wait for the stat + if (!this.filter(p.path, p)) + p.resume() + else { + const job = new PackJob(p.path, absolute, false) + job.entry = new WriteEntryTar(p, this[ENTRYOPT](job)) + job.entry.on('end', _ => this[JOBDONE](job)) + this[JOBS] += 1 + this[QUEUE].push(job) + } + + this[PROCESS]() + } + + [ADDFSENTRY] (p) { + const absolute = path.resolve(this.cwd, p) + if (this.prefix) + p = this.prefix + '/' + p.replace(/^\.(\/+|$)/, '') + + this[QUEUE].push(new PackJob(p, absolute)) + this[PROCESS]() + } + + [STAT] (job) { + job.pending = true + this[JOBS] += 1 + const stat = this.follow ? 'stat' : 'lstat' + fs[stat](job.absolute, (er, stat) => { + job.pending = false + this[JOBS] -= 1 + if (er) + this.emit('error', er) + else + this[ONSTAT](job, stat) + }) + } + + [ONSTAT] (job, stat) { + this.statCache.set(job.absolute, stat) + job.stat = stat + + // now we have the stat, we can filter it. + if (!this.filter(job.path, stat)) + job.ignore = true + + this[PROCESS]() + } + + [READDIR] (job) { + job.pending = true + this[JOBS] += 1 + fs.readdir(job.absolute, (er, entries) => { + job.pending = false + this[JOBS] -= 1 + if (er) + return this.emit('error', er) + this[ONREADDIR](job, entries) + }) + } + + [ONREADDIR] (job, entries) { + this.readdirCache.set(job.absolute, entries) + job.readdir = entries + this[PROCESS]() + } + + [PROCESS] () { + if (this[PROCESSING]) + return + + this[PROCESSING] = true + for (let w = this[QUEUE].head; + w !== null && this[JOBS] < this.jobs; + w = w.next) { + this[PROCESSJOB](w.value) + if (w.value.ignore) { + const p = w.next + this[QUEUE].removeNode(w) + w.next = p + } + } + + this[PROCESSING] = false + + if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) { + if (this.zip) + this.zip.end(EOF) + else { + super.write(EOF) + super.end() + } + } + } + + get [CURRENT] () { + return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value + } + + [JOBDONE] (job) { + this[QUEUE].shift() + this[JOBS] -= 1 + this[PROCESS]() + } + + [PROCESSJOB] (job) { + if (job.pending) + return + + if (job.entry) { + if (job === this[CURRENT] && !job.piped) + this[PIPE](job) + return + } + + if (!job.stat) { + if (this.statCache.has(job.absolute)) + this[ONSTAT](job, this.statCache.get(job.absolute)) + else + this[STAT](job) + } + if (!job.stat) + return + + // filtered out! + if (job.ignore) + return + + if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) { + if (this.readdirCache.has(job.absolute)) + this[ONREADDIR](job, this.readdirCache.get(job.absolute)) + else + this[READDIR](job) + if (!job.readdir) + return + } + + // we know it doesn't have an entry, because that got checked above + job.entry = this[ENTRY](job) + if (!job.entry) { + job.ignore = true + return + } + + if (job === this[CURRENT] && !job.piped) + this[PIPE](job) + } + + [ENTRYOPT] (job) { + return { + onwarn: (msg, data) => { + this.warn(msg, data) + }, + noPax: this.noPax, + cwd: this.cwd, + absolute: job.absolute, + preservePaths: this.preservePaths, + maxReadSize: this.maxReadSize, + strict: this.strict, + portable: this.portable, + linkCache: this.linkCache, + statCache: this.statCache, + noMtime: this.noMtime, + mtime: this.mtime + } + } + + [ENTRY] (job) { + this[JOBS] += 1 + try { + return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job)) + .on('end', () => this[JOBDONE](job)) + .on('error', er => this.emit('error', er)) + } catch (er) { + this.emit('error', er) + } + } + + [ONDRAIN] () { + if (this[CURRENT] && this[CURRENT].entry) + this[CURRENT].entry.resume() + } + + // like .pipe() but using super, because our write() is special + [PIPE] (job) { + job.piped = true + + if (job.readdir) + job.readdir.forEach(entry => { + const p = this.prefix ? + job.path.slice(this.prefix.length + 1) || './' + : job.path + + const base = p === './' ? '' : p.replace(/\/*$/, '/') + this[ADDFSENTRY](base + entry) + }) + + const source = job.entry + const zip = this.zip + + if (zip) + source.on('data', chunk => { + if (!zip.write(chunk)) + source.pause() + }) + else + source.on('data', chunk => { + if (!super.write(chunk)) + source.pause() + }) + } + + pause () { + if (this.zip) + this.zip.pause() + return super.pause() + } +}) + +class PackSync extends Pack { + constructor (opt) { + super(opt) + this[WRITEENTRYCLASS] = WriteEntrySync + } + + // pause/resume are no-ops in sync streams. + pause () {} + resume () {} + + [STAT] (job) { + const stat = this.follow ? 'statSync' : 'lstatSync' + this[ONSTAT](job, fs[stat](job.absolute)) + } + + [READDIR] (job, stat) { + this[ONREADDIR](job, fs.readdirSync(job.absolute)) + } + + // gotta get it all in this tick + [PIPE] (job) { + const source = job.entry + const zip = this.zip + + if (job.readdir) + job.readdir.forEach(entry => { + const p = this.prefix ? + job.path.slice(this.prefix.length + 1) || './' + : job.path + + const base = p === './' ? '' : p.replace(/\/*$/, '/') + this[ADDFSENTRY](base + entry) + }) + + if (zip) + source.on('data', chunk => { + zip.write(chunk) + }) + else + source.on('data', chunk => { + super[WRITE](chunk) + }) + } +} + +Pack.Sync = PackSync + +module.exports = Pack diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/parse.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/parse.js new file mode 100644 index 0000000..43d4383 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/parse.js @@ -0,0 +1,428 @@ +'use strict' + +// this[BUFFER] is the remainder of a chunk if we're waiting for +// the full 512 bytes of a header to come in. We will Buffer.concat() +// it to the next write(), which is a mem copy, but a small one. +// +// this[QUEUE] is a Yallist of entries that haven't been emitted +// yet this can only get filled up if the user keeps write()ing after +// a write() returns false, or does a write() with more than one entry +// +// We don't buffer chunks, we always parse them and either create an +// entry, or push it into the active entry. The ReadEntry class knows +// to throw data away if .ignore=true +// +// Shift entry off the buffer when it emits 'end', and emit 'entry' for +// the next one in the list. +// +// At any time, we're pushing body chunks into the entry at WRITEENTRY, +// and waiting for 'end' on the entry at READENTRY +// +// ignored entries get .resume() called on them straight away + +const warner = require('./warn-mixin.js') +const path = require('path') +const Header = require('./header.js') +const EE = require('events') +const Yallist = require('yallist') +const maxMetaEntrySize = 1024 * 1024 +const Entry = require('./read-entry.js') +const Pax = require('./pax.js') +const zlib = require('minizlib') +const Buffer = require('./buffer.js') + +const gzipHeader = Buffer.from([0x1f, 0x8b]) +const STATE = Symbol('state') +const WRITEENTRY = Symbol('writeEntry') +const READENTRY = Symbol('readEntry') +const NEXTENTRY = Symbol('nextEntry') +const PROCESSENTRY = Symbol('processEntry') +const EX = Symbol('extendedHeader') +const GEX = Symbol('globalExtendedHeader') +const META = Symbol('meta') +const EMITMETA = Symbol('emitMeta') +const BUFFER = Symbol('buffer') +const QUEUE = Symbol('queue') +const ENDED = Symbol('ended') +const EMITTEDEND = Symbol('emittedEnd') +const EMIT = Symbol('emit') +const UNZIP = Symbol('unzip') +const CONSUMECHUNK = Symbol('consumeChunk') +const CONSUMECHUNKSUB = Symbol('consumeChunkSub') +const CONSUMEBODY = Symbol('consumeBody') +const CONSUMEMETA = Symbol('consumeMeta') +const CONSUMEHEADER = Symbol('consumeHeader') +const CONSUMING = Symbol('consuming') +const BUFFERCONCAT = Symbol('bufferConcat') +const MAYBEEND = Symbol('maybeEnd') +const WRITING = Symbol('writing') +const ABORTED = Symbol('aborted') +const DONE = Symbol('onDone') + +const noop = _ => true + +module.exports = warner(class Parser extends EE { + constructor (opt) { + opt = opt || {} + super(opt) + + if (opt.ondone) + this.on(DONE, opt.ondone) + else + this.on(DONE, _ => { + this.emit('prefinish') + this.emit('finish') + this.emit('end') + this.emit('close') + }) + + this.strict = !!opt.strict + this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize + this.filter = typeof opt.filter === 'function' ? opt.filter : noop + + // have to set this so that streams are ok piping into it + this.writable = true + this.readable = false + + this[QUEUE] = new Yallist() + this[BUFFER] = null + this[READENTRY] = null + this[WRITEENTRY] = null + this[STATE] = 'begin' + this[META] = '' + this[EX] = null + this[GEX] = null + this[ENDED] = false + this[UNZIP] = null + this[ABORTED] = false + if (typeof opt.onwarn === 'function') + this.on('warn', opt.onwarn) + if (typeof opt.onentry === 'function') + this.on('entry', opt.onentry) + } + + [CONSUMEHEADER] (chunk, position) { + let header + try { + header = new Header(chunk, position, this[EX], this[GEX]) + } catch (er) { + return this.warn('invalid entry', er) + } + + if (header.nullBlock) + this[EMIT]('nullBlock') + else if (!header.cksumValid) + this.warn('invalid entry', header) + else if (!header.path) + this.warn('invalid: path is required', header) + else { + const type = header.type + if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) + this.warn('invalid: linkpath required', header) + else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) + this.warn('invalid: linkpath forbidden', header) + else { + const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX]) + + if (entry.meta) { + if (entry.size > this.maxMetaEntrySize) { + entry.ignore = true + this[EMIT]('ignoredEntry', entry) + this[STATE] = 'ignore' + } else if (entry.size > 0) { + this[META] = '' + entry.on('data', c => this[META] += c) + this[STATE] = 'meta' + } + } else { + + this[EX] = null + entry.ignore = entry.ignore || !this.filter(entry.path, entry) + if (entry.ignore) { + this[EMIT]('ignoredEntry', entry) + this[STATE] = entry.remain ? 'ignore' : 'begin' + } else { + if (entry.remain) + this[STATE] = 'body' + else { + this[STATE] = 'begin' + entry.end() + } + + if (!this[READENTRY]) { + this[QUEUE].push(entry) + this[NEXTENTRY]() + } else + this[QUEUE].push(entry) + } + } + } + } + } + + [PROCESSENTRY] (entry) { + let go = true + + if (!entry) { + this[READENTRY] = null + go = false + } else if (Array.isArray(entry)) + this.emit.apply(this, entry) + else { + this[READENTRY] = entry + this.emit('entry', entry) + if (!entry.emittedEnd) { + entry.on('end', _ => this[NEXTENTRY]()) + go = false + } + } + + return go + } + + [NEXTENTRY] () { + do {} while (this[PROCESSENTRY](this[QUEUE].shift())) + + if (!this[QUEUE].length) { + // At this point, there's nothing in the queue, but we may have an + // entry which is being consumed (readEntry). + // If we don't, then we definitely can handle more data. + // If we do, and either it's flowing, or it has never had any data + // written to it, then it needs more. + // The only other possibility is that it has returned false from a + // write() call, so we wait for the next drain to continue. + const re = this[READENTRY] + const drainNow = !re || re.flowing || re.size === re.remain + if (drainNow) { + if (!this[WRITING]) + this.emit('drain') + } else + re.once('drain', _ => this.emit('drain')) + } + } + + [CONSUMEBODY] (chunk, position) { + // write up to but no more than writeEntry.blockRemain + const entry = this[WRITEENTRY] + const br = entry.blockRemain + const c = (br >= chunk.length && position === 0) ? chunk + : chunk.slice(position, position + br) + + entry.write(c) + + if (!entry.blockRemain) { + this[STATE] = 'begin' + this[WRITEENTRY] = null + entry.end() + } + + return c.length + } + + [CONSUMEMETA] (chunk, position) { + const entry = this[WRITEENTRY] + const ret = this[CONSUMEBODY](chunk, position) + + // if we finished, then the entry is reset + if (!this[WRITEENTRY]) + this[EMITMETA](entry) + + return ret + } + + [EMIT] (ev, data, extra) { + if (!this[QUEUE].length && !this[READENTRY]) + this.emit(ev, data, extra) + else + this[QUEUE].push([ev, data, extra]) + } + + [EMITMETA] (entry) { + this[EMIT]('meta', this[META]) + switch (entry.type) { + case 'ExtendedHeader': + case 'OldExtendedHeader': + this[EX] = Pax.parse(this[META], this[EX], false) + break + + case 'GlobalExtendedHeader': + this[GEX] = Pax.parse(this[META], this[GEX], true) + break + + case 'NextFileHasLongPath': + case 'OldGnuLongPath': + this[EX] = this[EX] || Object.create(null) + this[EX].path = this[META].replace(/\0.*/, '') + break + + case 'NextFileHasLongLinkpath': + this[EX] = this[EX] || Object.create(null) + this[EX].linkpath = this[META].replace(/\0.*/, '') + break + + /* istanbul ignore next */ + default: throw new Error('unknown meta: ' + entry.type) + } + } + + abort (msg, error) { + this[ABORTED] = true + this.warn(msg, error) + this.emit('abort', error) + this.emit('error', error) + } + + write (chunk) { + if (this[ABORTED]) + return + + // first write, might be gzipped + if (this[UNZIP] === null && chunk) { + if (this[BUFFER]) { + chunk = Buffer.concat([this[BUFFER], chunk]) + this[BUFFER] = null + } + if (chunk.length < gzipHeader.length) { + this[BUFFER] = chunk + return true + } + for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) { + if (chunk[i] !== gzipHeader[i]) + this[UNZIP] = false + } + if (this[UNZIP] === null) { + const ended = this[ENDED] + this[ENDED] = false + this[UNZIP] = new zlib.Unzip() + this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk)) + this[UNZIP].on('error', er => + this.abort(er.message, er)) + this[UNZIP].on('end', _ => { + this[ENDED] = true + this[CONSUMECHUNK]() + }) + this[WRITING] = true + const ret = this[UNZIP][ended ? 'end' : 'write' ](chunk) + this[WRITING] = false + return ret + } + } + + this[WRITING] = true + if (this[UNZIP]) + this[UNZIP].write(chunk) + else + this[CONSUMECHUNK](chunk) + this[WRITING] = false + + // return false if there's a queue, or if the current entry isn't flowing + const ret = + this[QUEUE].length ? false : + this[READENTRY] ? this[READENTRY].flowing : + true + + // if we have no queue, then that means a clogged READENTRY + if (!ret && !this[QUEUE].length) + this[READENTRY].once('drain', _ => this.emit('drain')) + + return ret + } + + [BUFFERCONCAT] (c) { + if (c && !this[ABORTED]) + this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c + } + + [MAYBEEND] () { + if (this[ENDED] && + !this[EMITTEDEND] && + !this[ABORTED] && + !this[CONSUMING]) { + this[EMITTEDEND] = true + const entry = this[WRITEENTRY] + if (entry && entry.blockRemain) { + const have = this[BUFFER] ? this[BUFFER].length : 0 + this.warn('Truncated input (needed ' + entry.blockRemain + + ' more bytes, only ' + have + ' available)', entry) + if (this[BUFFER]) + entry.write(this[BUFFER]) + entry.end() + } + this[EMIT](DONE) + } + } + + [CONSUMECHUNK] (chunk) { + if (this[CONSUMING]) { + this[BUFFERCONCAT](chunk) + } else if (!chunk && !this[BUFFER]) { + this[MAYBEEND]() + } else { + this[CONSUMING] = true + if (this[BUFFER]) { + this[BUFFERCONCAT](chunk) + const c = this[BUFFER] + this[BUFFER] = null + this[CONSUMECHUNKSUB](c) + } else { + this[CONSUMECHUNKSUB](chunk) + } + + while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED]) { + const c = this[BUFFER] + this[BUFFER] = null + this[CONSUMECHUNKSUB](c) + } + this[CONSUMING] = false + } + + if (!this[BUFFER] || this[ENDED]) + this[MAYBEEND]() + } + + [CONSUMECHUNKSUB] (chunk) { + // we know that we are in CONSUMING mode, so anything written goes into + // the buffer. Advance the position and put any remainder in the buffer. + let position = 0 + let length = chunk.length + while (position + 512 <= length && !this[ABORTED]) { + switch (this[STATE]) { + case 'begin': + this[CONSUMEHEADER](chunk, position) + position += 512 + break + + case 'ignore': + case 'body': + position += this[CONSUMEBODY](chunk, position) + break + + case 'meta': + position += this[CONSUMEMETA](chunk, position) + break + + /* istanbul ignore next */ + default: + throw new Error('invalid state: ' + this[STATE]) + } + } + + if (position < length) { + if (this[BUFFER]) + this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]]) + else + this[BUFFER] = chunk.slice(position) + } + } + + end (chunk) { + if (!this[ABORTED]) { + if (this[UNZIP]) + this[UNZIP].end(chunk) + else { + this[ENDED] = true + this.write(chunk) + } + } + } +}) diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/pax.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/pax.js new file mode 100644 index 0000000..9d7e4ab --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/pax.js @@ -0,0 +1,146 @@ +'use strict' +const Buffer = require('./buffer.js') +const Header = require('./header.js') +const path = require('path') + +class Pax { + constructor (obj, global) { + this.atime = obj.atime || null + this.charset = obj.charset || null + this.comment = obj.comment || null + this.ctime = obj.ctime || null + this.gid = obj.gid || null + this.gname = obj.gname || null + this.linkpath = obj.linkpath || null + this.mtime = obj.mtime || null + this.path = obj.path || null + this.size = obj.size || null + this.uid = obj.uid || null + this.uname = obj.uname || null + this.dev = obj.dev || null + this.ino = obj.ino || null + this.nlink = obj.nlink || null + this.global = global || false + } + + encode () { + const body = this.encodeBody() + if (body === '') + return null + + const bodyLen = Buffer.byteLength(body) + // round up to 512 bytes + // add 512 for header + const bufLen = 512 * Math.ceil(1 + bodyLen / 512) + const buf = Buffer.allocUnsafe(bufLen) + + // 0-fill the header section, it might not hit every field + for (let i = 0; i < 512; i++) { + buf[i] = 0 + } + + new Header({ + // XXX split the path + // then the path should be PaxHeader + basename, but less than 99, + // prepend with the dirname + path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99), + mode: this.mode || 0o644, + uid: this.uid || null, + gid: this.gid || null, + size: bodyLen, + mtime: this.mtime || null, + type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader', + linkpath: '', + uname: this.uname || '', + gname: this.gname || '', + devmaj: 0, + devmin: 0, + atime: this.atime || null, + ctime: this.ctime || null + }).encode(buf) + + buf.write(body, 512, bodyLen, 'utf8') + + // null pad after the body + for (let i = bodyLen + 512; i < buf.length; i++) { + buf[i] = 0 + } + + return buf + } + + encodeBody () { + return ( + this.encodeField('path') + + this.encodeField('ctime') + + this.encodeField('atime') + + this.encodeField('dev') + + this.encodeField('ino') + + this.encodeField('nlink') + + this.encodeField('charset') + + this.encodeField('comment') + + this.encodeField('gid') + + this.encodeField('gname') + + this.encodeField('linkpath') + + this.encodeField('mtime') + + this.encodeField('size') + + this.encodeField('uid') + + this.encodeField('uname') + ) + } + + encodeField (field) { + if (this[field] === null || this[field] === undefined) + return '' + const v = this[field] instanceof Date ? this[field].getTime() / 1000 + : this[field] + const s = ' ' + + (field === 'dev' || field === 'ino' || field === 'nlink' + ? 'SCHILY.' : '') + + field + '=' + v + '\n' + const byteLen = Buffer.byteLength(s) + // the digits includes the length of the digits in ascii base-10 + // so if it's 9 characters, then adding 1 for the 9 makes it 10 + // which makes it 11 chars. + let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1 + if (byteLen + digits >= Math.pow(10, digits)) + digits += 1 + const len = digits + byteLen + return len + s + } +} + +Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g) + +const merge = (a, b) => + b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a + +const parseKV = string => + string + .replace(/\n$/, '') + .split('\n') + .reduce(parseKVLine, Object.create(null)) + +const parseKVLine = (set, line) => { + const n = parseInt(line, 10) + + // XXX Values with \n in them will fail this. + // Refactor to not be a naive line-by-line parse. + if (n !== Buffer.byteLength(line) + 1) + return set + + line = line.substr((n + ' ').length) + const kv = line.split('=') + const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1') + if (!k) + return set + + const v = kv.join('=') + set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k) + ? new Date(v * 1000) + : /^[0-9]+$/.test(v) ? +v + : v + return set +} + +module.exports = Pax diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/read-entry.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/read-entry.js new file mode 100644 index 0000000..8acee94 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/read-entry.js @@ -0,0 +1,98 @@ +'use strict' +const types = require('./types.js') +const MiniPass = require('minipass') + +const SLURP = Symbol('slurp') +module.exports = class ReadEntry extends MiniPass { + constructor (header, ex, gex) { + super() + // read entries always start life paused. this is to avoid the + // situation where Minipass's auto-ending empty streams results + // in an entry ending before we're ready for it. + this.pause() + this.extended = ex + this.globalExtended = gex + this.header = header + this.startBlockSize = 512 * Math.ceil(header.size / 512) + this.blockRemain = this.startBlockSize + this.remain = header.size + this.type = header.type + this.meta = false + this.ignore = false + switch (this.type) { + case 'File': + case 'OldFile': + case 'Link': + case 'SymbolicLink': + case 'CharacterDevice': + case 'BlockDevice': + case 'Directory': + case 'FIFO': + case 'ContiguousFile': + case 'GNUDumpDir': + break + + case 'NextFileHasLongLinkpath': + case 'NextFileHasLongPath': + case 'OldGnuLongPath': + case 'GlobalExtendedHeader': + case 'ExtendedHeader': + case 'OldExtendedHeader': + this.meta = true + break + + // NOTE: gnutar and bsdtar treat unrecognized types as 'File' + // it may be worth doing the same, but with a warning. + default: + this.ignore = true + } + + this.path = header.path + this.mode = header.mode + if (this.mode) + this.mode = this.mode & 0o7777 + this.uid = header.uid + this.gid = header.gid + this.uname = header.uname + this.gname = header.gname + this.size = header.size + this.mtime = header.mtime + this.atime = header.atime + this.ctime = header.ctime + this.linkpath = header.linkpath + this.uname = header.uname + this.gname = header.gname + + if (ex) this[SLURP](ex) + if (gex) this[SLURP](gex, true) + } + + write (data) { + const writeLen = data.length + if (writeLen > this.blockRemain) + throw new Error('writing more to entry than is appropriate') + + const r = this.remain + const br = this.blockRemain + this.remain = Math.max(0, r - writeLen) + this.blockRemain = Math.max(0, br - writeLen) + if (this.ignore) + return true + + if (r >= writeLen) + return super.write(data) + + // r < writeLen + return super.write(data.slice(0, r)) + } + + [SLURP] (ex, global) { + for (let k in ex) { + // we slurp in everything except for the path attribute in + // a global extended header, because that's weird. + if (ex[k] !== null && ex[k] !== undefined && + !(global && k === 'path')) + this[k] = ex[k] + } + } +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/replace.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/replace.js new file mode 100644 index 0000000..571cee9 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/replace.js @@ -0,0 +1,220 @@ +'use strict' +const Buffer = require('./buffer.js') + +// tar -r +const hlo = require('./high-level-opt.js') +const Pack = require('./pack.js') +const Parse = require('./parse.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const t = require('./list.js') +const path = require('path') + +// starting at the head of the file, read a Header +// If the checksum is invalid, that's our position to start writing +// If it is, jump forward by the specified size (round up to 512) +// and try again. +// Write the new Pack stream starting there. + +const Header = require('./header.js') + +const r = module.exports = (opt_, files, cb) => { + const opt = hlo(opt_) + + if (!opt.file) + throw new TypeError('file is required') + + if (opt.gzip) + throw new TypeError('cannot append to compressed archives') + + if (!files || !Array.isArray(files) || !files.length) + throw new TypeError('no files or directories specified') + + files = Array.from(files) + + return opt.sync ? replaceSync(opt, files) + : replace(opt, files, cb) +} + +const replaceSync = (opt, files) => { + const p = new Pack.Sync(opt) + + let threw = true + let fd + let position + + try { + try { + fd = fs.openSync(opt.file, 'r+') + } catch (er) { + if (er.code === 'ENOENT') + fd = fs.openSync(opt.file, 'w+') + else + throw er + } + + const st = fs.fstatSync(fd) + const headBuf = Buffer.alloc(512) + + POSITION: for (position = 0; position < st.size; position += 512) { + for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) { + bytes = fs.readSync( + fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos + ) + + if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) + throw new Error('cannot append to compressed archives') + + if (!bytes) + break POSITION + } + + let h = new Header(headBuf) + if (!h.cksumValid) + break + let entryBlockSize = 512 * Math.ceil(h.size / 512) + if (position + entryBlockSize + 512 > st.size) + break + // the 512 for the header we just parsed will be added as well + // also jump ahead all the blocks for the body + position += entryBlockSize + if (opt.mtimeCache) + opt.mtimeCache.set(h.path, h.mtime) + } + threw = false + + streamSync(opt, p, position, fd, files) + } finally { + if (threw) + try { fs.closeSync(fd) } catch (er) {} + } +} + +const streamSync = (opt, p, position, fd, files) => { + const stream = new fsm.WriteStreamSync(opt.file, { + fd: fd, + start: position + }) + p.pipe(stream) + addFilesSync(p, files) +} + +const replace = (opt, files, cb) => { + files = Array.from(files) + const p = new Pack(opt) + + const getPos = (fd, size, cb_) => { + const cb = (er, pos) => { + if (er) + fs.close(fd, _ => cb_(er)) + else + cb_(null, pos) + } + + let position = 0 + if (size === 0) + return cb(null, 0) + + let bufPos = 0 + const headBuf = Buffer.alloc(512) + const onread = (er, bytes) => { + if (er) + return cb(er) + bufPos += bytes + if (bufPos < 512 && bytes) + return fs.read( + fd, headBuf, bufPos, headBuf.length - bufPos, + position + bufPos, onread + ) + + if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) + return cb(new Error('cannot append to compressed archives')) + + // truncated header + if (bufPos < 512) + return cb(null, position) + + const h = new Header(headBuf) + if (!h.cksumValid) + return cb(null, position) + + const entryBlockSize = 512 * Math.ceil(h.size / 512) + if (position + entryBlockSize + 512 > size) + return cb(null, position) + + position += entryBlockSize + 512 + if (position >= size) + return cb(null, position) + + if (opt.mtimeCache) + opt.mtimeCache.set(h.path, h.mtime) + bufPos = 0 + fs.read(fd, headBuf, 0, 512, position, onread) + } + fs.read(fd, headBuf, 0, 512, position, onread) + } + + const promise = new Promise((resolve, reject) => { + p.on('error', reject) + let flag = 'r+' + const onopen = (er, fd) => { + if (er && er.code === 'ENOENT' && flag === 'r+') { + flag = 'w+' + return fs.open(opt.file, flag, onopen) + } + + if (er) + return reject(er) + + fs.fstat(fd, (er, st) => { + if (er) + return reject(er) + getPos(fd, st.size, (er, position) => { + if (er) + return reject(er) + const stream = new fsm.WriteStream(opt.file, { + fd: fd, + start: position + }) + p.pipe(stream) + stream.on('error', reject) + stream.on('close', resolve) + addFilesAsync(p, files) + }) + }) + } + fs.open(opt.file, flag, onopen) + }) + + return cb ? promise.then(cb, cb) : promise +} + +const addFilesSync = (p, files) => { + files.forEach(file => { + if (file.charAt(0) === '@') + t({ + file: path.resolve(p.cwd, file.substr(1)), + sync: true, + noResume: true, + onentry: entry => p.add(entry) + }) + else + p.add(file) + }) + p.end() +} + +const addFilesAsync = (p, files) => { + while (files.length) { + const file = files.shift() + if (file.charAt(0) === '@') + return t({ + file: path.resolve(p.cwd, file.substr(1)), + noResume: true, + onentry: entry => p.add(entry) + }).then(_ => addFilesAsync(p, files)) + else + p.add(file) + } + p.end() +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/types.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/types.js new file mode 100644 index 0000000..df42565 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/types.js @@ -0,0 +1,44 @@ +'use strict' +// map types from key to human-friendly name +exports.name = new Map([ + ['0', 'File'], + // same as File + ['', 'OldFile'], + ['1', 'Link'], + ['2', 'SymbolicLink'], + // Devices and FIFOs aren't fully supported + // they are parsed, but skipped when unpacking + ['3', 'CharacterDevice'], + ['4', 'BlockDevice'], + ['5', 'Directory'], + ['6', 'FIFO'], + // same as File + ['7', 'ContiguousFile'], + // pax headers + ['g', 'GlobalExtendedHeader'], + ['x', 'ExtendedHeader'], + // vendor-specific stuff + // skip + ['A', 'SolarisACL'], + // like 5, but with data, which should be skipped + ['D', 'GNUDumpDir'], + // metadata only, skip + ['I', 'Inode'], + // data = link path of next file + ['K', 'NextFileHasLongLinkpath'], + // data = path of next file + ['L', 'NextFileHasLongPath'], + // skip + ['M', 'ContinuationFile'], + // like L + ['N', 'OldGnuLongPath'], + // skip + ['S', 'SparseFile'], + // skip + ['V', 'TapeVolumeHeader'], + // like x + ['X', 'OldExtendedHeader'] +]) + +// map the other direction +exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]])) diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/unpack.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/unpack.js new file mode 100644 index 0000000..fc76509 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/unpack.js @@ -0,0 +1,621 @@ +'use strict' + +const assert = require('assert') +const EE = require('events').EventEmitter +const Parser = require('./parse.js') +const fs = require('fs') +const fsm = require('fs-minipass') +const path = require('path') +const mkdir = require('./mkdir.js') +const mkdirSync = mkdir.sync +const wc = require('./winchars.js') + +const ONENTRY = Symbol('onEntry') +const CHECKFS = Symbol('checkFs') +const ISREUSABLE = Symbol('isReusable') +const MAKEFS = Symbol('makeFs') +const FILE = Symbol('file') +const DIRECTORY = Symbol('directory') +const LINK = Symbol('link') +const SYMLINK = Symbol('symlink') +const HARDLINK = Symbol('hardlink') +const UNSUPPORTED = Symbol('unsupported') +const UNKNOWN = Symbol('unknown') +const CHECKPATH = Symbol('checkPath') +const MKDIR = Symbol('mkdir') +const ONERROR = Symbol('onError') +const PENDING = Symbol('pending') +const PEND = Symbol('pend') +const UNPEND = Symbol('unpend') +const ENDED = Symbol('ended') +const MAYBECLOSE = Symbol('maybeClose') +const SKIP = Symbol('skip') +const DOCHOWN = Symbol('doChown') +const UID = Symbol('uid') +const GID = Symbol('gid') +const crypto = require('crypto') + +// Unlinks on Windows are not atomic. +// +// This means that if you have a file entry, followed by another +// file entry with an identical name, and you cannot re-use the file +// (because it's a hardlink, or because unlink:true is set, or it's +// Windows, which does not have useful nlink values), then the unlink +// will be committed to the disk AFTER the new file has been written +// over the old one, deleting the new file. +// +// To work around this, on Windows systems, we rename the file and then +// delete the renamed file. It's a sloppy kludge, but frankly, I do not +// know of a better way to do this, given windows' non-atomic unlink +// semantics. +// +// See: https://github.com/npm/node-tar/issues/183 +/* istanbul ignore next */ +const unlinkFile = (path, cb) => { + if (process.platform !== 'win32') + return fs.unlink(path, cb) + + const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') + fs.rename(path, name, er => { + if (er) + return cb(er) + fs.unlink(name, cb) + }) +} + +/* istanbul ignore next */ +const unlinkFileSync = path => { + if (process.platform !== 'win32') + return fs.unlinkSync(path) + + const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex') + fs.renameSync(path, name) + fs.unlinkSync(name) +} + +// this.gid, entry.gid, this.processUid +const uint32 = (a, b, c) => + a === a >>> 0 ? a + : b === b >>> 0 ? b + : c + +class Unpack extends Parser { + constructor (opt) { + if (!opt) + opt = {} + + opt.ondone = _ => { + this[ENDED] = true + this[MAYBECLOSE]() + } + + super(opt) + + this.transform = typeof opt.transform === 'function' ? opt.transform : null + + this.writable = true + this.readable = false + + this[PENDING] = 0 + this[ENDED] = false + + this.dirCache = opt.dirCache || new Map() + + if (typeof opt.uid === 'number' || typeof opt.gid === 'number') { + // need both or neither + if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') + throw new TypeError('cannot set owner without number uid and gid') + if (opt.preserveOwner) + throw new TypeError( + 'cannot preserve owner in archive and also set owner explicitly') + this.uid = opt.uid + this.gid = opt.gid + this.setOwner = true + } else { + this.uid = null + this.gid = null + this.setOwner = false + } + + // default true for root + if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') + this.preserveOwner = process.getuid && process.getuid() === 0 + else + this.preserveOwner = !!opt.preserveOwner + + this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? + process.getuid() : null + this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? + process.getgid() : null + + // mostly just for testing, but useful in some cases. + // Forcibly trigger a chown on every entry, no matter what + this.forceChown = opt.forceChown === true + + // turn > this[ONENTRY](entry)) + } + + [MAYBECLOSE] () { + if (this[ENDED] && this[PENDING] === 0) { + this.emit('prefinish') + this.emit('finish') + this.emit('end') + this.emit('close') + } + } + + [CHECKPATH] (entry) { + if (this.strip) { + const parts = entry.path.split(/\/|\\/) + if (parts.length < this.strip) + return false + entry.path = parts.slice(this.strip).join('/') + + if (entry.type === 'Link') { + const linkparts = entry.linkpath.split(/\/|\\/) + if (linkparts.length >= this.strip) + entry.linkpath = linkparts.slice(this.strip).join('/') + } + } + + if (!this.preservePaths) { + const p = entry.path + if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) { + this.warn('path contains \'..\'', p) + return false + } + + // absolutes on posix are also absolutes on win32 + // so we only need to test this one to get both + if (path.win32.isAbsolute(p)) { + const parsed = path.win32.parse(p) + this.warn('stripping ' + parsed.root + ' from absolute path', p) + entry.path = p.substr(parsed.root.length) + } + } + + // only encode : chars that aren't drive letter indicators + if (this.win32) { + const parsed = path.win32.parse(entry.path) + entry.path = parsed.root === '' ? wc.encode(entry.path) + : parsed.root + wc.encode(entry.path.substr(parsed.root.length)) + } + + if (path.isAbsolute(entry.path)) + entry.absolute = entry.path + else + entry.absolute = path.resolve(this.cwd, entry.path) + + return true + } + + [ONENTRY] (entry) { + if (!this[CHECKPATH](entry)) + return entry.resume() + + assert.equal(typeof entry.absolute, 'string') + + switch (entry.type) { + case 'Directory': + case 'GNUDumpDir': + if (entry.mode) + entry.mode = entry.mode | 0o700 + + case 'File': + case 'OldFile': + case 'ContiguousFile': + case 'Link': + case 'SymbolicLink': + return this[CHECKFS](entry) + + case 'CharacterDevice': + case 'BlockDevice': + case 'FIFO': + return this[UNSUPPORTED](entry) + } + } + + [ONERROR] (er, entry) { + // Cwd has to exist, or else nothing works. That's serious. + // Other errors are warnings, which raise the error in strict + // mode, but otherwise continue on. + if (er.name === 'CwdError') + this.emit('error', er) + else { + this.warn(er.message, er) + this[UNPEND]() + entry.resume() + } + } + + [MKDIR] (dir, mode, cb) { + mkdir(dir, { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cache: this.dirCache, + cwd: this.cwd, + mode: mode + }, cb) + } + + [DOCHOWN] (entry) { + // in preserve owner mode, chown if the entry doesn't match process + // in set owner mode, chown if setting doesn't match process + return this.forceChown || + this.preserveOwner && + ( typeof entry.uid === 'number' && entry.uid !== this.processUid || + typeof entry.gid === 'number' && entry.gid !== this.processGid ) + || + ( typeof this.uid === 'number' && this.uid !== this.processUid || + typeof this.gid === 'number' && this.gid !== this.processGid ) + } + + [UID] (entry) { + return uint32(this.uid, entry.uid, this.processUid) + } + + [GID] (entry) { + return uint32(this.gid, entry.gid, this.processGid) + } + + [FILE] (entry) { + const mode = entry.mode & 0o7777 || this.fmode + const stream = new fsm.WriteStream(entry.absolute, { + mode: mode, + autoClose: false + }) + stream.on('error', er => this[ONERROR](er, entry)) + + let actions = 1 + const done = er => { + if (er) + return this[ONERROR](er, entry) + + if (--actions === 0) + fs.close(stream.fd, _ => this[UNPEND]()) + } + + stream.on('finish', _ => { + // if futimes fails, try utimes + // if utimes fails, fail with the original error + // same for fchown/chown + const abs = entry.absolute + const fd = stream.fd + + if (entry.mtime && !this.noMtime) { + actions++ + const atime = entry.atime || new Date() + const mtime = entry.mtime + fs.futimes(fd, atime, mtime, er => + er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er)) + : done()) + } + + if (this[DOCHOWN](entry)) { + actions++ + const uid = this[UID](entry) + const gid = this[GID](entry) + fs.fchown(fd, uid, gid, er => + er ? fs.chown(abs, uid, gid, er2 => done(er2 && er)) + : done()) + } + + done() + }) + + const tx = this.transform ? this.transform(entry) || entry : entry + if (tx !== entry) { + tx.on('error', er => this[ONERROR](er, entry)) + entry.pipe(tx) + } + tx.pipe(stream) + } + + [DIRECTORY] (entry) { + const mode = entry.mode & 0o7777 || this.dmode + this[MKDIR](entry.absolute, mode, er => { + if (er) + return this[ONERROR](er, entry) + + let actions = 1 + const done = _ => { + if (--actions === 0) { + this[UNPEND]() + entry.resume() + } + } + + if (entry.mtime && !this.noMtime) { + actions++ + fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done) + } + + if (this[DOCHOWN](entry)) { + actions++ + fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done) + } + + done() + }) + } + + [UNSUPPORTED] (entry) { + this.warn('unsupported entry type: ' + entry.type, entry) + entry.resume() + } + + [SYMLINK] (entry) { + this[LINK](entry, entry.linkpath, 'symlink') + } + + [HARDLINK] (entry) { + this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link') + } + + [PEND] () { + this[PENDING]++ + } + + [UNPEND] () { + this[PENDING]-- + this[MAYBECLOSE]() + } + + [SKIP] (entry) { + this[UNPEND]() + entry.resume() + } + + // Check if we can reuse an existing filesystem entry safely and + // overwrite it, rather than unlinking and recreating + // Windows doesn't report a useful nlink, so we just never reuse entries + [ISREUSABLE] (entry, st) { + return entry.type === 'File' && + !this.unlink && + st.isFile() && + st.nlink <= 1 && + process.platform !== 'win32' + } + + // check if a thing is there, and if so, try to clobber it + [CHECKFS] (entry) { + this[PEND]() + this[MKDIR](path.dirname(entry.absolute), this.dmode, er => { + if (er) + return this[ONERROR](er, entry) + fs.lstat(entry.absolute, (er, st) => { + if (st && (this.keep || this.newer && st.mtime > entry.mtime)) + this[SKIP](entry) + else if (er || this[ISREUSABLE](entry, st)) + this[MAKEFS](null, entry) + else if (st.isDirectory()) { + if (entry.type === 'Directory') { + if (!entry.mode || (st.mode & 0o7777) === entry.mode) + this[MAKEFS](null, entry) + else + fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry)) + } else + fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry)) + } else + unlinkFile(entry.absolute, er => this[MAKEFS](er, entry)) + }) + }) + } + + [MAKEFS] (er, entry) { + if (er) + return this[ONERROR](er, entry) + + switch (entry.type) { + case 'File': + case 'OldFile': + case 'ContiguousFile': + return this[FILE](entry) + + case 'Link': + return this[HARDLINK](entry) + + case 'SymbolicLink': + return this[SYMLINK](entry) + + case 'Directory': + case 'GNUDumpDir': + return this[DIRECTORY](entry) + } + } + + [LINK] (entry, linkpath, link) { + // XXX: get the type ('file' or 'dir') for windows + fs[link](linkpath, entry.absolute, er => { + if (er) + return this[ONERROR](er, entry) + this[UNPEND]() + entry.resume() + }) + } +} + +class UnpackSync extends Unpack { + constructor (opt) { + super(opt) + } + + [CHECKFS] (entry) { + const er = this[MKDIR](path.dirname(entry.absolute), this.dmode) + if (er) + return this[ONERROR](er, entry) + try { + const st = fs.lstatSync(entry.absolute) + if (this.keep || this.newer && st.mtime > entry.mtime) + return this[SKIP](entry) + else if (this[ISREUSABLE](entry, st)) + return this[MAKEFS](null, entry) + else { + try { + if (st.isDirectory()) { + if (entry.type === 'Directory') { + if (entry.mode && (st.mode & 0o7777) !== entry.mode) + fs.chmodSync(entry.absolute, entry.mode) + } else + fs.rmdirSync(entry.absolute) + } else + unlinkFileSync(entry.absolute) + return this[MAKEFS](null, entry) + } catch (er) { + return this[ONERROR](er, entry) + } + } + } catch (er) { + return this[MAKEFS](null, entry) + } + } + + [FILE] (entry) { + const mode = entry.mode & 0o7777 || this.fmode + + const oner = er => { + try { fs.closeSync(fd) } catch (_) {} + if (er) + this[ONERROR](er, entry) + } + + let stream + let fd + try { + fd = fs.openSync(entry.absolute, 'w', mode) + } catch (er) { + return oner(er) + } + const tx = this.transform ? this.transform(entry) || entry : entry + if (tx !== entry) { + tx.on('error', er => this[ONERROR](er, entry)) + entry.pipe(tx) + } + + tx.on('data', chunk => { + try { + fs.writeSync(fd, chunk, 0, chunk.length) + } catch (er) { + oner(er) + } + }) + + tx.on('end', _ => { + let er = null + // try both, falling futimes back to utimes + // if either fails, handle the first error + if (entry.mtime && !this.noMtime) { + const atime = entry.atime || new Date() + const mtime = entry.mtime + try { + fs.futimesSync(fd, atime, mtime) + } catch (futimeser) { + try { + fs.utimesSync(entry.absolute, atime, mtime) + } catch (utimeser) { + er = futimeser + } + } + } + + if (this[DOCHOWN](entry)) { + const uid = this[UID](entry) + const gid = this[GID](entry) + + try { + fs.fchownSync(fd, uid, gid) + } catch (fchowner) { + try { + fs.chownSync(entry.absolute, uid, gid) + } catch (chowner) { + er = er || fchowner + } + } + } + + oner(er) + }) + } + + [DIRECTORY] (entry) { + const mode = entry.mode & 0o7777 || this.dmode + const er = this[MKDIR](entry.absolute, mode) + if (er) + return this[ONERROR](er, entry) + if (entry.mtime && !this.noMtime) { + try { + fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime) + } catch (er) {} + } + if (this[DOCHOWN](entry)) { + try { + fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry)) + } catch (er) {} + } + entry.resume() + } + + [MKDIR] (dir, mode) { + try { + return mkdir.sync(dir, { + uid: this.uid, + gid: this.gid, + processUid: this.processUid, + processGid: this.processGid, + umask: this.processUmask, + preserve: this.preservePaths, + unlink: this.unlink, + cache: this.dirCache, + cwd: this.cwd, + mode: mode + }) + } catch (er) { + return er + } + } + + [LINK] (entry, linkpath, link) { + try { + fs[link + 'Sync'](linkpath, entry.absolute) + entry.resume() + } catch (er) { + return this[ONERROR](er, entry) + } + } +} + +Unpack.Sync = UnpackSync +module.exports = Unpack diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/update.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/update.js new file mode 100644 index 0000000..16c3e93 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/update.js @@ -0,0 +1,36 @@ +'use strict' + +// tar -u + +const hlo = require('./high-level-opt.js') +const r = require('./replace.js') +// just call tar.r with the filter and mtimeCache + +const u = module.exports = (opt_, files, cb) => { + const opt = hlo(opt_) + + if (!opt.file) + throw new TypeError('file is required') + + if (opt.gzip) + throw new TypeError('cannot append to compressed archives') + + if (!files || !Array.isArray(files) || !files.length) + throw new TypeError('no files or directories specified') + + files = Array.from(files) + + mtimeFilter(opt) + return r(opt, files, cb) +} + +const mtimeFilter = opt => { + const filter = opt.filter + + if (!opt.mtimeCache) + opt.mtimeCache = new Map() + + opt.filter = filter ? (path, stat) => + filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime) + : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/warn-mixin.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/warn-mixin.js new file mode 100644 index 0000000..94a4b9b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/warn-mixin.js @@ -0,0 +1,14 @@ +'use strict' +module.exports = Base => class extends Base { + warn (msg, data) { + if (!this.strict) + this.emit('warn', msg, data) + else if (data instanceof Error) + this.emit('error', data) + else { + const er = new Error(msg) + er.data = data + this.emit('error', er) + } + } +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/winchars.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/winchars.js new file mode 100644 index 0000000..cf6ea06 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/winchars.js @@ -0,0 +1,23 @@ +'use strict' + +// When writing files on Windows, translate the characters to their +// 0xf000 higher-encoded versions. + +const raw = [ + '|', + '<', + '>', + '?', + ':' +] + +const win = raw.map(char => + String.fromCharCode(0xf000 + char.charCodeAt(0))) + +const toWin = new Map(raw.map((char, i) => [char, win[i]])) +const toRaw = new Map(win.map((char, i) => [char, raw[i]])) + +module.exports = { + encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s), + decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s) +} diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/lib/write-entry.js b/legacy-libs/node-pre-gyp/node_modules/tar/lib/write-entry.js new file mode 100644 index 0000000..0c01900 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/lib/write-entry.js @@ -0,0 +1,422 @@ +'use strict' +const Buffer = require('./buffer.js') +const MiniPass = require('minipass') +const Pax = require('./pax.js') +const Header = require('./header.js') +const ReadEntry = require('./read-entry.js') +const fs = require('fs') +const path = require('path') + +const types = require('./types.js') +const maxReadSize = 16 * 1024 * 1024 +const PROCESS = Symbol('process') +const FILE = Symbol('file') +const DIRECTORY = Symbol('directory') +const SYMLINK = Symbol('symlink') +const HARDLINK = Symbol('hardlink') +const HEADER = Symbol('header') +const READ = Symbol('read') +const LSTAT = Symbol('lstat') +const ONLSTAT = Symbol('onlstat') +const ONREAD = Symbol('onread') +const ONREADLINK = Symbol('onreadlink') +const OPENFILE = Symbol('openfile') +const ONOPENFILE = Symbol('onopenfile') +const CLOSE = Symbol('close') +const MODE = Symbol('mode') +const warner = require('./warn-mixin.js') +const winchars = require('./winchars.js') + +const modeFix = require('./mode-fix.js') + +const WriteEntry = warner(class WriteEntry extends MiniPass { + constructor (p, opt) { + opt = opt || {} + super(opt) + if (typeof p !== 'string') + throw new TypeError('path is required') + this.path = p + // suppress atime, ctime, uid, gid, uname, gname + this.portable = !!opt.portable + // until node has builtin pwnam functions, this'll have to do + this.myuid = process.getuid && process.getuid() + this.myuser = process.env.USER || '' + this.maxReadSize = opt.maxReadSize || maxReadSize + this.linkCache = opt.linkCache || new Map() + this.statCache = opt.statCache || new Map() + this.preservePaths = !!opt.preservePaths + this.cwd = opt.cwd || process.cwd() + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.noMtime = !!opt.noMtime + this.mtime = opt.mtime || null + + if (typeof opt.onwarn === 'function') + this.on('warn', opt.onwarn) + + if (!this.preservePaths && path.win32.isAbsolute(p)) { + // absolutes on posix are also absolutes on win32 + // so we only need to test this one to get both + const parsed = path.win32.parse(p) + this.warn('stripping ' + parsed.root + ' from absolute path', p) + this.path = p.substr(parsed.root.length) + } + + this.win32 = !!opt.win32 || process.platform === 'win32' + if (this.win32) { + this.path = winchars.decode(this.path.replace(/\\/g, '/')) + p = p.replace(/\\/g, '/') + } + + this.absolute = opt.absolute || path.resolve(this.cwd, p) + + if (this.path === '') + this.path = './' + + if (this.statCache.has(this.absolute)) + this[ONLSTAT](this.statCache.get(this.absolute)) + else + this[LSTAT]() + } + + [LSTAT] () { + fs.lstat(this.absolute, (er, stat) => { + if (er) + return this.emit('error', er) + this[ONLSTAT](stat) + }) + } + + [ONLSTAT] (stat) { + this.statCache.set(this.absolute, stat) + this.stat = stat + if (!stat.isFile()) + stat.size = 0 + this.type = getType(stat) + this.emit('stat', stat) + this[PROCESS]() + } + + [PROCESS] () { + switch (this.type) { + case 'File': return this[FILE]() + case 'Directory': return this[DIRECTORY]() + case 'SymbolicLink': return this[SYMLINK]() + // unsupported types are ignored. + default: return this.end() + } + } + + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory') + } + + [HEADER] () { + if (this.type === 'Directory' && this.portable) + this.noMtime = true + + this.header = new Header({ + path: this.path, + linkpath: this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this[MODE](this.stat.mode), + uid: this.portable ? null : this.stat.uid, + gid: this.portable ? null : this.stat.gid, + size: this.stat.size, + mtime: this.noMtime ? null : this.mtime || this.stat.mtime, + type: this.type, + uname: this.portable ? null : + this.stat.uid === this.myuid ? this.myuser : '', + atime: this.portable ? null : this.stat.atime, + ctime: this.portable ? null : this.stat.ctime + }) + + if (this.header.encode() && !this.noPax) + this.write(new Pax({ + atime: this.portable ? null : this.header.atime, + ctime: this.portable ? null : this.header.ctime, + gid: this.portable ? null : this.header.gid, + mtime: this.noMtime ? null : this.mtime || this.header.mtime, + path: this.path, + linkpath: this.linkpath, + size: this.header.size, + uid: this.portable ? null : this.header.uid, + uname: this.portable ? null : this.header.uname, + dev: this.portable ? null : this.stat.dev, + ino: this.portable ? null : this.stat.ino, + nlink: this.portable ? null : this.stat.nlink + }).encode()) + this.write(this.header.block) + } + + [DIRECTORY] () { + if (this.path.substr(-1) !== '/') + this.path += '/' + this.stat.size = 0 + this[HEADER]() + this.end() + } + + [SYMLINK] () { + fs.readlink(this.absolute, (er, linkpath) => { + if (er) + return this.emit('error', er) + this[ONREADLINK](linkpath) + }) + } + + [ONREADLINK] (linkpath) { + this.linkpath = linkpath + this[HEADER]() + this.end() + } + + [HARDLINK] (linkpath) { + this.type = 'Link' + this.linkpath = path.relative(this.cwd, linkpath) + this.stat.size = 0 + this[HEADER]() + this.end() + } + + [FILE] () { + if (this.stat.nlink > 1) { + const linkKey = this.stat.dev + ':' + this.stat.ino + if (this.linkCache.has(linkKey)) { + const linkpath = this.linkCache.get(linkKey) + if (linkpath.indexOf(this.cwd) === 0) + return this[HARDLINK](linkpath) + } + this.linkCache.set(linkKey, this.absolute) + } + + this[HEADER]() + if (this.stat.size === 0) + return this.end() + + this[OPENFILE]() + } + + [OPENFILE] () { + fs.open(this.absolute, 'r', (er, fd) => { + if (er) + return this.emit('error', er) + this[ONOPENFILE](fd) + }) + } + + [ONOPENFILE] (fd) { + const blockLen = 512 * Math.ceil(this.stat.size / 512) + const bufLen = Math.min(blockLen, this.maxReadSize) + const buf = Buffer.allocUnsafe(bufLen) + this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen) + } + + [READ] (fd, buf, offset, length, pos, remain, blockRemain) { + fs.read(fd, buf, offset, length, pos, (er, bytesRead) => { + if (er) + return this[CLOSE](fd, _ => this.emit('error', er)) + this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) + }) + } + + [CLOSE] (fd, cb) { + fs.close(fd, cb) + } + + [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) { + if (bytesRead <= 0 && remain > 0) { + const er = new Error('encountered unexpected EOF') + er.path = this.absolute + er.syscall = 'read' + er.code = 'EOF' + this[CLOSE](fd, _ => _) + return this.emit('error', er) + } + + if (bytesRead > remain) { + const er = new Error('did not encounter expected EOF') + er.path = this.absolute + er.syscall = 'read' + er.code = 'EOF' + this[CLOSE](fd, _ => _) + return this.emit('error', er) + } + + // null out the rest of the buffer, if we could fit the block padding + if (bytesRead === remain) { + for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) { + buf[i + offset] = 0 + bytesRead ++ + remain ++ + } + } + + const writeBuf = offset === 0 && bytesRead === buf.length ? + buf : buf.slice(offset, offset + bytesRead) + remain -= bytesRead + blockRemain -= bytesRead + pos += bytesRead + offset += bytesRead + + this.write(writeBuf) + + if (!remain) { + if (blockRemain) + this.write(Buffer.alloc(blockRemain)) + this.end() + this[CLOSE](fd, _ => _) + return + } + + if (offset >= length) { + buf = Buffer.allocUnsafe(length) + offset = 0 + } + length = buf.length - offset + this[READ](fd, buf, offset, length, pos, remain, blockRemain) + } +}) + +class WriteEntrySync extends WriteEntry { + constructor (path, opt) { + super(path, opt) + } + + [LSTAT] () { + this[ONLSTAT](fs.lstatSync(this.absolute)) + } + + [SYMLINK] () { + this[ONREADLINK](fs.readlinkSync(this.absolute)) + } + + [OPENFILE] () { + this[ONOPENFILE](fs.openSync(this.absolute, 'r')) + } + + [READ] (fd, buf, offset, length, pos, remain, blockRemain) { + let threw = true + try { + const bytesRead = fs.readSync(fd, buf, offset, length, pos) + this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead) + threw = false + } finally { + if (threw) + try { this[CLOSE](fd) } catch (er) {} + } + } + + [CLOSE] (fd) { + fs.closeSync(fd) + } +} + +const WriteEntryTar = warner(class WriteEntryTar extends MiniPass { + constructor (readEntry, opt) { + opt = opt || {} + super(opt) + this.preservePaths = !!opt.preservePaths + this.portable = !!opt.portable + this.strict = !!opt.strict + this.noPax = !!opt.noPax + this.noMtime = !!opt.noMtime + + this.readEntry = readEntry + this.type = readEntry.type + if (this.type === 'Directory' && this.portable) + this.noMtime = true + + this.path = readEntry.path + this.mode = this[MODE](readEntry.mode) + this.uid = this.portable ? null : readEntry.uid + this.gid = this.portable ? null : readEntry.gid + this.uname = this.portable ? null : readEntry.uname + this.gname = this.portable ? null : readEntry.gname + this.size = readEntry.size + this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime + this.atime = this.portable ? null : readEntry.atime + this.ctime = this.portable ? null : readEntry.ctime + this.linkpath = readEntry.linkpath + + if (typeof opt.onwarn === 'function') + this.on('warn', opt.onwarn) + + if (path.isAbsolute(this.path) && !this.preservePaths) { + const parsed = path.parse(this.path) + this.warn( + 'stripping ' + parsed.root + ' from absolute path', + this.path + ) + this.path = this.path.substr(parsed.root.length) + } + + this.remain = readEntry.size + this.blockRemain = readEntry.startBlockSize + + this.header = new Header({ + path: this.path, + linkpath: this.linkpath, + // only the permissions and setuid/setgid/sticky bitflags + // not the higher-order bits that specify file type + mode: this.mode, + uid: this.portable ? null : this.uid, + gid: this.portable ? null : this.gid, + size: this.size, + mtime: this.noMtime ? null : this.mtime, + type: this.type, + uname: this.portable ? null : this.uname, + atime: this.portable ? null : this.atime, + ctime: this.portable ? null : this.ctime + }) + + if (this.header.encode() && !this.noPax) + super.write(new Pax({ + atime: this.portable ? null : this.atime, + ctime: this.portable ? null : this.ctime, + gid: this.portable ? null : this.gid, + mtime: this.noMtime ? null : this.mtime, + path: this.path, + linkpath: this.linkpath, + size: this.size, + uid: this.portable ? null : this.uid, + uname: this.portable ? null : this.uname, + dev: this.portable ? null : this.readEntry.dev, + ino: this.portable ? null : this.readEntry.ino, + nlink: this.portable ? null : this.readEntry.nlink + }).encode()) + + super.write(this.header.block) + readEntry.pipe(this) + } + + [MODE] (mode) { + return modeFix(mode, this.type === 'Directory') + } + + write (data) { + const writeLen = data.length + if (writeLen > this.blockRemain) + throw new Error('writing more to entry than is appropriate') + this.blockRemain -= writeLen + return super.write(data) + } + + end () { + if (this.blockRemain) + this.write(Buffer.alloc(this.blockRemain)) + return super.end() + } +}) + +WriteEntry.Sync = WriteEntrySync +WriteEntry.Tar = WriteEntryTar + +const getType = stat => + stat.isFile() ? 'File' + : stat.isDirectory() ? 'Directory' + : stat.isSymbolicLink() ? 'SymbolicLink' + : 'Unsupported' + +module.exports = WriteEntry diff --git a/legacy-libs/node-pre-gyp/node_modules/tar/package.json b/legacy-libs/node-pre-gyp/node_modules/tar/package.json new file mode 100644 index 0000000..4294b12 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/tar/package.json @@ -0,0 +1,150 @@ +{ + "_args": [ + [ + { + "raw": "tar@^4.4.2", + "scope": null, + "escapedName": "tar", + "name": "tar", + "rawSpec": "^4.4.2", + "spec": ">=4.4.2 <5.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp" + ] + ], + "_from": "tar@>=4.4.2 <5.0.0", + "_hasShrinkwrap": false, + "_id": "tar@4.4.13", + "_inCache": true, + "_location": "/node-pre-gyp/tar", + "_nodeVersion": "12.8.1", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/tar_4.4.13_1569387394602_0.5681974056976136" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "6.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "tar@^4.4.2", + "scope": null, + "escapedName": "tar", + "name": "tar", + "rawSpec": "^4.4.2", + "spec": ">=4.4.2 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp" + ], + "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "_shasum": "43b364bc52888d555298637b10d60790254ab525", + "_shrinkwrap": null, + "_spec": "tar@^4.4.2", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/node-tar/issues" + }, + "dependencies": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "description": "tar for node", + "devDependencies": { + "chmodr": "^1.2.0", + "end-of-stream": "^1.4.1", + "events-to-array": "^1.1.2", + "mutate-fs": "^2.1.1", + "rimraf": "^2.6.3", + "tap": "^14.6.5", + "tar-fs": "^1.16.3", + "tar-stream": "^1.6.2" + }, + "directories": {}, + "dist": { + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "shasum": "43b364bc52888d555298637b10d60790254ab525", + "tarball": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "fileCount": 24, + "unpackedSize": 133843, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdivODCRA9TVsSAnZWagAAKF0QAIz6zD9/wKs8V0YXQ4zM\nQWqU4k26ZZgEtnvAFW9ovgJVGnHQS9v2QhuJtHp4ap44I4fxKk2+1SeT1mhT\nUxnD5P08WBbAH0OrPorMP1r6r7zkAzQVNWmLUATdAGjK+zoWCxjd+6+7uItk\ni6sLpsQzXFFRttzl4Z9qDhrn1HxbBG2WGLZ9dhcTBnsEfFifPhBVIJhsU9uv\nsXdZZHNK14A52ieCADwQdqI+u1DIawM82G3e2AXEFN4i/2Km3UGrlRZ+Q76Z\nDp+iQN3o/amWTW1wddup0JeBEjGCjng7jD+S6BkiGWtTKWpeG3pSRv6g1MN4\n7YvAYXjOv2JKJ9MNJ5qIIdC0FeHuDMFfXTparMczr1sIAtvjue++drwp9dCF\n8XDDP7TjxkefbBvbIl1tF35MShC5+dsJwOmlyVcWSMdIInZmV5KGRdMdcFV2\nOT5hhdTAxSpcSdp4lJHYXhJUvP1ScRD/08RPfWmB/pr3hPEblv6M2qxpDfca\nhwhaV3srdvnicCqhju3KMzGBBJIikR/lAiI67QVVNaC3D68tHYOVUmFSKg0g\nGJpC7fiD31u1HTT9ndcfxKgUJ1OuRs5T35BtglvKFcpEd2FF4mANsegD4KwX\nGm/ID0I/8+K6ynTRd9+gpcUK2QGR+IH/IuiLvDJ/EZv7W/hirJ9o2r5RTthI\nQwxS\r\n=1EKm\r\n-----END PGP SIGNATURE-----\r\n" + }, + "engines": { + "node": ">=4.5" + }, + "gitHead": "65edb39114ad5956c06f8d7893365e942042ede1", + "homepage": "https://github.com/npm/node-tar#readme", + "license": "ISC", + "maintainers": [ + { + "name": "adam_baldwin", + "email": "evilpacket@gmail.com" + }, + { + "name": "ahmadnassri", + "email": "ahmad@ahmadnassri.com" + }, + { + "name": "annekimsey", + "email": "anne@npmjs.com" + }, + { + "name": "billatnpm", + "email": "billatnpm@gmail.com" + }, + { + "name": "claudiahdz", + "email": "cghr1990@gmail.com" + }, + { + "name": "darcyclarke", + "email": "darcy@darcyclarke.me" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "mikemimik", + "email": "mike@mikecorp.ca" + }, + { + "name": "ruyadorno", + "email": "ruyadorno@hotmail.com" + } + ], + "name": "tar", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-tar.git" + }, + "scripts": { + "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done", + "genparse": "node scripts/generate-parse-fixtures.js", + "postpublish": "git push origin --follow-tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap" + }, + "tap": { + "coverage-map": "map.js", + "check-coverage": true + }, + "version": "4.4.13" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/yallist/LICENSE b/legacy-libs/node-pre-gyp/node_modules/yallist/LICENSE new file mode 100644 index 0000000..19129e3 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/legacy-libs/node-pre-gyp/node_modules/yallist/README.md b/legacy-libs/node-pre-gyp/node_modules/yallist/README.md new file mode 100644 index 0000000..f586101 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/legacy-libs/node-pre-gyp/node_modules/yallist/iterator.js b/legacy-libs/node-pre-gyp/node_modules/yallist/iterator.js new file mode 100644 index 0000000..d41c97a --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/yallist/iterator.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} diff --git a/legacy-libs/node-pre-gyp/node_modules/yallist/package.json b/legacy-libs/node-pre-gyp/node_modules/yallist/package.json new file mode 100644 index 0000000..d93084b --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/yallist/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "yallist@^3.0.2", + "scope": null, + "escapedName": "yallist", + "name": "yallist", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/google-auth-library/node_modules/lru-cache" + ], + [ + { + "raw": "yallist@^3.0.3", + "scope": null, + "escapedName": "yallist", + "name": "yallist", + "rawSpec": "^3.0.3", + "spec": ">=3.0.3 <4.0.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/tar" + ] + ], + "_from": "yallist@^3.0.3", + "_hasShrinkwrap": false, + "_id": "yallist@3.1.1", + "_inCache": true, + "_location": "/node-pre-gyp/yallist", + "_nodeVersion": "12.8.1", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/yallist_3.1.1_1569874038188_0.3036372642366818" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "6.12.0-next.0", + "_phantomChildren": {}, + "_requested": { + "raw": "yallist@^3.0.3", + "scope": null, + "escapedName": "yallist", + "name": "yallist", + "rawSpec": "^3.0.3", + "spec": ">=3.0.3 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-pre-gyp/tar" + ], + "_resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "_shasum": "dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd", + "_shrinkwrap": null, + "_spec": "yallist@^3.0.3", + "_where": "/var/opt/motion2/node_modules/node-pre-gyp/node_modules/tar", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/yallist/issues" + }, + "dependencies": {}, + "description": "Yet Another Linked List", + "devDependencies": { + "tap": "^12.1.0" + }, + "directories": { + "test": "test" + }, + "dist": { + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "shasum": "dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd", + "tarball": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "fileCount": 5, + "unpackedSize": 14766, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkmB2CRA9TVsSAnZWagAAWgoP/0j+iDVcsa3byazx3CgE\nm/aBzB3GflrXZAtMZ11Q/VfAa+gNDWDSJ2NOFmX/GxhKTm1zeyhl14WgDAZN\nE/DIF6bZkAbr01gz0k9Xa7/sMprHei90zQ6oNxmAONiiR0N1E7HRwN7Qu32C\nKMYGky23RxnXOmcX3Ij+dITQPNT/3525ehO0F7otC1b6AUwHybawJYSv7ILq\nR2x6w7X9RE9cizxLADzFM7PwXHic/20b8lgCnaA7P7qqSauVrlmdiaejmvAW\n+F6/S2QCfWGsXfLMkvJbBAjcX4+mWE90/gz/qC4+DXlDjRAJ2LCVKCcXsszk\nsz1mzU7FDfN3tp60kd0XtEQ6xuagICLxy+lit2maTcwVQSYiKko4T7aFAFr+\nYKwEsFl1+PcnSDqnuc9+6K9K7dYYqAL2/4L509joWusG6cGWdWGd0j5IGosG\naXKFW0zB54WRRbZTsNrfpy7f8wSlXZSMZyeC/n84rUKAx/HtPycBkoJTvFdD\nkIaCnm5orykEaT8JSAqqG9o5ndF4Cwba79DUzHPWZscSR43A34iWJGKb83QU\nRlNLkxo8mgAFMNdA808wr0tyh/bbm2d5q6ZCKnTmrlktPCBcsbi854ol9WAH\nir/yNg3bKNVGgvMLKm/qngACxszUnIOy0Fsi0I5eUGg392CNbgAf7myATWlY\nWXcr\r\n=gXWc\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "ab350a79eb94c80f7146662748a12b6fcd63729c", + "homepage": "https://github.com/isaacs/yallist#readme", + "license": "ISC", + "main": "yallist.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "yallist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "scripts": { + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test/*.js --100" + }, + "version": "3.1.1" +} diff --git a/legacy-libs/node-pre-gyp/node_modules/yallist/yallist.js b/legacy-libs/node-pre-gyp/node_modules/yallist/yallist.js new file mode 100644 index 0000000..ed4e730 --- /dev/null +++ b/legacy-libs/node-pre-gyp/node_modules/yallist/yallist.js @@ -0,0 +1,426 @@ +'use strict' +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount /*, ...nodes */) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 2; i < arguments.length; i++) { + walker = insert(this, walker, arguments[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + require('./iterator.js')(Yallist) +} catch (er) {} diff --git a/legacy-libs/node-pre-gyp/package.json b/legacy-libs/node-pre-gyp/package.json new file mode 100644 index 0000000..16e768e --- /dev/null +++ b/legacy-libs/node-pre-gyp/package.json @@ -0,0 +1,161 @@ +{ + "_args": [ + [ + { + "raw": "node-pre-gyp@^0.16.0", + "scope": null, + "escapedName": "node-pre-gyp", + "name": "node-pre-gyp", + "rawSpec": "^0.16.0", + "spec": ">=0.16.0 <0.17.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/grpc" + ] + ], + "_from": "node-pre-gyp@>=0.16.0 <0.17.0", + "_hasShrinkwrap": false, + "_id": "node-pre-gyp@0.16.0", + "_inCache": true, + "_location": "/node-pre-gyp", + "_nodeVersion": "8.14.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/node-pre-gyp_0.16.0_1604004657710_0.12468192126334454" + }, + "_npmUser": { + "name": "nicolasnoble", + "email": "nicolas@nobis-crew.org" + }, + "_npmVersion": "6.14.5", + "_phantomChildren": { + "abbrev": "1.1.1", + "chownr": "1.1.4", + "fs-minipass": "1.2.7", + "minipass": "2.9.0", + "minizlib": "1.3.3", + "osenv": "0.1.5" + }, + "_requested": { + "raw": "node-pre-gyp@^0.16.0", + "scope": null, + "escapedName": "node-pre-gyp", + "name": "node-pre-gyp", + "rawSpec": "^0.16.0", + "spec": ">=0.16.0 <0.17.0", + "type": "range" + }, + "_requiredBy": [ + "/grpc" + ], + "_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.16.0.tgz", + "_shasum": "238fa540364784e5015dfcdba78da3937e18dbdc", + "_shrinkwrap": null, + "_spec": "node-pre-gyp@^0.16.0", + "_where": "/var/opt/motion2/node_modules/grpc", + "author": { + "name": "Dane Springmeyer", + "email": "dane@mapbox.com" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + }, + "bugs": { + "url": "https://github.com/mapbox/node-pre-gyp/issues" + }, + "dependencies": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.3", + "needle": "^2.5.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + }, + "description": "Node.js native addon binary install tool", + "devDependencies": { + "aws-sdk": "^2.28.0", + "jshint": "^2.9.5", + "nock": "^9.2.3", + "tape": "^4.6.3" + }, + "directories": {}, + "dist": { + "integrity": "sha512-4efGA+X/YXAHLi1hN8KaPrILULaUn2nWecFrn1k2I+99HpoyvcOGEbtcOxpDiUwPF2ZANMJDh32qwOUPenuR1g==", + "shasum": "238fa540364784e5015dfcdba78da3937e18dbdc", + "tarball": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.16.0.tgz", + "fileCount": 31, + "unpackedSize": 155418, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfmysyCRA9TVsSAnZWagAAeLgP/RCSH5lEJx2Arynivq5s\nDiHvWA+534Daxydixp/yvlJd8MNCuvKEDqC9cy/uuCHxt03qSZBPu/YbSM9+\n5+WLy2dz7E0qlB1Wx5CpqVBC0r9jp1YHRRPKTuy5ZHyc57+F6ZCl09XzaAiE\nzlr/L7/OnuqG83V8lQs0qrpvPWdVkHFFldtGnU92NaR0pvkko4eBOAAbMxyb\nDjQxPOCJmAb9r6iVJp1dk7Dh/xGCWuT950Z0sdfCXCyEEnUxABPxlsWXTQd8\n/whwS7JNsS5us2qJlGervHiXoF+PZMJ38d1CLh3l1vetcWYTZSyERx4viJUZ\n2vcN6+HKmwDJ0RqePeQ+oonjfORBUQsekdOzOETofQKDE2qWDaW6OfvLU1GE\ndY+ZTyY5hUXVPOcqHTfB3o7Atafu28146L0+1gPF69Kcf8i3Oi8PGxVdW9YJ\nQQvock5K3l5+gLxqmeSxzEKk/Q0TEjpAZsL86yZlqRIVfrCEkliGUFHj7oa4\n0d6aLndmEQc3RxcxBqNWyyMUYe97vx4m9JhU/bkYyTiAFn/lFJ7NoKyN7YF5\nW2ULr5CTgjp6KqQcUOSPVyxTf5XG2HI7fqS0kMvlC12oOA5OQUi5R31/cgos\nxbAEQSF1789i26bdNRv3yeYfkATDDVbQW6zXQJ620wGFv8x4WXhG9DsURASM\n71xq\r\n=LJCD\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "ac2a149d836cbcd916c32cbcf25695485219e76b", + "homepage": "https://github.com/mapbox/node-pre-gyp#readme", + "jshintConfig": { + "node": true, + "globalstrict": true, + "undef": true, + "unused": false, + "noarg": true + }, + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "binary" + ], + "license": "BSD-3-Clause", + "main": "./lib/node-pre-gyp.js", + "maintainers": [ + { + "name": "springmeyer", + "email": "dane@mapbox.com" + }, + { + "name": "gretacb", + "email": "carol@mapbox.com" + }, + { + "name": "kkaefer", + "email": "mail@kkaefer.com" + }, + { + "name": "flippmoke", + "email": "flippmoke@gmail.com" + }, + { + "name": "bergwerkgis", + "email": "wb@bergwerk-gis.at" + }, + { + "name": "yhahn", + "email": "young@mapbox.com" + }, + { + "name": "mapsam", + "email": "sam@mapbox.com" + }, + { + "name": "nicolasnoble", + "email": "nicolas@nobis-crew.org" + } + ], + "name": "node-pre-gyp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mapbox/node-pre-gyp.git" + }, + "scripts": { + "pretest": "jshint test/build.test.js test/s3_setup.test.js test/versioning.test.js test/fetch.test.js lib lib/util scripts bin/node-pre-gyp", + "test": "jshint lib lib/util scripts bin/node-pre-gyp && tape test/*test.js", + "update-crosswalk": "node scripts/abi_crosswalk.js" + }, + "version": "0.16.0" +} diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 35a148a..d7b7648 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 _0x41d7=['STRING','contactManager','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action'];(function(_0x732588,_0x3bdf2c){var _0x2c0d67=function(_0x5a77dd){while(--_0x5a77dd){_0x732588['push'](_0x732588['shift']());}};_0x2c0d67(++_0x3bdf2c);}(_0x41d7,0x194));var _0x741d=function(_0x3eec9c,_0x8a594e){_0x3eec9c=_0x3eec9c-0x0;var _0x2b2073=_0x41d7[_0x3eec9c];return _0x2b2073;};'use strict';var Sequelize=require('sequelize');module[_0x741d('0x0')]={'name':{'type':Sequelize[_0x741d('0x1')],'get':function(_0x3e39f5){return this[_0x741d('0x2')](_0x741d('0x3'));}},'action':{'type':Sequelize[_0x741d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x741d('0x5'),'integration','motionbar',_0x741d('0x6'),_0x741d('0x7'),'browser',_0x741d('0x8'),_0x741d('0x9')]],'msg':_0x741d('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x741d('0x4')](0x1000),'comment':_0x741d('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x741d('0xc')},'data3':{'type':Sequelize[_0x741d('0x4')](0x1000),'comment':_0x741d('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x741d('0x4')](0x1000),'comments':_0x741d('0xe')},'data6':{'type':Sequelize[_0x741d('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x741d('0xf')],'comments':_0x741d('0x10')}}; \ No newline at end of file +var _0xcc83=['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]','TEXT','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x5206cc,_0x2a1a51){var _0x788939=function(_0x43327b){while(--_0x43327b){_0x5206cc['push'](_0x5206cc['shift']());}};_0x788939(++_0x2a1a51);}(_0xcc83,0xae));var _0x3cc8=function(_0x485df3,_0x40b7d8){_0x485df3=_0x485df3-0x0;var _0x4d7454=_0xcc83[_0x485df3];return _0x4d7454;};'use strict';var Sequelize=require(_0x3cc8('0x0'));module['exports']={'name':{'type':Sequelize[_0x3cc8('0x1')],'get':function(_0x390f1c){return this[_0x3cc8('0x2')](_0x3cc8('0x3'));}},'action':{'type':Sequelize[_0x3cc8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3cc8('0x5'),'integration',_0x3cc8('0x6'),_0x3cc8('0x7'),_0x3cc8('0x8'),'browser',_0x3cc8('0x9'),_0x3cc8('0xa')]],'msg':_0x3cc8('0xb')}},'comment':_0x3cc8('0xb')},'data1':{'type':Sequelize[_0x3cc8('0x4')](0x1000),'comment':_0x3cc8('0xc')},'data2':{'type':Sequelize[_0x3cc8('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3cc8('0xd')},'data4':{'type':Sequelize[_0x3cc8('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x3cc8('0xe')},'data6':{'type':Sequelize[_0x3cc8('0x4')],'comments':_0x3cc8('0xf')},'data7':{'type':Sequelize[_0x3cc8('0x10')],'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 5a15ce7..7a87cd3 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 _0xf431=['find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','then','destroy','error','stack','name','update','body','Action'];(function(_0x4b64a4,_0x1bdc50){var _0xd19b0e=function(_0x4dfbe0){while(--_0x4dfbe0){_0x4b64a4['push'](_0x4b64a4['shift']());}};_0xd19b0e(++_0x1bdc50);}(_0xf431,0xdf));var _0x1f43=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0xf431[_0x80d733];return _0x435868;};'use strict';var emlformat=require(_0x1f43('0x0'));var rimraf=require(_0x1f43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f43('0x2'));var rp=require(_0x1f43('0x3'));var moment=require('moment');var BPromise=require(_0x1f43('0x4'));var Mustache=require(_0x1f43('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1f43('0x6'));var ejs=require(_0x1f43('0x7'));var fs=require('fs');var fs_extra=require(_0x1f43('0x8'));var _=require(_0x1f43('0x9'));var squel=require(_0x1f43('0xa'));var crypto=require(_0x1f43('0xb'));var jsforce=require(_0x1f43('0xc'));var deskjs=require(_0x1f43('0xd'));var toCsv=require(_0x1f43('0x6'));var querystring=require('querystring');var Papa=require(_0x1f43('0xe'));var Redis=require(_0x1f43('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1f43('0x10'));var hardwareService=require(_0x1f43('0x11'));var logger=require(_0x1f43('0x12'))(_0x1f43('0x13'));var utils=require('../../config/utils');var config=require(_0x1f43('0x14'));var licenseUtil=require(_0x1f43('0x15'));var db=require(_0x1f43('0x16'))['db'];function respondWithStatusCode(_0x31d23f,_0x2ea60a){_0x2ea60a=_0x2ea60a||0xcc;return function(_0x1c7509){if(_0x1c7509){return _0x31d23f[_0x1f43('0x17')](_0x2ea60a);}return _0x31d23f[_0x1f43('0x18')](_0x2ea60a)[_0x1f43('0x19')]();};}function respondWithResult(_0xf2a71a,_0x3dca89){_0x3dca89=_0x3dca89||0xc8;return function(_0x41be14){if(_0x41be14){return _0xf2a71a['status'](_0x3dca89)[_0x1f43('0x1a')](_0x41be14);}};}function respondWithFilteredResult(_0x547957,_0x3ffffb){return function(_0x325d9d){if(_0x325d9d){var _0x3ed20b=typeof _0x3ffffb[_0x1f43('0x1b')]===_0x1f43('0x1c')&&typeof _0x3ffffb['limit']==='undefined';var _0x461569=_0x325d9d['count'];var _0x291baf=_0x3ed20b?0x0:_0x3ffffb['offset'];var _0x597ac4=_0x3ed20b?_0x325d9d[_0x1f43('0x1d')]:_0x3ffffb[_0x1f43('0x1b')]+_0x3ffffb['limit'];var _0xcdabb8;if(_0x597ac4>=_0x461569){_0x597ac4=_0x461569;_0xcdabb8=0xc8;}else{_0xcdabb8=0xce;}_0x547957[_0x1f43('0x18')](_0xcdabb8);return _0x547957[_0x1f43('0x1e')]('Content-Range',_0x291baf+'-'+_0x597ac4+'/'+_0x461569)['json'](_0x325d9d);}return null;};}function patchUpdates(_0x1a6a29){return function(_0x284f2d){try{jsonpatch['apply'](_0x284f2d,_0x1a6a29,!![]);}catch(_0x2e1c22){return BPromise[_0x1f43('0x1f')](_0x2e1c22);}return _0x284f2d[_0x1f43('0x20')]();};}function saveUpdates(_0x15e57d,_0x5a0874){return function(_0x1416a4){if(_0x1416a4){return _0x1416a4['update'](_0x15e57d)[_0x1f43('0x21')](function(_0x35c390){return _0x35c390;});}return null;};}function removeEntity(_0x238462,_0x3a6c5a){return function(_0x97f380){if(_0x97f380){return _0x97f380[_0x1f43('0x22')]()[_0x1f43('0x21')](function(){_0x238462[_0x1f43('0x18')](0xcc)[_0x1f43('0x19')]();});}};}function handleEntityNotFound(_0x2d6732,_0x3bb455){return function(_0x5efcc9){if(!_0x5efcc9){_0x2d6732['sendStatus'](0x194);}return _0x5efcc9;};}function handleError(_0x43b4a9,_0x16377d){_0x16377d=_0x16377d||0x1f4;return function(_0x13cb2f){logger[_0x1f43('0x23')](_0x13cb2f[_0x1f43('0x24')]);if(_0x13cb2f[_0x1f43('0x25')]){delete _0x13cb2f[_0x1f43('0x25')];}_0x43b4a9['status'](_0x16377d)['send'](_0x13cb2f);};}exports[_0x1f43('0x26')]=function(_0x48da77,_0x2ac296){if(_0x48da77[_0x1f43('0x27')]['id']){delete _0x48da77[_0x1f43('0x27')]['id'];}return db[_0x1f43('0x28')][_0x1f43('0x29')]({'where':{'id':_0x48da77['params']['id']}})[_0x1f43('0x21')](handleEntityNotFound(_0x2ac296,null))[_0x1f43('0x21')](saveUpdates(_0x48da77[_0x1f43('0x27')],null))[_0x1f43('0x21')](respondWithResult(_0x2ac296,null))[_0x1f43('0x2a')](handleError(_0x2ac296,null));};exports[_0x1f43('0x22')]=function(_0x5b9283,_0x21df13){return db[_0x1f43('0x28')][_0x1f43('0x29')]({'where':{'id':_0x5b9283[_0x1f43('0x2b')]['id']}})[_0x1f43('0x21')](handleEntityNotFound(_0x21df13,null))['then'](removeEntity(_0x21df13,null))[_0x1f43('0x2a')](handleError(_0x21df13,null));}; \ No newline at end of file +var _0x7851=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x103e0d,_0x1675a7){var _0x3e92d2=function(_0x1da3a2){while(--_0x1da3a2){_0x103e0d['push'](_0x103e0d['shift']());}};_0x3e92d2(++_0x1675a7);}(_0x7851,0xba));var _0x1785=function(_0x2fb0a7,_0x4cc844){_0x2fb0a7=_0x2fb0a7-0x0;var _0x5348a9=_0x7851[_0x2fb0a7];return _0x5348a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1785('0x0'));var zipdir=require(_0x1785('0x1'));var jsonpatch=require(_0x1785('0x2'));var rp=require('request-promise');var moment=require(_0x1785('0x3'));var BPromise=require(_0x1785('0x4'));var Mustache=require(_0x1785('0x5'));var util=require(_0x1785('0x6'));var path=require(_0x1785('0x7'));var sox=require(_0x1785('0x8'));var csv=require(_0x1785('0x9'));var ejs=require(_0x1785('0xa'));var fs=require('fs');var fs_extra=require(_0x1785('0xb'));var _=require(_0x1785('0xc'));var squel=require(_0x1785('0xd'));var crypto=require('crypto');var jsforce=require(_0x1785('0xe'));var deskjs=require(_0x1785('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1785('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1785('0x11'));var as=require(_0x1785('0x12'));var hardwareService=require(_0x1785('0x13'));var logger=require(_0x1785('0x14'))(_0x1785('0x15'));var utils=require(_0x1785('0x16'));var config=require(_0x1785('0x17'));var licenseUtil=require(_0x1785('0x18'));var db=require(_0x1785('0x19'))['db'];function respondWithStatusCode(_0x19018c,_0x189260){_0x189260=_0x189260||0xcc;return function(_0x5e526e){if(_0x5e526e){return _0x19018c[_0x1785('0x1a')](_0x189260);}return _0x19018c[_0x1785('0x1b')](_0x189260)[_0x1785('0x1c')]();};}function respondWithResult(_0x4467b1,_0x5c44f2){_0x5c44f2=_0x5c44f2||0xc8;return function(_0x3d5f21){if(_0x3d5f21){return _0x4467b1[_0x1785('0x1b')](_0x5c44f2)['json'](_0x3d5f21);}};}function respondWithFilteredResult(_0x1096be,_0x27b04d){return function(_0x46c8a6){if(_0x46c8a6){var _0x55ecec=typeof _0x27b04d[_0x1785('0x1d')]==='undefined'&&typeof _0x27b04d[_0x1785('0x1e')]===_0x1785('0x1f');var _0x28f341=_0x46c8a6[_0x1785('0x20')];var _0x5f2952=_0x55ecec?0x0:_0x27b04d[_0x1785('0x1d')];var _0x3483ca=_0x55ecec?_0x46c8a6['count']:_0x27b04d[_0x1785('0x1d')]+_0x27b04d[_0x1785('0x1e')];var _0x15d7c1;if(_0x3483ca>=_0x28f341){_0x3483ca=_0x28f341;_0x15d7c1=0xc8;}else{_0x15d7c1=0xce;}_0x1096be['status'](_0x15d7c1);return _0x1096be[_0x1785('0x21')](_0x1785('0x22'),_0x5f2952+'-'+_0x3483ca+'/'+_0x28f341)[_0x1785('0x23')](_0x46c8a6);}return null;};}function patchUpdates(_0x25b31c){return function(_0x22d559){try{jsonpatch[_0x1785('0x24')](_0x22d559,_0x25b31c,!![]);}catch(_0x4bcb11){return BPromise[_0x1785('0x25')](_0x4bcb11);}return _0x22d559[_0x1785('0x26')]();};}function saveUpdates(_0x2550e1,_0x34189a){return function(_0x59e6d0){if(_0x59e6d0){return _0x59e6d0[_0x1785('0x27')](_0x2550e1)[_0x1785('0x28')](function(_0x40b38f){return _0x40b38f;});}return null;};}function removeEntity(_0x588541,_0x2f6016){return function(_0x7f0cd0){if(_0x7f0cd0){return _0x7f0cd0[_0x1785('0x29')]()['then'](function(){_0x588541[_0x1785('0x1b')](0xcc)[_0x1785('0x1c')]();});}};}function handleEntityNotFound(_0x2b6004,_0x1ada4f){return function(_0x3e0c06){if(!_0x3e0c06){_0x2b6004[_0x1785('0x1a')](0x194);}return _0x3e0c06;};}function handleError(_0x26e2f6,_0x393c32){_0x393c32=_0x393c32||0x1f4;return function(_0x49ca21){logger[_0x1785('0x2a')](_0x49ca21[_0x1785('0x2b')]);if(_0x49ca21['name']){delete _0x49ca21[_0x1785('0x2c')];}_0x26e2f6[_0x1785('0x1b')](_0x393c32)['send'](_0x49ca21);};}exports['update']=function(_0x1307a7,_0x59fe51){if(_0x1307a7[_0x1785('0x2d')]['id']){delete _0x1307a7[_0x1785('0x2d')]['id'];}return db[_0x1785('0x2e')][_0x1785('0x2f')]({'where':{'id':_0x1307a7[_0x1785('0x30')]['id']}})['then'](handleEntityNotFound(_0x59fe51,null))[_0x1785('0x28')](saveUpdates(_0x1307a7[_0x1785('0x2d')],null))[_0x1785('0x28')](respondWithResult(_0x59fe51,null))[_0x1785('0x31')](handleError(_0x59fe51,null));};exports[_0x1785('0x29')]=function(_0x237298,_0x20872b){return db[_0x1785('0x2e')][_0x1785('0x2f')]({'where':{'id':_0x237298[_0x1785('0x30')]['id']}})[_0x1785('0x28')](handleEntityNotFound(_0x20872b,null))[_0x1785('0x28')](removeEntity(_0x20872b,null))[_0x1785('0x31')](handleError(_0x20872b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 93642a8..62be46b 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 _0xe698=['path','rimraf','../../config/environment','./action.attributes','exports','define','lodash','util','moment','bluebird','request-promise'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xe698,0x69));var _0x8e69=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe698[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8e69('0x2'));var BPromise=require(_0x8e69('0x3'));var rp=require(_0x8e69('0x4'));var fs=require('fs');var path=require(_0x8e69('0x5'));var rimraf=require(_0x8e69('0x6'));var config=require(_0x8e69('0x7'));var attributes=require(_0x8e69('0x8'));module[_0x8e69('0x9')]=function(_0x1d6979,_0x3aa1ff){return _0x1d6979[_0x8e69('0xa')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf22=['bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','util','../../config/logger','api','moment'];(function(_0x54b306,_0x5208e6){var _0x50f13c=function(_0x5eed43){while(--_0x5eed43){_0x54b306['push'](_0x54b306['shift']());}};_0x50f13c(++_0x5208e6);}(_0xdf22,0x74));var _0x2df2=function(_0x10d350,_0x12fab8){_0x10d350=_0x10d350-0x0;var _0x247de1=_0xdf22[_0x10d350];return _0x247de1;};'use strict';var _=require('lodash');var util=require(_0x2df2('0x0'));var logger=require(_0x2df2('0x1'))(_0x2df2('0x2'));var moment=require(_0x2df2('0x3'));var BPromise=require(_0x2df2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2df2('0x5'));var rimraf=require(_0x2df2('0x6'));var config=require(_0x2df2('0x7'));var attributes=require(_0x2df2('0x8'));module[_0x2df2('0x9')]=function(_0x4e2dc4,_0x338bbb){return _0x4e2dc4[_0x2df2('0xa')]('Action',attributes,{'tableName':_0x2df2('0xb'),'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 74e96c9..de1cd8b 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x336e33,_0x527fa3){var _0x6c333a=function(_0x48dabd){while(--_0x48dabd){_0x336e33['push'](_0x336e33['shift']());}};_0x6c333a(++_0x527fa3);}(_0x5fab,0x177));var _0xb5fa=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0x5fab[_0xca1091];return _0xd3019c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x4975,0x86));var _0x5497=function(_0x528a5e,_0x397cbe){_0x528a5e=_0x528a5e-0x0;var _0x5b7355=_0x4975[_0x528a5e];return _0x5b7355;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3abfe53..ba27b7b 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 _0x3596=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x1ef964,_0x1953ec){var _0x3e857f=function(_0x28da96){while(--_0x28da96){_0x1ef964['push'](_0x1ef964['shift']());}};_0x3e857f(++_0x1953ec);}(_0x3596,0x181));var _0x6359=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3596[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x6359('0x0'));var util=require(_0x6359('0x1'));var path=require(_0x6359('0x2'));var timeout=require(_0x6359('0x3'));var express=require(_0x6359('0x4'));var router=express[_0x6359('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6359('0x6'));var interaction=require(_0x6359('0x7'));var config=require('../../config/environment');var controller=require(_0x6359('0x8'));router[_0x6359('0x9')](_0x6359('0xa'),auth[_0x6359('0xb')](),controller[_0x6359('0xc')]);router[_0x6359('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6359('0xe')]);module[_0x6359('0xf')]=router; \ No newline at end of file +var _0xb32e=['/:id','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','update','delete'];(function(_0x35c390,_0xb71e7a){var _0x2602cd=function(_0x3c941f){while(--_0x3c941f){_0x35c390['push'](_0x35c390['shift']());}};_0x2602cd(++_0xb71e7a);}(_0xb32e,0x13d));var _0xeb32=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb32e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeb32('0x0'));var util=require('util');var path=require(_0xeb32('0x1'));var timeout=require(_0xeb32('0x2'));var express=require(_0xeb32('0x3'));var router=express[_0xeb32('0x4')]();var fs_extra=require(_0xeb32('0x5'));var auth=require(_0xeb32('0x6'));var interaction=require(_0xeb32('0x7'));var config=require(_0xeb32('0x8'));var controller=require(_0xeb32('0x9'));router[_0xeb32('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xeb32('0xb')]);router[_0xeb32('0xc')](_0xeb32('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb32('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 612c723..d8a08c2 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x16311f,_0x40f002){var _0x42f147=function(_0x1887fd){while(--_0x1887fd){_0x16311f['push'](_0x16311f['shift']());}};_0x42f147(++_0x40f002);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x2eb2[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6aa7=['TEXT','sequelize','STRING'];(function(_0x564615,_0x51000c){var _0x3e5c3c=function(_0x35b777){while(--_0x35b777){_0x564615['push'](_0x564615['shift']());}};_0x3e5c3c(++_0x51000c);}(_0x6aa7,0x178));var _0x76aa=function(_0x4ef352,_0x622052){_0x4ef352=_0x4ef352-0x0;var _0xb33802=_0x6aa7[_0x4ef352];return _0xb33802;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x76aa('0x1')]},'parent':{'type':Sequelize[_0x76aa('0x1')]},'table':{'type':Sequelize[_0x76aa('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x76aa('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 412f596..67049a8 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 _0xd555=['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\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','output','web','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','MIN(%s)','clone','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','CustomReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','AnalyticCustomReport','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Reports','UserProfileSection','userProfileId','update','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)'];(function(_0x216a55,_0x4dfa2c){var _0xe9ecb3=function(_0x344dc0){while(--_0x344dc0){_0x216a55['push'](_0x216a55['shift']());}};_0xe9ecb3(++_0x4dfa2c);}(_0xd555,0xef));var _0x5d55=function(_0x11cb2f,_0x5c409f){_0x11cb2f=_0x11cb2f-0x0;var _0x5800fc=_0xd555[_0x11cb2f];return _0x5800fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5d55('0x0'));var zipdir=require(_0x5d55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5d55('0x2'));var BPromise=require(_0x5d55('0x3'));var Mustache=require('mustache');var util=require(_0x5d55('0x4'));var path=require(_0x5d55('0x5'));var sox=require(_0x5d55('0x6'));var csv=require(_0x5d55('0x7'));var ejs=require(_0x5d55('0x8'));var fs=require('fs');var fs_extra=require(_0x5d55('0x9'));var _=require(_0x5d55('0xa'));var squel=require(_0x5d55('0xb'));var crypto=require(_0x5d55('0xc'));var jsforce=require(_0x5d55('0xd'));var deskjs=require(_0x5d55('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5d55('0xf'));var Papa=require(_0x5d55('0x10'));var Redis=require(_0x5d55('0x11'));var authService=require(_0x5d55('0x12'));var qs=require(_0x5d55('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d55('0x14'));var logger=require(_0x5d55('0x15'))(_0x5d55('0x16'));var utils=require(_0x5d55('0x17'));var config=require(_0x5d55('0x18'));var licenseUtil=require(_0x5d55('0x19'));var db=require(_0x5d55('0x1a'))['db'];var dbH=require(_0x5d55('0x1a'))[_0x5d55('0x1b')];function respondWithStatusCode(_0x11f04a,_0x19a6eb){_0x19a6eb=_0x19a6eb||0xcc;return function(_0x54fc4c){if(_0x54fc4c){return _0x11f04a[_0x5d55('0x1c')](_0x19a6eb);}return _0x11f04a[_0x5d55('0x1d')](_0x19a6eb)['end']();};}function respondWithResult(_0x46712e,_0x22039f){_0x22039f=_0x22039f||0xc8;return function(_0x4854b3){if(_0x4854b3){return _0x46712e['status'](_0x22039f)[_0x5d55('0x1e')](_0x4854b3);}};}function respondWithFilteredResult(_0x2c4413,_0x332e5b){return function(_0x1964f6){if(_0x1964f6){var _0x3055bd=typeof _0x332e5b[_0x5d55('0x1f')]===_0x5d55('0x20')&&typeof _0x332e5b['limit']===_0x5d55('0x20');var _0x52fad9=_0x1964f6[_0x5d55('0x21')];var _0x372434=_0x3055bd?0x0:_0x332e5b[_0x5d55('0x1f')];var _0x29ee7f=_0x3055bd?_0x1964f6[_0x5d55('0x21')]:_0x332e5b['offset']+_0x332e5b['limit'];var _0x57502a;if(_0x29ee7f>=_0x52fad9){_0x29ee7f=_0x52fad9;_0x57502a=0xc8;}else{_0x57502a=0xce;}_0x2c4413[_0x5d55('0x1d')](_0x57502a);return _0x2c4413[_0x5d55('0x22')](_0x5d55('0x23'),_0x372434+'-'+_0x29ee7f+'/'+_0x52fad9)['json'](_0x1964f6);}return null;};}function patchUpdates(_0x2175c6){return function(_0xc5347e){try{jsonpatch[_0x5d55('0x24')](_0xc5347e,_0x2175c6,!![]);}catch(_0xa29d5f){return BPromise[_0x5d55('0x25')](_0xa29d5f);}return _0xc5347e[_0x5d55('0x26')]();};}function saveUpdates(_0xa04754,_0x2dedaa){return function(_0x5b1f90){if(_0x5b1f90){return _0x5b1f90['update'](_0xa04754)[_0x5d55('0x27')](function(_0x45b71f){return _0x45b71f;});}return null;};}function removeEntity(_0x2b2339,_0x1bbeab){return function(_0x5275eb){if(_0x5275eb){return _0x5275eb[_0x5d55('0x28')]()[_0x5d55('0x27')](function(){var _0x2280cd=_0x5275eb['get']({'plain':!![]});var _0x562468=_0x5d55('0x29');return db[_0x5d55('0x2a')]['destroy']({'where':{'type':_0x562468,'resourceId':_0x2280cd['id']}})[_0x5d55('0x27')](function(){return _0x5275eb;});})[_0x5d55('0x27')](function(){_0x2b2339['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dafd8,_0x119ef0){return function(_0x2fe3cb){if(!_0x2fe3cb){_0x2dafd8[_0x5d55('0x1c')](0x194);}return _0x2fe3cb;};}function handleError(_0x261bf9,_0x4e6a02){_0x4e6a02=_0x4e6a02||0x1f4;return function(_0x4232f1){logger[_0x5d55('0x2b')](_0x4232f1['stack']);if(_0x4232f1[_0x5d55('0x2c')]){delete _0x4232f1['name'];}_0x261bf9[_0x5d55('0x1d')](_0x4e6a02)[_0x5d55('0x2d')](_0x4232f1);};}exports[_0x5d55('0x2e')]=function(_0x4c3f3f,_0x188392){var _0x47d338={},_0x5ed909={},_0x3c7d28={'count':0x0,'rows':[]};var _0x52ce76=_[_0x5d55('0x2f')](db['AnalyticCustomReport'][_0x5d55('0x30')],function(_0x1606c6){return{'name':_0x1606c6[_0x5d55('0x31')],'type':_0x1606c6[_0x5d55('0x32')][_0x5d55('0x33')]};});_0x5ed909['model']=_[_0x5d55('0x2f')](_0x52ce76,_0x5d55('0x2c'));_0x5ed909[_0x5d55('0x34')]=_[_0x5d55('0x35')](_0x4c3f3f[_0x5d55('0x34')]);_0x5ed909[_0x5d55('0x36')]=_[_0x5d55('0x37')](_0x5ed909['model'],_0x5ed909[_0x5d55('0x34')]);_0x47d338[_0x5d55('0x38')]=_[_0x5d55('0x37')](_0x5ed909[_0x5d55('0x39')],qs[_0x5d55('0x3a')](_0x4c3f3f['query'][_0x5d55('0x3a')]));_0x47d338['attributes']=_0x47d338[_0x5d55('0x38')]['length']?_0x47d338[_0x5d55('0x38')]:_0x5ed909[_0x5d55('0x39')];if(!_0x4c3f3f[_0x5d55('0x34')][_0x5d55('0x3b')](_0x5d55('0x3c'))){_0x47d338[_0x5d55('0x3d')]=qs[_0x5d55('0x3d')](_0x4c3f3f['query'][_0x5d55('0x3d')]);_0x47d338[_0x5d55('0x1f')]=qs[_0x5d55('0x1f')](_0x4c3f3f['query']['offset']);}_0x47d338['order']=qs[_0x5d55('0x3e')](_0x4c3f3f['query'][_0x5d55('0x3e')]);_0x47d338[_0x5d55('0x3f')]=qs[_0x5d55('0x36')](_['pick'](_0x4c3f3f[_0x5d55('0x34')],_0x5ed909[_0x5d55('0x36')]),_0x52ce76);if(_0x4c3f3f[_0x5d55('0x34')][_0x5d55('0x40')]){_0x47d338['where']=_['merge'](_0x47d338[_0x5d55('0x3f')],{'$or':_[_0x5d55('0x2f')](_0x52ce76,function(_0x142669){if(_0x142669[_0x5d55('0x32')]!==_0x5d55('0x41')){var _0x3ba33a={};_0x3ba33a[_0x142669[_0x5d55('0x2c')]]={'$like':'%'+_0x4c3f3f['query']['filter']+'%'};return _0x3ba33a;}})});}_0x47d338=_[_0x5d55('0x42')]({},_0x47d338,_0x4c3f3f['options']);var _0x6513d6={'where':_0x47d338[_0x5d55('0x3f')]};return db[_0x5d55('0x43')]['count'](_0x6513d6)[_0x5d55('0x27')](function(_0x281406){_0x3c7d28[_0x5d55('0x21')]=_0x281406;if(_0x4c3f3f[_0x5d55('0x34')][_0x5d55('0x44')]){_0x47d338[_0x5d55('0x45')]=[{'all':!![]}];}return db[_0x5d55('0x43')][_0x5d55('0x46')](_0x47d338);})[_0x5d55('0x27')](function(_0x2d1fba){_0x3c7d28[_0x5d55('0x47')]=_0x2d1fba;return _0x3c7d28;})[_0x5d55('0x27')](respondWithFilteredResult(_0x188392,_0x47d338))[_0x5d55('0x48')](handleError(_0x188392,null));};exports[_0x5d55('0x49')]=function(_0x2c812c,_0x25a260){var _0x57de5c={'raw':![],'where':{'id':_0x2c812c[_0x5d55('0x4a')]['id']}},_0x5a723c={};_0x5a723c[_0x5d55('0x39')]=_['keys'](db[_0x5d55('0x43')][_0x5d55('0x30')]);_0x5a723c['query']=_[_0x5d55('0x35')](_0x2c812c[_0x5d55('0x34')]);_0x5a723c['filters']=_[_0x5d55('0x37')](_0x5a723c[_0x5d55('0x39')],_0x5a723c[_0x5d55('0x34')]);_0x57de5c[_0x5d55('0x38')]=_[_0x5d55('0x37')](_0x5a723c[_0x5d55('0x39')],qs['fields'](_0x2c812c[_0x5d55('0x34')][_0x5d55('0x3a')]));_0x57de5c['attributes']=_0x57de5c[_0x5d55('0x38')][_0x5d55('0x4b')]?_0x57de5c['attributes']:_0x5a723c[_0x5d55('0x39')];if(_0x2c812c[_0x5d55('0x34')][_0x5d55('0x44')]){_0x57de5c['include']=[{'all':!![]}];}_0x57de5c=_[_0x5d55('0x42')]({},_0x57de5c,_0x2c812c[_0x5d55('0x4c')]);return db[_0x5d55('0x43')][_0x5d55('0x4d')](_0x57de5c)[_0x5d55('0x27')](handleEntityNotFound(_0x25a260,null))['then'](respondWithResult(_0x25a260,null))['catch'](handleError(_0x25a260,null));};exports[_0x5d55('0x4e')]=function(_0x27a932,_0x3b310c){return db[_0x5d55('0x43')][_0x5d55('0x4e')](_0x27a932['body'],{})[_0x5d55('0x27')](function(_0x212879){var _0x262357=_0x27a932[_0x5d55('0x4f')]['get']({'plain':!![]});if(!_0x262357)throw new Error(_0x5d55('0x50'));if(_0x262357[_0x5d55('0x51')]===_0x5d55('0x4f')){var _0x2aad2b=_0x212879[_0x5d55('0x52')]({'plain':!![]});var _0x247955=_0x5d55('0x53');return db[_0x5d55('0x54')][_0x5d55('0x4d')]({'where':{'name':_0x247955,'userProfileId':_0x262357[_0x5d55('0x55')]},'raw':!![]})[_0x5d55('0x27')](function(_0x596d22){if(_0x596d22&&_0x596d22['autoAssociation']===0x0){return db[_0x5d55('0x2a')][_0x5d55('0x4e')]({'name':_0x2aad2b['name'],'resourceId':_0x2aad2b['id'],'type':_0x5d55('0x29'),'sectionId':_0x596d22['id']},{})[_0x5d55('0x27')](function(){return _0x212879;});}else{return _0x212879;}})[_0x5d55('0x48')](function(_0xf69b8b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf69b8b);throw _0xf69b8b;});}return _0x212879;})['then'](respondWithResult(_0x3b310c,0xc9))[_0x5d55('0x48')](handleError(_0x3b310c,null));};exports[_0x5d55('0x56')]=function(_0x2e2aaf,_0x5c80e4){if(_0x2e2aaf[_0x5d55('0x57')]['id']){delete _0x2e2aaf['body']['id'];}return db['AnalyticCustomReport'][_0x5d55('0x4d')]({'where':{'id':_0x2e2aaf[_0x5d55('0x4a')]['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x5c80e4,null))['then'](saveUpdates(_0x2e2aaf['body'],null))['then'](respondWithResult(_0x5c80e4,null))['catch'](handleError(_0x5c80e4,null));};exports['destroy']=function(_0x4436a9,_0x50923d){return db['AnalyticCustomReport']['find']({'where':{'id':_0x4436a9['params']['id']}})[_0x5d55('0x27')](handleEntityNotFound(_0x50923d,null))[_0x5d55('0x27')](removeEntity(_0x50923d,null))[_0x5d55('0x48')](handleError(_0x50923d,null));};exports[_0x5d55('0x58')]=function(_0x122971,_0x483d2b){var _0x54220a=0xa;var _0x5b0d07=[_0x5d55('0x59'),_0x5d55('0x5a'),_0x5d55('0x5b'),_0x5d55('0x5c')];var _0x14a6e1={'SUM':_0x5d55('0x5d'),'COUNT':_0x5d55('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5d55('0x5f'),'MIN':'MIN(%s)','AVG':_0x5d55('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5d55('0x61'),'GROUP_CONCAT DESC':_0x5d55('0x62')};var _0x356634={'SEC_TO_TIME':_0x5d55('0x63'),'DATE':_0x5d55('0x64'),'HOUR':_0x5d55('0x65'),'ROUND':_0x5d55('0x66'),'UNIX_TIMESTAMP':_0x5d55('0x67')};var _0x5dad5c=function(_0x4345fd){return!_[_0x5d55('0x68')]([_0x5d55('0x69'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x5d55('0x6a')],_0x4345fd);};var _0x228e23=function(_0xd1ceb7){if(!_0xd1ceb7||!_0xd1ceb7[_0x5d55('0x6b')][_0x5d55('0x4b')]){return'';}for(var _0x1a0052='(',_0x5779d9=0x0;_0x5779d9<_0xd1ceb7['rules'][_0x5d55('0x4b')];_0x5779d9+=0x1){_0x5779d9>0x0&&(_0x1a0052+='\x20'+_0xd1ceb7[_0x5d55('0x6c')]+'\x20');_0x1a0052+=_0xd1ceb7[_0x5d55('0x6b')][_0x5779d9][_0x5d55('0x6d')]?_0x228e23(_0xd1ceb7[_0x5d55('0x6b')][_0x5779d9][_0x5d55('0x6d')]):_0xd1ceb7['rules'][_0x5779d9]['field']+'\x20'+_0xd1ceb7[_0x5d55('0x6b')][_0x5779d9][_0x5d55('0x6e')]+(_0x5dad5c(_0xd1ceb7['rules'][_0x5779d9][_0x5d55('0x6e')])?'\x20'+_0xd1ceb7[_0x5d55('0x6b')][_0x5779d9][_0x5d55('0x6f')]:'');}return _0x1a0052+')';};var _0x299b6e={'where':{'id':_0x122971[_0x5d55('0x4a')]['id']}},_0x23f059,_0x2ca93d,_0x536757,_0x28b691,_0x404a27;_0x299b6e=_[_0x5d55('0x42')]({},_0x299b6e,_0x122971[_0x5d55('0x4c')]);return db[_0x5d55('0x43')][_0x5d55('0x4d')](_0x299b6e)[_0x5d55('0x27')](function(_0x259195){if(_0x259195){_0x23f059=_0x259195;return _0x259195['getFields']();}return null;})[_0x5d55('0x27')](function(_0x50d65f){if(_0x50d65f){if(!_0x50d65f[_0x5d55('0x4b')]){throw new db[(_0x5d55('0x70'))][(_0x5d55('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2ca93d=_0x50d65f;return db[_0x5d55('0x72')][_0x5d55('0x46')]({'raw':!![]});}return null;})[_0x5d55('0x27')](function(_0x413984){if(_0x413984){_0x536757=_[_0x5d55('0x73')](_0x413984,'id');var _0x256a78;var _0x23b5cd=squel[_0x5d55('0x74')]();_0x23b5cd[_0x5d55('0x75')](_0x23f059[_0x5d55('0x76')]);for(var _0x1a0a23=0x0;_0x1a0a23<_0x2ca93d[_0x5d55('0x4b')];_0x1a0a23+=0x1){_0x256a78=_0x2ca93d[_0x1a0a23][_0x5d55('0x77')]?_0x536757[_0x2ca93d[_0x1a0a23]['MetricId']][_0x5d55('0x78')]:_0x2ca93d[_0x1a0a23]['field'];_0x256a78=_0x2ca93d[_0x1a0a23][_0x5d55('0x79')]?_['replace'](_0x14a6e1[_0x2ca93d[_0x1a0a23][_0x5d55('0x79')]],'%s',_0x256a78):_0x256a78;_0x256a78=_0x2ca93d[_0x1a0a23]['format']?_[_0x5d55('0x7a')](_0x356634[_0x2ca93d[_0x1a0a23][_0x5d55('0x7b')]],'%s',_0x256a78):_0x256a78;if(_0x2ca93d[_0x1a0a23]['groupBy']){_0x23b5cd[_0x5d55('0x6d')](_0x256a78);}_0x2ca93d[_0x1a0a23][_0x5d55('0x7c')]&&_0x23b5cd[_0x5d55('0x7d')](_0x256a78,_0x2ca93d[_0x1a0a23][_0x5d55('0x7c')]===_0x5d55('0x7e')?![]:!![]);_0x23b5cd[_0x5d55('0x7f')](_0x256a78,_0x2ca93d[_0x1a0a23][_0x5d55('0x80')]||_0x256a78);}if(_0x23f059[_0x5d55('0x81')]){_0x23f059[_0x5d55('0x81')]=JSON[_0x5d55('0x82')](_0x23f059[_0x5d55('0x81')]);for(var _0x11ad35=0x0;_0x11ad35<_0x23f059[_0x5d55('0x81')][_0x5d55('0x4b')];_0x11ad35+=0x1){if(_0x23f059[_0x5d55('0x81')][_0x11ad35]['type']&&_[_0x5d55('0x68')](_0x5b0d07,_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x32')])&&_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x83')]&&_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x84')]&&_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x85')]){_0x23b5cd[_0x23f059[_0x5d55('0x81')][_0x11ad35]['type']](_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x84')],null,util[_0x5d55('0x7b')](_0x5d55('0x86'),_0x23f059[_0x5d55('0x76')],_0x23f059['joins'][_0x11ad35]['parentKey'],_0x23f059['joins'][_0x11ad35][_0x5d55('0x84')],_0x23f059[_0x5d55('0x81')][_0x11ad35][_0x5d55('0x85')]));}}}if(_0x23f059[_0x5d55('0x87')]){_0x23f059['conditions']=JSON['parse'](_0x23f059[_0x5d55('0x87')]);_0x23b5cd[_0x5d55('0x3f')](_0x228e23(_0x23f059[_0x5d55('0x87')]['group']));}_0x404a27=_0x23b5cd['clone']();_0x23b5cd['limit'](_0x54220a);_0x23b5cd['offset'](0x0);logger[_0x5d55('0x88')](_0x5d55('0x89'),_0x23b5cd[_0x5d55('0x8a')]());return dbH['sequelize'][_0x5d55('0x34')](_0x23b5cd[_0x5d55('0x8a')](),{'type':dbH[_0x5d55('0x8b')][_0x5d55('0x8c')]['SELECT']});}})[_0x5d55('0x27')](respondWithResult(_0x483d2b,null))[_0x5d55('0x48')](handleError(_0x483d2b,null));};function runReport(_0x53cf50,_0x1be96c,_0x2753cd){var _0xe03afe=_0x1be96c[_0x5d55('0x2c')];var _0x54217b=0xa;var _0x42b091=[_0x5d55('0x59'),_0x5d55('0x5a'),'right_join',_0x5d55('0x5c')];var _0x1f00ae={'SUM':_0x5d55('0x5d'),'COUNT':_0x5d55('0x5e'),'COUNT DISTINCT':_0x5d55('0x8d'),'MAX':_0x5d55('0x5f'),'MIN':'MIN(%s)','AVG':_0x5d55('0x60'),'GROUP_CONCAT':_0x5d55('0x8e'),'GROUP_CONCAT ASC':_0x5d55('0x61'),'GROUP_CONCAT DESC':_0x5d55('0x62')};var _0x17b551={'SEC_TO_TIME':_0x5d55('0x63'),'DATE':_0x5d55('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x5d55('0x66'),'UNIX_TIMESTAMP':_0x5d55('0x67')};var _0xeefe34=function(_0x4f3607){return!_[_0x5d55('0x68')]([_0x5d55('0x69'),_0x5d55('0x8f'),_0x5d55('0x90'),_0x5d55('0x6a')],_0x4f3607);};var _0xea0732=function(_0x59631c){if(!_0x59631c||!_0x59631c[_0x5d55('0x6b')][_0x5d55('0x4b')]){return'';}for(var _0x4197f3='(',_0x1c158e=0x0;_0x1c158e<_0x59631c[_0x5d55('0x6b')][_0x5d55('0x4b')];_0x1c158e+=0x1){_0x1c158e>0x0&&(_0x4197f3+='\x20'+_0x59631c[_0x5d55('0x6c')]+'\x20');_0x4197f3+=_0x59631c[_0x5d55('0x6b')][_0x1c158e][_0x5d55('0x6d')]?_0xea0732(_0x59631c[_0x5d55('0x6b')][_0x1c158e][_0x5d55('0x6d')]):_0x59631c['rules'][_0x1c158e]['field']+'\x20'+_0x59631c[_0x5d55('0x6b')][_0x1c158e]['condition']+(_0xeefe34(_0x59631c['rules'][_0x1c158e][_0x5d55('0x6e')])?'\x20'+_0x59631c[_0x5d55('0x6b')][_0x1c158e][_0x5d55('0x6f')]:'');}return _0x4197f3+')';};var _0x36ba56={'where':{'id':_0x53cf50['id']}},_0x442fb7,_0x502d04,_0x35d559,_0x5c5556,_0x5c2522;_0x36ba56=_[_0x5d55('0x42')]({},_0x36ba56,_0x2753cd);return db[_0x5d55('0x43')]['find'](_0x36ba56)[_0x5d55('0x27')](function(_0x3bb6db){if(_0x3bb6db){_0x442fb7=_0x3bb6db;return _0x3bb6db['getFields']();}return null;})[_0x5d55('0x27')](function(_0x42b0a3){if(_0x42b0a3){if(!_0x42b0a3[_0x5d55('0x4b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5d55('0x91'),0x193);}_0x502d04=_0x42b0a3;return db[_0x5d55('0x72')][_0x5d55('0x46')]({'raw':!![]});}return null;})[_0x5d55('0x27')](function(_0x269a6b){if(_0x269a6b){_0x35d559=_[_0x5d55('0x73')](_0x269a6b,'id');var _0x2f8568;var _0x1df272=squel['select']();_0x1df272[_0x5d55('0x75')](_0x442fb7[_0x5d55('0x76')]);for(var _0x5c930b=0x0;_0x5c930b<_0x502d04[_0x5d55('0x4b')];_0x5c930b+=0x1){_0x2f8568=_0x502d04[_0x5c930b][_0x5d55('0x77')]?_0x35d559[_0x502d04[_0x5c930b]['MetricId']][_0x5d55('0x78')]:_0x502d04[_0x5c930b][_0x5d55('0x7f')];_0x2f8568=_0x502d04[_0x5c930b][_0x5d55('0x79')]?_[_0x5d55('0x7a')](_0x1f00ae[_0x502d04[_0x5c930b][_0x5d55('0x79')]],'%s',_0x2f8568):_0x2f8568;_0x2f8568=_0x502d04[_0x5c930b][_0x5d55('0x7b')]?_[_0x5d55('0x7a')](_0x17b551[_0x502d04[_0x5c930b][_0x5d55('0x7b')]],'%s',_0x2f8568):_0x2f8568;if(_0x502d04[_0x5c930b][_0x5d55('0x92')]){_0x1df272[_0x5d55('0x6d')](_0x2f8568);}_0x502d04[_0x5c930b][_0x5d55('0x7c')]&&_0x1df272['order'](_0x2f8568,_0x502d04[_0x5c930b]['orderBy']===_0x5d55('0x7e')?![]:!![]);_0x1df272[_0x5d55('0x7f')](_0x2f8568,_0x502d04[_0x5c930b][_0x5d55('0x80')]||_0x2f8568);}if(_0x442fb7['joins']){_0x442fb7[_0x5d55('0x81')]=JSON['parse'](_0x442fb7[_0x5d55('0x81')]);for(var _0x4348ef=0x0;_0x4348ef<_0x442fb7[_0x5d55('0x81')]['length'];_0x4348ef+=0x1){if(_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x32')]&&_[_0x5d55('0x68')](_0x42b091,_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x32')])&&_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x83')]&&_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x84')]&&_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x85')]){_0x1df272[_0x442fb7[_0x5d55('0x81')][_0x4348ef]['type']](_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x84')],null,util[_0x5d55('0x7b')](_0x5d55('0x86'),_0x442fb7[_0x5d55('0x76')],_0x442fb7['joins'][_0x4348ef]['parentKey'],_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x84')],_0x442fb7[_0x5d55('0x81')][_0x4348ef][_0x5d55('0x85')]));}}}if(_0x442fb7[_0x5d55('0x87')]){_0x442fb7[_0x5d55('0x87')]=JSON[_0x5d55('0x82')](_0x442fb7[_0x5d55('0x87')]);_0x1df272['where'](_0xea0732(_0x442fb7['conditions'][_0x5d55('0x6d')]));}_0x5c2522=_0x1df272['clone']();_0x1df272['limit'](_0x54217b);_0x1df272[_0x5d55('0x1f')](0x0);return;}})[_0x5d55('0x27')](function(){if(_0x1be96c[_0x5d55('0x93')]===_0x5d55('0x94')){return null;}var _0xc44a23=_[_0x5d55('0x42')](_0x1be96c,{'name':_0x1be96c[_0x5d55('0x95')]||_0x1be96c[_0x5d55('0x2c')]||_0x442fb7[_0x5d55('0x2c')],'basename':_0xe03afe,'savename':util[_0x5d55('0x7b')](_0x5d55('0x96'),_0x1be96c[_0x5d55('0x2c')]||_0x442fb7[_0x5d55('0x2c')],require('randomstring')['generate'](0x4),_0x1be96c[_0x5d55('0x93')]||_0x5d55('0x97')),'reportId':_0x442fb7['id'],'reportType':'custom'});return db[_0x5d55('0x98')][_0x5d55('0x4e')](_0xc44a23,{'raw':!![]});})[_0x5d55('0x27')](function(_0x8cd768){if(_0x442fb7[_0x5d55('0x76')]==='cdr'){_0x5c2522[_0x5d55('0x3f')](_0x442fb7[_0x5d55('0x76')]+_0x5d55('0x99'),_0x1be96c['startDate'],_0x1be96c[_0x5d55('0x9a')]);}else{_0x5c2522[_0x5d55('0x3f')](_0x442fb7['table']+_0x5d55('0x9b'),_0x1be96c['startDate'],_0x1be96c[_0x5d55('0x9a')]);}if(_0x8cd768){logger[_0x5d55('0x9c')](_0x5d55('0x9d'),_0x5c2522[_0x5d55('0x8a')]());require(_0x5d55('0x9e'))[_0x5d55('0x9f')](path[_0x5d55('0x59')](__dirname,_0x5d55('0xa0'),_0x8cd768[_0x5d55('0x93')]),[_0x8cd768['id'],_0x5c2522[_0x5d55('0x8a')](),path[_0x5d55('0x59')](__dirname,_0x5d55('0xa1'),_0x8cd768['savename']),_0xe03afe]);return _0x8cd768;}else{var _0x557ed1=squel[_0x5d55('0x74')]();_0x557ed1['from']('('+_0x5c2522['toString']()+')',_0x5d55('0xa2'));_0x557ed1[_0x5d55('0x7f')](_0x5d55('0xa3'),_0x5d55('0x21'));_0x5c2522['limit'](_0x1be96c[_0x5d55('0x3d')]||_0x54217b);_0x5c2522[_0x5d55('0x1f')](_0x1be96c[_0x5d55('0x1f')]||0x0);return dbH[_0x5d55('0x8b')][_0x5d55('0x34')](_0x557ed1['toString'](),{'type':dbH['sequelize'][_0x5d55('0x8c')]['SELECT']})[_0x5d55('0x27')](function(_0x309af6){if(!_0x309af6[_0x5d55('0x4b')]){_0x5c5556=0x0;}else{_0x5c5556=_0x309af6[0x0][_0x5d55('0x21')]||0x0;}return dbH[_0x5d55('0x8b')][_0x5d55('0x34')](_0x5c2522['toString'](),{'type':dbH[_0x5d55('0x8b')]['QueryTypes'][_0x5d55('0xa4')]});})['then'](function(_0x565077){return{'rows':_0x565077||[],'count':_0x5c5556};});}});}exports[_0x5d55('0xa5')]=function(_0x1db596,_0x345dbe){return runReport(_0x1db596['params'],_0x1db596[_0x5d55('0x34')],_0x1db596[_0x5d55('0x4c')])[_0x5d55('0x27')](respondWithResult(_0x345dbe,null))[_0x5d55('0x48')](handleError(_0x345dbe,null));};exports['runReport']=runReport;exports[_0x5d55('0x34')]=function(_0x560f6c,_0x5c55a9){var _0x180ff7=0xa;var _0x7f3e34=[_0x5d55('0x59'),_0x5d55('0x5a'),_0x5d55('0x5b'),_0x5d55('0x5c')];var _0x113c0f={'SUM':_0x5d55('0x5d'),'COUNT':_0x5d55('0x5e'),'COUNT DISTINCT':_0x5d55('0x8d'),'MAX':_0x5d55('0x5f'),'MIN':_0x5d55('0xa6'),'AVG':_0x5d55('0x60'),'GROUP_CONCAT':_0x5d55('0x8e'),'GROUP_CONCAT ASC':_0x5d55('0x61'),'GROUP_CONCAT DESC':_0x5d55('0x62')};var _0x4f1e29={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5d55('0x64'),'HOUR':_0x5d55('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5d55('0x67')};var _0x406135=function(_0x2e0ea8){return!_[_0x5d55('0x68')]([_0x5d55('0x69'),_0x5d55('0x8f'),_0x5d55('0x90'),'IS\x20NOT\x20EMPTY'],_0x2e0ea8);};var _0x48268c=function(_0x55d208){if(!_0x55d208||!_0x55d208[_0x5d55('0x6b')]['length']){return'';}for(var _0x1de307='(',_0xc890ef=0x0;_0xc890ef<_0x55d208['rules'][_0x5d55('0x4b')];_0xc890ef+=0x1){_0xc890ef>0x0&&(_0x1de307+='\x20'+_0x55d208['operator']+'\x20');_0x1de307+=_0x55d208['rules'][_0xc890ef][_0x5d55('0x6d')]?_0x48268c(_0x55d208[_0x5d55('0x6b')][_0xc890ef]['group']):_0x55d208[_0x5d55('0x6b')][_0xc890ef][_0x5d55('0x7f')]+'\x20'+_0x55d208[_0x5d55('0x6b')][_0xc890ef][_0x5d55('0x6e')]+(_0x406135(_0x55d208[_0x5d55('0x6b')][_0xc890ef][_0x5d55('0x6e')])?'\x20'+_0x55d208['rules'][_0xc890ef][_0x5d55('0x6f')]:'');}return _0x1de307+')';};var _0x668bea={'where':{'id':_0x560f6c[_0x5d55('0x4a')]['id']}},_0x177fa2,_0x4bd65d,_0x30fd3c,_0x350ca7,_0x416756;_0x668bea=_[_0x5d55('0x42')]({},_0x668bea,_0x560f6c['options']);return db['AnalyticCustomReport'][_0x5d55('0x4d')](_0x668bea)[_0x5d55('0x27')](function(_0x135ab3){if(_0x135ab3){_0x177fa2=_0x135ab3;return _0x135ab3['getFields']();}return null;})[_0x5d55('0x27')](function(_0x8a8fcf){if(_0x8a8fcf){if(!_0x8a8fcf[_0x5d55('0x4b')]){throw new db[(_0x5d55('0x70'))]['ValidationErrorItem'](_0x5d55('0x91'),0x193);}_0x4bd65d=_0x8a8fcf;return db[_0x5d55('0x72')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x32875a){if(_0x32875a){_0x30fd3c=_[_0x5d55('0x73')](_0x32875a,'id');var _0x2053d5;var _0x1e9642=squel[_0x5d55('0x74')]();_0x1e9642[_0x5d55('0x75')](_0x177fa2[_0x5d55('0x76')]);for(var _0x25f11f=0x0;_0x25f11f<_0x4bd65d[_0x5d55('0x4b')];_0x25f11f+=0x1){_0x2053d5=_0x4bd65d[_0x25f11f][_0x5d55('0x77')]?_0x30fd3c[_0x4bd65d[_0x25f11f]['MetricId']][_0x5d55('0x78')]:_0x4bd65d[_0x25f11f]['field'];_0x2053d5=_0x4bd65d[_0x25f11f][_0x5d55('0x79')]?_[_0x5d55('0x7a')](_0x113c0f[_0x4bd65d[_0x25f11f]['function']],'%s',_0x2053d5):_0x2053d5;_0x2053d5=_0x4bd65d[_0x25f11f][_0x5d55('0x7b')]?_['replace'](_0x4f1e29[_0x4bd65d[_0x25f11f][_0x5d55('0x7b')]],'%s',_0x2053d5):_0x2053d5;if(_0x4bd65d[_0x25f11f][_0x5d55('0x92')]){_0x1e9642[_0x5d55('0x6d')](_0x2053d5);}_0x4bd65d[_0x25f11f][_0x5d55('0x7c')]&&_0x1e9642[_0x5d55('0x7d')](_0x2053d5,_0x4bd65d[_0x25f11f][_0x5d55('0x7c')]===_0x5d55('0x7e')?![]:!![]);_0x1e9642['field'](_0x2053d5,_0x4bd65d[_0x25f11f][_0x5d55('0x80')]||_0x2053d5);}if(_0x177fa2[_0x5d55('0x81')]){_0x177fa2['joins']=JSON[_0x5d55('0x82')](_0x177fa2[_0x5d55('0x81')]);for(var _0x2537e2=0x0;_0x2537e2<_0x177fa2[_0x5d55('0x81')][_0x5d55('0x4b')];_0x2537e2+=0x1){if(_0x177fa2[_0x5d55('0x81')][_0x2537e2][_0x5d55('0x32')]&&_['includes'](_0x7f3e34,_0x177fa2['joins'][_0x2537e2][_0x5d55('0x32')])&&_0x177fa2['joins'][_0x2537e2][_0x5d55('0x83')]&&_0x177fa2[_0x5d55('0x81')][_0x2537e2][_0x5d55('0x84')]&&_0x177fa2[_0x5d55('0x81')][_0x2537e2][_0x5d55('0x85')]){_0x1e9642[_0x177fa2[_0x5d55('0x81')][_0x2537e2][_0x5d55('0x32')]](_0x177fa2['joins'][_0x2537e2][_0x5d55('0x84')],null,util['format'](_0x5d55('0x86'),_0x177fa2[_0x5d55('0x76')],_0x177fa2[_0x5d55('0x81')][_0x2537e2][_0x5d55('0x83')],_0x177fa2[_0x5d55('0x81')][_0x2537e2]['foreignTable'],_0x177fa2[_0x5d55('0x81')][_0x2537e2]['foreignKey']));}}}if(_0x177fa2[_0x5d55('0x87')]){_0x177fa2[_0x5d55('0x87')]=JSON[_0x5d55('0x82')](_0x177fa2[_0x5d55('0x87')]);_0x1e9642[_0x5d55('0x3f')](_0x48268c(_0x177fa2[_0x5d55('0x87')][_0x5d55('0x6d')]));}_0x416756=_0x1e9642[_0x5d55('0xa7')]();_0x1e9642[_0x5d55('0x3d')](_0x180ff7);_0x1e9642[_0x5d55('0x1f')](0x0);logger[_0x5d55('0x88')]('Limited\x20Query:',_0x1e9642['toString']());return dbH[_0x5d55('0x8b')][_0x5d55('0x34')](_0x1e9642['toString'](),{'type':dbH[_0x5d55('0x8b')]['QueryTypes'][_0x5d55('0xa4')]});}})[_0x5d55('0x27')](function(){return{'sql':_0x416756[_0x5d55('0x8a')]()};})[_0x5d55('0x27')](respondWithResult(_0x5c55a9,null))[_0x5d55('0x48')](handleError(_0x5c55a9,null));}; \ No newline at end of file +var _0x0426=['COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','Sequelize','AnalyticMetric','order','alias','output','web','fullPath','%s-%s.%s','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','undefined','limit','count','offset','save','update','destroy','then','get','CustomReports','UserProfileResource','end','error','stack','name','send','map','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','AnalyticCustomReport','includeAll','include','findAll','catch','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x0426,0x188));var _0x6042=function(_0x1cb9b1,_0x38d288){_0x1cb9b1=_0x1cb9b1-0x0;var _0x1c0c2e=_0x0426[_0x1cb9b1];return _0x1c0c2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6042('0x0'));var zipdir=require(_0x6042('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6042('0x2'));var moment=require(_0x6042('0x3'));var BPromise=require(_0x6042('0x4'));var Mustache=require(_0x6042('0x5'));var util=require(_0x6042('0x6'));var path=require(_0x6042('0x7'));var sox=require('sox');var csv=require(_0x6042('0x8'));var ejs=require(_0x6042('0x9'));var fs=require('fs');var fs_extra=require(_0x6042('0xa'));var _=require(_0x6042('0xb'));var squel=require(_0x6042('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6042('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6042('0xe'));var Papa=require(_0x6042('0xf'));var Redis=require(_0x6042('0x10'));var authService=require(_0x6042('0x11'));var qs=require(_0x6042('0x12'));var as=require(_0x6042('0x13'));var hardwareService=require(_0x6042('0x14'));var logger=require('../../config/logger')(_0x6042('0x15'));var utils=require(_0x6042('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6042('0x17'))['db'];var dbH=require('../../mysqldb')[_0x6042('0x18')];function respondWithStatusCode(_0x3b77d6,_0x4f5f61){_0x4f5f61=_0x4f5f61||0xcc;return function(_0x2c4e4b){if(_0x2c4e4b){return _0x3b77d6[_0x6042('0x19')](_0x4f5f61);}return _0x3b77d6[_0x6042('0x1a')](_0x4f5f61)['end']();};}function respondWithResult(_0x3fce,_0x41b17e){_0x41b17e=_0x41b17e||0xc8;return function(_0x3e4d0b){if(_0x3e4d0b){return _0x3fce[_0x6042('0x1a')](_0x41b17e)['json'](_0x3e4d0b);}};}function respondWithFilteredResult(_0x5f4baf,_0x1eacfa){return function(_0x5ae454){if(_0x5ae454){var _0x25bd6f=typeof _0x1eacfa['offset']===_0x6042('0x1b')&&typeof _0x1eacfa[_0x6042('0x1c')]===_0x6042('0x1b');var _0x3a746c=_0x5ae454[_0x6042('0x1d')];var _0x4754b3=_0x25bd6f?0x0:_0x1eacfa[_0x6042('0x1e')];var _0x4d5115=_0x25bd6f?_0x5ae454[_0x6042('0x1d')]:_0x1eacfa[_0x6042('0x1e')]+_0x1eacfa[_0x6042('0x1c')];var _0x503bbf;if(_0x4d5115>=_0x3a746c){_0x4d5115=_0x3a746c;_0x503bbf=0xc8;}else{_0x503bbf=0xce;}_0x5f4baf['status'](_0x503bbf);return _0x5f4baf['set']('Content-Range',_0x4754b3+'-'+_0x4d5115+'/'+_0x3a746c)['json'](_0x5ae454);}return null;};}function patchUpdates(_0x3dbaa8){return function(_0xd911f1){try{jsonpatch['apply'](_0xd911f1,_0x3dbaa8,!![]);}catch(_0x310bb8){return BPromise['reject'](_0x310bb8);}return _0xd911f1[_0x6042('0x1f')]();};}function saveUpdates(_0x29696d,_0x163089){return function(_0x44f301){if(_0x44f301){return _0x44f301[_0x6042('0x20')](_0x29696d)['then'](function(_0x26e55b){return _0x26e55b;});}return null;};}function removeEntity(_0x15173c,_0x11291a){return function(_0x10801d){if(_0x10801d){return _0x10801d[_0x6042('0x21')]()[_0x6042('0x22')](function(){var _0x4426df=_0x10801d[_0x6042('0x23')]({'plain':!![]});var _0x1677d5=_0x6042('0x24');return db[_0x6042('0x25')]['destroy']({'where':{'type':_0x1677d5,'resourceId':_0x4426df['id']}})[_0x6042('0x22')](function(){return _0x10801d;});})['then'](function(){_0x15173c[_0x6042('0x1a')](0xcc)[_0x6042('0x26')]();});}};}function handleEntityNotFound(_0x37f8de,_0x5a54f7){return function(_0x1799a2){if(!_0x1799a2){_0x37f8de['sendStatus'](0x194);}return _0x1799a2;};}function handleError(_0x5309ec,_0x245cb7){_0x245cb7=_0x245cb7||0x1f4;return function(_0x47a6b1){logger[_0x6042('0x27')](_0x47a6b1[_0x6042('0x28')]);if(_0x47a6b1['name']){delete _0x47a6b1[_0x6042('0x29')];}_0x5309ec[_0x6042('0x1a')](_0x245cb7)[_0x6042('0x2a')](_0x47a6b1);};}exports['index']=function(_0x406110,_0x573743){var _0x13788c={},_0x280728={},_0x298737={'count':0x0,'rows':[]};var _0x428c80=_[_0x6042('0x2b')](db['AnalyticCustomReport'][_0x6042('0x2c')],function(_0x43b6a3){return{'name':_0x43b6a3['fieldName'],'type':_0x43b6a3[_0x6042('0x2d')][_0x6042('0x2e')]};});_0x280728[_0x6042('0x2f')]=_[_0x6042('0x2b')](_0x428c80,_0x6042('0x29'));_0x280728['query']=_['keys'](_0x406110[_0x6042('0x30')]);_0x280728['filters']=_[_0x6042('0x31')](_0x280728[_0x6042('0x2f')],_0x280728[_0x6042('0x30')]);_0x13788c['attributes']=_[_0x6042('0x31')](_0x280728[_0x6042('0x2f')],qs[_0x6042('0x32')](_0x406110[_0x6042('0x30')][_0x6042('0x32')]));_0x13788c[_0x6042('0x33')]=_0x13788c[_0x6042('0x33')][_0x6042('0x34')]?_0x13788c['attributes']:_0x280728['model'];if(!_0x406110['query'][_0x6042('0x35')](_0x6042('0x36'))){_0x13788c[_0x6042('0x1c')]=qs[_0x6042('0x1c')](_0x406110[_0x6042('0x30')]['limit']);_0x13788c[_0x6042('0x1e')]=qs[_0x6042('0x1e')](_0x406110['query']['offset']);}_0x13788c['order']=qs[_0x6042('0x37')](_0x406110['query'][_0x6042('0x37')]);_0x13788c[_0x6042('0x38')]=qs[_0x6042('0x39')](_['pick'](_0x406110[_0x6042('0x30')],_0x280728[_0x6042('0x39')]),_0x428c80);if(_0x406110['query']['filter']){_0x13788c['where']=_[_0x6042('0x3a')](_0x13788c[_0x6042('0x38')],{'$or':_['map'](_0x428c80,function(_0x2c38e6){if(_0x2c38e6[_0x6042('0x2d')]!==_0x6042('0x3b')){var _0x416fa3={};_0x416fa3[_0x2c38e6[_0x6042('0x29')]]={'$like':'%'+_0x406110[_0x6042('0x30')]['filter']+'%'};return _0x416fa3;}})});}_0x13788c=_[_0x6042('0x3a')]({},_0x13788c,_0x406110['options']);var _0x130779={'where':_0x13788c[_0x6042('0x38')]};return db[_0x6042('0x3c')][_0x6042('0x1d')](_0x130779)[_0x6042('0x22')](function(_0x39b8fb){_0x298737[_0x6042('0x1d')]=_0x39b8fb;if(_0x406110[_0x6042('0x30')][_0x6042('0x3d')]){_0x13788c[_0x6042('0x3e')]=[{'all':!![]}];}return db[_0x6042('0x3c')][_0x6042('0x3f')](_0x13788c);})[_0x6042('0x22')](function(_0x47094f){_0x298737['rows']=_0x47094f;return _0x298737;})[_0x6042('0x22')](respondWithFilteredResult(_0x573743,_0x13788c))[_0x6042('0x40')](handleError(_0x573743,null));};exports['show']=function(_0x54cf0e,_0x4e8a1a){var _0x32767b={'raw':![],'where':{'id':_0x54cf0e['params']['id']}},_0x4e3d21={};_0x4e3d21[_0x6042('0x2f')]=_[_0x6042('0x41')](db['AnalyticCustomReport'][_0x6042('0x2c')]);_0x4e3d21[_0x6042('0x30')]=_['keys'](_0x54cf0e[_0x6042('0x30')]);_0x4e3d21[_0x6042('0x39')]=_['intersection'](_0x4e3d21[_0x6042('0x2f')],_0x4e3d21[_0x6042('0x30')]);_0x32767b[_0x6042('0x33')]=_[_0x6042('0x31')](_0x4e3d21[_0x6042('0x2f')],qs[_0x6042('0x32')](_0x54cf0e['query'][_0x6042('0x32')]));_0x32767b[_0x6042('0x33')]=_0x32767b[_0x6042('0x33')]['length']?_0x32767b[_0x6042('0x33')]:_0x4e3d21[_0x6042('0x2f')];if(_0x54cf0e[_0x6042('0x30')][_0x6042('0x3d')]){_0x32767b[_0x6042('0x3e')]=[{'all':!![]}];}_0x32767b=_['merge']({},_0x32767b,_0x54cf0e['options']);return db[_0x6042('0x3c')]['find'](_0x32767b)[_0x6042('0x22')](handleEntityNotFound(_0x4e8a1a,null))[_0x6042('0x22')](respondWithResult(_0x4e8a1a,null))[_0x6042('0x40')](handleError(_0x4e8a1a,null));};exports['create']=function(_0x2d426f,_0x2c4cb9){return db[_0x6042('0x3c')][_0x6042('0x42')](_0x2d426f[_0x6042('0x43')],{})['then'](function(_0x239670){var _0x354852=_0x2d426f[_0x6042('0x44')]['get']({'plain':!![]});if(!_0x354852)throw new Error(_0x6042('0x45'));if(_0x354852['role']==='user'){var _0x48fb22=_0x239670[_0x6042('0x23')]({'plain':!![]});var _0x13e93d=_0x6042('0x46');return db[_0x6042('0x47')][_0x6042('0x48')]({'where':{'name':_0x13e93d,'userProfileId':_0x354852[_0x6042('0x49')]},'raw':!![]})[_0x6042('0x22')](function(_0x1d795e){if(_0x1d795e&&_0x1d795e[_0x6042('0x4a')]===0x0){return db[_0x6042('0x25')]['create']({'name':_0x48fb22[_0x6042('0x29')],'resourceId':_0x48fb22['id'],'type':_0x6042('0x24'),'sectionId':_0x1d795e['id']},{})[_0x6042('0x22')](function(){return _0x239670;});}else{return _0x239670;}})['catch'](function(_0xf962d8){logger[_0x6042('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf962d8);throw _0xf962d8;});}return _0x239670;})[_0x6042('0x22')](respondWithResult(_0x2c4cb9,0xc9))['catch'](handleError(_0x2c4cb9,null));};exports[_0x6042('0x20')]=function(_0x3914d0,_0x53904e){if(_0x3914d0[_0x6042('0x43')]['id']){delete _0x3914d0['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x3914d0[_0x6042('0x4b')]['id']}})[_0x6042('0x22')](handleEntityNotFound(_0x53904e,null))[_0x6042('0x22')](saveUpdates(_0x3914d0[_0x6042('0x43')],null))['then'](respondWithResult(_0x53904e,null))[_0x6042('0x40')](handleError(_0x53904e,null));};exports[_0x6042('0x21')]=function(_0x4f2f30,_0x3ecfd7){return db['AnalyticCustomReport'][_0x6042('0x48')]({'where':{'id':_0x4f2f30[_0x6042('0x4b')]['id']}})[_0x6042('0x22')](handleEntityNotFound(_0x3ecfd7,null))[_0x6042('0x22')](removeEntity(_0x3ecfd7,null))[_0x6042('0x40')](handleError(_0x3ecfd7,null));};exports['preview']=function(_0x5c0c85,_0xffd933){var _0x502134=0xa;var _0xe0b59c=[_0x6042('0x4c'),_0x6042('0x4d'),_0x6042('0x4e'),_0x6042('0x4f')];var _0x4d6920={'SUM':_0x6042('0x50'),'COUNT':_0x6042('0x51'),'COUNT DISTINCT':_0x6042('0x52'),'MAX':_0x6042('0x53'),'MIN':_0x6042('0x54'),'AVG':_0x6042('0x55'),'GROUP_CONCAT':_0x6042('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e43c2={'SEC_TO_TIME':_0x6042('0x57'),'DATE':_0x6042('0x58'),'HOUR':_0x6042('0x59'),'ROUND':_0x6042('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x285b74=function(_0x1462ad){return!_[_0x6042('0x5b')]([_0x6042('0x5c'),_0x6042('0x5d'),_0x6042('0x5e'),_0x6042('0x5f')],_0x1462ad);};var _0x5b8c64=function(_0x5749b3){if(!_0x5749b3||!_0x5749b3[_0x6042('0x60')][_0x6042('0x34')]){return'';}for(var _0x39432f='(',_0x401ba5=0x0;_0x401ba5<_0x5749b3['rules'][_0x6042('0x34')];_0x401ba5+=0x1){_0x401ba5>0x0&&(_0x39432f+='\x20'+_0x5749b3[_0x6042('0x61')]+'\x20');_0x39432f+=_0x5749b3[_0x6042('0x60')][_0x401ba5]['group']?_0x5b8c64(_0x5749b3['rules'][_0x401ba5][_0x6042('0x62')]):_0x5749b3['rules'][_0x401ba5]['field']+'\x20'+_0x5749b3['rules'][_0x401ba5][_0x6042('0x63')]+(_0x285b74(_0x5749b3[_0x6042('0x60')][_0x401ba5]['condition'])?'\x20'+_0x5749b3[_0x6042('0x60')][_0x401ba5][_0x6042('0x64')]:'');}return _0x39432f+')';};var _0x425602={'where':{'id':_0x5c0c85[_0x6042('0x4b')]['id']}},_0x5484b4,_0x55618f,_0x19e434,_0x35b31b,_0x468c09;_0x425602=_[_0x6042('0x3a')]({},_0x425602,_0x5c0c85[_0x6042('0x65')]);return db[_0x6042('0x3c')][_0x6042('0x48')](_0x425602)[_0x6042('0x22')](function(_0x36dfd4){if(_0x36dfd4){_0x5484b4=_0x36dfd4;return _0x36dfd4[_0x6042('0x66')]();}return null;})[_0x6042('0x22')](function(_0xd282da){if(_0xd282da){if(!_0xd282da[_0x6042('0x34')]){throw new db['Sequelize'][(_0x6042('0x67'))](_0x6042('0x68'),0x193);}_0x55618f=_0xd282da;return db['AnalyticMetric'][_0x6042('0x3f')]({'raw':!![]});}return null;})[_0x6042('0x22')](function(_0x365f65){if(_0x365f65){_0x19e434=_[_0x6042('0x69')](_0x365f65,'id');var _0x9e9b10;var _0x5ce58e=squel[_0x6042('0x6a')]();_0x5ce58e[_0x6042('0x6b')](_0x5484b4['table']);for(var _0x2823f6=0x0;_0x2823f6<_0x55618f['length'];_0x2823f6+=0x1){_0x9e9b10=_0x55618f[_0x2823f6][_0x6042('0x6c')]?_0x19e434[_0x55618f[_0x2823f6]['MetricId']][_0x6042('0x6d')]:_0x55618f[_0x2823f6][_0x6042('0x6e')];_0x9e9b10=_0x55618f[_0x2823f6][_0x6042('0x6f')]?_[_0x6042('0x70')](_0x4d6920[_0x55618f[_0x2823f6]['function']],'%s',_0x9e9b10):_0x9e9b10;_0x9e9b10=_0x55618f[_0x2823f6][_0x6042('0x71')]?_[_0x6042('0x70')](_0x5e43c2[_0x55618f[_0x2823f6][_0x6042('0x71')]],'%s',_0x9e9b10):_0x9e9b10;if(_0x55618f[_0x2823f6][_0x6042('0x72')]){_0x5ce58e[_0x6042('0x62')](_0x9e9b10);}_0x55618f[_0x2823f6][_0x6042('0x73')]&&_0x5ce58e['order'](_0x9e9b10,_0x55618f[_0x2823f6]['orderBy']===_0x6042('0x74')?![]:!![]);_0x5ce58e[_0x6042('0x6e')](_0x9e9b10,_0x55618f[_0x2823f6]['alias']||_0x9e9b10);}if(_0x5484b4[_0x6042('0x75')]){_0x5484b4[_0x6042('0x75')]=JSON[_0x6042('0x76')](_0x5484b4[_0x6042('0x75')]);for(var _0xf2060f=0x0;_0xf2060f<_0x5484b4[_0x6042('0x75')][_0x6042('0x34')];_0xf2060f+=0x1){if(_0x5484b4[_0x6042('0x75')][_0xf2060f]['type']&&_[_0x6042('0x5b')](_0xe0b59c,_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x2d')])&&_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x77')]&&_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x78')]&&_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x79')]){_0x5ce58e[_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x2d')]](_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x78')],null,util[_0x6042('0x71')](_0x6042('0x7a'),_0x5484b4[_0x6042('0x7b')],_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x77')],_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x78')],_0x5484b4[_0x6042('0x75')][_0xf2060f][_0x6042('0x79')]));}}}if(_0x5484b4[_0x6042('0x7c')]){_0x5484b4[_0x6042('0x7c')]=JSON[_0x6042('0x76')](_0x5484b4[_0x6042('0x7c')]);_0x5ce58e[_0x6042('0x38')](_0x5b8c64(_0x5484b4[_0x6042('0x7c')][_0x6042('0x62')]));}_0x468c09=_0x5ce58e[_0x6042('0x7d')]();_0x5ce58e[_0x6042('0x1c')](_0x502134);_0x5ce58e[_0x6042('0x1e')](0x0);logger[_0x6042('0x7e')](_0x6042('0x7f'),_0x5ce58e[_0x6042('0x80')]());return dbH[_0x6042('0x81')]['query'](_0x5ce58e[_0x6042('0x80')](),{'type':dbH[_0x6042('0x81')][_0x6042('0x82')][_0x6042('0x83')]});}})['then'](respondWithResult(_0xffd933,null))[_0x6042('0x40')](handleError(_0xffd933,null));};function runReport(_0xb8da06,_0x81d3b,_0xb0bb20){var _0x13149d=_0x81d3b[_0x6042('0x29')];var _0x154935=0xa;var _0x5601ff=[_0x6042('0x4c'),'left_join',_0x6042('0x4e'),_0x6042('0x4f')];var _0x3df097={'SUM':_0x6042('0x50'),'COUNT':_0x6042('0x51'),'COUNT DISTINCT':_0x6042('0x52'),'MAX':_0x6042('0x53'),'MIN':_0x6042('0x54'),'AVG':_0x6042('0x55'),'GROUP_CONCAT':_0x6042('0x56'),'GROUP_CONCAT ASC':_0x6042('0x84'),'GROUP_CONCAT DESC':_0x6042('0x85')};var _0x57cbd3={'SEC_TO_TIME':_0x6042('0x57'),'DATE':_0x6042('0x58'),'HOUR':_0x6042('0x59'),'ROUND':_0x6042('0x5a'),'UNIX_TIMESTAMP':_0x6042('0x86')};var _0x5a4255=function(_0x2cdece){return!_['includes']([_0x6042('0x5c'),_0x6042('0x5d'),_0x6042('0x5e'),_0x6042('0x5f')],_0x2cdece);};var _0x5e2fd2=function(_0x5ac2ff){if(!_0x5ac2ff||!_0x5ac2ff['rules'][_0x6042('0x34')]){return'';}for(var _0x17defa='(',_0x2ebee1=0x0;_0x2ebee1<_0x5ac2ff[_0x6042('0x60')][_0x6042('0x34')];_0x2ebee1+=0x1){_0x2ebee1>0x0&&(_0x17defa+='\x20'+_0x5ac2ff['operator']+'\x20');_0x17defa+=_0x5ac2ff[_0x6042('0x60')][_0x2ebee1][_0x6042('0x62')]?_0x5e2fd2(_0x5ac2ff['rules'][_0x2ebee1][_0x6042('0x62')]):_0x5ac2ff['rules'][_0x2ebee1]['field']+'\x20'+_0x5ac2ff[_0x6042('0x60')][_0x2ebee1][_0x6042('0x63')]+(_0x5a4255(_0x5ac2ff['rules'][_0x2ebee1]['condition'])?'\x20'+_0x5ac2ff[_0x6042('0x60')][_0x2ebee1][_0x6042('0x64')]:'');}return _0x17defa+')';};var _0x5960a2={'where':{'id':_0xb8da06['id']}},_0x5ba1c4,_0x170c66,_0x1136f8,_0x1d2767,_0x15f8c9;_0x5960a2=_[_0x6042('0x3a')]({},_0x5960a2,_0xb0bb20);return db[_0x6042('0x3c')]['find'](_0x5960a2)[_0x6042('0x22')](function(_0x1afe88){if(_0x1afe88){_0x5ba1c4=_0x1afe88;return _0x1afe88[_0x6042('0x66')]();}return null;})[_0x6042('0x22')](function(_0x5dcda3){if(_0x5dcda3){if(!_0x5dcda3[_0x6042('0x34')]){throw new db[(_0x6042('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x170c66=_0x5dcda3;return db[_0x6042('0x88')]['findAll']({'raw':!![]});}return null;})[_0x6042('0x22')](function(_0x2bbc9a){if(_0x2bbc9a){_0x1136f8=_[_0x6042('0x69')](_0x2bbc9a,'id');var _0x19af66;var _0x429a84=squel[_0x6042('0x6a')]();_0x429a84[_0x6042('0x6b')](_0x5ba1c4[_0x6042('0x7b')]);for(var _0x332bc8=0x0;_0x332bc8<_0x170c66['length'];_0x332bc8+=0x1){_0x19af66=_0x170c66[_0x332bc8][_0x6042('0x6c')]?_0x1136f8[_0x170c66[_0x332bc8][_0x6042('0x6c')]][_0x6042('0x6d')]:_0x170c66[_0x332bc8][_0x6042('0x6e')];_0x19af66=_0x170c66[_0x332bc8][_0x6042('0x6f')]?_[_0x6042('0x70')](_0x3df097[_0x170c66[_0x332bc8][_0x6042('0x6f')]],'%s',_0x19af66):_0x19af66;_0x19af66=_0x170c66[_0x332bc8]['format']?_['replace'](_0x57cbd3[_0x170c66[_0x332bc8][_0x6042('0x71')]],'%s',_0x19af66):_0x19af66;if(_0x170c66[_0x332bc8][_0x6042('0x72')]){_0x429a84[_0x6042('0x62')](_0x19af66);}_0x170c66[_0x332bc8][_0x6042('0x73')]&&_0x429a84[_0x6042('0x89')](_0x19af66,_0x170c66[_0x332bc8][_0x6042('0x73')]===_0x6042('0x74')?![]:!![]);_0x429a84['field'](_0x19af66,_0x170c66[_0x332bc8][_0x6042('0x8a')]||_0x19af66);}if(_0x5ba1c4[_0x6042('0x75')]){_0x5ba1c4[_0x6042('0x75')]=JSON[_0x6042('0x76')](_0x5ba1c4[_0x6042('0x75')]);for(var _0x5483e2=0x0;_0x5483e2<_0x5ba1c4[_0x6042('0x75')][_0x6042('0x34')];_0x5483e2+=0x1){if(_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x2d')]&&_[_0x6042('0x5b')](_0x5601ff,_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x2d')])&&_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x77')]&&_0x5ba1c4['joins'][_0x5483e2][_0x6042('0x78')]&&_0x5ba1c4[_0x6042('0x75')][_0x5483e2]['foreignKey']){_0x429a84[_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x2d')]](_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x78')],null,util[_0x6042('0x71')]('%s.%s\x20=\x20%s.%s',_0x5ba1c4[_0x6042('0x7b')],_0x5ba1c4[_0x6042('0x75')][_0x5483e2]['parentKey'],_0x5ba1c4['joins'][_0x5483e2][_0x6042('0x78')],_0x5ba1c4[_0x6042('0x75')][_0x5483e2][_0x6042('0x79')]));}}}if(_0x5ba1c4[_0x6042('0x7c')]){_0x5ba1c4[_0x6042('0x7c')]=JSON['parse'](_0x5ba1c4[_0x6042('0x7c')]);_0x429a84[_0x6042('0x38')](_0x5e2fd2(_0x5ba1c4[_0x6042('0x7c')]['group']));}_0x15f8c9=_0x429a84[_0x6042('0x7d')]();_0x429a84[_0x6042('0x1c')](_0x154935);_0x429a84[_0x6042('0x1e')](0x0);return;}})[_0x6042('0x22')](function(){if(_0x81d3b[_0x6042('0x8b')]===_0x6042('0x8c')){return null;}var _0x55d254=_['merge'](_0x81d3b,{'name':_0x81d3b[_0x6042('0x8d')]||_0x81d3b['name']||_0x5ba1c4['name'],'basename':_0x13149d,'savename':util['format'](_0x6042('0x8e'),_0x81d3b['name']||_0x5ba1c4[_0x6042('0x29')],require('randomstring')['generate'](0x4),_0x81d3b[_0x6042('0x8b')]||'csv'),'reportId':_0x5ba1c4['id'],'reportType':_0x6042('0x8f')});return db[_0x6042('0x90')]['create'](_0x55d254,{'raw':!![]});})[_0x6042('0x22')](function(_0x24fa34){if(_0x5ba1c4[_0x6042('0x7b')]===_0x6042('0x91')){_0x15f8c9[_0x6042('0x38')](_0x5ba1c4[_0x6042('0x7b')]+_0x6042('0x92'),_0x81d3b['startDate'],_0x81d3b[_0x6042('0x93')]);}else{_0x15f8c9[_0x6042('0x38')](_0x5ba1c4[_0x6042('0x7b')]+_0x6042('0x94'),_0x81d3b[_0x6042('0x95')],_0x81d3b[_0x6042('0x93')]);}if(_0x24fa34){logger['info'](_0x6042('0x96'),_0x15f8c9['toString']());require(_0x6042('0x97'))['fork'](path[_0x6042('0x4c')](__dirname,_0x6042('0x98'),_0x24fa34[_0x6042('0x8b')]),[_0x24fa34['id'],_0x15f8c9[_0x6042('0x80')](),path[_0x6042('0x4c')](__dirname,_0x6042('0x99'),_0x24fa34[_0x6042('0x9a')]),_0x13149d]);return _0x24fa34;}else{var _0x1a0e29=squel[_0x6042('0x6a')]();_0x1a0e29[_0x6042('0x6b')]('('+_0x15f8c9[_0x6042('0x80')]()+')',_0x6042('0x9b'));_0x1a0e29['field'](_0x6042('0x9c'),'count');_0x15f8c9[_0x6042('0x1c')](_0x81d3b[_0x6042('0x1c')]||_0x154935);_0x15f8c9[_0x6042('0x1e')](_0x81d3b[_0x6042('0x1e')]||0x0);return dbH['sequelize'][_0x6042('0x30')](_0x1a0e29[_0x6042('0x80')](),{'type':dbH[_0x6042('0x81')][_0x6042('0x82')][_0x6042('0x83')]})[_0x6042('0x22')](function(_0x17985f){if(!_0x17985f[_0x6042('0x34')]){_0x1d2767=0x0;}else{_0x1d2767=_0x17985f[0x0][_0x6042('0x1d')]||0x0;}return dbH[_0x6042('0x81')][_0x6042('0x30')](_0x15f8c9[_0x6042('0x80')](),{'type':dbH[_0x6042('0x81')]['QueryTypes'][_0x6042('0x83')]});})[_0x6042('0x22')](function(_0x58a470){return{'rows':_0x58a470||[],'count':_0x1d2767};});}});}exports['run']=function(_0xacd731,_0x5bdd4e){return runReport(_0xacd731[_0x6042('0x4b')],_0xacd731[_0x6042('0x30')],_0xacd731[_0x6042('0x65')])[_0x6042('0x22')](respondWithResult(_0x5bdd4e,null))[_0x6042('0x40')](handleError(_0x5bdd4e,null));};exports[_0x6042('0x9d')]=runReport;exports[_0x6042('0x30')]=function(_0x3e4aca,_0x617515){var _0x541832=0xa;var _0x517714=[_0x6042('0x4c'),'left_join',_0x6042('0x4e'),_0x6042('0x4f')];var _0x5b4e90={'SUM':_0x6042('0x50'),'COUNT':_0x6042('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6042('0x53'),'MIN':'MIN(%s)','AVG':_0x6042('0x55'),'GROUP_CONCAT':_0x6042('0x56'),'GROUP_CONCAT ASC':_0x6042('0x84'),'GROUP_CONCAT DESC':_0x6042('0x85')};var _0x2f5f78={'SEC_TO_TIME':_0x6042('0x57'),'DATE':_0x6042('0x58'),'HOUR':_0x6042('0x59'),'ROUND':_0x6042('0x5a'),'UNIX_TIMESTAMP':_0x6042('0x86')};var _0x5c8ddf=function(_0x48c999){return!_[_0x6042('0x5b')]([_0x6042('0x5c'),_0x6042('0x5d'),_0x6042('0x5e'),_0x6042('0x5f')],_0x48c999);};var _0x4a855e=function(_0x25a944){if(!_0x25a944||!_0x25a944['rules'][_0x6042('0x34')]){return'';}for(var _0x5350fe='(',_0x967291=0x0;_0x967291<_0x25a944[_0x6042('0x60')]['length'];_0x967291+=0x1){_0x967291>0x0&&(_0x5350fe+='\x20'+_0x25a944[_0x6042('0x61')]+'\x20');_0x5350fe+=_0x25a944['rules'][_0x967291][_0x6042('0x62')]?_0x4a855e(_0x25a944[_0x6042('0x60')][_0x967291][_0x6042('0x62')]):_0x25a944[_0x6042('0x60')][_0x967291]['field']+'\x20'+_0x25a944[_0x6042('0x60')][_0x967291]['condition']+(_0x5c8ddf(_0x25a944[_0x6042('0x60')][_0x967291][_0x6042('0x63')])?'\x20'+_0x25a944[_0x6042('0x60')][_0x967291][_0x6042('0x64')]:'');}return _0x5350fe+')';};var _0x13cc9={'where':{'id':_0x3e4aca['params']['id']}},_0x306381,_0x506900,_0x3ac454,_0x3f7ce0,_0x8e764;_0x13cc9=_[_0x6042('0x3a')]({},_0x13cc9,_0x3e4aca[_0x6042('0x65')]);return db[_0x6042('0x3c')][_0x6042('0x48')](_0x13cc9)[_0x6042('0x22')](function(_0x311f8e){if(_0x311f8e){_0x306381=_0x311f8e;return _0x311f8e[_0x6042('0x66')]();}return null;})['then'](function(_0x527f13){if(_0x527f13){if(!_0x527f13[_0x6042('0x34')]){throw new db[(_0x6042('0x87'))]['ValidationErrorItem'](_0x6042('0x68'),0x193);}_0x506900=_0x527f13;return db[_0x6042('0x88')][_0x6042('0x3f')]({'raw':!![]});}return null;})[_0x6042('0x22')](function(_0x5bfbb6){if(_0x5bfbb6){_0x3ac454=_[_0x6042('0x69')](_0x5bfbb6,'id');var _0x90b386;var _0x36b20b=squel['select']();_0x36b20b[_0x6042('0x6b')](_0x306381[_0x6042('0x7b')]);for(var _0xdb9202=0x0;_0xdb9202<_0x506900['length'];_0xdb9202+=0x1){_0x90b386=_0x506900[_0xdb9202][_0x6042('0x6c')]?_0x3ac454[_0x506900[_0xdb9202][_0x6042('0x6c')]][_0x6042('0x6d')]:_0x506900[_0xdb9202][_0x6042('0x6e')];_0x90b386=_0x506900[_0xdb9202]['function']?_[_0x6042('0x70')](_0x5b4e90[_0x506900[_0xdb9202]['function']],'%s',_0x90b386):_0x90b386;_0x90b386=_0x506900[_0xdb9202][_0x6042('0x71')]?_[_0x6042('0x70')](_0x2f5f78[_0x506900[_0xdb9202]['format']],'%s',_0x90b386):_0x90b386;if(_0x506900[_0xdb9202][_0x6042('0x72')]){_0x36b20b[_0x6042('0x62')](_0x90b386);}_0x506900[_0xdb9202][_0x6042('0x73')]&&_0x36b20b[_0x6042('0x89')](_0x90b386,_0x506900[_0xdb9202][_0x6042('0x73')]===_0x6042('0x74')?![]:!![]);_0x36b20b[_0x6042('0x6e')](_0x90b386,_0x506900[_0xdb9202][_0x6042('0x8a')]||_0x90b386);}if(_0x306381[_0x6042('0x75')]){_0x306381[_0x6042('0x75')]=JSON['parse'](_0x306381[_0x6042('0x75')]);for(var _0x9ed19c=0x0;_0x9ed19c<_0x306381[_0x6042('0x75')][_0x6042('0x34')];_0x9ed19c+=0x1){if(_0x306381['joins'][_0x9ed19c][_0x6042('0x2d')]&&_[_0x6042('0x5b')](_0x517714,_0x306381[_0x6042('0x75')][_0x9ed19c]['type'])&&_0x306381[_0x6042('0x75')][_0x9ed19c][_0x6042('0x77')]&&_0x306381[_0x6042('0x75')][_0x9ed19c][_0x6042('0x78')]&&_0x306381[_0x6042('0x75')][_0x9ed19c][_0x6042('0x79')]){_0x36b20b[_0x306381['joins'][_0x9ed19c]['type']](_0x306381['joins'][_0x9ed19c][_0x6042('0x78')],null,util[_0x6042('0x71')]('%s.%s\x20=\x20%s.%s',_0x306381[_0x6042('0x7b')],_0x306381['joins'][_0x9ed19c][_0x6042('0x77')],_0x306381['joins'][_0x9ed19c][_0x6042('0x78')],_0x306381['joins'][_0x9ed19c]['foreignKey']));}}}if(_0x306381[_0x6042('0x7c')]){_0x306381[_0x6042('0x7c')]=JSON['parse'](_0x306381[_0x6042('0x7c')]);_0x36b20b[_0x6042('0x38')](_0x4a855e(_0x306381[_0x6042('0x7c')][_0x6042('0x62')]));}_0x8e764=_0x36b20b['clone']();_0x36b20b[_0x6042('0x1c')](_0x541832);_0x36b20b['offset'](0x0);logger[_0x6042('0x7e')](_0x6042('0x7f'),_0x36b20b[_0x6042('0x80')]());return dbH[_0x6042('0x81')]['query'](_0x36b20b[_0x6042('0x80')](),{'type':dbH['sequelize'][_0x6042('0x82')]['SELECT']});}})[_0x6042('0x22')](function(){return{'sql':_0x8e764['toString']()};})[_0x6042('0x22')](respondWithResult(_0x617515,null))[_0x6042('0x40')](handleError(_0x617515,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 46726ff..1ac581c 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 _0xcc15=['exports','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x363ced,_0x33988f){var _0x147fa2=function(_0x3c7e28){while(--_0x3c7e28){_0x363ced['push'](_0x363ced['shift']());}};_0x147fa2(++_0x33988f);}(_0xcc15,0x9e));var _0x5cc1=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcc15[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5cc1('0x0'));var util=require(_0x5cc1('0x1'));var logger=require(_0x5cc1('0x2'))(_0x5cc1('0x3'));var moment=require(_0x5cc1('0x4'));var BPromise=require(_0x5cc1('0x5'));var rp=require(_0x5cc1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cc1('0x7'));var config=require(_0x5cc1('0x8'));var attributes=require(_0x5cc1('0x9'));module[_0x5cc1('0xa')]=function(_0x15d43e,_0x32840b){return _0x15d43e['define'](_0x5cc1('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72ff=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','request-promise','rimraf','./analyticCustomReport.attributes'];(function(_0x328ba9,_0x30a9ee){var _0x7f08c3=function(_0xd85a51){while(--_0xd85a51){_0x328ba9['push'](_0x328ba9['shift']());}};_0x7f08c3(++_0x30a9ee);}(_0x72ff,0x1c7));var _0xf72f=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x72ff[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xf72f('0x0'));var util=require(_0xf72f('0x1'));var logger=require(_0xf72f('0x2'))(_0xf72f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf72f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf72f('0x5'));var config=require('../../config/environment');var attributes=require(_0xf72f('0x6'));module[_0xf72f('0x7')]=function(_0xe25106,_0x26ab51){return _0xe25106[_0xf72f('0x8')](_0xf72f('0x9'),attributes,{'tableName':_0xf72f('0xa'),'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 4c55165..a3a4769 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 _0x9f22=['result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x259cb6,_0x546595){var _0x3b67bd=function(_0x24f8cb){while(--_0x24f8cb){_0x259cb6['push'](_0x259cb6['shift']());}};_0x3b67bd(++_0x546595);}(_0x9f22,0xf4));var _0x29f2=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9f22[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x29f2('0x0'));var util=require(_0x29f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f2('0x2'));var fs=require('fs');var Redis=require(_0x29f2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x29f2('0x4'));var logger=require('../../config/logger')(_0x29f2('0x5'));var config=require(_0x29f2('0x6'));var jayson=require(_0x29f2('0x7'));var client=jayson[_0x29f2('0x8')][_0x29f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ddd27,_0xdf12f3,_0xa0e766){return new BPromise(function(_0x15fed0,_0x39ff66){return client[_0x29f2('0xa')](_0x1ddd27,_0xa0e766)[_0x29f2('0xb')](function(_0x477dcd){logger[_0x29f2('0xc')](_0x29f2('0xd'),_0xdf12f3,_0x29f2('0xe'));logger[_0x29f2('0xf')](_0x29f2('0x10'),_0xdf12f3,_0x29f2('0xe'),JSON[_0x29f2('0x11')](_0x477dcd));if(_0x477dcd[_0x29f2('0x12')]){if(_0x477dcd[_0x29f2('0x12')]['code']===0x1f4){logger[_0x29f2('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xdf12f3,_0x477dcd[_0x29f2('0x12')]['message']);return _0x39ff66(_0x477dcd[_0x29f2('0x12')][_0x29f2('0x13')]);}logger[_0x29f2('0x12')](_0x29f2('0xd'),_0xdf12f3,_0x477dcd[_0x29f2('0x12')][_0x29f2('0x13')]);return _0x15fed0(_0x477dcd['error'][_0x29f2('0x13')]);}else{logger[_0x29f2('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0xdf12f3,_0x29f2('0xe'));_0x15fed0(_0x477dcd[_0x29f2('0x14')]['message']);}})[_0x29f2('0x15')](function(_0x52e0c4){logger[_0x29f2('0x12')](_0x29f2('0xd'),_0xdf12f3,_0x52e0c4);_0x39ff66(_0x52e0c4);});});} \ No newline at end of file +var _0x5b2e=['../../config/utils','rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37f87a,_0x4a4484){var _0x22d489=function(_0x6c9677){while(--_0x6c9677){_0x37f87a['push'](_0x37f87a['shift']());}};_0x22d489(++_0x4a4484);}(_0x5b2e,0xc3));var _0xe5b2=function(_0x1460b3,_0x277a98){_0x1460b3=_0x1460b3-0x0;var _0x197470=_0x5b2e[_0x1460b3];return _0x197470;};'use strict';var _=require('lodash');var util=require(_0xe5b2('0x0'));var moment=require('moment');var BPromise=require(_0xe5b2('0x1'));var rs=require(_0xe5b2('0x2'));var fs=require('fs');var Redis=require(_0xe5b2('0x3'));var db=require(_0xe5b2('0x4'))['db'];var utils=require(_0xe5b2('0x5'));var logger=require('../../config/logger')(_0xe5b2('0x6'));var config=require(_0xe5b2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe5b2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x451d82,_0x4b4324,_0x3b0bf4){return new BPromise(function(_0x23874d,_0x59e065){return client[_0xe5b2('0x9')](_0x451d82,_0x3b0bf4)[_0xe5b2('0xa')](function(_0x14c17d){logger[_0xe5b2('0xb')](_0xe5b2('0xc'),_0x4b4324,_0xe5b2('0xd'));logger[_0xe5b2('0xe')](_0xe5b2('0xf'),_0x4b4324,_0xe5b2('0xd'),JSON[_0xe5b2('0x10')](_0x14c17d));if(_0x14c17d[_0xe5b2('0x11')]){if(_0x14c17d[_0xe5b2('0x11')][_0xe5b2('0x12')]===0x1f4){logger[_0xe5b2('0x11')](_0xe5b2('0xc'),_0x4b4324,_0x14c17d[_0xe5b2('0x11')][_0xe5b2('0x13')]);return _0x59e065(_0x14c17d[_0xe5b2('0x11')][_0xe5b2('0x13')]);}logger[_0xe5b2('0x11')](_0xe5b2('0xc'),_0x4b4324,_0x14c17d[_0xe5b2('0x11')]['message']);return _0x23874d(_0x14c17d[_0xe5b2('0x11')][_0xe5b2('0x13')]);}else{logger[_0xe5b2('0xb')](_0xe5b2('0xc'),_0x4b4324,'request\x20sent');_0x23874d(_0x14c17d['result']['message']);}})['catch'](function(_0x2d47d3){logger[_0xe5b2('0x11')](_0xe5b2('0xc'),_0x4b4324,_0x2d47d3);_0x59e065(_0x2d47d3);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e887946..bb288d9 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 _0x48a0=['exports','multer','path','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','delete','destroy'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x48a0,0xdd));var _0x048a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x48a0[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x048a('0x0'));var util=require('util');var path=require(_0x048a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x048a('0x2'));var auth=require(_0x048a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x048a('0x4'));var controller=require(_0x048a('0x5'));router['get']('/',auth[_0x048a('0x6')](),controller['index']);router[_0x048a('0x7')](_0x048a('0x8'),auth[_0x048a('0x6')](),controller[_0x048a('0x9')]);router[_0x048a('0x7')](_0x048a('0xa'),auth[_0x048a('0x6')](),controller[_0x048a('0xb')]);router['get'](_0x048a('0xc'),auth[_0x048a('0x6')](),controller[_0x048a('0xd')]);router[_0x048a('0x7')](_0x048a('0xe'),auth[_0x048a('0x6')](),controller[_0x048a('0xf')]);router['post']('/',auth[_0x048a('0x6')](),controller['create']);router[_0x048a('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x048a('0x11')](_0x048a('0x8'),auth[_0x048a('0x6')](),controller[_0x048a('0x12')]);module[_0x048a('0x13')]=router; \ No newline at end of file +var _0xda05=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','/:id/run','run','/:id/query','post','create','put','delete','destroy','exports','path','connect-timeout','express'];(function(_0x23af0d,_0x29ed6c){var _0x164fb6=function(_0x4ccdfe){while(--_0x4ccdfe){_0x23af0d['push'](_0x23af0d['shift']());}};_0x164fb6(++_0x29ed6c);}(_0xda05,0x1c9));var _0x5da0=function(_0x247402,_0x9556ed){_0x247402=_0x247402-0x0;var _0x21fbc0=_0xda05[_0x247402];return _0x21fbc0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5da0('0x0'));var timeout=require(_0x5da0('0x1'));var express=require(_0x5da0('0x2'));var router=express[_0x5da0('0x3')]();var fs_extra=require(_0x5da0('0x4'));var auth=require(_0x5da0('0x5'));var interaction=require(_0x5da0('0x6'));var config=require(_0x5da0('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x5da0('0x8')]('/',auth['isAuthenticated'](),controller[_0x5da0('0x9')]);router[_0x5da0('0x8')](_0x5da0('0xa'),auth['isAuthenticated'](),controller[_0x5da0('0xb')]);router['get'](_0x5da0('0xc'),auth[_0x5da0('0xd')](),controller['preview']);router[_0x5da0('0x8')](_0x5da0('0xe'),auth['isAuthenticated'](),controller[_0x5da0('0xf')]);router[_0x5da0('0x8')](_0x5da0('0x10'),auth[_0x5da0('0xd')](),controller['query']);router[_0x5da0('0x11')]('/',auth['isAuthenticated'](),controller[_0x5da0('0x12')]);router[_0x5da0('0x13')](_0x5da0('0xa'),auth[_0x5da0('0xd')](),controller['update']);router[_0x5da0('0x14')](_0x5da0('0xa'),auth[_0x5da0('0xd')](),controller[_0x5da0('0x15')]);module[_0x5da0('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e18b88a..07a073d 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x333b9a,_0x14ce97){var _0x18670e=function(_0x21ce86){while(--_0x21ce86){_0x333b9a['push'](_0x333b9a['shift']());}};_0x18670e(++_0x14ce97);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2eb2[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x37299c,_0x4a0008){var _0x25dac8=function(_0x1a4d44){while(--_0x1a4d44){_0x37299c['push'](_0x37299c['shift']());}};_0x25dac8(++_0x4a0008);}(_0xeec6,0x1c2));var _0x6eec=function(_0x3ca7a9,_0x4fc0c7){_0x3ca7a9=_0x3ca7a9-0x0;var _0x399428=_0xeec6[_0x3ca7a9];return _0x399428;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 55c3960..6b65e4d 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 _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x389c56,_0x1c524d){var _0x3f0dba=function(_0x45effe){while(--_0x45effe){_0x389c56['push'](_0x389c56['shift']());}};_0x3f0dba(++_0x1c524d);}(_0x4975,0x86));var _0x5497=function(_0x106221,_0x556583){_0x106221=_0x106221-0x0;var _0x24f6f7=_0x4975[_0x106221];return _0x24f6f7;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));}; \ No newline at end of file +var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x2b7dae,_0x1a00ef){var _0xe68f93=function(_0x3529fd){while(--_0x3529fd){_0x2b7dae['push'](_0x2b7dae['shift']());}};_0xe68f93(++_0x1a00ef);}(_0x1cb9,0x14e));var _0x91cb=function(_0xaec1e8,_0xdb31ae){_0xaec1e8=_0xaec1e8-0x0;var _0xcad183=_0x1cb9[_0xaec1e8];return _0xcad183;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 7da1d0c..dd133fd 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 _0x054e=['request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x386fba,_0x282850){var _0x311b84=function(_0x345c21){while(--_0x345c21){_0x386fba['push'](_0x386fba['shift']());}};_0x311b84(++_0x282850);}(_0x054e,0x1f2));var _0xe054=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0x054e[_0x134827];return _0x366671;};'use strict';var _=require(_0xe054('0x0'));var util=require(_0xe054('0x1'));var logger=require(_0xe054('0x2'))(_0xe054('0x3'));var moment=require(_0xe054('0x4'));var BPromise=require(_0xe054('0x5'));var rp=require(_0xe054('0x6'));var fs=require('fs');var path=require(_0xe054('0x7'));var rimraf=require('rimraf');var config=require(_0xe054('0x8'));var attributes=require(_0xe054('0x9'));module[_0xe054('0xa')]=function(_0x543cda,_0x33032a){return _0x543cda[_0xe054('0xb')](_0xe054('0xc'),attributes,{'tableName':_0xe054('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4594=['api','moment','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util','../../config/logger'];(function(_0x4637d2,_0x1cb4a9){var _0x5b2683=function(_0x1a59ca){while(--_0x1a59ca){_0x4637d2['push'](_0x4637d2['shift']());}};_0x5b2683(++_0x1cb4a9);}(_0x4594,0x132));var _0x4459=function(_0x49cab6,_0xff7be1){_0x49cab6=_0x49cab6-0x0;var _0x2b2b02=_0x4594[_0x49cab6];return _0x2b2b02;};'use strict';var _=require('lodash');var util=require(_0x4459('0x0'));var logger=require(_0x4459('0x1'))(_0x4459('0x2'));var moment=require(_0x4459('0x3'));var BPromise=require('bluebird');var rp=require(_0x4459('0x4'));var fs=require('fs');var path=require(_0x4459('0x5'));var rimraf=require(_0x4459('0x6'));var config=require('../../config/environment');var attributes=require(_0x4459('0x7'));module[_0x4459('0x8')]=function(_0x34e2a4,_0x2c10f7){return _0x34e2a4[_0x4459('0x9')](_0x4459('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 4a087ca..4673511 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 _0xa713=['jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a1f09,_0x1482f6){var _0xe26c79=function(_0x35c7b4){while(--_0x35c7b4){_0x3a1f09['push'](_0x3a1f09['shift']());}};_0xe26c79(++_0x1482f6);}(_0xa713,0xe7));var _0x3a71=function(_0xcbed8a,_0x1ea709){_0xcbed8a=_0xcbed8a-0x0;var _0x174d7a=_0xa713[_0xcbed8a];return _0x174d7a;};'use strict';var _=require(_0x3a71('0x0'));var util=require('util');var moment=require(_0x3a71('0x1'));var BPromise=require(_0x3a71('0x2'));var rs=require(_0x3a71('0x3'));var fs=require('fs');var Redis=require(_0x3a71('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a71('0x5'));var logger=require(_0x3a71('0x6'))(_0x3a71('0x7'));var config=require(_0x3a71('0x8'));var jayson=require(_0x3a71('0x9'));var client=jayson[_0x3a71('0xa')][_0x3a71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5427f8,_0x29ffb6,_0x107819){return new BPromise(function(_0x500efe,_0x3b13d8){return client[_0x3a71('0xc')](_0x5427f8,_0x107819)[_0x3a71('0xd')](function(_0x5b081e){logger[_0x3a71('0xe')](_0x3a71('0xf'),_0x29ffb6,'request\x20sent');logger['debug'](_0x3a71('0x10'),_0x29ffb6,_0x3a71('0x11'),JSON[_0x3a71('0x12')](_0x5b081e));if(_0x5b081e[_0x3a71('0x13')]){if(_0x5b081e['error'][_0x3a71('0x14')]===0x1f4){logger[_0x3a71('0x13')](_0x3a71('0xf'),_0x29ffb6,_0x5b081e[_0x3a71('0x13')][_0x3a71('0x15')]);return _0x3b13d8(_0x5b081e['error'][_0x3a71('0x15')]);}logger[_0x3a71('0x13')](_0x3a71('0xf'),_0x29ffb6,_0x5b081e['error'][_0x3a71('0x15')]);return _0x500efe(_0x5b081e[_0x3a71('0x13')][_0x3a71('0x15')]);}else{logger[_0x3a71('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x29ffb6,_0x3a71('0x11'));_0x500efe(_0x5b081e[_0x3a71('0x16')][_0x3a71('0x15')]);}})[_0x3a71('0x17')](function(_0x493d3e){logger[_0x3a71('0x13')](_0x3a71('0xf'),_0x29ffb6,_0x493d3e);_0x3b13d8(_0x493d3e);});});} \ No newline at end of file +var _0x7345=['error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x302481,_0x5ca7c5){var _0x2cd89f=function(_0x55724b){while(--_0x55724b){_0x302481['push'](_0x302481['shift']());}};_0x2cd89f(++_0x5ca7c5);}(_0x7345,0x1e9));var _0x5734=function(_0x12bcbd,_0x46a583){_0x12bcbd=_0x12bcbd-0x0;var _0x4b7bc1=_0x7345[_0x12bcbd];return _0x4b7bc1;};'use strict';var _=require(_0x5734('0x0'));var util=require(_0x5734('0x1'));var moment=require(_0x5734('0x2'));var BPromise=require('bluebird');var rs=require(_0x5734('0x3'));var fs=require('fs');var Redis=require(_0x5734('0x4'));var db=require(_0x5734('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5734('0x6'))(_0x5734('0x7'));var config=require(_0x5734('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33ee6a,_0x84b6ba,_0x5a246b){return new BPromise(function(_0x349f7d,_0x386bef){return client[_0x5734('0xa')](_0x33ee6a,_0x5a246b)[_0x5734('0xb')](function(_0x4544c0){logger['info'](_0x5734('0xc'),_0x84b6ba,_0x5734('0xd'));logger[_0x5734('0xe')](_0x5734('0xf'),_0x84b6ba,_0x5734('0xd'),JSON[_0x5734('0x10')](_0x4544c0));if(_0x4544c0[_0x5734('0x11')]){if(_0x4544c0['error']['code']===0x1f4){logger['error'](_0x5734('0xc'),_0x84b6ba,_0x4544c0['error'][_0x5734('0x12')]);return _0x386bef(_0x4544c0[_0x5734('0x11')][_0x5734('0x12')]);}logger[_0x5734('0x11')](_0x5734('0xc'),_0x84b6ba,_0x4544c0['error'][_0x5734('0x12')]);return _0x349f7d(_0x4544c0[_0x5734('0x11')][_0x5734('0x12')]);}else{logger[_0x5734('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x84b6ba,_0x5734('0xd'));_0x349f7d(_0x4544c0[_0x5734('0x14')][_0x5734('0x12')]);}})[_0x5734('0x15')](function(_0x2bba43){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x84b6ba,_0x2bba43);_0x386bef(_0x2bba43);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 05ac9aa..e7c2392 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 _0x22a7=['/:id/preview','/:id/run','run','/:id/query','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','show'];(function(_0x4a23c6,_0x43da0b){var _0xf1c5e3=function(_0x417623){while(--_0x417623){_0x4a23c6['push'](_0x4a23c6['shift']());}};_0xf1c5e3(++_0x43da0b);}(_0x22a7,0xe4));var _0x722a=function(_0x49d907,_0x4edca7){_0x49d907=_0x49d907-0x0;var _0x2528ef=_0x22a7[_0x49d907];return _0x2528ef;};'use strict';var multer=require(_0x722a('0x0'));var util=require(_0x722a('0x1'));var path=require(_0x722a('0x2'));var timeout=require(_0x722a('0x3'));var express=require(_0x722a('0x4'));var router=express[_0x722a('0x5')]();var fs_extra=require(_0x722a('0x6'));var auth=require(_0x722a('0x7'));var interaction=require(_0x722a('0x8'));var config=require(_0x722a('0x9'));var controller=require(_0x722a('0xa'));router['get']('/',auth[_0x722a('0xb')](),controller[_0x722a('0xc')]);router[_0x722a('0xd')]('/:id',auth[_0x722a('0xb')](),controller[_0x722a('0xe')]);router[_0x722a('0xd')](_0x722a('0xf'),auth[_0x722a('0xb')](),controller['preview']);router[_0x722a('0xd')](_0x722a('0x10'),auth[_0x722a('0xb')](),controller[_0x722a('0x11')]);router[_0x722a('0xd')](_0x722a('0x12'),auth[_0x722a('0xb')](),controller['query']);router[_0x722a('0x13')]('/',auth[_0x722a('0xb')](),controller[_0x722a('0x14')]);router[_0x722a('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x722a('0x16')]);router[_0x722a('0x17')](_0x722a('0x18'),auth[_0x722a('0xb')](),controller[_0x722a('0x19')]);module[_0x722a('0x1a')]=router; \ No newline at end of file +var _0x9127=['/:id/query','query','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','run'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x9127,0x180));var _0x7912=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x9127[_0x102ff9];return _0x24fa97;};'use strict';var multer=require(_0x7912('0x0'));var util=require(_0x7912('0x1'));var path=require(_0x7912('0x2'));var timeout=require(_0x7912('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7912('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7912('0x5'));var config=require(_0x7912('0x6'));var controller=require(_0x7912('0x7'));router[_0x7912('0x8')]('/',auth[_0x7912('0x9')](),controller[_0x7912('0xa')]);router[_0x7912('0x8')](_0x7912('0xb'),auth['isAuthenticated'](),controller[_0x7912('0xc')]);router[_0x7912('0x8')](_0x7912('0xd'),auth[_0x7912('0x9')](),controller['preview']);router[_0x7912('0x8')]('/:id/run',auth[_0x7912('0x9')](),controller[_0x7912('0xe')]);router['get'](_0x7912('0xf'),auth[_0x7912('0x9')](),controller[_0x7912('0x10')]);router['post']('/',auth[_0x7912('0x9')](),controller[_0x7912('0x11')]);router['put'](_0x7912('0xb'),auth['isAuthenticated'](),controller[_0x7912('0x12')]);router['delete'](_0x7912('0xb'),auth[_0x7912('0x9')](),controller[_0x7912('0x13')]);module[_0x7912('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 4e3465f..759dfa6 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 _0x2e18=['STRING','ENUM','pdf','xlsx','csv','DATE','manual','UNSIGNED','sequelize'];(function(_0x11ecf4,_0x3742dd){var _0x552b7c=function(_0x47952e){while(--_0x47952e){_0x11ecf4['push'](_0x11ecf4['shift']());}};_0x552b7c(++_0x3742dd);}(_0x2e18,0x179));var _0x82e1=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x2e18[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x82e1('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x82e1('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x82e1('0x2')]('csv',_0x82e1('0x3'),_0x82e1('0x4')),'allowNull':![],'defaultValue':_0x82e1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x82e1('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x82e1('0x2')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x82e1('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x82e1('0x8')]},'reportType':{'type':Sequelize[_0x82e1('0x1')]}}; \ No newline at end of file +var _0x3bf9=['csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3bf9,0x8b));var _0x93bf=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x3bf9[_0x4996d5];return _0x4793f9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x93bf('0x0'));module[_0x93bf('0x1')]={'name':{'type':Sequelize[_0x93bf('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x93bf('0x3')](_0x93bf('0x4'),_0x93bf('0x5'),_0x93bf('0x6')),'allowNull':![],'defaultValue':_0x93bf('0x4')},'savename':{'type':Sequelize[_0x93bf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x93bf('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0x93bf('0x8')},'type':{'type':Sequelize['ENUM']('manual',_0x93bf('0x9')),'allowNull':![],'defaultValue':_0x93bf('0xa')},'reportId':{'type':Sequelize[_0x93bf('0xb')](0xb)[_0x93bf('0xc')]},'reportType':{'type':Sequelize[_0x93bf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 7cd5e0b..d823d1b 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 _0x4881=['undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','map','AnalyticExtractedReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x1f6ce1,_0x2c90d3){var _0x610f88=function(_0x3a5d4c){while(--_0x3a5d4c){_0x1f6ce1['push'](_0x1f6ce1['shift']());}};_0x610f88(++_0x2c90d3);}(_0x4881,0x1bf));var _0x1488=function(_0x3dbc7b,_0x516da5){_0x3dbc7b=_0x3dbc7b-0x0;var _0x217508=_0x4881[_0x3dbc7b];return _0x217508;};'use strict';var emlformat=require(_0x1488('0x0'));var rimraf=require(_0x1488('0x1'));var zipdir=require(_0x1488('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1488('0x3'));var moment=require(_0x1488('0x4'));var BPromise=require(_0x1488('0x5'));var Mustache=require(_0x1488('0x6'));var util=require('util');var path=require(_0x1488('0x7'));var sox=require(_0x1488('0x8'));var csv=require(_0x1488('0x9'));var ejs=require(_0x1488('0xa'));var fs=require('fs');var fs_extra=require(_0x1488('0xb'));var _=require(_0x1488('0xc'));var squel=require(_0x1488('0xd'));var crypto=require(_0x1488('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1488('0xf'));var toCsv=require(_0x1488('0x9'));var querystring=require(_0x1488('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1488('0x11'));var qs=require(_0x1488('0x12'));var as=require(_0x1488('0x13'));var hardwareService=require(_0x1488('0x14'));var logger=require('../../config/logger')(_0x1488('0x15'));var utils=require('../../config/utils');var config=require(_0x1488('0x16'));var licenseUtil=require(_0x1488('0x17'));var db=require(_0x1488('0x18'))['db'];function respondWithStatusCode(_0x5e8414,_0x4d89ad){_0x4d89ad=_0x4d89ad||0xcc;return function(_0x5ea666){if(_0x5ea666){return _0x5e8414['sendStatus'](_0x4d89ad);}return _0x5e8414[_0x1488('0x19')](_0x4d89ad)[_0x1488('0x1a')]();};}function respondWithResult(_0x4d1854,_0x2f3e22){_0x2f3e22=_0x2f3e22||0xc8;return function(_0x2630ee){if(_0x2630ee){return _0x4d1854[_0x1488('0x19')](_0x2f3e22)[_0x1488('0x1b')](_0x2630ee);}};}function respondWithFilteredResult(_0x21bfe5,_0x3b1d34){return function(_0xa412b){if(_0xa412b){var _0x58dba4=typeof _0x3b1d34['offset']===_0x1488('0x1c')&&typeof _0x3b1d34['limit']==='undefined';var _0x177bc6=_0xa412b[_0x1488('0x1d')];var _0xc10086=_0x58dba4?0x0:_0x3b1d34[_0x1488('0x1e')];var _0x5dac18=_0x58dba4?_0xa412b[_0x1488('0x1d')]:_0x3b1d34['offset']+_0x3b1d34[_0x1488('0x1f')];var _0xd2b21d;if(_0x5dac18>=_0x177bc6){_0x5dac18=_0x177bc6;_0xd2b21d=0xc8;}else{_0xd2b21d=0xce;}_0x21bfe5[_0x1488('0x19')](_0xd2b21d);return _0x21bfe5[_0x1488('0x20')](_0x1488('0x21'),_0xc10086+'-'+_0x5dac18+'/'+_0x177bc6)[_0x1488('0x1b')](_0xa412b);}return null;};}function patchUpdates(_0x1b1944){return function(_0x3527a8){try{jsonpatch[_0x1488('0x22')](_0x3527a8,_0x1b1944,!![]);}catch(_0x3754fe){return BPromise[_0x1488('0x23')](_0x3754fe);}return _0x3527a8[_0x1488('0x24')]();};}function saveUpdates(_0xf9c76a,_0x233207){return function(_0xad6cad){if(_0xad6cad){return _0xad6cad[_0x1488('0x25')](_0xf9c76a)[_0x1488('0x26')](function(_0x1cee7c){return _0x1cee7c;});}return null;};}function removeEntity(_0xd030c3,_0xc8fdea){return function(_0x45a27b){if(_0x45a27b){return _0x45a27b[_0x1488('0x27')]()['then'](function(){var _0x5c99b7=_0x45a27b[_0x1488('0x28')]({'plain':!![]});var _0x366197=_0x1488('0x29');return db[_0x1488('0x2a')][_0x1488('0x27')]({'where':{'type':_0x366197,'resourceId':_0x5c99b7['id']}})[_0x1488('0x26')](function(){return _0x45a27b;});})['then'](function(){_0xd030c3[_0x1488('0x19')](0xcc)[_0x1488('0x1a')]();});}};}function handleEntityNotFound(_0x831ed9,_0x356ebf){return function(_0x10d709){if(!_0x10d709){_0x831ed9[_0x1488('0x2b')](0x194);}return _0x10d709;};}function handleError(_0x2c835d,_0x180549){_0x180549=_0x180549||0x1f4;return function(_0x5d29c5){logger[_0x1488('0x2c')](_0x5d29c5[_0x1488('0x2d')]);if(_0x5d29c5['name']){delete _0x5d29c5[_0x1488('0x2e')];}_0x2c835d[_0x1488('0x19')](_0x180549)['send'](_0x5d29c5);};}exports['index']=function(_0x811f0e,_0x20f087){var _0x3ade78={},_0x4c8c71={},_0x41f768={'count':0x0,'rows':[]};var _0x54c2ea=_[_0x1488('0x2f')](db[_0x1488('0x30')][_0x1488('0x31')],function(_0x2a3a5b){return{'name':_0x2a3a5b['fieldName'],'type':_0x2a3a5b[_0x1488('0x32')][_0x1488('0x33')]};});_0x4c8c71['model']=_[_0x1488('0x2f')](_0x54c2ea,_0x1488('0x2e'));_0x4c8c71[_0x1488('0x34')]=_[_0x1488('0x35')](_0x811f0e['query']);_0x4c8c71[_0x1488('0x36')]=_[_0x1488('0x37')](_0x4c8c71[_0x1488('0x38')],_0x4c8c71[_0x1488('0x34')]);_0x3ade78[_0x1488('0x39')]=_['intersection'](_0x4c8c71[_0x1488('0x38')],qs[_0x1488('0x3a')](_0x811f0e[_0x1488('0x34')][_0x1488('0x3a')]));_0x3ade78[_0x1488('0x39')]=_0x3ade78[_0x1488('0x39')][_0x1488('0x3b')]?_0x3ade78[_0x1488('0x39')]:_0x4c8c71[_0x1488('0x38')];if(!_0x811f0e[_0x1488('0x34')]['hasOwnProperty']('nolimit')){_0x3ade78['limit']=qs[_0x1488('0x1f')](_0x811f0e['query'][_0x1488('0x1f')]);_0x3ade78[_0x1488('0x1e')]=qs[_0x1488('0x1e')](_0x811f0e[_0x1488('0x34')][_0x1488('0x1e')]);}_0x3ade78[_0x1488('0x3c')]=qs[_0x1488('0x3d')](_0x811f0e['query'][_0x1488('0x3d')]);_0x3ade78[_0x1488('0x3e')]=qs[_0x1488('0x36')](_[_0x1488('0x3f')](_0x811f0e[_0x1488('0x34')],_0x4c8c71[_0x1488('0x36')]),_0x54c2ea);if(_0x811f0e['query'][_0x1488('0x40')]){_0x3ade78[_0x1488('0x3e')]=_[_0x1488('0x41')](_0x3ade78[_0x1488('0x3e')],{'$or':_[_0x1488('0x2f')](_0x54c2ea,function(_0xef8ec1){if(_0xef8ec1[_0x1488('0x32')]!==_0x1488('0x42')){var _0x5dae07={};_0x5dae07[_0xef8ec1[_0x1488('0x2e')]]={'$like':'%'+_0x811f0e[_0x1488('0x34')]['filter']+'%'};return _0x5dae07;}})});}_0x3ade78=_[_0x1488('0x41')]({},_0x3ade78,_0x811f0e['options']);var _0x2b151a={'where':_0x3ade78[_0x1488('0x3e')]};return db[_0x1488('0x30')][_0x1488('0x1d')](_0x2b151a)[_0x1488('0x26')](function(_0x34854a){_0x41f768[_0x1488('0x1d')]=_0x34854a;if(_0x811f0e[_0x1488('0x34')]['includeAll']){_0x3ade78[_0x1488('0x43')]=[{'all':!![]}];}return db[_0x1488('0x30')][_0x1488('0x44')](_0x3ade78);})[_0x1488('0x26')](function(_0x1bf105){_0x41f768[_0x1488('0x45')]=_0x1bf105;return _0x41f768;})[_0x1488('0x26')](respondWithFilteredResult(_0x20f087,_0x3ade78))[_0x1488('0x46')](handleError(_0x20f087,null));};exports[_0x1488('0x47')]=function(_0x1555ca,_0x44a4cb){var _0x38e88a={'raw':!![],'where':{'id':_0x1555ca[_0x1488('0x48')]['id']}},_0x1d6d85={};_0x1d6d85[_0x1488('0x38')]=_[_0x1488('0x35')](db[_0x1488('0x30')][_0x1488('0x31')]);_0x1d6d85[_0x1488('0x34')]=_[_0x1488('0x35')](_0x1555ca[_0x1488('0x34')]);_0x1d6d85[_0x1488('0x36')]=_[_0x1488('0x37')](_0x1d6d85['model'],_0x1d6d85['query']);_0x38e88a['attributes']=_['intersection'](_0x1d6d85[_0x1488('0x38')],qs[_0x1488('0x3a')](_0x1555ca[_0x1488('0x34')][_0x1488('0x3a')]));_0x38e88a[_0x1488('0x39')]=_0x38e88a[_0x1488('0x39')][_0x1488('0x3b')]?_0x38e88a[_0x1488('0x39')]:_0x1d6d85['model'];if(_0x1555ca[_0x1488('0x34')][_0x1488('0x49')]){_0x38e88a[_0x1488('0x43')]=[{'all':!![]}];}_0x38e88a=_[_0x1488('0x41')]({},_0x38e88a,_0x1555ca['options']);return db[_0x1488('0x30')][_0x1488('0x4a')](_0x38e88a)[_0x1488('0x26')](handleEntityNotFound(_0x44a4cb,null))['then'](respondWithResult(_0x44a4cb,null))[_0x1488('0x46')](handleError(_0x44a4cb,null));};exports[_0x1488('0x4b')]=function(_0x2b2926,_0x232e9e){return db[_0x1488('0x30')]['create'](_0x2b2926['body'],{})['then'](function(_0x239b8e){var _0xd796e4=_0x2b2926['user'][_0x1488('0x28')]({'plain':!![]});if(!_0xd796e4)throw new Error(_0x1488('0x4c'));if(_0xd796e4[_0x1488('0x4d')]===_0x1488('0x4e')){var _0x3d5621=_0x239b8e[_0x1488('0x28')]({'plain':!![]});var _0x4aa3db=_0x1488('0x29');return db['UserProfileSection'][_0x1488('0x4a')]({'where':{'name':_0x4aa3db,'userProfileId':_0xd796e4['userProfileId']},'raw':!![]})[_0x1488('0x26')](function(_0x47f01b){if(_0x47f01b&&_0x47f01b[_0x1488('0x4f')]===0x0){return db['UserProfileResource'][_0x1488('0x4b')]({'name':_0x3d5621[_0x1488('0x2e')],'resourceId':_0x3d5621['id'],'type':_0x47f01b[_0x1488('0x2e')],'sectionId':_0x47f01b['id']},{})['then'](function(){return _0x239b8e;});}else{return _0x239b8e;}})[_0x1488('0x46')](function(_0x24276e){logger['error'](_0x1488('0x50'),_0x24276e);throw _0x24276e;});}return _0x239b8e;})[_0x1488('0x26')](respondWithResult(_0x232e9e,0xc9))[_0x1488('0x46')](handleError(_0x232e9e,null));};exports[_0x1488('0x25')]=function(_0x5bed8f,_0x1d2868){if(_0x5bed8f[_0x1488('0x51')]['id']){delete _0x5bed8f[_0x1488('0x51')]['id'];}return db['AnalyticExtractedReport'][_0x1488('0x4a')]({'where':{'id':_0x5bed8f['params']['id']}})[_0x1488('0x26')](handleEntityNotFound(_0x1d2868,null))[_0x1488('0x26')](saveUpdates(_0x5bed8f[_0x1488('0x51')],null))[_0x1488('0x26')](respondWithResult(_0x1d2868,null))[_0x1488('0x46')](handleError(_0x1d2868,null));};exports[_0x1488('0x27')]=function(_0x9eb994,_0x1358d7){return db[_0x1488('0x30')]['find']({'where':{'id':_0x9eb994[_0x1488('0x48')]['id']}})['then'](handleEntityNotFound(_0x1358d7,null))[_0x1488('0x26')](removeEntity(_0x1358d7,null))['catch'](handleError(_0x1358d7,null));};exports[_0x1488('0x52')]=function(_0x182103,_0x39c2c9,_0xe826ca){return db[_0x1488('0x30')]['find']({'where':{'id':_0x182103['params']['id']},'attributes':[_0x1488('0x2e'),_0x1488('0x53'),_0x1488('0x54'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x39c2c9,null))[_0x1488('0x26')](function(_0x3bd622){if(_0x3bd622){if(!fs['existsSync'](path[_0x1488('0x55')](config[_0x1488('0x56')],_0x1488('0x57'),_0x3bd622['savename']))){throw new db[(_0x1488('0x58'))][(_0x1488('0x59'))](_0x1488('0x5a'));}if(_0x182103['query'][_0x1488('0x5b')]){return _0x39c2c9[_0x1488('0x2b')](0xc8);}return _0x39c2c9[_0x1488('0x52')](path['join'](config[_0x1488('0x56')],_0x1488('0x57'),_0x3bd622['savename']),util[_0x1488('0x5c')](_0x1488('0x5d'),_0x3bd622[_0x1488('0x53')]||_0x3bd622[_0x1488('0x2e')],_0x3bd622['output'][_0x1488('0x5e')]()));}})[_0x1488('0x46')](handleError(_0x39c2c9,null));}; \ No newline at end of file +var _0x0c44=['name','keys','query','intersection','attributes','fields','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticExtractedReport','count','includeAll','include','findAll','catch','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','download','basename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','reject','then','destroy','UserProfileResource','error','stack','send','index','rawAttributes','fieldName','key','model','map'];(function(_0x2d5881,_0x38f899){var _0x2b26c2=function(_0x2203bd){while(--_0x2203bd){_0x2d5881['push'](_0x2d5881['shift']());}};_0x2b26c2(++_0x38f899);}(_0x0c44,0x91));var _0x40c4=function(_0x911d76,_0x392f25){_0x911d76=_0x911d76-0x0;var _0x3ef002=_0x0c44[_0x911d76];return _0x3ef002;};'use strict';var emlformat=require(_0x40c4('0x0'));var rimraf=require(_0x40c4('0x1'));var zipdir=require(_0x40c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c4('0x3'));var moment=require(_0x40c4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x40c4('0x5'));var util=require(_0x40c4('0x6'));var path=require('path');var sox=require(_0x40c4('0x7'));var csv=require(_0x40c4('0x8'));var ejs=require(_0x40c4('0x9'));var fs=require('fs');var fs_extra=require(_0x40c4('0xa'));var _=require(_0x40c4('0xb'));var squel=require(_0x40c4('0xc'));var crypto=require(_0x40c4('0xd'));var jsforce=require(_0x40c4('0xe'));var deskjs=require(_0x40c4('0xf'));var toCsv=require(_0x40c4('0x8'));var querystring=require(_0x40c4('0x10'));var Papa=require(_0x40c4('0x11'));var Redis=require(_0x40c4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x40c4('0x13'));var as=require(_0x40c4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40c4('0x15'))(_0x40c4('0x16'));var utils=require(_0x40c4('0x17'));var config=require(_0x40c4('0x18'));var licenseUtil=require(_0x40c4('0x19'));var db=require(_0x40c4('0x1a'))['db'];function respondWithStatusCode(_0x2c6eb2,_0x30340e){_0x30340e=_0x30340e||0xcc;return function(_0x380419){if(_0x380419){return _0x2c6eb2[_0x40c4('0x1b')](_0x30340e);}return _0x2c6eb2[_0x40c4('0x1c')](_0x30340e)[_0x40c4('0x1d')]();};}function respondWithResult(_0x1b1bec,_0x27a582){_0x27a582=_0x27a582||0xc8;return function(_0x244bb1){if(_0x244bb1){return _0x1b1bec['status'](_0x27a582)[_0x40c4('0x1e')](_0x244bb1);}};}function respondWithFilteredResult(_0x3e539c,_0x28e75b){return function(_0x485512){if(_0x485512){var _0x588173=typeof _0x28e75b['offset']===_0x40c4('0x1f')&&typeof _0x28e75b['limit']===_0x40c4('0x1f');var _0x2977b6=_0x485512['count'];var _0x1672c6=_0x588173?0x0:_0x28e75b[_0x40c4('0x20')];var _0x4b5331=_0x588173?_0x485512['count']:_0x28e75b['offset']+_0x28e75b[_0x40c4('0x21')];var _0x4fb9cd;if(_0x4b5331>=_0x2977b6){_0x4b5331=_0x2977b6;_0x4fb9cd=0xc8;}else{_0x4fb9cd=0xce;}_0x3e539c[_0x40c4('0x1c')](_0x4fb9cd);return _0x3e539c[_0x40c4('0x22')](_0x40c4('0x23'),_0x1672c6+'-'+_0x4b5331+'/'+_0x2977b6)[_0x40c4('0x1e')](_0x485512);}return null;};}function patchUpdates(_0x581647){return function(_0xd62635){try{jsonpatch['apply'](_0xd62635,_0x581647,!![]);}catch(_0x1fb377){return BPromise[_0x40c4('0x24')](_0x1fb377);}return _0xd62635['save']();};}function saveUpdates(_0x5b452e,_0x238d4d){return function(_0x460f2e){if(_0x460f2e){return _0x460f2e['update'](_0x5b452e)[_0x40c4('0x25')](function(_0x50e4bf){return _0x50e4bf;});}return null;};}function removeEntity(_0x568d1d,_0x59af9c){return function(_0x5c2eaf){if(_0x5c2eaf){return _0x5c2eaf[_0x40c4('0x26')]()[_0x40c4('0x25')](function(){var _0x17c13e=_0x5c2eaf['get']({'plain':!![]});var _0x2847e3='ExtractedReports';return db[_0x40c4('0x27')]['destroy']({'where':{'type':_0x2847e3,'resourceId':_0x17c13e['id']}})[_0x40c4('0x25')](function(){return _0x5c2eaf;});})[_0x40c4('0x25')](function(){_0x568d1d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592b84,_0x4f87f4){return function(_0x53dc90){if(!_0x53dc90){_0x592b84[_0x40c4('0x1b')](0x194);}return _0x53dc90;};}function handleError(_0x13d497,_0xc961d9){_0xc961d9=_0xc961d9||0x1f4;return function(_0x23422b){logger[_0x40c4('0x28')](_0x23422b[_0x40c4('0x29')]);if(_0x23422b['name']){delete _0x23422b['name'];}_0x13d497['status'](_0xc961d9)[_0x40c4('0x2a')](_0x23422b);};}exports[_0x40c4('0x2b')]=function(_0x53c7c0,_0x1fa6cd){var _0x2fd30a={},_0x1b787f={},_0x54c72b={'count':0x0,'rows':[]};var _0x1e9383=_['map'](db['AnalyticExtractedReport'][_0x40c4('0x2c')],function(_0x36dd2f){return{'name':_0x36dd2f[_0x40c4('0x2d')],'type':_0x36dd2f['type'][_0x40c4('0x2e')]};});_0x1b787f[_0x40c4('0x2f')]=_[_0x40c4('0x30')](_0x1e9383,_0x40c4('0x31'));_0x1b787f['query']=_[_0x40c4('0x32')](_0x53c7c0[_0x40c4('0x33')]);_0x1b787f['filters']=_[_0x40c4('0x34')](_0x1b787f['model'],_0x1b787f[_0x40c4('0x33')]);_0x2fd30a[_0x40c4('0x35')]=_[_0x40c4('0x34')](_0x1b787f[_0x40c4('0x2f')],qs[_0x40c4('0x36')](_0x53c7c0[_0x40c4('0x33')][_0x40c4('0x36')]));_0x2fd30a[_0x40c4('0x35')]=_0x2fd30a[_0x40c4('0x35')]['length']?_0x2fd30a[_0x40c4('0x35')]:_0x1b787f[_0x40c4('0x2f')];if(!_0x53c7c0['query'][_0x40c4('0x37')]('nolimit')){_0x2fd30a[_0x40c4('0x21')]=qs[_0x40c4('0x21')](_0x53c7c0[_0x40c4('0x33')][_0x40c4('0x21')]);_0x2fd30a[_0x40c4('0x20')]=qs[_0x40c4('0x20')](_0x53c7c0[_0x40c4('0x33')][_0x40c4('0x20')]);}_0x2fd30a['order']=qs['sort'](_0x53c7c0[_0x40c4('0x33')]['sort']);_0x2fd30a[_0x40c4('0x38')]=qs[_0x40c4('0x39')](_[_0x40c4('0x3a')](_0x53c7c0['query'],_0x1b787f[_0x40c4('0x39')]),_0x1e9383);if(_0x53c7c0[_0x40c4('0x33')][_0x40c4('0x3b')]){_0x2fd30a[_0x40c4('0x38')]=_[_0x40c4('0x3c')](_0x2fd30a[_0x40c4('0x38')],{'$or':_['map'](_0x1e9383,function(_0xb386c5){if(_0xb386c5['type']!==_0x40c4('0x3d')){var _0x51e436={};_0x51e436[_0xb386c5[_0x40c4('0x31')]]={'$like':'%'+_0x53c7c0[_0x40c4('0x33')][_0x40c4('0x3b')]+'%'};return _0x51e436;}})});}_0x2fd30a=_['merge']({},_0x2fd30a,_0x53c7c0[_0x40c4('0x3e')]);var _0x498ddf={'where':_0x2fd30a['where']};return db[_0x40c4('0x3f')][_0x40c4('0x40')](_0x498ddf)[_0x40c4('0x25')](function(_0x4acf5d){_0x54c72b['count']=_0x4acf5d;if(_0x53c7c0['query'][_0x40c4('0x41')]){_0x2fd30a[_0x40c4('0x42')]=[{'all':!![]}];}return db[_0x40c4('0x3f')][_0x40c4('0x43')](_0x2fd30a);})[_0x40c4('0x25')](function(_0x31b4a5){_0x54c72b['rows']=_0x31b4a5;return _0x54c72b;})[_0x40c4('0x25')](respondWithFilteredResult(_0x1fa6cd,_0x2fd30a))[_0x40c4('0x44')](handleError(_0x1fa6cd,null));};exports['show']=function(_0x167486,_0x18901e){var _0x280b72={'raw':!![],'where':{'id':_0x167486['params']['id']}},_0x2db531={};_0x2db531[_0x40c4('0x2f')]=_['keys'](db[_0x40c4('0x3f')][_0x40c4('0x2c')]);_0x2db531[_0x40c4('0x33')]=_[_0x40c4('0x32')](_0x167486[_0x40c4('0x33')]);_0x2db531['filters']=_[_0x40c4('0x34')](_0x2db531['model'],_0x2db531[_0x40c4('0x33')]);_0x280b72['attributes']=_[_0x40c4('0x34')](_0x2db531[_0x40c4('0x2f')],qs['fields'](_0x167486['query'][_0x40c4('0x36')]));_0x280b72[_0x40c4('0x35')]=_0x280b72['attributes'][_0x40c4('0x45')]?_0x280b72[_0x40c4('0x35')]:_0x2db531[_0x40c4('0x2f')];if(_0x167486['query'][_0x40c4('0x41')]){_0x280b72[_0x40c4('0x42')]=[{'all':!![]}];}_0x280b72=_[_0x40c4('0x3c')]({},_0x280b72,_0x167486['options']);return db[_0x40c4('0x3f')]['find'](_0x280b72)[_0x40c4('0x25')](handleEntityNotFound(_0x18901e,null))['then'](respondWithResult(_0x18901e,null))[_0x40c4('0x44')](handleError(_0x18901e,null));};exports[_0x40c4('0x46')]=function(_0xc471ec,_0x2b4aad){return db['AnalyticExtractedReport'][_0x40c4('0x46')](_0xc471ec[_0x40c4('0x47')],{})[_0x40c4('0x25')](function(_0x1ba78d){var _0x4d6232=_0xc471ec['user'][_0x40c4('0x48')]({'plain':!![]});if(!_0x4d6232)throw new Error(_0x40c4('0x49'));if(_0x4d6232[_0x40c4('0x4a')]===_0x40c4('0x4b')){var _0x3cf8a6=_0x1ba78d[_0x40c4('0x48')]({'plain':!![]});var _0x2a0fe2=_0x40c4('0x4c');return db[_0x40c4('0x4d')][_0x40c4('0x4e')]({'where':{'name':_0x2a0fe2,'userProfileId':_0x4d6232[_0x40c4('0x4f')]},'raw':!![]})[_0x40c4('0x25')](function(_0x77d374){if(_0x77d374&&_0x77d374[_0x40c4('0x50')]===0x0){return db[_0x40c4('0x27')]['create']({'name':_0x3cf8a6['name'],'resourceId':_0x3cf8a6['id'],'type':_0x77d374[_0x40c4('0x31')],'sectionId':_0x77d374['id']},{})[_0x40c4('0x25')](function(){return _0x1ba78d;});}else{return _0x1ba78d;}})[_0x40c4('0x44')](function(_0x1b4d40){logger['error'](_0x40c4('0x51'),_0x1b4d40);throw _0x1b4d40;});}return _0x1ba78d;})[_0x40c4('0x25')](respondWithResult(_0x2b4aad,0xc9))[_0x40c4('0x44')](handleError(_0x2b4aad,null));};exports[_0x40c4('0x52')]=function(_0x21afc1,_0x1b77ec){if(_0x21afc1[_0x40c4('0x47')]['id']){delete _0x21afc1[_0x40c4('0x47')]['id'];}return db[_0x40c4('0x3f')][_0x40c4('0x4e')]({'where':{'id':_0x21afc1[_0x40c4('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b77ec,null))[_0x40c4('0x25')](saveUpdates(_0x21afc1[_0x40c4('0x47')],null))[_0x40c4('0x25')](respondWithResult(_0x1b77ec,null))['catch'](handleError(_0x1b77ec,null));};exports['destroy']=function(_0x4ad9a0,_0x2ea588){return db['AnalyticExtractedReport'][_0x40c4('0x4e')]({'where':{'id':_0x4ad9a0['params']['id']}})[_0x40c4('0x25')](handleEntityNotFound(_0x2ea588,null))[_0x40c4('0x25')](removeEntity(_0x2ea588,null))[_0x40c4('0x44')](handleError(_0x2ea588,null));};exports[_0x40c4('0x54')]=function(_0x1c335d,_0x36ed57,_0x2bc8d8){return db[_0x40c4('0x3f')][_0x40c4('0x4e')]({'where':{'id':_0x1c335d[_0x40c4('0x53')]['id']},'attributes':[_0x40c4('0x31'),_0x40c4('0x55'),'savename',_0x40c4('0x56')],'raw':!![]})[_0x40c4('0x25')](handleEntityNotFound(_0x36ed57,null))['then'](function(_0x60365b){if(_0x60365b){if(!fs[_0x40c4('0x57')](path[_0x40c4('0x58')](config[_0x40c4('0x59')],_0x40c4('0x5a'),_0x60365b['savename']))){throw new db[(_0x40c4('0x5b'))][(_0x40c4('0x5c'))](_0x40c4('0x5d'));}if(_0x1c335d[_0x40c4('0x33')][_0x40c4('0x5e')]){return _0x36ed57[_0x40c4('0x1b')](0xc8);}return _0x36ed57[_0x40c4('0x54')](path['join'](config['root'],_0x40c4('0x5a'),_0x60365b[_0x40c4('0x5f')]),util['format']('%s.%s',_0x60365b[_0x40c4('0x55')]||_0x60365b[_0x40c4('0x31')],_0x60365b[_0x40c4('0x56')][_0x40c4('0x60')]()));}})[_0x40c4('0x44')](handleError(_0x36ed57,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 21eb022..f527fb8 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 _0x5ab3=['path','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','bluebird','request-promise'];(function(_0x3c7292,_0x9f32b1){var _0x1b66f6=function(_0x2965d8){while(--_0x2965d8){_0x3c7292['push'](_0x3c7292['shift']());}};_0x1b66f6(++_0x9f32b1);}(_0x5ab3,0x177));var _0x35ab=function(_0xb1daa5,_0x24a164){_0xb1daa5=_0xb1daa5-0x0;var _0x31107e=_0x5ab3[_0xb1daa5];return _0x31107e;};'use strict';var _=require(_0x35ab('0x0'));var util=require(_0x35ab('0x1'));var logger=require('../../config/logger')(_0x35ab('0x2'));var moment=require('moment');var BPromise=require(_0x35ab('0x3'));var rp=require(_0x35ab('0x4'));var fs=require('fs');var path=require(_0x35ab('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x35ab('0x6')]=function(_0x1d462e,_0x4559d8){return _0x1d462e[_0x35ab('0x7')](_0x35ab('0x8'),attributes,{'tableName':_0x35ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa740=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34727d,_0x1b3df4){var _0x175efc=function(_0x527de1){while(--_0x527de1){_0x34727d['push'](_0x34727d['shift']());}};_0x175efc(++_0x1b3df4);}(_0xa740,0xaf));var _0x0a74=function(_0x3bc255,_0x5712b0){_0x3bc255=_0x3bc255-0x0;var _0x14e4fc=_0xa740[_0x3bc255];return _0x14e4fc;};'use strict';var _=require('lodash');var util=require(_0x0a74('0x0'));var logger=require(_0x0a74('0x1'))(_0x0a74('0x2'));var moment=require(_0x0a74('0x3'));var BPromise=require(_0x0a74('0x4'));var rp=require(_0x0a74('0x5'));var fs=require('fs');var path=require(_0x0a74('0x6'));var rimraf=require(_0x0a74('0x7'));var config=require(_0x0a74('0x8'));var attributes=require(_0x0a74('0x9'));module[_0x0a74('0xa')]=function(_0x331e6e,_0xcb6e35){return _0x331e6e[_0x0a74('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x0a74('0xc'),'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 e67b038..42c3f89 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 _0x93f7=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x93f7,0x140));var _0x793f=function(_0x9f91e9,_0x163b58){_0x9f91e9=_0x9f91e9-0x0;var _0x516900=_0x93f7[_0x9f91e9];return _0x516900;};'use strict';var _=require('lodash');var util=require(_0x793f('0x0'));var moment=require(_0x793f('0x1'));var BPromise=require('bluebird');var rs=require(_0x793f('0x2'));var fs=require('fs');var Redis=require(_0x793f('0x3'));var db=require(_0x793f('0x4'))['db'];var utils=require(_0x793f('0x5'));var logger=require('../../config/logger')(_0x793f('0x6'));var config=require(_0x793f('0x7'));var jayson=require(_0x793f('0x8'));var client=jayson['client'][_0x793f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5574aa,_0x5b2108,_0x467a0d){return new BPromise(function(_0x17a914,_0x5622a){return client[_0x793f('0xa')](_0x5574aa,_0x467a0d)[_0x793f('0xb')](function(_0x34d88a){logger[_0x793f('0xc')](_0x793f('0xd'),_0x5b2108,_0x793f('0xe'));logger[_0x793f('0xf')](_0x793f('0x10'),_0x5b2108,_0x793f('0xe'),JSON[_0x793f('0x11')](_0x34d88a));if(_0x34d88a[_0x793f('0x12')]){if(_0x34d88a[_0x793f('0x12')][_0x793f('0x13')]===0x1f4){logger[_0x793f('0x12')](_0x793f('0xd'),_0x5b2108,_0x34d88a['error'][_0x793f('0x14')]);return _0x5622a(_0x34d88a[_0x793f('0x12')][_0x793f('0x14')]);}logger['error'](_0x793f('0xd'),_0x5b2108,_0x34d88a[_0x793f('0x12')]['message']);return _0x17a914(_0x34d88a['error'][_0x793f('0x14')]);}else{logger[_0x793f('0xc')](_0x793f('0xd'),_0x5b2108,_0x793f('0xe'));_0x17a914(_0x34d88a[_0x793f('0x15')][_0x793f('0x14')]);}})['catch'](function(_0x326532){logger[_0x793f('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5b2108,_0x326532);_0x5622a(_0x326532);});});} \ No newline at end of file +var _0x6675=['stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x290681,_0x59d049){var _0xb8b577=function(_0x1586c5){while(--_0x1586c5){_0x290681['push'](_0x290681['shift']());}};_0xb8b577(++_0x59d049);}(_0x6675,0x15c));var _0x5667=function(_0x440ebe,_0x286deb){_0x440ebe=_0x440ebe-0x0;var _0x399cfb=_0x6675[_0x440ebe];return _0x399cfb;};'use strict';var _=require(_0x5667('0x0'));var util=require('util');var moment=require(_0x5667('0x1'));var BPromise=require(_0x5667('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5667('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5667('0x4'))(_0x5667('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5667('0x6')][_0x5667('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x31ba0b,_0x4913c0,_0x32d471){return new BPromise(function(_0x264d45,_0x461471){return client['request'](_0x31ba0b,_0x32d471)[_0x5667('0x8')](function(_0x541731){logger[_0x5667('0x9')](_0x5667('0xa'),_0x4913c0,_0x5667('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4913c0,_0x5667('0xb'),JSON[_0x5667('0xc')](_0x541731));if(_0x541731[_0x5667('0xd')]){if(_0x541731[_0x5667('0xd')][_0x5667('0xe')]===0x1f4){logger['error'](_0x5667('0xa'),_0x4913c0,_0x541731[_0x5667('0xd')][_0x5667('0xf')]);return _0x461471(_0x541731['error'][_0x5667('0xf')]);}logger[_0x5667('0xd')](_0x5667('0xa'),_0x4913c0,_0x541731['error'][_0x5667('0xf')]);return _0x264d45(_0x541731[_0x5667('0xd')][_0x5667('0xf')]);}else{logger[_0x5667('0x9')](_0x5667('0xa'),_0x4913c0,'request\x20sent');_0x264d45(_0x541731[_0x5667('0x10')][_0x5667('0xf')]);}})[_0x5667('0x11')](function(_0x51fa54){logger[_0x5667('0xd')](_0x5667('0xa'),_0x4913c0,_0x51fa54);_0x461471(_0x51fa54);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b62c9d8..27eb1fe 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 _0x7121=['/:id/download','download','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7121,0x12f));var _0x1712=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x7121[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x1712('0x0'));var util=require(_0x1712('0x1'));var path=require(_0x1712('0x2'));var timeout=require(_0x1712('0x3'));var express=require(_0x1712('0x4'));var router=express[_0x1712('0x5')]();var fs_extra=require(_0x1712('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1712('0x7'));var config=require(_0x1712('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x1712('0x9')]('/',auth[_0x1712('0xa')](),controller['index']);router[_0x1712('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1712('0xb')]);router[_0x1712('0x9')](_0x1712('0xc'),auth[_0x1712('0xa')](),controller[_0x1712('0xd')]);router[_0x1712('0xe')]('/',auth[_0x1712('0xa')](),controller[_0x1712('0xf')]);router[_0x1712('0x10')](_0x1712('0x11'),auth['isAuthenticated'](),controller[_0x1712('0x12')]);router['delete'](_0x1712('0x11'),auth[_0x1712('0xa')](),controller[_0x1712('0x13')]);module[_0x1712('0x14')]=router; \ No newline at end of file +var _0xf1d5=['get','/:id/download','download','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','/:id','isAuthenticated'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0xf1d5,0x1bf));var _0x5f1d=function(_0x2a3226,_0x11595e){_0x2a3226=_0x2a3226-0x0;var _0x377993=_0xf1d5[_0x2a3226];return _0x377993;};'use strict';var multer=require(_0x5f1d('0x0'));var util=require(_0x5f1d('0x1'));var path=require(_0x5f1d('0x2'));var timeout=require(_0x5f1d('0x3'));var express=require('express');var router=express[_0x5f1d('0x4')]();var fs_extra=require(_0x5f1d('0x5'));var auth=require(_0x5f1d('0x6'));var interaction=require(_0x5f1d('0x7'));var config=require(_0x5f1d('0x8'));var controller=require(_0x5f1d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f1d('0xa')]);router['get'](_0x5f1d('0xb'),auth[_0x5f1d('0xc')](),controller['show']);router[_0x5f1d('0xd')](_0x5f1d('0xe'),auth[_0x5f1d('0xc')](),controller[_0x5f1d('0xf')]);router['post']('/',auth[_0x5f1d('0xc')](),controller[_0x5f1d('0x10')]);router[_0x5f1d('0x11')](_0x5f1d('0xb'),auth['isAuthenticated'](),controller[_0x5f1d('0x12')]);router['delete'](_0x5f1d('0xb'),auth[_0x5f1d('0xc')](),controller['destroy']);module[_0x5f1d('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index bc3dad5..ca4709b 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 _0x05db=['exports','STRING','BOOLEAN','sequelize'];(function(_0x41beb0,_0x2298de){var _0x77cc6f=function(_0x2f2cce){while(--_0x2f2cce){_0x41beb0['push'](_0x41beb0['shift']());}};_0x77cc6f(++_0x2298de);}(_0x05db,0x83));var _0xb05d=function(_0x5b406e,_0xcd06bc){_0x5b406e=_0x5b406e-0x0;var _0xe7d242=_0x05db[_0x5b406e];return _0xe7d242;};'use strict';var Sequelize=require(_0xb05d('0x0'));module[_0xb05d('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xb05d('0x2')]},'function':{'type':Sequelize[_0xb05d('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb05d('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb05d('0x2')]},'custom':{'type':Sequelize[_0xb05d('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8123=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x8123,0x8a));var _0x3812=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x8123[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require(_0x3812('0x0'));module[_0x3812('0x1')]={'field':{'type':Sequelize[_0x3812('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x3812('0x3')]},'format':{'type':Sequelize[_0x3812('0x3')]},'groupBy':{'type':Sequelize[_0x3812('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3812('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 375cc5c..49b3047 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 _0x0282=['to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','bulkDestroy','addFields','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x441b5f,_0x3ee529){var _0x3fc66f=function(_0xd7b2af){while(--_0xd7b2af){_0x441b5f['push'](_0x441b5f['shift']());}};_0x3fc66f(++_0x3ee529);}(_0x0282,0xd6));var _0x2028=function(_0x114733,_0x566111){_0x114733=_0x114733-0x0;var _0x2654d7=_0x0282[_0x114733];return _0x2654d7;};'use strict';var emlformat=require(_0x2028('0x0'));var rimraf=require(_0x2028('0x1'));var zipdir=require(_0x2028('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2028('0x3'));var moment=require(_0x2028('0x4'));var BPromise=require(_0x2028('0x5'));var Mustache=require('mustache');var util=require(_0x2028('0x6'));var path=require(_0x2028('0x7'));var sox=require(_0x2028('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2028('0x9'));var _=require(_0x2028('0xa'));var squel=require('squel');var crypto=require(_0x2028('0xb'));var jsforce=require(_0x2028('0xc'));var deskjs=require(_0x2028('0xd'));var toCsv=require(_0x2028('0xe'));var querystring=require(_0x2028('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2028('0x10'));var qs=require(_0x2028('0x11'));var as=require(_0x2028('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2028('0x13'));var licenseUtil=require(_0x2028('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6dfb8e,_0x3e2fe8){_0x3e2fe8=_0x3e2fe8||0xcc;return function(_0x178634){if(_0x178634){return _0x6dfb8e[_0x2028('0x15')](_0x3e2fe8);}return _0x6dfb8e[_0x2028('0x16')](_0x3e2fe8)['end']();};}function respondWithResult(_0x1edadb,_0x5678cf){_0x5678cf=_0x5678cf||0xc8;return function(_0x5e078a){if(_0x5e078a){return _0x1edadb['status'](_0x5678cf)[_0x2028('0x17')](_0x5e078a);}};}function respondWithFilteredResult(_0x44f199,_0x2478af){return function(_0x1425df){if(_0x1425df){var _0x5755db=typeof _0x2478af[_0x2028('0x18')]===_0x2028('0x19')&&typeof _0x2478af[_0x2028('0x1a')]===_0x2028('0x19');var _0x3c205d=_0x1425df[_0x2028('0x1b')];var _0x1b6c52=_0x5755db?0x0:_0x2478af['offset'];var _0x2785cb=_0x5755db?_0x1425df[_0x2028('0x1b')]:_0x2478af[_0x2028('0x18')]+_0x2478af['limit'];var _0x455fba;if(_0x2785cb>=_0x3c205d){_0x2785cb=_0x3c205d;_0x455fba=0xc8;}else{_0x455fba=0xce;}_0x44f199['status'](_0x455fba);return _0x44f199['set'](_0x2028('0x1c'),_0x1b6c52+'-'+_0x2785cb+'/'+_0x3c205d)[_0x2028('0x17')](_0x1425df);}return null;};}function patchUpdates(_0x5c9c97){return function(_0x4af690){try{jsonpatch[_0x2028('0x1d')](_0x4af690,_0x5c9c97,!![]);}catch(_0x323a8d){return BPromise[_0x2028('0x1e')](_0x323a8d);}return _0x4af690['save']();};}function saveUpdates(_0x403ac5,_0x4c51d1){return function(_0x128339){if(_0x128339){return _0x128339[_0x2028('0x1f')](_0x403ac5)[_0x2028('0x20')](function(_0x85ae8f){return _0x85ae8f;});}return null;};}function removeEntity(_0x412740,_0x3489bf){return function(_0x4af8db){if(_0x4af8db){return _0x4af8db[_0x2028('0x21')]()[_0x2028('0x20')](function(){_0x412740[_0x2028('0x16')](0xcc)[_0x2028('0x22')]();});}};}function handleEntityNotFound(_0x8358f7,_0x4e75e3){return function(_0x2ebf78){if(!_0x2ebf78){_0x8358f7[_0x2028('0x15')](0x194);}return _0x2ebf78;};}function handleError(_0x47d80b,_0x5d28f9){_0x5d28f9=_0x5d28f9||0x1f4;return function(_0x252200){logger['error'](_0x252200['stack']);if(_0x252200[_0x2028('0x23')]){delete _0x252200[_0x2028('0x23')];}_0x47d80b[_0x2028('0x16')](_0x5d28f9)['send'](_0x252200);};}exports[_0x2028('0x24')]=function(_0x403ae2,_0x585860){var _0x51cae2={},_0x11e3e8={},_0x4bb457={'count':0x0,'rows':[]};var _0x57ad34=_[_0x2028('0x25')](db[_0x2028('0x26')][_0x2028('0x27')],function(_0x33b616){return{'name':_0x33b616[_0x2028('0x28')],'type':_0x33b616[_0x2028('0x29')][_0x2028('0x2a')]};});_0x11e3e8[_0x2028('0x2b')]=_[_0x2028('0x25')](_0x57ad34,_0x2028('0x23'));_0x11e3e8[_0x2028('0x2c')]=_[_0x2028('0x2d')](_0x403ae2[_0x2028('0x2c')]);_0x11e3e8[_0x2028('0x2e')]=_[_0x2028('0x2f')](_0x11e3e8[_0x2028('0x2b')],_0x11e3e8[_0x2028('0x2c')]);_0x51cae2[_0x2028('0x30')]=_[_0x2028('0x2f')](_0x11e3e8[_0x2028('0x2b')],qs['fields'](_0x403ae2[_0x2028('0x2c')][_0x2028('0x31')]));_0x51cae2[_0x2028('0x30')]=_0x51cae2[_0x2028('0x30')]['length']?_0x51cae2[_0x2028('0x30')]:_0x11e3e8[_0x2028('0x2b')];if(!_0x403ae2[_0x2028('0x2c')][_0x2028('0x32')](_0x2028('0x33'))){_0x51cae2[_0x2028('0x1a')]=qs[_0x2028('0x1a')](_0x403ae2[_0x2028('0x2c')][_0x2028('0x1a')]);_0x51cae2[_0x2028('0x18')]=qs['offset'](_0x403ae2[_0x2028('0x2c')][_0x2028('0x18')]);}_0x51cae2[_0x2028('0x34')]=qs[_0x2028('0x35')](_0x403ae2[_0x2028('0x2c')][_0x2028('0x35')]);_0x51cae2['where']=qs[_0x2028('0x2e')](_[_0x2028('0x36')](_0x403ae2[_0x2028('0x2c')],_0x11e3e8[_0x2028('0x2e')]),_0x57ad34);if(_0x403ae2[_0x2028('0x2c')][_0x2028('0x37')]){_0x51cae2[_0x2028('0x38')]=_[_0x2028('0x39')](_0x51cae2['where'],{'$or':_[_0x2028('0x25')](_0x57ad34,function(_0x2d912e){if(_0x2d912e[_0x2028('0x29')]!==_0x2028('0x3a')){var _0x261210={};_0x261210[_0x2d912e[_0x2028('0x23')]]={'$like':'%'+_0x403ae2['query'][_0x2028('0x37')]+'%'};return _0x261210;}})});}_0x51cae2=_[_0x2028('0x39')]({},_0x51cae2,_0x403ae2[_0x2028('0x3b')]);var _0x5cac44={'where':_0x51cae2[_0x2028('0x38')]};return db[_0x2028('0x26')]['count'](_0x5cac44)[_0x2028('0x20')](function(_0x2be572){_0x4bb457['count']=_0x2be572;if(_0x403ae2[_0x2028('0x2c')][_0x2028('0x3c')]){_0x51cae2[_0x2028('0x3d')]=[{'all':!![]}];}return db[_0x2028('0x26')][_0x2028('0x3e')](_0x51cae2);})['then'](function(_0x46daf8){_0x4bb457[_0x2028('0x3f')]=_0x46daf8;return _0x4bb457;})['then'](respondWithFilteredResult(_0x585860,_0x51cae2))[_0x2028('0x40')](handleError(_0x585860,null));};exports[_0x2028('0x41')]=function(_0x377d60,_0x551998){var _0x393c6c={'raw':![],'where':{'id':_0x377d60[_0x2028('0x42')]['id']}},_0x3466b7={};_0x3466b7[_0x2028('0x2b')]=_[_0x2028('0x2d')](db[_0x2028('0x26')][_0x2028('0x27')]);_0x3466b7['query']=_[_0x2028('0x2d')](_0x377d60[_0x2028('0x2c')]);_0x3466b7['filters']=_[_0x2028('0x2f')](_0x3466b7['model'],_0x3466b7[_0x2028('0x2c')]);_0x393c6c[_0x2028('0x30')]=_[_0x2028('0x2f')](_0x3466b7[_0x2028('0x2b')],qs['fields'](_0x377d60[_0x2028('0x2c')][_0x2028('0x31')]));_0x393c6c[_0x2028('0x30')]=_0x393c6c[_0x2028('0x30')][_0x2028('0x43')]?_0x393c6c[_0x2028('0x30')]:_0x3466b7['model'];if(_0x377d60[_0x2028('0x2c')][_0x2028('0x3c')]){_0x393c6c[_0x2028('0x3d')]=[{'all':!![]}];}_0x393c6c=_[_0x2028('0x39')]({},_0x393c6c,_0x377d60[_0x2028('0x3b')]);return db['AnalyticFieldReport'][_0x2028('0x44')](_0x393c6c)[_0x2028('0x20')](handleEntityNotFound(_0x551998,null))[_0x2028('0x20')](respondWithResult(_0x551998,null))['catch'](handleError(_0x551998,null));};exports[_0x2028('0x45')]=function(_0x5728cb,_0x3ef3fc){return db[_0x2028('0x26')]['create'](_0x5728cb[_0x2028('0x46')],{})[_0x2028('0x20')](respondWithResult(_0x3ef3fc,0xc9))[_0x2028('0x40')](handleError(_0x3ef3fc,null));};exports[_0x2028('0x47')]=function(_0x265d90,_0x14b344){return db['AnalyticFieldReport']['bulkCreate'](_0x265d90['body'],{'raw':![],'individualHooks':!![]})[_0x2028('0x20')](respondWithResult(_0x14b344,0xc9))['catch'](handleError(_0x14b344,null));};exports[_0x2028('0x1f')]=function(_0x1d6794,_0x35b5d0){if(_0x1d6794['body']['id']){delete _0x1d6794[_0x2028('0x46')]['id'];}return db['AnalyticFieldReport'][_0x2028('0x44')]({'where':{'id':_0x1d6794[_0x2028('0x42')]['id']}})[_0x2028('0x20')](handleEntityNotFound(_0x35b5d0,null))[_0x2028('0x20')](saveUpdates(_0x1d6794[_0x2028('0x46')],null))[_0x2028('0x20')](respondWithResult(_0x35b5d0,null))[_0x2028('0x40')](handleError(_0x35b5d0,null));};exports['destroy']=function(_0x1d2c50,_0x1436f0){return db[_0x2028('0x26')][_0x2028('0x44')]({'where':{'id':_0x1d2c50[_0x2028('0x42')]['id']}})['then'](handleEntityNotFound(_0x1436f0,null))['then'](removeEntity(_0x1436f0,null))['catch'](handleError(_0x1436f0,null));};exports[_0x2028('0x48')]=function(_0x42bc36,_0x3d806d){return db[_0x2028('0x26')][_0x2028('0x21')]({'where':{'id':_0x42bc36[_0x2028('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3d806d,0xcc))['catch'](handleError(_0x3d806d,null));};exports[_0x2028('0x49')]=function(_0x580785,_0x411ced,_0x14a6a3){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x580785['params']['id']}})[_0x2028('0x20')](handleEntityNotFound(_0x411ced,null))[_0x2028('0x20')](function(_0x4b685d){if(_0x4b685d){return db['sequelize'][_0x2028('0x4a')](function(_0x1a8367){return db[_0x2028('0x26')][_0x2028('0x21')]({'where':{'CustomReportId':_0x580785[_0x2028('0x42')]['id']},'transaction':_0x1a8367})[_0x2028('0x20')](function(_0x3623e9){var _0x4e0c7a=_[_0x2028('0x25')](_0x580785[_0x2028('0x46')],function(_0xb51771){delete _0xb51771['id'];_0xb51771[_0x2028('0x4b')]=_0x580785[_0x2028('0x42')]['id'];return _0xb51771;});return db['AnalyticFieldReport'][_0x2028('0x47')](_0x4e0c7a,{'transaction':_0x1a8367});});})['then'](function(){return db['AnalyticFieldReport'][_0x2028('0x3e')]({'where':{'CustomReportId':_0x580785['params']['id']}});});}})[_0x2028('0x20')](respondWithResult(_0x411ced,null))['catch'](handleError(_0x411ced,null));}; \ No newline at end of file +var _0x439a=['ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','create','body','bulkCreate','find'];(function(_0x26ee60,_0x5871c8){var _0x43d418=function(_0x5649bf){while(--_0x5649bf){_0x26ee60['push'](_0x26ee60['shift']());}};_0x43d418(++_0x5871c8);}(_0x439a,0x186));var _0xa439=function(_0x33a47b,_0x25022a){_0x33a47b=_0x33a47b-0x0;var _0x3164d0=_0x439a[_0x33a47b];return _0x3164d0;};'use strict';var emlformat=require(_0xa439('0x0'));var rimraf=require(_0xa439('0x1'));var zipdir=require(_0xa439('0x2'));var jsonpatch=require(_0xa439('0x3'));var rp=require('request-promise');var moment=require(_0xa439('0x4'));var BPromise=require(_0xa439('0x5'));var Mustache=require(_0xa439('0x6'));var util=require(_0xa439('0x7'));var path=require('path');var sox=require(_0xa439('0x8'));var csv=require(_0xa439('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa439('0xa'));var _=require(_0xa439('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa439('0xc'));var toCsv=require(_0xa439('0x9'));var querystring=require(_0xa439('0xd'));var Papa=require(_0xa439('0xe'));var Redis=require('ioredis');var authService=require(_0xa439('0xf'));var qs=require(_0xa439('0x10'));var as=require(_0xa439('0x11'));var hardwareService=require(_0xa439('0x12'));var logger=require(_0xa439('0x13'))(_0xa439('0x14'));var utils=require(_0xa439('0x15'));var config=require(_0xa439('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26ce23,_0x1e99e5){_0x1e99e5=_0x1e99e5||0xcc;return function(_0x23aa51){if(_0x23aa51){return _0x26ce23[_0xa439('0x17')](_0x1e99e5);}return _0x26ce23[_0xa439('0x18')](_0x1e99e5)[_0xa439('0x19')]();};}function respondWithResult(_0x303c40,_0x510e8f){_0x510e8f=_0x510e8f||0xc8;return function(_0x5a4a83){if(_0x5a4a83){return _0x303c40[_0xa439('0x18')](_0x510e8f)[_0xa439('0x1a')](_0x5a4a83);}};}function respondWithFilteredResult(_0x45c4ec,_0x4ae5cb){return function(_0x4e35c0){if(_0x4e35c0){var _0x41be4e=typeof _0x4ae5cb['offset']===_0xa439('0x1b')&&typeof _0x4ae5cb[_0xa439('0x1c')]===_0xa439('0x1b');var _0x1909ab=_0x4e35c0['count'];var _0x42b3c1=_0x41be4e?0x0:_0x4ae5cb[_0xa439('0x1d')];var _0x285b65=_0x41be4e?_0x4e35c0[_0xa439('0x1e')]:_0x4ae5cb[_0xa439('0x1d')]+_0x4ae5cb[_0xa439('0x1c')];var _0x4e530f;if(_0x285b65>=_0x1909ab){_0x285b65=_0x1909ab;_0x4e530f=0xc8;}else{_0x4e530f=0xce;}_0x45c4ec[_0xa439('0x18')](_0x4e530f);return _0x45c4ec['set'](_0xa439('0x1f'),_0x42b3c1+'-'+_0x285b65+'/'+_0x1909ab)[_0xa439('0x1a')](_0x4e35c0);}return null;};}function patchUpdates(_0x41e404){return function(_0x5c6221){try{jsonpatch[_0xa439('0x20')](_0x5c6221,_0x41e404,!![]);}catch(_0x16250f){return BPromise[_0xa439('0x21')](_0x16250f);}return _0x5c6221[_0xa439('0x22')]();};}function saveUpdates(_0x543797,_0x4daff6){return function(_0x4ea2cd){if(_0x4ea2cd){return _0x4ea2cd[_0xa439('0x23')](_0x543797)[_0xa439('0x24')](function(_0x1a0a11){return _0x1a0a11;});}return null;};}function removeEntity(_0x13df5d,_0x3c5139){return function(_0x5cc4a8){if(_0x5cc4a8){return _0x5cc4a8[_0xa439('0x25')]()[_0xa439('0x24')](function(){_0x13df5d['status'](0xcc)[_0xa439('0x19')]();});}};}function handleEntityNotFound(_0x28a4f7,_0x415dba){return function(_0x6222dd){if(!_0x6222dd){_0x28a4f7[_0xa439('0x17')](0x194);}return _0x6222dd;};}function handleError(_0x28ee4e,_0x5acd51){_0x5acd51=_0x5acd51||0x1f4;return function(_0x5a9191){logger[_0xa439('0x26')](_0x5a9191['stack']);if(_0x5a9191[_0xa439('0x27')]){delete _0x5a9191['name'];}_0x28ee4e[_0xa439('0x18')](_0x5acd51)['send'](_0x5a9191);};}exports[_0xa439('0x28')]=function(_0x3ff4fb,_0x3348d5){var _0x53ff3b={},_0x45559b={},_0x248f3f={'count':0x0,'rows':[]};var _0x4f66aa=_[_0xa439('0x29')](db[_0xa439('0x2a')][_0xa439('0x2b')],function(_0x2cfb4f){return{'name':_0x2cfb4f[_0xa439('0x2c')],'type':_0x2cfb4f['type']['key']};});_0x45559b[_0xa439('0x2d')]=_[_0xa439('0x29')](_0x4f66aa,_0xa439('0x27'));_0x45559b[_0xa439('0x2e')]=_[_0xa439('0x2f')](_0x3ff4fb[_0xa439('0x2e')]);_0x45559b[_0xa439('0x30')]=_[_0xa439('0x31')](_0x45559b['model'],_0x45559b[_0xa439('0x2e')]);_0x53ff3b['attributes']=_['intersection'](_0x45559b[_0xa439('0x2d')],qs[_0xa439('0x32')](_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x32')]));_0x53ff3b[_0xa439('0x33')]=_0x53ff3b[_0xa439('0x33')][_0xa439('0x34')]?_0x53ff3b[_0xa439('0x33')]:_0x45559b[_0xa439('0x2d')];if(!_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x35')](_0xa439('0x36'))){_0x53ff3b['limit']=qs[_0xa439('0x1c')](_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x1c')]);_0x53ff3b[_0xa439('0x1d')]=qs['offset'](_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x1d')]);}_0x53ff3b[_0xa439('0x37')]=qs['sort'](_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x38')]);_0x53ff3b[_0xa439('0x39')]=qs['filters'](_['pick'](_0x3ff4fb[_0xa439('0x2e')],_0x45559b[_0xa439('0x30')]),_0x4f66aa);if(_0x3ff4fb[_0xa439('0x2e')][_0xa439('0x3a')]){_0x53ff3b[_0xa439('0x39')]=_[_0xa439('0x3b')](_0x53ff3b[_0xa439('0x39')],{'$or':_[_0xa439('0x29')](_0x4f66aa,function(_0x5a9872){if(_0x5a9872[_0xa439('0x3c')]!==_0xa439('0x3d')){var _0x46e51d={};_0x46e51d[_0x5a9872[_0xa439('0x27')]]={'$like':'%'+_0x3ff4fb['query'][_0xa439('0x3a')]+'%'};return _0x46e51d;}})});}_0x53ff3b=_[_0xa439('0x3b')]({},_0x53ff3b,_0x3ff4fb[_0xa439('0x3e')]);var _0x1c2f02={'where':_0x53ff3b[_0xa439('0x39')]};return db[_0xa439('0x2a')][_0xa439('0x1e')](_0x1c2f02)[_0xa439('0x24')](function(_0x475c8a){_0x248f3f[_0xa439('0x1e')]=_0x475c8a;if(_0x3ff4fb['query'][_0xa439('0x3f')]){_0x53ff3b['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa439('0x40')](_0x53ff3b);})[_0xa439('0x24')](function(_0xb5873){_0x248f3f['rows']=_0xb5873;return _0x248f3f;})[_0xa439('0x24')](respondWithFilteredResult(_0x3348d5,_0x53ff3b))[_0xa439('0x41')](handleError(_0x3348d5,null));};exports['show']=function(_0x389e45,_0xf25d9c){var _0x10af6b={'raw':![],'where':{'id':_0x389e45[_0xa439('0x42')]['id']}},_0x5736ca={};_0x5736ca[_0xa439('0x2d')]=_['keys'](db[_0xa439('0x2a')]['rawAttributes']);_0x5736ca[_0xa439('0x2e')]=_[_0xa439('0x2f')](_0x389e45[_0xa439('0x2e')]);_0x5736ca[_0xa439('0x30')]=_['intersection'](_0x5736ca[_0xa439('0x2d')],_0x5736ca[_0xa439('0x2e')]);_0x10af6b[_0xa439('0x33')]=_[_0xa439('0x31')](_0x5736ca[_0xa439('0x2d')],qs['fields'](_0x389e45['query'][_0xa439('0x32')]));_0x10af6b['attributes']=_0x10af6b[_0xa439('0x33')]['length']?_0x10af6b[_0xa439('0x33')]:_0x5736ca['model'];if(_0x389e45[_0xa439('0x2e')][_0xa439('0x3f')]){_0x10af6b[_0xa439('0x43')]=[{'all':!![]}];}_0x10af6b=_['merge']({},_0x10af6b,_0x389e45[_0xa439('0x3e')]);return db[_0xa439('0x2a')]['find'](_0x10af6b)['then'](handleEntityNotFound(_0xf25d9c,null))[_0xa439('0x24')](respondWithResult(_0xf25d9c,null))['catch'](handleError(_0xf25d9c,null));};exports[_0xa439('0x44')]=function(_0x589000,_0x50e13d){return db['AnalyticFieldReport']['create'](_0x589000[_0xa439('0x45')],{})[_0xa439('0x24')](respondWithResult(_0x50e13d,0xc9))[_0xa439('0x41')](handleError(_0x50e13d,null));};exports[_0xa439('0x46')]=function(_0x53f5f9,_0x5661cb){return db[_0xa439('0x2a')][_0xa439('0x46')](_0x53f5f9[_0xa439('0x45')],{'raw':![],'individualHooks':!![]})[_0xa439('0x24')](respondWithResult(_0x5661cb,0xc9))[_0xa439('0x41')](handleError(_0x5661cb,null));};exports['update']=function(_0xfb75f5,_0x548411){if(_0xfb75f5['body']['id']){delete _0xfb75f5[_0xa439('0x45')]['id'];}return db[_0xa439('0x2a')][_0xa439('0x47')]({'where':{'id':_0xfb75f5[_0xa439('0x42')]['id']}})['then'](handleEntityNotFound(_0x548411,null))[_0xa439('0x24')](saveUpdates(_0xfb75f5[_0xa439('0x45')],null))[_0xa439('0x24')](respondWithResult(_0x548411,null))['catch'](handleError(_0x548411,null));};exports[_0xa439('0x25')]=function(_0x25a3ad,_0x148922){return db['AnalyticFieldReport'][_0xa439('0x47')]({'where':{'id':_0x25a3ad[_0xa439('0x42')]['id']}})[_0xa439('0x24')](handleEntityNotFound(_0x148922,null))['then'](removeEntity(_0x148922,null))[_0xa439('0x41')](handleError(_0x148922,null));};exports['bulkDestroy']=function(_0x287e15,_0x3c0f01){return db[_0xa439('0x2a')][_0xa439('0x25')]({'where':{'id':_0x287e15['query'][_0xa439('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xa439('0x24')](respondWithResult(_0x3c0f01,0xcc))[_0xa439('0x41')](handleError(_0x3c0f01,null));};exports['addFields']=function(_0xedcbb7,_0x2824eb,_0xa844a3){return db[_0xa439('0x49')][_0xa439('0x4a')]({'where':{'id':_0xedcbb7[_0xa439('0x42')]['id']}})['then'](handleEntityNotFound(_0x2824eb,null))[_0xa439('0x24')](function(_0xe36b9c){if(_0xe36b9c){return db['sequelize'][_0xa439('0x4b')](function(_0x303815){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xedcbb7[_0xa439('0x42')]['id']},'transaction':_0x303815})[_0xa439('0x24')](function(_0x44a417){var _0x50d371=_[_0xa439('0x29')](_0xedcbb7['body'],function(_0x57fb32){delete _0x57fb32['id'];_0x57fb32[_0xa439('0x4c')]=_0xedcbb7[_0xa439('0x42')]['id'];return _0x57fb32;});return db['AnalyticFieldReport']['bulkCreate'](_0x50d371,{'transaction':_0x303815});});})['then'](function(){return db[_0xa439('0x2a')]['findAll']({'where':{'CustomReportId':_0xedcbb7[_0xa439('0x42')]['id']}});});}})[_0xa439('0x24')](respondWithResult(_0x2824eb,null))['catch'](handleError(_0x2824eb,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d0395ca..1e8e54a 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 _0xa77f=['define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x487d6e,_0x590ce7){var _0x3d0a2e=function(_0x4d559f){while(--_0x4d559f){_0x487d6e['push'](_0x487d6e['shift']());}};_0x3d0a2e(++_0x590ce7);}(_0xa77f,0xc7));var _0xfa77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa77f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xfa77('0x0'));var logger=require(_0xfa77('0x1'))(_0xfa77('0x2'));var moment=require(_0xfa77('0x3'));var BPromise=require(_0xfa77('0x4'));var rp=require(_0xfa77('0x5'));var fs=require('fs');var path=require(_0xfa77('0x6'));var rimraf=require(_0xfa77('0x7'));var config=require(_0xfa77('0x8'));var attributes=require(_0xfa77('0x9'));module[_0xfa77('0xa')]=function(_0x363a7f,_0x167c6c){return _0x363a7f[_0xfa77('0xb')](_0xfa77('0xc'),attributes,{'tableName':_0xfa77('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x068a=['util','api','moment','request-promise','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash'];(function(_0x22af6b,_0x3da4e8){var _0x3330ef=function(_0x5617d9){while(--_0x5617d9){_0x22af6b['push'](_0x22af6b['shift']());}};_0x3330ef(++_0x3da4e8);}(_0x068a,0xa9));var _0xa068=function(_0x40c2c7,_0x61d089){_0x40c2c7=_0x40c2c7-0x0;var _0x3b7316=_0x068a[_0x40c2c7];return _0x3b7316;};'use strict';var _=require(_0xa068('0x0'));var util=require(_0xa068('0x1'));var logger=require('../../config/logger')(_0xa068('0x2'));var moment=require(_0xa068('0x3'));var BPromise=require('bluebird');var rp=require(_0xa068('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa068('0x5'));var config=require('../../config/environment');var attributes=require(_0xa068('0x6'));module[_0xa068('0x7')]=function(_0x89636c,_0x45a738){return _0x89636c[_0xa068('0x8')](_0xa068('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 d0546f7..9ec3a00 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 _0x1041=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x1041,0x164));var _0x1104=function(_0x475be2,_0xf0639){_0x475be2=_0x475be2-0x0;var _0x4ff8b1=_0x1041[_0x475be2];return _0x4ff8b1;};'use strict';var _=require(_0x1104('0x0'));var util=require(_0x1104('0x1'));var moment=require(_0x1104('0x2'));var BPromise=require(_0x1104('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1104('0x4'));var db=require(_0x1104('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1104('0x6'))('rpc');var config=require(_0x1104('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1104('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b6d21,_0x26ed0e,_0x1dc875){return new BPromise(function(_0x14262d,_0x4be036){return client[_0x1104('0x9')](_0x3b6d21,_0x1dc875)[_0x1104('0xa')](function(_0x2d568c){logger[_0x1104('0xb')](_0x1104('0xc'),_0x26ed0e,_0x1104('0xd'));logger['debug'](_0x1104('0xe'),_0x26ed0e,_0x1104('0xd'),JSON[_0x1104('0xf')](_0x2d568c));if(_0x2d568c[_0x1104('0x10')]){if(_0x2d568c[_0x1104('0x10')][_0x1104('0x11')]===0x1f4){logger[_0x1104('0x10')](_0x1104('0xc'),_0x26ed0e,_0x2d568c['error'][_0x1104('0x12')]);return _0x4be036(_0x2d568c[_0x1104('0x10')][_0x1104('0x12')]);}logger[_0x1104('0x10')](_0x1104('0xc'),_0x26ed0e,_0x2d568c[_0x1104('0x10')][_0x1104('0x12')]);return _0x14262d(_0x2d568c['error']['message']);}else{logger['info'](_0x1104('0xc'),_0x26ed0e,_0x1104('0xd'));_0x14262d(_0x2d568c[_0x1104('0x13')][_0x1104('0x12')]);}})[_0x1104('0x14')](function(_0x50d27f){logger[_0x1104('0x10')](_0x1104('0xc'),_0x26ed0e,_0x50d27f);_0x4be036(_0x50d27f);});});} \ No newline at end of file +var _0x1f6a=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','ioredis'];(function(_0x595793,_0x5a290b){var _0x17a58c=function(_0xc0fc77){while(--_0xc0fc77){_0x595793['push'](_0x595793['shift']());}};_0x17a58c(++_0x5a290b);}(_0x1f6a,0x81));var _0xa1f6=function(_0x41b369,_0x29e21f){_0x41b369=_0x41b369-0x0;var _0x2af633=_0x1f6a[_0x41b369];return _0x2af633;};'use strict';var _=require(_0xa1f6('0x0'));var util=require(_0xa1f6('0x1'));var moment=require(_0xa1f6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1f6('0x3'));var db=require(_0xa1f6('0x4'))['db'];var utils=require(_0xa1f6('0x5'));var logger=require(_0xa1f6('0x6'))(_0xa1f6('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1f6('0x8'));var client=jayson[_0xa1f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x552d64,_0x2acd05,_0x564be1){return new BPromise(function(_0x10bca4,_0x58390d){return client['request'](_0x552d64,_0x564be1)['then'](function(_0x371591){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2acd05,_0xa1f6('0xa'));logger[_0xa1f6('0xb')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2acd05,_0xa1f6('0xa'),JSON[_0xa1f6('0xc')](_0x371591));if(_0x371591[_0xa1f6('0xd')]){if(_0x371591[_0xa1f6('0xd')][_0xa1f6('0xe')]===0x1f4){logger[_0xa1f6('0xd')](_0xa1f6('0xf'),_0x2acd05,_0x371591[_0xa1f6('0xd')][_0xa1f6('0x10')]);return _0x58390d(_0x371591['error']['message']);}logger[_0xa1f6('0xd')](_0xa1f6('0xf'),_0x2acd05,_0x371591[_0xa1f6('0xd')]['message']);return _0x10bca4(_0x371591[_0xa1f6('0xd')][_0xa1f6('0x10')]);}else{logger[_0xa1f6('0x11')](_0xa1f6('0xf'),_0x2acd05,_0xa1f6('0xa'));_0x10bca4(_0x371591['result'][_0xa1f6('0x10')]);}})[_0xa1f6('0x12')](function(_0x50ecdd){logger['error'](_0xa1f6('0xf'),_0x2acd05,_0x50ecdd);_0x58390d(_0x50ecdd);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index aba39fa..697459e 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(_0x59a18e,_0x546652){var _0x27ab29=function(_0xe47dcc){while(--_0xe47dcc){_0x59a18e['push'](_0x59a18e['shift']());}};_0x27ab29(++_0x546652);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x339775,_0xae2055){var _0x4b8b42=function(_0xa37a72){while(--_0xa37a72){_0x339775['push'](_0x339775['shift']());}};_0x4b8b42(++_0xae2055);}(_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 1a6b0ab..2e7cd0f 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 _0xc7a7=['TEXT','sequelize','exports','STRING'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0xc7a7,0x171));var _0x7c7a=function(_0x44a470,_0x118027){_0x44a470=_0x44a470-0x0;var _0x3a5d72=_0xc7a7[_0x44a470];return _0x3a5d72;};'use strict';var Sequelize=require(_0x7c7a('0x0'));module[_0x7c7a('0x1')]={'name':{'type':Sequelize[_0x7c7a('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x7c7a('0x2')]},'metric':{'type':Sequelize[_0x7c7a('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc343=['STRING','name','sequelize'];(function(_0x15b7c2,_0x46d467){var _0x3a5d5e=function(_0x14617a){while(--_0x14617a){_0x15b7c2['push'](_0x15b7c2['shift']());}};_0x3a5d5e(++_0x46d467);}(_0xc343,0x173));var _0x3c34=function(_0x480bad,_0x118d2a){_0x480bad=_0x480bad-0x0;var _0x5c694d=_0xc343[_0x480bad];return _0x5c694d;};'use strict';var Sequelize=require(_0x3c34('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c34('0x1')],'allowNull':![],'unique':_0x3c34('0x2')},'table':{'type':Sequelize[_0x3c34('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a3cc3ef..e39e5a1 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x4fcc99,_0x285125){var _0x2ca5bd=function(_0x3b006f){while(--_0x3b006f){_0x4fcc99['push'](_0x4fcc99['shift']());}};_0x2ca5bd(++_0x285125);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x5fc3[_0x1d426f];return _0x17f71a;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x6bccfa,_0x456bcb){var _0x1ad77b=function(_0x3b79ea){while(--_0x3b79ea){_0x6bccfa['push'](_0x6bccfa['shift']());}};_0x1ad77b(++_0x456bcb);}(_0xabce,0x103));var _0xeabc=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xabce[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4b7523d..1775a4a 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 _0x714c=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x714c,0x18d));var _0xc714=function(_0x11c090,_0x7d8e4e){_0x11c090=_0x11c090-0x0;var _0x444c13=_0x714c[_0x11c090];return _0x444c13;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var logger=require(_0xc714('0x1'))(_0xc714('0x2'));var moment=require(_0xc714('0x3'));var BPromise=require(_0xc714('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc714('0x5'));var rimraf=require(_0xc714('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xc714('0x7')]=function(_0xf624fc,_0x1c4a3b){return _0xf624fc[_0xc714('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb2a=['bluebird','request-promise','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb2a,0x16f));var _0xadb2=function(_0x37d10b,_0x382b7a){_0x37d10b=_0x37d10b-0x0;var _0x1fed32=_0xdb2a[_0x37d10b];return _0x1fed32;};'use strict';var _=require(_0xadb2('0x0'));var util=require(_0xadb2('0x1'));var logger=require(_0xadb2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xadb2('0x3'));var rp=require(_0xadb2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadb2('0x5'));var config=require('../../config/environment');var attributes=require(_0xadb2('0x6'));module[_0xadb2('0x7')]=function(_0x1f5c7e,_0x297e69){return _0x1f5c7e[_0xadb2('0x8')]('AnalyticMetric',attributes,{'tableName':_0xadb2('0x9'),'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 5cd4cf9..cada113 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 _0xcbed=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbed,0xc9));var _0xdcbe=function(_0x18070a,_0x2ee80a){_0x18070a=_0x18070a-0x0;var _0x20f3d0=_0xcbed[_0x18070a];return _0x20f3d0;};'use strict';var _=require(_0xdcbe('0x0'));var util=require(_0xdcbe('0x1'));var moment=require(_0xdcbe('0x2'));var BPromise=require('bluebird');var rs=require(_0xdcbe('0x3'));var fs=require('fs');var Redis=require(_0xdcbe('0x4'));var db=require(_0xdcbe('0x5'))['db'];var utils=require(_0xdcbe('0x6'));var logger=require(_0xdcbe('0x7'))(_0xdcbe('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdcbe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fea9,_0x8116dd,_0x33b8cf){return new BPromise(function(_0x319233,_0x2d78c3){return client['request'](_0x31fea9,_0x33b8cf)[_0xdcbe('0xa')](function(_0x5baf53){logger[_0xdcbe('0xb')](_0xdcbe('0xc'),_0x8116dd,'request\x20sent');logger[_0xdcbe('0xd')](_0xdcbe('0xe'),_0x8116dd,_0xdcbe('0xf'),JSON[_0xdcbe('0x10')](_0x5baf53));if(_0x5baf53[_0xdcbe('0x11')]){if(_0x5baf53['error'][_0xdcbe('0x12')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x8116dd,_0x5baf53[_0xdcbe('0x11')][_0xdcbe('0x13')]);return _0x2d78c3(_0x5baf53[_0xdcbe('0x11')][_0xdcbe('0x13')]);}logger[_0xdcbe('0x11')](_0xdcbe('0xc'),_0x8116dd,_0x5baf53['error']['message']);return _0x319233(_0x5baf53['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x8116dd,'request\x20sent');_0x319233(_0x5baf53[_0xdcbe('0x14')][_0xdcbe('0x13')]);}})[_0xdcbe('0x15')](function(_0x3f20c4){logger[_0xdcbe('0x11')](_0xdcbe('0xc'),_0x8116dd,_0x3f20c4);_0x2d78c3(_0x3f20c4);});});} \ No newline at end of file +var _0x7063=['error','code','message','AnalyticMetric,\x20%s,\x20%s','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0x7063,0x1e4));var _0x3706=function(_0x4c0bd5,_0xbdb1bf){_0x4c0bd5=_0x4c0bd5-0x0;var _0x5a55bc=_0x7063[_0x4c0bd5];return _0x5a55bc;};'use strict';var _=require(_0x3706('0x0'));var util=require(_0x3706('0x1'));var moment=require(_0x3706('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3706('0x3'))['db'];var utils=require(_0x3706('0x4'));var logger=require(_0x3706('0x5'))('rpc');var config=require(_0x3706('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3706('0x7')][_0x3706('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f015d,_0x304aa9,_0x1566ae){return new BPromise(function(_0xf13529,_0x51dc68){return client[_0x3706('0x9')](_0x3f015d,_0x1566ae)[_0x3706('0xa')](function(_0x4dcb82){logger[_0x3706('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x304aa9,_0x3706('0xc'));logger[_0x3706('0xd')](_0x3706('0xe'),_0x304aa9,_0x3706('0xc'),JSON[_0x3706('0xf')](_0x4dcb82));if(_0x4dcb82[_0x3706('0x10')]){if(_0x4dcb82['error'][_0x3706('0x11')]===0x1f4){logger[_0x3706('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x304aa9,_0x4dcb82[_0x3706('0x10')][_0x3706('0x12')]);return _0x51dc68(_0x4dcb82['error'][_0x3706('0x12')]);}logger[_0x3706('0x10')](_0x3706('0x13'),_0x304aa9,_0x4dcb82['error'][_0x3706('0x12')]);return _0xf13529(_0x4dcb82[_0x3706('0x10')][_0x3706('0x12')]);}else{logger[_0x3706('0xb')](_0x3706('0x13'),_0x304aa9,_0x3706('0xc'));_0xf13529(_0x4dcb82['result'][_0x3706('0x12')]);}})['catch'](function(_0x5f418a){logger['error'](_0x3706('0x13'),_0x304aa9,_0x5f418a);_0x51dc68(_0x5f418a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c7b01d2..8d89520 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 _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util'];(function(_0x472063,_0x11a264){var _0x17a1bf=function(_0x21f9d4){while(--_0x21f9d4){_0x472063['push'](_0x472063['shift']());}};_0x17a1bf(++_0x11a264);}(_0x814b,0x1a2));var _0xb814=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0x814b[_0x308dcc];return _0x361717;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xe')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['destroy']);module[_0xb814('0x13')]=router; \ No newline at end of file +var _0x9879=['./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x171eae,_0x3f4a62){var _0x1df649=function(_0x425767){while(--_0x425767){_0x171eae['push'](_0x171eae['shift']());}};_0x1df649(++_0x3f4a62);}(_0x9879,0x98));var _0x9987=function(_0x1bf4e8,_0x583680){_0x1bf4e8=_0x1bf4e8-0x0;var _0x4c8c3a=_0x9879[_0x1bf4e8];return _0x4c8c3a;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0xc')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0xe')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x10')]);router[_0x9987('0x11')](_0x9987('0xf'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);module[_0x9987('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ebf4ebd..0c713e6 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 _0x2639=['sequelize','exports','TEXT'];(function(_0x195e57,_0x102797){var _0x34f4fd=function(_0x42489e){while(--_0x42489e){_0x195e57['push'](_0x195e57['shift']());}};_0x34f4fd(++_0x102797);}(_0x2639,0xd5));var _0x9263=function(_0x1acf8f,_0x124105){_0x1acf8f=_0x1acf8f-0x0;var _0x458b6a=_0x2639[_0x1acf8f];return _0x458b6a;};'use strict';var Sequelize=require(_0x9263('0x0'));module[_0x9263('0x1')]={'tree':{'type':Sequelize[_0x9263('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe8e0=['exports','TEXT','sequelize'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xe8e0,0xb9));var _0x0e8e=function(_0x3577d0,_0x25dc65){_0x3577d0=_0x3577d0-0x0;var _0x5aecd1=_0xe8e0[_0x3577d0];return _0x5aecd1;};'use strict';var Sequelize=require(_0x0e8e('0x0'));module[_0x0e8e('0x1')]={'tree':{'type':Sequelize[_0x0e8e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index eb00599..2e1cc8c 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 _0x5a92=['send','index','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filter','merge','where','map','VIRTUAL','options','count','include','AnalyticTreeReport','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','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','offset','set','Content-Range','apply','then','destroy','error','stack'];(function(_0x4f37d6,_0x455d45){var _0x333b31=function(_0x4ee89e){while(--_0x4ee89e){_0x4f37d6['push'](_0x4f37d6['shift']());}};_0x333b31(++_0x455d45);}(_0x5a92,0x1ab));var _0x25a9=function(_0x352274,_0x357438){_0x352274=_0x352274-0x0;var _0x1d3e8a=_0x5a92[_0x352274];return _0x1d3e8a;};'use strict';var emlformat=require(_0x25a9('0x0'));var rimraf=require(_0x25a9('0x1'));var zipdir=require(_0x25a9('0x2'));var jsonpatch=require(_0x25a9('0x3'));var rp=require(_0x25a9('0x4'));var moment=require(_0x25a9('0x5'));var BPromise=require(_0x25a9('0x6'));var Mustache=require(_0x25a9('0x7'));var util=require(_0x25a9('0x8'));var path=require(_0x25a9('0x9'));var sox=require(_0x25a9('0xa'));var csv=require(_0x25a9('0xb'));var ejs=require(_0x25a9('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25a9('0xd'));var squel=require('squel');var crypto=require(_0x25a9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x25a9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x25a9('0x10'));var Papa=require(_0x25a9('0x11'));var Redis=require(_0x25a9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x25a9('0x13'));var as=require(_0x25a9('0x14'));var hardwareService=require(_0x25a9('0x15'));var logger=require(_0x25a9('0x16'))('api');var utils=require(_0x25a9('0x17'));var config=require(_0x25a9('0x18'));var licenseUtil=require(_0x25a9('0x19'));var db=require(_0x25a9('0x1a'))['db'];function respondWithStatusCode(_0x10f213,_0xd15536){_0xd15536=_0xd15536||0xcc;return function(_0x13a5e5){if(_0x13a5e5){return _0x10f213[_0x25a9('0x1b')](_0xd15536);}return _0x10f213[_0x25a9('0x1c')](_0xd15536)[_0x25a9('0x1d')]();};}function respondWithResult(_0x1aa78b,_0x5e4c86){_0x5e4c86=_0x5e4c86||0xc8;return function(_0x4962af){if(_0x4962af){return _0x1aa78b[_0x25a9('0x1c')](_0x5e4c86)[_0x25a9('0x1e')](_0x4962af);}};}function respondWithFilteredResult(_0x57450c,_0x3ccce5){return function(_0x440ad0){if(_0x440ad0){var _0xfe8a96=typeof _0x3ccce5['offset']===_0x25a9('0x1f')&&typeof _0x3ccce5[_0x25a9('0x20')]==='undefined';var _0x43408c=_0x440ad0['count'];var _0x5f1880=_0xfe8a96?0x0:_0x3ccce5[_0x25a9('0x21')];var _0x3a69da=_0xfe8a96?_0x440ad0['count']:_0x3ccce5[_0x25a9('0x21')]+_0x3ccce5[_0x25a9('0x20')];var _0x1efc2b;if(_0x3a69da>=_0x43408c){_0x3a69da=_0x43408c;_0x1efc2b=0xc8;}else{_0x1efc2b=0xce;}_0x57450c['status'](_0x1efc2b);return _0x57450c[_0x25a9('0x22')](_0x25a9('0x23'),_0x5f1880+'-'+_0x3a69da+'/'+_0x43408c)[_0x25a9('0x1e')](_0x440ad0);}return null;};}function patchUpdates(_0x2c9208){return function(_0x7d281f){try{jsonpatch[_0x25a9('0x24')](_0x7d281f,_0x2c9208,!![]);}catch(_0xcf43f2){return BPromise['reject'](_0xcf43f2);}return _0x7d281f['save']();};}function saveUpdates(_0x5732e5,_0x2b5720){return function(_0x20a4c4){if(_0x20a4c4){return _0x20a4c4['update'](_0x5732e5)[_0x25a9('0x25')](function(_0x31927a){return _0x31927a;});}return null;};}function removeEntity(_0x5c1462,_0x11d2d6){return function(_0x189a20){if(_0x189a20){return _0x189a20[_0x25a9('0x26')]()[_0x25a9('0x25')](function(){_0x5c1462[_0x25a9('0x1c')](0xcc)[_0x25a9('0x1d')]();});}};}function handleEntityNotFound(_0x2610d6,_0x511007){return function(_0x29727c){if(!_0x29727c){_0x2610d6[_0x25a9('0x1b')](0x194);}return _0x29727c;};}function handleError(_0x26d178,_0x1b5f3e){_0x1b5f3e=_0x1b5f3e||0x1f4;return function(_0x191a52){logger[_0x25a9('0x27')](_0x191a52[_0x25a9('0x28')]);if(_0x191a52['name']){delete _0x191a52['name'];}_0x26d178[_0x25a9('0x1c')](_0x1b5f3e)[_0x25a9('0x29')](_0x191a52);};}exports[_0x25a9('0x2a')]=function(_0x30ca01,_0x35675a){var _0x3c0c85={},_0x500d0={},_0x40dd96={'count':0x0,'rows':[]};var _0xbd160=_['map'](db['AnalyticTreeReport'][_0x25a9('0x2b')],function(_0x294bf7){return{'name':_0x294bf7[_0x25a9('0x2c')],'type':_0x294bf7[_0x25a9('0x2d')][_0x25a9('0x2e')]};});_0x500d0['model']=_['map'](_0xbd160,_0x25a9('0x2f'));_0x500d0[_0x25a9('0x30')]=_['keys'](_0x30ca01[_0x25a9('0x30')]);_0x500d0[_0x25a9('0x31')]=_[_0x25a9('0x32')](_0x500d0[_0x25a9('0x33')],_0x500d0[_0x25a9('0x30')]);_0x3c0c85[_0x25a9('0x34')]=_[_0x25a9('0x32')](_0x500d0[_0x25a9('0x33')],qs[_0x25a9('0x35')](_0x30ca01[_0x25a9('0x30')][_0x25a9('0x35')]));_0x3c0c85[_0x25a9('0x34')]=_0x3c0c85[_0x25a9('0x34')]['length']?_0x3c0c85['attributes']:_0x500d0['model'];if(!_0x30ca01['query'][_0x25a9('0x36')]('nolimit')){_0x3c0c85[_0x25a9('0x20')]=qs['limit'](_0x30ca01[_0x25a9('0x30')]['limit']);_0x3c0c85[_0x25a9('0x21')]=qs[_0x25a9('0x21')](_0x30ca01['query']['offset']);}_0x3c0c85['order']=qs[_0x25a9('0x37')](_0x30ca01[_0x25a9('0x30')][_0x25a9('0x37')]);_0x3c0c85['where']=qs[_0x25a9('0x31')](_[_0x25a9('0x38')](_0x30ca01[_0x25a9('0x30')],_0x500d0['filters']),_0xbd160);if(_0x30ca01[_0x25a9('0x30')][_0x25a9('0x39')]){_0x3c0c85['where']=_[_0x25a9('0x3a')](_0x3c0c85[_0x25a9('0x3b')],{'$or':_[_0x25a9('0x3c')](_0xbd160,function(_0x53eb8c){if(_0x53eb8c['type']!==_0x25a9('0x3d')){var _0x40b3a7={};_0x40b3a7[_0x53eb8c[_0x25a9('0x2f')]]={'$like':'%'+_0x30ca01[_0x25a9('0x30')]['filter']+'%'};return _0x40b3a7;}})});}_0x3c0c85=_[_0x25a9('0x3a')]({},_0x3c0c85,_0x30ca01[_0x25a9('0x3e')]);var _0x5ded69={'where':_0x3c0c85[_0x25a9('0x3b')]};return db['AnalyticTreeReport'][_0x25a9('0x3f')](_0x5ded69)[_0x25a9('0x25')](function(_0xd3b854){_0x40dd96[_0x25a9('0x3f')]=_0xd3b854;if(_0x30ca01[_0x25a9('0x30')]['includeAll']){_0x3c0c85[_0x25a9('0x40')]=[{'all':!![]}];}return db[_0x25a9('0x41')][_0x25a9('0x42')](_0x3c0c85);})[_0x25a9('0x25')](function(_0x3a85c5){_0x40dd96[_0x25a9('0x43')]=_0x3a85c5;return _0x40dd96;})[_0x25a9('0x25')](respondWithFilteredResult(_0x35675a,_0x3c0c85))[_0x25a9('0x44')](handleError(_0x35675a,null));};exports[_0x25a9('0x45')]=function(_0x1bb287,_0x177fac){var _0x5cdda1={'raw':!![],'where':{'id':_0x1bb287[_0x25a9('0x46')]['id']}},_0xe2518f={};_0xe2518f['model']=_[_0x25a9('0x47')](db[_0x25a9('0x41')][_0x25a9('0x2b')]);_0xe2518f[_0x25a9('0x30')]=_['keys'](_0x1bb287[_0x25a9('0x30')]);_0xe2518f[_0x25a9('0x31')]=_[_0x25a9('0x32')](_0xe2518f[_0x25a9('0x33')],_0xe2518f[_0x25a9('0x30')]);_0x5cdda1[_0x25a9('0x34')]=_[_0x25a9('0x32')](_0xe2518f[_0x25a9('0x33')],qs[_0x25a9('0x35')](_0x1bb287[_0x25a9('0x30')]['fields']));_0x5cdda1[_0x25a9('0x34')]=_0x5cdda1[_0x25a9('0x34')][_0x25a9('0x48')]?_0x5cdda1[_0x25a9('0x34')]:_0xe2518f[_0x25a9('0x33')];if(_0x1bb287['query'][_0x25a9('0x49')]){_0x5cdda1['include']=[{'all':!![]}];}_0x5cdda1=_[_0x25a9('0x3a')]({},_0x5cdda1,_0x1bb287[_0x25a9('0x3e')]);return db['AnalyticTreeReport'][_0x25a9('0x4a')](_0x5cdda1)[_0x25a9('0x25')](handleEntityNotFound(_0x177fac,null))[_0x25a9('0x25')](respondWithResult(_0x177fac,null))[_0x25a9('0x44')](handleError(_0x177fac,null));};exports['create']=function(_0x5eade1,_0x2240d3){return db['AnalyticTreeReport'][_0x25a9('0x4b')](_0x5eade1[_0x25a9('0x4c')],{})[_0x25a9('0x25')](respondWithResult(_0x2240d3,0xc9))['catch'](handleError(_0x2240d3,null));};exports[_0x25a9('0x4d')]=function(_0x353971,_0x5ab790){if(_0x353971[_0x25a9('0x4c')]['id']){delete _0x353971[_0x25a9('0x4c')]['id'];}return db[_0x25a9('0x41')][_0x25a9('0x4a')]({'where':{'id':_0x353971[_0x25a9('0x46')]['id']}})[_0x25a9('0x25')](handleEntityNotFound(_0x5ab790,null))[_0x25a9('0x25')](saveUpdates(_0x353971['body'],null))[_0x25a9('0x25')](respondWithResult(_0x5ab790,null))['catch'](handleError(_0x5ab790,null));};exports[_0x25a9('0x26')]=function(_0xba3cae,_0x3354c6){return db[_0x25a9('0x41')][_0x25a9('0x4a')]({'where':{'id':_0xba3cae[_0x25a9('0x46')]['id']}})[_0x25a9('0x25')](handleEntityNotFound(_0x3354c6,null))[_0x25a9('0x25')](removeEntity(_0x3354c6,null))[_0x25a9('0x44')](handleError(_0x3354c6,null));}; \ No newline at end of file +var _0x713a=['rows','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','include','findAll'];(function(_0x5c9b36,_0x120079){var _0x47e999=function(_0x33d1ce){while(--_0x33d1ce){_0x5c9b36['push'](_0x5c9b36['shift']());}};_0x47e999(++_0x120079);}(_0x713a,0x97));var _0xa713=function(_0x1f2a53,_0x2d5da9){_0x1f2a53=_0x1f2a53-0x0;var _0x38b369=_0x713a[_0x1f2a53];return _0x38b369;};'use strict';var emlformat=require(_0xa713('0x0'));var rimraf=require(_0xa713('0x1'));var zipdir=require(_0xa713('0x2'));var jsonpatch=require(_0xa713('0x3'));var rp=require(_0xa713('0x4'));var moment=require(_0xa713('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa713('0x6'));var util=require(_0xa713('0x7'));var path=require(_0xa713('0x8'));var sox=require(_0xa713('0x9'));var csv=require(_0xa713('0xa'));var ejs=require(_0xa713('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa713('0xc'));var squel=require(_0xa713('0xd'));var crypto=require(_0xa713('0xe'));var jsforce=require(_0xa713('0xf'));var deskjs=require(_0xa713('0x10'));var toCsv=require(_0xa713('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa713('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa713('0x12'));var as=require(_0xa713('0x13'));var hardwareService=require(_0xa713('0x14'));var logger=require(_0xa713('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa713('0x16'));var db=require(_0xa713('0x17'))['db'];function respondWithStatusCode(_0x393405,_0x48047e){_0x48047e=_0x48047e||0xcc;return function(_0x529b8b){if(_0x529b8b){return _0x393405['sendStatus'](_0x48047e);}return _0x393405['status'](_0x48047e)['end']();};}function respondWithResult(_0x452316,_0x485162){_0x485162=_0x485162||0xc8;return function(_0x3aad71){if(_0x3aad71){return _0x452316[_0xa713('0x18')](_0x485162)['json'](_0x3aad71);}};}function respondWithFilteredResult(_0x36ba3,_0x416e9a){return function(_0x318bb1){if(_0x318bb1){var _0x4b023a=typeof _0x416e9a['offset']===_0xa713('0x19')&&typeof _0x416e9a[_0xa713('0x1a')]===_0xa713('0x19');var _0x170c40=_0x318bb1[_0xa713('0x1b')];var _0x3ffe93=_0x4b023a?0x0:_0x416e9a[_0xa713('0x1c')];var _0xd023d6=_0x4b023a?_0x318bb1[_0xa713('0x1b')]:_0x416e9a[_0xa713('0x1c')]+_0x416e9a[_0xa713('0x1a')];var _0x5b5437;if(_0xd023d6>=_0x170c40){_0xd023d6=_0x170c40;_0x5b5437=0xc8;}else{_0x5b5437=0xce;}_0x36ba3['status'](_0x5b5437);return _0x36ba3[_0xa713('0x1d')](_0xa713('0x1e'),_0x3ffe93+'-'+_0xd023d6+'/'+_0x170c40)[_0xa713('0x1f')](_0x318bb1);}return null;};}function patchUpdates(_0x5ce956){return function(_0x477fa1){try{jsonpatch['apply'](_0x477fa1,_0x5ce956,!![]);}catch(_0x34cb31){return BPromise[_0xa713('0x20')](_0x34cb31);}return _0x477fa1['save']();};}function saveUpdates(_0x55d068,_0x1c5382){return function(_0x3ca165){if(_0x3ca165){return _0x3ca165[_0xa713('0x21')](_0x55d068)[_0xa713('0x22')](function(_0x146277){return _0x146277;});}return null;};}function removeEntity(_0x5308b9,_0x1dbb09){return function(_0x3d1239){if(_0x3d1239){return _0x3d1239['destroy']()[_0xa713('0x22')](function(){_0x5308b9[_0xa713('0x18')](0xcc)[_0xa713('0x23')]();});}};}function handleEntityNotFound(_0x25bf6e,_0x406d8c){return function(_0x15f9bb){if(!_0x15f9bb){_0x25bf6e[_0xa713('0x24')](0x194);}return _0x15f9bb;};}function handleError(_0x44f7f1,_0x3d4ffe){_0x3d4ffe=_0x3d4ffe||0x1f4;return function(_0x466ef3){logger[_0xa713('0x25')](_0x466ef3[_0xa713('0x26')]);if(_0x466ef3[_0xa713('0x27')]){delete _0x466ef3[_0xa713('0x27')];}_0x44f7f1[_0xa713('0x18')](_0x3d4ffe)[_0xa713('0x28')](_0x466ef3);};}exports[_0xa713('0x29')]=function(_0x12d967,_0x543ab8){var _0x4c582d={},_0x158f68={},_0x6c2e96={'count':0x0,'rows':[]};var _0x51ee13=_[_0xa713('0x2a')](db[_0xa713('0x2b')][_0xa713('0x2c')],function(_0x2388bd){return{'name':_0x2388bd[_0xa713('0x2d')],'type':_0x2388bd['type'][_0xa713('0x2e')]};});_0x158f68[_0xa713('0x2f')]=_[_0xa713('0x2a')](_0x51ee13,_0xa713('0x27'));_0x158f68[_0xa713('0x30')]=_[_0xa713('0x31')](_0x12d967['query']);_0x158f68[_0xa713('0x32')]=_[_0xa713('0x33')](_0x158f68[_0xa713('0x2f')],_0x158f68['query']);_0x4c582d[_0xa713('0x34')]=_[_0xa713('0x33')](_0x158f68[_0xa713('0x2f')],qs[_0xa713('0x35')](_0x12d967[_0xa713('0x30')][_0xa713('0x35')]));_0x4c582d[_0xa713('0x34')]=_0x4c582d[_0xa713('0x34')][_0xa713('0x36')]?_0x4c582d[_0xa713('0x34')]:_0x158f68[_0xa713('0x2f')];if(!_0x12d967[_0xa713('0x30')][_0xa713('0x37')](_0xa713('0x38'))){_0x4c582d[_0xa713('0x1a')]=qs[_0xa713('0x1a')](_0x12d967[_0xa713('0x30')][_0xa713('0x1a')]);_0x4c582d[_0xa713('0x1c')]=qs[_0xa713('0x1c')](_0x12d967[_0xa713('0x30')][_0xa713('0x1c')]);}_0x4c582d['order']=qs['sort'](_0x12d967['query']['sort']);_0x4c582d[_0xa713('0x39')]=qs[_0xa713('0x32')](_[_0xa713('0x3a')](_0x12d967[_0xa713('0x30')],_0x158f68[_0xa713('0x32')]),_0x51ee13);if(_0x12d967['query'][_0xa713('0x3b')]){_0x4c582d[_0xa713('0x39')]=_[_0xa713('0x3c')](_0x4c582d[_0xa713('0x39')],{'$or':_['map'](_0x51ee13,function(_0x24d9ae){if(_0x24d9ae[_0xa713('0x3d')]!=='VIRTUAL'){var _0x3ea209={};_0x3ea209[_0x24d9ae[_0xa713('0x27')]]={'$like':'%'+_0x12d967[_0xa713('0x30')][_0xa713('0x3b')]+'%'};return _0x3ea209;}})});}_0x4c582d=_[_0xa713('0x3c')]({},_0x4c582d,_0x12d967[_0xa713('0x3e')]);var _0x58b2e2={'where':_0x4c582d[_0xa713('0x39')]};return db['AnalyticTreeReport'][_0xa713('0x1b')](_0x58b2e2)[_0xa713('0x22')](function(_0x15b078){_0x6c2e96[_0xa713('0x1b')]=_0x15b078;if(_0x12d967[_0xa713('0x30')]['includeAll']){_0x4c582d[_0xa713('0x3f')]=[{'all':!![]}];}return db[_0xa713('0x2b')][_0xa713('0x40')](_0x4c582d);})[_0xa713('0x22')](function(_0x2fd2d6){_0x6c2e96[_0xa713('0x41')]=_0x2fd2d6;return _0x6c2e96;})[_0xa713('0x22')](respondWithFilteredResult(_0x543ab8,_0x4c582d))['catch'](handleError(_0x543ab8,null));};exports['show']=function(_0xd6c972,_0x5832f0){var _0x1f31f6={'raw':!![],'where':{'id':_0xd6c972[_0xa713('0x42')]['id']}},_0x1f7f6f={};_0x1f7f6f[_0xa713('0x2f')]=_[_0xa713('0x31')](db[_0xa713('0x2b')][_0xa713('0x2c')]);_0x1f7f6f['query']=_['keys'](_0xd6c972[_0xa713('0x30')]);_0x1f7f6f[_0xa713('0x32')]=_[_0xa713('0x33')](_0x1f7f6f[_0xa713('0x2f')],_0x1f7f6f[_0xa713('0x30')]);_0x1f31f6[_0xa713('0x34')]=_[_0xa713('0x33')](_0x1f7f6f['model'],qs['fields'](_0xd6c972[_0xa713('0x30')][_0xa713('0x35')]));_0x1f31f6['attributes']=_0x1f31f6['attributes']['length']?_0x1f31f6[_0xa713('0x34')]:_0x1f7f6f['model'];if(_0xd6c972[_0xa713('0x30')][_0xa713('0x43')]){_0x1f31f6[_0xa713('0x3f')]=[{'all':!![]}];}_0x1f31f6=_[_0xa713('0x3c')]({},_0x1f31f6,_0xd6c972[_0xa713('0x3e')]);return db['AnalyticTreeReport'][_0xa713('0x44')](_0x1f31f6)[_0xa713('0x22')](handleEntityNotFound(_0x5832f0,null))[_0xa713('0x22')](respondWithResult(_0x5832f0,null))[_0xa713('0x45')](handleError(_0x5832f0,null));};exports[_0xa713('0x46')]=function(_0x21fea8,_0x400079){return db[_0xa713('0x2b')][_0xa713('0x46')](_0x21fea8[_0xa713('0x47')],{})[_0xa713('0x22')](respondWithResult(_0x400079,0xc9))[_0xa713('0x45')](handleError(_0x400079,null));};exports['update']=function(_0x3b3874,_0x3ce607){if(_0x3b3874[_0xa713('0x47')]['id']){delete _0x3b3874[_0xa713('0x47')]['id'];}return db[_0xa713('0x2b')][_0xa713('0x44')]({'where':{'id':_0x3b3874['params']['id']}})['then'](handleEntityNotFound(_0x3ce607,null))[_0xa713('0x22')](saveUpdates(_0x3b3874['body'],null))['then'](respondWithResult(_0x3ce607,null))[_0xa713('0x45')](handleError(_0x3ce607,null));};exports['destroy']=function(_0x14473d,_0x26791b){return db[_0xa713('0x2b')][_0xa713('0x44')]({'where':{'id':_0x14473d[_0xa713('0x42')]['id']}})[_0xa713('0x22')](handleEntityNotFound(_0x26791b,null))[_0xa713('0x22')](removeEntity(_0x26791b,null))['catch'](handleError(_0x26791b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 1d96d67..3969a41 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 _0xc4e7=['../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','util','moment','bluebird','request-promise','path','rimraf'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xc4e7,0x9f));var _0x7c4e=function(_0x2d753a,_0x50cf79){_0x2d753a=_0x2d753a-0x0;var _0x2bd3a6=_0xc4e7[_0x2d753a];return _0x2bd3a6;};'use strict';var _=require('lodash');var util=require(_0x7c4e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7c4e('0x1'));var BPromise=require(_0x7c4e('0x2'));var rp=require(_0x7c4e('0x3'));var fs=require('fs');var path=require(_0x7c4e('0x4'));var rimraf=require(_0x7c4e('0x5'));var config=require(_0x7c4e('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0x7c4e('0x7')]=function(_0x12978d,_0x1a37fb){return _0x12978d[_0x7c4e('0x8')](_0x7c4e('0x9'),attributes,{'tableName':_0x7c4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f1f=['analytics_report_trees','lodash','moment','bluebird','request-promise','rimraf','AnalyticTreeReport'];(function(_0x334599,_0x4b1cfa){var _0x4cdff2=function(_0x297be7){while(--_0x297be7){_0x334599['push'](_0x334599['shift']());}};_0x4cdff2(++_0x4b1cfa);}(_0x0f1f,0x1eb));var _0xf0f1=function(_0x401100,_0x55fd7d){_0x401100=_0x401100-0x0;var _0xaeb83e=_0x0f1f[_0x401100];return _0xaeb83e;};'use strict';var _=require(_0xf0f1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf0f1('0x1'));var BPromise=require(_0xf0f1('0x2'));var rp=require(_0xf0f1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0f1('0x4'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0xebb531,_0x51abd0){return _0xebb531['define'](_0xf0f1('0x5'),attributes,{'tableName':_0xf0f1('0x6'),'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 bd526a5..a102ba7 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x2aeadc,_0x48f2d6){var _0x34ea3f=function(_0xba0971){while(--_0xba0971){_0x2aeadc['push'](_0x2aeadc['shift']());}};_0x34ea3f(++_0x48f2d6);}(_0xdb28,0x106));var _0x8db2=function(_0x3db842,_0x181671){_0x3db842=_0x3db842-0x0;var _0x3a1674=_0xdb28[_0x3db842];return _0x3a1674;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3c7056,_0x4fc530){var _0x4f9b36=function(_0x108f78){while(--_0x108f78){_0x3c7056['push'](_0x3c7056['shift']());}};_0x4f9b36(++_0x4fc530);}(_0x2ef3,0xba));var _0x32ef=function(_0x3efc38,_0x4a1948){_0x3efc38=_0x3efc38-0x0;var _0x57df80=_0x2ef3[_0x3efc38];return _0x57df80;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 1576f5f..7e981e7 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 _0x1038=['./analyticTreeReport.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x500896,_0x39a5ed){var _0x2a3c21=function(_0x21e2f8){while(--_0x21e2f8){_0x500896['push'](_0x500896['shift']());}};_0x2a3c21(++_0x39a5ed);}(_0x1038,0x1d4));var _0x8103=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x1038[_0x1399d6];return _0x4a9db4;};'use strict';var multer=require(_0x8103('0x0'));var util=require('util');var path=require(_0x8103('0x1'));var timeout=require(_0x8103('0x2'));var express=require(_0x8103('0x3'));var router=express[_0x8103('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8103('0x5'));var interaction=require(_0x8103('0x6'));var config=require(_0x8103('0x7'));var controller=require(_0x8103('0x8'));router['get']('/',auth[_0x8103('0x9')](),controller['index']);router[_0x8103('0xa')](_0x8103('0xb'),auth[_0x8103('0x9')](),controller[_0x8103('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8103('0xd')]);router[_0x8103('0xe')]('/:id',auth[_0x8103('0x9')](),controller['update']);router[_0x8103('0xf')]('/:id',auth[_0x8103('0x9')](),controller[_0x8103('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6de2=['fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x10dbab,_0x2e8174){var _0x408bfe=function(_0x4bca15){while(--_0x4bca15){_0x10dbab['push'](_0x10dbab['shift']());}};_0x408bfe(++_0x2e8174);}(_0x6de2,0xd3));var _0x26de=function(_0xbc1e06,_0xec7fb0){_0xbc1e06=_0xbc1e06-0x0;var _0x5e2079=_0x6de2[_0xbc1e06];return _0x5e2079;};'use strict';var multer=require(_0x26de('0x0'));var util=require('util');var path=require(_0x26de('0x1'));var timeout=require(_0x26de('0x2'));var express=require(_0x26de('0x3'));var router=express[_0x26de('0x4')]();var fs_extra=require(_0x26de('0x5'));var auth=require(_0x26de('0x6'));var interaction=require(_0x26de('0x7'));var config=require('../../config/environment');var controller=require(_0x26de('0x8'));router[_0x26de('0x9')]('/',auth[_0x26de('0xa')](),controller['index']);router[_0x26de('0x9')](_0x26de('0xb'),auth[_0x26de('0xa')](),controller['show']);router[_0x26de('0xc')]('/',auth[_0x26de('0xa')](),controller[_0x26de('0xd')]);router[_0x26de('0xe')](_0x26de('0xb'),auth['isAuthenticated'](),controller[_0x26de('0xf')]);router[_0x26de('0x10')](_0x26de('0xb'),auth[_0x26de('0xa')](),controller['destroy']);module[_0x26de('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 4d21015..a9d1c39 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 _0x0851=['sequelize','exports','STRING'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x0851,0x8a));var _0x1085=function(_0x43db86,_0x34184b){_0x43db86=_0x43db86-0x0;var _0x27bda2=_0x0851[_0x43db86];return _0x27bda2;};'use strict';var Sequelize=require(_0x1085('0x0'));module[_0x1085('0x1')]={'name':{'type':Sequelize[_0x1085('0x2')]},'basename':{'type':Sequelize[_0x1085('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65f4=['STRING'];(function(_0x59cafe,_0x5a930b){var _0x378c62=function(_0x4d41e8){while(--_0x4d41e8){_0x59cafe['push'](_0x59cafe['shift']());}};_0x378c62(++_0x5a930b);}(_0x65f4,0x19a));var _0x465f=function(_0x13f25a,_0x429fad){_0x13f25a=_0x13f25a-0x0;var _0xd22b3e=_0x65f4[_0x13f25a];return _0xd22b3e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x465f('0x0')]},'basename':{'type':Sequelize[_0x465f('0x0')]},'type':{'type':Sequelize[_0x465f('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d0e69be..ef8c3e0 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 _0x81e2=['update','then','error','stack','name','index','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','rawAttributes','find','catch','clone','params','omit','createdAt','body','updatedAt','create','destroy','originalname','basename','file','filename','download','findOne','root','server/files/attachments/','join','offline-chat/','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x81e2,0x8e));var _0x281e=function(_0x599d71,_0x5d1b02){_0x599d71=_0x599d71-0x0;var _0x1152d2=_0x81e2[_0x599d71];return _0x1152d2;};'use strict';var emlformat=require(_0x281e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x281e('0x1'));var rp=require(_0x281e('0x2'));var moment=require(_0x281e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x281e('0x4'));var util=require(_0x281e('0x5'));var path=require(_0x281e('0x6'));var sox=require(_0x281e('0x7'));var csv=require(_0x281e('0x8'));var ejs=require(_0x281e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x281e('0xa'));var squel=require(_0x281e('0xb'));var crypto=require(_0x281e('0xc'));var jsforce=require(_0x281e('0xd'));var deskjs=require(_0x281e('0xe'));var toCsv=require(_0x281e('0x8'));var querystring=require(_0x281e('0xf'));var Papa=require('papaparse');var Redis=require(_0x281e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x281e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x281e('0x12'));var logger=require(_0x281e('0x13'))(_0x281e('0x14'));var utils=require(_0x281e('0x15'));var config=require(_0x281e('0x16'));var licenseUtil=require(_0x281e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20aaa2,_0x42133d){_0x42133d=_0x42133d||0xcc;return function(_0x8dc274){if(_0x8dc274){return _0x20aaa2[_0x281e('0x18')](_0x42133d);}return _0x20aaa2[_0x281e('0x19')](_0x42133d)[_0x281e('0x1a')]();};}function respondWithResult(_0x177f1f,_0x27a290){_0x27a290=_0x27a290||0xc8;return function(_0x314b2e){if(_0x314b2e){return _0x177f1f[_0x281e('0x19')](_0x27a290)[_0x281e('0x1b')](_0x314b2e);}};}function respondWithFilteredResult(_0x334981,_0x1b468d){return function(_0x1a7abe){if(_0x1a7abe){var _0x33895b=typeof _0x1b468d['offset']===_0x281e('0x1c')&&typeof _0x1b468d[_0x281e('0x1d')]==='undefined';var _0x2bfb4e=_0x1a7abe[_0x281e('0x1e')];var _0xfc3663=_0x33895b?0x0:_0x1b468d['offset'];var _0x4b9cf0=_0x33895b?_0x1a7abe[_0x281e('0x1e')]:_0x1b468d[_0x281e('0x1f')]+_0x1b468d['limit'];var _0xdb8d38;if(_0x4b9cf0>=_0x2bfb4e){_0x4b9cf0=_0x2bfb4e;_0xdb8d38=0xc8;}else{_0xdb8d38=0xce;}_0x334981[_0x281e('0x19')](_0xdb8d38);return _0x334981[_0x281e('0x20')]('Content-Range',_0xfc3663+'-'+_0x4b9cf0+'/'+_0x2bfb4e)['json'](_0x1a7abe);}return null;};}function patchUpdates(_0xfcad21){return function(_0x2bfac3){try{jsonpatch[_0x281e('0x21')](_0x2bfac3,_0xfcad21,!![]);}catch(_0x1c787c){return BPromise[_0x281e('0x22')](_0x1c787c);}return _0x2bfac3[_0x281e('0x23')]();};}function saveUpdates(_0x8c4cfd,_0x492973){return function(_0xfc6815){if(_0xfc6815){return _0xfc6815[_0x281e('0x24')](_0x8c4cfd)[_0x281e('0x25')](function(_0x1a8c12){return _0x1a8c12;});}return null;};}function removeEntity(_0x5965bb,_0x2ee2b7){return function(_0x3a9f17){if(_0x3a9f17){return _0x3a9f17['destroy']()[_0x281e('0x25')](function(){_0x5965bb[_0x281e('0x19')](0xcc)[_0x281e('0x1a')]();});}};}function handleEntityNotFound(_0xbd1add,_0x52a874){return function(_0x500498){if(!_0x500498){_0xbd1add[_0x281e('0x18')](0x194);}return _0x500498;};}function handleError(_0x49dc9f,_0x1592ac){_0x1592ac=_0x1592ac||0x1f4;return function(_0x46045b){logger[_0x281e('0x26')](_0x46045b[_0x281e('0x27')]);if(_0x46045b[_0x281e('0x28')]){delete _0x46045b[_0x281e('0x28')];}_0x49dc9f['status'](_0x1592ac)['send'](_0x46045b);};}exports[_0x281e('0x29')]=function(_0x1bdaa7,_0xbc1512){var _0x519d16={},_0x4e0637={},_0x14682a={'count':0x0,'rows':[]};var _0x14b0ca=_[_0x281e('0x2a')](db[_0x281e('0x2b')]['rawAttributes'],function(_0x20e7f9){return{'name':_0x20e7f9[_0x281e('0x2c')],'type':_0x20e7f9[_0x281e('0x2d')][_0x281e('0x2e')]};});_0x4e0637[_0x281e('0x2f')]=_['map'](_0x14b0ca,_0x281e('0x28'));_0x4e0637[_0x281e('0x30')]=_[_0x281e('0x31')](_0x1bdaa7[_0x281e('0x30')]);_0x4e0637[_0x281e('0x32')]=_[_0x281e('0x33')](_0x4e0637[_0x281e('0x2f')],_0x4e0637[_0x281e('0x30')]);_0x519d16[_0x281e('0x34')]=_['intersection'](_0x4e0637[_0x281e('0x2f')],qs[_0x281e('0x35')](_0x1bdaa7[_0x281e('0x30')]['fields']));_0x519d16[_0x281e('0x34')]=_0x519d16[_0x281e('0x34')][_0x281e('0x36')]?_0x519d16['attributes']:_0x4e0637[_0x281e('0x2f')];if(!_0x1bdaa7[_0x281e('0x30')][_0x281e('0x37')](_0x281e('0x38'))){_0x519d16['limit']=qs[_0x281e('0x1d')](_0x1bdaa7['query'][_0x281e('0x1d')]);_0x519d16[_0x281e('0x1f')]=qs['offset'](_0x1bdaa7['query'][_0x281e('0x1f')]);}_0x519d16[_0x281e('0x39')]=qs['sort'](_0x1bdaa7[_0x281e('0x30')]['sort']);_0x519d16[_0x281e('0x3a')]=qs[_0x281e('0x32')](_[_0x281e('0x3b')](_0x1bdaa7[_0x281e('0x30')],_0x4e0637[_0x281e('0x32')]),_0x14b0ca);if(_0x1bdaa7[_0x281e('0x30')][_0x281e('0x3c')]){_0x519d16[_0x281e('0x3a')]=_['merge'](_0x519d16[_0x281e('0x3a')],{'$or':_[_0x281e('0x2a')](_0x14b0ca,function(_0x290bca){if(_0x290bca[_0x281e('0x2d')]!==_0x281e('0x3d')){var _0x203155={};_0x203155[_0x290bca[_0x281e('0x28')]]={'$like':'%'+_0x1bdaa7[_0x281e('0x30')][_0x281e('0x3c')]+'%'};return _0x203155;}})});}_0x519d16=_[_0x281e('0x3e')]({},_0x519d16,_0x1bdaa7[_0x281e('0x3f')]);var _0x2feb3a={'where':_0x519d16[_0x281e('0x3a')]};return db[_0x281e('0x2b')][_0x281e('0x1e')](_0x2feb3a)[_0x281e('0x25')](function(_0x5255fb){_0x14682a['count']=_0x5255fb;if(_0x1bdaa7[_0x281e('0x30')][_0x281e('0x40')]){_0x519d16[_0x281e('0x41')]=[{'all':!![]}];}return db[_0x281e('0x2b')][_0x281e('0x42')](_0x519d16);})[_0x281e('0x25')](function(_0x45af6d){_0x14682a[_0x281e('0x43')]=_0x45af6d;return _0x14682a;})[_0x281e('0x25')](respondWithFilteredResult(_0xbc1512,_0x519d16))['catch'](handleError(_0xbc1512,null));};exports['show']=function(_0x5c7a2a,_0x15e7fd){var _0x364a26={'raw':!![],'where':{'id':_0x5c7a2a['params']['id']}},_0x5b0dba={};_0x5b0dba[_0x281e('0x2f')]=_[_0x281e('0x31')](db[_0x281e('0x2b')][_0x281e('0x44')]);_0x5b0dba[_0x281e('0x30')]=_[_0x281e('0x31')](_0x5c7a2a[_0x281e('0x30')]);_0x5b0dba[_0x281e('0x32')]=_['intersection'](_0x5b0dba[_0x281e('0x2f')],_0x5b0dba['query']);_0x364a26[_0x281e('0x34')]=_['intersection'](_0x5b0dba[_0x281e('0x2f')],qs['fields'](_0x5c7a2a[_0x281e('0x30')][_0x281e('0x35')]));_0x364a26[_0x281e('0x34')]=_0x364a26[_0x281e('0x34')]['length']?_0x364a26['attributes']:_0x5b0dba[_0x281e('0x2f')];if(_0x5c7a2a[_0x281e('0x30')][_0x281e('0x40')]){_0x364a26[_0x281e('0x41')]=[{'all':!![]}];}_0x364a26=_[_0x281e('0x3e')]({},_0x364a26,_0x5c7a2a['options']);return db[_0x281e('0x2b')][_0x281e('0x45')](_0x364a26)[_0x281e('0x25')](handleEntityNotFound(_0x15e7fd,null))[_0x281e('0x25')](respondWithResult(_0x15e7fd,null))[_0x281e('0x46')](handleError(_0x15e7fd,null));};exports[_0x281e('0x47')]=function(_0x23c818,_0x1bd319){var _0x424d68={'where':{'id':_0x23c818[_0x281e('0x48')]['id']}},_0x203188={};_0x203188[_0x281e('0x2f')]=_['keys'](db[_0x281e('0x2b')]['rawAttributes']);_0x424d68[_0x281e('0x34')]=_[_0x281e('0x33')](_0x203188[_0x281e('0x2f')],qs[_0x281e('0x35')](_0x23c818[_0x281e('0x30')]['fields']));_0x424d68[_0x281e('0x34')]=_0x424d68[_0x281e('0x34')][_0x281e('0x36')]?_0x424d68[_0x281e('0x34')]:_0x203188[_0x281e('0x2f')];if(_0x23c818[_0x281e('0x30')]['includeAll']){_0x424d68[_0x281e('0x41')]=[{'all':!![]}];}_0x424d68=_[_0x281e('0x3e')]({},_0x424d68,_0x23c818['options']);return db[_0x281e('0x2b')][_0x281e('0x45')](_0x424d68)['then'](handleEntityNotFound(_0x1bd319,null))[_0x281e('0x25')](function(_0x2153a1){if(_0x2153a1){var _0x169af8=_0x2153a1['get']({'plain':!![]});_0x169af8=qs[_0x281e('0x49')](_0x169af8,['id',_0x281e('0x4a'),'updatedAt']);_0x23c818[_0x281e('0x4b')]=_['omit'](_0x23c818[_0x281e('0x4b')],['id',_0x281e('0x4a'),_0x281e('0x4c')]);return db['Attachment'][_0x281e('0x4d')](_[_0x281e('0x3e')](_0x169af8,_0x23c818[_0x281e('0x4b')]),{'include':_0x23c818[_0x281e('0x30')][_0x281e('0x40')]?[{'all':!![]}]:undefined});}})[_0x281e('0x25')](respondWithResult(_0x1bd319,0xc9))[_0x281e('0x46')](handleError(_0x1bd319,null));};exports[_0x281e('0x24')]=function(_0x55b987,_0x4e7fab){if(_0x55b987[_0x281e('0x4b')]['id']){delete _0x55b987[_0x281e('0x4b')]['id'];}return db[_0x281e('0x2b')][_0x281e('0x45')]({'where':{'id':_0x55b987[_0x281e('0x48')]['id']}})[_0x281e('0x25')](handleEntityNotFound(_0x4e7fab,null))[_0x281e('0x25')](saveUpdates(_0x55b987[_0x281e('0x4b')],null))[_0x281e('0x25')](respondWithResult(_0x4e7fab,null))[_0x281e('0x46')](handleError(_0x4e7fab,null));};exports[_0x281e('0x4e')]=function(_0x5007e6,_0x18b9bf){return db['Attachment'][_0x281e('0x45')]({'where':{'id':_0x5007e6[_0x281e('0x48')]['id']}})['then'](handleEntityNotFound(_0x18b9bf,null))[_0x281e('0x25')](removeEntity(_0x18b9bf,null))[_0x281e('0x46')](handleError(_0x18b9bf,null));};exports[_0x281e('0x4d')]=function(_0x55b8e3,_0x76b313,_0x4a034c){_0x55b8e3[_0x281e('0x4b')]['name']=_0x55b8e3['file'][_0x281e('0x4f')];_0x55b8e3[_0x281e('0x4b')][_0x281e('0x50')]=_0x55b8e3[_0x281e('0x51')][_0x281e('0x52')];_0x55b8e3[_0x281e('0x4b')][_0x281e('0x2d')]=_0x55b8e3[_0x281e('0x51')]['mimetype'];return db[_0x281e('0x2b')][_0x281e('0x4d')](_0x55b8e3[_0x281e('0x4b')])[_0x281e('0x25')](respondWithResult(_0x76b313,0xc9))[_0x281e('0x46')](handleError(_0x76b313,null));};exports[_0x281e('0x53')]=function(_0x29cc6c,_0x43a706,_0x1a821c){return db[_0x281e('0x2b')][_0x281e('0x54')]({'where':{'id':_0x29cc6c['params']['id']},'raw':!![]})[_0x281e('0x25')](handleEntityNotFound(_0x43a706,null))[_0x281e('0x25')](function(_0x23978f){if(_0x23978f){var _0x3fa686=_0x23978f['ChatOfflineMessageId']!==null;var _0x5ea192=path['join'](config[_0x281e('0x55')],_0x281e('0x56'));if(_0x3fa686){_0x5ea192=path[_0x281e('0x57')](_0x5ea192,_0x281e('0x58'));}var _0x1ba0ed=path['join'](_0x5ea192,_0x23978f[_0x281e('0x50')]);return _0x43a706[_0x281e('0x53')](_0x1ba0ed);}})[_0x281e('0x46')](handleError(_0x43a706,null));}; \ No newline at end of file +var _0x06bc=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','fieldName','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','type','VIRTUAL','merge','includeAll','include','Attachment','findAll','rows','catch','params','length','find','clone','options','get','omit','createdAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x561f40,_0x22bc3e){var _0x52ba0c=function(_0x413519){while(--_0x413519){_0x561f40['push'](_0x561f40['shift']());}};_0x52ba0c(++_0x22bc3e);}(_0x06bc,0x96));var _0xc06b=function(_0x2f00bd,_0x47ca41){_0x2f00bd=_0x2f00bd-0x0;var _0x1dbc01=_0x06bc[_0x2f00bd];return _0x1dbc01;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc06b('0x0'));var jsonpatch=require(_0xc06b('0x1'));var rp=require(_0xc06b('0x2'));var moment=require(_0xc06b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc06b('0x4'));var util=require(_0xc06b('0x5'));var path=require(_0xc06b('0x6'));var sox=require(_0xc06b('0x7'));var csv=require(_0xc06b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc06b('0x9'));var _=require(_0xc06b('0xa'));var squel=require('squel');var crypto=require(_0xc06b('0xb'));var jsforce=require(_0xc06b('0xc'));var deskjs=require(_0xc06b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc06b('0xe'));var Papa=require(_0xc06b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc06b('0x10'));var as=require(_0xc06b('0x11'));var hardwareService=require(_0xc06b('0x12'));var logger=require(_0xc06b('0x13'))(_0xc06b('0x14'));var utils=require(_0xc06b('0x15'));var config=require(_0xc06b('0x16'));var licenseUtil=require(_0xc06b('0x17'));var db=require(_0xc06b('0x18'))['db'];function respondWithStatusCode(_0x3c007f,_0x5b226c){_0x5b226c=_0x5b226c||0xcc;return function(_0x36e6f7){if(_0x36e6f7){return _0x3c007f[_0xc06b('0x19')](_0x5b226c);}return _0x3c007f[_0xc06b('0x1a')](_0x5b226c)[_0xc06b('0x1b')]();};}function respondWithResult(_0xbef10e,_0x15ae86){_0x15ae86=_0x15ae86||0xc8;return function(_0xaf9dc9){if(_0xaf9dc9){return _0xbef10e['status'](_0x15ae86)[_0xc06b('0x1c')](_0xaf9dc9);}};}function respondWithFilteredResult(_0x5516c1,_0x2ac1da){return function(_0x23e520){if(_0x23e520){var _0x52f566=typeof _0x2ac1da[_0xc06b('0x1d')]===_0xc06b('0x1e')&&typeof _0x2ac1da['limit']===_0xc06b('0x1e');var _0x4ac034=_0x23e520['count'];var _0x2ef698=_0x52f566?0x0:_0x2ac1da[_0xc06b('0x1d')];var _0x392ce3=_0x52f566?_0x23e520[_0xc06b('0x1f')]:_0x2ac1da[_0xc06b('0x1d')]+_0x2ac1da[_0xc06b('0x20')];var _0x829a61;if(_0x392ce3>=_0x4ac034){_0x392ce3=_0x4ac034;_0x829a61=0xc8;}else{_0x829a61=0xce;}_0x5516c1[_0xc06b('0x1a')](_0x829a61);return _0x5516c1[_0xc06b('0x21')]('Content-Range',_0x2ef698+'-'+_0x392ce3+'/'+_0x4ac034)[_0xc06b('0x1c')](_0x23e520);}return null;};}function patchUpdates(_0x28b1d9){return function(_0x1906d5){try{jsonpatch['apply'](_0x1906d5,_0x28b1d9,!![]);}catch(_0x49e328){return BPromise[_0xc06b('0x22')](_0x49e328);}return _0x1906d5[_0xc06b('0x23')]();};}function saveUpdates(_0x5aa864,_0x4890ca){return function(_0x3eeebb){if(_0x3eeebb){return _0x3eeebb[_0xc06b('0x24')](_0x5aa864)[_0xc06b('0x25')](function(_0x6f0364){return _0x6f0364;});}return null;};}function removeEntity(_0x286f9d,_0x336af6){return function(_0x48f8d0){if(_0x48f8d0){return _0x48f8d0[_0xc06b('0x26')]()[_0xc06b('0x25')](function(){_0x286f9d[_0xc06b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3266b1,_0x5ea256){return function(_0x3b7b1e){if(!_0x3b7b1e){_0x3266b1[_0xc06b('0x19')](0x194);}return _0x3b7b1e;};}function handleError(_0x1d42c4,_0x17fb91){_0x17fb91=_0x17fb91||0x1f4;return function(_0x1db002){logger[_0xc06b('0x27')](_0x1db002['stack']);if(_0x1db002[_0xc06b('0x28')]){delete _0x1db002['name'];}_0x1d42c4['status'](_0x17fb91)['send'](_0x1db002);};}exports['index']=function(_0x54b05c,_0x2bb8c3){var _0x12fa27={},_0x14f6c6={},_0x13be76={'count':0x0,'rows':[]};var _0xb8069e=_['map'](db['Attachment']['rawAttributes'],function(_0x197f11){return{'name':_0x197f11[_0xc06b('0x29')],'type':_0x197f11['type']['key']};});_0x14f6c6[_0xc06b('0x2a')]=_[_0xc06b('0x2b')](_0xb8069e,_0xc06b('0x28'));_0x14f6c6[_0xc06b('0x2c')]=_[_0xc06b('0x2d')](_0x54b05c[_0xc06b('0x2c')]);_0x14f6c6[_0xc06b('0x2e')]=_[_0xc06b('0x2f')](_0x14f6c6[_0xc06b('0x2a')],_0x14f6c6[_0xc06b('0x2c')]);_0x12fa27[_0xc06b('0x30')]=_[_0xc06b('0x2f')](_0x14f6c6[_0xc06b('0x2a')],qs[_0xc06b('0x31')](_0x54b05c[_0xc06b('0x2c')][_0xc06b('0x31')]));_0x12fa27[_0xc06b('0x30')]=_0x12fa27['attributes']['length']?_0x12fa27[_0xc06b('0x30')]:_0x14f6c6['model'];if(!_0x54b05c[_0xc06b('0x2c')]['hasOwnProperty'](_0xc06b('0x32'))){_0x12fa27['limit']=qs[_0xc06b('0x20')](_0x54b05c[_0xc06b('0x2c')][_0xc06b('0x20')]);_0x12fa27['offset']=qs[_0xc06b('0x1d')](_0x54b05c['query'][_0xc06b('0x1d')]);}_0x12fa27[_0xc06b('0x33')]=qs['sort'](_0x54b05c[_0xc06b('0x2c')][_0xc06b('0x34')]);_0x12fa27[_0xc06b('0x35')]=qs[_0xc06b('0x2e')](_[_0xc06b('0x36')](_0x54b05c[_0xc06b('0x2c')],_0x14f6c6[_0xc06b('0x2e')]),_0xb8069e);if(_0x54b05c[_0xc06b('0x2c')]['filter']){_0x12fa27['where']=_['merge'](_0x12fa27['where'],{'$or':_[_0xc06b('0x2b')](_0xb8069e,function(_0x4c1eb9){if(_0x4c1eb9[_0xc06b('0x37')]!==_0xc06b('0x38')){var _0x1ded92={};_0x1ded92[_0x4c1eb9['name']]={'$like':'%'+_0x54b05c[_0xc06b('0x2c')]['filter']+'%'};return _0x1ded92;}})});}_0x12fa27=_[_0xc06b('0x39')]({},_0x12fa27,_0x54b05c['options']);var _0x273e0f={'where':_0x12fa27[_0xc06b('0x35')]};return db['Attachment'][_0xc06b('0x1f')](_0x273e0f)[_0xc06b('0x25')](function(_0x28bec6){_0x13be76[_0xc06b('0x1f')]=_0x28bec6;if(_0x54b05c[_0xc06b('0x2c')][_0xc06b('0x3a')]){_0x12fa27[_0xc06b('0x3b')]=[{'all':!![]}];}return db[_0xc06b('0x3c')][_0xc06b('0x3d')](_0x12fa27);})[_0xc06b('0x25')](function(_0x310850){_0x13be76[_0xc06b('0x3e')]=_0x310850;return _0x13be76;})['then'](respondWithFilteredResult(_0x2bb8c3,_0x12fa27))[_0xc06b('0x3f')](handleError(_0x2bb8c3,null));};exports['show']=function(_0x11f6b6,_0x3b3eb4){var _0x14d6b4={'raw':!![],'where':{'id':_0x11f6b6[_0xc06b('0x40')]['id']}},_0x5cb270={};_0x5cb270[_0xc06b('0x2a')]=_[_0xc06b('0x2d')](db[_0xc06b('0x3c')]['rawAttributes']);_0x5cb270[_0xc06b('0x2c')]=_['keys'](_0x11f6b6[_0xc06b('0x2c')]);_0x5cb270['filters']=_['intersection'](_0x5cb270[_0xc06b('0x2a')],_0x5cb270[_0xc06b('0x2c')]);_0x14d6b4[_0xc06b('0x30')]=_[_0xc06b('0x2f')](_0x5cb270[_0xc06b('0x2a')],qs['fields'](_0x11f6b6['query'][_0xc06b('0x31')]));_0x14d6b4[_0xc06b('0x30')]=_0x14d6b4['attributes'][_0xc06b('0x41')]?_0x14d6b4[_0xc06b('0x30')]:_0x5cb270['model'];if(_0x11f6b6['query'][_0xc06b('0x3a')]){_0x14d6b4[_0xc06b('0x3b')]=[{'all':!![]}];}_0x14d6b4=_[_0xc06b('0x39')]({},_0x14d6b4,_0x11f6b6['options']);return db[_0xc06b('0x3c')][_0xc06b('0x42')](_0x14d6b4)['then'](handleEntityNotFound(_0x3b3eb4,null))[_0xc06b('0x25')](respondWithResult(_0x3b3eb4,null))[_0xc06b('0x3f')](handleError(_0x3b3eb4,null));};exports[_0xc06b('0x43')]=function(_0x5e04f1,_0x1cffe5){var _0x33ea71={'where':{'id':_0x5e04f1[_0xc06b('0x40')]['id']}},_0x369ff3={};_0x369ff3[_0xc06b('0x2a')]=_[_0xc06b('0x2d')](db[_0xc06b('0x3c')]['rawAttributes']);_0x33ea71['attributes']=_[_0xc06b('0x2f')](_0x369ff3[_0xc06b('0x2a')],qs[_0xc06b('0x31')](_0x5e04f1[_0xc06b('0x2c')][_0xc06b('0x31')]));_0x33ea71[_0xc06b('0x30')]=_0x33ea71['attributes'][_0xc06b('0x41')]?_0x33ea71['attributes']:_0x369ff3['model'];if(_0x5e04f1[_0xc06b('0x2c')]['includeAll']){_0x33ea71[_0xc06b('0x3b')]=[{'all':!![]}];}_0x33ea71=_[_0xc06b('0x39')]({},_0x33ea71,_0x5e04f1[_0xc06b('0x44')]);return db['Attachment']['find'](_0x33ea71)[_0xc06b('0x25')](handleEntityNotFound(_0x1cffe5,null))['then'](function(_0x2ed9a0){if(_0x2ed9a0){var _0x96b083=_0x2ed9a0[_0xc06b('0x45')]({'plain':!![]});_0x96b083=qs[_0xc06b('0x46')](_0x96b083,['id',_0xc06b('0x47'),'updatedAt']);_0x5e04f1[_0xc06b('0x48')]=_[_0xc06b('0x46')](_0x5e04f1[_0xc06b('0x48')],['id',_0xc06b('0x47'),'updatedAt']);return db[_0xc06b('0x3c')]['create'](_[_0xc06b('0x39')](_0x96b083,_0x5e04f1[_0xc06b('0x48')]),{'include':_0x5e04f1['query'][_0xc06b('0x3a')]?[{'all':!![]}]:undefined});}})[_0xc06b('0x25')](respondWithResult(_0x1cffe5,0xc9))['catch'](handleError(_0x1cffe5,null));};exports[_0xc06b('0x24')]=function(_0x7b96ac,_0x3c70da){if(_0x7b96ac['body']['id']){delete _0x7b96ac[_0xc06b('0x48')]['id'];}return db[_0xc06b('0x3c')][_0xc06b('0x42')]({'where':{'id':_0x7b96ac[_0xc06b('0x40')]['id']}})[_0xc06b('0x25')](handleEntityNotFound(_0x3c70da,null))[_0xc06b('0x25')](saveUpdates(_0x7b96ac[_0xc06b('0x48')],null))[_0xc06b('0x25')](respondWithResult(_0x3c70da,null))['catch'](handleError(_0x3c70da,null));};exports[_0xc06b('0x26')]=function(_0x4ef9e4,_0x2e4f60){return db[_0xc06b('0x3c')]['find']({'where':{'id':_0x4ef9e4[_0xc06b('0x40')]['id']}})[_0xc06b('0x25')](handleEntityNotFound(_0x2e4f60,null))[_0xc06b('0x25')](removeEntity(_0x2e4f60,null))['catch'](handleError(_0x2e4f60,null));};exports[_0xc06b('0x49')]=function(_0x363fc5,_0x146974,_0x2343fd){_0x363fc5[_0xc06b('0x48')][_0xc06b('0x28')]=_0x363fc5[_0xc06b('0x4a')][_0xc06b('0x4b')];_0x363fc5[_0xc06b('0x48')][_0xc06b('0x4c')]=_0x363fc5[_0xc06b('0x4a')][_0xc06b('0x4d')];_0x363fc5[_0xc06b('0x48')]['type']=_0x363fc5[_0xc06b('0x4a')][_0xc06b('0x4e')];return db[_0xc06b('0x3c')][_0xc06b('0x49')](_0x363fc5[_0xc06b('0x48')])[_0xc06b('0x25')](respondWithResult(_0x146974,0xc9))[_0xc06b('0x3f')](handleError(_0x146974,null));};exports[_0xc06b('0x4f')]=function(_0x5db43f,_0x3de777,_0x2aef74){return db[_0xc06b('0x3c')][_0xc06b('0x50')]({'where':{'id':_0x5db43f[_0xc06b('0x40')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3de777,null))['then'](function(_0xc31cb8){if(_0xc31cb8){var _0x507122=_0xc31cb8[_0xc06b('0x51')]!==null;var _0x59f98f=path['join'](config[_0xc06b('0x52')],_0xc06b('0x53'));if(_0x507122){_0x59f98f=path[_0xc06b('0x54')](_0x59f98f,'offline-chat/');}var _0x219128=path[_0xc06b('0x54')](_0x59f98f,_0xc31cb8[_0xc06b('0x4c')]);return _0x3de777[_0xc06b('0x4f')](_0x219128);}})[_0xc06b('0x3f')](handleError(_0x3de777,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 4ec83f0..60c0ea5 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 _0x76a0=['exports','define','attachments','lodash','../../config/logger','api','moment','bluebird','path','./attachment.attributes'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x76a0,0xad));var _0x076a=function(_0x2adc55,_0x1e1565){_0x2adc55=_0x2adc55-0x0;var _0x735331=_0x76a0[_0x2adc55];return _0x735331;};'use strict';var _=require(_0x076a('0x0'));var util=require('util');var logger=require(_0x076a('0x1'))(_0x076a('0x2'));var moment=require(_0x076a('0x3'));var BPromise=require(_0x076a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x076a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x076a('0x6'));module[_0x076a('0x7')]=function(_0x32cc6e,_0x1dacee){return _0x32cc6e[_0x076a('0x8')]('Attachment',attributes,{'tableName':_0x076a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb71d=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','define','Attachment','attachments'];(function(_0x59f3c8,_0x269e43){var _0x320c2f=function(_0x2c22a5){while(--_0x2c22a5){_0x59f3c8['push'](_0x59f3c8['shift']());}};_0x320c2f(++_0x269e43);}(_0xb71d,0x15c));var _0xdb71=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xb71d[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xdb71('0x0'));var util=require('util');var logger=require(_0xdb71('0x1'))(_0xdb71('0x2'));var moment=require(_0xdb71('0x3'));var BPromise=require(_0xdb71('0x4'));var rp=require(_0xdb71('0x5'));var fs=require('fs');var path=require(_0xdb71('0x6'));var rimraf=require(_0xdb71('0x7'));var config=require('../../config/environment');var attributes=require(_0xdb71('0x8'));module['exports']=function(_0x3c07be,_0x53898e){return _0x3c07be[_0xdb71('0x9')](_0xdb71('0xa'),attributes,{'tableName':_0xdb71('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 01dfd11..2d711f6 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 _0x99e9=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body','raw','CreateAttachment','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5177ac,_0x22ce5a){var _0x1e27ff=function(_0x43759f){while(--_0x43759f){_0x5177ac['push'](_0x5177ac['shift']());}};_0x1e27ff(++_0x22ce5a);}(_0x99e9,0xb4));var _0x999e=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x99e9[_0x291d3f];return _0x242080;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Attachment,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});}exports['CreateAttachment']=function(_0x4fcdfb){var _0x3153ce=this;return new Promise(function(_0x43b09e,_0xc4ef74){return db[_0x999e('0x17')][_0x999e('0x18')](_0x4fcdfb[_0x999e('0x19')],{'raw':_0x4fcdfb['options']?_0x4fcdfb['options'][_0x999e('0x1a')]===undefined?!![]:![]:!![]})[_0x999e('0xb')](function(_0x3b3642){logger['info'](_0x999e('0x1b'),_0x4fcdfb);logger[_0x999e('0xf')](_0x999e('0x1b'),_0x4fcdfb,JSON[_0x999e('0x11')](_0x3b3642));_0x43b09e(_0x3b3642);})[_0x999e('0x16')](function(_0x3750a0){logger[_0x999e('0x12')]('CreateAttachment',_0x3750a0['message'],_0x4fcdfb);_0xc4ef74(_0x3153ce[_0x999e('0x12')](0x1f4,_0x3750a0[_0x999e('0x14')]));});});}; \ No newline at end of file +var _0x6c50=['error','Attachment,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0x6c50,0xa4));var _0x06c5=function(_0x44641b,_0x20d859){_0x44641b=_0x44641b-0x0;var _0x51c353=_0x6c50[_0x44641b];return _0x51c353;};'use strict';var _=require(_0x06c5('0x0'));var util=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var BPromise=require(_0x06c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06c5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06c5('0x5'));var logger=require(_0x06c5('0x6'))(_0x06c5('0x7'));var config=require(_0x06c5('0x8'));var jayson=require(_0x06c5('0x9'));var client=jayson[_0x06c5('0xa')][_0x06c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x427dd6,_0x181c7f,_0x17c636){return new BPromise(function(_0x154b0a,_0x546ae5){return client[_0x06c5('0xc')](_0x427dd6,_0x17c636)[_0x06c5('0xd')](function(_0x3010af){logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,'request\x20sent');logger['debug'](_0x06c5('0xf'),_0x181c7f,'request\x20sent',JSON['stringify'](_0x3010af));if(_0x3010af['error']){if(_0x3010af[_0x06c5('0x10')]['code']===0x1f4){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af[_0x06c5('0x10')]['message']);return _0x546ae5(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x3010af['error']['message']);return _0x154b0a(_0x3010af[_0x06c5('0x10')][_0x06c5('0x12')]);}else{logger[_0x06c5('0xe')]('Attachment,\x20%s,\x20%s',_0x181c7f,_0x06c5('0x13'));_0x154b0a(_0x3010af[_0x06c5('0x14')]['message']);}})[_0x06c5('0x15')](function(_0x9045e6){logger[_0x06c5('0x10')](_0x06c5('0x11'),_0x181c7f,_0x9045e6);_0x546ae5(_0x9045e6);});});}exports[_0x06c5('0x16')]=function(_0x36b9e9){var _0x44d14e=this;return new Promise(function(_0x18a070,_0x1393f5){return db[_0x06c5('0x17')][_0x06c5('0x18')](_0x36b9e9[_0x06c5('0x19')],{'raw':_0x36b9e9[_0x06c5('0x1a')]?_0x36b9e9[_0x06c5('0x1a')][_0x06c5('0x1b')]===undefined?!![]:![]:!![]})[_0x06c5('0xd')](function(_0x26a653){logger['info'](_0x06c5('0x16'),_0x36b9e9);logger[_0x06c5('0x1c')](_0x06c5('0x16'),_0x36b9e9,JSON[_0x06c5('0x1d')](_0x26a653));_0x18a070(_0x26a653);})[_0x06c5('0x15')](function(_0x3c9e49){logger[_0x06c5('0x10')]('CreateAttachment',_0x3c9e49[_0x06c5('0x12')],_0x36b9e9);_0x1393f5(_0x44d14e[_0x06c5('0x10')](0x1f4,_0x3c9e49[_0x06c5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 4840fb4..f9e0ed4 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3f1842,_0x1e1a6f){var _0x23cad2=function(_0x1447b8){while(--_0x1447b8){_0x3f1842['push'](_0x3f1842['shift']());}};_0x23cad2(++_0x1e1a6f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b2c9b,_0x4363cb){_0x2b2c9b=_0x2b2c9b-0x0;var _0x1a312e=_0x5f2f[_0x2b2c9b];return _0x1a312e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 4aa1574..0450bba 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 _0xe84b=['salt','role','disabled','blocked','blockedAt','online','admin','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','activedirectory','undefined','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name'];(function(_0x2e4bf3,_0x2ba175){var _0x48c5ce=function(_0x1bfd25){while(--_0x1bfd25){_0x2e4bf3['push'](_0x2e4bf3['shift']());}};_0x48c5ce(++_0x2ba175);}(_0xe84b,0x1b0));var _0xbe84=function(_0x3e43c8,_0x516592){_0x3e43c8=_0x3e43c8-0x0;var _0x17b9b0=_0xe84b[_0x3e43c8];return _0x17b9b0;};'use strict';var passport=require(_0xbe84('0x0'));var LocalStrategy=require(_0xbe84('0x1'))[_0xbe84('0x2')];var moment=require(_0xbe84('0x3'));var ActiveDirectory=require(_0xbe84('0x4'));var BPromise=require(_0xbe84('0x5'));var util=require(_0xbe84('0x6'));var db=require(_0xbe84('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xbe84('0x8'));var config=require(_0xbe84('0x9'));var logger=require('../../config/logger')(_0xbe84('0xa'));function isActiveDirectoryConfigured(_0x5e3f9c){var _0x3e9528=![];if(typeof _0x5e3f9c[_0xbe84('0xb')]!==_0xbe84('0xc')){_0x3e9528=_0x5e3f9c['activedirectory']['baseDN']&&_0x5e3f9c[_0xbe84('0xb')]['url']&&_0x5e3f9c[_0xbe84('0xb')][_0xbe84('0xd')];}return _0x3e9528;}function adAuthenticate(_0x459339,_0x2f1ace,_0x336bd2){return new BPromise(function(_0x39823b,_0x327db6){try{var _0x3f9096=new ActiveDirectory(_0x459339);_0x3f9096[_0xbe84('0xe')](_0x2f1ace,_0x336bd2,function(_0xb26e85,_0x44a2e3){if(_0xb26e85){logger[_0xbe84('0xf')](_0xbe84('0x10'),_0x2f1ace,util['inspect'](_0xb26e85,{'showHidden':![],'depth':null}));_0x327db6(_0xbe84('0x11'));}else if(!_0x44a2e3){logger[_0xbe84('0xf')](_0xbe84('0x12'),_0x2f1ace);_0x327db6(_0xbe84('0x11'));}else{_0x39823b(_0x44a2e3);}});}catch(_0x5eeded){_0x327db6(_0x5eeded);}});}function ActiveDirectoryAuthenticate(_0x3df25e,_0x4ecc6c,_0xd43525,_0x285b43){var _0x3958e4,_0x716df5;if(!isActiveDirectoryConfigured(config)){logger[_0xbe84('0xf')](_0xbe84('0x13'),_0x4ecc6c);return _0x285b43(null,![],{'message':_0xbe84('0x11')});}return db[_0xbe84('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xbe84('0x15'),_0xbe84('0x16')],'raw':!![]})[_0xbe84('0x17')](function(_0x38663b){_0x3958e4=_0x38663b;if(!_0x3958e4[_0xbe84('0x15')]){logger[_0xbe84('0xf')](_0xbe84('0x18'),_0x4ecc6c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x3df25e[_0xbe84('0x19')]({'attributes':['id',_0xbe84('0x1a'),'password',_0xbe84('0x1b'),_0xbe84('0x1c'),_0xbe84('0x1d'),_0xbe84('0x1e'),_0xbe84('0x1f'),_0xbe84('0x20')],'where':{'name':_0x4ecc6c,'role':{'$or':[_0xbe84('0x21'),_0xbe84('0x22'),_0xbe84('0x23')]},'adSsoEnabled':!![]}});})[_0xbe84('0x17')](function(_0x6420a8){if(!_0x6420a8||_0x6420a8&&_0x6420a8['name']!==_0x4ecc6c){throw new Error(_0xbe84('0x11'));}_0x716df5=_0x6420a8;var _0x526073=_0x716df5[_0xbe84('0x1a')]+'@'+config[_0xbe84('0xb')]['domain'];return adAuthenticate(config[_0xbe84('0xb')],_0x526073,_0xd43525);})[_0xbe84('0x17')](function(_0x91d695){if(_0x716df5[_0xbe84('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3958e4[_0xbe84('0x16')]>0x0){if(_0x716df5[_0xbe84('0x1e')]){if(moment(_0x716df5[_0xbe84('0x1f')])[_0xbe84('0x24')](_0x3958e4[_0xbe84('0x16')],_0xbe84('0x25'))>moment()){throw new Error(_0xbe84('0x11'));}return utils[_0xbe84('0x26')](_0x716df5,0x0,![],null)[_0xbe84('0x17')](function(){return utils[_0xbe84('0x27')](_0x716df5);})[_0xbe84('0x17')](function(){return _0x285b43(null,_0x716df5);});}else{return utils['getLicense'](_0x716df5)[_0xbe84('0x17')](function(){return _0x285b43(null,_0x716df5);});}}else{return utils[_0xbe84('0x27')](_0x716df5)[_0xbe84('0x17')](function(){return _0x285b43(null,_0x716df5);});}})[_0xbe84('0x28')](function(_0x419d6f){return _0x285b43(null,![],_0x419d6f);});}function handleError(_0x48306f,_0x6c2515,_0x90d5df){return _0x48306f[_0xbe84('0x29')](_0x6c2515||0x1f4)[_0xbe84('0x2a')]({'message':_0x90d5df?_0x90d5df[_0xbe84('0x2b')]||_0x90d5df:''});}exports[_0xbe84('0x2c')]=function(_0xefbb06,_0x5563da,_0x4dd37d){passport['authenticate'](_0xbe84('0x2d'),function(_0x91934,_0x30afd6,_0x38b6d2){var _0x19a048=_0x91934||_0x38b6d2;if(_0x19a048){return handleError(_0x5563da,0x191,_0x19a048);}if(!_0x30afd6){return handleError(_0x5563da,0x194,{'message':_0xbe84('0x2e')});}else{var _0x3680a3={'payload':{'id':_0x30afd6['id'],'role':_0x30afd6['role']},'options':{'expiresIn':0x15180}};return authService[_0xbe84('0x2f')](_0x3680a3)[_0xbe84('0x17')](function(_0x6d1272){_0x5563da[_0xbe84('0x30')]({'id':_0x30afd6['id'],'token':_0x6d1272,'statusCall':'','isAlreadyLogged':_0x30afd6[_0xbe84('0x20')]});});}})(_0xefbb06,_0x5563da,_0x4dd37d);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0xbe84('0x1a'),'passwordField':_0xbe84('0x31')},function(_0x5456ca,_0x2a5513,_0x5027fd){return ActiveDirectoryAuthenticate(db[_0xbe84('0x32')],_0x5456ca,_0x2a5513,_0x5027fd);})); \ No newline at end of file +var _0x018f=['message','login','ad-login','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','name','password','role','disabled','blockedAt','online','admin','user','domain','blocked','add','minutes','clearBlockUser','getLicense','catch','status','send'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x018f,0x93));var _0xf018=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x018f[_0x1602ef];return _0x5870ee;};'use strict';var passport=require(_0xf018('0x0'));var LocalStrategy=require(_0xf018('0x1'))[_0xf018('0x2')];var moment=require(_0xf018('0x3'));var ActiveDirectory=require(_0xf018('0x4'));var BPromise=require('bluebird');var util=require(_0xf018('0x5'));var db=require(_0xf018('0x6'))['db'];var authService=require(_0xf018('0x7'));var utils=require(_0xf018('0x8'));var config=require(_0xf018('0x9'));var logger=require(_0xf018('0xa'))('api');function isActiveDirectoryConfigured(_0x384ebf){var _0x10037a=![];if(typeof _0x384ebf[_0xf018('0xb')]!==_0xf018('0xc')){_0x10037a=_0x384ebf[_0xf018('0xb')][_0xf018('0xd')]&&_0x384ebf['activedirectory']['url']&&_0x384ebf[_0xf018('0xb')]['domain'];}return _0x10037a;}function adAuthenticate(_0x30ffce,_0x567a9e,_0xbf3094){return new BPromise(function(_0x564412,_0x238a06){try{var _0x1a387c=new ActiveDirectory(_0x30ffce);_0x1a387c[_0xf018('0xe')](_0x567a9e,_0xbf3094,function(_0x54042a,_0x453ce3){if(_0x54042a){logger[_0xf018('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x567a9e,util[_0xf018('0x10')](_0x54042a,{'showHidden':![],'depth':null}));_0x238a06(_0xf018('0x11'));}else if(!_0x453ce3){logger[_0xf018('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x567a9e);_0x238a06(_0xf018('0x11'));}else{_0x564412(_0x453ce3);}});}catch(_0x4d8581){_0x238a06(_0x4d8581);}});}function ActiveDirectoryAuthenticate(_0x1274d3,_0x56bc49,_0x47585c,_0x27d3bb){var _0x368b81,_0x4acc3d;if(!isActiveDirectoryConfigured(config)){logger[_0xf018('0xf')](_0xf018('0x12'),_0x56bc49);return _0x27d3bb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xf018('0x13')][_0xf018('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xf018('0x15')],'raw':!![]})[_0xf018('0x16')](function(_0x82377b){_0x368b81=_0x82377b;if(!_0x368b81[_0xf018('0x17')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x56bc49);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1274d3[_0xf018('0x14')]({'attributes':['id',_0xf018('0x18'),_0xf018('0x19'),'salt',_0xf018('0x1a'),_0xf018('0x1b'),'blocked',_0xf018('0x1c'),_0xf018('0x1d')],'where':{'name':_0x56bc49,'role':{'$or':[_0xf018('0x1e'),_0xf018('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xf018('0x16')](function(_0x33969e){if(!_0x33969e||_0x33969e&&_0x33969e[_0xf018('0x18')]!==_0x56bc49){throw new Error(_0xf018('0x11'));}_0x4acc3d=_0x33969e;var _0xf59638=_0x4acc3d[_0xf018('0x18')]+'@'+config['activedirectory'][_0xf018('0x20')];return adAuthenticate(config[_0xf018('0xb')],_0xf59638,_0x47585c);})[_0xf018('0x16')](function(_0xcd60ea){if(_0x4acc3d[_0xf018('0x1b')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x368b81[_0xf018('0x15')]>0x0){if(_0x4acc3d[_0xf018('0x21')]){if(moment(_0x4acc3d[_0xf018('0x1c')])[_0xf018('0x22')](_0x368b81[_0xf018('0x15')],_0xf018('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xf018('0x24')](_0x4acc3d,0x0,![],null)[_0xf018('0x16')](function(){return utils[_0xf018('0x25')](_0x4acc3d);})['then'](function(){return _0x27d3bb(null,_0x4acc3d);});}else{return utils[_0xf018('0x25')](_0x4acc3d)[_0xf018('0x16')](function(){return _0x27d3bb(null,_0x4acc3d);});}}else{return utils[_0xf018('0x25')](_0x4acc3d)[_0xf018('0x16')](function(){return _0x27d3bb(null,_0x4acc3d);});}})[_0xf018('0x26')](function(_0x14b726){return _0x27d3bb(null,![],_0x14b726);});}function handleError(_0x1098f8,_0x16b0ea,_0x11e872){return _0x1098f8[_0xf018('0x27')](_0x16b0ea||0x1f4)[_0xf018('0x28')]({'message':_0x11e872?_0x11e872[_0xf018('0x29')]||_0x11e872:''});}exports[_0xf018('0x2a')]=function(_0x1f8cff,_0x2bd0c8,_0x125ab9){passport['authenticate'](_0xf018('0x2b'),function(_0xfc5987,_0x3d6989,_0x13f242){var _0x29b237=_0xfc5987||_0x13f242;if(_0x29b237){return handleError(_0x2bd0c8,0x191,_0x29b237);}if(!_0x3d6989){return handleError(_0x2bd0c8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x47679b={'payload':{'id':_0x3d6989['id'],'role':_0x3d6989[_0xf018('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xf018('0x2c')](_0x47679b)['then'](function(_0x1f5f5b){_0x2bd0c8['json']({'id':_0x3d6989['id'],'token':_0x1f5f5b,'statusCall':'','isAlreadyLogged':_0x3d6989[_0xf018('0x1d')]});});}})(_0x1f8cff,_0x2bd0c8,_0x125ab9);};passport[_0xf018('0x2d')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xf018('0x19')},function(_0x3f7292,_0x118d79,_0x409d67){return ActiveDirectoryAuthenticate(db[_0xf018('0x2e')],_0x3f7292,_0x118d79,_0x409d67);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index fa98391..a1f0260 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 _0x011f=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x5e3ac9,_0x4aa831){var _0x2d90bd=function(_0x49176){while(--_0x49176){_0x5e3ac9['push'](_0x5e3ac9['shift']());}};_0x2d90bd(++_0x4aa831);}(_0x011f,0xca));var _0xf011=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x011f[_0x588011];return _0x3b3773;};'use strict';var express=require(_0xf011('0x0'));var router=express[_0xf011('0x1')]();var controller=require(_0xf011('0x2'));router[_0xf011('0x3')]('/',controller[_0xf011('0x4')]);module[_0xf011('0x5')]=router; \ No newline at end of file +var _0x0b0d=['exports','Router'];(function(_0x37fa10,_0x5690ff){var _0x8dd0ee=function(_0x17fea5){while(--_0x17fea5){_0x37fa10['push'](_0x37fa10['shift']());}};_0x8dd0ee(++_0x5690ff);}(_0x0b0d,0x19d));var _0xd0b0=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0b0d[_0x21a9d9];return _0x46adce;};'use strict';var express=require('express');var router=express[_0xd0b0('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0xd0b0('0x1')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5834170..0807adf 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1b0c67,_0x8db591){var _0x43c8bd=function(_0x48d028){while(--_0x48d028){_0x1b0c67['push'](_0x1b0c67['shift']());}};_0x43c8bd(++_0x8db591);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x7eac31,_0x59bafb){var _0x29f4ee=function(_0x4d4ac6){while(--_0x4d4ac6){_0x7eac31['push'](_0x7eac31['shift']());}};_0x29f4ee(++_0x59bafb);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 36c61ff..28112ef 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 _0xceb3=['/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','login'];(function(_0x17b4d7,_0x28f0f4){var _0x467379=function(_0x1dc3db){while(--_0x1dc3db){_0x17b4d7['push'](_0x17b4d7['shift']());}};_0x467379(++_0x28f0f4);}(_0xceb3,0xf5));var _0x3ceb=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0xceb3[_0x174a72];return _0x32cecd;};'use strict';var express=require(_0x3ceb('0x0'));var passport=require(_0x3ceb('0x1'));var router=express[_0x3ceb('0x2')]();var controller=require(_0x3ceb('0x3'));var userController=require(_0x3ceb('0x4'));var authService=require('../../components/auth/service');router[_0x3ceb('0x5')]('/',controller[_0x3ceb('0x6')]);router[_0x3ceb('0x5')](_0x3ceb('0x7'),controller[_0x3ceb('0x8')],authService[_0x3ceb('0x9')],userController[_0x3ceb('0x6')],authService[_0x3ceb('0xa')]);module[_0x3ceb('0xb')]=router; \ No newline at end of file +var _0xfed1=['express','passport','./authGoogle.controller','../user/user.controller.js','get','login','setTokenCookie','exports'];(function(_0x493cea,_0x144c6a){var _0x1c32ba=function(_0x47c0f9){while(--_0x47c0f9){_0x493cea['push'](_0x493cea['shift']());}};_0x1c32ba(++_0x144c6a);}(_0xfed1,0xf0));var _0x1fed=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfed1[_0x122ef9];return _0x42fba0;};'use strict';var express=require(_0x1fed('0x0'));var passport=require(_0x1fed('0x1'));var router=express['Router']();var controller=require(_0x1fed('0x2'));var userController=require(_0x1fed('0x3'));var authService=require('../../components/auth/service');router[_0x1fed('0x4')]('/',controller[_0x1fed('0x5')]);router['get']('/callback',controller['callback'],authService['isMiddleware'],userController[_0x1fed('0x5')],authService[_0x1fed('0x6')]);module[_0x1fed('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index ef083aa..461b193 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 _0xc82b=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','User','params','token','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','validatePasswordHistory','previousPasswords','resetPasswordToken','use','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','then','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','error','message','stringify','status','send','login','local-login','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0x1df785,_0x49e58f){var _0x536b69=function(_0x397a45){while(--_0x397a45){_0x1df785['push'](_0x1df785['shift']());}};_0x536b69(++_0x49e58f);}(_0xc82b,0x1f2));var _0xbc82=function(_0x3e40db,_0x42a899){_0x3e40db=_0x3e40db-0x0;var _0x5b3ff2=_0xc82b[_0x3e40db];return _0x5b3ff2;};'use strict';var util=require(_0xbc82('0x0'));var passport=require(_0xbc82('0x1'));var LocalStrategy=require('passport-local')[_0xbc82('0x2')];var jayson=require(_0xbc82('0x3'));var _=require(_0xbc82('0x4'));var rs=require(_0xbc82('0x5'));var moment=require(_0xbc82('0x6'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0xbc82('0x7')][_0xbc82('0x8')]({'port':0x232b});function localAuthenticate(_0x1e414a,_0x5e10de,_0x7354e8,_0x34ae02){var _0x31ab18,_0x5352e5;return db[_0xbc82('0x9')][_0xbc82('0xa')]({'where':{'id':0x1},'attributes':[_0xbc82('0xb'),_0xbc82('0xc')],'raw':!![]})['then'](function(_0x4f4c5a){_0x31ab18=_0x4f4c5a;return _0x1e414a[_0xbc82('0xa')]({'attributes':['id',_0xbc82('0xd'),_0xbc82('0xe'),_0xbc82('0xf'),'role',_0xbc82('0x10'),_0xbc82('0x11'),_0xbc82('0x12'),_0xbc82('0x13')],'where':{'name':_0x5e10de,'role':{'$or':[_0xbc82('0x14'),_0xbc82('0x15'),_0xbc82('0x16')]}}});})['then'](function(_0x2eb661){if(!_0x2eb661||_0x2eb661&&_0x2eb661['name']!==_0x5e10de){throw new Error(_0xbc82('0x17'));}else{_0x5352e5=_0x2eb661;return _0x5352e5;}})['then'](function(){_0x5352e5['authenticate'](_0x7354e8,function(_0x9a24b6,_0x134160){var _0x5f19a0=_0x5352e5[_0xbc82('0x13')]+0x1;if(_0x9a24b6){return _0x34ae02(_0x9a24b6);}else if(!_0x134160){if(_0x5352e5[_0xbc82('0x10')]){return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}else if(_0x31ab18[_0xbc82('0xb')]>0x0){if(_0x5352e5[_0xbc82('0x11')]){if(_0x31ab18[_0xbc82('0xc')]>0x0){if(moment(_0x5352e5[_0xbc82('0x12')])[_0xbc82('0x18')](_0x31ab18['blockDuration'],_0xbc82('0x19'))>moment()){return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}else{return utils[_0xbc82('0x1a')](_0x5352e5,_0x5f19a0,![],null)[_0xbc82('0x1b')](function(){return _0x34ae02(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}}else{if(_0x5f19a0>=_0x31ab18[_0xbc82('0xb')]){return utils[_0xbc82('0x1a')](_0x5352e5,0x0,!![],moment())[_0xbc82('0x1b')](function(){return _0x34ae02(null,![],{'message':_0xbc82('0x17')});});}else{return utils['clearBlockUser'](_0x5352e5,_0x5f19a0,![],null)[_0xbc82('0x1b')](function(){return _0x34ae02(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}}else{if(_0x5352e5[_0xbc82('0x10')]){return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}else if(_0x31ab18[_0xbc82('0xb')]>0x0){if(_0x5352e5[_0xbc82('0x11')]){if(_0x31ab18[_0xbc82('0xc')]>0x0){if(moment(_0x5352e5['blockedAt'])[_0xbc82('0x18')](_0x31ab18[_0xbc82('0xc')],'minutes')>moment()){return _0x34ae02(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xbc82('0x1a')](_0x5352e5,0x0,![],null)[_0xbc82('0x1b')](function(){return utils[_0xbc82('0x1c')](_0x5352e5);})[_0xbc82('0x1b')](function(){return _0x34ae02(null,_0x5352e5);});}}else{return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}}else{return utils[_0xbc82('0x1a')](_0x5352e5,0x0,![],null)[_0xbc82('0x1b')](function(){return utils['getLicense'](_0x5352e5);})[_0xbc82('0x1b')](function(){return _0x34ae02(null,_0x5352e5);})[_0xbc82('0x1d')](function(_0x251de2){return _0x34ae02(null,![],_0x251de2);});}}else{if(_0x5352e5[_0xbc82('0x11')]){return _0x34ae02(null,![],{'message':_0xbc82('0x17')});}else{return utils[_0xbc82('0x1c')](_0x5352e5)[_0xbc82('0x1b')](function(){return _0x34ae02(null,_0x5352e5);});}}}});})[_0xbc82('0x1d')](function(_0x3b7784){return _0x34ae02(null,![],_0x3b7784);});}function sendServiceMail(_0x541a05){return db[_0xbc82('0x1e')][_0xbc82('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0xbc82('0x20')],'include':[{'model':db[_0xbc82('0x21')],'as':_0xbc82('0x22'),'include':[{'model':db[_0xbc82('0x23')],'as':_0xbc82('0x23')}]}]})[_0xbc82('0x1b')](function(_0x401b5c){if(!_0x401b5c){throw new Error(_0xbc82('0x24'));}var _0x24286e=_0x401b5c[_0xbc82('0x25')]();var _0x244ff1={'account':_0x24286e,'message':_['merge']({'from':util[_0xbc82('0x26')](_0xbc82('0x27'),_0x401b5c['name'],_0x401b5c[_0xbc82('0x20')]||_0x401b5c['Smtp'][_0xbc82('0x15')])},_0x541a05)};return client[_0xbc82('0x28')]('SendMail',_0x244ff1);})[_0xbc82('0x1b')](function(_0x3a466f){if(_0x3a466f['error']){throw new Error(util[_0xbc82('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3a466f[_0xbc82('0x29')][_0xbc82('0x2a')]||JSON[_0xbc82('0x2b')](_0x3a466f[_0xbc82('0x29')])));}return!![];});}function handleError(_0x1b6c4b,_0x5bdfa8,_0x2ac02c){return _0x1b6c4b[_0xbc82('0x2c')](_0x5bdfa8||0x1f4)[_0xbc82('0x2d')]({'message':_0x2ac02c?_0x2ac02c[_0xbc82('0x2a')]||_0x2ac02c:''});}exports[_0xbc82('0x2e')]=function(_0x25bfa7,_0x27d48e,_0x317642){passport['authenticate'](_0xbc82('0x2f'),function(_0xf92004,_0x8dfee4,_0x24db66){var _0x5a5c59=_0xf92004||_0x24db66;if(_0x5a5c59){return handleError(_0x27d48e,0x191,_0x5a5c59);}if(!_0x8dfee4){return handleError(_0x27d48e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2ef595={'payload':{'id':_0x8dfee4['id'],'role':_0x8dfee4[_0xbc82('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xbc82('0x31')](_0x2ef595)[_0xbc82('0x1b')](function(_0x13373f){_0x27d48e[_0xbc82('0x32')]({'id':_0x8dfee4['id'],'token':_0x13373f,'statusCall':'','isAlreadyLogged':_0x8dfee4[_0xbc82('0x33')]});});}})(_0x25bfa7,_0x27d48e,_0x317642);};exports['forgot']=function(_0x5585c5,_0x5d6bdf){if(!_0x5585c5[_0xbc82('0x34')][_0xbc82('0x20')]){return handleError(_0x5d6bdf,0x1f4,{'message':_0xbc82('0x35')});}var _0x167c5f=rs[_0xbc82('0x36')]();_0x5585c5[_0xbc82('0x34')][_0xbc82('0x20')]=_0x5585c5[_0xbc82('0x34')]['email']['trim']()[_0xbc82('0x37')]();var _0x504aec;return db[_0xbc82('0x9')][_0xbc82('0xa')]({'where':{'id':0x1},'attributes':[_0xbc82('0xb'),_0xbc82('0xc')],'raw':!![]})[_0xbc82('0x1b')](function(_0x3e2010){_0x504aec=_0x3e2010;return db['User'][_0xbc82('0x1f')]({'where':{'email':_0x5585c5[_0xbc82('0x34')][_0xbc82('0x20')]}});})[_0xbc82('0x1b')](function(_0x53f4f9){if(!_0x53f4f9){throw new Error(_0xbc82('0x38'));}if(_0x53f4f9[_0xbc82('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x53f4f9[_0xbc82('0x11')]){if(moment(_0x53f4f9[_0xbc82('0x12')])[_0xbc82('0x18')](_0x504aec[_0xbc82('0xc')],_0xbc82('0x19'))>moment()){throw new Error(_0xbc82('0x39'));}else{_0x53f4f9['blocked']=![];_0x53f4f9['blockedAt']=null;}}_0x53f4f9['resetPasswordToken']=_0x167c5f;_0x53f4f9[_0xbc82('0x3a')]=Date[_0xbc82('0x3b')]()+0x36ee80;return _0x53f4f9[_0xbc82('0x3c')]();})[_0xbc82('0x1b')](function(){return sendServiceMail({'to':_0x5585c5[_0xbc82('0x34')][_0xbc82('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xbc82('0x3d')+_0xbc82('0x3e')+_0xbc82('0x3f')+_0x5585c5[_0xbc82('0x40')][_0xbc82('0x41')]+_0xbc82('0x42')+_0x167c5f+'\x0a\x0a'+_0xbc82('0x43')});})[_0xbc82('0x1b')](function(){_0x5d6bdf['status'](0xc8)[_0xbc82('0x2d')]({'message':_0xbc82('0x44')});})[_0xbc82('0x1d')](function(_0x2d2d22){return handleError(_0x5d6bdf,0x1f4,_0x2d2d22);});};exports['reset']=function(_0x582ed9,_0x5001d3){return db[_0xbc82('0x45')][_0xbc82('0x1f')]({'where':{'resetPasswordToken':_0x582ed9[_0xbc82('0x46')][_0xbc82('0x47')],'resetPasswordExpires':{'$gt':Date[_0xbc82('0x3b')]()}}})['then'](function(_0x527991){if(!_0x527991){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xbc82('0x9')][_0xbc82('0xa')]({'attributes':['id','securePassword',_0xbc82('0x48'),_0xbc82('0x49')]})[_0xbc82('0x1b')](function(_0x1a0114){if(_0x1a0114[_0xbc82('0x4a')])authService[_0xbc82('0x4b')](_0x582ed9[_0xbc82('0x34')]['password']);if(!_0x1a0114[_0xbc82('0x48')]||!_0x527991['previousPasswords'])return _0x527991;authService[_0xbc82('0x4c')](_0x582ed9[_0xbc82('0x34')][_0xbc82('0xe')],_0x527991[_0xbc82('0x4d')],_0x1a0114[_0xbc82('0x49')]);return _0x527991;})['then'](function(){_0x527991[_0xbc82('0xe')]=_0x582ed9[_0xbc82('0x34')][_0xbc82('0xe')];_0x527991[_0xbc82('0x4e')]=null;_0x527991[_0xbc82('0x3a')]=null;return _0x527991['save']();});})['then'](function(){_0x5001d3['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0xbc82('0x1d')](function(_0x3d8877){return handleError(_0x5001d3,0x1f4,_0x3d8877);});};passport[_0xbc82('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0xbc82('0xe')},function(_0x3c815f,_0x3ee35b,_0x1140e7){return localAuthenticate(db[_0xbc82('0x45')],_0x3c815f,_0x3ee35b,_0x1140e7);})); \ No newline at end of file +var _0x74b3=['validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords'];(function(_0x2ea591,_0x493fef){var _0x2ad7d1=function(_0x434685){while(--_0x434685){_0x2ea591['push'](_0x2ea591['shift']());}};_0x2ad7d1(++_0x493fef);}(_0x74b3,0x14f));var _0x374b=function(_0x3365fa,_0x1f27c9){_0x3365fa=_0x3365fa-0x0;var _0x573910=_0x74b3[_0x3365fa];return _0x573910;};'use strict';var util=require(_0x374b('0x0'));var passport=require(_0x374b('0x1'));var LocalStrategy=require('passport-local')[_0x374b('0x2')];var jayson=require(_0x374b('0x3'));var _=require(_0x374b('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x374b('0x5'));var utils=require(_0x374b('0x6'));var client=jayson[_0x374b('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x4cde5f,_0x112ccd,_0x16f7ab,_0x40fc43){var _0x147c1a,_0x432b0d;return db[_0x374b('0x8')][_0x374b('0x9')]({'where':{'id':0x1},'attributes':[_0x374b('0xa'),_0x374b('0xb')],'raw':!![]})[_0x374b('0xc')](function(_0x4d220d){_0x147c1a=_0x4d220d;return _0x4cde5f[_0x374b('0x9')]({'attributes':['id',_0x374b('0xd'),_0x374b('0xe'),_0x374b('0xf'),_0x374b('0x10'),'disabled','blocked',_0x374b('0x11'),'loginAttempts'],'where':{'name':_0x112ccd,'role':{'$or':['admin',_0x374b('0x12'),_0x374b('0x13')]}}});})['then'](function(_0x2e3802){if(!_0x2e3802||_0x2e3802&&_0x2e3802['name']!==_0x112ccd){throw new Error(_0x374b('0x14'));}else{_0x432b0d=_0x2e3802;return _0x432b0d;}})['then'](function(){_0x432b0d[_0x374b('0x15')](_0x16f7ab,function(_0x4ac813,_0x4e471e){var _0x3a177d=_0x432b0d['loginAttempts']+0x1;if(_0x4ac813){return _0x40fc43(_0x4ac813);}else if(!_0x4e471e){if(_0x432b0d[_0x374b('0x16')]){return _0x40fc43(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x147c1a[_0x374b('0xa')]>0x0){if(_0x432b0d[_0x374b('0x17')]){if(_0x147c1a['blockDuration']>0x0){if(moment(_0x432b0d[_0x374b('0x11')])[_0x374b('0x18')](_0x147c1a['blockDuration'],_0x374b('0x19'))>moment()){return _0x40fc43(null,![],{'message':_0x374b('0x14')});}else{return utils[_0x374b('0x1a')](_0x432b0d,_0x3a177d,![],null)[_0x374b('0xc')](function(){return _0x40fc43(null,![],{'message':_0x374b('0x14')});});}}else{return _0x40fc43(null,![],{'message':_0x374b('0x14')});}}else{if(_0x3a177d>=_0x147c1a[_0x374b('0xa')]){return utils[_0x374b('0x1a')](_0x432b0d,0x0,!![],moment())['then'](function(){return _0x40fc43(null,![],{'message':_0x374b('0x14')});});}else{return utils[_0x374b('0x1a')](_0x432b0d,_0x3a177d,![],null)[_0x374b('0xc')](function(){return _0x40fc43(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x40fc43(null,![],{'message':_0x374b('0x14')});}}else{if(_0x432b0d['disabled']){return _0x40fc43(null,![],{'message':_0x374b('0x14')});}else if(_0x147c1a[_0x374b('0xa')]>0x0){if(_0x432b0d[_0x374b('0x17')]){if(_0x147c1a[_0x374b('0xb')]>0x0){if(moment(_0x432b0d[_0x374b('0x11')])[_0x374b('0x18')](_0x147c1a['blockDuration'],_0x374b('0x19'))>moment()){return _0x40fc43(null,![],{'message':_0x374b('0x14')});}else{return utils[_0x374b('0x1a')](_0x432b0d,0x0,![],null)[_0x374b('0xc')](function(){return utils[_0x374b('0x1b')](_0x432b0d);})[_0x374b('0xc')](function(){return _0x40fc43(null,_0x432b0d);});}}else{return _0x40fc43(null,![],{'message':_0x374b('0x14')});}}else{return utils[_0x374b('0x1a')](_0x432b0d,0x0,![],null)[_0x374b('0xc')](function(){return utils['getLicense'](_0x432b0d);})[_0x374b('0xc')](function(){return _0x40fc43(null,_0x432b0d);})[_0x374b('0x1c')](function(_0x2328ff){return _0x40fc43(null,![],_0x2328ff);});}}else{if(_0x432b0d[_0x374b('0x17')]){return _0x40fc43(null,![],{'message':_0x374b('0x14')});}else{return utils[_0x374b('0x1b')](_0x432b0d)[_0x374b('0xc')](function(){return _0x40fc43(null,_0x432b0d);});}}}});})[_0x374b('0x1c')](function(_0x2b3b52){return _0x40fc43(null,![],_0x2b3b52);});}function sendServiceMail(_0x1de34b){return db[_0x374b('0x1d')][_0x374b('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x374b('0x1f')],'include':[{'model':db[_0x374b('0x20')],'as':_0x374b('0x21'),'include':[{'model':db[_0x374b('0x22')],'as':_0x374b('0x22')}]}]})[_0x374b('0xc')](function(_0x3778ab){if(!_0x3778ab){throw new Error(_0x374b('0x23'));}var _0x593c98=_0x3778ab['getSmtpOptions']();var _0x1c196b={'account':_0x593c98,'message':_['merge']({'from':util[_0x374b('0x24')](_0x374b('0x25'),_0x3778ab[_0x374b('0xd')],_0x3778ab[_0x374b('0x1f')]||_0x3778ab[_0x374b('0x21')][_0x374b('0x12')])},_0x1de34b)};return client[_0x374b('0x26')](_0x374b('0x27'),_0x1c196b);})[_0x374b('0xc')](function(_0x176a3a){if(_0x176a3a[_0x374b('0x28')]){throw new Error(util[_0x374b('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x176a3a[_0x374b('0x28')][_0x374b('0x29')]||JSON[_0x374b('0x2a')](_0x176a3a[_0x374b('0x28')])));}return!![];});}function handleError(_0x184368,_0x629adc,_0x4b17a1){return _0x184368['status'](_0x629adc||0x1f4)[_0x374b('0x2b')]({'message':_0x4b17a1?_0x4b17a1[_0x374b('0x29')]||_0x4b17a1:''});}exports[_0x374b('0x2c')]=function(_0x2842be,_0x1e24bf,_0x4c976b){passport[_0x374b('0x15')](_0x374b('0x2d'),function(_0x868b8c,_0x4294a4,_0x20c6f9){var _0xe90c73=_0x868b8c||_0x20c6f9;if(_0xe90c73){return handleError(_0x1e24bf,0x191,_0xe90c73);}if(!_0x4294a4){return handleError(_0x1e24bf,0x194,{'message':_0x374b('0x2e')});}else{var _0x56f186={'payload':{'id':_0x4294a4['id'],'role':_0x4294a4[_0x374b('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x374b('0x2f')](_0x56f186)['then'](function(_0x5324b1){_0x1e24bf['json']({'id':_0x4294a4['id'],'token':_0x5324b1,'statusCall':'','isAlreadyLogged':_0x4294a4[_0x374b('0x30')]});});}})(_0x2842be,_0x1e24bf,_0x4c976b);};exports[_0x374b('0x31')]=function(_0x431a55,_0x2487a4){if(!_0x431a55['body'][_0x374b('0x1f')]){return handleError(_0x2487a4,0x1f4,{'message':_0x374b('0x32')});}var _0x41921d=rs[_0x374b('0x33')]();_0x431a55[_0x374b('0x34')][_0x374b('0x1f')]=_0x431a55[_0x374b('0x34')]['email'][_0x374b('0x35')]()[_0x374b('0x36')]();var _0x4fd210;return db[_0x374b('0x8')][_0x374b('0x9')]({'where':{'id':0x1},'attributes':[_0x374b('0xa'),_0x374b('0xb')],'raw':!![]})[_0x374b('0xc')](function(_0x33cb16){_0x4fd210=_0x33cb16;return db[_0x374b('0x37')][_0x374b('0x1e')]({'where':{'email':_0x431a55[_0x374b('0x34')][_0x374b('0x1f')]}});})[_0x374b('0xc')](function(_0x30a1cc){if(!_0x30a1cc){throw new Error(_0x374b('0x38'));}if(_0x30a1cc[_0x374b('0x16')]){throw new Error(_0x374b('0x39'));}if(_0x30a1cc[_0x374b('0x17')]){if(moment(_0x30a1cc['blockedAt'])['add'](_0x4fd210['blockDuration'],'minutes')>moment()){throw new Error(_0x374b('0x3a'));}else{_0x30a1cc[_0x374b('0x17')]=![];_0x30a1cc[_0x374b('0x11')]=null;}}_0x30a1cc[_0x374b('0x3b')]=_0x41921d;_0x30a1cc[_0x374b('0x3c')]=Date[_0x374b('0x3d')]()+0x36ee80;return _0x30a1cc[_0x374b('0x3e')]();})[_0x374b('0xc')](function(){return sendServiceMail({'to':_0x431a55['body']['email'],'subject':_0x374b('0x3f'),'text':_0x374b('0x40')+_0x374b('0x41')+_0x374b('0x42')+_0x431a55[_0x374b('0x43')]['host']+_0x374b('0x44')+_0x41921d+'\x0a\x0a'+_0x374b('0x45')});})[_0x374b('0xc')](function(){_0x2487a4[_0x374b('0x46')](0xc8)[_0x374b('0x2b')]({'message':_0x374b('0x47')});})[_0x374b('0x1c')](function(_0x57e64c){return handleError(_0x2487a4,0x1f4,_0x57e64c);});};exports['reset']=function(_0x4fd1d0,_0x1676ae){return db[_0x374b('0x37')][_0x374b('0x1e')]({'where':{'resetPasswordToken':_0x4fd1d0[_0x374b('0x48')][_0x374b('0x49')],'resetPasswordExpires':{'$gt':Date[_0x374b('0x3d')]()}}})[_0x374b('0xc')](function(_0x115321){if(!_0x115321){throw new Error(_0x374b('0x4a'));}return db[_0x374b('0x8')][_0x374b('0x9')]({'attributes':['id','securePassword',_0x374b('0x4b'),_0x374b('0x4c')]})['then'](function(_0x59ae2b){if(_0x59ae2b[_0x374b('0x4d')])authService[_0x374b('0x4e')](_0x4fd1d0[_0x374b('0x34')]['password']);if(!_0x59ae2b['enforcePasswordHistory']||!_0x115321[_0x374b('0x4f')])return _0x115321;authService[_0x374b('0x50')](_0x4fd1d0[_0x374b('0x34')][_0x374b('0xe')],_0x115321[_0x374b('0x4f')],_0x59ae2b[_0x374b('0x4c')]);return _0x115321;})[_0x374b('0xc')](function(){_0x115321[_0x374b('0xe')]=_0x4fd1d0[_0x374b('0x34')]['password'];_0x115321['resetPasswordToken']=null;_0x115321['resetPasswordExpires']=null;return _0x115321[_0x374b('0x3e')]();});})[_0x374b('0xc')](function(){_0x1676ae[_0x374b('0x46')](0xc8)[_0x374b('0x2b')]({'message':_0x374b('0x51')});})[_0x374b('0x1c')](function(_0x5cecda){return handleError(_0x1676ae,0x1f4,_0x5cecda);});};passport[_0x374b('0x52')]('local-login',new LocalStrategy({'usernameField':_0x374b('0xd'),'passwordField':'password'},function(_0x438d78,_0x5490b1,_0x56bfbf){return localAuthenticate(db[_0x374b('0x37')],_0x438d78,_0x5490b1,_0x56bfbf);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 258932e..7ea1c7d 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 _0x8964=['exports','express','post','/forgot','forgot','/reset/:token'];(function(_0x11d4b1,_0x6f58ca){var _0x1302ba=function(_0x4c75c1){while(--_0x4c75c1){_0x11d4b1['push'](_0x11d4b1['shift']());}};_0x1302ba(++_0x6f58ca);}(_0x8964,0xf7));var _0x4896=function(_0x24aa5c,_0x4ee4d3){_0x24aa5c=_0x24aa5c-0x0;var _0x19eb18=_0x8964[_0x24aa5c];return _0x19eb18;};'use strict';var express=require(_0x4896('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x4896('0x1')]('/',controller['login']);router[_0x4896('0x1')](_0x4896('0x2'),controller[_0x4896('0x3')]);router['post'](_0x4896('0x4'),controller['reset']);module[_0x4896('0x5')]=router; \ No newline at end of file +var _0x532d=['/reset/:token','reset','exports','express','Router','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x1ca64e,_0x1a7bdc){var _0x4319cb=function(_0x4170a3){while(--_0x4170a3){_0x1ca64e['push'](_0x1ca64e['shift']());}};_0x4319cb(++_0x1a7bdc);}(_0x532d,0x157));var _0xd532=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x532d[_0x4eaa4c];return _0x15aec6;};'use strict';var express=require(_0xd532('0x0'));var router=express[_0xd532('0x1')]();var controller=require(_0xd532('0x2'));router[_0xd532('0x3')]('/',controller[_0xd532('0x4')]);router[_0xd532('0x3')](_0xd532('0x5'),controller[_0xd532('0x6')]);router[_0xd532('0x3')](_0xd532('0x7'),controller[_0xd532('0x8')]);module[_0xd532('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 5f3587e..3d2505d 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 _0xcace=['INTEGER','sequelize','exports','STRING'];(function(_0xc1f995,_0x22e33c){var _0x2f7370=function(_0x3a9c06){while(--_0x3a9c06){_0xc1f995['push'](_0xc1f995['shift']());}};_0x2f7370(++_0x22e33c);}(_0xcace,0x6d));var _0xecac=function(_0x264609,_0x7609b9){_0x264609=_0x264609-0x0;var _0x1f38b9=_0xcace[_0x264609];return _0x1f38b9;};'use strict';var Sequelize=require(_0xecac('0x0'));module[_0xecac('0x1')]={'name':{'type':Sequelize[_0xecac('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xecac('0x2')]},'description':{'type':Sequelize[_0xecac('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xecac('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x34a1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1d9efc,_0x5892d7){var _0x324b21=function(_0x2257f0){while(--_0x2257f0){_0x1d9efc['push'](_0x1d9efc['shift']());}};_0x324b21(++_0x5892d7);}(_0x34a1,0xf7));var _0x134a=function(_0x2a8d8a,_0x38d93a){_0x2a8d8a=_0x2a8d8a-0x0;var _0x325fa7=_0x34a1[_0x2a8d8a];return _0x325fa7;};'use strict';var Sequelize=require(_0x134a('0x0'));module[_0x134a('0x1')]={'name':{'type':Sequelize[_0x134a('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x134a('0x2')]},'description':{'type':Sequelize[_0x134a('0x2')]},'status':{'type':Sequelize[_0x134a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 862506c..fe54275 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 _0xa7b9=['intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','Automation','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','query','keys','filters'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa7b9,0x76));var _0x9a7b=function(_0xcbe787,_0x401e4c){_0xcbe787=_0xcbe787-0x0;var _0x4c78fa=_0xa7b9[_0xcbe787];return _0x4c78fa;};'use strict';var emlformat=require(_0x9a7b('0x0'));var rimraf=require(_0x9a7b('0x1'));var zipdir=require(_0x9a7b('0x2'));var jsonpatch=require(_0x9a7b('0x3'));var rp=require(_0x9a7b('0x4'));var moment=require('moment');var BPromise=require(_0x9a7b('0x5'));var Mustache=require('mustache');var util=require(_0x9a7b('0x6'));var path=require(_0x9a7b('0x7'));var sox=require(_0x9a7b('0x8'));var csv=require(_0x9a7b('0x9'));var ejs=require(_0x9a7b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a7b('0xb'));var _=require(_0x9a7b('0xc'));var squel=require(_0x9a7b('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a7b('0x9'));var querystring=require(_0x9a7b('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a7b('0xf'));var authService=require(_0x9a7b('0x10'));var qs=require(_0x9a7b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a7b('0x12'))(_0x9a7b('0x13'));var utils=require('../../config/utils');var config=require(_0x9a7b('0x14'));var licenseUtil=require(_0x9a7b('0x15'));var db=require(_0x9a7b('0x16'))['db'];function respondWithStatusCode(_0x246718,_0x358893){_0x358893=_0x358893||0xcc;return function(_0x5d9e7b){if(_0x5d9e7b){return _0x246718['sendStatus'](_0x358893);}return _0x246718[_0x9a7b('0x17')](_0x358893)[_0x9a7b('0x18')]();};}function respondWithResult(_0x2bf0fd,_0xf22471){_0xf22471=_0xf22471||0xc8;return function(_0x110460){if(_0x110460){return _0x2bf0fd[_0x9a7b('0x17')](_0xf22471)[_0x9a7b('0x19')](_0x110460);}};}function respondWithFilteredResult(_0x3a9d4f,_0x55a284){return function(_0x56c9ad){if(_0x56c9ad){var _0x504b8c=typeof _0x55a284[_0x9a7b('0x1a')]==='undefined'&&typeof _0x55a284['limit']===_0x9a7b('0x1b');var _0x58b03a=_0x56c9ad['count'];var _0x4da0c4=_0x504b8c?0x0:_0x55a284[_0x9a7b('0x1a')];var _0x193f74=_0x504b8c?_0x56c9ad[_0x9a7b('0x1c')]:_0x55a284['offset']+_0x55a284[_0x9a7b('0x1d')];var _0x5e6777;if(_0x193f74>=_0x58b03a){_0x193f74=_0x58b03a;_0x5e6777=0xc8;}else{_0x5e6777=0xce;}_0x3a9d4f['status'](_0x5e6777);return _0x3a9d4f[_0x9a7b('0x1e')](_0x9a7b('0x1f'),_0x4da0c4+'-'+_0x193f74+'/'+_0x58b03a)[_0x9a7b('0x19')](_0x56c9ad);}return null;};}function patchUpdates(_0x2469ad){return function(_0x514fd9){try{jsonpatch[_0x9a7b('0x20')](_0x514fd9,_0x2469ad,!![]);}catch(_0x6ef3e1){return BPromise['reject'](_0x6ef3e1);}return _0x514fd9['save']();};}function saveUpdates(_0x260066,_0x2cd90d){return function(_0x5f2ace){if(_0x5f2ace){return _0x5f2ace[_0x9a7b('0x21')](_0x260066)[_0x9a7b('0x22')](function(_0x498fa9){return _0x498fa9;});}return null;};}function removeEntity(_0x522fe2,_0x5f1f28){return function(_0x2b42cc){if(_0x2b42cc){return _0x2b42cc[_0x9a7b('0x23')]()[_0x9a7b('0x22')](function(){_0x522fe2['status'](0xcc)[_0x9a7b('0x18')]();});}};}function handleEntityNotFound(_0x51aa23,_0x941cd9){return function(_0x318552){if(!_0x318552){_0x51aa23[_0x9a7b('0x24')](0x194);}return _0x318552;};}function handleError(_0x4eb5f6,_0x43ad1e){_0x43ad1e=_0x43ad1e||0x1f4;return function(_0x50bc1c){logger[_0x9a7b('0x25')](_0x50bc1c['stack']);if(_0x50bc1c[_0x9a7b('0x26')]){delete _0x50bc1c[_0x9a7b('0x26')];}_0x4eb5f6[_0x9a7b('0x17')](_0x43ad1e)[_0x9a7b('0x27')](_0x50bc1c);};}exports[_0x9a7b('0x28')]=function(_0x2fbf11,_0x52e4c6){var _0xced8e8={},_0xfcb437={},_0x52e57c={'count':0x0,'rows':[]};var _0x940d87=_[_0x9a7b('0x29')](db['Automation']['rawAttributes'],function(_0x3f4980){return{'name':_0x3f4980[_0x9a7b('0x2a')],'type':_0x3f4980[_0x9a7b('0x2b')][_0x9a7b('0x2c')]};});_0xfcb437['model']=_[_0x9a7b('0x29')](_0x940d87,_0x9a7b('0x26'));_0xfcb437[_0x9a7b('0x2d')]=_[_0x9a7b('0x2e')](_0x2fbf11[_0x9a7b('0x2d')]);_0xfcb437[_0x9a7b('0x2f')]=_[_0x9a7b('0x30')](_0xfcb437[_0x9a7b('0x31')],_0xfcb437[_0x9a7b('0x2d')]);_0xced8e8[_0x9a7b('0x32')]=_['intersection'](_0xfcb437[_0x9a7b('0x31')],qs[_0x9a7b('0x33')](_0x2fbf11[_0x9a7b('0x2d')][_0x9a7b('0x33')]));_0xced8e8[_0x9a7b('0x32')]=_0xced8e8[_0x9a7b('0x32')][_0x9a7b('0x34')]?_0xced8e8[_0x9a7b('0x32')]:_0xfcb437[_0x9a7b('0x31')];if(!_0x2fbf11[_0x9a7b('0x2d')][_0x9a7b('0x35')]('nolimit')){_0xced8e8['limit']=qs['limit'](_0x2fbf11[_0x9a7b('0x2d')]['limit']);_0xced8e8[_0x9a7b('0x1a')]=qs[_0x9a7b('0x1a')](_0x2fbf11[_0x9a7b('0x2d')][_0x9a7b('0x1a')]);}_0xced8e8[_0x9a7b('0x36')]=qs[_0x9a7b('0x37')](_0x2fbf11['query'][_0x9a7b('0x37')]);_0xced8e8['where']=qs[_0x9a7b('0x2f')](_[_0x9a7b('0x38')](_0x2fbf11[_0x9a7b('0x2d')],_0xfcb437[_0x9a7b('0x2f')]),_0x940d87);if(_0x2fbf11[_0x9a7b('0x2d')]['filter']){_0xced8e8[_0x9a7b('0x39')]=_[_0x9a7b('0x3a')](_0xced8e8[_0x9a7b('0x39')],{'$or':_[_0x9a7b('0x29')](_0x940d87,function(_0x4e5beb){if(_0x4e5beb[_0x9a7b('0x2b')]!==_0x9a7b('0x3b')){var _0x448511={};_0x448511[_0x4e5beb[_0x9a7b('0x26')]]={'$like':'%'+_0x2fbf11[_0x9a7b('0x2d')][_0x9a7b('0x3c')]+'%'};return _0x448511;}})});}_0xced8e8=_[_0x9a7b('0x3a')]({},_0xced8e8,_0x2fbf11['options']);var _0x1841ef={'where':_0xced8e8['where']};return db[_0x9a7b('0x3d')][_0x9a7b('0x1c')](_0x1841ef)[_0x9a7b('0x22')](function(_0x8c8f7b){_0x52e57c[_0x9a7b('0x1c')]=_0x8c8f7b;if(_0x2fbf11[_0x9a7b('0x2d')][_0x9a7b('0x3e')]){_0xced8e8[_0x9a7b('0x3f')]=[{'all':!![]}];}return db[_0x9a7b('0x3d')][_0x9a7b('0x40')](_0xced8e8);})[_0x9a7b('0x22')](function(_0x5f35a3){_0x52e57c['rows']=_0x5f35a3;return _0x52e57c;})['then'](respondWithFilteredResult(_0x52e4c6,_0xced8e8))[_0x9a7b('0x41')](handleError(_0x52e4c6,null));};exports[_0x9a7b('0x42')]=function(_0x286056,_0x4160d5){var _0x172238={'raw':![],'where':{'id':_0x286056[_0x9a7b('0x43')]['id']}},_0x3f6939={};_0x3f6939[_0x9a7b('0x31')]=_['keys'](db[_0x9a7b('0x3d')][_0x9a7b('0x44')]);_0x3f6939[_0x9a7b('0x2d')]=_[_0x9a7b('0x2e')](_0x286056['query']);_0x3f6939['filters']=_[_0x9a7b('0x30')](_0x3f6939[_0x9a7b('0x31')],_0x3f6939['query']);_0x172238[_0x9a7b('0x32')]=_[_0x9a7b('0x30')](_0x3f6939[_0x9a7b('0x31')],qs['fields'](_0x286056[_0x9a7b('0x2d')][_0x9a7b('0x33')]));_0x172238['attributes']=_0x172238['attributes'][_0x9a7b('0x34')]?_0x172238[_0x9a7b('0x32')]:_0x3f6939[_0x9a7b('0x31')];if(_0x286056[_0x9a7b('0x2d')]['includeAll']){_0x172238['include']=[{'all':!![]}];}_0x172238=_[_0x9a7b('0x3a')]({},_0x172238,_0x286056[_0x9a7b('0x45')]);return db[_0x9a7b('0x3d')][_0x9a7b('0x46')](_0x172238)['then'](handleEntityNotFound(_0x4160d5,null))[_0x9a7b('0x22')](respondWithResult(_0x4160d5,null))[_0x9a7b('0x41')](handleError(_0x4160d5,null));};exports[_0x9a7b('0x47')]=function(_0x3f9b92,_0x31fefb){return db[_0x9a7b('0x3d')][_0x9a7b('0x47')](_0x3f9b92[_0x9a7b('0x48')],{})['then'](respondWithResult(_0x31fefb,0xc9))['catch'](handleError(_0x31fefb,null));};exports[_0x9a7b('0x21')]=function(_0x155b47,_0x38f832){if(_0x155b47[_0x9a7b('0x48')]['id']){delete _0x155b47['body']['id'];}return db[_0x9a7b('0x3d')][_0x9a7b('0x46')]({'where':{'id':_0x155b47[_0x9a7b('0x43')]['id']}})[_0x9a7b('0x22')](handleEntityNotFound(_0x38f832,null))[_0x9a7b('0x22')](saveUpdates(_0x155b47[_0x9a7b('0x48')],null))[_0x9a7b('0x22')](respondWithResult(_0x38f832,null))[_0x9a7b('0x41')](handleError(_0x38f832,null));};exports[_0x9a7b('0x23')]=function(_0x423c01,_0x4d6e88){return db[_0x9a7b('0x3d')]['find']({'where':{'id':_0x423c01[_0x9a7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d6e88,null))['then'](removeEntity(_0x4d6e88,null))[_0x9a7b('0x41')](handleError(_0x4d6e88,null));};exports[_0x9a7b('0x49')]=function(_0x3206e9,_0x3318fd,_0x31d338){return db[_0x9a7b('0x4a')][_0x9a7b('0x46')]({'where':{'id':_0x3206e9['params']['id']}})['then'](handleEntityNotFound(_0x3318fd,null))['then'](function(_0x4b8a17){if(_0x4b8a17){return _0x4b8a17[_0x9a7b('0x49')](_0x3206e9[_0x9a7b('0x48')][_0x9a7b('0x4b')],_[_0x9a7b('0x4c')](_0x3206e9[_0x9a7b('0x48')],[_0x9a7b('0x4b'),'id'])||{});}})[_0x9a7b('0x22')](respondWithResult(_0x3318fd,null))[_0x9a7b('0x41')](handleError(_0x3318fd,null));};exports[_0x9a7b('0x4d')]=function(_0x1b121b,_0x41699a,_0x48a75d){var _0x173059={};var _0x283dde={};var _0x2a6616;var _0x4b7d7a;return db[_0x9a7b('0x3d')][_0x9a7b('0x4e')]({'where':{'id':_0x1b121b[_0x9a7b('0x43')]['id']}})[_0x9a7b('0x22')](handleEntityNotFound(_0x41699a,null))[_0x9a7b('0x22')](function(_0x4ea1db){if(_0x4ea1db){_0x2a6616=_0x4ea1db;_0x283dde[_0x9a7b('0x31')]=_['keys'](db[_0x9a7b('0x4a')]['rawAttributes']);_0x283dde[_0x9a7b('0x2d')]=_[_0x9a7b('0x2e')](_0x1b121b[_0x9a7b('0x2d')]);_0x283dde['filters']=_['intersection'](_0x283dde[_0x9a7b('0x31')],_0x283dde['query']);_0x173059[_0x9a7b('0x32')]=_['intersection'](_0x283dde[_0x9a7b('0x31')],qs[_0x9a7b('0x33')](_0x1b121b[_0x9a7b('0x2d')][_0x9a7b('0x33')]));_0x173059[_0x9a7b('0x32')]=_0x173059['attributes']['length']?_0x173059[_0x9a7b('0x32')]:_0x283dde[_0x9a7b('0x31')];_0x173059['order']=qs[_0x9a7b('0x37')](_0x1b121b[_0x9a7b('0x2d')][_0x9a7b('0x37')]);_0x173059[_0x9a7b('0x39')]=qs[_0x9a7b('0x2f')](_[_0x9a7b('0x38')](_0x1b121b['query'],_0x283dde[_0x9a7b('0x2f')]));if(_0x1b121b[_0x9a7b('0x2d')][_0x9a7b('0x3c')]){_0x173059[_0x9a7b('0x39')]=_[_0x9a7b('0x3a')](_0x173059[_0x9a7b('0x39')],{'$or':_['map'](_0x173059[_0x9a7b('0x32')],function(_0x295a7a){var _0x46effe={};_0x46effe[_0x295a7a]={'$like':'%'+_0x1b121b[_0x9a7b('0x2d')][_0x9a7b('0x3c')]+'%'};return _0x46effe;})});}_0x173059=_[_0x9a7b('0x3a')]({},_0x173059,_0x1b121b[_0x9a7b('0x45')]);return _0x2a6616[_0x9a7b('0x4d')](_0x173059);}})['then'](function(_0x2373f7){if(_0x2373f7){_0x4b7d7a=_0x2373f7[_0x9a7b('0x34')];if(!_0x1b121b['query'][_0x9a7b('0x35')](_0x9a7b('0x4f'))){_0x173059[_0x9a7b('0x1d')]=qs['limit'](_0x1b121b[_0x9a7b('0x2d')]['limit']);_0x173059[_0x9a7b('0x1a')]=qs[_0x9a7b('0x1a')](_0x1b121b[_0x9a7b('0x2d')]['offset']);}return _0x2a6616[_0x9a7b('0x4d')](_0x173059);}})['then'](function(_0x44baff){if(_0x44baff){return _0x44baff?{'count':_0x4b7d7a,'rows':_0x44baff}:null;}})['then'](respondWithResult(_0x41699a,null))[_0x9a7b('0x41')](handleError(_0x41699a,null));};exports[_0x9a7b('0x50')]=function(_0x565115,_0x17cbec,_0x15257f){return db[_0x9a7b('0x51')]['find']({'where':{'id':_0x565115[_0x9a7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x17cbec,null))[_0x9a7b('0x22')](function(_0x2089fa){if(_0x2089fa){return _0x2089fa[_0x9a7b('0x50')](_0x565115[_0x9a7b('0x48')][_0x9a7b('0x4b')],_[_0x9a7b('0x4c')](_0x565115[_0x9a7b('0x48')],[_0x9a7b('0x4b'),'id'])||{});}})[_0x9a7b('0x22')](respondWithResult(_0x17cbec,null))[_0x9a7b('0x41')](handleError(_0x17cbec,null));};exports[_0x9a7b('0x52')]=function(_0x5ce570,_0x59fa10,_0x3f69fd){var _0x284116={};var _0xf8e5d9={};var _0x3b0c99;var _0x555998;return db['Automation'][_0x9a7b('0x4e')]({'where':{'id':_0x5ce570[_0x9a7b('0x43')]['id']}})['then'](handleEntityNotFound(_0x59fa10,null))[_0x9a7b('0x22')](function(_0x351fe4){if(_0x351fe4){_0x3b0c99=_0x351fe4;_0xf8e5d9[_0x9a7b('0x31')]=_[_0x9a7b('0x2e')](db[_0x9a7b('0x51')][_0x9a7b('0x44')]);_0xf8e5d9[_0x9a7b('0x2d')]=_[_0x9a7b('0x2e')](_0x5ce570[_0x9a7b('0x2d')]);_0xf8e5d9['filters']=_[_0x9a7b('0x30')](_0xf8e5d9['model'],_0xf8e5d9[_0x9a7b('0x2d')]);_0x284116[_0x9a7b('0x32')]=_['intersection'](_0xf8e5d9[_0x9a7b('0x31')],qs['fields'](_0x5ce570[_0x9a7b('0x2d')][_0x9a7b('0x33')]));_0x284116['attributes']=_0x284116[_0x9a7b('0x32')][_0x9a7b('0x34')]?_0x284116[_0x9a7b('0x32')]:_0xf8e5d9[_0x9a7b('0x31')];_0x284116[_0x9a7b('0x36')]=qs[_0x9a7b('0x37')](_0x5ce570['query'][_0x9a7b('0x37')]);_0x284116[_0x9a7b('0x39')]=qs[_0x9a7b('0x2f')](_['pick'](_0x5ce570[_0x9a7b('0x2d')],_0xf8e5d9['filters']));if(_0x5ce570[_0x9a7b('0x2d')]['filter']){_0x284116['where']=_[_0x9a7b('0x3a')](_0x284116[_0x9a7b('0x39')],{'$or':_['map'](_0x284116[_0x9a7b('0x32')],function(_0x4e1381){var _0x4f5dd2={};_0x4f5dd2[_0x4e1381]={'$like':'%'+_0x5ce570[_0x9a7b('0x2d')][_0x9a7b('0x3c')]+'%'};return _0x4f5dd2;})});}_0x284116=_[_0x9a7b('0x3a')]({},_0x284116,_0x5ce570[_0x9a7b('0x45')]);return _0x3b0c99['getActions'](_0x284116);}})['then'](function(_0xc2d694){if(_0xc2d694){_0x555998=_0xc2d694[_0x9a7b('0x34')];if(!_0x5ce570[_0x9a7b('0x2d')][_0x9a7b('0x35')](_0x9a7b('0x4f'))){_0x284116[_0x9a7b('0x1d')]=qs[_0x9a7b('0x1d')](_0x5ce570[_0x9a7b('0x2d')][_0x9a7b('0x1d')]);_0x284116[_0x9a7b('0x1a')]=qs[_0x9a7b('0x1a')](_0x5ce570[_0x9a7b('0x2d')][_0x9a7b('0x1a')]);}return _0x3b0c99['getActions'](_0x284116);}})[_0x9a7b('0x22')](function(_0x1af15f){if(_0x1af15f){return _0x1af15f?{'count':_0x555998,'rows':_0x1af15f}:null;}})['then'](respondWithResult(_0x59fa10,null))[_0x9a7b('0x41')](handleError(_0x59fa10,null));}; \ No newline at end of file +var _0xf6f3=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','Action','addActions','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring'];(function(_0x2283e1,_0x560558){var _0x57a1ab=function(_0x576d55){while(--_0x576d55){_0x2283e1['push'](_0x2283e1['shift']());}};_0x57a1ab(++_0x560558);}(_0xf6f3,0xa1));var _0x3f6f=function(_0x589989,_0x2cfd1f){_0x589989=_0x589989-0x0;var _0x50584f=_0xf6f3[_0x589989];return _0x50584f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f6f('0x0'));var jsonpatch=require(_0x3f6f('0x1'));var rp=require(_0x3f6f('0x2'));var moment=require(_0x3f6f('0x3'));var BPromise=require(_0x3f6f('0x4'));var Mustache=require(_0x3f6f('0x5'));var util=require(_0x3f6f('0x6'));var path=require(_0x3f6f('0x7'));var sox=require(_0x3f6f('0x8'));var csv=require('to-csv');var ejs=require(_0x3f6f('0x9'));var fs=require('fs');var fs_extra=require(_0x3f6f('0xa'));var _=require(_0x3f6f('0xb'));var squel=require(_0x3f6f('0xc'));var crypto=require(_0x3f6f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3f6f('0xe'));var toCsv=require(_0x3f6f('0xf'));var querystring=require(_0x3f6f('0x10'));var Papa=require(_0x3f6f('0x11'));var Redis=require('ioredis');var authService=require(_0x3f6f('0x12'));var qs=require(_0x3f6f('0x13'));var as=require(_0x3f6f('0x14'));var hardwareService=require(_0x3f6f('0x15'));var logger=require('../../config/logger')(_0x3f6f('0x16'));var utils=require(_0x3f6f('0x17'));var config=require(_0x3f6f('0x18'));var licenseUtil=require(_0x3f6f('0x19'));var db=require(_0x3f6f('0x1a'))['db'];function respondWithStatusCode(_0x1bfb66,_0x407f24){_0x407f24=_0x407f24||0xcc;return function(_0x1fd22a){if(_0x1fd22a){return _0x1bfb66['sendStatus'](_0x407f24);}return _0x1bfb66[_0x3f6f('0x1b')](_0x407f24)[_0x3f6f('0x1c')]();};}function respondWithResult(_0x5f9195,_0x2d0973){_0x2d0973=_0x2d0973||0xc8;return function(_0x2dc60d){if(_0x2dc60d){return _0x5f9195[_0x3f6f('0x1b')](_0x2d0973)['json'](_0x2dc60d);}};}function respondWithFilteredResult(_0x534b09,_0x54c5a5){return function(_0x1134c9){if(_0x1134c9){var _0x1d2424=typeof _0x54c5a5['offset']===_0x3f6f('0x1d')&&typeof _0x54c5a5[_0x3f6f('0x1e')]===_0x3f6f('0x1d');var _0x48d26d=_0x1134c9[_0x3f6f('0x1f')];var _0x22a937=_0x1d2424?0x0:_0x54c5a5['offset'];var _0x5a6ddf=_0x1d2424?_0x1134c9[_0x3f6f('0x1f')]:_0x54c5a5['offset']+_0x54c5a5[_0x3f6f('0x1e')];var _0x4912cb;if(_0x5a6ddf>=_0x48d26d){_0x5a6ddf=_0x48d26d;_0x4912cb=0xc8;}else{_0x4912cb=0xce;}_0x534b09[_0x3f6f('0x1b')](_0x4912cb);return _0x534b09[_0x3f6f('0x20')](_0x3f6f('0x21'),_0x22a937+'-'+_0x5a6ddf+'/'+_0x48d26d)[_0x3f6f('0x22')](_0x1134c9);}return null;};}function patchUpdates(_0x3e18aa){return function(_0xbf50b8){try{jsonpatch[_0x3f6f('0x23')](_0xbf50b8,_0x3e18aa,!![]);}catch(_0x5173e3){return BPromise[_0x3f6f('0x24')](_0x5173e3);}return _0xbf50b8[_0x3f6f('0x25')]();};}function saveUpdates(_0x3eef12,_0x1d516d){return function(_0x522d22){if(_0x522d22){return _0x522d22[_0x3f6f('0x26')](_0x3eef12)[_0x3f6f('0x27')](function(_0x462328){return _0x462328;});}return null;};}function removeEntity(_0x34b283,_0x5eee43){return function(_0x2c3af0){if(_0x2c3af0){return _0x2c3af0[_0x3f6f('0x28')]()[_0x3f6f('0x27')](function(){_0x34b283[_0x3f6f('0x1b')](0xcc)[_0x3f6f('0x1c')]();});}};}function handleEntityNotFound(_0x35a4b9,_0x5afb24){return function(_0x1384f0){if(!_0x1384f0){_0x35a4b9['sendStatus'](0x194);}return _0x1384f0;};}function handleError(_0x161587,_0x40e1f2){_0x40e1f2=_0x40e1f2||0x1f4;return function(_0x56817c){logger[_0x3f6f('0x29')](_0x56817c[_0x3f6f('0x2a')]);if(_0x56817c[_0x3f6f('0x2b')]){delete _0x56817c['name'];}_0x161587[_0x3f6f('0x1b')](_0x40e1f2)['send'](_0x56817c);};}exports[_0x3f6f('0x2c')]=function(_0x561cf9,_0x273ac2){var _0xfc001b={},_0x3ed003={},_0x11059c={'count':0x0,'rows':[]};var _0x3a28ef=_[_0x3f6f('0x2d')](db[_0x3f6f('0x2e')][_0x3f6f('0x2f')],function(_0x33a3a2){return{'name':_0x33a3a2[_0x3f6f('0x30')],'type':_0x33a3a2[_0x3f6f('0x31')][_0x3f6f('0x32')]};});_0x3ed003[_0x3f6f('0x33')]=_[_0x3f6f('0x2d')](_0x3a28ef,_0x3f6f('0x2b'));_0x3ed003[_0x3f6f('0x34')]=_[_0x3f6f('0x35')](_0x561cf9[_0x3f6f('0x34')]);_0x3ed003[_0x3f6f('0x36')]=_[_0x3f6f('0x37')](_0x3ed003[_0x3f6f('0x33')],_0x3ed003['query']);_0xfc001b[_0x3f6f('0x38')]=_['intersection'](_0x3ed003[_0x3f6f('0x33')],qs['fields'](_0x561cf9[_0x3f6f('0x34')][_0x3f6f('0x39')]));_0xfc001b[_0x3f6f('0x38')]=_0xfc001b['attributes'][_0x3f6f('0x3a')]?_0xfc001b['attributes']:_0x3ed003['model'];if(!_0x561cf9[_0x3f6f('0x34')][_0x3f6f('0x3b')](_0x3f6f('0x3c'))){_0xfc001b[_0x3f6f('0x1e')]=qs[_0x3f6f('0x1e')](_0x561cf9[_0x3f6f('0x34')]['limit']);_0xfc001b[_0x3f6f('0x3d')]=qs[_0x3f6f('0x3d')](_0x561cf9['query'][_0x3f6f('0x3d')]);}_0xfc001b[_0x3f6f('0x3e')]=qs[_0x3f6f('0x3f')](_0x561cf9['query'][_0x3f6f('0x3f')]);_0xfc001b['where']=qs[_0x3f6f('0x36')](_[_0x3f6f('0x40')](_0x561cf9[_0x3f6f('0x34')],_0x3ed003[_0x3f6f('0x36')]),_0x3a28ef);if(_0x561cf9[_0x3f6f('0x34')][_0x3f6f('0x41')]){_0xfc001b[_0x3f6f('0x42')]=_[_0x3f6f('0x43')](_0xfc001b[_0x3f6f('0x42')],{'$or':_[_0x3f6f('0x2d')](_0x3a28ef,function(_0x131ef3){if(_0x131ef3[_0x3f6f('0x31')]!==_0x3f6f('0x44')){var _0x388397={};_0x388397[_0x131ef3[_0x3f6f('0x2b')]]={'$like':'%'+_0x561cf9[_0x3f6f('0x34')][_0x3f6f('0x41')]+'%'};return _0x388397;}})});}_0xfc001b=_[_0x3f6f('0x43')]({},_0xfc001b,_0x561cf9[_0x3f6f('0x45')]);var _0x5a65a2={'where':_0xfc001b['where']};return db[_0x3f6f('0x2e')][_0x3f6f('0x1f')](_0x5a65a2)[_0x3f6f('0x27')](function(_0x3012f4){_0x11059c['count']=_0x3012f4;if(_0x561cf9[_0x3f6f('0x34')]['includeAll']){_0xfc001b['include']=[{'all':!![]}];}return db[_0x3f6f('0x2e')][_0x3f6f('0x46')](_0xfc001b);})[_0x3f6f('0x27')](function(_0x332a64){_0x11059c[_0x3f6f('0x47')]=_0x332a64;return _0x11059c;})['then'](respondWithFilteredResult(_0x273ac2,_0xfc001b))[_0x3f6f('0x48')](handleError(_0x273ac2,null));};exports[_0x3f6f('0x49')]=function(_0x5aff61,_0x118015){var _0x934ac4={'raw':![],'where':{'id':_0x5aff61[_0x3f6f('0x4a')]['id']}},_0x23f8bc={};_0x23f8bc[_0x3f6f('0x33')]=_[_0x3f6f('0x35')](db['Automation'][_0x3f6f('0x2f')]);_0x23f8bc[_0x3f6f('0x34')]=_[_0x3f6f('0x35')](_0x5aff61[_0x3f6f('0x34')]);_0x23f8bc[_0x3f6f('0x36')]=_['intersection'](_0x23f8bc[_0x3f6f('0x33')],_0x23f8bc[_0x3f6f('0x34')]);_0x934ac4['attributes']=_[_0x3f6f('0x37')](_0x23f8bc[_0x3f6f('0x33')],qs[_0x3f6f('0x39')](_0x5aff61['query'][_0x3f6f('0x39')]));_0x934ac4[_0x3f6f('0x38')]=_0x934ac4[_0x3f6f('0x38')][_0x3f6f('0x3a')]?_0x934ac4[_0x3f6f('0x38')]:_0x23f8bc[_0x3f6f('0x33')];if(_0x5aff61[_0x3f6f('0x34')][_0x3f6f('0x4b')]){_0x934ac4[_0x3f6f('0x4c')]=[{'all':!![]}];}_0x934ac4=_['merge']({},_0x934ac4,_0x5aff61[_0x3f6f('0x45')]);return db['Automation'][_0x3f6f('0x4d')](_0x934ac4)[_0x3f6f('0x27')](handleEntityNotFound(_0x118015,null))[_0x3f6f('0x27')](respondWithResult(_0x118015,null))['catch'](handleError(_0x118015,null));};exports['create']=function(_0x3f9a20,_0x260639){return db['Automation'][_0x3f6f('0x4e')](_0x3f9a20[_0x3f6f('0x4f')],{})['then'](respondWithResult(_0x260639,0xc9))['catch'](handleError(_0x260639,null));};exports[_0x3f6f('0x26')]=function(_0x576418,_0x3fee12){if(_0x576418[_0x3f6f('0x4f')]['id']){delete _0x576418['body']['id'];}return db['Automation'][_0x3f6f('0x4d')]({'where':{'id':_0x576418[_0x3f6f('0x4a')]['id']}})[_0x3f6f('0x27')](handleEntityNotFound(_0x3fee12,null))[_0x3f6f('0x27')](saveUpdates(_0x576418['body'],null))[_0x3f6f('0x27')](respondWithResult(_0x3fee12,null))[_0x3f6f('0x48')](handleError(_0x3fee12,null));};exports[_0x3f6f('0x28')]=function(_0x348959,_0x3ac0b2){return db['Automation'][_0x3f6f('0x4d')]({'where':{'id':_0x348959[_0x3f6f('0x4a')]['id']}})[_0x3f6f('0x27')](handleEntityNotFound(_0x3ac0b2,null))[_0x3f6f('0x27')](removeEntity(_0x3ac0b2,null))[_0x3f6f('0x48')](handleError(_0x3ac0b2,null));};exports[_0x3f6f('0x50')]=function(_0x7388ef,_0x2c567f,_0x4a91cc){return db[_0x3f6f('0x51')][_0x3f6f('0x4d')]({'where':{'id':_0x7388ef[_0x3f6f('0x4a')]['id']}})[_0x3f6f('0x27')](handleEntityNotFound(_0x2c567f,null))[_0x3f6f('0x27')](function(_0x618714){if(_0x618714){return _0x618714[_0x3f6f('0x50')](_0x7388ef[_0x3f6f('0x4f')][_0x3f6f('0x52')],_[_0x3f6f('0x53')](_0x7388ef[_0x3f6f('0x4f')],['ids','id'])||{});}})[_0x3f6f('0x27')](respondWithResult(_0x2c567f,null))[_0x3f6f('0x48')](handleError(_0x2c567f,null));};exports[_0x3f6f('0x54')]=function(_0xbdeb8c,_0x1bf24c,_0x49d175){var _0xeca6b1={};var _0x492b89={};var _0x5085fc;var _0x3d155b;return db[_0x3f6f('0x2e')][_0x3f6f('0x55')]({'where':{'id':_0xbdeb8c[_0x3f6f('0x4a')]['id']}})[_0x3f6f('0x27')](handleEntityNotFound(_0x1bf24c,null))[_0x3f6f('0x27')](function(_0x3e81b2){if(_0x3e81b2){_0x5085fc=_0x3e81b2;_0x492b89[_0x3f6f('0x33')]=_[_0x3f6f('0x35')](db[_0x3f6f('0x51')][_0x3f6f('0x2f')]);_0x492b89[_0x3f6f('0x34')]=_['keys'](_0xbdeb8c['query']);_0x492b89['filters']=_[_0x3f6f('0x37')](_0x492b89['model'],_0x492b89['query']);_0xeca6b1['attributes']=_[_0x3f6f('0x37')](_0x492b89['model'],qs[_0x3f6f('0x39')](_0xbdeb8c[_0x3f6f('0x34')][_0x3f6f('0x39')]));_0xeca6b1[_0x3f6f('0x38')]=_0xeca6b1[_0x3f6f('0x38')][_0x3f6f('0x3a')]?_0xeca6b1[_0x3f6f('0x38')]:_0x492b89[_0x3f6f('0x33')];_0xeca6b1[_0x3f6f('0x3e')]=qs['sort'](_0xbdeb8c['query'][_0x3f6f('0x3f')]);_0xeca6b1[_0x3f6f('0x42')]=qs[_0x3f6f('0x36')](_['pick'](_0xbdeb8c[_0x3f6f('0x34')],_0x492b89[_0x3f6f('0x36')]));if(_0xbdeb8c['query'][_0x3f6f('0x41')]){_0xeca6b1[_0x3f6f('0x42')]=_[_0x3f6f('0x43')](_0xeca6b1['where'],{'$or':_[_0x3f6f('0x2d')](_0xeca6b1['attributes'],function(_0x387604){var _0x5abd50={};_0x5abd50[_0x387604]={'$like':'%'+_0xbdeb8c[_0x3f6f('0x34')][_0x3f6f('0x41')]+'%'};return _0x5abd50;})});}_0xeca6b1=_[_0x3f6f('0x43')]({},_0xeca6b1,_0xbdeb8c[_0x3f6f('0x45')]);return _0x5085fc[_0x3f6f('0x54')](_0xeca6b1);}})[_0x3f6f('0x27')](function(_0x52009d){if(_0x52009d){_0x3d155b=_0x52009d['length'];if(!_0xbdeb8c['query']['hasOwnProperty'](_0x3f6f('0x3c'))){_0xeca6b1['limit']=qs[_0x3f6f('0x1e')](_0xbdeb8c[_0x3f6f('0x34')][_0x3f6f('0x1e')]);_0xeca6b1[_0x3f6f('0x3d')]=qs[_0x3f6f('0x3d')](_0xbdeb8c[_0x3f6f('0x34')][_0x3f6f('0x3d')]);}return _0x5085fc[_0x3f6f('0x54')](_0xeca6b1);}})[_0x3f6f('0x27')](function(_0x266caf){if(_0x266caf){return _0x266caf?{'count':_0x3d155b,'rows':_0x266caf}:null;}})[_0x3f6f('0x27')](respondWithResult(_0x1bf24c,null))[_0x3f6f('0x48')](handleError(_0x1bf24c,null));};exports['addActions']=function(_0x111238,_0x23e04c,_0x240287){return db[_0x3f6f('0x56')][_0x3f6f('0x4d')]({'where':{'id':_0x111238[_0x3f6f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23e04c,null))[_0x3f6f('0x27')](function(_0x451cd9){if(_0x451cd9){return _0x451cd9[_0x3f6f('0x57')](_0x111238['body'][_0x3f6f('0x52')],_[_0x3f6f('0x53')](_0x111238[_0x3f6f('0x4f')],[_0x3f6f('0x52'),'id'])||{});}})[_0x3f6f('0x27')](respondWithResult(_0x23e04c,null))[_0x3f6f('0x48')](handleError(_0x23e04c,null));};exports[_0x3f6f('0x58')]=function(_0x29c93a,_0x435724,_0x1cc0ff){var _0x4f1f4b={};var _0x294cb7={};var _0x253a27;var _0x45721a;return db['Automation'][_0x3f6f('0x55')]({'where':{'id':_0x29c93a[_0x3f6f('0x4a')]['id']}})[_0x3f6f('0x27')](handleEntityNotFound(_0x435724,null))[_0x3f6f('0x27')](function(_0x1ea8d7){if(_0x1ea8d7){_0x253a27=_0x1ea8d7;_0x294cb7[_0x3f6f('0x33')]=_['keys'](db[_0x3f6f('0x56')]['rawAttributes']);_0x294cb7[_0x3f6f('0x34')]=_[_0x3f6f('0x35')](_0x29c93a['query']);_0x294cb7[_0x3f6f('0x36')]=_[_0x3f6f('0x37')](_0x294cb7[_0x3f6f('0x33')],_0x294cb7[_0x3f6f('0x34')]);_0x4f1f4b[_0x3f6f('0x38')]=_[_0x3f6f('0x37')](_0x294cb7[_0x3f6f('0x33')],qs['fields'](_0x29c93a[_0x3f6f('0x34')]['fields']));_0x4f1f4b['attributes']=_0x4f1f4b[_0x3f6f('0x38')][_0x3f6f('0x3a')]?_0x4f1f4b['attributes']:_0x294cb7['model'];_0x4f1f4b['order']=qs[_0x3f6f('0x3f')](_0x29c93a[_0x3f6f('0x34')][_0x3f6f('0x3f')]);_0x4f1f4b[_0x3f6f('0x42')]=qs[_0x3f6f('0x36')](_['pick'](_0x29c93a[_0x3f6f('0x34')],_0x294cb7[_0x3f6f('0x36')]));if(_0x29c93a[_0x3f6f('0x34')][_0x3f6f('0x41')]){_0x4f1f4b[_0x3f6f('0x42')]=_[_0x3f6f('0x43')](_0x4f1f4b[_0x3f6f('0x42')],{'$or':_[_0x3f6f('0x2d')](_0x4f1f4b[_0x3f6f('0x38')],function(_0x1fb20e){var _0x1e3119={};_0x1e3119[_0x1fb20e]={'$like':'%'+_0x29c93a[_0x3f6f('0x34')][_0x3f6f('0x41')]+'%'};return _0x1e3119;})});}_0x4f1f4b=_[_0x3f6f('0x43')]({},_0x4f1f4b,_0x29c93a[_0x3f6f('0x45')]);return _0x253a27[_0x3f6f('0x58')](_0x4f1f4b);}})[_0x3f6f('0x27')](function(_0x2dabe8){if(_0x2dabe8){_0x45721a=_0x2dabe8[_0x3f6f('0x3a')];if(!_0x29c93a[_0x3f6f('0x34')][_0x3f6f('0x3b')](_0x3f6f('0x3c'))){_0x4f1f4b['limit']=qs[_0x3f6f('0x1e')](_0x29c93a['query'][_0x3f6f('0x1e')]);_0x4f1f4b[_0x3f6f('0x3d')]=qs[_0x3f6f('0x3d')](_0x29c93a[_0x3f6f('0x34')][_0x3f6f('0x3d')]);}return _0x253a27['getActions'](_0x4f1f4b);}})['then'](function(_0x51d1df){if(_0x51d1df){return _0x51d1df?{'count':_0x45721a,'rows':_0x51d1df}:null;}})['then'](respondWithResult(_0x435724,null))[_0x3f6f('0x48')](handleError(_0x435724,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 07d2304..51613fa 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 _0x7619=['exports','define','Automation','tools_automations','util','../../config/logger','bluebird','request-promise','path','./automation.attributes'];(function(_0x460666,_0x24bfa0){var _0x555cbf=function(_0x3b4743){while(--_0x3b4743){_0x460666['push'](_0x460666['shift']());}};_0x555cbf(++_0x24bfa0);}(_0x7619,0xb8));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9761('0x0'));var logger=require(_0x9761('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9761('0x2'));var rp=require(_0x9761('0x3'));var fs=require('fs');var path=require(_0x9761('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9761('0x5'));module[_0x9761('0x6')]=function(_0x335c73,_0x188d11){return _0x335c73[_0x9761('0x7')](_0x9761('0x8'),attributes,{'tableName':_0x9761('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9779=['../../config/logger','api','moment','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x4e3b9c,_0x4d76a3){var _0x358b13=function(_0x2409d6){while(--_0x2409d6){_0x4e3b9c['push'](_0x4e3b9c['shift']());}};_0x358b13(++_0x4d76a3);}(_0x9779,0x129));var _0x9977=function(_0x4284b9,_0x3e1727){_0x4284b9=_0x4284b9-0x0;var _0x353af6=_0x9779[_0x4284b9];return _0x353af6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9977('0x0'))(_0x9977('0x1'));var moment=require(_0x9977('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9977('0x3'));var config=require(_0x9977('0x4'));var attributes=require(_0x9977('0x5'));module[_0x9977('0x6')]=function(_0x10213f,_0x5d06d2){return _0x10213f['define'](_0x9977('0x7'),attributes,{'tableName':_0x9977('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 6889f8e..4e6a38c 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 _0x6337=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','Automation,\x20%s,\x20%s'];(function(_0x30e1cd,_0x445ae0){var _0x5cb403=function(_0x53021e){while(--_0x53021e){_0x30e1cd['push'](_0x30e1cd['shift']());}};_0x5cb403(++_0x445ae0);}(_0x6337,0x18a));var _0x7633=function(_0x155495,_0x1e6e63){_0x155495=_0x155495-0x0;var _0x5813f4=_0x6337[_0x155495];return _0x5813f4;};'use strict';var _=require('lodash');var util=require(_0x7633('0x0'));var moment=require(_0x7633('0x1'));var BPromise=require(_0x7633('0x2'));var rs=require(_0x7633('0x3'));var fs=require('fs');var Redis=require(_0x7633('0x4'));var db=require(_0x7633('0x5'))['db'];var utils=require(_0x7633('0x6'));var logger=require(_0x7633('0x7'))(_0x7633('0x8'));var config=require('../../config/environment');var jayson=require(_0x7633('0x9'));var client=jayson[_0x7633('0xa')][_0x7633('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x539d69,_0x1fee41,_0x4b9491){return new BPromise(function(_0x27baac,_0x14742c){return client['request'](_0x539d69,_0x4b9491)[_0x7633('0xc')](function(_0x547874){logger[_0x7633('0xd')]('Automation,\x20%s,\x20%s',_0x1fee41,_0x7633('0xe'));logger[_0x7633('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x1fee41,_0x7633('0xe'),JSON[_0x7633('0x10')](_0x547874));if(_0x547874[_0x7633('0x11')]){if(_0x547874['error'][_0x7633('0x12')]===0x1f4){logger[_0x7633('0x11')](_0x7633('0x13'),_0x1fee41,_0x547874['error'][_0x7633('0x14')]);return _0x14742c(_0x547874[_0x7633('0x11')][_0x7633('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0x1fee41,_0x547874['error'][_0x7633('0x14')]);return _0x27baac(_0x547874[_0x7633('0x11')][_0x7633('0x14')]);}else{logger[_0x7633('0xd')](_0x7633('0x13'),_0x1fee41,_0x7633('0xe'));_0x27baac(_0x547874[_0x7633('0x15')][_0x7633('0x14')]);}})[_0x7633('0x16')](function(_0x5cbd62){logger[_0x7633('0x11')](_0x7633('0x13'),_0x1fee41,_0x5cbd62);_0x14742c(_0x5cbd62);});});} \ No newline at end of file +var _0x5942=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d151d,_0x2d6f25){var _0x232cec=function(_0x35ce18){while(--_0x35ce18){_0x3d151d['push'](_0x3d151d['shift']());}};_0x232cec(++_0x2d6f25);}(_0x5942,0x16a));var _0x2594=function(_0x4440dc,_0x4e12ca){_0x4440dc=_0x4440dc-0x0;var _0x28beda=_0x5942[_0x4440dc];return _0x28beda;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381472,_0xd0ada5,_0x3d20aa){return new BPromise(function(_0x5707a0,_0x2b42d3){return client[_0x2594('0xc')](_0x381472,_0x3d20aa)['then'](function(_0x29517f){logger['info'](_0x2594('0xd'),_0xd0ada5,_0x2594('0xe'));logger[_0x2594('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0xd0ada5,_0x2594('0xe'),JSON[_0x2594('0x10')](_0x29517f));if(_0x29517f[_0x2594('0x11')]){if(_0x29517f[_0x2594('0x11')]['code']===0x1f4){logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);return _0x2b42d3(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')]['message']);return _0x5707a0(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}else{logger['info'](_0x2594('0xd'),_0xd0ada5,'request\x20sent');_0x5707a0(_0x29517f[_0x2594('0x13')][_0x2594('0x12')]);}})[_0x2594('0x14')](function(_0x33b4bc){logger[_0x2594('0x11')]('Automation,\x20%s,\x20%s',_0xd0ada5,_0x33b4bc);_0x2b42d3(_0x33b4bc);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d815e1a..c9adb48 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 _0x8a9c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions','addActions','put','delete','destroy'];(function(_0x138d8e,_0x5752b3){var _0x3f1bd8=function(_0x23ff61){while(--_0x23ff61){_0x138d8e['push'](_0x138d8e['shift']());}};_0x3f1bd8(++_0x5752b3);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var path=require(_0xc8a9('0x2'));var timeout=require(_0xc8a9('0x3'));var express=require(_0xc8a9('0x4'));var router=express['Router']();var fs_extra=require(_0xc8a9('0x5'));var auth=require(_0xc8a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc8a9('0x7'));var controller=require(_0xc8a9('0x8'));router[_0xc8a9('0x9')]('/',auth['isAuthenticated'](),controller[_0xc8a9('0xa')]);router[_0xc8a9('0x9')](_0xc8a9('0xb'),auth[_0xc8a9('0xc')](),controller[_0xc8a9('0xd')]);router[_0xc8a9('0x9')](_0xc8a9('0xe'),auth[_0xc8a9('0xc')](),controller[_0xc8a9('0xf')]);router['get']('/:id/actions',auth[_0xc8a9('0xc')](),controller[_0xc8a9('0x10')]);router['post']('/',auth[_0xc8a9('0xc')](),controller['create']);router[_0xc8a9('0x11')](_0xc8a9('0xe'),auth['isAuthenticated'](),controller[_0xc8a9('0x12')]);router['post'](_0xc8a9('0x13'),auth[_0xc8a9('0xc')](),controller[_0xc8a9('0x14')]);router[_0xc8a9('0x15')](_0xc8a9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc8a9('0x16')]('/:id',auth[_0xc8a9('0xc')](),controller[_0xc8a9('0x17')]);module[_0xc8a9('0x18')]=router; \ No newline at end of file +var _0x1dd4=['post','create','put','update','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions'];(function(_0xe053aa,_0x23e4fa){var _0x4ec783=function(_0xe1d0d5){while(--_0xe1d0d5){_0xe053aa['push'](_0xe053aa['shift']());}};_0x4ec783(++_0x23e4fa);}(_0x1dd4,0x1a9));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x41dd('0x0'));var express=require(_0x41dd('0x1'));var router=express[_0x41dd('0x2')]();var fs_extra=require(_0x41dd('0x3'));var auth=require(_0x41dd('0x4'));var interaction=require(_0x41dd('0x5'));var config=require(_0x41dd('0x6'));var controller=require('./automation.controller');router[_0x41dd('0x7')]('/',auth[_0x41dd('0x8')](),controller[_0x41dd('0x9')]);router[_0x41dd('0x7')](_0x41dd('0xa'),auth[_0x41dd('0x8')](),controller['show']);router[_0x41dd('0x7')](_0x41dd('0xb'),auth[_0x41dd('0x8')](),controller[_0x41dd('0xc')]);router[_0x41dd('0x7')](_0x41dd('0xd'),auth[_0x41dd('0x8')](),controller[_0x41dd('0xe')]);router[_0x41dd('0xf')]('/',auth[_0x41dd('0x8')](),controller[_0x41dd('0x10')]);router[_0x41dd('0xf')]('/:id/conditions',auth[_0x41dd('0x8')](),controller['addConditions']);router[_0x41dd('0xf')]('/:id/actions',auth[_0x41dd('0x8')](),controller['addActions']);router[_0x41dd('0x11')](_0x41dd('0xa'),auth['isAuthenticated'](),controller[_0x41dd('0x12')]);router[_0x41dd('0x13')](_0x41dd('0xa'),auth[_0x41dd('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 448b058..7729b06 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 _0xd7bf=['Random\x20Last\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC'];(function(_0x3ff61b,_0xe602a4){var _0x561d5c=function(_0x1c1e3){while(--_0x1c1e3){_0x3ff61b['push'](_0x3ff61b['shift']());}};_0x561d5c(++_0xe602a4);}(_0xd7bf,0x72));var _0xfd7b=function(_0x12262f,_0x395c79){_0x12262f=_0x12262f-0x0;var _0x48ceff=_0xd7bf[_0x12262f];return _0x48ceff;};'use strict';var Sequelize=require('sequelize');module[_0xfd7b('0x0')]={'name':{'type':Sequelize[_0xfd7b('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfd7b('0x2')](_0xfd7b('0x3')),'allowNull':![],'defaultValue':_0xfd7b('0x3')},'description':{'type':Sequelize[_0xfd7b('0x1')]},'active':{'type':Sequelize[_0xfd7b('0x4')],'defaultValue':0x0,'comment':_0xfd7b('0x5')},'limitCalls':{'type':Sequelize[_0xfd7b('0x6')](0x4)[_0xfd7b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfd7b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfd7b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfd7b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfd7b('0xe')},'dialTimezone':{'type':Sequelize[_0xfd7b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xfd7b('0x2')](_0xfd7b('0xf'),_0xfd7b('0x10'),_0xfd7b('0x11')),'defaultValue':_0xfd7b('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfd7b('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfd7b('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfd7b('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd7b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfd7b('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfd7b('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfd7b('0x6')](0x9)[_0xfd7b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xfd7b('0x2')]('DESC',_0xfd7b('0x18')),'defaultValue':_0xfd7b('0x19')},'dialPrefix':{'type':Sequelize[_0xfd7b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd7b('0x1a')},'dialCutDigit':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfd7b('0x6')](0x3)[_0xfd7b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd7b('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfd7b('0x6')](0x5)[_0xfd7b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd7b('0x22')}}; \ No newline at end of file +var _0xf041=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x7526b7,_0xe0597e){var _0x3a1c3d=function(_0x557daa){while(--_0x557daa){_0x7526b7['push'](_0x7526b7['shift']());}};_0x3a1c3d(++_0xe0597e);}(_0xf041,0x1d5));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1f04('0x0'));module[_0x1f04('0x1')]={'name':{'type':Sequelize[_0x1f04('0x2')],'unique':_0x1f04('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1f04('0x4')),'allowNull':![],'defaultValue':_0x1f04('0x4')},'description':{'type':Sequelize[_0x1f04('0x2')]},'active':{'type':Sequelize[_0x1f04('0x5')],'defaultValue':0x0,'comment':_0x1f04('0x6')},'limitCalls':{'type':Sequelize[_0x1f04('0x7')](0x4)[_0x1f04('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1f04('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f04('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1f04('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1f04('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1f04('0xf')},'dialTimezone':{'type':Sequelize[_0x1f04('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1f04('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1f04('0x10')](_0x1f04('0x11'),_0x1f04('0x12'),_0x1f04('0x13')),'defaultValue':_0x1f04('0x11')},'dialAMDActive':{'type':Sequelize[_0x1f04('0x5')],'defaultValue':0x0,'comment':_0x1f04('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1f04('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1f04('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1f04('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f04('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1f04('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f04('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1f04('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f04('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1f04('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f04('0x7')](0x9)[_0x1f04('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f04('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f04('0x10')]('DESC','ASC'),'defaultValue':_0x1f04('0x1d')},'dialPrefix':{'type':Sequelize[_0x1f04('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f04('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x1f04('0x7')](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f04('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f04('0x7')](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f04('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f04('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f04('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index efdf9e6..992b7f4 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 _0x2d93=['fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','role','error','update','CmHopper','nolimit','pick','getHopperHistories','CmHopperHistory','CampaignId','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','createdAt','select','field','scheduledAt','ListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','then','get','UserProfileResource','destroy','name','send','map','Campaign','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x2f7571,_0x352fab){var _0x45245d=function(_0x377ec8){while(--_0x377ec8){_0x2f7571['push'](_0x2f7571['shift']());}};_0x45245d(++_0x352fab);}(_0x2d93,0xf3));var _0x32d9=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x2d93[_0x30faec];return _0x29484f;};'use strict';var emlformat=require(_0x32d9('0x0'));var rimraf=require(_0x32d9('0x1'));var zipdir=require(_0x32d9('0x2'));var jsonpatch=require(_0x32d9('0x3'));var rp=require(_0x32d9('0x4'));var moment=require(_0x32d9('0x5'));var BPromise=require(_0x32d9('0x6'));var Mustache=require(_0x32d9('0x7'));var util=require(_0x32d9('0x8'));var path=require(_0x32d9('0x9'));var sox=require(_0x32d9('0xa'));var csv=require(_0x32d9('0xb'));var ejs=require(_0x32d9('0xc'));var fs=require('fs');var fs_extra=require(_0x32d9('0xd'));var _=require('lodash');var squel=require(_0x32d9('0xe'));var crypto=require(_0x32d9('0xf'));var jsforce=require(_0x32d9('0x10'));var deskjs=require(_0x32d9('0x11'));var toCsv=require(_0x32d9('0xb'));var querystring=require('querystring');var Papa=require(_0x32d9('0x12'));var Redis=require(_0x32d9('0x13'));var authService=require(_0x32d9('0x14'));var qs=require(_0x32d9('0x15'));var as=require(_0x32d9('0x16'));var hardwareService=require(_0x32d9('0x17'));var logger=require(_0x32d9('0x18'))(_0x32d9('0x19'));var utils=require(_0x32d9('0x1a'));var config=require(_0x32d9('0x1b'));var licenseUtil=require(_0x32d9('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5afced,_0x16e983){_0x16e983=_0x16e983||0xcc;return function(_0x3ae057){if(_0x3ae057){return _0x5afced[_0x32d9('0x1d')](_0x16e983);}return _0x5afced[_0x32d9('0x1e')](_0x16e983)[_0x32d9('0x1f')]();};}function respondWithResult(_0x3b1d99,_0x9a0f21){_0x9a0f21=_0x9a0f21||0xc8;return function(_0x209a5c){if(_0x209a5c){return _0x3b1d99[_0x32d9('0x1e')](_0x9a0f21)[_0x32d9('0x20')](_0x209a5c);}};}function respondWithFilteredResult(_0x427433,_0x428821){return function(_0x5ebcab){if(_0x5ebcab){var _0x251b58=typeof _0x428821[_0x32d9('0x21')]==='undefined'&&typeof _0x428821[_0x32d9('0x22')]===_0x32d9('0x23');var _0x25fe2c=_0x5ebcab[_0x32d9('0x24')];var _0xd3e7a3=_0x251b58?0x0:_0x428821[_0x32d9('0x21')];var _0x33bb0b=_0x251b58?_0x5ebcab[_0x32d9('0x24')]:_0x428821[_0x32d9('0x21')]+_0x428821[_0x32d9('0x22')];var _0x543607;if(_0x33bb0b>=_0x25fe2c){_0x33bb0b=_0x25fe2c;_0x543607=0xc8;}else{_0x543607=0xce;}_0x427433['status'](_0x543607);return _0x427433[_0x32d9('0x25')](_0x32d9('0x26'),_0xd3e7a3+'-'+_0x33bb0b+'/'+_0x25fe2c)['json'](_0x5ebcab);}return null;};}function patchUpdates(_0x13f8b0){return function(_0x55b7a8){try{jsonpatch[_0x32d9('0x27')](_0x55b7a8,_0x13f8b0,!![]);}catch(_0x298cb6){return BPromise['reject'](_0x298cb6);}return _0x55b7a8['save']();};}function saveUpdates(_0x3e2ef3,_0xcd2cec){return function(_0x56b703){if(_0x56b703){return _0x56b703['update'](_0x3e2ef3)[_0x32d9('0x28')](function(_0x4162bc){return _0x4162bc;});}return null;};}function removeEntity(_0x339697,_0x37a0ce){return function(_0x3cb824){if(_0x3cb824){return _0x3cb824['destroy']()[_0x32d9('0x28')](function(){var _0x1c51a8=_0x3cb824[_0x32d9('0x29')]({'plain':!![]});var _0x215440='IvrCampaigns';return db[_0x32d9('0x2a')][_0x32d9('0x2b')]({'where':{'type':_0x215440,'resourceId':_0x1c51a8['id']}})[_0x32d9('0x28')](function(){return _0x3cb824;});})['then'](function(){_0x339697[_0x32d9('0x1e')](0xcc)[_0x32d9('0x1f')]();});}};}function handleEntityNotFound(_0x2dbc8c,_0xca2f14){return function(_0x5bd3f3){if(!_0x5bd3f3){_0x2dbc8c[_0x32d9('0x1d')](0x194);}return _0x5bd3f3;};}function handleError(_0x3cf5f2,_0x3d4258){_0x3d4258=_0x3d4258||0x1f4;return function(_0x7e7582){logger['error'](_0x7e7582['stack']);if(_0x7e7582['name']){delete _0x7e7582[_0x32d9('0x2c')];}_0x3cf5f2[_0x32d9('0x1e')](_0x3d4258)[_0x32d9('0x2d')](_0x7e7582);};}exports['index']=function(_0x272449,_0xda0f8f){var _0x56a7ab={},_0x28dc4={},_0x11909b={'count':0x0,'rows':[]};var _0x1b0dfb=_[_0x32d9('0x2e')](db[_0x32d9('0x2f')]['rawAttributes'],function(_0x28165e){return{'name':_0x28165e[_0x32d9('0x30')],'type':_0x28165e[_0x32d9('0x31')][_0x32d9('0x32')]};});_0x28dc4['model']=_[_0x32d9('0x2e')](_0x1b0dfb,'name');_0x28dc4[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x272449[_0x32d9('0x33')]);_0x28dc4[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x28dc4[_0x32d9('0x37')],_0x28dc4[_0x32d9('0x33')]);_0x56a7ab[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x28dc4['model'],qs[_0x32d9('0x39')](_0x272449[_0x32d9('0x33')][_0x32d9('0x39')]));_0x56a7ab[_0x32d9('0x38')]=_0x56a7ab[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x56a7ab[_0x32d9('0x38')]:_0x28dc4[_0x32d9('0x37')];if(!_0x272449[_0x32d9('0x33')][_0x32d9('0x3b')]('nolimit')){_0x56a7ab['limit']=qs[_0x32d9('0x22')](_0x272449[_0x32d9('0x33')][_0x32d9('0x22')]);_0x56a7ab[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x272449[_0x32d9('0x33')][_0x32d9('0x21')]);}_0x56a7ab[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x272449[_0x32d9('0x33')]['sort']);_0x56a7ab[_0x32d9('0x3e')]=qs['filters'](_['pick'](_0x272449[_0x32d9('0x33')],_0x28dc4[_0x32d9('0x35')]),_0x1b0dfb);if(_0x272449['query'][_0x32d9('0x3f')]){_0x56a7ab['where']=_[_0x32d9('0x40')](_0x56a7ab[_0x32d9('0x3e')],{'$or':_[_0x32d9('0x2e')](_0x1b0dfb,function(_0x4a15af){if(_0x4a15af[_0x32d9('0x31')]!==_0x32d9('0x41')){var _0x2649d8={};_0x2649d8[_0x4a15af[_0x32d9('0x2c')]]={'$like':'%'+_0x272449[_0x32d9('0x33')][_0x32d9('0x3f')]+'%'};return _0x2649d8;}})});}_0x56a7ab=_[_0x32d9('0x40')]({},_0x56a7ab,_0x272449[_0x32d9('0x42')]);var _0x5eabdb={'where':_0x56a7ab['where']};return db[_0x32d9('0x2f')][_0x32d9('0x24')](_0x5eabdb)['then'](function(_0x2eeb32){_0x11909b[_0x32d9('0x24')]=_0x2eeb32;if(_0x272449[_0x32d9('0x33')][_0x32d9('0x43')]){_0x56a7ab['include']=[{'all':!![]}];}return db['Campaign'][_0x32d9('0x44')](_0x56a7ab);})[_0x32d9('0x28')](function(_0x12c469){_0x11909b[_0x32d9('0x45')]=_0x12c469;return _0x11909b;})[_0x32d9('0x28')](respondWithFilteredResult(_0xda0f8f,_0x56a7ab))[_0x32d9('0x46')](handleError(_0xda0f8f,null));};exports[_0x32d9('0x47')]=function(_0x15f42f,_0x2edc21){var _0x4344dc={'raw':![],'where':{'id':_0x15f42f[_0x32d9('0x48')]['id']}},_0x56c419={};_0x56c419['model']=_[_0x32d9('0x34')](db[_0x32d9('0x2f')][_0x32d9('0x49')]);_0x56c419['query']=_['keys'](_0x15f42f['query']);_0x56c419[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x56c419['model'],_0x56c419[_0x32d9('0x33')]);_0x4344dc['attributes']=_[_0x32d9('0x36')](_0x56c419['model'],qs[_0x32d9('0x39')](_0x15f42f[_0x32d9('0x33')][_0x32d9('0x39')]));_0x4344dc[_0x32d9('0x38')]=_0x4344dc[_0x32d9('0x38')]['length']?_0x4344dc[_0x32d9('0x38')]:_0x56c419[_0x32d9('0x37')];if(_0x15f42f[_0x32d9('0x33')]['includeAll']){_0x4344dc[_0x32d9('0x4a')]=[{'all':!![]}];}_0x4344dc=_[_0x32d9('0x40')]({},_0x4344dc,_0x15f42f[_0x32d9('0x42')]);return db[_0x32d9('0x2f')][_0x32d9('0x4b')](_0x4344dc)['then'](handleEntityNotFound(_0x2edc21,null))[_0x32d9('0x28')](respondWithResult(_0x2edc21,null))[_0x32d9('0x46')](handleError(_0x2edc21,null));};exports[_0x32d9('0x4c')]=function(_0x433d90,_0x4f0df5){return db['Campaign'][_0x32d9('0x4c')](_0x433d90[_0x32d9('0x4d')],{})[_0x32d9('0x28')](function(_0x39eee9){var _0x26959d=_0x433d90[_0x32d9('0x4e')][_0x32d9('0x29')]({'plain':!![]});if(!_0x26959d)throw new Error(_0x32d9('0x4f'));if(_0x26959d['role']===_0x32d9('0x4e')){var _0x1d7425=_0x39eee9[_0x32d9('0x29')]({'plain':!![]});var _0x4d1197='IvrCampaigns';return db[_0x32d9('0x50')][_0x32d9('0x4b')]({'where':{'name':_0x4d1197,'userProfileId':_0x26959d[_0x32d9('0x51')]},'raw':!![]})[_0x32d9('0x28')](function(_0x144dac){if(_0x144dac&&_0x144dac[_0x32d9('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d7425[_0x32d9('0x2c')],'resourceId':_0x1d7425['id'],'type':_0x144dac[_0x32d9('0x2c')],'sectionId':_0x144dac['id']},{})['then'](function(){return _0x39eee9;});}else{return _0x39eee9;}})[_0x32d9('0x46')](function(_0x284127){logger['error'](_0x32d9('0x53'),_0x284127);throw _0x284127;});}return _0x39eee9;})[_0x32d9('0x28')](respondWithResult(_0x4f0df5,0xc9))[_0x32d9('0x46')](handleError(_0x4f0df5,null));};exports[_0x32d9('0x54')]=function(_0x1900da,_0xc3b38d){var _0x5a88a2={'where':{'id':_0x1900da[_0x32d9('0x48')]['id']}},_0x25d06b={};_0x25d06b[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x2f')]['rawAttributes']);_0x5a88a2[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x25d06b[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x1900da[_0x32d9('0x33')][_0x32d9('0x39')]));_0x5a88a2[_0x32d9('0x38')]=_0x5a88a2['attributes'][_0x32d9('0x3a')]?_0x5a88a2[_0x32d9('0x38')]:_0x25d06b[_0x32d9('0x37')];if(_0x1900da[_0x32d9('0x33')]['includeAll']){_0x5a88a2['include']=[{'all':!![]}];}_0x5a88a2=_[_0x32d9('0x40')]({},_0x5a88a2,_0x1900da[_0x32d9('0x42')]);return db[_0x32d9('0x2f')][_0x32d9('0x4b')](_0x5a88a2)['then'](handleEntityNotFound(_0xc3b38d,null))[_0x32d9('0x28')](function(_0x26e5bb){if(_0x26e5bb){var _0x5930dd=_0x26e5bb[_0x32d9('0x29')]({'plain':!![]});_0x5930dd=qs['omit'](_0x5930dd,['id','createdAt',_0x32d9('0x55')]);_0x1900da[_0x32d9('0x4d')]=_[_0x32d9('0x56')](_0x1900da[_0x32d9('0x4d')],['id','createdAt',_0x32d9('0x55')]);return db[_0x32d9('0x2f')]['create'](_['merge'](_0x5930dd,_0x1900da[_0x32d9('0x4d')]),{'include':_0x1900da[_0x32d9('0x33')][_0x32d9('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x29f194){var _0x144d16=_0x1900da[_0x32d9('0x4e')][_0x32d9('0x29')]({'plain':!![]});if(!_0x144d16)throw new Error(_0x32d9('0x4f'));if(_0x144d16[_0x32d9('0x57')]==='user'){var _0x371922=_0x29f194[_0x32d9('0x29')]({'plain':!![]});var _0x5127d8='IvrCampaigns';return db[_0x32d9('0x50')][_0x32d9('0x4b')]({'where':{'name':_0x5127d8,'userProfileId':_0x144d16[_0x32d9('0x51')]},'raw':!![]})[_0x32d9('0x28')](function(_0x2f3f19){if(_0x2f3f19&&_0x2f3f19[_0x32d9('0x52')]===0x0){return db['UserProfileResource'][_0x32d9('0x4c')]({'name':_0x371922[_0x32d9('0x2c')],'resourceId':_0x371922['id'],'type':_0x2f3f19[_0x32d9('0x2c')],'sectionId':_0x2f3f19['id']},{})[_0x32d9('0x28')](function(){return _0x29f194;});}else{return _0x29f194;}})['catch'](function(_0x38a176){logger[_0x32d9('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a176);throw _0x38a176;});}return _0x29f194;});}})['then'](respondWithResult(_0xc3b38d,0xc9))[_0x32d9('0x46')](handleError(_0xc3b38d,null));};exports[_0x32d9('0x59')]=function(_0x2e0601,_0x17f450){if(_0x2e0601['body']['id']){delete _0x2e0601['body']['id'];}return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x2e0601[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x17f450,null))[_0x32d9('0x28')](saveUpdates(_0x2e0601[_0x32d9('0x4d')],null))[_0x32d9('0x28')](respondWithResult(_0x17f450,null))['catch'](handleError(_0x17f450,null));};exports[_0x32d9('0x2b')]=function(_0x4a2dfe,_0x1aab0d){return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x4a2dfe['params']['id']}})['then'](handleEntityNotFound(_0x1aab0d,null))[_0x32d9('0x28')](removeEntity(_0x1aab0d,null))[_0x32d9('0x46')](handleError(_0x1aab0d,null));};exports['getHoppers']=function(_0x12fbc3,_0x5331c7,_0x17e95e){var _0x4d854d={'raw':!![],'where':{}};var _0x12bd39={};var _0x50f93f={'count':0x0,'rows':[]};return db[_0x32d9('0x2f')]['findOne']({'where':{'id':_0x12fbc3[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x5331c7,null))['then'](function(_0x510ffc){if(_0x510ffc){_0x12bd39[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x5a')][_0x32d9('0x49')]);_0x12bd39[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x12fbc3[_0x32d9('0x33')]);_0x12bd39[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x12bd39['model'],_0x12bd39['query']);_0x4d854d[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x12bd39[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x39')]));_0x4d854d[_0x32d9('0x38')]=_0x4d854d['attributes'][_0x32d9('0x3a')]?_0x4d854d[_0x32d9('0x38')]:_0x12bd39[_0x32d9('0x37')];if(!_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x4d854d[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x12fbc3['query'][_0x32d9('0x22')]);_0x4d854d['offset']=qs['offset'](_0x12fbc3[_0x32d9('0x33')]['offset']);}_0x4d854d[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x4d854d[_0x32d9('0x3e')]=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x12fbc3[_0x32d9('0x33')],_0x12bd39['filters']));_0x4d854d[_0x32d9('0x3e')]['CampaignId']=_0x510ffc['id'];if(_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3f')]){_0x4d854d['where']=_['merge'](_0x4d854d['where'],{'$or':_[_0x32d9('0x2e')](_0x4d854d['attributes'],function(_0x41bc2b){var _0x554a36={};_0x554a36[_0x41bc2b]={'$like':'%'+_0x12fbc3[_0x32d9('0x33')]['filter']+'%'};return _0x554a36;})});}_0x4d854d=_['merge']({},_0x4d854d,_0x12fbc3['options']);return db[_0x32d9('0x5a')][_0x32d9('0x24')]({'where':_0x4d854d['where']})[_0x32d9('0x28')](function(_0xd3fd19){_0x50f93f['count']=_0xd3fd19;if(_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x43')]){_0x4d854d[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x5a')]['findAll'](_0x4d854d);})[_0x32d9('0x28')](function(_0x874bb0){_0x50f93f[_0x32d9('0x45')]=_0x874bb0;return _0x50f93f;});}})[_0x32d9('0x28')](respondWithFilteredResult(_0x5331c7,_0x4d854d))[_0x32d9('0x46')](handleError(_0x5331c7,null));};exports[_0x32d9('0x5d')]=function(_0x13aff0,_0x157cbf,_0x4d916e){var _0x72cdce={'raw':!![],'where':{}};var _0x4bdb42={};var _0x5d6ddf={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x13aff0[_0x32d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x157cbf,null))[_0x32d9('0x28')](function(_0x12b96a){if(_0x12b96a){_0x4bdb42[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x5e')][_0x32d9('0x49')]);_0x4bdb42[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x13aff0['query']);_0x4bdb42[_0x32d9('0x35')]=_['intersection'](_0x4bdb42[_0x32d9('0x37')],_0x4bdb42[_0x32d9('0x33')]);_0x72cdce[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x4bdb42[_0x32d9('0x37')],qs['fields'](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x39')]));_0x72cdce[_0x32d9('0x38')]=_0x72cdce[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x72cdce[_0x32d9('0x38')]:_0x4bdb42[_0x32d9('0x37')];if(!_0x13aff0['query'][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x72cdce[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x22')]);_0x72cdce[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x21')]);}_0x72cdce[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x72cdce[_0x32d9('0x3e')]=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x13aff0['query'],_0x4bdb42[_0x32d9('0x35')]));_0x72cdce[_0x32d9('0x3e')][_0x32d9('0x5f')]=_0x12b96a['id'];if(_0x13aff0[_0x32d9('0x33')][_0x32d9('0x3f')]){_0x72cdce[_0x32d9('0x3e')]=_[_0x32d9('0x40')](_0x72cdce['where'],{'$or':_[_0x32d9('0x2e')](_0x72cdce['attributes'],function(_0x28dffd){var _0x78fcbf={};_0x78fcbf[_0x28dffd]={'$like':'%'+_0x13aff0[_0x32d9('0x33')]['filter']+'%'};return _0x78fcbf;})});}_0x72cdce=_[_0x32d9('0x40')]({},_0x72cdce,_0x13aff0[_0x32d9('0x42')]);return db['CmHopperHistory'][_0x32d9('0x24')]({'where':_0x72cdce[_0x32d9('0x3e')]})[_0x32d9('0x28')](function(_0x38ac3e){_0x5d6ddf[_0x32d9('0x24')]=_0x38ac3e;if(_0x13aff0[_0x32d9('0x33')][_0x32d9('0x43')]){_0x72cdce[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x5e')][_0x32d9('0x44')](_0x72cdce);})[_0x32d9('0x28')](function(_0x44ef70){_0x5d6ddf[_0x32d9('0x45')]=_0x44ef70;return _0x5d6ddf;});}})[_0x32d9('0x28')](respondWithFilteredResult(_0x157cbf,_0x72cdce))[_0x32d9('0x46')](handleError(_0x157cbf,null));};exports['getHopperFinals']=function(_0x36307e,_0x448e2d,_0x27bc3e){var _0x3c4d00={'raw':!![],'where':{}};var _0x5bef97={};var _0x173c0d={'count':0x0,'rows':[]};return db[_0x32d9('0x2f')][_0x32d9('0x60')]({'where':{'id':_0x36307e[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x448e2d,null))[_0x32d9('0x28')](function(_0x4fe8ee){if(_0x4fe8ee){_0x5bef97[_0x32d9('0x37')]=_[_0x32d9('0x34')](db['CmHopperFinal']['rawAttributes']);_0x5bef97[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x36307e[_0x32d9('0x33')]);_0x5bef97['filters']=_[_0x32d9('0x36')](_0x5bef97[_0x32d9('0x37')],_0x5bef97[_0x32d9('0x33')]);_0x3c4d00[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x5bef97[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x36307e['query'][_0x32d9('0x39')]));_0x3c4d00['attributes']=_0x3c4d00['attributes'][_0x32d9('0x3a')]?_0x3c4d00[_0x32d9('0x38')]:_0x5bef97['model'];if(!_0x36307e['query'][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x3c4d00[_0x32d9('0x22')]=qs['limit'](_0x36307e[_0x32d9('0x33')][_0x32d9('0x22')]);_0x3c4d00[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x36307e[_0x32d9('0x33')][_0x32d9('0x21')]);}_0x3c4d00['order']=qs[_0x32d9('0x3d')](_0x36307e[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x3c4d00['where']=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x36307e['query'],_0x5bef97['filters']));_0x3c4d00[_0x32d9('0x3e')][_0x32d9('0x5f')]=_0x4fe8ee['id'];if(_0x36307e[_0x32d9('0x33')][_0x32d9('0x3f')]){_0x3c4d00[_0x32d9('0x3e')]=_[_0x32d9('0x40')](_0x3c4d00[_0x32d9('0x3e')],{'$or':_[_0x32d9('0x2e')](_0x3c4d00[_0x32d9('0x38')],function(_0xcabef5){var _0x356fed={};_0x356fed[_0xcabef5]={'$like':'%'+_0x36307e[_0x32d9('0x33')][_0x32d9('0x3f')]+'%'};return _0x356fed;})});}_0x3c4d00=_[_0x32d9('0x40')]({},_0x3c4d00,_0x36307e[_0x32d9('0x42')]);return db[_0x32d9('0x61')][_0x32d9('0x24')]({'where':_0x3c4d00[_0x32d9('0x3e')]})[_0x32d9('0x28')](function(_0x3add4b){_0x173c0d[_0x32d9('0x24')]=_0x3add4b;if(_0x36307e[_0x32d9('0x33')]['includeAll']){_0x3c4d00[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x61')]['findAll'](_0x3c4d00);})[_0x32d9('0x28')](function(_0x35fe87){_0x173c0d['rows']=_0x35fe87;return _0x173c0d;});}})['then'](respondWithFilteredResult(_0x448e2d,_0x3c4d00))[_0x32d9('0x46')](handleError(_0x448e2d,null));};exports[_0x32d9('0x62')]=function(_0x36d678,_0x81bde8,_0x57a314){var _0x4ee997={'raw':!![],'where':{}};var _0x5d086f={};var _0x43104e={'count':0x0,'rows':[]};return db[_0x32d9('0x2f')]['findOne']({'where':{'id':_0x36d678[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x81bde8,null))[_0x32d9('0x28')](function(_0x55aa22){if(_0x55aa22){_0x5d086f[_0x32d9('0x37')]=_['keys'](db[_0x32d9('0x63')][_0x32d9('0x49')]);_0x5d086f['query']=_['keys'](_0x36d678[_0x32d9('0x33')]);_0x5d086f[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x5d086f['model'],_0x5d086f['query']);_0x4ee997[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x5d086f[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x36d678[_0x32d9('0x33')][_0x32d9('0x39')]));_0x4ee997[_0x32d9('0x38')]=_0x4ee997[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x4ee997[_0x32d9('0x38')]:_0x5d086f[_0x32d9('0x37')];if(!_0x36d678[_0x32d9('0x33')][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x4ee997[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x36d678[_0x32d9('0x33')][_0x32d9('0x22')]);_0x4ee997[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x36d678[_0x32d9('0x33')]['offset']);}_0x4ee997['order']=qs[_0x32d9('0x3d')](_0x36d678[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x4ee997[_0x32d9('0x3e')]=qs['filters'](_[_0x32d9('0x5c')](_0x36d678['query'],_0x5d086f[_0x32d9('0x35')]));_0x4ee997[_0x32d9('0x3e')][_0x32d9('0x5f')]=_0x55aa22['id'];if(_0x36d678['query'][_0x32d9('0x3f')]){_0x4ee997['where']=_[_0x32d9('0x40')](_0x4ee997['where'],{'$or':_[_0x32d9('0x2e')](_0x4ee997[_0x32d9('0x38')],function(_0x550a28){var _0x3acec2={};_0x3acec2[_0x550a28]={'$like':'%'+_0x36d678[_0x32d9('0x33')][_0x32d9('0x3f')]+'%'};return _0x3acec2;})});}_0x4ee997=_[_0x32d9('0x40')]({},_0x4ee997,_0x36d678[_0x32d9('0x42')]);return db[_0x32d9('0x63')][_0x32d9('0x24')]({'where':_0x4ee997[_0x32d9('0x3e')]})['then'](function(_0x402244){_0x43104e[_0x32d9('0x24')]=_0x402244;if(_0x36d678['query']['includeAll']){_0x4ee997[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x63')][_0x32d9('0x44')](_0x4ee997);})['then'](function(_0x5f40d5){_0x43104e[_0x32d9('0x45')]=_0x5f40d5;return _0x43104e;});}})[_0x32d9('0x28')](respondWithFilteredResult(_0x81bde8,_0x4ee997))[_0x32d9('0x46')](handleError(_0x81bde8,null));};exports[_0x32d9('0x64')]=function(_0x3c451,_0x10a0f4,_0x469afc){var _0x37f1de={};var _0x5bf416={};var _0x2e0ded;var _0x5123f3;return db[_0x32d9('0x2f')][_0x32d9('0x60')]({'where':{'id':_0x3c451[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x10a0f4,null))[_0x32d9('0x28')](function(_0x16edce){if(_0x16edce){_0x2e0ded=_0x16edce;_0x5bf416[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x65')][_0x32d9('0x49')]);_0x5bf416[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x3c451[_0x32d9('0x33')]);_0x5bf416[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x5bf416[_0x32d9('0x37')],_0x5bf416[_0x32d9('0x33')]);_0x37f1de[_0x32d9('0x38')]=_['intersection'](_0x5bf416[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x3c451[_0x32d9('0x33')][_0x32d9('0x39')]));_0x37f1de[_0x32d9('0x38')]=_0x37f1de[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x37f1de[_0x32d9('0x38')]:_0x5bf416[_0x32d9('0x37')];_0x37f1de[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x3c451['query'][_0x32d9('0x3d')]);_0x37f1de['where']=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x3c451[_0x32d9('0x33')],_0x5bf416[_0x32d9('0x35')]));if(_0x3c451['query'][_0x32d9('0x3f')]){_0x37f1de['where']=_[_0x32d9('0x40')](_0x37f1de[_0x32d9('0x3e')],{'$or':_['map'](_0x37f1de[_0x32d9('0x38')],function(_0x48ad55){var _0x487931={};_0x487931[_0x48ad55]={'$like':'%'+_0x3c451[_0x32d9('0x33')]['filter']+'%'};return _0x487931;})});}_0x37f1de=_[_0x32d9('0x40')]({},_0x37f1de,_0x3c451[_0x32d9('0x42')]);return _0x2e0ded['getLists'](_0x37f1de);}})[_0x32d9('0x28')](function(_0xa797db){if(_0xa797db){_0x5123f3=_0xa797db['length'];if(!_0x3c451[_0x32d9('0x33')][_0x32d9('0x3b')]('nolimit')){_0x37f1de[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x3c451[_0x32d9('0x33')]['limit']);_0x37f1de[_0x32d9('0x21')]=qs['offset'](_0x3c451[_0x32d9('0x33')][_0x32d9('0x21')]);}return _0x2e0ded[_0x32d9('0x64')](_0x37f1de);}})[_0x32d9('0x28')](function(_0x258c45){if(_0x258c45){return _0x258c45?{'count':_0x5123f3,'rows':_0x258c45}:null;}})[_0x32d9('0x28')](respondWithResult(_0x10a0f4,null))['catch'](handleError(_0x10a0f4,null));};exports[_0x32d9('0x66')]=function(_0x7da7dd,_0x173357,_0xab4efe){var _0x7de90d,_0x5e2ee5;var _0x4cad65=[];var _0xa9b008=moment()[_0x32d9('0x67')](_0x32d9('0x68'));return db[_0x32d9('0x2f')]['find']({'where':{'id':_0x7da7dd[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x173357,null))[_0x32d9('0x28')](function(_0x1fcb19){if(_0x1fcb19){_0x5e2ee5=_0x1fcb19;return _0x1fcb19[_0x32d9('0x66')](_0x7da7dd[_0x32d9('0x4d')]['ids'],_[_0x32d9('0x56')](_0x7da7dd[_0x32d9('0x4d')],[_0x32d9('0x69'),'id'])||{});}return null;})[_0x32d9('0x6a')](function(_0xaafb5d){var _0x11df73;var _0x3d687c;_0x7de90d=_0xaafb5d||[];var _0x5786f0=[];if(_0xaafb5d){for(var _0x2335db=0x0;_0x2335db<_0xaafb5d[_0x32d9('0x3a')];_0x2335db+=0x1){var _0x4bc6bf=_0xaafb5d[_0x2335db]['get']({'plain':!![]});_0x5e2ee5[_0x32d9('0x6b')]=_0x7da7dd['body'][_0x32d9('0x6b')]?_0x7da7dd['body'][_0x32d9('0x6b')]:_0x5e2ee5['dialCheckDuplicateType'];switch(_0x5e2ee5['dialCheckDuplicateType']){case _0x32d9('0x6c'):_0x11df73=squel[_0x32d9('0x6d')]()[_0x32d9('0x6e')](_0x32d9('0x6f'))[_0x32d9('0x70')]([_0x32d9('0x71'),'scheduledAt',_0x32d9('0x72'),'ListId',_0x32d9('0x5f'),_0x32d9('0x73'),_0x32d9('0x55')],squel[_0x32d9('0x74')]()['field'](_0x32d9('0x71'),_0x32d9('0x71'))[_0x32d9('0x75')]('NOW()',_0x32d9('0x76'))['field']('id',_0x32d9('0x72'))[_0x32d9('0x75')](_0x4bc6bf['CmListId']['toString'](),_0x32d9('0x77'))['field'](_0x7da7dd['params']['id'][_0x32d9('0x78')](),'CampaignId')[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x73'))[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x55'))['from'](_0x32d9('0x79'))[_0x32d9('0x3e')](_0x32d9('0x7a'))[_0x32d9('0x3e')]('ListId\x20=\x20?',_0x4bc6bf[_0x32d9('0x7b')][_0x32d9('0x78')]())[_0x32d9('0x3e')](_0x32d9('0x7c'))[_0x32d9('0x3e')](_0x32d9('0x7d'),squel[_0x32d9('0x74')]()['field'](_0x32d9('0x7e'))['from'](_0x32d9('0x7f'))[_0x32d9('0x3e')](_0x32d9('0x80'),_0x7da7dd[_0x32d9('0x48')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x32d9('0x74')]()[_0x32d9('0x75')](_0x32d9('0x81'))[_0x32d9('0x82')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x7da7dd[_0x32d9('0x48')]['id'][_0x32d9('0x78')]())))[_0x32d9('0x78')]();break;case _0x32d9('0x83'):_0x11df73=squel[_0x32d9('0x6d')]()['into'](_0x32d9('0x6f'))['fromQuery']([_0x32d9('0x71'),_0x32d9('0x76'),_0x32d9('0x72'),_0x32d9('0x77'),'CampaignId',_0x32d9('0x73'),_0x32d9('0x55')],squel[_0x32d9('0x74')]()[_0x32d9('0x75')](_0x32d9('0x71'),_0x32d9('0x71'))[_0x32d9('0x75')]('NOW()',_0x32d9('0x76'))['field']('id',_0x32d9('0x72'))['field'](_0x4bc6bf[_0x32d9('0x7b')][_0x32d9('0x78')](),_0x32d9('0x77'))[_0x32d9('0x75')](_0x7da7dd[_0x32d9('0x48')]['id']['toString'](),_0x32d9('0x5f'))[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x73'))[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x55'))['from'](_0x32d9('0x79'))[_0x32d9('0x3e')]('deletedAt\x20IS\x20NULL')[_0x32d9('0x3e')]('ListId\x20=\x20?',_0x4bc6bf[_0x32d9('0x7b')][_0x32d9('0x78')]())[_0x32d9('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x32d9('0x3e')](_0x32d9('0x7d'),squel['select']()['field'](_0x32d9('0x81'))['from'](_0x32d9('0x6f'))[_0x32d9('0x3e')](_0x32d9('0x80'),_0x7da7dd[_0x32d9('0x48')]['id'][_0x32d9('0x78')]())))[_0x32d9('0x78')]();break;default:_0x11df73=squel[_0x32d9('0x6d')]()[_0x32d9('0x6e')](_0x32d9('0x6f'))[_0x32d9('0x70')](['phone','scheduledAt',_0x32d9('0x72'),_0x32d9('0x77'),'CampaignId',_0x32d9('0x73'),_0x32d9('0x55')],squel[_0x32d9('0x74')]()['field'](_0x32d9('0x71'),_0x32d9('0x71'))[_0x32d9('0x75')](_0x32d9('0x84'),'scheduledAt')[_0x32d9('0x75')]('id',_0x32d9('0x72'))['field'](_0x4bc6bf[_0x32d9('0x7b')][_0x32d9('0x78')](),_0x32d9('0x77'))['field'](_0x7da7dd[_0x32d9('0x48')]['id'][_0x32d9('0x78')](),'CampaignId')[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x73'))['field']('\x27'+_0xa9b008+'\x27',_0x32d9('0x55'))['from']('cm_contacts')[_0x32d9('0x3e')](_0x32d9('0x7a'))[_0x32d9('0x3e')]('ListId\x20=\x20?',_0x4bc6bf[_0x32d9('0x7b')]['toString']())[_0x32d9('0x3e')](_0x32d9('0x7c')))['toString']();}_0x3d687c=squel[_0x32d9('0x6d')]()[_0x32d9('0x6e')](_0x32d9('0x85'))['fromQuery']([_0x32d9('0x86'),_0x32d9('0x76'),_0x32d9('0x71'),_0x32d9('0x87'),_0x32d9('0x73'),_0x32d9('0x55')],squel[_0x32d9('0x74')]()[_0x32d9('0x75')](_0x32d9('0x88'),'id')['field'](_0x32d9('0x84'),_0x32d9('0x76'))[_0x32d9('0x75')](_0x32d9('0x89'),'phone')[_0x32d9('0x75')](_0x32d9('0x8a'),'OrderBy')[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x73'))[_0x32d9('0x75')]('\x27'+_0xa9b008+'\x27',_0x32d9('0x55'))['from']('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x32d9('0x8b'))['where']('h.ListId\x20=\x20?',_0x4bc6bf[_0x32d9('0x7b')]['toString']())[_0x32d9('0x3e')](_0x32d9('0x8c'),_0x7da7dd[_0x32d9('0x48')]['id'][_0x32d9('0x78')]())[_0x32d9('0x3e')](_0x32d9('0x8d'),_0xa9b008))[_0x32d9('0x78')]();_0x5786f0['push'](db[_0x32d9('0x8e')][_0x32d9('0x33')](_0x11df73));_0x4cad65[_0x32d9('0x8f')](db['sequelize'][_0x32d9('0x33')](_0x3d687c));}return BPromise[_0x32d9('0x90')](_0x5786f0);}})[_0x32d9('0x28')](function(){return BPromise[_0x32d9('0x90')](_0x4cad65);})['then'](function(){return _0x7de90d;})[_0x32d9('0x28')](respondWithResult(_0x173357,null))[_0x32d9('0x46')](handleError(_0x173357,null));};exports['removeLists']=function(_0x4a80af,_0x3ef361,_0x340371){return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x4a80af[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x3ef361,null))['then'](function(_0x52299d){if(_0x52299d){return _0x52299d[_0x32d9('0x91')](_0x4a80af['query'][_0x32d9('0x69')]);}})['then'](function(_0x12bd60){if(_0x12bd60){return db[_0x32d9('0x5a')][_0x32d9('0x2b')]({'where':{'ListId':_0x4a80af[_0x32d9('0x33')][_0x32d9('0x69')],'CampaignId':_0x4a80af[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](function(){return _0x12bd60;});}})[_0x32d9('0x28')](respondWithStatusCode(_0x3ef361,null))[_0x32d9('0x46')](handleError(_0x3ef361,null));};exports[_0x32d9('0x92')]=function(_0x2223b0,_0x453aff,_0x3aaf4a){var _0x428d48={};var _0x1ac7fa={};var _0x31fb09;var _0x5ed849;return db[_0x32d9('0x2f')][_0x32d9('0x60')]({'where':{'id':_0x2223b0[_0x32d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x453aff,null))[_0x32d9('0x28')](function(_0x150ceb){if(_0x150ceb){_0x31fb09=_0x150ceb;_0x1ac7fa[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x65')][_0x32d9('0x49')]);_0x1ac7fa[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x2223b0[_0x32d9('0x33')]);_0x1ac7fa[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x1ac7fa[_0x32d9('0x37')],_0x1ac7fa[_0x32d9('0x33')]);_0x428d48[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x1ac7fa[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x2223b0['query']['fields']));_0x428d48[_0x32d9('0x38')]=_0x428d48[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x428d48[_0x32d9('0x38')]:_0x1ac7fa[_0x32d9('0x37')];_0x428d48[_0x32d9('0x3c')]=qs['sort'](_0x2223b0[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x428d48[_0x32d9('0x3e')]=qs['filters'](_[_0x32d9('0x5c')](_0x2223b0[_0x32d9('0x33')],_0x1ac7fa[_0x32d9('0x35')]));if(_0x2223b0['query'][_0x32d9('0x3f')]){_0x428d48['where']=_[_0x32d9('0x40')](_0x428d48[_0x32d9('0x3e')],{'$or':_[_0x32d9('0x2e')](_0x428d48[_0x32d9('0x38')],function(_0x20f8ae){var _0x4239e3={};_0x4239e3[_0x20f8ae]={'$like':'%'+_0x2223b0[_0x32d9('0x33')]['filter']+'%'};return _0x4239e3;})});}_0x428d48=_['merge']({},_0x428d48,_0x2223b0[_0x32d9('0x42')]);return _0x31fb09['getBlackLists'](_0x428d48);}})['then'](function(_0x2c5d81){if(_0x2c5d81){_0x5ed849=_0x2c5d81[_0x32d9('0x3a')];if(!_0x2223b0[_0x32d9('0x33')][_0x32d9('0x3b')]('nolimit')){_0x428d48[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x2223b0[_0x32d9('0x33')][_0x32d9('0x22')]);_0x428d48['offset']=qs[_0x32d9('0x21')](_0x2223b0[_0x32d9('0x33')]['offset']);}return _0x31fb09[_0x32d9('0x92')](_0x428d48);}})[_0x32d9('0x28')](function(_0x2d9793){if(_0x2d9793){return _0x2d9793?{'count':_0x5ed849,'rows':_0x2d9793}:null;}})[_0x32d9('0x28')](respondWithResult(_0x453aff,null))[_0x32d9('0x46')](handleError(_0x453aff,null));};exports[_0x32d9('0x93')]=function(_0xf0d31c,_0x5814db,_0x101225){var _0xd03dc1,_0x1894c3;var _0x12e0ef=[];var _0x39d1a6=moment()[_0x32d9('0x67')](_0x32d9('0x68'));return db['Campaign'][_0x32d9('0x4b')]({'where':{'id':_0xf0d31c[_0x32d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x5814db,null))[_0x32d9('0x28')](function(_0x3a614b){if(_0x3a614b){_0x1894c3=_0x3a614b;return _0x3a614b['addBlackLists'](_0xf0d31c[_0x32d9('0x4d')][_0x32d9('0x69')],_['omit'](_0xf0d31c['body'],[_0x32d9('0x69'),'id'])||{});}return null;})[_0x32d9('0x6a')](function(_0x3af376){var _0x258d61;var _0x4b3577;_0xd03dc1=_0x3af376||[];var _0x50c867=[];if(_0x3af376){for(var _0x57da0e=0x0;_0x57da0e<_0x3af376[_0x32d9('0x3a')];_0x57da0e+=0x1){var _0x2ca451=_0x3af376[_0x57da0e][_0x32d9('0x29')]({'plain':!![]});_0x258d61=squel[_0x32d9('0x6d')]()[_0x32d9('0x6e')](_0x32d9('0x94'))[_0x32d9('0x70')]([_0x32d9('0x71'),_0x32d9('0x72'),_0x32d9('0x77'),_0x32d9('0x5f'),_0x32d9('0x73'),'updatedAt'],squel[_0x32d9('0x74')]()[_0x32d9('0x75')](_0x32d9('0x71'),'phone')[_0x32d9('0x75')]('id',_0x32d9('0x72'))['field'](_0x2ca451[_0x32d9('0x7b')][_0x32d9('0x78')](),_0x32d9('0x77'))[_0x32d9('0x75')](_0xf0d31c[_0x32d9('0x48')]['id'][_0x32d9('0x78')](),_0x32d9('0x5f'))[_0x32d9('0x75')]('NOW()',_0x32d9('0x73'))['field'](_0x32d9('0x84'),_0x32d9('0x55'))[_0x32d9('0x82')](_0x32d9('0x79'))[_0x32d9('0x3e')](_0x32d9('0x7a'))['where']('ListId\x20=\x20?',_0x2ca451[_0x32d9('0x7b')]['toString']())[_0x32d9('0x3e')](_0x32d9('0x7c')))[_0x32d9('0x78')]();_0x50c867[_0x32d9('0x8f')](db[_0x32d9('0x8e')][_0x32d9('0x33')](_0x258d61));}return BPromise[_0x32d9('0x90')](_0x50c867);}})[_0x32d9('0x28')](function(){return _0xd03dc1;})['then'](respondWithResult(_0x5814db,null))[_0x32d9('0x46')](handleError(_0x5814db,null));};exports[_0x32d9('0x95')]=function(_0x20911c,_0x4821e6,_0xb0db18){return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x20911c[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x4821e6,null))['then'](function(_0xaa1f53){if(_0xaa1f53){return _0xaa1f53['removeBlackLists'](_0x20911c[_0x32d9('0x33')][_0x32d9('0x69')]);}})[_0x32d9('0x28')](function(_0xea2c91){if(_0xea2c91){return db[_0x32d9('0x63')][_0x32d9('0x2b')]({'where':{'ListId':_0x20911c[_0x32d9('0x33')][_0x32d9('0x69')],'CampaignId':_0x20911c['params']['id']}})[_0x32d9('0x28')](function(){return _0xea2c91;});}})[_0x32d9('0x28')](respondWithStatusCode(_0x4821e6,null))[_0x32d9('0x46')](handleError(_0x4821e6,null));}; \ No newline at end of file +var _0x6dcd=['ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','push','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','name','send','index','map','Campaign','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','createdAt','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','deletedAt\x20IS\x20NULL','insert','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item'];(function(_0x196154,_0x315041){var _0x1e355c=function(_0x19e74e){while(--_0x19e74e){_0x196154['push'](_0x196154['shift']());}};_0x1e355c(++_0x315041);}(_0x6dcd,0xa2));var _0xd6dc=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x6dcd[_0x397bfb];return _0x16c9b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6dc('0x1'));var rp=require(_0xd6dc('0x2'));var moment=require(_0xd6dc('0x3'));var BPromise=require(_0xd6dc('0x4'));var Mustache=require(_0xd6dc('0x5'));var util=require(_0xd6dc('0x6'));var path=require(_0xd6dc('0x7'));var sox=require(_0xd6dc('0x8'));var csv=require(_0xd6dc('0x9'));var ejs=require(_0xd6dc('0xa'));var fs=require('fs');var fs_extra=require(_0xd6dc('0xb'));var _=require(_0xd6dc('0xc'));var squel=require(_0xd6dc('0xd'));var crypto=require(_0xd6dc('0xe'));var jsforce=require(_0xd6dc('0xf'));var deskjs=require(_0xd6dc('0x10'));var toCsv=require(_0xd6dc('0x9'));var querystring=require('querystring');var Papa=require(_0xd6dc('0x11'));var Redis=require(_0xd6dc('0x12'));var authService=require(_0xd6dc('0x13'));var qs=require(_0xd6dc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6dc('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd6dc('0x16'));var licenseUtil=require(_0xd6dc('0x17'));var db=require(_0xd6dc('0x18'))['db'];function respondWithStatusCode(_0x5e94b3,_0x5d88f1){_0x5d88f1=_0x5d88f1||0xcc;return function(_0x3de00e){if(_0x3de00e){return _0x5e94b3[_0xd6dc('0x19')](_0x5d88f1);}return _0x5e94b3[_0xd6dc('0x1a')](_0x5d88f1)['end']();};}function respondWithResult(_0x40bd2c,_0x36722c){_0x36722c=_0x36722c||0xc8;return function(_0x5cb281){if(_0x5cb281){return _0x40bd2c[_0xd6dc('0x1a')](_0x36722c)[_0xd6dc('0x1b')](_0x5cb281);}};}function respondWithFilteredResult(_0x4c2347,_0x310868){return function(_0x1ef068){if(_0x1ef068){var _0x453bc4=typeof _0x310868[_0xd6dc('0x1c')]===_0xd6dc('0x1d')&&typeof _0x310868[_0xd6dc('0x1e')]===_0xd6dc('0x1d');var _0x1ed47b=_0x1ef068[_0xd6dc('0x1f')];var _0x4baa71=_0x453bc4?0x0:_0x310868[_0xd6dc('0x1c')];var _0xd99b5b=_0x453bc4?_0x1ef068[_0xd6dc('0x1f')]:_0x310868['offset']+_0x310868[_0xd6dc('0x1e')];var _0xf4982e;if(_0xd99b5b>=_0x1ed47b){_0xd99b5b=_0x1ed47b;_0xf4982e=0xc8;}else{_0xf4982e=0xce;}_0x4c2347[_0xd6dc('0x1a')](_0xf4982e);return _0x4c2347[_0xd6dc('0x20')](_0xd6dc('0x21'),_0x4baa71+'-'+_0xd99b5b+'/'+_0x1ed47b)[_0xd6dc('0x1b')](_0x1ef068);}return null;};}function patchUpdates(_0xde1b12){return function(_0x12c8ea){try{jsonpatch[_0xd6dc('0x22')](_0x12c8ea,_0xde1b12,!![]);}catch(_0x243780){return BPromise['reject'](_0x243780);}return _0x12c8ea[_0xd6dc('0x23')]();};}function saveUpdates(_0x586e87,_0x23093d){return function(_0x3688ae){if(_0x3688ae){return _0x3688ae[_0xd6dc('0x24')](_0x586e87)[_0xd6dc('0x25')](function(_0x905295){return _0x905295;});}return null;};}function removeEntity(_0x57f19c,_0x4e35b6){return function(_0x3a38be){if(_0x3a38be){return _0x3a38be[_0xd6dc('0x26')]()['then'](function(){var _0x40ab50=_0x3a38be[_0xd6dc('0x27')]({'plain':!![]});var _0x206ffa='IvrCampaigns';return db[_0xd6dc('0x28')][_0xd6dc('0x26')]({'where':{'type':_0x206ffa,'resourceId':_0x40ab50['id']}})[_0xd6dc('0x25')](function(){return _0x3a38be;});})[_0xd6dc('0x25')](function(){_0x57f19c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x522557,_0xaa5ba6){return function(_0x3ac99e){if(!_0x3ac99e){_0x522557[_0xd6dc('0x19')](0x194);}return _0x3ac99e;};}function handleError(_0x5de7cc,_0x22f9af){_0x22f9af=_0x22f9af||0x1f4;return function(_0x24d891){logger['error'](_0x24d891['stack']);if(_0x24d891['name']){delete _0x24d891[_0xd6dc('0x29')];}_0x5de7cc['status'](_0x22f9af)[_0xd6dc('0x2a')](_0x24d891);};}exports[_0xd6dc('0x2b')]=function(_0xc1312b,_0x5c2f06){var _0x77d021={},_0x41d29c={},_0x31ed53={'count':0x0,'rows':[]};var _0x297694=_[_0xd6dc('0x2c')](db[_0xd6dc('0x2d')][_0xd6dc('0x2e')],function(_0x52b610){return{'name':_0x52b610[_0xd6dc('0x2f')],'type':_0x52b610[_0xd6dc('0x30')]['key']};});_0x41d29c[_0xd6dc('0x31')]=_[_0xd6dc('0x2c')](_0x297694,_0xd6dc('0x29'));_0x41d29c[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0xc1312b[_0xd6dc('0x32')]);_0x41d29c[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0x41d29c['model'],_0x41d29c[_0xd6dc('0x32')]);_0x77d021['attributes']=_[_0xd6dc('0x35')](_0x41d29c[_0xd6dc('0x31')],qs['fields'](_0xc1312b['query'][_0xd6dc('0x36')]));_0x77d021['attributes']=_0x77d021[_0xd6dc('0x37')][_0xd6dc('0x38')]?_0x77d021[_0xd6dc('0x37')]:_0x41d29c[_0xd6dc('0x31')];if(!_0xc1312b['query'][_0xd6dc('0x39')](_0xd6dc('0x3a'))){_0x77d021[_0xd6dc('0x1e')]=qs[_0xd6dc('0x1e')](_0xc1312b['query'][_0xd6dc('0x1e')]);_0x77d021[_0xd6dc('0x1c')]=qs[_0xd6dc('0x1c')](_0xc1312b['query'][_0xd6dc('0x1c')]);}_0x77d021[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0xc1312b['query']['sort']);_0x77d021['where']=qs[_0xd6dc('0x34')](_[_0xd6dc('0x3d')](_0xc1312b[_0xd6dc('0x32')],_0x41d29c['filters']),_0x297694);if(_0xc1312b[_0xd6dc('0x32')][_0xd6dc('0x3e')]){_0x77d021[_0xd6dc('0x3f')]=_[_0xd6dc('0x40')](_0x77d021[_0xd6dc('0x3f')],{'$or':_[_0xd6dc('0x2c')](_0x297694,function(_0x1335df){if(_0x1335df[_0xd6dc('0x30')]!=='VIRTUAL'){var _0x123eff={};_0x123eff[_0x1335df['name']]={'$like':'%'+_0xc1312b['query'][_0xd6dc('0x3e')]+'%'};return _0x123eff;}})});}_0x77d021=_['merge']({},_0x77d021,_0xc1312b[_0xd6dc('0x41')]);var _0x2af4ae={'where':_0x77d021[_0xd6dc('0x3f')]};return db[_0xd6dc('0x2d')][_0xd6dc('0x1f')](_0x2af4ae)['then'](function(_0x1824a9){_0x31ed53[_0xd6dc('0x1f')]=_0x1824a9;if(_0xc1312b[_0xd6dc('0x32')][_0xd6dc('0x42')]){_0x77d021[_0xd6dc('0x43')]=[{'all':!![]}];}return db['Campaign'][_0xd6dc('0x44')](_0x77d021);})[_0xd6dc('0x25')](function(_0x17b8a4){_0x31ed53[_0xd6dc('0x45')]=_0x17b8a4;return _0x31ed53;})[_0xd6dc('0x25')](respondWithFilteredResult(_0x5c2f06,_0x77d021))['catch'](handleError(_0x5c2f06,null));};exports['show']=function(_0x88f7a5,_0x626f8d){var _0x14dba8={'raw':![],'where':{'id':_0x88f7a5[_0xd6dc('0x46')]['id']}},_0x5c7acd={};_0x5c7acd[_0xd6dc('0x31')]=_[_0xd6dc('0x33')](db[_0xd6dc('0x2d')][_0xd6dc('0x2e')]);_0x5c7acd[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x88f7a5[_0xd6dc('0x32')]);_0x5c7acd[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0x5c7acd[_0xd6dc('0x31')],_0x5c7acd['query']);_0x14dba8[_0xd6dc('0x37')]=_['intersection'](_0x5c7acd[_0xd6dc('0x31')],qs[_0xd6dc('0x36')](_0x88f7a5['query'][_0xd6dc('0x36')]));_0x14dba8[_0xd6dc('0x37')]=_0x14dba8[_0xd6dc('0x37')][_0xd6dc('0x38')]?_0x14dba8['attributes']:_0x5c7acd[_0xd6dc('0x31')];if(_0x88f7a5[_0xd6dc('0x32')]['includeAll']){_0x14dba8[_0xd6dc('0x43')]=[{'all':!![]}];}_0x14dba8=_[_0xd6dc('0x40')]({},_0x14dba8,_0x88f7a5[_0xd6dc('0x41')]);return db[_0xd6dc('0x2d')]['find'](_0x14dba8)['then'](handleEntityNotFound(_0x626f8d,null))[_0xd6dc('0x25')](respondWithResult(_0x626f8d,null))[_0xd6dc('0x47')](handleError(_0x626f8d,null));};exports[_0xd6dc('0x48')]=function(_0x1dbecd,_0x98a105){return db[_0xd6dc('0x2d')][_0xd6dc('0x48')](_0x1dbecd[_0xd6dc('0x49')],{})['then'](function(_0x3d6410){var _0x57ea71=_0x1dbecd['user'][_0xd6dc('0x27')]({'plain':!![]});if(!_0x57ea71)throw new Error(_0xd6dc('0x4a'));if(_0x57ea71[_0xd6dc('0x4b')]===_0xd6dc('0x4c')){var _0x56ac24=_0x3d6410[_0xd6dc('0x27')]({'plain':!![]});var _0x469a49=_0xd6dc('0x4d');return db[_0xd6dc('0x4e')][_0xd6dc('0x4f')]({'where':{'name':_0x469a49,'userProfileId':_0x57ea71[_0xd6dc('0x50')]},'raw':!![]})['then'](function(_0x548cb3){if(_0x548cb3&&_0x548cb3[_0xd6dc('0x51')]===0x0){return db[_0xd6dc('0x28')][_0xd6dc('0x48')]({'name':_0x56ac24['name'],'resourceId':_0x56ac24['id'],'type':_0x548cb3[_0xd6dc('0x29')],'sectionId':_0x548cb3['id']},{})[_0xd6dc('0x25')](function(){return _0x3d6410;});}else{return _0x3d6410;}})[_0xd6dc('0x47')](function(_0x471956){logger[_0xd6dc('0x52')](_0xd6dc('0x53'),_0x471956);throw _0x471956;});}return _0x3d6410;})[_0xd6dc('0x25')](respondWithResult(_0x98a105,0xc9))[_0xd6dc('0x47')](handleError(_0x98a105,null));};exports[_0xd6dc('0x54')]=function(_0x1c1564,_0xe2b949){var _0x4a56bc={'where':{'id':_0x1c1564[_0xd6dc('0x46')]['id']}},_0x4466f9={};_0x4466f9['model']=_[_0xd6dc('0x33')](db['Campaign'][_0xd6dc('0x2e')]);_0x4a56bc[_0xd6dc('0x37')]=_[_0xd6dc('0x35')](_0x4466f9[_0xd6dc('0x31')],qs['fields'](_0x1c1564[_0xd6dc('0x32')][_0xd6dc('0x36')]));_0x4a56bc[_0xd6dc('0x37')]=_0x4a56bc[_0xd6dc('0x37')]['length']?_0x4a56bc[_0xd6dc('0x37')]:_0x4466f9[_0xd6dc('0x31')];if(_0x1c1564[_0xd6dc('0x32')][_0xd6dc('0x42')]){_0x4a56bc[_0xd6dc('0x43')]=[{'all':!![]}];}_0x4a56bc=_['merge']({},_0x4a56bc,_0x1c1564[_0xd6dc('0x41')]);return db[_0xd6dc('0x2d')][_0xd6dc('0x4f')](_0x4a56bc)[_0xd6dc('0x25')](handleEntityNotFound(_0xe2b949,null))[_0xd6dc('0x25')](function(_0x3b5b8e){if(_0x3b5b8e){var _0x502ab2=_0x3b5b8e['get']({'plain':!![]});_0x502ab2=qs[_0xd6dc('0x55')](_0x502ab2,['id','createdAt',_0xd6dc('0x56')]);_0x1c1564[_0xd6dc('0x49')]=_[_0xd6dc('0x55')](_0x1c1564[_0xd6dc('0x49')],['id','createdAt',_0xd6dc('0x56')]);return db[_0xd6dc('0x2d')]['create'](_[_0xd6dc('0x40')](_0x502ab2,_0x1c1564[_0xd6dc('0x49')]),{'include':_0x1c1564[_0xd6dc('0x32')][_0xd6dc('0x42')]?[{'all':!![]}]:undefined})[_0xd6dc('0x25')](function(_0x24eda6){var _0x3fe3ca=_0x1c1564[_0xd6dc('0x4c')][_0xd6dc('0x27')]({'plain':!![]});if(!_0x3fe3ca)throw new Error(_0xd6dc('0x4a'));if(_0x3fe3ca['role']===_0xd6dc('0x4c')){var _0x1f0197=_0x24eda6[_0xd6dc('0x27')]({'plain':!![]});var _0x1e63f8=_0xd6dc('0x4d');return db[_0xd6dc('0x4e')][_0xd6dc('0x4f')]({'where':{'name':_0x1e63f8,'userProfileId':_0x3fe3ca['userProfileId']},'raw':!![]})[_0xd6dc('0x25')](function(_0x314aed){if(_0x314aed&&_0x314aed[_0xd6dc('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f0197['name'],'resourceId':_0x1f0197['id'],'type':_0x314aed[_0xd6dc('0x29')],'sectionId':_0x314aed['id']},{})[_0xd6dc('0x25')](function(){return _0x24eda6;});}else{return _0x24eda6;}})[_0xd6dc('0x47')](function(_0x4ea8c9){logger[_0xd6dc('0x52')](_0xd6dc('0x53'),_0x4ea8c9);throw _0x4ea8c9;});}return _0x24eda6;});}})[_0xd6dc('0x25')](respondWithResult(_0xe2b949,0xc9))[_0xd6dc('0x47')](handleError(_0xe2b949,null));};exports[_0xd6dc('0x24')]=function(_0xf979ba,_0x1a8953){if(_0xf979ba[_0xd6dc('0x49')]['id']){delete _0xf979ba[_0xd6dc('0x49')]['id'];}return db[_0xd6dc('0x2d')][_0xd6dc('0x4f')]({'where':{'id':_0xf979ba[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x1a8953,null))[_0xd6dc('0x25')](saveUpdates(_0xf979ba['body'],null))['then'](respondWithResult(_0x1a8953,null))['catch'](handleError(_0x1a8953,null));};exports[_0xd6dc('0x26')]=function(_0x3c97fb,_0x54e334){return db['Campaign']['find']({'where':{'id':_0x3c97fb[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x54e334,null))[_0xd6dc('0x25')](removeEntity(_0x54e334,null))[_0xd6dc('0x47')](handleError(_0x54e334,null));};exports[_0xd6dc('0x57')]=function(_0x1a609a,_0x5e7602,_0x392b5b){var _0x46980b={'raw':!![],'where':{}};var _0x528669={};var _0x37f485={'count':0x0,'rows':[]};return db[_0xd6dc('0x2d')][_0xd6dc('0x58')]({'where':{'id':_0x1a609a[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x5e7602,null))[_0xd6dc('0x25')](function(_0xf3bcbe){if(_0xf3bcbe){_0x528669[_0xd6dc('0x31')]=_['keys'](db[_0xd6dc('0x59')]['rawAttributes']);_0x528669[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x1a609a[_0xd6dc('0x32')]);_0x528669[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0x528669['model'],_0x528669[_0xd6dc('0x32')]);_0x46980b[_0xd6dc('0x37')]=_[_0xd6dc('0x35')](_0x528669[_0xd6dc('0x31')],qs[_0xd6dc('0x36')](_0x1a609a['query']['fields']));_0x46980b[_0xd6dc('0x37')]=_0x46980b['attributes'][_0xd6dc('0x38')]?_0x46980b[_0xd6dc('0x37')]:_0x528669['model'];if(!_0x1a609a[_0xd6dc('0x32')]['hasOwnProperty']('nolimit')){_0x46980b[_0xd6dc('0x1e')]=qs['limit'](_0x1a609a['query'][_0xd6dc('0x1e')]);_0x46980b[_0xd6dc('0x1c')]=qs['offset'](_0x1a609a[_0xd6dc('0x32')][_0xd6dc('0x1c')]);}_0x46980b[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0x1a609a[_0xd6dc('0x32')][_0xd6dc('0x3c')]);_0x46980b[_0xd6dc('0x3f')]=qs[_0xd6dc('0x34')](_[_0xd6dc('0x3d')](_0x1a609a[_0xd6dc('0x32')],_0x528669[_0xd6dc('0x34')]));_0x46980b[_0xd6dc('0x3f')][_0xd6dc('0x5a')]=_0xf3bcbe['id'];if(_0x1a609a['query'][_0xd6dc('0x3e')]){_0x46980b['where']=_['merge'](_0x46980b[_0xd6dc('0x3f')],{'$or':_['map'](_0x46980b['attributes'],function(_0x1deccb){var _0x1f251f={};_0x1f251f[_0x1deccb]={'$like':'%'+_0x1a609a[_0xd6dc('0x32')][_0xd6dc('0x3e')]+'%'};return _0x1f251f;})});}_0x46980b=_[_0xd6dc('0x40')]({},_0x46980b,_0x1a609a[_0xd6dc('0x41')]);return db[_0xd6dc('0x59')][_0xd6dc('0x1f')]({'where':_0x46980b[_0xd6dc('0x3f')]})['then'](function(_0x9cfa0c){_0x37f485['count']=_0x9cfa0c;if(_0x1a609a[_0xd6dc('0x32')][_0xd6dc('0x42')]){_0x46980b['include']=[{'all':!![]}];}return db[_0xd6dc('0x59')][_0xd6dc('0x44')](_0x46980b);})[_0xd6dc('0x25')](function(_0x2a5c6f){_0x37f485['rows']=_0x2a5c6f;return _0x37f485;});}})[_0xd6dc('0x25')](respondWithFilteredResult(_0x5e7602,_0x46980b))['catch'](handleError(_0x5e7602,null));};exports[_0xd6dc('0x5b')]=function(_0x2647af,_0x1bac04,_0xf10a6b){var _0x556521={'raw':!![],'where':{}};var _0x38ddae={};var _0x207641={'count':0x0,'rows':[]};return db[_0xd6dc('0x2d')][_0xd6dc('0x58')]({'where':{'id':_0x2647af[_0xd6dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bac04,null))[_0xd6dc('0x25')](function(_0x4a4d93){if(_0x4a4d93){_0x38ddae[_0xd6dc('0x31')]=_[_0xd6dc('0x33')](db['CmHopperHistory'][_0xd6dc('0x2e')]);_0x38ddae[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x2647af[_0xd6dc('0x32')]);_0x38ddae[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0x38ddae[_0xd6dc('0x31')],_0x38ddae[_0xd6dc('0x32')]);_0x556521['attributes']=_[_0xd6dc('0x35')](_0x38ddae[_0xd6dc('0x31')],qs[_0xd6dc('0x36')](_0x2647af[_0xd6dc('0x32')][_0xd6dc('0x36')]));_0x556521['attributes']=_0x556521[_0xd6dc('0x37')][_0xd6dc('0x38')]?_0x556521[_0xd6dc('0x37')]:_0x38ddae['model'];if(!_0x2647af['query']['hasOwnProperty']('nolimit')){_0x556521[_0xd6dc('0x1e')]=qs[_0xd6dc('0x1e')](_0x2647af[_0xd6dc('0x32')][_0xd6dc('0x1e')]);_0x556521[_0xd6dc('0x1c')]=qs[_0xd6dc('0x1c')](_0x2647af[_0xd6dc('0x32')][_0xd6dc('0x1c')]);}_0x556521[_0xd6dc('0x3b')]=qs['sort'](_0x2647af[_0xd6dc('0x32')][_0xd6dc('0x3c')]);_0x556521[_0xd6dc('0x3f')]=qs['filters'](_['pick'](_0x2647af[_0xd6dc('0x32')],_0x38ddae['filters']));_0x556521[_0xd6dc('0x3f')]['CampaignId']=_0x4a4d93['id'];if(_0x2647af[_0xd6dc('0x32')][_0xd6dc('0x3e')]){_0x556521['where']=_['merge'](_0x556521[_0xd6dc('0x3f')],{'$or':_[_0xd6dc('0x2c')](_0x556521[_0xd6dc('0x37')],function(_0x407399){var _0x32cf95={};_0x32cf95[_0x407399]={'$like':'%'+_0x2647af['query']['filter']+'%'};return _0x32cf95;})});}_0x556521=_[_0xd6dc('0x40')]({},_0x556521,_0x2647af[_0xd6dc('0x41')]);return db['CmHopperHistory'][_0xd6dc('0x1f')]({'where':_0x556521[_0xd6dc('0x3f')]})[_0xd6dc('0x25')](function(_0x25f8d0){_0x207641[_0xd6dc('0x1f')]=_0x25f8d0;if(_0x2647af[_0xd6dc('0x32')]['includeAll']){_0x556521[_0xd6dc('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd6dc('0x44')](_0x556521);})[_0xd6dc('0x25')](function(_0x1d1051){_0x207641[_0xd6dc('0x45')]=_0x1d1051;return _0x207641;});}})[_0xd6dc('0x25')](respondWithFilteredResult(_0x1bac04,_0x556521))[_0xd6dc('0x47')](handleError(_0x1bac04,null));};exports[_0xd6dc('0x5c')]=function(_0x1e87f7,_0x376174,_0x3a3774){var _0x17adca={'raw':!![],'where':{}};var _0x28def0={};var _0xa19688={'count':0x0,'rows':[]};return db['Campaign'][_0xd6dc('0x58')]({'where':{'id':_0x1e87f7[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x376174,null))['then'](function(_0x1a062a){if(_0x1a062a){_0x28def0[_0xd6dc('0x31')]=_[_0xd6dc('0x33')](db[_0xd6dc('0x5d')][_0xd6dc('0x2e')]);_0x28def0[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x1e87f7[_0xd6dc('0x32')]);_0x28def0[_0xd6dc('0x34')]=_['intersection'](_0x28def0[_0xd6dc('0x31')],_0x28def0['query']);_0x17adca['attributes']=_[_0xd6dc('0x35')](_0x28def0[_0xd6dc('0x31')],qs['fields'](_0x1e87f7[_0xd6dc('0x32')][_0xd6dc('0x36')]));_0x17adca[_0xd6dc('0x37')]=_0x17adca[_0xd6dc('0x37')]['length']?_0x17adca['attributes']:_0x28def0['model'];if(!_0x1e87f7[_0xd6dc('0x32')][_0xd6dc('0x39')]('nolimit')){_0x17adca[_0xd6dc('0x1e')]=qs[_0xd6dc('0x1e')](_0x1e87f7[_0xd6dc('0x32')][_0xd6dc('0x1e')]);_0x17adca['offset']=qs[_0xd6dc('0x1c')](_0x1e87f7['query']['offset']);}_0x17adca[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0x1e87f7['query'][_0xd6dc('0x3c')]);_0x17adca[_0xd6dc('0x3f')]=qs[_0xd6dc('0x34')](_[_0xd6dc('0x3d')](_0x1e87f7['query'],_0x28def0[_0xd6dc('0x34')]));_0x17adca[_0xd6dc('0x3f')][_0xd6dc('0x5a')]=_0x1a062a['id'];if(_0x1e87f7[_0xd6dc('0x32')][_0xd6dc('0x3e')]){_0x17adca[_0xd6dc('0x3f')]=_[_0xd6dc('0x40')](_0x17adca[_0xd6dc('0x3f')],{'$or':_[_0xd6dc('0x2c')](_0x17adca[_0xd6dc('0x37')],function(_0x1de555){var _0x546f97={};_0x546f97[_0x1de555]={'$like':'%'+_0x1e87f7[_0xd6dc('0x32')][_0xd6dc('0x3e')]+'%'};return _0x546f97;})});}_0x17adca=_[_0xd6dc('0x40')]({},_0x17adca,_0x1e87f7['options']);return db[_0xd6dc('0x5d')][_0xd6dc('0x1f')]({'where':_0x17adca['where']})['then'](function(_0x1f4894){_0xa19688[_0xd6dc('0x1f')]=_0x1f4894;if(_0x1e87f7['query'][_0xd6dc('0x42')]){_0x17adca[_0xd6dc('0x43')]=[{'all':!![]}];}return db[_0xd6dc('0x5d')][_0xd6dc('0x44')](_0x17adca);})[_0xd6dc('0x25')](function(_0x489774){_0xa19688[_0xd6dc('0x45')]=_0x489774;return _0xa19688;});}})[_0xd6dc('0x25')](respondWithFilteredResult(_0x376174,_0x17adca))[_0xd6dc('0x47')](handleError(_0x376174,null));};exports[_0xd6dc('0x5e')]=function(_0x1b31e1,_0x5c6096,_0x540c00){var _0x3dcf32={'raw':!![],'where':{}};var _0xe9fbcd={};var _0x3765ff={'count':0x0,'rows':[]};return db[_0xd6dc('0x2d')][_0xd6dc('0x58')]({'where':{'id':_0x1b31e1[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x5c6096,null))[_0xd6dc('0x25')](function(_0x694f86){if(_0x694f86){_0xe9fbcd[_0xd6dc('0x31')]=_[_0xd6dc('0x33')](db['CmHopperBlack'][_0xd6dc('0x2e')]);_0xe9fbcd[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x1b31e1[_0xd6dc('0x32')]);_0xe9fbcd[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0xe9fbcd[_0xd6dc('0x31')],_0xe9fbcd[_0xd6dc('0x32')]);_0x3dcf32[_0xd6dc('0x37')]=_[_0xd6dc('0x35')](_0xe9fbcd['model'],qs[_0xd6dc('0x36')](_0x1b31e1[_0xd6dc('0x32')][_0xd6dc('0x36')]));_0x3dcf32[_0xd6dc('0x37')]=_0x3dcf32[_0xd6dc('0x37')][_0xd6dc('0x38')]?_0x3dcf32[_0xd6dc('0x37')]:_0xe9fbcd[_0xd6dc('0x31')];if(!_0x1b31e1['query']['hasOwnProperty']('nolimit')){_0x3dcf32['limit']=qs[_0xd6dc('0x1e')](_0x1b31e1[_0xd6dc('0x32')][_0xd6dc('0x1e')]);_0x3dcf32[_0xd6dc('0x1c')]=qs['offset'](_0x1b31e1[_0xd6dc('0x32')]['offset']);}_0x3dcf32[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0x1b31e1[_0xd6dc('0x32')][_0xd6dc('0x3c')]);_0x3dcf32['where']=qs[_0xd6dc('0x34')](_[_0xd6dc('0x3d')](_0x1b31e1[_0xd6dc('0x32')],_0xe9fbcd[_0xd6dc('0x34')]));_0x3dcf32[_0xd6dc('0x3f')][_0xd6dc('0x5a')]=_0x694f86['id'];if(_0x1b31e1['query'][_0xd6dc('0x3e')]){_0x3dcf32[_0xd6dc('0x3f')]=_[_0xd6dc('0x40')](_0x3dcf32[_0xd6dc('0x3f')],{'$or':_[_0xd6dc('0x2c')](_0x3dcf32[_0xd6dc('0x37')],function(_0x6222cb){var _0x59b041={};_0x59b041[_0x6222cb]={'$like':'%'+_0x1b31e1[_0xd6dc('0x32')][_0xd6dc('0x3e')]+'%'};return _0x59b041;})});}_0x3dcf32=_[_0xd6dc('0x40')]({},_0x3dcf32,_0x1b31e1['options']);return db[_0xd6dc('0x5f')]['count']({'where':_0x3dcf32[_0xd6dc('0x3f')]})['then'](function(_0x3628ea){_0x3765ff[_0xd6dc('0x1f')]=_0x3628ea;if(_0x1b31e1[_0xd6dc('0x32')][_0xd6dc('0x42')]){_0x3dcf32['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3dcf32);})[_0xd6dc('0x25')](function(_0x1a067f){_0x3765ff[_0xd6dc('0x45')]=_0x1a067f;return _0x3765ff;});}})['then'](respondWithFilteredResult(_0x5c6096,_0x3dcf32))['catch'](handleError(_0x5c6096,null));};exports[_0xd6dc('0x60')]=function(_0x18ca3c,_0x503c39,_0x5917b3){var _0x280dc3={};var _0x5762c5={};var _0x523f30;var _0x5b3db6;return db[_0xd6dc('0x2d')][_0xd6dc('0x58')]({'where':{'id':_0x18ca3c['params']['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x503c39,null))[_0xd6dc('0x25')](function(_0x480c5c){if(_0x480c5c){_0x523f30=_0x480c5c;_0x5762c5[_0xd6dc('0x31')]=_[_0xd6dc('0x33')](db['CmList'][_0xd6dc('0x2e')]);_0x5762c5[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x18ca3c[_0xd6dc('0x32')]);_0x5762c5[_0xd6dc('0x34')]=_[_0xd6dc('0x35')](_0x5762c5[_0xd6dc('0x31')],_0x5762c5[_0xd6dc('0x32')]);_0x280dc3['attributes']=_['intersection'](_0x5762c5['model'],qs['fields'](_0x18ca3c[_0xd6dc('0x32')]['fields']));_0x280dc3[_0xd6dc('0x37')]=_0x280dc3['attributes']['length']?_0x280dc3[_0xd6dc('0x37')]:_0x5762c5[_0xd6dc('0x31')];_0x280dc3[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0x18ca3c[_0xd6dc('0x32')][_0xd6dc('0x3c')]);_0x280dc3[_0xd6dc('0x3f')]=qs[_0xd6dc('0x34')](_['pick'](_0x18ca3c[_0xd6dc('0x32')],_0x5762c5[_0xd6dc('0x34')]));if(_0x18ca3c[_0xd6dc('0x32')]['filter']){_0x280dc3[_0xd6dc('0x3f')]=_[_0xd6dc('0x40')](_0x280dc3[_0xd6dc('0x3f')],{'$or':_[_0xd6dc('0x2c')](_0x280dc3[_0xd6dc('0x37')],function(_0x76fbe){var _0x24df7a={};_0x24df7a[_0x76fbe]={'$like':'%'+_0x18ca3c[_0xd6dc('0x32')][_0xd6dc('0x3e')]+'%'};return _0x24df7a;})});}_0x280dc3=_['merge']({},_0x280dc3,_0x18ca3c['options']);return _0x523f30[_0xd6dc('0x60')](_0x280dc3);}})[_0xd6dc('0x25')](function(_0x295570){if(_0x295570){_0x5b3db6=_0x295570[_0xd6dc('0x38')];if(!_0x18ca3c[_0xd6dc('0x32')][_0xd6dc('0x39')](_0xd6dc('0x3a'))){_0x280dc3[_0xd6dc('0x1e')]=qs[_0xd6dc('0x1e')](_0x18ca3c[_0xd6dc('0x32')]['limit']);_0x280dc3[_0xd6dc('0x1c')]=qs['offset'](_0x18ca3c[_0xd6dc('0x32')][_0xd6dc('0x1c')]);}return _0x523f30['getLists'](_0x280dc3);}})[_0xd6dc('0x25')](function(_0x44be20){if(_0x44be20){return _0x44be20?{'count':_0x5b3db6,'rows':_0x44be20}:null;}})[_0xd6dc('0x25')](respondWithResult(_0x503c39,null))[_0xd6dc('0x47')](handleError(_0x503c39,null));};exports[_0xd6dc('0x61')]=function(_0x4e0f00,_0x1a10f8,_0x25b978){var _0x3d157d,_0x36ef21;var _0x1a875e=[];var _0x104c6f=moment()[_0xd6dc('0x62')](_0xd6dc('0x63'));return db[_0xd6dc('0x2d')][_0xd6dc('0x4f')]({'where':{'id':_0x4e0f00[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x1a10f8,null))[_0xd6dc('0x25')](function(_0x500d18){if(_0x500d18){_0x36ef21=_0x500d18;return _0x500d18[_0xd6dc('0x61')](_0x4e0f00['body'][_0xd6dc('0x64')],_[_0xd6dc('0x55')](_0x4e0f00[_0xd6dc('0x49')],['ids','id'])||{});}return null;})[_0xd6dc('0x65')](function(_0x2840fa){var _0x46cd50;var _0x3570b8;_0x3d157d=_0x2840fa||[];var _0x2ee539=[];if(_0x2840fa){for(var _0x5d8b54=0x0;_0x5d8b54<_0x2840fa['length'];_0x5d8b54+=0x1){var _0x11b1f2=_0x2840fa[_0x5d8b54][_0xd6dc('0x27')]({'plain':!![]});_0x36ef21[_0xd6dc('0x66')]=_0x4e0f00[_0xd6dc('0x49')][_0xd6dc('0x66')]?_0x4e0f00['body'][_0xd6dc('0x66')]:_0x36ef21[_0xd6dc('0x66')];switch(_0x36ef21[_0xd6dc('0x66')]){case _0xd6dc('0x67'):_0x46cd50=squel['insert']()['into'](_0xd6dc('0x68'))[_0xd6dc('0x69')]([_0xd6dc('0x6a'),_0xd6dc('0x6b'),_0xd6dc('0x6c'),_0xd6dc('0x6d'),_0xd6dc('0x5a'),'createdAt',_0xd6dc('0x56')],squel[_0xd6dc('0x6e')]()['field'](_0xd6dc('0x6a'),_0xd6dc('0x6a'))[_0xd6dc('0x6f')](_0xd6dc('0x70'),'scheduledAt')[_0xd6dc('0x6f')]('id','ContactId')[_0xd6dc('0x6f')](_0x11b1f2[_0xd6dc('0x71')][_0xd6dc('0x72')](),_0xd6dc('0x6d'))[_0xd6dc('0x6f')](_0x4e0f00['params']['id'][_0xd6dc('0x72')](),_0xd6dc('0x5a'))['field']('\x27'+_0x104c6f+'\x27',_0xd6dc('0x73'))[_0xd6dc('0x6f')]('\x27'+_0x104c6f+'\x27',_0xd6dc('0x56'))['from'](_0xd6dc('0x74'))[_0xd6dc('0x3f')]('deletedAt\x20IS\x20NULL')[_0xd6dc('0x3f')](_0xd6dc('0x75'),_0x11b1f2[_0xd6dc('0x71')][_0xd6dc('0x72')]())['where'](_0xd6dc('0x76'))[_0xd6dc('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xd6dc('0x77'))[_0xd6dc('0x78')](_0xd6dc('0x79'))[_0xd6dc('0x3f')](_0xd6dc('0x7a'),_0x4e0f00[_0xd6dc('0x46')]['id'][_0xd6dc('0x72')]()))['where'](_0xd6dc('0x7b'),squel[_0xd6dc('0x6e')]()[_0xd6dc('0x6f')](_0xd6dc('0x7c'))[_0xd6dc('0x78')]('cm_hopper')[_0xd6dc('0x3f')](_0xd6dc('0x7a'),_0x4e0f00['params']['id'][_0xd6dc('0x72')]())))[_0xd6dc('0x72')]();break;case _0xd6dc('0x7d'):_0x46cd50=squel['insert']()[_0xd6dc('0x7e')](_0xd6dc('0x68'))[_0xd6dc('0x69')]([_0xd6dc('0x6a'),_0xd6dc('0x6b'),_0xd6dc('0x6c'),'ListId',_0xd6dc('0x5a'),'createdAt',_0xd6dc('0x56')],squel[_0xd6dc('0x6e')]()[_0xd6dc('0x6f')](_0xd6dc('0x6a'),_0xd6dc('0x6a'))[_0xd6dc('0x6f')]('NOW()',_0xd6dc('0x6b'))[_0xd6dc('0x6f')]('id',_0xd6dc('0x6c'))[_0xd6dc('0x6f')](_0x11b1f2[_0xd6dc('0x71')][_0xd6dc('0x72')](),_0xd6dc('0x6d'))['field'](_0x4e0f00[_0xd6dc('0x46')]['id'][_0xd6dc('0x72')](),'CampaignId')[_0xd6dc('0x6f')]('\x27'+_0x104c6f+'\x27',_0xd6dc('0x73'))[_0xd6dc('0x6f')]('\x27'+_0x104c6f+'\x27',_0xd6dc('0x56'))[_0xd6dc('0x78')](_0xd6dc('0x74'))['where'](_0xd6dc('0x7f'))['where']('ListId\x20=\x20?',_0x11b1f2[_0xd6dc('0x71')][_0xd6dc('0x72')]())[_0xd6dc('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0xd6dc('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd6dc('0x6e')]()[_0xd6dc('0x6f')](_0xd6dc('0x7c'))[_0xd6dc('0x78')](_0xd6dc('0x68'))[_0xd6dc('0x3f')](_0xd6dc('0x7a'),_0x4e0f00['params']['id'][_0xd6dc('0x72')]())))['toString']();break;default:_0x46cd50=squel[_0xd6dc('0x80')]()['into'](_0xd6dc('0x68'))[_0xd6dc('0x69')](['phone',_0xd6dc('0x6b'),_0xd6dc('0x6c'),_0xd6dc('0x6d'),_0xd6dc('0x5a'),_0xd6dc('0x73'),_0xd6dc('0x56')],squel[_0xd6dc('0x6e')]()[_0xd6dc('0x6f')](_0xd6dc('0x6a'),_0xd6dc('0x6a'))[_0xd6dc('0x6f')](_0xd6dc('0x70'),_0xd6dc('0x6b'))[_0xd6dc('0x6f')]('id',_0xd6dc('0x6c'))[_0xd6dc('0x6f')](_0x11b1f2['CmListId'][_0xd6dc('0x72')](),_0xd6dc('0x6d'))['field'](_0x4e0f00['params']['id'][_0xd6dc('0x72')](),_0xd6dc('0x5a'))['field']('\x27'+_0x104c6f+'\x27','createdAt')[_0xd6dc('0x6f')]('\x27'+_0x104c6f+'\x27',_0xd6dc('0x56'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xd6dc('0x3f')](_0xd6dc('0x75'),_0x11b1f2['CmListId'][_0xd6dc('0x72')]())[_0xd6dc('0x3f')](_0xd6dc('0x76')))[_0xd6dc('0x72')]();}_0x3570b8=squel[_0xd6dc('0x80')]()[_0xd6dc('0x7e')](_0xd6dc('0x81'))['fromQuery']([_0xd6dc('0x82'),_0xd6dc('0x6b'),_0xd6dc('0x6a'),_0xd6dc('0x83'),_0xd6dc('0x73'),'updatedAt'],squel['select']()[_0xd6dc('0x6f')](_0xd6dc('0x84'),'id')['field']('NOW()','scheduledAt')[_0xd6dc('0x6f')](_0xd6dc('0x85'),'phone')[_0xd6dc('0x6f')](_0xd6dc('0x86'),_0xd6dc('0x83'))['field']('\x27'+_0x104c6f+'\x27',_0xd6dc('0x73'))[_0xd6dc('0x6f')]('\x27'+_0x104c6f+'\x27',_0xd6dc('0x56'))[_0xd6dc('0x78')](_0xd6dc('0x87'),'ci')[_0xd6dc('0x88')](_0xd6dc('0x68'),'h',_0xd6dc('0x89'))[_0xd6dc('0x3f')]('h.ListId\x20=\x20?',_0x11b1f2[_0xd6dc('0x71')][_0xd6dc('0x72')]())['where'](_0xd6dc('0x8a'),_0x4e0f00['params']['id'][_0xd6dc('0x72')]())['where'](_0xd6dc('0x8b'),_0x104c6f))[_0xd6dc('0x72')]();_0x2ee539['push'](db[_0xd6dc('0x8c')][_0xd6dc('0x32')](_0x46cd50));_0x1a875e['push'](db[_0xd6dc('0x8c')][_0xd6dc('0x32')](_0x3570b8));}return BPromise[_0xd6dc('0x8d')](_0x2ee539);}})[_0xd6dc('0x25')](function(){return BPromise[_0xd6dc('0x8d')](_0x1a875e);})[_0xd6dc('0x25')](function(){return _0x3d157d;})[_0xd6dc('0x25')](respondWithResult(_0x1a10f8,null))['catch'](handleError(_0x1a10f8,null));};exports[_0xd6dc('0x8e')]=function(_0x289a62,_0x54f4fb,_0x10f99d){return db[_0xd6dc('0x2d')][_0xd6dc('0x4f')]({'where':{'id':_0x289a62[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x54f4fb,null))[_0xd6dc('0x25')](function(_0x1e0eb5){if(_0x1e0eb5){return _0x1e0eb5[_0xd6dc('0x8e')](_0x289a62[_0xd6dc('0x32')][_0xd6dc('0x64')]);}})[_0xd6dc('0x25')](function(_0x31b36c){if(_0x31b36c){return db[_0xd6dc('0x59')][_0xd6dc('0x26')]({'where':{'ListId':_0x289a62[_0xd6dc('0x32')]['ids'],'CampaignId':_0x289a62[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](function(){return _0x31b36c;});}})['then'](respondWithStatusCode(_0x54f4fb,null))[_0xd6dc('0x47')](handleError(_0x54f4fb,null));};exports['getBlackLists']=function(_0x18aaaa,_0x11c218,_0xa867e3){var _0x2e86f4={};var _0x3216d5={};var _0x3119d3;var _0x194376;return db['Campaign'][_0xd6dc('0x58')]({'where':{'id':_0x18aaaa[_0xd6dc('0x46')]['id']}})['then'](handleEntityNotFound(_0x11c218,null))[_0xd6dc('0x25')](function(_0x31c252){if(_0x31c252){_0x3119d3=_0x31c252;_0x3216d5['model']=_[_0xd6dc('0x33')](db[_0xd6dc('0x8f')][_0xd6dc('0x2e')]);_0x3216d5[_0xd6dc('0x32')]=_[_0xd6dc('0x33')](_0x18aaaa[_0xd6dc('0x32')]);_0x3216d5['filters']=_[_0xd6dc('0x35')](_0x3216d5[_0xd6dc('0x31')],_0x3216d5[_0xd6dc('0x32')]);_0x2e86f4[_0xd6dc('0x37')]=_[_0xd6dc('0x35')](_0x3216d5[_0xd6dc('0x31')],qs['fields'](_0x18aaaa['query']['fields']));_0x2e86f4[_0xd6dc('0x37')]=_0x2e86f4['attributes'][_0xd6dc('0x38')]?_0x2e86f4[_0xd6dc('0x37')]:_0x3216d5[_0xd6dc('0x31')];_0x2e86f4[_0xd6dc('0x3b')]=qs[_0xd6dc('0x3c')](_0x18aaaa['query']['sort']);_0x2e86f4[_0xd6dc('0x3f')]=qs['filters'](_[_0xd6dc('0x3d')](_0x18aaaa[_0xd6dc('0x32')],_0x3216d5['filters']));if(_0x18aaaa['query'][_0xd6dc('0x3e')]){_0x2e86f4[_0xd6dc('0x3f')]=_[_0xd6dc('0x40')](_0x2e86f4['where'],{'$or':_[_0xd6dc('0x2c')](_0x2e86f4['attributes'],function(_0x34847a){var _0x4b2cb8={};_0x4b2cb8[_0x34847a]={'$like':'%'+_0x18aaaa[_0xd6dc('0x32')][_0xd6dc('0x3e')]+'%'};return _0x4b2cb8;})});}_0x2e86f4=_[_0xd6dc('0x40')]({},_0x2e86f4,_0x18aaaa['options']);return _0x3119d3[_0xd6dc('0x90')](_0x2e86f4);}})[_0xd6dc('0x25')](function(_0x1c774b){if(_0x1c774b){_0x194376=_0x1c774b[_0xd6dc('0x38')];if(!_0x18aaaa[_0xd6dc('0x32')][_0xd6dc('0x39')](_0xd6dc('0x3a'))){_0x2e86f4[_0xd6dc('0x1e')]=qs[_0xd6dc('0x1e')](_0x18aaaa[_0xd6dc('0x32')]['limit']);_0x2e86f4[_0xd6dc('0x1c')]=qs[_0xd6dc('0x1c')](_0x18aaaa[_0xd6dc('0x32')][_0xd6dc('0x1c')]);}return _0x3119d3[_0xd6dc('0x90')](_0x2e86f4);}})[_0xd6dc('0x25')](function(_0x5bc4e4){if(_0x5bc4e4){return _0x5bc4e4?{'count':_0x194376,'rows':_0x5bc4e4}:null;}})[_0xd6dc('0x25')](respondWithResult(_0x11c218,null))['catch'](handleError(_0x11c218,null));};exports[_0xd6dc('0x91')]=function(_0x4dd657,_0x18a345,_0x1b0846){var _0x55eb2b,_0x583b8b;var _0x56cd78=[];var _0x3a4b15=moment()['format'](_0xd6dc('0x63'));return db[_0xd6dc('0x2d')][_0xd6dc('0x4f')]({'where':{'id':_0x4dd657[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x18a345,null))[_0xd6dc('0x25')](function(_0x3d2691){if(_0x3d2691){_0x583b8b=_0x3d2691;return _0x3d2691[_0xd6dc('0x91')](_0x4dd657['body'][_0xd6dc('0x64')],_[_0xd6dc('0x55')](_0x4dd657[_0xd6dc('0x49')],['ids','id'])||{});}return null;})[_0xd6dc('0x65')](function(_0x2f6262){var _0x173854;var _0x55ccb7;_0x55eb2b=_0x2f6262||[];var _0x16f269=[];if(_0x2f6262){for(var _0x2b2863=0x0;_0x2b2863<_0x2f6262[_0xd6dc('0x38')];_0x2b2863+=0x1){var _0x430360=_0x2f6262[_0x2b2863][_0xd6dc('0x27')]({'plain':!![]});_0x173854=squel['insert']()[_0xd6dc('0x7e')]('cm_hopper_black')[_0xd6dc('0x69')]([_0xd6dc('0x6a'),'ContactId',_0xd6dc('0x6d'),_0xd6dc('0x5a'),_0xd6dc('0x73'),'updatedAt'],squel['select']()[_0xd6dc('0x6f')](_0xd6dc('0x6a'),'phone')[_0xd6dc('0x6f')]('id',_0xd6dc('0x6c'))[_0xd6dc('0x6f')](_0x430360[_0xd6dc('0x71')][_0xd6dc('0x72')](),_0xd6dc('0x6d'))['field'](_0x4dd657[_0xd6dc('0x46')]['id'][_0xd6dc('0x72')](),_0xd6dc('0x5a'))['field'](_0xd6dc('0x70'),_0xd6dc('0x73'))['field'](_0xd6dc('0x70'),_0xd6dc('0x56'))['from'](_0xd6dc('0x74'))[_0xd6dc('0x3f')](_0xd6dc('0x7f'))['where']('ListId\x20=\x20?',_0x430360[_0xd6dc('0x71')][_0xd6dc('0x72')]())[_0xd6dc('0x3f')](_0xd6dc('0x76')))[_0xd6dc('0x72')]();_0x16f269[_0xd6dc('0x92')](db[_0xd6dc('0x8c')][_0xd6dc('0x32')](_0x173854));}return BPromise[_0xd6dc('0x8d')](_0x16f269);}})[_0xd6dc('0x25')](function(){return _0x55eb2b;})[_0xd6dc('0x25')](respondWithResult(_0x18a345,null))[_0xd6dc('0x47')](handleError(_0x18a345,null));};exports[_0xd6dc('0x93')]=function(_0x3083a7,_0x266e31,_0x47899c){return db[_0xd6dc('0x2d')]['find']({'where':{'id':_0x3083a7[_0xd6dc('0x46')]['id']}})[_0xd6dc('0x25')](handleEntityNotFound(_0x266e31,null))['then'](function(_0x52c61e){if(_0x52c61e){return _0x52c61e[_0xd6dc('0x93')](_0x3083a7['query'][_0xd6dc('0x64')]);}})[_0xd6dc('0x25')](function(_0x4abfc4){if(_0x4abfc4){return db[_0xd6dc('0x5f')][_0xd6dc('0x26')]({'where':{'ListId':_0x3083a7[_0xd6dc('0x32')][_0xd6dc('0x64')],'CampaignId':_0x3083a7[_0xd6dc('0x46')]['id']}})['then'](function(){return _0x4abfc4;});}})[_0xd6dc('0x25')](respondWithStatusCode(_0x266e31,null))['catch'](handleError(_0x266e31,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 81b6698..61dc880 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4025fd,_0x392379){var _0x58fb64=function(_0x39369f){while(--_0x39369f){_0x4025fd['push'](_0x4025fd['shift']());}};_0x58fb64(++_0x392379);}(_0x7a54,0x106));var _0x47a5=function(_0x27b859,_0x2c34fc){_0x27b859=_0x27b859-0x0;var _0x1f0153=_0x7a54[_0x27b859];return _0x1f0153;};'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 0e7f32b..f9d48e2 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 _0xfdb5=['model','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','include','map'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xfdb5[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x5fdb('0x0'));var util=require(_0x5fdb('0x1'));var moment=require(_0x5fdb('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fdb('0x3'));var fs=require('fs');var Redis=require(_0x5fdb('0x4'));var db=require(_0x5fdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5fdb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fdb('0x7'));var client=jayson['client'][_0x5fdb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xda053e,_0x4b6fe0,_0x542bbc){return new BPromise(function(_0x5a556e,_0x340588){return client[_0x5fdb('0x9')](_0xda053e,_0x542bbc)[_0x5fdb('0xa')](function(_0x25cef8){logger[_0x5fdb('0xb')](_0x5fdb('0xc'),_0x4b6fe0,_0x5fdb('0xd'));logger['debug'](_0x5fdb('0xe'),_0x4b6fe0,'request\x20sent',JSON[_0x5fdb('0xf')](_0x25cef8));if(_0x25cef8[_0x5fdb('0x10')]){if(_0x25cef8[_0x5fdb('0x10')]['code']===0x1f4){logger[_0x5fdb('0x10')]('Campaign,\x20%s,\x20%s',_0x4b6fe0,_0x25cef8[_0x5fdb('0x10')][_0x5fdb('0x11')]);return _0x340588(_0x25cef8['error'][_0x5fdb('0x11')]);}logger[_0x5fdb('0x10')](_0x5fdb('0xc'),_0x4b6fe0,_0x25cef8['error'][_0x5fdb('0x11')]);return _0x5a556e(_0x25cef8[_0x5fdb('0x10')][_0x5fdb('0x11')]);}else{logger[_0x5fdb('0xb')](_0x5fdb('0xc'),_0x4b6fe0,_0x5fdb('0xd'));_0x5a556e(_0x25cef8['result']['message']);}})[_0x5fdb('0x12')](function(_0x5f1ddc){logger[_0x5fdb('0x10')](_0x5fdb('0xc'),_0x4b6fe0,_0x5f1ddc);_0x340588(_0x5f1ddc);});});}exports[_0x5fdb('0x13')]=function(_0x47a10f){var _0x15fa3e=this;return new Promise(function(_0xb8c99f,_0xf27e5d){return db[_0x5fdb('0x14')][_0x5fdb('0x15')]({'raw':_0x47a10f[_0x5fdb('0x16')]?_0x47a10f['options'][_0x5fdb('0x17')]===undefined?!![]:![]:!![],'where':_0x47a10f['options']?_0x47a10f['options'][_0x5fdb('0x18')]||null:null,'attributes':_0x47a10f[_0x5fdb('0x16')]?_0x47a10f[_0x5fdb('0x16')]['attributes']||null:null,'limit':_0x47a10f[_0x5fdb('0x16')]?_0x47a10f[_0x5fdb('0x16')]['limit']||null:null,'include':_0x47a10f[_0x5fdb('0x16')]?_0x47a10f[_0x5fdb('0x16')]['include']?_['map'](_0x47a10f['options']['include'],function(_0x15d2ec){return{'model':db[_0x15d2ec['model']],'as':_0x15d2ec['as'],'attributes':_0x15d2ec['attributes'],'include':_0x15d2ec[_0x5fdb('0x19')]?_[_0x5fdb('0x1a')](_0x15d2ec[_0x5fdb('0x19')],function(_0x49e795){return{'model':db[_0x49e795[_0x5fdb('0x1b')]],'as':_0x49e795['as'],'attributes':_0x49e795[_0x5fdb('0x1c')],'include':_0x49e795[_0x5fdb('0x19')]?_[_0x5fdb('0x1a')](_0x49e795['include'],function(_0x200eaf){return{'model':db[_0x200eaf['model']],'as':_0x200eaf['as'],'attributes':_0x200eaf[_0x5fdb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5fdb('0xa')](function(_0x488843){logger[_0x5fdb('0xb')]('GetCampaign',_0x47a10f);logger[_0x5fdb('0x1d')](_0x5fdb('0x13'),_0x47a10f,JSON['stringify'](_0x488843));_0xb8c99f(_0x488843);})['catch'](function(_0xa5c0e2){logger[_0x5fdb('0x10')](_0x5fdb('0x13'),_0xa5c0e2[_0x5fdb('0x11')],_0x47a10f);_0xf27e5d(_0x15fa3e[_0x5fdb('0x10')](0x1f4,_0xa5c0e2['message']));});});}; \ No newline at end of file +var _0x1120=['model','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','options','raw','attributes','include','map'];(function(_0x4bf0b5,_0xba25b7){var _0x51c87c=function(_0x3d8384){while(--_0x3d8384){_0x4bf0b5['push'](_0x4bf0b5['shift']());}};_0x51c87c(++_0xba25b7);}(_0x1120,0x140));var _0x0112=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1120[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x0112('0x0'));var util=require(_0x0112('0x1'));var moment=require(_0x0112('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(_0x0112('0x3'));var logger=require(_0x0112('0x4'))(_0x0112('0x5'));var config=require(_0x0112('0x6'));var jayson=require(_0x0112('0x7'));var client=jayson[_0x0112('0x8')][_0x0112('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40ad0d,_0x31d67a,_0x444422){return new BPromise(function(_0x2fd18c,_0x1e87af){return client['request'](_0x40ad0d,_0x444422)[_0x0112('0xa')](function(_0x26fd2e){logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));logger[_0x0112('0xe')](_0x0112('0xf'),_0x31d67a,'request\x20sent',JSON[_0x0112('0x10')](_0x26fd2e));if(_0x26fd2e[_0x0112('0x11')]){if(_0x26fd2e[_0x0112('0x11')][_0x0112('0x12')]===0x1f4){logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e[_0x0112('0x11')][_0x0112('0x13')]);return _0x1e87af(_0x26fd2e[_0x0112('0x11')]['message']);}logger['error'](_0x0112('0xc'),_0x31d67a,_0x26fd2e['error'][_0x0112('0x13')]);return _0x2fd18c(_0x26fd2e['error'][_0x0112('0x13')]);}else{logger[_0x0112('0xb')](_0x0112('0xc'),_0x31d67a,_0x0112('0xd'));_0x2fd18c(_0x26fd2e['result'][_0x0112('0x13')]);}})[_0x0112('0x14')](function(_0x5ef9fe){logger['error']('Campaign,\x20%s,\x20%s',_0x31d67a,_0x5ef9fe);_0x1e87af(_0x5ef9fe);});});}exports[_0x0112('0x15')]=function(_0x58f0ed){var _0x5c2236=this;return new Promise(function(_0x4e34c1,_0x19f10e){return db[_0x0112('0x16')]['findAll']({'raw':_0x58f0ed['options']?_0x58f0ed[_0x0112('0x17')][_0x0112('0x18')]===undefined?!![]:![]:!![],'where':_0x58f0ed['options']?_0x58f0ed[_0x0112('0x17')]['where']||null:null,'attributes':_0x58f0ed['options']?_0x58f0ed['options'][_0x0112('0x19')]||null:null,'limit':_0x58f0ed[_0x0112('0x17')]?_0x58f0ed[_0x0112('0x17')]['limit']||null:null,'include':_0x58f0ed[_0x0112('0x17')]?_0x58f0ed[_0x0112('0x17')][_0x0112('0x1a')]?_[_0x0112('0x1b')](_0x58f0ed['options'][_0x0112('0x1a')],function(_0x408bb8){return{'model':db[_0x408bb8[_0x0112('0x1c')]],'as':_0x408bb8['as'],'attributes':_0x408bb8[_0x0112('0x19')],'include':_0x408bb8['include']?_[_0x0112('0x1b')](_0x408bb8['include'],function(_0x58ea13){return{'model':db[_0x58ea13[_0x0112('0x1c')]],'as':_0x58ea13['as'],'attributes':_0x58ea13['attributes'],'include':_0x58ea13[_0x0112('0x1a')]?_['map'](_0x58ea13[_0x0112('0x1a')],function(_0x58e5){return{'model':db[_0x58e5[_0x0112('0x1c')]],'as':_0x58e5['as'],'attributes':_0x58e5[_0x0112('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0112('0xa')](function(_0x11bd7f){logger[_0x0112('0xb')](_0x0112('0x15'),_0x58f0ed);logger[_0x0112('0xe')](_0x0112('0x15'),_0x58f0ed,JSON[_0x0112('0x10')](_0x11bd7f));_0x4e34c1(_0x11bd7f);})['catch'](function(_0x6d44bb){logger['error'](_0x0112('0x15'),_0x6d44bb[_0x0112('0x13')],_0x58f0ed);_0x19f10e(_0x5c2236[_0x0112('0x11')](0x1f4,_0x6d44bb['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ca75948..4ecec51 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 _0x7ea8=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','update','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories'];(function(_0x8d65d2,_0x17511d){var _0x109850=function(_0x2a1d84){while(--_0x2a1d84){_0x8d65d2['push'](_0x8d65d2['shift']());}};_0x109850(++_0x17511d);}(_0x7ea8,0x1d1));var _0x87ea=function(_0x3edfa0,_0x5c56b0){_0x3edfa0=_0x3edfa0-0x0;var _0x161427=_0x7ea8[_0x3edfa0];return _0x161427;};'use strict';var multer=require(_0x87ea('0x0'));var util=require(_0x87ea('0x1'));var path=require(_0x87ea('0x2'));var timeout=require(_0x87ea('0x3'));var express=require(_0x87ea('0x4'));var router=express['Router']();var fs_extra=require(_0x87ea('0x5'));var auth=require(_0x87ea('0x6'));var interaction=require(_0x87ea('0x7'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x87ea('0x8')]('/',auth[_0x87ea('0x9')](),controller[_0x87ea('0xa')]);router[_0x87ea('0x8')](_0x87ea('0xb'),auth[_0x87ea('0x9')](),controller[_0x87ea('0xc')]);router[_0x87ea('0x8')]('/:id/hoppers',auth[_0x87ea('0x9')](),controller[_0x87ea('0xd')]);router[_0x87ea('0x8')](_0x87ea('0xe'),auth[_0x87ea('0x9')](),controller['getHopperHistories']);router[_0x87ea('0x8')]('/:id/hopper_finals',auth[_0x87ea('0x9')](),controller[_0x87ea('0xf')]);router[_0x87ea('0x8')](_0x87ea('0x10'),auth['isAuthenticated'](),controller[_0x87ea('0x11')]);router['get'](_0x87ea('0x12'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x13')]);router[_0x87ea('0x8')](_0x87ea('0x14'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x15')]);router[_0x87ea('0x16')]('/',auth['isAuthenticated'](),controller[_0x87ea('0x17')]);router[_0x87ea('0x16')]('/:id/clone',auth[_0x87ea('0x9')](),controller[_0x87ea('0x18')]);router['post'](_0x87ea('0x12'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x19')]);router[_0x87ea('0x16')](_0x87ea('0x14'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x1a')]);router['put'](_0x87ea('0xb'),auth['isAuthenticated'](),controller[_0x87ea('0x1b')]);router[_0x87ea('0x1c')](_0x87ea('0xb'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x1d')]);router['delete'](_0x87ea('0x12'),auth[_0x87ea('0x9')](),controller['removeLists']);router[_0x87ea('0x1c')](_0x87ea('0x14'),auth[_0x87ea('0x9')](),controller[_0x87ea('0x1e')]);module[_0x87ea('0x1f')]=router; \ No newline at end of file +var _0x73ef=['isAuthenticated','index','get','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','/:id/blacklists','post','create','/:id/clone','addBlackLists','put','delete','removeLists','removeBlackLists','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller'];(function(_0xee4f0d,_0x2d7af7){var _0x39d9d5=function(_0x4e9bd5){while(--_0x4e9bd5){_0xee4f0d['push'](_0xee4f0d['shift']());}};_0x39d9d5(++_0x2d7af7);}(_0x73ef,0x1b7));var _0xf73e=function(_0x1332c9,_0x3fab67){_0x1332c9=_0x1332c9-0x0;var _0xf3a17d=_0x73ef[_0x1332c9];return _0xf3a17d;};'use strict';var multer=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var path=require(_0xf73e('0x2'));var timeout=require(_0xf73e('0x3'));var express=require('express');var router=express[_0xf73e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf73e('0x5'));var interaction=require(_0xf73e('0x6'));var config=require(_0xf73e('0x7'));var controller=require(_0xf73e('0x8'));router['get']('/',auth[_0xf73e('0x9')](),controller[_0xf73e('0xa')]);router[_0xf73e('0xb')](_0xf73e('0xc'),auth['isAuthenticated'](),controller[_0xf73e('0xd')]);router[_0xf73e('0xb')]('/:id/hoppers',auth[_0xf73e('0x9')](),controller[_0xf73e('0xe')]);router[_0xf73e('0xb')](_0xf73e('0xf'),auth[_0xf73e('0x9')](),controller[_0xf73e('0x10')]);router[_0xf73e('0xb')](_0xf73e('0x11'),auth[_0xf73e('0x9')](),controller['getHopperFinals']);router[_0xf73e('0xb')]('/:id/hopper_black',auth[_0xf73e('0x9')](),controller['getHopperBlacks']);router[_0xf73e('0xb')](_0xf73e('0x12'),auth[_0xf73e('0x9')](),controller['getLists']);router[_0xf73e('0xb')](_0xf73e('0x13'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xf73e('0x14')]('/',auth[_0xf73e('0x9')](),controller[_0xf73e('0x15')]);router[_0xf73e('0x14')](_0xf73e('0x16'),auth[_0xf73e('0x9')](),controller['clone']);router['post'](_0xf73e('0x12'),auth[_0xf73e('0x9')](),controller['addLists']);router[_0xf73e('0x14')](_0xf73e('0x13'),auth[_0xf73e('0x9')](),controller[_0xf73e('0x17')]);router[_0xf73e('0x18')](_0xf73e('0xc'),auth[_0xf73e('0x9')](),controller['update']);router['delete']('/:id',auth[_0xf73e('0x9')](),controller['destroy']);router[_0xf73e('0x19')](_0xf73e('0x12'),auth['isAuthenticated'](),controller[_0xf73e('0x1a')]);router[_0xf73e('0x19')](_0xf73e('0x13'),auth[_0xf73e('0x9')](),controller[_0xf73e('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 1a1d53c..8f9f3b9 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 _0x13bf=['key','sequelize','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x39503d,_0x234d7f){var _0x418a75=function(_0x5bcd19){while(--_0x5bcd19){_0x39503d['push'](_0x39503d['shift']());}};_0x418a75(++_0x234d7f);}(_0x13bf,0xd9));var _0xf13b=function(_0xf065da,_0x2b8b75){_0xf065da=_0xf065da-0x0;var _0x1cb515=_0x13bf[_0xf065da];return _0x1cb515;};'use strict';var Sequelize=require(_0xf13b('0x0'));module['exports']={'key':{'type':Sequelize[_0xf13b('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xf13b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf13b('0x1')]},'name':{'type':Sequelize[_0xf13b('0x3')],'get':function(){return this[_0xf13b('0x4')](_0xf13b('0x5'));}}}; \ No newline at end of file +var _0x310b=['VIRTUAL','getDataValue','TEXT','STRING'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x310b,0x152));var _0xb310=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x310b[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb310('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb310('0x1')]},'name':{'type':Sequelize[_0xb310('0x2')],'get':function(){return this[_0xb310('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 70942ce..3562651 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 _0xdd48=['then','error','stack','name','send','CannedAnswer','fieldName','key','map','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','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','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','reject','save','update','destroy','get','CannedAnswers'];(function(_0x3f825c,_0x6e92e4){var _0x5cd0cf=function(_0x98fac6){while(--_0x98fac6){_0x3f825c['push'](_0x3f825c['shift']());}};_0x5cd0cf(++_0x6e92e4);}(_0xdd48,0xd9));var _0x8dd4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdd48[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x8dd4('0x0'));var rimraf=require(_0x8dd4('0x1'));var zipdir=require(_0x8dd4('0x2'));var jsonpatch=require(_0x8dd4('0x3'));var rp=require('request-promise');var moment=require(_0x8dd4('0x4'));var BPromise=require(_0x8dd4('0x5'));var Mustache=require(_0x8dd4('0x6'));var util=require(_0x8dd4('0x7'));var path=require(_0x8dd4('0x8'));var sox=require(_0x8dd4('0x9'));var csv=require(_0x8dd4('0xa'));var ejs=require(_0x8dd4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8dd4('0xc'));var squel=require(_0x8dd4('0xd'));var crypto=require(_0x8dd4('0xe'));var jsforce=require(_0x8dd4('0xf'));var deskjs=require(_0x8dd4('0x10'));var toCsv=require(_0x8dd4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8dd4('0x11'));var authService=require(_0x8dd4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8dd4('0x13'));var hardwareService=require(_0x8dd4('0x14'));var logger=require(_0x8dd4('0x15'))(_0x8dd4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8dd4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59d0dd,_0x46cde9){_0x46cde9=_0x46cde9||0xcc;return function(_0x3d9ea4){if(_0x3d9ea4){return _0x59d0dd[_0x8dd4('0x18')](_0x46cde9);}return _0x59d0dd[_0x8dd4('0x19')](_0x46cde9)[_0x8dd4('0x1a')]();};}function respondWithResult(_0x426e8a,_0x8ce728){_0x8ce728=_0x8ce728||0xc8;return function(_0x2d3ce2){if(_0x2d3ce2){return _0x426e8a[_0x8dd4('0x19')](_0x8ce728)['json'](_0x2d3ce2);}};}function respondWithFilteredResult(_0x2d0cba,_0x2a5525){return function(_0x4e218f){if(_0x4e218f){var _0x5bcb14=typeof _0x2a5525[_0x8dd4('0x1b')]===_0x8dd4('0x1c')&&typeof _0x2a5525['limit']===_0x8dd4('0x1c');var _0x10c7e4=_0x4e218f[_0x8dd4('0x1d')];var _0x4689e6=_0x5bcb14?0x0:_0x2a5525[_0x8dd4('0x1b')];var _0x9d9142=_0x5bcb14?_0x4e218f['count']:_0x2a5525[_0x8dd4('0x1b')]+_0x2a5525[_0x8dd4('0x1e')];var _0x3f4d7e;if(_0x9d9142>=_0x10c7e4){_0x9d9142=_0x10c7e4;_0x3f4d7e=0xc8;}else{_0x3f4d7e=0xce;}_0x2d0cba['status'](_0x3f4d7e);return _0x2d0cba[_0x8dd4('0x1f')]('Content-Range',_0x4689e6+'-'+_0x9d9142+'/'+_0x10c7e4)['json'](_0x4e218f);}return null;};}function patchUpdates(_0x28a6f3){return function(_0x31fdda){try{jsonpatch['apply'](_0x31fdda,_0x28a6f3,!![]);}catch(_0x4d35b5){return BPromise[_0x8dd4('0x20')](_0x4d35b5);}return _0x31fdda[_0x8dd4('0x21')]();};}function saveUpdates(_0x4eaad8,_0x5ef613){return function(_0x37c919){if(_0x37c919){return _0x37c919[_0x8dd4('0x22')](_0x4eaad8)['then'](function(_0x530db3){return _0x530db3;});}return null;};}function removeEntity(_0x4b3c0a,_0x19cc37){return function(_0x4be65c){if(_0x4be65c){return _0x4be65c[_0x8dd4('0x23')]()['then'](function(){var _0x47b90a=_0x4be65c[_0x8dd4('0x24')]({'plain':!![]});var _0x542ab5=_0x8dd4('0x25');return db['UserProfileResource'][_0x8dd4('0x23')]({'where':{'type':_0x542ab5,'resourceId':_0x47b90a['id']}})[_0x8dd4('0x26')](function(){return _0x4be65c;});})[_0x8dd4('0x26')](function(){_0x4b3c0a[_0x8dd4('0x19')](0xcc)[_0x8dd4('0x1a')]();});}};}function handleEntityNotFound(_0x5df441,_0x4a187a){return function(_0x36c3ac){if(!_0x36c3ac){_0x5df441[_0x8dd4('0x18')](0x194);}return _0x36c3ac;};}function handleError(_0x19331f,_0x2818b2){_0x2818b2=_0x2818b2||0x1f4;return function(_0x4883a9){logger[_0x8dd4('0x27')](_0x4883a9[_0x8dd4('0x28')]);if(_0x4883a9[_0x8dd4('0x29')]){delete _0x4883a9[_0x8dd4('0x29')];}_0x19331f['status'](_0x2818b2)[_0x8dd4('0x2a')](_0x4883a9);};}exports['index']=function(_0x156303,_0xbd18a6){var _0x533a63={},_0x36c500={},_0x12a4a0={'count':0x0,'rows':[]};var _0x3b26c0=_['map'](db[_0x8dd4('0x2b')]['rawAttributes'],function(_0x341c61){return{'name':_0x341c61[_0x8dd4('0x2c')],'type':_0x341c61['type'][_0x8dd4('0x2d')]};});_0x36c500['model']=_[_0x8dd4('0x2e')](_0x3b26c0,_0x8dd4('0x29'));_0x36c500[_0x8dd4('0x2f')]=_['keys'](_0x156303['query']);_0x36c500[_0x8dd4('0x30')]=_['intersection'](_0x36c500['model'],_0x36c500[_0x8dd4('0x2f')]);_0x533a63[_0x8dd4('0x31')]=_[_0x8dd4('0x32')](_0x36c500['model'],qs[_0x8dd4('0x33')](_0x156303['query']['fields']));_0x533a63[_0x8dd4('0x31')]=_0x533a63[_0x8dd4('0x31')][_0x8dd4('0x34')]?_0x533a63[_0x8dd4('0x31')]:_0x36c500[_0x8dd4('0x35')];if(!_0x156303['query'][_0x8dd4('0x36')](_0x8dd4('0x37'))){_0x533a63[_0x8dd4('0x1e')]=qs[_0x8dd4('0x1e')](_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x1e')]);_0x533a63['offset']=qs[_0x8dd4('0x1b')](_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x1b')]);}_0x533a63['order']=qs[_0x8dd4('0x38')](_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x38')]);_0x533a63[_0x8dd4('0x39')]=qs[_0x8dd4('0x30')](_[_0x8dd4('0x3a')](_0x156303['query'],_0x36c500[_0x8dd4('0x30')]),_0x3b26c0);if(_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x3b')]){_0x533a63[_0x8dd4('0x39')]=_[_0x8dd4('0x3c')](_0x533a63[_0x8dd4('0x39')],{'$or':[{'key':{'$like':'%'+_0x156303[_0x8dd4('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x3b')]+'%'}}]});}_0x533a63=_[_0x8dd4('0x3c')]({},_0x533a63,_0x156303['options']);var _0x39f32c={'where':_0x533a63['where']};return db['CannedAnswer'][_0x8dd4('0x1d')](_0x39f32c)['then'](function(_0x316f25){_0x12a4a0[_0x8dd4('0x1d')]=_0x316f25;if(_0x156303[_0x8dd4('0x2f')][_0x8dd4('0x3d')]){_0x533a63[_0x8dd4('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x8dd4('0x3f')](_0x533a63);})[_0x8dd4('0x26')](function(_0x39837f){_0x12a4a0[_0x8dd4('0x40')]=_0x39837f;return _0x12a4a0;})['then'](respondWithFilteredResult(_0xbd18a6,_0x533a63))[_0x8dd4('0x41')](handleError(_0xbd18a6,null));};exports[_0x8dd4('0x42')]=function(_0x44a314,_0x459f0c){var _0x2cf9ef={'raw':!![],'where':{'id':_0x44a314['params']['id']}},_0x5a5331={};_0x5a5331[_0x8dd4('0x35')]=_['keys'](db[_0x8dd4('0x2b')][_0x8dd4('0x43')]);_0x5a5331[_0x8dd4('0x2f')]=_[_0x8dd4('0x44')](_0x44a314[_0x8dd4('0x2f')]);_0x5a5331[_0x8dd4('0x30')]=_['intersection'](_0x5a5331[_0x8dd4('0x35')],_0x5a5331['query']);_0x2cf9ef['attributes']=_[_0x8dd4('0x32')](_0x5a5331[_0x8dd4('0x35')],qs[_0x8dd4('0x33')](_0x44a314['query'][_0x8dd4('0x33')]));_0x2cf9ef['attributes']=_0x2cf9ef[_0x8dd4('0x31')]['length']?_0x2cf9ef[_0x8dd4('0x31')]:_0x5a5331['model'];if(_0x44a314[_0x8dd4('0x2f')][_0x8dd4('0x3d')]){_0x2cf9ef[_0x8dd4('0x3e')]=[{'all':!![]}];}_0x2cf9ef=_['merge']({},_0x2cf9ef,_0x44a314['options']);return db[_0x8dd4('0x2b')][_0x8dd4('0x45')](_0x2cf9ef)[_0x8dd4('0x26')](handleEntityNotFound(_0x459f0c,null))['then'](respondWithResult(_0x459f0c,null))[_0x8dd4('0x41')](handleError(_0x459f0c,null));};exports[_0x8dd4('0x22')]=function(_0x4a0321,_0xe05a0c){if(_0x4a0321[_0x8dd4('0x46')]['id']){delete _0x4a0321[_0x8dd4('0x46')]['id'];}return db[_0x8dd4('0x2b')][_0x8dd4('0x45')]({'where':{'id':_0x4a0321['params']['id']}})[_0x8dd4('0x26')](handleEntityNotFound(_0xe05a0c,null))[_0x8dd4('0x26')](saveUpdates(_0x4a0321[_0x8dd4('0x46')],null))['then'](respondWithResult(_0xe05a0c,null))['catch'](handleError(_0xe05a0c,null));};exports[_0x8dd4('0x23')]=function(_0x5c8fb6,_0x3dba63){return db[_0x8dd4('0x2b')][_0x8dd4('0x45')]({'where':{'id':_0x5c8fb6['params']['id']}})[_0x8dd4('0x26')](handleEntityNotFound(_0x3dba63,null))[_0x8dd4('0x26')](removeEntity(_0x3dba63,null))[_0x8dd4('0x41')](handleError(_0x3dba63,null));};exports[_0x8dd4('0x47')]=function(_0x55d366,_0x54c34e){var _0x37feca={'key':_0x55d366[_0x8dd4('0x46')][_0x8dd4('0x2d')]};if(_0x55d366['body']['MailAccountId']){_0x37feca['MailAccountId']=_0x55d366[_0x8dd4('0x46')][_0x8dd4('0x48')];}else if(_0x55d366['body']['SmsAccountId']){_0x37feca[_0x8dd4('0x49')]=_0x55d366['body'][_0x8dd4('0x49')];}else if(_0x55d366[_0x8dd4('0x46')]['OpenchannelAccountId']){_0x37feca[_0x8dd4('0x4a')]=_0x55d366[_0x8dd4('0x46')][_0x8dd4('0x4a')];}else if(_0x55d366['body'][_0x8dd4('0x4b')]){_0x37feca[_0x8dd4('0x4b')]=_0x55d366['body'][_0x8dd4('0x4b')];}return db[_0x8dd4('0x2b')][_0x8dd4('0x45')]({'where':_0x37feca})[_0x8dd4('0x26')](function(_0x15195b){if(_0x15195b){throw new db['Sequelize'][(_0x8dd4('0x4c'))](_0x8dd4('0x4d'));}return db[_0x8dd4('0x2b')][_0x8dd4('0x47')](_0x55d366[_0x8dd4('0x46')]);})[_0x8dd4('0x26')](function(_0x53bdef){var _0xd8ab09=_0x55d366[_0x8dd4('0x4e')][_0x8dd4('0x24')]({'plain':!![]});if(!_0xd8ab09)throw new Error(_0x8dd4('0x4f'));if(_0xd8ab09[_0x8dd4('0x50')]==='user'){var _0x49664c=_0x53bdef[_0x8dd4('0x24')]({'plain':!![]});return db[_0x8dd4('0x51')][_0x8dd4('0x45')]({'where':{'name':_0x8dd4('0x25'),'userProfileId':_0xd8ab09[_0x8dd4('0x52')]},'raw':!![]})[_0x8dd4('0x26')](function(_0xe76cd0){if(_0xe76cd0&&_0xe76cd0[_0x8dd4('0x53')]===0x0){return db['UserProfileResource'][_0x8dd4('0x47')]({'name':_0x49664c['name'],'resourceId':_0x49664c['id'],'type':_0xe76cd0[_0x8dd4('0x29')],'sectionId':_0xe76cd0['id']},{})['then'](function(){return _0x53bdef;});}else{return _0x53bdef;}})[_0x8dd4('0x41')](function(_0xb355c3){logger[_0x8dd4('0x27')](_0x8dd4('0x54'),_0xb355c3);throw _0xb355c3;});}return _0x53bdef;})[_0x8dd4('0x26')](respondWithResult(_0x54c34e,0xc9))[_0x8dd4('0x41')](handleError(_0x54c34e,null));}; \ No newline at end of file +var _0x06d1=['json','apply','reject','save','update','destroy','then','get','CannedAnswers','error','stack','name','send','CannedAnswer','rawAttributes','type','key','model','map','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x2cf113,_0x197ce1){var _0x3cae95=function(_0x8fc6a2){while(--_0x8fc6a2){_0x2cf113['push'](_0x2cf113['shift']());}};_0x3cae95(++_0x197ce1);}(_0x06d1,0xe5));var _0x106d=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x06d1[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x106d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x106d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x106d('0x2'));var moment=require(_0x106d('0x3'));var BPromise=require(_0x106d('0x4'));var Mustache=require(_0x106d('0x5'));var util=require(_0x106d('0x6'));var path=require(_0x106d('0x7'));var sox=require(_0x106d('0x8'));var csv=require(_0x106d('0x9'));var ejs=require(_0x106d('0xa'));var fs=require('fs');var fs_extra=require(_0x106d('0xb'));var _=require(_0x106d('0xc'));var squel=require(_0x106d('0xd'));var crypto=require(_0x106d('0xe'));var jsforce=require(_0x106d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x106d('0x9'));var querystring=require(_0x106d('0x10'));var Papa=require(_0x106d('0x11'));var Redis=require(_0x106d('0x12'));var authService=require(_0x106d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x106d('0x14'));var logger=require(_0x106d('0x15'))(_0x106d('0x16'));var utils=require(_0x106d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38773f,_0x452329){_0x452329=_0x452329||0xcc;return function(_0x1b71a5){if(_0x1b71a5){return _0x38773f[_0x106d('0x18')](_0x452329);}return _0x38773f[_0x106d('0x19')](_0x452329)[_0x106d('0x1a')]();};}function respondWithResult(_0x50a636,_0x48ffe7){_0x48ffe7=_0x48ffe7||0xc8;return function(_0x152985){if(_0x152985){return _0x50a636['status'](_0x48ffe7)['json'](_0x152985);}};}function respondWithFilteredResult(_0x440d90,_0x3a20cd){return function(_0x1c2475){if(_0x1c2475){var _0x19e629=typeof _0x3a20cd[_0x106d('0x1b')]===_0x106d('0x1c')&&typeof _0x3a20cd[_0x106d('0x1d')]===_0x106d('0x1c');var _0x3c7bc6=_0x1c2475[_0x106d('0x1e')];var _0x2a202e=_0x19e629?0x0:_0x3a20cd[_0x106d('0x1b')];var _0x34e168=_0x19e629?_0x1c2475[_0x106d('0x1e')]:_0x3a20cd[_0x106d('0x1b')]+_0x3a20cd[_0x106d('0x1d')];var _0x13b9b1;if(_0x34e168>=_0x3c7bc6){_0x34e168=_0x3c7bc6;_0x13b9b1=0xc8;}else{_0x13b9b1=0xce;}_0x440d90['status'](_0x13b9b1);return _0x440d90['set'](_0x106d('0x1f'),_0x2a202e+'-'+_0x34e168+'/'+_0x3c7bc6)[_0x106d('0x20')](_0x1c2475);}return null;};}function patchUpdates(_0x49d9ac){return function(_0x8fcbba){try{jsonpatch[_0x106d('0x21')](_0x8fcbba,_0x49d9ac,!![]);}catch(_0x569ad7){return BPromise[_0x106d('0x22')](_0x569ad7);}return _0x8fcbba[_0x106d('0x23')]();};}function saveUpdates(_0x2c0752,_0x160af9){return function(_0x4dc00b){if(_0x4dc00b){return _0x4dc00b[_0x106d('0x24')](_0x2c0752)['then'](function(_0x13555b){return _0x13555b;});}return null;};}function removeEntity(_0x368d40,_0x2bbfef){return function(_0x2de5ce){if(_0x2de5ce){return _0x2de5ce[_0x106d('0x25')]()[_0x106d('0x26')](function(){var _0x38d16e=_0x2de5ce[_0x106d('0x27')]({'plain':!![]});var _0x555c1b=_0x106d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x555c1b,'resourceId':_0x38d16e['id']}})[_0x106d('0x26')](function(){return _0x2de5ce;});})['then'](function(){_0x368d40['status'](0xcc)[_0x106d('0x1a')]();});}};}function handleEntityNotFound(_0x19c456,_0x430d4b){return function(_0x596372){if(!_0x596372){_0x19c456[_0x106d('0x18')](0x194);}return _0x596372;};}function handleError(_0x3e775f,_0x17d720){_0x17d720=_0x17d720||0x1f4;return function(_0x25b342){logger[_0x106d('0x29')](_0x25b342[_0x106d('0x2a')]);if(_0x25b342[_0x106d('0x2b')]){delete _0x25b342[_0x106d('0x2b')];}_0x3e775f[_0x106d('0x19')](_0x17d720)[_0x106d('0x2c')](_0x25b342);};}exports['index']=function(_0x2221c7,_0x58ed5b){var _0x27e0e2={},_0x3880cb={},_0x4f3275={'count':0x0,'rows':[]};var _0x18eff1=_['map'](db[_0x106d('0x2d')][_0x106d('0x2e')],function(_0x5e6285){return{'name':_0x5e6285['fieldName'],'type':_0x5e6285[_0x106d('0x2f')][_0x106d('0x30')]};});_0x3880cb[_0x106d('0x31')]=_[_0x106d('0x32')](_0x18eff1,_0x106d('0x2b'));_0x3880cb['query']=_[_0x106d('0x33')](_0x2221c7['query']);_0x3880cb[_0x106d('0x34')]=_['intersection'](_0x3880cb[_0x106d('0x31')],_0x3880cb[_0x106d('0x35')]);_0x27e0e2['attributes']=_[_0x106d('0x36')](_0x3880cb[_0x106d('0x31')],qs[_0x106d('0x37')](_0x2221c7[_0x106d('0x35')][_0x106d('0x37')]));_0x27e0e2[_0x106d('0x38')]=_0x27e0e2[_0x106d('0x38')][_0x106d('0x39')]?_0x27e0e2[_0x106d('0x38')]:_0x3880cb[_0x106d('0x31')];if(!_0x2221c7[_0x106d('0x35')][_0x106d('0x3a')](_0x106d('0x3b'))){_0x27e0e2[_0x106d('0x1d')]=qs[_0x106d('0x1d')](_0x2221c7[_0x106d('0x35')][_0x106d('0x1d')]);_0x27e0e2[_0x106d('0x1b')]=qs['offset'](_0x2221c7['query'][_0x106d('0x1b')]);}_0x27e0e2[_0x106d('0x3c')]=qs[_0x106d('0x3d')](_0x2221c7[_0x106d('0x35')][_0x106d('0x3d')]);_0x27e0e2[_0x106d('0x3e')]=qs['filters'](_[_0x106d('0x3f')](_0x2221c7[_0x106d('0x35')],_0x3880cb[_0x106d('0x34')]),_0x18eff1);if(_0x2221c7[_0x106d('0x35')][_0x106d('0x40')]){_0x27e0e2[_0x106d('0x3e')]=_[_0x106d('0x41')](_0x27e0e2[_0x106d('0x3e')],{'$or':[{'key':{'$like':'%'+_0x2221c7[_0x106d('0x35')][_0x106d('0x40')]+'%'}},{'value':{'$like':'%'+_0x2221c7[_0x106d('0x35')][_0x106d('0x40')]+'%'}}]});}_0x27e0e2=_[_0x106d('0x41')]({},_0x27e0e2,_0x2221c7[_0x106d('0x42')]);var _0x5d9ffc={'where':_0x27e0e2[_0x106d('0x3e')]};return db[_0x106d('0x2d')][_0x106d('0x1e')](_0x5d9ffc)[_0x106d('0x26')](function(_0x571a81){_0x4f3275[_0x106d('0x1e')]=_0x571a81;if(_0x2221c7[_0x106d('0x35')][_0x106d('0x43')]){_0x27e0e2[_0x106d('0x44')]=[{'all':!![]}];}return db[_0x106d('0x2d')][_0x106d('0x45')](_0x27e0e2);})[_0x106d('0x26')](function(_0x4c6317){_0x4f3275[_0x106d('0x46')]=_0x4c6317;return _0x4f3275;})[_0x106d('0x26')](respondWithFilteredResult(_0x58ed5b,_0x27e0e2))[_0x106d('0x47')](handleError(_0x58ed5b,null));};exports['show']=function(_0x3b758d,_0x5e041a){var _0xb93f52={'raw':!![],'where':{'id':_0x3b758d[_0x106d('0x48')]['id']}},_0x6643d0={};_0x6643d0[_0x106d('0x31')]=_[_0x106d('0x33')](db[_0x106d('0x2d')][_0x106d('0x2e')]);_0x6643d0[_0x106d('0x35')]=_[_0x106d('0x33')](_0x3b758d[_0x106d('0x35')]);_0x6643d0[_0x106d('0x34')]=_[_0x106d('0x36')](_0x6643d0[_0x106d('0x31')],_0x6643d0[_0x106d('0x35')]);_0xb93f52['attributes']=_[_0x106d('0x36')](_0x6643d0[_0x106d('0x31')],qs[_0x106d('0x37')](_0x3b758d[_0x106d('0x35')][_0x106d('0x37')]));_0xb93f52[_0x106d('0x38')]=_0xb93f52[_0x106d('0x38')]['length']?_0xb93f52[_0x106d('0x38')]:_0x6643d0[_0x106d('0x31')];if(_0x3b758d['query']['includeAll']){_0xb93f52[_0x106d('0x44')]=[{'all':!![]}];}_0xb93f52=_[_0x106d('0x41')]({},_0xb93f52,_0x3b758d[_0x106d('0x42')]);return db[_0x106d('0x2d')][_0x106d('0x49')](_0xb93f52)[_0x106d('0x26')](handleEntityNotFound(_0x5e041a,null))['then'](respondWithResult(_0x5e041a,null))[_0x106d('0x47')](handleError(_0x5e041a,null));};exports[_0x106d('0x24')]=function(_0x5b5940,_0x2bcf53){if(_0x5b5940[_0x106d('0x4a')]['id']){delete _0x5b5940[_0x106d('0x4a')]['id'];}return db[_0x106d('0x2d')][_0x106d('0x49')]({'where':{'id':_0x5b5940['params']['id']}})[_0x106d('0x26')](handleEntityNotFound(_0x2bcf53,null))[_0x106d('0x26')](saveUpdates(_0x5b5940[_0x106d('0x4a')],null))[_0x106d('0x26')](respondWithResult(_0x2bcf53,null))[_0x106d('0x47')](handleError(_0x2bcf53,null));};exports['destroy']=function(_0x30310a,_0x42fe6c){return db[_0x106d('0x2d')][_0x106d('0x49')]({'where':{'id':_0x30310a[_0x106d('0x48')]['id']}})[_0x106d('0x26')](handleEntityNotFound(_0x42fe6c,null))[_0x106d('0x26')](removeEntity(_0x42fe6c,null))[_0x106d('0x47')](handleError(_0x42fe6c,null));};exports['create']=function(_0x1e8e2a,_0xebd988){var _0xc03c97={'key':_0x1e8e2a[_0x106d('0x4a')]['key']};if(_0x1e8e2a[_0x106d('0x4a')][_0x106d('0x4b')]){_0xc03c97['MailAccountId']=_0x1e8e2a[_0x106d('0x4a')][_0x106d('0x4b')];}else if(_0x1e8e2a['body']['SmsAccountId']){_0xc03c97[_0x106d('0x4c')]=_0x1e8e2a['body']['SmsAccountId'];}else if(_0x1e8e2a[_0x106d('0x4a')][_0x106d('0x4d')]){_0xc03c97[_0x106d('0x4d')]=_0x1e8e2a[_0x106d('0x4a')][_0x106d('0x4d')];}else if(_0x1e8e2a[_0x106d('0x4a')][_0x106d('0x4e')]){_0xc03c97[_0x106d('0x4e')]=_0x1e8e2a['body'][_0x106d('0x4e')];}return db[_0x106d('0x2d')][_0x106d('0x49')]({'where':_0xc03c97})['then'](function(_0x3b0fc3){if(_0x3b0fc3){throw new db[(_0x106d('0x4f'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x106d('0x2d')][_0x106d('0x50')](_0x1e8e2a[_0x106d('0x4a')]);})['then'](function(_0x38c80a){var _0x7bfbd4=_0x1e8e2a['user']['get']({'plain':!![]});if(!_0x7bfbd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7bfbd4[_0x106d('0x51')]===_0x106d('0x52')){var _0x1a32a1=_0x38c80a['get']({'plain':!![]});return db[_0x106d('0x53')][_0x106d('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x7bfbd4[_0x106d('0x54')]},'raw':!![]})['then'](function(_0x5dc7fb){if(_0x5dc7fb&&_0x5dc7fb[_0x106d('0x55')]===0x0){return db['UserProfileResource'][_0x106d('0x50')]({'name':_0x1a32a1[_0x106d('0x2b')],'resourceId':_0x1a32a1['id'],'type':_0x5dc7fb['name'],'sectionId':_0x5dc7fb['id']},{})[_0x106d('0x26')](function(){return _0x38c80a;});}else{return _0x38c80a;}})['catch'](function(_0x11bca8){logger[_0x106d('0x29')](_0x106d('0x56'),_0x11bca8);throw _0x11bca8;});}return _0x38c80a;})[_0x106d('0x26')](respondWithResult(_0xebd988,0xc9))['catch'](handleError(_0xebd988,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3f6089e..b703ff7 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 _0x1ee7=['util','../../config/logger','request-promise','path','rimraf','./cannedAnswer.attributes','exports','utf8mb4_unicode_ci','lodash'];(function(_0x12e830,_0x980832){var _0x463d60=function(_0x12aafc){while(--_0x12aafc){_0x12e830['push'](_0x12e830['shift']());}};_0x463d60(++_0x980832);}(_0x1ee7,0xce));var _0x71ee=function(_0x3731d2,_0xaaf8f9){_0x3731d2=_0x3731d2-0x0;var _0xa3894f=_0x1ee7[_0x3731d2];return _0xa3894f;};'use strict';var _=require(_0x71ee('0x0'));var util=require(_0x71ee('0x1'));var logger=require(_0x71ee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71ee('0x3'));var fs=require('fs');var path=require(_0x71ee('0x4'));var rimraf=require(_0x71ee('0x5'));var config=require('../../config/environment');var attributes=require(_0x71ee('0x6'));module[_0x71ee('0x7')]=function(_0x39e402,_0x5d7d53){return _0x39e402['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x71ee('0x8')});}; \ No newline at end of file +var _0x160b=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0xc18746,_0x7387a9){var _0x56c6cd=function(_0x307806){while(--_0x307806){_0xc18746['push'](_0xc18746['shift']());}};_0x56c6cd(++_0x7387a9);}(_0x160b,0xff));var _0xb160=function(_0x4f5d7e,_0x118431){_0x4f5d7e=_0x4f5d7e-0x0;var _0xaf263f=_0x160b[_0x4f5d7e];return _0xaf263f;};'use strict';var _=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var logger=require(_0xb160('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb160('0x3'));var rp=require(_0xb160('0x4'));var fs=require('fs');var path=require(_0xb160('0x5'));var rimraf=require(_0xb160('0x6'));var config=require(_0xb160('0x7'));var attributes=require(_0xb160('0x8'));module[_0xb160('0x9')]=function(_0x42a9c4,_0x29248e){return _0x42a9c4[_0xb160('0xa')](_0xb160('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb160('0xc'),'collate':_0xb160('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c524d53..e2347ed 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(_0x4cd9ba,_0x27252f){var _0x235dc7=function(_0x3c1b87){while(--_0x3c1b87){_0x4cd9ba['push'](_0x4cd9ba['shift']());}};_0x235dc7(++_0x27252f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x52caa3,_0x181dc4){var _0x53bdc9=function(_0x59a120){while(--_0x59a120){_0x52caa3['push'](_0x52caa3['shift']());}};_0x53bdc9(++_0x181dc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 281e6d6..7c5811a 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 _0xc61d=['isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xc61d,0x16e));var _0xdc61=function(_0x527d77,_0x3afd3a){_0x527d77=_0x527d77-0x0;var _0x2884cf=_0xc61d[_0x527d77];return _0x2884cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdc61('0x0'));var timeout=require(_0xdc61('0x1'));var express=require('express');var router=express[_0xdc61('0x2')]();var fs_extra=require(_0xdc61('0x3'));var auth=require(_0xdc61('0x4'));var interaction=require(_0xdc61('0x5'));var config=require(_0xdc61('0x6'));var controller=require('./cannedAnswer.controller');router[_0xdc61('0x7')]('/',auth[_0xdc61('0x8')](),controller[_0xdc61('0x9')]);router[_0xdc61('0x7')](_0xdc61('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xdc61('0xb')]('/',auth[_0xdc61('0x8')](),controller[_0xdc61('0xc')]);router['put'](_0xdc61('0xa'),auth['isAuthenticated'](),controller[_0xdc61('0xd')]);router[_0xdc61('0xe')](_0xdc61('0xa'),auth[_0xdc61('0x8')](),controller[_0xdc61('0xf')]);module[_0xdc61('0x10')]=router; \ No newline at end of file +var _0x819f=['post','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','get','isAuthenticated','show'];(function(_0x2c2c3c,_0x4ed336){var _0x5c320e=function(_0x5c6e89){while(--_0x5c6e89){_0x2c2c3c['push'](_0x2c2c3c['shift']());}};_0x5c320e(++_0x4ed336);}(_0x819f,0x8e));var _0xf819=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x819f[_0x49beea];return _0x27693a;};'use strict';var multer=require(_0xf819('0x0'));var util=require(_0xf819('0x1'));var path=require('path');var timeout=require(_0xf819('0x2'));var express=require(_0xf819('0x3'));var router=express[_0xf819('0x4')]();var fs_extra=require(_0xf819('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf819('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf819('0x7')]);router[_0xf819('0x8')]('/:id',auth[_0xf819('0x9')](),controller[_0xf819('0xa')]);router[_0xf819('0xb')]('/',auth[_0xf819('0x9')](),controller[_0xf819('0xc')]);router[_0xf819('0xd')](_0xf819('0xe'),auth[_0xf819('0x9')](),controller[_0xf819('0xf')]);router['delete']('/:id',auth[_0xf819('0x9')](),controller['destroy']);module[_0xf819('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 64ed21c..4818859 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 _0x89e3=['STRING','INTEGER','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x535986,_0x5f325b){var _0x2a3f4c=function(_0x4f165f){while(--_0x4f165f){_0x535986['push'](_0x535986['shift']());}};_0x2a3f4c(++_0x5f325b);}(_0x89e3,0x66));var _0x389e=function(_0x150fcf,_0x411fd9){_0x150fcf=_0x150fcf-0x0;var _0xd8d383=_0x89e3[_0x150fcf];return _0xd8d383;};'use strict';var Sequelize=require('sequelize');module[_0x389e('0x0')]={'calldate':{'type':Sequelize[_0x389e('0x1')],'allowNull':![],'defaultValue':_0x389e('0x2')},'clid':{'type':Sequelize[_0x389e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x389e('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x389e('0x3')]},'lastapp':{'type':Sequelize[_0x389e('0x3')]},'lastdata':{'type':Sequelize[_0x389e('0x3')]},'duration':{'type':Sequelize[_0x389e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x389e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x389e('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x389e('0x3')]},'uniqueid':{'type':Sequelize[_0x389e('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x389e('0x3')]},'peeraccount':{'type':Sequelize[_0x389e('0x3')]},'type':{'type':Sequelize[_0x389e('0x3')]},'tag':{'type':Sequelize[_0x389e('0x3')]}}; \ No newline at end of file +var _0x99e9=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x457b8c,_0x40321a){var _0x3bb94f=function(_0x16ea94){while(--_0x16ea94){_0x457b8c['push'](_0x457b8c['shift']());}};_0x3bb94f(++_0x40321a);}(_0x99e9,0xb4));var _0x999e=function(_0x300860,_0x509371){_0x300860=_0x300860-0x0;var _0x2094ad=_0x99e9[_0x300860];return _0x2094ad;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'calldate':{'type':Sequelize[_0x999e('0x1')],'allowNull':![],'defaultValue':_0x999e('0x2')},'clid':{'type':Sequelize[_0x999e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x999e('0x3')]},'dcontext':{'type':Sequelize[_0x999e('0x3')]},'channel':{'type':Sequelize[_0x999e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x999e('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x999e('0x3')]},'amaflags':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x999e('0x3')]},'uniqueid':{'type':Sequelize[_0x999e('0x3')]},'linkedid':{'type':Sequelize[_0x999e('0x3')]},'sequence':{'type':Sequelize[_0x999e('0x3')]},'peeraccount':{'type':Sequelize[_0x999e('0x3')]},'type':{'type':Sequelize[_0x999e('0x3')]},'tag':{'type':Sequelize[_0x999e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index d9f172b..e36466f 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 _0xa9b1=['where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter'];(function(_0x4c403d,_0x5ef49f){var _0x5a0c35=function(_0x40ba5a){while(--_0x40ba5a){_0x4c403d['push'](_0x4c403d['shift']());}};_0x5a0c35(++_0x5ef49f);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a9b('0x0'));var jsonpatch=require(_0x1a9b('0x1'));var rp=require(_0x1a9b('0x2'));var moment=require(_0x1a9b('0x3'));var BPromise=require(_0x1a9b('0x4'));var Mustache=require(_0x1a9b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a9b('0x6'));var ejs=require(_0x1a9b('0x7'));var fs=require('fs');var fs_extra=require(_0x1a9b('0x8'));var _=require(_0x1a9b('0x9'));var squel=require(_0x1a9b('0xa'));var crypto=require(_0x1a9b('0xb'));var jsforce=require(_0x1a9b('0xc'));var deskjs=require(_0x1a9b('0xd'));var toCsv=require(_0x1a9b('0x6'));var querystring=require(_0x1a9b('0xe'));var Papa=require(_0x1a9b('0xf'));var Redis=require(_0x1a9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a9b('0x11'));var hardwareService=require(_0x1a9b('0x12'));var logger=require(_0x1a9b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1a9b('0x14'));var db=require(_0x1a9b('0x15'))['db'];function respondWithStatusCode(_0x2c75cf,_0x11bf7e){_0x11bf7e=_0x11bf7e||0xcc;return function(_0x2c3170){if(_0x2c3170){return _0x2c75cf[_0x1a9b('0x16')](_0x11bf7e);}return _0x2c75cf['status'](_0x11bf7e)[_0x1a9b('0x17')]();};}function respondWithResult(_0x34f082,_0x245883){_0x245883=_0x245883||0xc8;return function(_0x53c725){if(_0x53c725){return _0x34f082[_0x1a9b('0x18')](_0x245883)[_0x1a9b('0x19')](_0x53c725);}};}function respondWithFilteredResult(_0x55a00d,_0x2a7d72){return function(_0x57ca87){if(_0x57ca87){var _0x439acd=typeof _0x2a7d72[_0x1a9b('0x1a')]===_0x1a9b('0x1b')&&typeof _0x2a7d72[_0x1a9b('0x1c')]===_0x1a9b('0x1b');var _0x20b8dc=_0x57ca87[_0x1a9b('0x1d')];var _0x205a0d=_0x439acd?0x0:_0x2a7d72[_0x1a9b('0x1a')];var _0x1281c2=_0x439acd?_0x57ca87['count']:_0x2a7d72[_0x1a9b('0x1a')]+_0x2a7d72[_0x1a9b('0x1c')];var _0x3df7d2;if(_0x1281c2>=_0x20b8dc){_0x1281c2=_0x20b8dc;_0x3df7d2=0xc8;}else{_0x3df7d2=0xce;}_0x55a00d[_0x1a9b('0x18')](_0x3df7d2);return _0x55a00d['set'](_0x1a9b('0x1e'),_0x205a0d+'-'+_0x1281c2+'/'+_0x20b8dc)[_0x1a9b('0x19')](_0x57ca87);}return null;};}function patchUpdates(_0x4b3cd3){return function(_0x23e327){try{jsonpatch[_0x1a9b('0x1f')](_0x23e327,_0x4b3cd3,!![]);}catch(_0x44cebf){return BPromise[_0x1a9b('0x20')](_0x44cebf);}return _0x23e327[_0x1a9b('0x21')]();};}function saveUpdates(_0x590568,_0x189e78){return function(_0x17b1dd){if(_0x17b1dd){return _0x17b1dd[_0x1a9b('0x22')](_0x590568)[_0x1a9b('0x23')](function(_0x36391a){return _0x36391a;});}return null;};}function removeEntity(_0x2e42f1,_0x28f937){return function(_0x488a33){if(_0x488a33){return _0x488a33[_0x1a9b('0x24')]()['then'](function(){_0x2e42f1[_0x1a9b('0x18')](0xcc)[_0x1a9b('0x17')]();});}};}function handleEntityNotFound(_0xad6541,_0x4e7234){return function(_0x213841){if(!_0x213841){_0xad6541[_0x1a9b('0x16')](0x194);}return _0x213841;};}function handleError(_0x1521f4,_0x181331){_0x181331=_0x181331||0x1f4;return function(_0x18c9dd){logger[_0x1a9b('0x25')](_0x18c9dd['stack']);if(_0x18c9dd[_0x1a9b('0x26')]){delete _0x18c9dd[_0x1a9b('0x26')];}_0x1521f4['status'](_0x181331)[_0x1a9b('0x27')](_0x18c9dd);};}exports[_0x1a9b('0x28')]=function(_0x5d70dc,_0x5d7e8c){var _0x3f8e98={},_0x1d981e={},_0x5362b8={'count':0x0,'rows':[]};var _0x30278b=_[_0x1a9b('0x29')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')],function(_0x1a5085){return{'name':_0x1a5085[_0x1a9b('0x2c')],'type':_0x1a5085[_0x1a9b('0x2d')]['key']};});_0x1d981e[_0x1a9b('0x2e')]=_[_0x1a9b('0x29')](_0x30278b,_0x1a9b('0x26'));_0x1d981e[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x5d70dc[_0x1a9b('0x2f')]);_0x1d981e[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x1d981e[_0x1a9b('0x2e')],_0x1d981e[_0x1a9b('0x2f')]);_0x3f8e98[_0x1a9b('0x33')]=_['intersection'](_0x1d981e['model'],qs[_0x1a9b('0x34')](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x3f8e98['attributes']=_0x3f8e98[_0x1a9b('0x33')]['length']?_0x3f8e98[_0x1a9b('0x33')]:_0x1d981e['model'];if(!_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x35')]('nolimit')){_0x3f8e98[_0x1a9b('0x1c')]=qs['limit'](_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x1c')]);_0x3f8e98[_0x1a9b('0x1a')]=qs[_0x1a9b('0x1a')](_0x5d70dc['query'][_0x1a9b('0x1a')]);}_0x3f8e98[_0x1a9b('0x36')]=qs[_0x1a9b('0x37')](_0x5d70dc['query'][_0x1a9b('0x37')]);_0x3f8e98['where']=qs['filters'](_[_0x1a9b('0x38')](_0x5d70dc[_0x1a9b('0x2f')],_0x1d981e[_0x1a9b('0x31')]),_0x30278b);if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]){_0x3f8e98[_0x1a9b('0x3a')]=_[_0x1a9b('0x3b')](_0x3f8e98['where'],{'$or':_[_0x1a9b('0x29')](_0x30278b,function(_0x230fc6){if(_0x230fc6[_0x1a9b('0x2d')]!=='VIRTUAL'){var _0x466827={};_0x466827[_0x230fc6[_0x1a9b('0x26')]]={'$like':'%'+_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x39')]+'%'};return _0x466827;}})});}_0x3f8e98=_['merge']({},_0x3f8e98,_0x5d70dc['options']);var _0x10e80f={'where':_0x3f8e98[_0x1a9b('0x3a')]};return db[_0x1a9b('0x2a')]['count'](_0x10e80f)['then'](function(_0x2b9bcf){_0x5362b8[_0x1a9b('0x1d')]=_0x2b9bcf;if(_0x5d70dc[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x3f8e98[_0x1a9b('0x3d')]=[{'all':!![]}];}return db[_0x1a9b('0x2a')][_0x1a9b('0x3e')](_0x3f8e98);})['then'](function(_0x313921){_0x5362b8[_0x1a9b('0x3f')]=_0x313921;return _0x5362b8;})[_0x1a9b('0x23')](respondWithFilteredResult(_0x5d7e8c,_0x3f8e98))[_0x1a9b('0x40')](handleError(_0x5d7e8c,null));};exports[_0x1a9b('0x41')]=function(_0x1decb8,_0xb4cbf4){var _0x398db3={'raw':!![],'where':{'id':_0x1decb8[_0x1a9b('0x42')]['id']}},_0x35f6d8={};_0x35f6d8[_0x1a9b('0x2e')]=_[_0x1a9b('0x30')](db[_0x1a9b('0x2a')][_0x1a9b('0x2b')]);_0x35f6d8[_0x1a9b('0x2f')]=_[_0x1a9b('0x30')](_0x1decb8['query']);_0x35f6d8[_0x1a9b('0x31')]=_[_0x1a9b('0x32')](_0x35f6d8['model'],_0x35f6d8[_0x1a9b('0x2f')]);_0x398db3['attributes']=_['intersection'](_0x35f6d8[_0x1a9b('0x2e')],qs[_0x1a9b('0x34')](_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x34')]));_0x398db3[_0x1a9b('0x33')]=_0x398db3[_0x1a9b('0x33')][_0x1a9b('0x43')]?_0x398db3['attributes']:_0x35f6d8[_0x1a9b('0x2e')];if(_0x1decb8[_0x1a9b('0x2f')][_0x1a9b('0x3c')]){_0x398db3[_0x1a9b('0x3d')]=[{'all':!![]}];}_0x398db3=_['merge']({},_0x398db3,_0x1decb8[_0x1a9b('0x44')]);return db[_0x1a9b('0x2a')][_0x1a9b('0x45')](_0x398db3)[_0x1a9b('0x23')](handleEntityNotFound(_0xb4cbf4,null))['then'](respondWithResult(_0xb4cbf4,null))[_0x1a9b('0x40')](handleError(_0xb4cbf4,null));};exports[_0x1a9b('0x46')]=function(_0x41e9fc,_0x1e93df){return db[_0x1a9b('0x2a')]['create'](_0x41e9fc['body'],{})[_0x1a9b('0x23')](respondWithResult(_0x1e93df,0xc9))[_0x1a9b('0x40')](handleError(_0x1e93df,null));};exports['update']=function(_0x52b06e,_0x252140){if(_0x52b06e[_0x1a9b('0x47')]['id']){delete _0x52b06e[_0x1a9b('0x47')]['id'];}return db['Cdr'][_0x1a9b('0x45')]({'where':{'id':_0x52b06e[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x252140,null))[_0x1a9b('0x23')](saveUpdates(_0x52b06e[_0x1a9b('0x47')],null))[_0x1a9b('0x23')](respondWithResult(_0x252140,null))[_0x1a9b('0x40')](handleError(_0x252140,null));};exports['destroy']=function(_0x54b9ac,_0x5465d0){return db[_0x1a9b('0x2a')][_0x1a9b('0x45')]({'where':{'id':_0x54b9ac[_0x1a9b('0x42')]['id']}})[_0x1a9b('0x23')](handleEntityNotFound(_0x5465d0,null))[_0x1a9b('0x23')](removeEntity(_0x5465d0,null))['catch'](handleError(_0x5465d0,null));};exports[_0x1a9b('0x48')]=function(_0x222bba,_0x3b1fdf){return db[_0x1a9b('0x2a')][_0x1a9b('0x48')]()[_0x1a9b('0x23')](respondWithResult(_0x3b1fdf,null))[_0x1a9b('0x40')](handleError(_0x3b1fdf,null));}; \ No newline at end of file +var _0x79a8=['reject','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x79a8,0x1d0));var _0x879a=function(_0x337570,_0xdd86bc){_0x337570=_0x337570-0x0;var _0x27b1fb=_0x79a8[_0x337570];return _0x27b1fb;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];function respondWithStatusCode(_0x320115,_0x54a9b6){_0x54a9b6=_0x54a9b6||0xcc;return function(_0x4738b4){if(_0x4738b4){return _0x320115[_0x879a('0x17')](_0x54a9b6);}return _0x320115[_0x879a('0x18')](_0x54a9b6)[_0x879a('0x19')]();};}function respondWithResult(_0x1a20c5,_0x1c2853){_0x1c2853=_0x1c2853||0xc8;return function(_0x461f1e){if(_0x461f1e){return _0x1a20c5[_0x879a('0x18')](_0x1c2853)[_0x879a('0x1a')](_0x461f1e);}};}function respondWithFilteredResult(_0x16b649,_0x5b4dbe){return function(_0x4a1e0e){if(_0x4a1e0e){var _0x3b8680=typeof _0x5b4dbe[_0x879a('0x1b')]==='undefined'&&typeof _0x5b4dbe[_0x879a('0x1c')]===_0x879a('0x1d');var _0x149105=_0x4a1e0e[_0x879a('0x1e')];var _0x32d9f5=_0x3b8680?0x0:_0x5b4dbe[_0x879a('0x1b')];var _0x4160bd=_0x3b8680?_0x4a1e0e[_0x879a('0x1e')]:_0x5b4dbe[_0x879a('0x1b')]+_0x5b4dbe[_0x879a('0x1c')];var _0x14241a;if(_0x4160bd>=_0x149105){_0x4160bd=_0x149105;_0x14241a=0xc8;}else{_0x14241a=0xce;}_0x16b649[_0x879a('0x18')](_0x14241a);return _0x16b649[_0x879a('0x1f')](_0x879a('0x20'),_0x32d9f5+'-'+_0x4160bd+'/'+_0x149105)['json'](_0x4a1e0e);}return null;};}function patchUpdates(_0x830b36){return function(_0x326e6a){try{jsonpatch['apply'](_0x326e6a,_0x830b36,!![]);}catch(_0x25a57d){return BPromise[_0x879a('0x21')](_0x25a57d);}return _0x326e6a['save']();};}function saveUpdates(_0x56e394,_0x4ed0d6){return function(_0x28c401){if(_0x28c401){return _0x28c401[_0x879a('0x22')](_0x56e394)[_0x879a('0x23')](function(_0x38d42c){return _0x38d42c;});}return null;};}function removeEntity(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(_0x3674f9){return _0x3674f9[_0x879a('0x24')]()[_0x879a('0x23')](function(){_0x4c3808[_0x879a('0x18')](0xcc)[_0x879a('0x19')]();});}};}function handleEntityNotFound(_0x1dd818,_0x7d67ed){return function(_0x14213c){if(!_0x14213c){_0x1dd818[_0x879a('0x17')](0x194);}return _0x14213c;};}function handleError(_0x2ee375,_0x272bf9){_0x272bf9=_0x272bf9||0x1f4;return function(_0x3510cc){logger[_0x879a('0x25')](_0x3510cc['stack']);if(_0x3510cc[_0x879a('0x26')]){delete _0x3510cc[_0x879a('0x26')];}_0x2ee375[_0x879a('0x18')](_0x272bf9)[_0x879a('0x27')](_0x3510cc);};}exports[_0x879a('0x28')]=function(_0x3030e0,_0x3ef6c1){var _0x2d9ed3={},_0x3ca5cd={},_0x1b6c15={'count':0x0,'rows':[]};var _0x2605e9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x99559){return{'name':_0x99559[_0x879a('0x2c')],'type':_0x99559[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x3ca5cd['model']=_[_0x879a('0x29')](_0x2605e9,'name');_0x3ca5cd[_0x879a('0x2f')]=_[_0x879a('0x30')](_0x3030e0[_0x879a('0x2f')]);_0x3ca5cd['filters']=_[_0x879a('0x31')](_0x3ca5cd['model'],_0x3ca5cd['query']);_0x2d9ed3['attributes']=_['intersection'](_0x3ca5cd[_0x879a('0x32')],qs[_0x879a('0x33')](_0x3030e0['query'][_0x879a('0x33')]));_0x2d9ed3[_0x879a('0x34')]=_0x2d9ed3[_0x879a('0x34')]['length']?_0x2d9ed3[_0x879a('0x34')]:_0x3ca5cd[_0x879a('0x32')];if(!_0x3030e0[_0x879a('0x2f')][_0x879a('0x35')]('nolimit')){_0x2d9ed3[_0x879a('0x1c')]=qs[_0x879a('0x1c')](_0x3030e0[_0x879a('0x2f')][_0x879a('0x1c')]);_0x2d9ed3['offset']=qs[_0x879a('0x1b')](_0x3030e0['query'][_0x879a('0x1b')]);}_0x2d9ed3['order']=qs[_0x879a('0x36')](_0x3030e0[_0x879a('0x2f')]['sort']);_0x2d9ed3[_0x879a('0x37')]=qs[_0x879a('0x38')](_[_0x879a('0x39')](_0x3030e0[_0x879a('0x2f')],_0x3ca5cd['filters']),_0x2605e9);if(_0x3030e0[_0x879a('0x2f')][_0x879a('0x3a')]){_0x2d9ed3[_0x879a('0x37')]=_['merge'](_0x2d9ed3['where'],{'$or':_['map'](_0x2605e9,function(_0x5de17f){if(_0x5de17f['type']!==_0x879a('0x3b')){var _0x142bdc={};_0x142bdc[_0x5de17f[_0x879a('0x26')]]={'$like':'%'+_0x3030e0['query']['filter']+'%'};return _0x142bdc;}})});}_0x2d9ed3=_['merge']({},_0x2d9ed3,_0x3030e0[_0x879a('0x3c')]);var _0x5597f9={'where':_0x2d9ed3[_0x879a('0x37')]};return db[_0x879a('0x2a')][_0x879a('0x1e')](_0x5597f9)['then'](function(_0x4f9681){_0x1b6c15[_0x879a('0x1e')]=_0x4f9681;if(_0x3030e0['query'][_0x879a('0x3d')]){_0x2d9ed3[_0x879a('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x879a('0x3f')](_0x2d9ed3);})[_0x879a('0x23')](function(_0x2cc43c){_0x1b6c15['rows']=_0x2cc43c;return _0x1b6c15;})[_0x879a('0x23')](respondWithFilteredResult(_0x3ef6c1,_0x2d9ed3))[_0x879a('0x40')](handleError(_0x3ef6c1,null));};exports['show']=function(_0x7d99a0,_0x2456a4){var _0x4dedfe={'raw':!![],'where':{'id':_0x7d99a0[_0x879a('0x41')]['id']}},_0x14f8e7={};_0x14f8e7[_0x879a('0x32')]=_[_0x879a('0x30')](db['Cdr'][_0x879a('0x2b')]);_0x14f8e7['query']=_[_0x879a('0x30')](_0x7d99a0['query']);_0x14f8e7[_0x879a('0x38')]=_['intersection'](_0x14f8e7[_0x879a('0x32')],_0x14f8e7[_0x879a('0x2f')]);_0x4dedfe[_0x879a('0x34')]=_[_0x879a('0x31')](_0x14f8e7[_0x879a('0x32')],qs[_0x879a('0x33')](_0x7d99a0['query'][_0x879a('0x33')]));_0x4dedfe[_0x879a('0x34')]=_0x4dedfe[_0x879a('0x34')]['length']?_0x4dedfe[_0x879a('0x34')]:_0x14f8e7[_0x879a('0x32')];if(_0x7d99a0[_0x879a('0x2f')]['includeAll']){_0x4dedfe[_0x879a('0x3e')]=[{'all':!![]}];}_0x4dedfe=_[_0x879a('0x42')]({},_0x4dedfe,_0x7d99a0[_0x879a('0x3c')]);return db[_0x879a('0x2a')]['find'](_0x4dedfe)['then'](handleEntityNotFound(_0x2456a4,null))[_0x879a('0x23')](respondWithResult(_0x2456a4,null))[_0x879a('0x40')](handleError(_0x2456a4,null));};exports['create']=function(_0x2ff7cd,_0x4420ac){return db['Cdr'][_0x879a('0x43')](_0x2ff7cd[_0x879a('0x44')],{})[_0x879a('0x23')](respondWithResult(_0x4420ac,0xc9))[_0x879a('0x40')](handleError(_0x4420ac,null));};exports['update']=function(_0x3ffbe6,_0x32933f){if(_0x3ffbe6[_0x879a('0x44')]['id']){delete _0x3ffbe6['body']['id'];}return db['Cdr'][_0x879a('0x45')]({'where':{'id':_0x3ffbe6[_0x879a('0x41')]['id']}})['then'](handleEntityNotFound(_0x32933f,null))[_0x879a('0x23')](saveUpdates(_0x3ffbe6[_0x879a('0x44')],null))[_0x879a('0x23')](respondWithResult(_0x32933f,null))['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x24')]=function(_0x677418,_0xc1c234){return db[_0x879a('0x2a')]['find']({'where':{'id':_0x677418[_0x879a('0x41')]['id']}})[_0x879a('0x23')](handleEntityNotFound(_0xc1c234,null))['then'](removeEntity(_0xc1c234,null))[_0x879a('0x40')](handleError(_0xc1c234,null));};exports[_0x879a('0x46')]=function(_0x59ff36,_0x51644c){return db[_0x879a('0x2a')]['describe']()['then'](respondWithResult(_0x51644c,null))[_0x879a('0x40')](handleError(_0x51644c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 3807ce2..e1944ac 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x432e38,_0x1aae1a){var _0x1070ac=function(_0x3ddeed){while(--_0x3ddeed){_0x432e38['push'](_0x432e38['shift']());}};_0x1070ac(++_0x1aae1a);}(_0x7a54,0x106));var _0x47a5=function(_0x2d027b,_0x4a913b){_0x2d027b=_0x2d027b-0x0;var _0x2cf6c9=_0x7a54[_0x2d027b];return _0x2cf6c9;};'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 +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x23931d,_0x1a1c41){var _0x5d4f5f=function(_0x5cbbf5){while(--_0x5cbbf5){_0x23931d['push'](_0x23931d['shift']());}};_0x5d4f5f(++_0x1a1c41);}(_0x7a54,0x106));var _0x47a5=function(_0x484c37,_0x47029a){_0x484c37=_0x484c37-0x0;var _0x31669e=_0x7a54[_0x484c37];return _0x31669e;};'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 35db8af..eafa750 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 _0xc78f=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc78f,0x17b));var _0xfc78=function(_0x414596,_0x6b3f54){_0x414596=_0x414596-0x0;var _0xd7bbe1=_0xc78f[_0x414596];return _0xd7bbe1;};'use strict';var _=require('lodash');var util=require(_0xfc78('0x0'));var moment=require(_0xfc78('0x1'));var BPromise=require(_0xfc78('0x2'));var rs=require(_0xfc78('0x3'));var fs=require('fs');var Redis=require(_0xfc78('0x4'));var db=require(_0xfc78('0x5'))['db'];var utils=require(_0xfc78('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc78('0x7'));var jayson=require(_0xfc78('0x8'));var client=jayson['client'][_0xfc78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x356538,_0x571b61,_0x6d6900){return new BPromise(function(_0x5dc484,_0x915f6a){return client[_0xfc78('0xa')](_0x356538,_0x6d6900)[_0xfc78('0xb')](function(_0x457563){logger[_0xfc78('0xc')](_0xfc78('0xd'),_0x571b61,_0xfc78('0xe'));logger['debug'](_0xfc78('0xf'),_0x571b61,_0xfc78('0xe'),JSON[_0xfc78('0x10')](_0x457563));if(_0x457563[_0xfc78('0x11')]){if(_0x457563[_0xfc78('0x11')]['code']===0x1f4){logger[_0xfc78('0x11')](_0xfc78('0xd'),_0x571b61,_0x457563[_0xfc78('0x11')][_0xfc78('0x12')]);return _0x915f6a(_0x457563[_0xfc78('0x11')]['message']);}logger['error'](_0xfc78('0xd'),_0x571b61,_0x457563[_0xfc78('0x11')][_0xfc78('0x12')]);return _0x5dc484(_0x457563[_0xfc78('0x11')][_0xfc78('0x12')]);}else{logger[_0xfc78('0xc')]('Cdr,\x20%s,\x20%s',_0x571b61,_0xfc78('0xe'));_0x5dc484(_0x457563[_0xfc78('0x13')][_0xfc78('0x12')]);}})[_0xfc78('0x14')](function(_0x39c54a){logger[_0xfc78('0x11')]('Cdr,\x20%s,\x20%s',_0x571b61,_0x39c54a);_0x915f6a(_0x39c54a);});});} \ No newline at end of file +var _0x0166=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Cdr,\x20%s,\x20%s','result'];(function(_0x1ee5ef,_0x38d42b){var _0x448ab8=function(_0x508932){while(--_0x508932){_0x1ee5ef['push'](_0x1ee5ef['shift']());}};_0x448ab8(++_0x38d42b);}(_0x0166,0xfc));var _0x6016=function(_0x43d4a5,_0x1b8a5d){_0x43d4a5=_0x43d4a5-0x0;var _0x562069=_0x0166[_0x43d4a5];return _0x562069;};'use strict';var _=require(_0x6016('0x0'));var util=require(_0x6016('0x1'));var moment=require('moment');var BPromise=require(_0x6016('0x2'));var rs=require(_0x6016('0x3'));var fs=require('fs');var Redis=require(_0x6016('0x4'));var db=require(_0x6016('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6016('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6016('0x7'));var client=jayson[_0x6016('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cf1d8,_0x2bf0a6,_0x25189e){return new BPromise(function(_0x15ded2,_0x2b3a23){return client[_0x6016('0x9')](_0x4cf1d8,_0x25189e)[_0x6016('0xa')](function(_0xe74e07){logger[_0x6016('0xb')]('Cdr,\x20%s,\x20%s',_0x2bf0a6,'request\x20sent');logger[_0x6016('0xc')](_0x6016('0xd'),_0x2bf0a6,_0x6016('0xe'),JSON[_0x6016('0xf')](_0xe74e07));if(_0xe74e07[_0x6016('0x10')]){if(_0xe74e07[_0x6016('0x10')][_0x6016('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x2bf0a6,_0xe74e07[_0x6016('0x10')][_0x6016('0x12')]);return _0x2b3a23(_0xe74e07[_0x6016('0x10')][_0x6016('0x12')]);}logger[_0x6016('0x10')](_0x6016('0x13'),_0x2bf0a6,_0xe74e07['error']['message']);return _0x15ded2(_0xe74e07[_0x6016('0x10')][_0x6016('0x12')]);}else{logger[_0x6016('0xb')]('Cdr,\x20%s,\x20%s',_0x2bf0a6,_0x6016('0xe'));_0x15ded2(_0xe74e07[_0x6016('0x14')][_0x6016('0x12')]);}})['catch'](function(_0x458841){logger[_0x6016('0x10')](_0x6016('0x13'),_0x2bf0a6,_0x458841);_0x2b3a23(_0x458841);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 4320fd9..b3a92d1 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index bdf8518..1398f67 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 _0x38fe=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x38fe,0xfa));var _0xe38f=function(_0x52321b,_0x5cf2be){_0x52321b=_0x52321b-0x0;var _0x562a3f=_0x38fe[_0x52321b];return _0x562a3f;};'use strict';var Sequelize=require(_0xe38f('0x0'));module[_0xe38f('0x1')]={'priority':{'type':Sequelize[_0xe38f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe38f('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe38f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe38f('0x3')],'defaultValue':_0xe38f('0x5')}}; \ No newline at end of file +var _0x50b6=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x50b6,0x8d));var _0x650b=function(_0x2d252e,_0x53f616){_0x2d252e=_0x2d252e-0x0;var _0x13a6c4=_0x50b6[_0x2d252e];return _0x13a6c4;};'use strict';var Sequelize=require(_0x650b('0x0'));module[_0x650b('0x1')]={'priority':{'type':Sequelize[_0x650b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x650b('0x3')},'appdata':{'type':Sequelize[_0x650b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x650b('0x5')],'defaultValue':_0x650b('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5877bac..983c0c6 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 _0x049e=['json','reject','save','update','then','error','stack','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','catch','body','find','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range'];(function(_0x3b3dd3,_0x16b375){var _0x719a79=function(_0xaaa279){while(--_0xaaa279){_0x3b3dd3['push'](_0x3b3dd3['shift']());}};_0x719a79(++_0x16b375);}(_0x049e,0x16a));var _0xe049=function(_0x350343,_0x256f69){_0x350343=_0x350343-0x0;var _0x9afc1c=_0x049e[_0x350343];return _0x9afc1c;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){_0x3b0f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aafd1,_0x1efbbe){return function(_0x53620b){if(!_0x53620b){_0x1aafd1[_0xe049('0x17')](0x194);}return _0x53620b;};}function handleError(_0x181432,_0x3e5c7f){_0x3e5c7f=_0x3e5c7f||0x1f4;return function(_0x423ba4){logger[_0xe049('0x23')](_0x423ba4[_0xe049('0x24')]);if(_0x423ba4['name']){delete _0x423ba4['name'];}_0x181432[_0xe049('0x18')](_0x3e5c7f)['send'](_0x423ba4);};}exports[_0xe049('0x25')]=function(_0x495d33,_0x3c50c3){var _0x2b79dc={'raw':!![],'where':{'id':_0x495d33[_0xe049('0x26')]['id']}},_0x5adcd6={};_0x5adcd6[_0xe049('0x27')]=_[_0xe049('0x28')](db[_0xe049('0x29')][_0xe049('0x2a')]);_0x5adcd6[_0xe049('0x2b')]=_[_0xe049('0x28')](_0x495d33[_0xe049('0x2b')]);_0x5adcd6[_0xe049('0x2c')]=_[_0xe049('0x2d')](_0x5adcd6[_0xe049('0x27')],_0x5adcd6['query']);_0x2b79dc[_0xe049('0x2e')]=_[_0xe049('0x2d')](_0x5adcd6['model'],qs['fields'](_0x495d33['query']['fields']));_0x2b79dc[_0xe049('0x2e')]=_0x2b79dc[_0xe049('0x2e')][_0xe049('0x2f')]?_0x2b79dc[_0xe049('0x2e')]:_0x5adcd6[_0xe049('0x27')];if(_0x495d33['query'][_0xe049('0x30')]){_0x2b79dc[_0xe049('0x31')]=[{'all':!![]}];}_0x2b79dc=_[_0xe049('0x32')]({},_0x2b79dc,_0x495d33[_0xe049('0x33')]);return db[_0xe049('0x29')]['find'](_0x2b79dc)[_0xe049('0x22')](handleEntityNotFound(_0x3c50c3,null))['then'](respondWithResult(_0x3c50c3,null))[_0xe049('0x34')](handleError(_0x3c50c3,null));};exports['update']=function(_0x1162d6,_0x374dc5){if(_0x1162d6[_0xe049('0x35')]['id']){delete _0x1162d6[_0xe049('0x35')]['id'];}return db[_0xe049('0x29')][_0xe049('0x36')]({'where':{'id':_0x1162d6[_0xe049('0x26')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x374dc5,null))[_0xe049('0x22')](saveUpdates(_0x1162d6[_0xe049('0x35')],null))[_0xe049('0x22')](respondWithResult(_0x374dc5,null))['catch'](handleError(_0x374dc5,null));};exports[_0xe049('0x37')]=function(_0x1b21d9,_0x78e33d){return db[_0xe049('0x29')][_0xe049('0x36')]({'where':{'id':_0x1b21d9[_0xe049('0x26')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x78e33d,null))[_0xe049('0x22')](removeEntity(_0x78e33d,null))['catch'](handleError(_0x78e33d,null));}; \ No newline at end of file +var _0xc4dd=['params','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','then','destroy','error','stack','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','model','include','merge','options','find','update','body'];(function(_0x4dde32,_0x5c671d){var _0x5da244=function(_0x46b7da){while(--_0x46b7da){_0x4dde32['push'](_0x4dde32['shift']());}};_0x5da244(++_0x5c671d);}(_0xc4dd,0xad));var _0xdc4d=function(_0x39ff75,_0x2cfc9d){_0x39ff75=_0x39ff75-0x0;var _0xabfcd=_0xc4dd[_0x39ff75];return _0xabfcd;};'use strict';var emlformat=require(_0xdc4d('0x0'));var rimraf=require(_0xdc4d('0x1'));var zipdir=require(_0xdc4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc4d('0x3'));var moment=require(_0xdc4d('0x4'));var BPromise=require(_0xdc4d('0x5'));var Mustache=require(_0xdc4d('0x6'));var util=require(_0xdc4d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdc4d('0x8'));var ejs=require(_0xdc4d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc4d('0xa'));var squel=require(_0xdc4d('0xb'));var crypto=require('crypto');var jsforce=require(_0xdc4d('0xc'));var deskjs=require(_0xdc4d('0xd'));var toCsv=require(_0xdc4d('0x8'));var querystring=require(_0xdc4d('0xe'));var Papa=require(_0xdc4d('0xf'));var Redis=require(_0xdc4d('0x10'));var authService=require(_0xdc4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdc4d('0x12'));var hardwareService=require(_0xdc4d('0x13'));var logger=require('../../config/logger')(_0xdc4d('0x14'));var utils=require('../../config/utils');var config=require(_0xdc4d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x487100,_0x351a48){_0x351a48=_0x351a48||0xcc;return function(_0xc63ead){if(_0xc63ead){return _0x487100[_0xdc4d('0x16')](_0x351a48);}return _0x487100['status'](_0x351a48)[_0xdc4d('0x17')]();};}function respondWithResult(_0x158295,_0x177547){_0x177547=_0x177547||0xc8;return function(_0x586e74){if(_0x586e74){return _0x158295[_0xdc4d('0x18')](_0x177547)['json'](_0x586e74);}};}function respondWithFilteredResult(_0x49235f,_0xf0f72c){return function(_0xff4e3){if(_0xff4e3){var _0x2c9835=typeof _0xf0f72c[_0xdc4d('0x19')]==='undefined'&&typeof _0xf0f72c[_0xdc4d('0x1a')]===_0xdc4d('0x1b');var _0x2caabc=_0xff4e3[_0xdc4d('0x1c')];var _0x504aa3=_0x2c9835?0x0:_0xf0f72c[_0xdc4d('0x19')];var _0x3203c1=_0x2c9835?_0xff4e3[_0xdc4d('0x1c')]:_0xf0f72c[_0xdc4d('0x19')]+_0xf0f72c[_0xdc4d('0x1a')];var _0x217fcb;if(_0x3203c1>=_0x2caabc){_0x3203c1=_0x2caabc;_0x217fcb=0xc8;}else{_0x217fcb=0xce;}_0x49235f[_0xdc4d('0x18')](_0x217fcb);return _0x49235f[_0xdc4d('0x1d')]('Content-Range',_0x504aa3+'-'+_0x3203c1+'/'+_0x2caabc)[_0xdc4d('0x1e')](_0xff4e3);}return null;};}function patchUpdates(_0x273af8){return function(_0x3900ce){try{jsonpatch[_0xdc4d('0x1f')](_0x3900ce,_0x273af8,!![]);}catch(_0x2eea2d){return BPromise['reject'](_0x2eea2d);}return _0x3900ce['save']();};}function saveUpdates(_0x2bca28,_0xa97815){return function(_0x3049a1){if(_0x3049a1){return _0x3049a1['update'](_0x2bca28)[_0xdc4d('0x20')](function(_0x4fee8a){return _0x4fee8a;});}return null;};}function removeEntity(_0xe30d3c,_0x25c8df){return function(_0x84132e){if(_0x84132e){return _0x84132e[_0xdc4d('0x21')]()[_0xdc4d('0x20')](function(){_0xe30d3c['status'](0xcc)[_0xdc4d('0x17')]();});}};}function handleEntityNotFound(_0x2def53,_0x722a8f){return function(_0xd6f0c7){if(!_0xd6f0c7){_0x2def53[_0xdc4d('0x16')](0x194);}return _0xd6f0c7;};}function handleError(_0x4f53ab,_0x22f9f2){_0x22f9f2=_0x22f9f2||0x1f4;return function(_0x1f51d9){logger[_0xdc4d('0x22')](_0x1f51d9[_0xdc4d('0x23')]);if(_0x1f51d9[_0xdc4d('0x24')]){delete _0x1f51d9[_0xdc4d('0x24')];}_0x4f53ab[_0xdc4d('0x18')](_0x22f9f2)[_0xdc4d('0x25')](_0x1f51d9);};}exports[_0xdc4d('0x26')]=function(_0x4933d6,_0x1c7270){var _0x31199d={'raw':!![],'where':{'id':_0x4933d6['params']['id']}},_0x286a52={};_0x286a52['model']=_[_0xdc4d('0x27')](db[_0xdc4d('0x28')][_0xdc4d('0x29')]);_0x286a52[_0xdc4d('0x2a')]=_['keys'](_0x4933d6[_0xdc4d('0x2a')]);_0x286a52[_0xdc4d('0x2b')]=_[_0xdc4d('0x2c')](_0x286a52['model'],_0x286a52[_0xdc4d('0x2a')]);_0x31199d[_0xdc4d('0x2d')]=_['intersection'](_0x286a52['model'],qs['fields'](_0x4933d6[_0xdc4d('0x2a')][_0xdc4d('0x2e')]));_0x31199d['attributes']=_0x31199d[_0xdc4d('0x2d')][_0xdc4d('0x2f')]?_0x31199d['attributes']:_0x286a52[_0xdc4d('0x30')];if(_0x4933d6[_0xdc4d('0x2a')]['includeAll']){_0x31199d[_0xdc4d('0x31')]=[{'all':!![]}];}_0x31199d=_[_0xdc4d('0x32')]({},_0x31199d,_0x4933d6[_0xdc4d('0x33')]);return db[_0xdc4d('0x28')][_0xdc4d('0x34')](_0x31199d)[_0xdc4d('0x20')](handleEntityNotFound(_0x1c7270,null))['then'](respondWithResult(_0x1c7270,null))['catch'](handleError(_0x1c7270,null));};exports[_0xdc4d('0x35')]=function(_0x279c46,_0x26ec16){if(_0x279c46[_0xdc4d('0x36')]['id']){delete _0x279c46[_0xdc4d('0x36')]['id'];}return db[_0xdc4d('0x28')][_0xdc4d('0x34')]({'where':{'id':_0x279c46[_0xdc4d('0x37')]['id']}})[_0xdc4d('0x20')](handleEntityNotFound(_0x26ec16,null))[_0xdc4d('0x20')](saveUpdates(_0x279c46[_0xdc4d('0x36')],null))[_0xdc4d('0x20')](respondWithResult(_0x26ec16,null))[_0xdc4d('0x38')](handleError(_0x26ec16,null));};exports[_0xdc4d('0x21')]=function(_0x4656a1,_0x1e2b0c){return db[_0xdc4d('0x28')][_0xdc4d('0x34')]({'where':{'id':_0x4656a1[_0xdc4d('0x37')]['id']}})[_0xdc4d('0x20')](handleEntityNotFound(_0x1e2b0c,null))['then'](removeEntity(_0x1e2b0c,null))[_0xdc4d('0x38')](handleError(_0x1e2b0c,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9844af4..26e675a 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 _0xb8b7=['./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','bluebird','request-promise','path','../../config/environment'];(function(_0x541641,_0x5ee02a){var _0x53766b=function(_0x151f72){while(--_0x151f72){_0x541641['push'](_0x541641['shift']());}};_0x53766b(++_0x5ee02a);}(_0xb8b7,0x114));var _0x7b8b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb8b7[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7b8b('0x0'));var rp=require(_0x7b8b('0x1'));var fs=require('fs');var path=require(_0x7b8b('0x2'));var rimraf=require('rimraf');var config=require(_0x7b8b('0x3'));var attributes=require(_0x7b8b('0x4'));module['exports']=function(_0x58a059,_0x43e2b4){return _0x58a059[_0x7b8b('0x5')](_0x7b8b('0x6'),attributes,{'tableName':_0x7b8b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b8b('0x8'),'collate':_0x7b8b('0x9')});}; \ No newline at end of file +var _0xcea2=['rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xebf5,_0x3754f3){var _0x4c52bf=function(_0x3ccdde){while(--_0x3ccdde){_0xebf5['push'](_0xebf5['shift']());}};_0x4c52bf(++_0x3754f3);}(_0xcea2,0x15a));var _0x2cea=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xcea2[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var logger=require(_0x2cea('0x1'))('api');var moment=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var rp=require(_0x2cea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var attributes=require(_0x2cea('0x7'));module['exports']=function(_0x34f0f2,_0x485c26){return _0x34f0f2[_0x2cea('0x8')](_0x2cea('0x9'),attributes,{'tableName':_0x2cea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2cea('0xb'),'collate':_0x2cea('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 92ba81e..f7c002b 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 _0xb9c2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird'];(function(_0x218bed,_0xf947ed){var _0x161203=function(_0x331f53){while(--_0x331f53){_0x218bed['push'](_0x218bed['shift']());}};_0x161203(++_0xf947ed);}(_0xb9c2,0x107));var _0x2b9c=function(_0x4cfce3,_0x5cfba0){_0x4cfce3=_0x4cfce3-0x0;var _0xd71772=_0xb9c2[_0x4cfce3];return _0xd71772;};'use strict';var _=require(_0x2b9c('0x0'));var util=require(_0x2b9c('0x1'));var moment=require('moment');var BPromise=require(_0x2b9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b9c('0x3'));var db=require(_0x2b9c('0x4'))['db'];var utils=require(_0x2b9c('0x5'));var logger=require(_0x2b9c('0x6'))(_0x2b9c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2b9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a8681,_0x212551,_0x44b6d0){return new BPromise(function(_0x4f1fca,_0x217b05){return client['request'](_0x5a8681,_0x44b6d0)[_0x2b9c('0x9')](function(_0xefc713){logger[_0x2b9c('0xa')](_0x2b9c('0xb'),_0x212551,_0x2b9c('0xc'));logger[_0x2b9c('0xd')](_0x2b9c('0xe'),_0x212551,_0x2b9c('0xc'),JSON[_0x2b9c('0xf')](_0xefc713));if(_0xefc713[_0x2b9c('0x10')]){if(_0xefc713[_0x2b9c('0x10')]['code']===0x1f4){logger['error'](_0x2b9c('0xb'),_0x212551,_0xefc713[_0x2b9c('0x10')][_0x2b9c('0x11')]);return _0x217b05(_0xefc713[_0x2b9c('0x10')][_0x2b9c('0x11')]);}logger['error'](_0x2b9c('0xb'),_0x212551,_0xefc713[_0x2b9c('0x10')][_0x2b9c('0x11')]);return _0x4f1fca(_0xefc713[_0x2b9c('0x10')][_0x2b9c('0x11')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x212551,'request\x20sent');_0x4f1fca(_0xefc713['result'][_0x2b9c('0x11')]);}})[_0x2b9c('0x12')](function(_0x158a58){logger['error'](_0x2b9c('0xb'),_0x212551,_0x158a58);_0x217b05(_0x158a58);});});} \ No newline at end of file +var _0xd26b=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util'];(function(_0x393cd7,_0xdbe809){var _0x1c5e12=function(_0x43a859){while(--_0x43a859){_0x393cd7['push'](_0x393cd7['shift']());}};_0x1c5e12(++_0xdbe809);}(_0xd26b,0xfb));var _0xbd26=function(_0x4d4b88,_0xff28fb){_0x4d4b88=_0x4d4b88-0x0;var _0xfa7665=_0xd26b[_0x4d4b88];return _0xfa7665;};'use strict';var _=require('lodash');var util=require(_0xbd26('0x0'));var moment=require(_0xbd26('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd26('0x3'))['db'];var utils=require(_0xbd26('0x4'));var logger=require('../../config/logger')(_0xbd26('0x5'));var config=require(_0xbd26('0x6'));var jayson=require(_0xbd26('0x7'));var client=jayson[_0xbd26('0x8')][_0xbd26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab34c,_0x13309c,_0x310480){return new BPromise(function(_0x3824f0,_0xa10675){return client[_0xbd26('0xa')](_0x4ab34c,_0x310480)[_0xbd26('0xb')](function(_0x36237d){logger[_0xbd26('0xc')](_0xbd26('0xd'),_0x13309c,_0xbd26('0xe'));logger['debug'](_0xbd26('0xf'),_0x13309c,_0xbd26('0xe'),JSON['stringify'](_0x36237d));if(_0x36237d['error']){if(_0x36237d[_0xbd26('0x10')][_0xbd26('0x11')]===0x1f4){logger[_0xbd26('0x10')](_0xbd26('0xd'),_0x13309c,_0x36237d[_0xbd26('0x10')][_0xbd26('0x12')]);return _0xa10675(_0x36237d['error'][_0xbd26('0x12')]);}logger[_0xbd26('0x10')](_0xbd26('0xd'),_0x13309c,_0x36237d[_0xbd26('0x10')][_0xbd26('0x12')]);return _0x3824f0(_0x36237d['error'][_0xbd26('0x12')]);}else{logger[_0xbd26('0xc')](_0xbd26('0xd'),_0x13309c,_0xbd26('0xe'));_0x3824f0(_0x36237d[_0xbd26('0x13')]['message']);}})[_0xbd26('0x14')](function(_0x27db90){logger[_0xbd26('0x10')](_0xbd26('0xd'),_0x13309c,_0x27db90);_0xa10675(_0x27db90);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index dec55c7..32be390 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 _0x2fe5=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','put','/:id','isAuthenticated','update','destroy','exports','multer','util'];(function(_0x2db905,_0x3a00a7){var _0x598f85=function(_0x46ccd6){while(--_0x46ccd6){_0x2db905['push'](_0x2db905['shift']());}};_0x598f85(++_0x3a00a7);}(_0x2fe5,0x12a));var _0x52fe=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2fe5[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var path=require(_0x52fe('0x2'));var timeout=require(_0x52fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x52fe('0x4'));var auth=require(_0x52fe('0x5'));var interaction=require(_0x52fe('0x6'));var config=require('../../config/environment');var controller=require(_0x52fe('0x7'));router[_0x52fe('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x52fe('0x9')](_0x52fe('0xa'),auth[_0x52fe('0xb')](),controller[_0x52fe('0xc')]);router['delete'](_0x52fe('0xa'),auth[_0x52fe('0xb')](),controller[_0x52fe('0xd')]);module[_0x52fe('0xe')]=router; \ No newline at end of file +var _0x2650=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x2650,0x7f));var _0x0265=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x2650[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0x0265('0x0'));var util=require(_0x0265('0x1'));var path=require(_0x0265('0x2'));var timeout=require('connect-timeout');var express=require(_0x0265('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0265('0x4'));var interaction=require(_0x0265('0x5'));var config=require(_0x0265('0x6'));var controller=require(_0x0265('0x7'));router[_0x0265('0x8')](_0x0265('0x9'),auth[_0x0265('0xa')](),controller[_0x0265('0xb')]);router[_0x0265('0xc')](_0x0265('0x9'),auth[_0x0265('0xa')](),controller[_0x0265('0xd')]);router[_0x0265('0xe')](_0x0265('0x9'),auth[_0x0265('0xa')](),controller[_0x0265('0xf')]);module[_0x0265('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6ede63f..cc3722c 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 _0xc405=['sequelize','STRING','BOOLEAN'];(function(_0x4db6bb,_0x1ff1d4){var _0x69ae44=function(_0x5d350c){while(--_0x5d350c){_0x4db6bb['push'](_0x4db6bb['shift']());}};_0x69ae44(++_0x1ff1d4);}(_0xc405,0x69));var _0x5c40=function(_0x1abaf7,_0x43e010){_0x1abaf7=_0x1abaf7-0x0;var _0x3ec6f8=_0xc405[_0x1abaf7];return _0x3ec6f8;};'use strict';var Sequelize=require(_0x5c40('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5c40('0x1')]},'write':{'type':Sequelize[_0x5c40('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x966f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x12cad4,_0x108240){var _0x475dd8=function(_0x209344){while(--_0x209344){_0x12cad4['push'](_0x12cad4['shift']());}};_0x475dd8(++_0x108240);}(_0x966f,0xbf));var _0xf966=function(_0x2be64f,_0x51ab84){_0x2be64f=_0x2be64f-0x0;var _0x42cad5=_0x966f[_0x2be64f];return _0x42cad5;};'use strict';var Sequelize=require(_0xf966('0x0'));module[_0xf966('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf966('0x2')]},'write':{'type':Sequelize[_0xf966('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 8392910..c10d847 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 _0xcff1=['save','error','stack','name','index','ChatGroup','fieldName','type','key','map','query','keys','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','params','rawAttributes','create','body','update','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','omit','getMembers','findOne','User','pick','filter','removeMembers','addMessage','getMessages','$gte','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0xcb2bbe,_0x782e6d){var _0x2dd38d=function(_0x17fb61){while(--_0x17fb61){_0xcb2bbe['push'](_0xcb2bbe['shift']());}};_0x2dd38d(++_0x782e6d);}(_0xcff1,0x1a6));var _0x1cff=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xcff1[_0x59c301];return _0x3866b9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cff('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1cff('0x1'));var BPromise=require(_0x1cff('0x2'));var Mustache=require(_0x1cff('0x3'));var util=require(_0x1cff('0x4'));var path=require('path');var sox=require(_0x1cff('0x5'));var csv=require(_0x1cff('0x6'));var ejs=require(_0x1cff('0x7'));var fs=require('fs');var fs_extra=require(_0x1cff('0x8'));var _=require(_0x1cff('0x9'));var squel=require(_0x1cff('0xa'));var crypto=require('crypto');var jsforce=require(_0x1cff('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cff('0x6'));var querystring=require(_0x1cff('0xc'));var Papa=require('papaparse');var Redis=require(_0x1cff('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1cff('0xe'));var hardwareService=require(_0x1cff('0xf'));var logger=require(_0x1cff('0x10'))(_0x1cff('0x11'));var utils=require(_0x1cff('0x12'));var config=require(_0x1cff('0x13'));var licenseUtil=require(_0x1cff('0x14'));var db=require(_0x1cff('0x15'))['db'];config['redis']=_[_0x1cff('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1cff('0x17'))(new Redis(config[_0x1cff('0x18')]));require(_0x1cff('0x19'))[_0x1cff('0x1a')](socket);function respondWithStatusCode(_0x4a3d5c,_0x303cf1){_0x303cf1=_0x303cf1||0xcc;return function(_0x483962){if(_0x483962){return _0x4a3d5c[_0x1cff('0x1b')](_0x303cf1);}return _0x4a3d5c[_0x1cff('0x1c')](_0x303cf1)[_0x1cff('0x1d')]();};}function respondWithResult(_0x40c7ec,_0x102ed4){_0x102ed4=_0x102ed4||0xc8;return function(_0x375187){if(_0x375187){return _0x40c7ec['status'](_0x102ed4)['json'](_0x375187);}};}function respondWithFilteredResult(_0x1c6079,_0x3b9dda){return function(_0xce7f51){if(_0xce7f51){var _0x9f8ac1=typeof _0x3b9dda[_0x1cff('0x1e')]===_0x1cff('0x1f')&&typeof _0x3b9dda[_0x1cff('0x20')]==='undefined';var _0x267a5b=_0xce7f51['count'];var _0x39a299=_0x9f8ac1?0x0:_0x3b9dda['offset'];var _0x51a751=_0x9f8ac1?_0xce7f51[_0x1cff('0x21')]:_0x3b9dda[_0x1cff('0x1e')]+_0x3b9dda[_0x1cff('0x20')];var _0x11a571;if(_0x51a751>=_0x267a5b){_0x51a751=_0x267a5b;_0x11a571=0xc8;}else{_0x11a571=0xce;}_0x1c6079[_0x1cff('0x1c')](_0x11a571);return _0x1c6079[_0x1cff('0x22')]('Content-Range',_0x39a299+'-'+_0x51a751+'/'+_0x267a5b)[_0x1cff('0x23')](_0xce7f51);}return null;};}function patchUpdates(_0x1ee735){return function(_0x5f2dee){try{jsonpatch[_0x1cff('0x24')](_0x5f2dee,_0x1ee735,!![]);}catch(_0x2cd102){return BPromise[_0x1cff('0x25')](_0x2cd102);}return _0x5f2dee[_0x1cff('0x26')]();};}function saveUpdates(_0x3d3309,_0x28a7b7){return function(_0x3f735e){if(_0x3f735e){return _0x3f735e['update'](_0x3d3309)['then'](function(_0x5c1064){return _0x5c1064;});}return null;};}function removeEntity(_0x188f7d,_0x138b63){return function(_0x4ca1c2){if(_0x4ca1c2){return _0x4ca1c2['destroy']()['then'](function(){_0x188f7d[_0x1cff('0x1c')](0xcc)[_0x1cff('0x1d')]();});}};}function handleEntityNotFound(_0xad5a42,_0x11de0c){return function(_0x21ef76){if(!_0x21ef76){_0xad5a42[_0x1cff('0x1b')](0x194);}return _0x21ef76;};}function handleError(_0x206109,_0x25d628){_0x25d628=_0x25d628||0x1f4;return function(_0x546d36){logger[_0x1cff('0x27')](_0x546d36[_0x1cff('0x28')]);if(_0x546d36[_0x1cff('0x29')]){delete _0x546d36[_0x1cff('0x29')];}_0x206109[_0x1cff('0x1c')](_0x25d628)['send'](_0x546d36);};}exports[_0x1cff('0x2a')]=function(_0x7b0c4d,_0x43a884){var _0x299e43={},_0x2e4034={},_0x321bfa={'count':0x0,'rows':[]};var _0x3c56f8=_['map'](db[_0x1cff('0x2b')]['rawAttributes'],function(_0x1715e5){return{'name':_0x1715e5[_0x1cff('0x2c')],'type':_0x1715e5[_0x1cff('0x2d')][_0x1cff('0x2e')]};});_0x2e4034['model']=_[_0x1cff('0x2f')](_0x3c56f8,_0x1cff('0x29'));_0x2e4034[_0x1cff('0x30')]=_[_0x1cff('0x31')](_0x7b0c4d['query']);_0x2e4034['filters']=_['intersection'](_0x2e4034['model'],_0x2e4034[_0x1cff('0x30')]);_0x299e43[_0x1cff('0x32')]=_[_0x1cff('0x33')](_0x2e4034['model'],qs[_0x1cff('0x34')](_0x7b0c4d[_0x1cff('0x30')]['fields']));_0x299e43[_0x1cff('0x32')]=_0x299e43['attributes'][_0x1cff('0x35')]?_0x299e43[_0x1cff('0x32')]:_0x2e4034[_0x1cff('0x36')];if(!_0x7b0c4d[_0x1cff('0x30')][_0x1cff('0x37')](_0x1cff('0x38'))){_0x299e43[_0x1cff('0x20')]=qs[_0x1cff('0x20')](_0x7b0c4d[_0x1cff('0x30')]['limit']);_0x299e43['offset']=qs[_0x1cff('0x1e')](_0x7b0c4d[_0x1cff('0x30')][_0x1cff('0x1e')]);}_0x299e43[_0x1cff('0x39')]=qs[_0x1cff('0x3a')](_0x7b0c4d[_0x1cff('0x30')][_0x1cff('0x3a')]);_0x299e43[_0x1cff('0x3b')]=qs[_0x1cff('0x3c')](_['pick'](_0x7b0c4d[_0x1cff('0x30')],_0x2e4034[_0x1cff('0x3c')]),_0x3c56f8);if(_0x7b0c4d[_0x1cff('0x30')]['filter']){_0x299e43[_0x1cff('0x3b')]=_['merge'](_0x299e43[_0x1cff('0x3b')],{'$or':_[_0x1cff('0x2f')](_0x3c56f8,function(_0x2d534b){if(_0x2d534b[_0x1cff('0x2d')]!==_0x1cff('0x3d')){var _0x4d216b={};_0x4d216b[_0x2d534b[_0x1cff('0x29')]]={'$like':'%'+_0x7b0c4d[_0x1cff('0x30')]['filter']+'%'};return _0x4d216b;}})});}_0x299e43=_[_0x1cff('0x3e')]({},_0x299e43,_0x7b0c4d[_0x1cff('0x3f')]);var _0x33e4bf={'where':_0x299e43['where']};return db[_0x1cff('0x2b')][_0x1cff('0x21')](_0x33e4bf)[_0x1cff('0x40')](function(_0x23d3c8){_0x321bfa[_0x1cff('0x21')]=_0x23d3c8;if(_0x7b0c4d[_0x1cff('0x30')][_0x1cff('0x41')]){_0x299e43[_0x1cff('0x42')]=[{'all':!![]}];}return db[_0x1cff('0x2b')][_0x1cff('0x43')](_0x299e43);})['then'](function(_0x5b4291){_0x321bfa['rows']=_0x5b4291;return _0x321bfa;})[_0x1cff('0x40')](respondWithFilteredResult(_0x43a884,_0x299e43))[_0x1cff('0x44')](handleError(_0x43a884,null));};exports['show']=function(_0x2a513a,_0x3c8e7e){var _0x1cc8c6={'raw':!![],'where':{'id':_0x2a513a[_0x1cff('0x45')]['id']}},_0x2aba4c={};_0x2aba4c[_0x1cff('0x36')]=_[_0x1cff('0x31')](db[_0x1cff('0x2b')][_0x1cff('0x46')]);_0x2aba4c[_0x1cff('0x30')]=_[_0x1cff('0x31')](_0x2a513a[_0x1cff('0x30')]);_0x2aba4c[_0x1cff('0x3c')]=_[_0x1cff('0x33')](_0x2aba4c[_0x1cff('0x36')],_0x2aba4c['query']);_0x1cc8c6[_0x1cff('0x32')]=_['intersection'](_0x2aba4c[_0x1cff('0x36')],qs[_0x1cff('0x34')](_0x2a513a[_0x1cff('0x30')][_0x1cff('0x34')]));_0x1cc8c6['attributes']=_0x1cc8c6[_0x1cff('0x32')][_0x1cff('0x35')]?_0x1cc8c6[_0x1cff('0x32')]:_0x2aba4c[_0x1cff('0x36')];if(_0x2a513a[_0x1cff('0x30')][_0x1cff('0x41')]){_0x1cc8c6['include']=[{'all':!![]}];}_0x1cc8c6=_[_0x1cff('0x3e')]({},_0x1cc8c6,_0x2a513a['options']);return db[_0x1cff('0x2b')]['find'](_0x1cc8c6)[_0x1cff('0x40')](handleEntityNotFound(_0x3c8e7e,null))[_0x1cff('0x40')](respondWithResult(_0x3c8e7e,null))[_0x1cff('0x44')](handleError(_0x3c8e7e,null));};exports[_0x1cff('0x47')]=function(_0x597f23,_0x28d5fd){return db['ChatGroup'][_0x1cff('0x47')](_0x597f23[_0x1cff('0x48')],{})[_0x1cff('0x40')](respondWithResult(_0x28d5fd,0xc9))[_0x1cff('0x44')](handleError(_0x28d5fd,null));};exports[_0x1cff('0x49')]=function(_0x40b3f7,_0xff668e){if(_0x40b3f7[_0x1cff('0x48')]['id']){delete _0x40b3f7[_0x1cff('0x48')]['id'];}return db[_0x1cff('0x2b')][_0x1cff('0x4a')]({'where':{'id':_0x40b3f7[_0x1cff('0x45')]['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0xff668e,null))['then'](saveUpdates(_0x40b3f7[_0x1cff('0x48')],null))[_0x1cff('0x40')](respondWithResult(_0xff668e,null))[_0x1cff('0x44')](handleError(_0xff668e,null));};exports[_0x1cff('0x4b')]=function(_0x2c69d5,_0x4cc6ee){return db['ChatGroup'][_0x1cff('0x4a')]({'where':{'id':_0x2c69d5[_0x1cff('0x45')]['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0x4cc6ee,null))[_0x1cff('0x40')](removeEntity(_0x4cc6ee,null))['catch'](handleError(_0x4cc6ee,null));};exports[_0x1cff('0x4c')]=function(_0x2042d6,_0x51f7bd){return db['ChatGroup'][_0x1cff('0x4c')]()[_0x1cff('0x40')](respondWithResult(_0x51f7bd,null))[_0x1cff('0x44')](handleError(_0x51f7bd,null));};exports[_0x1cff('0x4d')]=function(_0x401785,_0x3b603a,_0x1c0a14){return db[_0x1cff('0x4e')][_0x1cff('0x21')]({'where':{'ChatGroupId':_0x401785[_0x1cff('0x45')]['id'],'ToId':_0x401785[_0x1cff('0x4f')]['id'],'read':![]}})[_0x1cff('0x40')](function(_0x4bdb56){return{'id':_[_0x1cff('0x50')](_0x401785[_0x1cff('0x45')]['id']),'count':_0x4bdb56};})[_0x1cff('0x40')](respondWithResult(_0x3b603a,null))['catch'](handleError(_0x3b603a,null));};exports['addMembers']=function(_0x2a7f85,_0x382435,_0x39e257){return db[_0x1cff('0x2b')][_0x1cff('0x4a')]({'where':{'id':_0x2a7f85[_0x1cff('0x45')]['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0x382435,null))[_0x1cff('0x40')](function(_0x166996){if(_0x166996){return _0x166996['addMembers'](_0x2a7f85[_0x1cff('0x48')][_0x1cff('0x51')],_[_0x1cff('0x52')](_0x2a7f85['body'],['ids','id'])||{});}})[_0x1cff('0x40')](respondWithResult(_0x382435,null))[_0x1cff('0x44')](handleError(_0x382435,null));};exports[_0x1cff('0x53')]=function(_0x52c143,_0x251357,_0x301638){var _0x19c6b9={};var _0x14afff={};var _0xb25a1f;var _0x43948a;return db['ChatGroup'][_0x1cff('0x54')]({'where':{'id':_0x52c143['params']['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0x251357,null))[_0x1cff('0x40')](function(_0x5b4b46){if(_0x5b4b46){_0xb25a1f=_0x5b4b46;_0x14afff[_0x1cff('0x36')]=_[_0x1cff('0x31')](db[_0x1cff('0x55')][_0x1cff('0x46')]);_0x14afff[_0x1cff('0x30')]=_[_0x1cff('0x31')](_0x52c143[_0x1cff('0x30')]);_0x14afff[_0x1cff('0x3c')]=_[_0x1cff('0x33')](_0x14afff[_0x1cff('0x36')],_0x14afff['query']);_0x19c6b9[_0x1cff('0x32')]=_[_0x1cff('0x33')](_0x14afff['model'],qs[_0x1cff('0x34')](_0x52c143[_0x1cff('0x30')][_0x1cff('0x34')]));_0x19c6b9[_0x1cff('0x32')]=_0x19c6b9[_0x1cff('0x32')]['length']?_0x19c6b9['attributes']:_0x14afff[_0x1cff('0x36')];_0x19c6b9['order']=qs[_0x1cff('0x3a')](_0x52c143[_0x1cff('0x30')][_0x1cff('0x3a')]);_0x19c6b9[_0x1cff('0x3b')]=qs['filters'](_[_0x1cff('0x56')](_0x52c143[_0x1cff('0x30')],_0x14afff[_0x1cff('0x3c')]));if(_0x52c143[_0x1cff('0x30')][_0x1cff('0x57')]){_0x19c6b9[_0x1cff('0x3b')]=_[_0x1cff('0x3e')](_0x19c6b9[_0x1cff('0x3b')],{'$or':_['map'](_0x19c6b9[_0x1cff('0x32')],function(_0x40ae2f){var _0x52963c={};_0x52963c[_0x40ae2f]={'$like':'%'+_0x52c143[_0x1cff('0x30')][_0x1cff('0x57')]+'%'};return _0x52963c;})});}_0x19c6b9=_[_0x1cff('0x3e')]({},_0x19c6b9,_0x52c143[_0x1cff('0x3f')]);return _0xb25a1f[_0x1cff('0x53')](_0x19c6b9);}})['then'](function(_0x1a6ba9){if(_0x1a6ba9){_0x43948a=_0x1a6ba9['length'];if(!_0x52c143[_0x1cff('0x30')][_0x1cff('0x37')]('nolimit')){_0x19c6b9[_0x1cff('0x20')]=qs['limit'](_0x52c143[_0x1cff('0x30')]['limit']);_0x19c6b9[_0x1cff('0x1e')]=qs['offset'](_0x52c143[_0x1cff('0x30')][_0x1cff('0x1e')]);}return _0xb25a1f[_0x1cff('0x53')](_0x19c6b9);}})[_0x1cff('0x40')](function(_0xea6294){if(_0xea6294){return _0xea6294?{'count':_0x43948a,'rows':_0xea6294}:null;}})[_0x1cff('0x40')](respondWithResult(_0x251357,null))[_0x1cff('0x44')](handleError(_0x251357,null));};exports[_0x1cff('0x58')]=function(_0x2f5d24,_0x3c5151,_0xedf31c){return db['ChatGroup'][_0x1cff('0x4a')]({'where':{'id':_0x2f5d24[_0x1cff('0x45')]['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0x3c5151,null))[_0x1cff('0x40')](function(_0x3881ea){if(_0x3881ea){return _0x3881ea[_0x1cff('0x58')](_0x2f5d24[_0x1cff('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x3c5151,null))[_0x1cff('0x44')](handleError(_0x3c5151,null));};exports[_0x1cff('0x59')]=function(_0x1ad8f0,_0x2b7871,_0x27a47e){if(_0x1ad8f0[_0x1cff('0x48')]['id']){delete _0x1ad8f0[_0x1cff('0x48')]['id'];}return db[_0x1cff('0x2b')][_0x1cff('0x4a')]({'where':{'id':_0x1ad8f0[_0x1cff('0x45')]['id']}})[_0x1cff('0x40')](handleEntityNotFound(_0x2b7871,null))[_0x1cff('0x40')](function(_0xa72b78){if(_0xa72b78){_0x1ad8f0[_0x1cff('0x48')]['ChatGroupId']=_0xa72b78['id'];return db[_0x1cff('0x4e')][_0x1cff('0x47')](_0x1ad8f0[_0x1cff('0x48')]);}})[_0x1cff('0x40')](respondWithResult(_0x2b7871,null))['catch'](handleError(_0x2b7871,null));};exports[_0x1cff('0x5a')]=function(_0x351cb5,_0x24783c,_0x5c7468){var _0x1e30de={};var _0x43b453={};var _0x455b51;var _0x2ef5b8;return db[_0x1cff('0x2b')][_0x1cff('0x54')]({'where':{'id':_0x351cb5[_0x1cff('0x45')]['id']}})['then'](handleEntityNotFound(_0x24783c,null))[_0x1cff('0x40')](function(_0x1edc0c){if(_0x1edc0c){_0x455b51=_0x1edc0c;_0x43b453[_0x1cff('0x36')]=_[_0x1cff('0x31')](db[_0x1cff('0x4e')][_0x1cff('0x46')]);_0x43b453['query']=_[_0x1cff('0x31')](_0x351cb5[_0x1cff('0x30')]);_0x43b453['filters']=_[_0x1cff('0x33')](_0x43b453[_0x1cff('0x36')],_0x43b453['query']);_0x1e30de[_0x1cff('0x32')]=_['intersection'](_0x43b453[_0x1cff('0x36')],qs[_0x1cff('0x34')](_0x351cb5[_0x1cff('0x30')][_0x1cff('0x34')]));_0x1e30de[_0x1cff('0x32')]=_0x1e30de[_0x1cff('0x32')][_0x1cff('0x35')]?_0x1e30de[_0x1cff('0x32')]:_0x43b453[_0x1cff('0x36')];_0x1e30de[_0x1cff('0x39')]=qs[_0x1cff('0x3a')](_0x351cb5[_0x1cff('0x30')]['sort']);_0x1e30de[_0x1cff('0x3b')]=qs['filters'](_[_0x1cff('0x56')](_0x351cb5['query'],_0x43b453[_0x1cff('0x3c')]));if(_0x351cb5[_0x1cff('0x30')]['filter']){_0x1e30de['where']=_[_0x1cff('0x3e')](_0x1e30de['where'],{'$or':_[_0x1cff('0x2f')](_0x1e30de[_0x1cff('0x32')],function(_0x198e0a){var _0x2aa255={};_0x2aa255[_0x198e0a]={'$like':'%'+_0x351cb5[_0x1cff('0x30')][_0x1cff('0x57')]+'%'};return _0x2aa255;})});}if(_0x351cb5['query'][_0x1cff('0x5b')]){var _0x272a3a=_0x351cb5[_0x1cff('0x30')][_0x1cff('0x5b')]['split'](',');var _0x61ac61={};_0x61ac61[_0x272a3a[0x0]]={'$gte':moment(_0x272a3a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1e30de[_0x1cff('0x3b')]=_['merge'](_0x1e30de[_0x1cff('0x3b')],_0x61ac61);}_0x1e30de=_['merge']({},_0x1e30de,_0x351cb5[_0x1cff('0x3f')]);return _0x455b51['getMessages'](_0x1e30de);}})[_0x1cff('0x40')](function(_0x4ee67a){if(_0x4ee67a){_0x2ef5b8=_0x4ee67a[_0x1cff('0x35')];if(!_0x351cb5[_0x1cff('0x30')][_0x1cff('0x37')](_0x1cff('0x38'))){_0x1e30de[_0x1cff('0x20')]=qs[_0x1cff('0x20')](_0x351cb5[_0x1cff('0x30')][_0x1cff('0x20')]);_0x1e30de['offset']=qs[_0x1cff('0x1e')](_0x351cb5[_0x1cff('0x30')][_0x1cff('0x1e')]);}return _0x455b51[_0x1cff('0x5a')](_0x1e30de);}})[_0x1cff('0x40')](function(_0xf81065){if(_0xf81065){return _0xf81065?{'count':_0x2ef5b8,'rows':_0xf81065}:null;}})[_0x1cff('0x40')](respondWithResult(_0x24783c,null))[_0x1cff('0x44')](handleError(_0x24783c,null));}; \ No newline at end of file +var _0xb9cd=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','localhost','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','ChatGroup','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','map','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0xb9cd,0x18c));var _0xdb9c=function(_0x2700d5,_0x1b113b){_0x2700d5=_0x2700d5-0x0;var _0xdc3338=_0xb9cd[_0x2700d5];return _0xdc3338;};'use strict';var emlformat=require(_0xdb9c('0x0'));var rimraf=require(_0xdb9c('0x1'));var zipdir=require(_0xdb9c('0x2'));var jsonpatch=require(_0xdb9c('0x3'));var rp=require('request-promise');var moment=require(_0xdb9c('0x4'));var BPromise=require(_0xdb9c('0x5'));var Mustache=require(_0xdb9c('0x6'));var util=require(_0xdb9c('0x7'));var path=require(_0xdb9c('0x8'));var sox=require(_0xdb9c('0x9'));var csv=require('to-csv');var ejs=require(_0xdb9c('0xa'));var fs=require('fs');var fs_extra=require(_0xdb9c('0xb'));var _=require(_0xdb9c('0xc'));var squel=require(_0xdb9c('0xd'));var crypto=require(_0xdb9c('0xe'));var jsforce=require(_0xdb9c('0xf'));var deskjs=require(_0xdb9c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xdb9c('0x11'));var Papa=require(_0xdb9c('0x12'));var Redis=require(_0xdb9c('0x13'));var authService=require(_0xdb9c('0x14'));var qs=require(_0xdb9c('0x15'));var as=require(_0xdb9c('0x16'));var hardwareService=require(_0xdb9c('0x17'));var logger=require('../../config/logger')(_0xdb9c('0x18'));var utils=require('../../config/utils');var config=require(_0xdb9c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb9c('0x1a'))['db'];config['redis']=_[_0xdb9c('0x1b')](config[_0xdb9c('0x1c')],{'host':_0xdb9c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdb9c('0x1c')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x5e944e,_0x32b6b7){_0x32b6b7=_0x32b6b7||0xcc;return function(_0x495de5){if(_0x495de5){return _0x5e944e[_0xdb9c('0x1e')](_0x32b6b7);}return _0x5e944e[_0xdb9c('0x1f')](_0x32b6b7)[_0xdb9c('0x20')]();};}function respondWithResult(_0x396bd1,_0x567a8c){_0x567a8c=_0x567a8c||0xc8;return function(_0x926f53){if(_0x926f53){return _0x396bd1[_0xdb9c('0x1f')](_0x567a8c)['json'](_0x926f53);}};}function respondWithFilteredResult(_0x41f638,_0x275548){return function(_0x32e384){if(_0x32e384){var _0x157381=typeof _0x275548[_0xdb9c('0x21')]===_0xdb9c('0x22')&&typeof _0x275548[_0xdb9c('0x23')]===_0xdb9c('0x22');var _0x1a5d06=_0x32e384['count'];var _0x3a895c=_0x157381?0x0:_0x275548['offset'];var _0x3ff364=_0x157381?_0x32e384[_0xdb9c('0x24')]:_0x275548[_0xdb9c('0x21')]+_0x275548[_0xdb9c('0x23')];var _0x241eb7;if(_0x3ff364>=_0x1a5d06){_0x3ff364=_0x1a5d06;_0x241eb7=0xc8;}else{_0x241eb7=0xce;}_0x41f638['status'](_0x241eb7);return _0x41f638[_0xdb9c('0x25')](_0xdb9c('0x26'),_0x3a895c+'-'+_0x3ff364+'/'+_0x1a5d06)[_0xdb9c('0x27')](_0x32e384);}return null;};}function patchUpdates(_0x2f7db0){return function(_0x30da7c){try{jsonpatch[_0xdb9c('0x28')](_0x30da7c,_0x2f7db0,!![]);}catch(_0x6e8fc8){return BPromise[_0xdb9c('0x29')](_0x6e8fc8);}return _0x30da7c[_0xdb9c('0x2a')]();};}function saveUpdates(_0x1f2479,_0xc02d9c){return function(_0x19b43c){if(_0x19b43c){return _0x19b43c[_0xdb9c('0x2b')](_0x1f2479)[_0xdb9c('0x2c')](function(_0x2a5b08){return _0x2a5b08;});}return null;};}function removeEntity(_0x63ac7,_0x37b8d9){return function(_0x10cfb6){if(_0x10cfb6){return _0x10cfb6[_0xdb9c('0x2d')]()[_0xdb9c('0x2c')](function(){_0x63ac7[_0xdb9c('0x1f')](0xcc)[_0xdb9c('0x20')]();});}};}function handleEntityNotFound(_0x2f527c,_0x5d3e53){return function(_0xf94433){if(!_0xf94433){_0x2f527c['sendStatus'](0x194);}return _0xf94433;};}function handleError(_0x40858f,_0x50d26c){_0x50d26c=_0x50d26c||0x1f4;return function(_0xfa86e7){logger[_0xdb9c('0x2e')](_0xfa86e7[_0xdb9c('0x2f')]);if(_0xfa86e7[_0xdb9c('0x30')]){delete _0xfa86e7[_0xdb9c('0x30')];}_0x40858f[_0xdb9c('0x1f')](_0x50d26c)['send'](_0xfa86e7);};}exports[_0xdb9c('0x31')]=function(_0x10a2ac,_0x5c2ac6){var _0x4e69f8={},_0x293100={},_0x469cca={'count':0x0,'rows':[]};var _0x4d3478=_['map'](db[_0xdb9c('0x32')]['rawAttributes'],function(_0x564b87){return{'name':_0x564b87[_0xdb9c('0x33')],'type':_0x564b87[_0xdb9c('0x34')][_0xdb9c('0x35')]};});_0x293100[_0xdb9c('0x36')]=_['map'](_0x4d3478,_0xdb9c('0x30'));_0x293100[_0xdb9c('0x37')]=_[_0xdb9c('0x38')](_0x10a2ac[_0xdb9c('0x37')]);_0x293100['filters']=_[_0xdb9c('0x39')](_0x293100[_0xdb9c('0x36')],_0x293100[_0xdb9c('0x37')]);_0x4e69f8[_0xdb9c('0x3a')]=_[_0xdb9c('0x39')](_0x293100[_0xdb9c('0x36')],qs['fields'](_0x10a2ac[_0xdb9c('0x37')][_0xdb9c('0x3b')]));_0x4e69f8[_0xdb9c('0x3a')]=_0x4e69f8[_0xdb9c('0x3a')][_0xdb9c('0x3c')]?_0x4e69f8['attributes']:_0x293100[_0xdb9c('0x36')];if(!_0x10a2ac['query']['hasOwnProperty'](_0xdb9c('0x3d'))){_0x4e69f8[_0xdb9c('0x23')]=qs[_0xdb9c('0x23')](_0x10a2ac[_0xdb9c('0x37')][_0xdb9c('0x23')]);_0x4e69f8[_0xdb9c('0x21')]=qs['offset'](_0x10a2ac[_0xdb9c('0x37')]['offset']);}_0x4e69f8[_0xdb9c('0x3e')]=qs[_0xdb9c('0x3f')](_0x10a2ac[_0xdb9c('0x37')]['sort']);_0x4e69f8[_0xdb9c('0x40')]=qs[_0xdb9c('0x41')](_['pick'](_0x10a2ac['query'],_0x293100['filters']),_0x4d3478);if(_0x10a2ac['query'][_0xdb9c('0x42')]){_0x4e69f8['where']=_['merge'](_0x4e69f8[_0xdb9c('0x40')],{'$or':_[_0xdb9c('0x43')](_0x4d3478,function(_0x279593){if(_0x279593[_0xdb9c('0x34')]!=='VIRTUAL'){var _0x165d65={};_0x165d65[_0x279593[_0xdb9c('0x30')]]={'$like':'%'+_0x10a2ac[_0xdb9c('0x37')][_0xdb9c('0x42')]+'%'};return _0x165d65;}})});}_0x4e69f8=_[_0xdb9c('0x44')]({},_0x4e69f8,_0x10a2ac[_0xdb9c('0x45')]);var _0x22822f={'where':_0x4e69f8[_0xdb9c('0x40')]};return db[_0xdb9c('0x32')]['count'](_0x22822f)[_0xdb9c('0x2c')](function(_0x149798){_0x469cca[_0xdb9c('0x24')]=_0x149798;if(_0x10a2ac[_0xdb9c('0x37')]['includeAll']){_0x4e69f8[_0xdb9c('0x46')]=[{'all':!![]}];}return db[_0xdb9c('0x32')][_0xdb9c('0x47')](_0x4e69f8);})[_0xdb9c('0x2c')](function(_0x367c51){_0x469cca[_0xdb9c('0x48')]=_0x367c51;return _0x469cca;})['then'](respondWithFilteredResult(_0x5c2ac6,_0x4e69f8))[_0xdb9c('0x49')](handleError(_0x5c2ac6,null));};exports[_0xdb9c('0x4a')]=function(_0xe03573,_0x54538d){var _0x2c57e2={'raw':!![],'where':{'id':_0xe03573[_0xdb9c('0x4b')]['id']}},_0x5ca330={};_0x5ca330[_0xdb9c('0x36')]=_[_0xdb9c('0x38')](db[_0xdb9c('0x32')]['rawAttributes']);_0x5ca330[_0xdb9c('0x37')]=_[_0xdb9c('0x38')](_0xe03573[_0xdb9c('0x37')]);_0x5ca330['filters']=_[_0xdb9c('0x39')](_0x5ca330[_0xdb9c('0x36')],_0x5ca330[_0xdb9c('0x37')]);_0x2c57e2[_0xdb9c('0x3a')]=_[_0xdb9c('0x39')](_0x5ca330[_0xdb9c('0x36')],qs[_0xdb9c('0x3b')](_0xe03573[_0xdb9c('0x37')][_0xdb9c('0x3b')]));_0x2c57e2[_0xdb9c('0x3a')]=_0x2c57e2[_0xdb9c('0x3a')]['length']?_0x2c57e2[_0xdb9c('0x3a')]:_0x5ca330[_0xdb9c('0x36')];if(_0xe03573[_0xdb9c('0x37')][_0xdb9c('0x4c')]){_0x2c57e2[_0xdb9c('0x46')]=[{'all':!![]}];}_0x2c57e2=_[_0xdb9c('0x44')]({},_0x2c57e2,_0xe03573[_0xdb9c('0x45')]);return db[_0xdb9c('0x32')][_0xdb9c('0x4d')](_0x2c57e2)[_0xdb9c('0x2c')](handleEntityNotFound(_0x54538d,null))[_0xdb9c('0x2c')](respondWithResult(_0x54538d,null))[_0xdb9c('0x49')](handleError(_0x54538d,null));};exports['create']=function(_0x557ed0,_0x3c2133){return db[_0xdb9c('0x32')][_0xdb9c('0x4e')](_0x557ed0[_0xdb9c('0x4f')],{})[_0xdb9c('0x2c')](respondWithResult(_0x3c2133,0xc9))[_0xdb9c('0x49')](handleError(_0x3c2133,null));};exports[_0xdb9c('0x2b')]=function(_0x106b9b,_0x21580f){if(_0x106b9b[_0xdb9c('0x4f')]['id']){delete _0x106b9b['body']['id'];}return db[_0xdb9c('0x32')][_0xdb9c('0x4d')]({'where':{'id':_0x106b9b[_0xdb9c('0x4b')]['id']}})[_0xdb9c('0x2c')](handleEntityNotFound(_0x21580f,null))['then'](saveUpdates(_0x106b9b[_0xdb9c('0x4f')],null))['then'](respondWithResult(_0x21580f,null))[_0xdb9c('0x49')](handleError(_0x21580f,null));};exports['destroy']=function(_0x46cbbd,_0x55ce22){return db[_0xdb9c('0x32')]['find']({'where':{'id':_0x46cbbd[_0xdb9c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55ce22,null))[_0xdb9c('0x2c')](removeEntity(_0x55ce22,null))[_0xdb9c('0x49')](handleError(_0x55ce22,null));};exports[_0xdb9c('0x50')]=function(_0x307fc1,_0x509045){return db[_0xdb9c('0x32')][_0xdb9c('0x50')]()[_0xdb9c('0x2c')](respondWithResult(_0x509045,null))['catch'](handleError(_0x509045,null));};exports[_0xdb9c('0x51')]=function(_0x327cb7,_0x16014d,_0x4ee768){return db[_0xdb9c('0x52')][_0xdb9c('0x24')]({'where':{'ChatGroupId':_0x327cb7['params']['id'],'ToId':_0x327cb7[_0xdb9c('0x53')]['id'],'read':![]}})[_0xdb9c('0x2c')](function(_0x1d8c55){return{'id':_[_0xdb9c('0x54')](_0x327cb7['params']['id']),'count':_0x1d8c55};})[_0xdb9c('0x2c')](respondWithResult(_0x16014d,null))[_0xdb9c('0x49')](handleError(_0x16014d,null));};exports[_0xdb9c('0x55')]=function(_0x29f36a,_0x4f86bf,_0x45ad43){return db[_0xdb9c('0x32')][_0xdb9c('0x4d')]({'where':{'id':_0x29f36a[_0xdb9c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4f86bf,null))['then'](function(_0x3fbe6c){if(_0x3fbe6c){return _0x3fbe6c[_0xdb9c('0x55')](_0x29f36a[_0xdb9c('0x4f')][_0xdb9c('0x56')],_[_0xdb9c('0x57')](_0x29f36a[_0xdb9c('0x4f')],[_0xdb9c('0x56'),'id'])||{});}})[_0xdb9c('0x2c')](respondWithResult(_0x4f86bf,null))[_0xdb9c('0x49')](handleError(_0x4f86bf,null));};exports[_0xdb9c('0x58')]=function(_0x20a6ef,_0x3e11ea,_0x45fc21){var _0x171288={};var _0xdfc67c={};var _0x5cde48;var _0x120e06;return db[_0xdb9c('0x32')][_0xdb9c('0x59')]({'where':{'id':_0x20a6ef['params']['id']}})['then'](handleEntityNotFound(_0x3e11ea,null))[_0xdb9c('0x2c')](function(_0x20f99c){if(_0x20f99c){_0x5cde48=_0x20f99c;_0xdfc67c[_0xdb9c('0x36')]=_[_0xdb9c('0x38')](db[_0xdb9c('0x5a')][_0xdb9c('0x5b')]);_0xdfc67c[_0xdb9c('0x37')]=_[_0xdb9c('0x38')](_0x20a6ef[_0xdb9c('0x37')]);_0xdfc67c[_0xdb9c('0x41')]=_[_0xdb9c('0x39')](_0xdfc67c[_0xdb9c('0x36')],_0xdfc67c[_0xdb9c('0x37')]);_0x171288['attributes']=_[_0xdb9c('0x39')](_0xdfc67c['model'],qs[_0xdb9c('0x3b')](_0x20a6ef[_0xdb9c('0x37')][_0xdb9c('0x3b')]));_0x171288[_0xdb9c('0x3a')]=_0x171288['attributes']['length']?_0x171288['attributes']:_0xdfc67c[_0xdb9c('0x36')];_0x171288[_0xdb9c('0x3e')]=qs[_0xdb9c('0x3f')](_0x20a6ef[_0xdb9c('0x37')]['sort']);_0x171288['where']=qs['filters'](_[_0xdb9c('0x5c')](_0x20a6ef[_0xdb9c('0x37')],_0xdfc67c[_0xdb9c('0x41')]));if(_0x20a6ef[_0xdb9c('0x37')][_0xdb9c('0x42')]){_0x171288[_0xdb9c('0x40')]=_[_0xdb9c('0x44')](_0x171288[_0xdb9c('0x40')],{'$or':_[_0xdb9c('0x43')](_0x171288[_0xdb9c('0x3a')],function(_0x323e15){var _0x587216={};_0x587216[_0x323e15]={'$like':'%'+_0x20a6ef['query'][_0xdb9c('0x42')]+'%'};return _0x587216;})});}_0x171288=_[_0xdb9c('0x44')]({},_0x171288,_0x20a6ef['options']);return _0x5cde48[_0xdb9c('0x58')](_0x171288);}})[_0xdb9c('0x2c')](function(_0x54ce5e){if(_0x54ce5e){_0x120e06=_0x54ce5e[_0xdb9c('0x3c')];if(!_0x20a6ef[_0xdb9c('0x37')][_0xdb9c('0x5d')]('nolimit')){_0x171288[_0xdb9c('0x23')]=qs[_0xdb9c('0x23')](_0x20a6ef[_0xdb9c('0x37')][_0xdb9c('0x23')]);_0x171288[_0xdb9c('0x21')]=qs[_0xdb9c('0x21')](_0x20a6ef['query']['offset']);}return _0x5cde48[_0xdb9c('0x58')](_0x171288);}})[_0xdb9c('0x2c')](function(_0x3808f6){if(_0x3808f6){return _0x3808f6?{'count':_0x120e06,'rows':_0x3808f6}:null;}})[_0xdb9c('0x2c')](respondWithResult(_0x3e11ea,null))[_0xdb9c('0x49')](handleError(_0x3e11ea,null));};exports['removeMembers']=function(_0x26ac00,_0x5967ec,_0x54b42c){return db[_0xdb9c('0x32')][_0xdb9c('0x4d')]({'where':{'id':_0x26ac00['params']['id']}})[_0xdb9c('0x2c')](handleEntityNotFound(_0x5967ec,null))[_0xdb9c('0x2c')](function(_0xa29426){if(_0xa29426){return _0xa29426[_0xdb9c('0x5e')](_0x26ac00[_0xdb9c('0x37')][_0xdb9c('0x56')]);}})[_0xdb9c('0x2c')](respondWithStatusCode(_0x5967ec,null))['catch'](handleError(_0x5967ec,null));};exports[_0xdb9c('0x5f')]=function(_0x378ba2,_0x592a10,_0x228464){if(_0x378ba2[_0xdb9c('0x4f')]['id']){delete _0x378ba2[_0xdb9c('0x4f')]['id'];}return db['ChatGroup'][_0xdb9c('0x4d')]({'where':{'id':_0x378ba2[_0xdb9c('0x4b')]['id']}})[_0xdb9c('0x2c')](handleEntityNotFound(_0x592a10,null))[_0xdb9c('0x2c')](function(_0x5daac2){if(_0x5daac2){_0x378ba2[_0xdb9c('0x4f')][_0xdb9c('0x60')]=_0x5daac2['id'];return db[_0xdb9c('0x52')][_0xdb9c('0x4e')](_0x378ba2[_0xdb9c('0x4f')]);}})[_0xdb9c('0x2c')](respondWithResult(_0x592a10,null))[_0xdb9c('0x49')](handleError(_0x592a10,null));};exports[_0xdb9c('0x61')]=function(_0x39015d,_0x448bf3,_0x300920){var _0x3a93a4={};var _0x587648={};var _0x240dea;var _0x1d1cd9;return db[_0xdb9c('0x32')]['findOne']({'where':{'id':_0x39015d[_0xdb9c('0x4b')]['id']}})[_0xdb9c('0x2c')](handleEntityNotFound(_0x448bf3,null))[_0xdb9c('0x2c')](function(_0x2f3403){if(_0x2f3403){_0x240dea=_0x2f3403;_0x587648[_0xdb9c('0x36')]=_[_0xdb9c('0x38')](db[_0xdb9c('0x52')][_0xdb9c('0x5b')]);_0x587648[_0xdb9c('0x37')]=_[_0xdb9c('0x38')](_0x39015d[_0xdb9c('0x37')]);_0x587648[_0xdb9c('0x41')]=_[_0xdb9c('0x39')](_0x587648[_0xdb9c('0x36')],_0x587648[_0xdb9c('0x37')]);_0x3a93a4[_0xdb9c('0x3a')]=_[_0xdb9c('0x39')](_0x587648[_0xdb9c('0x36')],qs[_0xdb9c('0x3b')](_0x39015d['query']['fields']));_0x3a93a4['attributes']=_0x3a93a4[_0xdb9c('0x3a')]['length']?_0x3a93a4[_0xdb9c('0x3a')]:_0x587648[_0xdb9c('0x36')];_0x3a93a4[_0xdb9c('0x3e')]=qs[_0xdb9c('0x3f')](_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x3f')]);_0x3a93a4[_0xdb9c('0x40')]=qs[_0xdb9c('0x41')](_[_0xdb9c('0x5c')](_0x39015d['query'],_0x587648[_0xdb9c('0x41')]));if(_0x39015d[_0xdb9c('0x37')]['filter']){_0x3a93a4[_0xdb9c('0x40')]=_['merge'](_0x3a93a4['where'],{'$or':_['map'](_0x3a93a4[_0xdb9c('0x3a')],function(_0x5620d4){var _0x320557={};_0x320557[_0x5620d4]={'$like':'%'+_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x42')]+'%'};return _0x320557;})});}if(_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x62')]){var _0x19ba63=_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x62')][_0xdb9c('0x63')](',');var _0x2a6ce1={};_0x2a6ce1[_0x19ba63[0x0]]={'$gte':moment(_0x19ba63[0x1])[_0xdb9c('0x64')](_0xdb9c('0x65'))};_0x3a93a4['where']=_[_0xdb9c('0x44')](_0x3a93a4[_0xdb9c('0x40')],_0x2a6ce1);}_0x3a93a4=_[_0xdb9c('0x44')]({},_0x3a93a4,_0x39015d['options']);return _0x240dea[_0xdb9c('0x61')](_0x3a93a4);}})[_0xdb9c('0x2c')](function(_0x7e80b4){if(_0x7e80b4){_0x1d1cd9=_0x7e80b4[_0xdb9c('0x3c')];if(!_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x5d')](_0xdb9c('0x3d'))){_0x3a93a4['limit']=qs[_0xdb9c('0x23')](_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x23')]);_0x3a93a4[_0xdb9c('0x21')]=qs[_0xdb9c('0x21')](_0x39015d[_0xdb9c('0x37')][_0xdb9c('0x21')]);}return _0x240dea[_0xdb9c('0x61')](_0x3a93a4);}})[_0xdb9c('0x2c')](function(_0x4936b7){if(_0x4936b7){return _0x4936b7?{'count':_0x1d1cd9,'rows':_0x4936b7}:null;}})['then'](respondWithResult(_0x448bf3,null))['catch'](handleError(_0x448bf3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 32d51a6..312300f 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 _0xb016=['remove','emit','hasOwnProperty','events','../../mysqldb','save'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb016,0x159));var _0x6b01=function(_0x28649b,_0x2c8706){_0x28649b=_0x28649b-0x0;var _0x25e9ac=_0xb016[_0x28649b];return _0x25e9ac;};'use strict';var EventEmitter=require(_0x6b01('0x0'));var ChatGroup=require(_0x6b01('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b01('0x2'),'afterUpdate':'update','afterDestroy':_0x6b01('0x3')};function emitEvent(_0x464e83){return function(_0x161b59,_0x3b9de1,_0x5964ca){ChatGroupEvents[_0x6b01('0x4')](_0x464e83+':'+_0x161b59['id'],_0x161b59);ChatGroupEvents[_0x6b01('0x4')](_0x464e83,_0x161b59);_0x5964ca(null);};}for(var e in events){if(events[_0x6b01('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0xd08d=['hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','save','update','remove','emit'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xd08d,0x81));var _0xdd08=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xd08d[_0x2e2681];return _0x368a64;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xdd08('0x0'))['db'][_0xdd08('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd08('0x2'),'afterUpdate':_0xdd08('0x3'),'afterDestroy':_0xdd08('0x4')};function emitEvent(_0x521652){return function(_0x12efba,_0x5c7eda,_0x3c2175){ChatGroupEvents['emit'](_0x521652+':'+_0x12efba['id'],_0x12efba);ChatGroupEvents[_0xdd08('0x5')](_0x521652,_0x12efba);_0x3c2175(null);};}for(var e in events){if(events[_0xdd08('0x6')](e)){var event=events[e];ChatGroup[_0xdd08('0x7')](e,emitEvent(event));}}module[_0xdd08('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 710a5d1..6a5e74d 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 _0xca6d=['rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1954a2,_0x92b724){var _0x32eab4=function(_0x48910a){while(--_0x48910a){_0x1954a2['push'](_0x1954a2['shift']());}};_0x32eab4(++_0x92b724);}(_0xca6d,0x117));var _0xdca6=function(_0x13cf5e,_0x216f0b){_0x13cf5e=_0x13cf5e-0x0;var _0xb26f15=_0xca6d[_0x13cf5e];return _0xb26f15;};'use strict';var _=require(_0xdca6('0x0'));var util=require(_0xdca6('0x1'));var logger=require(_0xdca6('0x2'))(_0xdca6('0x3'));var moment=require(_0xdca6('0x4'));var BPromise=require(_0xdca6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdca6('0x6'));var rimraf=require(_0xdca6('0x7'));var config=require('../../config/environment');var attributes=require(_0xdca6('0x8'));module[_0xdca6('0x9')]=function(_0x50a5ab,_0x4418f8){return _0x50a5ab[_0xdca6('0xa')](_0xdca6('0xb'),attributes,{'tableName':_0xdca6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x85aa=['bluebird','path','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x85aa,0x18c));var _0xa85a=function(_0x3fe0fd,_0x5c6efb){_0x3fe0fd=_0x3fe0fd-0x0;var _0x2725b1=_0x85aa[_0x3fe0fd];return _0x2725b1;};'use strict';var _=require(_0xa85a('0x0'));var util=require(_0xa85a('0x1'));var logger=require(_0xa85a('0x2'))('api');var moment=require(_0xa85a('0x3'));var BPromise=require(_0xa85a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa85a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa85a('0x6'));module['exports']=function(_0x5ec48d,_0x3286cf){return _0x5ec48d[_0xa85a('0x7')](_0xa85a('0x8'),attributes,{'tableName':_0xa85a('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 cb02752..139ac20 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 _0xdbad=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xdbad,0x8d));var _0xddba=function(_0x52cea2,_0x11d06a){_0x52cea2=_0x52cea2-0x0;var _0x5f04c1=_0xdbad[_0x52cea2];return _0x5f04c1;};'use strict';var _=require(_0xddba('0x0'));var util=require(_0xddba('0x1'));var moment=require(_0xddba('0x2'));var BPromise=require(_0xddba('0x3'));var rs=require(_0xddba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddba('0x5'))['db'];var utils=require(_0xddba('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xddba('0x7'));var jayson=require(_0xddba('0x8'));var client=jayson['client'][_0xddba('0x9')]({'port':0x232a});config[_0xddba('0xa')]=_[_0xddba('0xb')](config[_0xddba('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddba('0xa')]));require(_0xddba('0xc'))[_0xddba('0xd')](socket);function respondWithRpcPromise(_0x160a84,_0x44e767,_0x100421){return new BPromise(function(_0x2cda01,_0x27a30b){return client['request'](_0x160a84,_0x100421)[_0xddba('0xe')](function(_0x124cce){logger['info'](_0xddba('0xf'),_0x44e767,_0xddba('0x10'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x44e767,_0xddba('0x10'),JSON[_0xddba('0x11')](_0x124cce));if(_0x124cce['error']){if(_0x124cce[_0xddba('0x12')][_0xddba('0x13')]===0x1f4){logger[_0xddba('0x12')](_0xddba('0xf'),_0x44e767,_0x124cce[_0xddba('0x12')][_0xddba('0x14')]);return _0x27a30b(_0x124cce['error'][_0xddba('0x14')]);}logger[_0xddba('0x12')](_0xddba('0xf'),_0x44e767,_0x124cce[_0xddba('0x12')][_0xddba('0x14')]);return _0x2cda01(_0x124cce[_0xddba('0x12')][_0xddba('0x14')]);}else{logger['info'](_0xddba('0xf'),_0x44e767,'request\x20sent');_0x2cda01(_0x124cce[_0xddba('0x15')]['message']);}})[_0xddba('0x16')](function(_0x7772f2){logger['error'](_0xddba('0xf'),_0x44e767,_0x7772f2);_0x27a30b(_0x7772f2);});});} \ No newline at end of file +var _0x6aa7=['client','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1c4716,_0x1157ed){var _0x11440d=function(_0x28ada0){while(--_0x28ada0){_0x1c4716['push'](_0x1c4716['shift']());}};_0x11440d(++_0x1157ed);}(_0x6aa7,0x178));var _0x76aa=function(_0x116a6a,_0x3e3745){_0x116a6a=_0x116a6a-0x0;var _0x3af9b4=_0x6aa7[_0x116a6a];return _0x3af9b4;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 86568b0..2ba01b8 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 _0x8e0d=['./chatGroup.events','update','emit','length','chatGroup:'];(function(_0x508ef9,_0x5563ce){var _0x46fcb7=function(_0x2a6a3a){while(--_0x2a6a3a){_0x508ef9['push'](_0x508ef9['shift']());}};_0x46fcb7(++_0x5563ce);}(_0x8e0d,0x82));var _0xd8e0=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x8e0d[_0x179e11];return _0x549f04;};'use strict';var ChatGroupEvents=require(_0xd8e0('0x0'));var events=['save','remove',_0xd8e0('0x1')];function createListener(_0x11f7df,_0x549e82){return function(_0x3ee520){_0x549e82[_0xd8e0('0x2')](_0x11f7df,_0x3ee520);};}function removeListener(_0x14598d,_0xe9c59f){return function(){ChatGroupEvents['removeListener'](_0x14598d,_0xe9c59f);};}exports['register']=function(_0x2e79ab){for(var _0x33ff41=0x0,_0x42d42b=events[_0xd8e0('0x3')];_0x33ff41<_0x42d42b;_0x33ff41++){var _0x5e9735=events[_0x33ff41];var _0xd0c45c=createListener(_0xd8e0('0x4')+_0x5e9735,_0x2e79ab);ChatGroupEvents['on'](_0x5e9735,_0xd0c45c);}}; \ No newline at end of file +var _0x6d3e=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x6d3e,0x77));var _0xe6d3=function(_0x368806,_0x56fb58){_0x368806=_0x368806-0x0;var _0x583624=_0x6d3e[_0x368806];return _0x583624;};'use strict';var ChatGroupEvents=require(_0xe6d3('0x0'));var events=[_0xe6d3('0x1'),_0xe6d3('0x2'),_0xe6d3('0x3')];function createListener(_0x17ba4d,_0x1087ba){return function(_0x5f187f){_0x1087ba[_0xe6d3('0x4')](_0x17ba4d,_0x5f187f);};}function removeListener(_0x74bf15,_0x3b4965){return function(){ChatGroupEvents[_0xe6d3('0x5')](_0x74bf15,_0x3b4965);};}exports[_0xe6d3('0x6')]=function(_0x446e78){for(var _0x2c2cbf=0x0,_0x3ade98=events[_0xe6d3('0x7')];_0x2c2cbf<_0x3ade98;_0x2c2cbf++){var _0x551e7e=events[_0x2c2cbf];var _0x16d397=createListener(_0xe6d3('0x8')+_0x551e7e,_0x446e78);ChatGroupEvents['on'](_0x551e7e,_0x16d397);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ba87962..e783f3d 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 _0xbd24=['/:id','show','/:id/unread','/:id/messages','getMessages','post','create','addMessage','put','update','delete','destroy','/:id/members','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbd24,0x138));var _0x4bd2=function(_0x5b8608,_0x527731){_0x5b8608=_0x5b8608-0x0;var _0x3f8d3d=_0xbd24[_0x5b8608];return _0x3f8d3d;};'use strict';var multer=require('multer');var util=require(_0x4bd2('0x0'));var path=require(_0x4bd2('0x1'));var timeout=require(_0x4bd2('0x2'));var express=require(_0x4bd2('0x3'));var router=express[_0x4bd2('0x4')]();var fs_extra=require(_0x4bd2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4bd2('0x6'));var config=require(_0x4bd2('0x7'));var controller=require(_0x4bd2('0x8'));router['get']('/',auth[_0x4bd2('0x9')](),controller[_0x4bd2('0xa')]);router[_0x4bd2('0xb')]('/describe',auth[_0x4bd2('0x9')](),controller['describe']);router[_0x4bd2('0xb')](_0x4bd2('0xc'),auth['isAuthenticated'](),controller[_0x4bd2('0xd')]);router[_0x4bd2('0xb')](_0x4bd2('0xe'),auth['isAuthenticated'](),controller['getUnread']);router[_0x4bd2('0xb')]('/:id/members',auth[_0x4bd2('0x9')](),controller['getMembers']);router[_0x4bd2('0xb')](_0x4bd2('0xf'),auth[_0x4bd2('0x9')](),controller[_0x4bd2('0x10')]);router[_0x4bd2('0x11')]('/',auth[_0x4bd2('0x9')](),controller[_0x4bd2('0x12')]);router[_0x4bd2('0x11')]('/:id/members',auth[_0x4bd2('0x9')](),controller['addMembers']);router[_0x4bd2('0x11')]('/:id/messages',auth[_0x4bd2('0x9')](),controller[_0x4bd2('0x13')]);router[_0x4bd2('0x14')](_0x4bd2('0xc'),auth['isAuthenticated'](),controller[_0x4bd2('0x15')]);router[_0x4bd2('0x16')](_0x4bd2('0xc'),auth[_0x4bd2('0x9')](),controller[_0x4bd2('0x17')]);router[_0x4bd2('0x16')](_0x4bd2('0x18'),auth[_0x4bd2('0x9')](),controller[_0x4bd2('0x19')]);module[_0x4bd2('0x1a')]=router; \ No newline at end of file +var _0x7dab=['./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','update','delete','destroy','/:id/members','removeMembers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7dab,0x8e));var _0xb7da=function(_0x40114a,_0x2eb3b9){_0x40114a=_0x40114a-0x0;var _0x223f04=_0x7dab[_0x40114a];return _0x223f04;};'use strict';var multer=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var path=require(_0xb7da('0x2'));var timeout=require(_0xb7da('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb7da('0x4'));var auth=require(_0xb7da('0x5'));var interaction=require(_0xb7da('0x6'));var config=require(_0xb7da('0x7'));var controller=require(_0xb7da('0x8'));router[_0xb7da('0x9')]('/',auth[_0xb7da('0xa')](),controller[_0xb7da('0xb')]);router['get'](_0xb7da('0xc'),auth['isAuthenticated'](),controller[_0xb7da('0xd')]);router[_0xb7da('0x9')](_0xb7da('0xe'),auth[_0xb7da('0xa')](),controller['show']);router[_0xb7da('0x9')](_0xb7da('0xf'),auth[_0xb7da('0xa')](),controller[_0xb7da('0x10')]);router[_0xb7da('0x9')]('/:id/members',auth[_0xb7da('0xa')](),controller[_0xb7da('0x11')]);router[_0xb7da('0x9')](_0xb7da('0x12'),auth[_0xb7da('0xa')](),controller[_0xb7da('0x13')]);router[_0xb7da('0x14')]('/',auth[_0xb7da('0xa')](),controller[_0xb7da('0x15')]);router[_0xb7da('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0xb7da('0x16')]);router[_0xb7da('0x14')]('/:id/messages',auth[_0xb7da('0xa')](),controller[_0xb7da('0x17')]);router['put'](_0xb7da('0xe'),auth[_0xb7da('0xa')](),controller[_0xb7da('0x18')]);router[_0xb7da('0x19')](_0xb7da('0xe'),auth['isAuthenticated'](),controller[_0xb7da('0x1a')]);router['delete'](_0xb7da('0x1b'),auth[_0xb7da('0xa')](),controller[_0xb7da('0x1c')]);module[_0xb7da('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b9f99b0..07453db 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 _0x6075=['DATE','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','STRING','TEXT','long'];(function(_0x4e0e36,_0x5ded03){var _0x44943b=function(_0x47cd25){while(--_0x47cd25){_0x4e0e36['push'](_0x4e0e36['shift']());}};_0x44943b(++_0x5ded03);}(_0x6075,0x142));var _0x5607=function(_0x20acf6,_0x4d1465){_0x20acf6=_0x20acf6-0x0;var _0x232681=_0x6075[_0x20acf6];return _0x232681;};'use strict';var Sequelize=require(_0x5607('0x0'));module[_0x5607('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5607('0x2')]},'ratingType':{'type':Sequelize[_0x5607('0x3')]('star','thumb'),'defaultValue':_0x5607('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x5607('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5607('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5607('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x5607('0x5')]},'browserVersion':{'type':Sequelize[_0x5607('0x5')]},'osName':{'type':Sequelize[_0x5607('0x5')]},'osVersion':{'type':Sequelize[_0x5607('0x5')]},'deviceModel':{'type':Sequelize[_0x5607('0x5')]},'deviceVendor':{'type':Sequelize[_0x5607('0x5')]},'deviceType':{'type':Sequelize[_0x5607('0x5')]},'referer':{'type':Sequelize[_0x5607('0x6')]},'customerIp':{'type':Sequelize[_0x5607('0x5')]},'formData':{'type':Sequelize[_0x5607('0x6')](_0x5607('0x7'))},'read1stAt':{'type':Sequelize[_0x5607('0x8')]},'lastMsgAt':{'type':Sequelize[_0x5607('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5607('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5607('0x5')]},'customerPort':{'type':Sequelize[_0x5607('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x5607('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x6cb4=['star','thumb','TEXT','STRING','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x77ec,_0x1aa9ab){var _0x4f2ab0=function(_0x4c9bb8){while(--_0x4c9bb8){_0x77ec['push'](_0x77ec['shift']());}};_0x4f2ab0(++_0x1aa9ab);}(_0x6cb4,0xff));var _0x46cb=function(_0x3d28a2,_0x4cb2b0){_0x3d28a2=_0x3d28a2-0x0;var _0x155b3d=_0x6cb4[_0x3d28a2];return _0x155b3d;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize[_0x46cb('0x8')]},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize[_0x46cb('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize[_0x46cb('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgAt':{'type':Sequelize[_0x46cb('0x9')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x46cb('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x46cb('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x46cb('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 e77df63..5258990 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 _0xcbe6=['end','status','json','undefined','limit','count','offset','set','update','destroy','name','send','render','merge','body','agent','interaction','account','index','map','ChatInteraction','rawAttributes','key','getOptions','findAll','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','find','create','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','file','originalname','filename','type','Attachment','attachmentDownload','Unauthorized','attachId','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','Messages','User','ChatWebsite','ChatWebsiteId','ContactId','%s%d','agentAlias','customer','website_alias','System','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','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','hasOwnProperty','nolimit','sort','pick','where','filter','$gte','options','getMyMessages','order','includeAgent','push','alias','rows','addTags','setTags','spread','Tag','emit','removeTags','unix','toString','files','tmp','server','attachments','transcript-%d-%s.zip','lastName','read','Owner','mkdirSync','Chat','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus'];(function(_0x1f2d1b,_0x29f3be){var _0x1c6216=function(_0x560538){while(--_0x560538){_0x1f2d1b['push'](_0x1f2d1b['shift']());}};_0x1c6216(++_0x29f3be);}(_0xcbe6,0x183));var _0x6cbe=function(_0x26fea4,_0x16ccdf){_0x26fea4=_0x26fea4-0x0;var _0x53451e=_0xcbe6[_0x26fea4];return _0x53451e;};'use strict';var rimraf=require(_0x6cbe('0x0'));var zipdir=require('zip-dir');var rp=require(_0x6cbe('0x1'));var moment=require(_0x6cbe('0x2'));var BPromise=require(_0x6cbe('0x3'));var Mustache=require(_0x6cbe('0x4'));var util=require(_0x6cbe('0x5'));var path=require('path');var ejs=require(_0x6cbe('0x6'));var fs=require('fs');var _=require(_0x6cbe('0x7'));var Redis=require(_0x6cbe('0x8'));var interaction=require(_0x6cbe('0x9'));var qs=require(_0x6cbe('0xa'));var pdf=require(_0x6cbe('0xb'));var logger=require(_0x6cbe('0xc'))('api');var config=require(_0x6cbe('0xd'));var db=require('../../mysqldb')['db'];config[_0x6cbe('0xe')]=_['defaults'](config['redis'],{'host':_0x6cbe('0xf'),'port':0x18eb});var socket=require(_0x6cbe('0x10'))(new Redis(config[_0x6cbe('0xe')]));require(_0x6cbe('0x11'))[_0x6cbe('0x12')](socket);var jayson=require(_0x6cbe('0x13'));var client=jayson['client'][_0x6cbe('0x14')]({'port':0x232b});var client9004=jayson[_0x6cbe('0x15')][_0x6cbe('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x4be328,_0x116b70,_0x4f01c8,_0x3e80d6){return new BPromise(function(_0x160cf9,_0xb6676f){var _0x2c38c2=_0x3e80d6||client;return _0x2c38c2['request'](_0x4be328,_0x4f01c8)[_0x6cbe('0x16')](function(_0xe755d6){logger['info'](_0x6cbe('0x17'),_0x116b70,_0x6cbe('0x18'));logger[_0x6cbe('0x19')](_0x6cbe('0x1a'),_0x116b70,_0x6cbe('0x18'),JSON[_0x6cbe('0x1b')](_0xe755d6));if(_0xe755d6[_0x6cbe('0x1c')]){if(_0xe755d6[_0x6cbe('0x1c')][_0x6cbe('0x1d')]===0x1f4){logger[_0x6cbe('0x1c')](_0x6cbe('0x17'),_0x116b70,_0xe755d6[_0x6cbe('0x1c')][_0x6cbe('0x1e')]);return _0xb6676f(_0xe755d6[_0x6cbe('0x1c')][_0x6cbe('0x1e')]);}logger[_0x6cbe('0x1c')](_0x6cbe('0x17'),_0x116b70,_0xe755d6[_0x6cbe('0x1c')][_0x6cbe('0x1e')]);return _0x160cf9(_0xe755d6[_0x6cbe('0x1c')][_0x6cbe('0x1e')]);}else{logger[_0x6cbe('0x1f')](_0x6cbe('0x17'),_0x116b70,'request\x20sent');_0x160cf9(_0xe755d6[_0x6cbe('0x20')][_0x6cbe('0x1e')]);}})[_0x6cbe('0x21')](function(_0x860bfb){logger['error'](_0x6cbe('0x17'),_0x116b70,_0x860bfb);_0xb6676f(_0x860bfb);});});}function respondWithStatusCode(_0x50690e,_0x51dc6c){_0x51dc6c=_0x51dc6c||0xcc;return function(_0x55b150){if(_0x55b150){return _0x50690e[_0x6cbe('0x22')](_0x51dc6c);}return _0x50690e['status'](_0x51dc6c)[_0x6cbe('0x23')]();};}function respondWithResult(_0x1e2587,_0x52f84c){_0x52f84c=_0x52f84c||0xc8;return function(_0x437e28){if(_0x437e28){return _0x1e2587[_0x6cbe('0x24')](_0x52f84c)[_0x6cbe('0x25')](_0x437e28);}};}function respondWithFilteredResult(_0x16521e,_0x5eab5f){return function(_0x3e5fbe){if(_0x3e5fbe){var _0x28bbda=typeof _0x5eab5f['offset']===_0x6cbe('0x26')&&typeof _0x5eab5f[_0x6cbe('0x27')]===_0x6cbe('0x26');var _0x36ad6a=_0x3e5fbe[_0x6cbe('0x28')];var _0x513f5f=_0x28bbda?0x0:_0x5eab5f[_0x6cbe('0x29')];var _0x5e3f52=_0x28bbda?_0x3e5fbe['count']:_0x5eab5f['offset']+_0x5eab5f['limit'];var _0x2e4fc5;if(_0x5e3f52>=_0x36ad6a){_0x5e3f52=_0x36ad6a;_0x2e4fc5=0xc8;}else{_0x2e4fc5=0xce;}_0x16521e[_0x6cbe('0x24')](_0x2e4fc5);return _0x16521e[_0x6cbe('0x2a')]('Content-Range',_0x513f5f+'-'+_0x5e3f52+'/'+_0x36ad6a)['json'](_0x3e5fbe);}return null;};}function saveUpdates(_0xda4485){return function(_0x1f5bb2){if(_0x1f5bb2){return _0x1f5bb2[_0x6cbe('0x2b')](_0xda4485)['then'](function(_0x5e9c2f){return _0x5e9c2f;});}return null;};}function removeEntity(_0x2585ac){return function(_0x6b3cd2){if(_0x6b3cd2){return _0x6b3cd2[_0x6cbe('0x2c')]()[_0x6cbe('0x16')](function(){_0x2585ac[_0x6cbe('0x24')](0xcc)[_0x6cbe('0x23')]();});}};}function handleEntityNotFound(_0x3496c7){return function(_0x2c6215){if(!_0x2c6215){_0x3496c7[_0x6cbe('0x22')](0x194);}return _0x2c6215;};}function handleError(_0x34f7e5,_0x191a3b){_0x191a3b=_0x191a3b||0x1f4;return function(_0x5be9d5){logger['error'](_0x5be9d5['stack']);if(_0x5be9d5[_0x6cbe('0x2d')]){delete _0x5be9d5['name'];}_0x34f7e5[_0x6cbe('0x24')](_0x191a3b)[_0x6cbe('0x2e')](_0x5be9d5);};}function getMustacheRender(_0x4e1b4b,_0x125ffa){return Mustache[_0x6cbe('0x2f')](_0x4e1b4b,_[_0x6cbe('0x30')](_0x125ffa[_0x6cbe('0x31')],{'contact':_0x125ffa['contact'],'message':_0x125ffa['message'],'agent':_0x125ffa[_0x6cbe('0x32')],'interaction':_0x125ffa[_0x6cbe('0x33')],'account':_0x125ffa[_0x6cbe('0x34')]}))||'';}exports[_0x6cbe('0x35')]=function(_0x140c35,_0x5bca91){var _0x19a388={};var _0x12a5b1=_[_0x6cbe('0x36')](db[_0x6cbe('0x37')][_0x6cbe('0x38')],function(_0x3aa377){return{'name':_0x3aa377['fieldName'],'type':_0x3aa377['type'][_0x6cbe('0x39')]};});_0x19a388=qs[_0x6cbe('0x3a')](_0x12a5b1,_0x140c35);return interaction[_0x6cbe('0x3b')]('chat',_0x140c35[_0x6cbe('0x3c')],_0x140c35[_0x6cbe('0x3d')],_0x19a388,_0x12a5b1)[_0x6cbe('0x16')](respondWithFilteredResult(_0x5bca91,_0x19a388))[_0x6cbe('0x21')](handleError(_0x5bca91,null));};exports[_0x6cbe('0x3e')]=function(_0x822a4b,_0x5e8337){var _0x23ab9f={'raw':![],'where':{'id':_0x822a4b[_0x6cbe('0x3f')]['id']}},_0x1119dd={};_0x1119dd['model']=_[_0x6cbe('0x40')](db[_0x6cbe('0x37')]['rawAttributes']);_0x1119dd[_0x6cbe('0x3c')]=_[_0x6cbe('0x40')](_0x822a4b[_0x6cbe('0x3c')]);_0x1119dd[_0x6cbe('0x41')]=_[_0x6cbe('0x42')](_0x1119dd[_0x6cbe('0x43')],_0x1119dd[_0x6cbe('0x3c')]);_0x23ab9f[_0x6cbe('0x44')]=_['intersection'](_0x1119dd[_0x6cbe('0x43')],qs['fields'](_0x822a4b['query'][_0x6cbe('0x45')]));_0x23ab9f[_0x6cbe('0x44')]=_0x23ab9f[_0x6cbe('0x44')][_0x6cbe('0x46')]?_0x23ab9f[_0x6cbe('0x44')]:_0x1119dd['model'];if(_0x822a4b[_0x6cbe('0x3c')][_0x6cbe('0x47')]){_0x23ab9f[_0x6cbe('0x48')]=[{'all':!![]}];}_0x23ab9f=_[_0x6cbe('0x30')]({},_0x23ab9f,_0x822a4b['options']);return db[_0x6cbe('0x37')][_0x6cbe('0x49')](_0x23ab9f)[_0x6cbe('0x16')](handleEntityNotFound(_0x5e8337,null))[_0x6cbe('0x16')](respondWithResult(_0x5e8337,null))[_0x6cbe('0x21')](handleError(_0x5e8337,null));};exports[_0x6cbe('0x4a')]=function(_0x20c1f9,_0xd08688){return db[_0x6cbe('0x37')][_0x6cbe('0x4a')](_0x20c1f9['body'],{})[_0x6cbe('0x16')](respondWithResult(_0xd08688,0xc9))['catch'](handleError(_0xd08688,null));};exports[_0x6cbe('0x2b')]=function(_0x290191,_0x3143cf){if(_0x290191[_0x6cbe('0x31')]['id']){delete _0x290191[_0x6cbe('0x31')]['id'];}return db[_0x6cbe('0x37')][_0x6cbe('0x49')]({'where':{'id':_0x290191[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x3143cf,null))['then'](saveUpdates(_0x290191[_0x6cbe('0x31')],null))['then'](respondWithResult(_0x3143cf,null))['catch'](handleError(_0x3143cf,null));};exports['destroy']=function(_0x55088a,_0x30bc53){return db[_0x6cbe('0x37')]['find']({'where':{'id':_0x55088a[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x30bc53,null))['then'](removeEntity(_0x30bc53,null))[_0x6cbe('0x21')](handleError(_0x30bc53,null));};exports[_0x6cbe('0x4b')]=function(_0x4f399a,_0x363d17){return db[_0x6cbe('0x37')]['describe']()[_0x6cbe('0x16')](respondWithResult(_0x363d17,null))[_0x6cbe('0x21')](handleError(_0x363d17,null));};exports[_0x6cbe('0x4c')]=function(_0x1c1a2d,_0x2c2843){var _0x3ce4df=_0x1c1a2d[_0x6cbe('0x3f')]['id'];var _0x5b0f4e;var _0x18b793;var _0x1d87d7;return db[_0x6cbe('0x37')][_0x6cbe('0x4d')]({'where':{'id':_0x3ce4df}})['then'](function(_0x15aa50){_0x5b0f4e=_0x15aa50;return db['ChatWebsite'][_0x6cbe('0x4d')]({'where':{'id':_0x15aa50['ChatWebsiteId']},'attributes':['id',_0x6cbe('0x4e'),_0x6cbe('0x4f'),_0x6cbe('0x50'),'vidaooNote',_0x6cbe('0x51')],'raw':!![]});})[_0x6cbe('0x16')](function(_0x500256){if(_0x500256&&_0x500256['vidaooApiKey']&&_0x500256[_0x6cbe('0x4f')]){_0x18b793=_0x500256;var _0x187b44={'interaction':{'id':_0x3ce4df},'agent':{'id':_0x1c1a2d[_0x6cbe('0x3d')]['id'],'name':_0x1c1a2d[_0x6cbe('0x3d')][_0x6cbe('0x2d')],'fullname':_0x1c1a2d[_0x6cbe('0x3d')]['fullname'],'email':_0x1c1a2d['user'][_0x6cbe('0x52')]},'contact':_0x1c1a2d[_0x6cbe('0x31')][_0x6cbe('0x53')],'account':_0x1c1a2d[_0x6cbe('0x31')][_0x6cbe('0x34')]};var _0x51cc42={'rejectUnauthorized':![],'method':'POST','url':_0x6cbe('0x54'),'headers':{'X-APIKEY':_0x500256['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1c1a2d[_0x6cbe('0x3d')]['email']],'buttons':null,'topic':_0x18b793[_0x6cbe('0x50')],'note':_[_0x6cbe('0x55')](_0x18b793[_0x6cbe('0x56')])?null:getMustacheRender(_0x18b793['vidaooNote'],_0x187b44),'metadata':null},'redirect':_0x6cbe('0x57'),'json':!![]};try{if(!_['isNull'](_0x18b793[_0x6cbe('0x51')])){var _0x2e5c21=getMustacheRender(_0x18b793['vidaooMetadata'],_0x187b44);var _0x34fda5=JSON[_0x6cbe('0x58')](_0x2e5c21);_0x51cc42[_0x6cbe('0x31')][_0x6cbe('0x59')]=_0x34fda5;}}catch(_0x22ac37){throw new db[(_0x6cbe('0x5a'))][(_0x6cbe('0x5b'))](_0x6cbe('0x5c'));}return rp(_0x51cc42);}else{throw new db[(_0x6cbe('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0xa9c3ca){_0x1d87d7=_0xa9c3ca;if(_0x1d87d7['id']){var _0x9f1140={'body':_0x1d87d7[_0x6cbe('0x5d')],'ChatWebsiteId':_0x18b793['id'],'ChatInteractionId':_0x5b0f4e['id'],'direction':_0x6cbe('0x5e'),'UserId':_0x1c1a2d[_0x6cbe('0x3d')]['id']};return db['ChatMessage']['create'](_0x9f1140,{});}else{throw new db[(_0x6cbe('0x5a'))]['ValidationError'](_0x6cbe('0x5f'));}})[_0x6cbe('0x16')](function(){return _0x5b0f4e[_0x6cbe('0x60')]({'vidaooSessionId':_0x1d87d7['id']});})[_0x6cbe('0x16')](respondWithResult(_0x2c2843,null))[_0x6cbe('0x21')](handleError(_0x2c2843,null));};exports[_0x6cbe('0x61')]=function(_0x175795,_0x5b775a){if(_0x175795[_0x6cbe('0x31')]['id']){delete _0x175795[_0x6cbe('0x31')]['id'];}return db['ChatInteraction'][_0x6cbe('0x49')]({'where':{'id':_0x175795[_0x6cbe('0x3f')]['id']},'include':[{'model':db[_0x6cbe('0x62')],'as':_0x6cbe('0x63')}]})[_0x6cbe('0x16')](handleEntityNotFound(_0x5b775a,null))['then'](saveUpdates(_0x175795[_0x6cbe('0x31')],null))[_0x6cbe('0x16')](respondWithResult(_0x5b775a,null))['catch'](handleError(_0x5b775a,null));};exports['abandon']=function(_0x54da26,_0x2d0ee1){if(_0x54da26[_0x6cbe('0x31')]['id']){delete _0x54da26[_0x6cbe('0x31')]['id'];}return db['ChatInteraction'][_0x6cbe('0x49')]({'where':{'id':_0x54da26[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](function(_0x6113e2){if(!_0x6113e2){logger[_0x6cbe('0x1c')](_0x6cbe('0x64'),'abandon',0x194,_0x6cbe('0x65'));_0x2d0ee1[_0x6cbe('0x22')](0x194);}else{if(_0x6113e2[_0x6cbe('0x66')]){throw new db[(_0x6cbe('0x5a'))]['ValidationError'](_0x6cbe('0x67'));}}return _0x6113e2;})['then'](function(_0x177700){if(_0x177700){return _0x177700[_0x6cbe('0x2b')]({'closed':_0x54da26['body'][_0x6cbe('0x68')],'disposition':_0x54da26['body'][_0x6cbe('0x69')]})[_0x6cbe('0x16')](function(_0x4e171c){return _0x4e171c;});}})['then'](function(){return respondWithRpcPromise(_0x6cbe('0x6a'),_0x6cbe('0x6b'),_0x54da26[_0x6cbe('0x31')],client9004);})[_0x6cbe('0x16')](respondWithResult(_0x2d0ee1,null))[_0x6cbe('0x21')](handleError(_0x2d0ee1,null));};exports['attachmentUpload']=function(_0x58c377,_0x17019b){_0x58c377[_0x6cbe('0x31')]['name']=_0x58c377[_0x6cbe('0x6c')][_0x6cbe('0x6d')];_0x58c377['body']['basename']=_0x58c377[_0x6cbe('0x6c')][_0x6cbe('0x6e')];_0x58c377['body'][_0x6cbe('0x6f')]=_0x58c377[_0x6cbe('0x6c')]['mimetype'];return db[_0x6cbe('0x70')][_0x6cbe('0x4a')](_0x58c377[_0x6cbe('0x31')])[_0x6cbe('0x16')](respondWithResult(_0x17019b,0xc9))[_0x6cbe('0x21')](handleError(_0x17019b,null));};exports[_0x6cbe('0x71')]=function(_0x23dbfc,_0x3f57f3){return db[_0x6cbe('0x37')]['findOne']({'where':{'id':_0x23dbfc[_0x6cbe('0x3f')]['id']},'raw':!![]})[_0x6cbe('0x16')](handleEntityNotFound(_0x3f57f3,null))[_0x6cbe('0x16')](function(_0x8a32a1){if(_0x8a32a1){if(_0x8a32a1[_0x6cbe('0x68')]){return _0x3f57f3[_0x6cbe('0x24')](0x193)[_0x6cbe('0x25')]({'status':0x193,'message':_0x6cbe('0x72')});}return db[_0x6cbe('0x70')]['findOne']({'where':{'id':_0x23dbfc[_0x6cbe('0x3c')][_0x6cbe('0x73')]},'raw':!![]})[_0x6cbe('0x16')](handleEntityNotFound(_0x3f57f3,null));}})[_0x6cbe('0x16')](function(_0x177f29){if(_0x177f29){var _0x1b9cfa=_0x177f29['ChatOfflineMessageId']!==null;var _0x38174d=path['join'](config['root'],_0x6cbe('0x74'));if(_0x1b9cfa){_0x38174d=path[_0x6cbe('0x75')](_0x38174d,_0x6cbe('0x76'));}var _0x33885c=path[_0x6cbe('0x75')](_0x38174d,_0x177f29[_0x6cbe('0x77')]);return _0x3f57f3[_0x6cbe('0x78')](_0x33885c);}})[_0x6cbe('0x21')](handleError(_0x3f57f3,null));};exports['close']=function(_0x3e0c6f,_0x3487fe){var _0x553760=null;var _0x18e633=null;var _0x17d191=null;if(_0x3e0c6f['body']['id']){delete _0x3e0c6f['body']['id'];}if(_0x3e0c6f[_0x6cbe('0x31')][_0x6cbe('0x79')]){_0x17d191=path['join'](config[_0x6cbe('0x7a')],_0x6cbe('0x7b'),util[_0x6cbe('0x7c')](_0x6cbe('0x7d'),Date[_0x6cbe('0x7e')]()));_0x3e0c6f['body']['pathTranscript']=_0x17d191;}return db['ChatInteraction'][_0x6cbe('0x49')]({'where':{'id':_0x3e0c6f['params']['id']},'include':[{'model':db[_0x6cbe('0x7f')],'as':_0x6cbe('0x80'),'include':[{'model':db[_0x6cbe('0x81')],'as':_0x6cbe('0x81')}]}]})[_0x6cbe('0x16')](handleEntityNotFound(_0x3487fe,null))[_0x6cbe('0x16')](saveUpdates(_0x3e0c6f['body'],null))['then'](function(_0x40e424){if(_0x40e424){_0x553760=_0x40e424;return db[_0x6cbe('0x82')]['find']({'where':{'id':_0x553760[_0x6cbe('0x83')]}});}})[_0x6cbe('0x16')](function(_0x1d743e){if(_0x1d743e){_0x18e633=_0x1d743e;return db[_0x6cbe('0x62')][_0x6cbe('0x49')]({'where':{'id':_0x553760[_0x6cbe('0x84')]}});}})[_0x6cbe('0x16')](function(_0x3a3024){if(_0x3a3024){if(_0x17d191){var _0xf6025f=null;for(var _0x580b38=0x1;_0x580b38<_0x553760[_0x6cbe('0x80')][_0x6cbe('0x46')];++_0x580b38){_0xf6025f=_0x553760[_0x6cbe('0x80')][_0x580b38];var _0x54edc4=_0xf6025f[_0x6cbe('0x66')]?util[_0x6cbe('0x7c')](_0x6cbe('0x85'),_0x18e633[_0x6cbe('0x86')],_0xf6025f[_0x6cbe('0x66')]):'System';var _0x42230c=_0x3e0c6f[_0x6cbe('0x31')][_0x6cbe('0x87')]||util[_0x6cbe('0x7c')](_0x6cbe('0x85'),'Visitor',_0xf6025f[_0x6cbe('0x84')]);switch(_0x18e633['agentIdentifier']){case _0x6cbe('0x88'):_0x54edc4=_0xf6025f[_0x6cbe('0x66')]?util[_0x6cbe('0x7c')]('%s%d',_0x18e633[_0x6cbe('0x86')],_0xf6025f[_0x6cbe('0x66')]):_0x6cbe('0x89');break;case'agent_alias':_0x54edc4=_0xf6025f[_0x6cbe('0x66')]?_0xf6025f[_0x6cbe('0x81')]['alias']||_0xf6025f['User'][_0x6cbe('0x8a')]:_0x6cbe('0x89');break;case _0x6cbe('0x8b'):_0x54edc4=_0xf6025f[_0x6cbe('0x66')]?_0xf6025f[_0x6cbe('0x81')][_0x6cbe('0x8a')]:_0x6cbe('0x89');break;default:_0x54edc4=_0xf6025f[_0x6cbe('0x66')]?util[_0x6cbe('0x7c')]('%s%d',_0x18e633[_0x6cbe('0x86')],_0xf6025f[_0x6cbe('0x66')]):_0x6cbe('0x89');}var _0x5a1fe5=util[_0x6cbe('0x7c')](_0x6cbe('0x8c'),moment(_0xf6025f[_0x6cbe('0x8d')])[_0x6cbe('0x7c')](_0x6cbe('0x8e')),_0xf6025f[_0x6cbe('0x8f')]==='in'?_0x42230c:_0x54edc4,_0xf6025f['body']);if(!_0xf6025f[_0x6cbe('0x90')]){fs[_0x6cbe('0x91')](_0x17d191,_0x5a1fe5);}}return db[_0x6cbe('0x92')][_0x6cbe('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x6cbe('0x93'),'raw':!![],'include':[{'model':db[_0x6cbe('0x94')],'as':_0x6cbe('0x94'),'raw':!![]}]}]});}}})[_0x6cbe('0x16')](function(_0x2b5121){if(!_0x2b5121||!_0x2b5121['Smtp']||!_0x3e0c6f[_0x6cbe('0x31')])return _0x553760;var _0x411493=_0x2b5121[_0x6cbe('0x95')]();return respondWithRpcPromise(_0x6cbe('0x96'),_0x6cbe('0x97'),{'account':_0x411493,'message':{'from':util['format'](_0x6cbe('0x98'),_0x2b5121[_0x6cbe('0x2d')],_0x2b5121[_0x6cbe('0x52')]||_0x2b5121[_0x6cbe('0x93')][_0x6cbe('0x3d')]),'to':_0x3e0c6f[_0x6cbe('0x31')][_0x6cbe('0x79')],'subject':_0x6cbe('0x99'),'text':util['format'](_0x6cbe('0x9a'),_0x3e0c6f[_0x6cbe('0x31')][_0x6cbe('0x79')]),'attachments':[{'path':_0x17d191}]}})[_0x6cbe('0x16')](function(){return _0x553760;})[_0x6cbe('0x21')](function(_0x50f7b0){logger[_0x6cbe('0x1c')](_0x50f7b0);});})[_0x6cbe('0x16')](respondWithStatusCode(_0x3487fe,0xc8))[_0x6cbe('0x21')](handleError(_0x3487fe,null));};exports[_0x6cbe('0x9b')]=function(_0x290978,_0x3f6f89){return db['ChatMessage'][_0x6cbe('0x49')]({'where':{'id':_0x290978[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x3f6f89,null))[_0x6cbe('0x16')](function(_0x2e3fc0){if(_0x2e3fc0){return _0x2e3fc0['addMessage'](_0x290978[_0x6cbe('0x31')][_0x6cbe('0x9c')],_[_0x6cbe('0x9d')](_0x290978[_0x6cbe('0x31')],[_0x6cbe('0x9c'),'id'])||{});}})[_0x6cbe('0x16')](respondWithResult(_0x3f6f89,null))[_0x6cbe('0x21')](handleError(_0x3f6f89,null));};exports[_0x6cbe('0x9e')]=function(_0x135b72,_0x206aa8){var _0x4bc24c={'raw':![],'where':{}};var _0x36ab3b={};var _0x6e31f4={'count':0x0,'rows':[]};return db[_0x6cbe('0x37')][_0x6cbe('0x4d')]({'where':{'id':_0x135b72['params']['id']}})['then'](handleEntityNotFound(_0x206aa8,null))[_0x6cbe('0x16')](function(_0x3a5610){if(_0x3a5610){_0x36ab3b[_0x6cbe('0x43')]=_[_0x6cbe('0x40')](db[_0x6cbe('0x7f')][_0x6cbe('0x38')]);_0x36ab3b[_0x6cbe('0x3c')]=_[_0x6cbe('0x40')](_0x135b72[_0x6cbe('0x3c')]);_0x36ab3b[_0x6cbe('0x41')]=_[_0x6cbe('0x42')](_0x36ab3b['model'],_0x36ab3b['query']);_0x4bc24c[_0x6cbe('0x44')]=_[_0x6cbe('0x42')](_0x36ab3b[_0x6cbe('0x43')],qs[_0x6cbe('0x45')](_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0x45')]));_0x4bc24c[_0x6cbe('0x44')]=_0x4bc24c[_0x6cbe('0x44')][_0x6cbe('0x46')]?_0x4bc24c[_0x6cbe('0x44')]:_0x36ab3b[_0x6cbe('0x43')];if(!_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0x9f')](_0x6cbe('0xa0'))){_0x4bc24c[_0x6cbe('0x27')]=qs['limit'](_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0x27')]);_0x4bc24c[_0x6cbe('0x29')]=qs[_0x6cbe('0x29')](_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0x29')]);}_0x4bc24c['order']=qs[_0x6cbe('0xa1')](_0x135b72[_0x6cbe('0x3c')]['sort']);_0x4bc24c['where']=qs['filters'](_[_0x6cbe('0xa2')](_0x135b72[_0x6cbe('0x3c')],_0x36ab3b[_0x6cbe('0x41')]));_0x4bc24c[_0x6cbe('0xa3')]['ChatInteractionId']=_0x3a5610['id'];if(_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0xa4')]){_0x4bc24c[_0x6cbe('0xa3')]=_[_0x6cbe('0x30')](_0x4bc24c['where'],{'$or':_['map'](_0x4bc24c[_0x6cbe('0x44')],function(_0x4f346e){var _0x503a92={};_0x503a92[_0x4f346e]={'$like':'%'+_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0xa4')]+'%'};return _0x503a92;})});}if(_0x135b72['query'][_0x6cbe('0xa5')]){var _0x2a77d8=_0x135b72['query'][_0x6cbe('0xa5')]['split'](',');var _0x4f8666={};_0x4f8666[_0x2a77d8[0x0]]={'$gte':moment(_0x2a77d8[0x1])[_0x6cbe('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4bc24c[_0x6cbe('0xa3')]=_[_0x6cbe('0x30')](_0x4bc24c[_0x6cbe('0xa3')],_0x4f8666);}_0x4bc24c=_['merge']({},_0x4bc24c,_0x135b72[_0x6cbe('0xa6')]);return db[_0x6cbe('0x7f')]['count']({'where':_0x4bc24c['where']})[_0x6cbe('0x16')](function(_0x29e5d5){_0x6e31f4['count']=_0x29e5d5;if(_0x135b72[_0x6cbe('0x3c')][_0x6cbe('0x47')]){_0x4bc24c['include']=[{'all':!![]}];}return db[_0x6cbe('0x7f')][_0x6cbe('0x3b')](_0x4bc24c);})[_0x6cbe('0x16')](function(_0x262e18){_0x6e31f4['rows']=_0x262e18;return _0x6e31f4;});}})[_0x6cbe('0x16')](respondWithFilteredResult(_0x206aa8,_0x4bc24c))[_0x6cbe('0x21')](handleError(_0x206aa8,null));};exports[_0x6cbe('0xa7')]=function(_0x526ff8,_0x3a301a){var _0x7e9cf7={'where':{}},_0x541826={},_0x121f85={'count':0x0,'rows':[]};return db[_0x6cbe('0x37')][_0x6cbe('0x4d')]({'where':{'id':_0x526ff8[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x3a301a,null))[_0x6cbe('0x16')](function(_0x5e77a7){if(_0x5e77a7){_0x541826[_0x6cbe('0x43')]=_[_0x6cbe('0x40')](db[_0x6cbe('0x7f')][_0x6cbe('0x38')]);_0x541826[_0x6cbe('0x3c')]=_[_0x6cbe('0x40')](_0x526ff8['query']);_0x541826[_0x6cbe('0x41')]=_[_0x6cbe('0x42')](_0x541826[_0x6cbe('0x43')],_0x541826['query']);_0x7e9cf7[_0x6cbe('0x44')]=_[_0x6cbe('0x42')](_0x541826['model'],qs[_0x6cbe('0x45')](_0x526ff8['query']['fields']));_0x7e9cf7['attributes']=_0x7e9cf7[_0x6cbe('0x44')][_0x6cbe('0x46')]?_0x7e9cf7[_0x6cbe('0x44')]:_0x541826[_0x6cbe('0x43')];if(!_0x526ff8[_0x6cbe('0x3c')][_0x6cbe('0x9f')](_0x6cbe('0xa0'))){_0x7e9cf7[_0x6cbe('0x27')]=qs['limit'](_0x526ff8[_0x6cbe('0x3c')][_0x6cbe('0x27')]);_0x7e9cf7[_0x6cbe('0x29')]=qs[_0x6cbe('0x29')](_0x526ff8[_0x6cbe('0x3c')][_0x6cbe('0x29')]);}_0x7e9cf7[_0x6cbe('0xa8')]=qs['sort'](_0x526ff8['query']['sort']);_0x7e9cf7[_0x6cbe('0xa3')]=qs[_0x6cbe('0x41')](_[_0x6cbe('0xa2')](_0x526ff8['query'],_0x541826[_0x6cbe('0x41')]));_0x7e9cf7[_0x6cbe('0xa3')]['ChatInteractionId']=_0x5e77a7['id'];if(_0x526ff8['query'][_0x6cbe('0xa4')]){_0x7e9cf7[_0x6cbe('0xa3')]=_[_0x6cbe('0x30')](_0x7e9cf7[_0x6cbe('0xa3')],{'$or':_[_0x6cbe('0x36')](_0x7e9cf7[_0x6cbe('0x44')],function(_0x5b00a0){var _0x44be8f={};_0x44be8f[_0x5b00a0]={'$like':'%'+_0x526ff8['query'][_0x6cbe('0xa4')]+'%'};return _0x44be8f;})});}_0x7e9cf7['where'][_0x6cbe('0x90')]=![];if(_0x526ff8[_0x6cbe('0x3c')]['id']){_0x7e9cf7['where']['id']={'$gt':_0x526ff8[_0x6cbe('0x3c')]['id']};}_0x7e9cf7=_[_0x6cbe('0x30')]({},_0x7e9cf7,_0x526ff8[_0x6cbe('0xa6')]);return db[_0x6cbe('0x7f')][_0x6cbe('0x28')]({'where':_0x7e9cf7[_0x6cbe('0xa3')]})[_0x6cbe('0x16')](function(_0x31ad8b){_0x121f85['count']=_0x31ad8b;_0x7e9cf7[_0x6cbe('0x48')]=[];if(_0x526ff8[_0x6cbe('0x3c')][_0x6cbe('0xa9')]){_0x7e9cf7[_0x6cbe('0x48')][_0x6cbe('0xaa')]({'model':db[_0x6cbe('0x81')],'as':_0x6cbe('0x81'),'attributes':['id',_0x6cbe('0x8a'),_0x6cbe('0xab')]});}if(_0x526ff8[_0x6cbe('0x3c')][_0x6cbe('0x47')]){_0x7e9cf7['include']=[{'all':!![]}];}return db[_0x6cbe('0x7f')][_0x6cbe('0x3b')](_0x7e9cf7);})[_0x6cbe('0x16')](function(_0x43809e){_0x121f85[_0x6cbe('0xac')]=_0x43809e;return _0x121f85;});}})[_0x6cbe('0x16')](respondWithFilteredResult(_0x3a301a,_0x7e9cf7))[_0x6cbe('0x21')](handleError(_0x3a301a,null));};exports[_0x6cbe('0xad')]=function(_0x3a6222,_0x51481e){return db[_0x6cbe('0x37')][_0x6cbe('0x49')]({'where':{'id':_0x3a6222[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x51481e,null))['then'](function(_0x281eec){if(_0x281eec){return _0x281eec[_0x6cbe('0xae')](_0x3a6222[_0x6cbe('0x31')]['ids'],_[_0x6cbe('0x9d')](_0x3a6222['body'],[_0x6cbe('0x9c'),'id'])||{})[_0x6cbe('0xaf')](function(){return db[_0x6cbe('0xb0')][_0x6cbe('0x3b')]({'attributes':['id',_0x6cbe('0x2d'),'color'],'where':{'id':_0x3a6222[_0x6cbe('0x31')][_0x6cbe('0x9c')]}});})[_0x6cbe('0x16')](function(_0x12a207){socket[_0x6cbe('0xb1')]('chatInteractionTags:save',{'id':Number(_0x3a6222[_0x6cbe('0x3f')]['id']),'tags':_0x12a207||[]});return{'id':Number(_0x3a6222[_0x6cbe('0x3f')]['id']),'tags':_0x12a207||[]};});}})[_0x6cbe('0x16')](respondWithResult(_0x51481e,null))[_0x6cbe('0x21')](handleError(_0x51481e,null));};exports[_0x6cbe('0xb2')]=function(_0xb8a450,_0x55192d){return db[_0x6cbe('0x37')][_0x6cbe('0x49')]({'where':{'id':_0xb8a450[_0x6cbe('0x3f')]['id']}})[_0x6cbe('0x16')](handleEntityNotFound(_0x55192d,null))[_0x6cbe('0x16')](function(_0x3e6f70){if(_0x3e6f70){return _0x3e6f70[_0x6cbe('0xb2')](_0xb8a450[_0x6cbe('0x3c')][_0x6cbe('0x9c')]);}})[_0x6cbe('0x16')](respondWithStatusCode(_0x55192d,null))[_0x6cbe('0x21')](handleError(_0x55192d,null));};exports['download']=function(_0x176984,_0x134baf){var _0x13e2fd=moment()[_0x6cbe('0xb3')]()[_0x6cbe('0xb4')]();var _0x52d801=path[_0x6cbe('0x75')](config[_0x6cbe('0x7a')],'server',_0x6cbe('0xb5'),_0x6cbe('0xb6'));var _0x51bc3e=path[_0x6cbe('0x75')](config['root'],_0x6cbe('0xb7'),_0x6cbe('0xb5'),_0x6cbe('0xb8'));var _0x431130=path[_0x6cbe('0x75')](_0x52d801,_0x13e2fd);var _0x5152fc=util[_0x6cbe('0x7c')](_0x6cbe('0xb9'),_0x176984[_0x6cbe('0x3f')]['id'],_0x13e2fd);var _0x5b2722=path['join'](_0x52d801,_0x5152fc);var _0x3dc560=[];_0x3dc560[_0x6cbe('0xaa')]({'model':db['User'],'as':_0x6cbe('0x81'),'attributes':['id',_0x6cbe('0x8a')],'raw':!![]});_0x3dc560[_0x6cbe('0xaa')]({'model':db[_0x6cbe('0x62')],'as':'Contact','attributes':['id','firstName',_0x6cbe('0xba')],'raw':!![]});if(_0x176984[_0x6cbe('0x3c')]['attachments']){_0x3dc560[_0x6cbe('0xaa')]({'model':db[_0x6cbe('0x70')],'as':_0x6cbe('0x70'),'raw':!![]});}var _0x2d29b7=[{'model':db[_0x6cbe('0x7f')],'as':_0x6cbe('0x80'),'attributes':['id','body',_0x6cbe('0x8d'),_0x6cbe('0x8f'),_0x6cbe('0x90'),_0x6cbe('0xbb')],'include':_0x3dc560}];_0x2d29b7[_0x6cbe('0xaa')]({'model':db[_0x6cbe('0x82')],'as':'Account','attributes':['id','name']});_0x2d29b7[_0x6cbe('0xaa')]({'model':db[_0x6cbe('0x81')],'as':_0x6cbe('0xbc'),'attributes':['id',_0x6cbe('0x8a')]});return db[_0x6cbe('0x37')][_0x6cbe('0x49')]({'where':{'id':_0x176984[_0x6cbe('0x3f')]['id']},'include':_0x2d29b7})[_0x6cbe('0x16')](handleEntityNotFound(_0x134baf,null))[_0x6cbe('0x16')](function(_0x46dc63){if(_0x46dc63){var _0x4324e5=_0x46dc63['get']({'plain':!![]});fs[_0x6cbe('0xbd')](_0x431130);var _0x53bb03={'channel':_0x6cbe('0xbe'),'account':_0x4324e5[_0x6cbe('0xbf')][_0x6cbe('0x2d')],'agent':_0x4324e5[_0x6cbe('0xbc')]?_0x4324e5[_0x6cbe('0xbc')][_0x6cbe('0x8a')]:_0x6cbe('0xc0'),'createdAt':moment(_0x4324e5[_0x6cbe('0x8d')])[_0x6cbe('0x7c')](_0x6cbe('0xc1'))['toString'](),'closedAt':_0x4324e5[_0x6cbe('0x68')]?moment(_0x4324e5['closedAt'])[_0x6cbe('0x7c')](_0x6cbe('0xc1'))[_0x6cbe('0xb4')]():'','disposition':_0x4324e5[_0x6cbe('0x69')],'chatInfo':{'browser':_0x4324e5[_0x6cbe('0xc2')],'os':_0x4324e5[_0x6cbe('0xc3')],'referer':_0x4324e5[_0x6cbe('0xc4')],'customerIp':_0x4324e5[_0x6cbe('0xc5')],'customerPort':_0x4324e5['customerPort']?_0x4324e5[_0x6cbe('0xc6')]:_0x6cbe('0xc0')},'messages':_(_0x4324e5[_0x6cbe('0x80')])[_0x6cbe('0xc7')]()[_0x6cbe('0xa4')]({'secret':![]})[_0x6cbe('0x36')](function(_0x356574){if(_0x356574['Attachment']){var _0xf2d986=path[_0x6cbe('0x75')](_0x51bc3e,_0x356574[_0x6cbe('0x70')][_0x6cbe('0x77')]);if(fs[_0x6cbe('0xc8')](_0xf2d986)){fs[_0x6cbe('0xc9')](_0xf2d986)[_0x6cbe('0xca')](fs['createWriteStream'](path[_0x6cbe('0x75')](_0x431130,_0x356574[_0x6cbe('0x70')][_0x6cbe('0x77')])));}}return{'date':moment(_0x356574['createdAt'])[_0x6cbe('0x7c')](_0x6cbe('0xc1'))['toString'](),'sender':_0x356574['direction']===_0x6cbe('0x5e')?_0x356574[_0x6cbe('0x81')]?_0x356574['User'][_0x6cbe('0x8a')]:_0x6cbe('0x89'):_0x356574[_0x6cbe('0x63')][_0x6cbe('0xcb')]+(_0x356574[_0x6cbe('0x63')][_0x6cbe('0xba')]?'\x20'+_0x356574[_0x6cbe('0x63')][_0x6cbe('0xba')]:''),'body':_0x356574[_0x6cbe('0x70')]?_0x356574[_0x6cbe('0x70')][_0x6cbe('0x77')]:_0x356574[_0x6cbe('0x31')],'direction':_0x356574[_0x6cbe('0x8f')]===_0x6cbe('0x5e')?'A':'C','secret':_0x356574['secret'],'read':_0x356574[_0x6cbe('0xbb')],'attachment':_0x356574['Attachment']};})[_0x6cbe('0xcc')]()};return ejs['renderFile'](path['join'](config[_0x6cbe('0x7a')],_0x6cbe('0xb7'),_0x6cbe('0xcd'),_0x6cbe('0xce')),{'interaction':_0x53bb03})['then'](function(_0x4994c6){var _0x593bc1=path[_0x6cbe('0x75')](_0x431130,_0x6cbe('0xcf')+_0x4324e5['id']+'-'+_0x13e2fd+_0x6cbe('0xd0'));var _0x89d177={'path':_0x593bc1,'channel':_0x6cbe('0xbe'),'interactionId':_0x4324e5['id']};return pdf[_0x6cbe('0xd1')](_0x4994c6,_0x89d177);})[_0x6cbe('0x16')](function(){return new Promise(function(_0x5c5da4,_0x22583f){zipdir(_0x431130,{'saveTo':_0x5b2722},function(_0xdc15f4,_0x37c5b6){if(_0xdc15f4)return _0x22583f(_0xdc15f4);return _0x5c5da4(_0x37c5b6);});})['then'](function(){return new BPromise(function(_0x1fff94,_0x1870b9){rimraf(_0x431130,function(_0x5ddd71){if(_0x5ddd71)_0x1870b9(_0x5ddd71);return _0x1fff94();});});})['then'](function(){return _0x134baf[_0x6cbe('0x78')](_0x5b2722,_0x5152fc,function(_0x1eba9b){if(_0x1eba9b){logger[_0x6cbe('0x1c')]('err',_0x1eba9b);}else{fs[_0x6cbe('0xd2')](_0x5b2722);}});});});}else{return _0x134baf[_0x6cbe('0x22')](0xc8);}})[_0x6cbe('0x21')](handleError(_0x134baf,null));}; \ No newline at end of file +var _0xd3b2=['YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','nolimit','includeAgent','push','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','createdAt','direction','read','Account','Owner','get','mkdirSync','Chat','toString','closedAt','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','localhost','./chatInteraction.socket','register','jayson/promise','client','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','length','includeAll','include','options','create','find','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','follow','isNull','vidaooMetadata','parse','metadata','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','order','sort','where','pick','filter','$gte','split'];(function(_0x236ff2,_0x522765){var _0x109f1d=function(_0x510f80){while(--_0x510f80){_0x236ff2['push'](_0x236ff2['shift']());}};_0x109f1d(++_0x522765);}(_0xd3b2,0x101));var _0x2d3b=function(_0x3baace,_0x549e97){_0x3baace=_0x3baace-0x0;var _0x5de4eb=_0xd3b2[_0x3baace];return _0x5de4eb;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x2d3b('0x0'));var rp=require('request-promise');var moment=require(_0x2d3b('0x1'));var BPromise=require(_0x2d3b('0x2'));var Mustache=require(_0x2d3b('0x3'));var util=require(_0x2d3b('0x4'));var path=require(_0x2d3b('0x5'));var ejs=require(_0x2d3b('0x6'));var fs=require('fs');var _=require(_0x2d3b('0x7'));var Redis=require('ioredis');var interaction=require(_0x2d3b('0x8'));var qs=require(_0x2d3b('0x9'));var pdf=require(_0x2d3b('0xa'));var logger=require(_0x2d3b('0xb'))(_0x2d3b('0xc'));var config=require(_0x2d3b('0xd'));var db=require(_0x2d3b('0xe'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2d3b('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2d3b('0x10'))[_0x2d3b('0x11')](socket);var jayson=require(_0x2d3b('0x12'));var client=jayson[_0x2d3b('0x13')]['http']({'port':0x232b});var client9004=jayson[_0x2d3b('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x7fb65a,_0xe6c084,_0x299d34,_0x4c1841){return new BPromise(function(_0x330f7e,_0x1a9a9e){var _0xcc6ef0=_0x4c1841||client;return _0xcc6ef0[_0x2d3b('0x14')](_0x7fb65a,_0x299d34)['then'](function(_0x3e1ecb){logger[_0x2d3b('0x15')](_0x2d3b('0x16'),_0xe6c084,'request\x20sent');logger[_0x2d3b('0x17')](_0x2d3b('0x18'),_0xe6c084,_0x2d3b('0x19'),JSON['stringify'](_0x3e1ecb));if(_0x3e1ecb[_0x2d3b('0x1a')]){if(_0x3e1ecb[_0x2d3b('0x1a')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xe6c084,_0x3e1ecb[_0x2d3b('0x1a')]['message']);return _0x1a9a9e(_0x3e1ecb[_0x2d3b('0x1a')]['message']);}logger[_0x2d3b('0x1a')](_0x2d3b('0x16'),_0xe6c084,_0x3e1ecb[_0x2d3b('0x1a')]['message']);return _0x330f7e(_0x3e1ecb['error'][_0x2d3b('0x1b')]);}else{logger[_0x2d3b('0x15')](_0x2d3b('0x16'),_0xe6c084,_0x2d3b('0x19'));_0x330f7e(_0x3e1ecb['result'][_0x2d3b('0x1b')]);}})[_0x2d3b('0x1c')](function(_0x4b3f01){logger[_0x2d3b('0x1a')](_0x2d3b('0x16'),_0xe6c084,_0x4b3f01);_0x1a9a9e(_0x4b3f01);});});}function respondWithStatusCode(_0x500031,_0x181dda){_0x181dda=_0x181dda||0xcc;return function(_0x6c0b73){if(_0x6c0b73){return _0x500031[_0x2d3b('0x1d')](_0x181dda);}return _0x500031[_0x2d3b('0x1e')](_0x181dda)[_0x2d3b('0x1f')]();};}function respondWithResult(_0x56a36a,_0x470b93){_0x470b93=_0x470b93||0xc8;return function(_0x263004){if(_0x263004){return _0x56a36a['status'](_0x470b93)[_0x2d3b('0x20')](_0x263004);}};}function respondWithFilteredResult(_0x40a5ed,_0x4f5fc2){return function(_0x56d73b){if(_0x56d73b){var _0x278f20=typeof _0x4f5fc2[_0x2d3b('0x21')]===_0x2d3b('0x22')&&typeof _0x4f5fc2[_0x2d3b('0x23')]===_0x2d3b('0x22');var _0x42904e=_0x56d73b[_0x2d3b('0x24')];var _0xc3a35d=_0x278f20?0x0:_0x4f5fc2[_0x2d3b('0x21')];var _0x32755f=_0x278f20?_0x56d73b[_0x2d3b('0x24')]:_0x4f5fc2[_0x2d3b('0x21')]+_0x4f5fc2['limit'];var _0x4480c3;if(_0x32755f>=_0x42904e){_0x32755f=_0x42904e;_0x4480c3=0xc8;}else{_0x4480c3=0xce;}_0x40a5ed[_0x2d3b('0x1e')](_0x4480c3);return _0x40a5ed[_0x2d3b('0x25')](_0x2d3b('0x26'),_0xc3a35d+'-'+_0x32755f+'/'+_0x42904e)[_0x2d3b('0x20')](_0x56d73b);}return null;};}function saveUpdates(_0x164088){return function(_0x204ad2){if(_0x204ad2){return _0x204ad2['update'](_0x164088)[_0x2d3b('0x27')](function(_0x4a7762){return _0x4a7762;});}return null;};}function removeEntity(_0x198cb2){return function(_0x5fd27f){if(_0x5fd27f){return _0x5fd27f[_0x2d3b('0x28')]()[_0x2d3b('0x27')](function(){_0x198cb2[_0x2d3b('0x1e')](0xcc)[_0x2d3b('0x1f')]();});}};}function handleEntityNotFound(_0xe0690d){return function(_0x108beb){if(!_0x108beb){_0xe0690d[_0x2d3b('0x1d')](0x194);}return _0x108beb;};}function handleError(_0xf881e1,_0x32d091){_0x32d091=_0x32d091||0x1f4;return function(_0x24ae5c){logger['error'](_0x24ae5c[_0x2d3b('0x29')]);if(_0x24ae5c[_0x2d3b('0x2a')]){delete _0x24ae5c['name'];}_0xf881e1[_0x2d3b('0x1e')](_0x32d091)[_0x2d3b('0x2b')](_0x24ae5c);};}function getMustacheRender(_0x5874e2,_0x280986){return Mustache[_0x2d3b('0x2c')](_0x5874e2,_[_0x2d3b('0x2d')](_0x280986[_0x2d3b('0x2e')],{'contact':_0x280986[_0x2d3b('0x2f')],'message':_0x280986[_0x2d3b('0x1b')],'agent':_0x280986[_0x2d3b('0x30')],'interaction':_0x280986[_0x2d3b('0x31')],'account':_0x280986[_0x2d3b('0x32')]}))||'';}exports[_0x2d3b('0x33')]=function(_0x40c4b9,_0x32fac9){var _0x4daaf7={};var _0x245283=_[_0x2d3b('0x34')](db['ChatInteraction'][_0x2d3b('0x35')],function(_0x3e63a7){return{'name':_0x3e63a7[_0x2d3b('0x36')],'type':_0x3e63a7[_0x2d3b('0x37')]['key']};});_0x4daaf7=qs[_0x2d3b('0x38')](_0x245283,_0x40c4b9);return interaction['findAll'](_0x2d3b('0x39'),_0x40c4b9[_0x2d3b('0x3a')],_0x40c4b9[_0x2d3b('0x3b')],_0x4daaf7,_0x245283)[_0x2d3b('0x27')](respondWithFilteredResult(_0x32fac9,_0x4daaf7))[_0x2d3b('0x1c')](handleError(_0x32fac9,null));};exports[_0x2d3b('0x3c')]=function(_0x36cf3e,_0x46b2ed){var _0x27c46d={'raw':![],'where':{'id':_0x36cf3e[_0x2d3b('0x3d')]['id']}},_0x127757={};_0x127757[_0x2d3b('0x3e')]=_[_0x2d3b('0x3f')](db[_0x2d3b('0x40')][_0x2d3b('0x35')]);_0x127757['query']=_[_0x2d3b('0x3f')](_0x36cf3e[_0x2d3b('0x3a')]);_0x127757[_0x2d3b('0x41')]=_[_0x2d3b('0x42')](_0x127757[_0x2d3b('0x3e')],_0x127757[_0x2d3b('0x3a')]);_0x27c46d['attributes']=_[_0x2d3b('0x42')](_0x127757[_0x2d3b('0x3e')],qs['fields'](_0x36cf3e['query'][_0x2d3b('0x43')]));_0x27c46d[_0x2d3b('0x44')]=_0x27c46d[_0x2d3b('0x44')][_0x2d3b('0x45')]?_0x27c46d[_0x2d3b('0x44')]:_0x127757[_0x2d3b('0x3e')];if(_0x36cf3e[_0x2d3b('0x3a')][_0x2d3b('0x46')]){_0x27c46d[_0x2d3b('0x47')]=[{'all':!![]}];}_0x27c46d=_[_0x2d3b('0x2d')]({},_0x27c46d,_0x36cf3e[_0x2d3b('0x48')]);return db[_0x2d3b('0x40')]['find'](_0x27c46d)['then'](handleEntityNotFound(_0x46b2ed,null))[_0x2d3b('0x27')](respondWithResult(_0x46b2ed,null))[_0x2d3b('0x1c')](handleError(_0x46b2ed,null));};exports[_0x2d3b('0x49')]=function(_0x5dca86,_0x47ffc2){return db[_0x2d3b('0x40')][_0x2d3b('0x49')](_0x5dca86['body'],{})[_0x2d3b('0x27')](respondWithResult(_0x47ffc2,0xc9))[_0x2d3b('0x1c')](handleError(_0x47ffc2,null));};exports['update']=function(_0x167be5,_0x46fa37){if(_0x167be5['body']['id']){delete _0x167be5[_0x2d3b('0x2e')]['id'];}return db[_0x2d3b('0x40')][_0x2d3b('0x4a')]({'where':{'id':_0x167be5[_0x2d3b('0x3d')]['id']}})[_0x2d3b('0x27')](handleEntityNotFound(_0x46fa37,null))[_0x2d3b('0x27')](saveUpdates(_0x167be5[_0x2d3b('0x2e')],null))[_0x2d3b('0x27')](respondWithResult(_0x46fa37,null))['catch'](handleError(_0x46fa37,null));};exports['destroy']=function(_0x4e9295,_0x26094c){return db['ChatInteraction'][_0x2d3b('0x4a')]({'where':{'id':_0x4e9295[_0x2d3b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x26094c,null))[_0x2d3b('0x27')](removeEntity(_0x26094c,null))[_0x2d3b('0x1c')](handleError(_0x26094c,null));};exports['describe']=function(_0x2fccf6,_0x30aea4){return db[_0x2d3b('0x40')][_0x2d3b('0x4b')]()[_0x2d3b('0x27')](respondWithResult(_0x30aea4,null))[_0x2d3b('0x1c')](handleError(_0x30aea4,null));};exports['createVidaooSession']=function(_0x4a35d1,_0x3eaa4d){var _0x107e90=_0x4a35d1[_0x2d3b('0x3d')]['id'];var _0x2e81c0;var _0x56cf91;var _0x413e1f;return db[_0x2d3b('0x40')]['findOne']({'where':{'id':_0x107e90}})[_0x2d3b('0x27')](function(_0x5779ed){_0x2e81c0=_0x5779ed;return db[_0x2d3b('0x4c')][_0x2d3b('0x4d')]({'where':{'id':_0x5779ed['ChatWebsiteId']},'attributes':['id',_0x2d3b('0x4e'),'vidaooEscalation',_0x2d3b('0x4f'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x2d3b('0x27')](function(_0x67d09d){if(_0x67d09d&&_0x67d09d[_0x2d3b('0x4e')]&&_0x67d09d['vidaooEscalation']){_0x56cf91=_0x67d09d;var _0x20ac55={'interaction':{'id':_0x107e90},'agent':{'id':_0x4a35d1[_0x2d3b('0x3b')]['id'],'name':_0x4a35d1[_0x2d3b('0x3b')]['name'],'fullname':_0x4a35d1['user'][_0x2d3b('0x50')],'email':_0x4a35d1[_0x2d3b('0x3b')][_0x2d3b('0x51')]},'contact':_0x4a35d1[_0x2d3b('0x2e')][_0x2d3b('0x2f')],'account':_0x4a35d1[_0x2d3b('0x2e')][_0x2d3b('0x32')]};var _0x2b79bc={'rejectUnauthorized':![],'method':_0x2d3b('0x52'),'url':_0x2d3b('0x53'),'headers':{'X-APIKEY':_0x67d09d[_0x2d3b('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a35d1[_0x2d3b('0x3b')][_0x2d3b('0x51')]],'buttons':null,'topic':_0x56cf91[_0x2d3b('0x4f')],'note':_['isNull'](_0x56cf91[_0x2d3b('0x54')])?null:getMustacheRender(_0x56cf91[_0x2d3b('0x54')],_0x20ac55),'metadata':null},'redirect':_0x2d3b('0x55'),'json':!![]};try{if(!_[_0x2d3b('0x56')](_0x56cf91[_0x2d3b('0x57')])){var _0x3fde41=getMustacheRender(_0x56cf91['vidaooMetadata'],_0x20ac55);var _0x3478d8=JSON[_0x2d3b('0x58')](_0x3fde41);_0x2b79bc[_0x2d3b('0x2e')][_0x2d3b('0x59')]=_0x3478d8;}}catch(_0x5d18d4){throw new db['Sequelize'][(_0x2d3b('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b79bc);}else{throw new db[(_0x2d3b('0x5b'))][(_0x2d3b('0x5a'))](_0x2d3b('0x5c'));}})[_0x2d3b('0x27')](function(_0x22f0e7){_0x413e1f=_0x22f0e7;if(_0x413e1f['id']){var _0x53fe1f={'body':_0x413e1f['join_url'],'ChatWebsiteId':_0x56cf91['id'],'ChatInteractionId':_0x2e81c0['id'],'direction':'out','UserId':_0x4a35d1[_0x2d3b('0x3b')]['id']};return db[_0x2d3b('0x5d')]['create'](_0x53fe1f,{});}else{throw new db[(_0x2d3b('0x5b'))]['ValidationError'](_0x2d3b('0x5e'));}})[_0x2d3b('0x27')](function(){return _0x2e81c0[_0x2d3b('0x5f')]({'vidaooSessionId':_0x413e1f['id']});})['then'](respondWithResult(_0x3eaa4d,null))[_0x2d3b('0x1c')](handleError(_0x3eaa4d,null));};exports[_0x2d3b('0x60')]=function(_0x576508,_0x10ec6a){if(_0x576508['body']['id']){delete _0x576508[_0x2d3b('0x2e')]['id'];}return db[_0x2d3b('0x40')][_0x2d3b('0x4a')]({'where':{'id':_0x576508[_0x2d3b('0x3d')]['id']},'include':[{'model':db[_0x2d3b('0x61')],'as':_0x2d3b('0x62')}]})[_0x2d3b('0x27')](handleEntityNotFound(_0x10ec6a,null))['then'](saveUpdates(_0x576508['body'],null))['then'](respondWithResult(_0x10ec6a,null))[_0x2d3b('0x1c')](handleError(_0x10ec6a,null));};exports[_0x2d3b('0x63')]=function(_0x24b570,_0x1dab34){if(_0x24b570[_0x2d3b('0x2e')]['id']){delete _0x24b570['body']['id'];}return db[_0x2d3b('0x40')]['find']({'where':{'id':_0x24b570[_0x2d3b('0x3d')]['id']}})[_0x2d3b('0x27')](function(_0x3c67a5){if(!_0x3c67a5){logger[_0x2d3b('0x1a')](_0x2d3b('0x64'),_0x2d3b('0x63'),0x194,_0x2d3b('0x65'));_0x1dab34[_0x2d3b('0x1d')](0x194);}else{if(_0x3c67a5[_0x2d3b('0x66')]){throw new db[(_0x2d3b('0x5b'))]['ValidationError'](_0x2d3b('0x67'));}}return _0x3c67a5;})[_0x2d3b('0x27')](function(_0x9cdb21){if(_0x9cdb21){return _0x9cdb21[_0x2d3b('0x68')]({'closed':_0x24b570['body'][_0x2d3b('0x69')],'disposition':_0x24b570['body'][_0x2d3b('0x6a')]})[_0x2d3b('0x27')](function(_0x1b0f9c){return _0x1b0f9c;});}})[_0x2d3b('0x27')](function(){return respondWithRpcPromise(_0x2d3b('0x6b'),'abandon',_0x24b570[_0x2d3b('0x2e')],client9004);})[_0x2d3b('0x27')](respondWithResult(_0x1dab34,null))[_0x2d3b('0x1c')](handleError(_0x1dab34,null));};exports[_0x2d3b('0x6c')]=function(_0x782486,_0x1a7234){_0x782486['body'][_0x2d3b('0x2a')]=_0x782486[_0x2d3b('0x6d')]['originalname'];_0x782486[_0x2d3b('0x2e')][_0x2d3b('0x6e')]=_0x782486['file'][_0x2d3b('0x6f')];_0x782486[_0x2d3b('0x2e')][_0x2d3b('0x37')]=_0x782486[_0x2d3b('0x6d')]['mimetype'];return db['Attachment'][_0x2d3b('0x49')](_0x782486[_0x2d3b('0x2e')])[_0x2d3b('0x27')](respondWithResult(_0x1a7234,0xc9))[_0x2d3b('0x1c')](handleError(_0x1a7234,null));};exports[_0x2d3b('0x70')]=function(_0xc93305,_0x2820cb){return db['ChatInteraction'][_0x2d3b('0x4d')]({'where':{'id':_0xc93305['params']['id']},'raw':!![]})[_0x2d3b('0x27')](handleEntityNotFound(_0x2820cb,null))[_0x2d3b('0x27')](function(_0x47dd99){if(_0x47dd99){if(_0x47dd99[_0x2d3b('0x69')]){return _0x2820cb[_0x2d3b('0x1e')](0x193)[_0x2d3b('0x20')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x2d3b('0x4d')]({'where':{'id':_0xc93305['query'][_0x2d3b('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x2820cb,null));}})[_0x2d3b('0x27')](function(_0x4d49b8){if(_0x4d49b8){var _0x217c3f=_0x4d49b8[_0x2d3b('0x72')]!==null;var _0x2b7783=path[_0x2d3b('0x73')](config[_0x2d3b('0x74')],_0x2d3b('0x75'));if(_0x217c3f){_0x2b7783=path['join'](_0x2b7783,_0x2d3b('0x76'));}var _0xad7da7=path[_0x2d3b('0x73')](_0x2b7783,_0x4d49b8[_0x2d3b('0x6e')]);return _0x2820cb[_0x2d3b('0x77')](_0xad7da7);}})[_0x2d3b('0x1c')](handleError(_0x2820cb,null));};exports[_0x2d3b('0x78')]=function(_0x6f04dc,_0x49842b){var _0x553731=null;var _0x411e5a=null;var _0x568dee=null;if(_0x6f04dc['body']['id']){delete _0x6f04dc[_0x2d3b('0x2e')]['id'];}if(_0x6f04dc[_0x2d3b('0x2e')][_0x2d3b('0x79')]){_0x568dee=path[_0x2d3b('0x73')](config['root'],_0x2d3b('0x7a'),util[_0x2d3b('0x7b')](_0x2d3b('0x7c'),Date[_0x2d3b('0x7d')]()));_0x6f04dc[_0x2d3b('0x2e')][_0x2d3b('0x7e')]=_0x568dee;}return db[_0x2d3b('0x40')]['find']({'where':{'id':_0x6f04dc[_0x2d3b('0x3d')]['id']},'include':[{'model':db[_0x2d3b('0x5d')],'as':_0x2d3b('0x7f'),'include':[{'model':db[_0x2d3b('0x80')],'as':_0x2d3b('0x80')}]}]})[_0x2d3b('0x27')](handleEntityNotFound(_0x49842b,null))[_0x2d3b('0x27')](saveUpdates(_0x6f04dc[_0x2d3b('0x2e')],null))['then'](function(_0x893571){if(_0x893571){_0x553731=_0x893571;return db['ChatWebsite'][_0x2d3b('0x4a')]({'where':{'id':_0x553731[_0x2d3b('0x81')]}});}})[_0x2d3b('0x27')](function(_0x554e75){if(_0x554e75){_0x411e5a=_0x554e75;return db[_0x2d3b('0x61')][_0x2d3b('0x4a')]({'where':{'id':_0x553731[_0x2d3b('0x82')]}});}})['then'](function(_0x548403){if(_0x548403){if(_0x568dee){var _0x33528e=null;for(var _0xeef061=0x1;_0xeef061<_0x553731[_0x2d3b('0x7f')]['length'];++_0xeef061){_0x33528e=_0x553731[_0x2d3b('0x7f')][_0xeef061];var _0x1f011c=_0x33528e[_0x2d3b('0x66')]?util[_0x2d3b('0x7b')](_0x2d3b('0x83'),_0x411e5a[_0x2d3b('0x84')],_0x33528e[_0x2d3b('0x66')]):'System';var _0x46b305=_0x6f04dc['body'][_0x2d3b('0x85')]||util[_0x2d3b('0x7b')]('%s%d',_0x2d3b('0x86'),_0x33528e[_0x2d3b('0x82')]);switch(_0x411e5a[_0x2d3b('0x87')]){case'website_alias':_0x1f011c=_0x33528e['UserId']?util[_0x2d3b('0x7b')](_0x2d3b('0x83'),_0x411e5a[_0x2d3b('0x84')],_0x33528e[_0x2d3b('0x66')]):_0x2d3b('0x88');break;case _0x2d3b('0x89'):_0x1f011c=_0x33528e[_0x2d3b('0x66')]?_0x33528e[_0x2d3b('0x80')][_0x2d3b('0x8a')]||_0x33528e[_0x2d3b('0x80')][_0x2d3b('0x50')]:_0x2d3b('0x88');break;case _0x2d3b('0x8b'):_0x1f011c=_0x33528e[_0x2d3b('0x66')]?_0x33528e[_0x2d3b('0x80')][_0x2d3b('0x50')]:_0x2d3b('0x88');break;default:_0x1f011c=_0x33528e[_0x2d3b('0x66')]?util['format'](_0x2d3b('0x83'),_0x411e5a[_0x2d3b('0x84')],_0x33528e[_0x2d3b('0x66')]):_0x2d3b('0x88');}var _0x210f5f=util[_0x2d3b('0x7b')](_0x2d3b('0x8c'),moment(_0x33528e['createdAt'])[_0x2d3b('0x7b')](_0x2d3b('0x8d')),_0x33528e['direction']==='in'?_0x46b305:_0x1f011c,_0x33528e['body']);if(!_0x33528e[_0x2d3b('0x8e')]){fs[_0x2d3b('0x8f')](_0x568dee,_0x210f5f);}}return db[_0x2d3b('0x90')][_0x2d3b('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2d3b('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2d3b('0x92'),'raw':!![]}]}]});}}})[_0x2d3b('0x27')](function(_0x252e47){if(!_0x252e47||!_0x252e47['Smtp']||!_0x6f04dc['body'])return _0x553731;var _0x5bf1b4=_0x252e47['getSmtpOptions']();return respondWithRpcPromise(_0x2d3b('0x93'),_0x2d3b('0x94'),{'account':_0x5bf1b4,'message':{'from':util['format'](_0x2d3b('0x95'),_0x252e47[_0x2d3b('0x2a')],_0x252e47['email']||_0x252e47[_0x2d3b('0x91')][_0x2d3b('0x3b')]),'to':_0x6f04dc['body'][_0x2d3b('0x79')],'subject':'Mail\x20Transcript','text':util[_0x2d3b('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x6f04dc[_0x2d3b('0x2e')][_0x2d3b('0x79')]),'attachments':[{'path':_0x568dee}]}})['then'](function(){return _0x553731;})[_0x2d3b('0x1c')](function(_0x2f22ab){logger[_0x2d3b('0x1a')](_0x2f22ab);});})[_0x2d3b('0x27')](respondWithStatusCode(_0x49842b,0xc8))[_0x2d3b('0x1c')](handleError(_0x49842b,null));};exports[_0x2d3b('0x96')]=function(_0x1bc8fe,_0x193453){return db[_0x2d3b('0x5d')]['find']({'where':{'id':_0x1bc8fe[_0x2d3b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x193453,null))[_0x2d3b('0x27')](function(_0x463c4c){if(_0x463c4c){return _0x463c4c[_0x2d3b('0x96')](_0x1bc8fe[_0x2d3b('0x2e')][_0x2d3b('0x97')],_[_0x2d3b('0x98')](_0x1bc8fe['body'],['ids','id'])||{});}})[_0x2d3b('0x27')](respondWithResult(_0x193453,null))[_0x2d3b('0x1c')](handleError(_0x193453,null));};exports['getMessages']=function(_0x19dee2,_0x33936f){var _0x1af4f1={'raw':![],'where':{}};var _0x49c1ca={};var _0x3d0b16={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2d3b('0x4d')]({'where':{'id':_0x19dee2[_0x2d3b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x33936f,null))[_0x2d3b('0x27')](function(_0x6e3bbd){if(_0x6e3bbd){_0x49c1ca['model']=_[_0x2d3b('0x3f')](db['ChatMessage'][_0x2d3b('0x35')]);_0x49c1ca[_0x2d3b('0x3a')]=_[_0x2d3b('0x3f')](_0x19dee2['query']);_0x49c1ca[_0x2d3b('0x41')]=_['intersection'](_0x49c1ca[_0x2d3b('0x3e')],_0x49c1ca[_0x2d3b('0x3a')]);_0x1af4f1['attributes']=_['intersection'](_0x49c1ca[_0x2d3b('0x3e')],qs['fields'](_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x43')]));_0x1af4f1['attributes']=_0x1af4f1[_0x2d3b('0x44')][_0x2d3b('0x45')]?_0x1af4f1['attributes']:_0x49c1ca[_0x2d3b('0x3e')];if(!_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x99')]('nolimit')){_0x1af4f1['limit']=qs[_0x2d3b('0x23')](_0x19dee2[_0x2d3b('0x3a')]['limit']);_0x1af4f1[_0x2d3b('0x21')]=qs[_0x2d3b('0x21')](_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x21')]);}_0x1af4f1[_0x2d3b('0x9a')]=qs[_0x2d3b('0x9b')](_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x9b')]);_0x1af4f1[_0x2d3b('0x9c')]=qs[_0x2d3b('0x41')](_[_0x2d3b('0x9d')](_0x19dee2[_0x2d3b('0x3a')],_0x49c1ca[_0x2d3b('0x41')]));_0x1af4f1[_0x2d3b('0x9c')]['ChatInteractionId']=_0x6e3bbd['id'];if(_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x9e')]){_0x1af4f1[_0x2d3b('0x9c')]=_[_0x2d3b('0x2d')](_0x1af4f1[_0x2d3b('0x9c')],{'$or':_[_0x2d3b('0x34')](_0x1af4f1[_0x2d3b('0x44')],function(_0x1084a){var _0xce7f49={};_0xce7f49[_0x1084a]={'$like':'%'+_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x9e')]+'%'};return _0xce7f49;})});}if(_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x9f')]){var _0x5a4cf0=_0x19dee2[_0x2d3b('0x3a')]['$gte'][_0x2d3b('0xa0')](',');var _0x3e0cb0={};_0x3e0cb0[_0x5a4cf0[0x0]]={'$gte':moment(_0x5a4cf0[0x1])[_0x2d3b('0x7b')](_0x2d3b('0xa1'))};_0x1af4f1[_0x2d3b('0x9c')]=_[_0x2d3b('0x2d')](_0x1af4f1['where'],_0x3e0cb0);}_0x1af4f1=_[_0x2d3b('0x2d')]({},_0x1af4f1,_0x19dee2[_0x2d3b('0x48')]);return db[_0x2d3b('0x5d')][_0x2d3b('0x24')]({'where':_0x1af4f1['where']})['then'](function(_0x54aeec){_0x3d0b16[_0x2d3b('0x24')]=_0x54aeec;if(_0x19dee2[_0x2d3b('0x3a')][_0x2d3b('0x46')]){_0x1af4f1[_0x2d3b('0x47')]=[{'all':!![]}];}return db[_0x2d3b('0x5d')][_0x2d3b('0xa2')](_0x1af4f1);})[_0x2d3b('0x27')](function(_0x13c408){_0x3d0b16[_0x2d3b('0xa3')]=_0x13c408;return _0x3d0b16;});}})[_0x2d3b('0x27')](respondWithFilteredResult(_0x33936f,_0x1af4f1))[_0x2d3b('0x1c')](handleError(_0x33936f,null));};exports[_0x2d3b('0xa4')]=function(_0x17ed94,_0x337dab){var _0x57a629={'where':{}},_0x257442={},_0x35acff={'count':0x0,'rows':[]};return db[_0x2d3b('0x40')][_0x2d3b('0x4d')]({'where':{'id':_0x17ed94[_0x2d3b('0x3d')]['id']}})[_0x2d3b('0x27')](handleEntityNotFound(_0x337dab,null))[_0x2d3b('0x27')](function(_0x40eb89){if(_0x40eb89){_0x257442[_0x2d3b('0x3e')]=_[_0x2d3b('0x3f')](db['ChatMessage'][_0x2d3b('0x35')]);_0x257442['query']=_[_0x2d3b('0x3f')](_0x17ed94[_0x2d3b('0x3a')]);_0x257442[_0x2d3b('0x41')]=_[_0x2d3b('0x42')](_0x257442[_0x2d3b('0x3e')],_0x257442[_0x2d3b('0x3a')]);_0x57a629[_0x2d3b('0x44')]=_[_0x2d3b('0x42')](_0x257442[_0x2d3b('0x3e')],qs['fields'](_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x43')]));_0x57a629['attributes']=_0x57a629[_0x2d3b('0x44')][_0x2d3b('0x45')]?_0x57a629[_0x2d3b('0x44')]:_0x257442[_0x2d3b('0x3e')];if(!_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x99')](_0x2d3b('0xa5'))){_0x57a629[_0x2d3b('0x23')]=qs['limit'](_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x23')]);_0x57a629[_0x2d3b('0x21')]=qs[_0x2d3b('0x21')](_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x21')]);}_0x57a629[_0x2d3b('0x9a')]=qs[_0x2d3b('0x9b')](_0x17ed94['query'][_0x2d3b('0x9b')]);_0x57a629[_0x2d3b('0x9c')]=qs['filters'](_[_0x2d3b('0x9d')](_0x17ed94[_0x2d3b('0x3a')],_0x257442['filters']));_0x57a629['where']['ChatInteractionId']=_0x40eb89['id'];if(_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x9e')]){_0x57a629[_0x2d3b('0x9c')]=_[_0x2d3b('0x2d')](_0x57a629[_0x2d3b('0x9c')],{'$or':_[_0x2d3b('0x34')](_0x57a629[_0x2d3b('0x44')],function(_0x4ebdd6){var _0x49fa15={};_0x49fa15[_0x4ebdd6]={'$like':'%'+_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x9e')]+'%'};return _0x49fa15;})});}_0x57a629[_0x2d3b('0x9c')][_0x2d3b('0x8e')]=![];if(_0x17ed94[_0x2d3b('0x3a')]['id']){_0x57a629[_0x2d3b('0x9c')]['id']={'$gt':_0x17ed94[_0x2d3b('0x3a')]['id']};}_0x57a629=_[_0x2d3b('0x2d')]({},_0x57a629,_0x17ed94['options']);return db['ChatMessage'][_0x2d3b('0x24')]({'where':_0x57a629[_0x2d3b('0x9c')]})['then'](function(_0x5f57d0){_0x35acff[_0x2d3b('0x24')]=_0x5f57d0;_0x57a629[_0x2d3b('0x47')]=[];if(_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0xa6')]){_0x57a629[_0x2d3b('0x47')][_0x2d3b('0xa7')]({'model':db[_0x2d3b('0x80')],'as':'User','attributes':['id',_0x2d3b('0x50'),'alias']});}if(_0x17ed94[_0x2d3b('0x3a')][_0x2d3b('0x46')]){_0x57a629['include']=[{'all':!![]}];}return db[_0x2d3b('0x5d')][_0x2d3b('0xa2')](_0x57a629);})[_0x2d3b('0x27')](function(_0x147c60){_0x35acff[_0x2d3b('0xa3')]=_0x147c60;return _0x35acff;});}})[_0x2d3b('0x27')](respondWithFilteredResult(_0x337dab,_0x57a629))['catch'](handleError(_0x337dab,null));};exports[_0x2d3b('0xa8')]=function(_0x7e5a8c,_0x12a506){return db[_0x2d3b('0x40')][_0x2d3b('0x4a')]({'where':{'id':_0x7e5a8c['params']['id']}})[_0x2d3b('0x27')](handleEntityNotFound(_0x12a506,null))[_0x2d3b('0x27')](function(_0x3f6a2d){if(_0x3f6a2d){return _0x3f6a2d[_0x2d3b('0xa9')](_0x7e5a8c['body']['ids'],_[_0x2d3b('0x98')](_0x7e5a8c['body'],[_0x2d3b('0x97'),'id'])||{})['spread'](function(){return db['Tag'][_0x2d3b('0xa2')]({'attributes':['id',_0x2d3b('0x2a'),'color'],'where':{'id':_0x7e5a8c[_0x2d3b('0x2e')][_0x2d3b('0x97')]}});})[_0x2d3b('0x27')](function(_0x413b23){socket[_0x2d3b('0xaa')](_0x2d3b('0xab'),{'id':Number(_0x7e5a8c[_0x2d3b('0x3d')]['id']),'tags':_0x413b23||[]});return{'id':Number(_0x7e5a8c[_0x2d3b('0x3d')]['id']),'tags':_0x413b23||[]};});}})['then'](respondWithResult(_0x12a506,null))[_0x2d3b('0x1c')](handleError(_0x12a506,null));};exports[_0x2d3b('0xac')]=function(_0x13632e,_0xd0918e){return db[_0x2d3b('0x40')][_0x2d3b('0x4a')]({'where':{'id':_0x13632e[_0x2d3b('0x3d')]['id']}})[_0x2d3b('0x27')](handleEntityNotFound(_0xd0918e,null))[_0x2d3b('0x27')](function(_0x31cd0e){if(_0x31cd0e){return _0x31cd0e[_0x2d3b('0xac')](_0x13632e['query'][_0x2d3b('0x97')]);}})[_0x2d3b('0x27')](respondWithStatusCode(_0xd0918e,null))[_0x2d3b('0x1c')](handleError(_0xd0918e,null));};exports['download']=function(_0x5a3e01,_0x587e41){var _0x1d1d51=moment()[_0x2d3b('0xad')]()['toString']();var _0x50decd=path['join'](config[_0x2d3b('0x74')],_0x2d3b('0xae'),_0x2d3b('0xaf'),_0x2d3b('0xb0'));var _0x1ec152=path[_0x2d3b('0x73')](config['root'],_0x2d3b('0xae'),_0x2d3b('0xaf'),_0x2d3b('0xb1'));var _0x272312=path[_0x2d3b('0x73')](_0x50decd,_0x1d1d51);var _0x27f66c=util[_0x2d3b('0x7b')](_0x2d3b('0xb2'),_0x5a3e01['params']['id'],_0x1d1d51);var _0x2940eb=path[_0x2d3b('0x73')](_0x50decd,_0x27f66c);var _0x9afc1f=[];_0x9afc1f[_0x2d3b('0xa7')]({'model':db['User'],'as':'User','attributes':['id',_0x2d3b('0x50')],'raw':!![]});_0x9afc1f[_0x2d3b('0xa7')]({'model':db[_0x2d3b('0x61')],'as':_0x2d3b('0x62'),'attributes':['id',_0x2d3b('0xb3'),_0x2d3b('0xb4')],'raw':!![]});if(_0x5a3e01['query']['attachments']){_0x9afc1f[_0x2d3b('0xa7')]({'model':db['Attachment'],'as':_0x2d3b('0xb5'),'raw':!![]});}var _0x2ad360=[{'model':db[_0x2d3b('0x5d')],'as':_0x2d3b('0x7f'),'attributes':['id',_0x2d3b('0x2e'),_0x2d3b('0xb6'),_0x2d3b('0xb7'),_0x2d3b('0x8e'),_0x2d3b('0xb8')],'include':_0x9afc1f}];_0x2ad360[_0x2d3b('0xa7')]({'model':db[_0x2d3b('0x4c')],'as':_0x2d3b('0xb9'),'attributes':['id',_0x2d3b('0x2a')]});_0x2ad360[_0x2d3b('0xa7')]({'model':db[_0x2d3b('0x80')],'as':_0x2d3b('0xba'),'attributes':['id',_0x2d3b('0x50')]});return db[_0x2d3b('0x40')][_0x2d3b('0x4a')]({'where':{'id':_0x5a3e01[_0x2d3b('0x3d')]['id']},'include':_0x2ad360})[_0x2d3b('0x27')](handleEntityNotFound(_0x587e41,null))[_0x2d3b('0x27')](function(_0x51b1af){if(_0x51b1af){var _0x3c302f=_0x51b1af[_0x2d3b('0xbb')]({'plain':!![]});fs[_0x2d3b('0xbc')](_0x272312);var _0x175ead={'channel':_0x2d3b('0xbd'),'account':_0x3c302f[_0x2d3b('0xb9')]['name'],'agent':_0x3c302f['Owner']?_0x3c302f['Owner']['fullname']:'N.A.','createdAt':moment(_0x3c302f[_0x2d3b('0xb6')])[_0x2d3b('0x7b')](_0x2d3b('0xa1'))[_0x2d3b('0xbe')](),'closedAt':_0x3c302f[_0x2d3b('0x69')]?moment(_0x3c302f[_0x2d3b('0xbf')])[_0x2d3b('0x7b')](_0x2d3b('0xa1'))[_0x2d3b('0xbe')]():'','disposition':_0x3c302f[_0x2d3b('0x6a')],'chatInfo':{'browser':_0x3c302f[_0x2d3b('0xc0')],'os':_0x3c302f[_0x2d3b('0xc1')],'referer':_0x3c302f[_0x2d3b('0xc2')],'customerIp':_0x3c302f[_0x2d3b('0xc3')],'customerPort':_0x3c302f[_0x2d3b('0xc4')]?_0x3c302f[_0x2d3b('0xc4')]:_0x2d3b('0xc5')},'messages':_(_0x3c302f[_0x2d3b('0x7f')])['tail']()[_0x2d3b('0x9e')]({'secret':![]})[_0x2d3b('0x34')](function(_0x5ebbf0){if(_0x5ebbf0['Attachment']){var _0x4a3ae0=path[_0x2d3b('0x73')](_0x1ec152,_0x5ebbf0[_0x2d3b('0xb5')][_0x2d3b('0x6e')]);if(fs[_0x2d3b('0xc6')](_0x4a3ae0)){fs[_0x2d3b('0xc7')](_0x4a3ae0)['pipe'](fs[_0x2d3b('0xc8')](path[_0x2d3b('0x73')](_0x272312,_0x5ebbf0[_0x2d3b('0xb5')][_0x2d3b('0x6e')])));}}return{'date':moment(_0x5ebbf0[_0x2d3b('0xb6')])[_0x2d3b('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2d3b('0xbe')](),'sender':_0x5ebbf0['direction']==='out'?_0x5ebbf0[_0x2d3b('0x80')]?_0x5ebbf0['User'][_0x2d3b('0x50')]:'System':_0x5ebbf0[_0x2d3b('0x62')][_0x2d3b('0xb3')]+(_0x5ebbf0[_0x2d3b('0x62')]['lastName']?'\x20'+_0x5ebbf0['Contact']['lastName']:''),'body':_0x5ebbf0[_0x2d3b('0xb5')]?_0x5ebbf0[_0x2d3b('0xb5')]['basename']:_0x5ebbf0[_0x2d3b('0x2e')],'direction':_0x5ebbf0[_0x2d3b('0xb7')]===_0x2d3b('0xc9')?'A':'C','secret':_0x5ebbf0[_0x2d3b('0x8e')],'read':_0x5ebbf0[_0x2d3b('0xb8')],'attachment':_0x5ebbf0[_0x2d3b('0xb5')]};})['value']()};return ejs[_0x2d3b('0xca')](path[_0x2d3b('0x73')](config[_0x2d3b('0x74')],_0x2d3b('0xae'),_0x2d3b('0xcb'),_0x2d3b('0xcc')),{'interaction':_0x175ead})[_0x2d3b('0x27')](function(_0x2385db){var _0x1b3013=path['join'](_0x272312,_0x2d3b('0xcd')+_0x3c302f['id']+'-'+_0x1d1d51+_0x2d3b('0xce'));var _0x2e9ba7={'path':_0x1b3013,'channel':_0x2d3b('0xbd'),'interactionId':_0x3c302f['id']};return pdf[_0x2d3b('0xcf')](_0x2385db,_0x2e9ba7);})[_0x2d3b('0x27')](function(){return new Promise(function(_0x3d0daf,_0xf81316){zipdir(_0x272312,{'saveTo':_0x2940eb},function(_0x1cc5d8,_0x17542c){if(_0x1cc5d8)return _0xf81316(_0x1cc5d8);return _0x3d0daf(_0x17542c);});})[_0x2d3b('0x27')](function(){return new BPromise(function(_0x107e66,_0x21be2d){rimraf(_0x272312,function(_0x38123e){if(_0x38123e)_0x21be2d(_0x38123e);return _0x107e66();});});})['then'](function(){return _0x587e41['download'](_0x2940eb,_0x27f66c,function(_0x220c50){if(_0x220c50){logger[_0x2d3b('0x1a')](_0x2d3b('0xd0'),_0x220c50);}else{fs['unlinkSync'](_0x2940eb);}});});});}else{return _0x587e41[_0x2d3b('0x1d')](0xc8);}})[_0x2d3b('0x1c')](handleError(_0x587e41,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 46401c0..a339373 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 _0x568e=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','setDataValue','Users','map','then','length','emit','catch'];(function(_0x42b1f6,_0x3df91b){var _0x37ee4f=function(_0x55df2){while(--_0x55df2){_0x42b1f6['push'](_0x42b1f6['shift']());}};_0x37ee4f(++_0x3df91b);}(_0x568e,0x1e9));var _0xe568=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x568e[_0x273c39];return _0x46d6b5;};'use strict';var EventEmitter=require(_0xe568('0x0'));var ChatInteraction=require(_0xe568('0x1'))['db'][_0xe568('0x2')];var ChatMessage=require(_0xe568('0x1'))['db'][_0xe568('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe568('0x4'),'afterUpdate':_0xe568('0x5'),'afterDestroy':_0xe568('0x6')};function emitEvent(_0x58cdd2){return function(_0x36a875,_0x1ee99f,_0x2de294){_0x36a875[_0xe568('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x232d63){_0x36a875[_0xe568('0x8')](_0xe568('0x9'),_0x232d63[_0xe568('0xa')](function(_0x1e17ec){return{'id':_0x1e17ec['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x36a875['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe568('0xb')](function(_0x1276b3){_0x36a875[_0xe568('0x8')]('unreadMessages',_0x1276b3[_0xe568('0xc')]);ChatInteractionEvents['emit'](_0x58cdd2+':'+_0x36a875['id'],_0x36a875);ChatInteractionEvents[_0xe568('0xd')](_0x58cdd2,_0x36a875);_0x2de294(null);})[_0xe568('0xe')](_0x2de294(null));};}for(var e in events){if(events[_0xe568('0xf')](e)){var event=events[e];ChatInteraction[_0xe568('0x10')](e,emitEvent(event));}}module[_0xe568('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0x04cc=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','remove','getUsers'];(function(_0x4d88ac,_0x14bbd5){var _0xffa7de=function(_0x8b9497){while(--_0x8b9497){_0x4d88ac['push'](_0x4d88ac['shift']());}};_0xffa7de(++_0x14bbd5);}(_0x04cc,0x11a));var _0xc04c=function(_0x5bfaa7,_0x404773){_0x5bfaa7=_0x5bfaa7-0x0;var _0xe1b1a3=_0x04cc[_0x5bfaa7];return _0xe1b1a3;};'use strict';var EventEmitter=require(_0xc04c('0x0'));var ChatInteraction=require(_0xc04c('0x1'))['db'][_0xc04c('0x2')];var ChatMessage=require(_0xc04c('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc04c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc04c('0x4')};function emitEvent(_0x2fefd7){return function(_0x153c93,_0x14ac09,_0x28d35d){_0x153c93[_0xc04c('0x5')]({'attributes':['id'],'raw':!![]})[_0xc04c('0x6')](function(_0x5a6076){_0x153c93[_0xc04c('0x7')](_0xc04c('0x8'),_0x5a6076[_0xc04c('0x9')](function(_0x26a695){return{'id':_0x26a695['id']};}));return ChatMessage[_0xc04c('0xa')]({'where':{'ChatInteractionId':_0x153c93['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc04c('0x6')](function(_0x1c363d){_0x153c93[_0xc04c('0x7')]('unreadMessages',_0x1c363d['length']);ChatInteractionEvents[_0xc04c('0xb')](_0x2fefd7+':'+_0x153c93['id'],_0x153c93);ChatInteractionEvents[_0xc04c('0xb')](_0x2fefd7,_0x153c93);_0x28d35d(null);})[_0xc04c('0xc')](_0x28d35d(null));};}for(var e in events){if(events[_0xc04c('0xd')](e)){var event=events[e];ChatInteraction[_0xc04c('0xe')](e,emitEvent(event));}}module[_0xc04c('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index dfb0435..0dc3163 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 _0x6b97=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x11ccb2,_0x3c3c09){var _0x5e59dd=function(_0x1a3c76){while(--_0x1a3c76){_0x11ccb2['push'](_0x11ccb2['shift']());}};_0x5e59dd(++_0x3c3c09);}(_0x6b97,0x112));var _0x76b9=function(_0x5d184b,_0x1b04c5){_0x5d184b=_0x5d184b-0x0;var _0x5cee64=_0x6b97[_0x5d184b];return _0x5cee64;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x76b9('0x0'))(_0x76b9('0x1'));var moment=require(_0x76b9('0x2'));var BPromise=require(_0x76b9('0x3'));var rp=require(_0x76b9('0x4'));var fs=require('fs');var path=require(_0x76b9('0x5'));var rimraf=require('rimraf');var config=require(_0x76b9('0x6'));var attributes=require(_0x76b9('0x7'));module['exports']=function(_0x1e4be8,_0x2d28a0){return _0x1e4be8[_0x76b9('0x8')](_0x76b9('0x9'),attributes,{'tableName':_0x76b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x566133,_0x387863,_0xb85f78){if(_0x566133[_0x76b9('0xb')](_0x76b9('0xc'))){_0x566133[_0x76b9('0xd')]=moment()[_0x76b9('0xe')](_0x76b9('0xf'));}_0xb85f78(null,_0x566133);}},'charset':_0x76b9('0x10'),'collate':_0x76b9('0x11')});}; \ No newline at end of file +var _0x42e7=['bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x15e051,_0x1b608d){var _0x3c1a38=function(_0x31db8b){while(--_0x31db8b){_0x15e051['push'](_0x15e051['shift']());}};_0x3c1a38(++_0x1b608d);}(_0x42e7,0xeb));var _0x742e=function(_0x5a2d9f,_0x17dc02){_0x5a2d9f=_0x5a2d9f-0x0;var _0x583a2c=_0x42e7[_0x5a2d9f];return _0x583a2c;};'use strict';var _=require('lodash');var util=require(_0x742e('0x0'));var logger=require('../../config/logger')(_0x742e('0x1'));var moment=require(_0x742e('0x2'));var BPromise=require(_0x742e('0x3'));var rp=require(_0x742e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x742e('0x5'));var config=require(_0x742e('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x742e('0x7')]=function(_0x148c38,_0xda4462){return _0x148c38[_0x742e('0x8')](_0x742e('0x9'),attributes,{'tableName':_0x742e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x131bc5,_0x551a07,_0x1fcd96){if(_0x131bc5[_0x742e('0xb')](_0x742e('0xc'))){_0x131bc5[_0x742e('0xd')]=moment()[_0x742e('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1fcd96(null,_0x131bc5);}},'charset':_0x742e('0xf'),'collate':_0x742e('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e5942e2..25e7f07 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 _0xcded=['info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xcded,0x101));var _0xdcde=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xcded[_0x3b2244];return _0x2dcc14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdcde('0x0'));var BPromise=require(_0xdcde('0x1'));var rs=require(_0xdcde('0x2'));var fs=require('fs');var Redis=require(_0xdcde('0x3'));var db=require(_0xdcde('0x4'))['db'];var utils=require(_0xdcde('0x5'));var logger=require(_0xdcde('0x6'))('rpc');var config=require(_0xdcde('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdcde('0x8')]({'port':0x232a});config[_0xdcde('0x9')]=_[_0xdcde('0xa')](config[_0xdcde('0x9')],{'host':_0xdcde('0xb'),'port':0x18eb});var socket=require(_0xdcde('0xc'))(new Redis(config[_0xdcde('0x9')]));require('./chatInteraction.socket')[_0xdcde('0xd')](socket);function respondWithRpcPromise(_0x2249f3,_0x4e8762,_0x22155c){return new BPromise(function(_0x447182,_0x334a41){return client['request'](_0x2249f3,_0x22155c)[_0xdcde('0xe')](function(_0x4801ef){logger['info'](_0xdcde('0xf'),_0x4e8762,_0xdcde('0x10'));logger[_0xdcde('0x11')](_0xdcde('0x12'),_0x4e8762,_0xdcde('0x10'),JSON[_0xdcde('0x13')](_0x4801ef));if(_0x4801ef['error']){if(_0x4801ef[_0xdcde('0x14')][_0xdcde('0x15')]===0x1f4){logger[_0xdcde('0x14')](_0xdcde('0xf'),_0x4e8762,_0x4801ef[_0xdcde('0x14')][_0xdcde('0x16')]);return _0x334a41(_0x4801ef[_0xdcde('0x14')][_0xdcde('0x16')]);}logger[_0xdcde('0x14')](_0xdcde('0xf'),_0x4e8762,_0x4801ef[_0xdcde('0x14')][_0xdcde('0x16')]);return _0x447182(_0x4801ef[_0xdcde('0x14')][_0xdcde('0x16')]);}else{logger[_0xdcde('0x17')](_0xdcde('0xf'),_0x4e8762,_0xdcde('0x10'));_0x447182(_0x4801ef['result']['message']);}})[_0xdcde('0x18')](function(_0x315077){logger[_0xdcde('0x14')](_0xdcde('0xf'),_0x4e8762,_0x315077);_0x334a41(_0x315077);});});}exports[_0xdcde('0x19')]=function(_0x3788b2){var _0x2e40ae=this;return new Promise(function(_0x347503,_0x2759b2){return db[_0xdcde('0x1a')][_0xdcde('0x1b')](_0x3788b2[_0xdcde('0x1c')],{'raw':_0x3788b2[_0xdcde('0x1d')]?_0x3788b2[_0xdcde('0x1d')][_0xdcde('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3788b2[_0xdcde('0x1d')]?_0x3788b2[_0xdcde('0x1d')][_0xdcde('0x1f')]||null:null,'attributes':_0x3788b2[_0xdcde('0x1d')]?_0x3788b2[_0xdcde('0x1d')]['attributes']||null:null,'limit':_0x3788b2[_0xdcde('0x1d')]?_0x3788b2['options'][_0xdcde('0x20')]||null:null})[_0xdcde('0xe')](function(_0x8c4326){logger[_0xdcde('0x17')](_0xdcde('0x19'),_0x3788b2);logger['debug'](_0xdcde('0x19'),_0x3788b2,JSON['stringify'](_0x8c4326));_0x347503(_0x8c4326);})['catch'](function(_0x37fe7c){logger['error']('UpdateChatInteraction',_0x37fe7c[_0xdcde('0x16')],_0x3788b2);_0x2759b2(_0x2e40ae[_0xdcde('0x14')](0x1f4,_0x37fe7c[_0xdcde('0x16')]));});});};exports[_0xdcde('0x21')]=function(_0x5bdfcc){return new Promise(function(_0x303509,_0x3ec2e8){return db[_0xdcde('0x1a')][_0xdcde('0x22')]({'where':_0x5bdfcc['options']?_0x5bdfcc['options'][_0xdcde('0x1f')]||null:null})[_0xdcde('0xe')](function(_0x20b884){if(_0x20b884){return _0x20b884[_0xdcde('0x23')](_0x5bdfcc['body'][_0xdcde('0x24')],_[_0xdcde('0x25')](_0x5bdfcc[_0xdcde('0x1c')],[_0xdcde('0x24'),'id'])||{});}})[_0xdcde('0x26')](function(_0x28c144){logger[_0xdcde('0x17')](_0xdcde('0x27'),_0x5bdfcc);logger[_0xdcde('0x11')](_0xdcde('0x27'),_0x5bdfcc,JSON[_0xdcde('0x13')](_0x28c144));_0x303509(_0x28c144);})[_0xdcde('0x18')](function(_0x837fa9){logger[_0xdcde('0x14')](_0xdcde('0x27'),_0x837fa9[_0xdcde('0x16')],_0x5bdfcc);_0x3ec2e8(_this[_0xdcde('0x14')](0x1f4,_0x837fa9[_0xdcde('0x16')]));});});}; \ No newline at end of file +var _0x8e49=['http','redis','localhost','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','update','options','where','attributes','limit','then','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','ChatInteraction','addTags','omit','body','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x44089b,_0x94258a){var _0x3df97b=function(_0x5e8b17){while(--_0x5e8b17){_0x44089b['push'](_0x44089b['shift']());}};_0x3df97b(++_0x94258a);}(_0x8e49,0xc0));var _0x98e4=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x8e49[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0x98e4('0x0'));var util=require(_0x98e4('0x1'));var moment=require(_0x98e4('0x2'));var BPromise=require(_0x98e4('0x3'));var rs=require(_0x98e4('0x4'));var fs=require('fs');var Redis=require(_0x98e4('0x5'));var db=require(_0x98e4('0x6'))['db'];var utils=require(_0x98e4('0x7'));var logger=require(_0x98e4('0x8'))(_0x98e4('0x9'));var config=require(_0x98e4('0xa'));var jayson=require(_0x98e4('0xb'));var client=jayson[_0x98e4('0xc')][_0x98e4('0xd')]({'port':0x232a});config[_0x98e4('0xe')]=_['defaults'](config[_0x98e4('0xe')],{'host':_0x98e4('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3abc85,_0x3bd1f0,_0x4ece51){return new BPromise(function(_0x21b090,_0x38498a){return client[_0x98e4('0x10')](_0x3abc85,_0x4ece51)['then'](function(_0x52d2d7){logger['info'](_0x98e4('0x11'),_0x3bd1f0,_0x98e4('0x12'));logger[_0x98e4('0x13')](_0x98e4('0x14'),_0x3bd1f0,_0x98e4('0x12'),JSON['stringify'](_0x52d2d7));if(_0x52d2d7['error']){if(_0x52d2d7[_0x98e4('0x15')][_0x98e4('0x16')]===0x1f4){logger['error'](_0x98e4('0x11'),_0x3bd1f0,_0x52d2d7[_0x98e4('0x15')][_0x98e4('0x17')]);return _0x38498a(_0x52d2d7[_0x98e4('0x15')]['message']);}logger[_0x98e4('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3bd1f0,_0x52d2d7['error'][_0x98e4('0x17')]);return _0x21b090(_0x52d2d7[_0x98e4('0x15')][_0x98e4('0x17')]);}else{logger[_0x98e4('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3bd1f0,_0x98e4('0x12'));_0x21b090(_0x52d2d7['result']['message']);}})['catch'](function(_0x4704c4){logger[_0x98e4('0x15')](_0x98e4('0x11'),_0x3bd1f0,_0x4704c4);_0x38498a(_0x4704c4);});});}exports['UpdateChatInteraction']=function(_0x4795d8){var _0x269626=this;return new Promise(function(_0x2839ed,_0x82f293){return db['ChatInteraction'][_0x98e4('0x19')](_0x4795d8['body'],{'raw':_0x4795d8['options']?_0x4795d8['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4795d8[_0x98e4('0x1a')]?_0x4795d8[_0x98e4('0x1a')][_0x98e4('0x1b')]||null:null,'attributes':_0x4795d8['options']?_0x4795d8[_0x98e4('0x1a')][_0x98e4('0x1c')]||null:null,'limit':_0x4795d8[_0x98e4('0x1a')]?_0x4795d8[_0x98e4('0x1a')][_0x98e4('0x1d')]||null:null})[_0x98e4('0x1e')](function(_0x368cbf){logger[_0x98e4('0x18')](_0x98e4('0x1f'),_0x4795d8);logger[_0x98e4('0x13')](_0x98e4('0x1f'),_0x4795d8,JSON[_0x98e4('0x20')](_0x368cbf));_0x2839ed(_0x368cbf);})[_0x98e4('0x21')](function(_0x58dda3){logger['error'](_0x98e4('0x1f'),_0x58dda3['message'],_0x4795d8);_0x82f293(_0x269626[_0x98e4('0x15')](0x1f4,_0x58dda3[_0x98e4('0x17')]));});});};exports[_0x98e4('0x22')]=function(_0x43a365){return new Promise(function(_0x4da46b,_0xa6cdd8){return db[_0x98e4('0x23')]['find']({'where':_0x43a365[_0x98e4('0x1a')]?_0x43a365['options']['where']||null:null})['then'](function(_0x1cc800){if(_0x1cc800){return _0x1cc800[_0x98e4('0x24')](_0x43a365['body']['ids'],_[_0x98e4('0x25')](_0x43a365[_0x98e4('0x26')],[_0x98e4('0x27'),'id'])||{});}})['spread'](function(_0x5d22f3){logger['info']('AddTags',_0x43a365);logger['debug'](_0x98e4('0x28'),_0x43a365,JSON[_0x98e4('0x20')](_0x5d22f3));_0x4da46b(_0x5d22f3);})['catch'](function(_0x1b0df5){logger[_0x98e4('0x15')](_0x98e4('0x28'),_0x1b0df5[_0x98e4('0x17')],_0x43a365);_0xa6cdd8(_this['error'](0x1f4,_0x1b0df5[_0x98e4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index daee561..7a637bb 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 _0x566c=['removeListener','register','length','chatInteraction:','save','remove','emit'];(function(_0x1aecf8,_0x3c94a3){var _0x49afe1=function(_0x5a3212){while(--_0x5a3212){_0x1aecf8['push'](_0x1aecf8['shift']());}};_0x49afe1(++_0x3c94a3);}(_0x566c,0x1e0));var _0xc566=function(_0x405b24,_0x2a9264){_0x405b24=_0x405b24-0x0;var _0x1a799b=_0x566c[_0x405b24];return _0x1a799b;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xc566('0x0'),_0xc566('0x1'),'update'];function createListener(_0x3aaa22,_0x23ae4f){return function(_0x2c1210){_0x23ae4f[_0xc566('0x2')](_0x3aaa22,_0x2c1210);};}function removeListener(_0x52c817,_0x4e1dad){return function(){ChatInteractionEvents[_0xc566('0x3')](_0x52c817,_0x4e1dad);};}exports[_0xc566('0x4')]=function(_0x10e281){for(var _0x42876c=0x0,_0x1c7f66=events[_0xc566('0x5')];_0x42876c<_0x1c7f66;_0x42876c++){var _0x375780=events[_0x42876c];var _0x1cfc3f=createListener(_0xc566('0x6')+_0x375780,_0x10e281);ChatInteractionEvents['on'](_0x375780,_0x1cfc3f);}}; \ No newline at end of file +var _0x9e29=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x9e29,0xf4));var _0x99e2=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x9e29[_0x12fc8d];return _0x3f9d04;};'use strict';var ChatInteractionEvents=require(_0x99e2('0x0'));var events=[_0x99e2('0x1'),_0x99e2('0x2'),_0x99e2('0x3')];function createListener(_0x839be5,_0x21e46e){return function(_0x52a13f){_0x21e46e['emit'](_0x839be5,_0x52a13f);};}function removeListener(_0x2f37fe,_0x38d026){return function(){ChatInteractionEvents[_0x99e2('0x4')](_0x2f37fe,_0x38d026);};}exports[_0x99e2('0x5')]=function(_0x1c5d41){for(var _0x42edac=0x0,_0x19021d=events[_0x99e2('0x6')];_0x42edac<_0x19021d;_0x42edac++){var _0x14d341=events[_0x42edac];var _0x44c8fc=createListener(_0x99e2('0x7')+_0x14d341,_0x1c5d41);ChatInteractionEvents['on'](_0x14d341,_0x44c8fc);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 7bed3df..f7c7a5b 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 _0x65e3=['isAuthenticated','index','/describe','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get'];(function(_0x2de121,_0x14107d){var _0x3ff9aa=function(_0x55ba54){while(--_0x55ba54){_0x2de121['push'](_0x2de121['shift']());}};_0x3ff9aa(++_0x14107d);}(_0x65e3,0x12f));var _0x365e=function(_0x54d3ad,_0x4bb204){_0x54d3ad=_0x54d3ad-0x0;var _0x7c1cb2=_0x65e3[_0x54d3ad];return _0x7c1cb2;};'use strict';var multer=require(_0x365e('0x0'));var util=require(_0x365e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x365e('0x2'));var router=express[_0x365e('0x3')]();var fs_extra=require(_0x365e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x365e('0x5'));var config=require(_0x365e('0x6'));var controller=require(_0x365e('0x7'));router[_0x365e('0x8')]('/',auth[_0x365e('0x9')](),controller[_0x365e('0xa')]);router['get'](_0x365e('0xb'),auth[_0x365e('0x9')](),controller['describe']);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller['show']);router[_0x365e('0x8')](_0x365e('0xc'),auth[_0x365e('0xd')](),controller[_0x365e('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x365e('0xf')]);router[_0x365e('0x8')](_0x365e('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x365e('0x11')]);router[_0x365e('0x8')](_0x365e('0x12'),auth[_0x365e('0x9')](),controller[_0x365e('0x13')]);router[_0x365e('0x14')]('/',auth[_0x365e('0x9')](),controller[_0x365e('0x15')]);router[_0x365e('0x14')](_0x365e('0x16'),auth['isAuthenticated'](),controller[_0x365e('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f0878,_0x233ebf,_0xe3c32a){_0xe3c32a(null,path[_0x365e('0x18')](config['root'],_0x365e('0x19')));},'filename':function(_0x2119e2,_0x360222,_0x26083d){_0x26083d(null,util[_0x365e('0x1a')](_0x365e('0x1b'),Date[_0x365e('0x1c')](),_0x360222[_0x365e('0x1d')][_0x365e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x365e('0x14')](_0x365e('0x1f'),upload[_0x365e('0x20')](_0x365e('0x21')),controller[_0x365e('0x22')]);router['post'](_0x365e('0x23'),auth[_0x365e('0xd')](),controller[_0x365e('0x24')]);router['post'](_0x365e('0x25'),auth[_0x365e('0x9')](),interaction[_0x365e('0x26')](_0x365e('0x27'),'chatinteraction:addtags'),controller[_0x365e('0x28')]);router[_0x365e('0x29')](_0x365e('0x2a'),auth[_0x365e('0x9')](),interaction[_0x365e('0x26')](_0x365e('0x27'),_0x365e('0x2b')),controller[_0x365e('0x2c')]);router['put']('/:id/custom_update',controller[_0x365e('0x2d')]);router['put']('/:id/abandon',auth[_0x365e('0xd')](),controller[_0x365e('0x2e')]);router[_0x365e('0x29')](_0x365e('0x2f'),controller[_0x365e('0x30')]);router[_0x365e('0x31')]('/:id',auth[_0x365e('0x9')](),interaction[_0x365e('0x26')]('chat',_0x365e('0x32')),controller['destroy']);router[_0x365e('0x31')](_0x365e('0x25'),auth[_0x365e('0x9')](),controller['removeTags']);module[_0x365e('0x33')]=router; \ No newline at end of file +var _0x926b=['show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/','originalname','replace','single','addMessage','tracked','chatinteraction:addtags','addTags','chat','update','put','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x926b,0x199));var _0xb926=function(_0x3f9729,_0x25bead){_0x3f9729=_0x3f9729-0x0;var _0x1c6055=_0x926b[_0x3f9729];return _0x1c6055;};'use strict';var multer=require(_0xb926('0x0'));var util=require('util');var path=require(_0xb926('0x1'));var timeout=require(_0xb926('0x2'));var express=require(_0xb926('0x3'));var router=express['Router']();var fs_extra=require(_0xb926('0x4'));var auth=require(_0xb926('0x5'));var interaction=require(_0xb926('0x6'));var config=require('../../config/environment');var controller=require(_0xb926('0x7'));router[_0xb926('0x8')]('/',auth[_0xb926('0x9')](),controller[_0xb926('0xa')]);router['get']('/describe',auth[_0xb926('0x9')](),controller[_0xb926('0xb')]);router['get'](_0xb926('0xc'),auth[_0xb926('0xd')](),controller[_0xb926('0xe')]);router[_0xb926('0x8')](_0xb926('0xf'),auth[_0xb926('0xd')](),controller[_0xb926('0x10')]);router['get'](_0xb926('0x11'),auth['isAuthenticated'](),controller[_0xb926('0x12')]);router['get'](_0xb926('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0xb926('0x8')](_0xb926('0x14'),auth[_0xb926('0x9')](),controller[_0xb926('0x15')]);router[_0xb926('0x16')]('/',auth[_0xb926('0x9')](),controller[_0xb926('0x17')]);router[_0xb926('0x16')](_0xb926('0x18'),auth[_0xb926('0x9')](),controller[_0xb926('0x19')]);var upload=multer({'storage':multer[_0xb926('0x1a')]({'destination':function(_0x215657,_0x1e4d27,_0xc246a0){_0xc246a0(null,path['join'](config[_0xb926('0x1b')],_0xb926('0x1c')));},'filename':function(_0x19890a,_0x102b3c,_0x35d4a5){_0x35d4a5(null,util['format']('%s-%s',Date['now'](),_0x102b3c[_0xb926('0x1d')][_0xb926('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0xb926('0x1f')]('file'),controller['attachmentUpload']);router[_0xb926('0x16')](_0xb926('0x11'),auth[_0xb926('0xd')](),controller[_0xb926('0x20')]);router[_0xb926('0x16')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xb926('0x21')]('chat',_0xb926('0x22')),controller[_0xb926('0x23')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0xb926('0x21')](_0xb926('0x24'),'chatinteraction:update'),controller[_0xb926('0x25')]);router[_0xb926('0x26')]('/:id/custom_update',controller[_0xb926('0x27')]);router[_0xb926('0x26')](_0xb926('0x28'),auth[_0xb926('0xd')](),controller[_0xb926('0x29')]);router[_0xb926('0x26')]('/:id/close',controller['close']);router[_0xb926('0x2a')](_0xb926('0xc'),auth[_0xb926('0x9')](),interaction[_0xb926('0x21')]('chat',_0xb926('0x2b')),controller[_0xb926('0x2c')]);router[_0xb926('0x2a')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb926('0x2d')]);module[_0xb926('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 0b92552..b26fd25 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 _0xadc0=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x2f7784,_0x28a499){var _0x2843cd=function(_0xaa1341){while(--_0xaa1341){_0x2f7784['push'](_0x2f7784['shift']());}};_0x2843cd(++_0x28a499);}(_0xadc0,0x100));var _0x0adc=function(_0x164a23,_0x1787cf){_0x164a23=_0x164a23-0x0;var _0x4135c3=_0xadc0[_0x164a23];return _0x4135c3;};'use strict';var Sequelize=require(_0x0adc('0x0'));module['exports']={'body':{'type':Sequelize[_0x0adc('0x1')](_0x0adc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0adc('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0adc('0x4')]}}; \ No newline at end of file +var _0xe199=['TEXT','INTEGER','sequelize'];(function(_0x103bae,_0x1b31e2){var _0x557e8a=function(_0x20c466){while(--_0x20c466){_0x103bae['push'](_0x103bae['shift']());}};_0x557e8a(++_0x1b31e2);}(_0xe199,0x1a6));var _0x9e19=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xe199[_0x3f993e];return _0x39c135;};'use strict';var Sequelize=require(_0x9e19('0x0'));module['exports']={'body':{'type':Sequelize[_0x9e19('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9e19('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index dcac6c5..16406a9 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 _0x9dbe=['status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','params','find','catch','create','body','update','destroy','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x1704f7,_0x5e0ca3){var _0x5c20b4=function(_0x50175d){while(--_0x50175d){_0x1704f7['push'](_0x1704f7['shift']());}};_0x5c20b4(++_0x5e0ca3);}(_0x9dbe,0xc2));var _0xe9db=function(_0x29a580,_0xc0cfbb){_0x29a580=_0x29a580-0x0;var _0x196b8c=_0x9dbe[_0x29a580];return _0x196b8c;};'use strict';var emlformat=require(_0xe9db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9db('0x1'));var jsonpatch=require(_0xe9db('0x2'));var rp=require(_0xe9db('0x3'));var moment=require(_0xe9db('0x4'));var BPromise=require(_0xe9db('0x5'));var Mustache=require(_0xe9db('0x6'));var util=require('util');var path=require(_0xe9db('0x7'));var sox=require(_0xe9db('0x8'));var csv=require(_0xe9db('0x9'));var ejs=require(_0xe9db('0xa'));var fs=require('fs');var fs_extra=require(_0xe9db('0xb'));var _=require('lodash');var squel=require(_0xe9db('0xc'));var crypto=require(_0xe9db('0xd'));var jsforce=require(_0xe9db('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe9db('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9db('0xf'));var authService=require(_0xe9db('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9db('0x11'))(_0xe9db('0x12'));var utils=require(_0xe9db('0x13'));var config=require(_0xe9db('0x14'));var licenseUtil=require(_0xe9db('0x15'));var db=require('../../mysqldb')['db'];config[_0xe9db('0x16')]=_[_0xe9db('0x17')](config['redis'],{'host':_0xe9db('0x18'),'port':0x18eb});var socket=require(_0xe9db('0x19'))(new Redis(config[_0xe9db('0x16')]));require(_0xe9db('0x1a'))[_0xe9db('0x1b')](socket);function respondWithStatusCode(_0x543155,_0x10aadc){_0x10aadc=_0x10aadc||0xcc;return function(_0x30f782){if(_0x30f782){return _0x543155['sendStatus'](_0x10aadc);}return _0x543155[_0xe9db('0x1c')](_0x10aadc)[_0xe9db('0x1d')]();};}function respondWithResult(_0x9f5e83,_0x5c1691){_0x5c1691=_0x5c1691||0xc8;return function(_0x4a53d9){if(_0x4a53d9){return _0x9f5e83[_0xe9db('0x1c')](_0x5c1691)[_0xe9db('0x1e')](_0x4a53d9);}};}function respondWithFilteredResult(_0x55c357,_0x56716f){return function(_0x522705){if(_0x522705){var _0x1ec863=typeof _0x56716f['offset']===_0xe9db('0x1f')&&typeof _0x56716f['limit']===_0xe9db('0x1f');var _0x38df36=_0x522705['count'];var _0xe40f58=_0x1ec863?0x0:_0x56716f[_0xe9db('0x20')];var _0x18b720=_0x1ec863?_0x522705[_0xe9db('0x21')]:_0x56716f[_0xe9db('0x20')]+_0x56716f[_0xe9db('0x22')];var _0x477cfd;if(_0x18b720>=_0x38df36){_0x18b720=_0x38df36;_0x477cfd=0xc8;}else{_0x477cfd=0xce;}_0x55c357[_0xe9db('0x1c')](_0x477cfd);return _0x55c357[_0xe9db('0x23')](_0xe9db('0x24'),_0xe40f58+'-'+_0x18b720+'/'+_0x38df36)['json'](_0x522705);}return null;};}function patchUpdates(_0x5320e6){return function(_0x535f84){try{jsonpatch[_0xe9db('0x25')](_0x535f84,_0x5320e6,!![]);}catch(_0x44c7e8){return BPromise[_0xe9db('0x26')](_0x44c7e8);}return _0x535f84[_0xe9db('0x27')]();};}function saveUpdates(_0x459817,_0x38e452){return function(_0xe5a7cc){if(_0xe5a7cc){return _0xe5a7cc['update'](_0x459817)[_0xe9db('0x28')](function(_0x240552){return _0x240552;});}return null;};}function removeEntity(_0x22ebc6,_0x1f3f60){return function(_0xf6f256){if(_0xf6f256){return _0xf6f256['destroy']()[_0xe9db('0x28')](function(){_0x22ebc6[_0xe9db('0x1c')](0xcc)[_0xe9db('0x1d')]();});}};}function handleEntityNotFound(_0x2efa9d,_0x9b11f2){return function(_0x4f7eb3){if(!_0x4f7eb3){_0x2efa9d['sendStatus'](0x194);}return _0x4f7eb3;};}function handleError(_0x43cf01,_0x495ba6){_0x495ba6=_0x495ba6||0x1f4;return function(_0x5538b0){logger[_0xe9db('0x29')](_0x5538b0[_0xe9db('0x2a')]);if(_0x5538b0[_0xe9db('0x2b')]){delete _0x5538b0[_0xe9db('0x2b')];}_0x43cf01[_0xe9db('0x1c')](_0x495ba6)[_0xe9db('0x2c')](_0x5538b0);};}exports[_0xe9db('0x2d')]=function(_0x3b0683,_0x47eaef){var _0x44c29b={},_0x24e71c={},_0x457e93={'count':0x0,'rows':[]};var _0x1aeb5d=_[_0xe9db('0x2e')](db['ChatInternalMessage'][_0xe9db('0x2f')],function(_0x349ea){return{'name':_0x349ea[_0xe9db('0x30')],'type':_0x349ea[_0xe9db('0x31')][_0xe9db('0x32')]};});_0x24e71c[_0xe9db('0x33')]=_[_0xe9db('0x2e')](_0x1aeb5d,_0xe9db('0x2b'));_0x24e71c[_0xe9db('0x34')]=_[_0xe9db('0x35')](_0x3b0683['query']);_0x24e71c[_0xe9db('0x36')]=_[_0xe9db('0x37')](_0x24e71c[_0xe9db('0x33')],_0x24e71c['query']);_0x44c29b[_0xe9db('0x38')]=_[_0xe9db('0x37')](_0x24e71c['model'],qs[_0xe9db('0x39')](_0x3b0683[_0xe9db('0x34')][_0xe9db('0x39')]));_0x44c29b[_0xe9db('0x38')]=_0x44c29b[_0xe9db('0x38')][_0xe9db('0x3a')]?_0x44c29b[_0xe9db('0x38')]:_0x24e71c[_0xe9db('0x33')];if(!_0x3b0683[_0xe9db('0x34')]['hasOwnProperty'](_0xe9db('0x3b'))){_0x44c29b['limit']=qs[_0xe9db('0x22')](_0x3b0683['query'][_0xe9db('0x22')]);_0x44c29b['offset']=qs[_0xe9db('0x20')](_0x3b0683[_0xe9db('0x34')]['offset']);}_0x44c29b[_0xe9db('0x3c')]=qs[_0xe9db('0x3d')](_0x3b0683[_0xe9db('0x34')]['sort']);_0x44c29b[_0xe9db('0x3e')]=qs[_0xe9db('0x36')](_[_0xe9db('0x3f')](_0x3b0683['query'],_0x24e71c[_0xe9db('0x36')]),_0x1aeb5d);if(_0x3b0683['query'][_0xe9db('0x40')]){_0x44c29b[_0xe9db('0x3e')]=_[_0xe9db('0x41')](_0x44c29b[_0xe9db('0x3e')],{'$or':_[_0xe9db('0x2e')](_0x1aeb5d,function(_0x4d96b1){if(_0x4d96b1['type']!==_0xe9db('0x42')){var _0x254cae={};_0x254cae[_0x4d96b1[_0xe9db('0x2b')]]={'$like':'%'+_0x3b0683[_0xe9db('0x34')][_0xe9db('0x40')]+'%'};return _0x254cae;}})});}_0x44c29b=_['merge']({},_0x44c29b,_0x3b0683[_0xe9db('0x43')]);var _0x3bc466={'where':_0x44c29b[_0xe9db('0x3e')]};return db[_0xe9db('0x44')][_0xe9db('0x21')](_0x3bc466)['then'](function(_0x3929d5){_0x457e93[_0xe9db('0x21')]=_0x3929d5;if(_0x3b0683[_0xe9db('0x34')][_0xe9db('0x45')]){_0x44c29b[_0xe9db('0x46')]=[{'all':!![]}];}return db[_0xe9db('0x44')][_0xe9db('0x47')](_0x44c29b);})[_0xe9db('0x28')](function(_0x372aa5){_0x457e93['rows']=_0x372aa5;return _0x457e93;})[_0xe9db('0x28')](respondWithFilteredResult(_0x47eaef,_0x44c29b))['catch'](handleError(_0x47eaef,null));};exports['show']=function(_0x7b23d1,_0x21ddf1){var _0x31c96a={'raw':!![],'where':{'id':_0x7b23d1[_0xe9db('0x48')]['id']}},_0x10e518={};_0x10e518[_0xe9db('0x33')]=_[_0xe9db('0x35')](db[_0xe9db('0x44')][_0xe9db('0x2f')]);_0x10e518[_0xe9db('0x34')]=_[_0xe9db('0x35')](_0x7b23d1[_0xe9db('0x34')]);_0x10e518[_0xe9db('0x36')]=_[_0xe9db('0x37')](_0x10e518['model'],_0x10e518[_0xe9db('0x34')]);_0x31c96a['attributes']=_[_0xe9db('0x37')](_0x10e518[_0xe9db('0x33')],qs[_0xe9db('0x39')](_0x7b23d1[_0xe9db('0x34')][_0xe9db('0x39')]));_0x31c96a[_0xe9db('0x38')]=_0x31c96a['attributes'][_0xe9db('0x3a')]?_0x31c96a[_0xe9db('0x38')]:_0x10e518[_0xe9db('0x33')];if(_0x7b23d1[_0xe9db('0x34')][_0xe9db('0x45')]){_0x31c96a[_0xe9db('0x46')]=[{'all':!![]}];}_0x31c96a=_[_0xe9db('0x41')]({},_0x31c96a,_0x7b23d1['options']);return db[_0xe9db('0x44')][_0xe9db('0x49')](_0x31c96a)[_0xe9db('0x28')](handleEntityNotFound(_0x21ddf1,null))[_0xe9db('0x28')](respondWithResult(_0x21ddf1,null))[_0xe9db('0x4a')](handleError(_0x21ddf1,null));};exports[_0xe9db('0x4b')]=function(_0x26cf1a,_0x1de6e8){return db[_0xe9db('0x44')]['create'](_0x26cf1a[_0xe9db('0x4c')],{})['then'](respondWithResult(_0x1de6e8,0xc9))[_0xe9db('0x4a')](handleError(_0x1de6e8,null));};exports[_0xe9db('0x4d')]=function(_0x5cb6d4,_0x3b44f0){if(_0x5cb6d4[_0xe9db('0x4c')]['id']){delete _0x5cb6d4['body']['id'];}return db[_0xe9db('0x44')][_0xe9db('0x49')]({'where':{'id':_0x5cb6d4['params']['id']}})[_0xe9db('0x28')](handleEntityNotFound(_0x3b44f0,null))[_0xe9db('0x28')](saveUpdates(_0x5cb6d4['body'],null))[_0xe9db('0x28')](respondWithResult(_0x3b44f0,null))[_0xe9db('0x4a')](handleError(_0x3b44f0,null));};exports[_0xe9db('0x4e')]=function(_0x135c4f,_0x21c156){return db['ChatInternalMessage'][_0xe9db('0x49')]({'where':{'id':_0x135c4f[_0xe9db('0x48')]['id']}})[_0xe9db('0x28')](handleEntityNotFound(_0x21c156,null))[_0xe9db('0x28')](removeEntity(_0x21c156,null))[_0xe9db('0x4a')](handleError(_0x21c156,null));};exports[_0xe9db('0x4f')]=function(_0x9cdb9d,_0xfc55fc){return db[_0xe9db('0x44')][_0xe9db('0x4f')]()[_0xe9db('0x28')](respondWithResult(_0xfc55fc,null))[_0xe9db('0x4a')](handleError(_0xfc55fc,null));};function wrapUser(_0x5ea94c){return function(_0x33c9cd){var _0x4e6749=_0x5ea94c[_0xe9db('0x50')]({'plain':!![]});_0x4e6749[_0xe9db('0x51')]=[];if(_0x33c9cd){_0x4e6749['lastMessageAt']=_0x33c9cd[_0xe9db('0x52')];_0x4e6749[_0xe9db('0x53')]=_0x33c9cd;}else{_0x4e6749['lastMessageAt']=moment(0x0)[_0xe9db('0x54')](_0xe9db('0x55'));_0x4e6749[_0xe9db('0x53')]={};}return _0x4e6749;};}exports[_0xe9db('0x56')]=function(_0x520c59,_0x550e90,_0x240d58){var _0x5dd205=[];return db[_0xe9db('0x57')][_0xe9db('0x47')]({'where':{'role':[_0xe9db('0x58'),_0xe9db('0x59'),_0xe9db('0x5a')]},'attributes':['id',_0xe9db('0x5b'),_0xe9db('0x2b'),_0xe9db('0x5c'),_0xe9db('0x5d'),_0xe9db('0x5e'),_0xe9db('0x5f'),_0xe9db('0x60'),'allowmessenger','showWebBar'],'order':qs['sort'](_0xe9db('0x61')),'include':[{'model':db[_0xe9db('0x62')],'as':_0xe9db('0x63'),'attributes':['id',_0xe9db('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xe9db('0x28')](function(_0x3dec3d){if(_0x3dec3d){var _0x401a0b=_0x520c59[_0xe9db('0x5a')]['get']({'plain':!![]});if(!_0x401a0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x401a0b[_0xe9db('0x5c')]===_0xe9db('0x5a')){return db[_0xe9db('0x64')][_0xe9db('0x49')]({'where':{'name':_0xe9db('0x65'),'userProfileId':_0x401a0b['userProfileId']},'raw':!![]})[_0xe9db('0x28')](function(_0x3c8828){if(_0x3c8828){if(_0x3c8828[_0xe9db('0x66')]===0x0){return db[_0xe9db('0x67')]['findAll']({'where':{'sectionId':_0x3c8828['id']},'raw':!![]})[_0xe9db('0x28')](function(_0x4db750){var _0x3e7446=[];if(_[_0xe9db('0x68')](_0x4db750)){_0x3e7446=_[_0xe9db('0x40')](_0x3dec3d,function(_0x45e9ca){if(_0x45e9ca[_0xe9db('0x5c')]!==_0xe9db('0x58')){return _0x45e9ca;}});return _0x3e7446;}else{for(var _0x5c6c0a=0x0;_0x5c6c0a<_0x3dec3d[_0xe9db('0x3a')];_0x5c6c0a++){var _0x508e9d=_0x3dec3d[_0x5c6c0a];if(_0x508e9d['role']===_0xe9db('0x58')){var _0x351580=_[_0xe9db('0x49')](_0x4db750,function(_0x1288c6){return _0x1288c6[_0xe9db('0x69')]===_0x508e9d['id'];});if(_0x351580)_0x3e7446[_0xe9db('0x6a')](_0x508e9d);}else{_0x3e7446['push'](_0x508e9d);}}return _0x3e7446;}});}else{return _0x3dec3d;}}else{var _0x370467=_[_0xe9db('0x40')](_0x3dec3d,function(_0x156561){if(_0x156561[_0xe9db('0x5c')]!==_0xe9db('0x58')){return _0x156561;}});return _0x370467;}});}else{return _0x3dec3d;}}})['then'](function(_0x17e3a7){var _0x46f7a5=[];if(_0x17e3a7){_0x5dd205=_0x17e3a7;for(var _0x408958=0x0;_0x408958<_0x17e3a7[_0xe9db('0x3a')];_0x408958+=0x1){_0x5dd205[_0x408958][_0xe9db('0x51')]=[];_0x46f7a5[_0xe9db('0x6a')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x520c59[_0xe9db('0x5a')]['id'],_0x17e3a7[_0x408958]['id']],'ToId':[_0x520c59[_0xe9db('0x5a')]['id'],_0x17e3a7[_0x408958]['id']],'ChatGroupId':null},'attributes':['id',_0xe9db('0x52'),_0xe9db('0x6b'),_0xe9db('0x6c'),'read',_0xe9db('0x4c')],'order':qs[_0xe9db('0x3d')](_0xe9db('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe9db('0x28')](wrapUser(_0x17e3a7[_0x408958])));}return BPromise[_0xe9db('0x6e')](_0x46f7a5);}return[];})['then'](function(_0x2703ab){return{'rows':_0x2703ab,'count':_0x2703ab[_0xe9db('0x3a')]};})[_0xe9db('0x28')](respondWithResult(_0x550e90,null))[_0xe9db('0x4a')](handleError(_0x550e90,null));}; \ No newline at end of file +var _0xd2eb=['includeAll','include','findAll','rows','catch','show','create','body','params','destroy','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','role','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','autoAssociation','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatInternalMessage'];(function(_0x5823e2,_0x5ec575){var _0xa50dee=function(_0x598714){while(--_0x598714){_0x5823e2['push'](_0x5823e2['shift']());}};_0xa50dee(++_0x5ec575);}(_0xd2eb,0x8d));var _0xbd2e=function(_0x4aa285,_0x1fe00d){_0x4aa285=_0x4aa285-0x0;var _0x2777ee=_0xd2eb[_0x4aa285];return _0x2777ee;};'use strict';var emlformat=require(_0xbd2e('0x0'));var rimraf=require(_0xbd2e('0x1'));var zipdir=require(_0xbd2e('0x2'));var jsonpatch=require(_0xbd2e('0x3'));var rp=require('request-promise');var moment=require(_0xbd2e('0x4'));var BPromise=require(_0xbd2e('0x5'));var Mustache=require(_0xbd2e('0x6'));var util=require(_0xbd2e('0x7'));var path=require(_0xbd2e('0x8'));var sox=require(_0xbd2e('0x9'));var csv=require(_0xbd2e('0xa'));var ejs=require(_0xbd2e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbd2e('0xc'));var jsforce=require(_0xbd2e('0xd'));var deskjs=require(_0xbd2e('0xe'));var toCsv=require(_0xbd2e('0xa'));var querystring=require(_0xbd2e('0xf'));var Papa=require(_0xbd2e('0x10'));var Redis=require(_0xbd2e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbd2e('0x12'));var as=require(_0xbd2e('0x13'));var hardwareService=require(_0xbd2e('0x14'));var logger=require(_0xbd2e('0x15'))('api');var utils=require(_0xbd2e('0x16'));var config=require(_0xbd2e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbd2e('0x18')]=_[_0xbd2e('0x19')](config[_0xbd2e('0x18')],{'host':_0xbd2e('0x1a'),'port':0x18eb});var socket=require(_0xbd2e('0x1b'))(new Redis(config[_0xbd2e('0x18')]));require('./chatInternalMessage.socket')[_0xbd2e('0x1c')](socket);function respondWithStatusCode(_0x45e39c,_0x38b87c){_0x38b87c=_0x38b87c||0xcc;return function(_0x238729){if(_0x238729){return _0x45e39c[_0xbd2e('0x1d')](_0x38b87c);}return _0x45e39c[_0xbd2e('0x1e')](_0x38b87c)[_0xbd2e('0x1f')]();};}function respondWithResult(_0x22d0e4,_0x4102b1){_0x4102b1=_0x4102b1||0xc8;return function(_0x2f5ab3){if(_0x2f5ab3){return _0x22d0e4[_0xbd2e('0x1e')](_0x4102b1)[_0xbd2e('0x20')](_0x2f5ab3);}};}function respondWithFilteredResult(_0x3484a7,_0x30ff99){return function(_0x1caa2c){if(_0x1caa2c){var _0x1691a3=typeof _0x30ff99['offset']==='undefined'&&typeof _0x30ff99['limit']===_0xbd2e('0x21');var _0x4a5bf8=_0x1caa2c[_0xbd2e('0x22')];var _0x3a523e=_0x1691a3?0x0:_0x30ff99[_0xbd2e('0x23')];var _0x89b3a8=_0x1691a3?_0x1caa2c[_0xbd2e('0x22')]:_0x30ff99[_0xbd2e('0x23')]+_0x30ff99[_0xbd2e('0x24')];var _0xeae289;if(_0x89b3a8>=_0x4a5bf8){_0x89b3a8=_0x4a5bf8;_0xeae289=0xc8;}else{_0xeae289=0xce;}_0x3484a7[_0xbd2e('0x1e')](_0xeae289);return _0x3484a7[_0xbd2e('0x25')](_0xbd2e('0x26'),_0x3a523e+'-'+_0x89b3a8+'/'+_0x4a5bf8)[_0xbd2e('0x20')](_0x1caa2c);}return null;};}function patchUpdates(_0x1bb30f){return function(_0x3ef12){try{jsonpatch[_0xbd2e('0x27')](_0x3ef12,_0x1bb30f,!![]);}catch(_0xd224a3){return BPromise['reject'](_0xd224a3);}return _0x3ef12[_0xbd2e('0x28')]();};}function saveUpdates(_0x37c675,_0x21d8d1){return function(_0x1f8934){if(_0x1f8934){return _0x1f8934[_0xbd2e('0x29')](_0x37c675)['then'](function(_0x4a1571){return _0x4a1571;});}return null;};}function removeEntity(_0x3341a1,_0x442888){return function(_0x162b7e){if(_0x162b7e){return _0x162b7e['destroy']()[_0xbd2e('0x2a')](function(){_0x3341a1[_0xbd2e('0x1e')](0xcc)[_0xbd2e('0x1f')]();});}};}function handleEntityNotFound(_0xda13eb,_0x2ed288){return function(_0x2c8ee9){if(!_0x2c8ee9){_0xda13eb[_0xbd2e('0x1d')](0x194);}return _0x2c8ee9;};}function handleError(_0x185113,_0xa37e75){_0xa37e75=_0xa37e75||0x1f4;return function(_0x5f1db9){logger[_0xbd2e('0x2b')](_0x5f1db9[_0xbd2e('0x2c')]);if(_0x5f1db9[_0xbd2e('0x2d')]){delete _0x5f1db9[_0xbd2e('0x2d')];}_0x185113['status'](_0xa37e75)['send'](_0x5f1db9);};}exports['index']=function(_0x5ada25,_0x3558dc){var _0x255761={},_0x4b8ef={},_0x222468={'count':0x0,'rows':[]};var _0x333582=_['map'](db['ChatInternalMessage'][_0xbd2e('0x2e')],function(_0xb721d1){return{'name':_0xb721d1['fieldName'],'type':_0xb721d1['type'][_0xbd2e('0x2f')]};});_0x4b8ef[_0xbd2e('0x30')]=_[_0xbd2e('0x31')](_0x333582,_0xbd2e('0x2d'));_0x4b8ef[_0xbd2e('0x32')]=_[_0xbd2e('0x33')](_0x5ada25[_0xbd2e('0x32')]);_0x4b8ef[_0xbd2e('0x34')]=_[_0xbd2e('0x35')](_0x4b8ef[_0xbd2e('0x30')],_0x4b8ef[_0xbd2e('0x32')]);_0x255761[_0xbd2e('0x36')]=_['intersection'](_0x4b8ef[_0xbd2e('0x30')],qs['fields'](_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x37')]));_0x255761[_0xbd2e('0x36')]=_0x255761[_0xbd2e('0x36')][_0xbd2e('0x38')]?_0x255761[_0xbd2e('0x36')]:_0x4b8ef[_0xbd2e('0x30')];if(!_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x39')](_0xbd2e('0x3a'))){_0x255761['limit']=qs[_0xbd2e('0x24')](_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x24')]);_0x255761[_0xbd2e('0x23')]=qs['offset'](_0x5ada25[_0xbd2e('0x32')]['offset']);}_0x255761[_0xbd2e('0x3b')]=qs[_0xbd2e('0x3c')](_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x3c')]);_0x255761['where']=qs['filters'](_[_0xbd2e('0x3d')](_0x5ada25[_0xbd2e('0x32')],_0x4b8ef['filters']),_0x333582);if(_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x3e')]){_0x255761[_0xbd2e('0x3f')]=_[_0xbd2e('0x40')](_0x255761[_0xbd2e('0x3f')],{'$or':_[_0xbd2e('0x31')](_0x333582,function(_0x2f10bd){if(_0x2f10bd[_0xbd2e('0x41')]!==_0xbd2e('0x42')){var _0x203608={};_0x203608[_0x2f10bd[_0xbd2e('0x2d')]]={'$like':'%'+_0x5ada25[_0xbd2e('0x32')]['filter']+'%'};return _0x203608;}})});}_0x255761=_[_0xbd2e('0x40')]({},_0x255761,_0x5ada25[_0xbd2e('0x43')]);var _0x1f53bc={'where':_0x255761[_0xbd2e('0x3f')]};return db[_0xbd2e('0x44')][_0xbd2e('0x22')](_0x1f53bc)[_0xbd2e('0x2a')](function(_0x1b112e){_0x222468[_0xbd2e('0x22')]=_0x1b112e;if(_0x5ada25[_0xbd2e('0x32')][_0xbd2e('0x45')]){_0x255761[_0xbd2e('0x46')]=[{'all':!![]}];}return db[_0xbd2e('0x44')][_0xbd2e('0x47')](_0x255761);})[_0xbd2e('0x2a')](function(_0x2a1cab){_0x222468[_0xbd2e('0x48')]=_0x2a1cab;return _0x222468;})[_0xbd2e('0x2a')](respondWithFilteredResult(_0x3558dc,_0x255761))[_0xbd2e('0x49')](handleError(_0x3558dc,null));};exports[_0xbd2e('0x4a')]=function(_0x5556c5,_0xf14e3){var _0x465bff={'raw':!![],'where':{'id':_0x5556c5['params']['id']}},_0x47a9e3={};_0x47a9e3['model']=_[_0xbd2e('0x33')](db[_0xbd2e('0x44')][_0xbd2e('0x2e')]);_0x47a9e3[_0xbd2e('0x32')]=_['keys'](_0x5556c5[_0xbd2e('0x32')]);_0x47a9e3[_0xbd2e('0x34')]=_[_0xbd2e('0x35')](_0x47a9e3[_0xbd2e('0x30')],_0x47a9e3[_0xbd2e('0x32')]);_0x465bff[_0xbd2e('0x36')]=_[_0xbd2e('0x35')](_0x47a9e3[_0xbd2e('0x30')],qs[_0xbd2e('0x37')](_0x5556c5[_0xbd2e('0x32')][_0xbd2e('0x37')]));_0x465bff[_0xbd2e('0x36')]=_0x465bff['attributes'][_0xbd2e('0x38')]?_0x465bff[_0xbd2e('0x36')]:_0x47a9e3[_0xbd2e('0x30')];if(_0x5556c5['query'][_0xbd2e('0x45')]){_0x465bff['include']=[{'all':!![]}];}_0x465bff=_[_0xbd2e('0x40')]({},_0x465bff,_0x5556c5['options']);return db[_0xbd2e('0x44')]['find'](_0x465bff)[_0xbd2e('0x2a')](handleEntityNotFound(_0xf14e3,null))[_0xbd2e('0x2a')](respondWithResult(_0xf14e3,null))[_0xbd2e('0x49')](handleError(_0xf14e3,null));};exports['create']=function(_0x47191c,_0x3564e4){return db[_0xbd2e('0x44')][_0xbd2e('0x4b')](_0x47191c[_0xbd2e('0x4c')],{})[_0xbd2e('0x2a')](respondWithResult(_0x3564e4,0xc9))[_0xbd2e('0x49')](handleError(_0x3564e4,null));};exports[_0xbd2e('0x29')]=function(_0x42a0ac,_0x2dee9d){if(_0x42a0ac[_0xbd2e('0x4c')]['id']){delete _0x42a0ac['body']['id'];}return db[_0xbd2e('0x44')]['find']({'where':{'id':_0x42a0ac[_0xbd2e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2dee9d,null))[_0xbd2e('0x2a')](saveUpdates(_0x42a0ac[_0xbd2e('0x4c')],null))[_0xbd2e('0x2a')](respondWithResult(_0x2dee9d,null))[_0xbd2e('0x49')](handleError(_0x2dee9d,null));};exports[_0xbd2e('0x4e')]=function(_0x3af300,_0x46935b){return db[_0xbd2e('0x44')][_0xbd2e('0x4f')]({'where':{'id':_0x3af300['params']['id']}})[_0xbd2e('0x2a')](handleEntityNotFound(_0x46935b,null))[_0xbd2e('0x2a')](removeEntity(_0x46935b,null))[_0xbd2e('0x49')](handleError(_0x46935b,null));};exports['describe']=function(_0x2f958a,_0x5c2a36){return db[_0xbd2e('0x44')][_0xbd2e('0x50')]()[_0xbd2e('0x2a')](respondWithResult(_0x5c2a36,null))[_0xbd2e('0x49')](handleError(_0x5c2a36,null));};function wrapUser(_0x524211){return function(_0x57e5b7){var _0x1973b4=_0x524211[_0xbd2e('0x51')]({'plain':!![]});_0x1973b4[_0xbd2e('0x52')]=[];if(_0x57e5b7){_0x1973b4[_0xbd2e('0x53')]=_0x57e5b7[_0xbd2e('0x54')];_0x1973b4[_0xbd2e('0x55')]=_0x57e5b7;}else{_0x1973b4[_0xbd2e('0x53')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1973b4[_0xbd2e('0x55')]={};}return _0x1973b4;};}exports[_0xbd2e('0x56')]=function(_0x5c1e32,_0x2b0d68,_0x26acc3){var _0xe93241=[];return db['User'][_0xbd2e('0x47')]({'where':{'role':[_0xbd2e('0x57'),_0xbd2e('0x58'),_0xbd2e('0x59')]},'attributes':['id',_0xbd2e('0x5a'),'name',_0xbd2e('0x5b'),'userpic','internal',_0xbd2e('0x5c'),'lastLoginAt',_0xbd2e('0x5d'),_0xbd2e('0x5e')],'order':qs[_0xbd2e('0x3c')](_0xbd2e('0x5f')),'include':[{'model':db[_0xbd2e('0x60')],'as':_0xbd2e('0x61'),'attributes':['id',_0xbd2e('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xbd2e('0x2a')](function(_0x21cae3){if(_0x21cae3){var _0x2606ae=_0x5c1e32['user']['get']({'plain':!![]});if(!_0x2606ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2606ae['role']===_0xbd2e('0x59')){return db['UserProfileSection'][_0xbd2e('0x4f')]({'where':{'name':'Agents','userProfileId':_0x2606ae['userProfileId']},'raw':!![]})[_0xbd2e('0x2a')](function(_0x229303){if(_0x229303){if(_0x229303[_0xbd2e('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x229303['id']},'raw':!![]})[_0xbd2e('0x2a')](function(_0x4291e2){var _0x1b3c74=[];if(_['isEmpty'](_0x4291e2)){_0x1b3c74=_[_0xbd2e('0x3e')](_0x21cae3,function(_0x2e4602){if(_0x2e4602[_0xbd2e('0x5b')]!==_0xbd2e('0x57')){return _0x2e4602;}});return _0x1b3c74;}else{for(var _0x25379f=0x0;_0x25379f<_0x21cae3[_0xbd2e('0x38')];_0x25379f++){var _0x26b3f0=_0x21cae3[_0x25379f];if(_0x26b3f0[_0xbd2e('0x5b')]===_0xbd2e('0x57')){var _0x525c0c=_[_0xbd2e('0x4f')](_0x4291e2,function(_0x1ab281){return _0x1ab281[_0xbd2e('0x63')]===_0x26b3f0['id'];});if(_0x525c0c)_0x1b3c74[_0xbd2e('0x64')](_0x26b3f0);}else{_0x1b3c74[_0xbd2e('0x64')](_0x26b3f0);}}return _0x1b3c74;}});}else{return _0x21cae3;}}else{var _0x5b2bbf=_[_0xbd2e('0x3e')](_0x21cae3,function(_0x3278e8){if(_0x3278e8[_0xbd2e('0x5b')]!=='agent'){return _0x3278e8;}});return _0x5b2bbf;}});}else{return _0x21cae3;}}})[_0xbd2e('0x2a')](function(_0x4881b8){var _0x20c716=[];if(_0x4881b8){_0xe93241=_0x4881b8;for(var _0x36631b=0x0;_0x36631b<_0x4881b8['length'];_0x36631b+=0x1){_0xe93241[_0x36631b][_0xbd2e('0x52')]=[];_0x20c716[_0xbd2e('0x64')](db[_0xbd2e('0x44')][_0xbd2e('0x4f')]({'where':{'FromId':[_0x5c1e32[_0xbd2e('0x59')]['id'],_0x4881b8[_0x36631b]['id']],'ToId':[_0x5c1e32[_0xbd2e('0x59')]['id'],_0x4881b8[_0x36631b]['id']],'ChatGroupId':null},'attributes':['id',_0xbd2e('0x54'),_0xbd2e('0x65'),_0xbd2e('0x66'),_0xbd2e('0x67'),_0xbd2e('0x4c')],'order':qs['sort'](_0xbd2e('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbd2e('0x2a')](wrapUser(_0x4881b8[_0x36631b])));}return BPromise['all'](_0x20c716);}return[];})[_0xbd2e('0x2a')](function(_0x56a8a8){return{'rows':_0x56a8a8,'count':_0x56a8a8[_0xbd2e('0x38')]};})[_0xbd2e('0x2a')](respondWithResult(_0x2b0d68,null))[_0xbd2e('0x49')](handleError(_0x2b0d68,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7ed2867..2e2412e 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 _0x6271=['ChatInternalMessage','save','update','hook','exports','events','../../mysqldb'];(function(_0x566f63,_0x637556){var _0x4e9fbd=function(_0x4afde7){while(--_0x4afde7){_0x566f63['push'](_0x566f63['shift']());}};_0x4e9fbd(++_0x637556);}(_0x6271,0x10f));var _0x1627=function(_0x3ae2a3,_0x2e629e){_0x3ae2a3=_0x3ae2a3-0x0;var _0x4809dc=_0x6271[_0x3ae2a3];return _0x4809dc;};'use strict';var EventEmitter=require(_0x1627('0x0'));var ChatInternalMessage=require(_0x1627('0x1'))['db'][_0x1627('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1627('0x3'),'afterUpdate':_0x1627('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29af0c){return function(_0x938bee,_0x4bf95e,_0x415bae){ChatInternalMessageEvents['emit'](_0x29af0c+':'+_0x938bee['id'],_0x938bee);ChatInternalMessageEvents['emit'](_0x29af0c,_0x938bee);_0x415bae(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x1627('0x5')](e,emitEvent(event));}}module[_0x1627('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xb0f6=['hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x1ae062,_0x250a42){var _0x1b2ab3=function(_0xc89406){while(--_0xc89406){_0x1ae062['push'](_0x1ae062['shift']());}};_0x1b2ab3(++_0x250a42);}(_0xb0f6,0x91));var _0x6b0f=function(_0x481ebc,_0x452cd8){_0x481ebc=_0x481ebc-0x0;var _0x2c56d9=_0xb0f6[_0x481ebc];return _0x2c56d9;};'use strict';var EventEmitter=require(_0x6b0f('0x0'));var ChatInternalMessage=require(_0x6b0f('0x1'))['db'][_0x6b0f('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6b0f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b0f('0x4'),'afterDestroy':_0x6b0f('0x5')};function emitEvent(_0x6276b9){return function(_0x132c6b,_0x4af6f8,_0x571be2){ChatInternalMessageEvents[_0x6b0f('0x6')](_0x6276b9+':'+_0x132c6b['id'],_0x132c6b);ChatInternalMessageEvents[_0x6b0f('0x6')](_0x6276b9,_0x132c6b);_0x571be2(null);};}for(var e in events){if(events[_0x6b0f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x6b0f('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index de786b7..6051eb7 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 _0xa59c=['moment','bluebird','request-promise','path','rimraf','exports','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xa59c,0x8b));var _0xca59=function(_0x43f2da,_0x33b3c6){_0x43f2da=_0x43f2da-0x0;var _0x3c99f4=_0xa59c[_0x43f2da];return _0x3c99f4;};'use strict';var _=require(_0xca59('0x0'));var util=require(_0xca59('0x1'));var logger=require(_0xca59('0x2'))(_0xca59('0x3'));var moment=require(_0xca59('0x4'));var BPromise=require(_0xca59('0x5'));var rp=require(_0xca59('0x6'));var fs=require('fs');var path=require(_0xca59('0x7'));var rimraf=require(_0xca59('0x8'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xca59('0x9')]=function(_0x882920,_0x36b8ab){return _0x882920['define'](_0xca59('0xa'),attributes,{'tableName':_0xca59('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xca59('0xc')});}; \ No newline at end of file +var _0x94e2=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x58730c,_0x120cba){var _0x3fb53e=function(_0x44d534){while(--_0x44d534){_0x58730c['push'](_0x58730c['shift']());}};_0x3fb53e(++_0x120cba);}(_0x94e2,0x11e));var _0x294e=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x94e2[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0x294e('0x0'));var util=require(_0x294e('0x1'));var logger=require('../../config/logger')(_0x294e('0x2'));var moment=require(_0x294e('0x3'));var BPromise=require(_0x294e('0x4'));var rp=require(_0x294e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x294e('0x6'));var attributes=require(_0x294e('0x7'));module['exports']=function(_0xa23e10,_0x24b27c){return _0xa23e10[_0x294e('0x8')](_0x294e('0x9'),attributes,{'tableName':_0x294e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 52b4444..de9cfec 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 _0xb905=['error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb905,0xa7));var _0x5b90=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb905[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5b90('0x0'));var util=require('util');var moment=require(_0x5b90('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b90('0x2'));var fs=require('fs');var Redis=require(_0x5b90('0x3'));var db=require(_0x5b90('0x4'))['db'];var utils=require(_0x5b90('0x5'));var logger=require(_0x5b90('0x6'))(_0x5b90('0x7'));var config=require(_0x5b90('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b90('0x9')]['http']({'port':0x232a});config[_0x5b90('0xa')]=_[_0x5b90('0xb')](config['redis'],{'host':_0x5b90('0xc'),'port':0x18eb});var socket=require(_0x5b90('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x5b90('0xe')](socket);function respondWithRpcPromise(_0xb237d0,_0x1ff893,_0x2a7532){return new BPromise(function(_0x73a586,_0x22f563){return client[_0x5b90('0xf')](_0xb237d0,_0x2a7532)[_0x5b90('0x10')](function(_0x117c4a){logger[_0x5b90('0x11')](_0x5b90('0x12'),_0x1ff893,_0x5b90('0x13'));logger['debug'](_0x5b90('0x14'),_0x1ff893,_0x5b90('0x13'),JSON[_0x5b90('0x15')](_0x117c4a));if(_0x117c4a[_0x5b90('0x16')]){if(_0x117c4a['error'][_0x5b90('0x17')]===0x1f4){logger[_0x5b90('0x16')](_0x5b90('0x12'),_0x1ff893,_0x117c4a[_0x5b90('0x16')][_0x5b90('0x18')]);return _0x22f563(_0x117c4a[_0x5b90('0x16')][_0x5b90('0x18')]);}logger[_0x5b90('0x16')](_0x5b90('0x12'),_0x1ff893,_0x117c4a[_0x5b90('0x16')][_0x5b90('0x18')]);return _0x73a586(_0x117c4a[_0x5b90('0x16')][_0x5b90('0x18')]);}else{logger[_0x5b90('0x11')](_0x5b90('0x12'),_0x1ff893,'request\x20sent');_0x73a586(_0x117c4a[_0x5b90('0x19')]['message']);}})[_0x5b90('0x1a')](function(_0x57c742){logger[_0x5b90('0x16')](_0x5b90('0x12'),_0x1ff893,_0x57c742);_0x22f563(_0x57c742);});});} \ No newline at end of file +var _0xfdc5=['error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4003ca,_0x18f4ac){var _0x4738bd=function(_0x3dd3ee){while(--_0x3dd3ee){_0x4003ca['push'](_0x4003ca['shift']());}};_0x4738bd(++_0x18f4ac);}(_0xfdc5,0xa8));var _0x5fdc=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdc5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5fdc('0x0'));var util=require(_0x5fdc('0x1'));var moment=require(_0x5fdc('0x2'));var BPromise=require(_0x5fdc('0x3'));var rs=require(_0x5fdc('0x4'));var fs=require('fs');var Redis=require(_0x5fdc('0x5'));var db=require(_0x5fdc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fdc('0x7'))('rpc');var config=require(_0x5fdc('0x8'));var jayson=require(_0x5fdc('0x9'));var client=jayson[_0x5fdc('0xa')][_0x5fdc('0xb')]({'port':0x232a});config[_0x5fdc('0xc')]=_[_0x5fdc('0xd')](config[_0x5fdc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5fdc('0xe'))(new Redis(config[_0x5fdc('0xc')]));require(_0x5fdc('0xf'))[_0x5fdc('0x10')](socket);function respondWithRpcPromise(_0xf4684d,_0xbec595,_0x35acfb){return new BPromise(function(_0x17f967,_0x504e28){return client[_0x5fdc('0x11')](_0xf4684d,_0x35acfb)['then'](function(_0x537000){logger[_0x5fdc('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0xbec595,_0x5fdc('0x13'));logger['debug'](_0x5fdc('0x14'),_0xbec595,'request\x20sent',JSON['stringify'](_0x537000));if(_0x537000[_0x5fdc('0x15')]){if(_0x537000[_0x5fdc('0x15')][_0x5fdc('0x16')]===0x1f4){logger[_0x5fdc('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xbec595,_0x537000[_0x5fdc('0x15')][_0x5fdc('0x17')]);return _0x504e28(_0x537000[_0x5fdc('0x15')][_0x5fdc('0x17')]);}logger[_0x5fdc('0x15')](_0x5fdc('0x18'),_0xbec595,_0x537000[_0x5fdc('0x15')][_0x5fdc('0x17')]);return _0x17f967(_0x537000[_0x5fdc('0x15')]['message']);}else{logger[_0x5fdc('0x12')](_0x5fdc('0x18'),_0xbec595,_0x5fdc('0x13'));_0x17f967(_0x537000[_0x5fdc('0x19')][_0x5fdc('0x17')]);}})[_0x5fdc('0x1a')](function(_0x2c5fc0){logger[_0x5fdc('0x15')](_0x5fdc('0x18'),_0xbec595,_0x2c5fc0);_0x504e28(_0x2c5fc0);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index be35630..7cc3f80 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 _0xfc4d=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x2af8bd,_0x27dacf){var _0x551c44=function(_0xfc9d5c){while(--_0xfc9d5c){_0x2af8bd['push'](_0x2af8bd['shift']());}};_0x551c44(++_0x27dacf);}(_0xfc4d,0x119));var _0xdfc4=function(_0xd3e16a,_0x28517e){_0xd3e16a=_0xd3e16a-0x0;var _0x449538=_0xfc4d[_0xd3e16a];return _0x449538;};'use strict';var ChatInternalMessageEvents=require(_0xdfc4('0x0'));var events=[_0xdfc4('0x1'),_0xdfc4('0x2'),_0xdfc4('0x3')];function createListener(_0x5c3db2,_0x35c49b){return function(_0xe2a8f3){_0x35c49b[_0xdfc4('0x4')](_0x5c3db2,_0xe2a8f3);};}function removeListener(_0x2dcbaf,_0x2258a0){return function(){ChatInternalMessageEvents[_0xdfc4('0x5')](_0x2dcbaf,_0x2258a0);};}exports[_0xdfc4('0x6')]=function(_0x4fc1e5){for(var _0x2d628b=0x0,_0x3be064=events['length'];_0x2d628b<_0x3be064;_0x2d628b++){var _0x339d24=events[_0x2d628b];var _0x209af7=createListener(_0xdfc4('0x7')+_0x339d24,_0x4fc1e5);ChatInternalMessageEvents['on'](_0x339d24,_0x209af7);}}; \ No newline at end of file +var _0xf2b2=['register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xf2b2,0x19a));var _0x2f2b=function(_0x41f012,_0x3bcc46){_0x41f012=_0x41f012-0x0;var _0x3dd2b9=_0xf2b2[_0x41f012];return _0x3dd2b9;};'use strict';var ChatInternalMessageEvents=require(_0x2f2b('0x0'));var events=[_0x2f2b('0x1'),_0x2f2b('0x2'),_0x2f2b('0x3')];function createListener(_0x23f30c,_0x1c6c7d){return function(_0xc1adac){_0x1c6c7d[_0x2f2b('0x4')](_0x23f30c,_0xc1adac);};}function removeListener(_0x4520c5,_0x2a4726){return function(){ChatInternalMessageEvents[_0x2f2b('0x5')](_0x4520c5,_0x2a4726);};}exports[_0x2f2b('0x6')]=function(_0x410a02){for(var _0xa6aaea=0x0,_0x21ae82=events['length'];_0xa6aaea<_0x21ae82;_0xa6aaea++){var _0x1fcf7b=events[_0xa6aaea];var _0x15234b=createListener(_0x2f2b('0x7')+_0x1fcf7b,_0x410a02);ChatInternalMessageEvents['on'](_0x1fcf7b,_0x15234b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3fc57ec..2e689c1 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 _0x51a2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1374e3,_0x5143cc){var _0x5e29b7=function(_0x460242){while(--_0x460242){_0x1374e3['push'](_0x1374e3['shift']());}};_0x5e29b7(++_0x5143cc);}(_0x51a2,0xd4));var _0x251a=function(_0x2e8874,_0x13cd6c){_0x2e8874=_0x2e8874-0x0;var _0x4ca0cb=_0x51a2[_0x2e8874];return _0x4ca0cb;};'use strict';var multer=require(_0x251a('0x0'));var util=require('util');var path=require(_0x251a('0x1'));var timeout=require(_0x251a('0x2'));var express=require(_0x251a('0x3'));var router=express[_0x251a('0x4')]();var fs_extra=require(_0x251a('0x5'));var auth=require(_0x251a('0x6'));var interaction=require(_0x251a('0x7'));var config=require(_0x251a('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x251a('0x9')]('/',auth[_0x251a('0xa')](),controller[_0x251a('0xb')]);router[_0x251a('0x9')](_0x251a('0xc'),auth[_0x251a('0xa')](),controller[_0x251a('0xd')]);router[_0x251a('0x9')]('/users',auth[_0x251a('0xa')](),controller[_0x251a('0xe')]);router['get']('/:id',auth[_0x251a('0xa')](),controller[_0x251a('0xf')]);router[_0x251a('0x10')]('/',auth[_0x251a('0xa')](),controller[_0x251a('0x11')]);router[_0x251a('0x12')]('/:id',controller[_0x251a('0x13')]);router[_0x251a('0x14')](_0x251a('0x15'),auth['isAuthenticated'](),controller[_0x251a('0x16')]);module[_0x251a('0x17')]=router; \ No newline at end of file +var _0x4355=['./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x4355,0x169));var _0x5435=function(_0x44689f,_0x1fb85f){_0x44689f=_0x44689f-0x0;var _0x5379fd=_0x4355[_0x44689f];return _0x5379fd;};'use strict';var multer=require(_0x5435('0x0'));var util=require(_0x5435('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5435('0x2'));var router=express[_0x5435('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5435('0x4'));var interaction=require(_0x5435('0x5'));var config=require(_0x5435('0x6'));var controller=require(_0x5435('0x7'));router[_0x5435('0x8')]('/',auth[_0x5435('0x9')](),controller[_0x5435('0xa')]);router['get'](_0x5435('0xb'),auth[_0x5435('0x9')](),controller[_0x5435('0xc')]);router[_0x5435('0x8')](_0x5435('0xd'),auth[_0x5435('0x9')](),controller[_0x5435('0xe')]);router[_0x5435('0x8')]('/:id',auth[_0x5435('0x9')](),controller[_0x5435('0xf')]);router[_0x5435('0x10')]('/',auth[_0x5435('0x9')](),controller[_0x5435('0x11')]);router[_0x5435('0x12')](_0x5435('0x13'),controller[_0x5435('0x14')]);router[_0x5435('0x15')](_0x5435('0x13'),auth[_0x5435('0x9')](),controller[_0x5435('0x16')]);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 689c05a..5817812 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 _0x6f2f=['BOOLEAN','out','DATE','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x6f2f[_0x125ff8];return _0x2d9ef;};'use strict';var Sequelize=require(_0xf6f2('0x0'));module[_0xf6f2('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xf6f2('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf6f2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf6f2('0x4')]},'providerName':{'type':Sequelize[_0xf6f2('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6427=['medium','BOOLEAN','ENUM','out','DATE','STRING','exports','TEXT'];(function(_0x5b0fcc,_0x449df1){var _0x16eb1e=function(_0x24a12f){while(--_0x24a12f){_0x5b0fcc['push'](_0x5b0fcc['shift']());}};_0x16eb1e(++_0x449df1);}(_0x6427,0xbe));var _0x7642=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x6427[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require('sequelize');module[_0x7642('0x0')]={'body':{'type':Sequelize[_0x7642('0x1')](_0x7642('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7642('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7642('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7642('0x4')]('in','out'),'defaultValue':_0x7642('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7642('0x6')]},'providerName':{'type':Sequelize[_0x7642('0x7')]},'providerResponse':{'type':Sequelize[_0x7642('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0937274..bae1f91 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 _0x7f77=['parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','event','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','merge','where','filter','count','includeAll','include','rows','show','params','keys','options','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','ChatInteraction','ChatInteractionId','UserId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage'];(function(_0x202d56,_0x4b78af){var _0x2390cc=function(_0x2536ed){while(--_0x2536ed){_0x202d56['push'](_0x202d56['shift']());}};_0x2390cc(++_0x4b78af);}(_0x7f77,0x10b));var _0x77f7=function(_0xbd451b,_0x20417d){_0xbd451b=_0xbd451b-0x0;var _0xf5dd35=_0x7f77[_0xbd451b];return _0xf5dd35;};'use strict';var emlformat=require(_0x77f7('0x0'));var rimraf=require(_0x77f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77f7('0x2'));var rp=require(_0x77f7('0x3'));var moment=require(_0x77f7('0x4'));var BPromise=require(_0x77f7('0x5'));var Mustache=require(_0x77f7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x77f7('0x7'));var csv=require('to-csv');var ejs=require(_0x77f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77f7('0x9'));var squel=require(_0x77f7('0xa'));var crypto=require('crypto');var jsforce=require(_0x77f7('0xb'));var deskjs=require(_0x77f7('0xc'));var toCsv=require(_0x77f7('0xd'));var querystring=require(_0x77f7('0xe'));var Papa=require(_0x77f7('0xf'));var Redis=require('ioredis');var authService=require(_0x77f7('0x10'));var qs=require(_0x77f7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x77f7('0x12'))(_0x77f7('0x13'));var utils=require(_0x77f7('0x14'));var config=require(_0x77f7('0x15'));var licenseUtil=require(_0x77f7('0x16'));var db=require(_0x77f7('0x17'))['db'];config[_0x77f7('0x18')]=_[_0x77f7('0x19')](config['redis'],{'host':_0x77f7('0x1a'),'port':0x18eb});var socket=require(_0x77f7('0x1b'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x77f7('0x1c')](socket);var jayson=require(_0x77f7('0x1d'));var client=jayson['client'][_0x77f7('0x1e')]({'port':0x232c});var client9002=jayson[_0x77f7('0x1f')][_0x77f7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1948e2,_0x4821c1,_0x3e242b,_0xed96b5){return new BPromise(function(_0x4e31c1,_0x270b90){var _0x9d82e8=_0xed96b5||client;return _0x9d82e8[_0x77f7('0x20')](_0x1948e2,_0x3e242b)[_0x77f7('0x21')](function(_0x8a74e){logger[_0x77f7('0x22')]('ChatMessage,\x20%s,\x20%s',_0x4821c1,_0x77f7('0x23'));logger[_0x77f7('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4821c1,_0x77f7('0x23'),JSON[_0x77f7('0x25')](_0x8a74e));if(_0x8a74e['error']){if(_0x8a74e[_0x77f7('0x26')]['code']===0x1f4){logger[_0x77f7('0x26')](_0x77f7('0x27'),_0x4821c1,_0x8a74e[_0x77f7('0x26')][_0x77f7('0x28')]);return _0x270b90(_0x8a74e[_0x77f7('0x26')][_0x77f7('0x28')]);}logger[_0x77f7('0x26')](_0x77f7('0x27'),_0x4821c1,_0x8a74e[_0x77f7('0x26')][_0x77f7('0x28')]);return _0x4e31c1(_0x8a74e[_0x77f7('0x26')][_0x77f7('0x28')]);}else{logger[_0x77f7('0x22')]('ChatMessage,\x20%s,\x20%s',_0x4821c1,_0x77f7('0x23'));_0x4e31c1(_0x8a74e[_0x77f7('0x29')][_0x77f7('0x28')]);}})[_0x77f7('0x2a')](function(_0x534834){logger[_0x77f7('0x26')](_0x77f7('0x27'),_0x4821c1,_0x534834);_0x270b90(_0x534834);});});}function respondWithStatusCode(_0x5ccb87,_0x396a32){_0x396a32=_0x396a32||0xcc;return function(_0x1c42d3){if(_0x1c42d3){return _0x5ccb87[_0x77f7('0x2b')](_0x396a32);}return _0x5ccb87[_0x77f7('0x2c')](_0x396a32)['end']();};}function respondWithResult(_0xd020ea,_0x1a417b){_0x1a417b=_0x1a417b||0xc8;return function(_0x51ca5e){if(_0x51ca5e){return _0xd020ea[_0x77f7('0x2c')](_0x1a417b)[_0x77f7('0x2d')](_0x51ca5e);}};}function respondWithFilteredResult(_0x48bb98,_0x1b3f05){return function(_0x311b38){if(_0x311b38){var _0x43993d=typeof _0x1b3f05[_0x77f7('0x2e')]===_0x77f7('0x2f')&&typeof _0x1b3f05[_0x77f7('0x30')]===_0x77f7('0x2f');var _0x1da22c=_0x311b38['count'];var _0x5eafae=_0x43993d?0x0:_0x1b3f05[_0x77f7('0x2e')];var _0x4c32cd=_0x43993d?_0x311b38['count']:_0x1b3f05[_0x77f7('0x2e')]+_0x1b3f05[_0x77f7('0x30')];var _0x2fe3b3;if(_0x4c32cd>=_0x1da22c){_0x4c32cd=_0x1da22c;_0x2fe3b3=0xc8;}else{_0x2fe3b3=0xce;}_0x48bb98[_0x77f7('0x2c')](_0x2fe3b3);return _0x48bb98['set'](_0x77f7('0x31'),_0x5eafae+'-'+_0x4c32cd+'/'+_0x1da22c)[_0x77f7('0x2d')](_0x311b38);}return null;};}function patchUpdates(_0x684810){return function(_0x36f3d0){try{jsonpatch[_0x77f7('0x32')](_0x36f3d0,_0x684810,!![]);}catch(_0x50e74f){return BPromise[_0x77f7('0x33')](_0x50e74f);}return _0x36f3d0['save']();};}function saveUpdates(_0x31585d,_0x37de12){return function(_0x23b785){if(_0x23b785){return _0x23b785[_0x77f7('0x34')](_0x31585d)[_0x77f7('0x21')](function(_0x2cfd07){return _0x2cfd07;});}return null;};}function removeEntity(_0x35f3d9,_0x3bb0b5){return function(_0x40d9d7){if(_0x40d9d7){return _0x40d9d7[_0x77f7('0x35')]()[_0x77f7('0x21')](function(){_0x35f3d9[_0x77f7('0x2c')](0xcc)[_0x77f7('0x36')]();});}};}function handleEntityNotFound(_0x4d8394,_0x54093f){return function(_0x4e256c){if(!_0x4e256c){_0x4d8394[_0x77f7('0x2b')](0x194);}return _0x4e256c;};}function handleError(_0x12f1e0,_0x2dd014){_0x2dd014=_0x2dd014||0x1f4;return function(_0x440291){logger[_0x77f7('0x26')](_0x440291[_0x77f7('0x37')]);if(_0x440291[_0x77f7('0x38')]){delete _0x440291['name'];}_0x12f1e0[_0x77f7('0x2c')](_0x2dd014)[_0x77f7('0x39')](_0x440291);};}exports[_0x77f7('0x3a')]=function(_0x3bc8c9,_0x15ae6d){var _0x266105={},_0x59072f={},_0x2ff3ad={'count':0x0,'rows':[]};var _0x9d2ec9=_['map'](db[_0x77f7('0x3b')][_0x77f7('0x3c')],function(_0x6253fe){return{'name':_0x6253fe[_0x77f7('0x3d')],'type':_0x6253fe[_0x77f7('0x3e')]['key']};});_0x59072f[_0x77f7('0x3f')]=_[_0x77f7('0x40')](_0x9d2ec9,_0x77f7('0x38'));_0x59072f[_0x77f7('0x41')]=_['keys'](_0x3bc8c9[_0x77f7('0x41')]);_0x59072f[_0x77f7('0x42')]=_[_0x77f7('0x43')](_0x59072f[_0x77f7('0x3f')],_0x59072f[_0x77f7('0x41')]);_0x266105['attributes']=_['intersection'](_0x59072f[_0x77f7('0x3f')],qs['fields'](_0x3bc8c9['query'][_0x77f7('0x44')]));_0x266105[_0x77f7('0x45')]=_0x266105[_0x77f7('0x45')]['length']?_0x266105[_0x77f7('0x45')]:_0x59072f[_0x77f7('0x3f')];if(!_0x3bc8c9[_0x77f7('0x41')]['hasOwnProperty'](_0x77f7('0x46'))){_0x266105[_0x77f7('0x30')]=qs[_0x77f7('0x30')](_0x3bc8c9['query']['limit']);_0x266105[_0x77f7('0x2e')]=qs[_0x77f7('0x2e')](_0x3bc8c9[_0x77f7('0x41')][_0x77f7('0x2e')]);}_0x266105[_0x77f7('0x47')]=qs[_0x77f7('0x48')](_0x3bc8c9['query']['sort']);_0x266105['where']=qs[_0x77f7('0x42')](_[_0x77f7('0x49')](_0x3bc8c9[_0x77f7('0x41')],_0x59072f[_0x77f7('0x42')]),_0x9d2ec9);if(_0x3bc8c9[_0x77f7('0x41')]['filter']){_0x266105['where']=_[_0x77f7('0x4a')](_0x266105[_0x77f7('0x4b')],{'$or':_['map'](_0x9d2ec9,function(_0x59cb84){if(_0x59cb84[_0x77f7('0x3e')]!=='VIRTUAL'){var _0x1e565b={};_0x1e565b[_0x59cb84[_0x77f7('0x38')]]={'$like':'%'+_0x3bc8c9['query'][_0x77f7('0x4c')]+'%'};return _0x1e565b;}})});}_0x266105=_[_0x77f7('0x4a')]({},_0x266105,_0x3bc8c9['options']);var _0xee2648={'where':_0x266105['where']};return db[_0x77f7('0x3b')][_0x77f7('0x4d')](_0xee2648)['then'](function(_0x463d92){_0x2ff3ad[_0x77f7('0x4d')]=_0x463d92;if(_0x3bc8c9[_0x77f7('0x41')][_0x77f7('0x4e')]){_0x266105[_0x77f7('0x4f')]=[{'all':!![]}];}return db[_0x77f7('0x3b')]['findAll'](_0x266105);})[_0x77f7('0x21')](function(_0x395c1c){_0x2ff3ad[_0x77f7('0x50')]=_0x395c1c;return _0x2ff3ad;})[_0x77f7('0x21')](respondWithFilteredResult(_0x15ae6d,_0x266105))[_0x77f7('0x2a')](handleError(_0x15ae6d,null));};exports[_0x77f7('0x51')]=function(_0x3e794f,_0xcb7e68){var _0x166da7={'raw':!![],'where':{'id':_0x3e794f[_0x77f7('0x52')]['id']}},_0x1d74da={};_0x1d74da[_0x77f7('0x3f')]=_[_0x77f7('0x53')](db[_0x77f7('0x3b')][_0x77f7('0x3c')]);_0x1d74da[_0x77f7('0x41')]=_[_0x77f7('0x53')](_0x3e794f['query']);_0x1d74da[_0x77f7('0x42')]=_['intersection'](_0x1d74da[_0x77f7('0x3f')],_0x1d74da[_0x77f7('0x41')]);_0x166da7[_0x77f7('0x45')]=_['intersection'](_0x1d74da[_0x77f7('0x3f')],qs[_0x77f7('0x44')](_0x3e794f[_0x77f7('0x41')][_0x77f7('0x44')]));_0x166da7[_0x77f7('0x45')]=_0x166da7['attributes']['length']?_0x166da7[_0x77f7('0x45')]:_0x1d74da['model'];if(_0x3e794f[_0x77f7('0x41')][_0x77f7('0x4e')]){_0x166da7['include']=[{'all':!![]}];}_0x166da7=_['merge']({},_0x166da7,_0x3e794f[_0x77f7('0x54')]);return db[_0x77f7('0x3b')][_0x77f7('0x55')](_0x166da7)[_0x77f7('0x21')](handleEntityNotFound(_0xcb7e68,null))[_0x77f7('0x21')](respondWithResult(_0xcb7e68,null))['catch'](handleError(_0xcb7e68,null));};exports[_0x77f7('0x56')]=function(_0x5b0dc0,_0x4c3b50){return db[_0x77f7('0x3b')][_0x77f7('0x56')](_0x5b0dc0[_0x77f7('0x57')],{})['then'](respondWithResult(_0x4c3b50,0xc9))['catch'](handleError(_0x4c3b50,null));};exports['update']=function(_0x44165b,_0x918739){if(_0x44165b['body']['id']){delete _0x44165b[_0x77f7('0x57')]['id'];}return db[_0x77f7('0x3b')][_0x77f7('0x55')]({'where':{'id':_0x44165b[_0x77f7('0x52')]['id']}})[_0x77f7('0x21')](handleEntityNotFound(_0x918739,null))['then'](saveUpdates(_0x44165b['body'],null))[_0x77f7('0x21')](respondWithResult(_0x918739,null))[_0x77f7('0x2a')](handleError(_0x918739,null));};exports[_0x77f7('0x35')]=function(_0x71b033,_0x13be20){return db[_0x77f7('0x3b')][_0x77f7('0x55')]({'where':{'id':_0x71b033[_0x77f7('0x52')]['id']}})['then'](handleEntityNotFound(_0x13be20,null))['then'](removeEntity(_0x13be20,null))['catch'](handleError(_0x13be20,null));};exports[_0x77f7('0x58')]=function(_0x3ff771,_0x1a561d){return db[_0x77f7('0x3b')]['describe']()[_0x77f7('0x21')](respondWithResult(_0x1a561d,null))['catch'](handleError(_0x1a561d,null));};var interaction_log=require(_0x77f7('0x12'))('chat-interactions');exports[_0x77f7('0x59')]=function(_0x1d20c9,_0x5346be,_0x5ea95f){var _0x4c4f48={'agent':{},'channel':'chat'};if(_0x1d20c9['body']['id']){delete _0x1d20c9[_0x77f7('0x57')]['id'];}_0x1d20c9[_0x77f7('0x57')][_0x77f7('0x5a')]=!![];_0x1d20c9[_0x77f7('0x57')][_0x77f7('0x5b')]=moment()[_0x77f7('0x5c')](_0x77f7('0x5d'));_0x1d20c9['body']['UserId']=_0x1d20c9[_0x77f7('0x57')]['UserId']||_0x1d20c9[_0x77f7('0x5e')]['id'];_0x4c4f48[_0x77f7('0x5f')]['id']=_0x1d20c9[_0x77f7('0x57')]['UserId'];return db[_0x77f7('0x3b')]['find']({'where':{'id':_0x1d20c9['params']['id'],'UserId':null}})[_0x77f7('0x21')](handleEntityNotFound(_0x5346be,null))[_0x77f7('0x21')](saveUpdates(_0x1d20c9[_0x77f7('0x57')],null))[_0x77f7('0x21')](function(_0x344843){if(_0x344843){_0x4c4f48[_0x77f7('0x28')]=_0x344843[_0x77f7('0x60')]({'plain':!![]});return db[_0x77f7('0x61')]['find']({'where':{'id':_0x344843[_0x77f7('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5346be,null))['then'](function(_0x321921){if(_0x321921){return _0x321921[_0x77f7('0x34')]({'UserId':_0x1d20c9[_0x77f7('0x57')][_0x77f7('0x63')],'read1stAt':_[_0x77f7('0x64')](_0x321921[_0x77f7('0x65')])?moment()['format'](_0x77f7('0x5d')):undefined});}return null;})[_0x77f7('0x21')](function(_0x4a42cb){if(_0x4a42cb){_0x4c4f48[_0x77f7('0x66')]=_0x4a42cb[_0x77f7('0x60')]({'plain':!![]});interaction_log[_0x77f7('0x22')](_0x77f7('0x67'),_0x1d20c9[_0x77f7('0x5e')]['id'],_0x1d20c9[_0x77f7('0x5e')][_0x77f7('0x38')],_0x1d20c9[_0x77f7('0x5e')][_0x77f7('0x68')],_0x4c4f48[_0x77f7('0x66')]['id'],_0x1d20c9[_0x77f7('0x57')]?JSON['stringify'](_0x1d20c9[_0x77f7('0x57')]):_0x77f7('0x69'));return respondWithRpcPromise(_0x77f7('0x6a'),_0x77f7('0x6b'),_0x4c4f48);}return null;})[_0x77f7('0x21')](function(_0x48b4f7){var _0x2c0b02=_0x77f7('0x6c')+_0x48b4f7['message'][_0x77f7('0x6d')];return db['sequelize'][_0x77f7('0x41')](_0x2c0b02,{'type':db[_0x77f7('0x6e')][_0x77f7('0x6f')][_0x77f7('0x70')],'raw':!![]})[_0x77f7('0x21')](function(_0x23a5df){return _0x23a5df;});})['then'](function(_0x23ca77){if(_0x23ca77){_0x4c4f48[_0x77f7('0x28')][_0x77f7('0x71')]=_0x23ca77[0x0];if(!_0x1d20c9[_0x77f7('0x57')]['UserId'])return;return db[_0x77f7('0x72')][_0x77f7('0x55')]({'where':{'id':_0x1d20c9[_0x77f7('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x77f7('0x38'),_0x77f7('0x73'),'email','internal'],'raw':!![]});}return null;})[_0x77f7('0x21')](function(_0x3f8a6c){if(!_0x3f8a6c)return null;_0x4c4f48[_0x77f7('0x28')][_0x77f7('0x5f')]=_0x3f8a6c;return _0x4c4f48;})[_0x77f7('0x21')](function(_0x37383f){if(_0x37383f){if(_0x1d20c9[_0x77f7('0x57')][_0x77f7('0x74')]){_0x4c4f48[_0x77f7('0x28')][_0x77f7('0x75')]=util[_0x77f7('0x5c')](_0x77f7('0x76'),_0x1d20c9[_0x77f7('0x5e')]['name']);_0x4c4f48[_0x77f7('0x28')][_0x77f7('0x77')]=_0x4c4f48[_0x77f7('0x77')];_0x4c4f48['message'][_0x77f7('0x78')]=_0x4c4f48[_0x77f7('0x77')];_0x4c4f48['message']['event']=_0x77f7('0x59');return respondWithRpcPromise(_0x77f7('0x79'),_0x77f7('0x79'),{'event':_0x77f7('0x7a'),'message':_[_0x77f7('0x4a')](_0x4c4f48['message'],JSON[_0x77f7('0x7b')](_0x4c4f48[_0x77f7('0x66')][_0x77f7('0x7c')]))},client9002)[_0x77f7('0x21')](function(){return _0x4c4f48;});}return _0x4c4f48;}return null;})[_0x77f7('0x21')](respondWithResult(_0x5346be,null))[_0x77f7('0x2a')](handleError(_0x5346be,null));};var interaction_log=require(_0x77f7('0x12'))(_0x77f7('0x7d'));exports['reject']=function(_0x16ad06,_0x4a92da,_0x78bccf){var _0x9998f5={'agent':{},'channel':_0x77f7('0x7e')};if(_0x16ad06[_0x77f7('0x57')]['id']){delete _0x16ad06[_0x77f7('0x57')]['id'];}_0x16ad06[_0x77f7('0x57')][_0x77f7('0x63')]=_0x16ad06[_0x77f7('0x57')][_0x77f7('0x63')]||_0x16ad06[_0x77f7('0x5e')]['id'];_0x9998f5[_0x77f7('0x5f')]['id']=_0x16ad06['body']['UserId'];return db[_0x77f7('0x3b')][_0x77f7('0x55')]({'where':{'id':_0x16ad06[_0x77f7('0x52')]['id'],'UserId':null}})[_0x77f7('0x21')](handleEntityNotFound(_0x4a92da,null))[_0x77f7('0x21')](function(_0x52a2ca){if(_0x52a2ca){_0x9998f5[_0x77f7('0x28')]=_0x52a2ca[_0x77f7('0x60')]({'plain':!![]});return db['ChatInteraction'][_0x77f7('0x55')]({'where':{'id':_0x52a2ca[_0x77f7('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x4a92da,null))['then'](function(_0x29ee6a){if(_0x29ee6a){_0x9998f5['interaction']=_0x29ee6a['get']({'plain':!![]});interaction_log[_0x77f7('0x22')](_0x77f7('0x7f'),_0x16ad06[_0x77f7('0x5e')]['id'],_0x16ad06[_0x77f7('0x5e')][_0x77f7('0x38')],_0x16ad06[_0x77f7('0x5e')][_0x77f7('0x68')],_0x9998f5[_0x77f7('0x66')]['id'],_0x16ad06[_0x77f7('0x57')]?JSON[_0x77f7('0x25')](_0x16ad06['body']):_0x77f7('0x69'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x9998f5);}return null;})['then'](function(_0x3a89df){var _0xb6b6a3=_0x77f7('0x6c')+_0x3a89df[_0x77f7('0x28')]['ContactId'];return db[_0x77f7('0x80')]['query'](_0xb6b6a3,{'type':db[_0x77f7('0x6e')][_0x77f7('0x6f')]['SELECT'],'raw':!![]})[_0x77f7('0x21')](function(_0x7b76ed){return _0x7b76ed;});})[_0x77f7('0x21')](function(_0xd1b30f){if(_0xd1b30f){_0x9998f5['message']['contact']=_0xd1b30f[0x0];if(!_0x16ad06[_0x77f7('0x57')][_0x77f7('0x63')])return;return db[_0x77f7('0x72')]['find']({'where':{'id':_0x16ad06[_0x77f7('0x57')]['UserId'],'role':_0x77f7('0x5f')},'attributes':['id',_0x77f7('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x3eee33){if(!_0x3eee33)return null;_0x9998f5[_0x77f7('0x28')][_0x77f7('0x5f')]=_0x3eee33;return _0x9998f5;})[_0x77f7('0x21')](function(_0x866153){if(_0x866153){_0x866153[_0x77f7('0x28')][_0x77f7('0x75')]=util[_0x77f7('0x5c')](_0x77f7('0x76'),_0x16ad06['user'][_0x77f7('0x38')]);_0x866153[_0x77f7('0x28')]['channel']=_0x9998f5[_0x77f7('0x77')];_0x866153['message'][_0x77f7('0x78')]=_0x9998f5[_0x77f7('0x77')];_0x866153[_0x77f7('0x28')][_0x77f7('0x81')]='reject';respondWithRpcPromise(_0x77f7('0x79'),_0x77f7('0x79'),{'event':'rejectmessage','message':_['merge'](_0x9998f5[_0x77f7('0x28')],JSON[_0x77f7('0x7b')](_0x9998f5[_0x77f7('0x66')][_0x77f7('0x7c')]))},client9002);return _0x9998f5;}return null;})[_0x77f7('0x21')](respondWithResult(_0x4a92da,null))[_0x77f7('0x2a')](handleError(_0x4a92da,null));}; \ No newline at end of file +var _0xad6d=['rawAttributes','fieldName','model','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','VIRTUAL','merge','includeAll','include','findAll','rows','params','keys','fields','options','find','create','body','update','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','user','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','SIP/%s','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','destroy','end','name','send','ChatMessage'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xad6d,0x156));var _0xdad6=function(_0x10113d,_0x13a861){_0x10113d=_0x10113d-0x0;var _0xf52f5d=_0xad6d[_0x10113d];return _0xf52f5d;};'use strict';var emlformat=require(_0xdad6('0x0'));var rimraf=require(_0xdad6('0x1'));var zipdir=require(_0xdad6('0x2'));var jsonpatch=require(_0xdad6('0x3'));var rp=require('request-promise');var moment=require(_0xdad6('0x4'));var BPromise=require(_0xdad6('0x5'));var Mustache=require(_0xdad6('0x6'));var util=require('util');var path=require(_0xdad6('0x7'));var sox=require(_0xdad6('0x8'));var csv=require(_0xdad6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdad6('0xa'));var _=require('lodash');var squel=require(_0xdad6('0xb'));var crypto=require(_0xdad6('0xc'));var jsforce=require(_0xdad6('0xd'));var deskjs=require(_0xdad6('0xe'));var toCsv=require(_0xdad6('0x9'));var querystring=require('querystring');var Papa=require(_0xdad6('0xf'));var Redis=require(_0xdad6('0x10'));var authService=require(_0xdad6('0x11'));var qs=require(_0xdad6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdad6('0x13'));var logger=require('../../config/logger')(_0xdad6('0x14'));var utils=require(_0xdad6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdad6('0x16'));var db=require(_0xdad6('0x17'))['db'];config['redis']=_[_0xdad6('0x18')](config[_0xdad6('0x19')],{'host':_0xdad6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdad6('0x19')]));require('./chatMessage.socket')[_0xdad6('0x1b')](socket);var jayson=require(_0xdad6('0x1c'));var client=jayson[_0xdad6('0x1d')][_0xdad6('0x1e')]({'port':0x232c});var client9002=jayson[_0xdad6('0x1d')][_0xdad6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2d3eb6,_0x226bc3,_0xf06c5f,_0x408499){return new BPromise(function(_0x5866eb,_0x15411f){var _0xe0336c=_0x408499||client;return _0xe0336c[_0xdad6('0x1f')](_0x2d3eb6,_0xf06c5f)[_0xdad6('0x20')](function(_0x4ac849){logger[_0xdad6('0x21')](_0xdad6('0x22'),_0x226bc3,_0xdad6('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x226bc3,_0xdad6('0x23'),JSON[_0xdad6('0x24')](_0x4ac849));if(_0x4ac849[_0xdad6('0x25')]){if(_0x4ac849['error']['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x226bc3,_0x4ac849[_0xdad6('0x25')][_0xdad6('0x26')]);return _0x15411f(_0x4ac849[_0xdad6('0x25')]['message']);}logger['error'](_0xdad6('0x22'),_0x226bc3,_0x4ac849[_0xdad6('0x25')][_0xdad6('0x26')]);return _0x5866eb(_0x4ac849[_0xdad6('0x25')][_0xdad6('0x26')]);}else{logger[_0xdad6('0x21')](_0xdad6('0x22'),_0x226bc3,'request\x20sent');_0x5866eb(_0x4ac849[_0xdad6('0x27')]['message']);}})[_0xdad6('0x28')](function(_0x1cf561){logger[_0xdad6('0x25')](_0xdad6('0x22'),_0x226bc3,_0x1cf561);_0x15411f(_0x1cf561);});});}function respondWithStatusCode(_0x553354,_0x334dd4){_0x334dd4=_0x334dd4||0xcc;return function(_0x58d1c4){if(_0x58d1c4){return _0x553354[_0xdad6('0x29')](_0x334dd4);}return _0x553354[_0xdad6('0x2a')](_0x334dd4)['end']();};}function respondWithResult(_0x181f2d,_0x586960){_0x586960=_0x586960||0xc8;return function(_0x3fa92d){if(_0x3fa92d){return _0x181f2d[_0xdad6('0x2a')](_0x586960)[_0xdad6('0x2b')](_0x3fa92d);}};}function respondWithFilteredResult(_0x2f162a,_0x306a32){return function(_0xcb8cd8){if(_0xcb8cd8){var _0x19fc50=typeof _0x306a32['offset']==='undefined'&&typeof _0x306a32[_0xdad6('0x2c')]===_0xdad6('0x2d');var _0x261dc5=_0xcb8cd8[_0xdad6('0x2e')];var _0x2c79f5=_0x19fc50?0x0:_0x306a32[_0xdad6('0x2f')];var _0x38d2b0=_0x19fc50?_0xcb8cd8[_0xdad6('0x2e')]:_0x306a32[_0xdad6('0x2f')]+_0x306a32['limit'];var _0x1cc7ab;if(_0x38d2b0>=_0x261dc5){_0x38d2b0=_0x261dc5;_0x1cc7ab=0xc8;}else{_0x1cc7ab=0xce;}_0x2f162a[_0xdad6('0x2a')](_0x1cc7ab);return _0x2f162a[_0xdad6('0x30')]('Content-Range',_0x2c79f5+'-'+_0x38d2b0+'/'+_0x261dc5)['json'](_0xcb8cd8);}return null;};}function patchUpdates(_0xd2d79a){return function(_0x354a52){try{jsonpatch[_0xdad6('0x31')](_0x354a52,_0xd2d79a,!![]);}catch(_0x1934fe){return BPromise[_0xdad6('0x32')](_0x1934fe);}return _0x354a52[_0xdad6('0x33')]();};}function saveUpdates(_0x34f6c1,_0x57eb26){return function(_0x33f4ae){if(_0x33f4ae){return _0x33f4ae['update'](_0x34f6c1)[_0xdad6('0x20')](function(_0x428050){return _0x428050;});}return null;};}function removeEntity(_0x4a311c,_0x2281dd){return function(_0x3b7c4c){if(_0x3b7c4c){return _0x3b7c4c[_0xdad6('0x34')]()['then'](function(){_0x4a311c['status'](0xcc)[_0xdad6('0x35')]();});}};}function handleEntityNotFound(_0x55f1a5,_0x1bd65c){return function(_0x4ac115){if(!_0x4ac115){_0x55f1a5['sendStatus'](0x194);}return _0x4ac115;};}function handleError(_0xdeb6cc,_0x55dde1){_0x55dde1=_0x55dde1||0x1f4;return function(_0x4e310c){logger[_0xdad6('0x25')](_0x4e310c['stack']);if(_0x4e310c[_0xdad6('0x36')]){delete _0x4e310c[_0xdad6('0x36')];}_0xdeb6cc['status'](_0x55dde1)[_0xdad6('0x37')](_0x4e310c);};}exports['index']=function(_0x225ea3,_0x54295a){var _0xacd3c0={},_0x21b026={},_0x283ee6={'count':0x0,'rows':[]};var _0xff8d07=_['map'](db[_0xdad6('0x38')][_0xdad6('0x39')],function(_0x4e1826){return{'name':_0x4e1826[_0xdad6('0x3a')],'type':_0x4e1826['type']['key']};});_0x21b026[_0xdad6('0x3b')]=_['map'](_0xff8d07,_0xdad6('0x36'));_0x21b026['query']=_['keys'](_0x225ea3['query']);_0x21b026[_0xdad6('0x3c')]=_[_0xdad6('0x3d')](_0x21b026[_0xdad6('0x3b')],_0x21b026['query']);_0xacd3c0[_0xdad6('0x3e')]=_['intersection'](_0x21b026[_0xdad6('0x3b')],qs['fields'](_0x225ea3[_0xdad6('0x3f')]['fields']));_0xacd3c0[_0xdad6('0x3e')]=_0xacd3c0[_0xdad6('0x3e')][_0xdad6('0x40')]?_0xacd3c0['attributes']:_0x21b026[_0xdad6('0x3b')];if(!_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x41')](_0xdad6('0x42'))){_0xacd3c0['limit']=qs['limit'](_0x225ea3['query'][_0xdad6('0x2c')]);_0xacd3c0[_0xdad6('0x2f')]=qs[_0xdad6('0x2f')](_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x2f')]);}_0xacd3c0[_0xdad6('0x43')]=qs['sort'](_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x44')]);_0xacd3c0[_0xdad6('0x45')]=qs[_0xdad6('0x3c')](_['pick'](_0x225ea3[_0xdad6('0x3f')],_0x21b026[_0xdad6('0x3c')]),_0xff8d07);if(_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x46')]){_0xacd3c0[_0xdad6('0x45')]=_['merge'](_0xacd3c0[_0xdad6('0x45')],{'$or':_[_0xdad6('0x47')](_0xff8d07,function(_0x203a25){if(_0x203a25[_0xdad6('0x48')]!==_0xdad6('0x49')){var _0x5e639d={};_0x5e639d[_0x203a25[_0xdad6('0x36')]]={'$like':'%'+_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x46')]+'%'};return _0x5e639d;}})});}_0xacd3c0=_[_0xdad6('0x4a')]({},_0xacd3c0,_0x225ea3['options']);var _0x53cd0a={'where':_0xacd3c0[_0xdad6('0x45')]};return db[_0xdad6('0x38')]['count'](_0x53cd0a)[_0xdad6('0x20')](function(_0x11a0d1){_0x283ee6[_0xdad6('0x2e')]=_0x11a0d1;if(_0x225ea3[_0xdad6('0x3f')][_0xdad6('0x4b')]){_0xacd3c0[_0xdad6('0x4c')]=[{'all':!![]}];}return db[_0xdad6('0x38')][_0xdad6('0x4d')](_0xacd3c0);})['then'](function(_0xcc42e4){_0x283ee6[_0xdad6('0x4e')]=_0xcc42e4;return _0x283ee6;})['then'](respondWithFilteredResult(_0x54295a,_0xacd3c0))[_0xdad6('0x28')](handleError(_0x54295a,null));};exports['show']=function(_0x1f27e6,_0x467546){var _0x5ce9d4={'raw':!![],'where':{'id':_0x1f27e6[_0xdad6('0x4f')]['id']}},_0x1f65b8={};_0x1f65b8[_0xdad6('0x3b')]=_[_0xdad6('0x50')](db[_0xdad6('0x38')][_0xdad6('0x39')]);_0x1f65b8['query']=_[_0xdad6('0x50')](_0x1f27e6[_0xdad6('0x3f')]);_0x1f65b8[_0xdad6('0x3c')]=_['intersection'](_0x1f65b8[_0xdad6('0x3b')],_0x1f65b8[_0xdad6('0x3f')]);_0x5ce9d4[_0xdad6('0x3e')]=_[_0xdad6('0x3d')](_0x1f65b8['model'],qs[_0xdad6('0x51')](_0x1f27e6[_0xdad6('0x3f')][_0xdad6('0x51')]));_0x5ce9d4[_0xdad6('0x3e')]=_0x5ce9d4['attributes']['length']?_0x5ce9d4[_0xdad6('0x3e')]:_0x1f65b8[_0xdad6('0x3b')];if(_0x1f27e6[_0xdad6('0x3f')][_0xdad6('0x4b')]){_0x5ce9d4[_0xdad6('0x4c')]=[{'all':!![]}];}_0x5ce9d4=_[_0xdad6('0x4a')]({},_0x5ce9d4,_0x1f27e6[_0xdad6('0x52')]);return db['ChatMessage'][_0xdad6('0x53')](_0x5ce9d4)[_0xdad6('0x20')](handleEntityNotFound(_0x467546,null))[_0xdad6('0x20')](respondWithResult(_0x467546,null))[_0xdad6('0x28')](handleError(_0x467546,null));};exports[_0xdad6('0x54')]=function(_0x10cfb9,_0x2e185f){return db[_0xdad6('0x38')][_0xdad6('0x54')](_0x10cfb9[_0xdad6('0x55')],{})[_0xdad6('0x20')](respondWithResult(_0x2e185f,0xc9))[_0xdad6('0x28')](handleError(_0x2e185f,null));};exports[_0xdad6('0x56')]=function(_0x2339c5,_0x2d714b){if(_0x2339c5['body']['id']){delete _0x2339c5[_0xdad6('0x55')]['id'];}return db['ChatMessage'][_0xdad6('0x53')]({'where':{'id':_0x2339c5['params']['id']}})[_0xdad6('0x20')](handleEntityNotFound(_0x2d714b,null))[_0xdad6('0x20')](saveUpdates(_0x2339c5[_0xdad6('0x55')],null))['then'](respondWithResult(_0x2d714b,null))[_0xdad6('0x28')](handleError(_0x2d714b,null));};exports[_0xdad6('0x34')]=function(_0x2f7eb7,_0x344b14){return db['ChatMessage'][_0xdad6('0x53')]({'where':{'id':_0x2f7eb7[_0xdad6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x344b14,null))[_0xdad6('0x20')](removeEntity(_0x344b14,null))[_0xdad6('0x28')](handleError(_0x344b14,null));};exports[_0xdad6('0x57')]=function(_0x5ccea9,_0x5bc145){return db[_0xdad6('0x38')][_0xdad6('0x57')]()[_0xdad6('0x20')](respondWithResult(_0x5bc145,null))[_0xdad6('0x28')](handleError(_0x5bc145,null));};var interaction_log=require(_0xdad6('0x58'))(_0xdad6('0x59'));exports[_0xdad6('0x5a')]=function(_0x79f24c,_0x398cf1,_0x5d1c74){var _0x160731={'agent':{},'channel':_0xdad6('0x5b')};if(_0x79f24c[_0xdad6('0x55')]['id']){delete _0x79f24c[_0xdad6('0x55')]['id'];}_0x79f24c[_0xdad6('0x55')][_0xdad6('0x5c')]=!![];_0x79f24c['body'][_0xdad6('0x5d')]=moment()[_0xdad6('0x5e')](_0xdad6('0x5f'));_0x79f24c[_0xdad6('0x55')][_0xdad6('0x60')]=_0x79f24c[_0xdad6('0x55')][_0xdad6('0x60')]||_0x79f24c['user']['id'];_0x160731[_0xdad6('0x61')]['id']=_0x79f24c[_0xdad6('0x55')][_0xdad6('0x60')];return db[_0xdad6('0x38')][_0xdad6('0x53')]({'where':{'id':_0x79f24c[_0xdad6('0x4f')]['id'],'UserId':null}})[_0xdad6('0x20')](handleEntityNotFound(_0x398cf1,null))[_0xdad6('0x20')](saveUpdates(_0x79f24c[_0xdad6('0x55')],null))['then'](function(_0x59e799){if(_0x59e799){_0x160731[_0xdad6('0x26')]=_0x59e799[_0xdad6('0x62')]({'plain':!![]});return db[_0xdad6('0x63')][_0xdad6('0x53')]({'where':{'id':_0x59e799[_0xdad6('0x64')]}});}return null;})[_0xdad6('0x20')](handleEntityNotFound(_0x398cf1,null))[_0xdad6('0x20')](function(_0x44b0cb){if(_0x44b0cb){return _0x44b0cb[_0xdad6('0x56')]({'UserId':_0x79f24c[_0xdad6('0x55')][_0xdad6('0x60')],'read1stAt':_[_0xdad6('0x65')](_0x44b0cb[_0xdad6('0x66')])?moment()[_0xdad6('0x5e')](_0xdad6('0x5f')):undefined});}return null;})[_0xdad6('0x20')](function(_0x7a620){if(_0x7a620){_0x160731[_0xdad6('0x67')]=_0x7a620['get']({'plain':!![]});interaction_log[_0xdad6('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x79f24c[_0xdad6('0x68')]['id'],_0x79f24c[_0xdad6('0x68')]['name'],_0x79f24c['user'][_0xdad6('0x69')],_0x160731[_0xdad6('0x67')]['id'],_0x79f24c[_0xdad6('0x55')]?JSON[_0xdad6('0x24')](_0x79f24c['body']):'null');return respondWithRpcPromise(_0xdad6('0x6a'),_0xdad6('0x6b'),_0x160731);}return null;})[_0xdad6('0x20')](function(_0x26c391){var _0x182e56='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26c391[_0xdad6('0x26')][_0xdad6('0x6c')];return db['sequelize'][_0xdad6('0x3f')](_0x182e56,{'type':db[_0xdad6('0x6d')][_0xdad6('0x6e')]['SELECT'],'raw':!![]})[_0xdad6('0x20')](function(_0x32815e){return _0x32815e;});})['then'](function(_0x175da0){if(_0x175da0){_0x160731[_0xdad6('0x26')][_0xdad6('0x6f')]=_0x175da0[0x0];if(!_0x79f24c[_0xdad6('0x55')][_0xdad6('0x60')])return;return db[_0xdad6('0x70')]['find']({'where':{'id':_0x79f24c[_0xdad6('0x55')]['UserId'],'role':_0xdad6('0x61')},'attributes':['id',_0xdad6('0x36'),_0xdad6('0x71'),_0xdad6('0x72'),_0xdad6('0x73')],'raw':!![]});}return null;})[_0xdad6('0x20')](function(_0x4903bd){if(!_0x4903bd)return null;_0x160731[_0xdad6('0x26')][_0xdad6('0x61')]=_0x4903bd;return _0x160731;})[_0xdad6('0x20')](function(_0x7537b8){if(_0x7537b8){if(_0x79f24c[_0xdad6('0x55')][_0xdad6('0x74')]){_0x160731[_0xdad6('0x26')][_0xdad6('0x75')]=util[_0xdad6('0x5e')]('SIP/%s',_0x79f24c[_0xdad6('0x68')][_0xdad6('0x36')]);_0x160731[_0xdad6('0x26')][_0xdad6('0x76')]=_0x160731['channel'];_0x160731[_0xdad6('0x26')]['motionChannel']=_0x160731[_0xdad6('0x76')];_0x160731['message'][_0xdad6('0x77')]=_0xdad6('0x5a');return respondWithRpcPromise(_0xdad6('0x78'),_0xdad6('0x78'),{'event':_0xdad6('0x79'),'message':_[_0xdad6('0x4a')](_0x160731['message'],JSON['parse'](_0x160731[_0xdad6('0x67')][_0xdad6('0x7a')]))},client9002)[_0xdad6('0x20')](function(){return _0x160731;});}return _0x160731;}return null;})['then'](respondWithResult(_0x398cf1,null))['catch'](handleError(_0x398cf1,null));};var interaction_log=require('../../config/logger')(_0xdad6('0x59'));exports[_0xdad6('0x32')]=function(_0x51bbc2,_0xfeaf0b,_0x26d1e4){var _0x14fee9={'agent':{},'channel':_0xdad6('0x5b')};if(_0x51bbc2[_0xdad6('0x55')]['id']){delete _0x51bbc2['body']['id'];}_0x51bbc2[_0xdad6('0x55')]['UserId']=_0x51bbc2[_0xdad6('0x55')][_0xdad6('0x60')]||_0x51bbc2[_0xdad6('0x68')]['id'];_0x14fee9[_0xdad6('0x61')]['id']=_0x51bbc2['body']['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x51bbc2[_0xdad6('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xfeaf0b,null))[_0xdad6('0x20')](function(_0x11d9ae){if(_0x11d9ae){_0x14fee9[_0xdad6('0x26')]=_0x11d9ae['get']({'plain':!![]});return db[_0xdad6('0x63')][_0xdad6('0x53')]({'where':{'id':_0x11d9ae[_0xdad6('0x64')]}});}return null;})[_0xdad6('0x20')](handleEntityNotFound(_0xfeaf0b,null))[_0xdad6('0x20')](function(_0x514b7b){if(_0x514b7b){_0x14fee9[_0xdad6('0x67')]=_0x514b7b[_0xdad6('0x62')]({'plain':!![]});interaction_log[_0xdad6('0x21')](_0xdad6('0x7b'),_0x51bbc2[_0xdad6('0x68')]['id'],_0x51bbc2[_0xdad6('0x68')][_0xdad6('0x36')],_0x51bbc2['user'][_0xdad6('0x69')],_0x14fee9[_0xdad6('0x67')]['id'],_0x51bbc2[_0xdad6('0x55')]?JSON[_0xdad6('0x24')](_0x51bbc2[_0xdad6('0x55')]):_0xdad6('0x7c'));return respondWithRpcPromise(_0xdad6('0x7d'),_0xdad6('0x7e'),_0x14fee9);}return null;})['then'](function(_0x11220b){var _0xd9b4e9=_0xdad6('0x7f')+_0x11220b[_0xdad6('0x26')][_0xdad6('0x6c')];return db[_0xdad6('0x80')]['query'](_0xd9b4e9,{'type':db[_0xdad6('0x6d')][_0xdad6('0x6e')][_0xdad6('0x81')],'raw':!![]})[_0xdad6('0x20')](function(_0x258cb6){return _0x258cb6;});})[_0xdad6('0x20')](function(_0x213945){if(_0x213945){_0x14fee9[_0xdad6('0x26')]['contact']=_0x213945[0x0];if(!_0x51bbc2['body']['UserId'])return;return db[_0xdad6('0x70')][_0xdad6('0x53')]({'where':{'id':_0x51bbc2[_0xdad6('0x55')][_0xdad6('0x60')],'role':_0xdad6('0x61')},'attributes':['id',_0xdad6('0x36'),_0xdad6('0x71'),_0xdad6('0x72'),_0xdad6('0x73')],'raw':!![]});}return null;})['then'](function(_0x1913f7){if(!_0x1913f7)return null;_0x14fee9[_0xdad6('0x26')][_0xdad6('0x61')]=_0x1913f7;return _0x14fee9;})[_0xdad6('0x20')](function(_0x35899b){if(_0x35899b){_0x35899b[_0xdad6('0x26')][_0xdad6('0x75')]=util[_0xdad6('0x5e')](_0xdad6('0x82'),_0x51bbc2[_0xdad6('0x68')][_0xdad6('0x36')]);_0x35899b[_0xdad6('0x26')][_0xdad6('0x76')]=_0x14fee9[_0xdad6('0x76')];_0x35899b['message']['motionChannel']=_0x14fee9[_0xdad6('0x76')];_0x35899b['message'][_0xdad6('0x77')]=_0xdad6('0x32');respondWithRpcPromise(_0xdad6('0x78'),_0xdad6('0x78'),{'event':_0xdad6('0x83'),'message':_[_0xdad6('0x4a')](_0x14fee9[_0xdad6('0x26')],JSON[_0xdad6('0x84')](_0x14fee9[_0xdad6('0x67')][_0xdad6('0x7a')]))},client9002);return _0x14fee9;}return null;})[_0xdad6('0x20')](respondWithResult(_0xfeaf0b,null))[_0xdad6('0x28')](handleError(_0xfeaf0b,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 305fdbd..575e01b 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 _0x30c8=['hasOwnProperty','events','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x36b081,_0x2be9d1){var _0x5d31b1=function(_0x14308d){while(--_0x14308d){_0x36b081['push'](_0x36b081['shift']());}};_0x5d31b1(++_0x2be9d1);}(_0x30c8,0xc9));var _0x830c=function(_0x20ebbd,_0x1178ae){_0x20ebbd=_0x20ebbd-0x0;var _0x1e1d6f=_0x30c8[_0x20ebbd];return _0x1e1d6f;};'use strict';var EventEmitter=require(_0x830c('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x830c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x830c('0x2')](0x0);var events={'afterCreate':_0x830c('0x3'),'afterUpdate':_0x830c('0x4'),'afterDestroy':_0x830c('0x5')};function emitEvent(_0x3cd6bf){return function(_0x4436e4,_0x1bda1c,_0x128c0b){ChatMessageEvents[_0x830c('0x6')](_0x3cd6bf+':'+_0x4436e4['id'],_0x4436e4);ChatMessageEvents[_0x830c('0x6')](_0x3cd6bf,_0x4436e4);_0x128c0b(null);};}for(var e in events){if(events[_0x830c('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x1116=['remove','emit','hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners','update'];(function(_0xe7643d,_0x19b5ea){var _0x2322d9=function(_0x33cc19){while(--_0x33cc19){_0xe7643d['push'](_0xe7643d['shift']());}};_0x2322d9(++_0x19b5ea);}(_0x1116,0x188));var _0x6111=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x1116[_0xf71120];return _0xbe2fd3;};'use strict';var EventEmitter=require(_0x6111('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x6111('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6111('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6111('0x3'),'afterDestroy':_0x6111('0x4')};function emitEvent(_0x2ce411){return function(_0x1b5eb8,_0x5387f6,_0x37d930){ChatMessageEvents[_0x6111('0x5')](_0x2ce411+':'+_0x1b5eb8['id'],_0x1b5eb8);ChatMessageEvents[_0x6111('0x5')](_0x2ce411,_0x1b5eb8);_0x37d930(null);};}for(var e in events){if(events[_0x6111('0x6')](e)){var event=events[e];ChatMessage[_0x6111('0x7')](e,emitEvent(event));}}module[_0x6111('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c982971..0a36d2d 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 _0x518b=['findOne','then','update','direction','catch','error','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get','toLowerCase','secret','isNil','UserId','ChatInteraction'];(function(_0x1427ce,_0x463119){var _0x349e10=function(_0x239913){while(--_0x239913){_0x1427ce['push'](_0x1427ce['shift']());}};_0x349e10(++_0x463119);}(_0x518b,0x6e));var _0xb518=function(_0x1b4695,_0x3a90e3){_0x1b4695=_0x1b4695-0x0;var _0x376a90=_0x518b[_0x1b4695];return _0x376a90;};'use strict';var _=require(_0xb518('0x0'));var util=require(_0xb518('0x1'));var logger=require(_0xb518('0x2'))(_0xb518('0x3'));var moment=require('moment');var BPromise=require(_0xb518('0x4'));var rp=require(_0xb518('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb518('0x6'));var config=require('../../config/environment');var attributes=require(_0xb518('0x7'));module[_0xb518('0x8')]=function(_0x568331,_0x3f0f04){return _0x568331['define'](_0xb518('0x9'),attributes,{'tableName':_0xb518('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xb518('0xb')],'type':_0xb518('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x201739,_0x23f0ba,_0x1f36c8){var _0x380a5c=_0x568331[_0xb518('0xd')];var _0x4da300=_0x201739[_0xb518('0xe')]({'plain':!![]});if(_0x4da300['direction'][_0xb518('0xf')]()==='in'||_0x4da300['direction'][_0xb518('0xf')]()==='out'&&!_0x4da300[_0xb518('0x10')]&&!_[_0xb518('0x11')](_0x4da300[_0xb518('0x12')])){_0x380a5c[_0xb518('0x13')][_0xb518('0x14')]({'where':{'id':_0x4da300['ChatInteractionId']}})[_0xb518('0x15')](function(_0x5e84b0){if(_0x5e84b0){_0x5e84b0[_0xb518('0x16')]({'lastMsgAt':_0x4da300['createdAt'],'lastMsgDirection':_0x4da300[_0xb518('0x17')][_0xb518('0xf')]()});}})[_0xb518('0x18')](function(_0x10ca6d){console[_0xb518('0x19')](_0x10ca6d);});}_0x1f36c8();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x54a7=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','error','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4a82fa,_0x20592c){var _0x2fdec4=function(_0x42a716){while(--_0x42a716){_0x4a82fa['push'](_0x4a82fa['shift']());}};_0x2fdec4(++_0x20592c);}(_0x54a7,0xe9));var _0x754a=function(_0x122cbd,_0x19b7ce){_0x122cbd=_0x122cbd-0x0;var _0x5ea0b1=_0x54a7[_0x122cbd];return _0x5ea0b1;};'use strict';var _=require(_0x754a('0x0'));var util=require(_0x754a('0x1'));var logger=require(_0x754a('0x2'))('api');var moment=require(_0x754a('0x3'));var BPromise=require('bluebird');var rp=require(_0x754a('0x4'));var fs=require('fs');var path=require(_0x754a('0x5'));var rimraf=require(_0x754a('0x6'));var config=require(_0x754a('0x7'));var attributes=require(_0x754a('0x8'));module[_0x754a('0x9')]=function(_0x426afc,_0x3ed013){return _0x426afc[_0x754a('0xa')](_0x754a('0xb'),attributes,{'tableName':_0x754a('0xc'),'paranoid':![],'indexes':[{'name':_0x754a('0xd'),'fields':[_0x754a('0xe')],'type':_0x754a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b8f89,_0x3295bc,_0x362f32){var _0x5b8723=_0x426afc[_0x754a('0x10')];var _0x542c6e=_0x4b8f89[_0x754a('0x11')]({'plain':!![]});if(_0x542c6e[_0x754a('0x12')][_0x754a('0x13')]()==='in'||_0x542c6e[_0x754a('0x12')][_0x754a('0x13')]()===_0x754a('0x14')&&!_0x542c6e[_0x754a('0x15')]&&!_[_0x754a('0x16')](_0x542c6e[_0x754a('0x17')])){_0x5b8723[_0x754a('0x18')][_0x754a('0x19')]({'where':{'id':_0x542c6e[_0x754a('0x1a')]}})['then'](function(_0x1c8845){if(_0x1c8845){_0x1c8845[_0x754a('0x1b')]({'lastMsgAt':_0x542c6e[_0x754a('0x1c')],'lastMsgDirection':_0x542c6e[_0x754a('0x12')][_0x754a('0x13')]()});}})['catch'](function(_0x1ec937){console[_0x754a('0x1d')](_0x1ec937);});}_0x362f32();}},'charset':'utf8mb4','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 bcd068d..e3f70f1 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 _0x5a4a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b6560,_0xde16b){var _0x1ad742=function(_0x3836b6){while(--_0x3836b6){_0x3b6560['push'](_0x3b6560['shift']());}};_0x1ad742(++_0xde16b);}(_0x5a4a,0xfc));var _0xa5a4=function(_0x59f100,_0x2f53a3){_0x59f100=_0x59f100-0x0;var _0x58e476=_0x5a4a[_0x59f100];return _0x58e476;};'use strict';var _=require(_0xa5a4('0x0'));var util=require(_0xa5a4('0x1'));var moment=require(_0xa5a4('0x2'));var BPromise=require(_0xa5a4('0x3'));var rs=require(_0xa5a4('0x4'));var fs=require('fs');var Redis=require(_0xa5a4('0x5'));var db=require(_0xa5a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5a4('0x7'))(_0xa5a4('0x8'));var config=require(_0xa5a4('0x9'));var jayson=require(_0xa5a4('0xa'));var client=jayson[_0xa5a4('0xb')][_0xa5a4('0xc')]({'port':0x232a});config[_0xa5a4('0xd')]=_[_0xa5a4('0xe')](config[_0xa5a4('0xd')],{'host':_0xa5a4('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5a4('0xd')]));require(_0xa5a4('0x10'))[_0xa5a4('0x11')](socket);function respondWithRpcPromise(_0x27eef3,_0x32d856,_0x427718){return new BPromise(function(_0x25ec93,_0x7cabd){return client[_0xa5a4('0x12')](_0x27eef3,_0x427718)['then'](function(_0x3c1d50){logger[_0xa5a4('0x13')](_0xa5a4('0x14'),_0x32d856,_0xa5a4('0x15'));logger['debug'](_0xa5a4('0x16'),_0x32d856,'request\x20sent',JSON[_0xa5a4('0x17')](_0x3c1d50));if(_0x3c1d50[_0xa5a4('0x18')]){if(_0x3c1d50['error'][_0xa5a4('0x19')]===0x1f4){logger[_0xa5a4('0x18')](_0xa5a4('0x14'),_0x32d856,_0x3c1d50[_0xa5a4('0x18')]['message']);return _0x7cabd(_0x3c1d50['error'][_0xa5a4('0x1a')]);}logger[_0xa5a4('0x18')]('ChatMessage,\x20%s,\x20%s',_0x32d856,_0x3c1d50[_0xa5a4('0x18')]['message']);return _0x25ec93(_0x3c1d50['error'][_0xa5a4('0x1a')]);}else{logger[_0xa5a4('0x13')]('ChatMessage,\x20%s,\x20%s',_0x32d856,_0xa5a4('0x15'));_0x25ec93(_0x3c1d50[_0xa5a4('0x1b')][_0xa5a4('0x1a')]);}})[_0xa5a4('0x1c')](function(_0x34bd15){logger[_0xa5a4('0x18')](_0xa5a4('0x14'),_0x32d856,_0x34bd15);_0x7cabd(_0x34bd15);});});}exports[_0xa5a4('0x1d')]=function(_0xcf9a10){var _0x227fe8=this;return new Promise(function(_0x152ff4,_0x1099a3){return db[_0xa5a4('0x1e')][_0xa5a4('0x1f')](_0xcf9a10[_0xa5a4('0x20')],{'raw':_0xcf9a10[_0xa5a4('0x21')]?_0xcf9a10[_0xa5a4('0x21')][_0xa5a4('0x22')]===undefined?!![]:![]:!![]})[_0xa5a4('0x23')](function(_0x2ccd7c){logger[_0xa5a4('0x13')](_0xa5a4('0x1d'),_0xcf9a10);logger[_0xa5a4('0x24')](_0xa5a4('0x1d'),_0xcf9a10,JSON[_0xa5a4('0x17')](_0x2ccd7c));_0x152ff4(_0x2ccd7c);})[_0xa5a4('0x1c')](function(_0x1ee959){logger[_0xa5a4('0x18')]('CreateChatMessage',_0x1ee959[_0xa5a4('0x1a')],_0xcf9a10);_0x1099a3(_0x227fe8[_0xa5a4('0x18')](0x1f4,_0x1ee959[_0xa5a4('0x1a')]));});});}; \ No newline at end of file +var _0x1014=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','error','ChatMessage,\x20%s,\x20%s','message','request\x20sent','catch','CreateChatMessage','create','options','raw','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e26b5,_0xdc679c){var _0x1f8b6a=function(_0x34d4e2){while(--_0x34d4e2){_0x5e26b5['push'](_0x5e26b5['shift']());}};_0x1f8b6a(++_0xdc679c);}(_0x1014,0x1c7));var _0x4101=function(_0x401221,_0x7b3acc){_0x401221=_0x401221-0x0;var _0x5e9bb9=_0x1014[_0x401221];return _0x5e9bb9;};'use strict';var _=require('lodash');var util=require(_0x4101('0x0'));var moment=require('moment');var BPromise=require(_0x4101('0x1'));var rs=require(_0x4101('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4101('0x3'))['db'];var utils=require(_0x4101('0x4'));var logger=require('../../config/logger')(_0x4101('0x5'));var config=require(_0x4101('0x6'));var jayson=require(_0x4101('0x7'));var client=jayson[_0x4101('0x8')][_0x4101('0x9')]({'port':0x232a});config[_0x4101('0xa')]=_[_0x4101('0xb')](config[_0x4101('0xa')],{'host':_0x4101('0xc'),'port':0x18eb});var socket=require(_0x4101('0xd'))(new Redis(config[_0x4101('0xa')]));require('./chatMessage.socket')[_0x4101('0xe')](socket);function respondWithRpcPromise(_0x2f98ed,_0x57728d,_0x769161){return new BPromise(function(_0x154aae,_0x27e99b){return client[_0x4101('0xf')](_0x2f98ed,_0x769161)[_0x4101('0x10')](function(_0x1f1471){logger[_0x4101('0x11')]('ChatMessage,\x20%s,\x20%s',_0x57728d,'request\x20sent');logger[_0x4101('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57728d,'request\x20sent',JSON['stringify'](_0x1f1471));if(_0x1f1471[_0x4101('0x13')]){if(_0x1f1471[_0x4101('0x13')]['code']===0x1f4){logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x27e99b(_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);}logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x154aae(_0x1f1471[_0x4101('0x13')]['message']);}else{logger[_0x4101('0x11')](_0x4101('0x14'),_0x57728d,_0x4101('0x16'));_0x154aae(_0x1f1471['result'][_0x4101('0x15')]);}})[_0x4101('0x17')](function(_0x44f73e){logger[_0x4101('0x13')]('ChatMessage,\x20%s,\x20%s',_0x57728d,_0x44f73e);_0x27e99b(_0x44f73e);});});}exports[_0x4101('0x18')]=function(_0x2cb011){var _0x7f7e79=this;return new Promise(function(_0x13b129,_0xd88bcb){return db['ChatMessage'][_0x4101('0x19')](_0x2cb011['body'],{'raw':_0x2cb011[_0x4101('0x1a')]?_0x2cb011[_0x4101('0x1a')][_0x4101('0x1b')]===undefined?!![]:![]:!![]})[_0x4101('0x10')](function(_0x238134){logger[_0x4101('0x11')](_0x4101('0x18'),_0x2cb011);logger[_0x4101('0x12')](_0x4101('0x18'),_0x2cb011,JSON[_0x4101('0x1c')](_0x238134));_0x13b129(_0x238134);})[_0x4101('0x17')](function(_0x436a51){logger[_0x4101('0x13')]('CreateChatMessage',_0x436a51['message'],_0x2cb011);_0xd88bcb(_0x7f7e79[_0x4101('0x13')](0x1f4,_0x436a51['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index dceb039..7bd8458 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 _0xfc17=['emit','removeListener','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1f7951,_0x492727){var _0x43ce4d=function(_0x29dec3){while(--_0x29dec3){_0x1f7951['push'](_0x1f7951['shift']());}};_0x43ce4d(++_0x492727);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x557890,_0x50e2f9){_0x557890=_0x557890-0x0;var _0x4aa144=_0xfc17[_0x557890];return _0x4aa144;};'use strict';var ChatMessageEvents=require(_0x7fc1('0x0'));var events=[_0x7fc1('0x1'),_0x7fc1('0x2'),_0x7fc1('0x3')];function createListener(_0x524e76,_0x184a4d){return function(_0x3bbf44){_0x184a4d[_0x7fc1('0x4')](_0x524e76,_0x3bbf44);};}function removeListener(_0x1f6079,_0x44101d){return function(){ChatMessageEvents[_0x7fc1('0x5')](_0x1f6079,_0x44101d);};}exports['register']=function(_0x30f5f8){for(var _0x1867ea=0x0,_0x2267ea=events[_0x7fc1('0x6')];_0x1867ea<_0x2267ea;_0x1867ea++){var _0x24c678=events[_0x1867ea];var _0x1b7106=createListener(_0x7fc1('0x7')+_0x24c678,_0x30f5f8);ChatMessageEvents['on'](_0x24c678,_0x1b7106);}}; \ No newline at end of file +var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xa8eb,0x179));var _0xba8e=function(_0x34aa65,_0x4fb4a0){_0x34aa65=_0x34aa65-0x0;var _0x3c39ce=_0xa8eb[_0x34aa65];return _0x3c39ce;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index e536367..d01a25a 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 _0x5c13=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','describe','show','create','/:id','put','accept','/:id/reject','reject','delete'];(function(_0x2d35d8,_0x23367f){var _0x4248ec=function(_0x1b7918){while(--_0x1b7918){_0x2d35d8['push'](_0x2d35d8['shift']());}};_0x4248ec(++_0x23367f);}(_0x5c13,0x7e));var _0x35c1=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x5c13[_0xf91841];return _0x4b9c44;};'use strict';var multer=require(_0x35c1('0x0'));var util=require(_0x35c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35c1('0x2'));var router=express[_0x35c1('0x3')]();var fs_extra=require(_0x35c1('0x4'));var auth=require(_0x35c1('0x5'));var interaction=require(_0x35c1('0x6'));var config=require(_0x35c1('0x7'));var controller=require(_0x35c1('0x8'));router['get']('/',auth[_0x35c1('0x9')](),controller['index']);router[_0x35c1('0xa')](_0x35c1('0xb'),auth[_0x35c1('0x9')](),controller[_0x35c1('0xc')]);router[_0x35c1('0xa')]('/:id',auth[_0x35c1('0x9')](),controller[_0x35c1('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0x35c1('0xe')]);router['put'](_0x35c1('0xf'),controller['update']);router[_0x35c1('0x10')]('/:id/accept',auth[_0x35c1('0x9')](),controller[_0x35c1('0x11')]);router['put'](_0x35c1('0x12'),auth[_0x35c1('0x9')](),controller[_0x35c1('0x13')]);router[_0x35c1('0x14')](_0x35c1('0xf'),auth[_0x35c1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x75c9=['create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','chat','chatmessage:create'];(function(_0x39eafc,_0x33c5e9){var _0x3008f6=function(_0x34479f){while(--_0x34479f){_0x39eafc['push'](_0x39eafc['shift']());}};_0x3008f6(++_0x33c5e9);}(_0x75c9,0x127));var _0x975c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x75c9[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require(_0x975c('0x0'));var util=require('util');var path=require(_0x975c('0x1'));var timeout=require('connect-timeout');var express=require(_0x975c('0x2'));var router=express['Router']();var fs_extra=require(_0x975c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x975c('0x4'));var config=require(_0x975c('0x5'));var controller=require(_0x975c('0x6'));router[_0x975c('0x7')]('/',auth['isAuthenticated'](),controller[_0x975c('0x8')]);router[_0x975c('0x7')](_0x975c('0x9'),auth[_0x975c('0xa')](),controller['describe']);router[_0x975c('0x7')](_0x975c('0xb'),auth[_0x975c('0xa')](),controller[_0x975c('0xc')]);router[_0x975c('0xd')]('/',auth[_0x975c('0xa')](),interaction[_0x975c('0xe')](_0x975c('0xf'),_0x975c('0x10')),controller[_0x975c('0x11')]);router[_0x975c('0x12')]('/:id',controller[_0x975c('0x13')]);router[_0x975c('0x12')](_0x975c('0x14'),auth[_0x975c('0xa')](),controller[_0x975c('0x15')]);router[_0x975c('0x12')]('/:id/reject',auth[_0x975c('0xa')](),controller[_0x975c('0x16')]);router[_0x975c('0x17')](_0x975c('0xb'),auth['isAuthenticated'](),controller[_0x975c('0x18')]);module[_0x975c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 6d9f14f..31cbe8b 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x5f305d,_0x30f146){var _0x39a87e=function(_0x11b635){while(--_0x11b635){_0x5f305d['push'](_0x5f305d['shift']());}};_0x39a87e(++_0x30f146);}(_0xdb28,0x106));var _0x8db2=function(_0x4d4f54,_0x1df8b1){_0x4d4f54=_0x4d4f54-0x0;var _0x43b089=_0xdb28[_0x4d4f54];return _0x43b089;};'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 +var _0x5f66=['medium','TEXT','exports'];(function(_0x574a1f,_0x554c25){var _0xa334dc=function(_0x34df7f){while(--_0x34df7f){_0x574a1f['push'](_0x574a1f['shift']());}};_0xa334dc(++_0x554c25);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 0043788..85d90ef 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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x388319,_0x4d24af){_0x388319=_0x388319-0x0;var _0x4caa76=_0x7a54[_0x388319];return _0x4caa76;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x353ce0,_0x2242e2){var _0x5aa4c1=function(_0x202385){while(--_0x202385){_0x353ce0['push'](_0x353ce0['shift']());}};_0x5aa4c1(++_0x2242e2);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index f8c5224..d13276a 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 _0xe367=['ChatOfflineMessage','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1169ec,_0x592493){var _0x334838=function(_0x3ab056){while(--_0x3ab056){_0x1169ec['push'](_0x1169ec['shift']());}};_0x334838(++_0x592493);}(_0xe367,0x116));var _0x7e36=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xe367[_0x1928c9];return _0x51b5fb;};'use strict';var EventEmitter=require(_0x7e36('0x0'));var ChatOfflineMessage=require(_0x7e36('0x1'))['db'][_0x7e36('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7e36('0x3'),'afterUpdate':_0x7e36('0x4'),'afterDestroy':_0x7e36('0x5')};function emitEvent(_0x3ca3a8){return function(_0xe1068b,_0x1f5176,_0x33669d){ChatOfflineMessageEvents[_0x7e36('0x6')](_0x3ca3a8+':'+_0xe1068b['id'],_0xe1068b);ChatOfflineMessageEvents[_0x7e36('0x6')](_0x3ca3a8,_0xe1068b);_0x33669d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x7e36('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x3304=['remove','emit','hook','exports','setMaxListeners','save','update'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x3304,0xc8));var _0x4330=function(_0x1d1d1a,_0x4d3eca){_0x1d1d1a=_0x1d1d1a-0x0;var _0x53027b=_0x3304[_0x1d1d1a];return _0x53027b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x4330('0x0')](0x0);var events={'afterCreate':_0x4330('0x1'),'afterUpdate':_0x4330('0x2'),'afterDestroy':_0x4330('0x3')};function emitEvent(_0x5f1fad){return function(_0xfd8c3e,_0x363ea6,_0xcc4149){ChatOfflineMessageEvents[_0x4330('0x4')](_0x5f1fad+':'+_0xfd8c3e['id'],_0xfd8c3e);ChatOfflineMessageEvents[_0x4330('0x4')](_0x5f1fad,_0xfd8c3e);_0xcc4149(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x4330('0x5')](e,emitEvent(event));}}module[_0x4330('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 28c6ba7..c2ee5eb 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 _0x49c9=['define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x205255,_0x36b8c8){var _0x2a36a5=function(_0x3d8906){while(--_0x3d8906){_0x205255['push'](_0x205255['shift']());}};_0x2a36a5(++_0x36b8c8);}(_0x49c9,0x158));var _0x949c=function(_0xb2e367,_0x2c6b86){_0xb2e367=_0xb2e367-0x0;var _0x320b08=_0x49c9[_0xb2e367];return _0x320b08;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x949c('0x0')]=function(_0x3d9a9a){return _0x3d9a9a[_0x949c('0x1')]('ChatOfflineMessage',attributes,{'tableName':_0x949c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x949c('0x3'),'collate':_0x949c('0x4')});}; \ No newline at end of file +var _0x0282=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0x4aabc1,_0x15e9b0){var _0x302c36=function(_0x5d2280){while(--_0x5d2280){_0x4aabc1['push'](_0x4aabc1['shift']());}};_0x302c36(++_0x15e9b0);}(_0x0282,0x118));var _0x2028=function(_0x144337,_0x1e2197){_0x144337=_0x144337-0x0;var _0x536147=_0x0282[_0x144337];return _0x536147;};'use strict';var attributes=require(_0x2028('0x0'));module['exports']=function(_0x41e43d){return _0x41e43d[_0x2028('0x1')](_0x2028('0x2'),attributes,{'tableName':_0x2028('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2028('0x4'),'collate':_0x2028('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e900652..2931980 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 _0x08e9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3fc8f2,_0x54b438){var _0x4325f2=function(_0x156e6c){while(--_0x156e6c){_0x3fc8f2['push'](_0x3fc8f2['shift']());}};_0x4325f2(++_0x54b438);}(_0x08e9,0xd1));var _0x908e=function(_0x1d630f,_0x343a35){_0x1d630f=_0x1d630f-0x0;var _0x327b13=_0x08e9[_0x1d630f];return _0x327b13;};'use strict';var _=require(_0x908e('0x0'));var util=require(_0x908e('0x1'));var moment=require(_0x908e('0x2'));var BPromise=require(_0x908e('0x3'));var rs=require(_0x908e('0x4'));var fs=require('fs');var Redis=require(_0x908e('0x5'));var db=require(_0x908e('0x6'))['db'];var utils=require(_0x908e('0x7'));var logger=require(_0x908e('0x8'))(_0x908e('0x9'));var config=require(_0x908e('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x908e('0xb')][_0x908e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x412275,_0x1eed47,_0x181fa8){return new BPromise(function(_0x4e2d63,_0x3a8f88){return client[_0x908e('0xd')](_0x412275,_0x181fa8)[_0x908e('0xe')](function(_0x10c315){logger[_0x908e('0xf')](_0x908e('0x10'),_0x1eed47,_0x908e('0x11'));logger[_0x908e('0x12')](_0x908e('0x13'),_0x1eed47,_0x908e('0x11'),JSON[_0x908e('0x14')](_0x10c315));if(_0x10c315[_0x908e('0x15')]){if(_0x10c315[_0x908e('0x15')][_0x908e('0x16')]===0x1f4){logger[_0x908e('0x15')](_0x908e('0x10'),_0x1eed47,_0x10c315['error'][_0x908e('0x17')]);return _0x3a8f88(_0x10c315[_0x908e('0x15')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1eed47,_0x10c315[_0x908e('0x15')][_0x908e('0x17')]);return _0x4e2d63(_0x10c315[_0x908e('0x15')][_0x908e('0x17')]);}else{logger[_0x908e('0xf')](_0x908e('0x10'),_0x1eed47,_0x908e('0x11'));_0x4e2d63(_0x10c315[_0x908e('0x18')][_0x908e('0x17')]);}})[_0x908e('0x19')](function(_0x48229e){logger[_0x908e('0x15')](_0x908e('0x10'),_0x1eed47,_0x48229e);_0x3a8f88(_0x48229e);});});} \ No newline at end of file +var _0xf463=['result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf463,0x94));var _0x3f46=function(_0x3b92df,_0xe3ea6b){_0x3b92df=_0x3b92df-0x0;var _0x175211=_0xf463[_0x3b92df];return _0x175211;};'use strict';var _=require('lodash');var util=require(_0x3f46('0x0'));var moment=require('moment');var BPromise=require(_0x3f46('0x1'));var rs=require(_0x3f46('0x2'));var fs=require('fs');var Redis=require(_0x3f46('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f46('0x4'));var logger=require(_0x3f46('0x5'))(_0x3f46('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f46('0x7'));var client=jayson[_0x3f46('0x8')][_0x3f46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5626d5,_0x3ba556,_0x288523){return new BPromise(function(_0x43b630,_0x3d1c58){return client[_0x3f46('0xa')](_0x5626d5,_0x288523)['then'](function(_0x27985d){logger[_0x3f46('0xb')](_0x3f46('0xc'),_0x3ba556,_0x3f46('0xd'));logger[_0x3f46('0xe')](_0x3f46('0xf'),_0x3ba556,_0x3f46('0xd'),JSON[_0x3f46('0x10')](_0x27985d));if(_0x27985d[_0x3f46('0x11')]){if(_0x27985d[_0x3f46('0x11')][_0x3f46('0x12')]===0x1f4){logger[_0x3f46('0x11')](_0x3f46('0xc'),_0x3ba556,_0x27985d['error']['message']);return _0x3d1c58(_0x27985d[_0x3f46('0x11')][_0x3f46('0x13')]);}logger[_0x3f46('0x11')](_0x3f46('0xc'),_0x3ba556,_0x27985d['error'][_0x3f46('0x13')]);return _0x43b630(_0x27985d['error'][_0x3f46('0x13')]);}else{logger[_0x3f46('0xb')](_0x3f46('0xc'),_0x3ba556,'request\x20sent');_0x43b630(_0x27985d[_0x3f46('0x14')][_0x3f46('0x13')]);}})['catch'](function(_0x186678){logger[_0x3f46('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ba556,_0x186678);_0x3d1c58(_0x186678);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 00345f7..c4c1851 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 _0x69ba=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy'];(function(_0x4ca12e,_0x3bd8c7){var _0x3123a2=function(_0x4ae3da){while(--_0x4ae3da){_0x4ca12e['push'](_0x4ca12e['shift']());}};_0x3123a2(++_0x3bd8c7);}(_0x69ba,0x109));var _0xa69b=function(_0x4d3f81,_0x5cae96){_0x4d3f81=_0x4d3f81-0x0;var _0x27ba5c=_0x69ba[_0x4d3f81];return _0x27ba5c;};'use strict';var multer=require(_0xa69b('0x0'));var util=require(_0xa69b('0x1'));var path=require(_0xa69b('0x2'));var timeout=require(_0xa69b('0x3'));var express=require(_0xa69b('0x4'));var router=express['Router']();var fs_extra=require(_0xa69b('0x5'));var auth=require(_0xa69b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa69b('0x7'));var controller=require(_0xa69b('0x8'));router[_0xa69b('0x9')]('/',auth[_0xa69b('0xa')](),controller[_0xa69b('0xb')]);router['get'](_0xa69b('0xc'),auth[_0xa69b('0xa')](),controller[_0xa69b('0xd')]);router[_0xa69b('0x9')](_0xa69b('0xe'),auth[_0xa69b('0xa')](),controller['show']);router[_0xa69b('0xf')]('/',auth['isAuthenticated'](),controller[_0xa69b('0x10')]);router[_0xa69b('0x11')](_0xa69b('0xe'),auth[_0xa69b('0xa')](),controller[_0xa69b('0x12')]);router[_0xa69b('0x13')]('/:id',auth[_0xa69b('0xa')](),controller[_0xa69b('0x14')]);module[_0xa69b('0x15')]=router; \ No newline at end of file +var _0x1ca4=['post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x1ca4,0x155));var _0x41ca=function(_0x2e2a96,_0x226e9f){_0x2e2a96=_0x2e2a96-0x0;var _0x3c07c6=_0x1ca4[_0x2e2a96];return _0x3c07c6;};'use strict';var multer=require(_0x41ca('0x0'));var util=require('util');var path=require(_0x41ca('0x1'));var timeout=require(_0x41ca('0x2'));var express=require(_0x41ca('0x3'));var router=express[_0x41ca('0x4')]();var fs_extra=require(_0x41ca('0x5'));var auth=require(_0x41ca('0x6'));var interaction=require(_0x41ca('0x7'));var config=require(_0x41ca('0x8'));var controller=require(_0x41ca('0x9'));router[_0x41ca('0xa')]('/',auth[_0x41ca('0xb')](),controller['index']);router[_0x41ca('0xa')](_0x41ca('0xc'),auth[_0x41ca('0xb')](),controller[_0x41ca('0xd')]);router[_0x41ca('0xa')](_0x41ca('0xe'),auth['isAuthenticated'](),controller[_0x41ca('0xf')]);router[_0x41ca('0x10')]('/',auth[_0x41ca('0xb')](),controller[_0x41ca('0x11')]);router['put'](_0x41ca('0xe'),auth['isAuthenticated'](),controller[_0x41ca('0x12')]);router[_0x41ca('0x13')]('/:id',auth[_0x41ca('0xb')](),controller['destroy']);module[_0x41ca('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e4ae0ae..38118d2 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 _0x2661=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2661,0x152));var _0x1266=function(_0x3d6a13,_0x38deb6){_0x3d6a13=_0x3d6a13-0x0;var _0x49ac0a=_0x2661[_0x3d6a13];return _0x49ac0a;};'use strict';var Sequelize=require(_0x1266('0x0'));module[_0x1266('0x1')]={'name':{'type':Sequelize[_0x1266('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1266('0x3')](_0x1266('0x4'),_0x1266('0x5')),'defaultValue':_0x1266('0x4')},'selector':{'type':Sequelize[_0x1266('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1d61=['timeout','INTEGER','sequelize','mouseOver'];(function(_0x2d7f04,_0x50e80c){var _0x36d3e8=function(_0x2998a1){while(--_0x2998a1){_0x2d7f04['push'](_0x2d7f04['shift']());}};_0x36d3e8(++_0x50e80c);}(_0x1d61,0x13e));var _0x11d6=function(_0x4f5fab,_0x438a4b){_0x4f5fab=_0x4f5fab-0x0;var _0x3b0ac0=_0x1d61[_0x4f5fab];return _0x3b0ac0;};'use strict';var Sequelize=require(_0x11d6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x11d6('0x1'),_0x11d6('0x2')),'defaultValue':_0x11d6('0x1')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x11d6('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 9c8fab8..08689c0 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 _0xf483=['query','attributes','intersection','model','fields','length','includeAll','merge','options','find','catch','update','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','stack','name','show','params','keys','ChatProactiveAction'];(function(_0x480bc0,_0x3eb7d2){var _0x4c0970=function(_0x396fe6){while(--_0x396fe6){_0x480bc0['push'](_0x480bc0['shift']());}};_0x4c0970(++_0x3eb7d2);}(_0xf483,0xf2));var _0x3f48=function(_0x47b7c4,_0x41d72b){_0x47b7c4=_0x47b7c4-0x0;var _0x544129=_0xf483[_0x47b7c4];return _0x544129;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f48('0x1'));var rp=require(_0x3f48('0x2'));var moment=require(_0x3f48('0x3'));var BPromise=require(_0x3f48('0x4'));var Mustache=require(_0x3f48('0x5'));var util=require(_0x3f48('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f48('0x7'));var fs=require('fs');var fs_extra=require(_0x3f48('0x8'));var _=require('lodash');var squel=require(_0x3f48('0x9'));var crypto=require(_0x3f48('0xa'));var jsforce=require(_0x3f48('0xb'));var deskjs=require(_0x3f48('0xc'));var toCsv=require(_0x3f48('0xd'));var querystring=require(_0x3f48('0xe'));var Papa=require(_0x3f48('0xf'));var Redis=require('ioredis');var authService=require(_0x3f48('0x10'));var qs=require(_0x3f48('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f48('0x12'));var logger=require('../../config/logger')(_0x3f48('0x13'));var utils=require(_0x3f48('0x14'));var config=require(_0x3f48('0x15'));var licenseUtil=require(_0x3f48('0x16'));var db=require(_0x3f48('0x17'))['db'];function respondWithStatusCode(_0x1e9563,_0x38502b){_0x38502b=_0x38502b||0xcc;return function(_0x5867db){if(_0x5867db){return _0x1e9563[_0x3f48('0x18')](_0x38502b);}return _0x1e9563[_0x3f48('0x19')](_0x38502b)['end']();};}function respondWithResult(_0x27ca72,_0x4e1f66){_0x4e1f66=_0x4e1f66||0xc8;return function(_0x101139){if(_0x101139){return _0x27ca72['status'](_0x4e1f66)[_0x3f48('0x1a')](_0x101139);}};}function respondWithFilteredResult(_0x57c489,_0x2a2083){return function(_0x2013b9){if(_0x2013b9){var _0x364032=typeof _0x2a2083['offset']===_0x3f48('0x1b')&&typeof _0x2a2083[_0x3f48('0x1c')]===_0x3f48('0x1b');var _0x6b97bf=_0x2013b9['count'];var _0x211b22=_0x364032?0x0:_0x2a2083[_0x3f48('0x1d')];var _0x14133f=_0x364032?_0x2013b9[_0x3f48('0x1e')]:_0x2a2083[_0x3f48('0x1d')]+_0x2a2083[_0x3f48('0x1c')];var _0x7a962f;if(_0x14133f>=_0x6b97bf){_0x14133f=_0x6b97bf;_0x7a962f=0xc8;}else{_0x7a962f=0xce;}_0x57c489[_0x3f48('0x19')](_0x7a962f);return _0x57c489[_0x3f48('0x1f')](_0x3f48('0x20'),_0x211b22+'-'+_0x14133f+'/'+_0x6b97bf)[_0x3f48('0x1a')](_0x2013b9);}return null;};}function patchUpdates(_0x353a23){return function(_0x108c6e){try{jsonpatch[_0x3f48('0x21')](_0x108c6e,_0x353a23,!![]);}catch(_0x323230){return BPromise[_0x3f48('0x22')](_0x323230);}return _0x108c6e[_0x3f48('0x23')]();};}function saveUpdates(_0x285462,_0x12fcde){return function(_0x12ef86){if(_0x12ef86){return _0x12ef86['update'](_0x285462)['then'](function(_0x3c9d93){return _0x3c9d93;});}return null;};}function removeEntity(_0xa85425,_0x2e569d){return function(_0x56ad7b){if(_0x56ad7b){return _0x56ad7b['destroy']()[_0x3f48('0x24')](function(){_0xa85425[_0x3f48('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30a5f1,_0x2e101d){return function(_0xe2bcb0){if(!_0xe2bcb0){_0x30a5f1[_0x3f48('0x18')](0x194);}return _0xe2bcb0;};}function handleError(_0xd01529,_0x108852){_0x108852=_0x108852||0x1f4;return function(_0x2cf7a9){logger['error'](_0x2cf7a9[_0x3f48('0x25')]);if(_0x2cf7a9[_0x3f48('0x26')]){delete _0x2cf7a9[_0x3f48('0x26')];}_0xd01529[_0x3f48('0x19')](_0x108852)['send'](_0x2cf7a9);};}exports[_0x3f48('0x27')]=function(_0x1e6297,_0x562001){var _0x2a5e3f={'raw':!![],'where':{'id':_0x1e6297[_0x3f48('0x28')]['id']}},_0x33201e={};_0x33201e['model']=_[_0x3f48('0x29')](db[_0x3f48('0x2a')]['rawAttributes']);_0x33201e[_0x3f48('0x2b')]=_[_0x3f48('0x29')](_0x1e6297[_0x3f48('0x2b')]);_0x33201e['filters']=_['intersection'](_0x33201e['model'],_0x33201e[_0x3f48('0x2b')]);_0x2a5e3f[_0x3f48('0x2c')]=_[_0x3f48('0x2d')](_0x33201e[_0x3f48('0x2e')],qs[_0x3f48('0x2f')](_0x1e6297[_0x3f48('0x2b')][_0x3f48('0x2f')]));_0x2a5e3f[_0x3f48('0x2c')]=_0x2a5e3f[_0x3f48('0x2c')][_0x3f48('0x30')]?_0x2a5e3f[_0x3f48('0x2c')]:_0x33201e[_0x3f48('0x2e')];if(_0x1e6297[_0x3f48('0x2b')][_0x3f48('0x31')]){_0x2a5e3f['include']=[{'all':!![]}];}_0x2a5e3f=_[_0x3f48('0x32')]({},_0x2a5e3f,_0x1e6297[_0x3f48('0x33')]);return db['ChatProactiveAction'][_0x3f48('0x34')](_0x2a5e3f)['then'](handleEntityNotFound(_0x562001,null))['then'](respondWithResult(_0x562001,null))['catch'](handleError(_0x562001,null));};exports['create']=function(_0x54d1c8,_0x54a59c){return db[_0x3f48('0x2a')]['create'](_0x54d1c8['body'],{})[_0x3f48('0x24')](respondWithResult(_0x54a59c,0xc9))[_0x3f48('0x35')](handleError(_0x54a59c,null));};exports[_0x3f48('0x36')]=function(_0x2b7935,_0x49d885){if(_0x2b7935[_0x3f48('0x37')]['id']){delete _0x2b7935['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2b7935[_0x3f48('0x28')]['id']}})[_0x3f48('0x24')](handleEntityNotFound(_0x49d885,null))['then'](saveUpdates(_0x2b7935[_0x3f48('0x37')],null))[_0x3f48('0x24')](respondWithResult(_0x49d885,null))[_0x3f48('0x35')](handleError(_0x49d885,null));};exports[_0x3f48('0x38')]=function(_0x4779af,_0x481b82){return db[_0x3f48('0x2a')][_0x3f48('0x34')]({'where':{'id':_0x4779af[_0x3f48('0x28')]['id']}})[_0x3f48('0x24')](handleEntityNotFound(_0x481b82,null))[_0x3f48('0x24')](removeEntity(_0x481b82,null))[_0x3f48('0x35')](handleError(_0x481b82,null));}; \ No newline at end of file +var _0x45d1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','update','then','destroy','end','error','name','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x45d1,0x1cb));var _0x145d=function(_0x539fb2,_0x5b6718){_0x539fb2=_0x539fb2-0x0;var _0x4d583d=_0x45d1[_0x539fb2];return _0x4d583d;};'use strict';var emlformat=require(_0x145d('0x0'));var rimraf=require(_0x145d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x145d('0x2'));var rp=require(_0x145d('0x3'));var moment=require('moment');var BPromise=require(_0x145d('0x4'));var Mustache=require('mustache');var util=require(_0x145d('0x5'));var path=require(_0x145d('0x6'));var sox=require(_0x145d('0x7'));var csv=require(_0x145d('0x8'));var ejs=require(_0x145d('0x9'));var fs=require('fs');var fs_extra=require(_0x145d('0xa'));var _=require(_0x145d('0xb'));var squel=require(_0x145d('0xc'));var crypto=require(_0x145d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x145d('0xe'));var Papa=require(_0x145d('0xf'));var Redis=require(_0x145d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x145d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x145d('0x12'));var logger=require(_0x145d('0x13'))(_0x145d('0x14'));var utils=require(_0x145d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x145d('0x16'));var db=require(_0x145d('0x17'))['db'];function respondWithStatusCode(_0x53956e,_0x70a6bd){_0x70a6bd=_0x70a6bd||0xcc;return function(_0x1a7e96){if(_0x1a7e96){return _0x53956e[_0x145d('0x18')](_0x70a6bd);}return _0x53956e[_0x145d('0x19')](_0x70a6bd)['end']();};}function respondWithResult(_0x5b8ffa,_0x100e7d){_0x100e7d=_0x100e7d||0xc8;return function(_0x851a19){if(_0x851a19){return _0x5b8ffa[_0x145d('0x19')](_0x100e7d)['json'](_0x851a19);}};}function respondWithFilteredResult(_0x24eaa2,_0x3e041a){return function(_0x5c0621){if(_0x5c0621){var _0x32f6eb=typeof _0x3e041a[_0x145d('0x1a')]==='undefined'&&typeof _0x3e041a[_0x145d('0x1b')]===_0x145d('0x1c');var _0x2f2353=_0x5c0621['count'];var _0x20a5b9=_0x32f6eb?0x0:_0x3e041a[_0x145d('0x1a')];var _0x197b53=_0x32f6eb?_0x5c0621[_0x145d('0x1d')]:_0x3e041a['offset']+_0x3e041a[_0x145d('0x1b')];var _0x295918;if(_0x197b53>=_0x2f2353){_0x197b53=_0x2f2353;_0x295918=0xc8;}else{_0x295918=0xce;}_0x24eaa2[_0x145d('0x19')](_0x295918);return _0x24eaa2['set'](_0x145d('0x1e'),_0x20a5b9+'-'+_0x197b53+'/'+_0x2f2353)[_0x145d('0x1f')](_0x5c0621);}return null;};}function patchUpdates(_0x4a6ef4){return function(_0x2e0d83){try{jsonpatch[_0x145d('0x20')](_0x2e0d83,_0x4a6ef4,!![]);}catch(_0x21b57f){return BPromise['reject'](_0x21b57f);}return _0x2e0d83['save']();};}function saveUpdates(_0x5c857e,_0x2a7d59){return function(_0x11bf8b){if(_0x11bf8b){return _0x11bf8b[_0x145d('0x21')](_0x5c857e)[_0x145d('0x22')](function(_0x50678e){return _0x50678e;});}return null;};}function removeEntity(_0x1a6cd2,_0x1f2eb8){return function(_0x5b6768){if(_0x5b6768){return _0x5b6768[_0x145d('0x23')]()['then'](function(){_0x1a6cd2['status'](0xcc)[_0x145d('0x24')]();});}};}function handleEntityNotFound(_0x583baf,_0x168a8f){return function(_0x227faa){if(!_0x227faa){_0x583baf[_0x145d('0x18')](0x194);}return _0x227faa;};}function handleError(_0x1a2307,_0x3402dc){_0x3402dc=_0x3402dc||0x1f4;return function(_0x2c4c88){logger[_0x145d('0x25')](_0x2c4c88['stack']);if(_0x2c4c88[_0x145d('0x26')]){delete _0x2c4c88['name'];}_0x1a2307[_0x145d('0x19')](_0x3402dc)['send'](_0x2c4c88);};}exports[_0x145d('0x27')]=function(_0x571909,_0x24a84c){var _0x3764c6={'raw':!![],'where':{'id':_0x571909[_0x145d('0x28')]['id']}},_0x1358b3={};_0x1358b3[_0x145d('0x29')]=_[_0x145d('0x2a')](db['ChatProactiveAction']['rawAttributes']);_0x1358b3['query']=_[_0x145d('0x2a')](_0x571909[_0x145d('0x2b')]);_0x1358b3[_0x145d('0x2c')]=_[_0x145d('0x2d')](_0x1358b3[_0x145d('0x29')],_0x1358b3['query']);_0x3764c6['attributes']=_['intersection'](_0x1358b3[_0x145d('0x29')],qs[_0x145d('0x2e')](_0x571909[_0x145d('0x2b')][_0x145d('0x2e')]));_0x3764c6[_0x145d('0x2f')]=_0x3764c6[_0x145d('0x2f')][_0x145d('0x30')]?_0x3764c6[_0x145d('0x2f')]:_0x1358b3[_0x145d('0x29')];if(_0x571909[_0x145d('0x2b')][_0x145d('0x31')]){_0x3764c6[_0x145d('0x32')]=[{'all':!![]}];}_0x3764c6=_[_0x145d('0x33')]({},_0x3764c6,_0x571909[_0x145d('0x34')]);return db['ChatProactiveAction'][_0x145d('0x35')](_0x3764c6)[_0x145d('0x22')](handleEntityNotFound(_0x24a84c,null))[_0x145d('0x22')](respondWithResult(_0x24a84c,null))[_0x145d('0x36')](handleError(_0x24a84c,null));};exports[_0x145d('0x37')]=function(_0x1a3782,_0x80e8b6){return db[_0x145d('0x38')][_0x145d('0x37')](_0x1a3782['body'],{})[_0x145d('0x22')](respondWithResult(_0x80e8b6,0xc9))[_0x145d('0x36')](handleError(_0x80e8b6,null));};exports[_0x145d('0x21')]=function(_0x410e94,_0x432283){if(_0x410e94[_0x145d('0x39')]['id']){delete _0x410e94['body']['id'];}return db['ChatProactiveAction'][_0x145d('0x35')]({'where':{'id':_0x410e94[_0x145d('0x28')]['id']}})[_0x145d('0x22')](handleEntityNotFound(_0x432283,null))[_0x145d('0x22')](saveUpdates(_0x410e94[_0x145d('0x39')],null))[_0x145d('0x22')](respondWithResult(_0x432283,null))['catch'](handleError(_0x432283,null));};exports[_0x145d('0x23')]=function(_0x52e88f,_0xdc819){return db[_0x145d('0x38')][_0x145d('0x35')]({'where':{'id':_0x52e88f[_0x145d('0x28')]['id']}})['then'](handleEntityNotFound(_0xdc819,null))['then'](removeEntity(_0xdc819,null))[_0x145d('0x36')](handleError(_0xdc819,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index a94f7b9..d511e84 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 _0x650b=['chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatProactiveAction'];(function(_0x19e21d,_0x21b638){var _0x4834a2=function(_0xbf3a6){while(--_0xbf3a6){_0x19e21d['push'](_0x19e21d['shift']());}};_0x4834a2(++_0x21b638);}(_0x650b,0x1e2));var _0xb650=function(_0xaf114d,_0x2bf02f){_0xaf114d=_0xaf114d-0x0;var _0x3fa697=_0x650b[_0xaf114d];return _0x3fa697;};'use strict';var _=require(_0xb650('0x0'));var util=require(_0xb650('0x1'));var logger=require(_0xb650('0x2'))(_0xb650('0x3'));var moment=require(_0xb650('0x4'));var BPromise=require(_0xb650('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb650('0x6'));var rimraf=require(_0xb650('0x7'));var config=require(_0xb650('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xb650('0x9')]=function(_0x1349a4,_0x934540){return _0x1349a4[_0xb650('0xa')](_0xb650('0xb'),attributes,{'tableName':_0xb650('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5e6=['define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x3765e6,_0x51e984){var _0x25c181=function(_0x5b9ff6){while(--_0x5b9ff6){_0x3765e6['push'](_0x3765e6['shift']());}};_0x25c181(++_0x51e984);}(_0xd5e6,0x1a3));var _0x6d5e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd5e6[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x6d5e('0x0'));var util=require(_0x6d5e('0x1'));var logger=require(_0x6d5e('0x2'))(_0x6d5e('0x3'));var moment=require('moment');var BPromise=require(_0x6d5e('0x4'));var rp=require(_0x6d5e('0x5'));var fs=require('fs');var path=require(_0x6d5e('0x6'));var rimraf=require(_0x6d5e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d5e('0x8'));module[_0x6d5e('0x9')]=function(_0x113539,_0x10b044){return _0x113539[_0x6d5e('0xa')](_0x6d5e('0xb'),attributes,{'tableName':_0x6d5e('0xc'),'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 2635f44..5b50eb7 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 _0xfca2=['http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfca2,0x6d));var _0x2fca=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xfca2[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0x2fca('0x0'));var util=require('util');var moment=require(_0x2fca('0x1'));var BPromise=require(_0x2fca('0x2'));var rs=require(_0x2fca('0x3'));var fs=require('fs');var Redis=require(_0x2fca('0x4'));var db=require(_0x2fca('0x5'))['db'];var utils=require(_0x2fca('0x6'));var logger=require(_0x2fca('0x7'))(_0x2fca('0x8'));var config=require('../../config/environment');var jayson=require(_0x2fca('0x9'));var client=jayson[_0x2fca('0xa')][_0x2fca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x459131,_0x3d0d36,_0x54bb89){return new BPromise(function(_0x34151b,_0x1b6b6c){return client['request'](_0x459131,_0x54bb89)[_0x2fca('0xc')](function(_0xb49d9d){logger[_0x2fca('0xd')](_0x2fca('0xe'),_0x3d0d36,'request\x20sent');logger[_0x2fca('0xf')](_0x2fca('0x10'),_0x3d0d36,_0x2fca('0x11'),JSON[_0x2fca('0x12')](_0xb49d9d));if(_0xb49d9d[_0x2fca('0x13')]){if(_0xb49d9d[_0x2fca('0x13')][_0x2fca('0x14')]===0x1f4){logger[_0x2fca('0x13')](_0x2fca('0xe'),_0x3d0d36,_0xb49d9d['error'][_0x2fca('0x15')]);return _0x1b6b6c(_0xb49d9d[_0x2fca('0x13')]['message']);}logger[_0x2fca('0x13')](_0x2fca('0xe'),_0x3d0d36,_0xb49d9d[_0x2fca('0x13')]['message']);return _0x34151b(_0xb49d9d['error']['message']);}else{logger[_0x2fca('0xd')](_0x2fca('0xe'),_0x3d0d36,_0x2fca('0x11'));_0x34151b(_0xb49d9d[_0x2fca('0x16')]['message']);}})[_0x2fca('0x17')](function(_0x6ddb8){logger[_0x2fca('0x13')](_0x2fca('0xe'),_0x3d0d36,_0x6ddb8);_0x1b6b6c(_0x6ddb8);});});} \ No newline at end of file +var _0x6c89=['message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x6c89,0x12d));var _0x96c8=function(_0xc369b1,_0x2c147a){_0xc369b1=_0xc369b1-0x0;var _0x33fc2e=_0x6c89[_0xc369b1];return _0x33fc2e;};'use strict';var _=require('lodash');var util=require(_0x96c8('0x0'));var moment=require(_0x96c8('0x1'));var BPromise=require(_0x96c8('0x2'));var rs=require(_0x96c8('0x3'));var fs=require('fs');var Redis=require(_0x96c8('0x4'));var db=require(_0x96c8('0x5'))['db'];var utils=require(_0x96c8('0x6'));var logger=require('../../config/logger')(_0x96c8('0x7'));var config=require(_0x96c8('0x8'));var jayson=require(_0x96c8('0x9'));var client=jayson['client'][_0x96c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66dff2,_0x2ac8d0,_0x181ef9){return new BPromise(function(_0x2cbe77,_0x2fbede){return client[_0x96c8('0xb')](_0x66dff2,_0x181ef9)[_0x96c8('0xc')](function(_0x2776ee){logger[_0x96c8('0xd')](_0x96c8('0xe'),_0x2ac8d0,_0x96c8('0xf'));logger[_0x96c8('0x10')](_0x96c8('0x11'),_0x2ac8d0,_0x96c8('0xf'),JSON[_0x96c8('0x12')](_0x2776ee));if(_0x2776ee[_0x96c8('0x13')]){if(_0x2776ee[_0x96c8('0x13')][_0x96c8('0x14')]===0x1f4){logger[_0x96c8('0x13')](_0x96c8('0xe'),_0x2ac8d0,_0x2776ee[_0x96c8('0x13')][_0x96c8('0x15')]);return _0x2fbede(_0x2776ee[_0x96c8('0x13')]['message']);}logger['error'](_0x96c8('0xe'),_0x2ac8d0,_0x2776ee[_0x96c8('0x13')][_0x96c8('0x15')]);return _0x2cbe77(_0x2776ee['error'][_0x96c8('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2ac8d0,_0x96c8('0xf'));_0x2cbe77(_0x2776ee[_0x96c8('0x16')][_0x96c8('0x15')]);}})['catch'](function(_0x5c4343){logger[_0x96c8('0x13')](_0x96c8('0xe'),_0x2ac8d0,_0x5c4343);_0x2fbede(_0x5c4343);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d409d92..5573471 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 _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x2b3b3a,_0x3226e0){var _0x4b1b2c=function(_0x53b585){while(--_0x53b585){_0x2b3b3a['push'](_0x2b3b3a['shift']());}};_0x4b1b2c(++_0x3226e0);}(_0x46ed,0x168));var _0xd46e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x46ed[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file +var _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x4d3f0b,_0x44a31a){var _0x39ec4b=function(_0x4ef45c){while(--_0x4ef45c){_0x4d3f0b['push'](_0x4d3f0b['shift']());}};_0x39ec4b(++_0x44a31a);}(_0xee14,0x13a));var _0x4ee1=function(_0x1d5fb0,_0x23d0f2){_0x1d5fb0=_0x1d5fb0-0x0;var _0x53520e=_0xee14[_0x1d5fb0];return _0x53520e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('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 fe0b928..ec86b21 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 _0x8e80=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x2cb943,_0x2b1e5e){var _0x640a9c=function(_0x46cd4a){while(--_0x46cd4a){_0x2cb943['push'](_0x2cb943['shift']());}};_0x640a9c(++_0x2b1e5e);}(_0x8e80,0x1d1));var _0x08e8=function(_0x4dd15b,_0x1d880a){_0x4dd15b=_0x4dd15b-0x0;var _0x2445f2=_0x8e80[_0x4dd15b];return _0x2445f2;};'use strict';var Sequelize=require(_0x08e8('0x0'));module[_0x08e8('0x1')]={'name':{'type':Sequelize[_0x08e8('0x2')],'unique':_0x08e8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x08e8('0x2')]},'timeout':{'type':Sequelize[_0x08e8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x08e8('0x5')](_0x08e8('0x6'),_0x08e8('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x2d43=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5cc3a6,_0x3b9e90){var _0x189cfd=function(_0x59d3cb){while(--_0x59d3cb){_0x5cc3a6['push'](_0x5cc3a6['shift']());}};_0x189cfd(++_0x3b9e90);}(_0x2d43,0x18a));var _0x32d4=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x2d43[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require(_0x32d4('0x0'));module[_0x32d4('0x1')]={'name':{'type':Sequelize[_0x32d4('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x32d4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x32d4('0x4')](_0x32d4('0x5'),_0x32d4('0x6'),_0x32d4('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 0479154..6186aa2 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 _0x45e5=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','localhost','./chatQueue.socket','client','http','then','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatQueue,\x20%s,\x20%s','message','info','result','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','update','describe','getMembers','pick','ChatQueueId','UserChatQueue','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','nolimit','addTeams','User','Agents','online','interface','transaction','findOrCreate','forEach','emit','removeTeams','ids','tq.TeamId','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x19f896,_0x52c84d){var _0x4c4eec=function(_0x4c2a3c){while(--_0x4c2a3c){_0x19f896['push'](_0x19f896['shift']());}};_0x4c4eec(++_0x52c84d);}(_0x45e5,0x11c));var _0x545e=function(_0x1a1db9,_0x19e741){_0x1a1db9=_0x1a1db9-0x0;var _0x3d29dc=_0x45e5[_0x1a1db9];return _0x3d29dc;};'use strict';var emlformat=require(_0x545e('0x0'));var rimraf=require(_0x545e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x545e('0x2'));var rp=require(_0x545e('0x3'));var moment=require(_0x545e('0x4'));var BPromise=require(_0x545e('0x5'));var Mustache=require(_0x545e('0x6'));var util=require(_0x545e('0x7'));var path=require(_0x545e('0x8'));var sox=require(_0x545e('0x9'));var csv=require('to-csv');var ejs=require(_0x545e('0xa'));var fs=require('fs');var fs_extra=require(_0x545e('0xb'));var _=require(_0x545e('0xc'));var squel=require('squel');var crypto=require(_0x545e('0xd'));var jsforce=require(_0x545e('0xe'));var deskjs=require(_0x545e('0xf'));var toCsv=require(_0x545e('0x10'));var querystring=require(_0x545e('0x11'));var Papa=require(_0x545e('0x12'));var Redis=require('ioredis');var authService=require(_0x545e('0x13'));var qs=require(_0x545e('0x14'));var as=require(_0x545e('0x15'));var hardwareService=require(_0x545e('0x16'));var logger=require('../../config/logger')(_0x545e('0x17'));var utils=require('../../config/utils');var config=require(_0x545e('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x545e('0x19')]=_['defaults'](config[_0x545e('0x19')],{'host':_0x545e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x545e('0x19')]));require(_0x545e('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x545e('0x1c')][_0x545e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1b8ec4,_0x897cca,_0x49f92d,_0x4ebcc8){return new BPromise(function(_0x343ac6,_0x26e7ef){var _0x5e296e=_0x4ebcc8||client;return _0x5e296e['request'](_0x1b8ec4,_0x49f92d)[_0x545e('0x1e')](function(_0x56a4a5){logger['info']('ChatQueue,\x20%s,\x20%s',_0x897cca,'request\x20sent');logger[_0x545e('0x1f')](_0x545e('0x20'),_0x897cca,_0x545e('0x21'),JSON[_0x545e('0x22')](_0x56a4a5));if(_0x56a4a5[_0x545e('0x23')]){if(_0x56a4a5[_0x545e('0x23')]['code']===0x1f4){logger[_0x545e('0x23')](_0x545e('0x24'),_0x897cca,_0x56a4a5[_0x545e('0x23')][_0x545e('0x25')]);return _0x26e7ef(_0x56a4a5['error'][_0x545e('0x25')]);}logger[_0x545e('0x23')]('ChatQueue,\x20%s,\x20%s',_0x897cca,_0x56a4a5[_0x545e('0x23')][_0x545e('0x25')]);return _0x343ac6(_0x56a4a5[_0x545e('0x23')][_0x545e('0x25')]);}else{logger[_0x545e('0x26')](_0x545e('0x24'),_0x897cca,_0x545e('0x21'));_0x343ac6(_0x56a4a5[_0x545e('0x27')][_0x545e('0x25')]);}})['catch'](function(_0x238b6c){logger[_0x545e('0x23')](_0x545e('0x24'),_0x897cca,_0x238b6c);_0x26e7ef(_0x238b6c);});});}function respondWithStatusCode(_0x1729f8,_0x2f9960){_0x2f9960=_0x2f9960||0xcc;return function(_0x5c4aa9){if(_0x5c4aa9){return _0x1729f8['sendStatus'](_0x2f9960);}return _0x1729f8['status'](_0x2f9960)['end']();};}function respondWithResult(_0xa09625,_0x4ee758){_0x4ee758=_0x4ee758||0xc8;return function(_0x500a44){if(_0x500a44){return _0xa09625[_0x545e('0x28')](_0x4ee758)[_0x545e('0x29')](_0x500a44);}};}function respondWithFilteredResult(_0x200930,_0xa510a1){return function(_0x4b70d9){if(_0x4b70d9){var _0x249837=typeof _0xa510a1[_0x545e('0x2a')]===_0x545e('0x2b')&&typeof _0xa510a1[_0x545e('0x2c')]==='undefined';var _0x22d329=_0x4b70d9['count'];var _0x53b7c6=_0x249837?0x0:_0xa510a1[_0x545e('0x2a')];var _0x29f6f0=_0x249837?_0x4b70d9[_0x545e('0x2d')]:_0xa510a1[_0x545e('0x2a')]+_0xa510a1[_0x545e('0x2c')];var _0x1c631b;if(_0x29f6f0>=_0x22d329){_0x29f6f0=_0x22d329;_0x1c631b=0xc8;}else{_0x1c631b=0xce;}_0x200930[_0x545e('0x28')](_0x1c631b);return _0x200930[_0x545e('0x2e')](_0x545e('0x2f'),_0x53b7c6+'-'+_0x29f6f0+'/'+_0x22d329)['json'](_0x4b70d9);}return null;};}function patchUpdates(_0x5505fe){return function(_0x3bdd9d){try{jsonpatch[_0x545e('0x30')](_0x3bdd9d,_0x5505fe,!![]);}catch(_0xc773ee){return BPromise['reject'](_0xc773ee);}return _0x3bdd9d[_0x545e('0x31')]();};}function saveUpdates(_0x46824f,_0x2ee03a){return function(_0x7d595c){if(_0x7d595c){return _0x7d595c['update'](_0x46824f)[_0x545e('0x1e')](function(_0x3c97a2){return _0x3c97a2;});}return null;};}function removeEntity(_0x2de7d8,_0x398b48){return function(_0x5e7e5d){if(_0x5e7e5d){return _0x5e7e5d[_0x545e('0x32')]()[_0x545e('0x1e')](function(){var _0x51ffcb=_0x5e7e5d['get']({'plain':!![]});var _0x43c960=_0x545e('0x33');return db[_0x545e('0x34')]['destroy']({'where':{'type':_0x43c960,'resourceId':_0x51ffcb['id']}})[_0x545e('0x1e')](function(){return _0x5e7e5d;});})[_0x545e('0x1e')](function(){_0x2de7d8[_0x545e('0x28')](0xcc)[_0x545e('0x35')]();});}};}function handleEntityNotFound(_0x277f41,_0x457cfa){return function(_0x33856c){if(!_0x33856c){_0x277f41[_0x545e('0x36')](0x194);}return _0x33856c;};}function handleError(_0x37b168,_0x430ca4){_0x430ca4=_0x430ca4||0x1f4;return function(_0x55bce4){logger[_0x545e('0x23')](_0x55bce4[_0x545e('0x37')]);if(_0x55bce4[_0x545e('0x38')]){delete _0x55bce4[_0x545e('0x38')];}_0x37b168[_0x545e('0x28')](_0x430ca4)[_0x545e('0x39')](_0x55bce4);};}exports[_0x545e('0x3a')]=function(_0x19e438,_0x54d018){var _0x2c4d2f={},_0x1734e1={},_0x509158={'count':0x0,'rows':[]};var _0x57384f=_[_0x545e('0x3b')](db[_0x545e('0x3c')][_0x545e('0x3d')],function(_0x46778b){return{'name':_0x46778b[_0x545e('0x3e')],'type':_0x46778b['type'][_0x545e('0x3f')]};});_0x1734e1[_0x545e('0x40')]=_['map'](_0x57384f,_0x545e('0x38'));_0x1734e1[_0x545e('0x41')]=_[_0x545e('0x42')](_0x19e438['query']);_0x1734e1[_0x545e('0x43')]=_[_0x545e('0x44')](_0x1734e1[_0x545e('0x40')],_0x1734e1['query']);_0x2c4d2f['attributes']=_['intersection'](_0x1734e1['model'],qs[_0x545e('0x45')](_0x19e438['query'][_0x545e('0x45')]));_0x2c4d2f['attributes']=_0x2c4d2f[_0x545e('0x46')][_0x545e('0x47')]?_0x2c4d2f['attributes']:_0x1734e1['model'];if(!_0x19e438[_0x545e('0x41')][_0x545e('0x48')]('nolimit')){_0x2c4d2f[_0x545e('0x2c')]=qs[_0x545e('0x2c')](_0x19e438[_0x545e('0x41')][_0x545e('0x2c')]);_0x2c4d2f[_0x545e('0x2a')]=qs[_0x545e('0x2a')](_0x19e438[_0x545e('0x41')][_0x545e('0x2a')]);}_0x2c4d2f[_0x545e('0x49')]=qs[_0x545e('0x4a')](_0x19e438['query']['sort']);_0x2c4d2f['where']=qs[_0x545e('0x43')](_['pick'](_0x19e438[_0x545e('0x41')],_0x1734e1[_0x545e('0x43')]),_0x57384f);if(_0x19e438['query'][_0x545e('0x4b')]){_0x2c4d2f['where']=_[_0x545e('0x4c')](_0x2c4d2f[_0x545e('0x4d')],{'$or':_[_0x545e('0x3b')](_0x57384f,function(_0x4b3c49){if(_0x4b3c49[_0x545e('0x4e')]!==_0x545e('0x4f')){var _0x341c71={};_0x341c71[_0x4b3c49[_0x545e('0x38')]]={'$like':'%'+_0x19e438[_0x545e('0x41')][_0x545e('0x4b')]+'%'};return _0x341c71;}})});}_0x2c4d2f=_[_0x545e('0x4c')]({},_0x2c4d2f,_0x19e438[_0x545e('0x50')]);var _0x202c7e={'where':_0x2c4d2f[_0x545e('0x4d')]};return db['ChatQueue'][_0x545e('0x2d')](_0x202c7e)[_0x545e('0x1e')](function(_0x34bfb5){_0x509158[_0x545e('0x2d')]=_0x34bfb5;if(_0x19e438[_0x545e('0x41')][_0x545e('0x51')]){_0x2c4d2f[_0x545e('0x52')]=[{'all':!![]}];}return db[_0x545e('0x3c')][_0x545e('0x53')](_0x2c4d2f);})['then'](function(_0x147f53){_0x509158[_0x545e('0x54')]=_0x147f53;return _0x509158;})[_0x545e('0x1e')](respondWithFilteredResult(_0x54d018,_0x2c4d2f))[_0x545e('0x55')](handleError(_0x54d018,null));};exports[_0x545e('0x56')]=function(_0x57f6ed,_0x3e4917){var _0x24e8a1={'raw':!![],'where':{'id':_0x57f6ed[_0x545e('0x57')]['id']}},_0x1108e5={};_0x1108e5['model']=_['keys'](db[_0x545e('0x3c')]['rawAttributes']);_0x1108e5['query']=_[_0x545e('0x42')](_0x57f6ed[_0x545e('0x41')]);_0x1108e5['filters']=_[_0x545e('0x44')](_0x1108e5['model'],_0x1108e5[_0x545e('0x41')]);_0x24e8a1[_0x545e('0x46')]=_['intersection'](_0x1108e5[_0x545e('0x40')],qs['fields'](_0x57f6ed[_0x545e('0x41')][_0x545e('0x45')]));_0x24e8a1[_0x545e('0x46')]=_0x24e8a1[_0x545e('0x46')][_0x545e('0x47')]?_0x24e8a1[_0x545e('0x46')]:_0x1108e5['model'];if(_0x57f6ed[_0x545e('0x41')][_0x545e('0x51')]){_0x24e8a1[_0x545e('0x52')]=[{'all':!![]}];}_0x24e8a1=_[_0x545e('0x4c')]({},_0x24e8a1,_0x57f6ed['options']);return db[_0x545e('0x3c')][_0x545e('0x58')](_0x24e8a1)[_0x545e('0x1e')](handleEntityNotFound(_0x3e4917,null))['then'](respondWithResult(_0x3e4917,null))['catch'](handleError(_0x3e4917,null));};exports[_0x545e('0x59')]=function(_0x349c81,_0x4c2b06){return db[_0x545e('0x3c')][_0x545e('0x59')](_0x349c81[_0x545e('0x5a')],{})[_0x545e('0x1e')](function(_0x38b397){var _0x25bc9a=_0x349c81[_0x545e('0x5b')]['get']({'plain':!![]});if(!_0x25bc9a)throw new Error(_0x545e('0x5c'));if(_0x25bc9a[_0x545e('0x5d')]===_0x545e('0x5b')){var _0x28eae2=_0x38b397[_0x545e('0x5e')]({'plain':!![]});var _0x28e038=_0x545e('0x33');return db['UserProfileSection'][_0x545e('0x58')]({'where':{'name':_0x28e038,'userProfileId':_0x25bc9a[_0x545e('0x5f')]},'raw':!![]})[_0x545e('0x1e')](function(_0x2af8ee){if(_0x2af8ee&&_0x2af8ee['autoAssociation']===0x0){return db[_0x545e('0x34')][_0x545e('0x59')]({'name':_0x28eae2['name'],'resourceId':_0x28eae2['id'],'type':_0x2af8ee['name'],'sectionId':_0x2af8ee['id']},{})['then'](function(){return _0x38b397;});}else{return _0x38b397;}})['catch'](function(_0x41cbda){logger[_0x545e('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41cbda);throw _0x41cbda;});}return _0x38b397;})[_0x545e('0x1e')](respondWithResult(_0x4c2b06,0xc9))[_0x545e('0x55')](handleError(_0x4c2b06,null));};exports[_0x545e('0x60')]=function(_0x417826,_0x21204a){if(_0x417826[_0x545e('0x5a')]['id']){delete _0x417826[_0x545e('0x5a')]['id'];}return db['ChatQueue'][_0x545e('0x58')]({'where':{'id':_0x417826[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0x21204a,null))['then'](saveUpdates(_0x417826[_0x545e('0x5a')],null))[_0x545e('0x1e')](respondWithResult(_0x21204a,null))['catch'](handleError(_0x21204a,null));};exports['destroy']=function(_0x4a0916,_0x12fdb3){return db[_0x545e('0x3c')][_0x545e('0x58')]({'where':{'id':_0x4a0916['params']['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0x12fdb3,null))['then'](removeEntity(_0x12fdb3,null))[_0x545e('0x55')](handleError(_0x12fdb3,null));};exports[_0x545e('0x61')]=function(_0x4afbd8,_0x55a849){return db['ChatQueue'][_0x545e('0x61')]()[_0x545e('0x1e')](respondWithResult(_0x55a849,null))[_0x545e('0x55')](handleError(_0x55a849,null));};exports[_0x545e('0x62')]=function(_0x2eec07,_0x1e5ffe,_0x9027c8){var _0x2d5272={'raw':!![],'where':{}},_0x39d359={},_0x32e293;return db[_0x545e('0x3c')]['findOne']({'where':{'id':_0x2eec07['params']['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0x1e5ffe,null))[_0x545e('0x1e')](function(_0x381a13){if(_0x381a13){_0x32e293=_0x381a13[_0x545e('0x5e')]({'plain':!![]});_0x39d359['model']=_[_0x545e('0x42')](db['UserChatQueue'][_0x545e('0x3d')]);_0x39d359[_0x545e('0x41')]=_[_0x545e('0x42')](_0x2eec07[_0x545e('0x41')]);_0x39d359[_0x545e('0x43')]=_[_0x545e('0x44')](_0x39d359['model'],_0x39d359['query']);_0x2d5272[_0x545e('0x46')]=_[_0x545e('0x44')](_0x39d359[_0x545e('0x40')],qs[_0x545e('0x45')](_0x2eec07['query'][_0x545e('0x45')]));_0x2d5272['attributes']=_0x2d5272[_0x545e('0x46')][_0x545e('0x47')]?_0x2d5272[_0x545e('0x46')]:_0x39d359[_0x545e('0x40')];if(!_0x2eec07[_0x545e('0x41')][_0x545e('0x48')]('nolimit')){_0x2d5272['limit']=qs[_0x545e('0x2c')](_0x2eec07[_0x545e('0x41')][_0x545e('0x2c')]);_0x2d5272[_0x545e('0x2a')]=qs['offset'](_0x2eec07[_0x545e('0x41')][_0x545e('0x2a')]);}_0x2d5272[_0x545e('0x49')]=qs[_0x545e('0x4a')](_0x2eec07[_0x545e('0x41')][_0x545e('0x4a')]);_0x2d5272['where']=qs[_0x545e('0x43')](_[_0x545e('0x63')](_0x2eec07[_0x545e('0x41')],_0x39d359[_0x545e('0x43')]));_0x2d5272[_0x545e('0x4d')][_0x545e('0x64')]=_0x381a13['id'];if(_0x2eec07[_0x545e('0x41')][_0x545e('0x4b')]){_0x2d5272['where']=_[_0x545e('0x4c')](_0x2d5272['where'],{'$or':_['map'](_0x2d5272[_0x545e('0x46')],function(_0xcd3600){var _0x4d0838={};_0x4d0838[_0xcd3600]={'$like':'%'+_0x2eec07[_0x545e('0x41')]['filter']+'%'};return _0x4d0838;})});}_0x2d5272=_['merge']({},_0x2d5272,_0x2eec07[_0x545e('0x50')]);return db[_0x545e('0x65')]['findAll'](_0x2d5272);}})['then'](function(_0x2e2cdd){if(_0x2e2cdd){return db['User'][_0x545e('0x66')]({'where':{'id':_['map'](_0x2e2cdd,_0x545e('0x67')),'role':_0x545e('0x68')},'attributes':['id',_0x545e('0x38'),_0x545e('0x69'),_0x545e('0x6a'),_0x545e('0x6b')]});}})[_0x545e('0x1e')](function(_0x1020f5){if(_0x1020f5){return{'count':_0x1020f5[_0x545e('0x2d')],'rows':_[_0x545e('0x3b')](_0x1020f5[_0x545e('0x54')],function(_0x2bc292){return{'membername':_0x2bc292[_0x545e('0x38')],'UserId':_0x2bc292['id'],'queue_name':_0x32e293[_0x545e('0x38')],'ChatQueueId':_0x32e293['id'],'interface':util['format'](_0x545e('0x6c'),_0x545e('0x6d'),_0x2bc292['name']),'penalty':0x0,'paused':_0x2bc292[_0x545e('0x69')],'createdAt':_0x2bc292['createdAt'],'updatedAt':_0x2bc292[_0x545e('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x545e('0x1e')](respondWithFilteredResult(_0x1e5ffe,_0x2d5272))['catch'](handleError(_0x1e5ffe,null));};exports[_0x545e('0x6e')]=function(_0x198f6d,_0xdfdf39,_0x12ff09){var _0x5a1f67={};var _0x15327b={};var _0x1f6d4a;var _0x12da30;return db['ChatQueue'][_0x545e('0x6f')]({'where':{'id':_0x198f6d[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0xdfdf39,null))[_0x545e('0x1e')](function(_0x504412){if(_0x504412){_0x1f6d4a=_0x504412;_0x15327b[_0x545e('0x40')]=_[_0x545e('0x42')](db[_0x545e('0x70')][_0x545e('0x3d')]);_0x15327b[_0x545e('0x41')]=_[_0x545e('0x42')](_0x198f6d['query']);_0x15327b[_0x545e('0x43')]=_['intersection'](_0x15327b[_0x545e('0x40')],_0x15327b['query']);_0x5a1f67[_0x545e('0x46')]=_[_0x545e('0x44')](_0x15327b[_0x545e('0x40')],qs['fields'](_0x198f6d[_0x545e('0x41')]['fields']));_0x5a1f67['attributes']=_0x5a1f67[_0x545e('0x46')][_0x545e('0x47')]?_0x5a1f67[_0x545e('0x46')]:_0x15327b[_0x545e('0x40')];_0x5a1f67[_0x545e('0x49')]=qs[_0x545e('0x4a')](_0x198f6d[_0x545e('0x41')]['sort']);_0x5a1f67[_0x545e('0x4d')]=qs['filters'](_['pick'](_0x198f6d[_0x545e('0x41')],_0x15327b[_0x545e('0x43')]));if(_0x198f6d[_0x545e('0x41')][_0x545e('0x4b')]){_0x5a1f67[_0x545e('0x4d')]=_[_0x545e('0x4c')](_0x5a1f67[_0x545e('0x4d')],{'$or':_[_0x545e('0x3b')](_0x5a1f67[_0x545e('0x46')],function(_0x218ab4){var _0x3d1c72={};_0x3d1c72[_0x218ab4]={'$like':'%'+_0x198f6d[_0x545e('0x41')][_0x545e('0x4b')]+'%'};return _0x3d1c72;})});}_0x5a1f67=_[_0x545e('0x4c')]({},_0x5a1f67,_0x198f6d[_0x545e('0x50')]);return _0x1f6d4a[_0x545e('0x6e')](_0x5a1f67);}})[_0x545e('0x1e')](function(_0x46ca03){if(_0x46ca03){_0x12da30=_0x46ca03[_0x545e('0x47')];if(!_0x198f6d[_0x545e('0x41')][_0x545e('0x48')](_0x545e('0x71'))){_0x5a1f67[_0x545e('0x2c')]=qs[_0x545e('0x2c')](_0x198f6d['query'][_0x545e('0x2c')]);_0x5a1f67['offset']=qs['offset'](_0x198f6d[_0x545e('0x41')][_0x545e('0x2a')]);}return _0x1f6d4a[_0x545e('0x6e')](_0x5a1f67);}})[_0x545e('0x1e')](function(_0x548d42){if(_0x548d42){return _0x548d42?{'count':_0x12da30,'rows':_0x548d42}:null;}})[_0x545e('0x1e')](respondWithResult(_0xdfdf39,null))[_0x545e('0x55')](handleError(_0xdfdf39,null));};exports[_0x545e('0x72')]=function(_0x4c3a3f,_0x5e1559,_0x50c174){var _0x3376cb=_0x4c3a3f['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x3376cb},'attributes':['id'],'include':[{'model':db[_0x545e('0x73')],'as':_0x545e('0x74'),'attributes':['id',_0x545e('0x38'),_0x545e('0x75'),'voicePause',_0x545e('0x76')],'raw':!![]}]})[_0x545e('0x1e')](function(_0x39d297){if(_0x39d297){var _0x2b3c48=_['flatMap'](_0x39d297,function(_0x323cfa){var _0x64c82b=_0x323cfa['get']({'plain':!![]});return _0x64c82b[_0x545e('0x74')];});return db[_0x545e('0x3c')]['find']({'where':{'id':_0x4c3a3f[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](function(_0x2b7cb7){return db['sequelize'][_0x545e('0x77')](function(_0x404e30){return _0x2b7cb7[_0x545e('0x72')](_0x3376cb,{'transaction':_0x404e30})[_0x545e('0x1e')](function(){return BPromise['each'](_0x2b3c48,function(_0x2091b5){return db[_0x545e('0x65')][_0x545e('0x78')]({'where':{'UserId':_0x2091b5['id'],'ChatQueueId':_0x4c3a3f[_0x545e('0x57')]['id']},'transaction':_0x404e30});});})['then'](function(){_0x2b3c48[_0x545e('0x79')](function(_0x12e4c0){socket[_0x545e('0x7a')]('userChatQueue:save',{'UserId':_0x12e4c0['id'],'ChatQueueId':_0x2b7cb7['id']});});});});});}})[_0x545e('0x1e')](respondWithStatusCode(_0x5e1559,null))['catch'](handleError(_0x5e1559,null));};exports[_0x545e('0x7b')]=function(_0x5e2a77,_0x615df3,_0x40a5b3){return db[_0x545e('0x70')][_0x545e('0x53')]({'where':{'id':_0x5e2a77[_0x545e('0x41')][_0x545e('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x545e('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x615df3,null))[_0x545e('0x1e')](function(_0x2aa6a1){var _0x381f18=_[_0x545e('0x3b')](_0x2aa6a1,'id');var _0x2fdc40=[];var _0x477af8=[];var _0x5c5366=squel['select']();_0x5c5366['field'](_0x545e('0x7d'))['from'](_0x545e('0x7e'),'tq')[_0x545e('0x7f')](_0x545e('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x545e('0x4d')](_0x545e('0x81'),_0x5e2a77[_0x545e('0x57')]['id']);for(var _0x1eb681=0x0;_0x1eb681<_0x2aa6a1[_0x545e('0x47')];_0x1eb681+=0x1){let _0x516f1e=_0x2aa6a1[_0x1eb681];for(var _0x1e58be=0x0;_0x1e58be<_0x516f1e['Agents']['length'];_0x1e58be+=0x1){let _0x3ab27f=_0x516f1e[_0x545e('0x74')][_0x1e58be];var _0x293581=_0x5c5366[_0x545e('0x82')]();_0x293581[_0x545e('0x4d')](_0x545e('0x83'),_0x3ab27f['id']);_0x477af8[_0x545e('0x84')](db[_0x545e('0x85')][_0x545e('0x41')](_0x293581['toString'](),{'type':db['sequelize'][_0x545e('0x86')][_0x545e('0x87')]})[_0x545e('0x1e')](function(_0x357a6a){if(_0x357a6a['length']===0x1){return _0x3ab27f['id'];}else{var _0x40b10e=_[_0x545e('0x88')](_[_0x545e('0x3b')](_0x357a6a,'TeamId'),function(_0x1bc007){return _[_0x545e('0x89')](_0x381f18,_0x1bc007);});if(_0x40b10e){return _0x3ab27f['id'];}}}));}}return BPromise['all'](_0x477af8)[_0x545e('0x1e')](function(_0x5c0d42){_0x2fdc40=_(_0x2fdc40)[_0x545e('0x8a')](_0x5c0d42)[_0x545e('0x8b')]()[_0x545e('0x8c')]();return db[_0x545e('0x3c')][_0x545e('0x58')]({'where':{'id':_0x5e2a77[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](function(_0x593ff8){return db[_0x545e('0x85')]['transaction'](function(_0x1b5e53){return _0x593ff8[_0x545e('0x7b')](_0x5e2a77[_0x545e('0x41')]['ids'],{'transaction':_0x1b5e53})[_0x545e('0x1e')](function(){if(!_[_0x545e('0x8d')](_0x2fdc40)){return _0x593ff8[_0x545e('0x8e')](_0x2fdc40,{'transaction':_0x1b5e53});}})[_0x545e('0x1e')](function(){_0x2fdc40['forEach'](function(_0x40cb06){socket[_0x545e('0x7a')](_0x545e('0x8f'),{'UserId':_0x40cb06,'ChatQueueId':_0x593ff8['id']});});});});});});})[_0x545e('0x1e')](respondWithStatusCode(_0x615df3,null))[_0x545e('0x55')](handleError(_0x615df3,null));};exports[_0x545e('0x90')]=function(_0x2f9325,_0xdfa052,_0x2de526){return db['ChatQueue']['find']({'where':{'id':_0x2f9325[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0xdfa052,null))[_0x545e('0x1e')](function(_0x1de123){if(_0x1de123){return _0x1de123['addAgents'](_0x2f9325['body']['ids'],_[_0x545e('0x91')](_0x2f9325['body'],[_0x545e('0x7c'),'id'])||{})[_0x545e('0x92')](function(_0x293c6e){for(var _0x7c8ea8=0x0;_0x7c8ea8<_0x2f9325[_0x545e('0x5a')][_0x545e('0x7c')]['length'];_0x7c8ea8+=0x1){socket[_0x545e('0x7a')](_0x545e('0x93'),{'UserId':Number(_0x2f9325[_0x545e('0x5a')]['ids'][_0x7c8ea8]),'ChatQueueId':Number(_0x2f9325[_0x545e('0x57')]['id'])});}return _0x293c6e;});}})['then'](respondWithResult(_0xdfa052,null))[_0x545e('0x55')](handleError(_0xdfa052,null));};exports['removeAgents']=function(_0x4fdb00,_0x849de1,_0x2de4c9){return db['ChatQueue'][_0x545e('0x58')]({'where':{'id':_0x4fdb00[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0x849de1,null))[_0x545e('0x1e')](function(_0x38b30f){if(_0x38b30f){return _0x38b30f[_0x545e('0x8e')](_0x4fdb00[_0x545e('0x41')][_0x545e('0x7c')])['then'](function(){if(_['isArray'](_0x4fdb00[_0x545e('0x41')][_0x545e('0x7c')])){for(var _0x1c5216=0x0;_0x1c5216<_0x4fdb00[_0x545e('0x41')]['ids'][_0x545e('0x47')];_0x1c5216+=0x1){socket[_0x545e('0x7a')](_0x545e('0x8f'),{'UserId':Number(_0x4fdb00[_0x545e('0x41')][_0x545e('0x7c')][_0x1c5216]),'ChatQueueId':Number(_0x4fdb00['params']['id'])});}}else{socket[_0x545e('0x7a')](_0x545e('0x8f'),{'UserId':Number(_0x4fdb00[_0x545e('0x41')]['ids']),'ChatQueueId':Number(_0x4fdb00[_0x545e('0x57')]['id'])});}});}})[_0x545e('0x1e')](respondWithStatusCode(_0x849de1,null))[_0x545e('0x55')](handleError(_0x849de1,null));};exports[_0x545e('0x94')]=function(_0x4726ab,_0x5187e6,_0x5ceaef){var _0x1ffff4={};var _0x3e5bcb={};var _0x16770d;var _0x8c27e4;return db[_0x545e('0x3c')]['findOne']({'where':{'id':_0x4726ab[_0x545e('0x57')]['id']}})[_0x545e('0x1e')](handleEntityNotFound(_0x5187e6,null))[_0x545e('0x1e')](function(_0x1c6e93){if(_0x1c6e93){_0x16770d=_0x1c6e93;_0x3e5bcb['model']=_[_0x545e('0x42')](db[_0x545e('0x73')][_0x545e('0x3d')]);_0x3e5bcb[_0x545e('0x41')]=_[_0x545e('0x42')](_0x4726ab['query']);_0x3e5bcb[_0x545e('0x43')]=_[_0x545e('0x44')](_0x3e5bcb[_0x545e('0x40')],_0x3e5bcb[_0x545e('0x41')]);_0x1ffff4['attributes']=_[_0x545e('0x44')](_0x3e5bcb['model'],qs[_0x545e('0x45')](_0x4726ab[_0x545e('0x41')][_0x545e('0x45')]));_0x1ffff4['attributes']=_0x1ffff4[_0x545e('0x46')][_0x545e('0x47')]?_0x1ffff4['attributes']:_0x3e5bcb[_0x545e('0x40')];_0x1ffff4[_0x545e('0x49')]=qs['sort'](_0x4726ab[_0x545e('0x41')]['sort']);_0x1ffff4['where']=qs[_0x545e('0x43')](_[_0x545e('0x63')](_0x4726ab['query'],_0x3e5bcb[_0x545e('0x43')]));if(_0x4726ab[_0x545e('0x41')]['filter']){_0x1ffff4[_0x545e('0x4d')]=_[_0x545e('0x4c')](_0x1ffff4[_0x545e('0x4d')],{'$or':_[_0x545e('0x3b')](_0x1ffff4[_0x545e('0x46')],function(_0x5db194){var _0x58cc53={};_0x58cc53[_0x5db194]={'$like':'%'+_0x4726ab[_0x545e('0x41')]['filter']+'%'};return _0x58cc53;})});}_0x1ffff4=_[_0x545e('0x4c')]({},_0x1ffff4,_0x4726ab[_0x545e('0x50')]);return _0x16770d['getAgents'](_0x1ffff4);}})[_0x545e('0x1e')](function(_0x23cd8c){if(_0x23cd8c){_0x8c27e4=_0x23cd8c[_0x545e('0x47')];if(!_0x4726ab[_0x545e('0x41')]['hasOwnProperty'](_0x545e('0x71'))){_0x1ffff4[_0x545e('0x2c')]=qs[_0x545e('0x2c')](_0x4726ab[_0x545e('0x41')][_0x545e('0x2c')]);_0x1ffff4['offset']=qs[_0x545e('0x2a')](_0x4726ab[_0x545e('0x41')][_0x545e('0x2a')]);}return _0x16770d['getAgents'](_0x1ffff4);}})[_0x545e('0x1e')](function(_0x486ca0){if(_0x486ca0){return _0x486ca0?{'count':_0x8c27e4,'rows':_0x486ca0}:null;}})['then'](respondWithResult(_0x5187e6,null))[_0x545e('0x55')](handleError(_0x5187e6,null));}; \ No newline at end of file +var _0xa7d5=['tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserChatQueue','ChatQueueId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','order','Team','User','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','ids','select','field'];(function(_0x285c72,_0x17e370){var _0x5adc55=function(_0x162dec){while(--_0x162dec){_0x285c72['push'](_0x285c72['shift']());}};_0x5adc55(++_0x17e370);}(_0xa7d5,0x1e8));var _0x5a7d=function(_0x167a2b,_0x5b3a55){_0x167a2b=_0x167a2b-0x0;var _0x10a6b8=_0xa7d5[_0x167a2b];return _0x10a6b8;};'use strict';var emlformat=require(_0x5a7d('0x0'));var rimraf=require(_0x5a7d('0x1'));var zipdir=require(_0x5a7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a7d('0x3'));var moment=require(_0x5a7d('0x4'));var BPromise=require(_0x5a7d('0x5'));var Mustache=require(_0x5a7d('0x6'));var util=require('util');var path=require(_0x5a7d('0x7'));var sox=require(_0x5a7d('0x8'));var csv=require(_0x5a7d('0x9'));var ejs=require(_0x5a7d('0xa'));var fs=require('fs');var fs_extra=require(_0x5a7d('0xb'));var _=require('lodash');var squel=require(_0x5a7d('0xc'));var crypto=require('crypto');var jsforce=require(_0x5a7d('0xd'));var deskjs=require(_0x5a7d('0xe'));var toCsv=require(_0x5a7d('0x9'));var querystring=require('querystring');var Papa=require(_0x5a7d('0xf'));var Redis=require(_0x5a7d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a7d('0x11'));var as=require(_0x5a7d('0x12'));var hardwareService=require(_0x5a7d('0x13'));var logger=require(_0x5a7d('0x14'))('api');var utils=require(_0x5a7d('0x15'));var config=require(_0x5a7d('0x16'));var licenseUtil=require(_0x5a7d('0x17'));var db=require(_0x5a7d('0x18'))['db'];config['redis']=_['defaults'](config[_0x5a7d('0x19')],{'host':_0x5a7d('0x1a'),'port':0x18eb});var socket=require(_0x5a7d('0x1b'))(new Redis(config[_0x5a7d('0x19')]));require(_0x5a7d('0x1c'))[_0x5a7d('0x1d')](socket);var jayson=require(_0x5a7d('0x1e'));var client=jayson['client'][_0x5a7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x7460ac,_0x23a6a1,_0x58975e,_0xd2b48d){return new BPromise(function(_0x527da5,_0x20dfe4){var _0x38bdcd=_0xd2b48d||client;return _0x38bdcd[_0x5a7d('0x20')](_0x7460ac,_0x58975e)['then'](function(_0x3cf376){logger[_0x5a7d('0x21')](_0x5a7d('0x22'),_0x23a6a1,'request\x20sent');logger[_0x5a7d('0x23')](_0x5a7d('0x24'),_0x23a6a1,_0x5a7d('0x25'),JSON[_0x5a7d('0x26')](_0x3cf376));if(_0x3cf376[_0x5a7d('0x27')]){if(_0x3cf376[_0x5a7d('0x27')][_0x5a7d('0x28')]===0x1f4){logger[_0x5a7d('0x27')](_0x5a7d('0x22'),_0x23a6a1,_0x3cf376[_0x5a7d('0x27')][_0x5a7d('0x29')]);return _0x20dfe4(_0x3cf376[_0x5a7d('0x27')][_0x5a7d('0x29')]);}logger['error'](_0x5a7d('0x22'),_0x23a6a1,_0x3cf376['error']['message']);return _0x527da5(_0x3cf376['error'][_0x5a7d('0x29')]);}else{logger[_0x5a7d('0x21')]('ChatQueue,\x20%s,\x20%s',_0x23a6a1,_0x5a7d('0x25'));_0x527da5(_0x3cf376['result']['message']);}})['catch'](function(_0x1a4eac){logger[_0x5a7d('0x27')](_0x5a7d('0x22'),_0x23a6a1,_0x1a4eac);_0x20dfe4(_0x1a4eac);});});}function respondWithStatusCode(_0x5676c,_0xd0a79f){_0xd0a79f=_0xd0a79f||0xcc;return function(_0x1a25c1){if(_0x1a25c1){return _0x5676c[_0x5a7d('0x2a')](_0xd0a79f);}return _0x5676c[_0x5a7d('0x2b')](_0xd0a79f)['end']();};}function respondWithResult(_0x158649,_0x291c9d){_0x291c9d=_0x291c9d||0xc8;return function(_0x4fe34b){if(_0x4fe34b){return _0x158649[_0x5a7d('0x2b')](_0x291c9d)[_0x5a7d('0x2c')](_0x4fe34b);}};}function respondWithFilteredResult(_0x43e29b,_0x36a88c){return function(_0x2ea8fa){if(_0x2ea8fa){var _0x54773c=typeof _0x36a88c[_0x5a7d('0x2d')]==='undefined'&&typeof _0x36a88c['limit']==='undefined';var _0xfd84bd=_0x2ea8fa[_0x5a7d('0x2e')];var _0xbe116d=_0x54773c?0x0:_0x36a88c['offset'];var _0x29c9af=_0x54773c?_0x2ea8fa[_0x5a7d('0x2e')]:_0x36a88c['offset']+_0x36a88c['limit'];var _0x24017b;if(_0x29c9af>=_0xfd84bd){_0x29c9af=_0xfd84bd;_0x24017b=0xc8;}else{_0x24017b=0xce;}_0x43e29b[_0x5a7d('0x2b')](_0x24017b);return _0x43e29b[_0x5a7d('0x2f')](_0x5a7d('0x30'),_0xbe116d+'-'+_0x29c9af+'/'+_0xfd84bd)[_0x5a7d('0x2c')](_0x2ea8fa);}return null;};}function patchUpdates(_0x229ebe){return function(_0x332d45){try{jsonpatch[_0x5a7d('0x31')](_0x332d45,_0x229ebe,!![]);}catch(_0x48ff0e){return BPromise[_0x5a7d('0x32')](_0x48ff0e);}return _0x332d45[_0x5a7d('0x33')]();};}function saveUpdates(_0x5d459b,_0x1d09ec){return function(_0x4bb4f2){if(_0x4bb4f2){return _0x4bb4f2[_0x5a7d('0x34')](_0x5d459b)[_0x5a7d('0x35')](function(_0x2213ce){return _0x2213ce;});}return null;};}function removeEntity(_0x22e60d,_0x26a4d5){return function(_0x9b554){if(_0x9b554){return _0x9b554[_0x5a7d('0x36')]()['then'](function(){var _0x14cdc3=_0x9b554[_0x5a7d('0x37')]({'plain':!![]});var _0x14d8ec=_0x5a7d('0x38');return db[_0x5a7d('0x39')][_0x5a7d('0x36')]({'where':{'type':_0x14d8ec,'resourceId':_0x14cdc3['id']}})[_0x5a7d('0x35')](function(){return _0x9b554;});})[_0x5a7d('0x35')](function(){_0x22e60d[_0x5a7d('0x2b')](0xcc)[_0x5a7d('0x3a')]();});}};}function handleEntityNotFound(_0xec433,_0x5cfefc){return function(_0x2f527a){if(!_0x2f527a){_0xec433[_0x5a7d('0x2a')](0x194);}return _0x2f527a;};}function handleError(_0x244aca,_0x471191){_0x471191=_0x471191||0x1f4;return function(_0x4676bc){logger[_0x5a7d('0x27')](_0x4676bc[_0x5a7d('0x3b')]);if(_0x4676bc[_0x5a7d('0x3c')]){delete _0x4676bc[_0x5a7d('0x3c')];}_0x244aca[_0x5a7d('0x2b')](_0x471191)[_0x5a7d('0x3d')](_0x4676bc);};}exports[_0x5a7d('0x3e')]=function(_0x52c892,_0x1f4f40){var _0x4ce581={},_0x2143b8={},_0x50adfb={'count':0x0,'rows':[]};var _0x5cc181=_[_0x5a7d('0x3f')](db[_0x5a7d('0x40')][_0x5a7d('0x41')],function(_0x38575d){return{'name':_0x38575d[_0x5a7d('0x42')],'type':_0x38575d[_0x5a7d('0x43')][_0x5a7d('0x44')]};});_0x2143b8[_0x5a7d('0x45')]=_[_0x5a7d('0x3f')](_0x5cc181,_0x5a7d('0x3c'));_0x2143b8[_0x5a7d('0x46')]=_[_0x5a7d('0x47')](_0x52c892['query']);_0x2143b8[_0x5a7d('0x48')]=_[_0x5a7d('0x49')](_0x2143b8[_0x5a7d('0x45')],_0x2143b8['query']);_0x4ce581[_0x5a7d('0x4a')]=_[_0x5a7d('0x49')](_0x2143b8['model'],qs[_0x5a7d('0x4b')](_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x4b')]));_0x4ce581[_0x5a7d('0x4a')]=_0x4ce581[_0x5a7d('0x4a')][_0x5a7d('0x4c')]?_0x4ce581[_0x5a7d('0x4a')]:_0x2143b8['model'];if(!_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x4d')](_0x5a7d('0x4e'))){_0x4ce581[_0x5a7d('0x4f')]=qs[_0x5a7d('0x4f')](_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x4f')]);_0x4ce581[_0x5a7d('0x2d')]=qs[_0x5a7d('0x2d')](_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x2d')]);}_0x4ce581['order']=qs[_0x5a7d('0x50')](_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x50')]);_0x4ce581[_0x5a7d('0x51')]=qs[_0x5a7d('0x48')](_[_0x5a7d('0x52')](_0x52c892['query'],_0x2143b8['filters']),_0x5cc181);if(_0x52c892['query'][_0x5a7d('0x53')]){_0x4ce581[_0x5a7d('0x51')]=_['merge'](_0x4ce581['where'],{'$or':_[_0x5a7d('0x3f')](_0x5cc181,function(_0x3c027e){if(_0x3c027e[_0x5a7d('0x43')]!==_0x5a7d('0x54')){var _0x382213={};_0x382213[_0x3c027e['name']]={'$like':'%'+_0x52c892[_0x5a7d('0x46')][_0x5a7d('0x53')]+'%'};return _0x382213;}})});}_0x4ce581=_[_0x5a7d('0x55')]({},_0x4ce581,_0x52c892[_0x5a7d('0x56')]);var _0x2b029c={'where':_0x4ce581['where']};return db[_0x5a7d('0x40')][_0x5a7d('0x2e')](_0x2b029c)[_0x5a7d('0x35')](function(_0x3ed2d3){_0x50adfb['count']=_0x3ed2d3;if(_0x52c892[_0x5a7d('0x46')]['includeAll']){_0x4ce581['include']=[{'all':!![]}];}return db['ChatQueue'][_0x5a7d('0x57')](_0x4ce581);})[_0x5a7d('0x35')](function(_0xd7c118){_0x50adfb[_0x5a7d('0x58')]=_0xd7c118;return _0x50adfb;})[_0x5a7d('0x35')](respondWithFilteredResult(_0x1f4f40,_0x4ce581))[_0x5a7d('0x59')](handleError(_0x1f4f40,null));};exports[_0x5a7d('0x5a')]=function(_0x2d68ef,_0x5aeb51){var _0x2f5af7={'raw':!![],'where':{'id':_0x2d68ef[_0x5a7d('0x5b')]['id']}},_0x5ccea2={};_0x5ccea2[_0x5a7d('0x45')]=_[_0x5a7d('0x47')](db[_0x5a7d('0x40')][_0x5a7d('0x41')]);_0x5ccea2['query']=_[_0x5a7d('0x47')](_0x2d68ef[_0x5a7d('0x46')]);_0x5ccea2[_0x5a7d('0x48')]=_[_0x5a7d('0x49')](_0x5ccea2[_0x5a7d('0x45')],_0x5ccea2['query']);_0x2f5af7[_0x5a7d('0x4a')]=_[_0x5a7d('0x49')](_0x5ccea2[_0x5a7d('0x45')],qs['fields'](_0x2d68ef[_0x5a7d('0x46')][_0x5a7d('0x4b')]));_0x2f5af7['attributes']=_0x2f5af7[_0x5a7d('0x4a')][_0x5a7d('0x4c')]?_0x2f5af7['attributes']:_0x5ccea2[_0x5a7d('0x45')];if(_0x2d68ef[_0x5a7d('0x46')][_0x5a7d('0x5c')]){_0x2f5af7[_0x5a7d('0x5d')]=[{'all':!![]}];}_0x2f5af7=_[_0x5a7d('0x55')]({},_0x2f5af7,_0x2d68ef[_0x5a7d('0x56')]);return db[_0x5a7d('0x40')][_0x5a7d('0x5e')](_0x2f5af7)[_0x5a7d('0x35')](handleEntityNotFound(_0x5aeb51,null))[_0x5a7d('0x35')](respondWithResult(_0x5aeb51,null))[_0x5a7d('0x59')](handleError(_0x5aeb51,null));};exports['create']=function(_0xba2712,_0x1b410f){return db[_0x5a7d('0x40')]['create'](_0xba2712['body'],{})[_0x5a7d('0x35')](function(_0x28b9da){var _0x360b8f=_0xba2712[_0x5a7d('0x5f')][_0x5a7d('0x37')]({'plain':!![]});if(!_0x360b8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x360b8f['role']===_0x5a7d('0x5f')){var _0x74d134=_0x28b9da[_0x5a7d('0x37')]({'plain':!![]});var _0x3851ea=_0x5a7d('0x38');return db[_0x5a7d('0x60')][_0x5a7d('0x5e')]({'where':{'name':_0x3851ea,'userProfileId':_0x360b8f[_0x5a7d('0x61')]},'raw':!![]})['then'](function(_0x589f8d){if(_0x589f8d&&_0x589f8d[_0x5a7d('0x62')]===0x0){return db[_0x5a7d('0x39')][_0x5a7d('0x63')]({'name':_0x74d134[_0x5a7d('0x3c')],'resourceId':_0x74d134['id'],'type':_0x589f8d[_0x5a7d('0x3c')],'sectionId':_0x589f8d['id']},{})[_0x5a7d('0x35')](function(){return _0x28b9da;});}else{return _0x28b9da;}})['catch'](function(_0x2ec085){logger[_0x5a7d('0x27')](_0x5a7d('0x64'),_0x2ec085);throw _0x2ec085;});}return _0x28b9da;})['then'](respondWithResult(_0x1b410f,0xc9))[_0x5a7d('0x59')](handleError(_0x1b410f,null));};exports['update']=function(_0x1d2469,_0x411f8b){if(_0x1d2469['body']['id']){delete _0x1d2469['body']['id'];}return db[_0x5a7d('0x40')][_0x5a7d('0x5e')]({'where':{'id':_0x1d2469[_0x5a7d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x411f8b,null))[_0x5a7d('0x35')](saveUpdates(_0x1d2469[_0x5a7d('0x65')],null))['then'](respondWithResult(_0x411f8b,null))['catch'](handleError(_0x411f8b,null));};exports[_0x5a7d('0x36')]=function(_0x4134d1,_0x305dfa){return db[_0x5a7d('0x40')][_0x5a7d('0x5e')]({'where':{'id':_0x4134d1[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](handleEntityNotFound(_0x305dfa,null))['then'](removeEntity(_0x305dfa,null))[_0x5a7d('0x59')](handleError(_0x305dfa,null));};exports['describe']=function(_0x2431d2,_0x58ebff){return db[_0x5a7d('0x40')]['describe']()['then'](respondWithResult(_0x58ebff,null))[_0x5a7d('0x59')](handleError(_0x58ebff,null));};exports[_0x5a7d('0x66')]=function(_0x4c6d11,_0x19f719,_0x547acb){var _0x54d63a={'raw':!![],'where':{}},_0x335329={},_0x43e44d;return db[_0x5a7d('0x40')][_0x5a7d('0x67')]({'where':{'id':_0x4c6d11[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](handleEntityNotFound(_0x19f719,null))['then'](function(_0x94dbb8){if(_0x94dbb8){_0x43e44d=_0x94dbb8['get']({'plain':!![]});_0x335329['model']=_[_0x5a7d('0x47')](db[_0x5a7d('0x68')]['rawAttributes']);_0x335329[_0x5a7d('0x46')]=_[_0x5a7d('0x47')](_0x4c6d11[_0x5a7d('0x46')]);_0x335329['filters']=_[_0x5a7d('0x49')](_0x335329[_0x5a7d('0x45')],_0x335329[_0x5a7d('0x46')]);_0x54d63a[_0x5a7d('0x4a')]=_['intersection'](_0x335329['model'],qs[_0x5a7d('0x4b')](_0x4c6d11[_0x5a7d('0x46')][_0x5a7d('0x4b')]));_0x54d63a[_0x5a7d('0x4a')]=_0x54d63a[_0x5a7d('0x4a')][_0x5a7d('0x4c')]?_0x54d63a[_0x5a7d('0x4a')]:_0x335329['model'];if(!_0x4c6d11['query']['hasOwnProperty'](_0x5a7d('0x4e'))){_0x54d63a[_0x5a7d('0x4f')]=qs[_0x5a7d('0x4f')](_0x4c6d11[_0x5a7d('0x46')][_0x5a7d('0x4f')]);_0x54d63a[_0x5a7d('0x2d')]=qs['offset'](_0x4c6d11[_0x5a7d('0x46')][_0x5a7d('0x2d')]);}_0x54d63a['order']=qs[_0x5a7d('0x50')](_0x4c6d11['query']['sort']);_0x54d63a['where']=qs[_0x5a7d('0x48')](_[_0x5a7d('0x52')](_0x4c6d11[_0x5a7d('0x46')],_0x335329[_0x5a7d('0x48')]));_0x54d63a[_0x5a7d('0x51')][_0x5a7d('0x69')]=_0x94dbb8['id'];if(_0x4c6d11['query'][_0x5a7d('0x53')]){_0x54d63a['where']=_[_0x5a7d('0x55')](_0x54d63a[_0x5a7d('0x51')],{'$or':_[_0x5a7d('0x3f')](_0x54d63a['attributes'],function(_0x10f064){var _0xe53533={};_0xe53533[_0x10f064]={'$like':'%'+_0x4c6d11['query'][_0x5a7d('0x53')]+'%'};return _0xe53533;})});}_0x54d63a=_['merge']({},_0x54d63a,_0x4c6d11[_0x5a7d('0x56')]);return db[_0x5a7d('0x68')][_0x5a7d('0x57')](_0x54d63a);}})[_0x5a7d('0x35')](function(_0x401ff0){if(_0x401ff0){return db['User']['findAndCountAll']({'where':{'id':_[_0x5a7d('0x3f')](_0x401ff0,'UserId'),'role':_0x5a7d('0x6a')},'attributes':['id','name',_0x5a7d('0x6b'),_0x5a7d('0x6c'),_0x5a7d('0x6d')]});}})[_0x5a7d('0x35')](function(_0x179e70){if(_0x179e70){return{'count':_0x179e70[_0x5a7d('0x2e')],'rows':_['map'](_0x179e70[_0x5a7d('0x58')],function(_0x17fcef){return{'membername':_0x17fcef['name'],'UserId':_0x17fcef['id'],'queue_name':_0x43e44d[_0x5a7d('0x3c')],'ChatQueueId':_0x43e44d['id'],'interface':util[_0x5a7d('0x6e')](_0x5a7d('0x6f'),_0x5a7d('0x70'),_0x17fcef[_0x5a7d('0x3c')]),'penalty':0x0,'paused':_0x17fcef[_0x5a7d('0x6b')],'createdAt':_0x17fcef[_0x5a7d('0x6d')],'updatedAt':_0x17fcef[_0x5a7d('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5a7d('0x35')](respondWithFilteredResult(_0x19f719,_0x54d63a))[_0x5a7d('0x59')](handleError(_0x19f719,null));};exports[_0x5a7d('0x71')]=function(_0x166931,_0x538bf9,_0x3b1ed6){var _0x30fbeb={};var _0x4fc1d4={};var _0x47749e;var _0x3ad434;return db[_0x5a7d('0x40')][_0x5a7d('0x67')]({'where':{'id':_0x166931[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](handleEntityNotFound(_0x538bf9,null))[_0x5a7d('0x35')](function(_0x34231c){if(_0x34231c){_0x47749e=_0x34231c;_0x4fc1d4[_0x5a7d('0x45')]=_[_0x5a7d('0x47')](db['Team'][_0x5a7d('0x41')]);_0x4fc1d4[_0x5a7d('0x46')]=_['keys'](_0x166931[_0x5a7d('0x46')]);_0x4fc1d4['filters']=_[_0x5a7d('0x49')](_0x4fc1d4['model'],_0x4fc1d4[_0x5a7d('0x46')]);_0x30fbeb['attributes']=_[_0x5a7d('0x49')](_0x4fc1d4['model'],qs[_0x5a7d('0x4b')](_0x166931['query'][_0x5a7d('0x4b')]));_0x30fbeb[_0x5a7d('0x4a')]=_0x30fbeb[_0x5a7d('0x4a')]['length']?_0x30fbeb[_0x5a7d('0x4a')]:_0x4fc1d4[_0x5a7d('0x45')];_0x30fbeb[_0x5a7d('0x72')]=qs[_0x5a7d('0x50')](_0x166931['query']['sort']);_0x30fbeb[_0x5a7d('0x51')]=qs['filters'](_['pick'](_0x166931[_0x5a7d('0x46')],_0x4fc1d4[_0x5a7d('0x48')]));if(_0x166931[_0x5a7d('0x46')][_0x5a7d('0x53')]){_0x30fbeb[_0x5a7d('0x51')]=_[_0x5a7d('0x55')](_0x30fbeb[_0x5a7d('0x51')],{'$or':_['map'](_0x30fbeb[_0x5a7d('0x4a')],function(_0x84f54d){var _0x40c660={};_0x40c660[_0x84f54d]={'$like':'%'+_0x166931[_0x5a7d('0x46')]['filter']+'%'};return _0x40c660;})});}_0x30fbeb=_['merge']({},_0x30fbeb,_0x166931['options']);return _0x47749e[_0x5a7d('0x71')](_0x30fbeb);}})[_0x5a7d('0x35')](function(_0x7f782f){if(_0x7f782f){_0x3ad434=_0x7f782f[_0x5a7d('0x4c')];if(!_0x166931[_0x5a7d('0x46')][_0x5a7d('0x4d')]('nolimit')){_0x30fbeb[_0x5a7d('0x4f')]=qs[_0x5a7d('0x4f')](_0x166931['query']['limit']);_0x30fbeb[_0x5a7d('0x2d')]=qs[_0x5a7d('0x2d')](_0x166931[_0x5a7d('0x46')][_0x5a7d('0x2d')]);}return _0x47749e[_0x5a7d('0x71')](_0x30fbeb);}})[_0x5a7d('0x35')](function(_0x4f455f){if(_0x4f455f){return _0x4f455f?{'count':_0x3ad434,'rows':_0x4f455f}:null;}})['then'](respondWithResult(_0x538bf9,null))['catch'](handleError(_0x538bf9,null));};exports['addTeams']=function(_0x45f95a,_0x64685f,_0x2cd1bc){var _0x6c4ba6=_0x45f95a[_0x5a7d('0x65')]['ids'];return db[_0x5a7d('0x73')][_0x5a7d('0x57')]({'where':{'id':_0x6c4ba6},'attributes':['id'],'include':[{'model':db[_0x5a7d('0x74')],'as':_0x5a7d('0x75'),'attributes':['id',_0x5a7d('0x3c'),'online',_0x5a7d('0x76'),_0x5a7d('0x77')],'raw':!![]}]})['then'](function(_0x1c56e2){if(_0x1c56e2){var _0x39e660=_[_0x5a7d('0x78')](_0x1c56e2,function(_0x2a1574){var _0x5313b6=_0x2a1574[_0x5a7d('0x37')]({'plain':!![]});return _0x5313b6[_0x5a7d('0x75')];});return db['ChatQueue']['find']({'where':{'id':_0x45f95a['params']['id']}})['then'](function(_0x205b82){return db[_0x5a7d('0x79')][_0x5a7d('0x7a')](function(_0x1dfbaf){return _0x205b82[_0x5a7d('0x7b')](_0x6c4ba6,{'transaction':_0x1dfbaf})[_0x5a7d('0x35')](function(){return BPromise[_0x5a7d('0x7c')](_0x39e660,function(_0x3d2704){return db[_0x5a7d('0x68')][_0x5a7d('0x7d')]({'where':{'UserId':_0x3d2704['id'],'ChatQueueId':_0x45f95a[_0x5a7d('0x5b')]['id']},'transaction':_0x1dfbaf});});})[_0x5a7d('0x35')](function(){_0x39e660[_0x5a7d('0x7e')](function(_0x3e130f){socket[_0x5a7d('0x7f')](_0x5a7d('0x80'),{'UserId':_0x3e130f['id'],'ChatQueueId':_0x205b82['id']});});});});});}})[_0x5a7d('0x35')](respondWithStatusCode(_0x64685f,null))[_0x5a7d('0x59')](handleError(_0x64685f,null));};exports['removeTeams']=function(_0xc633d1,_0x1ba058,_0x388a2c){return db['Team'][_0x5a7d('0x57')]({'where':{'id':_0xc633d1[_0x5a7d('0x46')][_0x5a7d('0x81')]},'attributes':['id'],'include':[{'model':db[_0x5a7d('0x74')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5a7d('0x35')](handleEntityNotFound(_0x1ba058,null))[_0x5a7d('0x35')](function(_0x1f343a){var _0x4075c4=_[_0x5a7d('0x3f')](_0x1f343a,'id');var _0x3d43a5=[];var _0x3911fd=[];var _0x361493=squel[_0x5a7d('0x82')]();_0x361493[_0x5a7d('0x83')](_0x5a7d('0x84'))['from'](_0x5a7d('0x85'),'tq')['join'](_0x5a7d('0x86'),'ut',_0x5a7d('0x87'))['where'](_0x5a7d('0x88'),_0xc633d1[_0x5a7d('0x5b')]['id']);for(var _0x233fc4=0x0;_0x233fc4<_0x1f343a[_0x5a7d('0x4c')];_0x233fc4+=0x1){let _0xf79767=_0x1f343a[_0x233fc4];for(var _0x5e4eb6=0x0;_0x5e4eb6<_0xf79767['Agents'][_0x5a7d('0x4c')];_0x5e4eb6+=0x1){let _0x1cae9c=_0xf79767[_0x5a7d('0x75')][_0x5e4eb6];var _0x49f09f=_0x361493[_0x5a7d('0x89')]();_0x49f09f[_0x5a7d('0x51')](_0x5a7d('0x8a'),_0x1cae9c['id']);_0x3911fd['push'](db[_0x5a7d('0x79')][_0x5a7d('0x46')](_0x49f09f[_0x5a7d('0x8b')](),{'type':db[_0x5a7d('0x79')][_0x5a7d('0x8c')]['SELECT']})['then'](function(_0x2caca2){if(_0x2caca2[_0x5a7d('0x4c')]===0x1){return _0x1cae9c['id'];}else{var _0x12eccc=_[_0x5a7d('0x8d')](_[_0x5a7d('0x3f')](_0x2caca2,_0x5a7d('0x8e')),function(_0x1da3bb){return _[_0x5a7d('0x8f')](_0x4075c4,_0x1da3bb);});if(_0x12eccc){return _0x1cae9c['id'];}}}));}}return BPromise[_0x5a7d('0x90')](_0x3911fd)[_0x5a7d('0x35')](function(_0x478799){_0x3d43a5=_(_0x3d43a5)[_0x5a7d('0x91')](_0x478799)['compact']()[_0x5a7d('0x92')]();return db[_0x5a7d('0x40')]['find']({'where':{'id':_0xc633d1[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](function(_0x1d9755){return db['sequelize']['transaction'](function(_0x2d853e){return _0x1d9755[_0x5a7d('0x93')](_0xc633d1[_0x5a7d('0x46')][_0x5a7d('0x81')],{'transaction':_0x2d853e})['then'](function(){if(!_[_0x5a7d('0x94')](_0x3d43a5)){return _0x1d9755[_0x5a7d('0x95')](_0x3d43a5,{'transaction':_0x2d853e});}})[_0x5a7d('0x35')](function(){_0x3d43a5[_0x5a7d('0x7e')](function(_0x776e1f){socket[_0x5a7d('0x7f')]('userChatQueue:remove',{'UserId':_0x776e1f,'ChatQueueId':_0x1d9755['id']});});});});});});})[_0x5a7d('0x35')](respondWithStatusCode(_0x1ba058,null))[_0x5a7d('0x59')](handleError(_0x1ba058,null));};exports[_0x5a7d('0x96')]=function(_0x5b52e2,_0x4e3152,_0x266051){return db[_0x5a7d('0x40')][_0x5a7d('0x5e')]({'where':{'id':_0x5b52e2[_0x5a7d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4e3152,null))[_0x5a7d('0x35')](function(_0x4a7c57){if(_0x4a7c57){return _0x4a7c57[_0x5a7d('0x96')](_0x5b52e2['body'][_0x5a7d('0x81')],_[_0x5a7d('0x97')](_0x5b52e2[_0x5a7d('0x65')],[_0x5a7d('0x81'),'id'])||{})['spread'](function(_0x320ed7){for(var _0x288ed=0x0;_0x288ed<_0x5b52e2['body']['ids'][_0x5a7d('0x4c')];_0x288ed+=0x1){socket[_0x5a7d('0x7f')]('userChatQueue:save',{'UserId':Number(_0x5b52e2['body'][_0x5a7d('0x81')][_0x288ed]),'ChatQueueId':Number(_0x5b52e2[_0x5a7d('0x5b')]['id'])});}return _0x320ed7;});}})[_0x5a7d('0x35')](respondWithResult(_0x4e3152,null))[_0x5a7d('0x59')](handleError(_0x4e3152,null));};exports[_0x5a7d('0x95')]=function(_0x1ccd42,_0x331757,_0x14e90a){return db['ChatQueue'][_0x5a7d('0x5e')]({'where':{'id':_0x1ccd42[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](handleEntityNotFound(_0x331757,null))[_0x5a7d('0x35')](function(_0xc57c35){if(_0xc57c35){return _0xc57c35[_0x5a7d('0x95')](_0x1ccd42[_0x5a7d('0x46')]['ids'])[_0x5a7d('0x35')](function(){if(_[_0x5a7d('0x98')](_0x1ccd42[_0x5a7d('0x46')][_0x5a7d('0x81')])){for(var _0x4b25eb=0x0;_0x4b25eb<_0x1ccd42[_0x5a7d('0x46')][_0x5a7d('0x81')]['length'];_0x4b25eb+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x1ccd42['query'][_0x5a7d('0x81')][_0x4b25eb]),'ChatQueueId':Number(_0x1ccd42['params']['id'])});}}else{socket[_0x5a7d('0x7f')](_0x5a7d('0x99'),{'UserId':Number(_0x1ccd42[_0x5a7d('0x46')]['ids']),'ChatQueueId':Number(_0x1ccd42[_0x5a7d('0x5b')]['id'])});}});}})[_0x5a7d('0x35')](respondWithStatusCode(_0x331757,null))[_0x5a7d('0x59')](handleError(_0x331757,null));};exports[_0x5a7d('0x9a')]=function(_0x153988,_0x48cae6,_0x396c3e){var _0x5160e1={};var _0x42df2={};var _0x6ce241;var _0x138481;return db[_0x5a7d('0x40')][_0x5a7d('0x67')]({'where':{'id':_0x153988[_0x5a7d('0x5b')]['id']}})[_0x5a7d('0x35')](handleEntityNotFound(_0x48cae6,null))['then'](function(_0x38979a){if(_0x38979a){_0x6ce241=_0x38979a;_0x42df2[_0x5a7d('0x45')]=_[_0x5a7d('0x47')](db[_0x5a7d('0x74')]['rawAttributes']);_0x42df2[_0x5a7d('0x46')]=_[_0x5a7d('0x47')](_0x153988[_0x5a7d('0x46')]);_0x42df2[_0x5a7d('0x48')]=_[_0x5a7d('0x49')](_0x42df2[_0x5a7d('0x45')],_0x42df2['query']);_0x5160e1[_0x5a7d('0x4a')]=_['intersection'](_0x42df2[_0x5a7d('0x45')],qs['fields'](_0x153988[_0x5a7d('0x46')][_0x5a7d('0x4b')]));_0x5160e1[_0x5a7d('0x4a')]=_0x5160e1[_0x5a7d('0x4a')][_0x5a7d('0x4c')]?_0x5160e1[_0x5a7d('0x4a')]:_0x42df2[_0x5a7d('0x45')];_0x5160e1[_0x5a7d('0x72')]=qs[_0x5a7d('0x50')](_0x153988[_0x5a7d('0x46')][_0x5a7d('0x50')]);_0x5160e1['where']=qs[_0x5a7d('0x48')](_[_0x5a7d('0x52')](_0x153988[_0x5a7d('0x46')],_0x42df2[_0x5a7d('0x48')]));if(_0x153988[_0x5a7d('0x46')][_0x5a7d('0x53')]){_0x5160e1[_0x5a7d('0x51')]=_[_0x5a7d('0x55')](_0x5160e1['where'],{'$or':_[_0x5a7d('0x3f')](_0x5160e1['attributes'],function(_0x415c9f){var _0x1f12da={};_0x1f12da[_0x415c9f]={'$like':'%'+_0x153988[_0x5a7d('0x46')]['filter']+'%'};return _0x1f12da;})});}_0x5160e1=_[_0x5a7d('0x55')]({},_0x5160e1,_0x153988[_0x5a7d('0x56')]);return _0x6ce241[_0x5a7d('0x9a')](_0x5160e1);}})[_0x5a7d('0x35')](function(_0x2f7e61){if(_0x2f7e61){_0x138481=_0x2f7e61['length'];if(!_0x153988[_0x5a7d('0x46')][_0x5a7d('0x4d')](_0x5a7d('0x4e'))){_0x5160e1[_0x5a7d('0x4f')]=qs[_0x5a7d('0x4f')](_0x153988[_0x5a7d('0x46')][_0x5a7d('0x4f')]);_0x5160e1[_0x5a7d('0x2d')]=qs[_0x5a7d('0x2d')](_0x153988[_0x5a7d('0x46')][_0x5a7d('0x2d')]);}return _0x6ce241['getAgents'](_0x5160e1);}})[_0x5a7d('0x35')](function(_0x31e663){if(_0x31e663){return _0x31e663?{'count':_0x138481,'rows':_0x31e663}:null;}})[_0x5a7d('0x35')](respondWithResult(_0x48cae6,null))[_0x5a7d('0x59')](handleError(_0x48cae6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 960e503..9081c84 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 _0x8776=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0x8776,0x136));var _0x6877=function(_0x50caa0,_0x2431be){_0x50caa0=_0x50caa0-0x0;var _0x11b0c9=_0x8776[_0x50caa0];return _0x11b0c9;};'use strict';var EventEmitter=require(_0x6877('0x0'));var ChatQueue=require(_0x6877('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6877('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6877('0x3'),'afterDestroy':_0x6877('0x4')};function emitEvent(_0x56e779){return function(_0x1340f1,_0x1a878a,_0x51af65){ChatQueueEvents[_0x6877('0x5')](_0x56e779+':'+_0x1340f1['id'],_0x1340f1);ChatQueueEvents[_0x6877('0x5')](_0x56e779,_0x1340f1);_0x51af65(null);};}for(var e in events){if(events[_0x6877('0x6')](e)){var event=events[e];ChatQueue[_0x6877('0x7')](e,emitEvent(event));}}module[_0x6877('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x4f38=['update','remove','emit','exports','events','ChatQueue','setMaxListeners','save'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4f38,0x11c));var _0x84f3=function(_0x262384,_0x31a89a){_0x262384=_0x262384-0x0;var _0x516fe6=_0x4f38[_0x262384];return _0x516fe6;};'use strict';var EventEmitter=require(_0x84f3('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x84f3('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x84f3('0x2')](0x0);var events={'afterCreate':_0x84f3('0x3'),'afterUpdate':_0x84f3('0x4'),'afterDestroy':_0x84f3('0x5')};function emitEvent(_0x54f66a){return function(_0x3aa6bc,_0x101dfb,_0x4b8e02){ChatQueueEvents[_0x84f3('0x6')](_0x54f66a+':'+_0x3aa6bc['id'],_0x3aa6bc);ChatQueueEvents['emit'](_0x54f66a,_0x3aa6bc);_0x4b8e02(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x84f3('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f5c8ca2..7cdb9b5 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 _0xc3af=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x1dc4cb,_0x36ea79){var _0x53052e=function(_0x2e3d96){while(--_0x2e3d96){_0x1dc4cb['push'](_0x1dc4cb['shift']());}};_0x53052e(++_0x36ea79);}(_0xc3af,0x17b));var _0xfc3a=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0xc3af[_0x538c70];return _0x42ae01;};'use strict';var _=require('lodash');var util=require(_0xfc3a('0x0'));var logger=require(_0xfc3a('0x1'))(_0xfc3a('0x2'));var moment=require(_0xfc3a('0x3'));var BPromise=require(_0xfc3a('0x4'));var rp=require(_0xfc3a('0x5'));var fs=require('fs');var path=require(_0xfc3a('0x6'));var rimraf=require(_0xfc3a('0x7'));var config=require(_0xfc3a('0x8'));var attributes=require(_0xfc3a('0x9'));module['exports']=function(_0x2a5d49,_0xac7f1f){return _0x2a5d49[_0xfc3a('0xa')](_0xfc3a('0xb'),attributes,{'tableName':_0xfc3a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9e1=['moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x2329f3,_0x193f3d){var _0xe572b7=function(_0x4beee2){while(--_0x4beee2){_0x2329f3['push'](_0x2329f3['shift']());}};_0xe572b7(++_0x193f3d);}(_0xb9e1,0xcc));var _0x1b9e=function(_0x3be82b,_0x3ef4fb){_0x3be82b=_0x3be82b-0x0;var _0x293c0e=_0xb9e1[_0x3be82b];return _0x293c0e;};'use strict';var _=require(_0x1b9e('0x0'));var util=require(_0x1b9e('0x1'));var logger=require(_0x1b9e('0x2'))(_0x1b9e('0x3'));var moment=require(_0x1b9e('0x4'));var BPromise=require(_0x1b9e('0x5'));var rp=require(_0x1b9e('0x6'));var fs=require('fs');var path=require(_0x1b9e('0x7'));var rimraf=require('rimraf');var config=require(_0x1b9e('0x8'));var attributes=require(_0x1b9e('0x9'));module[_0x1b9e('0xa')]=function(_0x27f108,_0x5a3609){return _0x27f108['define'](_0x1b9e('0xb'),attributes,{'tableName':_0x1b9e('0xc'),'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 b487dd2..73274d2 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 _0xbbdd=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','catch','ShowChatQueue','find','where','util','bluebird','randomstring','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then'];(function(_0x370de9,_0x57af01){var _0x1a43ee=function(_0x6a9748){while(--_0x6a9748){_0x370de9['push'](_0x370de9['shift']());}};_0x1a43ee(++_0x57af01);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbbdd[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xdbbd('0x0'));var moment=require('moment');var BPromise=require(_0xdbbd('0x1'));var rs=require(_0xdbbd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbbd('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdbbd('0x4'));var client=jayson[_0xdbbd('0x5')][_0xdbbd('0x6')]({'port':0x232a});config[_0xdbbd('0x7')]=_['defaults'](config[_0xdbbd('0x7')],{'host':_0xdbbd('0x8'),'port':0x18eb});var socket=require(_0xdbbd('0x9'))(new Redis(config[_0xdbbd('0x7')]));require(_0xdbbd('0xa'))[_0xdbbd('0xb')](socket);function respondWithRpcPromise(_0xb6e63e,_0x1e451b,_0xb79629){return new BPromise(function(_0x11e656,_0x59c6af){return client[_0xdbbd('0xc')](_0xb6e63e,_0xb79629)[_0xdbbd('0xd')](function(_0x564f47){logger['info']('ChatQueue,\x20%s,\x20%s',_0x1e451b,'request\x20sent');logger[_0xdbbd('0xe')](_0xdbbd('0xf'),_0x1e451b,_0xdbbd('0x10'),JSON[_0xdbbd('0x11')](_0x564f47));if(_0x564f47[_0xdbbd('0x12')]){if(_0x564f47[_0xdbbd('0x12')][_0xdbbd('0x13')]===0x1f4){logger['error'](_0xdbbd('0x14'),_0x1e451b,_0x564f47[_0xdbbd('0x12')]['message']);return _0x59c6af(_0x564f47[_0xdbbd('0x12')][_0xdbbd('0x15')]);}logger[_0xdbbd('0x12')](_0xdbbd('0x14'),_0x1e451b,_0x564f47['error'][_0xdbbd('0x15')]);return _0x11e656(_0x564f47[_0xdbbd('0x12')]['message']);}else{logger[_0xdbbd('0x16')](_0xdbbd('0x14'),_0x1e451b,_0xdbbd('0x10'));_0x11e656(_0x564f47[_0xdbbd('0x17')][_0xdbbd('0x15')]);}})['catch'](function(_0x5b266a){logger['error'](_0xdbbd('0x14'),_0x1e451b,_0x5b266a);_0x59c6af(_0x5b266a);});});}exports[_0xdbbd('0x18')]=function(_0x16a0d0){var _0x452b83=this;return new Promise(function(_0x10aad4,_0x5bdddc){return db[_0xdbbd('0x19')][_0xdbbd('0x1a')]({'raw':_0x16a0d0[_0xdbbd('0x1b')]?_0x16a0d0[_0xdbbd('0x1b')][_0xdbbd('0x1c')]===undefined?!![]:![]:!![],'where':_0x16a0d0[_0xdbbd('0x1b')]?_0x16a0d0['options']['where']||null:null,'attributes':_0x16a0d0[_0xdbbd('0x1b')]?_0x16a0d0['options'][_0xdbbd('0x1d')]||null:null,'limit':_0x16a0d0[_0xdbbd('0x1b')]?_0x16a0d0[_0xdbbd('0x1b')][_0xdbbd('0x1e')]||null:null,'include':_0x16a0d0['options']?_0x16a0d0[_0xdbbd('0x1b')][_0xdbbd('0x1f')]?_[_0xdbbd('0x20')](_0x16a0d0['options'][_0xdbbd('0x1f')],function(_0x74f84c){return{'model':db[_0x74f84c[_0xdbbd('0x21')]],'as':_0x74f84c['as'],'attributes':_0x74f84c[_0xdbbd('0x1d')],'include':_0x74f84c[_0xdbbd('0x1f')]?_[_0xdbbd('0x20')](_0x74f84c['include'],function(_0xeaa316){return{'model':db[_0xeaa316[_0xdbbd('0x21')]],'as':_0xeaa316['as'],'attributes':_0xeaa316[_0xdbbd('0x1d')],'include':_0xeaa316[_0xdbbd('0x1f')]?_[_0xdbbd('0x20')](_0xeaa316[_0xdbbd('0x1f')],function(_0x22d6cc){return{'model':db[_0x22d6cc['model']],'as':_0x22d6cc['as'],'attributes':_0x22d6cc[_0xdbbd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb9383c){logger['info'](_0xdbbd('0x18'),_0x16a0d0);logger[_0xdbbd('0xe')]('GetChatQueue',_0x16a0d0,JSON[_0xdbbd('0x11')](_0xb9383c));_0x10aad4(_0xb9383c);})[_0xdbbd('0x22')](function(_0x107c08){logger[_0xdbbd('0x12')](_0xdbbd('0x18'),_0x107c08[_0xdbbd('0x15')],_0x16a0d0);_0x5bdddc(_0x452b83[_0xdbbd('0x12')](0x1f4,_0x107c08[_0xdbbd('0x15')]));});});};exports[_0xdbbd('0x23')]=function(_0x22411e){var _0x4a9618=this;return new Promise(function(_0x35e87a,_0x3c5d79){return db[_0xdbbd('0x19')][_0xdbbd('0x24')]({'raw':_0x22411e[_0xdbbd('0x1b')]?_0x22411e['options'][_0xdbbd('0x1c')]===undefined?!![]:![]:!![],'where':_0x22411e[_0xdbbd('0x1b')]?_0x22411e[_0xdbbd('0x1b')][_0xdbbd('0x25')]||null:null,'attributes':_0x22411e[_0xdbbd('0x1b')]?_0x22411e['options'][_0xdbbd('0x1d')]||null:null,'include':_0x22411e[_0xdbbd('0x1b')]?_0x22411e[_0xdbbd('0x1b')][_0xdbbd('0x1f')]?_[_0xdbbd('0x20')](_0x22411e['options'][_0xdbbd('0x1f')],function(_0x5e26bc){return{'model':db[_0x5e26bc[_0xdbbd('0x21')]],'as':_0x5e26bc['as'],'attributes':_0x5e26bc[_0xdbbd('0x1d')],'include':_0x5e26bc['include']?_[_0xdbbd('0x20')](_0x5e26bc[_0xdbbd('0x1f')],function(_0xb95dd8){return{'model':db[_0xb95dd8[_0xdbbd('0x21')]],'as':_0xb95dd8['as'],'attributes':_0xb95dd8['attributes'],'include':_0xb95dd8['include']?_[_0xdbbd('0x20')](_0xb95dd8[_0xdbbd('0x1f')],function(_0x2cb1af){return{'model':db[_0x2cb1af[_0xdbbd('0x21')]],'as':_0x2cb1af['as'],'attributes':_0x2cb1af[_0xdbbd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdbbd('0xd')](function(_0x55a526){logger['info'](_0xdbbd('0x23'),_0x22411e);logger[_0xdbbd('0xe')]('ShowChatQueue',_0x22411e,JSON[_0xdbbd('0x11')](_0x55a526));_0x35e87a(_0x55a526);})[_0xdbbd('0x22')](function(_0x55b71b){logger[_0xdbbd('0x12')](_0xdbbd('0x23'),_0x55b71b[_0xdbbd('0x15')],_0x22411e);_0x3c5d79(_0x4a9618['error'](0x1f4,_0x55b71b[_0xdbbd('0x15')]));});});}; \ No newline at end of file +var _0x1abc=['then','stringify','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','options','raw','where','attributes','limit','map','include','model'];(function(_0x47d267,_0x5ebbeb){var _0x1bef7a=function(_0x2bcd3a){while(--_0x2bcd3a){_0x47d267['push'](_0x47d267['shift']());}};_0x1bef7a(++_0x5ebbeb);}(_0x1abc,0x107));var _0xc1ab=function(_0x20889a,_0x2fd6a6){_0x20889a=_0x20889a-0x0;var _0x1c515e=_0x1abc[_0x20889a];return _0x1c515e;};'use strict';var _=require(_0xc1ab('0x0'));var util=require(_0xc1ab('0x1'));var moment=require(_0xc1ab('0x2'));var BPromise=require('bluebird');var rs=require(_0xc1ab('0x3'));var fs=require('fs');var Redis=require(_0xc1ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1ab('0x5'));var logger=require(_0xc1ab('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc1ab('0x7'));var client=jayson[_0xc1ab('0x8')][_0xc1ab('0x9')]({'port':0x232a});config[_0xc1ab('0xa')]=_[_0xc1ab('0xb')](config[_0xc1ab('0xa')],{'host':_0xc1ab('0xc'),'port':0x18eb});var socket=require(_0xc1ab('0xd'))(new Redis(config[_0xc1ab('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1568ec,_0x5e7da4,_0x82f8a6){return new BPromise(function(_0x490e33,_0x4ec759){return client[_0xc1ab('0xe')](_0x1568ec,_0x82f8a6)['then'](function(_0x1098dd){logger[_0xc1ab('0xf')]('ChatQueue,\x20%s,\x20%s',_0x5e7da4,_0xc1ab('0x10'));logger[_0xc1ab('0x11')](_0xc1ab('0x12'),_0x5e7da4,'request\x20sent',JSON['stringify'](_0x1098dd));if(_0x1098dd['error']){if(_0x1098dd[_0xc1ab('0x13')][_0xc1ab('0x14')]===0x1f4){logger['error'](_0xc1ab('0x15'),_0x5e7da4,_0x1098dd[_0xc1ab('0x13')][_0xc1ab('0x16')]);return _0x4ec759(_0x1098dd[_0xc1ab('0x13')][_0xc1ab('0x16')]);}logger[_0xc1ab('0x13')](_0xc1ab('0x15'),_0x5e7da4,_0x1098dd['error'][_0xc1ab('0x16')]);return _0x490e33(_0x1098dd[_0xc1ab('0x13')][_0xc1ab('0x16')]);}else{logger[_0xc1ab('0xf')]('ChatQueue,\x20%s,\x20%s',_0x5e7da4,'request\x20sent');_0x490e33(_0x1098dd['result'][_0xc1ab('0x16')]);}})[_0xc1ab('0x17')](function(_0x220dca){logger[_0xc1ab('0x13')](_0xc1ab('0x15'),_0x5e7da4,_0x220dca);_0x4ec759(_0x220dca);});});}exports[_0xc1ab('0x18')]=function(_0x1fe96b){var _0x4b5f19=this;return new Promise(function(_0x19e0b7,_0x14cba2){return db['ChatQueue']['findAll']({'raw':_0x1fe96b[_0xc1ab('0x19')]?_0x1fe96b[_0xc1ab('0x19')][_0xc1ab('0x1a')]===undefined?!![]:![]:!![],'where':_0x1fe96b[_0xc1ab('0x19')]?_0x1fe96b[_0xc1ab('0x19')][_0xc1ab('0x1b')]||null:null,'attributes':_0x1fe96b['options']?_0x1fe96b[_0xc1ab('0x19')][_0xc1ab('0x1c')]||null:null,'limit':_0x1fe96b['options']?_0x1fe96b['options'][_0xc1ab('0x1d')]||null:null,'include':_0x1fe96b[_0xc1ab('0x19')]?_0x1fe96b[_0xc1ab('0x19')]['include']?_[_0xc1ab('0x1e')](_0x1fe96b[_0xc1ab('0x19')][_0xc1ab('0x1f')],function(_0x200dca){return{'model':db[_0x200dca[_0xc1ab('0x20')]],'as':_0x200dca['as'],'attributes':_0x200dca[_0xc1ab('0x1c')],'include':_0x200dca[_0xc1ab('0x1f')]?_[_0xc1ab('0x1e')](_0x200dca[_0xc1ab('0x1f')],function(_0x1faf82){return{'model':db[_0x1faf82[_0xc1ab('0x20')]],'as':_0x1faf82['as'],'attributes':_0x1faf82[_0xc1ab('0x1c')],'include':_0x1faf82[_0xc1ab('0x1f')]?_[_0xc1ab('0x1e')](_0x1faf82[_0xc1ab('0x1f')],function(_0x514278){return{'model':db[_0x514278[_0xc1ab('0x20')]],'as':_0x514278['as'],'attributes':_0x514278[_0xc1ab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc1ab('0x21')](function(_0x4236fc){logger[_0xc1ab('0xf')](_0xc1ab('0x18'),_0x1fe96b);logger['debug']('GetChatQueue',_0x1fe96b,JSON[_0xc1ab('0x22')](_0x4236fc));_0x19e0b7(_0x4236fc);})[_0xc1ab('0x17')](function(_0x21ce61){logger[_0xc1ab('0x13')](_0xc1ab('0x18'),_0x21ce61[_0xc1ab('0x16')],_0x1fe96b);_0x14cba2(_0x4b5f19['error'](0x1f4,_0x21ce61[_0xc1ab('0x16')]));});});};exports[_0xc1ab('0x23')]=function(_0xb922dc){var _0x269db4=this;return new Promise(function(_0x527fb1,_0x1f1fac){return db['ChatQueue'][_0xc1ab('0x24')]({'raw':_0xb922dc[_0xc1ab('0x19')]?_0xb922dc[_0xc1ab('0x19')][_0xc1ab('0x1a')]===undefined?!![]:![]:!![],'where':_0xb922dc[_0xc1ab('0x19')]?_0xb922dc['options'][_0xc1ab('0x1b')]||null:null,'attributes':_0xb922dc['options']?_0xb922dc[_0xc1ab('0x19')][_0xc1ab('0x1c')]||null:null,'include':_0xb922dc[_0xc1ab('0x19')]?_0xb922dc[_0xc1ab('0x19')][_0xc1ab('0x1f')]?_['map'](_0xb922dc[_0xc1ab('0x19')][_0xc1ab('0x1f')],function(_0x59b39d){return{'model':db[_0x59b39d[_0xc1ab('0x20')]],'as':_0x59b39d['as'],'attributes':_0x59b39d[_0xc1ab('0x1c')],'include':_0x59b39d['include']?_[_0xc1ab('0x1e')](_0x59b39d['include'],function(_0x8b8b22){return{'model':db[_0x8b8b22[_0xc1ab('0x20')]],'as':_0x8b8b22['as'],'attributes':_0x8b8b22[_0xc1ab('0x1c')],'include':_0x8b8b22[_0xc1ab('0x1f')]?_['map'](_0x8b8b22[_0xc1ab('0x1f')],function(_0xcf19da){return{'model':db[_0xcf19da[_0xc1ab('0x20')]],'as':_0xcf19da['as'],'attributes':_0xcf19da[_0xc1ab('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc1ab('0x21')](function(_0x79f17a){logger[_0xc1ab('0xf')](_0xc1ab('0x23'),_0xb922dc);logger[_0xc1ab('0x11')](_0xc1ab('0x23'),_0xb922dc,JSON[_0xc1ab('0x22')](_0x79f17a));_0x527fb1(_0x79f17a);})['catch'](function(_0x13da7f){logger[_0xc1ab('0x13')](_0xc1ab('0x23'),_0x13da7f['message'],_0xb922dc);_0x1f1fac(_0x269db4[_0xc1ab('0x13')](0x1f4,_0x13da7f[_0xc1ab('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e826f22..e723353 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 _0xb4e6=['removeListener','register','./chatQueue.events','remove','update','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xb4e6[_0x1b64dd];return _0xeb464c;};'use strict';var ChatQueueEvents=require(_0x6b4e('0x0'));var events=['save',_0x6b4e('0x1'),_0x6b4e('0x2')];function createListener(_0x365912,_0x25ffcb){return function(_0x44e781){_0x25ffcb[_0x6b4e('0x3')](_0x365912,_0x44e781);};}function removeListener(_0x1929b8,_0x52313b){return function(){ChatQueueEvents[_0x6b4e('0x4')](_0x1929b8,_0x52313b);};}exports[_0x6b4e('0x5')]=function(_0x1f67a2){for(var _0x49de51=0x0,_0xd3138f=events['length'];_0x49de51<_0xd3138f;_0x49de51++){var _0x4f00be=events[_0x49de51];var _0x2311d9=createListener('chatQueue:'+_0x4f00be,_0x1f67a2);ChatQueueEvents['on'](_0x4f00be,_0x2311d9);}}; \ No newline at end of file +var _0x2d17=['update','emit','register','chatQueue:','./chatQueue.events','save'];(function(_0x39ebfe,_0x1748f7){var _0x3a79df=function(_0x9c89cf){while(--_0x9c89cf){_0x39ebfe['push'](_0x39ebfe['shift']());}};_0x3a79df(++_0x1748f7);}(_0x2d17,0x17e));var _0x72d1=function(_0x55e595,_0x4bcbab){_0x55e595=_0x55e595-0x0;var _0x339a4b=_0x2d17[_0x55e595];return _0x339a4b;};'use strict';var ChatQueueEvents=require(_0x72d1('0x0'));var events=[_0x72d1('0x1'),'remove',_0x72d1('0x2')];function createListener(_0x4727f9,_0x531f4e){return function(_0x3687bc){_0x531f4e[_0x72d1('0x3')](_0x4727f9,_0x3687bc);};}function removeListener(_0x55b722,_0x1dd6d8){return function(){ChatQueueEvents['removeListener'](_0x55b722,_0x1dd6d8);};}exports[_0x72d1('0x4')]=function(_0x50f551){for(var _0x139ba0=0x0,_0x239d1f=events['length'];_0x139ba0<_0x239d1f;_0x139ba0++){var _0x477264=events[_0x139ba0];var _0x422f5a=createListener(_0x72d1('0x5')+_0x477264,_0x50f551);ChatQueueEvents['on'](_0x477264,_0x422f5a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 72b77d8..6412775 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x5835c8,_0x558720){var _0x46ab91=function(_0x9b79bc){while(--_0x9b79bc){_0x5835c8['push'](_0x5835c8['shift']());}};_0x46ab91(++_0x558720);}(_0x55ca,0x126));var _0xa55c=function(_0x160cd5,_0x19c58e){_0x160cd5=_0x160cd5-0x0;var _0x366763=_0x55ca[_0x160cd5];return _0x366763;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x2c96c0,_0x490d48){var _0x30c3a9=function(_0x45c563){while(--_0x45c563){_0x2c96c0['push'](_0x2c96c0['shift']());}};_0x30c3a9(++_0x490d48);}(_0x55ca,0x126));var _0xa55c=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x55ca[_0x15d18f];return _0xd12bf7;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index fcca0e6..d7adb49 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 _0x8f1e=['STRING','DATE','moment','sequelize'];(function(_0x5be89a,_0x2ffb4d){var _0x227621=function(_0x30caef){while(--_0x30caef){_0x5be89a['push'](_0x5be89a['shift']());}};_0x227621(++_0x2ffb4d);}(_0x8f1e,0xc2));var _0xe8f1=function(_0x12dfcb,_0xadf711){_0x12dfcb=_0x12dfcb-0x0;var _0x44e38d=_0x8f1e[_0x12dfcb];return _0x44e38d;};'use strict';var moment=require(_0xe8f1('0x0'));var Sequelize=require(_0xe8f1('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe8f1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe8f1('0x2')]},'joinAt':{'type':Sequelize[_0xe8f1('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe8f1('0x3')]},'exitAt':{'type':Sequelize[_0xe8f1('0x3')]},'reason':{'type':Sequelize[_0xe8f1('0x2')]}}; \ No newline at end of file +var _0x904c=['STRING','DATE','moment','sequelize','exports'];(function(_0x32f5ba,_0x2e66bf){var _0x2521a5=function(_0x411e93){while(--_0x411e93){_0x32f5ba['push'](_0x32f5ba['shift']());}};_0x2521a5(++_0x2e66bf);}(_0x904c,0xd9));var _0xc904=function(_0x37d268,_0x372782){_0x37d268=_0x37d268-0x0;var _0x19c77c=_0x904c[_0x37d268];return _0x19c77c;};'use strict';var moment=require(_0xc904('0x0'));var Sequelize=require(_0xc904('0x1'));module[_0xc904('0x2')]={'uniqueid':{'type':Sequelize[_0xc904('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc904('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc904('0x4')]},'exitAt':{'type':Sequelize[_0xc904('0x4')]},'reason':{'type':Sequelize[_0xc904('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 8a4ad6f..6971de6 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 _0xe451=['count','update','then','destroy','sendStatus','error','name','send','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit'];(function(_0x34049f,_0xec089){var _0x372ce1=function(_0x2ab598){while(--_0x2ab598){_0x34049f['push'](_0x34049f['shift']());}};_0x372ce1(++_0xec089);}(_0xe451,0xec));var _0x1e45=function(_0x3a9e5d,_0x251378){_0x3a9e5d=_0x3a9e5d-0x0;var _0x35c9f0=_0xe451[_0x3a9e5d];return _0x35c9f0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1e45('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1e45('0x1'));var Mustache=require(_0x1e45('0x2'));var util=require(_0x1e45('0x3'));var path=require(_0x1e45('0x4'));var sox=require('sox');var csv=require(_0x1e45('0x5'));var ejs=require(_0x1e45('0x6'));var fs=require('fs');var fs_extra=require(_0x1e45('0x7'));var _=require('lodash');var squel=require(_0x1e45('0x8'));var crypto=require(_0x1e45('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1e45('0x5'));var querystring=require(_0x1e45('0xa'));var Papa=require(_0x1e45('0xb'));var Redis=require('ioredis');var authService=require(_0x1e45('0xc'));var qs=require(_0x1e45('0xd'));var as=require(_0x1e45('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1e45('0xf'));var utils=require(_0x1e45('0x10'));var config=require(_0x1e45('0x11'));var licenseUtil=require(_0x1e45('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16cafc,_0x2ec564){_0x2ec564=_0x2ec564||0xcc;return function(_0x3d25a8){if(_0x3d25a8){return _0x16cafc['sendStatus'](_0x2ec564);}return _0x16cafc[_0x1e45('0x13')](_0x2ec564)[_0x1e45('0x14')]();};}function respondWithResult(_0x31215a,_0x21f68d){_0x21f68d=_0x21f68d||0xc8;return function(_0x5b3ee1){if(_0x5b3ee1){return _0x31215a[_0x1e45('0x13')](_0x21f68d)['json'](_0x5b3ee1);}};}function respondWithFilteredResult(_0xf66042,_0x2c7ace){return function(_0x4e1400){if(_0x4e1400){var _0xfdeae3=typeof _0x2c7ace[_0x1e45('0x15')]===_0x1e45('0x16')&&typeof _0x2c7ace[_0x1e45('0x17')]===_0x1e45('0x16');var _0x308c29=_0x4e1400[_0x1e45('0x18')];var _0x2a6f47=_0xfdeae3?0x0:_0x2c7ace[_0x1e45('0x15')];var _0x5d24a7=_0xfdeae3?_0x4e1400[_0x1e45('0x18')]:_0x2c7ace['offset']+_0x2c7ace['limit'];var _0x17c63a;if(_0x5d24a7>=_0x308c29){_0x5d24a7=_0x308c29;_0x17c63a=0xc8;}else{_0x17c63a=0xce;}_0xf66042['status'](_0x17c63a);return _0xf66042['set']('Content-Range',_0x2a6f47+'-'+_0x5d24a7+'/'+_0x308c29)['json'](_0x4e1400);}return null;};}function patchUpdates(_0x207335){return function(_0x4476eb){try{jsonpatch['apply'](_0x4476eb,_0x207335,!![]);}catch(_0xc0deec){return BPromise['reject'](_0xc0deec);}return _0x4476eb['save']();};}function saveUpdates(_0x41cfae,_0x59aaa7){return function(_0x4ffe97){if(_0x4ffe97){return _0x4ffe97[_0x1e45('0x19')](_0x41cfae)[_0x1e45('0x1a')](function(_0x4ce4c5){return _0x4ce4c5;});}return null;};}function removeEntity(_0x48209a,_0x2fb478){return function(_0x40c216){if(_0x40c216){return _0x40c216[_0x1e45('0x1b')]()[_0x1e45('0x1a')](function(){_0x48209a[_0x1e45('0x13')](0xcc)[_0x1e45('0x14')]();});}};}function handleEntityNotFound(_0x55e968,_0x3f6771){return function(_0x394f7e){if(!_0x394f7e){_0x55e968[_0x1e45('0x1c')](0x194);}return _0x394f7e;};}function handleError(_0x25b131,_0x1a8355){_0x1a8355=_0x1a8355||0x1f4;return function(_0xfd7633){logger[_0x1e45('0x1d')](_0xfd7633['stack']);if(_0xfd7633[_0x1e45('0x1e')]){delete _0xfd7633[_0x1e45('0x1e')];}_0x25b131[_0x1e45('0x13')](_0x1a8355)[_0x1e45('0x1f')](_0xfd7633);};}exports['index']=function(_0xe7cdcf,_0x34046e){var _0x3dd6c3={},_0x5229e7={},_0x3def67={'count':0x0,'rows':[]};var _0x4a04aa=_[_0x1e45('0x20')](db['ChatQueueReport']['rawAttributes'],function(_0x34d75e){return{'name':_0x34d75e[_0x1e45('0x21')],'type':_0x34d75e[_0x1e45('0x22')][_0x1e45('0x23')]};});_0x5229e7['model']=_[_0x1e45('0x20')](_0x4a04aa,'name');_0x5229e7[_0x1e45('0x24')]=_[_0x1e45('0x25')](_0xe7cdcf[_0x1e45('0x24')]);_0x5229e7['filters']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],_0x5229e7[_0x1e45('0x24')]);_0x3dd6c3['attributes']=_[_0x1e45('0x26')](_0x5229e7[_0x1e45('0x27')],qs[_0x1e45('0x28')](_0xe7cdcf[_0x1e45('0x24')]['fields']));_0x3dd6c3[_0x1e45('0x29')]=_0x3dd6c3[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x3dd6c3[_0x1e45('0x29')]:_0x5229e7[_0x1e45('0x27')];if(!_0xe7cdcf['query']['hasOwnProperty']('nolimit')){_0x3dd6c3['limit']=qs[_0x1e45('0x17')](_0xe7cdcf['query'][_0x1e45('0x17')]);_0x3dd6c3[_0x1e45('0x15')]=qs['offset'](_0xe7cdcf['query'][_0x1e45('0x15')]);}_0x3dd6c3[_0x1e45('0x2b')]=qs[_0x1e45('0x2c')](_0xe7cdcf[_0x1e45('0x24')]['sort']);_0x3dd6c3[_0x1e45('0x2d')]=qs[_0x1e45('0x2e')](_[_0x1e45('0x2f')](_0xe7cdcf[_0x1e45('0x24')],_0x5229e7['filters']),_0x4a04aa);if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]){_0x3dd6c3[_0x1e45('0x2d')]=_['merge'](_0x3dd6c3['where'],{'$or':_[_0x1e45('0x20')](_0x4a04aa,function(_0x47c200){if(_0x47c200['type']!==_0x1e45('0x31')){var _0x587a0a={};_0x587a0a[_0x47c200['name']]={'$like':'%'+_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x30')]+'%'};return _0x587a0a;}})});}_0x3dd6c3=_[_0x1e45('0x32')]({},_0x3dd6c3,_0xe7cdcf[_0x1e45('0x33')]);var _0x11a327={'where':_0x3dd6c3[_0x1e45('0x2d')]};return db[_0x1e45('0x34')][_0x1e45('0x18')](_0x11a327)[_0x1e45('0x1a')](function(_0x53713a){_0x3def67[_0x1e45('0x18')]=_0x53713a;if(_0xe7cdcf[_0x1e45('0x24')][_0x1e45('0x35')]){_0x3dd6c3[_0x1e45('0x36')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1e45('0x37')](_0x3dd6c3);})[_0x1e45('0x1a')](function(_0x2984ae){_0x3def67[_0x1e45('0x38')]=_0x2984ae;return _0x3def67;})['then'](respondWithFilteredResult(_0x34046e,_0x3dd6c3))[_0x1e45('0x39')](handleError(_0x34046e,null));};exports[_0x1e45('0x3a')]=function(_0x32a42a,_0x393a50){var _0x522b40={'raw':!![],'where':{'id':_0x32a42a[_0x1e45('0x3b')]['id']}},_0x460d38={};_0x460d38[_0x1e45('0x27')]=_[_0x1e45('0x25')](db[_0x1e45('0x34')][_0x1e45('0x3c')]);_0x460d38['query']=_[_0x1e45('0x25')](_0x32a42a['query']);_0x460d38[_0x1e45('0x2e')]=_[_0x1e45('0x26')](_0x460d38[_0x1e45('0x27')],_0x460d38[_0x1e45('0x24')]);_0x522b40[_0x1e45('0x29')]=_[_0x1e45('0x26')](_0x460d38['model'],qs[_0x1e45('0x28')](_0x32a42a[_0x1e45('0x24')][_0x1e45('0x28')]));_0x522b40['attributes']=_0x522b40[_0x1e45('0x29')][_0x1e45('0x2a')]?_0x522b40[_0x1e45('0x29')]:_0x460d38['model'];if(_0x32a42a['query']['includeAll']){_0x522b40[_0x1e45('0x36')]=[{'all':!![]}];}_0x522b40=_[_0x1e45('0x32')]({},_0x522b40,_0x32a42a[_0x1e45('0x33')]);return db[_0x1e45('0x34')]['find'](_0x522b40)[_0x1e45('0x1a')](handleEntityNotFound(_0x393a50,null))[_0x1e45('0x1a')](respondWithResult(_0x393a50,null))[_0x1e45('0x39')](handleError(_0x393a50,null));};exports[_0x1e45('0x3d')]=function(_0x3994d8,_0x53e41b){return db[_0x1e45('0x34')][_0x1e45('0x3d')](_0x3994d8[_0x1e45('0x3e')],{})[_0x1e45('0x1a')](respondWithResult(_0x53e41b,0xc9))[_0x1e45('0x39')](handleError(_0x53e41b,null));};exports['update']=function(_0x374c32,_0x14b06f){if(_0x374c32[_0x1e45('0x3e')]['id']){delete _0x374c32[_0x1e45('0x3e')]['id'];}return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x374c32['params']['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x14b06f,null))[_0x1e45('0x1a')](saveUpdates(_0x374c32['body'],null))[_0x1e45('0x1a')](respondWithResult(_0x14b06f,null))['catch'](handleError(_0x14b06f,null));};exports[_0x1e45('0x1b')]=function(_0x3e6845,_0x5bafc7){return db[_0x1e45('0x34')][_0x1e45('0x3f')]({'where':{'id':_0x3e6845[_0x1e45('0x3b')]['id']}})[_0x1e45('0x1a')](handleEntityNotFound(_0x5bafc7,null))[_0x1e45('0x1a')](removeEntity(_0x5bafc7,null))[_0x1e45('0x39')](handleError(_0x5bafc7,null));};exports[_0x1e45('0x40')]=function(_0x4cdf47,_0x2f19f3){return db[_0x1e45('0x34')]['describe']()['then'](respondWithResult(_0x2f19f3,null))[_0x1e45('0x39')](handleError(_0x2f19f3,null));}; \ No newline at end of file +var _0xa93a=['end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','filters','intersection','fields','query','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','keys','include','options','find','create','body','describe','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa93a,0xb8));var _0xaa93=function(_0x4cd037,_0x54d2d4){_0x4cd037=_0x4cd037-0x0;var _0x2cf9f3=_0xa93a[_0x4cd037];return _0x2cf9f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa93('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa93('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xaa93('0x2'));var util=require('util');var path=require(_0xaa93('0x3'));var sox=require(_0xaa93('0x4'));var csv=require(_0xaa93('0x5'));var ejs=require(_0xaa93('0x6'));var fs=require('fs');var fs_extra=require(_0xaa93('0x7'));var _=require('lodash');var squel=require(_0xaa93('0x8'));var crypto=require(_0xaa93('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xaa93('0xa'));var toCsv=require('to-csv');var querystring=require(_0xaa93('0xb'));var Papa=require(_0xaa93('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa93('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa93('0xe'))(_0xaa93('0xf'));var utils=require(_0xaa93('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa93('0x11'))['db'];function respondWithStatusCode(_0x52fba9,_0x96fabf){_0x96fabf=_0x96fabf||0xcc;return function(_0x55f5dc){if(_0x55f5dc){return _0x52fba9[_0xaa93('0x12')](_0x96fabf);}return _0x52fba9[_0xaa93('0x13')](_0x96fabf)[_0xaa93('0x14')]();};}function respondWithResult(_0x2418e3,_0x3f9df4){_0x3f9df4=_0x3f9df4||0xc8;return function(_0x580151){if(_0x580151){return _0x2418e3[_0xaa93('0x13')](_0x3f9df4)['json'](_0x580151);}};}function respondWithFilteredResult(_0x2df8c8,_0xfcb352){return function(_0x59d73c){if(_0x59d73c){var _0x543a57=typeof _0xfcb352[_0xaa93('0x15')]===_0xaa93('0x16')&&typeof _0xfcb352[_0xaa93('0x17')]===_0xaa93('0x16');var _0x1f6d57=_0x59d73c[_0xaa93('0x18')];var _0x29f90a=_0x543a57?0x0:_0xfcb352[_0xaa93('0x15')];var _0x542a56=_0x543a57?_0x59d73c['count']:_0xfcb352[_0xaa93('0x15')]+_0xfcb352[_0xaa93('0x17')];var _0xae316;if(_0x542a56>=_0x1f6d57){_0x542a56=_0x1f6d57;_0xae316=0xc8;}else{_0xae316=0xce;}_0x2df8c8['status'](_0xae316);return _0x2df8c8[_0xaa93('0x19')](_0xaa93('0x1a'),_0x29f90a+'-'+_0x542a56+'/'+_0x1f6d57)['json'](_0x59d73c);}return null;};}function patchUpdates(_0x3df2f4){return function(_0x4cae27){try{jsonpatch[_0xaa93('0x1b')](_0x4cae27,_0x3df2f4,!![]);}catch(_0x5b7735){return BPromise[_0xaa93('0x1c')](_0x5b7735);}return _0x4cae27[_0xaa93('0x1d')]();};}function saveUpdates(_0x4d6a45,_0x9e28ff){return function(_0x4cd72b){if(_0x4cd72b){return _0x4cd72b[_0xaa93('0x1e')](_0x4d6a45)[_0xaa93('0x1f')](function(_0x4be9e1){return _0x4be9e1;});}return null;};}function removeEntity(_0x4fc233,_0x2a1683){return function(_0x6eb19e){if(_0x6eb19e){return _0x6eb19e[_0xaa93('0x20')]()['then'](function(){_0x4fc233['status'](0xcc)[_0xaa93('0x14')]();});}};}function handleEntityNotFound(_0x51a0de,_0x2b3d76){return function(_0x1e7e97){if(!_0x1e7e97){_0x51a0de[_0xaa93('0x12')](0x194);}return _0x1e7e97;};}function handleError(_0x584059,_0x2c2e8f){_0x2c2e8f=_0x2c2e8f||0x1f4;return function(_0x17e2e6){logger[_0xaa93('0x21')](_0x17e2e6[_0xaa93('0x22')]);if(_0x17e2e6['name']){delete _0x17e2e6[_0xaa93('0x23')];}_0x584059['status'](_0x2c2e8f)['send'](_0x17e2e6);};}exports['index']=function(_0x535a92,_0x3b7b4c){var _0x76cd82={},_0x46c3ae={},_0xc7028d={'count':0x0,'rows':[]};var _0x515d55=_[_0xaa93('0x24')](db[_0xaa93('0x25')][_0xaa93('0x26')],function(_0x185059){return{'name':_0x185059[_0xaa93('0x27')],'type':_0x185059[_0xaa93('0x28')][_0xaa93('0x29')]};});_0x46c3ae[_0xaa93('0x2a')]=_[_0xaa93('0x24')](_0x515d55,_0xaa93('0x23'));_0x46c3ae['query']=_['keys'](_0x535a92['query']);_0x46c3ae[_0xaa93('0x2b')]=_[_0xaa93('0x2c')](_0x46c3ae[_0xaa93('0x2a')],_0x46c3ae['query']);_0x76cd82['attributes']=_[_0xaa93('0x2c')](_0x46c3ae['model'],qs[_0xaa93('0x2d')](_0x535a92[_0xaa93('0x2e')][_0xaa93('0x2d')]));_0x76cd82[_0xaa93('0x2f')]=_0x76cd82['attributes'][_0xaa93('0x30')]?_0x76cd82[_0xaa93('0x2f')]:_0x46c3ae[_0xaa93('0x2a')];if(!_0x535a92[_0xaa93('0x2e')][_0xaa93('0x31')]('nolimit')){_0x76cd82[_0xaa93('0x17')]=qs['limit'](_0x535a92[_0xaa93('0x2e')][_0xaa93('0x17')]);_0x76cd82[_0xaa93('0x15')]=qs[_0xaa93('0x15')](_0x535a92[_0xaa93('0x2e')][_0xaa93('0x15')]);}_0x76cd82['order']=qs['sort'](_0x535a92['query'][_0xaa93('0x32')]);_0x76cd82['where']=qs[_0xaa93('0x2b')](_[_0xaa93('0x33')](_0x535a92['query'],_0x46c3ae[_0xaa93('0x2b')]),_0x515d55);if(_0x535a92[_0xaa93('0x2e')][_0xaa93('0x34')]){_0x76cd82[_0xaa93('0x35')]=_[_0xaa93('0x36')](_0x76cd82[_0xaa93('0x35')],{'$or':_[_0xaa93('0x24')](_0x515d55,function(_0x3442c4){if(_0x3442c4['type']!==_0xaa93('0x37')){var _0x2fede7={};_0x2fede7[_0x3442c4[_0xaa93('0x23')]]={'$like':'%'+_0x535a92[_0xaa93('0x2e')]['filter']+'%'};return _0x2fede7;}})});}_0x76cd82=_['merge']({},_0x76cd82,_0x535a92['options']);var _0x500d1a={'where':_0x76cd82[_0xaa93('0x35')]};return db[_0xaa93('0x25')][_0xaa93('0x18')](_0x500d1a)[_0xaa93('0x1f')](function(_0x55f701){_0xc7028d['count']=_0x55f701;if(_0x535a92[_0xaa93('0x2e')][_0xaa93('0x38')]){_0x76cd82['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xaa93('0x39')](_0x76cd82);})[_0xaa93('0x1f')](function(_0x5bf7be){_0xc7028d[_0xaa93('0x3a')]=_0x5bf7be;return _0xc7028d;})['then'](respondWithFilteredResult(_0x3b7b4c,_0x76cd82))[_0xaa93('0x3b')](handleError(_0x3b7b4c,null));};exports['show']=function(_0x491086,_0x35dc56){var _0x242d7a={'raw':!![],'where':{'id':_0x491086[_0xaa93('0x3c')]['id']}},_0x59d92e={};_0x59d92e[_0xaa93('0x2a')]=_[_0xaa93('0x3d')](db[_0xaa93('0x25')][_0xaa93('0x26')]);_0x59d92e[_0xaa93('0x2e')]=_[_0xaa93('0x3d')](_0x491086[_0xaa93('0x2e')]);_0x59d92e[_0xaa93('0x2b')]=_['intersection'](_0x59d92e[_0xaa93('0x2a')],_0x59d92e[_0xaa93('0x2e')]);_0x242d7a['attributes']=_['intersection'](_0x59d92e[_0xaa93('0x2a')],qs[_0xaa93('0x2d')](_0x491086[_0xaa93('0x2e')][_0xaa93('0x2d')]));_0x242d7a[_0xaa93('0x2f')]=_0x242d7a['attributes']['length']?_0x242d7a['attributes']:_0x59d92e[_0xaa93('0x2a')];if(_0x491086['query'][_0xaa93('0x38')]){_0x242d7a[_0xaa93('0x3e')]=[{'all':!![]}];}_0x242d7a=_[_0xaa93('0x36')]({},_0x242d7a,_0x491086[_0xaa93('0x3f')]);return db[_0xaa93('0x25')][_0xaa93('0x40')](_0x242d7a)[_0xaa93('0x1f')](handleEntityNotFound(_0x35dc56,null))[_0xaa93('0x1f')](respondWithResult(_0x35dc56,null))[_0xaa93('0x3b')](handleError(_0x35dc56,null));};exports[_0xaa93('0x41')]=function(_0x2370ea,_0x5bfdcf){return db[_0xaa93('0x25')]['create'](_0x2370ea[_0xaa93('0x42')],{})[_0xaa93('0x1f')](respondWithResult(_0x5bfdcf,0xc9))[_0xaa93('0x3b')](handleError(_0x5bfdcf,null));};exports[_0xaa93('0x1e')]=function(_0x1190e3,_0x1adfa8){if(_0x1190e3[_0xaa93('0x42')]['id']){delete _0x1190e3[_0xaa93('0x42')]['id'];}return db['ChatQueueReport'][_0xaa93('0x40')]({'where':{'id':_0x1190e3[_0xaa93('0x3c')]['id']}})[_0xaa93('0x1f')](handleEntityNotFound(_0x1adfa8,null))[_0xaa93('0x1f')](saveUpdates(_0x1190e3[_0xaa93('0x42')],null))[_0xaa93('0x1f')](respondWithResult(_0x1adfa8,null))['catch'](handleError(_0x1adfa8,null));};exports[_0xaa93('0x20')]=function(_0x2ff830,_0x3ca8e1){return db[_0xaa93('0x25')]['find']({'where':{'id':_0x2ff830['params']['id']}})[_0xaa93('0x1f')](handleEntityNotFound(_0x3ca8e1,null))[_0xaa93('0x1f')](removeEntity(_0x3ca8e1,null))[_0xaa93('0x3b')](handleError(_0x3ca8e1,null));};exports[_0xaa93('0x43')]=function(_0x2e8dfd,_0x683145){return db[_0xaa93('0x25')][_0xaa93('0x43')]()[_0xaa93('0x1f')](respondWithResult(_0x683145,null))[_0xaa93('0x3b')](handleError(_0x683145,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 294b32b..230bac9 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bdd95,_0x3d0251){var _0xa776c0=function(_0x200f83){while(--_0x200f83){_0x3bdd95['push'](_0x3bdd95['shift']());}};_0xa776c0(++_0x3d0251);}(_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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 8ce4c8f..754fa31 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 _0xcb2c=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xcb2c,0x17a));var _0xccb2=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xcb2c[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xccb2('0x0'));var util=require(_0xccb2('0x1'));var moment=require(_0xccb2('0x2'));var BPromise=require(_0xccb2('0x3'));var rs=require(_0xccb2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xccb2('0x5'))['db'];var utils=require(_0xccb2('0x6'));var logger=require(_0xccb2('0x7'))(_0xccb2('0x8'));var config=require(_0xccb2('0x9'));var jayson=require(_0xccb2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e078d,_0x3c1e0e,_0x172ce0){return new BPromise(function(_0x71c46b,_0x1a8ee2){return client[_0xccb2('0xb')](_0x3e078d,_0x172ce0)[_0xccb2('0xc')](function(_0x29f2cb){logger[_0xccb2('0xd')](_0xccb2('0xe'),_0x3c1e0e,_0xccb2('0xf'));logger[_0xccb2('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3c1e0e,_0xccb2('0xf'),JSON[_0xccb2('0x11')](_0x29f2cb));if(_0x29f2cb[_0xccb2('0x12')]){if(_0x29f2cb[_0xccb2('0x12')][_0xccb2('0x13')]===0x1f4){logger['error'](_0xccb2('0xe'),_0x3c1e0e,_0x29f2cb[_0xccb2('0x12')]['message']);return _0x1a8ee2(_0x29f2cb[_0xccb2('0x12')][_0xccb2('0x14')]);}logger[_0xccb2('0x12')](_0xccb2('0xe'),_0x3c1e0e,_0x29f2cb[_0xccb2('0x12')][_0xccb2('0x14')]);return _0x71c46b(_0x29f2cb[_0xccb2('0x12')][_0xccb2('0x14')]);}else{logger[_0xccb2('0xd')](_0xccb2('0xe'),_0x3c1e0e,'request\x20sent');_0x71c46b(_0x29f2cb[_0xccb2('0x15')][_0xccb2('0x14')]);}})[_0xccb2('0x16')](function(_0x590757){logger[_0xccb2('0x12')](_0xccb2('0xe'),_0x3c1e0e,_0x590757);_0x1a8ee2(_0x590757);});});}exports[_0xccb2('0x17')]=function(_0x8a0290){var _0xdedb38=this;return new Promise(function(_0x179da7,_0x22491a){return db[_0xccb2('0x18')][_0xccb2('0x19')](_0x8a0290[_0xccb2('0x1a')],{'raw':_0x8a0290[_0xccb2('0x1b')]?_0x8a0290[_0xccb2('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xccb2('0xc')](function(_0x256919){logger[_0xccb2('0xd')](_0xccb2('0x17'),_0x8a0290);logger[_0xccb2('0x10')]('CreateChatQueueReport',_0x8a0290,JSON[_0xccb2('0x11')](_0x256919));_0x179da7(_0x256919);})[_0xccb2('0x16')](function(_0x41d42e){logger['error'](_0xccb2('0x17'),_0x41d42e[_0xccb2('0x14')],_0x8a0290);_0x22491a(_0xdedb38['error'](0x1f4,_0x41d42e[_0xccb2('0x14')]));});});};exports[_0xccb2('0x1c')]=function(_0x5d2e60){var _0x311c29=this;return new Promise(function(_0xfe7fed,_0x3f5db8){return db[_0xccb2('0x18')][_0xccb2('0x1d')](_0x5d2e60[_0xccb2('0x1a')],{'raw':_0x5d2e60[_0xccb2('0x1b')]?_0x5d2e60[_0xccb2('0x1b')][_0xccb2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d2e60['options']?_0x5d2e60[_0xccb2('0x1b')][_0xccb2('0x1f')]||null:null,'attributes':_0x5d2e60['options']?_0x5d2e60['options']['attributes']||null:null,'limit':_0x5d2e60[_0xccb2('0x1b')]?_0x5d2e60[_0xccb2('0x1b')][_0xccb2('0x20')]||null:null})['then'](function(_0x3c876a){logger[_0xccb2('0xd')]('UpdateChatQueueReport',_0x5d2e60);logger[_0xccb2('0x10')](_0xccb2('0x1c'),_0x5d2e60,JSON['stringify'](_0x3c876a));_0xfe7fed(_0x3c876a);})['catch'](function(_0x2ca798){logger[_0xccb2('0x12')](_0xccb2('0x1c'),_0x2ca798[_0xccb2('0x14')],_0x5d2e60);_0x3f5db8(_0x311c29['error'](0x1f4,_0x2ca798['message']));});});}; \ No newline at end of file +var _0x23ca=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','raw','where','limit','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d9cc6,_0x4ba613){var _0x2165b7=function(_0x25a4f5){while(--_0x25a4f5){_0x5d9cc6['push'](_0x5d9cc6['shift']());}};_0x2165b7(++_0x4ba613);}(_0x23ca,0x130));var _0xa23c=function(_0x450869,_0x6f402d){_0x450869=_0x450869-0x0;var _0x3e261f=_0x23ca[_0x450869];return _0x3e261f;};'use strict';var _=require(_0xa23c('0x0'));var util=require('util');var moment=require(_0xa23c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa23c('0x2'));var fs=require('fs');var Redis=require(_0xa23c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa23c('0x4'));var logger=require(_0xa23c('0x5'))('rpc');var config=require(_0xa23c('0x6'));var jayson=require(_0xa23c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16f1c2,_0x36886e,_0x395993){return new BPromise(function(_0x4246f3,_0x565a88){return client['request'](_0x16f1c2,_0x395993)[_0xa23c('0x8')](function(_0x1609fa){logger[_0xa23c('0x9')](_0xa23c('0xa'),_0x36886e,_0xa23c('0xb'));logger[_0xa23c('0xc')](_0xa23c('0xd'),_0x36886e,_0xa23c('0xb'),JSON[_0xa23c('0xe')](_0x1609fa));if(_0x1609fa[_0xa23c('0xf')]){if(_0x1609fa['error'][_0xa23c('0x10')]===0x1f4){logger[_0xa23c('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x36886e,_0x1609fa['error'][_0xa23c('0x11')]);return _0x565a88(_0x1609fa[_0xa23c('0xf')][_0xa23c('0x11')]);}logger[_0xa23c('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x36886e,_0x1609fa[_0xa23c('0xf')][_0xa23c('0x11')]);return _0x4246f3(_0x1609fa[_0xa23c('0xf')][_0xa23c('0x11')]);}else{logger[_0xa23c('0x9')](_0xa23c('0xa'),_0x36886e,'request\x20sent');_0x4246f3(_0x1609fa[_0xa23c('0x12')][_0xa23c('0x11')]);}})[_0xa23c('0x13')](function(_0xb357bf){logger[_0xa23c('0xf')](_0xa23c('0xa'),_0x36886e,_0xb357bf);_0x565a88(_0xb357bf);});});}exports[_0xa23c('0x14')]=function(_0x5ea866){var _0x2d0294=this;return new Promise(function(_0x1bc489,_0x4163a3){return db[_0xa23c('0x15')][_0xa23c('0x16')](_0x5ea866['body'],{'raw':_0x5ea866[_0xa23c('0x17')]?_0x5ea866['options']['raw']===undefined?!![]:![]:!![]})[_0xa23c('0x8')](function(_0x71b9a6){logger[_0xa23c('0x9')]('CreateChatQueueReport',_0x5ea866);logger[_0xa23c('0xc')](_0xa23c('0x14'),_0x5ea866,JSON[_0xa23c('0xe')](_0x71b9a6));_0x1bc489(_0x71b9a6);})[_0xa23c('0x13')](function(_0x3269a9){logger[_0xa23c('0xf')]('CreateChatQueueReport',_0x3269a9['message'],_0x5ea866);_0x4163a3(_0x2d0294[_0xa23c('0xf')](0x1f4,_0x3269a9[_0xa23c('0x11')]));});});};exports[_0xa23c('0x18')]=function(_0x41a75b){var _0x544017=this;return new Promise(function(_0x301529,_0x11fefa){return db['ChatQueueReport'][_0xa23c('0x19')](_0x41a75b['body'],{'raw':_0x41a75b['options']?_0x41a75b[_0xa23c('0x17')][_0xa23c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41a75b[_0xa23c('0x17')]?_0x41a75b[_0xa23c('0x17')][_0xa23c('0x1b')]||null:null,'attributes':_0x41a75b[_0xa23c('0x17')]?_0x41a75b[_0xa23c('0x17')]['attributes']||null:null,'limit':_0x41a75b['options']?_0x41a75b[_0xa23c('0x17')][_0xa23c('0x1c')]||null:null})[_0xa23c('0x8')](function(_0x46e5c8){logger[_0xa23c('0x9')](_0xa23c('0x18'),_0x41a75b);logger[_0xa23c('0xc')](_0xa23c('0x18'),_0x41a75b,JSON[_0xa23c('0xe')](_0x46e5c8));_0x301529(_0x46e5c8);})[_0xa23c('0x13')](function(_0x2f0519){logger[_0xa23c('0xf')](_0xa23c('0x18'),_0x2f0519[_0xa23c('0x11')],_0x41a75b);_0x11fefa(_0x544017['error'](0x1f4,_0x2f0519[_0xa23c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 65074e0..d12874d 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 _0x520b=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','put','/:id','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3ba9b5,_0x5ba267){var _0x369735=function(_0x376371){while(--_0x376371){_0x3ba9b5['push'](_0x3ba9b5['shift']());}};_0x369735(++_0x5ba267);}(_0x520b,0xf6));var _0xb520=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x520b[_0x16a223];return _0x5ded66;};'use strict';var multer=require('multer');var util=require(_0xb520('0x0'));var path=require(_0xb520('0x1'));var timeout=require(_0xb520('0x2'));var express=require('express');var router=express[_0xb520('0x3')]();var fs_extra=require(_0xb520('0x4'));var auth=require(_0xb520('0x5'));var interaction=require(_0xb520('0x6'));var config=require(_0xb520('0x7'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xb520('0x8')](),controller[_0xb520('0x9')]);router[_0xb520('0xa')](_0xb520('0xb'),auth['isAuthenticated'](),controller[_0xb520('0xc')]);router[_0xb520('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xb520('0xd')]);router[_0xb520('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb520('0xf')](_0xb520('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xb520('0x11')](_0xb520('0x10'),auth[_0xb520('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe747=['isAuthenticated','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatQueueReport.controller','get','index','/:id','show'];(function(_0x1160d7,_0x8324ed){var _0x53df4c=function(_0xecfd16){while(--_0xecfd16){_0x1160d7['push'](_0x1160d7['shift']());}};_0x53df4c(++_0x8324ed);}(_0xe747,0x1c7));var _0x7e74=function(_0x2ae5b9,_0x5775d6){_0x2ae5b9=_0x2ae5b9-0x0;var _0x4e2029=_0xe747[_0x2ae5b9];return _0x4e2029;};'use strict';var multer=require(_0x7e74('0x0'));var util=require(_0x7e74('0x1'));var path=require(_0x7e74('0x2'));var timeout=require(_0x7e74('0x3'));var express=require(_0x7e74('0x4'));var router=express[_0x7e74('0x5')]();var fs_extra=require(_0x7e74('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e74('0x7'));var controller=require(_0x7e74('0x8'));router[_0x7e74('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e74('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7e74('0x9')](_0x7e74('0xb'),auth['isAuthenticated'](),controller[_0x7e74('0xc')]);router['post']('/',auth[_0x7e74('0xd')](),controller['create']);router[_0x7e74('0xe')](_0x7e74('0xb'),auth['isAuthenticated'](),controller[_0x7e74('0xf')]);router[_0x7e74('0x10')](_0x7e74('0xb'),auth[_0x7e74('0xd')](),controller['destroy']);module[_0x7e74('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 983d570..fa88453 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x58e2d2,_0x4ff59b){var _0x249768=function(_0x1c9e31){while(--_0x1c9e31){_0x58e2d2['push'](_0x58e2d2['shift']());}};_0x249768(++_0x4ff59b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x9bde,0xe1));var _0xe9bd=function(_0x290a5d,_0x756519){_0x290a5d=_0x290a5d-0x0;var _0x15ec07=_0x9bde[_0x290a5d];return _0x15ec07;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 86d0f6d..11f0e15 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 _0xd99b=['sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatTransferReport','fieldName','type','key','query','filters','intersection','model','fields','attributes','order'];(function(_0x2bda4d,_0x5e6bb3){var _0x2b78f8=function(_0x1bc062){while(--_0x1bc062){_0x2bda4d['push'](_0x2bda4d['shift']());}};_0x2b78f8(++_0x5e6bb3);}(_0xd99b,0x1e7));var _0xbd99=function(_0x51c8ca,_0x427424){_0x51c8ca=_0x51c8ca-0x0;var _0x3fb56d=_0xd99b[_0x51c8ca];return _0x3fb56d;};'use strict';var emlformat=require(_0xbd99('0x0'));var rimraf=require(_0xbd99('0x1'));var zipdir=require(_0xbd99('0x2'));var jsonpatch=require(_0xbd99('0x3'));var rp=require(_0xbd99('0x4'));var moment=require('moment');var BPromise=require(_0xbd99('0x5'));var Mustache=require(_0xbd99('0x6'));var util=require(_0xbd99('0x7'));var path=require(_0xbd99('0x8'));var sox=require(_0xbd99('0x9'));var csv=require(_0xbd99('0xa'));var ejs=require(_0xbd99('0xb'));var fs=require('fs');var fs_extra=require(_0xbd99('0xc'));var _=require(_0xbd99('0xd'));var squel=require(_0xbd99('0xe'));var crypto=require(_0xbd99('0xf'));var jsforce=require(_0xbd99('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbd99('0xa'));var querystring=require(_0xbd99('0x11'));var Papa=require(_0xbd99('0x12'));var Redis=require(_0xbd99('0x13'));var authService=require(_0xbd99('0x14'));var qs=require(_0xbd99('0x15'));var as=require(_0xbd99('0x16'));var hardwareService=require(_0xbd99('0x17'));var logger=require(_0xbd99('0x18'))(_0xbd99('0x19'));var utils=require(_0xbd99('0x1a'));var config=require(_0xbd99('0x1b'));var licenseUtil=require(_0xbd99('0x1c'));var db=require(_0xbd99('0x1d'))['db'];function respondWithStatusCode(_0x1d20e3,_0xa59cc6){_0xa59cc6=_0xa59cc6||0xcc;return function(_0x3729a0){if(_0x3729a0){return _0x1d20e3[_0xbd99('0x1e')](_0xa59cc6);}return _0x1d20e3[_0xbd99('0x1f')](_0xa59cc6)[_0xbd99('0x20')]();};}function respondWithResult(_0x1654bf,_0x212d5b){_0x212d5b=_0x212d5b||0xc8;return function(_0x5278d6){if(_0x5278d6){return _0x1654bf[_0xbd99('0x1f')](_0x212d5b)['json'](_0x5278d6);}};}function respondWithFilteredResult(_0x6283f4,_0xa8b547){return function(_0xe51f66){if(_0xe51f66){var _0x1a79ba=typeof _0xa8b547['offset']==='undefined'&&typeof _0xa8b547[_0xbd99('0x21')]===_0xbd99('0x22');var _0x477ee2=_0xe51f66[_0xbd99('0x23')];var _0x551e49=_0x1a79ba?0x0:_0xa8b547['offset'];var _0x4a287b=_0x1a79ba?_0xe51f66[_0xbd99('0x23')]:_0xa8b547[_0xbd99('0x24')]+_0xa8b547[_0xbd99('0x21')];var _0x18a3d5;if(_0x4a287b>=_0x477ee2){_0x4a287b=_0x477ee2;_0x18a3d5=0xc8;}else{_0x18a3d5=0xce;}_0x6283f4[_0xbd99('0x1f')](_0x18a3d5);return _0x6283f4['set'](_0xbd99('0x25'),_0x551e49+'-'+_0x4a287b+'/'+_0x477ee2)['json'](_0xe51f66);}return null;};}function patchUpdates(_0xc8e953){return function(_0x2b1fe8){try{jsonpatch[_0xbd99('0x26')](_0x2b1fe8,_0xc8e953,!![]);}catch(_0x518916){return BPromise[_0xbd99('0x27')](_0x518916);}return _0x2b1fe8[_0xbd99('0x28')]();};}function saveUpdates(_0x221ac0,_0x2cd6e4){return function(_0xbe43df){if(_0xbe43df){return _0xbe43df[_0xbd99('0x29')](_0x221ac0)[_0xbd99('0x2a')](function(_0x3d527f){return _0x3d527f;});}return null;};}function removeEntity(_0x4c54a8,_0x3fb899){return function(_0x55a31f){if(_0x55a31f){return _0x55a31f[_0xbd99('0x2b')]()['then'](function(){_0x4c54a8[_0xbd99('0x1f')](0xcc)[_0xbd99('0x20')]();});}};}function handleEntityNotFound(_0x46cafc,_0x5140c7){return function(_0x203996){if(!_0x203996){_0x46cafc[_0xbd99('0x1e')](0x194);}return _0x203996;};}function handleError(_0x1454d0,_0x6a083c){_0x6a083c=_0x6a083c||0x1f4;return function(_0x1dc711){logger['error'](_0x1dc711[_0xbd99('0x2c')]);if(_0x1dc711['name']){delete _0x1dc711[_0xbd99('0x2d')];}_0x1454d0[_0xbd99('0x1f')](_0x6a083c)['send'](_0x1dc711);};}exports[_0xbd99('0x2e')]=function(_0x476fd8,_0x280755){var _0x211794={},_0x3fef96={},_0x43d823={'count':0x0,'rows':[]};var _0xec8ec1=_[_0xbd99('0x2f')](db[_0xbd99('0x30')]['rawAttributes'],function(_0x210b7f){return{'name':_0x210b7f[_0xbd99('0x31')],'type':_0x210b7f[_0xbd99('0x32')][_0xbd99('0x33')]};});_0x3fef96['model']=_[_0xbd99('0x2f')](_0xec8ec1,'name');_0x3fef96[_0xbd99('0x34')]=_['keys'](_0x476fd8[_0xbd99('0x34')]);_0x3fef96[_0xbd99('0x35')]=_[_0xbd99('0x36')](_0x3fef96[_0xbd99('0x37')],_0x3fef96[_0xbd99('0x34')]);_0x211794['attributes']=_[_0xbd99('0x36')](_0x3fef96[_0xbd99('0x37')],qs[_0xbd99('0x38')](_0x476fd8[_0xbd99('0x34')]['fields']));_0x211794[_0xbd99('0x39')]=_0x211794[_0xbd99('0x39')]['length']?_0x211794['attributes']:_0x3fef96[_0xbd99('0x37')];if(!_0x476fd8[_0xbd99('0x34')]['hasOwnProperty']('nolimit')){_0x211794[_0xbd99('0x21')]=qs[_0xbd99('0x21')](_0x476fd8[_0xbd99('0x34')][_0xbd99('0x21')]);_0x211794[_0xbd99('0x24')]=qs[_0xbd99('0x24')](_0x476fd8[_0xbd99('0x34')][_0xbd99('0x24')]);}_0x211794[_0xbd99('0x3a')]=qs[_0xbd99('0x3b')](_0x476fd8['query'][_0xbd99('0x3b')]);_0x211794[_0xbd99('0x3c')]=qs[_0xbd99('0x35')](_['pick'](_0x476fd8[_0xbd99('0x34')],_0x3fef96[_0xbd99('0x35')]),_0xec8ec1);if(_0x476fd8[_0xbd99('0x34')][_0xbd99('0x3d')]){_0x211794[_0xbd99('0x3c')]=_[_0xbd99('0x3e')](_0x211794[_0xbd99('0x3c')],{'$or':_[_0xbd99('0x2f')](_0xec8ec1,function(_0x957997){if(_0x957997[_0xbd99('0x32')]!==_0xbd99('0x3f')){var _0x8dc737={};_0x8dc737[_0x957997[_0xbd99('0x2d')]]={'$like':'%'+_0x476fd8[_0xbd99('0x34')]['filter']+'%'};return _0x8dc737;}})});}_0x211794=_[_0xbd99('0x3e')]({},_0x211794,_0x476fd8[_0xbd99('0x40')]);var _0x44d77b={'where':_0x211794[_0xbd99('0x3c')]};return db[_0xbd99('0x30')][_0xbd99('0x23')](_0x44d77b)[_0xbd99('0x2a')](function(_0x4b91c5){_0x43d823[_0xbd99('0x23')]=_0x4b91c5;if(_0x476fd8['query'][_0xbd99('0x41')]){_0x211794[_0xbd99('0x42')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xbd99('0x43')](_0x211794);})[_0xbd99('0x2a')](function(_0x4718ae){_0x43d823[_0xbd99('0x44')]=_0x4718ae;return _0x43d823;})[_0xbd99('0x2a')](respondWithFilteredResult(_0x280755,_0x211794))['catch'](handleError(_0x280755,null));};exports[_0xbd99('0x45')]=function(_0x4c0de2,_0x1b0c9a){var _0x46b9f8={'raw':!![],'where':{'id':_0x4c0de2[_0xbd99('0x46')]['id']}},_0x381ccb={};_0x381ccb[_0xbd99('0x37')]=_[_0xbd99('0x47')](db[_0xbd99('0x30')][_0xbd99('0x48')]);_0x381ccb['query']=_['keys'](_0x4c0de2[_0xbd99('0x34')]);_0x381ccb['filters']=_[_0xbd99('0x36')](_0x381ccb['model'],_0x381ccb[_0xbd99('0x34')]);_0x46b9f8['attributes']=_['intersection'](_0x381ccb[_0xbd99('0x37')],qs[_0xbd99('0x38')](_0x4c0de2[_0xbd99('0x34')]['fields']));_0x46b9f8['attributes']=_0x46b9f8['attributes']['length']?_0x46b9f8[_0xbd99('0x39')]:_0x381ccb['model'];if(_0x4c0de2['query'][_0xbd99('0x41')]){_0x46b9f8[_0xbd99('0x42')]=[{'all':!![]}];}_0x46b9f8=_[_0xbd99('0x3e')]({},_0x46b9f8,_0x4c0de2['options']);return db[_0xbd99('0x30')][_0xbd99('0x49')](_0x46b9f8)[_0xbd99('0x2a')](handleEntityNotFound(_0x1b0c9a,null))[_0xbd99('0x2a')](respondWithResult(_0x1b0c9a,null))[_0xbd99('0x4a')](handleError(_0x1b0c9a,null));};exports[_0xbd99('0x4b')]=function(_0x4dd461,_0x5f4c3d){return db[_0xbd99('0x30')][_0xbd99('0x4b')](_0x4dd461['body'],{})[_0xbd99('0x2a')](respondWithResult(_0x5f4c3d,0xc9))[_0xbd99('0x4a')](handleError(_0x5f4c3d,null));};exports[_0xbd99('0x29')]=function(_0x127a52,_0x385547){if(_0x127a52[_0xbd99('0x4c')]['id']){delete _0x127a52[_0xbd99('0x4c')]['id'];}return db['ChatTransferReport'][_0xbd99('0x49')]({'where':{'id':_0x127a52[_0xbd99('0x46')]['id']}})[_0xbd99('0x2a')](handleEntityNotFound(_0x385547,null))[_0xbd99('0x2a')](saveUpdates(_0x127a52[_0xbd99('0x4c')],null))['then'](respondWithResult(_0x385547,null))['catch'](handleError(_0x385547,null));};exports[_0xbd99('0x2b')]=function(_0x4f42fb,_0xf82b4){return db['ChatTransferReport'][_0xbd99('0x49')]({'where':{'id':_0x4f42fb[_0xbd99('0x46')]['id']}})[_0xbd99('0x2a')](handleEntityNotFound(_0xf82b4,null))[_0xbd99('0x2a')](removeEntity(_0xf82b4,null))[_0xbd99('0x4a')](handleError(_0xf82b4,null));};exports[_0xbd99('0x4d')]=function(_0x3c5725,_0x2de56a){return db['ChatTransferReport'][_0xbd99('0x4d')]()[_0xbd99('0x2a')](respondWithResult(_0x2de56a,null))['catch'](handleError(_0x2de56a,null));}; \ No newline at end of file +var _0x23c5=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','intersection','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields'];(function(_0x42939d,_0x24b834){var _0x11eed5=function(_0x1a86e7){while(--_0x1a86e7){_0x42939d['push'](_0x42939d['shift']());}};_0x11eed5(++_0x24b834);}(_0x23c5,0xfc));var _0x523c=function(_0x4b34ca,_0x3aa65d){_0x4b34ca=_0x4b34ca-0x0;var _0x2d7676=_0x23c5[_0x4b34ca];return _0x2d7676;};'use strict';var emlformat=require(_0x523c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x523c('0x1'));var jsonpatch=require(_0x523c('0x2'));var rp=require(_0x523c('0x3'));var moment=require(_0x523c('0x4'));var BPromise=require(_0x523c('0x5'));var Mustache=require(_0x523c('0x6'));var util=require(_0x523c('0x7'));var path=require('path');var sox=require(_0x523c('0x8'));var csv=require(_0x523c('0x9'));var ejs=require(_0x523c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x523c('0xb'));var squel=require(_0x523c('0xc'));var crypto=require(_0x523c('0xd'));var jsforce=require(_0x523c('0xe'));var deskjs=require(_0x523c('0xf'));var toCsv=require(_0x523c('0x9'));var querystring=require(_0x523c('0x10'));var Papa=require(_0x523c('0x11'));var Redis=require(_0x523c('0x12'));var authService=require(_0x523c('0x13'));var qs=require(_0x523c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x523c('0x15'));var logger=require(_0x523c('0x16'))(_0x523c('0x17'));var utils=require(_0x523c('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x523c('0x19'))['db'];function respondWithStatusCode(_0x482ac0,_0x3e975b){_0x3e975b=_0x3e975b||0xcc;return function(_0x40eb24){if(_0x40eb24){return _0x482ac0[_0x523c('0x1a')](_0x3e975b);}return _0x482ac0['status'](_0x3e975b)[_0x523c('0x1b')]();};}function respondWithResult(_0x519b3d,_0x1f5372){_0x1f5372=_0x1f5372||0xc8;return function(_0x26749c){if(_0x26749c){return _0x519b3d[_0x523c('0x1c')](_0x1f5372)[_0x523c('0x1d')](_0x26749c);}};}function respondWithFilteredResult(_0x4f74b4,_0x2d4b3d){return function(_0x5bb114){if(_0x5bb114){var _0x4a27ce=typeof _0x2d4b3d['offset']===_0x523c('0x1e')&&typeof _0x2d4b3d[_0x523c('0x1f')]==='undefined';var _0x125e3e=_0x5bb114[_0x523c('0x20')];var _0x2cdd95=_0x4a27ce?0x0:_0x2d4b3d[_0x523c('0x21')];var _0x5393a9=_0x4a27ce?_0x5bb114[_0x523c('0x20')]:_0x2d4b3d['offset']+_0x2d4b3d[_0x523c('0x1f')];var _0x438766;if(_0x5393a9>=_0x125e3e){_0x5393a9=_0x125e3e;_0x438766=0xc8;}else{_0x438766=0xce;}_0x4f74b4[_0x523c('0x1c')](_0x438766);return _0x4f74b4[_0x523c('0x22')]('Content-Range',_0x2cdd95+'-'+_0x5393a9+'/'+_0x125e3e)['json'](_0x5bb114);}return null;};}function patchUpdates(_0x1e7055){return function(_0x3cb9c6){try{jsonpatch[_0x523c('0x23')](_0x3cb9c6,_0x1e7055,!![]);}catch(_0x1000f2){return BPromise[_0x523c('0x24')](_0x1000f2);}return _0x3cb9c6[_0x523c('0x25')]();};}function saveUpdates(_0x29f799,_0x4d8346){return function(_0x2938ee){if(_0x2938ee){return _0x2938ee['update'](_0x29f799)[_0x523c('0x26')](function(_0x855e9b){return _0x855e9b;});}return null;};}function removeEntity(_0x24d040,_0x1dfb11){return function(_0x217fbc){if(_0x217fbc){return _0x217fbc[_0x523c('0x27')]()['then'](function(){_0x24d040[_0x523c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19b874,_0x23b259){return function(_0x38ae76){if(!_0x38ae76){_0x19b874[_0x523c('0x1a')](0x194);}return _0x38ae76;};}function handleError(_0x47f2d0,_0x4dad26){_0x4dad26=_0x4dad26||0x1f4;return function(_0x5bdc0f){logger[_0x523c('0x28')](_0x5bdc0f[_0x523c('0x29')]);if(_0x5bdc0f[_0x523c('0x2a')]){delete _0x5bdc0f[_0x523c('0x2a')];}_0x47f2d0[_0x523c('0x1c')](_0x4dad26)[_0x523c('0x2b')](_0x5bdc0f);};}exports[_0x523c('0x2c')]=function(_0x4b8ebb,_0x41fbba){var _0x30849d={},_0x4cd70f={},_0x354b98={'count':0x0,'rows':[]};var _0x57e891=_[_0x523c('0x2d')](db[_0x523c('0x2e')][_0x523c('0x2f')],function(_0x2cdb8b){return{'name':_0x2cdb8b[_0x523c('0x30')],'type':_0x2cdb8b['type'][_0x523c('0x31')]};});_0x4cd70f['model']=_[_0x523c('0x2d')](_0x57e891,_0x523c('0x2a'));_0x4cd70f[_0x523c('0x32')]=_[_0x523c('0x33')](_0x4b8ebb[_0x523c('0x32')]);_0x4cd70f[_0x523c('0x34')]=_['intersection'](_0x4cd70f[_0x523c('0x35')],_0x4cd70f[_0x523c('0x32')]);_0x30849d[_0x523c('0x36')]=_['intersection'](_0x4cd70f[_0x523c('0x35')],qs['fields'](_0x4b8ebb[_0x523c('0x32')][_0x523c('0x37')]));_0x30849d[_0x523c('0x36')]=_0x30849d[_0x523c('0x36')][_0x523c('0x38')]?_0x30849d[_0x523c('0x36')]:_0x4cd70f[_0x523c('0x35')];if(!_0x4b8ebb[_0x523c('0x32')][_0x523c('0x39')](_0x523c('0x3a'))){_0x30849d[_0x523c('0x1f')]=qs[_0x523c('0x1f')](_0x4b8ebb['query']['limit']);_0x30849d[_0x523c('0x21')]=qs['offset'](_0x4b8ebb['query']['offset']);}_0x30849d[_0x523c('0x3b')]=qs[_0x523c('0x3c')](_0x4b8ebb[_0x523c('0x32')]['sort']);_0x30849d[_0x523c('0x3d')]=qs[_0x523c('0x34')](_[_0x523c('0x3e')](_0x4b8ebb[_0x523c('0x32')],_0x4cd70f[_0x523c('0x34')]),_0x57e891);if(_0x4b8ebb['query'][_0x523c('0x3f')]){_0x30849d[_0x523c('0x3d')]=_[_0x523c('0x40')](_0x30849d[_0x523c('0x3d')],{'$or':_['map'](_0x57e891,function(_0x234ea6){if(_0x234ea6[_0x523c('0x41')]!==_0x523c('0x42')){var _0x121cfe={};_0x121cfe[_0x234ea6[_0x523c('0x2a')]]={'$like':'%'+_0x4b8ebb['query'][_0x523c('0x3f')]+'%'};return _0x121cfe;}})});}_0x30849d=_[_0x523c('0x40')]({},_0x30849d,_0x4b8ebb['options']);var _0x9447b7={'where':_0x30849d[_0x523c('0x3d')]};return db['ChatTransferReport'][_0x523c('0x20')](_0x9447b7)[_0x523c('0x26')](function(_0x45f8ac){_0x354b98['count']=_0x45f8ac;if(_0x4b8ebb[_0x523c('0x32')][_0x523c('0x43')]){_0x30849d[_0x523c('0x44')]=[{'all':!![]}];}return db[_0x523c('0x2e')][_0x523c('0x45')](_0x30849d);})[_0x523c('0x26')](function(_0x24fa21){_0x354b98['rows']=_0x24fa21;return _0x354b98;})[_0x523c('0x26')](respondWithFilteredResult(_0x41fbba,_0x30849d))[_0x523c('0x46')](handleError(_0x41fbba,null));};exports['show']=function(_0x330917,_0x490f96){var _0x28fe77={'raw':!![],'where':{'id':_0x330917[_0x523c('0x47')]['id']}},_0x36b873={};_0x36b873[_0x523c('0x35')]=_[_0x523c('0x33')](db[_0x523c('0x2e')]['rawAttributes']);_0x36b873[_0x523c('0x32')]=_[_0x523c('0x33')](_0x330917['query']);_0x36b873[_0x523c('0x34')]=_[_0x523c('0x48')](_0x36b873[_0x523c('0x35')],_0x36b873['query']);_0x28fe77[_0x523c('0x36')]=_[_0x523c('0x48')](_0x36b873[_0x523c('0x35')],qs[_0x523c('0x37')](_0x330917['query']['fields']));_0x28fe77[_0x523c('0x36')]=_0x28fe77['attributes']['length']?_0x28fe77[_0x523c('0x36')]:_0x36b873[_0x523c('0x35')];if(_0x330917[_0x523c('0x32')]['includeAll']){_0x28fe77[_0x523c('0x44')]=[{'all':!![]}];}_0x28fe77=_[_0x523c('0x40')]({},_0x28fe77,_0x330917['options']);return db['ChatTransferReport'][_0x523c('0x49')](_0x28fe77)[_0x523c('0x26')](handleEntityNotFound(_0x490f96,null))[_0x523c('0x26')](respondWithResult(_0x490f96,null))[_0x523c('0x46')](handleError(_0x490f96,null));};exports['create']=function(_0x228019,_0x1d9720){return db[_0x523c('0x2e')][_0x523c('0x4a')](_0x228019['body'],{})[_0x523c('0x26')](respondWithResult(_0x1d9720,0xc9))[_0x523c('0x46')](handleError(_0x1d9720,null));};exports['update']=function(_0x1fe073,_0x477733){if(_0x1fe073[_0x523c('0x4b')]['id']){delete _0x1fe073[_0x523c('0x4b')]['id'];}return db['ChatTransferReport'][_0x523c('0x49')]({'where':{'id':_0x1fe073[_0x523c('0x47')]['id']}})[_0x523c('0x26')](handleEntityNotFound(_0x477733,null))[_0x523c('0x26')](saveUpdates(_0x1fe073['body'],null))[_0x523c('0x26')](respondWithResult(_0x477733,null))['catch'](handleError(_0x477733,null));};exports['destroy']=function(_0x5a1c57,_0x3b45f2){return db['ChatTransferReport']['find']({'where':{'id':_0x5a1c57[_0x523c('0x47')]['id']}})[_0x523c('0x26')](handleEntityNotFound(_0x3b45f2,null))['then'](removeEntity(_0x3b45f2,null))[_0x523c('0x46')](handleError(_0x3b45f2,null));};exports[_0x523c('0x4c')]=function(_0x3a77da,_0x28cef5){return db[_0x523c('0x2e')][_0x523c('0x4c')]()['then'](respondWithResult(_0x28cef5,null))[_0x523c('0x46')](handleError(_0x28cef5,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index da1d472..a021f8b 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 _0xd51e=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','moment','request-promise','rimraf','../../config/environment'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xd51e,0x1bc));var _0xed51=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0xd51e[_0x1e7ead];return _0x3912b2;};'use strict';var _=require(_0xed51('0x0'));var util=require(_0xed51('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xed51('0x2'));var BPromise=require('bluebird');var rp=require(_0xed51('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed51('0x4'));var config=require(_0xed51('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0xed51('0x6')]=function(_0x3a7010,_0x5da8da){return _0x3a7010['define'](_0xed51('0x7'),attributes,{'tableName':_0xed51('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xed51('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x827e=['report_chat_transfer','lodash','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x312bf4,_0x352f71){var _0x1a4303=function(_0x29a668){while(--_0x29a668){_0x312bf4['push'](_0x312bf4['shift']());}};_0x1a4303(++_0x352f71);}(_0x827e,0x1b9));var _0xe827=function(_0x2607a1,_0x3b7944){_0x2607a1=_0x2607a1-0x0;var _0x57c25e=_0x827e[_0x2607a1];return _0x57c25e;};'use strict';var _=require(_0xe827('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe827('0x1'));var moment=require(_0xe827('0x2'));var BPromise=require(_0xe827('0x3'));var rp=require(_0xe827('0x4'));var fs=require('fs');var path=require(_0xe827('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe827('0x6'));module[_0xe827('0x7')]=function(_0x5a3e66,_0x3851d9){return _0x5a3e66[_0xe827('0x8')](_0xe827('0x9'),attributes,{'tableName':_0xe827('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1691cf2..1d2f294 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 _0x18eb=['error','code','ChatTransferReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x18eb,0x10f));var _0xb18e=function(_0xa8ca7,_0x456ca6){_0xa8ca7=_0xa8ca7-0x0;var _0x1b40d4=_0x18eb[_0xa8ca7];return _0x1b40d4;};'use strict';var _=require('lodash');var util=require(_0xb18e('0x0'));var moment=require(_0xb18e('0x1'));var BPromise=require(_0xb18e('0x2'));var rs=require(_0xb18e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb18e('0x4'));var logger=require(_0xb18e('0x5'))('rpc');var config=require(_0xb18e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb18e('0x7')][_0xb18e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26f98f,_0x40b232,_0x1e9f07){return new BPromise(function(_0x39db30,_0x527067){return client[_0xb18e('0x9')](_0x26f98f,_0x1e9f07)[_0xb18e('0xa')](function(_0x26fe6c){logger[_0xb18e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x40b232,_0xb18e('0xc'));logger['debug'](_0xb18e('0xd'),_0x40b232,'request\x20sent',JSON['stringify'](_0x26fe6c));if(_0x26fe6c[_0xb18e('0xe')]){if(_0x26fe6c[_0xb18e('0xe')][_0xb18e('0xf')]===0x1f4){logger[_0xb18e('0xe')](_0xb18e('0x10'),_0x40b232,_0x26fe6c[_0xb18e('0xe')][_0xb18e('0x11')]);return _0x527067(_0x26fe6c[_0xb18e('0xe')][_0xb18e('0x11')]);}logger[_0xb18e('0xe')](_0xb18e('0x10'),_0x40b232,_0x26fe6c['error'][_0xb18e('0x11')]);return _0x39db30(_0x26fe6c[_0xb18e('0xe')][_0xb18e('0x11')]);}else{logger[_0xb18e('0xb')](_0xb18e('0x10'),_0x40b232,_0xb18e('0xc'));_0x39db30(_0x26fe6c[_0xb18e('0x12')][_0xb18e('0x11')]);}})['catch'](function(_0x759683){logger[_0xb18e('0xe')](_0xb18e('0x10'),_0x40b232,_0x759683);_0x527067(_0x759683);});});} \ No newline at end of file +var _0x54eb=['client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','../../config/utils','rpc','../../config/environment'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x54eb,0x1a4));var _0xb54e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x54eb[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb54e('0x0'));var BPromise=require(_0xb54e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb54e('0x2'));var logger=require('../../config/logger')(_0xb54e('0x3'));var config=require(_0xb54e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb54e('0x5')][_0xb54e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4e26ad,_0xc395d3,_0x4a91fc){return new BPromise(function(_0x34d4ce,_0x24360b){return client[_0xb54e('0x7')](_0x4e26ad,_0x4a91fc)[_0xb54e('0x8')](function(_0x1562db){logger[_0xb54e('0x9')](_0xb54e('0xa'),_0xc395d3,_0xb54e('0xb'));logger[_0xb54e('0xc')](_0xb54e('0xd'),_0xc395d3,_0xb54e('0xb'),JSON[_0xb54e('0xe')](_0x1562db));if(_0x1562db[_0xb54e('0xf')]){if(_0x1562db['error']['code']===0x1f4){logger[_0xb54e('0xf')](_0xb54e('0xa'),_0xc395d3,_0x1562db['error'][_0xb54e('0x10')]);return _0x24360b(_0x1562db[_0xb54e('0xf')][_0xb54e('0x10')]);}logger[_0xb54e('0xf')](_0xb54e('0xa'),_0xc395d3,_0x1562db['error'][_0xb54e('0x10')]);return _0x34d4ce(_0x1562db[_0xb54e('0xf')]['message']);}else{logger[_0xb54e('0x9')](_0xb54e('0xa'),_0xc395d3,_0xb54e('0xb'));_0x34d4ce(_0x1562db['result'][_0xb54e('0x10')]);}})['catch'](function(_0x15e95d){logger[_0xb54e('0xf')](_0xb54e('0xa'),_0xc395d3,_0x15e95d);_0x24360b(_0x15e95d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index bc410e7..79c51c7 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 _0x65bc=['/describe','describe','/:id','show','post','create','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get'];(function(_0x2993dd,_0xd88e7d){var _0x3814b2=function(_0x5b1a41){while(--_0x5b1a41){_0x2993dd['push'](_0x2993dd['shift']());}};_0x3814b2(++_0xd88e7d);}(_0x65bc,0x1c8));var _0xc65b=function(_0x2383b3,_0xa31137){_0x2383b3=_0x2383b3-0x0;var _0xc10b13=_0x65bc[_0x2383b3];return _0xc10b13;};'use strict';var multer=require(_0xc65b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc65b('0x1'));var express=require(_0xc65b('0x2'));var router=express[_0xc65b('0x3')]();var fs_extra=require(_0xc65b('0x4'));var auth=require(_0xc65b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc65b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc65b('0x7')](_0xc65b('0x8'),auth['isAuthenticated'](),controller[_0xc65b('0x9')]);router[_0xc65b('0x7')](_0xc65b('0xa'),auth['isAuthenticated'](),controller[_0xc65b('0xb')]);router[_0xc65b('0xc')]('/',auth['isAuthenticated'](),controller[_0xc65b('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc65b('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc65b('0xf')]);module['exports']=router; \ No newline at end of file +var _0xca11=['destroy','multer','util','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','put','update','delete'];(function(_0x5d035a,_0x150506){var _0x3a530f=function(_0x13c18d){while(--_0x13c18d){_0x5d035a['push'](_0x5d035a['shift']());}};_0x3a530f(++_0x150506);}(_0xca11,0x181));var _0x1ca1=function(_0x213ddd,_0x615a2){_0x213ddd=_0x213ddd-0x0;var _0x56522d=_0xca11[_0x213ddd];return _0x56522d;};'use strict';var multer=require(_0x1ca1('0x0'));var util=require(_0x1ca1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1ca1('0x2'));var router=express[_0x1ca1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ca1('0x4'));var config=require(_0x1ca1('0x5'));var controller=require('./chatTransferReport.controller');router[_0x1ca1('0x6')]('/',auth[_0x1ca1('0x7')](),controller[_0x1ca1('0x8')]);router['get'](_0x1ca1('0x9'),auth[_0x1ca1('0x7')](),controller['describe']);router['get'](_0x1ca1('0xa'),auth[_0x1ca1('0x7')](),controller['show']);router[_0x1ca1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ca1('0xc')](_0x1ca1('0xa'),auth[_0x1ca1('0x7')](),controller[_0x1ca1('0xd')]);router[_0x1ca1('0xe')](_0x1ca1('0xa'),auth['isAuthenticated'](),controller[_0x1ca1('0xf')]);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 df61e38..57ed198 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 _0x1339=['New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','thumb','stringify','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x592307,_0x2b8719){var _0x244eb8=function(_0x3e7c78){while(--_0x3e7c78){_0x592307['push'](_0x592307['shift']());}};_0x244eb8(++_0x2b8719);}(_0x1339,0x1ed));var _0x9133=function(_0x4c4f91,_0x429a4b){_0x4c4f91=_0x4c4f91-0x0;var _0x1616bc=_0x1339[_0x4c4f91];return _0x1616bc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9133('0x0')]={'name':{'type':Sequelize[_0x9133('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'unique':_0x9133('0x2')},'description':{'type':Sequelize[_0x9133('0x1')]},'mapKey':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x3')},'mapKeyOffline':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0x9133('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':_0x9133('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':_0x9133('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':_0x9133('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':_0x9133('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9133('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9133('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9133('0x8')](_0x9133('0x9'),_0x9133('0xa')),'defaultValue':_0x9133('0x9')},'header_online':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0xc')},'offline_chat_button':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9133('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x9133('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9133('0x10')]},'closingQuestion':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0x12')},'noteTitle':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x13')},'placeholderMessage':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x9133('0x8')]('star',_0x9133('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9133('0x16')]({'items':[{'type':_0x9133('0x17'),'variable':null,'config':{'placeholder':'name','type':_0x9133('0x18'),'required':!![]},'props':{'title':_0x9133('0x19'),'helpText':''}},{'type':_0x9133('0x17'),'props':{'title':_0x9133('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9133('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9133('0x1a'))?JSON[_0x9133('0x1b')](this[_0x9133('0x1c')](_0x9133('0x1a'))):{};},'set':function(_0x4483ef){return this[_0x9133('0x1d')](_0x9133('0x1a'),JSON[_0x9133('0x16')](_0x4483ef));}},'offlineForm':{'type':Sequelize[_0x9133('0x10')],'defaultValue':function(){return JSON[_0x9133('0x16')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9133('0x3'),'type':_0x9133('0x3')},'variable':null},{'type':_0x9133('0x1e'),'config':{'placeholder':_0x9133('0x1f')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x9133('0x1c')](_0x9133('0x20'))?JSON[_0x9133('0x1b')](this[_0x9133('0x1c')](_0x9133('0x20'))):{};},'set':function(_0x88326c){return this['setDataValue']('offlineForm',JSON['stringify'](_0x88326c));}},'token':{'type':Sequelize[_0x9133('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9133('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9133('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9133('0x1')]},'waitingTitle':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x23')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x9133('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9133('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x14')},'sendUnmanaged':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x25')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9133('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9133('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9133('0x10')],'defaultValue':function(){return _0x9133('0x26');}},'notificationSound':{'type':Sequelize[_0x9133('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9133('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9133('0x2a')},'defaultTitle':{'type':Sequelize[_0x9133('0x1')]},'customerAvatar':{'type':Sequelize[_0x9133('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9133('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9133('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9133('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9133('0x1')],'defaultValue':_0x9133('0x2b')},'systemAvatar':{'type':Sequelize[_0x9133('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9133('0x7')],'comment':_0x9133('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xafd8f9){if(!_0xafd8f9)this[_0x9133('0x1d')](_0x9133('0x2d'),null);this[_0x9133('0x1d')](_0x9133('0x2e'),_0xafd8f9);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9133('0x1')]},'vidaooTopic':{'type':Sequelize[_0x9133('0x1')],'allowNull':![],'defaultValue':_0x9133('0x2f')},'vidaooNote':{'type':Sequelize[_0x9133('0x1')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x9133('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9133('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9133('0x10')]}}; \ No newline at end of file +var _0xedd9=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','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.','website_alias','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3ae34a,_0x143082){var _0x4c9edc=function(_0x2796c8){while(--_0x2796c8){_0x3ae34a['push'](_0x3ae34a['shift']());}};_0x4c9edc(++_0x143082);}(_0xedd9,0xfc));var _0x9edd=function(_0x557678,_0x4a69bd){_0x557678=_0x557678-0x0;var _0x4cc5fc=_0xedd9[_0x557678];return _0x4cc5fc;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'name':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'unique':_0x9edd('0x3')},'description':{'type':Sequelize[_0x9edd('0x2')]},'mapKey':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x4')},'key':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9edd('0x2')]},'animation':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9edd('0x9'),_0x9edd('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xb')},'start_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xc')},'offline_chat_button':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'header_offline':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9edd('0x11')]},'closingQuestion':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x13')},'noteTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x14')},'closingMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x9edd('0x16'),_0x9edd('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x9edd('0x1a'),'required':!![]},'props':{'title':_0x9edd('0x1b'),'helpText':''}},{'type':_0x9edd('0x19'),'props':{'title':_0x9edd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9edd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x1d'))?JSON[_0x9edd('0x1e')](this[_0x9edd('0x1c')](_0x9edd('0x1d'))):{};},'set':function(_0x4d507f){return this['setDataValue'](_0x9edd('0x1d'),JSON[_0x9edd('0x18')](_0x4d507f));}},'offlineForm':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return JSON[_0x9edd('0x18')]({'items':[{'type':_0x9edd('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x9edd('0x4')},'variable':null},{'type':_0x9edd('0x1f'),'config':{'placeholder':_0x9edd('0x20')},'props':{'title':'Comments','helpText':_0x9edd('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x9edd('0x1c')](_0x9edd('0x22'))?JSON[_0x9edd('0x1e')](this['getDataValue'](_0x9edd('0x22'))):{};},'set':function(_0x3fb556){return this[_0x9edd('0x23')](_0x9edd('0x22'),JSON[_0x9edd('0x18')](_0x3fb556));}},'token':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return rs[_0x9edd('0x24')]();}},'autoclose':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9edd('0x2')]},'forwardOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9edd('0x2')]},'waitingTitle':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9edd('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x29')},'skipUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x15')},'sendUnmanaged':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9edd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9edd('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2b')},'messagesAlignment':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2c')},'defaultTitle':{'type':Sequelize[_0x9edd('0x2')]},'customerAvatar':{'type':Sequelize[_0x9edd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9edd('0xf')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':_0x9edd('0x2d')},'systemAvatar':{'type':Sequelize[_0x9edd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x9edd('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x9edd('0x8')],'defaultValue':![],'comment':_0x9edd('0x2f'),'set':function(_0x48958a){if(!_0x48958a)this[_0x9edd('0x23')]('mandatoryDispositionPauseId',null);this[_0x9edd('0x23')](_0x9edd('0x30'),_0x48958a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9edd('0x2')]},'vidaooTopic':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![],'defaultValue':_0x9edd('0x31')},'vidaooNote':{'type':Sequelize[_0x9edd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x9edd('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9edd('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ac3bc8a..6d9b875 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 _0xa566=['addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','html-to-text','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','merge','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','ValidationError','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','applications','list','orderBy','priority','asc','account','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','server','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','findOne','Contact','internal','Tags','color','tag','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','connection','virtual','replace','verticalAlignment','labelText','textButtonColor','color_button','backgroundColor'];(function(_0x20c0ec,_0x5d2ed9){var _0x8f2063=function(_0x1cf74d){while(--_0x1cf74d){_0x20c0ec['push'](_0x20c0ec['shift']());}};_0x8f2063(++_0x5d2ed9);}(_0xa566,0x143));var _0x6a56=function(_0x220ed1,_0x2db6bc){_0x220ed1=_0x220ed1-0x0;var _0x158652=_0xa566[_0x220ed1];return _0x158652;};'use strict';var BPromise=require(_0x6a56('0x0'));var Mustache=require('mustache');var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var ejs=require(_0x6a56('0x3'));var fs=require('fs');var fs_extra=require(_0x6a56('0x4'));var _=require(_0x6a56('0x5'));var querystring=require(_0x6a56('0x6'));var Redis=require('ioredis');var qs=require(_0x6a56('0x7'));var logger=require(_0x6a56('0x8'))(_0x6a56('0x9'));var config=require(_0x6a56('0xa'));var url=require('url');var db=require(_0x6a56('0xb'))['db'];config['redis']=_['defaults'](config[_0x6a56('0xc')],{'host':_0x6a56('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a56('0xc')]));require(_0x6a56('0xe'))['register'](socket);var htmlToText=require(_0x6a56('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x6a56('0x10')][_0x6a56('0x11')]({'port':0x232c});var client9002=jayson[_0x6a56('0x10')][_0x6a56('0x11')]({'port':0x232a});var client9003=jayson[_0x6a56('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x6a56('0x10')][_0x6a56('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x16c8b4,_0x379b75,_0x514945,_0x21cd4b){return new BPromise(function(_0x4b8332,_0x19a801){var _0x42f408=_0x21cd4b||client;return _0x42f408[_0x6a56('0x12')](_0x16c8b4,_0x514945)[_0x6a56('0x13')](function(_0x1ee6ea){logger['info'](_0x6a56('0x14'),_0x379b75,_0x6a56('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x379b75,_0x6a56('0x15'),JSON[_0x6a56('0x16')](_0x1ee6ea));if(_0x1ee6ea[_0x6a56('0x17')]){if(_0x1ee6ea[_0x6a56('0x17')][_0x6a56('0x18')]===0x1f4){logger['error'](_0x6a56('0x14'),_0x379b75,_0x1ee6ea['error'][_0x6a56('0x19')]);return _0x19a801(_0x1ee6ea[_0x6a56('0x17')][_0x6a56('0x19')]);}logger[_0x6a56('0x17')](_0x6a56('0x14'),_0x379b75,_0x1ee6ea[_0x6a56('0x17')][_0x6a56('0x19')]);return _0x4b8332(_0x1ee6ea[_0x6a56('0x17')][_0x6a56('0x19')]);}else{logger[_0x6a56('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x379b75,_0x6a56('0x15'));_0x4b8332(_0x1ee6ea[_0x6a56('0x1b')][_0x6a56('0x19')]);}})[_0x6a56('0x1c')](function(_0x3b2e11){logger[_0x6a56('0x17')](_0x6a56('0x14'),_0x379b75,_0x3b2e11);_0x19a801(_0x3b2e11);});});}function respondWithStatusCode(_0x5b8385,_0x49200c){_0x49200c=_0x49200c||0xcc;return function(_0x40c5df){if(_0x40c5df){return _0x5b8385[_0x6a56('0x1d')](_0x49200c);}return _0x5b8385[_0x6a56('0x1e')](_0x49200c)[_0x6a56('0x1f')]();};}function respondWithResult(_0x28da22,_0x337732){_0x337732=_0x337732||0xc8;return function(_0x50e1dc){if(_0x50e1dc){return _0x28da22['status'](_0x337732)[_0x6a56('0x20')](_0x50e1dc);}};}function respondWithFilteredResult(_0x20acaa,_0x51697a){return function(_0x10d4e5){if(_0x10d4e5){var _0x3e06e4=typeof _0x51697a['offset']==='undefined'&&typeof _0x51697a[_0x6a56('0x21')]===_0x6a56('0x22');var _0x1deb3d=_0x10d4e5['count'];var _0x569014=_0x3e06e4?0x0:_0x51697a[_0x6a56('0x23')];var _0x11cf12=_0x3e06e4?_0x10d4e5['count']:_0x51697a[_0x6a56('0x23')]+_0x51697a[_0x6a56('0x21')];var _0x4f0aa2;if(_0x11cf12>=_0x1deb3d){_0x11cf12=_0x1deb3d;_0x4f0aa2=0xc8;}else{_0x4f0aa2=0xce;}_0x20acaa[_0x6a56('0x1e')](_0x4f0aa2);return _0x20acaa[_0x6a56('0x24')](_0x6a56('0x25'),_0x569014+'-'+_0x11cf12+'/'+_0x1deb3d)[_0x6a56('0x20')](_0x10d4e5);}return null;};}function saveUpdates(_0x12c437){return function(_0x3872b2){if(_0x3872b2){return _0x3872b2[_0x6a56('0x26')](_0x12c437)[_0x6a56('0x13')](function(_0x11c391){return _0x11c391;});}return null;};}function removeEntity(_0x47f8ae){return function(_0x584ffd){if(_0x584ffd){return _0x584ffd[_0x6a56('0x27')]()[_0x6a56('0x13')](function(){var _0x43d319=_0x584ffd[_0x6a56('0x28')]({'plain':!![]});var _0x3b9690=_0x6a56('0x29');return db[_0x6a56('0x2a')]['destroy']({'where':{'type':_0x3b9690,'resourceId':_0x43d319['id']}})[_0x6a56('0x13')](function(){return _0x584ffd;});})[_0x6a56('0x13')](function(){_0x47f8ae[_0x6a56('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c47f4){return function(_0x3b7b5e){if(!_0x3b7b5e){_0x2c47f4['sendStatus'](0x194);}return _0x3b7b5e;};}function handleError(_0x360b79,_0x5030a9){_0x5030a9=_0x5030a9||0x1f4;return function(_0x2b0375){logger[_0x6a56('0x17')](_0x2b0375[_0x6a56('0x2b')]);if(_0x2b0375[_0x6a56('0x2c')]){delete _0x2b0375['name'];}_0x360b79[_0x6a56('0x1e')](_0x5030a9)[_0x6a56('0x2d')](_0x2b0375);};}exports[_0x6a56('0x2e')]=function(_0x3b4db1,_0x50524c){var _0x305991={'include':[{'model':db[_0x6a56('0x2f')],'as':_0x6a56('0x30')}]},_0x3be1af={},_0x3f882b={'count':0x0,'rows':[]};var _0xc65e6b=_[_0x6a56('0x31')](db[_0x6a56('0x32')][_0x6a56('0x33')],function(_0x244fc4){return{'name':_0x244fc4[_0x6a56('0x34')],'type':_0x244fc4[_0x6a56('0x35')][_0x6a56('0x36')]};});_0x3be1af[_0x6a56('0x37')]=_[_0x6a56('0x31')](_0xc65e6b,_0x6a56('0x2c'));_0x3be1af['query']=_[_0x6a56('0x38')](_0x3b4db1['query']);_0x3be1af[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x3be1af[_0x6a56('0x37')],_0x3be1af[_0x6a56('0x3b')]);_0x305991['attributes']=_['intersection'](_0x3be1af[_0x6a56('0x37')],qs['fields'](_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x3c')]));_0x305991['attributes']=_0x305991[_0x6a56('0x3d')]['length']?_0x305991[_0x6a56('0x3d')]:_0x3be1af[_0x6a56('0x37')];if(!_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x3e')](_0x6a56('0x3f'))){_0x305991[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x21')]);_0x305991[_0x6a56('0x23')]=qs['offset'](_0x3b4db1['query']['offset']);}_0x305991[_0x6a56('0x40')]=qs[_0x6a56('0x41')](_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x305991['where']=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x3b4db1['query'],_0x3be1af['filters']),_0xc65e6b);if(_0x3b4db1['query'][_0x6a56('0x43')]){_0x305991[_0x6a56('0x44')]=_['merge'](_0x305991[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0xc65e6b,function(_0x3b0ad5){if(_0x3b0ad5[_0x6a56('0x35')]!==_0x6a56('0x45')){var _0x5c6712={};_0x5c6712[_0x3b0ad5[_0x6a56('0x2c')]]={'$like':'%'+_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x5c6712;}})});}_0x305991=_['merge']({},_0x305991,_0x3b4db1[_0x6a56('0x46')]);var _0x42f1c9={'where':_0x305991[_0x6a56('0x44')]};return db[_0x6a56('0x32')]['count'](_0x42f1c9)[_0x6a56('0x13')](function(_0x14826f){_0x3f882b[_0x6a56('0x47')]=_0x14826f;if(_0x3b4db1[_0x6a56('0x3b')][_0x6a56('0x48')]){_0x305991[_0x6a56('0x49')]=[{'all':!![]}];}return db[_0x6a56('0x32')][_0x6a56('0x4a')](_0x305991);})[_0x6a56('0x13')](function(_0x2008fe){_0x3f882b[_0x6a56('0x4b')]=_0x2008fe;return _0x3f882b;})['then'](respondWithFilteredResult(_0x50524c,_0x305991))[_0x6a56('0x1c')](handleError(_0x50524c,null));};exports[_0x6a56('0x4c')]=function(_0x173e26,_0x4f0437){var _0x3fdebd={'raw':![],'where':{'id':_0x173e26[_0x6a56('0x4d')]['id']},'include':[{'model':db[_0x6a56('0x2f')],'as':_0x6a56('0x30')}]},_0x232111={};_0x232111[_0x6a56('0x37')]=_[_0x6a56('0x38')](db[_0x6a56('0x32')]['rawAttributes']);_0x232111[_0x6a56('0x3b')]=_[_0x6a56('0x38')](_0x173e26[_0x6a56('0x3b')]);_0x232111[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x232111[_0x6a56('0x37')],_0x232111['query']);_0x3fdebd['attributes']=_['intersection'](_0x232111[_0x6a56('0x37')],qs['fields'](_0x173e26[_0x6a56('0x3b')]['fields']));_0x3fdebd[_0x6a56('0x3d')]=_0x3fdebd[_0x6a56('0x3d')][_0x6a56('0x4e')]?_0x3fdebd[_0x6a56('0x3d')]:_0x232111['model'];if(_0x173e26[_0x6a56('0x3b')][_0x6a56('0x48')]){_0x3fdebd[_0x6a56('0x49')]=[{'all':!![]}];}_0x3fdebd=_['merge']({},_0x3fdebd,_0x173e26['options']);return db[_0x6a56('0x32')][_0x6a56('0x4f')](_0x3fdebd)[_0x6a56('0x13')](handleEntityNotFound(_0x4f0437,null))[_0x6a56('0x13')](respondWithResult(_0x4f0437,null))[_0x6a56('0x1c')](handleError(_0x4f0437,null));};exports[_0x6a56('0x50')]=function(_0x2a9c8f,_0x507355){return db[_0x6a56('0x32')][_0x6a56('0x50')](_0x2a9c8f['body'],{})[_0x6a56('0x13')](function(_0x533316){var _0x2ddb72=_0x2a9c8f[_0x6a56('0x51')][_0x6a56('0x28')]({'plain':!![]});if(!_0x2ddb72)throw new Error(_0x6a56('0x52'));if(_0x2ddb72['role']===_0x6a56('0x51')){var _0x248d5f=_0x533316[_0x6a56('0x28')]({'plain':!![]});var _0x5d5985=_0x6a56('0x29');return db[_0x6a56('0x53')][_0x6a56('0x4f')]({'where':{'name':_0x5d5985,'userProfileId':_0x2ddb72[_0x6a56('0x54')]},'raw':!![]})[_0x6a56('0x13')](function(_0x2b65bc){if(_0x2b65bc&&_0x2b65bc[_0x6a56('0x55')]===0x0){return db[_0x6a56('0x2a')][_0x6a56('0x50')]({'name':_0x248d5f[_0x6a56('0x2c')],'resourceId':_0x248d5f['id'],'type':_0x2b65bc[_0x6a56('0x2c')],'sectionId':_0x2b65bc['id']},{})[_0x6a56('0x13')](function(){return _0x533316;});}else{return _0x533316;}})['catch'](function(_0x348349){logger['error'](_0x6a56('0x56'),_0x348349);throw _0x348349;});}return _0x533316;})[_0x6a56('0x13')](respondWithResult(_0x507355,0xc9))['catch'](handleError(_0x507355,null));};exports[_0x6a56('0x26')]=function(_0x566766,_0x506823){if(_0x566766['body']['id']){delete _0x566766[_0x6a56('0x57')]['id'];}return db['ChatWebsite'][_0x6a56('0x4f')]({'where':{'id':_0x566766[_0x6a56('0x4d')]['id']},'include':[{'model':db[_0x6a56('0x2f')],'as':_0x6a56('0x30')}]})['then'](handleEntityNotFound(_0x506823,null))[_0x6a56('0x13')](saveUpdates(_0x566766[_0x6a56('0x57')],null))[_0x6a56('0x13')](respondWithResult(_0x506823,null))[_0x6a56('0x1c')](handleError(_0x506823,null));};exports[_0x6a56('0x27')]=function(_0x38fd12,_0x4e33b9){return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x38fd12[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x4e33b9,null))[_0x6a56('0x13')](removeEntity(_0x4e33b9,null))[_0x6a56('0x1c')](handleError(_0x4e33b9,null));};exports[_0x6a56('0x58')]=function(_0x23b88c,_0x211904){return db[_0x6a56('0x32')][_0x6a56('0x58')]()[_0x6a56('0x13')](respondWithResult(_0x211904,null))[_0x6a56('0x1c')](handleError(_0x211904,null));};exports[_0x6a56('0x59')]=function(_0x4d5e86,_0x561426){if(_0x4d5e86[_0x6a56('0x57')]['id']){delete _0x4d5e86[_0x6a56('0x57')]['id'];}return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x4d5e86[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x561426,null))[_0x6a56('0x13')](function(_0x51c1ca){if(_0x51c1ca){_0x4d5e86[_0x6a56('0x57')][_0x6a56('0x5a')]=_0x51c1ca['id'];return db[_0x6a56('0x5b')]['create'](_0x4d5e86[_0x6a56('0x57')]);}})[_0x6a56('0x13')](respondWithResult(_0x561426,null))[_0x6a56('0x1c')](handleError(_0x561426,null));};exports[_0x6a56('0x5c')]=function(_0x1d02f5,_0x423108){var _0xb8d8cc={'raw':![],'where':{}};var _0x3e051f={};var _0x2d470d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x1d02f5[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x423108,null))[_0x6a56('0x13')](function(_0x4a47af){if(_0x4a47af){_0x3e051f[_0x6a56('0x37')]=_['keys'](db[_0x6a56('0x5b')]['rawAttributes']);_0x3e051f[_0x6a56('0x3b')]=_['keys'](_0x1d02f5[_0x6a56('0x3b')]);_0x3e051f[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x3e051f[_0x6a56('0x37')],_0x3e051f[_0x6a56('0x3b')]);_0xb8d8cc[_0x6a56('0x3d')]=_['intersection'](_0x3e051f[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x1d02f5[_0x6a56('0x3b')]['fields']));_0xb8d8cc[_0x6a56('0x3d')]=_0xb8d8cc['attributes'][_0x6a56('0x4e')]?_0xb8d8cc[_0x6a56('0x3d')]:_0x3e051f['model'];if(!_0x1d02f5['query'][_0x6a56('0x3e')](_0x6a56('0x3f'))){_0xb8d8cc[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x1d02f5[_0x6a56('0x3b')][_0x6a56('0x21')]);_0xb8d8cc['offset']=qs[_0x6a56('0x23')](_0x1d02f5[_0x6a56('0x3b')][_0x6a56('0x23')]);}_0xb8d8cc[_0x6a56('0x40')]=qs[_0x6a56('0x41')](_0x1d02f5[_0x6a56('0x3b')][_0x6a56('0x41')]);_0xb8d8cc[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x1d02f5[_0x6a56('0x3b')],_0x3e051f[_0x6a56('0x39')]));_0xb8d8cc[_0x6a56('0x44')][_0x6a56('0x5a')]=_0x4a47af['id'];if(_0x1d02f5['query']['filter']){_0xb8d8cc[_0x6a56('0x44')]=_[_0x6a56('0x5d')](_0xb8d8cc[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0xb8d8cc[_0x6a56('0x3d')],function(_0x475c41){var _0x4d6ed9={};_0x4d6ed9[_0x475c41]={'$like':'%'+_0x1d02f5[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x4d6ed9;})});}_0xb8d8cc=_[_0x6a56('0x5d')]({},_0xb8d8cc,_0x1d02f5[_0x6a56('0x46')]);return db[_0x6a56('0x5b')][_0x6a56('0x47')]({'where':_0xb8d8cc[_0x6a56('0x44')]})[_0x6a56('0x13')](function(_0x509973){_0x2d470d['count']=_0x509973;if(_0x1d02f5['query'][_0x6a56('0x48')]){_0xb8d8cc[_0x6a56('0x49')]=[{'all':!![]}];}return db['Disposition'][_0x6a56('0x4a')](_0xb8d8cc);})[_0x6a56('0x13')](function(_0x35a71c){_0x2d470d[_0x6a56('0x4b')]=_0x35a71c;return _0x2d470d;});}})['then'](respondWithFilteredResult(_0x423108,_0xb8d8cc))[_0x6a56('0x1c')](handleError(_0x423108,null));};exports['removeDispositions']=function(_0x2b409b,_0x507359){return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x2b409b['params']['id']}})['then'](handleEntityNotFound(_0x507359,null))[_0x6a56('0x13')](function(_0x1af720){if(_0x1af720){return _0x1af720['removeDispositions'](_0x2b409b['query'][_0x6a56('0x5e')]);}})[_0x6a56('0x13')](respondWithStatusCode(_0x507359,null))['catch'](handleError(_0x507359,null));};exports[_0x6a56('0x5f')]=function(_0x57d0f5,_0x16ebcf){if(_0x57d0f5[_0x6a56('0x57')]['id']){delete _0x57d0f5[_0x6a56('0x57')]['id'];}return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x57d0f5[_0x6a56('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16ebcf,null))[_0x6a56('0x13')](function(_0x325e8c){if(_0x325e8c){_0x57d0f5[_0x6a56('0x57')]['ChatWebsiteId']=_0x325e8c['id'];return db[_0x6a56('0x60')][_0x6a56('0x50')](_0x57d0f5[_0x6a56('0x57')]);}})[_0x6a56('0x13')](respondWithResult(_0x16ebcf,null))[_0x6a56('0x1c')](handleError(_0x16ebcf,null));};exports['getAnswers']=function(_0x14b10b,_0x17af74){var _0x51709={'raw':![],'where':{}};var _0x48e475={};var _0x51c7ab={'count':0x0,'rows':[]};return db[_0x6a56('0x32')]['findOne']({'where':{'id':_0x14b10b[_0x6a56('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17af74,null))[_0x6a56('0x13')](function(_0x46d90d){if(_0x46d90d){_0x48e475[_0x6a56('0x37')]=_[_0x6a56('0x38')](db[_0x6a56('0x60')][_0x6a56('0x33')]);_0x48e475[_0x6a56('0x3b')]=_[_0x6a56('0x38')](_0x14b10b['query']);_0x48e475[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x48e475[_0x6a56('0x37')],_0x48e475[_0x6a56('0x3b')]);_0x51709['attributes']=_[_0x6a56('0x3a')](_0x48e475[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x14b10b[_0x6a56('0x3b')]['fields']));_0x51709[_0x6a56('0x3d')]=_0x51709[_0x6a56('0x3d')][_0x6a56('0x4e')]?_0x51709[_0x6a56('0x3d')]:_0x48e475['model'];if(!_0x14b10b['query'][_0x6a56('0x3e')](_0x6a56('0x3f'))){_0x51709[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x14b10b[_0x6a56('0x3b')][_0x6a56('0x21')]);_0x51709[_0x6a56('0x23')]=qs[_0x6a56('0x23')](_0x14b10b[_0x6a56('0x3b')]['offset']);}_0x51709[_0x6a56('0x40')]=qs[_0x6a56('0x41')](_0x14b10b[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x51709[_0x6a56('0x44')]=qs['filters'](_[_0x6a56('0x42')](_0x14b10b[_0x6a56('0x3b')],_0x48e475['filters']));_0x51709[_0x6a56('0x44')][_0x6a56('0x5a')]=_0x46d90d['id'];if(_0x14b10b['query']['filter']){_0x51709['where']=_[_0x6a56('0x5d')](_0x51709[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x51709[_0x6a56('0x3d')],function(_0x7fba00){var _0x38b63e={};_0x38b63e[_0x7fba00]={'$like':'%'+_0x14b10b[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x38b63e;})});}_0x51709=_[_0x6a56('0x5d')]({},_0x51709,_0x14b10b[_0x6a56('0x46')]);return db[_0x6a56('0x60')][_0x6a56('0x47')]({'where':_0x51709[_0x6a56('0x44')]})[_0x6a56('0x13')](function(_0x53c7d1){_0x51c7ab[_0x6a56('0x47')]=_0x53c7d1;if(_0x14b10b[_0x6a56('0x3b')][_0x6a56('0x48')]){_0x51709['include']=[{'all':!![]}];}return db[_0x6a56('0x60')]['findAll'](_0x51709);})[_0x6a56('0x13')](function(_0x490eac){_0x51c7ab[_0x6a56('0x4b')]=_0x490eac;return _0x51c7ab;});}})[_0x6a56('0x13')](respondWithFilteredResult(_0x17af74,_0x51709))[_0x6a56('0x1c')](handleError(_0x17af74,null));};exports['removeAnswers']=function(_0x5f0df3,_0x3f3547){return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x5f0df3[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x3f3547,null))['then'](function(_0x363d92){if(_0x363d92){return _0x363d92[_0x6a56('0x61')](_0x5f0df3[_0x6a56('0x3b')]['ids']);}})[_0x6a56('0x13')](respondWithStatusCode(_0x3f3547,null))[_0x6a56('0x1c')](handleError(_0x3f3547,null));};exports[_0x6a56('0x62')]=function(_0x1b4626,_0x49d923){_0x1b4626['body'][_0x6a56('0x63')]=_0x1b4626[_0x6a56('0x64')][_0x6a56('0x65')];return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x1b4626[_0x6a56('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49d923,null))['then'](saveUpdates(_0x1b4626[_0x6a56('0x57')],null))[_0x6a56('0x13')](respondWithResult(_0x49d923,null))[_0x6a56('0x1c')](handleError(_0x49d923,null));};exports[_0x6a56('0x66')]=function(_0x258729,_0x1a76ac){_0x258729[_0x6a56('0x57')][_0x6a56('0x67')]=_0x258729[_0x6a56('0x64')]['filename'];return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x258729[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x1a76ac,null))['then'](saveUpdates(_0x258729[_0x6a56('0x57')],null))[_0x6a56('0x13')](respondWithResult(_0x1a76ac,null))[_0x6a56('0x1c')](handleError(_0x1a76ac,null));};exports['addCustomerAvatar']=function(_0x481ad6,_0x2229ae){_0x481ad6[_0x6a56('0x57')][_0x6a56('0x68')]=_0x481ad6[_0x6a56('0x64')]['filename'];return db['ChatWebsite'][_0x6a56('0x4f')]({'where':{'id':_0x481ad6[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x2229ae,null))['then'](saveUpdates(_0x481ad6[_0x6a56('0x57')],null))['then'](respondWithResult(_0x2229ae,null))[_0x6a56('0x1c')](handleError(_0x2229ae,null));};exports[_0x6a56('0x69')]=function(_0xa456b4,_0x205d40){_0xa456b4[_0x6a56('0x57')][_0x6a56('0x6a')]=_0xa456b4[_0x6a56('0x64')]['filename'];return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0xa456b4[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x205d40,null))['then'](saveUpdates(_0xa456b4[_0x6a56('0x57')],null))['then'](respondWithResult(_0x205d40,null))[_0x6a56('0x1c')](handleError(_0x205d40,null));};exports[_0x6a56('0x6b')]=function(_0x24d5c3,_0x4d1a6e){var _0x5d275f=path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0x6e'));var _0x41e9db={'where':{'id':_0x24d5c3[_0x6a56('0x4d')]['id']},'attributes':['id',_0x6a56('0x63')],'raw':!![]};var _0x5cc5e9=![];return require(_0x6a56('0x6f'))['getLicense']()[_0x6a56('0x13')](function(_0x5129b0){if(_0x5129b0){_0x5cc5e9=_0x5129b0[_0x6a56('0x70')];}})[_0x6a56('0x13')](function(){return db[_0x6a56('0x32')]['find'](_0x41e9db);})[_0x6a56('0x13')](handleEntityNotFound(_0x4d1a6e,null))[_0x6a56('0x13')](function(_0x223e8e){if(_0x223e8e){if(!_[_0x6a56('0x71')](_0x223e8e[_0x6a56('0x63')])){if(fs['existsSync'](path['join'](config['root'],_0x6a56('0x72'),_0x223e8e[_0x6a56('0x63')]))&&_0x5cc5e9){_0x5d275f=path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0x72'),_0x223e8e['sitepic']);}}return _0x4d1a6e[_0x6a56('0x73')](_0x5d275f);}})[_0x6a56('0x1c')](handleError(_0x4d1a6e,null));};exports[_0x6a56('0x74')]=function(_0x5c08c8,_0x1f39c2){var _0x19adea=path['join'](config[_0x6a56('0x6d')],'server/files/images/avatars/default_avatar.png');var _0x6c1b8a={'where':{'id':_0x5c08c8[_0x6a56('0x4d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6a56('0x32')][_0x6a56('0x4f')](_0x6c1b8a)[_0x6a56('0x13')](handleEntityNotFound(_0x1f39c2,null))[_0x6a56('0x13')](function(_0x54deea){if(_0x54deea){if(!_[_0x6a56('0x71')](_0x54deea[_0x6a56('0x67')])){if(fs[_0x6a56('0x75')](path[_0x6a56('0x6c')](config['root'],_0x6a56('0x76'),_0x54deea[_0x6a56('0x67')]))){_0x19adea=path[_0x6a56('0x6c')](config['root'],_0x6a56('0x76'),_0x54deea[_0x6a56('0x67')]);}}return _0x1f39c2['download'](_0x19adea);}})[_0x6a56('0x1c')](handleError(_0x1f39c2,null));};exports[_0x6a56('0x77')]=function(_0x334a31,_0x53e5a0){var _0x1037dd=path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0x78'));var _0x1375e8={'where':{'id':_0x334a31[_0x6a56('0x4d')]['id']},'attributes':['id',_0x6a56('0x68'),_0x6a56('0x79')],'raw':!![]};return db[_0x6a56('0x32')][_0x6a56('0x4f')](_0x1375e8)['then'](handleEntityNotFound(_0x53e5a0,null))[_0x6a56('0x13')](function(_0x133747){if(_0x133747){if(!_[_0x6a56('0x71')](_0x133747['customerAvatar'])){if(fs[_0x6a56('0x75')](path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0x76'),_0x133747['customerAvatar']))&&_0x133747['showCustomerAvatar']){_0x1037dd=path[_0x6a56('0x6c')](config['root'],_0x6a56('0x76'),_0x133747[_0x6a56('0x68')]);}}return _0x53e5a0[_0x6a56('0x73')](_0x1037dd);}})['catch'](handleError(_0x53e5a0,null));};exports[_0x6a56('0x7a')]=function(_0x3ea869,_0xea0176){var _0x391d73=path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0x7b'));var _0x497133={'where':{'id':_0x3ea869[_0x6a56('0x4d')]['id']},'attributes':['id',_0x6a56('0x6a')],'raw':!![]};return db[_0x6a56('0x32')][_0x6a56('0x4f')](_0x497133)[_0x6a56('0x13')](handleEntityNotFound(_0xea0176,null))[_0x6a56('0x13')](function(_0x4a598f){if(_0x4a598f){if(!_[_0x6a56('0x71')](_0x4a598f[_0x6a56('0x6a')])){if(fs[_0x6a56('0x75')](path[_0x6a56('0x6c')](config['root'],'server/files/images/avatars/',_0x4a598f[_0x6a56('0x6a')]))){_0x391d73=path[_0x6a56('0x6c')](config['root'],'server/files/images/avatars/',_0x4a598f[_0x6a56('0x6a')]);}}return _0xea0176['download'](_0x391d73);}})[_0x6a56('0x1c')](handleError(_0xea0176,null));};exports[_0x6a56('0x7c')]=function(_0x4d45b0,_0x4c2d2a){var _0x3c66c4=require(_0x6a56('0x7d'));var _0x272b9b=new _0x3c66c4();var _0x582fb9=_0x272b9b[_0x6a56('0x7e')](_0x4d45b0[_0x6a56('0x7f')][_0x6a56('0x80')])[_0x6a56('0x81')]();var _0x2f0da5={'body':_0x4d45b0[_0x6a56('0x57')],'channel':_0x6a56('0x82')};var _0x126a07=[];var _0x1dfc71=[];var _0x177ae0={};var _0x5ce25d=![];return db[_0x6a56('0x83')][_0x6a56('0x58')]()[_0x6a56('0x13')](function(_0x48fa5d){if(!_0x48fa5d){throw new db[(_0x6a56('0x84'))]['ValidationError'](_0x6a56('0x85'));}_0x126a07=_[_0x6a56('0x86')](_['keys'](_0x48fa5d),[_0x6a56('0x87'),_0x6a56('0x88')]);_0x1dfc71=_[_0x6a56('0x86')](_['keys'](_0x48fa5d),['createdAt',_0x6a56('0x88'),'CompanyId',_0x6a56('0x89')]);if(_0x4d45b0[_0x6a56('0x57')]['id']){delete _0x4d45b0[_0x6a56('0x57')]['id'];}if(_[_0x6a56('0x71')](_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8a')])){throw new db[(_0x6a56('0x84'))][(_0x6a56('0x8b'))](_0x6a56('0x8c'));}if(_[_0x6a56('0x71')](_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x57')])||_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x57')]===''){throw new db[(_0x6a56('0x84'))][(_0x6a56('0x8b'))](_0x6a56('0x8d'));}if(_['isNil'](_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8e')])){throw new db['Sequelize'][(_0x6a56('0x8b'))](_0x6a56('0x8f')+_0x1dfc71);}if(!_[_0x6a56('0x90')](_0x1dfc71,_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8e')])){throw new db[(_0x6a56('0x84'))]['ValidationError'](_0x6a56('0x91')+_0x1dfc71);}_0x177ae0[_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8e')]]=_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8a')];})[_0x6a56('0x13')](function(){return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x4d45b0[_0x6a56('0x4d')]['id']},'include':[{'model':db[_0x6a56('0x92')],'as':_0x6a56('0x93'),'include':[{'model':db[_0x6a56('0x83')],'as':_0x6a56('0x94'),'where':_0x177ae0,'limit':0x1,'order':[[_0x6a56('0x88'),'DESC']]}]},{'model':db[_0x6a56('0x95')],'as':_0x6a56('0x96')}]});})['then'](handleEntityNotFound(_0x4c2d2a,null))[_0x6a56('0x13')](function(_0x925cd9){if(_0x925cd9&&_0x925cd9['List']){_0x2f0da5['account']=_0x925cd9;_0x2f0da5[_0x6a56('0x97')]=_0x925cd9[_0x6a56('0x96')];_0x2f0da5[_0x6a56('0x98')]=_0x925cd9[_0x6a56('0x93')];_0x2f0da5[_0x6a56('0x97')]=_[_0x6a56('0x99')](_0x2f0da5[_0x6a56('0x97')],[_0x6a56('0x9a')],[_0x6a56('0x9b')]);if(_0x2f0da5[_0x6a56('0x9c')][_0x6a56('0x96')]){delete _0x2f0da5[_0x6a56('0x9c')][_0x6a56('0x96')];}if(_0x2f0da5[_0x6a56('0x9c')][_0x6a56('0x93')]&&_0x2f0da5[_0x6a56('0x9c')]['List']['Contacts']['length']){return _0x2f0da5[_0x6a56('0x9c')][_0x6a56('0x93')][_0x6a56('0x94')][0x0];}var _0xf57998=_[_0x6a56('0x9d')](_0x4d45b0[_0x6a56('0x57')],{'firstName':_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8a')],'ListId':_0x925cd9['ListId']});_0xf57998[_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x8e')]]=_0x4d45b0['body']['from'];return db[_0x6a56('0x83')][_0x6a56('0x50')](_0xf57998,{'fields':_0x126a07,'raw':!![]});}})[_0x6a56('0x13')](handleEntityNotFound(_0x4c2d2a,null))[_0x6a56('0x13')](function(_0x58e452){_0x2f0da5[_0x6a56('0x9e')]=_0x58e452;var _0xefdf95=_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x9f')];if(_0x4d45b0[_0x6a56('0x7f')][_0x6a56('0xa0')]){_0xefdf95=_0x4d45b0[_0x6a56('0x7f')]['cf-connecting-ip'];}else if(_0x4d45b0['headers']['x-forwarded-for']){_0xefdf95=_['first'](_0x4d45b0[_0x6a56('0x7f')][_0x6a56('0xa1')]['split'](','));}if(_0x58e452){var _0x1acc94={'ContactId':_0x58e452['id'],'ChatWebsiteId':_0x4d45b0[_0x6a56('0x4d')]['id'],'from':(_0x58e452[_0x6a56('0xa2')]||'')+'\x20'+(_0x58e452[_0x6a56('0xa3')]||''),'customerIp':_0xefdf95,'customerPort':_0x4d45b0[_0x6a56('0x7f')][_0x6a56('0xa4')]?_0x4d45b0[_0x6a56('0x7f')][_0x6a56('0xa4')]:null,'referer':_0x4d45b0['body'][_0x6a56('0xa5')],'browserName':_0x582fb9['browser'][_0x6a56('0x2c')]&&_0x582fb9[_0x6a56('0xa6')][_0x6a56('0xa7')]?util[_0x6a56('0xa8')](_0x6a56('0xa9'),_0x582fb9[_0x6a56('0xa6')][_0x6a56('0x2c')],_0x582fb9[_0x6a56('0xa6')]['version']):'unknown','browserVersion':_0x582fb9[_0x6a56('0xa6')][_0x6a56('0xa7')]||_0x6a56('0xaa'),'osName':util[_0x6a56('0xa8')]('%s\x20%s',_0x582fb9['os'][_0x6a56('0x2c')],_0x582fb9['os'][_0x6a56('0xa7')]),'osVersion':_0x582fb9['os'][_0x6a56('0xa7')],'deviceModel':_0x582fb9[_0x6a56('0xab')][_0x6a56('0x37')]&&_0x582fb9[_0x6a56('0xab')]['vendor']?util['format'](_0x6a56('0xac'),_0x582fb9[_0x6a56('0xab')]['model'],_0x582fb9[_0x6a56('0xab')][_0x6a56('0xad')],_0x582fb9[_0x6a56('0xab')][_0x6a56('0x35')]):null,'deviceVendor':_0x582fb9['device'][_0x6a56('0xad')],'deviceType':_0x582fb9['device'][_0x6a56('0x35')],'formData':JSON['stringify'](_0x4d45b0['body'])};var _0x462f40={'ChatWebsiteId':_0x4d45b0[_0x6a56('0x4d')]['id'],'closed':![]};if(_0x4d45b0['body'][_0x6a56('0xae')]){_0x462f40[_0x6a56('0xae')]=_0x4d45b0[_0x6a56('0x57')]['threadId'];return db[_0x6a56('0xaf')]['find']({'where':_0x462f40})[_0x6a56('0x13')](function(_0x2698e7){if(_0x2698e7){return[_0x2698e7,![]];}_0x1acc94['threadId']=_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xae')];_0x1acc94['externalUrl']=_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xb0')];return db[_0x6a56('0xaf')][_0x6a56('0x50')](_0x1acc94)['then'](function(_0x14e0cc){return[_0x14e0cc,!![]];});});}_0x462f40[_0x6a56('0xb1')]=_0x58e452['id'];if(_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xb2')]&&_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xb2')]['id']){_0x462f40['id']=_0x4d45b0['body'][_0x6a56('0xb2')]['id'];return db['ChatInteraction'][_0x6a56('0x4f')]({'where':_0x462f40})['then'](function(_0x322578){if(_0x322578){return[_0x322578,![]];}return db[_0x6a56('0xaf')][_0x6a56('0x50')](_0x1acc94)[_0x6a56('0x13')](function(_0x1a3e0a){return[_0x1a3e0a,!![]];});});}return db[_0x6a56('0xaf')][_0x6a56('0x50')](_0x1acc94)[_0x6a56('0x13')](function(_0x44a57d){return[_0x44a57d,!![]];});}})[_0x6a56('0xb3')](function(_0x4f381b,_0x4e98fa){if(_0x4f381b){_0x5ce25d=_0x4e98fa;if(!_0x4e98fa){var _0x4826a3={'from':(_0x2f0da5[_0x6a56('0x9e')]['firstName']||'')+'\x20'+(_0x2f0da5[_0x6a56('0x9e')][_0x6a56('0xa3')]||'')};if(_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xae')]&&_0x4d45b0[_0x6a56('0x57')]['messageId']&&_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xae')]!=_0x4d45b0['body']['messageId']){_0x4826a3[_0x6a56('0xae')]=_0x4d45b0[_0x6a56('0x57')][_0x6a56('0xb4')];}return _0x4f381b['update'](_0x4826a3);}else{return _0x4f381b;}}})['then'](function(_0x5c86ea){_0x2f0da5['interaction']=_0x5c86ea['get']({'plain':!![]});_0x2f0da5[_0x6a56('0xb2')][_0x6a56('0xb5')]=_0x5ce25d;if(_0x2f0da5[_0x6a56('0xb2')][_0x6a56('0xb5')]){if(_0x2f0da5['account'][_0x6a56('0xb6')]){_0x2f0da5[_0x6a56('0x97')][_0x6a56('0xb7')]({'id':0x0,'priority':_0x2f0da5[_0x6a56('0x97')][_0x6a56('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x6a56('0xb8')][_0x6a56('0x50')]({'body':_0x4d45b0[_0x6a56('0x57')][_0x6a56('0x57')],'ChatWebsiteId':_0x4d45b0[_0x6a56('0x4d')]['id'],'ChatInteractionId':_0x5c86ea['id'],'direction':'in','ContactId':_0x2f0da5[_0x6a56('0x9e')]['id'],'AttachmentId':_0x4d45b0['body']['AttachmentId']});})['then'](function(_0x3a406b){_0x2f0da5[_0x6a56('0x19')]=_0x3a406b;if(_0x2f0da5[_0x6a56('0xb2')][_0x6a56('0xb9')]){return db[_0x6a56('0xba')][_0x6a56('0x4f')]({'attributes':['id',_0x6a56('0x2c')],'where':{'id':_0x2f0da5['interaction']['UserId']}})['then'](function(_0x2cfe4c){if(_0x2cfe4c){_0x2f0da5[_0x6a56('0x97')][_0x6a56('0xbb')]({'id':0x0,'priority':0x0,'app':_0x6a56('0xbc'),'appdata':_0x2cfe4c['name']+','+(_0x2f0da5[_0x6a56('0x9c')][_0x6a56('0xbd')]||0xa),'interval':_0x6a56('0xbe')});_0x2f0da5['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6a56('0xbf'),_0x6a56('0xc0'),_0x2f0da5);});}return respondWithRpcPromise(_0x6a56('0xbf'),_0x6a56('0xc0'),_0x2f0da5);})[_0x6a56('0x13')](function(_0x2b6810){respondWithRpcPromise(_0x6a56('0xc1'),'EventManager',{'event':'notify','message':_0x2b6810},client9002);return _0x2b6810;})['then'](respondWithResult(_0x4c2d2a,null))['catch'](handleError(_0x4c2d2a,null));};exports[_0x6a56('0xc2')]=function(_0x9e96f8,_0x1b7743){var _0x4ee3e1,_0x4217ba,_0x2c3773;var _0x44670d=[];var _0x32fd7e={};var _0xce54cc=_0x9e96f8[_0x6a56('0xc3')]||[];var _0x378874=[];var _0xae9fdb;return db[_0x6a56('0x83')]['describe']()[_0x6a56('0x13')](function(_0x25af2d){if(!_0x25af2d){throw new db[(_0x6a56('0x84'))][(_0x6a56('0x8b'))]('no\x20available\x20attributes');}_0x44670d=_[_0x6a56('0x86')](_['keys'](_0x25af2d),[_0x6a56('0x87'),_0x6a56('0x88'),_0x6a56('0xc4'),_0x6a56('0x89')]);if(_0x9e96f8[_0x6a56('0x57')]['id']){delete _0x9e96f8['body']['id'];}if(_[_0x6a56('0x71')](_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x8a')])){throw _0x1b7743[_0x6a56('0x1e')](0x1f4)[_0x6a56('0x2d')](new db[(_0x6a56('0x84'))][(_0x6a56('0x8b'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x9e96f8[_0x6a56('0x57')]['body'])||_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x57')]===''){throw _0x1b7743['status'](0x1f4)[_0x6a56('0x2d')](new db[(_0x6a56('0x84'))]['ValidationError'](_0x6a56('0x8d')));}if(_[_0x6a56('0x71')](_0x9e96f8[_0x6a56('0x57')][_0x6a56('0xc5')])){throw _0x1b7743[_0x6a56('0x1e')](0x1f4)[_0x6a56('0x2d')](new db['Sequelize'][(_0x6a56('0x8b'))](_0x6a56('0xc6')+_0x44670d));}if(!_[_0x6a56('0x90')](_0x44670d,_0x9e96f8[_0x6a56('0x57')][_0x6a56('0xc5')])){throw _0x1b7743[_0x6a56('0x1e')](0x1f4)[_0x6a56('0x2d')](new db[(_0x6a56('0x84'))][(_0x6a56('0x8b'))](_0x6a56('0xc7')+_0x44670d));}_0x32fd7e[_0x9e96f8[_0x6a56('0x57')]['mapKeyOffline']]=_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x8a')];})['then'](function(){return db['ChatWebsite'][_0x6a56('0x4f')]({'where':{'id':_0x9e96f8[_0x6a56('0x4d')]['id']},'include':[{'model':db['CmList'],'as':_0x6a56('0x93')},{'model':db[_0x6a56('0xc8')],'as':_0x6a56('0xc8')}]});})[_0x6a56('0x13')](handleEntityNotFound(_0x1b7743,null))['then'](function(_0x2135a3){if(_0x2135a3&&_0x2135a3[_0x6a56('0x93')]){_0x4217ba=_0x2135a3;var _0x19ea1a=_[_0x6a56('0x9d')](_0x9e96f8[_0x6a56('0x57')],{'firstName':_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x8a')],'phone':_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x8a')],'ListId':_0x2135a3[_0x6a56('0x89')]});_0x19ea1a[_0x9e96f8[_0x6a56('0x57')][_0x6a56('0xc5')]]=_0x9e96f8[_0x6a56('0x57')][_0x6a56('0x8a')];return db['CmContact'][_0x6a56('0xc9')]({'where':_0x32fd7e,'defaults':_0x19ea1a});}})[_0x6a56('0xb3')](function(_0x148733){if(_0x148733){_0x2c3773=_0x148733;var _0x15a564=fs[_0x6a56('0xca')](path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0xcb')),_0x6a56('0xcc'));var _0x2d1979=ejs[_0x6a56('0xcd')](_0x15a564,{'body':_['toPairs'](_0x9e96f8['body'][_0x6a56('0x57')]),'bodyTitle':_0x4217ba[_0x6a56('0xce')]});return db[_0x6a56('0xcf')][_0x6a56('0x50')]({'body':_0x2d1979,'plainBody':htmlToText['fromString'](_0x2d1979),'ContactId':_0x148733['id'],'ChatWebsiteId':_0x4217ba['id']});}})[_0x6a56('0x13')](function(_0x25807b){_0xae9fdb=_0x25807b;if(_0xce54cc['length']){var _0x46143e=_0xce54cc['map'](function(_0xedb1ea){return{'name':_0xedb1ea[_0x6a56('0xd0')],'basename':_0xedb1ea[_0x6a56('0x65')],'type':_0xedb1ea['mimetype'],'ChatOfflineMessageId':_0x25807b['id']};});_0x378874=_0x46143e['map'](_0x74f349=>{var _0x35d46c={'filename':_0x74f349[_0x6a56('0x2c')],'path':path[_0x6a56('0x6c')](config[_0x6a56('0x6d')],_0x6a56('0xd1'),_0x6a56('0xc3'),'attachments',_0x6a56('0xd2'),_0x74f349['basename'])};return _0x35d46c;});if(!_0x4217ba[_0x6a56('0xd3')]){return db['sequelize'][_0x6a56('0xd4')](function(_0x23a248){return db['Attachment'][_0x6a56('0xd5')](_0x46143e,{'transaction':_0x23a248});});}}})[_0x6a56('0x13')](function(){if(_0xae9fdb){_0x4ee3e1=_0xae9fdb;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6a56('0xd6')],'as':_0x6a56('0xd7'),'raw':!![],'include':[{'model':db[_0x6a56('0xd8')],'as':_0x6a56('0xd8'),'raw':!![]}]}]});}})[_0x6a56('0x13')](function(_0x255ad7){if(_0x255ad7&&_0x255ad7[_0x6a56('0xd7')]&&_0x4217ba[_0x6a56('0xd9')]&&_0x4217ba[_0x6a56('0xda')]){var _0x251390=_0x255ad7[_0x6a56('0xdb')]();return respondWithRpcPromise(_0x6a56('0xdc'),'sendMail',{'account':_0x251390,'message':{'from':util['format'](_0x6a56('0xdd'),_0x255ad7[_0x6a56('0x2c')],_0x255ad7[_0x6a56('0xde')]||_0x255ad7['Smtp'][_0x6a56('0x51')]),'to':_0x4217ba[_0x6a56('0xda')],'subject':_0x4217ba[_0x6a56('0xdf')],'html':_0x4ee3e1[_0x6a56('0x57')],'attachments':_0x378874}},client9003)[_0x6a56('0x13')](function(){return _0x4ee3e1;})['catch'](function(_0x2b70b3){logger[_0x6a56('0x17')](_0x2b70b3);});}})['then'](function(){if(_0x4217ba&&_0x4217ba[_0x6a56('0xd3')]&&_0x4217ba[_0x6a56('0xe0')]){var _0x2e8335=[];if(_0xce54cc[_0x6a56('0x4e')]){_0x2e8335=_0xce54cc[_0x6a56('0x31')](function(_0x2db6a3){return{'name':_0x2db6a3[_0x6a56('0xd0')],'basename':_0x2db6a3[_0x6a56('0x65')],'type':_0x2db6a3[_0x6a56('0xe1')],'ChatOfflineMessageId':_0xae9fdb['id']};});}var _0x1a887f;if(!_[_0x6a56('0x71')](_0x4217ba[_0x6a56('0xe2')])){var _0x4560f4=_['map'](_0x9e96f8['body'],function(_0x37f391){return _0x37f391;});var _0x4c9ba0=_[_0x6a56('0xe3')](_0x4560f4)[0x0];var _0x46172c=_['mapValues'](_0x4c9ba0,function(_0x1a2617){return _0x1a2617;});_0x1a887f=_0x46172c[0x1][_0x4217ba[_0x6a56('0xe2')]];}var _0x3b6353={'from':_0x2c3773[_0x6a56('0xde')],'firstName':_0x2c3773[_0x6a56('0xa2')],'lastName':_0x2c3773[_0x6a56('0xa3')],'mapKey':_0x6a56('0xde'),'message':{'from':_0x2c3773[_0x6a56('0xde')],'to':_0x4217ba[_0x6a56('0xc8')][_0x6a56('0xde')],'cc':'','subject':_[_0x6a56('0x71')](_0x1a887f)?_0x4217ba['offlineMessageSubject']:_0x1a887f,'messageId':'','sentAt':new Date(),'attach':_0x2e8335[_0x6a56('0x4e')],'attachments':_0x2e8335,'originChannel':_0x6a56('0xe4'),'ChatWebsiteId':_0x4217ba['id'],'ChatOfflineMessageId':_0x4ee3e1['id'],'originTo':_0x4217ba[_0x6a56('0xc8')][_0x6a56('0xde')]},'body':_0x4ee3e1[_0x6a56('0x57')]};var _0x16ab63={'account':{'id':_0x4217ba['MailAccountId']},'body':_0x3b6353,'log':_0x6a56('0xe5')};return respondWithRpcPromise(_0x6a56('0xe5'),_0x6a56('0xe6'),_0x16ab63,client9001)[_0x6a56('0x13')](function(){return _0x4ee3e1;})[_0x6a56('0x1c')](function(_0x2db5ca){logger[_0x6a56('0x17')](_0x2db5ca);});}return;})[_0x6a56('0x13')](function(){if(_0x4ee3e1){return _0x4ee3e1;}})['then'](respondWithResult(_0x1b7743,null))[_0x6a56('0x1c')](function(_0x323c6a){logger[_0x6a56('0x17')](_0x6a56('0x1c'),_0x323c6a);for(var _0xc14ea4 of _0xce54cc){var _0x1602fc=path['join'](config[_0x6a56('0x6d')],'server',_0x6a56('0xc3'),_0x6a56('0xe7'),_0x6a56('0xd2'),_0xc14ea4['filename']);fs_extra[_0x6a56('0xe8')](_0x1602fc)[_0x6a56('0x1c')](function(_0x4c010c){logger['error'](_0x6a56('0xe9'),_0x1602fc,_0x4c010c);});}});};exports[_0x6a56('0xea')]=function(_0x26e603,_0x3c8095){return db[_0x6a56('0xaf')][_0x6a56('0x4f')]({'where':{'id':_0x26e603[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x3c8095,null))[_0x6a56('0x13')](function(_0x404764){if(_0x404764){return _0x404764[_0x6a56('0xea')](_0x26e603[_0x6a56('0x57')]['ids'],_['omit'](_0x26e603[_0x6a56('0x57')],[_0x6a56('0x5e'),'id'])||{});}})[_0x6a56('0x13')](respondWithResult(_0x3c8095,null))['catch'](handleError(_0x3c8095,null));};exports[_0x6a56('0xeb')]=function(_0x5c57fc,_0x3264ff){var _0x466e50={'raw':![],'where':{}};var _0x252876={};var _0x1d7df={'count':0x0,'rows':[]};return db[_0x6a56('0x32')][_0x6a56('0xec')]({'where':{'id':_0x5c57fc[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x3264ff,null))['then'](function(_0x29a67e){if(_0x29a67e){_0x252876[_0x6a56('0x37')]=_[_0x6a56('0x38')](db[_0x6a56('0xaf')]['rawAttributes']);_0x252876[_0x6a56('0x3b')]=_[_0x6a56('0x38')](_0x5c57fc[_0x6a56('0x3b')]);_0x252876[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x252876[_0x6a56('0x37')],_0x252876[_0x6a56('0x3b')]);_0x466e50[_0x6a56('0x3d')]=_[_0x6a56('0x3a')](_0x252876[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x5c57fc['query'][_0x6a56('0x3c')]));_0x466e50['attributes']=_0x466e50['attributes'][_0x6a56('0x4e')]?_0x466e50['attributes']:_0x252876['model'];if(!_0x5c57fc[_0x6a56('0x3b')]['hasOwnProperty'](_0x6a56('0x3f'))){_0x466e50[_0x6a56('0x21')]=qs['limit'](_0x5c57fc[_0x6a56('0x3b')]['limit']);_0x466e50['offset']=qs[_0x6a56('0x23')](_0x5c57fc['query'][_0x6a56('0x23')]);}_0x466e50[_0x6a56('0x40')]=qs[_0x6a56('0x41')](_0x5c57fc[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x466e50[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x5c57fc[_0x6a56('0x3b')],_0x252876[_0x6a56('0x39')]));_0x466e50['where'][_0x6a56('0x5a')]=_0x29a67e['id'];if(_0x5c57fc['query'][_0x6a56('0x43')]){_0x466e50['where']=_['merge'](_0x466e50[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x466e50[_0x6a56('0x3d')],function(_0x3203a8){var _0x186c60={};_0x186c60[_0x3203a8]={'$like':'%'+_0x5c57fc[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x186c60;})});}_0x466e50=_[_0x6a56('0x5d')]({},_0x466e50,_0x5c57fc[_0x6a56('0x46')]);return db['ChatInteraction'][_0x6a56('0x47')]({'where':_0x466e50[_0x6a56('0x44')]})['then'](function(_0x3eb80a){_0x1d7df[_0x6a56('0x47')]=_0x3eb80a;if(_0x5c57fc[_0x6a56('0x3b')]['includeAll']){_0x466e50[_0x6a56('0x49')]=[{'model':db['CmContact'],'as':_0x6a56('0xed'),'required':![]},{'model':db[_0x6a56('0xba')],'as':'Owner','attributes':[_0x6a56('0x2c'),'fullname',_0x6a56('0xee')],'required':![]},{'model':db['Tag'],'as':_0x6a56('0xef'),'attributes':['id',_0x6a56('0x2c'),_0x6a56('0xf0')],'where':_0x5c57fc[_0x6a56('0x3b')]['tag']?{'id':_0x5c57fc[_0x6a56('0x3b')]['tag']}:undefined,'required':_0x5c57fc[_0x6a56('0x3b')][_0x6a56('0xf1')]?!![]:![]}];}return db[_0x6a56('0xaf')][_0x6a56('0x4a')](_0x466e50);})[_0x6a56('0x13')](function(_0x39f46a){_0x1d7df['rows']=_0x39f46a;return _0x1d7df;});}})[_0x6a56('0x13')](respondWithFilteredResult(_0x3264ff,_0x466e50))[_0x6a56('0x1c')](handleError(_0x3264ff,null));};function iftimePromise(_0x8e26e3,_0x2ad88e){return respondWithRpcPromise('Command','getSnippet',{'command':_0x2ad88e[_0x6a56('0xf2')]?util[_0x6a56('0xa8')](_0x6a56('0xf3'),_0x8e26e3['interval'],_0x2ad88e[_0x6a56('0xf2')]):util[_0x6a56('0xa8')](_0x6a56('0xf4'),_0x8e26e3[_0x6a56('0xf5')])},client9002)[_0x6a56('0x13')](function(_0x2aad27){var _0x5eb1ca=_0x2aad27&&_0x2aad27[_0x6a56('0xf6')](_0x6a56('0xf7'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2ad88e['id'],_0x8e26e3['id'],_0x8e26e3[_0x6a56('0xf5')],_0x5eb1ca?_0x6a56('0xf8'):'OFFLINE',_0x2ad88e['timezone']?_0x2ad88e['timezone']:_0x6a56('0xf9'));return _0x5eb1ca;})[_0x6a56('0x1c')](function(_0x59cd37){logger[_0x6a56('0x17')](_0x6a56('0xfa'),_0x2ad88e['id'],_0x8e26e3['id'],_0x8e26e3[_0x6a56('0xf5')],util[_0x6a56('0xfb')](_0x59cd37,{'showHidden':![],'depth':null}),_0x2ad88e[_0x6a56('0xf2')]?_0x2ad88e[_0x6a56('0xf2')]:_0x6a56('0xf9'));return![];});}exports['getSnippet']=function(_0x9950e0,_0x2c7ce7){var _0x49f512=0x0;var _0x1f6242=0x0;var _0x274f38=![];var _0x180341;var _0x5741df;return db['ChatWebsite'][_0x6a56('0x4f')]({'where':{'id':_0x9950e0[_0x6a56('0x4d')]['id']},'include':[{'model':db[_0x6a56('0xfc')],'as':_0x6a56('0xfc'),'include':[{'model':db['Interval'],'as':_0x6a56('0xfd'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x2c7ce7,null))[_0x6a56('0x13')](function(_0x211f5e){if(_0x211f5e){_0x180341=_0x211f5e;return _0x211f5e[_0x6a56('0xfe')]({'raw':!![]});}})[_0x6a56('0x13')](function(_0x4b8827){if(_0x180341){if(_0x4b8827){_0x5741df=_0x4b8827;}}return require(_0x6a56('0x6f'))[_0x6a56('0xff')]();})[_0x6a56('0x13')](function(_0x2dfb9f){if(_0x2dfb9f){_0x1f6242=_0x2dfb9f['virtual'];_0x274f38=_0x2dfb9f['custom'];}})[_0x6a56('0x13')](function(){return db[_0x6a56('0xaf')][_0x6a56('0x47')]({'where':{'closed':![]}});})['then'](function(_0x4a38c2){_0x49f512=_0x4a38c2;if(_0x1f6242&&_0x4a38c2>_0x1f6242){return db[_0x6a56('0x100')]['findOne']({'where':{'id':0x1}})[_0x6a56('0x13')](function(_0x29d464){if(_0x29d464){_0x29d464[_0x6a56('0x101')](_0x6a56('0x102'));}});}})['then'](function(){if(_0x180341[_0x6a56('0xfc')]&&_0x180341[_0x6a56('0xfc')]['Intervals']){var _0x4974a9=[];for(var _0x5a3b19=0x0;_0x5a3b19<_0x180341['Interval'][_0x6a56('0xfd')]['length'];_0x5a3b19++){var _0x1e03b4=_0x180341['Interval'][_0x6a56('0xfd')][_0x5a3b19][_0x6a56('0x28')]({'plain':!![]});_0x4974a9[_0x6a56('0xb7')](iftimePromise(_0x1e03b4,_0x180341));}return BPromise[_0x6a56('0x103')](_0x4974a9)[_0x6a56('0x13')](function(_0x57070e){return _['some'](_0x57070e);});}else{return!![];}})[_0x6a56('0x13')](function(_0x1aa15e){var _0xe9e0d4=fs[_0x6a56('0xca')](path[_0x6a56('0x6c')](config['root'],_0x6a56('0x104')),_0x6a56('0xcc'));var _0x264bcf=new url[(_0x6a56('0x105'))](_0x180341[_0x6a56('0x106')])['origin'];var _0x21a414=_0x6a56('0x107');var _0x280c0c=![];var _0xf8e36={'chatVersion':_0x21a414,'chatWebsiteAddressOrigin':_0x264bcf,'remote':_0x180341[_0x6a56('0x108')],'query':querystring[_0x6a56('0x16')](_[_0x6a56('0x5d')](_0x180341[_0x6a56('0x28')]({'plain':!![]}),{'customerIp':_0x9950e0[_0x6a56('0x7f')][_0x6a56('0xa1')]||_0x9950e0[_0x6a56('0x7f')]['x-real-ip']||_0x9950e0[_0x6a56('0x109')]['remoteAddress']||_0x9950e0['ip'],'referer':_0x9950e0['headers']['referer'],'openedInteractions':_0x49f512,'maxInteractions':_0x1f6242,'virtual':_0x274f38[_0x6a56('0x10a')],'online':_0x1aa15e,'custom':_0x274f38}))[_0x6a56('0x10b')](/'/g,'\x5c\x27')};_0x2c7ce7[_0x6a56('0x2d')](ejs[_0x6a56('0xcd')](Mustache['render'](_0xe9e0d4,_0xf8e36),{'proactiveActions':_0x5741df,'alignment':_0x180341['alignment'],'verticalAlignment':_0x180341[_0x6a56('0x10c')],'div_color':_0x180341[_0x6a56('0xf0')],'labelText':_0x180341[_0x6a56('0x10d')],'text_color':_0x180341['textColor'],'text_button_color':_0x180341[_0x6a56('0x10e')],'button_color':_0x180341[_0x6a56('0x10f')],'background_color':_0x180341[_0x6a56('0x110')],'hideWhenOffline':_0x180341['hideWhenOffline'],'intervalId':_0x180341['IntervalId'],'isDevelopment':_0x280c0c,'chatVersion':_0x21a414}));})[_0x6a56('0x1c')](handleError(_0x2c7ce7,null));};exports[_0x6a56('0x111')]=function(_0x53b326,_0x529f78){var _0x550014=_0x53b326[_0x6a56('0x4d')]['id'];var _0x5462db=_0x53b326[_0x6a56('0x57')];var _0x301e75=0xc8;var _0x18d167=null;return db[_0x6a56('0x112')]['transaction']({'isolationLevel':db['sequelize'][_0x6a56('0x113')][_0x6a56('0x114')][_0x6a56('0x115')]},function(_0x56f15c){return db[_0x6a56('0x32')]['findOne']({'where':{'id':_0x550014},'transaction':_0x56f15c})[_0x6a56('0x13')](function(_0x2d0961){if(_0x2d0961){return db[_0x6a56('0x95')][_0x6a56('0x27')]({'where':{'ChatWebsiteId':_0x550014},'transaction':_0x56f15c})[_0x6a56('0x13')](function(){var _0xb3c002=_[_0x6a56('0x31')](_0x5462db,function(_0x3a3086){_0x3a3086[_0x6a56('0x5a')]=_0x550014;return _0x3a3086;});return db[_0x6a56('0x95')][_0x6a56('0xd5')](_0xb3c002,{'transaction':_0x56f15c});});}else{_0x301e75=0x194;_0x18d167=[];}});})[_0x6a56('0x13')](function(){if(_0x301e75!==0x194){return db[_0x6a56('0x95')][_0x6a56('0x116')]({'where':{'ChatWebsiteId':_0x550014},'order':_0x6a56('0x9a')})['then'](function(_0x4db410){_0x18d167=_0x4db410;});}})[_0x6a56('0x1c')](function(_0x55863a){_0x301e75=0x1f4;logger[_0x6a56('0x17')](_0x55863a[_0x6a56('0x2b')]);if(_0x55863a[_0x6a56('0x2c')]){delete _0x55863a[_0x6a56('0x2c')];}_0x18d167=_0x55863a;})[_0x6a56('0x117')](function(){if(_0x18d167===null){_0x529f78[_0x6a56('0x1d')](_0x301e75);}else{if(_0x301e75===0x1f4){_0x529f78[_0x6a56('0x1e')](_0x301e75)[_0x6a56('0x2d')](_0x18d167);}else{_0x529f78[_0x6a56('0x1e')](_0x301e75)['json'](_0x18d167);}}});};exports[_0x6a56('0x118')]=function(_0x35440a,_0xfad30d){var _0x4b4bd2={};var _0x2687ca={};var _0x2814a6;var _0x150edb;return db[_0x6a56('0x32')]['findOne']({'where':{'id':_0x35440a['params']['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0xfad30d,null))[_0x6a56('0x13')](function(_0x128597){if(_0x128597){_0x2814a6=_0x128597;_0x2687ca[_0x6a56('0x37')]=_[_0x6a56('0x38')](db[_0x6a56('0x95')][_0x6a56('0x33')]);_0x2687ca['query']=_[_0x6a56('0x38')](_0x35440a[_0x6a56('0x3b')]);_0x2687ca[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x2687ca[_0x6a56('0x37')],_0x2687ca[_0x6a56('0x3b')]);_0x4b4bd2[_0x6a56('0x3d')]=_['intersection'](_0x2687ca[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x35440a[_0x6a56('0x3b')][_0x6a56('0x3c')]));_0x4b4bd2['attributes']=_0x4b4bd2[_0x6a56('0x3d')][_0x6a56('0x4e')]?_0x4b4bd2[_0x6a56('0x3d')]:_0x2687ca[_0x6a56('0x37')];_0x4b4bd2[_0x6a56('0x40')]=qs['sort'](_0x35440a[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x4b4bd2[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x35440a[_0x6a56('0x3b')],_0x2687ca[_0x6a56('0x39')]));if(_0x35440a[_0x6a56('0x3b')][_0x6a56('0x43')]){_0x4b4bd2[_0x6a56('0x44')]=_[_0x6a56('0x5d')](_0x4b4bd2[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x4b4bd2[_0x6a56('0x3d')],function(_0x451051){var _0x5ae772={};_0x5ae772[_0x451051]={'$like':'%'+_0x35440a[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x5ae772;})});}_0x4b4bd2=_[_0x6a56('0x5d')]({},_0x4b4bd2,_0x35440a[_0x6a56('0x46')]);return _0x2814a6[_0x6a56('0x118')](_0x4b4bd2);}})[_0x6a56('0x13')](function(_0x3ec1cb){if(_0x3ec1cb){_0x150edb=_0x3ec1cb[_0x6a56('0x4e')];if(!_0x35440a[_0x6a56('0x3b')][_0x6a56('0x3e')]('nolimit')){_0x4b4bd2['limit']=qs[_0x6a56('0x21')](_0x35440a[_0x6a56('0x3b')][_0x6a56('0x21')]);_0x4b4bd2[_0x6a56('0x23')]=qs['offset'](_0x35440a[_0x6a56('0x3b')][_0x6a56('0x23')]);}return _0x2814a6['getApplications'](_0x4b4bd2);}})['then'](function(_0x509a10){if(_0x509a10){return _0x509a10?{'count':_0x150edb,'rows':_0x509a10}:null;}})[_0x6a56('0x13')](respondWithResult(_0xfad30d,null))[_0x6a56('0x1c')](handleError(_0xfad30d,null));};exports[_0x6a56('0x119')]=function(_0x4d3a02,_0x52a34e){return db['chatProactiveAction']['find']({'where':{'id':_0x4d3a02[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x52a34e,null))[_0x6a56('0x13')](function(_0x11727c){if(_0x11727c){return _0x11727c['addProactiveActions'](_0x4d3a02[_0x6a56('0x57')][_0x6a56('0x5e')],_[_0x6a56('0x11a')](_0x4d3a02[_0x6a56('0x57')],['ids','id'])||{});}})[_0x6a56('0x13')](respondWithResult(_0x52a34e,null))['catch'](handleError(_0x52a34e,null));};exports['getProactiveActions']=function(_0x336458,_0x4bcade){var _0x4a7cc8={};var _0x56eed5={};var _0x36944e;var _0x3de7ad;return db[_0x6a56('0x32')][_0x6a56('0xec')]({'where':{'id':_0x336458[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x4bcade,null))[_0x6a56('0x13')](function(_0x3f430d){if(_0x3f430d){_0x36944e=_0x3f430d;_0x56eed5[_0x6a56('0x37')]=_['keys'](db[_0x6a56('0x11b')][_0x6a56('0x33')]);_0x56eed5[_0x6a56('0x3b')]=_['keys'](_0x336458[_0x6a56('0x3b')]);_0x56eed5['filters']=_[_0x6a56('0x3a')](_0x56eed5[_0x6a56('0x37')],_0x56eed5[_0x6a56('0x3b')]);_0x4a7cc8[_0x6a56('0x3d')]=_['intersection'](_0x56eed5[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x336458[_0x6a56('0x3b')][_0x6a56('0x3c')]));_0x4a7cc8[_0x6a56('0x3d')]=_0x4a7cc8['attributes'][_0x6a56('0x4e')]?_0x4a7cc8['attributes']:_0x56eed5['model'];_0x4a7cc8['order']=qs['sort'](_0x336458[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x4a7cc8[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_['pick'](_0x336458[_0x6a56('0x3b')],_0x56eed5[_0x6a56('0x39')]));if(_0x336458['query'][_0x6a56('0x43')]){_0x4a7cc8[_0x6a56('0x44')]=_[_0x6a56('0x5d')](_0x4a7cc8[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x4a7cc8[_0x6a56('0x3d')],function(_0x23e793){var _0x4c0f8f={};_0x4c0f8f[_0x23e793]={'$like':'%'+_0x336458[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x4c0f8f;})});}_0x4a7cc8=_[_0x6a56('0x5d')]({},_0x4a7cc8,_0x336458['options']);return _0x36944e[_0x6a56('0xfe')](_0x4a7cc8);}})['then'](function(_0xfe647b){if(_0xfe647b){_0x3de7ad=_0xfe647b['length'];if(!_0x336458[_0x6a56('0x3b')]['hasOwnProperty'](_0x6a56('0x3f'))){_0x4a7cc8[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x336458[_0x6a56('0x3b')][_0x6a56('0x21')]);_0x4a7cc8[_0x6a56('0x23')]=qs[_0x6a56('0x23')](_0x336458[_0x6a56('0x3b')][_0x6a56('0x23')]);}return _0x36944e['getProactiveActions'](_0x4a7cc8);}})['then'](function(_0x563f5e){if(_0x563f5e){return _0x563f5e?{'count':_0x3de7ad,'rows':_0x563f5e}:null;}})[_0x6a56('0x13')](respondWithResult(_0x4bcade,null))[_0x6a56('0x1c')](handleError(_0x4bcade,null));};exports['getFields']=function(_0x301cae,_0x10276d){var _0x9884b3=_0x301cae['query'][_0x6a56('0x11c')]===_0x6a56('0x11d')?_0x6a56('0x11e'):_0x6a56('0x11f');return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'attributes':['id',_0x9884b3],'where':{'id':_0x301cae[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x10276d,null))[_0x6a56('0x13')](function(_0x4d1d46){if(_0x4d1d46){var _0x5dcdd4=_0x4d1d46[_0x9884b3];var _0x47eb76=_0x5dcdd4&&_0x5dcdd4[_0x6a56('0x120')]?_0x5dcdd4[_0x6a56('0x120')]:[];_0x10276d[_0x6a56('0x2d')]({'fromKey':_[_0x6a56('0x71')](_0x5dcdd4['fromKey'])?undefined:_0x5dcdd4['fromKey'],'count':_0x47eb76[_0x6a56('0x4e')],'rows':_0x47eb76});}})[_0x6a56('0x1c')](handleError(_0x10276d,null));};exports[_0x6a56('0x121')]=function(_0x4a5f4b,_0x2ccc3d){var _0x39b67f={'raw':![],'where':{}};var _0x989808={};var _0x188b5b={'count':0x0,'rows':[]};return db[_0x6a56('0x32')][_0x6a56('0xec')]({'where':{'id':_0x4a5f4b[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x2ccc3d,null))['then'](function(_0x2fe957){if(_0x2fe957){_0x989808['model']=_['keys'](db[_0x6a56('0xcf')][_0x6a56('0x33')]);_0x989808[_0x6a56('0x3b')]=_[_0x6a56('0x38')](_0x4a5f4b['query']);_0x989808[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x989808[_0x6a56('0x37')],_0x989808['query']);_0x39b67f[_0x6a56('0x3d')]=_[_0x6a56('0x3a')](_0x989808['model'],qs['fields'](_0x4a5f4b['query'][_0x6a56('0x3c')]));_0x39b67f[_0x6a56('0x3d')]=_0x39b67f['attributes'][_0x6a56('0x4e')]?_0x39b67f['attributes']:_0x989808[_0x6a56('0x37')];if(!_0x4a5f4b[_0x6a56('0x3b')][_0x6a56('0x3e')](_0x6a56('0x3f'))){_0x39b67f[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x4a5f4b['query']['limit']);_0x39b67f[_0x6a56('0x23')]=qs['offset'](_0x4a5f4b[_0x6a56('0x3b')][_0x6a56('0x23')]);}_0x39b67f[_0x6a56('0x40')]=qs['sort'](_0x4a5f4b[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x39b67f[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x4a5f4b[_0x6a56('0x3b')],_0x989808[_0x6a56('0x39')]));_0x39b67f[_0x6a56('0x44')][_0x6a56('0x5a')]=_0x2fe957['id'];if(_0x4a5f4b[_0x6a56('0x3b')][_0x6a56('0x43')]){_0x39b67f[_0x6a56('0x44')]=_[_0x6a56('0x5d')](_0x39b67f[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x39b67f['attributes'],function(_0x1b3584){var _0x1354bd={};_0x1354bd[_0x1b3584]={'$like':'%'+_0x4a5f4b[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x1354bd;})});}_0x39b67f=_[_0x6a56('0x5d')]({},_0x39b67f,_0x4a5f4b['options']);return db[_0x6a56('0xcf')][_0x6a56('0x47')]({'where':_0x39b67f[_0x6a56('0x44')]})[_0x6a56('0x13')](function(_0x3599c7){_0x188b5b[_0x6a56('0x47')]=_0x3599c7;if(_0x4a5f4b['query'][_0x6a56('0x48')]){_0x39b67f[_0x6a56('0x49')]=[{'all':!![]}];}else{_0x39b67f['include']=[{'model':db[_0x6a56('0x83')],'as':_0x6a56('0xed'),'required':![]},{'model':db[_0x6a56('0x122')],'as':_0x6a56('0x123'),'required':![]}];}return db[_0x6a56('0xcf')][_0x6a56('0x4a')](_0x39b67f);})[_0x6a56('0x13')](function(_0x53f9ec){_0x188b5b[_0x6a56('0x4b')]=_0x53f9ec;return _0x188b5b;});}})[_0x6a56('0x13')](respondWithFilteredResult(_0x2ccc3d,_0x39b67f))[_0x6a56('0x1c')](handleError(_0x2ccc3d,null));};exports[_0x6a56('0x124')]=function(_0x2c11d7,_0x402150){return db['ChatWebsite'][_0x6a56('0x4f')]({'where':{'id':_0x2c11d7['params']['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x402150,null))[_0x6a56('0x13')](function(_0x14843d){if(_0x14843d){return _0x14843d['addAgents'](_0x2c11d7[_0x6a56('0x57')][_0x6a56('0x5e')],_[_0x6a56('0x11a')](_0x2c11d7['body'],['ids','id'])||{})[_0x6a56('0xb3')](function(_0x5cd7c6){for(var _0x4fe5d3=0x0;_0x4fe5d3<_0x2c11d7[_0x6a56('0x57')][_0x6a56('0x5e')][_0x6a56('0x4e')];_0x4fe5d3+=0x1){socket[_0x6a56('0x125')]('userChatWebsite:save',{'UserId':Number(_0x2c11d7['body'][_0x6a56('0x5e')][_0x4fe5d3]),'ChatWebsiteId':Number(_0x2c11d7[_0x6a56('0x4d')]['id'])});}return _0x5cd7c6;});}})[_0x6a56('0x13')](respondWithResult(_0x402150,null))['catch'](handleError(_0x402150,null));};exports[_0x6a56('0x126')]=function(_0x3cbaa8,_0x33b87a){return db[_0x6a56('0x32')][_0x6a56('0x4f')]({'where':{'id':_0x3cbaa8[_0x6a56('0x4d')]['id']}})[_0x6a56('0x13')](handleEntityNotFound(_0x33b87a,null))[_0x6a56('0x13')](function(_0x17bbe8){if(_0x17bbe8){return _0x17bbe8['removeAgents'](_0x3cbaa8[_0x6a56('0x3b')]['ids'])['then'](function(){if(_[_0x6a56('0x127')](_0x3cbaa8[_0x6a56('0x3b')]['ids'])){for(var _0x608c69=0x0;_0x608c69<_0x3cbaa8[_0x6a56('0x3b')][_0x6a56('0x5e')][_0x6a56('0x4e')];_0x608c69+=0x1){socket[_0x6a56('0x125')](_0x6a56('0x128'),{'UserId':Number(_0x3cbaa8[_0x6a56('0x3b')][_0x6a56('0x5e')][_0x608c69]),'ChatWebsiteId':Number(_0x3cbaa8[_0x6a56('0x4d')]['id'])});}}else{socket[_0x6a56('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x3cbaa8[_0x6a56('0x3b')][_0x6a56('0x5e')]),'ChatWebsiteId':Number(_0x3cbaa8['params']['id'])});}});}})[_0x6a56('0x13')](respondWithStatusCode(_0x33b87a,null))[_0x6a56('0x1c')](handleError(_0x33b87a,null));};exports['getAgents']=function(_0x54f23f,_0x457375){var _0x1804c0={};var _0x3a0bfa={};var _0x2c578d;var _0x140121;return db['ChatWebsite'][_0x6a56('0xec')]({'where':{'id':_0x54f23f[_0x6a56('0x4d')]['id']}})['then'](handleEntityNotFound(_0x457375,null))[_0x6a56('0x13')](function(_0x841871){if(_0x841871){_0x2c578d=_0x841871;_0x3a0bfa['model']=_[_0x6a56('0x38')](db[_0x6a56('0xba')]['rawAttributes']);_0x3a0bfa[_0x6a56('0x3b')]=_[_0x6a56('0x38')](_0x54f23f[_0x6a56('0x3b')]);_0x3a0bfa[_0x6a56('0x39')]=_[_0x6a56('0x3a')](_0x3a0bfa['model'],_0x3a0bfa[_0x6a56('0x3b')]);_0x1804c0['attributes']=_[_0x6a56('0x3a')](_0x3a0bfa[_0x6a56('0x37')],qs[_0x6a56('0x3c')](_0x54f23f['query'][_0x6a56('0x3c')]));_0x1804c0[_0x6a56('0x3d')]=_0x1804c0[_0x6a56('0x3d')][_0x6a56('0x4e')]?_0x1804c0[_0x6a56('0x3d')]:_0x3a0bfa['model'];_0x1804c0[_0x6a56('0x40')]=qs[_0x6a56('0x41')](_0x54f23f[_0x6a56('0x3b')][_0x6a56('0x41')]);_0x1804c0[_0x6a56('0x44')]=qs[_0x6a56('0x39')](_[_0x6a56('0x42')](_0x54f23f['query'],_0x3a0bfa[_0x6a56('0x39')]));if(_0x54f23f[_0x6a56('0x3b')]['filter']){_0x1804c0[_0x6a56('0x44')]=_[_0x6a56('0x5d')](_0x1804c0[_0x6a56('0x44')],{'$or':_[_0x6a56('0x31')](_0x1804c0[_0x6a56('0x3d')],function(_0x3b73ea){var _0x2ffa2b={};_0x2ffa2b[_0x3b73ea]={'$like':'%'+_0x54f23f[_0x6a56('0x3b')][_0x6a56('0x43')]+'%'};return _0x2ffa2b;})});}_0x1804c0=_[_0x6a56('0x5d')]({},_0x1804c0,_0x54f23f[_0x6a56('0x46')]);return _0x2c578d[_0x6a56('0x129')](_0x1804c0);}})[_0x6a56('0x13')](function(_0x121e3e){if(_0x121e3e){_0x140121=_0x121e3e['length'];if(!_0x54f23f['query'][_0x6a56('0x3e')](_0x6a56('0x3f'))){_0x1804c0[_0x6a56('0x21')]=qs[_0x6a56('0x21')](_0x54f23f[_0x6a56('0x3b')]['limit']);_0x1804c0[_0x6a56('0x23')]=qs[_0x6a56('0x23')](_0x54f23f[_0x6a56('0x3b')][_0x6a56('0x23')]);}return _0x2c578d[_0x6a56('0x129')](_0x1804c0);}})[_0x6a56('0x13')](function(_0x2dc7ec){if(_0x2dc7ec){return _0x2dc7ec?{'count':_0x140121,'rows':_0x2dc7ec}:null;}})[_0x6a56('0x13')](respondWithResult(_0x457375,null))[_0x6a56('0x1c')](handleError(_0x457375,null));}; \ No newline at end of file +var _0xd2c7=['interaction','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','offlineMessageSubject','originalname','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','push','some','origin','remote','x-real-ip','remoteAddress','referer','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','removeDispositions','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','unknown','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId'];(function(_0x26926c,_0x69b67){var _0x4dfaa6=function(_0x26ff0f){while(--_0x26ff0f){_0x26926c['push'](_0x26926c['shift']());}};_0x4dfaa6(++_0x69b67);}(_0xd2c7,0x1a9));var _0x7d2c=function(_0x4b41e0,_0x42bd44){_0x4b41e0=_0x4b41e0-0x0;var _0x287650=_0xd2c7[_0x4b41e0];return _0x287650;};'use strict';var BPromise=require(_0x7d2c('0x0'));var Mustache=require(_0x7d2c('0x1'));var util=require('util');var path=require(_0x7d2c('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d2c('0x3'));var _=require(_0x7d2c('0x4'));var querystring=require(_0x7d2c('0x5'));var Redis=require(_0x7d2c('0x6'));var qs=require(_0x7d2c('0x7'));var logger=require(_0x7d2c('0x8'))(_0x7d2c('0x9'));var config=require(_0x7d2c('0xa'));var url=require(_0x7d2c('0xb'));var db=require(_0x7d2c('0xc'))['db'];config['redis']=_[_0x7d2c('0xd')](config[_0x7d2c('0xe')],{'host':_0x7d2c('0xf'),'port':0x18eb});var socket=require(_0x7d2c('0x10'))(new Redis(config[_0x7d2c('0xe')]));require(_0x7d2c('0x11'))['register'](socket);var htmlToText=require(_0x7d2c('0x12'));var jayson=require('jayson/promise');var client=jayson[_0x7d2c('0x13')][_0x7d2c('0x14')]({'port':0x232c});var client9002=jayson[_0x7d2c('0x13')][_0x7d2c('0x14')]({'port':0x232a});var client9003=jayson[_0x7d2c('0x13')]['http']({'port':0x232b});var client9001=jayson[_0x7d2c('0x13')][_0x7d2c('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x8b9e0b,_0x55467e,_0x23a78d,_0x595d4b){return new BPromise(function(_0xcb04c,_0x13915d){var _0x132665=_0x595d4b||client;return _0x132665[_0x7d2c('0x15')](_0x8b9e0b,_0x23a78d)[_0x7d2c('0x16')](function(_0x57c5fd){logger[_0x7d2c('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x55467e,'request\x20sent');logger[_0x7d2c('0x18')](_0x7d2c('0x19'),_0x55467e,_0x7d2c('0x1a'),JSON[_0x7d2c('0x1b')](_0x57c5fd));if(_0x57c5fd[_0x7d2c('0x1c')]){if(_0x57c5fd[_0x7d2c('0x1c')][_0x7d2c('0x1d')]===0x1f4){logger[_0x7d2c('0x1c')](_0x7d2c('0x1e'),_0x55467e,_0x57c5fd[_0x7d2c('0x1c')][_0x7d2c('0x1f')]);return _0x13915d(_0x57c5fd[_0x7d2c('0x1c')]['message']);}logger[_0x7d2c('0x1c')](_0x7d2c('0x1e'),_0x55467e,_0x57c5fd[_0x7d2c('0x1c')]['message']);return _0xcb04c(_0x57c5fd[_0x7d2c('0x1c')][_0x7d2c('0x1f')]);}else{logger['info'](_0x7d2c('0x1e'),_0x55467e,_0x7d2c('0x1a'));_0xcb04c(_0x57c5fd['result'][_0x7d2c('0x1f')]);}})[_0x7d2c('0x20')](function(_0x4ef1e7){logger[_0x7d2c('0x1c')](_0x7d2c('0x1e'),_0x55467e,_0x4ef1e7);_0x13915d(_0x4ef1e7);});});}function respondWithStatusCode(_0x3ac73b,_0x5de332){_0x5de332=_0x5de332||0xcc;return function(_0x57a781){if(_0x57a781){return _0x3ac73b[_0x7d2c('0x21')](_0x5de332);}return _0x3ac73b[_0x7d2c('0x22')](_0x5de332)[_0x7d2c('0x23')]();};}function respondWithResult(_0x366db7,_0x36e57b){_0x36e57b=_0x36e57b||0xc8;return function(_0x4f737a){if(_0x4f737a){return _0x366db7[_0x7d2c('0x22')](_0x36e57b)[_0x7d2c('0x24')](_0x4f737a);}};}function respondWithFilteredResult(_0x37d36d,_0x11dd23){return function(_0x3d6c51){if(_0x3d6c51){var _0x211ff3=typeof _0x11dd23[_0x7d2c('0x25')]==='undefined'&&typeof _0x11dd23[_0x7d2c('0x26')]===_0x7d2c('0x27');var _0x1231e1=_0x3d6c51[_0x7d2c('0x28')];var _0x3a5d0a=_0x211ff3?0x0:_0x11dd23[_0x7d2c('0x25')];var _0x4aa2a2=_0x211ff3?_0x3d6c51['count']:_0x11dd23[_0x7d2c('0x25')]+_0x11dd23[_0x7d2c('0x26')];var _0x4354da;if(_0x4aa2a2>=_0x1231e1){_0x4aa2a2=_0x1231e1;_0x4354da=0xc8;}else{_0x4354da=0xce;}_0x37d36d[_0x7d2c('0x22')](_0x4354da);return _0x37d36d[_0x7d2c('0x29')](_0x7d2c('0x2a'),_0x3a5d0a+'-'+_0x4aa2a2+'/'+_0x1231e1)[_0x7d2c('0x24')](_0x3d6c51);}return null;};}function saveUpdates(_0x56a7b4){return function(_0x5c04fb){if(_0x5c04fb){return _0x5c04fb[_0x7d2c('0x2b')](_0x56a7b4)[_0x7d2c('0x16')](function(_0x55d753){return _0x55d753;});}return null;};}function removeEntity(_0x591837){return function(_0x5db431){if(_0x5db431){return _0x5db431[_0x7d2c('0x2c')]()[_0x7d2c('0x16')](function(){var _0x516c4b=_0x5db431[_0x7d2c('0x2d')]({'plain':!![]});var _0x4ff1c4=_0x7d2c('0x2e');return db[_0x7d2c('0x2f')][_0x7d2c('0x2c')]({'where':{'type':_0x4ff1c4,'resourceId':_0x516c4b['id']}})[_0x7d2c('0x16')](function(){return _0x5db431;});})['then'](function(){_0x591837[_0x7d2c('0x22')](0xcc)[_0x7d2c('0x23')]();});}};}function handleEntityNotFound(_0x8a2bdb){return function(_0x39656e){if(!_0x39656e){_0x8a2bdb[_0x7d2c('0x21')](0x194);}return _0x39656e;};}function handleError(_0x51ca19,_0x397e50){_0x397e50=_0x397e50||0x1f4;return function(_0x437ed0){logger[_0x7d2c('0x1c')](_0x437ed0[_0x7d2c('0x30')]);if(_0x437ed0[_0x7d2c('0x31')]){delete _0x437ed0[_0x7d2c('0x31')];}_0x51ca19[_0x7d2c('0x22')](_0x397e50)['send'](_0x437ed0);};}exports[_0x7d2c('0x32')]=function(_0x940891,_0x5aad33){var _0x50884d={'include':[{'model':db[_0x7d2c('0x33')],'as':_0x7d2c('0x34')}]},_0x5c70a5={},_0x1a3880={'count':0x0,'rows':[]};var _0x4ae15a=_[_0x7d2c('0x35')](db[_0x7d2c('0x36')]['rawAttributes'],function(_0x1d6011){return{'name':_0x1d6011[_0x7d2c('0x37')],'type':_0x1d6011[_0x7d2c('0x38')][_0x7d2c('0x39')]};});_0x5c70a5[_0x7d2c('0x3a')]=_['map'](_0x4ae15a,_0x7d2c('0x31'));_0x5c70a5[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x940891[_0x7d2c('0x3b')]);_0x5c70a5[_0x7d2c('0x3d')]=_[_0x7d2c('0x3e')](_0x5c70a5[_0x7d2c('0x3a')],_0x5c70a5[_0x7d2c('0x3b')]);_0x50884d[_0x7d2c('0x3f')]=_[_0x7d2c('0x3e')](_0x5c70a5[_0x7d2c('0x3a')],qs[_0x7d2c('0x40')](_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x50884d[_0x7d2c('0x3f')]=_0x50884d[_0x7d2c('0x3f')][_0x7d2c('0x41')]?_0x50884d[_0x7d2c('0x3f')]:_0x5c70a5[_0x7d2c('0x3a')];if(!_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x42')](_0x7d2c('0x43'))){_0x50884d['limit']=qs[_0x7d2c('0x26')](_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x26')]);_0x50884d[_0x7d2c('0x25')]=qs[_0x7d2c('0x25')](_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x25')]);}_0x50884d[_0x7d2c('0x44')]=qs[_0x7d2c('0x45')](_0x940891[_0x7d2c('0x3b')]['sort']);_0x50884d['where']=qs[_0x7d2c('0x3d')](_[_0x7d2c('0x46')](_0x940891['query'],_0x5c70a5[_0x7d2c('0x3d')]),_0x4ae15a);if(_0x940891[_0x7d2c('0x3b')]['filter']){_0x50884d[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x50884d['where'],{'$or':_[_0x7d2c('0x35')](_0x4ae15a,function(_0x364a2d){if(_0x364a2d[_0x7d2c('0x38')]!==_0x7d2c('0x49')){var _0x32f896={};_0x32f896[_0x364a2d[_0x7d2c('0x31')]]={'$like':'%'+_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x4a')]+'%'};return _0x32f896;}})});}_0x50884d=_[_0x7d2c('0x48')]({},_0x50884d,_0x940891[_0x7d2c('0x4b')]);var _0x16db29={'where':_0x50884d[_0x7d2c('0x47')]};return db['ChatWebsite'][_0x7d2c('0x28')](_0x16db29)['then'](function(_0xdb864d){_0x1a3880[_0x7d2c('0x28')]=_0xdb864d;if(_0x940891[_0x7d2c('0x3b')][_0x7d2c('0x4c')]){_0x50884d[_0x7d2c('0x4d')]=[{'all':!![]}];}return db[_0x7d2c('0x36')]['findAll'](_0x50884d);})[_0x7d2c('0x16')](function(_0x302cf8){_0x1a3880[_0x7d2c('0x4e')]=_0x302cf8;return _0x1a3880;})[_0x7d2c('0x16')](respondWithFilteredResult(_0x5aad33,_0x50884d))[_0x7d2c('0x20')](handleError(_0x5aad33,null));};exports['show']=function(_0x29f418,_0x5921c4){var _0x5f138d={'raw':![],'where':{'id':_0x29f418[_0x7d2c('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0x7d2c('0x34')}]},_0x2aab87={};_0x2aab87[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db[_0x7d2c('0x36')][_0x7d2c('0x50')]);_0x2aab87[_0x7d2c('0x3b')]=_['keys'](_0x29f418[_0x7d2c('0x3b')]);_0x2aab87[_0x7d2c('0x3d')]=_[_0x7d2c('0x3e')](_0x2aab87['model'],_0x2aab87[_0x7d2c('0x3b')]);_0x5f138d[_0x7d2c('0x3f')]=_['intersection'](_0x2aab87[_0x7d2c('0x3a')],qs[_0x7d2c('0x40')](_0x29f418[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x5f138d['attributes']=_0x5f138d[_0x7d2c('0x3f')][_0x7d2c('0x41')]?_0x5f138d[_0x7d2c('0x3f')]:_0x2aab87[_0x7d2c('0x3a')];if(_0x29f418[_0x7d2c('0x3b')][_0x7d2c('0x4c')]){_0x5f138d[_0x7d2c('0x4d')]=[{'all':!![]}];}_0x5f138d=_[_0x7d2c('0x48')]({},_0x5f138d,_0x29f418[_0x7d2c('0x4b')]);return db[_0x7d2c('0x36')]['find'](_0x5f138d)[_0x7d2c('0x16')](handleEntityNotFound(_0x5921c4,null))[_0x7d2c('0x16')](respondWithResult(_0x5921c4,null))[_0x7d2c('0x20')](handleError(_0x5921c4,null));};exports[_0x7d2c('0x51')]=function(_0x451775,_0x2f8ff2){return db[_0x7d2c('0x36')][_0x7d2c('0x51')](_0x451775[_0x7d2c('0x52')],{})[_0x7d2c('0x16')](function(_0x3f8d50){var _0x2f75bf=_0x451775['user']['get']({'plain':!![]});if(!_0x2f75bf)throw new Error(_0x7d2c('0x53'));if(_0x2f75bf['role']==='user'){var _0x546038=_0x3f8d50[_0x7d2c('0x2d')]({'plain':!![]});var _0x3898d3=_0x7d2c('0x2e');return db[_0x7d2c('0x54')][_0x7d2c('0x55')]({'where':{'name':_0x3898d3,'userProfileId':_0x2f75bf[_0x7d2c('0x56')]},'raw':!![]})['then'](function(_0x3e8c26){if(_0x3e8c26&&_0x3e8c26[_0x7d2c('0x57')]===0x0){return db[_0x7d2c('0x2f')][_0x7d2c('0x51')]({'name':_0x546038['name'],'resourceId':_0x546038['id'],'type':_0x3e8c26[_0x7d2c('0x31')],'sectionId':_0x3e8c26['id']},{})[_0x7d2c('0x16')](function(){return _0x3f8d50;});}else{return _0x3f8d50;}})['catch'](function(_0x3c1c2e){logger['error'](_0x7d2c('0x58'),_0x3c1c2e);throw _0x3c1c2e;});}return _0x3f8d50;})['then'](respondWithResult(_0x2f8ff2,0xc9))[_0x7d2c('0x20')](handleError(_0x2f8ff2,null));};exports['update']=function(_0xfb3824,_0x8071ba){if(_0xfb3824['body']['id']){delete _0xfb3824[_0x7d2c('0x52')]['id'];}return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0xfb3824['params']['id']},'include':[{'model':db['Pause'],'as':_0x7d2c('0x34')}]})[_0x7d2c('0x16')](handleEntityNotFound(_0x8071ba,null))[_0x7d2c('0x16')](saveUpdates(_0xfb3824[_0x7d2c('0x52')],null))[_0x7d2c('0x16')](respondWithResult(_0x8071ba,null))['catch'](handleError(_0x8071ba,null));};exports['destroy']=function(_0x23fadf,_0x1c3f7f){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x23fadf[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x1c3f7f,null))[_0x7d2c('0x16')](removeEntity(_0x1c3f7f,null))[_0x7d2c('0x20')](handleError(_0x1c3f7f,null));};exports[_0x7d2c('0x59')]=function(_0x36f112,_0x4d642a){return db['ChatWebsite']['describe']()[_0x7d2c('0x16')](respondWithResult(_0x4d642a,null))['catch'](handleError(_0x4d642a,null));};exports[_0x7d2c('0x5a')]=function(_0x36831c,_0x153a9d){if(_0x36831c[_0x7d2c('0x52')]['id']){delete _0x36831c[_0x7d2c('0x52')]['id'];}return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x36831c[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x153a9d,null))['then'](function(_0x430ee0){if(_0x430ee0){_0x36831c['body'][_0x7d2c('0x5b')]=_0x430ee0['id'];return db[_0x7d2c('0x5c')][_0x7d2c('0x51')](_0x36831c['body']);}})['then'](respondWithResult(_0x153a9d,null))[_0x7d2c('0x20')](handleError(_0x153a9d,null));};exports[_0x7d2c('0x5d')]=function(_0x4ef945,_0xbc5150){var _0x11a2d6={'raw':![],'where':{}};var _0x2098d9={};var _0x36c51f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7d2c('0x5e')]({'where':{'id':_0x4ef945[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0xbc5150,null))[_0x7d2c('0x16')](function(_0x29a627){if(_0x29a627){_0x2098d9[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db['Disposition']['rawAttributes']);_0x2098d9['query']=_[_0x7d2c('0x3c')](_0x4ef945[_0x7d2c('0x3b')]);_0x2098d9[_0x7d2c('0x3d')]=_['intersection'](_0x2098d9[_0x7d2c('0x3a')],_0x2098d9[_0x7d2c('0x3b')]);_0x11a2d6['attributes']=_[_0x7d2c('0x3e')](_0x2098d9[_0x7d2c('0x3a')],qs['fields'](_0x4ef945[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x11a2d6[_0x7d2c('0x3f')]=_0x11a2d6[_0x7d2c('0x3f')][_0x7d2c('0x41')]?_0x11a2d6[_0x7d2c('0x3f')]:_0x2098d9[_0x7d2c('0x3a')];if(!_0x4ef945[_0x7d2c('0x3b')]['hasOwnProperty'](_0x7d2c('0x43'))){_0x11a2d6[_0x7d2c('0x26')]=qs[_0x7d2c('0x26')](_0x4ef945[_0x7d2c('0x3b')]['limit']);_0x11a2d6['offset']=qs[_0x7d2c('0x25')](_0x4ef945['query'][_0x7d2c('0x25')]);}_0x11a2d6[_0x7d2c('0x44')]=qs['sort'](_0x4ef945[_0x7d2c('0x3b')]['sort']);_0x11a2d6['where']=qs[_0x7d2c('0x3d')](_[_0x7d2c('0x46')](_0x4ef945['query'],_0x2098d9['filters']));_0x11a2d6[_0x7d2c('0x47')][_0x7d2c('0x5b')]=_0x29a627['id'];if(_0x4ef945['query'][_0x7d2c('0x4a')]){_0x11a2d6[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x11a2d6[_0x7d2c('0x47')],{'$or':_['map'](_0x11a2d6[_0x7d2c('0x3f')],function(_0x582a89){var _0x31d3d3={};_0x31d3d3[_0x582a89]={'$like':'%'+_0x4ef945['query']['filter']+'%'};return _0x31d3d3;})});}_0x11a2d6=_[_0x7d2c('0x48')]({},_0x11a2d6,_0x4ef945['options']);return db[_0x7d2c('0x5c')][_0x7d2c('0x28')]({'where':_0x11a2d6['where']})[_0x7d2c('0x16')](function(_0x5432da){_0x36c51f[_0x7d2c('0x28')]=_0x5432da;if(_0x4ef945[_0x7d2c('0x3b')][_0x7d2c('0x4c')]){_0x11a2d6[_0x7d2c('0x4d')]=[{'all':!![]}];}return db[_0x7d2c('0x5c')][_0x7d2c('0x5f')](_0x11a2d6);})[_0x7d2c('0x16')](function(_0x5e8803){_0x36c51f['rows']=_0x5e8803;return _0x36c51f;});}})['then'](respondWithFilteredResult(_0xbc5150,_0x11a2d6))['catch'](handleError(_0xbc5150,null));};exports['removeDispositions']=function(_0x1bf00c,_0x374a6f){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x1bf00c[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x374a6f,null))[_0x7d2c('0x16')](function(_0xc86c04){if(_0xc86c04){return _0xc86c04[_0x7d2c('0x60')](_0x1bf00c[_0x7d2c('0x3b')]['ids']);}})[_0x7d2c('0x16')](respondWithStatusCode(_0x374a6f,null))[_0x7d2c('0x20')](handleError(_0x374a6f,null));};exports['addAnswer']=function(_0x6e819b,_0x5c8cfa){if(_0x6e819b['body']['id']){delete _0x6e819b[_0x7d2c('0x52')]['id'];}return db['ChatWebsite'][_0x7d2c('0x55')]({'where':{'id':_0x6e819b[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x5c8cfa,null))['then'](function(_0x3f7b8d){if(_0x3f7b8d){_0x6e819b[_0x7d2c('0x52')][_0x7d2c('0x5b')]=_0x3f7b8d['id'];return db[_0x7d2c('0x61')][_0x7d2c('0x51')](_0x6e819b[_0x7d2c('0x52')]);}})[_0x7d2c('0x16')](respondWithResult(_0x5c8cfa,null))['catch'](handleError(_0x5c8cfa,null));};exports['getAnswers']=function(_0x4d8be7,_0x17899c){var _0x357b07={'raw':![],'where':{}};var _0x2dd700={};var _0x2d22c5={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7d2c('0x5e')]({'where':{'id':_0x4d8be7[_0x7d2c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17899c,null))[_0x7d2c('0x16')](function(_0x38c178){if(_0x38c178){_0x2dd700[_0x7d2c('0x3a')]=_['keys'](db[_0x7d2c('0x61')]['rawAttributes']);_0x2dd700[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x4d8be7[_0x7d2c('0x3b')]);_0x2dd700[_0x7d2c('0x3d')]=_[_0x7d2c('0x3e')](_0x2dd700[_0x7d2c('0x3a')],_0x2dd700['query']);_0x357b07['attributes']=_['intersection'](_0x2dd700[_0x7d2c('0x3a')],qs[_0x7d2c('0x40')](_0x4d8be7['query'][_0x7d2c('0x40')]));_0x357b07['attributes']=_0x357b07['attributes'][_0x7d2c('0x41')]?_0x357b07[_0x7d2c('0x3f')]:_0x2dd700['model'];if(!_0x4d8be7[_0x7d2c('0x3b')][_0x7d2c('0x42')](_0x7d2c('0x43'))){_0x357b07[_0x7d2c('0x26')]=qs[_0x7d2c('0x26')](_0x4d8be7[_0x7d2c('0x3b')][_0x7d2c('0x26')]);_0x357b07[_0x7d2c('0x25')]=qs[_0x7d2c('0x25')](_0x4d8be7[_0x7d2c('0x3b')][_0x7d2c('0x25')]);}_0x357b07[_0x7d2c('0x44')]=qs[_0x7d2c('0x45')](_0x4d8be7['query']['sort']);_0x357b07[_0x7d2c('0x47')]=qs[_0x7d2c('0x3d')](_[_0x7d2c('0x46')](_0x4d8be7['query'],_0x2dd700[_0x7d2c('0x3d')]));_0x357b07['where'][_0x7d2c('0x5b')]=_0x38c178['id'];if(_0x4d8be7[_0x7d2c('0x3b')][_0x7d2c('0x4a')]){_0x357b07[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x357b07[_0x7d2c('0x47')],{'$or':_[_0x7d2c('0x35')](_0x357b07[_0x7d2c('0x3f')],function(_0x46ff05){var _0x1f4b7f={};_0x1f4b7f[_0x46ff05]={'$like':'%'+_0x4d8be7['query']['filter']+'%'};return _0x1f4b7f;})});}_0x357b07=_[_0x7d2c('0x48')]({},_0x357b07,_0x4d8be7[_0x7d2c('0x4b')]);return db[_0x7d2c('0x61')][_0x7d2c('0x28')]({'where':_0x357b07['where']})['then'](function(_0x46c9b2){_0x2d22c5['count']=_0x46c9b2;if(_0x4d8be7[_0x7d2c('0x3b')][_0x7d2c('0x4c')]){_0x357b07['include']=[{'all':!![]}];}return db[_0x7d2c('0x61')]['findAll'](_0x357b07);})[_0x7d2c('0x16')](function(_0x101f46){_0x2d22c5[_0x7d2c('0x4e')]=_0x101f46;return _0x2d22c5;});}})[_0x7d2c('0x16')](respondWithFilteredResult(_0x17899c,_0x357b07))['catch'](handleError(_0x17899c,null));};exports[_0x7d2c('0x62')]=function(_0x8c573b,_0x57ef0c){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x8c573b[_0x7d2c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57ef0c,null))[_0x7d2c('0x16')](function(_0xb207af){if(_0xb207af){return _0xb207af['removeAnswers'](_0x8c573b[_0x7d2c('0x3b')][_0x7d2c('0x63')]);}})[_0x7d2c('0x16')](respondWithStatusCode(_0x57ef0c,null))['catch'](handleError(_0x57ef0c,null));};exports[_0x7d2c('0x64')]=function(_0xdb9b47,_0x11efa4){_0xdb9b47['body']['sitepic']=_0xdb9b47[_0x7d2c('0x65')][_0x7d2c('0x66')];return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0xdb9b47[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x11efa4,null))[_0x7d2c('0x16')](saveUpdates(_0xdb9b47['body'],null))[_0x7d2c('0x16')](respondWithResult(_0x11efa4,null))['catch'](handleError(_0x11efa4,null));};exports[_0x7d2c('0x67')]=function(_0x3498ae,_0x1e63ac){_0x3498ae[_0x7d2c('0x52')][_0x7d2c('0x68')]=_0x3498ae['file'][_0x7d2c('0x66')];return db['ChatWebsite'][_0x7d2c('0x55')]({'where':{'id':_0x3498ae[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x1e63ac,null))[_0x7d2c('0x16')](saveUpdates(_0x3498ae[_0x7d2c('0x52')],null))['then'](respondWithResult(_0x1e63ac,null))[_0x7d2c('0x20')](handleError(_0x1e63ac,null));};exports['addCustomerAvatar']=function(_0x3ac4cf,_0x429583){_0x3ac4cf[_0x7d2c('0x52')]['customerAvatar']=_0x3ac4cf[_0x7d2c('0x65')][_0x7d2c('0x66')];return db[_0x7d2c('0x36')]['find']({'where':{'id':_0x3ac4cf[_0x7d2c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x429583,null))[_0x7d2c('0x16')](saveUpdates(_0x3ac4cf[_0x7d2c('0x52')],null))[_0x7d2c('0x16')](respondWithResult(_0x429583,null))[_0x7d2c('0x20')](handleError(_0x429583,null));};exports[_0x7d2c('0x69')]=function(_0x1e1ee7,_0x215035){_0x1e1ee7[_0x7d2c('0x52')]['systemAvatar']=_0x1e1ee7[_0x7d2c('0x65')][_0x7d2c('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x1e1ee7['params']['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x215035,null))[_0x7d2c('0x16')](saveUpdates(_0x1e1ee7[_0x7d2c('0x52')],null))[_0x7d2c('0x16')](respondWithResult(_0x215035,null))[_0x7d2c('0x20')](handleError(_0x215035,null));};exports[_0x7d2c('0x6a')]=function(_0x3d931c,_0x4b6155){var _0x241d3d=path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x6d'));var _0x1dfa11={'where':{'id':_0x3d931c[_0x7d2c('0x4f')]['id']},'attributes':['id',_0x7d2c('0x6e')],'raw':!![]};var _0x39050f=![];return require(_0x7d2c('0x6f'))[_0x7d2c('0x70')]()['then'](function(_0x141808){if(_0x141808){_0x39050f=_0x141808['custom'];}})[_0x7d2c('0x16')](function(){return db[_0x7d2c('0x36')][_0x7d2c('0x55')](_0x1dfa11);})[_0x7d2c('0x16')](handleEntityNotFound(_0x4b6155,null))[_0x7d2c('0x16')](function(_0x5e1424){if(_0x5e1424){if(!_[_0x7d2c('0x71')](_0x5e1424[_0x7d2c('0x6e')])){if(fs['existsSync'](path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],'server/files/images/logos/',_0x5e1424[_0x7d2c('0x6e')]))&&_0x39050f){_0x241d3d=path['join'](config['root'],_0x7d2c('0x72'),_0x5e1424['sitepic']);}}return _0x4b6155[_0x7d2c('0x73')](_0x241d3d);}})['catch'](handleError(_0x4b6155,null));};exports[_0x7d2c('0x74')]=function(_0x3a1811,_0x17d6ec){var _0x3fc299=path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x75'));var _0x384b00={'where':{'id':_0x3a1811['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7d2c('0x36')][_0x7d2c('0x55')](_0x384b00)['then'](handleEntityNotFound(_0x17d6ec,null))[_0x7d2c('0x16')](function(_0x119c6b){if(_0x119c6b){if(!_[_0x7d2c('0x71')](_0x119c6b['agentAvatar'])){if(fs['existsSync'](path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x76'),_0x119c6b['agentAvatar']))){_0x3fc299=path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x76'),_0x119c6b[_0x7d2c('0x68')]);}}return _0x17d6ec[_0x7d2c('0x73')](_0x3fc299);}})[_0x7d2c('0x20')](handleError(_0x17d6ec,null));};exports[_0x7d2c('0x77')]=function(_0x189aab,_0x1d387a){var _0x1a2239=path['join'](config[_0x7d2c('0x6c')],_0x7d2c('0x78'));var _0x2ef853={'where':{'id':_0x189aab[_0x7d2c('0x4f')]['id']},'attributes':['id',_0x7d2c('0x79'),_0x7d2c('0x7a')],'raw':!![]};return db[_0x7d2c('0x36')][_0x7d2c('0x55')](_0x2ef853)[_0x7d2c('0x16')](handleEntityNotFound(_0x1d387a,null))['then'](function(_0x3197bc){if(_0x3197bc){if(!_[_0x7d2c('0x71')](_0x3197bc[_0x7d2c('0x79')])){if(fs[_0x7d2c('0x7b')](path['join'](config['root'],'server/files/images/avatars/',_0x3197bc[_0x7d2c('0x79')]))&&_0x3197bc[_0x7d2c('0x7a')]){_0x1a2239=path[_0x7d2c('0x6b')](config['root'],'server/files/images/avatars/',_0x3197bc[_0x7d2c('0x79')]);}}return _0x1d387a[_0x7d2c('0x73')](_0x1a2239);}})['catch'](handleError(_0x1d387a,null));};exports[_0x7d2c('0x7c')]=function(_0x517ba0,_0x5b8b97){var _0x3c017d=path[_0x7d2c('0x6b')](config['root'],_0x7d2c('0x7d'));var _0x341fad={'where':{'id':_0x517ba0[_0x7d2c('0x4f')]['id']},'attributes':['id',_0x7d2c('0x7e')],'raw':!![]};return db[_0x7d2c('0x36')]['find'](_0x341fad)[_0x7d2c('0x16')](handleEntityNotFound(_0x5b8b97,null))[_0x7d2c('0x16')](function(_0x1803bb){if(_0x1803bb){if(!_[_0x7d2c('0x71')](_0x1803bb[_0x7d2c('0x7e')])){if(fs[_0x7d2c('0x7b')](path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x76'),_0x1803bb[_0x7d2c('0x7e')]))){_0x3c017d=path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],_0x7d2c('0x76'),_0x1803bb['systemAvatar']);}}return _0x5b8b97[_0x7d2c('0x73')](_0x3c017d);}})[_0x7d2c('0x20')](handleError(_0x5b8b97,null));};exports['notify']=function(_0x3e434f,_0x1d8495){var _0x4ea334=require(_0x7d2c('0x7f'));var _0x1dc554=new _0x4ea334();var _0x3e1891=_0x1dc554['setUA'](_0x3e434f[_0x7d2c('0x80')][_0x7d2c('0x81')])[_0x7d2c('0x82')]();var _0x262cc5={'body':_0x3e434f[_0x7d2c('0x52')],'channel':_0x7d2c('0x83')};var _0x231d86=[];var _0x20cc80=[];var _0x5c3ca5={};var _0x50bf72=![];return db['CmContact'][_0x7d2c('0x59')]()['then'](function(_0x31c94f){if(!_0x31c94f){throw new db[(_0x7d2c('0x84'))]['ValidationError'](_0x7d2c('0x85'));}_0x231d86=_[_0x7d2c('0x86')](_[_0x7d2c('0x3c')](_0x31c94f),[_0x7d2c('0x87'),'updatedAt']);_0x20cc80=_[_0x7d2c('0x86')](_[_0x7d2c('0x3c')](_0x31c94f),[_0x7d2c('0x87'),_0x7d2c('0x88'),_0x7d2c('0x89'),_0x7d2c('0x8a')]);if(_0x3e434f[_0x7d2c('0x52')]['id']){delete _0x3e434f[_0x7d2c('0x52')]['id'];}if(_['isNil'](_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x8b')])){throw new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0x8d'));}if(_[_0x7d2c('0x71')](_0x3e434f[_0x7d2c('0x52')]['body'])||_0x3e434f[_0x7d2c('0x52')]['body']===''){throw new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0x8e'));}if(_['isNil'](_0x3e434f['body']['mapKey'])){throw new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20cc80);}if(!_[_0x7d2c('0x8f')](_0x20cc80,_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x90')])){throw new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0x91')+_0x20cc80);}_0x5c3ca5[_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x90')]]=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x8b')];})[_0x7d2c('0x16')](function(){return db[_0x7d2c('0x36')]['find']({'where':{'id':_0x3e434f[_0x7d2c('0x4f')]['id']},'include':[{'model':db[_0x7d2c('0x92')],'as':_0x7d2c('0x93'),'include':[{'model':db[_0x7d2c('0x94')],'as':_0x7d2c('0x95'),'where':_0x5c3ca5,'limit':0x1,'order':[[_0x7d2c('0x88'),_0x7d2c('0x96')]]}]},{'model':db[_0x7d2c('0x97')],'as':_0x7d2c('0x98')}]});})[_0x7d2c('0x16')](handleEntityNotFound(_0x1d8495,null))['then'](function(_0x451bad){if(_0x451bad&&_0x451bad[_0x7d2c('0x93')]){_0x262cc5[_0x7d2c('0x99')]=_0x451bad;_0x262cc5[_0x7d2c('0x9a')]=_0x451bad[_0x7d2c('0x98')];_0x262cc5[_0x7d2c('0x9b')]=_0x451bad[_0x7d2c('0x93')];_0x262cc5[_0x7d2c('0x9a')]=_[_0x7d2c('0x9c')](_0x262cc5[_0x7d2c('0x9a')],[_0x7d2c('0x9d')],[_0x7d2c('0x9e')]);if(_0x262cc5[_0x7d2c('0x99')][_0x7d2c('0x98')]){delete _0x262cc5[_0x7d2c('0x99')][_0x7d2c('0x98')];}if(_0x262cc5[_0x7d2c('0x99')]['List']&&_0x262cc5[_0x7d2c('0x99')][_0x7d2c('0x93')][_0x7d2c('0x95')][_0x7d2c('0x41')]){return _0x262cc5[_0x7d2c('0x99')][_0x7d2c('0x93')][_0x7d2c('0x95')][0x0];}var _0x1d6250=_[_0x7d2c('0xd')](_0x3e434f[_0x7d2c('0x52')],{'firstName':_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x8b')],'ListId':_0x451bad[_0x7d2c('0x8a')]});_0x1d6250[_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x90')]]=_0x3e434f['body'][_0x7d2c('0x8b')];return db[_0x7d2c('0x94')]['create'](_0x1d6250,{'fields':_0x231d86,'raw':!![]});}})[_0x7d2c('0x16')](handleEntityNotFound(_0x1d8495,null))[_0x7d2c('0x16')](function(_0x4ce501){_0x262cc5['contact']=_0x4ce501;var _0x134ef2=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0x9f')];if(_0x3e434f[_0x7d2c('0x80')][_0x7d2c('0xa0')]){_0x134ef2=_0x3e434f['headers'][_0x7d2c('0xa0')];}else if(_0x3e434f[_0x7d2c('0x80')][_0x7d2c('0xa1')]){_0x134ef2=_[_0x7d2c('0xa2')](_0x3e434f[_0x7d2c('0x80')]['x-forwarded-for'][_0x7d2c('0xa3')](','));}if(_0x4ce501){var _0x57122b={'ContactId':_0x4ce501['id'],'ChatWebsiteId':_0x3e434f['params']['id'],'from':(_0x4ce501[_0x7d2c('0xa4')]||'')+'\x20'+(_0x4ce501['lastName']||''),'customerIp':_0x134ef2,'customerPort':_0x3e434f[_0x7d2c('0x80')][_0x7d2c('0xa5')]?_0x3e434f[_0x7d2c('0x80')]['x-real-port']:null,'referer':_0x3e434f[_0x7d2c('0x52')]['referer'],'browserName':_0x3e1891[_0x7d2c('0xa6')][_0x7d2c('0x31')]&&_0x3e1891['browser'][_0x7d2c('0xa7')]?util[_0x7d2c('0xa8')]('%s\x20%s',_0x3e1891[_0x7d2c('0xa6')][_0x7d2c('0x31')],_0x3e1891['browser']['version']):'unknown','browserVersion':_0x3e1891[_0x7d2c('0xa6')][_0x7d2c('0xa7')]||_0x7d2c('0xa9'),'osName':util[_0x7d2c('0xa8')]('%s\x20%s',_0x3e1891['os'][_0x7d2c('0x31')],_0x3e1891['os'][_0x7d2c('0xa7')]),'osVersion':_0x3e1891['os'][_0x7d2c('0xa7')],'deviceModel':_0x3e1891[_0x7d2c('0xaa')][_0x7d2c('0x3a')]&&_0x3e1891['device']['vendor']?util[_0x7d2c('0xa8')](_0x7d2c('0xab'),_0x3e1891['device'][_0x7d2c('0x3a')],_0x3e1891['device'][_0x7d2c('0xac')],_0x3e1891[_0x7d2c('0xaa')][_0x7d2c('0x38')]):null,'deviceVendor':_0x3e1891[_0x7d2c('0xaa')]['vendor'],'deviceType':_0x3e1891[_0x7d2c('0xaa')][_0x7d2c('0x38')],'formData':JSON[_0x7d2c('0x1b')](_0x3e434f[_0x7d2c('0x52')])};var _0x526141={'ChatWebsiteId':_0x3e434f['params']['id'],'closed':![]};if(_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xad')]){_0x526141[_0x7d2c('0xad')]=_0x3e434f[_0x7d2c('0x52')]['threadId'];return db['ChatInteraction'][_0x7d2c('0x55')]({'where':_0x526141})[_0x7d2c('0x16')](function(_0x1614ff){if(_0x1614ff){return[_0x1614ff,![]];}_0x57122b['threadId']=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xad')];_0x57122b[_0x7d2c('0xae')]=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xae')];return db[_0x7d2c('0xaf')][_0x7d2c('0x51')](_0x57122b)[_0x7d2c('0x16')](function(_0x216f16){return[_0x216f16,!![]];});});}_0x526141[_0x7d2c('0xb0')]=_0x4ce501['id'];if(_0x3e434f['body'][_0x7d2c('0xb1')]&&_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xb1')]['id']){_0x526141['id']=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xb1')]['id'];return db[_0x7d2c('0xaf')][_0x7d2c('0x55')]({'where':_0x526141})['then'](function(_0x2fad2c){if(_0x2fad2c){return[_0x2fad2c,![]];}return db['ChatInteraction'][_0x7d2c('0x51')](_0x57122b)['then'](function(_0x46cd7e){return[_0x46cd7e,!![]];});});}return db[_0x7d2c('0xaf')][_0x7d2c('0x51')](_0x57122b)[_0x7d2c('0x16')](function(_0x205774){return[_0x205774,!![]];});}})['spread'](function(_0x34517f,_0x55f6e2){if(_0x34517f){_0x50bf72=_0x55f6e2;if(!_0x55f6e2){var _0x418c63={'from':(_0x262cc5['contact'][_0x7d2c('0xa4')]||'')+'\x20'+(_0x262cc5[_0x7d2c('0xb2')][_0x7d2c('0xb3')]||'')};if(_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xad')]&&_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xb4')]&&_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xad')]!=_0x3e434f[_0x7d2c('0x52')][_0x7d2c('0xb4')]){_0x418c63[_0x7d2c('0xad')]=_0x3e434f[_0x7d2c('0x52')]['messageId'];}return _0x34517f[_0x7d2c('0x2b')](_0x418c63);}else{return _0x34517f;}}})['then'](function(_0x5e0dce){_0x262cc5[_0x7d2c('0xb1')]=_0x5e0dce['get']({'plain':!![]});_0x262cc5[_0x7d2c('0xb1')]['created']=_0x50bf72;if(_0x262cc5[_0x7d2c('0xb1')][_0x7d2c('0xb5')]){if(_0x262cc5[_0x7d2c('0x99')][_0x7d2c('0xb6')]){_0x262cc5[_0x7d2c('0x9a')]['push']({'id':0x0,'priority':_0x262cc5[_0x7d2c('0x9a')][_0x7d2c('0x41')]+0x1,'app':_0x7d2c('0xb7'),'appdata':_0x7d2c('0xb8'),'interval':_0x7d2c('0xb9')});}}return db[_0x7d2c('0xba')]['create']({'body':_0x3e434f[_0x7d2c('0x52')]['body'],'ChatWebsiteId':_0x3e434f[_0x7d2c('0x4f')]['id'],'ChatInteractionId':_0x5e0dce['id'],'direction':'in','ContactId':_0x262cc5['contact']['id'],'AttachmentId':_0x3e434f[_0x7d2c('0x52')]['AttachmentId']});})[_0x7d2c('0x16')](function(_0x5944f1){_0x262cc5['message']=_0x5944f1;if(_0x262cc5[_0x7d2c('0xb1')][_0x7d2c('0xbb')]){return db[_0x7d2c('0xbc')][_0x7d2c('0x55')]({'attributes':['id',_0x7d2c('0x31')],'where':{'id':_0x262cc5[_0x7d2c('0xb1')]['UserId']}})[_0x7d2c('0x16')](function(_0x260f54){if(_0x260f54){_0x262cc5[_0x7d2c('0x9a')][_0x7d2c('0xbd')]({'id':0x0,'priority':0x0,'app':_0x7d2c('0xbe'),'appdata':_0x260f54[_0x7d2c('0x31')]+','+(_0x262cc5[_0x7d2c('0x99')][_0x7d2c('0xbf')]||0xa),'interval':_0x7d2c('0xb9')});_0x262cc5[_0x7d2c('0xc0')]=!![];}return respondWithRpcPromise(_0x7d2c('0xc1'),_0x7d2c('0xc2'),_0x262cc5);});}return respondWithRpcPromise('Start',_0x7d2c('0xc2'),_0x262cc5);})['then'](function(_0x154e7f){respondWithRpcPromise(_0x7d2c('0xc3'),_0x7d2c('0xc3'),{'event':_0x7d2c('0xc4'),'message':_0x154e7f},client9002);return _0x154e7f;})[_0x7d2c('0x16')](respondWithResult(_0x1d8495,null))[_0x7d2c('0x20')](handleError(_0x1d8495,null));};exports['offline']=function(_0x4a106b,_0x224dcc){var _0x10efc0,_0x54b45c,_0x30c376;var _0x47d50a=[];var _0x45e702={};var _0x181f6a=_0x4a106b[_0x7d2c('0xc5')]||[];var _0x5a8565=[];var _0x2b965e;return db[_0x7d2c('0x94')][_0x7d2c('0x59')]()[_0x7d2c('0x16')](function(_0x1ea782){if(!_0x1ea782){throw new db[(_0x7d2c('0x84'))]['ValidationError'](_0x7d2c('0x85'));}_0x47d50a=_[_0x7d2c('0x86')](_[_0x7d2c('0x3c')](_0x1ea782),[_0x7d2c('0x87'),_0x7d2c('0x88'),_0x7d2c('0x89'),_0x7d2c('0x8a')]);if(_0x4a106b[_0x7d2c('0x52')]['id']){delete _0x4a106b[_0x7d2c('0x52')]['id'];}if(_[_0x7d2c('0x71')](_0x4a106b[_0x7d2c('0x52')]['from'])){throw _0x224dcc[_0x7d2c('0x22')](0x1f4)[_0x7d2c('0xc6')](new db['Sequelize'][(_0x7d2c('0x8c'))](_0x7d2c('0x8d')));}if(_[_0x7d2c('0x71')](_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x52')])||_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x52')]===''){throw _0x224dcc[_0x7d2c('0x22')](0x1f4)['send'](new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0x8e')));}if(_['isNil'](_0x4a106b[_0x7d2c('0x52')]['mapKeyOffline'])){throw _0x224dcc['status'](0x1f4)[_0x7d2c('0xc6')](new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0xc7')+_0x47d50a));}if(!_[_0x7d2c('0x8f')](_0x47d50a,_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0xc8')])){throw _0x224dcc[_0x7d2c('0x22')](0x1f4)[_0x7d2c('0xc6')](new db[(_0x7d2c('0x84'))][(_0x7d2c('0x8c'))](_0x7d2c('0xc9')+_0x47d50a));}_0x45e702[_0x4a106b['body'][_0x7d2c('0xc8')]]=_0x4a106b['body'][_0x7d2c('0x8b')];})['then'](function(){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x4a106b[_0x7d2c('0x4f')]['id']},'include':[{'model':db[_0x7d2c('0x92')],'as':'List'},{'model':db[_0x7d2c('0xca')],'as':'MailAccount'}]});})[_0x7d2c('0x16')](handleEntityNotFound(_0x224dcc,null))[_0x7d2c('0x16')](function(_0x5959e3){if(_0x5959e3&&_0x5959e3['List']){_0x54b45c=_0x5959e3;var _0x3fe6a1=_[_0x7d2c('0xd')](_0x4a106b[_0x7d2c('0x52')],{'firstName':_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x8b')],'phone':_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x8b')],'ListId':_0x5959e3[_0x7d2c('0x8a')]});_0x3fe6a1[_0x4a106b[_0x7d2c('0x52')]['mapKeyOffline']]=_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x8b')];return db[_0x7d2c('0x94')][_0x7d2c('0xcb')]({'where':_0x45e702,'defaults':_0x3fe6a1});}})[_0x7d2c('0xcc')](function(_0x5af1dc){if(_0x5af1dc){_0x30c376=_0x5af1dc;var _0x162a6b=fs[_0x7d2c('0xcd')](path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],'server/files/templates/chatOfflineMessage.ejs'),_0x7d2c('0xce'));var _0x3caaf3=ejs[_0x7d2c('0xcf')](_0x162a6b,{'body':_[_0x7d2c('0xd0')](_0x4a106b[_0x7d2c('0x52')][_0x7d2c('0x52')]),'bodyTitle':_0x54b45c[_0x7d2c('0xd1')]});return db[_0x7d2c('0xd2')]['create']({'body':_0x3caaf3,'plainBody':htmlToText['fromString'](_0x3caaf3),'ContactId':_0x5af1dc['id'],'ChatWebsiteId':_0x54b45c['id']});}})[_0x7d2c('0x16')](function(_0x17eccf){_0x2b965e=_0x17eccf;if(_0x181f6a[_0x7d2c('0x41')]){var _0x35f6dd=_0x181f6a[_0x7d2c('0x35')](function(_0xfdd8e8){return{'name':_0xfdd8e8['originalname'],'basename':_0xfdd8e8[_0x7d2c('0x66')],'type':_0xfdd8e8['mimetype'],'ChatOfflineMessageId':_0x17eccf['id']};});_0x5a8565=_0x35f6dd[_0x7d2c('0x35')](_0x2cf79c=>{var _0x5adc7c={'filename':_0x2cf79c['name'],'path':path[_0x7d2c('0x6b')](config['root'],'server',_0x7d2c('0xc5'),_0x7d2c('0xd3'),_0x7d2c('0xd4'),_0x2cf79c[_0x7d2c('0xd5')])};return _0x5adc7c;});if(!_0x54b45c[_0x7d2c('0xd6')]){return db[_0x7d2c('0xd7')]['transaction'](function(_0x5b4307){return db[_0x7d2c('0xd8')][_0x7d2c('0xd9')](_0x35f6dd,{'transaction':_0x5b4307});});}}})[_0x7d2c('0x16')](function(){if(_0x2b965e){_0x10efc0=_0x2b965e;return db[_0x7d2c('0xca')][_0x7d2c('0x5e')]({'where':{'service':!![]},'include':[{'model':db[_0x7d2c('0xda')],'as':_0x7d2c('0xdb'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x378ddc){if(_0x378ddc&&_0x378ddc[_0x7d2c('0xdb')]&&_0x54b45c['forwardOffline']&&_0x54b45c[_0x7d2c('0xdc')]){var _0x323be2=_0x378ddc[_0x7d2c('0xdd')]();return respondWithRpcPromise(_0x7d2c('0xde'),_0x7d2c('0xdf'),{'account':_0x323be2,'message':{'from':util[_0x7d2c('0xa8')](_0x7d2c('0xe0'),_0x378ddc[_0x7d2c('0x31')],_0x378ddc[_0x7d2c('0xe1')]||_0x378ddc[_0x7d2c('0xdb')][_0x7d2c('0xe2')]),'to':_0x54b45c[_0x7d2c('0xdc')],'subject':_0x54b45c[_0x7d2c('0xe3')],'html':_0x10efc0[_0x7d2c('0x52')],'attachments':_0x5a8565}},client9003)['then'](function(){return _0x10efc0;})['catch'](function(_0x9acace){logger['error'](_0x9acace);});}})[_0x7d2c('0x16')](function(){if(_0x54b45c&&_0x54b45c[_0x7d2c('0xd6')]&&_0x54b45c['MailAccountId']){var _0x89628f=[];if(_0x181f6a['length']){_0x89628f=_0x181f6a[_0x7d2c('0x35')](function(_0x99e053){return{'name':_0x99e053[_0x7d2c('0xe4')],'basename':_0x99e053[_0x7d2c('0x66')],'type':_0x99e053['mimetype'],'ChatOfflineMessageId':_0x2b965e['id']};});}var _0x5d07d1;if(!_[_0x7d2c('0x71')](_0x54b45c[_0x7d2c('0xe5')])){var _0x2994a2=_[_0x7d2c('0x35')](_0x4a106b[_0x7d2c('0x52')],function(_0x46a25b){return _0x46a25b;});var _0x519145=_[_0x7d2c('0xe6')](_0x2994a2)[0x0];var _0x16be72=_[_0x7d2c('0xe7')](_0x519145,function(_0x250254){return _0x250254;});_0x5d07d1=_0x16be72[0x1][_0x54b45c['subjectOffline']];}var _0x33beeb={'from':_0x30c376[_0x7d2c('0xe1')],'firstName':_0x30c376[_0x7d2c('0xa4')],'lastName':_0x30c376[_0x7d2c('0xb3')],'mapKey':_0x7d2c('0xe1'),'message':{'from':_0x30c376['email'],'to':_0x54b45c['MailAccount'][_0x7d2c('0xe1')],'cc':'','subject':_[_0x7d2c('0x71')](_0x5d07d1)?_0x54b45c['offlineMessageSubject']:_0x5d07d1,'messageId':'','sentAt':new Date(),'attach':_0x89628f['length'],'attachments':_0x89628f,'originChannel':_0x7d2c('0xe8'),'ChatWebsiteId':_0x54b45c['id'],'ChatOfflineMessageId':_0x10efc0['id'],'originTo':_0x54b45c[_0x7d2c('0xca')][_0x7d2c('0xe1')]},'body':_0x10efc0[_0x7d2c('0x52')]};var _0x23ec5f={'account':{'id':_0x54b45c[_0x7d2c('0xe9')]},'body':_0x33beeb,'log':_0x7d2c('0xea')};return respondWithRpcPromise('NotifyMailAccount',_0x7d2c('0xeb'),_0x23ec5f,client9001)[_0x7d2c('0x16')](function(){return _0x10efc0;})['catch'](function(_0x5f36ad){logger[_0x7d2c('0x1c')](_0x5f36ad);});}return;})['then'](function(){if(_0x10efc0){return _0x10efc0;}})['then'](respondWithResult(_0x224dcc,null))['catch'](function(_0x30136e){logger[_0x7d2c('0x1c')](_0x7d2c('0x20'),_0x30136e);for(var _0x4f9355 of _0x181f6a){var _0x391609=path['join'](config[_0x7d2c('0x6c')],_0x7d2c('0xec'),_0x7d2c('0xc5'),_0x7d2c('0xd3'),_0x7d2c('0xd4'),_0x4f9355[_0x7d2c('0x66')]);fs_extra['remove'](_0x391609)[_0x7d2c('0x20')](function(_0x4b0c15){logger[_0x7d2c('0x1c')](_0x7d2c('0xed'),_0x391609,_0x4b0c15);});}});};exports[_0x7d2c('0xee')]=function(_0x49ccf7,_0x1a7e15){return db[_0x7d2c('0xaf')][_0x7d2c('0x55')]({'where':{'id':_0x49ccf7[_0x7d2c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a7e15,null))[_0x7d2c('0x16')](function(_0x5e364e){if(_0x5e364e){return _0x5e364e[_0x7d2c('0xee')](_0x49ccf7[_0x7d2c('0x52')][_0x7d2c('0x63')],_[_0x7d2c('0xef')](_0x49ccf7[_0x7d2c('0x52')],[_0x7d2c('0x63'),'id'])||{});}})[_0x7d2c('0x16')](respondWithResult(_0x1a7e15,null))[_0x7d2c('0x20')](handleError(_0x1a7e15,null));};exports[_0x7d2c('0xf0')]=function(_0x2174df,_0x3e5083){var _0x3c1810={'raw':![],'where':{}};var _0x34d95c={};var _0x24bff4={'count':0x0,'rows':[]};return db[_0x7d2c('0x36')][_0x7d2c('0x5e')]({'where':{'id':_0x2174df['params']['id']}})['then'](handleEntityNotFound(_0x3e5083,null))['then'](function(_0x917163){if(_0x917163){_0x34d95c[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db[_0x7d2c('0xaf')][_0x7d2c('0x50')]);_0x34d95c[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x2174df[_0x7d2c('0x3b')]);_0x34d95c['filters']=_['intersection'](_0x34d95c['model'],_0x34d95c['query']);_0x3c1810[_0x7d2c('0x3f')]=_['intersection'](_0x34d95c['model'],qs[_0x7d2c('0x40')](_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x3c1810[_0x7d2c('0x3f')]=_0x3c1810[_0x7d2c('0x3f')][_0x7d2c('0x41')]?_0x3c1810['attributes']:_0x34d95c['model'];if(!_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0x42')](_0x7d2c('0x43'))){_0x3c1810[_0x7d2c('0x26')]=qs[_0x7d2c('0x26')](_0x2174df['query'][_0x7d2c('0x26')]);_0x3c1810[_0x7d2c('0x25')]=qs['offset'](_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0x25')]);}_0x3c1810[_0x7d2c('0x44')]=qs[_0x7d2c('0x45')](_0x2174df['query'][_0x7d2c('0x45')]);_0x3c1810[_0x7d2c('0x47')]=qs[_0x7d2c('0x3d')](_[_0x7d2c('0x46')](_0x2174df['query'],_0x34d95c[_0x7d2c('0x3d')]));_0x3c1810[_0x7d2c('0x47')]['ChatWebsiteId']=_0x917163['id'];if(_0x2174df['query']['filter']){_0x3c1810[_0x7d2c('0x47')]=_['merge'](_0x3c1810['where'],{'$or':_[_0x7d2c('0x35')](_0x3c1810[_0x7d2c('0x3f')],function(_0x455aaa){var _0x2d936d={};_0x2d936d[_0x455aaa]={'$like':'%'+_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0x4a')]+'%'};return _0x2d936d;})});}_0x3c1810=_[_0x7d2c('0x48')]({},_0x3c1810,_0x2174df[_0x7d2c('0x4b')]);return db['ChatInteraction'][_0x7d2c('0x28')]({'where':_0x3c1810[_0x7d2c('0x47')]})['then'](function(_0x4f644b){_0x24bff4[_0x7d2c('0x28')]=_0x4f644b;if(_0x2174df['query'][_0x7d2c('0x4c')]){_0x3c1810['include']=[{'model':db[_0x7d2c('0x94')],'as':_0x7d2c('0xf1'),'required':![]},{'model':db[_0x7d2c('0xbc')],'as':'Owner','attributes':[_0x7d2c('0x31'),_0x7d2c('0xf2'),_0x7d2c('0xf3')],'required':![]},{'model':db[_0x7d2c('0xf4')],'as':_0x7d2c('0xf5'),'attributes':['id','name',_0x7d2c('0xf6')],'where':_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0xf7')]?{'id':_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0xf7')]}:undefined,'required':_0x2174df[_0x7d2c('0x3b')][_0x7d2c('0xf7')]?!![]:![]}];}return db[_0x7d2c('0xaf')][_0x7d2c('0x5f')](_0x3c1810);})[_0x7d2c('0x16')](function(_0xe2d5cd){_0x24bff4[_0x7d2c('0x4e')]=_0xe2d5cd;return _0x24bff4;});}})[_0x7d2c('0x16')](respondWithFilteredResult(_0x3e5083,_0x3c1810))[_0x7d2c('0x20')](handleError(_0x3e5083,null));};function iftimePromise(_0x3de927,_0x2d71ac){return respondWithRpcPromise(_0x7d2c('0xf8'),_0x7d2c('0xf9'),{'command':_0x2d71ac[_0x7d2c('0xfa')]?util['format']('iftime\x20%s,%s',_0x3de927[_0x7d2c('0xfb')],_0x2d71ac[_0x7d2c('0xfa')]):util[_0x7d2c('0xa8')](_0x7d2c('0xfc'),_0x3de927['interval'])},client9002)['then'](function(_0x57b105){var _0x5bad94=_0x57b105&&_0x57b105[_0x7d2c('0xfd')]('true')>=0x0?!![]:![];logger[_0x7d2c('0x17')](_0x7d2c('0xfe'),_0x2d71ac['id'],_0x3de927['id'],_0x3de927['interval'],_0x5bad94?_0x7d2c('0xff'):_0x7d2c('0x100'),_0x2d71ac[_0x7d2c('0xfa')]?_0x2d71ac['timezone']:_0x7d2c('0x101'));return _0x5bad94;})[_0x7d2c('0x20')](function(_0xf25a0b){logger[_0x7d2c('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2d71ac['id'],_0x3de927['id'],_0x3de927[_0x7d2c('0xfb')],util['inspect'](_0xf25a0b,{'showHidden':![],'depth':null}),_0x2d71ac[_0x7d2c('0xfa')]?_0x2d71ac['timezone']:_0x7d2c('0x101'));return![];});}exports['getSnippet']=function(_0x2d9216,_0x151d02){var _0x3565cc=0x0;var _0x54ace7=0x0;var _0x386159=![];var _0x1a350c;var _0x5008c0;return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x2d9216[_0x7d2c('0x4f')]['id']},'include':[{'model':db['Interval'],'as':_0x7d2c('0x102'),'include':[{'model':db[_0x7d2c('0x102')],'as':_0x7d2c('0x103'),'attributes':['id',_0x7d2c('0xfb')],'raw':!![]}]}]})[_0x7d2c('0x16')](handleEntityNotFound(_0x151d02,null))['then'](function(_0x103235){if(_0x103235){_0x1a350c=_0x103235;return _0x103235[_0x7d2c('0x104')]({'raw':!![]});}})[_0x7d2c('0x16')](function(_0x205da3){if(_0x1a350c){if(_0x205da3){_0x5008c0=_0x205da3;}}return require(_0x7d2c('0x6f'))['getLicense']();})[_0x7d2c('0x16')](function(_0x3b0e63){if(_0x3b0e63){_0x54ace7=_0x3b0e63[_0x7d2c('0x105')];_0x386159=_0x3b0e63[_0x7d2c('0x106')];}})[_0x7d2c('0x16')](function(){return db[_0x7d2c('0xaf')]['count']({'where':{'closed':![]}});})[_0x7d2c('0x16')](function(_0x3cab99){_0x3565cc=_0x3cab99;if(_0x54ace7&&_0x3cab99>_0x54ace7){return db[_0x7d2c('0x107')][_0x7d2c('0x5e')]({'where':{'id':0x1}})[_0x7d2c('0x16')](function(_0x3df6c7){if(_0x3df6c7){_0x3df6c7[_0x7d2c('0x108')]('chatLicenseExceeded');}});}})[_0x7d2c('0x16')](function(){if(_0x1a350c[_0x7d2c('0x102')]&&_0x1a350c['Interval'][_0x7d2c('0x103')]){var _0xafdadc=[];for(var _0x2c13be=0x0;_0x2c13be<_0x1a350c[_0x7d2c('0x102')]['Intervals']['length'];_0x2c13be++){var _0x530110=_0x1a350c[_0x7d2c('0x102')][_0x7d2c('0x103')][_0x2c13be][_0x7d2c('0x2d')]({'plain':!![]});_0xafdadc[_0x7d2c('0x109')](iftimePromise(_0x530110,_0x1a350c));}return BPromise['all'](_0xafdadc)[_0x7d2c('0x16')](function(_0xd769fb){return _[_0x7d2c('0x10a')](_0xd769fb);});}else{return!![];}})[_0x7d2c('0x16')](function(_0x5be9ec){var _0x5c1390=fs[_0x7d2c('0xcd')](path[_0x7d2c('0x6b')](config[_0x7d2c('0x6c')],'server/files/chat/iframe.ejs'),_0x7d2c('0xce'));var _0x463c55=new url['URL'](_0x1a350c['address'])[_0x7d2c('0x10b')];var _0xa4c250='3.1.0';var _0x2ac71c=![];var _0x18e98e={'chatVersion':_0xa4c250,'chatWebsiteAddressOrigin':_0x463c55,'remote':_0x1a350c[_0x7d2c('0x10c')],'query':querystring[_0x7d2c('0x1b')](_[_0x7d2c('0x48')](_0x1a350c[_0x7d2c('0x2d')]({'plain':!![]}),{'customerIp':_0x2d9216[_0x7d2c('0x80')]['x-forwarded-for']||_0x2d9216['headers'][_0x7d2c('0x10d')]||_0x2d9216['connection'][_0x7d2c('0x10e')]||_0x2d9216['ip'],'referer':_0x2d9216['headers'][_0x7d2c('0x10f')],'openedInteractions':_0x3565cc,'maxInteractions':_0x54ace7,'virtual':_0x386159[_0x7d2c('0x105')],'online':_0x5be9ec,'custom':_0x386159}))['replace'](/'/g,'\x5c\x27')};_0x151d02[_0x7d2c('0xc6')](ejs[_0x7d2c('0xcf')](Mustache[_0x7d2c('0xcf')](_0x5c1390,_0x18e98e),{'proactiveActions':_0x5008c0,'alignment':_0x1a350c[_0x7d2c('0x110')],'verticalAlignment':_0x1a350c[_0x7d2c('0x111')],'div_color':_0x1a350c[_0x7d2c('0xf6')],'labelText':_0x1a350c[_0x7d2c('0x112')],'text_color':_0x1a350c[_0x7d2c('0x113')],'text_button_color':_0x1a350c[_0x7d2c('0x114')],'button_color':_0x1a350c[_0x7d2c('0x115')],'background_color':_0x1a350c['backgroundColor'],'hideWhenOffline':_0x1a350c['hideWhenOffline'],'intervalId':_0x1a350c[_0x7d2c('0x116')],'isDevelopment':_0x2ac71c,'chatVersion':_0xa4c250}));})['catch'](handleError(_0x151d02,null));};exports[_0x7d2c('0x117')]=function(_0x512138,_0x566428){var _0x1dd0cf=_0x512138[_0x7d2c('0x4f')]['id'];var _0x918f38=_0x512138['body'];var _0x3bbf37=0xc8;var _0x2ecd5c=null;return db[_0x7d2c('0xd7')][_0x7d2c('0x118')]({'isolationLevel':db[_0x7d2c('0xd7')][_0x7d2c('0x119')][_0x7d2c('0x11a')][_0x7d2c('0x11b')]},function(_0x3df260){return db[_0x7d2c('0x36')]['findOne']({'where':{'id':_0x1dd0cf},'transaction':_0x3df260})[_0x7d2c('0x16')](function(_0x953c0c){if(_0x953c0c){return db[_0x7d2c('0x97')][_0x7d2c('0x2c')]({'where':{'ChatWebsiteId':_0x1dd0cf},'transaction':_0x3df260})[_0x7d2c('0x16')](function(){var _0x4e3794=_[_0x7d2c('0x35')](_0x918f38,function(_0x3d06e7){_0x3d06e7[_0x7d2c('0x5b')]=_0x1dd0cf;return _0x3d06e7;});return db['ChatApplication']['bulkCreate'](_0x4e3794,{'transaction':_0x3df260});});}else{_0x3bbf37=0x194;_0x2ecd5c=[];}});})[_0x7d2c('0x16')](function(){if(_0x3bbf37!==0x194){return db[_0x7d2c('0x97')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1dd0cf},'order':_0x7d2c('0x9d')})[_0x7d2c('0x16')](function(_0x2974b5){_0x2ecd5c=_0x2974b5;});}})['catch'](function(_0x1f8660){_0x3bbf37=0x1f4;logger[_0x7d2c('0x1c')](_0x1f8660[_0x7d2c('0x30')]);if(_0x1f8660[_0x7d2c('0x31')]){delete _0x1f8660[_0x7d2c('0x31')];}_0x2ecd5c=_0x1f8660;})[_0x7d2c('0x11c')](function(){if(_0x2ecd5c===null){_0x566428[_0x7d2c('0x21')](_0x3bbf37);}else{if(_0x3bbf37===0x1f4){_0x566428['status'](_0x3bbf37)[_0x7d2c('0xc6')](_0x2ecd5c);}else{_0x566428['status'](_0x3bbf37)['json'](_0x2ecd5c);}}});};exports[_0x7d2c('0x11d')]=function(_0x463a32,_0x3778b4){var _0x414143={};var _0x5b48c1={};var _0x170c59;var _0x41ef0f;return db[_0x7d2c('0x36')][_0x7d2c('0x5e')]({'where':{'id':_0x463a32[_0x7d2c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3778b4,null))[_0x7d2c('0x16')](function(_0x2fdfcb){if(_0x2fdfcb){_0x170c59=_0x2fdfcb;_0x5b48c1['model']=_[_0x7d2c('0x3c')](db[_0x7d2c('0x97')]['rawAttributes']);_0x5b48c1[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x463a32[_0x7d2c('0x3b')]);_0x5b48c1[_0x7d2c('0x3d')]=_['intersection'](_0x5b48c1[_0x7d2c('0x3a')],_0x5b48c1['query']);_0x414143[_0x7d2c('0x3f')]=_[_0x7d2c('0x3e')](_0x5b48c1[_0x7d2c('0x3a')],qs['fields'](_0x463a32[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x414143[_0x7d2c('0x3f')]=_0x414143['attributes'][_0x7d2c('0x41')]?_0x414143[_0x7d2c('0x3f')]:_0x5b48c1[_0x7d2c('0x3a')];_0x414143[_0x7d2c('0x44')]=qs['sort'](_0x463a32[_0x7d2c('0x3b')]['sort']);_0x414143['where']=qs['filters'](_[_0x7d2c('0x46')](_0x463a32[_0x7d2c('0x3b')],_0x5b48c1[_0x7d2c('0x3d')]));if(_0x463a32[_0x7d2c('0x3b')][_0x7d2c('0x4a')]){_0x414143[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x414143['where'],{'$or':_[_0x7d2c('0x35')](_0x414143[_0x7d2c('0x3f')],function(_0x612c77){var _0x35930f={};_0x35930f[_0x612c77]={'$like':'%'+_0x463a32[_0x7d2c('0x3b')]['filter']+'%'};return _0x35930f;})});}_0x414143=_['merge']({},_0x414143,_0x463a32['options']);return _0x170c59[_0x7d2c('0x11d')](_0x414143);}})[_0x7d2c('0x16')](function(_0x3647eb){if(_0x3647eb){_0x41ef0f=_0x3647eb[_0x7d2c('0x41')];if(!_0x463a32[_0x7d2c('0x3b')][_0x7d2c('0x42')](_0x7d2c('0x43'))){_0x414143[_0x7d2c('0x26')]=qs['limit'](_0x463a32[_0x7d2c('0x3b')]['limit']);_0x414143['offset']=qs[_0x7d2c('0x25')](_0x463a32['query']['offset']);}return _0x170c59['getApplications'](_0x414143);}})[_0x7d2c('0x16')](function(_0x5e416f){if(_0x5e416f){return _0x5e416f?{'count':_0x41ef0f,'rows':_0x5e416f}:null;}})[_0x7d2c('0x16')](respondWithResult(_0x3778b4,null))[_0x7d2c('0x20')](handleError(_0x3778b4,null));};exports['addProactiveActions']=function(_0x458ce0,_0x5e8a13){return db[_0x7d2c('0x11e')][_0x7d2c('0x55')]({'where':{'id':_0x458ce0[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x5e8a13,null))[_0x7d2c('0x16')](function(_0x6adc15){if(_0x6adc15){return _0x6adc15[_0x7d2c('0x11f')](_0x458ce0[_0x7d2c('0x52')]['ids'],_[_0x7d2c('0xef')](_0x458ce0[_0x7d2c('0x52')],[_0x7d2c('0x63'),'id'])||{});}})[_0x7d2c('0x16')](respondWithResult(_0x5e8a13,null))[_0x7d2c('0x20')](handleError(_0x5e8a13,null));};exports[_0x7d2c('0x104')]=function(_0x389838,_0x11d38){var _0x3ef8cf={};var _0x29c04c={};var _0x5a7a82;var _0x52c72b;return db[_0x7d2c('0x36')]['findOne']({'where':{'id':_0x389838[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x11d38,null))[_0x7d2c('0x16')](function(_0x4269d1){if(_0x4269d1){_0x5a7a82=_0x4269d1;_0x29c04c[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db[_0x7d2c('0x120')][_0x7d2c('0x50')]);_0x29c04c[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x389838[_0x7d2c('0x3b')]);_0x29c04c[_0x7d2c('0x3d')]=_[_0x7d2c('0x3e')](_0x29c04c['model'],_0x29c04c[_0x7d2c('0x3b')]);_0x3ef8cf[_0x7d2c('0x3f')]=_[_0x7d2c('0x3e')](_0x29c04c['model'],qs['fields'](_0x389838['query']['fields']));_0x3ef8cf['attributes']=_0x3ef8cf['attributes'][_0x7d2c('0x41')]?_0x3ef8cf[_0x7d2c('0x3f')]:_0x29c04c[_0x7d2c('0x3a')];_0x3ef8cf['order']=qs[_0x7d2c('0x45')](_0x389838[_0x7d2c('0x3b')]['sort']);_0x3ef8cf[_0x7d2c('0x47')]=qs[_0x7d2c('0x3d')](_['pick'](_0x389838[_0x7d2c('0x3b')],_0x29c04c[_0x7d2c('0x3d')]));if(_0x389838[_0x7d2c('0x3b')][_0x7d2c('0x4a')]){_0x3ef8cf['where']=_[_0x7d2c('0x48')](_0x3ef8cf[_0x7d2c('0x47')],{'$or':_[_0x7d2c('0x35')](_0x3ef8cf[_0x7d2c('0x3f')],function(_0x2579ce){var _0x526756={};_0x526756[_0x2579ce]={'$like':'%'+_0x389838['query'][_0x7d2c('0x4a')]+'%'};return _0x526756;})});}_0x3ef8cf=_[_0x7d2c('0x48')]({},_0x3ef8cf,_0x389838[_0x7d2c('0x4b')]);return _0x5a7a82[_0x7d2c('0x104')](_0x3ef8cf);}})[_0x7d2c('0x16')](function(_0x42602e){if(_0x42602e){_0x52c72b=_0x42602e[_0x7d2c('0x41')];if(!_0x389838[_0x7d2c('0x3b')][_0x7d2c('0x42')]('nolimit')){_0x3ef8cf[_0x7d2c('0x26')]=qs['limit'](_0x389838[_0x7d2c('0x3b')][_0x7d2c('0x26')]);_0x3ef8cf[_0x7d2c('0x25')]=qs[_0x7d2c('0x25')](_0x389838[_0x7d2c('0x3b')][_0x7d2c('0x25')]);}return _0x5a7a82[_0x7d2c('0x104')](_0x3ef8cf);}})[_0x7d2c('0x16')](function(_0x2bed6e){if(_0x2bed6e){return _0x2bed6e?{'count':_0x52c72b,'rows':_0x2bed6e}:null;}})[_0x7d2c('0x16')](respondWithResult(_0x11d38,null))['catch'](handleError(_0x11d38,null));};exports[_0x7d2c('0x121')]=function(_0x1635c3,_0x385ae5){var _0x34d6a6=_0x1635c3[_0x7d2c('0x3b')]['online']==='false'?'offlineForm':_0x7d2c('0x122');return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'attributes':['id',_0x34d6a6],'where':{'id':_0x1635c3[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x385ae5,null))[_0x7d2c('0x16')](function(_0x39fbff){if(_0x39fbff){var _0x4299d1=_0x39fbff[_0x34d6a6];var _0x4e67b2=_0x4299d1&&_0x4299d1['items']?_0x4299d1[_0x7d2c('0x123')]:[];_0x385ae5[_0x7d2c('0xc6')]({'fromKey':_[_0x7d2c('0x71')](_0x4299d1['fromKey'])?undefined:_0x4299d1['fromKey'],'count':_0x4e67b2[_0x7d2c('0x41')],'rows':_0x4e67b2});}})[_0x7d2c('0x20')](handleError(_0x385ae5,null));};exports[_0x7d2c('0x124')]=function(_0x5ebac0,_0x227845){var _0x2003d3={'raw':![],'where':{}};var _0x10c9c0={};var _0x57fb94={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7d2c('0x5e')]({'where':{'id':_0x5ebac0[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x227845,null))[_0x7d2c('0x16')](function(_0x4488eb){if(_0x4488eb){_0x10c9c0[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db[_0x7d2c('0xd2')]['rawAttributes']);_0x10c9c0[_0x7d2c('0x3b')]=_[_0x7d2c('0x3c')](_0x5ebac0[_0x7d2c('0x3b')]);_0x10c9c0[_0x7d2c('0x3d')]=_[_0x7d2c('0x3e')](_0x10c9c0[_0x7d2c('0x3a')],_0x10c9c0[_0x7d2c('0x3b')]);_0x2003d3[_0x7d2c('0x3f')]=_[_0x7d2c('0x3e')](_0x10c9c0[_0x7d2c('0x3a')],qs['fields'](_0x5ebac0[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x2003d3['attributes']=_0x2003d3['attributes'][_0x7d2c('0x41')]?_0x2003d3[_0x7d2c('0x3f')]:_0x10c9c0['model'];if(!_0x5ebac0[_0x7d2c('0x3b')][_0x7d2c('0x42')]('nolimit')){_0x2003d3[_0x7d2c('0x26')]=qs[_0x7d2c('0x26')](_0x5ebac0[_0x7d2c('0x3b')]['limit']);_0x2003d3[_0x7d2c('0x25')]=qs['offset'](_0x5ebac0[_0x7d2c('0x3b')]['offset']);}_0x2003d3['order']=qs['sort'](_0x5ebac0[_0x7d2c('0x3b')][_0x7d2c('0x45')]);_0x2003d3[_0x7d2c('0x47')]=qs['filters'](_[_0x7d2c('0x46')](_0x5ebac0[_0x7d2c('0x3b')],_0x10c9c0['filters']));_0x2003d3[_0x7d2c('0x47')]['ChatWebsiteId']=_0x4488eb['id'];if(_0x5ebac0[_0x7d2c('0x3b')][_0x7d2c('0x4a')]){_0x2003d3[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x2003d3[_0x7d2c('0x47')],{'$or':_[_0x7d2c('0x35')](_0x2003d3[_0x7d2c('0x3f')],function(_0x2c826b){var _0x5a500f={};_0x5a500f[_0x2c826b]={'$like':'%'+_0x5ebac0[_0x7d2c('0x3b')]['filter']+'%'};return _0x5a500f;})});}_0x2003d3=_[_0x7d2c('0x48')]({},_0x2003d3,_0x5ebac0[_0x7d2c('0x4b')]);return db[_0x7d2c('0xd2')]['count']({'where':_0x2003d3[_0x7d2c('0x47')]})['then'](function(_0xf391df){_0x57fb94[_0x7d2c('0x28')]=_0xf391df;if(_0x5ebac0['query']['includeAll']){_0x2003d3['include']=[{'all':!![]}];}else{_0x2003d3[_0x7d2c('0x4d')]=[{'model':db['CmContact'],'as':_0x7d2c('0xf1'),'required':![]},{'model':db[_0x7d2c('0xd8')],'as':_0x7d2c('0x125'),'required':![]}];}return db[_0x7d2c('0xd2')]['findAll'](_0x2003d3);})[_0x7d2c('0x16')](function(_0x274bfa){_0x57fb94[_0x7d2c('0x4e')]=_0x274bfa;return _0x57fb94;});}})['then'](respondWithFilteredResult(_0x227845,_0x2003d3))[_0x7d2c('0x20')](handleError(_0x227845,null));};exports[_0x7d2c('0x126')]=function(_0x17dd8d,_0x4c74c9){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x17dd8d['params']['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x4c74c9,null))[_0x7d2c('0x16')](function(_0x472ddc){if(_0x472ddc){return _0x472ddc[_0x7d2c('0x126')](_0x17dd8d[_0x7d2c('0x52')][_0x7d2c('0x63')],_['omit'](_0x17dd8d[_0x7d2c('0x52')],[_0x7d2c('0x63'),'id'])||{})[_0x7d2c('0xcc')](function(_0x4324ef){for(var _0x47eb84=0x0;_0x47eb84<_0x17dd8d[_0x7d2c('0x52')][_0x7d2c('0x63')][_0x7d2c('0x41')];_0x47eb84+=0x1){socket[_0x7d2c('0x127')](_0x7d2c('0x128'),{'UserId':Number(_0x17dd8d[_0x7d2c('0x52')]['ids'][_0x47eb84]),'ChatWebsiteId':Number(_0x17dd8d['params']['id'])});}return _0x4324ef;});}})[_0x7d2c('0x16')](respondWithResult(_0x4c74c9,null))[_0x7d2c('0x20')](handleError(_0x4c74c9,null));};exports[_0x7d2c('0x129')]=function(_0x1008c7,_0x58a74e){return db[_0x7d2c('0x36')][_0x7d2c('0x55')]({'where':{'id':_0x1008c7['params']['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x58a74e,null))[_0x7d2c('0x16')](function(_0x293032){if(_0x293032){return _0x293032[_0x7d2c('0x129')](_0x1008c7['query'][_0x7d2c('0x63')])[_0x7d2c('0x16')](function(){if(_[_0x7d2c('0x12a')](_0x1008c7[_0x7d2c('0x3b')][_0x7d2c('0x63')])){for(var _0x3e927b=0x0;_0x3e927b<_0x1008c7[_0x7d2c('0x3b')]['ids'][_0x7d2c('0x41')];_0x3e927b+=0x1){socket['emit'](_0x7d2c('0x12b'),{'UserId':Number(_0x1008c7['query'][_0x7d2c('0x63')][_0x3e927b]),'ChatWebsiteId':Number(_0x1008c7['params']['id'])});}}else{socket[_0x7d2c('0x127')](_0x7d2c('0x12b'),{'UserId':Number(_0x1008c7[_0x7d2c('0x3b')][_0x7d2c('0x63')]),'ChatWebsiteId':Number(_0x1008c7[_0x7d2c('0x4f')]['id'])});}});}})[_0x7d2c('0x16')](respondWithStatusCode(_0x58a74e,null))['catch'](handleError(_0x58a74e,null));};exports['getAgents']=function(_0x52d93e,_0x30c0ed){var _0x4c3036={};var _0x57b799={};var _0x358fd;var _0x537f8c;return db[_0x7d2c('0x36')][_0x7d2c('0x5e')]({'where':{'id':_0x52d93e[_0x7d2c('0x4f')]['id']}})[_0x7d2c('0x16')](handleEntityNotFound(_0x30c0ed,null))[_0x7d2c('0x16')](function(_0x38c37b){if(_0x38c37b){_0x358fd=_0x38c37b;_0x57b799[_0x7d2c('0x3a')]=_[_0x7d2c('0x3c')](db[_0x7d2c('0xbc')][_0x7d2c('0x50')]);_0x57b799[_0x7d2c('0x3b')]=_['keys'](_0x52d93e[_0x7d2c('0x3b')]);_0x57b799['filters']=_['intersection'](_0x57b799[_0x7d2c('0x3a')],_0x57b799[_0x7d2c('0x3b')]);_0x4c3036[_0x7d2c('0x3f')]=_['intersection'](_0x57b799[_0x7d2c('0x3a')],qs[_0x7d2c('0x40')](_0x52d93e[_0x7d2c('0x3b')][_0x7d2c('0x40')]));_0x4c3036[_0x7d2c('0x3f')]=_0x4c3036[_0x7d2c('0x3f')][_0x7d2c('0x41')]?_0x4c3036['attributes']:_0x57b799[_0x7d2c('0x3a')];_0x4c3036[_0x7d2c('0x44')]=qs['sort'](_0x52d93e['query']['sort']);_0x4c3036['where']=qs[_0x7d2c('0x3d')](_['pick'](_0x52d93e[_0x7d2c('0x3b')],_0x57b799['filters']));if(_0x52d93e[_0x7d2c('0x3b')][_0x7d2c('0x4a')]){_0x4c3036[_0x7d2c('0x47')]=_[_0x7d2c('0x48')](_0x4c3036[_0x7d2c('0x47')],{'$or':_[_0x7d2c('0x35')](_0x4c3036[_0x7d2c('0x3f')],function(_0x40b09a){var _0xe0efcf={};_0xe0efcf[_0x40b09a]={'$like':'%'+_0x52d93e[_0x7d2c('0x3b')][_0x7d2c('0x4a')]+'%'};return _0xe0efcf;})});}_0x4c3036=_['merge']({},_0x4c3036,_0x52d93e[_0x7d2c('0x4b')]);return _0x358fd[_0x7d2c('0x12c')](_0x4c3036);}})[_0x7d2c('0x16')](function(_0x146fd4){if(_0x146fd4){_0x537f8c=_0x146fd4[_0x7d2c('0x41')];if(!_0x52d93e[_0x7d2c('0x3b')]['hasOwnProperty'](_0x7d2c('0x43'))){_0x4c3036[_0x7d2c('0x26')]=qs['limit'](_0x52d93e[_0x7d2c('0x3b')][_0x7d2c('0x26')]);_0x4c3036[_0x7d2c('0x25')]=qs['offset'](_0x52d93e['query'][_0x7d2c('0x25')]);}return _0x358fd[_0x7d2c('0x12c')](_0x4c3036);}})['then'](function(_0x42c15a){if(_0x42c15a){return _0x42c15a?{'count':_0x537f8c,'rows':_0x42c15a}:null;}})[_0x7d2c('0x16')](respondWithResult(_0x30c0ed,null))[_0x7d2c('0x20')](handleError(_0x30c0ed,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index ac87870..e42eb58 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 _0x769c=['events','ChatWebsite','setMaxListeners','remove','emit','exports'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x769c,0x96));var _0xc769=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x769c[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0xc769('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xc769('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc769('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc769('0x3')};function emitEvent(_0x25dc31){return function(_0x21f114,_0x3409d2,_0x5aed51){ChatWebsiteEvents[_0xc769('0x4')](_0x25dc31+':'+_0x21f114['id'],_0x21f114);ChatWebsiteEvents[_0xc769('0x4')](_0x25dc31,_0x21f114);_0x5aed51(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc769('0x5')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5697=['ChatWebsite','setMaxListeners','save','hook','exports','events'];(function(_0x3e95cb,_0x4f5933){var _0x2c2e48=function(_0x569577){while(--_0x569577){_0x3e95cb['push'](_0x3e95cb['shift']());}};_0x2c2e48(++_0x4f5933);}(_0x5697,0x1b5));var _0x7569=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0x5697[_0x340d75];return _0x3f1114;};'use strict';var EventEmitter=require(_0x7569('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x7569('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x7569('0x2')](0x0);var events={'afterCreate':_0x7569('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4eff57){return function(_0x499e06,_0x48340f,_0x32db80){ChatWebsiteEvents['emit'](_0x4eff57+':'+_0x499e06['id'],_0x499e06);ChatWebsiteEvents['emit'](_0x4eff57,_0x499e06);_0x32db80(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x7569('0x4')](e,emitEvent(event));}}module[_0x7569('0x5')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b477c89..2141b2a 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 _0x7f20=['../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x7f20,0x178));var _0x07f2=function(_0x4392d2,_0x438f52){_0x4392d2=_0x4392d2-0x0;var _0xff44ba=_0x7f20[_0x4392d2];return _0xff44ba;};'use strict';var _=require(_0x07f2('0x0'));var util=require(_0x07f2('0x1'));var logger=require(_0x07f2('0x2'))(_0x07f2('0x3'));var moment=require(_0x07f2('0x4'));var BPromise=require(_0x07f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07f2('0x6'));var rimraf=require(_0x07f2('0x7'));var config=require(_0x07f2('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x5ab397,_0x1fe7ac){return _0x5ab397[_0x07f2('0x9')](_0x07f2('0xa'),attributes,{'tableName':_0x07f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc10=['../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','api','moment','path'];(function(_0x4ebf01,_0x96e1c4){var _0x7f2f65=function(_0x997311){while(--_0x997311){_0x4ebf01['push'](_0x4ebf01['shift']());}};_0x7f2f65(++_0x96e1c4);}(_0xcc10,0x7d));var _0x0cc1=function(_0x284ca1,_0x8d4369){_0x284ca1=_0x284ca1-0x0;var _0xbe5fec=_0xcc10[_0x284ca1];return _0xbe5fec;};'use strict';var _=require(_0x0cc1('0x0'));var util=require(_0x0cc1('0x1'));var logger=require('../../config/logger')(_0x0cc1('0x2'));var moment=require(_0x0cc1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cc1('0x4'));var rimraf=require('rimraf');var config=require(_0x0cc1('0x5'));var attributes=require(_0x0cc1('0x6'));module[_0x0cc1('0x7')]=function(_0x99a8a7,_0xdfeb62){return _0x99a8a7['define'](_0x0cc1('0x8'),attributes,{'tableName':_0x0cc1('0x9'),'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 266f5d2..7eda96f 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 _0x5ad7=['client','http','redis','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x11f15e,_0x2cc181){var _0x27dad5=function(_0x245de4){while(--_0x245de4){_0x11f15e['push'](_0x11f15e['shift']());}};_0x27dad5(++_0x2cc181);}(_0x5ad7,0xfc));var _0x75ad=function(_0xdf0915,_0xd4f76d){_0xdf0915=_0xdf0915-0x0;var _0x2f7d92=_0x5ad7[_0xdf0915];return _0x2f7d92;};'use strict';var _=require('lodash');var util=require(_0x75ad('0x0'));var moment=require(_0x75ad('0x1'));var BPromise=require(_0x75ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75ad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x75ad('0x4'));var logger=require(_0x75ad('0x5'))(_0x75ad('0x6'));var config=require('../../config/environment');var jayson=require(_0x75ad('0x7'));var client=jayson[_0x75ad('0x8')][_0x75ad('0x9')]({'port':0x232a});config[_0x75ad('0xa')]=_['defaults'](config[_0x75ad('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x75ad('0xb'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x75ad('0xc')](socket);function respondWithRpcPromise(_0x32a23a,_0x1a0d10,_0x13be17){return new BPromise(function(_0x48a4df,_0x25720b){return client[_0x75ad('0xd')](_0x32a23a,_0x13be17)[_0x75ad('0xe')](function(_0x433189){logger['info'](_0x75ad('0xf'),_0x1a0d10,'request\x20sent');logger[_0x75ad('0x10')](_0x75ad('0x11'),_0x1a0d10,_0x75ad('0x12'),JSON[_0x75ad('0x13')](_0x433189));if(_0x433189['error']){if(_0x433189[_0x75ad('0x14')][_0x75ad('0x15')]===0x1f4){logger['error'](_0x75ad('0xf'),_0x1a0d10,_0x433189[_0x75ad('0x14')][_0x75ad('0x16')]);return _0x25720b(_0x433189[_0x75ad('0x14')][_0x75ad('0x16')]);}logger[_0x75ad('0x14')](_0x75ad('0xf'),_0x1a0d10,_0x433189['error'][_0x75ad('0x16')]);return _0x48a4df(_0x433189[_0x75ad('0x14')][_0x75ad('0x16')]);}else{logger[_0x75ad('0x17')](_0x75ad('0xf'),_0x1a0d10,_0x75ad('0x12'));_0x48a4df(_0x433189[_0x75ad('0x18')]['message']);}})[_0x75ad('0x19')](function(_0x8226d5){logger[_0x75ad('0x14')](_0x75ad('0xf'),_0x1a0d10,_0x8226d5);_0x25720b(_0x8226d5);});});} \ No newline at end of file +var _0x8675=['ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','debug'];(function(_0x5c6ef0,_0x40b9a1){var _0x1db1a9=function(_0x97598d){while(--_0x97598d){_0x5c6ef0['push'](_0x5c6ef0['shift']());}};_0x1db1a9(++_0x40b9a1);}(_0x8675,0xdf));var _0x5867=function(_0x2b3248,_0x4681c3){_0x2b3248=_0x2b3248-0x0;var _0x4c273=_0x8675[_0x2b3248];return _0x4c273;};'use strict';var _=require(_0x5867('0x0'));var util=require('util');var moment=require(_0x5867('0x1'));var BPromise=require(_0x5867('0x2'));var rs=require(_0x5867('0x3'));var fs=require('fs');var Redis=require(_0x5867('0x4'));var db=require(_0x5867('0x5'))['db'];var utils=require(_0x5867('0x6'));var logger=require(_0x5867('0x7'))(_0x5867('0x8'));var config=require(_0x5867('0x9'));var jayson=require(_0x5867('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x5867('0xb')]=_[_0x5867('0xc')](config[_0x5867('0xb')],{'host':_0x5867('0xd'),'port':0x18eb});var socket=require(_0x5867('0xe'))(new Redis(config[_0x5867('0xb')]));require(_0x5867('0xf'))[_0x5867('0x10')](socket);function respondWithRpcPromise(_0x437820,_0x18be77,_0x238e16){return new BPromise(function(_0x322f1f,_0xcc2c6e){return client[_0x5867('0x11')](_0x437820,_0x238e16)['then'](function(_0x4cc23b){logger['info'](_0x5867('0x12'),_0x18be77,'request\x20sent');logger[_0x5867('0x13')](_0x5867('0x14'),_0x18be77,_0x5867('0x15'),JSON[_0x5867('0x16')](_0x4cc23b));if(_0x4cc23b[_0x5867('0x17')]){if(_0x4cc23b['error']['code']===0x1f4){logger[_0x5867('0x17')](_0x5867('0x12'),_0x18be77,_0x4cc23b['error'][_0x5867('0x18')]);return _0xcc2c6e(_0x4cc23b[_0x5867('0x17')][_0x5867('0x18')]);}logger['error'](_0x5867('0x12'),_0x18be77,_0x4cc23b[_0x5867('0x17')]['message']);return _0x322f1f(_0x4cc23b[_0x5867('0x17')][_0x5867('0x18')]);}else{logger[_0x5867('0x19')](_0x5867('0x12'),_0x18be77,'request\x20sent');_0x322f1f(_0x4cc23b['result']['message']);}})[_0x5867('0x1a')](function(_0x56732b){logger[_0x5867('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x18be77,_0x56732b);_0xcc2c6e(_0x56732b);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fccd2c4..87c4491 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 _0x1a75=['register','length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a75,0xb9));var _0x51a7=function(_0x1b5379,_0x41ce5b){_0x1b5379=_0x1b5379-0x0;var _0x77124e=_0x1a75[_0x1b5379];return _0x77124e;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x51a7('0x0'),_0x51a7('0x1'),'update'];function createListener(_0x173f4e,_0x21c98a){return function(_0x2bb4e8){_0x21c98a[_0x51a7('0x2')](_0x173f4e,_0x2bb4e8);};}function removeListener(_0x2a6f68,_0x24c3a7){return function(){ChatWebsiteEvents[_0x51a7('0x3')](_0x2a6f68,_0x24c3a7);};}exports[_0x51a7('0x4')]=function(_0x1a653e){for(var _0x34a9b3=0x0,_0x27e6a3=events[_0x51a7('0x5')];_0x34a9b3<_0x27e6a3;_0x34a9b3++){var _0x20dcfb=events[_0x34a9b3];var _0x175912=createListener(_0x51a7('0x6')+_0x20dcfb,_0x1a653e);ChatWebsiteEvents['on'](_0x20dcfb,_0x175912);}}; \ No newline at end of file +var _0x5079=['remove','update','length','save'];(function(_0x138386,_0x2a3ea6){var _0x20fac1=function(_0x3398e9){while(--_0x3398e9){_0x138386['push'](_0x138386['shift']());}};_0x20fac1(++_0x2a3ea6);}(_0x5079,0x17b));var _0x9507=function(_0x20d6f0,_0x33e54c){_0x20d6f0=_0x20d6f0-0x0;var _0x105ceb=_0x5079[_0x20d6f0];return _0x105ceb;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x9507('0x0'),_0x9507('0x1'),_0x9507('0x2')];function createListener(_0x4ce57b,_0xfdf200){return function(_0x3e0e9e){_0xfdf200['emit'](_0x4ce57b,_0x3e0e9e);};}function removeListener(_0x146cdb,_0x1e9e62){return function(){ChatWebsiteEvents['removeListener'](_0x146cdb,_0x1e9e62);};}exports['register']=function(_0x18299f){for(var _0x27226b=0x0,_0xecfcc5=events[_0x9507('0x3')];_0x27226b<_0xecfcc5;_0x27226b++){var _0x478fd8=events[_0x27226b];var _0x8c1256=createListener('chatWebsite:'+_0x478fd8,_0x18299f);ChatWebsiteEvents['on'](_0x478fd8,_0x8c1256);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index fef2e96..6a57991 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 _0xc0f0=['getSnippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getAgents','create','post','addDisposition','addAnswer','join','format','%s-%s','/:id/logo','single','addLogo','root','server/files/images/avatars/','now','originalname','file','diskStorage','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x48bfeb,_0x170426){var _0x5d085e=function(_0x24ae5b){while(--_0x24ae5b){_0x48bfeb['push'](_0x48bfeb['shift']());}};_0x5d085e(++_0x170426);}(_0xc0f0,0x18d));var _0x0c0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0f0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0c0f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c0f('0x1'));var router=express[_0x0c0f('0x2')]();var fs_extra=require(_0x0c0f('0x3'));var auth=require(_0x0c0f('0x4'));var interaction=require(_0x0c0f('0x5'));var config=require('../../config/environment');var controller=require(_0x0c0f('0x6'));router[_0x0c0f('0x7')]('/',auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x9')]);router[_0x0c0f('0x7')](_0x0c0f('0xa'),auth['isAuthenticated'](),controller[_0x0c0f('0xb')]);router[_0x0c0f('0x7')](_0x0c0f('0xc'),auth[_0x0c0f('0x8')](),controller['show']);router[_0x0c0f('0x7')](_0x0c0f('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x0c0f('0xe'),auth['isAuthenticated'](),controller[_0x0c0f('0xf')]);router[_0x0c0f('0x7')]('/:id/logo',controller[_0x0c0f('0x10')]);router[_0x0c0f('0x7')](_0x0c0f('0x11'),controller['getAvatar']);router[_0x0c0f('0x7')]('/:id/customer_avatar',controller[_0x0c0f('0x12')]);router[_0x0c0f('0x7')](_0x0c0f('0x13'),controller['getSystemAvatar']);router[_0x0c0f('0x7')](_0x0c0f('0x14'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x15')]);router['get'](_0x0c0f('0x16'),controller[_0x0c0f('0x17')]);router[_0x0c0f('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0c0f('0x18')]);router['get'](_0x0c0f('0x19'),auth[_0x0c0f('0x8')](),controller['getProactiveActions']);router[_0x0c0f('0x7')](_0x0c0f('0x1a'),controller[_0x0c0f('0x1b')]);router['get'](_0x0c0f('0x1c'),auth[_0x0c0f('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0c0f('0x1e')]);router[_0x0c0f('0x1f')](_0x0c0f('0xd'),auth['isAuthenticated'](),controller[_0x0c0f('0x20')]);router[_0x0c0f('0x1f')](_0x0c0f('0xe'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x158e26,_0x18d711,_0x57258a){_0x57258a(null,path[_0x0c0f('0x22')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2d8d58,_0x441678,_0x1934f2){_0x1934f2(null,util[_0x0c0f('0x23')](_0x0c0f('0x24'),Date['now'](),_0x441678['originalname']));}})});router[_0x0c0f('0x1f')](_0x0c0f('0x25'),upload[_0x0c0f('0x26')]('file'),controller[_0x0c0f('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3862b2,_0x531eec,_0x48f29f){_0x48f29f(null,path['join'](config[_0x0c0f('0x28')],_0x0c0f('0x29')));},'filename':function(_0x1651d5,_0x1cddad,_0x422e01){_0x422e01(null,util[_0x0c0f('0x23')](_0x0c0f('0x24'),Date[_0x0c0f('0x2a')](),_0x1cddad[_0x0c0f('0x2b')]));}})});router['post'](_0x0c0f('0x11'),upload[_0x0c0f('0x26')](_0x0c0f('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x0c0f('0x2d')]({'destination':function(_0x465527,_0x3fd710,_0x4dc041){_0x4dc041(null,path[_0x0c0f('0x22')](config['root'],_0x0c0f('0x29')));},'filename':function(_0x3101ea,_0x7e4e4b,_0x2db179){_0x2db179(null,util[_0x0c0f('0x23')](_0x0c0f('0x24'),Date[_0x0c0f('0x2a')](),_0x7e4e4b['originalname']));}})});router[_0x0c0f('0x1f')](_0x0c0f('0x2e'),upload[_0x0c0f('0x26')](_0x0c0f('0x2c')),controller[_0x0c0f('0x2f')]);var upload=multer({'storage':multer[_0x0c0f('0x2d')]({'destination':function(_0x3d4bb5,_0x4fe3ea,_0x1ef5c1){_0x1ef5c1(null,path[_0x0c0f('0x22')](config[_0x0c0f('0x28')],_0x0c0f('0x29')));},'filename':function(_0x134b30,_0x49aacf,_0xc60a20){_0xc60a20(null,util[_0x0c0f('0x23')](_0x0c0f('0x24'),Date[_0x0c0f('0x2a')](),_0x49aacf[_0x0c0f('0x2b')]));}})});router['post']('/:id/system_avatar',upload[_0x0c0f('0x26')](_0x0c0f('0x2c')),controller['addSystemAvatar']);router[_0x0c0f('0x1f')](_0x0c0f('0x30'),controller[_0x0c0f('0x31')]);const offlineUploadMulter=multer({'storage':multer[_0x0c0f('0x2d')]({'destination':function(_0x19c33b,_0x11a30b,_0x988cd5){const _0x22e1c1=path[_0x0c0f('0x22')](config[_0x0c0f('0x28')],'server/files',_0x0c0f('0x32'),_0x0c0f('0x33'));fs_extra[_0x0c0f('0x34')](_0x22e1c1,function(){_0x988cd5(null,_0x22e1c1);});},'filename':function(_0x2b5168,_0x51c4e0,_0x54d7e6){const _0x1037db=_0x51c4e0[_0x0c0f('0x2b')][_0x0c0f('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1300e7=path[_0x0c0f('0x36')](_0x1037db);const _0x11bb04=Date[_0x0c0f('0x2a')]()+'-'+_0x1037db[_0x0c0f('0x35')](_0x1300e7,'')+_0x1300e7;_0x54d7e6(null,_0x11bb04);}})});router['post'](_0x0c0f('0x37'),offlineUploadMulter[_0x0c0f('0x38')](),controller[_0x0c0f('0x39')]);router['post'](_0x0c0f('0x14'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x3a')]);router[_0x0c0f('0x1f')](_0x0c0f('0x3b'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x3c')]);router[_0x0c0f('0x1f')](_0x0c0f('0x19'),auth[_0x0c0f('0x8')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x3d')]);router[_0x0c0f('0x3e')](_0x0c0f('0xc'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x3f')]);router[_0x0c0f('0x40')]('/:id',auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x41')]);router[_0x0c0f('0x40')](_0x0c0f('0xd'),auth['isAuthenticated'](),controller[_0x0c0f('0x42')]);router[_0x0c0f('0x40')](_0x0c0f('0xe'),auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x43')]);router[_0x0c0f('0x40')]('/:id/users',auth[_0x0c0f('0x8')](),controller[_0x0c0f('0x44')]);module[_0x0c0f('0x45')]=router; \ No newline at end of file +var _0x8794=['addAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','/:id/offline','any','offline','addInteraction','addApplications','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now'];(function(_0x1e4fe8,_0x217264){var _0x8113f=function(_0x12f489){while(--_0x12f489){_0x1e4fe8['push'](_0x1e4fe8['shift']());}};_0x8113f(++_0x217264);}(_0x8794,0x13b));var _0x4879=function(_0x14cc59,_0x361208){_0x14cc59=_0x14cc59-0x0;var _0x31c77c=_0x8794[_0x14cc59];return _0x31c77c;};'use strict';var multer=require(_0x4879('0x0'));var util=require(_0x4879('0x1'));var path=require(_0x4879('0x2'));var timeout=require(_0x4879('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4879('0x4'));var auth=require(_0x4879('0x5'));var interaction=require(_0x4879('0x6'));var config=require(_0x4879('0x7'));var controller=require(_0x4879('0x8'));router[_0x4879('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4879('0x9')](_0x4879('0xa'),auth[_0x4879('0xb')](),controller[_0x4879('0xc')]);router['get'](_0x4879('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4879('0x9')]('/:id/dispositions',auth[_0x4879('0xb')](),controller[_0x4879('0xe')]);router[_0x4879('0x9')](_0x4879('0xf'),auth[_0x4879('0xb')](),controller[_0x4879('0x10')]);router[_0x4879('0x9')]('/:id/logo',controller['getLogo']);router[_0x4879('0x9')](_0x4879('0x11'),controller[_0x4879('0x12')]);router[_0x4879('0x9')](_0x4879('0x13'),controller['getCustomerAvatar']);router[_0x4879('0x9')](_0x4879('0x14'),controller[_0x4879('0x15')]);router[_0x4879('0x9')](_0x4879('0x16'),auth[_0x4879('0xb')](),controller[_0x4879('0x17')]);router[_0x4879('0x9')](_0x4879('0x18'),controller['getSnippet']);router['get'](_0x4879('0x19'),auth[_0x4879('0xb')](),controller['getApplications']);router[_0x4879('0x9')](_0x4879('0x1a'),auth[_0x4879('0xb')](),controller[_0x4879('0x1b')]);router[_0x4879('0x9')](_0x4879('0x1c'),controller[_0x4879('0x1d')]);router[_0x4879('0x9')](_0x4879('0x1e'),auth[_0x4879('0xb')](),controller['getOfflineMessages']);router[_0x4879('0x9')]('/:id/users',auth[_0x4879('0xb')](),controller[_0x4879('0x1f')]);router[_0x4879('0x20')]('/',auth[_0x4879('0xb')](),controller[_0x4879('0x21')]);router[_0x4879('0x20')](_0x4879('0x22'),auth[_0x4879('0xb')](),controller[_0x4879('0x23')]);router[_0x4879('0x20')]('/:id/canned_answers',auth[_0x4879('0xb')](),controller[_0x4879('0x24')]);var upload=multer({'storage':multer[_0x4879('0x25')]({'destination':function(_0x4e4c28,_0xc4e0e5,_0x14f241){_0x14f241(null,path[_0x4879('0x26')](config[_0x4879('0x27')],_0x4879('0x28')));},'filename':function(_0x3def8d,_0x359089,_0x387514){_0x387514(null,util[_0x4879('0x29')](_0x4879('0x2a'),Date['now'](),_0x359089[_0x4879('0x2b')]));}})});router['post'](_0x4879('0x2c'),upload[_0x4879('0x2d')](_0x4879('0x2e')),controller[_0x4879('0x2f')]);var upload=multer({'storage':multer[_0x4879('0x25')]({'destination':function(_0x2e682c,_0x533e76,_0x1c40de){_0x1c40de(null,path['join'](config[_0x4879('0x27')],_0x4879('0x30')));},'filename':function(_0x3dcb43,_0x3ef923,_0x162af7){_0x162af7(null,util['format'](_0x4879('0x2a'),Date[_0x4879('0x31')](),_0x3ef923[_0x4879('0x2b')]));}})});router[_0x4879('0x20')](_0x4879('0x11'),upload[_0x4879('0x2d')](_0x4879('0x2e')),controller[_0x4879('0x32')]);var upload=multer({'storage':multer[_0x4879('0x25')]({'destination':function(_0x3850de,_0x190dad,_0x303fbc){_0x303fbc(null,path[_0x4879('0x26')](config[_0x4879('0x27')],_0x4879('0x30')));},'filename':function(_0x4b6f8d,_0xbb59a0,_0x542fe8){_0x542fe8(null,util[_0x4879('0x29')](_0x4879('0x2a'),Date[_0x4879('0x31')](),_0xbb59a0[_0x4879('0x2b')]));}})});router[_0x4879('0x20')]('/:id/customer_avatar',upload[_0x4879('0x2d')](_0x4879('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x4879('0x25')]({'destination':function(_0x1cd091,_0x3595ec,_0x424583){_0x424583(null,path[_0x4879('0x26')](config[_0x4879('0x27')],'server/files/images/avatars/'));},'filename':function(_0x1ac35c,_0xdbb536,_0x340473){_0x340473(null,util[_0x4879('0x29')](_0x4879('0x2a'),Date[_0x4879('0x31')](),_0xdbb536[_0x4879('0x2b')]));}})});router[_0x4879('0x20')]('/:id/system_avatar',upload['single'](_0x4879('0x2e')),controller[_0x4879('0x33')]);router[_0x4879('0x20')](_0x4879('0x34'),controller[_0x4879('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x972a13,_0xaacb88,_0x28714b){const _0x3d01cc=path['join'](config[_0x4879('0x27')],_0x4879('0x36'),_0x4879('0x37'),_0x4879('0x38'));fs_extra['ensureDir'](_0x3d01cc,function(){_0x28714b(null,_0x3d01cc);});},'filename':function(_0xf9a85,_0x5d0fbb,_0x135ce0){const _0x111e92=_0x5d0fbb[_0x4879('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x496274=path[_0x4879('0x39')](_0x111e92);const _0x816539=Date[_0x4879('0x31')]()+'-'+_0x111e92['replace'](_0x496274,'')+_0x496274;_0x135ce0(null,_0x816539);}})});router['post'](_0x4879('0x3a'),offlineUploadMulter[_0x4879('0x3b')](),controller[_0x4879('0x3c')]);router['post']('/:id/interactions',auth[_0x4879('0xb')](),controller[_0x4879('0x3d')]);router[_0x4879('0x20')]('/:id/applications',auth[_0x4879('0xb')](),controller[_0x4879('0x3e')]);router['post']('/:id/proactive_actions',auth[_0x4879('0xb')](),controller['addProactiveActions']);router[_0x4879('0x20')](_0x4879('0x3f'),auth[_0x4879('0xb')](),controller[_0x4879('0x40')]);router[_0x4879('0x41')]('/:id',auth['isAuthenticated'](),controller[_0x4879('0x42')]);router[_0x4879('0x43')](_0x4879('0xd'),auth[_0x4879('0xb')](),controller[_0x4879('0x44')]);router[_0x4879('0x43')](_0x4879('0x22'),auth[_0x4879('0xb')](),controller[_0x4879('0x45')]);router[_0x4879('0x43')]('/:id/canned_answers',auth[_0x4879('0xb')](),controller[_0x4879('0x46')]);router[_0x4879('0x43')](_0x4879('0x3f'),auth[_0x4879('0xb')](),controller[_0x4879('0x47')]);module[_0x4879('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 04cae1d..661367d 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 _0x238d=['express','env','production','get','Client-Side\x20logger\x20not\x20found!','use','exports','beaver-logger/server'];(function(_0x146ef3,_0x1c7bb0){var _0x5d9bae=function(_0x3b70f7){while(--_0x3b70f7){_0x146ef3['push'](_0x146ef3['shift']());}};_0x5d9bae(++_0x1c7bb0);}(_0x238d,0x97));var _0xd238=function(_0x1e3107,_0x37d1c2){_0x1e3107=_0x1e3107-0x0;var _0x58d4d4=_0x238d[_0x1e3107];return _0x58d4d4;};var beaverLogger=require(_0xd238('0x0'));var express=require(_0xd238('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xd238('0x2')]===_0xd238('0x3')||![];function clientSideLogs(_0x316fe3,_0x2332d1,_0x444d2d){var _0xbdab44=_0x316fe3['app'][_0xd238('0x4')]('client-side-logger');if(!_0xbdab44){throw new Error(_0xd238('0x5'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0xbdab44,'enableCors':!isProduction})(_0x316fe3,_0x2332d1,_0x444d2d);}router[_0xd238('0x6')](auth['isAuthenticated'](),clientSideLogs);module[_0xd238('0x7')]=router; \ No newline at end of file +var _0xbd8e=['isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x3308e5,_0x34e791){var _0xd60ecb=function(_0x170704){while(--_0x170704){_0x3308e5['push'](_0x3308e5['shift']());}};_0xd60ecb(++_0x34e791);}(_0xbd8e,0x1bc));var _0xebd8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xbd8e[_0x502c7d];return _0x30b7ed;};var beaverLogger=require(_0xebd8('0x0'));var express=require(_0xebd8('0x1'));var auth=require(_0xebd8('0x2'));var config=require(_0xebd8('0x3'));var router=express['Router']();var isProduction=config[_0xebd8('0x4')]==='production'||![];function clientSideLogs(_0x57bb77,_0x346942,_0x184ca9){var _0x353a25=_0x57bb77['app'][_0xebd8('0x5')](_0xebd8('0x6'));if(!_0x353a25){throw new Error(_0xebd8('0x7'));}return beaverLogger[_0xebd8('0x8')]({'uri':_0xebd8('0x9'),'logger':_0x353a25,'enableCors':!isProduction})(_0x57bb77,_0x346942,_0x184ca9);}router[_0xebd8('0xa')](auth[_0xebd8('0xb')](),clientSideLogs);module[_0xebd8('0xc')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index eb690fd..05fb721 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 _0xaeca=['AmazonAWS','Google','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','sequelize','exports','STRING'];(function(_0xc9fe08,_0x35ca3d){var _0x5c3adb=function(_0x46af9a){while(--_0x46af9a){_0xc9fe08['push'](_0xc9fe08['shift']());}};_0x5c3adb(++_0x35ca3d);}(_0xaeca,0x189));var _0xaaec=function(_0x3e5a76,_0x1e2316){_0x3e5a76=_0x3e5a76-0x0;var _0x2b9bc6=_0xaeca[_0x3e5a76];return _0x2b9bc6;};'use strict';var Sequelize=require(_0xaaec('0x0'));module[_0xaaec('0x1')]={'name':{'type':Sequelize[_0xaaec('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xaaec('0x3'),_0xaaec('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xaaec('0x5')]('Outlook365',_0xaaec('0x6'))},'data1':{'type':Sequelize[_0xaaec('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xaaec('0x2')],'comment':_0xaaec('0x7')},'data3':{'type':Sequelize[_0xaaec('0x2')],'comment':_0xaaec('0x8')},'data4':{'type':Sequelize[_0xaaec('0x2')],'comment':_0xaaec('0x9')},'data5':{'type':Sequelize[_0xaaec('0xa')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xaaec('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xaaec('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x4eec=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x189d12,_0x17aafc){var _0x39b0ad=function(_0x21a7de){while(--_0x21a7de){_0x189d12['push'](_0x189d12['shift']());}};_0x39b0ad(++_0x17aafc);}(_0x4eec,0xeb));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc4ee('0x0'));module[_0xc4ee('0x1')]={'name':{'type':Sequelize[_0xc4ee('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc4ee('0x3')]('AmazonAWS',_0xc4ee('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc4ee('0x3')]('Outlook365',_0xc4ee('0x5'))},'data1':{'type':Sequelize[_0xc4ee('0x2')],'comment':_0xc4ee('0x6')},'data2':{'type':Sequelize[_0xc4ee('0x2')],'comment':_0xc4ee('0x7')},'data3':{'type':Sequelize[_0xc4ee('0x2')],'comment':_0xc4ee('0x8')},'data4':{'type':Sequelize[_0xc4ee('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xc4ee('0x9')],'comment':_0xc4ee('0xa')},'data6':{'type':Sequelize[_0xc4ee('0x9')],'comment':_0xc4ee('0xb')},'data7':{'type':Sequelize[_0xc4ee('0x9')],'comment':_0xc4ee('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 6a645ee..2a1f3c3 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 _0x6aa5=['encryptString','find','params','sendStatus','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data6','data5','microsoftAuthorization:success','emit','microsoftAuthorization:error','send','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','VIRTUAL','merge','options','CloudProvider','map','service','decryptString','data3','catch','show','includeAll','MicrosoftAzure','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join'];(function(_0x5f4886,_0x537a26){var _0x45003a=function(_0xa6022a){while(--_0xa6022a){_0x5f4886['push'](_0x5f4886['shift']());}};_0x45003a(++_0x537a26);}(_0x6aa5,0x1ca));var _0x56aa=function(_0x13ed69,_0x229161){_0x13ed69=_0x13ed69-0x0;var _0x50c72e=_0x6aa5[_0x13ed69];return _0x50c72e;};'use strict';var _=require('lodash');var Redis=require(_0x56aa('0x0'));var qs=require(_0x56aa('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x56aa('0x2'));var logger=require(_0x56aa('0x3'))(_0x56aa('0x4'));var db=require(_0x56aa('0x5'))['db'];var oauth=require(_0x56aa('0x6'));config[_0x56aa('0x7')]=_[_0x56aa('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56aa('0x7')]));var redis=new Redis(config[_0x56aa('0x7')]);function respondWithStatusCode(_0x182654,_0xd5a72e){_0xd5a72e=_0xd5a72e||0xcc;return function(_0x294d84){if(_0x294d84){return _0x182654['sendStatus'](_0xd5a72e);}return _0x182654[_0x56aa('0x9')](_0xd5a72e)[_0x56aa('0xa')]();};}function respondWithResult(_0x5e99ca,_0x4e9f60){_0x4e9f60=_0x4e9f60||0xc8;return function(_0x56ac5b){if(_0x56ac5b){return _0x5e99ca[_0x56aa('0x9')](_0x4e9f60)[_0x56aa('0xb')](_0x56ac5b);}};}function respondWithFilteredResult(_0x2dd9a0,_0x1cb82f){return function(_0x268d03){if(_0x268d03){var _0x1a8e8e=typeof _0x1cb82f[_0x56aa('0xc')]===_0x56aa('0xd')&&typeof _0x1cb82f['limit']===_0x56aa('0xd');var _0x156d1e=_0x268d03[_0x56aa('0xe')];var _0x4d370f=_0x1a8e8e?0x0:_0x1cb82f[_0x56aa('0xc')];var _0x24c496=_0x1a8e8e?_0x268d03[_0x56aa('0xe')]:_0x1cb82f['offset']+_0x1cb82f[_0x56aa('0xf')];var _0x413caf;if(_0x24c496>=_0x156d1e){_0x24c496=_0x156d1e;_0x413caf=0xc8;}else{_0x413caf=0xce;}_0x2dd9a0[_0x56aa('0x9')](_0x413caf);return _0x2dd9a0[_0x56aa('0x10')](_0x56aa('0x11'),_0x4d370f+'-'+_0x24c496+'/'+_0x156d1e)[_0x56aa('0xb')](_0x268d03);}return null;};}function saveUpdates(_0x55f1ec){return function(_0x2b11d8){if(_0x2b11d8){return _0x2b11d8[_0x56aa('0x12')](_0x55f1ec)[_0x56aa('0x13')](function(_0x564db1){return _0x564db1;});}return null;};}function removeEntity(_0x2796fc){return function(_0x43b1a7){if(_0x43b1a7){return _0x43b1a7[_0x56aa('0x14')]()[_0x56aa('0x13')](function(){_0x2796fc[_0x56aa('0x9')](0xcc)[_0x56aa('0xa')]();});}};}function handleEntityNotFound(_0x3a0f77){return function(_0x5154a7){if(!_0x5154a7){_0x3a0f77['sendStatus'](0x194);}return _0x5154a7;};}function handleError(_0x141c2b,_0x318d96){_0x318d96=_0x318d96||0x1f4;return function(_0x2e3f97){logger[_0x56aa('0x15')](_0x2e3f97[_0x56aa('0x16')]);if(_0x2e3f97[_0x56aa('0x17')]){delete _0x2e3f97[_0x56aa('0x17')];}_0x141c2b[_0x56aa('0x9')](_0x318d96)['send'](_0x2e3f97);};}function maskClientSecret(_0x5caf65){return _['padEnd'](_0x5caf65['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x2e0194,_0x3abc51){var _0x3c35cc={},_0x17e53a={},_0x5b96ec={'count':0x0,'rows':[]};var _0x4c5c2f=_['map'](db['CloudProvider'][_0x56aa('0x18')],function(_0x4bf647){return{'name':_0x4bf647[_0x56aa('0x19')],'type':_0x4bf647[_0x56aa('0x1a')][_0x56aa('0x1b')]};});_0x17e53a[_0x56aa('0x1c')]=_['map'](_0x4c5c2f,'name');_0x17e53a[_0x56aa('0x1d')]=_[_0x56aa('0x1e')](_0x2e0194[_0x56aa('0x1d')]);_0x17e53a[_0x56aa('0x1f')]=_[_0x56aa('0x20')](_0x17e53a[_0x56aa('0x1c')],_0x17e53a[_0x56aa('0x1d')]);_0x3c35cc['attributes']=_['intersection'](_0x17e53a[_0x56aa('0x1c')],qs[_0x56aa('0x21')](_0x2e0194['query'][_0x56aa('0x21')]));_0x3c35cc['attributes']=_0x3c35cc[_0x56aa('0x22')][_0x56aa('0x23')]?_0x3c35cc[_0x56aa('0x22')]:_0x17e53a[_0x56aa('0x1c')];if(!_0x2e0194[_0x56aa('0x1d')]['hasOwnProperty']('nolimit')){_0x3c35cc[_0x56aa('0xf')]=qs[_0x56aa('0xf')](_0x2e0194[_0x56aa('0x1d')][_0x56aa('0xf')]);_0x3c35cc[_0x56aa('0xc')]=qs[_0x56aa('0xc')](_0x2e0194['query'][_0x56aa('0xc')]);}_0x3c35cc[_0x56aa('0x24')]=qs[_0x56aa('0x25')](_0x2e0194[_0x56aa('0x1d')][_0x56aa('0x25')]);_0x3c35cc[_0x56aa('0x26')]=qs['filters'](_['pick'](_0x2e0194[_0x56aa('0x1d')],_0x17e53a['filters']),_0x4c5c2f);if(_0x2e0194['query']['filter']){_0x3c35cc['where']=_['merge'](_0x3c35cc[_0x56aa('0x26')],{'$or':_['map'](_0x4c5c2f,function(_0x152f18){if(_0x152f18['type']!==_0x56aa('0x27')){var _0x5e3688={};_0x5e3688[_0x152f18[_0x56aa('0x17')]]={'$like':'%'+_0x2e0194[_0x56aa('0x1d')]['filter']+'%'};return _0x5e3688;}})});}_0x3c35cc=_[_0x56aa('0x28')]({},_0x3c35cc,_0x2e0194[_0x56aa('0x29')]);var _0x24e5ff={'where':_0x3c35cc[_0x56aa('0x26')]};return db['CloudProvider'][_0x56aa('0xe')](_0x24e5ff)[_0x56aa('0x13')](function(_0x25cc01){_0x5b96ec['count']=_0x25cc01;if(_0x2e0194[_0x56aa('0x1d')]['includeAll']){_0x3c35cc['include']=[{'all':!![]}];}return db[_0x56aa('0x2a')]['findAll'](_0x3c35cc);})[_0x56aa('0x13')](function(_0x341efc){_0x5b96ec['rows']=_[_0x56aa('0x2b')](_0x341efc,function(_0x51f019){if(_0x51f019[_0x56aa('0x2c')]==='MicrosoftAzure'){var _0x29e9dc=encryptor[_0x56aa('0x2d')](_0x51f019[_0x56aa('0x2e')]);_0x51f019[_0x56aa('0x2e')]=maskClientSecret(_0x29e9dc);}return _0x51f019;});return _0x5b96ec;})[_0x56aa('0x13')](respondWithFilteredResult(_0x3abc51,_0x3c35cc))[_0x56aa('0x2f')](handleError(_0x3abc51,null));};exports[_0x56aa('0x30')]=function(_0xf1f761,_0x1145cc){var _0x5229cd={'raw':!![],'where':{'id':_0xf1f761['params']['id']}},_0x969ac6={};_0x969ac6['model']=_[_0x56aa('0x1e')](db['CloudProvider']['rawAttributes']);_0x969ac6[_0x56aa('0x1d')]=_[_0x56aa('0x1e')](_0xf1f761[_0x56aa('0x1d')]);_0x969ac6[_0x56aa('0x1f')]=_['intersection'](_0x969ac6[_0x56aa('0x1c')],_0x969ac6[_0x56aa('0x1d')]);_0x5229cd[_0x56aa('0x22')]=_[_0x56aa('0x20')](_0x969ac6[_0x56aa('0x1c')],qs[_0x56aa('0x21')](_0xf1f761['query'][_0x56aa('0x21')]));_0x5229cd[_0x56aa('0x22')]=_0x5229cd[_0x56aa('0x22')][_0x56aa('0x23')]?_0x5229cd[_0x56aa('0x22')]:_0x969ac6[_0x56aa('0x1c')];if(_0xf1f761[_0x56aa('0x1d')][_0x56aa('0x31')]){_0x5229cd['include']=[{'all':!![]}];}_0x5229cd=_['merge']({},_0x5229cd,_0xf1f761['options']);return db[_0x56aa('0x2a')]['find'](_0x5229cd)[_0x56aa('0x13')](handleEntityNotFound(_0x1145cc,null))[_0x56aa('0x13')](function(_0xa69d4b){if(_0xa69d4b[_0x56aa('0x2c')]===_0x56aa('0x32')){var _0xf4e66=encryptor[_0x56aa('0x2d')](_0xa69d4b[_0x56aa('0x2e')]);_0xa69d4b[_0x56aa('0x2e')]=maskClientSecret(_0xf4e66);}return _0xa69d4b;})['then'](respondWithResult(_0x1145cc,null))[_0x56aa('0x2f')](handleError(_0x1145cc,null));};exports['create']=function(_0x528044,_0x5629b9){if(!_0x528044[_0x56aa('0x33')][_0x56aa('0x17')])throw new Error(_0x56aa('0x34'));if(!_0x528044[_0x56aa('0x33')]['service'])throw new Error(_0x56aa('0x35'));var _0x4fb986=db[_0x56aa('0x2a')][_0x56aa('0x18')][_0x56aa('0x2c')][_0x56aa('0x36')];if(!_0x4fb986[_0x56aa('0x37')](_0x528044[_0x56aa('0x33')][_0x56aa('0x2c')]))throw new Error(_0x56aa('0x38')+_0x4fb986[_0x56aa('0x39')](',\x20'));if(_0x528044[_0x56aa('0x33')]['service']==='MicrosoftAzure'&&_0x528044[_0x56aa('0x33')][_0x56aa('0x2e')]){_0x528044['body'][_0x56aa('0x2e')]=encryptor[_0x56aa('0x3a')](_0x528044[_0x56aa('0x33')][_0x56aa('0x2e')]);}return db['CloudProvider']['create'](_0x528044['body'],{})[_0x56aa('0x13')](respondWithResult(_0x5629b9,0xc9))[_0x56aa('0x2f')](handleError(_0x5629b9,null));};exports[_0x56aa('0x12')]=function(_0x1c3d8f,_0x29fb20){if(_0x1c3d8f[_0x56aa('0x33')]['id']){delete _0x1c3d8f[_0x56aa('0x33')]['id'];}return db[_0x56aa('0x2a')][_0x56aa('0x3b')]({'where':{'id':_0x1c3d8f[_0x56aa('0x3c')]['id']}})[_0x56aa('0x13')](handleEntityNotFound(_0x29fb20,null))[_0x56aa('0x13')](function(_0x55aed6){if(_0x55aed6[_0x56aa('0x2c')]==='MicrosoftAzure'&&_0x1c3d8f[_0x56aa('0x33')][_0x56aa('0x2e')]){_0x1c3d8f[_0x56aa('0x33')][_0x56aa('0x2e')]=encryptor[_0x56aa('0x3a')](_0x1c3d8f[_0x56aa('0x33')][_0x56aa('0x2e')]);}return _0x55aed6;})[_0x56aa('0x13')](saveUpdates(_0x1c3d8f[_0x56aa('0x33')],null))[_0x56aa('0x13')](respondWithResult(_0x29fb20,null))[_0x56aa('0x2f')](handleError(_0x29fb20,null));};exports[_0x56aa('0x14')]=function(_0x69d737,_0x142762){return db[_0x56aa('0x2a')]['find']({'where':{'id':_0x69d737[_0x56aa('0x3c')]['id']}})[_0x56aa('0x13')](handleEntityNotFound(_0x142762,null))[_0x56aa('0x13')](removeEntity(_0x142762,null))['catch'](handleError(_0x142762,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4fa1e2,_0xd9bad){return db['CloudProvider']['findOne']({'where':{'id':_0x4fa1e2[_0x56aa('0x3c')]['id']},'raw':!![]})[_0x56aa('0x13')](function(_0x33322f){if(!_0x33322f)return _0xd9bad[_0x56aa('0x3d')](0x194);return{'url':oauth[_0x56aa('0x3e')](_0x33322f,_0x4fa1e2[_0x56aa('0x3f')]['id'])};})['then'](respondWithResult(_0xd9bad,null))['catch'](handleError(_0xd9bad,null));};exports[_0x56aa('0x40')]=function(_0x396b60,_0x469784){var _0x5640a8=_0x396b60[_0x56aa('0x33')];var _0x20c04a;var _0x498763;if(_0x5640a8[_0x56aa('0x15')])throw _0x5640a8;redis[_0x56aa('0x41')](_0x5640a8[_0x56aa('0x42')])['then'](function(_0x56cf99){if(!_0x56cf99)throw new Error(_0x56aa('0x43'));_0x20c04a=JSON[_0x56aa('0x44')](_0x56cf99);var _0xf78896=Buffer[_0x56aa('0x45')](_0x5640a8[_0x56aa('0x42')],_0x56aa('0x46'))['toString'](_0x56aa('0x47'));_0x498763=JSON[_0x56aa('0x44')](_0xf78896);if(!oauth[_0x56aa('0x48')](_0x5640a8[_0x56aa('0x49')],_0x20c04a[_0x56aa('0x4a')]))throw new Error(_0x56aa('0x4b'));redis[_0x56aa('0x4c')](_0x5640a8[_0x56aa('0x42')]);return oauth[_0x56aa('0x4d')](_0x5640a8[_0x56aa('0x4e')],_0x20c04a);})[_0x56aa('0x13')](function(_0x16880d){_0x20c04a['data5']=_0x16880d['access_token'];_0x20c04a[_0x56aa('0x4f')]=_0x16880d['refresh_token'];return db[_0x56aa('0x2a')][_0x56aa('0x12')]({'data5':_0x20c04a[_0x56aa('0x50')],'data6':_0x20c04a[_0x56aa('0x4f')]},{'where':{'id':_0x20c04a['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x20c04a);socket['emit'](_0x56aa('0x51'),{'id':_0x498763['id']});return;})['then'](respondWithStatusCode(_0x469784,null))[_0x56aa('0x2f')](function(_0x28081b){if(_0x498763){socket[_0x56aa('0x52')](_0x56aa('0x53'),{'id':_0x498763['id']});}if(!_0x20c04a){logger[_0x56aa('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0x28081b);return _0x469784['status'](0x1f4)[_0x56aa('0x54')](_0x28081b['message']);}logger[_0x56aa('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x20c04a['id'],JSON[_0x56aa('0x55')](_0x28081b));});}; \ No newline at end of file +var _0x3d47=['../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','then','destroy','error','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName','type','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','intersection','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','findOne','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','state','base64','toString','ascii','parse','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x3d47,0xbb));var _0x73d4=function(_0x41bf53,_0x243297){_0x41bf53=_0x41bf53-0x0;var _0x4c75d8=_0x3d47[_0x41bf53];return _0x4c75d8;};'use strict';var _=require('lodash');var Redis=require(_0x73d4('0x0'));var qs=require(_0x73d4('0x1'));var encryptor=require(_0x73d4('0x2'));var config=require(_0x73d4('0x3'));var logger=require(_0x73d4('0x4'))('api');var db=require(_0x73d4('0x5'))['db'];var oauth=require(_0x73d4('0x6'));config['redis']=_['defaults'](config[_0x73d4('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0x73d4('0x7')]);function respondWithStatusCode(_0x153f1d,_0x3faff7){_0x3faff7=_0x3faff7||0xcc;return function(_0x3dab0f){if(_0x3dab0f){return _0x153f1d[_0x73d4('0x8')](_0x3faff7);}return _0x153f1d['status'](_0x3faff7)[_0x73d4('0x9')]();};}function respondWithResult(_0x5d3c6c,_0x1af0cc){_0x1af0cc=_0x1af0cc||0xc8;return function(_0x222d7c){if(_0x222d7c){return _0x5d3c6c[_0x73d4('0xa')](_0x1af0cc)[_0x73d4('0xb')](_0x222d7c);}};}function respondWithFilteredResult(_0x2ea594,_0xa6d5dd){return function(_0x197d49){if(_0x197d49){var _0x5275d1=typeof _0xa6d5dd[_0x73d4('0xc')]===_0x73d4('0xd')&&typeof _0xa6d5dd[_0x73d4('0xe')]===_0x73d4('0xd');var _0x810959=_0x197d49['count'];var _0x10b0ac=_0x5275d1?0x0:_0xa6d5dd[_0x73d4('0xc')];var _0x13501b=_0x5275d1?_0x197d49['count']:_0xa6d5dd['offset']+_0xa6d5dd[_0x73d4('0xe')];var _0x1b6b52;if(_0x13501b>=_0x810959){_0x13501b=_0x810959;_0x1b6b52=0xc8;}else{_0x1b6b52=0xce;}_0x2ea594['status'](_0x1b6b52);return _0x2ea594[_0x73d4('0xf')](_0x73d4('0x10'),_0x10b0ac+'-'+_0x13501b+'/'+_0x810959)[_0x73d4('0xb')](_0x197d49);}return null;};}function saveUpdates(_0x2e66c3){return function(_0x20bfa4){if(_0x20bfa4){return _0x20bfa4['update'](_0x2e66c3)[_0x73d4('0x11')](function(_0x10f9e0){return _0x10f9e0;});}return null;};}function removeEntity(_0x7be2de){return function(_0x24fc50){if(_0x24fc50){return _0x24fc50[_0x73d4('0x12')]()[_0x73d4('0x11')](function(){_0x7be2de[_0x73d4('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x263775){return function(_0x1b25ff){if(!_0x1b25ff){_0x263775['sendStatus'](0x194);}return _0x1b25ff;};}function handleError(_0x452aa1,_0x287b98){_0x287b98=_0x287b98||0x1f4;return function(_0x4e0960){logger[_0x73d4('0x13')](_0x4e0960[_0x73d4('0x14')]);if(_0x4e0960['name']){delete _0x4e0960[_0x73d4('0x15')];}_0x452aa1[_0x73d4('0xa')](_0x287b98)[_0x73d4('0x16')](_0x4e0960);};}function maskClientSecret(_0x3fd0c1){return _[_0x73d4('0x17')](_0x3fd0c1[_0x73d4('0x18')](0x0,0x3),0x14,'*');}exports[_0x73d4('0x19')]=function(_0xf0806e,_0x265ea8){var _0x30dbe3={},_0x1302df={},_0xdf32dd={'count':0x0,'rows':[]};var _0x51b429=_[_0x73d4('0x1a')](db[_0x73d4('0x1b')]['rawAttributes'],function(_0x80e9ad){return{'name':_0x80e9ad[_0x73d4('0x1c')],'type':_0x80e9ad[_0x73d4('0x1d')]['key']};});_0x1302df['model']=_[_0x73d4('0x1a')](_0x51b429,_0x73d4('0x15'));_0x1302df[_0x73d4('0x1e')]=_[_0x73d4('0x1f')](_0xf0806e['query']);_0x1302df[_0x73d4('0x20')]=_['intersection'](_0x1302df['model'],_0x1302df[_0x73d4('0x1e')]);_0x30dbe3[_0x73d4('0x21')]=_['intersection'](_0x1302df['model'],qs[_0x73d4('0x22')](_0xf0806e[_0x73d4('0x1e')][_0x73d4('0x22')]));_0x30dbe3[_0x73d4('0x21')]=_0x30dbe3['attributes'][_0x73d4('0x23')]?_0x30dbe3[_0x73d4('0x21')]:_0x1302df[_0x73d4('0x24')];if(!_0xf0806e['query'][_0x73d4('0x25')](_0x73d4('0x26'))){_0x30dbe3['limit']=qs[_0x73d4('0xe')](_0xf0806e['query']['limit']);_0x30dbe3['offset']=qs[_0x73d4('0xc')](_0xf0806e[_0x73d4('0x1e')][_0x73d4('0xc')]);}_0x30dbe3[_0x73d4('0x27')]=qs[_0x73d4('0x28')](_0xf0806e[_0x73d4('0x1e')][_0x73d4('0x28')]);_0x30dbe3[_0x73d4('0x29')]=qs['filters'](_[_0x73d4('0x2a')](_0xf0806e[_0x73d4('0x1e')],_0x1302df['filters']),_0x51b429);if(_0xf0806e[_0x73d4('0x1e')][_0x73d4('0x2b')]){_0x30dbe3[_0x73d4('0x29')]=_[_0x73d4('0x2c')](_0x30dbe3[_0x73d4('0x29')],{'$or':_[_0x73d4('0x1a')](_0x51b429,function(_0x5aed40){if(_0x5aed40[_0x73d4('0x1d')]!==_0x73d4('0x2d')){var _0xb125f7={};_0xb125f7[_0x5aed40[_0x73d4('0x15')]]={'$like':'%'+_0xf0806e[_0x73d4('0x1e')][_0x73d4('0x2b')]+'%'};return _0xb125f7;}})});}_0x30dbe3=_[_0x73d4('0x2c')]({},_0x30dbe3,_0xf0806e[_0x73d4('0x2e')]);var _0x5dd8cc={'where':_0x30dbe3[_0x73d4('0x29')]};return db[_0x73d4('0x1b')][_0x73d4('0x2f')](_0x5dd8cc)['then'](function(_0x5c886f){_0xdf32dd[_0x73d4('0x2f')]=_0x5c886f;if(_0xf0806e[_0x73d4('0x1e')][_0x73d4('0x30')]){_0x30dbe3['include']=[{'all':!![]}];}return db[_0x73d4('0x1b')][_0x73d4('0x31')](_0x30dbe3);})[_0x73d4('0x11')](function(_0x536421){_0xdf32dd[_0x73d4('0x32')]=_[_0x73d4('0x1a')](_0x536421,function(_0x417ca9){if(_0x417ca9[_0x73d4('0x33')]===_0x73d4('0x34')){var _0x467e73=encryptor[_0x73d4('0x35')](_0x417ca9[_0x73d4('0x36')]);_0x417ca9['data3']=maskClientSecret(_0x467e73);}return _0x417ca9;});return _0xdf32dd;})[_0x73d4('0x11')](respondWithFilteredResult(_0x265ea8,_0x30dbe3))[_0x73d4('0x37')](handleError(_0x265ea8,null));};exports[_0x73d4('0x38')]=function(_0x4abf9b,_0x550bb4){var _0x12d71f={'raw':!![],'where':{'id':_0x4abf9b[_0x73d4('0x39')]['id']}},_0x1b1471={};_0x1b1471[_0x73d4('0x24')]=_[_0x73d4('0x1f')](db[_0x73d4('0x1b')][_0x73d4('0x3a')]);_0x1b1471[_0x73d4('0x1e')]=_['keys'](_0x4abf9b[_0x73d4('0x1e')]);_0x1b1471[_0x73d4('0x20')]=_[_0x73d4('0x3b')](_0x1b1471[_0x73d4('0x24')],_0x1b1471[_0x73d4('0x1e')]);_0x12d71f[_0x73d4('0x21')]=_['intersection'](_0x1b1471[_0x73d4('0x24')],qs[_0x73d4('0x22')](_0x4abf9b[_0x73d4('0x1e')][_0x73d4('0x22')]));_0x12d71f[_0x73d4('0x21')]=_0x12d71f[_0x73d4('0x21')][_0x73d4('0x23')]?_0x12d71f[_0x73d4('0x21')]:_0x1b1471[_0x73d4('0x24')];if(_0x4abf9b['query'][_0x73d4('0x30')]){_0x12d71f[_0x73d4('0x3c')]=[{'all':!![]}];}_0x12d71f=_[_0x73d4('0x2c')]({},_0x12d71f,_0x4abf9b[_0x73d4('0x2e')]);return db[_0x73d4('0x1b')][_0x73d4('0x3d')](_0x12d71f)[_0x73d4('0x11')](handleEntityNotFound(_0x550bb4,null))[_0x73d4('0x11')](function(_0x5f32fb){if(_0x5f32fb['service']===_0x73d4('0x34')){var _0x29fc61=encryptor[_0x73d4('0x35')](_0x5f32fb[_0x73d4('0x36')]);_0x5f32fb[_0x73d4('0x36')]=maskClientSecret(_0x29fc61);}return _0x5f32fb;})['then'](respondWithResult(_0x550bb4,null))[_0x73d4('0x37')](handleError(_0x550bb4,null));};exports['create']=function(_0x41fe38,_0xaa5b60){if(!_0x41fe38[_0x73d4('0x3e')][_0x73d4('0x15')])throw new Error(_0x73d4('0x3f'));if(!_0x41fe38[_0x73d4('0x3e')][_0x73d4('0x33')])throw new Error(_0x73d4('0x40'));var _0x1f8170=db['CloudProvider'][_0x73d4('0x3a')][_0x73d4('0x33')][_0x73d4('0x41')];if(!_0x1f8170[_0x73d4('0x42')](_0x41fe38['body'][_0x73d4('0x33')]))throw new Error(_0x73d4('0x43')+_0x1f8170['join'](',\x20'));if(_0x41fe38['body']['service']===_0x73d4('0x34')&&_0x41fe38[_0x73d4('0x3e')]['data3']){_0x41fe38[_0x73d4('0x3e')][_0x73d4('0x36')]=encryptor[_0x73d4('0x44')](_0x41fe38[_0x73d4('0x3e')][_0x73d4('0x36')]);}return db[_0x73d4('0x1b')][_0x73d4('0x45')](_0x41fe38[_0x73d4('0x3e')],{})[_0x73d4('0x11')](respondWithResult(_0xaa5b60,0xc9))[_0x73d4('0x37')](handleError(_0xaa5b60,null));};exports['update']=function(_0x5bc567,_0x414645){if(_0x5bc567['body']['id']){delete _0x5bc567[_0x73d4('0x3e')]['id'];}return db[_0x73d4('0x1b')]['find']({'where':{'id':_0x5bc567[_0x73d4('0x39')]['id']}})[_0x73d4('0x11')](handleEntityNotFound(_0x414645,null))[_0x73d4('0x11')](function(_0x569b3b){if(_0x569b3b[_0x73d4('0x33')]===_0x73d4('0x34')&&_0x5bc567[_0x73d4('0x3e')][_0x73d4('0x36')]){_0x5bc567['body'][_0x73d4('0x36')]=encryptor[_0x73d4('0x44')](_0x5bc567[_0x73d4('0x3e')][_0x73d4('0x36')]);}return _0x569b3b;})[_0x73d4('0x11')](saveUpdates(_0x5bc567[_0x73d4('0x3e')],null))[_0x73d4('0x11')](respondWithResult(_0x414645,null))[_0x73d4('0x37')](handleError(_0x414645,null));};exports[_0x73d4('0x12')]=function(_0x3a1d00,_0x56a63f){return db[_0x73d4('0x1b')][_0x73d4('0x3d')]({'where':{'id':_0x3a1d00[_0x73d4('0x39')]['id']}})[_0x73d4('0x11')](handleEntityNotFound(_0x56a63f,null))[_0x73d4('0x11')](removeEntity(_0x56a63f,null))['catch'](handleError(_0x56a63f,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4678ed,_0x4dd00f){return db[_0x73d4('0x1b')][_0x73d4('0x46')]({'where':{'id':_0x4678ed[_0x73d4('0x39')]['id']},'raw':!![]})[_0x73d4('0x11')](function(_0x4a8d2){if(!_0x4a8d2)return _0x4dd00f['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4a8d2,_0x4678ed[_0x73d4('0x47')]['id'])};})[_0x73d4('0x11')](respondWithResult(_0x4dd00f,null))[_0x73d4('0x37')](handleError(_0x4dd00f,null));};exports[_0x73d4('0x48')]=function(_0x1ffbde,_0x549b78){var _0x216c1e=_0x1ffbde[_0x73d4('0x3e')];var _0x331964;var _0x4412a3;if(_0x216c1e[_0x73d4('0x13')])throw _0x216c1e;redis['get'](_0x216c1e['state'])[_0x73d4('0x11')](function(_0x54b76e){if(!_0x54b76e)throw new Error(_0x73d4('0x49'));_0x331964=JSON['parse'](_0x54b76e);var _0x274371=Buffer['from'](_0x216c1e[_0x73d4('0x4a')],_0x73d4('0x4b'))[_0x73d4('0x4c')](_0x73d4('0x4d'));_0x4412a3=JSON[_0x73d4('0x4e')](_0x274371);if(!oauth[_0x73d4('0x4f')](_0x216c1e[_0x73d4('0x50')],_0x331964['oauth2Claims']))throw new Error(_0x73d4('0x51'));redis[_0x73d4('0x52')](_0x216c1e[_0x73d4('0x4a')]);return oauth[_0x73d4('0x53')](_0x216c1e[_0x73d4('0x54')],_0x331964);})[_0x73d4('0x11')](function(_0xdd6776){_0x331964[_0x73d4('0x55')]=_0xdd6776['access_token'];_0x331964[_0x73d4('0x56')]=_0xdd6776[_0x73d4('0x57')];return db['CloudProvider']['update']({'data5':_0x331964[_0x73d4('0x55')],'data6':_0x331964[_0x73d4('0x56')]},{'where':{'id':_0x331964['id']}});})[_0x73d4('0x11')](function(){oauth[_0x73d4('0x58')](_0x331964);socket[_0x73d4('0x59')](_0x73d4('0x5a'),{'id':_0x4412a3['id']});return;})[_0x73d4('0x11')](respondWithStatusCode(_0x549b78,null))[_0x73d4('0x37')](function(_0x5dbe62){if(_0x4412a3){socket[_0x73d4('0x59')](_0x73d4('0x5b'),{'id':_0x4412a3['id']});}if(!_0x331964){logger[_0x73d4('0x13')](_0x73d4('0x5c'),_0x5dbe62);return _0x549b78['status'](0x1f4)[_0x73d4('0x16')](_0x5dbe62['message']);}logger['error'](_0x73d4('0x5d'),_0x331964['id'],JSON[_0x73d4('0x5e')](_0x5dbe62));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 30109ca..acc3a83 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 _0x92f3=['CloudProvider','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x1b9573,_0x5ba074){var _0x3ed329=function(_0x1bdf3f){while(--_0x1bdf3f){_0x1b9573['push'](_0x1b9573['shift']());}};_0x3ed329(++_0x5ba074);}(_0x92f3,0x16d));var _0x392f=function(_0x59f708,_0x141192){_0x59f708=_0x59f708-0x0;var _0x1d5133=_0x92f3[_0x59f708];return _0x1d5133;};'use strict';var _=require(_0x392f('0x0'));var util=require('util');var logger=require(_0x392f('0x1'))(_0x392f('0x2'));var moment=require(_0x392f('0x3'));var BPromise=require(_0x392f('0x4'));var rp=require(_0x392f('0x5'));var fs=require('fs');var path=require(_0x392f('0x6'));var rimraf=require(_0x392f('0x7'));var config=require(_0x392f('0x8'));var attributes=require(_0x392f('0x9'));module[_0x392f('0xa')]=function(_0xa6b466,_0x2630ab){return _0xa6b466[_0x392f('0xb')](_0x392f('0xc'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9280=['bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x541a6b,_0x3ed296){var _0x41b7ed=function(_0x1f9f52){while(--_0x1f9f52){_0x541a6b['push'](_0x541a6b['shift']());}};_0x41b7ed(++_0x3ed296);}(_0x9280,0x19f));var _0x0928=function(_0x5d91bd,_0x395795){_0x5d91bd=_0x5d91bd-0x0;var _0x2b2b3e=_0x9280[_0x5d91bd];return _0x2b2b3e;};'use strict';var _=require(_0x0928('0x0'));var util=require(_0x0928('0x1'));var logger=require(_0x0928('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0928('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0928('0x4'));var rimraf=require(_0x0928('0x5'));var config=require(_0x0928('0x6'));var attributes=require(_0x0928('0x7'));module[_0x0928('0x8')]=function(_0x464e36,_0x513937){return _0x464e36[_0x0928('0x9')](_0x0928('0xa'),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 b6f1c82..045b1b5 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 _0x5e2b=['email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','map','type','Dynamics365','push','join','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','data4','response_mode','form_post','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','data1','set','decode','payload','aud','isAfter','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','data5','access_token','refresh_token','update','catch','error','authorization_code','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile'];(function(_0xc01168,_0x305562){var _0x3015d2=function(_0x238cfd){while(--_0x238cfd){_0xc01168['push'](_0xc01168['shift']());}};_0x3015d2(++_0x305562);}(_0x5e2b,0x1bb));var _0xb5e2=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x5e2b[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0xb5e2('0x0'));var crypto=require('crypto');var jwt=require(_0xb5e2('0x1'));var moment=require(_0xb5e2('0x2'));var Redis=require('ioredis');var rp=require(_0xb5e2('0x3'));var util=require(_0xb5e2('0x4'));var encryptor=require(_0xb5e2('0x5'));var config=require('../../config/environment');var logger=require(_0xb5e2('0x6'))('api');var schedule=require(_0xb5e2('0x7'));var db=require('../../mysqldb')['db'];config[_0xb5e2('0x8')]=_[_0xb5e2('0x9')](config[_0xb5e2('0x8')],{'host':_0xb5e2('0xa'),'port':0x18eb});var redis=new Redis(config[_0xb5e2('0x8')]);var MICROSOFT_AUTH_URL=_0xb5e2('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xb5e2('0xc'),_0xb5e2('0xd'),_0xb5e2('0xe'),_0xb5e2('0xf'),_0xb5e2('0x10'),_0xb5e2('0x11')],'Dynamics365':[_0xb5e2('0x12'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x496105){var _0x4fa7d8=_[_0xb5e2('0x13')](AZURE_AUTH_SCOPES[_0x496105[_0xb5e2('0x14')]]);if(_0x496105[_0xb5e2('0x14')]===_0xb5e2('0x15'))_0x4fa7d8[_0xb5e2('0x16')](_0x496105['data7']+'/.default');return _0x4fa7d8[_0xb5e2('0x17')]('\x20');}function getAccessTokenScope(_0x4fb4df){if(_0x4fb4df[_0xb5e2('0x14')]==='Outlook365')return _0xb5e2('0xf');if(_0x4fb4df[_0xb5e2('0x14')]===_0xb5e2('0x15'))return _0x4fb4df[_0xb5e2('0x18')]+_0xb5e2('0x19');}function generateMicrosoftAuthorizationUrl(_0x3b7907,_0x5317dd){var _0x54772b=MICROSOFT_AUTH_URL[_0xb5e2('0x1a')](_0xb5e2('0x1b'),_0x3b7907[_0xb5e2('0x1c')]);var _0x44abf9=[_0xb5e2('0x1d'),_0xb5e2('0x1e')];var _0x500a5a=Buffer[_0xb5e2('0x1f')](JSON[_0xb5e2('0x20')]({'id':_0x5317dd}))[_0xb5e2('0x21')]('base64');var _0x527b5b=crypto[_0xb5e2('0x22')](0x10)[_0xb5e2('0x21')](_0xb5e2('0x23'));var _0x8d7939=getAuthorizationScopes(_0x3b7907);var _0x24af8f=[{'key':_0xb5e2('0x24'),'value':_0x3b7907['data1']},{'key':_0xb5e2('0x25'),'value':encodeURIComponent(_0x44abf9[_0xb5e2('0x17')]('\x20'))},{'key':'redirect_uri','value':_0x3b7907[_0xb5e2('0x26')]},{'key':_0xb5e2('0x27'),'value':_0xb5e2('0x28')},{'key':'scope','value':encodeURIComponent(_0x8d7939)},{'key':_0xb5e2('0x29'),'value':_0x500a5a},{'key':_0xb5e2('0x2a'),'value':_0x527b5b},{'key':_0xb5e2('0x2b'),'value':_0xb5e2('0x2c')}];var _0x79e6ac=_0x54772b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb5e2('0x13')](_0x24af8f,function(_0x271b6f){return _0x271b6f[_0xb5e2('0x2d')]+'='+_0x271b6f[_0xb5e2('0x2e')];})[_0xb5e2('0x17')]('&');_0x3b7907[_0xb5e2('0x2f')]={'issuer':_0x54772b['replace'](_0xb5e2('0x30'),''),'audience':_0x3b7907[_0xb5e2('0x31')],'state':_0x500a5a,'nonce':_0x527b5b};redis[_0xb5e2('0x32')](_0x500a5a,JSON['stringify'](_0x3b7907));return _0x79e6ac;}function isValidIdToken(_0x230eb8,_0x1c9866){try{var _0x2651c4=jwt[_0xb5e2('0x33')](_0x230eb8,{'complete':!![]});var _0x293101=_0x2651c4[_0xb5e2('0x34')];if(_0x293101['iss']!==_0x1c9866['issuer'])return![];if(_0x293101[_0xb5e2('0x35')]!==_0x1c9866['audience'])return![];if(_0x293101[_0xb5e2('0x2a')]!==_0x1c9866[_0xb5e2('0x2a')])return![];if(moment()[_0xb5e2('0x36')](moment['unix'](_0x293101['exp'])))return![];return!![];}catch(_0x3a5c6d){throw _0x3a5c6d;}}function refreshOauth2MicrosoftAccessToken(_0x3cc3a8){return Promise[_0xb5e2('0x37')]()[_0xb5e2('0x38')](function(){if(_0x3cc3a8[_0xb5e2('0x39')])return _0x3cc3a8;return db[_0xb5e2('0x3a')][_0xb5e2('0x3b')]({'where':{'id':_0x3cc3a8['id']},'raw':!![]});})[_0xb5e2('0x38')](function(_0x5b41b1){var _0x47fbf5={'grant_type':'refresh_token','refresh_token':_0x5b41b1[_0xb5e2('0x3c')],'scope':getAccessTokenScope(_0x5b41b1),'redirect_uri':_0x5b41b1[_0xb5e2('0x26')],'client_id':_0x5b41b1[_0xb5e2('0x31')],'client_secret':encryptor[_0xb5e2('0x3d')](_0x5b41b1[_0xb5e2('0x39')])};var _0xc57b58={'method':_0xb5e2('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x5b41b1[_0xb5e2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x47fbf5,'json':!![]};return rp(_0xc57b58);})[_0xb5e2('0x38')](function(_0x2440ea){_0x3cc3a8[_0xb5e2('0x3f')]=_0x2440ea[_0xb5e2('0x40')];_0x3cc3a8[_0xb5e2('0x3c')]=_0x2440ea[_0xb5e2('0x41')];return db[_0xb5e2('0x3a')][_0xb5e2('0x42')]({'data5':_0x3cc3a8[_0xb5e2('0x3f')],'data6':_0x3cc3a8[_0xb5e2('0x3c')]},{'where':{'id':_0x3cc3a8['id']}});})[_0xb5e2('0x38')](function(){return _0x3cc3a8;})[_0xb5e2('0x43')](function(_0x36124b){logger[_0xb5e2('0x44')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x3cc3a8['id'],_0x36124b);});}function getOauth2MicrosoftAccessToken(_0x5f2cfb,_0x10e436){var _0x4c560e={'grant_type':_0xb5e2('0x45'),'code':_0x5f2cfb,'scope':getAccessTokenScope(_0x10e436),'redirect_uri':_0x10e436[_0xb5e2('0x26')],'client_id':_0x10e436['data1'],'client_secret':encryptor[_0xb5e2('0x3d')](_0x10e436[_0xb5e2('0x39')])};var _0xc9f285={'method':_0xb5e2('0x3e'),'uri':MICROSOFT_AUTH_URL[_0xb5e2('0x1a')](_0xb5e2('0x1b'),_0x10e436[_0xb5e2('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4c560e,'json':!![]};return rp(_0xc9f285);}function startRefreshInterval(_0x286cf7){var _0x469c09=schedule[_0xb5e2('0x46')];if(_0x469c09[_0x286cf7['id']])clearInterval(_0x469c09[_0x286cf7['id']]);_0x469c09[_0x286cf7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb5e2('0x47')](this,{'id':_0x286cf7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb5e2('0x46')]=_0x469c09;}function startAllRefreshIntervals(){return db[_0xb5e2('0x3a')][_0xb5e2('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb5e2('0x38')](function(_0x1bbb02){var _0x26c2cf=_0x1bbb02[_0xb5e2('0x13')](function(_0x59366a){return refreshOauth2MicrosoftAccessToken(_0x59366a)['then'](function(_0x47c3a3){startRefreshInterval(_0x47c3a3);});});return Promise['all'](_0x26c2cf);})[_0xb5e2('0x43')](function(_0x28565e){var _0x1a2310=_0x28565e?util[_0xb5e2('0x49')](_0x28565e,{'showHidden':![],'depth':null}):'';logger['error'](_0xb5e2('0x4a'),_0x1a2310);});}module[_0xb5e2('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x1d71=['redirect_uri','data4','form_post','state','nonce','prompt','key','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','isAfter','exp','data3','CloudProvider','findOne','refresh_token','decryptString','data2','data5','access_token','data6','update','then','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','bind','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','replace','code','id_token','from','stringify','base64','randomBytes','toString','client_id','data1','response_type','join'];(function(_0x3b7e80,_0x3d1b12){var _0xe3c04d=function(_0x236aa9){while(--_0x236aa9){_0x3b7e80['push'](_0x3b7e80['shift']());}};_0xe3c04d(++_0x3d1b12);}(_0x1d71,0x71));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11d7('0x0'));var crypto=require('crypto');var jwt=require(_0x11d7('0x1'));var moment=require('moment');var Redis=require(_0x11d7('0x2'));var rp=require(_0x11d7('0x3'));var util=require(_0x11d7('0x4'));var encryptor=require('../../components/encryptor');var config=require(_0x11d7('0x5'));var logger=require(_0x11d7('0x6'))(_0x11d7('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x11d7('0x8'))['db'];config[_0x11d7('0x9')]=_[_0x11d7('0xa')](config[_0x11d7('0x9')],{'host':_0x11d7('0xb'),'port':0x18eb});var redis=new Redis(config[_0x11d7('0x9')]);var MICROSOFT_AUTH_URL=_0x11d7('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x11d7('0xd'),_0x11d7('0xe'),_0x11d7('0xf'),_0x11d7('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x11d7('0x11'),_0x11d7('0x12')],'Dynamics365':['openid',_0x11d7('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x11d7('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x11d7('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x186211){var _0x5ab372=_[_0x11d7('0x15')](AZURE_AUTH_SCOPES[_0x186211[_0x11d7('0x16')]]);if(_0x186211[_0x11d7('0x16')]==='Dynamics365')_0x5ab372[_0x11d7('0x17')](_0x186211[_0x11d7('0x18')]+_0x11d7('0x19'));return _0x5ab372['join']('\x20');}function getAccessTokenScope(_0x59dcb6){if(_0x59dcb6[_0x11d7('0x16')]===_0x11d7('0x1a'))return _0x11d7('0x1b');if(_0x59dcb6[_0x11d7('0x16')]===_0x11d7('0x1c'))return _0x59dcb6[_0x11d7('0x18')]+_0x11d7('0x19');}function generateMicrosoftAuthorizationUrl(_0x138dfe,_0x1c7392){var _0x2030c1=MICROSOFT_AUTH_URL[_0x11d7('0x1d')]('{TENANT_ID}',_0x138dfe['data2']);var _0xe81ed8=[_0x11d7('0x1e'),_0x11d7('0x1f')];var _0x1b17f4=Buffer[_0x11d7('0x20')](JSON[_0x11d7('0x21')]({'id':_0x1c7392}))['toString'](_0x11d7('0x22'));var _0x2df932=crypto[_0x11d7('0x23')](0x10)[_0x11d7('0x24')]('hex');var _0x1299ee=getAuthorizationScopes(_0x138dfe);var _0x44306d=[{'key':_0x11d7('0x25'),'value':_0x138dfe[_0x11d7('0x26')]},{'key':_0x11d7('0x27'),'value':encodeURIComponent(_0xe81ed8[_0x11d7('0x28')]('\x20'))},{'key':_0x11d7('0x29'),'value':_0x138dfe[_0x11d7('0x2a')]},{'key':'response_mode','value':_0x11d7('0x2b')},{'key':'scope','value':encodeURIComponent(_0x1299ee)},{'key':_0x11d7('0x2c'),'value':_0x1b17f4},{'key':_0x11d7('0x2d'),'value':_0x2df932},{'key':_0x11d7('0x2e'),'value':'login'}];var _0x1ae94f=_0x2030c1+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x11d7('0x15')](_0x44306d,function(_0x46264e){return _0x46264e[_0x11d7('0x2f')]+'='+_0x46264e['value'];})[_0x11d7('0x28')]('&');_0x138dfe[_0x11d7('0x30')]={'issuer':_0x2030c1[_0x11d7('0x1d')](_0x11d7('0x31'),''),'audience':_0x138dfe['data1'],'state':_0x1b17f4,'nonce':_0x2df932};redis[_0x11d7('0x32')](_0x1b17f4,JSON[_0x11d7('0x21')](_0x138dfe));return _0x1ae94f;}function isValidIdToken(_0x10d078,_0x1be893){try{var _0x17ea7b=jwt['decode'](_0x10d078,{'complete':!![]});var _0x5caf6d=_0x17ea7b[_0x11d7('0x33')];if(_0x5caf6d[_0x11d7('0x34')]!==_0x1be893[_0x11d7('0x35')])return![];if(_0x5caf6d[_0x11d7('0x36')]!==_0x1be893['audience'])return![];if(_0x5caf6d[_0x11d7('0x2d')]!==_0x1be893['nonce'])return![];if(moment()[_0x11d7('0x37')](moment['unix'](_0x5caf6d[_0x11d7('0x38')])))return![];return!![];}catch(_0x4bfaaf){throw _0x4bfaaf;}}function refreshOauth2MicrosoftAccessToken(_0x8d4aad){return Promise['resolve']()['then'](function(){if(_0x8d4aad[_0x11d7('0x39')])return _0x8d4aad;return db[_0x11d7('0x3a')][_0x11d7('0x3b')]({'where':{'id':_0x8d4aad['id']},'raw':!![]});})['then'](function(_0x36169e){var _0x4003fe={'grant_type':_0x11d7('0x3c'),'refresh_token':_0x36169e['data6'],'scope':getAccessTokenScope(_0x36169e),'redirect_uri':_0x36169e['data4'],'client_id':_0x36169e[_0x11d7('0x26')],'client_secret':encryptor[_0x11d7('0x3d')](_0x36169e[_0x11d7('0x39')])};var _0x16dca9={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x11d7('0x1d')]('{TENANT_ID}',_0x36169e[_0x11d7('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4003fe,'json':!![]};return rp(_0x16dca9);})['then'](function(_0x35f980){_0x8d4aad[_0x11d7('0x3f')]=_0x35f980[_0x11d7('0x40')];_0x8d4aad[_0x11d7('0x41')]=_0x35f980[_0x11d7('0x3c')];return db[_0x11d7('0x3a')][_0x11d7('0x42')]({'data5':_0x8d4aad[_0x11d7('0x3f')],'data6':_0x8d4aad[_0x11d7('0x41')]},{'where':{'id':_0x8d4aad['id']}});})[_0x11d7('0x43')](function(){return _0x8d4aad;})['catch'](function(_0x59e24b){logger[_0x11d7('0x44')](_0x11d7('0x45'),_0x8d4aad['id'],_0x59e24b);});}function getOauth2MicrosoftAccessToken(_0x2875c8,_0x26b1e2){var _0x40c428={'grant_type':_0x11d7('0x46'),'code':_0x2875c8,'scope':getAccessTokenScope(_0x26b1e2),'redirect_uri':_0x26b1e2[_0x11d7('0x2a')],'client_id':_0x26b1e2['data1'],'client_secret':encryptor[_0x11d7('0x3d')](_0x26b1e2[_0x11d7('0x39')])};var _0x59486e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x11d7('0x1d')](_0x11d7('0x47'),_0x26b1e2[_0x11d7('0x3e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x40c428,'json':!![]};return rp(_0x59486e);}function startRefreshInterval(_0xafb004){var _0x5365c2=schedule[_0x11d7('0x48')];if(_0x5365c2[_0xafb004['id']])clearInterval(_0x5365c2[_0xafb004['id']]);_0x5365c2[_0xafb004['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x11d7('0x49')](this,{'id':_0xafb004['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x11d7('0x48')]=_0x5365c2;}function startAllRefreshIntervals(){return db[_0x11d7('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x58ebb3){var _0x1492b4=_0x58ebb3[_0x11d7('0x15')](function(_0x28ee70){return refreshOauth2MicrosoftAccessToken(_0x28ee70)[_0x11d7('0x43')](function(_0x2109f2){startRefreshInterval(_0x2109f2);});});return Promise[_0x11d7('0x4a')](_0x1492b4);})['catch'](function(_0x2c9fe4){var _0x364599=_0x2c9fe4?util['inspect'](_0x2c9fe4,{'showHidden':![],'depth':null}):'';logger[_0x11d7('0x44')](_0x11d7('0x4b'),_0x364599);});}module[_0x11d7('0x4c')]={'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 cbf29dc..e864b7c 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 _0xa413=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','info'];(function(_0x402b1f,_0x3df329){var _0x5d22f2=function(_0x5f17c3){while(--_0x5f17c3){_0x402b1f['push'](_0x402b1f['shift']());}};_0x5d22f2(++_0x3df329);}(_0xa413,0x1e5));var _0x3a41=function(_0x365e84,_0x44654b){_0x365e84=_0x365e84-0x0;var _0x3918a9=_0xa413[_0x365e84];return _0x3918a9;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f6d2,_0x407d52,_0xca7253){return new BPromise(function(_0x473cd2,_0x27c2e5){return client['request'](_0x45f6d2,_0xca7253)[_0x3a41('0xa')](function(_0x570304){logger['info']('CloudProvider,\x20%s,\x20%s',_0x407d52,_0x3a41('0xb'));logger['debug'](_0x3a41('0xc'),_0x407d52,'request\x20sent',JSON[_0x3a41('0xd')](_0x570304));if(_0x570304[_0x3a41('0xe')]){if(_0x570304['error'][_0x3a41('0xf')]===0x1f4){logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x27c2e5(_0x570304['error'][_0x3a41('0x11')]);}logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x473cd2(_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);}else{logger[_0x3a41('0x12')](_0x3a41('0x10'),_0x407d52,_0x3a41('0xb'));_0x473cd2(_0x570304[_0x3a41('0x13')]['message']);}})[_0x3a41('0x14')](function(_0x30d675){logger['error']('CloudProvider,\x20%s,\x20%s',_0x407d52,_0x30d675);_0x27c2e5(_0x30d675);});});} \ No newline at end of file +var _0xa5c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa5c1,0x19f));var _0x1a5c=function(_0x58dc59,_0x351208){_0x58dc59=_0x58dc59-0x0;var _0x4a2c8b=_0xa5c1[_0x58dc59];return _0x4a2c8b;};'use strict';var _=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var moment=require(_0x1a5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a5c('0x4'));var logger=require(_0x1a5c('0x5'))(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var jayson=require(_0x1a5c('0x8'));var client=jayson[_0x1a5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9853,_0x580a2e,_0x438f8f){return new BPromise(function(_0x43a2ed,_0x1702ce){return client['request'](_0x9853,_0x438f8f)[_0x1a5c('0xa')](function(_0x4c0bd2){logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');logger[_0x1a5c('0xd')](_0x1a5c('0xe'),_0x580a2e,'request\x20sent',JSON[_0x1a5c('0xf')](_0x4c0bd2));if(_0x4c0bd2[_0x1a5c('0x10')]){if(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x11')]===0x1f4){logger[_0x1a5c('0x10')](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x1702ce(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}logger['error'](_0x1a5c('0xc'),_0x580a2e,_0x4c0bd2[_0x1a5c('0x10')]['message']);return _0x43a2ed(_0x4c0bd2[_0x1a5c('0x10')][_0x1a5c('0x12')]);}else{logger[_0x1a5c('0xb')](_0x1a5c('0xc'),_0x580a2e,'request\x20sent');_0x43a2ed(_0x4c0bd2[_0x1a5c('0x13')]['message']);}})[_0x1a5c('0x14')](function(_0x44648a){logger[_0x1a5c('0x10')]('CloudProvider,\x20%s,\x20%s',_0x580a2e,_0x44648a);_0x1702ce(_0x44648a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 4424bfb..b7f1aa7 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x22667a,_0x5cee40){var _0x187033=function(_0x2b1dc7){while(--_0x2b1dc7){_0x22667a['push'](_0x22667a['shift']());}};_0x187033(++_0x5cee40);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x365882,_0x34bf3f){var _0x3bcd97=function(_0x27da69){while(--_0x27da69){_0x365882['push'](_0x365882['shift']());}};_0x3bcd97(++_0x34bf3f);}(_0x2ef3,0xba));var _0x32ef=function(_0x446ef9,_0x7fa2f7){_0x446ef9=_0x446ef9-0x0;var _0x1b348a=_0x2ef3[_0x446ef9];return _0x1b348a;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index cb56700..06066c6 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 _0xe35a=['STRING','name','sequelize','exports'];(function(_0x353371,_0x1d2cc9){var _0x4cbce5=function(_0x48100f){while(--_0x48100f){_0x353371['push'](_0x353371['shift']());}};_0x4cbce5(++_0x1d2cc9);}(_0xe35a,0x1a6));var _0xae35=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0xe35a[_0x1e6e39];return _0x2d9029;};'use strict';var Sequelize=require(_0xae35('0x0'));module[_0xae35('0x1')]={'name':{'type':Sequelize[_0xae35('0x2')],'unique':_0xae35('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xae35('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xae35('0x2')]},'phone':{'type':Sequelize[_0xae35('0x2')]},'fax':{'type':Sequelize[_0xae35('0x2')]},'type':{'type':Sequelize[_0xae35('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xae35('0x2')]},'city':{'type':Sequelize[_0xae35('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xae35('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xae35('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xae35('0x2')]},'sCity':{'type':Sequelize[_0xae35('0x2')]},'sCountry':{'type':Sequelize[_0xae35('0x2')]},'description':{'type':Sequelize[_0xae35('0x2')]}}; \ No newline at end of file +var _0x3df4=['STRING','exports'];(function(_0x96f54d,_0x5e5d21){var _0xdb885c=function(_0x35225c){while(--_0x35225c){_0x96f54d['push'](_0x96f54d['shift']());}};_0xdb885c(++_0x5e5d21);}(_0x3df4,0x137));var _0x43df=function(_0x58cd9c,_0x584d3d){_0x58cd9c=_0x58cd9c-0x0;var _0x93fd95=_0x3df4[_0x58cd9c];return _0x93fd95;};'use strict';var Sequelize=require('sequelize');module[_0x43df('0x0')]={'name':{'type':Sequelize[_0x43df('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x43df('0x1')]},'website':{'type':Sequelize[_0x43df('0x1')]},'phone':{'type':Sequelize[_0x43df('0x1')]},'fax':{'type':Sequelize[_0x43df('0x1')]},'type':{'type':Sequelize[_0x43df('0x1')]},'street':{'type':Sequelize[_0x43df('0x1')]},'postalCode':{'type':Sequelize[_0x43df('0x1')]},'city':{'type':Sequelize[_0x43df('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x43df('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x43df('0x1')]},'sStreet':{'type':Sequelize[_0x43df('0x1')]},'sPostalCode':{'type':Sequelize[_0x43df('0x1')]},'sCity':{'type':Sequelize[_0x43df('0x1')]},'sCountry':{'type':Sequelize[_0x43df('0x1')]},'description':{'type':Sequelize[_0x43df('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 4748037..caad961 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 _0xec3d=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','name','send','index','CmCompany','describe','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','params','rawAttributes','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','nolimit','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x152ef7,_0x221f4c){var _0x33b535=function(_0x4d9ab7){while(--_0x4d9ab7){_0x152ef7['push'](_0x152ef7['shift']());}};_0x33b535(++_0x221f4c);}(_0xec3d,0x1aa));var _0xdec3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec3d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdec3('0x0'));var jsonpatch=require(_0xdec3('0x1'));var rp=require(_0xdec3('0x2'));var moment=require(_0xdec3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdec3('0x4'));var util=require(_0xdec3('0x5'));var path=require(_0xdec3('0x6'));var sox=require('sox');var csv=require(_0xdec3('0x7'));var ejs=require(_0xdec3('0x8'));var fs=require('fs');var fs_extra=require(_0xdec3('0x9'));var _=require('lodash');var squel=require(_0xdec3('0xa'));var crypto=require(_0xdec3('0xb'));var jsforce=require(_0xdec3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdec3('0x7'));var querystring=require(_0xdec3('0xd'));var Papa=require(_0xdec3('0xe'));var Redis=require(_0xdec3('0xf'));var authService=require(_0xdec3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdec3('0x11'));var logger=require(_0xdec3('0x12'))(_0xdec3('0x13'));var utils=require(_0xdec3('0x14'));var config=require(_0xdec3('0x15'));var licenseUtil=require(_0xdec3('0x16'));var db=require(_0xdec3('0x17'))['db'];function respondWithStatusCode(_0x3629a4,_0x1b9bfc){_0x1b9bfc=_0x1b9bfc||0xcc;return function(_0x55a0db){if(_0x55a0db){return _0x3629a4[_0xdec3('0x18')](_0x1b9bfc);}return _0x3629a4[_0xdec3('0x19')](_0x1b9bfc)[_0xdec3('0x1a')]();};}function respondWithResult(_0x4d7a8e,_0x4e69fb){_0x4e69fb=_0x4e69fb||0xc8;return function(_0x5cd541){if(_0x5cd541){return _0x4d7a8e[_0xdec3('0x19')](_0x4e69fb)[_0xdec3('0x1b')](_0x5cd541);}};}function respondWithFilteredResult(_0x1172e4,_0x2bfe68){return function(_0x2ac417){if(_0x2ac417){var _0x1770f9=typeof _0x2bfe68['offset']===_0xdec3('0x1c')&&typeof _0x2bfe68['limit']===_0xdec3('0x1c');var _0x35e442=_0x2ac417[_0xdec3('0x1d')];var _0x3d7f01=_0x1770f9?0x0:_0x2bfe68[_0xdec3('0x1e')];var _0x5e9067=_0x1770f9?_0x2ac417['count']:_0x2bfe68[_0xdec3('0x1e')]+_0x2bfe68[_0xdec3('0x1f')];var _0xdfb0a4;if(_0x5e9067>=_0x35e442){_0x5e9067=_0x35e442;_0xdfb0a4=0xc8;}else{_0xdfb0a4=0xce;}_0x1172e4[_0xdec3('0x19')](_0xdfb0a4);return _0x1172e4[_0xdec3('0x20')](_0xdec3('0x21'),_0x3d7f01+'-'+_0x5e9067+'/'+_0x35e442)['json'](_0x2ac417);}return null;};}function patchUpdates(_0x49b158){return function(_0x359c43){try{jsonpatch[_0xdec3('0x22')](_0x359c43,_0x49b158,!![]);}catch(_0x3111a8){return BPromise[_0xdec3('0x23')](_0x3111a8);}return _0x359c43[_0xdec3('0x24')]();};}function saveUpdates(_0x61e319,_0x147405){return function(_0x9d40bf){if(_0x9d40bf){return _0x9d40bf[_0xdec3('0x25')](_0x61e319)[_0xdec3('0x26')](function(_0x12d602){return _0x12d602;});}return null;};}function removeEntity(_0x38ef90,_0x345a77){return function(_0x2f1c02){if(_0x2f1c02){return _0x2f1c02[_0xdec3('0x27')]()[_0xdec3('0x26')](function(){var _0x196877=_0x2f1c02['get']({'plain':!![]});var _0x24f20c=_0xdec3('0x28');return db[_0xdec3('0x29')][_0xdec3('0x27')]({'where':{'type':_0x24f20c,'resourceId':_0x196877['id']}})[_0xdec3('0x26')](function(){return _0x2f1c02;});})[_0xdec3('0x26')](function(){_0x38ef90[_0xdec3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4580b7,_0x2de0ed){return function(_0x2c97fe){if(!_0x2c97fe){_0x4580b7[_0xdec3('0x18')](0x194);}return _0x2c97fe;};}function handleError(_0xb291da,_0x8610d0){_0x8610d0=_0x8610d0||0x1f4;return function(_0xdf2908){logger[_0xdec3('0x2a')](_0xdf2908['stack']);if(_0xdf2908[_0xdec3('0x2b')]){delete _0xdf2908[_0xdec3('0x2b')];}_0xb291da[_0xdec3('0x19')](_0x8610d0)[_0xdec3('0x2c')](_0xdf2908);};}exports[_0xdec3('0x2d')]=function(_0x3c4524,_0x36afaa){var _0x18d6b4={},_0x55fa78={},_0x37d98b={'count':0x0,'rows':[]};return db[_0xdec3('0x2e')][_0xdec3('0x2f')]()[_0xdec3('0x26')](function(_0x1a597f){_0x55fa78['model']=_[_0xdec3('0x30')](_0x1a597f);_0x55fa78[_0xdec3('0x31')]=_[_0xdec3('0x30')](_0x3c4524[_0xdec3('0x31')]);_0x55fa78[_0xdec3('0x32')]=_['intersection'](_0x55fa78[_0xdec3('0x33')],_0x55fa78['query']);_0x18d6b4[_0xdec3('0x34')]=_['intersection'](_0x55fa78[_0xdec3('0x33')],qs[_0xdec3('0x35')](_0x3c4524[_0xdec3('0x31')]['fields']));_0x18d6b4[_0xdec3('0x34')]=_0x18d6b4[_0xdec3('0x34')][_0xdec3('0x36')]?_0x18d6b4[_0xdec3('0x34')]:_0x55fa78['model'];if(!_0x3c4524[_0xdec3('0x31')][_0xdec3('0x37')]('nolimit')){_0x18d6b4[_0xdec3('0x1f')]=qs[_0xdec3('0x1f')](_0x3c4524[_0xdec3('0x31')][_0xdec3('0x1f')]);_0x18d6b4[_0xdec3('0x1e')]=qs[_0xdec3('0x1e')](_0x3c4524['query']['offset']);}_0x18d6b4[_0xdec3('0x38')]=qs[_0xdec3('0x39')](_0x3c4524[_0xdec3('0x31')]['sort']);_0x18d6b4[_0xdec3('0x3a')]=qs['filters'](_[_0xdec3('0x3b')](_0x3c4524[_0xdec3('0x31')],_0x55fa78['filters']),_0x1a597f);if(_0x3c4524['query'][_0xdec3('0x3c')]){_0x18d6b4[_0xdec3('0x3a')]=_[_0xdec3('0x3d')](_0x18d6b4[_0xdec3('0x3a')],{'$or':_[_0xdec3('0x3e')](_0x18d6b4[_0xdec3('0x34')],function(_0x1bc968){var _0x4463bc={};_0x4463bc[_0x1bc968]={'$like':'%'+_0x3c4524[_0xdec3('0x31')][_0xdec3('0x3c')]+'%'};return _0x4463bc;})});}_0x18d6b4=_['merge']({},_0x18d6b4,_0x3c4524[_0xdec3('0x3f')]);var _0x2f9604={'where':_0x18d6b4['where']};return db[_0xdec3('0x2e')][_0xdec3('0x1d')](_0x2f9604)[_0xdec3('0x26')](function(_0x4def4c){_0x37d98b[_0xdec3('0x1d')]=_0x4def4c;if(_0x3c4524['query'][_0xdec3('0x40')]){_0x18d6b4[_0xdec3('0x41')]=[{'all':!![]}];}return db[_0xdec3('0x2e')]['findAll'](_0x18d6b4);})[_0xdec3('0x26')](function(_0x23ee4c){_0x37d98b[_0xdec3('0x42')]=_0x23ee4c;return _0x37d98b;})[_0xdec3('0x26')](respondWithFilteredResult(_0x36afaa,_0x18d6b4))[_0xdec3('0x43')](handleError(_0x36afaa,null));})[_0xdec3('0x43')](handleError(_0x36afaa,null));};exports['show']=function(_0xe1a4bb,_0x365c4e){var _0x539f47={'raw':![],'where':{'id':_0xe1a4bb[_0xdec3('0x44')]['id']}},_0x2fcdc1={};_0x2fcdc1['model']=_['keys'](db[_0xdec3('0x2e')][_0xdec3('0x45')]);_0x2fcdc1[_0xdec3('0x31')]=_[_0xdec3('0x30')](_0xe1a4bb[_0xdec3('0x31')]);_0x2fcdc1[_0xdec3('0x32')]=_[_0xdec3('0x46')](_0x2fcdc1[_0xdec3('0x33')],_0x2fcdc1['query']);_0x539f47[_0xdec3('0x34')]=_[_0xdec3('0x46')](_0x2fcdc1['model'],qs['fields'](_0xe1a4bb[_0xdec3('0x31')]['fields']));_0x539f47[_0xdec3('0x34')]=_0x539f47['attributes'][_0xdec3('0x36')]?_0x539f47['attributes']:_0x2fcdc1[_0xdec3('0x33')];if(_0xe1a4bb['query']['includeAll']){_0x539f47[_0xdec3('0x41')]=[{'all':!![]}];}_0x539f47=_['merge']({},_0x539f47,_0xe1a4bb[_0xdec3('0x3f')]);return db['CmCompany']['find'](_0x539f47)[_0xdec3('0x26')](handleEntityNotFound(_0x365c4e,null))[_0xdec3('0x26')](respondWithResult(_0x365c4e,null))['catch'](handleError(_0x365c4e,null));};exports[_0xdec3('0x47')]=function(_0x38e72d,_0x5b9661){return db[_0xdec3('0x2e')]['create'](_0x38e72d[_0xdec3('0x48')],{})[_0xdec3('0x26')](function(_0xfffd10){var _0x4a5dc1=_0x38e72d[_0xdec3('0x49')][_0xdec3('0x4a')]({'plain':!![]});if(!_0x4a5dc1)throw new Error(_0xdec3('0x4b'));if(_0x4a5dc1[_0xdec3('0x4c')]===_0xdec3('0x49')){var _0x22be69=_0xfffd10['get']({'plain':!![]});var _0x86418a=_0xdec3('0x28');return db[_0xdec3('0x4d')][_0xdec3('0x4e')]({'where':{'name':_0x86418a,'userProfileId':_0x4a5dc1[_0xdec3('0x4f')]},'raw':!![]})['then'](function(_0x4554fc){if(_0x4554fc&&_0x4554fc[_0xdec3('0x50')]===0x0){return db[_0xdec3('0x29')][_0xdec3('0x47')]({'name':_0x22be69[_0xdec3('0x2b')],'resourceId':_0x22be69['id'],'type':_0x4554fc[_0xdec3('0x2b')],'sectionId':_0x4554fc['id']},{})[_0xdec3('0x26')](function(){return _0xfffd10;});}else{return _0xfffd10;}})[_0xdec3('0x43')](function(_0x579b3b){logger[_0xdec3('0x2a')](_0xdec3('0x51'),_0x579b3b);throw _0x579b3b;});}return _0xfffd10;})[_0xdec3('0x26')](respondWithResult(_0x5b9661,0xc9))[_0xdec3('0x43')](handleError(_0x5b9661,null));};exports[_0xdec3('0x25')]=function(_0x3bac05,_0x1a54d6){if(_0x3bac05[_0xdec3('0x48')]['id']){delete _0x3bac05[_0xdec3('0x48')]['id'];}return db[_0xdec3('0x2e')][_0xdec3('0x4e')]({'where':{'id':_0x3bac05[_0xdec3('0x44')]['id']}})[_0xdec3('0x26')](handleEntityNotFound(_0x1a54d6,null))[_0xdec3('0x26')](saveUpdates(_0x3bac05[_0xdec3('0x48')],null))[_0xdec3('0x26')](respondWithResult(_0x1a54d6,null))[_0xdec3('0x43')](handleError(_0x1a54d6,null));};exports[_0xdec3('0x27')]=function(_0x1ef602,_0x535ca2){return db[_0xdec3('0x2e')][_0xdec3('0x4e')]({'where':{'id':_0x1ef602['params']['id']}})[_0xdec3('0x26')](handleEntityNotFound(_0x535ca2,null))[_0xdec3('0x26')](removeEntity(_0x535ca2,null))[_0xdec3('0x43')](handleError(_0x535ca2,null));};exports[_0xdec3('0x2f')]=function(_0x1419ee,_0x3875a5){return db['CmCompany'][_0xdec3('0x2f')]()['then'](respondWithResult(_0x3875a5,null))[_0xdec3('0x43')](handleError(_0x3875a5,null));};exports[_0xdec3('0x52')]=function(_0x29cedb,_0x1a5eb6,_0x2acdad){return db[_0xdec3('0x53')]['find']({'where':{'id':_0x29cedb[_0xdec3('0x44')]['id']}})[_0xdec3('0x26')](handleEntityNotFound(_0x1a5eb6,null))[_0xdec3('0x26')](function(_0x143e00){if(_0x143e00){return _0x143e00[_0xdec3('0x52')](_0x29cedb[_0xdec3('0x48')][_0xdec3('0x54')],_[_0xdec3('0x55')](_0x29cedb['body'],[_0xdec3('0x54'),'id'])||{});}})[_0xdec3('0x26')](respondWithResult(_0x1a5eb6,null))[_0xdec3('0x43')](handleError(_0x1a5eb6,null));};exports['getContacts']=function(_0x343717,_0x13d680,_0x267d96){var _0x33a04a={};var _0x4245e8={};var _0x118e96;var _0x3f51e0;return db[_0xdec3('0x2e')]['findOne']({'where':{'id':_0x343717[_0xdec3('0x44')]['id']}})[_0xdec3('0x26')](handleEntityNotFound(_0x13d680,null))[_0xdec3('0x26')](function(_0x4f2543){if(_0x4f2543){_0x118e96=_0x4f2543;_0x4245e8['model']=_[_0xdec3('0x30')](db['CmContact']['rawAttributes']);_0x4245e8['query']=_[_0xdec3('0x30')](_0x343717[_0xdec3('0x31')]);_0x4245e8[_0xdec3('0x32')]=_[_0xdec3('0x46')](_0x4245e8[_0xdec3('0x33')],_0x4245e8['query']);_0x33a04a[_0xdec3('0x34')]=_[_0xdec3('0x46')](_0x4245e8[_0xdec3('0x33')],qs['fields'](_0x343717[_0xdec3('0x31')][_0xdec3('0x35')]));_0x33a04a[_0xdec3('0x34')]=_0x33a04a[_0xdec3('0x34')][_0xdec3('0x36')]?_0x33a04a[_0xdec3('0x34')]:_0x4245e8[_0xdec3('0x33')];_0x33a04a[_0xdec3('0x38')]=qs[_0xdec3('0x39')](_0x343717[_0xdec3('0x31')][_0xdec3('0x39')]);_0x33a04a[_0xdec3('0x3a')]=qs['filters'](_[_0xdec3('0x3b')](_0x343717[_0xdec3('0x31')],_0x4245e8['filters']));if(_0x343717['query'][_0xdec3('0x3c')]){_0x33a04a[_0xdec3('0x3a')]=_['merge'](_0x33a04a[_0xdec3('0x3a')],{'$or':_[_0xdec3('0x3e')](_0x33a04a['attributes'],function(_0xf893ca){var _0x4b8364={};_0x4b8364[_0xf893ca]={'$like':'%'+_0x343717[_0xdec3('0x31')][_0xdec3('0x3c')]+'%'};return _0x4b8364;})});}_0x33a04a=_[_0xdec3('0x3d')]({},_0x33a04a,_0x343717[_0xdec3('0x3f')]);return _0x118e96[_0xdec3('0x56')](_0x33a04a);}})[_0xdec3('0x26')](function(_0x30ebc0){if(_0x30ebc0){_0x3f51e0=_0x30ebc0[_0xdec3('0x36')];if(!_0x343717[_0xdec3('0x31')][_0xdec3('0x37')](_0xdec3('0x57'))){_0x33a04a[_0xdec3('0x1f')]=qs[_0xdec3('0x1f')](_0x343717[_0xdec3('0x31')]['limit']);_0x33a04a[_0xdec3('0x1e')]=qs[_0xdec3('0x1e')](_0x343717[_0xdec3('0x31')][_0xdec3('0x1e')]);}return _0x118e96[_0xdec3('0x56')](_0x33a04a);}})[_0xdec3('0x26')](function(_0x2aaf2c){if(_0x2aaf2c){return _0x2aaf2c?{'count':_0x3f51e0,'rows':_0x2aaf2c}:null;}})['then'](respondWithResult(_0x13d680,null))[_0xdec3('0x43')](handleError(_0x13d680,null));}; \ No newline at end of file +var _0x71f1=['Companies','UserProfileResource','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','includeAll','findAll','rows','catch','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','findOne','rawAttributes','pick','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71f1,0x130));var _0x171f=function(_0x356dcc,_0x51f8f7){_0x356dcc=_0x356dcc-0x0;var _0xe6c019=_0x71f1[_0x356dcc];return _0xe6c019;};'use strict';var emlformat=require(_0x171f('0x0'));var rimraf=require(_0x171f('0x1'));var zipdir=require(_0x171f('0x2'));var jsonpatch=require(_0x171f('0x3'));var rp=require(_0x171f('0x4'));var moment=require(_0x171f('0x5'));var BPromise=require(_0x171f('0x6'));var Mustache=require(_0x171f('0x7'));var util=require('util');var path=require(_0x171f('0x8'));var sox=require(_0x171f('0x9'));var csv=require('to-csv');var ejs=require(_0x171f('0xa'));var fs=require('fs');var fs_extra=require(_0x171f('0xb'));var _=require('lodash');var squel=require(_0x171f('0xc'));var crypto=require('crypto');var jsforce=require(_0x171f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x171f('0xe'));var querystring=require(_0x171f('0xf'));var Papa=require(_0x171f('0x10'));var Redis=require(_0x171f('0x11'));var authService=require(_0x171f('0x12'));var qs=require(_0x171f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x171f('0x14'));var logger=require(_0x171f('0x15'))(_0x171f('0x16'));var utils=require('../../config/utils');var config=require(_0x171f('0x17'));var licenseUtil=require(_0x171f('0x18'));var db=require(_0x171f('0x19'))['db'];function respondWithStatusCode(_0x1625b8,_0x16872d){_0x16872d=_0x16872d||0xcc;return function(_0x4700fa){if(_0x4700fa){return _0x1625b8[_0x171f('0x1a')](_0x16872d);}return _0x1625b8[_0x171f('0x1b')](_0x16872d)[_0x171f('0x1c')]();};}function respondWithResult(_0x22bc15,_0x40d518){_0x40d518=_0x40d518||0xc8;return function(_0x5379ec){if(_0x5379ec){return _0x22bc15[_0x171f('0x1b')](_0x40d518)[_0x171f('0x1d')](_0x5379ec);}};}function respondWithFilteredResult(_0x5bee2b,_0x30c96b){return function(_0x48e57c){if(_0x48e57c){var _0x438aac=typeof _0x30c96b[_0x171f('0x1e')]===_0x171f('0x1f')&&typeof _0x30c96b[_0x171f('0x20')]==='undefined';var _0x20e157=_0x48e57c[_0x171f('0x21')];var _0x24f13e=_0x438aac?0x0:_0x30c96b['offset'];var _0x104f28=_0x438aac?_0x48e57c[_0x171f('0x21')]:_0x30c96b[_0x171f('0x1e')]+_0x30c96b[_0x171f('0x20')];var _0x2afe9c;if(_0x104f28>=_0x20e157){_0x104f28=_0x20e157;_0x2afe9c=0xc8;}else{_0x2afe9c=0xce;}_0x5bee2b[_0x171f('0x1b')](_0x2afe9c);return _0x5bee2b['set']('Content-Range',_0x24f13e+'-'+_0x104f28+'/'+_0x20e157)[_0x171f('0x1d')](_0x48e57c);}return null;};}function patchUpdates(_0x685464){return function(_0x16bd9f){try{jsonpatch[_0x171f('0x22')](_0x16bd9f,_0x685464,!![]);}catch(_0x2946fd){return BPromise[_0x171f('0x23')](_0x2946fd);}return _0x16bd9f['save']();};}function saveUpdates(_0x23ad7e,_0x5acae4){return function(_0x34915d){if(_0x34915d){return _0x34915d[_0x171f('0x24')](_0x23ad7e)['then'](function(_0x2834f6){return _0x2834f6;});}return null;};}function removeEntity(_0x2fa751,_0x2f7bd9){return function(_0x5c8539){if(_0x5c8539){return _0x5c8539[_0x171f('0x25')]()[_0x171f('0x26')](function(){var _0x1a5205=_0x5c8539[_0x171f('0x27')]({'plain':!![]});var _0x56c308=_0x171f('0x28');return db[_0x171f('0x29')]['destroy']({'where':{'type':_0x56c308,'resourceId':_0x1a5205['id']}})[_0x171f('0x26')](function(){return _0x5c8539;});})[_0x171f('0x26')](function(){_0x2fa751[_0x171f('0x1b')](0xcc)[_0x171f('0x1c')]();});}};}function handleEntityNotFound(_0x27ec9c,_0x46f166){return function(_0x41bb84){if(!_0x41bb84){_0x27ec9c[_0x171f('0x1a')](0x194);}return _0x41bb84;};}function handleError(_0x1ae388,_0x56fcfb){_0x56fcfb=_0x56fcfb||0x1f4;return function(_0x4cad86){logger[_0x171f('0x2a')](_0x4cad86['stack']);if(_0x4cad86[_0x171f('0x2b')]){delete _0x4cad86[_0x171f('0x2b')];}_0x1ae388[_0x171f('0x1b')](_0x56fcfb)[_0x171f('0x2c')](_0x4cad86);};}exports[_0x171f('0x2d')]=function(_0x4e018c,_0x3ff13b){var _0x19e616={},_0x17f02f={},_0x208903={'count':0x0,'rows':[]};return db[_0x171f('0x2e')][_0x171f('0x2f')]()['then'](function(_0x1a5c0d){_0x17f02f[_0x171f('0x30')]=_[_0x171f('0x31')](_0x1a5c0d);_0x17f02f[_0x171f('0x32')]=_[_0x171f('0x31')](_0x4e018c[_0x171f('0x32')]);_0x17f02f[_0x171f('0x33')]=_[_0x171f('0x34')](_0x17f02f[_0x171f('0x30')],_0x17f02f[_0x171f('0x32')]);_0x19e616[_0x171f('0x35')]=_[_0x171f('0x34')](_0x17f02f['model'],qs[_0x171f('0x36')](_0x4e018c[_0x171f('0x32')]['fields']));_0x19e616[_0x171f('0x35')]=_0x19e616['attributes'][_0x171f('0x37')]?_0x19e616[_0x171f('0x35')]:_0x17f02f[_0x171f('0x30')];if(!_0x4e018c['query'][_0x171f('0x38')](_0x171f('0x39'))){_0x19e616[_0x171f('0x20')]=qs[_0x171f('0x20')](_0x4e018c[_0x171f('0x32')]['limit']);_0x19e616[_0x171f('0x1e')]=qs[_0x171f('0x1e')](_0x4e018c[_0x171f('0x32')][_0x171f('0x1e')]);}_0x19e616[_0x171f('0x3a')]=qs[_0x171f('0x3b')](_0x4e018c[_0x171f('0x32')]['sort']);_0x19e616['where']=qs['filters'](_['pick'](_0x4e018c[_0x171f('0x32')],_0x17f02f[_0x171f('0x33')]),_0x1a5c0d);if(_0x4e018c[_0x171f('0x32')][_0x171f('0x3c')]){_0x19e616[_0x171f('0x3d')]=_[_0x171f('0x3e')](_0x19e616[_0x171f('0x3d')],{'$or':_['map'](_0x19e616[_0x171f('0x35')],function(_0x97d8b1){var _0x26b01b={};_0x26b01b[_0x97d8b1]={'$like':'%'+_0x4e018c[_0x171f('0x32')][_0x171f('0x3c')]+'%'};return _0x26b01b;})});}_0x19e616=_['merge']({},_0x19e616,_0x4e018c['options']);var _0x1b772e={'where':_0x19e616[_0x171f('0x3d')]};return db[_0x171f('0x2e')][_0x171f('0x21')](_0x1b772e)[_0x171f('0x26')](function(_0xa0d687){_0x208903[_0x171f('0x21')]=_0xa0d687;if(_0x4e018c[_0x171f('0x32')][_0x171f('0x3f')]){_0x19e616['include']=[{'all':!![]}];}return db[_0x171f('0x2e')][_0x171f('0x40')](_0x19e616);})[_0x171f('0x26')](function(_0x3000ed){_0x208903[_0x171f('0x41')]=_0x3000ed;return _0x208903;})[_0x171f('0x26')](respondWithFilteredResult(_0x3ff13b,_0x19e616))[_0x171f('0x42')](handleError(_0x3ff13b,null));})['catch'](handleError(_0x3ff13b,null));};exports['show']=function(_0x2779a9,_0x20471e){var _0x4df7f2={'raw':![],'where':{'id':_0x2779a9[_0x171f('0x43')]['id']}},_0x19b386={};_0x19b386[_0x171f('0x30')]=_[_0x171f('0x31')](db[_0x171f('0x2e')]['rawAttributes']);_0x19b386[_0x171f('0x32')]=_[_0x171f('0x31')](_0x2779a9['query']);_0x19b386['filters']=_['intersection'](_0x19b386[_0x171f('0x30')],_0x19b386['query']);_0x4df7f2[_0x171f('0x35')]=_[_0x171f('0x34')](_0x19b386[_0x171f('0x30')],qs[_0x171f('0x36')](_0x2779a9['query'][_0x171f('0x36')]));_0x4df7f2[_0x171f('0x35')]=_0x4df7f2[_0x171f('0x35')][_0x171f('0x37')]?_0x4df7f2['attributes']:_0x19b386[_0x171f('0x30')];if(_0x2779a9[_0x171f('0x32')][_0x171f('0x3f')]){_0x4df7f2[_0x171f('0x44')]=[{'all':!![]}];}_0x4df7f2=_[_0x171f('0x3e')]({},_0x4df7f2,_0x2779a9[_0x171f('0x45')]);return db[_0x171f('0x2e')][_0x171f('0x46')](_0x4df7f2)[_0x171f('0x26')](handleEntityNotFound(_0x20471e,null))[_0x171f('0x26')](respondWithResult(_0x20471e,null))['catch'](handleError(_0x20471e,null));};exports[_0x171f('0x47')]=function(_0x57e528,_0x29c676){return db[_0x171f('0x2e')][_0x171f('0x47')](_0x57e528['body'],{})[_0x171f('0x26')](function(_0x3f8d46){var _0x21d466=_0x57e528[_0x171f('0x48')][_0x171f('0x27')]({'plain':!![]});if(!_0x21d466)throw new Error(_0x171f('0x49'));if(_0x21d466['role']==='user'){var _0x133bc1=_0x3f8d46[_0x171f('0x27')]({'plain':!![]});var _0x432eb8=_0x171f('0x28');return db[_0x171f('0x4a')][_0x171f('0x46')]({'where':{'name':_0x432eb8,'userProfileId':_0x21d466[_0x171f('0x4b')]},'raw':!![]})[_0x171f('0x26')](function(_0x2f74bd){if(_0x2f74bd&&_0x2f74bd['autoAssociation']===0x0){return db[_0x171f('0x29')][_0x171f('0x47')]({'name':_0x133bc1[_0x171f('0x2b')],'resourceId':_0x133bc1['id'],'type':_0x2f74bd[_0x171f('0x2b')],'sectionId':_0x2f74bd['id']},{})[_0x171f('0x26')](function(){return _0x3f8d46;});}else{return _0x3f8d46;}})[_0x171f('0x42')](function(_0x3be308){logger['error'](_0x171f('0x4c'),_0x3be308);throw _0x3be308;});}return _0x3f8d46;})[_0x171f('0x26')](respondWithResult(_0x29c676,0xc9))[_0x171f('0x42')](handleError(_0x29c676,null));};exports[_0x171f('0x24')]=function(_0x1882bf,_0x1c2493){if(_0x1882bf[_0x171f('0x4d')]['id']){delete _0x1882bf[_0x171f('0x4d')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x1882bf[_0x171f('0x43')]['id']}})[_0x171f('0x26')](handleEntityNotFound(_0x1c2493,null))[_0x171f('0x26')](saveUpdates(_0x1882bf[_0x171f('0x4d')],null))[_0x171f('0x26')](respondWithResult(_0x1c2493,null))['catch'](handleError(_0x1c2493,null));};exports['destroy']=function(_0x3a5f24,_0x238cb1){return db[_0x171f('0x2e')][_0x171f('0x46')]({'where':{'id':_0x3a5f24[_0x171f('0x43')]['id']}})[_0x171f('0x26')](handleEntityNotFound(_0x238cb1,null))[_0x171f('0x26')](removeEntity(_0x238cb1,null))[_0x171f('0x42')](handleError(_0x238cb1,null));};exports[_0x171f('0x2f')]=function(_0x1509cf,_0x2ea4c9){return db['CmCompany']['describe']()[_0x171f('0x26')](respondWithResult(_0x2ea4c9,null))[_0x171f('0x42')](handleError(_0x2ea4c9,null));};exports[_0x171f('0x4e')]=function(_0x456873,_0x25c30a,_0x515096){return db[_0x171f('0x4f')]['find']({'where':{'id':_0x456873[_0x171f('0x43')]['id']}})[_0x171f('0x26')](handleEntityNotFound(_0x25c30a,null))[_0x171f('0x26')](function(_0x2b44a6){if(_0x2b44a6){return _0x2b44a6[_0x171f('0x4e')](_0x456873[_0x171f('0x4d')]['ids'],_[_0x171f('0x50')](_0x456873['body'],['ids','id'])||{});}})[_0x171f('0x26')](respondWithResult(_0x25c30a,null))['catch'](handleError(_0x25c30a,null));};exports['getContacts']=function(_0x352977,_0xcceec0,_0x14f74b){var _0x33ff4a={};var _0x4ecb64={};var _0x11c330;var _0x350dcf;return db['CmCompany'][_0x171f('0x51')]({'where':{'id':_0x352977[_0x171f('0x43')]['id']}})[_0x171f('0x26')](handleEntityNotFound(_0xcceec0,null))[_0x171f('0x26')](function(_0x7dd1f2){if(_0x7dd1f2){_0x11c330=_0x7dd1f2;_0x4ecb64[_0x171f('0x30')]=_[_0x171f('0x31')](db[_0x171f('0x4f')][_0x171f('0x52')]);_0x4ecb64['query']=_['keys'](_0x352977[_0x171f('0x32')]);_0x4ecb64[_0x171f('0x33')]=_[_0x171f('0x34')](_0x4ecb64[_0x171f('0x30')],_0x4ecb64['query']);_0x33ff4a[_0x171f('0x35')]=_[_0x171f('0x34')](_0x4ecb64['model'],qs[_0x171f('0x36')](_0x352977[_0x171f('0x32')]['fields']));_0x33ff4a[_0x171f('0x35')]=_0x33ff4a[_0x171f('0x35')][_0x171f('0x37')]?_0x33ff4a['attributes']:_0x4ecb64['model'];_0x33ff4a[_0x171f('0x3a')]=qs[_0x171f('0x3b')](_0x352977[_0x171f('0x32')][_0x171f('0x3b')]);_0x33ff4a['where']=qs[_0x171f('0x33')](_[_0x171f('0x53')](_0x352977[_0x171f('0x32')],_0x4ecb64[_0x171f('0x33')]));if(_0x352977[_0x171f('0x32')][_0x171f('0x3c')]){_0x33ff4a[_0x171f('0x3d')]=_[_0x171f('0x3e')](_0x33ff4a[_0x171f('0x3d')],{'$or':_[_0x171f('0x54')](_0x33ff4a[_0x171f('0x35')],function(_0x496bec){var _0x394ea3={};_0x394ea3[_0x496bec]={'$like':'%'+_0x352977[_0x171f('0x32')][_0x171f('0x3c')]+'%'};return _0x394ea3;})});}_0x33ff4a=_[_0x171f('0x3e')]({},_0x33ff4a,_0x352977[_0x171f('0x45')]);return _0x11c330[_0x171f('0x55')](_0x33ff4a);}})[_0x171f('0x26')](function(_0x57e568){if(_0x57e568){_0x350dcf=_0x57e568[_0x171f('0x37')];if(!_0x352977[_0x171f('0x32')][_0x171f('0x38')]('nolimit')){_0x33ff4a['limit']=qs[_0x171f('0x20')](_0x352977['query'][_0x171f('0x20')]);_0x33ff4a[_0x171f('0x1e')]=qs['offset'](_0x352977['query'][_0x171f('0x1e')]);}return _0x11c330[_0x171f('0x55')](_0x33ff4a);}})[_0x171f('0x26')](function(_0x2051a7){if(_0x2051a7){return _0x2051a7?{'count':_0x350dcf,'rows':_0x2051a7}:null;}})[_0x171f('0x26')](respondWithResult(_0xcceec0,null))[_0x171f('0x42')](handleError(_0xcceec0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8db265f..6208480 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 _0x30d2=['./cmCompany.attributes','exports','define','cm_companies','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x30d2,0x90));var _0x230d=function(_0x17a329,_0x5d2f43){_0x17a329=_0x17a329-0x0;var _0x761387=_0x30d2[_0x17a329];return _0x761387;};'use strict';var _=require('lodash');var util=require(_0x230d('0x0'));var logger=require(_0x230d('0x1'))('api');var moment=require(_0x230d('0x2'));var BPromise=require(_0x230d('0x3'));var rp=require(_0x230d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x230d('0x5'));var attributes=require(_0x230d('0x6'));module[_0x230d('0x7')]=function(_0x59391a,_0x5039a6){return _0x59391a[_0x230d('0x8')]('CmCompany',attributes,{'tableName':_0x230d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecf5=['define','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xecf5,0x1b9));var _0x5ecf=function(_0x3e1139,_0x5106a2){_0x3e1139=_0x3e1139-0x0;var _0x26905d=_0xecf5[_0x3e1139];return _0x26905d;};'use strict';var _=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var logger=require(_0x5ecf('0x2'))('api');var moment=require(_0x5ecf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ecf('0x4'));var rimraf=require(_0x5ecf('0x5'));var config=require(_0x5ecf('0x6'));var attributes=require(_0x5ecf('0x7'));module[_0x5ecf('0x8')]=function(_0x5061fe,_0x5bea97){return _0x5061fe[_0x5ecf('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','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 ef1ef7f..c123765 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 _0xe7a3=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x45d776,_0x2c5217){var _0x356cda=function(_0x11677d){while(--_0x11677d){_0x45d776['push'](_0x45d776['shift']());}};_0x356cda(++_0x2c5217);}(_0xe7a3,0xb1));var _0x3e7a=function(_0x170150,_0xeab6a6){_0x170150=_0x170150-0x0;var _0x1e62cf=_0xe7a3[_0x170150];return _0x1e62cf;};'use strict';var _=require(_0x3e7a('0x0'));var util=require(_0x3e7a('0x1'));var moment=require('moment');var BPromise=require(_0x3e7a('0x2'));var rs=require(_0x3e7a('0x3'));var fs=require('fs');var Redis=require(_0x3e7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e7a('0x5'));var logger=require(_0x3e7a('0x6'))('rpc');var config=require(_0x3e7a('0x7'));var jayson=require(_0x3e7a('0x8'));var client=jayson[_0x3e7a('0x9')][_0x3e7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230b68,_0x4a4132,_0x2b080a){return new BPromise(function(_0x512ad5,_0x25212d){return client[_0x3e7a('0xb')](_0x230b68,_0x2b080a)['then'](function(_0x407f56){logger[_0x3e7a('0xc')](_0x3e7a('0xd'),_0x4a4132,_0x3e7a('0xe'));logger['debug'](_0x3e7a('0xf'),_0x4a4132,_0x3e7a('0xe'),JSON[_0x3e7a('0x10')](_0x407f56));if(_0x407f56[_0x3e7a('0x11')]){if(_0x407f56[_0x3e7a('0x11')][_0x3e7a('0x12')]===0x1f4){logger[_0x3e7a('0x11')](_0x3e7a('0xd'),_0x4a4132,_0x407f56['error'][_0x3e7a('0x13')]);return _0x25212d(_0x407f56['error'][_0x3e7a('0x13')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x4a4132,_0x407f56[_0x3e7a('0x11')][_0x3e7a('0x13')]);return _0x512ad5(_0x407f56[_0x3e7a('0x11')][_0x3e7a('0x13')]);}else{logger[_0x3e7a('0xc')](_0x3e7a('0xd'),_0x4a4132,_0x3e7a('0xe'));_0x512ad5(_0x407f56[_0x3e7a('0x14')][_0x3e7a('0x13')]);}})[_0x3e7a('0x15')](function(_0x10135d){logger['error'](_0x3e7a('0xd'),_0x4a4132,_0x10135d);_0x25212d(_0x10135d);});});} \ No newline at end of file +var _0x28e4=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b4b0c,_0x3061f3){var _0x5ceca8=function(_0x7b2639){while(--_0x7b2639){_0x2b4b0c['push'](_0x2b4b0c['shift']());}};_0x5ceca8(++_0x3061f3);}(_0x28e4,0x10d));var _0x428e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28e4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x428e('0x0'));var moment=require(_0x428e('0x1'));var BPromise=require(_0x428e('0x2'));var rs=require(_0x428e('0x3'));var fs=require('fs');var Redis=require(_0x428e('0x4'));var db=require(_0x428e('0x5'))['db'];var utils=require(_0x428e('0x6'));var logger=require(_0x428e('0x7'))(_0x428e('0x8'));var config=require(_0x428e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x428e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52978f,_0x3ddf52,_0x15153c){return new BPromise(function(_0x576f11,_0x3c3d5e){return client[_0x428e('0xb')](_0x52978f,_0x15153c)[_0x428e('0xc')](function(_0x14a2c4){logger[_0x428e('0xd')](_0x428e('0xe'),_0x3ddf52,_0x428e('0xf'));logger[_0x428e('0x10')](_0x428e('0x11'),_0x3ddf52,'request\x20sent',JSON[_0x428e('0x12')](_0x14a2c4));if(_0x14a2c4[_0x428e('0x13')]){if(_0x14a2c4[_0x428e('0x13')]['code']===0x1f4){logger[_0x428e('0x13')](_0x428e('0xe'),_0x3ddf52,_0x14a2c4['error']['message']);return _0x3c3d5e(_0x14a2c4[_0x428e('0x13')][_0x428e('0x14')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x3ddf52,_0x14a2c4[_0x428e('0x13')][_0x428e('0x14')]);return _0x576f11(_0x14a2c4[_0x428e('0x13')][_0x428e('0x14')]);}else{logger[_0x428e('0xd')](_0x428e('0xe'),_0x3ddf52,_0x428e('0xf'));_0x576f11(_0x14a2c4['result'][_0x428e('0x14')]);}})[_0x428e('0x15')](function(_0x528e26){logger[_0x428e('0x13')](_0x428e('0xe'),_0x3ddf52,_0x528e26);_0x3c3d5e(_0x528e26);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 62c0c7f..937c9c2 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 _0xf9b7=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','isAuthenticated','index','describe','show','get','/:id/contacts','getContacts','post','create','addContacts','put','/:id','update','destroy'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf9b7,0x91));var _0x7f9b=function(_0x4a1a67,_0x5e7df3){_0x4a1a67=_0x4a1a67-0x0;var _0x263c3d=_0xf9b7[_0x4a1a67];return _0x263c3d;};'use strict';var multer=require(_0x7f9b('0x0'));var util=require(_0x7f9b('0x1'));var path=require(_0x7f9b('0x2'));var timeout=require(_0x7f9b('0x3'));var express=require(_0x7f9b('0x4'));var router=express[_0x7f9b('0x5')]();var fs_extra=require(_0x7f9b('0x6'));var auth=require(_0x7f9b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f9b('0x8'));router['get']('/',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xa')]);router['get']('/describe',auth[_0x7f9b('0x9')](),controller[_0x7f9b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7f9b('0xc')]);router[_0x7f9b('0xd')](_0x7f9b('0xe'),auth['isAuthenticated'](),controller[_0x7f9b('0xf')]);router[_0x7f9b('0x10')]('/',auth['isAuthenticated'](),controller[_0x7f9b('0x11')]);router['post'](_0x7f9b('0xe'),auth[_0x7f9b('0x9')](),controller[_0x7f9b('0x12')]);router[_0x7f9b('0x13')](_0x7f9b('0x14'),auth['isAuthenticated'](),controller[_0x7f9b('0x15')]);router['delete'](_0x7f9b('0x14'),auth[_0x7f9b('0x9')](),controller[_0x7f9b('0x16')]);module[_0x7f9b('0x17')]=router; \ No newline at end of file +var _0x74c6=['isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x74c6,0x1ae));var _0x674c=function(_0x1b6594,_0x4a2158){_0x1b6594=_0x1b6594-0x0;var _0x9db1f1=_0x74c6[_0x1b6594];return _0x9db1f1;};'use strict';var multer=require(_0x674c('0x0'));var util=require(_0x674c('0x1'));var path=require(_0x674c('0x2'));var timeout=require('connect-timeout');var express=require(_0x674c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x674c('0x4'));var interaction=require(_0x674c('0x5'));var config=require(_0x674c('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0x674c('0x7')](),controller[_0x674c('0x8')]);router[_0x674c('0x9')](_0x674c('0xa'),auth['isAuthenticated'](),controller[_0x674c('0xb')]);router[_0x674c('0x9')](_0x674c('0xc'),auth[_0x674c('0x7')](),controller[_0x674c('0xd')]);router[_0x674c('0x9')](_0x674c('0xe'),auth['isAuthenticated'](),controller[_0x674c('0xf')]);router[_0x674c('0x10')]('/',auth[_0x674c('0x7')](),controller[_0x674c('0x11')]);router['post'](_0x674c('0xe'),auth[_0x674c('0x7')](),controller[_0x674c('0x12')]);router['put'](_0x674c('0xc'),auth[_0x674c('0x7')](),controller[_0x674c('0x13')]);router[_0x674c('0x14')](_0x674c('0xc'),auth[_0x674c('0x7')](),controller[_0x674c('0x15')]);module[_0x674c('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a4bf448..f1879b8 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 _0x120f=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','STRING','TEXT'];(function(_0x4dee14,_0x3d6aba){var _0x4daacb=function(_0x194cb3){while(--_0x194cb3){_0x4dee14['push'](_0x4dee14['shift']());}};_0x4daacb(++_0x3d6aba);}(_0x120f,0x134));var _0xf120=function(_0x1d44b1,_0x227b87){_0x1d44b1=_0x1d44b1-0x0;var _0x112cb6=_0x120f[_0x1d44b1];return _0x112cb6;};'use strict';var _=require(_0xf120('0x0'));var Sequelize=require(_0xf120('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf120('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf120('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf120('0x2')]},'country':{'type':Sequelize[_0xf120('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf120('0x2')]},'description':{'type':Sequelize[_0xf120('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf120('0x2')]},'fax':{'type':Sequelize[_0xf120('0x2')]},'email':{'type':Sequelize[_0xf120('0x2')]},'url':{'type':Sequelize[_0xf120('0x2')]},'facebook':{'type':Sequelize[_0xf120('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf120('0x2')]},'skype':{'type':Sequelize[_0xf120('0x2')]},'teams':{'type':Sequelize[_0xf120('0x2')]},'viber':{'type':Sequelize[_0xf120('0x2')]},'line':{'type':Sequelize[_0xf120('0x2')]},'wechat':{'type':Sequelize[_0xf120('0x2')]},'telegram':{'type':Sequelize[_0xf120('0x2')]},'UserId':{'type':Sequelize[_0xf120('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xf120('0x2')]},'priority':{'type':Sequelize[_0xf120('0x4')](0x2)[_0xf120('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf120('0x6')],'defaultValue':Sequelize[_0xf120('0x7')]},'dialTimezone':{'type':Sequelize[_0xf120('0x2')]},'utcOffset':{'type':Sequelize[_0xf120('0x4')]}}; \ No newline at end of file +var _0xe856=['sequelize','exports','STRING','TEXT','DATE','NOW','INTEGER'];(function(_0x3432ff,_0x3080ca){var _0x38c4ea=function(_0x242e64){while(--_0x242e64){_0x3432ff['push'](_0x3432ff['shift']());}};_0x38c4ea(++_0x3080ca);}(_0xe856,0x1ab));var _0x6e85=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe856[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var Sequelize=require(_0x6e85('0x0'));module[_0x6e85('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6e85('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6e85('0x2')]},'country':{'type':Sequelize[_0x6e85('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6e85('0x2')]},'description':{'type':Sequelize[_0x6e85('0x3')]},'phone':{'type':Sequelize[_0x6e85('0x2')]},'mobile':{'type':Sequelize[_0x6e85('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x6e85('0x2')]},'facebook':{'type':Sequelize[_0x6e85('0x2')]},'fb_data':{'type':Sequelize[_0x6e85('0x2')]},'twitter':{'type':Sequelize[_0x6e85('0x2')]},'skype':{'type':Sequelize[_0x6e85('0x2')]},'teams':{'type':Sequelize[_0x6e85('0x2')]},'viber':{'type':Sequelize[_0x6e85('0x2')]},'line':{'type':Sequelize[_0x6e85('0x2')]},'wechat':{'type':Sequelize[_0x6e85('0x2')]},'telegram':{'type':Sequelize[_0x6e85('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6e85('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6e85('0x4')],'defaultValue':Sequelize[_0x6e85('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x6e85('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 56f5311..e7a1dbd 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(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 d542d40..1b60ffd 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 _0x8bcf=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0x52afb2,_0x108961){var _0x28f94c=function(_0x418276){while(--_0x418276){_0x52afb2['push'](_0x52afb2['shift']());}};_0x28f94c(++_0x108961);}(_0x8bcf,0x1d2));var _0xf8bc=function(_0x22015e,_0x21efb3){_0x22015e=_0x22015e-0x0;var _0x115a2a=_0x8bcf[_0x22015e];return _0x115a2a;};'use strict';var EventEmitter=require(_0xf8bc('0x0'));var CmContact=require(_0xf8bc('0x1'))['db'][_0xf8bc('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf8bc('0x3')](0x0);var events={'afterCreate':_0xf8bc('0x4'),'afterUpdate':'update','afterDestroy':_0xf8bc('0x5')};function emitEvent(_0x17fa48){return function(_0x3b3b53,_0xa519f5,_0xacc7df){CmContactEvents[_0xf8bc('0x6')](_0x17fa48+':'+_0x3b3b53['id'],_0x3b3b53);CmContactEvents[_0xf8bc('0x6')](_0x17fa48,_0x3b3b53);_0xacc7df(null);};}for(var e in events){if(events[_0xf8bc('0x7')](e)){var event=events[e];CmContact[_0xf8bc('0x8')](e,emitEvent(event));}}module[_0xf8bc('0x9')]=CmContactEvents; \ No newline at end of file +var _0xc3a8=['update','remove','emit','hasOwnProperty','hook','exports','events','CmContact','setMaxListeners','save'];(function(_0x5187bb,_0x4c73c5){var _0x385a08=function(_0x13a142){while(--_0x13a142){_0x5187bb['push'](_0x5187bb['shift']());}};_0x385a08(++_0x4c73c5);}(_0xc3a8,0xf6));var _0x8c3a=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0xc3a8[_0x28fbbf];return _0x543af6;};'use strict';var EventEmitter=require(_0x8c3a('0x0'));var CmContact=require('../../mysqldb')['db'][_0x8c3a('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8c3a('0x2')](0x0);var events={'afterCreate':_0x8c3a('0x3'),'afterUpdate':_0x8c3a('0x4'),'afterDestroy':_0x8c3a('0x5')};function emitEvent(_0x535cf7){return function(_0xab4150,_0x1630ba,_0x27801b){CmContactEvents[_0x8c3a('0x6')](_0x535cf7+':'+_0xab4150['id'],_0xab4150);CmContactEvents['emit'](_0x535cf7,_0xab4150);_0x27801b(null);};}for(var e in events){if(events[_0x8c3a('0x7')](e)){var event=events[e];CmContact[_0x8c3a('0x8')](e,emitEvent(event));}}module[_0x8c3a('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 0262a6f..bc4af68 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 _0xca35=['../../config/environment/shared','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','email','FULLTEXT','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','utcOffset','add','minutes','then','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','callbackUniqueid','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','catch','Campaign','timezones','\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','outbound','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','findAll','CmList','get','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x9dfd2a,_0x506da8){var _0x5cd200=function(_0x2b1fa8){while(--_0x2b1fa8){_0x9dfd2a['push'](_0x9dfd2a['shift']());}};_0x5cd200(++_0x506da8);}(_0xca35,0x114));var _0x5ca3=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xca35[_0x575a38];return _0x5a7bdd;};'use strict';var _=require(_0x5ca3('0x0'));var util=require(_0x5ca3('0x1'));var logger=require(_0x5ca3('0x2'))(_0x5ca3('0x3'));var moment=require(_0x5ca3('0x4'));var BPromise=require(_0x5ca3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ca3('0x6'));var rimraf=require('rimraf');var config=require(_0x5ca3('0x7'));var shared=require(_0x5ca3('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x232663,_0x5bed3d){return _0x232663[_0x5ca3('0x9')](_0x5ca3('0xa'),attributes,{'tableName':_0x5ca3('0xb'),'paranoid':!![],'indexes':[{'name':_0x5ca3('0xc'),'fields':[_0x5ca3('0xc')]},{'name':_0x5ca3('0xd'),'fields':['firstName',_0x5ca3('0xe'),_0x5ca3('0xc'),'mobile','fax',_0x5ca3('0xf')],'type':_0x5ca3('0x10')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x5ca3('0x11'),'hooks':{'afterCreate':function(_0x1933da,_0x75a5fa,_0x502c35){var _0x1acdc0=_0x232663[_0x5ca3('0x12')];var _0x16016a=_0x1933da['get']({'plain':!![]});function _0x19f52f(){return function(_0x3ff727){logger[_0x5ca3('0x13')](_0x5ca3('0x14'),_0x5ca3('0x15'),util[_0x5ca3('0x16')](_0x3ff727,{'showHidden':![],'depth':null}));};}function _0x463daf(_0x4f47c3,_0x32e5b4){var _0x4c03a1=_0x32e5b4['scheduledat']?_0x32e5b4[_0x5ca3('0x17')]:moment()[_0x5ca3('0x18')](_0x5ca3('0x19'));return new BPromise(function(_0x13de96,_0x2fa399){if(_[_0x5ca3('0x1a')](_0x32e5b4[_0x5ca3('0x1b')])){_0x13de96({'ret':_0x4c03a1});}else{_0x1acdc0[_0x5ca3('0x1c')][_0x5ca3('0x1d')]({'where':{'id':_0x4f47c3['id']}})['then'](function(_0x1efeca){if(!_['isNil'](_0x1efeca)){var _0x36a4ff=_0x1efeca[_0x5ca3('0x1b')];if(!_[_0x5ca3('0x1a')](_0x36a4ff)){var _0x2b9e42=shared['timezones'];var _0x3510e5=_0x2b9e42[_0x36a4ff];var _0x1269e5=_0x2b9e42[_0x32e5b4['dialTimezone']];if(!_['isNil'](_0x3510e5)&&!_[_0x5ca3('0x1a')](_0x1269e5)){var _0x725035=_0x3510e5[_0x5ca3('0x1e')]-_0x1269e5[_0x5ca3('0x1e')];_0x4c03a1=_0x32e5b4[_0x5ca3('0x17')]?_0x32e5b4[_0x5ca3('0x17')]:moment();var _0x3bf043=moment(_0x4c03a1)[_0x5ca3('0x1f')](_0x725035,_0x5ca3('0x20'));_0x13de96({'ret':_0x3bf043[_0x5ca3('0x18')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x13de96({'ret':_0x4c03a1});}else _0x13de96({'ret':_0x4c03a1});}else{_0x13de96({'ret':_0x4c03a1});}});}});return 0xa;}var _0x592b48=function(_0x12cbc0){return new BPromise(function(_0x765ade,_0x53cc5a){_0x463daf(_0x12cbc0,_0x16016a)[_0x5ca3('0x21')](function(_0x4c8760){_0x16016a[_0x5ca3('0x17')]=_0x4c8760[_0x5ca3('0x22')];_0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x1d')]({'where':{'phone':_0x16016a['phone'],'VoiceQueueId':_0x12cbc0['id']}})[_0x5ca3('0x21')](function(_0x1cddb9){if(!_['isNil'](_0x1cddb9)){throw new Error(_0x5ca3('0x24')+_0x16016a[_0x5ca3('0xc')]+_0x5ca3('0x25')+_0x12cbc0['id']);}return _0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x26')]({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a['ListId'],'priority':_0x16016a['priority']?_0x16016a[_0x5ca3('0x27')]:0x2,'scheduledat':_0x16016a['scheduledat']?_0x16016a[_0x5ca3('0x17')]:moment()['format'](_0x5ca3('0x19')),'callback':_0x16016a[_0x5ca3('0x28')]?!![]:![],'callbackuniqueid':_0x16016a[_0x5ca3('0x28')]?_0x16016a[_0x5ca3('0x28')]:undefined,'callbackat':_0x16016a['callbackUniqueid']?moment()[_0x5ca3('0x18')](_0x5ca3('0x19')):undefined,'VoiceQueueId':_0x12cbc0['id']});})['catch'](function(_0x4d7a3f){_0x53cc5a(_0x4d7a3f);});});});};var _0x4d02df=function(_0x1e6dd3){return new BPromise(function(_0x341036,_0x1cf97f){_0x463daf(_0x1e6dd3,_0x16016a)['then'](function(_0x412cfa){_0x16016a[_0x5ca3('0x17')]=_0x412cfa[_0x5ca3('0x22')];_0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x1d')]({'where':{'phone':_0x16016a[_0x5ca3('0xc')],'VoiceQueueId':_0x1e6dd3['id']}})['then'](function(_0x2a922f){if(!_[_0x5ca3('0x1a')](_0x2a922f)){throw new Error('cmContact,\x20afterCreate\x20'+_0x16016a[_0x5ca3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1e6dd3['id']);}return _0x1acdc0[_0x5ca3('0x29')][_0x5ca3('0x1d')]({'where':{'calleridnum':_0x16016a[_0x5ca3('0xc')],'VoiceQueueId':_0x1e6dd3['id']}});})['then'](function(_0x2a3e29){if(!_[_0x5ca3('0x1a')](_0x2a3e29)){throw new Error(_0x5ca3('0x2a')+_0x16016a['phone']+_0x5ca3('0x2b')+_0x1e6dd3['id']);}return _0x1acdc0[_0x5ca3('0x23')]['create']({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a[_0x5ca3('0x2c')],'priority':_0x16016a['priority']?_0x16016a[_0x5ca3('0x27')]:0x2,'scheduledat':_0x16016a[_0x5ca3('0x17')]?_0x16016a['scheduledat']:moment()['format'](_0x5ca3('0x19')),'callback':_0x16016a[_0x5ca3('0x28')]?!![]:![],'callbackuniqueid':_0x16016a[_0x5ca3('0x28')]?_0x16016a[_0x5ca3('0x28')]:undefined,'callbackat':_0x16016a['callbackUniqueid']?moment()['format'](_0x5ca3('0x19')):undefined,'VoiceQueueId':_0x1e6dd3['id']});})[_0x5ca3('0x2d')](function(_0x1f2573){_0x1cf97f(_0x1f2573);});});});};function _0x463a16(){return function(_0x43ff68){logger['error'](_0x5ca3('0x14'),'afterCreate',util[_0x5ca3('0x16')](_0x43ff68,{'showHidden':![],'depth':null}));};}function _0x523fcb(_0x3463d2,_0x287845){var _0x33716b=_0x287845['scheduledat']?_0x287845[_0x5ca3('0x17')]:moment()[_0x5ca3('0x18')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2558e4,_0x3e6ce8){if(_[_0x5ca3('0x1a')](_0x287845[_0x5ca3('0x1b')])){_0x2558e4({'ret':_0x33716b});}else{_0x1acdc0[_0x5ca3('0x2e')]['findOne']({'where':{'id':_0x3463d2['id']}})[_0x5ca3('0x21')](function(_0x54aeef){if(!_[_0x5ca3('0x1a')](_0x54aeef)){var _0x52c1a7=_0x54aeef[_0x5ca3('0x1b')];if(!_[_0x5ca3('0x1a')](_0x52c1a7)){var _0xabe262=shared[_0x5ca3('0x2f')];var _0x1c94c5=_0xabe262[_0x52c1a7];var _0x1d616c=_0xabe262[_0x287845[_0x5ca3('0x1b')]];if(!_[_0x5ca3('0x1a')](_0x1c94c5)&&!_[_0x5ca3('0x1a')](_0x1d616c)){var _0xe12bd9=_0x1c94c5['utcOffset']-_0x1d616c[_0x5ca3('0x1e')];_0x33716b=_0x287845[_0x5ca3('0x17')]?_0x287845[_0x5ca3('0x17')]:moment();var _0x13cb7b=moment(_0x33716b)[_0x5ca3('0x1f')](_0xe12bd9,'minutes');_0x2558e4({'ret':_0x13cb7b['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2558e4({'ret':_0x33716b});}else _0x2558e4({'ret':_0x33716b});}else{_0x2558e4({'ret':_0x33716b});}});}});return 0xa;}var _0x3a3bc3=function(_0x41389c){return new BPromise(function(_0x465fde,_0x3df394){_0x523fcb(_0x41389c,_0x16016a)[_0x5ca3('0x21')](function(_0x2ee42b){_0x16016a[_0x5ca3('0x17')]=_0x2ee42b[_0x5ca3('0x22')];_0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x1d')]({'where':{'phone':_0x16016a[_0x5ca3('0xc')],'CampaignId':_0x41389c['id']}})['then'](function(_0x43feac){if(!_[_0x5ca3('0x1a')](_0x43feac)){throw new Error(_0x5ca3('0x24')+_0x16016a[_0x5ca3('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x41389c['id']);}return _0x1acdc0[_0x5ca3('0x23')]['create']({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a[_0x5ca3('0x2c')],'priority':_0x16016a['priority']?_0x16016a[_0x5ca3('0x27')]:0x2,'scheduledat':_0x16016a[_0x5ca3('0x17')]?_0x16016a[_0x5ca3('0x17')]:moment()[_0x5ca3('0x18')](_0x5ca3('0x19')),'callback':_0x16016a[_0x5ca3('0x28')]?!![]:![],'callbackuniqueid':_0x16016a['callbackUniqueid']?_0x16016a[_0x5ca3('0x28')]:undefined,'callbackat':_0x16016a['callbackUniqueid']?moment()[_0x5ca3('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x41389c['id']});})['catch'](function(_0x525697){_0x3df394(_0x525697);});});});};var _0xb92656=function(_0x4d5abe){return new BPromise(function(_0x52e570,_0x490f16){_0x523fcb(_0x4d5abe,_0x16016a)[_0x5ca3('0x21')](function(_0x3d6e69){_0x16016a[_0x5ca3('0x17')]=_0x3d6e69[_0x5ca3('0x22')];_0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x1d')]({'where':{'phone':_0x16016a['phone'],'CampaignId':_0x4d5abe['id']}})[_0x5ca3('0x21')](function(_0x4b8c14){if(!_['isNil'](_0x4b8c14)){throw new Error('cmContact,\x20afterCreate\x20'+_0x16016a[_0x5ca3('0xc')]+_0x5ca3('0x30')+_0x4d5abe['id']);}return _0x1acdc0[_0x5ca3('0x29')][_0x5ca3('0x1d')]({'where':{'calleridnum':_0x16016a[_0x5ca3('0xc')],'CampaignId':_0x4d5abe['id']}});})['then'](function(_0x59d58b){if(!_[_0x5ca3('0x1a')](_0x59d58b)){throw new Error(_0x5ca3('0x2a')+_0x16016a[_0x5ca3('0xc')]+_0x5ca3('0x31')+_0x4d5abe['id']);}return _0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x26')]({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a['ListId'],'priority':_0x16016a[_0x5ca3('0x27')]?_0x16016a[_0x5ca3('0x27')]:0x2,'scheduledat':_0x16016a[_0x5ca3('0x17')]?_0x16016a[_0x5ca3('0x17')]:moment()[_0x5ca3('0x18')](_0x5ca3('0x19')),'callback':_0x16016a[_0x5ca3('0x28')]?!![]:![],'callbackuniqueid':_0x16016a[_0x5ca3('0x28')]?_0x16016a[_0x5ca3('0x28')]:undefined,'callbackat':_0x16016a[_0x5ca3('0x28')]?moment()[_0x5ca3('0x18')](_0x5ca3('0x19')):undefined,'CampaignId':_0x4d5abe['id']});})['catch'](function(_0x22a6c7){_0x490f16(_0x22a6c7);});});});};if(_0x16016a['ListId']){_0x1acdc0[_0x5ca3('0x1c')]['findAll']({'where':{'type':_0x5ca3('0x32')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x1acdc0['CmList'],'as':_0x5ca3('0x33'),'where':{'id':_0x16016a[_0x5ca3('0x2c')]}}]})['then'](function(_0x3f2746){if(_0x3f2746){var _0x1bc876=[];for(var _0x2f3683=0x0,_0xc4c6bc;_0x2f3683<_0x3f2746[_0x5ca3('0x34')];_0x2f3683+=0x1){_0xc4c6bc=_0x3f2746[_0x2f3683]['get']({'plain':!![]});switch(_0xc4c6bc[_0x5ca3('0x35')]){case _0x5ca3('0x36'):_0x4d02df(_0xc4c6bc)['catch'](_0x19f52f());break;case _0x5ca3('0x37'):_0x592b48(_0xc4c6bc)[_0x5ca3('0x2d')](_0x19f52f());break;default:_0x523fcb(_0xc4c6bc,_0x16016a)['then'](function(_0x364534){_0x16016a[_0x5ca3('0x17')]=_0x364534[_0x5ca3('0x22')];_0x1acdc0[_0x5ca3('0x23')][_0x5ca3('0x26')]({'phone':_0x16016a['phone'],'ContactId':_0x16016a['id'],'ListId':_0x16016a['ListId'],'scheduledat':_0x16016a[_0x5ca3('0x17')]?_0x16016a[_0x5ca3('0x17')]:moment()[_0x5ca3('0x18')](_0x5ca3('0x19')),'priority':_0x16016a['priority']?_0x16016a['priority']:0x2,'callback':_0x16016a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x16016a[_0x5ca3('0x28')]?_0x16016a[_0x5ca3('0x28')]:undefined,'callbackat':_0x16016a['callbackUniqueid']?moment()[_0x5ca3('0x18')](_0x5ca3('0x19')):undefined,'VoiceQueueId':_0xc4c6bc['id']})['catch'](_0x19f52f());});}}}})[_0x5ca3('0x21')](function(){return _0x1acdc0[_0x5ca3('0x1c')][_0x5ca3('0x38')]({'where':{'type':_0x5ca3('0x32')},'attributes':['id'],'include':[{'model':_0x1acdc0[_0x5ca3('0x39')],'as':'BlackLists','where':{'id':_0x16016a[_0x5ca3('0x2c')]}}]})[_0x5ca3('0x21')](function(_0xe0fe44){if(_0xe0fe44){var _0x368e90=[];for(var _0x370163=0x0,_0x3d4613;_0x370163<_0xe0fe44[_0x5ca3('0x34')];_0x370163+=0x1){_0x3d4613=_0xe0fe44[_0x370163][_0x5ca3('0x3a')]({'plain':!![]});_0x1acdc0[_0x5ca3('0x3b')][_0x5ca3('0x26')]({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a[_0x5ca3('0x2c')],'VoiceQueueId':_0x3d4613['id']})[_0x5ca3('0x2d')](function(_0x5d8e33){logger['error']('cmContact,\x20%s,\x20%s',_0x5ca3('0x15'),_0x5d8e33[_0x5ca3('0x3c')]);});}}});})['then'](function(){return _0x1acdc0['Campaign'][_0x5ca3('0x38')]({'attributes':['id',_0x5ca3('0x35'),_0x5ca3('0x1b')],'include':[{'model':_0x1acdc0[_0x5ca3('0x39')],'as':'Lists','where':{'id':_0x16016a[_0x5ca3('0x2c')]}}]})[_0x5ca3('0x21')](function(_0x36b27d){if(_0x36b27d){var _0x526b4f=[];for(var _0x4a5523=0x0,_0x49cf07;_0x4a5523<_0x36b27d[_0x5ca3('0x34')];_0x4a5523+=0x1){_0x49cf07=_0x36b27d[_0x4a5523]['get']({'plain':!![]});switch(_0x49cf07[_0x5ca3('0x35')]){case _0x5ca3('0x36'):_0xb92656(_0x49cf07)[_0x5ca3('0x2d')](_0x463a16());break;case _0x5ca3('0x37'):_0x3a3bc3(_0x49cf07)[_0x5ca3('0x2d')](_0x463a16());break;default:_0x1acdc0[_0x5ca3('0x23')]['create']({'phone':_0x16016a[_0x5ca3('0xc')],'ContactId':_0x16016a['id'],'ListId':_0x16016a[_0x5ca3('0x2c')],'scheduledat':_0x16016a['scheduledat']?_0x16016a[_0x5ca3('0x17')]:moment()['format'](_0x5ca3('0x19')),'priority':_0x16016a[_0x5ca3('0x27')]?_0x16016a[_0x5ca3('0x27')]:0x2,'callback':_0x16016a[_0x5ca3('0x28')]?!![]:![],'callbackuniqueid':_0x16016a[_0x5ca3('0x28')]?_0x16016a['callbackUniqueid']:undefined,'callbackat':_0x16016a['callbackUniqueid']?moment()[_0x5ca3('0x18')](_0x5ca3('0x19')):undefined,'CampaignId':_0x49cf07['id']})[_0x5ca3('0x2d')](_0x463a16());}}}});})[_0x5ca3('0x21')](function(){return _0x1acdc0[_0x5ca3('0x2e')][_0x5ca3('0x38')]({'attributes':['id'],'include':[{'model':_0x1acdc0[_0x5ca3('0x39')],'as':'BlackLists','where':{'id':_0x16016a[_0x5ca3('0x2c')]}}]})[_0x5ca3('0x21')](function(_0x1acd17){if(_0x1acd17){var _0x5b5307=[];for(var _0x2d9f68=0x0,_0x260090;_0x2d9f68<_0x1acd17[_0x5ca3('0x34')];_0x2d9f68+=0x1){_0x260090=_0x1acd17[_0x2d9f68][_0x5ca3('0x3a')]({'plain':!![]});_0x1acdc0[_0x5ca3('0x3b')][_0x5ca3('0x26')]({'phone':_0x16016a['phone'],'ContactId':_0x16016a['id'],'ListId':_0x16016a[_0x5ca3('0x2c')],'CampaignId':_0x260090['id']})[_0x5ca3('0x2d')](function(_0x41a140){logger[_0x5ca3('0x13')]('cmContact,\x20%s,\x20%s','afterCreate',_0x41a140[_0x5ca3('0x3c')]);});}}});})[_0x5ca3('0x21')](function(){_0x502c35();})[_0x5ca3('0x2d')](function(_0x435921){logger[_0x5ca3('0x13')](_0x5ca3('0x3d'),_0x5ca3('0x15'),_0x435921['message']);_0x502c35(_0x435921);});}else{_0x502c35(new Error(_0x5ca3('0x3e')));}},'afterDestroy':function(_0x1da58f,_0x4e00ff,_0x5a004d){var _0x5e9126=_0x232663['models'];var _0x105d17=_0x1da58f['get']({'plain':!![]});return _0x5e9126[_0x5ca3('0x23')]['findAll']({'raw':!![],'where':{'ListId':_0x105d17[_0x5ca3('0x2c')],'ContactId':_0x105d17['id']}})[_0x5ca3('0x21')](function(_0x185840){if(!_[_0x5ca3('0x3f')](_0x185840)){var _0x13d7d3=[];for(var _0x11320b=0x0;_0x11320b<_0x185840[_0x5ca3('0x34')];_0x11320b+=0x1){var _0x38240d=_0x5e9126[_0x5ca3('0x23')][_0x5ca3('0x40')]({'where':{'ListId':_0x185840[_0x11320b][_0x5ca3('0x2c')],'ContactId':_0x185840[_0x11320b][_0x5ca3('0x41')],'VoiceQueueId':_0x185840[_0x11320b][_0x5ca3('0x42')],'CampaignId':_0x185840[_0x11320b][_0x5ca3('0x43')]}});_0x13d7d3[_0x5ca3('0x44')](_0x38240d);}return BPromise['all'](_0x13d7d3);}})[_0x5ca3('0x21')](function(_0x4339a6){logger[_0x5ca3('0x45')]('[CmContact][afterDestroy][Succesfull]',util[_0x5ca3('0x16')](_0x4339a6,{'showHidden':![],'depth':null}));_0x5a004d();})[_0x5ca3('0x2d')](function(_0x182507){logger[_0x5ca3('0x13')](_0x5ca3('0x46'),util[_0x5ca3('0x16')](_0x182507,{'showHidden':![],'depth':null}));_0x5a004d(_0x182507);});}}});}; \ No newline at end of file +var _0xff33=['always','onlyIfOpen','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','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','timezones','\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','Lists','length','dialCheckDuplicateType'];(function(_0x59e956,_0xdabc4c){var _0x4b1f9b=function(_0x1a3e86){while(--_0x1a3e86){_0x59e956['push'](_0x59e956['shift']());}};_0x4b1f9b(++_0xdabc4c);}(_0xff33,0xa7));var _0x3ff3=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xff33[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require(_0x3ff3('0x0'));var util=require(_0x3ff3('0x1'));var logger=require('../../config/logger')(_0x3ff3('0x2'));var moment=require(_0x3ff3('0x3'));var BPromise=require(_0x3ff3('0x4'));var rp=require(_0x3ff3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ff3('0x6'));var config=require(_0x3ff3('0x7'));var shared=require(_0x3ff3('0x8'));var attributes=require(_0x3ff3('0x9'));module[_0x3ff3('0xa')]=function(_0x1296b9,_0x56a770){return _0x1296b9['define'](_0x3ff3('0xb'),attributes,{'tableName':_0x3ff3('0xc'),'paranoid':!![],'indexes':[{'name':_0x3ff3('0xd'),'fields':[_0x3ff3('0xd')]},{'name':_0x3ff3('0xe'),'fields':[_0x3ff3('0xf'),_0x3ff3('0x10'),'phone',_0x3ff3('0x11'),_0x3ff3('0x12'),_0x3ff3('0x13')],'type':_0x3ff3('0x14')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x3ff3('0x15'),'hooks':{'afterCreate':function(_0x3f5fb6,_0x5a780a,_0x224c1b){var _0x58f1c7=_0x1296b9[_0x3ff3('0x16')];var _0x215a7f=_0x3f5fb6[_0x3ff3('0x17')]({'plain':!![]});function _0x4a883c(){return function(_0x19d7e3){logger[_0x3ff3('0x18')](_0x3ff3('0x19'),_0x3ff3('0x1a'),util[_0x3ff3('0x1b')](_0x19d7e3,{'showHidden':![],'depth':null}));};}function _0x5a95a7(_0x21f3cd,_0x30913d){var _0x396e40=_0x30913d['scheduledat']?_0x30913d[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e'));return new BPromise(function(_0x55588c,_0x398f09){if(_[_0x3ff3('0x1f')](_0x30913d[_0x3ff3('0x20')])){_0x55588c({'ret':_0x396e40});}else{_0x58f1c7[_0x3ff3('0x21')][_0x3ff3('0x22')]({'where':{'id':_0x21f3cd['id']}})[_0x3ff3('0x23')](function(_0x1e4fb8){if(!_[_0x3ff3('0x1f')](_0x1e4fb8)){var _0x109fc9=_0x1e4fb8[_0x3ff3('0x20')];if(!_['isNil'](_0x109fc9)){var _0x527fd7=shared['timezones'];var _0x586781=_0x527fd7[_0x109fc9];var _0x1cebc0=_0x527fd7[_0x30913d['dialTimezone']];if(!_['isNil'](_0x586781)&&!_['isNil'](_0x1cebc0)){var _0x98cdfa=_0x586781[_0x3ff3('0x24')]-_0x1cebc0[_0x3ff3('0x24')];_0x396e40=_0x30913d[_0x3ff3('0x1c')]?_0x30913d['scheduledat']:moment();var _0x44dd28=moment(_0x396e40)[_0x3ff3('0x25')](_0x98cdfa,_0x3ff3('0x26'));_0x55588c({'ret':_0x44dd28[_0x3ff3('0x1d')](_0x3ff3('0x1e'))});}else _0x55588c({'ret':_0x396e40});}else _0x55588c({'ret':_0x396e40});}else{_0x55588c({'ret':_0x396e40});}});}});return 0xa;}var _0x256498=function(_0x4bb83a){return new BPromise(function(_0x128d59,_0x69431){_0x5a95a7(_0x4bb83a,_0x215a7f)[_0x3ff3('0x23')](function(_0x24345d){_0x215a7f[_0x3ff3('0x1c')]=_0x24345d[_0x3ff3('0x27')];_0x58f1c7[_0x3ff3('0x28')]['findOne']({'where':{'phone':_0x215a7f[_0x3ff3('0xd')],'VoiceQueueId':_0x4bb83a['id']}})[_0x3ff3('0x23')](function(_0x573b5a){if(!_[_0x3ff3('0x1f')](_0x573b5a)){throw new Error(_0x3ff3('0x29')+_0x215a7f['phone']+_0x3ff3('0x2a')+_0x4bb83a['id']);}return _0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'priority':_0x215a7f[_0x3ff3('0x2d')]?_0x215a7f[_0x3ff3('0x2d')]:0x2,'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')),'callback':_0x215a7f[_0x3ff3('0x2e')]?!![]:![],'callbackuniqueid':_0x215a7f['callbackUniqueid']?_0x215a7f[_0x3ff3('0x2e')]:undefined,'callbackat':_0x215a7f[_0x3ff3('0x2e')]?moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')):undefined,'VoiceQueueId':_0x4bb83a['id']});})[_0x3ff3('0x2f')](function(_0x4ee5c2){_0x69431(_0x4ee5c2);});});});};var _0x3a7e80=function(_0x239909){return new BPromise(function(_0x5c4f37,_0x5e11c5){_0x5a95a7(_0x239909,_0x215a7f)[_0x3ff3('0x23')](function(_0x44c68d){_0x215a7f[_0x3ff3('0x1c')]=_0x44c68d[_0x3ff3('0x27')];_0x58f1c7[_0x3ff3('0x28')]['findOne']({'where':{'phone':_0x215a7f[_0x3ff3('0xd')],'VoiceQueueId':_0x239909['id']}})['then'](function(_0x34818c){if(!_[_0x3ff3('0x1f')](_0x34818c)){throw new Error(_0x3ff3('0x29')+_0x215a7f[_0x3ff3('0xd')]+_0x3ff3('0x30')+_0x239909['id']);}return _0x58f1c7[_0x3ff3('0x31')][_0x3ff3('0x22')]({'where':{'calleridnum':_0x215a7f[_0x3ff3('0xd')],'VoiceQueueId':_0x239909['id']}});})[_0x3ff3('0x23')](function(_0x5aab78){if(!_[_0x3ff3('0x1f')](_0x5aab78)){throw new Error(_0x3ff3('0x32')+_0x215a7f[_0x3ff3('0xd')]+_0x3ff3('0x33')+_0x239909['id']);}return _0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'priority':_0x215a7f[_0x3ff3('0x2d')]?_0x215a7f['priority']:0x2,'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')),'callback':_0x215a7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x215a7f[_0x3ff3('0x2e')]?_0x215a7f[_0x3ff3('0x2e')]:undefined,'callbackat':_0x215a7f[_0x3ff3('0x2e')]?moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')):undefined,'VoiceQueueId':_0x239909['id']});})[_0x3ff3('0x2f')](function(_0x3aae1f){_0x5e11c5(_0x3aae1f);});});});};function _0x321e2c(){return function(_0x1da86e){logger[_0x3ff3('0x18')](_0x3ff3('0x19'),_0x3ff3('0x1a'),util[_0x3ff3('0x1b')](_0x1da86e,{'showHidden':![],'depth':null}));};}function _0xd65b06(_0x7fa92c,_0x29b600){var _0x3d031b=_0x29b600['scheduledat']?_0x29b600['scheduledat']:moment()['format'](_0x3ff3('0x1e'));return new BPromise(function(_0x94a9c5,_0x417ef9){if(_[_0x3ff3('0x1f')](_0x29b600[_0x3ff3('0x20')])){_0x94a9c5({'ret':_0x3d031b});}else{_0x58f1c7[_0x3ff3('0x34')]['findOne']({'where':{'id':_0x7fa92c['id']}})[_0x3ff3('0x23')](function(_0x78fdd3){if(!_[_0x3ff3('0x1f')](_0x78fdd3)){var _0x42b65c=_0x78fdd3['dialTimezone'];if(!_[_0x3ff3('0x1f')](_0x42b65c)){var _0x531020=shared[_0x3ff3('0x35')];var _0x364ddd=_0x531020[_0x42b65c];var _0x5ea885=_0x531020[_0x29b600[_0x3ff3('0x20')]];if(!_['isNil'](_0x364ddd)&&!_['isNil'](_0x5ea885)){var _0x30f6f7=_0x364ddd[_0x3ff3('0x24')]-_0x5ea885['utcOffset'];_0x3d031b=_0x29b600[_0x3ff3('0x1c')]?_0x29b600[_0x3ff3('0x1c')]:moment();var _0x31e648=moment(_0x3d031b)[_0x3ff3('0x25')](_0x30f6f7,_0x3ff3('0x26'));_0x94a9c5({'ret':_0x31e648[_0x3ff3('0x1d')](_0x3ff3('0x1e'))});}else _0x94a9c5({'ret':_0x3d031b});}else _0x94a9c5({'ret':_0x3d031b});}else{_0x94a9c5({'ret':_0x3d031b});}});}});return 0xa;}var _0x3eecf2=function(_0x30c6d7){return new BPromise(function(_0x2ea6ff,_0x55f019){_0xd65b06(_0x30c6d7,_0x215a7f)[_0x3ff3('0x23')](function(_0x384503){_0x215a7f[_0x3ff3('0x1c')]=_0x384503[_0x3ff3('0x27')];_0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x22')]({'where':{'phone':_0x215a7f[_0x3ff3('0xd')],'CampaignId':_0x30c6d7['id']}})[_0x3ff3('0x23')](function(_0x3abd6d){if(!_['isNil'](_0x3abd6d)){throw new Error(_0x3ff3('0x29')+_0x215a7f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x30c6d7['id']);}return _0x58f1c7['CmHopper'][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'priority':_0x215a7f[_0x3ff3('0x2d')]?_0x215a7f[_0x3ff3('0x2d')]:0x2,'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')),'callback':_0x215a7f[_0x3ff3('0x2e')]?!![]:![],'callbackuniqueid':_0x215a7f[_0x3ff3('0x2e')]?_0x215a7f['callbackUniqueid']:undefined,'callbackat':_0x215a7f[_0x3ff3('0x2e')]?moment()['format'](_0x3ff3('0x1e')):undefined,'CampaignId':_0x30c6d7['id']});})[_0x3ff3('0x2f')](function(_0x502b66){_0x55f019(_0x502b66);});});});};var _0x50b560=function(_0x3bb096){return new BPromise(function(_0x2fd170,_0xe73f9b){_0xd65b06(_0x3bb096,_0x215a7f)[_0x3ff3('0x23')](function(_0x414eb8){_0x215a7f[_0x3ff3('0x1c')]=_0x414eb8[_0x3ff3('0x27')];_0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x22')]({'where':{'phone':_0x215a7f[_0x3ff3('0xd')],'CampaignId':_0x3bb096['id']}})[_0x3ff3('0x23')](function(_0x204767){if(!_[_0x3ff3('0x1f')](_0x204767)){throw new Error(_0x3ff3('0x29')+_0x215a7f[_0x3ff3('0xd')]+_0x3ff3('0x36')+_0x3bb096['id']);}return _0x58f1c7['CmHopperFinal'][_0x3ff3('0x22')]({'where':{'calleridnum':_0x215a7f['phone'],'CampaignId':_0x3bb096['id']}});})[_0x3ff3('0x23')](function(_0x48c24b){if(!_[_0x3ff3('0x1f')](_0x48c24b)){throw new Error(_0x3ff3('0x32')+_0x215a7f[_0x3ff3('0xd')]+_0x3ff3('0x37')+_0x3bb096['id']);}return _0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f['ListId'],'priority':_0x215a7f[_0x3ff3('0x2d')]?_0x215a7f[_0x3ff3('0x2d')]:0x2,'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')),'callback':_0x215a7f[_0x3ff3('0x2e')]?!![]:![],'callbackuniqueid':_0x215a7f[_0x3ff3('0x2e')]?_0x215a7f[_0x3ff3('0x2e')]:undefined,'callbackat':_0x215a7f[_0x3ff3('0x2e')]?moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')):undefined,'CampaignId':_0x3bb096['id']});})[_0x3ff3('0x2f')](function(_0x1b9521){_0xe73f9b(_0x1b9521);});});});};if(_0x215a7f[_0x3ff3('0x2c')]){_0x58f1c7[_0x3ff3('0x21')][_0x3ff3('0x38')]({'where':{'type':_0x3ff3('0x39')},'attributes':['id','dialCheckDuplicateType',_0x3ff3('0x20')],'include':[{'model':_0x58f1c7['CmList'],'as':_0x3ff3('0x3a'),'where':{'id':_0x215a7f['ListId']}}]})[_0x3ff3('0x23')](function(_0x3d6096){if(_0x3d6096){var _0x4914e7=[];for(var _0x898b9e=0x0,_0x59ce4f;_0x898b9e<_0x3d6096[_0x3ff3('0x3b')];_0x898b9e+=0x1){_0x59ce4f=_0x3d6096[_0x898b9e][_0x3ff3('0x17')]({'plain':!![]});switch(_0x59ce4f[_0x3ff3('0x3c')]){case _0x3ff3('0x3d'):_0x3a7e80(_0x59ce4f)[_0x3ff3('0x2f')](_0x4a883c());break;case _0x3ff3('0x3e'):_0x256498(_0x59ce4f)[_0x3ff3('0x2f')](_0x4a883c());break;default:_0xd65b06(_0x59ce4f,_0x215a7f)[_0x3ff3('0x23')](function(_0xb656a2){_0x215a7f[_0x3ff3('0x1c')]=_0xb656a2[_0x3ff3('0x27')];_0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f['scheduledat']:moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')),'priority':_0x215a7f[_0x3ff3('0x2d')]?_0x215a7f['priority']:0x2,'callback':_0x215a7f[_0x3ff3('0x2e')]?!![]:![],'callbackuniqueid':_0x215a7f['callbackUniqueid']?_0x215a7f[_0x3ff3('0x2e')]:undefined,'callbackat':_0x215a7f[_0x3ff3('0x2e')]?moment()[_0x3ff3('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x59ce4f['id']})[_0x3ff3('0x2f')](_0x4a883c());});}}}})[_0x3ff3('0x23')](function(){return _0x58f1c7[_0x3ff3('0x21')]['findAll']({'where':{'type':_0x3ff3('0x39')},'attributes':['id'],'include':[{'model':_0x58f1c7[_0x3ff3('0x3f')],'as':_0x3ff3('0x40'),'where':{'id':_0x215a7f[_0x3ff3('0x2c')]}}]})[_0x3ff3('0x23')](function(_0x2c8c0c){if(_0x2c8c0c){var _0x42b752=[];for(var _0x15c924=0x0,_0x52ea1f;_0x15c924<_0x2c8c0c[_0x3ff3('0x3b')];_0x15c924+=0x1){_0x52ea1f=_0x2c8c0c[_0x15c924][_0x3ff3('0x17')]({'plain':!![]});_0x58f1c7[_0x3ff3('0x41')]['create']({'phone':_0x215a7f['phone'],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'VoiceQueueId':_0x52ea1f['id']})[_0x3ff3('0x2f')](function(_0x7cf8e){logger['error'](_0x3ff3('0x42'),_0x3ff3('0x1a'),_0x7cf8e[_0x3ff3('0x43')]);});}}});})[_0x3ff3('0x23')](function(){return _0x58f1c7[_0x3ff3('0x34')][_0x3ff3('0x38')]({'attributes':['id','dialCheckDuplicateType',_0x3ff3('0x20')],'include':[{'model':_0x58f1c7[_0x3ff3('0x3f')],'as':_0x3ff3('0x3a'),'where':{'id':_0x215a7f[_0x3ff3('0x2c')]}}]})[_0x3ff3('0x23')](function(_0x59171b){if(_0x59171b){var _0x458f5a=[];for(var _0x4ff4ea=0x0,_0x925f6;_0x4ff4ea<_0x59171b['length'];_0x4ff4ea+=0x1){_0x925f6=_0x59171b[_0x4ff4ea][_0x3ff3('0x17')]({'plain':!![]});switch(_0x925f6[_0x3ff3('0x3c')]){case _0x3ff3('0x3d'):_0x50b560(_0x925f6)['catch'](_0x321e2c());break;case _0x3ff3('0x3e'):_0x3eecf2(_0x925f6)[_0x3ff3('0x2f')](_0x321e2c());break;default:_0x58f1c7[_0x3ff3('0x28')][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'scheduledat':_0x215a7f[_0x3ff3('0x1c')]?_0x215a7f[_0x3ff3('0x1c')]:moment()[_0x3ff3('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x215a7f['priority']?_0x215a7f[_0x3ff3('0x2d')]:0x2,'callback':_0x215a7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x215a7f[_0x3ff3('0x2e')]?_0x215a7f[_0x3ff3('0x2e')]:undefined,'callbackat':_0x215a7f['callbackUniqueid']?moment()[_0x3ff3('0x1d')](_0x3ff3('0x1e')):undefined,'CampaignId':_0x925f6['id']})[_0x3ff3('0x2f')](_0x321e2c());}}}});})[_0x3ff3('0x23')](function(){return _0x58f1c7[_0x3ff3('0x34')][_0x3ff3('0x38')]({'attributes':['id'],'include':[{'model':_0x58f1c7[_0x3ff3('0x3f')],'as':_0x3ff3('0x40'),'where':{'id':_0x215a7f['ListId']}}]})['then'](function(_0xf0e9cd){if(_0xf0e9cd){var _0x314afb=[];for(var _0x360302=0x0,_0x222f2f;_0x360302<_0xf0e9cd[_0x3ff3('0x3b')];_0x360302+=0x1){_0x222f2f=_0xf0e9cd[_0x360302][_0x3ff3('0x17')]({'plain':!![]});_0x58f1c7['CmHopperBlack'][_0x3ff3('0x2b')]({'phone':_0x215a7f[_0x3ff3('0xd')],'ContactId':_0x215a7f['id'],'ListId':_0x215a7f[_0x3ff3('0x2c')],'CampaignId':_0x222f2f['id']})[_0x3ff3('0x2f')](function(_0x5e3d74){logger[_0x3ff3('0x18')]('cmContact,\x20%s,\x20%s',_0x3ff3('0x1a'),_0x5e3d74[_0x3ff3('0x43')]);});}}});})[_0x3ff3('0x23')](function(){_0x224c1b();})[_0x3ff3('0x2f')](function(_0x3d4702){logger['error']('cmContact,\x20%s,\x20%s',_0x3ff3('0x1a'),_0x3d4702['message']);_0x224c1b(_0x3d4702);});}else{_0x224c1b(new Error(_0x3ff3('0x44')));}},'afterDestroy':function(_0x378b1a,_0x1eb0e2,_0x490a9e){var _0x333a27=_0x1296b9[_0x3ff3('0x16')];var _0x3b5e64=_0x378b1a['get']({'plain':!![]});return _0x333a27['CmHopper'][_0x3ff3('0x38')]({'raw':!![],'where':{'ListId':_0x3b5e64[_0x3ff3('0x2c')],'ContactId':_0x3b5e64['id']}})[_0x3ff3('0x23')](function(_0x59503c){if(!_[_0x3ff3('0x45')](_0x59503c)){var _0x41f225=[];for(var _0x30d170=0x0;_0x30d170<_0x59503c[_0x3ff3('0x3b')];_0x30d170+=0x1){var _0x27921c=_0x333a27[_0x3ff3('0x28')]['destroy']({'where':{'ListId':_0x59503c[_0x30d170]['ListId'],'ContactId':_0x59503c[_0x30d170][_0x3ff3('0x46')],'VoiceQueueId':_0x59503c[_0x30d170][_0x3ff3('0x47')],'CampaignId':_0x59503c[_0x30d170][_0x3ff3('0x48')]}});_0x41f225[_0x3ff3('0x49')](_0x27921c);}return BPromise['all'](_0x41f225);}})[_0x3ff3('0x23')](function(_0x59e8c7){logger['info'](_0x3ff3('0x4a'),util[_0x3ff3('0x1b')](_0x59e8c7,{'showHidden':![],'depth':null}));_0x490a9e();})[_0x3ff3('0x2f')](function(_0x4b95c7){logger[_0x3ff3('0x18')](_0x3ff3('0x4b'),util[_0x3ff3('0x1b')](_0x4b95c7,{'showHidden':![],'depth':null}));_0x490a9e(_0x4b95c7);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 752a8f2..02a35ea 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(_0x38dffd,_0x5b760e){var _0x45cf26=function(_0x58485e){while(--_0x58485e){_0x38dffd['push'](_0x38dffd['shift']());}};_0x45cf26(++_0x5b760e);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x5e5e1b,_0x39fd4b){var _0x25f625=function(_0x4946c4){while(--_0x4946c4){_0x5e5e1b['push'](_0x5e5e1b['shift']());}};_0x25f625(++_0x39fd4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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 cc7d927..c720e73 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 _0xd6ce=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x3c8bca,_0xcec1b8){var _0x517e5f=function(_0x5d3170){while(--_0x5d3170){_0x3c8bca['push'](_0x3c8bca['shift']());}};_0x517e5f(++_0xcec1b8);}(_0xd6ce,0x127));var _0xed6c=function(_0x3ea901,_0x4f19d0){_0x3ea901=_0x3ea901-0x0;var _0x417085=_0xd6ce[_0x3ea901];return _0x417085;};'use strict';var Sequelize=require(_0xed6c('0x0'));module[_0xed6c('0x1')]={'CmContactId':{'type':Sequelize[_0xed6c('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xed6c('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xed6c('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xed6c('0x3')],'defaultValue':_0xed6c('0x4')},'OrderBy':{'type':Sequelize[_0xed6c('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0xc718=['STRING','PHONE','sequelize','INTEGER'];(function(_0x29eeec,_0x337c09){var _0x2cf46e=function(_0x491b79){while(--_0x491b79){_0x29eeec['push'](_0x29eeec['shift']());}};_0x2cf46e(++_0x337c09);}(_0xc718,0xb6));var _0x8c71=function(_0xcb2404,_0x390c79){_0xcb2404=_0xcb2404-0x0;var _0x219adb=_0xc718[_0xcb2404];return _0x219adb;};'use strict';var Sequelize=require(_0x8c71('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x8c71('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x8c71('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x8c71('0x2')],'defaultValue':_0x8c71('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'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 f907a15..34a28a9 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 _0xfb91=['include','CmContactHasItem','findAll','rows','catch','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','stack','name','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','includeAll'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb91,0xf8));var _0x1fb9=function(_0x1cd4e0,_0x38e794){_0x1cd4e0=_0x1cd4e0-0x0;var _0x509b43=_0xfb91[_0x1cd4e0];return _0x509b43;};'use strict';var emlformat=require(_0x1fb9('0x0'));var rimraf=require(_0x1fb9('0x1'));var zipdir=require(_0x1fb9('0x2'));var jsonpatch=require(_0x1fb9('0x3'));var rp=require(_0x1fb9('0x4'));var moment=require(_0x1fb9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1fb9('0x6'));var util=require(_0x1fb9('0x7'));var path=require(_0x1fb9('0x8'));var sox=require(_0x1fb9('0x9'));var csv=require(_0x1fb9('0xa'));var ejs=require(_0x1fb9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fb9('0xc'));var squel=require(_0x1fb9('0xd'));var crypto=require(_0x1fb9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fb9('0xf'));var toCsv=require(_0x1fb9('0xa'));var querystring=require('querystring');var Papa=require(_0x1fb9('0x10'));var Redis=require(_0x1fb9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1fb9('0x12'));var hardwareService=require(_0x1fb9('0x13'));var logger=require(_0x1fb9('0x14'))(_0x1fb9('0x15'));var utils=require('../../config/utils');var config=require(_0x1fb9('0x16'));var licenseUtil=require(_0x1fb9('0x17'));var db=require(_0x1fb9('0x18'))['db'];function respondWithStatusCode(_0x4d204e,_0x1da0dc){_0x1da0dc=_0x1da0dc||0xcc;return function(_0x2bb476){if(_0x2bb476){return _0x4d204e[_0x1fb9('0x19')](_0x1da0dc);}return _0x4d204e[_0x1fb9('0x1a')](_0x1da0dc)[_0x1fb9('0x1b')]();};}function respondWithResult(_0x219915,_0x456489){_0x456489=_0x456489||0xc8;return function(_0x1c0674){if(_0x1c0674){return _0x219915[_0x1fb9('0x1a')](_0x456489)['json'](_0x1c0674);}};}function respondWithFilteredResult(_0x252259,_0x37db46){return function(_0x2eb445){if(_0x2eb445){var _0x212657=typeof _0x37db46[_0x1fb9('0x1c')]===_0x1fb9('0x1d')&&typeof _0x37db46['limit']===_0x1fb9('0x1d');var _0x164da8=_0x2eb445['count'];var _0x1d4f0a=_0x212657?0x0:_0x37db46[_0x1fb9('0x1c')];var _0xc6b3ce=_0x212657?_0x2eb445[_0x1fb9('0x1e')]:_0x37db46[_0x1fb9('0x1c')]+_0x37db46[_0x1fb9('0x1f')];var _0x1fd9e6;if(_0xc6b3ce>=_0x164da8){_0xc6b3ce=_0x164da8;_0x1fd9e6=0xc8;}else{_0x1fd9e6=0xce;}_0x252259[_0x1fb9('0x1a')](_0x1fd9e6);return _0x252259['set']('Content-Range',_0x1d4f0a+'-'+_0xc6b3ce+'/'+_0x164da8)['json'](_0x2eb445);}return null;};}function patchUpdates(_0x17b50f){return function(_0x575ecc){try{jsonpatch[_0x1fb9('0x20')](_0x575ecc,_0x17b50f,!![]);}catch(_0x37d18e){return BPromise[_0x1fb9('0x21')](_0x37d18e);}return _0x575ecc[_0x1fb9('0x22')]();};}function saveUpdates(_0x127ff,_0x3cc93b){return function(_0x27d476){if(_0x27d476){return _0x27d476[_0x1fb9('0x23')](_0x127ff)[_0x1fb9('0x24')](function(_0x2c0847){return _0x2c0847;});}return null;};}function removeEntity(_0x4e9292,_0x9f6101){return function(_0x40558f){if(_0x40558f){return _0x40558f['destroy']()[_0x1fb9('0x24')](function(){var _0x30e127=_0x40558f[_0x1fb9('0x25')]({'plain':!![]});var _0x462016=_0x1fb9('0x26');return db[_0x1fb9('0x27')][_0x1fb9('0x28')]({'where':{'type':_0x462016,'resourceId':_0x30e127['id']}})[_0x1fb9('0x24')](function(){return _0x40558f;});})[_0x1fb9('0x24')](function(){_0x4e9292[_0x1fb9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4275bf,_0x442e73){return function(_0x46eafa){if(!_0x46eafa){_0x4275bf[_0x1fb9('0x19')](0x194);}return _0x46eafa;};}function handleError(_0x5e03f8,_0x1df0de){_0x1df0de=_0x1df0de||0x1f4;return function(_0x40a1a8){logger[_0x1fb9('0x29')](_0x40a1a8[_0x1fb9('0x2a')]);if(_0x40a1a8['name']){delete _0x40a1a8[_0x1fb9('0x2b')];}_0x5e03f8[_0x1fb9('0x1a')](_0x1df0de)['send'](_0x40a1a8);};}exports['index']=function(_0xd8b205,_0x21e13c){var _0x52d94c={},_0x23274b={},_0x59e2a8={'count':0x0,'rows':[]};var _0x1a6c09=_['map'](db['CmContactHasItem'][_0x1fb9('0x2c')],function(_0x3d549d){return{'name':_0x3d549d[_0x1fb9('0x2d')],'type':_0x3d549d[_0x1fb9('0x2e')]['key']};});_0x23274b['model']=_[_0x1fb9('0x2f')](_0x1a6c09,_0x1fb9('0x2b'));_0x23274b[_0x1fb9('0x30')]=_[_0x1fb9('0x31')](_0xd8b205['query']);_0x23274b['filters']=_[_0x1fb9('0x32')](_0x23274b[_0x1fb9('0x33')],_0x23274b[_0x1fb9('0x30')]);_0x52d94c[_0x1fb9('0x34')]=_[_0x1fb9('0x32')](_0x23274b[_0x1fb9('0x33')],qs[_0x1fb9('0x35')](_0xd8b205[_0x1fb9('0x30')]['fields']));_0x52d94c[_0x1fb9('0x34')]=_0x52d94c['attributes'][_0x1fb9('0x36')]?_0x52d94c['attributes']:_0x23274b['model'];if(!_0xd8b205[_0x1fb9('0x30')]['hasOwnProperty']('nolimit')){_0x52d94c[_0x1fb9('0x1f')]=qs[_0x1fb9('0x1f')](_0xd8b205['query'][_0x1fb9('0x1f')]);_0x52d94c[_0x1fb9('0x1c')]=qs[_0x1fb9('0x1c')](_0xd8b205['query']['offset']);}_0x52d94c[_0x1fb9('0x37')]=qs[_0x1fb9('0x38')](_0xd8b205[_0x1fb9('0x30')]['sort']);_0x52d94c[_0x1fb9('0x39')]=qs['filters'](_[_0x1fb9('0x3a')](_0xd8b205[_0x1fb9('0x30')],_0x23274b[_0x1fb9('0x3b')]),_0x1a6c09);if(_0xd8b205[_0x1fb9('0x30')][_0x1fb9('0x3c')]){_0x52d94c[_0x1fb9('0x39')]=_['merge'](_0x52d94c[_0x1fb9('0x39')],{'$or':_[_0x1fb9('0x2f')](_0x1a6c09,function(_0x128ae8){if(_0x128ae8[_0x1fb9('0x2e')]!=='VIRTUAL'){var _0x5acdc7={};_0x5acdc7[_0x128ae8[_0x1fb9('0x2b')]]={'$like':'%'+_0xd8b205[_0x1fb9('0x30')][_0x1fb9('0x3c')]+'%'};return _0x5acdc7;}})});}_0x52d94c=_[_0x1fb9('0x3d')]({},_0x52d94c,_0xd8b205[_0x1fb9('0x3e')]);var _0x36f70d={'where':_0x52d94c[_0x1fb9('0x39')]};return db['CmContactHasItem']['count'](_0x36f70d)[_0x1fb9('0x24')](function(_0x7b3494){_0x59e2a8['count']=_0x7b3494;if(_0xd8b205['query'][_0x1fb9('0x3f')]){_0x52d94c[_0x1fb9('0x40')]=[{'all':!![]}];}return db[_0x1fb9('0x41')][_0x1fb9('0x42')](_0x52d94c);})[_0x1fb9('0x24')](function(_0x3ab168){_0x59e2a8[_0x1fb9('0x43')]=_0x3ab168;return _0x59e2a8;})[_0x1fb9('0x24')](respondWithFilteredResult(_0x21e13c,_0x52d94c))[_0x1fb9('0x44')](handleError(_0x21e13c,null));};exports['show']=function(_0x1dbeea,_0x576202){var _0x3da94c={'raw':!![],'where':{'id':_0x1dbeea['params']['id']}},_0x360bdc={};_0x360bdc[_0x1fb9('0x33')]=_[_0x1fb9('0x31')](db[_0x1fb9('0x41')][_0x1fb9('0x2c')]);_0x360bdc[_0x1fb9('0x30')]=_['keys'](_0x1dbeea[_0x1fb9('0x30')]);_0x360bdc[_0x1fb9('0x3b')]=_[_0x1fb9('0x32')](_0x360bdc['model'],_0x360bdc[_0x1fb9('0x30')]);_0x3da94c[_0x1fb9('0x34')]=_['intersection'](_0x360bdc[_0x1fb9('0x33')],qs['fields'](_0x1dbeea[_0x1fb9('0x30')][_0x1fb9('0x35')]));_0x3da94c[_0x1fb9('0x34')]=_0x3da94c[_0x1fb9('0x34')]['length']?_0x3da94c[_0x1fb9('0x34')]:_0x360bdc[_0x1fb9('0x33')];if(_0x1dbeea[_0x1fb9('0x30')]['includeAll']){_0x3da94c[_0x1fb9('0x40')]=[{'all':!![]}];}_0x3da94c=_[_0x1fb9('0x3d')]({},_0x3da94c,_0x1dbeea[_0x1fb9('0x3e')]);return db['CmContactHasItem'][_0x1fb9('0x45')](_0x3da94c)[_0x1fb9('0x24')](handleEntityNotFound(_0x576202,null))[_0x1fb9('0x24')](respondWithResult(_0x576202,null))[_0x1fb9('0x44')](handleError(_0x576202,null));};exports['create']=function(_0x24b159,_0x255dd4){return db[_0x1fb9('0x41')]['create'](_0x24b159[_0x1fb9('0x46')],{})['then'](function(_0x436a9a){var _0x42fa85=_0x24b159[_0x1fb9('0x47')][_0x1fb9('0x25')]({'plain':!![]});if(!_0x42fa85)throw new Error(_0x1fb9('0x48'));if(_0x42fa85['role']===_0x1fb9('0x47')){var _0x273f0d=_0x436a9a[_0x1fb9('0x25')]({'plain':!![]});var _0x4e1bb7='CmContactHasItems';return db[_0x1fb9('0x49')][_0x1fb9('0x45')]({'where':{'name':_0x4e1bb7,'userProfileId':_0x42fa85['userProfileId']},'raw':!![]})['then'](function(_0x4a831e){if(_0x4a831e&&_0x4a831e[_0x1fb9('0x4a')]===0x0){return db[_0x1fb9('0x27')][_0x1fb9('0x4b')]({'name':_0x273f0d[_0x1fb9('0x2b')],'resourceId':_0x273f0d['id'],'type':_0x4a831e[_0x1fb9('0x2b')],'sectionId':_0x4a831e['id']},{})['then'](function(){return _0x436a9a;});}else{return _0x436a9a;}})[_0x1fb9('0x44')](function(_0x3c808d){logger[_0x1fb9('0x29')](_0x1fb9('0x4c'),_0x3c808d);throw _0x3c808d;});}return _0x436a9a;})[_0x1fb9('0x24')](respondWithResult(_0x255dd4,0xc9))[_0x1fb9('0x44')](handleError(_0x255dd4,null));};exports[_0x1fb9('0x23')]=function(_0x2a671c,_0x2e6ff1){if(_0x2a671c[_0x1fb9('0x46')]['id']){delete _0x2a671c['body']['id'];}return db[_0x1fb9('0x41')][_0x1fb9('0x45')]({'where':{'id':_0x2a671c[_0x1fb9('0x4d')]['id']}})[_0x1fb9('0x24')](handleEntityNotFound(_0x2e6ff1,null))[_0x1fb9('0x24')](saveUpdates(_0x2a671c[_0x1fb9('0x46')],null))[_0x1fb9('0x24')](respondWithResult(_0x2e6ff1,null))[_0x1fb9('0x44')](handleError(_0x2e6ff1,null));};exports[_0x1fb9('0x28')]=function(_0x410e83,_0x3cd67d){return db[_0x1fb9('0x41')][_0x1fb9('0x45')]({'where':{'id':_0x410e83[_0x1fb9('0x4d')]['id']}})[_0x1fb9('0x24')](handleEntityNotFound(_0x3cd67d,null))['then'](removeEntity(_0x3cd67d,null))[_0x1fb9('0x44')](handleError(_0x3cd67d,null));}; \ No newline at end of file +var _0xed33=['include','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','update','destroy','then','get','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','order','sort','where','pick','merge','options','includeAll'];(function(_0x21747a,_0x2bf4d5){var _0x365f2a=function(_0x1e2b22){while(--_0x1e2b22){_0x21747a['push'](_0x21747a['shift']());}};_0x365f2a(++_0x2bf4d5);}(_0xed33,0x1e4));var _0x3ed3=function(_0x56e4b9,_0x292b1a){_0x56e4b9=_0x56e4b9-0x0;var _0x448e90=_0xed33[_0x56e4b9];return _0x448e90;};'use strict';var emlformat=require(_0x3ed3('0x0'));var rimraf=require(_0x3ed3('0x1'));var zipdir=require(_0x3ed3('0x2'));var jsonpatch=require(_0x3ed3('0x3'));var rp=require(_0x3ed3('0x4'));var moment=require(_0x3ed3('0x5'));var BPromise=require(_0x3ed3('0x6'));var Mustache=require('mustache');var util=require(_0x3ed3('0x7'));var path=require(_0x3ed3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ed3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ed3('0xa'));var squel=require(_0x3ed3('0xb'));var crypto=require('crypto');var jsforce=require(_0x3ed3('0xc'));var deskjs=require(_0x3ed3('0xd'));var toCsv=require(_0x3ed3('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ed3('0xf'));var authService=require(_0x3ed3('0x10'));var qs=require(_0x3ed3('0x11'));var as=require(_0x3ed3('0x12'));var hardwareService=require(_0x3ed3('0x13'));var logger=require(_0x3ed3('0x14'))(_0x3ed3('0x15'));var utils=require('../../config/utils');var config=require(_0x3ed3('0x16'));var licenseUtil=require(_0x3ed3('0x17'));var db=require(_0x3ed3('0x18'))['db'];function respondWithStatusCode(_0x8931a8,_0x23ad7e){_0x23ad7e=_0x23ad7e||0xcc;return function(_0x2b83d7){if(_0x2b83d7){return _0x8931a8[_0x3ed3('0x19')](_0x23ad7e);}return _0x8931a8['status'](_0x23ad7e)['end']();};}function respondWithResult(_0x226fe6,_0x280ad6){_0x280ad6=_0x280ad6||0xc8;return function(_0x2e6543){if(_0x2e6543){return _0x226fe6['status'](_0x280ad6)['json'](_0x2e6543);}};}function respondWithFilteredResult(_0x13aebd,_0x1bec31){return function(_0x27bbc2){if(_0x27bbc2){var _0x2c2e0e=typeof _0x1bec31[_0x3ed3('0x1a')]===_0x3ed3('0x1b')&&typeof _0x1bec31[_0x3ed3('0x1c')]===_0x3ed3('0x1b');var _0x2baa52=_0x27bbc2['count'];var _0x1bb6e1=_0x2c2e0e?0x0:_0x1bec31['offset'];var _0x57ec03=_0x2c2e0e?_0x27bbc2[_0x3ed3('0x1d')]:_0x1bec31['offset']+_0x1bec31[_0x3ed3('0x1c')];var _0x542103;if(_0x57ec03>=_0x2baa52){_0x57ec03=_0x2baa52;_0x542103=0xc8;}else{_0x542103=0xce;}_0x13aebd[_0x3ed3('0x1e')](_0x542103);return _0x13aebd[_0x3ed3('0x1f')](_0x3ed3('0x20'),_0x1bb6e1+'-'+_0x57ec03+'/'+_0x2baa52)[_0x3ed3('0x21')](_0x27bbc2);}return null;};}function patchUpdates(_0x435d9a){return function(_0x31edb4){try{jsonpatch[_0x3ed3('0x22')](_0x31edb4,_0x435d9a,!![]);}catch(_0x48dcaf){return BPromise[_0x3ed3('0x23')](_0x48dcaf);}return _0x31edb4['save']();};}function saveUpdates(_0x4e1526,_0x305fae){return function(_0x49046f){if(_0x49046f){return _0x49046f[_0x3ed3('0x24')](_0x4e1526)['then'](function(_0x435911){return _0x435911;});}return null;};}function removeEntity(_0x2bf6ee,_0x39bfaf){return function(_0x3c1a9d){if(_0x3c1a9d){return _0x3c1a9d[_0x3ed3('0x25')]()[_0x3ed3('0x26')](function(){var _0x5b69e6=_0x3c1a9d[_0x3ed3('0x27')]({'plain':!![]});var _0x1cd220='CmContactHasItems';return db['UserProfileResource'][_0x3ed3('0x25')]({'where':{'type':_0x1cd220,'resourceId':_0x5b69e6['id']}})[_0x3ed3('0x26')](function(){return _0x3c1a9d;});})[_0x3ed3('0x26')](function(){_0x2bf6ee[_0x3ed3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a81f5,_0x3b6655){return function(_0x17b359){if(!_0x17b359){_0x4a81f5[_0x3ed3('0x19')](0x194);}return _0x17b359;};}function handleError(_0x29ac54,_0xd936d6){_0xd936d6=_0xd936d6||0x1f4;return function(_0xd979be){logger[_0x3ed3('0x28')](_0xd979be['stack']);if(_0xd979be[_0x3ed3('0x29')]){delete _0xd979be[_0x3ed3('0x29')];}_0x29ac54[_0x3ed3('0x1e')](_0xd936d6)[_0x3ed3('0x2a')](_0xd979be);};}exports[_0x3ed3('0x2b')]=function(_0x3f953d,_0x2ae7d7){var _0x5aae9d={},_0x7069bd={},_0x1e0fd8={'count':0x0,'rows':[]};var _0x2154da=_[_0x3ed3('0x2c')](db[_0x3ed3('0x2d')][_0x3ed3('0x2e')],function(_0x31428e){return{'name':_0x31428e[_0x3ed3('0x2f')],'type':_0x31428e[_0x3ed3('0x30')]['key']};});_0x7069bd['model']=_[_0x3ed3('0x2c')](_0x2154da,_0x3ed3('0x29'));_0x7069bd[_0x3ed3('0x31')]=_['keys'](_0x3f953d['query']);_0x7069bd[_0x3ed3('0x32')]=_[_0x3ed3('0x33')](_0x7069bd[_0x3ed3('0x34')],_0x7069bd[_0x3ed3('0x31')]);_0x5aae9d[_0x3ed3('0x35')]=_[_0x3ed3('0x33')](_0x7069bd['model'],qs['fields'](_0x3f953d[_0x3ed3('0x31')]['fields']));_0x5aae9d[_0x3ed3('0x35')]=_0x5aae9d[_0x3ed3('0x35')][_0x3ed3('0x36')]?_0x5aae9d[_0x3ed3('0x35')]:_0x7069bd[_0x3ed3('0x34')];if(!_0x3f953d[_0x3ed3('0x31')]['hasOwnProperty']('nolimit')){_0x5aae9d[_0x3ed3('0x1c')]=qs[_0x3ed3('0x1c')](_0x3f953d['query'][_0x3ed3('0x1c')]);_0x5aae9d['offset']=qs[_0x3ed3('0x1a')](_0x3f953d[_0x3ed3('0x31')]['offset']);}_0x5aae9d[_0x3ed3('0x37')]=qs[_0x3ed3('0x38')](_0x3f953d['query']['sort']);_0x5aae9d[_0x3ed3('0x39')]=qs[_0x3ed3('0x32')](_[_0x3ed3('0x3a')](_0x3f953d[_0x3ed3('0x31')],_0x7069bd[_0x3ed3('0x32')]),_0x2154da);if(_0x3f953d[_0x3ed3('0x31')]['filter']){_0x5aae9d[_0x3ed3('0x39')]=_[_0x3ed3('0x3b')](_0x5aae9d[_0x3ed3('0x39')],{'$or':_[_0x3ed3('0x2c')](_0x2154da,function(_0x46999e){if(_0x46999e[_0x3ed3('0x30')]!=='VIRTUAL'){var _0x135dd8={};_0x135dd8[_0x46999e['name']]={'$like':'%'+_0x3f953d[_0x3ed3('0x31')]['filter']+'%'};return _0x135dd8;}})});}_0x5aae9d=_[_0x3ed3('0x3b')]({},_0x5aae9d,_0x3f953d[_0x3ed3('0x3c')]);var _0x567887={'where':_0x5aae9d['where']};return db['CmContactHasItem'][_0x3ed3('0x1d')](_0x567887)[_0x3ed3('0x26')](function(_0x59093a){_0x1e0fd8['count']=_0x59093a;if(_0x3f953d[_0x3ed3('0x31')][_0x3ed3('0x3d')]){_0x5aae9d[_0x3ed3('0x3e')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x5aae9d);})['then'](function(_0xa7611c){_0x1e0fd8[_0x3ed3('0x3f')]=_0xa7611c;return _0x1e0fd8;})['then'](respondWithFilteredResult(_0x2ae7d7,_0x5aae9d))[_0x3ed3('0x40')](handleError(_0x2ae7d7,null));};exports[_0x3ed3('0x41')]=function(_0x219cc1,_0x293ec2){var _0x492587={'raw':!![],'where':{'id':_0x219cc1[_0x3ed3('0x42')]['id']}},_0x90ac86={};_0x90ac86[_0x3ed3('0x34')]=_['keys'](db[_0x3ed3('0x2d')][_0x3ed3('0x2e')]);_0x90ac86['query']=_['keys'](_0x219cc1[_0x3ed3('0x31')]);_0x90ac86['filters']=_[_0x3ed3('0x33')](_0x90ac86[_0x3ed3('0x34')],_0x90ac86[_0x3ed3('0x31')]);_0x492587[_0x3ed3('0x35')]=_['intersection'](_0x90ac86['model'],qs[_0x3ed3('0x43')](_0x219cc1[_0x3ed3('0x31')][_0x3ed3('0x43')]));_0x492587[_0x3ed3('0x35')]=_0x492587[_0x3ed3('0x35')][_0x3ed3('0x36')]?_0x492587['attributes']:_0x90ac86[_0x3ed3('0x34')];if(_0x219cc1['query'][_0x3ed3('0x3d')]){_0x492587[_0x3ed3('0x3e')]=[{'all':!![]}];}_0x492587=_[_0x3ed3('0x3b')]({},_0x492587,_0x219cc1[_0x3ed3('0x3c')]);return db[_0x3ed3('0x2d')][_0x3ed3('0x44')](_0x492587)[_0x3ed3('0x26')](handleEntityNotFound(_0x293ec2,null))[_0x3ed3('0x26')](respondWithResult(_0x293ec2,null))[_0x3ed3('0x40')](handleError(_0x293ec2,null));};exports[_0x3ed3('0x45')]=function(_0x4c0b2f,_0x501d92){return db[_0x3ed3('0x2d')]['create'](_0x4c0b2f[_0x3ed3('0x46')],{})[_0x3ed3('0x26')](function(_0x46fa18){var _0x2f39a0=_0x4c0b2f[_0x3ed3('0x47')][_0x3ed3('0x27')]({'plain':!![]});if(!_0x2f39a0)throw new Error(_0x3ed3('0x48'));if(_0x2f39a0[_0x3ed3('0x49')]===_0x3ed3('0x47')){var _0x278243=_0x46fa18[_0x3ed3('0x27')]({'plain':!![]});var _0x531914='CmContactHasItems';return db['UserProfileSection'][_0x3ed3('0x44')]({'where':{'name':_0x531914,'userProfileId':_0x2f39a0[_0x3ed3('0x4a')]},'raw':!![]})[_0x3ed3('0x26')](function(_0x338e90){if(_0x338e90&&_0x338e90[_0x3ed3('0x4b')]===0x0){return db[_0x3ed3('0x4c')][_0x3ed3('0x45')]({'name':_0x278243[_0x3ed3('0x29')],'resourceId':_0x278243['id'],'type':_0x338e90[_0x3ed3('0x29')],'sectionId':_0x338e90['id']},{})[_0x3ed3('0x26')](function(){return _0x46fa18;});}else{return _0x46fa18;}})['catch'](function(_0x136352){logger['error'](_0x3ed3('0x4d'),_0x136352);throw _0x136352;});}return _0x46fa18;})['then'](respondWithResult(_0x501d92,0xc9))[_0x3ed3('0x40')](handleError(_0x501d92,null));};exports['update']=function(_0x5f28d1,_0x41d7e3){if(_0x5f28d1[_0x3ed3('0x46')]['id']){delete _0x5f28d1[_0x3ed3('0x46')]['id'];}return db[_0x3ed3('0x2d')][_0x3ed3('0x44')]({'where':{'id':_0x5f28d1[_0x3ed3('0x42')]['id']}})[_0x3ed3('0x26')](handleEntityNotFound(_0x41d7e3,null))[_0x3ed3('0x26')](saveUpdates(_0x5f28d1[_0x3ed3('0x46')],null))['then'](respondWithResult(_0x41d7e3,null))[_0x3ed3('0x40')](handleError(_0x41d7e3,null));};exports[_0x3ed3('0x25')]=function(_0x3f14c1,_0x37e986){return db[_0x3ed3('0x2d')][_0x3ed3('0x44')]({'where':{'id':_0x3f14c1[_0x3ed3('0x42')]['id']}})[_0x3ed3('0x26')](handleEntityNotFound(_0x37e986,null))[_0x3ed3('0x26')](removeEntity(_0x37e986,null))[_0x3ed3('0x40')](handleError(_0x37e986,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 7a45288..fba5688 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 _0xbe0c=['rimraf','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xbe0c,0x155));var _0xcbe0=function(_0x43b5a7,_0xf5e3d6){_0x43b5a7=_0x43b5a7-0x0;var _0x5461fe=_0xbe0c[_0x43b5a7];return _0x5461fe;};'use strict';var _=require(_0xcbe0('0x0'));var util=require(_0xcbe0('0x1'));var logger=require('../../config/logger')(_0xcbe0('0x2'));var moment=require(_0xcbe0('0x3'));var BPromise=require(_0xcbe0('0x4'));var rp=require(_0xcbe0('0x5'));var fs=require('fs');var path=require(_0xcbe0('0x6'));var rimraf=require(_0xcbe0('0x7'));var config=require('../../config/environment');var attributes=require(_0xcbe0('0x8'));module[_0xcbe0('0x9')]=function(_0x38c2ed,_0x5a0eaa){return _0x38c2ed['define'](_0xcbe0('0xa'),attributes,{'tableName':_0xcbe0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4e1=['CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x3ea7e9,_0x472bc5){var _0x26388b=function(_0x131ea1){while(--_0x131ea1){_0x3ea7e9['push'](_0x3ea7e9['shift']());}};_0x26388b(++_0x472bc5);}(_0xd4e1,0x9c));var _0x1d4e=function(_0x43c139,_0x17a132){_0x43c139=_0x43c139-0x0;var _0x58e477=_0xd4e1[_0x43c139];return _0x58e477;};'use strict';var _=require(_0x1d4e('0x0'));var util=require('util');var logger=require(_0x1d4e('0x1'))(_0x1d4e('0x2'));var moment=require(_0x1d4e('0x3'));var BPromise=require(_0x1d4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1d4e('0x5'));var config=require(_0x1d4e('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0x1d4e('0x7')]=function(_0x1122be,_0x18c59f){return _0x1122be[_0x1d4e('0x8')](_0x1d4e('0x9'),attributes,{'tableName':_0x1d4e('0xa'),'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 f080b7e..8e15b18 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 _0x7901=['../../config/logger','rpc','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c388d,_0x3f8896){var _0x1e2278=function(_0x29f715){while(--_0x29f715){_0x2c388d['push'](_0x2c388d['shift']());}};_0x1e2278(++_0x3f8896);}(_0x7901,0xc8));var _0x1790=function(_0x5d1d5c,_0x479079){_0x5d1d5c=_0x5d1d5c-0x0;var _0x5eae72=_0x7901[_0x5d1d5c];return _0x5eae72;};'use strict';var _=require(_0x1790('0x0'));var util=require(_0x1790('0x1'));var moment=require(_0x1790('0x2'));var BPromise=require('bluebird');var rs=require(_0x1790('0x3'));var fs=require('fs');var Redis=require(_0x1790('0x4'));var db=require(_0x1790('0x5'))['db'];var utils=require(_0x1790('0x6'));var logger=require(_0x1790('0x7'))(_0x1790('0x8'));var config=require('../../config/environment');var jayson=require(_0x1790('0x9'));var client=jayson['client'][_0x1790('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1979b4,_0x3ad5cb,_0x10189a){return new BPromise(function(_0xd07ed2,_0x256fe1){return client[_0x1790('0xb')](_0x1979b4,_0x10189a)[_0x1790('0xc')](function(_0x17c9cd){logger[_0x1790('0xd')](_0x1790('0xe'),_0x3ad5cb,_0x1790('0xf'));logger['debug'](_0x1790('0x10'),_0x3ad5cb,_0x1790('0xf'),JSON[_0x1790('0x11')](_0x17c9cd));if(_0x17c9cd[_0x1790('0x12')]){if(_0x17c9cd[_0x1790('0x12')][_0x1790('0x13')]===0x1f4){logger[_0x1790('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x3ad5cb,_0x17c9cd[_0x1790('0x12')][_0x1790('0x14')]);return _0x256fe1(_0x17c9cd[_0x1790('0x12')]['message']);}logger[_0x1790('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x3ad5cb,_0x17c9cd[_0x1790('0x12')]['message']);return _0xd07ed2(_0x17c9cd['error']['message']);}else{logger[_0x1790('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x3ad5cb,_0x1790('0xf'));_0xd07ed2(_0x17c9cd[_0x1790('0x15')][_0x1790('0x14')]);}})[_0x1790('0x16')](function(_0x47d226){logger[_0x1790('0x12')](_0x1790('0xe'),_0x3ad5cb,_0x47d226);_0x256fe1(_0x47d226);});});} \ No newline at end of file +var _0x6cba=['request\x20sent','debug','stringify','error','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x6cba,0x79));var _0xa6cb=function(_0x504d1e,_0x358b66){_0x504d1e=_0x504d1e-0x0;var _0xe0f72d=_0x6cba[_0x504d1e];return _0xe0f72d;};'use strict';var _=require(_0xa6cb('0x0'));var util=require('util');var moment=require(_0xa6cb('0x1'));var BPromise=require('bluebird');var rs=require(_0xa6cb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6cb('0x3'))['db'];var utils=require(_0xa6cb('0x4'));var logger=require(_0xa6cb('0x5'))(_0xa6cb('0x6'));var config=require(_0xa6cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa6cb('0x8')][_0xa6cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa11d,_0x519198,_0x3701f7){return new BPromise(function(_0x6c6739,_0x2fff18){return client[_0xa6cb('0xa')](_0x4aa11d,_0x3701f7)['then'](function(_0x17baf4){logger[_0xa6cb('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x519198,_0xa6cb('0xc'));logger[_0xa6cb('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x519198,_0xa6cb('0xc'),JSON[_0xa6cb('0xe')](_0x17baf4));if(_0x17baf4[_0xa6cb('0xf')]){if(_0x17baf4['error']['code']===0x1f4){logger['error'](_0xa6cb('0x10'),_0x519198,_0x17baf4['error'][_0xa6cb('0x11')]);return _0x2fff18(_0x17baf4[_0xa6cb('0xf')][_0xa6cb('0x11')]);}logger['error'](_0xa6cb('0x10'),_0x519198,_0x17baf4[_0xa6cb('0xf')][_0xa6cb('0x11')]);return _0x6c6739(_0x17baf4[_0xa6cb('0xf')][_0xa6cb('0x11')]);}else{logger['info'](_0xa6cb('0x10'),_0x519198,_0xa6cb('0xc'));_0x6c6739(_0x17baf4[_0xa6cb('0x12')][_0xa6cb('0x11')]);}})['catch'](function(_0x1adec7){logger[_0xa6cb('0xf')](_0xa6cb('0x10'),_0x519198,_0x1adec7);_0x2fff18(_0x1adec7);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 781d1a8..ec653f2 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 _0x36da=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x424d84,_0x1ae7b3){var _0x470900=function(_0x5c5eb8){while(--_0x5c5eb8){_0x424d84['push'](_0x424d84['shift']());}};_0x470900(++_0x1ae7b3);}(_0x36da,0x154));var _0xa36d=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x36da[_0x2b63c9];return _0x5928c6;};'use strict';var multer=require(_0xa36d('0x0'));var util=require(_0xa36d('0x1'));var path=require(_0xa36d('0x2'));var timeout=require(_0xa36d('0x3'));var express=require(_0xa36d('0x4'));var router=express[_0xa36d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa36d('0x6'));var interaction=require(_0xa36d('0x7'));var config=require('../../config/environment');var controller=require(_0xa36d('0x8'));router[_0xa36d('0x9')]('/',auth[_0xa36d('0xa')](),controller[_0xa36d('0xb')]);router[_0xa36d('0x9')](_0xa36d('0xc'),auth[_0xa36d('0xa')](),controller['show']);router[_0xa36d('0xd')]('/',auth[_0xa36d('0xa')](),controller[_0xa36d('0xe')]);router[_0xa36d('0xf')](_0xa36d('0xc'),auth[_0xa36d('0xa')](),controller[_0xa36d('0x10')]);router[_0xa36d('0x11')](_0xa36d('0xc'),auth[_0xa36d('0xa')](),controller[_0xa36d('0x12')]);module[_0xa36d('0x13')]=router; \ No newline at end of file +var _0x8f07=['../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','isAuthenticated','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8f07,0x161));var _0x78f0=function(_0x460e9e,_0x5bf3e8){_0x460e9e=_0x460e9e-0x0;var _0x4a9504=_0x8f07[_0x460e9e];return _0x4a9504;};'use strict';var multer=require('multer');var util=require(_0x78f0('0x0'));var path=require('path');var timeout=require(_0x78f0('0x1'));var express=require(_0x78f0('0x2'));var router=express['Router']();var fs_extra=require(_0x78f0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x78f0('0x4'));var config=require(_0x78f0('0x5'));var controller=require(_0x78f0('0x6'));router[_0x78f0('0x7')]('/',auth['isAuthenticated'](),controller[_0x78f0('0x8')]);router[_0x78f0('0x7')]('/:id',auth[_0x78f0('0x9')](),controller[_0x78f0('0xa')]);router[_0x78f0('0xb')]('/',auth['isAuthenticated'](),controller[_0x78f0('0xc')]);router[_0x78f0('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x78f0('0xe')]('/:id',auth[_0x78f0('0x9')](),controller[_0x78f0('0xf')]);module[_0x78f0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 6ae6262..7dd3ab3 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 _0x5920=['long','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','getDataValue','alias','setDataValue','name','STRING','TEXT'];(function(_0x427db6,_0xac1f2c){var _0x3a7fea=function(_0x127234){while(--_0x127234){_0x427db6['push'](_0x427db6['shift']());}};_0x3a7fea(++_0xac1f2c);}(_0x5920,0x1e5));var _0x0592=function(_0x33cea7,_0x42af9d){_0x33cea7=_0x33cea7-0x0;var _0x2b0452=_0x5920[_0x33cea7];return _0x2b0452;};'use strict';var Sequelize=require(_0x0592('0x0'));var _=require(_0x0592('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38a33d){return this[_0x0592('0x2')](_0x0592('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x213548){this[_0x0592('0x4')](_0x0592('0x3'),_0x213548?_0x213548:this[_0x0592('0x2')](_0x0592('0x5')));}},'type':{'type':Sequelize[_0x0592('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x0592('0x7')](_0x0592('0x8')),'get':function(){if(this[_0x0592('0x2')]('type')===_0x0592('0x9')){return JSON[_0x0592('0xa')](this['getDataValue'](_0x0592('0xb')));}else{return this[_0x0592('0x2')](_0x0592('0xb'));}},'set':function(_0x11e380){if(Array[_0x0592('0xc')](_0x11e380)){this[_0x0592('0x4')](_0x0592('0xb'),JSON[_0x0592('0xd')](_0x11e380));}else{this[_0x0592('0x4')](_0x0592('0xb'),_0x11e380);}}},'required':{'type':Sequelize[_0x0592('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0592('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0592('0xf')](_0x0592('0x10'))}}; \ No newline at end of file +var _0x390f=['sequelize','exports','getDataValue','alias','STRING','TEXT','type','select','parse','values','isArray','setDataValue','stringify','ENUM','voice'];(function(_0x5954d2,_0x15db93){var _0x316928=function(_0x278bd3){while(--_0x278bd3){_0x5954d2['push'](_0x5954d2['shift']());}};_0x316928(++_0x15db93);}(_0x390f,0x96));var _0xf390=function(_0x32ddd2,_0xe0f618){_0x32ddd2=_0x32ddd2-0x0;var _0x48de30=_0x390f[_0x32ddd2];return _0x48de30;};'use strict';var Sequelize=require(_0xf390('0x0'));var _=require('lodash');module[_0xf390('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51a9b2){return this[_0xf390('0x2')](_0xf390('0x3'));}},'alias':{'type':Sequelize[_0xf390('0x4')],'allowNull':![],'set':function(_0x448a2c){this['setDataValue']('alias',_0x448a2c?_0x448a2c:this[_0xf390('0x2')]('name'));}},'type':{'type':Sequelize[_0xf390('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xf390('0x5')]('long'),'get':function(){if(this[_0xf390('0x2')](_0xf390('0x6'))===_0xf390('0x7')){return JSON[_0xf390('0x8')](this['getDataValue'](_0xf390('0x9')));}else{return this[_0xf390('0x2')](_0xf390('0x9'));}},'set':function(_0x51384f){if(Array[_0xf390('0xa')](_0x51384f)){this[_0xf390('0xb')](_0xf390('0x9'),JSON[_0xf390('0xc')](_0x51384f));}else{this[_0xf390('0xb')](_0xf390('0x9'),_0x51384f);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf390('0xd')](_0xf390('0xe'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 243289f..35f5f45 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 _0x43da=['number','INTEGER','switch','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','findAll','show','params','keys','includeAll','body','find','catch','destroy','create','sequelize','transaction','Sequelize','TEXT','text'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x43da,0xb8));var _0xa43d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x43da[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xa43d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa43d('0x1'));var jsonpatch=require(_0xa43d('0x2'));var rp=require('request-promise');var moment=require(_0xa43d('0x3'));var BPromise=require(_0xa43d('0x4'));var Mustache=require(_0xa43d('0x5'));var util=require(_0xa43d('0x6'));var path=require(_0xa43d('0x7'));var sox=require(_0xa43d('0x8'));var csv=require(_0xa43d('0x9'));var ejs=require(_0xa43d('0xa'));var fs=require('fs');var fs_extra=require(_0xa43d('0xb'));var _=require(_0xa43d('0xc'));var squel=require(_0xa43d('0xd'));var crypto=require(_0xa43d('0xe'));var jsforce=require(_0xa43d('0xf'));var deskjs=require(_0xa43d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa43d('0x11'));var Papa=require('papaparse');var Redis=require(_0xa43d('0x12'));var authService=require(_0xa43d('0x13'));var qs=require(_0xa43d('0x14'));var as=require(_0xa43d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa43d('0x16'))(_0xa43d('0x17'));var utils=require(_0xa43d('0x18'));var config=require(_0xa43d('0x19'));var licenseUtil=require(_0xa43d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3900a8,_0x22e336){_0x22e336=_0x22e336||0xcc;return function(_0x1040f1){if(_0x1040f1){return _0x3900a8[_0xa43d('0x1b')](_0x22e336);}return _0x3900a8[_0xa43d('0x1c')](_0x22e336)[_0xa43d('0x1d')]();};}function respondWithResult(_0x41ac0e,_0x4037a3){_0x4037a3=_0x4037a3||0xc8;return function(_0x4b16cd){if(_0x4b16cd){return _0x41ac0e['status'](_0x4037a3)[_0xa43d('0x1e')](_0x4b16cd);}};}function respondWithFilteredResult(_0x59836a,_0x5de0af){return function(_0x4fc356){if(_0x4fc356){var _0x582364=typeof _0x5de0af[_0xa43d('0x1f')]===_0xa43d('0x20')&&typeof _0x5de0af[_0xa43d('0x21')]==='undefined';var _0x107b4b=_0x4fc356[_0xa43d('0x22')];var _0x334ac6=_0x582364?0x0:_0x5de0af[_0xa43d('0x1f')];var _0xbef79d=_0x582364?_0x4fc356[_0xa43d('0x22')]:_0x5de0af[_0xa43d('0x1f')]+_0x5de0af[_0xa43d('0x21')];var _0x2eae60;if(_0xbef79d>=_0x107b4b){_0xbef79d=_0x107b4b;_0x2eae60=0xc8;}else{_0x2eae60=0xce;}_0x59836a[_0xa43d('0x1c')](_0x2eae60);return _0x59836a['set'](_0xa43d('0x23'),_0x334ac6+'-'+_0xbef79d+'/'+_0x107b4b)[_0xa43d('0x1e')](_0x4fc356);}return null;};}function patchUpdates(_0x3c1a51){return function(_0x5aa739){try{jsonpatch['apply'](_0x5aa739,_0x3c1a51,!![]);}catch(_0x4ddced){return BPromise[_0xa43d('0x24')](_0x4ddced);}return _0x5aa739['save']();};}function saveUpdates(_0x2008cd,_0x1d1c8c){return function(_0x5c72bf){if(_0x5c72bf){return _0x5c72bf[_0xa43d('0x25')](_0x2008cd)[_0xa43d('0x26')](function(_0x453efa){return _0x453efa;});}return null;};}function removeEntity(_0x382b3c,_0xcc04a0){return function(_0x21ba90){if(_0x21ba90){return _0x21ba90['destroy']()[_0xa43d('0x26')](function(){_0x382b3c[_0xa43d('0x1c')](0xcc)[_0xa43d('0x1d')]();});}};}function handleEntityNotFound(_0x507e9e,_0x1ba546){return function(_0x51b50b){if(!_0x51b50b){_0x507e9e[_0xa43d('0x1b')](0x194);}return _0x51b50b;};}function handleError(_0x5669b3,_0x14142e){_0x14142e=_0x14142e||0x1f4;return function(_0x5b7549){logger[_0xa43d('0x27')](_0x5b7549[_0xa43d('0x28')]);if(_0x5b7549[_0xa43d('0x29')]){delete _0x5b7549[_0xa43d('0x29')];}_0x5669b3[_0xa43d('0x1c')](_0x14142e)[_0xa43d('0x2a')](_0x5b7549);};}exports[_0xa43d('0x2b')]=function(_0x2c90af,_0x96b1a7){var _0x429adb={},_0x4437e3={},_0x3138b0={'count':0x0,'rows':[]};var _0x5b300e=_[_0xa43d('0x2c')](db[_0xa43d('0x2d')][_0xa43d('0x2e')],function(_0x2ffe54){return{'name':_0x2ffe54['fieldName'],'type':_0x2ffe54['type'][_0xa43d('0x2f')]};});_0x4437e3[_0xa43d('0x30')]=_[_0xa43d('0x31')](_['map'](_0x5b300e,_0xa43d('0x29')),[_0xa43d('0x29')]);_0x4437e3['query']=_['keys'](_0x2c90af[_0xa43d('0x32')]);_0x4437e3[_0xa43d('0x33')]=_[_0xa43d('0x34')](_0x4437e3[_0xa43d('0x30')],_0x4437e3[_0xa43d('0x32')]);_0x429adb[_0xa43d('0x35')]=_[_0xa43d('0x34')](_0x4437e3[_0xa43d('0x30')],qs[_0xa43d('0x36')](_0x2c90af[_0xa43d('0x32')]['fields']));_0x429adb['attributes']=_0x429adb['attributes'][_0xa43d('0x37')]?_0x429adb[_0xa43d('0x35')]:_0x4437e3[_0xa43d('0x30')];if(!_0x2c90af[_0xa43d('0x32')][_0xa43d('0x38')]('nolimit')){_0x429adb[_0xa43d('0x21')]=qs[_0xa43d('0x21')](_0x2c90af['query'][_0xa43d('0x21')]);_0x429adb[_0xa43d('0x1f')]=qs[_0xa43d('0x1f')](_0x2c90af['query'][_0xa43d('0x1f')]);}_0x429adb[_0xa43d('0x39')]=qs[_0xa43d('0x3a')](_0x2c90af['query'][_0xa43d('0x3a')]);_0x429adb[_0xa43d('0x3b')]=qs[_0xa43d('0x33')](_['pick'](_0x2c90af[_0xa43d('0x32')],_0x4437e3['filters']),_0x5b300e);if(_0x2c90af[_0xa43d('0x32')]['filter']){_0x429adb['where']=_[_0xa43d('0x3c')](_0x429adb[_0xa43d('0x3b')],{'$or':_[_0xa43d('0x2c')](_0x5b300e,function(_0x10dca2){if(_0x10dca2[_0xa43d('0x3d')]!==_0xa43d('0x3e')){var _0x3c9fe0={};_0x3c9fe0[_0x10dca2[_0xa43d('0x29')]]={'$like':'%'+_0x2c90af[_0xa43d('0x32')][_0xa43d('0x3f')]+'%'};return _0x3c9fe0;}})});}_0x429adb=_[_0xa43d('0x3c')]({},_0x429adb,_0x2c90af[_0xa43d('0x40')]);var _0x112a2c={'where':_0x429adb['where']};return db[_0xa43d('0x2d')][_0xa43d('0x22')](_0x112a2c)[_0xa43d('0x26')](function(_0xc36694){_0x3138b0[_0xa43d('0x22')]=_0xc36694;if(_0x2c90af[_0xa43d('0x32')]['includeAll']){_0x429adb['include']=[{'all':!![]}];}return db[_0xa43d('0x2d')][_0xa43d('0x41')](_0x429adb);})[_0xa43d('0x26')](function(_0x129753){_0x3138b0['rows']=_0x129753;return _0x3138b0;})['then'](respondWithFilteredResult(_0x96b1a7,_0x429adb))['catch'](handleError(_0x96b1a7,null));};exports[_0xa43d('0x42')]=function(_0x1f3199,_0x3a3965){var _0x494366={'raw':!![],'where':{'id':_0x1f3199[_0xa43d('0x43')]['id']}},_0x3eefe2={};_0x3eefe2[_0xa43d('0x30')]=_[_0xa43d('0x44')](db[_0xa43d('0x2d')][_0xa43d('0x2e')]);_0x3eefe2['query']=_['keys'](_0x1f3199[_0xa43d('0x32')]);_0x3eefe2[_0xa43d('0x33')]=_['intersection'](_0x3eefe2['model'],_0x3eefe2['query']);_0x494366[_0xa43d('0x35')]=_[_0xa43d('0x34')](_0x3eefe2['model'],qs[_0xa43d('0x36')](_0x1f3199[_0xa43d('0x32')][_0xa43d('0x36')]));_0x494366[_0xa43d('0x35')]=_0x494366['attributes']['length']?_0x494366[_0xa43d('0x35')]:_0x3eefe2[_0xa43d('0x30')];if(_0x1f3199[_0xa43d('0x32')][_0xa43d('0x45')]){_0x494366['include']=[{'all':!![]}];}_0x494366=_[_0xa43d('0x3c')]({},_0x494366,_0x1f3199[_0xa43d('0x40')]);return db[_0xa43d('0x2d')]['find'](_0x494366)[_0xa43d('0x26')](handleEntityNotFound(_0x3a3965,null))[_0xa43d('0x26')](respondWithResult(_0x3a3965,null))['catch'](handleError(_0x3a3965,null));};exports['update']=function(_0x278659,_0x40e717){if(_0x278659[_0xa43d('0x46')]['id']){delete _0x278659[_0xa43d('0x46')]['id'];}return db['CmCustomField'][_0xa43d('0x47')]({'where':{'id':_0x278659['params']['id']}})['then'](handleEntityNotFound(_0x40e717,null))[_0xa43d('0x26')](saveUpdates(_0x278659[_0xa43d('0x46')],null))[_0xa43d('0x26')](respondWithResult(_0x40e717,null))[_0xa43d('0x48')](handleError(_0x40e717,null));};exports[_0xa43d('0x49')]=function(_0x5180cd,_0x1005bf){return db[_0xa43d('0x2d')][_0xa43d('0x47')]({'where':{'id':_0x5180cd[_0xa43d('0x43')]['id']}})[_0xa43d('0x26')](handleEntityNotFound(_0x1005bf,null))[_0xa43d('0x26')](removeEntity(_0x1005bf,null))[_0xa43d('0x48')](handleError(_0x1005bf,null));};exports[_0xa43d('0x4a')]=function(_0x1ffb48,_0x4e28b6){var _0x5046f0;return db[_0xa43d('0x4b')][_0xa43d('0x4c')](function(_0x5d8fd3){return db[_0xa43d('0x2d')][_0xa43d('0x4a')](_0x1ffb48['body'],{'transaction':_0x5d8fd3})[_0xa43d('0x26')](function(_0xa5d1d4){_0x5046f0=_0xa5d1d4;var _0x507c1c={'type':db[_0xa43d('0x4d')][_0xa43d('0x4e')],'transaction':_0x5d8fd3};switch(_0x1ffb48[_0xa43d('0x46')][_0xa43d('0x3d')]){case _0xa43d('0x4f'):_0x507c1c['type']=db[_0xa43d('0x4d')]['TEXT'];break;case _0xa43d('0x50'):_0x507c1c[_0xa43d('0x3d')]=db[_0xa43d('0x4d')][_0xa43d('0x51')];break;case _0xa43d('0x52'):_0x507c1c['type']=db[_0xa43d('0x4d')]['BOOLEAN'];_0x507c1c[_0xa43d('0x53')]=![];break;default:}return db[_0xa43d('0x4b')][_0xa43d('0x54')][_0xa43d('0x55')]('cm_contacts',util[_0xa43d('0x56')](_0xa43d('0x57'),_0x5046f0['id']),_0x507c1c);})[_0xa43d('0x26')](function(){return _0x5046f0;});})['then'](respondWithResult(_0x4e28b6,0xc9))[_0xa43d('0x48')](handleError(_0x4e28b6,null));}; \ No newline at end of file +var _0x1400=['key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','update','body','create','Sequelize','text','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','reject','destroy','then','error','stack','name','send','index','CmCustomField','fieldName','type'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x1400,0xc7));var _0x0140=function(_0x524042,_0x1b85d7){_0x524042=_0x524042-0x0;var _0x2f6e83=_0x1400[_0x524042];return _0x2f6e83;};'use strict';var emlformat=require(_0x0140('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0140('0x1'));var jsonpatch=require(_0x0140('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0140('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0140('0x4'));var csv=require(_0x0140('0x5'));var ejs=require(_0x0140('0x6'));var fs=require('fs');var fs_extra=require(_0x0140('0x7'));var _=require(_0x0140('0x8'));var squel=require('squel');var crypto=require(_0x0140('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0140('0xa'));var toCsv=require(_0x0140('0x5'));var querystring=require(_0x0140('0xb'));var Papa=require(_0x0140('0xc'));var Redis=require(_0x0140('0xd'));var authService=require(_0x0140('0xe'));var qs=require(_0x0140('0xf'));var as=require(_0x0140('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0140('0x11'));var config=require(_0x0140('0x12'));var licenseUtil=require(_0x0140('0x13'));var db=require(_0x0140('0x14'))['db'];function respondWithStatusCode(_0x2f3e1d,_0x3f221c){_0x3f221c=_0x3f221c||0xcc;return function(_0x1c9ee9){if(_0x1c9ee9){return _0x2f3e1d[_0x0140('0x15')](_0x3f221c);}return _0x2f3e1d[_0x0140('0x16')](_0x3f221c)['end']();};}function respondWithResult(_0x316b9e,_0x1d3ffb){_0x1d3ffb=_0x1d3ffb||0xc8;return function(_0x40a938){if(_0x40a938){return _0x316b9e['status'](_0x1d3ffb)[_0x0140('0x17')](_0x40a938);}};}function respondWithFilteredResult(_0x419548,_0x4d677b){return function(_0x45d377){if(_0x45d377){var _0x350f4f=typeof _0x4d677b['offset']===_0x0140('0x18')&&typeof _0x4d677b['limit']===_0x0140('0x18');var _0x4755b7=_0x45d377['count'];var _0x143c28=_0x350f4f?0x0:_0x4d677b[_0x0140('0x19')];var _0x572e98=_0x350f4f?_0x45d377[_0x0140('0x1a')]:_0x4d677b[_0x0140('0x19')]+_0x4d677b[_0x0140('0x1b')];var _0x48633d;if(_0x572e98>=_0x4755b7){_0x572e98=_0x4755b7;_0x48633d=0xc8;}else{_0x48633d=0xce;}_0x419548[_0x0140('0x16')](_0x48633d);return _0x419548[_0x0140('0x1c')](_0x0140('0x1d'),_0x143c28+'-'+_0x572e98+'/'+_0x4755b7)[_0x0140('0x17')](_0x45d377);}return null;};}function patchUpdates(_0x3ed80a){return function(_0x194e7d){try{jsonpatch['apply'](_0x194e7d,_0x3ed80a,!![]);}catch(_0x5e06a3){return BPromise[_0x0140('0x1e')](_0x5e06a3);}return _0x194e7d['save']();};}function saveUpdates(_0x1edef2,_0x39a459){return function(_0x1fa82f){if(_0x1fa82f){return _0x1fa82f['update'](_0x1edef2)['then'](function(_0x5b9122){return _0x5b9122;});}return null;};}function removeEntity(_0x517cec,_0x46a2d0){return function(_0x5d29ca){if(_0x5d29ca){return _0x5d29ca[_0x0140('0x1f')]()[_0x0140('0x20')](function(){_0x517cec[_0x0140('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393437,_0x1b7e1d){return function(_0x3344d1){if(!_0x3344d1){_0x393437[_0x0140('0x15')](0x194);}return _0x3344d1;};}function handleError(_0x264f41,_0xf8dc6){_0xf8dc6=_0xf8dc6||0x1f4;return function(_0x45a133){logger[_0x0140('0x21')](_0x45a133[_0x0140('0x22')]);if(_0x45a133['name']){delete _0x45a133[_0x0140('0x23')];}_0x264f41[_0x0140('0x16')](_0xf8dc6)[_0x0140('0x24')](_0x45a133);};}exports[_0x0140('0x25')]=function(_0x57b1b2,_0x1eac7b){var _0x41cab0={},_0x4b6692={},_0x2d4063={'count':0x0,'rows':[]};var _0x2b99f6=_['map'](db[_0x0140('0x26')]['rawAttributes'],function(_0x503012){return{'name':_0x503012[_0x0140('0x27')],'type':_0x503012[_0x0140('0x28')][_0x0140('0x29')]};});_0x4b6692[_0x0140('0x2a')]=_[_0x0140('0x2b')](_[_0x0140('0x2c')](_0x2b99f6,_0x0140('0x23')),[_0x0140('0x23')]);_0x4b6692[_0x0140('0x2d')]=_[_0x0140('0x2e')](_0x57b1b2[_0x0140('0x2d')]);_0x4b6692[_0x0140('0x2f')]=_[_0x0140('0x30')](_0x4b6692[_0x0140('0x2a')],_0x4b6692[_0x0140('0x2d')]);_0x41cab0[_0x0140('0x31')]=_[_0x0140('0x30')](_0x4b6692[_0x0140('0x2a')],qs['fields'](_0x57b1b2[_0x0140('0x2d')][_0x0140('0x32')]));_0x41cab0[_0x0140('0x31')]=_0x41cab0[_0x0140('0x31')][_0x0140('0x33')]?_0x41cab0[_0x0140('0x31')]:_0x4b6692[_0x0140('0x2a')];if(!_0x57b1b2[_0x0140('0x2d')][_0x0140('0x34')](_0x0140('0x35'))){_0x41cab0[_0x0140('0x1b')]=qs[_0x0140('0x1b')](_0x57b1b2[_0x0140('0x2d')]['limit']);_0x41cab0[_0x0140('0x19')]=qs[_0x0140('0x19')](_0x57b1b2[_0x0140('0x2d')][_0x0140('0x19')]);}_0x41cab0['order']=qs[_0x0140('0x36')](_0x57b1b2[_0x0140('0x2d')][_0x0140('0x36')]);_0x41cab0[_0x0140('0x37')]=qs['filters'](_['pick'](_0x57b1b2['query'],_0x4b6692['filters']),_0x2b99f6);if(_0x57b1b2[_0x0140('0x2d')][_0x0140('0x38')]){_0x41cab0['where']=_['merge'](_0x41cab0[_0x0140('0x37')],{'$or':_['map'](_0x2b99f6,function(_0x42b4e7){if(_0x42b4e7[_0x0140('0x28')]!==_0x0140('0x39')){var _0xc5d7ca={};_0xc5d7ca[_0x42b4e7[_0x0140('0x23')]]={'$like':'%'+_0x57b1b2[_0x0140('0x2d')][_0x0140('0x38')]+'%'};return _0xc5d7ca;}})});}_0x41cab0=_[_0x0140('0x3a')]({},_0x41cab0,_0x57b1b2[_0x0140('0x3b')]);var _0x211d1f={'where':_0x41cab0['where']};return db[_0x0140('0x26')]['count'](_0x211d1f)[_0x0140('0x20')](function(_0x55881e){_0x2d4063[_0x0140('0x1a')]=_0x55881e;if(_0x57b1b2[_0x0140('0x2d')][_0x0140('0x3c')]){_0x41cab0[_0x0140('0x3d')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x41cab0);})['then'](function(_0x3f8d01){_0x2d4063[_0x0140('0x3e')]=_0x3f8d01;return _0x2d4063;})[_0x0140('0x20')](respondWithFilteredResult(_0x1eac7b,_0x41cab0))[_0x0140('0x3f')](handleError(_0x1eac7b,null));};exports[_0x0140('0x40')]=function(_0x5957b1,_0x15a142){var _0xddfcb0={'raw':!![],'where':{'id':_0x5957b1[_0x0140('0x41')]['id']}},_0x3ec88d={};_0x3ec88d[_0x0140('0x2a')]=_[_0x0140('0x2e')](db['CmCustomField'][_0x0140('0x42')]);_0x3ec88d['query']=_[_0x0140('0x2e')](_0x5957b1['query']);_0x3ec88d['filters']=_[_0x0140('0x30')](_0x3ec88d['model'],_0x3ec88d[_0x0140('0x2d')]);_0xddfcb0[_0x0140('0x31')]=_[_0x0140('0x30')](_0x3ec88d['model'],qs[_0x0140('0x32')](_0x5957b1[_0x0140('0x2d')]['fields']));_0xddfcb0[_0x0140('0x31')]=_0xddfcb0[_0x0140('0x31')]['length']?_0xddfcb0[_0x0140('0x31')]:_0x3ec88d['model'];if(_0x5957b1[_0x0140('0x2d')][_0x0140('0x3c')]){_0xddfcb0['include']=[{'all':!![]}];}_0xddfcb0=_[_0x0140('0x3a')]({},_0xddfcb0,_0x5957b1[_0x0140('0x3b')]);return db[_0x0140('0x26')][_0x0140('0x43')](_0xddfcb0)[_0x0140('0x20')](handleEntityNotFound(_0x15a142,null))[_0x0140('0x20')](respondWithResult(_0x15a142,null))[_0x0140('0x3f')](handleError(_0x15a142,null));};exports[_0x0140('0x44')]=function(_0x52c64f,_0x1f38db){if(_0x52c64f[_0x0140('0x45')]['id']){delete _0x52c64f[_0x0140('0x45')]['id'];}return db['CmCustomField'][_0x0140('0x43')]({'where':{'id':_0x52c64f[_0x0140('0x41')]['id']}})[_0x0140('0x20')](handleEntityNotFound(_0x1f38db,null))['then'](saveUpdates(_0x52c64f[_0x0140('0x45')],null))[_0x0140('0x20')](respondWithResult(_0x1f38db,null))[_0x0140('0x3f')](handleError(_0x1f38db,null));};exports[_0x0140('0x1f')]=function(_0x57fdce,_0x4005a2){return db[_0x0140('0x26')][_0x0140('0x43')]({'where':{'id':_0x57fdce[_0x0140('0x41')]['id']}})['then'](handleEntityNotFound(_0x4005a2,null))[_0x0140('0x20')](removeEntity(_0x4005a2,null))[_0x0140('0x3f')](handleError(_0x4005a2,null));};exports[_0x0140('0x46')]=function(_0x24a825,_0xb80394){var _0x1ecfd1;return db['sequelize']['transaction'](function(_0xcbf84e){return db[_0x0140('0x26')][_0x0140('0x46')](_0x24a825[_0x0140('0x45')],{'transaction':_0xcbf84e})[_0x0140('0x20')](function(_0x3399b6){_0x1ecfd1=_0x3399b6;var _0x3f837c={'type':db[_0x0140('0x47')]['TEXT'],'transaction':_0xcbf84e};switch(_0x24a825['body'][_0x0140('0x28')]){case _0x0140('0x48'):_0x3f837c['type']=db[_0x0140('0x47')]['TEXT'];break;case'number':_0x3f837c[_0x0140('0x28')]=db[_0x0140('0x47')][_0x0140('0x49')];break;case'switch':_0x3f837c[_0x0140('0x28')]=db[_0x0140('0x47')][_0x0140('0x4a')];_0x3f837c[_0x0140('0x4b')]=![];break;default:}return db['sequelize'][_0x0140('0x4c')][_0x0140('0x4d')](_0x0140('0x4e'),util[_0x0140('0x4f')]('cf_%d',_0x1ecfd1['id']),_0x3f837c);})['then'](function(){return _0x1ecfd1;});})[_0x0140('0x20')](respondWithResult(_0xb80394,0xc9))[_0x0140('0x3f')](handleError(_0xb80394,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 3dfd47d..8bd71cd 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 _0x371f=['CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','define'];(function(_0x247ed6,_0x3a2005){var _0x2ad171=function(_0x218e04){while(--_0x218e04){_0x247ed6['push'](_0x247ed6['shift']());}};_0x2ad171(++_0x3a2005);}(_0x371f,0x13a));var _0xf371=function(_0x14d23a,_0x19f334){_0x14d23a=_0x14d23a-0x0;var _0x5afb61=_0x371f[_0x14d23a];return _0x5afb61;};'use strict';var _=require(_0xf371('0x0'));var util=require(_0xf371('0x1'));var logger=require(_0xf371('0x2'))(_0xf371('0x3'));var moment=require(_0xf371('0x4'));var BPromise=require('bluebird');var rp=require(_0xf371('0x5'));var fs=require('fs');var path=require(_0xf371('0x6'));var rimraf=require('rimraf');var config=require(_0xf371('0x7'));var attributes=require(_0xf371('0x8'));module['exports']=function(_0x2b424e,_0x2528c8){return _0x2b424e[_0xf371('0x9')](_0xf371('0xa'),attributes,{'tableName':_0xf371('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc786=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmCustomField','util','api'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0xc786,0x80));var _0x6c78=function(_0x230668,_0x392bbf){_0x230668=_0x230668-0x0;var _0x51fbd9=_0xc786[_0x230668];return _0x51fbd9;};'use strict';var _=require('lodash');var util=require(_0x6c78('0x0'));var logger=require('../../config/logger')(_0x6c78('0x1'));var moment=require(_0x6c78('0x2'));var BPromise=require(_0x6c78('0x3'));var rp=require(_0x6c78('0x4'));var fs=require('fs');var path=require(_0x6c78('0x5'));var rimraf=require(_0x6c78('0x6'));var config=require(_0x6c78('0x7'));var attributes=require('./cmCustomField.attributes');module[_0x6c78('0x8')]=function(_0x24b255,_0x4bc782){return _0x24b255['define'](_0x6c78('0x9'),attributes,{'tableName':'cm_custom_fields','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 753a016..958e839 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 _0xac36=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1f120c,_0x22cd8f){var _0x3f43f5=function(_0x2e6eef){while(--_0x2e6eef){_0x1f120c['push'](_0x1f120c['shift']());}};_0x3f43f5(++_0x22cd8f);}(_0xac36,0x177));var _0x6ac3=function(_0x3530b5,_0x323b72){_0x3530b5=_0x3530b5-0x0;var _0x2f63e5=_0xac36[_0x3530b5];return _0x2f63e5;};'use strict';var _=require('lodash');var util=require(_0x6ac3('0x0'));var moment=require(_0x6ac3('0x1'));var BPromise=require(_0x6ac3('0x2'));var rs=require(_0x6ac3('0x3'));var fs=require('fs');var Redis=require(_0x6ac3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ac3('0x5'))(_0x6ac3('0x6'));var config=require(_0x6ac3('0x7'));var jayson=require(_0x6ac3('0x8'));var client=jayson[_0x6ac3('0x9')][_0x6ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d922,_0x1adcd6,_0xfd4c0){return new BPromise(function(_0x4ad332,_0x1e8e84){return client['request'](_0x25d922,_0xfd4c0)[_0x6ac3('0xb')](function(_0x1c75aa){logger['info']('CmCustomField,\x20%s,\x20%s',_0x1adcd6,'request\x20sent');logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1adcd6,'request\x20sent',JSON[_0x6ac3('0xc')](_0x1c75aa));if(_0x1c75aa[_0x6ac3('0xd')]){if(_0x1c75aa[_0x6ac3('0xd')][_0x6ac3('0xe')]===0x1f4){logger[_0x6ac3('0xd')](_0x6ac3('0xf'),_0x1adcd6,_0x1c75aa[_0x6ac3('0xd')][_0x6ac3('0x10')]);return _0x1e8e84(_0x1c75aa['error']['message']);}logger[_0x6ac3('0xd')](_0x6ac3('0xf'),_0x1adcd6,_0x1c75aa[_0x6ac3('0xd')][_0x6ac3('0x10')]);return _0x4ad332(_0x1c75aa[_0x6ac3('0xd')][_0x6ac3('0x10')]);}else{logger[_0x6ac3('0x11')]('CmCustomField,\x20%s,\x20%s',_0x1adcd6,'request\x20sent');_0x4ad332(_0x1c75aa[_0x6ac3('0x12')]['message']);}})[_0x6ac3('0x13')](function(_0xf64456){logger['error']('CmCustomField,\x20%s,\x20%s',_0x1adcd6,_0xf64456);_0x1e8e84(_0xf64456);});});} \ No newline at end of file +var _0xf3ad=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1b0a23,_0xe0a7e){var _0x382e02=function(_0x2cc774){while(--_0x2cc774){_0x1b0a23['push'](_0x1b0a23['shift']());}};_0x382e02(++_0xe0a7e);}(_0xf3ad,0xee));var _0xdf3a=function(_0x5a4f20,_0x2d2a5a){_0x5a4f20=_0x5a4f20-0x0;var _0xe7f057=_0xf3ad[_0x5a4f20];return _0xe7f057;};'use strict';var _=require(_0xdf3a('0x0'));var util=require(_0xdf3a('0x1'));var moment=require(_0xdf3a('0x2'));var BPromise=require(_0xdf3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3a('0x5'));var logger=require(_0xdf3a('0x6'))(_0xdf3a('0x7'));var config=require(_0xdf3a('0x8'));var jayson=require(_0xdf3a('0x9'));var client=jayson[_0xdf3a('0xa')][_0xdf3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6414,_0x4b9f73,_0x224ee7){return new BPromise(function(_0x56abce,_0x310745){return client[_0xdf3a('0xc')](_0x1a6414,_0x224ee7)['then'](function(_0xd55057){logger['info'](_0xdf3a('0xd'),_0x4b9f73,_0xdf3a('0xe'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x4b9f73,'request\x20sent',JSON[_0xdf3a('0xf')](_0xd55057));if(_0xd55057[_0xdf3a('0x10')]){if(_0xd55057[_0xdf3a('0x10')][_0xdf3a('0x11')]===0x1f4){logger[_0xdf3a('0x10')](_0xdf3a('0xd'),_0x4b9f73,_0xd55057[_0xdf3a('0x10')][_0xdf3a('0x12')]);return _0x310745(_0xd55057[_0xdf3a('0x10')][_0xdf3a('0x12')]);}logger[_0xdf3a('0x10')](_0xdf3a('0xd'),_0x4b9f73,_0xd55057[_0xdf3a('0x10')]['message']);return _0x56abce(_0xd55057[_0xdf3a('0x10')][_0xdf3a('0x12')]);}else{logger[_0xdf3a('0x13')](_0xdf3a('0xd'),_0x4b9f73,_0xdf3a('0xe'));_0x56abce(_0xd55057[_0xdf3a('0x14')][_0xdf3a('0x12')]);}})[_0xdf3a('0x15')](function(_0x4a800f){logger[_0xdf3a('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4b9f73,_0x4a800f);_0x310745(_0x4a800f);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 606941e..54c9198 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 _0xdad2=['isAuthenticated','index','show','post','create','put','/:id','update','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x79cf27,_0x2d42ab){var _0x5729a4=function(_0x83bab0){while(--_0x83bab0){_0x79cf27['push'](_0x79cf27['shift']());}};_0x5729a4(++_0x2d42ab);}(_0xdad2,0x14c));var _0x2dad=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdad2[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require(_0x2dad('0x0'));var path=require(_0x2dad('0x1'));var timeout=require('connect-timeout');var express=require(_0x2dad('0x2'));var router=express[_0x2dad('0x3')]();var fs_extra=require(_0x2dad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2dad('0x5'));var config=require(_0x2dad('0x6'));var controller=require('./cmCustomField.controller');router[_0x2dad('0x7')]('/',auth[_0x2dad('0x8')](),controller[_0x2dad('0x9')]);router[_0x2dad('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2dad('0xa')]);router[_0x2dad('0xb')]('/',auth[_0x2dad('0x8')](),controller[_0x2dad('0xc')]);router[_0x2dad('0xd')](_0x2dad('0xe'),auth['isAuthenticated'](),controller[_0x2dad('0xf')]);router['delete'](_0x2dad('0xe'),auth[_0x2dad('0x8')](),controller['destroy']);module[_0x2dad('0x10')]=router; \ No newline at end of file +var _0x635c=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','util'];(function(_0x1af6cf,_0x4aaef5){var _0x5b2f29=function(_0x3344d1){while(--_0x3344d1){_0x1af6cf['push'](_0x1af6cf['shift']());}};_0x5b2f29(++_0x4aaef5);}(_0x635c,0xa1));var _0xc635=function(_0x42af89,_0x1bcbe9){_0x42af89=_0x42af89-0x0;var _0xf54f3=_0x635c[_0x42af89];return _0xf54f3;};'use strict';var multer=require('multer');var util=require(_0xc635('0x0'));var path=require(_0xc635('0x1'));var timeout=require(_0xc635('0x2'));var express=require(_0xc635('0x3'));var router=express['Router']();var fs_extra=require(_0xc635('0x4'));var auth=require(_0xc635('0x5'));var interaction=require(_0xc635('0x6'));var config=require(_0xc635('0x7'));var controller=require(_0xc635('0x8'));router[_0xc635('0x9')]('/',auth[_0xc635('0xa')](),controller['index']);router[_0xc635('0x9')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller['show']);router[_0xc635('0xc')]('/',auth[_0xc635('0xa')](),controller[_0xc635('0xd')]);router[_0xc635('0xe')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller[_0xc635('0xf')]);router[_0xc635('0x10')](_0xc635('0xb'),auth[_0xc635('0xa')](),controller['destroy']);module[_0xc635('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 308660b..f93b498 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 _0xe903=['INTEGER','DATE','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2c05b0,_0x4838ed){var _0x1be44d=function(_0x530e28){while(--_0x530e28){_0x2c05b0['push'](_0x2c05b0['shift']());}};_0x1be44d(++_0x4838ed);}(_0xe903,0x108));var _0x3e90=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xe903[_0xdc37a1];return _0x99b4fe;};'use strict';var moment=require(_0x3e90('0x0'));var Sequelize=require('sequelize');module[_0x3e90('0x1')]={'phone':{'type':Sequelize[_0x3e90('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x3e90('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x3e90('0x4')](_0x3e90('0x5'))},'countbusyretry':{'type':Sequelize[_0x3e90('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3e90('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3e90('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3e90('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e90('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3e90('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3e90('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x3e90('0x9')},'ListId':{'type':Sequelize[_0x3e90('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3e90('0x6')],'unique':_0x3e90('0x9')},'CampaignId':{'type':Sequelize[_0x3e90('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x3e90('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3e90('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3e90('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x3e90('0x7')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xf418=['INTEGER','BOOLEAN','contactListQueue','moment','exports','STRING','DATE','format'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf418,0x6b));var _0x8f41=function(_0x51517a,_0x5eb51f){_0x51517a=_0x51517a-0x0;var _0x15de83=_0xf418[_0x51517a];return _0x15de83;};'use strict';var moment=require(_0x8f41('0x0'));var Sequelize=require('sequelize');module[_0x8f41('0x1')]={'phone':{'type':Sequelize[_0x8f41('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8f41('0x3')],'defaultValue':moment()[_0x8f41('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8f41('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8f41('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8f41('0x3')]},'priority':{'type':Sequelize[_0x8f41('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8f41('0x5')],'unique':_0x8f41('0x7')},'ListId':{'type':Sequelize[_0x8f41('0x5')],'unique':_0x8f41('0x7')},'UserId':{'type':Sequelize[_0x8f41('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8f41('0x7')},'CampaignId':{'type':Sequelize[_0x8f41('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8f41('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x8f41('0x3')],'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 774b36f..4967260 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 _0x84e7=['literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','update','getPreviewRecall','recallme','LOCK','Contact','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','timezones','push','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','status','json','offset','undefined','count','limit','set','Content-Range','then','sendStatus','error','stack','send','index','map','CmHopper','rawAttributes','fieldName','type','query','keys','intersection','model','filters','$or','$gt','$lt','$ne','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','rows','show','includeAll','find','catch','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','name','omit','dataValues','createdAt','updatedAt','deleted','membername','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','priority','ASC','DESC'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x84e7,0x122));var _0x784e=function(_0x17b078,_0x1bc6a5){_0x17b078=_0x17b078-0x0;var _0x39f3ce=_0x84e7[_0x17b078];return _0x39f3ce;};'use strict';var moment=require('moment');var _=require(_0x784e('0x0'));var qs=require(_0x784e('0x1'));var logger=require('../../config/logger')(_0x784e('0x2'));var shared=require(_0x784e('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x45e3ad,_0x14cee2){_0x14cee2=_0x14cee2||0xc8;return function(_0x205619){if(_0x205619){return _0x45e3ad[_0x784e('0x4')](_0x14cee2)[_0x784e('0x5')](_0x205619);}};}function respondWithFilteredResult(_0x133296,_0x48ed22){return function(_0x3cbdd1){if(_0x3cbdd1){var _0x5d5595=typeof _0x48ed22[_0x784e('0x6')]===_0x784e('0x7')&&typeof _0x48ed22['limit']===_0x784e('0x7');var _0x46fda9=_0x3cbdd1[_0x784e('0x8')];var _0x3ddd55=_0x5d5595?0x0:_0x48ed22['offset'];var _0x4ae056=_0x5d5595?_0x3cbdd1[_0x784e('0x8')]:_0x48ed22[_0x784e('0x6')]+_0x48ed22[_0x784e('0x9')];var _0x2fd1b5;if(_0x4ae056>=_0x46fda9){_0x4ae056=_0x46fda9;_0x2fd1b5=0xc8;}else{_0x2fd1b5=0xce;}_0x133296['status'](_0x2fd1b5);return _0x133296[_0x784e('0xa')](_0x784e('0xb'),_0x3ddd55+'-'+_0x4ae056+'/'+_0x46fda9)[_0x784e('0x5')](_0x3cbdd1);}return null;};}function saveUpdates(_0x2c7227,_0x40e0d1){return function(_0x208d24){if(_0x208d24){return _0x208d24['update'](_0x2c7227)[_0x784e('0xc')](function(_0x5177e4){return _0x5177e4;});}return null;};}function handleEntityNotFound(_0x172697,_0x1f6ede){return function(_0x41f993){if(!_0x41f993){_0x172697[_0x784e('0xd')](0x194);}return _0x41f993;};}function handleError(_0x31a8cc,_0x46bd33){_0x46bd33=_0x46bd33||0x1f4;return function(_0x947397){logger[_0x784e('0xe')](_0x947397[_0x784e('0xf')]);if(_0x947397['name']){delete _0x947397['name'];}_0x31a8cc[_0x784e('0x4')](_0x46bd33)[_0x784e('0x10')](_0x947397);};}exports[_0x784e('0x11')]=function(_0x25281f,_0x3ac83){var _0x19072b={},_0x1dc568={},_0x504ebf={'count':0x0,'rows':[]};var _0x2524d0=_[_0x784e('0x12')](db[_0x784e('0x13')][_0x784e('0x14')],function(_0x440cd6){return{'name':_0x440cd6[_0x784e('0x15')],'type':_0x440cd6[_0x784e('0x16')]['key']};});_0x1dc568['model']=_[_0x784e('0x12')](_0x2524d0,'name');_0x1dc568[_0x784e('0x17')]=_[_0x784e('0x18')](_0x25281f['query']);_0x1dc568['filters']=_[_0x784e('0x19')](_0x1dc568[_0x784e('0x1a')],_0x1dc568[_0x784e('0x17')]);_0x1dc568[_0x784e('0x1b')]=_['concat'](_0x1dc568['filters'],['$and',_0x784e('0x1c'),_0x784e('0x1d'),'$gte',_0x784e('0x1e'),'$lte',_0x784e('0x1f'),'$eq',_0x784e('0x20'),_0x784e('0x21'),_0x784e('0x22'),_0x784e('0x23'),'$notIn',_0x784e('0x24'),_0x784e('0x25'),_0x784e('0x26'),_0x784e('0x27'),'$like',_0x784e('0x28'),_0x784e('0x29'),'$contained','$any']);_0x19072b[_0x784e('0x2a')]=_[_0x784e('0x19')](_0x1dc568[_0x784e('0x1a')],qs[_0x784e('0x2b')](_0x25281f[_0x784e('0x17')][_0x784e('0x2b')]));_0x19072b[_0x784e('0x2a')]=_0x19072b[_0x784e('0x2a')][_0x784e('0x2c')]?_0x19072b[_0x784e('0x2a')]:_0x1dc568[_0x784e('0x1a')];if(!_0x25281f[_0x784e('0x17')][_0x784e('0x2d')](_0x784e('0x2e'))){_0x19072b[_0x784e('0x9')]=qs['limit'](_0x25281f[_0x784e('0x17')]['limit']);_0x19072b[_0x784e('0x6')]=qs[_0x784e('0x6')](_0x25281f[_0x784e('0x17')]['offset']);}_0x19072b[_0x784e('0x2f')]=qs['sort'](_0x25281f[_0x784e('0x17')][_0x784e('0x30')]);_0x19072b['where']=qs[_0x784e('0x1b')](_[_0x784e('0x31')](_0x25281f['query'],_0x1dc568['filters']),_0x2524d0);if(_0x25281f[_0x784e('0x17')][_0x784e('0x32')]){_0x19072b[_0x784e('0x33')]=_[_0x784e('0x34')](_0x19072b[_0x784e('0x33')],{'$or':_['map'](_0x2524d0,function(_0x23f42d){if(_0x23f42d[_0x784e('0x16')]!=='VIRTUAL'){var _0x3c95da={};_0x3c95da[_0x23f42d['name']]={'$like':'%'+_0x25281f['query']['filter']+'%'};return _0x3c95da;}})});}_0x19072b=_[_0x784e('0x34')]({},_0x19072b,_0x25281f[_0x784e('0x35')]);var _0x5aa239={'where':_0x19072b[_0x784e('0x33')]};return db[_0x784e('0x13')][_0x784e('0x8')](_0x5aa239)[_0x784e('0xc')](function(_0x1351ef){_0x504ebf[_0x784e('0x8')]=_0x1351ef;if(_0x25281f['query']['includeAll']){_0x19072b[_0x784e('0x36')]=[{'all':!![]}];}return db[_0x784e('0x13')]['findAll'](_0x19072b);})['then'](function(_0x48afec){_0x504ebf[_0x784e('0x37')]=_0x48afec;return _0x504ebf;})[_0x784e('0xc')](respondWithFilteredResult(_0x3ac83,_0x19072b))['catch'](handleError(_0x3ac83,null));};exports[_0x784e('0x38')]=function(_0x2b8dbc,_0x35f85c){var _0x49e82a={'raw':!![],'where':{'id':_0x2b8dbc['params']['id']}},_0x2be8da={};_0x2be8da[_0x784e('0x1a')]=_['keys'](db[_0x784e('0x13')][_0x784e('0x14')]);_0x2be8da['query']=_['keys'](_0x2b8dbc[_0x784e('0x17')]);_0x2be8da[_0x784e('0x1b')]=_[_0x784e('0x19')](_0x2be8da['model'],_0x2be8da[_0x784e('0x17')]);_0x49e82a[_0x784e('0x2a')]=_[_0x784e('0x19')](_0x2be8da[_0x784e('0x1a')],qs['fields'](_0x2b8dbc[_0x784e('0x17')][_0x784e('0x2b')]));_0x49e82a['attributes']=_0x49e82a['attributes'][_0x784e('0x2c')]?_0x49e82a[_0x784e('0x2a')]:_0x2be8da[_0x784e('0x1a')];if(_0x2b8dbc[_0x784e('0x17')][_0x784e('0x39')]){_0x49e82a['include']=[{'all':!![]}];}_0x49e82a=_['merge']({},_0x49e82a,_0x2b8dbc['options']);return db[_0x784e('0x13')][_0x784e('0x3a')](_0x49e82a)[_0x784e('0xc')](handleEntityNotFound(_0x35f85c,null))[_0x784e('0xc')](respondWithResult(_0x35f85c,null))[_0x784e('0x3b')](handleError(_0x35f85c,null));};exports['create']=function(_0x50fbae,_0x507e5a){return db[_0x784e('0x13')][_0x784e('0x3c')](_0x50fbae['body'],{})[_0x784e('0xc')](respondWithResult(_0x507e5a,0xc9))[_0x784e('0x3b')](handleError(_0x507e5a,null));};exports['update']=function(_0x174aee,_0x329925){if(_0x174aee[_0x784e('0x3d')]['id']){delete _0x174aee[_0x784e('0x3d')]['id'];}return db[_0x784e('0x13')][_0x784e('0x3a')]({'where':{'id':_0x174aee[_0x784e('0x3e')]['id']}})[_0x784e('0xc')](handleEntityNotFound(_0x329925,null))['then'](saveUpdates(_0x174aee[_0x784e('0x3d')],null))[_0x784e('0xc')](respondWithResult(_0x329925,null))['catch'](handleError(_0x329925,null));};exports[_0x784e('0x3f')]=function(_0x473e63,_0x3bfafc){return db[_0x784e('0x13')][_0x784e('0x3f')]()[_0x784e('0xc')](respondWithResult(_0x3bfafc,null))[_0x784e('0x3b')](handleError(_0x3bfafc,null));};exports[_0x784e('0x40')]=function(_0x52438e,_0x1aded3){var _0x5a2696;var _0x1b9579=_0x52438e[_0x784e('0x3e')]['id'];return db['CmHopper']['find']({'where':{'id':_0x52438e[_0x784e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1aded3,null))[_0x784e('0xc')](function(_0x52f7a6){if(_0x52f7a6){return _0x52f7a6[_0x784e('0x40')]()[_0x784e('0xc')](function(_0x45d046){return _0x45d046;});}})[_0x784e('0xc')](function(_0x553e79){_0x5a2696=_0x553e79;if(_0x553e79){if(_0x553e79['VoiceQueueId']||_0x553e79[_0x784e('0x41')]){return db[_0x553e79[_0x784e('0x42')]?_0x784e('0x43'):_0x784e('0x44')][_0x784e('0x3a')]({'where':{'id':_0x553e79['VoiceQueueId']?_0x553e79['VoiceQueueId']:_0x553e79[_0x784e('0x41')]},'attributes':['id',_0x784e('0x45')],'raw':!![]});}}})['then'](function(_0x43f4f9){var _0x2a9456={};if(_0x43f4f9){_['merge'](_0x2a9456,_[_0x784e('0x46')](_0x5a2696[_0x784e('0x47')],[_0x784e('0x48'),_0x784e('0x49'),'id']));_0x2a9456['state']=0x15;_0x2a9456['statedesc']=_0x784e('0x4a');_0x2a9456['campaign']=_0x43f4f9['name'];_0x2a9456[_0x784e('0x4b')]=_0x52438e[_0x784e('0x4c')][_0x784e('0x45')];_0x2a9456[_0x784e('0x4d')]=_0x52438e[_0x784e('0x4c')]['id'];_0x2a9456[_0x784e('0x4a')]=!![];_0x2a9456[_0x784e('0x4e')]=moment()['format'](_0x784e('0x4f'));_0x2a9456[_0x784e('0x50')]=_0x5a2696['phone'];_0x2a9456['campaigntype']=_0x5a2696['VoiceQueueId']?_0x784e('0x51'):_0x784e('0x52');return db[_0x784e('0x53')][_0x784e('0x3a')]({'where':{'id':_0x2a9456[_0x784e('0x54')]},'attributes':['firstName',_0x784e('0x55')]})[_0x784e('0xc')](function(_0x13a1bf){if(!_[_0x784e('0x56')](_0x1aded3)&&!_['isNil'](_0x13a1bf[_0x784e('0x57')])){_0x2a9456['calleridname']=_0x13a1bf[_0x784e('0x57')];if(!_[_0x784e('0x56')](_0x13a1bf[_0x784e('0x55')])){_0x2a9456[_0x784e('0x58')]+='\x20'+_0x13a1bf[_0x784e('0x55')];}}})[_0x784e('0x59')](function(){return db['CmHopperFinal'][_0x784e('0x3c')](_0x2a9456);});}})['then'](function(_0x420f13){return db[_0x784e('0x5a')][_0x784e('0x40')]({'where':{'CmHopperId':_0x1b9579}});})[_0x784e('0xc')](function(){return _0x1aded3[_0x784e('0x4')](0xcc)[_0x784e('0x5b')]();})[_0x784e('0x3b')](handleError(_0x1aded3,null));};exports[_0x784e('0x5c')]=function(_0x40375d,_0xb848ea){var _0x38813b=[];return db[_0x784e('0x53')][_0x784e('0x3f')]()[_0x784e('0xc')](function(_0x314c9a){_0x38813b=_[_0x784e('0x18')](_0x314c9a);return _0x40375d[_0x784e('0x4c')][_0x784e('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x784e('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x784e('0x5f')],'raw':!![]});})['then'](function(_0x3236e8){if(_0x3236e8&&_0x3236e8[_0x784e('0x2c')]){return db[_0x784e('0x60')][_0x784e('0x61')](function(_0x68a021){var _0x4eb6f3={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x784e('0x62')](_0x784e('0x4f'))},'VoiceQueueId':{'$in':_[_0x784e('0x12')](_0x3236e8,'id')},'$or':[{'UserId':null},{'UserId':_0x40375d['user']['id']}]};var _0x4c034d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3236e8)[_0x784e('0x32')]([_0x784e('0x5f'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x40375d['user']['id']}]};var _0x21f26e={'$or':[_0x4eb6f3,_0x4c034d]};var _0x36ae65=[];if(_0x40375d[_0x784e('0x3d')][_0x784e('0x63')]&&_0x40375d[_0x784e('0x3d')]['direction']===_0x784e('0x64')){if(!_[_0x784e('0x65')](_0x40375d[_0x784e('0x3d')][_0x784e('0x66')])){_0x21f26e['id']={'$in':_0x40375d[_0x784e('0x3d')][_0x784e('0x66')]};}_0x36ae65=[[_0x784e('0x67'),_0x784e('0x68')],['scheduledAt',_0x3236e8[0x0]['dialOrderByScheduledAt']===_0x784e('0x68')?_0x784e('0x69'):'ASC'],db[_0x784e('0x60')][_0x784e('0x6a')](_0x784e('0x6b')),['id',_0x784e('0x69')]];}else{if(!_['isEmpty'](_0x40375d[_0x784e('0x3d')][_0x784e('0x66')])){_0x21f26e['id']={'$notIn':_0x40375d[_0x784e('0x3d')][_0x784e('0x66')]};}_0x36ae65=[['priority','DESC'],['scheduledAt',_0x3236e8[0x0][_0x784e('0x6c')]],db['sequelize']['literal'](_0x784e('0x6d')),['id','ASC']];}return db['CmHopper'][_0x784e('0x6e')]({'attributes':['id',_0x784e('0x6f'),'phone','recallme'],'where':_0x21f26e,'order':_0x36ae65,'transaction':_0x68a021,'lock':_0x68a021['LOCK'][_0x784e('0x70')],'include':[{'model':db[_0x784e('0x53')],'as':'Contact','attributes':_0x38813b,'include':[{'model':db[_0x784e('0x71')],'as':_0x784e('0x72'),'attributes':['id',_0x784e('0x45')]}]},{'model':db[_0x784e('0x73')],'as':_0x784e('0x74'),'attributes':['id','name']},{'model':db[_0x784e('0x43')],'as':_0x784e('0x75'),'attributes':['id','name',_0x784e('0x76')]}]})[_0x784e('0xc')](function(_0x3af80d){if(_0x3af80d){return _0x3af80d[_0x784e('0x77')]({'UserId':_0x40375d['user']['id']},{'transaction':_0x68a021});}});});}})[_0x784e('0xc')](handleEntityNotFound(_0xb848ea,null))['then'](respondWithResult(_0xb848ea,null))[_0x784e('0x3b')](handleError(_0xb848ea,null));};exports[_0x784e('0x78')]=function(_0x3811f7,_0x57caf6,_0x3328d7){var _0x3f09cd=[];var _0x1f7907=_0x3811f7['params']['id'];var _0x3abaa2=_0x3811f7[_0x784e('0x4c')]['id'];return db[_0x784e('0x53')][_0x784e('0x3f')]()[_0x784e('0xc')](function(_0x570cc2){_0x3f09cd=_[_0x784e('0x18')](_0x570cc2);return db[_0x784e('0x60')]['transaction'](function(_0x4a2c67){const _0x3882c4={'id':_0x1f7907};return db[_0x784e('0x13')][_0x784e('0x6e')]({'attributes':['id','scheduledat',_0x784e('0x79')],'where':_0x3882c4,'transaction':_0x4a2c67,'lock':_0x4a2c67[_0x784e('0x7a')][_0x784e('0x70')],'include':[{'model':db[_0x784e('0x53')],'as':_0x784e('0x7b'),'attributes':_0x3f09cd,'include':[{'model':db[_0x784e('0x71')],'as':_0x784e('0x72'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0x784e('0x74'),'attributes':['id','name']},{'model':db[_0x784e('0x43')],'as':_0x784e('0x75'),'attributes':['id',_0x784e('0x45'),'dialActive']}]})[_0x784e('0xc')](function(_0x3cb59b){if(_0x3cb59b){return _0x3cb59b[_0x784e('0x77')]({'UserId':_0x3abaa2},{'transaction':_0x4a2c67});}});});})[_0x784e('0xc')](handleEntityNotFound(_0x57caf6,null))[_0x784e('0xc')](respondWithResult(_0x57caf6,null))[_0x784e('0x3b')](handleError(_0x57caf6,null));};exports[_0x784e('0x7c')]=function(_0x13f03a,_0x464aeb){return _0x13f03a[_0x784e('0x4c')][_0x784e('0x5d')]({'where':{'type':_0x784e('0x7d'),'dialActive':!![],'dialMethod':_0x784e('0x5e')},'attributes':['id'],'raw':!![]})[_0x784e('0xc')](function(_0x127ad7){if(_0x127ad7&&_0x127ad7[_0x784e('0x2c')]){return db[_0x784e('0x13')][_0x784e('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x784e('0x62')](_0x784e('0x4f'))},'VoiceQueueId':{'$in':_[_0x784e('0x12')](_0x127ad7,'id')},'$or':[{'UserId':null},{'UserId':_0x13f03a['user']['id']}]}});}return 0x0;})[_0x784e('0xc')](function(_0x9f09e7){if(!_[_0x784e('0x56')](_0x9f09e7)&&_[_0x784e('0x7e')](_0x9f09e7)){return _0x464aeb[_0x784e('0x4')](0xc8)[_0x784e('0x5')]({'contacts':_0x9f09e7});}else{logger['error'](_0x784e('0x7f'),'getOpenContacts',0x194,_0x784e('0x80'));_0x464aeb['sendStatus'](0x194);}})['catch'](handleError(_0x464aeb,null));};exports['getTimezones']=function(_0x37cc24,_0x610060){var _0x21fb2c=shared[_0x784e('0x81')];var _0x11c957=[];_[_0x784e('0x12')](_0x21fb2c,function(_0x5ed28c){_0x11c957[_0x784e('0x82')]({'id':_0x5ed28c[_0x784e('0x45')],'name':_0x5ed28c[_0x784e('0x45')],'utcOffset':_0x5ed28c['utcOffset']});});return _0x610060[_0x784e('0x4')](0xc8)[_0x784e('0x5')]({'tz':_0x11c957});};exports[_0x784e('0x83')]=function(_0x1f9151,_0x13764d){var _0x275b00=shared[_0x784e('0x81')];var _0x4f77ef={};if(!_['isNil'](_0x275b00[_0x1f9151[_0x784e('0x3d')]['id']]))_0x4f77ef=_0x275b00[_0x1f9151[_0x784e('0x3d')]['id']];return _0x13764d[_0x784e('0x4')](0xc8)[_0x784e('0x5')](_0x4f77ef);}; \ No newline at end of file +var _0xb205=['$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','CmHopper','intersection','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','state','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','lastName','isNil','calleridname','firstName','finally','end','getPreview','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','Contact','getOpenContacts','getVoiceQueues','outbound','isNumber','json','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','status','offset','undefined','count','set','update','then','sendStatus','name','send','index','map','rawAttributes','type','key','model','query','concat','filters','$and','$or','$gt','$gte'];(function(_0x6f033,_0x44cd29){var _0x44c23e=function(_0x385b5e){while(--_0x385b5e){_0x6f033['push'](_0x6f033['shift']());}};_0x44c23e(++_0x44cd29);}(_0xb205,0xf0));var _0x5b20=function(_0x435f3a,_0x9ebf77){_0x435f3a=_0x435f3a-0x0;var _0x2075fa=_0xb205[_0x435f3a];return _0x2075fa;};'use strict';var moment=require(_0x5b20('0x0'));var _=require(_0x5b20('0x1'));var qs=require(_0x5b20('0x2'));var logger=require(_0x5b20('0x3'))(_0x5b20('0x4'));var shared=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithResult(_0x37fe91,_0x573200){_0x573200=_0x573200||0xc8;return function(_0x17046a){if(_0x17046a){return _0x37fe91[_0x5b20('0x5')](_0x573200)['json'](_0x17046a);}};}function respondWithFilteredResult(_0x3206cd,_0x29d926){return function(_0x364e48){if(_0x364e48){var _0x5c1ff9=typeof _0x29d926[_0x5b20('0x6')]===_0x5b20('0x7')&&typeof _0x29d926['limit']==='undefined';var _0x2b5b5f=_0x364e48[_0x5b20('0x8')];var _0x36ef1b=_0x5c1ff9?0x0:_0x29d926[_0x5b20('0x6')];var _0xe0246d=_0x5c1ff9?_0x364e48[_0x5b20('0x8')]:_0x29d926[_0x5b20('0x6')]+_0x29d926['limit'];var _0xdec7cd;if(_0xe0246d>=_0x2b5b5f){_0xe0246d=_0x2b5b5f;_0xdec7cd=0xc8;}else{_0xdec7cd=0xce;}_0x3206cd[_0x5b20('0x5')](_0xdec7cd);return _0x3206cd[_0x5b20('0x9')]('Content-Range',_0x36ef1b+'-'+_0xe0246d+'/'+_0x2b5b5f)['json'](_0x364e48);}return null;};}function saveUpdates(_0x2a13ac,_0x374632){return function(_0xf721a0){if(_0xf721a0){return _0xf721a0[_0x5b20('0xa')](_0x2a13ac)[_0x5b20('0xb')](function(_0x4c76d8){return _0x4c76d8;});}return null;};}function handleEntityNotFound(_0x42fbb0,_0x32c2df){return function(_0x180185){if(!_0x180185){_0x42fbb0[_0x5b20('0xc')](0x194);}return _0x180185;};}function handleError(_0x519f9f,_0x5247f9){_0x5247f9=_0x5247f9||0x1f4;return function(_0x25b9ab){logger['error'](_0x25b9ab['stack']);if(_0x25b9ab[_0x5b20('0xd')]){delete _0x25b9ab['name'];}_0x519f9f[_0x5b20('0x5')](_0x5247f9)[_0x5b20('0xe')](_0x25b9ab);};}exports[_0x5b20('0xf')]=function(_0x498986,_0x44ac15){var _0x301c9a={},_0x3e37ef={},_0x43199f={'count':0x0,'rows':[]};var _0x4aca0f=_[_0x5b20('0x10')](db['CmHopper'][_0x5b20('0x11')],function(_0x30da3b){return{'name':_0x30da3b['fieldName'],'type':_0x30da3b[_0x5b20('0x12')][_0x5b20('0x13')]};});_0x3e37ef[_0x5b20('0x14')]=_['map'](_0x4aca0f,_0x5b20('0xd'));_0x3e37ef[_0x5b20('0x15')]=_['keys'](_0x498986[_0x5b20('0x15')]);_0x3e37ef['filters']=_['intersection'](_0x3e37ef[_0x5b20('0x14')],_0x3e37ef['query']);_0x3e37ef['filters']=_[_0x5b20('0x16')](_0x3e37ef[_0x5b20('0x17')],[_0x5b20('0x18'),_0x5b20('0x19'),_0x5b20('0x1a'),_0x5b20('0x1b'),_0x5b20('0x1c'),_0x5b20('0x1d'),'$ne',_0x5b20('0x1e'),_0x5b20('0x1f'),_0x5b20('0x20'),_0x5b20('0x21'),_0x5b20('0x22'),_0x5b20('0x23'),'$like',_0x5b20('0x24'),'$iLike',_0x5b20('0x25'),_0x5b20('0x26'),_0x5b20('0x27'),'$contains','$contained',_0x5b20('0x28')]);_0x301c9a[_0x5b20('0x29')]=_['intersection'](_0x3e37ef['model'],qs[_0x5b20('0x2a')](_0x498986['query'][_0x5b20('0x2a')]));_0x301c9a[_0x5b20('0x29')]=_0x301c9a[_0x5b20('0x29')][_0x5b20('0x2b')]?_0x301c9a['attributes']:_0x3e37ef[_0x5b20('0x14')];if(!_0x498986[_0x5b20('0x15')][_0x5b20('0x2c')](_0x5b20('0x2d'))){_0x301c9a['limit']=qs[_0x5b20('0x2e')](_0x498986[_0x5b20('0x15')][_0x5b20('0x2e')]);_0x301c9a[_0x5b20('0x6')]=qs[_0x5b20('0x6')](_0x498986[_0x5b20('0x15')][_0x5b20('0x6')]);}_0x301c9a[_0x5b20('0x2f')]=qs[_0x5b20('0x30')](_0x498986[_0x5b20('0x15')][_0x5b20('0x30')]);_0x301c9a[_0x5b20('0x31')]=qs[_0x5b20('0x17')](_[_0x5b20('0x32')](_0x498986[_0x5b20('0x15')],_0x3e37ef['filters']),_0x4aca0f);if(_0x498986['query']['filter']){_0x301c9a[_0x5b20('0x31')]=_[_0x5b20('0x33')](_0x301c9a[_0x5b20('0x31')],{'$or':_[_0x5b20('0x10')](_0x4aca0f,function(_0x5d3e95){if(_0x5d3e95['type']!==_0x5b20('0x34')){var _0x1c8ed6={};_0x1c8ed6[_0x5d3e95[_0x5b20('0xd')]]={'$like':'%'+_0x498986[_0x5b20('0x15')][_0x5b20('0x35')]+'%'};return _0x1c8ed6;}})});}_0x301c9a=_[_0x5b20('0x33')]({},_0x301c9a,_0x498986[_0x5b20('0x36')]);var _0x4f117d={'where':_0x301c9a['where']};return db['CmHopper'][_0x5b20('0x8')](_0x4f117d)[_0x5b20('0xb')](function(_0x29c731){_0x43199f[_0x5b20('0x8')]=_0x29c731;if(_0x498986[_0x5b20('0x15')][_0x5b20('0x37')]){_0x301c9a['include']=[{'all':!![]}];}return db['CmHopper'][_0x5b20('0x38')](_0x301c9a);})[_0x5b20('0xb')](function(_0x53abbf){_0x43199f[_0x5b20('0x39')]=_0x53abbf;return _0x43199f;})[_0x5b20('0xb')](respondWithFilteredResult(_0x44ac15,_0x301c9a))[_0x5b20('0x3a')](handleError(_0x44ac15,null));};exports[_0x5b20('0x3b')]=function(_0x368990,_0x1899e1){var _0x1e047b={'raw':!![],'where':{'id':_0x368990[_0x5b20('0x3c')]['id']}},_0x426ad4={};_0x426ad4[_0x5b20('0x14')]=_[_0x5b20('0x3d')](db[_0x5b20('0x3e')]['rawAttributes']);_0x426ad4[_0x5b20('0x15')]=_[_0x5b20('0x3d')](_0x368990[_0x5b20('0x15')]);_0x426ad4[_0x5b20('0x17')]=_[_0x5b20('0x3f')](_0x426ad4[_0x5b20('0x14')],_0x426ad4[_0x5b20('0x15')]);_0x1e047b[_0x5b20('0x29')]=_[_0x5b20('0x3f')](_0x426ad4[_0x5b20('0x14')],qs[_0x5b20('0x2a')](_0x368990[_0x5b20('0x15')][_0x5b20('0x2a')]));_0x1e047b[_0x5b20('0x29')]=_0x1e047b[_0x5b20('0x29')][_0x5b20('0x2b')]?_0x1e047b[_0x5b20('0x29')]:_0x426ad4[_0x5b20('0x14')];if(_0x368990[_0x5b20('0x15')][_0x5b20('0x37')]){_0x1e047b[_0x5b20('0x40')]=[{'all':!![]}];}_0x1e047b=_[_0x5b20('0x33')]({},_0x1e047b,_0x368990[_0x5b20('0x36')]);return db[_0x5b20('0x3e')][_0x5b20('0x41')](_0x1e047b)[_0x5b20('0xb')](handleEntityNotFound(_0x1899e1,null))[_0x5b20('0xb')](respondWithResult(_0x1899e1,null))['catch'](handleError(_0x1899e1,null));};exports[_0x5b20('0x42')]=function(_0x407467,_0x852527){return db[_0x5b20('0x3e')][_0x5b20('0x42')](_0x407467[_0x5b20('0x43')],{})[_0x5b20('0xb')](respondWithResult(_0x852527,0xc9))['catch'](handleError(_0x852527,null));};exports[_0x5b20('0xa')]=function(_0x2c47a6,_0x33c6d9){if(_0x2c47a6[_0x5b20('0x43')]['id']){delete _0x2c47a6[_0x5b20('0x43')]['id'];}return db[_0x5b20('0x3e')][_0x5b20('0x41')]({'where':{'id':_0x2c47a6['params']['id']}})[_0x5b20('0xb')](handleEntityNotFound(_0x33c6d9,null))[_0x5b20('0xb')](saveUpdates(_0x2c47a6['body'],null))[_0x5b20('0xb')](respondWithResult(_0x33c6d9,null))[_0x5b20('0x3a')](handleError(_0x33c6d9,null));};exports['describe']=function(_0x2b726c,_0x365af7){return db[_0x5b20('0x3e')][_0x5b20('0x44')]()[_0x5b20('0xb')](respondWithResult(_0x365af7,null))[_0x5b20('0x3a')](handleError(_0x365af7,null));};exports[_0x5b20('0x45')]=function(_0x36c204,_0x58bd13){var _0xbb6a0b;var _0x1e84ff=_0x36c204[_0x5b20('0x3c')]['id'];return db[_0x5b20('0x3e')][_0x5b20('0x41')]({'where':{'id':_0x36c204[_0x5b20('0x3c')]['id']}})['then'](handleEntityNotFound(_0x58bd13,null))[_0x5b20('0xb')](function(_0x220ff7){if(_0x220ff7){return _0x220ff7['destroy']()[_0x5b20('0xb')](function(_0x48d5f2){return _0x48d5f2;});}})[_0x5b20('0xb')](function(_0x3c224d){_0xbb6a0b=_0x3c224d;if(_0x3c224d){if(_0x3c224d[_0x5b20('0x46')]||_0x3c224d[_0x5b20('0x47')]){return db[_0x3c224d['VoiceQueueId']?_0x5b20('0x48'):_0x5b20('0x49')][_0x5b20('0x41')]({'where':{'id':_0x3c224d[_0x5b20('0x46')]?_0x3c224d[_0x5b20('0x46')]:_0x3c224d[_0x5b20('0x47')]},'attributes':['id',_0x5b20('0xd')],'raw':!![]});}}})['then'](function(_0x55fc94){var _0x2699bf={};if(_0x55fc94){_[_0x5b20('0x33')](_0x2699bf,_[_0x5b20('0x4a')](_0xbb6a0b['dataValues'],[_0x5b20('0x4b'),_0x5b20('0x4c'),'id']));_0x2699bf[_0x5b20('0x4d')]=0x15;_0x2699bf['statedesc']=_0x5b20('0x4e');_0x2699bf[_0x5b20('0x4f')]=_0x55fc94[_0x5b20('0xd')];_0x2699bf['membername']=_0x36c204[_0x5b20('0x50')]['name'];_0x2699bf[_0x5b20('0x51')]=_0x36c204[_0x5b20('0x50')]['id'];_0x2699bf[_0x5b20('0x4e')]=!![];_0x2699bf[_0x5b20('0x52')]=moment()['format'](_0x5b20('0x53'));_0x2699bf['calleridnum']=_0xbb6a0b[_0x5b20('0x54')];_0x2699bf['campaigntype']=_0xbb6a0b['VoiceQueueId']?_0x5b20('0x55'):_0x5b20('0x56');return db[_0x5b20('0x57')][_0x5b20('0x41')]({'where':{'id':_0x2699bf['ContactId']},'attributes':['firstName',_0x5b20('0x58')]})[_0x5b20('0xb')](function(_0x1cca2c){if(!_[_0x5b20('0x59')](_0x58bd13)&&!_[_0x5b20('0x59')](_0x1cca2c['firstName'])){_0x2699bf[_0x5b20('0x5a')]=_0x1cca2c[_0x5b20('0x5b')];if(!_[_0x5b20('0x59')](_0x1cca2c[_0x5b20('0x58')])){_0x2699bf[_0x5b20('0x5a')]+='\x20'+_0x1cca2c[_0x5b20('0x58')];}}})[_0x5b20('0x5c')](function(){return db['CmHopperFinal'][_0x5b20('0x42')](_0x2699bf);});}})[_0x5b20('0xb')](function(_0x2a9ca9){return db['CmHopperAdditionalPhone'][_0x5b20('0x45')]({'where':{'CmHopperId':_0x1e84ff}});})[_0x5b20('0xb')](function(){return _0x58bd13[_0x5b20('0x5')](0xcc)[_0x5b20('0x5d')]();})['catch'](handleError(_0x58bd13,null));};exports[_0x5b20('0x5e')]=function(_0x301a89,_0x404f87){var _0x290ddb=[];return db[_0x5b20('0x57')]['describe']()['then'](function(_0x4d4f17){_0x290ddb=_['keys'](_0x4d4f17);return _0x301a89['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x5b20('0x5f')},'attributes':['id',_0x5b20('0x60'),_0x5b20('0x61')],'raw':!![]});})[_0x5b20('0xb')](function(_0x500a58){if(_0x500a58&&_0x500a58['length']){return db[_0x5b20('0x62')][_0x5b20('0x63')](function(_0x2db7a7){var _0xb1a217={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x5b20('0x10')](_0x500a58,'id')},'$or':[{'UserId':null},{'UserId':_0x301a89[_0x5b20('0x50')]['id']}]};var _0x42e992={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x500a58)[_0x5b20('0x35')](['dialPreviewAutoRecallMe',0x0])[_0x5b20('0x10')]('id')[_0x5b20('0x64')]()},'$or':[{'UserId':null},{'UserId':_0x301a89['user']['id']}]};var _0xa346dc={'$or':[_0xb1a217,_0x42e992]};var _0x3015dd=[];if(_0x301a89[_0x5b20('0x43')][_0x5b20('0x65')]&&_0x301a89[_0x5b20('0x43')]['direction']===_0x5b20('0x66')){if(!_[_0x5b20('0x67')](_0x301a89[_0x5b20('0x43')][_0x5b20('0x68')])){_0xa346dc['id']={'$in':_0x301a89[_0x5b20('0x43')]['hopperIds']};}_0x3015dd=[[_0x5b20('0x69'),_0x5b20('0x6a')],[_0x5b20('0x6b'),_0x500a58[0x0][_0x5b20('0x60')]===_0x5b20('0x6a')?_0x5b20('0x6c'):_0x5b20('0x6a')],db[_0x5b20('0x62')]['literal'](_0x5b20('0x6d')),['id','DESC']];}else{if(!_['isEmpty'](_0x301a89[_0x5b20('0x43')][_0x5b20('0x68')])){_0xa346dc['id']={'$notIn':_0x301a89[_0x5b20('0x43')][_0x5b20('0x68')]};}_0x3015dd=[[_0x5b20('0x69'),_0x5b20('0x6c')],[_0x5b20('0x6b'),_0x500a58[0x0][_0x5b20('0x60')]],db[_0x5b20('0x62')][_0x5b20('0x6e')](_0x5b20('0x6f')),['id','ASC']];}return db[_0x5b20('0x3e')]['findOne']({'attributes':['id',_0x5b20('0x70'),_0x5b20('0x54'),_0x5b20('0x71')],'where':_0xa346dc,'order':_0x3015dd,'transaction':_0x2db7a7,'lock':_0x2db7a7[_0x5b20('0x72')][_0x5b20('0x73')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x290ddb,'include':[{'model':db[_0x5b20('0x74')],'as':_0x5b20('0x75'),'attributes':['id',_0x5b20('0xd')]}]},{'model':db[_0x5b20('0x76')],'as':_0x5b20('0x77'),'attributes':['id',_0x5b20('0xd')]},{'model':db[_0x5b20('0x48')],'as':_0x5b20('0x78'),'attributes':['id','name',_0x5b20('0x79')]}]})['then'](function(_0x24e77c){if(_0x24e77c){return _0x24e77c[_0x5b20('0xa')]({'UserId':_0x301a89['user']['id']},{'transaction':_0x2db7a7});}});});}})[_0x5b20('0xb')](handleEntityNotFound(_0x404f87,null))[_0x5b20('0xb')](respondWithResult(_0x404f87,null))[_0x5b20('0x3a')](handleError(_0x404f87,null));};exports[_0x5b20('0x7a')]=function(_0x360ec6,_0xaf8013,_0x2cc4b4){var _0x504968=[];var _0x279c1d=_0x360ec6['params']['id'];var _0x52fccc=_0x360ec6[_0x5b20('0x50')]['id'];return db[_0x5b20('0x57')]['describe']()[_0x5b20('0xb')](function(_0x19bc2f){_0x504968=_['keys'](_0x19bc2f);return db[_0x5b20('0x62')][_0x5b20('0x63')](function(_0x371f63){const _0xf00341={'id':_0x279c1d};return db[_0x5b20('0x3e')]['findOne']({'attributes':['id','scheduledat',_0x5b20('0x71')],'where':_0xf00341,'transaction':_0x371f63,'lock':_0x371f63[_0x5b20('0x72')][_0x5b20('0x73')],'include':[{'model':db[_0x5b20('0x57')],'as':_0x5b20('0x7b'),'attributes':_0x504968,'include':[{'model':db['CmCompany'],'as':_0x5b20('0x75'),'attributes':['id',_0x5b20('0xd')]}]},{'model':db[_0x5b20('0x76')],'as':_0x5b20('0x77'),'attributes':['id',_0x5b20('0xd')]},{'model':db[_0x5b20('0x48')],'as':_0x5b20('0x78'),'attributes':['id',_0x5b20('0xd'),_0x5b20('0x79')]}]})['then'](function(_0x2abfc5){if(_0x2abfc5){return _0x2abfc5[_0x5b20('0xa')]({'UserId':_0x52fccc},{'transaction':_0x371f63});}});});})[_0x5b20('0xb')](handleEntityNotFound(_0xaf8013,null))['then'](respondWithResult(_0xaf8013,null))['catch'](handleError(_0xaf8013,null));};exports[_0x5b20('0x7c')]=function(_0xfc7f55,_0x32c823){return _0xfc7f55[_0x5b20('0x50')][_0x5b20('0x7d')]({'where':{'type':_0x5b20('0x7e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x5b20('0xb')](function(_0x1b70c4){if(_0x1b70c4&&_0x1b70c4['length']){return db[_0x5b20('0x3e')][_0x5b20('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5b20('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x1b70c4,'id')},'$or':[{'UserId':null},{'UserId':_0xfc7f55[_0x5b20('0x50')]['id']}]}});}return 0x0;})[_0x5b20('0xb')](function(_0x26b93a){if(!_['isNil'](_0x26b93a)&&_[_0x5b20('0x7f')](_0x26b93a)){return _0x32c823[_0x5b20('0x5')](0xc8)[_0x5b20('0x80')]({'contacts':_0x26b93a});}else{logger['error'](_0x5b20('0x81'),_0x5b20('0x7c'),0x194,_0x5b20('0x82'));_0x32c823[_0x5b20('0xc')](0x194);}})['catch'](handleError(_0x32c823,null));};exports['getTimezones']=function(_0x214a96,_0x210584){var _0x54d54f=shared[_0x5b20('0x83')];var _0x5f541d=[];_[_0x5b20('0x10')](_0x54d54f,function(_0x129b81){_0x5f541d[_0x5b20('0x84')]({'id':_0x129b81[_0x5b20('0xd')],'name':_0x129b81[_0x5b20('0xd')],'utcOffset':_0x129b81[_0x5b20('0x85')]});});return _0x210584[_0x5b20('0x5')](0xc8)[_0x5b20('0x80')]({'tz':_0x5f541d});};exports['getTimezone']=function(_0x5438ca,_0xa18191){var _0x205e5e=shared[_0x5b20('0x83')];var _0x41a5d0={};if(!_['isNil'](_0x205e5e[_0x5438ca[_0x5b20('0x43')]['id']]))_0x41a5d0=_0x205e5e[_0x5438ca[_0x5b20('0x43')]['id']];return _0xa18191[_0x5b20('0x5')](0xc8)[_0x5b20('0x80')](_0x41a5d0);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d64eb5b..657205c 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 _0x7a54=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','moment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7a54,0x106));var _0x47a5=function(_0x4e9250,_0xa79758){_0x4e9250=_0x4e9250-0x0;var _0x304819=_0x7a54[_0x4e9250];return _0x304819;};'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':'scheduledat','fields':[_0x47a5('0xc')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x47a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x34bb68,_0x5b0079){var _0x3db9fb=function(_0x2c87bd){while(--_0x2c87bd){_0x34bb68['push'](_0x34bb68['shift']());}};_0x3db9fb(++_0x5b0079);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x512b9f,_0x30b7fd){_0x512b9f=_0x512b9f-0x0;var _0x22e8fc=_0xbd51[_0x512b9f];return _0x22e8fc;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 2c1c02b..7c07298 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 _0xa6a4=['voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','util','moment','bluebird','../../mysqldb','../../config/logger','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCmHopper','stringify','catch','error','message','find','then','debug','ShowCmHopper','CreateCmHopper','create','body','active','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','transaction','order','LOCK','UPDATE','CmContact','keys','Agent','name','voicePause','length','UserId','push','update','dataValues','MoveContactManagedDialer','sequelize','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications'];(function(_0x495468,_0x77c7ae){var _0x53ecc6=function(_0x15ae58){while(--_0x15ae58){_0x495468['push'](_0x495468['shift']());}};_0x53ecc6(++_0x77c7ae);}(_0xa6a4,0x9e));var _0x4a6a=function(_0x24a782,_0x51eaf3){_0x24a782=_0x24a782-0x0;var _0x109a20=_0xa6a4[_0x24a782];return _0x109a20;};'use strict';var _=require('lodash');var util=require(_0x4a6a('0x0'));var moment=require(_0x4a6a('0x1'));var BPromise=require(_0x4a6a('0x2'));var db=require(_0x4a6a('0x3'))['db'];var logger=require(_0x4a6a('0x4'))('rpc');exports['GetCmHopper']=function(_0x33c708){var _0x364ba3=this;return new Promise(function(_0x147977,_0x4e1bed){return db[_0x4a6a('0x5')][_0x4a6a('0x6')]({'raw':_0x33c708[_0x4a6a('0x7')]?_0x33c708[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![],'where':_0x33c708[_0x4a6a('0x7')]?_0x33c708[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null,'attributes':_0x33c708[_0x4a6a('0x7')]?_0x33c708[_0x4a6a('0x7')][_0x4a6a('0xa')]||null:null,'limit':_0x33c708[_0x4a6a('0x7')]?_0x33c708[_0x4a6a('0x7')][_0x4a6a('0xb')]||null:null,'include':_0x33c708[_0x4a6a('0x7')]?_0x33c708[_0x4a6a('0x7')][_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0x33c708[_0x4a6a('0x7')][_0x4a6a('0xc')],function(_0xcddb3e){return{'model':db[_0xcddb3e[_0x4a6a('0xe')]],'as':_0xcddb3e['as'],'attributes':_0xcddb3e[_0x4a6a('0xa')],'include':_0xcddb3e[_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0xcddb3e[_0x4a6a('0xc')],function(_0x52cbd0){return{'model':db[_0x52cbd0[_0x4a6a('0xe')]],'as':_0x52cbd0['as'],'attributes':_0x52cbd0['attributes'],'include':_0x52cbd0[_0x4a6a('0xc')]?_['map'](_0x52cbd0[_0x4a6a('0xc')],function(_0x101cad){return{'model':db[_0x101cad[_0x4a6a('0xe')]],'as':_0x101cad['as'],'attributes':_0x101cad[_0x4a6a('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10d768){logger[_0x4a6a('0xf')](_0x4a6a('0x10'),_0x33c708);logger['debug'](_0x4a6a('0x10'),_0x33c708,JSON[_0x4a6a('0x11')](_0x10d768));_0x147977(_0x10d768);})[_0x4a6a('0x12')](function(_0x24b729){logger[_0x4a6a('0x13')](_0x4a6a('0x10'),_0x24b729[_0x4a6a('0x14')],_0x33c708);_0x4e1bed(_0x364ba3[_0x4a6a('0x13')](0x1f4,_0x24b729[_0x4a6a('0x14')]));});});};exports['ShowCmHopper']=function(_0xe1c1fb){var _0x2ab05c=this;return new Promise(function(_0x1fafe1,_0x7d1d0b){return db[_0x4a6a('0x5')][_0x4a6a('0x15')]({'raw':_0xe1c1fb['options']?_0xe1c1fb[_0x4a6a('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0xe1c1fb['options']?_0xe1c1fb[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null,'attributes':_0xe1c1fb['options']?_0xe1c1fb[_0x4a6a('0x7')][_0x4a6a('0xa')]||null:null,'include':_0xe1c1fb[_0x4a6a('0x7')]?_0xe1c1fb[_0x4a6a('0x7')][_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0xe1c1fb[_0x4a6a('0x7')][_0x4a6a('0xc')],function(_0x1dce27){return{'model':db[_0x1dce27[_0x4a6a('0xe')]],'as':_0x1dce27['as'],'attributes':_0x1dce27[_0x4a6a('0xa')],'include':_0x1dce27['include']?_[_0x4a6a('0xd')](_0x1dce27['include'],function(_0x33a570){return{'model':db[_0x33a570[_0x4a6a('0xe')]],'as':_0x33a570['as'],'attributes':_0x33a570['attributes'],'include':_0x33a570[_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0x33a570['include'],function(_0x2f46af){return{'model':db[_0x2f46af['model']],'as':_0x2f46af['as'],'attributes':_0x2f46af[_0x4a6a('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a6a('0x16')](function(_0x34ecf9){logger['info']('ShowCmHopper',_0xe1c1fb);logger[_0x4a6a('0x17')](_0x4a6a('0x18'),_0xe1c1fb,JSON[_0x4a6a('0x11')](_0x34ecf9));_0x1fafe1(_0x34ecf9);})[_0x4a6a('0x12')](function(_0x39f46e){logger['error'](_0x4a6a('0x18'),_0x39f46e['message'],_0xe1c1fb);_0x7d1d0b(_0x2ab05c['error'](0x1f4,_0x39f46e[_0x4a6a('0x14')]));});});};exports[_0x4a6a('0x19')]=function(_0x2c1646){var _0x44a628=this;return new Promise(function(_0x2a9ebe,_0x4eea87){return db[_0x4a6a('0x5')][_0x4a6a('0x1a')](_0x2c1646[_0x4a6a('0x1b')],{'raw':_0x2c1646['options']?_0x2c1646[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![]})[_0x4a6a('0x16')](function(_0x1eb9ad){logger['info'](_0x4a6a('0x19'),_0x2c1646);logger[_0x4a6a('0x17')](_0x4a6a('0x19'),_0x2c1646,JSON[_0x4a6a('0x11')](_0x1eb9ad));_0x2a9ebe(_0x1eb9ad);})[_0x4a6a('0x12')](function(_0x5d2fbc){logger[_0x4a6a('0x13')](_0x4a6a('0x19'),_0x5d2fbc[_0x4a6a('0x14')],_0x2c1646);_0x4eea87(_0x44a628[_0x4a6a('0x13')](0x1f4,_0x5d2fbc[_0x4a6a('0x14')]));});});};exports['UpdateCmHopper']=function(_0x5d0b3e){var _0x2c3fff=this;return new Promise(function(_0x49fe53,_0x3fb856){return db['CmHopper']['update'](_0x5d0b3e[_0x4a6a('0x1b')],{'raw':_0x5d0b3e['options']?_0x5d0b3e[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0b3e[_0x4a6a('0x7')]?_0x5d0b3e[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null,'attributes':_0x5d0b3e[_0x4a6a('0x7')]?_0x5d0b3e[_0x4a6a('0x7')]['attributes']||null:null,'limit':_0x5d0b3e['options']?_0x5d0b3e[_0x4a6a('0x7')][_0x4a6a('0xb')]||null:null})['then'](function(_0x2f6207){logger[_0x4a6a('0xf')]('UpdateCmHopper',_0x5d0b3e);logger[_0x4a6a('0xf')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x5d0b3e[_0x4a6a('0x7')][_0x4a6a('0x9')]),_0x5d0b3e[_0x4a6a('0x1b')][_0x4a6a('0x1c')]);logger['debug'](_0x4a6a('0x1d'),_0x5d0b3e,JSON[_0x4a6a('0x11')](_0x2f6207));_0x49fe53(_0x2f6207);})[_0x4a6a('0x12')](function(_0x54bcc0){logger[_0x4a6a('0x13')](_0x4a6a('0x1d'),_0x54bcc0[_0x4a6a('0x14')],_0x5d0b3e);_0x3fb856(_0x2c3fff[_0x4a6a('0x13')](0x1f4,_0x54bcc0[_0x4a6a('0x14')]));});});};exports[_0x4a6a('0x1e')]=function(_0x1310b3){var _0x487b8d=this;return new Promise(function(_0x3a3551,_0x43dd78){return db['CmHopper'][_0x4a6a('0x1f')]({'where':_0x1310b3['options']?_0x1310b3[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null})['then'](function(_0x192319){logger[_0x4a6a('0xf')](_0x4a6a('0x1e'),_0x1310b3);logger['debug']('DestroyCmHopper',_0x1310b3,JSON[_0x4a6a('0x11')](_0x192319));_0x3a3551(_0x192319);})[_0x4a6a('0x12')](function(_0x260bb2){logger[_0x4a6a('0x13')](_0x4a6a('0x1e'),_0x260bb2[_0x4a6a('0x14')],_0x1310b3);_0x43dd78(_0x487b8d[_0x4a6a('0x13')](0x1f4,_0x260bb2[_0x4a6a('0x14')]));});});};exports[_0x4a6a('0x20')]=function(_0x5b388d){var _0x5a3c94=this;return new Promise(function(_0x3a797e,_0x5321ac){return db['CmContact'][_0x4a6a('0x21')]()[_0x4a6a('0x16')](function(_0x270770){return db['sequelize'][_0x4a6a('0x22')](function(_0x3d93f8){return db[_0x4a6a('0x5')][_0x4a6a('0x6')]({'where':_0x5b388d[_0x4a6a('0x7')]?_0x5b388d['options']['where']||null:null,'attributes':_0x5b388d[_0x4a6a('0x7')]?_0x5b388d[_0x4a6a('0x7')][_0x4a6a('0xa')]||null:null,'limit':_0x5b388d[_0x4a6a('0x7')]?_0x5b388d[_0x4a6a('0x7')]['limit']||null:null,'order':_0x5b388d[_0x4a6a('0x7')]?_0x5b388d[_0x4a6a('0x7')][_0x4a6a('0x23')]||null:null,'transaction':_0x3d93f8,'lock':_0x3d93f8[_0x4a6a('0x24')][_0x4a6a('0x25')],'include':[{'model':db[_0x4a6a('0x26')],'as':'Contact','attributes':_[_0x4a6a('0x27')](_0x270770)},{'model':db['User'],'as':_0x4a6a('0x28'),'attributes':['id',_0x4a6a('0x29'),_0x4a6a('0x2a')]}]})[_0x4a6a('0x16')](function(_0x11cbf9){var _0x44025d=[];var _0x1faccd=[];for(var _0x1cbcd8=0x0;_0x1cbcd8<_0x11cbf9[_0x4a6a('0x2b')];_0x1cbcd8+=0x1){var _0x163fdc=_0x11cbf9[_0x1cbcd8][_0x4a6a('0x2c')];if(_0x163fdc===null){_0x44025d['push'](_0x11cbf9[_0x1cbcd8]['update'](_0x5b388d[_0x4a6a('0x1b')],{'transaction':_0x3d93f8}));}else if(!_0x1faccd['includes'](_0x163fdc)){_0x1faccd[_0x4a6a('0x2d')](_0x163fdc);_0x44025d[_0x4a6a('0x2d')](_0x11cbf9[_0x1cbcd8][_0x4a6a('0x2e')](_0x5b388d[_0x4a6a('0x1b')],{'transaction':_0x3d93f8}));}}return BPromise['all'](_0x44025d);});})[_0x4a6a('0x16')](function(_0x22c2e9){logger[_0x4a6a('0xf')](_0x4a6a('0x20'),_0x5b388d);if(_0x22c2e9[_0x4a6a('0x2b')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x22c2e9[0x0][_0x4a6a('0x2f')]['id'],_0x22c2e9[0x0][_0x4a6a('0x2f')]['ContactId'],_0x22c2e9[0x0][_0x4a6a('0x2f')]['active']);}logger[_0x4a6a('0x17')](_0x4a6a('0x20'),_0x5b388d,JSON[_0x4a6a('0x11')](_0x22c2e9));_0x3a797e(_0x22c2e9);})[_0x4a6a('0x12')](function(_0x505afe){logger['error'](_0x4a6a('0x20'),_0x505afe[_0x4a6a('0x14')],_0x5b388d);_0x5321ac(_0x5a3c94['error'](0x1f4,_0x505afe['message']));});});});};exports[_0x4a6a('0x30')]=function(_0x387a3d){var _0x1cd06a=this;return new Promise(function(_0x49b0e1,_0x2f22df){return db[_0x4a6a('0x31')]['transaction'](function(_0x1f0a48){return db['CmHopperFinal'][_0x4a6a('0x1a')](_0x387a3d['body'],{'raw':_0x387a3d[_0x4a6a('0x7')]?_0x387a3d[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![],'transaction':_0x1f0a48})['then'](function(){logger['info'](_0x4a6a('0x32'),JSON[_0x4a6a('0x11')](_0x387a3d[_0x4a6a('0x7')][_0x4a6a('0x9')]),_0x387a3d['options'][_0x4a6a('0x9')][_0x4a6a('0x1c')]);return db[_0x4a6a('0x5')][_0x4a6a('0x1f')]({'where':_0x387a3d[_0x4a6a('0x7')]?_0x387a3d[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null,'transaction':_0x1f0a48});});})[_0x4a6a('0x16')](function(_0x3d5b5b){logger[_0x4a6a('0xf')](_0x4a6a('0x30'),_0x387a3d);logger[_0x4a6a('0x17')](_0x4a6a('0x30'),_0x387a3d,JSON[_0x4a6a('0x11')](_0x3d5b5b));_0x49b0e1(_0x3d5b5b);})[_0x4a6a('0x12')](function(_0x3cfb3c){logger[_0x4a6a('0x13')](_0x4a6a('0x30'),_0x3cfb3c[_0x4a6a('0x14')],_0x387a3d);_0x2f22df(_0x1cd06a[_0x4a6a('0x13')](0x1f4,_0x3cfb3c[_0x4a6a('0x14')]));});});};exports['CountReScheduled']=function(_0x4d2e7a){var _0x3eed3c=this;return new Promise(function(_0x4cb6e5,_0x6764cb){return db[_0x4a6a('0x5')][_0x4a6a('0x6')]({'raw':_0x4d2e7a[_0x4a6a('0x7')]?_0x4d2e7a[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![],'where':_0x4d2e7a['options']?_0x4d2e7a[_0x4a6a('0x7')][_0x4a6a('0x9')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4a6a('0x33'),db[_0x4a6a('0x31')]['fn']('IF',db[_0x4a6a('0x31')][_0x4a6a('0x34')](_0x4a6a('0x35')+util['format'](_0x4a6a('0x36'),moment()[_0x4a6a('0x37')](_0x4a6a('0x38')))+'\x20,\x201,\x20null'))),_0x4a6a('0x39')]]})[_0x4a6a('0x16')](function(_0x293bda){logger[_0x4a6a('0xf')](_0x4a6a('0x3a'),_0x4d2e7a);logger[_0x4a6a('0x17')](_0x4a6a('0x3a'),_0x4d2e7a,JSON['stringify'](_0x293bda));_0x4cb6e5(_0x293bda);})[_0x4a6a('0x12')](function(_0x44b529){logger[_0x4a6a('0x13')](_0x4a6a('0x3a'),_0x44b529[_0x4a6a('0x14')],_0x4d2e7a);_0x6764cb(_0x3eed3c['error'](0x1f4,_0x44b529['message']));});});};exports[_0x4a6a('0x3b')]=function(_0x1a8f7a){var _0x4c9edb=this;return new Promise(function(_0x334d6d,_0xcba449){return db[_0x4a6a('0x26')][_0x4a6a('0x21')]()[_0x4a6a('0x16')](function(){return db[_0x4a6a('0x31')][_0x4a6a('0x22')](function(_0x5e5bd6){return db[_0x4a6a('0x5')]['findAll']({'where':_0x1a8f7a[_0x4a6a('0x7')]?_0x1a8f7a['options'][_0x4a6a('0x9')]||null:null,'attributes':_0x1a8f7a[_0x4a6a('0x7')]?_0x1a8f7a[_0x4a6a('0x7')][_0x4a6a('0xa')]||null:null,'limit':0x1,'order':_0x1a8f7a[_0x4a6a('0x7')]?_0x1a8f7a['options'][_0x4a6a('0x23')]||null:null,'group':db['CmHopper'][_0x4a6a('0x2c')],'transaction':_0x5e5bd6,'lock':_0x5e5bd6['LOCK']['UPDATE'],'include':_0x1a8f7a[_0x4a6a('0x7')]?_0x1a8f7a[_0x4a6a('0x7')][_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0x1a8f7a[_0x4a6a('0x7')][_0x4a6a('0xc')],function(_0x361abb){return{'model':db[_0x361abb['model']],'as':_0x361abb['as'],'attributes':_0x361abb[_0x4a6a('0xa')],'include':_0x361abb[_0x4a6a('0xc')]?_['map'](_0x361abb[_0x4a6a('0xc')],function(_0x375489){return{'model':db[_0x375489['model']],'as':_0x375489['as'],'attributes':_0x375489[_0x4a6a('0xa')],'include':_0x375489[_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0x375489[_0x4a6a('0xc')],function(_0x2da126){return{'model':db[_0x2da126['model']],'as':_0x2da126['as'],'attributes':_0x2da126[_0x4a6a('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4a6a('0x16')](function(_0x1174a0){var _0x44c061=[];for(var _0x4d5b12=0x0;_0x4d5b12<_0x1174a0[_0x4a6a('0x2b')];_0x4d5b12+=0x1){_0x44c061[_0x4a6a('0x2d')](_0x1174a0[_0x4d5b12]['update'](_0x1a8f7a['body'],{'transaction':_0x5e5bd6}));}return BPromise['all'](_0x44c061);});})[_0x4a6a('0x16')](function(_0x3b443a){logger['info']('GetContactRecallMe',_0x1a8f7a);logger[_0x4a6a('0x17')](_0x4a6a('0x3b'),_0x1a8f7a,JSON['stringify'](_0x3b443a));_0x334d6d(_0x3b443a);})[_0x4a6a('0x12')](function(_0x42880c){logger[_0x4a6a('0x13')]('GetContactRecallMe',_0x42880c['message'],_0x1a8f7a);_0xcba449(_0x4c9edb[_0x4a6a('0x13')](0x1f4,_0x42880c[_0x4a6a('0x14')]));});});});};exports[_0x4a6a('0x3c')]=function(_0x415895){var _0x27faf9=this;return new Promise(function(_0x1b45e4,_0x179199){db[_0x4a6a('0x26')][_0x4a6a('0x21')]()['then'](function(_0x30a918){return db[_0x4a6a('0x5')][_0x4a6a('0x6')]({'raw':_0x415895['options']?_0x415895[_0x4a6a('0x7')][_0x4a6a('0x8')]===undefined?!![]:![]:!![],'where':_0x415895[_0x4a6a('0x7')]?_0x415895['options']['where']||null:null,'attributes':_0x415895['options']?_0x415895['options'][_0x4a6a('0xa')]||null:null,'limit':_0x415895['options']?_0x415895['options'][_0x4a6a('0xb')]||null:null,'include':_0x415895[_0x4a6a('0x7')]?_0x415895['options']['include']?_[_0x4a6a('0xd')](_0x415895['options'][_0x4a6a('0xc')],function(_0x591a9e){return{'model':db[_0x591a9e[_0x4a6a('0xe')]],'as':_0x591a9e['as'],'attributes':_0x591a9e['as']===_0x4a6a('0x3d')?_[_0x4a6a('0x27')](_0x30a918):_0x591a9e[_0x4a6a('0xa')],'include':_0x591a9e['include']?_[_0x4a6a('0xd')](_0x591a9e['include'],function(_0x5b80c2){return{'model':db[_0x5b80c2[_0x4a6a('0xe')]],'as':_0x5b80c2['as'],'attributes':_0x5b80c2[_0x4a6a('0xa')],'include':_0x5b80c2[_0x4a6a('0xc')]?_[_0x4a6a('0xd')](_0x5b80c2[_0x4a6a('0xc')],function(_0x49a72d){return{'model':db[_0x49a72d[_0x4a6a('0xe')]],'as':_0x49a72d['as'],'attributes':_0x49a72d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a6a('0x16')](function(_0x41d359){logger['info'](_0x4a6a('0x10'),_0x415895);logger[_0x4a6a('0x17')](_0x4a6a('0x10'),_0x415895,JSON[_0x4a6a('0x11')](_0x41d359));_0x1b45e4(_0x41d359);})[_0x4a6a('0x12')](function(_0x1c1569){logger[_0x4a6a('0x13')]('GetCmHopper',_0x1c1569[_0x4a6a('0x14')],_0x415895);_0x179199(_0x27faf9[_0x4a6a('0x13')](0x1f4,_0x1c1569[_0x4a6a('0x14')]));});});});};exports[_0x4a6a('0x3e')]=function(_0x100147){var _0x3f26d6=this;return new Promise(function(_0x1d8872,_0x555b1f){return db[_0x4a6a('0x26')][_0x4a6a('0x3f')]({'raw':!![],'where':{'phone':_0x100147[_0x4a6a('0x7')]['where'][_0x4a6a('0x40')]},'attributes':['id',_0x4a6a('0x41')],'order':[['id',_0x4a6a('0x42')]]})['then'](function(_0x4a7ee4){logger[_0x4a6a('0xf')](_0x4a6a('0x43'),_0x100147);logger[_0x4a6a('0x17')](_0x4a6a('0x43'),_0x100147,JSON[_0x4a6a('0x11')](_0x4a7ee4));_0x1d8872(_0x4a7ee4);})[_0x4a6a('0x12')](function(_0x374e68){logger[_0x4a6a('0x13')]('getContactByPhone',_0x374e68[_0x4a6a('0x14')],_0x100147);_0x555b1f(_0x3f26d6[_0x4a6a('0x13')](0x1f4,_0x374e68['message']));});});};exports[_0x4a6a('0x44')]=function(_0x2a5870){var _0x200645=this;return new Promise(function(_0x12037c,_0x164c2b){return db[_0x4a6a('0x31')]['transaction'](function(_0x5e88f6){var _0x393aec=_0x2a5870[_0x4a6a('0x7')]&&_0x2a5870[_0x4a6a('0x7')]['where']?_0x2a5870[_0x4a6a('0x7')][_0x4a6a('0x9')]:{};return db[_0x4a6a('0x5')]['update'](_0x2a5870['body'],{'where':_0x393aec,'transaction':_0x5e88f6})['then'](function(_0x2548a5){logger[_0x4a6a('0xf')]('ResetActiveCalls',_0x2a5870);logger['debug'](_0x4a6a('0x44'),_0x2a5870,JSON[_0x4a6a('0x11')](_0x2548a5));_0x12037c(_0x2548a5);})[_0x4a6a('0x12')](function(_0x5996c3){logger['error'](_0x4a6a('0x44'),_0x5996c3[_0x4a6a('0x14')],_0x2a5870);_0x164c2b(_0x200645[_0x4a6a('0x13')](0x1f4,_0x5996c3[_0x4a6a('0x14')]));});});});};exports[_0x4a6a('0x45')]=function(_0x500a6f){var _0x506fd5=this;var _0x3cffa3=_0x500a6f[_0x4a6a('0x1b')]['where'][_0x4a6a('0x46')];var _0x146e82=_0x500a6f[_0x4a6a('0x1b')][_0x4a6a('0x9')][_0x4a6a('0x47')];var _0x3b3c8f=_0x500a6f['body'][_0x4a6a('0x9')][_0x4a6a('0x48')];return new Promise(function(_0xf6e69f,_0x4011f2){return db[_0x4a6a('0x5')][_0x4a6a('0x6')]({'where':{'voiceQueueId':{'$in':_0x3cffa3},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4a6a('0x31')]['literal'](_0x4a6a('0x49')+_0x146e82+_0x4a6a('0x4a')),'$gt':db['sequelize'][_0x4a6a('0x34')]('NOW()')}},'UserId':{'$in':_0x3b3c8f}},'include':[{'model':db[_0x4a6a('0x26')],'as':_0x4a6a('0x3d')},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x4a6a('0x2a')]},{'model':db['CmList'],'as':'List'}]})[_0x4a6a('0x16')](function(_0x100453){if(_0x100453[_0x4a6a('0x2b')]>0x0){return db[_0x4a6a('0x31')][_0x4a6a('0x22')](function(_0x21dada){return db[_0x4a6a('0x5')][_0x4a6a('0x2e')]({'recallmeNotifiedDate':db['sequelize'][_0x4a6a('0x34')](_0x4a6a('0x4b'))},{'where':{'id':{'$in':_[_0x4a6a('0xd')](_0x100453,'id')}},'transaction':_0x21dada})[_0x4a6a('0x16')](function(){_0xf6e69f(_0x100453);})[_0x4a6a('0x12')](function(_0xb87681){logger[_0x4a6a('0x13')]('CmHopperHandlePreviewRecallNotifications',_0xb87681['message'],_0x500a6f);_0x4011f2(_0x506fd5['error'](0x1f4,_0xb87681[_0x4a6a('0x14')]));});})['catch'](function(_0x485be6){logger['error'](_0x4a6a('0x45'),_0x485be6[_0x4a6a('0x14')],_0x500a6f);_0x4011f2(_0x506fd5[_0x4a6a('0x13')](0x1f4,_0x485be6[_0x4a6a('0x14')]));});}else{_0xf6e69f(_0x100453);}});});}; \ No newline at end of file +var _0x6a78=['UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','includes','push','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','then','info','stringify','error','message','ShowCmHopper','find','raw','debug','catch','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','describe','sequelize','transaction','order','LOCK'];(function(_0x3986b8,_0x1e6bbf){var _0x19e94e=function(_0x41c69b){while(--_0x41c69b){_0x3986b8['push'](_0x3986b8['shift']());}};_0x19e94e(++_0x1e6bbf);}(_0x6a78,0x1c4));var _0x86a7=function(_0x211caf,_0x3f4636){_0x211caf=_0x211caf-0x0;var _0x3357ff=_0x6a78[_0x211caf];return _0x3357ff;};'use strict';var _=require(_0x86a7('0x0'));var util=require(_0x86a7('0x1'));var moment=require(_0x86a7('0x2'));var BPromise=require(_0x86a7('0x3'));var db=require(_0x86a7('0x4'))['db'];var logger=require(_0x86a7('0x5'))(_0x86a7('0x6'));exports[_0x86a7('0x7')]=function(_0x426435){var _0x363dc4=this;return new Promise(function(_0x530d7c,_0x97928f){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'raw':_0x426435[_0x86a7('0xa')]?_0x426435['options']['raw']===undefined?!![]:![]:!![],'where':_0x426435[_0x86a7('0xa')]?_0x426435['options'][_0x86a7('0xb')]||null:null,'attributes':_0x426435['options']?_0x426435[_0x86a7('0xa')][_0x86a7('0xc')]||null:null,'limit':_0x426435[_0x86a7('0xa')]?_0x426435[_0x86a7('0xa')][_0x86a7('0xd')]||null:null,'include':_0x426435[_0x86a7('0xa')]?_0x426435[_0x86a7('0xa')][_0x86a7('0xe')]?_[_0x86a7('0xf')](_0x426435[_0x86a7('0xa')]['include'],function(_0x5a326f){return{'model':db[_0x5a326f[_0x86a7('0x10')]],'as':_0x5a326f['as'],'attributes':_0x5a326f[_0x86a7('0xc')],'include':_0x5a326f[_0x86a7('0xe')]?_[_0x86a7('0xf')](_0x5a326f[_0x86a7('0xe')],function(_0x165877){return{'model':db[_0x165877[_0x86a7('0x10')]],'as':_0x165877['as'],'attributes':_0x165877[_0x86a7('0xc')],'include':_0x165877['include']?_[_0x86a7('0xf')](_0x165877[_0x86a7('0xe')],function(_0x8c56ef){return{'model':db[_0x8c56ef['model']],'as':_0x8c56ef['as'],'attributes':_0x8c56ef[_0x86a7('0xc')]};}):[]};}):[]};}):[]:[]})[_0x86a7('0x11')](function(_0x484ef6){logger[_0x86a7('0x12')](_0x86a7('0x7'),_0x426435);logger['debug'](_0x86a7('0x7'),_0x426435,JSON[_0x86a7('0x13')](_0x484ef6));_0x530d7c(_0x484ef6);})['catch'](function(_0x2d0699){logger[_0x86a7('0x14')](_0x86a7('0x7'),_0x2d0699[_0x86a7('0x15')],_0x426435);_0x97928f(_0x363dc4[_0x86a7('0x14')](0x1f4,_0x2d0699[_0x86a7('0x15')]));});});};exports[_0x86a7('0x16')]=function(_0xfed972){var _0x9f1cc0=this;return new Promise(function(_0x56b334,_0x53c5ae){return db[_0x86a7('0x8')][_0x86a7('0x17')]({'raw':_0xfed972[_0x86a7('0xa')]?_0xfed972[_0x86a7('0xa')][_0x86a7('0x18')]===undefined?!![]:![]:!![],'where':_0xfed972[_0x86a7('0xa')]?_0xfed972[_0x86a7('0xa')][_0x86a7('0xb')]||null:null,'attributes':_0xfed972[_0x86a7('0xa')]?_0xfed972[_0x86a7('0xa')][_0x86a7('0xc')]||null:null,'include':_0xfed972[_0x86a7('0xa')]?_0xfed972[_0x86a7('0xa')]['include']?_[_0x86a7('0xf')](_0xfed972[_0x86a7('0xa')][_0x86a7('0xe')],function(_0x3af2d0){return{'model':db[_0x3af2d0[_0x86a7('0x10')]],'as':_0x3af2d0['as'],'attributes':_0x3af2d0['attributes'],'include':_0x3af2d0[_0x86a7('0xe')]?_[_0x86a7('0xf')](_0x3af2d0[_0x86a7('0xe')],function(_0xaede3){return{'model':db[_0xaede3[_0x86a7('0x10')]],'as':_0xaede3['as'],'attributes':_0xaede3[_0x86a7('0xc')],'include':_0xaede3[_0x86a7('0xe')]?_['map'](_0xaede3[_0x86a7('0xe')],function(_0x5abe10){return{'model':db[_0x5abe10[_0x86a7('0x10')]],'as':_0x5abe10['as'],'attributes':_0x5abe10[_0x86a7('0xc')]};}):[]};}):[]};}):[]:[]})[_0x86a7('0x11')](function(_0x40f4aa){logger[_0x86a7('0x12')](_0x86a7('0x16'),_0xfed972);logger[_0x86a7('0x19')](_0x86a7('0x16'),_0xfed972,JSON[_0x86a7('0x13')](_0x40f4aa));_0x56b334(_0x40f4aa);})[_0x86a7('0x1a')](function(_0x59f079){logger[_0x86a7('0x14')](_0x86a7('0x16'),_0x59f079['message'],_0xfed972);_0x53c5ae(_0x9f1cc0[_0x86a7('0x14')](0x1f4,_0x59f079[_0x86a7('0x15')]));});});};exports[_0x86a7('0x1b')]=function(_0x24a410){var _0x17f7f5=this;return new Promise(function(_0x2cc15c,_0x23371f){return db['CmHopper'][_0x86a7('0x1c')](_0x24a410[_0x86a7('0x1d')],{'raw':_0x24a410[_0x86a7('0xa')]?_0x24a410[_0x86a7('0xa')][_0x86a7('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x10ebf1){logger['info'](_0x86a7('0x1b'),_0x24a410);logger['debug']('CreateCmHopper',_0x24a410,JSON[_0x86a7('0x13')](_0x10ebf1));_0x2cc15c(_0x10ebf1);})[_0x86a7('0x1a')](function(_0x6b1a3c){logger[_0x86a7('0x14')](_0x86a7('0x1b'),_0x6b1a3c[_0x86a7('0x15')],_0x24a410);_0x23371f(_0x17f7f5[_0x86a7('0x14')](0x1f4,_0x6b1a3c['message']));});});};exports[_0x86a7('0x1e')]=function(_0x196c8c){var _0x4dcb1b=this;return new Promise(function(_0x2982fe,_0x300aed){return db[_0x86a7('0x8')][_0x86a7('0x1f')](_0x196c8c[_0x86a7('0x1d')],{'raw':_0x196c8c[_0x86a7('0xa')]?_0x196c8c[_0x86a7('0xa')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196c8c[_0x86a7('0xa')]?_0x196c8c[_0x86a7('0xa')]['where']||null:null,'attributes':_0x196c8c[_0x86a7('0xa')]?_0x196c8c[_0x86a7('0xa')]['attributes']||null:null,'limit':_0x196c8c[_0x86a7('0xa')]?_0x196c8c['options'][_0x86a7('0xd')]||null:null})[_0x86a7('0x11')](function(_0x4bd88d){logger['info'](_0x86a7('0x1e'),_0x196c8c);logger[_0x86a7('0x12')](_0x86a7('0x20'),JSON[_0x86a7('0x13')](_0x196c8c[_0x86a7('0xa')]['where']),_0x196c8c[_0x86a7('0x1d')]['active']);logger[_0x86a7('0x19')](_0x86a7('0x1e'),_0x196c8c,JSON[_0x86a7('0x13')](_0x4bd88d));_0x2982fe(_0x4bd88d);})[_0x86a7('0x1a')](function(_0x4a6e86){logger[_0x86a7('0x14')](_0x86a7('0x1e'),_0x4a6e86['message'],_0x196c8c);_0x300aed(_0x4dcb1b[_0x86a7('0x14')](0x1f4,_0x4a6e86['message']));});});};exports[_0x86a7('0x21')]=function(_0x520672){var _0x37ad04=this;return new Promise(function(_0x375f88,_0x264eab){return db[_0x86a7('0x8')][_0x86a7('0x22')]({'where':_0x520672[_0x86a7('0xa')]?_0x520672[_0x86a7('0xa')][_0x86a7('0xb')]||null:null})[_0x86a7('0x11')](function(_0x27fc07){logger[_0x86a7('0x12')](_0x86a7('0x21'),_0x520672);logger[_0x86a7('0x19')](_0x86a7('0x21'),_0x520672,JSON[_0x86a7('0x13')](_0x27fc07));_0x375f88(_0x27fc07);})['catch'](function(_0x40017e){logger[_0x86a7('0x14')](_0x86a7('0x21'),_0x40017e['message'],_0x520672);_0x264eab(_0x37ad04[_0x86a7('0x14')](0x1f4,_0x40017e[_0x86a7('0x15')]));});});};exports['GetContactDialer']=function(_0x15da87){var _0x40e215=this;return new Promise(function(_0x13c56f,_0x2285ed){return db['CmContact'][_0x86a7('0x23')]()[_0x86a7('0x11')](function(_0x1975d3){return db[_0x86a7('0x24')][_0x86a7('0x25')](function(_0x44de44){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'where':_0x15da87['options']?_0x15da87[_0x86a7('0xa')]['where']||null:null,'attributes':_0x15da87[_0x86a7('0xa')]?_0x15da87[_0x86a7('0xa')][_0x86a7('0xc')]||null:null,'limit':_0x15da87[_0x86a7('0xa')]?_0x15da87[_0x86a7('0xa')][_0x86a7('0xd')]||null:null,'order':_0x15da87['options']?_0x15da87[_0x86a7('0xa')][_0x86a7('0x26')]||null:null,'transaction':_0x44de44,'lock':_0x44de44[_0x86a7('0x27')][_0x86a7('0x28')],'include':[{'model':db[_0x86a7('0x29')],'as':_0x86a7('0x2a'),'attributes':_[_0x86a7('0x2b')](_0x1975d3)},{'model':db[_0x86a7('0x2c')],'as':_0x86a7('0x2d'),'attributes':['id',_0x86a7('0x2e'),_0x86a7('0x2f')]}]})[_0x86a7('0x11')](function(_0x233963){var _0x3cf22d=[];var _0x1d6967=[];for(var _0x5542d7=0x0;_0x5542d7<_0x233963[_0x86a7('0x30')];_0x5542d7+=0x1){var _0x35c703=_0x233963[_0x5542d7]['UserId'];if(_0x35c703===null){_0x3cf22d['push'](_0x233963[_0x5542d7][_0x86a7('0x1f')](_0x15da87[_0x86a7('0x1d')],{'transaction':_0x44de44}));}else if(!_0x1d6967[_0x86a7('0x31')](_0x35c703)){_0x1d6967[_0x86a7('0x32')](_0x35c703);_0x3cf22d[_0x86a7('0x32')](_0x233963[_0x5542d7][_0x86a7('0x1f')](_0x15da87[_0x86a7('0x1d')],{'transaction':_0x44de44}));}}return BPromise[_0x86a7('0x33')](_0x3cf22d);});})[_0x86a7('0x11')](function(_0x6dfcfc){logger[_0x86a7('0x12')](_0x86a7('0x34'),_0x15da87);if(_0x6dfcfc[_0x86a7('0x30')]>0x0){logger[_0x86a7('0x12')](_0x86a7('0x35'),_0x6dfcfc[0x0][_0x86a7('0x36')]['id'],_0x6dfcfc[0x0]['dataValues'][_0x86a7('0x37')],_0x6dfcfc[0x0][_0x86a7('0x36')][_0x86a7('0x38')]);}logger[_0x86a7('0x19')](_0x86a7('0x34'),_0x15da87,JSON[_0x86a7('0x13')](_0x6dfcfc));_0x13c56f(_0x6dfcfc);})[_0x86a7('0x1a')](function(_0x3f9a46){logger[_0x86a7('0x14')](_0x86a7('0x34'),_0x3f9a46[_0x86a7('0x15')],_0x15da87);_0x2285ed(_0x40e215[_0x86a7('0x14')](0x1f4,_0x3f9a46[_0x86a7('0x15')]));});});});};exports[_0x86a7('0x39')]=function(_0x5961f8){var _0x1e9d61=this;return new Promise(function(_0x54c4a8,_0x7e4da5){return db[_0x86a7('0x24')][_0x86a7('0x25')](function(_0x2c77bd){return db['CmHopperFinal'][_0x86a7('0x1c')](_0x5961f8[_0x86a7('0x1d')],{'raw':_0x5961f8[_0x86a7('0xa')]?_0x5961f8[_0x86a7('0xa')][_0x86a7('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2c77bd})[_0x86a7('0x11')](function(){logger[_0x86a7('0x12')](_0x86a7('0x3a'),JSON[_0x86a7('0x13')](_0x5961f8[_0x86a7('0xa')][_0x86a7('0xb')]),_0x5961f8[_0x86a7('0xa')][_0x86a7('0xb')][_0x86a7('0x38')]);return db['CmHopper'][_0x86a7('0x22')]({'where':_0x5961f8[_0x86a7('0xa')]?_0x5961f8[_0x86a7('0xa')][_0x86a7('0xb')]||null:null,'transaction':_0x2c77bd});});})[_0x86a7('0x11')](function(_0x44a69b){logger[_0x86a7('0x12')](_0x86a7('0x39'),_0x5961f8);logger[_0x86a7('0x19')](_0x86a7('0x39'),_0x5961f8,JSON[_0x86a7('0x13')](_0x44a69b));_0x54c4a8(_0x44a69b);})['catch'](function(_0x3282d2){logger[_0x86a7('0x14')](_0x86a7('0x39'),_0x3282d2[_0x86a7('0x15')],_0x5961f8);_0x7e4da5(_0x1e9d61[_0x86a7('0x14')](0x1f4,_0x3282d2[_0x86a7('0x15')]));});});};exports['CountReScheduled']=function(_0x274bb2){var _0x510300=this;return new Promise(function(_0x2d0df3,_0x291019){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'raw':_0x274bb2[_0x86a7('0xa')]?_0x274bb2[_0x86a7('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x274bb2[_0x86a7('0xa')]?_0x274bb2[_0x86a7('0xa')]['where']||null:null,'attributes':[[db[_0x86a7('0x24')]['fn']('COUNT',db[_0x86a7('0x24')]['fn']('IF',db['sequelize']['literal'](_0x86a7('0x3b')+util['format'](_0x86a7('0x3c'),moment()['format'](_0x86a7('0x3d')))+_0x86a7('0x3e')))),_0x86a7('0x3f')]]})[_0x86a7('0x11')](function(_0x220e0c){logger['info'](_0x86a7('0x40'),_0x274bb2);logger[_0x86a7('0x19')]('CountReScheduled',_0x274bb2,JSON[_0x86a7('0x13')](_0x220e0c));_0x2d0df3(_0x220e0c);})[_0x86a7('0x1a')](function(_0x40a88c){logger[_0x86a7('0x14')](_0x86a7('0x40'),_0x40a88c['message'],_0x274bb2);_0x291019(_0x510300[_0x86a7('0x14')](0x1f4,_0x40a88c['message']));});});};exports[_0x86a7('0x41')]=function(_0x56b9c8){var _0x4227f0=this;return new Promise(function(_0x2826f0,_0x56a281){return db['CmContact'][_0x86a7('0x23')]()[_0x86a7('0x11')](function(){return db[_0x86a7('0x24')][_0x86a7('0x25')](function(_0x1843e9){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'where':_0x56b9c8[_0x86a7('0xa')]?_0x56b9c8[_0x86a7('0xa')][_0x86a7('0xb')]||null:null,'attributes':_0x56b9c8[_0x86a7('0xa')]?_0x56b9c8['options'][_0x86a7('0xc')]||null:null,'limit':0x1,'order':_0x56b9c8[_0x86a7('0xa')]?_0x56b9c8['options'][_0x86a7('0x26')]||null:null,'group':db['CmHopper'][_0x86a7('0x42')],'transaction':_0x1843e9,'lock':_0x1843e9[_0x86a7('0x27')][_0x86a7('0x28')],'include':_0x56b9c8['options']?_0x56b9c8['options']['include']?_['map'](_0x56b9c8[_0x86a7('0xa')][_0x86a7('0xe')],function(_0x358d26){return{'model':db[_0x358d26['model']],'as':_0x358d26['as'],'attributes':_0x358d26[_0x86a7('0xc')],'include':_0x358d26[_0x86a7('0xe')]?_[_0x86a7('0xf')](_0x358d26['include'],function(_0xdd2abd){return{'model':db[_0xdd2abd[_0x86a7('0x10')]],'as':_0xdd2abd['as'],'attributes':_0xdd2abd[_0x86a7('0xc')],'include':_0xdd2abd[_0x86a7('0xe')]?_[_0x86a7('0xf')](_0xdd2abd['include'],function(_0x25eed3){return{'model':db[_0x25eed3[_0x86a7('0x10')]],'as':_0x25eed3['as'],'attributes':_0x25eed3[_0x86a7('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46013b){var _0x2b1edb=[];for(var _0x4688c3=0x0;_0x4688c3<_0x46013b[_0x86a7('0x30')];_0x4688c3+=0x1){_0x2b1edb[_0x86a7('0x32')](_0x46013b[_0x4688c3][_0x86a7('0x1f')](_0x56b9c8['body'],{'transaction':_0x1843e9}));}return BPromise[_0x86a7('0x33')](_0x2b1edb);});})[_0x86a7('0x11')](function(_0x225f21){logger[_0x86a7('0x12')]('GetContactRecallMe',_0x56b9c8);logger[_0x86a7('0x19')](_0x86a7('0x41'),_0x56b9c8,JSON[_0x86a7('0x13')](_0x225f21));_0x2826f0(_0x225f21);})[_0x86a7('0x1a')](function(_0xa29fc4){logger[_0x86a7('0x14')](_0x86a7('0x41'),_0xa29fc4[_0x86a7('0x15')],_0x56b9c8);_0x56a281(_0x4227f0[_0x86a7('0x14')](0x1f4,_0xa29fc4[_0x86a7('0x15')]));});});});};exports[_0x86a7('0x43')]=function(_0x576e96){var _0x1e9007=this;return new Promise(function(_0x1162ee,_0x284b32){db['CmContact'][_0x86a7('0x23')]()[_0x86a7('0x11')](function(_0x2ff229){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'raw':_0x576e96[_0x86a7('0xa')]?_0x576e96['options'][_0x86a7('0x18')]===undefined?!![]:![]:!![],'where':_0x576e96['options']?_0x576e96['options'][_0x86a7('0xb')]||null:null,'attributes':_0x576e96[_0x86a7('0xa')]?_0x576e96[_0x86a7('0xa')][_0x86a7('0xc')]||null:null,'limit':_0x576e96['options']?_0x576e96[_0x86a7('0xa')]['limit']||null:null,'include':_0x576e96[_0x86a7('0xa')]?_0x576e96[_0x86a7('0xa')]['include']?_['map'](_0x576e96['options']['include'],function(_0xb16070){return{'model':db[_0xb16070[_0x86a7('0x10')]],'as':_0xb16070['as'],'attributes':_0xb16070['as']===_0x86a7('0x2a')?_[_0x86a7('0x2b')](_0x2ff229):_0xb16070[_0x86a7('0xc')],'include':_0xb16070[_0x86a7('0xe')]?_[_0x86a7('0xf')](_0xb16070['include'],function(_0xf346df){return{'model':db[_0xf346df['model']],'as':_0xf346df['as'],'attributes':_0xf346df['attributes'],'include':_0xf346df['include']?_[_0x86a7('0xf')](_0xf346df[_0x86a7('0xe')],function(_0x2b146f){return{'model':db[_0x2b146f[_0x86a7('0x10')]],'as':_0x2b146f['as'],'attributes':_0x2b146f[_0x86a7('0xc')]};}):[]};}):[]};}):[]:[]})[_0x86a7('0x11')](function(_0x1e976d){logger[_0x86a7('0x12')](_0x86a7('0x7'),_0x576e96);logger[_0x86a7('0x19')](_0x86a7('0x7'),_0x576e96,JSON[_0x86a7('0x13')](_0x1e976d));_0x1162ee(_0x1e976d);})['catch'](function(_0x5a9821){logger[_0x86a7('0x14')](_0x86a7('0x7'),_0x5a9821[_0x86a7('0x15')],_0x576e96);_0x284b32(_0x1e9007[_0x86a7('0x14')](0x1f4,_0x5a9821[_0x86a7('0x15')]));});});});};exports[_0x86a7('0x44')]=function(_0x2242ac){var _0x2e9d17=this;return new Promise(function(_0x2a73a0,_0x3d8127){return db[_0x86a7('0x29')][_0x86a7('0x45')]({'raw':!![],'where':{'phone':_0x2242ac[_0x86a7('0xa')][_0x86a7('0xb')][_0x86a7('0x46')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})['then'](function(_0xbddd12){logger[_0x86a7('0x12')](_0x86a7('0x47'),_0x2242ac);logger['debug'](_0x86a7('0x47'),_0x2242ac,JSON['stringify'](_0xbddd12));_0x2a73a0(_0xbddd12);})[_0x86a7('0x1a')](function(_0x5f3bb7){logger['error']('getContactByPhone',_0x5f3bb7[_0x86a7('0x15')],_0x2242ac);_0x3d8127(_0x2e9d17['error'](0x1f4,_0x5f3bb7[_0x86a7('0x15')]));});});};exports[_0x86a7('0x48')]=function(_0x50c75f){var _0x3c5e83=this;return new Promise(function(_0x472045,_0x25f970){return db[_0x86a7('0x24')][_0x86a7('0x25')](function(_0x31e20d){var _0x401c1b=_0x50c75f[_0x86a7('0xa')]&&_0x50c75f[_0x86a7('0xa')]['where']?_0x50c75f['options']['where']:{};return db[_0x86a7('0x8')]['update'](_0x50c75f[_0x86a7('0x1d')],{'where':_0x401c1b,'transaction':_0x31e20d})[_0x86a7('0x11')](function(_0x3a89a9){logger[_0x86a7('0x12')](_0x86a7('0x48'),_0x50c75f);logger[_0x86a7('0x19')](_0x86a7('0x48'),_0x50c75f,JSON['stringify'](_0x3a89a9));_0x472045(_0x3a89a9);})[_0x86a7('0x1a')](function(_0x990927){logger[_0x86a7('0x14')](_0x86a7('0x48'),_0x990927[_0x86a7('0x15')],_0x50c75f);_0x25f970(_0x3c5e83['error'](0x1f4,_0x990927[_0x86a7('0x15')]));});});});};exports[_0x86a7('0x49')]=function(_0x3af207){var _0x293153=this;var _0x56a9a5=_0x3af207[_0x86a7('0x1d')][_0x86a7('0xb')][_0x86a7('0x4a')];var _0x15e8d4=_0x3af207[_0x86a7('0x1d')]['where']['interval'];var _0x470ed2=_0x3af207['body'][_0x86a7('0xb')][_0x86a7('0x4b')];return new Promise(function(_0x46a39c,_0x3456b1){return db[_0x86a7('0x8')][_0x86a7('0x9')]({'where':{'voiceQueueId':{'$in':_0x56a9a5},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x86a7('0x4c')](_0x86a7('0x4d')+_0x15e8d4+_0x86a7('0x4e')),'$gt':db[_0x86a7('0x24')]['literal']('NOW()')}},'UserId':{'$in':_0x470ed2}},'include':[{'model':db[_0x86a7('0x29')],'as':_0x86a7('0x2a')},{'model':db[_0x86a7('0x2c')],'as':_0x86a7('0x2d'),'attributes':['id','name',_0x86a7('0x2f')]},{'model':db[_0x86a7('0x4f')],'as':_0x86a7('0x50')}]})[_0x86a7('0x11')](function(_0x188e35){if(_0x188e35[_0x86a7('0x30')]>0x0){return db[_0x86a7('0x24')][_0x86a7('0x25')](function(_0x4d7ba6){return db[_0x86a7('0x8')][_0x86a7('0x1f')]({'recallmeNotifiedDate':db[_0x86a7('0x24')][_0x86a7('0x4c')](_0x86a7('0x51'))},{'where':{'id':{'$in':_[_0x86a7('0xf')](_0x188e35,'id')}},'transaction':_0x4d7ba6})[_0x86a7('0x11')](function(){_0x46a39c(_0x188e35);})[_0x86a7('0x1a')](function(_0x40b1e0){logger[_0x86a7('0x14')](_0x86a7('0x49'),_0x40b1e0[_0x86a7('0x15')],_0x3af207);_0x3456b1(_0x293153[_0x86a7('0x14')](0x1f4,_0x40b1e0[_0x86a7('0x15')]));});})[_0x86a7('0x1a')](function(_0x13bc7f){logger[_0x86a7('0x14')](_0x86a7('0x49'),_0x13bc7f[_0x86a7('0x15')],_0x3af207);_0x3456b1(_0x293153['error'](0x1f4,_0x13bc7f[_0x86a7('0x15')]));});}else{_0x46a39c(_0x188e35);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3881cc4..3a6fc6d 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 _0xe1b9=['getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','/timezone','getTimezone','put','delete','destroy','exports','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe1b9,0x147));var _0x9e1b=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xe1b9[_0x2235bf];return _0x4c3a64;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x9e1b('0x0'));var controller=require(_0x9e1b('0x1'));router['get']('/',auth[_0x9e1b('0x2')](),controller[_0x9e1b('0x3')]);router[_0x9e1b('0x4')](_0x9e1b('0x5'),auth['isAuthenticated'](),controller[_0x9e1b('0x6')]);router[_0x9e1b('0x4')](_0x9e1b('0x7'),auth[_0x9e1b('0x2')](),controller[_0x9e1b('0x8')]);router['get']('/timezones',auth[_0x9e1b('0x2')](),controller[_0x9e1b('0x9')]);router[_0x9e1b('0x4')](_0x9e1b('0xa'),auth[_0x9e1b('0x2')](),controller[_0x9e1b('0xb')]);router[_0x9e1b('0x4')](_0x9e1b('0xc'),auth[_0x9e1b('0x2')](),controller[_0x9e1b('0xd')]);router[_0x9e1b('0xe')]('/',auth[_0x9e1b('0x2')](),controller['create']);router[_0x9e1b('0xe')]('/preview',auth[_0x9e1b('0x2')](),controller['getPreview']);router[_0x9e1b('0xe')](_0x9e1b('0xf'),auth[_0x9e1b('0x2')](),controller[_0x9e1b('0x10')]);router[_0x9e1b('0x11')](_0x9e1b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9e1b('0x12')](_0x9e1b('0xa'),auth[_0x9e1b('0x2')](),controller[_0x9e1b('0x13')]);module[_0x9e1b('0x14')]=router; \ No newline at end of file +var _0x8f64=['put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','post','create','/preview','getPreview','/timezone'];(function(_0x12a4fa,_0x4b927e){var _0x5baea6=function(_0x2d9237){while(--_0x2d9237){_0x12a4fa['push'](_0x12a4fa['shift']());}};_0x5baea6(++_0x4b927e);}(_0x8f64,0x14a));var _0x48f6=function(_0xcf8a1f,_0x6646a1){_0xcf8a1f=_0xcf8a1f-0x0;var _0xaf9b14=_0x8f64[_0xcf8a1f];return _0xaf9b14;};'use strict';var express=require(_0x48f6('0x0'));var router=express[_0x48f6('0x1')]();var auth=require(_0x48f6('0x2'));var controller=require(_0x48f6('0x3'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x48f6('0x4')](_0x48f6('0x5'),auth[_0x48f6('0x6')](),controller[_0x48f6('0x7')]);router[_0x48f6('0x4')](_0x48f6('0x8'),auth['isAuthenticated'](),controller[_0x48f6('0x9')]);router[_0x48f6('0x4')](_0x48f6('0xa'),auth[_0x48f6('0x6')](),controller[_0x48f6('0xb')]);router['get'](_0x48f6('0xc'),auth[_0x48f6('0x6')](),controller[_0x48f6('0xd')]);router[_0x48f6('0x4')](_0x48f6('0xe'),auth[_0x48f6('0x6')](),controller['getPreviewRecall']);router[_0x48f6('0xf')]('/',auth['isAuthenticated'](),controller[_0x48f6('0x10')]);router[_0x48f6('0xf')](_0x48f6('0x11'),auth[_0x48f6('0x6')](),controller[_0x48f6('0x12')]);router['post'](_0x48f6('0x13'),auth['isAuthenticated'](),controller['getTimezone']);router[_0x48f6('0x14')](_0x48f6('0xc'),auth[_0x48f6('0x6')](),controller[_0x48f6('0x15')]);router[_0x48f6('0x16')](_0x48f6('0xc'),auth['isAuthenticated'](),controller[_0x48f6('0x17')]);module[_0x48f6('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 5bf935c..2fb0068 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 _0x8879=['YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER','DATE','format'];(function(_0x4793bd,_0x1b16ab){var _0x441c5b=function(_0x574b7a){while(--_0x574b7a){_0x4793bd['push'](_0x4793bd['shift']());}};_0x441c5b(++_0x1b16ab);}(_0x8879,0x7f));var _0x9887=function(_0x2da148,_0x450594){_0x2da148=_0x2da148-0x0;var _0x2bfd9c=_0x8879[_0x2da148];return _0x2bfd9c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9887('0x0'));module[_0x9887('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x9887('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9887('0x4')],'defaultValue':moment()[_0x9887('0x5')](_0x9887('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9887('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcac4=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','INTEGER'];(function(_0x9cf5e1,_0x4ae91d){var _0xf97089=function(_0x181503){while(--_0x181503){_0x9cf5e1['push'](_0x9cf5e1['shift']());}};_0xf97089(++_0x4ae91d);}(_0xcac4,0x154));var _0x4cac=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcac4[_0xd1d19a];return _0x52a79d;};'use strict';var moment=require(_0x4cac('0x0'));var Sequelize=require('sequelize');module[_0x4cac('0x1')]={'CmHopperId':{'type':Sequelize[_0x4cac('0x2')]},'phone':{'type':Sequelize[_0x4cac('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4cac('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4cac('0x4')],'defaultValue':moment()[_0x4cac('0x5')](_0x4cac('0x6'))},'countbusyretry':{'type':Sequelize[_0x4cac('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4cac('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4cac('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4cac('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 66070c5..2a07fa5 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 _0x4f61=['rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','rows','catch','show','params','include','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','send','index','CmHopperAdditionalPhone'];(function(_0x3d46cb,_0xb6b796){var _0xe0795f=function(_0x318db6){while(--_0x318db6){_0x3d46cb['push'](_0x3d46cb['shift']());}};_0xe0795f(++_0xb6b796);}(_0x4f61,0xd7));var _0x14f6=function(_0x5400ed,_0x4bfd4a){_0x5400ed=_0x5400ed-0x0;var _0x72a0d1=_0x4f61[_0x5400ed];return _0x72a0d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14f6('0x0'));var zipdir=require(_0x14f6('0x1'));var jsonpatch=require(_0x14f6('0x2'));var rp=require(_0x14f6('0x3'));var moment=require(_0x14f6('0x4'));var BPromise=require(_0x14f6('0x5'));var Mustache=require(_0x14f6('0x6'));var util=require(_0x14f6('0x7'));var path=require('path');var sox=require(_0x14f6('0x8'));var csv=require(_0x14f6('0x9'));var ejs=require(_0x14f6('0xa'));var fs=require('fs');var fs_extra=require(_0x14f6('0xb'));var _=require(_0x14f6('0xc'));var squel=require(_0x14f6('0xd'));var crypto=require('crypto');var jsforce=require(_0x14f6('0xe'));var deskjs=require(_0x14f6('0xf'));var toCsv=require(_0x14f6('0x9'));var querystring=require(_0x14f6('0x10'));var Papa=require(_0x14f6('0x11'));var Redis=require(_0x14f6('0x12'));var authService=require(_0x14f6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14f6('0x14'));var logger=require(_0x14f6('0x15'))(_0x14f6('0x16'));var utils=require(_0x14f6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x14f6('0x18'));var db=require(_0x14f6('0x19'))['db'];function respondWithStatusCode(_0x576ee4,_0x59fd02){_0x59fd02=_0x59fd02||0xcc;return function(_0x5cd731){if(_0x5cd731){return _0x576ee4[_0x14f6('0x1a')](_0x59fd02);}return _0x576ee4[_0x14f6('0x1b')](_0x59fd02)[_0x14f6('0x1c')]();};}function respondWithResult(_0x18c151,_0x319761){_0x319761=_0x319761||0xc8;return function(_0x1dbebf){if(_0x1dbebf){return _0x18c151['status'](_0x319761)[_0x14f6('0x1d')](_0x1dbebf);}};}function respondWithFilteredResult(_0x403a40,_0x58538c){return function(_0xd82a03){if(_0xd82a03){var _0x413201=typeof _0x58538c[_0x14f6('0x1e')]===_0x14f6('0x1f')&&typeof _0x58538c[_0x14f6('0x20')]==='undefined';var _0xe5d497=_0xd82a03[_0x14f6('0x21')];var _0x1b6997=_0x413201?0x0:_0x58538c[_0x14f6('0x1e')];var _0x579138=_0x413201?_0xd82a03[_0x14f6('0x21')]:_0x58538c[_0x14f6('0x1e')]+_0x58538c[_0x14f6('0x20')];var _0x12e60e;if(_0x579138>=_0xe5d497){_0x579138=_0xe5d497;_0x12e60e=0xc8;}else{_0x12e60e=0xce;}_0x403a40[_0x14f6('0x1b')](_0x12e60e);return _0x403a40[_0x14f6('0x22')](_0x14f6('0x23'),_0x1b6997+'-'+_0x579138+'/'+_0xe5d497)[_0x14f6('0x1d')](_0xd82a03);}return null;};}function patchUpdates(_0x34253d){return function(_0x24984c){try{jsonpatch[_0x14f6('0x24')](_0x24984c,_0x34253d,!![]);}catch(_0x3b9429){return BPromise[_0x14f6('0x25')](_0x3b9429);}return _0x24984c[_0x14f6('0x26')]();};}function saveUpdates(_0x10c16a,_0x44b727){return function(_0x2859da){if(_0x2859da){return _0x2859da['update'](_0x10c16a)[_0x14f6('0x27')](function(_0x2918a4){return _0x2918a4;});}return null;};}function removeEntity(_0x9e5487,_0x4b9b0e){return function(_0x4b65e8){if(_0x4b65e8){return _0x4b65e8[_0x14f6('0x28')]()[_0x14f6('0x27')](function(){var _0x53669c=_0x4b65e8[_0x14f6('0x29')]({'plain':!![]});var _0x2ddf0b=_0x14f6('0x2a');return db['UserProfileResource'][_0x14f6('0x28')]({'where':{'type':_0x2ddf0b,'resourceId':_0x53669c['id']}})[_0x14f6('0x27')](function(){return _0x4b65e8;});})[_0x14f6('0x27')](function(){_0x9e5487[_0x14f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47438b,_0x4d8242){return function(_0x141d81){if(!_0x141d81){_0x47438b[_0x14f6('0x1a')](0x194);}return _0x141d81;};}function handleError(_0x4f1ce6,_0x574678){_0x574678=_0x574678||0x1f4;return function(_0x316e91){logger[_0x14f6('0x2b')](_0x316e91[_0x14f6('0x2c')]);if(_0x316e91[_0x14f6('0x2d')]){delete _0x316e91[_0x14f6('0x2d')];}_0x4f1ce6['status'](_0x574678)[_0x14f6('0x2e')](_0x316e91);};}exports[_0x14f6('0x2f')]=function(_0xad6d16,_0x5d12d9){var _0x492671={},_0x10d0f4={},_0x10f2f6={'count':0x0,'rows':[]};var _0xab5fe8=_['map'](db[_0x14f6('0x30')][_0x14f6('0x31')],function(_0x31733d){return{'name':_0x31733d[_0x14f6('0x32')],'type':_0x31733d[_0x14f6('0x33')]['key']};});_0x10d0f4[_0x14f6('0x34')]=_[_0x14f6('0x35')](_0xab5fe8,_0x14f6('0x2d'));_0x10d0f4[_0x14f6('0x36')]=_[_0x14f6('0x37')](_0xad6d16['query']);_0x10d0f4[_0x14f6('0x38')]=_['intersection'](_0x10d0f4[_0x14f6('0x34')],_0x10d0f4[_0x14f6('0x36')]);_0x492671[_0x14f6('0x39')]=_[_0x14f6('0x3a')](_0x10d0f4[_0x14f6('0x34')],qs['fields'](_0xad6d16[_0x14f6('0x36')][_0x14f6('0x3b')]));_0x492671['attributes']=_0x492671[_0x14f6('0x39')][_0x14f6('0x3c')]?_0x492671[_0x14f6('0x39')]:_0x10d0f4[_0x14f6('0x34')];if(!_0xad6d16[_0x14f6('0x36')][_0x14f6('0x3d')](_0x14f6('0x3e'))){_0x492671[_0x14f6('0x20')]=qs['limit'](_0xad6d16[_0x14f6('0x36')]['limit']);_0x492671[_0x14f6('0x1e')]=qs['offset'](_0xad6d16[_0x14f6('0x36')]['offset']);}_0x492671[_0x14f6('0x3f')]=qs[_0x14f6('0x40')](_0xad6d16['query']['sort']);_0x492671[_0x14f6('0x41')]=qs[_0x14f6('0x38')](_[_0x14f6('0x42')](_0xad6d16[_0x14f6('0x36')],_0x10d0f4[_0x14f6('0x38')]),_0xab5fe8);if(_0xad6d16[_0x14f6('0x36')]['filter']){_0x492671['where']=_['merge'](_0x492671[_0x14f6('0x41')],{'$or':_[_0x14f6('0x35')](_0xab5fe8,function(_0x54e4f7){if(_0x54e4f7[_0x14f6('0x33')]!==_0x14f6('0x43')){var _0xd5a833={};_0xd5a833[_0x54e4f7[_0x14f6('0x2d')]]={'$like':'%'+_0xad6d16['query']['filter']+'%'};return _0xd5a833;}})});}_0x492671=_['merge']({},_0x492671,_0xad6d16[_0x14f6('0x44')]);var _0x229968={'where':_0x492671[_0x14f6('0x41')]};return db[_0x14f6('0x30')]['count'](_0x229968)[_0x14f6('0x27')](function(_0x42ade3){_0x10f2f6[_0x14f6('0x21')]=_0x42ade3;if(_0xad6d16[_0x14f6('0x36')][_0x14f6('0x45')]){_0x492671['include']=[{'all':!![]}];}return db[_0x14f6('0x30')]['findAll'](_0x492671);})[_0x14f6('0x27')](function(_0x5e21ae){_0x10f2f6[_0x14f6('0x46')]=_0x5e21ae;return _0x10f2f6;})['then'](respondWithFilteredResult(_0x5d12d9,_0x492671))[_0x14f6('0x47')](handleError(_0x5d12d9,null));};exports[_0x14f6('0x48')]=function(_0x59eb67,_0x5043f6){var _0x3a3f88={'raw':!![],'where':{'id':_0x59eb67[_0x14f6('0x49')]['id']}},_0x1fa257={};_0x1fa257['model']=_[_0x14f6('0x37')](db['CmHopperAdditionalPhone'][_0x14f6('0x31')]);_0x1fa257[_0x14f6('0x36')]=_[_0x14f6('0x37')](_0x59eb67[_0x14f6('0x36')]);_0x1fa257[_0x14f6('0x38')]=_[_0x14f6('0x3a')](_0x1fa257['model'],_0x1fa257[_0x14f6('0x36')]);_0x3a3f88[_0x14f6('0x39')]=_[_0x14f6('0x3a')](_0x1fa257[_0x14f6('0x34')],qs[_0x14f6('0x3b')](_0x59eb67[_0x14f6('0x36')]['fields']));_0x3a3f88[_0x14f6('0x39')]=_0x3a3f88['attributes'][_0x14f6('0x3c')]?_0x3a3f88[_0x14f6('0x39')]:_0x1fa257[_0x14f6('0x34')];if(_0x59eb67[_0x14f6('0x36')]['includeAll']){_0x3a3f88[_0x14f6('0x4a')]=[{'all':!![]}];}_0x3a3f88=_[_0x14f6('0x4b')]({},_0x3a3f88,_0x59eb67[_0x14f6('0x44')]);return db[_0x14f6('0x30')][_0x14f6('0x4c')](_0x3a3f88)[_0x14f6('0x27')](handleEntityNotFound(_0x5043f6,null))[_0x14f6('0x27')](respondWithResult(_0x5043f6,null))['catch'](handleError(_0x5043f6,null));};exports[_0x14f6('0x4d')]=function(_0x15c5e0,_0x36d774){return db[_0x14f6('0x30')]['create'](_0x15c5e0['body'],{})[_0x14f6('0x27')](function(_0xb724c0){var _0x3fc634=_0x15c5e0[_0x14f6('0x4e')][_0x14f6('0x29')]({'plain':!![]});if(!_0x3fc634)throw new Error(_0x14f6('0x4f'));if(_0x3fc634[_0x14f6('0x50')]===_0x14f6('0x4e')){var _0x214d79=_0xb724c0[_0x14f6('0x29')]({'plain':!![]});var _0x2606a8='CmHopperAdditionalPhones';return db[_0x14f6('0x51')][_0x14f6('0x4c')]({'where':{'name':_0x2606a8,'userProfileId':_0x3fc634[_0x14f6('0x52')]},'raw':!![]})[_0x14f6('0x27')](function(_0x306d9d){if(_0x306d9d&&_0x306d9d[_0x14f6('0x53')]===0x0){return db[_0x14f6('0x54')][_0x14f6('0x4d')]({'name':_0x214d79['name'],'resourceId':_0x214d79['id'],'type':_0x306d9d[_0x14f6('0x2d')],'sectionId':_0x306d9d['id']},{})['then'](function(){return _0xb724c0;});}else{return _0xb724c0;}})['catch'](function(_0x513d9e){logger[_0x14f6('0x2b')](_0x14f6('0x55'),_0x513d9e);throw _0x513d9e;});}return _0xb724c0;})[_0x14f6('0x27')](respondWithResult(_0x36d774,0xc9))[_0x14f6('0x47')](handleError(_0x36d774,null));};exports[_0x14f6('0x56')]=function(_0x139316,_0x3fbeb3){if(_0x139316[_0x14f6('0x57')]['id']){delete _0x139316['body']['id'];}return db[_0x14f6('0x30')][_0x14f6('0x4c')]({'where':{'id':_0x139316[_0x14f6('0x49')]['id']}})[_0x14f6('0x27')](handleEntityNotFound(_0x3fbeb3,null))[_0x14f6('0x27')](saveUpdates(_0x139316[_0x14f6('0x57')],null))[_0x14f6('0x27')](respondWithResult(_0x3fbeb3,null))[_0x14f6('0x47')](handleError(_0x3fbeb3,null));};exports[_0x14f6('0x28')]=function(_0xc8db54,_0x4ccee1){return db['CmHopperAdditionalPhone'][_0x14f6('0x4c')]({'where':{'id':_0xc8db54[_0x14f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x4ccee1,null))['then'](removeEntity(_0x4ccee1,null))[_0x14f6('0x47')](handleError(_0x4ccee1,null));}; \ No newline at end of file +var _0xdf96=['length','hasOwnProperty','offset','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','set','reject','update','then','destroy','get','end','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields'];(function(_0x770cda,_0x2bf304){var _0x7e7f57=function(_0x4daa5c){while(--_0x4daa5c){_0x770cda['push'](_0x770cda['shift']());}};_0x7e7f57(++_0x2bf304);}(_0xdf96,0x6e));var _0x6df9=function(_0x1ce54f,_0x4a8970){_0x1ce54f=_0x1ce54f-0x0;var _0x203698=_0xdf96[_0x1ce54f];return _0x203698;};'use strict';var emlformat=require(_0x6df9('0x0'));var rimraf=require(_0x6df9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6df9('0x2'));var rp=require(_0x6df9('0x3'));var moment=require(_0x6df9('0x4'));var BPromise=require(_0x6df9('0x5'));var Mustache=require(_0x6df9('0x6'));var util=require(_0x6df9('0x7'));var path=require(_0x6df9('0x8'));var sox=require(_0x6df9('0x9'));var csv=require(_0x6df9('0xa'));var ejs=require(_0x6df9('0xb'));var fs=require('fs');var fs_extra=require(_0x6df9('0xc'));var _=require(_0x6df9('0xd'));var squel=require(_0x6df9('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6df9('0xa'));var querystring=require(_0x6df9('0xf'));var Papa=require('papaparse');var Redis=require(_0x6df9('0x10'));var authService=require(_0x6df9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6df9('0x12'))(_0x6df9('0x13'));var utils=require('../../config/utils');var config=require(_0x6df9('0x14'));var licenseUtil=require(_0x6df9('0x15'));var db=require(_0x6df9('0x16'))['db'];function respondWithStatusCode(_0x373d74,_0x5c57fe){_0x5c57fe=_0x5c57fe||0xcc;return function(_0x4e3081){if(_0x4e3081){return _0x373d74[_0x6df9('0x17')](_0x5c57fe);}return _0x373d74[_0x6df9('0x18')](_0x5c57fe)['end']();};}function respondWithResult(_0x468026,_0x155ce1){_0x155ce1=_0x155ce1||0xc8;return function(_0xfce552){if(_0xfce552){return _0x468026[_0x6df9('0x18')](_0x155ce1)[_0x6df9('0x19')](_0xfce552);}};}function respondWithFilteredResult(_0x37c024,_0x20e9ac){return function(_0x253a16){if(_0x253a16){var _0x51eac1=typeof _0x20e9ac['offset']===_0x6df9('0x1a')&&typeof _0x20e9ac[_0x6df9('0x1b')]==='undefined';var _0x4e07e2=_0x253a16['count'];var _0x4a4f41=_0x51eac1?0x0:_0x20e9ac['offset'];var _0x21d871=_0x51eac1?_0x253a16['count']:_0x20e9ac['offset']+_0x20e9ac[_0x6df9('0x1b')];var _0x3d488f;if(_0x21d871>=_0x4e07e2){_0x21d871=_0x4e07e2;_0x3d488f=0xc8;}else{_0x3d488f=0xce;}_0x37c024[_0x6df9('0x18')](_0x3d488f);return _0x37c024[_0x6df9('0x1c')]('Content-Range',_0x4a4f41+'-'+_0x21d871+'/'+_0x4e07e2)[_0x6df9('0x19')](_0x253a16);}return null;};}function patchUpdates(_0x32e53e){return function(_0x4d67e8){try{jsonpatch['apply'](_0x4d67e8,_0x32e53e,!![]);}catch(_0xf6371){return BPromise[_0x6df9('0x1d')](_0xf6371);}return _0x4d67e8['save']();};}function saveUpdates(_0x2fe242,_0x561c11){return function(_0x8136ba){if(_0x8136ba){return _0x8136ba[_0x6df9('0x1e')](_0x2fe242)[_0x6df9('0x1f')](function(_0x34daa3){return _0x34daa3;});}return null;};}function removeEntity(_0x3971de,_0x2040cc){return function(_0x212a1c){if(_0x212a1c){return _0x212a1c[_0x6df9('0x20')]()[_0x6df9('0x1f')](function(){var _0x47b3da=_0x212a1c[_0x6df9('0x21')]({'plain':!![]});var _0x3e28ce='CmHopperAdditionalPhones';return db['UserProfileResource'][_0x6df9('0x20')]({'where':{'type':_0x3e28ce,'resourceId':_0x47b3da['id']}})[_0x6df9('0x1f')](function(){return _0x212a1c;});})[_0x6df9('0x1f')](function(){_0x3971de[_0x6df9('0x18')](0xcc)[_0x6df9('0x22')]();});}};}function handleEntityNotFound(_0x3da9f7,_0x3c408f){return function(_0xead212){if(!_0xead212){_0x3da9f7['sendStatus'](0x194);}return _0xead212;};}function handleError(_0x3eb995,_0x3d79f2){_0x3d79f2=_0x3d79f2||0x1f4;return function(_0x1b8643){logger[_0x6df9('0x23')](_0x1b8643[_0x6df9('0x24')]);if(_0x1b8643[_0x6df9('0x25')]){delete _0x1b8643['name'];}_0x3eb995[_0x6df9('0x18')](_0x3d79f2)[_0x6df9('0x26')](_0x1b8643);};}exports[_0x6df9('0x27')]=function(_0x5c2837,_0x1d3802){var _0x2f5833={},_0x5cc85d={},_0x5f1851={'count':0x0,'rows':[]};var _0xac48be=_[_0x6df9('0x28')](db[_0x6df9('0x29')][_0x6df9('0x2a')],function(_0x332a86){return{'name':_0x332a86[_0x6df9('0x2b')],'type':_0x332a86[_0x6df9('0x2c')][_0x6df9('0x2d')]};});_0x5cc85d['model']=_['map'](_0xac48be,_0x6df9('0x25'));_0x5cc85d[_0x6df9('0x2e')]=_['keys'](_0x5c2837['query']);_0x5cc85d[_0x6df9('0x2f')]=_['intersection'](_0x5cc85d[_0x6df9('0x30')],_0x5cc85d[_0x6df9('0x2e')]);_0x2f5833[_0x6df9('0x31')]=_[_0x6df9('0x32')](_0x5cc85d[_0x6df9('0x30')],qs['fields'](_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x33')]));_0x2f5833['attributes']=_0x2f5833[_0x6df9('0x31')][_0x6df9('0x34')]?_0x2f5833[_0x6df9('0x31')]:_0x5cc85d[_0x6df9('0x30')];if(!_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x35')]('nolimit')){_0x2f5833[_0x6df9('0x1b')]=qs['limit'](_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x1b')]);_0x2f5833[_0x6df9('0x36')]=qs['offset'](_0x5c2837['query'][_0x6df9('0x36')]);}_0x2f5833['order']=qs[_0x6df9('0x37')](_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x37')]);_0x2f5833[_0x6df9('0x38')]=qs[_0x6df9('0x2f')](_[_0x6df9('0x39')](_0x5c2837[_0x6df9('0x2e')],_0x5cc85d['filters']),_0xac48be);if(_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x3a')]){_0x2f5833[_0x6df9('0x38')]=_[_0x6df9('0x3b')](_0x2f5833['where'],{'$or':_[_0x6df9('0x28')](_0xac48be,function(_0x2c5de4){if(_0x2c5de4['type']!==_0x6df9('0x3c')){var _0x46d4df={};_0x46d4df[_0x2c5de4[_0x6df9('0x25')]]={'$like':'%'+_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x3a')]+'%'};return _0x46d4df;}})});}_0x2f5833=_[_0x6df9('0x3b')]({},_0x2f5833,_0x5c2837['options']);var _0x1b48f5={'where':_0x2f5833[_0x6df9('0x38')]};return db[_0x6df9('0x29')]['count'](_0x1b48f5)[_0x6df9('0x1f')](function(_0xe01ff4){_0x5f1851['count']=_0xe01ff4;if(_0x5c2837[_0x6df9('0x2e')][_0x6df9('0x3d')]){_0x2f5833[_0x6df9('0x3e')]=[{'all':!![]}];}return db[_0x6df9('0x29')][_0x6df9('0x3f')](_0x2f5833);})[_0x6df9('0x1f')](function(_0x228040){_0x5f1851['rows']=_0x228040;return _0x5f1851;})[_0x6df9('0x1f')](respondWithFilteredResult(_0x1d3802,_0x2f5833))[_0x6df9('0x40')](handleError(_0x1d3802,null));};exports[_0x6df9('0x41')]=function(_0x33130e,_0x47066e){var _0x232035={'raw':!![],'where':{'id':_0x33130e[_0x6df9('0x42')]['id']}},_0x5467a7={};_0x5467a7[_0x6df9('0x30')]=_[_0x6df9('0x43')](db[_0x6df9('0x29')][_0x6df9('0x2a')]);_0x5467a7[_0x6df9('0x2e')]=_[_0x6df9('0x43')](_0x33130e['query']);_0x5467a7['filters']=_[_0x6df9('0x32')](_0x5467a7[_0x6df9('0x30')],_0x5467a7['query']);_0x232035[_0x6df9('0x31')]=_['intersection'](_0x5467a7['model'],qs[_0x6df9('0x33')](_0x33130e[_0x6df9('0x2e')][_0x6df9('0x33')]));_0x232035['attributes']=_0x232035[_0x6df9('0x31')]['length']?_0x232035[_0x6df9('0x31')]:_0x5467a7[_0x6df9('0x30')];if(_0x33130e[_0x6df9('0x2e')][_0x6df9('0x3d')]){_0x232035[_0x6df9('0x3e')]=[{'all':!![]}];}_0x232035=_[_0x6df9('0x3b')]({},_0x232035,_0x33130e[_0x6df9('0x44')]);return db[_0x6df9('0x29')][_0x6df9('0x45')](_0x232035)[_0x6df9('0x1f')](handleEntityNotFound(_0x47066e,null))[_0x6df9('0x1f')](respondWithResult(_0x47066e,null))[_0x6df9('0x40')](handleError(_0x47066e,null));};exports[_0x6df9('0x46')]=function(_0x3cf8bf,_0x453780){return db[_0x6df9('0x29')]['create'](_0x3cf8bf[_0x6df9('0x47')],{})[_0x6df9('0x1f')](function(_0x3b4218){var _0x4b8c90=_0x3cf8bf[_0x6df9('0x48')][_0x6df9('0x21')]({'plain':!![]});if(!_0x4b8c90)throw new Error(_0x6df9('0x49'));if(_0x4b8c90[_0x6df9('0x4a')]===_0x6df9('0x48')){var _0x5ae0fe=_0x3b4218[_0x6df9('0x21')]({'plain':!![]});var _0x46c289=_0x6df9('0x4b');return db[_0x6df9('0x4c')][_0x6df9('0x45')]({'where':{'name':_0x46c289,'userProfileId':_0x4b8c90[_0x6df9('0x4d')]},'raw':!![]})[_0x6df9('0x1f')](function(_0xbe71f7){if(_0xbe71f7&&_0xbe71f7[_0x6df9('0x4e')]===0x0){return db[_0x6df9('0x4f')][_0x6df9('0x46')]({'name':_0x5ae0fe[_0x6df9('0x25')],'resourceId':_0x5ae0fe['id'],'type':_0xbe71f7[_0x6df9('0x25')],'sectionId':_0xbe71f7['id']},{})[_0x6df9('0x1f')](function(){return _0x3b4218;});}else{return _0x3b4218;}})[_0x6df9('0x40')](function(_0x495578){logger['error'](_0x6df9('0x50'),_0x495578);throw _0x495578;});}return _0x3b4218;})[_0x6df9('0x1f')](respondWithResult(_0x453780,0xc9))['catch'](handleError(_0x453780,null));};exports[_0x6df9('0x1e')]=function(_0x119ac9,_0x26accd){if(_0x119ac9[_0x6df9('0x47')]['id']){delete _0x119ac9[_0x6df9('0x47')]['id'];}return db[_0x6df9('0x29')]['find']({'where':{'id':_0x119ac9[_0x6df9('0x42')]['id']}})[_0x6df9('0x1f')](handleEntityNotFound(_0x26accd,null))[_0x6df9('0x1f')](saveUpdates(_0x119ac9[_0x6df9('0x47')],null))[_0x6df9('0x1f')](respondWithResult(_0x26accd,null))[_0x6df9('0x40')](handleError(_0x26accd,null));};exports[_0x6df9('0x20')]=function(_0x310e4b,_0x3f444a){return db[_0x6df9('0x29')][_0x6df9('0x45')]({'where':{'id':_0x310e4b[_0x6df9('0x42')]['id']}})[_0x6df9('0x1f')](handleEntityNotFound(_0x3f444a,null))['then'](removeEntity(_0x3f444a,null))[_0x6df9('0x40')](handleError(_0x3f444a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 4e8a1b3..335dfba 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 _0x6d58=['rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x38c20b,_0x2b832b){var _0x3f37b5=function(_0x53e78c){while(--_0x53e78c){_0x38c20b['push'](_0x38c20b['shift']());}};_0x3f37b5(++_0x2b832b);}(_0x6d58,0x165));var _0x86d5=function(_0x327f83,_0x32f2a5){_0x327f83=_0x327f83-0x0;var _0x42647e=_0x6d58[_0x327f83];return _0x42647e;};'use strict';var _=require(_0x86d5('0x0'));var util=require(_0x86d5('0x1'));var logger=require('../../config/logger')(_0x86d5('0x2'));var moment=require(_0x86d5('0x3'));var BPromise=require(_0x86d5('0x4'));var rp=require(_0x86d5('0x5'));var fs=require('fs');var path=require(_0x86d5('0x6'));var rimraf=require(_0x86d5('0x7'));var config=require(_0x86d5('0x8'));var attributes=require(_0x86d5('0x9'));module[_0x86d5('0xa')]=function(_0x3a4ff4,_0x1ae315){return _0x3a4ff4[_0x86d5('0xb')](_0x86d5('0xc'),attributes,{'tableName':_0x86d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf722=['../../config/environment','exports','lodash','util','../../config/logger','api','request-promise'];(function(_0x36bf36,_0x185b5f){var _0xabc2a2=function(_0x4d447d){while(--_0x4d447d){_0x36bf36['push'](_0x36bf36['shift']());}};_0xabc2a2(++_0x185b5f);}(_0xf722,0xb1));var _0x2f72=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf722[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var logger=require(_0x2f72('0x2'))(_0x2f72('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2f72('0x5'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x2f72('0x6')]=function(_0x4e716e,_0x39dcc0){return _0x4e716e['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','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 a35de3c..35af4a6 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 _0xad26=['scheduledat','add','minutes','phone','countmachineretry','createdAt','updatedAt','sequelize','transaction','activateAdditionalPhone','IncrementPreviewCounters','update','field','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','ListId','body','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','countnoanswerretry','dialGlobalMaxRetry','SwapAdditionalPhones','waitTime','duration','isNil'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad26,0x1b1));var _0x6ad2=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xad26[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x6ad2('0x0'));var util=require(_0x6ad2('0x1'));var moment=require(_0x6ad2('0x2'));var BPromise=require(_0x6ad2('0x3'));var rs=require(_0x6ad2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ad2('0x5'))['db'];var utils=require(_0x6ad2('0x6'));var logger=require(_0x6ad2('0x7'))(_0x6ad2('0x8'));var config=require('../../config/environment');var jayson=require(_0x6ad2('0x9'));var client=jayson[_0x6ad2('0xa')][_0x6ad2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d9b17,_0xd47d4b,_0x26f002){return new BPromise(function(_0x43cab5,_0x36e3b2){return client[_0x6ad2('0xc')](_0x1d9b17,_0x26f002)['then'](function(_0x3c6335){logger['info'](_0x6ad2('0xd'),_0xd47d4b,'request\x20sent');logger[_0x6ad2('0xe')](_0x6ad2('0xf'),_0xd47d4b,_0x6ad2('0x10'),JSON['stringify'](_0x3c6335));if(_0x3c6335[_0x6ad2('0x11')]){if(_0x3c6335[_0x6ad2('0x11')][_0x6ad2('0x12')]===0x1f4){logger[_0x6ad2('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xd47d4b,_0x3c6335[_0x6ad2('0x11')][_0x6ad2('0x13')]);return _0x36e3b2(_0x3c6335[_0x6ad2('0x11')]['message']);}logger[_0x6ad2('0x11')](_0x6ad2('0xd'),_0xd47d4b,_0x3c6335[_0x6ad2('0x11')][_0x6ad2('0x13')]);return _0x43cab5(_0x3c6335[_0x6ad2('0x11')]['message']);}else{logger['info'](_0x6ad2('0xd'),_0xd47d4b,_0x6ad2('0x10'));_0x43cab5(_0x3c6335[_0x6ad2('0x14')][_0x6ad2('0x13')]);}})[_0x6ad2('0x15')](function(_0x5fe5f1){logger[_0x6ad2('0x11')](_0x6ad2('0xd'),_0xd47d4b,_0x5fe5f1);_0x36e3b2(_0x5fe5f1);});});}exports[_0x6ad2('0x16')]=function(_0x4e60a6){var _0x111ccc=this;return new Promise(function(_0xf2a799,_0x175394){return db[_0x6ad2('0x17')][_0x6ad2('0x18')]({'raw':!![],'where':{'ContactId':_0x4e60a6['body'][_0x6ad2('0x19')],'ListId':_0x4e60a6['body'][_0x6ad2('0x1a')],'VoiceQueueId':_0x4e60a6[_0x6ad2('0x1b')][_0x6ad2('0x1c')]===undefined?null:_0x4e60a6[_0x6ad2('0x1b')][_0x6ad2('0x1c')],'CampaignId':_0x4e60a6[_0x6ad2('0x1b')][_0x6ad2('0x1d')]===undefined?null:_0x4e60a6['body'][_0x6ad2('0x1d')]}})[_0x6ad2('0x1e')](function(_0x3f2b78){if(_0x3f2b78!=null){return db[_0x6ad2('0x1f')][_0x6ad2('0x18')]({'raw':!![],'where':{'CmHopperId':_0x3f2b78['id'],'OrderBy':{'$gt':_0x3f2b78['OrderBy']}},'order':[[_0x6ad2('0x20'),_0x6ad2('0x21')]]})[_0x6ad2('0x1e')](function(_0x899d75){var _0x24782c=0x0;if(_0x899d75){if(_0x899d75[_0x6ad2('0x22')]+_0x899d75[_0x6ad2('0x23')]+_0x899d75['countnoanswerretry']+_0x899d75[_0x6ad2('0x24')]+_0x899d75[_0x6ad2('0x25')]+_0x899d75[_0x6ad2('0x26')]+_0x899d75['countmachineretry']+_0x899d75[_0x6ad2('0x27')]<_0x4e60a6[_0x6ad2('0x28')]['dialGlobalMaxRetry'])_0x24782c=0x1;_0xf2a799({'additional':_0x24782c});}else{return db[_0x6ad2('0x1f')][_0x6ad2('0x18')]({'raw':!![],'where':{'CmHopperId':_0x3f2b78['id']},'order':[['OrderBy',_0x6ad2('0x21')]]})[_0x6ad2('0x1e')](function(_0x2749c){var _0x44ff61=0x0;if(_0x2749c){if(_0x2749c[_0x6ad2('0x22')]+_0x2749c['countcongestionretry']+_0x2749c[_0x6ad2('0x29')]+_0x2749c['countnosuchnumberretry']+_0x2749c['countdropretry']+_0x2749c[_0x6ad2('0x26')]+_0x2749c['countmachineretry']+_0x2749c[_0x6ad2('0x27')]<_0x4e60a6['entity'][_0x6ad2('0x2a')])_0x44ff61=0x1;_0xf2a799({'additional':_0x44ff61});}else{_0xf2a799({'additional':0x0});}})[_0x6ad2('0x15')](function(_0x32a220){logger[_0x6ad2('0x11')](_0x6ad2('0x16'),_0x32a220[_0x6ad2('0x13')]);_0x175394(_0x111ccc[_0x6ad2('0x11')](0x1f4,_0x32a220[_0x6ad2('0x13')]));});}})[_0x6ad2('0x15')](function(_0x117fe6){logger['error'](_0x6ad2('0x16'),_0x117fe6[_0x6ad2('0x13')]);_0x175394(_0x111ccc['error'](0x1f4,_0x117fe6[_0x6ad2('0x13')]));});}else _0xf2a799({'additional':0x0});});});};exports[_0x6ad2('0x2b')]=function(_0x454ccb){var _0x23a7ee=this;return new Promise(function(_0x2444ea,_0x5bb9ad){return db['CmHopper'][_0x6ad2('0x18')]({'raw':!![],'where':{'ContactId':_0x454ccb[_0x6ad2('0x1b')]['ContactId'],'ListId':_0x454ccb[_0x6ad2('0x1b')][_0x6ad2('0x1a')],'VoiceQueueId':_0x454ccb[_0x6ad2('0x1b')][_0x6ad2('0x1c')]===undefined?null:_0x454ccb['body'][_0x6ad2('0x1c')],'CampaignId':_0x454ccb['body'][_0x6ad2('0x1d')]===undefined?null:_0x454ccb[_0x6ad2('0x1b')][_0x6ad2('0x1d')]}})[_0x6ad2('0x1e')](function(_0x59cf4f){if(_0x59cf4f!=null){return db['CmHopperAdditionalPhone'][_0x6ad2('0x18')]({'raw':!![],'where':{'CmHopperId':_0x59cf4f['id'],'OrderBy':{'$gte':_0x59cf4f[_0x6ad2('0x20')]}},'order':[['OrderBy',_0x6ad2('0x21')]]})[_0x6ad2('0x1e')](function(_0x3cec3b){if(_0x3cec3b)return activateAdditionalPhone(_0x59cf4f,_0x454ccb[_0x6ad2('0x1b')],_0x3cec3b,_0x454ccb['duration'],_0x454ccb[_0x6ad2('0x2c')])[_0x6ad2('0x1e')](function(_0x392c20){_0x2444ea(_0x392c20);});else{return db['CmHopperAdditionalPhone'][_0x6ad2('0x18')]({'raw':!![],'where':{'CmHopperId':_0x59cf4f['id']},'order':[['OrderBy',_0x6ad2('0x21')]]})[_0x6ad2('0x1e')](function(_0x5b887b){if(_0x5b887b)return activateAdditionalPhone(_0x59cf4f,_0x454ccb[_0x6ad2('0x1b')],_0x5b887b,_0x454ccb[_0x6ad2('0x2d')],_0x454ccb[_0x6ad2('0x2c')])[_0x6ad2('0x1e')](function(_0x17c4c3){_0x2444ea(_0x17c4c3);});else{_0x2444ea({'id':_0x59cf4f['id'],'phone':''});}})[_0x6ad2('0x15')](function(_0x296014){logger[_0x6ad2('0x11')](_0x6ad2('0x16'),_0x296014['message']);_0x5bb9ad(_0x23a7ee[_0x6ad2('0x11')](0x1f4,_0x296014[_0x6ad2('0x13')]));});}})[_0x6ad2('0x15')](function(_0x48a60a){logger['error'](_0x6ad2('0x16'),_0x48a60a[_0x6ad2('0x13')]);_0x5bb9ad(_0x23a7ee[_0x6ad2('0x11')](0x1f4,_0x48a60a[_0x6ad2('0x13')]));});}else _0x2444ea(0x1);});});};function activateAdditionalPhone(_0xe9f023,_0x86c5f9,_0x3c11ef,_0x2b1542,_0x74a047){return new Promise(function(_0x3b2c9a,_0xa1e9a7){var _0xb7dbe9;if(_[_0x6ad2('0x2e')](_0x3c11ef[_0x6ad2('0x2f')])){_0x3c11ef[_0x6ad2('0x2f')]=moment();}if(moment()>moment(_0x3c11ef['scheduledat'])){_0xb7dbe9=moment()[_0x6ad2('0x30')](_0x74a047||0x3,_0x6ad2('0x31'));}else{if(_0x3c11ef[_0x6ad2('0x20')]==0x0){_0xb7dbe9=moment(_0x3c11ef[_0x6ad2('0x2f')]);}else{_0xb7dbe9=moment()['add'](_0x74a047||0x3,_0x6ad2('0x31'));}}if(_['isNil'](_0xb7dbe9)){_0xb7dbe9=moment()[_0x6ad2('0x30')](_0x74a047||0x3,_0x6ad2('0x31'));}var _0x126856={'phone':_0xe9f023[_0x6ad2('0x32')],'active':0x0,'OrderBy':_[_0x6ad2('0x2e')](_0xe9f023[_0x6ad2('0x20')])?0x0:_0xe9f023['OrderBy'],'scheduledat':moment()[_0x6ad2('0x30')](_0x2b1542||0x1,_0x6ad2('0x31')),'countbusyretry':_0x86c5f9[_0x6ad2('0x22')],'countcongestionretry':_0x86c5f9['countcongestionretry'],'countnoanswerretry':_0x86c5f9[_0x6ad2('0x29')],'countnosuchnumberretry':_0x86c5f9['countnosuchnumberretry'],'countdropretry':_0x86c5f9[_0x6ad2('0x25')],'countabandonedretry':_0x86c5f9[_0x6ad2('0x26')],'countmachineretry':_0x86c5f9[_0x6ad2('0x33')],'countagentrejectretry':_0x86c5f9['countagentrejectretry'],'createdAt':_0x86c5f9[_0x6ad2('0x34')],'updatedAt':_0x86c5f9[_0x6ad2('0x35')]};var _0x21ba4b={'CmHopperId':_0xe9f023['id'],'phone':_0x3c11ef['phone'],'active':0x0,'OrderBy':_[_0x6ad2('0x2e')](_0x3c11ef[_0x6ad2('0x20')])?0x0:_0x3c11ef['OrderBy'],'scheduledat':_0xb7dbe9,'countbusyretry':_0x3c11ef['countbusyretry'],'countcongestionretry':_0x3c11ef[_0x6ad2('0x23')],'countnoanswerretry':_0x3c11ef[_0x6ad2('0x29')],'countnosuchnumberretry':_0x3c11ef['countnosuchnumberretry'],'countdropretry':_0x3c11ef['countdropretry'],'countabandonedretry':_0x3c11ef[_0x6ad2('0x26')],'countmachineretry':_0x3c11ef['countmachineretry'],'countagentrejectretry':_0x3c11ef[_0x6ad2('0x27')],'createdAt':_0x3c11ef['createdAt'],'updatedAt':_0x3c11ef[_0x6ad2('0x35')]};return db[_0x6ad2('0x36')][_0x6ad2('0x37')](function(_0x5d0148){return db[_0x6ad2('0x1f')]['update'](_0x126856,{'where':{'id':_0x3c11ef['id']}},{'transaction':_0x5d0148})[_0x6ad2('0x1e')](function(){return db[_0x6ad2('0x17')]['update'](_0x21ba4b,{'where':{'id':_0xe9f023['id']}},{'transaction':_0x5d0148});});})[_0x6ad2('0x1e')](function(_0x52c2cd){_0x3b2c9a({'id':_0xe9f023['id'],'phone':_0x3c11ef[_0x6ad2('0x32')]});})[_0x6ad2('0x15')](function(_0x5e76f1){logger[_0x6ad2('0x11')](_0x6ad2('0x38'),_0x5e76f1[_0x6ad2('0x13')]);_0xa1e9a7({'error':_0x5e76f1[_0x6ad2('0x13')]});});});}exports[_0x6ad2('0x39')]=function(_0x3813aa){var _0x265b0b=this;return new Promise(function(_0x6ba2a6,_0x260142){return db[_0x6ad2('0x17')][_0x6ad2('0x3a')](_0x3813aa[_0x6ad2('0x1b')][_0x6ad2('0x3b')],{'where':{'id':_0x3813aa['body']['id']}})[_0x6ad2('0x1e')](function(_0xbda5dd){_0x6ba2a6(_0xbda5dd);})[_0x6ad2('0x15')](function(_0x4b4b3c){logger[_0x6ad2('0x11')](_0x6ad2('0x39'),_0x4b4b3c[_0x6ad2('0x13')]);_0x260142(_0x265b0b['error'](0x1f4,_0x4b4b3c[_0x6ad2('0x13')]));});});}; \ No newline at end of file +var _0xf485=['http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','findOne','countbusyretry','countnosuchnumberretry','countmachineretry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','phone','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x31b24f,_0x5609d4){var _0x3f646b=function(_0x51be24){while(--_0x51be24){_0x31b24f['push'](_0x31b24f['shift']());}};_0x3f646b(++_0x5609d4);}(_0xf485,0x1af));var _0x5f48=function(_0x5a2d02,_0x1193e4){_0x5a2d02=_0x5a2d02-0x0;var _0x22520c=_0xf485[_0x5a2d02];return _0x22520c;};'use strict';var _=require(_0x5f48('0x0'));var util=require('util');var moment=require(_0x5f48('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f48('0x2'));var fs=require('fs');var Redis=require(_0x5f48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f48('0x4'));var logger=require(_0x5f48('0x5'))(_0x5f48('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f48('0x7'));var client=jayson[_0x5f48('0x8')][_0x5f48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427713,_0x2013b2,_0x475a1a){return new BPromise(function(_0x1c33dd,_0x3ea948){return client[_0x5f48('0xa')](_0x427713,_0x475a1a)['then'](function(_0x1cfc7f){logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));logger[_0x5f48('0xe')](_0x5f48('0xf'),_0x2013b2,_0x5f48('0xd'),JSON['stringify'](_0x1cfc7f));if(_0x1cfc7f[_0x5f48('0x10')]){if(_0x1cfc7f[_0x5f48('0x10')]['code']===0x1f4){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x3ea948(_0x1cfc7f[_0x5f48('0x10')]['message']);}logger['error'](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x1c33dd(_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);}else{logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));_0x1c33dd(_0x1cfc7f['result'][_0x5f48('0x11')]);}})[_0x5f48('0x12')](function(_0x29adc2){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x29adc2);_0x3ea948(_0x29adc2);});});}exports['VerifyAdditionalPhones']=function(_0x1d6054){var _0x761798=this;return new Promise(function(_0x36896c,_0x20ad28){return db[_0x5f48('0x13')]['findOne']({'raw':!![],'where':{'ContactId':_0x1d6054[_0x5f48('0x14')][_0x5f48('0x15')],'ListId':_0x1d6054[_0x5f48('0x14')][_0x5f48('0x16')],'VoiceQueueId':_0x1d6054[_0x5f48('0x14')][_0x5f48('0x17')]===undefined?null:_0x1d6054[_0x5f48('0x14')][_0x5f48('0x17')],'CampaignId':_0x1d6054['body']['CampaignId']===undefined?null:_0x1d6054[_0x5f48('0x14')][_0x5f48('0x18')]}})['then'](function(_0x40ab87){if(_0x40ab87!=null){return db[_0x5f48('0x19')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x40ab87['id'],'OrderBy':{'$gt':_0x40ab87[_0x5f48('0x1a')]}},'order':[['OrderBy',_0x5f48('0x1b')]]})[_0x5f48('0x1c')](function(_0x181fc5){var _0x4b99a7=0x0;if(_0x181fc5){if(_0x181fc5['countbusyretry']+_0x181fc5[_0x5f48('0x1d')]+_0x181fc5[_0x5f48('0x1e')]+_0x181fc5['countnosuchnumberretry']+_0x181fc5['countdropretry']+_0x181fc5[_0x5f48('0x1f')]+_0x181fc5['countmachineretry']+_0x181fc5[_0x5f48('0x20')]<_0x1d6054[_0x5f48('0x21')][_0x5f48('0x22')])_0x4b99a7=0x1;_0x36896c({'additional':_0x4b99a7});}else{return db[_0x5f48('0x19')][_0x5f48('0x23')]({'raw':!![],'where':{'CmHopperId':_0x40ab87['id']},'order':[[_0x5f48('0x1a'),_0x5f48('0x1b')]]})[_0x5f48('0x1c')](function(_0x16a0cd){var _0x4731ab=0x0;if(_0x16a0cd){if(_0x16a0cd[_0x5f48('0x24')]+_0x16a0cd[_0x5f48('0x1d')]+_0x16a0cd[_0x5f48('0x1e')]+_0x16a0cd[_0x5f48('0x25')]+_0x16a0cd['countdropretry']+_0x16a0cd[_0x5f48('0x1f')]+_0x16a0cd[_0x5f48('0x26')]+_0x16a0cd[_0x5f48('0x20')]<_0x1d6054['entity'][_0x5f48('0x22')])_0x4731ab=0x1;_0x36896c({'additional':_0x4731ab});}else{_0x36896c({'additional':0x0});}})[_0x5f48('0x12')](function(_0x1a244a){logger[_0x5f48('0x10')](_0x5f48('0x27'),_0x1a244a['message']);_0x20ad28(_0x761798[_0x5f48('0x10')](0x1f4,_0x1a244a['message']));});}})[_0x5f48('0x12')](function(_0x432d21){logger[_0x5f48('0x10')](_0x5f48('0x27'),_0x432d21[_0x5f48('0x11')]);_0x20ad28(_0x761798[_0x5f48('0x10')](0x1f4,_0x432d21[_0x5f48('0x11')]));});}else _0x36896c({'additional':0x0});});});};exports[_0x5f48('0x28')]=function(_0x257d04){var _0x1fbd2d=this;return new Promise(function(_0xe91cc5,_0x46734d){return db['CmHopper'][_0x5f48('0x23')]({'raw':!![],'where':{'ContactId':_0x257d04[_0x5f48('0x14')][_0x5f48('0x15')],'ListId':_0x257d04['body'][_0x5f48('0x16')],'VoiceQueueId':_0x257d04['body'][_0x5f48('0x17')]===undefined?null:_0x257d04[_0x5f48('0x14')][_0x5f48('0x17')],'CampaignId':_0x257d04[_0x5f48('0x14')][_0x5f48('0x18')]===undefined?null:_0x257d04[_0x5f48('0x14')]['CampaignId']}})['then'](function(_0x4c4a21){if(_0x4c4a21!=null){return db[_0x5f48('0x19')][_0x5f48('0x23')]({'raw':!![],'where':{'CmHopperId':_0x4c4a21['id'],'OrderBy':{'$gte':_0x4c4a21['OrderBy']}},'order':[[_0x5f48('0x1a'),_0x5f48('0x1b')]]})[_0x5f48('0x1c')](function(_0x1b8784){if(_0x1b8784)return activateAdditionalPhone(_0x4c4a21,_0x257d04[_0x5f48('0x14')],_0x1b8784,_0x257d04[_0x5f48('0x29')],_0x257d04[_0x5f48('0x2a')])[_0x5f48('0x1c')](function(_0xc1a98d){_0xe91cc5(_0xc1a98d);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x4c4a21['id']},'order':[['OrderBy',_0x5f48('0x1b')]]})[_0x5f48('0x1c')](function(_0x10b9a6){if(_0x10b9a6)return activateAdditionalPhone(_0x4c4a21,_0x257d04[_0x5f48('0x14')],_0x10b9a6,_0x257d04[_0x5f48('0x29')],_0x257d04['waitTime'])[_0x5f48('0x1c')](function(_0x153267){_0xe91cc5(_0x153267);});else{_0xe91cc5({'id':_0x4c4a21['id'],'phone':''});}})[_0x5f48('0x12')](function(_0xa0c646){logger[_0x5f48('0x10')](_0x5f48('0x27'),_0xa0c646[_0x5f48('0x11')]);_0x46734d(_0x1fbd2d['error'](0x1f4,_0xa0c646[_0x5f48('0x11')]));});}})[_0x5f48('0x12')](function(_0x6c84e1){logger[_0x5f48('0x10')](_0x5f48('0x27'),_0x6c84e1['message']);_0x46734d(_0x1fbd2d['error'](0x1f4,_0x6c84e1[_0x5f48('0x11')]));});}else _0xe91cc5(0x1);});});};function activateAdditionalPhone(_0x43a7cc,_0x4a53c0,_0x1c5884,_0x5cbd30,_0x885911){return new Promise(function(_0x9b3da7,_0x4f3ff5){var _0x1baa73;if(_[_0x5f48('0x2b')](_0x1c5884['scheduledat'])){_0x1c5884['scheduledat']=moment();}if(moment()>moment(_0x1c5884[_0x5f48('0x2c')])){_0x1baa73=moment()[_0x5f48('0x2d')](_0x885911||0x3,_0x5f48('0x2e'));}else{if(_0x1c5884[_0x5f48('0x1a')]==0x0){_0x1baa73=moment(_0x1c5884[_0x5f48('0x2c')]);}else{_0x1baa73=moment()[_0x5f48('0x2d')](_0x885911||0x3,_0x5f48('0x2e'));}}if(_[_0x5f48('0x2b')](_0x1baa73)){_0x1baa73=moment()[_0x5f48('0x2d')](_0x885911||0x3,_0x5f48('0x2e'));}var _0x1460fb={'phone':_0x43a7cc['phone'],'active':0x0,'OrderBy':_[_0x5f48('0x2b')](_0x43a7cc[_0x5f48('0x1a')])?0x0:_0x43a7cc[_0x5f48('0x1a')],'scheduledat':moment()[_0x5f48('0x2d')](_0x5cbd30||0x1,'minutes'),'countbusyretry':_0x4a53c0[_0x5f48('0x24')],'countcongestionretry':_0x4a53c0['countcongestionretry'],'countnoanswerretry':_0x4a53c0[_0x5f48('0x1e')],'countnosuchnumberretry':_0x4a53c0[_0x5f48('0x25')],'countdropretry':_0x4a53c0['countdropretry'],'countabandonedretry':_0x4a53c0[_0x5f48('0x1f')],'countmachineretry':_0x4a53c0[_0x5f48('0x26')],'countagentrejectretry':_0x4a53c0[_0x5f48('0x20')],'createdAt':_0x4a53c0[_0x5f48('0x2f')],'updatedAt':_0x4a53c0['updatedAt']};var _0xf98039={'CmHopperId':_0x43a7cc['id'],'phone':_0x1c5884[_0x5f48('0x30')],'active':0x0,'OrderBy':_[_0x5f48('0x2b')](_0x1c5884[_0x5f48('0x1a')])?0x0:_0x1c5884[_0x5f48('0x1a')],'scheduledat':_0x1baa73,'countbusyretry':_0x1c5884[_0x5f48('0x24')],'countcongestionretry':_0x1c5884[_0x5f48('0x1d')],'countnoanswerretry':_0x1c5884[_0x5f48('0x1e')],'countnosuchnumberretry':_0x1c5884[_0x5f48('0x25')],'countdropretry':_0x1c5884['countdropretry'],'countabandonedretry':_0x1c5884[_0x5f48('0x1f')],'countmachineretry':_0x1c5884[_0x5f48('0x26')],'countagentrejectretry':_0x1c5884[_0x5f48('0x20')],'createdAt':_0x1c5884[_0x5f48('0x2f')],'updatedAt':_0x1c5884['updatedAt']};return db[_0x5f48('0x31')][_0x5f48('0x32')](function(_0x5b9ecc){return db[_0x5f48('0x19')][_0x5f48('0x33')](_0x1460fb,{'where':{'id':_0x1c5884['id']}},{'transaction':_0x5b9ecc})['then'](function(){return db[_0x5f48('0x13')][_0x5f48('0x33')](_0xf98039,{'where':{'id':_0x43a7cc['id']}},{'transaction':_0x5b9ecc});});})[_0x5f48('0x1c')](function(_0x5a4b69){_0x9b3da7({'id':_0x43a7cc['id'],'phone':_0x1c5884['phone']});})['catch'](function(_0x55afb4){logger[_0x5f48('0x10')](_0x5f48('0x34'),_0x55afb4[_0x5f48('0x11')]);_0x4f3ff5({'error':_0x55afb4['message']});});});}exports[_0x5f48('0x35')]=function(_0x50fae9){var _0x1676f5=this;return new Promise(function(_0x2edc25,_0xeeaee){return db['CmHopper'][_0x5f48('0x33')](_0x50fae9[_0x5f48('0x14')][_0x5f48('0x36')],{'where':{'id':_0x50fae9[_0x5f48('0x14')]['id']}})[_0x5f48('0x1c')](function(_0xd8374c){_0x2edc25(_0xd8374c);})[_0x5f48('0x12')](function(_0x11bc0d){logger[_0x5f48('0x10')](_0x5f48('0x35'),_0x11bc0d[_0x5f48('0x11')]);_0xeeaee(_0x1676f5[_0x5f48('0x10')](0x1f4,_0x11bc0d['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 574218c..a3c62d0 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 _0xf536=['isAuthenticated','show','post','create','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id'];(function(_0x27af08,_0x192c31){var _0x49eb8e=function(_0x249b6b){while(--_0x249b6b){_0x27af08['push'](_0x27af08['shift']());}};_0x49eb8e(++_0x192c31);}(_0xf536,0x106));var _0x6f53=function(_0x186222,_0x3bdfb0){_0x186222=_0x186222-0x0;var _0x226a38=_0xf536[_0x186222];return _0x226a38;};'use strict';var multer=require('multer');var util=require(_0x6f53('0x0'));var path=require('path');var timeout=require(_0x6f53('0x1'));var express=require('express');var router=express[_0x6f53('0x2')]();var fs_extra=require(_0x6f53('0x3'));var auth=require(_0x6f53('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f53('0x5'));var controller=require(_0x6f53('0x6'));router[_0x6f53('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f53('0x8')]);router['get'](_0x6f53('0x9'),auth[_0x6f53('0xa')](),controller[_0x6f53('0xb')]);router[_0x6f53('0xc')]('/',auth[_0x6f53('0xa')](),controller[_0x6f53('0xd')]);router['put']('/:id',auth[_0x6f53('0xa')](),controller[_0x6f53('0xe')]);router[_0x6f53('0xf')](_0x6f53('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x6f53('0x10')]=router; \ No newline at end of file +var _0xfac9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer','path','connect-timeout','Router'];(function(_0xff1c5d,_0x2202f2){var _0x2f801a=function(_0x269497){while(--_0x269497){_0xff1c5d['push'](_0xff1c5d['shift']());}};_0x2f801a(++_0x2202f2);}(_0xfac9,0x1d0));var _0x9fac=function(_0x2aa916,_0x1ab327){_0x2aa916=_0x2aa916-0x0;var _0x3368c9=_0xfac9[_0x2aa916];return _0x3368c9;};'use strict';var multer=require(_0x9fac('0x0'));var util=require('util');var path=require(_0x9fac('0x1'));var timeout=require(_0x9fac('0x2'));var express=require('express');var router=express[_0x9fac('0x3')]();var fs_extra=require(_0x9fac('0x4'));var auth=require(_0x9fac('0x5'));var interaction=require(_0x9fac('0x6'));var config=require(_0x9fac('0x7'));var controller=require(_0x9fac('0x8'));router[_0x9fac('0x9')]('/',auth[_0x9fac('0xa')](),controller[_0x9fac('0xb')]);router[_0x9fac('0x9')](_0x9fac('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9fac('0xa')](),controller[_0x9fac('0xd')]);router[_0x9fac('0xe')](_0x9fac('0xc'),auth['isAuthenticated'](),controller[_0x9fac('0xf')]);router[_0x9fac('0x10')](_0x9fac('0xc'),auth[_0x9fac('0xa')](),controller[_0x9fac('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 4c7bb46..3668c6b 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 _0x23f4=['INTEGER','contactListQueue','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23f4,0x1ee));var _0x423f=function(_0x2963a4,_0x4e4ac9){_0x2963a4=_0x2963a4-0x0;var _0x1322e6=_0x23f4[_0x2963a4];return _0x1322e6;};'use strict';var moment=require('moment');var Sequelize=require(_0x423f('0x0'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x423f('0x1')],'unique':_0x423f('0x2')},'ListId':{'type':Sequelize[_0x423f('0x1')],'unique':_0x423f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x423f('0x1')],'unique':_0x423f('0x2')}}; \ No newline at end of file +var _0x374c=['STRING','INTEGER','contactListQueue','sequelize','exports'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x374c,0x1e3));var _0xc374=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x374c[_0x50aa2e];return _0x5e07f0;};'use strict';var moment=require('moment');var Sequelize=require(_0xc374('0x0'));module[_0xc374('0x1')]={'phone':{'type':Sequelize[_0xc374('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc374('0x3')],'unique':_0xc374('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc374('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc374('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4ef6848..5a9edba 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 _0x7791=['name','send','index','map','CmHopperBlack','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack'];(function(_0x238988,_0x55a3bc){var _0x4705e1=function(_0x50db4a){while(--_0x50db4a){_0x238988['push'](_0x238988['shift']());}};_0x4705e1(++_0x55a3bc);}(_0x7791,0xbb));var _0x1779=function(_0x3bc304,_0x1dd725){_0x3bc304=_0x3bc304-0x0;var _0x29124e=_0x7791[_0x3bc304];return _0x29124e;};'use strict';var emlformat=require(_0x1779('0x0'));var rimraf=require(_0x1779('0x1'));var zipdir=require(_0x1779('0x2'));var jsonpatch=require(_0x1779('0x3'));var rp=require('request-promise');var moment=require(_0x1779('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1779('0x5'));var util=require('util');var path=require(_0x1779('0x6'));var sox=require(_0x1779('0x7'));var csv=require(_0x1779('0x8'));var ejs=require(_0x1779('0x9'));var fs=require('fs');var fs_extra=require(_0x1779('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1779('0xb'));var jsforce=require(_0x1779('0xc'));var deskjs=require(_0x1779('0xd'));var toCsv=require(_0x1779('0x8'));var querystring=require(_0x1779('0xe'));var Papa=require(_0x1779('0xf'));var Redis=require(_0x1779('0x10'));var authService=require(_0x1779('0x11'));var qs=require(_0x1779('0x12'));var as=require(_0x1779('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1779('0x14'))('api');var utils=require(_0x1779('0x15'));var config=require(_0x1779('0x16'));var licenseUtil=require(_0x1779('0x17'));var db=require(_0x1779('0x18'))['db'];function respondWithStatusCode(_0x313d72,_0xde5444){_0xde5444=_0xde5444||0xcc;return function(_0x3aa9e8){if(_0x3aa9e8){return _0x313d72[_0x1779('0x19')](_0xde5444);}return _0x313d72[_0x1779('0x1a')](_0xde5444)[_0x1779('0x1b')]();};}function respondWithResult(_0x510ed0,_0x4f282a){_0x4f282a=_0x4f282a||0xc8;return function(_0x2aef1d){if(_0x2aef1d){return _0x510ed0[_0x1779('0x1a')](_0x4f282a)[_0x1779('0x1c')](_0x2aef1d);}};}function respondWithFilteredResult(_0x49a4c6,_0x3da016){return function(_0x96e1ac){if(_0x96e1ac){var _0x39489f=typeof _0x3da016[_0x1779('0x1d')]===_0x1779('0x1e')&&typeof _0x3da016[_0x1779('0x1f')]===_0x1779('0x1e');var _0x56b8c5=_0x96e1ac[_0x1779('0x20')];var _0x353f92=_0x39489f?0x0:_0x3da016[_0x1779('0x1d')];var _0x3dca4c=_0x39489f?_0x96e1ac[_0x1779('0x20')]:_0x3da016[_0x1779('0x1d')]+_0x3da016[_0x1779('0x1f')];var _0x22cfd4;if(_0x3dca4c>=_0x56b8c5){_0x3dca4c=_0x56b8c5;_0x22cfd4=0xc8;}else{_0x22cfd4=0xce;}_0x49a4c6[_0x1779('0x1a')](_0x22cfd4);return _0x49a4c6[_0x1779('0x21')](_0x1779('0x22'),_0x353f92+'-'+_0x3dca4c+'/'+_0x56b8c5)['json'](_0x96e1ac);}return null;};}function patchUpdates(_0x406f1c){return function(_0x3736ce){try{jsonpatch[_0x1779('0x23')](_0x3736ce,_0x406f1c,!![]);}catch(_0x2ce3cf){return BPromise['reject'](_0x2ce3cf);}return _0x3736ce[_0x1779('0x24')]();};}function saveUpdates(_0x2842bf,_0x1a790b){return function(_0x5d95c6){if(_0x5d95c6){return _0x5d95c6['update'](_0x2842bf)[_0x1779('0x25')](function(_0xbb0078){return _0xbb0078;});}return null;};}function removeEntity(_0x46c877,_0x1b18cc){return function(_0x31344e){if(_0x31344e){return _0x31344e[_0x1779('0x26')]()['then'](function(){_0x46c877[_0x1779('0x1a')](0xcc)[_0x1779('0x1b')]();});}};}function handleEntityNotFound(_0x3f6a06,_0x4ee789){return function(_0xb0540e){if(!_0xb0540e){_0x3f6a06[_0x1779('0x19')](0x194);}return _0xb0540e;};}function handleError(_0x312505,_0xd66c3a){_0xd66c3a=_0xd66c3a||0x1f4;return function(_0x2d818b){logger[_0x1779('0x27')](_0x2d818b[_0x1779('0x28')]);if(_0x2d818b[_0x1779('0x29')]){delete _0x2d818b[_0x1779('0x29')];}_0x312505['status'](_0xd66c3a)[_0x1779('0x2a')](_0x2d818b);};}exports[_0x1779('0x2b')]=function(_0x5f281c,_0x391f63){var _0x3c39a1={},_0x1e9494={},_0x2df763={'count':0x0,'rows':[]};var _0x1248c1=_[_0x1779('0x2c')](db[_0x1779('0x2d')]['rawAttributes'],function(_0x9a302d){return{'name':_0x9a302d[_0x1779('0x2e')],'type':_0x9a302d[_0x1779('0x2f')][_0x1779('0x30')]};});_0x1e9494[_0x1779('0x31')]=_['map'](_0x1248c1,'name');_0x1e9494['query']=_[_0x1779('0x32')](_0x5f281c[_0x1779('0x33')]);_0x1e9494[_0x1779('0x34')]=_[_0x1779('0x35')](_0x1e9494[_0x1779('0x31')],_0x1e9494[_0x1779('0x33')]);_0x3c39a1[_0x1779('0x36')]=_['intersection'](_0x1e9494[_0x1779('0x31')],qs[_0x1779('0x37')](_0x5f281c[_0x1779('0x33')]['fields']));_0x3c39a1['attributes']=_0x3c39a1['attributes']['length']?_0x3c39a1[_0x1779('0x36')]:_0x1e9494['model'];if(!_0x5f281c[_0x1779('0x33')]['hasOwnProperty'](_0x1779('0x38'))){_0x3c39a1[_0x1779('0x1f')]=qs[_0x1779('0x1f')](_0x5f281c[_0x1779('0x33')]['limit']);_0x3c39a1[_0x1779('0x1d')]=qs[_0x1779('0x1d')](_0x5f281c[_0x1779('0x33')][_0x1779('0x1d')]);}_0x3c39a1['order']=qs['sort'](_0x5f281c[_0x1779('0x33')]['sort']);_0x3c39a1['where']=qs[_0x1779('0x34')](_[_0x1779('0x39')](_0x5f281c['query'],_0x1e9494[_0x1779('0x34')]),_0x1248c1);if(_0x5f281c[_0x1779('0x33')][_0x1779('0x3a')]){_0x3c39a1[_0x1779('0x3b')]=_['merge'](_0x3c39a1[_0x1779('0x3b')],{'$or':_[_0x1779('0x2c')](_0x1248c1,function(_0x1bbc8d){if(_0x1bbc8d[_0x1779('0x2f')]!==_0x1779('0x3c')){var _0x2f7e6b={};_0x2f7e6b[_0x1bbc8d[_0x1779('0x29')]]={'$like':'%'+_0x5f281c['query'][_0x1779('0x3a')]+'%'};return _0x2f7e6b;}})});}_0x3c39a1=_[_0x1779('0x3d')]({},_0x3c39a1,_0x5f281c['options']);var _0x43b8bd={'where':_0x3c39a1[_0x1779('0x3b')]};return db[_0x1779('0x2d')][_0x1779('0x20')](_0x43b8bd)[_0x1779('0x25')](function(_0x210661){_0x2df763['count']=_0x210661;if(_0x5f281c[_0x1779('0x33')]['includeAll']){_0x3c39a1[_0x1779('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1779('0x3f')](_0x3c39a1);})[_0x1779('0x25')](function(_0x9159d9){_0x2df763[_0x1779('0x40')]=_0x9159d9;return _0x2df763;})[_0x1779('0x25')](respondWithFilteredResult(_0x391f63,_0x3c39a1))[_0x1779('0x41')](handleError(_0x391f63,null));};exports[_0x1779('0x42')]=function(_0x3944ec,_0x24519f){var _0x317871={'raw':!![],'where':{'id':_0x3944ec[_0x1779('0x43')]['id']}},_0x4e03de={};_0x4e03de[_0x1779('0x31')]=_[_0x1779('0x32')](db[_0x1779('0x2d')][_0x1779('0x44')]);_0x4e03de[_0x1779('0x33')]=_['keys'](_0x3944ec[_0x1779('0x33')]);_0x4e03de[_0x1779('0x34')]=_[_0x1779('0x35')](_0x4e03de[_0x1779('0x31')],_0x4e03de[_0x1779('0x33')]);_0x317871[_0x1779('0x36')]=_[_0x1779('0x35')](_0x4e03de['model'],qs['fields'](_0x3944ec[_0x1779('0x33')]['fields']));_0x317871['attributes']=_0x317871[_0x1779('0x36')][_0x1779('0x45')]?_0x317871[_0x1779('0x36')]:_0x4e03de[_0x1779('0x31')];if(_0x3944ec[_0x1779('0x33')][_0x1779('0x46')]){_0x317871[_0x1779('0x3e')]=[{'all':!![]}];}_0x317871=_[_0x1779('0x3d')]({},_0x317871,_0x3944ec[_0x1779('0x47')]);return db[_0x1779('0x2d')][_0x1779('0x48')](_0x317871)[_0x1779('0x25')](handleEntityNotFound(_0x24519f,null))['then'](respondWithResult(_0x24519f,null))[_0x1779('0x41')](handleError(_0x24519f,null));};exports[_0x1779('0x49')]=function(_0x3c0862,_0x372706){if(_0x3c0862['body']['id']){delete _0x3c0862['body']['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3c0862[_0x1779('0x43')]['id']}})[_0x1779('0x25')](handleEntityNotFound(_0x372706,null))['then'](saveUpdates(_0x3c0862[_0x1779('0x4a')],null))['then'](respondWithResult(_0x372706,null))[_0x1779('0x41')](handleError(_0x372706,null));};exports[_0x1779('0x26')]=function(_0x267744,_0x3642f5){return db[_0x1779('0x2d')][_0x1779('0x48')]({'where':{'id':_0x267744['params']['id']}})['then'](handleEntityNotFound(_0x3642f5,null))[_0x1779('0x25')](removeEntity(_0x3642f5,null))[_0x1779('0x41')](handleError(_0x3642f5,null));};exports[_0x1779('0x4b')]=function(_0x14deb1,_0x405cc6){return db[_0x1779('0x2d')][_0x1779('0x4b')]()[_0x1779('0x25')](respondWithResult(_0x405cc6,null))['catch'](handleError(_0x405cc6,null));}; \ No newline at end of file +var _0xf2bc=['stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','describe','eml-format','rimraf','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf2bc,0x14a));var _0xcf2b=function(_0xe1b2a8,_0x38f786){_0xe1b2a8=_0xe1b2a8-0x0;var _0x554804=_0xf2bc[_0xe1b2a8];return _0x554804;};'use strict';var emlformat=require(_0xcf2b('0x0'));var rimraf=require(_0xcf2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcf2b('0x2'));var Mustache=require(_0xcf2b('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcf2b('0x4'));var ejs=require(_0xcf2b('0x5'));var fs=require('fs');var fs_extra=require(_0xcf2b('0x6'));var _=require(_0xcf2b('0x7'));var squel=require(_0xcf2b('0x8'));var crypto=require(_0xcf2b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xcf2b('0xa'));var toCsv=require('to-csv');var querystring=require(_0xcf2b('0xb'));var Papa=require(_0xcf2b('0xc'));var Redis=require(_0xcf2b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcf2b('0xe'));var as=require(_0xcf2b('0xf'));var hardwareService=require(_0xcf2b('0x10'));var logger=require(_0xcf2b('0x11'))(_0xcf2b('0x12'));var utils=require(_0xcf2b('0x13'));var config=require(_0xcf2b('0x14'));var licenseUtil=require(_0xcf2b('0x15'));var db=require(_0xcf2b('0x16'))['db'];function respondWithStatusCode(_0x564188,_0x8f4aab){_0x8f4aab=_0x8f4aab||0xcc;return function(_0x2b5925){if(_0x2b5925){return _0x564188[_0xcf2b('0x17')](_0x8f4aab);}return _0x564188[_0xcf2b('0x18')](_0x8f4aab)[_0xcf2b('0x19')]();};}function respondWithResult(_0x551a2c,_0x2e58bc){_0x2e58bc=_0x2e58bc||0xc8;return function(_0x3be92f){if(_0x3be92f){return _0x551a2c[_0xcf2b('0x18')](_0x2e58bc)[_0xcf2b('0x1a')](_0x3be92f);}};}function respondWithFilteredResult(_0x2576ea,_0x460639){return function(_0x1f9812){if(_0x1f9812){var _0x21b2a2=typeof _0x460639[_0xcf2b('0x1b')]==='undefined'&&typeof _0x460639['limit']===_0xcf2b('0x1c');var _0xa51481=_0x1f9812[_0xcf2b('0x1d')];var _0x16169f=_0x21b2a2?0x0:_0x460639[_0xcf2b('0x1b')];var _0x24e885=_0x21b2a2?_0x1f9812[_0xcf2b('0x1d')]:_0x460639[_0xcf2b('0x1b')]+_0x460639[_0xcf2b('0x1e')];var _0x3160f5;if(_0x24e885>=_0xa51481){_0x24e885=_0xa51481;_0x3160f5=0xc8;}else{_0x3160f5=0xce;}_0x2576ea[_0xcf2b('0x18')](_0x3160f5);return _0x2576ea[_0xcf2b('0x1f')](_0xcf2b('0x20'),_0x16169f+'-'+_0x24e885+'/'+_0xa51481)['json'](_0x1f9812);}return null;};}function patchUpdates(_0x71f092){return function(_0x4e98c6){try{jsonpatch[_0xcf2b('0x21')](_0x4e98c6,_0x71f092,!![]);}catch(_0x36b70d){return BPromise[_0xcf2b('0x22')](_0x36b70d);}return _0x4e98c6[_0xcf2b('0x23')]();};}function saveUpdates(_0xe5ce28,_0x311d45){return function(_0x33eaba){if(_0x33eaba){return _0x33eaba[_0xcf2b('0x24')](_0xe5ce28)[_0xcf2b('0x25')](function(_0x59ae59){return _0x59ae59;});}return null;};}function removeEntity(_0xee3e7e,_0x30b48f){return function(_0x14cde2){if(_0x14cde2){return _0x14cde2[_0xcf2b('0x26')]()[_0xcf2b('0x25')](function(){_0xee3e7e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x363e08,_0x463b13){return function(_0x1e7e0a){if(!_0x1e7e0a){_0x363e08[_0xcf2b('0x17')](0x194);}return _0x1e7e0a;};}function handleError(_0x4eb59a,_0x55fdfe){_0x55fdfe=_0x55fdfe||0x1f4;return function(_0x39fdc3){logger[_0xcf2b('0x27')](_0x39fdc3[_0xcf2b('0x28')]);if(_0x39fdc3[_0xcf2b('0x29')]){delete _0x39fdc3[_0xcf2b('0x29')];}_0x4eb59a['status'](_0x55fdfe)['send'](_0x39fdc3);};}exports[_0xcf2b('0x2a')]=function(_0x4d3b50,_0x101cb5){var _0x5d5823={},_0x16580e={},_0x30312c={'count':0x0,'rows':[]};var _0x549c05=_[_0xcf2b('0x2b')](db[_0xcf2b('0x2c')][_0xcf2b('0x2d')],function(_0x524777){return{'name':_0x524777[_0xcf2b('0x2e')],'type':_0x524777[_0xcf2b('0x2f')]['key']};});_0x16580e['model']=_[_0xcf2b('0x2b')](_0x549c05,_0xcf2b('0x29'));_0x16580e[_0xcf2b('0x30')]=_['keys'](_0x4d3b50[_0xcf2b('0x30')]);_0x16580e[_0xcf2b('0x31')]=_[_0xcf2b('0x32')](_0x16580e[_0xcf2b('0x33')],_0x16580e[_0xcf2b('0x30')]);_0x5d5823[_0xcf2b('0x34')]=_[_0xcf2b('0x32')](_0x16580e['model'],qs['fields'](_0x4d3b50[_0xcf2b('0x30')][_0xcf2b('0x35')]));_0x5d5823[_0xcf2b('0x34')]=_0x5d5823[_0xcf2b('0x34')][_0xcf2b('0x36')]?_0x5d5823[_0xcf2b('0x34')]:_0x16580e['model'];if(!_0x4d3b50['query'][_0xcf2b('0x37')]('nolimit')){_0x5d5823[_0xcf2b('0x1e')]=qs['limit'](_0x4d3b50[_0xcf2b('0x30')][_0xcf2b('0x1e')]);_0x5d5823['offset']=qs['offset'](_0x4d3b50['query']['offset']);}_0x5d5823[_0xcf2b('0x38')]=qs['sort'](_0x4d3b50[_0xcf2b('0x30')]['sort']);_0x5d5823['where']=qs['filters'](_[_0xcf2b('0x39')](_0x4d3b50[_0xcf2b('0x30')],_0x16580e[_0xcf2b('0x31')]),_0x549c05);if(_0x4d3b50['query'][_0xcf2b('0x3a')]){_0x5d5823['where']=_[_0xcf2b('0x3b')](_0x5d5823[_0xcf2b('0x3c')],{'$or':_['map'](_0x549c05,function(_0x4e0888){if(_0x4e0888[_0xcf2b('0x2f')]!==_0xcf2b('0x3d')){var _0x50def4={};_0x50def4[_0x4e0888[_0xcf2b('0x29')]]={'$like':'%'+_0x4d3b50[_0xcf2b('0x30')][_0xcf2b('0x3a')]+'%'};return _0x50def4;}})});}_0x5d5823=_[_0xcf2b('0x3b')]({},_0x5d5823,_0x4d3b50[_0xcf2b('0x3e')]);var _0x1696a8={'where':_0x5d5823[_0xcf2b('0x3c')]};return db[_0xcf2b('0x2c')]['count'](_0x1696a8)[_0xcf2b('0x25')](function(_0x21c667){_0x30312c[_0xcf2b('0x1d')]=_0x21c667;if(_0x4d3b50[_0xcf2b('0x30')][_0xcf2b('0x3f')]){_0x5d5823[_0xcf2b('0x40')]=[{'all':!![]}];}return db[_0xcf2b('0x2c')][_0xcf2b('0x41')](_0x5d5823);})['then'](function(_0x2112e5){_0x30312c[_0xcf2b('0x42')]=_0x2112e5;return _0x30312c;})[_0xcf2b('0x25')](respondWithFilteredResult(_0x101cb5,_0x5d5823))[_0xcf2b('0x43')](handleError(_0x101cb5,null));};exports[_0xcf2b('0x44')]=function(_0x47e9f8,_0x3d324a){var _0x777343={'raw':!![],'where':{'id':_0x47e9f8[_0xcf2b('0x45')]['id']}},_0x55810d={};_0x55810d[_0xcf2b('0x33')]=_[_0xcf2b('0x46')](db['CmHopperBlack'][_0xcf2b('0x2d')]);_0x55810d[_0xcf2b('0x30')]=_[_0xcf2b('0x46')](_0x47e9f8[_0xcf2b('0x30')]);_0x55810d[_0xcf2b('0x31')]=_[_0xcf2b('0x32')](_0x55810d[_0xcf2b('0x33')],_0x55810d[_0xcf2b('0x30')]);_0x777343[_0xcf2b('0x34')]=_[_0xcf2b('0x32')](_0x55810d[_0xcf2b('0x33')],qs['fields'](_0x47e9f8[_0xcf2b('0x30')][_0xcf2b('0x35')]));_0x777343[_0xcf2b('0x34')]=_0x777343['attributes'][_0xcf2b('0x36')]?_0x777343[_0xcf2b('0x34')]:_0x55810d[_0xcf2b('0x33')];if(_0x47e9f8[_0xcf2b('0x30')][_0xcf2b('0x3f')]){_0x777343[_0xcf2b('0x40')]=[{'all':!![]}];}_0x777343=_[_0xcf2b('0x3b')]({},_0x777343,_0x47e9f8['options']);return db[_0xcf2b('0x2c')][_0xcf2b('0x47')](_0x777343)[_0xcf2b('0x25')](handleEntityNotFound(_0x3d324a,null))[_0xcf2b('0x25')](respondWithResult(_0x3d324a,null))['catch'](handleError(_0x3d324a,null));};exports[_0xcf2b('0x24')]=function(_0x3872dd,_0x241da){if(_0x3872dd[_0xcf2b('0x48')]['id']){delete _0x3872dd['body']['id'];}return db[_0xcf2b('0x2c')][_0xcf2b('0x47')]({'where':{'id':_0x3872dd[_0xcf2b('0x45')]['id']}})['then'](handleEntityNotFound(_0x241da,null))[_0xcf2b('0x25')](saveUpdates(_0x3872dd['body'],null))[_0xcf2b('0x25')](respondWithResult(_0x241da,null))['catch'](handleError(_0x241da,null));};exports[_0xcf2b('0x26')]=function(_0x31a530,_0x38eeeb){return db[_0xcf2b('0x2c')][_0xcf2b('0x47')]({'where':{'id':_0x31a530[_0xcf2b('0x45')]['id']}})[_0xcf2b('0x25')](handleEntityNotFound(_0x38eeeb,null))[_0xcf2b('0x25')](removeEntity(_0x38eeeb,null))[_0xcf2b('0x43')](handleError(_0x38eeeb,null));};exports[_0xcf2b('0x49')]=function(_0x1afe67,_0x26aef4){return db[_0xcf2b('0x2c')]['describe']()[_0xcf2b('0x25')](respondWithResult(_0x26aef4,null))[_0xcf2b('0x43')](handleError(_0x26aef4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index b972d45..e40d3db 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 _0xf01c=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','lodash','util','../../config/logger'];(function(_0x5a39c3,_0x7fa035){var _0x366141=function(_0x8e64fd){while(--_0x8e64fd){_0x5a39c3['push'](_0x5a39c3['shift']());}};_0x366141(++_0x7fa035);}(_0xf01c,0x189));var _0xcf01=function(_0x21a127,_0x834064){_0x21a127=_0x21a127-0x0;var _0xf511b4=_0xf01c[_0x21a127];return _0xf511b4;};'use strict';var _=require(_0xcf01('0x0'));var util=require(_0xcf01('0x1'));var logger=require(_0xcf01('0x2'))(_0xcf01('0x3'));var moment=require(_0xcf01('0x4'));var BPromise=require(_0xcf01('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf01('0x6'));var rimraf=require(_0xcf01('0x7'));var config=require(_0xcf01('0x8'));var attributes=require(_0xcf01('0x9'));module['exports']=function(_0x52eddd,_0x47bec7){return _0x52eddd[_0xcf01('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7260=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7260,0x112));var _0x0726=function(_0x112c53,_0x3dd1d4){_0x112c53=_0x112c53-0x0;var _0x1c3297=_0x7260[_0x112c53];return _0x1c3297;};'use strict';var _=require('lodash');var util=require(_0x0726('0x0'));var logger=require(_0x0726('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0726('0x2'));var rp=require(_0x0726('0x3'));var fs=require('fs');var path=require(_0x0726('0x4'));var rimraf=require(_0x0726('0x5'));var config=require(_0x0726('0x6'));var attributes=require(_0x0726('0x7'));module[_0x0726('0x8')]=function(_0x5254fd,_0xb6ce55){return _0x5254fd[_0x0726('0x9')](_0x0726('0xa'),attributes,{'tableName':_0x0726('0xb'),'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 8043d46..c9cb6a9 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 _0x8824=['message','result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','include','map','model','then','stringify','UpdateCmHopperBlack','update','raw','DestroyCmHopperBlack','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','error','code','CmHopperBlack,\x20%s,\x20%s'];(function(_0x4d209b,_0x1a05e8){var _0xc5e693=function(_0x109c6e){while(--_0x109c6e){_0x4d209b['push'](_0x4d209b['shift']());}};_0xc5e693(++_0x1a05e8);}(_0x8824,0x1cb));var _0x4882=function(_0x4cf861,_0x247626){_0x4cf861=_0x4cf861-0x0;var _0x3ced9e=_0x8824[_0x4cf861];return _0x3ced9e;};'use strict';var _=require(_0x4882('0x0'));var util=require(_0x4882('0x1'));var moment=require(_0x4882('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4882('0x3'));var db=require(_0x4882('0x4'))['db'];var utils=require(_0x4882('0x5'));var logger=require(_0x4882('0x6'))(_0x4882('0x7'));var config=require(_0x4882('0x8'));var jayson=require(_0x4882('0x9'));var client=jayson[_0x4882('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1304bd,_0x49e609,_0x532408){return new BPromise(function(_0x4d73ac,_0x40e478){return client['request'](_0x1304bd,_0x532408)['then'](function(_0x1502f0){logger[_0x4882('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x49e609,_0x4882('0xc'));logger[_0x4882('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x49e609,'request\x20sent',JSON['stringify'](_0x1502f0));if(_0x1502f0[_0x4882('0xe')]){if(_0x1502f0[_0x4882('0xe')][_0x4882('0xf')]===0x1f4){logger[_0x4882('0xe')](_0x4882('0x10'),_0x49e609,_0x1502f0[_0x4882('0xe')]['message']);return _0x40e478(_0x1502f0['error'][_0x4882('0x11')]);}logger[_0x4882('0xe')](_0x4882('0x10'),_0x49e609,_0x1502f0[_0x4882('0xe')][_0x4882('0x11')]);return _0x4d73ac(_0x1502f0['error'][_0x4882('0x11')]);}else{logger[_0x4882('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x49e609,_0x4882('0xc'));_0x4d73ac(_0x1502f0[_0x4882('0x12')][_0x4882('0x11')]);}})[_0x4882('0x13')](function(_0x797a29){logger[_0x4882('0xe')](_0x4882('0x10'),_0x49e609,_0x797a29);_0x40e478(_0x797a29);});});}exports[_0x4882('0x14')]=function(_0x598dd3){var _0x5cee95=this;return new Promise(function(_0x2186d9,_0x4480f8){return db[_0x4882('0x15')]['findAll']({'raw':_0x598dd3[_0x4882('0x16')]?_0x598dd3[_0x4882('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x598dd3['options']?_0x598dd3[_0x4882('0x16')][_0x4882('0x17')]||null:null,'attributes':_0x598dd3[_0x4882('0x16')]?_0x598dd3[_0x4882('0x16')][_0x4882('0x18')]||null:null,'limit':_0x598dd3['options']?_0x598dd3['options']['limit']||null:null,'include':_0x598dd3['options']?_0x598dd3[_0x4882('0x16')][_0x4882('0x19')]?_['map'](_0x598dd3['options'][_0x4882('0x19')],function(_0x48b9e4){return{'model':db[_0x48b9e4['model']],'as':_0x48b9e4['as'],'attributes':_0x48b9e4[_0x4882('0x18')],'include':_0x48b9e4['include']?_[_0x4882('0x1a')](_0x48b9e4['include'],function(_0x22ac0a){return{'model':db[_0x22ac0a[_0x4882('0x1b')]],'as':_0x22ac0a['as'],'attributes':_0x22ac0a[_0x4882('0x18')],'include':_0x22ac0a['include']?_['map'](_0x22ac0a[_0x4882('0x19')],function(_0x34af4b){return{'model':db[_0x34af4b[_0x4882('0x1b')]],'as':_0x34af4b['as'],'attributes':_0x34af4b[_0x4882('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4882('0x1c')](function(_0xb795c8){logger['info']('GetCmHopperBlack',_0x598dd3);logger[_0x4882('0xd')](_0x4882('0x14'),_0x598dd3,JSON[_0x4882('0x1d')](_0xb795c8));_0x2186d9(_0xb795c8);})[_0x4882('0x13')](function(_0x4ec60e){logger[_0x4882('0xe')](_0x4882('0x14'),_0x4ec60e['message'],_0x598dd3);_0x4480f8(_0x5cee95[_0x4882('0xe')](0x1f4,_0x4ec60e[_0x4882('0x11')]));});});};exports[_0x4882('0x1e')]=function(_0xf5cae3){var _0x5d7f84=this;return new Promise(function(_0x5953fc,_0x21dc64){return db['CmHopperBlack'][_0x4882('0x1f')](_0xf5cae3['body'],{'raw':_0xf5cae3[_0x4882('0x16')]?_0xf5cae3[_0x4882('0x16')][_0x4882('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf5cae3[_0x4882('0x16')]?_0xf5cae3[_0x4882('0x16')][_0x4882('0x17')]||null:null,'attributes':_0xf5cae3[_0x4882('0x16')]?_0xf5cae3['options'][_0x4882('0x18')]||null:null,'limit':_0xf5cae3['options']?_0xf5cae3['options']['limit']||null:null})[_0x4882('0x1c')](function(_0x4a1638){logger[_0x4882('0xb')]('UpdateCmHopperBlack',_0xf5cae3);logger[_0x4882('0xd')](_0x4882('0x1e'),_0xf5cae3,JSON[_0x4882('0x1d')](_0x4a1638));_0x5953fc(_0x4a1638);})[_0x4882('0x13')](function(_0x3b7b33){logger[_0x4882('0xe')](_0x4882('0x1e'),_0x3b7b33['message'],_0xf5cae3);_0x21dc64(_0x5d7f84[_0x4882('0xe')](0x1f4,_0x3b7b33[_0x4882('0x11')]));});});};exports[_0x4882('0x21')]=function(_0x2bcff2){var _0x11de83=this;return new Promise(function(_0x591400,_0x343cc7){return db[_0x4882('0x15')]['destroy']({'where':_0x2bcff2['options']?_0x2bcff2['options'][_0x4882('0x17')]||null:null})[_0x4882('0x1c')](function(_0x42c8f1){logger['info'](_0x4882('0x21'),_0x2bcff2);logger['debug'](_0x4882('0x21'),_0x2bcff2,JSON[_0x4882('0x1d')](_0x42c8f1));_0x591400(_0x42c8f1);})['catch'](function(_0x2a7056){logger[_0x4882('0xe')]('DestroyCmHopperBlack',_0x2a7056[_0x4882('0x11')],_0x2bcff2);_0x343cc7(_0x11de83['error'](0x1f4,_0x2a7056[_0x4882('0x11')]));});});}; \ No newline at end of file +var _0x7c48=['model','CmHopperBlack','update','body','raw','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map'];(function(_0x2cceb1,_0x499a5b){var _0x482cb4=function(_0x538ce7){while(--_0x538ce7){_0x2cceb1['push'](_0x2cceb1['shift']());}};_0x482cb4(++_0x499a5b);}(_0x7c48,0xcc));var _0x87c4=function(_0x18b591,_0x2b65dd){_0x18b591=_0x18b591-0x0;var _0xb6773a=_0x7c48[_0x18b591];return _0xb6773a;};'use strict';var _=require(_0x87c4('0x0'));var util=require(_0x87c4('0x1'));var moment=require(_0x87c4('0x2'));var BPromise=require(_0x87c4('0x3'));var rs=require(_0x87c4('0x4'));var fs=require('fs');var Redis=require(_0x87c4('0x5'));var db=require(_0x87c4('0x6'))['db'];var utils=require(_0x87c4('0x7'));var logger=require(_0x87c4('0x8'))('rpc');var config=require(_0x87c4('0x9'));var jayson=require(_0x87c4('0xa'));var client=jayson[_0x87c4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13ab9f,_0x4169bd,_0xef8d89){return new BPromise(function(_0xd4b2dc,_0x119dba){return client[_0x87c4('0xc')](_0x13ab9f,_0xef8d89)[_0x87c4('0xd')](function(_0x13fe24){logger[_0x87c4('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x4169bd,_0x87c4('0xf'));logger[_0x87c4('0x10')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4169bd,'request\x20sent',JSON[_0x87c4('0x11')](_0x13fe24));if(_0x13fe24['error']){if(_0x13fe24[_0x87c4('0x12')][_0x87c4('0x13')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x4169bd,_0x13fe24[_0x87c4('0x12')][_0x87c4('0x14')]);return _0x119dba(_0x13fe24[_0x87c4('0x12')]['message']);}logger[_0x87c4('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x4169bd,_0x13fe24[_0x87c4('0x12')]['message']);return _0xd4b2dc(_0x13fe24['error'][_0x87c4('0x14')]);}else{logger[_0x87c4('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x4169bd,_0x87c4('0xf'));_0xd4b2dc(_0x13fe24['result']['message']);}})['catch'](function(_0x219dc0){logger[_0x87c4('0x12')](_0x87c4('0x15'),_0x4169bd,_0x219dc0);_0x119dba(_0x219dc0);});});}exports[_0x87c4('0x16')]=function(_0x32b8ac){var _0x4168a7=this;return new Promise(function(_0x8353fd,_0x3cb2d6){return db['CmHopperBlack'][_0x87c4('0x17')]({'raw':_0x32b8ac[_0x87c4('0x18')]?_0x32b8ac['options']['raw']===undefined?!![]:![]:!![],'where':_0x32b8ac[_0x87c4('0x18')]?_0x32b8ac[_0x87c4('0x18')][_0x87c4('0x19')]||null:null,'attributes':_0x32b8ac[_0x87c4('0x18')]?_0x32b8ac['options'][_0x87c4('0x1a')]||null:null,'limit':_0x32b8ac[_0x87c4('0x18')]?_0x32b8ac['options'][_0x87c4('0x1b')]||null:null,'include':_0x32b8ac[_0x87c4('0x18')]?_0x32b8ac[_0x87c4('0x18')][_0x87c4('0x1c')]?_[_0x87c4('0x1d')](_0x32b8ac[_0x87c4('0x18')][_0x87c4('0x1c')],function(_0x38ed4e){return{'model':db[_0x38ed4e[_0x87c4('0x1e')]],'as':_0x38ed4e['as'],'attributes':_0x38ed4e[_0x87c4('0x1a')],'include':_0x38ed4e[_0x87c4('0x1c')]?_[_0x87c4('0x1d')](_0x38ed4e[_0x87c4('0x1c')],function(_0x3df112){return{'model':db[_0x3df112[_0x87c4('0x1e')]],'as':_0x3df112['as'],'attributes':_0x3df112[_0x87c4('0x1a')],'include':_0x3df112['include']?_[_0x87c4('0x1d')](_0x3df112[_0x87c4('0x1c')],function(_0x43fa04){return{'model':db[_0x43fa04[_0x87c4('0x1e')]],'as':_0x43fa04['as'],'attributes':_0x43fa04[_0x87c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x87c4('0xd')](function(_0x128b52){logger[_0x87c4('0xe')](_0x87c4('0x16'),_0x32b8ac);logger[_0x87c4('0x10')](_0x87c4('0x16'),_0x32b8ac,JSON[_0x87c4('0x11')](_0x128b52));_0x8353fd(_0x128b52);})['catch'](function(_0x268355){logger[_0x87c4('0x12')]('GetCmHopperBlack',_0x268355[_0x87c4('0x14')],_0x32b8ac);_0x3cb2d6(_0x4168a7[_0x87c4('0x12')](0x1f4,_0x268355[_0x87c4('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x16caa2){var _0x4eb374=this;return new Promise(function(_0x287f83,_0x3ad8e7){return db[_0x87c4('0x1f')][_0x87c4('0x20')](_0x16caa2[_0x87c4('0x21')],{'raw':_0x16caa2[_0x87c4('0x18')]?_0x16caa2[_0x87c4('0x18')][_0x87c4('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16caa2[_0x87c4('0x18')]?_0x16caa2['options'][_0x87c4('0x19')]||null:null,'attributes':_0x16caa2[_0x87c4('0x18')]?_0x16caa2[_0x87c4('0x18')][_0x87c4('0x1a')]||null:null,'limit':_0x16caa2[_0x87c4('0x18')]?_0x16caa2[_0x87c4('0x18')][_0x87c4('0x1b')]||null:null})[_0x87c4('0xd')](function(_0x56dd6d){logger['info'](_0x87c4('0x23'),_0x16caa2);logger[_0x87c4('0x10')](_0x87c4('0x23'),_0x16caa2,JSON['stringify'](_0x56dd6d));_0x287f83(_0x56dd6d);})[_0x87c4('0x24')](function(_0x530e5f){logger['error']('UpdateCmHopperBlack',_0x530e5f[_0x87c4('0x14')],_0x16caa2);_0x3ad8e7(_0x4eb374[_0x87c4('0x12')](0x1f4,_0x530e5f['message']));});});};exports[_0x87c4('0x25')]=function(_0x2fb6d1){var _0x1c73d1=this;return new Promise(function(_0x37d6c0,_0x7420b2){return db[_0x87c4('0x1f')][_0x87c4('0x26')]({'where':_0x2fb6d1[_0x87c4('0x18')]?_0x2fb6d1['options']['where']||null:null})['then'](function(_0x4f3b12){logger['info'](_0x87c4('0x25'),_0x2fb6d1);logger[_0x87c4('0x10')]('DestroyCmHopperBlack',_0x2fb6d1,JSON[_0x87c4('0x11')](_0x4f3b12));_0x37d6c0(_0x4f3b12);})['catch'](function(_0x29b684){logger[_0x87c4('0x12')]('DestroyCmHopperBlack',_0x29b684[_0x87c4('0x14')],_0x2fb6d1);_0x7420b2(_0x1c73d1[_0x87c4('0x12')](0x1f4,_0x29b684[_0x87c4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8404491..48bf9ab 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 _0x2eb2=['/describe','describe','/:id','show','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x1c6d60,_0x169674){var _0x3f5d8c=function(_0x2ec592){while(--_0x2ec592){_0x1c6d60['push'](_0x1c6d60['shift']());}};_0x3f5d8c(++_0x169674);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x2eb2[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/:id',auth[_0x22eb('0x8')](),controller['update']);router['delete'](_0x22eb('0xc'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);module[_0x22eb('0x10')]=router; \ No newline at end of file +var _0x5162=['/:id','show','update','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe'];(function(_0x127b06,_0x1e1fd1){var _0x3ebe23=function(_0x2b133c){while(--_0x2b133c){_0x127b06['push'](_0x127b06['shift']());}};_0x3ebe23(++_0x1e1fd1);}(_0x5162,0x103));var _0x2516=function(_0x48f9d2,_0x33ba0d){_0x48f9d2=_0x48f9d2-0x0;var _0x5228da=_0x5162[_0x48f9d2];return _0x5228da;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['put'](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2516('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index aaeae7c..fedcb0b 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 _0x987c=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x987c,0x74));var _0xc987=function(_0x5f5346,_0x250efe){_0x5f5346=_0x5f5346-0x0;var _0x16def9=_0x987c[_0x5f5346];return _0x16def9;};'use strict';var Sequelize=require(_0xc987('0x0'));var moment=require(_0xc987('0x1'));module[_0xc987('0x2')]={'state':{'type':Sequelize[_0xc987('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xc987('0x4')]},'scheduledat':{'type':Sequelize[_0xc987('0x5')]},'countbusyretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xc987('0x4')]},'calleridnum':{'type':Sequelize[_0xc987('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc987('0x5')]},'answertime':{'type':Sequelize[_0xc987('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc987('0x5')]},'ringtime':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc987('0x4')]},'campaigntype':{'type':Sequelize[_0xc987('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc987('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc987('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc987('0x4')]},'dispositionat':{'type':Sequelize[_0xc987('0x5')],'set':function(_0x10582e){var _0x82dd57=this[_0xc987('0x6')](_0xc987('0x7'));if(_0x82dd57&&_0x10582e){this[_0xc987('0x8')](_0xc987('0x9'),moment(_0x10582e)['diff'](moment(_0x82dd57),_0xc987('0xa')));}}},'amd':{'type':Sequelize[_0xc987('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc987('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc987('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xc987('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc987('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc987('0x5')]},'deleted':{'type':Sequelize[_0xc987('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc987('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xc987('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc987('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x04e7=['endtime','setDataValue','BOOLEAN','moment','INTEGER','STRING','DATE'];(function(_0x46f322,_0x583830){var _0x30b247=function(_0x6677e9){while(--_0x6677e9){_0x46f322['push'](_0x46f322['shift']());}};_0x30b247(++_0x583830);}(_0x04e7,0xa4));var _0x704e=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x04e7[_0x2e76a7];return _0x454cde;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x704e('0x0'));module['exports']={'state':{'type':Sequelize[_0x704e('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x704e('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x704e('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x704e('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x704e('0x2')]},'calleridname':{'type':Sequelize[_0x704e('0x2')]},'starttime':{'type':Sequelize[_0x704e('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x704e('0x3')]},'droptime':{'type':Sequelize[_0x704e('0x3')]},'endtime':{'type':Sequelize[_0x704e('0x3')]},'ringtime':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x704e('0x2')]},'membername':{'type':Sequelize[_0x704e('0x2')]},'reason':{'type':Sequelize[_0x704e('0x2')]},'disposition':{'type':Sequelize[_0x704e('0x2')]},'secondDisposition':{'type':Sequelize[_0x704e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x704e('0x2')]},'dispositionat':{'type':Sequelize[_0x704e('0x3')],'set':function(_0x57c2a1){var _0x116354=this['getDataValue'](_0x704e('0x4'));if(_0x116354&&_0x57c2a1){this[_0x704e('0x5')]('followuptime',moment(_0x57c2a1)['diff'](moment(_0x116354),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x704e('0x6')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x704e('0x6')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x704e('0x3')]},'callback':{'type':Sequelize[_0x704e('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x704e('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x704e('0x3')]},'deleted':{'type':Sequelize[_0x704e('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x704e('0x3')]},'recallme':{'type':Sequelize[_0x704e('0x6')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x704e('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x704e('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x704e('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 09b0029..95385b6 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 _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x187d,0x93));var _0xd187=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x187d[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));}; \ No newline at end of file +var _0x71ab=['json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','map','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','CmHopperFinal','findAll','rows','catch','show','params','rawAttributes','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','dropContacts','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','state','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x21f197,_0x38ee7e){var _0x3f070e=function(_0x3814a8){while(--_0x3814a8){_0x21f197['push'](_0x21f197['shift']());}};_0x3f070e(++_0x38ee7e);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x3401f7,_0x1a010d){return function(_0x20ed75){if(!_0x20ed75){_0x3401f7[_0xb71a('0x19')](0x194);}return _0x20ed75;};}function handleError(_0x31085b,_0x2a847a){_0x2a847a=_0x2a847a||0x1f4;return function(_0x45b849){logger[_0xb71a('0x26')](_0x45b849[_0xb71a('0x27')]);if(_0x45b849['name']){delete _0x45b849[_0xb71a('0x28')];}_0x31085b[_0xb71a('0x1a')](_0x2a847a)[_0xb71a('0x29')](_0x45b849);};}exports[_0xb71a('0x2a')]=function(_0x2fbd73,_0x38178c){var _0x44826e={},_0x25364c={},_0x42c086={'count':0x0,'rows':[]};var _0x421fcf=_[_0xb71a('0x2b')](db['CmHopperFinal']['rawAttributes'],function(_0x3112d3){return{'name':_0x3112d3['fieldName'],'type':_0x3112d3[_0xb71a('0x2c')][_0xb71a('0x2d')]};});_0x25364c['model']=_[_0xb71a('0x2b')](_0x421fcf,_0xb71a('0x28'));_0x25364c[_0xb71a('0x2e')]=_[_0xb71a('0x2f')](_0x2fbd73[_0xb71a('0x2e')]);_0x25364c[_0xb71a('0x30')]=_['intersection'](_0x25364c[_0xb71a('0x31')],_0x25364c[_0xb71a('0x2e')]);_0x44826e[_0xb71a('0x32')]=_[_0xb71a('0x33')](_0x25364c['model'],qs[_0xb71a('0x34')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x34')]));_0x44826e[_0xb71a('0x32')]=_0x44826e[_0xb71a('0x32')][_0xb71a('0x35')]?_0x44826e[_0xb71a('0x32')]:_0x25364c[_0xb71a('0x31')];if(!_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x36')]('nolimit')){_0x44826e['limit']=qs[_0xb71a('0x1f')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1f')]);_0x44826e[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x1d')]);}_0x44826e['order']=qs[_0xb71a('0x37')](_0x2fbd73['query'][_0xb71a('0x37')]);_0x44826e[_0xb71a('0x38')]=qs[_0xb71a('0x30')](_[_0xb71a('0x39')](_0x2fbd73['query'],_0x25364c[_0xb71a('0x30')]),_0x421fcf);if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]){_0x44826e[_0xb71a('0x38')]=_[_0xb71a('0x3b')](_0x44826e[_0xb71a('0x38')],{'$or':_[_0xb71a('0x2b')](_0x421fcf,function(_0x2756b9){if(_0x2756b9[_0xb71a('0x2c')]!=='VIRTUAL'){var _0x24a3af={};_0x24a3af[_0x2756b9['name']]={'$like':'%'+_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3a')]+'%'};return _0x24a3af;}})});}_0x44826e=_[_0xb71a('0x3b')]({},_0x44826e,_0x2fbd73[_0xb71a('0x3c')]);var _0xce7b8a={'where':_0x44826e[_0xb71a('0x38')]};return db['CmHopperFinal']['count'](_0xce7b8a)['then'](function(_0x35fea9){_0x42c086['count']=_0x35fea9;if(_0x2fbd73[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x44826e[_0xb71a('0x3e')]=[{'all':!![]}];}return db[_0xb71a('0x3f')][_0xb71a('0x40')](_0x44826e);})[_0xb71a('0x24')](function(_0x59530a){_0x42c086[_0xb71a('0x41')]=_0x59530a;return _0x42c086;})[_0xb71a('0x24')](respondWithFilteredResult(_0x38178c,_0x44826e))[_0xb71a('0x42')](handleError(_0x38178c,null));};exports[_0xb71a('0x43')]=function(_0x7d305,_0x2f08d2){var _0x55cbca={'raw':!![],'where':{'id':_0x7d305[_0xb71a('0x44')]['id']}},_0x2afff3={};_0x2afff3[_0xb71a('0x31')]=_[_0xb71a('0x2f')](db[_0xb71a('0x3f')][_0xb71a('0x45')]);_0x2afff3[_0xb71a('0x2e')]=_['keys'](_0x7d305['query']);_0x2afff3[_0xb71a('0x30')]=_[_0xb71a('0x33')](_0x2afff3[_0xb71a('0x31')],_0x2afff3[_0xb71a('0x2e')]);_0x55cbca['attributes']=_[_0xb71a('0x33')](_0x2afff3['model'],qs[_0xb71a('0x34')](_0x7d305[_0xb71a('0x2e')]['fields']));_0x55cbca[_0xb71a('0x32')]=_0x55cbca[_0xb71a('0x32')][_0xb71a('0x35')]?_0x55cbca[_0xb71a('0x32')]:_0x2afff3['model'];if(_0x7d305[_0xb71a('0x2e')][_0xb71a('0x3d')]){_0x55cbca[_0xb71a('0x3e')]=[{'all':!![]}];}_0x55cbca=_['merge']({},_0x55cbca,_0x7d305[_0xb71a('0x3c')]);return db[_0xb71a('0x3f')][_0xb71a('0x46')](_0x55cbca)['then'](handleEntityNotFound(_0x2f08d2,null))[_0xb71a('0x24')](respondWithResult(_0x2f08d2,null))[_0xb71a('0x42')](handleError(_0x2f08d2,null));};exports[_0xb71a('0x47')]=function(_0x1f29b7,_0x365bed){return db['CmHopperFinal'][_0xb71a('0x47')]()[_0xb71a('0x24')](respondWithResult(_0x365bed,null))[_0xb71a('0x42')](handleError(_0x365bed,null));};exports[_0xb71a('0x23')]=function(_0x489c1f,_0x48fbde){if(_0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')]){delete _0x489c1f[_0xb71a('0x48')][_0xb71a('0x49')];}return db[_0xb71a('0x3f')][_0xb71a('0x46')]({'where':{'uniqueid':_0x489c1f[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x24')](saveUpdates(_0x489c1f[_0xb71a('0x48')],null))['then'](respondWithResult(_0x48fbde,null))[_0xb71a('0x42')](handleError(_0x48fbde,null));};exports[_0xb71a('0x4a')]=function(_0x500196,_0x1c0536,_0x58116c){return db[_0xb71a('0x3f')][_0xb71a('0x40')]({'raw':![],'where':{'VoiceQueueId':_0x500196[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x54')))),'dropContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x55')))),_0xb71a('0x56')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x59')))),_0xb71a('0x5a')]]})['then'](handleEntityNotFound(_0x1c0536,null))[_0xb71a('0x24')](respondWithResult(_0x1c0536,null))[_0xb71a('0x42')](handleError(_0x1c0536,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x181a9f,_0xe55672,_0x38de3a){return db[_0xb71a('0x3f')]['findAll']({'raw':![],'where':{'CampaignId':_0x181a9f[_0xb71a('0x44')]['id']},'attributes':[[db[_0xb71a('0x4b')]['fn']('COUNT',db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x4d')))),_0xb71a('0x4e')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x5b')))),'noAnswerContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')][_0xb71a('0x4f')](_0xb71a('0x50')))),_0xb71a('0x51')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x52')))),_0xb71a('0x53')],[db['sequelize']['fn'](_0xb71a('0x4c'),db['sequelize']['fn']('IF',db[_0xb71a('0x4b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb71a('0x5c')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db[_0xb71a('0x4b')]['literal'](_0xb71a('0x55')))),'abandonedContacts'],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize']['literal'](_0xb71a('0x57')))),_0xb71a('0x58')],[db[_0xb71a('0x4b')]['fn'](_0xb71a('0x4c'),db[_0xb71a('0x4b')]['fn']('IF',db['sequelize'][_0xb71a('0x4f')](_0xb71a('0x59')))),_0xb71a('0x5a')]]})[_0xb71a('0x24')](handleEntityNotFound(_0xe55672,null))[_0xb71a('0x24')](respondWithResult(_0xe55672,null))['catch'](handleError(_0xe55672,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15b8be,_0x2dd470,_0x38a8a1){return db[_0xb71a('0x5d')][_0xb71a('0x46')]({'where':{'id':_0x15b8be[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2dd470,null))['then'](function(_0x45f4b2){var _0x27c15e;if(_0x45f4b2){_0x27c15e=squel['insert']()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),_0xb71a('0x63'),'VoiceQueueId',_0xb71a('0x64'),_0xb71a('0x65')],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),_0xb71a('0x69'))[_0xb71a('0x67')](_0xb71a('0x6a'),'scheduledAt')[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))[_0xb71a('0x67')]('ANY_VALUE(VoiceQueueId)',_0xb71a('0x6d'))['field'](_0xb71a('0x6a'),_0xb71a('0x64'))['field'](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x15b8be[_0xb71a('0x48')]['state'][_0xb71a('0x70')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')]('VoiceQueueId\x20=\x20?',_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel[_0xb71a('0x66')]()[_0xb71a('0x67')]('calleridnum')[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')](_0xb71a('0x6f'),_0x15b8be[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))[_0xb71a('0x70')]();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x27c15e);}return[];})['then'](respondWithResult(_0x2dd470,null))[_0xb71a('0x42')](handleError(_0x2dd470,null));};exports[_0xb71a('0x76')]=function(_0x28bc74,_0x575a0a,_0x1a658e){return db[_0xb71a('0x77')]['find']({'where':{'id':_0x28bc74[_0xb71a('0x44')]['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x575a0a,null))[_0xb71a('0x24')](function(_0x21b9b5){var _0x4abfd6;if(_0x21b9b5){_0x4abfd6=squel[_0xb71a('0x78')]()[_0xb71a('0x5e')](_0xb71a('0x5f'))[_0xb71a('0x60')](['phone',_0xb71a('0x61'),_0xb71a('0x62'),'ListId',_0xb71a('0x79'),_0xb71a('0x64'),'updatedAt'],squel[_0xb71a('0x66')]()[_0xb71a('0x67')](_0xb71a('0x68'),'phone')[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x61'))[_0xb71a('0x67')](_0xb71a('0x6b'),_0xb71a('0x62'))[_0xb71a('0x67')](_0xb71a('0x6c'),_0xb71a('0x63'))['field']('ANY_VALUE(CampaignId)',_0xb71a('0x79'))[_0xb71a('0x67')](_0xb71a('0x6a'),_0xb71a('0x64'))[_0xb71a('0x67')](_0xb71a('0x6a'),'updatedAt')[_0xb71a('0x6e')]('cm_hopper_final')[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id'][_0xb71a('0x70')]())['where'](_0xb71a('0x71'),_0x28bc74[_0xb71a('0x48')][_0xb71a('0x7a')][_0xb71a('0x70')]())[_0xb71a('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x69'))['from'](_0xb71a('0x5f'))[_0xb71a('0x38')](_0xb71a('0x7b'),_0x28bc74['params']['id'][_0xb71a('0x70')]()))[_0xb71a('0x38')](_0xb71a('0x72'),squel['select']()[_0xb71a('0x67')](_0xb71a('0x7c'))[_0xb71a('0x6e')](_0xb71a('0x73'))[_0xb71a('0x38')]('CampaignId\x20=\x20?',_0x28bc74[_0xb71a('0x44')]['id']['toString']())[_0xb71a('0x38')](_0xb71a('0x74')))[_0xb71a('0x75')]('ContactId'))['toString']();return db[_0xb71a('0x4b')][_0xb71a('0x2e')](_0x4abfd6);}return[];})[_0xb71a('0x24')](respondWithResult(_0x575a0a,null))[_0xb71a('0x42')](handleError(_0x575a0a,null));};exports[_0xb71a('0x7d')]=function(_0x18dfb3,_0x38ffc1,_0x442ec0){return db[_0xb71a('0x7e')][_0xb71a('0x7f')]({'where':{'VoiceQueueId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x6d')],'CampaignId':_0x18dfb3[_0xb71a('0x48')][_0xb71a('0x79')],'ContactId':_0x18dfb3[_0xb71a('0x48')]['ContactId']}})[_0xb71a('0x24')](handleEntityNotFound(_0x38ffc1,null))[_0xb71a('0x24')](function(_0x243c90){if(_0x243c90){return _0x243c90;}return null;})['then'](respondWithResult(_0x38ffc1,null))['catch'](handleError(_0x38ffc1,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 95494e5..14312c2 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 _0xa03b=['../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x2fd4a7,_0x4aec26){var _0x20ca65=function(_0x2dce3b){while(--_0x2dce3b){_0x2fd4a7['push'](_0x2fd4a7['shift']());}};_0x20ca65(++_0x4aec26);}(_0xa03b,0xb4));var _0xba03=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0xa03b[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0xba03('0x0'));var util=require(_0xba03('0x1'));var logger=require(_0xba03('0x2'))(_0xba03('0x3'));var moment=require(_0xba03('0x4'));var BPromise=require(_0xba03('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba03('0x6'));var rimraf=require('rimraf');var config=require(_0xba03('0x7'));var attributes=require(_0xba03('0x8'));module['exports']=function(_0x84c73,_0xfcfdac){return _0x84c73['define'](_0xba03('0x9'),attributes,{'tableName':_0xba03('0xa'),'paranoid':![],'indexes':[{'name':_0xba03('0xb'),'fields':[_0xba03('0xb')]},{'name':'uniqueid','fields':[_0xba03('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc36b=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf','exports','define'];(function(_0xf79080,_0xd8fefe){var _0x2994e0=function(_0x23c211){while(--_0x23c211){_0xf79080['push'](_0xf79080['shift']());}};_0x2994e0(++_0xd8fefe);}(_0xc36b,0x13c));var _0xbc36=function(_0x28e28b,_0x340c0f){_0x28e28b=_0x28e28b-0x0;var _0x40a4e1=_0xc36b[_0x28e28b];return _0x40a4e1;};'use strict';var _=require(_0xbc36('0x0'));var util=require(_0xbc36('0x1'));var logger=require(_0xbc36('0x2'))(_0xbc36('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbc36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc36('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xbc36('0x6')]=function(_0xb302c7,_0x7841ce){return _0xb302c7[_0xbc36('0x7')](_0xbc36('0x8'),attributes,{'tableName':_0xbc36('0x9'),'paranoid':![],'indexes':[{'name':_0xbc36('0xa'),'fields':['calleridnum']},{'name':_0xbc36('0xb'),'fields':[_0xbc36('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 093ea5a..8f94545 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x235949,_0x1ea646){var _0xf4d440=function(_0x180c7b){while(--_0x180c7b){_0x235949['push'](_0x235949['shift']());}};_0xf4d440(++_0x1ea646);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a9b3f,_0x158971){_0x4a9b3f=_0x4a9b3f-0x0;var _0x48b4f0=_0xb10b[_0x4a9b3f];return _0x48b4f0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0xb3a655,_0x4905b7){var _0x538d97=function(_0x231391){while(--_0x231391){_0xb3a655['push'](_0xb3a655['shift']());}};_0x538d97(++_0x4905b7);}(_0x7a54,0x106));var _0x47a5=function(_0x3d217f,_0xb33b77){_0x3d217f=_0x3d217f-0x0;var _0x52e174=_0x7a54[_0x3d217f];return _0x52e174;};'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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index ad049a2..32cccc3 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 _0x3ef7=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','exports'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x73ef('0x0'));var util=require('util');var path=require(_0x73ef('0x1'));var timeout=require(_0x73ef('0x2'));var express=require(_0x73ef('0x3'));var router=express[_0x73ef('0x4')]();var fs_extra=require(_0x73ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x73ef('0x6'));var config=require(_0x73ef('0x7'));var controller=require(_0x73ef('0x8'));router[_0x73ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x73ef('0xa')]);router[_0x73ef('0x9')](_0x73ef('0xb'),auth[_0x73ef('0xc')](),controller[_0x73ef('0xd')]);router['get'](_0x73ef('0xe'),auth[_0x73ef('0xc')](),controller['show']);router[_0x73ef('0x9')](_0x73ef('0xf'),auth[_0x73ef('0xc')](),controller[_0x73ef('0x10')]);router[_0x73ef('0x9')]('/campaign/countAttributes/:id',auth[_0x73ef('0xc')](),controller[_0x73ef('0x11')]);router[_0x73ef('0x12')](_0x73ef('0x13'),auth[_0x73ef('0xc')](),controller[_0x73ef('0x14')]);router[_0x73ef('0x12')](_0x73ef('0x15'),auth[_0x73ef('0xc')](),controller[_0x73ef('0x16')]);router[_0x73ef('0x12')](_0x73ef('0x17'),auth[_0x73ef('0xc')](),controller['checkContactHopper']);router[_0x73ef('0x18')]('/:id',auth[_0x73ef('0xc')](),controller[_0x73ef('0x19')]);module[_0x73ef('0x1a')]=router; \ No newline at end of file +var _0x5d2c=['/:id','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','put'];(function(_0x53f85e,_0x1ee067){var _0xc1ea07=function(_0x3334ff){while(--_0x3334ff){_0x53f85e['push'](_0x53f85e['shift']());}};_0xc1ea07(++_0x1ee067);}(_0x5d2c,0x144));var _0xc5d2=function(_0x2ad70b,_0x3e9813){_0x2ad70b=_0x2ad70b-0x0;var _0x8e0829=_0x5d2c[_0x2ad70b];return _0x8e0829;};'use strict';var multer=require(_0xc5d2('0x0'));var util=require('util');var path=require(_0xc5d2('0x1'));var timeout=require(_0xc5d2('0x2'));var express=require('express');var router=express[_0xc5d2('0x3')]();var fs_extra=require(_0xc5d2('0x4'));var auth=require(_0xc5d2('0x5'));var interaction=require(_0xc5d2('0x6'));var config=require(_0xc5d2('0x7'));var controller=require(_0xc5d2('0x8'));router[_0xc5d2('0x9')]('/',auth[_0xc5d2('0xa')](),controller[_0xc5d2('0xb')]);router[_0xc5d2('0x9')]('/describe',auth[_0xc5d2('0xa')](),controller[_0xc5d2('0xc')]);router[_0xc5d2('0x9')]('/:id',auth[_0xc5d2('0xa')](),controller[_0xc5d2('0xd')]);router[_0xc5d2('0x9')](_0xc5d2('0xe'),auth[_0xc5d2('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0xc5d2('0xf'),auth[_0xc5d2('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xc5d2('0x10')](_0xc5d2('0x11'),auth[_0xc5d2('0xa')](),controller[_0xc5d2('0x12')]);router[_0xc5d2('0x10')](_0xc5d2('0x13'),auth[_0xc5d2('0xa')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc5d2('0x10')]('/checkContactHopper',auth[_0xc5d2('0xa')](),controller['checkContactHopper']);router[_0xc5d2('0x14')](_0xc5d2('0x15'),auth[_0xc5d2('0xa')](),controller['update']);module[_0xc5d2('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 398ffa9..6838c19 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 _0x7622=['BOOLEAN','sequelize','INTEGER','DATE','STRING'];(function(_0x3068c8,_0x1f5504){var _0x40c6e4=function(_0x4e1f11){while(--_0x4e1f11){_0x3068c8['push'](_0x3068c8['shift']());}};_0x40c6e4(++_0x1f5504);}(_0x7622,0xba));var _0x2762=function(_0x291d80,_0x574ab4){_0x291d80=_0x291d80-0x0;var _0x35e2c6=_0x7622[_0x291d80];return _0x35e2c6;};'use strict';var Sequelize=require(_0x2762('0x0'));module['exports']={'state':{'type':Sequelize[_0x2762('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2762('0x2')]},'countbusyretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2762('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2762('0x3')]},'calleridname':{'type':Sequelize[_0x2762('0x3')]},'starttime':{'type':Sequelize[_0x2762('0x2')]},'responsetime':{'type':Sequelize[_0x2762('0x2')]},'answertime':{'type':Sequelize[_0x2762('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2762('0x2')]},'ringtime':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2762('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2762('0x3')]},'membername':{'type':Sequelize[_0x2762('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x2762('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2762('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2762('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2762('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2762('0x2')]},'recallme':{'type':Sequelize[_0x2762('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2762('0x2')]},'edited':{'type':Sequelize[_0x2762('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2762('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2762('0x3')]}}; \ No newline at end of file +var _0x78ab=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x3c4702,_0x315207){var _0x186a83=function(_0x5a2786){while(--_0x5a2786){_0x3c4702['push'](_0x3c4702['shift']());}};_0x186a83(++_0x315207);}(_0x78ab,0x81));var _0xb78a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x78ab[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xb78a('0x0'));module[_0xb78a('0x1')]={'state':{'type':Sequelize[_0xb78a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb78a('0x3')]},'scheduledat':{'type':Sequelize[_0xb78a('0x4')]},'countbusyretry':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb78a('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb78a('0x3')]},'calleridnum':{'type':Sequelize[_0xb78a('0x3')]},'calleridname':{'type':Sequelize[_0xb78a('0x3')]},'starttime':{'type':Sequelize[_0xb78a('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xb78a('0x4')]},'endtime':{'type':Sequelize[_0xb78a('0x4')]},'ringtime':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb78a('0x3')]},'campaigntype':{'type':Sequelize[_0xb78a('0x3')]},'membername':{'type':Sequelize[_0xb78a('0x3')]},'reason':{'type':Sequelize[_0xb78a('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xb78a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xb78a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb78a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb78a('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb78a('0x4')]},'edited':{'type':Sequelize[_0xb78a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb78a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb78a('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 eb14727..58be6d6 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 _0x74b4=['update','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','includeAll','rows','catch','params','keys','include','options','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x350396,_0x391ad2){var _0xf306b1=function(_0x3f2d38){while(--_0x3f2d38){_0x350396['push'](_0x350396['shift']());}};_0xf306b1(++_0x391ad2);}(_0x74b4,0x1b1));var _0x474b=function(_0x5ba506,_0x316c7a){_0x5ba506=_0x5ba506-0x0;var _0x820408=_0x74b4[_0x5ba506];return _0x820408;};'use strict';var emlformat=require(_0x474b('0x0'));var rimraf=require(_0x474b('0x1'));var zipdir=require(_0x474b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x474b('0x3'));var moment=require(_0x474b('0x4'));var BPromise=require(_0x474b('0x5'));var Mustache=require('mustache');var util=require(_0x474b('0x6'));var path=require(_0x474b('0x7'));var sox=require(_0x474b('0x8'));var csv=require('to-csv');var ejs=require(_0x474b('0x9'));var fs=require('fs');var fs_extra=require(_0x474b('0xa'));var _=require(_0x474b('0xb'));var squel=require(_0x474b('0xc'));var crypto=require(_0x474b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x474b('0xe'));var toCsv=require(_0x474b('0xf'));var querystring=require(_0x474b('0x10'));var Papa=require(_0x474b('0x11'));var Redis=require(_0x474b('0x12'));var authService=require(_0x474b('0x13'));var qs=require(_0x474b('0x14'));var as=require(_0x474b('0x15'));var hardwareService=require(_0x474b('0x16'));var logger=require('../../config/logger')(_0x474b('0x17'));var utils=require(_0x474b('0x18'));var config=require(_0x474b('0x19'));var licenseUtil=require(_0x474b('0x1a'));var db=require(_0x474b('0x1b'))['db'];function respondWithStatusCode(_0x14a90d,_0x3b1b83){_0x3b1b83=_0x3b1b83||0xcc;return function(_0x73f579){if(_0x73f579){return _0x14a90d[_0x474b('0x1c')](_0x3b1b83);}return _0x14a90d[_0x474b('0x1d')](_0x3b1b83)[_0x474b('0x1e')]();};}function respondWithResult(_0x32ac30,_0x2a0167){_0x2a0167=_0x2a0167||0xc8;return function(_0x24b1ab){if(_0x24b1ab){return _0x32ac30[_0x474b('0x1d')](_0x2a0167)[_0x474b('0x1f')](_0x24b1ab);}};}function respondWithFilteredResult(_0x2bbe9a,_0x593367){return function(_0x106acf){if(_0x106acf){var _0x56fb82=typeof _0x593367[_0x474b('0x20')]===_0x474b('0x21')&&typeof _0x593367['limit']===_0x474b('0x21');var _0x53f4a7=_0x106acf[_0x474b('0x22')];var _0x521bf6=_0x56fb82?0x0:_0x593367[_0x474b('0x20')];var _0x5c6222=_0x56fb82?_0x106acf[_0x474b('0x22')]:_0x593367[_0x474b('0x20')]+_0x593367[_0x474b('0x23')];var _0x4df539;if(_0x5c6222>=_0x53f4a7){_0x5c6222=_0x53f4a7;_0x4df539=0xc8;}else{_0x4df539=0xce;}_0x2bbe9a[_0x474b('0x1d')](_0x4df539);return _0x2bbe9a[_0x474b('0x24')](_0x474b('0x25'),_0x521bf6+'-'+_0x5c6222+'/'+_0x53f4a7)['json'](_0x106acf);}return null;};}function patchUpdates(_0x5a128a){return function(_0x5de11b){try{jsonpatch[_0x474b('0x26')](_0x5de11b,_0x5a128a,!![]);}catch(_0xdf95b){return BPromise[_0x474b('0x27')](_0xdf95b);}return _0x5de11b[_0x474b('0x28')]();};}function saveUpdates(_0x454c9f,_0xae3cf5){return function(_0x240edd){if(_0x240edd){return _0x240edd[_0x474b('0x29')](_0x454c9f)[_0x474b('0x2a')](function(_0x55e7f6){return _0x55e7f6;});}return null;};}function removeEntity(_0x4f8455,_0xfb351b){return function(_0x2f49dd){if(_0x2f49dd){return _0x2f49dd[_0x474b('0x2b')]()[_0x474b('0x2a')](function(){_0x4f8455['status'](0xcc)[_0x474b('0x1e')]();});}};}function handleEntityNotFound(_0x86b511,_0x257e3c){return function(_0xaebade){if(!_0xaebade){_0x86b511[_0x474b('0x1c')](0x194);}return _0xaebade;};}function handleError(_0x5744dd,_0x4558cc){_0x4558cc=_0x4558cc||0x1f4;return function(_0x317364){logger[_0x474b('0x2c')](_0x317364[_0x474b('0x2d')]);if(_0x317364[_0x474b('0x2e')]){delete _0x317364[_0x474b('0x2e')];}_0x5744dd[_0x474b('0x1d')](_0x4558cc)[_0x474b('0x2f')](_0x317364);};}exports['index']=function(_0x4a2963,_0x26ff67){var _0x4a00aa={},_0x5a0af9={},_0x1fc182={'count':0x0,'rows':[]};var _0x3636e2=_[_0x474b('0x30')](db[_0x474b('0x31')][_0x474b('0x32')],function(_0x4a5a9b){return{'name':_0x4a5a9b[_0x474b('0x33')],'type':_0x4a5a9b['type'][_0x474b('0x34')]};});_0x5a0af9[_0x474b('0x35')]=_['map'](_0x3636e2,_0x474b('0x2e'));_0x5a0af9['query']=_['keys'](_0x4a2963['query']);_0x5a0af9[_0x474b('0x36')]=_[_0x474b('0x37')](_0x5a0af9[_0x474b('0x35')],_0x5a0af9[_0x474b('0x38')]);_0x4a00aa[_0x474b('0x39')]=_[_0x474b('0x37')](_0x5a0af9['model'],qs['fields'](_0x4a2963[_0x474b('0x38')][_0x474b('0x3a')]));_0x4a00aa[_0x474b('0x39')]=_0x4a00aa['attributes'][_0x474b('0x3b')]?_0x4a00aa[_0x474b('0x39')]:_0x5a0af9[_0x474b('0x35')];if(!_0x4a2963['query'][_0x474b('0x3c')]('nolimit')){_0x4a00aa[_0x474b('0x23')]=qs[_0x474b('0x23')](_0x4a2963[_0x474b('0x38')][_0x474b('0x23')]);_0x4a00aa[_0x474b('0x20')]=qs[_0x474b('0x20')](_0x4a2963['query']['offset']);}_0x4a00aa[_0x474b('0x3d')]=qs[_0x474b('0x3e')](_0x4a2963[_0x474b('0x38')]['sort']);_0x4a00aa['where']=qs[_0x474b('0x36')](_[_0x474b('0x3f')](_0x4a2963[_0x474b('0x38')],_0x5a0af9[_0x474b('0x36')]),_0x3636e2);if(_0x4a2963[_0x474b('0x38')][_0x474b('0x40')]){_0x4a00aa[_0x474b('0x41')]=_['merge'](_0x4a00aa[_0x474b('0x41')],{'$or':_[_0x474b('0x30')](_0x3636e2,function(_0x5c446f){if(_0x5c446f[_0x474b('0x42')]!==_0x474b('0x43')){var _0x5bfa08={};_0x5bfa08[_0x5c446f[_0x474b('0x2e')]]={'$like':'%'+_0x4a2963[_0x474b('0x38')][_0x474b('0x40')]+'%'};return _0x5bfa08;}})});}_0x4a00aa=_['merge']({},_0x4a00aa,_0x4a2963['options']);var _0x2eb154={'where':_0x4a00aa[_0x474b('0x41')]};return db[_0x474b('0x31')][_0x474b('0x22')](_0x2eb154)[_0x474b('0x2a')](function(_0x2b0b9b){_0x1fc182[_0x474b('0x22')]=_0x2b0b9b;if(_0x4a2963[_0x474b('0x38')][_0x474b('0x44')]){_0x4a00aa['include']=[{'all':!![]}];}return db[_0x474b('0x31')]['findAll'](_0x4a00aa);})[_0x474b('0x2a')](function(_0x12fdf0){_0x1fc182[_0x474b('0x45')]=_0x12fdf0;return _0x1fc182;})['then'](respondWithFilteredResult(_0x26ff67,_0x4a00aa))[_0x474b('0x46')](handleError(_0x26ff67,null));};exports['show']=function(_0x33b33b,_0x57323e){var _0x1dd33f={'raw':!![],'where':{'id':_0x33b33b[_0x474b('0x47')]['id']}},_0xc4e7a9={};_0xc4e7a9['model']=_[_0x474b('0x48')](db[_0x474b('0x31')][_0x474b('0x32')]);_0xc4e7a9[_0x474b('0x38')]=_[_0x474b('0x48')](_0x33b33b[_0x474b('0x38')]);_0xc4e7a9['filters']=_['intersection'](_0xc4e7a9[_0x474b('0x35')],_0xc4e7a9['query']);_0x1dd33f[_0x474b('0x39')]=_['intersection'](_0xc4e7a9[_0x474b('0x35')],qs[_0x474b('0x3a')](_0x33b33b[_0x474b('0x38')]['fields']));_0x1dd33f[_0x474b('0x39')]=_0x1dd33f['attributes'][_0x474b('0x3b')]?_0x1dd33f['attributes']:_0xc4e7a9[_0x474b('0x35')];if(_0x33b33b['query']['includeAll']){_0x1dd33f[_0x474b('0x49')]=[{'all':!![]}];}_0x1dd33f=_['merge']({},_0x1dd33f,_0x33b33b[_0x474b('0x4a')]);return db[_0x474b('0x31')]['find'](_0x1dd33f)['then'](handleEntityNotFound(_0x57323e,null))[_0x474b('0x2a')](respondWithResult(_0x57323e,null))[_0x474b('0x46')](handleError(_0x57323e,null));};exports[_0x474b('0x4b')]=function(_0x533ba3,_0x13cad8){return db[_0x474b('0x31')]['create'](_0x533ba3[_0x474b('0x4c')],{})[_0x474b('0x2a')](respondWithResult(_0x13cad8,0xc9))[_0x474b('0x46')](handleError(_0x13cad8,null));};exports[_0x474b('0x4d')]=function(_0x20d3a6,_0x500368){return db['CmHopperHistory']['describe']()[_0x474b('0x2a')](respondWithResult(_0x500368,null))[_0x474b('0x46')](handleError(_0x500368,null));};exports[_0x474b('0x29')]=function(_0x3013a0,_0x7b967e){if(_0x3013a0[_0x474b('0x4c')][_0x474b('0x4e')]){delete _0x3013a0[_0x474b('0x4c')][_0x474b('0x4e')];}return db[_0x474b('0x31')]['find']({'where':{'uniqueid':_0x3013a0[_0x474b('0x47')]['id']}})[_0x474b('0x2a')](handleEntityNotFound(_0x7b967e,null))[_0x474b('0x2a')](saveUpdates(_0x3013a0[_0x474b('0x4c')],null))[_0x474b('0x2a')](respondWithResult(_0x7b967e,null))[_0x474b('0x46')](handleError(_0x7b967e,null));}; \ No newline at end of file +var _0x95a2=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','length','options','find','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x95a2,0x12a));var _0x295a=function(_0x416a0a,_0x24f91f){_0x416a0a=_0x416a0a-0x0;var _0x574c9f=_0x95a2[_0x416a0a];return _0x574c9f;};'use strict';var emlformat=require(_0x295a('0x0'));var rimraf=require(_0x295a('0x1'));var zipdir=require(_0x295a('0x2'));var jsonpatch=require(_0x295a('0x3'));var rp=require(_0x295a('0x4'));var moment=require(_0x295a('0x5'));var BPromise=require(_0x295a('0x6'));var Mustache=require('mustache');var util=require(_0x295a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x295a('0x8'));var ejs=require(_0x295a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x295a('0xa'));var squel=require(_0x295a('0xb'));var crypto=require(_0x295a('0xc'));var jsforce=require(_0x295a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x295a('0x8'));var querystring=require('querystring');var Papa=require(_0x295a('0xe'));var Redis=require(_0x295a('0xf'));var authService=require(_0x295a('0x10'));var qs=require(_0x295a('0x11'));var as=require(_0x295a('0x12'));var hardwareService=require(_0x295a('0x13'));var logger=require(_0x295a('0x14'))(_0x295a('0x15'));var utils=require(_0x295a('0x16'));var config=require(_0x295a('0x17'));var licenseUtil=require(_0x295a('0x18'));var db=require(_0x295a('0x19'))['db'];function respondWithStatusCode(_0x3cdd1a,_0x3258b2){_0x3258b2=_0x3258b2||0xcc;return function(_0xc88a06){if(_0xc88a06){return _0x3cdd1a[_0x295a('0x1a')](_0x3258b2);}return _0x3cdd1a[_0x295a('0x1b')](_0x3258b2)[_0x295a('0x1c')]();};}function respondWithResult(_0x532915,_0x50240a){_0x50240a=_0x50240a||0xc8;return function(_0x5dab21){if(_0x5dab21){return _0x532915[_0x295a('0x1b')](_0x50240a)[_0x295a('0x1d')](_0x5dab21);}};}function respondWithFilteredResult(_0x4f6335,_0x407195){return function(_0x2a477a){if(_0x2a477a){var _0x572ece=typeof _0x407195['offset']===_0x295a('0x1e')&&typeof _0x407195[_0x295a('0x1f')]==='undefined';var _0x205839=_0x2a477a[_0x295a('0x20')];var _0x1b82a5=_0x572ece?0x0:_0x407195['offset'];var _0x2836e4=_0x572ece?_0x2a477a[_0x295a('0x20')]:_0x407195[_0x295a('0x21')]+_0x407195['limit'];var _0x10fd02;if(_0x2836e4>=_0x205839){_0x2836e4=_0x205839;_0x10fd02=0xc8;}else{_0x10fd02=0xce;}_0x4f6335['status'](_0x10fd02);return _0x4f6335[_0x295a('0x22')](_0x295a('0x23'),_0x1b82a5+'-'+_0x2836e4+'/'+_0x205839)[_0x295a('0x1d')](_0x2a477a);}return null;};}function patchUpdates(_0x14d470){return function(_0x513c98){try{jsonpatch[_0x295a('0x24')](_0x513c98,_0x14d470,!![]);}catch(_0x4a86f0){return BPromise[_0x295a('0x25')](_0x4a86f0);}return _0x513c98[_0x295a('0x26')]();};}function saveUpdates(_0x3b256f,_0x4f3311){return function(_0x43a566){if(_0x43a566){return _0x43a566[_0x295a('0x27')](_0x3b256f)[_0x295a('0x28')](function(_0x5a8c11){return _0x5a8c11;});}return null;};}function removeEntity(_0x2bf93b,_0x258084){return function(_0x3ceec4){if(_0x3ceec4){return _0x3ceec4['destroy']()[_0x295a('0x28')](function(){_0x2bf93b['status'](0xcc)[_0x295a('0x1c')]();});}};}function handleEntityNotFound(_0x30ffe6,_0x3caaf2){return function(_0x4b0278){if(!_0x4b0278){_0x30ffe6[_0x295a('0x1a')](0x194);}return _0x4b0278;};}function handleError(_0x4237db,_0x3d09a3){_0x3d09a3=_0x3d09a3||0x1f4;return function(_0x76906b){logger[_0x295a('0x29')](_0x76906b[_0x295a('0x2a')]);if(_0x76906b[_0x295a('0x2b')]){delete _0x76906b[_0x295a('0x2b')];}_0x4237db[_0x295a('0x1b')](_0x3d09a3)[_0x295a('0x2c')](_0x76906b);};}exports[_0x295a('0x2d')]=function(_0x24f33d,_0x162ea2){var _0x1844ea={},_0x31a48c={},_0x191679={'count':0x0,'rows':[]};var _0x59cc70=_['map'](db[_0x295a('0x2e')][_0x295a('0x2f')],function(_0x7168fb){return{'name':_0x7168fb[_0x295a('0x30')],'type':_0x7168fb[_0x295a('0x31')][_0x295a('0x32')]};});_0x31a48c['model']=_[_0x295a('0x33')](_0x59cc70,_0x295a('0x2b'));_0x31a48c[_0x295a('0x34')]=_[_0x295a('0x35')](_0x24f33d['query']);_0x31a48c['filters']=_[_0x295a('0x36')](_0x31a48c[_0x295a('0x37')],_0x31a48c[_0x295a('0x34')]);_0x1844ea[_0x295a('0x38')]=_['intersection'](_0x31a48c[_0x295a('0x37')],qs[_0x295a('0x39')](_0x24f33d['query'][_0x295a('0x39')]));_0x1844ea[_0x295a('0x38')]=_0x1844ea[_0x295a('0x38')]['length']?_0x1844ea[_0x295a('0x38')]:_0x31a48c[_0x295a('0x37')];if(!_0x24f33d[_0x295a('0x34')][_0x295a('0x3a')](_0x295a('0x3b'))){_0x1844ea[_0x295a('0x1f')]=qs[_0x295a('0x1f')](_0x24f33d[_0x295a('0x34')][_0x295a('0x1f')]);_0x1844ea['offset']=qs[_0x295a('0x21')](_0x24f33d['query']['offset']);}_0x1844ea[_0x295a('0x3c')]=qs['sort'](_0x24f33d[_0x295a('0x34')]['sort']);_0x1844ea[_0x295a('0x3d')]=qs[_0x295a('0x3e')](_[_0x295a('0x3f')](_0x24f33d['query'],_0x31a48c[_0x295a('0x3e')]),_0x59cc70);if(_0x24f33d[_0x295a('0x34')]['filter']){_0x1844ea[_0x295a('0x3d')]=_[_0x295a('0x40')](_0x1844ea['where'],{'$or':_[_0x295a('0x33')](_0x59cc70,function(_0x1a83c8){if(_0x1a83c8[_0x295a('0x31')]!==_0x295a('0x41')){var _0x14ffbc={};_0x14ffbc[_0x1a83c8[_0x295a('0x2b')]]={'$like':'%'+_0x24f33d[_0x295a('0x34')][_0x295a('0x42')]+'%'};return _0x14ffbc;}})});}_0x1844ea=_[_0x295a('0x40')]({},_0x1844ea,_0x24f33d['options']);var _0x3a86a3={'where':_0x1844ea[_0x295a('0x3d')]};return db[_0x295a('0x2e')][_0x295a('0x20')](_0x3a86a3)[_0x295a('0x28')](function(_0x1accc9){_0x191679[_0x295a('0x20')]=_0x1accc9;if(_0x24f33d['query'][_0x295a('0x43')]){_0x1844ea[_0x295a('0x44')]=[{'all':!![]}];}return db[_0x295a('0x2e')][_0x295a('0x45')](_0x1844ea);})[_0x295a('0x28')](function(_0x3ffe01){_0x191679['rows']=_0x3ffe01;return _0x191679;})[_0x295a('0x28')](respondWithFilteredResult(_0x162ea2,_0x1844ea))[_0x295a('0x46')](handleError(_0x162ea2,null));};exports['show']=function(_0x3f1fbe,_0x4fe10c){var _0x40275f={'raw':!![],'where':{'id':_0x3f1fbe['params']['id']}},_0x255814={};_0x255814['model']=_[_0x295a('0x35')](db[_0x295a('0x2e')][_0x295a('0x2f')]);_0x255814[_0x295a('0x34')]=_[_0x295a('0x35')](_0x3f1fbe[_0x295a('0x34')]);_0x255814[_0x295a('0x3e')]=_[_0x295a('0x36')](_0x255814[_0x295a('0x37')],_0x255814[_0x295a('0x34')]);_0x40275f[_0x295a('0x38')]=_[_0x295a('0x36')](_0x255814[_0x295a('0x37')],qs[_0x295a('0x39')](_0x3f1fbe['query'][_0x295a('0x39')]));_0x40275f['attributes']=_0x40275f[_0x295a('0x38')][_0x295a('0x47')]?_0x40275f[_0x295a('0x38')]:_0x255814[_0x295a('0x37')];if(_0x3f1fbe[_0x295a('0x34')][_0x295a('0x43')]){_0x40275f[_0x295a('0x44')]=[{'all':!![]}];}_0x40275f=_[_0x295a('0x40')]({},_0x40275f,_0x3f1fbe[_0x295a('0x48')]);return db[_0x295a('0x2e')][_0x295a('0x49')](_0x40275f)[_0x295a('0x28')](handleEntityNotFound(_0x4fe10c,null))[_0x295a('0x28')](respondWithResult(_0x4fe10c,null))[_0x295a('0x46')](handleError(_0x4fe10c,null));};exports['create']=function(_0x1f5177,_0x27028d){return db[_0x295a('0x2e')][_0x295a('0x4a')](_0x1f5177[_0x295a('0x4b')],{})['then'](respondWithResult(_0x27028d,0xc9))[_0x295a('0x46')](handleError(_0x27028d,null));};exports[_0x295a('0x4c')]=function(_0x27c775,_0x3f8f7d){return db[_0x295a('0x2e')][_0x295a('0x4c')]()[_0x295a('0x28')](respondWithResult(_0x3f8f7d,null))[_0x295a('0x46')](handleError(_0x3f8f7d,null));};exports[_0x295a('0x27')]=function(_0x1e7619,_0x2aa210){if(_0x1e7619[_0x295a('0x4b')][_0x295a('0x4d')]){delete _0x1e7619[_0x295a('0x4b')][_0x295a('0x4d')];}return db['CmHopperHistory'][_0x295a('0x49')]({'where':{'uniqueid':_0x1e7619[_0x295a('0x4e')]['id']}})[_0x295a('0x28')](handleEntityNotFound(_0x2aa210,null))[_0x295a('0x28')](saveUpdates(_0x1e7619[_0x295a('0x4b')],null))[_0x295a('0x28')](respondWithResult(_0x2aa210,null))['catch'](handleError(_0x2aa210,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 1e3d149..e52cc0b 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 _0x57ef=['path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9af573,_0x373b81){var _0x4276e5=function(_0x124797){while(--_0x124797){_0x9af573['push'](_0x9af573['shift']());}};_0x4276e5(++_0x373b81);}(_0x57ef,0xdb));var _0xf57e=function(_0x2435df,_0x461a0f){_0x2435df=_0x2435df-0x0;var _0x37eaee=_0x57ef[_0x2435df];return _0x37eaee;};'use strict';var _=require('lodash');var util=require(_0xf57e('0x0'));var logger=require(_0xf57e('0x1'))(_0xf57e('0x2'));var moment=require(_0xf57e('0x3'));var BPromise=require(_0xf57e('0x4'));var rp=require(_0xf57e('0x5'));var fs=require('fs');var path=require(_0xf57e('0x6'));var rimraf=require('rimraf');var config=require(_0xf57e('0x7'));var attributes=require(_0xf57e('0x8'));module[_0xf57e('0x9')]=function(_0xf9d112,_0x31d997){return _0xf9d112[_0xf57e('0xa')](_0xf57e('0xb'),attributes,{'tableName':_0xf57e('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xf57e('0xd')]},{'name':_0xf57e('0xe'),'fields':[_0xf57e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf69c=['path','../../config/environment','exports','define','CmHopperHistory','endtime','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x78aa15,_0x26a15e){var _0x839de8=function(_0x4c46b1){while(--_0x4c46b1){_0x78aa15['push'](_0x78aa15['shift']());}};_0x839de8(++_0x26a15e);}(_0xf69c,0x151));var _0xcf69=function(_0x48a0b4,_0x2a4c3f){_0x48a0b4=_0x48a0b4-0x0;var _0x44b1e6=_0xf69c[_0x48a0b4];return _0x44b1e6;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var logger=require(_0xcf69('0x1'))(_0xcf69('0x2'));var moment=require('moment');var BPromise=require(_0xcf69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf69('0x4'));var rimraf=require('rimraf');var config=require(_0xcf69('0x5'));var attributes=require('./cmHopperHistory.attributes');module[_0xcf69('0x6')]=function(_0x168197,_0x225c65){return _0x168197[_0xcf69('0x7')](_0xcf69('0x8'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0xcf69('0x9'),'fields':[_0xcf69('0x9')]},{'name':_0xcf69('0xa'),'fields':[_0xcf69('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 31f2f41..b1f1e31 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 _0x867f=['`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','body','options','CreateCmHopperHistory','stringify','CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit'];(function(_0x49ec16,_0x5130aa){var _0x19dd9=function(_0x1b50b6){while(--_0x1b50b6){_0x49ec16['push'](_0x49ec16['shift']());}};_0x19dd9(++_0x5130aa);}(_0x867f,0xe6));var _0xf867=function(_0x4f3e33,_0x5704a8){_0x4f3e33=_0x4f3e33-0x0;var _0x1a070c=_0x867f[_0x4f3e33];return _0x1a070c;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});}exports['CreateCmHopperHistory']=function(_0x39f9e8){var _0x47dfa7=this;return new Promise(function(_0x51bdb3,_0x1a5592){return db['CmHopperHistory']['create'](_0x39f9e8[_0xf867('0x16')],{'raw':_0x39f9e8[_0xf867('0x17')]?_0x39f9e8['options']['raw']===undefined?!![]:![]:!![]})[_0xf867('0xc')](function(_0x23e7dd){logger[_0xf867('0xd')](_0xf867('0x18'),_0x39f9e8);logger[_0xf867('0x10')](_0xf867('0x18'),_0x39f9e8,JSON[_0xf867('0x19')](_0x23e7dd));_0x51bdb3(_0x23e7dd);})[_0xf867('0x15')](function(_0x586a25){logger['error'](_0xf867('0x18'),_0x586a25['message'],_0x39f9e8);_0x1a5592(_0x47dfa7[_0xf867('0x12')](0x1f4,_0x586a25[_0xf867('0x13')]));});});};exports['AvgHandleTime']=function(_0x419b6f){var _0x169f15=this;return new Promise(function(_0x53dc5a,_0x231076){return db[_0xf867('0x1a')][_0xf867('0x1b')]({'raw':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1c')]===undefined?!![]:![]:!![],'where':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1d')]||null:null,'attributes':[[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')][_0xf867('0x20')]('id')),_0xf867('0x21')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db['sequelize']['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x23')))),_0xf867('0x24')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db['sequelize'][_0xf867('0x22')](_0xf867('0x25')))),_0xf867('0x26')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0xf867('0x27')],[db['sequelize']['fn'](_0xf867('0x28'),db['sequelize']['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0xf867('0x1e')]['fn'](_0xf867('0x28'),db['sequelize']['fn']('IF',db['sequelize'][_0xf867('0x22')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xf867('0x2a')]]})[_0xf867('0xc')](function(_0x419de3){logger[_0xf867('0xd')]('AvgHandleTime',_0x419b6f);logger['debug'](_0xf867('0x2b'),_0x419b6f,JSON[_0xf867('0x19')](_0x419de3));_0x53dc5a(_0x419de3);})[_0xf867('0x15')](function(_0x50fb7d){logger[_0xf867('0x12')](_0xf867('0x2b'),_0x50fb7d['message'],_0x419b6f);_0x231076(_0x169f15[_0xf867('0x12')](0x1f4,_0x50fb7d['message']));});});};exports[_0xf867('0x2c')]=function(_0x2c7aa4){var _0x326abf=this;return new Promise(function(_0x4c47ad,_0x17e99a){return db['CmHopperHistory'][_0xf867('0x1b')]({'raw':_0x2c7aa4[_0xf867('0x17')]?_0x2c7aa4[_0xf867('0x17')][_0xf867('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c7aa4[_0xf867('0x17')]?_0x2c7aa4[_0xf867('0x17')][_0xf867('0x1d')]||null:null,'attributes':[[_0xf867('0x2d'),'name'],[db['sequelize']['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x2e')))),_0xf867('0x2f')],[db[_0xf867('0x1e')]['fn']('COUNT',db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x30')))),_0xf867('0x31')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')]['literal'](_0xf867('0x23')))),'outboundAnswerCallsDay'],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db['sequelize'][_0xf867('0x22')](_0xf867('0x32')))),_0xf867('0x33')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db['sequelize'][_0xf867('0x22')](_0xf867('0x34')))),_0xf867('0x35')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db['sequelize']['fn']('IF',db[_0xf867('0x1e')]['literal'](_0xf867('0x36')))),_0xf867('0x37')],[db['sequelize']['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x38')))),_0xf867('0x39')],[db['sequelize']['fn'](_0xf867('0x1f'),db['sequelize']['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x3a')))),_0xf867('0x3b')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xf867('0x3c')))),_0xf867('0x3d')],[db[_0xf867('0x1e')]['fn']('COUNT',db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0xf867('0x3e')],[db['sequelize']['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')](_0xf867('0x3f')))),_0xf867('0x40')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xf867('0x22')](_0xf867('0x41')))),_0xf867('0x42')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')]['literal'](_0xf867('0x43')))),_0xf867('0x40')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db['sequelize']['fn']('IF',db[_0xf867('0x1e')][_0xf867('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})[_0xf867('0xc')](function(_0x347273){logger['info'](_0xf867('0x2c'),_0x2c7aa4);logger[_0xf867('0x10')]('GetVoiceQueueHopperHistory',_0x2c7aa4,JSON[_0xf867('0x19')](_0x347273));_0x4c47ad(_0x347273);})[_0xf867('0x15')](function(_0x59d460){logger[_0xf867('0x12')](_0xf867('0x2c'),_0x59d460[_0xf867('0x13')],_0x2c7aa4);_0x17e99a(_0x326abf[_0xf867('0x12')](0x1f4,_0x59d460[_0xf867('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x4c1180){var _0x2dfea0=this;return new Promise(function(_0x319779,_0x29ac26){return db[_0xf867('0x1a')][_0xf867('0x1b')]({'raw':_0x4c1180[_0xf867('0x17')]?_0x4c1180['options'][_0xf867('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c1180[_0xf867('0x17')]?_0x4c1180[_0xf867('0x17')][_0xf867('0x1d')]||null:null,'attributes':[[_0xf867('0x2d'),_0xf867('0x44')],[db[_0xf867('0x1e')]['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')][_0xf867('0x20')]('id')),_0xf867('0x45')],[db['sequelize']['fn'](_0xf867('0x1f'),db[_0xf867('0x1e')]['fn']('IF',db[_0xf867('0x1e')]['literal'](_0xf867('0x23')))),_0xf867('0x46')]],'group':[_0xf867('0x2d')]})[_0xf867('0xc')](function(_0x550622){logger['info'](_0xf867('0x47'),_0x4c1180);logger[_0xf867('0x10')](_0xf867('0x47'),_0x4c1180,JSON[_0xf867('0x19')](_0x550622));_0x319779(_0x550622);})['catch'](function(_0x2d9794){logger['error'](_0xf867('0x47'),_0x2d9794[_0xf867('0x13')],_0x4c1180);_0x29ac26(_0x2dfea0[_0xf867('0x12')](0x1f4,_0x2d9794['message']));});});}; \ No newline at end of file +var _0x01f6=['predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CmHopperHistory','create','body','options','CreateCmHopperHistory','debug','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','literal','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x934754,_0x15bd40){var _0x5cf1fc=function(_0x2c1de6){while(--_0x2c1de6){_0x934754['push'](_0x934754['shift']());}};_0x5cf1fc(++_0x15bd40);}(_0x01f6,0xea));var _0x601f=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0x01f6[_0xbe40ad];return _0x50fac9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x601f('0x0'));var BPromise=require(_0x601f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x601f('0x2'));var db=require(_0x601f('0x3'))['db'];var utils=require(_0x601f('0x4'));var logger=require(_0x601f('0x5'))(_0x601f('0x6'));var config=require('../../config/environment');var jayson=require(_0x601f('0x7'));var client=jayson['client'][_0x601f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4822c4,_0x54bb25,_0x5c7026){return new BPromise(function(_0x3c3b38,_0x3a8d6c){return client[_0x601f('0x9')](_0x4822c4,_0x5c7026)[_0x601f('0xa')](function(_0x37335b){logger[_0x601f('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x54bb25,'request\x20sent');logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x54bb25,_0x601f('0xc'),JSON[_0x601f('0xd')](_0x37335b));if(_0x37335b['error']){if(_0x37335b[_0x601f('0xe')][_0x601f('0xf')]===0x1f4){logger[_0x601f('0xe')](_0x601f('0x10'),_0x54bb25,_0x37335b[_0x601f('0xe')]['message']);return _0x3a8d6c(_0x37335b[_0x601f('0xe')][_0x601f('0x11')]);}logger[_0x601f('0xe')](_0x601f('0x10'),_0x54bb25,_0x37335b[_0x601f('0xe')][_0x601f('0x11')]);return _0x3c3b38(_0x37335b['error']['message']);}else{logger[_0x601f('0xb')](_0x601f('0x10'),_0x54bb25,_0x601f('0xc'));_0x3c3b38(_0x37335b[_0x601f('0x12')][_0x601f('0x11')]);}})[_0x601f('0x13')](function(_0x44fdf9){logger[_0x601f('0xe')](_0x601f('0x10'),_0x54bb25,_0x44fdf9);_0x3a8d6c(_0x44fdf9);});});}exports['CreateCmHopperHistory']=function(_0x53fa67){var _0x1e2c46=this;return new Promise(function(_0x40faa0,_0x2399da){return db[_0x601f('0x14')][_0x601f('0x15')](_0x53fa67[_0x601f('0x16')],{'raw':_0x53fa67[_0x601f('0x17')]?_0x53fa67[_0x601f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x601f('0xa')](function(_0xaf88cc){logger['info'](_0x601f('0x18'),_0x53fa67);logger[_0x601f('0x19')](_0x601f('0x18'),_0x53fa67,JSON['stringify'](_0xaf88cc));_0x40faa0(_0xaf88cc);})[_0x601f('0x13')](function(_0x2210e3){logger['error']('CreateCmHopperHistory',_0x2210e3[_0x601f('0x11')],_0x53fa67);_0x2399da(_0x1e2c46['error'](0x1f4,_0x2210e3[_0x601f('0x11')]));});});};exports['AvgHandleTime']=function(_0x1c9ef3){var _0x933313=this;return new Promise(function(_0x11e1f5,_0x15fbcb){return db['CmHopperHistory'][_0x601f('0x1a')]({'raw':_0x1c9ef3['options']?_0x1c9ef3['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c9ef3[_0x601f('0x17')]?_0x1c9ef3[_0x601f('0x17')][_0x601f('0x1b')]||null:null,'attributes':[[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')][_0x601f('0x1e')]('id')),_0x601f('0x1f')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')]['literal'](_0x601f('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0x601f('0x1c')]['fn']('COUNT',db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')]['literal'](_0x601f('0x21')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')]('`state`\x20=\x2011,\x201,\x20null'))),_0x601f('0x23')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x24'),db['sequelize']['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x25')))),_0x601f('0x26')],[db['sequelize']['fn'](_0x601f('0x24'),db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x27')))),_0x601f('0x28')]]})['then'](function(_0x58712a){logger['info'](_0x601f('0x29'),_0x1c9ef3);logger[_0x601f('0x19')]('AvgHandleTime',_0x1c9ef3,JSON[_0x601f('0xd')](_0x58712a));_0x11e1f5(_0x58712a);})[_0x601f('0x13')](function(_0x3cb6b4){logger[_0x601f('0xe')]('AvgHandleTime',_0x3cb6b4[_0x601f('0x11')],_0x1c9ef3);_0x15fbcb(_0x933313['error'](0x1f4,_0x3cb6b4[_0x601f('0x11')]));});});};exports[_0x601f('0x2a')]=function(_0x24ed27){var _0x27fbb7=this;return new Promise(function(_0x907e17,_0x2273d1){return db[_0x601f('0x14')][_0x601f('0x1a')]({'raw':_0x24ed27[_0x601f('0x17')]?_0x24ed27['options'][_0x601f('0x2b')]===undefined?!![]:![]:!![],'where':_0x24ed27[_0x601f('0x17')]?_0x24ed27['options'][_0x601f('0x1b')]||null:null,'attributes':[[_0x601f('0x2c'),_0x601f('0x2d')],[db['sequelize']['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x2f')))),_0x601f('0x30')],[db['sequelize']['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')]['literal'](_0x601f('0x20')))),_0x601f('0x31')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db['sequelize']['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x32')))),_0x601f('0x33')],[db[_0x601f('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x34')))),_0x601f('0x35')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x601f('0x36')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x37')))),_0x601f('0x38')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x39')))),_0x601f('0x3a')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x3b')))),'outboundBlacklistCallsDay'],[db[_0x601f('0x1c')]['fn']('COUNT',db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),_0x601f('0x3c')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0x601f('0x3d')],[db[_0x601f('0x1c')]['fn']('COUNT',db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0x601f('0x3e')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x3f')))),_0x601f('0x3d')],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db['sequelize'][_0x601f('0x22')](_0x601f('0x40')))),_0x601f('0x41')]],'group':[_0x601f('0x2c')]})[_0x601f('0xa')](function(_0x4b099e){logger[_0x601f('0xb')](_0x601f('0x2a'),_0x24ed27);logger['debug'](_0x601f('0x2a'),_0x24ed27,JSON['stringify'](_0x4b099e));_0x907e17(_0x4b099e);})['catch'](function(_0x5e9025){logger['error']('GetVoiceQueueHopperHistory',_0x5e9025[_0x601f('0x11')],_0x24ed27);_0x2273d1(_0x27fbb7[_0x601f('0xe')](0x1f4,_0x5e9025[_0x601f('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x2728f1){var _0x3d4c93=this;return new Promise(function(_0xd35d26,_0x56f807){return db['CmHopperHistory'][_0x601f('0x1a')]({'raw':_0x2728f1[_0x601f('0x17')]?_0x2728f1[_0x601f('0x17')][_0x601f('0x2b')]===undefined?!![]:![]:!![],'where':_0x2728f1[_0x601f('0x17')]?_0x2728f1[_0x601f('0x17')][_0x601f('0x1b')]||null:null,'attributes':[[_0x601f('0x2c'),'name'],[db[_0x601f('0x1c')]['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')][_0x601f('0x1e')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x601f('0x1d'),db[_0x601f('0x1c')]['fn']('IF',db[_0x601f('0x1c')][_0x601f('0x22')](_0x601f('0x20')))),_0x601f('0x42')]],'group':[_0x601f('0x2c')]})[_0x601f('0xa')](function(_0x41f500){logger['info'](_0x601f('0x43'),_0x2728f1);logger['debug']('GetCampaignHopperHistory',_0x2728f1,JSON[_0x601f('0xd')](_0x41f500));_0xd35d26(_0x41f500);})['catch'](function(_0xc8121){logger[_0x601f('0xe')](_0x601f('0x43'),_0xc8121[_0x601f('0x11')],_0x2728f1);_0x56f807(_0x3d4c93[_0x601f('0xe')](0x1f4,_0xc8121['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 624d76e..de8f899 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 _0x3b64=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/:id','post','create','put','exports','multer'];(function(_0x2f625f,_0x5367bd){var _0x533355=function(_0x58d280){while(--_0x58d280){_0x2f625f['push'](_0x2f625f['shift']());}};_0x533355(++_0x5367bd);}(_0x3b64,0x167));var _0x43b6=function(_0x11510a,_0x1223a1){_0x11510a=_0x11510a-0x0;var _0x4fff18=_0x3b64[_0x11510a];return _0x4fff18;};'use strict';var multer=require(_0x43b6('0x0'));var util=require(_0x43b6('0x1'));var path=require(_0x43b6('0x2'));var timeout=require(_0x43b6('0x3'));var express=require(_0x43b6('0x4'));var router=express[_0x43b6('0x5')]();var fs_extra=require(_0x43b6('0x6'));var auth=require(_0x43b6('0x7'));var interaction=require(_0x43b6('0x8'));var config=require(_0x43b6('0x9'));var controller=require(_0x43b6('0xa'));router[_0x43b6('0xb')]('/',auth[_0x43b6('0xc')](),controller['index']);router[_0x43b6('0xb')]('/describe',auth[_0x43b6('0xc')](),controller['describe']);router[_0x43b6('0xb')](_0x43b6('0xd'),auth[_0x43b6('0xc')](),controller['show']);router[_0x43b6('0xe')]('/',auth[_0x43b6('0xc')](),controller[_0x43b6('0xf')]);router[_0x43b6('0x10')](_0x43b6('0xd'),auth[_0x43b6('0xc')](),controller['update']);module[_0x43b6('0x11')]=router; \ No newline at end of file +var _0xd5a8=['create','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show'];(function(_0xd9f3f0,_0x5d292a){var _0x54995a=function(_0x54ca4d){while(--_0x54ca4d){_0xd9f3f0['push'](_0xd9f3f0['shift']());}};_0x54995a(++_0x5d292a);}(_0xd5a8,0x147));var _0x8d5a=function(_0x2d4fe8,_0x2901b6){_0x2d4fe8=_0x2d4fe8-0x0;var _0x5bdf52=_0xd5a8[_0x2d4fe8];return _0x5bdf52;};'use strict';var multer=require('multer');var util=require(_0x8d5a('0x0'));var path=require(_0x8d5a('0x1'));var timeout=require(_0x8d5a('0x2'));var express=require(_0x8d5a('0x3'));var router=express[_0x8d5a('0x4')]();var fs_extra=require(_0x8d5a('0x5'));var auth=require(_0x8d5a('0x6'));var interaction=require(_0x8d5a('0x7'));var config=require(_0x8d5a('0x8'));var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x8d5a('0x9')](),controller[_0x8d5a('0xa')]);router['get'](_0x8d5a('0xb'),auth[_0x8d5a('0x9')](),controller['describe']);router[_0x8d5a('0xc')](_0x8d5a('0xd'),auth[_0x8d5a('0x9')](),controller[_0x8d5a('0xe')]);router['post']('/',auth[_0x8d5a('0x9')](),controller[_0x8d5a('0xf')]);router[_0x8d5a('0x10')](_0x8d5a('0xd'),auth[_0x8d5a('0x9')](),controller[_0x8d5a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c1b9e10..77f1ae5 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 _0x5eb8=['STRING','exports'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x455eed,_0x822290){_0x455eed=_0x455eed-0x0;var _0x31cb46=_0x5eb8[_0x455eed];return _0x31cb46;};'use strict';var Sequelize=require('sequelize');module[_0x85eb('0x0')]={'name':{'type':Sequelize[_0x85eb('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x85eb('0x1')]}}; \ No newline at end of file +var _0xfd8f=['name','STRING','sequelize','exports'];(function(_0x4bc7c8,_0x54801b){var _0x211398=function(_0x5091f8){while(--_0x5091f8){_0x4bc7c8['push'](_0x4bc7c8['shift']());}};_0x211398(++_0x54801b);}(_0xfd8f,0xae));var _0xffd8=function(_0x4cfb50,_0x5641c6){_0x4cfb50=_0x4cfb50-0x0;var _0x162ef2=_0xfd8f[_0x4cfb50];return _0x162ef2;};'use strict';var Sequelize=require(_0xffd8('0x0'));module[_0xffd8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xffd8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xffd8('0x3')]},'dialPrefix':{'type':Sequelize[_0xffd8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 979724e..ca0b3af 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 _0xf5bf=['toString','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','Sequelize','text','TEXT','number','BOOLEAN','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','info','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','ListId','Disposition','findOne','nolimit','removeDispositions','addContacts','CmContact','tags','isArray','push','each','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','raw','getContacts','ContactItemType','alias','cm_contacts','c.ListId\x20=\x20?','distinct','c.cf_','customField_','field','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','description','description_additionalPhone_'];(function(_0x5280c0,_0x51a074){var _0x2935b6=function(_0x30914e){while(--_0x30914e){_0x5280c0['push'](_0x5280c0['shift']());}};_0x2935b6(++_0x51a074);}(_0xf5bf,0x16a));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xff5b('0x1'));var rp=require(_0xff5b('0x2'));var moment=require('moment');var BPromise=require(_0xff5b('0x3'));var Mustache=require(_0xff5b('0x4'));var util=require(_0xff5b('0x5'));var path=require('path');var sox=require(_0xff5b('0x6'));var csv=require('to-csv');var ejs=require(_0xff5b('0x7'));var fs=require('fs');var fs_extra=require(_0xff5b('0x8'));var _=require(_0xff5b('0x9'));var squel=require(_0xff5b('0xa'));var crypto=require(_0xff5b('0xb'));var jsforce=require(_0xff5b('0xc'));var deskjs=require(_0xff5b('0xd'));var toCsv=require(_0xff5b('0xe'));var querystring=require(_0xff5b('0xf'));var Papa=require(_0xff5b('0x10'));var Redis=require('ioredis');var authService=require(_0xff5b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff5b('0x12'));var hardwareService=require(_0xff5b('0x13'));var logger=require(_0xff5b('0x14'))(_0xff5b('0x15'));var utils=require(_0xff5b('0x16'));var config=require(_0xff5b('0x17'));var licenseUtil=require(_0xff5b('0x18'));var db=require(_0xff5b('0x19'))['db'];var csv_results;config[_0xff5b('0x1a')]=_[_0xff5b('0x1b')](config[_0xff5b('0x1a')],{'host':_0xff5b('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff5b('0x1a')]));require(_0xff5b('0x1d'))['register'](socket);function respondWithStatusCode(_0x3ce394,_0x137d3a){_0x137d3a=_0x137d3a||0xcc;return function(_0x486c15){if(_0x486c15){return _0x3ce394[_0xff5b('0x1e')](_0x137d3a);}return _0x3ce394[_0xff5b('0x1f')](_0x137d3a)[_0xff5b('0x20')]();};}function respondWithResult(_0x47cd84,_0x20bf14){_0x20bf14=_0x20bf14||0xc8;return function(_0x7aa7dc){if(_0x7aa7dc){return _0x47cd84[_0xff5b('0x1f')](_0x20bf14)[_0xff5b('0x21')](_0x7aa7dc);}};}function respondWithFilteredResult(_0x3a9017,_0x36b8fb){return function(_0x2188cd){if(_0x2188cd){var _0x25a76e=typeof _0x36b8fb['offset']===_0xff5b('0x22')&&typeof _0x36b8fb[_0xff5b('0x23')]===_0xff5b('0x22');var _0x4186e8=_0x2188cd[_0xff5b('0x24')];var _0x4703d0=_0x25a76e?0x0:_0x36b8fb['offset'];var _0x58697e=_0x25a76e?_0x2188cd[_0xff5b('0x24')]:_0x36b8fb['offset']+_0x36b8fb['limit'];var _0x243736;if(_0x58697e>=_0x4186e8){_0x58697e=_0x4186e8;_0x243736=0xc8;}else{_0x243736=0xce;}_0x3a9017[_0xff5b('0x1f')](_0x243736);return _0x3a9017[_0xff5b('0x25')](_0xff5b('0x26'),_0x4703d0+'-'+_0x58697e+'/'+_0x4186e8)['json'](_0x2188cd);}return null;};}function patchUpdates(_0x497fb4){return function(_0x15dd68){try{jsonpatch[_0xff5b('0x27')](_0x15dd68,_0x497fb4,!![]);}catch(_0x154cfc){return BPromise[_0xff5b('0x28')](_0x154cfc);}return _0x15dd68[_0xff5b('0x29')]();};}function saveUpdates(_0x47eef0,_0x5191a2){return function(_0x247df1){if(_0x247df1){return _0x247df1[_0xff5b('0x2a')](_0x47eef0)[_0xff5b('0x2b')](function(_0x1bb65a){return _0x1bb65a;});}return null;};}function removeEntity(_0x488bd9,_0x78752){return function(_0x4580a4){if(_0x4580a4){return _0x4580a4[_0xff5b('0x2c')]()[_0xff5b('0x2b')](function(){var _0x4866ab=_0x4580a4[_0xff5b('0x2d')]({'plain':!![]});var _0x282d0e=_0xff5b('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x282d0e,'resourceId':_0x4866ab['id']}})['then'](function(){return _0x4580a4;});})[_0xff5b('0x2b')](function(){_0x488bd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d3690,_0x429e6b){return function(_0x27a565){if(!_0x27a565){_0x1d3690[_0xff5b('0x1e')](0x194);}return _0x27a565;};}function handleError(_0x39e94f,_0x19b716){_0x19b716=_0x19b716||0x1f4;return function(_0x5373fc){logger['error'](_0x5373fc[_0xff5b('0x2f')]);if(_0x5373fc['name']){delete _0x5373fc[_0xff5b('0x30')];}_0x39e94f[_0xff5b('0x1f')](_0x19b716)[_0xff5b('0x31')](_0x5373fc);};}exports[_0xff5b('0x32')]=function(_0x2d4bc5,_0x462fda){var _0x37ac19={},_0x314be8={},_0x371551={'count':0x0,'rows':[]};var _0x15e1b4=_[_0xff5b('0x33')](db[_0xff5b('0x34')][_0xff5b('0x35')],function(_0x2ef1c6){return{'name':_0x2ef1c6[_0xff5b('0x36')],'type':_0x2ef1c6[_0xff5b('0x37')]['key']};});_0x314be8[_0xff5b('0x38')]=_[_0xff5b('0x33')](_0x15e1b4,'name');_0x314be8[_0xff5b('0x39')]=_['keys'](_0x2d4bc5['query']);_0x314be8[_0xff5b('0x3a')]=_[_0xff5b('0x3b')](_0x314be8[_0xff5b('0x38')],_0x314be8[_0xff5b('0x39')]);_0x37ac19[_0xff5b('0x3c')]=_[_0xff5b('0x3b')](_0x314be8['model'],qs[_0xff5b('0x3d')](_0x2d4bc5[_0xff5b('0x39')][_0xff5b('0x3d')]));_0x37ac19[_0xff5b('0x3c')]=_0x37ac19[_0xff5b('0x3c')]['length']?_0x37ac19[_0xff5b('0x3c')]:_0x314be8[_0xff5b('0x38')];if(!_0x2d4bc5['query'][_0xff5b('0x3e')]('nolimit')){_0x37ac19[_0xff5b('0x23')]=qs[_0xff5b('0x23')](_0x2d4bc5['query'][_0xff5b('0x23')]);_0x37ac19['offset']=qs[_0xff5b('0x3f')](_0x2d4bc5['query']['offset']);}_0x37ac19[_0xff5b('0x40')]=qs[_0xff5b('0x41')](_0x2d4bc5[_0xff5b('0x39')][_0xff5b('0x41')]);_0x37ac19[_0xff5b('0x42')]=qs[_0xff5b('0x3a')](_[_0xff5b('0x43')](_0x2d4bc5[_0xff5b('0x39')],_0x314be8['filters']),_0x15e1b4);if(_0x2d4bc5[_0xff5b('0x39')][_0xff5b('0x44')]){_0x37ac19[_0xff5b('0x42')]=_[_0xff5b('0x45')](_0x37ac19[_0xff5b('0x42')],{'$or':_[_0xff5b('0x33')](_0x15e1b4,function(_0x5711aa){if(_0x5711aa[_0xff5b('0x37')]!==_0xff5b('0x46')){var _0x5e2eda={};_0x5e2eda[_0x5711aa['name']]={'$like':'%'+_0x2d4bc5[_0xff5b('0x39')][_0xff5b('0x44')]+'%'};return _0x5e2eda;}})});}_0x37ac19=_['merge']({},_0x37ac19,_0x2d4bc5[_0xff5b('0x47')]);var _0x97ea77={'where':_0x37ac19['where']};return db['CmList'][_0xff5b('0x24')](_0x97ea77)['then'](function(_0x5714aa){_0x371551[_0xff5b('0x24')]=_0x5714aa;if(_0x2d4bc5[_0xff5b('0x39')][_0xff5b('0x48')]){_0x37ac19[_0xff5b('0x49')]=[{'all':!![]}];}return db['CmList'][_0xff5b('0x4a')](_0x37ac19);})[_0xff5b('0x2b')](function(_0x23926e){_0x371551[_0xff5b('0x4b')]=_0x23926e;return _0x371551;})[_0xff5b('0x2b')](respondWithFilteredResult(_0x462fda,_0x37ac19))[_0xff5b('0x4c')](handleError(_0x462fda,null));};exports[_0xff5b('0x4d')]=function(_0x54ce3e,_0x48b485){var _0x7029c6={'raw':![],'where':{'id':_0x54ce3e[_0xff5b('0x4e')]['id']}},_0x42d13d={};_0x42d13d['model']=_[_0xff5b('0x4f')](db['CmList'][_0xff5b('0x35')]);_0x42d13d[_0xff5b('0x39')]=_[_0xff5b('0x4f')](_0x54ce3e[_0xff5b('0x39')]);_0x42d13d[_0xff5b('0x3a')]=_['intersection'](_0x42d13d[_0xff5b('0x38')],_0x42d13d[_0xff5b('0x39')]);_0x7029c6[_0xff5b('0x3c')]=_[_0xff5b('0x3b')](_0x42d13d[_0xff5b('0x38')],qs['fields'](_0x54ce3e[_0xff5b('0x39')][_0xff5b('0x3d')]));_0x7029c6[_0xff5b('0x3c')]=_0x7029c6['attributes'][_0xff5b('0x50')]?_0x7029c6[_0xff5b('0x3c')]:_0x42d13d[_0xff5b('0x38')];if(_0x54ce3e[_0xff5b('0x39')]['includeAll']){_0x7029c6[_0xff5b('0x49')]=[{'all':!![]}];}_0x7029c6=_[_0xff5b('0x45')]({},_0x7029c6,_0x54ce3e[_0xff5b('0x47')]);return db[_0xff5b('0x34')][_0xff5b('0x51')](_0x7029c6)[_0xff5b('0x2b')](handleEntityNotFound(_0x48b485,null))[_0xff5b('0x2b')](respondWithResult(_0x48b485,null))[_0xff5b('0x4c')](handleError(_0x48b485,null));};exports['create']=function(_0x4abf67,_0x2b40a2){return db[_0xff5b('0x34')][_0xff5b('0x52')](_0x4abf67[_0xff5b('0x53')],{})[_0xff5b('0x2b')](function(_0x387e32){var _0x211d47=_0x4abf67['user'][_0xff5b('0x2d')]({'plain':!![]});if(!_0x211d47)throw new Error(_0xff5b('0x54'));if(_0x211d47[_0xff5b('0x55')]==='user'){var _0xcd0db8=_0x387e32[_0xff5b('0x2d')]({'plain':!![]});var _0xdc8a72='Lists';return db[_0xff5b('0x56')][_0xff5b('0x51')]({'where':{'name':_0xdc8a72,'userProfileId':_0x211d47[_0xff5b('0x57')]},'raw':!![]})[_0xff5b('0x2b')](function(_0x343048){if(_0x343048&&_0x343048[_0xff5b('0x58')]===0x0){return db[_0xff5b('0x59')][_0xff5b('0x52')]({'name':_0xcd0db8['name'],'resourceId':_0xcd0db8['id'],'type':_0x343048[_0xff5b('0x30')],'sectionId':_0x343048['id']},{})[_0xff5b('0x2b')](function(){return _0x387e32;});}else{return _0x387e32;}})[_0xff5b('0x4c')](function(_0x4bf856){logger[_0xff5b('0x5a')](_0xff5b('0x5b'),_0x4bf856);throw _0x4bf856;});}return _0x387e32;})[_0xff5b('0x2b')](respondWithResult(_0x2b40a2,0xc9))[_0xff5b('0x4c')](handleError(_0x2b40a2,null));};exports['update']=function(_0x4a01a2,_0x3cc5f8){if(_0x4a01a2[_0xff5b('0x53')]['id']){delete _0x4a01a2[_0xff5b('0x53')]['id'];}return db['CmList']['find']({'where':{'id':_0x4a01a2['params']['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x3cc5f8,null))['then'](saveUpdates(_0x4a01a2[_0xff5b('0x53')],null))[_0xff5b('0x2b')](respondWithResult(_0x3cc5f8,null))[_0xff5b('0x4c')](handleError(_0x3cc5f8,null));};exports[_0xff5b('0x2c')]=function(_0x4870cb,_0x4433d5){return db['CmList'][_0xff5b('0x51')]({'where':{'id':_0x4870cb[_0xff5b('0x4e')]['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x4433d5,null))[_0xff5b('0x2b')](removeEntity(_0x4433d5,null))[_0xff5b('0x4c')](handleError(_0x4433d5,null));};exports['describe']=function(_0x40d396,_0x56c68a){return db[_0xff5b('0x34')]['describe']()['then'](respondWithResult(_0x56c68a,null))[_0xff5b('0x4c')](handleError(_0x56c68a,null));};exports[_0xff5b('0x5c')]=function(_0x1cd9fb,_0x23b001,_0x48dbb6){if(_0x1cd9fb['body']['id']){delete _0x1cd9fb[_0xff5b('0x53')]['id'];}return db['CmList'][_0xff5b('0x51')]({'where':{'id':_0x1cd9fb['params']['id']}})['then'](handleEntityNotFound(_0x23b001,null))['then'](function(_0x1689e9){if(_0x1689e9){_0x1cd9fb['body'][_0xff5b('0x5d')]=_0x1689e9['id'];return db[_0xff5b('0x5e')][_0xff5b('0x52')](_0x1cd9fb[_0xff5b('0x53')]);}})['then'](respondWithResult(_0x23b001,null))['catch'](handleError(_0x23b001,null));};exports['getDispositions']=function(_0x1fe0c1,_0x898e37,_0x2cf59e){var _0x759fc6={'raw':![],'where':{}};var _0x33d1cc={};var _0xd42304={'count':0x0,'rows':[]};return db[_0xff5b('0x34')][_0xff5b('0x5f')]({'where':{'id':_0x1fe0c1[_0xff5b('0x4e')]['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x898e37,null))['then'](function(_0x56bb81){if(_0x56bb81){_0x33d1cc[_0xff5b('0x38')]=_['keys'](db[_0xff5b('0x5e')][_0xff5b('0x35')]);_0x33d1cc[_0xff5b('0x39')]=_[_0xff5b('0x4f')](_0x1fe0c1['query']);_0x33d1cc[_0xff5b('0x3a')]=_[_0xff5b('0x3b')](_0x33d1cc[_0xff5b('0x38')],_0x33d1cc[_0xff5b('0x39')]);_0x759fc6[_0xff5b('0x3c')]=_[_0xff5b('0x3b')](_0x33d1cc['model'],qs[_0xff5b('0x3d')](_0x1fe0c1[_0xff5b('0x39')]['fields']));_0x759fc6[_0xff5b('0x3c')]=_0x759fc6[_0xff5b('0x3c')][_0xff5b('0x50')]?_0x759fc6[_0xff5b('0x3c')]:_0x33d1cc[_0xff5b('0x38')];if(!_0x1fe0c1[_0xff5b('0x39')][_0xff5b('0x3e')](_0xff5b('0x60'))){_0x759fc6[_0xff5b('0x23')]=qs[_0xff5b('0x23')](_0x1fe0c1[_0xff5b('0x39')]['limit']);_0x759fc6[_0xff5b('0x3f')]=qs[_0xff5b('0x3f')](_0x1fe0c1[_0xff5b('0x39')][_0xff5b('0x3f')]);}_0x759fc6[_0xff5b('0x40')]=qs[_0xff5b('0x41')](_0x1fe0c1['query'][_0xff5b('0x41')]);_0x759fc6[_0xff5b('0x42')]=qs[_0xff5b('0x3a')](_[_0xff5b('0x43')](_0x1fe0c1[_0xff5b('0x39')],_0x33d1cc['filters']));_0x759fc6[_0xff5b('0x42')][_0xff5b('0x5d')]=_0x56bb81['id'];if(_0x1fe0c1[_0xff5b('0x39')][_0xff5b('0x44')]){_0x759fc6[_0xff5b('0x42')]=_[_0xff5b('0x45')](_0x759fc6[_0xff5b('0x42')],{'$or':_[_0xff5b('0x33')](_0x759fc6[_0xff5b('0x3c')],function(_0x58ba33){var _0x18a761={};_0x18a761[_0x58ba33]={'$like':'%'+_0x1fe0c1['query']['filter']+'%'};return _0x18a761;})});}_0x759fc6=_[_0xff5b('0x45')]({},_0x759fc6,_0x1fe0c1[_0xff5b('0x47')]);return db[_0xff5b('0x5e')][_0xff5b('0x24')]({'where':_0x759fc6[_0xff5b('0x42')]})['then'](function(_0x559faf){_0xd42304[_0xff5b('0x24')]=_0x559faf;if(_0x1fe0c1[_0xff5b('0x39')][_0xff5b('0x48')]){_0x759fc6[_0xff5b('0x49')]=[{'all':!![]}];}return db[_0xff5b('0x5e')]['findAll'](_0x759fc6);})[_0xff5b('0x2b')](function(_0xf8896d){_0xd42304[_0xff5b('0x4b')]=_0xf8896d;return _0xd42304;});}})[_0xff5b('0x2b')](respondWithFilteredResult(_0x898e37,_0x759fc6))['catch'](handleError(_0x898e37,null));};exports[_0xff5b('0x61')]=function(_0x300916,_0x165006,_0x1963b8){return db[_0xff5b('0x34')]['find']({'where':{'id':_0x300916['params']['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x165006,null))[_0xff5b('0x2b')](function(_0x197f99){if(_0x197f99){return _0x197f99['removeDispositions'](_0x300916[_0xff5b('0x39')]['ids']);}})[_0xff5b('0x2b')](respondWithStatusCode(_0x165006,null))[_0xff5b('0x4c')](handleError(_0x165006,null));};exports[_0xff5b('0x62')]=function(_0x5a617b,_0x21a792,_0x27f58f){return db[_0xff5b('0x34')][_0xff5b('0x51')]({'where':{'id':_0x5a617b['params']['id']}})['then'](handleEntityNotFound(_0x21a792,null))['then'](function(_0x4d3b7e){if(_0x4d3b7e){var _0x1feb74=[];var _0x134efa={'success':[],'errors':[]};return db[_0xff5b('0x63')]['describe']()[_0xff5b('0x2b')](function(_0x4b4ecf){if(_0x5a617b[_0xff5b('0x53')][_0xff5b('0x64')]&&_[_0xff5b('0x65')](_0x5a617b[_0xff5b('0x53')]['tags'])){if(_0x5a617b[_0xff5b('0x53')]['tags'][_0xff5b('0x50')]){_0x5a617b['body']['tags']=_0x5a617b[_0xff5b('0x53')][_0xff5b('0x64')]['join'](';')+';';}else{_0x5a617b[_0xff5b('0x53')][_0xff5b('0x64')]=null;}}else{_0x5a617b[_0xff5b('0x53')][_0xff5b('0x64')]=null;}if(_0x5a617b[_0xff5b('0x53')]&&_[_0xff5b('0x65')](_0x5a617b['body'])){for(var _0x165d73=0x0;_0x165d73<_0x5a617b[_0xff5b('0x53')]['length'];_0x165d73+=0x1){_0x5a617b[_0xff5b('0x53')][_0x165d73][_0xff5b('0x5d')]=_0x5a617b[_0xff5b('0x4e')]['id'];_0x1feb74[_0xff5b('0x66')](_0x5a617b[_0xff5b('0x53')][_0x165d73]);}return BPromise[_0xff5b('0x67')](_0x1feb74,function(_0x16e7d0){return db['CmContact'][_0xff5b('0x52')](_['omit'](_0x16e7d0,[_0xff5b('0x68'),'id'])||{},{'fields':_['keys'](_0x4b4ecf),'raw':!![]})['then'](function(_0x43b3a4){_0x134efa[_0xff5b('0x69')][_0xff5b('0x66')](_0x43b3a4[_0xff5b('0x6a')]);})[_0xff5b('0x4c')](function(_0x94cc5c){_0x134efa[_0xff5b('0x6b')][_0xff5b('0x66')]({'data':_0x16e7d0,'error':_0x94cc5c[_0xff5b('0x6c')]});});})['then'](function(_0x20ea36){return _0x134efa;})['catch'](function(_0x149dd1){return _0x149dd1;});}else{_0x21a792[_0xff5b('0x1f')](0x190)[_0xff5b('0x21')]({'message':_0xff5b('0x6d')});}});}})[_0xff5b('0x2b')](respondWithResult(_0x21a792,null))['catch'](handleError(_0x21a792,null));};exports['getContacts']=function(_0x17b0a8,_0x4a8e62,_0x22caa1){var _0x472bc6;return db[_0xff5b('0x34')][_0xff5b('0x51')]({'where':{'id':_0x17b0a8[_0xff5b('0x4e')]['id']},'include':[{'model':db[_0xff5b('0x6e')],'as':_0xff5b('0x6f')}]})[_0xff5b('0x2b')](handleEntityNotFound(_0x4a8e62,null))[_0xff5b('0x2b')](function(_0x10c4cc){if(_0x10c4cc){_0x472bc6=_0x10c4cc;return db[_0xff5b('0x63')][_0xff5b('0x35')];}})['then'](function(_0x2221f9){if(_0x2221f9){var _0x40c7a5={};var _0x35bf22={};_0x35bf22[_0xff5b('0x38')]=_['concat'](_[_0xff5b('0x4f')](_0x2221f9),_['map'](_0x472bc6[_0xff5b('0x6f')],function(_0x2c6750){return util[_0xff5b('0x70')](_0xff5b('0x71'),_0x2c6750['id']);}));_0x35bf22[_0xff5b('0x39')]=_['keys'](_0x17b0a8['query']);_0x35bf22[_0xff5b('0x3a')]=_[_0xff5b('0x3b')](_0x35bf22['model'],_0x35bf22['query']);_0x40c7a5[_0xff5b('0x3c')]=_[_0xff5b('0x3b')](_0x35bf22[_0xff5b('0x38')],qs['fields'](_0x17b0a8[_0xff5b('0x39')][_0xff5b('0x3d')]));_0x40c7a5[_0xff5b('0x3c')]=_0x40c7a5[_0xff5b('0x3c')][_0xff5b('0x50')]?_0x40c7a5[_0xff5b('0x3c')]:_0x35bf22[_0xff5b('0x38')];if(!_0x17b0a8['query'][_0xff5b('0x3e')](_0xff5b('0x60'))){_0x40c7a5['limit']=qs['limit'](_0x17b0a8['query']['limit']);_0x40c7a5['offset']=qs[_0xff5b('0x3f')](_0x17b0a8[_0xff5b('0x39')][_0xff5b('0x3f')]);}_0x40c7a5[_0xff5b('0x40')]=qs[_0xff5b('0x41')](_0x17b0a8['query'][_0xff5b('0x41')]);_0x40c7a5['where']=qs[_0xff5b('0x3a')](_[_0xff5b('0x43')](_0x17b0a8[_0xff5b('0x39')],_0x35bf22['filters']));_0x40c7a5[_0xff5b('0x72')]=!![];if(_0x17b0a8[_0xff5b('0x39')]['filter']){_0x40c7a5[_0xff5b('0x42')]=_[_0xff5b('0x45')](_0x40c7a5[_0xff5b('0x42')],{'$or':_[_0xff5b('0x33')](_0x40c7a5[_0xff5b('0x3c')],function(_0x46858b){var _0x1bce0f={};_0x1bce0f[_0x46858b]={'$like':'%'+_0x17b0a8[_0xff5b('0x39')][_0xff5b('0x44')]+'%'};return _0x1bce0f;})});}_0x40c7a5=_[_0xff5b('0x45')]({},_0x40c7a5,_0x17b0a8[_0xff5b('0x47')]);return _0x472bc6[_0xff5b('0x73')](_0x40c7a5);}})[_0xff5b('0x2b')](respondWithResult(_0x4a8e62,null))[_0xff5b('0x4c')](handleError(_0x4a8e62,null));};exports['getContactsCsv']=function(_0x138ddd,_0x1c986e,_0x193f8e){var _0xf828e2;var _0x2380c7;var _0x29f323;var _0x53a28c=_0x138ddd[_0xff5b('0x4e')]['id'];csv_results=[];return db[_0xff5b('0x74')][_0xff5b('0x4a')]({'attributes':['id',_0xff5b('0x30')],'raw':!![],'order':['OrderBy']})['then'](function(_0x23063f){_0xf828e2=_0x23063f;var _0x2c7308=_[_0xff5b('0x4f')](db['CmContact'][_0xff5b('0x35')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xff5b('0x75')]})[_0xff5b('0x2b')](function(_0x3527bc){_0x2380c7=_0x3527bc;var _0x43dc0f=squel['select']()[_0xff5b('0x3d')](_0x2c7308)['from'](_0xff5b('0x76'),'c')[_0xff5b('0x42')](_0xff5b('0x77'),_0x53a28c)[_0xff5b('0x42')]('c.deletedAt\x20is\x20null')[_0xff5b('0x78')]();for(var _0x400974=0x0;_0x400974<_0x2380c7[_0xff5b('0x50')];_0x400974++){_0x43dc0f['field'](_0xff5b('0x79')+_0x2380c7[_0x400974]['id'],_0xff5b('0x7a')+_0x2380c7[_0x400974][_0xff5b('0x75')]);}for(var _0x400974=0x0;_0x400974<_0xf828e2[_0xff5b('0x50')];_0x400974++){_0x43dc0f[_0xff5b('0x7b')](squel[_0xff5b('0x7c')]()[_0xff5b('0x7b')](_0xff5b('0x7d'))['from'](_0xff5b('0x7e'))[_0xff5b('0x42')]('ItemTypeId\x20=\x20?',_0xf828e2[_0x400974]['id'])['where'](_0xff5b('0x7f')),'additionalPhone_'+_0xf828e2[_0x400974][_0xff5b('0x30')]);_0x43dc0f[_0xff5b('0x7b')](squel[_0xff5b('0x7c')]()[_0xff5b('0x7b')](_0xff5b('0x80'))['from'](_0xff5b('0x7e'))[_0xff5b('0x42')]('ItemTypeId\x20=\x20?',_0xf828e2[_0x400974]['id'])['where'](_0xff5b('0x7f')),_0xff5b('0x81')+_0xf828e2[_0x400974][_0xff5b('0x30')]);}var _0x359f7d=[];_0x359f7d[_0xff5b('0x66')](_0x43dc0f[_0xff5b('0x82')]());BPromise[_0xff5b('0x67')](_0x359f7d,handleQuery)[_0xff5b('0x2b')](function(_0x501de1){handleQuery(_0x43dc0f[_0xff5b('0x82')]());var _0x1cce5e=csv_results[0x0];if(!_[_0xff5b('0x83')](_0x1cce5e)){var _0x3aeb4e=toCsv(_0x1cce5e);var _0x4cac8b=Date[_0xff5b('0x84')]();fs['writeFileSync'](util[_0xff5b('0x70')]('/tmp/list_%d_%s.csv',_0x53a28c,_0x4cac8b),_0x3aeb4e);_0x1c986e[_0xff5b('0x85')](_0xff5b('0x86'),_0xff5b('0x87')+util[_0xff5b('0x70')](_0xff5b('0x88'),_0x53a28c,_0x4cac8b));_0x1c986e[_0xff5b('0x85')](_0xff5b('0x89'),_0xff5b('0x8a'));return _0x1c986e[_0xff5b('0x8b')](util['format'](_0xff5b('0x8c'),_0x53a28c,_0x4cac8b));}else{return _0x1c986e[_0xff5b('0x1e')](0xcc);}});});});};exports[_0xff5b('0x8d')]=function(_0x352982,_0x34520b,_0x5adeb2){var _0x164c5e;delete _0x352982[_0xff5b('0x53')]['id'];return db['CmList'][_0xff5b('0x5f')]({'where':{'id':_0x352982[_0xff5b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x34520b,null))[_0xff5b('0x2b')](function(_0x119c52){if(_0x119c52){return db[_0xff5b('0x8e')][_0xff5b('0x8f')](function(_0x460318){return db[_0xff5b('0x6e')]['create'](_0x352982[_0xff5b('0x53')],{'transaction':_0x460318})[_0xff5b('0x2b')](function(_0x11dece){_0x164c5e=_0x11dece;return _0x119c52['addCustomFields'](_0x11dece,{'transaction':_0x460318});})[_0xff5b('0x2b')](function(){var _0x3ee710={'type':db[_0xff5b('0x90')]['TEXT'],'transaction':_0x460318};switch(_0x352982[_0xff5b('0x53')][_0xff5b('0x37')]){case _0xff5b('0x91'):_0x3ee710[_0xff5b('0x37')]=db[_0xff5b('0x90')][_0xff5b('0x92')];break;case _0xff5b('0x93'):_0x3ee710[_0xff5b('0x37')]=db[_0xff5b('0x90')]['INTEGER'];break;case'switch':_0x3ee710['type']=db['Sequelize'][_0xff5b('0x94')];_0x3ee710['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0xff5b('0x95')](_0xff5b('0x76'),util[_0xff5b('0x70')](_0xff5b('0x96'),_0x164c5e['id']),_0x3ee710);})[_0xff5b('0x2b')](function(){return _0x164c5e;});});}})[_0xff5b('0x2b')](respondWithResult(_0x34520b,null))[_0xff5b('0x4c')](handleError(_0x34520b,null));};exports[_0xff5b('0x97')]=function(_0x1c51aa,_0x2468e3,_0x32c959){var _0x255648={};var _0x4594d3={};var _0x43ed88;var _0x2166c1;return db['CmList'][_0xff5b('0x5f')]({'where':{'id':_0x1c51aa['params']['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x2468e3,null))[_0xff5b('0x2b')](function(_0x5ea3d4){if(_0x5ea3d4){_0x43ed88=_0x5ea3d4;_0x4594d3[_0xff5b('0x38')]=_[_0xff5b('0x4f')](db[_0xff5b('0x6e')][_0xff5b('0x35')]);_0x4594d3[_0xff5b('0x39')]=_[_0xff5b('0x4f')](_0x1c51aa[_0xff5b('0x39')]);_0x4594d3[_0xff5b('0x3a')]=_[_0xff5b('0x3b')](_0x4594d3['model'],_0x4594d3['query']);_0x255648['attributes']=_[_0xff5b('0x3b')](_0x4594d3[_0xff5b('0x38')],qs[_0xff5b('0x3d')](_0x1c51aa[_0xff5b('0x39')][_0xff5b('0x3d')]));_0x255648[_0xff5b('0x3c')]=_0x255648[_0xff5b('0x3c')][_0xff5b('0x50')]?_0x255648['attributes']:_0x4594d3[_0xff5b('0x38')];_0x255648[_0xff5b('0x40')]=qs['sort'](_0x1c51aa['query'][_0xff5b('0x41')]);_0x255648[_0xff5b('0x42')]=qs['filters'](_['pick'](_0x1c51aa[_0xff5b('0x39')],_0x4594d3[_0xff5b('0x3a')]));_0x255648[_0xff5b('0x42')]=_[_0xff5b('0x45')](_0x255648[_0xff5b('0x42')],{'$or':[{'ListId':_0x5ea3d4['id']},{'ListId':null}]});if(_0x1c51aa[_0xff5b('0x39')]['filter']){_0x255648['where']=_['merge'](_0x255648['where'],{'$or':_[_0xff5b('0x33')](_0x255648['attributes'],function(_0x3f8d5a){var _0xd62e9a={};_0xd62e9a[_0x3f8d5a]={'$like':'%'+_0x1c51aa['query'][_0xff5b('0x44')]+'%'};return _0xd62e9a;})});}_0x255648=_['merge']({},_0x255648,_0x1c51aa[_0xff5b('0x47')]);return db[_0xff5b('0x6e')]['findAndCountAll'](_0x255648);}})[_0xff5b('0x2b')](respondWithResult(_0x2468e3,null))[_0xff5b('0x4c')](handleError(_0x2468e3,null));};exports[_0xff5b('0x98')]=function(_0x55ba9e,_0x3e6c87){return db[_0xff5b('0x6e')][_0xff5b('0x99')]({'where':{'ListId':null}})[_0xff5b('0x2b')](handleEntityNotFound(_0x3e6c87,null))[_0xff5b('0x2b')](function(_0x3c79c6){return _0x3c79c6;})[_0xff5b('0x2b')](respondWithResult(_0x3e6c87,null))['catch'](handleError(_0x3e6c87,null));};exports[_0xff5b('0x9a')]=function(_0x4deca2,_0x4b1d9b,_0x4d8dd8){return db[_0xff5b('0x34')][_0xff5b('0x51')]({'where':{'id':_0x4deca2[_0xff5b('0x4e')]['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x4b1d9b,null))[_0xff5b('0x2b')](function(_0x3e0b29){if(_0x3e0b29){return _0x3e0b29[_0xff5b('0x9a')](_0x4deca2[_0xff5b('0x53')]['ids'],_[_0xff5b('0x9b')](_0x4deca2['body'],[_0xff5b('0x68'),'id'])||{})[_0xff5b('0x9c')](function(_0x1490c4){for(var _0x4e7cbe=0x0;_0x4e7cbe<_0x4deca2[_0xff5b('0x53')][_0xff5b('0x68')][_0xff5b('0x50')];_0x4e7cbe+=0x1){socket['emit'](_0xff5b('0x9d'),{'UserId':Number(_0x4deca2[_0xff5b('0x53')][_0xff5b('0x68')][_0x4e7cbe]),'CmListId':Number(_0x4deca2[_0xff5b('0x4e')]['id'])});}return _0x1490c4;});}})[_0xff5b('0x2b')](respondWithResult(_0x4b1d9b,null))[_0xff5b('0x4c')](handleError(_0x4b1d9b,null));};exports[_0xff5b('0x9e')]=function(_0x216df3,_0x220bfa,_0xedb4ca){return db[_0xff5b('0x34')]['find']({'where':{'id':_0x216df3[_0xff5b('0x4e')]['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x220bfa,null))['then'](function(_0x4db7b2){if(_0x4db7b2){return _0x4db7b2['removeAgents'](_0x216df3[_0xff5b('0x39')]['ids'])[_0xff5b('0x2b')](function(){if(_['isArray'](_0x216df3[_0xff5b('0x39')]['ids'])){for(var _0x3e7df6=0x0;_0x3e7df6<_0x216df3[_0xff5b('0x39')][_0xff5b('0x68')][_0xff5b('0x50')];_0x3e7df6+=0x1){socket[_0xff5b('0x9f')](_0xff5b('0xa0'),{'UserId':Number(_0x216df3[_0xff5b('0x39')]['ids'][_0x3e7df6]),'CmListId':Number(_0x216df3['params']['id'])});}}else{socket['emit'](_0xff5b('0xa0'),{'UserId':Number(_0x216df3[_0xff5b('0x39')][_0xff5b('0x68')]),'CmListId':Number(_0x216df3[_0xff5b('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x220bfa,null))[_0xff5b('0x4c')](handleError(_0x220bfa,null));};exports['getAgents']=function(_0x269093,_0x51915e,_0x1fd75e){var _0x37aade={};var _0x330ffc={};var _0xbd5efd;var _0x2b05f4;return db[_0xff5b('0x34')][_0xff5b('0x5f')]({'where':{'id':_0x269093[_0xff5b('0x4e')]['id']}})[_0xff5b('0x2b')](handleEntityNotFound(_0x51915e,null))[_0xff5b('0x2b')](function(_0x2c4e95){if(_0x2c4e95){_0xbd5efd=_0x2c4e95;_0x330ffc[_0xff5b('0x38')]=_['keys'](db[_0xff5b('0xa1')]['rawAttributes']);_0x330ffc[_0xff5b('0x39')]=_[_0xff5b('0x4f')](_0x269093[_0xff5b('0x39')]);_0x330ffc[_0xff5b('0x3a')]=_[_0xff5b('0x3b')](_0x330ffc['model'],_0x330ffc[_0xff5b('0x39')]);_0x37aade[_0xff5b('0x3c')]=_['intersection'](_0x330ffc['model'],qs['fields'](_0x269093[_0xff5b('0x39')][_0xff5b('0x3d')]));_0x37aade[_0xff5b('0x3c')]=_0x37aade['attributes'][_0xff5b('0x50')]?_0x37aade[_0xff5b('0x3c')]:_0x330ffc[_0xff5b('0x38')];_0x37aade['order']=qs[_0xff5b('0x41')](_0x269093[_0xff5b('0x39')][_0xff5b('0x41')]);_0x37aade[_0xff5b('0x42')]=qs[_0xff5b('0x3a')](_['pick'](_0x269093[_0xff5b('0x39')],_0x330ffc['filters']));if(_0x269093['query'][_0xff5b('0x44')]){_0x37aade['where']=_[_0xff5b('0x45')](_0x37aade[_0xff5b('0x42')],{'$or':_[_0xff5b('0x33')](_0x37aade[_0xff5b('0x3c')],function(_0x4664d3){var _0x2d9d75={};_0x2d9d75[_0x4664d3]={'$like':'%'+_0x269093['query'][_0xff5b('0x44')]+'%'};return _0x2d9d75;})});}_0x37aade=_[_0xff5b('0x45')]({},_0x37aade,_0x269093[_0xff5b('0x47')]);return _0xbd5efd['getAgents'](_0x37aade);}})[_0xff5b('0x2b')](function(_0x1fa8ee){if(_0x1fa8ee){_0x2b05f4=_0x1fa8ee['length'];if(!_0x269093['query'][_0xff5b('0x3e')](_0xff5b('0x60'))){_0x37aade[_0xff5b('0x23')]=qs['limit'](_0x269093[_0xff5b('0x39')]['limit']);_0x37aade['offset']=qs[_0xff5b('0x3f')](_0x269093[_0xff5b('0x39')][_0xff5b('0x3f')]);}return _0xbd5efd[_0xff5b('0xa2')](_0x37aade);}})[_0xff5b('0x2b')](function(_0x27d708){if(_0x27d708){return _0x27d708?{'count':_0x2b05f4,'rows':_0x27d708}:null;}})[_0xff5b('0x2b')](respondWithResult(_0x51915e,null))[_0xff5b('0x4c')](handleError(_0x51915e,null));};function handleQuery(_0x3b876c){logger[_0xff5b('0xa3')](_0x3b876c);return db['sequelize']['query'](_0x3b876c)[_0xff5b('0x9c')](function(_0x1524c6){csv_results['push'](_0x1524c6);})[_0xff5b('0x4c')](function(_0xbc1ba3){logger[_0xff5b('0x5a')](_0xbc1ba3[_0xff5b('0x6c')]);});} \ No newline at end of file +var _0xbce1=['set','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','describe','addDisposition','Disposition','findOne','order','ListId','rows','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','raw','getContactsCsv','ContactItemType','OrderBy','CmCustomField','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','Sequelize','TEXT','number','INTEGER','defaultValue','sequelize','queryInterface','addColumn','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','count'];(function(_0x3da09c,_0x9884f2){var _0x9f9809=function(_0x1b0948){while(--_0x1b0948){_0x3da09c['push'](_0x3da09c['shift']());}};_0x9f9809(++_0x9884f2);}(_0xbce1,0x7c));var _0x1bce=function(_0x4725c1,_0x5ee2af){_0x4725c1=_0x4725c1-0x0;var _0x13ef4e=_0xbce1[_0x4725c1];return _0x13ef4e;};'use strict';var emlformat=require(_0x1bce('0x0'));var rimraf=require(_0x1bce('0x1'));var zipdir=require(_0x1bce('0x2'));var jsonpatch=require(_0x1bce('0x3'));var rp=require('request-promise');var moment=require(_0x1bce('0x4'));var BPromise=require(_0x1bce('0x5'));var Mustache=require(_0x1bce('0x6'));var util=require(_0x1bce('0x7'));var path=require(_0x1bce('0x8'));var sox=require('sox');var csv=require(_0x1bce('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bce('0xa'));var _=require(_0x1bce('0xb'));var squel=require(_0x1bce('0xc'));var crypto=require(_0x1bce('0xd'));var jsforce=require(_0x1bce('0xe'));var deskjs=require(_0x1bce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1bce('0x10'));var Papa=require(_0x1bce('0x11'));var Redis=require(_0x1bce('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1bce('0x13'));var as=require(_0x1bce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bce('0x15'))('api');var utils=require(_0x1bce('0x16'));var config=require(_0x1bce('0x17'));var licenseUtil=require(_0x1bce('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x1bce('0x19')]=_[_0x1bce('0x1a')](config['redis'],{'host':_0x1bce('0x1b'),'port':0x18eb});var socket=require(_0x1bce('0x1c'))(new Redis(config[_0x1bce('0x19')]));require('./cmList.socket')[_0x1bce('0x1d')](socket);function respondWithStatusCode(_0x598c6c,_0x28d551){_0x28d551=_0x28d551||0xcc;return function(_0x4e0d6d){if(_0x4e0d6d){return _0x598c6c[_0x1bce('0x1e')](_0x28d551);}return _0x598c6c['status'](_0x28d551)[_0x1bce('0x1f')]();};}function respondWithResult(_0x3f4927,_0x504506){_0x504506=_0x504506||0xc8;return function(_0x401559){if(_0x401559){return _0x3f4927[_0x1bce('0x20')](_0x504506)[_0x1bce('0x21')](_0x401559);}};}function respondWithFilteredResult(_0x91f57,_0x45aa07){return function(_0x5b9ee5){if(_0x5b9ee5){var _0x3934d7=typeof _0x45aa07[_0x1bce('0x22')]==='undefined'&&typeof _0x45aa07['limit']==='undefined';var _0x3cb958=_0x5b9ee5[_0x1bce('0x23')];var _0x548d2e=_0x3934d7?0x0:_0x45aa07[_0x1bce('0x22')];var _0x503f10=_0x3934d7?_0x5b9ee5[_0x1bce('0x23')]:_0x45aa07[_0x1bce('0x22')]+_0x45aa07['limit'];var _0x500de7;if(_0x503f10>=_0x3cb958){_0x503f10=_0x3cb958;_0x500de7=0xc8;}else{_0x500de7=0xce;}_0x91f57[_0x1bce('0x20')](_0x500de7);return _0x91f57[_0x1bce('0x24')]('Content-Range',_0x548d2e+'-'+_0x503f10+'/'+_0x3cb958)['json'](_0x5b9ee5);}return null;};}function patchUpdates(_0x2022af){return function(_0x5972e2){try{jsonpatch[_0x1bce('0x25')](_0x5972e2,_0x2022af,!![]);}catch(_0x3567f1){return BPromise[_0x1bce('0x26')](_0x3567f1);}return _0x5972e2['save']();};}function saveUpdates(_0x4d723d,_0x49f424){return function(_0x2dd7d0){if(_0x2dd7d0){return _0x2dd7d0[_0x1bce('0x27')](_0x4d723d)[_0x1bce('0x28')](function(_0x3d26ee){return _0x3d26ee;});}return null;};}function removeEntity(_0xd71871,_0x1d2687){return function(_0x3e9e5a){if(_0x3e9e5a){return _0x3e9e5a[_0x1bce('0x29')]()[_0x1bce('0x28')](function(){var _0x2098a5=_0x3e9e5a[_0x1bce('0x2a')]({'plain':!![]});var _0x3d15a7='Lists';return db[_0x1bce('0x2b')][_0x1bce('0x29')]({'where':{'type':_0x3d15a7,'resourceId':_0x2098a5['id']}})['then'](function(){return _0x3e9e5a;});})[_0x1bce('0x28')](function(){_0xd71871['status'](0xcc)[_0x1bce('0x1f')]();});}};}function handleEntityNotFound(_0xcff3d4,_0x27c5c5){return function(_0x183f2e){if(!_0x183f2e){_0xcff3d4[_0x1bce('0x1e')](0x194);}return _0x183f2e;};}function handleError(_0x11feda,_0x537b8e){_0x537b8e=_0x537b8e||0x1f4;return function(_0xcdab69){logger[_0x1bce('0x2c')](_0xcdab69[_0x1bce('0x2d')]);if(_0xcdab69[_0x1bce('0x2e')]){delete _0xcdab69[_0x1bce('0x2e')];}_0x11feda[_0x1bce('0x20')](_0x537b8e)[_0x1bce('0x2f')](_0xcdab69);};}exports['index']=function(_0x4437ce,_0x52467a){var _0x4fd759={},_0x143477={},_0x57ff1d={'count':0x0,'rows':[]};var _0x2c3898=_['map'](db[_0x1bce('0x30')][_0x1bce('0x31')],function(_0x255b1c){return{'name':_0x255b1c[_0x1bce('0x32')],'type':_0x255b1c[_0x1bce('0x33')][_0x1bce('0x34')]};});_0x143477[_0x1bce('0x35')]=_[_0x1bce('0x36')](_0x2c3898,_0x1bce('0x2e'));_0x143477[_0x1bce('0x37')]=_[_0x1bce('0x38')](_0x4437ce[_0x1bce('0x37')]);_0x143477[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x143477['model'],_0x143477['query']);_0x4fd759[_0x1bce('0x3b')]=_['intersection'](_0x143477['model'],qs['fields'](_0x4437ce[_0x1bce('0x37')][_0x1bce('0x3c')]));_0x4fd759[_0x1bce('0x3b')]=_0x4fd759[_0x1bce('0x3b')]['length']?_0x4fd759[_0x1bce('0x3b')]:_0x143477[_0x1bce('0x35')];if(!_0x4437ce[_0x1bce('0x37')][_0x1bce('0x3d')](_0x1bce('0x3e'))){_0x4fd759[_0x1bce('0x3f')]=qs[_0x1bce('0x3f')](_0x4437ce['query'][_0x1bce('0x3f')]);_0x4fd759[_0x1bce('0x22')]=qs[_0x1bce('0x22')](_0x4437ce[_0x1bce('0x37')]['offset']);}_0x4fd759['order']=qs[_0x1bce('0x40')](_0x4437ce['query'][_0x1bce('0x40')]);_0x4fd759['where']=qs[_0x1bce('0x39')](_[_0x1bce('0x41')](_0x4437ce[_0x1bce('0x37')],_0x143477[_0x1bce('0x39')]),_0x2c3898);if(_0x4437ce[_0x1bce('0x37')][_0x1bce('0x42')]){_0x4fd759['where']=_[_0x1bce('0x43')](_0x4fd759[_0x1bce('0x44')],{'$or':_[_0x1bce('0x36')](_0x2c3898,function(_0x28f1cc){if(_0x28f1cc[_0x1bce('0x33')]!=='VIRTUAL'){var _0x165798={};_0x165798[_0x28f1cc[_0x1bce('0x2e')]]={'$like':'%'+_0x4437ce['query'][_0x1bce('0x42')]+'%'};return _0x165798;}})});}_0x4fd759=_[_0x1bce('0x43')]({},_0x4fd759,_0x4437ce['options']);var _0x21d00a={'where':_0x4fd759[_0x1bce('0x44')]};return db[_0x1bce('0x30')][_0x1bce('0x23')](_0x21d00a)[_0x1bce('0x28')](function(_0x31315a){_0x57ff1d['count']=_0x31315a;if(_0x4437ce[_0x1bce('0x37')][_0x1bce('0x45')]){_0x4fd759[_0x1bce('0x46')]=[{'all':!![]}];}return db[_0x1bce('0x30')][_0x1bce('0x47')](_0x4fd759);})[_0x1bce('0x28')](function(_0x2d1df3){_0x57ff1d['rows']=_0x2d1df3;return _0x57ff1d;})[_0x1bce('0x28')](respondWithFilteredResult(_0x52467a,_0x4fd759))[_0x1bce('0x48')](handleError(_0x52467a,null));};exports['show']=function(_0x1a6de1,_0x199f4c){var _0x26cd38={'raw':![],'where':{'id':_0x1a6de1[_0x1bce('0x49')]['id']}},_0x379d88={};_0x379d88[_0x1bce('0x35')]=_[_0x1bce('0x38')](db[_0x1bce('0x30')]['rawAttributes']);_0x379d88['query']=_[_0x1bce('0x38')](_0x1a6de1[_0x1bce('0x37')]);_0x379d88[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x379d88['model'],_0x379d88[_0x1bce('0x37')]);_0x26cd38['attributes']=_[_0x1bce('0x3a')](_0x379d88[_0x1bce('0x35')],qs[_0x1bce('0x3c')](_0x1a6de1[_0x1bce('0x37')][_0x1bce('0x3c')]));_0x26cd38['attributes']=_0x26cd38[_0x1bce('0x3b')][_0x1bce('0x4a')]?_0x26cd38['attributes']:_0x379d88[_0x1bce('0x35')];if(_0x1a6de1[_0x1bce('0x37')][_0x1bce('0x45')]){_0x26cd38[_0x1bce('0x46')]=[{'all':!![]}];}_0x26cd38=_[_0x1bce('0x43')]({},_0x26cd38,_0x1a6de1[_0x1bce('0x4b')]);return db['CmList'][_0x1bce('0x4c')](_0x26cd38)[_0x1bce('0x28')](handleEntityNotFound(_0x199f4c,null))['then'](respondWithResult(_0x199f4c,null))[_0x1bce('0x48')](handleError(_0x199f4c,null));};exports['create']=function(_0x354b44,_0xbd874c){return db[_0x1bce('0x30')][_0x1bce('0x4d')](_0x354b44[_0x1bce('0x4e')],{})[_0x1bce('0x28')](function(_0x198e6d){var _0x1b9be9=_0x354b44[_0x1bce('0x4f')][_0x1bce('0x2a')]({'plain':!![]});if(!_0x1b9be9)throw new Error(_0x1bce('0x50'));if(_0x1b9be9[_0x1bce('0x51')]===_0x1bce('0x4f')){var _0x40c210=_0x198e6d['get']({'plain':!![]});var _0x41b18d=_0x1bce('0x52');return db['UserProfileSection'][_0x1bce('0x4c')]({'where':{'name':_0x41b18d,'userProfileId':_0x1b9be9['userProfileId']},'raw':!![]})[_0x1bce('0x28')](function(_0x262f83){if(_0x262f83&&_0x262f83['autoAssociation']===0x0){return db[_0x1bce('0x2b')][_0x1bce('0x4d')]({'name':_0x40c210[_0x1bce('0x2e')],'resourceId':_0x40c210['id'],'type':_0x262f83[_0x1bce('0x2e')],'sectionId':_0x262f83['id']},{})[_0x1bce('0x28')](function(){return _0x198e6d;});}else{return _0x198e6d;}})['catch'](function(_0x53f84c){logger[_0x1bce('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f84c);throw _0x53f84c;});}return _0x198e6d;})[_0x1bce('0x28')](respondWithResult(_0xbd874c,0xc9))[_0x1bce('0x48')](handleError(_0xbd874c,null));};exports[_0x1bce('0x27')]=function(_0x5f46ca,_0x135824){if(_0x5f46ca['body']['id']){delete _0x5f46ca[_0x1bce('0x4e')]['id'];}return db[_0x1bce('0x30')][_0x1bce('0x4c')]({'where':{'id':_0x5f46ca[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x135824,null))[_0x1bce('0x28')](saveUpdates(_0x5f46ca[_0x1bce('0x4e')],null))['then'](respondWithResult(_0x135824,null))[_0x1bce('0x48')](handleError(_0x135824,null));};exports[_0x1bce('0x29')]=function(_0x303c62,_0x19a4b9){return db[_0x1bce('0x30')]['find']({'where':{'id':_0x303c62[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x19a4b9,null))[_0x1bce('0x28')](removeEntity(_0x19a4b9,null))[_0x1bce('0x48')](handleError(_0x19a4b9,null));};exports[_0x1bce('0x53')]=function(_0x4cf9b6,_0x398043){return db['CmList'][_0x1bce('0x53')]()['then'](respondWithResult(_0x398043,null))['catch'](handleError(_0x398043,null));};exports[_0x1bce('0x54')]=function(_0xd71b52,_0xcfa07d,_0x4a986d){if(_0xd71b52['body']['id']){delete _0xd71b52[_0x1bce('0x4e')]['id'];}return db[_0x1bce('0x30')]['find']({'where':{'id':_0xd71b52[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0xcfa07d,null))[_0x1bce('0x28')](function(_0x2bd00c){if(_0x2bd00c){_0xd71b52[_0x1bce('0x4e')]['ListId']=_0x2bd00c['id'];return db[_0x1bce('0x55')][_0x1bce('0x4d')](_0xd71b52[_0x1bce('0x4e')]);}})['then'](respondWithResult(_0xcfa07d,null))[_0x1bce('0x48')](handleError(_0xcfa07d,null));};exports['getDispositions']=function(_0x37acac,_0x2d8a05,_0xecf848){var _0x523d67={'raw':![],'where':{}};var _0x240517={};var _0x3df71b={'count':0x0,'rows':[]};return db[_0x1bce('0x30')][_0x1bce('0x56')]({'where':{'id':_0x37acac[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x2d8a05,null))[_0x1bce('0x28')](function(_0x47cf8a){if(_0x47cf8a){_0x240517[_0x1bce('0x35')]=_['keys'](db[_0x1bce('0x55')]['rawAttributes']);_0x240517[_0x1bce('0x37')]=_['keys'](_0x37acac[_0x1bce('0x37')]);_0x240517['filters']=_[_0x1bce('0x3a')](_0x240517[_0x1bce('0x35')],_0x240517[_0x1bce('0x37')]);_0x523d67[_0x1bce('0x3b')]=_[_0x1bce('0x3a')](_0x240517['model'],qs[_0x1bce('0x3c')](_0x37acac['query'][_0x1bce('0x3c')]));_0x523d67[_0x1bce('0x3b')]=_0x523d67[_0x1bce('0x3b')][_0x1bce('0x4a')]?_0x523d67[_0x1bce('0x3b')]:_0x240517['model'];if(!_0x37acac['query'][_0x1bce('0x3d')](_0x1bce('0x3e'))){_0x523d67['limit']=qs['limit'](_0x37acac[_0x1bce('0x37')]['limit']);_0x523d67['offset']=qs[_0x1bce('0x22')](_0x37acac['query']['offset']);}_0x523d67[_0x1bce('0x57')]=qs[_0x1bce('0x40')](_0x37acac[_0x1bce('0x37')]['sort']);_0x523d67['where']=qs[_0x1bce('0x39')](_['pick'](_0x37acac['query'],_0x240517[_0x1bce('0x39')]));_0x523d67[_0x1bce('0x44')][_0x1bce('0x58')]=_0x47cf8a['id'];if(_0x37acac[_0x1bce('0x37')]['filter']){_0x523d67['where']=_[_0x1bce('0x43')](_0x523d67[_0x1bce('0x44')],{'$or':_[_0x1bce('0x36')](_0x523d67['attributes'],function(_0x287d9f){var _0x1a429e={};_0x1a429e[_0x287d9f]={'$like':'%'+_0x37acac[_0x1bce('0x37')]['filter']+'%'};return _0x1a429e;})});}_0x523d67=_['merge']({},_0x523d67,_0x37acac[_0x1bce('0x4b')]);return db['Disposition'][_0x1bce('0x23')]({'where':_0x523d67[_0x1bce('0x44')]})['then'](function(_0x54aa8a){_0x3df71b[_0x1bce('0x23')]=_0x54aa8a;if(_0x37acac[_0x1bce('0x37')][_0x1bce('0x45')]){_0x523d67[_0x1bce('0x46')]=[{'all':!![]}];}return db[_0x1bce('0x55')][_0x1bce('0x47')](_0x523d67);})[_0x1bce('0x28')](function(_0x5ba62f){_0x3df71b[_0x1bce('0x59')]=_0x5ba62f;return _0x3df71b;});}})[_0x1bce('0x28')](respondWithFilteredResult(_0x2d8a05,_0x523d67))['catch'](handleError(_0x2d8a05,null));};exports[_0x1bce('0x5a')]=function(_0x12774e,_0x3fd577,_0x313967){return db[_0x1bce('0x30')]['find']({'where':{'id':_0x12774e['params']['id']}})['then'](handleEntityNotFound(_0x3fd577,null))[_0x1bce('0x28')](function(_0x16ec87){if(_0x16ec87){return _0x16ec87[_0x1bce('0x5a')](_0x12774e[_0x1bce('0x37')][_0x1bce('0x5b')]);}})[_0x1bce('0x28')](respondWithStatusCode(_0x3fd577,null))[_0x1bce('0x48')](handleError(_0x3fd577,null));};exports[_0x1bce('0x5c')]=function(_0x5c23d3,_0x166e50,_0x2477ea){return db['CmList'][_0x1bce('0x4c')]({'where':{'id':_0x5c23d3[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x166e50,null))[_0x1bce('0x28')](function(_0x22f828){if(_0x22f828){var _0x10929e=[];var _0x4263e9={'success':[],'errors':[]};return db[_0x1bce('0x5d')][_0x1bce('0x53')]()[_0x1bce('0x28')](function(_0x182945){if(_0x5c23d3[_0x1bce('0x4e')]['tags']&&_[_0x1bce('0x5e')](_0x5c23d3[_0x1bce('0x4e')]['tags'])){if(_0x5c23d3[_0x1bce('0x4e')][_0x1bce('0x5f')]['length']){_0x5c23d3[_0x1bce('0x4e')][_0x1bce('0x5f')]=_0x5c23d3[_0x1bce('0x4e')][_0x1bce('0x5f')]['join'](';')+';';}else{_0x5c23d3[_0x1bce('0x4e')][_0x1bce('0x5f')]=null;}}else{_0x5c23d3[_0x1bce('0x4e')][_0x1bce('0x5f')]=null;}if(_0x5c23d3[_0x1bce('0x4e')]&&_[_0x1bce('0x5e')](_0x5c23d3['body'])){for(var _0x247867=0x0;_0x247867<_0x5c23d3['body'][_0x1bce('0x4a')];_0x247867+=0x1){_0x5c23d3[_0x1bce('0x4e')][_0x247867][_0x1bce('0x58')]=_0x5c23d3[_0x1bce('0x49')]['id'];_0x10929e[_0x1bce('0x60')](_0x5c23d3['body'][_0x247867]);}return BPromise[_0x1bce('0x61')](_0x10929e,function(_0x17b80b){return db[_0x1bce('0x5d')][_0x1bce('0x4d')](_[_0x1bce('0x62')](_0x17b80b,[_0x1bce('0x5b'),'id'])||{},{'fields':_['keys'](_0x182945),'raw':!![]})['then'](function(_0x3e41ac){_0x4263e9[_0x1bce('0x63')][_0x1bce('0x60')](_0x3e41ac[_0x1bce('0x64')]);})[_0x1bce('0x48')](function(_0x1c60f4){_0x4263e9[_0x1bce('0x65')][_0x1bce('0x60')]({'data':_0x17b80b,'error':_0x1c60f4[_0x1bce('0x66')]});});})[_0x1bce('0x28')](function(_0x1cfefa){return _0x4263e9;})[_0x1bce('0x48')](function(_0x271491){return _0x271491;});}else{_0x166e50[_0x1bce('0x20')](0x190)[_0x1bce('0x21')]({'message':_0x1bce('0x67')});}});}})[_0x1bce('0x28')](respondWithResult(_0x166e50,null))[_0x1bce('0x48')](handleError(_0x166e50,null));};exports[_0x1bce('0x68')]=function(_0x5f1f7e,_0x1f299c,_0x48b37a){var _0x13775d;return db['CmList'][_0x1bce('0x4c')]({'where':{'id':_0x5f1f7e[_0x1bce('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x1bce('0x69')}]})[_0x1bce('0x28')](handleEntityNotFound(_0x1f299c,null))[_0x1bce('0x28')](function(_0x95b4f7){if(_0x95b4f7){_0x13775d=_0x95b4f7;return db['CmContact']['rawAttributes'];}})['then'](function(_0x1734e0){if(_0x1734e0){var _0x5a7e53={};var _0x5cc208={};_0x5cc208[_0x1bce('0x35')]=_['concat'](_[_0x1bce('0x38')](_0x1734e0),_[_0x1bce('0x36')](_0x13775d[_0x1bce('0x69')],function(_0x2c6c2c){return util['format']('cf_%d',_0x2c6c2c['id']);}));_0x5cc208[_0x1bce('0x37')]=_[_0x1bce('0x38')](_0x5f1f7e[_0x1bce('0x37')]);_0x5cc208[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x5cc208[_0x1bce('0x35')],_0x5cc208[_0x1bce('0x37')]);_0x5a7e53['attributes']=_[_0x1bce('0x3a')](_0x5cc208['model'],qs['fields'](_0x5f1f7e['query'][_0x1bce('0x3c')]));_0x5a7e53[_0x1bce('0x3b')]=_0x5a7e53[_0x1bce('0x3b')][_0x1bce('0x4a')]?_0x5a7e53[_0x1bce('0x3b')]:_0x5cc208[_0x1bce('0x35')];if(!_0x5f1f7e['query'][_0x1bce('0x3d')](_0x1bce('0x3e'))){_0x5a7e53['limit']=qs[_0x1bce('0x3f')](_0x5f1f7e[_0x1bce('0x37')][_0x1bce('0x3f')]);_0x5a7e53[_0x1bce('0x22')]=qs[_0x1bce('0x22')](_0x5f1f7e[_0x1bce('0x37')]['offset']);}_0x5a7e53['order']=qs[_0x1bce('0x40')](_0x5f1f7e[_0x1bce('0x37')]['sort']);_0x5a7e53[_0x1bce('0x44')]=qs['filters'](_[_0x1bce('0x41')](_0x5f1f7e[_0x1bce('0x37')],_0x5cc208[_0x1bce('0x39')]));_0x5a7e53[_0x1bce('0x6a')]=!![];if(_0x5f1f7e[_0x1bce('0x37')][_0x1bce('0x42')]){_0x5a7e53[_0x1bce('0x44')]=_[_0x1bce('0x43')](_0x5a7e53['where'],{'$or':_[_0x1bce('0x36')](_0x5a7e53[_0x1bce('0x3b')],function(_0x1ee099){var _0x1184ae={};_0x1184ae[_0x1ee099]={'$like':'%'+_0x5f1f7e[_0x1bce('0x37')]['filter']+'%'};return _0x1184ae;})});}_0x5a7e53=_[_0x1bce('0x43')]({},_0x5a7e53,_0x5f1f7e[_0x1bce('0x4b')]);return _0x13775d[_0x1bce('0x68')](_0x5a7e53);}})[_0x1bce('0x28')](respondWithResult(_0x1f299c,null))[_0x1bce('0x48')](handleError(_0x1f299c,null));};exports[_0x1bce('0x6b')]=function(_0x357137,_0x222e6c,_0x5051b5){var _0x2481d4;var _0x4c72c0;var _0x2f6a17;var _0x1fee2b=_0x357137[_0x1bce('0x49')]['id'];csv_results=[];return db[_0x1bce('0x6c')][_0x1bce('0x47')]({'attributes':['id',_0x1bce('0x2e')],'raw':!![],'order':[_0x1bce('0x6d')]})[_0x1bce('0x28')](function(_0x3d5a18){_0x2481d4=_0x3d5a18;var _0x14c5ac=_[_0x1bce('0x38')](db[_0x1bce('0x5d')][_0x1bce('0x31')]);return db[_0x1bce('0x6e')]['findAll']({'raw':!![],'attributes':['id','alias']})[_0x1bce('0x28')](function(_0x256811){_0x4c72c0=_0x256811;var _0x364de9=squel[_0x1bce('0x6f')]()[_0x1bce('0x3c')](_0x14c5ac)[_0x1bce('0x70')](_0x1bce('0x71'),'c')[_0x1bce('0x44')](_0x1bce('0x72'),_0x1fee2b)['where'](_0x1bce('0x73'))[_0x1bce('0x74')]();for(var _0x3eade2=0x0;_0x3eade2<_0x4c72c0[_0x1bce('0x4a')];_0x3eade2++){_0x364de9[_0x1bce('0x75')](_0x1bce('0x76')+_0x4c72c0[_0x3eade2]['id'],_0x1bce('0x77')+_0x4c72c0[_0x3eade2][_0x1bce('0x78')]);}for(var _0x3eade2=0x0;_0x3eade2<_0x2481d4[_0x1bce('0x4a')];_0x3eade2++){_0x364de9['field'](squel[_0x1bce('0x6f')]()[_0x1bce('0x75')](_0x1bce('0x79'))['from'](_0x1bce('0x7a'))[_0x1bce('0x44')]('ItemTypeId\x20=\x20?',_0x2481d4[_0x3eade2]['id'])[_0x1bce('0x44')](_0x1bce('0x7b')),_0x1bce('0x7c')+_0x2481d4[_0x3eade2]['name']);_0x364de9['field'](squel[_0x1bce('0x6f')]()['field'](_0x1bce('0x7d'))[_0x1bce('0x70')](_0x1bce('0x7a'))[_0x1bce('0x44')]('ItemTypeId\x20=\x20?',_0x2481d4[_0x3eade2]['id'])[_0x1bce('0x44')](_0x1bce('0x7b')),_0x1bce('0x7e')+_0x2481d4[_0x3eade2][_0x1bce('0x2e')]);}var _0x2a0f33=[];_0x2a0f33[_0x1bce('0x60')](_0x364de9[_0x1bce('0x7f')]());BPromise['each'](_0x2a0f33,handleQuery)[_0x1bce('0x28')](function(_0x5561ba){handleQuery(_0x364de9['toString']());var _0x101f44=csv_results[0x0];if(!_[_0x1bce('0x80')](_0x101f44)){var _0x57c2dd=toCsv(_0x101f44);var _0x446819=Date[_0x1bce('0x81')]();fs[_0x1bce('0x82')](util[_0x1bce('0x83')](_0x1bce('0x84'),_0x1fee2b,_0x446819),_0x57c2dd);_0x222e6c[_0x1bce('0x85')](_0x1bce('0x86'),_0x1bce('0x87')+util[_0x1bce('0x83')](_0x1bce('0x88'),_0x1fee2b,_0x446819));_0x222e6c[_0x1bce('0x85')](_0x1bce('0x89'),_0x1bce('0x8a'));return _0x222e6c[_0x1bce('0x8b')](util[_0x1bce('0x83')](_0x1bce('0x84'),_0x1fee2b,_0x446819));}else{return _0x222e6c['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x2e088c,_0x4b30bd,_0x7fd959){var _0x4f5bea;delete _0x2e088c[_0x1bce('0x4e')]['id'];return db[_0x1bce('0x30')][_0x1bce('0x56')]({'where':{'id':_0x2e088c['params']['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x4b30bd,null))[_0x1bce('0x28')](function(_0x56c86b){if(_0x56c86b){return db['sequelize']['transaction'](function(_0x4f2f23){return db['CmCustomField'][_0x1bce('0x4d')](_0x2e088c[_0x1bce('0x4e')],{'transaction':_0x4f2f23})[_0x1bce('0x28')](function(_0x4f371c){_0x4f5bea=_0x4f371c;return _0x56c86b['addCustomFields'](_0x4f371c,{'transaction':_0x4f2f23});})[_0x1bce('0x28')](function(){var _0x27b43a={'type':db[_0x1bce('0x8c')]['TEXT'],'transaction':_0x4f2f23};switch(_0x2e088c['body'][_0x1bce('0x33')]){case'text':_0x27b43a[_0x1bce('0x33')]=db[_0x1bce('0x8c')][_0x1bce('0x8d')];break;case _0x1bce('0x8e'):_0x27b43a[_0x1bce('0x33')]=db['Sequelize'][_0x1bce('0x8f')];break;case'switch':_0x27b43a[_0x1bce('0x33')]=db['Sequelize']['BOOLEAN'];_0x27b43a[_0x1bce('0x90')]=![];break;default:}return db[_0x1bce('0x91')][_0x1bce('0x92')][_0x1bce('0x93')](_0x1bce('0x71'),util['format']('cf_%s',_0x4f5bea['id']),_0x27b43a);})[_0x1bce('0x28')](function(){return _0x4f5bea;});});}})[_0x1bce('0x28')](respondWithResult(_0x4b30bd,null))['catch'](handleError(_0x4b30bd,null));};exports[_0x1bce('0x94')]=function(_0x158695,_0x204293,_0x942dcc){var _0x3f97c6={};var _0x565fdd={};var _0x7ba7c4;var _0x4744ec;return db[_0x1bce('0x30')][_0x1bce('0x56')]({'where':{'id':_0x158695[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x204293,null))[_0x1bce('0x28')](function(_0x1e82e4){if(_0x1e82e4){_0x7ba7c4=_0x1e82e4;_0x565fdd[_0x1bce('0x35')]=_['keys'](db[_0x1bce('0x6e')]['rawAttributes']);_0x565fdd[_0x1bce('0x37')]=_[_0x1bce('0x38')](_0x158695[_0x1bce('0x37')]);_0x565fdd[_0x1bce('0x39')]=_['intersection'](_0x565fdd[_0x1bce('0x35')],_0x565fdd['query']);_0x3f97c6[_0x1bce('0x3b')]=_[_0x1bce('0x3a')](_0x565fdd[_0x1bce('0x35')],qs[_0x1bce('0x3c')](_0x158695[_0x1bce('0x37')][_0x1bce('0x3c')]));_0x3f97c6[_0x1bce('0x3b')]=_0x3f97c6[_0x1bce('0x3b')][_0x1bce('0x4a')]?_0x3f97c6[_0x1bce('0x3b')]:_0x565fdd[_0x1bce('0x35')];_0x3f97c6[_0x1bce('0x57')]=qs['sort'](_0x158695['query'][_0x1bce('0x40')]);_0x3f97c6[_0x1bce('0x44')]=qs[_0x1bce('0x39')](_[_0x1bce('0x41')](_0x158695[_0x1bce('0x37')],_0x565fdd[_0x1bce('0x39')]));_0x3f97c6[_0x1bce('0x44')]=_[_0x1bce('0x43')](_0x3f97c6[_0x1bce('0x44')],{'$or':[{'ListId':_0x1e82e4['id']},{'ListId':null}]});if(_0x158695[_0x1bce('0x37')][_0x1bce('0x42')]){_0x3f97c6['where']=_['merge'](_0x3f97c6[_0x1bce('0x44')],{'$or':_[_0x1bce('0x36')](_0x3f97c6[_0x1bce('0x3b')],function(_0x192147){var _0xc52810={};_0xc52810[_0x192147]={'$like':'%'+_0x158695[_0x1bce('0x37')][_0x1bce('0x42')]+'%'};return _0xc52810;})});}_0x3f97c6=_[_0x1bce('0x43')]({},_0x3f97c6,_0x158695[_0x1bce('0x4b')]);return db['CmCustomField'][_0x1bce('0x95')](_0x3f97c6);}})[_0x1bce('0x28')](respondWithResult(_0x204293,null))[_0x1bce('0x48')](handleError(_0x204293,null));};exports[_0x1bce('0x96')]=function(_0xcab6cb,_0x4ff7df){return db[_0x1bce('0x6e')]['findAndCountAll']({'where':{'ListId':null}})[_0x1bce('0x28')](handleEntityNotFound(_0x4ff7df,null))['then'](function(_0x120e7c){return _0x120e7c;})[_0x1bce('0x28')](respondWithResult(_0x4ff7df,null))[_0x1bce('0x48')](handleError(_0x4ff7df,null));};exports['addAgents']=function(_0x439c6f,_0x5e3b79,_0xc05583){return db[_0x1bce('0x30')][_0x1bce('0x4c')]({'where':{'id':_0x439c6f[_0x1bce('0x49')]['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x5e3b79,null))[_0x1bce('0x28')](function(_0x51c9ad){if(_0x51c9ad){return _0x51c9ad[_0x1bce('0x97')](_0x439c6f['body'][_0x1bce('0x5b')],_[_0x1bce('0x62')](_0x439c6f['body'],[_0x1bce('0x5b'),'id'])||{})[_0x1bce('0x98')](function(_0x3f6248){for(var _0x2ddd09=0x0;_0x2ddd09<_0x439c6f[_0x1bce('0x4e')]['ids'][_0x1bce('0x4a')];_0x2ddd09+=0x1){socket[_0x1bce('0x99')](_0x1bce('0x9a'),{'UserId':Number(_0x439c6f[_0x1bce('0x4e')][_0x1bce('0x5b')][_0x2ddd09]),'CmListId':Number(_0x439c6f[_0x1bce('0x49')]['id'])});}return _0x3f6248;});}})['then'](respondWithResult(_0x5e3b79,null))[_0x1bce('0x48')](handleError(_0x5e3b79,null));};exports['removeAgents']=function(_0x5c9f44,_0x2fbc29,_0xecb163){return db[_0x1bce('0x30')][_0x1bce('0x4c')]({'where':{'id':_0x5c9f44['params']['id']}})['then'](handleEntityNotFound(_0x2fbc29,null))[_0x1bce('0x28')](function(_0x263f87){if(_0x263f87){return _0x263f87[_0x1bce('0x9b')](_0x5c9f44[_0x1bce('0x37')][_0x1bce('0x5b')])[_0x1bce('0x28')](function(){if(_['isArray'](_0x5c9f44[_0x1bce('0x37')][_0x1bce('0x5b')])){for(var _0x48f7ee=0x0;_0x48f7ee<_0x5c9f44[_0x1bce('0x37')][_0x1bce('0x5b')][_0x1bce('0x4a')];_0x48f7ee+=0x1){socket[_0x1bce('0x99')]('userCmList:remove',{'UserId':Number(_0x5c9f44[_0x1bce('0x37')][_0x1bce('0x5b')][_0x48f7ee]),'CmListId':Number(_0x5c9f44[_0x1bce('0x49')]['id'])});}}else{socket[_0x1bce('0x99')](_0x1bce('0x9c'),{'UserId':Number(_0x5c9f44[_0x1bce('0x37')]['ids']),'CmListId':Number(_0x5c9f44[_0x1bce('0x49')]['id'])});}});}})[_0x1bce('0x28')](respondWithStatusCode(_0x2fbc29,null))[_0x1bce('0x48')](handleError(_0x2fbc29,null));};exports[_0x1bce('0x9d')]=function(_0x40df25,_0x558fe0,_0x50164c){var _0x596c32={};var _0x390c05={};var _0xb0c51d;var _0x4c6bb9;return db[_0x1bce('0x30')][_0x1bce('0x56')]({'where':{'id':_0x40df25['params']['id']}})[_0x1bce('0x28')](handleEntityNotFound(_0x558fe0,null))[_0x1bce('0x28')](function(_0x215b7c){if(_0x215b7c){_0xb0c51d=_0x215b7c;_0x390c05['model']=_[_0x1bce('0x38')](db[_0x1bce('0x9e')][_0x1bce('0x31')]);_0x390c05['query']=_[_0x1bce('0x38')](_0x40df25[_0x1bce('0x37')]);_0x390c05[_0x1bce('0x39')]=_[_0x1bce('0x3a')](_0x390c05[_0x1bce('0x35')],_0x390c05[_0x1bce('0x37')]);_0x596c32['attributes']=_[_0x1bce('0x3a')](_0x390c05['model'],qs[_0x1bce('0x3c')](_0x40df25[_0x1bce('0x37')][_0x1bce('0x3c')]));_0x596c32[_0x1bce('0x3b')]=_0x596c32[_0x1bce('0x3b')][_0x1bce('0x4a')]?_0x596c32['attributes']:_0x390c05[_0x1bce('0x35')];_0x596c32['order']=qs['sort'](_0x40df25[_0x1bce('0x37')][_0x1bce('0x40')]);_0x596c32['where']=qs[_0x1bce('0x39')](_[_0x1bce('0x41')](_0x40df25[_0x1bce('0x37')],_0x390c05[_0x1bce('0x39')]));if(_0x40df25[_0x1bce('0x37')][_0x1bce('0x42')]){_0x596c32[_0x1bce('0x44')]=_[_0x1bce('0x43')](_0x596c32[_0x1bce('0x44')],{'$or':_[_0x1bce('0x36')](_0x596c32[_0x1bce('0x3b')],function(_0x14e327){var _0x5ebb11={};_0x5ebb11[_0x14e327]={'$like':'%'+_0x40df25[_0x1bce('0x37')][_0x1bce('0x42')]+'%'};return _0x5ebb11;})});}_0x596c32=_[_0x1bce('0x43')]({},_0x596c32,_0x40df25[_0x1bce('0x4b')]);return _0xb0c51d[_0x1bce('0x9d')](_0x596c32);}})[_0x1bce('0x28')](function(_0x1ed86b){if(_0x1ed86b){_0x4c6bb9=_0x1ed86b[_0x1bce('0x4a')];if(!_0x40df25[_0x1bce('0x37')][_0x1bce('0x3d')](_0x1bce('0x3e'))){_0x596c32[_0x1bce('0x3f')]=qs[_0x1bce('0x3f')](_0x40df25['query']['limit']);_0x596c32['offset']=qs[_0x1bce('0x22')](_0x40df25['query'][_0x1bce('0x22')]);}return _0xb0c51d[_0x1bce('0x9d')](_0x596c32);}})['then'](function(_0x19287f){if(_0x19287f){return _0x19287f?{'count':_0x4c6bb9,'rows':_0x19287f}:null;}})[_0x1bce('0x28')](respondWithResult(_0x558fe0,null))[_0x1bce('0x48')](handleError(_0x558fe0,null));};function handleQuery(_0x19d79d){logger[_0x1bce('0x9f')](_0x19d79d);return db[_0x1bce('0x91')][_0x1bce('0x37')](_0x19d79d)[_0x1bce('0x98')](function(_0x134edf){csv_results['push'](_0x134edf);})[_0x1bce('0x48')](function(_0x4828a9){logger['error'](_0x4828a9[_0x1bce('0x66')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d69cf80..28a0c29 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x1e1ad9,_0x379e60){var _0x24a3ba=function(_0x17c87a){while(--_0x17c87a){_0x1e1ad9['push'](_0x1e1ad9['shift']());}};_0x24a3ba(++_0x379e60);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x2828b3,_0x2bb499){var _0x3ddbce=function(_0x424ced){while(--_0x424ced){_0x2828b3['push'](_0x2828b3['shift']());}};_0x3ddbce(++_0x2bb499);}(_0x814b,0x1a2));var _0xb814=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0x814b[_0x86c6cb];return _0x1b1592;};'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 aa25923..61ca5e2 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x30e8ac,_0x7f65a9){var _0x5a057c=function(_0x87369f){while(--_0x87369f){_0x30e8ac['push'](_0x30e8ac['shift']());}};_0x5a057c(++_0x7f65a9);}(_0x2dae,0xc3));var _0xe2da=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x2dae[_0x3e0763];return _0x351ca2;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x561222,_0x18b75b){_0x561222=_0x561222-0x0;var _0x43494b=_0x6f0d[_0x561222];return _0x43494b;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'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 ec7f373..8a8cdf6 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 _0xdafd=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x102a81,_0x1865d3){var _0x5bb8fa=function(_0x4f9cb0){while(--_0x4f9cb0){_0x102a81['push'](_0x102a81['shift']());}};_0x5bb8fa(++_0x1865d3);}(_0xdafd,0x1b3));var _0xddaf=function(_0x7a0cb8,_0xfdb29e){_0x7a0cb8=_0x7a0cb8-0x0;var _0x4dd048=_0xdafd[_0x7a0cb8];return _0x4dd048;};'use strict';var _=require(_0xddaf('0x0'));var util=require('util');var moment=require(_0xddaf('0x1'));var BPromise=require(_0xddaf('0x2'));var rs=require(_0xddaf('0x3'));var fs=require('fs');var Redis=require(_0xddaf('0x4'));var db=require(_0xddaf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xddaf('0x6'));var config=require(_0xddaf('0x7'));var jayson=require(_0xddaf('0x8'));var client=jayson['client'][_0xddaf('0x9')]({'port':0x232a});config[_0xddaf('0xa')]=_[_0xddaf('0xb')](config[_0xddaf('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xddaf('0xc'))(new Redis(config[_0xddaf('0xa')]));require(_0xddaf('0xd'))[_0xddaf('0xe')](socket);function respondWithRpcPromise(_0xc97fc8,_0x46d451,_0x5f1474){return new BPromise(function(_0x5ce47b,_0x1fd745){return client[_0xddaf('0xf')](_0xc97fc8,_0x5f1474)[_0xddaf('0x10')](function(_0xe37dcb){logger['info'](_0xddaf('0x11'),_0x46d451,_0xddaf('0x12'));logger[_0xddaf('0x13')](_0xddaf('0x14'),_0x46d451,'request\x20sent',JSON[_0xddaf('0x15')](_0xe37dcb));if(_0xe37dcb[_0xddaf('0x16')]){if(_0xe37dcb[_0xddaf('0x16')][_0xddaf('0x17')]===0x1f4){logger['error'](_0xddaf('0x11'),_0x46d451,_0xe37dcb['error'][_0xddaf('0x18')]);return _0x1fd745(_0xe37dcb['error']['message']);}logger[_0xddaf('0x16')](_0xddaf('0x11'),_0x46d451,_0xe37dcb[_0xddaf('0x16')][_0xddaf('0x18')]);return _0x5ce47b(_0xe37dcb[_0xddaf('0x16')][_0xddaf('0x18')]);}else{logger['info'](_0xddaf('0x11'),_0x46d451,_0xddaf('0x12'));_0x5ce47b(_0xe37dcb[_0xddaf('0x19')][_0xddaf('0x18')]);}})[_0xddaf('0x1a')](function(_0x4b2c2d){logger['error'](_0xddaf('0x11'),_0x46d451,_0x4b2c2d);_0x1fd745(_0x4b2c2d);});});} \ No newline at end of file +var _0x2e7f=['error','code','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x182f79,_0x1f7bfc){var _0x5d8c58=function(_0xaf82c3){while(--_0xaf82c3){_0x182f79['push'](_0x182f79['shift']());}};_0x5d8c58(++_0x1f7bfc);}(_0x2e7f,0x108));var _0xf2e7=function(_0x197560,_0x493652){_0x197560=_0x197560-0x0;var _0x576a01=_0x2e7f[_0x197560];return _0x576a01;};'use strict';var _=require(_0xf2e7('0x0'));var util=require(_0xf2e7('0x1'));var moment=require('moment');var BPromise=require(_0xf2e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2e7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2e7('0x4'));var logger=require(_0xf2e7('0x5'))(_0xf2e7('0x6'));var config=require(_0xf2e7('0x7'));var jayson=require(_0xf2e7('0x8'));var client=jayson[_0xf2e7('0x9')][_0xf2e7('0xa')]({'port':0x232a});config[_0xf2e7('0xb')]=_['defaults'](config['redis'],{'host':_0xf2e7('0xc'),'port':0x18eb});var socket=require(_0xf2e7('0xd'))(new Redis(config['redis']));require(_0xf2e7('0xe'))[_0xf2e7('0xf')](socket);function respondWithRpcPromise(_0x5247dd,_0x109316,_0x38d174){return new BPromise(function(_0x42aab3,_0x4df6c1){return client[_0xf2e7('0x10')](_0x5247dd,_0x38d174)[_0xf2e7('0x11')](function(_0xa67a7c){logger[_0xf2e7('0x12')](_0xf2e7('0x13'),_0x109316,_0xf2e7('0x14'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x109316,_0xf2e7('0x14'),JSON[_0xf2e7('0x15')](_0xa67a7c));if(_0xa67a7c[_0xf2e7('0x16')]){if(_0xa67a7c['error'][_0xf2e7('0x17')]===0x1f4){logger[_0xf2e7('0x16')](_0xf2e7('0x13'),_0x109316,_0xa67a7c['error'][_0xf2e7('0x18')]);return _0x4df6c1(_0xa67a7c[_0xf2e7('0x16')]['message']);}logger[_0xf2e7('0x16')](_0xf2e7('0x13'),_0x109316,_0xa67a7c[_0xf2e7('0x16')][_0xf2e7('0x18')]);return _0x42aab3(_0xa67a7c[_0xf2e7('0x16')][_0xf2e7('0x18')]);}else{logger[_0xf2e7('0x12')](_0xf2e7('0x13'),_0x109316,_0xf2e7('0x14'));_0x42aab3(_0xa67a7c[_0xf2e7('0x19')][_0xf2e7('0x18')]);}})['catch'](function(_0x457190){logger[_0xf2e7('0x16')]('CmList,\x20%s,\x20%s',_0x109316,_0x457190);_0x4df6c1(_0x457190);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 835c6ff..7bbe719 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 _0x831d=['removeListener','register','length','cmList:','./cmList.events','save','update','emit'];(function(_0x596dbf,_0x5a2e3d){var _0x222953=function(_0x4dd8e1){while(--_0x4dd8e1){_0x596dbf['push'](_0x596dbf['shift']());}};_0x222953(++_0x5a2e3d);}(_0x831d,0x19c));var _0xd831=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x831d[_0x445101];return _0x3c3d04;};'use strict';var CmListEvents=require(_0xd831('0x0'));var events=[_0xd831('0x1'),'remove',_0xd831('0x2')];function createListener(_0x54b28e,_0x3080de){return function(_0x5e3531){_0x3080de[_0xd831('0x3')](_0x54b28e,_0x5e3531);};}function removeListener(_0x3c2944,_0x2301c3){return function(){CmListEvents[_0xd831('0x4')](_0x3c2944,_0x2301c3);};}exports[_0xd831('0x5')]=function(_0x1ba52d){for(var _0x30741e=0x0,_0x1ee494=events[_0xd831('0x6')];_0x30741e<_0x1ee494;_0x30741e++){var _0x40467=events[_0x30741e];var _0x173d6e=createListener(_0xd831('0x7')+_0x40467,_0x1ba52d);CmListEvents['on'](_0x40467,_0x173d6e);}}; \ No newline at end of file +var _0xcc0c=['./cmList.events','save','remove','update','length','cmList:'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xcc0c,0x102));var _0xccc0=function(_0x22e101,_0x412840){_0x22e101=_0x22e101-0x0;var _0xa51f61=_0xcc0c[_0x22e101];return _0xa51f61;};'use strict';var CmListEvents=require(_0xccc0('0x0'));var events=[_0xccc0('0x1'),_0xccc0('0x2'),_0xccc0('0x3')];function createListener(_0x10af09,_0x155063){return function(_0x2ebeca){_0x155063['emit'](_0x10af09,_0x2ebeca);};}function removeListener(_0x1f3d3e,_0x3cd3c2){return function(){CmListEvents['removeListener'](_0x1f3d3e,_0x3cd3c2);};}exports['register']=function(_0x1d99f6){for(var _0x5629d2=0x0,_0x2a54a6=events[_0xccc0('0x4')];_0x5629d2<_0x2a54a6;_0x5629d2++){var _0x536ff0=events[_0x5629d2];var _0xe587c2=createListener(_0xccc0('0x5')+_0x536ff0,_0x1d99f6);CmListEvents['on'](_0x536ff0,_0xe587c2);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b55890a..f8ca383 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 _0x2227=['/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','/describe','describe','get','getGlobalCustomFields'];(function(_0x51e4bd,_0x31c995){var _0x3c5c7e=function(_0x50cdf3){while(--_0x50cdf3){_0x51e4bd['push'](_0x51e4bd['shift']());}};_0x3c5c7e(++_0x31c995);}(_0x2227,0x147));var _0x7222=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x2227[_0x258fb0];return _0x4d1afe;};'use strict';var multer=require(_0x7222('0x0'));var util=require(_0x7222('0x1'));var path=require(_0x7222('0x2'));var timeout=require('connect-timeout');var express=require(_0x7222('0x3'));var router=express[_0x7222('0x4')]();var fs_extra=require(_0x7222('0x5'));var auth=require(_0x7222('0x6'));var interaction=require(_0x7222('0x7'));var config=require(_0x7222('0x8'));var controller=require(_0x7222('0x9'));router['get']('/',auth[_0x7222('0xa')](),controller['index']);router['get'](_0x7222('0xb'),auth[_0x7222('0xa')](),controller[_0x7222('0xc')]);router[_0x7222('0xd')]('/global_fields',auth[_0x7222('0xa')](),controller[_0x7222('0xe')]);router[_0x7222('0xd')](_0x7222('0xf'),auth[_0x7222('0xa')](),controller[_0x7222('0x10')]);router[_0x7222('0xd')](_0x7222('0x11'),auth[_0x7222('0xa')](),controller[_0x7222('0x12')]);router[_0x7222('0xd')]('/:id/contacts',auth[_0x7222('0xa')](),controller[_0x7222('0x13')]);router[_0x7222('0xd')](_0x7222('0x14'),auth[_0x7222('0xa')](),controller[_0x7222('0x15')]);router['get'](_0x7222('0x16'),auth['isAuthenticated'](),controller[_0x7222('0x17')]);router[_0x7222('0xd')](_0x7222('0x18'),auth[_0x7222('0xa')](),controller[_0x7222('0x19')]);router[_0x7222('0x1a')]('/',auth[_0x7222('0xa')](),controller[_0x7222('0x1b')]);router[_0x7222('0x1a')](_0x7222('0x11'),auth[_0x7222('0xa')](),controller[_0x7222('0x1c')]);router[_0x7222('0x1a')]('/:id/contacts',auth[_0x7222('0xa')](),controller[_0x7222('0x1d')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller['addCustomField']);router[_0x7222('0x1a')](_0x7222('0x18'),auth['isAuthenticated'](),controller[_0x7222('0x1e')]);router[_0x7222('0x1f')](_0x7222('0xf'),auth[_0x7222('0xa')](),controller[_0x7222('0x20')]);router[_0x7222('0x21')](_0x7222('0xf'),auth[_0x7222('0xa')](),controller[_0x7222('0x22')]);router[_0x7222('0x21')](_0x7222('0x11'),auth[_0x7222('0xa')](),controller[_0x7222('0x23')]);router[_0x7222('0x21')](_0x7222('0x18'),auth[_0x7222('0xa')](),controller[_0x7222('0x24')]);module[_0x7222('0x25')]=router; \ No newline at end of file +var _0xdd66=['/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','update','delete','removeDispositions','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields'];(function(_0xfb0266,_0x2befed){var _0x33ae42=function(_0x42aa8d){while(--_0x42aa8d){_0xfb0266['push'](_0xfb0266['shift']());}};_0x33ae42(++_0x2befed);}(_0xdd66,0x121));var _0x6dd6=function(_0x36707b,_0x4e5bdb){_0x36707b=_0x36707b-0x0;var _0x4e4d87=_0xdd66[_0x36707b];return _0x4e4d87;};'use strict';var multer=require('multer');var util=require(_0x6dd6('0x0'));var path=require(_0x6dd6('0x1'));var timeout=require('connect-timeout');var express=require(_0x6dd6('0x2'));var router=express[_0x6dd6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6dd6('0x4'));var interaction=require(_0x6dd6('0x5'));var config=require(_0x6dd6('0x6'));var controller=require(_0x6dd6('0x7'));router[_0x6dd6('0x8')]('/',auth['isAuthenticated'](),controller[_0x6dd6('0x9')]);router[_0x6dd6('0x8')](_0x6dd6('0xa'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0xc')]);router['get'](_0x6dd6('0xd'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0xe')]);router[_0x6dd6('0x8')](_0x6dd6('0xf'),auth['isAuthenticated'](),controller[_0x6dd6('0x10')]);router['get'](_0x6dd6('0x11'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x12')]);router['get'](_0x6dd6('0x13'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x14')]);router[_0x6dd6('0x8')](_0x6dd6('0x15'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x16')]);router[_0x6dd6('0x8')](_0x6dd6('0x17'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x18')]);router['get'](_0x6dd6('0x19'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x1a')]);router[_0x6dd6('0x1b')]('/',auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x1c')]);router[_0x6dd6('0x1b')](_0x6dd6('0x11'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x1d')]);router[_0x6dd6('0x1b')]('/:id/contacts',auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x1e')]);router['post'](_0x6dd6('0x17'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x1f')]);router[_0x6dd6('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x6dd6('0x20')]);router['put'](_0x6dd6('0xf'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x21')]);router[_0x6dd6('0x22')](_0x6dd6('0xf'),auth[_0x6dd6('0xb')](),controller['destroy']);router[_0x6dd6('0x22')](_0x6dd6('0x11'),auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x23')]);router['delete']('/:id/users',auth[_0x6dd6('0xb')](),controller[_0x6dd6('0x24')]);module[_0x6dd6('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 12643fa..e43ee22 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 _0x1a1e=['getDataValue','STRING','sequelize','exports'];(function(_0x111be7,_0x45b6cb){var _0x5c4c5e=function(_0x352dc4){while(--_0x352dc4){_0x111be7['push'](_0x111be7['shift']());}};_0x5c4c5e(++_0x45b6cb);}(_0x1a1e,0x106));var _0xe1a1=function(_0xa04daf,_0x25e602){_0xa04daf=_0xa04daf-0x0;var _0x3f7fa6=_0x1a1e[_0xa04daf];return _0x3f7fa6;};'use strict';var Sequelize=require(_0xe1a1('0x0'));module[_0xe1a1('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4885e0){return this[_0xe1a1('0x2')]('field');}},'field':{'type':Sequelize[_0xe1a1('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xe1a1('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xe1a1('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xdb2b=['exports','field','STRING','sequelize'];(function(_0x370852,_0x2c7e62){var _0x40cc7e=function(_0x34a439){while(--_0x34a439){_0x370852['push'](_0x370852['shift']());}};_0x40cc7e(++_0x2c7e62);}(_0xdb2b,0xbf));var _0xbdb2=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xdb2b[_0x4fa438];return _0x4e3958;};'use strict';var Sequelize=require(_0xbdb2('0x0'));module[_0xbdb2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x423140){return this['getDataValue'](_0xbdb2('0x2'));}},'field':{'type':Sequelize[_0xbdb2('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xbdb2('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xbdb2('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 830a386..370461e 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x37d550,_0x2ea910){var _0x401427=function(_0x25a48c){while(--_0x25a48c){_0x37d550['push'](_0x37d550['shift']());}};_0x401427(++_0x2ea910);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4f4b4e,_0x3aba9c){var _0x592918=function(_0x2a06a4){while(--_0x2a06a4){_0x4f4b4e['push'](_0x4f4b4e['shift']());}};_0x592918(++_0x3aba9c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f888aab..db54d7d 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 _0xc879=['path','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1e1d32,_0x13c313){var _0x1b0bd8=function(_0x3d8f7e){while(--_0x3d8f7e){_0x1e1d32['push'](_0x1e1d32['shift']());}};_0x1b0bd8(++_0x13c313);}(_0xc879,0x165));var _0x9c87=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xc879[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x9c87('0x0'));var util=require(_0x9c87('0x1'));var logger=require(_0x9c87('0x2'))(_0x9c87('0x3'));var moment=require('moment');var BPromise=require(_0x9c87('0x4'));var rp=require(_0x9c87('0x5'));var fs=require('fs');var path=require(_0x9c87('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c87('0x7'));module[_0x9c87('0x8')]=function(_0x23e604,_0x4919d7){return _0x23e604[_0x9c87('0x9')]('Condition',attributes,{'tableName':_0x9c87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dd9=['request-promise','path','define','Condition','lodash','util','../../config/logger','api'];(function(_0x5adb18,_0x222326){var _0x420c98=function(_0x146b7b){while(--_0x146b7b){_0x5adb18['push'](_0x5adb18['shift']());}};_0x420c98(++_0x222326);}(_0x4dd9,0x144));var _0x94dd=function(_0x230949,_0x790da6){_0x230949=_0x230949-0x0;var _0x54a3dd=_0x4dd9[_0x230949];return _0x54a3dd;};'use strict';var _=require(_0x94dd('0x0'));var util=require(_0x94dd('0x1'));var logger=require(_0x94dd('0x2'))(_0x94dd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94dd('0x4'));var fs=require('fs');var path=require(_0x94dd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x308798,_0x14204a){return _0x308798[_0x94dd('0x6')](_0x94dd('0x7'),attributes,{'tableName':'tools_conditions','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 e729da0..36ba6af 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 _0x9265=['../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x398592,_0x1eb56c){var _0x3caaf2=function(_0x5023ed){while(--_0x5023ed){_0x398592['push'](_0x398592['shift']());}};_0x3caaf2(++_0x1eb56c);}(_0x9265,0x13b));var _0x5926=function(_0x56985b,_0x678773){_0x56985b=_0x56985b-0x0;var _0x1748c4=_0x9265[_0x56985b];return _0x1748c4;};'use strict';var _=require(_0x5926('0x0'));var util=require(_0x5926('0x1'));var moment=require(_0x5926('0x2'));var BPromise=require(_0x5926('0x3'));var rs=require(_0x5926('0x4'));var fs=require('fs');var Redis=require(_0x5926('0x5'));var db=require(_0x5926('0x6'))['db'];var utils=require(_0x5926('0x7'));var logger=require(_0x5926('0x8'))(_0x5926('0x9'));var config=require(_0x5926('0xa'));var jayson=require(_0x5926('0xb'));var client=jayson[_0x5926('0xc')][_0x5926('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4a985f,_0x1937fa,_0x2419a3){return new BPromise(function(_0xc8975b,_0x1255e2){return client['request'](_0x4a985f,_0x2419a3)[_0x5926('0xe')](function(_0x22336d){logger[_0x5926('0xf')](_0x5926('0x10'),_0x1937fa,_0x5926('0x11'));logger[_0x5926('0x12')](_0x5926('0x13'),_0x1937fa,_0x5926('0x11'),JSON[_0x5926('0x14')](_0x22336d));if(_0x22336d[_0x5926('0x15')]){if(_0x22336d['error']['code']===0x1f4){logger[_0x5926('0x15')]('Condition,\x20%s,\x20%s',_0x1937fa,_0x22336d[_0x5926('0x15')][_0x5926('0x16')]);return _0x1255e2(_0x22336d[_0x5926('0x15')][_0x5926('0x16')]);}logger[_0x5926('0x15')](_0x5926('0x10'),_0x1937fa,_0x22336d[_0x5926('0x15')][_0x5926('0x16')]);return _0xc8975b(_0x22336d['error']['message']);}else{logger['info'](_0x5926('0x10'),_0x1937fa,'request\x20sent');_0xc8975b(_0x22336d[_0x5926('0x17')]['message']);}})[_0x5926('0x18')](function(_0x1d272d){logger['error'](_0x5926('0x10'),_0x1937fa,_0x1d272d);_0x1255e2(_0x1d272d);});});} \ No newline at end of file +var _0xa6f9=['client','http','request','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x55f5f1,_0x11660f){var _0x20f0ec=function(_0x597f54){while(--_0x597f54){_0x55f5f1['push'](_0x55f5f1['shift']());}};_0x20f0ec(++_0x11660f);}(_0xa6f9,0x1db));var _0x9a6f=function(_0x40fd2c,_0x321ac8){_0x40fd2c=_0x40fd2c-0x0;var _0x581c40=_0xa6f9[_0x40fd2c];return _0x581c40;};'use strict';var _=require(_0x9a6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9a6f('0x1'));var rs=require(_0x9a6f('0x2'));var fs=require('fs');var Redis=require(_0x9a6f('0x3'));var db=require(_0x9a6f('0x4'))['db'];var utils=require(_0x9a6f('0x5'));var logger=require(_0x9a6f('0x6'))(_0x9a6f('0x7'));var config=require(_0x9a6f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a6f('0x9')][_0x9a6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x445d86,_0x3f4ba3,_0x1300d5){return new BPromise(function(_0x37b009,_0x5e4bb4){return client[_0x9a6f('0xb')](_0x445d86,_0x1300d5)['then'](function(_0x4a34ae){logger[_0x9a6f('0xc')](_0x9a6f('0xd'),_0x3f4ba3,'request\x20sent');logger[_0x9a6f('0xe')](_0x9a6f('0xf'),_0x3f4ba3,_0x9a6f('0x10'),JSON['stringify'](_0x4a34ae));if(_0x4a34ae['error']){if(_0x4a34ae[_0x9a6f('0x11')][_0x9a6f('0x12')]===0x1f4){logger[_0x9a6f('0x11')](_0x9a6f('0xd'),_0x3f4ba3,_0x4a34ae['error']['message']);return _0x5e4bb4(_0x4a34ae[_0x9a6f('0x11')][_0x9a6f('0x13')]);}logger[_0x9a6f('0x11')](_0x9a6f('0xd'),_0x3f4ba3,_0x4a34ae[_0x9a6f('0x11')][_0x9a6f('0x13')]);return _0x37b009(_0x4a34ae['error'][_0x9a6f('0x13')]);}else{logger[_0x9a6f('0xc')](_0x9a6f('0xd'),_0x3f4ba3,_0x9a6f('0x10'));_0x37b009(_0x4a34ae[_0x9a6f('0x14')][_0x9a6f('0x13')]);}})[_0x9a6f('0x15')](function(_0x32d770){logger[_0x9a6f('0x11')](_0x9a6f('0xd'),_0x3f4ba3,_0x32d770);_0x5e4bb4(_0x32d770);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 43a41fc..91d8175 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 _0xbd9c=['Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','express'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xbd9c,0xf5));var _0xcbd9=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0xbd9c[_0x5f08a6];return _0x5d0641;};'use strict';var multer=require('multer');var util=require(_0xcbd9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbd9('0x1'));var router=express[_0xcbd9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcbd9('0x3'));var interaction=require(_0xcbd9('0x4'));var config=require('../../config/environment');var controller=require(_0xcbd9('0x5'));router[_0xcbd9('0x6')](_0xcbd9('0x7'),auth[_0xcbd9('0x8')](),controller[_0xcbd9('0x9')]);router[_0xcbd9('0xa')](_0xcbd9('0x7'),auth[_0xcbd9('0x8')](),controller[_0xcbd9('0xb')]);module[_0xcbd9('0xc')]=router; \ No newline at end of file +var _0xf2b9=['delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xf2b9,0xce));var _0x9f2b=function(_0x763108,_0x35539f){_0x763108=_0x763108-0x0;var _0x133a4e=_0xf2b9[_0x763108];return _0x133a4e;};'use strict';var multer=require(_0x9f2b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9f2b('0x1'));var router=express['Router']();var fs_extra=require(_0x9f2b('0x2'));var auth=require(_0x9f2b('0x3'));var interaction=require(_0x9f2b('0x4'));var config=require(_0x9f2b('0x5'));var controller=require('./condition.controller');router[_0x9f2b('0x6')](_0x9f2b('0x7'),auth[_0x9f2b('0x8')](),controller[_0x9f2b('0x9')]);router[_0x9f2b('0xa')](_0x9f2b('0x7'),auth[_0x9f2b('0x8')](),controller[_0x9f2b('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 95494e1..88dead1 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 _0x8b60=['STRING','name','INTEGER','sequelize','exports'];(function(_0x177735,_0x409055){var _0x1e6aff=function(_0x402138){while(--_0x402138){_0x177735['push'](_0x177735['shift']());}};_0x1e6aff(++_0x409055);}(_0x8b60,0x1d4));var _0x08b6=function(_0x508168,_0x40f494){_0x508168=_0x508168-0x0;var _0xfaac9a=_0x8b60[_0x508168];return _0xfaac9a;};'use strict';var Sequelize=require(_0x08b6('0x0'));module[_0x08b6('0x1')]={'name':{'type':Sequelize[_0x08b6('0x2')],'allowNull':![],'unique':_0x08b6('0x3')},'OrderBy':{'type':Sequelize[_0x08b6('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x08b6('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa80c=['exports','INTEGER','sequelize'];(function(_0x4a4d4e,_0x2f72a3){var _0x2417f4=function(_0x5527f1){while(--_0x5527f1){_0x4a4d4e['push'](_0x4a4d4e['shift']());}};_0x2417f4(++_0x2f72a3);}(_0xa80c,0xc2));var _0xca80=function(_0xf0cf28,_0x1a5fe2){_0xf0cf28=_0xf0cf28-0x0;var _0x2d367d=_0xa80c[_0xf0cf28];return _0x2d367d;};'use strict';var Sequelize=require(_0xca80('0x0'));module[_0xca80('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xca80('0x2')],'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 e4fc035..c12d8dd 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 _0x0abf=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','filter','map','type','VIRTUAL','merge','options','ContactItemType','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','destroy','CmContactHasItem','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils'];(function(_0x2cb718,_0x547aa2){var _0x3c7d8d=function(_0x25b329){while(--_0x25b329){_0x2cb718['push'](_0x2cb718['shift']());}};_0x3c7d8d(++_0x547aa2);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xf0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ab('0x1'));var jsonpatch=require(_0xf0ab('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0ab('0x3'));var Mustache=require('mustache');var util=require(_0xf0ab('0x4'));var path=require(_0xf0ab('0x5'));var sox=require(_0xf0ab('0x6'));var csv=require(_0xf0ab('0x7'));var ejs=require(_0xf0ab('0x8'));var fs=require('fs');var fs_extra=require(_0xf0ab('0x9'));var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x7'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var licenseUtil=require(_0xf0ab('0x15'));var db=require(_0xf0ab('0x16'))['db'];function respondWithStatusCode(_0x38ca67,_0x34ccdc){_0x34ccdc=_0x34ccdc||0xcc;return function(_0x4fdd5f){if(_0x4fdd5f){return _0x38ca67[_0xf0ab('0x17')](_0x34ccdc);}return _0x38ca67[_0xf0ab('0x18')](_0x34ccdc)[_0xf0ab('0x19')]();};}function respondWithResult(_0x35c75f,_0x1824ef){_0x1824ef=_0x1824ef||0xc8;return function(_0x36cabe){if(_0x36cabe){return _0x35c75f[_0xf0ab('0x18')](_0x1824ef)[_0xf0ab('0x1a')](_0x36cabe);}};}function respondWithFilteredResult(_0x180d0b,_0x3c5bfd){return function(_0x20f453){if(_0x20f453){var _0x221bac=typeof _0x3c5bfd[_0xf0ab('0x1b')]===_0xf0ab('0x1c')&&typeof _0x3c5bfd[_0xf0ab('0x1d')]==='undefined';var _0x457465=_0x20f453[_0xf0ab('0x1e')];var _0x1803f0=_0x221bac?0x0:_0x3c5bfd[_0xf0ab('0x1b')];var _0x776619=_0x221bac?_0x20f453[_0xf0ab('0x1e')]:_0x3c5bfd[_0xf0ab('0x1b')]+_0x3c5bfd[_0xf0ab('0x1d')];var _0x1713d6;if(_0x776619>=_0x457465){_0x776619=_0x457465;_0x1713d6=0xc8;}else{_0x1713d6=0xce;}_0x180d0b[_0xf0ab('0x18')](_0x1713d6);return _0x180d0b[_0xf0ab('0x1f')](_0xf0ab('0x20'),_0x1803f0+'-'+_0x776619+'/'+_0x457465)[_0xf0ab('0x1a')](_0x20f453);}return null;};}function patchUpdates(_0x22a205){return function(_0x2cd961){try{jsonpatch[_0xf0ab('0x21')](_0x2cd961,_0x22a205,!![]);}catch(_0x537673){return BPromise[_0xf0ab('0x22')](_0x537673);}return _0x2cd961[_0xf0ab('0x23')]();};}function saveUpdates(_0x1e1483,_0x11ab3a){return function(_0x3bf6a1){if(_0x3bf6a1){return _0x3bf6a1[_0xf0ab('0x24')](_0x1e1483)[_0xf0ab('0x25')](function(_0x20140b){return _0x20140b;});}return null;};}function removeEntity(_0x36ad01,_0x18bb37){return function(_0x43119f){if(_0x43119f){return _0x43119f['destroy']()['then'](function(){var _0x4eee21=_0x43119f[_0xf0ab('0x26')]({'plain':!![]});var _0x4f0caf=_0xf0ab('0x27');return db[_0xf0ab('0x28')]['destroy']({'where':{'type':_0x4f0caf,'resourceId':_0x4eee21['id']}})[_0xf0ab('0x25')](function(){return _0x43119f;});})[_0xf0ab('0x25')](function(){_0x36ad01[_0xf0ab('0x18')](0xcc)[_0xf0ab('0x19')]();});}};}function handleEntityNotFound(_0x7d4ff9,_0x502921){return function(_0x2d0da7){if(!_0x2d0da7){_0x7d4ff9['sendStatus'](0x194);}return _0x2d0da7;};}function handleError(_0x55d799,_0x1dcd2e){_0x1dcd2e=_0x1dcd2e||0x1f4;return function(_0x4306c6){logger[_0xf0ab('0x29')](_0x4306c6[_0xf0ab('0x2a')]);if(_0x4306c6[_0xf0ab('0x2b')]){delete _0x4306c6[_0xf0ab('0x2b')];}_0x55d799[_0xf0ab('0x18')](_0x1dcd2e)[_0xf0ab('0x2c')](_0x4306c6);};}exports[_0xf0ab('0x2d')]=function(_0x2f0fcd,_0x21e8ac){var _0x199753={},_0x58cbe1={},_0x1e1ffb={'count':0x0,'rows':[]};var _0x35973a=_['map'](db['ContactItemType'][_0xf0ab('0x2e')],function(_0x1dc84e){return{'name':_0x1dc84e[_0xf0ab('0x2f')],'type':_0x1dc84e['type']['key']};});_0x58cbe1[_0xf0ab('0x30')]=_['map'](_0x35973a,_0xf0ab('0x2b'));_0x58cbe1['query']=_[_0xf0ab('0x31')](_0x2f0fcd[_0xf0ab('0x32')]);_0x58cbe1['filters']=_['intersection'](_0x58cbe1[_0xf0ab('0x30')],_0x58cbe1[_0xf0ab('0x32')]);_0x199753[_0xf0ab('0x33')]=_[_0xf0ab('0x34')](_0x58cbe1[_0xf0ab('0x30')],qs[_0xf0ab('0x35')](_0x2f0fcd[_0xf0ab('0x32')][_0xf0ab('0x35')]));_0x199753[_0xf0ab('0x33')]=_0x199753[_0xf0ab('0x33')][_0xf0ab('0x36')]?_0x199753[_0xf0ab('0x33')]:_0x58cbe1[_0xf0ab('0x30')];if(!_0x2f0fcd[_0xf0ab('0x32')]['hasOwnProperty'](_0xf0ab('0x37'))){_0x199753[_0xf0ab('0x1d')]=qs[_0xf0ab('0x1d')](_0x2f0fcd['query'][_0xf0ab('0x1d')]);_0x199753[_0xf0ab('0x1b')]=qs[_0xf0ab('0x1b')](_0x2f0fcd['query'][_0xf0ab('0x1b')]);}_0x199753['order']=qs[_0xf0ab('0x38')](_0x2f0fcd['query'][_0xf0ab('0x38')]);_0x199753[_0xf0ab('0x39')]=qs[_0xf0ab('0x3a')](_[_0xf0ab('0x3b')](_0x2f0fcd[_0xf0ab('0x32')],_0x58cbe1[_0xf0ab('0x3a')]),_0x35973a);if(_0x2f0fcd['query'][_0xf0ab('0x3c')]){_0x199753[_0xf0ab('0x39')]=_['merge'](_0x199753[_0xf0ab('0x39')],{'$or':_[_0xf0ab('0x3d')](_0x35973a,function(_0x1d4eec){if(_0x1d4eec[_0xf0ab('0x3e')]!==_0xf0ab('0x3f')){var _0x11e3b7={};_0x11e3b7[_0x1d4eec[_0xf0ab('0x2b')]]={'$like':'%'+_0x2f0fcd['query'][_0xf0ab('0x3c')]+'%'};return _0x11e3b7;}})});}_0x199753=_[_0xf0ab('0x40')]({},_0x199753,_0x2f0fcd[_0xf0ab('0x41')]);var _0x4bd6d1={'where':_0x199753[_0xf0ab('0x39')]};return db[_0xf0ab('0x42')][_0xf0ab('0x1e')](_0x4bd6d1)[_0xf0ab('0x25')](function(_0x2b7ed5){_0x1e1ffb['count']=_0x2b7ed5;if(_0x2f0fcd[_0xf0ab('0x32')][_0xf0ab('0x43')]){_0x199753[_0xf0ab('0x44')]=[{'all':!![]}];}return db[_0xf0ab('0x42')][_0xf0ab('0x45')](_0x199753);})[_0xf0ab('0x25')](function(_0x45849c){_0x1e1ffb[_0xf0ab('0x46')]=_0x45849c;return _0x1e1ffb;})[_0xf0ab('0x25')](respondWithFilteredResult(_0x21e8ac,_0x199753))[_0xf0ab('0x47')](handleError(_0x21e8ac,null));};exports[_0xf0ab('0x48')]=function(_0x32ec93,_0x22a265){var _0x5e6b6b={'raw':!![],'where':{'id':_0x32ec93[_0xf0ab('0x49')]['id']}},_0x4c4ab9={};_0x4c4ab9['model']=_[_0xf0ab('0x31')](db[_0xf0ab('0x42')]['rawAttributes']);_0x4c4ab9[_0xf0ab('0x32')]=_[_0xf0ab('0x31')](_0x32ec93['query']);_0x4c4ab9[_0xf0ab('0x3a')]=_[_0xf0ab('0x34')](_0x4c4ab9[_0xf0ab('0x30')],_0x4c4ab9[_0xf0ab('0x32')]);_0x5e6b6b[_0xf0ab('0x33')]=_[_0xf0ab('0x34')](_0x4c4ab9[_0xf0ab('0x30')],qs[_0xf0ab('0x35')](_0x32ec93[_0xf0ab('0x32')][_0xf0ab('0x35')]));_0x5e6b6b[_0xf0ab('0x33')]=_0x5e6b6b[_0xf0ab('0x33')][_0xf0ab('0x36')]?_0x5e6b6b[_0xf0ab('0x33')]:_0x4c4ab9['model'];if(_0x32ec93['query'][_0xf0ab('0x43')]){_0x5e6b6b['include']=[{'all':!![]}];}_0x5e6b6b=_['merge']({},_0x5e6b6b,_0x32ec93['options']);return db[_0xf0ab('0x42')][_0xf0ab('0x4a')](_0x5e6b6b)[_0xf0ab('0x25')](handleEntityNotFound(_0x22a265,null))[_0xf0ab('0x25')](respondWithResult(_0x22a265,null))[_0xf0ab('0x47')](handleError(_0x22a265,null));};exports[_0xf0ab('0x4b')]=function(_0x472c1b,_0x1a0f21){return db[_0xf0ab('0x42')][_0xf0ab('0x4b')](_0x472c1b[_0xf0ab('0x4c')],{})[_0xf0ab('0x25')](function(_0x4e6c9b){var _0x393c9a=_0x472c1b[_0xf0ab('0x4d')][_0xf0ab('0x26')]({'plain':!![]});if(!_0x393c9a)throw new Error(_0xf0ab('0x4e'));if(_0x393c9a[_0xf0ab('0x4f')]===_0xf0ab('0x4d')){var _0x430921=_0x4e6c9b[_0xf0ab('0x26')]({'plain':!![]});var _0x47f564='ContactItemTypes';return db['UserProfileSection'][_0xf0ab('0x4a')]({'where':{'name':_0x47f564,'userProfileId':_0x393c9a[_0xf0ab('0x50')]},'raw':!![]})['then'](function(_0xa1a416){if(_0xa1a416&&_0xa1a416[_0xf0ab('0x51')]===0x0){return db['UserProfileResource'][_0xf0ab('0x4b')]({'name':_0x430921[_0xf0ab('0x2b')],'resourceId':_0x430921['id'],'type':_0xa1a416[_0xf0ab('0x2b')],'sectionId':_0xa1a416['id']},{})[_0xf0ab('0x25')](function(){return _0x4e6c9b;});}else{return _0x4e6c9b;}})[_0xf0ab('0x47')](function(_0x33112b){logger[_0xf0ab('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33112b);throw _0x33112b;});}return _0x4e6c9b;})[_0xf0ab('0x25')](respondWithResult(_0x1a0f21,0xc9))['catch'](handleError(_0x1a0f21,null));};exports[_0xf0ab('0x24')]=function(_0x4c9d2b,_0x1a402b){if(_0x4c9d2b['body']['id']){delete _0x4c9d2b['body']['id'];}return db[_0xf0ab('0x42')]['find']({'where':{'id':_0x4c9d2b[_0xf0ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a402b,null))[_0xf0ab('0x25')](saveUpdates(_0x4c9d2b['body'],null))[_0xf0ab('0x25')](respondWithResult(_0x1a402b,null))[_0xf0ab('0x47')](handleError(_0x1a402b,null));};exports[_0xf0ab('0x52')]=function(_0x57f9dd,_0x47f270){return db['ContactItemType'][_0xf0ab('0x4a')]({'where':{'id':_0x57f9dd[_0xf0ab('0x49')]['id']}})['then'](handleEntityNotFound(_0x47f270,null))['then'](db[_0xf0ab('0x53')][_0xf0ab('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x57f9dd[_0xf0ab('0x49')]['id']}}))[_0xf0ab('0x25')](removeEntity(_0x47f270,null))[_0xf0ab('0x47')](handleError(_0x47f270,null));}; \ No newline at end of file +var _0x4cf8=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','ContactItemType','include','findAll','catch','find','create','body','user','UserProfileSection','userProfileId','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4fb34f,_0x1a95cf){var _0x1d4726=function(_0x158f05){while(--_0x158f05){_0x4fb34f['push'](_0x4fb34f['shift']());}};_0x1d4726(++_0x1a95cf);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x4cf8[_0x2085f3];return _0x384e3c;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){var _0x1c7747=_0x4c9d1c[_0x84cf('0x27')]({'plain':!![]});var _0x1d220a=_0x84cf('0x28');return db[_0x84cf('0x29')][_0x84cf('0x26')]({'where':{'type':_0x1d220a,'resourceId':_0x1c7747['id']}})[_0x84cf('0x25')](function(){return _0x4c9d1c;});})[_0x84cf('0x25')](function(){_0x29e9e1['status'](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2a')](_0x29455e[_0x84cf('0x2b')]);if(_0x29455e[_0x84cf('0x2c')]){delete _0x29455e[_0x84cf('0x2c')];}_0x1595dd[_0x84cf('0x19')](_0x5a428c)[_0x84cf('0x2d')](_0x29455e);};}exports[_0x84cf('0x2e')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['ContactItemType'][_0x84cf('0x2f')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x30')],'type':_0x25de3a[_0x84cf('0x31')][_0x84cf('0x32')]};});_0x308f8f[_0x84cf('0x33')]=_[_0x84cf('0x34')](_0x44f16e,_0x84cf('0x2c'));_0x308f8f['query']=_[_0x84cf('0x35')](_0x1bfa56[_0x84cf('0x36')]);_0x308f8f['filters']=_[_0x84cf('0x37')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x36')]);_0x31dbf5[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x308f8f[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x1bfa56['query'][_0x84cf('0x39')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3a')]?_0x31dbf5[_0x84cf('0x38')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x3b')](_0x84cf('0x3c'))){_0x31dbf5[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x1bfa56[_0x84cf('0x36')]['limit']);_0x31dbf5[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x1c')]);}_0x31dbf5[_0x84cf('0x3e')]=qs[_0x84cf('0x3f')](_0x1bfa56['query'][_0x84cf('0x3f')]);_0x31dbf5['where']=qs[_0x84cf('0x40')](_[_0x84cf('0x41')](_0x1bfa56[_0x84cf('0x36')],_0x308f8f[_0x84cf('0x40')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x42')]){_0x31dbf5[_0x84cf('0x43')]=_[_0x84cf('0x44')](_0x31dbf5[_0x84cf('0x43')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x45')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x36')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x44')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x46')][_0x84cf('0x1e')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x1e')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x36')]['includeAll']){_0x31dbf5[_0x84cf('0x47')]=[{'all':!![]}];}return db['ContactItemType'][_0x84cf('0x48')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x25')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x49')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':!![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x33')]=_['keys'](db[_0x84cf('0x46')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x36')]);_0x191ad8[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x3fe8c1[_0x84cf('0x33')],qs['fields'](_0x2b737e[_0x84cf('0x36')]['fields']));_0x191ad8[_0x84cf('0x38')]=_0x191ad8[_0x84cf('0x38')][_0x84cf('0x3a')]?_0x191ad8[_0x84cf('0x38')]:_0x3fe8c1[_0x84cf('0x33')];if(_0x2b737e[_0x84cf('0x36')]['includeAll']){_0x191ad8[_0x84cf('0x47')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x44')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x46')][_0x84cf('0x4a')](_0x191ad8)[_0x84cf('0x25')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x46')][_0x84cf('0x4b')](_0x1cf3f6[_0x84cf('0x4c')],{})[_0x84cf('0x25')](function(_0x51d725){var _0x350985=_0x1cf3f6['user'][_0x84cf('0x27')]({'plain':!![]});if(!_0x350985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350985['role']===_0x84cf('0x4d')){var _0xb1c3a8=_0x51d725[_0x84cf('0x27')]({'plain':!![]});var _0x55e24e='ContactItemTypes';return db[_0x84cf('0x4e')][_0x84cf('0x4a')]({'where':{'name':_0x55e24e,'userProfileId':_0x350985[_0x84cf('0x4f')]},'raw':!![]})[_0x84cf('0x25')](function(_0x401ced){if(_0x401ced&&_0x401ced['autoAssociation']===0x0){return db[_0x84cf('0x29')][_0x84cf('0x4b')]({'name':_0xb1c3a8['name'],'resourceId':_0xb1c3a8['id'],'type':_0x401ced[_0x84cf('0x2c')],'sectionId':_0x401ced['id']},{})['then'](function(){return _0x51d725;});}else{return _0x51d725;}})['catch'](function(_0x147194){logger[_0x84cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x147194);throw _0x147194;});}return _0x51d725;})['then'](respondWithResult(_0x104421,0xc9))[_0x84cf('0x49')](handleError(_0x104421,null));};exports[_0x84cf('0x24')]=function(_0x2f739a,_0x1e2676){if(_0x2f739a[_0x84cf('0x4c')]['id']){delete _0x2f739a[_0x84cf('0x4c')]['id'];}return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x2f739a['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x1e2676,null))[_0x84cf('0x25')](saveUpdates(_0x2f739a['body'],null))['then'](respondWithResult(_0x1e2676,null))[_0x84cf('0x49')](handleError(_0x1e2676,null));};exports[_0x84cf('0x26')]=function(_0x3912cb,_0x2a4f20){return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x3912cb[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a4f20,null))[_0x84cf('0x25')](db['CmContactHasItem'][_0x84cf('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3912cb['params']['id']}}))[_0x84cf('0x25')](removeEntity(_0x2a4f20,null))[_0x84cf('0x49')](handleError(_0x2a4f20,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 6e2fa01..0816884 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 _0x4d16=['path','../../config/environment','./contactItemType.attributes','exports','define','tools_contact_item_types','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xbda95a,_0x57b159){var _0x4ec880=function(_0x489dd0){while(--_0x489dd0){_0xbda95a['push'](_0xbda95a['shift']());}};_0x4ec880(++_0x57b159);}(_0x4d16,0xb6));var _0x64d1=function(_0x31f0ac,_0x20f326){_0x31f0ac=_0x31f0ac-0x0;var _0x22168f=_0x4d16[_0x31f0ac];return _0x22168f;};'use strict';var _=require(_0x64d1('0x0'));var util=require('util');var logger=require(_0x64d1('0x1'))(_0x64d1('0x2'));var moment=require('moment');var BPromise=require(_0x64d1('0x3'));var rp=require(_0x64d1('0x4'));var fs=require('fs');var path=require(_0x64d1('0x5'));var rimraf=require('rimraf');var config=require(_0x64d1('0x6'));var attributes=require(_0x64d1('0x7'));module[_0x64d1('0x8')]=function(_0x471535,_0x49c168){return _0x471535[_0x64d1('0x9')]('ContactItemType',attributes,{'tableName':_0x64d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68f0=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types'];(function(_0x2d83ec,_0x528cce){var _0x12f1dc=function(_0x5c9924){while(--_0x5c9924){_0x2d83ec['push'](_0x2d83ec['shift']());}};_0x12f1dc(++_0x528cce);}(_0x68f0,0x197));var _0x068f=function(_0x577a2e,_0x3816f0){_0x577a2e=_0x577a2e-0x0;var _0x3ac138=_0x68f0[_0x577a2e];return _0x3ac138;};'use strict';var _=require(_0x068f('0x0'));var util=require(_0x068f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x068f('0x2'));var rp=require(_0x068f('0x3'));var fs=require('fs');var path=require(_0x068f('0x4'));var rimraf=require(_0x068f('0x5'));var config=require(_0x068f('0x6'));var attributes=require(_0x068f('0x7'));module[_0x068f('0x8')]=function(_0x52daf1,_0xe81465){return _0x52daf1['define'](_0x068f('0x9'),attributes,{'tableName':_0x068f('0xa'),'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 c79ed6e..0d3e95e 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 _0x4ec2=['debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x4ec2,0x196));var _0x24ec=function(_0x563f59,_0x2135bd){_0x563f59=_0x563f59-0x0;var _0x3ab255=_0x4ec2[_0x563f59];return _0x3ab255;};'use strict';var _=require('lodash');var util=require(_0x24ec('0x0'));var moment=require(_0x24ec('0x1'));var BPromise=require(_0x24ec('0x2'));var rs=require(_0x24ec('0x3'));var fs=require('fs');var Redis=require(_0x24ec('0x4'));var db=require(_0x24ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x24ec('0x6'))(_0x24ec('0x7'));var config=require(_0x24ec('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x24ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c45f1,_0x4473ed,_0x431919){return new BPromise(function(_0x4a74a1,_0xd0cc35){return client[_0x24ec('0xa')](_0x3c45f1,_0x431919)[_0x24ec('0xb')](function(_0x4fbf49){logger['info']('ContactItemType,\x20%s,\x20%s',_0x4473ed,'request\x20sent');logger[_0x24ec('0xc')](_0x24ec('0xd'),_0x4473ed,_0x24ec('0xe'),JSON[_0x24ec('0xf')](_0x4fbf49));if(_0x4fbf49[_0x24ec('0x10')]){if(_0x4fbf49[_0x24ec('0x10')][_0x24ec('0x11')]===0x1f4){logger[_0x24ec('0x10')](_0x24ec('0x12'),_0x4473ed,_0x4fbf49[_0x24ec('0x10')][_0x24ec('0x13')]);return _0xd0cc35(_0x4fbf49[_0x24ec('0x10')][_0x24ec('0x13')]);}logger[_0x24ec('0x10')](_0x24ec('0x12'),_0x4473ed,_0x4fbf49['error'][_0x24ec('0x13')]);return _0x4a74a1(_0x4fbf49[_0x24ec('0x10')][_0x24ec('0x13')]);}else{logger[_0x24ec('0x14')]('ContactItemType,\x20%s,\x20%s',_0x4473ed,_0x24ec('0xe'));_0x4a74a1(_0x4fbf49[_0x24ec('0x15')][_0x24ec('0x13')]);}})['catch'](function(_0xeccaa5){logger[_0x24ec('0x10')](_0x24ec('0x12'),_0x4473ed,_0xeccaa5);_0xd0cc35(_0xeccaa5);});});} \ No newline at end of file +var _0x784a=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','http','request','then','info'];(function(_0x4d72c9,_0x519e4a){var _0x4f5143=function(_0x21be84){while(--_0x21be84){_0x4d72c9['push'](_0x4d72c9['shift']());}};_0x4f5143(++_0x519e4a);}(_0x784a,0x130));var _0xa784=function(_0x4c7232,_0x4109aa){_0x4c7232=_0x4c7232-0x0;var _0x2175ca=_0x784a[_0x4c7232];return _0x2175ca;};'use strict';var _=require(_0xa784('0x0'));var util=require(_0xa784('0x1'));var moment=require(_0xa784('0x2'));var BPromise=require('bluebird');var rs=require(_0xa784('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa784('0x4'))['db'];var utils=require(_0xa784('0x5'));var logger=require('../../config/logger')(_0xa784('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa784('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36cdce,_0x39c6d0,_0x5e66c0){return new BPromise(function(_0x7a773,_0x2ed29f){return client[_0xa784('0x8')](_0x36cdce,_0x5e66c0)[_0xa784('0x9')](function(_0xf850d){logger[_0xa784('0xa')](_0xa784('0xb'),_0x39c6d0,_0xa784('0xc'));logger[_0xa784('0xd')](_0xa784('0xe'),_0x39c6d0,_0xa784('0xc'),JSON[_0xa784('0xf')](_0xf850d));if(_0xf850d[_0xa784('0x10')]){if(_0xf850d[_0xa784('0x10')][_0xa784('0x11')]===0x1f4){logger[_0xa784('0x10')](_0xa784('0xb'),_0x39c6d0,_0xf850d['error'][_0xa784('0x12')]);return _0x2ed29f(_0xf850d[_0xa784('0x10')][_0xa784('0x12')]);}logger[_0xa784('0x10')]('ContactItemType,\x20%s,\x20%s',_0x39c6d0,_0xf850d['error'][_0xa784('0x12')]);return _0x7a773(_0xf850d[_0xa784('0x10')]['message']);}else{logger[_0xa784('0xa')]('ContactItemType,\x20%s,\x20%s',_0x39c6d0,_0xa784('0xc'));_0x7a773(_0xf850d[_0xa784('0x13')][_0xa784('0x12')]);}})[_0xa784('0x14')](function(_0x4dac88){logger[_0xa784('0x10')](_0xa784('0xb'),_0x39c6d0,_0x4dac88);_0x2ed29f(_0x4dac88);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index af67e27..27c5ed7 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 _0x503c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x37c464,_0x335a10){var _0xc1c63b=function(_0x40816f){while(--_0x40816f){_0x37c464['push'](_0x37c464['shift']());}};_0xc1c63b(++_0x335a10);}(_0x503c,0x146));var _0xc503=function(_0x3c6166,_0x51a9fe){_0x3c6166=_0x3c6166-0x0;var _0x215b27=_0x503c[_0x3c6166];return _0x215b27;};'use strict';var multer=require('multer');var util=require(_0xc503('0x0'));var path=require('path');var timeout=require(_0xc503('0x1'));var express=require(_0xc503('0x2'));var router=express[_0xc503('0x3')]();var fs_extra=require(_0xc503('0x4'));var auth=require(_0xc503('0x5'));var interaction=require(_0xc503('0x6'));var config=require(_0xc503('0x7'));var controller=require('./contactItemType.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc503('0x8')]);router['get'](_0xc503('0x9'),auth[_0xc503('0xa')](),controller[_0xc503('0xb')]);router[_0xc503('0xc')]('/',auth[_0xc503('0xa')](),controller[_0xc503('0xd')]);router[_0xc503('0xe')](_0xc503('0x9'),auth[_0xc503('0xa')](),controller['update']);router[_0xc503('0xf')]('/:id',auth[_0xc503('0xa')](),controller[_0xc503('0x10')]);module[_0xc503('0x11')]=router; \ No newline at end of file +var _0xbed3=['show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x21b771,_0x4bbdaa){var _0x485e47=function(_0x4a1149){while(--_0x4a1149){_0x21b771['push'](_0x21b771['shift']());}};_0x485e47(++_0x4bbdaa);}(_0xbed3,0x1a4));var _0x3bed=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xbed3[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x3bed('0x0'));var util=require(_0x3bed('0x1'));var path=require(_0x3bed('0x2'));var timeout=require(_0x3bed('0x3'));var express=require(_0x3bed('0x4'));var router=express[_0x3bed('0x5')]();var fs_extra=require(_0x3bed('0x6'));var auth=require(_0x3bed('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3bed('0x8'));var controller=require('./contactItemType.controller');router[_0x3bed('0x9')]('/',auth[_0x3bed('0xa')](),controller['index']);router[_0x3bed('0x9')](_0x3bed('0xb'),auth[_0x3bed('0xa')](),controller[_0x3bed('0xc')]);router['post']('/',auth[_0x3bed('0xa')](),controller[_0x3bed('0xd')]);router[_0x3bed('0xe')](_0x3bed('0xb'),auth[_0x3bed('0xa')](),controller[_0x3bed('0xf')]);router['delete'](_0x3bed('0xb'),auth[_0x3bed('0xa')](),controller[_0x3bed('0x10')]);module[_0x3bed('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 486ac22..4d27891 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x421c06,_0x3a6275){var _0x5098ea=function(_0x1e7ac5){while(--_0x1e7ac5){_0x421c06['push'](_0x421c06['shift']());}};_0x5098ea(++_0x3a6275);}(_0x2032,0xd9));var _0x2203=function(_0x1ce46f,_0x187eb3){_0x1ce46f=_0x1ce46f-0x0;var _0x57c1eb=_0x2032[_0x1ce46f];return _0x57c1eb;};'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 _0xbaf0=['name','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index adb4c26..5d8d48b 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 _0x7713=['set','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','clone','params','createdAt','updatedAt','body','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0x28fde4,_0x4fbc40){var _0xdc3f1b=function(_0x58f4be){while(--_0x58f4be){_0x28fde4['push'](_0x28fde4['shift']());}};_0xdc3f1b(++_0x4fbc40);}(_0x7713,0x157));var _0x3771=function(_0x1107d8,_0x114c00){_0x1107d8=_0x1107d8-0x0;var _0x38984b=_0x7713[_0x1107d8];return _0x38984b;};'use strict';var emlformat=require(_0x3771('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3771('0x1'));var rp=require(_0x3771('0x2'));var moment=require(_0x3771('0x3'));var BPromise=require(_0x3771('0x4'));var Mustache=require(_0x3771('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3771('0x6'));var csv=require(_0x3771('0x7'));var ejs=require(_0x3771('0x8'));var fs=require('fs');var fs_extra=require(_0x3771('0x9'));var _=require(_0x3771('0xa'));var squel=require(_0x3771('0xb'));var crypto=require('crypto');var jsforce=require(_0x3771('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3771('0xd'));var Papa=require(_0x3771('0xe'));var Redis=require('ioredis');var authService=require(_0x3771('0xf'));var qs=require(_0x3771('0x10'));var as=require(_0x3771('0x11'));var hardwareService=require(_0x3771('0x12'));var logger=require('../../config/logger')(_0x3771('0x13'));var utils=require('../../config/utils');var config=require(_0x3771('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3771('0x15'))['db'];config[_0x3771('0x16')]=_[_0x3771('0x17')](config['redis'],{'host':_0x3771('0x18'),'port':0x18eb});var socket=require(_0x3771('0x19'))(new Redis(config[_0x3771('0x16')]));require('./dashboard.socket')[_0x3771('0x1a')](socket);function respondWithStatusCode(_0x2c6bd3,_0x551058){_0x551058=_0x551058||0xcc;return function(_0x114ac2){if(_0x114ac2){return _0x2c6bd3[_0x3771('0x1b')](_0x551058);}return _0x2c6bd3[_0x3771('0x1c')](_0x551058)[_0x3771('0x1d')]();};}function respondWithResult(_0x449feb,_0x19b8f1){_0x19b8f1=_0x19b8f1||0xc8;return function(_0x3e6333){if(_0x3e6333){return _0x449feb[_0x3771('0x1c')](_0x19b8f1)[_0x3771('0x1e')](_0x3e6333);}};}function respondWithFilteredResult(_0x197b9b,_0x18cebc){return function(_0x4986cc){if(_0x4986cc){var _0x3c7688=typeof _0x18cebc[_0x3771('0x1f')]==='undefined'&&typeof _0x18cebc[_0x3771('0x20')]===_0x3771('0x21');var _0x2c4297=_0x4986cc['count'];var _0x3556d5=_0x3c7688?0x0:_0x18cebc['offset'];var _0x3d6dbb=_0x3c7688?_0x4986cc[_0x3771('0x22')]:_0x18cebc[_0x3771('0x1f')]+_0x18cebc[_0x3771('0x20')];var _0x37f7c1;if(_0x3d6dbb>=_0x2c4297){_0x3d6dbb=_0x2c4297;_0x37f7c1=0xc8;}else{_0x37f7c1=0xce;}_0x197b9b[_0x3771('0x1c')](_0x37f7c1);return _0x197b9b[_0x3771('0x23')](_0x3771('0x24'),_0x3556d5+'-'+_0x3d6dbb+'/'+_0x2c4297)[_0x3771('0x1e')](_0x4986cc);}return null;};}function patchUpdates(_0x1fdd92){return function(_0x57ad21){try{jsonpatch[_0x3771('0x25')](_0x57ad21,_0x1fdd92,!![]);}catch(_0x31b220){return BPromise['reject'](_0x31b220);}return _0x57ad21[_0x3771('0x26')]();};}function saveUpdates(_0x433eff,_0x8e62de){return function(_0x6a0605){if(_0x6a0605){return _0x6a0605[_0x3771('0x27')](_0x433eff)[_0x3771('0x28')](function(_0x90a419){return _0x90a419;});}return null;};}function removeEntity(_0x41a50f,_0x26d64f){return function(_0x2b8823){if(_0x2b8823){return _0x2b8823[_0x3771('0x29')]()[_0x3771('0x28')](function(){var _0x3c04a9=_0x2b8823[_0x3771('0x2a')]({'plain':!![]});var _0x1bae79=_0x3771('0x2b');return db[_0x3771('0x2c')][_0x3771('0x29')]({'where':{'type':_0x1bae79,'resourceId':_0x3c04a9['id']}})['then'](function(){return _0x2b8823;});})[_0x3771('0x28')](function(){_0x41a50f['status'](0xcc)[_0x3771('0x1d')]();});}};}function handleEntityNotFound(_0x320330,_0x5813bd){return function(_0x52761e){if(!_0x52761e){_0x320330[_0x3771('0x1b')](0x194);}return _0x52761e;};}function handleError(_0x4077c1,_0x1b36b8){_0x1b36b8=_0x1b36b8||0x1f4;return function(_0x5bfee6){logger[_0x3771('0x2d')](_0x5bfee6[_0x3771('0x2e')]);if(_0x5bfee6['name']){delete _0x5bfee6[_0x3771('0x2f')];}_0x4077c1[_0x3771('0x1c')](_0x1b36b8)[_0x3771('0x30')](_0x5bfee6);};}exports[_0x3771('0x31')]=function(_0x11e399,_0x42b534){var _0x518ed={},_0xc01d3c={},_0x4a80e4={'count':0x0,'rows':[]};var _0x42ec8b=_['map'](db[_0x3771('0x32')][_0x3771('0x33')],function(_0x3bb7e3){return{'name':_0x3bb7e3['fieldName'],'type':_0x3bb7e3['type'][_0x3771('0x34')]};});_0xc01d3c[_0x3771('0x35')]=_[_0x3771('0x36')](_0x42ec8b,_0x3771('0x2f'));_0xc01d3c['query']=_[_0x3771('0x37')](_0x11e399[_0x3771('0x38')]);_0xc01d3c[_0x3771('0x39')]=_[_0x3771('0x3a')](_0xc01d3c[_0x3771('0x35')],_0xc01d3c[_0x3771('0x38')]);_0x518ed[_0x3771('0x3b')]=_[_0x3771('0x3a')](_0xc01d3c[_0x3771('0x35')],qs['fields'](_0x11e399[_0x3771('0x38')][_0x3771('0x3c')]));_0x518ed['attributes']=_0x518ed[_0x3771('0x3b')][_0x3771('0x3d')]?_0x518ed[_0x3771('0x3b')]:_0xc01d3c[_0x3771('0x35')];if(!_0x11e399[_0x3771('0x38')][_0x3771('0x3e')](_0x3771('0x3f'))){_0x518ed[_0x3771('0x20')]=qs['limit'](_0x11e399[_0x3771('0x38')][_0x3771('0x20')]);_0x518ed[_0x3771('0x1f')]=qs[_0x3771('0x1f')](_0x11e399['query']['offset']);}_0x518ed[_0x3771('0x40')]=qs[_0x3771('0x41')](_0x11e399[_0x3771('0x38')][_0x3771('0x41')]);_0x518ed[_0x3771('0x42')]=qs['filters'](_[_0x3771('0x43')](_0x11e399[_0x3771('0x38')],_0xc01d3c['filters']),_0x42ec8b);if(_0x11e399[_0x3771('0x38')][_0x3771('0x44')]){_0x518ed[_0x3771('0x42')]=_[_0x3771('0x45')](_0x518ed[_0x3771('0x42')],{'$or':_[_0x3771('0x36')](_0x42ec8b,function(_0x48ba73){if(_0x48ba73[_0x3771('0x46')]!==_0x3771('0x47')){var _0x16ed9d={};_0x16ed9d[_0x48ba73['name']]={'$like':'%'+_0x11e399[_0x3771('0x38')][_0x3771('0x44')]+'%'};return _0x16ed9d;}})});}_0x518ed=_[_0x3771('0x45')]({},_0x518ed,_0x11e399['options']);var _0x74be6f={'where':_0x518ed['where']};return db[_0x3771('0x32')][_0x3771('0x22')](_0x74be6f)[_0x3771('0x28')](function(_0x3589f1){_0x4a80e4[_0x3771('0x22')]=_0x3589f1;if(_0x11e399['query'][_0x3771('0x48')]){_0x518ed[_0x3771('0x49')]=[{'all':!![]}];}return db[_0x3771('0x32')][_0x3771('0x4a')](_0x518ed);})[_0x3771('0x28')](function(_0x1456a6){_0x4a80e4['rows']=_0x1456a6;return _0x4a80e4;})[_0x3771('0x28')](respondWithFilteredResult(_0x42b534,_0x518ed))[_0x3771('0x4b')](handleError(_0x42b534,null));};exports['show']=function(_0x24c35f,_0x16b966){var _0x13b4dc={'raw':![],'where':{'id':_0x24c35f['params']['id']}},_0x19e58e={};_0x19e58e['model']=_[_0x3771('0x37')](db[_0x3771('0x32')][_0x3771('0x33')]);_0x19e58e[_0x3771('0x38')]=_[_0x3771('0x37')](_0x24c35f[_0x3771('0x38')]);_0x19e58e[_0x3771('0x39')]=_[_0x3771('0x3a')](_0x19e58e[_0x3771('0x35')],_0x19e58e[_0x3771('0x38')]);_0x13b4dc[_0x3771('0x3b')]=_['intersection'](_0x19e58e[_0x3771('0x35')],qs[_0x3771('0x3c')](_0x24c35f[_0x3771('0x38')][_0x3771('0x3c')]));_0x13b4dc[_0x3771('0x3b')]=_0x13b4dc[_0x3771('0x3b')]['length']?_0x13b4dc[_0x3771('0x3b')]:_0x19e58e[_0x3771('0x35')];if(_0x24c35f[_0x3771('0x38')][_0x3771('0x48')]){_0x13b4dc['include']=[{'all':!![]}];}_0x13b4dc=_[_0x3771('0x45')]({},_0x13b4dc,_0x24c35f[_0x3771('0x4c')]);return db[_0x3771('0x32')]['find'](_0x13b4dc)['then'](handleEntityNotFound(_0x16b966,null))[_0x3771('0x28')](respondWithResult(_0x16b966,null))[_0x3771('0x4b')](handleError(_0x16b966,null));};exports[_0x3771('0x4d')]=function(_0x3ba5be,_0x186698){return db[_0x3771('0x32')][_0x3771('0x4d')](_0x3ba5be['body'],{})['then'](function(_0xb6219a){var _0x207532=_0x3ba5be[_0x3771('0x4e')]['get']({'plain':!![]});if(!_0x207532)throw new Error(_0x3771('0x4f'));if(_0x207532[_0x3771('0x50')]===_0x3771('0x4e')){var _0x4f71ac=_0xb6219a[_0x3771('0x2a')]({'plain':!![]});var _0x29a44c=_0x3771('0x2b');return db[_0x3771('0x51')][_0x3771('0x52')]({'where':{'name':_0x29a44c,'userProfileId':_0x207532[_0x3771('0x53')]},'raw':!![]})[_0x3771('0x28')](function(_0x26fe6c){if(_0x26fe6c&&_0x26fe6c['autoAssociation']===0x0){return db[_0x3771('0x2c')][_0x3771('0x4d')]({'name':_0x4f71ac[_0x3771('0x2f')],'resourceId':_0x4f71ac['id'],'type':_0x26fe6c[_0x3771('0x2f')],'sectionId':_0x26fe6c['id']},{})[_0x3771('0x28')](function(){return _0xb6219a;});}else{return _0xb6219a;}})[_0x3771('0x4b')](function(_0x120274){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x120274);throw _0x120274;});}return _0xb6219a;})[_0x3771('0x28')](respondWithResult(_0x186698,0xc9))[_0x3771('0x4b')](handleError(_0x186698,null));};exports[_0x3771('0x54')]=function(_0x2d251f,_0x3ae944){var _0x5a954a={'where':{'id':_0x2d251f[_0x3771('0x55')]['id']}},_0x460486={};_0x460486[_0x3771('0x35')]=_[_0x3771('0x37')](db[_0x3771('0x32')][_0x3771('0x33')]);_0x5a954a[_0x3771('0x3b')]=_[_0x3771('0x3a')](_0x460486[_0x3771('0x35')],qs['fields'](_0x2d251f['query'][_0x3771('0x3c')]));_0x5a954a['attributes']=_0x5a954a[_0x3771('0x3b')][_0x3771('0x3d')]?_0x5a954a[_0x3771('0x3b')]:_0x460486[_0x3771('0x35')];if(_0x2d251f[_0x3771('0x38')][_0x3771('0x48')]){_0x5a954a['include']=[{'all':!![]}];}_0x5a954a=_[_0x3771('0x45')]({},_0x5a954a,_0x2d251f[_0x3771('0x4c')]);return db[_0x3771('0x32')][_0x3771('0x52')](_0x5a954a)[_0x3771('0x28')](handleEntityNotFound(_0x3ae944,null))[_0x3771('0x28')](function(_0x336a8b){if(_0x336a8b){var _0xfa79a=_0x336a8b[_0x3771('0x2a')]({'plain':!![]});_0xfa79a=qs['omit'](_0xfa79a,['id',_0x3771('0x56'),_0x3771('0x57')]);_0x2d251f[_0x3771('0x58')]=_['omit'](_0x2d251f[_0x3771('0x58')],['id','createdAt',_0x3771('0x57')]);return db[_0x3771('0x32')][_0x3771('0x4d')](_[_0x3771('0x45')](_0xfa79a,_0x2d251f[_0x3771('0x58')]),{'include':_0x2d251f[_0x3771('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x3771('0x28')](function(_0x41f17b){var _0x3135=_0x2d251f[_0x3771('0x4e')][_0x3771('0x2a')]({'plain':!![]});if(!_0x3135)throw new Error(_0x3771('0x4f'));if(_0x3135['role']===_0x3771('0x4e')){var _0x4f7030=_0x41f17b[_0x3771('0x2a')]({'plain':!![]});var _0xc2a2b2=_0x3771('0x2b');return db[_0x3771('0x51')]['find']({'where':{'name':_0xc2a2b2,'userProfileId':_0x3135['userProfileId']},'raw':!![]})['then'](function(_0x2c1f61){if(_0x2c1f61&&_0x2c1f61[_0x3771('0x59')]===0x0){return db[_0x3771('0x2c')][_0x3771('0x4d')]({'name':_0x4f7030['name'],'resourceId':_0x4f7030['id'],'type':_0x2c1f61['name'],'sectionId':_0x2c1f61['id']},{})['then'](function(){return _0x41f17b;});}else{return _0x41f17b;}})[_0x3771('0x4b')](function(_0x41c943){logger[_0x3771('0x2d')](_0x3771('0x5a'),_0x41c943);throw _0x41c943;});}return _0x41f17b;});}})['then'](respondWithResult(_0x3ae944,0xc9))[_0x3771('0x4b')](handleError(_0x3ae944,null));};exports[_0x3771('0x27')]=function(_0x100507,_0x2cddf8){if(_0x100507[_0x3771('0x58')]['id']){delete _0x100507[_0x3771('0x58')]['id'];}return db[_0x3771('0x32')]['find']({'where':{'id':_0x100507[_0x3771('0x55')]['id']}})[_0x3771('0x28')](handleEntityNotFound(_0x2cddf8,null))[_0x3771('0x28')](saveUpdates(_0x100507['body'],null))[_0x3771('0x28')](respondWithResult(_0x2cddf8,null))[_0x3771('0x4b')](handleError(_0x2cddf8,null));};exports[_0x3771('0x29')]=function(_0x335435,_0x276300){return db['Dashboard']['find']({'where':{'id':_0x335435[_0x3771('0x55')]['id']}})['then'](handleEntityNotFound(_0x276300,null))[_0x3771('0x28')](removeEntity(_0x276300,null))[_0x3771('0x4b')](handleError(_0x276300,null));};function widgetAttributes(_0x838fc2){try{switch(_0x838fc2[_0x3771('0x46')]){case'iframe':return[{'name':_0x3771('0x5b'),'value':_0x838fc2['attrUrl']||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0][_0x3771('0x5d')]:undefined)||_0x3771('0x5e')}];case _0x3771('0x5f'):return[{'name':_0x3771('0x60'),'value':_0x838fc2[_0x3771('0x60')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0][_0x3771('0x5d')]:undefined)||''}];case _0x3771('0x61'):return[{'name':_0x3771('0x62'),'value':_0x838fc2[_0x3771('0x62')]||(_0x838fc2['attrs']&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0][_0x3771('0x5d')]:undefined)||_0x3771('0x63')},{'name':_0x3771('0x64'),'value':_0x838fc2[_0x3771('0x64')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x1]?_0x838fc2[_0x3771('0x5c')][0x1][_0x3771('0x5d')]:undefined)||'0.00'},{'name':_0x3771('0x65'),'value':_0x838fc2[_0x3771('0x65')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x2]?_0x838fc2['attrs'][0x2]['value']:undefined)||0xc}];case _0x3771('0x66'):return[{'name':_0x3771('0x67'),'value':_0x838fc2[_0x3771('0x67')]||(_0x838fc2['attrs']&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0][_0x3771('0x5d')]:undefined)||_0x3771('0x68')},{'name':_0x3771('0x69'),'value':_0x838fc2[_0x3771('0x69')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x1]?_0x838fc2[_0x3771('0x5c')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x838fc2[_0x3771('0x65')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x2]?_0x838fc2[_0x3771('0x5c')][0x2][_0x3771('0x5d')]:undefined)||0x14},{'name':_0x3771('0x6a'),'value':_0x838fc2[_0x3771('0x6a')]||(_0x838fc2['attrs']&&_0x838fc2['attrs'][0x3]?_0x838fc2[_0x3771('0x5c')][0x3][_0x3771('0x5d')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x838fc2[_0x3771('0x6b')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2['attrs'][0x4]?_0x838fc2[_0x3771('0x5c')][0x4]['value']:undefined)||''},{'name':_0x3771('0x6c'),'value':_0x838fc2[_0x3771('0x6c')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x5]?_0x838fc2[_0x3771('0x5c')][0x5]['value']:undefined)||''},{'name':_0x3771('0x6d'),'value':_0x838fc2['attrSmsAccounts']||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x6]?_0x838fc2['attrs'][0x6][_0x3771('0x5d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x838fc2[_0x3771('0x6e')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x7]?_0x838fc2[_0x3771('0x5c')][0x7][_0x3771('0x5d')]:undefined)||''},{'name':_0x3771('0x6f'),'value':_0x838fc2[_0x3771('0x6f')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x8]?_0x838fc2[_0x3771('0x5c')][0x8][_0x3771('0x5d')]:undefined)||''},{'name':_0x3771('0x70'),'value':_0x838fc2[_0x3771('0x70')]||(_0x838fc2['attrs']&&_0x838fc2[_0x3771('0x5c')][0x9]?_0x838fc2[_0x3771('0x5c')][0x9]['value']:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x3771('0x71'),'value':_0x838fc2[_0x3771('0x71')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0]['value']:undefined)||'total'},{'name':_0x3771('0x72'),'value':_0x838fc2['attrSerie2']||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2['attrs'][0x1]?_0x838fc2[_0x3771('0x5c')][0x1][_0x3771('0x5d')]:undefined)||null},{'name':_0x3771('0x73'),'value':_0x838fc2[_0x3771('0x73')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x2]?_0x838fc2[_0x3771('0x5c')][0x2][_0x3771('0x5d')]:undefined)||null},{'name':_0x3771('0x69'),'value':_0x838fc2[_0x3771('0x69')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x3]?_0x838fc2[_0x3771('0x5c')][0x3][_0x3771('0x5d')]:undefined)||[]},{'name':_0x3771('0x6a'),'value':_0x838fc2[_0x3771('0x6a')]||(_0x838fc2['attrs']&&_0x838fc2['attrs'][0x4]?_0x838fc2[_0x3771('0x5c')][0x4]['value']:undefined)||'voice'},{'name':_0x3771('0x6b'),'value':_0x838fc2['attrEmailAccounts']||(_0x838fc2['attrs']&&_0x838fc2[_0x3771('0x5c')][0x5]?_0x838fc2[_0x3771('0x5c')][0x5][_0x3771('0x5d')]:undefined)||''},{'name':_0x3771('0x6c'),'value':_0x838fc2[_0x3771('0x6c')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2['attrs'][0x6]?_0x838fc2[_0x3771('0x5c')][0x6][_0x3771('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x838fc2[_0x3771('0x6d')]||(_0x838fc2['attrs']&&_0x838fc2['attrs'][0x7]?_0x838fc2[_0x3771('0x5c')][0x7]['value']:undefined)||''},{'name':_0x3771('0x6e'),'value':_0x838fc2[_0x3771('0x6e')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x8]?_0x838fc2['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x838fc2[_0x3771('0x6f')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x9]?_0x838fc2[_0x3771('0x5c')][0x9][_0x3771('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x838fc2['attrChatWebsites']||(_0x838fc2['attrs']&&_0x838fc2['attrs'][0xa]?_0x838fc2[_0x3771('0x5c')][0xa]['value']:undefined)||''}];case _0x3771('0x74'):return[{'name':_0x3771('0x75'),'type':_0x838fc2[_0x3771('0x76')]||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x0]?_0x838fc2[_0x3771('0x5c')][0x0][_0x3771('0x46')]:undefined)||null,'value':_0x838fc2['attrReport']||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2['attrs'][0x0]?_0x838fc2[_0x3771('0x5c')][0x0]['value']:undefined)||null},{'name':_0x3771('0x77'),'value':_0x838fc2['attrRefresh']||(_0x838fc2[_0x3771('0x5c')]&&_0x838fc2[_0x3771('0x5c')][0x1]?_0x838fc2[_0x3771('0x5c')][0x1][_0x3771('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1fd4eb){logger['error'](_0x3771('0x78'),JSON[_0x3771('0x79')](_0x1fd4eb));return[];}}exports[_0x3771('0x7a')]=function(_0x2b12e8,_0x2a9f9b,_0x4faed9){if(_0x2b12e8[_0x3771('0x58')]['id']){delete _0x2b12e8[_0x3771('0x58')]['id'];}return db['Dashboard'][_0x3771('0x52')]({'where':{'id':_0x2b12e8['params']['id']}})[_0x3771('0x28')](handleEntityNotFound(_0x2a9f9b,null))[_0x3771('0x28')](function(_0xc515fb){if(_0xc515fb){_0x2b12e8['body']['DashboardId']=_0xc515fb['id'];_0x2b12e8[_0x3771('0x58')]['attrs']=widgetAttributes(_0x2b12e8[_0x3771('0x58')]);return db[_0x3771('0x7b')][_0x3771('0x4d')](_0x2b12e8['body']);}})[_0x3771('0x28')](respondWithResult(_0x2a9f9b,null))[_0x3771('0x4b')](handleError(_0x2a9f9b,null));};exports[_0x3771('0x7c')]=function(_0x1735a2,_0x4d63f2,_0x492bd0){var _0x2d5280={};var _0x1c7b6d={};var _0x9ed6fe;var _0x2f1d50;return db[_0x3771('0x32')][_0x3771('0x7d')]({'where':{'id':_0x1735a2[_0x3771('0x55')]['id']}})[_0x3771('0x28')](handleEntityNotFound(_0x4d63f2,null))[_0x3771('0x28')](function(_0x484358){if(_0x484358){_0x9ed6fe=_0x484358;_0x1c7b6d[_0x3771('0x35')]=_[_0x3771('0x37')](db[_0x3771('0x7b')][_0x3771('0x33')]);_0x1c7b6d['query']=_[_0x3771('0x37')](_0x1735a2[_0x3771('0x38')]);_0x1c7b6d[_0x3771('0x39')]=_[_0x3771('0x3a')](_0x1c7b6d['model'],_0x1c7b6d['query']);_0x2d5280[_0x3771('0x3b')]=_['intersection'](_0x1c7b6d[_0x3771('0x35')],qs['fields'](_0x1735a2[_0x3771('0x38')][_0x3771('0x3c')]));_0x2d5280[_0x3771('0x3b')]=_0x2d5280[_0x3771('0x3b')][_0x3771('0x3d')]?_0x2d5280[_0x3771('0x3b')]:_0x1c7b6d[_0x3771('0x35')];_0x2d5280[_0x3771('0x40')]=qs[_0x3771('0x41')](_0x1735a2['query'][_0x3771('0x41')]);_0x2d5280[_0x3771('0x42')]=qs[_0x3771('0x39')](_[_0x3771('0x43')](_0x1735a2[_0x3771('0x38')],_0x1c7b6d[_0x3771('0x39')]));if(_0x1735a2[_0x3771('0x38')]['filter']){_0x2d5280[_0x3771('0x42')]=_['merge'](_0x2d5280['where'],{'$or':_[_0x3771('0x36')](_0x2d5280[_0x3771('0x3b')],function(_0x1d863c){var _0x4a7f4d={};_0x4a7f4d[_0x1d863c]={'$like':'%'+_0x1735a2[_0x3771('0x38')]['filter']+'%'};return _0x4a7f4d;})});}_0x2d5280=_[_0x3771('0x45')]({},_0x2d5280,_0x1735a2[_0x3771('0x4c')]);return _0x9ed6fe[_0x3771('0x7c')](_0x2d5280);}})[_0x3771('0x28')](function(_0x5f1b8b){if(_0x5f1b8b){_0x2f1d50=_0x5f1b8b['length'];if(!_0x1735a2[_0x3771('0x38')]['hasOwnProperty'](_0x3771('0x3f'))){_0x2d5280[_0x3771('0x20')]=qs[_0x3771('0x20')](_0x1735a2[_0x3771('0x38')][_0x3771('0x20')]);_0x2d5280[_0x3771('0x1f')]=qs[_0x3771('0x1f')](_0x1735a2[_0x3771('0x38')]['offset']);}return _0x9ed6fe[_0x3771('0x7c')](_0x2d5280);}})['then'](function(_0x245103){if(_0x245103){return _0x245103?{'count':_0x2f1d50,'rows':_0x245103}:null;}})['then'](respondWithResult(_0x4d63f2,null))['catch'](handleError(_0x4d63f2,null));}; \ No newline at end of file +var _0x3842=['findOne','pick','getItems','hasOwnProperty','nolimit','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','find','catch','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','attrs','value','https://','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3842,0x101));var _0x2384=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3842[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2384('0x0'));var jsonpatch=require(_0x2384('0x1'));var rp=require(_0x2384('0x2'));var moment=require(_0x2384('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2384('0x4'));var util=require(_0x2384('0x5'));var path=require(_0x2384('0x6'));var sox=require(_0x2384('0x7'));var csv=require(_0x2384('0x8'));var ejs=require(_0x2384('0x9'));var fs=require('fs');var fs_extra=require(_0x2384('0xa'));var _=require(_0x2384('0xb'));var squel=require(_0x2384('0xc'));var crypto=require(_0x2384('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2384('0x8'));var querystring=require('querystring');var Papa=require(_0x2384('0xe'));var Redis=require(_0x2384('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2384('0x10'));var as=require(_0x2384('0x11'));var hardwareService=require(_0x2384('0x12'));var logger=require(_0x2384('0x13'))('api');var utils=require(_0x2384('0x14'));var config=require(_0x2384('0x15'));var licenseUtil=require(_0x2384('0x16'));var db=require('../../mysqldb')['db'];config[_0x2384('0x17')]=_['defaults'](config['redis'],{'host':_0x2384('0x18'),'port':0x18eb});var socket=require(_0x2384('0x19'))(new Redis(config[_0x2384('0x17')]));require('./dashboard.socket')[_0x2384('0x1a')](socket);function respondWithStatusCode(_0x30da2b,_0x210f11){_0x210f11=_0x210f11||0xcc;return function(_0x12b42b){if(_0x12b42b){return _0x30da2b[_0x2384('0x1b')](_0x210f11);}return _0x30da2b[_0x2384('0x1c')](_0x210f11)[_0x2384('0x1d')]();};}function respondWithResult(_0x115111,_0x3996eb){_0x3996eb=_0x3996eb||0xc8;return function(_0x3cac9d){if(_0x3cac9d){return _0x115111['status'](_0x3996eb)['json'](_0x3cac9d);}};}function respondWithFilteredResult(_0x17af81,_0xd5e447){return function(_0x15a48c){if(_0x15a48c){var _0x9a904c=typeof _0xd5e447[_0x2384('0x1e')]==='undefined'&&typeof _0xd5e447[_0x2384('0x1f')]===_0x2384('0x20');var _0x5c69cd=_0x15a48c[_0x2384('0x21')];var _0x3615fc=_0x9a904c?0x0:_0xd5e447[_0x2384('0x1e')];var _0x28763e=_0x9a904c?_0x15a48c[_0x2384('0x21')]:_0xd5e447[_0x2384('0x1e')]+_0xd5e447[_0x2384('0x1f')];var _0x2a9d8f;if(_0x28763e>=_0x5c69cd){_0x28763e=_0x5c69cd;_0x2a9d8f=0xc8;}else{_0x2a9d8f=0xce;}_0x17af81[_0x2384('0x1c')](_0x2a9d8f);return _0x17af81[_0x2384('0x22')](_0x2384('0x23'),_0x3615fc+'-'+_0x28763e+'/'+_0x5c69cd)[_0x2384('0x24')](_0x15a48c);}return null;};}function patchUpdates(_0x1e6b4b){return function(_0xe8f8ce){try{jsonpatch['apply'](_0xe8f8ce,_0x1e6b4b,!![]);}catch(_0x74ca74){return BPromise[_0x2384('0x25')](_0x74ca74);}return _0xe8f8ce['save']();};}function saveUpdates(_0xe26ece,_0x22d063){return function(_0x4e930a){if(_0x4e930a){return _0x4e930a[_0x2384('0x26')](_0xe26ece)[_0x2384('0x27')](function(_0x13ae01){return _0x13ae01;});}return null;};}function removeEntity(_0x2047bf,_0x80ebd2){return function(_0x2c7eed){if(_0x2c7eed){return _0x2c7eed[_0x2384('0x28')]()['then'](function(){var _0x4cc788=_0x2c7eed[_0x2384('0x29')]({'plain':!![]});var _0xfb80c=_0x2384('0x2a');return db[_0x2384('0x2b')][_0x2384('0x28')]({'where':{'type':_0xfb80c,'resourceId':_0x4cc788['id']}})[_0x2384('0x27')](function(){return _0x2c7eed;});})[_0x2384('0x27')](function(){_0x2047bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c557a,_0x4e9501){return function(_0x3a6c07){if(!_0x3a6c07){_0x5c557a[_0x2384('0x1b')](0x194);}return _0x3a6c07;};}function handleError(_0x33f405,_0x1b1768){_0x1b1768=_0x1b1768||0x1f4;return function(_0x473b91){logger[_0x2384('0x2c')](_0x473b91[_0x2384('0x2d')]);if(_0x473b91[_0x2384('0x2e')]){delete _0x473b91['name'];}_0x33f405[_0x2384('0x1c')](_0x1b1768)[_0x2384('0x2f')](_0x473b91);};}exports[_0x2384('0x30')]=function(_0x4f1b41,_0x4d1332){var _0x3fee17={},_0x3013e7={},_0x1137d8={'count':0x0,'rows':[]};var _0x5e20b6=_[_0x2384('0x31')](db[_0x2384('0x32')][_0x2384('0x33')],function(_0x4f0ea2){return{'name':_0x4f0ea2[_0x2384('0x34')],'type':_0x4f0ea2[_0x2384('0x35')][_0x2384('0x36')]};});_0x3013e7['model']=_['map'](_0x5e20b6,_0x2384('0x2e'));_0x3013e7[_0x2384('0x37')]=_[_0x2384('0x38')](_0x4f1b41[_0x2384('0x37')]);_0x3013e7[_0x2384('0x39')]=_[_0x2384('0x3a')](_0x3013e7[_0x2384('0x3b')],_0x3013e7['query']);_0x3fee17[_0x2384('0x3c')]=_[_0x2384('0x3a')](_0x3013e7[_0x2384('0x3b')],qs['fields'](_0x4f1b41[_0x2384('0x37')][_0x2384('0x3d')]));_0x3fee17['attributes']=_0x3fee17[_0x2384('0x3c')][_0x2384('0x3e')]?_0x3fee17[_0x2384('0x3c')]:_0x3013e7['model'];if(!_0x4f1b41['query']['hasOwnProperty']('nolimit')){_0x3fee17['limit']=qs['limit'](_0x4f1b41[_0x2384('0x37')]['limit']);_0x3fee17[_0x2384('0x1e')]=qs[_0x2384('0x1e')](_0x4f1b41[_0x2384('0x37')][_0x2384('0x1e')]);}_0x3fee17[_0x2384('0x3f')]=qs[_0x2384('0x40')](_0x4f1b41['query'][_0x2384('0x40')]);_0x3fee17[_0x2384('0x41')]=qs['filters'](_['pick'](_0x4f1b41['query'],_0x3013e7['filters']),_0x5e20b6);if(_0x4f1b41[_0x2384('0x37')][_0x2384('0x42')]){_0x3fee17[_0x2384('0x41')]=_[_0x2384('0x43')](_0x3fee17[_0x2384('0x41')],{'$or':_[_0x2384('0x31')](_0x5e20b6,function(_0x5ae243){if(_0x5ae243[_0x2384('0x35')]!=='VIRTUAL'){var _0x38eff9={};_0x38eff9[_0x5ae243[_0x2384('0x2e')]]={'$like':'%'+_0x4f1b41[_0x2384('0x37')][_0x2384('0x42')]+'%'};return _0x38eff9;}})});}_0x3fee17=_[_0x2384('0x43')]({},_0x3fee17,_0x4f1b41['options']);var _0x159a1c={'where':_0x3fee17[_0x2384('0x41')]};return db[_0x2384('0x32')][_0x2384('0x21')](_0x159a1c)[_0x2384('0x27')](function(_0x48d66d){_0x1137d8[_0x2384('0x21')]=_0x48d66d;if(_0x4f1b41['query'][_0x2384('0x44')]){_0x3fee17[_0x2384('0x45')]=[{'all':!![]}];}return db[_0x2384('0x32')][_0x2384('0x46')](_0x3fee17);})[_0x2384('0x27')](function(_0x110a44){_0x1137d8[_0x2384('0x47')]=_0x110a44;return _0x1137d8;})[_0x2384('0x27')](respondWithFilteredResult(_0x4d1332,_0x3fee17))['catch'](handleError(_0x4d1332,null));};exports[_0x2384('0x48')]=function(_0x483b25,_0x3c142d){var _0x580849={'raw':![],'where':{'id':_0x483b25['params']['id']}},_0x49dc8f={};_0x49dc8f[_0x2384('0x3b')]=_[_0x2384('0x38')](db[_0x2384('0x32')][_0x2384('0x33')]);_0x49dc8f[_0x2384('0x37')]=_[_0x2384('0x38')](_0x483b25['query']);_0x49dc8f[_0x2384('0x39')]=_[_0x2384('0x3a')](_0x49dc8f[_0x2384('0x3b')],_0x49dc8f[_0x2384('0x37')]);_0x580849['attributes']=_[_0x2384('0x3a')](_0x49dc8f['model'],qs[_0x2384('0x3d')](_0x483b25[_0x2384('0x37')]['fields']));_0x580849[_0x2384('0x3c')]=_0x580849['attributes'][_0x2384('0x3e')]?_0x580849[_0x2384('0x3c')]:_0x49dc8f[_0x2384('0x3b')];if(_0x483b25['query']['includeAll']){_0x580849['include']=[{'all':!![]}];}_0x580849=_[_0x2384('0x43')]({},_0x580849,_0x483b25['options']);return db[_0x2384('0x32')][_0x2384('0x49')](_0x580849)[_0x2384('0x27')](handleEntityNotFound(_0x3c142d,null))[_0x2384('0x27')](respondWithResult(_0x3c142d,null))[_0x2384('0x4a')](handleError(_0x3c142d,null));};exports['create']=function(_0x4497b7,_0x17a11f){return db[_0x2384('0x32')][_0x2384('0x4b')](_0x4497b7[_0x2384('0x4c')],{})[_0x2384('0x27')](function(_0x433506){var _0x1aa78d=_0x4497b7[_0x2384('0x4d')][_0x2384('0x29')]({'plain':!![]});if(!_0x1aa78d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1aa78d['role']===_0x2384('0x4d')){var _0xa1cd64=_0x433506[_0x2384('0x29')]({'plain':!![]});var _0x44248f='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x44248f,'userProfileId':_0x1aa78d[_0x2384('0x4e')]},'raw':!![]})[_0x2384('0x27')](function(_0x50205e){if(_0x50205e&&_0x50205e['autoAssociation']===0x0){return db[_0x2384('0x2b')]['create']({'name':_0xa1cd64[_0x2384('0x2e')],'resourceId':_0xa1cd64['id'],'type':_0x50205e[_0x2384('0x2e')],'sectionId':_0x50205e['id']},{})[_0x2384('0x27')](function(){return _0x433506;});}else{return _0x433506;}})['catch'](function(_0x526911){logger[_0x2384('0x2c')](_0x2384('0x4f'),_0x526911);throw _0x526911;});}return _0x433506;})[_0x2384('0x27')](respondWithResult(_0x17a11f,0xc9))[_0x2384('0x4a')](handleError(_0x17a11f,null));};exports['clone']=function(_0x4fdd66,_0xcbd05a){var _0x4169c7={'where':{'id':_0x4fdd66[_0x2384('0x50')]['id']}},_0x4d9361={};_0x4d9361[_0x2384('0x3b')]=_[_0x2384('0x38')](db[_0x2384('0x32')][_0x2384('0x33')]);_0x4169c7[_0x2384('0x3c')]=_[_0x2384('0x3a')](_0x4d9361['model'],qs[_0x2384('0x3d')](_0x4fdd66[_0x2384('0x37')][_0x2384('0x3d')]));_0x4169c7[_0x2384('0x3c')]=_0x4169c7[_0x2384('0x3c')][_0x2384('0x3e')]?_0x4169c7[_0x2384('0x3c')]:_0x4d9361[_0x2384('0x3b')];if(_0x4fdd66[_0x2384('0x37')][_0x2384('0x44')]){_0x4169c7[_0x2384('0x45')]=[{'all':!![]}];}_0x4169c7=_[_0x2384('0x43')]({},_0x4169c7,_0x4fdd66[_0x2384('0x51')]);return db[_0x2384('0x32')][_0x2384('0x49')](_0x4169c7)[_0x2384('0x27')](handleEntityNotFound(_0xcbd05a,null))['then'](function(_0x715739){if(_0x715739){var _0x5bb2dc=_0x715739[_0x2384('0x29')]({'plain':!![]});_0x5bb2dc=qs[_0x2384('0x52')](_0x5bb2dc,['id',_0x2384('0x53'),_0x2384('0x54')]);_0x4fdd66['body']=_[_0x2384('0x52')](_0x4fdd66[_0x2384('0x4c')],['id',_0x2384('0x53'),_0x2384('0x54')]);return db[_0x2384('0x32')][_0x2384('0x4b')](_[_0x2384('0x43')](_0x5bb2dc,_0x4fdd66['body']),{'include':_0x4fdd66[_0x2384('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x2384('0x27')](function(_0x29eb46){var _0x1084b8=_0x4fdd66[_0x2384('0x4d')][_0x2384('0x29')]({'plain':!![]});if(!_0x1084b8)throw new Error(_0x2384('0x55'));if(_0x1084b8[_0x2384('0x56')]===_0x2384('0x4d')){var _0x2c630b=_0x29eb46['get']({'plain':!![]});var _0x4469ec=_0x2384('0x2a');return db[_0x2384('0x57')][_0x2384('0x49')]({'where':{'name':_0x4469ec,'userProfileId':_0x1084b8[_0x2384('0x4e')]},'raw':!![]})[_0x2384('0x27')](function(_0x40956c){if(_0x40956c&&_0x40956c[_0x2384('0x58')]===0x0){return db[_0x2384('0x2b')]['create']({'name':_0x2c630b[_0x2384('0x2e')],'resourceId':_0x2c630b['id'],'type':_0x40956c[_0x2384('0x2e')],'sectionId':_0x40956c['id']},{})[_0x2384('0x27')](function(){return _0x29eb46;});}else{return _0x29eb46;}})['catch'](function(_0x3f7c73){logger['error'](_0x2384('0x4f'),_0x3f7c73);throw _0x3f7c73;});}return _0x29eb46;});}})[_0x2384('0x27')](respondWithResult(_0xcbd05a,0xc9))[_0x2384('0x4a')](handleError(_0xcbd05a,null));};exports[_0x2384('0x26')]=function(_0x3c941b,_0x4da6d3){if(_0x3c941b[_0x2384('0x4c')]['id']){delete _0x3c941b[_0x2384('0x4c')]['id'];}return db['Dashboard'][_0x2384('0x49')]({'where':{'id':_0x3c941b[_0x2384('0x50')]['id']}})[_0x2384('0x27')](handleEntityNotFound(_0x4da6d3,null))[_0x2384('0x27')](saveUpdates(_0x3c941b[_0x2384('0x4c')],null))[_0x2384('0x27')](respondWithResult(_0x4da6d3,null))[_0x2384('0x4a')](handleError(_0x4da6d3,null));};exports[_0x2384('0x28')]=function(_0x4fd232,_0x124e79){return db[_0x2384('0x32')][_0x2384('0x49')]({'where':{'id':_0x4fd232[_0x2384('0x50')]['id']}})[_0x2384('0x27')](handleEntityNotFound(_0x124e79,null))[_0x2384('0x27')](removeEntity(_0x124e79,null))[_0x2384('0x4a')](handleError(_0x124e79,null));};function widgetAttributes(_0x496b07){try{switch(_0x496b07[_0x2384('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x496b07['attrUrl']||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0][_0x2384('0x5a')]:undefined)||_0x2384('0x5b')}];case'custom':return[{'name':_0x2384('0x5c'),'value':_0x496b07['attrPath']||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0][_0x2384('0x5a')]:undefined)||''}];case'clock':return[{'name':_0x2384('0x5d'),'value':_0x496b07[_0x2384('0x5d')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0][_0x2384('0x5a')]:undefined)||_0x2384('0x5e')},{'name':_0x2384('0x5f'),'value':_0x496b07[_0x2384('0x5f')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x1]?_0x496b07['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x2384('0x60'),'value':_0x496b07[_0x2384('0x60')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x2]?_0x496b07[_0x2384('0x59')][0x2]['value']:undefined)||0xc}];case _0x2384('0x61'):return[{'name':_0x2384('0x62'),'value':_0x496b07[_0x2384('0x62')]||(_0x496b07['attrs']&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07['attrs'][0x0][_0x2384('0x5a')]:undefined)||_0x2384('0x63')},{'name':_0x2384('0x64'),'value':_0x496b07['attrVoiceQueues']||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x1]?_0x496b07[_0x2384('0x59')][0x1][_0x2384('0x5a')]:undefined)||[]},{'name':'attrFontSize','value':_0x496b07[_0x2384('0x60')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x2]?_0x496b07[_0x2384('0x59')][0x2][_0x2384('0x5a')]:undefined)||0x14},{'name':_0x2384('0x65'),'value':_0x496b07[_0x2384('0x65')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x3]?_0x496b07[_0x2384('0x59')][0x3]['value']:undefined)||_0x2384('0x66')},{'name':_0x2384('0x67'),'value':_0x496b07[_0x2384('0x67')]||(_0x496b07['attrs']&&_0x496b07[_0x2384('0x59')][0x4]?_0x496b07['attrs'][0x4][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x68'),'value':_0x496b07[_0x2384('0x68')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x5]?_0x496b07[_0x2384('0x59')][0x5][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x69'),'value':_0x496b07[_0x2384('0x69')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x6]?_0x496b07['attrs'][0x6][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x6a'),'value':_0x496b07[_0x2384('0x6a')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07['attrs'][0x7]?_0x496b07[_0x2384('0x59')][0x7]['value']:undefined)||''},{'name':_0x2384('0x6b'),'value':_0x496b07['attrWhatsappAccounts']||(_0x496b07[_0x2384('0x59')]&&_0x496b07['attrs'][0x8]?_0x496b07[_0x2384('0x59')][0x8][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x6c'),'value':_0x496b07[_0x2384('0x6c')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x9]?_0x496b07[_0x2384('0x59')][0x9][_0x2384('0x5a')]:undefined)||''}];case _0x2384('0x6d'):case _0x2384('0x6e'):return[{'name':_0x2384('0x6f'),'value':_0x496b07[_0x2384('0x6f')]||(_0x496b07['attrs']&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0][_0x2384('0x5a')]:undefined)||_0x2384('0x63')},{'name':'attrSerie2','value':_0x496b07['attrSerie2']||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x1]?_0x496b07['attrs'][0x1][_0x2384('0x5a')]:undefined)||null},{'name':_0x2384('0x70'),'value':_0x496b07[_0x2384('0x70')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x2]?_0x496b07[_0x2384('0x59')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x496b07[_0x2384('0x64')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x3]?_0x496b07[_0x2384('0x59')][0x3][_0x2384('0x5a')]:undefined)||[]},{'name':'attrChannel','value':_0x496b07['attrChannel']||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x4]?_0x496b07[_0x2384('0x59')][0x4][_0x2384('0x5a')]:undefined)||_0x2384('0x66')},{'name':_0x2384('0x67'),'value':_0x496b07[_0x2384('0x67')]||(_0x496b07['attrs']&&_0x496b07['attrs'][0x5]?_0x496b07[_0x2384('0x59')][0x5]['value']:undefined)||''},{'name':_0x2384('0x68'),'value':_0x496b07[_0x2384('0x68')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x6]?_0x496b07['attrs'][0x6][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x69'),'value':_0x496b07['attrSmsAccounts']||(_0x496b07[_0x2384('0x59')]&&_0x496b07['attrs'][0x7]?_0x496b07[_0x2384('0x59')][0x7][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x6a'),'value':_0x496b07['attrOpenchannelAccounts']||(_0x496b07['attrs']&&_0x496b07['attrs'][0x8]?_0x496b07['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x496b07[_0x2384('0x6b')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x9]?_0x496b07[_0x2384('0x59')][0x9][_0x2384('0x5a')]:undefined)||''},{'name':_0x2384('0x6c'),'value':_0x496b07[_0x2384('0x6c')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0xa]?_0x496b07[_0x2384('0x59')][0xa][_0x2384('0x5a')]:undefined)||''}];case _0x2384('0x71'):return[{'name':_0x2384('0x72'),'type':_0x496b07[_0x2384('0x73')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0][_0x2384('0x35')]:undefined)||null,'value':_0x496b07[_0x2384('0x72')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x0]?_0x496b07[_0x2384('0x59')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x496b07[_0x2384('0x74')]||(_0x496b07[_0x2384('0x59')]&&_0x496b07[_0x2384('0x59')][0x1]?_0x496b07[_0x2384('0x59')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4705a6){logger[_0x2384('0x2c')](_0x2384('0x75'),JSON[_0x2384('0x76')](_0x4705a6));return[];}}exports[_0x2384('0x77')]=function(_0x21c566,_0x3c743e,_0x33c1e6){if(_0x21c566[_0x2384('0x4c')]['id']){delete _0x21c566[_0x2384('0x4c')]['id'];}return db[_0x2384('0x32')][_0x2384('0x49')]({'where':{'id':_0x21c566[_0x2384('0x50')]['id']}})[_0x2384('0x27')](handleEntityNotFound(_0x3c743e,null))[_0x2384('0x27')](function(_0x5a15ce){if(_0x5a15ce){_0x21c566[_0x2384('0x4c')]['DashboardId']=_0x5a15ce['id'];_0x21c566[_0x2384('0x4c')]['attrs']=widgetAttributes(_0x21c566[_0x2384('0x4c')]);return db[_0x2384('0x78')][_0x2384('0x4b')](_0x21c566[_0x2384('0x4c')]);}})['then'](respondWithResult(_0x3c743e,null))[_0x2384('0x4a')](handleError(_0x3c743e,null));};exports['getItems']=function(_0x1dd670,_0x426162,_0x140a15){var _0x11dc87={};var _0x2eefb3={};var _0x2e0645;var _0x5ddbb2;return db[_0x2384('0x32')][_0x2384('0x79')]({'where':{'id':_0x1dd670[_0x2384('0x50')]['id']}})[_0x2384('0x27')](handleEntityNotFound(_0x426162,null))[_0x2384('0x27')](function(_0x55be29){if(_0x55be29){_0x2e0645=_0x55be29;_0x2eefb3[_0x2384('0x3b')]=_['keys'](db[_0x2384('0x78')][_0x2384('0x33')]);_0x2eefb3['query']=_[_0x2384('0x38')](_0x1dd670[_0x2384('0x37')]);_0x2eefb3[_0x2384('0x39')]=_[_0x2384('0x3a')](_0x2eefb3[_0x2384('0x3b')],_0x2eefb3[_0x2384('0x37')]);_0x11dc87['attributes']=_['intersection'](_0x2eefb3[_0x2384('0x3b')],qs['fields'](_0x1dd670[_0x2384('0x37')][_0x2384('0x3d')]));_0x11dc87['attributes']=_0x11dc87[_0x2384('0x3c')]['length']?_0x11dc87['attributes']:_0x2eefb3['model'];_0x11dc87[_0x2384('0x3f')]=qs[_0x2384('0x40')](_0x1dd670[_0x2384('0x37')][_0x2384('0x40')]);_0x11dc87[_0x2384('0x41')]=qs[_0x2384('0x39')](_[_0x2384('0x7a')](_0x1dd670[_0x2384('0x37')],_0x2eefb3['filters']));if(_0x1dd670[_0x2384('0x37')][_0x2384('0x42')]){_0x11dc87[_0x2384('0x41')]=_['merge'](_0x11dc87[_0x2384('0x41')],{'$or':_['map'](_0x11dc87[_0x2384('0x3c')],function(_0x4aa410){var _0x165eba={};_0x165eba[_0x4aa410]={'$like':'%'+_0x1dd670[_0x2384('0x37')]['filter']+'%'};return _0x165eba;})});}_0x11dc87=_[_0x2384('0x43')]({},_0x11dc87,_0x1dd670['options']);return _0x2e0645[_0x2384('0x7b')](_0x11dc87);}})['then'](function(_0x4907fc){if(_0x4907fc){_0x5ddbb2=_0x4907fc['length'];if(!_0x1dd670[_0x2384('0x37')][_0x2384('0x7c')](_0x2384('0x7d'))){_0x11dc87[_0x2384('0x1f')]=qs[_0x2384('0x1f')](_0x1dd670[_0x2384('0x37')][_0x2384('0x1f')]);_0x11dc87['offset']=qs[_0x2384('0x1e')](_0x1dd670[_0x2384('0x37')]['offset']);}return _0x2e0645[_0x2384('0x7b')](_0x11dc87);}})[_0x2384('0x27')](function(_0x80eaaa){if(_0x80eaaa){return _0x80eaaa?{'count':_0x5ddbb2,'rows':_0x80eaaa}:null;}})[_0x2384('0x27')](respondWithResult(_0x426162,null))[_0x2384('0x4a')](handleError(_0x426162,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 75be628..1a9f8c2 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 _0x9341=['events','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x310b7e,_0x35c330){var _0xa252d2=function(_0x424ccd){while(--_0x424ccd){_0x310b7e['push'](_0x310b7e['shift']());}};_0xa252d2(++_0x35c330);}(_0x9341,0xc8));var _0x1934=function(_0x352270,_0x41e3ad){_0x352270=_0x352270-0x0;var _0x3caffb=_0x9341[_0x352270];return _0x3caffb;};'use strict';var EventEmitter=require(_0x1934('0x0'));var Dashboard=require(_0x1934('0x1'))['db'][_0x1934('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1934('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1934('0x4'),'afterDestroy':_0x1934('0x5')};function emitEvent(_0x5d3645){return function(_0x3bd63b,_0x2963f9,_0x51c4f5){DashboardEvents['emit'](_0x5d3645+':'+_0x3bd63b['id'],_0x3bd63b);DashboardEvents[_0x1934('0x6')](_0x5d3645,_0x3bd63b);_0x51c4f5(null);};}for(var e in events){if(events[_0x1934('0x7')](e)){var event=events[e];Dashboard[_0x1934('0x8')](e,emitEvent(event));}}module[_0x1934('0x9')]=DashboardEvents; \ No newline at end of file +var _0x5958=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove'];(function(_0x4523c7,_0x17ff23){var _0x2eab67=function(_0xcf75b3){while(--_0xcf75b3){_0x4523c7['push'](_0x4523c7['shift']());}};_0x2eab67(++_0x17ff23);}(_0x5958,0x14e));var _0x8595=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x5958[_0x38a7ac];return _0x53061a;};'use strict';var EventEmitter=require(_0x8595('0x0'));var Dashboard=require(_0x8595('0x1'))['db'][_0x8595('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8595('0x3')](0x0);var events={'afterCreate':_0x8595('0x4'),'afterUpdate':_0x8595('0x5'),'afterDestroy':_0x8595('0x6')};function emitEvent(_0x4c99c6){return function(_0x34907c,_0x26d540,_0x55cafd){DashboardEvents[_0x8595('0x7')](_0x4c99c6+':'+_0x34907c['id'],_0x34907c);DashboardEvents[_0x8595('0x7')](_0x4c99c6,_0x34907c);_0x55cafd(null);};}for(var e in events){if(events[_0x8595('0x8')](e)){var event=events[e];Dashboard[_0x8595('0x9')](e,emitEvent(event));}}module[_0x8595('0xa')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 1a200e7..55219d6 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 _0x2737=['dashboards','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Dashboard'];(function(_0x470e1d,_0x5f36ef){var _0x195fee=function(_0x115bf2){while(--_0x115bf2){_0x470e1d['push'](_0x470e1d['shift']());}};_0x195fee(++_0x5f36ef);}(_0x2737,0xa1));var _0x7273=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2737[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7273('0x0'))(_0x7273('0x1'));var moment=require(_0x7273('0x2'));var BPromise=require(_0x7273('0x3'));var rp=require(_0x7273('0x4'));var fs=require('fs');var path=require(_0x7273('0x5'));var rimraf=require(_0x7273('0x6'));var config=require(_0x7273('0x7'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x67a41c,_0x3a58ce){return _0x67a41c['define'](_0x7273('0x8'),attributes,{'tableName':_0x7273('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7835=['Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./dashboard.attributes','exports','define'];(function(_0x161e8d,_0x460081){var _0x332bbc=function(_0x3d6a19){while(--_0x3d6a19){_0x161e8d['push'](_0x161e8d['shift']());}};_0x332bbc(++_0x460081);}(_0x7835,0xec));var _0x5783=function(_0x59779a,_0x1b6355){_0x59779a=_0x59779a-0x0;var _0x40e8b4=_0x7835[_0x59779a];return _0x40e8b4;};'use strict';var _=require(_0x5783('0x0'));var util=require(_0x5783('0x1'));var logger=require(_0x5783('0x2'))(_0x5783('0x3'));var moment=require(_0x5783('0x4'));var BPromise=require('bluebird');var rp=require(_0x5783('0x5'));var fs=require('fs');var path=require(_0x5783('0x6'));var rimraf=require(_0x5783('0x7'));var config=require('../../config/environment');var attributes=require(_0x5783('0x8'));module[_0x5783('0x9')]=function(_0x491f31,_0x405da0){return _0x491f31[_0x5783('0xa')](_0x5783('0xb'),attributes,{'tableName':_0x5783('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 0a79f03..ca42b86 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 _0xdc28=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xdc28,0x99));var _0x8dc2=function(_0xc31be8,_0x3425f0){_0xc31be8=_0xc31be8-0x0;var _0x52f117=_0xdc28[_0xc31be8];return _0x52f117;};'use strict';var _=require(_0x8dc2('0x0'));var util=require(_0x8dc2('0x1'));var moment=require(_0x8dc2('0x2'));var BPromise=require(_0x8dc2('0x3'));var rs=require(_0x8dc2('0x4'));var fs=require('fs');var Redis=require(_0x8dc2('0x5'));var db=require(_0x8dc2('0x6'))['db'];var utils=require(_0x8dc2('0x7'));var logger=require(_0x8dc2('0x8'))('rpc');var config=require(_0x8dc2('0x9'));var jayson=require(_0x8dc2('0xa'));var client=jayson[_0x8dc2('0xb')]['http']({'port':0x232a});config[_0x8dc2('0xc')]=_[_0x8dc2('0xd')](config[_0x8dc2('0xc')],{'host':_0x8dc2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dc2('0xc')]));require(_0x8dc2('0xf'))['register'](socket);function respondWithRpcPromise(_0x43817c,_0x44a398,_0x203628){return new BPromise(function(_0x311b84,_0xaee69e){return client[_0x8dc2('0x10')](_0x43817c,_0x203628)['then'](function(_0x3d1be6){logger[_0x8dc2('0x11')](_0x8dc2('0x12'),_0x44a398,_0x8dc2('0x13'));logger['debug'](_0x8dc2('0x14'),_0x44a398,'request\x20sent',JSON[_0x8dc2('0x15')](_0x3d1be6));if(_0x3d1be6['error']){if(_0x3d1be6['error']['code']===0x1f4){logger[_0x8dc2('0x16')]('Dashboard,\x20%s,\x20%s',_0x44a398,_0x3d1be6['error'][_0x8dc2('0x17')]);return _0xaee69e(_0x3d1be6['error'][_0x8dc2('0x17')]);}logger['error'](_0x8dc2('0x12'),_0x44a398,_0x3d1be6['error'][_0x8dc2('0x17')]);return _0x311b84(_0x3d1be6[_0x8dc2('0x16')]['message']);}else{logger[_0x8dc2('0x11')](_0x8dc2('0x12'),_0x44a398,'request\x20sent');_0x311b84(_0x3d1be6['result'][_0x8dc2('0x17')]);}})[_0x8dc2('0x18')](function(_0x40ae91){logger[_0x8dc2('0x16')](_0x8dc2('0x12'),_0x44a398,_0x40ae91);_0xaee69e(_0x40ae91);});});} \ No newline at end of file +var _0xb2bf=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x591f83,_0xbeec15){var _0x104cb7=function(_0x18420c){while(--_0x18420c){_0x591f83['push'](_0x591f83['shift']());}};_0x104cb7(++_0xbeec15);}(_0xb2bf,0xb5));var _0xfb2b=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xb2bf[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0xfb2b('0x0'));var util=require(_0xfb2b('0x1'));var moment=require(_0xfb2b('0x2'));var BPromise=require(_0xfb2b('0x3'));var rs=require(_0xfb2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb2b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb2b('0x6'))(_0xfb2b('0x7'));var config=require(_0xfb2b('0x8'));var jayson=require(_0xfb2b('0x9'));var client=jayson[_0xfb2b('0xa')]['http']({'port':0x232a});config[_0xfb2b('0xb')]=_['defaults'](config[_0xfb2b('0xb')],{'host':_0xfb2b('0xc'),'port':0x18eb});var socket=require(_0xfb2b('0xd'))(new Redis(config[_0xfb2b('0xb')]));require(_0xfb2b('0xe'))['register'](socket);function respondWithRpcPromise(_0x126ff0,_0x3484b5,_0x573ca1){return new BPromise(function(_0x33a4ee,_0x3bc3bc){return client[_0xfb2b('0xf')](_0x126ff0,_0x573ca1)[_0xfb2b('0x10')](function(_0x274da0){logger[_0xfb2b('0x11')](_0xfb2b('0x12'),_0x3484b5,_0xfb2b('0x13'));logger[_0xfb2b('0x14')](_0xfb2b('0x15'),_0x3484b5,_0xfb2b('0x13'),JSON[_0xfb2b('0x16')](_0x274da0));if(_0x274da0[_0xfb2b('0x17')]){if(_0x274da0['error'][_0xfb2b('0x18')]===0x1f4){logger[_0xfb2b('0x17')](_0xfb2b('0x12'),_0x3484b5,_0x274da0[_0xfb2b('0x17')]['message']);return _0x3bc3bc(_0x274da0[_0xfb2b('0x17')][_0xfb2b('0x19')]);}logger[_0xfb2b('0x17')]('Dashboard,\x20%s,\x20%s',_0x3484b5,_0x274da0['error'][_0xfb2b('0x19')]);return _0x33a4ee(_0x274da0[_0xfb2b('0x17')]['message']);}else{logger[_0xfb2b('0x11')](_0xfb2b('0x12'),_0x3484b5,_0xfb2b('0x13'));_0x33a4ee(_0x274da0[_0xfb2b('0x1a')]['message']);}})[_0xfb2b('0x1b')](function(_0x13f174){logger[_0xfb2b('0x17')](_0xfb2b('0x12'),_0x3484b5,_0x13f174);_0x3bc3bc(_0x13f174);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index da4de25..848c319 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 _0x26e8=['update','emit','removeListener','register','dashboard:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26e8,0x179));var _0x826e=function(_0x427b08,_0x44470d){_0x427b08=_0x427b08-0x0;var _0x4a8274=_0x26e8[_0x427b08];return _0x4a8274;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x826e('0x0'),'remove',_0x826e('0x1')];function createListener(_0x187515,_0x4daf40){return function(_0x477fbc){_0x4daf40[_0x826e('0x2')](_0x187515,_0x477fbc);};}function removeListener(_0xd839b2,_0x396384){return function(){DashboardEvents[_0x826e('0x3')](_0xd839b2,_0x396384);};}exports[_0x826e('0x4')]=function(_0x3ce6b2){for(var _0x41a960=0x0,_0x2c72f9=events['length'];_0x41a960<_0x2c72f9;_0x41a960++){var _0x1e89fc=events[_0x41a960];var _0x87df86=createListener(_0x826e('0x5')+_0x1e89fc,_0x3ce6b2);DashboardEvents['on'](_0x1e89fc,_0x87df86);}}; \ No newline at end of file +var _0x3aea=['save','remove','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x3ef7e4,_0x1e13a6){var _0x54299d=function(_0x499869){while(--_0x499869){_0x3ef7e4['push'](_0x3ef7e4['shift']());}};_0x54299d(++_0x1e13a6);}(_0x3aea,0x109));var _0xa3ae=function(_0x2d58ef,_0x26f7b1){_0x2d58ef=_0x2d58ef-0x0;var _0x3091e5=_0x3aea[_0x2d58ef];return _0x3091e5;};'use strict';var DashboardEvents=require(_0xa3ae('0x0'));var events=[_0xa3ae('0x1'),_0xa3ae('0x2'),'update'];function createListener(_0x3098f0,_0x4b7910){return function(_0x4d03c7){_0x4b7910['emit'](_0x3098f0,_0x4d03c7);};}function removeListener(_0x415365,_0x446783){return function(){DashboardEvents[_0xa3ae('0x3')](_0x415365,_0x446783);};}exports[_0xa3ae('0x4')]=function(_0x1966f0){for(var _0x330009=0x0,_0x3f032d=events[_0xa3ae('0x5')];_0x330009<_0x3f032d;_0x330009++){var _0x86ba3=events[_0x330009];var _0x54a3c6=createListener(_0xa3ae('0x6')+_0x86ba3,_0x1966f0);DashboardEvents['on'](_0x86ba3,_0x54a3c6);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 09a9c89..2792419 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 _0xed93=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','put','delete','destroy','exports','multer','util'];(function(_0x8aedd5,_0x4ba6db){var _0x37f96a=function(_0x521373){while(--_0x521373){_0x8aedd5['push'](_0x8aedd5['shift']());}};_0x37f96a(++_0x4ba6db);}(_0xed93,0x1d9));var _0x3ed9=function(_0x4f6cd3,_0x27bdd2){_0x4f6cd3=_0x4f6cd3-0x0;var _0x10a327=_0xed93[_0x4f6cd3];return _0x10a327;};'use strict';var multer=require(_0x3ed9('0x0'));var util=require(_0x3ed9('0x1'));var path=require('path');var timeout=require(_0x3ed9('0x2'));var express=require(_0x3ed9('0x3'));var router=express[_0x3ed9('0x4')]();var fs_extra=require(_0x3ed9('0x5'));var auth=require(_0x3ed9('0x6'));var interaction=require(_0x3ed9('0x7'));var config=require(_0x3ed9('0x8'));var controller=require(_0x3ed9('0x9'));router[_0x3ed9('0xa')]('/',auth[_0x3ed9('0xb')](),controller[_0x3ed9('0xc')]);router[_0x3ed9('0xa')](_0x3ed9('0xd'),auth[_0x3ed9('0xb')](),controller[_0x3ed9('0xe')]);router[_0x3ed9('0xa')](_0x3ed9('0xf'),auth[_0x3ed9('0xb')](),controller[_0x3ed9('0x10')]);router[_0x3ed9('0x11')]('/',auth[_0x3ed9('0xb')](),controller[_0x3ed9('0x12')]);router[_0x3ed9('0x11')](_0x3ed9('0x13'),auth[_0x3ed9('0xb')](),controller[_0x3ed9('0x14')]);router[_0x3ed9('0x11')](_0x3ed9('0xf'),auth[_0x3ed9('0xb')](),controller['addItem']);router[_0x3ed9('0x15')](_0x3ed9('0xd'),auth[_0x3ed9('0xb')](),controller['update']);router[_0x3ed9('0x16')](_0x3ed9('0xd'),auth[_0x3ed9('0xb')](),controller[_0x3ed9('0x17')]);module[_0x3ed9('0x18')]=router; \ No newline at end of file +var _0xe75f=['addItem','put','update','delete','exports','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x2442a1,_0x59355c){var _0x40f7ad=function(_0x279ff5){while(--_0x279ff5){_0x2442a1['push'](_0x2442a1['shift']());}};_0x40f7ad(++_0x59355c);}(_0xe75f,0x64));var _0xfe75=function(_0xf9fa33,_0xed0f87){_0xf9fa33=_0xf9fa33-0x0;var _0x4d3e56=_0xe75f[_0xf9fa33];return _0x4d3e56;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfe75('0x0'));var router=express[_0xfe75('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfe75('0x2'));var config=require(_0xfe75('0x3'));var controller=require('./dashboard.controller');router[_0xfe75('0x4')]('/',auth[_0xfe75('0x5')](),controller[_0xfe75('0x6')]);router['get'](_0xfe75('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xfe75('0x4')](_0xfe75('0x8'),auth[_0xfe75('0x5')](),controller[_0xfe75('0x9')]);router[_0xfe75('0xa')]('/',auth[_0xfe75('0x5')](),controller[_0xfe75('0xb')]);router[_0xfe75('0xa')](_0xfe75('0xc'),auth['isAuthenticated'](),controller[_0xfe75('0xd')]);router[_0xfe75('0xa')](_0xfe75('0x8'),auth[_0xfe75('0x5')](),controller[_0xfe75('0xe')]);router[_0xfe75('0xf')](_0xfe75('0x7'),auth['isAuthenticated'](),controller[_0xfe75('0x10')]);router[_0xfe75('0x11')](_0xfe75('0x7'),auth[_0xfe75('0x5')](),controller['destroy']);module[_0xfe75('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index dcdd942..a09e2e3 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 _0xfcf0=['sequelize','squel','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x5178fb,_0x121e19){var _0x348183=function(_0x52c2ec){while(--_0x52c2ec){_0x5178fb['push'](_0x5178fb['shift']());}};_0x348183(++_0x121e19);}(_0xfcf0,0x138));var _0x0fcf=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0xfcf0[_0xc5a279];return _0xc755d3;};'use strict';var Sequelize=require(_0x0fcf('0x0'));var squel=require(_0x0fcf('0x1'));var _=require('lodash');module[_0x0fcf('0x2')]={'title':{'type':Sequelize[_0x0fcf('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0fcf('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x0fcf('0x4')]('long'),'get':function(){try{return JSON[_0x0fcf('0x5')](this[_0x0fcf('0x6')](_0x0fcf('0x7')));}catch(_0x3af316){return[];}},'set':function(_0x1bace8){try{this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')](_0x1bace8));}catch(_0x50c575){this[_0x0fcf('0x8')](_0x0fcf('0x7'),JSON[_0x0fcf('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x0fcf('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x0fcf('0xa')]},'col':{'type':Sequelize[_0x0fcf('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fcf('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x0fcf('0x3')]},'titleFontSize':{'type':Sequelize[_0x0fcf('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0x11500b,_0x8c789a){var _0x57a4e0=function(_0x2ef44e){while(--_0x2ef44e){_0x11500b['push'](_0x11500b['shift']());}};_0x57a4e0(++_0x8c789a);}(_0xeff8,0x186));var _0x8eff=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xeff8[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 58d8e94..674aa6b 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 _0x2428=['attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find','catch','destroy','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues'];(function(_0x79c9b5,_0x59b3ae){var _0x5c2d2d=function(_0x1addae){while(--_0x1addae){_0x79c9b5['push'](_0x79c9b5['shift']());}};_0x5c2d2d(++_0x59b3ae);}(_0x2428,0xd3));var _0x8242=function(_0x142cce,_0x38cf81){_0x142cce=_0x142cce-0x0;var _0x1d5013=_0x2428[_0x142cce];return _0x1d5013;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8242('0x0'));var zipdir=require(_0x8242('0x1'));var jsonpatch=require(_0x8242('0x2'));var rp=require(_0x8242('0x3'));var moment=require(_0x8242('0x4'));var BPromise=require(_0x8242('0x5'));var Mustache=require(_0x8242('0x6'));var util=require(_0x8242('0x7'));var path=require(_0x8242('0x8'));var sox=require(_0x8242('0x9'));var csv=require(_0x8242('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8242('0xb'));var _=require(_0x8242('0xc'));var squel=require(_0x8242('0xd'));var crypto=require(_0x8242('0xe'));var jsforce=require(_0x8242('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8242('0xa'));var querystring=require(_0x8242('0x10'));var Papa=require(_0x8242('0x11'));var Redis=require(_0x8242('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8242('0x13'));var as=require(_0x8242('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8242('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8242('0x16')]=_[_0x8242('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8242('0x18'))(new Redis(config[_0x8242('0x16')]));require('./dashboardItem.socket')[_0x8242('0x19')](socket);function respondWithStatusCode(_0x5d649c,_0x4086e5){_0x4086e5=_0x4086e5||0xcc;return function(_0x34dfe3){if(_0x34dfe3){return _0x5d649c[_0x8242('0x1a')](_0x4086e5);}return _0x5d649c[_0x8242('0x1b')](_0x4086e5)[_0x8242('0x1c')]();};}function respondWithResult(_0x15f60c,_0x2a7a8d){_0x2a7a8d=_0x2a7a8d||0xc8;return function(_0x53ac08){if(_0x53ac08){return _0x15f60c['status'](_0x2a7a8d)[_0x8242('0x1d')](_0x53ac08);}};}function respondWithFilteredResult(_0x45a325,_0x3e373e){return function(_0xad2711){if(_0xad2711){var _0x12b745=typeof _0x3e373e[_0x8242('0x1e')]===_0x8242('0x1f')&&typeof _0x3e373e[_0x8242('0x20')]==='undefined';var _0x1aa763=_0xad2711[_0x8242('0x21')];var _0x206916=_0x12b745?0x0:_0x3e373e[_0x8242('0x1e')];var _0x3cc7f4=_0x12b745?_0xad2711['count']:_0x3e373e[_0x8242('0x1e')]+_0x3e373e['limit'];var _0x22746e;if(_0x3cc7f4>=_0x1aa763){_0x3cc7f4=_0x1aa763;_0x22746e=0xc8;}else{_0x22746e=0xce;}_0x45a325[_0x8242('0x1b')](_0x22746e);return _0x45a325['set']('Content-Range',_0x206916+'-'+_0x3cc7f4+'/'+_0x1aa763)[_0x8242('0x1d')](_0xad2711);}return null;};}function patchUpdates(_0x737a81){return function(_0x3336e8){try{jsonpatch[_0x8242('0x22')](_0x3336e8,_0x737a81,!![]);}catch(_0x477191){return BPromise[_0x8242('0x23')](_0x477191);}return _0x3336e8[_0x8242('0x24')]();};}function saveUpdates(_0x5b5811,_0x5ddf2a){return function(_0x4d6ab5){if(_0x4d6ab5){return _0x4d6ab5[_0x8242('0x25')](_0x5b5811)[_0x8242('0x26')](function(_0x4e3caa){return _0x4e3caa;});}return null;};}function removeEntity(_0x4c964a,_0x42e6f5){return function(_0x3e75fd){if(_0x3e75fd){return _0x3e75fd['destroy']()[_0x8242('0x26')](function(){_0x4c964a['status'](0xcc)[_0x8242('0x1c')]();});}};}function handleEntityNotFound(_0x4ab16e,_0x2a8504){return function(_0x20f2b7){if(!_0x20f2b7){_0x4ab16e['sendStatus'](0x194);}return _0x20f2b7;};}function handleError(_0x135a00,_0x1a41b1){_0x1a41b1=_0x1a41b1||0x1f4;return function(_0x77a048){logger[_0x8242('0x27')](_0x77a048[_0x8242('0x28')]);if(_0x77a048[_0x8242('0x29')]){delete _0x77a048[_0x8242('0x29')];}_0x135a00[_0x8242('0x1b')](_0x1a41b1)[_0x8242('0x2a')](_0x77a048);};}exports[_0x8242('0x2b')]=function(_0x3ea5fb,_0x27bedc){var _0x44f2ca={'raw':![],'where':{'id':_0x3ea5fb[_0x8242('0x2c')]['id']}},_0x163b1e={};_0x163b1e[_0x8242('0x2d')]=_[_0x8242('0x2e')](db[_0x8242('0x2f')][_0x8242('0x30')]);_0x163b1e[_0x8242('0x31')]=_[_0x8242('0x2e')](_0x3ea5fb[_0x8242('0x31')]);_0x163b1e[_0x8242('0x32')]=_['intersection'](_0x163b1e[_0x8242('0x2d')],_0x163b1e[_0x8242('0x31')]);_0x44f2ca[_0x8242('0x33')]=_[_0x8242('0x34')](_0x163b1e[_0x8242('0x2d')],qs[_0x8242('0x35')](_0x3ea5fb[_0x8242('0x31')]['fields']));_0x44f2ca['attributes']=_0x44f2ca[_0x8242('0x33')]['length']?_0x44f2ca[_0x8242('0x33')]:_0x163b1e['model'];if(_0x3ea5fb[_0x8242('0x31')][_0x8242('0x36')]){_0x44f2ca[_0x8242('0x37')]=[{'all':!![]}];}_0x44f2ca=_[_0x8242('0x38')]({},_0x44f2ca,_0x3ea5fb[_0x8242('0x39')]);return db[_0x8242('0x2f')][_0x8242('0x3a')](_0x44f2ca)['then'](handleEntityNotFound(_0x27bedc,null))['then'](respondWithResult(_0x27bedc,null))[_0x8242('0x3b')](handleError(_0x27bedc,null));};exports[_0x8242('0x3c')]=function(_0x226846,_0x59c54){return db['DashboardItem'][_0x8242('0x3a')]({'where':{'id':_0x226846['params']['id']}})[_0x8242('0x26')](handleEntityNotFound(_0x59c54,null))[_0x8242('0x26')](removeEntity(_0x59c54,null))[_0x8242('0x3b')](handleError(_0x59c54,null));};function widgetAttributes(_0x5a8a75){try{switch(_0x5a8a75['type']){case _0x8242('0x3d'):return[{'name':_0x8242('0x3e'),'value':_0x5a8a75['attrUrl']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75['attrs'][0x0]?_0x5a8a75['attrs'][0x0][_0x8242('0x40')]:undefined)||'https://'}];case _0x8242('0x41'):return[{'name':_0x8242('0x42'),'value':_0x5a8a75[_0x8242('0x42')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x0]?_0x5a8a75[_0x8242('0x3f')][0x0][_0x8242('0x40')]:undefined)||''}];case _0x8242('0x43'):return[{'name':_0x8242('0x44'),'value':_0x5a8a75[_0x8242('0x44')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x0]?_0x5a8a75['attrs'][0x0][_0x8242('0x40')]:undefined)||_0x8242('0x45')},{'name':'attrTimezone','value':_0x5a8a75[_0x8242('0x46')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x1]?_0x5a8a75[_0x8242('0x3f')][0x1][_0x8242('0x40')]:undefined)||_0x8242('0x47')},{'name':'attrFontSize','value':_0x5a8a75[_0x8242('0x48')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x2]?_0x5a8a75[_0x8242('0x3f')][0x2]['value']:undefined)||0xc}];case _0x8242('0x49'):return[{'name':_0x8242('0x4a'),'value':_0x5a8a75[_0x8242('0x4a')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x0]?_0x5a8a75[_0x8242('0x3f')][0x0][_0x8242('0x40')]:undefined)||_0x8242('0x4b')},{'name':'attrVoiceQueues','value':_0x5a8a75[_0x8242('0x4c')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x1]?_0x5a8a75[_0x8242('0x3f')][0x1][_0x8242('0x40')]:undefined)||[]},{'name':_0x8242('0x48'),'value':_0x5a8a75[_0x8242('0x48')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x2]?_0x5a8a75['attrs'][0x2][_0x8242('0x40')]:undefined)||0x14},{'name':_0x8242('0x4d'),'value':_0x5a8a75['attrChannel']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x3]?_0x5a8a75[_0x8242('0x3f')][0x3][_0x8242('0x40')]:undefined)||_0x8242('0x4e')},{'name':_0x8242('0x4f'),'value':_0x5a8a75[_0x8242('0x4f')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x4]?_0x5a8a75[_0x8242('0x3f')][0x4][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x50'),'value':_0x5a8a75[_0x8242('0x50')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x5]?_0x5a8a75[_0x8242('0x3f')][0x5][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x51'),'value':_0x5a8a75['attrSmsAccounts']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x6]?_0x5a8a75[_0x8242('0x3f')][0x6][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x52'),'value':_0x5a8a75['attrOpenchannelAccounts']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x7]?_0x5a8a75[_0x8242('0x3f')][0x7][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x53'),'value':_0x5a8a75['attrWhatsappAccounts']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x8]?_0x5a8a75[_0x8242('0x3f')][0x8][_0x8242('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5a8a75[_0x8242('0x54')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75['attrs'][0x9]?_0x5a8a75[_0x8242('0x3f')][0x9][_0x8242('0x40')]:undefined)||''}];case _0x8242('0x55'):case _0x8242('0x56'):return[{'name':_0x8242('0x57'),'value':_0x5a8a75['attrSerie1']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75['attrs'][0x0]?_0x5a8a75[_0x8242('0x3f')][0x0][_0x8242('0x40')]:undefined)||_0x8242('0x4b')},{'name':_0x8242('0x58'),'value':_0x5a8a75[_0x8242('0x58')]||(_0x5a8a75['attrs']&&_0x5a8a75['attrs'][0x1]?_0x5a8a75[_0x8242('0x3f')][0x1][_0x8242('0x40')]:undefined)||null},{'name':_0x8242('0x59'),'value':_0x5a8a75[_0x8242('0x59')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75['attrs'][0x2]?_0x5a8a75['attrs'][0x2][_0x8242('0x40')]:undefined)||null},{'name':_0x8242('0x4c'),'value':_0x5a8a75[_0x8242('0x4c')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x3]?_0x5a8a75[_0x8242('0x3f')][0x3]['value']:undefined)||[]},{'name':_0x8242('0x4d'),'value':_0x5a8a75[_0x8242('0x4d')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x4]?_0x5a8a75[_0x8242('0x3f')][0x4]['value']:undefined)||_0x8242('0x4e')},{'name':'attrEmailAccounts','value':_0x5a8a75[_0x8242('0x4f')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x5]?_0x5a8a75[_0x8242('0x3f')][0x5][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x50'),'value':_0x5a8a75[_0x8242('0x50')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x6]?_0x5a8a75[_0x8242('0x3f')][0x6][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x51'),'value':_0x5a8a75[_0x8242('0x51')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x7]?_0x5a8a75[_0x8242('0x3f')][0x7]['value']:undefined)||''},{'name':_0x8242('0x52'),'value':_0x5a8a75[_0x8242('0x52')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x8]?_0x5a8a75['attrs'][0x8]['value']:undefined)||''},{'name':_0x8242('0x53'),'value':_0x5a8a75[_0x8242('0x53')]||(_0x5a8a75['attrs']&&_0x5a8a75[_0x8242('0x3f')][0x9]?_0x5a8a75[_0x8242('0x3f')][0x9][_0x8242('0x40')]:undefined)||''},{'name':_0x8242('0x54'),'value':_0x5a8a75[_0x8242('0x54')]||(_0x5a8a75['attrs']&&_0x5a8a75['attrs'][0xa]?_0x5a8a75[_0x8242('0x3f')][0xa][_0x8242('0x40')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x5a8a75['reportType']||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x0]?_0x5a8a75['attrs'][0x0]['type']:undefined)||null,'value':_0x5a8a75[_0x8242('0x5a')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x0]?_0x5a8a75[_0x8242('0x3f')][0x0][_0x8242('0x40')]:undefined)||null},{'name':_0x8242('0x5b'),'value':_0x5a8a75[_0x8242('0x5b')]||(_0x5a8a75[_0x8242('0x3f')]&&_0x5a8a75[_0x8242('0x3f')][0x1]?_0x5a8a75['attrs'][0x1][_0x8242('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x1962c3){logger[_0x8242('0x27')](_0x8242('0x5c'),JSON[_0x8242('0x5d')](_0x1962c3));return[];}}exports[_0x8242('0x5e')]=function(_0x14d01c,_0x1f1f0d){if(_0x14d01c['body']){_0x14d01c[_0x8242('0x5f')][_0x8242('0x3f')]=widgetAttributes(_0x14d01c[_0x8242('0x5f')]);}return db['DashboardItem'][_0x8242('0x5e')](_0x14d01c[_0x8242('0x5f')],{})[_0x8242('0x26')](respondWithResult(_0x1f1f0d,0xc9))[_0x8242('0x3b')](handleError(_0x1f1f0d,null));};exports[_0x8242('0x25')]=function(_0x464669,_0xd6ad){if(_0x464669[_0x8242('0x5f')]['id']){delete _0x464669[_0x8242('0x5f')]['id'];}_0x464669[_0x8242('0x5f')][_0x8242('0x3f')]=widgetAttributes(_0x464669[_0x8242('0x5f')]);return db[_0x8242('0x2f')][_0x8242('0x3a')]({'where':{'id':_0x464669[_0x8242('0x2c')]['id']}})[_0x8242('0x26')](handleEntityNotFound(_0xd6ad,null))['then'](saveUpdates(_0x464669['body'],null))[_0x8242('0x26')](respondWithResult(_0xd6ad,null))[_0x8242('0x3b')](handleError(_0xd6ad,null));}; \ No newline at end of file +var _0xb5f3=['attrVoiceQueues','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','params','DashboardItem','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie2','attrSerie3'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb5f3,0x137));var _0x3b5f=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0xb5f3[_0x10f68e];return _0x4c8372;};'use strict';var emlformat=require(_0x3b5f('0x0'));var rimraf=require(_0x3b5f('0x1'));var zipdir=require(_0x3b5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b5f('0x3'));var moment=require(_0x3b5f('0x4'));var BPromise=require(_0x3b5f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3b5f('0x6'));var sox=require(_0x3b5f('0x7'));var csv=require(_0x3b5f('0x8'));var ejs=require(_0x3b5f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b5f('0xa'));var squel=require(_0x3b5f('0xb'));var crypto=require('crypto');var jsforce=require(_0x3b5f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3b5f('0x8'));var querystring=require(_0x3b5f('0xd'));var Papa=require(_0x3b5f('0xe'));var Redis=require(_0x3b5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3b5f('0x10'));var as=require(_0x3b5f('0x11'));var hardwareService=require(_0x3b5f('0x12'));var logger=require(_0x3b5f('0x13'))(_0x3b5f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b5f('0x15'))['db'];config[_0x3b5f('0x16')]=_[_0x3b5f('0x17')](config[_0x3b5f('0x16')],{'host':_0x3b5f('0x18'),'port':0x18eb});var socket=require(_0x3b5f('0x19'))(new Redis(config[_0x3b5f('0x16')]));require(_0x3b5f('0x1a'))['register'](socket);function respondWithStatusCode(_0x3d960d,_0x2c4277){_0x2c4277=_0x2c4277||0xcc;return function(_0x2009a8){if(_0x2009a8){return _0x3d960d['sendStatus'](_0x2c4277);}return _0x3d960d[_0x3b5f('0x1b')](_0x2c4277)['end']();};}function respondWithResult(_0x5df2e7,_0x2c6aaa){_0x2c6aaa=_0x2c6aaa||0xc8;return function(_0x53fc3f){if(_0x53fc3f){return _0x5df2e7[_0x3b5f('0x1b')](_0x2c6aaa)[_0x3b5f('0x1c')](_0x53fc3f);}};}function respondWithFilteredResult(_0xa9a9eb,_0x15c66c){return function(_0x5ed046){if(_0x5ed046){var _0x2db25f=typeof _0x15c66c['offset']===_0x3b5f('0x1d')&&typeof _0x15c66c[_0x3b5f('0x1e')]===_0x3b5f('0x1d');var _0x5711ff=_0x5ed046['count'];var _0x2f84de=_0x2db25f?0x0:_0x15c66c[_0x3b5f('0x1f')];var _0x30bfe7=_0x2db25f?_0x5ed046[_0x3b5f('0x20')]:_0x15c66c['offset']+_0x15c66c[_0x3b5f('0x1e')];var _0xfcc090;if(_0x30bfe7>=_0x5711ff){_0x30bfe7=_0x5711ff;_0xfcc090=0xc8;}else{_0xfcc090=0xce;}_0xa9a9eb[_0x3b5f('0x1b')](_0xfcc090);return _0xa9a9eb[_0x3b5f('0x21')](_0x3b5f('0x22'),_0x2f84de+'-'+_0x30bfe7+'/'+_0x5711ff)[_0x3b5f('0x1c')](_0x5ed046);}return null;};}function patchUpdates(_0x56a1d0){return function(_0x5e6d68){try{jsonpatch[_0x3b5f('0x23')](_0x5e6d68,_0x56a1d0,!![]);}catch(_0x1e1df6){return BPromise[_0x3b5f('0x24')](_0x1e1df6);}return _0x5e6d68[_0x3b5f('0x25')]();};}function saveUpdates(_0x469b92,_0x2309ce){return function(_0xd50bf){if(_0xd50bf){return _0xd50bf[_0x3b5f('0x26')](_0x469b92)[_0x3b5f('0x27')](function(_0x3267b8){return _0x3267b8;});}return null;};}function removeEntity(_0x52be62,_0x55fb32){return function(_0x15e63e){if(_0x15e63e){return _0x15e63e[_0x3b5f('0x28')]()[_0x3b5f('0x27')](function(){_0x52be62[_0x3b5f('0x1b')](0xcc)[_0x3b5f('0x29')]();});}};}function handleEntityNotFound(_0x5302f9,_0x13a54a){return function(_0x2d5ba1){if(!_0x2d5ba1){_0x5302f9[_0x3b5f('0x2a')](0x194);}return _0x2d5ba1;};}function handleError(_0x3cf7c3,_0x58321f){_0x58321f=_0x58321f||0x1f4;return function(_0x4f023c){logger[_0x3b5f('0x2b')](_0x4f023c[_0x3b5f('0x2c')]);if(_0x4f023c[_0x3b5f('0x2d')]){delete _0x4f023c['name'];}_0x3cf7c3['status'](_0x58321f)[_0x3b5f('0x2e')](_0x4f023c);};}exports[_0x3b5f('0x2f')]=function(_0x5f171d,_0xbb62dc){var _0x562f95={'raw':![],'where':{'id':_0x5f171d[_0x3b5f('0x30')]['id']}},_0xa10ddb={};_0xa10ddb['model']=_['keys'](db[_0x3b5f('0x31')][_0x3b5f('0x32')]);_0xa10ddb[_0x3b5f('0x33')]=_[_0x3b5f('0x34')](_0x5f171d[_0x3b5f('0x33')]);_0xa10ddb[_0x3b5f('0x35')]=_[_0x3b5f('0x36')](_0xa10ddb[_0x3b5f('0x37')],_0xa10ddb['query']);_0x562f95[_0x3b5f('0x38')]=_[_0x3b5f('0x36')](_0xa10ddb[_0x3b5f('0x37')],qs['fields'](_0x5f171d[_0x3b5f('0x33')][_0x3b5f('0x39')]));_0x562f95[_0x3b5f('0x38')]=_0x562f95[_0x3b5f('0x38')][_0x3b5f('0x3a')]?_0x562f95['attributes']:_0xa10ddb['model'];if(_0x5f171d['query'][_0x3b5f('0x3b')]){_0x562f95[_0x3b5f('0x3c')]=[{'all':!![]}];}_0x562f95=_[_0x3b5f('0x3d')]({},_0x562f95,_0x5f171d[_0x3b5f('0x3e')]);return db[_0x3b5f('0x31')][_0x3b5f('0x3f')](_0x562f95)['then'](handleEntityNotFound(_0xbb62dc,null))[_0x3b5f('0x27')](respondWithResult(_0xbb62dc,null))[_0x3b5f('0x40')](handleError(_0xbb62dc,null));};exports[_0x3b5f('0x28')]=function(_0x5352c7,_0x511671){return db[_0x3b5f('0x31')]['find']({'where':{'id':_0x5352c7['params']['id']}})['then'](handleEntityNotFound(_0x511671,null))[_0x3b5f('0x27')](removeEntity(_0x511671,null))['catch'](handleError(_0x511671,null));};function widgetAttributes(_0x2a4356){try{switch(_0x2a4356[_0x3b5f('0x41')]){case _0x3b5f('0x42'):return[{'name':'attrUrl','value':_0x2a4356[_0x3b5f('0x43')]||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0x0]?_0x2a4356[_0x3b5f('0x44')][0x0][_0x3b5f('0x45')]:undefined)||_0x3b5f('0x46')}];case _0x3b5f('0x47'):return[{'name':'attrPath','value':_0x2a4356[_0x3b5f('0x48')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x0]?_0x2a4356[_0x3b5f('0x44')][0x0][_0x3b5f('0x45')]:undefined)||''}];case _0x3b5f('0x49'):return[{'name':_0x3b5f('0x4a'),'value':_0x2a4356[_0x3b5f('0x4a')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x0]?_0x2a4356['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x3b5f('0x4b'),'value':_0x2a4356[_0x3b5f('0x4b')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x1]?_0x2a4356['attrs'][0x1][_0x3b5f('0x45')]:undefined)||_0x3b5f('0x4c')},{'name':_0x3b5f('0x4d'),'value':_0x2a4356['attrFontSize']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x2]?_0x2a4356[_0x3b5f('0x44')][0x2]['value']:undefined)||0xc}];case _0x3b5f('0x4e'):return[{'name':'attrMetric','value':_0x2a4356[_0x3b5f('0x4f')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x0]?_0x2a4356[_0x3b5f('0x44')][0x0][_0x3b5f('0x45')]:undefined)||_0x3b5f('0x50')},{'name':'attrVoiceQueues','value':_0x2a4356['attrVoiceQueues']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x1]?_0x2a4356['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x2a4356['attrFontSize']||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0x2]?_0x2a4356[_0x3b5f('0x44')][0x2][_0x3b5f('0x45')]:undefined)||0x14},{'name':'attrChannel','value':_0x2a4356[_0x3b5f('0x51')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x3]?_0x2a4356[_0x3b5f('0x44')][0x3][_0x3b5f('0x45')]:undefined)||_0x3b5f('0x52')},{'name':'attrEmailAccounts','value':_0x2a4356[_0x3b5f('0x53')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x4]?_0x2a4356[_0x3b5f('0x44')][0x4][_0x3b5f('0x45')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2a4356[_0x3b5f('0x54')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x5]?_0x2a4356[_0x3b5f('0x44')][0x5]['value']:undefined)||''},{'name':_0x3b5f('0x55'),'value':_0x2a4356[_0x3b5f('0x55')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x6]?_0x2a4356[_0x3b5f('0x44')][0x6][_0x3b5f('0x45')]:undefined)||''},{'name':_0x3b5f('0x56'),'value':_0x2a4356[_0x3b5f('0x56')]||(_0x2a4356['attrs']&&_0x2a4356['attrs'][0x7]?_0x2a4356[_0x3b5f('0x44')][0x7][_0x3b5f('0x45')]:undefined)||''},{'name':_0x3b5f('0x57'),'value':_0x2a4356[_0x3b5f('0x57')]||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0x8]?_0x2a4356['attrs'][0x8][_0x3b5f('0x45')]:undefined)||''},{'name':_0x3b5f('0x58'),'value':_0x2a4356[_0x3b5f('0x58')]||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0x9]?_0x2a4356[_0x3b5f('0x44')][0x9]['value']:undefined)||''}];case _0x3b5f('0x59'):case _0x3b5f('0x5a'):return[{'name':'attrSerie1','value':_0x2a4356['attrSerie1']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x0]?_0x2a4356[_0x3b5f('0x44')][0x0][_0x3b5f('0x45')]:undefined)||_0x3b5f('0x50')},{'name':'attrSerie2','value':_0x2a4356[_0x3b5f('0x5b')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x1]?_0x2a4356[_0x3b5f('0x44')][0x1]['value']:undefined)||null},{'name':_0x3b5f('0x5c'),'value':_0x2a4356['attrSerie3']||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0x2]?_0x2a4356[_0x3b5f('0x44')][0x2][_0x3b5f('0x45')]:undefined)||null},{'name':_0x3b5f('0x5d'),'value':_0x2a4356['attrVoiceQueues']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x3]?_0x2a4356[_0x3b5f('0x44')][0x3]['value']:undefined)||[]},{'name':_0x3b5f('0x51'),'value':_0x2a4356['attrChannel']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x4]?_0x2a4356[_0x3b5f('0x44')][0x4][_0x3b5f('0x45')]:undefined)||'voice'},{'name':_0x3b5f('0x53'),'value':_0x2a4356[_0x3b5f('0x53')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x5]?_0x2a4356['attrs'][0x5][_0x3b5f('0x45')]:undefined)||''},{'name':_0x3b5f('0x54'),'value':_0x2a4356['attrFaxAccounts']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x6]?_0x2a4356[_0x3b5f('0x44')][0x6]['value']:undefined)||''},{'name':_0x3b5f('0x55'),'value':_0x2a4356[_0x3b5f('0x55')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x7]?_0x2a4356[_0x3b5f('0x44')][0x7]['value']:undefined)||''},{'name':_0x3b5f('0x56'),'value':_0x2a4356[_0x3b5f('0x56')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x8]?_0x2a4356[_0x3b5f('0x44')][0x8][_0x3b5f('0x45')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2a4356[_0x3b5f('0x57')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x9]?_0x2a4356['attrs'][0x9]['value']:undefined)||''},{'name':_0x3b5f('0x58'),'value':_0x2a4356[_0x3b5f('0x58')]||(_0x2a4356['attrs']&&_0x2a4356[_0x3b5f('0x44')][0xa]?_0x2a4356[_0x3b5f('0x44')][0xa][_0x3b5f('0x45')]:undefined)||''}];case _0x3b5f('0x5e'):return[{'name':'attrReport','type':_0x2a4356['reportType']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356['attrs'][0x0]?_0x2a4356['attrs'][0x0][_0x3b5f('0x41')]:undefined)||null,'value':_0x2a4356[_0x3b5f('0x5f')]||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x0]?_0x2a4356[_0x3b5f('0x44')][0x0]['value']:undefined)||null},{'name':_0x3b5f('0x60'),'value':_0x2a4356['attrRefresh']||(_0x2a4356[_0x3b5f('0x44')]&&_0x2a4356[_0x3b5f('0x44')][0x1]?_0x2a4356[_0x3b5f('0x44')][0x1][_0x3b5f('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x275f83){logger[_0x3b5f('0x2b')](_0x3b5f('0x61'),JSON[_0x3b5f('0x62')](_0x275f83));return[];}}exports[_0x3b5f('0x63')]=function(_0x273f6f,_0x2bdbb5){if(_0x273f6f[_0x3b5f('0x64')]){_0x273f6f['body'][_0x3b5f('0x44')]=widgetAttributes(_0x273f6f['body']);}return db['DashboardItem']['create'](_0x273f6f[_0x3b5f('0x64')],{})[_0x3b5f('0x27')](respondWithResult(_0x2bdbb5,0xc9))[_0x3b5f('0x40')](handleError(_0x2bdbb5,null));};exports[_0x3b5f('0x26')]=function(_0x1153f2,_0x2867e4){if(_0x1153f2[_0x3b5f('0x64')]['id']){delete _0x1153f2[_0x3b5f('0x64')]['id'];}_0x1153f2['body'][_0x3b5f('0x44')]=widgetAttributes(_0x1153f2[_0x3b5f('0x64')]);return db[_0x3b5f('0x31')][_0x3b5f('0x3f')]({'where':{'id':_0x1153f2[_0x3b5f('0x30')]['id']}})['then'](handleEntityNotFound(_0x2867e4,null))[_0x3b5f('0x27')](saveUpdates(_0x1153f2['body'],null))[_0x3b5f('0x27')](respondWithResult(_0x2867e4,null))[_0x3b5f('0x40')](handleError(_0x2867e4,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 768589e..9d78f97 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 _0x5613=['update','remove','hook','events','setMaxListeners','save'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5613,0x177));var _0x3561=function(_0x13c0ab,_0x39f268){_0x13c0ab=_0x13c0ab-0x0;var _0x2f7fb8=_0x5613[_0x13c0ab];return _0x2f7fb8;};'use strict';var EventEmitter=require(_0x3561('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3561('0x1')](0x0);var events={'afterCreate':_0x3561('0x2'),'afterUpdate':_0x3561('0x3'),'afterDestroy':_0x3561('0x4')};function emitEvent(_0xbb7f3d){return function(_0x37d7b5,_0x58e557,_0x1109a0){DashboardItemEvents['emit'](_0xbb7f3d+':'+_0x37d7b5['id'],_0x37d7b5);DashboardItemEvents['emit'](_0xbb7f3d,_0x37d7b5);_0x1109a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x3561('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x43b7=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x43b7,0x1df));var _0x743b=function(_0x4dceac,_0x71f1a3){_0x4dceac=_0x4dceac-0x0;var _0x4022fd=_0x43b7[_0x4dceac];return _0x4022fd;};'use strict';var EventEmitter=require(_0x743b('0x0'));var DashboardItem=require(_0x743b('0x1'))['db'][_0x743b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x743b('0x3')](0x0);var events={'afterCreate':_0x743b('0x4'),'afterUpdate':'update','afterDestroy':_0x743b('0x5')};function emitEvent(_0x97de33){return function(_0x9011fe,_0x347c69,_0x5d8940){DashboardItemEvents[_0x743b('0x6')](_0x97de33+':'+_0x9011fe['id'],_0x9011fe);DashboardItemEvents['emit'](_0x97de33,_0x9011fe);_0x5d8940(null);};}for(var e in events){if(events[_0x743b('0x7')](e)){var event=events[e];DashboardItem[_0x743b('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9b19d87..72ce697 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 _0xd331=['request-promise','path','rimraf','../../config/environment','exports','DashboardItem','dashboard_items','lodash','api','moment'];(function(_0x5bf467,_0x17192e){var _0x5a62ae=function(_0x20c3aa){while(--_0x20c3aa){_0x5bf467['push'](_0x5bf467['shift']());}};_0x5a62ae(++_0x17192e);}(_0xd331,0xed));var _0x1d33=function(_0x3263d4,_0x2a93af){_0x3263d4=_0x3263d4-0x0;var _0x26e080=_0xd331[_0x3263d4];return _0x26e080;};'use strict';var _=require(_0x1d33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1d33('0x1'));var moment=require(_0x1d33('0x2'));var BPromise=require('bluebird');var rp=require(_0x1d33('0x3'));var fs=require('fs');var path=require(_0x1d33('0x4'));var rimraf=require(_0x1d33('0x5'));var config=require(_0x1d33('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x1d33('0x7')]=function(_0x24c32b,_0x4cf782){return _0x24c32b['define'](_0x1d33('0x8'),attributes,{'tableName':_0x1d33('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17ba=['define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x1b58a3,_0x5de88a){var _0x5459fa=function(_0x3ace8b){while(--_0x3ace8b){_0x1b58a3['push'](_0x1b58a3['shift']());}};_0x5459fa(++_0x5de88a);}(_0x17ba,0xab));var _0xa17b=function(_0x13e4f9,_0x6c3414){_0x13e4f9=_0x13e4f9-0x0;var _0x51bed9=_0x17ba[_0x13e4f9];return _0x51bed9;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'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 cb629ca..8be4bbb 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 _0x01b0=['DashboardItem,\x20%s,\x20%s','message','info','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0x01b0,0xca));var _0x001b=function(_0x37f40e,_0x5c5a1d){_0x37f40e=_0x37f40e-0x0;var _0x1bab3f=_0x01b0[_0x37f40e];return _0x1bab3f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x001b('0x0'));var fs=require('fs');var Redis=require(_0x001b('0x1'));var db=require(_0x001b('0x2'))['db'];var utils=require(_0x001b('0x3'));var logger=require('../../config/logger')(_0x001b('0x4'));var config=require(_0x001b('0x5'));var jayson=require(_0x001b('0x6'));var client=jayson[_0x001b('0x7')][_0x001b('0x8')]({'port':0x232a});config[_0x001b('0x9')]=_['defaults'](config[_0x001b('0x9')],{'host':_0x001b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x001b('0xb'))['register'](socket);function respondWithRpcPromise(_0x3c6aeb,_0x3cc634,_0x3e26e8){return new BPromise(function(_0xed3a94,_0x4b1612){return client['request'](_0x3c6aeb,_0x3e26e8)['then'](function(_0x4bc095){logger['info']('DashboardItem,\x20%s,\x20%s',_0x3cc634,_0x001b('0xc'));logger[_0x001b('0xd')](_0x001b('0xe'),_0x3cc634,'request\x20sent',JSON[_0x001b('0xf')](_0x4bc095));if(_0x4bc095[_0x001b('0x10')]){if(_0x4bc095[_0x001b('0x10')][_0x001b('0x11')]===0x1f4){logger[_0x001b('0x10')](_0x001b('0x12'),_0x3cc634,_0x4bc095[_0x001b('0x10')][_0x001b('0x13')]);return _0x4b1612(_0x4bc095[_0x001b('0x10')]['message']);}logger[_0x001b('0x10')](_0x001b('0x12'),_0x3cc634,_0x4bc095[_0x001b('0x10')]['message']);return _0xed3a94(_0x4bc095[_0x001b('0x10')][_0x001b('0x13')]);}else{logger[_0x001b('0x14')](_0x001b('0x12'),_0x3cc634,_0x001b('0xc'));_0xed3a94(_0x4bc095['result'][_0x001b('0x13')]);}})[_0x001b('0x15')](function(_0x43253d){logger[_0x001b('0x10')](_0x001b('0x12'),_0x3cc634,_0x43253d);_0x4b1612(_0x43253d);});});} \ No newline at end of file +var _0x21ec=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x566c8e,_0x10d230){var _0xe02f1e=function(_0x15568b){while(--_0x15568b){_0x566c8e['push'](_0x566c8e['shift']());}};_0xe02f1e(++_0x10d230);}(_0x21ec,0x1ab));var _0xc21e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x21ec[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xc21e('0x0'));var util=require(_0xc21e('0x1'));var moment=require(_0xc21e('0x2'));var BPromise=require(_0xc21e('0x3'));var rs=require(_0xc21e('0x4'));var fs=require('fs');var Redis=require(_0xc21e('0x5'));var db=require(_0xc21e('0x6'))['db'];var utils=require(_0xc21e('0x7'));var logger=require(_0xc21e('0x8'))(_0xc21e('0x9'));var config=require('../../config/environment');var jayson=require(_0xc21e('0xa'));var client=jayson[_0xc21e('0xb')][_0xc21e('0xc')]({'port':0x232a});config[_0xc21e('0xd')]=_[_0xc21e('0xe')](config['redis'],{'host':_0xc21e('0xf'),'port':0x18eb});var socket=require(_0xc21e('0x10'))(new Redis(config[_0xc21e('0xd')]));require('./dashboardItem.socket')[_0xc21e('0x11')](socket);function respondWithRpcPromise(_0x2b5336,_0x4a4e6e,_0x719759){return new BPromise(function(_0xee7fa9,_0x165eac){return client[_0xc21e('0x12')](_0x2b5336,_0x719759)[_0xc21e('0x13')](function(_0x5c5f2a){logger[_0xc21e('0x14')]('DashboardItem,\x20%s,\x20%s',_0x4a4e6e,_0xc21e('0x15'));logger[_0xc21e('0x16')](_0xc21e('0x17'),_0x4a4e6e,_0xc21e('0x15'),JSON[_0xc21e('0x18')](_0x5c5f2a));if(_0x5c5f2a[_0xc21e('0x19')]){if(_0x5c5f2a[_0xc21e('0x19')]['code']===0x1f4){logger['error'](_0xc21e('0x1a'),_0x4a4e6e,_0x5c5f2a['error'][_0xc21e('0x1b')]);return _0x165eac(_0x5c5f2a[_0xc21e('0x19')][_0xc21e('0x1b')]);}logger[_0xc21e('0x19')](_0xc21e('0x1a'),_0x4a4e6e,_0x5c5f2a[_0xc21e('0x19')][_0xc21e('0x1b')]);return _0xee7fa9(_0x5c5f2a[_0xc21e('0x19')][_0xc21e('0x1b')]);}else{logger['info'](_0xc21e('0x1a'),_0x4a4e6e,_0xc21e('0x15'));_0xee7fa9(_0x5c5f2a[_0xc21e('0x1c')][_0xc21e('0x1b')]);}})['catch'](function(_0x2691f6){logger[_0xc21e('0x19')]('DashboardItem,\x20%s,\x20%s',_0x4a4e6e,_0x2691f6);_0x165eac(_0x2691f6);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 57f606a..71c324b 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 _0x3c28=['removeListener','register','length','dashboardItem:','save','remove','update'];(function(_0x1ca2ff,_0x141cd6){var _0x16b496=function(_0x57dcde){while(--_0x57dcde){_0x1ca2ff['push'](_0x1ca2ff['shift']());}};_0x16b496(++_0x141cd6);}(_0x3c28,0x169));var _0x83c2=function(_0x1d3696,_0x525d46){_0x1d3696=_0x1d3696-0x0;var _0x5ba65c=_0x3c28[_0x1d3696];return _0x5ba65c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x83c2('0x0'),_0x83c2('0x1'),_0x83c2('0x2')];function createListener(_0x507f66,_0x4b3570){return function(_0x11608a){_0x4b3570['emit'](_0x507f66,_0x11608a);};}function removeListener(_0x4ebbdc,_0x2b4a5b){return function(){DashboardItemEvents[_0x83c2('0x3')](_0x4ebbdc,_0x2b4a5b);};}exports[_0x83c2('0x4')]=function(_0x3608f4){for(var _0x160b74=0x0,_0x56415c=events[_0x83c2('0x5')];_0x160b74<_0x56415c;_0x160b74++){var _0x3e8257=events[_0x160b74];var _0xfc5f69=createListener(_0x83c2('0x6')+_0x3e8257,_0x3608f4);DashboardItemEvents['on'](_0x3e8257,_0xfc5f69);}}; \ No newline at end of file +var _0xd9d1=['dashboardItem:','remove','update','emit','removeListener','length'];(function(_0x716fcd,_0x37a900){var _0x24a255=function(_0x36cb12){while(--_0x36cb12){_0x716fcd['push'](_0x716fcd['shift']());}};_0x24a255(++_0x37a900);}(_0xd9d1,0x1b7));var _0x1d9d=function(_0x196e11,_0x339eaa){_0x196e11=_0x196e11-0x0;var _0x3da5f9=_0xd9d1[_0x196e11];return _0x3da5f9;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x1d9d('0x0'),_0x1d9d('0x1')];function createListener(_0x784837,_0x15c680){return function(_0x36eb47){_0x15c680[_0x1d9d('0x2')](_0x784837,_0x36eb47);};}function removeListener(_0x49f6d5,_0xab9c98){return function(){DashboardItemEvents[_0x1d9d('0x3')](_0x49f6d5,_0xab9c98);};}exports['register']=function(_0x19b1de){for(var _0x21b301=0x0,_0x4f171f=events[_0x1d9d('0x4')];_0x21b301<_0x4f171f;_0x21b301++){var _0x9cde8e=events[_0x21b301];var _0x154bbc=createListener(_0x1d9d('0x5')+_0x9cde8e,_0x19b1de);DashboardItemEvents['on'](_0x9cde8e,_0x154bbc);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a5dff3c..bd17e14 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 _0x1874=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','post','isAuthenticated','delete','util','path','connect-timeout','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1874,0x1e5));var _0x4187=function(_0x4acebb,_0x356726){_0x4acebb=_0x4acebb-0x0;var _0x21b211=_0x1874[_0x4acebb];return _0x21b211;};'use strict';var multer=require('multer');var util=require(_0x4187('0x0'));var path=require(_0x4187('0x1'));var timeout=require(_0x4187('0x2'));var express=require(_0x4187('0x3'));var router=express[_0x4187('0x4')]();var fs_extra=require(_0x4187('0x5'));var auth=require(_0x4187('0x6'));var interaction=require(_0x4187('0x7'));var config=require(_0x4187('0x8'));var controller=require(_0x4187('0x9'));router['get'](_0x4187('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4187('0xb')]('/',auth[_0x4187('0xc')](),controller['create']);router['put'](_0x4187('0xa'),auth[_0x4187('0xc')](),controller['update']);router[_0x4187('0xd')](_0x4187('0xa'),auth[_0x4187('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb53f=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xb53f,0x98));var _0xfb53=function(_0x169401,_0x43d39e){_0x169401=_0x169401-0x0;var _0x4a8801=_0xb53f[_0x169401];return _0x4a8801;};'use strict';var multer=require(_0xfb53('0x0'));var util=require(_0xfb53('0x1'));var path=require(_0xfb53('0x2'));var timeout=require(_0xfb53('0x3'));var express=require('express');var router=express[_0xfb53('0x4')]();var fs_extra=require(_0xfb53('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb53('0x6'));var config=require(_0xfb53('0x7'));var controller=require(_0xfb53('0x8'));router['get'](_0xfb53('0x9'),auth[_0xfb53('0xa')](),controller[_0xfb53('0xb')]);router[_0xfb53('0xc')]('/',auth[_0xfb53('0xa')](),controller[_0xfb53('0xd')]);router[_0xfb53('0xe')](_0xfb53('0x9'),auth[_0xfb53('0xa')](),controller[_0xfb53('0xf')]);router[_0xfb53('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfb53('0x11')]);module[_0xfb53('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index a2375be..fb9b229 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 _0x0744=['second','third','sequelize','exports','STRING','ENUM','first'];(function(_0x40f2b0,_0x10bf06){var _0x15ee7e=function(_0x4827d5){while(--_0x4827d5){_0x40f2b0['push'](_0x40f2b0['shift']());}};_0x15ee7e(++_0x10bf06);}(_0x0744,0xe2));var _0x4074=function(_0x15f6f7,_0x305040){_0x15f6f7=_0x15f6f7-0x0;var _0x37c435=_0x0744[_0x15f6f7];return _0x37c435;};'use strict';var Sequelize=require(_0x4074('0x0'));module[_0x4074('0x1')]={'name':{'type':Sequelize[_0x4074('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x4074('0x3')](_0x4074('0x4'),_0x4074('0x5'),_0x4074('0x6')),'allowNull':![],'defaultValue':_0x4074('0x4')},'description':{'type':Sequelize[_0x4074('0x2')]}}; \ No newline at end of file +var _0xbb43=['sequelize','exports','STRING','ENUM','first','third'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbb43,0x72));var _0x3bb4=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0xbb43[_0x9a7ea6];return _0x1c2040;};'use strict';var Sequelize=require(_0x3bb4('0x0'));module[_0x3bb4('0x1')]={'name':{'type':Sequelize[_0x3bb4('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x3bb4('0x3')](_0x3bb4('0x4'),'second',_0x3bb4('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x3bb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index a970769..4504d87 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 _0x9655=['send','map','Disposition','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','findAll','catch','show','params','length','merge','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name'];(function(_0x552e0c,_0x18b5b3){var _0x50a946=function(_0x1c09c6){while(--_0x1c09c6){_0x552e0c['push'](_0x552e0c['shift']());}};_0x50a946(++_0x18b5b3);}(_0x9655,0x160));var _0x5965=function(_0x32825e,_0x434d56){_0x32825e=_0x32825e-0x0;var _0x18f77a=_0x9655[_0x32825e];return _0x18f77a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5965('0x0'));var zipdir=require(_0x5965('0x1'));var jsonpatch=require(_0x5965('0x2'));var rp=require(_0x5965('0x3'));var moment=require(_0x5965('0x4'));var BPromise=require(_0x5965('0x5'));var Mustache=require('mustache');var util=require(_0x5965('0x6'));var path=require(_0x5965('0x7'));var sox=require('sox');var csv=require(_0x5965('0x8'));var ejs=require(_0x5965('0x9'));var fs=require('fs');var fs_extra=require(_0x5965('0xa'));var _=require(_0x5965('0xb'));var squel=require('squel');var crypto=require(_0x5965('0xc'));var jsforce=require(_0x5965('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5965('0x8'));var querystring=require(_0x5965('0xe'));var Papa=require(_0x5965('0xf'));var Redis=require(_0x5965('0x10'));var authService=require(_0x5965('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5965('0x12'));var hardwareService=require(_0x5965('0x13'));var logger=require('../../config/logger')(_0x5965('0x14'));var utils=require(_0x5965('0x15'));var config=require(_0x5965('0x16'));var licenseUtil=require(_0x5965('0x17'));var db=require(_0x5965('0x18'))['db'];function respondWithStatusCode(_0x334286,_0x233dbc){_0x233dbc=_0x233dbc||0xcc;return function(_0xc9a1d2){if(_0xc9a1d2){return _0x334286[_0x5965('0x19')](_0x233dbc);}return _0x334286[_0x5965('0x1a')](_0x233dbc)['end']();};}function respondWithResult(_0x54d5c8,_0x5f94e6){_0x5f94e6=_0x5f94e6||0xc8;return function(_0x372f73){if(_0x372f73){return _0x54d5c8[_0x5965('0x1a')](_0x5f94e6)[_0x5965('0x1b')](_0x372f73);}};}function respondWithFilteredResult(_0xba6bb7,_0x1959c5){return function(_0x2d6b6c){if(_0x2d6b6c){var _0x204644=typeof _0x1959c5[_0x5965('0x1c')]===_0x5965('0x1d')&&typeof _0x1959c5[_0x5965('0x1e')]===_0x5965('0x1d');var _0x43dd1f=_0x2d6b6c['count'];var _0x4c046a=_0x204644?0x0:_0x1959c5[_0x5965('0x1c')];var _0x3fa749=_0x204644?_0x2d6b6c[_0x5965('0x1f')]:_0x1959c5[_0x5965('0x1c')]+_0x1959c5['limit'];var _0x473378;if(_0x3fa749>=_0x43dd1f){_0x3fa749=_0x43dd1f;_0x473378=0xc8;}else{_0x473378=0xce;}_0xba6bb7[_0x5965('0x1a')](_0x473378);return _0xba6bb7[_0x5965('0x20')]('Content-Range',_0x4c046a+'-'+_0x3fa749+'/'+_0x43dd1f)['json'](_0x2d6b6c);}return null;};}function patchUpdates(_0x23baf8){return function(_0x470211){try{jsonpatch['apply'](_0x470211,_0x23baf8,!![]);}catch(_0x242a71){return BPromise['reject'](_0x242a71);}return _0x470211[_0x5965('0x21')]();};}function saveUpdates(_0x25f0e1,_0x37652c){return function(_0x2d3608){if(_0x2d3608){return _0x2d3608['update'](_0x25f0e1)[_0x5965('0x22')](function(_0x45bce0){return _0x45bce0;});}return null;};}function removeEntity(_0x59523b,_0x3547fa){return function(_0x13269f){if(_0x13269f){return _0x13269f[_0x5965('0x23')]()[_0x5965('0x22')](function(){var _0x30b597=_0x13269f[_0x5965('0x24')]({'plain':!![]});var _0x1e3d9a=_0x5965('0x25');return db[_0x5965('0x26')]['destroy']({'where':{'type':_0x1e3d9a,'resourceId':_0x30b597['id']}})[_0x5965('0x22')](function(){return _0x13269f;});})[_0x5965('0x22')](function(){_0x59523b[_0x5965('0x1a')](0xcc)[_0x5965('0x27')]();});}};}function handleEntityNotFound(_0x2d1778,_0x4d6f0a){return function(_0x44898a){if(!_0x44898a){_0x2d1778[_0x5965('0x19')](0x194);}return _0x44898a;};}function handleError(_0x54beae,_0x9b50a){_0x9b50a=_0x9b50a||0x1f4;return function(_0x12ab37){logger[_0x5965('0x28')](_0x12ab37[_0x5965('0x29')]);if(_0x12ab37[_0x5965('0x2a')]){delete _0x12ab37[_0x5965('0x2a')];}_0x54beae['status'](_0x9b50a)[_0x5965('0x2b')](_0x12ab37);};}exports['index']=function(_0x5bea7f,_0x56f84a){var _0x3b5e38={},_0x370bdf={},_0x290bbd={'count':0x0,'rows':[]};var _0x306e12=_[_0x5965('0x2c')](db[_0x5965('0x2d')][_0x5965('0x2e')],function(_0x498c99){return{'name':_0x498c99[_0x5965('0x2f')],'type':_0x498c99[_0x5965('0x30')][_0x5965('0x31')]};});_0x370bdf[_0x5965('0x32')]=_['map'](_0x306e12,'name');_0x370bdf[_0x5965('0x33')]=_['keys'](_0x5bea7f[_0x5965('0x33')]);_0x370bdf[_0x5965('0x34')]=_[_0x5965('0x35')](_0x370bdf['model'],_0x370bdf['query']);_0x3b5e38[_0x5965('0x36')]=_[_0x5965('0x35')](_0x370bdf['model'],qs['fields'](_0x5bea7f[_0x5965('0x33')][_0x5965('0x37')]));_0x3b5e38['attributes']=_0x3b5e38['attributes']['length']?_0x3b5e38['attributes']:_0x370bdf[_0x5965('0x32')];if(!_0x5bea7f['query'][_0x5965('0x38')](_0x5965('0x39'))){_0x3b5e38[_0x5965('0x1e')]=qs['limit'](_0x5bea7f['query']['limit']);_0x3b5e38[_0x5965('0x1c')]=qs[_0x5965('0x1c')](_0x5bea7f[_0x5965('0x33')]['offset']);}_0x3b5e38['order']=qs[_0x5965('0x3a')](_0x5bea7f[_0x5965('0x33')][_0x5965('0x3a')]);_0x3b5e38[_0x5965('0x3b')]=qs['filters'](_['pick'](_0x5bea7f[_0x5965('0x33')],_0x370bdf[_0x5965('0x34')]),_0x306e12);if(_0x5bea7f[_0x5965('0x33')][_0x5965('0x3c')]){_0x3b5e38[_0x5965('0x3b')]=_['merge'](_0x3b5e38[_0x5965('0x3b')],{'$or':_[_0x5965('0x2c')](_0x306e12,function(_0x11a87b){if(_0x11a87b[_0x5965('0x30')]!=='VIRTUAL'){var _0x10a796={};_0x10a796[_0x11a87b[_0x5965('0x2a')]]={'$like':'%'+_0x5bea7f[_0x5965('0x33')]['filter']+'%'};return _0x10a796;}})});}_0x3b5e38=_['merge']({},_0x3b5e38,_0x5bea7f[_0x5965('0x3d')]);var _0x3c25b8={'where':_0x3b5e38[_0x5965('0x3b')]};return db[_0x5965('0x2d')][_0x5965('0x1f')](_0x3c25b8)[_0x5965('0x22')](function(_0x26bd9d){_0x290bbd[_0x5965('0x1f')]=_0x26bd9d;if(_0x5bea7f['query'][_0x5965('0x3e')]){_0x3b5e38[_0x5965('0x3f')]=[{'all':!![]}];}return db[_0x5965('0x2d')][_0x5965('0x40')](_0x3b5e38);})[_0x5965('0x22')](function(_0x1215d0){_0x290bbd['rows']=_0x1215d0;return _0x290bbd;})['then'](respondWithFilteredResult(_0x56f84a,_0x3b5e38))[_0x5965('0x41')](handleError(_0x56f84a,null));};exports[_0x5965('0x42')]=function(_0x5c39f9,_0x48afe2){var _0xa3d518={'raw':!![],'where':{'id':_0x5c39f9[_0x5965('0x43')]['id']}},_0xf2992f={};_0xf2992f[_0x5965('0x32')]=_['keys'](db[_0x5965('0x2d')][_0x5965('0x2e')]);_0xf2992f[_0x5965('0x33')]=_['keys'](_0x5c39f9[_0x5965('0x33')]);_0xf2992f[_0x5965('0x34')]=_[_0x5965('0x35')](_0xf2992f['model'],_0xf2992f[_0x5965('0x33')]);_0xa3d518[_0x5965('0x36')]=_[_0x5965('0x35')](_0xf2992f[_0x5965('0x32')],qs[_0x5965('0x37')](_0x5c39f9[_0x5965('0x33')]['fields']));_0xa3d518[_0x5965('0x36')]=_0xa3d518[_0x5965('0x36')][_0x5965('0x44')]?_0xa3d518[_0x5965('0x36')]:_0xf2992f[_0x5965('0x32')];if(_0x5c39f9[_0x5965('0x33')]['includeAll']){_0xa3d518[_0x5965('0x3f')]=[{'all':!![]}];}_0xa3d518=_[_0x5965('0x45')]({},_0xa3d518,_0x5c39f9[_0x5965('0x3d')]);return db[_0x5965('0x2d')]['find'](_0xa3d518)[_0x5965('0x22')](handleEntityNotFound(_0x48afe2,null))[_0x5965('0x22')](respondWithResult(_0x48afe2,null))['catch'](handleError(_0x48afe2,null));};exports[_0x5965('0x46')]=function(_0x19bcc2,_0x3c0303){return db[_0x5965('0x2d')][_0x5965('0x46')](_0x19bcc2['body'],{})[_0x5965('0x22')](function(_0x584841){var _0x4cb2ba=_0x19bcc2['user'][_0x5965('0x24')]({'plain':!![]});if(!_0x4cb2ba)throw new Error(_0x5965('0x47'));if(_0x4cb2ba['role']==='user'){var _0x26f630=_0x584841['get']({'plain':!![]});var _0x5e4233='Dispositions';return db[_0x5965('0x48')][_0x5965('0x49')]({'where':{'name':_0x5e4233,'userProfileId':_0x4cb2ba[_0x5965('0x4a')]},'raw':!![]})[_0x5965('0x22')](function(_0x30b071){if(_0x30b071&&_0x30b071[_0x5965('0x4b')]===0x0){return db[_0x5965('0x26')][_0x5965('0x46')]({'name':_0x26f630[_0x5965('0x2a')],'resourceId':_0x26f630['id'],'type':_0x30b071[_0x5965('0x2a')],'sectionId':_0x30b071['id']},{})[_0x5965('0x22')](function(){return _0x584841;});}else{return _0x584841;}})['catch'](function(_0x3936aa){logger[_0x5965('0x28')](_0x5965('0x4c'),_0x3936aa);throw _0x3936aa;});}return _0x584841;})[_0x5965('0x22')](respondWithResult(_0x3c0303,0xc9))[_0x5965('0x41')](handleError(_0x3c0303,null));};exports[_0x5965('0x4d')]=function(_0xfaf2e6,_0x4dd1f4){if(_0xfaf2e6['body']['id']){delete _0xfaf2e6[_0x5965('0x4e')]['id'];}return db[_0x5965('0x2d')][_0x5965('0x49')]({'where':{'id':_0xfaf2e6[_0x5965('0x43')]['id']}})[_0x5965('0x22')](handleEntityNotFound(_0x4dd1f4,null))[_0x5965('0x22')](saveUpdates(_0xfaf2e6['body'],null))[_0x5965('0x22')](respondWithResult(_0x4dd1f4,null))[_0x5965('0x41')](handleError(_0x4dd1f4,null));};exports[_0x5965('0x23')]=function(_0x7eaea0,_0x4555d2){return db[_0x5965('0x2d')][_0x5965('0x49')]({'where':{'id':_0x7eaea0[_0x5965('0x43')]['id']}})['then'](handleEntityNotFound(_0x4555d2,null))[_0x5965('0x22')](removeEntity(_0x4555d2,null))[_0x5965('0x41')](handleError(_0x4555d2,null));}; \ No newline at end of file +var _0xf163=['end','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','Dispositions','UserProfileResource','name','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x372e78,_0xa4b08a){var _0x8f8851=function(_0x2694ce){while(--_0x2694ce){_0x372e78['push'](_0x372e78['shift']());}};_0x8f8851(++_0xa4b08a);}(_0xf163,0x129));var _0x3f16=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0xf163[_0x36940e];return _0x3283f2;};'use strict';var emlformat=require(_0x3f16('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3f16('0x1'));var jsonpatch=require(_0x3f16('0x2'));var rp=require(_0x3f16('0x3'));var moment=require(_0x3f16('0x4'));var BPromise=require(_0x3f16('0x5'));var Mustache=require('mustache');var util=require(_0x3f16('0x6'));var path=require(_0x3f16('0x7'));var sox=require('sox');var csv=require(_0x3f16('0x8'));var ejs=require(_0x3f16('0x9'));var fs=require('fs');var fs_extra=require(_0x3f16('0xa'));var _=require(_0x3f16('0xb'));var squel=require(_0x3f16('0xc'));var crypto=require(_0x3f16('0xd'));var jsforce=require(_0x3f16('0xe'));var deskjs=require(_0x3f16('0xf'));var toCsv=require(_0x3f16('0x8'));var querystring=require(_0x3f16('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f16('0x11'));var authService=require(_0x3f16('0x12'));var qs=require(_0x3f16('0x13'));var as=require(_0x3f16('0x14'));var hardwareService=require(_0x3f16('0x15'));var logger=require(_0x3f16('0x16'))('api');var utils=require(_0x3f16('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3f16('0x18'));var db=require(_0x3f16('0x19'))['db'];function respondWithStatusCode(_0xd36fd0,_0x101158){_0x101158=_0x101158||0xcc;return function(_0x1e7330){if(_0x1e7330){return _0xd36fd0[_0x3f16('0x1a')](_0x101158);}return _0xd36fd0['status'](_0x101158)[_0x3f16('0x1b')]();};}function respondWithResult(_0x36a20b,_0x8a24e6){_0x8a24e6=_0x8a24e6||0xc8;return function(_0x1c83c7){if(_0x1c83c7){return _0x36a20b[_0x3f16('0x1c')](_0x8a24e6)['json'](_0x1c83c7);}};}function respondWithFilteredResult(_0x461d4e,_0x5b0b3f){return function(_0x23e0e4){if(_0x23e0e4){var _0x24c077=typeof _0x5b0b3f[_0x3f16('0x1d')]===_0x3f16('0x1e')&&typeof _0x5b0b3f[_0x3f16('0x1f')]===_0x3f16('0x1e');var _0x10769=_0x23e0e4[_0x3f16('0x20')];var _0x2fae0f=_0x24c077?0x0:_0x5b0b3f[_0x3f16('0x1d')];var _0x12691c=_0x24c077?_0x23e0e4[_0x3f16('0x20')]:_0x5b0b3f[_0x3f16('0x1d')]+_0x5b0b3f[_0x3f16('0x1f')];var _0x198372;if(_0x12691c>=_0x10769){_0x12691c=_0x10769;_0x198372=0xc8;}else{_0x198372=0xce;}_0x461d4e[_0x3f16('0x1c')](_0x198372);return _0x461d4e['set'](_0x3f16('0x21'),_0x2fae0f+'-'+_0x12691c+'/'+_0x10769)['json'](_0x23e0e4);}return null;};}function patchUpdates(_0x27166c){return function(_0x35a067){try{jsonpatch[_0x3f16('0x22')](_0x35a067,_0x27166c,!![]);}catch(_0x1f7020){return BPromise['reject'](_0x1f7020);}return _0x35a067[_0x3f16('0x23')]();};}function saveUpdates(_0xd451c6,_0x24a5e5){return function(_0x2cbc6f){if(_0x2cbc6f){return _0x2cbc6f[_0x3f16('0x24')](_0xd451c6)[_0x3f16('0x25')](function(_0xa2a3b7){return _0xa2a3b7;});}return null;};}function removeEntity(_0x559a78,_0x289bb8){return function(_0x5c4fe4){if(_0x5c4fe4){return _0x5c4fe4['destroy']()[_0x3f16('0x25')](function(){var _0x4a9766=_0x5c4fe4[_0x3f16('0x26')]({'plain':!![]});var _0x42c8c4=_0x3f16('0x27');return db[_0x3f16('0x28')]['destroy']({'where':{'type':_0x42c8c4,'resourceId':_0x4a9766['id']}})['then'](function(){return _0x5c4fe4;});})[_0x3f16('0x25')](function(){_0x559a78[_0x3f16('0x1c')](0xcc)[_0x3f16('0x1b')]();});}};}function handleEntityNotFound(_0xfe2506,_0xf3636a){return function(_0x3d6ddd){if(!_0x3d6ddd){_0xfe2506[_0x3f16('0x1a')](0x194);}return _0x3d6ddd;};}function handleError(_0x5c93c6,_0x6f8eb){_0x6f8eb=_0x6f8eb||0x1f4;return function(_0xb90034){logger['error'](_0xb90034['stack']);if(_0xb90034[_0x3f16('0x29')]){delete _0xb90034[_0x3f16('0x29')];}_0x5c93c6['status'](_0x6f8eb)['send'](_0xb90034);};}exports[_0x3f16('0x2a')]=function(_0x3048d4,_0x52a045){var _0x52fcbd={},_0x478696={},_0x3df48e={'count':0x0,'rows':[]};var _0xf1c937=_[_0x3f16('0x2b')](db[_0x3f16('0x2c')][_0x3f16('0x2d')],function(_0x5ad909){return{'name':_0x5ad909[_0x3f16('0x2e')],'type':_0x5ad909[_0x3f16('0x2f')][_0x3f16('0x30')]};});_0x478696[_0x3f16('0x31')]=_[_0x3f16('0x2b')](_0xf1c937,_0x3f16('0x29'));_0x478696[_0x3f16('0x32')]=_[_0x3f16('0x33')](_0x3048d4[_0x3f16('0x32')]);_0x478696['filters']=_['intersection'](_0x478696[_0x3f16('0x31')],_0x478696[_0x3f16('0x32')]);_0x52fcbd['attributes']=_[_0x3f16('0x34')](_0x478696[_0x3f16('0x31')],qs[_0x3f16('0x35')](_0x3048d4[_0x3f16('0x32')][_0x3f16('0x35')]));_0x52fcbd[_0x3f16('0x36')]=_0x52fcbd['attributes'][_0x3f16('0x37')]?_0x52fcbd[_0x3f16('0x36')]:_0x478696[_0x3f16('0x31')];if(!_0x3048d4[_0x3f16('0x32')][_0x3f16('0x38')](_0x3f16('0x39'))){_0x52fcbd[_0x3f16('0x1f')]=qs[_0x3f16('0x1f')](_0x3048d4[_0x3f16('0x32')][_0x3f16('0x1f')]);_0x52fcbd[_0x3f16('0x1d')]=qs[_0x3f16('0x1d')](_0x3048d4['query'][_0x3f16('0x1d')]);}_0x52fcbd[_0x3f16('0x3a')]=qs[_0x3f16('0x3b')](_0x3048d4[_0x3f16('0x32')][_0x3f16('0x3b')]);_0x52fcbd[_0x3f16('0x3c')]=qs[_0x3f16('0x3d')](_[_0x3f16('0x3e')](_0x3048d4['query'],_0x478696[_0x3f16('0x3d')]),_0xf1c937);if(_0x3048d4[_0x3f16('0x32')][_0x3f16('0x3f')]){_0x52fcbd[_0x3f16('0x3c')]=_[_0x3f16('0x40')](_0x52fcbd['where'],{'$or':_[_0x3f16('0x2b')](_0xf1c937,function(_0x3c20c3){if(_0x3c20c3[_0x3f16('0x2f')]!==_0x3f16('0x41')){var _0x5876e7={};_0x5876e7[_0x3c20c3[_0x3f16('0x29')]]={'$like':'%'+_0x3048d4[_0x3f16('0x32')][_0x3f16('0x3f')]+'%'};return _0x5876e7;}})});}_0x52fcbd=_[_0x3f16('0x40')]({},_0x52fcbd,_0x3048d4['options']);var _0x4ad275={'where':_0x52fcbd[_0x3f16('0x3c')]};return db[_0x3f16('0x2c')][_0x3f16('0x20')](_0x4ad275)[_0x3f16('0x25')](function(_0x37c5d8){_0x3df48e[_0x3f16('0x20')]=_0x37c5d8;if(_0x3048d4[_0x3f16('0x32')]['includeAll']){_0x52fcbd[_0x3f16('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x3f16('0x43')](_0x52fcbd);})[_0x3f16('0x25')](function(_0x3d1403){_0x3df48e[_0x3f16('0x44')]=_0x3d1403;return _0x3df48e;})[_0x3f16('0x25')](respondWithFilteredResult(_0x52a045,_0x52fcbd))['catch'](handleError(_0x52a045,null));};exports[_0x3f16('0x45')]=function(_0x3a65bc,_0x18bf96){var _0x198c68={'raw':!![],'where':{'id':_0x3a65bc['params']['id']}},_0x2c2909={};_0x2c2909[_0x3f16('0x31')]=_[_0x3f16('0x33')](db[_0x3f16('0x2c')]['rawAttributes']);_0x2c2909['query']=_[_0x3f16('0x33')](_0x3a65bc['query']);_0x2c2909[_0x3f16('0x3d')]=_[_0x3f16('0x34')](_0x2c2909[_0x3f16('0x31')],_0x2c2909[_0x3f16('0x32')]);_0x198c68['attributes']=_[_0x3f16('0x34')](_0x2c2909['model'],qs[_0x3f16('0x35')](_0x3a65bc['query'][_0x3f16('0x35')]));_0x198c68[_0x3f16('0x36')]=_0x198c68['attributes']['length']?_0x198c68[_0x3f16('0x36')]:_0x2c2909[_0x3f16('0x31')];if(_0x3a65bc[_0x3f16('0x32')]['includeAll']){_0x198c68[_0x3f16('0x42')]=[{'all':!![]}];}_0x198c68=_[_0x3f16('0x40')]({},_0x198c68,_0x3a65bc[_0x3f16('0x46')]);return db[_0x3f16('0x2c')][_0x3f16('0x47')](_0x198c68)['then'](handleEntityNotFound(_0x18bf96,null))[_0x3f16('0x25')](respondWithResult(_0x18bf96,null))['catch'](handleError(_0x18bf96,null));};exports['create']=function(_0x59d583,_0x4970a7){return db[_0x3f16('0x2c')][_0x3f16('0x48')](_0x59d583['body'],{})['then'](function(_0x1bafd5){var _0x2f9e3e=_0x59d583[_0x3f16('0x49')][_0x3f16('0x26')]({'plain':!![]});if(!_0x2f9e3e)throw new Error(_0x3f16('0x4a'));if(_0x2f9e3e['role']===_0x3f16('0x49')){var _0x316c1d=_0x1bafd5[_0x3f16('0x26')]({'plain':!![]});var _0x4c9d6e=_0x3f16('0x27');return db[_0x3f16('0x4b')][_0x3f16('0x47')]({'where':{'name':_0x4c9d6e,'userProfileId':_0x2f9e3e['userProfileId']},'raw':!![]})[_0x3f16('0x25')](function(_0x439da3){if(_0x439da3&&_0x439da3[_0x3f16('0x4c')]===0x0){return db[_0x3f16('0x28')][_0x3f16('0x48')]({'name':_0x316c1d[_0x3f16('0x29')],'resourceId':_0x316c1d['id'],'type':_0x439da3['name'],'sectionId':_0x439da3['id']},{})[_0x3f16('0x25')](function(){return _0x1bafd5;});}else{return _0x1bafd5;}})[_0x3f16('0x4d')](function(_0xcd59ad){logger['error'](_0x3f16('0x4e'),_0xcd59ad);throw _0xcd59ad;});}return _0x1bafd5;})[_0x3f16('0x25')](respondWithResult(_0x4970a7,0xc9))['catch'](handleError(_0x4970a7,null));};exports['update']=function(_0x403307,_0x2991ab){if(_0x403307[_0x3f16('0x4f')]['id']){delete _0x403307[_0x3f16('0x4f')]['id'];}return db['Disposition'][_0x3f16('0x47')]({'where':{'id':_0x403307[_0x3f16('0x50')]['id']}})[_0x3f16('0x25')](handleEntityNotFound(_0x2991ab,null))[_0x3f16('0x25')](saveUpdates(_0x403307[_0x3f16('0x4f')],null))[_0x3f16('0x25')](respondWithResult(_0x2991ab,null))[_0x3f16('0x4d')](handleError(_0x2991ab,null));};exports['destroy']=function(_0x3e0f0c,_0x8ff73b){return db['Disposition'][_0x3f16('0x47')]({'where':{'id':_0x3e0f0c[_0x3f16('0x50')]['id']}})['then'](handleEntityNotFound(_0x8ff73b,null))['then'](removeEntity(_0x8ff73b,null))['catch'](handleError(_0x8ff73b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 4512f8f..9d42d9e 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 _0x86a0=['ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x86a0,0x91));var _0x086a=function(_0x197d78,_0x1bd130){_0x197d78=_0x197d78-0x0;var _0x5808c1=_0x86a0[_0x197d78];return _0x5808c1;};'use strict';var _=require('lodash');var util=require(_0x086a('0x0'));var logger=require(_0x086a('0x1'))(_0x086a('0x2'));var moment=require('moment');var BPromise=require(_0x086a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x086a('0x4'));var rimraf=require(_0x086a('0x5'));var config=require(_0x086a('0x6'));var attributes=require(_0x086a('0x7'));module[_0x086a('0x8')]=function(_0x583da8,_0x40b689){return _0x583da8[_0x086a('0x9')](_0x086a('0xa'),attributes,{'tableName':_0x086a('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x086a('0xc'),'fields':['name',_0x086a('0xd')]},{'unique':!![],'name':_0x086a('0xe'),'fields':[_0x086a('0xf'),_0x086a('0x10')]},{'unique':!![],'name':'name_mail','fields':['name',_0x086a('0x11')]},{'unique':!![],'name':_0x086a('0x12'),'fields':[_0x086a('0xf'),'SmsAccountId']},{'unique':!![],'name':_0x086a('0x13'),'fields':[_0x086a('0xf'),_0x086a('0x14')]},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x086a('0x15'),'fields':[_0x086a('0xf'),_0x086a('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e09=['name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions'];(function(_0x5c1763,_0x58f55a){var _0x539e73=function(_0x5e22ad){while(--_0x5e22ad){_0x5c1763['push'](_0x5c1763['shift']());}};_0x539e73(++_0x58f55a);}(_0x9e09,0xa4));var _0x99e0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9e09[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x99e0('0x0'));var util=require(_0x99e0('0x1'));var logger=require('../../config/logger')(_0x99e0('0x2'));var moment=require(_0x99e0('0x3'));var BPromise=require(_0x99e0('0x4'));var rp=require(_0x99e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x99e0('0x6'));var attributes=require(_0x99e0('0x7'));module[_0x99e0('0x8')]=function(_0x4bc958,_0x40c9b2){return _0x4bc958[_0x99e0('0x9')](_0x99e0('0xa'),attributes,{'tableName':_0x99e0('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':_0x99e0('0xc'),'fields':[_0x99e0('0xd'),_0x99e0('0xe')]},{'unique':!![],'name':_0x99e0('0xf'),'fields':['name',_0x99e0('0x10')]},{'unique':!![],'name':'name_sms','fields':['name','SmsAccountId']},{'unique':!![],'name':_0x99e0('0x11'),'fields':[_0x99e0('0xd'),_0x99e0('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x99e0('0xd'),_0x99e0('0x13')]},{'unique':!![],'name':_0x99e0('0x14'),'fields':[_0x99e0('0xd'),_0x99e0('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index eb6801b..75bd500 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(_0x4189bf,_0x1b9a27){var _0x3da2c5=function(_0x35670b){while(--_0x35670b){_0x4189bf['push'](_0x4189bf['shift']());}};_0x3da2c5(++_0x1b9a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x2688ea,_0x38cf77){var _0xd92357=function(_0x412d62){while(--_0x412d62){_0x2688ea['push'](_0x2688ea['shift']());}};_0xd92357(++_0x38cf77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 aab0aea..169ab58 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 _0x5625=['get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./disposition.controller'];(function(_0x3de840,_0x25db42){var _0x99b05e=function(_0x4dcc81){while(--_0x4dcc81){_0x3de840['push'](_0x3de840['shift']());}};_0x99b05e(++_0x25db42);}(_0x5625,0x110));var _0x5562=function(_0x3a7e58,_0x5ad8de){_0x3a7e58=_0x3a7e58-0x0;var _0x42f274=_0x5625[_0x3a7e58];return _0x42f274;};'use strict';var multer=require(_0x5562('0x0'));var util=require(_0x5562('0x1'));var path=require('path');var timeout=require(_0x5562('0x2'));var express=require(_0x5562('0x3'));var router=express[_0x5562('0x4')]();var fs_extra=require(_0x5562('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5562('0x6'));var controller=require(_0x5562('0x7'));router[_0x5562('0x8')]('/',auth['isAuthenticated'](),controller[_0x5562('0x9')]);router[_0x5562('0x8')](_0x5562('0xa'),auth['isAuthenticated'](),controller[_0x5562('0xb')]);router[_0x5562('0xc')]('/',auth[_0x5562('0xd')](),controller[_0x5562('0xe')]);router[_0x5562('0xf')](_0x5562('0xa'),auth[_0x5562('0xd')](),controller[_0x5562('0x10')]);router[_0x5562('0x11')]('/:id',auth[_0x5562('0xd')](),controller[_0x5562('0x12')]);module[_0x5562('0x13')]=router; \ No newline at end of file +var _0xe318=['post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x5061a9,_0x41a3f2){var _0x351bf3=function(_0x208378){while(--_0x208378){_0x5061a9['push'](_0x5061a9['shift']());}};_0x351bf3(++_0x41a3f2);}(_0xe318,0x181));var _0x8e31=function(_0x34a3fe,_0x5350b7){_0x34a3fe=_0x34a3fe-0x0;var _0x293a42=_0xe318[_0x34a3fe];return _0x293a42;};'use strict';var multer=require(_0x8e31('0x0'));var util=require(_0x8e31('0x1'));var path=require(_0x8e31('0x2'));var timeout=require(_0x8e31('0x3'));var express=require(_0x8e31('0x4'));var router=express[_0x8e31('0x5')]();var fs_extra=require(_0x8e31('0x6'));var auth=require(_0x8e31('0x7'));var interaction=require(_0x8e31('0x8'));var config=require(_0x8e31('0x9'));var controller=require('./disposition.controller');router['get']('/',auth[_0x8e31('0xa')](),controller[_0x8e31('0xb')]);router[_0x8e31('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8e31('0xd')]);router[_0x8e31('0xe')]('/',auth[_0x8e31('0xa')](),controller[_0x8e31('0xf')]);router[_0x8e31('0x10')](_0x8e31('0x11'),auth[_0x8e31('0xa')](),controller[_0x8e31('0x12')]);router[_0x8e31('0x13')]('/:id',auth[_0x8e31('0xa')](),controller[_0x8e31('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 427fe99..ad61401 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 _0x080a=['2400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400'];(function(_0x372a3d,_0x332395){var _0x3549a8=function(_0x5062b2){while(--_0x5062b2){_0x372a3d['push'](_0x372a3d['shift']());}};_0x3549a8(++_0x332395);}(_0x080a,0x146));var _0xa080=function(_0x2908d4,_0x1246f0){_0x2908d4=_0x2908d4-0x0;var _0x2e8b94=_0x080a[_0x2908d4];return _0x2e8b94;};'use strict';var Sequelize=require(_0xa080('0x0'));module[_0xa080('0x1')]={'name':{'type':Sequelize[_0xa080('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa080('0x2')]},'ecm':{'type':Sequelize[_0xa080('0x3')](_0xa080('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xa080('0x2')],'defaultValue':_0xa080('0x5')},'localstationid':{'type':Sequelize[_0xa080('0x2')],'unique':_0xa080('0x6')},'minrate':{'type':Sequelize[_0xa080('0x3')]('2400',_0xa080('0x7'),_0xa080('0x8'),_0xa080('0x9'),_0xa080('0xa'),_0xa080('0xb')),'defaultValue':_0xa080('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xa080('0xc'),'4800',_0xa080('0x8'),_0xa080('0x9'),_0xa080('0xa'),_0xa080('0xb')),'defaultValue':_0xa080('0xb')},'modem':{'type':Sequelize[_0xa080('0x2')],'defaultValue':_0xa080('0xd')},'gateway':{'type':Sequelize[_0xa080('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa080('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa080('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa080('0x3')](_0xa080('0xf'),'IAX',_0xa080('0x10'),_0xa080('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xa080('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa080('0x12')],'defaultValue':function(){return _0xa080('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa080('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa080('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa080('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa080('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa080('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa080('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xa080('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xa080('0x14')],'defaultValue':![],'comment':_0xa080('0x16'),'set':function(_0x470460){if(!_0x470460)this[_0xa080('0x17')](_0xa080('0x18'),null);this[_0xa080('0x17')](_0xa080('0x19'),_0x470460);}}}; \ No newline at end of file +var _0xc501=['DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc501,0x85));var _0x1c50=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0xc501[_0x22dac7];return _0x3e6cfa;};'use strict';var Sequelize=require('sequelize');module[_0x1c50('0x0')]={'name':{'type':Sequelize[_0x1c50('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1c50('0x1')]},'ecm':{'type':Sequelize[_0x1c50('0x2')](_0x1c50('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x1c50('0x1')],'defaultValue':_0x1c50('0x4')},'localstationid':{'type':Sequelize[_0x1c50('0x1')],'unique':_0x1c50('0x5')},'minrate':{'type':Sequelize[_0x1c50('0x2')](_0x1c50('0x6'),'4800',_0x1c50('0x7'),_0x1c50('0x8'),_0x1c50('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x1c50('0x6'),'4800',_0x1c50('0x7'),_0x1c50('0x8'),'12000',_0x1c50('0xa')),'defaultValue':_0x1c50('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x1c50('0xb')},'gateway':{'type':Sequelize[_0x1c50('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1c50('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1c50('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1c50('0x2')](_0x1c50('0xd'),'IAX',_0x1c50('0xe'),_0x1c50('0xf')),'defaultValue':_0x1c50('0xd')},'key':{'type':Sequelize[_0x1c50('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1c50('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1c50('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1c50('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1c50('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1c50('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1c50('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1c50('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1c50('0x11')],'defaultValue':![],'comment':_0x1c50('0x12'),'set':function(_0x40484c){if(!_0x40484c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x1c50('0x13')](_0x1c50('0x14'),_0x40484c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c16e9ea..80adf63 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 _0xa426=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','order','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','defaults','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','userFaxAccount:remove','getAgents','eml-format','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','update','destroy','then','get','FaxAccounts','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource'];(function(_0x69d91e,_0x12fec6){var _0x381436=function(_0x9a01a0){while(--_0x9a01a0){_0x69d91e['push'](_0x69d91e['shift']());}};_0x381436(++_0x12fec6);}(_0xa426,0x123));var _0x6a42=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa426[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0x6a42('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6a42('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a42('0x2'));var util=require(_0x6a42('0x3'));var path=require('path');var sox=require(_0x6a42('0x4'));var csv=require(_0x6a42('0x5'));var ejs=require(_0x6a42('0x6'));var fs=require('fs');var fs_extra=require(_0x6a42('0x7'));var _=require('lodash');var squel=require(_0x6a42('0x8'));var crypto=require(_0x6a42('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6a42('0xa'));var toCsv=require(_0x6a42('0x5'));var querystring=require(_0x6a42('0xb'));var Papa=require(_0x6a42('0xc'));var Redis=require(_0x6a42('0xd'));var authService=require(_0x6a42('0xe'));var qs=require(_0x6a42('0xf'));var as=require(_0x6a42('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a42('0x11'))(_0x6a42('0x12'));var utils=require(_0x6a42('0x13'));var config=require(_0x6a42('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a42('0x15'))['db'];config[_0x6a42('0x16')]=_['defaults'](config['redis'],{'host':_0x6a42('0x17'),'port':0x18eb});var socket=require(_0x6a42('0x18'))(new Redis(config[_0x6a42('0x16')]));require(_0x6a42('0x19'))['register'](socket);var jayson=require(_0x6a42('0x1a'));var client=jayson[_0x6a42('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6a42('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2e9287,_0x38b50a,_0x416070,_0x3d1205){return new BPromise(function(_0x1a296f,_0xa1bebf){var _0x137ea5=_0x3d1205||client;return _0x137ea5[_0x6a42('0x1d')](_0x2e9287,_0x416070)['then'](function(_0x27146c){logger[_0x6a42('0x1e')](_0x6a42('0x1f'),_0x38b50a,_0x6a42('0x20'));logger[_0x6a42('0x21')](_0x6a42('0x22'),_0x38b50a,_0x6a42('0x20'),JSON['stringify'](_0x27146c));if(_0x27146c[_0x6a42('0x23')]){if(_0x27146c[_0x6a42('0x23')][_0x6a42('0x24')]===0x1f4){logger[_0x6a42('0x23')](_0x6a42('0x1f'),_0x38b50a,_0x27146c[_0x6a42('0x23')]['message']);return _0xa1bebf(_0x27146c[_0x6a42('0x23')]['message']);}logger[_0x6a42('0x23')](_0x6a42('0x1f'),_0x38b50a,_0x27146c['error'][_0x6a42('0x25')]);return _0x1a296f(_0x27146c[_0x6a42('0x23')][_0x6a42('0x25')]);}else{logger[_0x6a42('0x1e')](_0x6a42('0x1f'),_0x38b50a,'request\x20sent');_0x1a296f(_0x27146c[_0x6a42('0x26')][_0x6a42('0x25')]);}})[_0x6a42('0x27')](function(_0x1cf8a6){logger[_0x6a42('0x23')](_0x6a42('0x1f'),_0x38b50a,_0x1cf8a6);_0xa1bebf(_0x1cf8a6);});});}function respondWithStatusCode(_0xe44ff1,_0x16aa8c){_0x16aa8c=_0x16aa8c||0xcc;return function(_0x2caf9c){if(_0x2caf9c){return _0xe44ff1[_0x6a42('0x28')](_0x16aa8c);}return _0xe44ff1[_0x6a42('0x29')](_0x16aa8c)[_0x6a42('0x2a')]();};}function respondWithResult(_0x382c56,_0x53c532){_0x53c532=_0x53c532||0xc8;return function(_0x3b1ab3){if(_0x3b1ab3){return _0x382c56[_0x6a42('0x29')](_0x53c532)['json'](_0x3b1ab3);}};}function respondWithFilteredResult(_0xf6de71,_0x26ec47){return function(_0x3b4c47){if(_0x3b4c47){var _0x4b4f40=typeof _0x26ec47[_0x6a42('0x2b')]===_0x6a42('0x2c')&&typeof _0x26ec47['limit']===_0x6a42('0x2c');var _0x78372b=_0x3b4c47['count'];var _0x535391=_0x4b4f40?0x0:_0x26ec47['offset'];var _0x3950d2=_0x4b4f40?_0x3b4c47[_0x6a42('0x2d')]:_0x26ec47[_0x6a42('0x2b')]+_0x26ec47['limit'];var _0x11d16c;if(_0x3950d2>=_0x78372b){_0x3950d2=_0x78372b;_0x11d16c=0xc8;}else{_0x11d16c=0xce;}_0xf6de71[_0x6a42('0x29')](_0x11d16c);return _0xf6de71[_0x6a42('0x2e')](_0x6a42('0x2f'),_0x535391+'-'+_0x3950d2+'/'+_0x78372b)[_0x6a42('0x30')](_0x3b4c47);}return null;};}function patchUpdates(_0x37a957){return function(_0x3d7c45){try{jsonpatch[_0x6a42('0x31')](_0x3d7c45,_0x37a957,!![]);}catch(_0x326b55){return BPromise['reject'](_0x326b55);}return _0x3d7c45['save']();};}function saveUpdates(_0x2ebb53,_0x3bb8c0){return function(_0x18f1d7){if(_0x18f1d7){return _0x18f1d7[_0x6a42('0x32')](_0x2ebb53)['then'](function(_0x3dd9d5){return _0x3dd9d5;});}return null;};}function removeEntity(_0x3caa39,_0x4ee42d){return function(_0x21f542){if(_0x21f542){return _0x21f542[_0x6a42('0x33')]()[_0x6a42('0x34')](function(){var _0x2aed90=_0x21f542[_0x6a42('0x35')]({'plain':!![]});var _0x38b4bf=_0x6a42('0x36');return db['UserProfileResource'][_0x6a42('0x33')]({'where':{'type':_0x38b4bf,'resourceId':_0x2aed90['id']}})[_0x6a42('0x34')](function(){return _0x21f542;});})['then'](function(){_0x3caa39['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a929,_0x28f91b){return function(_0x2e5a0c){if(!_0x2e5a0c){_0x59a929[_0x6a42('0x28')](0x194);}return _0x2e5a0c;};}function handleError(_0xfd5fe6,_0x2e38cf){_0x2e38cf=_0x2e38cf||0x1f4;return function(_0x516d4d){logger[_0x6a42('0x23')](_0x516d4d[_0x6a42('0x37')]);if(_0x516d4d[_0x6a42('0x38')]){delete _0x516d4d[_0x6a42('0x38')];}_0xfd5fe6[_0x6a42('0x29')](_0x2e38cf)[_0x6a42('0x39')](_0x516d4d);};}exports[_0x6a42('0x3a')]=function(_0x504acd,_0xc80c89){var _0xceb80b={'include':[{'model':db['Pause'],'as':_0x6a42('0x3b')}]},_0x4645c2={},_0x228acf={'count':0x0,'rows':[]};var _0x5dd7b5=_[_0x6a42('0x3c')](db[_0x6a42('0x3d')][_0x6a42('0x3e')],function(_0x3f563c){return{'name':_0x3f563c['fieldName'],'type':_0x3f563c[_0x6a42('0x3f')][_0x6a42('0x40')]};});_0x4645c2['model']=_[_0x6a42('0x3c')](_0x5dd7b5,'name');_0x4645c2['query']=_[_0x6a42('0x41')](_0x504acd['query']);_0x4645c2[_0x6a42('0x42')]=_['intersection'](_0x4645c2[_0x6a42('0x43')],_0x4645c2[_0x6a42('0x44')]);_0xceb80b[_0x6a42('0x45')]=_[_0x6a42('0x46')](_0x4645c2[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x504acd[_0x6a42('0x44')][_0x6a42('0x47')]));_0xceb80b[_0x6a42('0x45')]=_0xceb80b['attributes'][_0x6a42('0x48')]?_0xceb80b['attributes']:_0x4645c2[_0x6a42('0x43')];if(!_0x504acd[_0x6a42('0x44')][_0x6a42('0x49')](_0x6a42('0x4a'))){_0xceb80b[_0x6a42('0x4b')]=qs['limit'](_0x504acd[_0x6a42('0x44')][_0x6a42('0x4b')]);_0xceb80b['offset']=qs[_0x6a42('0x2b')](_0x504acd[_0x6a42('0x44')][_0x6a42('0x2b')]);}_0xceb80b['order']=qs[_0x6a42('0x4c')](_0x504acd[_0x6a42('0x44')][_0x6a42('0x4c')]);_0xceb80b[_0x6a42('0x4d')]=qs[_0x6a42('0x42')](_['pick'](_0x504acd[_0x6a42('0x44')],_0x4645c2[_0x6a42('0x42')]),_0x5dd7b5);if(_0x504acd[_0x6a42('0x44')][_0x6a42('0x4e')]){_0xceb80b[_0x6a42('0x4d')]=_[_0x6a42('0x4f')](_0xceb80b[_0x6a42('0x4d')],{'$or':_[_0x6a42('0x3c')](_0x5dd7b5,function(_0x31b6c5){if(_0x31b6c5[_0x6a42('0x3f')]!==_0x6a42('0x50')){var _0x18eb77={};_0x18eb77[_0x31b6c5['name']]={'$like':'%'+_0x504acd[_0x6a42('0x44')]['filter']+'%'};return _0x18eb77;}})});}_0xceb80b=_[_0x6a42('0x4f')]({},_0xceb80b,_0x504acd[_0x6a42('0x51')]);var _0x28a779={'where':_0xceb80b['where']};return db[_0x6a42('0x3d')][_0x6a42('0x2d')](_0x28a779)[_0x6a42('0x34')](function(_0x47cd64){_0x228acf[_0x6a42('0x2d')]=_0x47cd64;if(_0x504acd[_0x6a42('0x44')][_0x6a42('0x52')]){_0xceb80b[_0x6a42('0x53')]=[{'all':!![]}];}return db[_0x6a42('0x3d')]['findAll'](_0xceb80b);})[_0x6a42('0x34')](function(_0x245f80){_0x228acf[_0x6a42('0x54')]=_0x245f80;return _0x228acf;})['then'](respondWithFilteredResult(_0xc80c89,_0xceb80b))[_0x6a42('0x27')](handleError(_0xc80c89,null));};exports[_0x6a42('0x55')]=function(_0x1798bb,_0x41d374){var _0x550d07={'raw':![],'where':{'id':_0x1798bb[_0x6a42('0x56')]['id']},'include':[{'model':db[_0x6a42('0x57')],'as':_0x6a42('0x3b')}]},_0x527ddf={};_0x527ddf[_0x6a42('0x43')]=_[_0x6a42('0x41')](db[_0x6a42('0x3d')][_0x6a42('0x3e')]);_0x527ddf['query']=_[_0x6a42('0x41')](_0x1798bb[_0x6a42('0x44')]);_0x527ddf[_0x6a42('0x42')]=_['intersection'](_0x527ddf['model'],_0x527ddf['query']);_0x550d07[_0x6a42('0x45')]=_['intersection'](_0x527ddf[_0x6a42('0x43')],qs['fields'](_0x1798bb[_0x6a42('0x44')][_0x6a42('0x47')]));_0x550d07[_0x6a42('0x45')]=_0x550d07['attributes']['length']?_0x550d07[_0x6a42('0x45')]:_0x527ddf['model'];if(_0x1798bb[_0x6a42('0x44')][_0x6a42('0x52')]){_0x550d07[_0x6a42('0x53')]=[{'all':!![]}];}_0x550d07=_[_0x6a42('0x4f')]({},_0x550d07,_0x1798bb[_0x6a42('0x51')]);return db[_0x6a42('0x3d')][_0x6a42('0x58')](_0x550d07)[_0x6a42('0x34')](handleEntityNotFound(_0x41d374,null))[_0x6a42('0x34')](respondWithResult(_0x41d374,null))['catch'](handleError(_0x41d374,null));};exports[_0x6a42('0x59')]=function(_0x4e3357,_0x3fadd5){return db[_0x6a42('0x3d')][_0x6a42('0x59')](_0x4e3357[_0x6a42('0x5a')],{})['then'](function(_0x4d7eb5){var _0x2c0f6c=_0x4e3357[_0x6a42('0x5b')][_0x6a42('0x35')]({'plain':!![]});if(!_0x2c0f6c)throw new Error(_0x6a42('0x5c'));if(_0x2c0f6c[_0x6a42('0x5d')]===_0x6a42('0x5b')){var _0xa47243=_0x4d7eb5[_0x6a42('0x35')]({'plain':!![]});var _0xaf1a77=_0x6a42('0x36');return db[_0x6a42('0x5e')]['find']({'where':{'name':_0xaf1a77,'userProfileId':_0x2c0f6c[_0x6a42('0x5f')]},'raw':!![]})[_0x6a42('0x34')](function(_0x54afc2){if(_0x54afc2&&_0x54afc2['autoAssociation']===0x0){return db[_0x6a42('0x60')][_0x6a42('0x59')]({'name':_0xa47243['name'],'resourceId':_0xa47243['id'],'type':_0x54afc2[_0x6a42('0x38')],'sectionId':_0x54afc2['id']},{})[_0x6a42('0x34')](function(){return _0x4d7eb5;});}else{return _0x4d7eb5;}})['catch'](function(_0x1bd2c8){logger[_0x6a42('0x23')](_0x6a42('0x61'),_0x1bd2c8);throw _0x1bd2c8;});}return _0x4d7eb5;})[_0x6a42('0x34')](respondWithResult(_0x3fadd5,0xc9))[_0x6a42('0x27')](handleError(_0x3fadd5,null));};exports[_0x6a42('0x32')]=function(_0x24205f,_0x2bae7d){if(_0x24205f['body']['id']){delete _0x24205f[_0x6a42('0x5a')]['id'];}return db[_0x6a42('0x3d')]['find']({'where':{'id':_0x24205f[_0x6a42('0x56')]['id']},'include':[{'model':db[_0x6a42('0x57')],'as':_0x6a42('0x3b')}]})[_0x6a42('0x34')](handleEntityNotFound(_0x2bae7d,null))[_0x6a42('0x34')](saveUpdates(_0x24205f[_0x6a42('0x5a')],null))[_0x6a42('0x34')](respondWithResult(_0x2bae7d,null))['catch'](handleError(_0x2bae7d,null));};exports[_0x6a42('0x33')]=function(_0x1d45f8,_0x361ec0){return db[_0x6a42('0x3d')][_0x6a42('0x58')]({'where':{'id':_0x1d45f8[_0x6a42('0x56')]['id']}})['then'](handleEntityNotFound(_0x361ec0,null))[_0x6a42('0x34')](removeEntity(_0x361ec0,null))[_0x6a42('0x27')](handleError(_0x361ec0,null));};exports[_0x6a42('0x62')]=function(_0x180280,_0x60d4d5){return db[_0x6a42('0x3d')][_0x6a42('0x62')]()[_0x6a42('0x34')](respondWithResult(_0x60d4d5,null))['catch'](handleError(_0x60d4d5,null));};exports[_0x6a42('0x63')]=function(_0x5d0cc2,_0x163ec3,_0x1aad31){if(_0x5d0cc2[_0x6a42('0x5a')]['id']){delete _0x5d0cc2[_0x6a42('0x5a')]['id'];}return db['FaxAccount'][_0x6a42('0x58')]({'where':{'id':_0x5d0cc2[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x163ec3,null))[_0x6a42('0x34')](function(_0x5ab71a){if(_0x5ab71a){_0x5d0cc2[_0x6a42('0x5a')][_0x6a42('0x64')]=_0x5ab71a['id'];return db[_0x6a42('0x65')][_0x6a42('0x59')](_0x5d0cc2['body']);}})['then'](respondWithResult(_0x163ec3,null))[_0x6a42('0x27')](handleError(_0x163ec3,null));};exports['getDispositions']=function(_0x22c1d0,_0x31cba3,_0x53a4c3){var _0x1b52d3={'raw':![],'where':{}};var _0x4ceb25={};var _0x44abcb={'count':0x0,'rows':[]};return db[_0x6a42('0x3d')][_0x6a42('0x66')]({'where':{'id':_0x22c1d0['params']['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x31cba3,null))[_0x6a42('0x34')](function(_0x42e08b){if(_0x42e08b){_0x4ceb25[_0x6a42('0x43')]=_[_0x6a42('0x41')](db[_0x6a42('0x65')]['rawAttributes']);_0x4ceb25[_0x6a42('0x44')]=_[_0x6a42('0x41')](_0x22c1d0[_0x6a42('0x44')]);_0x4ceb25[_0x6a42('0x42')]=_[_0x6a42('0x46')](_0x4ceb25[_0x6a42('0x43')],_0x4ceb25[_0x6a42('0x44')]);_0x1b52d3['attributes']=_[_0x6a42('0x46')](_0x4ceb25[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x47')]));_0x1b52d3[_0x6a42('0x45')]=_0x1b52d3[_0x6a42('0x45')][_0x6a42('0x48')]?_0x1b52d3[_0x6a42('0x45')]:_0x4ceb25[_0x6a42('0x43')];if(!_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x49')]('nolimit')){_0x1b52d3['limit']=qs['limit'](_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x4b')]);_0x1b52d3['offset']=qs['offset'](_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x2b')]);}_0x1b52d3[_0x6a42('0x67')]=qs['sort'](_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x4c')]);_0x1b52d3[_0x6a42('0x4d')]=qs[_0x6a42('0x42')](_[_0x6a42('0x68')](_0x22c1d0[_0x6a42('0x44')],_0x4ceb25[_0x6a42('0x42')]));_0x1b52d3['where'][_0x6a42('0x64')]=_0x42e08b['id'];if(_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x4e')]){_0x1b52d3[_0x6a42('0x4d')]=_[_0x6a42('0x4f')](_0x1b52d3['where'],{'$or':_[_0x6a42('0x3c')](_0x1b52d3[_0x6a42('0x45')],function(_0x2d607a){var _0x11b7c9={};_0x11b7c9[_0x2d607a]={'$like':'%'+_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x4e')]+'%'};return _0x11b7c9;})});}_0x1b52d3=_[_0x6a42('0x4f')]({},_0x1b52d3,_0x22c1d0[_0x6a42('0x51')]);return db[_0x6a42('0x65')][_0x6a42('0x2d')]({'where':_0x1b52d3[_0x6a42('0x4d')]})[_0x6a42('0x34')](function(_0x581ab0){_0x44abcb[_0x6a42('0x2d')]=_0x581ab0;if(_0x22c1d0[_0x6a42('0x44')][_0x6a42('0x52')]){_0x1b52d3[_0x6a42('0x53')]=[{'all':!![]}];}return db[_0x6a42('0x65')][_0x6a42('0x69')](_0x1b52d3);})[_0x6a42('0x34')](function(_0x2de132){_0x44abcb[_0x6a42('0x54')]=_0x2de132;return _0x44abcb;});}})['then'](respondWithFilteredResult(_0x31cba3,_0x1b52d3))[_0x6a42('0x27')](handleError(_0x31cba3,null));};exports[_0x6a42('0x6a')]=function(_0x55bcb4,_0x34c2ed,_0x454299){return db['FaxAccount'][_0x6a42('0x58')]({'where':{'id':_0x55bcb4['params']['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x34c2ed,null))[_0x6a42('0x34')](function(_0xe53b83){if(_0xe53b83){return _0xe53b83['removeDispositions'](_0x55bcb4['query'][_0x6a42('0x6b')]);}})[_0x6a42('0x34')](respondWithStatusCode(_0x34c2ed,null))[_0x6a42('0x27')](handleError(_0x34c2ed,null));};exports[_0x6a42('0x6c')]=function(_0x44644d,_0x1c9b4d,_0x463669){if(_0x44644d[_0x6a42('0x5a')]['id']){delete _0x44644d['body']['id'];}return db['FaxAccount'][_0x6a42('0x58')]({'where':{'id':_0x44644d[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x1c9b4d,null))[_0x6a42('0x34')](function(_0x45f7c9){if(_0x45f7c9){_0x44644d['body'][_0x6a42('0x64')]=_0x45f7c9['id'];return db[_0x6a42('0x6d')][_0x6a42('0x59')](_0x44644d[_0x6a42('0x5a')]);}})[_0x6a42('0x34')](respondWithResult(_0x1c9b4d,null))[_0x6a42('0x27')](handleError(_0x1c9b4d,null));};exports[_0x6a42('0x6e')]=function(_0x352c50,_0x55c5a4,_0x2dc955){var _0x4989f7={'raw':![],'where':{}};var _0x446ebd={};var _0x176464={'count':0x0,'rows':[]};return db[_0x6a42('0x3d')][_0x6a42('0x66')]({'where':{'id':_0x352c50[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x55c5a4,null))[_0x6a42('0x34')](function(_0x5c8752){if(_0x5c8752){_0x446ebd[_0x6a42('0x43')]=_[_0x6a42('0x41')](db['CannedAnswer'][_0x6a42('0x3e')]);_0x446ebd['query']=_[_0x6a42('0x41')](_0x352c50[_0x6a42('0x44')]);_0x446ebd[_0x6a42('0x42')]=_['intersection'](_0x446ebd[_0x6a42('0x43')],_0x446ebd[_0x6a42('0x44')]);_0x4989f7[_0x6a42('0x45')]=_['intersection'](_0x446ebd[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x352c50['query'][_0x6a42('0x47')]));_0x4989f7[_0x6a42('0x45')]=_0x4989f7[_0x6a42('0x45')]['length']?_0x4989f7[_0x6a42('0x45')]:_0x446ebd[_0x6a42('0x43')];if(!_0x352c50[_0x6a42('0x44')][_0x6a42('0x49')]('nolimit')){_0x4989f7[_0x6a42('0x4b')]=qs['limit'](_0x352c50[_0x6a42('0x44')]['limit']);_0x4989f7[_0x6a42('0x2b')]=qs['offset'](_0x352c50[_0x6a42('0x44')]['offset']);}_0x4989f7[_0x6a42('0x67')]=qs[_0x6a42('0x4c')](_0x352c50['query']['sort']);_0x4989f7[_0x6a42('0x4d')]=qs['filters'](_[_0x6a42('0x68')](_0x352c50[_0x6a42('0x44')],_0x446ebd['filters']));_0x4989f7[_0x6a42('0x4d')][_0x6a42('0x64')]=_0x5c8752['id'];if(_0x352c50[_0x6a42('0x44')][_0x6a42('0x4e')]){_0x4989f7[_0x6a42('0x4d')]=_['merge'](_0x4989f7['where'],{'$or':_[_0x6a42('0x3c')](_0x4989f7['attributes'],function(_0xe5fd3b){var _0x363b56={};_0x363b56[_0xe5fd3b]={'$like':'%'+_0x352c50[_0x6a42('0x44')]['filter']+'%'};return _0x363b56;})});}_0x4989f7=_[_0x6a42('0x4f')]({},_0x4989f7,_0x352c50['options']);return db['CannedAnswer'][_0x6a42('0x2d')]({'where':_0x4989f7[_0x6a42('0x4d')]})[_0x6a42('0x34')](function(_0x5ccff6){_0x176464[_0x6a42('0x2d')]=_0x5ccff6;if(_0x352c50['query']['includeAll']){_0x4989f7[_0x6a42('0x53')]=[{'all':!![]}];}return db[_0x6a42('0x6d')][_0x6a42('0x69')](_0x4989f7);})[_0x6a42('0x34')](function(_0x1d701a){_0x176464[_0x6a42('0x54')]=_0x1d701a;return _0x176464;});}})[_0x6a42('0x34')](respondWithFilteredResult(_0x55c5a4,_0x4989f7))[_0x6a42('0x27')](handleError(_0x55c5a4,null));};exports[_0x6a42('0x6f')]=function(_0x231e56,_0x57aee5,_0x48dde3){return db['FaxAccount']['find']({'where':{'id':_0x231e56[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x57aee5,null))[_0x6a42('0x34')](function(_0x42419d){if(_0x42419d){return _0x42419d[_0x6a42('0x6f')](_0x231e56[_0x6a42('0x44')][_0x6a42('0x6b')]);}})['then'](respondWithStatusCode(_0x57aee5,null))[_0x6a42('0x27')](handleError(_0x57aee5,null));};exports[_0x6a42('0x70')]=function(_0x290722,_0x469d68,_0x1d804b){return db[_0x6a42('0x71')][_0x6a42('0x58')]({'where':{'id':_0x290722[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x469d68,null))[_0x6a42('0x34')](function(_0xe12813){if(_0xe12813){return _0xe12813[_0x6a42('0x70')](_0x290722[_0x6a42('0x5a')][_0x6a42('0x6b')],_[_0x6a42('0x72')](_0x290722[_0x6a42('0x5a')],[_0x6a42('0x6b'),'id'])||{});}})[_0x6a42('0x34')](respondWithResult(_0x469d68,null))[_0x6a42('0x27')](handleError(_0x469d68,null));};exports[_0x6a42('0x73')]=function(_0x4ab1a5,_0x4afffc,_0x14dc57){var _0x2d7a9b={'raw':![],'where':{}};var _0x502185={};var _0x1e5233={'count':0x0,'rows':[]};return db[_0x6a42('0x3d')][_0x6a42('0x66')]({'where':{'id':_0x4ab1a5[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x4afffc,null))[_0x6a42('0x34')](function(_0x607d35){if(_0x607d35){_0x502185['model']=_[_0x6a42('0x41')](db[_0x6a42('0x71')]['rawAttributes']);_0x502185[_0x6a42('0x44')]=_[_0x6a42('0x41')](_0x4ab1a5[_0x6a42('0x44')]);_0x502185[_0x6a42('0x42')]=_[_0x6a42('0x46')](_0x502185[_0x6a42('0x43')],_0x502185[_0x6a42('0x44')]);_0x2d7a9b[_0x6a42('0x45')]=_[_0x6a42('0x46')](_0x502185[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x4ab1a5['query']['fields']));_0x2d7a9b['attributes']=_0x2d7a9b['attributes'][_0x6a42('0x48')]?_0x2d7a9b[_0x6a42('0x45')]:_0x502185[_0x6a42('0x43')];if(!_0x4ab1a5['query'][_0x6a42('0x49')]('nolimit')){_0x2d7a9b[_0x6a42('0x4b')]=qs[_0x6a42('0x4b')](_0x4ab1a5[_0x6a42('0x44')]['limit']);_0x2d7a9b[_0x6a42('0x2b')]=qs['offset'](_0x4ab1a5[_0x6a42('0x44')][_0x6a42('0x2b')]);}_0x2d7a9b[_0x6a42('0x67')]=qs[_0x6a42('0x4c')](_0x4ab1a5[_0x6a42('0x44')]['sort']);_0x2d7a9b[_0x6a42('0x4d')]=qs[_0x6a42('0x42')](_[_0x6a42('0x68')](_0x4ab1a5[_0x6a42('0x44')],_0x502185[_0x6a42('0x42')]));_0x2d7a9b['where'][_0x6a42('0x64')]=_0x607d35['id'];if(_0x4ab1a5[_0x6a42('0x44')][_0x6a42('0x4e')]){_0x2d7a9b[_0x6a42('0x4d')]=_['merge'](_0x2d7a9b[_0x6a42('0x4d')],{'$or':_['map'](_0x2d7a9b[_0x6a42('0x45')],function(_0x5b3ef3){var _0x11caf9={};_0x11caf9[_0x5b3ef3]={'$like':'%'+_0x4ab1a5[_0x6a42('0x44')][_0x6a42('0x4e')]+'%'};return _0x11caf9;})});}_0x2d7a9b=_[_0x6a42('0x4f')]({},_0x2d7a9b,_0x4ab1a5[_0x6a42('0x51')]);return db['FaxInteraction']['count']({'where':_0x2d7a9b[_0x6a42('0x4d')]})[_0x6a42('0x34')](function(_0x4a83ba){_0x1e5233['count']=_0x4a83ba;if(_0x4ab1a5[_0x6a42('0x44')][_0x6a42('0x52')]){_0x2d7a9b[_0x6a42('0x53')]=[{'model':db[_0x6a42('0x74')],'as':_0x6a42('0x75'),'required':![]},{'model':db[_0x6a42('0x76')],'as':_0x6a42('0x77'),'attributes':[_0x6a42('0x38'),'fullname',_0x6a42('0x78')],'required':![]},{'model':db[_0x6a42('0x79')],'as':_0x6a42('0x7a'),'attributes':['id',_0x6a42('0x38'),_0x6a42('0x7b')],'where':_0x4ab1a5[_0x6a42('0x44')]['tag']?{'id':_0x4ab1a5[_0x6a42('0x44')]['tag']}:undefined,'required':_0x4ab1a5['query'][_0x6a42('0x7c')]?!![]:![]}];}return db[_0x6a42('0x71')][_0x6a42('0x69')](_0x2d7a9b);})[_0x6a42('0x34')](function(_0x2bd745){_0x1e5233['rows']=_0x2bd745;return _0x1e5233;});}})['then'](respondWithFilteredResult(_0x4afffc,_0x2d7a9b))[_0x6a42('0x27')](handleError(_0x4afffc,null));};exports[_0x6a42('0x7d')]=function(_0x371717,_0x5c3615){var _0x4f6b5e=_0x371717['params']['id'];var _0x1f7396=_0x371717[_0x6a42('0x5a')];var _0x11005b=0xc8;var _0x5b9b97=null;return db[_0x6a42('0x7e')][_0x6a42('0x7f')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x289544){return db['FaxAccount']['findOne']({'where':{'id':_0x4f6b5e},'transaction':_0x289544})[_0x6a42('0x34')](function(_0xf56227){if(_0xf56227){return db[_0x6a42('0x80')][_0x6a42('0x33')]({'where':{'FaxAccountId':_0x4f6b5e},'transaction':_0x289544})['then'](function(){var _0xe0eed5=_[_0x6a42('0x3c')](_0x1f7396,function(_0x2d818b){_0x2d818b[_0x6a42('0x64')]=_0x4f6b5e;return _0x2d818b;});return db[_0x6a42('0x80')][_0x6a42('0x81')](_0xe0eed5,{'transaction':_0x289544});});}else{_0x11005b=0x194;_0x5b9b97=[];}});})[_0x6a42('0x34')](function(){if(_0x11005b!==0x194){return db['FaxApplication'][_0x6a42('0x82')]({'where':{'FaxAccountId':_0x4f6b5e},'order':_0x6a42('0x83')})[_0x6a42('0x34')](function(_0x5bd2c2){_0x5b9b97=_0x5bd2c2;});}})[_0x6a42('0x27')](function(_0x56c0f8){_0x11005b=0x1f4;logger[_0x6a42('0x23')](_0x56c0f8['stack']);if(_0x56c0f8[_0x6a42('0x38')]){delete _0x56c0f8[_0x6a42('0x38')];}_0x5b9b97=_0x56c0f8;})[_0x6a42('0x84')](function(){if(_0x5b9b97===null){_0x5c3615['sendStatus'](_0x11005b);}else{if(_0x11005b===0x1f4){_0x5c3615[_0x6a42('0x29')](_0x11005b)[_0x6a42('0x39')](_0x5b9b97);}else{_0x5c3615[_0x6a42('0x29')](_0x11005b)[_0x6a42('0x30')](_0x5b9b97);}}});};exports['getApplications']=function(_0x428042,_0x5374f1,_0x61bd4e){var _0x486466={};var _0x3d505a={};var _0x3dc3eb;var _0x53cf91;return db[_0x6a42('0x3d')][_0x6a42('0x66')]({'where':{'id':_0x428042[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x5374f1,null))[_0x6a42('0x34')](function(_0x59fae6){if(_0x59fae6){_0x3dc3eb=_0x59fae6;_0x3d505a[_0x6a42('0x43')]=_[_0x6a42('0x41')](db[_0x6a42('0x80')][_0x6a42('0x3e')]);_0x3d505a['query']=_[_0x6a42('0x41')](_0x428042[_0x6a42('0x44')]);_0x3d505a['filters']=_[_0x6a42('0x46')](_0x3d505a[_0x6a42('0x43')],_0x3d505a['query']);_0x486466[_0x6a42('0x45')]=_[_0x6a42('0x46')](_0x3d505a[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x428042[_0x6a42('0x44')][_0x6a42('0x47')]));_0x486466['attributes']=_0x486466[_0x6a42('0x45')][_0x6a42('0x48')]?_0x486466[_0x6a42('0x45')]:_0x3d505a['model'];_0x486466[_0x6a42('0x67')]=qs['sort'](_0x428042['query']['sort']);_0x486466['where']=qs[_0x6a42('0x42')](_[_0x6a42('0x68')](_0x428042[_0x6a42('0x44')],_0x3d505a[_0x6a42('0x42')]));if(_0x428042['query']['filter']){_0x486466[_0x6a42('0x4d')]=_['merge'](_0x486466[_0x6a42('0x4d')],{'$or':_['map'](_0x486466[_0x6a42('0x45')],function(_0x1192ce){var _0x56b6c3={};_0x56b6c3[_0x1192ce]={'$like':'%'+_0x428042[_0x6a42('0x44')][_0x6a42('0x4e')]+'%'};return _0x56b6c3;})});}_0x486466=_[_0x6a42('0x4f')]({},_0x486466,_0x428042[_0x6a42('0x51')]);return _0x3dc3eb[_0x6a42('0x85')](_0x486466);}})[_0x6a42('0x34')](function(_0x9def2b){if(_0x9def2b){_0x53cf91=_0x9def2b[_0x6a42('0x48')];if(!_0x428042[_0x6a42('0x44')][_0x6a42('0x49')](_0x6a42('0x4a'))){_0x486466[_0x6a42('0x4b')]=qs['limit'](_0x428042[_0x6a42('0x44')][_0x6a42('0x4b')]);_0x486466[_0x6a42('0x2b')]=qs[_0x6a42('0x2b')](_0x428042[_0x6a42('0x44')][_0x6a42('0x2b')]);}return _0x3dc3eb[_0x6a42('0x85')](_0x486466);}})['then'](function(_0x179da5){if(_0x179da5){return _0x179da5?{'count':_0x53cf91,'rows':_0x179da5}:null;}})[_0x6a42('0x34')](respondWithResult(_0x5374f1,null))['catch'](handleError(_0x5374f1,null));};function Extension(_0x4af827,_0x165edf,_0x292f7f,_0x59b16f){this[_0x6a42('0x86')]=_0x6a42('0x87');this[_0x6a42('0x88')]=_0x4af827['localstationid'];this[_0x6a42('0x89')]=_0x59b16f;this[_0x6a42('0x3f')]=_0x6a42('0x8a');this[_0x6a42('0x8b')]=_0x6a42('0x8c');this[_0x6a42('0x64')]=_0x4af827['id'];this[_0x6a42('0x83')]=_0x165edf;this['appdata']=_0x292f7f;}function createExtensionsReciveFax(_0x5d1f17){var _0x5b7f31=0x1;var _0x2ed2c4=[];_0x2ed2c4[_0x6a42('0x8d')](new Extension(_0x5d1f17,_0x5b7f31,'',_0x6a42('0x8e')));_0x5b7f31+=0x1;_0x2ed2c4[_0x6a42('0x8d')](new Extension(_0x5d1f17,_0x5b7f31,_0x6a42('0x8f'),_0x6a42('0x90')));_0x5b7f31+=0x1;for(var _0x1b3085 in _0x5d1f17){if(_0x5d1f17[_0x6a42('0x49')](_0x1b3085)&&(_0x1b3085===_0x6a42('0x91')||_0x1b3085===_0x6a42('0x92')||_0x1b3085==='gateway'||_0x1b3085===_0x6a42('0x93')||_0x1b3085===_0x6a42('0x94')||_0x1b3085===_0x6a42('0x95')||_0x1b3085===_0x6a42('0x96')||_0x1b3085==='modem'||_0x1b3085==='t38timeout')){_0x2ed2c4['push'](new Extension(_0x5d1f17,_0x5b7f31,_0x6a42('0x97')+_0x1b3085+')='+_0x5d1f17[_0x1b3085],_0x6a42('0x90')));_0x5b7f31+=0x1;}}_0x2ed2c4[_0x6a42('0x8d')](new Extension(_0x5d1f17,_0x5b7f31,'6','Wait'));_0x5b7f31+=0x1;_0x2ed2c4[_0x6a42('0x8d')](new Extension(_0x5d1f17,_0x5b7f31,_0x6a42('0x98'),_0x6a42('0x99')));_0x5b7f31=0x0;return _0x2ed2c4;}exports[_0x6a42('0x9a')]=function(_0xdb4422,_0xddebb5,_0x492d02){var _0x2420f4;return db['sequelize'][_0x6a42('0x7f')](function(_0x51c4e6){return db[_0x6a42('0x3d')][_0x6a42('0x59')](_0xdb4422['body'],{'transaction':_0x51c4e6})['then'](function(_0x1674ae){_0x2420f4=_0x1674ae[_0x6a42('0x35')]({'plain':!![]});return db[_0x6a42('0x9b')][_0x6a42('0x81')](createExtensionsReciveFax(_0x2420f4),{'transaction':_0x51c4e6});});})[_0x6a42('0x34')](function(){return _0x2420f4;})[_0x6a42('0x34')](respondWithResult(_0xddebb5,null))['catch'](handleError(_0xddebb5,null));};exports[_0x6a42('0x9c')]=function(_0x25b32a,_0x3dc4b4,_0x4e4b12){var _0x2ee1f5;return db[_0x6a42('0x7e')][_0x6a42('0x7f')](function(_0x3b8dad){return db[_0x6a42('0x3d')]['update'](_0x25b32a['body'],{'where':{'id':_0x25b32a['body']['id']},'transaction':_0x3b8dad})[_0x6a42('0x34')](function(_0x148c52){return db[_0x6a42('0x9b')][_0x6a42('0x33')]({'where':{'FaxAccountId':_0x25b32a[_0x6a42('0x5a')]['id']},'transaction':_0x3b8dad})[_0x6a42('0x34')](function(_0x4d591d){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x6a42('0x72')](_0x25b32a['body'],[_0x6a42('0x9d'),_0x6a42('0x40'),'createdAt',_0x6a42('0x9e'),_0x6a42('0x9f'),_0x6a42('0xa0')])),{'transaction':_0x3b8dad});});});})[_0x6a42('0x34')](function(){return db['FaxAccount'][_0x6a42('0xa1')](_0x25b32a['body']['id']);})[_0x6a42('0x34')](respondWithResult(_0x3dc4b4,null))[_0x6a42('0x27')](handleError(_0x3dc4b4,null));};exports['getMessages']=function(_0x20b6bc,_0x27f2a8,_0xc16bd7){var _0x10d36a={'raw':!![],'where':{}};var _0x19bb19={};var _0x31b689={'count':0x0,'rows':[]};return db[_0x6a42('0x3d')]['findOne']({'where':{'id':_0x20b6bc[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x27f2a8,null))[_0x6a42('0x34')](function(_0x472667){if(_0x472667){_0x19bb19['model']=_[_0x6a42('0x41')](db[_0x6a42('0xa2')][_0x6a42('0x3e')]);_0x19bb19[_0x6a42('0x44')]=_['keys'](_0x20b6bc[_0x6a42('0x44')]);_0x19bb19[_0x6a42('0x42')]=_[_0x6a42('0x46')](_0x19bb19[_0x6a42('0x43')],_0x19bb19[_0x6a42('0x44')]);_0x10d36a[_0x6a42('0x45')]=_['intersection'](_0x19bb19['model'],qs[_0x6a42('0x47')](_0x20b6bc[_0x6a42('0x44')][_0x6a42('0x47')]));_0x10d36a[_0x6a42('0x45')]=_0x10d36a[_0x6a42('0x45')][_0x6a42('0x48')]?_0x10d36a[_0x6a42('0x45')]:_0x19bb19[_0x6a42('0x43')];if(!_0x20b6bc[_0x6a42('0x44')][_0x6a42('0x49')](_0x6a42('0x4a'))){_0x10d36a[_0x6a42('0x4b')]=qs[_0x6a42('0x4b')](_0x20b6bc[_0x6a42('0x44')][_0x6a42('0x4b')]);_0x10d36a['offset']=qs[_0x6a42('0x2b')](_0x20b6bc[_0x6a42('0x44')][_0x6a42('0x2b')]);}_0x10d36a[_0x6a42('0x67')]=qs['sort'](_0x20b6bc['query'][_0x6a42('0x4c')]);_0x10d36a[_0x6a42('0x4d')]=qs['filters'](_['pick'](_0x20b6bc[_0x6a42('0x44')],_0x19bb19[_0x6a42('0x42')]));_0x10d36a['where'][_0x6a42('0x64')]=_0x472667['id'];if(_0x20b6bc['query'][_0x6a42('0x4e')]){_0x10d36a[_0x6a42('0x4d')]=_[_0x6a42('0x4f')](_0x10d36a['where'],{'$or':_[_0x6a42('0x3c')](_0x10d36a[_0x6a42('0x45')],function(_0x4f6164){var _0x1d2e23={};_0x1d2e23[_0x4f6164]={'$like':'%'+_0x20b6bc['query'][_0x6a42('0x4e')]+'%'};return _0x1d2e23;})});}if(_0x20b6bc['query'][_0x6a42('0xa3')]){var _0x32fb48=_0x20b6bc[_0x6a42('0x44')][_0x6a42('0xa3')]['split'](',');var _0x3e75ab={};_0x3e75ab[_0x32fb48[0x0]]={'$gte':moment(_0x32fb48[0x1])['format'](_0x6a42('0xa4'))};_0x10d36a[_0x6a42('0x4d')]=_['merge'](_0x10d36a[_0x6a42('0x4d')],_0x3e75ab);}_0x10d36a=_[_0x6a42('0x4f')]({},_0x10d36a,_0x20b6bc[_0x6a42('0x51')]);return db[_0x6a42('0xa2')]['count']({'where':_0x10d36a['where']})[_0x6a42('0x34')](function(_0x4c7f50){_0x31b689[_0x6a42('0x2d')]=_0x4c7f50;if(_0x20b6bc[_0x6a42('0x44')][_0x6a42('0x52')]){_0x10d36a[_0x6a42('0x53')]=[{'all':!![]}];}return db[_0x6a42('0xa2')][_0x6a42('0x69')](_0x10d36a);})['then'](function(_0x2c544d){_0x31b689[_0x6a42('0x54')]=_0x2c544d;return _0x31b689;});}})[_0x6a42('0x34')](respondWithFilteredResult(_0x27f2a8,_0x10d36a))[_0x6a42('0x27')](handleError(_0x27f2a8,null));};exports[_0x6a42('0x39')]=function(_0x2559d7,_0x26ee9e,_0x450a48){var _0x2b1c94,_0x29656f={},_0x2e0b22;if(_0x2559d7['body']['to']){_0x2e0b22=_0x2559d7['body']['to'][0x0];}return db[_0x6a42('0x3d')][_0x6a42('0x58')]({'where':{'id':_0x2559d7['params']['id']},'include':[{'model':db[_0x6a42('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x6a42('0xa6'),'where':{'fax':_0x2e0b22},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x6a42('0x34')](handleEntityNotFound(_0x26ee9e,null))[_0x6a42('0x34')](function(_0x1df240){_0x2b1c94=_0x1df240;if(_0x2559d7['body'][_0x6a42('0xa7')]&&_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')]['length']){for(var _0x40596e=0x0;_0x40596e<_0x2559d7[_0x6a42('0x5a')]['attachments'][_0x6a42('0x48')];_0x40596e+=0x1){_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][_0x40596e]={'filename':_0x2559d7['body'][_0x6a42('0xa7')][_0x40596e]['name'],'id':_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][_0x40596e]['id'],'path':path['join'](config[_0x6a42('0xa8')],_0x6a42('0xa9'),_0x2559d7[_0x6a42('0x5a')]['attachments'][_0x40596e][_0x6a42('0xaa')])};}}return respondWithRpcPromise(_0x6a42('0xab'),_0x6a42('0xab'),{'FaxAccountId':_['isNil'](_0x2559d7[_0x6a42('0x56')]['id'])?undefined:_0x2559d7['params']['id'],'path':_[_0x6a42('0xac')](_0x2559d7['body'][_0x6a42('0xa7')][0x0]['path'])?undefined:_0x2559d7['body'][_0x6a42('0xa7')][0x0][_0x6a42('0xad')],'fax':_[_0x6a42('0xac')](_0x2559d7[_0x6a42('0x5a')]['to'][0x0])?undefined:_0x2559d7[_0x6a42('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x2b1c94){if(_['isNil'](_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xae')])){_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xae')]=util['format'](_0x6a42('0xaf'),_0x2b1c94['name'],_0x2b1c94[_0x6a42('0xb0')]);}if(_0x2b1c94[_0x6a42('0xb1')]){if(_0x2b1c94[_0x6a42('0xb1')]['Contacts'][_0x6a42('0x48')]){return _0x2b1c94['List'][_0x6a42('0xa6')][0x0];}else{return db[_0x6a42('0x74')][_0x6a42('0x59')](_[_0x6a42('0xb2')](_0x2559d7[_0x6a42('0x5a')],{'firstName':_0x2559d7['body']['to'][0x0],'phone':_0x2559d7[_0x6a42('0x5a')]['to'][0x0],'fax':_0x2559d7[_0x6a42('0x5a')]['to'][0x0],'ListId':_0x2b1c94[_0x6a42('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x6a42('0xb3'));}})[_0x6a42('0x34')](function(_0x1b6669){if(_0x1b6669){return db['FaxInteraction'][_0x6a42('0x58')]({'where':{'ContactId':_0x1b6669['id'],'closed':![],'FaxAccountId':_0x2b1c94['id']}})[_0x6a42('0x34')](function(_0x4e53cf){if(_0x4e53cf){return[_0x4e53cf,![]];}return db[_0x6a42('0x71')][_0x6a42('0x59')]({'UserId':_0x2559d7[_0x6a42('0x5b')]['id'],'ContactId':_0x1b6669['id'],'FaxAccountId':_0x2b1c94['id'],'fax':_0x2559d7[_0x6a42('0x5a')]['to'][0x0],'firstMsgDirection':_0x6a42('0xb4'),'Messages':[_[_0x6a42('0x4f')](_0x2559d7[_0x6a42('0x5a')],{'read':![],'body':_0x2559d7['body'][_0x6a42('0xa7')][0x0][_0x6a42('0xb5')],'FaxAccountId':_0x2b1c94['id'],'UserId':_0x2559d7[_0x6a42('0x5b')]['id'],'ContactId':_0x1b6669['id'],'AttachmentId':_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x6a42('0xa2')],'as':_0x6a42('0xb6')}]})['then'](function(_0x3c1ef1){return[_0x3c1ef1,!![]];});});}else{throw new Error(_0x6a42('0xb7'));}})['spread'](function(_0x2f6f8e,_0x4ada95){if(_0x4ada95){return _0x2f6f8e;}return db['FaxMessage'][_0x6a42('0x59')]({'direction':_0x6a42('0xb4'),'read':![],'body':_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0][_0x6a42('0xb5')],'FaxAccountId':_0x2b1c94['id'],'FaxInteractionId':_0x2f6f8e['id'],'UserId':_0x2559d7[_0x6a42('0x5b')]['id'],'ContactId':_0x2f6f8e[_0x6a42('0xb8')],'AttachmentId':_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0]['id']})[_0x6a42('0x34')](function(_0x141dbd){_0x2f6f8e[_0x6a42('0xb9')][_0x6a42('0xb6')]=[];_0x2f6f8e[_0x6a42('0xb9')][_0x6a42('0xb6')][_0x6a42('0x8d')](_0x141dbd['dataValues']);return _0x2f6f8e;});})['then'](function(_0x45ca10){respondWithRpcPromise(_0x6a42('0xba'),_0x6a42('0xba'),{'FaxAccountId':_[_0x6a42('0xac')](_0x2559d7[_0x6a42('0x56')]['id'])?undefined:_0x2559d7[_0x6a42('0x56')]['id'],'path':_[_0x6a42('0xac')](_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0][_0x6a42('0xad')])?undefined:_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0][_0x6a42('0xad')],'fax':_['isNil'](_0x2559d7[_0x6a42('0x5a')]['to'][0x0])?undefined:_0x2559d7[_0x6a42('0x5a')]['to'][0x0],'AttachmentId':_0x2559d7[_0x6a42('0x5a')][_0x6a42('0xa7')][0x0]['id']},client9002)[_0x6a42('0x34')](function(_0x857f9b){logger[_0x6a42('0x1e')]('SendFaxRpc,\x20%s',_0x857f9b);})[_0x6a42('0x27')](function(_0x9405d0){logger[_0x6a42('0x1e')](_0x6a42('0xbb'),_0x9405d0);});return _0x45ca10;})[_0x6a42('0x34')](respondWithResult(_0x26ee9e,null))[_0x6a42('0x27')](handleError(_0x26ee9e,null));};exports[_0x6a42('0xbc')]=function(_0x59cd73,_0x1eb03c,_0x4a7f2c){return db[_0x6a42('0x3d')][_0x6a42('0x58')]({'where':{'id':_0x59cd73['params']['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x1eb03c,null))[_0x6a42('0x34')](function(_0x21e2ac){if(_0x21e2ac){return _0x21e2ac[_0x6a42('0xbc')](_0x59cd73[_0x6a42('0x5a')]['ids'],_[_0x6a42('0x72')](_0x59cd73[_0x6a42('0x5a')],[_0x6a42('0x6b'),'id'])||{})[_0x6a42('0xbd')](function(_0x20c3d7){for(var _0x1e5b4e=0x0;_0x1e5b4e<_0x59cd73['body'][_0x6a42('0x6b')][_0x6a42('0x48')];_0x1e5b4e+=0x1){socket[_0x6a42('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x59cd73[_0x6a42('0x5a')]['ids'][_0x1e5b4e]),'FaxAccountId':Number(_0x59cd73['params']['id'])});}return _0x20c3d7;});}})[_0x6a42('0x34')](respondWithResult(_0x1eb03c,null))[_0x6a42('0x27')](handleError(_0x1eb03c,null));};exports[_0x6a42('0xbf')]=function(_0x46a9a3,_0x4dc172,_0x2989f7){return db['FaxAccount'][_0x6a42('0x58')]({'where':{'id':_0x46a9a3[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x4dc172,null))[_0x6a42('0x34')](function(_0x326b3d){if(_0x326b3d){return _0x326b3d[_0x6a42('0xbf')](_0x46a9a3['query'][_0x6a42('0x6b')])[_0x6a42('0x34')](function(){if(_['isArray'](_0x46a9a3['query'][_0x6a42('0x6b')])){for(var _0x30c292=0x0;_0x30c292<_0x46a9a3['query'][_0x6a42('0x6b')][_0x6a42('0x48')];_0x30c292+=0x1){socket[_0x6a42('0xbe')](_0x6a42('0xc0'),{'UserId':Number(_0x46a9a3['query']['ids'][_0x30c292]),'FaxAccountId':Number(_0x46a9a3[_0x6a42('0x56')]['id'])});}}else{socket[_0x6a42('0xbe')](_0x6a42('0xc0'),{'UserId':Number(_0x46a9a3[_0x6a42('0x44')][_0x6a42('0x6b')]),'FaxAccountId':Number(_0x46a9a3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4dc172,null))['catch'](handleError(_0x4dc172,null));};exports[_0x6a42('0xc1')]=function(_0x567ff5,_0x52b7aa,_0x1e1bc4){var _0x17d309={};var _0x2c5c9c={};var _0x581192;var _0x44e155;return db['FaxAccount'][_0x6a42('0x66')]({'where':{'id':_0x567ff5[_0x6a42('0x56')]['id']}})[_0x6a42('0x34')](handleEntityNotFound(_0x52b7aa,null))['then'](function(_0x54407d){if(_0x54407d){_0x581192=_0x54407d;_0x2c5c9c[_0x6a42('0x43')]=_['keys'](db['User']['rawAttributes']);_0x2c5c9c['query']=_[_0x6a42('0x41')](_0x567ff5['query']);_0x2c5c9c[_0x6a42('0x42')]=_[_0x6a42('0x46')](_0x2c5c9c[_0x6a42('0x43')],_0x2c5c9c[_0x6a42('0x44')]);_0x17d309[_0x6a42('0x45')]=_['intersection'](_0x2c5c9c[_0x6a42('0x43')],qs[_0x6a42('0x47')](_0x567ff5[_0x6a42('0x44')][_0x6a42('0x47')]));_0x17d309[_0x6a42('0x45')]=_0x17d309['attributes'][_0x6a42('0x48')]?_0x17d309['attributes']:_0x2c5c9c[_0x6a42('0x43')];_0x17d309[_0x6a42('0x67')]=qs[_0x6a42('0x4c')](_0x567ff5[_0x6a42('0x44')][_0x6a42('0x4c')]);_0x17d309[_0x6a42('0x4d')]=qs['filters'](_['pick'](_0x567ff5[_0x6a42('0x44')],_0x2c5c9c[_0x6a42('0x42')]));if(_0x567ff5['query'][_0x6a42('0x4e')]){_0x17d309[_0x6a42('0x4d')]=_[_0x6a42('0x4f')](_0x17d309[_0x6a42('0x4d')],{'$or':_[_0x6a42('0x3c')](_0x17d309[_0x6a42('0x45')],function(_0x2c379f){var _0xf5817e={};_0xf5817e[_0x2c379f]={'$like':'%'+_0x567ff5[_0x6a42('0x44')][_0x6a42('0x4e')]+'%'};return _0xf5817e;})});}_0x17d309=_['merge']({},_0x17d309,_0x567ff5[_0x6a42('0x51')]);return _0x581192[_0x6a42('0xc1')](_0x17d309);}})['then'](function(_0x5aefb8){if(_0x5aefb8){_0x44e155=_0x5aefb8['length'];if(!_0x567ff5[_0x6a42('0x44')][_0x6a42('0x49')](_0x6a42('0x4a'))){_0x17d309[_0x6a42('0x4b')]=qs[_0x6a42('0x4b')](_0x567ff5[_0x6a42('0x44')][_0x6a42('0x4b')]);_0x17d309['offset']=qs['offset'](_0x567ff5[_0x6a42('0x44')][_0x6a42('0x2b')]);}return _0x581192[_0x6a42('0xc1')](_0x17d309);}})[_0x6a42('0x34')](function(_0x40a4a7){if(_0x40a4a7){return _0x40a4a7?{'count':_0x44e155,'rows':_0x40a4a7}:null;}})[_0x6a42('0x34')](respondWithResult(_0x52b7aa,null))[_0x6a42('0x27')](handleError(_0x52b7aa,null));}; \ No newline at end of file +var _0xc40e=['Fax\x20Extension','appdata','push','Answer','Set','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','addAccountApplications','transaction','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','get','FaxAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','hasOwnProperty','FaxAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description'];(function(_0x2dc83e,_0x575fb1){var _0x45a774=function(_0x4ffac7){while(--_0x4ffac7){_0x2dc83e['push'](_0x2dc83e['shift']());}};_0x45a774(++_0x575fb1);}(_0xc40e,0x1c0));var _0xec40=function(_0x53d499,_0x11475c){_0x53d499=_0x53d499-0x0;var _0xd1ec36=_0xc40e[_0x53d499];return _0xd1ec36;};'use strict';var emlformat=require(_0xec40('0x0'));var rimraf=require(_0xec40('0x1'));var zipdir=require(_0xec40('0x2'));var jsonpatch=require(_0xec40('0x3'));var rp=require(_0xec40('0x4'));var moment=require(_0xec40('0x5'));var BPromise=require(_0xec40('0x6'));var Mustache=require(_0xec40('0x7'));var util=require('util');var path=require(_0xec40('0x8'));var sox=require(_0xec40('0x9'));var csv=require(_0xec40('0xa'));var ejs=require(_0xec40('0xb'));var fs=require('fs');var fs_extra=require(_0xec40('0xc'));var _=require(_0xec40('0xd'));var squel=require('squel');var crypto=require(_0xec40('0xe'));var jsforce=require(_0xec40('0xf'));var deskjs=require(_0xec40('0x10'));var toCsv=require(_0xec40('0xa'));var querystring=require(_0xec40('0x11'));var Papa=require(_0xec40('0x12'));var Redis=require(_0xec40('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xec40('0x14'))(_0xec40('0x15'));var utils=require(_0xec40('0x16'));var config=require(_0xec40('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xec40('0x18')](config[_0xec40('0x19')],{'host':_0xec40('0x1a'),'port':0x18eb});var socket=require(_0xec40('0x1b'))(new Redis(config['redis']));require(_0xec40('0x1c'))[_0xec40('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xec40('0x1e')][_0xec40('0x1f')]({'port':0x232c});var client9002=jayson[_0xec40('0x1e')][_0xec40('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x13b1ba,_0x2e97ac,_0x5081b9,_0x2687c5){return new BPromise(function(_0x124b67,_0x405931){var _0x562a0b=_0x2687c5||client;return _0x562a0b[_0xec40('0x20')](_0x13b1ba,_0x5081b9)['then'](function(_0x4e1241){logger[_0xec40('0x21')](_0xec40('0x22'),_0x2e97ac,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2e97ac,_0xec40('0x23'),JSON[_0xec40('0x24')](_0x4e1241));if(_0x4e1241['error']){if(_0x4e1241[_0xec40('0x25')][_0xec40('0x26')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x2e97ac,_0x4e1241[_0xec40('0x25')][_0xec40('0x27')]);return _0x405931(_0x4e1241[_0xec40('0x25')][_0xec40('0x27')]);}logger[_0xec40('0x25')]('FaxAccount,\x20%s,\x20%s',_0x2e97ac,_0x4e1241[_0xec40('0x25')][_0xec40('0x27')]);return _0x124b67(_0x4e1241[_0xec40('0x25')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x2e97ac,'request\x20sent');_0x124b67(_0x4e1241[_0xec40('0x28')][_0xec40('0x27')]);}})[_0xec40('0x29')](function(_0x252f41){logger['error']('FaxAccount,\x20%s,\x20%s',_0x2e97ac,_0x252f41);_0x405931(_0x252f41);});});}function respondWithStatusCode(_0x1d286f,_0x1e3b81){_0x1e3b81=_0x1e3b81||0xcc;return function(_0x2eaf26){if(_0x2eaf26){return _0x1d286f[_0xec40('0x2a')](_0x1e3b81);}return _0x1d286f[_0xec40('0x2b')](_0x1e3b81)['end']();};}function respondWithResult(_0x268c36,_0x264a35){_0x264a35=_0x264a35||0xc8;return function(_0xc14fa1){if(_0xc14fa1){return _0x268c36[_0xec40('0x2b')](_0x264a35)[_0xec40('0x2c')](_0xc14fa1);}};}function respondWithFilteredResult(_0x45be48,_0x8532a9){return function(_0x18a6c6){if(_0x18a6c6){var _0x55f748=typeof _0x8532a9[_0xec40('0x2d')]===_0xec40('0x2e')&&typeof _0x8532a9['limit']==='undefined';var _0x2c778c=_0x18a6c6[_0xec40('0x2f')];var _0x4ce39e=_0x55f748?0x0:_0x8532a9[_0xec40('0x2d')];var _0x45f9b6=_0x55f748?_0x18a6c6[_0xec40('0x2f')]:_0x8532a9['offset']+_0x8532a9['limit'];var _0x2f387f;if(_0x45f9b6>=_0x2c778c){_0x45f9b6=_0x2c778c;_0x2f387f=0xc8;}else{_0x2f387f=0xce;}_0x45be48[_0xec40('0x2b')](_0x2f387f);return _0x45be48[_0xec40('0x30')](_0xec40('0x31'),_0x4ce39e+'-'+_0x45f9b6+'/'+_0x2c778c)[_0xec40('0x2c')](_0x18a6c6);}return null;};}function patchUpdates(_0x38a943){return function(_0x331976){try{jsonpatch[_0xec40('0x32')](_0x331976,_0x38a943,!![]);}catch(_0x22bfba){return BPromise[_0xec40('0x33')](_0x22bfba);}return _0x331976['save']();};}function saveUpdates(_0x567d57,_0x159b7e){return function(_0x4b55a1){if(_0x4b55a1){return _0x4b55a1[_0xec40('0x34')](_0x567d57)['then'](function(_0x4596b4){return _0x4596b4;});}return null;};}function removeEntity(_0x254586,_0x167232){return function(_0x2d1ff9){if(_0x2d1ff9){return _0x2d1ff9['destroy']()[_0xec40('0x35')](function(){var _0x5c8433=_0x2d1ff9[_0xec40('0x36')]({'plain':!![]});var _0xbd412=_0xec40('0x37');return db[_0xec40('0x38')][_0xec40('0x39')]({'where':{'type':_0xbd412,'resourceId':_0x5c8433['id']}})[_0xec40('0x35')](function(){return _0x2d1ff9;});})[_0xec40('0x35')](function(){_0x254586[_0xec40('0x2b')](0xcc)[_0xec40('0x3a')]();});}};}function handleEntityNotFound(_0x25ec76,_0x5ca674){return function(_0x5981eb){if(!_0x5981eb){_0x25ec76[_0xec40('0x2a')](0x194);}return _0x5981eb;};}function handleError(_0x1cd034,_0x35b93a){_0x35b93a=_0x35b93a||0x1f4;return function(_0x20ef81){logger[_0xec40('0x25')](_0x20ef81[_0xec40('0x3b')]);if(_0x20ef81[_0xec40('0x3c')]){delete _0x20ef81[_0xec40('0x3c')];}_0x1cd034[_0xec40('0x2b')](_0x35b93a)[_0xec40('0x3d')](_0x20ef81);};}exports[_0xec40('0x3e')]=function(_0x41a8ab,_0x2c1e7e){var _0x21d9d9={'include':[{'model':db[_0xec40('0x3f')],'as':_0xec40('0x40')}]},_0x3775b6={},_0x106877={'count':0x0,'rows':[]};var _0x26b3f6=_[_0xec40('0x41')](db[_0xec40('0x42')][_0xec40('0x43')],function(_0x1c54d1){return{'name':_0x1c54d1['fieldName'],'type':_0x1c54d1[_0xec40('0x44')][_0xec40('0x45')]};});_0x3775b6[_0xec40('0x46')]=_[_0xec40('0x41')](_0x26b3f6,_0xec40('0x3c'));_0x3775b6['query']=_[_0xec40('0x47')](_0x41a8ab[_0xec40('0x48')]);_0x3775b6[_0xec40('0x49')]=_['intersection'](_0x3775b6[_0xec40('0x46')],_0x3775b6[_0xec40('0x48')]);_0x21d9d9[_0xec40('0x4a')]=_[_0xec40('0x4b')](_0x3775b6[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x41a8ab[_0xec40('0x48')][_0xec40('0x4c')]));_0x21d9d9[_0xec40('0x4a')]=_0x21d9d9['attributes'][_0xec40('0x4d')]?_0x21d9d9[_0xec40('0x4a')]:_0x3775b6['model'];if(!_0x41a8ab[_0xec40('0x48')]['hasOwnProperty'](_0xec40('0x4e'))){_0x21d9d9['limit']=qs[_0xec40('0x4f')](_0x41a8ab[_0xec40('0x48')][_0xec40('0x4f')]);_0x21d9d9[_0xec40('0x2d')]=qs[_0xec40('0x2d')](_0x41a8ab[_0xec40('0x48')][_0xec40('0x2d')]);}_0x21d9d9[_0xec40('0x50')]=qs[_0xec40('0x51')](_0x41a8ab[_0xec40('0x48')][_0xec40('0x51')]);_0x21d9d9['where']=qs[_0xec40('0x49')](_[_0xec40('0x52')](_0x41a8ab['query'],_0x3775b6[_0xec40('0x49')]),_0x26b3f6);if(_0x41a8ab['query'][_0xec40('0x53')]){_0x21d9d9[_0xec40('0x54')]=_[_0xec40('0x55')](_0x21d9d9[_0xec40('0x54')],{'$or':_['map'](_0x26b3f6,function(_0x181338){if(_0x181338['type']!==_0xec40('0x56')){var _0xf4326f={};_0xf4326f[_0x181338[_0xec40('0x3c')]]={'$like':'%'+_0x41a8ab[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0xf4326f;}})});}_0x21d9d9=_[_0xec40('0x55')]({},_0x21d9d9,_0x41a8ab[_0xec40('0x57')]);var _0xd3cacb={'where':_0x21d9d9[_0xec40('0x54')]};return db[_0xec40('0x42')][_0xec40('0x2f')](_0xd3cacb)[_0xec40('0x35')](function(_0x205534){_0x106877[_0xec40('0x2f')]=_0x205534;if(_0x41a8ab['query'][_0xec40('0x58')]){_0x21d9d9['include']=[{'all':!![]}];}return db[_0xec40('0x42')][_0xec40('0x59')](_0x21d9d9);})[_0xec40('0x35')](function(_0x525cca){_0x106877[_0xec40('0x5a')]=_0x525cca;return _0x106877;})[_0xec40('0x35')](respondWithFilteredResult(_0x2c1e7e,_0x21d9d9))[_0xec40('0x29')](handleError(_0x2c1e7e,null));};exports['show']=function(_0x563313,_0x5726cc){var _0x14e12f={'raw':![],'where':{'id':_0x563313[_0xec40('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x598f1b={};_0x598f1b[_0xec40('0x46')]=_['keys'](db['FaxAccount']['rawAttributes']);_0x598f1b[_0xec40('0x48')]=_[_0xec40('0x47')](_0x563313[_0xec40('0x48')]);_0x598f1b['filters']=_[_0xec40('0x4b')](_0x598f1b[_0xec40('0x46')],_0x598f1b['query']);_0x14e12f[_0xec40('0x4a')]=_[_0xec40('0x4b')](_0x598f1b[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x563313[_0xec40('0x48')][_0xec40('0x4c')]));_0x14e12f[_0xec40('0x4a')]=_0x14e12f[_0xec40('0x4a')][_0xec40('0x4d')]?_0x14e12f['attributes']:_0x598f1b[_0xec40('0x46')];if(_0x563313[_0xec40('0x48')][_0xec40('0x58')]){_0x14e12f[_0xec40('0x5c')]=[{'all':!![]}];}_0x14e12f=_[_0xec40('0x55')]({},_0x14e12f,_0x563313['options']);return db[_0xec40('0x42')]['find'](_0x14e12f)['then'](handleEntityNotFound(_0x5726cc,null))[_0xec40('0x35')](respondWithResult(_0x5726cc,null))['catch'](handleError(_0x5726cc,null));};exports[_0xec40('0x5d')]=function(_0x4fd526,_0x3f7379){return db['FaxAccount'][_0xec40('0x5d')](_0x4fd526[_0xec40('0x5e')],{})['then'](function(_0x2fd55f){var _0x37e618=_0x4fd526[_0xec40('0x5f')][_0xec40('0x36')]({'plain':!![]});if(!_0x37e618)throw new Error(_0xec40('0x60'));if(_0x37e618['role']===_0xec40('0x5f')){var _0x43bd6a=_0x2fd55f[_0xec40('0x36')]({'plain':!![]});var _0x520421=_0xec40('0x37');return db[_0xec40('0x61')][_0xec40('0x62')]({'where':{'name':_0x520421,'userProfileId':_0x37e618[_0xec40('0x63')]},'raw':!![]})[_0xec40('0x35')](function(_0x49b170){if(_0x49b170&&_0x49b170[_0xec40('0x64')]===0x0){return db[_0xec40('0x38')][_0xec40('0x5d')]({'name':_0x43bd6a[_0xec40('0x3c')],'resourceId':_0x43bd6a['id'],'type':_0x49b170[_0xec40('0x3c')],'sectionId':_0x49b170['id']},{})['then'](function(){return _0x2fd55f;});}else{return _0x2fd55f;}})[_0xec40('0x29')](function(_0x5b681a){logger[_0xec40('0x25')](_0xec40('0x65'),_0x5b681a);throw _0x5b681a;});}return _0x2fd55f;})[_0xec40('0x35')](respondWithResult(_0x3f7379,0xc9))[_0xec40('0x29')](handleError(_0x3f7379,null));};exports[_0xec40('0x34')]=function(_0x1add65,_0x27a118){if(_0x1add65[_0xec40('0x5e')]['id']){delete _0x1add65[_0xec40('0x5e')]['id'];}return db['FaxAccount'][_0xec40('0x62')]({'where':{'id':_0x1add65[_0xec40('0x5b')]['id']},'include':[{'model':db[_0xec40('0x3f')],'as':_0xec40('0x40')}]})[_0xec40('0x35')](handleEntityNotFound(_0x27a118,null))[_0xec40('0x35')](saveUpdates(_0x1add65[_0xec40('0x5e')],null))['then'](respondWithResult(_0x27a118,null))[_0xec40('0x29')](handleError(_0x27a118,null));};exports[_0xec40('0x39')]=function(_0x16b7c0,_0x3c8edb){return db[_0xec40('0x42')][_0xec40('0x62')]({'where':{'id':_0x16b7c0['params']['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x3c8edb,null))['then'](removeEntity(_0x3c8edb,null))['catch'](handleError(_0x3c8edb,null));};exports[_0xec40('0x66')]=function(_0xde0f71,_0x53e5c9){return db[_0xec40('0x42')][_0xec40('0x66')]()[_0xec40('0x35')](respondWithResult(_0x53e5c9,null))[_0xec40('0x29')](handleError(_0x53e5c9,null));};exports['addDisposition']=function(_0x45d79c,_0x1ce707,_0x32720a){if(_0x45d79c[_0xec40('0x5e')]['id']){delete _0x45d79c[_0xec40('0x5e')]['id'];}return db[_0xec40('0x42')][_0xec40('0x62')]({'where':{'id':_0x45d79c['params']['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x1ce707,null))[_0xec40('0x35')](function(_0x282eaa){if(_0x282eaa){_0x45d79c[_0xec40('0x5e')]['FaxAccountId']=_0x282eaa['id'];return db[_0xec40('0x67')][_0xec40('0x5d')](_0x45d79c['body']);}})[_0xec40('0x35')](respondWithResult(_0x1ce707,null))[_0xec40('0x29')](handleError(_0x1ce707,null));};exports[_0xec40('0x68')]=function(_0x1d7c58,_0x1164f5,_0xe68fe0){var _0x13bda3={'raw':![],'where':{}};var _0x4a9e6a={};var _0x5b7c1c={'count':0x0,'rows':[]};return db[_0xec40('0x42')][_0xec40('0x69')]({'where':{'id':_0x1d7c58[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x1164f5,null))['then'](function(_0xe4d4fa){if(_0xe4d4fa){_0x4a9e6a[_0xec40('0x46')]=_[_0xec40('0x47')](db['Disposition']['rawAttributes']);_0x4a9e6a['query']=_[_0xec40('0x47')](_0x1d7c58[_0xec40('0x48')]);_0x4a9e6a['filters']=_[_0xec40('0x4b')](_0x4a9e6a[_0xec40('0x46')],_0x4a9e6a[_0xec40('0x48')]);_0x13bda3[_0xec40('0x4a')]=_[_0xec40('0x4b')](_0x4a9e6a[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x1d7c58[_0xec40('0x48')][_0xec40('0x4c')]));_0x13bda3[_0xec40('0x4a')]=_0x13bda3[_0xec40('0x4a')][_0xec40('0x4d')]?_0x13bda3['attributes']:_0x4a9e6a['model'];if(!_0x1d7c58[_0xec40('0x48')][_0xec40('0x6a')](_0xec40('0x4e'))){_0x13bda3['limit']=qs[_0xec40('0x4f')](_0x1d7c58[_0xec40('0x48')][_0xec40('0x4f')]);_0x13bda3[_0xec40('0x2d')]=qs[_0xec40('0x2d')](_0x1d7c58[_0xec40('0x48')][_0xec40('0x2d')]);}_0x13bda3[_0xec40('0x50')]=qs['sort'](_0x1d7c58[_0xec40('0x48')][_0xec40('0x51')]);_0x13bda3[_0xec40('0x54')]=qs[_0xec40('0x49')](_[_0xec40('0x52')](_0x1d7c58[_0xec40('0x48')],_0x4a9e6a[_0xec40('0x49')]));_0x13bda3['where'][_0xec40('0x6b')]=_0xe4d4fa['id'];if(_0x1d7c58[_0xec40('0x48')][_0xec40('0x53')]){_0x13bda3[_0xec40('0x54')]=_[_0xec40('0x55')](_0x13bda3[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x13bda3[_0xec40('0x4a')],function(_0x41cc62){var _0x4d16ba={};_0x4d16ba[_0x41cc62]={'$like':'%'+_0x1d7c58[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0x4d16ba;})});}_0x13bda3=_[_0xec40('0x55')]({},_0x13bda3,_0x1d7c58['options']);return db['Disposition'][_0xec40('0x2f')]({'where':_0x13bda3[_0xec40('0x54')]})['then'](function(_0x17625e){_0x5b7c1c[_0xec40('0x2f')]=_0x17625e;if(_0x1d7c58[_0xec40('0x48')][_0xec40('0x58')]){_0x13bda3[_0xec40('0x5c')]=[{'all':!![]}];}return db[_0xec40('0x67')]['findAll'](_0x13bda3);})['then'](function(_0x100fe7){_0x5b7c1c[_0xec40('0x5a')]=_0x100fe7;return _0x5b7c1c;});}})[_0xec40('0x35')](respondWithFilteredResult(_0x1164f5,_0x13bda3))[_0xec40('0x29')](handleError(_0x1164f5,null));};exports[_0xec40('0x6c')]=function(_0x187c53,_0x3d5ffd,_0x5b2c66){return db[_0xec40('0x42')][_0xec40('0x62')]({'where':{'id':_0x187c53[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x3d5ffd,null))['then'](function(_0x2924e6){if(_0x2924e6){return _0x2924e6[_0xec40('0x6c')](_0x187c53[_0xec40('0x48')][_0xec40('0x6d')]);}})[_0xec40('0x35')](respondWithStatusCode(_0x3d5ffd,null))['catch'](handleError(_0x3d5ffd,null));};exports['addAnswer']=function(_0x35305f,_0x1d2b9f,_0x1e15ec){if(_0x35305f[_0xec40('0x5e')]['id']){delete _0x35305f[_0xec40('0x5e')]['id'];}return db[_0xec40('0x42')][_0xec40('0x62')]({'where':{'id':_0x35305f[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x1d2b9f,null))[_0xec40('0x35')](function(_0x4721ad){if(_0x4721ad){_0x35305f[_0xec40('0x5e')][_0xec40('0x6b')]=_0x4721ad['id'];return db[_0xec40('0x6e')]['create'](_0x35305f[_0xec40('0x5e')]);}})[_0xec40('0x35')](respondWithResult(_0x1d2b9f,null))[_0xec40('0x29')](handleError(_0x1d2b9f,null));};exports[_0xec40('0x6f')]=function(_0x70782,_0x4c143c,_0x3b9b51){var _0x2827f2={'raw':![],'where':{}};var _0x583c8a={};var _0x386c51={'count':0x0,'rows':[]};return db[_0xec40('0x42')]['findOne']({'where':{'id':_0x70782['params']['id']}})['then'](handleEntityNotFound(_0x4c143c,null))[_0xec40('0x35')](function(_0x5bee19){if(_0x5bee19){_0x583c8a[_0xec40('0x46')]=_[_0xec40('0x47')](db[_0xec40('0x6e')][_0xec40('0x43')]);_0x583c8a['query']=_[_0xec40('0x47')](_0x70782[_0xec40('0x48')]);_0x583c8a[_0xec40('0x49')]=_[_0xec40('0x4b')](_0x583c8a['model'],_0x583c8a['query']);_0x2827f2[_0xec40('0x4a')]=_[_0xec40('0x4b')](_0x583c8a[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x70782[_0xec40('0x48')][_0xec40('0x4c')]));_0x2827f2[_0xec40('0x4a')]=_0x2827f2[_0xec40('0x4a')][_0xec40('0x4d')]?_0x2827f2['attributes']:_0x583c8a[_0xec40('0x46')];if(!_0x70782['query'][_0xec40('0x6a')](_0xec40('0x4e'))){_0x2827f2[_0xec40('0x4f')]=qs[_0xec40('0x4f')](_0x70782['query']['limit']);_0x2827f2['offset']=qs['offset'](_0x70782['query']['offset']);}_0x2827f2[_0xec40('0x50')]=qs[_0xec40('0x51')](_0x70782[_0xec40('0x48')][_0xec40('0x51')]);_0x2827f2[_0xec40('0x54')]=qs[_0xec40('0x49')](_['pick'](_0x70782['query'],_0x583c8a[_0xec40('0x49')]));_0x2827f2[_0xec40('0x54')]['FaxAccountId']=_0x5bee19['id'];if(_0x70782[_0xec40('0x48')][_0xec40('0x53')]){_0x2827f2[_0xec40('0x54')]=_[_0xec40('0x55')](_0x2827f2[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x2827f2[_0xec40('0x4a')],function(_0x2afa6d){var _0x3b8779={};_0x3b8779[_0x2afa6d]={'$like':'%'+_0x70782[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0x3b8779;})});}_0x2827f2=_[_0xec40('0x55')]({},_0x2827f2,_0x70782[_0xec40('0x57')]);return db[_0xec40('0x6e')][_0xec40('0x2f')]({'where':_0x2827f2[_0xec40('0x54')]})[_0xec40('0x35')](function(_0x4238dd){_0x386c51['count']=_0x4238dd;if(_0x70782[_0xec40('0x48')][_0xec40('0x58')]){_0x2827f2[_0xec40('0x5c')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2827f2);})[_0xec40('0x35')](function(_0x1e3918){_0x386c51[_0xec40('0x5a')]=_0x1e3918;return _0x386c51;});}})[_0xec40('0x35')](respondWithFilteredResult(_0x4c143c,_0x2827f2))['catch'](handleError(_0x4c143c,null));};exports['removeAnswers']=function(_0xd2c851,_0x28aefd,_0x3e7bd6){return db[_0xec40('0x42')][_0xec40('0x62')]({'where':{'id':_0xd2c851['params']['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x28aefd,null))['then'](function(_0x51d84a){if(_0x51d84a){return _0x51d84a[_0xec40('0x70')](_0xd2c851['query'][_0xec40('0x6d')]);}})[_0xec40('0x35')](respondWithStatusCode(_0x28aefd,null))['catch'](handleError(_0x28aefd,null));};exports[_0xec40('0x71')]=function(_0x31f28d,_0x5b8e5e,_0x3c3d71){return db[_0xec40('0x72')][_0xec40('0x62')]({'where':{'id':_0x31f28d['params']['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x5b8e5e,null))[_0xec40('0x35')](function(_0x2721b5){if(_0x2721b5){return _0x2721b5['addInteraction'](_0x31f28d[_0xec40('0x5e')][_0xec40('0x6d')],_[_0xec40('0x73')](_0x31f28d[_0xec40('0x5e')],[_0xec40('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x5b8e5e,null))['catch'](handleError(_0x5b8e5e,null));};exports[_0xec40('0x74')]=function(_0x291d96,_0x4158a3,_0x15ac28){var _0x52b933={'raw':![],'where':{}};var _0x3e2939={};var _0x3415cd={'count':0x0,'rows':[]};return db['FaxAccount'][_0xec40('0x69')]({'where':{'id':_0x291d96[_0xec40('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4158a3,null))['then'](function(_0x504d45){if(_0x504d45){_0x3e2939['model']=_['keys'](db[_0xec40('0x72')]['rawAttributes']);_0x3e2939[_0xec40('0x48')]=_[_0xec40('0x47')](_0x291d96[_0xec40('0x48')]);_0x3e2939[_0xec40('0x49')]=_['intersection'](_0x3e2939[_0xec40('0x46')],_0x3e2939[_0xec40('0x48')]);_0x52b933['attributes']=_[_0xec40('0x4b')](_0x3e2939[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x291d96['query'][_0xec40('0x4c')]));_0x52b933['attributes']=_0x52b933[_0xec40('0x4a')][_0xec40('0x4d')]?_0x52b933[_0xec40('0x4a')]:_0x3e2939[_0xec40('0x46')];if(!_0x291d96[_0xec40('0x48')]['hasOwnProperty'](_0xec40('0x4e'))){_0x52b933[_0xec40('0x4f')]=qs[_0xec40('0x4f')](_0x291d96['query']['limit']);_0x52b933['offset']=qs['offset'](_0x291d96[_0xec40('0x48')][_0xec40('0x2d')]);}_0x52b933[_0xec40('0x50')]=qs[_0xec40('0x51')](_0x291d96[_0xec40('0x48')]['sort']);_0x52b933[_0xec40('0x54')]=qs[_0xec40('0x49')](_[_0xec40('0x52')](_0x291d96['query'],_0x3e2939[_0xec40('0x49')]));_0x52b933[_0xec40('0x54')][_0xec40('0x6b')]=_0x504d45['id'];if(_0x291d96[_0xec40('0x48')]['filter']){_0x52b933[_0xec40('0x54')]=_['merge'](_0x52b933[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x52b933[_0xec40('0x4a')],function(_0xa319e3){var _0xd790ce={};_0xd790ce[_0xa319e3]={'$like':'%'+_0x291d96[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0xd790ce;})});}_0x52b933=_[_0xec40('0x55')]({},_0x52b933,_0x291d96[_0xec40('0x57')]);return db[_0xec40('0x72')][_0xec40('0x2f')]({'where':_0x52b933[_0xec40('0x54')]})[_0xec40('0x35')](function(_0x582db7){_0x3415cd['count']=_0x582db7;if(_0x291d96[_0xec40('0x48')]['includeAll']){_0x52b933[_0xec40('0x5c')]=[{'model':db[_0xec40('0x75')],'as':_0xec40('0x76'),'required':![]},{'model':db[_0xec40('0x77')],'as':_0xec40('0x78'),'attributes':[_0xec40('0x3c'),_0xec40('0x79'),'internal'],'required':![]},{'model':db[_0xec40('0x7a')],'as':'Tags','attributes':['id',_0xec40('0x3c'),_0xec40('0x7b')],'where':_0x291d96[_0xec40('0x48')]['tag']?{'id':_0x291d96[_0xec40('0x48')][_0xec40('0x7c')]}:undefined,'required':_0x291d96[_0xec40('0x48')]['tag']?!![]:![]}];}return db[_0xec40('0x72')][_0xec40('0x59')](_0x52b933);})[_0xec40('0x35')](function(_0x2a4c7e){_0x3415cd[_0xec40('0x5a')]=_0x2a4c7e;return _0x3415cd;});}})[_0xec40('0x35')](respondWithFilteredResult(_0x4158a3,_0x52b933))[_0xec40('0x29')](handleError(_0x4158a3,null));};exports[_0xec40('0x7d')]=function(_0x5b052d,_0x1d5c91){var _0x53b53f=_0x5b052d[_0xec40('0x5b')]['id'];var _0xbe0c34=_0x5b052d[_0xec40('0x5e')];var _0x3738bb=0xc8;var _0xaffd92=null;return db[_0xec40('0x7e')]['transaction']({'isolationLevel':db['sequelize'][_0xec40('0x7f')][_0xec40('0x80')][_0xec40('0x81')]},function(_0x36199d){return db[_0xec40('0x42')][_0xec40('0x69')]({'where':{'id':_0x53b53f},'transaction':_0x36199d})[_0xec40('0x35')](function(_0x35aa9d){if(_0x35aa9d){return db[_0xec40('0x82')][_0xec40('0x39')]({'where':{'FaxAccountId':_0x53b53f},'transaction':_0x36199d})[_0xec40('0x35')](function(){var _0x287813=_[_0xec40('0x41')](_0xbe0c34,function(_0x42d2db){_0x42d2db[_0xec40('0x6b')]=_0x53b53f;return _0x42d2db;});return db[_0xec40('0x82')][_0xec40('0x83')](_0x287813,{'transaction':_0x36199d});});}else{_0x3738bb=0x194;_0xaffd92=[];}});})['then'](function(){if(_0x3738bb!==0x194){return db[_0xec40('0x82')][_0xec40('0x84')]({'where':{'FaxAccountId':_0x53b53f},'order':_0xec40('0x85')})[_0xec40('0x35')](function(_0xaa8638){_0xaffd92=_0xaa8638;});}})['catch'](function(_0x3b296c){_0x3738bb=0x1f4;logger['error'](_0x3b296c[_0xec40('0x3b')]);if(_0x3b296c[_0xec40('0x3c')]){delete _0x3b296c[_0xec40('0x3c')];}_0xaffd92=_0x3b296c;})[_0xec40('0x86')](function(){if(_0xaffd92===null){_0x1d5c91['sendStatus'](_0x3738bb);}else{if(_0x3738bb===0x1f4){_0x1d5c91[_0xec40('0x2b')](_0x3738bb)['send'](_0xaffd92);}else{_0x1d5c91[_0xec40('0x2b')](_0x3738bb)[_0xec40('0x2c')](_0xaffd92);}}});};exports[_0xec40('0x87')]=function(_0x386c0d,_0x5a5305,_0x9a85fc){var _0x5c46f5={};var _0x2c4cbd={};var _0x3569f3;var _0x4bb8fa;return db[_0xec40('0x42')][_0xec40('0x69')]({'where':{'id':_0x386c0d['params']['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x5a5305,null))[_0xec40('0x35')](function(_0x243a36){if(_0x243a36){_0x3569f3=_0x243a36;_0x2c4cbd[_0xec40('0x46')]=_[_0xec40('0x47')](db[_0xec40('0x82')][_0xec40('0x43')]);_0x2c4cbd[_0xec40('0x48')]=_['keys'](_0x386c0d[_0xec40('0x48')]);_0x2c4cbd[_0xec40('0x49')]=_[_0xec40('0x4b')](_0x2c4cbd[_0xec40('0x46')],_0x2c4cbd[_0xec40('0x48')]);_0x5c46f5['attributes']=_[_0xec40('0x4b')](_0x2c4cbd[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x386c0d[_0xec40('0x48')][_0xec40('0x4c')]));_0x5c46f5[_0xec40('0x4a')]=_0x5c46f5[_0xec40('0x4a')][_0xec40('0x4d')]?_0x5c46f5[_0xec40('0x4a')]:_0x2c4cbd[_0xec40('0x46')];_0x5c46f5[_0xec40('0x50')]=qs[_0xec40('0x51')](_0x386c0d[_0xec40('0x48')]['sort']);_0x5c46f5[_0xec40('0x54')]=qs[_0xec40('0x49')](_[_0xec40('0x52')](_0x386c0d[_0xec40('0x48')],_0x2c4cbd[_0xec40('0x49')]));if(_0x386c0d[_0xec40('0x48')][_0xec40('0x53')]){_0x5c46f5['where']=_[_0xec40('0x55')](_0x5c46f5[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x5c46f5[_0xec40('0x4a')],function(_0x29c28d){var _0x254d76={};_0x254d76[_0x29c28d]={'$like':'%'+_0x386c0d['query'][_0xec40('0x53')]+'%'};return _0x254d76;})});}_0x5c46f5=_['merge']({},_0x5c46f5,_0x386c0d[_0xec40('0x57')]);return _0x3569f3[_0xec40('0x87')](_0x5c46f5);}})[_0xec40('0x35')](function(_0x3e7c9a){if(_0x3e7c9a){_0x4bb8fa=_0x3e7c9a[_0xec40('0x4d')];if(!_0x386c0d[_0xec40('0x48')][_0xec40('0x6a')](_0xec40('0x4e'))){_0x5c46f5[_0xec40('0x4f')]=qs[_0xec40('0x4f')](_0x386c0d[_0xec40('0x48')][_0xec40('0x4f')]);_0x5c46f5[_0xec40('0x2d')]=qs['offset'](_0x386c0d[_0xec40('0x48')][_0xec40('0x2d')]);}return _0x3569f3[_0xec40('0x87')](_0x5c46f5);}})[_0xec40('0x35')](function(_0x25a5f7){if(_0x25a5f7){return _0x25a5f7?{'count':_0x4bb8fa,'rows':_0x25a5f7}:null;}})[_0xec40('0x35')](respondWithResult(_0x5a5305,null))[_0xec40('0x29')](handleError(_0x5a5305,null));};function Extension(_0x3dd919,_0xb29b69,_0x23a1e6,_0x5bc50a){this[_0xec40('0x88')]=_0xec40('0x89');this[_0xec40('0x8a')]=_0x3dd919[_0xec40('0x8b')];this[_0xec40('0x8c')]=_0x5bc50a;this[_0xec40('0x44')]=_0xec40('0x8d');this[_0xec40('0x8e')]=_0xec40('0x8f');this[_0xec40('0x6b')]=_0x3dd919['id'];this[_0xec40('0x85')]=_0xb29b69;this[_0xec40('0x90')]=_0x23a1e6;}function createExtensionsReciveFax(_0x3afba9){var _0x43d143=0x1;var _0xb12bbc=[];_0xb12bbc[_0xec40('0x91')](new Extension(_0x3afba9,_0x43d143,'',_0xec40('0x92')));_0x43d143+=0x1;_0xb12bbc[_0xec40('0x91')](new Extension(_0x3afba9,_0x43d143,'CDR(type)=inbound-fax',_0xec40('0x93')));_0x43d143+=0x1;for(var _0x897605 in _0x3afba9){if(_0x3afba9['hasOwnProperty'](_0x897605)&&(_0x897605===_0xec40('0x94')||_0x897605===_0xec40('0x8b')||_0x897605==='gateway'||_0x897605===_0xec40('0x95')||_0x897605===_0xec40('0x96')||_0x897605===_0xec40('0x97')||_0x897605===_0xec40('0x98')||_0x897605===_0xec40('0x99')||_0x897605===_0xec40('0x9a'))){_0xb12bbc['push'](new Extension(_0x3afba9,_0x43d143,'FAXOPT('+_0x897605+')='+_0x3afba9[_0x897605],_0xec40('0x93')));_0x43d143+=0x1;}}_0xb12bbc[_0xec40('0x91')](new Extension(_0x3afba9,_0x43d143,'6',_0xec40('0x9b')));_0x43d143+=0x1;_0xb12bbc['push'](new Extension(_0x3afba9,_0x43d143,'/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'));_0x43d143=0x0;return _0xb12bbc;}exports[_0xec40('0x9c')]=function(_0x10f85a,_0x531591,_0x1d8a1c){var _0x44aa6c;return db[_0xec40('0x7e')][_0xec40('0x9d')](function(_0x222839){return db['FaxAccount'][_0xec40('0x5d')](_0x10f85a[_0xec40('0x5e')],{'transaction':_0x222839})[_0xec40('0x35')](function(_0x17972d){_0x44aa6c=_0x17972d[_0xec40('0x36')]({'plain':!![]});return db[_0xec40('0x9e')][_0xec40('0x83')](createExtensionsReciveFax(_0x44aa6c),{'transaction':_0x222839});});})[_0xec40('0x35')](function(){return _0x44aa6c;})[_0xec40('0x35')](respondWithResult(_0x531591,null))[_0xec40('0x29')](handleError(_0x531591,null));};exports['updateAccountApplications']=function(_0x519d36,_0x39e544,_0x7a60b0){var _0x4530da;return db[_0xec40('0x7e')][_0xec40('0x9d')](function(_0x38d93a){return db[_0xec40('0x42')][_0xec40('0x34')](_0x519d36[_0xec40('0x5e')],{'where':{'id':_0x519d36[_0xec40('0x5e')]['id']},'transaction':_0x38d93a})[_0xec40('0x35')](function(_0x8c747){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x519d36[_0xec40('0x5e')]['id']},'transaction':_0x38d93a})['then'](function(_0x2a8d4b){return db[_0xec40('0x9e')][_0xec40('0x83')](createExtensionsReciveFax(_[_0xec40('0x73')](_0x519d36[_0xec40('0x5e')],[_0xec40('0x9f'),_0xec40('0x45'),_0xec40('0xa0'),_0xec40('0xa1'),_0xec40('0xa2'),_0xec40('0xa3')])),{'transaction':_0x38d93a});});});})[_0xec40('0x35')](function(){return db[_0xec40('0x42')]['findById'](_0x519d36[_0xec40('0x5e')]['id']);})[_0xec40('0x35')](respondWithResult(_0x39e544,null))[_0xec40('0x29')](handleError(_0x39e544,null));};exports[_0xec40('0xa4')]=function(_0x1aba5a,_0x5f55fa,_0xf0aac4){var _0x52f720={'raw':!![],'where':{}};var _0x4fc226={};var _0x236422={'count':0x0,'rows':[]};return db[_0xec40('0x42')][_0xec40('0x69')]({'where':{'id':_0x1aba5a[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x5f55fa,null))[_0xec40('0x35')](function(_0x4c220f){if(_0x4c220f){_0x4fc226[_0xec40('0x46')]=_[_0xec40('0x47')](db[_0xec40('0xa5')][_0xec40('0x43')]);_0x4fc226['query']=_[_0xec40('0x47')](_0x1aba5a[_0xec40('0x48')]);_0x4fc226[_0xec40('0x49')]=_[_0xec40('0x4b')](_0x4fc226['model'],_0x4fc226[_0xec40('0x48')]);_0x52f720['attributes']=_['intersection'](_0x4fc226[_0xec40('0x46')],qs['fields'](_0x1aba5a[_0xec40('0x48')]['fields']));_0x52f720['attributes']=_0x52f720[_0xec40('0x4a')][_0xec40('0x4d')]?_0x52f720[_0xec40('0x4a')]:_0x4fc226[_0xec40('0x46')];if(!_0x1aba5a['query'][_0xec40('0x6a')](_0xec40('0x4e'))){_0x52f720[_0xec40('0x4f')]=qs[_0xec40('0x4f')](_0x1aba5a[_0xec40('0x48')]['limit']);_0x52f720[_0xec40('0x2d')]=qs['offset'](_0x1aba5a['query'][_0xec40('0x2d')]);}_0x52f720['order']=qs[_0xec40('0x51')](_0x1aba5a[_0xec40('0x48')][_0xec40('0x51')]);_0x52f720[_0xec40('0x54')]=qs[_0xec40('0x49')](_['pick'](_0x1aba5a[_0xec40('0x48')],_0x4fc226['filters']));_0x52f720[_0xec40('0x54')][_0xec40('0x6b')]=_0x4c220f['id'];if(_0x1aba5a[_0xec40('0x48')]['filter']){_0x52f720[_0xec40('0x54')]=_[_0xec40('0x55')](_0x52f720[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x52f720['attributes'],function(_0x1b18be){var _0x54a67a={};_0x54a67a[_0x1b18be]={'$like':'%'+_0x1aba5a[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0x54a67a;})});}if(_0x1aba5a[_0xec40('0x48')][_0xec40('0xa6')]){var _0x4a8a4a=_0x1aba5a['query'][_0xec40('0xa6')][_0xec40('0xa7')](',');var _0x4764ce={};_0x4764ce[_0x4a8a4a[0x0]]={'$gte':moment(_0x4a8a4a[0x1])['format'](_0xec40('0xa8'))};_0x52f720['where']=_[_0xec40('0x55')](_0x52f720[_0xec40('0x54')],_0x4764ce);}_0x52f720=_[_0xec40('0x55')]({},_0x52f720,_0x1aba5a[_0xec40('0x57')]);return db['FaxMessage'][_0xec40('0x2f')]({'where':_0x52f720[_0xec40('0x54')]})['then'](function(_0x5db74){_0x236422['count']=_0x5db74;if(_0x1aba5a[_0xec40('0x48')]['includeAll']){_0x52f720[_0xec40('0x5c')]=[{'all':!![]}];}return db[_0xec40('0xa5')]['findAll'](_0x52f720);})[_0xec40('0x35')](function(_0x967985){_0x236422[_0xec40('0x5a')]=_0x967985;return _0x236422;});}})['then'](respondWithFilteredResult(_0x5f55fa,_0x52f720))[_0xec40('0x29')](handleError(_0x5f55fa,null));};exports[_0xec40('0x3d')]=function(_0x1fa3b5,_0x556efc,_0x28ec4e){var _0x143991,_0x477d79={},_0x3787d2;if(_0x1fa3b5['body']['to']){_0x3787d2=_0x1fa3b5[_0xec40('0x5e')]['to'][0x0];}return db['FaxAccount'][_0xec40('0x62')]({'where':{'id':_0x1fa3b5[_0xec40('0x5b')]['id']},'include':[{'model':db[_0xec40('0xa9')],'as':_0xec40('0xaa'),'include':[{'model':db[_0xec40('0x75')],'as':_0xec40('0xab'),'where':{'fax':_0x3787d2},'limit':0x1,'order':[['updatedAt',_0xec40('0xac')]]}]}]})['then'](handleEntityNotFound(_0x556efc,null))[_0xec40('0x35')](function(_0xcf726){_0x143991=_0xcf726;if(_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')]&&_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][_0xec40('0x4d')]){for(var _0x501519=0x0;_0x501519<_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][_0xec40('0x4d')];_0x501519+=0x1){_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][_0x501519]={'filename':_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][_0x501519][_0xec40('0x3c')],'id':_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][_0x501519]['id'],'path':path['join'](config['root'],_0xec40('0xae'),_0x1fa3b5[_0xec40('0x5e')]['attachments'][_0x501519][_0xec40('0xaf')])};}}return respondWithRpcPromise(_0xec40('0xb0'),_0xec40('0xb0'),{'FaxAccountId':_[_0xec40('0xb1')](_0x1fa3b5['params']['id'])?undefined:_0x1fa3b5[_0xec40('0x5b')]['id'],'path':_[_0xec40('0xb1')](_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][0x0]['path'])?undefined:_0x1fa3b5[_0xec40('0x5e')]['attachments'][0x0]['path'],'fax':_[_0xec40('0xb1')](_0x1fa3b5['body']['to'][0x0])?undefined:_0x1fa3b5[_0xec40('0x5e')]['to'][0x0]},client9002);})[_0xec40('0x35')](function(){if(_0x143991){if(_['isNil'](_0x1fa3b5['body'][_0xec40('0xb2')])){_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xb2')]=util[_0xec40('0xb3')](_0xec40('0xb4'),_0x143991[_0xec40('0x3c')],_0x143991['fax']);}if(_0x143991[_0xec40('0xaa')]){if(_0x143991['List'][_0xec40('0xab')][_0xec40('0x4d')]){return _0x143991[_0xec40('0xaa')][_0xec40('0xab')][0x0];}else{return db['CmContact'][_0xec40('0x5d')](_['defaults'](_0x1fa3b5['body'],{'firstName':_0x1fa3b5['body']['to'][0x0],'phone':_0x1fa3b5[_0xec40('0x5e')]['to'][0x0],'fax':_0x1fa3b5[_0xec40('0x5e')]['to'][0x0],'ListId':_0x143991['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xec40('0xb5'));}})[_0xec40('0x35')](function(_0x217367){if(_0x217367){return db[_0xec40('0x72')][_0xec40('0x62')]({'where':{'ContactId':_0x217367['id'],'closed':![],'FaxAccountId':_0x143991['id']}})[_0xec40('0x35')](function(_0x12d631){if(_0x12d631){return[_0x12d631,![]];}return db[_0xec40('0x72')][_0xec40('0x5d')]({'UserId':_0x1fa3b5[_0xec40('0x5f')]['id'],'ContactId':_0x217367['id'],'FaxAccountId':_0x143991['id'],'fax':_0x1fa3b5[_0xec40('0x5e')]['to'][0x0],'firstMsgDirection':_0xec40('0xb6'),'Messages':[_[_0xec40('0x55')](_0x1fa3b5[_0xec40('0x5e')],{'read':![],'body':_0x1fa3b5['body'][_0xec40('0xad')][0x0]['filename'],'FaxAccountId':_0x143991['id'],'UserId':_0x1fa3b5['user']['id'],'ContactId':_0x217367['id'],'AttachmentId':_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][0x0]['id']})]},{'include':[{'model':db[_0xec40('0xa5')],'as':_0xec40('0xb7')}]})[_0xec40('0x35')](function(_0x4ac9ee){return[_0x4ac9ee,!![]];});});}else{throw new Error(_0xec40('0xb8'));}})[_0xec40('0xb9')](function(_0x3551d4,_0x306e21){if(_0x306e21){return _0x3551d4;}return db['FaxMessage'][_0xec40('0x5d')]({'direction':'out','read':![],'body':_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][0x0][_0xec40('0xba')],'FaxAccountId':_0x143991['id'],'FaxInteractionId':_0x3551d4['id'],'UserId':_0x1fa3b5[_0xec40('0x5f')]['id'],'ContactId':_0x3551d4[_0xec40('0xbb')],'AttachmentId':_0x1fa3b5[_0xec40('0x5e')][_0xec40('0xad')][0x0]['id']})[_0xec40('0x35')](function(_0x137bd9){_0x3551d4[_0xec40('0xbc')][_0xec40('0xb7')]=[];_0x3551d4[_0xec40('0xbc')][_0xec40('0xb7')]['push'](_0x137bd9[_0xec40('0xbc')]);return _0x3551d4;});})[_0xec40('0x35')](function(_0x4905e1){respondWithRpcPromise(_0xec40('0xbd'),_0xec40('0xbd'),{'FaxAccountId':_[_0xec40('0xb1')](_0x1fa3b5[_0xec40('0x5b')]['id'])?undefined:_0x1fa3b5[_0xec40('0x5b')]['id'],'path':_[_0xec40('0xb1')](_0x1fa3b5[_0xec40('0x5e')]['attachments'][0x0][_0xec40('0x8')])?undefined:_0x1fa3b5[_0xec40('0x5e')]['attachments'][0x0][_0xec40('0x8')],'fax':_[_0xec40('0xb1')](_0x1fa3b5[_0xec40('0x5e')]['to'][0x0])?undefined:_0x1fa3b5['body']['to'][0x0],'AttachmentId':_0x1fa3b5['body'][_0xec40('0xad')][0x0]['id']},client9002)[_0xec40('0x35')](function(_0x120109){logger[_0xec40('0x21')](_0xec40('0xbe'),_0x120109);})[_0xec40('0x29')](function(_0x165518){logger[_0xec40('0x21')]('SendFaxRpc,\x20%s',_0x165518);});return _0x4905e1;})[_0xec40('0x35')](respondWithResult(_0x556efc,null))[_0xec40('0x29')](handleError(_0x556efc,null));};exports[_0xec40('0xbf')]=function(_0x113b33,_0x36d4bf,_0x23b538){return db['FaxAccount'][_0xec40('0x62')]({'where':{'id':_0x113b33[_0xec40('0x5b')]['id']}})['then'](handleEntityNotFound(_0x36d4bf,null))['then'](function(_0x5847be){if(_0x5847be){return _0x5847be['addAgents'](_0x113b33['body'][_0xec40('0x6d')],_[_0xec40('0x73')](_0x113b33['body'],[_0xec40('0x6d'),'id'])||{})[_0xec40('0xb9')](function(_0x1c36a8){for(var _0xa7e376=0x0;_0xa7e376<_0x113b33[_0xec40('0x5e')]['ids'][_0xec40('0x4d')];_0xa7e376+=0x1){socket[_0xec40('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x113b33[_0xec40('0x5e')]['ids'][_0xa7e376]),'FaxAccountId':Number(_0x113b33[_0xec40('0x5b')]['id'])});}return _0x1c36a8;});}})['then'](respondWithResult(_0x36d4bf,null))[_0xec40('0x29')](handleError(_0x36d4bf,null));};exports[_0xec40('0xc1')]=function(_0x40ec88,_0x205588,_0xd81d3a){return db[_0xec40('0x42')]['find']({'where':{'id':_0x40ec88[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x205588,null))[_0xec40('0x35')](function(_0x14ad94){if(_0x14ad94){return _0x14ad94[_0xec40('0xc1')](_0x40ec88[_0xec40('0x48')][_0xec40('0x6d')])['then'](function(){if(_[_0xec40('0xc2')](_0x40ec88[_0xec40('0x48')][_0xec40('0x6d')])){for(var _0x4ff952=0x0;_0x4ff952<_0x40ec88['query'][_0xec40('0x6d')][_0xec40('0x4d')];_0x4ff952+=0x1){socket[_0xec40('0xc0')](_0xec40('0xc3'),{'UserId':Number(_0x40ec88[_0xec40('0x48')][_0xec40('0x6d')][_0x4ff952]),'FaxAccountId':Number(_0x40ec88[_0xec40('0x5b')]['id'])});}}else{socket[_0xec40('0xc0')](_0xec40('0xc3'),{'UserId':Number(_0x40ec88[_0xec40('0x48')][_0xec40('0x6d')]),'FaxAccountId':Number(_0x40ec88[_0xec40('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x205588,null))[_0xec40('0x29')](handleError(_0x205588,null));};exports[_0xec40('0xc4')]=function(_0x2ec582,_0x3e96c5,_0x276de5){var _0x5db08c={};var _0xa0020a={};var _0x4827f0;var _0x4bc175;return db[_0xec40('0x42')][_0xec40('0x69')]({'where':{'id':_0x2ec582[_0xec40('0x5b')]['id']}})[_0xec40('0x35')](handleEntityNotFound(_0x3e96c5,null))[_0xec40('0x35')](function(_0x33e0f4){if(_0x33e0f4){_0x4827f0=_0x33e0f4;_0xa0020a['model']=_[_0xec40('0x47')](db[_0xec40('0x77')][_0xec40('0x43')]);_0xa0020a['query']=_[_0xec40('0x47')](_0x2ec582[_0xec40('0x48')]);_0xa0020a[_0xec40('0x49')]=_[_0xec40('0x4b')](_0xa0020a[_0xec40('0x46')],_0xa0020a[_0xec40('0x48')]);_0x5db08c['attributes']=_[_0xec40('0x4b')](_0xa0020a[_0xec40('0x46')],qs[_0xec40('0x4c')](_0x2ec582[_0xec40('0x48')][_0xec40('0x4c')]));_0x5db08c[_0xec40('0x4a')]=_0x5db08c[_0xec40('0x4a')][_0xec40('0x4d')]?_0x5db08c[_0xec40('0x4a')]:_0xa0020a[_0xec40('0x46')];_0x5db08c[_0xec40('0x50')]=qs['sort'](_0x2ec582[_0xec40('0x48')][_0xec40('0x51')]);_0x5db08c[_0xec40('0x54')]=qs[_0xec40('0x49')](_[_0xec40('0x52')](_0x2ec582[_0xec40('0x48')],_0xa0020a['filters']));if(_0x2ec582[_0xec40('0x48')]['filter']){_0x5db08c[_0xec40('0x54')]=_[_0xec40('0x55')](_0x5db08c[_0xec40('0x54')],{'$or':_[_0xec40('0x41')](_0x5db08c['attributes'],function(_0x32f1c6){var _0x2838e3={};_0x2838e3[_0x32f1c6]={'$like':'%'+_0x2ec582[_0xec40('0x48')][_0xec40('0x53')]+'%'};return _0x2838e3;})});}_0x5db08c=_[_0xec40('0x55')]({},_0x5db08c,_0x2ec582[_0xec40('0x57')]);return _0x4827f0['getAgents'](_0x5db08c);}})[_0xec40('0x35')](function(_0x2f2b5f){if(_0x2f2b5f){_0x4bc175=_0x2f2b5f['length'];if(!_0x2ec582['query'][_0xec40('0x6a')]('nolimit')){_0x5db08c[_0xec40('0x4f')]=qs[_0xec40('0x4f')](_0x2ec582[_0xec40('0x48')][_0xec40('0x4f')]);_0x5db08c['offset']=qs['offset'](_0x2ec582[_0xec40('0x48')][_0xec40('0x2d')]);}return _0x4827f0['getAgents'](_0x5db08c);}})[_0xec40('0x35')](function(_0x3f1c6e){if(_0x3f1c6e){return _0x3f1c6e?{'count':_0x4bc175,'rows':_0x3f1c6e}:null;}})[_0xec40('0x35')](respondWithResult(_0x3e96c5,null))[_0xec40('0x29')](handleError(_0x3e96c5,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index cc78636..a24eaa3 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 _0x78a4=['emit','hasOwnProperty','hook','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x49d010,_0x4cd5ae){var _0x147755=function(_0x29ab55){while(--_0x29ab55){_0x49d010['push'](_0x49d010['shift']());}};_0x147755(++_0x4cd5ae);}(_0x78a4,0x12c));var _0x478a=function(_0x390752,_0x42cad3){_0x390752=_0x390752-0x0;var _0x5eca55=_0x78a4[_0x390752];return _0x5eca55;};'use strict';var EventEmitter=require(_0x478a('0x0'));var FaxAccount=require(_0x478a('0x1'))['db'][_0x478a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x478a('0x3')](0x0);var events={'afterCreate':_0x478a('0x4'),'afterUpdate':_0x478a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5f0d01){return function(_0x5c541a,_0x3a5bb2,_0x56e017){FaxAccountEvents['emit'](_0x5f0d01+':'+_0x5c541a['id'],_0x5c541a);FaxAccountEvents[_0x478a('0x6')](_0x5f0d01,_0x5c541a);_0x56e017(null);};}for(var e in events){if(events[_0x478a('0x7')](e)){var event=events[e];FaxAccount[_0x478a('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x4407=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x4407,0x12e));var _0x7440=function(_0x55f59e,_0x966db7){_0x55f59e=_0x55f59e-0x0;var _0x272cd3=_0x4407[_0x55f59e];return _0x272cd3;};'use strict';var EventEmitter=require(_0x7440('0x0'));var FaxAccount=require(_0x7440('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7440('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7440('0x3')};function emitEvent(_0x2bac76){return function(_0x45f059,_0x688b3e,_0x5df893){FaxAccountEvents[_0x7440('0x4')](_0x2bac76+':'+_0x45f059['id'],_0x45f059);FaxAccountEvents['emit'](_0x2bac76,_0x45f059);_0x5df893(null);};}for(var e in events){if(events[_0x7440('0x5')](e)){var event=events[e];FaxAccount[_0x7440('0x6')](e,emitEvent(event));}}module[_0x7440('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index a91df56..7b851a7 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 _0x5878=['fax_accounts','lodash','util','../../config/logger','api','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x40c6a7,_0x4fc99d){var _0x37f57d=function(_0x3ada7e){while(--_0x3ada7e){_0x40c6a7['push'](_0x40c6a7['shift']());}};_0x37f57d(++_0x4fc99d);}(_0x5878,0x1b9));var _0x8587=function(_0x5238b0,_0x27d80a){_0x5238b0=_0x5238b0-0x0;var _0x2202f=_0x5878[_0x5238b0];return _0x2202f;};'use strict';var _=require(_0x8587('0x0'));var util=require(_0x8587('0x1'));var logger=require(_0x8587('0x2'))(_0x8587('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8587('0x4'));var config=require(_0x8587('0x5'));var attributes=require(_0x8587('0x6'));module[_0x8587('0x7')]=function(_0x48d17,_0x29728f){return _0x48d17[_0x8587('0x8')](_0x8587('0x9'),attributes,{'tableName':_0x8587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x043d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x043d,0x9c));var _0xd043=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x043d[_0x408d22];return _0x58effd;};'use strict';var _=require('lodash');var util=require(_0xd043('0x0'));var logger=require(_0xd043('0x1'))(_0xd043('0x2'));var moment=require(_0xd043('0x3'));var BPromise=require(_0xd043('0x4'));var rp=require(_0xd043('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd043('0x6'));var config=require(_0xd043('0x7'));var attributes=require(_0xd043('0x8'));module[_0xd043('0x9')]=function(_0x561154,_0x1e6ab5){return _0x561154[_0xd043('0xa')](_0xd043('0xb'),attributes,{'tableName':_0xd043('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 1985720..faa3d1b 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 _0x54d9=['FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','options','raw','where','attributes','limit','include','map','model','then','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','CmList','Applications','get','list','List','applications','orderBy','asc','Contacts','create','contact','FaxInteraction','find','Contact\x20not\x20found','autoclose','push','length','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x46cc9e,_0x51a09c){var _0x2afb41=function(_0x5ce282){while(--_0x5ce282){_0x46cc9e['push'](_0x46cc9e['shift']());}};_0x2afb41(++_0x51a09c);}(_0x54d9,0xf8));var _0x954d=function(_0x1c19d4,_0x146a9c){_0x1c19d4=_0x1c19d4-0x0;var _0x110ffa=_0x54d9[_0x1c19d4];return _0x110ffa;};'use strict';var _=require(_0x954d('0x0'));var util=require(_0x954d('0x1'));var moment=require(_0x954d('0x2'));var BPromise=require(_0x954d('0x3'));var rs=require(_0x954d('0x4'));var fs=require('fs');var Redis=require(_0x954d('0x5'));var db=require(_0x954d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x954d('0x7'))(_0x954d('0x8'));var config=require('../../config/environment');var jayson=require(_0x954d('0x9'));var client=jayson[_0x954d('0xa')][_0x954d('0xb')]({'port':0x232c});config['redis']=_[_0x954d('0xc')](config[_0x954d('0xd')],{'host':_0x954d('0xe'),'port':0x18eb});var socket=require(_0x954d('0xf'))(new Redis(config[_0x954d('0xd')]));require('./faxAccount.socket')[_0x954d('0x10')](socket);function respondWithRpcPromise(_0x439a4e,_0x3b5b5e,_0x30d9c9){return new BPromise(function(_0x3c6767,_0x1e1e98){return client[_0x954d('0x11')](_0x439a4e,_0x30d9c9)['then'](function(_0x15ed37){logger[_0x954d('0x12')]('FaxAccount,\x20%s,\x20%s',_0x3b5b5e,_0x954d('0x13'));logger[_0x954d('0x14')](_0x954d('0x15'),_0x3b5b5e,_0x954d('0x13'),JSON['stringify'](_0x15ed37));if(_0x15ed37['error']){if(_0x15ed37[_0x954d('0x16')][_0x954d('0x17')]===0x1f4){logger[_0x954d('0x16')]('FaxAccount,\x20%s,\x20%s',_0x3b5b5e,_0x15ed37[_0x954d('0x16')][_0x954d('0x18')]);return _0x1e1e98(_0x15ed37[_0x954d('0x16')][_0x954d('0x18')]);}logger[_0x954d('0x16')]('FaxAccount,\x20%s,\x20%s',_0x3b5b5e,_0x15ed37[_0x954d('0x16')]['message']);return _0x3c6767(_0x15ed37['error'][_0x954d('0x18')]);}else{logger[_0x954d('0x12')](_0x954d('0x19'),_0x3b5b5e,_0x954d('0x13'));_0x3c6767(_0x15ed37[_0x954d('0x1a')][_0x954d('0x18')]);}})[_0x954d('0x1b')](function(_0x129e56){logger['error'](_0x954d('0x19'),_0x3b5b5e,_0x129e56);_0x1e1e98(_0x129e56);});});}exports[_0x954d('0x1c')]=function(_0x22d263){var _0x4ea862=this;return new Promise(function(_0xf7c7bf,_0x23650f){return db['FaxAccount']['findAll']({'raw':_0x22d263[_0x954d('0x1d')]?_0x22d263[_0x954d('0x1d')][_0x954d('0x1e')]===undefined?!![]:![]:!![],'where':_0x22d263[_0x954d('0x1d')]?_0x22d263[_0x954d('0x1d')][_0x954d('0x1f')]||null:null,'attributes':_0x22d263[_0x954d('0x1d')]?_0x22d263[_0x954d('0x1d')][_0x954d('0x20')]||null:null,'limit':_0x22d263['options']?_0x22d263[_0x954d('0x1d')][_0x954d('0x21')]||null:null,'include':_0x22d263[_0x954d('0x1d')]?_0x22d263[_0x954d('0x1d')][_0x954d('0x22')]?_[_0x954d('0x23')](_0x22d263[_0x954d('0x1d')][_0x954d('0x22')],function(_0x3bf489){return{'model':db[_0x3bf489[_0x954d('0x24')]],'as':_0x3bf489['as'],'attributes':_0x3bf489[_0x954d('0x20')],'include':_0x3bf489[_0x954d('0x22')]?_[_0x954d('0x23')](_0x3bf489[_0x954d('0x22')],function(_0x4602f4){return{'model':db[_0x4602f4[_0x954d('0x24')]],'as':_0x4602f4['as'],'attributes':_0x4602f4[_0x954d('0x20')],'include':_0x4602f4['include']?_[_0x954d('0x23')](_0x4602f4[_0x954d('0x22')],function(_0x598d93){return{'model':db[_0x598d93['model']],'as':_0x598d93['as'],'attributes':_0x598d93[_0x954d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x954d('0x25')](function(_0x5be2c1){logger['info'](_0x954d('0x1c'),_0x22d263);logger[_0x954d('0x14')](_0x954d('0x1c'),_0x22d263,JSON[_0x954d('0x26')](_0x5be2c1));_0xf7c7bf(_0x5be2c1);})[_0x954d('0x1b')](function(_0x16a6ef){logger[_0x954d('0x16')](_0x954d('0x1c'),_0x16a6ef[_0x954d('0x18')],_0x22d263);_0x23650f(_0x4ea862[_0x954d('0x16')](0x1f4,_0x16a6ef['message']));});});};exports[_0x954d('0x27')]=function(_0x36e081,_0xaeec53,_0x1bb5b7){var _0x2b53bf=this;return new Promise(function(_0x1aba1f,_0x1441c6){var _0x4c8d63={'body':_0x36e081[_0x954d('0x28')],'channel':_0x954d('0x29')};var _0x2c4e3d=[];var _0x393168=[];var _0x5e658f={};return db[_0x954d('0x2a')][_0x954d('0x2b')]()['then'](function(_0x2d41a9){if(!_0x2d41a9){throw new db[(_0x954d('0x2c'))][(_0x954d('0x2d'))](_0x954d('0x2e'));}_0x2c4e3d=_[_0x954d('0x2f')](_['keys'](_0x2d41a9),['createdAt','updatedAt']);_0x393168=_[_0x954d('0x2f')](_['keys'](_0x2d41a9),[_0x954d('0x30'),_0x954d('0x31'),_0x954d('0x32'),_0x954d('0x33')]);if(_0x36e081['body']['id']){delete _0x36e081[_0x954d('0x28')]['id'];}if(_[_0x954d('0x34')](_0x36e081['body'][_0x954d('0x35')])){throw new db[(_0x954d('0x2c'))][(_0x954d('0x2d'))](_0x954d('0x36'));}if(_[_0x954d('0x34')](_0x36e081[_0x954d('0x28')][_0x954d('0x28')])||_0x36e081[_0x954d('0x28')][_0x954d('0x28')]===''){throw new db[(_0x954d('0x2c'))][(_0x954d('0x2d'))](_0x954d('0x37'));}if(_[_0x954d('0x34')](_0x36e081[_0x954d('0x28')]['mapKey'])){throw new db['Sequelize'][(_0x954d('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x393168);}if(!_[_0x954d('0x38')](_0x393168,_0x36e081[_0x954d('0x28')][_0x954d('0x39')])){throw new db[(_0x954d('0x2c'))]['ValidationError'](_0x954d('0x3a')+_0x393168);}_0x5e658f[_0x36e081['body'][_0x954d('0x39')]]=_0x36e081['body'][_0x954d('0x35')];})['then'](function(){return db[_0x954d('0x3b')]['find']({'where':{'id':_0x36e081[_0x954d('0x3c')]['id']},'include':[{'model':db[_0x954d('0x3d')],'as':'List','include':[{'model':db[_0x954d('0x2a')],'as':'Contacts','where':_0x5e658f,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':_0x954d('0x3e')}]});})[_0x954d('0x25')](function(_0x3161aa){if(_0x3161aa&&_0x3161aa['List']){var _0x10328c=_0x3161aa[_0x954d('0x3f')]({'plain':!![]});_0x4c8d63[_0x954d('0x3c')]=_0x10328c;_0x4c8d63['applications']=_0x10328c['Applications'];_0x4c8d63[_0x954d('0x40')]=_0x10328c[_0x954d('0x41')];_0x4c8d63[_0x954d('0x42')]=_[_0x954d('0x43')](_0x4c8d63[_0x954d('0x42')],['priority'],[_0x954d('0x44')]);if(_0x4c8d63[_0x954d('0x3c')][_0x954d('0x3e')]){delete _0x4c8d63[_0x954d('0x3c')][_0x954d('0x3e')];}if(_0x4c8d63[_0x954d('0x3c')]['List']&&_0x4c8d63[_0x954d('0x3c')][_0x954d('0x41')]['Contacts']['length']){return _0x4c8d63[_0x954d('0x3c')][_0x954d('0x41')][_0x954d('0x45')][0x0];}var _0xfcca0b=_[_0x954d('0xc')](_0x36e081[_0x954d('0x28')],{'firstName':_0x36e081[_0x954d('0x28')][_0x954d('0x35')],'ListId':_0x10328c[_0x954d('0x33')]});_0xfcca0b[_0x36e081[_0x954d('0x28')]['mapKey']]=_0x36e081[_0x954d('0x28')][_0x954d('0x35')];return db[_0x954d('0x2a')][_0x954d('0x46')](_0xfcca0b,{'fields':_0x2c4e3d,'raw':!![]});}})[_0x954d('0x25')](function(_0x283925){_0x4c8d63[_0x954d('0x47')]=_0x283925;if(_0x283925){var _0x25ff05={'ContactId':_0x283925['id'],'FaxAccountId':_0x36e081['account']['id'],'fax':_0x283925[_0x954d('0x29')]};return db[_0x954d('0x48')][_0x954d('0x49')]({'where':{'ContactId':_0x283925['id'],'closed':![],'FaxAccountId':_0x36e081[_0x954d('0x3c')]['id']}})['then'](function(_0x3d537b){if(_0x3d537b){return[_0x3d537b,![]];}return db[_0x954d('0x48')]['create'](_0x25ff05)[_0x954d('0x25')](function(_0x3a866d){return[_0x3a866d,!![]];});});}else{throw new Error(_0x954d('0x4a'));}})['spread'](function(_0x489282,_0x31343b){var _0x47cbc4=_0x489282[_0x954d('0x3f')]({'plain':!![]});if(_0x31343b){if(_0x4c8d63[_0x954d('0x3c')][_0x954d('0x4b')]){_0x4c8d63[_0x954d('0x42')][_0x954d('0x4c')]({'id':0x0,'priority':_0x4c8d63['applications'][_0x954d('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x954d('0x4e')});}_0x47cbc4['created']=!![];}else{_0x47cbc4['created']=![];}_0x4c8d63[_0x954d('0x4f')]=_0x47cbc4;return db[_0x954d('0x50')][_0x954d('0x46')]({'body':_0x36e081[_0x954d('0x28')][_0x954d('0x28')],'FaxAccountId':_0x36e081[_0x954d('0x3c')]['id'],'FaxInteractionId':_0x489282['id'],'direction':'in','ContactId':_0x489282[_0x954d('0x51')],'AttachmentId':_0x36e081[_0x954d('0x28')][_0x954d('0x52')]});})[_0x954d('0x25')](function(_0x4f52f6){_0x4c8d63[_0x954d('0x18')]=_0x4f52f6;if(_0x4c8d63[_0x954d('0x4f')][_0x954d('0x53')]){return db[_0x954d('0x54')]['find']({'attributes':['id',_0x954d('0x55')],'where':{'id':_0x4c8d63[_0x954d('0x4f')][_0x954d('0x53')]}})[_0x954d('0x25')](function(_0x3241a2){if(_0x3241a2){_0x4c8d63['applications'][_0x954d('0x56')]({'id':0x0,'priority':0x0,'app':_0x954d('0x57'),'appdata':_0x3241a2['name']+','+(_0x4c8d63[_0x954d('0x3c')][_0x954d('0x58')]||0xa),'interval':_0x954d('0x4e')});}return respondWithRpcPromise(_0x954d('0x59'),_0x954d('0x5a'),_0x4c8d63);});}return respondWithRpcPromise(_0x954d('0x59'),'startRouting',_0x4c8d63);})[_0x954d('0x25')](function(_0x9bc08b){_0x1aba1f(_0x9bc08b);})[_0x954d('0x1b')](function(_0x51d96e){_0x1441c6(_0x2b53bf['error'](0x1f4,_0x51d96e[_0x954d('0x18')]));});});}; \ No newline at end of file +var _0xb0f8=['GetFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','Contacts','updatedAt','DESC','FaxApplication','Applications','applications','list','List','priority','length','defaults','contact','FaxInteraction','create','Contact\x20not\x20found','spread','push','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','raw','options','where','attributes','include','map','model'];(function(_0x411888,_0x21e751){var _0x186805=function(_0x105881){while(--_0x105881){_0x411888['push'](_0x411888['shift']());}};_0x186805(++_0x21e751);}(_0xb0f8,0xd6));var _0x8b0f=function(_0x3b806f,_0x4deb45){_0x3b806f=_0x3b806f-0x0;var _0x1c5af9=_0xb0f8[_0x3b806f];return _0x1c5af9;};'use strict';var _=require(_0x8b0f('0x0'));var util=require('util');var moment=require(_0x8b0f('0x1'));var BPromise=require(_0x8b0f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b0f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b0f('0x4'))(_0x8b0f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b0f('0x6')][_0x8b0f('0x7')]({'port':0x232c});config['redis']=_['defaults'](config[_0x8b0f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b0f('0x9'))(new Redis(config[_0x8b0f('0x8')]));require(_0x8b0f('0xa'))[_0x8b0f('0xb')](socket);function respondWithRpcPromise(_0x3b6297,_0x508db7,_0x417db0){return new BPromise(function(_0x5551f3,_0x5b18c4){return client[_0x8b0f('0xc')](_0x3b6297,_0x417db0)[_0x8b0f('0xd')](function(_0x4ea557){logger[_0x8b0f('0xe')](_0x8b0f('0xf'),_0x508db7,_0x8b0f('0x10'));logger[_0x8b0f('0x11')](_0x8b0f('0x12'),_0x508db7,'request\x20sent',JSON[_0x8b0f('0x13')](_0x4ea557));if(_0x4ea557[_0x8b0f('0x14')]){if(_0x4ea557[_0x8b0f('0x14')][_0x8b0f('0x15')]===0x1f4){logger[_0x8b0f('0x14')](_0x8b0f('0xf'),_0x508db7,_0x4ea557[_0x8b0f('0x14')][_0x8b0f('0x16')]);return _0x5b18c4(_0x4ea557[_0x8b0f('0x14')]['message']);}logger[_0x8b0f('0x14')]('FaxAccount,\x20%s,\x20%s',_0x508db7,_0x4ea557['error']['message']);return _0x5551f3(_0x4ea557[_0x8b0f('0x14')][_0x8b0f('0x16')]);}else{logger[_0x8b0f('0xe')]('FaxAccount,\x20%s,\x20%s',_0x508db7,_0x8b0f('0x10'));_0x5551f3(_0x4ea557['result'][_0x8b0f('0x16')]);}})[_0x8b0f('0x17')](function(_0x13c21c){logger[_0x8b0f('0x14')](_0x8b0f('0xf'),_0x508db7,_0x13c21c);_0x5b18c4(_0x13c21c);});});}exports['GetFaxAccount']=function(_0x48e820){var _0x42425c=this;return new Promise(function(_0x4d86e6,_0x590be2){return db['FaxAccount'][_0x8b0f('0x18')]({'raw':_0x48e820['options']?_0x48e820['options'][_0x8b0f('0x19')]===undefined?!![]:![]:!![],'where':_0x48e820[_0x8b0f('0x1a')]?_0x48e820[_0x8b0f('0x1a')][_0x8b0f('0x1b')]||null:null,'attributes':_0x48e820[_0x8b0f('0x1a')]?_0x48e820['options'][_0x8b0f('0x1c')]||null:null,'limit':_0x48e820['options']?_0x48e820[_0x8b0f('0x1a')]['limit']||null:null,'include':_0x48e820[_0x8b0f('0x1a')]?_0x48e820[_0x8b0f('0x1a')][_0x8b0f('0x1d')]?_[_0x8b0f('0x1e')](_0x48e820[_0x8b0f('0x1a')]['include'],function(_0x50c627){return{'model':db[_0x50c627[_0x8b0f('0x1f')]],'as':_0x50c627['as'],'attributes':_0x50c627[_0x8b0f('0x1c')],'include':_0x50c627[_0x8b0f('0x1d')]?_['map'](_0x50c627['include'],function(_0x3a88f6){return{'model':db[_0x3a88f6[_0x8b0f('0x1f')]],'as':_0x3a88f6['as'],'attributes':_0x3a88f6[_0x8b0f('0x1c')],'include':_0x3a88f6[_0x8b0f('0x1d')]?_[_0x8b0f('0x1e')](_0x3a88f6['include'],function(_0x10abc1){return{'model':db[_0x10abc1[_0x8b0f('0x1f')]],'as':_0x10abc1['as'],'attributes':_0x10abc1['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b0f('0xd')](function(_0x54c26f){logger[_0x8b0f('0xe')]('GetFaxAccount',_0x48e820);logger['debug'](_0x8b0f('0x20'),_0x48e820,JSON[_0x8b0f('0x13')](_0x54c26f));_0x4d86e6(_0x54c26f);})['catch'](function(_0x80fbf3){logger[_0x8b0f('0x14')](_0x8b0f('0x20'),_0x80fbf3['message'],_0x48e820);_0x590be2(_0x42425c['error'](0x1f4,_0x80fbf3[_0x8b0f('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x27b757,_0x4df730,_0x47856a){var _0x33ef4e=this;return new Promise(function(_0x1f84b2,_0x1d5731){var _0x1ca786={'body':_0x27b757[_0x8b0f('0x21')],'channel':'fax'};var _0x242a23=[];var _0x26a3ed=[];var _0x3558c3={};return db[_0x8b0f('0x22')][_0x8b0f('0x23')]()[_0x8b0f('0xd')](function(_0x4ee80c){if(!_0x4ee80c){throw new db[(_0x8b0f('0x24'))]['ValidationError'](_0x8b0f('0x25'));}_0x242a23=_[_0x8b0f('0x26')](_[_0x8b0f('0x27')](_0x4ee80c),[_0x8b0f('0x28'),'updatedAt']);_0x26a3ed=_[_0x8b0f('0x26')](_['keys'](_0x4ee80c),['createdAt','updatedAt',_0x8b0f('0x29'),_0x8b0f('0x2a')]);if(_0x27b757['body']['id']){delete _0x27b757['body']['id'];}if(_[_0x8b0f('0x2b')](_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x2c')])){throw new db['Sequelize'][(_0x8b0f('0x2d'))](_0x8b0f('0x2e'));}if(_[_0x8b0f('0x2b')](_0x27b757['body'][_0x8b0f('0x21')])||_0x27b757[_0x8b0f('0x21')]['body']===''){throw new db[(_0x8b0f('0x24'))][(_0x8b0f('0x2d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8b0f('0x2b')](_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x2f')])){throw new db['Sequelize'][(_0x8b0f('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x26a3ed);}if(!_[_0x8b0f('0x30')](_0x26a3ed,_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x2f')])){throw new db['Sequelize'][(_0x8b0f('0x2d'))](_0x8b0f('0x31')+_0x26a3ed);}_0x3558c3[_0x27b757[_0x8b0f('0x21')]['mapKey']]=_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x2c')];})[_0x8b0f('0xd')](function(){return db[_0x8b0f('0x32')][_0x8b0f('0x33')]({'where':{'id':_0x27b757[_0x8b0f('0x34')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8b0f('0x22')],'as':_0x8b0f('0x35'),'where':_0x3558c3,'limit':0x1,'order':[[_0x8b0f('0x36'),_0x8b0f('0x37')]]}]},{'model':db[_0x8b0f('0x38')],'as':_0x8b0f('0x39')}]});})[_0x8b0f('0xd')](function(_0x4b164e){if(_0x4b164e&&_0x4b164e['List']){var _0x291a26=_0x4b164e['get']({'plain':!![]});_0x1ca786[_0x8b0f('0x34')]=_0x291a26;_0x1ca786[_0x8b0f('0x3a')]=_0x291a26['Applications'];_0x1ca786[_0x8b0f('0x3b')]=_0x291a26[_0x8b0f('0x3c')];_0x1ca786['applications']=_['orderBy'](_0x1ca786[_0x8b0f('0x3a')],[_0x8b0f('0x3d')],['asc']);if(_0x1ca786[_0x8b0f('0x34')]['Applications']){delete _0x1ca786['account']['Applications'];}if(_0x1ca786[_0x8b0f('0x34')][_0x8b0f('0x3c')]&&_0x1ca786['account'][_0x8b0f('0x3c')]['Contacts'][_0x8b0f('0x3e')]){return _0x1ca786[_0x8b0f('0x34')]['List']['Contacts'][0x0];}var _0x4789ed=_[_0x8b0f('0x3f')](_0x27b757[_0x8b0f('0x21')],{'firstName':_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x2c')],'ListId':_0x291a26[_0x8b0f('0x2a')]});_0x4789ed[_0x27b757['body'][_0x8b0f('0x2f')]]=_0x27b757['body'][_0x8b0f('0x2c')];return db[_0x8b0f('0x22')]['create'](_0x4789ed,{'fields':_0x242a23,'raw':!![]});}})[_0x8b0f('0xd')](function(_0x51fadf){_0x1ca786[_0x8b0f('0x40')]=_0x51fadf;if(_0x51fadf){var _0x3229f5={'ContactId':_0x51fadf['id'],'FaxAccountId':_0x27b757[_0x8b0f('0x34')]['id'],'fax':_0x51fadf['fax']};return db[_0x8b0f('0x41')][_0x8b0f('0x33')]({'where':{'ContactId':_0x51fadf['id'],'closed':![],'FaxAccountId':_0x27b757[_0x8b0f('0x34')]['id']}})[_0x8b0f('0xd')](function(_0x4e15e5){if(_0x4e15e5){return[_0x4e15e5,![]];}return db[_0x8b0f('0x41')][_0x8b0f('0x42')](_0x3229f5)[_0x8b0f('0xd')](function(_0x3ed3ad){return[_0x3ed3ad,!![]];});});}else{throw new Error(_0x8b0f('0x43'));}})[_0x8b0f('0x44')](function(_0x56813,_0x55a11c){var _0x4087cb=_0x56813['get']({'plain':!![]});if(_0x55a11c){if(_0x1ca786[_0x8b0f('0x34')]['autoclose']){_0x1ca786['applications'][_0x8b0f('0x45')]({'id':0x0,'priority':_0x1ca786[_0x8b0f('0x3a')]['length']+0x1,'app':'close','appdata':_0x8b0f('0x46'),'interval':_0x8b0f('0x47')});}_0x4087cb[_0x8b0f('0x48')]=!![];}else{_0x4087cb['created']=![];}_0x1ca786[_0x8b0f('0x49')]=_0x4087cb;return db['FaxMessage']['create']({'body':_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x21')],'FaxAccountId':_0x27b757['account']['id'],'FaxInteractionId':_0x56813['id'],'direction':'in','ContactId':_0x56813[_0x8b0f('0x4a')],'AttachmentId':_0x27b757[_0x8b0f('0x21')][_0x8b0f('0x4b')]});})[_0x8b0f('0xd')](function(_0x39dcae){_0x1ca786[_0x8b0f('0x16')]=_0x39dcae;if(_0x1ca786[_0x8b0f('0x49')][_0x8b0f('0x4c')]){return db['User'][_0x8b0f('0x33')]({'attributes':['id',_0x8b0f('0x4d')],'where':{'id':_0x1ca786[_0x8b0f('0x49')]['UserId']}})[_0x8b0f('0xd')](function(_0x3b8c91){if(_0x3b8c91){_0x1ca786['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x8b0f('0x4e'),'appdata':_0x3b8c91[_0x8b0f('0x4d')]+','+(_0x1ca786['account'][_0x8b0f('0x4f')]||0xa),'interval':_0x8b0f('0x47')});}return respondWithRpcPromise(_0x8b0f('0x50'),'startRouting',_0x1ca786);});}return respondWithRpcPromise(_0x8b0f('0x50'),_0x8b0f('0x51'),_0x1ca786);})[_0x8b0f('0xd')](function(_0x2958fb){_0x1f84b2(_0x2958fb);})[_0x8b0f('0x17')](function(_0x3c3175){_0x1d5731(_0x33ef4e[_0x8b0f('0x14')](0x1f4,_0x3c3175[_0x8b0f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 44cc99a..6b8ece5 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 _0x072a=['register','length','faxAccount:','./faxAccount.events','save','remove','emit','removeListener'];(function(_0x2256f9,_0x324540){var _0x2bb9f3=function(_0x12a7c2){while(--_0x12a7c2){_0x2256f9['push'](_0x2256f9['shift']());}};_0x2bb9f3(++_0x324540);}(_0x072a,0x6b));var _0xa072=function(_0xd86a32,_0x4d3e6c){_0xd86a32=_0xd86a32-0x0;var _0x4b531e=_0x072a[_0xd86a32];return _0x4b531e;};'use strict';var FaxAccountEvents=require(_0xa072('0x0'));var events=[_0xa072('0x1'),_0xa072('0x2'),'update'];function createListener(_0x2f5a62,_0x1510a4){return function(_0x39b600){_0x1510a4[_0xa072('0x3')](_0x2f5a62,_0x39b600);};}function removeListener(_0x464819,_0x4ea36d){return function(){FaxAccountEvents[_0xa072('0x4')](_0x464819,_0x4ea36d);};}exports[_0xa072('0x5')]=function(_0x344dfc){for(var _0x24cfde=0x0,_0x557ff6=events[_0xa072('0x6')];_0x24cfde<_0x557ff6;_0x24cfde++){var _0x5d42af=events[_0x24cfde];var _0x308be0=createListener(_0xa072('0x7')+_0x5d42af,_0x344dfc);FaxAccountEvents['on'](_0x5d42af,_0x308be0);}}; \ No newline at end of file +var _0x4ef0=['emit','faxAccount:','update'];(function(_0x4fc970,_0x56064c){var _0x169140=function(_0x1d4c8e){while(--_0x1d4c8e){_0x4fc970['push'](_0x4fc970['shift']());}};_0x169140(++_0x56064c);}(_0x4ef0,0xda));var _0x04ef=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x4ef0[_0x245afe];return _0x4eefde;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove',_0x04ef('0x0')];function createListener(_0x83c748,_0xf7cdc3){return function(_0x4e7107){_0xf7cdc3[_0x04ef('0x1')](_0x83c748,_0x4e7107);};}function removeListener(_0x5e416c,_0x436d6e){return function(){FaxAccountEvents['removeListener'](_0x5e416c,_0x436d6e);};}exports['register']=function(_0x33c74a){for(var _0x30bb8c=0x0,_0x24f09f=events['length'];_0x30bb8c<_0x24f09f;_0x30bb8c++){var _0x3bc711=events[_0x30bb8c];var _0x2501f9=createListener(_0x04ef('0x2')+_0x3bc711,_0x33c74a);FaxAccountEvents['on'](_0x3bc711,_0x2501f9);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9d59719..7112950 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_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['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(_0x1a5a59,_0x1fa824){var _0x40491d=function(_0x4024e5){while(--_0x4024e5){_0x1a5a59['push'](_0x1a5a59['shift']());}};_0x40491d(++_0x1fa824);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 423e6e9..c3c42e0 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 _0x270d=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3c53ab,_0xa68c67){var _0x475aa6=function(_0x361569){while(--_0x361569){_0x3c53ab['push'](_0x3c53ab['shift']());}};_0x475aa6(++_0xa68c67);}(_0x270d,0x180));var _0xd270=function(_0x3b9ae1,_0x1efdf6){_0x3b9ae1=_0x3b9ae1-0x0;var _0x29367e=_0x270d[_0x3b9ae1];return _0x29367e;};'use strict';var Sequelize=require(_0xd270('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd270('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd270('0x2')],'allowNull':![],'defaultValue':_0xd270('0x3')},'appdata':{'type':Sequelize[_0xd270('0x4')]()},'description':{'type':Sequelize[_0xd270('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd270('0x5')}}; \ No newline at end of file +var _0xb647=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xe10904,_0x3d51c7){var _0x2d96d6=function(_0x57b888){while(--_0x57b888){_0xe10904['push'](_0xe10904['shift']());}};_0x2d96d6(++_0x3d51c7);}(_0xb647,0x15a));var _0x7b64=function(_0x272224,_0x56bf40){_0x272224=_0x272224-0x0;var _0x564eab=_0xb647[_0x272224];return _0x564eab;};'use strict';var Sequelize=require(_0x7b64('0x0'));module[_0x7b64('0x1')]={'priority':{'type':Sequelize[_0x7b64('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7b64('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7b64('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7b64('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index dd4c320..06d4236 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 _0x2e2c=['body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FaxApplication','then','includeAll','catch','show','params','filters','intersection','length','include','create'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x2e2c,0x1be));var _0xc2e2=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x2e2c[_0x3f2228];return _0x285ae4;};'use strict';var emlformat=require(_0xc2e2('0x0'));var rimraf=require(_0xc2e2('0x1'));var zipdir=require(_0xc2e2('0x2'));var jsonpatch=require(_0xc2e2('0x3'));var rp=require(_0xc2e2('0x4'));var moment=require(_0xc2e2('0x5'));var BPromise=require(_0xc2e2('0x6'));var Mustache=require(_0xc2e2('0x7'));var util=require(_0xc2e2('0x8'));var path=require('path');var sox=require(_0xc2e2('0x9'));var csv=require(_0xc2e2('0xa'));var ejs=require(_0xc2e2('0xb'));var fs=require('fs');var fs_extra=require(_0xc2e2('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc2e2('0xd'));var deskjs=require(_0xc2e2('0xe'));var toCsv=require(_0xc2e2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc2e2('0xf'));var authService=require(_0xc2e2('0x10'));var qs=require(_0xc2e2('0x11'));var as=require(_0xc2e2('0x12'));var hardwareService=require(_0xc2e2('0x13'));var logger=require('../../config/logger')(_0xc2e2('0x14'));var utils=require(_0xc2e2('0x15'));var config=require(_0xc2e2('0x16'));var licenseUtil=require(_0xc2e2('0x17'));var db=require(_0xc2e2('0x18'))['db'];function respondWithStatusCode(_0x252f62,_0x45820e){_0x45820e=_0x45820e||0xcc;return function(_0x503c37){if(_0x503c37){return _0x252f62[_0xc2e2('0x19')](_0x45820e);}return _0x252f62[_0xc2e2('0x1a')](_0x45820e)[_0xc2e2('0x1b')]();};}function respondWithResult(_0x5a20e0,_0x4d352e){_0x4d352e=_0x4d352e||0xc8;return function(_0x6b0ad9){if(_0x6b0ad9){return _0x5a20e0['status'](_0x4d352e)[_0xc2e2('0x1c')](_0x6b0ad9);}};}function respondWithFilteredResult(_0x1f9c46,_0x486660){return function(_0x560481){if(_0x560481){var _0x426f04=typeof _0x486660['offset']===_0xc2e2('0x1d')&&typeof _0x486660[_0xc2e2('0x1e')]===_0xc2e2('0x1d');var _0x42212a=_0x560481[_0xc2e2('0x1f')];var _0xfea89=_0x426f04?0x0:_0x486660[_0xc2e2('0x20')];var _0xa13bb8=_0x426f04?_0x560481['count']:_0x486660[_0xc2e2('0x20')]+_0x486660[_0xc2e2('0x1e')];var _0x31a703;if(_0xa13bb8>=_0x42212a){_0xa13bb8=_0x42212a;_0x31a703=0xc8;}else{_0x31a703=0xce;}_0x1f9c46[_0xc2e2('0x1a')](_0x31a703);return _0x1f9c46[_0xc2e2('0x21')](_0xc2e2('0x22'),_0xfea89+'-'+_0xa13bb8+'/'+_0x42212a)[_0xc2e2('0x1c')](_0x560481);}return null;};}function patchUpdates(_0xc6aaf4){return function(_0x53e676){try{jsonpatch[_0xc2e2('0x23')](_0x53e676,_0xc6aaf4,!![]);}catch(_0x4e8082){return BPromise['reject'](_0x4e8082);}return _0x53e676['save']();};}function saveUpdates(_0x398b9d,_0xf05da9){return function(_0xa643b0){if(_0xa643b0){return _0xa643b0[_0xc2e2('0x24')](_0x398b9d)['then'](function(_0x3a4e81){return _0x3a4e81;});}return null;};}function removeEntity(_0x81e030,_0x317935){return function(_0x1095f3){if(_0x1095f3){return _0x1095f3['destroy']()['then'](function(){_0x81e030['status'](0xcc)[_0xc2e2('0x1b')]();});}};}function handleEntityNotFound(_0x4caf6d,_0x34bc59){return function(_0x270c5e){if(!_0x270c5e){_0x4caf6d[_0xc2e2('0x19')](0x194);}return _0x270c5e;};}function handleError(_0x5c66a4,_0x37ea4d){_0x37ea4d=_0x37ea4d||0x1f4;return function(_0x38195b){logger[_0xc2e2('0x25')](_0x38195b[_0xc2e2('0x26')]);if(_0x38195b['name']){delete _0x38195b[_0xc2e2('0x27')];}_0x5c66a4[_0xc2e2('0x1a')](_0x37ea4d)['send'](_0x38195b);};}exports[_0xc2e2('0x28')]=function(_0x32d97f,_0x48d99f){var _0x3b36f8={},_0x200e3e={},_0x13d1e9={'count':0x0,'rows':[]};var _0x593ff9=_[_0xc2e2('0x29')](db['FaxApplication'][_0xc2e2('0x2a')],function(_0x4cc53d){return{'name':_0x4cc53d[_0xc2e2('0x2b')],'type':_0x4cc53d['type'][_0xc2e2('0x2c')]};});_0x200e3e['model']=_[_0xc2e2('0x29')](_0x593ff9,_0xc2e2('0x27'));_0x200e3e[_0xc2e2('0x2d')]=_[_0xc2e2('0x2e')](_0x32d97f[_0xc2e2('0x2d')]);_0x200e3e['filters']=_['intersection'](_0x200e3e['model'],_0x200e3e[_0xc2e2('0x2d')]);_0x3b36f8[_0xc2e2('0x2f')]=_['intersection'](_0x200e3e[_0xc2e2('0x30')],qs['fields'](_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x31')]));_0x3b36f8[_0xc2e2('0x2f')]=_0x3b36f8[_0xc2e2('0x2f')]['length']?_0x3b36f8['attributes']:_0x200e3e[_0xc2e2('0x30')];if(!_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x32')](_0xc2e2('0x33'))){_0x3b36f8[_0xc2e2('0x1e')]=qs[_0xc2e2('0x1e')](_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x1e')]);_0x3b36f8[_0xc2e2('0x20')]=qs[_0xc2e2('0x20')](_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x20')]);}_0x3b36f8[_0xc2e2('0x34')]=qs['sort'](_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x35')]);_0x3b36f8[_0xc2e2('0x36')]=qs['filters'](_[_0xc2e2('0x37')](_0x32d97f[_0xc2e2('0x2d')],_0x200e3e['filters']),_0x593ff9);if(_0x32d97f['query'][_0xc2e2('0x38')]){_0x3b36f8[_0xc2e2('0x36')]=_['merge'](_0x3b36f8['where'],{'$or':_[_0xc2e2('0x29')](_0x593ff9,function(_0x3b46f3){if(_0x3b46f3[_0xc2e2('0x39')]!==_0xc2e2('0x3a')){var _0x55da9a={};_0x55da9a[_0x3b46f3['name']]={'$like':'%'+_0x32d97f[_0xc2e2('0x2d')][_0xc2e2('0x38')]+'%'};return _0x55da9a;}})});}_0x3b36f8=_[_0xc2e2('0x3b')]({},_0x3b36f8,_0x32d97f[_0xc2e2('0x3c')]);var _0x45e834={'where':_0x3b36f8[_0xc2e2('0x36')]};return db[_0xc2e2('0x3d')][_0xc2e2('0x1f')](_0x45e834)[_0xc2e2('0x3e')](function(_0x5e9095){_0x13d1e9[_0xc2e2('0x1f')]=_0x5e9095;if(_0x32d97f['query'][_0xc2e2('0x3f')]){_0x3b36f8['include']=[{'all':!![]}];}return db[_0xc2e2('0x3d')]['findAll'](_0x3b36f8);})['then'](function(_0x694c3){_0x13d1e9['rows']=_0x694c3;return _0x13d1e9;})[_0xc2e2('0x3e')](respondWithFilteredResult(_0x48d99f,_0x3b36f8))[_0xc2e2('0x40')](handleError(_0x48d99f,null));};exports[_0xc2e2('0x41')]=function(_0x497add,_0x2ffcf0){var _0x3ada4a={'raw':!![],'where':{'id':_0x497add[_0xc2e2('0x42')]['id']}},_0x4940c1={};_0x4940c1[_0xc2e2('0x30')]=_[_0xc2e2('0x2e')](db['FaxApplication'][_0xc2e2('0x2a')]);_0x4940c1['query']=_[_0xc2e2('0x2e')](_0x497add[_0xc2e2('0x2d')]);_0x4940c1[_0xc2e2('0x43')]=_[_0xc2e2('0x44')](_0x4940c1['model'],_0x4940c1[_0xc2e2('0x2d')]);_0x3ada4a['attributes']=_[_0xc2e2('0x44')](_0x4940c1[_0xc2e2('0x30')],qs['fields'](_0x497add['query'][_0xc2e2('0x31')]));_0x3ada4a[_0xc2e2('0x2f')]=_0x3ada4a[_0xc2e2('0x2f')][_0xc2e2('0x45')]?_0x3ada4a[_0xc2e2('0x2f')]:_0x4940c1[_0xc2e2('0x30')];if(_0x497add[_0xc2e2('0x2d')][_0xc2e2('0x3f')]){_0x3ada4a[_0xc2e2('0x46')]=[{'all':!![]}];}_0x3ada4a=_[_0xc2e2('0x3b')]({},_0x3ada4a,_0x497add[_0xc2e2('0x3c')]);return db[_0xc2e2('0x3d')]['find'](_0x3ada4a)[_0xc2e2('0x3e')](handleEntityNotFound(_0x2ffcf0,null))[_0xc2e2('0x3e')](respondWithResult(_0x2ffcf0,null))[_0xc2e2('0x40')](handleError(_0x2ffcf0,null));};exports[_0xc2e2('0x47')]=function(_0x51ad77,_0x4fef6b){return db[_0xc2e2('0x3d')][_0xc2e2('0x47')](_0x51ad77['body'],{})[_0xc2e2('0x3e')](respondWithResult(_0x4fef6b,0xc9))[_0xc2e2('0x40')](handleError(_0x4fef6b,null));};exports['update']=function(_0x502e01,_0x4c94d6){if(_0x502e01[_0xc2e2('0x48')]['id']){delete _0x502e01[_0xc2e2('0x48')]['id'];}return db[_0xc2e2('0x3d')][_0xc2e2('0x49')]({'where':{'id':_0x502e01['params']['id']}})[_0xc2e2('0x3e')](handleEntityNotFound(_0x4c94d6,null))[_0xc2e2('0x3e')](saveUpdates(_0x502e01[_0xc2e2('0x48')],null))[_0xc2e2('0x3e')](respondWithResult(_0x4c94d6,null))['catch'](handleError(_0x4c94d6,null));};exports['destroy']=function(_0x569b17,_0x3c6478){return db[_0xc2e2('0x3d')][_0xc2e2('0x49')]({'where':{'id':_0x569b17[_0xc2e2('0x42')]['id']}})[_0xc2e2('0x3e')](handleEntityNotFound(_0x3c6478,null))['then'](removeEntity(_0x3c6478,null))[_0xc2e2('0x40')](handleError(_0x3c6478,null));}; \ No newline at end of file +var _0x16c5=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','find','catch','body','params','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0x16c5,0x10d));var _0x516c=function(_0xdf4bae,_0xa499bb){_0xdf4bae=_0xdf4bae-0x0;var _0x1e7337=_0x16c5[_0xdf4bae];return _0x1e7337;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x516c('0x0'));var zipdir=require(_0x516c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x516c('0x2'));var moment=require(_0x516c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x516c('0x4'));var util=require('util');var path=require(_0x516c('0x5'));var sox=require(_0x516c('0x6'));var csv=require(_0x516c('0x7'));var ejs=require(_0x516c('0x8'));var fs=require('fs');var fs_extra=require(_0x516c('0x9'));var _=require(_0x516c('0xa'));var squel=require(_0x516c('0xb'));var crypto=require('crypto');var jsforce=require(_0x516c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x516c('0xd'));var Papa=require('papaparse');var Redis=require(_0x516c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x516c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x516c('0x10'));var logger=require(_0x516c('0x11'))(_0x516c('0x12'));var utils=require(_0x516c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x516c('0x14'));var db=require(_0x516c('0x15'))['db'];function respondWithStatusCode(_0x2b56a1,_0x192a96){_0x192a96=_0x192a96||0xcc;return function(_0x33b0c6){if(_0x33b0c6){return _0x2b56a1[_0x516c('0x16')](_0x192a96);}return _0x2b56a1[_0x516c('0x17')](_0x192a96)[_0x516c('0x18')]();};}function respondWithResult(_0x56fac5,_0x3ac8ae){_0x3ac8ae=_0x3ac8ae||0xc8;return function(_0xb8348b){if(_0xb8348b){return _0x56fac5[_0x516c('0x17')](_0x3ac8ae)[_0x516c('0x19')](_0xb8348b);}};}function respondWithFilteredResult(_0x357847,_0x23f327){return function(_0x24c78c){if(_0x24c78c){var _0x166fb2=typeof _0x23f327[_0x516c('0x1a')]===_0x516c('0x1b')&&typeof _0x23f327[_0x516c('0x1c')]===_0x516c('0x1b');var _0x4a823e=_0x24c78c['count'];var _0xe3316=_0x166fb2?0x0:_0x23f327[_0x516c('0x1a')];var _0x11fe32=_0x166fb2?_0x24c78c[_0x516c('0x1d')]:_0x23f327[_0x516c('0x1a')]+_0x23f327['limit'];var _0x315cc8;if(_0x11fe32>=_0x4a823e){_0x11fe32=_0x4a823e;_0x315cc8=0xc8;}else{_0x315cc8=0xce;}_0x357847[_0x516c('0x17')](_0x315cc8);return _0x357847[_0x516c('0x1e')](_0x516c('0x1f'),_0xe3316+'-'+_0x11fe32+'/'+_0x4a823e)[_0x516c('0x19')](_0x24c78c);}return null;};}function patchUpdates(_0x53ef46){return function(_0xba7395){try{jsonpatch['apply'](_0xba7395,_0x53ef46,!![]);}catch(_0x918e1f){return BPromise[_0x516c('0x20')](_0x918e1f);}return _0xba7395[_0x516c('0x21')]();};}function saveUpdates(_0x114131,_0xfd4d6f){return function(_0x392f81){if(_0x392f81){return _0x392f81[_0x516c('0x22')](_0x114131)[_0x516c('0x23')](function(_0x46fbba){return _0x46fbba;});}return null;};}function removeEntity(_0x572b1a,_0x2f4002){return function(_0x1f6ba4){if(_0x1f6ba4){return _0x1f6ba4[_0x516c('0x24')]()[_0x516c('0x23')](function(){_0x572b1a['status'](0xcc)[_0x516c('0x18')]();});}};}function handleEntityNotFound(_0x4d8ee3,_0x2ad2d3){return function(_0x26cca9){if(!_0x26cca9){_0x4d8ee3['sendStatus'](0x194);}return _0x26cca9;};}function handleError(_0x429c3b,_0x418a98){_0x418a98=_0x418a98||0x1f4;return function(_0x258eb2){logger[_0x516c('0x25')](_0x258eb2[_0x516c('0x26')]);if(_0x258eb2[_0x516c('0x27')]){delete _0x258eb2['name'];}_0x429c3b[_0x516c('0x17')](_0x418a98)[_0x516c('0x28')](_0x258eb2);};}exports['index']=function(_0x29a9ad,_0x173638){var _0x1e5154={},_0x48d347={},_0x1937b8={'count':0x0,'rows':[]};var _0xbcec01=_[_0x516c('0x29')](db[_0x516c('0x2a')][_0x516c('0x2b')],function(_0x54aaef){return{'name':_0x54aaef[_0x516c('0x2c')],'type':_0x54aaef[_0x516c('0x2d')][_0x516c('0x2e')]};});_0x48d347['model']=_['map'](_0xbcec01,_0x516c('0x27'));_0x48d347[_0x516c('0x2f')]=_[_0x516c('0x30')](_0x29a9ad['query']);_0x48d347[_0x516c('0x31')]=_[_0x516c('0x32')](_0x48d347[_0x516c('0x33')],_0x48d347[_0x516c('0x2f')]);_0x1e5154[_0x516c('0x34')]=_[_0x516c('0x32')](_0x48d347[_0x516c('0x33')],qs['fields'](_0x29a9ad[_0x516c('0x2f')][_0x516c('0x35')]));_0x1e5154['attributes']=_0x1e5154[_0x516c('0x34')][_0x516c('0x36')]?_0x1e5154[_0x516c('0x34')]:_0x48d347[_0x516c('0x33')];if(!_0x29a9ad[_0x516c('0x2f')][_0x516c('0x37')](_0x516c('0x38'))){_0x1e5154['limit']=qs[_0x516c('0x1c')](_0x29a9ad['query'][_0x516c('0x1c')]);_0x1e5154[_0x516c('0x1a')]=qs[_0x516c('0x1a')](_0x29a9ad['query']['offset']);}_0x1e5154[_0x516c('0x39')]=qs[_0x516c('0x3a')](_0x29a9ad[_0x516c('0x2f')][_0x516c('0x3a')]);_0x1e5154[_0x516c('0x3b')]=qs['filters'](_[_0x516c('0x3c')](_0x29a9ad[_0x516c('0x2f')],_0x48d347[_0x516c('0x31')]),_0xbcec01);if(_0x29a9ad[_0x516c('0x2f')][_0x516c('0x3d')]){_0x1e5154[_0x516c('0x3b')]=_[_0x516c('0x3e')](_0x1e5154[_0x516c('0x3b')],{'$or':_[_0x516c('0x29')](_0xbcec01,function(_0x9ec3c3){if(_0x9ec3c3['type']!==_0x516c('0x3f')){var _0x2eac3e={};_0x2eac3e[_0x9ec3c3[_0x516c('0x27')]]={'$like':'%'+_0x29a9ad['query'][_0x516c('0x3d')]+'%'};return _0x2eac3e;}})});}_0x1e5154=_[_0x516c('0x3e')]({},_0x1e5154,_0x29a9ad[_0x516c('0x40')]);var _0x119b6={'where':_0x1e5154[_0x516c('0x3b')]};return db['FaxApplication'][_0x516c('0x1d')](_0x119b6)[_0x516c('0x23')](function(_0x481a45){_0x1937b8[_0x516c('0x1d')]=_0x481a45;if(_0x29a9ad[_0x516c('0x2f')]['includeAll']){_0x1e5154[_0x516c('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x516c('0x42')](_0x1e5154);})[_0x516c('0x23')](function(_0x4cc784){_0x1937b8[_0x516c('0x43')]=_0x4cc784;return _0x1937b8;})[_0x516c('0x23')](respondWithFilteredResult(_0x173638,_0x1e5154))['catch'](handleError(_0x173638,null));};exports[_0x516c('0x44')]=function(_0x276cbc,_0x325b7e){var _0x1bc2a2={'raw':!![],'where':{'id':_0x276cbc['params']['id']}},_0x505321={};_0x505321[_0x516c('0x33')]=_[_0x516c('0x30')](db[_0x516c('0x2a')][_0x516c('0x2b')]);_0x505321[_0x516c('0x2f')]=_['keys'](_0x276cbc[_0x516c('0x2f')]);_0x505321[_0x516c('0x31')]=_[_0x516c('0x32')](_0x505321[_0x516c('0x33')],_0x505321[_0x516c('0x2f')]);_0x1bc2a2[_0x516c('0x34')]=_[_0x516c('0x32')](_0x505321[_0x516c('0x33')],qs['fields'](_0x276cbc['query'][_0x516c('0x35')]));_0x1bc2a2['attributes']=_0x1bc2a2[_0x516c('0x34')][_0x516c('0x36')]?_0x1bc2a2['attributes']:_0x505321[_0x516c('0x33')];if(_0x276cbc[_0x516c('0x2f')]['includeAll']){_0x1bc2a2[_0x516c('0x41')]=[{'all':!![]}];}_0x1bc2a2=_[_0x516c('0x3e')]({},_0x1bc2a2,_0x276cbc[_0x516c('0x40')]);return db[_0x516c('0x2a')][_0x516c('0x45')](_0x1bc2a2)['then'](handleEntityNotFound(_0x325b7e,null))['then'](respondWithResult(_0x325b7e,null))[_0x516c('0x46')](handleError(_0x325b7e,null));};exports['create']=function(_0x57bff3,_0xf8f3de){return db[_0x516c('0x2a')]['create'](_0x57bff3['body'],{})['then'](respondWithResult(_0xf8f3de,0xc9))[_0x516c('0x46')](handleError(_0xf8f3de,null));};exports[_0x516c('0x22')]=function(_0x261aa0,_0xc85ff8){if(_0x261aa0[_0x516c('0x47')]['id']){delete _0x261aa0[_0x516c('0x47')]['id'];}return db[_0x516c('0x2a')][_0x516c('0x45')]({'where':{'id':_0x261aa0['params']['id']}})[_0x516c('0x23')](handleEntityNotFound(_0xc85ff8,null))[_0x516c('0x23')](saveUpdates(_0x261aa0[_0x516c('0x47')],null))['then'](respondWithResult(_0xc85ff8,null))['catch'](handleError(_0xc85ff8,null));};exports['destroy']=function(_0x435701,_0x1683d4){return db[_0x516c('0x2a')][_0x516c('0x45')]({'where':{'id':_0x435701[_0x516c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1683d4,null))[_0x516c('0x23')](removeEntity(_0x1683d4,null))[_0x516c('0x46')](handleError(_0x1683d4,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index ef60931..8b14628 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 _0xce99=['util','../../config/logger','api','bluebird','../../config/environment','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x36bbf4,_0x3fd8ec){var _0x379367=function(_0x22197f){while(--_0x22197f){_0x36bbf4['push'](_0x36bbf4['shift']());}};_0x379367(++_0x3fd8ec);}(_0xce99,0x118));var _0x9ce9=function(_0x19b161,_0x875a08){_0x19b161=_0x19b161-0x0;var _0x23dbe5=_0xce99[_0x19b161];return _0x23dbe5;};'use strict';var _=require('lodash');var util=require(_0x9ce9('0x0'));var logger=require(_0x9ce9('0x1'))(_0x9ce9('0x2'));var moment=require('moment');var BPromise=require(_0x9ce9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9ce9('0x4'));var attributes=require('./faxApplication.attributes');module[_0x9ce9('0x5')]=function(_0x28ec4d,_0x485203){return _0x28ec4d[_0x9ce9('0x6')]('FaxApplication',attributes,{'tableName':_0x9ce9('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ce9('0x8'),'collate':_0x9ce9('0x9')});}; \ No newline at end of file +var _0x17b5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x4c2bdc,_0x5915d7){var _0x5a3222=function(_0x2262dd){while(--_0x2262dd){_0x4c2bdc['push'](_0x4c2bdc['shift']());}};_0x5a3222(++_0x5915d7);}(_0x17b5,0x15a));var _0x517b=function(_0x5cfcef,_0x20d843){_0x5cfcef=_0x5cfcef-0x0;var _0x21df12=_0x17b5[_0x5cfcef];return _0x21df12;};'use strict';var _=require(_0x517b('0x0'));var util=require(_0x517b('0x1'));var logger=require(_0x517b('0x2'))(_0x517b('0x3'));var moment=require(_0x517b('0x4'));var BPromise=require(_0x517b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x517b('0x6'));var rimraf=require('rimraf');var config=require(_0x517b('0x7'));var attributes=require(_0x517b('0x8'));module[_0x517b('0x9')]=function(_0x2e318c,_0x9997b9){return _0x2e318c[_0x517b('0xa')](_0x517b('0xb'),attributes,{'tableName':_0x517b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x517b('0xd'),'collate':_0x517b('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 95ae58b..a20b62c 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 _0x0f83=['request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','code','error','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0xde3c47,_0x2e3cf7){var _0x2fb6ad=function(_0xd5ee14){while(--_0xd5ee14){_0xde3c47['push'](_0xde3c47['shift']());}};_0x2fb6ad(++_0x2e3cf7);}(_0x0f83,0x66));var _0x30f8=function(_0x282d3c,_0xbf90b){_0x282d3c=_0x282d3c-0x0;var _0x50b594=_0x0f83[_0x282d3c];return _0x50b594;};'use strict';var _=require('lodash');var util=require(_0x30f8('0x0'));var moment=require(_0x30f8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x30f8('0x2'));var db=require(_0x30f8('0x3'))['db'];var utils=require(_0x30f8('0x4'));var logger=require(_0x30f8('0x5'))(_0x30f8('0x6'));var config=require('../../config/environment');var jayson=require(_0x30f8('0x7'));var client=jayson[_0x30f8('0x8')][_0x30f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23836c,_0x3a6feb,_0x18627b){return new BPromise(function(_0x2572a1,_0x3047c2){return client[_0x30f8('0xa')](_0x23836c,_0x18627b)[_0x30f8('0xb')](function(_0x410480){logger[_0x30f8('0xc')](_0x30f8('0xd'),_0x3a6feb,_0x30f8('0xe'));logger['debug'](_0x30f8('0xf'),_0x3a6feb,_0x30f8('0xe'),JSON['stringify'](_0x410480));if(_0x410480['error']){if(_0x410480['error'][_0x30f8('0x10')]===0x1f4){logger['error'](_0x30f8('0xd'),_0x3a6feb,_0x410480[_0x30f8('0x11')][_0x30f8('0x12')]);return _0x3047c2(_0x410480['error'][_0x30f8('0x12')]);}logger['error'](_0x30f8('0xd'),_0x3a6feb,_0x410480[_0x30f8('0x11')][_0x30f8('0x12')]);return _0x2572a1(_0x410480['error'][_0x30f8('0x12')]);}else{logger['info'](_0x30f8('0xd'),_0x3a6feb,'request\x20sent');_0x2572a1(_0x410480['result'][_0x30f8('0x12')]);}})[_0x30f8('0x13')](function(_0x28ced5){logger['error'](_0x30f8('0xd'),_0x3a6feb,_0x28ced5);_0x3047c2(_0x28ced5);});});}exports[_0x30f8('0x14')]=function(_0x210ce3){var _0x50a7cc=this;return new Promise(function(_0x29f91e,_0x5e2e9e){return db[_0x30f8('0x15')][_0x30f8('0x16')](_0x210ce3[_0x30f8('0x17')],{'raw':_0x210ce3['options']?_0x210ce3[_0x30f8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x210ce3[_0x30f8('0x18')]?_0x210ce3[_0x30f8('0x18')][_0x30f8('0x19')]||null:null,'attributes':_0x210ce3[_0x30f8('0x18')]?_0x210ce3[_0x30f8('0x18')][_0x30f8('0x1a')]||null:null,'limit':_0x210ce3['options']?_0x210ce3['options'][_0x30f8('0x1b')]||null:null})[_0x30f8('0xb')](function(_0x5cb2b2){logger['info'](_0x30f8('0x14'),_0x210ce3);logger['debug'](_0x30f8('0x14'),_0x210ce3,JSON[_0x30f8('0x1c')](_0x5cb2b2));_0x29f91e(_0x5cb2b2);})[_0x30f8('0x13')](function(_0x3378f7){logger['error'](_0x30f8('0x14'),_0x3378f7[_0x30f8('0x12')],_0x210ce3);_0x5e2e9e(_0x50a7cc['error'](0x1f4,_0x3378f7[_0x30f8('0x12')]));});});}; \ No newline at end of file +var _0xd3ff=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxApplication','update','body','options','where','limit','stringify','lodash','util','moment','randomstring','ioredis'];(function(_0x4604fa,_0xa44471){var _0x258783=function(_0x294b2c){while(--_0x294b2c){_0x4604fa['push'](_0x4604fa['shift']());}};_0x258783(++_0xa44471);}(_0xd3ff,0x1ae));var _0xfd3f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3ff[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfd3f('0x0'));var util=require(_0xfd3f('0x1'));var moment=require(_0xfd3f('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd3f('0x3'));var fs=require('fs');var Redis=require(_0xfd3f('0x4'));var db=require(_0xfd3f('0x5'))['db'];var utils=require(_0xfd3f('0x6'));var logger=require(_0xfd3f('0x7'))(_0xfd3f('0x8'));var config=require(_0xfd3f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41dcb5,_0xdc397c,_0x28d155){return new BPromise(function(_0xae296a,_0x4df669){return client['request'](_0x41dcb5,_0x28d155)[_0xfd3f('0xb')](function(_0x5bacf8){logger[_0xfd3f('0xc')](_0xfd3f('0xd'),_0xdc397c,_0xfd3f('0xe'));logger[_0xfd3f('0xf')](_0xfd3f('0x10'),_0xdc397c,'request\x20sent',JSON['stringify'](_0x5bacf8));if(_0x5bacf8[_0xfd3f('0x11')]){if(_0x5bacf8[_0xfd3f('0x11')][_0xfd3f('0x12')]===0x1f4){logger['error'](_0xfd3f('0xd'),_0xdc397c,_0x5bacf8[_0xfd3f('0x11')]['message']);return _0x4df669(_0x5bacf8['error']['message']);}logger[_0xfd3f('0x11')](_0xfd3f('0xd'),_0xdc397c,_0x5bacf8['error'][_0xfd3f('0x13')]);return _0xae296a(_0x5bacf8[_0xfd3f('0x11')][_0xfd3f('0x13')]);}else{logger[_0xfd3f('0xc')](_0xfd3f('0xd'),_0xdc397c,_0xfd3f('0xe'));_0xae296a(_0x5bacf8[_0xfd3f('0x14')][_0xfd3f('0x13')]);}})[_0xfd3f('0x15')](function(_0x1f08d6){logger[_0xfd3f('0x11')](_0xfd3f('0xd'),_0xdc397c,_0x1f08d6);_0x4df669(_0x1f08d6);});});}exports[_0xfd3f('0x16')]=function(_0x514ea4){var _0x110b7f=this;return new Promise(function(_0x76e0ae,_0xc5c37b){return db['FaxApplication'][_0xfd3f('0x17')](_0x514ea4[_0xfd3f('0x18')],{'raw':_0x514ea4[_0xfd3f('0x19')]?_0x514ea4[_0xfd3f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514ea4['options']?_0x514ea4['options'][_0xfd3f('0x1a')]||null:null,'attributes':_0x514ea4[_0xfd3f('0x19')]?_0x514ea4[_0xfd3f('0x19')]['attributes']||null:null,'limit':_0x514ea4[_0xfd3f('0x19')]?_0x514ea4[_0xfd3f('0x19')][_0xfd3f('0x1b')]||null:null})['then'](function(_0x7f624b){logger['info'](_0xfd3f('0x16'),_0x514ea4);logger[_0xfd3f('0xf')]('UpdateFaxApplication',_0x514ea4,JSON[_0xfd3f('0x1c')](_0x7f624b));_0x76e0ae(_0x7f624b);})[_0xfd3f('0x15')](function(_0xde9d){logger[_0xfd3f('0x11')]('UpdateFaxApplication',_0xde9d[_0xfd3f('0x13')],_0x514ea4);_0xc5c37b(_0x110b7f[_0xfd3f('0x11')](0x1f4,_0xde9d[_0xfd3f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2fc9ddd..49bfcd0 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 _0x1eba=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x28a465,_0x558c2c){var _0x258386=function(_0x384486){while(--_0x384486){_0x28a465['push'](_0x28a465['shift']());}};_0x258386(++_0x558c2c);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x1eba[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0xf')]);router['put'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router['delete'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x11')]);module[_0xa1eb('0x12')]=router; \ No newline at end of file +var _0x1eba=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x280a2e,_0x244c6f){var _0x286f67=function(_0xe4620b){while(--_0xe4620b){_0x280a2e['push'](_0x280a2e['shift']());}};_0x286f67(++_0x244c6f);}(_0x1eba,0x1d7));var _0xa1eb=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x1eba[_0xfcbcb8];return _0x1b1f97;};'use strict';var multer=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var path=require(_0xa1eb('0x2'));var timeout=require(_0xa1eb('0x3'));var express=require(_0xa1eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa1eb('0x5'));var interaction=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var controller=require(_0xa1eb('0x8'));router[_0xa1eb('0x9')]('/',auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xb')]);router[_0xa1eb('0x9')](_0xa1eb('0xc'),auth[_0xa1eb('0xa')](),controller[_0xa1eb('0xd')]);router[_0xa1eb('0xe')]('/',auth['isAuthenticated'](),controller[_0xa1eb('0xf')]);router['put'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x10')]);router['delete'](_0xa1eb('0xc'),auth['isAuthenticated'](),controller[_0xa1eb('0x11')]);module[_0xa1eb('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index dba004f..df30184 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 _0xfece=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfece,0x102));var _0xefec=function(_0xc089c7,_0x139cea){_0xc089c7=_0xc089c7-0x0;var _0x325fb3=_0xfece[_0xc089c7];return _0x325fb3;};'use strict';var Sequelize=require(_0xefec('0x0'));module[_0xefec('0x1')]={'closed':{'type':Sequelize[_0xefec('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xefec('0x3')]},'disposition':{'type':Sequelize[_0xefec('0x4')]},'secondDisposition':{'type':Sequelize[_0xefec('0x4')]},'thirdDisposition':{'type':Sequelize[_0xefec('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xefec('0x3')]},'fax':{'type':Sequelize[_0xefec('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xefec('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xefec('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xefec('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x9929=['sequelize','BOOLEAN','STRING','DATE','out'];(function(_0x342123,_0x388ac8){var _0x18dcef=function(_0x51c70f){while(--_0x51c70f){_0x342123['push'](_0x342123['shift']());}};_0x18dcef(++_0x388ac8);}(_0x9929,0x64));var _0x9992=function(_0x479837,_0x4f2bef){_0x479837=_0x479837-0x0;var _0xc458a3=_0x9929[_0x479837];return _0xc458a3;};'use strict';var Sequelize=require(_0x9992('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9992('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9992('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9992('0x2')]},'read1stAt':{'type':Sequelize[_0x9992('0x3')]},'fax':{'type':Sequelize[_0x9992('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9992('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9992('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9992('0x4')),'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 172e093..09f4ba5 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 _0x6cd4=['mkdirSync','existsSync','createWriteStream','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','stack','name','send','map','FaxInteraction','fieldName','type','key','getOptions','findAll','fax','query','user','catch','params','model','keys','rawAttributes','filters','fields','attributes','length','includeAll','include','merge','options','find','create','body','update','addMessage','FaxMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','sort','where','pick','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','faxInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get'];(function(_0x3979e3,_0xb2f138){var _0x5e7c9e=function(_0x23ed7a){while(--_0x23ed7a){_0x3979e3['push'](_0x3979e3['shift']());}};_0x5e7c9e(++_0xb2f138);}(_0x6cd4,0xd0));var _0x46cd=function(_0x4e57ae,_0x18fd92){_0x4e57ae=_0x4e57ae-0x0;var _0xe22f92=_0x6cd4[_0x4e57ae];return _0xe22f92;};'use strict';var rimraf=require(_0x46cd('0x0'));var zipdir=require(_0x46cd('0x1'));var moment=require(_0x46cd('0x2'));var BPromise=require(_0x46cd('0x3'));var util=require(_0x46cd('0x4'));var path=require(_0x46cd('0x5'));var fs=require('fs');var _=require(_0x46cd('0x6'));var Redis=require(_0x46cd('0x7'));var interaction=require(_0x46cd('0x8'));var qs=require(_0x46cd('0x9'));var logger=require('../../config/logger')(_0x46cd('0xa'));var config=require(_0x46cd('0xb'));var db=require(_0x46cd('0xc'))['db'];config[_0x46cd('0xd')]=_['defaults'](config['redis'],{'host':_0x46cd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46cd('0xd')]));require(_0x46cd('0xf'))[_0x46cd('0x10')](socket);function respondWithStatusCode(_0x2f6d53,_0xa1cdb6){_0xa1cdb6=_0xa1cdb6||0xcc;return function(_0x116514){if(_0x116514){return _0x2f6d53[_0x46cd('0x11')](_0xa1cdb6);}return _0x2f6d53[_0x46cd('0x12')](_0xa1cdb6)[_0x46cd('0x13')]();};}function respondWithResult(_0x778b12,_0x25e640){_0x25e640=_0x25e640||0xc8;return function(_0x492546){if(_0x492546){return _0x778b12['status'](_0x25e640)[_0x46cd('0x14')](_0x492546);}};}function respondWithFilteredResult(_0x548fb6,_0x5cf097){return function(_0x457ad0){if(_0x457ad0){var _0x748b94=typeof _0x5cf097['offset']===_0x46cd('0x15')&&typeof _0x5cf097[_0x46cd('0x16')]==='undefined';var _0x12c144=_0x457ad0[_0x46cd('0x17')];var _0xd2ac7d=_0x748b94?0x0:_0x5cf097[_0x46cd('0x18')];var _0x37a0a7=_0x748b94?_0x457ad0[_0x46cd('0x17')]:_0x5cf097[_0x46cd('0x18')]+_0x5cf097['limit'];var _0xd5b0df;if(_0x37a0a7>=_0x12c144){_0x37a0a7=_0x12c144;_0xd5b0df=0xc8;}else{_0xd5b0df=0xce;}_0x548fb6[_0x46cd('0x12')](_0xd5b0df);return _0x548fb6[_0x46cd('0x19')](_0x46cd('0x1a'),_0xd2ac7d+'-'+_0x37a0a7+'/'+_0x12c144)[_0x46cd('0x14')](_0x457ad0);}return null;};}function saveUpdates(_0x3cf600){return function(_0x7a588b){if(_0x7a588b){return _0x7a588b['update'](_0x3cf600)[_0x46cd('0x1b')](function(_0x1ccbc4){return _0x1ccbc4;});}return null;};}function removeEntity(_0x2b8b34){return function(_0x5f411b){if(_0x5f411b){return _0x5f411b[_0x46cd('0x1c')]()['then'](function(){_0x2b8b34[_0x46cd('0x12')](0xcc)[_0x46cd('0x13')]();});}};}function handleEntityNotFound(_0x225ed4){return function(_0x45b923){if(!_0x45b923){_0x225ed4[_0x46cd('0x11')](0x194);}return _0x45b923;};}function handleError(_0x117372,_0x182907){_0x182907=_0x182907||0x1f4;return function(_0xfa5fa0){logger['error'](_0xfa5fa0[_0x46cd('0x1d')]);if(_0xfa5fa0[_0x46cd('0x1e')]){delete _0xfa5fa0[_0x46cd('0x1e')];}_0x117372[_0x46cd('0x12')](_0x182907)[_0x46cd('0x1f')](_0xfa5fa0);};}exports['index']=function(_0x5f2753,_0x6456c){var _0x4316c3={};var _0x4352d9=_[_0x46cd('0x20')](db[_0x46cd('0x21')]['rawAttributes'],function(_0x3d6e8a){return{'name':_0x3d6e8a[_0x46cd('0x22')],'type':_0x3d6e8a[_0x46cd('0x23')][_0x46cd('0x24')]};});_0x4316c3=qs[_0x46cd('0x25')](_0x4352d9,_0x5f2753);return interaction[_0x46cd('0x26')](_0x46cd('0x27'),_0x5f2753[_0x46cd('0x28')],_0x5f2753[_0x46cd('0x29')],_0x4316c3,_0x4352d9)['then'](respondWithFilteredResult(_0x6456c,_0x4316c3))[_0x46cd('0x2a')](handleError(_0x6456c,null));};exports['show']=function(_0x113e24,_0x515889){var _0x41c0e6={'raw':![],'where':{'id':_0x113e24[_0x46cd('0x2b')]['id']}},_0x4e9980={};_0x4e9980[_0x46cd('0x2c')]=_[_0x46cd('0x2d')](db[_0x46cd('0x21')][_0x46cd('0x2e')]);_0x4e9980[_0x46cd('0x28')]=_[_0x46cd('0x2d')](_0x113e24[_0x46cd('0x28')]);_0x4e9980[_0x46cd('0x2f')]=_['intersection'](_0x4e9980[_0x46cd('0x2c')],_0x4e9980[_0x46cd('0x28')]);_0x41c0e6['attributes']=_['intersection'](_0x4e9980[_0x46cd('0x2c')],qs[_0x46cd('0x30')](_0x113e24[_0x46cd('0x28')][_0x46cd('0x30')]));_0x41c0e6[_0x46cd('0x31')]=_0x41c0e6[_0x46cd('0x31')][_0x46cd('0x32')]?_0x41c0e6[_0x46cd('0x31')]:_0x4e9980[_0x46cd('0x2c')];if(_0x113e24['query'][_0x46cd('0x33')]){_0x41c0e6[_0x46cd('0x34')]=[{'all':!![]}];}_0x41c0e6=_[_0x46cd('0x35')]({},_0x41c0e6,_0x113e24[_0x46cd('0x36')]);return db[_0x46cd('0x21')][_0x46cd('0x37')](_0x41c0e6)[_0x46cd('0x1b')](handleEntityNotFound(_0x515889,null))[_0x46cd('0x1b')](respondWithResult(_0x515889,null))[_0x46cd('0x2a')](handleError(_0x515889,null));};exports[_0x46cd('0x38')]=function(_0x12f6b0,_0x5aef9e){return db[_0x46cd('0x21')][_0x46cd('0x38')](_0x12f6b0[_0x46cd('0x39')],{})[_0x46cd('0x1b')](respondWithResult(_0x5aef9e,0xc9))['catch'](handleError(_0x5aef9e,null));};exports[_0x46cd('0x3a')]=function(_0x2206c4,_0x5f2619){if(_0x2206c4['body']['id']){delete _0x2206c4[_0x46cd('0x39')]['id'];}return db[_0x46cd('0x21')][_0x46cd('0x37')]({'where':{'id':_0x2206c4[_0x46cd('0x2b')]['id']}})[_0x46cd('0x1b')](handleEntityNotFound(_0x5f2619,null))[_0x46cd('0x1b')](saveUpdates(_0x2206c4['body'],null))['then'](respondWithResult(_0x5f2619,null))[_0x46cd('0x2a')](handleError(_0x5f2619,null));};exports['destroy']=function(_0x349076,_0x3aa0a7){return db['FaxInteraction']['find']({'where':{'id':_0x349076[_0x46cd('0x2b')]['id']}})[_0x46cd('0x1b')](handleEntityNotFound(_0x3aa0a7,null))['then'](removeEntity(_0x3aa0a7,null))[_0x46cd('0x2a')](handleError(_0x3aa0a7,null));};exports['describe']=function(_0x52baf6,_0x2439ae){return db[_0x46cd('0x21')]['describe']()[_0x46cd('0x1b')](respondWithResult(_0x2439ae,null))[_0x46cd('0x2a')](handleError(_0x2439ae,null));};exports[_0x46cd('0x3b')]=function(_0x176292,_0x38e706){return db[_0x46cd('0x3c')]['find']({'where':{'id':_0x176292[_0x46cd('0x2b')]['id']}})['then'](handleEntityNotFound(_0x38e706,null))['then'](function(_0x185503){if(_0x185503){return _0x185503[_0x46cd('0x3b')](_0x176292[_0x46cd('0x39')][_0x46cd('0x3d')],_[_0x46cd('0x3e')](_0x176292[_0x46cd('0x39')],[_0x46cd('0x3d'),'id'])||{});}})[_0x46cd('0x1b')](respondWithResult(_0x38e706,null))[_0x46cd('0x2a')](handleError(_0x38e706,null));};exports[_0x46cd('0x3f')]=function(_0x54014f,_0x2c27f9){var _0x53f2aa={'raw':![],'where':{}};var _0x3d6974={};var _0x4495e5={'count':0x0,'rows':[]};return db[_0x46cd('0x21')][_0x46cd('0x40')]({'where':{'id':_0x54014f[_0x46cd('0x2b')]['id']}})[_0x46cd('0x1b')](handleEntityNotFound(_0x2c27f9,null))['then'](function(_0x2616a8){if(_0x2616a8){_0x3d6974[_0x46cd('0x2c')]=_[_0x46cd('0x2d')](db[_0x46cd('0x3c')][_0x46cd('0x2e')]);_0x3d6974[_0x46cd('0x28')]=_[_0x46cd('0x2d')](_0x54014f[_0x46cd('0x28')]);_0x3d6974[_0x46cd('0x2f')]=_[_0x46cd('0x41')](_0x3d6974[_0x46cd('0x2c')],_0x3d6974[_0x46cd('0x28')]);_0x53f2aa['attributes']=_[_0x46cd('0x41')](_0x3d6974[_0x46cd('0x2c')],qs[_0x46cd('0x30')](_0x54014f['query']['fields']));_0x53f2aa[_0x46cd('0x31')]=_0x53f2aa['attributes'][_0x46cd('0x32')]?_0x53f2aa[_0x46cd('0x31')]:_0x3d6974[_0x46cd('0x2c')];if(!_0x54014f[_0x46cd('0x28')][_0x46cd('0x42')]('nolimit')){_0x53f2aa[_0x46cd('0x16')]=qs[_0x46cd('0x16')](_0x54014f['query'][_0x46cd('0x16')]);_0x53f2aa[_0x46cd('0x18')]=qs['offset'](_0x54014f[_0x46cd('0x28')][_0x46cd('0x18')]);}_0x53f2aa['order']=qs[_0x46cd('0x43')](_0x54014f[_0x46cd('0x28')]['sort']);_0x53f2aa[_0x46cd('0x44')]=qs[_0x46cd('0x2f')](_[_0x46cd('0x45')](_0x54014f[_0x46cd('0x28')],_0x3d6974['filters']));_0x53f2aa['where']['FaxInteractionId']=_0x2616a8['id'];if(_0x54014f[_0x46cd('0x28')][_0x46cd('0x46')]){_0x53f2aa['where']=_['merge'](_0x53f2aa[_0x46cd('0x44')],{'$or':_[_0x46cd('0x20')](_0x53f2aa[_0x46cd('0x31')],function(_0x520424){var _0x1992bf={};_0x1992bf[_0x520424]={'$like':'%'+_0x54014f[_0x46cd('0x28')][_0x46cd('0x46')]+'%'};return _0x1992bf;})});}if(_0x54014f[_0x46cd('0x28')]['$gte']){var _0x8bbcef=_0x54014f['query']['$gte'][_0x46cd('0x47')](',');var _0x15ca94={};_0x15ca94[_0x8bbcef[0x0]]={'$gte':moment(_0x8bbcef[0x1])[_0x46cd('0x48')](_0x46cd('0x49'))};_0x53f2aa[_0x46cd('0x44')]=_[_0x46cd('0x35')](_0x53f2aa['where'],_0x15ca94);}_0x53f2aa=_['merge']({},_0x53f2aa,_0x54014f['options']);return db[_0x46cd('0x3c')][_0x46cd('0x17')]({'where':_0x53f2aa['where']})['then'](function(_0x1ddd25){_0x4495e5[_0x46cd('0x17')]=_0x1ddd25;if(_0x54014f['query'][_0x46cd('0x33')]){_0x53f2aa[_0x46cd('0x34')]=[{'all':!![]}];}return db[_0x46cd('0x3c')][_0x46cd('0x26')](_0x53f2aa);})['then'](function(_0x6a821){_0x4495e5[_0x46cd('0x4a')]=_0x6a821;return _0x4495e5;});}})[_0x46cd('0x1b')](respondWithFilteredResult(_0x2c27f9,_0x53f2aa))[_0x46cd('0x2a')](handleError(_0x2c27f9,null));};exports[_0x46cd('0x4b')]=function(_0x17d9c8,_0x5d38c6){return db[_0x46cd('0x21')]['find']({'where':{'id':_0x17d9c8[_0x46cd('0x2b')]['id']}})[_0x46cd('0x1b')](handleEntityNotFound(_0x5d38c6,null))[_0x46cd('0x1b')](function(_0x4e4327){if(_0x4e4327){return _0x4e4327[_0x46cd('0x4c')](_0x17d9c8[_0x46cd('0x39')][_0x46cd('0x3d')],_[_0x46cd('0x3e')](_0x17d9c8['body'],['ids','id'])||{})['spread'](function(){return db[_0x46cd('0x4d')][_0x46cd('0x26')]({'attributes':['id','name',_0x46cd('0x4e')],'where':{'id':_0x17d9c8[_0x46cd('0x39')][_0x46cd('0x3d')]}});})[_0x46cd('0x1b')](function(_0x1f0b11){socket['emit'](_0x46cd('0x4f'),{'id':Number(_0x17d9c8['params']['id']),'tags':_0x1f0b11||[]});return{'id':Number(_0x17d9c8[_0x46cd('0x2b')]['id']),'tags':_0x1f0b11||[]};});}})[_0x46cd('0x1b')](respondWithResult(_0x5d38c6,null))[_0x46cd('0x2a')](handleError(_0x5d38c6,null));};exports[_0x46cd('0x50')]=function(_0x41db42,_0x181146){return db['FaxInteraction'][_0x46cd('0x37')]({'where':{'id':_0x41db42[_0x46cd('0x2b')]['id']}})[_0x46cd('0x1b')](handleEntityNotFound(_0x181146,null))['then'](function(_0x37fac5){if(_0x37fac5){return _0x37fac5[_0x46cd('0x50')](_0x41db42[_0x46cd('0x28')][_0x46cd('0x3d')]);}})[_0x46cd('0x1b')](respondWithStatusCode(_0x181146,null))['catch'](handleError(_0x181146,null));};exports[_0x46cd('0x51')]=function(_0x54ac6e,_0x3489b3){var _0x14777e=moment()[_0x46cd('0x52')]()[_0x46cd('0x53')]();var _0x4c765a=path['join'](config[_0x46cd('0x54')],_0x46cd('0x55'),'files',_0x46cd('0x56'));var _0x1e7aa1=path[_0x46cd('0x57')](config[_0x46cd('0x54')],_0x46cd('0x55'),_0x46cd('0x58'),_0x46cd('0x59'));var _0x52753b=path[_0x46cd('0x57')](_0x4c765a,_0x14777e);var _0x855a6=util[_0x46cd('0x48')](_0x46cd('0x5a'),_0x54ac6e[_0x46cd('0x2b')]['id'],_0x14777e);var _0xf1525c=path[_0x46cd('0x57')](_0x4c765a,_0x855a6);var _0x11cba1=[];_0x11cba1['push']({'model':db[_0x46cd('0x5b')],'as':_0x46cd('0x5b'),'raw':!![]});var _0x56efe8=[{'model':db['FaxMessage'],'as':_0x46cd('0x5c'),'attributes':['id',_0x46cd('0x39'),_0x46cd('0x5d')],'include':_0x11cba1}];return db['FaxInteraction'][_0x46cd('0x37')]({'where':{'id':_0x54ac6e[_0x46cd('0x2b')]['id']},'include':_0x56efe8})[_0x46cd('0x1b')](handleEntityNotFound(_0x3489b3,null))['then'](function(_0x5e1df7){if(_0x5e1df7&&_0x5e1df7[_0x46cd('0x5c')]){var _0x5ad14c=_0x5e1df7[_0x46cd('0x5e')]({'plain':!![]});fs[_0x46cd('0x5f')](_0x52753b);for(var _0x413af6=0x0;_0x413af6<_0x5ad14c[_0x46cd('0x5c')]['length'];_0x413af6++){var _0x4e54cf=_0x5ad14c['Messages'][_0x413af6][_0x46cd('0x5b')];if(_0x4e54cf){var _0x1a104b=path[_0x46cd('0x57')](_0x1e7aa1,_0x4e54cf['basename']);if(fs[_0x46cd('0x60')](_0x1a104b)){fs['createReadStream'](_0x1a104b)['pipe'](fs[_0x46cd('0x61')](path[_0x46cd('0x57')](_0x52753b,_0x4e54cf['basename'])));}}}return BPromise[_0x46cd('0x62')]()[_0x46cd('0x1b')](function(){return new BPromise(function(_0x425a6f,_0x14741e){zipdir(_0x52753b,{'saveTo':_0xf1525c},function(_0x499afd,_0x283117){if(_0x499afd)return _0x14741e(_0x499afd);return _0x425a6f(_0x283117);});})['then'](function(){return new BPromise(function(_0x40afa8,_0x233f75){rimraf(_0x52753b,function(_0x59b718){if(_0x59b718)_0x233f75(_0x59b718);return _0x40afa8();});});})[_0x46cd('0x1b')](function(){return _0x3489b3[_0x46cd('0x51')](_0xf1525c,_0x855a6,function(_0x18640f){if(_0x18640f){console['log'](_0x46cd('0x63'),_0x18640f);}else{fs[_0x46cd('0x64')](_0xf1525c);}});});});}else{return _0x3489b3[_0x46cd('0x11')](0xc8);}})[_0x46cd('0x2a')](handleError(_0x3489b3,null));}; \ No newline at end of file +var _0xf50a=['nolimit','sort','where','FaxInteractionId','map','filter','$gte','split','format','options','includeAll','rows','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','root','files','server','attachments','join','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','mkdirSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','status','end','undefined','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','show','model','keys','filters','intersection','attributes','length','include','merge','find','catch','create','body','params','describe','addMessage','omit','ids','getMessages','findOne','FaxMessage'];(function(_0x5572fe,_0x3d439c){var _0x4b6196=function(_0x12dc77){while(--_0x12dc77){_0x5572fe['push'](_0x5572fe['shift']());}};_0x4b6196(++_0x3d439c);}(_0xf50a,0x87));var _0xaf50=function(_0x544f46,_0x168b65){_0x544f46=_0x544f46-0x0;var _0x21e7f2=_0xf50a[_0x544f46];return _0x21e7f2;};'use strict';var rimraf=require(_0xaf50('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xaf50('0x1'));var util=require(_0xaf50('0x2'));var path=require(_0xaf50('0x3'));var fs=require('fs');var _=require(_0xaf50('0x4'));var Redis=require('ioredis');var interaction=require(_0xaf50('0x5'));var qs=require(_0xaf50('0x6'));var logger=require('../../config/logger')(_0xaf50('0x7'));var config=require(_0xaf50('0x8'));var db=require(_0xaf50('0x9'))['db'];config[_0xaf50('0xa')]=_[_0xaf50('0xb')](config[_0xaf50('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf50('0xc'))(new Redis(config[_0xaf50('0xa')]));require(_0xaf50('0xd'))['register'](socket);function respondWithStatusCode(_0x975e35,_0x51b899){_0x51b899=_0x51b899||0xcc;return function(_0x3ed8c5){if(_0x3ed8c5){return _0x975e35['sendStatus'](_0x51b899);}return _0x975e35[_0xaf50('0xe')](_0x51b899)[_0xaf50('0xf')]();};}function respondWithResult(_0x24dcb0,_0x702c6f){_0x702c6f=_0x702c6f||0xc8;return function(_0x168db7){if(_0x168db7){return _0x24dcb0[_0xaf50('0xe')](_0x702c6f)['json'](_0x168db7);}};}function respondWithFilteredResult(_0x4c6528,_0x107807){return function(_0x4f1048){if(_0x4f1048){var _0x2f4820=typeof _0x107807['offset']===_0xaf50('0x10')&&typeof _0x107807['limit']==='undefined';var _0xa44131=_0x4f1048[_0xaf50('0x11')];var _0x2d6678=_0x2f4820?0x0:_0x107807[_0xaf50('0x12')];var _0x5064c8=_0x2f4820?_0x4f1048[_0xaf50('0x11')]:_0x107807['offset']+_0x107807[_0xaf50('0x13')];var _0x2f1576;if(_0x5064c8>=_0xa44131){_0x5064c8=_0xa44131;_0x2f1576=0xc8;}else{_0x2f1576=0xce;}_0x4c6528[_0xaf50('0xe')](_0x2f1576);return _0x4c6528[_0xaf50('0x14')](_0xaf50('0x15'),_0x2d6678+'-'+_0x5064c8+'/'+_0xa44131)['json'](_0x4f1048);}return null;};}function saveUpdates(_0xdc526e){return function(_0x457aea){if(_0x457aea){return _0x457aea[_0xaf50('0x16')](_0xdc526e)[_0xaf50('0x17')](function(_0x2c2c05){return _0x2c2c05;});}return null;};}function removeEntity(_0x539eb7){return function(_0x562d6c){if(_0x562d6c){return _0x562d6c[_0xaf50('0x18')]()[_0xaf50('0x17')](function(){_0x539eb7[_0xaf50('0xe')](0xcc)[_0xaf50('0xf')]();});}};}function handleEntityNotFound(_0x9afe2a){return function(_0x524c85){if(!_0x524c85){_0x9afe2a[_0xaf50('0x19')](0x194);}return _0x524c85;};}function handleError(_0x51cf99,_0x299929){_0x299929=_0x299929||0x1f4;return function(_0x41f308){logger['error'](_0x41f308[_0xaf50('0x1a')]);if(_0x41f308['name']){delete _0x41f308[_0xaf50('0x1b')];}_0x51cf99[_0xaf50('0xe')](_0x299929)[_0xaf50('0x1c')](_0x41f308);};}exports[_0xaf50('0x1d')]=function(_0x5332e4,_0x49e768){var _0x4a0307={};var _0x320314=_['map'](db[_0xaf50('0x1e')][_0xaf50('0x1f')],function(_0x23b327){return{'name':_0x23b327[_0xaf50('0x20')],'type':_0x23b327[_0xaf50('0x21')][_0xaf50('0x22')]};});_0x4a0307=qs[_0xaf50('0x23')](_0x320314,_0x5332e4);return interaction[_0xaf50('0x24')](_0xaf50('0x25'),_0x5332e4[_0xaf50('0x26')],_0x5332e4[_0xaf50('0x27')],_0x4a0307,_0x320314)['then'](respondWithFilteredResult(_0x49e768,_0x4a0307))['catch'](handleError(_0x49e768,null));};exports[_0xaf50('0x28')]=function(_0x14c7b5,_0x35dbe7){var _0x580d42={'raw':![],'where':{'id':_0x14c7b5['params']['id']}},_0x3f61ff={};_0x3f61ff[_0xaf50('0x29')]=_[_0xaf50('0x2a')](db['FaxInteraction'][_0xaf50('0x1f')]);_0x3f61ff[_0xaf50('0x26')]=_['keys'](_0x14c7b5[_0xaf50('0x26')]);_0x3f61ff[_0xaf50('0x2b')]=_[_0xaf50('0x2c')](_0x3f61ff['model'],_0x3f61ff[_0xaf50('0x26')]);_0x580d42[_0xaf50('0x2d')]=_[_0xaf50('0x2c')](_0x3f61ff[_0xaf50('0x29')],qs['fields'](_0x14c7b5[_0xaf50('0x26')]['fields']));_0x580d42[_0xaf50('0x2d')]=_0x580d42[_0xaf50('0x2d')][_0xaf50('0x2e')]?_0x580d42['attributes']:_0x3f61ff[_0xaf50('0x29')];if(_0x14c7b5[_0xaf50('0x26')]['includeAll']){_0x580d42[_0xaf50('0x2f')]=[{'all':!![]}];}_0x580d42=_[_0xaf50('0x30')]({},_0x580d42,_0x14c7b5['options']);return db[_0xaf50('0x1e')][_0xaf50('0x31')](_0x580d42)[_0xaf50('0x17')](handleEntityNotFound(_0x35dbe7,null))['then'](respondWithResult(_0x35dbe7,null))[_0xaf50('0x32')](handleError(_0x35dbe7,null));};exports[_0xaf50('0x33')]=function(_0x28e6f2,_0x1f5034){return db[_0xaf50('0x1e')][_0xaf50('0x33')](_0x28e6f2[_0xaf50('0x34')],{})[_0xaf50('0x17')](respondWithResult(_0x1f5034,0xc9))[_0xaf50('0x32')](handleError(_0x1f5034,null));};exports[_0xaf50('0x16')]=function(_0x4270fe,_0xa874fa){if(_0x4270fe[_0xaf50('0x34')]['id']){delete _0x4270fe[_0xaf50('0x34')]['id'];}return db[_0xaf50('0x1e')]['find']({'where':{'id':_0x4270fe['params']['id']}})[_0xaf50('0x17')](handleEntityNotFound(_0xa874fa,null))[_0xaf50('0x17')](saveUpdates(_0x4270fe[_0xaf50('0x34')],null))[_0xaf50('0x17')](respondWithResult(_0xa874fa,null))[_0xaf50('0x32')](handleError(_0xa874fa,null));};exports[_0xaf50('0x18')]=function(_0xe55ad,_0x340eb0){return db[_0xaf50('0x1e')][_0xaf50('0x31')]({'where':{'id':_0xe55ad[_0xaf50('0x35')]['id']}})[_0xaf50('0x17')](handleEntityNotFound(_0x340eb0,null))[_0xaf50('0x17')](removeEntity(_0x340eb0,null))[_0xaf50('0x32')](handleError(_0x340eb0,null));};exports[_0xaf50('0x36')]=function(_0x52d8d5,_0x1f4264){return db[_0xaf50('0x1e')]['describe']()['then'](respondWithResult(_0x1f4264,null))[_0xaf50('0x32')](handleError(_0x1f4264,null));};exports[_0xaf50('0x37')]=function(_0x50a3c1,_0x77a04a){return db['FaxMessage'][_0xaf50('0x31')]({'where':{'id':_0x50a3c1[_0xaf50('0x35')]['id']}})['then'](handleEntityNotFound(_0x77a04a,null))[_0xaf50('0x17')](function(_0x116ec3){if(_0x116ec3){return _0x116ec3[_0xaf50('0x37')](_0x50a3c1[_0xaf50('0x34')]['ids'],_[_0xaf50('0x38')](_0x50a3c1['body'],[_0xaf50('0x39'),'id'])||{});}})[_0xaf50('0x17')](respondWithResult(_0x77a04a,null))['catch'](handleError(_0x77a04a,null));};exports[_0xaf50('0x3a')]=function(_0x422735,_0x8afd1c){var _0x15dc11={'raw':![],'where':{}};var _0x2d9ed3={};var _0x1cce5b={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xaf50('0x3b')]({'where':{'id':_0x422735[_0xaf50('0x35')]['id']}})[_0xaf50('0x17')](handleEntityNotFound(_0x8afd1c,null))[_0xaf50('0x17')](function(_0x526ead){if(_0x526ead){_0x2d9ed3[_0xaf50('0x29')]=_['keys'](db[_0xaf50('0x3c')][_0xaf50('0x1f')]);_0x2d9ed3[_0xaf50('0x26')]=_[_0xaf50('0x2a')](_0x422735[_0xaf50('0x26')]);_0x2d9ed3[_0xaf50('0x2b')]=_[_0xaf50('0x2c')](_0x2d9ed3[_0xaf50('0x29')],_0x2d9ed3[_0xaf50('0x26')]);_0x15dc11['attributes']=_[_0xaf50('0x2c')](_0x2d9ed3[_0xaf50('0x29')],qs['fields'](_0x422735[_0xaf50('0x26')]['fields']));_0x15dc11['attributes']=_0x15dc11[_0xaf50('0x2d')]['length']?_0x15dc11[_0xaf50('0x2d')]:_0x2d9ed3[_0xaf50('0x29')];if(!_0x422735[_0xaf50('0x26')]['hasOwnProperty'](_0xaf50('0x3d'))){_0x15dc11[_0xaf50('0x13')]=qs['limit'](_0x422735['query'][_0xaf50('0x13')]);_0x15dc11['offset']=qs['offset'](_0x422735[_0xaf50('0x26')]['offset']);}_0x15dc11['order']=qs['sort'](_0x422735[_0xaf50('0x26')][_0xaf50('0x3e')]);_0x15dc11[_0xaf50('0x3f')]=qs[_0xaf50('0x2b')](_['pick'](_0x422735['query'],_0x2d9ed3[_0xaf50('0x2b')]));_0x15dc11['where'][_0xaf50('0x40')]=_0x526ead['id'];if(_0x422735[_0xaf50('0x26')]['filter']){_0x15dc11[_0xaf50('0x3f')]=_[_0xaf50('0x30')](_0x15dc11[_0xaf50('0x3f')],{'$or':_[_0xaf50('0x41')](_0x15dc11[_0xaf50('0x2d')],function(_0x488714){var _0x357778={};_0x357778[_0x488714]={'$like':'%'+_0x422735[_0xaf50('0x26')][_0xaf50('0x42')]+'%'};return _0x357778;})});}if(_0x422735[_0xaf50('0x26')][_0xaf50('0x43')]){var _0x4c2000=_0x422735[_0xaf50('0x26')]['$gte'][_0xaf50('0x44')](',');var _0xedbbfb={};_0xedbbfb[_0x4c2000[0x0]]={'$gte':moment(_0x4c2000[0x1])[_0xaf50('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0x15dc11[_0xaf50('0x3f')]=_[_0xaf50('0x30')](_0x15dc11[_0xaf50('0x3f')],_0xedbbfb);}_0x15dc11=_[_0xaf50('0x30')]({},_0x15dc11,_0x422735[_0xaf50('0x46')]);return db[_0xaf50('0x3c')][_0xaf50('0x11')]({'where':_0x15dc11[_0xaf50('0x3f')]})[_0xaf50('0x17')](function(_0x4532aa){_0x1cce5b[_0xaf50('0x11')]=_0x4532aa;if(_0x422735['query'][_0xaf50('0x47')]){_0x15dc11['include']=[{'all':!![]}];}return db[_0xaf50('0x3c')]['findAll'](_0x15dc11);})['then'](function(_0x215491){_0x1cce5b[_0xaf50('0x48')]=_0x215491;return _0x1cce5b;});}})[_0xaf50('0x17')](respondWithFilteredResult(_0x8afd1c,_0x15dc11))[_0xaf50('0x32')](handleError(_0x8afd1c,null));};exports['addTags']=function(_0x38a14d,_0x37ba54){return db[_0xaf50('0x1e')][_0xaf50('0x31')]({'where':{'id':_0x38a14d[_0xaf50('0x35')]['id']}})[_0xaf50('0x17')](handleEntityNotFound(_0x37ba54,null))[_0xaf50('0x17')](function(_0x129a2b){if(_0x129a2b){return _0x129a2b['setTags'](_0x38a14d[_0xaf50('0x34')][_0xaf50('0x39')],_[_0xaf50('0x38')](_0x38a14d[_0xaf50('0x34')],['ids','id'])||{})['spread'](function(){return db[_0xaf50('0x49')][_0xaf50('0x24')]({'attributes':['id',_0xaf50('0x1b'),_0xaf50('0x4a')],'where':{'id':_0x38a14d[_0xaf50('0x34')][_0xaf50('0x39')]}});})[_0xaf50('0x17')](function(_0x2129ba){socket[_0xaf50('0x4b')](_0xaf50('0x4c'),{'id':Number(_0x38a14d[_0xaf50('0x35')]['id']),'tags':_0x2129ba||[]});return{'id':Number(_0x38a14d['params']['id']),'tags':_0x2129ba||[]};});}})['then'](respondWithResult(_0x37ba54,null))['catch'](handleError(_0x37ba54,null));};exports[_0xaf50('0x4d')]=function(_0x33013f,_0x39d777){return db[_0xaf50('0x1e')][_0xaf50('0x31')]({'where':{'id':_0x33013f['params']['id']}})[_0xaf50('0x17')](handleEntityNotFound(_0x39d777,null))['then'](function(_0x24e932){if(_0x24e932){return _0x24e932[_0xaf50('0x4d')](_0x33013f[_0xaf50('0x26')][_0xaf50('0x39')]);}})[_0xaf50('0x17')](respondWithStatusCode(_0x39d777,null))[_0xaf50('0x32')](handleError(_0x39d777,null));};exports[_0xaf50('0x4e')]=function(_0x40c40b,_0x5d2db2){var _0x109a6c=moment()[_0xaf50('0x4f')]()['toString']();var _0x38cf50=path['join'](config[_0xaf50('0x50')],'server',_0xaf50('0x51'),'tmp');var _0x154116=path['join'](config['root'],_0xaf50('0x52'),_0xaf50('0x51'),_0xaf50('0x53'));var _0x5d350a=path[_0xaf50('0x54')](_0x38cf50,_0x109a6c);var _0x1729c6=util[_0xaf50('0x45')](_0xaf50('0x55'),_0x40c40b[_0xaf50('0x35')]['id'],_0x109a6c);var _0x3f837c=path[_0xaf50('0x54')](_0x38cf50,_0x1729c6);var _0x375f4b=[];_0x375f4b['push']({'model':db['Attachment'],'as':_0xaf50('0x56'),'raw':!![]});var _0xbed70c=[{'model':db[_0xaf50('0x3c')],'as':'Messages','attributes':['id','body',_0xaf50('0x57')],'include':_0x375f4b}];return db[_0xaf50('0x1e')][_0xaf50('0x31')]({'where':{'id':_0x40c40b[_0xaf50('0x35')]['id']},'include':_0xbed70c})[_0xaf50('0x17')](handleEntityNotFound(_0x5d2db2,null))['then'](function(_0x2a7e1d){if(_0x2a7e1d&&_0x2a7e1d[_0xaf50('0x58')]){var _0x1486a4=_0x2a7e1d[_0xaf50('0x59')]({'plain':!![]});fs[_0xaf50('0x5a')](_0x5d350a);for(var _0x519e10=0x0;_0x519e10<_0x1486a4[_0xaf50('0x58')][_0xaf50('0x2e')];_0x519e10++){var _0x48a873=_0x1486a4['Messages'][_0x519e10][_0xaf50('0x56')];if(_0x48a873){var _0x1ba75b=path['join'](_0x154116,_0x48a873['basename']);if(fs['existsSync'](_0x1ba75b)){fs[_0xaf50('0x5b')](_0x1ba75b)[_0xaf50('0x5c')](fs[_0xaf50('0x5d')](path[_0xaf50('0x54')](_0x5d350a,_0x48a873['basename'])));}}}return BPromise[_0xaf50('0x5e')]()[_0xaf50('0x17')](function(){return new BPromise(function(_0x4d2b54,_0x2315e7){zipdir(_0x5d350a,{'saveTo':_0x3f837c},function(_0x3b3663,_0x38faf2){if(_0x3b3663)return _0x2315e7(_0x3b3663);return _0x4d2b54(_0x38faf2);});})[_0xaf50('0x17')](function(){return new BPromise(function(_0x326ad5,_0x266275){rimraf(_0x5d350a,function(_0xb793c9){if(_0xb793c9)_0x266275(_0xb793c9);return _0x326ad5();});});})['then'](function(){return _0x5d2db2[_0xaf50('0x4e')](_0x3f837c,_0x1729c6,function(_0x4bd7ad){if(_0x4bd7ad){console[_0xaf50('0x5f')](_0xaf50('0x60'),_0x4bd7ad);}else{fs[_0xaf50('0x61')](_0x3f837c);}});});});}else{return _0x5d2db2[_0xaf50('0x19')](0xc8);}})[_0xaf50('0x32')](handleError(_0x5d2db2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 4e44920..2d6628a 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 _0xb44e=['update','then','setDataValue','Users','map','findAll','length','emit','catch','hook','exports','events','FaxInteraction','FaxMessage','setMaxListeners','save'];(function(_0x4a4334,_0x11f528){var _0x3eaeb5=function(_0x1dfcdb){while(--_0x1dfcdb){_0x4a4334['push'](_0x4a4334['shift']());}};_0x3eaeb5(++_0x11f528);}(_0xb44e,0x9b));var _0xeb44=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xb44e[_0x8c1005];return _0x175354;};'use strict';var EventEmitter=require(_0xeb44('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xeb44('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xeb44('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xeb44('0x3')](0x0);var events={'afterCreate':_0xeb44('0x4'),'afterUpdate':_0xeb44('0x5'),'afterDestroy':'remove'};function emitEvent(_0x21499c){return function(_0xe1dc3b,_0x402325,_0x11a9cf){_0xe1dc3b['getUsers']({'attributes':['id'],'raw':!![]})[_0xeb44('0x6')](function(_0x1741d2){_0xe1dc3b[_0xeb44('0x7')](_0xeb44('0x8'),_0x1741d2[_0xeb44('0x9')](function(_0x343b12){return{'id':_0x343b12['id']};}));return FaxMessage[_0xeb44('0xa')]({'where':{'FaxInteractionId':_0xe1dc3b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb44('0x6')](function(_0x4e5072){_0xe1dc3b[_0xeb44('0x7')]('unreadMessages',_0x4e5072[_0xeb44('0xb')]);FaxInteractionEvents[_0xeb44('0xc')](_0x21499c+':'+_0xe1dc3b['id'],_0xe1dc3b);FaxInteractionEvents['emit'](_0x21499c,_0xe1dc3b);_0x11a9cf(null);})[_0xeb44('0xd')](_0x11a9cf(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xeb44('0xe')](e,emitEvent(event));}}module[_0xeb44('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xe4b5=['unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove','then','setDataValue','Users','map','findAll'];(function(_0x2840a9,_0x25276d){var _0xe08e42=function(_0x53c379){while(--_0x53c379){_0x2840a9['push'](_0x2840a9['shift']());}};_0xe08e42(++_0x25276d);}(_0xe4b5,0x19e));var _0x5e4b=function(_0x4c6aa1,_0x152e16){_0x4c6aa1=_0x4c6aa1-0x0;var _0x4cac5d=_0xe4b5[_0x4c6aa1];return _0x4cac5d;};'use strict';var EventEmitter=require(_0x5e4b('0x0'));var FaxInteraction=require(_0x5e4b('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x5e4b('0x1'))['db'][_0x5e4b('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e4b('0x3'),'afterUpdate':_0x5e4b('0x4'),'afterDestroy':_0x5e4b('0x5')};function emitEvent(_0x5d213b){return function(_0x4bc8b0,_0x867355,_0x25c863){_0x4bc8b0['getUsers']({'attributes':['id'],'raw':!![]})[_0x5e4b('0x6')](function(_0x5c0a6b){_0x4bc8b0[_0x5e4b('0x7')](_0x5e4b('0x8'),_0x5c0a6b[_0x5e4b('0x9')](function(_0x1ecfbc){return{'id':_0x1ecfbc['id']};}));return FaxMessage[_0x5e4b('0xa')]({'where':{'FaxInteractionId':_0x4bc8b0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5e4b('0x6')](function(_0x3a4870){_0x4bc8b0[_0x5e4b('0x7')](_0x5e4b('0xb'),_0x3a4870[_0x5e4b('0xc')]);FaxInteractionEvents['emit'](_0x5d213b+':'+_0x4bc8b0['id'],_0x4bc8b0);FaxInteractionEvents['emit'](_0x5d213b,_0x4bc8b0);_0x25c863(null);})[_0x5e4b('0xd')](_0x25c863(null));};}for(var e in events){if(events[_0x5e4b('0xe')](e)){var event=events[e];FaxInteraction[_0x5e4b('0xf')](e,emitEvent(event));}}module[_0x5e4b('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 50c82ce..920c8a5 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 _0x405f=['bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0x405f,0x1d8));var _0xf405=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x405f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xf405('0x0'));var logger=require(_0xf405('0x1'))(_0xf405('0x2'));var moment=require(_0xf405('0x3'));var BPromise=require(_0xf405('0x4'));var rp=require(_0xf405('0x5'));var fs=require('fs');var path=require(_0xf405('0x6'));var rimraf=require(_0xf405('0x7'));var config=require(_0xf405('0x8'));var attributes=require(_0xf405('0x9'));module[_0xf405('0xa')]=function(_0x3c9e7c,_0xcf1e3e){return _0x3c9e7c[_0xf405('0xb')](_0xf405('0xc'),attributes,{'tableName':_0xf405('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a7483,_0x218a4a,_0x175d4e){if(_0x3a7483['changed'](_0xf405('0xe'))){_0x3a7483['closedAt']=moment()[_0xf405('0xf')](_0xf405('0x10'));}_0x175d4e(null,_0x3a7483);}}});}; \ No newline at end of file +var _0x065d=['request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','changed','closed','closedAt','util','../../config/logger','api','bluebird'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x065d,0x1d8));var _0xd065=function(_0x5e6c68,_0x48bf5c){_0x5e6c68=_0x5e6c68-0x0;var _0x1f3d18=_0x065d[_0x5e6c68];return _0x1f3d18;};'use strict';var _=require('lodash');var util=require(_0xd065('0x0'));var logger=require(_0xd065('0x1'))(_0xd065('0x2'));var moment=require('moment');var BPromise=require(_0xd065('0x3'));var rp=require(_0xd065('0x4'));var fs=require('fs');var path=require(_0xd065('0x5'));var rimraf=require(_0xd065('0x6'));var config=require(_0xd065('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xd065('0x8')]=function(_0x758260,_0x2c85b1){return _0x758260[_0xd065('0x9')](_0xd065('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x524754,_0x36ab99,_0x274a14){if(_0x524754[_0xd065('0xb')](_0xd065('0xc'))){_0x524754[_0xd065('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x274a14(null,_0x524754);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 0c58349..a782697 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 _0x124e=['where','attributes','limit','catch','find','addTags','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateFaxInteraction','FaxInteraction','update','body','options','raw'];(function(_0x22f924,_0x17b3db){var _0x558899=function(_0x1c7474){while(--_0x1c7474){_0x22f924['push'](_0x22f924['shift']());}};_0x558899(++_0x17b3db);}(_0x124e,0xc7));var _0xe124=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x124e[_0x273dc5];return _0x46dae7;};'use strict';var _=require(_0xe124('0x0'));var util=require('util');var moment=require(_0xe124('0x1'));var BPromise=require(_0xe124('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe124('0x3'))['db'];var utils=require(_0xe124('0x4'));var logger=require(_0xe124('0x5'))(_0xe124('0x6'));var config=require(_0xe124('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe124('0x8')][_0xe124('0x9')]({'port':0x232a});config['redis']=_[_0xe124('0xa')](config[_0xe124('0xb')],{'host':_0xe124('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe124('0xb')]));require('./faxInteraction.socket')[_0xe124('0xd')](socket);function respondWithRpcPromise(_0xeb61f4,_0x5c84a1,_0x1ac012){return new BPromise(function(_0x4fad50,_0x3d2eea){return client['request'](_0xeb61f4,_0x1ac012)[_0xe124('0xe')](function(_0x412ae8){logger[_0xe124('0xf')](_0xe124('0x10'),_0x5c84a1,_0xe124('0x11'));logger[_0xe124('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5c84a1,_0xe124('0x11'),JSON[_0xe124('0x13')](_0x412ae8));if(_0x412ae8[_0xe124('0x14')]){if(_0x412ae8[_0xe124('0x14')][_0xe124('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x5c84a1,_0x412ae8[_0xe124('0x14')][_0xe124('0x16')]);return _0x3d2eea(_0x412ae8[_0xe124('0x14')]['message']);}logger[_0xe124('0x14')](_0xe124('0x10'),_0x5c84a1,_0x412ae8[_0xe124('0x14')]['message']);return _0x4fad50(_0x412ae8[_0xe124('0x14')]['message']);}else{logger[_0xe124('0xf')](_0xe124('0x10'),_0x5c84a1,_0xe124('0x11'));_0x4fad50(_0x412ae8['result'][_0xe124('0x16')]);}})['catch'](function(_0x1e1780){logger[_0xe124('0x14')](_0xe124('0x10'),_0x5c84a1,_0x1e1780);_0x3d2eea(_0x1e1780);});});}exports[_0xe124('0x17')]=function(_0x46dff7){var _0x2ceb73=this;return new Promise(function(_0x230071,_0x735af2){return db[_0xe124('0x18')][_0xe124('0x19')](_0x46dff7[_0xe124('0x1a')],{'raw':_0x46dff7[_0xe124('0x1b')]?_0x46dff7['options'][_0xe124('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46dff7['options']?_0x46dff7[_0xe124('0x1b')][_0xe124('0x1d')]||null:null,'attributes':_0x46dff7[_0xe124('0x1b')]?_0x46dff7[_0xe124('0x1b')][_0xe124('0x1e')]||null:null,'limit':_0x46dff7[_0xe124('0x1b')]?_0x46dff7['options'][_0xe124('0x1f')]||null:null})['then'](function(_0x2fcaeb){logger['info'](_0xe124('0x17'),_0x46dff7);logger[_0xe124('0x12')](_0xe124('0x17'),_0x46dff7,JSON[_0xe124('0x13')](_0x2fcaeb));_0x230071(_0x2fcaeb);})[_0xe124('0x20')](function(_0x29132d){logger[_0xe124('0x14')](_0xe124('0x17'),_0x29132d[_0xe124('0x16')],_0x46dff7);_0x735af2(_0x2ceb73['error'](0x1f4,_0x29132d['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x4e9358){return new Promise(function(_0x249767,_0x347dfc){return db['FaxInteraction'][_0xe124('0x21')]({'where':_0x4e9358[_0xe124('0x1b')]?_0x4e9358[_0xe124('0x1b')][_0xe124('0x1d')]||null:null})['then'](function(_0x1ce01a){if(_0x1ce01a){return _0x1ce01a[_0xe124('0x22')](_0x4e9358[_0xe124('0x1a')]['ids'],_[_0xe124('0x23')](_0x4e9358[_0xe124('0x1a')],['ids','id'])||{});}})[_0xe124('0x24')](function(_0x4f4ede){logger[_0xe124('0xf')](_0xe124('0x25'),_0x4e9358);logger[_0xe124('0x12')]('AddTags',_0x4e9358,JSON[_0xe124('0x13')](_0x4f4ede));_0x249767(_0x4f4ede);})[_0xe124('0x20')](function(_0xb1ac71){logger[_0xe124('0x14')](_0xe124('0x25'),_0xb1ac71[_0xe124('0x16')],_0x4e9358);_0x347dfc(_this[_0xe124('0x14')](0x1f4,_0xb1ac71['message']));});});}; \ No newline at end of file +var _0x2edf=['limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','raw'];(function(_0xadb3d8,_0x38cfde){var _0x12d6a0=function(_0xbb1924){while(--_0xbb1924){_0xadb3d8['push'](_0xadb3d8['shift']());}};_0x12d6a0(++_0x38cfde);}(_0x2edf,0x10b));var _0xf2ed=function(_0x1fb6e2,_0x3a22ce){_0x1fb6e2=_0x1fb6e2-0x0;var _0x354690=_0x2edf[_0x1fb6e2];return _0x354690;};'use strict';var _=require(_0xf2ed('0x0'));var util=require(_0xf2ed('0x1'));var moment=require(_0xf2ed('0x2'));var BPromise=require(_0xf2ed('0x3'));var rs=require(_0xf2ed('0x4'));var fs=require('fs');var Redis=require(_0xf2ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2ed('0x6'));var logger=require('../../config/logger')(_0xf2ed('0x7'));var config=require(_0xf2ed('0x8'));var jayson=require(_0xf2ed('0x9'));var client=jayson[_0xf2ed('0xa')]['http']({'port':0x232a});config['redis']=_[_0xf2ed('0xb')](config[_0xf2ed('0xc')],{'host':_0xf2ed('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2ed('0xc')]));require(_0xf2ed('0xe'))['register'](socket);function respondWithRpcPromise(_0x384087,_0x35a5c5,_0x58f0ed){return new BPromise(function(_0x1ab6d3,_0x5574c9){return client[_0xf2ed('0xf')](_0x384087,_0x58f0ed)[_0xf2ed('0x10')](function(_0x3fded8){logger[_0xf2ed('0x11')](_0xf2ed('0x12'),_0x35a5c5,_0xf2ed('0x13'));logger[_0xf2ed('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x35a5c5,'request\x20sent',JSON['stringify'](_0x3fded8));if(_0x3fded8[_0xf2ed('0x15')]){if(_0x3fded8['error']['code']===0x1f4){logger['error'](_0xf2ed('0x12'),_0x35a5c5,_0x3fded8['error'][_0xf2ed('0x16')]);return _0x5574c9(_0x3fded8['error'][_0xf2ed('0x16')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x35a5c5,_0x3fded8['error'][_0xf2ed('0x16')]);return _0x1ab6d3(_0x3fded8['error'][_0xf2ed('0x16')]);}else{logger[_0xf2ed('0x11')](_0xf2ed('0x12'),_0x35a5c5,_0xf2ed('0x13'));_0x1ab6d3(_0x3fded8[_0xf2ed('0x17')][_0xf2ed('0x16')]);}})[_0xf2ed('0x18')](function(_0x47bb8e){logger[_0xf2ed('0x15')](_0xf2ed('0x12'),_0x35a5c5,_0x47bb8e);_0x5574c9(_0x47bb8e);});});}exports[_0xf2ed('0x19')]=function(_0x4e7d75){var _0x5933f0=this;return new Promise(function(_0x57a9a9,_0x3fceea){return db[_0xf2ed('0x1a')]['update'](_0x4e7d75['body'],{'raw':_0x4e7d75[_0xf2ed('0x1b')]?_0x4e7d75[_0xf2ed('0x1b')][_0xf2ed('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7d75[_0xf2ed('0x1b')]?_0x4e7d75[_0xf2ed('0x1b')]['where']||null:null,'attributes':_0x4e7d75[_0xf2ed('0x1b')]?_0x4e7d75['options']['attributes']||null:null,'limit':_0x4e7d75['options']?_0x4e7d75[_0xf2ed('0x1b')][_0xf2ed('0x1d')]||null:null})['then'](function(_0x10a3e4){logger[_0xf2ed('0x11')](_0xf2ed('0x19'),_0x4e7d75);logger['debug'](_0xf2ed('0x19'),_0x4e7d75,JSON[_0xf2ed('0x1e')](_0x10a3e4));_0x57a9a9(_0x10a3e4);})[_0xf2ed('0x18')](function(_0x2d61ef){logger[_0xf2ed('0x15')](_0xf2ed('0x19'),_0x2d61ef[_0xf2ed('0x16')],_0x4e7d75);_0x3fceea(_0x5933f0[_0xf2ed('0x15')](0x1f4,_0x2d61ef[_0xf2ed('0x16')]));});});};exports[_0xf2ed('0x1f')]=function(_0x4e6703){return new Promise(function(_0x3f3ab5,_0x3d4924){return db['FaxInteraction'][_0xf2ed('0x20')]({'where':_0x4e6703[_0xf2ed('0x1b')]?_0x4e6703[_0xf2ed('0x1b')]['where']||null:null})[_0xf2ed('0x10')](function(_0x2922f7){if(_0x2922f7){return _0x2922f7[_0xf2ed('0x21')](_0x4e6703['body'][_0xf2ed('0x22')],_[_0xf2ed('0x23')](_0x4e6703['body'],[_0xf2ed('0x22'),'id'])||{});}})['spread'](function(_0x198233){logger[_0xf2ed('0x11')](_0xf2ed('0x24'),_0x4e6703);logger[_0xf2ed('0x14')](_0xf2ed('0x24'),_0x4e6703,JSON[_0xf2ed('0x1e')](_0x198233));_0x3f3ab5(_0x198233);})[_0xf2ed('0x18')](function(_0x4a1bf9){logger[_0xf2ed('0x15')](_0xf2ed('0x24'),_0x4a1bf9[_0xf2ed('0x16')],_0x4e6703);_0x3d4924(_this[_0xf2ed('0x15')](0x1f4,_0x4a1bf9[_0xf2ed('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4c9a1e5..bc816a8 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 _0x909e=['length','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x909e,0x1f2));var _0xe909=function(_0x3bfa0a,_0x1b84fb){_0x3bfa0a=_0x3bfa0a-0x0;var _0x483031=_0x909e[_0x3bfa0a];return _0x483031;};'use strict';var FaxInteractionEvents=require(_0xe909('0x0'));var events=[_0xe909('0x1'),_0xe909('0x2'),_0xe909('0x3')];function createListener(_0x1d54ab,_0x5900af){return function(_0x430c40){_0x5900af['emit'](_0x1d54ab,_0x430c40);};}function removeListener(_0x1fdb06,_0x2a35ac){return function(){FaxInteractionEvents[_0xe909('0x4')](_0x1fdb06,_0x2a35ac);};}exports[_0xe909('0x5')]=function(_0x2b549a){for(var _0x4c8fe7=0x0,_0x531419=events[_0xe909('0x6')];_0x4c8fe7<_0x531419;_0x4c8fe7++){var _0x57f0f5=events[_0x4c8fe7];var _0x961ad8=createListener(_0xe909('0x7')+_0x57f0f5,_0x2b549a);FaxInteractionEvents['on'](_0x57f0f5,_0x961ad8);}}; \ No newline at end of file +var _0x9b1c=['length','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x283cd1,_0x1bb686){var _0xecf7b2=function(_0x27cc0b){while(--_0x27cc0b){_0x283cd1['push'](_0x283cd1['shift']());}};_0xecf7b2(++_0x1bb686);}(_0x9b1c,0x16a));var _0xc9b1=function(_0x5a04ef,_0x38da7a){_0x5a04ef=_0x5a04ef-0x0;var _0xd92f45=_0x9b1c[_0x5a04ef];return _0xd92f45;};'use strict';var FaxInteractionEvents=require(_0xc9b1('0x0'));var events=[_0xc9b1('0x1'),_0xc9b1('0x2'),_0xc9b1('0x3')];function createListener(_0x1167a3,_0x26e0af){return function(_0xdfe543){_0x26e0af['emit'](_0x1167a3,_0xdfe543);};}function removeListener(_0xdbe170,_0x588621){return function(){FaxInteractionEvents[_0xc9b1('0x4')](_0xdbe170,_0x588621);};}exports[_0xc9b1('0x5')]=function(_0x284b26){for(var _0x424ae0=0x0,_0x1a83b4=events[_0xc9b1('0x6')];_0x424ae0<_0x1a83b4;_0x424ae0++){var _0x2d5550=events[_0x424ae0];var _0x4ce6af=createListener(_0xc9b1('0x7')+_0x2d5550,_0x284b26);FaxInteractionEvents['on'](_0x2d5550,_0x4ce6af);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 8eefa53..7aaf0b6 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 _0x4bc9=['delete','faxinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','create','post','/:id/tags','fax','tracked','update'];(function(_0xa423c5,_0x2472d3){var _0x39fffd=function(_0x4d8986){while(--_0x4d8986){_0xa423c5['push'](_0xa423c5['shift']());}};_0x39fffd(++_0x2472d3);}(_0x4bc9,0x1d4));var _0x94bc=function(_0xd6b5d6,_0x157d08){_0xd6b5d6=_0xd6b5d6-0x0;var _0x243656=_0x4bc9[_0xd6b5d6];return _0x243656;};'use strict';var multer=require(_0x94bc('0x0'));var util=require(_0x94bc('0x1'));var path=require('path');var timeout=require(_0x94bc('0x2'));var express=require(_0x94bc('0x3'));var router=express[_0x94bc('0x4')]();var fs_extra=require(_0x94bc('0x5'));var auth=require(_0x94bc('0x6'));var interaction=require(_0x94bc('0x7'));var config=require(_0x94bc('0x8'));var controller=require(_0x94bc('0x9'));router[_0x94bc('0xa')]('/',auth[_0x94bc('0xb')](),controller[_0x94bc('0xc')]);router[_0x94bc('0xa')](_0x94bc('0xd'),auth[_0x94bc('0xb')](),controller['describe']);router['get'](_0x94bc('0xe'),auth['isAuthenticated'](),controller[_0x94bc('0xf')]);router[_0x94bc('0xa')](_0x94bc('0x10'),auth[_0x94bc('0xb')](),controller['getMessages']);router[_0x94bc('0xa')](_0x94bc('0x11'),auth[_0x94bc('0xb')](),controller[_0x94bc('0x12')]);router['post']('/',auth[_0x94bc('0xb')](),controller[_0x94bc('0x13')]);router[_0x94bc('0x14')](_0x94bc('0x10'),auth[_0x94bc('0xb')](),controller['addMessage']);router[_0x94bc('0x14')](_0x94bc('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x94bc('0x16'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0x94bc('0xe'),auth[_0x94bc('0xb')](),interaction[_0x94bc('0x17')](_0x94bc('0x16'),'faxinteraction:update'),controller[_0x94bc('0x18')]);router[_0x94bc('0x19')](_0x94bc('0xe'),auth[_0x94bc('0xb')](),interaction['tracked']('fax',_0x94bc('0x1a')),controller['destroy']);router[_0x94bc('0x19')](_0x94bc('0x15'),auth[_0x94bc('0xb')](),controller[_0x94bc('0x1b')]);module[_0x94bc('0x1c')]=router; \ No newline at end of file +var _0x370d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x370d,0xc6));var _0xd370=function(_0x38358a,_0x864f16){_0x38358a=_0x38358a-0x0;var _0x1a0c18=_0x370d[_0x38358a];return _0x1a0c18;};'use strict';var multer=require(_0xd370('0x0'));var util=require(_0xd370('0x1'));var path=require('path');var timeout=require(_0xd370('0x2'));var express=require(_0xd370('0x3'));var router=express[_0xd370('0x4')]();var fs_extra=require(_0xd370('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd370('0x6'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd370('0x7')]);router[_0xd370('0x8')](_0xd370('0x9'),auth[_0xd370('0xa')](),controller[_0xd370('0xb')]);router[_0xd370('0x8')](_0xd370('0xc'),auth[_0xd370('0xa')](),controller['show']);router[_0xd370('0x8')](_0xd370('0xd'),auth[_0xd370('0xa')](),controller[_0xd370('0xe')]);router[_0xd370('0x8')](_0xd370('0xf'),auth['isAuthenticated'](),controller[_0xd370('0x10')]);router[_0xd370('0x11')]('/',auth['isAuthenticated'](),controller[_0xd370('0x12')]);router['post'](_0xd370('0xd'),auth[_0xd370('0xa')](),controller[_0xd370('0x13')]);router[_0xd370('0x11')](_0xd370('0x14'),auth[_0xd370('0xa')](),interaction['tracked']('fax',_0xd370('0x15')),controller[_0xd370('0x16')]);router[_0xd370('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xd370('0x18')](_0xd370('0x19'),_0xd370('0x1a')),controller[_0xd370('0x1b')]);router[_0xd370('0x1c')](_0xd370('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xd370('0x19'),_0xd370('0x1d')),controller[_0xd370('0x1e')]);router[_0xd370('0x1c')](_0xd370('0x14'),auth[_0xd370('0xa')](),controller[_0xd370('0x1f')]);module[_0xd370('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 5c670b4..efa8ebb 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 _0x383d=['medium','BOOLEAN','out','DATE','TEXT'];(function(_0x529351,_0x3ac704){var _0x41cd56=function(_0x540861){while(--_0x540861){_0x529351['push'](_0x529351['shift']());}};_0x41cd56(++_0x3ac704);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd383('0x0')](_0xd383('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd383('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd383('0x3')),'defaultValue':_0xd383('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd383('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd383('0x4')]}}; \ No newline at end of file +var _0x12c9=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x57883f,_0x201cb4){var _0x14ed92=function(_0x5689c7){while(--_0x5689c7){_0x57883f['push'](_0x57883f['shift']());}};_0x14ed92(++_0x201cb4);}(_0x12c9,0x1c9));var _0x912c=function(_0x77ce99,_0x505a17){_0x77ce99=_0x77ce99-0x0;var _0x1fe52d=_0x12c9[_0x77ce99];return _0x1fe52d;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'body':{'type':Sequelize[_0x912c('0x2')](_0x912c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x912c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x912c('0x5')),'defaultValue':_0x912c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x912c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x912c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8a0282b..8c5b2b6 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 _0x8083=['model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','keys','include','find','body','params','destroy','describe','fax-interactions','fax','read','readAt','format','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','reject','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','motionChannel','CmContact','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','attachments','basename','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\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','update','stack','name','send','index','FaxMessage','rawAttributes','type','key'];(function(_0x479cad,_0x4b796c){var _0x551ebb=function(_0x210815){while(--_0x210815){_0x479cad['push'](_0x479cad['shift']());}};_0x551ebb(++_0x4b796c);}(_0x8083,0x1ed));var _0x3808=function(_0x13b796,_0x19507b){_0x13b796=_0x13b796-0x0;var _0x54757d=_0x8083[_0x13b796];return _0x54757d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3808('0x0'));var zipdir=require(_0x3808('0x1'));var jsonpatch=require(_0x3808('0x2'));var rp=require('request-promise');var moment=require(_0x3808('0x3'));var BPromise=require(_0x3808('0x4'));var Mustache=require(_0x3808('0x5'));var util=require(_0x3808('0x6'));var path=require(_0x3808('0x7'));var sox=require('sox');var csv=require(_0x3808('0x8'));var ejs=require(_0x3808('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3808('0xa'));var squel=require('squel');var crypto=require(_0x3808('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3808('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3808('0xd'));var Papa=require(_0x3808('0xe'));var Redis=require(_0x3808('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3808('0x10'));var logger=require(_0x3808('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3808('0x12'));var db=require(_0x3808('0x13'))['db'];config[_0x3808('0x14')]=_[_0x3808('0x15')](config['redis'],{'host':_0x3808('0x16'),'port':0x18eb});var socket=require(_0x3808('0x17'))(new Redis(config['redis']));require(_0x3808('0x18'))[_0x3808('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3808('0x1a')][_0x3808('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa28896,_0x4a6c19,_0x50428a,_0x2e82d2){return new BPromise(function(_0x4556b0,_0x356c6e){var _0x3c2a66=_0x2e82d2||client;return _0x3c2a66[_0x3808('0x1c')](_0xa28896,_0x50428a)[_0x3808('0x1d')](function(_0x5da8cb){logger['info'](_0x3808('0x1e'),_0x4a6c19,'request\x20sent');logger[_0x3808('0x1f')](_0x3808('0x20'),_0x4a6c19,_0x3808('0x21'),JSON[_0x3808('0x22')](_0x5da8cb));if(_0x5da8cb[_0x3808('0x23')]){if(_0x5da8cb[_0x3808('0x23')][_0x3808('0x24')]===0x1f4){logger[_0x3808('0x23')](_0x3808('0x1e'),_0x4a6c19,_0x5da8cb[_0x3808('0x23')][_0x3808('0x25')]);return _0x356c6e(_0x5da8cb[_0x3808('0x23')][_0x3808('0x25')]);}logger[_0x3808('0x23')](_0x3808('0x1e'),_0x4a6c19,_0x5da8cb[_0x3808('0x23')][_0x3808('0x25')]);return _0x4556b0(_0x5da8cb[_0x3808('0x23')][_0x3808('0x25')]);}else{logger['info'](_0x3808('0x1e'),_0x4a6c19,_0x3808('0x21'));_0x4556b0(_0x5da8cb[_0x3808('0x26')][_0x3808('0x25')]);}})[_0x3808('0x27')](function(_0x4872e5){logger[_0x3808('0x23')](_0x3808('0x1e'),_0x4a6c19,_0x4872e5);_0x356c6e(_0x4872e5);});});}function respondWithStatusCode(_0x53b5e7,_0x5868af){_0x5868af=_0x5868af||0xcc;return function(_0x552cb8){if(_0x552cb8){return _0x53b5e7[_0x3808('0x28')](_0x5868af);}return _0x53b5e7[_0x3808('0x29')](_0x5868af)[_0x3808('0x2a')]();};}function respondWithResult(_0x4c578e,_0x3a8fd1){_0x3a8fd1=_0x3a8fd1||0xc8;return function(_0x1d4abb){if(_0x1d4abb){return _0x4c578e[_0x3808('0x29')](_0x3a8fd1)[_0x3808('0x2b')](_0x1d4abb);}};}function respondWithFilteredResult(_0x22a93d,_0x5c0982){return function(_0xe4260b){if(_0xe4260b){var _0x12e7bc=typeof _0x5c0982['offset']===_0x3808('0x2c')&&typeof _0x5c0982['limit']===_0x3808('0x2c');var _0x654d81=_0xe4260b[_0x3808('0x2d')];var _0x59d524=_0x12e7bc?0x0:_0x5c0982[_0x3808('0x2e')];var _0x21ce90=_0x12e7bc?_0xe4260b[_0x3808('0x2d')]:_0x5c0982[_0x3808('0x2e')]+_0x5c0982[_0x3808('0x2f')];var _0x25b5b7;if(_0x21ce90>=_0x654d81){_0x21ce90=_0x654d81;_0x25b5b7=0xc8;}else{_0x25b5b7=0xce;}_0x22a93d[_0x3808('0x29')](_0x25b5b7);return _0x22a93d[_0x3808('0x30')](_0x3808('0x31'),_0x59d524+'-'+_0x21ce90+'/'+_0x654d81)['json'](_0xe4260b);}return null;};}function patchUpdates(_0x159ab7){return function(_0x26c8ec){try{jsonpatch['apply'](_0x26c8ec,_0x159ab7,!![]);}catch(_0x7a724b){return BPromise['reject'](_0x7a724b);}return _0x26c8ec['save']();};}function saveUpdates(_0xbab505,_0x12f81a){return function(_0x39383d){if(_0x39383d){return _0x39383d[_0x3808('0x32')](_0xbab505)[_0x3808('0x1d')](function(_0x4c0c65){return _0x4c0c65;});}return null;};}function removeEntity(_0x44fa4f,_0x2aa717){return function(_0x26077b){if(_0x26077b){return _0x26077b['destroy']()[_0x3808('0x1d')](function(){_0x44fa4f['status'](0xcc)[_0x3808('0x2a')]();});}};}function handleEntityNotFound(_0x4eb80d,_0x2e77f1){return function(_0xc4d51b){if(!_0xc4d51b){_0x4eb80d[_0x3808('0x28')](0x194);}return _0xc4d51b;};}function handleError(_0x3bd52d,_0x48628c){_0x48628c=_0x48628c||0x1f4;return function(_0x1ca3eb){logger[_0x3808('0x23')](_0x1ca3eb[_0x3808('0x33')]);if(_0x1ca3eb[_0x3808('0x34')]){delete _0x1ca3eb[_0x3808('0x34')];}_0x3bd52d[_0x3808('0x29')](_0x48628c)[_0x3808('0x35')](_0x1ca3eb);};}exports[_0x3808('0x36')]=function(_0x4e6cc9,_0x27ce48){var _0x264366={},_0x7c3b0e={},_0x456501={'count':0x0,'rows':[]};var _0x33a67e=_['map'](db[_0x3808('0x37')][_0x3808('0x38')],function(_0x3deb3e){return{'name':_0x3deb3e['fieldName'],'type':_0x3deb3e[_0x3808('0x39')][_0x3808('0x3a')]};});_0x7c3b0e[_0x3808('0x3b')]=_[_0x3808('0x3c')](_0x33a67e,_0x3808('0x34'));_0x7c3b0e[_0x3808('0x3d')]=_['keys'](_0x4e6cc9['query']);_0x7c3b0e[_0x3808('0x3e')]=_[_0x3808('0x3f')](_0x7c3b0e[_0x3808('0x3b')],_0x7c3b0e[_0x3808('0x3d')]);_0x264366[_0x3808('0x40')]=_[_0x3808('0x3f')](_0x7c3b0e['model'],qs[_0x3808('0x41')](_0x4e6cc9[_0x3808('0x3d')][_0x3808('0x41')]));_0x264366['attributes']=_0x264366[_0x3808('0x40')][_0x3808('0x42')]?_0x264366['attributes']:_0x7c3b0e[_0x3808('0x3b')];if(!_0x4e6cc9[_0x3808('0x3d')][_0x3808('0x43')](_0x3808('0x44'))){_0x264366[_0x3808('0x2f')]=qs[_0x3808('0x2f')](_0x4e6cc9[_0x3808('0x3d')]['limit']);_0x264366['offset']=qs[_0x3808('0x2e')](_0x4e6cc9[_0x3808('0x3d')][_0x3808('0x2e')]);}_0x264366[_0x3808('0x45')]=qs[_0x3808('0x46')](_0x4e6cc9['query']['sort']);_0x264366[_0x3808('0x47')]=qs[_0x3808('0x3e')](_['pick'](_0x4e6cc9[_0x3808('0x3d')],_0x7c3b0e[_0x3808('0x3e')]),_0x33a67e);if(_0x4e6cc9[_0x3808('0x3d')][_0x3808('0x48')]){_0x264366[_0x3808('0x47')]=_[_0x3808('0x49')](_0x264366[_0x3808('0x47')],{'$or':_[_0x3808('0x3c')](_0x33a67e,function(_0x54c8ac){if(_0x54c8ac[_0x3808('0x39')]!==_0x3808('0x4a')){var _0x270ada={};_0x270ada[_0x54c8ac[_0x3808('0x34')]]={'$like':'%'+_0x4e6cc9['query']['filter']+'%'};return _0x270ada;}})});}_0x264366=_['merge']({},_0x264366,_0x4e6cc9[_0x3808('0x4b')]);var _0xd18225={'where':_0x264366[_0x3808('0x47')]};return db[_0x3808('0x37')][_0x3808('0x2d')](_0xd18225)[_0x3808('0x1d')](function(_0x2a83e1){_0x456501[_0x3808('0x2d')]=_0x2a83e1;if(_0x4e6cc9['query'][_0x3808('0x4c')]){_0x264366['include']=[{'all':!![]}];}return db[_0x3808('0x37')][_0x3808('0x4d')](_0x264366);})[_0x3808('0x1d')](function(_0x129223){_0x456501['rows']=_0x129223;return _0x456501;})['then'](respondWithFilteredResult(_0x27ce48,_0x264366))[_0x3808('0x27')](handleError(_0x27ce48,null));};exports[_0x3808('0x4e')]=function(_0x58a4cc,_0x4dc814){var _0x137224={'raw':!![],'where':{'id':_0x58a4cc['params']['id']}},_0x5ee074={};_0x5ee074[_0x3808('0x3b')]=_[_0x3808('0x4f')](db[_0x3808('0x37')][_0x3808('0x38')]);_0x5ee074[_0x3808('0x3d')]=_[_0x3808('0x4f')](_0x58a4cc[_0x3808('0x3d')]);_0x5ee074[_0x3808('0x3e')]=_[_0x3808('0x3f')](_0x5ee074[_0x3808('0x3b')],_0x5ee074[_0x3808('0x3d')]);_0x137224[_0x3808('0x40')]=_[_0x3808('0x3f')](_0x5ee074[_0x3808('0x3b')],qs[_0x3808('0x41')](_0x58a4cc[_0x3808('0x3d')][_0x3808('0x41')]));_0x137224[_0x3808('0x40')]=_0x137224[_0x3808('0x40')][_0x3808('0x42')]?_0x137224[_0x3808('0x40')]:_0x5ee074[_0x3808('0x3b')];if(_0x58a4cc[_0x3808('0x3d')][_0x3808('0x4c')]){_0x137224[_0x3808('0x50')]=[{'all':!![]}];}_0x137224=_[_0x3808('0x49')]({},_0x137224,_0x58a4cc[_0x3808('0x4b')]);return db['FaxMessage'][_0x3808('0x51')](_0x137224)[_0x3808('0x1d')](handleEntityNotFound(_0x4dc814,null))['then'](respondWithResult(_0x4dc814,null))[_0x3808('0x27')](handleError(_0x4dc814,null));};exports[_0x3808('0x32')]=function(_0x3eaca2,_0x13dcb3){if(_0x3eaca2[_0x3808('0x52')]['id']){delete _0x3eaca2['body']['id'];}return db[_0x3808('0x37')][_0x3808('0x51')]({'where':{'id':_0x3eaca2[_0x3808('0x53')]['id']}})[_0x3808('0x1d')](handleEntityNotFound(_0x13dcb3,null))[_0x3808('0x1d')](saveUpdates(_0x3eaca2['body'],null))[_0x3808('0x1d')](respondWithResult(_0x13dcb3,null))['catch'](handleError(_0x13dcb3,null));};exports[_0x3808('0x54')]=function(_0x3cd936,_0x27cd35){return db['FaxMessage'][_0x3808('0x51')]({'where':{'id':_0x3cd936[_0x3808('0x53')]['id']}})[_0x3808('0x1d')](handleEntityNotFound(_0x27cd35,null))[_0x3808('0x1d')](removeEntity(_0x27cd35,null))[_0x3808('0x27')](handleError(_0x27cd35,null));};exports[_0x3808('0x55')]=function(_0x508135,_0x42d29c){return db[_0x3808('0x37')]['describe']()[_0x3808('0x1d')](respondWithResult(_0x42d29c,null))[_0x3808('0x27')](handleError(_0x42d29c,null));};var interaction_log=require(_0x3808('0x11'))(_0x3808('0x56'));exports['accept']=function(_0x13a69c,_0x1d7df8,_0x4b82c8){var _0x66d4ea={'agent':{},'channel':_0x3808('0x57')};if(_0x13a69c[_0x3808('0x52')]['id']){delete _0x13a69c[_0x3808('0x52')]['id'];}_0x13a69c[_0x3808('0x52')][_0x3808('0x58')]=!![];_0x13a69c[_0x3808('0x52')][_0x3808('0x59')]=moment()[_0x3808('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x13a69c[_0x3808('0x52')]['UserId']=_0x13a69c['body'][_0x3808('0x5b')]||_0x13a69c[_0x3808('0x5c')]['id'];_0x66d4ea[_0x3808('0x5d')]['id']=_0x13a69c[_0x3808('0x52')][_0x3808('0x5b')];return db[_0x3808('0x37')][_0x3808('0x51')]({'where':{'id':_0x13a69c[_0x3808('0x53')]['id'],'UserId':null}})[_0x3808('0x1d')](handleEntityNotFound(_0x1d7df8,null))['then'](saveUpdates(_0x13a69c['body'],null))[_0x3808('0x1d')](function(_0x8fae7d){if(_0x8fae7d){_0x66d4ea[_0x3808('0x25')]=_0x8fae7d['get']({'plain':!![]});return db[_0x3808('0x5e')][_0x3808('0x51')]({'where':{'id':_0x8fae7d[_0x3808('0x5f')]}});}return null;})[_0x3808('0x1d')](handleEntityNotFound(_0x1d7df8,null))[_0x3808('0x1d')](function(_0x2e6375){if(_0x2e6375){return _0x2e6375[_0x3808('0x32')]({'UserId':_0x13a69c['body'][_0x3808('0x5b')],'read1stAt':_['isNil'](_0x2e6375[_0x3808('0x60')])?moment()[_0x3808('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3808('0x1d')](function(_0x5a765d){if(_0x5a765d){_0x66d4ea[_0x3808('0x61')]=_0x5a765d['get']({'plain':!![]});interaction_log[_0x3808('0x62')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x13a69c[_0x3808('0x5c')]['id'],_0x13a69c['user'][_0x3808('0x34')],_0x13a69c[_0x3808('0x5c')][_0x3808('0x63')],_0x66d4ea['interaction']['id'],_0x13a69c[_0x3808('0x52')]?JSON[_0x3808('0x22')](_0x13a69c[_0x3808('0x52')]):_0x3808('0x64'));return respondWithRpcPromise(_0x3808('0x65'),_0x3808('0x66'),_0x66d4ea);}return null;})[_0x3808('0x1d')](function(_0x1a54d4){var _0x516e93='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1a54d4['message']['ContactId'];return db[_0x3808('0x67')][_0x3808('0x3d')](_0x516e93,{'type':db[_0x3808('0x68')][_0x3808('0x69')]['SELECT'],'raw':!![]})['then'](function(_0x4d4369){return _0x4d4369;});})[_0x3808('0x1d')](function(_0x470c0f){if(_0x470c0f){_0x66d4ea[_0x3808('0x25')][_0x3808('0x6a')]=_0x470c0f[0x0];if(!_0x13a69c[_0x3808('0x52')][_0x3808('0x5b')])return;return db[_0x3808('0x6b')][_0x3808('0x51')]({'where':{'id':_0x13a69c[_0x3808('0x52')]['UserId'],'role':_0x3808('0x5d')},'attributes':['id','name',_0x3808('0x6c'),_0x3808('0x6d'),_0x3808('0x6e')],'raw':!![]});}return null;})[_0x3808('0x1d')](function(_0x1ec881){if(!_0x1ec881)return null;_0x66d4ea[_0x3808('0x25')]['agent']=_0x1ec881;return _0x66d4ea;})['then'](function(_0x4958d3){if(_0x4958d3){if(_0x13a69c[_0x3808('0x52')][_0x3808('0x6f')]){_0x66d4ea[_0x3808('0x25')][_0x3808('0x70')]=util['format'](_0x3808('0x71'),_0x13a69c[_0x3808('0x5c')][_0x3808('0x34')]);_0x66d4ea[_0x3808('0x25')][_0x3808('0x72')]=_0x66d4ea[_0x3808('0x72')];_0x66d4ea[_0x3808('0x25')]['motionChannel']=_0x66d4ea[_0x3808('0x72')];_0x66d4ea[_0x3808('0x25')][_0x3808('0x73')]=_0x3808('0x74');return respondWithRpcPromise(_0x3808('0x75'),_0x3808('0x75'),{'event':'acceptmessage','message':_0x66d4ea['message']},client9002)[_0x3808('0x1d')](function(){return _0x66d4ea;});}return _0x66d4ea;}return null;})[_0x3808('0x1d')](respondWithResult(_0x1d7df8,null))[_0x3808('0x27')](handleError(_0x1d7df8,null));};var interaction_log=require(_0x3808('0x11'))(_0x3808('0x56'));exports[_0x3808('0x76')]=function(_0x278433,_0x2986af,_0x2c9fd8){var _0x408593={'agent':{},'channel':_0x3808('0x57')};if(_0x278433[_0x3808('0x52')]['id']){delete _0x278433[_0x3808('0x52')]['id'];}_0x278433['body'][_0x3808('0x5b')]=_0x278433[_0x3808('0x52')]['UserId']||_0x278433['user']['id'];_0x408593[_0x3808('0x5d')]['id']=_0x278433[_0x3808('0x52')][_0x3808('0x5b')];return db[_0x3808('0x37')][_0x3808('0x51')]({'where':{'id':_0x278433[_0x3808('0x53')]['id'],'UserId':null}})[_0x3808('0x1d')](handleEntityNotFound(_0x2986af,null))[_0x3808('0x1d')](function(_0x8ceb02){if(_0x8ceb02){_0x408593[_0x3808('0x25')]=_0x8ceb02['get']({'plain':!![]});return db[_0x3808('0x5e')][_0x3808('0x51')]({'where':{'id':_0x8ceb02[_0x3808('0x5f')]}});}return null;})[_0x3808('0x1d')](handleEntityNotFound(_0x2986af,null))[_0x3808('0x1d')](function(_0x4e0dca){if(_0x4e0dca){_0x408593['interaction']=_0x4e0dca[_0x3808('0x77')]({'plain':!![]});interaction_log[_0x3808('0x62')](_0x3808('0x78'),_0x278433['user']['id'],_0x278433['user'][_0x3808('0x34')],_0x278433[_0x3808('0x5c')][_0x3808('0x63')],_0x408593['interaction']['id'],_0x278433['body']?JSON[_0x3808('0x22')](_0x278433[_0x3808('0x52')]):_0x3808('0x64'));return respondWithRpcPromise('RejectMessage',_0x3808('0x79'),_0x408593);}return null;})[_0x3808('0x1d')](function(_0x153a13){var _0x570d3a=_0x3808('0x7a')+_0x153a13['message'][_0x3808('0x7b')];return db['sequelize'][_0x3808('0x3d')](_0x570d3a,{'type':db[_0x3808('0x68')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3808('0x1d')](function(_0x311f57){return _0x311f57;});})[_0x3808('0x1d')](function(_0x39ad58){if(_0x39ad58){_0x408593[_0x3808('0x25')][_0x3808('0x6a')]=_0x39ad58[0x0];if(!_0x278433[_0x3808('0x52')][_0x3808('0x5b')])return;return db[_0x3808('0x6b')][_0x3808('0x51')]({'where':{'id':_0x278433[_0x3808('0x52')][_0x3808('0x5b')],'role':_0x3808('0x5d')},'attributes':['id',_0x3808('0x34'),_0x3808('0x6c'),_0x3808('0x6d'),_0x3808('0x6e')],'raw':!![]});}return null;})['then'](function(_0x53739b){if(!_0x53739b)return null;_0x408593[_0x3808('0x25')][_0x3808('0x5d')]=_0x53739b;return _0x408593;})[_0x3808('0x1d')](function(_0x1ce94a){if(_0x1ce94a){_0x1ce94a['message'][_0x3808('0x70')]=util[_0x3808('0x5a')](_0x3808('0x71'),_0x278433['user'][_0x3808('0x34')]);_0x1ce94a['message']['channel']=_0x408593[_0x3808('0x72')];_0x1ce94a[_0x3808('0x25')][_0x3808('0x7c')]=_0x408593[_0x3808('0x72')];_0x1ce94a['message']['event']=_0x3808('0x76');respondWithRpcPromise('EventManager',_0x3808('0x75'),{'event':'rejectmessage','message':_0x1ce94a[_0x3808('0x25')]},client9002);return _0x408593;}return null;})[_0x3808('0x1d')](respondWithResult(_0x2986af,null))[_0x3808('0x27')](handleError(_0x2986af,null));};exports['create']=function(_0x27b948,_0x25df9c){var _0x13ff07;return db[_0x3808('0x37')]['create'](_0x27b948[_0x3808('0x52')],{})[_0x3808('0x1d')](function(_0x1cc43d){_0x13ff07=_0x1cc43d;return db[_0x3808('0x7d')]['findOne']({'where':{'id':_0x13ff07[_0x3808('0x7b')]}});})[_0x3808('0x1d')](function(_0x1930c3){if(_[_0x3808('0x7e')](_0x1930c3)){return;}else{_0x13ff07[_0x3808('0x57')]=_0x1930c3[_0x3808('0x57')];return db[_0x3808('0x7f')]['findOne']({'where':{'id':_0x13ff07[_0x3808('0x80')]}});}})[_0x3808('0x1d')](function(_0x20cc5d){return respondWithRpcPromise(_0x3808('0x81'),_0x3808('0x81'),{'FaxAccountId':_[_0x3808('0x7e')](_0x27b948[_0x3808('0x52')])?undefined:_0x27b948[_0x3808('0x52')][_0x3808('0x82')],'path':_['isNil'](_0x20cc5d)?undefined:util['format'](_0x3808('0x83'),_0x20cc5d['basename']),'fax':_['isNil'](_0x13ff07['fax'])?undefined:_0x13ff07[_0x3808('0x57')],'AttachmentId':_0x13ff07[_0x3808('0x80')]},client9002);})[_0x3808('0x1d')](respondWithResult(_0x25df9c,0xc9))[_0x3808('0x27')](handleError(_0x25df9c,null));};exports[_0x3808('0x84')]=function(_0x3eb6fb,_0xfb2f63){var _0x5ccaaf=path[_0x3808('0x85')](config[_0x3808('0x86')],_0x3808('0x87'),'files',_0x3808('0x88'));return db['FaxMessage'][_0x3808('0x51')]({'where':{'id':_0x3eb6fb[_0x3808('0x53')]['id']},'include':[{'model':db[_0x3808('0x7f')],'as':_0x3808('0x7f')}]})[_0x3808('0x1d')](handleEntityNotFound(_0xfb2f63,null))[_0x3808('0x1d')](function(_0x3bab31){if(_0x3bab31){return _0xfb2f63[_0x3808('0x84')](path[_0x3808('0x85')](_0x5ccaaf,_0x3bab31[_0x3808('0x7f')][_0x3808('0x89')]));}})['catch'](handleError(_0xfb2f63,null));}; \ No newline at end of file +var _0x7248=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','merge','where','VIRTUAL','options','include','findAll','show','params','keys','find','body','describe','fax-interactions','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','format','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','RejectMessage','rejectMessage','User','interface','rejectmessage','create','Attachment','findOne','AttachmentId','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','attachments','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3f2302,_0x3c3363){var _0x55fed4=function(_0x14d32e){while(--_0x14d32e){_0x3f2302['push'](_0x3f2302['shift']());}};_0x55fed4(++_0x3c3363);}(_0x7248,0x78));var _0x8724=function(_0x43f8cc,_0x592b95){_0x43f8cc=_0x43f8cc-0x0;var _0x1c8808=_0x7248[_0x43f8cc];return _0x1c8808;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8724('0x0'));var zipdir=require(_0x8724('0x1'));var jsonpatch=require(_0x8724('0x2'));var rp=require(_0x8724('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8724('0x4'));var util=require(_0x8724('0x5'));var path=require(_0x8724('0x6'));var sox=require(_0x8724('0x7'));var csv=require(_0x8724('0x8'));var ejs=require(_0x8724('0x9'));var fs=require('fs');var fs_extra=require(_0x8724('0xa'));var _=require(_0x8724('0xb'));var squel=require(_0x8724('0xc'));var crypto=require(_0x8724('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8724('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8724('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8724('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8724('0x11'));var logger=require(_0x8724('0x12'))('api');var utils=require(_0x8724('0x13'));var config=require(_0x8724('0x14'));var licenseUtil=require(_0x8724('0x15'));var db=require(_0x8724('0x16'))['db'];config['redis']=_['defaults'](config[_0x8724('0x17')],{'host':_0x8724('0x18'),'port':0x18eb});var socket=require(_0x8724('0x19'))(new Redis(config[_0x8724('0x17')]));require(_0x8724('0x1a'))[_0x8724('0x1b')](socket);var jayson=require(_0x8724('0x1c'));var client=jayson[_0x8724('0x1d')][_0x8724('0x1e')]({'port':0x232c});var client9002=jayson[_0x8724('0x1d')][_0x8724('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x390b83,_0x575209,_0x3d57b9,_0x3ab531){return new BPromise(function(_0x50d993,_0xea63ab){var _0x11d312=_0x3ab531||client;return _0x11d312[_0x8724('0x1f')](_0x390b83,_0x3d57b9)[_0x8724('0x20')](function(_0x42197a){logger[_0x8724('0x21')](_0x8724('0x22'),_0x575209,_0x8724('0x23'));logger[_0x8724('0x24')](_0x8724('0x25'),_0x575209,_0x8724('0x23'),JSON[_0x8724('0x26')](_0x42197a));if(_0x42197a['error']){if(_0x42197a[_0x8724('0x27')][_0x8724('0x28')]===0x1f4){logger[_0x8724('0x27')]('FaxMessage,\x20%s,\x20%s',_0x575209,_0x42197a['error']['message']);return _0xea63ab(_0x42197a[_0x8724('0x27')][_0x8724('0x29')]);}logger[_0x8724('0x27')](_0x8724('0x22'),_0x575209,_0x42197a[_0x8724('0x27')][_0x8724('0x29')]);return _0x50d993(_0x42197a[_0x8724('0x27')][_0x8724('0x29')]);}else{logger[_0x8724('0x21')](_0x8724('0x22'),_0x575209,'request\x20sent');_0x50d993(_0x42197a['result'][_0x8724('0x29')]);}})[_0x8724('0x2a')](function(_0xc7b46a){logger['error'](_0x8724('0x22'),_0x575209,_0xc7b46a);_0xea63ab(_0xc7b46a);});});}function respondWithStatusCode(_0x56d137,_0x3bb050){_0x3bb050=_0x3bb050||0xcc;return function(_0x3c5a96){if(_0x3c5a96){return _0x56d137[_0x8724('0x2b')](_0x3bb050);}return _0x56d137[_0x8724('0x2c')](_0x3bb050)[_0x8724('0x2d')]();};}function respondWithResult(_0x19beaf,_0x578773){_0x578773=_0x578773||0xc8;return function(_0xb38bb){if(_0xb38bb){return _0x19beaf[_0x8724('0x2c')](_0x578773)['json'](_0xb38bb);}};}function respondWithFilteredResult(_0x2d5cfb,_0x44fab8){return function(_0x1da31b){if(_0x1da31b){var _0x25afee=typeof _0x44fab8[_0x8724('0x2e')]===_0x8724('0x2f')&&typeof _0x44fab8[_0x8724('0x30')]===_0x8724('0x2f');var _0x52dbfb=_0x1da31b[_0x8724('0x31')];var _0x5bbd98=_0x25afee?0x0:_0x44fab8[_0x8724('0x2e')];var _0x5979fd=_0x25afee?_0x1da31b[_0x8724('0x31')]:_0x44fab8[_0x8724('0x2e')]+_0x44fab8[_0x8724('0x30')];var _0x3c53ea;if(_0x5979fd>=_0x52dbfb){_0x5979fd=_0x52dbfb;_0x3c53ea=0xc8;}else{_0x3c53ea=0xce;}_0x2d5cfb[_0x8724('0x2c')](_0x3c53ea);return _0x2d5cfb['set']('Content-Range',_0x5bbd98+'-'+_0x5979fd+'/'+_0x52dbfb)[_0x8724('0x32')](_0x1da31b);}return null;};}function patchUpdates(_0x540708){return function(_0x3b1ca8){try{jsonpatch[_0x8724('0x33')](_0x3b1ca8,_0x540708,!![]);}catch(_0x2ccd07){return BPromise[_0x8724('0x34')](_0x2ccd07);}return _0x3b1ca8[_0x8724('0x35')]();};}function saveUpdates(_0x415269,_0x1060a3){return function(_0x2d8a03){if(_0x2d8a03){return _0x2d8a03[_0x8724('0x36')](_0x415269)[_0x8724('0x20')](function(_0x3cf105){return _0x3cf105;});}return null;};}function removeEntity(_0x424c11,_0x1ecb28){return function(_0x29e0af){if(_0x29e0af){return _0x29e0af[_0x8724('0x37')]()[_0x8724('0x20')](function(){_0x424c11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x333993,_0x501946){return function(_0x4712e0){if(!_0x4712e0){_0x333993[_0x8724('0x2b')](0x194);}return _0x4712e0;};}function handleError(_0x5e6538,_0x5cd340){_0x5cd340=_0x5cd340||0x1f4;return function(_0x408720){logger[_0x8724('0x27')](_0x408720[_0x8724('0x38')]);if(_0x408720[_0x8724('0x39')]){delete _0x408720['name'];}_0x5e6538[_0x8724('0x2c')](_0x5cd340)[_0x8724('0x3a')](_0x408720);};}exports[_0x8724('0x3b')]=function(_0x3f2061,_0x1b1a77){var _0x29df00={},_0x2939cf={},_0x5251c9={'count':0x0,'rows':[]};var _0x4ee56=_[_0x8724('0x3c')](db[_0x8724('0x3d')][_0x8724('0x3e')],function(_0x5b26a9){return{'name':_0x5b26a9[_0x8724('0x3f')],'type':_0x5b26a9[_0x8724('0x40')][_0x8724('0x41')]};});_0x2939cf['model']=_['map'](_0x4ee56,_0x8724('0x39'));_0x2939cf[_0x8724('0x42')]=_['keys'](_0x3f2061[_0x8724('0x42')]);_0x2939cf[_0x8724('0x43')]=_[_0x8724('0x44')](_0x2939cf[_0x8724('0x45')],_0x2939cf[_0x8724('0x42')]);_0x29df00[_0x8724('0x46')]=_[_0x8724('0x44')](_0x2939cf[_0x8724('0x45')],qs[_0x8724('0x47')](_0x3f2061[_0x8724('0x42')][_0x8724('0x47')]));_0x29df00[_0x8724('0x46')]=_0x29df00[_0x8724('0x46')][_0x8724('0x48')]?_0x29df00[_0x8724('0x46')]:_0x2939cf[_0x8724('0x45')];if(!_0x3f2061[_0x8724('0x42')]['hasOwnProperty'](_0x8724('0x49'))){_0x29df00[_0x8724('0x30')]=qs['limit'](_0x3f2061[_0x8724('0x42')][_0x8724('0x30')]);_0x29df00[_0x8724('0x2e')]=qs['offset'](_0x3f2061[_0x8724('0x42')][_0x8724('0x2e')]);}_0x29df00[_0x8724('0x4a')]=qs['sort'](_0x3f2061[_0x8724('0x42')][_0x8724('0x4b')]);_0x29df00['where']=qs[_0x8724('0x43')](_['pick'](_0x3f2061['query'],_0x2939cf[_0x8724('0x43')]),_0x4ee56);if(_0x3f2061[_0x8724('0x42')]['filter']){_0x29df00['where']=_[_0x8724('0x4c')](_0x29df00[_0x8724('0x4d')],{'$or':_[_0x8724('0x3c')](_0x4ee56,function(_0x46a01d){if(_0x46a01d['type']!==_0x8724('0x4e')){var _0x288f36={};_0x288f36[_0x46a01d[_0x8724('0x39')]]={'$like':'%'+_0x3f2061[_0x8724('0x42')]['filter']+'%'};return _0x288f36;}})});}_0x29df00=_[_0x8724('0x4c')]({},_0x29df00,_0x3f2061[_0x8724('0x4f')]);var _0x4a675f={'where':_0x29df00[_0x8724('0x4d')]};return db[_0x8724('0x3d')][_0x8724('0x31')](_0x4a675f)[_0x8724('0x20')](function(_0xb172a6){_0x5251c9['count']=_0xb172a6;if(_0x3f2061['query']['includeAll']){_0x29df00[_0x8724('0x50')]=[{'all':!![]}];}return db[_0x8724('0x3d')][_0x8724('0x51')](_0x29df00);})[_0x8724('0x20')](function(_0x5259dd){_0x5251c9['rows']=_0x5259dd;return _0x5251c9;})[_0x8724('0x20')](respondWithFilteredResult(_0x1b1a77,_0x29df00))['catch'](handleError(_0x1b1a77,null));};exports[_0x8724('0x52')]=function(_0x3c74ae,_0x4b374e){var _0x574c4f={'raw':!![],'where':{'id':_0x3c74ae[_0x8724('0x53')]['id']}},_0x10e33c={};_0x10e33c['model']=_[_0x8724('0x54')](db[_0x8724('0x3d')][_0x8724('0x3e')]);_0x10e33c[_0x8724('0x42')]=_[_0x8724('0x54')](_0x3c74ae[_0x8724('0x42')]);_0x10e33c[_0x8724('0x43')]=_['intersection'](_0x10e33c['model'],_0x10e33c[_0x8724('0x42')]);_0x574c4f[_0x8724('0x46')]=_['intersection'](_0x10e33c[_0x8724('0x45')],qs['fields'](_0x3c74ae[_0x8724('0x42')][_0x8724('0x47')]));_0x574c4f['attributes']=_0x574c4f[_0x8724('0x46')][_0x8724('0x48')]?_0x574c4f[_0x8724('0x46')]:_0x10e33c[_0x8724('0x45')];if(_0x3c74ae['query']['includeAll']){_0x574c4f[_0x8724('0x50')]=[{'all':!![]}];}_0x574c4f=_[_0x8724('0x4c')]({},_0x574c4f,_0x3c74ae[_0x8724('0x4f')]);return db[_0x8724('0x3d')][_0x8724('0x55')](_0x574c4f)[_0x8724('0x20')](handleEntityNotFound(_0x4b374e,null))['then'](respondWithResult(_0x4b374e,null))[_0x8724('0x2a')](handleError(_0x4b374e,null));};exports[_0x8724('0x36')]=function(_0x4e73a3,_0x462dd2){if(_0x4e73a3[_0x8724('0x56')]['id']){delete _0x4e73a3[_0x8724('0x56')]['id'];}return db[_0x8724('0x3d')]['find']({'where':{'id':_0x4e73a3[_0x8724('0x53')]['id']}})['then'](handleEntityNotFound(_0x462dd2,null))[_0x8724('0x20')](saveUpdates(_0x4e73a3[_0x8724('0x56')],null))['then'](respondWithResult(_0x462dd2,null))['catch'](handleError(_0x462dd2,null));};exports[_0x8724('0x37')]=function(_0x5140c6,_0x152957){return db['FaxMessage']['find']({'where':{'id':_0x5140c6[_0x8724('0x53')]['id']}})[_0x8724('0x20')](handleEntityNotFound(_0x152957,null))['then'](removeEntity(_0x152957,null))[_0x8724('0x2a')](handleError(_0x152957,null));};exports[_0x8724('0x57')]=function(_0x526363,_0x50a96e){return db[_0x8724('0x3d')]['describe']()[_0x8724('0x20')](respondWithResult(_0x50a96e,null))['catch'](handleError(_0x50a96e,null));};var interaction_log=require('../../config/logger')(_0x8724('0x58'));exports['accept']=function(_0x4c19f4,_0x3cf2d,_0x4c5c13){var _0x178d0e={'agent':{},'channel':_0x8724('0x59')};if(_0x4c19f4[_0x8724('0x56')]['id']){delete _0x4c19f4[_0x8724('0x56')]['id'];}_0x4c19f4[_0x8724('0x56')][_0x8724('0x5a')]=!![];_0x4c19f4[_0x8724('0x56')]['readAt']=moment()['format'](_0x8724('0x5b'));_0x4c19f4['body'][_0x8724('0x5c')]=_0x4c19f4[_0x8724('0x56')][_0x8724('0x5c')]||_0x4c19f4['user']['id'];_0x178d0e['agent']['id']=_0x4c19f4[_0x8724('0x56')][_0x8724('0x5c')];return db[_0x8724('0x3d')][_0x8724('0x55')]({'where':{'id':_0x4c19f4[_0x8724('0x53')]['id'],'UserId':null}})[_0x8724('0x20')](handleEntityNotFound(_0x3cf2d,null))['then'](saveUpdates(_0x4c19f4[_0x8724('0x56')],null))[_0x8724('0x20')](function(_0x4b1a91){if(_0x4b1a91){_0x178d0e[_0x8724('0x29')]=_0x4b1a91[_0x8724('0x5d')]({'plain':!![]});return db[_0x8724('0x5e')][_0x8724('0x55')]({'where':{'id':_0x4b1a91[_0x8724('0x5f')]}});}return null;})[_0x8724('0x20')](handleEntityNotFound(_0x3cf2d,null))[_0x8724('0x20')](function(_0x2838f7){if(_0x2838f7){return _0x2838f7['update']({'UserId':_0x4c19f4[_0x8724('0x56')][_0x8724('0x5c')],'read1stAt':_['isNil'](_0x2838f7['read1stAt'])?moment()[_0x8724('0x60')](_0x8724('0x5b')):undefined});}return null;})[_0x8724('0x20')](function(_0x5859e9){if(_0x5859e9){_0x178d0e['interaction']=_0x5859e9['get']({'plain':!![]});interaction_log[_0x8724('0x21')](_0x8724('0x61'),_0x4c19f4[_0x8724('0x62')]['id'],_0x4c19f4[_0x8724('0x62')][_0x8724('0x39')],_0x4c19f4[_0x8724('0x62')][_0x8724('0x63')],_0x178d0e[_0x8724('0x64')]['id'],_0x4c19f4['body']?JSON['stringify'](_0x4c19f4[_0x8724('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8724('0x65'),_0x178d0e);}return null;})[_0x8724('0x20')](function(_0x1407b4){var _0x48f30b=_0x8724('0x66')+_0x1407b4['message'][_0x8724('0x67')];return db[_0x8724('0x68')][_0x8724('0x42')](_0x48f30b,{'type':db[_0x8724('0x69')][_0x8724('0x6a')][_0x8724('0x6b')],'raw':!![]})[_0x8724('0x20')](function(_0x403336){return _0x403336;});})[_0x8724('0x20')](function(_0x5bc414){if(_0x5bc414){_0x178d0e[_0x8724('0x29')][_0x8724('0x6c')]=_0x5bc414[0x0];if(!_0x4c19f4['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x4c19f4[_0x8724('0x56')][_0x8724('0x5c')],'role':_0x8724('0x6d')},'attributes':['id',_0x8724('0x39'),'fullname',_0x8724('0x6e'),_0x8724('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2ab2d6){if(!_0x2ab2d6)return null;_0x178d0e[_0x8724('0x29')][_0x8724('0x6d')]=_0x2ab2d6;return _0x178d0e;})[_0x8724('0x20')](function(_0x184644){if(_0x184644){if(_0x4c19f4[_0x8724('0x56')][_0x8724('0x70')]){_0x178d0e[_0x8724('0x29')]['interface']=util[_0x8724('0x60')](_0x8724('0x71'),_0x4c19f4['user'][_0x8724('0x39')]);_0x178d0e['message']['channel']=_0x178d0e[_0x8724('0x72')];_0x178d0e[_0x8724('0x29')][_0x8724('0x73')]=_0x178d0e[_0x8724('0x72')];_0x178d0e[_0x8724('0x29')][_0x8724('0x74')]=_0x8724('0x75');return respondWithRpcPromise(_0x8724('0x76'),'EventManager',{'event':_0x8724('0x77'),'message':_0x178d0e['message']},client9002)[_0x8724('0x20')](function(){return _0x178d0e;});}return _0x178d0e;}return null;})[_0x8724('0x20')](respondWithResult(_0x3cf2d,null))[_0x8724('0x2a')](handleError(_0x3cf2d,null));};var interaction_log=require(_0x8724('0x12'))(_0x8724('0x58'));exports['reject']=function(_0x261278,_0x4f3e2d,_0x5b6bd6){var _0x486a52={'agent':{},'channel':'fax'};if(_0x261278[_0x8724('0x56')]['id']){delete _0x261278['body']['id'];}_0x261278[_0x8724('0x56')]['UserId']=_0x261278['body']['UserId']||_0x261278['user']['id'];_0x486a52[_0x8724('0x6d')]['id']=_0x261278[_0x8724('0x56')][_0x8724('0x5c')];return db[_0x8724('0x3d')][_0x8724('0x55')]({'where':{'id':_0x261278['params']['id'],'UserId':null}})[_0x8724('0x20')](handleEntityNotFound(_0x4f3e2d,null))['then'](function(_0x3b647f){if(_0x3b647f){_0x486a52[_0x8724('0x29')]=_0x3b647f[_0x8724('0x5d')]({'plain':!![]});return db[_0x8724('0x5e')][_0x8724('0x55')]({'where':{'id':_0x3b647f[_0x8724('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x4f3e2d,null))['then'](function(_0x35cff8){if(_0x35cff8){_0x486a52['interaction']=_0x35cff8[_0x8724('0x5d')]({'plain':!![]});interaction_log[_0x8724('0x21')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x261278[_0x8724('0x62')]['id'],_0x261278['user'][_0x8724('0x39')],_0x261278[_0x8724('0x62')][_0x8724('0x63')],_0x486a52[_0x8724('0x64')]['id'],_0x261278[_0x8724('0x56')]?JSON['stringify'](_0x261278[_0x8724('0x56')]):'null');return respondWithRpcPromise(_0x8724('0x78'),_0x8724('0x79'),_0x486a52);}return null;})[_0x8724('0x20')](function(_0x37fa7e){var _0x50db09='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x37fa7e[_0x8724('0x29')][_0x8724('0x67')];return db[_0x8724('0x68')][_0x8724('0x42')](_0x50db09,{'type':db[_0x8724('0x69')][_0x8724('0x6a')][_0x8724('0x6b')],'raw':!![]})['then'](function(_0xe9ecc9){return _0xe9ecc9;});})[_0x8724('0x20')](function(_0x543f80){if(_0x543f80){_0x486a52['message'][_0x8724('0x6c')]=_0x543f80[0x0];if(!_0x261278['body'][_0x8724('0x5c')])return;return db[_0x8724('0x7a')][_0x8724('0x55')]({'where':{'id':_0x261278['body'][_0x8724('0x5c')],'role':_0x8724('0x6d')},'attributes':['id',_0x8724('0x39'),'fullname',_0x8724('0x6e'),_0x8724('0x6f')],'raw':!![]});}return null;})[_0x8724('0x20')](function(_0x1668c5){if(!_0x1668c5)return null;_0x486a52[_0x8724('0x29')]['agent']=_0x1668c5;return _0x486a52;})[_0x8724('0x20')](function(_0x5196ee){if(_0x5196ee){_0x5196ee['message'][_0x8724('0x7b')]=util[_0x8724('0x60')](_0x8724('0x71'),_0x261278[_0x8724('0x62')]['name']);_0x5196ee['message'][_0x8724('0x72')]=_0x486a52[_0x8724('0x72')];_0x5196ee[_0x8724('0x29')][_0x8724('0x73')]=_0x486a52[_0x8724('0x72')];_0x5196ee['message'][_0x8724('0x74')]=_0x8724('0x34');respondWithRpcPromise(_0x8724('0x76'),_0x8724('0x76'),{'event':_0x8724('0x7c'),'message':_0x5196ee[_0x8724('0x29')]},client9002);return _0x486a52;}return null;})[_0x8724('0x20')](respondWithResult(_0x4f3e2d,null))[_0x8724('0x2a')](handleError(_0x4f3e2d,null));};exports['create']=function(_0x3cb120,_0x3dcf1f){var _0x8e43ac;return db['FaxMessage'][_0x8724('0x7d')](_0x3cb120[_0x8724('0x56')],{})[_0x8724('0x20')](function(_0x54a2c9){_0x8e43ac=_0x54a2c9;return db['CmContact']['findOne']({'where':{'id':_0x8e43ac[_0x8724('0x67')]}});})[_0x8724('0x20')](function(_0x22df29){if(_['isNil'](_0x22df29)){return;}else{_0x8e43ac[_0x8724('0x59')]=_0x22df29[_0x8724('0x59')];return db[_0x8724('0x7e')][_0x8724('0x7f')]({'where':{'id':_0x8e43ac[_0x8724('0x80')]}});}})[_0x8724('0x20')](function(_0x2c66c2){return respondWithRpcPromise(_0x8724('0x81'),'SendFax',{'FaxAccountId':_[_0x8724('0x82')](_0x3cb120['body'])?undefined:_0x3cb120[_0x8724('0x56')][_0x8724('0x83')],'path':_['isNil'](_0x2c66c2)?undefined:util[_0x8724('0x60')](_0x8724('0x84'),_0x2c66c2[_0x8724('0x85')]),'fax':_[_0x8724('0x82')](_0x8e43ac['fax'])?undefined:_0x8e43ac['fax'],'AttachmentId':_0x8e43ac[_0x8724('0x80')]},client9002);})[_0x8724('0x20')](respondWithResult(_0x3dcf1f,0xc9))[_0x8724('0x2a')](handleError(_0x3dcf1f,null));};exports[_0x8724('0x86')]=function(_0x2f78d8,_0x2e7288){var _0x473295=path[_0x8724('0x87')](config['root'],_0x8724('0x88'),'files',_0x8724('0x89'));return db['FaxMessage'][_0x8724('0x55')]({'where':{'id':_0x2f78d8[_0x8724('0x53')]['id']},'include':[{'model':db[_0x8724('0x7e')],'as':_0x8724('0x7e')}]})[_0x8724('0x20')](handleEntityNotFound(_0x2e7288,null))[_0x8724('0x20')](function(_0x746efd){if(_0x746efd){return _0x2e7288[_0x8724('0x86')](path[_0x8724('0x87')](_0x473295,_0x746efd['Attachment'][_0x8724('0x85')]));}})[_0x8724('0x2a')](handleError(_0x2e7288,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index bda5a67..b088a25 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 _0x3f8a=['../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x125d11,_0xd33527){var _0xd77ef2=function(_0x238141){while(--_0x238141){_0x125d11['push'](_0x125d11['shift']());}};_0xd77ef2(++_0xd33527);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x2c60de,_0x565bf9){_0x2c60de=_0x2c60de-0x0;var _0x277399=_0x3f8a[_0x2c60de];return _0x277399;};'use strict';var EventEmitter=require(_0xa3f8('0x0'));var FaxMessage=require(_0xa3f8('0x1'))['db'][_0xa3f8('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xa3f8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa3f8('0x4'),'afterDestroy':_0xa3f8('0x5')};function emitEvent(_0x928738){return function(_0x15b6aa,_0x2553fd,_0x2847b4){FaxMessageEvents[_0xa3f8('0x6')](_0x928738+':'+_0x15b6aa['id'],_0x15b6aa);FaxMessageEvents[_0xa3f8('0x6')](_0x928738,_0x15b6aa);_0x2847b4(null);};}for(var e in events){if(events[_0xa3f8('0x7')](e)){var event=events[e];FaxMessage[_0xa3f8('0x8')](e,emitEvent(event));}}module[_0xa3f8('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x6657=['FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x581ae2,_0xfc6a3f){var _0x322552=function(_0x59b98e){while(--_0x59b98e){_0x581ae2['push'](_0x581ae2['shift']());}};_0x322552(++_0xfc6a3f);}(_0x6657,0x17f));var _0x7665=function(_0x3d1969,_0x57745e){_0x3d1969=_0x3d1969-0x0;var _0x5da1f2=_0x6657[_0x3d1969];return _0x5da1f2;};'use strict';var EventEmitter=require(_0x7665('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7665('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7665('0x2')](0x0);var events={'afterCreate':_0x7665('0x3'),'afterUpdate':_0x7665('0x4'),'afterDestroy':'remove'};function emitEvent(_0x386ca9){return function(_0x2ed8cb,_0x26acc4,_0x1c33b1){FaxMessageEvents[_0x7665('0x5')](_0x386ca9+':'+_0x2ed8cb['id'],_0x2ed8cb);FaxMessageEvents[_0x7665('0x5')](_0x386ca9,_0x2ed8cb);_0x1c33b1(null);};}for(var e in events){if(events[_0x7665('0x6')](e)){var event=events[e];FaxMessage[_0x7665('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 375b698..1c20258 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 _0x970e=['request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x317bfa,_0x183068){var _0x3ce05d=function(_0x27db0e){while(--_0x27db0e){_0x317bfa['push'](_0x317bfa['shift']());}};_0x3ce05d(++_0x183068);}(_0x970e,0x1f2));var _0xe970=function(_0x2178c3,_0x454b36){_0x2178c3=_0x2178c3-0x0;var _0x41416c=_0x970e[_0x2178c3];return _0x41416c;};'use strict';var _=require(_0xe970('0x0'));var util=require(_0xe970('0x1'));var logger=require(_0xe970('0x2'))(_0xe970('0x3'));var moment=require(_0xe970('0x4'));var BPromise=require(_0xe970('0x5'));var rp=require(_0xe970('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe970('0x7'));var config=require(_0xe970('0x8'));var attributes=require(_0xe970('0x9'));module[_0xe970('0xa')]=function(_0x21f195,_0x26d746){return _0x21f195['define'](_0xe970('0xb'),attributes,{'tableName':_0xe970('0xc'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xe970('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5df09d,_0x88659b,_0x241484){var _0x3cd97d=_0x21f195['models'];var _0x58045c=_0x5df09d[_0xe970('0xe')]({'plain':!![]});if(_0x58045c[_0xe970('0xf')][_0xe970('0x10')]()==='in'||_0x58045c[_0xe970('0xf')][_0xe970('0x10')]()===_0xe970('0x11')&&!_0x58045c[_0xe970('0x12')]&&!_[_0xe970('0x13')](_0x58045c[_0xe970('0x14')])){_0x3cd97d[_0xe970('0x15')][_0xe970('0x16')]({'where':{'id':_0x58045c['FaxInteractionId']}})['then'](function(_0x1b4e3e){if(_0x1b4e3e){_0x1b4e3e[_0xe970('0x17')]({'lastMsgAt':_0x58045c[_0xe970('0x18')],'lastMsgDirection':_0x58045c['direction'][_0xe970('0x10')]()});}})[_0xe970('0x19')](function(_0xe35290){console[_0xe970('0x1a')](_0xe35290);});}_0x241484();}},'charset':'utf8mb4','collate':_0xe970('0x1b')});}; \ No newline at end of file +var _0xc05d=['toLowerCase','secret','isNil','UserId','FaxInteraction','then','createdAt','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xc05d,0x8b));var _0xdc05=function(_0xffa8a,_0x27e454){_0xffa8a=_0xffa8a-0x0;var _0x3c7626=_0xc05d[_0xffa8a];return _0x3c7626;};'use strict';var _=require(_0xdc05('0x0'));var util=require('util');var logger=require(_0xdc05('0x1'))(_0xdc05('0x2'));var moment=require(_0xdc05('0x3'));var BPromise=require(_0xdc05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc05('0x5'));var rimraf=require(_0xdc05('0x6'));var config=require(_0xdc05('0x7'));var attributes=require(_0xdc05('0x8'));module['exports']=function(_0x3508e3,_0x41607e){return _0x3508e3[_0xdc05('0x9')](_0xdc05('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xdc05('0xb'),'fields':[_0xdc05('0xc')],'type':_0xdc05('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9b1acd,_0x1503d2,_0xb321a7){var _0x13d5b2=_0x3508e3[_0xdc05('0xe')];var _0x47fb00=_0x9b1acd[_0xdc05('0xf')]({'plain':!![]});if(_0x47fb00[_0xdc05('0x10')]['toLowerCase']()==='in'||_0x47fb00[_0xdc05('0x10')][_0xdc05('0x11')]()==='out'&&!_0x47fb00[_0xdc05('0x12')]&&!_[_0xdc05('0x13')](_0x47fb00[_0xdc05('0x14')])){_0x13d5b2[_0xdc05('0x15')]['findOne']({'where':{'id':_0x47fb00['FaxInteractionId']}})[_0xdc05('0x16')](function(_0x5beb63){if(_0x5beb63){_0x5beb63['update']({'lastMsgAt':_0x47fb00[_0xdc05('0x17')],'lastMsgDirection':_0x47fb00[_0xdc05('0x10')][_0xdc05('0x11')]()});}})['catch'](function(_0x112a96){console[_0xdc05('0x18')](_0x112a96);});}_0xb321a7();}},'charset':_0xdc05('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index dce84d5..5c25b78 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 _0x9c44=['code','message','info','catch','FaxMessage','create','body','options','CreateFaxMessage','stringify','UpdateFaxMessage','update','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});config[_0x49c4('0x9')]=_[_0x49c4('0xa')](config[_0x49c4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0xb'))(new Redis(config[_0x49c4('0x9')]));require(_0x49c4('0xc'))[_0x49c4('0xd')](socket);function respondWithRpcPromise(_0x4c7d3a,_0x5ab4a3,_0x451ea6){return new BPromise(function(_0x313e73,_0x58cad7){return client[_0x49c4('0xe')](_0x4c7d3a,_0x451ea6)[_0x49c4('0xf')](function(_0x4adb3c){logger['info'](_0x49c4('0x10'),_0x5ab4a3,_0x49c4('0x11'));logger['debug'](_0x49c4('0x12'),_0x5ab4a3,_0x49c4('0x11'),JSON['stringify'](_0x4adb3c));if(_0x4adb3c[_0x49c4('0x13')]){if(_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x14')]===0x1f4){logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x58cad7(_0x4adb3c[_0x49c4('0x13')]['message']);}logger[_0x49c4('0x13')](_0x49c4('0x10'),_0x5ab4a3,_0x4adb3c[_0x49c4('0x13')][_0x49c4('0x15')]);return _0x313e73(_0x4adb3c[_0x49c4('0x13')]['message']);}else{logger[_0x49c4('0x16')](_0x49c4('0x10'),_0x5ab4a3,'request\x20sent');_0x313e73(_0x4adb3c['result'][_0x49c4('0x15')]);}})[_0x49c4('0x17')](function(_0x3addb2){logger['error'](_0x49c4('0x10'),_0x5ab4a3,_0x3addb2);_0x58cad7(_0x3addb2);});});}exports['CreateFaxMessage']=function(_0x2cbd50){var _0x1806c2=this;return new Promise(function(_0xe31fcc,_0x291526){return db[_0x49c4('0x18')][_0x49c4('0x19')](_0x2cbd50[_0x49c4('0x1a')],{'raw':_0x2cbd50[_0x49c4('0x1b')]?_0x2cbd50[_0x49c4('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x57f502){logger[_0x49c4('0x16')]('CreateFaxMessage',_0x2cbd50);logger['debug'](_0x49c4('0x1c'),_0x2cbd50,JSON[_0x49c4('0x1d')](_0x57f502));_0xe31fcc(_0x57f502);})[_0x49c4('0x17')](function(_0xd335e4){logger['error']('CreateFaxMessage',_0xd335e4[_0x49c4('0x15')],_0x2cbd50);_0x291526(_0x1806c2[_0x49c4('0x13')](0x1f4,_0xd335e4['message']));});});};exports[_0x49c4('0x1e')]=function(_0x43e014){var _0x210159=this;return new Promise(function(_0xa7a826,_0x531d92){return db['FaxMessage'][_0x49c4('0x1f')](_0x43e014['body'],{'raw':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43e014[_0x49c4('0x1b')]?_0x43e014['options'][_0x49c4('0x21')]||null:null,'attributes':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x22')]||null:null,'limit':_0x43e014[_0x49c4('0x1b')]?_0x43e014[_0x49c4('0x1b')][_0x49c4('0x23')]||null:null})[_0x49c4('0xf')](function(_0x17b50f){logger[_0x49c4('0x16')](_0x49c4('0x1e'),_0x43e014);logger['debug']('UpdateFaxMessage',_0x43e014,JSON['stringify'](_0x17b50f));_0xa7a826(_0x17b50f);})[_0x49c4('0x17')](function(_0x7ee704){logger[_0x49c4('0x13')](_0x49c4('0x1e'),_0x7ee704[_0x49c4('0x15')],_0x43e014);_0x531d92(_0x210159['error'](0x1f4,_0x7ee704[_0x49c4('0x15')]));});});}; \ No newline at end of file +var _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x4a5cee,_0x26fd45){var _0x14fb71=function(_0x90215){while(--_0x90215){_0x4a5cee['push'](_0x4a5cee['shift']());}};_0x14fb71(++_0x26fd45);}(_0xac9d,0x14d));var _0xdac9=function(_0x19c5f2,_0x44ed13){_0x19c5f2=_0x19c5f2-0x0;var _0xb94caf=_0xac9d[_0x19c5f2];return _0xb94caf;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index a9b12a8..b06f1d2 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 _0x18bd=['removeListener','length','faxMessage:','./faxMessage.events','save','remove','emit'];(function(_0x52b52b,_0x3cf1d1){var _0x4c5141=function(_0x3f2f12){while(--_0x3f2f12){_0x52b52b['push'](_0x52b52b['shift']());}};_0x4c5141(++_0x3cf1d1);}(_0x18bd,0xce));var _0xd18b=function(_0xffa255,_0x363b68){_0xffa255=_0xffa255-0x0;var _0x4536ae=_0x18bd[_0xffa255];return _0x4536ae;};'use strict';var FaxMessageEvents=require(_0xd18b('0x0'));var events=[_0xd18b('0x1'),_0xd18b('0x2'),'update'];function createListener(_0x39766b,_0x3abf7c){return function(_0xf00f42){_0x3abf7c[_0xd18b('0x3')](_0x39766b,_0xf00f42);};}function removeListener(_0x2081ef,_0x100130){return function(){FaxMessageEvents[_0xd18b('0x4')](_0x2081ef,_0x100130);};}exports['register']=function(_0x598250){for(var _0x2268e2=0x0,_0x1de1c5=events[_0xd18b('0x5')];_0x2268e2<_0x1de1c5;_0x2268e2++){var _0x2d3de5=events[_0x2268e2];var _0x437f29=createListener(_0xd18b('0x6')+_0x2d3de5,_0x598250);FaxMessageEvents['on'](_0x2d3de5,_0x437f29);}}; \ No newline at end of file +var _0xc782=['remove','update','emit','removeListener','register','length','save'];(function(_0x954c59,_0x4ccf4c){var _0x358bb2=function(_0x4ef8f9){while(--_0x4ef8f9){_0x954c59['push'](_0x954c59['shift']());}};_0x358bb2(++_0x4ccf4c);}(_0xc782,0x12c));var _0x2c78=function(_0x5499ab,_0x4c1128){_0x5499ab=_0x5499ab-0x0;var _0x344478=_0xc782[_0x5499ab];return _0x344478;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x2c78('0x0'),_0x2c78('0x1'),_0x2c78('0x2')];function createListener(_0x12d9a9,_0x3d0fb1){return function(_0x5b45b5){_0x3d0fb1[_0x2c78('0x3')](_0x12d9a9,_0x5b45b5);};}function removeListener(_0x3b72f6,_0x324d2e){return function(){FaxMessageEvents[_0x2c78('0x4')](_0x3b72f6,_0x324d2e);};}exports[_0x2c78('0x5')]=function(_0x2a79f5){for(var _0x3f2f32=0x0,_0xb072c2=events[_0x2c78('0x6')];_0x3f2f32<_0xb072c2;_0x3f2f32++){var _0x4e8048=events[_0x3f2f32];var _0x50dd40=createListener('faxMessage:'+_0x4e8048,_0x2a79f5);FaxMessageEvents['on'](_0x4e8048,_0x50dd40);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e3e7590..965d0a6 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 _0x5b02=['put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','show','download','post','tracked','fax','faxmessage:create','create'];(function(_0x26e3e2,_0x1e5dd7){var _0x502226=function(_0x4e0044){while(--_0x4e0044){_0x26e3e2['push'](_0x26e3e2['shift']());}};_0x502226(++_0x1e5dd7);}(_0x5b02,0xe9));var _0x25b0=function(_0x5c9ac9,_0x50cd17){_0x5c9ac9=_0x5c9ac9-0x0;var _0x2770b4=_0x5b02[_0x5c9ac9];return _0x2770b4;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x25b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var controller=require(_0x25b0('0x7'));router[_0x25b0('0x8')]('/',auth[_0x25b0('0x9')](),controller['index']);router[_0x25b0('0x8')](_0x25b0('0xa'),auth['isAuthenticated'](),controller[_0x25b0('0xb')]);router['get']('/:id',auth[_0x25b0('0x9')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x8')]('/:id/download',auth[_0x25b0('0x9')](),controller[_0x25b0('0xd')]);router[_0x25b0('0xe')]('/',auth[_0x25b0('0x9')](),interaction[_0x25b0('0xf')](_0x25b0('0x10'),_0x25b0('0x11')),controller[_0x25b0('0x12')]);router[_0x25b0('0x13')](_0x25b0('0x14'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x15')]);router[_0x25b0('0x13')](_0x25b0('0x16'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x17')]);router[_0x25b0('0x13')](_0x25b0('0x18'),auth[_0x25b0('0x9')](),controller[_0x25b0('0x19')]);router[_0x25b0('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x25b0('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x2547=['/:id/download','download','post','tracked','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x2547,0x1cd));var _0x7254=function(_0x276467,_0x237a3b){_0x276467=_0x276467-0x0;var _0x4c7f18=_0x2547[_0x276467];return _0x4c7f18;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),interaction[_0x7254('0x12')]('fax',_0x7254('0x13')),controller['create']);router[_0x7254('0x14')]('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0x15')]);router[_0x7254('0x14')](_0x7254('0x16'),auth[_0x7254('0xa')](),controller[_0x7254('0x17')]);router[_0x7254('0x14')](_0x7254('0x18'),auth[_0x7254('0xa')](),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),controller['destroy']);module[_0x7254('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 7c10ed3..e70f602 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 _0x85e6=['STRING','ENUM','rrmemory','beepall','INTEGER','sequelize','exports','name'];(function(_0x20e8ee,_0x596118){var _0x2243d8=function(_0x20428d){while(--_0x20428d){_0x20e8ee['push'](_0x20e8ee['shift']());}};_0x2243d8(++_0x596118);}(_0x85e6,0x1a5));var _0x685e=function(_0x458d2d,_0x435f78){_0x458d2d=_0x458d2d-0x0;var _0x56b4fe=_0x85e6[_0x458d2d];return _0x56b4fe;};'use strict';var Sequelize=require(_0x685e('0x0'));module[_0x685e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x685e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x685e('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x685e('0x4')](_0x685e('0x5'),_0x685e('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x685e('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7874=['beepall','roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x3a730e,_0x59a269){var _0x2d8bad=function(_0x411fca){while(--_0x411fca){_0x3a730e['push'](_0x3a730e['shift']());}};_0x2d8bad(++_0x59a269);}(_0x7874,0x152));var _0x4787=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x7874[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4787('0x0')],'unique':_0x4787('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4787('0x0')]},'timeout':{'type':Sequelize[_0x4787('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4787('0x3'),_0x4787('0x4'),_0x4787('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4787('0x2')],'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 56fcc53..c03a695 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 _0xbf85=['get','role','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','Team','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','every','compact','value','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','send','index','map','FaxQueue','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body'];(function(_0x54b01a,_0x4fab10){var _0x62e975=function(_0x4f9b1a){while(--_0x4f9b1a){_0x54b01a['push'](_0x54b01a['shift']());}};_0x62e975(++_0x4fab10);}(_0xbf85,0x14f));var _0x5bf8=function(_0x1d209c,_0x633e4a){_0x1d209c=_0x1d209c-0x0;var _0x33c332=_0xbf85[_0x1d209c];return _0x33c332;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5bf8('0x0'));var zipdir=require(_0x5bf8('0x1'));var jsonpatch=require(_0x5bf8('0x2'));var rp=require('request-promise');var moment=require(_0x5bf8('0x3'));var BPromise=require(_0x5bf8('0x4'));var Mustache=require(_0x5bf8('0x5'));var util=require(_0x5bf8('0x6'));var path=require(_0x5bf8('0x7'));var sox=require('sox');var csv=require(_0x5bf8('0x8'));var ejs=require(_0x5bf8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5bf8('0xa'));var crypto=require(_0x5bf8('0xb'));var jsforce=require(_0x5bf8('0xc'));var deskjs=require(_0x5bf8('0xd'));var toCsv=require(_0x5bf8('0x8'));var querystring=require('querystring');var Papa=require(_0x5bf8('0xe'));var Redis=require(_0x5bf8('0xf'));var authService=require(_0x5bf8('0x10'));var qs=require(_0x5bf8('0x11'));var as=require(_0x5bf8('0x12'));var hardwareService=require(_0x5bf8('0x13'));var logger=require(_0x5bf8('0x14'))(_0x5bf8('0x15'));var utils=require(_0x5bf8('0x16'));var config=require(_0x5bf8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bf8('0x18'))['db'];config[_0x5bf8('0x19')]=_[_0x5bf8('0x1a')](config['redis'],{'host':_0x5bf8('0x1b'),'port':0x18eb});var socket=require(_0x5bf8('0x1c'))(new Redis(config[_0x5bf8('0x19')]));require('./faxQueue.socket')[_0x5bf8('0x1d')](socket);function respondWithStatusCode(_0x5e5408,_0x3c9daa){_0x3c9daa=_0x3c9daa||0xcc;return function(_0x2a7d61){if(_0x2a7d61){return _0x5e5408[_0x5bf8('0x1e')](_0x3c9daa);}return _0x5e5408['status'](_0x3c9daa)[_0x5bf8('0x1f')]();};}function respondWithResult(_0x17fab5,_0x5c37aa){_0x5c37aa=_0x5c37aa||0xc8;return function(_0x8c4543){if(_0x8c4543){return _0x17fab5[_0x5bf8('0x20')](_0x5c37aa)['json'](_0x8c4543);}};}function respondWithFilteredResult(_0x17749c,_0x1dae1e){return function(_0x32ab3c){if(_0x32ab3c){var _0x22e206=typeof _0x1dae1e['offset']===_0x5bf8('0x21')&&typeof _0x1dae1e[_0x5bf8('0x22')]==='undefined';var _0x24fd83=_0x32ab3c['count'];var _0x1bcfe4=_0x22e206?0x0:_0x1dae1e[_0x5bf8('0x23')];var _0x7efd4f=_0x22e206?_0x32ab3c[_0x5bf8('0x24')]:_0x1dae1e[_0x5bf8('0x23')]+_0x1dae1e[_0x5bf8('0x22')];var _0x29db84;if(_0x7efd4f>=_0x24fd83){_0x7efd4f=_0x24fd83;_0x29db84=0xc8;}else{_0x29db84=0xce;}_0x17749c[_0x5bf8('0x20')](_0x29db84);return _0x17749c['set'](_0x5bf8('0x25'),_0x1bcfe4+'-'+_0x7efd4f+'/'+_0x24fd83)['json'](_0x32ab3c);}return null;};}function patchUpdates(_0x4cb0b7){return function(_0x2f1cbf){try{jsonpatch[_0x5bf8('0x26')](_0x2f1cbf,_0x4cb0b7,!![]);}catch(_0x56026a){return BPromise[_0x5bf8('0x27')](_0x56026a);}return _0x2f1cbf[_0x5bf8('0x28')]();};}function saveUpdates(_0x583284,_0x1b7207){return function(_0x23511d){if(_0x23511d){return _0x23511d[_0x5bf8('0x29')](_0x583284)[_0x5bf8('0x2a')](function(_0x1a2311){return _0x1a2311;});}return null;};}function removeEntity(_0x3f4809,_0x1a3a58){return function(_0x3d2eed){if(_0x3d2eed){return _0x3d2eed[_0x5bf8('0x2b')]()[_0x5bf8('0x2a')](function(){var _0x3c60f6=_0x3d2eed['get']({'plain':!![]});var _0x313901=_0x5bf8('0x2c');return db[_0x5bf8('0x2d')][_0x5bf8('0x2b')]({'where':{'type':_0x313901,'resourceId':_0x3c60f6['id']}})[_0x5bf8('0x2a')](function(){return _0x3d2eed;});})[_0x5bf8('0x2a')](function(){_0x3f4809[_0x5bf8('0x20')](0xcc)[_0x5bf8('0x1f')]();});}};}function handleEntityNotFound(_0x2aba55,_0x113ca4){return function(_0x16f687){if(!_0x16f687){_0x2aba55[_0x5bf8('0x1e')](0x194);}return _0x16f687;};}function handleError(_0x52eff7,_0x2e754f){_0x2e754f=_0x2e754f||0x1f4;return function(_0x266880){logger['error'](_0x266880['stack']);if(_0x266880['name']){delete _0x266880['name'];}_0x52eff7['status'](_0x2e754f)[_0x5bf8('0x2e')](_0x266880);};}exports[_0x5bf8('0x2f')]=function(_0x29a780,_0x568eba){var _0x559747={},_0x12da05={},_0x1f6344={'count':0x0,'rows':[]};var _0xb47515=_[_0x5bf8('0x30')](db[_0x5bf8('0x31')]['rawAttributes'],function(_0xce3698){return{'name':_0xce3698[_0x5bf8('0x32')],'type':_0xce3698[_0x5bf8('0x33')][_0x5bf8('0x34')]};});_0x12da05[_0x5bf8('0x35')]=_[_0x5bf8('0x30')](_0xb47515,_0x5bf8('0x36'));_0x12da05[_0x5bf8('0x37')]=_[_0x5bf8('0x38')](_0x29a780[_0x5bf8('0x37')]);_0x12da05[_0x5bf8('0x39')]=_['intersection'](_0x12da05[_0x5bf8('0x35')],_0x12da05['query']);_0x559747[_0x5bf8('0x3a')]=_[_0x5bf8('0x3b')](_0x12da05['model'],qs[_0x5bf8('0x3c')](_0x29a780['query'][_0x5bf8('0x3c')]));_0x559747[_0x5bf8('0x3a')]=_0x559747[_0x5bf8('0x3a')][_0x5bf8('0x3d')]?_0x559747['attributes']:_0x12da05[_0x5bf8('0x35')];if(!_0x29a780[_0x5bf8('0x37')][_0x5bf8('0x3e')](_0x5bf8('0x3f'))){_0x559747[_0x5bf8('0x22')]=qs['limit'](_0x29a780[_0x5bf8('0x37')]['limit']);_0x559747['offset']=qs[_0x5bf8('0x23')](_0x29a780[_0x5bf8('0x37')][_0x5bf8('0x23')]);}_0x559747[_0x5bf8('0x40')]=qs[_0x5bf8('0x41')](_0x29a780[_0x5bf8('0x37')][_0x5bf8('0x41')]);_0x559747[_0x5bf8('0x42')]=qs[_0x5bf8('0x39')](_[_0x5bf8('0x43')](_0x29a780[_0x5bf8('0x37')],_0x12da05[_0x5bf8('0x39')]),_0xb47515);if(_0x29a780[_0x5bf8('0x37')][_0x5bf8('0x44')]){_0x559747[_0x5bf8('0x42')]=_['merge'](_0x559747['where'],{'$or':_[_0x5bf8('0x30')](_0xb47515,function(_0x40c12a){if(_0x40c12a['type']!==_0x5bf8('0x45')){var _0x4bab56={};_0x4bab56[_0x40c12a['name']]={'$like':'%'+_0x29a780[_0x5bf8('0x37')][_0x5bf8('0x44')]+'%'};return _0x4bab56;}})});}_0x559747=_[_0x5bf8('0x46')]({},_0x559747,_0x29a780['options']);var _0x4d6974={'where':_0x559747[_0x5bf8('0x42')]};return db[_0x5bf8('0x31')][_0x5bf8('0x24')](_0x4d6974)[_0x5bf8('0x2a')](function(_0x58d512){_0x1f6344[_0x5bf8('0x24')]=_0x58d512;if(_0x29a780['query'][_0x5bf8('0x47')]){_0x559747[_0x5bf8('0x48')]=[{'all':!![]}];}return db[_0x5bf8('0x31')][_0x5bf8('0x49')](_0x559747);})[_0x5bf8('0x2a')](function(_0x136bb7){_0x1f6344[_0x5bf8('0x4a')]=_0x136bb7;return _0x1f6344;})['then'](respondWithFilteredResult(_0x568eba,_0x559747))[_0x5bf8('0x4b')](handleError(_0x568eba,null));};exports[_0x5bf8('0x4c')]=function(_0xdea450,_0x567ef1){var _0x44111b={'raw':!![],'where':{'id':_0xdea450[_0x5bf8('0x4d')]['id']}},_0x12fbd3={};_0x12fbd3[_0x5bf8('0x35')]=_[_0x5bf8('0x38')](db[_0x5bf8('0x31')][_0x5bf8('0x4e')]);_0x12fbd3[_0x5bf8('0x37')]=_[_0x5bf8('0x38')](_0xdea450[_0x5bf8('0x37')]);_0x12fbd3[_0x5bf8('0x39')]=_[_0x5bf8('0x3b')](_0x12fbd3[_0x5bf8('0x35')],_0x12fbd3['query']);_0x44111b[_0x5bf8('0x3a')]=_[_0x5bf8('0x3b')](_0x12fbd3[_0x5bf8('0x35')],qs['fields'](_0xdea450['query'][_0x5bf8('0x3c')]));_0x44111b[_0x5bf8('0x3a')]=_0x44111b[_0x5bf8('0x3a')]['length']?_0x44111b['attributes']:_0x12fbd3[_0x5bf8('0x35')];if(_0xdea450[_0x5bf8('0x37')][_0x5bf8('0x47')]){_0x44111b[_0x5bf8('0x48')]=[{'all':!![]}];}_0x44111b=_['merge']({},_0x44111b,_0xdea450[_0x5bf8('0x4f')]);return db['FaxQueue'][_0x5bf8('0x50')](_0x44111b)[_0x5bf8('0x2a')](handleEntityNotFound(_0x567ef1,null))[_0x5bf8('0x2a')](respondWithResult(_0x567ef1,null))[_0x5bf8('0x4b')](handleError(_0x567ef1,null));};exports['create']=function(_0x5782fc,_0x55af5b){return db['FaxQueue']['create'](_0x5782fc[_0x5bf8('0x51')],{})[_0x5bf8('0x2a')](function(_0x1f0126){var _0x54cb20=_0x5782fc['user'][_0x5bf8('0x52')]({'plain':!![]});if(!_0x54cb20)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54cb20[_0x5bf8('0x53')]===_0x5bf8('0x54')){var _0x51266c=_0x1f0126['get']({'plain':!![]});var _0x435cf5=_0x5bf8('0x2c');return db[_0x5bf8('0x55')][_0x5bf8('0x50')]({'where':{'name':_0x435cf5,'userProfileId':_0x54cb20[_0x5bf8('0x56')]},'raw':!![]})['then'](function(_0x1f4a29){if(_0x1f4a29&&_0x1f4a29['autoAssociation']===0x0){return db['UserProfileResource'][_0x5bf8('0x57')]({'name':_0x51266c[_0x5bf8('0x36')],'resourceId':_0x51266c['id'],'type':_0x1f4a29[_0x5bf8('0x36')],'sectionId':_0x1f4a29['id']},{})[_0x5bf8('0x2a')](function(){return _0x1f0126;});}else{return _0x1f0126;}})[_0x5bf8('0x4b')](function(_0x47d418){logger['error'](_0x5bf8('0x58'),_0x47d418);throw _0x47d418;});}return _0x1f0126;})['then'](respondWithResult(_0x55af5b,0xc9))[_0x5bf8('0x4b')](handleError(_0x55af5b,null));};exports['update']=function(_0xc71d84,_0x520048){if(_0xc71d84[_0x5bf8('0x51')]['id']){delete _0xc71d84[_0x5bf8('0x51')]['id'];}return db[_0x5bf8('0x31')][_0x5bf8('0x50')]({'where':{'id':_0xc71d84[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x520048,null))[_0x5bf8('0x2a')](saveUpdates(_0xc71d84['body'],null))[_0x5bf8('0x2a')](respondWithResult(_0x520048,null))[_0x5bf8('0x4b')](handleError(_0x520048,null));};exports[_0x5bf8('0x2b')]=function(_0x25d38f,_0x4f8116){return db['FaxQueue'][_0x5bf8('0x50')]({'where':{'id':_0x25d38f[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x4f8116,null))['then'](removeEntity(_0x4f8116,null))['catch'](handleError(_0x4f8116,null));};exports[_0x5bf8('0x59')]=function(_0x2438c9,_0x119f41){return db[_0x5bf8('0x31')][_0x5bf8('0x59')]()[_0x5bf8('0x2a')](respondWithResult(_0x119f41,null))[_0x5bf8('0x4b')](handleError(_0x119f41,null));};exports['getMembers']=function(_0x52f197,_0x250727,_0x220ba7){var _0x44f0ee={'raw':!![],'where':{}},_0x3b0b00={},_0x58fdad;return db['FaxQueue'][_0x5bf8('0x5a')]({'where':{'id':_0x52f197[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x250727,null))['then'](function(_0x8c631a){if(_0x8c631a){_0x58fdad=_0x8c631a[_0x5bf8('0x52')]({'plain':!![]});_0x3b0b00[_0x5bf8('0x35')]=_[_0x5bf8('0x38')](db[_0x5bf8('0x5b')][_0x5bf8('0x4e')]);_0x3b0b00[_0x5bf8('0x37')]=_['keys'](_0x52f197[_0x5bf8('0x37')]);_0x3b0b00[_0x5bf8('0x39')]=_[_0x5bf8('0x3b')](_0x3b0b00['model'],_0x3b0b00[_0x5bf8('0x37')]);_0x44f0ee[_0x5bf8('0x3a')]=_['intersection'](_0x3b0b00['model'],qs['fields'](_0x52f197[_0x5bf8('0x37')][_0x5bf8('0x3c')]));_0x44f0ee[_0x5bf8('0x3a')]=_0x44f0ee[_0x5bf8('0x3a')][_0x5bf8('0x3d')]?_0x44f0ee[_0x5bf8('0x3a')]:_0x3b0b00[_0x5bf8('0x35')];if(!_0x52f197[_0x5bf8('0x37')][_0x5bf8('0x3e')](_0x5bf8('0x3f'))){_0x44f0ee[_0x5bf8('0x22')]=qs[_0x5bf8('0x22')](_0x52f197[_0x5bf8('0x37')][_0x5bf8('0x22')]);_0x44f0ee[_0x5bf8('0x23')]=qs['offset'](_0x52f197['query'][_0x5bf8('0x23')]);}_0x44f0ee[_0x5bf8('0x40')]=qs['sort'](_0x52f197['query'][_0x5bf8('0x41')]);_0x44f0ee[_0x5bf8('0x42')]=qs[_0x5bf8('0x39')](_['pick'](_0x52f197['query'],_0x3b0b00['filters']));_0x44f0ee['where'][_0x5bf8('0x5c')]=_0x8c631a['id'];if(_0x52f197[_0x5bf8('0x37')][_0x5bf8('0x44')]){_0x44f0ee[_0x5bf8('0x42')]=_['merge'](_0x44f0ee['where'],{'$or':_['map'](_0x44f0ee[_0x5bf8('0x3a')],function(_0xccc03d){var _0xfc9f45={};_0xfc9f45[_0xccc03d]={'$like':'%'+_0x52f197[_0x5bf8('0x37')][_0x5bf8('0x44')]+'%'};return _0xfc9f45;})});}_0x44f0ee=_['merge']({},_0x44f0ee,_0x52f197[_0x5bf8('0x4f')]);return db['UserFaxQueue'][_0x5bf8('0x49')](_0x44f0ee);}})[_0x5bf8('0x2a')](function(_0x5cc381){if(_0x5cc381){return db['User'][_0x5bf8('0x5d')]({'where':{'id':_[_0x5bf8('0x30')](_0x5cc381,'UserId'),'role':_0x5bf8('0x5e')},'attributes':['id','name','faxPause',_0x5bf8('0x5f'),_0x5bf8('0x60')]});}})['then'](function(_0x1d2b48){if(_0x1d2b48){return{'count':_0x1d2b48['count'],'rows':_['map'](_0x1d2b48['rows'],function(_0x37f0a6){return{'membername':_0x37f0a6['name'],'UserId':_0x37f0a6['id'],'queue_name':_0x58fdad['name'],'FaxQueueId':_0x58fdad['id'],'interface':util[_0x5bf8('0x61')](_0x5bf8('0x62'),_0x5bf8('0x63'),_0x37f0a6[_0x5bf8('0x36')]),'penalty':0x0,'paused':_0x37f0a6[_0x5bf8('0x64')],'createdAt':_0x37f0a6[_0x5bf8('0x60')],'updatedAt':_0x37f0a6[_0x5bf8('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5bf8('0x2a')](respondWithFilteredResult(_0x250727,_0x44f0ee))[_0x5bf8('0x4b')](handleError(_0x250727,null));};exports[_0x5bf8('0x65')]=function(_0xd45ad5,_0x40ff59,_0x1cdd15){var _0x58ec15={};var _0x474edf={};var _0x2b6ba6;var _0x418512;return db[_0x5bf8('0x31')][_0x5bf8('0x5a')]({'where':{'id':_0xd45ad5[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x40ff59,null))[_0x5bf8('0x2a')](function(_0x3c0b77){if(_0x3c0b77){_0x2b6ba6=_0x3c0b77;_0x474edf['model']=_['keys'](db[_0x5bf8('0x66')][_0x5bf8('0x4e')]);_0x474edf['query']=_['keys'](_0xd45ad5[_0x5bf8('0x37')]);_0x474edf[_0x5bf8('0x39')]=_['intersection'](_0x474edf[_0x5bf8('0x35')],_0x474edf[_0x5bf8('0x37')]);_0x58ec15[_0x5bf8('0x3a')]=_[_0x5bf8('0x3b')](_0x474edf['model'],qs[_0x5bf8('0x3c')](_0xd45ad5[_0x5bf8('0x37')]['fields']));_0x58ec15[_0x5bf8('0x3a')]=_0x58ec15[_0x5bf8('0x3a')][_0x5bf8('0x3d')]?_0x58ec15[_0x5bf8('0x3a')]:_0x474edf[_0x5bf8('0x35')];_0x58ec15['order']=qs[_0x5bf8('0x41')](_0xd45ad5[_0x5bf8('0x37')][_0x5bf8('0x41')]);_0x58ec15[_0x5bf8('0x42')]=qs['filters'](_[_0x5bf8('0x43')](_0xd45ad5['query'],_0x474edf[_0x5bf8('0x39')]));if(_0xd45ad5[_0x5bf8('0x37')]['filter']){_0x58ec15['where']=_[_0x5bf8('0x46')](_0x58ec15[_0x5bf8('0x42')],{'$or':_[_0x5bf8('0x30')](_0x58ec15[_0x5bf8('0x3a')],function(_0x3b6f2b){var _0x57996d={};_0x57996d[_0x3b6f2b]={'$like':'%'+_0xd45ad5[_0x5bf8('0x37')][_0x5bf8('0x44')]+'%'};return _0x57996d;})});}_0x58ec15=_[_0x5bf8('0x46')]({},_0x58ec15,_0xd45ad5[_0x5bf8('0x4f')]);return _0x2b6ba6[_0x5bf8('0x65')](_0x58ec15);}})[_0x5bf8('0x2a')](function(_0x434f4c){if(_0x434f4c){_0x418512=_0x434f4c[_0x5bf8('0x3d')];if(!_0xd45ad5[_0x5bf8('0x37')][_0x5bf8('0x3e')](_0x5bf8('0x3f'))){_0x58ec15[_0x5bf8('0x22')]=qs[_0x5bf8('0x22')](_0xd45ad5['query'][_0x5bf8('0x22')]);_0x58ec15[_0x5bf8('0x23')]=qs[_0x5bf8('0x23')](_0xd45ad5[_0x5bf8('0x37')][_0x5bf8('0x23')]);}return _0x2b6ba6['getTeams'](_0x58ec15);}})[_0x5bf8('0x2a')](function(_0x5f3875){if(_0x5f3875){return _0x5f3875?{'count':_0x418512,'rows':_0x5f3875}:null;}})['then'](respondWithResult(_0x40ff59,null))[_0x5bf8('0x4b')](handleError(_0x40ff59,null));};exports['addTeams']=function(_0x5d37c5,_0x104300,_0x3db671){var _0x182716=_0x5d37c5[_0x5bf8('0x51')][_0x5bf8('0x67')];return db[_0x5bf8('0x66')]['findAll']({'where':{'id':_0x182716},'attributes':['id'],'include':[{'model':db[_0x5bf8('0x68')],'as':_0x5bf8('0x69'),'attributes':['id',_0x5bf8('0x36'),_0x5bf8('0x6a'),_0x5bf8('0x6b'),'interface'],'raw':!![]}]})[_0x5bf8('0x2a')](function(_0x20046c){if(_0x20046c){var _0x1d1168=_[_0x5bf8('0x6c')](_0x20046c,function(_0x3df11c){var _0x28e3de=_0x3df11c[_0x5bf8('0x52')]({'plain':!![]});return _0x28e3de['Agents'];});return db[_0x5bf8('0x31')]['find']({'where':{'id':_0x5d37c5[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](function(_0x2a0389){return db[_0x5bf8('0x6d')][_0x5bf8('0x6e')](function(_0x3d46a9){return _0x2a0389[_0x5bf8('0x6f')](_0x182716,{'transaction':_0x3d46a9})['then'](function(){return BPromise[_0x5bf8('0x70')](_0x1d1168,function(_0x2119dd){return db[_0x5bf8('0x5b')][_0x5bf8('0x71')]({'where':{'UserId':_0x2119dd['id'],'FaxQueueId':_0x5d37c5['params']['id']},'transaction':_0x3d46a9});});})[_0x5bf8('0x2a')](function(){_0x1d1168[_0x5bf8('0x72')](function(_0x2ff1a7){socket['emit']('userFaxQueue:save',{'UserId':_0x2ff1a7['id'],'FaxQueueId':_0x2a0389['id']});});});});});}})[_0x5bf8('0x2a')](respondWithStatusCode(_0x104300,null))[_0x5bf8('0x4b')](handleError(_0x104300,null));};exports['removeTeams']=function(_0x21b41e,_0x4fb424,_0x36b993){return db['Team'][_0x5bf8('0x49')]({'where':{'id':_0x21b41e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x5bf8('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5bf8('0x2a')](handleEntityNotFound(_0x4fb424,null))[_0x5bf8('0x2a')](function(_0x166a22){var _0x3d4579=_[_0x5bf8('0x30')](_0x166a22,'id');var _0x47ee76=[];var _0x444635=[];var _0x26be7a=squel[_0x5bf8('0x73')]();_0x26be7a[_0x5bf8('0x74')](_0x5bf8('0x75'))['from'](_0x5bf8('0x76'),'tq')[_0x5bf8('0x77')](_0x5bf8('0x78'),'ut',_0x5bf8('0x79'))[_0x5bf8('0x42')](_0x5bf8('0x7a'),_0x21b41e[_0x5bf8('0x4d')]['id']);for(var _0x4e1953=0x0;_0x4e1953<_0x166a22['length'];_0x4e1953+=0x1){let _0x342ff9=_0x166a22[_0x4e1953];for(var _0x106087=0x0;_0x106087<_0x342ff9['Agents'][_0x5bf8('0x3d')];_0x106087+=0x1){let _0x1a7f87=_0x342ff9['Agents'][_0x106087];var _0x1e7c4b=_0x26be7a[_0x5bf8('0x7b')]();_0x1e7c4b[_0x5bf8('0x42')]('ut.UserId\x20=\x20?',_0x1a7f87['id']);_0x444635[_0x5bf8('0x7c')](db[_0x5bf8('0x6d')][_0x5bf8('0x37')](_0x1e7c4b[_0x5bf8('0x7d')](),{'type':db[_0x5bf8('0x6d')]['QueryTypes']['SELECT']})[_0x5bf8('0x2a')](function(_0x4cc681){if(_0x4cc681['length']===0x1){return _0x1a7f87['id'];}else{var _0x34ff00=_[_0x5bf8('0x7e')](_[_0x5bf8('0x30')](_0x4cc681,'TeamId'),function(_0x8a6baa){return _['includes'](_0x3d4579,_0x8a6baa);});if(_0x34ff00){return _0x1a7f87['id'];}}}));}}return BPromise['all'](_0x444635)['then'](function(_0x44aaec){_0x47ee76=_(_0x47ee76)['union'](_0x44aaec)[_0x5bf8('0x7f')]()[_0x5bf8('0x80')]();return db['FaxQueue'][_0x5bf8('0x50')]({'where':{'id':_0x21b41e['params']['id']}})[_0x5bf8('0x2a')](function(_0x2b4f58){return db[_0x5bf8('0x6d')]['transaction'](function(_0x3d5b44){return _0x2b4f58[_0x5bf8('0x81')](_0x21b41e['query']['ids'],{'transaction':_0x3d5b44})[_0x5bf8('0x2a')](function(){if(!_[_0x5bf8('0x82')](_0x47ee76)){return _0x2b4f58[_0x5bf8('0x83')](_0x47ee76,{'transaction':_0x3d5b44});}})[_0x5bf8('0x2a')](function(){_0x47ee76[_0x5bf8('0x72')](function(_0x51f6fc){socket[_0x5bf8('0x84')](_0x5bf8('0x85'),{'UserId':_0x51f6fc,'FaxQueueId':_0x2b4f58['id']});});});});});});})[_0x5bf8('0x2a')](respondWithStatusCode(_0x4fb424,null))[_0x5bf8('0x4b')](handleError(_0x4fb424,null));};exports[_0x5bf8('0x86')]=function(_0x5442aa,_0x1236d7,_0x5a8910){return db[_0x5bf8('0x31')][_0x5bf8('0x50')]({'where':{'id':_0x5442aa['params']['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x1236d7,null))['then'](function(_0x306c64){if(_0x306c64){return _0x306c64[_0x5bf8('0x86')](_0x5442aa[_0x5bf8('0x51')]['ids'],_[_0x5bf8('0x87')](_0x5442aa[_0x5bf8('0x51')],['ids','id'])||{})[_0x5bf8('0x88')](function(_0x31cd73){for(var _0x4a48f5=0x0;_0x4a48f5<_0x5442aa[_0x5bf8('0x51')][_0x5bf8('0x67')][_0x5bf8('0x3d')];_0x4a48f5+=0x1){socket[_0x5bf8('0x84')](_0x5bf8('0x89'),{'UserId':Number(_0x5442aa['body'][_0x5bf8('0x67')][_0x4a48f5]),'FaxQueueId':Number(_0x5442aa[_0x5bf8('0x4d')]['id'])});}return _0x31cd73;});}})[_0x5bf8('0x2a')](respondWithResult(_0x1236d7,null))[_0x5bf8('0x4b')](handleError(_0x1236d7,null));};exports[_0x5bf8('0x83')]=function(_0x101656,_0x1c2002,_0xc9258b){return db['FaxQueue'][_0x5bf8('0x50')]({'where':{'id':_0x101656[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x1c2002,null))[_0x5bf8('0x2a')](function(_0x59b573){if(_0x59b573){return _0x59b573['removeAgents'](_0x101656[_0x5bf8('0x37')][_0x5bf8('0x67')])[_0x5bf8('0x2a')](function(){if(_['isArray'](_0x101656[_0x5bf8('0x37')][_0x5bf8('0x67')])){for(var _0x511e74=0x0;_0x511e74<_0x101656[_0x5bf8('0x37')]['ids'][_0x5bf8('0x3d')];_0x511e74+=0x1){socket[_0x5bf8('0x84')](_0x5bf8('0x85'),{'UserId':Number(_0x101656['query']['ids'][_0x511e74]),'FaxQueueId':Number(_0x101656[_0x5bf8('0x4d')]['id'])});}}else{socket['emit'](_0x5bf8('0x85'),{'UserId':Number(_0x101656[_0x5bf8('0x37')][_0x5bf8('0x67')]),'FaxQueueId':Number(_0x101656[_0x5bf8('0x4d')]['id'])});}});}})[_0x5bf8('0x2a')](respondWithStatusCode(_0x1c2002,null))['catch'](handleError(_0x1c2002,null));};exports[_0x5bf8('0x8a')]=function(_0x58f5e8,_0x15bb7a,_0x602895){var _0x54a933={};var _0x4fee0d={};var _0x31aba8;var _0x175f29;return db[_0x5bf8('0x31')][_0x5bf8('0x5a')]({'where':{'id':_0x58f5e8[_0x5bf8('0x4d')]['id']}})[_0x5bf8('0x2a')](handleEntityNotFound(_0x15bb7a,null))[_0x5bf8('0x2a')](function(_0x4e02bc){if(_0x4e02bc){_0x31aba8=_0x4e02bc;_0x4fee0d['model']=_[_0x5bf8('0x38')](db[_0x5bf8('0x68')]['rawAttributes']);_0x4fee0d[_0x5bf8('0x37')]=_[_0x5bf8('0x38')](_0x58f5e8['query']);_0x4fee0d['filters']=_[_0x5bf8('0x3b')](_0x4fee0d['model'],_0x4fee0d[_0x5bf8('0x37')]);_0x54a933[_0x5bf8('0x3a')]=_[_0x5bf8('0x3b')](_0x4fee0d[_0x5bf8('0x35')],qs[_0x5bf8('0x3c')](_0x58f5e8['query']['fields']));_0x54a933[_0x5bf8('0x3a')]=_0x54a933['attributes']['length']?_0x54a933[_0x5bf8('0x3a')]:_0x4fee0d['model'];_0x54a933[_0x5bf8('0x40')]=qs[_0x5bf8('0x41')](_0x58f5e8[_0x5bf8('0x37')][_0x5bf8('0x41')]);_0x54a933[_0x5bf8('0x42')]=qs['filters'](_[_0x5bf8('0x43')](_0x58f5e8['query'],_0x4fee0d['filters']));if(_0x58f5e8[_0x5bf8('0x37')][_0x5bf8('0x44')]){_0x54a933[_0x5bf8('0x42')]=_['merge'](_0x54a933[_0x5bf8('0x42')],{'$or':_[_0x5bf8('0x30')](_0x54a933[_0x5bf8('0x3a')],function(_0x287f06){var _0x109c0d={};_0x109c0d[_0x287f06]={'$like':'%'+_0x58f5e8[_0x5bf8('0x37')][_0x5bf8('0x44')]+'%'};return _0x109c0d;})});}_0x54a933=_[_0x5bf8('0x46')]({},_0x54a933,_0x58f5e8['options']);return _0x31aba8[_0x5bf8('0x8a')](_0x54a933);}})[_0x5bf8('0x2a')](function(_0x515d6f){if(_0x515d6f){_0x175f29=_0x515d6f[_0x5bf8('0x3d')];if(!_0x58f5e8['query'][_0x5bf8('0x3e')](_0x5bf8('0x3f'))){_0x54a933['limit']=qs[_0x5bf8('0x22')](_0x58f5e8[_0x5bf8('0x37')][_0x5bf8('0x22')]);_0x54a933[_0x5bf8('0x23')]=qs['offset'](_0x58f5e8[_0x5bf8('0x37')][_0x5bf8('0x23')]);}return _0x31aba8[_0x5bf8('0x8a')](_0x54a933);}})[_0x5bf8('0x2a')](function(_0x55dff5){if(_0x55dff5){return _0x55dff5?{'count':_0x175f29,'rows':_0x55dff5}:null;}})[_0x5bf8('0x2a')](respondWithResult(_0x15bb7a,null))['catch'](handleError(_0x15bb7a,null));}; \ No newline at end of file +var _0x18d6=['describe','getMembers','findOne','UserFaxQueue','order','FaxQueueId','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','ids','User','Agents','online','voicePause','interface','addTeams','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','union','sequelize','transaction','removeTeams','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','count','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params'];(function(_0x1b99dc,_0x24a858){var _0x4c7fb3=function(_0x19ef02){while(--_0x19ef02){_0x1b99dc['push'](_0x1b99dc['shift']());}};_0x4c7fb3(++_0x24a858);}(_0x18d6,0xca));var _0x618d=function(_0x4a2176,_0x176e35){_0x4a2176=_0x4a2176-0x0;var _0x29e2c7=_0x18d6[_0x4a2176];return _0x29e2c7;};'use strict';var emlformat=require(_0x618d('0x0'));var rimraf=require(_0x618d('0x1'));var zipdir=require(_0x618d('0x2'));var jsonpatch=require(_0x618d('0x3'));var rp=require(_0x618d('0x4'));var moment=require(_0x618d('0x5'));var BPromise=require(_0x618d('0x6'));var Mustache=require(_0x618d('0x7'));var util=require(_0x618d('0x8'));var path=require(_0x618d('0x9'));var sox=require(_0x618d('0xa'));var csv=require(_0x618d('0xb'));var ejs=require(_0x618d('0xc'));var fs=require('fs');var fs_extra=require(_0x618d('0xd'));var _=require(_0x618d('0xe'));var squel=require(_0x618d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x618d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x618d('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x618d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x618d('0x13'));var hardwareService=require(_0x618d('0x14'));var logger=require(_0x618d('0x15'))(_0x618d('0x16'));var utils=require(_0x618d('0x17'));var config=require(_0x618d('0x18'));var licenseUtil=require(_0x618d('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x618d('0x1a')](config['redis'],{'host':_0x618d('0x1b'),'port':0x18eb});var socket=require(_0x618d('0x1c'))(new Redis(config[_0x618d('0x1d')]));require(_0x618d('0x1e'))[_0x618d('0x1f')](socket);function respondWithStatusCode(_0x29dcf7,_0x5e5469){_0x5e5469=_0x5e5469||0xcc;return function(_0x7d7d92){if(_0x7d7d92){return _0x29dcf7['sendStatus'](_0x5e5469);}return _0x29dcf7['status'](_0x5e5469)[_0x618d('0x20')]();};}function respondWithResult(_0x3a6d7d,_0x120552){_0x120552=_0x120552||0xc8;return function(_0x50726b){if(_0x50726b){return _0x3a6d7d['status'](_0x120552)[_0x618d('0x21')](_0x50726b);}};}function respondWithFilteredResult(_0x1a765f,_0x4f89e1){return function(_0xda5d0){if(_0xda5d0){var _0x3b942b=typeof _0x4f89e1[_0x618d('0x22')]==='undefined'&&typeof _0x4f89e1['limit']===_0x618d('0x23');var _0x17ce07=_0xda5d0['count'];var _0x50a8a1=_0x3b942b?0x0:_0x4f89e1['offset'];var _0x27af37=_0x3b942b?_0xda5d0['count']:_0x4f89e1['offset']+_0x4f89e1[_0x618d('0x24')];var _0x21163c;if(_0x27af37>=_0x17ce07){_0x27af37=_0x17ce07;_0x21163c=0xc8;}else{_0x21163c=0xce;}_0x1a765f[_0x618d('0x25')](_0x21163c);return _0x1a765f[_0x618d('0x26')](_0x618d('0x27'),_0x50a8a1+'-'+_0x27af37+'/'+_0x17ce07)[_0x618d('0x21')](_0xda5d0);}return null;};}function patchUpdates(_0x5a1ae4){return function(_0x44d93e){try{jsonpatch[_0x618d('0x28')](_0x44d93e,_0x5a1ae4,!![]);}catch(_0x5ac372){return BPromise[_0x618d('0x29')](_0x5ac372);}return _0x44d93e[_0x618d('0x2a')]();};}function saveUpdates(_0x29a534,_0x5b2399){return function(_0x5c169e){if(_0x5c169e){return _0x5c169e['update'](_0x29a534)[_0x618d('0x2b')](function(_0x5b9952){return _0x5b9952;});}return null;};}function removeEntity(_0x57125a,_0x31ee40){return function(_0xae069a){if(_0xae069a){return _0xae069a[_0x618d('0x2c')]()['then'](function(){var _0x4202a6=_0xae069a[_0x618d('0x2d')]({'plain':!![]});var _0x21564f='FaxQueues';return db['UserProfileResource'][_0x618d('0x2c')]({'where':{'type':_0x21564f,'resourceId':_0x4202a6['id']}})[_0x618d('0x2b')](function(){return _0xae069a;});})[_0x618d('0x2b')](function(){_0x57125a[_0x618d('0x25')](0xcc)[_0x618d('0x20')]();});}};}function handleEntityNotFound(_0x185f41,_0xfebfa2){return function(_0x5b1a9b){if(!_0x5b1a9b){_0x185f41[_0x618d('0x2e')](0x194);}return _0x5b1a9b;};}function handleError(_0x515c8c,_0x5926e6){_0x5926e6=_0x5926e6||0x1f4;return function(_0xde0251){logger[_0x618d('0x2f')](_0xde0251[_0x618d('0x30')]);if(_0xde0251[_0x618d('0x31')]){delete _0xde0251[_0x618d('0x31')];}_0x515c8c[_0x618d('0x25')](_0x5926e6)[_0x618d('0x32')](_0xde0251);};}exports[_0x618d('0x33')]=function(_0x3e64c1,_0x44491e){var _0x126876={},_0x4f93d7={},_0x2cea31={'count':0x0,'rows':[]};var _0x3c879b=_[_0x618d('0x34')](db[_0x618d('0x35')][_0x618d('0x36')],function(_0x391497){return{'name':_0x391497[_0x618d('0x37')],'type':_0x391497[_0x618d('0x38')][_0x618d('0x39')]};});_0x4f93d7['model']=_[_0x618d('0x34')](_0x3c879b,'name');_0x4f93d7[_0x618d('0x3a')]=_['keys'](_0x3e64c1[_0x618d('0x3a')]);_0x4f93d7[_0x618d('0x3b')]=_['intersection'](_0x4f93d7[_0x618d('0x3c')],_0x4f93d7[_0x618d('0x3a')]);_0x126876[_0x618d('0x3d')]=_[_0x618d('0x3e')](_0x4f93d7[_0x618d('0x3c')],qs['fields'](_0x3e64c1[_0x618d('0x3a')][_0x618d('0x3f')]));_0x126876['attributes']=_0x126876['attributes'][_0x618d('0x40')]?_0x126876[_0x618d('0x3d')]:_0x4f93d7[_0x618d('0x3c')];if(!_0x3e64c1[_0x618d('0x3a')][_0x618d('0x41')](_0x618d('0x42'))){_0x126876[_0x618d('0x24')]=qs['limit'](_0x3e64c1[_0x618d('0x3a')][_0x618d('0x24')]);_0x126876[_0x618d('0x22')]=qs[_0x618d('0x22')](_0x3e64c1[_0x618d('0x3a')]['offset']);}_0x126876['order']=qs[_0x618d('0x43')](_0x3e64c1[_0x618d('0x3a')][_0x618d('0x43')]);_0x126876['where']=qs[_0x618d('0x3b')](_[_0x618d('0x44')](_0x3e64c1['query'],_0x4f93d7[_0x618d('0x3b')]),_0x3c879b);if(_0x3e64c1[_0x618d('0x3a')][_0x618d('0x45')]){_0x126876['where']=_[_0x618d('0x46')](_0x126876[_0x618d('0x47')],{'$or':_['map'](_0x3c879b,function(_0x20c093){if(_0x20c093[_0x618d('0x38')]!==_0x618d('0x48')){var _0x30ffce={};_0x30ffce[_0x20c093['name']]={'$like':'%'+_0x3e64c1[_0x618d('0x3a')]['filter']+'%'};return _0x30ffce;}})});}_0x126876=_[_0x618d('0x46')]({},_0x126876,_0x3e64c1['options']);var _0x5da865={'where':_0x126876['where']};return db[_0x618d('0x35')]['count'](_0x5da865)[_0x618d('0x2b')](function(_0x231bae){_0x2cea31[_0x618d('0x49')]=_0x231bae;if(_0x3e64c1[_0x618d('0x3a')]['includeAll']){_0x126876[_0x618d('0x4a')]=[{'all':!![]}];}return db[_0x618d('0x35')][_0x618d('0x4b')](_0x126876);})[_0x618d('0x2b')](function(_0xe46896){_0x2cea31[_0x618d('0x4c')]=_0xe46896;return _0x2cea31;})[_0x618d('0x2b')](respondWithFilteredResult(_0x44491e,_0x126876))[_0x618d('0x4d')](handleError(_0x44491e,null));};exports[_0x618d('0x4e')]=function(_0x1e3239,_0x29e025){var _0x32b9dc={'raw':!![],'where':{'id':_0x1e3239['params']['id']}},_0x5e0e1f={};_0x5e0e1f['model']=_[_0x618d('0x4f')](db['FaxQueue'][_0x618d('0x36')]);_0x5e0e1f[_0x618d('0x3a')]=_['keys'](_0x1e3239[_0x618d('0x3a')]);_0x5e0e1f[_0x618d('0x3b')]=_[_0x618d('0x3e')](_0x5e0e1f[_0x618d('0x3c')],_0x5e0e1f[_0x618d('0x3a')]);_0x32b9dc[_0x618d('0x3d')]=_[_0x618d('0x3e')](_0x5e0e1f[_0x618d('0x3c')],qs['fields'](_0x1e3239[_0x618d('0x3a')][_0x618d('0x3f')]));_0x32b9dc[_0x618d('0x3d')]=_0x32b9dc[_0x618d('0x3d')]['length']?_0x32b9dc['attributes']:_0x5e0e1f[_0x618d('0x3c')];if(_0x1e3239[_0x618d('0x3a')][_0x618d('0x50')]){_0x32b9dc[_0x618d('0x4a')]=[{'all':!![]}];}_0x32b9dc=_[_0x618d('0x46')]({},_0x32b9dc,_0x1e3239[_0x618d('0x51')]);return db[_0x618d('0x35')][_0x618d('0x52')](_0x32b9dc)[_0x618d('0x2b')](handleEntityNotFound(_0x29e025,null))[_0x618d('0x2b')](respondWithResult(_0x29e025,null))[_0x618d('0x4d')](handleError(_0x29e025,null));};exports[_0x618d('0x53')]=function(_0x3386bb,_0x41539a){return db['FaxQueue'][_0x618d('0x53')](_0x3386bb[_0x618d('0x54')],{})[_0x618d('0x2b')](function(_0x3c8e39){var _0x572c63=_0x3386bb[_0x618d('0x55')]['get']({'plain':!![]});if(!_0x572c63)throw new Error(_0x618d('0x56'));if(_0x572c63[_0x618d('0x57')]===_0x618d('0x55')){var _0x324fa0=_0x3c8e39[_0x618d('0x2d')]({'plain':!![]});var _0x58ba8b=_0x618d('0x58');return db[_0x618d('0x59')][_0x618d('0x52')]({'where':{'name':_0x58ba8b,'userProfileId':_0x572c63[_0x618d('0x5a')]},'raw':!![]})[_0x618d('0x2b')](function(_0x50d4bd){if(_0x50d4bd&&_0x50d4bd[_0x618d('0x5b')]===0x0){return db[_0x618d('0x5c')][_0x618d('0x53')]({'name':_0x324fa0[_0x618d('0x31')],'resourceId':_0x324fa0['id'],'type':_0x50d4bd[_0x618d('0x31')],'sectionId':_0x50d4bd['id']},{})[_0x618d('0x2b')](function(){return _0x3c8e39;});}else{return _0x3c8e39;}})['catch'](function(_0x57fbcb){logger[_0x618d('0x2f')](_0x618d('0x5d'),_0x57fbcb);throw _0x57fbcb;});}return _0x3c8e39;})[_0x618d('0x2b')](respondWithResult(_0x41539a,0xc9))[_0x618d('0x4d')](handleError(_0x41539a,null));};exports[_0x618d('0x5e')]=function(_0xe12899,_0xf9bbb){if(_0xe12899[_0x618d('0x54')]['id']){delete _0xe12899[_0x618d('0x54')]['id'];}return db[_0x618d('0x35')][_0x618d('0x52')]({'where':{'id':_0xe12899[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0xf9bbb,null))[_0x618d('0x2b')](saveUpdates(_0xe12899[_0x618d('0x54')],null))[_0x618d('0x2b')](respondWithResult(_0xf9bbb,null))['catch'](handleError(_0xf9bbb,null));};exports[_0x618d('0x2c')]=function(_0x5eed3c,_0x4952aa){return db['FaxQueue'][_0x618d('0x52')]({'where':{'id':_0x5eed3c[_0x618d('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4952aa,null))['then'](removeEntity(_0x4952aa,null))[_0x618d('0x4d')](handleError(_0x4952aa,null));};exports[_0x618d('0x60')]=function(_0x1e207d,_0xc8b668){return db[_0x618d('0x35')][_0x618d('0x60')]()[_0x618d('0x2b')](respondWithResult(_0xc8b668,null))[_0x618d('0x4d')](handleError(_0xc8b668,null));};exports[_0x618d('0x61')]=function(_0xccaddc,_0x1d8039,_0x3aac40){var _0x43d347={'raw':!![],'where':{}},_0x1f7823={},_0x9ffa88;return db[_0x618d('0x35')][_0x618d('0x62')]({'where':{'id':_0xccaddc[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0x1d8039,null))[_0x618d('0x2b')](function(_0x1bf5cc){if(_0x1bf5cc){_0x9ffa88=_0x1bf5cc[_0x618d('0x2d')]({'plain':!![]});_0x1f7823[_0x618d('0x3c')]=_[_0x618d('0x4f')](db[_0x618d('0x63')][_0x618d('0x36')]);_0x1f7823[_0x618d('0x3a')]=_[_0x618d('0x4f')](_0xccaddc['query']);_0x1f7823[_0x618d('0x3b')]=_[_0x618d('0x3e')](_0x1f7823['model'],_0x1f7823['query']);_0x43d347[_0x618d('0x3d')]=_[_0x618d('0x3e')](_0x1f7823[_0x618d('0x3c')],qs[_0x618d('0x3f')](_0xccaddc['query'][_0x618d('0x3f')]));_0x43d347[_0x618d('0x3d')]=_0x43d347[_0x618d('0x3d')]['length']?_0x43d347[_0x618d('0x3d')]:_0x1f7823['model'];if(!_0xccaddc[_0x618d('0x3a')][_0x618d('0x41')]('nolimit')){_0x43d347[_0x618d('0x24')]=qs['limit'](_0xccaddc[_0x618d('0x3a')]['limit']);_0x43d347['offset']=qs[_0x618d('0x22')](_0xccaddc[_0x618d('0x3a')][_0x618d('0x22')]);}_0x43d347[_0x618d('0x64')]=qs[_0x618d('0x43')](_0xccaddc['query']['sort']);_0x43d347[_0x618d('0x47')]=qs[_0x618d('0x3b')](_['pick'](_0xccaddc[_0x618d('0x3a')],_0x1f7823[_0x618d('0x3b')]));_0x43d347[_0x618d('0x47')][_0x618d('0x65')]=_0x1bf5cc['id'];if(_0xccaddc[_0x618d('0x3a')][_0x618d('0x45')]){_0x43d347[_0x618d('0x47')]=_[_0x618d('0x46')](_0x43d347[_0x618d('0x47')],{'$or':_[_0x618d('0x34')](_0x43d347[_0x618d('0x3d')],function(_0x4ab85f){var _0x1bf5c5={};_0x1bf5c5[_0x4ab85f]={'$like':'%'+_0xccaddc[_0x618d('0x3a')][_0x618d('0x45')]+'%'};return _0x1bf5c5;})});}_0x43d347=_[_0x618d('0x46')]({},_0x43d347,_0xccaddc[_0x618d('0x51')]);return db[_0x618d('0x63')][_0x618d('0x4b')](_0x43d347);}})[_0x618d('0x2b')](function(_0x389870){if(_0x389870){return db['User']['findAndCountAll']({'where':{'id':_[_0x618d('0x34')](_0x389870,_0x618d('0x66')),'role':_0x618d('0x67')},'attributes':['id',_0x618d('0x31'),_0x618d('0x68'),_0x618d('0x69'),'createdAt']});}})['then'](function(_0x44b6a5){if(_0x44b6a5){return{'count':_0x44b6a5[_0x618d('0x49')],'rows':_['map'](_0x44b6a5[_0x618d('0x4c')],function(_0x5e3cd6){return{'membername':_0x5e3cd6['name'],'UserId':_0x5e3cd6['id'],'queue_name':_0x9ffa88[_0x618d('0x31')],'FaxQueueId':_0x9ffa88['id'],'interface':util[_0x618d('0x6a')](_0x618d('0x6b'),_0x618d('0x6c'),_0x5e3cd6[_0x618d('0x31')]),'penalty':0x0,'paused':_0x5e3cd6[_0x618d('0x68')],'createdAt':_0x5e3cd6[_0x618d('0x6d')],'updatedAt':_0x5e3cd6[_0x618d('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x618d('0x2b')](respondWithFilteredResult(_0x1d8039,_0x43d347))[_0x618d('0x4d')](handleError(_0x1d8039,null));};exports['getTeams']=function(_0x19d5f2,_0x9e59ad,_0x2a6489){var _0xee4464={};var _0x325069={};var _0x55174c;var _0x5b3187;return db[_0x618d('0x35')][_0x618d('0x62')]({'where':{'id':_0x19d5f2[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0x9e59ad,null))['then'](function(_0x19978a){if(_0x19978a){_0x55174c=_0x19978a;_0x325069[_0x618d('0x3c')]=_[_0x618d('0x4f')](db[_0x618d('0x6e')][_0x618d('0x36')]);_0x325069['query']=_[_0x618d('0x4f')](_0x19d5f2[_0x618d('0x3a')]);_0x325069[_0x618d('0x3b')]=_['intersection'](_0x325069[_0x618d('0x3c')],_0x325069['query']);_0xee4464[_0x618d('0x3d')]=_[_0x618d('0x3e')](_0x325069[_0x618d('0x3c')],qs[_0x618d('0x3f')](_0x19d5f2['query'][_0x618d('0x3f')]));_0xee4464[_0x618d('0x3d')]=_0xee4464[_0x618d('0x3d')][_0x618d('0x40')]?_0xee4464[_0x618d('0x3d')]:_0x325069['model'];_0xee4464['order']=qs[_0x618d('0x43')](_0x19d5f2['query'][_0x618d('0x43')]);_0xee4464['where']=qs[_0x618d('0x3b')](_[_0x618d('0x44')](_0x19d5f2[_0x618d('0x3a')],_0x325069['filters']));if(_0x19d5f2[_0x618d('0x3a')][_0x618d('0x45')]){_0xee4464[_0x618d('0x47')]=_[_0x618d('0x46')](_0xee4464[_0x618d('0x47')],{'$or':_[_0x618d('0x34')](_0xee4464[_0x618d('0x3d')],function(_0x223637){var _0x25cd37={};_0x25cd37[_0x223637]={'$like':'%'+_0x19d5f2[_0x618d('0x3a')][_0x618d('0x45')]+'%'};return _0x25cd37;})});}_0xee4464=_[_0x618d('0x46')]({},_0xee4464,_0x19d5f2['options']);return _0x55174c[_0x618d('0x6f')](_0xee4464);}})['then'](function(_0x2bb1){if(_0x2bb1){_0x5b3187=_0x2bb1['length'];if(!_0x19d5f2[_0x618d('0x3a')][_0x618d('0x41')]('nolimit')){_0xee4464[_0x618d('0x24')]=qs[_0x618d('0x24')](_0x19d5f2[_0x618d('0x3a')][_0x618d('0x24')]);_0xee4464['offset']=qs[_0x618d('0x22')](_0x19d5f2[_0x618d('0x3a')][_0x618d('0x22')]);}return _0x55174c[_0x618d('0x6f')](_0xee4464);}})[_0x618d('0x2b')](function(_0x4f2002){if(_0x4f2002){return _0x4f2002?{'count':_0x5b3187,'rows':_0x4f2002}:null;}})[_0x618d('0x2b')](respondWithResult(_0x9e59ad,null))[_0x618d('0x4d')](handleError(_0x9e59ad,null));};exports['addTeams']=function(_0x9780ac,_0x843f2,_0x34601e){var _0x19665e=_0x9780ac[_0x618d('0x54')][_0x618d('0x70')];return db[_0x618d('0x6e')][_0x618d('0x4b')]({'where':{'id':_0x19665e},'attributes':['id'],'include':[{'model':db[_0x618d('0x71')],'as':_0x618d('0x72'),'attributes':['id',_0x618d('0x31'),_0x618d('0x73'),_0x618d('0x74'),_0x618d('0x75')],'raw':!![]}]})[_0x618d('0x2b')](function(_0x5752a8){if(_0x5752a8){var _0x1c6dc6=_['flatMap'](_0x5752a8,function(_0xfa6e30){var _0x516bea=_0xfa6e30['get']({'plain':!![]});return _0x516bea[_0x618d('0x72')];});return db[_0x618d('0x35')][_0x618d('0x52')]({'where':{'id':_0x9780ac[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](function(_0x2d3083){return db['sequelize']['transaction'](function(_0x2ce868){return _0x2d3083[_0x618d('0x76')](_0x19665e,{'transaction':_0x2ce868})[_0x618d('0x2b')](function(){return BPromise['each'](_0x1c6dc6,function(_0x75ffb0){return db[_0x618d('0x63')][_0x618d('0x77')]({'where':{'UserId':_0x75ffb0['id'],'FaxQueueId':_0x9780ac[_0x618d('0x5f')]['id']},'transaction':_0x2ce868});});})[_0x618d('0x2b')](function(){_0x1c6dc6[_0x618d('0x78')](function(_0x3681fa){socket['emit'](_0x618d('0x79'),{'UserId':_0x3681fa['id'],'FaxQueueId':_0x2d3083['id']});});});});});}})[_0x618d('0x2b')](respondWithStatusCode(_0x843f2,null))[_0x618d('0x4d')](handleError(_0x843f2,null));};exports['removeTeams']=function(_0x44933a,_0x239209,_0x4c604){return db[_0x618d('0x6e')][_0x618d('0x4b')]({'where':{'id':_0x44933a['query'][_0x618d('0x70')]},'attributes':['id'],'include':[{'model':db[_0x618d('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x618d('0x2b')](handleEntityNotFound(_0x239209,null))[_0x618d('0x2b')](function(_0x2570aa){var _0x441882=_[_0x618d('0x34')](_0x2570aa,'id');var _0x1ce775=[];var _0x23fe2d=[];var _0xba3ebc=squel[_0x618d('0x7a')]();_0xba3ebc[_0x618d('0x7b')](_0x618d('0x7c'))[_0x618d('0x7d')]('team_has_fax_queues','tq')[_0x618d('0x7e')](_0x618d('0x7f'),'ut',_0x618d('0x80'))[_0x618d('0x47')](_0x618d('0x81'),_0x44933a[_0x618d('0x5f')]['id']);for(var _0x799d8c=0x0;_0x799d8c<_0x2570aa[_0x618d('0x40')];_0x799d8c+=0x1){let _0x52a8c3=_0x2570aa[_0x799d8c];for(var _0x55b7aa=0x0;_0x55b7aa<_0x52a8c3['Agents'][_0x618d('0x40')];_0x55b7aa+=0x1){let _0x48d32e=_0x52a8c3[_0x618d('0x72')][_0x55b7aa];var _0x221768=_0xba3ebc[_0x618d('0x82')]();_0x221768[_0x618d('0x47')](_0x618d('0x83'),_0x48d32e['id']);_0x23fe2d['push'](db['sequelize'][_0x618d('0x3a')](_0x221768[_0x618d('0x84')](),{'type':db['sequelize'][_0x618d('0x85')][_0x618d('0x86')]})[_0x618d('0x2b')](function(_0x5ba7af){if(_0x5ba7af[_0x618d('0x40')]===0x1){return _0x48d32e['id'];}else{var _0x480153=_[_0x618d('0x87')](_[_0x618d('0x34')](_0x5ba7af,'TeamId'),function(_0x52991d){return _[_0x618d('0x88')](_0x441882,_0x52991d);});if(_0x480153){return _0x48d32e['id'];}}}));}}return BPromise['all'](_0x23fe2d)[_0x618d('0x2b')](function(_0x2fc0f0){_0x1ce775=_(_0x1ce775)[_0x618d('0x89')](_0x2fc0f0)['compact']()['value']();return db[_0x618d('0x35')][_0x618d('0x52')]({'where':{'id':_0x44933a[_0x618d('0x5f')]['id']}})['then'](function(_0x15c010){return db[_0x618d('0x8a')][_0x618d('0x8b')](function(_0x471556){return _0x15c010[_0x618d('0x8c')](_0x44933a[_0x618d('0x3a')][_0x618d('0x70')],{'transaction':_0x471556})['then'](function(){if(!_['isEmpty'](_0x1ce775)){return _0x15c010[_0x618d('0x8d')](_0x1ce775,{'transaction':_0x471556});}})[_0x618d('0x2b')](function(){_0x1ce775[_0x618d('0x78')](function(_0x4ffb8b){socket[_0x618d('0x8e')](_0x618d('0x8f'),{'UserId':_0x4ffb8b,'FaxQueueId':_0x15c010['id']});});});});});});})[_0x618d('0x2b')](respondWithStatusCode(_0x239209,null))[_0x618d('0x4d')](handleError(_0x239209,null));};exports[_0x618d('0x90')]=function(_0x5af1c7,_0x400163,_0x316379){return db['FaxQueue'][_0x618d('0x52')]({'where':{'id':_0x5af1c7[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0x400163,null))[_0x618d('0x2b')](function(_0x198515){if(_0x198515){return _0x198515[_0x618d('0x90')](_0x5af1c7[_0x618d('0x54')][_0x618d('0x70')],_[_0x618d('0x91')](_0x5af1c7['body'],[_0x618d('0x70'),'id'])||{})[_0x618d('0x92')](function(_0x441aca){for(var _0x34bf59=0x0;_0x34bf59<_0x5af1c7[_0x618d('0x54')][_0x618d('0x70')]['length'];_0x34bf59+=0x1){socket[_0x618d('0x8e')]('userFaxQueue:save',{'UserId':Number(_0x5af1c7[_0x618d('0x54')]['ids'][_0x34bf59]),'FaxQueueId':Number(_0x5af1c7[_0x618d('0x5f')]['id'])});}return _0x441aca;});}})[_0x618d('0x2b')](respondWithResult(_0x400163,null))['catch'](handleError(_0x400163,null));};exports[_0x618d('0x8d')]=function(_0x5335af,_0x5c5a4a,_0x33e4d1){return db[_0x618d('0x35')]['find']({'where':{'id':_0x5335af['params']['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0x5c5a4a,null))['then'](function(_0x554355){if(_0x554355){return _0x554355[_0x618d('0x8d')](_0x5335af['query'][_0x618d('0x70')])[_0x618d('0x2b')](function(){if(_[_0x618d('0x93')](_0x5335af['query'][_0x618d('0x70')])){for(var _0x348d3c=0x0;_0x348d3c<_0x5335af[_0x618d('0x3a')]['ids'][_0x618d('0x40')];_0x348d3c+=0x1){socket[_0x618d('0x8e')]('userFaxQueue:remove',{'UserId':Number(_0x5335af[_0x618d('0x3a')][_0x618d('0x70')][_0x348d3c]),'FaxQueueId':Number(_0x5335af['params']['id'])});}}else{socket['emit'](_0x618d('0x8f'),{'UserId':Number(_0x5335af['query'][_0x618d('0x70')]),'FaxQueueId':Number(_0x5335af['params']['id'])});}});}})[_0x618d('0x2b')](respondWithStatusCode(_0x5c5a4a,null))[_0x618d('0x4d')](handleError(_0x5c5a4a,null));};exports[_0x618d('0x94')]=function(_0x11c603,_0x2918fc,_0x31b9bc){var _0x317618={};var _0x215cae={};var _0x29f8d8;var _0x539a4d;return db[_0x618d('0x35')]['findOne']({'where':{'id':_0x11c603[_0x618d('0x5f')]['id']}})[_0x618d('0x2b')](handleEntityNotFound(_0x2918fc,null))[_0x618d('0x2b')](function(_0x1bf01b){if(_0x1bf01b){_0x29f8d8=_0x1bf01b;_0x215cae[_0x618d('0x3c')]=_[_0x618d('0x4f')](db[_0x618d('0x71')][_0x618d('0x36')]);_0x215cae[_0x618d('0x3a')]=_[_0x618d('0x4f')](_0x11c603['query']);_0x215cae[_0x618d('0x3b')]=_[_0x618d('0x3e')](_0x215cae[_0x618d('0x3c')],_0x215cae[_0x618d('0x3a')]);_0x317618['attributes']=_['intersection'](_0x215cae['model'],qs[_0x618d('0x3f')](_0x11c603[_0x618d('0x3a')]['fields']));_0x317618[_0x618d('0x3d')]=_0x317618['attributes']['length']?_0x317618[_0x618d('0x3d')]:_0x215cae[_0x618d('0x3c')];_0x317618[_0x618d('0x64')]=qs[_0x618d('0x43')](_0x11c603[_0x618d('0x3a')][_0x618d('0x43')]);_0x317618[_0x618d('0x47')]=qs[_0x618d('0x3b')](_[_0x618d('0x44')](_0x11c603['query'],_0x215cae[_0x618d('0x3b')]));if(_0x11c603[_0x618d('0x3a')]['filter']){_0x317618[_0x618d('0x47')]=_[_0x618d('0x46')](_0x317618[_0x618d('0x47')],{'$or':_[_0x618d('0x34')](_0x317618['attributes'],function(_0x16981b){var _0x4b1b62={};_0x4b1b62[_0x16981b]={'$like':'%'+_0x11c603['query']['filter']+'%'};return _0x4b1b62;})});}_0x317618=_[_0x618d('0x46')]({},_0x317618,_0x11c603['options']);return _0x29f8d8[_0x618d('0x94')](_0x317618);}})[_0x618d('0x2b')](function(_0x344470){if(_0x344470){_0x539a4d=_0x344470['length'];if(!_0x11c603[_0x618d('0x3a')][_0x618d('0x41')](_0x618d('0x42'))){_0x317618['limit']=qs[_0x618d('0x24')](_0x11c603[_0x618d('0x3a')][_0x618d('0x24')]);_0x317618[_0x618d('0x22')]=qs['offset'](_0x11c603[_0x618d('0x3a')][_0x618d('0x22')]);}return _0x29f8d8[_0x618d('0x94')](_0x317618);}})['then'](function(_0x2ea878){if(_0x2ea878){return _0x2ea878?{'count':_0x539a4d,'rows':_0x2ea878}:null;}})[_0x618d('0x2b')](respondWithResult(_0x2918fc,null))[_0x618d('0x4d')](handleError(_0x2918fc,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index ddf010b..710a0e6 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 _0xd282=['update','remove','emit','hook','exports','../../mysqldb','FaxQueue','save'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xd282,0xfd));var _0x2d28=function(_0x34d8f7,_0x2abf6b){_0x34d8f7=_0x34d8f7-0x0;var _0x201f01=_0xd282[_0x34d8f7];return _0x201f01;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x2d28('0x0'))['db'][_0x2d28('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2d28('0x2'),'afterUpdate':_0x2d28('0x3'),'afterDestroy':_0x2d28('0x4')};function emitEvent(_0x1f8182){return function(_0x3259b1,_0x395eb6,_0x501f4c){FaxQueueEvents[_0x2d28('0x5')](_0x1f8182+':'+_0x3259b1['id'],_0x3259b1);FaxQueueEvents[_0x2d28('0x5')](_0x1f8182,_0x3259b1);_0x501f4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x2d28('0x6')](e,emitEvent(event));}}module[_0x2d28('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x5ab9=['emit','hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners','update','remove'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x5ab9,0x8b));var _0x95ab=function(_0xde0a7f,_0x33437f){_0xde0a7f=_0xde0a7f-0x0;var _0x1b5b69=_0x5ab9[_0xde0a7f];return _0x1b5b69;};'use strict';var EventEmitter=require(_0x95ab('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x95ab('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x95ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x95ab('0x3'),'afterDestroy':_0x95ab('0x4')};function emitEvent(_0x526f56){return function(_0x19b406,_0x280b73,_0x1f4260){FaxQueueEvents[_0x95ab('0x5')](_0x526f56+':'+_0x19b406['id'],_0x19b406);FaxQueueEvents[_0x95ab('0x5')](_0x526f56,_0x19b406);_0x1f4260(null);};}for(var e in events){if(events[_0x95ab('0x6')](e)){var event=events[e];FaxQueue[_0x95ab('0x7')](e,emitEvent(event));}}module[_0x95ab('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 0a938dd..37a7d6c 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 _0x8954=['rimraf','../../config/environment','exports','define','fax_queues','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x42650c,_0xc05ba5){var _0x3ba3dc=function(_0xba2022){while(--_0xba2022){_0x42650c['push'](_0x42650c['shift']());}};_0x3ba3dc(++_0xc05ba5);}(_0x8954,0x94));var _0x4895=function(_0xdde7a1,_0x442663){_0xdde7a1=_0xdde7a1-0x0;var _0x238939=_0x8954[_0xdde7a1];return _0x238939;};'use strict';var _=require(_0x4895('0x0'));var util=require('util');var logger=require(_0x4895('0x1'))(_0x4895('0x2'));var moment=require(_0x4895('0x3'));var BPromise=require(_0x4895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4895('0x5'));var rimraf=require(_0x4895('0x6'));var config=require(_0x4895('0x7'));var attributes=require('./faxQueue.attributes');module[_0x4895('0x8')]=function(_0xe4299e,_0x3d0235){return _0xe4299e[_0x4895('0x9')]('FaxQueue',attributes,{'tableName':_0x4895('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d9e=['../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x92979e,_0xc9d8f1){var _0x10a6f6=function(_0x45e5ae){while(--_0x45e5ae){_0x92979e['push'](_0x92979e['shift']());}};_0x10a6f6(++_0xc9d8f1);}(_0x3d9e,0xe5));var _0xe3d9=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x3d9e[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0xe3d9('0x0'));var util=require(_0xe3d9('0x1'));var logger=require(_0xe3d9('0x2'))(_0xe3d9('0x3'));var moment=require(_0xe3d9('0x4'));var BPromise=require(_0xe3d9('0x5'));var rp=require(_0xe3d9('0x6'));var fs=require('fs');var path=require(_0xe3d9('0x7'));var rimraf=require(_0xe3d9('0x8'));var config=require(_0xe3d9('0x9'));var attributes=require(_0xe3d9('0xa'));module[_0xe3d9('0xb')]=function(_0x2e27f2,_0x5d2565){return _0x2e27f2[_0xe3d9('0xc')]('FaxQueue',attributes,{'tableName':_0xe3d9('0xd'),'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 9de1e2f..ea987f4 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 _0x1d47=['client','http','defaults','localhost','redis','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','info','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc2ba3d,_0x41d05a){var _0x4960b7=function(_0x295b8b){while(--_0x295b8b){_0xc2ba3d['push'](_0xc2ba3d['shift']());}};_0x4960b7(++_0x41d05a);}(_0x1d47,0x99));var _0x71d4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1d47[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x71d4('0x0'));var util=require('util');var moment=require(_0x71d4('0x1'));var BPromise=require(_0x71d4('0x2'));var rs=require(_0x71d4('0x3'));var fs=require('fs');var Redis=require(_0x71d4('0x4'));var db=require(_0x71d4('0x5'))['db'];var utils=require(_0x71d4('0x6'));var logger=require(_0x71d4('0x7'))(_0x71d4('0x8'));var config=require(_0x71d4('0x9'));var jayson=require(_0x71d4('0xa'));var client=jayson[_0x71d4('0xb')][_0x71d4('0xc')]({'port':0x232a});config['redis']=_[_0x71d4('0xd')](config['redis'],{'host':_0x71d4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71d4('0xf')]));require('./faxQueue.socket')[_0x71d4('0x10')](socket);function respondWithRpcPromise(_0x558e17,_0x10fc8a,_0x570308){return new BPromise(function(_0x49f284,_0x1156fc){return client[_0x71d4('0x11')](_0x558e17,_0x570308)['then'](function(_0x42336f){logger['info'](_0x71d4('0x12'),_0x10fc8a,_0x71d4('0x13'));logger[_0x71d4('0x14')](_0x71d4('0x15'),_0x10fc8a,'request\x20sent',JSON[_0x71d4('0x16')](_0x42336f));if(_0x42336f['error']){if(_0x42336f['error'][_0x71d4('0x17')]===0x1f4){logger[_0x71d4('0x18')](_0x71d4('0x12'),_0x10fc8a,_0x42336f[_0x71d4('0x18')]['message']);return _0x1156fc(_0x42336f['error']['message']);}logger[_0x71d4('0x18')]('FaxQueue,\x20%s,\x20%s',_0x10fc8a,_0x42336f[_0x71d4('0x18')][_0x71d4('0x19')]);return _0x49f284(_0x42336f[_0x71d4('0x18')][_0x71d4('0x19')]);}else{logger['info'](_0x71d4('0x12'),_0x10fc8a,_0x71d4('0x13'));_0x49f284(_0x42336f['result'][_0x71d4('0x19')]);}})[_0x71d4('0x1a')](function(_0x5439ae){logger[_0x71d4('0x18')](_0x71d4('0x12'),_0x10fc8a,_0x5439ae);_0x1156fc(_0x5439ae);});});}exports[_0x71d4('0x1b')]=function(_0x45fb2a){var _0x20a48d=this;return new Promise(function(_0x4c9ac0,_0x23e9ee){return db['FaxQueue'][_0x71d4('0x1c')]({'raw':_0x45fb2a[_0x71d4('0x1d')]?_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x1e')]===undefined?!![]:![]:!![],'where':_0x45fb2a[_0x71d4('0x1d')]?_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x1f')]||null:null,'attributes':_0x45fb2a['options']?_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x20')]||null:null,'limit':_0x45fb2a[_0x71d4('0x1d')]?_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x21')]||null:null,'include':_0x45fb2a['options']?_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x22')]?_[_0x71d4('0x23')](_0x45fb2a[_0x71d4('0x1d')][_0x71d4('0x22')],function(_0x5988a8){return{'model':db[_0x5988a8[_0x71d4('0x24')]],'as':_0x5988a8['as'],'attributes':_0x5988a8[_0x71d4('0x20')],'include':_0x5988a8['include']?_['map'](_0x5988a8['include'],function(_0x8d0f24){return{'model':db[_0x8d0f24[_0x71d4('0x24')]],'as':_0x8d0f24['as'],'attributes':_0x8d0f24[_0x71d4('0x20')],'include':_0x8d0f24[_0x71d4('0x22')]?_[_0x71d4('0x23')](_0x8d0f24['include'],function(_0x3e068e){return{'model':db[_0x3e068e['model']],'as':_0x3e068e['as'],'attributes':_0x3e068e[_0x71d4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x71d4('0x25')](function(_0xb40c51){logger[_0x71d4('0x26')](_0x71d4('0x1b'),_0x45fb2a);logger[_0x71d4('0x14')](_0x71d4('0x1b'),_0x45fb2a,JSON[_0x71d4('0x16')](_0xb40c51));_0x4c9ac0(_0xb40c51);})[_0x71d4('0x1a')](function(_0x1bc20e){logger[_0x71d4('0x18')](_0x71d4('0x1b'),_0x1bc20e['message'],_0x45fb2a);_0x23e9ee(_0x20a48d['error'](0x1f4,_0x1bc20e[_0x71d4('0x19')]));});});};exports[_0x71d4('0x27')]=function(_0x538baa){var _0x3c8d46=this;return new Promise(function(_0x3cfed4,_0x1c1a71){return db['FaxQueue'][_0x71d4('0x28')]({'raw':_0x538baa[_0x71d4('0x1d')]?_0x538baa[_0x71d4('0x1d')][_0x71d4('0x1e')]===undefined?!![]:![]:!![],'where':_0x538baa[_0x71d4('0x1d')]?_0x538baa[_0x71d4('0x1d')]['where']||null:null,'attributes':_0x538baa[_0x71d4('0x1d')]?_0x538baa[_0x71d4('0x1d')][_0x71d4('0x20')]||null:null,'include':_0x538baa[_0x71d4('0x1d')]?_0x538baa['options'][_0x71d4('0x22')]?_[_0x71d4('0x23')](_0x538baa['options'][_0x71d4('0x22')],function(_0x4f4ba9){return{'model':db[_0x4f4ba9[_0x71d4('0x24')]],'as':_0x4f4ba9['as'],'attributes':_0x4f4ba9[_0x71d4('0x20')],'include':_0x4f4ba9[_0x71d4('0x22')]?_['map'](_0x4f4ba9[_0x71d4('0x22')],function(_0x587f21){return{'model':db[_0x587f21[_0x71d4('0x24')]],'as':_0x587f21['as'],'attributes':_0x587f21[_0x71d4('0x20')],'include':_0x587f21[_0x71d4('0x22')]?_[_0x71d4('0x23')](_0x587f21[_0x71d4('0x22')],function(_0x3dace2){return{'model':db[_0x3dace2[_0x71d4('0x24')]],'as':_0x3dace2['as'],'attributes':_0x3dace2[_0x71d4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x71d4('0x25')](function(_0x418c90){logger['info']('ShowFaxQueue',_0x538baa);logger[_0x71d4('0x14')](_0x71d4('0x27'),_0x538baa,JSON[_0x71d4('0x16')](_0x418c90));_0x3cfed4(_0x418c90);})[_0x71d4('0x1a')](function(_0x373b66){logger[_0x71d4('0x18')](_0x71d4('0x27'),_0x373b66[_0x71d4('0x19')],_0x538baa);_0x1c1a71(_0x3c8d46[_0x71d4('0x18')](0x1f4,_0x373b66[_0x71d4('0x19')]));});});}; \ No newline at end of file +var _0xb2fc=['register','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetFaxQueue','FaxQueue','findAll','options','raw','include','map','model','attributes','then','debug','catch','where','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x13c440,_0xa53eb6){var _0x116c16=function(_0x48fc69){while(--_0x48fc69){_0x13c440['push'](_0x13c440['shift']());}};_0x116c16(++_0xa53eb6);}(_0xb2fc,0x136));var _0xcb2f=function(_0x22cf1d,_0x2e4fc0){_0x22cf1d=_0x22cf1d-0x0;var _0x5f431f=_0xb2fc[_0x22cf1d];return _0x5f431f;};'use strict';var _=require(_0xcb2f('0x0'));var util=require(_0xcb2f('0x1'));var moment=require(_0xcb2f('0x2'));var BPromise=require(_0xcb2f('0x3'));var rs=require(_0xcb2f('0x4'));var fs=require('fs');var Redis=require(_0xcb2f('0x5'));var db=require(_0xcb2f('0x6'))['db'];var utils=require(_0xcb2f('0x7'));var logger=require(_0xcb2f('0x8'))(_0xcb2f('0x9'));var config=require(_0xcb2f('0xa'));var jayson=require(_0xcb2f('0xb'));var client=jayson[_0xcb2f('0xc')][_0xcb2f('0xd')]({'port':0x232a});config[_0xcb2f('0xe')]=_[_0xcb2f('0xf')](config[_0xcb2f('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb2f('0x10'))(new Redis(config[_0xcb2f('0xe')]));require(_0xcb2f('0x11'))[_0xcb2f('0x12')](socket);function respondWithRpcPromise(_0x23de99,_0x237a70,_0x5174c2){return new BPromise(function(_0x2b2b71,_0x2eb531){return client['request'](_0x23de99,_0x5174c2)['then'](function(_0x1f0d3f){logger[_0xcb2f('0x13')](_0xcb2f('0x14'),_0x237a70,'request\x20sent');logger['debug'](_0xcb2f('0x15'),_0x237a70,'request\x20sent',JSON[_0xcb2f('0x16')](_0x1f0d3f));if(_0x1f0d3f['error']){if(_0x1f0d3f[_0xcb2f('0x17')]['code']===0x1f4){logger[_0xcb2f('0x17')](_0xcb2f('0x14'),_0x237a70,_0x1f0d3f[_0xcb2f('0x17')]['message']);return _0x2eb531(_0x1f0d3f[_0xcb2f('0x17')]['message']);}logger['error'](_0xcb2f('0x14'),_0x237a70,_0x1f0d3f[_0xcb2f('0x17')][_0xcb2f('0x18')]);return _0x2b2b71(_0x1f0d3f[_0xcb2f('0x17')][_0xcb2f('0x18')]);}else{logger[_0xcb2f('0x13')]('FaxQueue,\x20%s,\x20%s',_0x237a70,_0xcb2f('0x19'));_0x2b2b71(_0x1f0d3f[_0xcb2f('0x1a')][_0xcb2f('0x18')]);}})['catch'](function(_0x226b26){logger['error'](_0xcb2f('0x14'),_0x237a70,_0x226b26);_0x2eb531(_0x226b26);});});}exports[_0xcb2f('0x1b')]=function(_0x470035){var _0x3bdeab=this;return new Promise(function(_0x18cc52,_0x481ae8){return db[_0xcb2f('0x1c')][_0xcb2f('0x1d')]({'raw':_0x470035['options']?_0x470035[_0xcb2f('0x1e')][_0xcb2f('0x1f')]===undefined?!![]:![]:!![],'where':_0x470035[_0xcb2f('0x1e')]?_0x470035[_0xcb2f('0x1e')]['where']||null:null,'attributes':_0x470035[_0xcb2f('0x1e')]?_0x470035['options']['attributes']||null:null,'limit':_0x470035[_0xcb2f('0x1e')]?_0x470035['options']['limit']||null:null,'include':_0x470035[_0xcb2f('0x1e')]?_0x470035['options'][_0xcb2f('0x20')]?_['map'](_0x470035['options'][_0xcb2f('0x20')],function(_0x44c910){return{'model':db[_0x44c910['model']],'as':_0x44c910['as'],'attributes':_0x44c910['attributes'],'include':_0x44c910[_0xcb2f('0x20')]?_[_0xcb2f('0x21')](_0x44c910[_0xcb2f('0x20')],function(_0xbf4fd6){return{'model':db[_0xbf4fd6[_0xcb2f('0x22')]],'as':_0xbf4fd6['as'],'attributes':_0xbf4fd6[_0xcb2f('0x23')],'include':_0xbf4fd6[_0xcb2f('0x20')]?_[_0xcb2f('0x21')](_0xbf4fd6[_0xcb2f('0x20')],function(_0x36f381){return{'model':db[_0x36f381['model']],'as':_0x36f381['as'],'attributes':_0x36f381[_0xcb2f('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcb2f('0x24')](function(_0x5be69a){logger[_0xcb2f('0x13')](_0xcb2f('0x1b'),_0x470035);logger[_0xcb2f('0x25')]('GetFaxQueue',_0x470035,JSON[_0xcb2f('0x16')](_0x5be69a));_0x18cc52(_0x5be69a);})[_0xcb2f('0x26')](function(_0x15b7c5){logger[_0xcb2f('0x17')](_0xcb2f('0x1b'),_0x15b7c5['message'],_0x470035);_0x481ae8(_0x3bdeab[_0xcb2f('0x17')](0x1f4,_0x15b7c5[_0xcb2f('0x18')]));});});};exports['ShowFaxQueue']=function(_0x4db63e){var _0x1cfe17=this;return new Promise(function(_0x2575e4,_0x2f0a8b){return db['FaxQueue']['find']({'raw':_0x4db63e[_0xcb2f('0x1e')]?_0x4db63e['options'][_0xcb2f('0x1f')]===undefined?!![]:![]:!![],'where':_0x4db63e[_0xcb2f('0x1e')]?_0x4db63e['options'][_0xcb2f('0x27')]||null:null,'attributes':_0x4db63e[_0xcb2f('0x1e')]?_0x4db63e[_0xcb2f('0x1e')][_0xcb2f('0x23')]||null:null,'include':_0x4db63e[_0xcb2f('0x1e')]?_0x4db63e[_0xcb2f('0x1e')][_0xcb2f('0x20')]?_['map'](_0x4db63e[_0xcb2f('0x1e')][_0xcb2f('0x20')],function(_0x1ab621){return{'model':db[_0x1ab621['model']],'as':_0x1ab621['as'],'attributes':_0x1ab621['attributes'],'include':_0x1ab621['include']?_[_0xcb2f('0x21')](_0x1ab621['include'],function(_0x150959){return{'model':db[_0x150959['model']],'as':_0x150959['as'],'attributes':_0x150959[_0xcb2f('0x23')],'include':_0x150959[_0xcb2f('0x20')]?_[_0xcb2f('0x21')](_0x150959[_0xcb2f('0x20')],function(_0x2d759d){return{'model':db[_0x2d759d['model']],'as':_0x2d759d['as'],'attributes':_0x2d759d[_0xcb2f('0x23')]};}):[]};}):[]};}):[]:[]})[_0xcb2f('0x24')](function(_0x5f4ea1){logger['info'](_0xcb2f('0x28'),_0x4db63e);logger[_0xcb2f('0x25')](_0xcb2f('0x28'),_0x4db63e,JSON[_0xcb2f('0x16')](_0x5f4ea1));_0x2575e4(_0x5f4ea1);})['catch'](function(_0xaefa11){logger[_0xcb2f('0x17')]('ShowFaxQueue',_0xaefa11[_0xcb2f('0x18')],_0x4db63e);_0x2f0a8b(_0x1cfe17[_0xcb2f('0x17')](0x1f4,_0xaefa11[_0xcb2f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 621f99a..ca9976e 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 _0x6fd5=['./faxQueue.events','remove','update','emit','removeListener','register','length','faxQueue:'];(function(_0x157363,_0x43e87b){var _0x25dd68=function(_0xfc7f6c){while(--_0xfc7f6c){_0x157363['push'](_0x157363['shift']());}};_0x25dd68(++_0x43e87b);}(_0x6fd5,0xf0));var _0x56fd=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6fd5[_0x4243a3];return _0x1b2a33;};'use strict';var FaxQueueEvents=require(_0x56fd('0x0'));var events=['save',_0x56fd('0x1'),_0x56fd('0x2')];function createListener(_0x2626a2,_0x2d9a4e){return function(_0xf5b2de){_0x2d9a4e[_0x56fd('0x3')](_0x2626a2,_0xf5b2de);};}function removeListener(_0x3aecd4,_0x5a397a){return function(){FaxQueueEvents[_0x56fd('0x4')](_0x3aecd4,_0x5a397a);};}exports[_0x56fd('0x5')]=function(_0x1ae776){for(var _0x649fcd=0x0,_0x29d85b=events[_0x56fd('0x6')];_0x649fcd<_0x29d85b;_0x649fcd++){var _0x26e641=events[_0x649fcd];var _0x48ede7=createListener(_0x56fd('0x7')+_0x26e641,_0x1ae776);FaxQueueEvents['on'](_0x26e641,_0x48ede7);}}; \ No newline at end of file +var _0x6f58=['register','length','./faxQueue.events','save','remove','update'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x6f58,0xaa));var _0x86f5=function(_0x2d67bd,_0x4a9301){_0x2d67bd=_0x2d67bd-0x0;var _0x397280=_0x6f58[_0x2d67bd];return _0x397280;};'use strict';var FaxQueueEvents=require(_0x86f5('0x0'));var events=[_0x86f5('0x1'),_0x86f5('0x2'),_0x86f5('0x3')];function createListener(_0x332121,_0x5ab0e7){return function(_0x5e2c22){_0x5ab0e7['emit'](_0x332121,_0x5e2c22);};}function removeListener(_0x31e6f7,_0x27ac98){return function(){FaxQueueEvents['removeListener'](_0x31e6f7,_0x27ac98);};}exports[_0x86f5('0x4')]=function(_0xbf28d0){for(var _0x3bba85=0x0,_0x5149ad=events[_0x86f5('0x5')];_0x3bba85<_0x5149ad;_0x3bba85++){var _0x11933e=events[_0x3bba85];var _0x56910b=createListener('faxQueue:'+_0x11933e,_0xbf28d0);FaxQueueEvents['on'](_0x11933e,_0x56910b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d326456..d866516 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 _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0xa08526,_0xd2a376){var _0x2684eb=function(_0x2bfe3a){while(--_0x2bfe3a){_0xa08526['push'](_0xa08526['shift']());}};_0x2684eb(++_0xd2a376);}(_0xef17,0x136));var _0x7ef1=function(_0x5b9f02,_0x32d165){_0x5b9f02=_0x5b9f02-0x0;var _0xce60b9=_0xef17[_0x5b9f02];return _0xce60b9;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router; \ No newline at end of file +var _0x2c8f=['isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','delete','destroy','removeTeams','exports','util','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get'];(function(_0x5c3cbd,_0x5ddfcd){var _0xdf0617=function(_0x493009){while(--_0x493009){_0x5c3cbd['push'](_0x5c3cbd['shift']());}};_0xdf0617(++_0x5ddfcd);}(_0x2c8f,0x192));var _0xf2c8=function(_0x2d7089,_0x213af9){_0x2d7089=_0x2d7089-0x0;var _0x20ee25=_0x2c8f[_0x2d7089];return _0x20ee25;};'use strict';var multer=require('multer');var util=require(_0xf2c8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2c8('0x1')]();var fs_extra=require(_0xf2c8('0x2'));var auth=require(_0xf2c8('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2c8('0x4'));router[_0xf2c8('0x5')]('/',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x7')]);router[_0xf2c8('0x5')]('/describe',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x8')]);router[_0xf2c8('0x5')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xa')]);router['get'](_0xf2c8('0xb'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xc')]);router[_0xf2c8('0x5')](_0xf2c8('0xd'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xe')]);router[_0xf2c8('0x5')]('/:id/users',auth[_0xf2c8('0x6')](),controller['getAgents']);router[_0xf2c8('0xf')]('/',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x10')]);router[_0xf2c8('0xf')](_0xf2c8('0xd'),auth[_0xf2c8('0x6')](),controller['addTeams']);router[_0xf2c8('0xf')](_0xf2c8('0x11'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x12')]);router[_0xf2c8('0x13')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller['update']);router[_0xf2c8('0x14')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x15')]);router[_0xf2c8('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf2c8('0x16')]);router[_0xf2c8('0x14')](_0xf2c8('0x11'),auth[_0xf2c8('0x6')](),controller['removeAgents']);module[_0xf2c8('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 eb5ff32..31d8228 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 _0x4bcf=['STRING','DATE','moment','sequelize'];(function(_0x1934fc,_0x437669){var _0x4c2de0=function(_0x89358c){while(--_0x89358c){_0x1934fc['push'](_0x1934fc['shift']());}};_0x4c2de0(++_0x437669);}(_0x4bcf,0x116));var _0xf4bc=function(_0xc9b9f3,_0x4b96c4){_0xc9b9f3=_0xc9b9f3-0x0;var _0x2e4a9a=_0x4bcf[_0xc9b9f3];return _0x2e4a9a;};'use strict';var moment=require(_0xf4bc('0x0'));var Sequelize=require(_0xf4bc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xf4bc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf4bc('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf4bc('0x3')]},'exitAt':{'type':Sequelize[_0xf4bc('0x3')]},'reason':{'type':Sequelize[_0xf4bc('0x2')]}}; \ No newline at end of file +var _0x39e0=['exports','STRING','DATE'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x39e0,0x1c5));var _0x039e=function(_0x4552ae,_0x4783e3){_0x4552ae=_0x4552ae-0x0;var _0x4af521=_0x39e0[_0x4552ae];return _0x4af521;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x039e('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x039e('0x1')]},'joinAt':{'type':Sequelize[_0x039e('0x2')]},'leaveAt':{'type':Sequelize[_0x039e('0x2')]},'acceptAt':{'type':Sequelize[_0x039e('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x039e('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 33b3815..7f782d0 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 _0x0962=['type','VIRTUAL','options','includeAll','include','findAll','catch','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge'];(function(_0x5b94cd,_0x819fb7){var _0x540115=function(_0x604dd){while(--_0x604dd){_0x5b94cd['push'](_0x5b94cd['shift']());}};_0x540115(++_0x819fb7);}(_0x0962,0x198));var _0x2096=function(_0x6e337f,_0x1dd036){_0x6e337f=_0x6e337f-0x0;var _0x3345c0=_0x0962[_0x6e337f];return _0x3345c0;};'use strict';var emlformat=require(_0x2096('0x0'));var rimraf=require(_0x2096('0x1'));var zipdir=require(_0x2096('0x2'));var jsonpatch=require(_0x2096('0x3'));var rp=require('request-promise');var moment=require(_0x2096('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2096('0x5'));var path=require(_0x2096('0x6'));var sox=require(_0x2096('0x7'));var csv=require(_0x2096('0x8'));var ejs=require(_0x2096('0x9'));var fs=require('fs');var fs_extra=require(_0x2096('0xa'));var _=require(_0x2096('0xb'));var squel=require(_0x2096('0xc'));var crypto=require('crypto');var jsforce=require(_0x2096('0xd'));var deskjs=require(_0x2096('0xe'));var toCsv=require(_0x2096('0x8'));var querystring=require(_0x2096('0xf'));var Papa=require(_0x2096('0x10'));var Redis=require(_0x2096('0x11'));var authService=require(_0x2096('0x12'));var qs=require(_0x2096('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2096('0x14'));var logger=require(_0x2096('0x15'))('api');var utils=require(_0x2096('0x16'));var config=require(_0x2096('0x17'));var licenseUtil=require(_0x2096('0x18'));var db=require(_0x2096('0x19'))['db'];function respondWithStatusCode(_0x5d351e,_0x541213){_0x541213=_0x541213||0xcc;return function(_0x404e2b){if(_0x404e2b){return _0x5d351e[_0x2096('0x1a')](_0x541213);}return _0x5d351e[_0x2096('0x1b')](_0x541213)['end']();};}function respondWithResult(_0x14bf54,_0x45b7ec){_0x45b7ec=_0x45b7ec||0xc8;return function(_0x420c57){if(_0x420c57){return _0x14bf54['status'](_0x45b7ec)[_0x2096('0x1c')](_0x420c57);}};}function respondWithFilteredResult(_0x37dcd0,_0x2c6e88){return function(_0x305ada){if(_0x305ada){var _0x5b151a=typeof _0x2c6e88[_0x2096('0x1d')]===_0x2096('0x1e')&&typeof _0x2c6e88[_0x2096('0x1f')]==='undefined';var _0x479ba2=_0x305ada[_0x2096('0x20')];var _0x22c478=_0x5b151a?0x0:_0x2c6e88['offset'];var _0xd7e9e0=_0x5b151a?_0x305ada[_0x2096('0x20')]:_0x2c6e88[_0x2096('0x1d')]+_0x2c6e88['limit'];var _0x2a9f62;if(_0xd7e9e0>=_0x479ba2){_0xd7e9e0=_0x479ba2;_0x2a9f62=0xc8;}else{_0x2a9f62=0xce;}_0x37dcd0['status'](_0x2a9f62);return _0x37dcd0[_0x2096('0x21')](_0x2096('0x22'),_0x22c478+'-'+_0xd7e9e0+'/'+_0x479ba2)[_0x2096('0x1c')](_0x305ada);}return null;};}function patchUpdates(_0x12fe63){return function(_0x3f4d7d){try{jsonpatch[_0x2096('0x23')](_0x3f4d7d,_0x12fe63,!![]);}catch(_0x2125ad){return BPromise[_0x2096('0x24')](_0x2125ad);}return _0x3f4d7d[_0x2096('0x25')]();};}function saveUpdates(_0x58c61c,_0x40f28c){return function(_0x4b74e2){if(_0x4b74e2){return _0x4b74e2[_0x2096('0x26')](_0x58c61c)['then'](function(_0x5dfdd5){return _0x5dfdd5;});}return null;};}function removeEntity(_0x362414,_0x686f15){return function(_0x3c3d9c){if(_0x3c3d9c){return _0x3c3d9c[_0x2096('0x27')]()[_0x2096('0x28')](function(){_0x362414[_0x2096('0x1b')](0xcc)[_0x2096('0x29')]();});}};}function handleEntityNotFound(_0xe72b8a,_0x285ff1){return function(_0x2e2c03){if(!_0x2e2c03){_0xe72b8a[_0x2096('0x1a')](0x194);}return _0x2e2c03;};}function handleError(_0xd70ed4,_0x587afa){_0x587afa=_0x587afa||0x1f4;return function(_0x4a78e7){logger[_0x2096('0x2a')](_0x4a78e7[_0x2096('0x2b')]);if(_0x4a78e7[_0x2096('0x2c')]){delete _0x4a78e7[_0x2096('0x2c')];}_0xd70ed4[_0x2096('0x1b')](_0x587afa)[_0x2096('0x2d')](_0x4a78e7);};}exports[_0x2096('0x2e')]=function(_0x1e980c,_0x73b7b4){var _0x56e019={},_0x1524de={},_0x393ef1={'count':0x0,'rows':[]};var _0x77692b=_[_0x2096('0x2f')](db[_0x2096('0x30')][_0x2096('0x31')],function(_0x1a0ace){return{'name':_0x1a0ace[_0x2096('0x32')],'type':_0x1a0ace['type'][_0x2096('0x33')]};});_0x1524de[_0x2096('0x34')]=_['map'](_0x77692b,_0x2096('0x2c'));_0x1524de[_0x2096('0x35')]=_[_0x2096('0x36')](_0x1e980c[_0x2096('0x35')]);_0x1524de[_0x2096('0x37')]=_[_0x2096('0x38')](_0x1524de[_0x2096('0x34')],_0x1524de[_0x2096('0x35')]);_0x56e019['attributes']=_[_0x2096('0x38')](_0x1524de[_0x2096('0x34')],qs['fields'](_0x1e980c[_0x2096('0x35')]['fields']));_0x56e019['attributes']=_0x56e019[_0x2096('0x39')][_0x2096('0x3a')]?_0x56e019[_0x2096('0x39')]:_0x1524de[_0x2096('0x34')];if(!_0x1e980c['query']['hasOwnProperty'](_0x2096('0x3b'))){_0x56e019[_0x2096('0x1f')]=qs[_0x2096('0x1f')](_0x1e980c[_0x2096('0x35')]['limit']);_0x56e019['offset']=qs[_0x2096('0x1d')](_0x1e980c[_0x2096('0x35')]['offset']);}_0x56e019[_0x2096('0x3c')]=qs[_0x2096('0x3d')](_0x1e980c['query'][_0x2096('0x3d')]);_0x56e019['where']=qs['filters'](_[_0x2096('0x3e')](_0x1e980c['query'],_0x1524de[_0x2096('0x37')]),_0x77692b);if(_0x1e980c['query'][_0x2096('0x3f')]){_0x56e019[_0x2096('0x40')]=_[_0x2096('0x41')](_0x56e019[_0x2096('0x40')],{'$or':_[_0x2096('0x2f')](_0x77692b,function(_0x2f226a){if(_0x2f226a[_0x2096('0x42')]!==_0x2096('0x43')){var _0x1072af={};_0x1072af[_0x2f226a[_0x2096('0x2c')]]={'$like':'%'+_0x1e980c[_0x2096('0x35')][_0x2096('0x3f')]+'%'};return _0x1072af;}})});}_0x56e019=_['merge']({},_0x56e019,_0x1e980c[_0x2096('0x44')]);var _0x4d7ec5={'where':_0x56e019[_0x2096('0x40')]};return db[_0x2096('0x30')][_0x2096('0x20')](_0x4d7ec5)[_0x2096('0x28')](function(_0x3ebe73){_0x393ef1[_0x2096('0x20')]=_0x3ebe73;if(_0x1e980c[_0x2096('0x35')][_0x2096('0x45')]){_0x56e019[_0x2096('0x46')]=[{'all':!![]}];}return db[_0x2096('0x30')][_0x2096('0x47')](_0x56e019);})['then'](function(_0x38efd0){_0x393ef1['rows']=_0x38efd0;return _0x393ef1;})[_0x2096('0x28')](respondWithFilteredResult(_0x73b7b4,_0x56e019))[_0x2096('0x48')](handleError(_0x73b7b4,null));};exports['show']=function(_0x492116,_0x3bd152){var _0x167b97={'raw':!![],'where':{'id':_0x492116[_0x2096('0x49')]['id']}},_0x52b4dc={};_0x52b4dc[_0x2096('0x34')]=_[_0x2096('0x36')](db[_0x2096('0x30')][_0x2096('0x31')]);_0x52b4dc[_0x2096('0x35')]=_['keys'](_0x492116[_0x2096('0x35')]);_0x52b4dc[_0x2096('0x37')]=_[_0x2096('0x38')](_0x52b4dc['model'],_0x52b4dc[_0x2096('0x35')]);_0x167b97[_0x2096('0x39')]=_[_0x2096('0x38')](_0x52b4dc['model'],qs[_0x2096('0x4a')](_0x492116[_0x2096('0x35')]['fields']));_0x167b97[_0x2096('0x39')]=_0x167b97[_0x2096('0x39')][_0x2096('0x3a')]?_0x167b97[_0x2096('0x39')]:_0x52b4dc['model'];if(_0x492116['query'][_0x2096('0x45')]){_0x167b97['include']=[{'all':!![]}];}_0x167b97=_['merge']({},_0x167b97,_0x492116['options']);return db[_0x2096('0x30')][_0x2096('0x4b')](_0x167b97)[_0x2096('0x28')](handleEntityNotFound(_0x3bd152,null))[_0x2096('0x28')](respondWithResult(_0x3bd152,null))['catch'](handleError(_0x3bd152,null));};exports['create']=function(_0x18b972,_0x300e02){return db[_0x2096('0x30')][_0x2096('0x4c')](_0x18b972[_0x2096('0x4d')],{})[_0x2096('0x28')](respondWithResult(_0x300e02,0xc9))['catch'](handleError(_0x300e02,null));};exports['update']=function(_0x1e7dea,_0x2ed29c){if(_0x1e7dea[_0x2096('0x4d')]['id']){delete _0x1e7dea[_0x2096('0x4d')]['id'];}return db[_0x2096('0x30')]['find']({'where':{'id':_0x1e7dea['params']['id']}})[_0x2096('0x28')](handleEntityNotFound(_0x2ed29c,null))[_0x2096('0x28')](saveUpdates(_0x1e7dea['body'],null))[_0x2096('0x28')](respondWithResult(_0x2ed29c,null))[_0x2096('0x48')](handleError(_0x2ed29c,null));};exports[_0x2096('0x27')]=function(_0x58a25d,_0x5e0c64){return db['FaxQueueReport'][_0x2096('0x4b')]({'where':{'id':_0x58a25d[_0x2096('0x49')]['id']}})[_0x2096('0x28')](handleEntityNotFound(_0x5e0c64,null))[_0x2096('0x28')](removeEntity(_0x5e0c64,null))[_0x2096('0x48')](handleError(_0x5e0c64,null));};exports[_0x2096('0x4e')]=function(_0x542915,_0x2aff64){return db[_0x2096('0x30')]['describe']()['then'](respondWithResult(_0x2aff64,null))[_0x2096('0x48')](handleError(_0x2aff64,null));}; \ No newline at end of file +var _0x0439=['intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x1c3578,_0x1b1406){var _0x17b17a=function(_0x34e46f){while(--_0x34e46f){_0x1c3578['push'](_0x1c3578['shift']());}};_0x17b17a(++_0x1b1406);}(_0x0439,0xdd));var _0x9043=function(_0x29aca7,_0x21c650){_0x29aca7=_0x29aca7-0x0;var _0x1db0a0=_0x0439[_0x29aca7];return _0x1db0a0;};'use strict';var emlformat=require(_0x9043('0x0'));var rimraf=require(_0x9043('0x1'));var zipdir=require(_0x9043('0x2'));var jsonpatch=require(_0x9043('0x3'));var rp=require(_0x9043('0x4'));var moment=require(_0x9043('0x5'));var BPromise=require(_0x9043('0x6'));var Mustache=require('mustache');var util=require(_0x9043('0x7'));var path=require(_0x9043('0x8'));var sox=require(_0x9043('0x9'));var csv=require('to-csv');var ejs=require(_0x9043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9043('0xb'));var crypto=require(_0x9043('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9043('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9043('0xe'));var Papa=require(_0x9043('0xf'));var Redis=require('ioredis');var authService=require(_0x9043('0x10'));var qs=require(_0x9043('0x11'));var as=require(_0x9043('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9043('0x13'));var utils=require(_0x9043('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9043('0x15'));var db=require(_0x9043('0x16'))['db'];function respondWithStatusCode(_0x3d8d67,_0x2bf58d){_0x2bf58d=_0x2bf58d||0xcc;return function(_0xcd2bf1){if(_0xcd2bf1){return _0x3d8d67[_0x9043('0x17')](_0x2bf58d);}return _0x3d8d67['status'](_0x2bf58d)[_0x9043('0x18')]();};}function respondWithResult(_0xf3f958,_0x48b142){_0x48b142=_0x48b142||0xc8;return function(_0x18f916){if(_0x18f916){return _0xf3f958[_0x9043('0x19')](_0x48b142)['json'](_0x18f916);}};}function respondWithFilteredResult(_0x37eca8,_0x1c2473){return function(_0x3aaee1){if(_0x3aaee1){var _0x2b3c2d=typeof _0x1c2473[_0x9043('0x1a')]===_0x9043('0x1b')&&typeof _0x1c2473[_0x9043('0x1c')]===_0x9043('0x1b');var _0x21f330=_0x3aaee1[_0x9043('0x1d')];var _0x51823a=_0x2b3c2d?0x0:_0x1c2473['offset'];var _0x47fbdc=_0x2b3c2d?_0x3aaee1[_0x9043('0x1d')]:_0x1c2473[_0x9043('0x1a')]+_0x1c2473[_0x9043('0x1c')];var _0x43bbd4;if(_0x47fbdc>=_0x21f330){_0x47fbdc=_0x21f330;_0x43bbd4=0xc8;}else{_0x43bbd4=0xce;}_0x37eca8['status'](_0x43bbd4);return _0x37eca8[_0x9043('0x1e')]('Content-Range',_0x51823a+'-'+_0x47fbdc+'/'+_0x21f330)['json'](_0x3aaee1);}return null;};}function patchUpdates(_0x161511){return function(_0x3572d5){try{jsonpatch[_0x9043('0x1f')](_0x3572d5,_0x161511,!![]);}catch(_0x820f8c){return BPromise[_0x9043('0x20')](_0x820f8c);}return _0x3572d5[_0x9043('0x21')]();};}function saveUpdates(_0x3a82b4,_0x366695){return function(_0x5a3f7a){if(_0x5a3f7a){return _0x5a3f7a[_0x9043('0x22')](_0x3a82b4)[_0x9043('0x23')](function(_0x30930c){return _0x30930c;});}return null;};}function removeEntity(_0x5506bf,_0x18727f){return function(_0x3c4fa4){if(_0x3c4fa4){return _0x3c4fa4[_0x9043('0x24')]()[_0x9043('0x23')](function(){_0x5506bf[_0x9043('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16caf2,_0xca0bb1){return function(_0x6d23af){if(!_0x6d23af){_0x16caf2[_0x9043('0x17')](0x194);}return _0x6d23af;};}function handleError(_0x2003c3,_0x13e8dd){_0x13e8dd=_0x13e8dd||0x1f4;return function(_0x5f4975){logger[_0x9043('0x25')](_0x5f4975['stack']);if(_0x5f4975[_0x9043('0x26')]){delete _0x5f4975[_0x9043('0x26')];}_0x2003c3[_0x9043('0x19')](_0x13e8dd)[_0x9043('0x27')](_0x5f4975);};}exports['index']=function(_0xc92d75,_0x2e12b1){var _0x14cf80={},_0x228d7f={},_0x37ecc2={'count':0x0,'rows':[]};var _0x590357=_[_0x9043('0x28')](db[_0x9043('0x29')][_0x9043('0x2a')],function(_0x4e4363){return{'name':_0x4e4363[_0x9043('0x2b')],'type':_0x4e4363[_0x9043('0x2c')]['key']};});_0x228d7f[_0x9043('0x2d')]=_[_0x9043('0x28')](_0x590357,'name');_0x228d7f[_0x9043('0x2e')]=_[_0x9043('0x2f')](_0xc92d75[_0x9043('0x2e')]);_0x228d7f[_0x9043('0x30')]=_['intersection'](_0x228d7f[_0x9043('0x2d')],_0x228d7f[_0x9043('0x2e')]);_0x14cf80['attributes']=_['intersection'](_0x228d7f[_0x9043('0x2d')],qs[_0x9043('0x31')](_0xc92d75[_0x9043('0x2e')][_0x9043('0x31')]));_0x14cf80[_0x9043('0x32')]=_0x14cf80[_0x9043('0x32')]['length']?_0x14cf80['attributes']:_0x228d7f[_0x9043('0x2d')];if(!_0xc92d75[_0x9043('0x2e')][_0x9043('0x33')](_0x9043('0x34'))){_0x14cf80[_0x9043('0x1c')]=qs[_0x9043('0x1c')](_0xc92d75[_0x9043('0x2e')]['limit']);_0x14cf80[_0x9043('0x1a')]=qs['offset'](_0xc92d75[_0x9043('0x2e')]['offset']);}_0x14cf80[_0x9043('0x35')]=qs[_0x9043('0x36')](_0xc92d75['query']['sort']);_0x14cf80[_0x9043('0x37')]=qs[_0x9043('0x30')](_[_0x9043('0x38')](_0xc92d75[_0x9043('0x2e')],_0x228d7f[_0x9043('0x30')]),_0x590357);if(_0xc92d75[_0x9043('0x2e')][_0x9043('0x39')]){_0x14cf80[_0x9043('0x37')]=_[_0x9043('0x3a')](_0x14cf80[_0x9043('0x37')],{'$or':_[_0x9043('0x28')](_0x590357,function(_0x19b858){if(_0x19b858['type']!==_0x9043('0x3b')){var _0x5187bf={};_0x5187bf[_0x19b858[_0x9043('0x26')]]={'$like':'%'+_0xc92d75[_0x9043('0x2e')]['filter']+'%'};return _0x5187bf;}})});}_0x14cf80=_[_0x9043('0x3a')]({},_0x14cf80,_0xc92d75[_0x9043('0x3c')]);var _0x1dc9cf={'where':_0x14cf80['where']};return db[_0x9043('0x29')][_0x9043('0x1d')](_0x1dc9cf)[_0x9043('0x23')](function(_0x3cdaf9){_0x37ecc2[_0x9043('0x1d')]=_0x3cdaf9;if(_0xc92d75[_0x9043('0x2e')][_0x9043('0x3d')]){_0x14cf80[_0x9043('0x3e')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x9043('0x3f')](_0x14cf80);})['then'](function(_0x56a084){_0x37ecc2[_0x9043('0x40')]=_0x56a084;return _0x37ecc2;})['then'](respondWithFilteredResult(_0x2e12b1,_0x14cf80))[_0x9043('0x41')](handleError(_0x2e12b1,null));};exports['show']=function(_0x392551,_0x3a75e0){var _0x2c479d={'raw':!![],'where':{'id':_0x392551[_0x9043('0x42')]['id']}},_0x38028b={};_0x38028b[_0x9043('0x2d')]=_['keys'](db[_0x9043('0x29')][_0x9043('0x2a')]);_0x38028b[_0x9043('0x2e')]=_['keys'](_0x392551[_0x9043('0x2e')]);_0x38028b[_0x9043('0x30')]=_['intersection'](_0x38028b[_0x9043('0x2d')],_0x38028b['query']);_0x2c479d[_0x9043('0x32')]=_[_0x9043('0x43')](_0x38028b['model'],qs['fields'](_0x392551[_0x9043('0x2e')][_0x9043('0x31')]));_0x2c479d[_0x9043('0x32')]=_0x2c479d[_0x9043('0x32')]['length']?_0x2c479d[_0x9043('0x32')]:_0x38028b[_0x9043('0x2d')];if(_0x392551['query']['includeAll']){_0x2c479d[_0x9043('0x3e')]=[{'all':!![]}];}_0x2c479d=_[_0x9043('0x3a')]({},_0x2c479d,_0x392551['options']);return db[_0x9043('0x29')][_0x9043('0x44')](_0x2c479d)[_0x9043('0x23')](handleEntityNotFound(_0x3a75e0,null))[_0x9043('0x23')](respondWithResult(_0x3a75e0,null))['catch'](handleError(_0x3a75e0,null));};exports[_0x9043('0x45')]=function(_0x172872,_0x5d7e24){return db[_0x9043('0x29')][_0x9043('0x45')](_0x172872[_0x9043('0x46')],{})[_0x9043('0x23')](respondWithResult(_0x5d7e24,0xc9))[_0x9043('0x41')](handleError(_0x5d7e24,null));};exports[_0x9043('0x22')]=function(_0x6f909a,_0x370821){if(_0x6f909a[_0x9043('0x46')]['id']){delete _0x6f909a[_0x9043('0x46')]['id'];}return db[_0x9043('0x29')][_0x9043('0x44')]({'where':{'id':_0x6f909a[_0x9043('0x42')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x370821,null))['then'](saveUpdates(_0x6f909a[_0x9043('0x46')],null))[_0x9043('0x23')](respondWithResult(_0x370821,null))['catch'](handleError(_0x370821,null));};exports[_0x9043('0x24')]=function(_0x188695,_0x385fb6){return db['FaxQueueReport']['find']({'where':{'id':_0x188695[_0x9043('0x42')]['id']}})[_0x9043('0x23')](handleEntityNotFound(_0x385fb6,null))[_0x9043('0x23')](removeEntity(_0x385fb6,null))[_0x9043('0x41')](handleError(_0x385fb6,null));};exports['describe']=function(_0x13127e,_0x425205){return db[_0x9043('0x29')][_0x9043('0x47')]()['then'](respondWithResult(_0x425205,null))[_0x9043('0x41')](handleError(_0x425205,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index d849318..685071c 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x2a1044,_0x145063){var _0x14b7c6=function(_0x3dbbb){while(--_0x3dbbb){_0x2a1044['push'](_0x2a1044['shift']());}};_0x14b7c6(++_0x145063);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x7fbe[_0x50cfc3];return _0x5c11ef;};'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':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'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(_0x3c358c,_0x226141){var _0x2fb4dd=function(_0x288100){while(--_0x288100){_0x3c358c['push'](_0x3c358c['shift']());}};_0x2fb4dd(++_0x226141);}(_0x1261,0x144));var _0x1126=function(_0x3a7e01,_0x51204c){_0x3a7e01=_0x3a7e01-0x0;var _0x5b8398=_0x1261[_0x3a7e01];return _0x5b8398;};'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 f0d4d69..e772951 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 _0xb320=['FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xb320,0xa9));var _0x0b32=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xb320[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require('lodash');var util=require(_0x0b32('0x0'));var moment=require('moment');var BPromise=require(_0x0b32('0x1'));var rs=require(_0x0b32('0x2'));var fs=require('fs');var Redis=require(_0x0b32('0x3'));var db=require(_0x0b32('0x4'))['db'];var utils=require(_0x0b32('0x5'));var logger=require(_0x0b32('0x6'))(_0x0b32('0x7'));var config=require(_0x0b32('0x8'));var jayson=require(_0x0b32('0x9'));var client=jayson[_0x0b32('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x561033,_0x5176db,_0x141586){return new BPromise(function(_0xb339e3,_0x5d91c8){return client['request'](_0x561033,_0x141586)[_0x0b32('0xb')](function(_0x1c0682){logger[_0x0b32('0xc')](_0x0b32('0xd'),_0x5176db,'request\x20sent');logger[_0x0b32('0xe')](_0x0b32('0xf'),_0x5176db,_0x0b32('0x10'),JSON[_0x0b32('0x11')](_0x1c0682));if(_0x1c0682[_0x0b32('0x12')]){if(_0x1c0682['error'][_0x0b32('0x13')]===0x1f4){logger[_0x0b32('0x12')](_0x0b32('0xd'),_0x5176db,_0x1c0682[_0x0b32('0x12')][_0x0b32('0x14')]);return _0x5d91c8(_0x1c0682[_0x0b32('0x12')]['message']);}logger[_0x0b32('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5176db,_0x1c0682['error'][_0x0b32('0x14')]);return _0xb339e3(_0x1c0682[_0x0b32('0x12')]['message']);}else{logger[_0x0b32('0xc')](_0x0b32('0xd'),_0x5176db,_0x0b32('0x10'));_0xb339e3(_0x1c0682[_0x0b32('0x15')][_0x0b32('0x14')]);}})[_0x0b32('0x16')](function(_0xddfc7){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5176db,_0xddfc7);_0x5d91c8(_0xddfc7);});});}exports['CreateFaxQueueReport']=function(_0x1d005e){var _0x546a3e=this;return new Promise(function(_0x5d8252,_0x70ab9f){return db[_0x0b32('0x17')][_0x0b32('0x18')](_0x1d005e[_0x0b32('0x19')],{'raw':_0x1d005e[_0x0b32('0x1a')]?_0x1d005e['options'][_0x0b32('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x47a368){logger[_0x0b32('0xc')](_0x0b32('0x1c'),_0x1d005e);logger['debug'](_0x0b32('0x1c'),_0x1d005e,JSON[_0x0b32('0x11')](_0x47a368));_0x5d8252(_0x47a368);})[_0x0b32('0x16')](function(_0xbfd31b){logger[_0x0b32('0x12')](_0x0b32('0x1c'),_0xbfd31b[_0x0b32('0x14')],_0x1d005e);_0x70ab9f(_0x546a3e[_0x0b32('0x12')](0x1f4,_0xbfd31b[_0x0b32('0x14')]));});});};exports[_0x0b32('0x1d')]=function(_0x1c24e8){var _0xd6e04a=this;return new Promise(function(_0xa0edc,_0x2afaa3){return db['FaxQueueReport'][_0x0b32('0x1e')](_0x1c24e8[_0x0b32('0x19')],{'raw':_0x1c24e8['options']?_0x1c24e8[_0x0b32('0x1a')][_0x0b32('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c24e8[_0x0b32('0x1a')]?_0x1c24e8[_0x0b32('0x1a')][_0x0b32('0x1f')]||null:null,'attributes':_0x1c24e8[_0x0b32('0x1a')]?_0x1c24e8[_0x0b32('0x1a')]['attributes']||null:null,'limit':_0x1c24e8[_0x0b32('0x1a')]?_0x1c24e8['options']['limit']||null:null})[_0x0b32('0xb')](function(_0x72a823){logger['info']('UpdateFaxQueueReport',_0x1c24e8);logger['debug'](_0x0b32('0x1d'),_0x1c24e8,JSON['stringify'](_0x72a823));_0xa0edc(_0x72a823);})[_0x0b32('0x16')](function(_0x4545f3){logger[_0x0b32('0x12')](_0x0b32('0x1d'),_0x4545f3['message'],_0x1c24e8);_0x2afaa3(_0xd6e04a[_0x0b32('0x12')](0x1f4,_0x4545f3['message']));});});}; \ No newline at end of file +var _0xfa76=['catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','update','body','where','attributes','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x204db8,_0x2d2d6d){var _0x30a01e=function(_0x159c71){while(--_0x159c71){_0x204db8['push'](_0x204db8['shift']());}};_0x30a01e(++_0x2d2d6d);}(_0xfa76,0x1d2));var _0x6fa7=function(_0xc0d6bb,_0xa8ddaa){_0xc0d6bb=_0xc0d6bb-0x0;var _0x2eb24e=_0xfa76[_0xc0d6bb];return _0x2eb24e;};'use strict';var _=require(_0x6fa7('0x0'));var util=require('util');var moment=require(_0x6fa7('0x1'));var BPromise=require(_0x6fa7('0x2'));var rs=require(_0x6fa7('0x3'));var fs=require('fs');var Redis=require(_0x6fa7('0x4'));var db=require(_0x6fa7('0x5'))['db'];var utils=require(_0x6fa7('0x6'));var logger=require(_0x6fa7('0x7'))(_0x6fa7('0x8'));var config=require(_0x6fa7('0x9'));var jayson=require(_0x6fa7('0xa'));var client=jayson[_0x6fa7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43424b,_0x217771,_0x3e3f08){return new BPromise(function(_0xf5a70e,_0x3bb73a){return client[_0x6fa7('0xc')](_0x43424b,_0x3e3f08)[_0x6fa7('0xd')](function(_0x2adf1c){logger[_0x6fa7('0xe')](_0x6fa7('0xf'),_0x217771,_0x6fa7('0x10'));logger[_0x6fa7('0x11')](_0x6fa7('0x12'),_0x217771,_0x6fa7('0x10'),JSON[_0x6fa7('0x13')](_0x2adf1c));if(_0x2adf1c[_0x6fa7('0x14')]){if(_0x2adf1c[_0x6fa7('0x14')][_0x6fa7('0x15')]===0x1f4){logger[_0x6fa7('0x14')](_0x6fa7('0xf'),_0x217771,_0x2adf1c[_0x6fa7('0x14')]['message']);return _0x3bb73a(_0x2adf1c[_0x6fa7('0x14')][_0x6fa7('0x16')]);}logger[_0x6fa7('0x14')](_0x6fa7('0xf'),_0x217771,_0x2adf1c[_0x6fa7('0x14')][_0x6fa7('0x16')]);return _0xf5a70e(_0x2adf1c['error'][_0x6fa7('0x16')]);}else{logger[_0x6fa7('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x217771,_0x6fa7('0x10'));_0xf5a70e(_0x2adf1c[_0x6fa7('0x17')][_0x6fa7('0x16')]);}})[_0x6fa7('0x18')](function(_0x31e7fc){logger[_0x6fa7('0x14')](_0x6fa7('0xf'),_0x217771,_0x31e7fc);_0x3bb73a(_0x31e7fc);});});}exports['CreateFaxQueueReport']=function(_0x550c67){var _0x23e0e1=this;return new Promise(function(_0x3260e7,_0x11ad03){return db[_0x6fa7('0x19')][_0x6fa7('0x1a')](_0x550c67['body'],{'raw':_0x550c67[_0x6fa7('0x1b')]?_0x550c67['options'][_0x6fa7('0x1c')]===undefined?!![]:![]:!![]})[_0x6fa7('0xd')](function(_0x189853){logger['info'](_0x6fa7('0x1d'),_0x550c67);logger['debug'](_0x6fa7('0x1d'),_0x550c67,JSON[_0x6fa7('0x13')](_0x189853));_0x3260e7(_0x189853);})[_0x6fa7('0x18')](function(_0x2145fe){logger[_0x6fa7('0x14')]('CreateFaxQueueReport',_0x2145fe[_0x6fa7('0x16')],_0x550c67);_0x11ad03(_0x23e0e1[_0x6fa7('0x14')](0x1f4,_0x2145fe[_0x6fa7('0x16')]));});});};exports['UpdateFaxQueueReport']=function(_0x59b4e8){var _0x307119=this;return new Promise(function(_0x106fa8,_0x27ddf){return db[_0x6fa7('0x19')][_0x6fa7('0x1e')](_0x59b4e8[_0x6fa7('0x1f')],{'raw':_0x59b4e8[_0x6fa7('0x1b')]?_0x59b4e8['options'][_0x6fa7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59b4e8[_0x6fa7('0x1b')]?_0x59b4e8[_0x6fa7('0x1b')][_0x6fa7('0x20')]||null:null,'attributes':_0x59b4e8[_0x6fa7('0x1b')]?_0x59b4e8['options'][_0x6fa7('0x21')]||null:null,'limit':_0x59b4e8[_0x6fa7('0x1b')]?_0x59b4e8[_0x6fa7('0x1b')]['limit']||null:null})[_0x6fa7('0xd')](function(_0x3a6d8d){logger[_0x6fa7('0xe')]('UpdateFaxQueueReport',_0x59b4e8);logger[_0x6fa7('0x11')](_0x6fa7('0x22'),_0x59b4e8,JSON[_0x6fa7('0x13')](_0x3a6d8d));_0x106fa8(_0x3a6d8d);})['catch'](function(_0x260773){logger[_0x6fa7('0x14')](_0x6fa7('0x22'),_0x260773['message'],_0x59b4e8);_0x27ddf(_0x307119[_0x6fa7('0x14')](0x1f4,_0x260773['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 5fe5262..ad14ee8 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 _0xfbe0=['create','put','update','delete','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x5079cb,_0x3f6150){var _0x301659=function(_0x4c499c){while(--_0x4c499c){_0x5079cb['push'](_0x5079cb['shift']());}};_0x301659(++_0x3f6150);}(_0xfbe0,0xee));var _0x0fbe=function(_0x4538aa,_0x2e7a4a){_0x4538aa=_0x4538aa-0x0;var _0xd85bfb=_0xfbe0[_0x4538aa];return _0xd85bfb;};'use strict';var multer=require(_0x0fbe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0fbe('0x1'));var express=require(_0x0fbe('0x2'));var router=express['Router']();var fs_extra=require(_0x0fbe('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0fbe('0x4'));var config=require(_0x0fbe('0x5'));var controller=require(_0x0fbe('0x6'));router[_0x0fbe('0x7')]('/',auth[_0x0fbe('0x8')](),controller[_0x0fbe('0x9')]);router[_0x0fbe('0x7')]('/describe',auth[_0x0fbe('0x8')](),controller[_0x0fbe('0xa')]);router['get'](_0x0fbe('0xb'),auth[_0x0fbe('0x8')](),controller[_0x0fbe('0xc')]);router[_0x0fbe('0xd')]('/',auth[_0x0fbe('0x8')](),controller[_0x0fbe('0xe')]);router[_0x0fbe('0xf')](_0x0fbe('0xb'),auth[_0x0fbe('0x8')](),controller[_0x0fbe('0x10')]);router[_0x0fbe('0x11')](_0x0fbe('0xb'),auth[_0x0fbe('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdb48=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','describe','show','post','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x294c42,_0xbd23ad){var _0x4c73d9=function(_0x4f140e){while(--_0x4f140e){_0x294c42['push'](_0x294c42['shift']());}};_0x4c73d9(++_0xbd23ad);}(_0xdb48,0xb8));var _0x8db4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xdb48[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x8db4('0x0'));var util=require(_0x8db4('0x1'));var path=require('path');var timeout=require(_0x8db4('0x2'));var express=require(_0x8db4('0x3'));var router=express[_0x8db4('0x4')]();var fs_extra=require(_0x8db4('0x5'));var auth=require(_0x8db4('0x6'));var interaction=require(_0x8db4('0x7'));var config=require(_0x8db4('0x8'));var controller=require(_0x8db4('0x9'));router[_0x8db4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8db4('0xa')]('/describe',auth[_0x8db4('0xb')](),controller[_0x8db4('0xc')]);router['get']('/:id',auth[_0x8db4('0xb')](),controller[_0x8db4('0xd')]);router[_0x8db4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8db4('0xf')]('/:id',auth[_0x8db4('0xb')](),controller[_0x8db4('0x10')]);router[_0x8db4('0x11')](_0x8db4('0x12'),auth['isAuthenticated'](),controller[_0x8db4('0x13')]);module[_0x8db4('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 59fbeb1..c136a7c 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x52ac48,_0x146d20){var _0x17b0f6=function(_0xfd2b28){while(--_0xfd2b28){_0x52ac48['push'](_0x52ac48['shift']());}};_0x17b0f6(++_0x146d20);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x271dc9,_0x5c1711){var _0x4019de=function(_0x142a25){while(--_0x142a25){_0x271dc9['push'](_0x271dc9['shift']());}};_0x4019de(++_0x5c1711);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d5d00d5..4f59919 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 _0x19f6=['fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','FaxTransferReport','includeAll','include','findAll','catch','find','create','body','destroy','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x19f6,0xcf));var _0x619f=function(_0x5bef0a,_0x1fb747){_0x5bef0a=_0x5bef0a-0x0;var _0x1a02ea=_0x19f6[_0x5bef0a];return _0x1a02ea;};'use strict';var emlformat=require(_0x619f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x619f('0x1'));var jsonpatch=require(_0x619f('0x2'));var rp=require(_0x619f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x619f('0x4'));var path=require(_0x619f('0x5'));var sox=require(_0x619f('0x6'));var csv=require(_0x619f('0x7'));var ejs=require(_0x619f('0x8'));var fs=require('fs');var fs_extra=require(_0x619f('0x9'));var _=require(_0x619f('0xa'));var squel=require(_0x619f('0xb'));var crypto=require('crypto');var jsforce=require(_0x619f('0xc'));var deskjs=require(_0x619f('0xd'));var toCsv=require(_0x619f('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x619f('0xe'));var authService=require(_0x619f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x619f('0x10'))(_0x619f('0x11'));var utils=require(_0x619f('0x12'));var config=require(_0x619f('0x13'));var licenseUtil=require(_0x619f('0x14'));var db=require(_0x619f('0x15'))['db'];function respondWithStatusCode(_0x1f0268,_0x318327){_0x318327=_0x318327||0xcc;return function(_0x1fd6c8){if(_0x1fd6c8){return _0x1f0268[_0x619f('0x16')](_0x318327);}return _0x1f0268[_0x619f('0x17')](_0x318327)[_0x619f('0x18')]();};}function respondWithResult(_0x464f39,_0x3fb0cc){_0x3fb0cc=_0x3fb0cc||0xc8;return function(_0x5f0287){if(_0x5f0287){return _0x464f39['status'](_0x3fb0cc)[_0x619f('0x19')](_0x5f0287);}};}function respondWithFilteredResult(_0x203362,_0x52cfa8){return function(_0x4c8882){if(_0x4c8882){var _0x1ed859=typeof _0x52cfa8['offset']==='undefined'&&typeof _0x52cfa8[_0x619f('0x1a')]===_0x619f('0x1b');var _0x2ea8eb=_0x4c8882[_0x619f('0x1c')];var _0x14409f=_0x1ed859?0x0:_0x52cfa8[_0x619f('0x1d')];var _0x4ae1c4=_0x1ed859?_0x4c8882[_0x619f('0x1c')]:_0x52cfa8[_0x619f('0x1d')]+_0x52cfa8[_0x619f('0x1a')];var _0x17352b;if(_0x4ae1c4>=_0x2ea8eb){_0x4ae1c4=_0x2ea8eb;_0x17352b=0xc8;}else{_0x17352b=0xce;}_0x203362['status'](_0x17352b);return _0x203362[_0x619f('0x1e')](_0x619f('0x1f'),_0x14409f+'-'+_0x4ae1c4+'/'+_0x2ea8eb)['json'](_0x4c8882);}return null;};}function patchUpdates(_0x5a5c6b){return function(_0x4c878d){try{jsonpatch[_0x619f('0x20')](_0x4c878d,_0x5a5c6b,!![]);}catch(_0x444634){return BPromise[_0x619f('0x21')](_0x444634);}return _0x4c878d[_0x619f('0x22')]();};}function saveUpdates(_0x6c2a7b,_0x5994a7){return function(_0x167164){if(_0x167164){return _0x167164[_0x619f('0x23')](_0x6c2a7b)['then'](function(_0x46e705){return _0x46e705;});}return null;};}function removeEntity(_0x37d8e6,_0xeefed2){return function(_0x52a261){if(_0x52a261){return _0x52a261['destroy']()[_0x619f('0x24')](function(){_0x37d8e6[_0x619f('0x17')](0xcc)[_0x619f('0x18')]();});}};}function handleEntityNotFound(_0x16b4ab,_0x32e8b6){return function(_0x201289){if(!_0x201289){_0x16b4ab['sendStatus'](0x194);}return _0x201289;};}function handleError(_0x10459e,_0x31b362){_0x31b362=_0x31b362||0x1f4;return function(_0x10f16f){logger[_0x619f('0x25')](_0x10f16f[_0x619f('0x26')]);if(_0x10f16f[_0x619f('0x27')]){delete _0x10f16f[_0x619f('0x27')];}_0x10459e[_0x619f('0x17')](_0x31b362)[_0x619f('0x28')](_0x10f16f);};}exports['index']=function(_0x545097,_0x5d2522){var _0x18ed4f={},_0x4d1414={},_0x24b440={'count':0x0,'rows':[]};var _0x389e26=_[_0x619f('0x29')](db['FaxTransferReport'][_0x619f('0x2a')],function(_0x9d3098){return{'name':_0x9d3098[_0x619f('0x2b')],'type':_0x9d3098[_0x619f('0x2c')]['key']};});_0x4d1414[_0x619f('0x2d')]=_['map'](_0x389e26,_0x619f('0x27'));_0x4d1414[_0x619f('0x2e')]=_[_0x619f('0x2f')](_0x545097[_0x619f('0x2e')]);_0x4d1414[_0x619f('0x30')]=_[_0x619f('0x31')](_0x4d1414['model'],_0x4d1414[_0x619f('0x2e')]);_0x18ed4f[_0x619f('0x32')]=_[_0x619f('0x31')](_0x4d1414[_0x619f('0x2d')],qs[_0x619f('0x33')](_0x545097[_0x619f('0x2e')][_0x619f('0x33')]));_0x18ed4f['attributes']=_0x18ed4f[_0x619f('0x32')]['length']?_0x18ed4f[_0x619f('0x32')]:_0x4d1414[_0x619f('0x2d')];if(!_0x545097[_0x619f('0x2e')][_0x619f('0x34')](_0x619f('0x35'))){_0x18ed4f['limit']=qs[_0x619f('0x1a')](_0x545097[_0x619f('0x2e')][_0x619f('0x1a')]);_0x18ed4f[_0x619f('0x1d')]=qs[_0x619f('0x1d')](_0x545097['query'][_0x619f('0x1d')]);}_0x18ed4f[_0x619f('0x36')]=qs[_0x619f('0x37')](_0x545097[_0x619f('0x2e')][_0x619f('0x37')]);_0x18ed4f[_0x619f('0x38')]=qs[_0x619f('0x30')](_['pick'](_0x545097[_0x619f('0x2e')],_0x4d1414[_0x619f('0x30')]),_0x389e26);if(_0x545097[_0x619f('0x2e')]['filter']){_0x18ed4f[_0x619f('0x38')]=_['merge'](_0x18ed4f[_0x619f('0x38')],{'$or':_[_0x619f('0x29')](_0x389e26,function(_0x5df1ba){if(_0x5df1ba[_0x619f('0x2c')]!==_0x619f('0x39')){var _0xb6b8cd={};_0xb6b8cd[_0x5df1ba[_0x619f('0x27')]]={'$like':'%'+_0x545097[_0x619f('0x2e')][_0x619f('0x3a')]+'%'};return _0xb6b8cd;}})});}_0x18ed4f=_[_0x619f('0x3b')]({},_0x18ed4f,_0x545097[_0x619f('0x3c')]);var _0x5437ba={'where':_0x18ed4f[_0x619f('0x38')]};return db[_0x619f('0x3d')][_0x619f('0x1c')](_0x5437ba)[_0x619f('0x24')](function(_0x459ae2){_0x24b440[_0x619f('0x1c')]=_0x459ae2;if(_0x545097['query'][_0x619f('0x3e')]){_0x18ed4f[_0x619f('0x3f')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x619f('0x40')](_0x18ed4f);})[_0x619f('0x24')](function(_0x2a65e5){_0x24b440['rows']=_0x2a65e5;return _0x24b440;})[_0x619f('0x24')](respondWithFilteredResult(_0x5d2522,_0x18ed4f))[_0x619f('0x41')](handleError(_0x5d2522,null));};exports['show']=function(_0x349ede,_0x43bb42){var _0x2b1c56={'raw':!![],'where':{'id':_0x349ede['params']['id']}},_0x447f11={};_0x447f11[_0x619f('0x2d')]=_[_0x619f('0x2f')](db[_0x619f('0x3d')][_0x619f('0x2a')]);_0x447f11[_0x619f('0x2e')]=_[_0x619f('0x2f')](_0x349ede[_0x619f('0x2e')]);_0x447f11['filters']=_[_0x619f('0x31')](_0x447f11[_0x619f('0x2d')],_0x447f11[_0x619f('0x2e')]);_0x2b1c56[_0x619f('0x32')]=_[_0x619f('0x31')](_0x447f11[_0x619f('0x2d')],qs[_0x619f('0x33')](_0x349ede['query'][_0x619f('0x33')]));_0x2b1c56[_0x619f('0x32')]=_0x2b1c56[_0x619f('0x32')]['length']?_0x2b1c56[_0x619f('0x32')]:_0x447f11['model'];if(_0x349ede[_0x619f('0x2e')][_0x619f('0x3e')]){_0x2b1c56[_0x619f('0x3f')]=[{'all':!![]}];}_0x2b1c56=_['merge']({},_0x2b1c56,_0x349ede[_0x619f('0x3c')]);return db[_0x619f('0x3d')][_0x619f('0x42')](_0x2b1c56)[_0x619f('0x24')](handleEntityNotFound(_0x43bb42,null))[_0x619f('0x24')](respondWithResult(_0x43bb42,null))['catch'](handleError(_0x43bb42,null));};exports[_0x619f('0x43')]=function(_0x14c413,_0x504c99){return db[_0x619f('0x3d')][_0x619f('0x43')](_0x14c413[_0x619f('0x44')],{})[_0x619f('0x24')](respondWithResult(_0x504c99,0xc9))['catch'](handleError(_0x504c99,null));};exports[_0x619f('0x23')]=function(_0x30343a,_0xf93839){if(_0x30343a[_0x619f('0x44')]['id']){delete _0x30343a[_0x619f('0x44')]['id'];}return db[_0x619f('0x3d')][_0x619f('0x42')]({'where':{'id':_0x30343a['params']['id']}})[_0x619f('0x24')](handleEntityNotFound(_0xf93839,null))[_0x619f('0x24')](saveUpdates(_0x30343a['body'],null))['then'](respondWithResult(_0xf93839,null))[_0x619f('0x41')](handleError(_0xf93839,null));};exports[_0x619f('0x45')]=function(_0x2d32f1,_0x465de2){return db['FaxTransferReport'][_0x619f('0x42')]({'where':{'id':_0x2d32f1[_0x619f('0x46')]['id']}})[_0x619f('0x24')](handleEntityNotFound(_0x465de2,null))[_0x619f('0x24')](removeEntity(_0x465de2,null))[_0x619f('0x41')](handleError(_0x465de2,null));};exports[_0x619f('0x47')]=function(_0x5bc028,_0x484706){return db[_0x619f('0x3d')][_0x619f('0x47')]()['then'](respondWithResult(_0x484706,null))[_0x619f('0x41')](handleError(_0x484706,null));}; \ No newline at end of file +var _0x9a59=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','length','find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9a59,0x1c8));var _0x99a5=function(_0x5137ef,_0x24fa4f){_0x5137ef=_0x5137ef-0x0;var _0x1c41f0=_0x9a59[_0x5137ef];return _0x1c41f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x99a5('0x0'));var zipdir=require(_0x99a5('0x1'));var jsonpatch=require(_0x99a5('0x2'));var rp=require(_0x99a5('0x3'));var moment=require(_0x99a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x99a5('0x5'));var util=require(_0x99a5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x99a5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99a5('0x8'));var _=require(_0x99a5('0x9'));var squel=require(_0x99a5('0xa'));var crypto=require(_0x99a5('0xb'));var jsforce=require(_0x99a5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x99a5('0x7'));var querystring=require(_0x99a5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x99a5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x99a5('0xf'));var hardwareService=require(_0x99a5('0x10'));var logger=require(_0x99a5('0x11'))(_0x99a5('0x12'));var utils=require(_0x99a5('0x13'));var config=require(_0x99a5('0x14'));var licenseUtil=require(_0x99a5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5612a0,_0xf46eb8){_0xf46eb8=_0xf46eb8||0xcc;return function(_0x4c3682){if(_0x4c3682){return _0x5612a0['sendStatus'](_0xf46eb8);}return _0x5612a0[_0x99a5('0x16')](_0xf46eb8)[_0x99a5('0x17')]();};}function respondWithResult(_0x68dfce,_0x336640){_0x336640=_0x336640||0xc8;return function(_0x1e2174){if(_0x1e2174){return _0x68dfce[_0x99a5('0x16')](_0x336640)['json'](_0x1e2174);}};}function respondWithFilteredResult(_0x83068d,_0x1983f4){return function(_0x2cc949){if(_0x2cc949){var _0x137e60=typeof _0x1983f4[_0x99a5('0x18')]===_0x99a5('0x19')&&typeof _0x1983f4['limit']===_0x99a5('0x19');var _0x25227a=_0x2cc949[_0x99a5('0x1a')];var _0x1acdac=_0x137e60?0x0:_0x1983f4[_0x99a5('0x18')];var _0x107794=_0x137e60?_0x2cc949[_0x99a5('0x1a')]:_0x1983f4[_0x99a5('0x18')]+_0x1983f4[_0x99a5('0x1b')];var _0x2baa21;if(_0x107794>=_0x25227a){_0x107794=_0x25227a;_0x2baa21=0xc8;}else{_0x2baa21=0xce;}_0x83068d[_0x99a5('0x16')](_0x2baa21);return _0x83068d[_0x99a5('0x1c')]('Content-Range',_0x1acdac+'-'+_0x107794+'/'+_0x25227a)[_0x99a5('0x1d')](_0x2cc949);}return null;};}function patchUpdates(_0x3f162e){return function(_0x5b038c){try{jsonpatch[_0x99a5('0x1e')](_0x5b038c,_0x3f162e,!![]);}catch(_0x126dc4){return BPromise[_0x99a5('0x1f')](_0x126dc4);}return _0x5b038c[_0x99a5('0x20')]();};}function saveUpdates(_0x2d6515,_0x310bcc){return function(_0x1c2698){if(_0x1c2698){return _0x1c2698[_0x99a5('0x21')](_0x2d6515)[_0x99a5('0x22')](function(_0x11c032){return _0x11c032;});}return null;};}function removeEntity(_0x317894,_0x285f07){return function(_0x26766d){if(_0x26766d){return _0x26766d[_0x99a5('0x23')]()[_0x99a5('0x22')](function(){_0x317894['status'](0xcc)[_0x99a5('0x17')]();});}};}function handleEntityNotFound(_0x1cbdff,_0x23e762){return function(_0x55152d){if(!_0x55152d){_0x1cbdff['sendStatus'](0x194);}return _0x55152d;};}function handleError(_0x5f4e31,_0x476098){_0x476098=_0x476098||0x1f4;return function(_0x5138e2){logger['error'](_0x5138e2[_0x99a5('0x24')]);if(_0x5138e2[_0x99a5('0x25')]){delete _0x5138e2[_0x99a5('0x25')];}_0x5f4e31['status'](_0x476098)['send'](_0x5138e2);};}exports[_0x99a5('0x26')]=function(_0x5763cf,_0x4fe5a8){var _0x202760={},_0x2baa25={},_0x254a57={'count':0x0,'rows':[]};var _0x500bfa=_[_0x99a5('0x27')](db[_0x99a5('0x28')][_0x99a5('0x29')],function(_0x47280f){return{'name':_0x47280f[_0x99a5('0x2a')],'type':_0x47280f[_0x99a5('0x2b')][_0x99a5('0x2c')]};});_0x2baa25['model']=_[_0x99a5('0x27')](_0x500bfa,_0x99a5('0x25'));_0x2baa25[_0x99a5('0x2d')]=_[_0x99a5('0x2e')](_0x5763cf[_0x99a5('0x2d')]);_0x2baa25[_0x99a5('0x2f')]=_['intersection'](_0x2baa25[_0x99a5('0x30')],_0x2baa25['query']);_0x202760[_0x99a5('0x31')]=_['intersection'](_0x2baa25[_0x99a5('0x30')],qs[_0x99a5('0x32')](_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x32')]));_0x202760[_0x99a5('0x31')]=_0x202760[_0x99a5('0x31')]['length']?_0x202760[_0x99a5('0x31')]:_0x2baa25[_0x99a5('0x30')];if(!_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x33')](_0x99a5('0x34'))){_0x202760[_0x99a5('0x1b')]=qs[_0x99a5('0x1b')](_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x1b')]);_0x202760[_0x99a5('0x18')]=qs[_0x99a5('0x18')](_0x5763cf[_0x99a5('0x2d')]['offset']);}_0x202760[_0x99a5('0x35')]=qs['sort'](_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x36')]);_0x202760[_0x99a5('0x37')]=qs[_0x99a5('0x2f')](_[_0x99a5('0x38')](_0x5763cf['query'],_0x2baa25['filters']),_0x500bfa);if(_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x39')]){_0x202760['where']=_[_0x99a5('0x3a')](_0x202760[_0x99a5('0x37')],{'$or':_['map'](_0x500bfa,function(_0x1c58cf){if(_0x1c58cf['type']!==_0x99a5('0x3b')){var _0x2f6060={};_0x2f6060[_0x1c58cf[_0x99a5('0x25')]]={'$like':'%'+_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x39')]+'%'};return _0x2f6060;}})});}_0x202760=_[_0x99a5('0x3a')]({},_0x202760,_0x5763cf[_0x99a5('0x3c')]);var _0x318ac3={'where':_0x202760[_0x99a5('0x37')]};return db[_0x99a5('0x28')]['count'](_0x318ac3)['then'](function(_0x18dd8c){_0x254a57[_0x99a5('0x1a')]=_0x18dd8c;if(_0x5763cf[_0x99a5('0x2d')][_0x99a5('0x3d')]){_0x202760[_0x99a5('0x3e')]=[{'all':!![]}];}return db[_0x99a5('0x28')]['findAll'](_0x202760);})[_0x99a5('0x22')](function(_0x4940ff){_0x254a57[_0x99a5('0x3f')]=_0x4940ff;return _0x254a57;})[_0x99a5('0x22')](respondWithFilteredResult(_0x4fe5a8,_0x202760))['catch'](handleError(_0x4fe5a8,null));};exports[_0x99a5('0x40')]=function(_0x3d1087,_0x39a061){var _0x4704c4={'raw':!![],'where':{'id':_0x3d1087[_0x99a5('0x41')]['id']}},_0x5605c8={};_0x5605c8['model']=_[_0x99a5('0x2e')](db[_0x99a5('0x28')][_0x99a5('0x29')]);_0x5605c8[_0x99a5('0x2d')]=_[_0x99a5('0x2e')](_0x3d1087[_0x99a5('0x2d')]);_0x5605c8[_0x99a5('0x2f')]=_[_0x99a5('0x42')](_0x5605c8[_0x99a5('0x30')],_0x5605c8[_0x99a5('0x2d')]);_0x4704c4[_0x99a5('0x31')]=_['intersection'](_0x5605c8['model'],qs['fields'](_0x3d1087[_0x99a5('0x2d')]['fields']));_0x4704c4[_0x99a5('0x31')]=_0x4704c4[_0x99a5('0x31')][_0x99a5('0x43')]?_0x4704c4[_0x99a5('0x31')]:_0x5605c8[_0x99a5('0x30')];if(_0x3d1087[_0x99a5('0x2d')][_0x99a5('0x3d')]){_0x4704c4[_0x99a5('0x3e')]=[{'all':!![]}];}_0x4704c4=_[_0x99a5('0x3a')]({},_0x4704c4,_0x3d1087[_0x99a5('0x3c')]);return db[_0x99a5('0x28')][_0x99a5('0x44')](_0x4704c4)[_0x99a5('0x22')](handleEntityNotFound(_0x39a061,null))[_0x99a5('0x22')](respondWithResult(_0x39a061,null))['catch'](handleError(_0x39a061,null));};exports[_0x99a5('0x45')]=function(_0x305989,_0xe77a59){return db[_0x99a5('0x28')][_0x99a5('0x45')](_0x305989[_0x99a5('0x46')],{})[_0x99a5('0x22')](respondWithResult(_0xe77a59,0xc9))[_0x99a5('0x47')](handleError(_0xe77a59,null));};exports[_0x99a5('0x21')]=function(_0x434389,_0x1c14f0){if(_0x434389['body']['id']){delete _0x434389[_0x99a5('0x46')]['id'];}return db[_0x99a5('0x28')]['find']({'where':{'id':_0x434389[_0x99a5('0x41')]['id']}})[_0x99a5('0x22')](handleEntityNotFound(_0x1c14f0,null))[_0x99a5('0x22')](saveUpdates(_0x434389[_0x99a5('0x46')],null))['then'](respondWithResult(_0x1c14f0,null))[_0x99a5('0x47')](handleError(_0x1c14f0,null));};exports[_0x99a5('0x23')]=function(_0x3fd932,_0x29eb08){return db[_0x99a5('0x28')][_0x99a5('0x44')]({'where':{'id':_0x3fd932[_0x99a5('0x41')]['id']}})['then'](handleEntityNotFound(_0x29eb08,null))[_0x99a5('0x22')](removeEntity(_0x29eb08,null))['catch'](handleError(_0x29eb08,null));};exports['describe']=function(_0x398aca,_0x1daddc){return db[_0x99a5('0x28')][_0x99a5('0x48')]()['then'](respondWithResult(_0x1daddc,null))[_0x99a5('0x47')](handleError(_0x1daddc,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index d7186f9..a534681 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 _0x84f2=['FaxTransferReport','uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x84f2,0x1ee));var _0x284f=function(_0x575228,_0x3f9bc1){_0x575228=_0x575228-0x0;var _0x4cb11e=_0x84f2[_0x575228];return _0x4cb11e;};'use strict';var _=require(_0x284f('0x0'));var util=require(_0x284f('0x1'));var logger=require(_0x284f('0x2'))('api');var moment=require(_0x284f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x284f('0x4'));var rimraf=require(_0x284f('0x5'));var config=require(_0x284f('0x6'));var attributes=require(_0x284f('0x7'));module[_0x284f('0x8')]=function(_0x21c6dd,_0x3bfd43){return _0x21c6dd[_0x284f('0x9')](_0x284f('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x284f('0xb'),'fields':[_0x284f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc23d=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer'];(function(_0x28c5c8,_0x361bf0){var _0x295f37=function(_0x42d67c){while(--_0x42d67c){_0x28c5c8['push'](_0x28c5c8['shift']());}};_0x295f37(++_0x361bf0);}(_0xc23d,0x7f));var _0xdc23=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0xc23d[_0x1d2bc8];return _0x1857e1;};'use strict';var _=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var logger=require(_0xdc23('0x2'))(_0xdc23('0x3'));var moment=require(_0xdc23('0x4'));var BPromise=require(_0xdc23('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc23('0x6'));var rimraf=require(_0xdc23('0x7'));var config=require(_0xdc23('0x8'));var attributes=require(_0xdc23('0x9'));module[_0xdc23('0xa')]=function(_0x5b6bec,_0x4a153f){return _0x5b6bec[_0xdc23('0xb')]('FaxTransferReport',attributes,{'tableName':_0xdc23('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdc23('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4d7e3c1..5223bbb 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 _0xb951=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x24657f,_0x1620ed){var _0x389972=function(_0x1eca77){while(--_0x1eca77){_0x24657f['push'](_0x24657f['shift']());}};_0x389972(++_0x1620ed);}(_0xb951,0x142));var _0x1b95=function(_0x29ce74,_0x4c6b8c){_0x29ce74=_0x29ce74-0x0;var _0x44bf9c=_0xb951[_0x29ce74];return _0x44bf9c;};'use strict';var _=require(_0x1b95('0x0'));var util=require(_0x1b95('0x1'));var moment=require(_0x1b95('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b95('0x3'))['db'];var utils=require(_0x1b95('0x4'));var logger=require(_0x1b95('0x5'))(_0x1b95('0x6'));var config=require(_0x1b95('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1b95('0x8')][_0x1b95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24e4e7,_0x42ef42,_0x176747){return new BPromise(function(_0x33416a,_0x532cdf){return client[_0x1b95('0xa')](_0x24e4e7,_0x176747)[_0x1b95('0xb')](function(_0x4b4585){logger[_0x1b95('0xc')](_0x1b95('0xd'),_0x42ef42,_0x1b95('0xe'));logger[_0x1b95('0xf')](_0x1b95('0x10'),_0x42ef42,'request\x20sent',JSON[_0x1b95('0x11')](_0x4b4585));if(_0x4b4585[_0x1b95('0x12')]){if(_0x4b4585[_0x1b95('0x12')][_0x1b95('0x13')]===0x1f4){logger['error'](_0x1b95('0xd'),_0x42ef42,_0x4b4585[_0x1b95('0x12')][_0x1b95('0x14')]);return _0x532cdf(_0x4b4585['error'][_0x1b95('0x14')]);}logger[_0x1b95('0x12')](_0x1b95('0xd'),_0x42ef42,_0x4b4585[_0x1b95('0x12')][_0x1b95('0x14')]);return _0x33416a(_0x4b4585[_0x1b95('0x12')][_0x1b95('0x14')]);}else{logger[_0x1b95('0xc')](_0x1b95('0xd'),_0x42ef42,_0x1b95('0xe'));_0x33416a(_0x4b4585['result']['message']);}})[_0x1b95('0x15')](function(_0x50ac52){logger[_0x1b95('0x12')](_0x1b95('0xd'),_0x42ef42,_0x50ac52);_0x532cdf(_0x50ac52);});});} \ No newline at end of file +var _0x5cb5=['message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x2b50ea,_0x4cb59b){var _0x2568b2=function(_0x290d2b){while(--_0x290d2b){_0x2b50ea['push'](_0x2b50ea['shift']());}};_0x2568b2(++_0x4cb59b);}(_0x5cb5,0xd2));var _0x55cb=function(_0x265e2a,_0x1782b6){_0x265e2a=_0x265e2a-0x0;var _0x47b038=_0x5cb5[_0x265e2a];return _0x47b038;};'use strict';var _=require('lodash');var util=require(_0x55cb('0x0'));var moment=require(_0x55cb('0x1'));var BPromise=require(_0x55cb('0x2'));var rs=require(_0x55cb('0x3'));var fs=require('fs');var Redis=require(_0x55cb('0x4'));var db=require(_0x55cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x55cb('0x6'));var config=require(_0x55cb('0x7'));var jayson=require(_0x55cb('0x8'));var client=jayson[_0x55cb('0x9')][_0x55cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359395,_0x3abb6a,_0x6149f0){return new BPromise(function(_0x547002,_0x339b09){return client[_0x55cb('0xb')](_0x359395,_0x6149f0)[_0x55cb('0xc')](function(_0xb2a344){logger[_0x55cb('0xd')](_0x55cb('0xe'),_0x3abb6a,'request\x20sent');logger[_0x55cb('0xf')](_0x55cb('0x10'),_0x3abb6a,'request\x20sent',JSON[_0x55cb('0x11')](_0xb2a344));if(_0xb2a344['error']){if(_0xb2a344['error'][_0x55cb('0x12')]===0x1f4){logger[_0x55cb('0x13')](_0x55cb('0xe'),_0x3abb6a,_0xb2a344[_0x55cb('0x13')]['message']);return _0x339b09(_0xb2a344[_0x55cb('0x13')][_0x55cb('0x14')]);}logger[_0x55cb('0x13')](_0x55cb('0xe'),_0x3abb6a,_0xb2a344[_0x55cb('0x13')][_0x55cb('0x14')]);return _0x547002(_0xb2a344[_0x55cb('0x13')][_0x55cb('0x14')]);}else{logger[_0x55cb('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x3abb6a,_0x55cb('0x15'));_0x547002(_0xb2a344[_0x55cb('0x16')][_0x55cb('0x14')]);}})['catch'](function(_0x4aa3cd){logger['error'](_0x55cb('0xe'),_0x3abb6a,_0x4aa3cd);_0x339b09(_0x4aa3cd);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 36c3207..39ab393 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 _0x40ee=['/:id','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x4d4aec,_0x19e701){var _0x235d7e=function(_0x100ff6){while(--_0x100ff6){_0x4d4aec['push'](_0x4d4aec['shift']());}};_0x235d7e(++_0x19e701);}(_0x40ee,0xaf));var _0xe40e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x40ee[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xe40e('0x0'));var util=require(_0xe40e('0x1'));var path=require(_0xe40e('0x2'));var timeout=require(_0xe40e('0x3'));var express=require(_0xe40e('0x4'));var router=express[_0xe40e('0x5')]();var fs_extra=require(_0xe40e('0x6'));var auth=require(_0xe40e('0x7'));var interaction=require(_0xe40e('0x8'));var config=require(_0xe40e('0x9'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0xe40e('0xa')](),controller[_0xe40e('0xb')]);router[_0xe40e('0xc')](_0xe40e('0xd'),auth[_0xe40e('0xa')](),controller[_0xe40e('0xe')]);router['get'](_0xe40e('0xf'),auth[_0xe40e('0xa')](),controller['show']);router['post']('/',auth[_0xe40e('0xa')](),controller[_0xe40e('0x10')]);router['put'](_0xe40e('0xf'),auth[_0xe40e('0xa')](),controller[_0xe40e('0x11')]);router['delete']('/:id',auth[_0xe40e('0xa')](),controller[_0xe40e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x216f=['put','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x216f,0x135));var _0xf216=function(_0x879445,_0x14e128){_0x879445=_0x879445-0x0;var _0x414628=_0x216f[_0x879445];return _0x414628;};'use strict';var multer=require(_0xf216('0x0'));var util=require(_0xf216('0x1'));var path=require(_0xf216('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf216('0x3')]();var fs_extra=require(_0xf216('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf216('0x5'));var config=require(_0xf216('0x6'));var controller=require(_0xf216('0x7'));router[_0xf216('0x8')]('/',auth[_0xf216('0x9')](),controller[_0xf216('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf216('0xb')]);router[_0xf216('0x8')](_0xf216('0xc'),auth[_0xf216('0x9')](),controller['show']);router[_0xf216('0xd')]('/',auth['isAuthenticated'](),controller[_0xf216('0xe')]);router[_0xf216('0xf')]('/:id',auth[_0xf216('0x9')](),controller['update']);router[_0xf216('0x10')](_0xf216('0xc'),auth[_0xf216('0x9')](),controller['destroy']);module[_0xf216('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 4ee0078..6432080 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 _0x0004=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','destroy','exports','multer','path'];(function(_0x1b9ab2,_0x1b8913){var _0x5bb038=function(_0x422845){while(--_0x422845){_0x1b9ab2['push'](_0x1b9ab2['shift']());}};_0x5bb038(++_0x1b8913);}(_0x0004,0x19e));var _0x4000=function(_0x4f232d,_0x50c2fd){_0x4f232d=_0x4f232d-0x0;var _0x494086=_0x0004[_0x4f232d];return _0x494086;};'use strict';var multer=require(_0x4000('0x0'));var util=require('util');var path=require(_0x4000('0x1'));var timeout=require(_0x4000('0x2'));var express=require(_0x4000('0x3'));var router=express[_0x4000('0x4')]();var fs_extra=require(_0x4000('0x5'));var auth=require(_0x4000('0x6'));var interaction=require(_0x4000('0x7'));var config=require(_0x4000('0x8'));var controller=require(_0x4000('0x9'));router['get']('/',auth[_0x4000('0xa')](),controller[_0x4000('0xb')]);router[_0x4000('0xc')]('/:id',auth[_0x4000('0xa')](),controller[_0x4000('0xd')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x4000('0xe')]);router['get'](_0x4000('0xf'),auth[_0x4000('0xa')](),controller[_0x4000('0x10')]);router[_0x4000('0x11')]('/',auth[_0x4000('0xa')](),controller[_0x4000('0x12')]);router[_0x4000('0x11')](_0x4000('0x13'),auth[_0x4000('0xa')](),controller[_0x4000('0x14')]);router[_0x4000('0x15')](_0x4000('0x16'),auth[_0x4000('0xa')](),controller[_0x4000('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4000('0x18')]);module[_0x4000('0x19')]=router; \ No newline at end of file +var _0x143b=['./intDeskAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','post','create','update','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x143b,0xf6));var _0xb143=function(_0x3839a8,_0xef990d){_0x3839a8=_0x3839a8-0x0;var _0x41d155=_0x143b[_0x3839a8];return _0x41d155;};'use strict';var multer=require(_0xb143('0x0'));var util=require('util');var path=require(_0xb143('0x1'));var timeout=require('connect-timeout');var express=require(_0xb143('0x2'));var router=express[_0xb143('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb143('0x4'));var config=require(_0xb143('0x5'));var controller=require(_0xb143('0x6'));router['get']('/',auth[_0xb143('0x7')](),controller[_0xb143('0x8')]);router['get'](_0xb143('0x9'),auth[_0xb143('0x7')](),controller[_0xb143('0xa')]);router[_0xb143('0xb')](_0xb143('0xc'),auth['isAuthenticated'](),controller[_0xb143('0xd')]);router[_0xb143('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xb143('0xe')]('/',auth[_0xb143('0x7')](),controller[_0xb143('0xf')]);router['post'](_0xb143('0xc'),auth[_0xb143('0x7')](),controller['addConfiguration']);router['put'](_0xb143('0x9'),auth['isAuthenticated'](),controller[_0xb143('0x10')]);router['delete'](_0xb143('0x9'),auth[_0xb143('0x7')](),controller['destroy']);module[_0xb143('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index caf06d4..2cc9e4c 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 _0xa585=['newTab','integrationTab','sequelize','exports','STRING','basic','ENUM'];(function(_0xd6601b,_0x19ca00){var _0x496db2=function(_0x4fff85){while(--_0x4fff85){_0xd6601b['push'](_0xd6601b['shift']());}};_0x496db2(++_0x19ca00);}(_0xa585,0xf7));var _0x5a58=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xa585[_0x4695ba];return _0x524b7d;};'use strict';var Sequelize=require(_0x5a58('0x0'));module[_0x5a58('0x1')]={'name':{'type':Sequelize[_0x5a58('0x2')]},'description':{'type':Sequelize[_0x5a58('0x2')]},'username':{'type':Sequelize[_0x5a58('0x2')]},'remoteUri':{'type':Sequelize[_0x5a58('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x5a58('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5a58('0x2')]},'consumerKey':{'type':Sequelize[_0x5a58('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x5a58('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5a58('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5a58('0x4')]('integrationTab',_0x5a58('0x5')),'defaultValue':_0x5a58('0x6')}}; \ No newline at end of file +var _0xc2c3=['sequelize','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x23b3de,_0x51fb7e){var _0xe9c52a=function(_0x230412){while(--_0x230412){_0x23b3de['push'](_0x23b3de['shift']());}};_0xe9c52a(++_0x51fb7e);}(_0xc2c3,0x11a));var _0x3c2c=function(_0x2a6f0b,_0xed2ec){_0x2a6f0b=_0x2a6f0b-0x0;var _0x4bf4c6=_0xc2c3[_0x2a6f0b];return _0x4bf4c6;};'use strict';var Sequelize=require(_0x3c2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c2c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3c2c('0x1')]},'authType':{'type':Sequelize[_0x3c2c('0x2')](_0x3c2c('0x3')),'defaultValue':_0x3c2c('0x3')},'password':{'type':Sequelize[_0x3c2c('0x1')]},'consumerKey':{'type':Sequelize[_0x3c2c('0x1')]},'consumerSecret':{'type':Sequelize[_0x3c2c('0x1')]},'token':{'type':Sequelize[_0x3c2c('0x1')]},'tokenSecret':{'type':Sequelize[_0x3c2c('0x1')]},'serverUrl':{'type':Sequelize[_0x3c2c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3c2c('0x2')](_0x3c2c('0x4'),_0x3c2c('0x5')),'defaultValue':_0x3c2c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 43533d3..7ad9947 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 _0xd054=['Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','show','create','body','find','params','DeskConfiguration','sort','getConfigurations','nolimit','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','format','%s/custom_fields','application/json','basic'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd054,0x168));var _0x4d05=function(_0x58f045,_0x217e8f){_0x58f045=_0x58f045-0x0;var _0x2eff3b=_0xd054[_0x58f045];return _0x2eff3b;};'use strict';var emlformat=require(_0x4d05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d05('0x1'));var jsonpatch=require(_0x4d05('0x2'));var rp=require(_0x4d05('0x3'));var moment=require(_0x4d05('0x4'));var BPromise=require(_0x4d05('0x5'));var Mustache=require(_0x4d05('0x6'));var util=require('util');var path=require(_0x4d05('0x7'));var sox=require(_0x4d05('0x8'));var csv=require(_0x4d05('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d05('0xa'));var squel=require(_0x4d05('0xb'));var crypto=require('crypto');var jsforce=require(_0x4d05('0xc'));var deskjs=require(_0x4d05('0xd'));var toCsv=require(_0x4d05('0x9'));var querystring=require(_0x4d05('0xe'));var Papa=require(_0x4d05('0xf'));var Redis=require(_0x4d05('0x10'));var authService=require(_0x4d05('0x11'));var qs=require(_0x4d05('0x12'));var as=require(_0x4d05('0x13'));var hardwareService=require(_0x4d05('0x14'));var logger=require(_0x4d05('0x15'))(_0x4d05('0x16'));var utils=require(_0x4d05('0x17'));var config=require(_0x4d05('0x18'));var licenseUtil=require(_0x4d05('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2d7e63,_0x1b2cf9){_0x1b2cf9=_0x1b2cf9||0xcc;return function(_0x4612a5){if(_0x4612a5){return _0x2d7e63[_0x4d05('0x1a')](_0x1b2cf9);}return _0x2d7e63[_0x4d05('0x1b')](_0x1b2cf9)[_0x4d05('0x1c')]();};}function respondWithResult(_0x131851,_0x1a97d8){_0x1a97d8=_0x1a97d8||0xc8;return function(_0x38fa12){if(_0x38fa12){return _0x131851[_0x4d05('0x1b')](_0x1a97d8)[_0x4d05('0x1d')](_0x38fa12);}};}function respondWithFilteredResult(_0x3a3b17,_0x1ce0f9){return function(_0x56a167){if(_0x56a167){var _0x4c35a3=typeof _0x1ce0f9[_0x4d05('0x1e')]===_0x4d05('0x1f')&&typeof _0x1ce0f9[_0x4d05('0x20')]===_0x4d05('0x1f');var _0x5c8346=_0x56a167[_0x4d05('0x21')];var _0x9a6751=_0x4c35a3?0x0:_0x1ce0f9[_0x4d05('0x1e')];var _0x227cc4=_0x4c35a3?_0x56a167[_0x4d05('0x21')]:_0x1ce0f9[_0x4d05('0x1e')]+_0x1ce0f9[_0x4d05('0x20')];var _0xa05b61;if(_0x227cc4>=_0x5c8346){_0x227cc4=_0x5c8346;_0xa05b61=0xc8;}else{_0xa05b61=0xce;}_0x3a3b17[_0x4d05('0x1b')](_0xa05b61);return _0x3a3b17[_0x4d05('0x22')](_0x4d05('0x23'),_0x9a6751+'-'+_0x227cc4+'/'+_0x5c8346)[_0x4d05('0x1d')](_0x56a167);}return null;};}function patchUpdates(_0x22cb02){return function(_0x35e272){try{jsonpatch[_0x4d05('0x24')](_0x35e272,_0x22cb02,!![]);}catch(_0x58f0ed){return BPromise[_0x4d05('0x25')](_0x58f0ed);}return _0x35e272['save']();};}function saveUpdates(_0x5c8a77,_0x545e2e){return function(_0xae13c3){if(_0xae13c3){return _0xae13c3[_0x4d05('0x26')](_0x5c8a77)[_0x4d05('0x27')](function(_0x2a766d){return _0x2a766d;});}return null;};}function removeEntity(_0x39154e,_0x237e64){return function(_0xdf4ea){if(_0xdf4ea){return _0xdf4ea[_0x4d05('0x28')]()[_0x4d05('0x27')](function(){_0x39154e[_0x4d05('0x1b')](0xcc)[_0x4d05('0x1c')]();});}};}function handleEntityNotFound(_0x180330,_0x38f3f8){return function(_0x1244d1){if(!_0x1244d1){_0x180330[_0x4d05('0x1a')](0x194);}return _0x1244d1;};}function handleError(_0x318af5,_0x396d1d){_0x396d1d=_0x396d1d||0x1f4;return function(_0x384fc9){logger['error'](_0x384fc9[_0x4d05('0x29')]);if(_0x384fc9[_0x4d05('0x2a')]){delete _0x384fc9[_0x4d05('0x2a')];}_0x318af5[_0x4d05('0x1b')](_0x396d1d)[_0x4d05('0x2b')](_0x384fc9);};}exports[_0x4d05('0x2c')]=function(_0x5bbb5f,_0xaa2227){var _0x3c7792={},_0x3a0c1a={},_0x339f9d={'count':0x0,'rows':[]};var _0x3c0bb5=_[_0x4d05('0x2d')](db[_0x4d05('0x2e')][_0x4d05('0x2f')],function(_0x5b7769){return{'name':_0x5b7769[_0x4d05('0x30')],'type':_0x5b7769[_0x4d05('0x31')]['key']};});_0x3a0c1a[_0x4d05('0x32')]=_[_0x4d05('0x2d')](_0x3c0bb5,_0x4d05('0x2a'));_0x3a0c1a[_0x4d05('0x33')]=_[_0x4d05('0x34')](_0x5bbb5f[_0x4d05('0x33')]);_0x3a0c1a[_0x4d05('0x35')]=_[_0x4d05('0x36')](_0x3a0c1a[_0x4d05('0x32')],_0x3a0c1a[_0x4d05('0x33')]);_0x3c7792[_0x4d05('0x37')]=_[_0x4d05('0x36')](_0x3a0c1a[_0x4d05('0x32')],qs['fields'](_0x5bbb5f[_0x4d05('0x33')][_0x4d05('0x38')]));_0x3c7792[_0x4d05('0x37')]=_0x3c7792[_0x4d05('0x37')][_0x4d05('0x39')]?_0x3c7792[_0x4d05('0x37')]:_0x3a0c1a[_0x4d05('0x32')];if(!_0x5bbb5f[_0x4d05('0x33')][_0x4d05('0x3a')]('nolimit')){_0x3c7792[_0x4d05('0x20')]=qs['limit'](_0x5bbb5f[_0x4d05('0x33')][_0x4d05('0x20')]);_0x3c7792[_0x4d05('0x1e')]=qs[_0x4d05('0x1e')](_0x5bbb5f['query'][_0x4d05('0x1e')]);}_0x3c7792[_0x4d05('0x3b')]=qs['sort'](_0x5bbb5f['query']['sort']);_0x3c7792['where']=qs[_0x4d05('0x35')](_[_0x4d05('0x3c')](_0x5bbb5f[_0x4d05('0x33')],_0x3a0c1a['filters']),_0x3c0bb5);if(_0x5bbb5f[_0x4d05('0x33')][_0x4d05('0x3d')]){_0x3c7792[_0x4d05('0x3e')]=_['merge'](_0x3c7792[_0x4d05('0x3e')],{'$or':_['map'](_0x3c0bb5,function(_0x42dccc){if(_0x42dccc[_0x4d05('0x31')]!==_0x4d05('0x3f')){var _0x4330ac={};_0x4330ac[_0x42dccc['name']]={'$like':'%'+_0x5bbb5f['query'][_0x4d05('0x3d')]+'%'};return _0x4330ac;}})});}_0x3c7792=_[_0x4d05('0x40')]({},_0x3c7792,_0x5bbb5f[_0x4d05('0x41')]);var _0x39ad1b={'where':_0x3c7792[_0x4d05('0x3e')]};return db[_0x4d05('0x2e')][_0x4d05('0x21')](_0x39ad1b)[_0x4d05('0x27')](function(_0x288e81){_0x339f9d[_0x4d05('0x21')]=_0x288e81;if(_0x5bbb5f[_0x4d05('0x33')]['includeAll']){_0x3c7792[_0x4d05('0x42')]=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x3c7792);})['then'](function(_0x3ae1d4){_0x339f9d[_0x4d05('0x43')]=_0x3ae1d4;return _0x339f9d;})[_0x4d05('0x27')](respondWithFilteredResult(_0xaa2227,_0x3c7792))[_0x4d05('0x44')](handleError(_0xaa2227,null));};exports[_0x4d05('0x45')]=function(_0x49f2d6,_0x6d22d){var _0x526ad2={'raw':![],'where':{'id':_0x49f2d6['params']['id']}},_0x3e5919={};_0x3e5919[_0x4d05('0x32')]=_[_0x4d05('0x34')](db[_0x4d05('0x2e')][_0x4d05('0x2f')]);_0x3e5919[_0x4d05('0x33')]=_['keys'](_0x49f2d6[_0x4d05('0x33')]);_0x3e5919[_0x4d05('0x35')]=_[_0x4d05('0x36')](_0x3e5919['model'],_0x3e5919[_0x4d05('0x33')]);_0x526ad2[_0x4d05('0x37')]=_['intersection'](_0x3e5919[_0x4d05('0x32')],qs[_0x4d05('0x38')](_0x49f2d6[_0x4d05('0x33')][_0x4d05('0x38')]));_0x526ad2[_0x4d05('0x37')]=_0x526ad2['attributes']['length']?_0x526ad2['attributes']:_0x3e5919[_0x4d05('0x32')];if(_0x49f2d6[_0x4d05('0x33')]['includeAll']){_0x526ad2[_0x4d05('0x42')]=[{'all':!![]}];}_0x526ad2=_[_0x4d05('0x40')]({},_0x526ad2,_0x49f2d6['options']);return db[_0x4d05('0x2e')]['find'](_0x526ad2)[_0x4d05('0x27')](handleEntityNotFound(_0x6d22d,null))[_0x4d05('0x27')](respondWithResult(_0x6d22d,null))['catch'](handleError(_0x6d22d,null));};exports[_0x4d05('0x46')]=function(_0x560acf,_0x2417c6){return db[_0x4d05('0x2e')][_0x4d05('0x46')](_0x560acf[_0x4d05('0x47')],{})['then'](respondWithResult(_0x2417c6,0xc9))[_0x4d05('0x44')](handleError(_0x2417c6,null));};exports[_0x4d05('0x26')]=function(_0x3900b8,_0x2e882f){if(_0x3900b8[_0x4d05('0x47')]['id']){delete _0x3900b8['body']['id'];}return db[_0x4d05('0x2e')][_0x4d05('0x48')]({'where':{'id':_0x3900b8[_0x4d05('0x49')]['id']}})[_0x4d05('0x27')](handleEntityNotFound(_0x2e882f,null))[_0x4d05('0x27')](saveUpdates(_0x3900b8[_0x4d05('0x47')],null))[_0x4d05('0x27')](respondWithResult(_0x2e882f,null))[_0x4d05('0x44')](handleError(_0x2e882f,null));};exports[_0x4d05('0x28')]=function(_0x7c84ce,_0x254ced){return db['DeskAccount'][_0x4d05('0x48')]({'where':{'id':_0x7c84ce['params']['id']}})['then'](handleEntityNotFound(_0x254ced,null))['then'](removeEntity(_0x254ced,null))['catch'](handleError(_0x254ced,null));};exports['getConfigurations']=function(_0x1c14af,_0x4c9256,_0x1546eb){var _0x4e7be2={};var _0x5401bc={};var _0x40991c;var _0x214f53;return db[_0x4d05('0x2e')]['findOne']({'where':{'id':_0x1c14af[_0x4d05('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c9256,null))[_0x4d05('0x27')](function(_0x3a99d4){if(_0x3a99d4){_0x40991c=_0x3a99d4;_0x5401bc[_0x4d05('0x32')]=_['keys'](db[_0x4d05('0x4a')][_0x4d05('0x2f')]);_0x5401bc[_0x4d05('0x33')]=_[_0x4d05('0x34')](_0x1c14af['query']);_0x5401bc[_0x4d05('0x35')]=_[_0x4d05('0x36')](_0x5401bc['model'],_0x5401bc[_0x4d05('0x33')]);_0x4e7be2['attributes']=_['intersection'](_0x5401bc[_0x4d05('0x32')],qs[_0x4d05('0x38')](_0x1c14af['query'][_0x4d05('0x38')]));_0x4e7be2['attributes']=_0x4e7be2[_0x4d05('0x37')][_0x4d05('0x39')]?_0x4e7be2['attributes']:_0x5401bc['model'];_0x4e7be2['order']=qs[_0x4d05('0x4b')](_0x1c14af[_0x4d05('0x33')]['sort']);_0x4e7be2[_0x4d05('0x3e')]=qs[_0x4d05('0x35')](_[_0x4d05('0x3c')](_0x1c14af['query'],_0x5401bc['filters']));if(_0x1c14af['query'][_0x4d05('0x3d')]){_0x4e7be2['where']=_[_0x4d05('0x40')](_0x4e7be2['where'],{'$or':_[_0x4d05('0x2d')](_0x4e7be2[_0x4d05('0x37')],function(_0x2a53d5){var _0x49ee51={};_0x49ee51[_0x2a53d5]={'$like':'%'+_0x1c14af[_0x4d05('0x33')][_0x4d05('0x3d')]+'%'};return _0x49ee51;})});}_0x4e7be2=_[_0x4d05('0x40')]({},_0x4e7be2,_0x1c14af[_0x4d05('0x41')]);return _0x40991c[_0x4d05('0x4c')](_0x4e7be2);}})[_0x4d05('0x27')](function(_0x10a3ae){if(_0x10a3ae){_0x214f53=_0x10a3ae[_0x4d05('0x39')];if(!_0x1c14af[_0x4d05('0x33')]['hasOwnProperty'](_0x4d05('0x4d'))){_0x4e7be2[_0x4d05('0x20')]=qs['limit'](_0x1c14af[_0x4d05('0x33')][_0x4d05('0x20')]);_0x4e7be2[_0x4d05('0x1e')]=qs[_0x4d05('0x1e')](_0x1c14af[_0x4d05('0x33')][_0x4d05('0x1e')]);}return _0x40991c['getConfigurations'](_0x4e7be2);}})['then'](function(_0x48f4b0){if(_0x48f4b0){return _0x48f4b0?{'count':_0x214f53,'rows':_0x48f4b0}:null;}})[_0x4d05('0x27')](respondWithResult(_0x4c9256,null))[_0x4d05('0x44')](handleError(_0x4c9256,null));};exports['addConfiguration']=function(_0x4d8f09,_0x5051f3,_0x14ffe6){if(_0x4d8f09[_0x4d05('0x47')]['id']){delete _0x4d8f09['body']['id'];}return db[_0x4d05('0x2e')][_0x4d05('0x4e')]({'where':{'id':_0x4d8f09[_0x4d05('0x49')]['id']}})[_0x4d05('0x27')](handleEntityNotFound(_0x5051f3,null))[_0x4d05('0x27')](function(_0x271a6b){if(_0x271a6b){_0x4d8f09[_0x4d05('0x47')][_0x4d05('0x4f')]=_0x271a6b['id'];_0x4d8f09[_0x4d05('0x47')]['Subjects']=integrations[_0x4d05('0x50')](_0x4d8f09['body'][_0x4d05('0x51')],_0x4d8f09['body']['type']);_0x4d8f09[_0x4d05('0x47')][_0x4d05('0x52')]=integrations[_0x4d05('0x53')](_0x4d8f09[_0x4d05('0x47')][_0x4d05('0x51')],_0x4d8f09[_0x4d05('0x47')]['type']);return db[_0x4d05('0x4a')][_0x4d05('0x46')](_0x4d8f09[_0x4d05('0x47')],{'include':[{'model':db[_0x4d05('0x54')],'as':'Subjects'},{'model':db[_0x4d05('0x54')],'as':'Descriptions'}]});}return null;})[_0x4d05('0x27')](respondWithResult(_0x5051f3,null))[_0x4d05('0x44')](handleError(_0x5051f3,null));};exports[_0x4d05('0x55')]=function(_0x27caf3,_0x35fa52,_0x5695ff){var _0x3f6dd6=[{'name':_0x4d05('0x56'),'label':_0x4d05('0x56'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x3ecd44='';return db[_0x4d05('0x2e')]['findOne']({'where':{'id':_0x27caf3['params']['id']},'attributes':['id','remoteUri',_0x4d05('0x57'),_0x4d05('0x58'),_0x4d05('0x59'),'consumerKey',_0x4d05('0x5a'),_0x4d05('0x5b'),_0x4d05('0x5c')]})[_0x4d05('0x27')](handleEntityNotFound(_0x35fa52,null))[_0x4d05('0x27')](function(_0x5287e2){if(_0x5287e2){_0x3ecd44=_0x5287e2[_0x4d05('0x5d')];var _0x208886=_0x3ecd44['slice'](-0x1);if(_0x208886==='/'){_0x3ecd44=_0x3ecd44[_0x4d05('0x5e')](0x0,_0x3ecd44[_0x4d05('0x5f')](_0x208886));}var _0x3a73b6={'method':'GET','uri':util[_0x4d05('0x60')](_0x4d05('0x61'),_0x3ecd44),'headers':{'Content-Type':_0x4d05('0x62'),'Accept':'application/json'},'json':!![]};if(_0x5287e2[_0x4d05('0x57')]===_0x4d05('0x63')){_0x3a73b6['headers'][_0x4d05('0x64')]=util[_0x4d05('0x60')](_0x4d05('0x65'),new Buffer(util['format'](_0x4d05('0x66'),_0x5287e2[_0x4d05('0x58')],_0x5287e2[_0x4d05('0x59')]))[_0x4d05('0x67')](_0x4d05('0x68')));}return rp(_0x3a73b6)[_0x4d05('0x27')](function(_0x1932db){return _0x3f6dd6[_0x4d05('0x69')](_[_0x4d05('0x2d')](_0x1932db[_0x4d05('0x6a')][_0x4d05('0x6b')],function(_0x23ce3a){return{'id':_0x23ce3a[_0x4d05('0x2a')],'name':_0x23ce3a[_0x4d05('0x2a')],'type':_0x23ce3a['type'],'active':_0x23ce3a[_0x4d05('0x6c')],'label':_0x23ce3a[_0x4d05('0x6d')],'custom':!![]};}));});}})[_0x4d05('0x27')](function(_0x32f454){return{'count':_0x32f454['length'],'rows':_0x32f454};})[_0x4d05('0x27')](respondWithResult(_0x35fa52,null))['catch'](function(_0x3611a7){var _0x381b1d=_0x27caf3['query'][_0x4d05('0x6e')]?0x1f4:_0x3611a7['statusCode']||0x1f4;logger[_0x4d05('0x6f')](_0x4d05('0x70'),_0x4d05('0x55'),_0x381b1d,JSON[_0x4d05('0x71')](_0x3611a7));delete _0x3611a7[_0x4d05('0x2a')];if(_0x381b1d===0x191){_0x381b1d=0x190;}_0x35fa52['status'](_0x381b1d)[_0x4d05('0x2b')](_0x27caf3[_0x4d05('0x33')][_0x4d05('0x6e')]?{'message':_0x4d05('0x72'),'statusCode':_0x3611a7['statusCode']}:_0x3611a7);});}; \ No newline at end of file +var _0x8c9d=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','where','pick','merge','VIRTUAL','filter','options','DeskAccount','then','includeAll','include','catch','show','params','rawAttributes','intersection','length','find','create','body','getConfigurations','findOne','DeskConfiguration','sort','AccountId','getSubjects','channel','Subjects','DeskField','Descriptions','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','format','toString','base64','concat','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x3be1a0,_0x4e785c){var _0x16d727=function(_0x2c2c78){while(--_0x2c2c78){_0x3be1a0['push'](_0x3be1a0['shift']());}};_0x16d727(++_0x4e785c);}(_0x8c9d,0xce));var _0xd8c9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8c9d[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xd8c9('0x0'));var rimraf=require(_0xd8c9('0x1'));var zipdir=require(_0xd8c9('0x2'));var jsonpatch=require(_0xd8c9('0x3'));var rp=require(_0xd8c9('0x4'));var moment=require(_0xd8c9('0x5'));var BPromise=require(_0xd8c9('0x6'));var Mustache=require('mustache');var util=require(_0xd8c9('0x7'));var path=require(_0xd8c9('0x8'));var sox=require('sox');var csv=require(_0xd8c9('0x9'));var ejs=require(_0xd8c9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8c9('0xb'));var squel=require(_0xd8c9('0xc'));var crypto=require(_0xd8c9('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd8c9('0x9'));var querystring=require(_0xd8c9('0xe'));var Papa=require(_0xd8c9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8c9('0x10'));var as=require(_0xd8c9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8c9('0x12'))(_0xd8c9('0x13'));var utils=require(_0xd8c9('0x14'));var config=require(_0xd8c9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8c9('0x16'))['db'];var integrations=require(_0xd8c9('0x17'));function respondWithStatusCode(_0x5231d4,_0x2af7cd){_0x2af7cd=_0x2af7cd||0xcc;return function(_0x236f32){if(_0x236f32){return _0x5231d4['sendStatus'](_0x2af7cd);}return _0x5231d4[_0xd8c9('0x18')](_0x2af7cd)[_0xd8c9('0x19')]();};}function respondWithResult(_0x2bc86c,_0x3649db){_0x3649db=_0x3649db||0xc8;return function(_0x2f7003){if(_0x2f7003){return _0x2bc86c['status'](_0x3649db)['json'](_0x2f7003);}};}function respondWithFilteredResult(_0xba0538,_0x4a2664){return function(_0x263827){if(_0x263827){var _0x3fa29c=typeof _0x4a2664[_0xd8c9('0x1a')]==='undefined'&&typeof _0x4a2664['limit']===_0xd8c9('0x1b');var _0x5e6ff1=_0x263827[_0xd8c9('0x1c')];var _0x224da5=_0x3fa29c?0x0:_0x4a2664[_0xd8c9('0x1a')];var _0x414f76=_0x3fa29c?_0x263827['count']:_0x4a2664[_0xd8c9('0x1a')]+_0x4a2664['limit'];var _0x34b571;if(_0x414f76>=_0x5e6ff1){_0x414f76=_0x5e6ff1;_0x34b571=0xc8;}else{_0x34b571=0xce;}_0xba0538[_0xd8c9('0x18')](_0x34b571);return _0xba0538[_0xd8c9('0x1d')](_0xd8c9('0x1e'),_0x224da5+'-'+_0x414f76+'/'+_0x5e6ff1)['json'](_0x263827);}return null;};}function patchUpdates(_0x3afa37){return function(_0x20eced){try{jsonpatch[_0xd8c9('0x1f')](_0x20eced,_0x3afa37,!![]);}catch(_0x5822a4){return BPromise[_0xd8c9('0x20')](_0x5822a4);}return _0x20eced['save']();};}function saveUpdates(_0x24f7f5,_0x136988){return function(_0x50abb1){if(_0x50abb1){return _0x50abb1[_0xd8c9('0x21')](_0x24f7f5)['then'](function(_0x5184c5){return _0x5184c5;});}return null;};}function removeEntity(_0xfb5b35,_0x34867a){return function(_0x5e4438){if(_0x5e4438){return _0x5e4438[_0xd8c9('0x22')]()['then'](function(){_0xfb5b35[_0xd8c9('0x18')](0xcc)[_0xd8c9('0x19')]();});}};}function handleEntityNotFound(_0x1692eb,_0x427aee){return function(_0x2701ae){if(!_0x2701ae){_0x1692eb[_0xd8c9('0x23')](0x194);}return _0x2701ae;};}function handleError(_0x12f6c1,_0x2155a1){_0x2155a1=_0x2155a1||0x1f4;return function(_0x4eb9f6){logger[_0xd8c9('0x24')](_0x4eb9f6[_0xd8c9('0x25')]);if(_0x4eb9f6[_0xd8c9('0x26')]){delete _0x4eb9f6[_0xd8c9('0x26')];}_0x12f6c1[_0xd8c9('0x18')](_0x2155a1)[_0xd8c9('0x27')](_0x4eb9f6);};}exports[_0xd8c9('0x28')]=function(_0x435aff,_0x200bc3){var _0x2ea4e8={},_0x3b7ae9={},_0x49363a={'count':0x0,'rows':[]};var _0x14a819=_['map'](db['DeskAccount']['rawAttributes'],function(_0x45a140){return{'name':_0x45a140[_0xd8c9('0x29')],'type':_0x45a140[_0xd8c9('0x2a')][_0xd8c9('0x2b')]};});_0x3b7ae9[_0xd8c9('0x2c')]=_[_0xd8c9('0x2d')](_0x14a819,_0xd8c9('0x26'));_0x3b7ae9[_0xd8c9('0x2e')]=_[_0xd8c9('0x2f')](_0x435aff[_0xd8c9('0x2e')]);_0x3b7ae9[_0xd8c9('0x30')]=_['intersection'](_0x3b7ae9[_0xd8c9('0x2c')],_0x3b7ae9['query']);_0x2ea4e8[_0xd8c9('0x31')]=_['intersection'](_0x3b7ae9[_0xd8c9('0x2c')],qs[_0xd8c9('0x32')](_0x435aff['query'][_0xd8c9('0x32')]));_0x2ea4e8[_0xd8c9('0x31')]=_0x2ea4e8[_0xd8c9('0x31')]['length']?_0x2ea4e8[_0xd8c9('0x31')]:_0x3b7ae9['model'];if(!_0x435aff[_0xd8c9('0x2e')][_0xd8c9('0x33')](_0xd8c9('0x34'))){_0x2ea4e8[_0xd8c9('0x35')]=qs['limit'](_0x435aff[_0xd8c9('0x2e')][_0xd8c9('0x35')]);_0x2ea4e8[_0xd8c9('0x1a')]=qs[_0xd8c9('0x1a')](_0x435aff['query']['offset']);}_0x2ea4e8[_0xd8c9('0x36')]=qs['sort'](_0x435aff[_0xd8c9('0x2e')]['sort']);_0x2ea4e8[_0xd8c9('0x37')]=qs[_0xd8c9('0x30')](_[_0xd8c9('0x38')](_0x435aff[_0xd8c9('0x2e')],_0x3b7ae9[_0xd8c9('0x30')]),_0x14a819);if(_0x435aff['query']['filter']){_0x2ea4e8[_0xd8c9('0x37')]=_[_0xd8c9('0x39')](_0x2ea4e8[_0xd8c9('0x37')],{'$or':_[_0xd8c9('0x2d')](_0x14a819,function(_0x5082d6){if(_0x5082d6[_0xd8c9('0x2a')]!==_0xd8c9('0x3a')){var _0x90d6ff={};_0x90d6ff[_0x5082d6[_0xd8c9('0x26')]]={'$like':'%'+_0x435aff[_0xd8c9('0x2e')][_0xd8c9('0x3b')]+'%'};return _0x90d6ff;}})});}_0x2ea4e8=_[_0xd8c9('0x39')]({},_0x2ea4e8,_0x435aff[_0xd8c9('0x3c')]);var _0x2022aa={'where':_0x2ea4e8['where']};return db[_0xd8c9('0x3d')][_0xd8c9('0x1c')](_0x2022aa)[_0xd8c9('0x3e')](function(_0x4c3253){_0x49363a['count']=_0x4c3253;if(_0x435aff[_0xd8c9('0x2e')][_0xd8c9('0x3f')]){_0x2ea4e8[_0xd8c9('0x40')]=[{'all':!![]}];}return db[_0xd8c9('0x3d')]['findAll'](_0x2ea4e8);})[_0xd8c9('0x3e')](function(_0x38b376){_0x49363a['rows']=_0x38b376;return _0x49363a;})[_0xd8c9('0x3e')](respondWithFilteredResult(_0x200bc3,_0x2ea4e8))[_0xd8c9('0x41')](handleError(_0x200bc3,null));};exports[_0xd8c9('0x42')]=function(_0x1b7df6,_0x1bee32){var _0x2e48af={'raw':![],'where':{'id':_0x1b7df6[_0xd8c9('0x43')]['id']}},_0xaeed51={};_0xaeed51[_0xd8c9('0x2c')]=_['keys'](db[_0xd8c9('0x3d')][_0xd8c9('0x44')]);_0xaeed51[_0xd8c9('0x2e')]=_[_0xd8c9('0x2f')](_0x1b7df6[_0xd8c9('0x2e')]);_0xaeed51[_0xd8c9('0x30')]=_[_0xd8c9('0x45')](_0xaeed51[_0xd8c9('0x2c')],_0xaeed51[_0xd8c9('0x2e')]);_0x2e48af[_0xd8c9('0x31')]=_['intersection'](_0xaeed51[_0xd8c9('0x2c')],qs[_0xd8c9('0x32')](_0x1b7df6[_0xd8c9('0x2e')][_0xd8c9('0x32')]));_0x2e48af[_0xd8c9('0x31')]=_0x2e48af[_0xd8c9('0x31')][_0xd8c9('0x46')]?_0x2e48af['attributes']:_0xaeed51[_0xd8c9('0x2c')];if(_0x1b7df6[_0xd8c9('0x2e')][_0xd8c9('0x3f')]){_0x2e48af[_0xd8c9('0x40')]=[{'all':!![]}];}_0x2e48af=_[_0xd8c9('0x39')]({},_0x2e48af,_0x1b7df6[_0xd8c9('0x3c')]);return db['DeskAccount'][_0xd8c9('0x47')](_0x2e48af)[_0xd8c9('0x3e')](handleEntityNotFound(_0x1bee32,null))[_0xd8c9('0x3e')](respondWithResult(_0x1bee32,null))[_0xd8c9('0x41')](handleError(_0x1bee32,null));};exports[_0xd8c9('0x48')]=function(_0x8a4606,_0x42faca){return db[_0xd8c9('0x3d')][_0xd8c9('0x48')](_0x8a4606['body'],{})[_0xd8c9('0x3e')](respondWithResult(_0x42faca,0xc9))[_0xd8c9('0x41')](handleError(_0x42faca,null));};exports[_0xd8c9('0x21')]=function(_0x1cf7d2,_0x2e01c0){if(_0x1cf7d2[_0xd8c9('0x49')]['id']){delete _0x1cf7d2['body']['id'];}return db[_0xd8c9('0x3d')][_0xd8c9('0x47')]({'where':{'id':_0x1cf7d2[_0xd8c9('0x43')]['id']}})[_0xd8c9('0x3e')](handleEntityNotFound(_0x2e01c0,null))['then'](saveUpdates(_0x1cf7d2[_0xd8c9('0x49')],null))[_0xd8c9('0x3e')](respondWithResult(_0x2e01c0,null))[_0xd8c9('0x41')](handleError(_0x2e01c0,null));};exports[_0xd8c9('0x22')]=function(_0x1c3078,_0x2762ad){return db[_0xd8c9('0x3d')][_0xd8c9('0x47')]({'where':{'id':_0x1c3078[_0xd8c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x2762ad,null))[_0xd8c9('0x3e')](removeEntity(_0x2762ad,null))['catch'](handleError(_0x2762ad,null));};exports[_0xd8c9('0x4a')]=function(_0xac0f93,_0x31621b,_0x49cdcb){var _0x1d1145={};var _0x252902={};var _0x58711a;var _0x485381;return db['DeskAccount'][_0xd8c9('0x4b')]({'where':{'id':_0xac0f93['params']['id']}})[_0xd8c9('0x3e')](handleEntityNotFound(_0x31621b,null))[_0xd8c9('0x3e')](function(_0x5ed5cd){if(_0x5ed5cd){_0x58711a=_0x5ed5cd;_0x252902[_0xd8c9('0x2c')]=_[_0xd8c9('0x2f')](db[_0xd8c9('0x4c')][_0xd8c9('0x44')]);_0x252902[_0xd8c9('0x2e')]=_[_0xd8c9('0x2f')](_0xac0f93['query']);_0x252902['filters']=_[_0xd8c9('0x45')](_0x252902[_0xd8c9('0x2c')],_0x252902['query']);_0x1d1145[_0xd8c9('0x31')]=_[_0xd8c9('0x45')](_0x252902[_0xd8c9('0x2c')],qs[_0xd8c9('0x32')](_0xac0f93['query'][_0xd8c9('0x32')]));_0x1d1145[_0xd8c9('0x31')]=_0x1d1145[_0xd8c9('0x31')][_0xd8c9('0x46')]?_0x1d1145[_0xd8c9('0x31')]:_0x252902[_0xd8c9('0x2c')];_0x1d1145[_0xd8c9('0x36')]=qs[_0xd8c9('0x4d')](_0xac0f93[_0xd8c9('0x2e')][_0xd8c9('0x4d')]);_0x1d1145[_0xd8c9('0x37')]=qs['filters'](_[_0xd8c9('0x38')](_0xac0f93[_0xd8c9('0x2e')],_0x252902['filters']));if(_0xac0f93[_0xd8c9('0x2e')][_0xd8c9('0x3b')]){_0x1d1145[_0xd8c9('0x37')]=_[_0xd8c9('0x39')](_0x1d1145['where'],{'$or':_[_0xd8c9('0x2d')](_0x1d1145['attributes'],function(_0x10fdb1){var _0x432b4c={};_0x432b4c[_0x10fdb1]={'$like':'%'+_0xac0f93[_0xd8c9('0x2e')][_0xd8c9('0x3b')]+'%'};return _0x432b4c;})});}_0x1d1145=_[_0xd8c9('0x39')]({},_0x1d1145,_0xac0f93[_0xd8c9('0x3c')]);return _0x58711a[_0xd8c9('0x4a')](_0x1d1145);}})[_0xd8c9('0x3e')](function(_0x17bb97){if(_0x17bb97){_0x485381=_0x17bb97[_0xd8c9('0x46')];if(!_0xac0f93['query']['hasOwnProperty'](_0xd8c9('0x34'))){_0x1d1145[_0xd8c9('0x35')]=qs['limit'](_0xac0f93['query'][_0xd8c9('0x35')]);_0x1d1145[_0xd8c9('0x1a')]=qs[_0xd8c9('0x1a')](_0xac0f93[_0xd8c9('0x2e')][_0xd8c9('0x1a')]);}return _0x58711a['getConfigurations'](_0x1d1145);}})['then'](function(_0x9a3747){if(_0x9a3747){return _0x9a3747?{'count':_0x485381,'rows':_0x9a3747}:null;}})[_0xd8c9('0x3e')](respondWithResult(_0x31621b,null))['catch'](handleError(_0x31621b,null));};exports['addConfiguration']=function(_0x29ff68,_0x548217,_0x2ef7aa){if(_0x29ff68['body']['id']){delete _0x29ff68[_0xd8c9('0x49')]['id'];}return db['DeskAccount'][_0xd8c9('0x4b')]({'where':{'id':_0x29ff68[_0xd8c9('0x43')]['id']}})[_0xd8c9('0x3e')](handleEntityNotFound(_0x548217,null))[_0xd8c9('0x3e')](function(_0x431d65){if(_0x431d65){_0x29ff68[_0xd8c9('0x49')][_0xd8c9('0x4e')]=_0x431d65['id'];_0x29ff68['body']['Subjects']=integrations[_0xd8c9('0x4f')](_0x29ff68['body'][_0xd8c9('0x50')],_0x29ff68[_0xd8c9('0x49')][_0xd8c9('0x2a')]);_0x29ff68[_0xd8c9('0x49')]['Descriptions']=integrations['getDescriptions'](_0x29ff68[_0xd8c9('0x49')][_0xd8c9('0x50')],_0x29ff68[_0xd8c9('0x49')][_0xd8c9('0x2a')]);return db[_0xd8c9('0x4c')][_0xd8c9('0x48')](_0x29ff68[_0xd8c9('0x49')],{'include':[{'model':db['DeskField'],'as':_0xd8c9('0x51')},{'model':db[_0xd8c9('0x52')],'as':_0xd8c9('0x53')}]});}return null;})[_0xd8c9('0x3e')](respondWithResult(_0x548217,null))[_0xd8c9('0x41')](handleError(_0x548217,null));};exports['getFields']=function(_0x41c155,_0x5c3dbe,_0x526f5c){var _0x230224=[{'name':_0xd8c9('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x54aeb2='';return db[_0xd8c9('0x3d')][_0xd8c9('0x4b')]({'where':{'id':_0x41c155['params']['id']},'attributes':['id',_0xd8c9('0x55'),_0xd8c9('0x56'),_0xd8c9('0x57'),_0xd8c9('0x58'),_0xd8c9('0x59'),_0xd8c9('0x5a'),'token',_0xd8c9('0x5b')]})[_0xd8c9('0x3e')](handleEntityNotFound(_0x5c3dbe,null))[_0xd8c9('0x3e')](function(_0x4f29fd){if(_0x4f29fd){_0x54aeb2=_0x4f29fd[_0xd8c9('0x55')];var _0x249e60=_0x54aeb2[_0xd8c9('0x5c')](-0x1);if(_0x249e60==='/'){_0x54aeb2=_0x54aeb2[_0xd8c9('0x5d')](0x0,_0x54aeb2[_0xd8c9('0x5e')](_0x249e60));}var _0x169881={'method':'GET','uri':util['format'](_0xd8c9('0x5f'),_0x54aeb2),'headers':{'Content-Type':_0xd8c9('0x60'),'Accept':_0xd8c9('0x60')},'json':!![]};if(_0x4f29fd['authType']===_0xd8c9('0x61')){_0x169881['headers']['Authorization']=util[_0xd8c9('0x62')]('Basic\x20%s',new Buffer(util[_0xd8c9('0x62')]('%s:%s',_0x4f29fd[_0xd8c9('0x57')],_0x4f29fd[_0xd8c9('0x58')]))[_0xd8c9('0x63')](_0xd8c9('0x64')));}return rp(_0x169881)[_0xd8c9('0x3e')](function(_0x3992eb){return _0x230224[_0xd8c9('0x65')](_[_0xd8c9('0x2d')](_0x3992eb[_0xd8c9('0x66')]['entries'],function(_0x4ee72c){return{'id':_0x4ee72c[_0xd8c9('0x26')],'name':_0x4ee72c[_0xd8c9('0x26')],'type':_0x4ee72c[_0xd8c9('0x2a')],'active':_0x4ee72c[_0xd8c9('0x67')],'label':_0x4ee72c['label'],'custom':!![]};}));});}})[_0xd8c9('0x3e')](function(_0xdf35ea){return{'count':_0xdf35ea[_0xd8c9('0x46')],'rows':_0xdf35ea};})[_0xd8c9('0x3e')](respondWithResult(_0x5c3dbe,null))[_0xd8c9('0x41')](function(_0xf7d6a5){var _0x2ec80c=_0x41c155[_0xd8c9('0x2e')][_0xd8c9('0x68')]?0x1f4:_0xf7d6a5[_0xd8c9('0x69')]||0x1f4;logger['error'](_0xd8c9('0x6a'),_0xd8c9('0x6b'),_0x2ec80c,JSON[_0xd8c9('0x6c')](_0xf7d6a5));delete _0xf7d6a5['name'];if(_0x2ec80c===0x191){_0x2ec80c=0x190;}_0x5c3dbe[_0xd8c9('0x18')](_0x2ec80c)[_0xd8c9('0x27')](_0x41c155[_0xd8c9('0x2e')]['test']?{'message':_0xd8c9('0x6d'),'statusCode':_0xf7d6a5[_0xd8c9('0x69')]}:_0xf7d6a5);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index caec31c..bb6162d 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 _0x527c=['exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x25a92f,_0x352bf0){var _0x1e43fe=function(_0x467615){while(--_0x467615){_0x25a92f['push'](_0x25a92f['shift']());}};_0x1e43fe(++_0x352bf0);}(_0x527c,0xf2));var _0xc527=function(_0x1e9d6a,_0x3e5cab){_0x1e9d6a=_0x1e9d6a-0x0;var _0x222bd1=_0x527c[_0x1e9d6a];return _0x222bd1;};'use strict';var _=require(_0xc527('0x0'));var util=require(_0xc527('0x1'));var logger=require('../../config/logger')(_0xc527('0x2'));var moment=require(_0xc527('0x3'));var BPromise=require(_0xc527('0x4'));var rp=require(_0xc527('0x5'));var fs=require('fs');var path=require(_0xc527('0x6'));var rimraf=require(_0xc527('0x7'));var config=require(_0xc527('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xc527('0x9'));module[_0xc527('0xa')]=function(_0x5aa791,_0x23d48b){return _0x5aa791[_0xc527('0xb')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x596f=['rimraf','../../config/environment','../../components/integrations/configuration','define','int_desk_accounts','util','../../config/logger','api','request-promise','path'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0x596f,0x18b));var _0xf596=function(_0x526623,_0x5b5bd7){_0x526623=_0x526623-0x0;var _0x555f18=_0x596f[_0x526623];return _0x555f18;};'use strict';var _=require('lodash');var util=require(_0xf596('0x0'));var logger=require(_0xf596('0x1'))(_0xf596('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf596('0x3'));var fs=require('fs');var path=require(_0xf596('0x4'));var rimraf=require(_0xf596('0x5'));var config=require(_0xf596('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xf596('0x7'));module['exports']=function(_0x51907b,_0x234494){return _0x51907b[_0xf596('0x8')]('DeskAccount',attributes,{'tableName':_0xf596('0x9'),'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 80dca4d..0d64572 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 _0x6c11=['http','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map','ShowDeskAccount','find','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5e5c35,_0xdab7e3){var _0x53ff31=function(_0x9a89d0){while(--_0x9a89d0){_0x5e5c35['push'](_0x5e5c35['shift']());}};_0x53ff31(++_0xdab7e3);}(_0x6c11,0xff));var _0x16c1=function(_0x2e9b83,_0x238187){_0x2e9b83=_0x2e9b83-0x0;var _0x569ce3=_0x6c11[_0x2e9b83];return _0x569ce3;};'use strict';var _=require(_0x16c1('0x0'));var util=require('util');var moment=require(_0x16c1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16c1('0x2'));var db=require(_0x16c1('0x3'))['db'];var utils=require(_0x16c1('0x4'));var logger=require(_0x16c1('0x5'))(_0x16c1('0x6'));var config=require('../../config/environment');var jayson=require(_0x16c1('0x7'));var client=jayson[_0x16c1('0x8')][_0x16c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4440,_0x3a700e,_0x1a785d){return new BPromise(function(_0x1669ef,_0x3e5034){return client['request'](_0x5d4440,_0x1a785d)[_0x16c1('0xa')](function(_0x42fcbf){logger[_0x16c1('0xb')]('DeskAccount,\x20%s,\x20%s',_0x3a700e,_0x16c1('0xc'));logger[_0x16c1('0xd')](_0x16c1('0xe'),_0x3a700e,_0x16c1('0xc'),JSON[_0x16c1('0xf')](_0x42fcbf));if(_0x42fcbf[_0x16c1('0x10')]){if(_0x42fcbf[_0x16c1('0x10')][_0x16c1('0x11')]===0x1f4){logger['error'](_0x16c1('0x12'),_0x3a700e,_0x42fcbf[_0x16c1('0x10')][_0x16c1('0x13')]);return _0x3e5034(_0x42fcbf['error'][_0x16c1('0x13')]);}logger[_0x16c1('0x10')]('DeskAccount,\x20%s,\x20%s',_0x3a700e,_0x42fcbf[_0x16c1('0x10')][_0x16c1('0x13')]);return _0x1669ef(_0x42fcbf[_0x16c1('0x10')][_0x16c1('0x13')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x3a700e,'request\x20sent');_0x1669ef(_0x42fcbf['result'][_0x16c1('0x13')]);}})[_0x16c1('0x14')](function(_0x26b892){logger[_0x16c1('0x10')](_0x16c1('0x12'),_0x3a700e,_0x26b892);_0x3e5034(_0x26b892);});});}exports[_0x16c1('0x15')]=function(_0x360c2e){var _0x3704b2=this;return new Promise(function(_0x185188,_0x5786a5){return db[_0x16c1('0x16')][_0x16c1('0x17')]({'raw':_0x360c2e[_0x16c1('0x18')]?_0x360c2e['options'][_0x16c1('0x19')]===undefined?!![]:![]:!![],'where':_0x360c2e[_0x16c1('0x18')]?_0x360c2e[_0x16c1('0x18')][_0x16c1('0x1a')]||null:null,'attributes':_0x360c2e[_0x16c1('0x18')]?_0x360c2e[_0x16c1('0x18')][_0x16c1('0x1b')]||null:null,'limit':_0x360c2e['options']?_0x360c2e[_0x16c1('0x18')]['limit']||null:null,'include':_0x360c2e[_0x16c1('0x18')]?_0x360c2e['options'][_0x16c1('0x1c')]?_['map'](_0x360c2e[_0x16c1('0x18')][_0x16c1('0x1c')],function(_0x163148){return{'model':db[_0x163148[_0x16c1('0x1d')]],'as':_0x163148['as'],'attributes':_0x163148[_0x16c1('0x1b')],'include':_0x163148[_0x16c1('0x1c')]?_[_0x16c1('0x1e')](_0x163148['include'],function(_0x3b146a){return{'model':db[_0x3b146a['model']],'as':_0x3b146a['as'],'attributes':_0x3b146a[_0x16c1('0x1b')],'include':_0x3b146a['include']?_[_0x16c1('0x1e')](_0x3b146a['include'],function(_0xe1ce02){return{'model':db[_0xe1ce02[_0x16c1('0x1d')]],'as':_0xe1ce02['as'],'attributes':_0xe1ce02[_0x16c1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x16c1('0xa')](function(_0x10cfdd){logger[_0x16c1('0xb')](_0x16c1('0x15'),_0x360c2e);logger['debug'](_0x16c1('0x15'),_0x360c2e,JSON[_0x16c1('0xf')](_0x10cfdd));_0x185188(_0x10cfdd);})[_0x16c1('0x14')](function(_0x2c2541){logger[_0x16c1('0x10')]('GetDeskAccount',_0x2c2541[_0x16c1('0x13')],_0x360c2e);_0x5786a5(_0x3704b2[_0x16c1('0x10')](0x1f4,_0x2c2541['message']));});});};exports[_0x16c1('0x1f')]=function(_0x4c2928){var _0x312925=this;return new Promise(function(_0x2d533b,_0x1e7b01){return db[_0x16c1('0x16')][_0x16c1('0x20')]({'raw':_0x4c2928[_0x16c1('0x18')]?_0x4c2928[_0x16c1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4c2928[_0x16c1('0x18')]?_0x4c2928['options']['where']||null:null,'attributes':_0x4c2928['options']?_0x4c2928['options'][_0x16c1('0x1b')]||null:null,'include':_0x4c2928[_0x16c1('0x18')]?_0x4c2928['options'][_0x16c1('0x1c')]?_[_0x16c1('0x1e')](_0x4c2928[_0x16c1('0x18')]['include'],function(_0x48c4bc){return{'model':db[_0x48c4bc['model']],'as':_0x48c4bc['as'],'attributes':_0x48c4bc['attributes'],'include':_0x48c4bc[_0x16c1('0x1c')]?_[_0x16c1('0x1e')](_0x48c4bc[_0x16c1('0x1c')],function(_0x498966){return{'model':db[_0x498966[_0x16c1('0x1d')]],'as':_0x498966['as'],'attributes':_0x498966[_0x16c1('0x1b')],'include':_0x498966[_0x16c1('0x1c')]?_[_0x16c1('0x1e')](_0x498966[_0x16c1('0x1c')],function(_0x5d1aaa){return{'model':db[_0x5d1aaa[_0x16c1('0x1d')]],'as':_0x5d1aaa['as'],'attributes':_0x5d1aaa[_0x16c1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x16c1('0xa')](function(_0xbdf97d){logger['info'](_0x16c1('0x1f'),_0x4c2928);logger[_0x16c1('0xd')](_0x16c1('0x1f'),_0x4c2928,JSON[_0x16c1('0xf')](_0xbdf97d));_0x2d533b(_0xbdf97d);})['catch'](function(_0x45a758){logger[_0x16c1('0x10')](_0x16c1('0x1f'),_0x45a758['message'],_0x4c2928);_0x1e7b01(_0x312925['error'](0x1f4,_0x45a758[_0x16c1('0x13')]));});});}; \ No newline at end of file +var _0xa867=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x2bc61d,_0x11d00a){var _0x1a2c54=function(_0x2a0d89){while(--_0x2a0d89){_0x2bc61d['push'](_0x2bc61d['shift']());}};_0x1a2c54(++_0x11d00a);}(_0xa867,0x12d));var _0x7a86=function(_0x1a4b24,_0x455ac1){_0x1a4b24=_0x1a4b24-0x0;var _0x1b33b4=_0xa867[_0x1a4b24];return _0x1b33b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a86('0x0'));var fs=require('fs');var Redis=require(_0x7a86('0x1'));var db=require(_0x7a86('0x2'))['db'];var utils=require(_0x7a86('0x3'));var logger=require(_0x7a86('0x4'))(_0x7a86('0x5'));var config=require('../../config/environment');var jayson=require(_0x7a86('0x6'));var client=jayson[_0x7a86('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b9f8e,_0x4e41e3,_0x3aec3f){return new BPromise(function(_0x2c87bc,_0x5ec534){return client['request'](_0x1b9f8e,_0x3aec3f)[_0x7a86('0x8')](function(_0x164cef){logger[_0x7a86('0x9')](_0x7a86('0xa'),_0x4e41e3,_0x7a86('0xb'));logger[_0x7a86('0xc')](_0x7a86('0xd'),_0x4e41e3,_0x7a86('0xb'),JSON['stringify'](_0x164cef));if(_0x164cef['error']){if(_0x164cef[_0x7a86('0xe')][_0x7a86('0xf')]===0x1f4){logger['error'](_0x7a86('0xa'),_0x4e41e3,_0x164cef[_0x7a86('0xe')][_0x7a86('0x10')]);return _0x5ec534(_0x164cef['error'][_0x7a86('0x10')]);}logger[_0x7a86('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4e41e3,_0x164cef[_0x7a86('0xe')][_0x7a86('0x10')]);return _0x2c87bc(_0x164cef[_0x7a86('0xe')][_0x7a86('0x10')]);}else{logger[_0x7a86('0x9')](_0x7a86('0xa'),_0x4e41e3,'request\x20sent');_0x2c87bc(_0x164cef[_0x7a86('0x11')][_0x7a86('0x10')]);}})[_0x7a86('0x12')](function(_0x34dcd1){logger['error'](_0x7a86('0xa'),_0x4e41e3,_0x34dcd1);_0x5ec534(_0x34dcd1);});});}exports[_0x7a86('0x13')]=function(_0x27fd07){var _0x2c10b5=this;return new Promise(function(_0x4dba0c,_0x414819){return db[_0x7a86('0x14')]['findAll']({'raw':_0x27fd07[_0x7a86('0x15')]?_0x27fd07[_0x7a86('0x15')][_0x7a86('0x16')]===undefined?!![]:![]:!![],'where':_0x27fd07['options']?_0x27fd07[_0x7a86('0x15')][_0x7a86('0x17')]||null:null,'attributes':_0x27fd07['options']?_0x27fd07[_0x7a86('0x15')][_0x7a86('0x18')]||null:null,'limit':_0x27fd07[_0x7a86('0x15')]?_0x27fd07[_0x7a86('0x15')][_0x7a86('0x19')]||null:null,'include':_0x27fd07[_0x7a86('0x15')]?_0x27fd07[_0x7a86('0x15')][_0x7a86('0x1a')]?_[_0x7a86('0x1b')](_0x27fd07[_0x7a86('0x15')][_0x7a86('0x1a')],function(_0x3f065c){return{'model':db[_0x3f065c['model']],'as':_0x3f065c['as'],'attributes':_0x3f065c['attributes'],'include':_0x3f065c[_0x7a86('0x1a')]?_[_0x7a86('0x1b')](_0x3f065c['include'],function(_0x13a961){return{'model':db[_0x13a961[_0x7a86('0x1c')]],'as':_0x13a961['as'],'attributes':_0x13a961['attributes'],'include':_0x13a961[_0x7a86('0x1a')]?_['map'](_0x13a961[_0x7a86('0x1a')],function(_0x59abf0){return{'model':db[_0x59abf0[_0x7a86('0x1c')]],'as':_0x59abf0['as'],'attributes':_0x59abf0[_0x7a86('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7a86('0x8')](function(_0x29c4c8){logger['info']('GetDeskAccount',_0x27fd07);logger[_0x7a86('0xc')](_0x7a86('0x13'),_0x27fd07,JSON[_0x7a86('0x1d')](_0x29c4c8));_0x4dba0c(_0x29c4c8);})[_0x7a86('0x12')](function(_0x4f6b64){logger[_0x7a86('0xe')](_0x7a86('0x13'),_0x4f6b64[_0x7a86('0x10')],_0x27fd07);_0x414819(_0x2c10b5[_0x7a86('0xe')](0x1f4,_0x4f6b64[_0x7a86('0x10')]));});});};exports[_0x7a86('0x1e')]=function(_0x1d0d22){var _0x215920=this;return new Promise(function(_0x247b66,_0x549e1e){return db[_0x7a86('0x14')]['find']({'raw':_0x1d0d22['options']?_0x1d0d22[_0x7a86('0x15')][_0x7a86('0x16')]===undefined?!![]:![]:!![],'where':_0x1d0d22[_0x7a86('0x15')]?_0x1d0d22[_0x7a86('0x15')][_0x7a86('0x17')]||null:null,'attributes':_0x1d0d22[_0x7a86('0x15')]?_0x1d0d22[_0x7a86('0x15')]['attributes']||null:null,'include':_0x1d0d22['options']?_0x1d0d22['options'][_0x7a86('0x1a')]?_['map'](_0x1d0d22[_0x7a86('0x15')][_0x7a86('0x1a')],function(_0x4bec27){return{'model':db[_0x4bec27['model']],'as':_0x4bec27['as'],'attributes':_0x4bec27['attributes'],'include':_0x4bec27[_0x7a86('0x1a')]?_[_0x7a86('0x1b')](_0x4bec27[_0x7a86('0x1a')],function(_0x52217f){return{'model':db[_0x52217f[_0x7a86('0x1c')]],'as':_0x52217f['as'],'attributes':_0x52217f[_0x7a86('0x18')],'include':_0x52217f[_0x7a86('0x1a')]?_[_0x7a86('0x1b')](_0x52217f[_0x7a86('0x1a')],function(_0x3ff4af){return{'model':db[_0x3ff4af[_0x7a86('0x1c')]],'as':_0x3ff4af['as'],'attributes':_0x3ff4af[_0x7a86('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7a86('0x8')](function(_0x175a76){logger[_0x7a86('0x9')](_0x7a86('0x1e'),_0x1d0d22);logger['debug']('ShowDeskAccount',_0x1d0d22,JSON[_0x7a86('0x1d')](_0x175a76));_0x247b66(_0x175a76);})['catch'](function(_0x5a4d29){logger[_0x7a86('0xe')](_0x7a86('0x1e'),_0x5a4d29[_0x7a86('0x10')],_0x1d0d22);_0x549e1e(_0x215920[_0x7a86('0xe')](0x1f4,_0x5a4d29[_0x7a86('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a352a75..f12ec9e 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59cb2a,_0x579e33){var _0x1ed1a8=function(_0x26c716){while(--_0x26c716){_0x59cb2a['push'](_0x59cb2a['shift']());}};_0x1ed1a8(++_0x579e33);}(_0x008c,0x188));var _0xc008=function(_0x2287df,_0x5a4a24){_0x2287df=_0x2287df-0x0;var _0x2afbc1=_0x008c[_0x2287df];return _0x2afbc1;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x2cab2b,_0x463cfd){var _0x348185=function(_0x1dcc15){while(--_0x1dcc15){_0x2cab2b['push'](_0x2cab2b['shift']());}};_0x348185(++_0x463cfd);}(_0x3e74,0x175));var _0x43e7=function(_0x19c0f1,_0x65c5d0){_0x19c0f1=_0x19c0f1-0x0;var _0x7122d1=_0x3e74[_0x19c0f1];return _0x7122d1;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index beee4d4..7be0be3 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 _0xd43b=['STRING','sequelize','exports'];(function(_0x494e72,_0x5f1178){var _0x2d3947=function(_0x165f2b){while(--_0x165f2b){_0x494e72['push'](_0x494e72['shift']());}};_0x2d3947(++_0x5f1178);}(_0xd43b,0xaf));var _0xbd43=function(_0x43a48f,_0x6797c6){_0x43a48f=_0x43a48f-0x0;var _0x1bde3c=_0xd43b[_0x43a48f];return _0x1bde3c;};'use strict';var Sequelize=require(_0xbd43('0x0'));module[_0xbd43('0x1')]={'name':{'type':Sequelize[_0xbd43('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa9d7=['sequelize','STRING'];(function(_0x5220fc,_0x5dbbfb){var _0x2f50c0=function(_0x4e457e){while(--_0x4e457e){_0x5220fc['push'](_0x5220fc['shift']());}};_0x2f50c0(++_0x5dbbfb);}(_0xa9d7,0x11c));var _0x7a9d=function(_0x28a0e1,_0x38ecdb){_0x28a0e1=_0x28a0e1-0x0;var _0x2cfa79=_0xa9d7[_0x28a0e1];return _0x2cfa79;};'use strict';var Sequelize=require(_0x7a9d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7a9d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7c0d72f..6299552 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 _0x0402=['apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','model','query','keys','filters','attributes','intersection','length','limit','order','sort','pick','filter','where','merge','VIRTUAL','DeskConfiguration','includeAll','include','catch','show','fields','options','find','create','body','getFields','findOne','params','DeskField','hasOwnProperty','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x0402,0x179));var _0x2040=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x0402[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2040('0x0'));var zipdir=require(_0x2040('0x1'));var jsonpatch=require(_0x2040('0x2'));var rp=require(_0x2040('0x3'));var moment=require('moment');var BPromise=require(_0x2040('0x4'));var Mustache=require(_0x2040('0x5'));var util=require(_0x2040('0x6'));var path=require('path');var sox=require(_0x2040('0x7'));var csv=require(_0x2040('0x8'));var ejs=require(_0x2040('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2040('0xa'));var squel=require(_0x2040('0xb'));var crypto=require(_0x2040('0xc'));var jsforce=require(_0x2040('0xd'));var deskjs=require(_0x2040('0xe'));var toCsv=require(_0x2040('0x8'));var querystring=require('querystring');var Papa=require(_0x2040('0xf'));var Redis=require('ioredis');var authService=require(_0x2040('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2040('0x11'));var hardwareService=require(_0x2040('0x12'));var logger=require(_0x2040('0x13'))(_0x2040('0x14'));var utils=require('../../config/utils');var config=require(_0x2040('0x15'));var licenseUtil=require(_0x2040('0x16'));var db=require(_0x2040('0x17'))['db'];function respondWithStatusCode(_0x3c6beb,_0x552c3e){_0x552c3e=_0x552c3e||0xcc;return function(_0x5c7d4e){if(_0x5c7d4e){return _0x3c6beb[_0x2040('0x18')](_0x552c3e);}return _0x3c6beb['status'](_0x552c3e)[_0x2040('0x19')]();};}function respondWithResult(_0x4ed46f,_0xd9d225){_0xd9d225=_0xd9d225||0xc8;return function(_0x112f1b){if(_0x112f1b){return _0x4ed46f[_0x2040('0x1a')](_0xd9d225)[_0x2040('0x1b')](_0x112f1b);}};}function respondWithFilteredResult(_0x49b904,_0x19a1d2){return function(_0xabfaec){if(_0xabfaec){var _0x4781b4=typeof _0x19a1d2[_0x2040('0x1c')]===_0x2040('0x1d')&&typeof _0x19a1d2['limit']==='undefined';var _0x1df885=_0xabfaec[_0x2040('0x1e')];var _0x1e2068=_0x4781b4?0x0:_0x19a1d2[_0x2040('0x1c')];var _0x40d8ea=_0x4781b4?_0xabfaec['count']:_0x19a1d2[_0x2040('0x1c')]+_0x19a1d2['limit'];var _0x2ec595;if(_0x40d8ea>=_0x1df885){_0x40d8ea=_0x1df885;_0x2ec595=0xc8;}else{_0x2ec595=0xce;}_0x49b904[_0x2040('0x1a')](_0x2ec595);return _0x49b904[_0x2040('0x1f')](_0x2040('0x20'),_0x1e2068+'-'+_0x40d8ea+'/'+_0x1df885)[_0x2040('0x1b')](_0xabfaec);}return null;};}function patchUpdates(_0x72b36d){return function(_0x4854d1){try{jsonpatch[_0x2040('0x21')](_0x4854d1,_0x72b36d,!![]);}catch(_0x2bb40e){return BPromise[_0x2040('0x22')](_0x2bb40e);}return _0x4854d1[_0x2040('0x23')]();};}function saveUpdates(_0x3607ac,_0x8189e3){return function(_0x5de057){if(_0x5de057){return _0x5de057[_0x2040('0x24')](_0x3607ac)[_0x2040('0x25')](function(_0x20114c){return _0x20114c;});}return null;};}function removeEntity(_0x1f5532,_0x4e9ab4){return function(_0x1dcdb3){if(_0x1dcdb3){return _0x1dcdb3[_0x2040('0x26')]()[_0x2040('0x25')](function(){_0x1f5532[_0x2040('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x338c36,_0x49b7e4){return function(_0x29ed68){if(!_0x29ed68){_0x338c36['sendStatus'](0x194);}return _0x29ed68;};}function handleError(_0x4b20d3,_0x2bd0c9){_0x2bd0c9=_0x2bd0c9||0x1f4;return function(_0x3d5857){logger[_0x2040('0x27')](_0x3d5857['stack']);if(_0x3d5857[_0x2040('0x28')]){delete _0x3d5857[_0x2040('0x28')];}_0x4b20d3[_0x2040('0x1a')](_0x2bd0c9)[_0x2040('0x29')](_0x3d5857);};}exports[_0x2040('0x2a')]=function(_0x513385,_0x7e9b3b){var _0x3bf5db={},_0x38872e={},_0x221997={'count':0x0,'rows':[]};var _0x3486a3=_[_0x2040('0x2b')](db['DeskConfiguration'][_0x2040('0x2c')],function(_0x717d04){return{'name':_0x717d04['fieldName'],'type':_0x717d04['type']['key']};});_0x38872e[_0x2040('0x2d')]=_[_0x2040('0x2b')](_0x3486a3,'name');_0x38872e[_0x2040('0x2e')]=_[_0x2040('0x2f')](_0x513385[_0x2040('0x2e')]);_0x38872e[_0x2040('0x30')]=_['intersection'](_0x38872e[_0x2040('0x2d')],_0x38872e['query']);_0x3bf5db[_0x2040('0x31')]=_[_0x2040('0x32')](_0x38872e['model'],qs['fields'](_0x513385[_0x2040('0x2e')]['fields']));_0x3bf5db[_0x2040('0x31')]=_0x3bf5db[_0x2040('0x31')][_0x2040('0x33')]?_0x3bf5db[_0x2040('0x31')]:_0x38872e[_0x2040('0x2d')];if(!_0x513385[_0x2040('0x2e')]['hasOwnProperty']('nolimit')){_0x3bf5db[_0x2040('0x34')]=qs[_0x2040('0x34')](_0x513385[_0x2040('0x2e')][_0x2040('0x34')]);_0x3bf5db[_0x2040('0x1c')]=qs[_0x2040('0x1c')](_0x513385[_0x2040('0x2e')][_0x2040('0x1c')]);}_0x3bf5db[_0x2040('0x35')]=qs[_0x2040('0x36')](_0x513385[_0x2040('0x2e')][_0x2040('0x36')]);_0x3bf5db['where']=qs[_0x2040('0x30')](_[_0x2040('0x37')](_0x513385['query'],_0x38872e['filters']),_0x3486a3);if(_0x513385[_0x2040('0x2e')][_0x2040('0x38')]){_0x3bf5db[_0x2040('0x39')]=_[_0x2040('0x3a')](_0x3bf5db[_0x2040('0x39')],{'$or':_[_0x2040('0x2b')](_0x3486a3,function(_0x10221b){if(_0x10221b['type']!==_0x2040('0x3b')){var _0x515490={};_0x515490[_0x10221b['name']]={'$like':'%'+_0x513385['query'][_0x2040('0x38')]+'%'};return _0x515490;}})});}_0x3bf5db=_[_0x2040('0x3a')]({},_0x3bf5db,_0x513385['options']);var _0x3fa292={'where':_0x3bf5db[_0x2040('0x39')]};return db[_0x2040('0x3c')][_0x2040('0x1e')](_0x3fa292)['then'](function(_0x2ce6c9){_0x221997[_0x2040('0x1e')]=_0x2ce6c9;if(_0x513385[_0x2040('0x2e')][_0x2040('0x3d')]){_0x3bf5db[_0x2040('0x3e')]=[{'all':!![]}];}return db[_0x2040('0x3c')]['findAll'](_0x3bf5db);})[_0x2040('0x25')](function(_0x589418){_0x221997['rows']=_0x589418;return _0x221997;})[_0x2040('0x25')](respondWithFilteredResult(_0x7e9b3b,_0x3bf5db))[_0x2040('0x3f')](handleError(_0x7e9b3b,null));};exports[_0x2040('0x40')]=function(_0x4b97c3,_0x4cf008){var _0x42abff={'raw':![],'where':{'id':_0x4b97c3['params']['id']}},_0x579c47={};_0x579c47['model']=_[_0x2040('0x2f')](db[_0x2040('0x3c')]['rawAttributes']);_0x579c47[_0x2040('0x2e')]=_[_0x2040('0x2f')](_0x4b97c3['query']);_0x579c47[_0x2040('0x30')]=_[_0x2040('0x32')](_0x579c47[_0x2040('0x2d')],_0x579c47[_0x2040('0x2e')]);_0x42abff[_0x2040('0x31')]=_['intersection'](_0x579c47[_0x2040('0x2d')],qs[_0x2040('0x41')](_0x4b97c3[_0x2040('0x2e')]['fields']));_0x42abff[_0x2040('0x31')]=_0x42abff[_0x2040('0x31')][_0x2040('0x33')]?_0x42abff[_0x2040('0x31')]:_0x579c47[_0x2040('0x2d')];if(_0x4b97c3[_0x2040('0x2e')][_0x2040('0x3d')]){_0x42abff[_0x2040('0x3e')]=[{'all':!![]}];}_0x42abff=_['merge']({},_0x42abff,_0x4b97c3[_0x2040('0x42')]);return db[_0x2040('0x3c')][_0x2040('0x43')](_0x42abff)[_0x2040('0x25')](handleEntityNotFound(_0x4cf008,null))[_0x2040('0x25')](respondWithResult(_0x4cf008,null))[_0x2040('0x3f')](handleError(_0x4cf008,null));};exports[_0x2040('0x44')]=function(_0x2d4018,_0x51dead){return db[_0x2040('0x3c')]['create'](_0x2d4018[_0x2040('0x45')],{})[_0x2040('0x25')](respondWithResult(_0x51dead,0xc9))[_0x2040('0x3f')](handleError(_0x51dead,null));};exports[_0x2040('0x24')]=function(_0x1368d0,_0x163023){if(_0x1368d0[_0x2040('0x45')]['id']){delete _0x1368d0[_0x2040('0x45')]['id'];}return db[_0x2040('0x3c')]['find']({'where':{'id':_0x1368d0['params']['id']}})['then'](handleEntityNotFound(_0x163023,null))[_0x2040('0x25')](saveUpdates(_0x1368d0[_0x2040('0x45')],null))[_0x2040('0x25')](respondWithResult(_0x163023,null))[_0x2040('0x3f')](handleError(_0x163023,null));};exports['destroy']=function(_0xb2f184,_0x451169){return db[_0x2040('0x3c')][_0x2040('0x43')]({'where':{'id':_0xb2f184['params']['id']}})['then'](handleEntityNotFound(_0x451169,null))[_0x2040('0x25')](removeEntity(_0x451169,null))['catch'](handleError(_0x451169,null));};exports[_0x2040('0x46')]=function(_0x305a62,_0x4aef7a,_0x36dfa0){var _0x1cf7ec={};var _0x5386d7={};var _0x181fce;var _0x2b6a3f;return db['DeskConfiguration'][_0x2040('0x47')]({'where':{'id':_0x305a62[_0x2040('0x48')]['id']}})[_0x2040('0x25')](handleEntityNotFound(_0x4aef7a,null))[_0x2040('0x25')](function(_0x21dc84){if(_0x21dc84){_0x181fce=_0x21dc84;_0x5386d7[_0x2040('0x2d')]=_[_0x2040('0x2f')](db[_0x2040('0x49')]['rawAttributes']);_0x5386d7[_0x2040('0x2e')]=_[_0x2040('0x2f')](_0x305a62[_0x2040('0x2e')]);_0x5386d7['filters']=_['intersection'](_0x5386d7[_0x2040('0x2d')],_0x5386d7[_0x2040('0x2e')]);_0x1cf7ec[_0x2040('0x31')]=_['intersection'](_0x5386d7[_0x2040('0x2d')],qs[_0x2040('0x41')](_0x305a62[_0x2040('0x2e')][_0x2040('0x41')]));_0x1cf7ec[_0x2040('0x31')]=_0x1cf7ec['attributes'][_0x2040('0x33')]?_0x1cf7ec['attributes']:_0x5386d7[_0x2040('0x2d')];_0x1cf7ec[_0x2040('0x35')]=qs[_0x2040('0x36')](_0x305a62['query'][_0x2040('0x36')]);_0x1cf7ec[_0x2040('0x39')]=qs[_0x2040('0x30')](_['pick'](_0x305a62[_0x2040('0x2e')],_0x5386d7['filters']));if(_0x305a62[_0x2040('0x2e')][_0x2040('0x38')]){_0x1cf7ec[_0x2040('0x39')]=_[_0x2040('0x3a')](_0x1cf7ec[_0x2040('0x39')],{'$or':_[_0x2040('0x2b')](_0x1cf7ec['attributes'],function(_0x5724ff){var _0x1ce105={};_0x1ce105[_0x5724ff]={'$like':'%'+_0x305a62[_0x2040('0x2e')]['filter']+'%'};return _0x1ce105;})});}_0x1cf7ec=_[_0x2040('0x3a')]({},_0x1cf7ec,_0x305a62['options']);return _0x181fce['getFields'](_0x1cf7ec);}})[_0x2040('0x25')](function(_0x199c8e){if(_0x199c8e){_0x2b6a3f=_0x199c8e[_0x2040('0x33')];if(!_0x305a62[_0x2040('0x2e')][_0x2040('0x4a')](_0x2040('0x4b'))){_0x1cf7ec[_0x2040('0x34')]=qs[_0x2040('0x34')](_0x305a62[_0x2040('0x2e')][_0x2040('0x34')]);_0x1cf7ec[_0x2040('0x1c')]=qs[_0x2040('0x1c')](_0x305a62[_0x2040('0x2e')]['offset']);}return _0x181fce[_0x2040('0x46')](_0x1cf7ec);}})[_0x2040('0x25')](function(_0x48394d){if(_0x48394d){return _0x48394d?{'count':_0x2b6a3f,'rows':_0x48394d}:null;}})[_0x2040('0x25')](respondWithResult(_0x4aef7a,null))[_0x2040('0x3f')](handleError(_0x4aef7a,null));};exports[_0x2040('0x4c')]=function(_0x511fa4,_0x45abed,_0x2af3da){var _0x263a6f={};var _0x93245d={};var _0x4e9c09;var _0x10f4db;return db[_0x2040('0x3c')][_0x2040('0x47')]({'where':{'id':_0x511fa4['params']['id']}})[_0x2040('0x25')](handleEntityNotFound(_0x45abed,null))[_0x2040('0x25')](function(_0x16290f){if(_0x16290f){_0x4e9c09=_0x16290f;_0x93245d['model']=_[_0x2040('0x2f')](db[_0x2040('0x49')][_0x2040('0x2c')]);_0x93245d[_0x2040('0x2e')]=_['keys'](_0x511fa4[_0x2040('0x2e')]);_0x93245d[_0x2040('0x30')]=_[_0x2040('0x32')](_0x93245d[_0x2040('0x2d')],_0x93245d[_0x2040('0x2e')]);_0x263a6f[_0x2040('0x31')]=_[_0x2040('0x32')](_0x93245d[_0x2040('0x2d')],qs[_0x2040('0x41')](_0x511fa4[_0x2040('0x2e')][_0x2040('0x41')]));_0x263a6f[_0x2040('0x31')]=_0x263a6f[_0x2040('0x31')][_0x2040('0x33')]?_0x263a6f[_0x2040('0x31')]:_0x93245d[_0x2040('0x2d')];_0x263a6f[_0x2040('0x35')]=qs[_0x2040('0x36')](_0x511fa4[_0x2040('0x2e')][_0x2040('0x36')]);_0x263a6f[_0x2040('0x39')]=qs[_0x2040('0x30')](_[_0x2040('0x37')](_0x511fa4[_0x2040('0x2e')],_0x93245d[_0x2040('0x30')]));if(_0x511fa4['query'][_0x2040('0x38')]){_0x263a6f[_0x2040('0x39')]=_[_0x2040('0x3a')](_0x263a6f[_0x2040('0x39')],{'$or':_[_0x2040('0x2b')](_0x263a6f[_0x2040('0x31')],function(_0x12140c){var _0x369206={};_0x369206[_0x12140c]={'$like':'%'+_0x511fa4[_0x2040('0x2e')][_0x2040('0x38')]+'%'};return _0x369206;})});}_0x263a6f=_[_0x2040('0x3a')]({},_0x263a6f,_0x511fa4[_0x2040('0x42')]);return _0x4e9c09[_0x2040('0x4c')](_0x263a6f);}})[_0x2040('0x25')](function(_0x242902){if(_0x242902){_0x10f4db=_0x242902[_0x2040('0x33')];if(!_0x511fa4[_0x2040('0x2e')][_0x2040('0x4a')](_0x2040('0x4b'))){_0x263a6f[_0x2040('0x34')]=qs['limit'](_0x511fa4[_0x2040('0x2e')][_0x2040('0x34')]);_0x263a6f[_0x2040('0x1c')]=qs[_0x2040('0x1c')](_0x511fa4[_0x2040('0x2e')][_0x2040('0x1c')]);}return _0x4e9c09[_0x2040('0x4c')](_0x263a6f);}})[_0x2040('0x25')](function(_0x5738fc){if(_0x5738fc){return _0x5738fc?{'count':_0x10f4db,'rows':_0x5738fc}:null;}})[_0x2040('0x25')](respondWithResult(_0x45abed,null))['catch'](handleError(_0x45abed,null));};exports[_0x2040('0x4d')]=function(_0x482971,_0x138cc4,_0x17b35b){var _0x33732a={};var _0x3eceab={};var _0x1d8d5b;var _0x4511a7;return db[_0x2040('0x3c')][_0x2040('0x47')]({'where':{'id':_0x482971[_0x2040('0x48')]['id']}})[_0x2040('0x25')](handleEntityNotFound(_0x138cc4,null))[_0x2040('0x25')](function(_0xc23e98){if(_0xc23e98){_0x1d8d5b=_0xc23e98;_0x3eceab[_0x2040('0x2d')]=_['keys'](db['DeskField'][_0x2040('0x2c')]);_0x3eceab[_0x2040('0x2e')]=_['keys'](_0x482971[_0x2040('0x2e')]);_0x3eceab[_0x2040('0x30')]=_[_0x2040('0x32')](_0x3eceab[_0x2040('0x2d')],_0x3eceab[_0x2040('0x2e')]);_0x33732a['attributes']=_[_0x2040('0x32')](_0x3eceab['model'],qs[_0x2040('0x41')](_0x482971['query'][_0x2040('0x41')]));_0x33732a['attributes']=_0x33732a[_0x2040('0x31')][_0x2040('0x33')]?_0x33732a[_0x2040('0x31')]:_0x3eceab[_0x2040('0x2d')];_0x33732a[_0x2040('0x35')]=qs[_0x2040('0x36')](_0x482971['query']['sort']);_0x33732a[_0x2040('0x39')]=qs['filters'](_[_0x2040('0x37')](_0x482971[_0x2040('0x2e')],_0x3eceab[_0x2040('0x30')]));if(_0x482971[_0x2040('0x2e')][_0x2040('0x38')]){_0x33732a[_0x2040('0x39')]=_['merge'](_0x33732a['where'],{'$or':_[_0x2040('0x2b')](_0x33732a[_0x2040('0x31')],function(_0x466bf8){var _0x2c2c6f={};_0x2c2c6f[_0x466bf8]={'$like':'%'+_0x482971[_0x2040('0x2e')]['filter']+'%'};return _0x2c2c6f;})});}_0x33732a=_['merge']({},_0x33732a,_0x482971[_0x2040('0x42')]);return _0x1d8d5b[_0x2040('0x4d')](_0x33732a);}})['then'](function(_0x171666){if(_0x171666){_0x4511a7=_0x171666[_0x2040('0x33')];if(!_0x482971[_0x2040('0x2e')][_0x2040('0x4a')](_0x2040('0x4b'))){_0x33732a[_0x2040('0x34')]=qs[_0x2040('0x34')](_0x482971[_0x2040('0x2e')]['limit']);_0x33732a[_0x2040('0x1c')]=qs['offset'](_0x482971[_0x2040('0x2e')]['offset']);}return _0x1d8d5b[_0x2040('0x4d')](_0x33732a);}})[_0x2040('0x25')](function(_0x390eb1){if(_0x390eb1){return _0x390eb1?{'count':_0x4511a7,'rows':_0x390eb1}:null;}})['then'](respondWithResult(_0x138cc4,null))[_0x2040('0x3f')](handleError(_0x138cc4,null));};exports['getTags']=function(_0x23475a,_0x22868b,_0x55ec8f){var _0x2ebcd3={};var _0x5939dd={};var _0x1cf946;var _0x36e3f5;return db[_0x2040('0x3c')][_0x2040('0x47')]({'where':{'id':_0x23475a[_0x2040('0x48')]['id']}})[_0x2040('0x25')](handleEntityNotFound(_0x22868b,null))['then'](function(_0x52b330){if(_0x52b330){_0x1cf946=_0x52b330;_0x5939dd['model']=_[_0x2040('0x2f')](db[_0x2040('0x4e')][_0x2040('0x2c')]);_0x5939dd[_0x2040('0x2e')]=_['keys'](_0x23475a[_0x2040('0x2e')]);_0x5939dd[_0x2040('0x30')]=_[_0x2040('0x32')](_0x5939dd[_0x2040('0x2d')],_0x5939dd[_0x2040('0x2e')]);_0x2ebcd3[_0x2040('0x31')]=_['intersection'](_0x5939dd[_0x2040('0x2d')],qs['fields'](_0x23475a['query'][_0x2040('0x41')]));_0x2ebcd3['attributes']=_0x2ebcd3[_0x2040('0x31')][_0x2040('0x33')]?_0x2ebcd3[_0x2040('0x31')]:_0x5939dd[_0x2040('0x2d')];_0x2ebcd3['order']=qs[_0x2040('0x36')](_0x23475a[_0x2040('0x2e')]['sort']);_0x2ebcd3[_0x2040('0x39')]=qs[_0x2040('0x30')](_[_0x2040('0x37')](_0x23475a[_0x2040('0x2e')],_0x5939dd['filters']));if(_0x23475a[_0x2040('0x2e')][_0x2040('0x38')]){_0x2ebcd3[_0x2040('0x39')]=_[_0x2040('0x3a')](_0x2ebcd3['where'],{'$or':_[_0x2040('0x2b')](_0x2ebcd3[_0x2040('0x31')],function(_0x47a1fd){var _0xe8d7de={};_0xe8d7de[_0x47a1fd]={'$like':'%'+_0x23475a[_0x2040('0x2e')]['filter']+'%'};return _0xe8d7de;})});}_0x2ebcd3=_['merge']({},_0x2ebcd3,_0x23475a['options']);return _0x1cf946[_0x2040('0x4f')](_0x2ebcd3);}})[_0x2040('0x25')](function(_0x4ac4c2){if(_0x4ac4c2){_0x36e3f5=_0x4ac4c2[_0x2040('0x33')];if(!_0x23475a[_0x2040('0x2e')][_0x2040('0x4a')]('nolimit')){_0x2ebcd3['limit']=qs[_0x2040('0x34')](_0x23475a[_0x2040('0x2e')][_0x2040('0x34')]);_0x2ebcd3['offset']=qs['offset'](_0x23475a['query'][_0x2040('0x1c')]);}return _0x1cf946[_0x2040('0x4f')](_0x2ebcd3);}})['then'](function(_0xc29370){if(_0xc29370){return _0xc29370?{'count':_0x36e3f5,'rows':_0xc29370}:null;}})[_0x2040('0x25')](respondWithResult(_0x22868b,null))[_0x2040('0x3f')](handleError(_0x22868b,null));};exports['setTags']=function(_0x496886,_0x325afc,_0xf33c0e){if(_0x496886[_0x2040('0x45')]['id']){delete _0x496886['body']['id'];}return db['DeskConfiguration'][_0x2040('0x47')]({'where':{'id':_0x496886[_0x2040('0x48')]['id']}})['then'](handleEntityNotFound(_0x325afc,null))['then'](function(_0x5e796e){if(_0x5e796e){return _0x5e796e[_0x2040('0x50')](_0x496886[_0x2040('0x45')][_0x2040('0x51')]||[]);}return null;})[_0x2040('0x25')](respondWithResult(_0x325afc,null))['catch'](handleError(_0x325afc,null));}; \ No newline at end of file +var _0x7b4e=['map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','create','body','findOne','params','DeskField','getFields','getSubjects','getDescriptions','order','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x4a020b,_0x2d784b){var _0x12d5b2=function(_0x53c036){while(--_0x53c036){_0x4a020b['push'](_0x4a020b['shift']());}};_0x12d5b2(++_0x2d784b);}(_0x7b4e,0x185));var _0xe7b4=function(_0x263152,_0x45ee79){_0x263152=_0x263152-0x0;var _0x225f0c=_0x7b4e[_0x263152];return _0x225f0c;};'use strict';var emlformat=require(_0xe7b4('0x0'));var rimraf=require(_0xe7b4('0x1'));var zipdir=require(_0xe7b4('0x2'));var jsonpatch=require(_0xe7b4('0x3'));var rp=require(_0xe7b4('0x4'));var moment=require(_0xe7b4('0x5'));var BPromise=require(_0xe7b4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe7b4('0x7'));var csv=require(_0xe7b4('0x8'));var ejs=require(_0xe7b4('0x9'));var fs=require('fs');var fs_extra=require(_0xe7b4('0xa'));var _=require(_0xe7b4('0xb'));var squel=require(_0xe7b4('0xc'));var crypto=require(_0xe7b4('0xd'));var jsforce=require(_0xe7b4('0xe'));var deskjs=require(_0xe7b4('0xf'));var toCsv=require(_0xe7b4('0x8'));var querystring=require(_0xe7b4('0x10'));var Papa=require('papaparse');var Redis=require(_0xe7b4('0x11'));var authService=require(_0xe7b4('0x12'));var qs=require(_0xe7b4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7b4('0x14'));var logger=require(_0xe7b4('0x15'))(_0xe7b4('0x16'));var utils=require(_0xe7b4('0x17'));var config=require(_0xe7b4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7b4('0x19'))['db'];function respondWithStatusCode(_0x1f325,_0x292463){_0x292463=_0x292463||0xcc;return function(_0x4b75ae){if(_0x4b75ae){return _0x1f325['sendStatus'](_0x292463);}return _0x1f325['status'](_0x292463)[_0xe7b4('0x1a')]();};}function respondWithResult(_0x345175,_0x26933e){_0x26933e=_0x26933e||0xc8;return function(_0x18113a){if(_0x18113a){return _0x345175[_0xe7b4('0x1b')](_0x26933e)['json'](_0x18113a);}};}function respondWithFilteredResult(_0x45302e,_0x24919c){return function(_0x458c33){if(_0x458c33){var _0x4259c2=typeof _0x24919c[_0xe7b4('0x1c')]===_0xe7b4('0x1d')&&typeof _0x24919c[_0xe7b4('0x1e')]===_0xe7b4('0x1d');var _0x3ebc1d=_0x458c33['count'];var _0x3e4852=_0x4259c2?0x0:_0x24919c['offset'];var _0x2f0555=_0x4259c2?_0x458c33[_0xe7b4('0x1f')]:_0x24919c[_0xe7b4('0x1c')]+_0x24919c[_0xe7b4('0x1e')];var _0x5894e5;if(_0x2f0555>=_0x3ebc1d){_0x2f0555=_0x3ebc1d;_0x5894e5=0xc8;}else{_0x5894e5=0xce;}_0x45302e[_0xe7b4('0x1b')](_0x5894e5);return _0x45302e[_0xe7b4('0x20')]('Content-Range',_0x3e4852+'-'+_0x2f0555+'/'+_0x3ebc1d)[_0xe7b4('0x21')](_0x458c33);}return null;};}function patchUpdates(_0xdfec17){return function(_0x241b35){try{jsonpatch[_0xe7b4('0x22')](_0x241b35,_0xdfec17,!![]);}catch(_0x1ff0f7){return BPromise[_0xe7b4('0x23')](_0x1ff0f7);}return _0x241b35[_0xe7b4('0x24')]();};}function saveUpdates(_0x1306ce,_0x5b6c4e){return function(_0x3dd7c4){if(_0x3dd7c4){return _0x3dd7c4[_0xe7b4('0x25')](_0x1306ce)[_0xe7b4('0x26')](function(_0x2e97d5){return _0x2e97d5;});}return null;};}function removeEntity(_0x8b93e8,_0x203e61){return function(_0x490cb8){if(_0x490cb8){return _0x490cb8[_0xe7b4('0x27')]()[_0xe7b4('0x26')](function(){_0x8b93e8[_0xe7b4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26dc28,_0x199a98){return function(_0x56a6ed){if(!_0x56a6ed){_0x26dc28[_0xe7b4('0x28')](0x194);}return _0x56a6ed;};}function handleError(_0x5ae7ca,_0x125ae8){_0x125ae8=_0x125ae8||0x1f4;return function(_0x5b1056){logger[_0xe7b4('0x29')](_0x5b1056[_0xe7b4('0x2a')]);if(_0x5b1056[_0xe7b4('0x2b')]){delete _0x5b1056[_0xe7b4('0x2b')];}_0x5ae7ca['status'](_0x125ae8)[_0xe7b4('0x2c')](_0x5b1056);};}exports[_0xe7b4('0x2d')]=function(_0x145a01,_0x5e2172){var _0x7ed309={},_0x18f1fe={},_0x1b8a5d={'count':0x0,'rows':[]};var _0x19ab54=_[_0xe7b4('0x2e')](db[_0xe7b4('0x2f')][_0xe7b4('0x30')],function(_0x3be29b){return{'name':_0x3be29b[_0xe7b4('0x31')],'type':_0x3be29b[_0xe7b4('0x32')][_0xe7b4('0x33')]};});_0x18f1fe[_0xe7b4('0x34')]=_['map'](_0x19ab54,'name');_0x18f1fe[_0xe7b4('0x35')]=_[_0xe7b4('0x36')](_0x145a01[_0xe7b4('0x35')]);_0x18f1fe[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x18f1fe['model'],_0x18f1fe['query']);_0x7ed309['attributes']=_['intersection'](_0x18f1fe['model'],qs[_0xe7b4('0x39')](_0x145a01[_0xe7b4('0x35')][_0xe7b4('0x39')]));_0x7ed309[_0xe7b4('0x3a')]=_0x7ed309[_0xe7b4('0x3a')]['length']?_0x7ed309[_0xe7b4('0x3a')]:_0x18f1fe[_0xe7b4('0x34')];if(!_0x145a01[_0xe7b4('0x35')][_0xe7b4('0x3b')](_0xe7b4('0x3c'))){_0x7ed309[_0xe7b4('0x1e')]=qs[_0xe7b4('0x1e')](_0x145a01['query'][_0xe7b4('0x1e')]);_0x7ed309[_0xe7b4('0x1c')]=qs[_0xe7b4('0x1c')](_0x145a01[_0xe7b4('0x35')][_0xe7b4('0x1c')]);}_0x7ed309['order']=qs['sort'](_0x145a01[_0xe7b4('0x35')][_0xe7b4('0x3d')]);_0x7ed309[_0xe7b4('0x3e')]=qs[_0xe7b4('0x37')](_[_0xe7b4('0x3f')](_0x145a01[_0xe7b4('0x35')],_0x18f1fe[_0xe7b4('0x37')]),_0x19ab54);if(_0x145a01[_0xe7b4('0x35')][_0xe7b4('0x40')]){_0x7ed309['where']=_[_0xe7b4('0x41')](_0x7ed309[_0xe7b4('0x3e')],{'$or':_['map'](_0x19ab54,function(_0x3ec4db){if(_0x3ec4db[_0xe7b4('0x32')]!==_0xe7b4('0x42')){var _0x470aa4={};_0x470aa4[_0x3ec4db[_0xe7b4('0x2b')]]={'$like':'%'+_0x145a01[_0xe7b4('0x35')]['filter']+'%'};return _0x470aa4;}})});}_0x7ed309=_['merge']({},_0x7ed309,_0x145a01[_0xe7b4('0x43')]);var _0x25b166={'where':_0x7ed309[_0xe7b4('0x3e')]};return db[_0xe7b4('0x2f')][_0xe7b4('0x1f')](_0x25b166)[_0xe7b4('0x26')](function(_0xe8b64a){_0x1b8a5d[_0xe7b4('0x1f')]=_0xe8b64a;if(_0x145a01['query'][_0xe7b4('0x44')]){_0x7ed309[_0xe7b4('0x45')]=[{'all':!![]}];}return db[_0xe7b4('0x2f')][_0xe7b4('0x46')](_0x7ed309);})['then'](function(_0x48fb22){_0x1b8a5d['rows']=_0x48fb22;return _0x1b8a5d;})[_0xe7b4('0x26')](respondWithFilteredResult(_0x5e2172,_0x7ed309))[_0xe7b4('0x47')](handleError(_0x5e2172,null));};exports[_0xe7b4('0x48')]=function(_0x5afd02,_0x2a1947){var _0x305138={'raw':![],'where':{'id':_0x5afd02['params']['id']}},_0x556a46={};_0x556a46['model']=_[_0xe7b4('0x36')](db[_0xe7b4('0x2f')]['rawAttributes']);_0x556a46[_0xe7b4('0x35')]=_['keys'](_0x5afd02[_0xe7b4('0x35')]);_0x556a46[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x556a46[_0xe7b4('0x34')],_0x556a46['query']);_0x305138[_0xe7b4('0x3a')]=_['intersection'](_0x556a46[_0xe7b4('0x34')],qs[_0xe7b4('0x39')](_0x5afd02[_0xe7b4('0x35')][_0xe7b4('0x39')]));_0x305138[_0xe7b4('0x3a')]=_0x305138['attributes'][_0xe7b4('0x49')]?_0x305138[_0xe7b4('0x3a')]:_0x556a46[_0xe7b4('0x34')];if(_0x5afd02[_0xe7b4('0x35')]['includeAll']){_0x305138['include']=[{'all':!![]}];}_0x305138=_[_0xe7b4('0x41')]({},_0x305138,_0x5afd02[_0xe7b4('0x43')]);return db[_0xe7b4('0x2f')][_0xe7b4('0x4a')](_0x305138)[_0xe7b4('0x26')](handleEntityNotFound(_0x2a1947,null))[_0xe7b4('0x26')](respondWithResult(_0x2a1947,null))[_0xe7b4('0x47')](handleError(_0x2a1947,null));};exports[_0xe7b4('0x4b')]=function(_0x5e9b0c,_0x2b7430){return db[_0xe7b4('0x2f')][_0xe7b4('0x4b')](_0x5e9b0c[_0xe7b4('0x4c')],{})[_0xe7b4('0x26')](respondWithResult(_0x2b7430,0xc9))[_0xe7b4('0x47')](handleError(_0x2b7430,null));};exports[_0xe7b4('0x25')]=function(_0x8e6b58,_0x1f0947){if(_0x8e6b58[_0xe7b4('0x4c')]['id']){delete _0x8e6b58[_0xe7b4('0x4c')]['id'];}return db[_0xe7b4('0x2f')][_0xe7b4('0x4a')]({'where':{'id':_0x8e6b58['params']['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x1f0947,null))[_0xe7b4('0x26')](saveUpdates(_0x8e6b58[_0xe7b4('0x4c')],null))[_0xe7b4('0x26')](respondWithResult(_0x1f0947,null))[_0xe7b4('0x47')](handleError(_0x1f0947,null));};exports[_0xe7b4('0x27')]=function(_0x42b622,_0x2ae2fd){return db[_0xe7b4('0x2f')][_0xe7b4('0x4a')]({'where':{'id':_0x42b622['params']['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x2ae2fd,null))[_0xe7b4('0x26')](removeEntity(_0x2ae2fd,null))[_0xe7b4('0x47')](handleError(_0x2ae2fd,null));};exports['getFields']=function(_0x365b3c,_0x37f83d,_0x43fce7){var _0x18dacf={};var _0x474f18={};var _0x3e3863;var _0x53136e;return db[_0xe7b4('0x2f')][_0xe7b4('0x4d')]({'where':{'id':_0x365b3c[_0xe7b4('0x4e')]['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x37f83d,null))[_0xe7b4('0x26')](function(_0x3dd438){if(_0x3dd438){_0x3e3863=_0x3dd438;_0x474f18['model']=_[_0xe7b4('0x36')](db[_0xe7b4('0x4f')]['rawAttributes']);_0x474f18[_0xe7b4('0x35')]=_[_0xe7b4('0x36')](_0x365b3c['query']);_0x474f18[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x474f18[_0xe7b4('0x34')],_0x474f18[_0xe7b4('0x35')]);_0x18dacf['attributes']=_['intersection'](_0x474f18[_0xe7b4('0x34')],qs[_0xe7b4('0x39')](_0x365b3c[_0xe7b4('0x35')][_0xe7b4('0x39')]));_0x18dacf['attributes']=_0x18dacf[_0xe7b4('0x3a')][_0xe7b4('0x49')]?_0x18dacf[_0xe7b4('0x3a')]:_0x474f18[_0xe7b4('0x34')];_0x18dacf['order']=qs['sort'](_0x365b3c['query'][_0xe7b4('0x3d')]);_0x18dacf[_0xe7b4('0x3e')]=qs['filters'](_[_0xe7b4('0x3f')](_0x365b3c[_0xe7b4('0x35')],_0x474f18['filters']));if(_0x365b3c['query'][_0xe7b4('0x40')]){_0x18dacf[_0xe7b4('0x3e')]=_[_0xe7b4('0x41')](_0x18dacf[_0xe7b4('0x3e')],{'$or':_[_0xe7b4('0x2e')](_0x18dacf[_0xe7b4('0x3a')],function(_0x3e6c29){var _0x4edbcc={};_0x4edbcc[_0x3e6c29]={'$like':'%'+_0x365b3c[_0xe7b4('0x35')][_0xe7b4('0x40')]+'%'};return _0x4edbcc;})});}_0x18dacf=_[_0xe7b4('0x41')]({},_0x18dacf,_0x365b3c[_0xe7b4('0x43')]);return _0x3e3863['getFields'](_0x18dacf);}})['then'](function(_0xedda00){if(_0xedda00){_0x53136e=_0xedda00['length'];if(!_0x365b3c[_0xe7b4('0x35')][_0xe7b4('0x3b')](_0xe7b4('0x3c'))){_0x18dacf[_0xe7b4('0x1e')]=qs[_0xe7b4('0x1e')](_0x365b3c[_0xe7b4('0x35')]['limit']);_0x18dacf[_0xe7b4('0x1c')]=qs[_0xe7b4('0x1c')](_0x365b3c[_0xe7b4('0x35')][_0xe7b4('0x1c')]);}return _0x3e3863[_0xe7b4('0x50')](_0x18dacf);}})[_0xe7b4('0x26')](function(_0x38ac8e){if(_0x38ac8e){return _0x38ac8e?{'count':_0x53136e,'rows':_0x38ac8e}:null;}})[_0xe7b4('0x26')](respondWithResult(_0x37f83d,null))['catch'](handleError(_0x37f83d,null));};exports[_0xe7b4('0x51')]=function(_0x53f870,_0x5c8a52,_0x204f62){var _0x2396af={};var _0x4842e4={};var _0x4968ca;var _0x41eb58;return db[_0xe7b4('0x2f')][_0xe7b4('0x4d')]({'where':{'id':_0x53f870[_0xe7b4('0x4e')]['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x5c8a52,null))[_0xe7b4('0x26')](function(_0x20fe5f){if(_0x20fe5f){_0x4968ca=_0x20fe5f;_0x4842e4[_0xe7b4('0x34')]=_[_0xe7b4('0x36')](db[_0xe7b4('0x4f')]['rawAttributes']);_0x4842e4[_0xe7b4('0x35')]=_['keys'](_0x53f870[_0xe7b4('0x35')]);_0x4842e4[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x4842e4[_0xe7b4('0x34')],_0x4842e4[_0xe7b4('0x35')]);_0x2396af[_0xe7b4('0x3a')]=_['intersection'](_0x4842e4[_0xe7b4('0x34')],qs[_0xe7b4('0x39')](_0x53f870[_0xe7b4('0x35')][_0xe7b4('0x39')]));_0x2396af['attributes']=_0x2396af[_0xe7b4('0x3a')][_0xe7b4('0x49')]?_0x2396af[_0xe7b4('0x3a')]:_0x4842e4['model'];_0x2396af['order']=qs['sort'](_0x53f870[_0xe7b4('0x35')]['sort']);_0x2396af['where']=qs[_0xe7b4('0x37')](_[_0xe7b4('0x3f')](_0x53f870[_0xe7b4('0x35')],_0x4842e4['filters']));if(_0x53f870[_0xe7b4('0x35')][_0xe7b4('0x40')]){_0x2396af[_0xe7b4('0x3e')]=_['merge'](_0x2396af['where'],{'$or':_[_0xe7b4('0x2e')](_0x2396af['attributes'],function(_0x2d553f){var _0xa402fa={};_0xa402fa[_0x2d553f]={'$like':'%'+_0x53f870[_0xe7b4('0x35')][_0xe7b4('0x40')]+'%'};return _0xa402fa;})});}_0x2396af=_[_0xe7b4('0x41')]({},_0x2396af,_0x53f870['options']);return _0x4968ca[_0xe7b4('0x51')](_0x2396af);}})[_0xe7b4('0x26')](function(_0x4c9462){if(_0x4c9462){_0x41eb58=_0x4c9462[_0xe7b4('0x49')];if(!_0x53f870[_0xe7b4('0x35')][_0xe7b4('0x3b')](_0xe7b4('0x3c'))){_0x2396af[_0xe7b4('0x1e')]=qs[_0xe7b4('0x1e')](_0x53f870[_0xe7b4('0x35')][_0xe7b4('0x1e')]);_0x2396af[_0xe7b4('0x1c')]=qs[_0xe7b4('0x1c')](_0x53f870[_0xe7b4('0x35')]['offset']);}return _0x4968ca[_0xe7b4('0x51')](_0x2396af);}})['then'](function(_0x54c8ca){if(_0x54c8ca){return _0x54c8ca?{'count':_0x41eb58,'rows':_0x54c8ca}:null;}})['then'](respondWithResult(_0x5c8a52,null))['catch'](handleError(_0x5c8a52,null));};exports[_0xe7b4('0x52')]=function(_0xb29cd7,_0x136c7e,_0x440dda){var _0x2ef65d={};var _0x94c4ff={};var _0x578f52;var _0x1ff7bc;return db[_0xe7b4('0x2f')][_0xe7b4('0x4d')]({'where':{'id':_0xb29cd7[_0xe7b4('0x4e')]['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x136c7e,null))[_0xe7b4('0x26')](function(_0x518f4a){if(_0x518f4a){_0x578f52=_0x518f4a;_0x94c4ff[_0xe7b4('0x34')]=_[_0xe7b4('0x36')](db[_0xe7b4('0x4f')][_0xe7b4('0x30')]);_0x94c4ff[_0xe7b4('0x35')]=_[_0xe7b4('0x36')](_0xb29cd7['query']);_0x94c4ff[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x94c4ff[_0xe7b4('0x34')],_0x94c4ff[_0xe7b4('0x35')]);_0x2ef65d[_0xe7b4('0x3a')]=_['intersection'](_0x94c4ff[_0xe7b4('0x34')],qs[_0xe7b4('0x39')](_0xb29cd7[_0xe7b4('0x35')][_0xe7b4('0x39')]));_0x2ef65d[_0xe7b4('0x3a')]=_0x2ef65d['attributes'][_0xe7b4('0x49')]?_0x2ef65d[_0xe7b4('0x3a')]:_0x94c4ff[_0xe7b4('0x34')];_0x2ef65d[_0xe7b4('0x53')]=qs[_0xe7b4('0x3d')](_0xb29cd7[_0xe7b4('0x35')]['sort']);_0x2ef65d['where']=qs[_0xe7b4('0x37')](_[_0xe7b4('0x3f')](_0xb29cd7['query'],_0x94c4ff['filters']));if(_0xb29cd7[_0xe7b4('0x35')]['filter']){_0x2ef65d[_0xe7b4('0x3e')]=_[_0xe7b4('0x41')](_0x2ef65d['where'],{'$or':_[_0xe7b4('0x2e')](_0x2ef65d[_0xe7b4('0x3a')],function(_0xb07815){var _0x4293b7={};_0x4293b7[_0xb07815]={'$like':'%'+_0xb29cd7['query'][_0xe7b4('0x40')]+'%'};return _0x4293b7;})});}_0x2ef65d=_[_0xe7b4('0x41')]({},_0x2ef65d,_0xb29cd7[_0xe7b4('0x43')]);return _0x578f52[_0xe7b4('0x52')](_0x2ef65d);}})['then'](function(_0x5b3d28){if(_0x5b3d28){_0x1ff7bc=_0x5b3d28[_0xe7b4('0x49')];if(!_0xb29cd7['query'][_0xe7b4('0x3b')](_0xe7b4('0x3c'))){_0x2ef65d[_0xe7b4('0x1e')]=qs['limit'](_0xb29cd7['query']['limit']);_0x2ef65d['offset']=qs[_0xe7b4('0x1c')](_0xb29cd7[_0xe7b4('0x35')]['offset']);}return _0x578f52[_0xe7b4('0x52')](_0x2ef65d);}})[_0xe7b4('0x26')](function(_0x370c50){if(_0x370c50){return _0x370c50?{'count':_0x1ff7bc,'rows':_0x370c50}:null;}})['then'](respondWithResult(_0x136c7e,null))[_0xe7b4('0x47')](handleError(_0x136c7e,null));};exports[_0xe7b4('0x54')]=function(_0x913dc2,_0x214d90,_0x5e9a21){var _0x55781a={};var _0x5bfa30={};var _0x4be5c1;var _0x228b9e;return db[_0xe7b4('0x2f')][_0xe7b4('0x4d')]({'where':{'id':_0x913dc2[_0xe7b4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x214d90,null))[_0xe7b4('0x26')](function(_0x4a9c0e){if(_0x4a9c0e){_0x4be5c1=_0x4a9c0e;_0x5bfa30['model']=_[_0xe7b4('0x36')](db[_0xe7b4('0x55')]['rawAttributes']);_0x5bfa30['query']=_[_0xe7b4('0x36')](_0x913dc2[_0xe7b4('0x35')]);_0x5bfa30[_0xe7b4('0x37')]=_[_0xe7b4('0x38')](_0x5bfa30['model'],_0x5bfa30[_0xe7b4('0x35')]);_0x55781a[_0xe7b4('0x3a')]=_[_0xe7b4('0x38')](_0x5bfa30[_0xe7b4('0x34')],qs[_0xe7b4('0x39')](_0x913dc2['query'][_0xe7b4('0x39')]));_0x55781a[_0xe7b4('0x3a')]=_0x55781a['attributes'][_0xe7b4('0x49')]?_0x55781a['attributes']:_0x5bfa30[_0xe7b4('0x34')];_0x55781a[_0xe7b4('0x53')]=qs[_0xe7b4('0x3d')](_0x913dc2[_0xe7b4('0x35')][_0xe7b4('0x3d')]);_0x55781a[_0xe7b4('0x3e')]=qs[_0xe7b4('0x37')](_[_0xe7b4('0x3f')](_0x913dc2[_0xe7b4('0x35')],_0x5bfa30[_0xe7b4('0x37')]));if(_0x913dc2[_0xe7b4('0x35')][_0xe7b4('0x40')]){_0x55781a[_0xe7b4('0x3e')]=_[_0xe7b4('0x41')](_0x55781a[_0xe7b4('0x3e')],{'$or':_[_0xe7b4('0x2e')](_0x55781a['attributes'],function(_0x165908){var _0x1e0471={};_0x1e0471[_0x165908]={'$like':'%'+_0x913dc2[_0xe7b4('0x35')][_0xe7b4('0x40')]+'%'};return _0x1e0471;})});}_0x55781a=_[_0xe7b4('0x41')]({},_0x55781a,_0x913dc2[_0xe7b4('0x43')]);return _0x4be5c1[_0xe7b4('0x54')](_0x55781a);}})[_0xe7b4('0x26')](function(_0x18dcf5){if(_0x18dcf5){_0x228b9e=_0x18dcf5[_0xe7b4('0x49')];if(!_0x913dc2['query'][_0xe7b4('0x3b')]('nolimit')){_0x55781a[_0xe7b4('0x1e')]=qs[_0xe7b4('0x1e')](_0x913dc2[_0xe7b4('0x35')][_0xe7b4('0x1e')]);_0x55781a[_0xe7b4('0x1c')]=qs[_0xe7b4('0x1c')](_0x913dc2['query'][_0xe7b4('0x1c')]);}return _0x4be5c1['getTags'](_0x55781a);}})[_0xe7b4('0x26')](function(_0x36d112){if(_0x36d112){return _0x36d112?{'count':_0x228b9e,'rows':_0x36d112}:null;}})['then'](respondWithResult(_0x214d90,null))[_0xe7b4('0x47')](handleError(_0x214d90,null));};exports['setTags']=function(_0x30bd05,_0x3dbbb5,_0x33a4e1){if(_0x30bd05[_0xe7b4('0x4c')]['id']){delete _0x30bd05[_0xe7b4('0x4c')]['id'];}return db[_0xe7b4('0x2f')][_0xe7b4('0x4d')]({'where':{'id':_0x30bd05[_0xe7b4('0x4e')]['id']}})[_0xe7b4('0x26')](handleEntityNotFound(_0x3dbbb5,null))['then'](function(_0x1f2d12){if(_0x1f2d12){return _0x1f2d12[_0xe7b4('0x56')](_0x30bd05['body']['ids']||[]);}return null;})[_0xe7b4('0x26')](respondWithResult(_0x3dbbb5,null))['catch'](handleError(_0x3dbbb5,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 22021f5..d5da313 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 _0x2c3f=['exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes'];(function(_0x3badd8,_0x14b5e8){var _0x26c7d9=function(_0x17d5ae){while(--_0x17d5ae){_0x3badd8['push'](_0x3badd8['shift']());}};_0x26c7d9(++_0x14b5e8);}(_0x2c3f,0xc3));var _0xf2c3=function(_0x119746,_0x5affb6){_0x119746=_0x119746-0x0;var _0x4c4c68=_0x2c3f[_0x119746];return _0x4c4c68;};'use strict';var _=require(_0xf2c3('0x0'));var util=require(_0xf2c3('0x1'));var logger=require(_0xf2c3('0x2'))(_0xf2c3('0x3'));var moment=require('moment');var BPromise=require(_0xf2c3('0x4'));var rp=require(_0xf2c3('0x5'));var fs=require('fs');var path=require(_0xf2c3('0x6'));var rimraf=require(_0xf2c3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf2c3('0x8'));module[_0xf2c3('0x9')]=function(_0x1fd140,_0x5c8dc6){return _0x1fd140['define'](_0xf2c3('0xa'),attributes,{'tableName':_0xf2c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc799=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc799,0x1a6));var _0x9c79=function(_0x2a4e4a,_0x5417d2){_0x2a4e4a=_0x2a4e4a-0x0;var _0x120bab=_0xc799[_0x2a4e4a];return _0x120bab;};'use strict';var _=require(_0x9c79('0x0'));var util=require(_0x9c79('0x1'));var logger=require(_0x9c79('0x2'))(_0x9c79('0x3'));var moment=require(_0x9c79('0x4'));var BPromise=require(_0x9c79('0x5'));var rp=require(_0x9c79('0x6'));var fs=require('fs');var path=require(_0x9c79('0x7'));var rimraf=require(_0x9c79('0x8'));var config=require('../../config/environment');var attributes=require(_0x9c79('0x9'));module[_0x9c79('0xa')]=function(_0x419a7f,_0x157883){return _0x419a7f[_0x9c79('0xb')](_0x9c79('0xc'),attributes,{'tableName':_0x9c79('0xd'),'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 313a3e9..ebeac95 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 _0xb7de=['http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2c3453,_0x5ea996){var _0x182b70=function(_0x5be8f1){while(--_0x5be8f1){_0x2c3453['push'](_0x2c3453['shift']());}};_0x182b70(++_0x5ea996);}(_0xb7de,0xc7));var _0xeb7d=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xb7de[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var moment=require(_0xeb7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb7d('0x3'));var fs=require('fs');var Redis=require(_0xeb7d('0x4'));var db=require(_0xeb7d('0x5'))['db'];var utils=require(_0xeb7d('0x6'));var logger=require(_0xeb7d('0x7'))('rpc');var config=require(_0xeb7d('0x8'));var jayson=require(_0xeb7d('0x9'));var client=jayson[_0xeb7d('0xa')][_0xeb7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc8bd99,_0x593170,_0x5e7556){return new BPromise(function(_0xb802e1,_0x13d376){return client[_0xeb7d('0xc')](_0xc8bd99,_0x5e7556)[_0xeb7d('0xd')](function(_0x4a880a){logger[_0xeb7d('0xe')](_0xeb7d('0xf'),_0x593170,_0xeb7d('0x10'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x593170,_0xeb7d('0x10'),JSON['stringify'](_0x4a880a));if(_0x4a880a[_0xeb7d('0x11')]){if(_0x4a880a[_0xeb7d('0x11')][_0xeb7d('0x12')]===0x1f4){logger[_0xeb7d('0x11')](_0xeb7d('0xf'),_0x593170,_0x4a880a[_0xeb7d('0x11')]['message']);return _0x13d376(_0x4a880a[_0xeb7d('0x11')][_0xeb7d('0x13')]);}logger[_0xeb7d('0x11')](_0xeb7d('0xf'),_0x593170,_0x4a880a[_0xeb7d('0x11')]['message']);return _0xb802e1(_0x4a880a[_0xeb7d('0x11')]['message']);}else{logger[_0xeb7d('0xe')](_0xeb7d('0xf'),_0x593170,_0xeb7d('0x10'));_0xb802e1(_0x4a880a['result']['message']);}})[_0xeb7d('0x14')](function(_0xfcbbce){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x593170,_0xfcbbce);_0x13d376(_0xfcbbce);});});} \ No newline at end of file +var _0xcdf0=['request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xcdf0,0xa8));var _0x0cdf=function(_0x28700d,_0x214447){_0x28700d=_0x28700d-0x0;var _0x185156=_0xcdf0[_0x28700d];return _0x185156;};'use strict';var _=require(_0x0cdf('0x0'));var util=require(_0x0cdf('0x1'));var moment=require(_0x0cdf('0x2'));var BPromise=require(_0x0cdf('0x3'));var rs=require(_0x0cdf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cdf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cdf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0cdf('0x7'));var client=jayson[_0x0cdf('0x8')][_0x0cdf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x658ceb,_0x45b4d9,_0x5415ef){return new BPromise(function(_0x47f3ea,_0x238a0b){return client['request'](_0x658ceb,_0x5415ef)[_0x0cdf('0xa')](function(_0x275bc9){logger['info'](_0x0cdf('0xb'),_0x45b4d9,_0x0cdf('0xc'));logger[_0x0cdf('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x45b4d9,_0x0cdf('0xc'),JSON[_0x0cdf('0xe')](_0x275bc9));if(_0x275bc9[_0x0cdf('0xf')]){if(_0x275bc9[_0x0cdf('0xf')]['code']===0x1f4){logger[_0x0cdf('0xf')](_0x0cdf('0xb'),_0x45b4d9,_0x275bc9['error'][_0x0cdf('0x10')]);return _0x238a0b(_0x275bc9[_0x0cdf('0xf')][_0x0cdf('0x10')]);}logger[_0x0cdf('0xf')](_0x0cdf('0xb'),_0x45b4d9,_0x275bc9[_0x0cdf('0xf')]['message']);return _0x47f3ea(_0x275bc9[_0x0cdf('0xf')][_0x0cdf('0x10')]);}else{logger['info'](_0x0cdf('0xb'),_0x45b4d9,_0x0cdf('0xc'));_0x47f3ea(_0x275bc9[_0x0cdf('0x11')][_0x0cdf('0x10')]);}})['catch'](function(_0x5b1261){logger[_0x0cdf('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x45b4d9,_0x5b1261);_0x238a0b(_0x5b1261);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6b61ee8..fbf7354 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 _0x065d=['/:id','show','post','create','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x065d,0x6f));var _0xd065=function(_0x323960,_0x558215){_0x323960=_0x323960-0x0;var _0x50cf80=_0x065d[_0x323960];return _0x50cf80;};'use strict';var multer=require(_0xd065('0x0'));var util=require('util');var path=require(_0xd065('0x1'));var timeout=require(_0xd065('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd065('0x3'));var interaction=require(_0xd065('0x4'));var config=require(_0xd065('0x5'));var controller=require(_0xd065('0x6'));router['get']('/',auth[_0xd065('0x7')](),controller['index']);router[_0xd065('0x8')](_0xd065('0x9'),auth[_0xd065('0x7')](),controller[_0xd065('0xa')]);router[_0xd065('0xb')]('/',auth[_0xd065('0x7')](),controller[_0xd065('0xc')]);router['put'](_0xd065('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd065('0xd')]('/:id',auth[_0xd065('0x7')](),controller[_0xd065('0xe')]);module['exports']=router; \ No newline at end of file +var _0x8507=['./intDeskField.controller','get','isAuthenticated','index','/:id','post','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x31a639,_0x392cf8){var _0x4a8300=function(_0x449727){while(--_0x449727){_0x31a639['push'](_0x31a639['shift']());}};_0x4a8300(++_0x392cf8);}(_0x8507,0x14c));var _0x7850=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8507[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x7850('0x0'));var util=require('util');var path=require(_0x7850('0x1'));var timeout=require('connect-timeout');var express=require(_0x7850('0x2'));var router=express[_0x7850('0x3')]();var fs_extra=require(_0x7850('0x4'));var auth=require(_0x7850('0x5'));var interaction=require(_0x7850('0x6'));var config=require(_0x7850('0x7'));var controller=require(_0x7850('0x8'));router[_0x7850('0x9')]('/',auth[_0x7850('0xa')](),controller[_0x7850('0xb')]);router['get'](_0x7850('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7850('0xd')]('/',auth[_0x7850('0xa')](),controller['create']);router[_0x7850('0xe')](_0x7850('0xc'),auth[_0x7850('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7850('0xf')]);module[_0x7850('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 2b8f59d..2320928 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 _0x527b=['STRING','variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','picklist'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x527b,0x100));var _0xb527=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x527b[_0x3358ba];return _0x296e73;};'use strict';var Sequelize=require(_0xb527('0x0'));module[_0xb527('0x1')]={'type':{'type':Sequelize[_0xb527('0x2')](_0xb527('0x3'),'variable','customVariable','keyValue',_0xb527('0x4')),'defaultValue':_0xb527('0x3')},'content':{'type':Sequelize[_0xb527('0x5')]},'key':{'type':Sequelize[_0xb527('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb527('0x3'),_0xb527('0x6'),_0xb527('0x7'))},'keyContent':{'type':Sequelize[_0xb527('0x5')]},'idField':{'type':Sequelize[_0xb527('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb527('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb527('0x5')]}}; \ No newline at end of file +var _0x7ee8=['customVariable','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x7b3220,_0x36f056){var _0x1c8884=function(_0x23f8da){while(--_0x23f8da){_0x7b3220['push'](_0x7b3220['shift']());}};_0x1c8884(++_0x36f056);}(_0x7ee8,0xbb));var _0x87ee=function(_0x558222,_0x105cdb){_0x558222=_0x558222-0x0;var _0x4e1044=_0x7ee8[_0x558222];return _0x4e1044;};'use strict';var Sequelize=require(_0x87ee('0x0'));module[_0x87ee('0x1')]={'type':{'type':Sequelize[_0x87ee('0x2')](_0x87ee('0x3'),_0x87ee('0x4'),_0x87ee('0x5'),'keyValue',_0x87ee('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x87ee('0x7')]},'key':{'type':Sequelize[_0x87ee('0x7')]},'keyType':{'type':Sequelize[_0x87ee('0x2')](_0x87ee('0x3'),_0x87ee('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x87ee('0x7')]},'idField':{'type':Sequelize[_0x87ee('0x7')]},'nameField':{'type':Sequelize[_0x87ee('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x87ee('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index eb914b6..5f5c1d2 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 _0x8a8b=['model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','destroy','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key'];(function(_0x1a070b,_0x46d2c8){var _0x20b48d=function(_0x4e8510){while(--_0x4e8510){_0x1a070b['push'](_0x1a070b['shift']());}};_0x20b48d(++_0x46d2c8);}(_0x8a8b,0xae));var _0xb8a8=function(_0x4ae23e,_0x5f59a0){_0x4ae23e=_0x4ae23e-0x0;var _0x3268c6=_0x8a8b[_0x4ae23e];return _0x3268c6;};'use strict';var emlformat=require(_0xb8a8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a8('0x1'));var rp=require(_0xb8a8('0x2'));var moment=require('moment');var BPromise=require(_0xb8a8('0x3'));var Mustache=require('mustache');var util=require(_0xb8a8('0x4'));var path=require('path');var sox=require(_0xb8a8('0x5'));var csv=require(_0xb8a8('0x6'));var ejs=require(_0xb8a8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8a8('0x8'));var squel=require('squel');var crypto=require(_0xb8a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb8a8('0xa'));var toCsv=require(_0xb8a8('0x6'));var querystring=require(_0xb8a8('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8a8('0xc'));var authService=require(_0xb8a8('0xd'));var qs=require(_0xb8a8('0xe'));var as=require(_0xb8a8('0xf'));var hardwareService=require(_0xb8a8('0x10'));var logger=require(_0xb8a8('0x11'))(_0xb8a8('0x12'));var utils=require(_0xb8a8('0x13'));var config=require(_0xb8a8('0x14'));var licenseUtil=require(_0xb8a8('0x15'));var db=require(_0xb8a8('0x16'))['db'];function respondWithStatusCode(_0x3ba314,_0x6e85aa){_0x6e85aa=_0x6e85aa||0xcc;return function(_0x5278f8){if(_0x5278f8){return _0x3ba314[_0xb8a8('0x17')](_0x6e85aa);}return _0x3ba314[_0xb8a8('0x18')](_0x6e85aa)[_0xb8a8('0x19')]();};}function respondWithResult(_0xad6499,_0x42fb99){_0x42fb99=_0x42fb99||0xc8;return function(_0xf3750e){if(_0xf3750e){return _0xad6499[_0xb8a8('0x18')](_0x42fb99)[_0xb8a8('0x1a')](_0xf3750e);}};}function respondWithFilteredResult(_0x22e0ac,_0x3d96dc){return function(_0x3ca02e){if(_0x3ca02e){var _0x4f6cd0=typeof _0x3d96dc[_0xb8a8('0x1b')]==='undefined'&&typeof _0x3d96dc[_0xb8a8('0x1c')]===_0xb8a8('0x1d');var _0x412041=_0x3ca02e[_0xb8a8('0x1e')];var _0x121be4=_0x4f6cd0?0x0:_0x3d96dc[_0xb8a8('0x1b')];var _0x1d0898=_0x4f6cd0?_0x3ca02e[_0xb8a8('0x1e')]:_0x3d96dc['offset']+_0x3d96dc['limit'];var _0x306c20;if(_0x1d0898>=_0x412041){_0x1d0898=_0x412041;_0x306c20=0xc8;}else{_0x306c20=0xce;}_0x22e0ac['status'](_0x306c20);return _0x22e0ac['set']('Content-Range',_0x121be4+'-'+_0x1d0898+'/'+_0x412041)[_0xb8a8('0x1a')](_0x3ca02e);}return null;};}function patchUpdates(_0x44cdee){return function(_0x421b58){try{jsonpatch[_0xb8a8('0x1f')](_0x421b58,_0x44cdee,!![]);}catch(_0x380fcb){return BPromise[_0xb8a8('0x20')](_0x380fcb);}return _0x421b58['save']();};}function saveUpdates(_0x17c2b8,_0x9ca4b){return function(_0x1a3ff2){if(_0x1a3ff2){return _0x1a3ff2[_0xb8a8('0x21')](_0x17c2b8)['then'](function(_0x404ca5){return _0x404ca5;});}return null;};}function removeEntity(_0x55c6aa,_0x32aba6){return function(_0x4bc82a){if(_0x4bc82a){return _0x4bc82a[_0xb8a8('0x22')]()['then'](function(){_0x55c6aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dadd6,_0x2dfad6){return function(_0xd25b42){if(!_0xd25b42){_0x5dadd6[_0xb8a8('0x17')](0x194);}return _0xd25b42;};}function handleError(_0x1672ba,_0x41b86d){_0x41b86d=_0x41b86d||0x1f4;return function(_0x4b6c93){logger[_0xb8a8('0x23')](_0x4b6c93[_0xb8a8('0x24')]);if(_0x4b6c93[_0xb8a8('0x25')]){delete _0x4b6c93[_0xb8a8('0x25')];}_0x1672ba[_0xb8a8('0x18')](_0x41b86d)['send'](_0x4b6c93);};}exports[_0xb8a8('0x26')]=function(_0x118f2d,_0xe1772e){var _0x1e7403={},_0x47464e={},_0x543e81={'count':0x0,'rows':[]};var _0x4aec01=_[_0xb8a8('0x27')](db[_0xb8a8('0x28')][_0xb8a8('0x29')],function(_0x3c2bea){return{'name':_0x3c2bea[_0xb8a8('0x2a')],'type':_0x3c2bea[_0xb8a8('0x2b')][_0xb8a8('0x2c')]};});_0x47464e[_0xb8a8('0x2d')]=_[_0xb8a8('0x27')](_0x4aec01,_0xb8a8('0x25'));_0x47464e['query']=_['keys'](_0x118f2d[_0xb8a8('0x2e')]);_0x47464e[_0xb8a8('0x2f')]=_[_0xb8a8('0x30')](_0x47464e['model'],_0x47464e['query']);_0x1e7403['attributes']=_['intersection'](_0x47464e['model'],qs[_0xb8a8('0x31')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x31')]));_0x1e7403['attributes']=_0x1e7403[_0xb8a8('0x32')][_0xb8a8('0x33')]?_0x1e7403[_0xb8a8('0x32')]:_0x47464e[_0xb8a8('0x2d')];if(!_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x34')]('nolimit')){_0x1e7403[_0xb8a8('0x1c')]=qs[_0xb8a8('0x1c')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x1c')]);_0x1e7403[_0xb8a8('0x1b')]=qs[_0xb8a8('0x1b')](_0x118f2d['query']['offset']);}_0x1e7403[_0xb8a8('0x35')]=qs[_0xb8a8('0x36')](_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x36')]);_0x1e7403[_0xb8a8('0x37')]=qs[_0xb8a8('0x2f')](_[_0xb8a8('0x38')](_0x118f2d['query'],_0x47464e[_0xb8a8('0x2f')]),_0x4aec01);if(_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x39')]){_0x1e7403[_0xb8a8('0x37')]=_[_0xb8a8('0x3a')](_0x1e7403[_0xb8a8('0x37')],{'$or':_[_0xb8a8('0x27')](_0x4aec01,function(_0x3901c8){if(_0x3901c8[_0xb8a8('0x2b')]!==_0xb8a8('0x3b')){var _0x27b287={};_0x27b287[_0x3901c8[_0xb8a8('0x25')]]={'$like':'%'+_0x118f2d[_0xb8a8('0x2e')][_0xb8a8('0x39')]+'%'};return _0x27b287;}})});}_0x1e7403=_['merge']({},_0x1e7403,_0x118f2d[_0xb8a8('0x3c')]);var _0x605e15={'where':_0x1e7403[_0xb8a8('0x37')]};return db[_0xb8a8('0x28')][_0xb8a8('0x1e')](_0x605e15)[_0xb8a8('0x3d')](function(_0x3d011f){_0x543e81[_0xb8a8('0x1e')]=_0x3d011f;if(_0x118f2d['query'][_0xb8a8('0x3e')]){_0x1e7403[_0xb8a8('0x3f')]=[{'all':!![]}];}return db[_0xb8a8('0x28')][_0xb8a8('0x40')](_0x1e7403);})[_0xb8a8('0x3d')](function(_0x4eec73){_0x543e81[_0xb8a8('0x41')]=_0x4eec73;return _0x543e81;})[_0xb8a8('0x3d')](respondWithFilteredResult(_0xe1772e,_0x1e7403))['catch'](handleError(_0xe1772e,null));};exports[_0xb8a8('0x42')]=function(_0x2bfc77,_0x36c8e4){var _0x4d0f99={'raw':!![],'where':{'id':_0x2bfc77[_0xb8a8('0x43')]['id']}},_0x3590ac={};_0x3590ac[_0xb8a8('0x2d')]=_[_0xb8a8('0x44')](db['DeskField'][_0xb8a8('0x29')]);_0x3590ac['query']=_[_0xb8a8('0x44')](_0x2bfc77['query']);_0x3590ac[_0xb8a8('0x2f')]=_[_0xb8a8('0x30')](_0x3590ac[_0xb8a8('0x2d')],_0x3590ac[_0xb8a8('0x2e')]);_0x4d0f99[_0xb8a8('0x32')]=_[_0xb8a8('0x30')](_0x3590ac[_0xb8a8('0x2d')],qs[_0xb8a8('0x31')](_0x2bfc77[_0xb8a8('0x2e')][_0xb8a8('0x31')]));_0x4d0f99[_0xb8a8('0x32')]=_0x4d0f99[_0xb8a8('0x32')][_0xb8a8('0x33')]?_0x4d0f99[_0xb8a8('0x32')]:_0x3590ac['model'];if(_0x2bfc77[_0xb8a8('0x2e')]['includeAll']){_0x4d0f99[_0xb8a8('0x3f')]=[{'all':!![]}];}_0x4d0f99=_[_0xb8a8('0x3a')]({},_0x4d0f99,_0x2bfc77[_0xb8a8('0x3c')]);return db[_0xb8a8('0x28')][_0xb8a8('0x45')](_0x4d0f99)[_0xb8a8('0x3d')](handleEntityNotFound(_0x36c8e4,null))[_0xb8a8('0x3d')](respondWithResult(_0x36c8e4,null))['catch'](handleError(_0x36c8e4,null));};exports[_0xb8a8('0x46')]=function(_0x4175e1,_0x3ca626){return db['DeskField'][_0xb8a8('0x46')](_0x4175e1[_0xb8a8('0x47')],{})['then'](respondWithResult(_0x3ca626,0xc9))['catch'](handleError(_0x3ca626,null));};exports[_0xb8a8('0x21')]=function(_0x45e3d3,_0x2b6464){if(_0x45e3d3['body']['id']){delete _0x45e3d3[_0xb8a8('0x47')]['id'];}return db[_0xb8a8('0x28')][_0xb8a8('0x45')]({'where':{'id':_0x45e3d3[_0xb8a8('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b6464,null))[_0xb8a8('0x3d')](saveUpdates(_0x45e3d3[_0xb8a8('0x47')],null))[_0xb8a8('0x3d')](respondWithResult(_0x2b6464,null))[_0xb8a8('0x48')](handleError(_0x2b6464,null));};exports['destroy']=function(_0xa46a18,_0x32f688){return db[_0xb8a8('0x28')][_0xb8a8('0x45')]({'where':{'id':_0xa46a18[_0xb8a8('0x43')]['id']}})[_0xb8a8('0x3d')](handleEntityNotFound(_0x32f688,null))[_0xb8a8('0x3d')](removeEntity(_0x32f688,null))['catch'](handleError(_0x32f688,null));}; \ No newline at end of file +var _0xbff5=['bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','DeskField','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4546f0,_0x58f091){var _0x1b883e=function(_0x34851b){while(--_0x34851b){_0x4546f0['push'](_0x4546f0['shift']());}};_0x1b883e(++_0x58f091);}(_0xbff5,0x1bc));var _0x5bff=function(_0x141f90,_0x34fbbb){_0x141f90=_0x141f90-0x0;var _0x69d843=_0xbff5[_0x141f90];return _0x69d843;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['DeskField'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['DeskField'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['DeskField'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1926dfc..30e3b03 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 _0x4bec=['desk_unique_index','idField','util','api','moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4bec,0x12b));var _0xc4be=function(_0x4719bb,_0x457328){_0x4719bb=_0x4719bb-0x0;var _0x4bdb66=_0x4bec[_0x4719bb];return _0x4bdb66;};'use strict';var _=require('lodash');var util=require(_0xc4be('0x0'));var logger=require('../../config/logger')(_0xc4be('0x1'));var moment=require(_0xc4be('0x2'));var BPromise=require('bluebird');var rp=require(_0xc4be('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4be('0x4'));var config=require(_0xc4be('0x5'));var attributes=require(_0xc4be('0x6'));module['exports']=function(_0x117be9,_0x554b7e){return _0x117be9['define'](_0xc4be('0x7'),attributes,{'tableName':_0xc4be('0x8'),'paranoid':![],'indexes':[{'name':_0xc4be('0x9'),'fields':[_0xc4be('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2521=['idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','int_desk_fields'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x2521,0x84));var _0x1252=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x2521[_0x3bef2c];return _0x331503;};'use strict';var _=require('lodash');var util=require(_0x1252('0x0'));var logger=require(_0x1252('0x1'))(_0x1252('0x2'));var moment=require(_0x1252('0x3'));var BPromise=require('bluebird');var rp=require(_0x1252('0x4'));var fs=require('fs');var path=require(_0x1252('0x5'));var rimraf=require(_0x1252('0x6'));var config=require(_0x1252('0x7'));var attributes=require(_0x1252('0x8'));module[_0x1252('0x9')]=function(_0x22b878,_0x4cf800){return _0x22b878['define']('DeskField',attributes,{'tableName':_0x1252('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x1252('0xb'),_0x1252('0xc')],'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 0501d01..6d69f7b 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 _0x845c=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis'];(function(_0x3f09d4,_0x202d30){var _0x1c17ac=function(_0x2e37fd){while(--_0x2e37fd){_0x3f09d4['push'](_0x3f09d4['shift']());}};_0x1c17ac(++_0x202d30);}(_0x845c,0x64));var _0xc845=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x845c[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xc845('0x0'));var util=require(_0xc845('0x1'));var moment=require(_0xc845('0x2'));var BPromise=require(_0xc845('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc845('0x4'));var db=require(_0xc845('0x5'))['db'];var utils=require(_0xc845('0x6'));var logger=require('../../config/logger')(_0xc845('0x7'));var config=require('../../config/environment');var jayson=require(_0xc845('0x8'));var client=jayson[_0xc845('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51b480,_0x10379d,_0x19f159){return new BPromise(function(_0x5582d5,_0x13d075){return client[_0xc845('0xa')](_0x51b480,_0x19f159)[_0xc845('0xb')](function(_0x40c3db){logger[_0xc845('0xc')](_0xc845('0xd'),_0x10379d,_0xc845('0xe'));logger[_0xc845('0xf')](_0xc845('0x10'),_0x10379d,_0xc845('0xe'),JSON[_0xc845('0x11')](_0x40c3db));if(_0x40c3db[_0xc845('0x12')]){if(_0x40c3db[_0xc845('0x12')]['code']===0x1f4){logger[_0xc845('0x12')]('DeskField,\x20%s,\x20%s',_0x10379d,_0x40c3db['error'][_0xc845('0x13')]);return _0x13d075(_0x40c3db[_0xc845('0x12')][_0xc845('0x13')]);}logger['error'](_0xc845('0xd'),_0x10379d,_0x40c3db[_0xc845('0x12')][_0xc845('0x13')]);return _0x5582d5(_0x40c3db[_0xc845('0x12')][_0xc845('0x13')]);}else{logger[_0xc845('0xc')](_0xc845('0xd'),_0x10379d,'request\x20sent');_0x5582d5(_0x40c3db[_0xc845('0x14')]['message']);}})['catch'](function(_0x4796af){logger[_0xc845('0x12')](_0xc845('0xd'),_0x10379d,_0x4796af);_0x13d075(_0x4796af);});});} \ No newline at end of file +var _0x8802=['request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5373f7,_0x13ec9b){var _0x17a3ae=function(_0x43ce31){while(--_0x43ce31){_0x5373f7['push'](_0x5373f7['shift']());}};_0x17a3ae(++_0x13ec9b);}(_0x8802,0x184));var _0x2880=function(_0x4fb789,_0x6b8092){_0x4fb789=_0x4fb789-0x0;var _0x49b5e4=_0x8802[_0x4fb789];return _0x49b5e4;};'use strict';var _=require('lodash');var util=require(_0x2880('0x0'));var moment=require(_0x2880('0x1'));var BPromise=require(_0x2880('0x2'));var rs=require(_0x2880('0x3'));var fs=require('fs');var Redis=require(_0x2880('0x4'));var db=require(_0x2880('0x5'))['db'];var utils=require(_0x2880('0x6'));var logger=require(_0x2880('0x7'))(_0x2880('0x8'));var config=require(_0x2880('0x9'));var jayson=require(_0x2880('0xa'));var client=jayson['client'][_0x2880('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3151ed,_0x232d7b,_0x1e6b98){return new BPromise(function(_0x10d987,_0x504210){return client[_0x2880('0xc')](_0x3151ed,_0x1e6b98)[_0x2880('0xd')](function(_0x57c284){logger[_0x2880('0xe')](_0x2880('0xf'),_0x232d7b,_0x2880('0x10'));logger[_0x2880('0x11')](_0x2880('0x12'),_0x232d7b,_0x2880('0x10'),JSON[_0x2880('0x13')](_0x57c284));if(_0x57c284[_0x2880('0x14')]){if(_0x57c284['error'][_0x2880('0x15')]===0x1f4){logger[_0x2880('0x14')](_0x2880('0xf'),_0x232d7b,_0x57c284[_0x2880('0x14')][_0x2880('0x16')]);return _0x504210(_0x57c284[_0x2880('0x14')][_0x2880('0x16')]);}logger[_0x2880('0x14')](_0x2880('0xf'),_0x232d7b,_0x57c284[_0x2880('0x14')]['message']);return _0x10d987(_0x57c284[_0x2880('0x14')][_0x2880('0x16')]);}else{logger['info'](_0x2880('0xf'),_0x232d7b,_0x2880('0x10'));_0x10d987(_0x57c284[_0x2880('0x17')][_0x2880('0x16')]);}})[_0x2880('0x18')](function(_0x5d1074){logger[_0x2880('0x14')](_0x2880('0xf'),_0x232d7b,_0x5d1074);_0x504210(_0x5d1074);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bf8e548..38f6335 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 _0x2c67=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','addConfiguration'];(function(_0x235be9,_0x4ca361){var _0x1fc038=function(_0x453883){while(--_0x453883){_0x235be9['push'](_0x235be9['shift']());}};_0x1fc038(++_0x4ca361);}(_0x2c67,0x164));var _0x72c6=function(_0x381e98,_0x250c6e){_0x381e98=_0x381e98-0x0;var _0x5aa0c2=_0x2c67[_0x381e98];return _0x5aa0c2;};'use strict';var multer=require(_0x72c6('0x0'));var util=require(_0x72c6('0x1'));var path=require('path');var timeout=require(_0x72c6('0x2'));var express=require(_0x72c6('0x3'));var router=express[_0x72c6('0x4')]();var fs_extra=require(_0x72c6('0x5'));var auth=require(_0x72c6('0x6'));var interaction=require(_0x72c6('0x7'));var config=require(_0x72c6('0x8'));var controller=require(_0x72c6('0x9'));router[_0x72c6('0xa')]('/',auth['isAuthenticated'](),controller[_0x72c6('0xb')]);router['get'](_0x72c6('0xc'),auth['isAuthenticated'](),controller[_0x72c6('0xd')]);router[_0x72c6('0xa')](_0x72c6('0xe'),auth['isAuthenticated'](),controller[_0x72c6('0xf')]);router[_0x72c6('0xa')](_0x72c6('0x10'),auth[_0x72c6('0x11')](),controller[_0x72c6('0x12')]);router[_0x72c6('0x13')]('/',auth[_0x72c6('0x11')](),controller[_0x72c6('0x14')]);router[_0x72c6('0x13')](_0x72c6('0xe'),auth[_0x72c6('0x11')](),controller[_0x72c6('0x15')]);router[_0x72c6('0x16')](_0x72c6('0xc'),auth[_0x72c6('0x11')](),controller[_0x72c6('0x17')]);router[_0x72c6('0x18')](_0x72c6('0xc'),auth[_0x72c6('0x11')](),controller[_0x72c6('0x19')]);module[_0x72c6('0x1a')]=router; \ No newline at end of file +var _0x98e9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','create','post','addConfiguration','/:id','update','delete','path','connect-timeout','express','Router','fs-extra'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x98e9,0xd7));var _0x998e=function(_0x4b1e86,_0x360dfa){_0x4b1e86=_0x4b1e86-0x0;var _0x107417=_0x98e9[_0x4b1e86];return _0x107417;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x998e('0x0'));var timeout=require(_0x998e('0x1'));var express=require(_0x998e('0x2'));var router=express[_0x998e('0x3')]();var fs_extra=require(_0x998e('0x4'));var auth=require(_0x998e('0x5'));var interaction=require(_0x998e('0x6'));var config=require(_0x998e('0x7'));var controller=require(_0x998e('0x8'));router['get']('/',auth[_0x998e('0x9')](),controller[_0x998e('0xa')]);router[_0x998e('0xb')]('/:id',auth[_0x998e('0x9')](),controller['show']);router[_0x998e('0xb')](_0x998e('0xc'),auth[_0x998e('0x9')](),controller[_0x998e('0xd')]);router[_0x998e('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x998e('0x9')](),controller[_0x998e('0xe')]);router[_0x998e('0xf')](_0x998e('0xc'),auth[_0x998e('0x9')](),controller[_0x998e('0x10')]);router['put'](_0x998e('0x11'),auth[_0x998e('0x9')](),controller[_0x998e('0x12')]);router[_0x998e('0x13')](_0x998e('0x11'),auth[_0x998e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 053ebeb..695758e 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 _0x965d=['exports','STRING','sequelize'];(function(_0x4dc939,_0x4ae210){var _0x1c70bc=function(_0x31602d){while(--_0x31602d){_0x4dc939['push'](_0x4dc939['shift']());}};_0x1c70bc(++_0x4ae210);}(_0x965d,0x1be));var _0xd965=function(_0x303675,_0xf33824){_0x303675=_0x303675-0x0;var _0x39f6cf=_0x965d[_0x303675];return _0x39f6cf;};'use strict';var Sequelize=require(_0xd965('0x0'));module[_0xd965('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd965('0x2')]},'password':{'type':Sequelize[_0xd965('0x2')]},'remoteUri':{'type':Sequelize[_0xd965('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd965('0x2')]},'clientSecret':{'type':Sequelize[_0xd965('0x2')]},'serverUrl':{'type':Sequelize[_0xd965('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x5581=['STRING','sequelize'];(function(_0x6f62f4,_0x4e7215){var _0x3a0240=function(_0x3707e3){while(--_0x3707e3){_0x6f62f4['push'](_0x6f62f4['shift']());}};_0x3a0240(++_0x4e7215);}(_0x5581,0x115));var _0x1558=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x5581[_0x2642cb];return _0xe6e41;};'use strict';var Sequelize=require(_0x1558('0x0'));module['exports']={'name':{'type':Sequelize[_0x1558('0x1')]},'username':{'type':Sequelize[_0x1558('0x1')]},'password':{'type':Sequelize[_0x1558('0x1')]},'remoteUri':{'type':Sequelize[_0x1558('0x1')]},'tenantId':{'type':Sequelize[_0x1558('0x1')]},'clientId':{'type':Sequelize[_0x1558('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1558('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1558('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f5f418f..3cfbd93 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 _0x105f=['description','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','https://login.microsoftonline.com/','/oauth2/token','password','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','error','send','test','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName','OptionSet','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','api','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','end','sendStatus','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','Dynamics365Account','rows','show','params','keys','rawAttributes','fields','include','catch','create','body','find','getConfigurations','Dynamics365Configuration','pick','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','title'];(function(_0x3b0c5d,_0x160f65){var _0x26a2c4=function(_0x511936){while(--_0x511936){_0x3b0c5d['push'](_0x3b0c5d['shift']());}};_0x26a2c4(++_0x160f65);}(_0x105f,0x71));var _0xf105=function(_0x442056,_0x7e77e4){_0x442056=_0x442056-0x0;var _0x568188=_0x105f[_0x442056];return _0x568188;};'use strict';var rp=require('request-promise');var util=require(_0xf105('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf105('0x1'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf105('0x2'));function respondWithResult(_0x34d5e7,_0x7bfadd){_0x7bfadd=_0x7bfadd||0xc8;return function(_0x368830){if(_0x368830){return _0x34d5e7['status'](_0x7bfadd)[_0xf105('0x3')](_0x368830);}};}function respondWithFilteredResult(_0x100675,_0x5f4946){return function(_0x12509d){if(_0x12509d){var _0x57abaa=typeof _0x5f4946[_0xf105('0x4')]===_0xf105('0x5')&&typeof _0x5f4946[_0xf105('0x6')]===_0xf105('0x5');var _0x4e6abd=_0x12509d['count'];var _0x50596d=_0x57abaa?0x0:_0x5f4946['offset'];var _0x17ebdd=_0x57abaa?_0x12509d[_0xf105('0x7')]:_0x5f4946['offset']+_0x5f4946[_0xf105('0x6')];var _0x27abb2;if(_0x17ebdd>=_0x4e6abd){_0x17ebdd=_0x4e6abd;_0x27abb2=0xc8;}else{_0x27abb2=0xce;}_0x100675[_0xf105('0x8')](_0x27abb2);return _0x100675[_0xf105('0x9')](_0xf105('0xa'),_0x50596d+'-'+_0x17ebdd+'/'+_0x4e6abd)[_0xf105('0x3')](_0x12509d);}return null;};}function saveUpdates(_0x48c08e){return function(_0x2f2dd5){if(_0x2f2dd5){return _0x2f2dd5['update'](_0x48c08e)[_0xf105('0xb')](function(_0xb8cdd0){return _0xb8cdd0;});}return null;};}function removeEntity(_0x36e59e){return function(_0x57e98d){if(_0x57e98d){return _0x57e98d[_0xf105('0xc')]()['then'](function(){_0x36e59e['status'](0xcc)[_0xf105('0xd')]();});}};}function handleEntityNotFound(_0x443095){return function(_0x24dd40){if(!_0x24dd40){_0x443095[_0xf105('0xe')](0x194);}return _0x24dd40;};}function handleError(_0x468643,_0x5036e0){_0x5036e0=_0x5036e0||0x1f4;return function(_0x50ae81){logger['error'](_0x50ae81['stack']);if(_0x50ae81[_0xf105('0xf')]){delete _0x50ae81['name'];}_0x468643[_0xf105('0x8')](_0x5036e0)['send'](_0x50ae81);};}exports[_0xf105('0x10')]=function(_0x3e1c5f,_0x2188e9){var _0xe07a35={},_0x369b60={},_0x3d704a={'count':0x0,'rows':[]};var _0x2a673b=_[_0xf105('0x11')](db['Dynamics365Account']['rawAttributes'],function(_0x2aa2e2){return{'name':_0x2aa2e2[_0xf105('0x12')],'type':_0x2aa2e2[_0xf105('0x13')][_0xf105('0x14')]};});_0x369b60[_0xf105('0x15')]=_[_0xf105('0x11')](_0x2a673b,_0xf105('0xf'));_0x369b60[_0xf105('0x16')]=_['keys'](_0x3e1c5f[_0xf105('0x16')]);_0x369b60[_0xf105('0x17')]=_[_0xf105('0x18')](_0x369b60[_0xf105('0x15')],_0x369b60[_0xf105('0x16')]);_0xe07a35[_0xf105('0x19')]=_[_0xf105('0x18')](_0x369b60[_0xf105('0x15')],qs['fields'](_0x3e1c5f[_0xf105('0x16')]['fields']));_0xe07a35[_0xf105('0x19')]=_0xe07a35['attributes'][_0xf105('0x1a')]?_0xe07a35[_0xf105('0x19')]:_0x369b60[_0xf105('0x15')];if(!_0x3e1c5f[_0xf105('0x16')][_0xf105('0x1b')](_0xf105('0x1c'))){_0xe07a35['limit']=qs[_0xf105('0x6')](_0x3e1c5f['query'][_0xf105('0x6')]);_0xe07a35[_0xf105('0x4')]=qs[_0xf105('0x4')](_0x3e1c5f[_0xf105('0x16')][_0xf105('0x4')]);}_0xe07a35[_0xf105('0x1d')]=qs[_0xf105('0x1e')](_0x3e1c5f[_0xf105('0x16')][_0xf105('0x1e')]);_0xe07a35[_0xf105('0x1f')]=qs['filters'](_['pick'](_0x3e1c5f[_0xf105('0x16')],_0x369b60[_0xf105('0x17')]),_0x2a673b);if(_0x3e1c5f['query']['filter']){_0xe07a35[_0xf105('0x1f')]=_[_0xf105('0x20')](_0xe07a35[_0xf105('0x1f')],{'$or':_['map'](_0x2a673b,function(_0x2245cf){if(_0x2245cf[_0xf105('0x13')]!==_0xf105('0x21')){var _0xd48fbb={};_0xd48fbb[_0x2245cf[_0xf105('0xf')]]={'$like':'%'+_0x3e1c5f[_0xf105('0x16')][_0xf105('0x22')]+'%'};return _0xd48fbb;}})});}_0xe07a35=_['merge']({},_0xe07a35,_0x3e1c5f[_0xf105('0x23')]);var _0x487466={'where':_0xe07a35[_0xf105('0x1f')]};return db['Dynamics365Account'][_0xf105('0x7')](_0x487466)['then'](function(_0x3240df){_0x3d704a[_0xf105('0x7')]=_0x3240df;if(_0x3e1c5f[_0xf105('0x16')][_0xf105('0x24')]){_0xe07a35['include']=[{'all':!![]}];}return db[_0xf105('0x25')]['findAll'](_0xe07a35);})[_0xf105('0xb')](function(_0x478acc){_0x3d704a[_0xf105('0x26')]=_0x478acc;return _0x3d704a;})[_0xf105('0xb')](respondWithFilteredResult(_0x2188e9,_0xe07a35))['catch'](handleError(_0x2188e9,null));};exports[_0xf105('0x27')]=function(_0x405417,_0x2279f3){var _0x328bd0={'raw':![],'where':{'id':_0x405417[_0xf105('0x28')]['id']}},_0x17b61c={};_0x17b61c[_0xf105('0x15')]=_[_0xf105('0x29')](db[_0xf105('0x25')][_0xf105('0x2a')]);_0x17b61c[_0xf105('0x16')]=_[_0xf105('0x29')](_0x405417[_0xf105('0x16')]);_0x17b61c[_0xf105('0x17')]=_[_0xf105('0x18')](_0x17b61c[_0xf105('0x15')],_0x17b61c['query']);_0x328bd0[_0xf105('0x19')]=_['intersection'](_0x17b61c[_0xf105('0x15')],qs[_0xf105('0x2b')](_0x405417['query'][_0xf105('0x2b')]));_0x328bd0[_0xf105('0x19')]=_0x328bd0[_0xf105('0x19')][_0xf105('0x1a')]?_0x328bd0[_0xf105('0x19')]:_0x17b61c[_0xf105('0x15')];if(_0x405417['query'][_0xf105('0x24')]){_0x328bd0[_0xf105('0x2c')]=[{'all':!![]}];}_0x328bd0=_[_0xf105('0x20')]({},_0x328bd0,_0x405417[_0xf105('0x23')]);return db['Dynamics365Account']['find'](_0x328bd0)[_0xf105('0xb')](handleEntityNotFound(_0x2279f3,null))[_0xf105('0xb')](respondWithResult(_0x2279f3,null))[_0xf105('0x2d')](handleError(_0x2279f3,null));};exports[_0xf105('0x2e')]=function(_0x25e090,_0x13ad8d){return db['Dynamics365Account'][_0xf105('0x2e')](_0x25e090[_0xf105('0x2f')],{})[_0xf105('0xb')](respondWithResult(_0x13ad8d,0xc9))[_0xf105('0x2d')](handleError(_0x13ad8d,null));};exports['update']=function(_0x5a8234,_0x7be3bc){if(_0x5a8234[_0xf105('0x2f')]['id']){delete _0x5a8234[_0xf105('0x2f')]['id'];}return db[_0xf105('0x25')][_0xf105('0x30')]({'where':{'id':_0x5a8234[_0xf105('0x28')]['id']}})['then'](handleEntityNotFound(_0x7be3bc,null))['then'](saveUpdates(_0x5a8234['body'],null))[_0xf105('0xb')](respondWithResult(_0x7be3bc,null))[_0xf105('0x2d')](handleError(_0x7be3bc,null));};exports[_0xf105('0xc')]=function(_0x3fae65,_0x5625c8){return db[_0xf105('0x25')][_0xf105('0x30')]({'where':{'id':_0x3fae65[_0xf105('0x28')]['id']}})[_0xf105('0xb')](handleEntityNotFound(_0x5625c8,null))['then'](removeEntity(_0x5625c8,null))[_0xf105('0x2d')](handleError(_0x5625c8,null));};exports[_0xf105('0x31')]=function(_0x400103,_0x59b75f){var _0x33624f={};var _0x1beeab={};var _0x1f2509;var _0x5d65e9;return db[_0xf105('0x25')]['findOne']({'where':{'id':_0x400103['params']['id']}})[_0xf105('0xb')](handleEntityNotFound(_0x59b75f,null))[_0xf105('0xb')](function(_0x173b10){if(_0x173b10){_0x1f2509=_0x173b10;_0x1beeab['model']=_[_0xf105('0x29')](db[_0xf105('0x32')][_0xf105('0x2a')]);_0x1beeab['query']=_['keys'](_0x400103['query']);_0x1beeab[_0xf105('0x17')]=_[_0xf105('0x18')](_0x1beeab[_0xf105('0x15')],_0x1beeab[_0xf105('0x16')]);_0x33624f[_0xf105('0x19')]=_[_0xf105('0x18')](_0x1beeab[_0xf105('0x15')],qs['fields'](_0x400103['query'][_0xf105('0x2b')]));_0x33624f['attributes']=_0x33624f[_0xf105('0x19')][_0xf105('0x1a')]?_0x33624f[_0xf105('0x19')]:_0x1beeab['model'];_0x33624f[_0xf105('0x1d')]=qs[_0xf105('0x1e')](_0x400103[_0xf105('0x16')][_0xf105('0x1e')]);_0x33624f[_0xf105('0x1f')]=qs[_0xf105('0x17')](_[_0xf105('0x33')](_0x400103[_0xf105('0x16')],_0x1beeab[_0xf105('0x17')]));if(_0x400103[_0xf105('0x16')][_0xf105('0x22')]){_0x33624f[_0xf105('0x1f')]=_[_0xf105('0x20')](_0x33624f[_0xf105('0x1f')],{'$or':_[_0xf105('0x11')](_0x33624f['attributes'],function(_0x1ee4b0){var _0x3736f9={};_0x3736f9[_0x1ee4b0]={'$like':'%'+_0x400103[_0xf105('0x16')][_0xf105('0x22')]+'%'};return _0x3736f9;})});}_0x33624f=_[_0xf105('0x20')]({},_0x33624f,_0x400103[_0xf105('0x23')]);return _0x1f2509[_0xf105('0x31')](_0x33624f);}})['then'](function(_0x2ecff5){if(_0x2ecff5){_0x5d65e9=_0x2ecff5[_0xf105('0x1a')];if(!_0x400103['query'][_0xf105('0x1b')](_0xf105('0x1c'))){_0x33624f[_0xf105('0x6')]=qs[_0xf105('0x6')](_0x400103['query'][_0xf105('0x6')]);_0x33624f[_0xf105('0x4')]=qs[_0xf105('0x4')](_0x400103[_0xf105('0x16')]['offset']);}return _0x1f2509['getConfigurations'](_0x33624f);}})[_0xf105('0xb')](function(_0x10dbd7){if(_0x10dbd7){return _0x10dbd7?{'count':_0x5d65e9,'rows':_0x10dbd7}:null;}})['then'](respondWithResult(_0x59b75f,null))['catch'](handleError(_0x59b75f,null));};exports['addConfiguration']=function(_0x6977a1,_0x112b46){if(_0x6977a1[_0xf105('0x2f')]['id']){delete _0x6977a1[_0xf105('0x2f')]['id'];}return db[_0xf105('0x25')][_0xf105('0x34')]({'where':{'id':_0x6977a1[_0xf105('0x28')]['id']}})['then'](handleEntityNotFound(_0x112b46,null))[_0xf105('0xb')](function(_0x5d82d2){if(_0x5d82d2){_0x6977a1[_0xf105('0x2f')]['AccountId']=_0x5d82d2['id'];_0x6977a1[_0xf105('0x2f')][_0xf105('0x35')]=integrations[_0xf105('0x36')](_0x6977a1[_0xf105('0x2f')]['channel'],_0x6977a1[_0xf105('0x2f')][_0xf105('0x13')]);_0x6977a1[_0xf105('0x2f')][_0xf105('0x37')]=integrations[_0xf105('0x38')](_0x6977a1[_0xf105('0x2f')][_0xf105('0x39')],_0x6977a1[_0xf105('0x2f')][_0xf105('0x13')]);return db[_0xf105('0x32')][_0xf105('0x2e')](_0x6977a1[_0xf105('0x2f')],{'include':[{'model':db[_0xf105('0x3a')],'as':_0xf105('0x35')},{'model':db[_0xf105('0x3a')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x112b46,null))[_0xf105('0x2d')](handleError(_0x112b46,null));};function sanitizeRemoteUri(_0x322082){var _0x32bd5d=_0x322082[_0xf105('0x3b')](-0x1);if(_0x32bd5d==='/')return _0x322082[_0xf105('0x3c')](0x0,_0x322082[_0xf105('0x3d')](_0x32bd5d));return _0x322082;}function getWebApiUrl(_0x158eeb){return util['format'](_0xf105('0x3e'),_0x158eeb);}exports[_0xf105('0x3f')]=function(_0x2d8b1b,_0xf1fab6){var _0x521662=_0x2d8b1b[_0xf105('0x16')]['ticketType'];var _0x109e6a=_0x521662===_0xf105('0x40')?_0xf105('0x41'):_0xf105('0x42');var _0xd5ec2f='';var _0x4fbe8b='';var _0x160703='';var _0x58152b='';var _0x24207c='';var _0x4bf374='';var _0x4b7423='';var _0x3b7920='';var _0x380fba=[_0xf105('0x43'),_0xf105('0x44'),'customerid',_0xf105('0x45'),_0xf105('0x46'),_0xf105('0x47'),'phonenumber','regardingobjectid',_0xf105('0x48'),_0xf105('0x49')];var _0x15f9c7=[_0xf105('0x4a'),_0xf105('0x4b'),'actualserviceunits','billedserviceunits',_0xf105('0x4c'),_0xf105('0x4d'),_0xf105('0x4e'),_0xf105('0x4f'),_0xf105('0x50'),'createdbyexternalpartyyominame','createdbyname','createdbyyominame',_0xf105('0x51'),_0xf105('0x52'),_0xf105('0x53'),_0xf105('0x54'),_0xf105('0x55'),_0xf105('0x56'),_0xf105('0x57'),_0xf105('0x58'),_0xf105('0x59'),_0xf105('0x5a'),_0xf105('0x5b'),'exchangerate',_0xf105('0x5c'),_0xf105('0x5d'),_0xf105('0x5e'),_0xf105('0x5f'),_0xf105('0x60'),'lastonholdtime',_0xf105('0x61'),_0xf105('0x62'),_0xf105('0x63'),_0xf105('0x64'),_0xf105('0x65'),_0xf105('0x66'),_0xf105('0x67'),_0xf105('0x68'),_0xf105('0x69'),'msdyn_iotalertname',_0xf105('0x6a'),_0xf105('0x6b'),'overriddencreatedon','owneridname',_0xf105('0x6c'),_0xf105('0x6d'),'parentcaseidname',_0xf105('0x6e'),'primarycontactidyominame',_0xf105('0x6f'),_0xf105('0x70'),_0xf105('0x71'),'resolveby',_0xf105('0x72'),_0xf105('0x73'),'responsiblecontactidname','responsiblecontactidyominame',_0xf105('0x74'),'slainvokedidname',_0xf105('0x75'),'socialprofileidname',_0xf105('0x76'),_0xf105('0x77'),_0xf105('0x78'),_0xf105('0x79'),_0xf105('0x7a'),'transactioncurrencyidname','traversedpath',_0xf105('0x7b'),_0xf105('0x7c')];var _0x346030=_0x380fba[_0xf105('0x7d')](_0x15f9c7);return db[_0xf105('0x25')][_0xf105('0x34')]({'where':{'id':_0x2d8b1b['params']['id']},'attributes':['id',_0xf105('0x7e'),'password','remoteUri',_0xf105('0x7f'),_0xf105('0x80'),_0xf105('0x81'),_0xf105('0x82')],'include':[{'model':db['CloudProvider'],'as':_0xf105('0x83'),'attributes':['id',_0xf105('0x84'),_0xf105('0x85')]}]})[_0xf105('0xb')](handleEntityNotFound(_0xf1fab6,null))['then'](function(_0x2f60f7){if(_0x2f60f7){if(_0x2f60f7[_0xf105('0x82')]){_0x2f60f7[_0xf105('0x86')]=_0x2f60f7['CloudProvider']['data5'];_0x3b7920=sanitizeRemoteUri(_0x2f60f7[_0xf105('0x83')][_0xf105('0x85')]);_0x4b7423=getWebApiUrl(_0x3b7920);return _0x2f60f7;}_0x3b7920=sanitizeRemoteUri(_0x2f60f7[_0xf105('0x87')]);_0x4b7423=getWebApiUrl(_0x3b7920);var _0x3de2fb={'method':'POST','uri':_0xf105('0x88')+_0x2f60f7['tenantId']+_0xf105('0x89'),'form':{'client_id':_0x2f60f7['clientId'],'resource':_0x3b7920,'username':_0x2f60f7['username'],'password':_0x2f60f7[_0xf105('0x8a')],'grant_type':_0xf105('0x8a'),'client_secret':_0x2f60f7['clientSecret']},'json':!![]};return rp(_0x3de2fb);}})[_0xf105('0xb')](function(_0x52ecc7){_0x4bf374=_0x52ecc7['access_token'];var _0x470bdc={'method':'GET','uri':encodeURI(_0x4b7423+_0xf105('0x8b')+_0x109e6a+'\x27'),'headers':{'Authorization':_0xf105('0x8c')+_0x4bf374,'If-None-Match':null,'OData-Version':_0xf105('0x8d')},'json':!![]};return rp(_0x470bdc);})[_0xf105('0xb')](function(_0x5ee864){var _0x1440fd=_0x5ee864[_0xf105('0x8e')][0x0];var _0x34b35c=_0x1440fd[_0xf105('0x8f')];var _0xac21={'method':_0xf105('0x90'),'uri':_0x4b7423+_0xf105('0x91')+_0x34b35c+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf105('0x8c')+_0x4bf374,'If-None-Match':null,'OData-Version':_0xf105('0x8d')},'json':!![]};return rp(_0xac21);})[_0xf105('0xb')](function(_0x39703a){_0xd5ec2f=_0x39703a;_0x4fbe8b=_0xd5ec2f[_0xf105('0x92')];_0x4fbe8b=_['remove'](_0x4fbe8b,function(_0x3bd40b){return!_0x346030[_0xf105('0x93')](_0x3bd40b[_0xf105('0x94')]);});var _0x3b392e=[];var _0x225d38=[];_0x4fbe8b[_0xf105('0x95')](function(_0x32d188){if(_0x32d188[_0xf105('0x96')]){var _0x729aa2=_0x32d188[_0xf105('0x96')][_0xf105('0x3c')](_0x32d188[_0xf105('0x96')]['lastIndexOf']('.')+0x1);if(_0x729aa2===_0xf105('0x97')){_0x3b392e[_0xf105('0x98')](getSelectList(_0x4b7423,_0x521662,_0x225d38,_0xd5ec2f[_0xf105('0x8f')],_0x32d188[_0xf105('0x8f')],_0x4bf374));}}});return Promise[_0xf105('0x99')](_0x3b392e);})[_0xf105('0xb')](function(_0xc1cf3a){_0x160703=_0xc1cf3a[0x0];var _0x25e8c8=[];var _0x519f20=[];_0x4fbe8b[_0xf105('0x95')](function(_0x1b3117){if(!_[_0xf105('0x9a')](_0x1b3117['@odata.type'])){var _0x441d08=_0x1b3117[_0xf105('0x96')]['substring'](_0x1b3117[_0xf105('0x96')][_0xf105('0x3d')]('.')+0x1);if(_0x441d08==='BooleanAttributeMetadata'){_0x25e8c8[_0xf105('0x98')](getBooleanList(_0x4b7423,_0x521662,_0x519f20,_0xd5ec2f['MetadataId'],_0x1b3117['MetadataId'],_0x4bf374));}}});return Promise[_0xf105('0x99')](_0x25e8c8);})[_0xf105('0xb')](function(_0x53f45c){_0x58152b=_0x53f45c[0x0];var _0x28c27b=[];var _0x5ae7ba=[];_0x4fbe8b[_0xf105('0x95')](function(_0x58ec27){if(_0x58ec27[_0xf105('0x96')]){var _0x493998=_0x58ec27[_0xf105('0x96')][_0xf105('0x3c')](_0x58ec27['@odata.type'][_0xf105('0x3d')]('.')+0x1);if(_0x493998===_0xf105('0x9b')||_0x493998===_0xf105('0x9c')||_0x493998===_0xf105('0x9d')||_0x493998===_0xf105('0x9e')||_0x493998===_0xf105('0x9f')||_0x493998===_0xf105('0xa0')||_0x493998===_0xf105('0xa1')||_0x493998===_0xf105('0xa2')||_0x493998===_0xf105('0xa3')||_0x493998===_0xf105('0xa4')){_0x28c27b[_0xf105('0x98')](getInputList(_0x4b7423,_0x521662,_0x493998,_0x5ae7ba,_0xd5ec2f[_0xf105('0x8f')],_0x58ec27[_0xf105('0x8f')],_0x4bf374));}}});return Promise['all'](_0x28c27b);})['then'](function(_0x349ded){_0x24207c=_0x349ded[0x0];var _0x3b7ee1=_0x160703[_0xf105('0x7d')](_0x58152b)[_0xf105('0x7d')](_0x24207c);var _0x4bde98={'count':_0x3b7ee1['length'],'rows':_0x3b7ee1};return _0x4bde98;})[_0xf105('0xb')](respondWithResult(_0xf1fab6,null))[_0xf105('0x2d')](function(_0x57c253){var _0x25db3a=_0x2d8b1b[_0xf105('0x16')]['test']?0x1f4:_0x57c253['statusCode']||0x1f4;logger[_0xf105('0xa5')](_0x57c253['stack']);delete _0x57c253[_0xf105('0xf')];if(_0x25db3a===0x191){_0x25db3a=0x190;}_0xf1fab6[_0xf105('0x8')](_0x25db3a)[_0xf105('0xa6')](_0x2d8b1b[_0xf105('0x16')][_0xf105('0xa7')]?{'message':_0xf105('0xa8'),'statusCode':_0x57c253[_0xf105('0xa9')]}:_0x57c253);});};function getSelectList(_0x53690e,_0x59a9b1,_0x26fe5d,_0xd20ada,_0x6fc0e0,_0x224368){var _0x3d2e83={'method':_0xf105('0x90'),'uri':_0x53690e+_0xf105('0x91')+_0xd20ada+_0xf105('0xaa')+_0x6fc0e0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xf105('0xab'),'headers':{'Authorization':_0xf105('0x8c')+_0x224368,'If-None-Match':null,'OData-Version':_0xf105('0x8d')},'json':!![]};return rp(_0x3d2e83)[_0xf105('0xb')](function(_0x57a112){var _0x22e10b=[];var _0x19989d=_0x57a112['OptionSet'][_0xf105('0xac')];_0x19989d['forEach'](function(_0x5097d7){_0x22e10b[_0xf105('0x98')]({'name':_0x5097d7[_0xf105('0xad')][_0xf105('0xae')][_0xf105('0xad')],'value':String(_0x5097d7['Value'])});});var _0x29f175={'id':_0x59a9b1+'_'+_0x57a112[_0xf105('0x94')],'name':_0x57a112[_0xf105('0xaf')][_0xf105('0xae')]['Label'],'custom':![],'options':_0x22e10b};_0x26fe5d[_0xf105('0x98')](_0x29f175);return _0x26fe5d;});}function getBooleanList(_0x513590,_0x52f844,_0x52a61f,_0x356961,_0xe78d75,_0x1a7978){var _0x47494b={'method':'GET','uri':_0x513590+_0xf105('0x91')+_0x356961+_0xf105('0xaa')+_0xe78d75+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xf105('0x8c')+_0x1a7978,'If-None-Match':null,'OData-Version':_0xf105('0x8d')},'json':!![]};return rp(_0x47494b)[_0xf105('0xb')](function(_0x29d0e6){var _0x944ed5=[];_0x944ed5['push']({'name':_0x29d0e6[_0xf105('0xb0')]['TrueOption'][_0xf105('0xad')][_0xf105('0xae')]['Label'],'value':_0xf105('0xb1')},{'name':_0x29d0e6[_0xf105('0xb0')]['FalseOption']['Label'][_0xf105('0xae')][_0xf105('0xad')],'value':_0xf105('0xb2')});var _0x52ce29={'id':_0x52f844+'_'+_0x29d0e6[_0xf105('0x94')],'name':_0x29d0e6[_0xf105('0xaf')]['UserLocalizedLabel'][_0xf105('0xad')],'custom':![],'options':_0x944ed5};_0x52a61f['push'](_0x52ce29);return _0x52a61f;});}function getInputList(_0x2b3fc4,_0x17b49a,_0x34131a,_0x28bf6f,_0x14fd0a,_0x5cd09d,_0x528f80){var _0x1418cd={'method':_0xf105('0x90'),'uri':_0x2b3fc4+_0xf105('0x91')+_0x14fd0a+_0xf105('0xaa')+_0x5cd09d+_0xf105('0xb3')+_0x34131a+_0xf105('0xb4'),'headers':{'Authorization':_0xf105('0x8c')+_0x528f80,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1418cd)[_0xf105('0xb')](function(_0x1e6fa9){var _0x415528={'id':_0x17b49a+'_'+_0x1e6fa9[_0xf105('0x94')],'name':_0x1e6fa9[_0xf105('0xaf')][_0xf105('0xae')]?_0x1e6fa9['DisplayName'][_0xf105('0xae')][_0xf105('0xad')]:_0x1e6fa9[_0xf105('0x94')],'custom':![],'options':[]};_0x28bf6f[_0xf105('0x98')](_0x415528);return _0x28bf6f;});} \ No newline at end of file +var _0xc366=['primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','/oauth2/token','clientId','username','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','substring','BooleanAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','Value','LogicalName','OptionSet','TrueOption','UserLocalizedLabel','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','api','json','offset','undefined','limit','count','status','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','map','Dynamics365Account','rawAttributes','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','update','find','Dynamics365Configuration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','format','%s/api/data/v9.0/','getFields','ticketType','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname'];(function(_0x1c64b4,_0x2eb6f2){var _0xf63baa=function(_0x26e704){while(--_0x26e704){_0x1c64b4['push'](_0x1c64b4['shift']());}};_0xf63baa(++_0x2eb6f2);}(_0xc366,0x1c5));var _0x6c36=function(_0x47cd8c,_0x482199){_0x47cd8c=_0x47cd8c-0x0;var _0x375a6=_0xc366[_0x47cd8c];return _0x375a6;};'use strict';var rp=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var _=require(_0x6c36('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6c36('0x3'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x259073,_0x46de14){_0x46de14=_0x46de14||0xc8;return function(_0x2d28af){if(_0x2d28af){return _0x259073['status'](_0x46de14)[_0x6c36('0x4')](_0x2d28af);}};}function respondWithFilteredResult(_0x5d1d5e,_0x55591f){return function(_0x1e99a1){if(_0x1e99a1){var _0x422d5d=typeof _0x55591f[_0x6c36('0x5')]===_0x6c36('0x6')&&typeof _0x55591f[_0x6c36('0x7')]==='undefined';var _0xf9076b=_0x1e99a1[_0x6c36('0x8')];var _0x38d21d=_0x422d5d?0x0:_0x55591f[_0x6c36('0x5')];var _0x11de0e=_0x422d5d?_0x1e99a1[_0x6c36('0x8')]:_0x55591f[_0x6c36('0x5')]+_0x55591f[_0x6c36('0x7')];var _0x20486f;if(_0x11de0e>=_0xf9076b){_0x11de0e=_0xf9076b;_0x20486f=0xc8;}else{_0x20486f=0xce;}_0x5d1d5e[_0x6c36('0x9')](_0x20486f);return _0x5d1d5e[_0x6c36('0xa')](_0x6c36('0xb'),_0x38d21d+'-'+_0x11de0e+'/'+_0xf9076b)['json'](_0x1e99a1);}return null;};}function saveUpdates(_0x2cebf9){return function(_0x20b8ef){if(_0x20b8ef){return _0x20b8ef['update'](_0x2cebf9)[_0x6c36('0xc')](function(_0x104d19){return _0x104d19;});}return null;};}function removeEntity(_0x2c9c5a){return function(_0x3ccd4a){if(_0x3ccd4a){return _0x3ccd4a[_0x6c36('0xd')]()[_0x6c36('0xc')](function(){_0x2c9c5a['status'](0xcc)[_0x6c36('0xe')]();});}};}function handleEntityNotFound(_0x16d8ff){return function(_0x166a4d){if(!_0x166a4d){_0x16d8ff[_0x6c36('0xf')](0x194);}return _0x166a4d;};}function handleError(_0x3fdf58,_0x5bf446){_0x5bf446=_0x5bf446||0x1f4;return function(_0x1e5837){logger[_0x6c36('0x10')](_0x1e5837[_0x6c36('0x11')]);if(_0x1e5837[_0x6c36('0x12')]){delete _0x1e5837[_0x6c36('0x12')];}_0x3fdf58['status'](_0x5bf446)['send'](_0x1e5837);};}exports['index']=function(_0x1187fc,_0x332f63){var _0x522970={},_0x204852={},_0x4763be={'count':0x0,'rows':[]};var _0x1840a0=_[_0x6c36('0x13')](db[_0x6c36('0x14')][_0x6c36('0x15')],function(_0x152072){return{'name':_0x152072['fieldName'],'type':_0x152072['type'][_0x6c36('0x16')]};});_0x204852['model']=_[_0x6c36('0x13')](_0x1840a0,_0x6c36('0x12'));_0x204852['query']=_[_0x6c36('0x17')](_0x1187fc['query']);_0x204852[_0x6c36('0x18')]=_[_0x6c36('0x19')](_0x204852[_0x6c36('0x1a')],_0x204852[_0x6c36('0x1b')]);_0x522970[_0x6c36('0x1c')]=_[_0x6c36('0x19')](_0x204852[_0x6c36('0x1a')],qs[_0x6c36('0x1d')](_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x1d')]));_0x522970['attributes']=_0x522970[_0x6c36('0x1c')]['length']?_0x522970[_0x6c36('0x1c')]:_0x204852[_0x6c36('0x1a')];if(!_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x1e')](_0x6c36('0x1f'))){_0x522970[_0x6c36('0x7')]=qs[_0x6c36('0x7')](_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x7')]);_0x522970['offset']=qs[_0x6c36('0x5')](_0x1187fc[_0x6c36('0x1b')]['offset']);}_0x522970['order']=qs[_0x6c36('0x20')](_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x20')]);_0x522970[_0x6c36('0x21')]=qs[_0x6c36('0x18')](_[_0x6c36('0x22')](_0x1187fc['query'],_0x204852[_0x6c36('0x18')]),_0x1840a0);if(_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x23')]){_0x522970[_0x6c36('0x21')]=_[_0x6c36('0x24')](_0x522970[_0x6c36('0x21')],{'$or':_['map'](_0x1840a0,function(_0x49418f){if(_0x49418f[_0x6c36('0x25')]!==_0x6c36('0x26')){var _0x236954={};_0x236954[_0x49418f[_0x6c36('0x12')]]={'$like':'%'+_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x23')]+'%'};return _0x236954;}})});}_0x522970=_['merge']({},_0x522970,_0x1187fc[_0x6c36('0x27')]);var _0xa0f335={'where':_0x522970[_0x6c36('0x21')]};return db[_0x6c36('0x14')]['count'](_0xa0f335)['then'](function(_0x55b795){_0x4763be[_0x6c36('0x8')]=_0x55b795;if(_0x1187fc[_0x6c36('0x1b')][_0x6c36('0x28')]){_0x522970[_0x6c36('0x29')]=[{'all':!![]}];}return db[_0x6c36('0x14')][_0x6c36('0x2a')](_0x522970);})['then'](function(_0x2563d9){_0x4763be[_0x6c36('0x2b')]=_0x2563d9;return _0x4763be;})[_0x6c36('0xc')](respondWithFilteredResult(_0x332f63,_0x522970))[_0x6c36('0x2c')](handleError(_0x332f63,null));};exports['show']=function(_0x5e77a5,_0x51abb6){var _0x37e565={'raw':![],'where':{'id':_0x5e77a5[_0x6c36('0x2d')]['id']}},_0x10297b={};_0x10297b['model']=_[_0x6c36('0x17')](db[_0x6c36('0x14')][_0x6c36('0x15')]);_0x10297b[_0x6c36('0x1b')]=_[_0x6c36('0x17')](_0x5e77a5[_0x6c36('0x1b')]);_0x10297b[_0x6c36('0x18')]=_['intersection'](_0x10297b[_0x6c36('0x1a')],_0x10297b[_0x6c36('0x1b')]);_0x37e565[_0x6c36('0x1c')]=_['intersection'](_0x10297b['model'],qs['fields'](_0x5e77a5[_0x6c36('0x1b')][_0x6c36('0x1d')]));_0x37e565['attributes']=_0x37e565['attributes'][_0x6c36('0x2e')]?_0x37e565['attributes']:_0x10297b[_0x6c36('0x1a')];if(_0x5e77a5['query'][_0x6c36('0x28')]){_0x37e565[_0x6c36('0x29')]=[{'all':!![]}];}_0x37e565=_['merge']({},_0x37e565,_0x5e77a5[_0x6c36('0x27')]);return db['Dynamics365Account']['find'](_0x37e565)['then'](handleEntityNotFound(_0x51abb6,null))[_0x6c36('0xc')](respondWithResult(_0x51abb6,null))[_0x6c36('0x2c')](handleError(_0x51abb6,null));};exports[_0x6c36('0x2f')]=function(_0x1a1578,_0x5e1825){return db['Dynamics365Account']['create'](_0x1a1578[_0x6c36('0x30')],{})[_0x6c36('0xc')](respondWithResult(_0x5e1825,0xc9))['catch'](handleError(_0x5e1825,null));};exports[_0x6c36('0x31')]=function(_0xb5fa11,_0xa5f35c){if(_0xb5fa11[_0x6c36('0x30')]['id']){delete _0xb5fa11[_0x6c36('0x30')]['id'];}return db['Dynamics365Account'][_0x6c36('0x32')]({'where':{'id':_0xb5fa11['params']['id']}})['then'](handleEntityNotFound(_0xa5f35c,null))[_0x6c36('0xc')](saveUpdates(_0xb5fa11['body'],null))[_0x6c36('0xc')](respondWithResult(_0xa5f35c,null))['catch'](handleError(_0xa5f35c,null));};exports[_0x6c36('0xd')]=function(_0x2e1462,_0xe4e401){return db[_0x6c36('0x14')][_0x6c36('0x32')]({'where':{'id':_0x2e1462[_0x6c36('0x2d')]['id']}})[_0x6c36('0xc')](handleEntityNotFound(_0xe4e401,null))['then'](removeEntity(_0xe4e401,null))[_0x6c36('0x2c')](handleError(_0xe4e401,null));};exports['getConfigurations']=function(_0x2a44e3,_0x2d2082){var _0x4ee511={};var _0x97c328={};var _0x2b1d34;var _0x168a46;return db[_0x6c36('0x14')]['findOne']({'where':{'id':_0x2a44e3[_0x6c36('0x2d')]['id']}})[_0x6c36('0xc')](handleEntityNotFound(_0x2d2082,null))[_0x6c36('0xc')](function(_0x56295f){if(_0x56295f){_0x2b1d34=_0x56295f;_0x97c328[_0x6c36('0x1a')]=_['keys'](db[_0x6c36('0x33')][_0x6c36('0x15')]);_0x97c328[_0x6c36('0x1b')]=_[_0x6c36('0x17')](_0x2a44e3[_0x6c36('0x1b')]);_0x97c328[_0x6c36('0x18')]=_[_0x6c36('0x19')](_0x97c328[_0x6c36('0x1a')],_0x97c328[_0x6c36('0x1b')]);_0x4ee511['attributes']=_[_0x6c36('0x19')](_0x97c328[_0x6c36('0x1a')],qs[_0x6c36('0x1d')](_0x2a44e3[_0x6c36('0x1b')][_0x6c36('0x1d')]));_0x4ee511[_0x6c36('0x1c')]=_0x4ee511['attributes'][_0x6c36('0x2e')]?_0x4ee511['attributes']:_0x97c328[_0x6c36('0x1a')];_0x4ee511['order']=qs[_0x6c36('0x20')](_0x2a44e3[_0x6c36('0x1b')]['sort']);_0x4ee511['where']=qs[_0x6c36('0x18')](_[_0x6c36('0x22')](_0x2a44e3[_0x6c36('0x1b')],_0x97c328[_0x6c36('0x18')]));if(_0x2a44e3[_0x6c36('0x1b')]['filter']){_0x4ee511[_0x6c36('0x21')]=_[_0x6c36('0x24')](_0x4ee511[_0x6c36('0x21')],{'$or':_['map'](_0x4ee511[_0x6c36('0x1c')],function(_0x32869a){var _0x45dde1={};_0x45dde1[_0x32869a]={'$like':'%'+_0x2a44e3[_0x6c36('0x1b')][_0x6c36('0x23')]+'%'};return _0x45dde1;})});}_0x4ee511=_[_0x6c36('0x24')]({},_0x4ee511,_0x2a44e3['options']);return _0x2b1d34['getConfigurations'](_0x4ee511);}})[_0x6c36('0xc')](function(_0x2827e0){if(_0x2827e0){_0x168a46=_0x2827e0[_0x6c36('0x2e')];if(!_0x2a44e3[_0x6c36('0x1b')][_0x6c36('0x1e')](_0x6c36('0x1f'))){_0x4ee511[_0x6c36('0x7')]=qs[_0x6c36('0x7')](_0x2a44e3['query'][_0x6c36('0x7')]);_0x4ee511[_0x6c36('0x5')]=qs['offset'](_0x2a44e3['query'][_0x6c36('0x5')]);}return _0x2b1d34['getConfigurations'](_0x4ee511);}})[_0x6c36('0xc')](function(_0x41ba26){if(_0x41ba26){return _0x41ba26?{'count':_0x168a46,'rows':_0x41ba26}:null;}})[_0x6c36('0xc')](respondWithResult(_0x2d2082,null))[_0x6c36('0x2c')](handleError(_0x2d2082,null));};exports['addConfiguration']=function(_0xdf3008,_0x2cdbc7){if(_0xdf3008[_0x6c36('0x30')]['id']){delete _0xdf3008[_0x6c36('0x30')]['id'];}return db['Dynamics365Account'][_0x6c36('0x34')]({'where':{'id':_0xdf3008['params']['id']}})['then'](handleEntityNotFound(_0x2cdbc7,null))[_0x6c36('0xc')](function(_0x4972cb){if(_0x4972cb){_0xdf3008['body'][_0x6c36('0x35')]=_0x4972cb['id'];_0xdf3008['body'][_0x6c36('0x36')]=integrations[_0x6c36('0x37')](_0xdf3008['body']['channel'],_0xdf3008[_0x6c36('0x30')][_0x6c36('0x25')]);_0xdf3008[_0x6c36('0x30')][_0x6c36('0x38')]=integrations[_0x6c36('0x39')](_0xdf3008['body'][_0x6c36('0x3a')],_0xdf3008['body']['type']);return db[_0x6c36('0x33')]['create'](_0xdf3008['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x6c36('0x36')},{'model':db[_0x6c36('0x3b')],'as':_0x6c36('0x38')}]});}return null;})['then'](respondWithResult(_0x2cdbc7,null))[_0x6c36('0x2c')](handleError(_0x2cdbc7,null));};function sanitizeRemoteUri(_0x1b7a90){var _0x3a2797=_0x1b7a90[_0x6c36('0x3c')](-0x1);if(_0x3a2797==='/')return _0x1b7a90['substring'](0x0,_0x1b7a90['lastIndexOf'](_0x3a2797));return _0x1b7a90;}function getWebApiUrl(_0xc2533a){return util[_0x6c36('0x3d')](_0x6c36('0x3e'),_0xc2533a);}exports[_0x6c36('0x3f')]=function(_0x2455ca,_0x34afd5){var _0x17fbdd=_0x2455ca[_0x6c36('0x1b')][_0x6c36('0x40')];var _0xb4344a=_0x17fbdd==='incident'?_0x6c36('0x41'):_0x6c36('0x42');var _0x2ea7e7='';var _0x4e0dd6='';var _0x3edf44='';var _0x4a5766='';var _0xdf95a0='';var _0x2ccb1a='';var _0x183adc='';var _0x13fc8e='';var _0x18e21e=['title',_0x6c36('0x43'),_0x6c36('0x44'),_0x6c36('0x45'),_0x6c36('0x46'),'subject',_0x6c36('0x47'),_0x6c36('0x48'),_0x6c36('0x49'),'phonecall_activity_parties'];var _0x774d7=[_0x6c36('0x4a'),'accountidyominame',_0x6c36('0x4b'),'billedserviceunits',_0x6c36('0x4c'),_0x6c36('0x4d'),'contractdetailidname',_0x6c36('0x4e'),_0x6c36('0x4f'),_0x6c36('0x50'),_0x6c36('0x51'),_0x6c36('0x52'),_0x6c36('0x53'),_0x6c36('0x54'),_0x6c36('0x55'),_0x6c36('0x56'),'customeridtype',_0x6c36('0x57'),_0x6c36('0x58'),_0x6c36('0x59'),_0x6c36('0x5a'),_0x6c36('0x5b'),_0x6c36('0x5c'),_0x6c36('0x5d'),_0x6c36('0x5e'),_0x6c36('0x5f'),_0x6c36('0x60'),_0x6c36('0x61'),_0x6c36('0x62'),_0x6c36('0x63'),_0x6c36('0x64'),_0x6c36('0x65'),'modifiedbyexternalpartyyominame',_0x6c36('0x66'),_0x6c36('0x67'),_0x6c36('0x68'),'modifiedonbehalfbyname',_0x6c36('0x69'),_0x6c36('0x6a'),_0x6c36('0x6b'),_0x6c36('0x6c'),_0x6c36('0x6d'),_0x6c36('0x6e'),_0x6c36('0x6f'),'owneridtype','owneridyominame',_0x6c36('0x70'),_0x6c36('0x71'),_0x6c36('0x72'),_0x6c36('0x73'),_0x6c36('0x74'),'productserialnumber',_0x6c36('0x75'),_0x6c36('0x76'),_0x6c36('0x77'),_0x6c36('0x78'),_0x6c36('0x79'),_0x6c36('0x7a'),_0x6c36('0x7b'),'slaname',_0x6c36('0x7c'),_0x6c36('0x7d'),_0x6c36('0x7e'),'subjectidname',_0x6c36('0x7f'),_0x6c36('0x80'),'transactioncurrencyidname',_0x6c36('0x81'),_0x6c36('0x82'),_0x6c36('0x83')];var _0x46a501=_0x18e21e[_0x6c36('0x84')](_0x774d7);return db[_0x6c36('0x14')]['findOne']({'where':{'id':_0x2455ca[_0x6c36('0x2d')]['id']},'attributes':['id','username','password',_0x6c36('0x85'),_0x6c36('0x86'),'clientId',_0x6c36('0x87'),_0x6c36('0x88')],'include':[{'model':db[_0x6c36('0x89')],'as':_0x6c36('0x89'),'attributes':['id','data5',_0x6c36('0x8a')]}]})[_0x6c36('0xc')](handleEntityNotFound(_0x34afd5,null))['then'](function(_0x53cce7){if(_0x53cce7){if(_0x53cce7['modernAuthentication']){_0x53cce7[_0x6c36('0x8b')]=_0x53cce7['CloudProvider'][_0x6c36('0x8c')];_0x13fc8e=sanitizeRemoteUri(_0x53cce7[_0x6c36('0x89')][_0x6c36('0x8a')]);_0x183adc=getWebApiUrl(_0x13fc8e);return _0x53cce7;}_0x13fc8e=sanitizeRemoteUri(_0x53cce7[_0x6c36('0x85')]);_0x183adc=getWebApiUrl(_0x13fc8e);var _0x1d13a2={'method':_0x6c36('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x53cce7[_0x6c36('0x86')]+_0x6c36('0x8e'),'form':{'client_id':_0x53cce7[_0x6c36('0x8f')],'resource':_0x13fc8e,'username':_0x53cce7[_0x6c36('0x90')],'password':_0x53cce7[_0x6c36('0x91')],'grant_type':'password','client_secret':_0x53cce7['clientSecret']},'json':!![]};return rp(_0x1d13a2);}})['then'](function(_0x11ab04){_0x2ccb1a=_0x11ab04['access_token'];var _0x25e7a9={'method':_0x6c36('0x92'),'uri':encodeURI(_0x183adc+_0x6c36('0x93')+_0xb4344a+'\x27'),'headers':{'Authorization':_0x6c36('0x94')+_0x2ccb1a,'If-None-Match':null,'OData-Version':_0x6c36('0x95')},'json':!![]};return rp(_0x25e7a9);})[_0x6c36('0xc')](function(_0x523cee){var _0xf4db6c=_0x523cee['value'][0x0];var _0x3833d0=_0xf4db6c[_0x6c36('0x96')];var _0xc21040={'method':_0x6c36('0x92'),'uri':_0x183adc+_0x6c36('0x97')+_0x3833d0+_0x6c36('0x98'),'headers':{'Authorization':_0x6c36('0x94')+_0x2ccb1a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xc21040);})[_0x6c36('0xc')](function(_0x55f40a){_0x2ea7e7=_0x55f40a;_0x4e0dd6=_0x2ea7e7[_0x6c36('0x99')];_0x4e0dd6=_[_0x6c36('0x9a')](_0x4e0dd6,function(_0x1e61b7){return!_0x46a501[_0x6c36('0x9b')](_0x1e61b7['LogicalName']);});var _0x4c5100=[];var _0x125d5c=[];_0x4e0dd6[_0x6c36('0x9c')](function(_0x2c27a2){if(_0x2c27a2['@odata.type']){var _0x1e01e7=_0x2c27a2[_0x6c36('0x9d')]['substring'](_0x2c27a2[_0x6c36('0x9d')][_0x6c36('0x9e')]('.')+0x1);if(_0x1e01e7===_0x6c36('0x9f')){_0x4c5100[_0x6c36('0xa0')](getSelectList(_0x183adc,_0x17fbdd,_0x125d5c,_0x2ea7e7[_0x6c36('0x96')],_0x2c27a2[_0x6c36('0x96')],_0x2ccb1a));}}});return Promise[_0x6c36('0xa1')](_0x4c5100);})[_0x6c36('0xc')](function(_0x5132c8){_0x3edf44=_0x5132c8[0x0];var _0x372f8d=[];var _0x1af3b1=[];_0x4e0dd6[_0x6c36('0x9c')](function(_0x9e3d93){if(!_[_0x6c36('0xa2')](_0x9e3d93[_0x6c36('0x9d')])){var _0x9af491=_0x9e3d93[_0x6c36('0x9d')][_0x6c36('0xa3')](_0x9e3d93[_0x6c36('0x9d')]['lastIndexOf']('.')+0x1);if(_0x9af491===_0x6c36('0xa4')){_0x372f8d[_0x6c36('0xa0')](getBooleanList(_0x183adc,_0x17fbdd,_0x1af3b1,_0x2ea7e7[_0x6c36('0x96')],_0x9e3d93[_0x6c36('0x96')],_0x2ccb1a));}}});return Promise[_0x6c36('0xa1')](_0x372f8d);})[_0x6c36('0xc')](function(_0x16b001){_0x4a5766=_0x16b001[0x0];var _0x7a06d8=[];var _0x139958=[];_0x4e0dd6[_0x6c36('0x9c')](function(_0x36a6c9){if(_0x36a6c9[_0x6c36('0x9d')]){var _0x528b63=_0x36a6c9[_0x6c36('0x9d')][_0x6c36('0xa3')](_0x36a6c9[_0x6c36('0x9d')][_0x6c36('0x9e')]('.')+0x1);if(_0x528b63==='StringAttributeMetadata'||_0x528b63==='DoubleAttributeMetadata'||_0x528b63===_0x6c36('0xa5')||_0x528b63===_0x6c36('0xa6')||_0x528b63==='MemoAttributeMetadata'||_0x528b63===_0x6c36('0xa7')||_0x528b63===_0x6c36('0xa8')||_0x528b63===_0x6c36('0xa9')||_0x528b63===_0x6c36('0xaa')||_0x528b63===_0x6c36('0xab')){_0x7a06d8[_0x6c36('0xa0')](getInputList(_0x183adc,_0x17fbdd,_0x528b63,_0x139958,_0x2ea7e7['MetadataId'],_0x36a6c9[_0x6c36('0x96')],_0x2ccb1a));}}});return Promise['all'](_0x7a06d8);})['then'](function(_0x208760){_0xdf95a0=_0x208760[0x0];var _0x25df0e=_0x3edf44[_0x6c36('0x84')](_0x4a5766)[_0x6c36('0x84')](_0xdf95a0);var _0x44a866={'count':_0x25df0e['length'],'rows':_0x25df0e};return _0x44a866;})[_0x6c36('0xc')](respondWithResult(_0x34afd5,null))[_0x6c36('0x2c')](function(_0x4996a2){var _0x281f12=_0x2455ca['query'][_0x6c36('0xac')]?0x1f4:_0x4996a2[_0x6c36('0xad')]||0x1f4;logger[_0x6c36('0x10')](_0x4996a2[_0x6c36('0x11')]);delete _0x4996a2[_0x6c36('0x12')];if(_0x281f12===0x191){_0x281f12=0x190;}_0x34afd5[_0x6c36('0x9')](_0x281f12)[_0x6c36('0xae')](_0x2455ca[_0x6c36('0x1b')][_0x6c36('0xac')]?{'message':_0x6c36('0xaf'),'statusCode':_0x4996a2['statusCode']}:_0x4996a2);});};function getSelectList(_0x11ba80,_0x2cbdc9,_0x230580,_0x58c6cf,_0x329163,_0x2cf8f7){var _0x2e555e={'method':_0x6c36('0x92'),'uri':_0x11ba80+'EntityDefinitions('+_0x58c6cf+_0x6c36('0xb0')+_0x329163+_0x6c36('0xb1')+_0x6c36('0xb2'),'headers':{'Authorization':_0x6c36('0x94')+_0x2cf8f7,'If-None-Match':null,'OData-Version':_0x6c36('0x95')},'json':!![]};return rp(_0x2e555e)[_0x6c36('0xc')](function(_0x1da728){var _0x555db9=[];var _0xc27364=_0x1da728['OptionSet']['Options'];_0xc27364['forEach'](function(_0x202b3a){_0x555db9['push']({'name':_0x202b3a['Label']['UserLocalizedLabel'][_0x6c36('0xb3')],'value':String(_0x202b3a[_0x6c36('0xb4')])});});var _0x1aebe5={'id':_0x2cbdc9+'_'+_0x1da728[_0x6c36('0xb5')],'name':_0x1da728['DisplayName']['UserLocalizedLabel'][_0x6c36('0xb3')],'custom':![],'options':_0x555db9};_0x230580[_0x6c36('0xa0')](_0x1aebe5);return _0x230580;});}function getBooleanList(_0x5837b4,_0xa79d02,_0x5e5995,_0x555ee0,_0xf0ca26,_0x241ba7){var _0x26db87={'method':_0x6c36('0x92'),'uri':_0x5837b4+'EntityDefinitions('+_0x555ee0+_0x6c36('0xb0')+_0xf0ca26+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x6c36('0x94')+_0x241ba7,'If-None-Match':null,'OData-Version':_0x6c36('0x95')},'json':!![]};return rp(_0x26db87)[_0x6c36('0xc')](function(_0x411c5d){var _0x4777ff=[];_0x4777ff[_0x6c36('0xa0')]({'name':_0x411c5d[_0x6c36('0xb6')][_0x6c36('0xb7')][_0x6c36('0xb3')][_0x6c36('0xb8')][_0x6c36('0xb3')],'value':'true'},{'name':_0x411c5d[_0x6c36('0xb6')]['FalseOption'][_0x6c36('0xb3')][_0x6c36('0xb8')][_0x6c36('0xb3')],'value':_0x6c36('0xb9')});var _0x3f923={'id':_0xa79d02+'_'+_0x411c5d[_0x6c36('0xb5')],'name':_0x411c5d[_0x6c36('0xba')][_0x6c36('0xb8')][_0x6c36('0xb3')],'custom':![],'options':_0x4777ff};_0x5e5995[_0x6c36('0xa0')](_0x3f923);return _0x5e5995;});}function getInputList(_0x5f14ca,_0x320d4d,_0x43ce5d,_0x3fc899,_0x37b6b5,_0x40699a,_0x48c08f){var _0xc42739={'method':_0x6c36('0x92'),'uri':_0x5f14ca+'EntityDefinitions('+_0x37b6b5+_0x6c36('0xb0')+_0x40699a+_0x6c36('0xbb')+_0x43ce5d+_0x6c36('0xbc'),'headers':{'Authorization':_0x6c36('0x94')+_0x48c08f,'If-None-Match':null,'OData-Version':_0x6c36('0x95')},'json':!![]};return rp(_0xc42739)[_0x6c36('0xc')](function(_0xcd6e05){var _0x5684a1={'id':_0x320d4d+'_'+_0xcd6e05[_0x6c36('0xb5')],'name':_0xcd6e05['DisplayName']['UserLocalizedLabel']?_0xcd6e05[_0x6c36('0xba')][_0x6c36('0xb8')]['Label']:_0xcd6e05['LogicalName'],'custom':![],'options':[]};_0x3fc899[_0x6c36('0xa0')](_0x5684a1);return _0x3fc899;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index e2ef978..628a5ed 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x232792,_0x45150a){var _0x5a1a4f=function(_0x43a4d0){while(--_0x43a4d0){_0x232792['push'](_0x232792['shift']());}};_0x5a1a4f(++_0x45150a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xcb91[_0xd578cb];return _0x775533;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3b15dc,_0x182f4d){var _0x5c10e0=function(_0x3b78d8){while(--_0x3b78d8){_0x3b15dc['push'](_0x3b15dc['shift']());}};_0x5c10e0(++_0x182f4d);}(_0x757a,0xde));var _0xa757=function(_0x30d869,_0x64d644){_0x30d869=_0x30d869-0x0;var _0x2ba187=_0x757a[_0x30d869];return _0x2ba187;};'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 0a79c17..5596f9b 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 _0x6b6a=['code','message','catch','Dynamics365Account','findAll','options','where','attributes','include','map','model','then','GetDynamics365Account','ShowDynamics365Account','find','lodash','randomstring','../../mysqldb','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xce0583,_0x30efb4){var _0x57a041=function(_0x34ef7e){while(--_0x34ef7e){_0xce0583['push'](_0xce0583['shift']());}};_0x57a041(++_0x30efb4);}(_0x6b6a,0x1c2));var _0xa6b6=function(_0x15b192,_0x38c235){_0x15b192=_0x15b192-0x0;var _0x396e73=_0x6b6a[_0x15b192];return _0x396e73;};'use strict';var _=require(_0xa6b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa6b6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6b6('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa6b6('0x3'));var client=jayson[_0xa6b6('0x4')][_0xa6b6('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x9e2bab,_0x2512dc,_0x235b11){return new BPromise(function(_0xa07f7c,_0x5215a3){return client[_0xa6b6('0x6')](_0x9e2bab,_0x235b11)['then'](function(_0x24dc02){logger[_0xa6b6('0x7')](_0xa6b6('0x8'),_0x2512dc,_0xa6b6('0x9'));logger[_0xa6b6('0xa')](_0xa6b6('0xb'),_0x2512dc,_0xa6b6('0x9'),JSON[_0xa6b6('0xc')](_0x24dc02));if(_0x24dc02[_0xa6b6('0xd')]){if(_0x24dc02[_0xa6b6('0xd')][_0xa6b6('0xe')]===0x1f4){logger[_0xa6b6('0xd')](_0xa6b6('0x8'),_0x2512dc,_0x24dc02[_0xa6b6('0xd')][_0xa6b6('0xf')]);return _0x5215a3(_0x24dc02[_0xa6b6('0xd')][_0xa6b6('0xf')]);}logger[_0xa6b6('0xd')](_0xa6b6('0x8'),_0x2512dc,_0x24dc02[_0xa6b6('0xd')][_0xa6b6('0xf')]);return _0xa07f7c(_0x24dc02[_0xa6b6('0xd')][_0xa6b6('0xf')]);}else{logger['info'](_0xa6b6('0x8'),_0x2512dc,_0xa6b6('0x9'));_0xa07f7c(_0x24dc02['result'][_0xa6b6('0xf')]);}})[_0xa6b6('0x10')](function(_0x49a9a8){logger[_0xa6b6('0xd')](_0xa6b6('0x8'),_0x2512dc,_0x49a9a8);_0x5215a3(_0x49a9a8);});});}exports['GetDynamics365Account']=function(_0x48de39){var _0x4ef18b=this;return new Promise(function(_0x3dc748,_0x6396b7){return db[_0xa6b6('0x11')][_0xa6b6('0x12')]({'raw':_0x48de39[_0xa6b6('0x13')]?_0x48de39[_0xa6b6('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x48de39['options']?_0x48de39['options'][_0xa6b6('0x14')]||null:null,'attributes':_0x48de39[_0xa6b6('0x13')]?_0x48de39['options'][_0xa6b6('0x15')]||null:null,'limit':_0x48de39[_0xa6b6('0x13')]?_0x48de39[_0xa6b6('0x13')]['limit']||null:null,'include':_0x48de39[_0xa6b6('0x13')]?_0x48de39[_0xa6b6('0x13')][_0xa6b6('0x16')]?_[_0xa6b6('0x17')](_0x48de39['options'][_0xa6b6('0x16')],function(_0x18e873){return{'model':db[_0x18e873[_0xa6b6('0x18')]],'as':_0x18e873['as'],'attributes':_0x18e873['attributes'],'include':_0x18e873[_0xa6b6('0x16')]?_[_0xa6b6('0x17')](_0x18e873[_0xa6b6('0x16')],function(_0x24ba32){return{'model':db[_0x24ba32[_0xa6b6('0x18')]],'as':_0x24ba32['as'],'attributes':_0x24ba32['attributes'],'include':_0x24ba32[_0xa6b6('0x16')]?_[_0xa6b6('0x17')](_0x24ba32['include'],function(_0x87aaa3){return{'model':db[_0x87aaa3[_0xa6b6('0x18')]],'as':_0x87aaa3['as'],'attributes':_0x87aaa3[_0xa6b6('0x15')]};}):[]};}):[]};}):[]:[]})[_0xa6b6('0x19')](function(_0x22077a){logger[_0xa6b6('0x7')](_0xa6b6('0x1a'),_0x48de39);logger[_0xa6b6('0xa')]('GetDynamics365Account',_0x48de39,JSON[_0xa6b6('0xc')](_0x22077a));_0x3dc748(_0x22077a);})['catch'](function(_0x2cf9d7){logger['error'](_0xa6b6('0x1a'),_0x2cf9d7['message'],_0x48de39);_0x6396b7(_0x4ef18b[_0xa6b6('0xd')](0x1f4,_0x2cf9d7[_0xa6b6('0xf')]));});});};exports[_0xa6b6('0x1b')]=function(_0x28f13a){var _0x2ae1f3=this;return new Promise(function(_0x4a9274,_0x58dc22){return db[_0xa6b6('0x11')][_0xa6b6('0x1c')]({'raw':_0x28f13a[_0xa6b6('0x13')]?_0x28f13a['options']['raw']===undefined?!![]:![]:!![],'where':_0x28f13a[_0xa6b6('0x13')]?_0x28f13a[_0xa6b6('0x13')]['where']||null:null,'attributes':_0x28f13a[_0xa6b6('0x13')]?_0x28f13a[_0xa6b6('0x13')]['attributes']||null:null,'include':_0x28f13a[_0xa6b6('0x13')]?_0x28f13a[_0xa6b6('0x13')]['include']?_[_0xa6b6('0x17')](_0x28f13a[_0xa6b6('0x13')][_0xa6b6('0x16')],function(_0x1bed17){return{'model':db[_0x1bed17[_0xa6b6('0x18')]],'as':_0x1bed17['as'],'attributes':_0x1bed17['attributes'],'include':_0x1bed17['include']?_[_0xa6b6('0x17')](_0x1bed17['include'],function(_0xe621e4){return{'model':db[_0xe621e4[_0xa6b6('0x18')]],'as':_0xe621e4['as'],'attributes':_0xe621e4[_0xa6b6('0x15')],'include':_0xe621e4[_0xa6b6('0x16')]?_[_0xa6b6('0x17')](_0xe621e4[_0xa6b6('0x16')],function(_0x7f6766){return{'model':db[_0x7f6766[_0xa6b6('0x18')]],'as':_0x7f6766['as'],'attributes':_0x7f6766[_0xa6b6('0x15')]};}):[]};}):[]};}):[]:[]})[_0xa6b6('0x19')](function(_0x207faa){logger['info'](_0xa6b6('0x1b'),_0x28f13a);logger[_0xa6b6('0xa')](_0xa6b6('0x1b'),_0x28f13a,JSON['stringify'](_0x207faa));_0x4a9274(_0x207faa);})[_0xa6b6('0x10')](function(_0x24ec56){logger[_0xa6b6('0xd')](_0xa6b6('0x1b'),_0x24ec56[_0xa6b6('0xf')],_0x28f13a);_0x58dc22(_0x2ae1f3[_0xa6b6('0xd')](0x1f4,_0x24ec56[_0xa6b6('0xf')]));});});}; \ No newline at end of file +var _0x3047=['raw','where','limit','map','include','model','GetDynamics365Account','ShowDynamics365Account','find','attributes','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','Dynamics365Account','findAll','options'];(function(_0x333cd5,_0x571d86){var _0x2a2ece=function(_0x1e3c7e){while(--_0x1e3c7e){_0x333cd5['push'](_0x333cd5['shift']());}};_0x2a2ece(++_0x571d86);}(_0x3047,0x197));var _0x7304=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3047[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7304('0x0'));var util=require('util');var moment=require(_0x7304('0x1'));var BPromise=require('bluebird');var rs=require(_0x7304('0x2'));var fs=require('fs');var Redis=require(_0x7304('0x3'));var db=require(_0x7304('0x4'))['db'];var utils=require(_0x7304('0x5'));var logger=require('../../config/logger')(_0x7304('0x6'));var config=require(_0x7304('0x7'));var jayson=require(_0x7304('0x8'));var client=jayson[_0x7304('0x9')][_0x7304('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16355a,_0x466bbe,_0xf94e8f){return new BPromise(function(_0x47ac76,_0x479af7){return client[_0x7304('0xb')](_0x16355a,_0xf94e8f)[_0x7304('0xc')](function(_0x1cea2a){logger[_0x7304('0xd')](_0x7304('0xe'),_0x466bbe,_0x7304('0xf'));logger[_0x7304('0x10')](_0x7304('0x11'),_0x466bbe,'request\x20sent',JSON['stringify'](_0x1cea2a));if(_0x1cea2a[_0x7304('0x12')]){if(_0x1cea2a[_0x7304('0x12')]['code']===0x1f4){logger[_0x7304('0x12')](_0x7304('0xe'),_0x466bbe,_0x1cea2a[_0x7304('0x12')][_0x7304('0x13')]);return _0x479af7(_0x1cea2a[_0x7304('0x12')]['message']);}logger[_0x7304('0x12')](_0x7304('0xe'),_0x466bbe,_0x1cea2a['error'][_0x7304('0x13')]);return _0x47ac76(_0x1cea2a[_0x7304('0x12')][_0x7304('0x13')]);}else{logger[_0x7304('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x466bbe,_0x7304('0xf'));_0x47ac76(_0x1cea2a[_0x7304('0x14')][_0x7304('0x13')]);}})[_0x7304('0x15')](function(_0x4f8076){logger['error'](_0x7304('0xe'),_0x466bbe,_0x4f8076);_0x479af7(_0x4f8076);});});}exports['GetDynamics365Account']=function(_0x522b95){var _0x226c90=this;return new Promise(function(_0x55b457,_0x499fba){return db[_0x7304('0x16')][_0x7304('0x17')]({'raw':_0x522b95[_0x7304('0x18')]?_0x522b95['options'][_0x7304('0x19')]===undefined?!![]:![]:!![],'where':_0x522b95[_0x7304('0x18')]?_0x522b95[_0x7304('0x18')][_0x7304('0x1a')]||null:null,'attributes':_0x522b95[_0x7304('0x18')]?_0x522b95[_0x7304('0x18')]['attributes']||null:null,'limit':_0x522b95['options']?_0x522b95['options'][_0x7304('0x1b')]||null:null,'include':_0x522b95['options']?_0x522b95[_0x7304('0x18')]['include']?_[_0x7304('0x1c')](_0x522b95[_0x7304('0x18')][_0x7304('0x1d')],function(_0x35032f){return{'model':db[_0x35032f[_0x7304('0x1e')]],'as':_0x35032f['as'],'attributes':_0x35032f['attributes'],'include':_0x35032f[_0x7304('0x1d')]?_[_0x7304('0x1c')](_0x35032f[_0x7304('0x1d')],function(_0x361ec3){return{'model':db[_0x361ec3[_0x7304('0x1e')]],'as':_0x361ec3['as'],'attributes':_0x361ec3['attributes'],'include':_0x361ec3['include']?_['map'](_0x361ec3[_0x7304('0x1d')],function(_0x5243fa){return{'model':db[_0x5243fa[_0x7304('0x1e')]],'as':_0x5243fa['as'],'attributes':_0x5243fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x7304('0xc')](function(_0x43bacb){logger['info'](_0x7304('0x1f'),_0x522b95);logger['debug'](_0x7304('0x1f'),_0x522b95,JSON['stringify'](_0x43bacb));_0x55b457(_0x43bacb);})['catch'](function(_0x227aca){logger[_0x7304('0x12')](_0x7304('0x1f'),_0x227aca['message'],_0x522b95);_0x499fba(_0x226c90[_0x7304('0x12')](0x1f4,_0x227aca[_0x7304('0x13')]));});});};exports[_0x7304('0x20')]=function(_0x4ca137){var _0x3ba62d=this;return new Promise(function(_0x26f21e,_0x33959b){return db['Dynamics365Account'][_0x7304('0x21')]({'raw':_0x4ca137[_0x7304('0x18')]?_0x4ca137[_0x7304('0x18')][_0x7304('0x19')]===undefined?!![]:![]:!![],'where':_0x4ca137[_0x7304('0x18')]?_0x4ca137[_0x7304('0x18')][_0x7304('0x1a')]||null:null,'attributes':_0x4ca137[_0x7304('0x18')]?_0x4ca137[_0x7304('0x18')]['attributes']||null:null,'include':_0x4ca137[_0x7304('0x18')]?_0x4ca137['options'][_0x7304('0x1d')]?_[_0x7304('0x1c')](_0x4ca137[_0x7304('0x18')][_0x7304('0x1d')],function(_0x1ac645){return{'model':db[_0x1ac645[_0x7304('0x1e')]],'as':_0x1ac645['as'],'attributes':_0x1ac645['attributes'],'include':_0x1ac645[_0x7304('0x1d')]?_['map'](_0x1ac645[_0x7304('0x1d')],function(_0x2a2864){return{'model':db[_0x2a2864['model']],'as':_0x2a2864['as'],'attributes':_0x2a2864[_0x7304('0x22')],'include':_0x2a2864['include']?_[_0x7304('0x1c')](_0x2a2864[_0x7304('0x1d')],function(_0xbfa7cd){return{'model':db[_0xbfa7cd['model']],'as':_0xbfa7cd['as'],'attributes':_0xbfa7cd[_0x7304('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x469262){logger[_0x7304('0xd')]('ShowDynamics365Account',_0x4ca137);logger['debug'](_0x7304('0x20'),_0x4ca137,JSON[_0x7304('0x23')](_0x469262));_0x26f21e(_0x469262);})['catch'](function(_0x5b1c65){logger[_0x7304('0x12')](_0x7304('0x20'),_0x5b1c65[_0x7304('0x13')],_0x4ca137);_0x33959b(_0x3ba62d['error'](0x1f4,_0x5b1c65[_0x7304('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index ed7f083..bba9eaf 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 _0xf4a0=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','/:id','show','get','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xf4a0,0x1f2));var _0x0f4a=function(_0x5accf1,_0x521711){_0x5accf1=_0x5accf1-0x0;var _0x2304ab=_0xf4a0[_0x5accf1];return _0x2304ab;};'use strict';var multer=require(_0x0f4a('0x0'));var util=require(_0x0f4a('0x1'));var path=require(_0x0f4a('0x2'));var timeout=require(_0x0f4a('0x3'));var express=require(_0x0f4a('0x4'));var router=express[_0x0f4a('0x5')]();var fs_extra=require(_0x0f4a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0f4a('0x7'));var config=require(_0x0f4a('0x8'));var controller=require(_0x0f4a('0x9'));router['get']('/',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xb')]);router['get'](_0x0f4a('0xc'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xd')]);router[_0x0f4a('0xe')]('/:id/fields',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xf')]);router['get'](_0x0f4a('0x10'),auth[_0x0f4a('0xa')](),controller['getSubjects']);router[_0x0f4a('0xe')](_0x0f4a('0x11'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0f4a('0x13')]);router[_0x0f4a('0x14')](_0x0f4a('0xc'),auth['isAuthenticated'](),controller[_0x0f4a('0x15')]);router[_0x0f4a('0x16')](_0x0f4a('0xc'),auth[_0x0f4a('0xa')](),controller['destroy']);module[_0x0f4a('0x17')]=router; \ No newline at end of file +var _0x7b08=['put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x7b08,0x163));var _0x87b0=function(_0x56ec9b,_0x429455){_0x56ec9b=_0x56ec9b-0x0;var _0x3c8e0f=_0x7b08[_0x56ec9b];return _0x3c8e0f;};'use strict';var multer=require(_0x87b0('0x0'));var util=require('util');var path=require(_0x87b0('0x1'));var timeout=require(_0x87b0('0x2'));var express=require(_0x87b0('0x3'));var router=express['Router']();var fs_extra=require(_0x87b0('0x4'));var auth=require(_0x87b0('0x5'));var interaction=require(_0x87b0('0x6'));var config=require(_0x87b0('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x87b0('0x8')]('/',auth[_0x87b0('0x9')](),controller[_0x87b0('0xa')]);router[_0x87b0('0x8')](_0x87b0('0xb'),auth[_0x87b0('0x9')](),controller[_0x87b0('0xc')]);router[_0x87b0('0x8')](_0x87b0('0xd'),auth[_0x87b0('0x9')](),controller['getFields']);router[_0x87b0('0x8')](_0x87b0('0xe'),auth[_0x87b0('0x9')](),controller[_0x87b0('0xf')]);router[_0x87b0('0x8')](_0x87b0('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x87b0('0x11')]('/',auth[_0x87b0('0x9')](),controller[_0x87b0('0x12')]);router[_0x87b0('0x13')](_0x87b0('0xb'),auth[_0x87b0('0x9')](),controller['update']);router[_0x87b0('0x14')](_0x87b0('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x87b0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 94659ef..6c12a72 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 _0x9977=['ENUM','incident','phonecall','contact','nothing','exports','STRING'];(function(_0x340075,_0x36bde0){var _0x4c36fa=function(_0x2733b4){while(--_0x2733b4){_0x340075['push'](_0x340075['shift']());}};_0x4c36fa(++_0x36bde0);}(_0x9977,0x1ef));var _0x7997=function(_0x4ebdf4,_0x57d47f){_0x4ebdf4=_0x4ebdf4-0x0;var _0x18d1c1=_0x9977[_0x4ebdf4];return _0x18d1c1;};'use strict';var Sequelize=require('sequelize');module[_0x7997('0x0')]={'name':{'type':Sequelize[_0x7997('0x1')]},'description':{'type':Sequelize[_0x7997('0x1')]},'ticketType':{'type':Sequelize[_0x7997('0x2')](_0x7997('0x3'),_0x7997('0x4')),'defaultValue':_0x7997('0x3')},'moduleCreate':{'type':Sequelize[_0x7997('0x2')](_0x7997('0x5'),_0x7997('0x6')),'defaultValue':_0x7997('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x7997('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xac29=['incident','phonecall','nothing','sequelize','STRING','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac29,0xed));var _0x9ac2=function(_0x2af0e9,_0x5d13d8){_0x2af0e9=_0x2af0e9-0x0;var _0x5aaa1b=_0xac29[_0x2af0e9];return _0x5aaa1b;};'use strict';var Sequelize=require(_0x9ac2('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ac2('0x1')]},'description':{'type':Sequelize[_0x9ac2('0x1')]},'ticketType':{'type':Sequelize[_0x9ac2('0x2')](_0x9ac2('0x3'),_0x9ac2('0x4')),'defaultValue':_0x9ac2('0x3')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x9ac2('0x5')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x9ac2('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a8ba9be..93446ac 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 _0xb639=['options','rows','catch','show','params','fields','includeAll','include','create','body','destroy','find','getFields','findOne','Dynamics365Field','length','sort','pick','hasOwnProperty','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','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','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','sendStatus','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','order','filter','merge','where','VIRTUAL'];(function(_0x24293,_0x334bfb){var _0xf337e=function(_0x2885be){while(--_0x2885be){_0x24293['push'](_0x24293['shift']());}};_0xf337e(++_0x334bfb);}(_0xb639,0x1ea));var _0x9b63=function(_0x5f0b01,_0x38c683){_0x5f0b01=_0x5f0b01-0x0;var _0x1f62a9=_0xb639[_0x5f0b01];return _0x1f62a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9b63('0x0'));var zipdir=require(_0x9b63('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9b63('0x2'));var BPromise=require(_0x9b63('0x3'));var Mustache=require(_0x9b63('0x4'));var util=require(_0x9b63('0x5'));var path=require(_0x9b63('0x6'));var sox=require(_0x9b63('0x7'));var csv=require('to-csv');var ejs=require(_0x9b63('0x8'));var fs=require('fs');var fs_extra=require(_0x9b63('0x9'));var _=require(_0x9b63('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b63('0xb'));var deskjs=require(_0x9b63('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9b63('0xd'));var authService=require(_0x9b63('0xe'));var qs=require(_0x9b63('0xf'));var as=require(_0x9b63('0x10'));var hardwareService=require(_0x9b63('0x11'));var logger=require(_0x9b63('0x12'))(_0x9b63('0x13'));var utils=require(_0x9b63('0x14'));var config=require(_0x9b63('0x15'));var licenseUtil=require(_0x9b63('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dfbf2,_0x995eb3){_0x995eb3=_0x995eb3||0xcc;return function(_0x4b61bd){if(_0x4b61bd){return _0x3dfbf2['sendStatus'](_0x995eb3);}return _0x3dfbf2[_0x9b63('0x17')](_0x995eb3)[_0x9b63('0x18')]();};}function respondWithResult(_0x8dc86a,_0x2d05a3){_0x2d05a3=_0x2d05a3||0xc8;return function(_0x24133b){if(_0x24133b){return _0x8dc86a[_0x9b63('0x17')](_0x2d05a3)[_0x9b63('0x19')](_0x24133b);}};}function respondWithFilteredResult(_0x9e1caf,_0x4edae7){return function(_0x76956d){if(_0x76956d){var _0x2bb40e=typeof _0x4edae7[_0x9b63('0x1a')]==='undefined'&&typeof _0x4edae7[_0x9b63('0x1b')]===_0x9b63('0x1c');var _0x5cfc6b=_0x76956d[_0x9b63('0x1d')];var _0xdadff1=_0x2bb40e?0x0:_0x4edae7[_0x9b63('0x1a')];var _0x4b16cd=_0x2bb40e?_0x76956d['count']:_0x4edae7[_0x9b63('0x1a')]+_0x4edae7['limit'];var _0x20b070;if(_0x4b16cd>=_0x5cfc6b){_0x4b16cd=_0x5cfc6b;_0x20b070=0xc8;}else{_0x20b070=0xce;}_0x9e1caf['status'](_0x20b070);return _0x9e1caf[_0x9b63('0x1e')](_0x9b63('0x1f'),_0xdadff1+'-'+_0x4b16cd+'/'+_0x5cfc6b)[_0x9b63('0x19')](_0x76956d);}return null;};}function patchUpdates(_0x1c4d51){return function(_0x2b64f5){try{jsonpatch['apply'](_0x2b64f5,_0x1c4d51,!![]);}catch(_0x14f833){return BPromise['reject'](_0x14f833);}return _0x2b64f5[_0x9b63('0x20')]();};}function saveUpdates(_0x1dff55,_0x5854ca){return function(_0x1c739d){if(_0x1c739d){return _0x1c739d[_0x9b63('0x21')](_0x1dff55)[_0x9b63('0x22')](function(_0x35b78d){return _0x35b78d;});}return null;};}function removeEntity(_0x38752e,_0xf77dd9){return function(_0x4cf50c){if(_0x4cf50c){return _0x4cf50c['destroy']()[_0x9b63('0x22')](function(){_0x38752e[_0x9b63('0x17')](0xcc)[_0x9b63('0x18')]();});}};}function handleEntityNotFound(_0x48c46a,_0x2557c5){return function(_0x386815){if(!_0x386815){_0x48c46a[_0x9b63('0x23')](0x194);}return _0x386815;};}function handleError(_0x56627c,_0x74ee30){_0x74ee30=_0x74ee30||0x1f4;return function(_0x3facd2){logger['error'](_0x3facd2[_0x9b63('0x24')]);if(_0x3facd2[_0x9b63('0x25')]){delete _0x3facd2[_0x9b63('0x25')];}_0x56627c['status'](_0x74ee30)[_0x9b63('0x26')](_0x3facd2);};}exports[_0x9b63('0x27')]=function(_0x4f2451,_0x4cdff5){var _0x8ecc25={},_0x20f51d={},_0x16cb7c={'count':0x0,'rows':[]};var _0x5b63b1=_[_0x9b63('0x28')](db[_0x9b63('0x29')][_0x9b63('0x2a')],function(_0x472d18){return{'name':_0x472d18[_0x9b63('0x2b')],'type':_0x472d18[_0x9b63('0x2c')]['key']};});_0x20f51d[_0x9b63('0x2d')]=_[_0x9b63('0x28')](_0x5b63b1,_0x9b63('0x25'));_0x20f51d['query']=_[_0x9b63('0x2e')](_0x4f2451[_0x9b63('0x2f')]);_0x20f51d[_0x9b63('0x30')]=_[_0x9b63('0x31')](_0x20f51d['model'],_0x20f51d[_0x9b63('0x2f')]);_0x8ecc25[_0x9b63('0x32')]=_[_0x9b63('0x31')](_0x20f51d[_0x9b63('0x2d')],qs['fields'](_0x4f2451['query']['fields']));_0x8ecc25[_0x9b63('0x32')]=_0x8ecc25[_0x9b63('0x32')]['length']?_0x8ecc25[_0x9b63('0x32')]:_0x20f51d[_0x9b63('0x2d')];if(!_0x4f2451[_0x9b63('0x2f')]['hasOwnProperty']('nolimit')){_0x8ecc25[_0x9b63('0x1b')]=qs[_0x9b63('0x1b')](_0x4f2451[_0x9b63('0x2f')][_0x9b63('0x1b')]);_0x8ecc25[_0x9b63('0x1a')]=qs['offset'](_0x4f2451['query'][_0x9b63('0x1a')]);}_0x8ecc25[_0x9b63('0x33')]=qs['sort'](_0x4f2451['query']['sort']);_0x8ecc25['where']=qs[_0x9b63('0x30')](_['pick'](_0x4f2451[_0x9b63('0x2f')],_0x20f51d[_0x9b63('0x30')]),_0x5b63b1);if(_0x4f2451[_0x9b63('0x2f')][_0x9b63('0x34')]){_0x8ecc25['where']=_[_0x9b63('0x35')](_0x8ecc25[_0x9b63('0x36')],{'$or':_[_0x9b63('0x28')](_0x5b63b1,function(_0x29349d){if(_0x29349d[_0x9b63('0x2c')]!==_0x9b63('0x37')){var _0x5f325a={};_0x5f325a[_0x29349d[_0x9b63('0x25')]]={'$like':'%'+_0x4f2451['query'][_0x9b63('0x34')]+'%'};return _0x5f325a;}})});}_0x8ecc25=_[_0x9b63('0x35')]({},_0x8ecc25,_0x4f2451[_0x9b63('0x38')]);var _0x24cc22={'where':_0x8ecc25[_0x9b63('0x36')]};return db[_0x9b63('0x29')]['count'](_0x24cc22)[_0x9b63('0x22')](function(_0x2f45c7){_0x16cb7c[_0x9b63('0x1d')]=_0x2f45c7;if(_0x4f2451[_0x9b63('0x2f')]['includeAll']){_0x8ecc25['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x8ecc25);})['then'](function(_0x15b16a){_0x16cb7c[_0x9b63('0x39')]=_0x15b16a;return _0x16cb7c;})['then'](respondWithFilteredResult(_0x4cdff5,_0x8ecc25))[_0x9b63('0x3a')](handleError(_0x4cdff5,null));};exports[_0x9b63('0x3b')]=function(_0x27b336,_0x571ef0){var _0x54d528={'raw':![],'where':{'id':_0x27b336[_0x9b63('0x3c')]['id']}},_0x2dff99={};_0x2dff99['model']=_[_0x9b63('0x2e')](db['Dynamics365Configuration'][_0x9b63('0x2a')]);_0x2dff99[_0x9b63('0x2f')]=_[_0x9b63('0x2e')](_0x27b336[_0x9b63('0x2f')]);_0x2dff99[_0x9b63('0x30')]=_['intersection'](_0x2dff99[_0x9b63('0x2d')],_0x2dff99[_0x9b63('0x2f')]);_0x54d528[_0x9b63('0x32')]=_['intersection'](_0x2dff99[_0x9b63('0x2d')],qs[_0x9b63('0x3d')](_0x27b336['query'][_0x9b63('0x3d')]));_0x54d528['attributes']=_0x54d528['attributes']['length']?_0x54d528[_0x9b63('0x32')]:_0x2dff99[_0x9b63('0x2d')];if(_0x27b336[_0x9b63('0x2f')][_0x9b63('0x3e')]){_0x54d528[_0x9b63('0x3f')]=[{'all':!![]}];}_0x54d528=_[_0x9b63('0x35')]({},_0x54d528,_0x27b336[_0x9b63('0x38')]);return db[_0x9b63('0x29')]['find'](_0x54d528)[_0x9b63('0x22')](handleEntityNotFound(_0x571ef0,null))[_0x9b63('0x22')](respondWithResult(_0x571ef0,null))[_0x9b63('0x3a')](handleError(_0x571ef0,null));};exports[_0x9b63('0x40')]=function(_0x508bf4,_0x5d285e){return db['Dynamics365Configuration']['create'](_0x508bf4[_0x9b63('0x41')],{})[_0x9b63('0x22')](respondWithResult(_0x5d285e,0xc9))[_0x9b63('0x3a')](handleError(_0x5d285e,null));};exports[_0x9b63('0x21')]=function(_0x5619f4,_0x29acff){if(_0x5619f4[_0x9b63('0x41')]['id']){delete _0x5619f4[_0x9b63('0x41')]['id'];}return db[_0x9b63('0x29')]['find']({'where':{'id':_0x5619f4[_0x9b63('0x3c')]['id']}})['then'](handleEntityNotFound(_0x29acff,null))['then'](saveUpdates(_0x5619f4[_0x9b63('0x41')],null))[_0x9b63('0x22')](respondWithResult(_0x29acff,null))[_0x9b63('0x3a')](handleError(_0x29acff,null));};exports[_0x9b63('0x42')]=function(_0x54057d,_0x203007){return db[_0x9b63('0x29')][_0x9b63('0x43')]({'where':{'id':_0x54057d[_0x9b63('0x3c')]['id']}})['then'](handleEntityNotFound(_0x203007,null))[_0x9b63('0x22')](removeEntity(_0x203007,null))['catch'](handleError(_0x203007,null));};exports[_0x9b63('0x44')]=function(_0x41fa69,_0x413720,_0x321b83){var _0x3034ce={};var _0x1e5f27={};var _0x44bc41;var _0x1693c5;return db['Dynamics365Configuration'][_0x9b63('0x45')]({'where':{'id':_0x41fa69[_0x9b63('0x3c')]['id']}})[_0x9b63('0x22')](handleEntityNotFound(_0x413720,null))['then'](function(_0x3816be){if(_0x3816be){_0x44bc41=_0x3816be;_0x1e5f27[_0x9b63('0x2d')]=_[_0x9b63('0x2e')](db[_0x9b63('0x46')]['rawAttributes']);_0x1e5f27['query']=_[_0x9b63('0x2e')](_0x41fa69['query']);_0x1e5f27[_0x9b63('0x30')]=_[_0x9b63('0x31')](_0x1e5f27['model'],_0x1e5f27[_0x9b63('0x2f')]);_0x3034ce[_0x9b63('0x32')]=_[_0x9b63('0x31')](_0x1e5f27[_0x9b63('0x2d')],qs['fields'](_0x41fa69['query'][_0x9b63('0x3d')]));_0x3034ce[_0x9b63('0x32')]=_0x3034ce[_0x9b63('0x32')][_0x9b63('0x47')]?_0x3034ce[_0x9b63('0x32')]:_0x1e5f27[_0x9b63('0x2d')];_0x3034ce[_0x9b63('0x33')]=qs[_0x9b63('0x48')](_0x41fa69[_0x9b63('0x2f')][_0x9b63('0x48')]);_0x3034ce[_0x9b63('0x36')]=qs['filters'](_[_0x9b63('0x49')](_0x41fa69['query'],_0x1e5f27[_0x9b63('0x30')]));if(_0x41fa69['query'][_0x9b63('0x34')]){_0x3034ce[_0x9b63('0x36')]=_[_0x9b63('0x35')](_0x3034ce[_0x9b63('0x36')],{'$or':_[_0x9b63('0x28')](_0x3034ce[_0x9b63('0x32')],function(_0x7034f){var _0x3e6f7d={};_0x3e6f7d[_0x7034f]={'$like':'%'+_0x41fa69[_0x9b63('0x2f')][_0x9b63('0x34')]+'%'};return _0x3e6f7d;})});}_0x3034ce=_[_0x9b63('0x35')]({},_0x3034ce,_0x41fa69[_0x9b63('0x38')]);return _0x44bc41[_0x9b63('0x44')](_0x3034ce);}})[_0x9b63('0x22')](function(_0x31badd){if(_0x31badd){_0x1693c5=_0x31badd[_0x9b63('0x47')];if(!_0x41fa69[_0x9b63('0x2f')][_0x9b63('0x4a')]('nolimit')){_0x3034ce[_0x9b63('0x1b')]=qs[_0x9b63('0x1b')](_0x41fa69['query'][_0x9b63('0x1b')]);_0x3034ce[_0x9b63('0x1a')]=qs['offset'](_0x41fa69['query'][_0x9b63('0x1a')]);}return _0x44bc41[_0x9b63('0x44')](_0x3034ce);}})[_0x9b63('0x22')](function(_0x23db58){if(_0x23db58){return _0x23db58?{'count':_0x1693c5,'rows':_0x23db58}:null;}})[_0x9b63('0x22')](respondWithResult(_0x413720,null))[_0x9b63('0x3a')](handleError(_0x413720,null));};exports[_0x9b63('0x4b')]=function(_0x1dfc8f,_0x4b278f,_0x2fadf8){var _0x2eda79={};var _0x139d1a={};var _0x5816e3;var _0x314c70;return db[_0x9b63('0x29')]['findOne']({'where':{'id':_0x1dfc8f['params']['id']}})[_0x9b63('0x22')](handleEntityNotFound(_0x4b278f,null))['then'](function(_0x27a554){if(_0x27a554){_0x5816e3=_0x27a554;_0x139d1a[_0x9b63('0x2d')]=_[_0x9b63('0x2e')](db[_0x9b63('0x46')][_0x9b63('0x2a')]);_0x139d1a[_0x9b63('0x2f')]=_[_0x9b63('0x2e')](_0x1dfc8f[_0x9b63('0x2f')]);_0x139d1a['filters']=_[_0x9b63('0x31')](_0x139d1a[_0x9b63('0x2d')],_0x139d1a[_0x9b63('0x2f')]);_0x2eda79[_0x9b63('0x32')]=_[_0x9b63('0x31')](_0x139d1a[_0x9b63('0x2d')],qs[_0x9b63('0x3d')](_0x1dfc8f[_0x9b63('0x2f')][_0x9b63('0x3d')]));_0x2eda79[_0x9b63('0x32')]=_0x2eda79['attributes'][_0x9b63('0x47')]?_0x2eda79[_0x9b63('0x32')]:_0x139d1a[_0x9b63('0x2d')];_0x2eda79['order']=qs[_0x9b63('0x48')](_0x1dfc8f[_0x9b63('0x2f')]['sort']);_0x2eda79['where']=qs['filters'](_[_0x9b63('0x49')](_0x1dfc8f[_0x9b63('0x2f')],_0x139d1a[_0x9b63('0x30')]));if(_0x1dfc8f[_0x9b63('0x2f')][_0x9b63('0x34')]){_0x2eda79[_0x9b63('0x36')]=_[_0x9b63('0x35')](_0x2eda79[_0x9b63('0x36')],{'$or':_[_0x9b63('0x28')](_0x2eda79[_0x9b63('0x32')],function(_0x39296e){var _0x1de86a={};_0x1de86a[_0x39296e]={'$like':'%'+_0x1dfc8f[_0x9b63('0x2f')][_0x9b63('0x34')]+'%'};return _0x1de86a;})});}_0x2eda79=_[_0x9b63('0x35')]({},_0x2eda79,_0x1dfc8f[_0x9b63('0x38')]);return _0x5816e3['getSubjects'](_0x2eda79);}})['then'](function(_0x115938){if(_0x115938){_0x314c70=_0x115938[_0x9b63('0x47')];if(!_0x1dfc8f['query'][_0x9b63('0x4a')](_0x9b63('0x4c'))){_0x2eda79[_0x9b63('0x1b')]=qs[_0x9b63('0x1b')](_0x1dfc8f[_0x9b63('0x2f')][_0x9b63('0x1b')]);_0x2eda79[_0x9b63('0x1a')]=qs[_0x9b63('0x1a')](_0x1dfc8f[_0x9b63('0x2f')][_0x9b63('0x1a')]);}return _0x5816e3[_0x9b63('0x4b')](_0x2eda79);}})['then'](function(_0x264bc1){if(_0x264bc1){return _0x264bc1?{'count':_0x314c70,'rows':_0x264bc1}:null;}})[_0x9b63('0x22')](respondWithResult(_0x4b278f,null))[_0x9b63('0x3a')](handleError(_0x4b278f,null));};exports['getDescriptions']=function(_0xb9d918,_0x4be5d0,_0x4bf7c4){var _0x36a0f3={};var _0x1c0cb6={};var _0x4d83c3;var _0xef392d;return db[_0x9b63('0x29')]['findOne']({'where':{'id':_0xb9d918[_0x9b63('0x3c')]['id']}})[_0x9b63('0x22')](handleEntityNotFound(_0x4be5d0,null))[_0x9b63('0x22')](function(_0x2d1955){if(_0x2d1955){_0x4d83c3=_0x2d1955;_0x1c0cb6[_0x9b63('0x2d')]=_[_0x9b63('0x2e')](db[_0x9b63('0x46')]['rawAttributes']);_0x1c0cb6['query']=_[_0x9b63('0x2e')](_0xb9d918['query']);_0x1c0cb6[_0x9b63('0x30')]=_[_0x9b63('0x31')](_0x1c0cb6[_0x9b63('0x2d')],_0x1c0cb6[_0x9b63('0x2f')]);_0x36a0f3[_0x9b63('0x32')]=_[_0x9b63('0x31')](_0x1c0cb6[_0x9b63('0x2d')],qs[_0x9b63('0x3d')](_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x3d')]));_0x36a0f3[_0x9b63('0x32')]=_0x36a0f3['attributes'][_0x9b63('0x47')]?_0x36a0f3['attributes']:_0x1c0cb6[_0x9b63('0x2d')];_0x36a0f3['order']=qs[_0x9b63('0x48')](_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x48')]);_0x36a0f3['where']=qs[_0x9b63('0x30')](_[_0x9b63('0x49')](_0xb9d918[_0x9b63('0x2f')],_0x1c0cb6[_0x9b63('0x30')]));if(_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x34')]){_0x36a0f3['where']=_['merge'](_0x36a0f3['where'],{'$or':_[_0x9b63('0x28')](_0x36a0f3[_0x9b63('0x32')],function(_0x4f5689){var _0x9772bc={};_0x9772bc[_0x4f5689]={'$like':'%'+_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x34')]+'%'};return _0x9772bc;})});}_0x36a0f3=_['merge']({},_0x36a0f3,_0xb9d918[_0x9b63('0x38')]);return _0x4d83c3[_0x9b63('0x4d')](_0x36a0f3);}})['then'](function(_0x49a645){if(_0x49a645){_0xef392d=_0x49a645[_0x9b63('0x47')];if(!_0xb9d918['query'][_0x9b63('0x4a')](_0x9b63('0x4c'))){_0x36a0f3[_0x9b63('0x1b')]=qs[_0x9b63('0x1b')](_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x1b')]);_0x36a0f3[_0x9b63('0x1a')]=qs[_0x9b63('0x1a')](_0xb9d918[_0x9b63('0x2f')][_0x9b63('0x1a')]);}return _0x4d83c3[_0x9b63('0x4d')](_0x36a0f3);}})['then'](function(_0x19ddd4){if(_0x19ddd4){return _0x19ddd4?{'count':_0xef392d,'rows':_0x19ddd4}:null;}})['then'](respondWithResult(_0x4be5d0,null))[_0x9b63('0x3a')](handleError(_0x4be5d0,null));}; \ No newline at end of file +var _0x8d0f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','findOne','Dynamics365Field','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','keys','query'];(function(_0x1a5b15,_0x4fb894){var _0x2c25a3=function(_0x51e30a){while(--_0x51e30a){_0x1a5b15['push'](_0x1a5b15['shift']());}};_0x2c25a3(++_0x4fb894);}(_0x8d0f,0x117));var _0xf8d0=function(_0xa5febd,_0x43ac20){_0xa5febd=_0xa5febd-0x0;var _0xcd46a8=_0x8d0f[_0xa5febd];return _0xcd46a8;};'use strict';var emlformat=require(_0xf8d0('0x0'));var rimraf=require(_0xf8d0('0x1'));var zipdir=require(_0xf8d0('0x2'));var jsonpatch=require(_0xf8d0('0x3'));var rp=require(_0xf8d0('0x4'));var moment=require(_0xf8d0('0x5'));var BPromise=require(_0xf8d0('0x6'));var Mustache=require(_0xf8d0('0x7'));var util=require(_0xf8d0('0x8'));var path=require(_0xf8d0('0x9'));var sox=require(_0xf8d0('0xa'));var csv=require(_0xf8d0('0xb'));var ejs=require(_0xf8d0('0xc'));var fs=require('fs');var fs_extra=require(_0xf8d0('0xd'));var _=require('lodash');var squel=require(_0xf8d0('0xe'));var crypto=require(_0xf8d0('0xf'));var jsforce=require(_0xf8d0('0x10'));var deskjs=require(_0xf8d0('0x11'));var toCsv=require(_0xf8d0('0xb'));var querystring=require(_0xf8d0('0x12'));var Papa=require(_0xf8d0('0x13'));var Redis=require(_0xf8d0('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xf8d0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8d0('0x16'));var logger=require(_0xf8d0('0x17'))('api');var utils=require(_0xf8d0('0x18'));var config=require(_0xf8d0('0x19'));var licenseUtil=require(_0xf8d0('0x1a'));var db=require(_0xf8d0('0x1b'))['db'];function respondWithStatusCode(_0x5b7287,_0x4f1a08){_0x4f1a08=_0x4f1a08||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x5b7287['sendStatus'](_0x4f1a08);}return _0x5b7287['status'](_0x4f1a08)[_0xf8d0('0x1c')]();};}function respondWithResult(_0x51b5a4,_0x409acf){_0x409acf=_0x409acf||0xc8;return function(_0x513588){if(_0x513588){return _0x51b5a4['status'](_0x409acf)[_0xf8d0('0x1d')](_0x513588);}};}function respondWithFilteredResult(_0x55091f,_0x1d90cb){return function(_0x127fd1){if(_0x127fd1){var _0x4e9f25=typeof _0x1d90cb['offset']===_0xf8d0('0x1e')&&typeof _0x1d90cb[_0xf8d0('0x1f')]==='undefined';var _0x7ea4b=_0x127fd1[_0xf8d0('0x20')];var _0x5f3e67=_0x4e9f25?0x0:_0x1d90cb[_0xf8d0('0x21')];var _0x3a9859=_0x4e9f25?_0x127fd1['count']:_0x1d90cb[_0xf8d0('0x21')]+_0x1d90cb['limit'];var _0x53ff5f;if(_0x3a9859>=_0x7ea4b){_0x3a9859=_0x7ea4b;_0x53ff5f=0xc8;}else{_0x53ff5f=0xce;}_0x55091f[_0xf8d0('0x22')](_0x53ff5f);return _0x55091f[_0xf8d0('0x23')](_0xf8d0('0x24'),_0x5f3e67+'-'+_0x3a9859+'/'+_0x7ea4b)[_0xf8d0('0x1d')](_0x127fd1);}return null;};}function patchUpdates(_0x521cfa){return function(_0x367de6){try{jsonpatch['apply'](_0x367de6,_0x521cfa,!![]);}catch(_0x2d969c){return BPromise[_0xf8d0('0x25')](_0x2d969c);}return _0x367de6['save']();};}function saveUpdates(_0x1d0df0,_0x4749be){return function(_0x4595c8){if(_0x4595c8){return _0x4595c8[_0xf8d0('0x26')](_0x1d0df0)[_0xf8d0('0x27')](function(_0x40082b){return _0x40082b;});}return null;};}function removeEntity(_0x1aa880,_0x3c3d6c){return function(_0x304796){if(_0x304796){return _0x304796[_0xf8d0('0x28')]()[_0xf8d0('0x27')](function(){_0x1aa880['status'](0xcc)[_0xf8d0('0x1c')]();});}};}function handleEntityNotFound(_0x5228b3,_0x4976d1){return function(_0x31e7f3){if(!_0x31e7f3){_0x5228b3[_0xf8d0('0x29')](0x194);}return _0x31e7f3;};}function handleError(_0x283b8b,_0x37e1f9){_0x37e1f9=_0x37e1f9||0x1f4;return function(_0x22873f){logger[_0xf8d0('0x2a')](_0x22873f['stack']);if(_0x22873f[_0xf8d0('0x2b')]){delete _0x22873f['name'];}_0x283b8b[_0xf8d0('0x22')](_0x37e1f9)[_0xf8d0('0x2c')](_0x22873f);};}exports[_0xf8d0('0x2d')]=function(_0x48aa18,_0x8fe337){var _0x301fc={},_0x22aaf0={},_0x476abb={'count':0x0,'rows':[]};var _0x4c1a49=_[_0xf8d0('0x2e')](db['Dynamics365Configuration'][_0xf8d0('0x2f')],function(_0x5e26f9){return{'name':_0x5e26f9['fieldName'],'type':_0x5e26f9[_0xf8d0('0x30')][_0xf8d0('0x31')]};});_0x22aaf0[_0xf8d0('0x32')]=_[_0xf8d0('0x2e')](_0x4c1a49,_0xf8d0('0x2b'));_0x22aaf0['query']=_[_0xf8d0('0x33')](_0x48aa18[_0xf8d0('0x34')]);_0x22aaf0['filters']=_[_0xf8d0('0x35')](_0x22aaf0[_0xf8d0('0x32')],_0x22aaf0[_0xf8d0('0x34')]);_0x301fc[_0xf8d0('0x36')]=_['intersection'](_0x22aaf0[_0xf8d0('0x32')],qs[_0xf8d0('0x37')](_0x48aa18[_0xf8d0('0x34')]['fields']));_0x301fc[_0xf8d0('0x36')]=_0x301fc['attributes']['length']?_0x301fc[_0xf8d0('0x36')]:_0x22aaf0[_0xf8d0('0x32')];if(!_0x48aa18[_0xf8d0('0x34')][_0xf8d0('0x38')](_0xf8d0('0x39'))){_0x301fc[_0xf8d0('0x1f')]=qs[_0xf8d0('0x1f')](_0x48aa18[_0xf8d0('0x34')][_0xf8d0('0x1f')]);_0x301fc[_0xf8d0('0x21')]=qs[_0xf8d0('0x21')](_0x48aa18[_0xf8d0('0x34')][_0xf8d0('0x21')]);}_0x301fc[_0xf8d0('0x3a')]=qs[_0xf8d0('0x3b')](_0x48aa18[_0xf8d0('0x34')]['sort']);_0x301fc[_0xf8d0('0x3c')]=qs[_0xf8d0('0x3d')](_['pick'](_0x48aa18[_0xf8d0('0x34')],_0x22aaf0[_0xf8d0('0x3d')]),_0x4c1a49);if(_0x48aa18[_0xf8d0('0x34')]['filter']){_0x301fc['where']=_[_0xf8d0('0x3e')](_0x301fc[_0xf8d0('0x3c')],{'$or':_['map'](_0x4c1a49,function(_0x3168a6){if(_0x3168a6['type']!=='VIRTUAL'){var _0x311e3d={};_0x311e3d[_0x3168a6[_0xf8d0('0x2b')]]={'$like':'%'+_0x48aa18[_0xf8d0('0x34')][_0xf8d0('0x3f')]+'%'};return _0x311e3d;}})});}_0x301fc=_['merge']({},_0x301fc,_0x48aa18[_0xf8d0('0x40')]);var _0x114269={'where':_0x301fc[_0xf8d0('0x3c')]};return db[_0xf8d0('0x41')][_0xf8d0('0x20')](_0x114269)[_0xf8d0('0x27')](function(_0x2114ae){_0x476abb[_0xf8d0('0x20')]=_0x2114ae;if(_0x48aa18['query'][_0xf8d0('0x42')]){_0x301fc['include']=[{'all':!![]}];}return db[_0xf8d0('0x41')][_0xf8d0('0x43')](_0x301fc);})[_0xf8d0('0x27')](function(_0x66119f){_0x476abb[_0xf8d0('0x44')]=_0x66119f;return _0x476abb;})[_0xf8d0('0x27')](respondWithFilteredResult(_0x8fe337,_0x301fc))[_0xf8d0('0x45')](handleError(_0x8fe337,null));};exports[_0xf8d0('0x46')]=function(_0x13f330,_0x1451d){var _0x45658e={'raw':![],'where':{'id':_0x13f330[_0xf8d0('0x47')]['id']}},_0x5c106f={};_0x5c106f[_0xf8d0('0x32')]=_[_0xf8d0('0x33')](db[_0xf8d0('0x41')]['rawAttributes']);_0x5c106f[_0xf8d0('0x34')]=_[_0xf8d0('0x33')](_0x13f330[_0xf8d0('0x34')]);_0x5c106f[_0xf8d0('0x3d')]=_[_0xf8d0('0x35')](_0x5c106f[_0xf8d0('0x32')],_0x5c106f[_0xf8d0('0x34')]);_0x45658e[_0xf8d0('0x36')]=_[_0xf8d0('0x35')](_0x5c106f[_0xf8d0('0x32')],qs['fields'](_0x13f330[_0xf8d0('0x34')][_0xf8d0('0x37')]));_0x45658e[_0xf8d0('0x36')]=_0x45658e[_0xf8d0('0x36')][_0xf8d0('0x48')]?_0x45658e[_0xf8d0('0x36')]:_0x5c106f[_0xf8d0('0x32')];if(_0x13f330[_0xf8d0('0x34')][_0xf8d0('0x42')]){_0x45658e[_0xf8d0('0x49')]=[{'all':!![]}];}_0x45658e=_[_0xf8d0('0x3e')]({},_0x45658e,_0x13f330[_0xf8d0('0x40')]);return db['Dynamics365Configuration'][_0xf8d0('0x4a')](_0x45658e)[_0xf8d0('0x27')](handleEntityNotFound(_0x1451d,null))['then'](respondWithResult(_0x1451d,null))[_0xf8d0('0x45')](handleError(_0x1451d,null));};exports[_0xf8d0('0x4b')]=function(_0x526111,_0x431e0f){return db['Dynamics365Configuration']['create'](_0x526111[_0xf8d0('0x4c')],{})[_0xf8d0('0x27')](respondWithResult(_0x431e0f,0xc9))[_0xf8d0('0x45')](handleError(_0x431e0f,null));};exports[_0xf8d0('0x26')]=function(_0x569fcb,_0x422bde){if(_0x569fcb[_0xf8d0('0x4c')]['id']){delete _0x569fcb[_0xf8d0('0x4c')]['id'];}return db['Dynamics365Configuration'][_0xf8d0('0x4a')]({'where':{'id':_0x569fcb[_0xf8d0('0x47')]['id']}})['then'](handleEntityNotFound(_0x422bde,null))[_0xf8d0('0x27')](saveUpdates(_0x569fcb['body'],null))[_0xf8d0('0x27')](respondWithResult(_0x422bde,null))[_0xf8d0('0x45')](handleError(_0x422bde,null));};exports[_0xf8d0('0x28')]=function(_0x51d199,_0x45ec87){return db[_0xf8d0('0x41')][_0xf8d0('0x4a')]({'where':{'id':_0x51d199[_0xf8d0('0x47')]['id']}})[_0xf8d0('0x27')](handleEntityNotFound(_0x45ec87,null))[_0xf8d0('0x27')](removeEntity(_0x45ec87,null))[_0xf8d0('0x45')](handleError(_0x45ec87,null));};exports['getFields']=function(_0x2e6ec9,_0x250ecc,_0x3e9334){var _0x697638={};var _0x1261d7={};var _0x1e981e;var _0x2d174a;return db['Dynamics365Configuration'][_0xf8d0('0x4d')]({'where':{'id':_0x2e6ec9['params']['id']}})[_0xf8d0('0x27')](handleEntityNotFound(_0x250ecc,null))['then'](function(_0x2387ff){if(_0x2387ff){_0x1e981e=_0x2387ff;_0x1261d7[_0xf8d0('0x32')]=_[_0xf8d0('0x33')](db[_0xf8d0('0x4e')][_0xf8d0('0x2f')]);_0x1261d7[_0xf8d0('0x34')]=_[_0xf8d0('0x33')](_0x2e6ec9[_0xf8d0('0x34')]);_0x1261d7[_0xf8d0('0x3d')]=_[_0xf8d0('0x35')](_0x1261d7[_0xf8d0('0x32')],_0x1261d7[_0xf8d0('0x34')]);_0x697638['attributes']=_['intersection'](_0x1261d7['model'],qs[_0xf8d0('0x37')](_0x2e6ec9[_0xf8d0('0x34')]['fields']));_0x697638[_0xf8d0('0x36')]=_0x697638[_0xf8d0('0x36')][_0xf8d0('0x48')]?_0x697638[_0xf8d0('0x36')]:_0x1261d7[_0xf8d0('0x32')];_0x697638[_0xf8d0('0x3a')]=qs[_0xf8d0('0x3b')](_0x2e6ec9[_0xf8d0('0x34')][_0xf8d0('0x3b')]);_0x697638[_0xf8d0('0x3c')]=qs['filters'](_[_0xf8d0('0x4f')](_0x2e6ec9['query'],_0x1261d7[_0xf8d0('0x3d')]));if(_0x2e6ec9[_0xf8d0('0x34')][_0xf8d0('0x3f')]){_0x697638['where']=_[_0xf8d0('0x3e')](_0x697638[_0xf8d0('0x3c')],{'$or':_[_0xf8d0('0x2e')](_0x697638[_0xf8d0('0x36')],function(_0x1a3d05){var _0x4aacab={};_0x4aacab[_0x1a3d05]={'$like':'%'+_0x2e6ec9[_0xf8d0('0x34')][_0xf8d0('0x3f')]+'%'};return _0x4aacab;})});}_0x697638=_['merge']({},_0x697638,_0x2e6ec9[_0xf8d0('0x40')]);return _0x1e981e[_0xf8d0('0x50')](_0x697638);}})[_0xf8d0('0x27')](function(_0x28a270){if(_0x28a270){_0x2d174a=_0x28a270[_0xf8d0('0x48')];if(!_0x2e6ec9['query'][_0xf8d0('0x38')](_0xf8d0('0x39'))){_0x697638['limit']=qs[_0xf8d0('0x1f')](_0x2e6ec9[_0xf8d0('0x34')][_0xf8d0('0x1f')]);_0x697638[_0xf8d0('0x21')]=qs['offset'](_0x2e6ec9[_0xf8d0('0x34')][_0xf8d0('0x21')]);}return _0x1e981e[_0xf8d0('0x50')](_0x697638);}})['then'](function(_0x55100a){if(_0x55100a){return _0x55100a?{'count':_0x2d174a,'rows':_0x55100a}:null;}})['then'](respondWithResult(_0x250ecc,null))[_0xf8d0('0x45')](handleError(_0x250ecc,null));};exports[_0xf8d0('0x51')]=function(_0x45d714,_0x1cf04a,_0x1493df){var _0x3d05d6={};var _0x22c3a8={};var _0x57a3c1;var _0x299396;return db[_0xf8d0('0x41')][_0xf8d0('0x4d')]({'where':{'id':_0x45d714[_0xf8d0('0x47')]['id']}})[_0xf8d0('0x27')](handleEntityNotFound(_0x1cf04a,null))[_0xf8d0('0x27')](function(_0x2fcaf8){if(_0x2fcaf8){_0x57a3c1=_0x2fcaf8;_0x22c3a8['model']=_['keys'](db[_0xf8d0('0x4e')][_0xf8d0('0x2f')]);_0x22c3a8[_0xf8d0('0x34')]=_[_0xf8d0('0x33')](_0x45d714[_0xf8d0('0x34')]);_0x22c3a8[_0xf8d0('0x3d')]=_[_0xf8d0('0x35')](_0x22c3a8[_0xf8d0('0x32')],_0x22c3a8[_0xf8d0('0x34')]);_0x3d05d6['attributes']=_[_0xf8d0('0x35')](_0x22c3a8[_0xf8d0('0x32')],qs[_0xf8d0('0x37')](_0x45d714[_0xf8d0('0x34')][_0xf8d0('0x37')]));_0x3d05d6['attributes']=_0x3d05d6['attributes'][_0xf8d0('0x48')]?_0x3d05d6[_0xf8d0('0x36')]:_0x22c3a8[_0xf8d0('0x32')];_0x3d05d6['order']=qs[_0xf8d0('0x3b')](_0x45d714[_0xf8d0('0x34')][_0xf8d0('0x3b')]);_0x3d05d6[_0xf8d0('0x3c')]=qs[_0xf8d0('0x3d')](_[_0xf8d0('0x4f')](_0x45d714['query'],_0x22c3a8[_0xf8d0('0x3d')]));if(_0x45d714[_0xf8d0('0x34')]['filter']){_0x3d05d6[_0xf8d0('0x3c')]=_[_0xf8d0('0x3e')](_0x3d05d6['where'],{'$or':_['map'](_0x3d05d6['attributes'],function(_0x2525ca){var _0x3c226f={};_0x3c226f[_0x2525ca]={'$like':'%'+_0x45d714[_0xf8d0('0x34')][_0xf8d0('0x3f')]+'%'};return _0x3c226f;})});}_0x3d05d6=_[_0xf8d0('0x3e')]({},_0x3d05d6,_0x45d714[_0xf8d0('0x40')]);return _0x57a3c1['getSubjects'](_0x3d05d6);}})[_0xf8d0('0x27')](function(_0x396243){if(_0x396243){_0x299396=_0x396243[_0xf8d0('0x48')];if(!_0x45d714[_0xf8d0('0x34')][_0xf8d0('0x38')](_0xf8d0('0x39'))){_0x3d05d6[_0xf8d0('0x1f')]=qs[_0xf8d0('0x1f')](_0x45d714[_0xf8d0('0x34')][_0xf8d0('0x1f')]);_0x3d05d6[_0xf8d0('0x21')]=qs['offset'](_0x45d714['query'][_0xf8d0('0x21')]);}return _0x57a3c1[_0xf8d0('0x51')](_0x3d05d6);}})[_0xf8d0('0x27')](function(_0x3edd8c){if(_0x3edd8c){return _0x3edd8c?{'count':_0x299396,'rows':_0x3edd8c}:null;}})['then'](respondWithResult(_0x1cf04a,null))[_0xf8d0('0x45')](handleError(_0x1cf04a,null));};exports[_0xf8d0('0x52')]=function(_0x5b94d0,_0x52bcb3,_0x361a9a){var _0x47e608={};var _0x11211b={};var _0xc0a5ac;var _0x3436ee;return db['Dynamics365Configuration'][_0xf8d0('0x4d')]({'where':{'id':_0x5b94d0['params']['id']}})[_0xf8d0('0x27')](handleEntityNotFound(_0x52bcb3,null))[_0xf8d0('0x27')](function(_0x3156ef){if(_0x3156ef){_0xc0a5ac=_0x3156ef;_0x11211b[_0xf8d0('0x32')]=_[_0xf8d0('0x33')](db['Dynamics365Field']['rawAttributes']);_0x11211b[_0xf8d0('0x34')]=_[_0xf8d0('0x33')](_0x5b94d0[_0xf8d0('0x34')]);_0x11211b['filters']=_[_0xf8d0('0x35')](_0x11211b['model'],_0x11211b[_0xf8d0('0x34')]);_0x47e608[_0xf8d0('0x36')]=_[_0xf8d0('0x35')](_0x11211b[_0xf8d0('0x32')],qs[_0xf8d0('0x37')](_0x5b94d0[_0xf8d0('0x34')]['fields']));_0x47e608[_0xf8d0('0x36')]=_0x47e608[_0xf8d0('0x36')]['length']?_0x47e608['attributes']:_0x11211b[_0xf8d0('0x32')];_0x47e608[_0xf8d0('0x3a')]=qs[_0xf8d0('0x3b')](_0x5b94d0[_0xf8d0('0x34')][_0xf8d0('0x3b')]);_0x47e608[_0xf8d0('0x3c')]=qs[_0xf8d0('0x3d')](_[_0xf8d0('0x4f')](_0x5b94d0[_0xf8d0('0x34')],_0x11211b[_0xf8d0('0x3d')]));if(_0x5b94d0[_0xf8d0('0x34')]['filter']){_0x47e608[_0xf8d0('0x3c')]=_[_0xf8d0('0x3e')](_0x47e608[_0xf8d0('0x3c')],{'$or':_[_0xf8d0('0x2e')](_0x47e608[_0xf8d0('0x36')],function(_0x210fd3){var _0x447c97={};_0x447c97[_0x210fd3]={'$like':'%'+_0x5b94d0['query'][_0xf8d0('0x3f')]+'%'};return _0x447c97;})});}_0x47e608=_[_0xf8d0('0x3e')]({},_0x47e608,_0x5b94d0[_0xf8d0('0x40')]);return _0xc0a5ac['getDescriptions'](_0x47e608);}})['then'](function(_0x4c990f){if(_0x4c990f){_0x3436ee=_0x4c990f[_0xf8d0('0x48')];if(!_0x5b94d0['query']['hasOwnProperty'](_0xf8d0('0x39'))){_0x47e608[_0xf8d0('0x1f')]=qs[_0xf8d0('0x1f')](_0x5b94d0[_0xf8d0('0x34')]['limit']);_0x47e608[_0xf8d0('0x21')]=qs[_0xf8d0('0x21')](_0x5b94d0[_0xf8d0('0x34')][_0xf8d0('0x21')]);}return _0xc0a5ac[_0xf8d0('0x52')](_0x47e608);}})[_0xf8d0('0x27')](function(_0x37c7e5){if(_0x37c7e5){return _0x37c7e5?{'count':_0x3436ee,'rows':_0x37c7e5}:null;}})[_0xf8d0('0x27')](respondWithResult(_0x52bcb3,null))[_0xf8d0('0x45')](handleError(_0x52bcb3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index aa4ef6b..fc562c3 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 _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x37b112,_0x3548bb){_0x37b112=_0x37b112-0x0;var _0x59f332=_0x6f0d[_0x37b112];return _0x59f332;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('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(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0x3e74,0x175));var _0x43e7=function(_0x472f64,_0x4a29d){_0x472f64=_0x472f64-0x0;var _0x37168c=_0x3e74[_0x472f64];return _0x37168c;};'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 0735df9..4ef51b9 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 _0x38c4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x119d0f,_0xd33b7b){var _0x5f9b8f=function(_0x12ed96){while(--_0x12ed96){_0x119d0f['push'](_0x119d0f['shift']());}};_0x5f9b8f(++_0xd33b7b);}(_0x38c4,0x199));var _0x438c=function(_0x51586a,_0x181782){_0x51586a=_0x51586a-0x0;var _0x50f172=_0x38c4[_0x51586a];return _0x50f172;};'use strict';var _=require(_0x438c('0x0'));var util=require(_0x438c('0x1'));var moment=require(_0x438c('0x2'));var BPromise=require('bluebird');var rs=require(_0x438c('0x3'));var fs=require('fs');var Redis=require(_0x438c('0x4'));var db=require(_0x438c('0x5'))['db'];var utils=require(_0x438c('0x6'));var logger=require(_0x438c('0x7'))(_0x438c('0x8'));var config=require(_0x438c('0x9'));var jayson=require(_0x438c('0xa'));var client=jayson[_0x438c('0xb')][_0x438c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x523622,_0x19a461,_0x54ddab){return new BPromise(function(_0x4e7aeb,_0x5d3c1e){return client[_0x438c('0xd')](_0x523622,_0x54ddab)[_0x438c('0xe')](function(_0x30ac6e){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x19a461,_0x438c('0xf'));logger[_0x438c('0x10')](_0x438c('0x11'),_0x19a461,_0x438c('0xf'),JSON[_0x438c('0x12')](_0x30ac6e));if(_0x30ac6e[_0x438c('0x13')]){if(_0x30ac6e['error'][_0x438c('0x14')]===0x1f4){logger['error'](_0x438c('0x15'),_0x19a461,_0x30ac6e[_0x438c('0x13')][_0x438c('0x16')]);return _0x5d3c1e(_0x30ac6e['error'][_0x438c('0x16')]);}logger[_0x438c('0x13')](_0x438c('0x15'),_0x19a461,_0x30ac6e[_0x438c('0x13')][_0x438c('0x16')]);return _0x4e7aeb(_0x30ac6e[_0x438c('0x13')][_0x438c('0x16')]);}else{logger[_0x438c('0x17')](_0x438c('0x15'),_0x19a461,_0x438c('0xf'));_0x4e7aeb(_0x30ac6e[_0x438c('0x18')][_0x438c('0x16')]);}})[_0x438c('0x19')](function(_0x310781){logger[_0x438c('0x13')](_0x438c('0x15'),_0x19a461,_0x310781);_0x5d3c1e(_0x310781);});});} \ No newline at end of file +var _0x4e28=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','http','request','info','request\x20sent','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch'];(function(_0x21aafd,_0x1f0fa6){var _0x9f2800=function(_0xf23734){while(--_0xf23734){_0x21aafd['push'](_0x21aafd['shift']());}};_0x9f2800(++_0x1f0fa6);}(_0x4e28,0x1ed));var _0x84e2=function(_0x16a5c9,_0x43e7eb){_0x16a5c9=_0x16a5c9-0x0;var _0x3a1ed6=_0x4e28[_0x16a5c9];return _0x3a1ed6;};'use strict';var _=require(_0x84e2('0x0'));var util=require(_0x84e2('0x1'));var moment=require(_0x84e2('0x2'));var BPromise=require(_0x84e2('0x3'));var rs=require(_0x84e2('0x4'));var fs=require('fs');var Redis=require(_0x84e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84e2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x84e2('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x84e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16cec4,_0x115efc,_0x49f92a){return new BPromise(function(_0x5275a9,_0x26dc4c){return client[_0x84e2('0x9')](_0x16cec4,_0x49f92a)['then'](function(_0x586f9){logger[_0x84e2('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x115efc,_0x84e2('0xb'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x115efc,_0x84e2('0xb'),JSON['stringify'](_0x586f9));if(_0x586f9[_0x84e2('0xc')]){if(_0x586f9['error']['code']===0x1f4){logger[_0x84e2('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x115efc,_0x586f9[_0x84e2('0xc')][_0x84e2('0xd')]);return _0x26dc4c(_0x586f9['error']['message']);}logger['error'](_0x84e2('0xe'),_0x115efc,_0x586f9['error'][_0x84e2('0xd')]);return _0x5275a9(_0x586f9[_0x84e2('0xc')][_0x84e2('0xd')]);}else{logger[_0x84e2('0xa')](_0x84e2('0xe'),_0x115efc,_0x84e2('0xb'));_0x5275a9(_0x586f9[_0x84e2('0xf')][_0x84e2('0xd')]);}})[_0x84e2('0x10')](function(_0x3ac883){logger[_0x84e2('0xc')](_0x84e2('0xe'),_0x115efc,_0x3ac883);_0x26dc4c(_0x3ac883);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8403ced..98d04d1 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 _0x5c95=['index','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x547976,_0x3e5459){var _0x54cf9e=function(_0x1aedd3){while(--_0x1aedd3){_0x547976['push'](_0x547976['shift']());}};_0x54cf9e(++_0x3e5459);}(_0x5c95,0x187));var _0x55c9=function(_0x318606,_0x26823b){_0x318606=_0x318606-0x0;var _0x5f47fd=_0x5c95[_0x318606];return _0x5f47fd;};'use strict';var multer=require(_0x55c9('0x0'));var util=require(_0x55c9('0x1'));var path=require(_0x55c9('0x2'));var timeout=require(_0x55c9('0x3'));var express=require('express');var router=express[_0x55c9('0x4')]();var fs_extra=require(_0x55c9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x55c9('0x6'));var config=require(_0x55c9('0x7'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x55c9('0x8')](),controller[_0x55c9('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x55c9('0xa')]('/',auth[_0x55c9('0x8')](),controller['create']);router[_0x55c9('0xb')](_0x55c9('0xc'),auth[_0x55c9('0x8')](),controller[_0x55c9('0xd')]);router['delete']('/:id',auth[_0x55c9('0x8')](),controller[_0x55c9('0xe')]);module[_0x55c9('0xf')]=router; \ No newline at end of file +var _0x764c=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x406fbb,_0x1093e5){var _0x8e921d=function(_0x410517){while(--_0x410517){_0x406fbb['push'](_0x406fbb['shift']());}};_0x8e921d(++_0x1093e5);}(_0x764c,0x143));var _0xc764=function(_0x3aa903,_0x4261c2){_0x3aa903=_0x3aa903-0x0;var _0x43dcb0=_0x764c[_0x3aa903];return _0x43dcb0;};'use strict';var multer=require(_0xc764('0x0'));var util=require(_0xc764('0x1'));var path=require(_0xc764('0x2'));var timeout=require(_0xc764('0x3'));var express=require('express');var router=express[_0xc764('0x4')]();var fs_extra=require(_0xc764('0x5'));var auth=require(_0xc764('0x6'));var interaction=require(_0xc764('0x7'));var config=require(_0xc764('0x8'));var controller=require(_0xc764('0x9'));router[_0xc764('0xa')]('/',auth[_0xc764('0xb')](),controller['index']);router['get'](_0xc764('0xc'),auth[_0xc764('0xb')](),controller[_0xc764('0xd')]);router[_0xc764('0xe')]('/',auth[_0xc764('0xb')](),controller[_0xc764('0xf')]);router[_0xc764('0x10')](_0xc764('0xc'),auth[_0xc764('0xb')](),controller[_0xc764('0x11')]);router[_0xc764('0x12')]('/:id',auth[_0xc764('0xb')](),controller['destroy']);module[_0xc764('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index c4763cd..b9f832c 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 _0xead2=['string','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2c0efb,_0x5dd1d7){var _0x3c93b9=function(_0x41d023){while(--_0x41d023){_0x2c0efb['push'](_0x2c0efb['shift']());}};_0x3c93b9(++_0x5dd1d7);}(_0xead2,0xc7));var _0x2ead=function(_0x3fd41,_0x2bffd1){_0x3fd41=_0x3fd41-0x0;var _0x1d27b0=_0xead2[_0x3fd41];return _0x1d27b0;};'use strict';var Sequelize=require(_0x2ead('0x0'));module[_0x2ead('0x1')]={'type':{'type':Sequelize[_0x2ead('0x2')]('string',_0x2ead('0x3'),_0x2ead('0x4'),_0x2ead('0x5'),_0x2ead('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2ead('0x7')]},'key':{'type':Sequelize[_0x2ead('0x7')]},'keyType':{'type':Sequelize[_0x2ead('0x2')](_0x2ead('0x8'),_0x2ead('0x3'),_0x2ead('0x4'))},'keyContent':{'type':Sequelize[_0x2ead('0x7')]},'idField':{'type':Sequelize[_0x2ead('0x7')]},'nameField':{'type':Sequelize[_0x2ead('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9eeb=['customVariable','picklist','STRING','BOOLEAN','sequelize','string','variable'];(function(_0x5a2bc0,_0x23152a){var _0x2c29db=function(_0x2b6893){while(--_0x2b6893){_0x5a2bc0['push'](_0x5a2bc0['shift']());}};_0x2c29db(++_0x23152a);}(_0x9eeb,0x6d));var _0xb9ee=function(_0x38911d,_0x75f88c){_0x38911d=_0x38911d-0x0;var _0x43c233=_0x9eeb[_0x38911d];return _0x43c233;};'use strict';var Sequelize=require(_0xb9ee('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb9ee('0x1'),_0xb9ee('0x2'),_0xb9ee('0x3'),'keyValue',_0xb9ee('0x4')),'defaultValue':_0xb9ee('0x1')},'content':{'type':Sequelize[_0xb9ee('0x5')]},'key':{'type':Sequelize[_0xb9ee('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb9ee('0x1'),_0xb9ee('0x2'),_0xb9ee('0x3'))},'keyContent':{'type':Sequelize[_0xb9ee('0x5')]},'idField':{'type':Sequelize[_0xb9ee('0x5')]},'nameField':{'type':Sequelize[_0xb9ee('0x5')]},'customField':{'type':Sequelize[_0xb9ee('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7f47fdc..1963361 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 _0xc9fa=['sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','limit','undefined','count','offset','save','update','destroy','then','sendStatus','error','stack','name','index','Dynamics365Field','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path'];(function(_0x11d073,_0x1a6d85){var _0x1ef950=function(_0x3ef798){while(--_0x3ef798){_0x11d073['push'](_0x11d073['shift']());}};_0x1ef950(++_0x1a6d85);}(_0xc9fa,0x84));var _0xac9f=function(_0xdbccf0,_0x3dba4d){_0xdbccf0=_0xdbccf0-0x0;var _0x162a01=_0xc9fa[_0xdbccf0];return _0x162a01;};'use strict';var emlformat=require(_0xac9f('0x0'));var rimraf=require(_0xac9f('0x1'));var zipdir=require(_0xac9f('0x2'));var jsonpatch=require(_0xac9f('0x3'));var rp=require('request-promise');var moment=require(_0xac9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac9f('0x5'));var util=require(_0xac9f('0x6'));var path=require(_0xac9f('0x7'));var sox=require(_0xac9f('0x8'));var csv=require(_0xac9f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac9f('0xa'));var _=require(_0xac9f('0xb'));var squel=require(_0xac9f('0xc'));var crypto=require('crypto');var jsforce=require(_0xac9f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xac9f('0xe'));var Papa=require('papaparse');var Redis=require(_0xac9f('0xf'));var authService=require(_0xac9f('0x10'));var qs=require(_0xac9f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac9f('0x12'));var logger=require(_0xac9f('0x13'))(_0xac9f('0x14'));var utils=require(_0xac9f('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xac9f('0x16'))['db'];function respondWithStatusCode(_0x16ca8e,_0x588b6f){_0x588b6f=_0x588b6f||0xcc;return function(_0x4522a4){if(_0x4522a4){return _0x16ca8e['sendStatus'](_0x588b6f);}return _0x16ca8e['status'](_0x588b6f)[_0xac9f('0x17')]();};}function respondWithResult(_0x1e8347,_0x5d8657){_0x5d8657=_0x5d8657||0xc8;return function(_0x370a34){if(_0x370a34){return _0x1e8347[_0xac9f('0x18')](_0x5d8657)[_0xac9f('0x19')](_0x370a34);}};}function respondWithFilteredResult(_0x1bf23d,_0x274ef1){return function(_0xd7a462){if(_0xd7a462){var _0x181832=typeof _0x274ef1['offset']==='undefined'&&typeof _0x274ef1[_0xac9f('0x1a')]===_0xac9f('0x1b');var _0x504818=_0xd7a462[_0xac9f('0x1c')];var _0x7d35a0=_0x181832?0x0:_0x274ef1[_0xac9f('0x1d')];var _0x37d7d0=_0x181832?_0xd7a462[_0xac9f('0x1c')]:_0x274ef1[_0xac9f('0x1d')]+_0x274ef1[_0xac9f('0x1a')];var _0x325fba;if(_0x37d7d0>=_0x504818){_0x37d7d0=_0x504818;_0x325fba=0xc8;}else{_0x325fba=0xce;}_0x1bf23d[_0xac9f('0x18')](_0x325fba);return _0x1bf23d['set']('Content-Range',_0x7d35a0+'-'+_0x37d7d0+'/'+_0x504818)[_0xac9f('0x19')](_0xd7a462);}return null;};}function patchUpdates(_0x3af8f0){return function(_0x4d6a32){try{jsonpatch['apply'](_0x4d6a32,_0x3af8f0,!![]);}catch(_0x2e3963){return BPromise['reject'](_0x2e3963);}return _0x4d6a32[_0xac9f('0x1e')]();};}function saveUpdates(_0x837cac,_0x10b73e){return function(_0xff1597){if(_0xff1597){return _0xff1597[_0xac9f('0x1f')](_0x837cac)['then'](function(_0x5d0da6){return _0x5d0da6;});}return null;};}function removeEntity(_0x235ac6,_0x19abd2){return function(_0x5126f7){if(_0x5126f7){return _0x5126f7[_0xac9f('0x20')]()[_0xac9f('0x21')](function(){_0x235ac6[_0xac9f('0x18')](0xcc)[_0xac9f('0x17')]();});}};}function handleEntityNotFound(_0x5ae0fb,_0x318392){return function(_0x2abb30){if(!_0x2abb30){_0x5ae0fb[_0xac9f('0x22')](0x194);}return _0x2abb30;};}function handleError(_0xf21309,_0x472d51){_0x472d51=_0x472d51||0x1f4;return function(_0x22340f){logger[_0xac9f('0x23')](_0x22340f[_0xac9f('0x24')]);if(_0x22340f[_0xac9f('0x25')]){delete _0x22340f[_0xac9f('0x25')];}_0xf21309[_0xac9f('0x18')](_0x472d51)['send'](_0x22340f);};}exports[_0xac9f('0x26')]=function(_0x13419f,_0x178288){var _0x7f7803={},_0x407699={},_0x1f652d={'count':0x0,'rows':[]};var _0x438e51=_['map'](db[_0xac9f('0x27')][_0xac9f('0x28')],function(_0x7d6043){return{'name':_0x7d6043[_0xac9f('0x29')],'type':_0x7d6043[_0xac9f('0x2a')]['key']};});_0x407699[_0xac9f('0x2b')]=_['map'](_0x438e51,_0xac9f('0x25'));_0x407699[_0xac9f('0x2c')]=_['keys'](_0x13419f[_0xac9f('0x2c')]);_0x407699[_0xac9f('0x2d')]=_[_0xac9f('0x2e')](_0x407699[_0xac9f('0x2b')],_0x407699['query']);_0x7f7803[_0xac9f('0x2f')]=_[_0xac9f('0x2e')](_0x407699[_0xac9f('0x2b')],qs[_0xac9f('0x30')](_0x13419f['query'][_0xac9f('0x30')]));_0x7f7803[_0xac9f('0x2f')]=_0x7f7803[_0xac9f('0x2f')][_0xac9f('0x31')]?_0x7f7803[_0xac9f('0x2f')]:_0x407699[_0xac9f('0x2b')];if(!_0x13419f[_0xac9f('0x2c')][_0xac9f('0x32')](_0xac9f('0x33'))){_0x7f7803[_0xac9f('0x1a')]=qs[_0xac9f('0x1a')](_0x13419f[_0xac9f('0x2c')][_0xac9f('0x1a')]);_0x7f7803[_0xac9f('0x1d')]=qs['offset'](_0x13419f[_0xac9f('0x2c')][_0xac9f('0x1d')]);}_0x7f7803[_0xac9f('0x34')]=qs['sort'](_0x13419f['query']['sort']);_0x7f7803[_0xac9f('0x35')]=qs[_0xac9f('0x2d')](_[_0xac9f('0x36')](_0x13419f[_0xac9f('0x2c')],_0x407699[_0xac9f('0x2d')]),_0x438e51);if(_0x13419f[_0xac9f('0x2c')][_0xac9f('0x37')]){_0x7f7803[_0xac9f('0x35')]=_['merge'](_0x7f7803[_0xac9f('0x35')],{'$or':_[_0xac9f('0x38')](_0x438e51,function(_0x5877f3){if(_0x5877f3[_0xac9f('0x2a')]!==_0xac9f('0x39')){var _0x29c2be={};_0x29c2be[_0x5877f3[_0xac9f('0x25')]]={'$like':'%'+_0x13419f[_0xac9f('0x2c')]['filter']+'%'};return _0x29c2be;}})});}_0x7f7803=_[_0xac9f('0x3a')]({},_0x7f7803,_0x13419f[_0xac9f('0x3b')]);var _0x40de25={'where':_0x7f7803['where']};return db['Dynamics365Field']['count'](_0x40de25)[_0xac9f('0x21')](function(_0x10c1ad){_0x1f652d[_0xac9f('0x1c')]=_0x10c1ad;if(_0x13419f[_0xac9f('0x2c')]['includeAll']){_0x7f7803['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xac9f('0x3c')](_0x7f7803);})[_0xac9f('0x21')](function(_0xef0bd5){_0x1f652d[_0xac9f('0x3d')]=_0xef0bd5;return _0x1f652d;})[_0xac9f('0x21')](respondWithFilteredResult(_0x178288,_0x7f7803))[_0xac9f('0x3e')](handleError(_0x178288,null));};exports[_0xac9f('0x3f')]=function(_0x1c1fb5,_0x356258){var _0x5dbb98={'raw':!![],'where':{'id':_0x1c1fb5[_0xac9f('0x40')]['id']}},_0xdb065d={};_0xdb065d['model']=_[_0xac9f('0x41')](db['Dynamics365Field'][_0xac9f('0x28')]);_0xdb065d[_0xac9f('0x2c')]=_['keys'](_0x1c1fb5[_0xac9f('0x2c')]);_0xdb065d[_0xac9f('0x2d')]=_[_0xac9f('0x2e')](_0xdb065d['model'],_0xdb065d['query']);_0x5dbb98[_0xac9f('0x2f')]=_[_0xac9f('0x2e')](_0xdb065d[_0xac9f('0x2b')],qs[_0xac9f('0x30')](_0x1c1fb5[_0xac9f('0x2c')][_0xac9f('0x30')]));_0x5dbb98['attributes']=_0x5dbb98[_0xac9f('0x2f')][_0xac9f('0x31')]?_0x5dbb98['attributes']:_0xdb065d[_0xac9f('0x2b')];if(_0x1c1fb5[_0xac9f('0x2c')][_0xac9f('0x42')]){_0x5dbb98['include']=[{'all':!![]}];}_0x5dbb98=_['merge']({},_0x5dbb98,_0x1c1fb5['options']);return db[_0xac9f('0x27')][_0xac9f('0x43')](_0x5dbb98)[_0xac9f('0x21')](handleEntityNotFound(_0x356258,null))['then'](respondWithResult(_0x356258,null))[_0xac9f('0x3e')](handleError(_0x356258,null));};exports['create']=function(_0x312e40,_0x287fa0){return db[_0xac9f('0x27')][_0xac9f('0x44')](_0x312e40['body'],{})[_0xac9f('0x21')](respondWithResult(_0x287fa0,0xc9))[_0xac9f('0x3e')](handleError(_0x287fa0,null));};exports[_0xac9f('0x1f')]=function(_0x26f5f8,_0x1a0d81){if(_0x26f5f8[_0xac9f('0x45')]['id']){delete _0x26f5f8[_0xac9f('0x45')]['id'];}return db['Dynamics365Field'][_0xac9f('0x43')]({'where':{'id':_0x26f5f8[_0xac9f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a0d81,null))[_0xac9f('0x21')](saveUpdates(_0x26f5f8[_0xac9f('0x45')],null))['then'](respondWithResult(_0x1a0d81,null))['catch'](handleError(_0x1a0d81,null));};exports['destroy']=function(_0x5a5c36,_0x3c718f){return db[_0xac9f('0x27')]['find']({'where':{'id':_0x5a5c36[_0xac9f('0x40')]['id']}})[_0xac9f('0x21')](handleEntityNotFound(_0x3c718f,null))[_0xac9f('0x21')](removeEntity(_0x3c718f,null))['catch'](handleError(_0x3c718f,null));}; \ No newline at end of file +var _0xe846=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','end','error','stack','name','send','index','Dynamics365Field','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe846,0x170));var _0x6e84=function(_0x328a34,_0x38ac22){_0x328a34=_0x328a34-0x0;var _0x574c0b=_0xe846[_0x328a34];return _0x574c0b;};'use strict';var emlformat=require(_0x6e84('0x0'));var rimraf=require(_0x6e84('0x1'));var zipdir=require(_0x6e84('0x2'));var jsonpatch=require(_0x6e84('0x3'));var rp=require(_0x6e84('0x4'));var moment=require(_0x6e84('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6e84('0x6'));var csv=require('to-csv');var ejs=require(_0x6e84('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e84('0x8'));var crypto=require(_0x6e84('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6e84('0xa'));var Papa=require('papaparse');var Redis=require(_0x6e84('0xb'));var authService=require(_0x6e84('0xc'));var qs=require(_0x6e84('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e84('0xe'));var logger=require('../../config/logger')(_0x6e84('0xf'));var utils=require(_0x6e84('0x10'));var config=require(_0x6e84('0x11'));var licenseUtil=require(_0x6e84('0x12'));var db=require(_0x6e84('0x13'))['db'];function respondWithStatusCode(_0xaa8563,_0x44c261){_0x44c261=_0x44c261||0xcc;return function(_0x4e01b5){if(_0x4e01b5){return _0xaa8563[_0x6e84('0x14')](_0x44c261);}return _0xaa8563[_0x6e84('0x15')](_0x44c261)['end']();};}function respondWithResult(_0x52c23c,_0x552eb8){_0x552eb8=_0x552eb8||0xc8;return function(_0x42ac00){if(_0x42ac00){return _0x52c23c[_0x6e84('0x15')](_0x552eb8)[_0x6e84('0x16')](_0x42ac00);}};}function respondWithFilteredResult(_0x83134e,_0x3dc889){return function(_0x708703){if(_0x708703){var _0x22afc9=typeof _0x3dc889[_0x6e84('0x17')]===_0x6e84('0x18')&&typeof _0x3dc889[_0x6e84('0x19')]===_0x6e84('0x18');var _0x25335a=_0x708703[_0x6e84('0x1a')];var _0x129067=_0x22afc9?0x0:_0x3dc889[_0x6e84('0x17')];var _0x140c21=_0x22afc9?_0x708703[_0x6e84('0x1a')]:_0x3dc889[_0x6e84('0x17')]+_0x3dc889[_0x6e84('0x19')];var _0x5affc5;if(_0x140c21>=_0x25335a){_0x140c21=_0x25335a;_0x5affc5=0xc8;}else{_0x5affc5=0xce;}_0x83134e['status'](_0x5affc5);return _0x83134e['set']('Content-Range',_0x129067+'-'+_0x140c21+'/'+_0x25335a)[_0x6e84('0x16')](_0x708703);}return null;};}function patchUpdates(_0x1bab8c){return function(_0x7d1ed8){try{jsonpatch[_0x6e84('0x1b')](_0x7d1ed8,_0x1bab8c,!![]);}catch(_0x4a405b){return BPromise[_0x6e84('0x1c')](_0x4a405b);}return _0x7d1ed8[_0x6e84('0x1d')]();};}function saveUpdates(_0x4b1871,_0x575c1e){return function(_0x5b1a86){if(_0x5b1a86){return _0x5b1a86['update'](_0x4b1871)[_0x6e84('0x1e')](function(_0x49e010){return _0x49e010;});}return null;};}function removeEntity(_0x50d7de,_0x564f2f){return function(_0x46e863){if(_0x46e863){return _0x46e863['destroy']()['then'](function(){_0x50d7de['status'](0xcc)[_0x6e84('0x1f')]();});}};}function handleEntityNotFound(_0x503ab4,_0x5470be){return function(_0x380d0d){if(!_0x380d0d){_0x503ab4[_0x6e84('0x14')](0x194);}return _0x380d0d;};}function handleError(_0xa58f33,_0x29653f){_0x29653f=_0x29653f||0x1f4;return function(_0x42fe52){logger[_0x6e84('0x20')](_0x42fe52[_0x6e84('0x21')]);if(_0x42fe52[_0x6e84('0x22')]){delete _0x42fe52[_0x6e84('0x22')];}_0xa58f33[_0x6e84('0x15')](_0x29653f)[_0x6e84('0x23')](_0x42fe52);};}exports[_0x6e84('0x24')]=function(_0x2e642a,_0xa2a0db){var _0x1f8675={},_0x588907={},_0x15c966={'count':0x0,'rows':[]};var _0x39116f=_['map'](db[_0x6e84('0x25')]['rawAttributes'],function(_0x51a26f){return{'name':_0x51a26f[_0x6e84('0x26')],'type':_0x51a26f[_0x6e84('0x27')]['key']};});_0x588907[_0x6e84('0x28')]=_['map'](_0x39116f,'name');_0x588907[_0x6e84('0x29')]=_[_0x6e84('0x2a')](_0x2e642a['query']);_0x588907[_0x6e84('0x2b')]=_['intersection'](_0x588907['model'],_0x588907['query']);_0x1f8675[_0x6e84('0x2c')]=_[_0x6e84('0x2d')](_0x588907['model'],qs['fields'](_0x2e642a['query'][_0x6e84('0x2e')]));_0x1f8675[_0x6e84('0x2c')]=_0x1f8675[_0x6e84('0x2c')][_0x6e84('0x2f')]?_0x1f8675[_0x6e84('0x2c')]:_0x588907['model'];if(!_0x2e642a['query'][_0x6e84('0x30')]('nolimit')){_0x1f8675['limit']=qs[_0x6e84('0x19')](_0x2e642a[_0x6e84('0x29')][_0x6e84('0x19')]);_0x1f8675[_0x6e84('0x17')]=qs[_0x6e84('0x17')](_0x2e642a[_0x6e84('0x29')][_0x6e84('0x17')]);}_0x1f8675[_0x6e84('0x31')]=qs['sort'](_0x2e642a[_0x6e84('0x29')][_0x6e84('0x32')]);_0x1f8675[_0x6e84('0x33')]=qs[_0x6e84('0x2b')](_[_0x6e84('0x34')](_0x2e642a['query'],_0x588907[_0x6e84('0x2b')]),_0x39116f);if(_0x2e642a[_0x6e84('0x29')][_0x6e84('0x35')]){_0x1f8675[_0x6e84('0x33')]=_[_0x6e84('0x36')](_0x1f8675[_0x6e84('0x33')],{'$or':_[_0x6e84('0x37')](_0x39116f,function(_0x4edd4a){if(_0x4edd4a[_0x6e84('0x27')]!==_0x6e84('0x38')){var _0x4ba6a3={};_0x4ba6a3[_0x4edd4a[_0x6e84('0x22')]]={'$like':'%'+_0x2e642a[_0x6e84('0x29')][_0x6e84('0x35')]+'%'};return _0x4ba6a3;}})});}_0x1f8675=_['merge']({},_0x1f8675,_0x2e642a[_0x6e84('0x39')]);var _0x506a9d={'where':_0x1f8675[_0x6e84('0x33')]};return db[_0x6e84('0x25')]['count'](_0x506a9d)[_0x6e84('0x1e')](function(_0x15f93d){_0x15c966[_0x6e84('0x1a')]=_0x15f93d;if(_0x2e642a['query']['includeAll']){_0x1f8675[_0x6e84('0x3a')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x1f8675);})[_0x6e84('0x1e')](function(_0x2056b2){_0x15c966[_0x6e84('0x3b')]=_0x2056b2;return _0x15c966;})['then'](respondWithFilteredResult(_0xa2a0db,_0x1f8675))[_0x6e84('0x3c')](handleError(_0xa2a0db,null));};exports[_0x6e84('0x3d')]=function(_0xc5fd8,_0x1703db){var _0x3f9849={'raw':!![],'where':{'id':_0xc5fd8[_0x6e84('0x3e')]['id']}},_0x180f52={};_0x180f52[_0x6e84('0x28')]=_[_0x6e84('0x2a')](db['Dynamics365Field'][_0x6e84('0x3f')]);_0x180f52[_0x6e84('0x29')]=_['keys'](_0xc5fd8[_0x6e84('0x29')]);_0x180f52['filters']=_['intersection'](_0x180f52['model'],_0x180f52[_0x6e84('0x29')]);_0x3f9849['attributes']=_[_0x6e84('0x2d')](_0x180f52[_0x6e84('0x28')],qs['fields'](_0xc5fd8['query'][_0x6e84('0x2e')]));_0x3f9849[_0x6e84('0x2c')]=_0x3f9849[_0x6e84('0x2c')][_0x6e84('0x2f')]?_0x3f9849['attributes']:_0x180f52[_0x6e84('0x28')];if(_0xc5fd8[_0x6e84('0x29')]['includeAll']){_0x3f9849[_0x6e84('0x3a')]=[{'all':!![]}];}_0x3f9849=_[_0x6e84('0x36')]({},_0x3f9849,_0xc5fd8['options']);return db[_0x6e84('0x25')][_0x6e84('0x40')](_0x3f9849)[_0x6e84('0x1e')](handleEntityNotFound(_0x1703db,null))['then'](respondWithResult(_0x1703db,null))[_0x6e84('0x3c')](handleError(_0x1703db,null));};exports[_0x6e84('0x41')]=function(_0x2ed844,_0x31ba70){return db['Dynamics365Field'][_0x6e84('0x41')](_0x2ed844['body'],{})[_0x6e84('0x1e')](respondWithResult(_0x31ba70,0xc9))[_0x6e84('0x3c')](handleError(_0x31ba70,null));};exports['update']=function(_0x47381f,_0x147463){if(_0x47381f[_0x6e84('0x42')]['id']){delete _0x47381f['body']['id'];}return db[_0x6e84('0x25')][_0x6e84('0x40')]({'where':{'id':_0x47381f[_0x6e84('0x3e')]['id']}})[_0x6e84('0x1e')](handleEntityNotFound(_0x147463,null))['then'](saveUpdates(_0x47381f[_0x6e84('0x42')],null))[_0x6e84('0x1e')](respondWithResult(_0x147463,null))['catch'](handleError(_0x147463,null));};exports[_0x6e84('0x43')]=function(_0x1bca60,_0x27377b){return db['Dynamics365Field']['find']({'where':{'id':_0x1bca60['params']['id']}})[_0x6e84('0x1e')](handleEntityNotFound(_0x27377b,null))[_0x6e84('0x1e')](removeEntity(_0x27377b,null))[_0x6e84('0x3c')](handleError(_0x27377b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1155fa1..970938d 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 _0x619e=['idField','lodash','util','../../config/logger','moment','path','rimraf','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x585ba8,_0x4400b0){var _0x5c5f8f=function(_0x37247e){while(--_0x37247e){_0x585ba8['push'](_0x585ba8['shift']());}};_0x5c5f8f(++_0x4400b0);}(_0x619e,0x18d));var _0xe619=function(_0x2c976f,_0x4bd2c4){_0x2c976f=_0x2c976f-0x0;var _0x1a1227=_0x619e[_0x2c976f];return _0x1a1227;};'use strict';var _=require(_0xe619('0x0'));var util=require(_0xe619('0x1'));var logger=require(_0xe619('0x2'))('api');var moment=require(_0xe619('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe619('0x4'));var rimraf=require(_0xe619('0x5'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0xe619('0x6')]=function(_0x3a3a6d,_0x4f78a5){return _0x3a3a6d[_0xe619('0x7')](_0xe619('0x8'),attributes,{'tableName':_0xe619('0x9'),'paranoid':![],'indexes':[{'name':_0xe619('0xa'),'fields':[_0xe619('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba85=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','util','api','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xba85,0x18c));var _0x5ba8=function(_0x3f4039,_0x4d3d02){_0x3f4039=_0x3f4039-0x0;var _0x4b9cb4=_0xba85[_0x3f4039];return _0x4b9cb4;};'use strict';var _=require('lodash');var util=require(_0x5ba8('0x0'));var logger=require('../../config/logger')(_0x5ba8('0x1'));var moment=require(_0x5ba8('0x2'));var BPromise=require('bluebird');var rp=require(_0x5ba8('0x3'));var fs=require('fs');var path=require(_0x5ba8('0x4'));var rimraf=require('rimraf');var config=require(_0x5ba8('0x5'));var attributes=require(_0x5ba8('0x6'));module[_0x5ba8('0x7')]=function(_0xf07979,_0x597f1a){return _0xf07979[_0x5ba8('0x8')](_0x5ba8('0x9'),attributes,{'tableName':_0x5ba8('0xa'),'paranoid':![],'indexes':[{'name':_0x5ba8('0xb'),'fields':[_0x5ba8('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 020cac7..2d21558 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 _0xe3e8=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xe3e8,0xb9));var _0x8e3e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xe3e8[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x8e3e('0x0'));var util=require('util');var moment=require(_0x8e3e('0x1'));var BPromise=require(_0x8e3e('0x2'));var rs=require(_0x8e3e('0x3'));var fs=require('fs');var Redis=require(_0x8e3e('0x4'));var db=require(_0x8e3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e3e('0x6'));var config=require(_0x8e3e('0x7'));var jayson=require(_0x8e3e('0x8'));var client=jayson[_0x8e3e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1382f5,_0x58b2be,_0x19e328){return new BPromise(function(_0x68927b,_0x341534){return client[_0x8e3e('0xa')](_0x1382f5,_0x19e328)[_0x8e3e('0xb')](function(_0x32be61){logger['info'](_0x8e3e('0xc'),_0x58b2be,_0x8e3e('0xd'));logger['debug'](_0x8e3e('0xe'),_0x58b2be,'request\x20sent',JSON[_0x8e3e('0xf')](_0x32be61));if(_0x32be61['error']){if(_0x32be61[_0x8e3e('0x10')][_0x8e3e('0x11')]===0x1f4){logger[_0x8e3e('0x10')](_0x8e3e('0xc'),_0x58b2be,_0x32be61[_0x8e3e('0x10')][_0x8e3e('0x12')]);return _0x341534(_0x32be61['error'][_0x8e3e('0x12')]);}logger['error'](_0x8e3e('0xc'),_0x58b2be,_0x32be61[_0x8e3e('0x10')][_0x8e3e('0x12')]);return _0x68927b(_0x32be61['error'][_0x8e3e('0x12')]);}else{logger['info'](_0x8e3e('0xc'),_0x58b2be,'request\x20sent');_0x68927b(_0x32be61[_0x8e3e('0x13')][_0x8e3e('0x12')]);}})[_0x8e3e('0x14')](function(_0x536125){logger[_0x8e3e('0x10')](_0x8e3e('0xc'),_0x58b2be,_0x536125);_0x341534(_0x536125);});});} \ No newline at end of file +var _0x2186=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x468bf8,_0x60fddf){var _0xb54fb6=function(_0x10e2c3){while(--_0x10e2c3){_0x468bf8['push'](_0x468bf8['shift']());}};_0xb54fb6(++_0x60fddf);}(_0x2186,0x184));var _0x6218=function(_0x46e6fb,_0x3bc554){_0x46e6fb=_0x46e6fb-0x0;var _0x4c2a0b=_0x2186[_0x46e6fb];return _0x4c2a0b;};'use strict';var _=require('lodash');var util=require(_0x6218('0x0'));var moment=require(_0x6218('0x1'));var BPromise=require('bluebird');var rs=require(_0x6218('0x2'));var fs=require('fs');var Redis=require(_0x6218('0x3'));var db=require(_0x6218('0x4'))['db'];var utils=require(_0x6218('0x5'));var logger=require(_0x6218('0x6'))(_0x6218('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6218('0x8')][_0x6218('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ad411,_0xf11167,_0x1f9f07){return new BPromise(function(_0x3390c0,_0xb1e880){return client[_0x6218('0xa')](_0x1ad411,_0x1f9f07)[_0x6218('0xb')](function(_0x59de7e){logger[_0x6218('0xc')](_0x6218('0xd'),_0xf11167,'request\x20sent');logger[_0x6218('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xf11167,_0x6218('0xf'),JSON[_0x6218('0x10')](_0x59de7e));if(_0x59de7e[_0x6218('0x11')]){if(_0x59de7e[_0x6218('0x11')][_0x6218('0x12')]===0x1f4){logger[_0x6218('0x11')](_0x6218('0xd'),_0xf11167,_0x59de7e[_0x6218('0x11')]['message']);return _0xb1e880(_0x59de7e[_0x6218('0x11')]['message']);}logger[_0x6218('0x11')](_0x6218('0xd'),_0xf11167,_0x59de7e[_0x6218('0x11')]['message']);return _0x3390c0(_0x59de7e[_0x6218('0x11')][_0x6218('0x13')]);}else{logger[_0x6218('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0xf11167,_0x6218('0xf'));_0x3390c0(_0x59de7e[_0x6218('0x14')][_0x6218('0x13')]);}})[_0x6218('0x15')](function(_0x2ad257){logger['error'](_0x6218('0xd'),_0xf11167,_0x2ad257);_0xb1e880(_0x2ad257);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 8df7866..2fce934 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 _0x4b2a=['fs-extra','../../components/auth/service','../../components/interaction/service','index','/:id','get','isAuthenticated','getConfigurations','/:id/fields','post','create','/:id/configurations','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4b2a,0x1de));var _0xa4b2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b2a[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xa4b2('0x0'));var util=require(_0xa4b2('0x1'));var path=require(_0xa4b2('0x2'));var timeout=require(_0xa4b2('0x3'));var express=require(_0xa4b2('0x4'));var router=express['Router']();var fs_extra=require(_0xa4b2('0x5'));var auth=require(_0xa4b2('0x6'));var interaction=require(_0xa4b2('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa4b2('0x8')]);router['get'](_0xa4b2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xa4b2('0xa')]('/:id/configurations',auth[_0xa4b2('0xb')](),controller[_0xa4b2('0xc')]);router[_0xa4b2('0xa')](_0xa4b2('0xd'),auth[_0xa4b2('0xb')](),controller['getFields']);router[_0xa4b2('0xe')]('/',auth[_0xa4b2('0xb')](),controller[_0xa4b2('0xf')]);router[_0xa4b2('0xe')](_0xa4b2('0x10'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xa4b2('0x9'),auth[_0xa4b2('0xb')](),controller[_0xa4b2('0x11')]);router[_0xa4b2('0x12')]('/:id',auth[_0xa4b2('0xb')](),controller[_0xa4b2('0x13')]);module[_0xa4b2('0x14')]=router; \ No newline at end of file +var _0x8157=['getConfigurations','/:id/fields','create','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','show','/:id/configurations'];(function(_0x30e8a1,_0x55fa82){var _0x37c6f1=function(_0x377105){while(--_0x377105){_0x30e8a1['push'](_0x30e8a1['shift']());}};_0x37c6f1(++_0x55fa82);}(_0x8157,0x1d7));var _0x7815=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x8157[_0x3b19ea];return _0x40ece9;};'use strict';var multer=require(_0x7815('0x0'));var util=require(_0x7815('0x1'));var path=require(_0x7815('0x2'));var timeout=require(_0x7815('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7815('0x4'));var interaction=require(_0x7815('0x5'));var config=require(_0x7815('0x6'));var controller=require(_0x7815('0x7'));router[_0x7815('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x7815('0x9')](),controller[_0x7815('0xa')]);router['get'](_0x7815('0xb'),auth[_0x7815('0x9')](),controller[_0x7815('0xc')]);router[_0x7815('0x8')](_0x7815('0xd'),auth[_0x7815('0x9')](),controller['getFields']);router['post']('/',auth[_0x7815('0x9')](),controller[_0x7815('0xe')]);router[_0x7815('0xf')](_0x7815('0xb'),auth['isAuthenticated'](),controller[_0x7815('0x10')]);router[_0x7815('0x11')](_0x7815('0x12'),auth[_0x7815('0x9')](),controller[_0x7815('0x13')]);router[_0x7815('0x14')]('/:id',auth[_0x7815('0x9')](),controller[_0x7815('0x15')]);module[_0x7815('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 9b34aaa..973446e 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 _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x205bc3,_0x18a9c5){var _0x2963e9=function(_0x2aacf){while(--_0x2aacf){_0x205bc3['push'](_0x205bc3['shift']());}};_0x2963e9(++_0x18a9c5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x404eed,_0x5390c5){_0x404eed=_0x404eed-0x0;var _0xd45887=_0x0b0e[_0x404eed];return _0xd45887;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0xb016,0x159));var _0x6b01=function(_0x54c0d2,_0x508f9b){_0x54c0d2=_0x54c0d2-0x0;var _0x1c0891=_0xb016[_0x54c0d2];return _0x1c0891;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('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 f9a8495..e9679cd 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 _0x24e9=['format','Basic\x20%s','base64','subject','agent','description','group','source','ticket_type','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','offset','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','update','params','FreshdeskConfiguration','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','findOne','apiKey','remoteUri','lastIndexOf','GET','%s/%s','api/v2/ticket_fields'];(function(_0x16c33e,_0x5b919c){var _0x18e058=function(_0x575009){while(--_0x575009){_0x16c33e['push'](_0x16c33e['shift']());}};_0x18e058(++_0x5b919c);}(_0x24e9,0x85));var _0x924e=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x24e9[_0x25701b];return _0x3a8a2c;};'use strict';var emlformat=require(_0x924e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x924e('0x1'));var jsonpatch=require(_0x924e('0x2'));var rp=require(_0x924e('0x3'));var moment=require(_0x924e('0x4'));var BPromise=require(_0x924e('0x5'));var Mustache=require(_0x924e('0x6'));var util=require(_0x924e('0x7'));var path=require(_0x924e('0x8'));var sox=require('sox');var csv=require(_0x924e('0x9'));var ejs=require(_0x924e('0xa'));var fs=require('fs');var fs_extra=require(_0x924e('0xb'));var _=require(_0x924e('0xc'));var squel=require(_0x924e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x924e('0xe'));var toCsv=require(_0x924e('0x9'));var querystring=require(_0x924e('0xf'));var Papa=require(_0x924e('0x10'));var Redis=require('ioredis');var authService=require(_0x924e('0x11'));var qs=require(_0x924e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x924e('0x13'));var logger=require('../../config/logger')(_0x924e('0x14'));var utils=require(_0x924e('0x15'));var config=require(_0x924e('0x16'));var licenseUtil=require(_0x924e('0x17'));var db=require(_0x924e('0x18'))['db'];var integrations=require(_0x924e('0x19'));function respondWithStatusCode(_0x2096d0,_0x380bb5){_0x380bb5=_0x380bb5||0xcc;return function(_0x570bb8){if(_0x570bb8){return _0x2096d0[_0x924e('0x1a')](_0x380bb5);}return _0x2096d0['status'](_0x380bb5)[_0x924e('0x1b')]();};}function respondWithResult(_0x3ac60a,_0x12dcec){_0x12dcec=_0x12dcec||0xc8;return function(_0x3d7eac){if(_0x3d7eac){return _0x3ac60a[_0x924e('0x1c')](_0x12dcec)[_0x924e('0x1d')](_0x3d7eac);}};}function respondWithFilteredResult(_0x4dff17,_0x4df52c){return function(_0x8328a5){if(_0x8328a5){var _0x463d18=typeof _0x4df52c['offset']===_0x924e('0x1e')&&typeof _0x4df52c['limit']==='undefined';var _0x1a04d7=_0x8328a5['count'];var _0x50272c=_0x463d18?0x0:_0x4df52c[_0x924e('0x1f')];var _0x4715f8=_0x463d18?_0x8328a5[_0x924e('0x20')]:_0x4df52c[_0x924e('0x1f')]+_0x4df52c[_0x924e('0x21')];var _0x51fb8c;if(_0x4715f8>=_0x1a04d7){_0x4715f8=_0x1a04d7;_0x51fb8c=0xc8;}else{_0x51fb8c=0xce;}_0x4dff17[_0x924e('0x1c')](_0x51fb8c);return _0x4dff17[_0x924e('0x22')]('Content-Range',_0x50272c+'-'+_0x4715f8+'/'+_0x1a04d7)[_0x924e('0x1d')](_0x8328a5);}return null;};}function patchUpdates(_0x136d02){return function(_0x2070f5){try{jsonpatch[_0x924e('0x23')](_0x2070f5,_0x136d02,!![]);}catch(_0x59b352){return BPromise[_0x924e('0x24')](_0x59b352);}return _0x2070f5[_0x924e('0x25')]();};}function saveUpdates(_0x524524,_0x460295){return function(_0x4297b4){if(_0x4297b4){return _0x4297b4['update'](_0x524524)[_0x924e('0x26')](function(_0x1b26f9){return _0x1b26f9;});}return null;};}function removeEntity(_0x1a4106,_0x3315f6){return function(_0x33bc7c){if(_0x33bc7c){return _0x33bc7c[_0x924e('0x27')]()[_0x924e('0x26')](function(){_0x1a4106[_0x924e('0x1c')](0xcc)[_0x924e('0x1b')]();});}};}function handleEntityNotFound(_0x4662c4,_0x4fb285){return function(_0x497daa){if(!_0x497daa){_0x4662c4[_0x924e('0x1a')](0x194);}return _0x497daa;};}function handleError(_0x5e4fd8,_0x51a30f){_0x51a30f=_0x51a30f||0x1f4;return function(_0x1ea892){logger[_0x924e('0x28')](_0x1ea892[_0x924e('0x29')]);if(_0x1ea892[_0x924e('0x2a')]){delete _0x1ea892['name'];}_0x5e4fd8['status'](_0x51a30f)[_0x924e('0x2b')](_0x1ea892);};}exports['index']=function(_0x42d472,_0x4258e7){var _0x1dc3fd={},_0x352d42={},_0x5825f2={'count':0x0,'rows':[]};var _0x22992d=_[_0x924e('0x2c')](db[_0x924e('0x2d')][_0x924e('0x2e')],function(_0xb88fb5){return{'name':_0xb88fb5[_0x924e('0x2f')],'type':_0xb88fb5[_0x924e('0x30')][_0x924e('0x31')]};});_0x352d42[_0x924e('0x32')]=_[_0x924e('0x2c')](_0x22992d,_0x924e('0x2a'));_0x352d42[_0x924e('0x33')]=_[_0x924e('0x34')](_0x42d472[_0x924e('0x33')]);_0x352d42[_0x924e('0x35')]=_[_0x924e('0x36')](_0x352d42[_0x924e('0x32')],_0x352d42['query']);_0x1dc3fd[_0x924e('0x37')]=_[_0x924e('0x36')](_0x352d42['model'],qs[_0x924e('0x38')](_0x42d472['query'][_0x924e('0x38')]));_0x1dc3fd[_0x924e('0x37')]=_0x1dc3fd[_0x924e('0x37')][_0x924e('0x39')]?_0x1dc3fd[_0x924e('0x37')]:_0x352d42['model'];if(!_0x42d472[_0x924e('0x33')][_0x924e('0x3a')](_0x924e('0x3b'))){_0x1dc3fd[_0x924e('0x21')]=qs[_0x924e('0x21')](_0x42d472[_0x924e('0x33')][_0x924e('0x21')]);_0x1dc3fd[_0x924e('0x1f')]=qs[_0x924e('0x1f')](_0x42d472[_0x924e('0x33')][_0x924e('0x1f')]);}_0x1dc3fd[_0x924e('0x3c')]=qs[_0x924e('0x3d')](_0x42d472['query'][_0x924e('0x3d')]);_0x1dc3fd['where']=qs[_0x924e('0x35')](_[_0x924e('0x3e')](_0x42d472[_0x924e('0x33')],_0x352d42[_0x924e('0x35')]),_0x22992d);if(_0x42d472[_0x924e('0x33')][_0x924e('0x3f')]){_0x1dc3fd[_0x924e('0x40')]=_[_0x924e('0x41')](_0x1dc3fd[_0x924e('0x40')],{'$or':_[_0x924e('0x2c')](_0x22992d,function(_0x281fc6){if(_0x281fc6[_0x924e('0x30')]!==_0x924e('0x42')){var _0x6d050c={};_0x6d050c[_0x281fc6['name']]={'$like':'%'+_0x42d472[_0x924e('0x33')][_0x924e('0x3f')]+'%'};return _0x6d050c;}})});}_0x1dc3fd=_['merge']({},_0x1dc3fd,_0x42d472[_0x924e('0x43')]);var _0x591145={'where':_0x1dc3fd[_0x924e('0x40')]};return db[_0x924e('0x2d')][_0x924e('0x20')](_0x591145)[_0x924e('0x26')](function(_0xd2fa2a){_0x5825f2[_0x924e('0x20')]=_0xd2fa2a;if(_0x42d472[_0x924e('0x33')][_0x924e('0x44')]){_0x1dc3fd[_0x924e('0x45')]=[{'all':!![]}];}return db[_0x924e('0x2d')][_0x924e('0x46')](_0x1dc3fd);})[_0x924e('0x26')](function(_0x3e45af){_0x5825f2[_0x924e('0x47')]=_0x3e45af;return _0x5825f2;})[_0x924e('0x26')](respondWithFilteredResult(_0x4258e7,_0x1dc3fd))['catch'](handleError(_0x4258e7,null));};exports[_0x924e('0x48')]=function(_0x2e1fc1,_0x3ded39){var _0x649759={'raw':![],'where':{'id':_0x2e1fc1['params']['id']}},_0x24b8b0={};_0x24b8b0[_0x924e('0x32')]=_[_0x924e('0x34')](db[_0x924e('0x2d')]['rawAttributes']);_0x24b8b0[_0x924e('0x33')]=_[_0x924e('0x34')](_0x2e1fc1['query']);_0x24b8b0['filters']=_['intersection'](_0x24b8b0[_0x924e('0x32')],_0x24b8b0[_0x924e('0x33')]);_0x649759[_0x924e('0x37')]=_[_0x924e('0x36')](_0x24b8b0[_0x924e('0x32')],qs[_0x924e('0x38')](_0x2e1fc1[_0x924e('0x33')][_0x924e('0x38')]));_0x649759['attributes']=_0x649759[_0x924e('0x37')][_0x924e('0x39')]?_0x649759['attributes']:_0x24b8b0[_0x924e('0x32')];if(_0x2e1fc1[_0x924e('0x33')][_0x924e('0x44')]){_0x649759[_0x924e('0x45')]=[{'all':!![]}];}_0x649759=_['merge']({},_0x649759,_0x2e1fc1[_0x924e('0x43')]);return db[_0x924e('0x2d')][_0x924e('0x49')](_0x649759)[_0x924e('0x26')](handleEntityNotFound(_0x3ded39,null))['then'](respondWithResult(_0x3ded39,null))['catch'](handleError(_0x3ded39,null));};exports[_0x924e('0x4a')]=function(_0x32db84,_0x233d82){return db[_0x924e('0x2d')][_0x924e('0x4a')](_0x32db84[_0x924e('0x4b')],{})[_0x924e('0x26')](respondWithResult(_0x233d82,0xc9))[_0x924e('0x4c')](handleError(_0x233d82,null));};exports[_0x924e('0x4d')]=function(_0x353a48,_0x76c64e){if(_0x353a48[_0x924e('0x4b')]['id']){delete _0x353a48[_0x924e('0x4b')]['id'];}return db['FreshdeskAccount'][_0x924e('0x49')]({'where':{'id':_0x353a48[_0x924e('0x4e')]['id']}})[_0x924e('0x26')](handleEntityNotFound(_0x76c64e,null))[_0x924e('0x26')](saveUpdates(_0x353a48[_0x924e('0x4b')],null))[_0x924e('0x26')](respondWithResult(_0x76c64e,null))[_0x924e('0x4c')](handleError(_0x76c64e,null));};exports[_0x924e('0x27')]=function(_0x53f43b,_0xc8fab){return db[_0x924e('0x2d')][_0x924e('0x49')]({'where':{'id':_0x53f43b[_0x924e('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc8fab,null))['then'](removeEntity(_0xc8fab,null))[_0x924e('0x4c')](handleError(_0xc8fab,null));};exports['getConfigurations']=function(_0xbe505e,_0x3bd2b0,_0x569a82){var _0x18a72c={};var _0x48dbc4={};var _0x46ade8;var _0x312667;return db[_0x924e('0x2d')]['findOne']({'where':{'id':_0xbe505e['params']['id']}})[_0x924e('0x26')](handleEntityNotFound(_0x3bd2b0,null))[_0x924e('0x26')](function(_0x7c3fe9){if(_0x7c3fe9){_0x46ade8=_0x7c3fe9;_0x48dbc4['model']=_[_0x924e('0x34')](db[_0x924e('0x4f')][_0x924e('0x2e')]);_0x48dbc4[_0x924e('0x33')]=_[_0x924e('0x34')](_0xbe505e[_0x924e('0x33')]);_0x48dbc4['filters']=_[_0x924e('0x36')](_0x48dbc4['model'],_0x48dbc4[_0x924e('0x33')]);_0x18a72c[_0x924e('0x37')]=_[_0x924e('0x36')](_0x48dbc4[_0x924e('0x32')],qs[_0x924e('0x38')](_0xbe505e[_0x924e('0x33')][_0x924e('0x38')]));_0x18a72c['attributes']=_0x18a72c[_0x924e('0x37')]['length']?_0x18a72c[_0x924e('0x37')]:_0x48dbc4[_0x924e('0x32')];_0x18a72c['order']=qs['sort'](_0xbe505e['query'][_0x924e('0x3d')]);_0x18a72c[_0x924e('0x40')]=qs[_0x924e('0x35')](_[_0x924e('0x3e')](_0xbe505e[_0x924e('0x33')],_0x48dbc4['filters']));if(_0xbe505e[_0x924e('0x33')][_0x924e('0x3f')]){_0x18a72c[_0x924e('0x40')]=_['merge'](_0x18a72c[_0x924e('0x40')],{'$or':_['map'](_0x18a72c[_0x924e('0x37')],function(_0x17dcc5){var _0x34c788={};_0x34c788[_0x17dcc5]={'$like':'%'+_0xbe505e[_0x924e('0x33')]['filter']+'%'};return _0x34c788;})});}_0x18a72c=_[_0x924e('0x41')]({},_0x18a72c,_0xbe505e[_0x924e('0x43')]);return _0x46ade8[_0x924e('0x50')](_0x18a72c);}})[_0x924e('0x26')](function(_0x4cdffa){if(_0x4cdffa){_0x312667=_0x4cdffa[_0x924e('0x39')];if(!_0xbe505e[_0x924e('0x33')][_0x924e('0x3a')](_0x924e('0x3b'))){_0x18a72c['limit']=qs[_0x924e('0x21')](_0xbe505e[_0x924e('0x33')][_0x924e('0x21')]);_0x18a72c[_0x924e('0x1f')]=qs[_0x924e('0x1f')](_0xbe505e['query']['offset']);}return _0x46ade8[_0x924e('0x50')](_0x18a72c);}})[_0x924e('0x26')](function(_0x207ec6){if(_0x207ec6){return _0x207ec6?{'count':_0x312667,'rows':_0x207ec6}:null;}})[_0x924e('0x26')](respondWithResult(_0x3bd2b0,null))[_0x924e('0x4c')](handleError(_0x3bd2b0,null));};exports['addConfiguration']=function(_0x311ad1,_0x299ba4,_0x59e155){if(_0x311ad1['body']['id']){delete _0x311ad1[_0x924e('0x4b')]['id'];}return db[_0x924e('0x2d')]['findOne']({'where':{'id':_0x311ad1[_0x924e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x299ba4,null))[_0x924e('0x26')](function(_0x31db6d){if(_0x31db6d){_0x311ad1[_0x924e('0x4b')][_0x924e('0x51')]=_0x31db6d['id'];_0x311ad1[_0x924e('0x4b')][_0x924e('0x52')]=integrations['getSubjects'](_0x311ad1[_0x924e('0x4b')][_0x924e('0x53')],_0x311ad1[_0x924e('0x4b')]['type']);_0x311ad1[_0x924e('0x4b')][_0x924e('0x54')]=integrations[_0x924e('0x55')](_0x311ad1[_0x924e('0x4b')][_0x924e('0x53')],_0x311ad1[_0x924e('0x4b')]['type']);return db['FreshdeskConfiguration']['create'](_0x311ad1[_0x924e('0x4b')],{'include':[{'model':db[_0x924e('0x56')],'as':_0x924e('0x52')},{'model':db['FreshdeskField'],'as':_0x924e('0x54')}]});}return null;})[_0x924e('0x26')](respondWithResult(_0x299ba4,null))[_0x924e('0x4c')](handleError(_0x299ba4,null));};exports[_0x924e('0x57')]=function(_0x50fe75,_0x1c42c9,_0x24adba){var _0x11ce7e='';return db[_0x924e('0x2d')][_0x924e('0x58')]({'where':{'id':_0x50fe75[_0x924e('0x4e')]['id']},'attributes':['id','remoteUri',_0x924e('0x59')]})[_0x924e('0x26')](handleEntityNotFound(_0x1c42c9,null))['then'](function(_0x154549){if(_0x154549){_0x11ce7e=_0x154549[_0x924e('0x5a')];var _0x39ec55=_0x11ce7e['slice'](-0x1);if(_0x39ec55==='/'){_0x11ce7e=_0x11ce7e['substring'](0x0,_0x11ce7e[_0x924e('0x5b')](_0x39ec55));}return rp({'method':_0x924e('0x5c'),'uri':util['format'](_0x924e('0x5d'),_0x11ce7e,_0x924e('0x5e')),'headers':{'Authorization':util[_0x924e('0x5f')](_0x924e('0x60'),new Buffer(util[_0x924e('0x5f')]('%s:X',_0x154549[_0x924e('0x59')]))['toString'](_0x924e('0x61')))},'json':!![]});}})['then'](function(_0x522328){if(_0x522328){var _0x382b6d=['requester',_0x924e('0x62'),_0x924e('0x63'),_0x924e('0x64'),_0x924e('0x1c'),'priority',_0x924e('0x65'),_0x924e('0x66'),_0x924e('0x67'),_0x924e('0x65'),'company'];_['remove'](_0x522328,function(_0x2afda7){return _0x382b6d[_0x924e('0x68')](_0x2afda7[_0x924e('0x2a')])||!_0x2afda7['default']&&_0x2afda7[_0x924e('0x30')]!==_0x924e('0x69')&&_0x2afda7[_0x924e('0x30')]!==_0x924e('0x6a');});return{'count':_0x522328[_0x924e('0x39')],'rows':_[_0x924e('0x2c')](_0x522328,function(_0x23b619){return{'id':_0x23b619['name'],'name':_0x23b619[_0x924e('0x6b')],'custom':!_0x23b619[_0x924e('0x6c')],'options':_0x23b619['choices']?_['map'](_0x23b619[_0x924e('0x6d')],function(_0x1661e8){return{'name':_[_0x924e('0x6e')](_0x1661e8),'value':_0x1661e8};}):[]};})};}})[_0x924e('0x26')](respondWithResult(_0x1c42c9,null))[_0x924e('0x4c')](function(_0x1ae328){var _0x46e2ae=_0x50fe75['query'][_0x924e('0x6f')]?0x1f4:_0x1ae328[_0x924e('0x70')]||0x1f4;logger[_0x924e('0x28')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x46e2ae,JSON['stringify'](_0x1ae328));delete _0x1ae328['name'];if(_0x46e2ae===0x191){_0x46e2ae=0x190;}_0x1c42c9[_0x924e('0x1c')](_0x46e2ae)[_0x924e('0x2b')](_0x50fe75[_0x924e('0x33')][_0x924e('0x6f')]?{'message':_0x924e('0x71'),'statusCode':_0x1ae328[_0x924e('0x70')]}:_0x1ae328);});}; \ No newline at end of file +var _0x6594=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','FreshdeskAccount','rawAttributes','options','find','create','body','update','params','findOne','FreshdeskConfiguration','length','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','Basic\x20%s','format','%s:X','requester','subject','ticket_type','group','company','remove','includes','default','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x6594,0xcb));var _0x4659=function(_0x239a99,_0x2eea66){_0x239a99=_0x239a99-0x0;var _0x5e65dc=_0x6594[_0x239a99];return _0x5e65dc;};'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(_0x4659('0x0'));var moment=require(_0x4659('0x1'));var BPromise=require(_0x4659('0x2'));var Mustache=require(_0x4659('0x3'));var util=require(_0x4659('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4659('0x5'));var ejs=require(_0x4659('0x6'));var fs=require('fs');var fs_extra=require(_0x4659('0x7'));var _=require(_0x4659('0x8'));var squel=require('squel');var crypto=require(_0x4659('0x9'));var jsforce=require(_0x4659('0xa'));var deskjs=require(_0x4659('0xb'));var toCsv=require(_0x4659('0x5'));var querystring=require(_0x4659('0xc'));var Papa=require(_0x4659('0xd'));var Redis=require('ioredis');var authService=require(_0x4659('0xe'));var qs=require(_0x4659('0xf'));var as=require(_0x4659('0x10'));var hardwareService=require(_0x4659('0x11'));var logger=require(_0x4659('0x12'))(_0x4659('0x13'));var utils=require(_0x4659('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4659('0x15'))['db'];var integrations=require(_0x4659('0x16'));function respondWithStatusCode(_0x1f89cf,_0x5389a0){_0x5389a0=_0x5389a0||0xcc;return function(_0x40f043){if(_0x40f043){return _0x1f89cf[_0x4659('0x17')](_0x5389a0);}return _0x1f89cf['status'](_0x5389a0)['end']();};}function respondWithResult(_0x1a9e9c,_0x4c3c05){_0x4c3c05=_0x4c3c05||0xc8;return function(_0x39d8ba){if(_0x39d8ba){return _0x1a9e9c[_0x4659('0x18')](_0x4c3c05)[_0x4659('0x19')](_0x39d8ba);}};}function respondWithFilteredResult(_0x5c099c,_0x3d9a17){return function(_0x429b72){if(_0x429b72){var _0x1d78a5=typeof _0x3d9a17[_0x4659('0x1a')]==='undefined'&&typeof _0x3d9a17[_0x4659('0x1b')]===_0x4659('0x1c');var _0x73f3f5=_0x429b72[_0x4659('0x1d')];var _0x4c8820=_0x1d78a5?0x0:_0x3d9a17[_0x4659('0x1a')];var _0x3049ba=_0x1d78a5?_0x429b72['count']:_0x3d9a17[_0x4659('0x1a')]+_0x3d9a17[_0x4659('0x1b')];var _0x6b8d07;if(_0x3049ba>=_0x73f3f5){_0x3049ba=_0x73f3f5;_0x6b8d07=0xc8;}else{_0x6b8d07=0xce;}_0x5c099c[_0x4659('0x18')](_0x6b8d07);return _0x5c099c['set']('Content-Range',_0x4c8820+'-'+_0x3049ba+'/'+_0x73f3f5)[_0x4659('0x19')](_0x429b72);}return null;};}function patchUpdates(_0x157f1a){return function(_0x1fce1d){try{jsonpatch[_0x4659('0x1e')](_0x1fce1d,_0x157f1a,!![]);}catch(_0x288cdf){return BPromise[_0x4659('0x1f')](_0x288cdf);}return _0x1fce1d[_0x4659('0x20')]();};}function saveUpdates(_0x2e773b,_0x1a016e){return function(_0x494631){if(_0x494631){return _0x494631['update'](_0x2e773b)[_0x4659('0x21')](function(_0x4c40b3){return _0x4c40b3;});}return null;};}function removeEntity(_0x1e9c93,_0x47c73d){return function(_0x1715ba){if(_0x1715ba){return _0x1715ba[_0x4659('0x22')]()[_0x4659('0x21')](function(){_0x1e9c93[_0x4659('0x18')](0xcc)[_0x4659('0x23')]();});}};}function handleEntityNotFound(_0x1fe661,_0x2b4ad8){return function(_0x1d1cba){if(!_0x1d1cba){_0x1fe661[_0x4659('0x17')](0x194);}return _0x1d1cba;};}function handleError(_0x507598,_0x428dd5){_0x428dd5=_0x428dd5||0x1f4;return function(_0x1bd579){logger[_0x4659('0x24')](_0x1bd579[_0x4659('0x25')]);if(_0x1bd579[_0x4659('0x26')]){delete _0x1bd579[_0x4659('0x26')];}_0x507598[_0x4659('0x18')](_0x428dd5)[_0x4659('0x27')](_0x1bd579);};}exports[_0x4659('0x28')]=function(_0x479a2e,_0x5d0c89){var _0xde3c49={},_0x26d67f={},_0x5c5a31={'count':0x0,'rows':[]};var _0x507fc1=_[_0x4659('0x29')](db['FreshdeskAccount']['rawAttributes'],function(_0x34d817){return{'name':_0x34d817[_0x4659('0x2a')],'type':_0x34d817['type'][_0x4659('0x2b')]};});_0x26d67f[_0x4659('0x2c')]=_[_0x4659('0x29')](_0x507fc1,_0x4659('0x26'));_0x26d67f[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x479a2e[_0x4659('0x2d')]);_0x26d67f['filters']=_[_0x4659('0x2f')](_0x26d67f[_0x4659('0x2c')],_0x26d67f[_0x4659('0x2d')]);_0xde3c49[_0x4659('0x30')]=_['intersection'](_0x26d67f[_0x4659('0x2c')],qs[_0x4659('0x31')](_0x479a2e[_0x4659('0x2d')][_0x4659('0x31')]));_0xde3c49[_0x4659('0x30')]=_0xde3c49[_0x4659('0x30')]['length']?_0xde3c49['attributes']:_0x26d67f['model'];if(!_0x479a2e[_0x4659('0x2d')][_0x4659('0x32')]('nolimit')){_0xde3c49[_0x4659('0x1b')]=qs[_0x4659('0x1b')](_0x479a2e['query'][_0x4659('0x1b')]);_0xde3c49[_0x4659('0x1a')]=qs['offset'](_0x479a2e['query'][_0x4659('0x1a')]);}_0xde3c49[_0x4659('0x33')]=qs[_0x4659('0x34')](_0x479a2e[_0x4659('0x2d')][_0x4659('0x34')]);_0xde3c49[_0x4659('0x35')]=qs[_0x4659('0x36')](_[_0x4659('0x37')](_0x479a2e[_0x4659('0x2d')],_0x26d67f['filters']),_0x507fc1);if(_0x479a2e[_0x4659('0x2d')][_0x4659('0x38')]){_0xde3c49['where']=_['merge'](_0xde3c49['where'],{'$or':_['map'](_0x507fc1,function(_0xb4a62d){if(_0xb4a62d[_0x4659('0x39')]!==_0x4659('0x3a')){var _0x5406ae={};_0x5406ae[_0xb4a62d[_0x4659('0x26')]]={'$like':'%'+_0x479a2e[_0x4659('0x2d')]['filter']+'%'};return _0x5406ae;}})});}_0xde3c49=_[_0x4659('0x3b')]({},_0xde3c49,_0x479a2e['options']);var _0x1f5298={'where':_0xde3c49[_0x4659('0x35')]};return db['FreshdeskAccount']['count'](_0x1f5298)[_0x4659('0x21')](function(_0x391879){_0x5c5a31[_0x4659('0x1d')]=_0x391879;if(_0x479a2e['query'][_0x4659('0x3c')]){_0xde3c49[_0x4659('0x3d')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x4659('0x3e')](_0xde3c49);})[_0x4659('0x21')](function(_0xd78633){_0x5c5a31[_0x4659('0x3f')]=_0xd78633;return _0x5c5a31;})[_0x4659('0x21')](respondWithFilteredResult(_0x5d0c89,_0xde3c49))[_0x4659('0x40')](handleError(_0x5d0c89,null));};exports['show']=function(_0x11e413,_0x22e2bb){var _0xd38f94={'raw':![],'where':{'id':_0x11e413['params']['id']}},_0x9f120a={};_0x9f120a['model']=_[_0x4659('0x2e')](db[_0x4659('0x41')][_0x4659('0x42')]);_0x9f120a[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x11e413[_0x4659('0x2d')]);_0x9f120a[_0x4659('0x36')]=_['intersection'](_0x9f120a[_0x4659('0x2c')],_0x9f120a[_0x4659('0x2d')]);_0xd38f94[_0x4659('0x30')]=_[_0x4659('0x2f')](_0x9f120a['model'],qs[_0x4659('0x31')](_0x11e413['query']['fields']));_0xd38f94['attributes']=_0xd38f94['attributes']['length']?_0xd38f94[_0x4659('0x30')]:_0x9f120a[_0x4659('0x2c')];if(_0x11e413[_0x4659('0x2d')][_0x4659('0x3c')]){_0xd38f94[_0x4659('0x3d')]=[{'all':!![]}];}_0xd38f94=_['merge']({},_0xd38f94,_0x11e413[_0x4659('0x43')]);return db[_0x4659('0x41')][_0x4659('0x44')](_0xd38f94)[_0x4659('0x21')](handleEntityNotFound(_0x22e2bb,null))['then'](respondWithResult(_0x22e2bb,null))[_0x4659('0x40')](handleError(_0x22e2bb,null));};exports[_0x4659('0x45')]=function(_0x374df3,_0x1d3876){return db[_0x4659('0x41')]['create'](_0x374df3[_0x4659('0x46')],{})[_0x4659('0x21')](respondWithResult(_0x1d3876,0xc9))['catch'](handleError(_0x1d3876,null));};exports[_0x4659('0x47')]=function(_0x51e4ad,_0x452154){if(_0x51e4ad['body']['id']){delete _0x51e4ad[_0x4659('0x46')]['id'];}return db['FreshdeskAccount'][_0x4659('0x44')]({'where':{'id':_0x51e4ad[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x452154,null))[_0x4659('0x21')](saveUpdates(_0x51e4ad[_0x4659('0x46')],null))[_0x4659('0x21')](respondWithResult(_0x452154,null))[_0x4659('0x40')](handleError(_0x452154,null));};exports[_0x4659('0x22')]=function(_0x722dea,_0x4a39a2){return db[_0x4659('0x41')][_0x4659('0x44')]({'where':{'id':_0x722dea[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x4a39a2,null))['then'](removeEntity(_0x4a39a2,null))[_0x4659('0x40')](handleError(_0x4a39a2,null));};exports['getConfigurations']=function(_0x1d8b61,_0x105369,_0x3dbb46){var _0x42bd7e={};var _0x4f62ac={};var _0xc62155;var _0x225f98;return db[_0x4659('0x41')][_0x4659('0x49')]({'where':{'id':_0x1d8b61['params']['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x105369,null))[_0x4659('0x21')](function(_0x9df1b2){if(_0x9df1b2){_0xc62155=_0x9df1b2;_0x4f62ac[_0x4659('0x2c')]=_[_0x4659('0x2e')](db[_0x4659('0x4a')][_0x4659('0x42')]);_0x4f62ac[_0x4659('0x2d')]=_[_0x4659('0x2e')](_0x1d8b61[_0x4659('0x2d')]);_0x4f62ac[_0x4659('0x36')]=_[_0x4659('0x2f')](_0x4f62ac[_0x4659('0x2c')],_0x4f62ac[_0x4659('0x2d')]);_0x42bd7e['attributes']=_[_0x4659('0x2f')](_0x4f62ac[_0x4659('0x2c')],qs['fields'](_0x1d8b61[_0x4659('0x2d')][_0x4659('0x31')]));_0x42bd7e[_0x4659('0x30')]=_0x42bd7e[_0x4659('0x30')][_0x4659('0x4b')]?_0x42bd7e[_0x4659('0x30')]:_0x4f62ac[_0x4659('0x2c')];_0x42bd7e['order']=qs[_0x4659('0x34')](_0x1d8b61[_0x4659('0x2d')][_0x4659('0x34')]);_0x42bd7e[_0x4659('0x35')]=qs[_0x4659('0x36')](_[_0x4659('0x37')](_0x1d8b61[_0x4659('0x2d')],_0x4f62ac['filters']));if(_0x1d8b61[_0x4659('0x2d')][_0x4659('0x38')]){_0x42bd7e['where']=_[_0x4659('0x3b')](_0x42bd7e[_0x4659('0x35')],{'$or':_[_0x4659('0x29')](_0x42bd7e['attributes'],function(_0x36d2cc){var _0x20f7ec={};_0x20f7ec[_0x36d2cc]={'$like':'%'+_0x1d8b61['query'][_0x4659('0x38')]+'%'};return _0x20f7ec;})});}_0x42bd7e=_['merge']({},_0x42bd7e,_0x1d8b61[_0x4659('0x43')]);return _0xc62155[_0x4659('0x4c')](_0x42bd7e);}})[_0x4659('0x21')](function(_0x517921){if(_0x517921){_0x225f98=_0x517921['length'];if(!_0x1d8b61[_0x4659('0x2d')]['hasOwnProperty'](_0x4659('0x4d'))){_0x42bd7e[_0x4659('0x1b')]=qs[_0x4659('0x1b')](_0x1d8b61['query']['limit']);_0x42bd7e[_0x4659('0x1a')]=qs[_0x4659('0x1a')](_0x1d8b61[_0x4659('0x2d')]['offset']);}return _0xc62155['getConfigurations'](_0x42bd7e);}})[_0x4659('0x21')](function(_0x41785f){if(_0x41785f){return _0x41785f?{'count':_0x225f98,'rows':_0x41785f}:null;}})[_0x4659('0x21')](respondWithResult(_0x105369,null))[_0x4659('0x40')](handleError(_0x105369,null));};exports[_0x4659('0x4e')]=function(_0x2746dc,_0x1b874d,_0x4dd4a8){if(_0x2746dc[_0x4659('0x46')]['id']){delete _0x2746dc['body']['id'];}return db[_0x4659('0x41')]['findOne']({'where':{'id':_0x2746dc[_0x4659('0x48')]['id']}})[_0x4659('0x21')](handleEntityNotFound(_0x1b874d,null))[_0x4659('0x21')](function(_0x57343a){if(_0x57343a){_0x2746dc['body'][_0x4659('0x4f')]=_0x57343a['id'];_0x2746dc[_0x4659('0x46')][_0x4659('0x50')]=integrations[_0x4659('0x51')](_0x2746dc[_0x4659('0x46')][_0x4659('0x52')],_0x2746dc[_0x4659('0x46')][_0x4659('0x39')]);_0x2746dc[_0x4659('0x46')][_0x4659('0x53')]=integrations[_0x4659('0x54')](_0x2746dc[_0x4659('0x46')]['channel'],_0x2746dc[_0x4659('0x46')]['type']);return db[_0x4659('0x4a')][_0x4659('0x45')](_0x2746dc['body'],{'include':[{'model':db[_0x4659('0x55')],'as':_0x4659('0x50')},{'model':db[_0x4659('0x55')],'as':'Descriptions'}]});}return null;})[_0x4659('0x21')](respondWithResult(_0x1b874d,null))[_0x4659('0x40')](handleError(_0x1b874d,null));};exports[_0x4659('0x56')]=function(_0x5e840f,_0x28bb1b,_0x4825a4){var _0x332658='';return db[_0x4659('0x41')]['findOne']({'where':{'id':_0x5e840f[_0x4659('0x48')]['id']},'attributes':['id',_0x4659('0x57'),_0x4659('0x58')]})[_0x4659('0x21')](handleEntityNotFound(_0x28bb1b,null))[_0x4659('0x21')](function(_0x482dc9){if(_0x482dc9){_0x332658=_0x482dc9[_0x4659('0x57')];var _0x249eb1=_0x332658[_0x4659('0x59')](-0x1);if(_0x249eb1==='/'){_0x332658=_0x332658[_0x4659('0x5a')](0x0,_0x332658[_0x4659('0x5b')](_0x249eb1));}return rp({'method':_0x4659('0x5c'),'uri':util['format']('%s/%s',_0x332658,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x4659('0x5d'),new Buffer(util[_0x4659('0x5e')](_0x4659('0x5f'),_0x482dc9['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x4659('0x21')](function(_0x2cef6b){if(_0x2cef6b){var _0x15d709=[_0x4659('0x60'),_0x4659('0x61'),'agent','description','status','priority','group','source',_0x4659('0x62'),_0x4659('0x63'),_0x4659('0x64')];_[_0x4659('0x65')](_0x2cef6b,function(_0x35ce47){return _0x15d709[_0x4659('0x66')](_0x35ce47['name'])||!_0x35ce47[_0x4659('0x67')]&&_0x35ce47[_0x4659('0x39')]!=='custom_text'&&_0x35ce47[_0x4659('0x39')]!==_0x4659('0x68');});return{'count':_0x2cef6b['length'],'rows':_[_0x4659('0x29')](_0x2cef6b,function(_0x56d500){return{'id':_0x56d500[_0x4659('0x26')],'name':_0x56d500['label'],'custom':!_0x56d500[_0x4659('0x67')],'options':_0x56d500[_0x4659('0x69')]?_[_0x4659('0x29')](_0x56d500[_0x4659('0x69')],function(_0x59d3be){return{'name':_['capitalize'](_0x59d3be),'value':_0x59d3be};}):[]};})};}})[_0x4659('0x21')](respondWithResult(_0x28bb1b,null))[_0x4659('0x40')](function(_0x320028){var _0x95642f=_0x5e840f[_0x4659('0x2d')][_0x4659('0x6a')]?0x1f4:_0x320028[_0x4659('0x6b')]||0x1f4;logger[_0x4659('0x24')](_0x4659('0x6c'),'getFields',_0x95642f,JSON[_0x4659('0x6d')](_0x320028));delete _0x320028[_0x4659('0x26')];if(_0x95642f===0x191){_0x95642f=0x190;}_0x28bb1b['status'](_0x95642f)[_0x4659('0x27')](_0x5e840f[_0x4659('0x2d')][_0x4659('0x6a')]?{'message':'Wrong\x20credentials','statusCode':_0x320028[_0x4659('0x6b')]}:_0x320028);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 4201c21..5fd7aea 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 _0x2744=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','lodash','../../config/logger'];(function(_0x1f15bb,_0x4663fb){var _0x3a49ef=function(_0x5aa13c){while(--_0x5aa13c){_0x1f15bb['push'](_0x1f15bb['shift']());}};_0x3a49ef(++_0x4663fb);}(_0x2744,0x77));var _0x4274=function(_0x1703cf,_0x21fed1){_0x1703cf=_0x1703cf-0x0;var _0x4304eb=_0x2744[_0x1703cf];return _0x4304eb;};'use strict';var _=require(_0x4274('0x0'));var util=require('util');var logger=require(_0x4274('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4274('0x2'));var rp=require(_0x4274('0x3'));var fs=require('fs');var path=require(_0x4274('0x4'));var rimraf=require(_0x4274('0x5'));var config=require(_0x4274('0x6'));var attributes=require(_0x4274('0x7'));var integrations=require(_0x4274('0x8'));module['exports']=function(_0x42e38e,_0x6b1b5){return _0x42e38e[_0x4274('0x9')](_0x4274('0xa'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x334e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','exports'];(function(_0x37fa67,_0x16bdac){var _0x2952fc=function(_0x42c481){while(--_0x42c481){_0x37fa67['push'](_0x37fa67['shift']());}};_0x2952fc(++_0x16bdac);}(_0x334e,0x1cb));var _0xe334=function(_0x37b5d3,_0x5b10fd){_0x37b5d3=_0x37b5d3-0x0;var _0x51c3e5=_0x334e[_0x37b5d3];return _0x51c3e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe334('0x0'))(_0xe334('0x1'));var moment=require(_0xe334('0x2'));var BPromise=require(_0xe334('0x3'));var rp=require(_0xe334('0x4'));var fs=require('fs');var path=require(_0xe334('0x5'));var rimraf=require(_0xe334('0x6'));var config=require('../../config/environment');var attributes=require(_0xe334('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe334('0x8')]=function(_0x454ae4,_0x521237){return _0x454ae4['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 7b8a4c3..51ae79e 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 _0x537a=['info','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','map','include','model','ShowFreshdeskAccount','find','then','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','debug','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x537a,0xf7));var _0xa537=function(_0x2b332c,_0x4f557f){_0x2b332c=_0x2b332c-0x0;var _0x4423e6=_0x537a[_0x2b332c];return _0x4423e6;};'use strict';var _=require('lodash');var util=require(_0xa537('0x0'));var moment=require('moment');var BPromise=require(_0xa537('0x1'));var rs=require(_0xa537('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa537('0x3'));var logger=require(_0xa537('0x4'))(_0xa537('0x5'));var config=require(_0xa537('0x6'));var jayson=require(_0xa537('0x7'));var client=jayson[_0xa537('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a3407,_0xebdbb3,_0xfa73aa){return new BPromise(function(_0xdd920b,_0x25e0b1){return client[_0xa537('0x9')](_0x2a3407,_0xfa73aa)['then'](function(_0x80663d){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0xebdbb3,'request\x20sent');logger[_0xa537('0xa')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0xebdbb3,_0xa537('0xb'),JSON[_0xa537('0xc')](_0x80663d));if(_0x80663d['error']){if(_0x80663d[_0xa537('0xd')][_0xa537('0xe')]===0x1f4){logger[_0xa537('0xd')](_0xa537('0xf'),_0xebdbb3,_0x80663d['error'][_0xa537('0x10')]);return _0x25e0b1(_0x80663d['error'][_0xa537('0x10')]);}logger[_0xa537('0xd')](_0xa537('0xf'),_0xebdbb3,_0x80663d[_0xa537('0xd')][_0xa537('0x10')]);return _0xdd920b(_0x80663d['error'][_0xa537('0x10')]);}else{logger[_0xa537('0x11')](_0xa537('0xf'),_0xebdbb3,_0xa537('0xb'));_0xdd920b(_0x80663d[_0xa537('0x12')][_0xa537('0x10')]);}})[_0xa537('0x13')](function(_0x2d4a21){logger[_0xa537('0xd')](_0xa537('0xf'),_0xebdbb3,_0x2d4a21);_0x25e0b1(_0x2d4a21);});});}exports[_0xa537('0x14')]=function(_0x2061c3){var _0xcc08ad=this;return new Promise(function(_0x2c0a6e,_0x51e608){return db[_0xa537('0x15')]['findAll']({'raw':_0x2061c3[_0xa537('0x16')]?_0x2061c3['options'][_0xa537('0x17')]===undefined?!![]:![]:!![],'where':_0x2061c3[_0xa537('0x16')]?_0x2061c3[_0xa537('0x16')][_0xa537('0x18')]||null:null,'attributes':_0x2061c3['options']?_0x2061c3['options'][_0xa537('0x19')]||null:null,'limit':_0x2061c3['options']?_0x2061c3[_0xa537('0x16')][_0xa537('0x1a')]||null:null,'include':_0x2061c3[_0xa537('0x16')]?_0x2061c3[_0xa537('0x16')]['include']?_[_0xa537('0x1b')](_0x2061c3[_0xa537('0x16')][_0xa537('0x1c')],function(_0x341549){return{'model':db[_0x341549[_0xa537('0x1d')]],'as':_0x341549['as'],'attributes':_0x341549[_0xa537('0x19')],'include':_0x341549['include']?_[_0xa537('0x1b')](_0x341549[_0xa537('0x1c')],function(_0x2bf608){return{'model':db[_0x2bf608[_0xa537('0x1d')]],'as':_0x2bf608['as'],'attributes':_0x2bf608['attributes'],'include':_0x2bf608['include']?_['map'](_0x2bf608[_0xa537('0x1c')],function(_0xfd1f49){return{'model':db[_0xfd1f49[_0xa537('0x1d')]],'as':_0xfd1f49['as'],'attributes':_0xfd1f49[_0xa537('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3692c7){logger[_0xa537('0x11')]('GetFreshdeskAccount',_0x2061c3);logger[_0xa537('0xa')](_0xa537('0x14'),_0x2061c3,JSON['stringify'](_0x3692c7));_0x2c0a6e(_0x3692c7);})[_0xa537('0x13')](function(_0x515ab7){logger['error'](_0xa537('0x14'),_0x515ab7[_0xa537('0x10')],_0x2061c3);_0x51e608(_0xcc08ad['error'](0x1f4,_0x515ab7[_0xa537('0x10')]));});});};exports[_0xa537('0x1e')]=function(_0x5129ef){var _0x4a1d24=this;return new Promise(function(_0x1c8c6c,_0x153ed4){return db[_0xa537('0x15')][_0xa537('0x1f')]({'raw':_0x5129ef[_0xa537('0x16')]?_0x5129ef[_0xa537('0x16')][_0xa537('0x17')]===undefined?!![]:![]:!![],'where':_0x5129ef['options']?_0x5129ef[_0xa537('0x16')][_0xa537('0x18')]||null:null,'attributes':_0x5129ef['options']?_0x5129ef['options']['attributes']||null:null,'include':_0x5129ef[_0xa537('0x16')]?_0x5129ef[_0xa537('0x16')][_0xa537('0x1c')]?_[_0xa537('0x1b')](_0x5129ef['options']['include'],function(_0x4db686){return{'model':db[_0x4db686[_0xa537('0x1d')]],'as':_0x4db686['as'],'attributes':_0x4db686[_0xa537('0x19')],'include':_0x4db686[_0xa537('0x1c')]?_[_0xa537('0x1b')](_0x4db686['include'],function(_0x7bcbc1){return{'model':db[_0x7bcbc1[_0xa537('0x1d')]],'as':_0x7bcbc1['as'],'attributes':_0x7bcbc1[_0xa537('0x19')],'include':_0x7bcbc1[_0xa537('0x1c')]?_[_0xa537('0x1b')](_0x7bcbc1[_0xa537('0x1c')],function(_0x10721d){return{'model':db[_0x10721d[_0xa537('0x1d')]],'as':_0x10721d['as'],'attributes':_0x10721d[_0xa537('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa537('0x20')](function(_0x23bd77){logger[_0xa537('0x11')](_0xa537('0x1e'),_0x5129ef);logger[_0xa537('0xa')](_0xa537('0x1e'),_0x5129ef,JSON['stringify'](_0x23bd77));_0x1c8c6c(_0x23bd77);})['catch'](function(_0x2aa5ba){logger[_0xa537('0xd')](_0xa537('0x1e'),_0x2aa5ba[_0xa537('0x10')],_0x5129ef);_0x153ed4(_0x4a1d24[_0xa537('0xd')](0x1f4,_0x2aa5ba['message']));});});}; \ No newline at end of file +var _0xbf39=['include','model','map','stringify','ShowFreshdeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xbf39,0xc5));var _0x9bf3=function(_0x45c0c1,_0x52e01e){_0x45c0c1=_0x45c0c1-0x0;var _0x207f7b=_0xbf39[_0x45c0c1];return _0x207f7b;};'use strict';var _=require('lodash');var util=require(_0x9bf3('0x0'));var moment=require(_0x9bf3('0x1'));var BPromise=require(_0x9bf3('0x2'));var rs=require(_0x9bf3('0x3'));var fs=require('fs');var Redis=require(_0x9bf3('0x4'));var db=require(_0x9bf3('0x5'))['db'];var utils=require(_0x9bf3('0x6'));var logger=require('../../config/logger')(_0x9bf3('0x7'));var config=require(_0x9bf3('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9bf3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c1869,_0x462469,_0x481930){return new BPromise(function(_0x45e042,_0x154844){return client['request'](_0x2c1869,_0x481930)[_0x9bf3('0xa')](function(_0x449dc7){logger[_0x9bf3('0xb')](_0x9bf3('0xc'),_0x462469,'request\x20sent');logger[_0x9bf3('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x462469,_0x9bf3('0xe'),JSON['stringify'](_0x449dc7));if(_0x449dc7[_0x9bf3('0xf')]){if(_0x449dc7[_0x9bf3('0xf')][_0x9bf3('0x10')]===0x1f4){logger['error'](_0x9bf3('0xc'),_0x462469,_0x449dc7[_0x9bf3('0xf')]['message']);return _0x154844(_0x449dc7[_0x9bf3('0xf')]['message']);}logger[_0x9bf3('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x462469,_0x449dc7[_0x9bf3('0xf')][_0x9bf3('0x11')]);return _0x45e042(_0x449dc7[_0x9bf3('0xf')]['message']);}else{logger[_0x9bf3('0xb')](_0x9bf3('0xc'),_0x462469,_0x9bf3('0xe'));_0x45e042(_0x449dc7[_0x9bf3('0x12')][_0x9bf3('0x11')]);}})[_0x9bf3('0x13')](function(_0x18509b){logger[_0x9bf3('0xf')](_0x9bf3('0xc'),_0x462469,_0x18509b);_0x154844(_0x18509b);});});}exports[_0x9bf3('0x14')]=function(_0x2912d5){var _0x19ec90=this;return new Promise(function(_0x21f9e1,_0x297f9a){return db['FreshdeskAccount'][_0x9bf3('0x15')]({'raw':_0x2912d5[_0x9bf3('0x16')]?_0x2912d5['options'][_0x9bf3('0x17')]===undefined?!![]:![]:!![],'where':_0x2912d5[_0x9bf3('0x16')]?_0x2912d5[_0x9bf3('0x16')][_0x9bf3('0x18')]||null:null,'attributes':_0x2912d5[_0x9bf3('0x16')]?_0x2912d5[_0x9bf3('0x16')][_0x9bf3('0x19')]||null:null,'limit':_0x2912d5['options']?_0x2912d5['options'][_0x9bf3('0x1a')]||null:null,'include':_0x2912d5[_0x9bf3('0x16')]?_0x2912d5[_0x9bf3('0x16')][_0x9bf3('0x1b')]?_['map'](_0x2912d5['options']['include'],function(_0x507683){return{'model':db[_0x507683[_0x9bf3('0x1c')]],'as':_0x507683['as'],'attributes':_0x507683[_0x9bf3('0x19')],'include':_0x507683[_0x9bf3('0x1b')]?_[_0x9bf3('0x1d')](_0x507683[_0x9bf3('0x1b')],function(_0x54f098){return{'model':db[_0x54f098[_0x9bf3('0x1c')]],'as':_0x54f098['as'],'attributes':_0x54f098[_0x9bf3('0x19')],'include':_0x54f098[_0x9bf3('0x1b')]?_['map'](_0x54f098[_0x9bf3('0x1b')],function(_0x2baa10){return{'model':db[_0x2baa10[_0x9bf3('0x1c')]],'as':_0x2baa10['as'],'attributes':_0x2baa10[_0x9bf3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9bf3('0xa')](function(_0x2860b9){logger[_0x9bf3('0xb')](_0x9bf3('0x14'),_0x2912d5);logger[_0x9bf3('0xd')](_0x9bf3('0x14'),_0x2912d5,JSON[_0x9bf3('0x1e')](_0x2860b9));_0x21f9e1(_0x2860b9);})[_0x9bf3('0x13')](function(_0x5b8624){logger[_0x9bf3('0xf')](_0x9bf3('0x14'),_0x5b8624[_0x9bf3('0x11')],_0x2912d5);_0x297f9a(_0x19ec90[_0x9bf3('0xf')](0x1f4,_0x5b8624[_0x9bf3('0x11')]));});});};exports['ShowFreshdeskAccount']=function(_0x5003b2){var _0x521c11=this;return new Promise(function(_0x4ef289,_0x10ce5b){return db['FreshdeskAccount']['find']({'raw':_0x5003b2[_0x9bf3('0x16')]?_0x5003b2[_0x9bf3('0x16')][_0x9bf3('0x17')]===undefined?!![]:![]:!![],'where':_0x5003b2[_0x9bf3('0x16')]?_0x5003b2['options'][_0x9bf3('0x18')]||null:null,'attributes':_0x5003b2[_0x9bf3('0x16')]?_0x5003b2['options']['attributes']||null:null,'include':_0x5003b2[_0x9bf3('0x16')]?_0x5003b2['options']['include']?_[_0x9bf3('0x1d')](_0x5003b2[_0x9bf3('0x16')]['include'],function(_0x50d5f9){return{'model':db[_0x50d5f9[_0x9bf3('0x1c')]],'as':_0x50d5f9['as'],'attributes':_0x50d5f9[_0x9bf3('0x19')],'include':_0x50d5f9[_0x9bf3('0x1b')]?_['map'](_0x50d5f9['include'],function(_0x372381){return{'model':db[_0x372381[_0x9bf3('0x1c')]],'as':_0x372381['as'],'attributes':_0x372381[_0x9bf3('0x19')],'include':_0x372381['include']?_[_0x9bf3('0x1d')](_0x372381[_0x9bf3('0x1b')],function(_0x29dbbb){return{'model':db[_0x29dbbb[_0x9bf3('0x1c')]],'as':_0x29dbbb['as'],'attributes':_0x29dbbb[_0x9bf3('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9bf3('0xa')](function(_0x5a371e){logger[_0x9bf3('0xb')](_0x9bf3('0x1f'),_0x5003b2);logger[_0x9bf3('0xd')](_0x9bf3('0x1f'),_0x5003b2,JSON[_0x9bf3('0x1e')](_0x5a371e));_0x4ef289(_0x5a371e);})['catch'](function(_0x42c85f){logger[_0x9bf3('0xf')](_0x9bf3('0x1f'),_0x42c85f[_0x9bf3('0x11')],_0x5003b2);_0x10ce5b(_0x521c11[_0x9bf3('0xf')](0x1f4,_0x42c85f['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3d46514..392a9fc 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 _0xb206=['/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','show','get','/:id/fields','getFields'];(function(_0x11b40d,_0x3a55eb){var _0x1c73ce=function(_0x5105ff){while(--_0x5105ff){_0x11b40d['push'](_0x11b40d['shift']());}};_0x1c73ce(++_0x3a55eb);}(_0xb206,0xbb));var _0x6b20=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xb206[_0x5e6cb8];return _0x3faeb3;};'use strict';var multer=require(_0x6b20('0x0'));var util=require(_0x6b20('0x1'));var path=require('path');var timeout=require(_0x6b20('0x2'));var express=require(_0x6b20('0x3'));var router=express[_0x6b20('0x4')]();var fs_extra=require(_0x6b20('0x5'));var auth=require(_0x6b20('0x6'));var interaction=require(_0x6b20('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x6b20('0x8')](),controller['index']);router['get']('/:id',auth[_0x6b20('0x8')](),controller[_0x6b20('0x9')]);router[_0x6b20('0xa')](_0x6b20('0xb'),auth[_0x6b20('0x8')](),controller[_0x6b20('0xc')]);router[_0x6b20('0xa')](_0x6b20('0xd'),auth[_0x6b20('0x8')](),controller['getSubjects']);router[_0x6b20('0xa')](_0x6b20('0xe'),auth[_0x6b20('0x8')](),controller['getDescriptions']);router[_0x6b20('0xa')](_0x6b20('0xf'),auth[_0x6b20('0x8')](),controller[_0x6b20('0x10')]);router[_0x6b20('0x11')]('/',auth[_0x6b20('0x8')](),controller[_0x6b20('0x12')]);router['post'](_0x6b20('0xf'),auth['isAuthenticated'](),controller['setTags']);router[_0x6b20('0x13')]('/:id',auth[_0x6b20('0x8')](),controller[_0x6b20('0x14')]);router[_0x6b20('0x15')](_0x6b20('0x16'),auth[_0x6b20('0x8')](),controller[_0x6b20('0x17')]);module[_0x6b20('0x18')]=router; \ No newline at end of file +var _0xd0b9=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd0b9,0xeb));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9d0b('0x0'));var util=require(_0x9d0b('0x1'));var path=require('path');var timeout=require(_0x9d0b('0x2'));var express=require(_0x9d0b('0x3'));var router=express[_0x9d0b('0x4')]();var fs_extra=require(_0x9d0b('0x5'));var auth=require(_0x9d0b('0x6'));var interaction=require(_0x9d0b('0x7'));var config=require(_0x9d0b('0x8'));var controller=require(_0x9d0b('0x9'));router[_0x9d0b('0xa')]('/',auth[_0x9d0b('0xb')](),controller['index']);router[_0x9d0b('0xa')](_0x9d0b('0xc'),auth[_0x9d0b('0xb')](),controller['show']);router[_0x9d0b('0xa')](_0x9d0b('0xd'),auth[_0x9d0b('0xb')](),controller[_0x9d0b('0xe')]);router[_0x9d0b('0xa')](_0x9d0b('0xf'),auth['isAuthenticated'](),controller[_0x9d0b('0x10')]);router['get'](_0x9d0b('0x11'),auth[_0x9d0b('0xb')](),controller[_0x9d0b('0x12')]);router['get'](_0x9d0b('0x13'),auth[_0x9d0b('0xb')](),controller[_0x9d0b('0x14')]);router[_0x9d0b('0x15')]('/',auth[_0x9d0b('0xb')](),controller['create']);router[_0x9d0b('0x15')]('/:id/tags',auth[_0x9d0b('0xb')](),controller[_0x9d0b('0x16')]);router[_0x9d0b('0x17')](_0x9d0b('0xc'),auth[_0x9d0b('0xb')](),controller[_0x9d0b('0x18')]);router[_0x9d0b('0x19')](_0x9d0b('0xc'),auth[_0x9d0b('0xb')](),controller[_0x9d0b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8fa3461..8d95d7c 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 _0xd5e9=['STRING','sequelize','exports'];(function(_0x2d55b6,_0x1e9fc8){var _0x5517db=function(_0x54e691){while(--_0x54e691){_0x2d55b6['push'](_0x2d55b6['shift']());}};_0x5517db(++_0x1e9fc8);}(_0xd5e9,0x1ae));var _0x9d5e=function(_0x2903ec,_0x4adec2){_0x2903ec=_0x2903ec-0x0;var _0x50251f=_0xd5e9[_0x2903ec];return _0x50251f;};'use strict';var Sequelize=require(_0x9d5e('0x0'));module[_0x9d5e('0x1')]={'name':{'type':Sequelize[_0x9d5e('0x2')]},'description':{'type':Sequelize[_0x9d5e('0x2')]}}; \ No newline at end of file +var _0x8abc=['exports','STRING','sequelize'];(function(_0x53ed59,_0x4beb34){var _0x5834ca=function(_0x5f51f0){while(--_0x5f51f0){_0x53ed59['push'](_0x53ed59['shift']());}};_0x5834ca(++_0x4beb34);}(_0x8abc,0xc2));var _0xc8ab=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0x8abc[_0x41cb4b];return _0x1719c1;};'use strict';var Sequelize=require(_0xc8ab('0x0'));module[_0xc8ab('0x1')]={'name':{'type':Sequelize[_0xc8ab('0x2')]},'description':{'type':Sequelize[_0xc8ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 56fe18e..f11e252 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 _0xdbd1=['params','includeAll','find','catch','create','body','FreshdeskField','pick','nolimit','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','name','index','FreshdeskConfiguration','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show'];(function(_0x1f6691,_0x3a3d46){var _0xf786b6=function(_0x2afbdb){while(--_0x2afbdb){_0x1f6691['push'](_0x1f6691['shift']());}};_0xf786b6(++_0x3a3d46);}(_0xdbd1,0x151));var _0x1dbd=function(_0x3b4de2,_0x525d6b){_0x3b4de2=_0x3b4de2-0x0;var _0x530dfa=_0xdbd1[_0x3b4de2];return _0x530dfa;};'use strict';var emlformat=require(_0x1dbd('0x0'));var rimraf=require(_0x1dbd('0x1'));var zipdir=require(_0x1dbd('0x2'));var jsonpatch=require(_0x1dbd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1dbd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1dbd('0x5'));var sox=require(_0x1dbd('0x6'));var csv=require(_0x1dbd('0x7'));var ejs=require(_0x1dbd('0x8'));var fs=require('fs');var fs_extra=require(_0x1dbd('0x9'));var _=require(_0x1dbd('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1dbd('0xb'));var deskjs=require(_0x1dbd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1dbd('0xd'));var Papa=require('papaparse');var Redis=require(_0x1dbd('0xe'));var authService=require(_0x1dbd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dbd('0x10'));var logger=require(_0x1dbd('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x1dbd('0x12'));var licenseUtil=require(_0x1dbd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a42a7,_0x4c50ce){_0x4c50ce=_0x4c50ce||0xcc;return function(_0x13be99){if(_0x13be99){return _0x2a42a7[_0x1dbd('0x14')](_0x4c50ce);}return _0x2a42a7[_0x1dbd('0x15')](_0x4c50ce)['end']();};}function respondWithResult(_0x173941,_0x5b5cbd){_0x5b5cbd=_0x5b5cbd||0xc8;return function(_0x295473){if(_0x295473){return _0x173941[_0x1dbd('0x15')](_0x5b5cbd)[_0x1dbd('0x16')](_0x295473);}};}function respondWithFilteredResult(_0x2f1f6b,_0x39c586){return function(_0x24b0e9){if(_0x24b0e9){var _0x554657=typeof _0x39c586[_0x1dbd('0x17')]==='undefined'&&typeof _0x39c586[_0x1dbd('0x18')]===_0x1dbd('0x19');var _0x5ca4eb=_0x24b0e9['count'];var _0x182c6e=_0x554657?0x0:_0x39c586['offset'];var _0x393a20=_0x554657?_0x24b0e9[_0x1dbd('0x1a')]:_0x39c586[_0x1dbd('0x17')]+_0x39c586[_0x1dbd('0x18')];var _0x32522e;if(_0x393a20>=_0x5ca4eb){_0x393a20=_0x5ca4eb;_0x32522e=0xc8;}else{_0x32522e=0xce;}_0x2f1f6b[_0x1dbd('0x15')](_0x32522e);return _0x2f1f6b[_0x1dbd('0x1b')](_0x1dbd('0x1c'),_0x182c6e+'-'+_0x393a20+'/'+_0x5ca4eb)[_0x1dbd('0x16')](_0x24b0e9);}return null;};}function patchUpdates(_0x36ed0b){return function(_0xb6b0f){try{jsonpatch[_0x1dbd('0x1d')](_0xb6b0f,_0x36ed0b,!![]);}catch(_0x36e3fe){return BPromise[_0x1dbd('0x1e')](_0x36e3fe);}return _0xb6b0f['save']();};}function saveUpdates(_0x2cc69e,_0x2bcdef){return function(_0x13c333){if(_0x13c333){return _0x13c333[_0x1dbd('0x1f')](_0x2cc69e)[_0x1dbd('0x20')](function(_0x1a4389){return _0x1a4389;});}return null;};}function removeEntity(_0x377daa,_0x4ba718){return function(_0xa214a7){if(_0xa214a7){return _0xa214a7[_0x1dbd('0x21')]()['then'](function(){_0x377daa[_0x1dbd('0x15')](0xcc)[_0x1dbd('0x22')]();});}};}function handleEntityNotFound(_0x22b059,_0x2557dd){return function(_0x1aa128){if(!_0x1aa128){_0x22b059[_0x1dbd('0x14')](0x194);}return _0x1aa128;};}function handleError(_0xb68a16,_0x3dbe78){_0x3dbe78=_0x3dbe78||0x1f4;return function(_0x7be125){logger[_0x1dbd('0x23')](_0x7be125['stack']);if(_0x7be125[_0x1dbd('0x24')]){delete _0x7be125['name'];}_0xb68a16[_0x1dbd('0x15')](_0x3dbe78)['send'](_0x7be125);};}exports[_0x1dbd('0x25')]=function(_0x5148c7,_0x4f5e62){var _0x6525ca={},_0x2bbfbb={},_0x37f892={'count':0x0,'rows':[]};var _0x35ee0c=_['map'](db[_0x1dbd('0x26')][_0x1dbd('0x27')],function(_0x3b0312){return{'name':_0x3b0312[_0x1dbd('0x28')],'type':_0x3b0312[_0x1dbd('0x29')]['key']};});_0x2bbfbb[_0x1dbd('0x2a')]=_[_0x1dbd('0x2b')](_0x35ee0c,_0x1dbd('0x24'));_0x2bbfbb['query']=_[_0x1dbd('0x2c')](_0x5148c7[_0x1dbd('0x2d')]);_0x2bbfbb['filters']=_['intersection'](_0x2bbfbb[_0x1dbd('0x2a')],_0x2bbfbb[_0x1dbd('0x2d')]);_0x6525ca[_0x1dbd('0x2e')]=_[_0x1dbd('0x2f')](_0x2bbfbb[_0x1dbd('0x2a')],qs['fields'](_0x5148c7[_0x1dbd('0x2d')][_0x1dbd('0x30')]));_0x6525ca[_0x1dbd('0x2e')]=_0x6525ca[_0x1dbd('0x2e')][_0x1dbd('0x31')]?_0x6525ca[_0x1dbd('0x2e')]:_0x2bbfbb[_0x1dbd('0x2a')];if(!_0x5148c7[_0x1dbd('0x2d')][_0x1dbd('0x32')]('nolimit')){_0x6525ca['limit']=qs[_0x1dbd('0x18')](_0x5148c7['query'][_0x1dbd('0x18')]);_0x6525ca['offset']=qs[_0x1dbd('0x17')](_0x5148c7['query'][_0x1dbd('0x17')]);}_0x6525ca[_0x1dbd('0x33')]=qs[_0x1dbd('0x34')](_0x5148c7[_0x1dbd('0x2d')]['sort']);_0x6525ca[_0x1dbd('0x35')]=qs[_0x1dbd('0x36')](_['pick'](_0x5148c7[_0x1dbd('0x2d')],_0x2bbfbb['filters']),_0x35ee0c);if(_0x5148c7[_0x1dbd('0x2d')][_0x1dbd('0x37')]){_0x6525ca[_0x1dbd('0x35')]=_[_0x1dbd('0x38')](_0x6525ca['where'],{'$or':_[_0x1dbd('0x2b')](_0x35ee0c,function(_0x45789b){if(_0x45789b[_0x1dbd('0x29')]!==_0x1dbd('0x39')){var _0x2e9349={};_0x2e9349[_0x45789b[_0x1dbd('0x24')]]={'$like':'%'+_0x5148c7['query'][_0x1dbd('0x37')]+'%'};return _0x2e9349;}})});}_0x6525ca=_[_0x1dbd('0x38')]({},_0x6525ca,_0x5148c7[_0x1dbd('0x3a')]);var _0x41fb0c={'where':_0x6525ca[_0x1dbd('0x35')]};return db['FreshdeskConfiguration']['count'](_0x41fb0c)[_0x1dbd('0x20')](function(_0x28f05d){_0x37f892[_0x1dbd('0x1a')]=_0x28f05d;if(_0x5148c7[_0x1dbd('0x2d')]['includeAll']){_0x6525ca[_0x1dbd('0x3b')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x1dbd('0x3c')](_0x6525ca);})['then'](function(_0x28f247){_0x37f892[_0x1dbd('0x3d')]=_0x28f247;return _0x37f892;})[_0x1dbd('0x20')](respondWithFilteredResult(_0x4f5e62,_0x6525ca))['catch'](handleError(_0x4f5e62,null));};exports[_0x1dbd('0x3e')]=function(_0x51e493,_0x584d1c){var _0xdb14c={'raw':![],'where':{'id':_0x51e493[_0x1dbd('0x3f')]['id']}},_0x2e8642={};_0x2e8642['model']=_[_0x1dbd('0x2c')](db[_0x1dbd('0x26')][_0x1dbd('0x27')]);_0x2e8642[_0x1dbd('0x2d')]=_[_0x1dbd('0x2c')](_0x51e493[_0x1dbd('0x2d')]);_0x2e8642[_0x1dbd('0x36')]=_[_0x1dbd('0x2f')](_0x2e8642[_0x1dbd('0x2a')],_0x2e8642[_0x1dbd('0x2d')]);_0xdb14c[_0x1dbd('0x2e')]=_['intersection'](_0x2e8642['model'],qs[_0x1dbd('0x30')](_0x51e493[_0x1dbd('0x2d')]['fields']));_0xdb14c['attributes']=_0xdb14c[_0x1dbd('0x2e')][_0x1dbd('0x31')]?_0xdb14c['attributes']:_0x2e8642['model'];if(_0x51e493[_0x1dbd('0x2d')][_0x1dbd('0x40')]){_0xdb14c[_0x1dbd('0x3b')]=[{'all':!![]}];}_0xdb14c=_[_0x1dbd('0x38')]({},_0xdb14c,_0x51e493[_0x1dbd('0x3a')]);return db['FreshdeskConfiguration'][_0x1dbd('0x41')](_0xdb14c)[_0x1dbd('0x20')](handleEntityNotFound(_0x584d1c,null))[_0x1dbd('0x20')](respondWithResult(_0x584d1c,null))[_0x1dbd('0x42')](handleError(_0x584d1c,null));};exports[_0x1dbd('0x43')]=function(_0xce1eff,_0x2fac4d){return db[_0x1dbd('0x26')][_0x1dbd('0x43')](_0xce1eff[_0x1dbd('0x44')],{})['then'](respondWithResult(_0x2fac4d,0xc9))['catch'](handleError(_0x2fac4d,null));};exports['update']=function(_0x55561e,_0x3c60b4){if(_0x55561e[_0x1dbd('0x44')]['id']){delete _0x55561e[_0x1dbd('0x44')]['id'];}return db[_0x1dbd('0x26')][_0x1dbd('0x41')]({'where':{'id':_0x55561e[_0x1dbd('0x3f')]['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0x3c60b4,null))['then'](saveUpdates(_0x55561e[_0x1dbd('0x44')],null))[_0x1dbd('0x20')](respondWithResult(_0x3c60b4,null))[_0x1dbd('0x42')](handleError(_0x3c60b4,null));};exports['destroy']=function(_0x310283,_0x138d92){return db['FreshdeskConfiguration'][_0x1dbd('0x41')]({'where':{'id':_0x310283[_0x1dbd('0x3f')]['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0x138d92,null))[_0x1dbd('0x20')](removeEntity(_0x138d92,null))['catch'](handleError(_0x138d92,null));};exports['getFields']=function(_0x2e128f,_0x2b503f,_0x5c4f8f){var _0x21d29f={};var _0x4603df={};var _0x59fd3a;var _0x1989f9;return db[_0x1dbd('0x26')]['findOne']({'where':{'id':_0x2e128f['params']['id']}})['then'](handleEntityNotFound(_0x2b503f,null))[_0x1dbd('0x20')](function(_0x474826){if(_0x474826){_0x59fd3a=_0x474826;_0x4603df[_0x1dbd('0x2a')]=_[_0x1dbd('0x2c')](db[_0x1dbd('0x45')]['rawAttributes']);_0x4603df[_0x1dbd('0x2d')]=_[_0x1dbd('0x2c')](_0x2e128f[_0x1dbd('0x2d')]);_0x4603df[_0x1dbd('0x36')]=_[_0x1dbd('0x2f')](_0x4603df[_0x1dbd('0x2a')],_0x4603df[_0x1dbd('0x2d')]);_0x21d29f['attributes']=_['intersection'](_0x4603df[_0x1dbd('0x2a')],qs[_0x1dbd('0x30')](_0x2e128f[_0x1dbd('0x2d')][_0x1dbd('0x30')]));_0x21d29f[_0x1dbd('0x2e')]=_0x21d29f[_0x1dbd('0x2e')][_0x1dbd('0x31')]?_0x21d29f[_0x1dbd('0x2e')]:_0x4603df[_0x1dbd('0x2a')];_0x21d29f[_0x1dbd('0x33')]=qs[_0x1dbd('0x34')](_0x2e128f[_0x1dbd('0x2d')][_0x1dbd('0x34')]);_0x21d29f[_0x1dbd('0x35')]=qs[_0x1dbd('0x36')](_[_0x1dbd('0x46')](_0x2e128f[_0x1dbd('0x2d')],_0x4603df[_0x1dbd('0x36')]));if(_0x2e128f[_0x1dbd('0x2d')]['filter']){_0x21d29f[_0x1dbd('0x35')]=_[_0x1dbd('0x38')](_0x21d29f['where'],{'$or':_['map'](_0x21d29f[_0x1dbd('0x2e')],function(_0xcec08e){var _0x185cc9={};_0x185cc9[_0xcec08e]={'$like':'%'+_0x2e128f[_0x1dbd('0x2d')][_0x1dbd('0x37')]+'%'};return _0x185cc9;})});}_0x21d29f=_[_0x1dbd('0x38')]({},_0x21d29f,_0x2e128f[_0x1dbd('0x3a')]);return _0x59fd3a['getFields'](_0x21d29f);}})['then'](function(_0x377d89){if(_0x377d89){_0x1989f9=_0x377d89['length'];if(!_0x2e128f[_0x1dbd('0x2d')][_0x1dbd('0x32')](_0x1dbd('0x47'))){_0x21d29f[_0x1dbd('0x18')]=qs[_0x1dbd('0x18')](_0x2e128f[_0x1dbd('0x2d')]['limit']);_0x21d29f['offset']=qs['offset'](_0x2e128f[_0x1dbd('0x2d')][_0x1dbd('0x17')]);}return _0x59fd3a[_0x1dbd('0x48')](_0x21d29f);}})['then'](function(_0x265245){if(_0x265245){return _0x265245?{'count':_0x1989f9,'rows':_0x265245}:null;}})[_0x1dbd('0x20')](respondWithResult(_0x2b503f,null))[_0x1dbd('0x42')](handleError(_0x2b503f,null));};exports[_0x1dbd('0x49')]=function(_0x1e1f34,_0xc2ffff,_0x16e486){var _0x333d58={};var _0x3a9d92={};var _0x2e4a18;var _0x499345;return db['FreshdeskConfiguration'][_0x1dbd('0x4a')]({'where':{'id':_0x1e1f34[_0x1dbd('0x3f')]['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0xc2ffff,null))[_0x1dbd('0x20')](function(_0x39ba5d){if(_0x39ba5d){_0x2e4a18=_0x39ba5d;_0x3a9d92[_0x1dbd('0x2a')]=_[_0x1dbd('0x2c')](db[_0x1dbd('0x45')]['rawAttributes']);_0x3a9d92[_0x1dbd('0x2d')]=_[_0x1dbd('0x2c')](_0x1e1f34[_0x1dbd('0x2d')]);_0x3a9d92[_0x1dbd('0x36')]=_['intersection'](_0x3a9d92[_0x1dbd('0x2a')],_0x3a9d92['query']);_0x333d58['attributes']=_['intersection'](_0x3a9d92[_0x1dbd('0x2a')],qs[_0x1dbd('0x30')](_0x1e1f34['query'][_0x1dbd('0x30')]));_0x333d58[_0x1dbd('0x2e')]=_0x333d58[_0x1dbd('0x2e')]['length']?_0x333d58['attributes']:_0x3a9d92[_0x1dbd('0x2a')];_0x333d58[_0x1dbd('0x33')]=qs['sort'](_0x1e1f34[_0x1dbd('0x2d')][_0x1dbd('0x34')]);_0x333d58[_0x1dbd('0x35')]=qs[_0x1dbd('0x36')](_[_0x1dbd('0x46')](_0x1e1f34[_0x1dbd('0x2d')],_0x3a9d92[_0x1dbd('0x36')]));if(_0x1e1f34[_0x1dbd('0x2d')][_0x1dbd('0x37')]){_0x333d58['where']=_[_0x1dbd('0x38')](_0x333d58['where'],{'$or':_[_0x1dbd('0x2b')](_0x333d58['attributes'],function(_0x4473bb){var _0x2f7365={};_0x2f7365[_0x4473bb]={'$like':'%'+_0x1e1f34['query'][_0x1dbd('0x37')]+'%'};return _0x2f7365;})});}_0x333d58=_[_0x1dbd('0x38')]({},_0x333d58,_0x1e1f34[_0x1dbd('0x3a')]);return _0x2e4a18['getSubjects'](_0x333d58);}})[_0x1dbd('0x20')](function(_0x412253){if(_0x412253){_0x499345=_0x412253[_0x1dbd('0x31')];if(!_0x1e1f34[_0x1dbd('0x2d')][_0x1dbd('0x32')]('nolimit')){_0x333d58[_0x1dbd('0x18')]=qs[_0x1dbd('0x18')](_0x1e1f34[_0x1dbd('0x2d')][_0x1dbd('0x18')]);_0x333d58[_0x1dbd('0x17')]=qs[_0x1dbd('0x17')](_0x1e1f34[_0x1dbd('0x2d')][_0x1dbd('0x17')]);}return _0x2e4a18[_0x1dbd('0x49')](_0x333d58);}})[_0x1dbd('0x20')](function(_0xec7727){if(_0xec7727){return _0xec7727?{'count':_0x499345,'rows':_0xec7727}:null;}})[_0x1dbd('0x20')](respondWithResult(_0xc2ffff,null))[_0x1dbd('0x42')](handleError(_0xc2ffff,null));};exports[_0x1dbd('0x4b')]=function(_0x2934e7,_0x2a5712,_0x4ee156){var _0x8a4c56={};var _0x5c6246={};var _0x2646c1;var _0x2a7baf;return db[_0x1dbd('0x26')][_0x1dbd('0x4a')]({'where':{'id':_0x2934e7['params']['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0x2a5712,null))['then'](function(_0x4a1bd7){if(_0x4a1bd7){_0x2646c1=_0x4a1bd7;_0x5c6246[_0x1dbd('0x2a')]=_[_0x1dbd('0x2c')](db[_0x1dbd('0x45')][_0x1dbd('0x27')]);_0x5c6246['query']=_[_0x1dbd('0x2c')](_0x2934e7['query']);_0x5c6246['filters']=_[_0x1dbd('0x2f')](_0x5c6246[_0x1dbd('0x2a')],_0x5c6246[_0x1dbd('0x2d')]);_0x8a4c56[_0x1dbd('0x2e')]=_[_0x1dbd('0x2f')](_0x5c6246[_0x1dbd('0x2a')],qs['fields'](_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x30')]));_0x8a4c56['attributes']=_0x8a4c56[_0x1dbd('0x2e')]['length']?_0x8a4c56[_0x1dbd('0x2e')]:_0x5c6246[_0x1dbd('0x2a')];_0x8a4c56[_0x1dbd('0x33')]=qs[_0x1dbd('0x34')](_0x2934e7['query'][_0x1dbd('0x34')]);_0x8a4c56['where']=qs['filters'](_[_0x1dbd('0x46')](_0x2934e7['query'],_0x5c6246[_0x1dbd('0x36')]));if(_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x37')]){_0x8a4c56[_0x1dbd('0x35')]=_[_0x1dbd('0x38')](_0x8a4c56[_0x1dbd('0x35')],{'$or':_[_0x1dbd('0x2b')](_0x8a4c56[_0x1dbd('0x2e')],function(_0x31bef9){var _0x1cd9c3={};_0x1cd9c3[_0x31bef9]={'$like':'%'+_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x37')]+'%'};return _0x1cd9c3;})});}_0x8a4c56=_[_0x1dbd('0x38')]({},_0x8a4c56,_0x2934e7[_0x1dbd('0x3a')]);return _0x2646c1[_0x1dbd('0x4b')](_0x8a4c56);}})[_0x1dbd('0x20')](function(_0x1bef3e){if(_0x1bef3e){_0x2a7baf=_0x1bef3e[_0x1dbd('0x31')];if(!_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x32')](_0x1dbd('0x47'))){_0x8a4c56['limit']=qs[_0x1dbd('0x18')](_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x18')]);_0x8a4c56[_0x1dbd('0x17')]=qs[_0x1dbd('0x17')](_0x2934e7[_0x1dbd('0x2d')][_0x1dbd('0x17')]);}return _0x2646c1[_0x1dbd('0x4b')](_0x8a4c56);}})[_0x1dbd('0x20')](function(_0x3b8bd2){if(_0x3b8bd2){return _0x3b8bd2?{'count':_0x2a7baf,'rows':_0x3b8bd2}:null;}})[_0x1dbd('0x20')](respondWithResult(_0x2a5712,null))[_0x1dbd('0x42')](handleError(_0x2a5712,null));};exports[_0x1dbd('0x4c')]=function(_0x9c3199,_0x3a5dc1,_0x124923){var _0x249a6d={};var _0x1b0a5a={};var _0x2bdebb;var _0x4e0fee;return db[_0x1dbd('0x26')][_0x1dbd('0x4a')]({'where':{'id':_0x9c3199[_0x1dbd('0x3f')]['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0x3a5dc1,null))[_0x1dbd('0x20')](function(_0x36065f){if(_0x36065f){_0x2bdebb=_0x36065f;_0x1b0a5a[_0x1dbd('0x2a')]=_[_0x1dbd('0x2c')](db[_0x1dbd('0x4d')][_0x1dbd('0x27')]);_0x1b0a5a[_0x1dbd('0x2d')]=_[_0x1dbd('0x2c')](_0x9c3199[_0x1dbd('0x2d')]);_0x1b0a5a['filters']=_[_0x1dbd('0x2f')](_0x1b0a5a['model'],_0x1b0a5a[_0x1dbd('0x2d')]);_0x249a6d['attributes']=_['intersection'](_0x1b0a5a[_0x1dbd('0x2a')],qs[_0x1dbd('0x30')](_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x30')]));_0x249a6d[_0x1dbd('0x2e')]=_0x249a6d[_0x1dbd('0x2e')][_0x1dbd('0x31')]?_0x249a6d[_0x1dbd('0x2e')]:_0x1b0a5a[_0x1dbd('0x2a')];_0x249a6d[_0x1dbd('0x33')]=qs[_0x1dbd('0x34')](_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x34')]);_0x249a6d[_0x1dbd('0x35')]=qs[_0x1dbd('0x36')](_[_0x1dbd('0x46')](_0x9c3199[_0x1dbd('0x2d')],_0x1b0a5a[_0x1dbd('0x36')]));if(_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x37')]){_0x249a6d[_0x1dbd('0x35')]=_[_0x1dbd('0x38')](_0x249a6d[_0x1dbd('0x35')],{'$or':_[_0x1dbd('0x2b')](_0x249a6d['attributes'],function(_0x3047a0){var _0x180fcf={};_0x180fcf[_0x3047a0]={'$like':'%'+_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x37')]+'%'};return _0x180fcf;})});}_0x249a6d=_[_0x1dbd('0x38')]({},_0x249a6d,_0x9c3199[_0x1dbd('0x3a')]);return _0x2bdebb[_0x1dbd('0x4c')](_0x249a6d);}})[_0x1dbd('0x20')](function(_0x1e1cde){if(_0x1e1cde){_0x4e0fee=_0x1e1cde[_0x1dbd('0x31')];if(!_0x9c3199['query'][_0x1dbd('0x32')](_0x1dbd('0x47'))){_0x249a6d[_0x1dbd('0x18')]=qs[_0x1dbd('0x18')](_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x18')]);_0x249a6d[_0x1dbd('0x17')]=qs[_0x1dbd('0x17')](_0x9c3199[_0x1dbd('0x2d')][_0x1dbd('0x17')]);}return _0x2bdebb[_0x1dbd('0x4c')](_0x249a6d);}})['then'](function(_0x9ca86b){if(_0x9ca86b){return _0x9ca86b?{'count':_0x4e0fee,'rows':_0x9ca86b}:null;}})['then'](respondWithResult(_0x3a5dc1,null))[_0x1dbd('0x42')](handleError(_0x3a5dc1,null));};exports['setTags']=function(_0xcc7553,_0x4c9d1e,_0x60457){if(_0xcc7553[_0x1dbd('0x44')]['id']){delete _0xcc7553[_0x1dbd('0x44')]['id'];}return db[_0x1dbd('0x26')][_0x1dbd('0x4a')]({'where':{'id':_0xcc7553['params']['id']}})[_0x1dbd('0x20')](handleEntityNotFound(_0x4c9d1e,null))[_0x1dbd('0x20')](function(_0x9ce560){if(_0x9ce560){return _0x9ce560[_0x1dbd('0x4e')](_0xcc7553[_0x1dbd('0x44')][_0x1dbd('0x4f')]||[]);}return null;})[_0x1dbd('0x20')](respondWithResult(_0x4c9d1e,null))[_0x1dbd('0x42')](handleError(_0x4c9d1e,null));}; \ No newline at end of file +var _0x05c9=['options','find','create','body','findOne','FreshdeskField','pick','getFields','getSubjects','nolimit','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','end','stack','name','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','intersection','include'];(function(_0x8e4931,_0x10fb37){var _0x312141=function(_0x2f3ece){while(--_0x2f3ece){_0x8e4931['push'](_0x8e4931['shift']());}};_0x312141(++_0x10fb37);}(_0x05c9,0xb8));var _0x905c=function(_0x593241,_0x1e1e53){_0x593241=_0x593241-0x0;var _0x7dd43b=_0x05c9[_0x593241];return _0x7dd43b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x905c('0x0'));var zipdir=require(_0x905c('0x1'));var jsonpatch=require(_0x905c('0x2'));var rp=require(_0x905c('0x3'));var moment=require(_0x905c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x905c('0x5'));var util=require(_0x905c('0x6'));var path=require(_0x905c('0x7'));var sox=require(_0x905c('0x8'));var csv=require(_0x905c('0x9'));var ejs=require(_0x905c('0xa'));var fs=require('fs');var fs_extra=require(_0x905c('0xb'));var _=require('lodash');var squel=require(_0x905c('0xc'));var crypto=require(_0x905c('0xd'));var jsforce=require(_0x905c('0xe'));var deskjs=require(_0x905c('0xf'));var toCsv=require(_0x905c('0x9'));var querystring=require(_0x905c('0x10'));var Papa=require('papaparse');var Redis=require(_0x905c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x905c('0x12'));var as=require(_0x905c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x905c('0x14'))(_0x905c('0x15'));var utils=require('../../config/utils');var config=require(_0x905c('0x16'));var licenseUtil=require(_0x905c('0x17'));var db=require(_0x905c('0x18'))['db'];function respondWithStatusCode(_0x172df0,_0x2196fe){_0x2196fe=_0x2196fe||0xcc;return function(_0x452c04){if(_0x452c04){return _0x172df0[_0x905c('0x19')](_0x2196fe);}return _0x172df0[_0x905c('0x1a')](_0x2196fe)['end']();};}function respondWithResult(_0x45baa5,_0x1c48dd){_0x1c48dd=_0x1c48dd||0xc8;return function(_0x435dd1){if(_0x435dd1){return _0x45baa5[_0x905c('0x1a')](_0x1c48dd)[_0x905c('0x1b')](_0x435dd1);}};}function respondWithFilteredResult(_0x1182fe,_0x3d530b){return function(_0x39ee49){if(_0x39ee49){var _0x2ab0a6=typeof _0x3d530b['offset']===_0x905c('0x1c')&&typeof _0x3d530b[_0x905c('0x1d')]==='undefined';var _0x484376=_0x39ee49[_0x905c('0x1e')];var _0x1e868e=_0x2ab0a6?0x0:_0x3d530b[_0x905c('0x1f')];var _0xbc5a8d=_0x2ab0a6?_0x39ee49[_0x905c('0x1e')]:_0x3d530b[_0x905c('0x1f')]+_0x3d530b[_0x905c('0x1d')];var _0xd90fc8;if(_0xbc5a8d>=_0x484376){_0xbc5a8d=_0x484376;_0xd90fc8=0xc8;}else{_0xd90fc8=0xce;}_0x1182fe[_0x905c('0x1a')](_0xd90fc8);return _0x1182fe[_0x905c('0x20')](_0x905c('0x21'),_0x1e868e+'-'+_0xbc5a8d+'/'+_0x484376)[_0x905c('0x1b')](_0x39ee49);}return null;};}function patchUpdates(_0x52ff9e){return function(_0x2ecf69){try{jsonpatch[_0x905c('0x22')](_0x2ecf69,_0x52ff9e,!![]);}catch(_0x3ad3a7){return BPromise[_0x905c('0x23')](_0x3ad3a7);}return _0x2ecf69['save']();};}function saveUpdates(_0x4e06d0,_0x2fd629){return function(_0x94bb63){if(_0x94bb63){return _0x94bb63[_0x905c('0x24')](_0x4e06d0)['then'](function(_0x43d6f9){return _0x43d6f9;});}return null;};}function removeEntity(_0x253ae2,_0x348817){return function(_0x543463){if(_0x543463){return _0x543463[_0x905c('0x25')]()[_0x905c('0x26')](function(){_0x253ae2[_0x905c('0x1a')](0xcc)[_0x905c('0x27')]();});}};}function handleEntityNotFound(_0x1771e0,_0x2f91d1){return function(_0x44650b){if(!_0x44650b){_0x1771e0[_0x905c('0x19')](0x194);}return _0x44650b;};}function handleError(_0x3245f9,_0x2aa5ea){_0x2aa5ea=_0x2aa5ea||0x1f4;return function(_0x41d79e){logger['error'](_0x41d79e[_0x905c('0x28')]);if(_0x41d79e['name']){delete _0x41d79e[_0x905c('0x29')];}_0x3245f9[_0x905c('0x1a')](_0x2aa5ea)['send'](_0x41d79e);};}exports[_0x905c('0x2a')]=function(_0x224a01,_0x3ee95c){var _0x168845={},_0x37500a={},_0x1b6063={'count':0x0,'rows':[]};var _0x130158=_[_0x905c('0x2b')](db[_0x905c('0x2c')]['rawAttributes'],function(_0x5c5aef){return{'name':_0x5c5aef[_0x905c('0x2d')],'type':_0x5c5aef[_0x905c('0x2e')][_0x905c('0x2f')]};});_0x37500a[_0x905c('0x30')]=_[_0x905c('0x2b')](_0x130158,_0x905c('0x29'));_0x37500a['query']=_['keys'](_0x224a01[_0x905c('0x31')]);_0x37500a['filters']=_['intersection'](_0x37500a[_0x905c('0x30')],_0x37500a[_0x905c('0x31')]);_0x168845[_0x905c('0x32')]=_['intersection'](_0x37500a[_0x905c('0x30')],qs[_0x905c('0x33')](_0x224a01[_0x905c('0x31')][_0x905c('0x33')]));_0x168845[_0x905c('0x32')]=_0x168845['attributes'][_0x905c('0x34')]?_0x168845['attributes']:_0x37500a[_0x905c('0x30')];if(!_0x224a01['query'][_0x905c('0x35')]('nolimit')){_0x168845[_0x905c('0x1d')]=qs[_0x905c('0x1d')](_0x224a01[_0x905c('0x31')][_0x905c('0x1d')]);_0x168845[_0x905c('0x1f')]=qs[_0x905c('0x1f')](_0x224a01[_0x905c('0x31')][_0x905c('0x1f')]);}_0x168845[_0x905c('0x36')]=qs[_0x905c('0x37')](_0x224a01['query'][_0x905c('0x37')]);_0x168845[_0x905c('0x38')]=qs['filters'](_['pick'](_0x224a01[_0x905c('0x31')],_0x37500a[_0x905c('0x39')]),_0x130158);if(_0x224a01[_0x905c('0x31')][_0x905c('0x3a')]){_0x168845[_0x905c('0x38')]=_[_0x905c('0x3b')](_0x168845[_0x905c('0x38')],{'$or':_[_0x905c('0x2b')](_0x130158,function(_0x56dc32){if(_0x56dc32[_0x905c('0x2e')]!==_0x905c('0x3c')){var _0x444cc1={};_0x444cc1[_0x56dc32[_0x905c('0x29')]]={'$like':'%'+_0x224a01[_0x905c('0x31')][_0x905c('0x3a')]+'%'};return _0x444cc1;}})});}_0x168845=_[_0x905c('0x3b')]({},_0x168845,_0x224a01['options']);var _0x2fc24c={'where':_0x168845[_0x905c('0x38')]};return db[_0x905c('0x2c')][_0x905c('0x1e')](_0x2fc24c)[_0x905c('0x26')](function(_0x4fdcfb){_0x1b6063['count']=_0x4fdcfb;if(_0x224a01[_0x905c('0x31')][_0x905c('0x3d')]){_0x168845['include']=[{'all':!![]}];}return db[_0x905c('0x2c')][_0x905c('0x3e')](_0x168845);})[_0x905c('0x26')](function(_0x326b63){_0x1b6063[_0x905c('0x3f')]=_0x326b63;return _0x1b6063;})[_0x905c('0x26')](respondWithFilteredResult(_0x3ee95c,_0x168845))[_0x905c('0x40')](handleError(_0x3ee95c,null));};exports[_0x905c('0x41')]=function(_0x5980d6,_0x4df70e){var _0x1aab5a={'raw':![],'where':{'id':_0x5980d6[_0x905c('0x42')]['id']}},_0x3d5320={};_0x3d5320['model']=_['keys'](db[_0x905c('0x2c')][_0x905c('0x43')]);_0x3d5320[_0x905c('0x31')]=_[_0x905c('0x44')](_0x5980d6[_0x905c('0x31')]);_0x3d5320[_0x905c('0x39')]=_[_0x905c('0x45')](_0x3d5320[_0x905c('0x30')],_0x3d5320['query']);_0x1aab5a[_0x905c('0x32')]=_[_0x905c('0x45')](_0x3d5320[_0x905c('0x30')],qs[_0x905c('0x33')](_0x5980d6['query'][_0x905c('0x33')]));_0x1aab5a[_0x905c('0x32')]=_0x1aab5a[_0x905c('0x32')]['length']?_0x1aab5a[_0x905c('0x32')]:_0x3d5320[_0x905c('0x30')];if(_0x5980d6[_0x905c('0x31')][_0x905c('0x3d')]){_0x1aab5a[_0x905c('0x46')]=[{'all':!![]}];}_0x1aab5a=_['merge']({},_0x1aab5a,_0x5980d6[_0x905c('0x47')]);return db[_0x905c('0x2c')][_0x905c('0x48')](_0x1aab5a)[_0x905c('0x26')](handleEntityNotFound(_0x4df70e,null))[_0x905c('0x26')](respondWithResult(_0x4df70e,null))[_0x905c('0x40')](handleError(_0x4df70e,null));};exports[_0x905c('0x49')]=function(_0x1de443,_0x209dbe){return db[_0x905c('0x2c')][_0x905c('0x49')](_0x1de443[_0x905c('0x4a')],{})['then'](respondWithResult(_0x209dbe,0xc9))[_0x905c('0x40')](handleError(_0x209dbe,null));};exports[_0x905c('0x24')]=function(_0x418604,_0x337a3b){if(_0x418604[_0x905c('0x4a')]['id']){delete _0x418604[_0x905c('0x4a')]['id'];}return db[_0x905c('0x2c')][_0x905c('0x48')]({'where':{'id':_0x418604['params']['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x337a3b,null))[_0x905c('0x26')](saveUpdates(_0x418604[_0x905c('0x4a')],null))[_0x905c('0x26')](respondWithResult(_0x337a3b,null))[_0x905c('0x40')](handleError(_0x337a3b,null));};exports[_0x905c('0x25')]=function(_0x4d5675,_0x54fbf1){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4d5675[_0x905c('0x42')]['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x54fbf1,null))['then'](removeEntity(_0x54fbf1,null))[_0x905c('0x40')](handleError(_0x54fbf1,null));};exports['getFields']=function(_0x2a4bd4,_0x2d6ea5,_0x5a2441){var _0x2b5235={};var _0x4cb198={};var _0x339047;var _0x1088dd;return db['FreshdeskConfiguration'][_0x905c('0x4b')]({'where':{'id':_0x2a4bd4[_0x905c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d6ea5,null))['then'](function(_0x5cbe48){if(_0x5cbe48){_0x339047=_0x5cbe48;_0x4cb198[_0x905c('0x30')]=_[_0x905c('0x44')](db[_0x905c('0x4c')]['rawAttributes']);_0x4cb198[_0x905c('0x31')]=_[_0x905c('0x44')](_0x2a4bd4['query']);_0x4cb198[_0x905c('0x39')]=_[_0x905c('0x45')](_0x4cb198['model'],_0x4cb198['query']);_0x2b5235[_0x905c('0x32')]=_[_0x905c('0x45')](_0x4cb198['model'],qs[_0x905c('0x33')](_0x2a4bd4['query']['fields']));_0x2b5235[_0x905c('0x32')]=_0x2b5235[_0x905c('0x32')][_0x905c('0x34')]?_0x2b5235[_0x905c('0x32')]:_0x4cb198[_0x905c('0x30')];_0x2b5235[_0x905c('0x36')]=qs[_0x905c('0x37')](_0x2a4bd4['query']['sort']);_0x2b5235['where']=qs['filters'](_[_0x905c('0x4d')](_0x2a4bd4[_0x905c('0x31')],_0x4cb198['filters']));if(_0x2a4bd4['query'][_0x905c('0x3a')]){_0x2b5235[_0x905c('0x38')]=_[_0x905c('0x3b')](_0x2b5235[_0x905c('0x38')],{'$or':_[_0x905c('0x2b')](_0x2b5235[_0x905c('0x32')],function(_0x2038cb){var _0x2411ca={};_0x2411ca[_0x2038cb]={'$like':'%'+_0x2a4bd4['query'][_0x905c('0x3a')]+'%'};return _0x2411ca;})});}_0x2b5235=_['merge']({},_0x2b5235,_0x2a4bd4[_0x905c('0x47')]);return _0x339047[_0x905c('0x4e')](_0x2b5235);}})[_0x905c('0x26')](function(_0x312097){if(_0x312097){_0x1088dd=_0x312097[_0x905c('0x34')];if(!_0x2a4bd4[_0x905c('0x31')][_0x905c('0x35')]('nolimit')){_0x2b5235[_0x905c('0x1d')]=qs[_0x905c('0x1d')](_0x2a4bd4[_0x905c('0x31')]['limit']);_0x2b5235[_0x905c('0x1f')]=qs[_0x905c('0x1f')](_0x2a4bd4[_0x905c('0x31')][_0x905c('0x1f')]);}return _0x339047[_0x905c('0x4e')](_0x2b5235);}})[_0x905c('0x26')](function(_0x1e1d6e){if(_0x1e1d6e){return _0x1e1d6e?{'count':_0x1088dd,'rows':_0x1e1d6e}:null;}})[_0x905c('0x26')](respondWithResult(_0x2d6ea5,null))[_0x905c('0x40')](handleError(_0x2d6ea5,null));};exports[_0x905c('0x4f')]=function(_0x1dc86b,_0x597d4b,_0x454c0e){var _0x12dc13={};var _0x2c2e68={};var _0x13d31c;var _0x3bc4db;return db[_0x905c('0x2c')][_0x905c('0x4b')]({'where':{'id':_0x1dc86b[_0x905c('0x42')]['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x597d4b,null))[_0x905c('0x26')](function(_0x583c6){if(_0x583c6){_0x13d31c=_0x583c6;_0x2c2e68[_0x905c('0x30')]=_[_0x905c('0x44')](db['FreshdeskField'][_0x905c('0x43')]);_0x2c2e68[_0x905c('0x31')]=_[_0x905c('0x44')](_0x1dc86b[_0x905c('0x31')]);_0x2c2e68[_0x905c('0x39')]=_[_0x905c('0x45')](_0x2c2e68['model'],_0x2c2e68['query']);_0x12dc13['attributes']=_[_0x905c('0x45')](_0x2c2e68['model'],qs[_0x905c('0x33')](_0x1dc86b['query']['fields']));_0x12dc13[_0x905c('0x32')]=_0x12dc13['attributes']['length']?_0x12dc13[_0x905c('0x32')]:_0x2c2e68[_0x905c('0x30')];_0x12dc13['order']=qs[_0x905c('0x37')](_0x1dc86b[_0x905c('0x31')]['sort']);_0x12dc13[_0x905c('0x38')]=qs[_0x905c('0x39')](_[_0x905c('0x4d')](_0x1dc86b[_0x905c('0x31')],_0x2c2e68[_0x905c('0x39')]));if(_0x1dc86b[_0x905c('0x31')][_0x905c('0x3a')]){_0x12dc13[_0x905c('0x38')]=_[_0x905c('0x3b')](_0x12dc13[_0x905c('0x38')],{'$or':_[_0x905c('0x2b')](_0x12dc13[_0x905c('0x32')],function(_0x27e531){var _0x2bdd34={};_0x2bdd34[_0x27e531]={'$like':'%'+_0x1dc86b[_0x905c('0x31')][_0x905c('0x3a')]+'%'};return _0x2bdd34;})});}_0x12dc13=_[_0x905c('0x3b')]({},_0x12dc13,_0x1dc86b[_0x905c('0x47')]);return _0x13d31c[_0x905c('0x4f')](_0x12dc13);}})[_0x905c('0x26')](function(_0x1a36c4){if(_0x1a36c4){_0x3bc4db=_0x1a36c4['length'];if(!_0x1dc86b[_0x905c('0x31')][_0x905c('0x35')](_0x905c('0x50'))){_0x12dc13[_0x905c('0x1d')]=qs[_0x905c('0x1d')](_0x1dc86b[_0x905c('0x31')][_0x905c('0x1d')]);_0x12dc13['offset']=qs['offset'](_0x1dc86b[_0x905c('0x31')][_0x905c('0x1f')]);}return _0x13d31c[_0x905c('0x4f')](_0x12dc13);}})[_0x905c('0x26')](function(_0x4df790){if(_0x4df790){return _0x4df790?{'count':_0x3bc4db,'rows':_0x4df790}:null;}})[_0x905c('0x26')](respondWithResult(_0x597d4b,null))[_0x905c('0x40')](handleError(_0x597d4b,null));};exports['getDescriptions']=function(_0x58d667,_0x3fda53,_0x115f99){var _0x4cebb0={};var _0x229384={};var _0x21af6a;var _0x55c5a5;return db['FreshdeskConfiguration'][_0x905c('0x4b')]({'where':{'id':_0x58d667[_0x905c('0x42')]['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x3fda53,null))[_0x905c('0x26')](function(_0x1c3e27){if(_0x1c3e27){_0x21af6a=_0x1c3e27;_0x229384[_0x905c('0x30')]=_[_0x905c('0x44')](db[_0x905c('0x4c')][_0x905c('0x43')]);_0x229384['query']=_[_0x905c('0x44')](_0x58d667[_0x905c('0x31')]);_0x229384[_0x905c('0x39')]=_[_0x905c('0x45')](_0x229384[_0x905c('0x30')],_0x229384[_0x905c('0x31')]);_0x4cebb0['attributes']=_[_0x905c('0x45')](_0x229384[_0x905c('0x30')],qs['fields'](_0x58d667[_0x905c('0x31')]['fields']));_0x4cebb0[_0x905c('0x32')]=_0x4cebb0[_0x905c('0x32')]['length']?_0x4cebb0[_0x905c('0x32')]:_0x229384[_0x905c('0x30')];_0x4cebb0['order']=qs[_0x905c('0x37')](_0x58d667['query']['sort']);_0x4cebb0['where']=qs[_0x905c('0x39')](_['pick'](_0x58d667[_0x905c('0x31')],_0x229384[_0x905c('0x39')]));if(_0x58d667[_0x905c('0x31')]['filter']){_0x4cebb0[_0x905c('0x38')]=_[_0x905c('0x3b')](_0x4cebb0['where'],{'$or':_['map'](_0x4cebb0['attributes'],function(_0x578650){var _0x20739a={};_0x20739a[_0x578650]={'$like':'%'+_0x58d667[_0x905c('0x31')]['filter']+'%'};return _0x20739a;})});}_0x4cebb0=_[_0x905c('0x3b')]({},_0x4cebb0,_0x58d667[_0x905c('0x47')]);return _0x21af6a['getDescriptions'](_0x4cebb0);}})[_0x905c('0x26')](function(_0x50d083){if(_0x50d083){_0x55c5a5=_0x50d083['length'];if(!_0x58d667[_0x905c('0x31')][_0x905c('0x35')](_0x905c('0x50'))){_0x4cebb0['limit']=qs[_0x905c('0x1d')](_0x58d667['query'][_0x905c('0x1d')]);_0x4cebb0[_0x905c('0x1f')]=qs[_0x905c('0x1f')](_0x58d667[_0x905c('0x31')][_0x905c('0x1f')]);}return _0x21af6a[_0x905c('0x51')](_0x4cebb0);}})[_0x905c('0x26')](function(_0x727764){if(_0x727764){return _0x727764?{'count':_0x55c5a5,'rows':_0x727764}:null;}})[_0x905c('0x26')](respondWithResult(_0x3fda53,null))[_0x905c('0x40')](handleError(_0x3fda53,null));};exports['getTags']=function(_0x20fb35,_0x21e592,_0x12d422){var _0x5a9827={};var _0x3aa1c2={};var _0x56900c;var _0x1aa001;return db[_0x905c('0x2c')][_0x905c('0x4b')]({'where':{'id':_0x20fb35['params']['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x21e592,null))[_0x905c('0x26')](function(_0x40b917){if(_0x40b917){_0x56900c=_0x40b917;_0x3aa1c2['model']=_[_0x905c('0x44')](db['Tag'][_0x905c('0x43')]);_0x3aa1c2['query']=_[_0x905c('0x44')](_0x20fb35[_0x905c('0x31')]);_0x3aa1c2['filters']=_['intersection'](_0x3aa1c2['model'],_0x3aa1c2['query']);_0x5a9827['attributes']=_[_0x905c('0x45')](_0x3aa1c2[_0x905c('0x30')],qs[_0x905c('0x33')](_0x20fb35[_0x905c('0x31')][_0x905c('0x33')]));_0x5a9827[_0x905c('0x32')]=_0x5a9827[_0x905c('0x32')]['length']?_0x5a9827[_0x905c('0x32')]:_0x3aa1c2[_0x905c('0x30')];_0x5a9827[_0x905c('0x36')]=qs[_0x905c('0x37')](_0x20fb35['query'][_0x905c('0x37')]);_0x5a9827[_0x905c('0x38')]=qs[_0x905c('0x39')](_[_0x905c('0x4d')](_0x20fb35[_0x905c('0x31')],_0x3aa1c2[_0x905c('0x39')]));if(_0x20fb35[_0x905c('0x31')][_0x905c('0x3a')]){_0x5a9827['where']=_[_0x905c('0x3b')](_0x5a9827[_0x905c('0x38')],{'$or':_[_0x905c('0x2b')](_0x5a9827[_0x905c('0x32')],function(_0x1885dc){var _0x43c4a5={};_0x43c4a5[_0x1885dc]={'$like':'%'+_0x20fb35[_0x905c('0x31')]['filter']+'%'};return _0x43c4a5;})});}_0x5a9827=_[_0x905c('0x3b')]({},_0x5a9827,_0x20fb35['options']);return _0x56900c['getTags'](_0x5a9827);}})['then'](function(_0x434136){if(_0x434136){_0x1aa001=_0x434136[_0x905c('0x34')];if(!_0x20fb35[_0x905c('0x31')][_0x905c('0x35')](_0x905c('0x50'))){_0x5a9827[_0x905c('0x1d')]=qs[_0x905c('0x1d')](_0x20fb35[_0x905c('0x31')][_0x905c('0x1d')]);_0x5a9827[_0x905c('0x1f')]=qs[_0x905c('0x1f')](_0x20fb35[_0x905c('0x31')][_0x905c('0x1f')]);}return _0x56900c[_0x905c('0x52')](_0x5a9827);}})[_0x905c('0x26')](function(_0x6739c7){if(_0x6739c7){return _0x6739c7?{'count':_0x1aa001,'rows':_0x6739c7}:null;}})[_0x905c('0x26')](respondWithResult(_0x21e592,null))[_0x905c('0x40')](handleError(_0x21e592,null));};exports[_0x905c('0x53')]=function(_0x1495e0,_0x1afb61,_0x6c1cfd){if(_0x1495e0['body']['id']){delete _0x1495e0[_0x905c('0x4a')]['id'];}return db[_0x905c('0x2c')][_0x905c('0x4b')]({'where':{'id':_0x1495e0[_0x905c('0x42')]['id']}})[_0x905c('0x26')](handleEntityNotFound(_0x1afb61,null))[_0x905c('0x26')](function(_0x6ad722){if(_0x6ad722){return _0x6ad722[_0x905c('0x53')](_0x1495e0[_0x905c('0x4a')][_0x905c('0x54')]||[]);}return null;})[_0x905c('0x26')](respondWithResult(_0x1afb61,null))[_0x905c('0x40')](handleError(_0x1afb61,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a535a6d..4786a0b 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 _0xf75e=['bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf75e,0x168));var _0xef75=function(_0x133715,_0x1f7fe7){_0x133715=_0x133715-0x0;var _0x13c50a=_0xf75e[_0x133715];return _0x13c50a;};'use strict';var _=require(_0xef75('0x0'));var util=require('util');var logger=require(_0xef75('0x1'))(_0xef75('0x2'));var moment=require(_0xef75('0x3'));var BPromise=require(_0xef75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef75('0x5'));var rimraf=require(_0xef75('0x6'));var config=require(_0xef75('0x7'));var attributes=require(_0xef75('0x8'));module[_0xef75('0x9')]=function(_0x49b731,_0x140156){return _0x49b731[_0xef75('0xa')](_0xef75('0xb'),attributes,{'tableName':_0xef75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc80e=['define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2aedd3,_0x1aff78){var _0x39bf3c=function(_0x19ed60){while(--_0x19ed60){_0x2aedd3['push'](_0x2aedd3['shift']());}};_0x39bf3c(++_0x1aff78);}(_0xc80e,0x19b));var _0xec80=function(_0x51cabf,_0x2828db){_0x51cabf=_0x51cabf-0x0;var _0x517538=_0xc80e[_0x51cabf];return _0x517538;};'use strict';var _=require(_0xec80('0x0'));var util=require(_0xec80('0x1'));var logger=require(_0xec80('0x2'))(_0xec80('0x3'));var moment=require('moment');var BPromise=require(_0xec80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec80('0x5'));var rimraf=require(_0xec80('0x6'));var config=require(_0xec80('0x7'));var attributes=require(_0xec80('0x8'));module['exports']=function(_0x1c9573,_0x585cb7){return _0x1c9573[_0xec80('0x9')](_0xec80('0xa'),attributes,{'tableName':_0xec80('0xb'),'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 0787e74..697df7a 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 _0x761c=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x245132,_0x4d1437){var _0x28abad=function(_0x1b66d4){while(--_0x1b66d4){_0x245132['push'](_0x245132['shift']());}};_0x28abad(++_0x4d1437);}(_0x761c,0x1b3));var _0xc761=function(_0x37c20e,_0x372c2d){_0x37c20e=_0x37c20e-0x0;var _0x28c89f=_0x761c[_0x37c20e];return _0x28c89f;};'use strict';var _=require('lodash');var util=require(_0xc761('0x0'));var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require(_0xc761('0x3'));var fs=require('fs');var Redis=require(_0xc761('0x4'));var db=require(_0xc761('0x5'))['db'];var utils=require(_0xc761('0x6'));var logger=require('../../config/logger')(_0xc761('0x7'));var config=require(_0xc761('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33de79,_0x30f08f,_0x52ffda){return new BPromise(function(_0x37c228,_0x522ba6){return client[_0xc761('0xa')](_0x33de79,_0x52ffda)[_0xc761('0xb')](function(_0x5d417b){logger[_0xc761('0xc')](_0xc761('0xd'),_0x30f08f,_0xc761('0xe'));logger[_0xc761('0xf')](_0xc761('0x10'),_0x30f08f,_0xc761('0xe'),JSON['stringify'](_0x5d417b));if(_0x5d417b[_0xc761('0x11')]){if(_0x5d417b[_0xc761('0x11')]['code']===0x1f4){logger['error'](_0xc761('0xd'),_0x30f08f,_0x5d417b[_0xc761('0x11')][_0xc761('0x12')]);return _0x522ba6(_0x5d417b['error'][_0xc761('0x12')]);}logger[_0xc761('0x11')](_0xc761('0xd'),_0x30f08f,_0x5d417b['error']['message']);return _0x37c228(_0x5d417b[_0xc761('0x11')][_0xc761('0x12')]);}else{logger[_0xc761('0xc')](_0xc761('0xd'),_0x30f08f,'request\x20sent');_0x37c228(_0x5d417b[_0xc761('0x13')][_0xc761('0x12')]);}})['catch'](function(_0x19e790){logger[_0xc761('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x30f08f,_0x19e790);_0x522ba6(_0x19e790);});});} \ No newline at end of file +var _0xa6d2=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2821a9,_0x54d53f){var _0x30bf24=function(_0x4ed1f5){while(--_0x4ed1f5){_0x2821a9['push'](_0x2821a9['shift']());}};_0x30bf24(++_0x54d53f);}(_0xa6d2,0xd7));var _0x2a6d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6d2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x2a6d('0x0'));var moment=require(_0x2a6d('0x1'));var BPromise=require(_0x2a6d('0x2'));var rs=require(_0x2a6d('0x3'));var fs=require('fs');var Redis=require(_0x2a6d('0x4'));var db=require(_0x2a6d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a6d('0x6'))(_0x2a6d('0x7'));var config=require(_0x2a6d('0x8'));var jayson=require(_0x2a6d('0x9'));var client=jayson[_0x2a6d('0xa')][_0x2a6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a6af0,_0x1047f2,_0x53a24d){return new BPromise(function(_0x5c453b,_0x2bf9de){return client[_0x2a6d('0xc')](_0x5a6af0,_0x53a24d)['then'](function(_0x30e444){logger[_0x2a6d('0xd')](_0x2a6d('0xe'),_0x1047f2,_0x2a6d('0xf'));logger['debug'](_0x2a6d('0x10'),_0x1047f2,_0x2a6d('0xf'),JSON[_0x2a6d('0x11')](_0x30e444));if(_0x30e444[_0x2a6d('0x12')]){if(_0x30e444[_0x2a6d('0x12')]['code']===0x1f4){logger['error'](_0x2a6d('0xe'),_0x1047f2,_0x30e444[_0x2a6d('0x12')][_0x2a6d('0x13')]);return _0x2bf9de(_0x30e444[_0x2a6d('0x12')][_0x2a6d('0x13')]);}logger[_0x2a6d('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1047f2,_0x30e444['error']['message']);return _0x5c453b(_0x30e444['error'][_0x2a6d('0x13')]);}else{logger[_0x2a6d('0xd')](_0x2a6d('0xe'),_0x1047f2,_0x2a6d('0xf'));_0x5c453b(_0x30e444['result']['message']);}})[_0x2a6d('0x14')](function(_0x40ea23){logger[_0x2a6d('0x12')](_0x2a6d('0xe'),_0x1047f2,_0x40ea23);_0x2bf9de(_0x40ea23);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index b661691..71a9d15 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 _0x6022=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','update','destroy','exports','util','path','connect-timeout'];(function(_0x8389d7,_0x56499f){var _0x156ade=function(_0x3cb16e){while(--_0x3cb16e){_0x8389d7['push'](_0x8389d7['shift']());}};_0x156ade(++_0x56499f);}(_0x6022,0x10b));var _0x2602=function(_0x192ce9,_0x339ef2){_0x192ce9=_0x192ce9-0x0;var _0x2432b5=_0x6022[_0x192ce9];return _0x2432b5;};'use strict';var multer=require('multer');var util=require(_0x2602('0x0'));var path=require(_0x2602('0x1'));var timeout=require(_0x2602('0x2'));var express=require(_0x2602('0x3'));var router=express[_0x2602('0x4')]();var fs_extra=require(_0x2602('0x5'));var auth=require(_0x2602('0x6'));var interaction=require(_0x2602('0x7'));var config=require('../../config/environment');var controller=require(_0x2602('0x8'));router[_0x2602('0x9')]('/',auth[_0x2602('0xa')](),controller[_0x2602('0xb')]);router[_0x2602('0x9')](_0x2602('0xc'),auth[_0x2602('0xa')](),controller['show']);router[_0x2602('0xd')]('/',auth[_0x2602('0xa')](),controller[_0x2602('0xe')]);router['put'](_0x2602('0xc'),auth[_0x2602('0xa')](),controller[_0x2602('0xf')]);router['delete'](_0x2602('0xc'),auth['isAuthenticated'](),controller[_0x2602('0x10')]);module[_0x2602('0x11')]=router; \ No newline at end of file +var _0xd350=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','get','/:id','show','delete','exports'];(function(_0x314323,_0x2b5ce9){var _0x56925=function(_0x325f6a){while(--_0x325f6a){_0x314323['push'](_0x314323['shift']());}};_0x56925(++_0x2b5ce9);}(_0xd350,0x9a));var _0x0d35=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0xd350[_0x1fa381];return _0x47eefe;};'use strict';var multer=require(_0x0d35('0x0'));var util=require(_0x0d35('0x1'));var path=require(_0x0d35('0x2'));var timeout=require(_0x0d35('0x3'));var express=require('express');var router=express[_0x0d35('0x4')]();var fs_extra=require(_0x0d35('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0d35('0x6'));var config=require('../../config/environment');var controller=require(_0x0d35('0x7'));router['get']('/',auth[_0x0d35('0x8')](),controller['index']);router[_0x0d35('0x9')](_0x0d35('0xa'),auth['isAuthenticated'](),controller[_0x0d35('0xb')]);router['post']('/',auth[_0x0d35('0x8')](),controller['create']);router['put'](_0x0d35('0xa'),auth[_0x0d35('0x8')](),controller['update']);router[_0x0d35('0xc')](_0x0d35('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0d35('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 33f9c70..035a0cb 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 _0x9300=['string','variable','customVariable','picklist','STRING','exports','ENUM'];(function(_0x26ef30,_0x42b817){var _0x445d62=function(_0x23fd28){while(--_0x23fd28){_0x26ef30['push'](_0x26ef30['shift']());}};_0x445d62(++_0x42b817);}(_0x9300,0x132));var _0x0930=function(_0x1425e8,_0x2c195b){_0x1425e8=_0x1425e8-0x0;var _0x1cd239=_0x9300[_0x1425e8];return _0x1cd239;};'use strict';var Sequelize=require('sequelize');module[_0x0930('0x0')]={'type':{'type':Sequelize[_0x0930('0x1')](_0x0930('0x2'),_0x0930('0x3'),_0x0930('0x4'),'keyValue',_0x0930('0x5')),'defaultValue':_0x0930('0x2')},'content':{'type':Sequelize[_0x0930('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0930('0x1')](_0x0930('0x2'),_0x0930('0x3'),_0x0930('0x4'))},'keyContent':{'type':Sequelize[_0x0930('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0930('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0930('0x6')]}}; \ No newline at end of file +var _0xd858=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x57a2c9,_0x1b48b4){var _0x29b1ed=function(_0x13fcd5){while(--_0x13fcd5){_0x57a2c9['push'](_0x57a2c9['shift']());}};_0x29b1ed(++_0x1b48b4);}(_0xd858,0xc8));var _0x8d85=function(_0x4cd065,_0x18d8b9){_0x4cd065=_0x4cd065-0x0;var _0x189891=_0xd858[_0x4cd065];return _0x189891;};'use strict';var Sequelize=require(_0x8d85('0x0'));module[_0x8d85('0x1')]={'type':{'type':Sequelize[_0x8d85('0x2')](_0x8d85('0x3'),_0x8d85('0x4'),_0x8d85('0x5'),_0x8d85('0x6'),_0x8d85('0x7')),'defaultValue':_0x8d85('0x3')},'content':{'type':Sequelize[_0x8d85('0x8')]},'key':{'type':Sequelize[_0x8d85('0x8')]},'keyType':{'type':Sequelize[_0x8d85('0x2')](_0x8d85('0x3'),'variable',_0x8d85('0x5'))},'keyContent':{'type':Sequelize[_0x8d85('0x8')]},'idField':{'type':Sequelize[_0x8d85('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8d85('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d85('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4a531e2..6ce1a37 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 _0x41bb=['../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','FreshdeskField','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x295aa4,_0x58dcf0){var _0x17ea2f=function(_0x40caaf){while(--_0x40caaf){_0x295aa4['push'](_0x295aa4['shift']());}};_0x17ea2f(++_0x58dcf0);}(_0x41bb,0xc5));var _0xb41b=function(_0x19fcac,_0x58503c){_0x19fcac=_0x19fcac-0x0;var _0x547290=_0x41bb[_0x19fcac];return _0x547290;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['FreshdeskField'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['FreshdeskField']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['FreshdeskField'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['FreshdeskField'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));}; \ No newline at end of file +var _0xc901=['save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','includeAll','find','catch','create','body','params','eml-format','moment','bluebird','util','path','sox','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/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x325736,_0x5a310c){var _0x4d7e25=function(_0x1e41fd){while(--_0x1e41fd){_0x325736['push'](_0x325736['shift']());}};_0x4d7e25(++_0x5a310c);}(_0xc901,0x142));var _0x1c90=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc901[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x1c90('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c90('0x1'));var BPromise=require(_0x1c90('0x2'));var Mustache=require('mustache');var util=require(_0x1c90('0x3'));var path=require(_0x1c90('0x4'));var sox=require(_0x1c90('0x5'));var csv=require(_0x1c90('0x6'));var ejs=require(_0x1c90('0x7'));var fs=require('fs');var fs_extra=require(_0x1c90('0x8'));var _=require(_0x1c90('0x9'));var squel=require(_0x1c90('0xa'));var crypto=require(_0x1c90('0xb'));var jsforce=require(_0x1c90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c90('0x6'));var querystring=require(_0x1c90('0xd'));var Papa=require(_0x1c90('0xe'));var Redis=require(_0x1c90('0xf'));var authService=require(_0x1c90('0x10'));var qs=require(_0x1c90('0x11'));var as=require(_0x1c90('0x12'));var hardwareService=require(_0x1c90('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1c90('0x14'));var config=require(_0x1c90('0x15'));var licenseUtil=require(_0x1c90('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da158,_0x3a38ed){_0x3a38ed=_0x3a38ed||0xcc;return function(_0x3353e3){if(_0x3353e3){return _0x4da158['sendStatus'](_0x3a38ed);}return _0x4da158[_0x1c90('0x17')](_0x3a38ed)[_0x1c90('0x18')]();};}function respondWithResult(_0xf72b98,_0x589c97){_0x589c97=_0x589c97||0xc8;return function(_0x42cb94){if(_0x42cb94){return _0xf72b98['status'](_0x589c97)[_0x1c90('0x19')](_0x42cb94);}};}function respondWithFilteredResult(_0x210ef4,_0x7a88dc){return function(_0x42d8a4){if(_0x42d8a4){var _0x48bd5e=typeof _0x7a88dc[_0x1c90('0x1a')]==='undefined'&&typeof _0x7a88dc[_0x1c90('0x1b')]===_0x1c90('0x1c');var _0x5f1025=_0x42d8a4[_0x1c90('0x1d')];var _0x4ec354=_0x48bd5e?0x0:_0x7a88dc['offset'];var _0x128bf0=_0x48bd5e?_0x42d8a4['count']:_0x7a88dc[_0x1c90('0x1a')]+_0x7a88dc[_0x1c90('0x1b')];var _0x2a5b73;if(_0x128bf0>=_0x5f1025){_0x128bf0=_0x5f1025;_0x2a5b73=0xc8;}else{_0x2a5b73=0xce;}_0x210ef4[_0x1c90('0x17')](_0x2a5b73);return _0x210ef4['set'](_0x1c90('0x1e'),_0x4ec354+'-'+_0x128bf0+'/'+_0x5f1025)['json'](_0x42d8a4);}return null;};}function patchUpdates(_0x525997){return function(_0x38f997){try{jsonpatch[_0x1c90('0x1f')](_0x38f997,_0x525997,!![]);}catch(_0x47fd11){return BPromise[_0x1c90('0x20')](_0x47fd11);}return _0x38f997[_0x1c90('0x21')]();};}function saveUpdates(_0x445664,_0x4074fd){return function(_0x13fc42){if(_0x13fc42){return _0x13fc42[_0x1c90('0x22')](_0x445664)['then'](function(_0x418f4c){return _0x418f4c;});}return null;};}function removeEntity(_0x46baa1,_0xab232a){return function(_0x33c88b){if(_0x33c88b){return _0x33c88b[_0x1c90('0x23')]()[_0x1c90('0x24')](function(){_0x46baa1[_0x1c90('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x64ca90,_0x435c3a){return function(_0x3923a9){if(!_0x3923a9){_0x64ca90['sendStatus'](0x194);}return _0x3923a9;};}function handleError(_0xb5666e,_0x44387f){_0x44387f=_0x44387f||0x1f4;return function(_0x4abffe){logger[_0x1c90('0x25')](_0x4abffe[_0x1c90('0x26')]);if(_0x4abffe['name']){delete _0x4abffe[_0x1c90('0x27')];}_0xb5666e[_0x1c90('0x17')](_0x44387f)[_0x1c90('0x28')](_0x4abffe);};}exports[_0x1c90('0x29')]=function(_0x395edb,_0x111e20){var _0xd0a607={},_0x35c843={},_0x52c308={'count':0x0,'rows':[]};var _0xc1a571=_[_0x1c90('0x2a')](db[_0x1c90('0x2b')][_0x1c90('0x2c')],function(_0x1979de){return{'name':_0x1979de[_0x1c90('0x2d')],'type':_0x1979de[_0x1c90('0x2e')][_0x1c90('0x2f')]};});_0x35c843[_0x1c90('0x30')]=_[_0x1c90('0x2a')](_0xc1a571,_0x1c90('0x27'));_0x35c843['query']=_[_0x1c90('0x31')](_0x395edb[_0x1c90('0x32')]);_0x35c843['filters']=_[_0x1c90('0x33')](_0x35c843['model'],_0x35c843[_0x1c90('0x32')]);_0xd0a607['attributes']=_[_0x1c90('0x33')](_0x35c843['model'],qs[_0x1c90('0x34')](_0x395edb[_0x1c90('0x32')]['fields']));_0xd0a607[_0x1c90('0x35')]=_0xd0a607[_0x1c90('0x35')]['length']?_0xd0a607[_0x1c90('0x35')]:_0x35c843[_0x1c90('0x30')];if(!_0x395edb[_0x1c90('0x32')][_0x1c90('0x36')](_0x1c90('0x37'))){_0xd0a607['limit']=qs['limit'](_0x395edb['query']['limit']);_0xd0a607['offset']=qs[_0x1c90('0x1a')](_0x395edb[_0x1c90('0x32')][_0x1c90('0x1a')]);}_0xd0a607['order']=qs[_0x1c90('0x38')](_0x395edb['query'][_0x1c90('0x38')]);_0xd0a607[_0x1c90('0x39')]=qs['filters'](_['pick'](_0x395edb[_0x1c90('0x32')],_0x35c843[_0x1c90('0x3a')]),_0xc1a571);if(_0x395edb[_0x1c90('0x32')][_0x1c90('0x3b')]){_0xd0a607[_0x1c90('0x39')]=_[_0x1c90('0x3c')](_0xd0a607[_0x1c90('0x39')],{'$or':_['map'](_0xc1a571,function(_0x508025){if(_0x508025[_0x1c90('0x2e')]!==_0x1c90('0x3d')){var _0x134501={};_0x134501[_0x508025[_0x1c90('0x27')]]={'$like':'%'+_0x395edb[_0x1c90('0x32')][_0x1c90('0x3b')]+'%'};return _0x134501;}})});}_0xd0a607=_[_0x1c90('0x3c')]({},_0xd0a607,_0x395edb[_0x1c90('0x3e')]);var _0x398ee9={'where':_0xd0a607[_0x1c90('0x39')]};return db['FreshdeskField'][_0x1c90('0x1d')](_0x398ee9)['then'](function(_0x5a8eea){_0x52c308[_0x1c90('0x1d')]=_0x5a8eea;if(_0x395edb['query']['includeAll']){_0xd0a607[_0x1c90('0x3f')]=[{'all':!![]}];}return db[_0x1c90('0x2b')]['findAll'](_0xd0a607);})[_0x1c90('0x24')](function(_0x3271ea){_0x52c308[_0x1c90('0x40')]=_0x3271ea;return _0x52c308;})[_0x1c90('0x24')](respondWithFilteredResult(_0x111e20,_0xd0a607))['catch'](handleError(_0x111e20,null));};exports['show']=function(_0x19e689,_0x171ca0){var _0x5680fe={'raw':!![],'where':{'id':_0x19e689['params']['id']}},_0x35952a={};_0x35952a[_0x1c90('0x30')]=_[_0x1c90('0x31')](db['FreshdeskField'][_0x1c90('0x2c')]);_0x35952a[_0x1c90('0x32')]=_[_0x1c90('0x31')](_0x19e689[_0x1c90('0x32')]);_0x35952a[_0x1c90('0x3a')]=_[_0x1c90('0x33')](_0x35952a[_0x1c90('0x30')],_0x35952a[_0x1c90('0x32')]);_0x5680fe[_0x1c90('0x35')]=_[_0x1c90('0x33')](_0x35952a[_0x1c90('0x30')],qs['fields'](_0x19e689[_0x1c90('0x32')]['fields']));_0x5680fe[_0x1c90('0x35')]=_0x5680fe['attributes']['length']?_0x5680fe[_0x1c90('0x35')]:_0x35952a[_0x1c90('0x30')];if(_0x19e689[_0x1c90('0x32')][_0x1c90('0x41')]){_0x5680fe[_0x1c90('0x3f')]=[{'all':!![]}];}_0x5680fe=_[_0x1c90('0x3c')]({},_0x5680fe,_0x19e689[_0x1c90('0x3e')]);return db[_0x1c90('0x2b')][_0x1c90('0x42')](_0x5680fe)['then'](handleEntityNotFound(_0x171ca0,null))['then'](respondWithResult(_0x171ca0,null))[_0x1c90('0x43')](handleError(_0x171ca0,null));};exports[_0x1c90('0x44')]=function(_0x68fac8,_0x2d30f5){return db[_0x1c90('0x2b')][_0x1c90('0x44')](_0x68fac8[_0x1c90('0x45')],{})[_0x1c90('0x24')](respondWithResult(_0x2d30f5,0xc9))['catch'](handleError(_0x2d30f5,null));};exports[_0x1c90('0x22')]=function(_0x24016a,_0x9524b6){if(_0x24016a['body']['id']){delete _0x24016a['body']['id'];}return db[_0x1c90('0x2b')]['find']({'where':{'id':_0x24016a[_0x1c90('0x46')]['id']}})['then'](handleEntityNotFound(_0x9524b6,null))['then'](saveUpdates(_0x24016a[_0x1c90('0x45')],null))[_0x1c90('0x24')](respondWithResult(_0x9524b6,null))['catch'](handleError(_0x9524b6,null));};exports['destroy']=function(_0x394177,_0x53f158){return db[_0x1c90('0x2b')][_0x1c90('0x42')]({'where':{'id':_0x394177[_0x1c90('0x46')]['id']}})[_0x1c90('0x24')](handleEntityNotFound(_0x53f158,null))['then'](removeEntity(_0x53f158,null))['catch'](handleError(_0x53f158,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 5ad5751..c0acbc5 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 _0x2743=['rimraf','./intFreshdeskField.attributes','define','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','request-promise'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x2743,0x176));var _0x3274=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3274('0x0'));var util=require(_0x3274('0x1'));var logger=require(_0x3274('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3274('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3274('0x4'));var config=require('../../config/environment');var attributes=require(_0x3274('0x5'));module['exports']=function(_0x24f64a,_0x9f782){return _0x24f64a[_0x3274('0x6')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3274('0x7'),'fields':['idField',_0x3274('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3228=['path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x3bf605,_0xfda59f){var _0x592e91=function(_0x4730fb){while(--_0x4730fb){_0x3bf605['push'](_0x3bf605['shift']());}};_0x592e91(++_0xfda59f);}(_0x3228,0x181));var _0x8322=function(_0x2f4e6a,_0x235880){_0x2f4e6a=_0x2f4e6a-0x0;var _0x37bacf=_0x3228[_0x2f4e6a];return _0x37bacf;};'use strict';var _=require(_0x8322('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8322('0x1'));var moment=require(_0x8322('0x2'));var BPromise=require(_0x8322('0x3'));var rp=require(_0x8322('0x4'));var fs=require('fs');var path=require(_0x8322('0x5'));var rimraf=require(_0x8322('0x6'));var config=require(_0x8322('0x7'));var attributes=require(_0x8322('0x8'));module[_0x8322('0x9')]=function(_0x4979e7,_0x2d3f72){return _0x4979e7[_0x8322('0xa')]('FreshdeskField',attributes,{'tableName':_0x8322('0xb'),'paranoid':![],'indexes':[{'name':_0x8322('0xc'),'fields':[_0x8322('0xd'),_0x8322('0xe')],'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 21fa2b5..3b920e9 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 _0x3ea4=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s'];(function(_0x12b4af,_0x3f83e5){var _0x3f6da4=function(_0x1e94fd){while(--_0x1e94fd){_0x12b4af['push'](_0x12b4af['shift']());}};_0x3f6da4(++_0x3f83e5);}(_0x3ea4,0x190));var _0x43ea=function(_0x256b67,_0x14e47b){_0x256b67=_0x256b67-0x0;var _0x3e2d99=_0x3ea4[_0x256b67];return _0x3e2d99;};'use strict';var _=require(_0x43ea('0x0'));var util=require(_0x43ea('0x1'));var moment=require(_0x43ea('0x2'));var BPromise=require(_0x43ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43ea('0x4'));var db=require(_0x43ea('0x5'))['db'];var utils=require(_0x43ea('0x6'));var logger=require('../../config/logger')(_0x43ea('0x7'));var config=require(_0x43ea('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43ea('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x77b688,_0x22c573,_0x4a5e6f){return new BPromise(function(_0x2b62a8,_0x57e38c){return client[_0x43ea('0xa')](_0x77b688,_0x4a5e6f)['then'](function(_0x14934c){logger[_0x43ea('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x22c573,_0x43ea('0xc'));logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x22c573,_0x43ea('0xc'),JSON[_0x43ea('0xd')](_0x14934c));if(_0x14934c[_0x43ea('0xe')]){if(_0x14934c['error'][_0x43ea('0xf')]===0x1f4){logger[_0x43ea('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x22c573,_0x14934c[_0x43ea('0xe')]['message']);return _0x57e38c(_0x14934c[_0x43ea('0xe')][_0x43ea('0x10')]);}logger['error'](_0x43ea('0x11'),_0x22c573,_0x14934c[_0x43ea('0xe')]['message']);return _0x2b62a8(_0x14934c[_0x43ea('0xe')][_0x43ea('0x10')]);}else{logger[_0x43ea('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x22c573,_0x43ea('0xc'));_0x2b62a8(_0x14934c['result']['message']);}})[_0x43ea('0x12')](function(_0x5d4a88){logger[_0x43ea('0xe')](_0x43ea('0x11'),_0x22c573,_0x5d4a88);_0x57e38c(_0x5d4a88);});});} \ No newline at end of file +var _0x949d=['then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x949d,0xe7));var _0xd949=function(_0x49c1ca,_0x2764f2){_0x49c1ca=_0x49c1ca-0x0;var _0x15379e=_0x949d[_0x49c1ca];return _0x15379e;};'use strict';var _=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var moment=require('moment');var BPromise=require(_0xd949('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd949('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd949('0x4'));var logger=require(_0xd949('0x5'))(_0xd949('0x6'));var config=require(_0xd949('0x7'));var jayson=require(_0xd949('0x8'));var client=jayson[_0xd949('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208cf7,_0x59eed6,_0xc094f1){return new BPromise(function(_0x365378,_0x312cd8){return client[_0xd949('0xa')](_0x208cf7,_0xc094f1)[_0xd949('0xb')](function(_0x35d67c){logger['info'](_0xd949('0xc'),_0x59eed6,_0xd949('0xd'));logger[_0xd949('0xe')](_0xd949('0xf'),_0x59eed6,'request\x20sent',JSON['stringify'](_0x35d67c));if(_0x35d67c[_0xd949('0x10')]){if(_0x35d67c['error'][_0xd949('0x11')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x59eed6,_0x35d67c[_0xd949('0x10')]['message']);return _0x312cd8(_0x35d67c[_0xd949('0x10')][_0xd949('0x12')]);}logger['error'](_0xd949('0xc'),_0x59eed6,_0x35d67c['error'][_0xd949('0x12')]);return _0x365378(_0x35d67c['error'][_0xd949('0x12')]);}else{logger[_0xd949('0x13')](_0xd949('0xc'),_0x59eed6,_0xd949('0xd'));_0x365378(_0x35d67c[_0xd949('0x14')]['message']);}})[_0xd949('0x15')](function(_0x4635ba){logger[_0xd949('0x10')](_0xd949('0xc'),_0x59eed6,_0x4635ba);_0x312cd8(_0x4635ba);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index fb3201e..97c3fcf 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 _0x593e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0xe7d07d,_0x52e4e3){var _0x229e46=function(_0x376839){while(--_0x376839){_0xe7d07d['push'](_0xe7d07d['shift']());}};_0x229e46(++_0x52e4e3);}(_0x593e,0xcb));var _0xe593=function(_0xd6b186,_0x11f279){_0xd6b186=_0xd6b186-0x0;var _0x504439=_0x593e[_0xd6b186];return _0x504439;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var fs_extra=require(_0xe593('0x6'));var auth=require(_0xe593('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x8'));var controller=require(_0xe593('0x9'));router[_0xe593('0xa')]('/',auth[_0xe593('0xb')](),controller[_0xe593('0xc')]);router[_0xe593('0xa')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0xe')]);router[_0xe593('0xa')]('/:id/configurations',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),controller['create']);router[_0xe593('0x11')](_0xe593('0x12'),auth[_0xe593('0xb')](),controller[_0xe593('0x13')]);router[_0xe593('0x14')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0x15')]);router[_0xe593('0x16')](_0xe593('0xd'),auth['isAuthenticated'](),controller[_0xe593('0x17')]);module[_0xe593('0x18')]=router; \ No newline at end of file +var _0xdb94=['isAuthenticated','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','index','/:id','show','get','/:id/configurations'];(function(_0x41c673,_0x397d52){var _0x429cd9=function(_0x39084e){while(--_0x39084e){_0x41c673['push'](_0x41c673['shift']());}};_0x429cd9(++_0x397d52);}(_0xdb94,0xab));var _0x4db9=function(_0x125816,_0x4db4f6){_0x125816=_0x125816-0x0;var _0x45ff99=_0xdb94[_0x125816];return _0x45ff99;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var fs_extra=require(_0x4db9('0x5'));var auth=require(_0x4db9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4db9('0x8')]);router['get'](_0x4db9('0x9'),auth['isAuthenticated'](),controller[_0x4db9('0xa')]);router[_0x4db9('0xb')](_0x4db9('0xc'),auth[_0x4db9('0xd')](),controller[_0x4db9('0xe')]);router[_0x4db9('0xb')](_0x4db9('0xf'),auth[_0x4db9('0xd')](),controller[_0x4db9('0x10')]);router[_0x4db9('0x11')]('/',auth[_0x4db9('0xd')](),controller['create']);router[_0x4db9('0x11')](_0x4db9('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4db9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4db9('0x13')]);router[_0x4db9('0x14')]('/:id',auth[_0x4db9('0xd')](),controller[_0x4db9('0x15')]);module[_0x4db9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index bbe48b2..b92cb46 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 _0x1eba=['exports','STRING','remoteUri','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x1eba[_0x53d172];return _0x1bd0a2;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'name':{'type':Sequelize[_0xa1eb('0x2')]},'description':{'type':Sequelize[_0xa1eb('0x2')]},'username':{'type':Sequelize[_0xa1eb('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa1eb('0x2')],'unique':_0xa1eb('0x3')},'serverUrl':{'type':Sequelize[_0xa1eb('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8603=['remoteUri','exports','STRING'];(function(_0x55a03a,_0x194806){var _0x3ae934=function(_0x4a46cf){while(--_0x4a46cf){_0x55a03a['push'](_0x55a03a['shift']());}};_0x3ae934(++_0x194806);}(_0x8603,0x190));var _0x3860=function(_0x128450,_0x5869ba){_0x128450=_0x128450-0x0;var _0x4d80ed=_0x8603[_0x128450];return _0x4d80ed;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'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 9e387ce..e9e9291 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 _0x83c2=['merge','filter','options','FreshsalesAccount','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','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/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x463d73,_0x471f3d){var _0x2a2f1b=function(_0x403539){while(--_0x403539){_0x463d73['push'](_0x463d73['shift']());}};_0x2a2f1b(++_0x471f3d);}(_0x83c2,0x96));var _0x283c=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x83c2[_0x334fea];return _0x3c5829;};'use strict';var emlformat=require(_0x283c('0x0'));var rimraf=require(_0x283c('0x1'));var zipdir=require(_0x283c('0x2'));var jsonpatch=require(_0x283c('0x3'));var rp=require('request-promise');var moment=require(_0x283c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x283c('0x5'));var path=require(_0x283c('0x6'));var sox=require('sox');var csv=require(_0x283c('0x7'));var ejs=require(_0x283c('0x8'));var fs=require('fs');var fs_extra=require(_0x283c('0x9'));var _=require(_0x283c('0xa'));var squel=require(_0x283c('0xb'));var crypto=require(_0x283c('0xc'));var jsforce=require(_0x283c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x283c('0xe'));var Papa=require(_0x283c('0xf'));var Redis=require('ioredis');var authService=require(_0x283c('0x10'));var qs=require(_0x283c('0x11'));var as=require(_0x283c('0x12'));var hardwareService=require(_0x283c('0x13'));var logger=require(_0x283c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x283c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x283c('0x16'));function respondWithStatusCode(_0x4d34d9,_0x41dd2f){_0x41dd2f=_0x41dd2f||0xcc;return function(_0x2c632a){if(_0x2c632a){return _0x4d34d9['sendStatus'](_0x41dd2f);}return _0x4d34d9[_0x283c('0x17')](_0x41dd2f)['end']();};}function respondWithResult(_0x1e06ee,_0x1e5b4d){_0x1e5b4d=_0x1e5b4d||0xc8;return function(_0x49622e){if(_0x49622e){return _0x1e06ee['status'](_0x1e5b4d)[_0x283c('0x18')](_0x49622e);}};}function respondWithFilteredResult(_0x586c6b,_0x5e45a6){return function(_0x1b2459){if(_0x1b2459){var _0x512972=typeof _0x5e45a6[_0x283c('0x19')]===_0x283c('0x1a')&&typeof _0x5e45a6[_0x283c('0x1b')]===_0x283c('0x1a');var _0x172b67=_0x1b2459['count'];var _0x3e8311=_0x512972?0x0:_0x5e45a6[_0x283c('0x19')];var _0xe0bf17=_0x512972?_0x1b2459['count']:_0x5e45a6[_0x283c('0x19')]+_0x5e45a6[_0x283c('0x1b')];var _0x51c2e1;if(_0xe0bf17>=_0x172b67){_0xe0bf17=_0x172b67;_0x51c2e1=0xc8;}else{_0x51c2e1=0xce;}_0x586c6b[_0x283c('0x17')](_0x51c2e1);return _0x586c6b['set']('Content-Range',_0x3e8311+'-'+_0xe0bf17+'/'+_0x172b67)[_0x283c('0x18')](_0x1b2459);}return null;};}function patchUpdates(_0x447310){return function(_0x114af2){try{jsonpatch[_0x283c('0x1c')](_0x114af2,_0x447310,!![]);}catch(_0x30b14c){return BPromise[_0x283c('0x1d')](_0x30b14c);}return _0x114af2[_0x283c('0x1e')]();};}function saveUpdates(_0x4d4739,_0x2ddd63){return function(_0x49563a){if(_0x49563a){return _0x49563a[_0x283c('0x1f')](_0x4d4739)[_0x283c('0x20')](function(_0x4d33b7){return _0x4d33b7;});}return null;};}function removeEntity(_0x208730,_0x1109d7){return function(_0x20fcf8){if(_0x20fcf8){return _0x20fcf8[_0x283c('0x21')]()['then'](function(){_0x208730['status'](0xcc)[_0x283c('0x22')]();});}};}function handleEntityNotFound(_0x4fa53f,_0x40c379){return function(_0x45ce36){if(!_0x45ce36){_0x4fa53f[_0x283c('0x23')](0x194);}return _0x45ce36;};}function handleError(_0x381d62,_0x4db2d9){_0x4db2d9=_0x4db2d9||0x1f4;return function(_0x41052c){logger['error'](_0x41052c[_0x283c('0x24')]);if(_0x41052c[_0x283c('0x25')]){delete _0x41052c[_0x283c('0x25')];}_0x381d62[_0x283c('0x17')](_0x4db2d9)[_0x283c('0x26')](_0x41052c);};}exports[_0x283c('0x27')]=function(_0x346a2a,_0x16a0fd){var _0x3897f3={},_0x2d15c1={},_0x40c65c={'count':0x0,'rows':[]};var _0x2cacc8=_['map'](db['FreshsalesAccount'][_0x283c('0x28')],function(_0x364226){return{'name':_0x364226[_0x283c('0x29')],'type':_0x364226[_0x283c('0x2a')][_0x283c('0x2b')]};});_0x2d15c1[_0x283c('0x2c')]=_[_0x283c('0x2d')](_0x2cacc8,_0x283c('0x25'));_0x2d15c1[_0x283c('0x2e')]=_[_0x283c('0x2f')](_0x346a2a[_0x283c('0x2e')]);_0x2d15c1[_0x283c('0x30')]=_[_0x283c('0x31')](_0x2d15c1[_0x283c('0x2c')],_0x2d15c1['query']);_0x3897f3['attributes']=_[_0x283c('0x31')](_0x2d15c1['model'],qs[_0x283c('0x32')](_0x346a2a[_0x283c('0x2e')][_0x283c('0x32')]));_0x3897f3['attributes']=_0x3897f3[_0x283c('0x33')][_0x283c('0x34')]?_0x3897f3[_0x283c('0x33')]:_0x2d15c1['model'];if(!_0x346a2a[_0x283c('0x2e')][_0x283c('0x35')]('nolimit')){_0x3897f3[_0x283c('0x1b')]=qs[_0x283c('0x1b')](_0x346a2a[_0x283c('0x2e')][_0x283c('0x1b')]);_0x3897f3[_0x283c('0x19')]=qs[_0x283c('0x19')](_0x346a2a[_0x283c('0x2e')]['offset']);}_0x3897f3[_0x283c('0x36')]=qs[_0x283c('0x37')](_0x346a2a[_0x283c('0x2e')][_0x283c('0x37')]);_0x3897f3[_0x283c('0x38')]=qs[_0x283c('0x30')](_[_0x283c('0x39')](_0x346a2a[_0x283c('0x2e')],_0x2d15c1[_0x283c('0x30')]),_0x2cacc8);if(_0x346a2a[_0x283c('0x2e')]['filter']){_0x3897f3[_0x283c('0x38')]=_[_0x283c('0x3a')](_0x3897f3['where'],{'$or':_['map'](_0x2cacc8,function(_0x578bf7){if(_0x578bf7[_0x283c('0x2a')]!=='VIRTUAL'){var _0x5a36a8={};_0x5a36a8[_0x578bf7[_0x283c('0x25')]]={'$like':'%'+_0x346a2a[_0x283c('0x2e')][_0x283c('0x3b')]+'%'};return _0x5a36a8;}})});}_0x3897f3=_['merge']({},_0x3897f3,_0x346a2a[_0x283c('0x3c')]);var _0x48a88b={'where':_0x3897f3[_0x283c('0x38')]};return db[_0x283c('0x3d')][_0x283c('0x3e')](_0x48a88b)[_0x283c('0x20')](function(_0x50cf39){_0x40c65c[_0x283c('0x3e')]=_0x50cf39;if(_0x346a2a['query'][_0x283c('0x3f')]){_0x3897f3[_0x283c('0x40')]=[{'all':!![]}];}return db[_0x283c('0x3d')][_0x283c('0x41')](_0x3897f3);})[_0x283c('0x20')](function(_0x18e0d0){_0x40c65c[_0x283c('0x42')]=_0x18e0d0;return _0x40c65c;})[_0x283c('0x20')](respondWithFilteredResult(_0x16a0fd,_0x3897f3))[_0x283c('0x43')](handleError(_0x16a0fd,null));};exports[_0x283c('0x44')]=function(_0x2a18a1,_0x1140a3){var _0x236799={'raw':![],'where':{'id':_0x2a18a1[_0x283c('0x45')]['id']}},_0x548753={};_0x548753[_0x283c('0x2c')]=_['keys'](db[_0x283c('0x3d')]['rawAttributes']);_0x548753[_0x283c('0x2e')]=_[_0x283c('0x2f')](_0x2a18a1[_0x283c('0x2e')]);_0x548753[_0x283c('0x30')]=_['intersection'](_0x548753[_0x283c('0x2c')],_0x548753[_0x283c('0x2e')]);_0x236799[_0x283c('0x33')]=_[_0x283c('0x31')](_0x548753[_0x283c('0x2c')],qs[_0x283c('0x32')](_0x2a18a1['query'][_0x283c('0x32')]));_0x236799[_0x283c('0x33')]=_0x236799[_0x283c('0x33')]['length']?_0x236799[_0x283c('0x33')]:_0x548753[_0x283c('0x2c')];if(_0x2a18a1['query'][_0x283c('0x3f')]){_0x236799[_0x283c('0x40')]=[{'all':!![]}];}_0x236799=_[_0x283c('0x3a')]({},_0x236799,_0x2a18a1['options']);return db[_0x283c('0x3d')]['find'](_0x236799)[_0x283c('0x20')](handleEntityNotFound(_0x1140a3,null))['then'](respondWithResult(_0x1140a3,null))[_0x283c('0x43')](handleError(_0x1140a3,null));};exports['create']=function(_0x1b7b00,_0x100e4e){return db[_0x283c('0x3d')][_0x283c('0x46')](_0x1b7b00[_0x283c('0x47')],{})['then'](respondWithResult(_0x100e4e,0xc9))[_0x283c('0x43')](handleError(_0x100e4e,null));};exports[_0x283c('0x1f')]=function(_0x4cfdef,_0x4d4278){if(_0x4cfdef['body']['id']){delete _0x4cfdef['body']['id'];}return db[_0x283c('0x3d')][_0x283c('0x48')]({'where':{'id':_0x4cfdef['params']['id']}})['then'](handleEntityNotFound(_0x4d4278,null))[_0x283c('0x20')](saveUpdates(_0x4cfdef['body'],null))['then'](respondWithResult(_0x4d4278,null))['catch'](handleError(_0x4d4278,null));};exports[_0x283c('0x21')]=function(_0x58941e,_0x2622cd){return db[_0x283c('0x3d')][_0x283c('0x48')]({'where':{'id':_0x58941e['params']['id']}})[_0x283c('0x20')](handleEntityNotFound(_0x2622cd,null))[_0x283c('0x20')](removeEntity(_0x2622cd,null))[_0x283c('0x43')](handleError(_0x2622cd,null));};exports['getConfigurations']=function(_0x25c09b,_0x540aaa,_0xef5611){var _0xd5b24f={};var _0x922924={};var _0x3a716d;var _0x1db87c;return db[_0x283c('0x3d')][_0x283c('0x49')]({'where':{'id':_0x25c09b[_0x283c('0x45')]['id']}})[_0x283c('0x20')](handleEntityNotFound(_0x540aaa,null))[_0x283c('0x20')](function(_0x595554){if(_0x595554){_0x3a716d=_0x595554;_0x922924[_0x283c('0x2c')]=_['keys'](db['FreshsalesConfiguration'][_0x283c('0x28')]);_0x922924[_0x283c('0x2e')]=_[_0x283c('0x2f')](_0x25c09b[_0x283c('0x2e')]);_0x922924[_0x283c('0x30')]=_[_0x283c('0x31')](_0x922924[_0x283c('0x2c')],_0x922924['query']);_0xd5b24f[_0x283c('0x33')]=_['intersection'](_0x922924[_0x283c('0x2c')],qs[_0x283c('0x32')](_0x25c09b[_0x283c('0x2e')][_0x283c('0x32')]));_0xd5b24f[_0x283c('0x33')]=_0xd5b24f[_0x283c('0x33')][_0x283c('0x34')]?_0xd5b24f[_0x283c('0x33')]:_0x922924[_0x283c('0x2c')];_0xd5b24f[_0x283c('0x36')]=qs['sort'](_0x25c09b[_0x283c('0x2e')][_0x283c('0x37')]);_0xd5b24f['where']=qs[_0x283c('0x30')](_[_0x283c('0x39')](_0x25c09b[_0x283c('0x2e')],_0x922924[_0x283c('0x30')]));if(_0x25c09b[_0x283c('0x2e')][_0x283c('0x3b')]){_0xd5b24f['where']=_[_0x283c('0x3a')](_0xd5b24f['where'],{'$or':_[_0x283c('0x2d')](_0xd5b24f[_0x283c('0x33')],function(_0x3be728){var _0x29e1bb={};_0x29e1bb[_0x3be728]={'$like':'%'+_0x25c09b[_0x283c('0x2e')][_0x283c('0x3b')]+'%'};return _0x29e1bb;})});}_0xd5b24f=_[_0x283c('0x3a')]({},_0xd5b24f,_0x25c09b[_0x283c('0x3c')]);return _0x3a716d[_0x283c('0x4a')](_0xd5b24f);}})[_0x283c('0x20')](function(_0x15e494){if(_0x15e494){_0x1db87c=_0x15e494['length'];if(!_0x25c09b[_0x283c('0x2e')][_0x283c('0x35')](_0x283c('0x4b'))){_0xd5b24f[_0x283c('0x1b')]=qs['limit'](_0x25c09b[_0x283c('0x2e')][_0x283c('0x1b')]);_0xd5b24f['offset']=qs[_0x283c('0x19')](_0x25c09b[_0x283c('0x2e')][_0x283c('0x19')]);}return _0x3a716d[_0x283c('0x4a')](_0xd5b24f);}})['then'](function(_0x55fdf5){if(_0x55fdf5){return _0x55fdf5?{'count':_0x1db87c,'rows':_0x55fdf5}:null;}})[_0x283c('0x20')](respondWithResult(_0x540aaa,null))[_0x283c('0x43')](handleError(_0x540aaa,null));};exports['addConfiguration']=function(_0x3ba3ce,_0x18e8fd,_0x488d28){if(_0x3ba3ce[_0x283c('0x47')]['id']){delete _0x3ba3ce['body']['id'];}return db['FreshsalesAccount'][_0x283c('0x49')]({'where':{'id':_0x3ba3ce[_0x283c('0x45')]['id']}})[_0x283c('0x20')](handleEntityNotFound(_0x18e8fd,null))[_0x283c('0x20')](function(_0x1cce70){if(_0x1cce70){_0x3ba3ce[_0x283c('0x47')][_0x283c('0x4c')]=_0x1cce70['id'];_0x3ba3ce[_0x283c('0x47')][_0x283c('0x4d')]=integrations[_0x283c('0x4e')](_0x3ba3ce[_0x283c('0x47')][_0x283c('0x4f')],_0x3ba3ce['body']['type']);_0x3ba3ce[_0x283c('0x47')][_0x283c('0x50')]=integrations[_0x283c('0x51')](_0x3ba3ce[_0x283c('0x47')][_0x283c('0x4f')],_0x3ba3ce[_0x283c('0x47')][_0x283c('0x2a')]);return db[_0x283c('0x52')][_0x283c('0x46')](_0x3ba3ce[_0x283c('0x47')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x283c('0x53')],'as':_0x283c('0x50')}]});}return null;})[_0x283c('0x20')](respondWithResult(_0x18e8fd,null))[_0x283c('0x43')](handleError(_0x18e8fd,null));};exports['getFields']=function(_0x35f863,_0xef9710,_0x3ae148){var _0x138136='';var _0x1eaf88='';return db[_0x283c('0x3d')]['findOne']({'where':{'id':_0x35f863[_0x283c('0x45')]['id']},'attributes':['id',_0x283c('0x54'),_0x283c('0x55'),_0x283c('0x56')]})[_0x283c('0x20')](handleEntityNotFound(_0xef9710,null))[_0x283c('0x20')](function(_0x4d37bf){if(_0x4d37bf){_0x1eaf88=_0x4d37bf[_0x283c('0x54')];_0x138136=_0x4d37bf[_0x283c('0x55')];var _0x250ac3=_0x4d37bf[_0x283c('0x55')][_0x283c('0x57')](-0x1);if(_0x250ac3==='/'){_0x138136=_0x138136[_0x283c('0x58')](0x0,_0x138136[_0x283c('0x59')](_0x250ac3));}return rp({'method':_0x283c('0x5a'),'uri':util[_0x283c('0x5b')](_0x283c('0x5c'),_0x138136,_0x283c('0x5d')),'headers':{'Authorization':'Token\x20token='+_0x4d37bf[_0x283c('0x56')]},'json':!![]});}})[_0x283c('0x20')](function(_0x595aa2){if(_0x595aa2){var _0x1f005f=_0x595aa2[_0x283c('0x5e')];var _0x389a63=![];var _0x14c225=null;for(_0x14c225=0x0;_0x14c225<_0x1f005f[_0x283c('0x34')];_0x14c225++){if(_0x1f005f[_0x14c225][_0x283c('0x5f')]===_0x1eaf88){_0x389a63=!![];}}if(_0x389a63){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x283c('0x60')});}}})['then'](respondWithResult(_0xef9710,null))['catch'](function(_0x4b91f1){var _0x152893=_0x35f863['query'][_0x283c('0x61')]?0x1f4:_0x4b91f1[_0x283c('0x62')]||0x1f4;logger[_0x283c('0x63')](_0x283c('0x64'),_0x283c('0x65'),_0x152893,JSON[_0x283c('0x66')](_0x4b91f1));delete _0x4b91f1[_0x283c('0x25')];if(_0x152893===0x191){_0x152893=0x190;}_0xef9710['status'](_0x152893)[_0x283c('0x26')](_0x35f863[_0x283c('0x2e')][_0x283c('0x61')]?{'message':_0x283c('0x67'),'statusCode':_0x4b91f1[_0x283c('0x62')]}:_0x4b91f1);});}; \ No newline at end of file +var _0x8e15=['email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','keys','merge','find','create','body','catch','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','Subjects','channel','FreshsalesField','Descriptions','getFields','username','apiKey','remoteUri','slice','substring','GET','format','%s%s','Token\x20token=','users'];(function(_0x163b4a,_0x355bc0){var _0x2446c4=function(_0x536a25){while(--_0x536a25){_0x163b4a['push'](_0x163b4a['shift']());}};_0x2446c4(++_0x355bc0);}(_0x8e15,0x69));var _0x58e1=function(_0x4b6f5c,_0x56f7ce){_0x4b6f5c=_0x4b6f5c-0x0;var _0x55548b=_0x8e15[_0x4b6f5c];return _0x55548b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58e1('0x0'));var zipdir=require(_0x58e1('0x1'));var jsonpatch=require(_0x58e1('0x2'));var rp=require(_0x58e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x58e1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x58e1('0x5'));var csv=require('to-csv');var ejs=require(_0x58e1('0x6'));var fs=require('fs');var fs_extra=require(_0x58e1('0x7'));var _=require(_0x58e1('0x8'));var squel=require('squel');var crypto=require(_0x58e1('0x9'));var jsforce=require(_0x58e1('0xa'));var deskjs=require(_0x58e1('0xb'));var toCsv=require(_0x58e1('0xc'));var querystring=require('querystring');var Papa=require(_0x58e1('0xd'));var Redis=require('ioredis');var authService=require(_0x58e1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x58e1('0xf'));var hardwareService=require(_0x58e1('0x10'));var logger=require('../../config/logger')(_0x58e1('0x11'));var utils=require(_0x58e1('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x58e1('0x13'))['db'];var integrations=require(_0x58e1('0x14'));function respondWithStatusCode(_0x1558a7,_0x49a5fe){_0x49a5fe=_0x49a5fe||0xcc;return function(_0xd4ffda){if(_0xd4ffda){return _0x1558a7[_0x58e1('0x15')](_0x49a5fe);}return _0x1558a7[_0x58e1('0x16')](_0x49a5fe)['end']();};}function respondWithResult(_0xf60a13,_0x4360fe){_0x4360fe=_0x4360fe||0xc8;return function(_0x5951b5){if(_0x5951b5){return _0xf60a13['status'](_0x4360fe)[_0x58e1('0x17')](_0x5951b5);}};}function respondWithFilteredResult(_0x5782d0,_0x452b81){return function(_0x236ed9){if(_0x236ed9){var _0x4a40c6=typeof _0x452b81[_0x58e1('0x18')]===_0x58e1('0x19')&&typeof _0x452b81[_0x58e1('0x1a')]===_0x58e1('0x19');var _0x472bc6=_0x236ed9[_0x58e1('0x1b')];var _0x1789ae=_0x4a40c6?0x0:_0x452b81[_0x58e1('0x18')];var _0x47a421=_0x4a40c6?_0x236ed9[_0x58e1('0x1b')]:_0x452b81[_0x58e1('0x18')]+_0x452b81[_0x58e1('0x1a')];var _0x3fe23a;if(_0x47a421>=_0x472bc6){_0x47a421=_0x472bc6;_0x3fe23a=0xc8;}else{_0x3fe23a=0xce;}_0x5782d0[_0x58e1('0x16')](_0x3fe23a);return _0x5782d0['set']('Content-Range',_0x1789ae+'-'+_0x47a421+'/'+_0x472bc6)[_0x58e1('0x17')](_0x236ed9);}return null;};}function patchUpdates(_0x33a9ab){return function(_0x16eb99){try{jsonpatch['apply'](_0x16eb99,_0x33a9ab,!![]);}catch(_0x5f2b4e){return BPromise[_0x58e1('0x1c')](_0x5f2b4e);}return _0x16eb99[_0x58e1('0x1d')]();};}function saveUpdates(_0x523c90,_0x458c64){return function(_0x4f3237){if(_0x4f3237){return _0x4f3237[_0x58e1('0x1e')](_0x523c90)['then'](function(_0x568715){return _0x568715;});}return null;};}function removeEntity(_0x35b091,_0x10f2f6){return function(_0x5a14c9){if(_0x5a14c9){return _0x5a14c9[_0x58e1('0x1f')]()[_0x58e1('0x20')](function(){_0x35b091[_0x58e1('0x16')](0xcc)[_0x58e1('0x21')]();});}};}function handleEntityNotFound(_0x55f56a,_0x17c579){return function(_0x4b1ee6){if(!_0x4b1ee6){_0x55f56a[_0x58e1('0x15')](0x194);}return _0x4b1ee6;};}function handleError(_0x5c41a3,_0x41b357){_0x41b357=_0x41b357||0x1f4;return function(_0x54d598){logger[_0x58e1('0x22')](_0x54d598['stack']);if(_0x54d598[_0x58e1('0x23')]){delete _0x54d598[_0x58e1('0x23')];}_0x5c41a3[_0x58e1('0x16')](_0x41b357)[_0x58e1('0x24')](_0x54d598);};}exports[_0x58e1('0x25')]=function(_0x221594,_0xc3c7f1){var _0x1948e1={},_0x223be1={},_0x570376={'count':0x0,'rows':[]};var _0x4205b2=_[_0x58e1('0x26')](db['FreshsalesAccount'][_0x58e1('0x27')],function(_0x5f271b){return{'name':_0x5f271b[_0x58e1('0x28')],'type':_0x5f271b[_0x58e1('0x29')][_0x58e1('0x2a')]};});_0x223be1[_0x58e1('0x2b')]=_['map'](_0x4205b2,_0x58e1('0x23'));_0x223be1[_0x58e1('0x2c')]=_['keys'](_0x221594[_0x58e1('0x2c')]);_0x223be1[_0x58e1('0x2d')]=_[_0x58e1('0x2e')](_0x223be1[_0x58e1('0x2b')],_0x223be1[_0x58e1('0x2c')]);_0x1948e1[_0x58e1('0x2f')]=_[_0x58e1('0x2e')](_0x223be1[_0x58e1('0x2b')],qs[_0x58e1('0x30')](_0x221594['query'][_0x58e1('0x30')]));_0x1948e1['attributes']=_0x1948e1[_0x58e1('0x2f')][_0x58e1('0x31')]?_0x1948e1[_0x58e1('0x2f')]:_0x223be1['model'];if(!_0x221594[_0x58e1('0x2c')][_0x58e1('0x32')](_0x58e1('0x33'))){_0x1948e1['limit']=qs[_0x58e1('0x1a')](_0x221594[_0x58e1('0x2c')][_0x58e1('0x1a')]);_0x1948e1[_0x58e1('0x18')]=qs[_0x58e1('0x18')](_0x221594[_0x58e1('0x2c')][_0x58e1('0x18')]);}_0x1948e1[_0x58e1('0x34')]=qs['sort'](_0x221594[_0x58e1('0x2c')][_0x58e1('0x35')]);_0x1948e1[_0x58e1('0x36')]=qs[_0x58e1('0x2d')](_[_0x58e1('0x37')](_0x221594[_0x58e1('0x2c')],_0x223be1[_0x58e1('0x2d')]),_0x4205b2);if(_0x221594[_0x58e1('0x2c')][_0x58e1('0x38')]){_0x1948e1[_0x58e1('0x36')]=_['merge'](_0x1948e1[_0x58e1('0x36')],{'$or':_[_0x58e1('0x26')](_0x4205b2,function(_0x2f3df3){if(_0x2f3df3[_0x58e1('0x29')]!==_0x58e1('0x39')){var _0x4b0751={};_0x4b0751[_0x2f3df3[_0x58e1('0x23')]]={'$like':'%'+_0x221594['query'][_0x58e1('0x38')]+'%'};return _0x4b0751;}})});}_0x1948e1=_['merge']({},_0x1948e1,_0x221594[_0x58e1('0x3a')]);var _0xdf2b55={'where':_0x1948e1[_0x58e1('0x36')]};return db[_0x58e1('0x3b')][_0x58e1('0x1b')](_0xdf2b55)['then'](function(_0x43158d){_0x570376['count']=_0x43158d;if(_0x221594[_0x58e1('0x2c')][_0x58e1('0x3c')]){_0x1948e1[_0x58e1('0x3d')]=[{'all':!![]}];}return db[_0x58e1('0x3b')][_0x58e1('0x3e')](_0x1948e1);})[_0x58e1('0x20')](function(_0xa09de1){_0x570376[_0x58e1('0x3f')]=_0xa09de1;return _0x570376;})[_0x58e1('0x20')](respondWithFilteredResult(_0xc3c7f1,_0x1948e1))['catch'](handleError(_0xc3c7f1,null));};exports[_0x58e1('0x40')]=function(_0x7c37ad,_0x29b860){var _0x5cfee1={'raw':![],'where':{'id':_0x7c37ad[_0x58e1('0x41')]['id']}},_0x30bc88={};_0x30bc88[_0x58e1('0x2b')]=_[_0x58e1('0x42')](db['FreshsalesAccount'][_0x58e1('0x27')]);_0x30bc88[_0x58e1('0x2c')]=_['keys'](_0x7c37ad[_0x58e1('0x2c')]);_0x30bc88[_0x58e1('0x2d')]=_[_0x58e1('0x2e')](_0x30bc88['model'],_0x30bc88[_0x58e1('0x2c')]);_0x5cfee1[_0x58e1('0x2f')]=_[_0x58e1('0x2e')](_0x30bc88['model'],qs[_0x58e1('0x30')](_0x7c37ad['query'][_0x58e1('0x30')]));_0x5cfee1[_0x58e1('0x2f')]=_0x5cfee1[_0x58e1('0x2f')]['length']?_0x5cfee1[_0x58e1('0x2f')]:_0x30bc88[_0x58e1('0x2b')];if(_0x7c37ad[_0x58e1('0x2c')][_0x58e1('0x3c')]){_0x5cfee1[_0x58e1('0x3d')]=[{'all':!![]}];}_0x5cfee1=_[_0x58e1('0x43')]({},_0x5cfee1,_0x7c37ad[_0x58e1('0x3a')]);return db[_0x58e1('0x3b')][_0x58e1('0x44')](_0x5cfee1)[_0x58e1('0x20')](handleEntityNotFound(_0x29b860,null))['then'](respondWithResult(_0x29b860,null))['catch'](handleError(_0x29b860,null));};exports[_0x58e1('0x45')]=function(_0x5274d2,_0x5305a1){return db['FreshsalesAccount'][_0x58e1('0x45')](_0x5274d2[_0x58e1('0x46')],{})['then'](respondWithResult(_0x5305a1,0xc9))[_0x58e1('0x47')](handleError(_0x5305a1,null));};exports[_0x58e1('0x1e')]=function(_0x13cd24,_0x392f76){if(_0x13cd24[_0x58e1('0x46')]['id']){delete _0x13cd24[_0x58e1('0x46')]['id'];}return db['FreshsalesAccount'][_0x58e1('0x44')]({'where':{'id':_0x13cd24[_0x58e1('0x41')]['id']}})[_0x58e1('0x20')](handleEntityNotFound(_0x392f76,null))[_0x58e1('0x20')](saveUpdates(_0x13cd24[_0x58e1('0x46')],null))['then'](respondWithResult(_0x392f76,null))[_0x58e1('0x47')](handleError(_0x392f76,null));};exports['destroy']=function(_0x2e1ad1,_0x3906b5){return db[_0x58e1('0x3b')][_0x58e1('0x44')]({'where':{'id':_0x2e1ad1['params']['id']}})['then'](handleEntityNotFound(_0x3906b5,null))[_0x58e1('0x20')](removeEntity(_0x3906b5,null))[_0x58e1('0x47')](handleError(_0x3906b5,null));};exports[_0x58e1('0x48')]=function(_0x336ef1,_0xa930a4,_0x352657){var _0xd484ec={};var _0x589932={};var _0x230fce;var _0x23891f;return db['FreshsalesAccount'][_0x58e1('0x49')]({'where':{'id':_0x336ef1['params']['id']}})[_0x58e1('0x20')](handleEntityNotFound(_0xa930a4,null))[_0x58e1('0x20')](function(_0x41a528){if(_0x41a528){_0x230fce=_0x41a528;_0x589932[_0x58e1('0x2b')]=_[_0x58e1('0x42')](db[_0x58e1('0x4a')]['rawAttributes']);_0x589932['query']=_['keys'](_0x336ef1[_0x58e1('0x2c')]);_0x589932[_0x58e1('0x2d')]=_[_0x58e1('0x2e')](_0x589932[_0x58e1('0x2b')],_0x589932['query']);_0xd484ec[_0x58e1('0x2f')]=_['intersection'](_0x589932[_0x58e1('0x2b')],qs['fields'](_0x336ef1[_0x58e1('0x2c')][_0x58e1('0x30')]));_0xd484ec[_0x58e1('0x2f')]=_0xd484ec[_0x58e1('0x2f')][_0x58e1('0x31')]?_0xd484ec[_0x58e1('0x2f')]:_0x589932['model'];_0xd484ec[_0x58e1('0x34')]=qs[_0x58e1('0x35')](_0x336ef1[_0x58e1('0x2c')][_0x58e1('0x35')]);_0xd484ec['where']=qs['filters'](_[_0x58e1('0x37')](_0x336ef1[_0x58e1('0x2c')],_0x589932[_0x58e1('0x2d')]));if(_0x336ef1[_0x58e1('0x2c')][_0x58e1('0x38')]){_0xd484ec[_0x58e1('0x36')]=_[_0x58e1('0x43')](_0xd484ec[_0x58e1('0x36')],{'$or':_['map'](_0xd484ec[_0x58e1('0x2f')],function(_0x22e23b){var _0x35064e={};_0x35064e[_0x22e23b]={'$like':'%'+_0x336ef1['query'][_0x58e1('0x38')]+'%'};return _0x35064e;})});}_0xd484ec=_[_0x58e1('0x43')]({},_0xd484ec,_0x336ef1[_0x58e1('0x3a')]);return _0x230fce[_0x58e1('0x48')](_0xd484ec);}})[_0x58e1('0x20')](function(_0x3b7c22){if(_0x3b7c22){_0x23891f=_0x3b7c22[_0x58e1('0x31')];if(!_0x336ef1[_0x58e1('0x2c')][_0x58e1('0x32')](_0x58e1('0x33'))){_0xd484ec['limit']=qs['limit'](_0x336ef1[_0x58e1('0x2c')][_0x58e1('0x1a')]);_0xd484ec[_0x58e1('0x18')]=qs[_0x58e1('0x18')](_0x336ef1['query'][_0x58e1('0x18')]);}return _0x230fce[_0x58e1('0x48')](_0xd484ec);}})[_0x58e1('0x20')](function(_0x2e97d9){if(_0x2e97d9){return _0x2e97d9?{'count':_0x23891f,'rows':_0x2e97d9}:null;}})['then'](respondWithResult(_0xa930a4,null))[_0x58e1('0x47')](handleError(_0xa930a4,null));};exports[_0x58e1('0x4b')]=function(_0x589dfb,_0x42437b,_0x387f81){if(_0x589dfb[_0x58e1('0x46')]['id']){delete _0x589dfb['body']['id'];}return db[_0x58e1('0x3b')][_0x58e1('0x49')]({'where':{'id':_0x589dfb['params']['id']}})[_0x58e1('0x20')](handleEntityNotFound(_0x42437b,null))[_0x58e1('0x20')](function(_0x21aaf2){if(_0x21aaf2){_0x589dfb[_0x58e1('0x46')]['AccountId']=_0x21aaf2['id'];_0x589dfb['body'][_0x58e1('0x4c')]=integrations['getSubjects'](_0x589dfb[_0x58e1('0x46')][_0x58e1('0x4d')],_0x589dfb[_0x58e1('0x46')][_0x58e1('0x29')]);_0x589dfb[_0x58e1('0x46')]['Descriptions']=integrations['getDescriptions'](_0x589dfb['body'][_0x58e1('0x4d')],_0x589dfb[_0x58e1('0x46')][_0x58e1('0x29')]);return db[_0x58e1('0x4a')][_0x58e1('0x45')](_0x589dfb['body'],{'include':[{'model':db[_0x58e1('0x4e')],'as':_0x58e1('0x4c')},{'model':db['FreshsalesField'],'as':_0x58e1('0x4f')}]});}return null;})[_0x58e1('0x20')](respondWithResult(_0x42437b,null))[_0x58e1('0x47')](handleError(_0x42437b,null));};exports[_0x58e1('0x50')]=function(_0x41d749,_0x48406f,_0x4d5359){var _0x10e05b='';var _0x20db23='';return db[_0x58e1('0x3b')]['findOne']({'where':{'id':_0x41d749[_0x58e1('0x41')]['id']},'attributes':['id',_0x58e1('0x51'),'remoteUri',_0x58e1('0x52')]})[_0x58e1('0x20')](handleEntityNotFound(_0x48406f,null))['then'](function(_0x4da4fe){if(_0x4da4fe){_0x20db23=_0x4da4fe[_0x58e1('0x51')];_0x10e05b=_0x4da4fe['remoteUri'];var _0x3f0b04=_0x4da4fe[_0x58e1('0x53')][_0x58e1('0x54')](-0x1);if(_0x3f0b04==='/'){_0x10e05b=_0x10e05b[_0x58e1('0x55')](0x0,_0x10e05b['lastIndexOf'](_0x3f0b04));}return rp({'method':_0x58e1('0x56'),'uri':util[_0x58e1('0x57')](_0x58e1('0x58'),_0x10e05b,'/api/selector/owners'),'headers':{'Authorization':_0x58e1('0x59')+_0x4da4fe[_0x58e1('0x52')]},'json':!![]});}})[_0x58e1('0x20')](function(_0x271cce){if(_0x271cce){var _0x1c3c85=_0x271cce[_0x58e1('0x5a')];var _0x35b589=![];var _0x181a35=null;for(_0x181a35=0x0;_0x181a35<_0x1c3c85['length'];_0x181a35++){if(_0x1c3c85[_0x181a35][_0x58e1('0x5b')]===_0x20db23){_0x35b589=!![];}}if(_0x35b589){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x58e1('0x5c')});}}})[_0x58e1('0x20')](respondWithResult(_0x48406f,null))[_0x58e1('0x47')](function(_0x1cb2cb){var _0x4e24a5=_0x41d749[_0x58e1('0x2c')][_0x58e1('0x5d')]?0x1f4:_0x1cb2cb[_0x58e1('0x5e')]||0x1f4;logger[_0x58e1('0x22')](_0x58e1('0x5f'),_0x58e1('0x50'),_0x4e24a5,JSON[_0x58e1('0x60')](_0x1cb2cb));delete _0x1cb2cb[_0x58e1('0x23')];if(_0x4e24a5===0x191){_0x4e24a5=0x190;}_0x48406f['status'](_0x4e24a5)[_0x58e1('0x24')](_0x41d749['query'][_0x58e1('0x5d')]?{'message':_0x58e1('0x61'),'statusCode':_0x1cb2cb['statusCode']}:_0x1cb2cb);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 01e9871..ee132ec 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x7a54,0x106));var _0x47a5=function(_0x28ee7a,_0x59637e){_0x28ee7a=_0x28ee7a-0x0;var _0x2c3634=_0x7a54[_0x28ee7a];return _0x2c3634;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x571c83,_0x4c97dc){var _0x2b8bd2=function(_0x1401a1){while(--_0x1401a1){_0x571c83['push'](_0x571c83['shift']());}};_0x2b8bd2(++_0x4c97dc);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'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 2ddbdb1..c6e5e89 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 _0xffd6=['options','raw','limit','include','model','attributes','ShowFreshsalesAccount','FreshsalesAccount','find','where','map','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFreshsalesAccount','findAll'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xffd6,0x97));var _0x6ffd=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xffd6[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}exports[_0x6ffd('0x16')]=function(_0x889a4b){var _0x545576=this;return new Promise(function(_0x11a609,_0x56c541){return db['FreshsalesAccount'][_0x6ffd('0x17')]({'raw':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b['options'][_0x6ffd('0x19')]===undefined?!![]:![]:!![],'where':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b['options']['where']||null:null,'attributes':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b[_0x6ffd('0x18')]['attributes']||null:null,'limit':_0x889a4b[_0x6ffd('0x18')]?_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1a')]||null:null,'include':_0x889a4b['options']?_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1b')]?_['map'](_0x889a4b[_0x6ffd('0x18')][_0x6ffd('0x1b')],function(_0x50c19a){return{'model':db[_0x50c19a[_0x6ffd('0x1c')]],'as':_0x50c19a['as'],'attributes':_0x50c19a[_0x6ffd('0x1d')],'include':_0x50c19a[_0x6ffd('0x1b')]?_['map'](_0x50c19a[_0x6ffd('0x1b')],function(_0x3e5726){return{'model':db[_0x3e5726[_0x6ffd('0x1c')]],'as':_0x3e5726['as'],'attributes':_0x3e5726['attributes'],'include':_0x3e5726[_0x6ffd('0x1b')]?_['map'](_0x3e5726[_0x6ffd('0x1b')],function(_0x43269c){return{'model':db[_0x43269c['model']],'as':_0x43269c['as'],'attributes':_0x43269c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ffd('0xa')](function(_0x2a0391){logger[_0x6ffd('0x13')]('GetFreshsalesAccount',_0x889a4b);logger['debug'](_0x6ffd('0x16'),_0x889a4b,JSON['stringify'](_0x2a0391));_0x11a609(_0x2a0391);})[_0x6ffd('0x15')](function(_0x20c007){logger['error'](_0x6ffd('0x16'),_0x20c007[_0x6ffd('0x12')],_0x889a4b);_0x56c541(_0x545576[_0x6ffd('0x10')](0x1f4,_0x20c007[_0x6ffd('0x12')]));});});};exports[_0x6ffd('0x1e')]=function(_0x31c609){var _0x225c66=this;return new Promise(function(_0xccb8c,_0x17f627){return db[_0x6ffd('0x1f')][_0x6ffd('0x20')]({'raw':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31c609['options']?_0x31c609['options'][_0x6ffd('0x21')]||null:null,'attributes':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1d')]||null:null,'include':_0x31c609[_0x6ffd('0x18')]?_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1b')]?_[_0x6ffd('0x22')](_0x31c609[_0x6ffd('0x18')][_0x6ffd('0x1b')],function(_0x26394c){return{'model':db[_0x26394c[_0x6ffd('0x1c')]],'as':_0x26394c['as'],'attributes':_0x26394c[_0x6ffd('0x1d')],'include':_0x26394c['include']?_[_0x6ffd('0x22')](_0x26394c[_0x6ffd('0x1b')],function(_0x2efc20){return{'model':db[_0x2efc20[_0x6ffd('0x1c')]],'as':_0x2efc20['as'],'attributes':_0x2efc20['attributes'],'include':_0x2efc20[_0x6ffd('0x1b')]?_['map'](_0x2efc20['include'],function(_0x617d52){return{'model':db[_0x617d52[_0x6ffd('0x1c')]],'as':_0x617d52['as'],'attributes':_0x617d52[_0x6ffd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6ffd('0xa')](function(_0x55e9b4){logger[_0x6ffd('0x13')]('ShowFreshsalesAccount',_0x31c609);logger[_0x6ffd('0xd')](_0x6ffd('0x1e'),_0x31c609,JSON[_0x6ffd('0xf')](_0x55e9b4));_0xccb8c(_0x55e9b4);})[_0x6ffd('0x15')](function(_0x23fae4){logger['error']('ShowFreshsalesAccount',_0x23fae4[_0x6ffd('0x12')],_0x31c609);_0x17f627(_0x225c66['error'](0x1f4,_0x23fae4[_0x6ffd('0x12')]));});});}; \ No newline at end of file +var _0xf2e3=['FreshsalesAccount','findAll','options','where','attributes','model','include','map','ShowFreshsalesAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount'];(function(_0x4f66,_0x4c4a2e){var _0x4e3d42=function(_0xcbd4b0){while(--_0xcbd4b0){_0x4f66['push'](_0x4f66['shift']());}};_0x4e3d42(++_0x4c4a2e);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xf2e3[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var moment=require(_0x3f2e('0x1'));var BPromise=require(_0x3f2e('0x2'));var rs=require(_0x3f2e('0x3'));var fs=require('fs');var Redis=require(_0x3f2e('0x4'));var db=require(_0x3f2e('0x5'))['db'];var utils=require(_0x3f2e('0x6'));var logger=require(_0x3f2e('0x7'))(_0x3f2e('0x8'));var config=require(_0x3f2e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f2e('0xa')][_0x3f2e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c0864,_0xdf499f,_0x12c6e7){return new BPromise(function(_0x11067d,_0x3636f6){return client[_0x3f2e('0xc')](_0x3c0864,_0x12c6e7)[_0x3f2e('0xd')](function(_0x29a6cc){logger[_0x3f2e('0xe')](_0x3f2e('0xf'),_0xdf499f,_0x3f2e('0x10'));logger[_0x3f2e('0x11')](_0x3f2e('0x12'),_0xdf499f,_0x3f2e('0x10'),JSON[_0x3f2e('0x13')](_0x29a6cc));if(_0x29a6cc[_0x3f2e('0x14')]){if(_0x29a6cc[_0x3f2e('0x14')]['code']===0x1f4){logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x29a6cc['error'][_0x3f2e('0x15')]);return _0x3636f6(_0x29a6cc[_0x3f2e('0x14')][_0x3f2e('0x15')]);}logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x29a6cc['error'][_0x3f2e('0x15')]);return _0x11067d(_0x29a6cc[_0x3f2e('0x14')][_0x3f2e('0x15')]);}else{logger['info'](_0x3f2e('0xf'),_0xdf499f,_0x3f2e('0x10'));_0x11067d(_0x29a6cc[_0x3f2e('0x16')][_0x3f2e('0x15')]);}})[_0x3f2e('0x17')](function(_0x2fef73){logger[_0x3f2e('0x14')](_0x3f2e('0xf'),_0xdf499f,_0x2fef73);_0x3636f6(_0x2fef73);});});}exports[_0x3f2e('0x18')]=function(_0xc00add){var _0x107876=this;return new Promise(function(_0x5b9989,_0x40e28f){return db[_0x3f2e('0x19')][_0x3f2e('0x1a')]({'raw':_0xc00add[_0x3f2e('0x1b')]?_0xc00add[_0x3f2e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xc00add['options']?_0xc00add[_0x3f2e('0x1b')][_0x3f2e('0x1c')]||null:null,'attributes':_0xc00add[_0x3f2e('0x1b')]?_0xc00add[_0x3f2e('0x1b')][_0x3f2e('0x1d')]||null:null,'limit':_0xc00add[_0x3f2e('0x1b')]?_0xc00add['options']['limit']||null:null,'include':_0xc00add[_0x3f2e('0x1b')]?_0xc00add[_0x3f2e('0x1b')]['include']?_['map'](_0xc00add[_0x3f2e('0x1b')]['include'],function(_0x1b8c67){return{'model':db[_0x1b8c67[_0x3f2e('0x1e')]],'as':_0x1b8c67['as'],'attributes':_0x1b8c67['attributes'],'include':_0x1b8c67['include']?_['map'](_0x1b8c67[_0x3f2e('0x1f')],function(_0x3d7631){return{'model':db[_0x3d7631['model']],'as':_0x3d7631['as'],'attributes':_0x3d7631[_0x3f2e('0x1d')],'include':_0x3d7631['include']?_[_0x3f2e('0x20')](_0x3d7631['include'],function(_0x2806d0){return{'model':db[_0x2806d0[_0x3f2e('0x1e')]],'as':_0x2806d0['as'],'attributes':_0x2806d0[_0x3f2e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3f2e('0xd')](function(_0x11bad1){logger['info'](_0x3f2e('0x18'),_0xc00add);logger[_0x3f2e('0x11')]('GetFreshsalesAccount',_0xc00add,JSON['stringify'](_0x11bad1));_0x5b9989(_0x11bad1);})[_0x3f2e('0x17')](function(_0x1e5db4){logger[_0x3f2e('0x14')](_0x3f2e('0x18'),_0x1e5db4['message'],_0xc00add);_0x40e28f(_0x107876[_0x3f2e('0x14')](0x1f4,_0x1e5db4[_0x3f2e('0x15')]));});});};exports[_0x3f2e('0x21')]=function(_0x4d9b8c){var _0x349ed4=this;return new Promise(function(_0x2741d0,_0xa6a8ab){return db['FreshsalesAccount'][_0x3f2e('0x22')]({'raw':_0x4d9b8c[_0x3f2e('0x1b')]?_0x4d9b8c[_0x3f2e('0x1b')][_0x3f2e('0x23')]===undefined?!![]:![]:!![],'where':_0x4d9b8c[_0x3f2e('0x1b')]?_0x4d9b8c[_0x3f2e('0x1b')]['where']||null:null,'attributes':_0x4d9b8c[_0x3f2e('0x1b')]?_0x4d9b8c[_0x3f2e('0x1b')][_0x3f2e('0x1d')]||null:null,'include':_0x4d9b8c[_0x3f2e('0x1b')]?_0x4d9b8c[_0x3f2e('0x1b')][_0x3f2e('0x1f')]?_[_0x3f2e('0x20')](_0x4d9b8c['options'][_0x3f2e('0x1f')],function(_0x1e4866){return{'model':db[_0x1e4866[_0x3f2e('0x1e')]],'as':_0x1e4866['as'],'attributes':_0x1e4866[_0x3f2e('0x1d')],'include':_0x1e4866['include']?_['map'](_0x1e4866[_0x3f2e('0x1f')],function(_0x35ead3){return{'model':db[_0x35ead3[_0x3f2e('0x1e')]],'as':_0x35ead3['as'],'attributes':_0x35ead3[_0x3f2e('0x1d')],'include':_0x35ead3[_0x3f2e('0x1f')]?_[_0x3f2e('0x20')](_0x35ead3[_0x3f2e('0x1f')],function(_0x35937a){return{'model':db[_0x35937a[_0x3f2e('0x1e')]],'as':_0x35937a['as'],'attributes':_0x35937a[_0x3f2e('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ff764){logger[_0x3f2e('0xe')](_0x3f2e('0x21'),_0x4d9b8c);logger[_0x3f2e('0x11')]('ShowFreshsalesAccount',_0x4d9b8c,JSON[_0x3f2e('0x13')](_0x1ff764));_0x2741d0(_0x1ff764);})[_0x3f2e('0x17')](function(_0x3f41af){logger[_0x3f2e('0x14')](_0x3f2e('0x21'),_0x3f41af[_0x3f2e('0x15')],_0x4d9b8c);_0xa6a8ab(_0x349ed4[_0x3f2e('0x14')](0x1f4,_0x3f41af[_0x3f2e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index ed13df7..1701621 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 _0xfee3=['/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfee3,0xa3));var _0x3fee=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xfee3[_0x2d994d];return _0xd54be4;};'use strict';var multer=require('multer');var util=require(_0x3fee('0x0'));var path=require('path');var timeout=require(_0x3fee('0x1'));var express=require(_0x3fee('0x2'));var router=express['Router']();var fs_extra=require(_0x3fee('0x3'));var auth=require(_0x3fee('0x4'));var interaction=require(_0x3fee('0x5'));var config=require(_0x3fee('0x6'));var controller=require(_0x3fee('0x7'));router[_0x3fee('0x8')]('/',auth[_0x3fee('0x9')](),controller[_0x3fee('0xa')]);router['get'](_0x3fee('0xb'),auth[_0x3fee('0x9')](),controller[_0x3fee('0xc')]);router[_0x3fee('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x3fee('0x8')](_0x3fee('0xd'),auth['isAuthenticated'](),controller[_0x3fee('0xe')]);router[_0x3fee('0x8')](_0x3fee('0xf'),auth[_0x3fee('0x9')](),controller[_0x3fee('0x10')]);router[_0x3fee('0x11')]('/',auth[_0x3fee('0x9')](),controller[_0x3fee('0x12')]);router[_0x3fee('0x13')](_0x3fee('0xb'),auth[_0x3fee('0x9')](),controller[_0x3fee('0x14')]);router['delete'](_0x3fee('0xb'),auth[_0x3fee('0x9')](),controller['destroy']);module[_0x3fee('0x15')]=router; \ No newline at end of file +var _0x4378=['get','isAuthenticated','/:id','show','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller'];(function(_0x36617e,_0x57e535){var _0x45c976=function(_0x212aa2){while(--_0x212aa2){_0x36617e['push'](_0x36617e['shift']());}};_0x45c976(++_0x57e535);}(_0x4378,0x16d));var _0x8437=function(_0x211c7d,_0x1e9c66){_0x211c7d=_0x211c7d-0x0;var _0x500ae3=_0x4378[_0x211c7d];return _0x500ae3;};'use strict';var multer=require(_0x8437('0x0'));var util=require(_0x8437('0x1'));var path=require(_0x8437('0x2'));var timeout=require(_0x8437('0x3'));var express=require(_0x8437('0x4'));var router=express[_0x8437('0x5')]();var fs_extra=require(_0x8437('0x6'));var auth=require(_0x8437('0x7'));var interaction=require(_0x8437('0x8'));var config=require('../../config/environment');var controller=require(_0x8437('0x9'));router[_0x8437('0xa')]('/',auth[_0x8437('0xb')](),controller['index']);router[_0x8437('0xa')](_0x8437('0xc'),auth[_0x8437('0xb')](),controller[_0x8437('0xd')]);router[_0x8437('0xa')]('/:id/subjects',auth[_0x8437('0xb')](),controller['getSubjects']);router[_0x8437('0xa')](_0x8437('0xe'),auth['isAuthenticated'](),controller[_0x8437('0xf')]);router['get'](_0x8437('0x10'),auth['isAuthenticated'](),controller[_0x8437('0x11')]);router[_0x8437('0x12')]('/',auth[_0x8437('0xb')](),controller[_0x8437('0x13')]);router[_0x8437('0x14')](_0x8437('0xc'),auth[_0x8437('0xb')](),controller[_0x8437('0x15')]);router[_0x8437('0x16')](_0x8437('0xc'),auth['isAuthenticated'](),controller[_0x8437('0x17')]);module[_0x8437('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 4865025..f7b4209 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 _0x5b87=['STRING'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x5b87,0x1b1));var _0x75b8=function(_0x38e0a,_0x5b3a8c){_0x38e0a=_0x38e0a-0x0;var _0x427352=_0x5b87[_0x38e0a];return _0x427352;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x75b8('0x0')]},'description':{'type':Sequelize[_0x75b8('0x0')]}}; \ No newline at end of file +var _0xc5ab=['sequelize','STRING'];(function(_0x8ea103,_0x2ec4e8){var _0x43721c=function(_0x4c51f1){while(--_0x4c51f1){_0x8ea103['push'](_0x8ea103['shift']());}};_0x43721c(++_0x2ec4e8);}(_0xc5ab,0x146));var _0xbc5a=function(_0x2ee2b8,_0x295110){_0x2ee2b8=_0x2ee2b8-0x0;var _0x3e05b9=_0xc5ab[_0x2ee2b8];return _0x3e05b9;};'use strict';var Sequelize=require(_0xbc5a('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc5a('0x1')]},'description':{'type':Sequelize[_0xbc5a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 32031fb..0bf89bf 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 _0x1320=['hasOwnProperty','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','getSubjects','findOne','FreshsalesField','getDescriptions','pick'];(function(_0x43621c,_0x26aa2a){var _0x4e19db=function(_0x59ae3b){while(--_0x59ae3b){_0x43621c['push'](_0x43621c['shift']());}};_0x4e19db(++_0x26aa2a);}(_0x1320,0x197));var _0x0132=function(_0x310c0a,_0x4ec103){_0x310c0a=_0x310c0a-0x0;var _0x599109=_0x1320[_0x310c0a];return _0x599109;};'use strict';var emlformat=require(_0x0132('0x0'));var rimraf=require(_0x0132('0x1'));var zipdir=require(_0x0132('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0132('0x3'));var moment=require(_0x0132('0x4'));var BPromise=require(_0x0132('0x5'));var Mustache=require(_0x0132('0x6'));var util=require('util');var path=require(_0x0132('0x7'));var sox=require(_0x0132('0x8'));var csv=require('to-csv');var ejs=require(_0x0132('0x9'));var fs=require('fs');var fs_extra=require(_0x0132('0xa'));var _=require(_0x0132('0xb'));var squel=require('squel');var crypto=require(_0x0132('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0132('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0132('0xe'));var Redis=require(_0x0132('0xf'));var authService=require(_0x0132('0x10'));var qs=require(_0x0132('0x11'));var as=require(_0x0132('0x12'));var hardwareService=require(_0x0132('0x13'));var logger=require(_0x0132('0x14'))(_0x0132('0x15'));var utils=require(_0x0132('0x16'));var config=require(_0x0132('0x17'));var licenseUtil=require(_0x0132('0x18'));var db=require(_0x0132('0x19'))['db'];function respondWithStatusCode(_0x4086fb,_0x3a5882){_0x3a5882=_0x3a5882||0xcc;return function(_0x1ebebf){if(_0x1ebebf){return _0x4086fb[_0x0132('0x1a')](_0x3a5882);}return _0x4086fb['status'](_0x3a5882)[_0x0132('0x1b')]();};}function respondWithResult(_0xd24d86,_0x4cd09f){_0x4cd09f=_0x4cd09f||0xc8;return function(_0x4deeaf){if(_0x4deeaf){return _0xd24d86[_0x0132('0x1c')](_0x4cd09f)[_0x0132('0x1d')](_0x4deeaf);}};}function respondWithFilteredResult(_0xeedec,_0x43bd12){return function(_0x16b29e){if(_0x16b29e){var _0x38129b=typeof _0x43bd12[_0x0132('0x1e')]===_0x0132('0x1f')&&typeof _0x43bd12[_0x0132('0x20')]===_0x0132('0x1f');var _0x5d5a52=_0x16b29e[_0x0132('0x21')];var _0x5a947f=_0x38129b?0x0:_0x43bd12['offset'];var _0x451174=_0x38129b?_0x16b29e[_0x0132('0x21')]:_0x43bd12['offset']+_0x43bd12['limit'];var _0x25a7a5;if(_0x451174>=_0x5d5a52){_0x451174=_0x5d5a52;_0x25a7a5=0xc8;}else{_0x25a7a5=0xce;}_0xeedec[_0x0132('0x1c')](_0x25a7a5);return _0xeedec[_0x0132('0x22')](_0x0132('0x23'),_0x5a947f+'-'+_0x451174+'/'+_0x5d5a52)[_0x0132('0x1d')](_0x16b29e);}return null;};}function patchUpdates(_0x5a88ad){return function(_0x1e48e1){try{jsonpatch[_0x0132('0x24')](_0x1e48e1,_0x5a88ad,!![]);}catch(_0x1e84d9){return BPromise['reject'](_0x1e84d9);}return _0x1e48e1[_0x0132('0x25')]();};}function saveUpdates(_0x2cb2d7,_0xaef5b4){return function(_0x4afa97){if(_0x4afa97){return _0x4afa97['update'](_0x2cb2d7)[_0x0132('0x26')](function(_0x1d2ba8){return _0x1d2ba8;});}return null;};}function removeEntity(_0x2924c5,_0x3f50dc){return function(_0x3443e7){if(_0x3443e7){return _0x3443e7[_0x0132('0x27')]()[_0x0132('0x26')](function(){_0x2924c5['status'](0xcc)[_0x0132('0x1b')]();});}};}function handleEntityNotFound(_0x38f29e,_0x508c72){return function(_0x290fa5){if(!_0x290fa5){_0x38f29e[_0x0132('0x1a')](0x194);}return _0x290fa5;};}function handleError(_0x5f346c,_0x8028b6){_0x8028b6=_0x8028b6||0x1f4;return function(_0x215abb){logger[_0x0132('0x28')](_0x215abb[_0x0132('0x29')]);if(_0x215abb[_0x0132('0x2a')]){delete _0x215abb['name'];}_0x5f346c[_0x0132('0x1c')](_0x8028b6)['send'](_0x215abb);};}exports['index']=function(_0x293fd3,_0x2111b8){var _0x1abfe7={},_0x1e6039={},_0x5a4259={'count':0x0,'rows':[]};var _0x4febc6=_[_0x0132('0x2b')](db[_0x0132('0x2c')][_0x0132('0x2d')],function(_0x53bec8){return{'name':_0x53bec8[_0x0132('0x2e')],'type':_0x53bec8[_0x0132('0x2f')][_0x0132('0x30')]};});_0x1e6039[_0x0132('0x31')]=_[_0x0132('0x2b')](_0x4febc6,_0x0132('0x2a'));_0x1e6039[_0x0132('0x32')]=_[_0x0132('0x33')](_0x293fd3[_0x0132('0x32')]);_0x1e6039['filters']=_[_0x0132('0x34')](_0x1e6039[_0x0132('0x31')],_0x1e6039['query']);_0x1abfe7[_0x0132('0x35')]=_[_0x0132('0x34')](_0x1e6039[_0x0132('0x31')],qs[_0x0132('0x36')](_0x293fd3[_0x0132('0x32')]['fields']));_0x1abfe7[_0x0132('0x35')]=_0x1abfe7[_0x0132('0x35')][_0x0132('0x37')]?_0x1abfe7[_0x0132('0x35')]:_0x1e6039[_0x0132('0x31')];if(!_0x293fd3['query']['hasOwnProperty'](_0x0132('0x38'))){_0x1abfe7[_0x0132('0x20')]=qs[_0x0132('0x20')](_0x293fd3[_0x0132('0x32')]['limit']);_0x1abfe7[_0x0132('0x1e')]=qs[_0x0132('0x1e')](_0x293fd3[_0x0132('0x32')][_0x0132('0x1e')]);}_0x1abfe7[_0x0132('0x39')]=qs[_0x0132('0x3a')](_0x293fd3[_0x0132('0x32')][_0x0132('0x3a')]);_0x1abfe7[_0x0132('0x3b')]=qs[_0x0132('0x3c')](_['pick'](_0x293fd3[_0x0132('0x32')],_0x1e6039[_0x0132('0x3c')]),_0x4febc6);if(_0x293fd3[_0x0132('0x32')]['filter']){_0x1abfe7[_0x0132('0x3b')]=_[_0x0132('0x3d')](_0x1abfe7[_0x0132('0x3b')],{'$or':_['map'](_0x4febc6,function(_0x579aab){if(_0x579aab[_0x0132('0x2f')]!==_0x0132('0x3e')){var _0x357cb0={};_0x357cb0[_0x579aab[_0x0132('0x2a')]]={'$like':'%'+_0x293fd3[_0x0132('0x32')][_0x0132('0x3f')]+'%'};return _0x357cb0;}})});}_0x1abfe7=_[_0x0132('0x3d')]({},_0x1abfe7,_0x293fd3[_0x0132('0x40')]);var _0x157de7={'where':_0x1abfe7['where']};return db[_0x0132('0x2c')][_0x0132('0x21')](_0x157de7)[_0x0132('0x26')](function(_0x409df6){_0x5a4259['count']=_0x409df6;if(_0x293fd3[_0x0132('0x32')][_0x0132('0x41')]){_0x1abfe7[_0x0132('0x42')]=[{'all':!![]}];}return db[_0x0132('0x2c')]['findAll'](_0x1abfe7);})[_0x0132('0x26')](function(_0x528c19){_0x5a4259[_0x0132('0x43')]=_0x528c19;return _0x5a4259;})['then'](respondWithFilteredResult(_0x2111b8,_0x1abfe7))[_0x0132('0x44')](handleError(_0x2111b8,null));};exports[_0x0132('0x45')]=function(_0x133948,_0x13286c){var _0x85f8a4={'raw':![],'where':{'id':_0x133948[_0x0132('0x46')]['id']}},_0xece5e9={};_0xece5e9[_0x0132('0x31')]=_['keys'](db[_0x0132('0x2c')][_0x0132('0x2d')]);_0xece5e9[_0x0132('0x32')]=_[_0x0132('0x33')](_0x133948['query']);_0xece5e9[_0x0132('0x3c')]=_[_0x0132('0x34')](_0xece5e9[_0x0132('0x31')],_0xece5e9[_0x0132('0x32')]);_0x85f8a4['attributes']=_[_0x0132('0x34')](_0xece5e9['model'],qs['fields'](_0x133948[_0x0132('0x32')]['fields']));_0x85f8a4[_0x0132('0x35')]=_0x85f8a4[_0x0132('0x35')]['length']?_0x85f8a4[_0x0132('0x35')]:_0xece5e9[_0x0132('0x31')];if(_0x133948[_0x0132('0x32')][_0x0132('0x41')]){_0x85f8a4[_0x0132('0x42')]=[{'all':!![]}];}_0x85f8a4=_['merge']({},_0x85f8a4,_0x133948[_0x0132('0x40')]);return db[_0x0132('0x2c')]['find'](_0x85f8a4)[_0x0132('0x26')](handleEntityNotFound(_0x13286c,null))['then'](respondWithResult(_0x13286c,null))[_0x0132('0x44')](handleError(_0x13286c,null));};exports[_0x0132('0x47')]=function(_0x248d76,_0x310a82){return db[_0x0132('0x2c')][_0x0132('0x47')](_0x248d76[_0x0132('0x48')],{})[_0x0132('0x26')](respondWithResult(_0x310a82,0xc9))[_0x0132('0x44')](handleError(_0x310a82,null));};exports['update']=function(_0x1dcf44,_0x97607e){if(_0x1dcf44[_0x0132('0x48')]['id']){delete _0x1dcf44[_0x0132('0x48')]['id'];}return db[_0x0132('0x2c')][_0x0132('0x49')]({'where':{'id':_0x1dcf44[_0x0132('0x46')]['id']}})['then'](handleEntityNotFound(_0x97607e,null))[_0x0132('0x26')](saveUpdates(_0x1dcf44['body'],null))[_0x0132('0x26')](respondWithResult(_0x97607e,null))[_0x0132('0x44')](handleError(_0x97607e,null));};exports['destroy']=function(_0x4dfa3d,_0x13a28a){return db[_0x0132('0x2c')][_0x0132('0x49')]({'where':{'id':_0x4dfa3d['params']['id']}})[_0x0132('0x26')](handleEntityNotFound(_0x13a28a,null))[_0x0132('0x26')](removeEntity(_0x13a28a,null))[_0x0132('0x44')](handleError(_0x13a28a,null));};exports[_0x0132('0x4a')]=function(_0x192f6e,_0x4c2eb7,_0x2ef7bf){var _0x673ee8={};var _0x1f72f1={};var _0x56e512;var _0x345817;return db[_0x0132('0x2c')][_0x0132('0x4b')]({'where':{'id':_0x192f6e[_0x0132('0x46')]['id']}})[_0x0132('0x26')](handleEntityNotFound(_0x4c2eb7,null))['then'](function(_0x1da293){if(_0x1da293){_0x56e512=_0x1da293;_0x1f72f1[_0x0132('0x31')]=_['keys'](db[_0x0132('0x4c')]['rawAttributes']);_0x1f72f1[_0x0132('0x32')]=_[_0x0132('0x33')](_0x192f6e[_0x0132('0x32')]);_0x1f72f1[_0x0132('0x3c')]=_[_0x0132('0x34')](_0x1f72f1['model'],_0x1f72f1[_0x0132('0x32')]);_0x673ee8[_0x0132('0x35')]=_[_0x0132('0x34')](_0x1f72f1['model'],qs[_0x0132('0x36')](_0x192f6e[_0x0132('0x32')][_0x0132('0x36')]));_0x673ee8[_0x0132('0x35')]=_0x673ee8[_0x0132('0x35')][_0x0132('0x37')]?_0x673ee8[_0x0132('0x35')]:_0x1f72f1['model'];_0x673ee8[_0x0132('0x39')]=qs['sort'](_0x192f6e['query'][_0x0132('0x3a')]);_0x673ee8[_0x0132('0x3b')]=qs[_0x0132('0x3c')](_['pick'](_0x192f6e['query'],_0x1f72f1['filters']));if(_0x192f6e[_0x0132('0x32')][_0x0132('0x3f')]){_0x673ee8[_0x0132('0x3b')]=_['merge'](_0x673ee8[_0x0132('0x3b')],{'$or':_['map'](_0x673ee8[_0x0132('0x35')],function(_0x1e0759){var _0x10febb={};_0x10febb[_0x1e0759]={'$like':'%'+_0x192f6e[_0x0132('0x32')][_0x0132('0x3f')]+'%'};return _0x10febb;})});}_0x673ee8=_[_0x0132('0x3d')]({},_0x673ee8,_0x192f6e['options']);return _0x56e512['getSubjects'](_0x673ee8);}})[_0x0132('0x26')](function(_0x5ed1a9){if(_0x5ed1a9){_0x345817=_0x5ed1a9[_0x0132('0x37')];if(!_0x192f6e[_0x0132('0x32')]['hasOwnProperty'](_0x0132('0x38'))){_0x673ee8[_0x0132('0x20')]=qs['limit'](_0x192f6e[_0x0132('0x32')][_0x0132('0x20')]);_0x673ee8[_0x0132('0x1e')]=qs[_0x0132('0x1e')](_0x192f6e[_0x0132('0x32')][_0x0132('0x1e')]);}return _0x56e512[_0x0132('0x4a')](_0x673ee8);}})[_0x0132('0x26')](function(_0x560f49){if(_0x560f49){return _0x560f49?{'count':_0x345817,'rows':_0x560f49}:null;}})['then'](respondWithResult(_0x4c2eb7,null))[_0x0132('0x44')](handleError(_0x4c2eb7,null));};exports[_0x0132('0x4d')]=function(_0x41ef11,_0x120e13,_0x42dfe0){var _0x74d7d6={};var _0x49781f={};var _0x2c1684;var _0x269928;return db[_0x0132('0x2c')][_0x0132('0x4b')]({'where':{'id':_0x41ef11[_0x0132('0x46')]['id']}})[_0x0132('0x26')](handleEntityNotFound(_0x120e13,null))['then'](function(_0x35b5d2){if(_0x35b5d2){_0x2c1684=_0x35b5d2;_0x49781f[_0x0132('0x31')]=_[_0x0132('0x33')](db[_0x0132('0x4c')][_0x0132('0x2d')]);_0x49781f[_0x0132('0x32')]=_[_0x0132('0x33')](_0x41ef11[_0x0132('0x32')]);_0x49781f[_0x0132('0x3c')]=_['intersection'](_0x49781f[_0x0132('0x31')],_0x49781f[_0x0132('0x32')]);_0x74d7d6[_0x0132('0x35')]=_['intersection'](_0x49781f[_0x0132('0x31')],qs['fields'](_0x41ef11[_0x0132('0x32')][_0x0132('0x36')]));_0x74d7d6[_0x0132('0x35')]=_0x74d7d6[_0x0132('0x35')]['length']?_0x74d7d6[_0x0132('0x35')]:_0x49781f[_0x0132('0x31')];_0x74d7d6[_0x0132('0x39')]=qs['sort'](_0x41ef11[_0x0132('0x32')][_0x0132('0x3a')]);_0x74d7d6[_0x0132('0x3b')]=qs['filters'](_[_0x0132('0x4e')](_0x41ef11[_0x0132('0x32')],_0x49781f[_0x0132('0x3c')]));if(_0x41ef11[_0x0132('0x32')]['filter']){_0x74d7d6['where']=_[_0x0132('0x3d')](_0x74d7d6[_0x0132('0x3b')],{'$or':_['map'](_0x74d7d6[_0x0132('0x35')],function(_0x3e4deb){var _0x4ebbda={};_0x4ebbda[_0x3e4deb]={'$like':'%'+_0x41ef11[_0x0132('0x32')][_0x0132('0x3f')]+'%'};return _0x4ebbda;})});}_0x74d7d6=_[_0x0132('0x3d')]({},_0x74d7d6,_0x41ef11[_0x0132('0x40')]);return _0x2c1684[_0x0132('0x4d')](_0x74d7d6);}})[_0x0132('0x26')](function(_0x4d3af5){if(_0x4d3af5){_0x269928=_0x4d3af5[_0x0132('0x37')];if(!_0x41ef11[_0x0132('0x32')][_0x0132('0x4f')]('nolimit')){_0x74d7d6[_0x0132('0x20')]=qs[_0x0132('0x20')](_0x41ef11['query']['limit']);_0x74d7d6[_0x0132('0x1e')]=qs[_0x0132('0x1e')](_0x41ef11['query'][_0x0132('0x1e')]);}return _0x2c1684[_0x0132('0x4d')](_0x74d7d6);}})[_0x0132('0x26')](function(_0x4896fd){if(_0x4896fd){return _0x4896fd?{'count':_0x269928,'rows':_0x4896fd}:null;}})['then'](respondWithResult(_0x120e13,null))['catch'](handleError(_0x120e13,null));};exports[_0x0132('0x50')]=function(_0x4c0129,_0x309998,_0x4e8723){var _0x196828={};var _0x5a8777={};var _0x525ad2;var _0x2b22ea;return db[_0x0132('0x2c')][_0x0132('0x4b')]({'where':{'id':_0x4c0129[_0x0132('0x46')]['id']}})[_0x0132('0x26')](handleEntityNotFound(_0x309998,null))['then'](function(_0x52cdfb){if(_0x52cdfb){_0x525ad2=_0x52cdfb;_0x5a8777['model']=_[_0x0132('0x33')](db[_0x0132('0x4c')]['rawAttributes']);_0x5a8777['query']=_[_0x0132('0x33')](_0x4c0129[_0x0132('0x32')]);_0x5a8777[_0x0132('0x3c')]=_[_0x0132('0x34')](_0x5a8777[_0x0132('0x31')],_0x5a8777[_0x0132('0x32')]);_0x196828[_0x0132('0x35')]=_[_0x0132('0x34')](_0x5a8777[_0x0132('0x31')],qs['fields'](_0x4c0129[_0x0132('0x32')]['fields']));_0x196828[_0x0132('0x35')]=_0x196828['attributes']['length']?_0x196828[_0x0132('0x35')]:_0x5a8777[_0x0132('0x31')];_0x196828[_0x0132('0x39')]=qs[_0x0132('0x3a')](_0x4c0129['query'][_0x0132('0x3a')]);_0x196828['where']=qs['filters'](_[_0x0132('0x4e')](_0x4c0129['query'],_0x5a8777[_0x0132('0x3c')]));if(_0x4c0129['query'][_0x0132('0x3f')]){_0x196828[_0x0132('0x3b')]=_[_0x0132('0x3d')](_0x196828[_0x0132('0x3b')],{'$or':_['map'](_0x196828[_0x0132('0x35')],function(_0x433abd){var _0x29fc63={};_0x29fc63[_0x433abd]={'$like':'%'+_0x4c0129['query'][_0x0132('0x3f')]+'%'};return _0x29fc63;})});}_0x196828=_['merge']({},_0x196828,_0x4c0129[_0x0132('0x40')]);return _0x525ad2['getFields'](_0x196828);}})[_0x0132('0x26')](function(_0x2ae1b1){if(_0x2ae1b1){_0x2b22ea=_0x2ae1b1[_0x0132('0x37')];if(!_0x4c0129[_0x0132('0x32')][_0x0132('0x4f')](_0x0132('0x38'))){_0x196828['limit']=qs['limit'](_0x4c0129[_0x0132('0x32')][_0x0132('0x20')]);_0x196828[_0x0132('0x1e')]=qs['offset'](_0x4c0129[_0x0132('0x32')][_0x0132('0x1e')]);}return _0x525ad2[_0x0132('0x50')](_0x196828);}})['then'](function(_0x49fd1b){if(_0x49fd1b){return _0x49fd1b?{'count':_0x2b22ea,'rows':_0x49fd1b}:null;}})[_0x0132('0x26')](respondWithResult(_0x309998,null))[_0x0132('0x44')](handleError(_0x309998,null));}; \ No newline at end of file +var _0xf496=['create','body','destroy','find','rawAttributes','order','filter','getSubjects','hasOwnProperty','getDescriptions','findOne','FreshsalesField','pick','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','map','FreshsalesConfiguration','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','sort','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','include'];(function(_0x211036,_0x1fb51c){var _0x20332e=function(_0x53c57e){while(--_0x53c57e){_0x211036['push'](_0x211036['shift']());}};_0x20332e(++_0x1fb51c);}(_0xf496,0x18a));var _0x6f49=function(_0x10e508,_0xdec8c9){_0x10e508=_0x10e508-0x0;var _0x11792b=_0xf496[_0x10e508];return _0x11792b;};'use strict';var emlformat=require(_0x6f49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f49('0x1'));var jsonpatch=require(_0x6f49('0x2'));var rp=require(_0x6f49('0x3'));var moment=require(_0x6f49('0x4'));var BPromise=require(_0x6f49('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f49('0x6'));var sox=require(_0x6f49('0x7'));var csv=require(_0x6f49('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f49('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6f49('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f49('0x8'));var querystring=require(_0x6f49('0xb'));var Papa=require(_0x6f49('0xc'));var Redis=require(_0x6f49('0xd'));var authService=require(_0x6f49('0xe'));var qs=require(_0x6f49('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f49('0x10'))(_0x6f49('0x11'));var utils=require('../../config/utils');var config=require(_0x6f49('0x12'));var licenseUtil=require(_0x6f49('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29820a,_0x146c1f){_0x146c1f=_0x146c1f||0xcc;return function(_0x2c2906){if(_0x2c2906){return _0x29820a[_0x6f49('0x14')](_0x146c1f);}return _0x29820a[_0x6f49('0x15')](_0x146c1f)['end']();};}function respondWithResult(_0x3444ff,_0x52d7ae){_0x52d7ae=_0x52d7ae||0xc8;return function(_0x39d4aa){if(_0x39d4aa){return _0x3444ff[_0x6f49('0x15')](_0x52d7ae)[_0x6f49('0x16')](_0x39d4aa);}};}function respondWithFilteredResult(_0x3de1d3,_0x1faf7f){return function(_0x1700a8){if(_0x1700a8){var _0x15c166=typeof _0x1faf7f[_0x6f49('0x17')]===_0x6f49('0x18')&&typeof _0x1faf7f[_0x6f49('0x19')]===_0x6f49('0x18');var _0x306918=_0x1700a8[_0x6f49('0x1a')];var _0x253f50=_0x15c166?0x0:_0x1faf7f[_0x6f49('0x17')];var _0x3814b8=_0x15c166?_0x1700a8[_0x6f49('0x1a')]:_0x1faf7f['offset']+_0x1faf7f['limit'];var _0x4031df;if(_0x3814b8>=_0x306918){_0x3814b8=_0x306918;_0x4031df=0xc8;}else{_0x4031df=0xce;}_0x3de1d3['status'](_0x4031df);return _0x3de1d3[_0x6f49('0x1b')](_0x6f49('0x1c'),_0x253f50+'-'+_0x3814b8+'/'+_0x306918)[_0x6f49('0x16')](_0x1700a8);}return null;};}function patchUpdates(_0x21b748){return function(_0x1af4c0){try{jsonpatch[_0x6f49('0x1d')](_0x1af4c0,_0x21b748,!![]);}catch(_0x4b0767){return BPromise[_0x6f49('0x1e')](_0x4b0767);}return _0x1af4c0[_0x6f49('0x1f')]();};}function saveUpdates(_0x5126b9,_0x27cb3f){return function(_0xb85dc7){if(_0xb85dc7){return _0xb85dc7[_0x6f49('0x20')](_0x5126b9)['then'](function(_0x4ddb59){return _0x4ddb59;});}return null;};}function removeEntity(_0xaf0e99,_0x53ad15){return function(_0x4c4b85){if(_0x4c4b85){return _0x4c4b85['destroy']()[_0x6f49('0x21')](function(){_0xaf0e99[_0x6f49('0x15')](0xcc)[_0x6f49('0x22')]();});}};}function handleEntityNotFound(_0x25b750,_0x21019d){return function(_0x582b34){if(!_0x582b34){_0x25b750['sendStatus'](0x194);}return _0x582b34;};}function handleError(_0x2275a8,_0x48b2f1){_0x48b2f1=_0x48b2f1||0x1f4;return function(_0x236eb7){logger['error'](_0x236eb7[_0x6f49('0x23')]);if(_0x236eb7['name']){delete _0x236eb7[_0x6f49('0x24')];}_0x2275a8[_0x6f49('0x15')](_0x48b2f1)['send'](_0x236eb7);};}exports['index']=function(_0x4c8a44,_0x4032ce){var _0xd3218f={},_0x5292a9={},_0x5db1af={'count':0x0,'rows':[]};var _0x7f9f8=_[_0x6f49('0x25')](db[_0x6f49('0x26')]['rawAttributes'],function(_0x269e5f){return{'name':_0x269e5f[_0x6f49('0x27')],'type':_0x269e5f[_0x6f49('0x28')][_0x6f49('0x29')]};});_0x5292a9[_0x6f49('0x2a')]=_[_0x6f49('0x25')](_0x7f9f8,_0x6f49('0x24'));_0x5292a9['query']=_[_0x6f49('0x2b')](_0x4c8a44[_0x6f49('0x2c')]);_0x5292a9[_0x6f49('0x2d')]=_[_0x6f49('0x2e')](_0x5292a9[_0x6f49('0x2a')],_0x5292a9['query']);_0xd3218f[_0x6f49('0x2f')]=_[_0x6f49('0x2e')](_0x5292a9[_0x6f49('0x2a')],qs['fields'](_0x4c8a44[_0x6f49('0x2c')]['fields']));_0xd3218f['attributes']=_0xd3218f[_0x6f49('0x2f')][_0x6f49('0x30')]?_0xd3218f[_0x6f49('0x2f')]:_0x5292a9[_0x6f49('0x2a')];if(!_0x4c8a44[_0x6f49('0x2c')]['hasOwnProperty'](_0x6f49('0x31'))){_0xd3218f['limit']=qs[_0x6f49('0x19')](_0x4c8a44['query'][_0x6f49('0x19')]);_0xd3218f['offset']=qs['offset'](_0x4c8a44[_0x6f49('0x2c')][_0x6f49('0x17')]);}_0xd3218f['order']=qs[_0x6f49('0x32')](_0x4c8a44[_0x6f49('0x2c')][_0x6f49('0x32')]);_0xd3218f['where']=qs['filters'](_['pick'](_0x4c8a44[_0x6f49('0x2c')],_0x5292a9['filters']),_0x7f9f8);if(_0x4c8a44[_0x6f49('0x2c')]['filter']){_0xd3218f['where']=_[_0x6f49('0x33')](_0xd3218f[_0x6f49('0x34')],{'$or':_['map'](_0x7f9f8,function(_0x5327a8){if(_0x5327a8['type']!==_0x6f49('0x35')){var _0x140e1b={};_0x140e1b[_0x5327a8['name']]={'$like':'%'+_0x4c8a44[_0x6f49('0x2c')]['filter']+'%'};return _0x140e1b;}})});}_0xd3218f=_['merge']({},_0xd3218f,_0x4c8a44[_0x6f49('0x36')]);var _0x82fc93={'where':_0xd3218f['where']};return db['FreshsalesConfiguration'][_0x6f49('0x1a')](_0x82fc93)[_0x6f49('0x21')](function(_0x57ab03){_0x5db1af[_0x6f49('0x1a')]=_0x57ab03;if(_0x4c8a44['query'][_0x6f49('0x37')]){_0xd3218f['include']=[{'all':!![]}];}return db[_0x6f49('0x26')][_0x6f49('0x38')](_0xd3218f);})[_0x6f49('0x21')](function(_0xaa5f21){_0x5db1af[_0x6f49('0x39')]=_0xaa5f21;return _0x5db1af;})[_0x6f49('0x21')](respondWithFilteredResult(_0x4032ce,_0xd3218f))[_0x6f49('0x3a')](handleError(_0x4032ce,null));};exports['show']=function(_0x26301e,_0x760ca8){var _0x205231={'raw':![],'where':{'id':_0x26301e[_0x6f49('0x3b')]['id']}},_0x572e57={};_0x572e57[_0x6f49('0x2a')]=_[_0x6f49('0x2b')](db[_0x6f49('0x26')]['rawAttributes']);_0x572e57['query']=_[_0x6f49('0x2b')](_0x26301e[_0x6f49('0x2c')]);_0x572e57[_0x6f49('0x2d')]=_[_0x6f49('0x2e')](_0x572e57['model'],_0x572e57[_0x6f49('0x2c')]);_0x205231[_0x6f49('0x2f')]=_[_0x6f49('0x2e')](_0x572e57[_0x6f49('0x2a')],qs[_0x6f49('0x3c')](_0x26301e[_0x6f49('0x2c')][_0x6f49('0x3c')]));_0x205231[_0x6f49('0x2f')]=_0x205231[_0x6f49('0x2f')]['length']?_0x205231['attributes']:_0x572e57[_0x6f49('0x2a')];if(_0x26301e['query'][_0x6f49('0x37')]){_0x205231[_0x6f49('0x3d')]=[{'all':!![]}];}_0x205231=_[_0x6f49('0x33')]({},_0x205231,_0x26301e[_0x6f49('0x36')]);return db[_0x6f49('0x26')]['find'](_0x205231)[_0x6f49('0x21')](handleEntityNotFound(_0x760ca8,null))[_0x6f49('0x21')](respondWithResult(_0x760ca8,null))[_0x6f49('0x3a')](handleError(_0x760ca8,null));};exports[_0x6f49('0x3e')]=function(_0x566c14,_0x37e9d3){return db[_0x6f49('0x26')][_0x6f49('0x3e')](_0x566c14[_0x6f49('0x3f')],{})[_0x6f49('0x21')](respondWithResult(_0x37e9d3,0xc9))[_0x6f49('0x3a')](handleError(_0x37e9d3,null));};exports[_0x6f49('0x20')]=function(_0x21bdf5,_0x44fdbd){if(_0x21bdf5[_0x6f49('0x3f')]['id']){delete _0x21bdf5[_0x6f49('0x3f')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x21bdf5[_0x6f49('0x3b')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x44fdbd,null))['then'](saveUpdates(_0x21bdf5['body'],null))[_0x6f49('0x21')](respondWithResult(_0x44fdbd,null))[_0x6f49('0x3a')](handleError(_0x44fdbd,null));};exports[_0x6f49('0x40')]=function(_0x427a92,_0x5e7ad6){return db[_0x6f49('0x26')][_0x6f49('0x41')]({'where':{'id':_0x427a92['params']['id']}})['then'](handleEntityNotFound(_0x5e7ad6,null))['then'](removeEntity(_0x5e7ad6,null))['catch'](handleError(_0x5e7ad6,null));};exports['getSubjects']=function(_0x381e83,_0x5dca69,_0x50c750){var _0x34581e={};var _0x25fd12={};var _0x463106;var _0x2d197c;return db[_0x6f49('0x26')]['findOne']({'where':{'id':_0x381e83['params']['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x5dca69,null))['then'](function(_0x18d87d){if(_0x18d87d){_0x463106=_0x18d87d;_0x25fd12[_0x6f49('0x2a')]=_['keys'](db['FreshsalesField'][_0x6f49('0x42')]);_0x25fd12[_0x6f49('0x2c')]=_[_0x6f49('0x2b')](_0x381e83[_0x6f49('0x2c')]);_0x25fd12[_0x6f49('0x2d')]=_[_0x6f49('0x2e')](_0x25fd12[_0x6f49('0x2a')],_0x25fd12['query']);_0x34581e[_0x6f49('0x2f')]=_[_0x6f49('0x2e')](_0x25fd12[_0x6f49('0x2a')],qs['fields'](_0x381e83[_0x6f49('0x2c')][_0x6f49('0x3c')]));_0x34581e[_0x6f49('0x2f')]=_0x34581e[_0x6f49('0x2f')][_0x6f49('0x30')]?_0x34581e[_0x6f49('0x2f')]:_0x25fd12[_0x6f49('0x2a')];_0x34581e[_0x6f49('0x43')]=qs[_0x6f49('0x32')](_0x381e83[_0x6f49('0x2c')]['sort']);_0x34581e['where']=qs[_0x6f49('0x2d')](_['pick'](_0x381e83[_0x6f49('0x2c')],_0x25fd12['filters']));if(_0x381e83[_0x6f49('0x2c')]['filter']){_0x34581e['where']=_[_0x6f49('0x33')](_0x34581e[_0x6f49('0x34')],{'$or':_[_0x6f49('0x25')](_0x34581e[_0x6f49('0x2f')],function(_0x336494){var _0x74df1e={};_0x74df1e[_0x336494]={'$like':'%'+_0x381e83[_0x6f49('0x2c')][_0x6f49('0x44')]+'%'};return _0x74df1e;})});}_0x34581e=_[_0x6f49('0x33')]({},_0x34581e,_0x381e83[_0x6f49('0x36')]);return _0x463106[_0x6f49('0x45')](_0x34581e);}})['then'](function(_0xd73b9c){if(_0xd73b9c){_0x2d197c=_0xd73b9c[_0x6f49('0x30')];if(!_0x381e83[_0x6f49('0x2c')][_0x6f49('0x46')](_0x6f49('0x31'))){_0x34581e[_0x6f49('0x19')]=qs[_0x6f49('0x19')](_0x381e83[_0x6f49('0x2c')][_0x6f49('0x19')]);_0x34581e[_0x6f49('0x17')]=qs['offset'](_0x381e83[_0x6f49('0x2c')]['offset']);}return _0x463106['getSubjects'](_0x34581e);}})['then'](function(_0x31c748){if(_0x31c748){return _0x31c748?{'count':_0x2d197c,'rows':_0x31c748}:null;}})[_0x6f49('0x21')](respondWithResult(_0x5dca69,null))['catch'](handleError(_0x5dca69,null));};exports[_0x6f49('0x47')]=function(_0x4784fe,_0x4bb57e,_0x5dd24a){var _0x2e759a={};var _0x3aec49={};var _0x4452a6;var _0x1e2e3e;return db[_0x6f49('0x26')][_0x6f49('0x48')]({'where':{'id':_0x4784fe[_0x6f49('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4bb57e,null))[_0x6f49('0x21')](function(_0x1b5f61){if(_0x1b5f61){_0x4452a6=_0x1b5f61;_0x3aec49[_0x6f49('0x2a')]=_[_0x6f49('0x2b')](db[_0x6f49('0x49')][_0x6f49('0x42')]);_0x3aec49[_0x6f49('0x2c')]=_['keys'](_0x4784fe[_0x6f49('0x2c')]);_0x3aec49[_0x6f49('0x2d')]=_[_0x6f49('0x2e')](_0x3aec49['model'],_0x3aec49[_0x6f49('0x2c')]);_0x2e759a[_0x6f49('0x2f')]=_[_0x6f49('0x2e')](_0x3aec49['model'],qs[_0x6f49('0x3c')](_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x3c')]));_0x2e759a[_0x6f49('0x2f')]=_0x2e759a[_0x6f49('0x2f')][_0x6f49('0x30')]?_0x2e759a['attributes']:_0x3aec49[_0x6f49('0x2a')];_0x2e759a[_0x6f49('0x43')]=qs['sort'](_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x32')]);_0x2e759a[_0x6f49('0x34')]=qs['filters'](_['pick'](_0x4784fe[_0x6f49('0x2c')],_0x3aec49[_0x6f49('0x2d')]));if(_0x4784fe['query'][_0x6f49('0x44')]){_0x2e759a[_0x6f49('0x34')]=_[_0x6f49('0x33')](_0x2e759a[_0x6f49('0x34')],{'$or':_[_0x6f49('0x25')](_0x2e759a[_0x6f49('0x2f')],function(_0x50d40d){var _0x4a4340={};_0x4a4340[_0x50d40d]={'$like':'%'+_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x44')]+'%'};return _0x4a4340;})});}_0x2e759a=_[_0x6f49('0x33')]({},_0x2e759a,_0x4784fe[_0x6f49('0x36')]);return _0x4452a6[_0x6f49('0x47')](_0x2e759a);}})['then'](function(_0x33e00b){if(_0x33e00b){_0x1e2e3e=_0x33e00b[_0x6f49('0x30')];if(!_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x46')](_0x6f49('0x31'))){_0x2e759a[_0x6f49('0x19')]=qs[_0x6f49('0x19')](_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x19')]);_0x2e759a[_0x6f49('0x17')]=qs['offset'](_0x4784fe[_0x6f49('0x2c')][_0x6f49('0x17')]);}return _0x4452a6[_0x6f49('0x47')](_0x2e759a);}})[_0x6f49('0x21')](function(_0x2e2ebd){if(_0x2e2ebd){return _0x2e2ebd?{'count':_0x1e2e3e,'rows':_0x2e2ebd}:null;}})['then'](respondWithResult(_0x4bb57e,null))[_0x6f49('0x3a')](handleError(_0x4bb57e,null));};exports['getFields']=function(_0x135cfa,_0x2364c9,_0x2ac77c){var _0x4e9c59={};var _0x1dffd6={};var _0x557ebf;var _0x7df3b9;return db['FreshsalesConfiguration'][_0x6f49('0x48')]({'where':{'id':_0x135cfa[_0x6f49('0x3b')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x2364c9,null))[_0x6f49('0x21')](function(_0x28878d){if(_0x28878d){_0x557ebf=_0x28878d;_0x1dffd6['model']=_[_0x6f49('0x2b')](db[_0x6f49('0x49')][_0x6f49('0x42')]);_0x1dffd6[_0x6f49('0x2c')]=_[_0x6f49('0x2b')](_0x135cfa[_0x6f49('0x2c')]);_0x1dffd6[_0x6f49('0x2d')]=_[_0x6f49('0x2e')](_0x1dffd6[_0x6f49('0x2a')],_0x1dffd6[_0x6f49('0x2c')]);_0x4e9c59[_0x6f49('0x2f')]=_[_0x6f49('0x2e')](_0x1dffd6[_0x6f49('0x2a')],qs[_0x6f49('0x3c')](_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x3c')]));_0x4e9c59['attributes']=_0x4e9c59[_0x6f49('0x2f')][_0x6f49('0x30')]?_0x4e9c59[_0x6f49('0x2f')]:_0x1dffd6[_0x6f49('0x2a')];_0x4e9c59['order']=qs[_0x6f49('0x32')](_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x32')]);_0x4e9c59['where']=qs['filters'](_[_0x6f49('0x4a')](_0x135cfa[_0x6f49('0x2c')],_0x1dffd6[_0x6f49('0x2d')]));if(_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x44')]){_0x4e9c59[_0x6f49('0x34')]=_[_0x6f49('0x33')](_0x4e9c59[_0x6f49('0x34')],{'$or':_[_0x6f49('0x25')](_0x4e9c59[_0x6f49('0x2f')],function(_0x3388ad){var _0x396e23={};_0x396e23[_0x3388ad]={'$like':'%'+_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x44')]+'%'};return _0x396e23;})});}_0x4e9c59=_[_0x6f49('0x33')]({},_0x4e9c59,_0x135cfa[_0x6f49('0x36')]);return _0x557ebf[_0x6f49('0x4b')](_0x4e9c59);}})['then'](function(_0x50e82e){if(_0x50e82e){_0x7df3b9=_0x50e82e['length'];if(!_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x46')](_0x6f49('0x31'))){_0x4e9c59[_0x6f49('0x19')]=qs['limit'](_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x19')]);_0x4e9c59[_0x6f49('0x17')]=qs['offset'](_0x135cfa[_0x6f49('0x2c')][_0x6f49('0x17')]);}return _0x557ebf[_0x6f49('0x4b')](_0x4e9c59);}})['then'](function(_0x1d95aa){if(_0x1d95aa){return _0x1d95aa?{'count':_0x7df3b9,'rows':_0x1d95aa}:null;}})['then'](respondWithResult(_0x2364c9,null))[_0x6f49('0x3a')](handleError(_0x2364c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index feac87b..42ba999 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 _0xe85a=['bluebird','request-promise','path','rimraf','define','FreshsalesConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x5803d6,_0x5e61a8){var _0x78d51e=function(_0x4cfa02){while(--_0x4cfa02){_0x5803d6['push'](_0x5803d6['shift']());}};_0x78d51e(++_0x5e61a8);}(_0xe85a,0xcc));var _0xae85=function(_0x56798b,_0x425822){_0x56798b=_0x56798b-0x0;var _0x2d218b=_0xe85a[_0x56798b];return _0x2d218b;};'use strict';var _=require(_0xae85('0x0'));var util=require(_0xae85('0x1'));var logger=require(_0xae85('0x2'))(_0xae85('0x3'));var moment=require(_0xae85('0x4'));var BPromise=require(_0xae85('0x5'));var rp=require(_0xae85('0x6'));var fs=require('fs');var path=require(_0xae85('0x7'));var rimraf=require(_0xae85('0x8'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0xf64140,_0x437269){return _0xf64140[_0xae85('0x9')](_0xae85('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc541=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','util'];(function(_0x25cb72,_0x4c06ae){var _0x2165ae=function(_0x57ea51){while(--_0x57ea51){_0x25cb72['push'](_0x25cb72['shift']());}};_0x2165ae(++_0x4c06ae);}(_0xc541,0xdb));var _0x1c54=function(_0xb4947e,_0x39de27){_0xb4947e=_0xb4947e-0x0;var _0x2af6df=_0xc541[_0xb4947e];return _0x2af6df;};'use strict';var _=require(_0x1c54('0x0'));var util=require(_0x1c54('0x1'));var logger=require(_0x1c54('0x2'))(_0x1c54('0x3'));var moment=require(_0x1c54('0x4'));var BPromise=require(_0x1c54('0x5'));var rp=require(_0x1c54('0x6'));var fs=require('fs');var path=require(_0x1c54('0x7'));var rimraf=require(_0x1c54('0x8'));var config=require(_0x1c54('0x9'));var attributes=require(_0x1c54('0xa'));module[_0x1c54('0xb')]=function(_0xb5d20e,_0x227121){return _0xb5d20e['define'](_0x1c54('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index be30972..6e2495a 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 _0x8cd8=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x8cd8,0x1de));var _0x88cd=function(_0x52a235,_0x313190){_0x52a235=_0x52a235-0x0;var _0x339e12=_0x8cd8[_0x52a235];return _0x339e12;};'use strict';var _=require(_0x88cd('0x0'));var util=require(_0x88cd('0x1'));var moment=require(_0x88cd('0x2'));var BPromise=require(_0x88cd('0x3'));var rs=require(_0x88cd('0x4'));var fs=require('fs');var Redis=require(_0x88cd('0x5'));var db=require(_0x88cd('0x6'))['db'];var utils=require(_0x88cd('0x7'));var logger=require(_0x88cd('0x8'))(_0x88cd('0x9'));var config=require('../../config/environment');var jayson=require(_0x88cd('0xa'));var client=jayson[_0x88cd('0xb')][_0x88cd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44ac92,_0x192719,_0x3ec799){return new BPromise(function(_0x13c484,_0x4a5da2){return client[_0x88cd('0xd')](_0x44ac92,_0x3ec799)[_0x88cd('0xe')](function(_0x372066){logger[_0x88cd('0xf')](_0x88cd('0x10'),_0x192719,_0x88cd('0x11'));logger[_0x88cd('0x12')](_0x88cd('0x13'),_0x192719,_0x88cd('0x11'),JSON[_0x88cd('0x14')](_0x372066));if(_0x372066[_0x88cd('0x15')]){if(_0x372066[_0x88cd('0x15')][_0x88cd('0x16')]===0x1f4){logger[_0x88cd('0x15')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x192719,_0x372066[_0x88cd('0x15')]['message']);return _0x4a5da2(_0x372066[_0x88cd('0x15')]['message']);}logger[_0x88cd('0x15')](_0x88cd('0x10'),_0x192719,_0x372066['error'][_0x88cd('0x17')]);return _0x13c484(_0x372066['error']['message']);}else{logger['info'](_0x88cd('0x10'),_0x192719,_0x88cd('0x11'));_0x13c484(_0x372066['result']['message']);}})[_0x88cd('0x18')](function(_0x2dcb78){logger['error'](_0x88cd('0x10'),_0x192719,_0x2dcb78);_0x4a5da2(_0x2dcb78);});});} \ No newline at end of file +var _0xcc84=['code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xf5444f,_0x486085){var _0x3fd533=function(_0x3f4ca6){while(--_0x3f4ca6){_0xf5444f['push'](_0xf5444f['shift']());}};_0x3fd533(++_0x486085);}(_0xcc84,0x1cf));var _0x4cc8=function(_0x4f38f7,_0x2346a7){_0x4f38f7=_0x4f38f7-0x0;var _0x3e7649=_0xcc84[_0x4f38f7];return _0x3e7649;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4cc8('0x0'));var BPromise=require(_0x4cc8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cc8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4cc8('0x3'));var logger=require(_0x4cc8('0x4'))(_0x4cc8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4cc8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x8a6679,_0x1875c1,_0x2240e9){return new BPromise(function(_0x32068e,_0x5ed0ea){return client['request'](_0x8a6679,_0x2240e9)[_0x4cc8('0x7')](function(_0x28d809){logger[_0x4cc8('0x8')](_0x4cc8('0x9'),_0x1875c1,_0x4cc8('0xa'));logger['debug'](_0x4cc8('0xb'),_0x1875c1,_0x4cc8('0xa'),JSON['stringify'](_0x28d809));if(_0x28d809[_0x4cc8('0xc')]){if(_0x28d809[_0x4cc8('0xc')][_0x4cc8('0xd')]===0x1f4){logger['error'](_0x4cc8('0x9'),_0x1875c1,_0x28d809[_0x4cc8('0xc')]['message']);return _0x5ed0ea(_0x28d809[_0x4cc8('0xc')]['message']);}logger[_0x4cc8('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1875c1,_0x28d809['error'][_0x4cc8('0xe')]);return _0x32068e(_0x28d809[_0x4cc8('0xc')][_0x4cc8('0xe')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1875c1,'request\x20sent');_0x32068e(_0x28d809[_0x4cc8('0xf')][_0x4cc8('0xe')]);}})[_0x4cc8('0x10')](function(_0x1d6196){logger[_0x4cc8('0xc')](_0x4cc8('0x9'),_0x1875c1,_0x1d6196);_0x5ed0ea(_0x1d6196);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 29945aa..ee7ca0e 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 _0x4b8a=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x30d2af,_0x378716){var _0x2d1c42=function(_0x90e629){while(--_0x90e629){_0x30d2af['push'](_0x30d2af['shift']());}};_0x2d1c42(++_0x378716);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4b8a[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xa4b8('0x0'));var path=require('path');var timeout=require(_0xa4b8('0x1'));var express=require(_0xa4b8('0x2'));var router=express[_0xa4b8('0x3')]();var fs_extra=require(_0xa4b8('0x4'));var auth=require(_0xa4b8('0x5'));var interaction=require(_0xa4b8('0x6'));var config=require(_0xa4b8('0x7'));var controller=require(_0xa4b8('0x8'));router[_0xa4b8('0x9')]('/',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xb')]);router[_0xa4b8('0x9')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller['show']);router[_0xa4b8('0xd')]('/',auth[_0xa4b8('0xa')](),controller[_0xa4b8('0xe')]);router[_0xa4b8('0xf')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x10')]);router[_0xa4b8('0x11')](_0xa4b8('0xc'),auth[_0xa4b8('0xa')](),controller[_0xa4b8('0x12')]);module[_0xa4b8('0x13')]=router; \ No newline at end of file +var _0x3d9c=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d9c,0x134));var _0xc3d9=function(_0x17a376,_0x591732){_0x17a376=_0x17a376-0x0;var _0x39e454=_0x3d9c[_0x17a376];return _0x39e454;};'use strict';var multer=require(_0xc3d9('0x0'));var util=require('util');var path=require(_0xc3d9('0x1'));var timeout=require(_0xc3d9('0x2'));var express=require(_0xc3d9('0x3'));var router=express['Router']();var fs_extra=require(_0xc3d9('0x4'));var auth=require(_0xc3d9('0x5'));var interaction=require(_0xc3d9('0x6'));var config=require(_0xc3d9('0x7'));var controller=require(_0xc3d9('0x8'));router[_0xc3d9('0x9')]('/',auth[_0xc3d9('0xa')](),controller['index']);router[_0xc3d9('0x9')](_0xc3d9('0xb'),auth['isAuthenticated'](),controller[_0xc3d9('0xc')]);router['post']('/',auth[_0xc3d9('0xa')](),controller[_0xc3d9('0xd')]);router[_0xc3d9('0xe')]('/:id',auth[_0xc3d9('0xa')](),controller[_0xc3d9('0xf')]);router['delete'](_0xc3d9('0xb'),auth[_0xc3d9('0xa')](),controller[_0xc3d9('0x10')]);module[_0xc3d9('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 c204020..c0a6684 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 _0xbe96=['ENUM','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x5e03f6,_0x41ad00){var _0x2ae1c5=function(_0x592244){while(--_0x592244){_0x5e03f6['push'](_0x5e03f6['shift']());}};_0x2ae1c5(++_0x41ad00);}(_0xbe96,0x129));var _0x6be9=function(_0x33331f,_0x4f7736){_0x33331f=_0x33331f-0x0;var _0x372927=_0xbe96[_0x33331f];return _0x372927;};'use strict';var Sequelize=require(_0x6be9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6be9('0x1'),_0x6be9('0x2'),_0x6be9('0x3'),_0x6be9('0x4'),_0x6be9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6be9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6be9('0x7')](_0x6be9('0x1'),_0x6be9('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x6be9('0x6')]},'idField':{'type':Sequelize[_0x6be9('0x6')]},'nameField':{'type':Sequelize[_0x6be9('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6be9('0x6')]}}; \ No newline at end of file +var _0x2714=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2714,0x1c2));var _0x4271=function(_0x4e1859,_0x2f8bb4){_0x4e1859=_0x4e1859-0x0;var _0x3217d0=_0x2714[_0x4e1859];return _0x3217d0;};'use strict';var Sequelize=require(_0x4271('0x0'));module[_0x4271('0x1')]={'type':{'type':Sequelize[_0x4271('0x2')](_0x4271('0x3'),'variable',_0x4271('0x4'),_0x4271('0x5'),_0x4271('0x6')),'defaultValue':_0x4271('0x3')},'content':{'type':Sequelize[_0x4271('0x7')]},'key':{'type':Sequelize[_0x4271('0x7')]},'keyType':{'type':Sequelize[_0x4271('0x2')]('string',_0x4271('0x8'),_0x4271('0x4'))},'keyContent':{'type':Sequelize[_0x4271('0x7')]},'idField':{'type':Sequelize[_0x4271('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4271('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4302491..97fbb11 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 _0xfa93=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','catch','show','includeAll','options','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x5ade1d,_0x5a6f9e){var _0x52d1e7=function(_0x3af973){while(--_0x3af973){_0x5ade1d['push'](_0x5ade1d['shift']());}};_0x52d1e7(++_0x5a6f9e);}(_0xfa93,0xd4));var _0x3fa9=function(_0xe42a96,_0x610517){_0xe42a96=_0xe42a96-0x0;var _0x1e3e54=_0xfa93[_0xe42a96];return _0x1e3e54;};'use strict';var emlformat=require(_0x3fa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fa9('0x1'));var jsonpatch=require(_0x3fa9('0x2'));var rp=require(_0x3fa9('0x3'));var moment=require(_0x3fa9('0x4'));var BPromise=require(_0x3fa9('0x5'));var Mustache=require(_0x3fa9('0x6'));var util=require(_0x3fa9('0x7'));var path=require(_0x3fa9('0x8'));var sox=require(_0x3fa9('0x9'));var csv=require(_0x3fa9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fa9('0xb'));var squel=require(_0x3fa9('0xc'));var crypto=require(_0x3fa9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3fa9('0xe'));var toCsv=require(_0x3fa9('0xa'));var querystring=require(_0x3fa9('0xf'));var Papa=require(_0x3fa9('0x10'));var Redis=require('ioredis');var authService=require(_0x3fa9('0x11'));var qs=require(_0x3fa9('0x12'));var as=require(_0x3fa9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fa9('0x14'))('api');var utils=require(_0x3fa9('0x15'));var config=require(_0x3fa9('0x16'));var licenseUtil=require(_0x3fa9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499ab9,_0x1a028e){_0x1a028e=_0x1a028e||0xcc;return function(_0x211283){if(_0x211283){return _0x499ab9[_0x3fa9('0x18')](_0x1a028e);}return _0x499ab9[_0x3fa9('0x19')](_0x1a028e)['end']();};}function respondWithResult(_0x2a8f61,_0x8ced29){_0x8ced29=_0x8ced29||0xc8;return function(_0x297a56){if(_0x297a56){return _0x2a8f61[_0x3fa9('0x19')](_0x8ced29)[_0x3fa9('0x1a')](_0x297a56);}};}function respondWithFilteredResult(_0x56e897,_0x2e47ee){return function(_0x3efdeb){if(_0x3efdeb){var _0x4e78a6=typeof _0x2e47ee[_0x3fa9('0x1b')]===_0x3fa9('0x1c')&&typeof _0x2e47ee['limit']===_0x3fa9('0x1c');var _0x1b3f72=_0x3efdeb['count'];var _0x3a393c=_0x4e78a6?0x0:_0x2e47ee['offset'];var _0x53b92c=_0x4e78a6?_0x3efdeb['count']:_0x2e47ee[_0x3fa9('0x1b')]+_0x2e47ee[_0x3fa9('0x1d')];var _0x16afb0;if(_0x53b92c>=_0x1b3f72){_0x53b92c=_0x1b3f72;_0x16afb0=0xc8;}else{_0x16afb0=0xce;}_0x56e897[_0x3fa9('0x19')](_0x16afb0);return _0x56e897[_0x3fa9('0x1e')](_0x3fa9('0x1f'),_0x3a393c+'-'+_0x53b92c+'/'+_0x1b3f72)[_0x3fa9('0x1a')](_0x3efdeb);}return null;};}function patchUpdates(_0x259226){return function(_0x3e92b2){try{jsonpatch['apply'](_0x3e92b2,_0x259226,!![]);}catch(_0x36a58b){return BPromise[_0x3fa9('0x20')](_0x36a58b);}return _0x3e92b2['save']();};}function saveUpdates(_0xa71876,_0x2ac558){return function(_0x683ad1){if(_0x683ad1){return _0x683ad1['update'](_0xa71876)[_0x3fa9('0x21')](function(_0x2c5156){return _0x2c5156;});}return null;};}function removeEntity(_0x11f414,_0x43593f){return function(_0x549d3d){if(_0x549d3d){return _0x549d3d[_0x3fa9('0x22')]()[_0x3fa9('0x21')](function(){_0x11f414[_0x3fa9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27cdf8,_0x53ed20){return function(_0xa93082){if(!_0xa93082){_0x27cdf8[_0x3fa9('0x18')](0x194);}return _0xa93082;};}function handleError(_0x1aaab9,_0x44cb4c){_0x44cb4c=_0x44cb4c||0x1f4;return function(_0x4758b4){logger[_0x3fa9('0x23')](_0x4758b4[_0x3fa9('0x24')]);if(_0x4758b4['name']){delete _0x4758b4[_0x3fa9('0x25')];}_0x1aaab9['status'](_0x44cb4c)[_0x3fa9('0x26')](_0x4758b4);};}exports[_0x3fa9('0x27')]=function(_0x1cfb72,_0x167d9c){var _0xea06b3={},_0x3baa36={},_0x473763={'count':0x0,'rows':[]};var _0x47f7a2=_[_0x3fa9('0x28')](db[_0x3fa9('0x29')][_0x3fa9('0x2a')],function(_0x10abe4){return{'name':_0x10abe4[_0x3fa9('0x2b')],'type':_0x10abe4[_0x3fa9('0x2c')][_0x3fa9('0x2d')]};});_0x3baa36['model']=_[_0x3fa9('0x28')](_0x47f7a2,_0x3fa9('0x25'));_0x3baa36[_0x3fa9('0x2e')]=_[_0x3fa9('0x2f')](_0x1cfb72['query']);_0x3baa36[_0x3fa9('0x30')]=_[_0x3fa9('0x31')](_0x3baa36[_0x3fa9('0x32')],_0x3baa36[_0x3fa9('0x2e')]);_0xea06b3[_0x3fa9('0x33')]=_[_0x3fa9('0x31')](_0x3baa36[_0x3fa9('0x32')],qs[_0x3fa9('0x34')](_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x34')]));_0xea06b3[_0x3fa9('0x33')]=_0xea06b3[_0x3fa9('0x33')]['length']?_0xea06b3[_0x3fa9('0x33')]:_0x3baa36[_0x3fa9('0x32')];if(!_0x1cfb72[_0x3fa9('0x2e')]['hasOwnProperty']('nolimit')){_0xea06b3['limit']=qs[_0x3fa9('0x1d')](_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x1d')]);_0xea06b3[_0x3fa9('0x1b')]=qs[_0x3fa9('0x1b')](_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x1b')]);}_0xea06b3[_0x3fa9('0x35')]=qs[_0x3fa9('0x36')](_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x36')]);_0xea06b3[_0x3fa9('0x37')]=qs[_0x3fa9('0x30')](_[_0x3fa9('0x38')](_0x1cfb72[_0x3fa9('0x2e')],_0x3baa36[_0x3fa9('0x30')]),_0x47f7a2);if(_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x39')]){_0xea06b3[_0x3fa9('0x37')]=_[_0x3fa9('0x3a')](_0xea06b3[_0x3fa9('0x37')],{'$or':_[_0x3fa9('0x28')](_0x47f7a2,function(_0x6b01b0){if(_0x6b01b0[_0x3fa9('0x2c')]!==_0x3fa9('0x3b')){var _0x4a9d6b={};_0x4a9d6b[_0x6b01b0[_0x3fa9('0x25')]]={'$like':'%'+_0x1cfb72[_0x3fa9('0x2e')][_0x3fa9('0x39')]+'%'};return _0x4a9d6b;}})});}_0xea06b3=_['merge']({},_0xea06b3,_0x1cfb72['options']);var _0x501b0d={'where':_0xea06b3['where']};return db[_0x3fa9('0x29')][_0x3fa9('0x3c')](_0x501b0d)[_0x3fa9('0x21')](function(_0x4c139a){_0x473763[_0x3fa9('0x3c')]=_0x4c139a;if(_0x1cfb72[_0x3fa9('0x2e')]['includeAll']){_0xea06b3[_0x3fa9('0x3d')]=[{'all':!![]}];}return db[_0x3fa9('0x29')][_0x3fa9('0x3e')](_0xea06b3);})[_0x3fa9('0x21')](function(_0xf9be23){_0x473763['rows']=_0xf9be23;return _0x473763;})[_0x3fa9('0x21')](respondWithFilteredResult(_0x167d9c,_0xea06b3))[_0x3fa9('0x3f')](handleError(_0x167d9c,null));};exports[_0x3fa9('0x40')]=function(_0x29ec3f,_0x163b3f){var _0x247fca={'raw':!![],'where':{'id':_0x29ec3f['params']['id']}},_0x27b98b={};_0x27b98b[_0x3fa9('0x32')]=_[_0x3fa9('0x2f')](db[_0x3fa9('0x29')][_0x3fa9('0x2a')]);_0x27b98b[_0x3fa9('0x2e')]=_[_0x3fa9('0x2f')](_0x29ec3f[_0x3fa9('0x2e')]);_0x27b98b['filters']=_[_0x3fa9('0x31')](_0x27b98b[_0x3fa9('0x32')],_0x27b98b[_0x3fa9('0x2e')]);_0x247fca[_0x3fa9('0x33')]=_[_0x3fa9('0x31')](_0x27b98b['model'],qs[_0x3fa9('0x34')](_0x29ec3f[_0x3fa9('0x2e')][_0x3fa9('0x34')]));_0x247fca[_0x3fa9('0x33')]=_0x247fca[_0x3fa9('0x33')]['length']?_0x247fca['attributes']:_0x27b98b['model'];if(_0x29ec3f['query'][_0x3fa9('0x41')]){_0x247fca[_0x3fa9('0x3d')]=[{'all':!![]}];}_0x247fca=_[_0x3fa9('0x3a')]({},_0x247fca,_0x29ec3f[_0x3fa9('0x42')]);return db[_0x3fa9('0x29')][_0x3fa9('0x43')](_0x247fca)[_0x3fa9('0x21')](handleEntityNotFound(_0x163b3f,null))[_0x3fa9('0x21')](respondWithResult(_0x163b3f,null))[_0x3fa9('0x3f')](handleError(_0x163b3f,null));};exports[_0x3fa9('0x44')]=function(_0x3b7ddf,_0x593858){return db[_0x3fa9('0x29')][_0x3fa9('0x44')](_0x3b7ddf[_0x3fa9('0x45')],{})['then'](respondWithResult(_0x593858,0xc9))[_0x3fa9('0x3f')](handleError(_0x593858,null));};exports[_0x3fa9('0x46')]=function(_0xf2c22b,_0x3cccf4){if(_0xf2c22b[_0x3fa9('0x45')]['id']){delete _0xf2c22b['body']['id'];}return db[_0x3fa9('0x29')][_0x3fa9('0x43')]({'where':{'id':_0xf2c22b[_0x3fa9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3cccf4,null))[_0x3fa9('0x21')](saveUpdates(_0xf2c22b['body'],null))[_0x3fa9('0x21')](respondWithResult(_0x3cccf4,null))[_0x3fa9('0x3f')](handleError(_0x3cccf4,null));};exports[_0x3fa9('0x22')]=function(_0x166497,_0x34c849){return db[_0x3fa9('0x29')][_0x3fa9('0x43')]({'where':{'id':_0x166497[_0x3fa9('0x47')]['id']}})['then'](handleEntityNotFound(_0x34c849,null))[_0x3fa9('0x21')](removeEntity(_0x34c849,null))['catch'](handleError(_0x34c849,null));}; \ No newline at end of file +var _0x9094=['show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','send','index','map','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','FreshsalesField','includeAll','include','findAll','rows','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9094,0x90));var _0x4909=function(_0xedef82,_0x2a5230){_0xedef82=_0xedef82-0x0;var _0x5c1f65=_0x9094[_0xedef82];return _0x5c1f65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4909('0x0'));var zipdir=require(_0x4909('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4909('0x2'));var moment=require(_0x4909('0x3'));var BPromise=require(_0x4909('0x4'));var Mustache=require(_0x4909('0x5'));var util=require(_0x4909('0x6'));var path=require('path');var sox=require(_0x4909('0x7'));var csv=require(_0x4909('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4909('0x9'));var _=require(_0x4909('0xa'));var squel=require(_0x4909('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4909('0x8'));var querystring=require(_0x4909('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4909('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4909('0xe'));var logger=require(_0x4909('0xf'))(_0x4909('0x10'));var utils=require(_0x4909('0x11'));var config=require(_0x4909('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e5b31,_0x3fd8dc){_0x3fd8dc=_0x3fd8dc||0xcc;return function(_0x8a2ef9){if(_0x8a2ef9){return _0x3e5b31[_0x4909('0x13')](_0x3fd8dc);}return _0x3e5b31[_0x4909('0x14')](_0x3fd8dc)[_0x4909('0x15')]();};}function respondWithResult(_0x5b5902,_0x1c7df5){_0x1c7df5=_0x1c7df5||0xc8;return function(_0x4a2b0e){if(_0x4a2b0e){return _0x5b5902[_0x4909('0x14')](_0x1c7df5)['json'](_0x4a2b0e);}};}function respondWithFilteredResult(_0x50b82d,_0x456bfc){return function(_0x36d2b1){if(_0x36d2b1){var _0x248bd9=typeof _0x456bfc[_0x4909('0x16')]===_0x4909('0x17')&&typeof _0x456bfc[_0x4909('0x18')]===_0x4909('0x17');var _0x23ea4b=_0x36d2b1[_0x4909('0x19')];var _0x47dd29=_0x248bd9?0x0:_0x456bfc['offset'];var _0x287fe5=_0x248bd9?_0x36d2b1[_0x4909('0x19')]:_0x456bfc['offset']+_0x456bfc['limit'];var _0x16077b;if(_0x287fe5>=_0x23ea4b){_0x287fe5=_0x23ea4b;_0x16077b=0xc8;}else{_0x16077b=0xce;}_0x50b82d[_0x4909('0x14')](_0x16077b);return _0x50b82d[_0x4909('0x1a')](_0x4909('0x1b'),_0x47dd29+'-'+_0x287fe5+'/'+_0x23ea4b)['json'](_0x36d2b1);}return null;};}function patchUpdates(_0x41db76){return function(_0x1249a2){try{jsonpatch[_0x4909('0x1c')](_0x1249a2,_0x41db76,!![]);}catch(_0x93df50){return BPromise['reject'](_0x93df50);}return _0x1249a2[_0x4909('0x1d')]();};}function saveUpdates(_0x495554,_0x1c9da3){return function(_0x1cbce6){if(_0x1cbce6){return _0x1cbce6[_0x4909('0x1e')](_0x495554)[_0x4909('0x1f')](function(_0xe3a1fe){return _0xe3a1fe;});}return null;};}function removeEntity(_0x3ed6cd,_0x38cc1b){return function(_0x99bf34){if(_0x99bf34){return _0x99bf34[_0x4909('0x20')]()[_0x4909('0x1f')](function(){_0x3ed6cd[_0x4909('0x14')](0xcc)[_0x4909('0x15')]();});}};}function handleEntityNotFound(_0x54b46b,_0x3af69d){return function(_0x280f68){if(!_0x280f68){_0x54b46b[_0x4909('0x13')](0x194);}return _0x280f68;};}function handleError(_0x20374a,_0x1fee76){_0x1fee76=_0x1fee76||0x1f4;return function(_0x5b2fe1){logger[_0x4909('0x21')](_0x5b2fe1['stack']);if(_0x5b2fe1['name']){delete _0x5b2fe1['name'];}_0x20374a['status'](_0x1fee76)[_0x4909('0x22')](_0x5b2fe1);};}exports[_0x4909('0x23')]=function(_0x3af7bd,_0x49e25f){var _0x4cecf1={},_0x251b0a={},_0x2eaa5e={'count':0x0,'rows':[]};var _0x383dd8=_[_0x4909('0x24')](db['FreshsalesField'][_0x4909('0x25')],function(_0x96aa55){return{'name':_0x96aa55[_0x4909('0x26')],'type':_0x96aa55[_0x4909('0x27')][_0x4909('0x28')]};});_0x251b0a['model']=_[_0x4909('0x24')](_0x383dd8,_0x4909('0x29'));_0x251b0a[_0x4909('0x2a')]=_['keys'](_0x3af7bd[_0x4909('0x2a')]);_0x251b0a[_0x4909('0x2b')]=_[_0x4909('0x2c')](_0x251b0a[_0x4909('0x2d')],_0x251b0a['query']);_0x4cecf1[_0x4909('0x2e')]=_[_0x4909('0x2c')](_0x251b0a[_0x4909('0x2d')],qs[_0x4909('0x2f')](_0x3af7bd[_0x4909('0x2a')][_0x4909('0x2f')]));_0x4cecf1['attributes']=_0x4cecf1[_0x4909('0x2e')][_0x4909('0x30')]?_0x4cecf1[_0x4909('0x2e')]:_0x251b0a[_0x4909('0x2d')];if(!_0x3af7bd['query'][_0x4909('0x31')]('nolimit')){_0x4cecf1[_0x4909('0x18')]=qs[_0x4909('0x18')](_0x3af7bd[_0x4909('0x2a')][_0x4909('0x18')]);_0x4cecf1[_0x4909('0x16')]=qs['offset'](_0x3af7bd[_0x4909('0x2a')][_0x4909('0x16')]);}_0x4cecf1[_0x4909('0x32')]=qs[_0x4909('0x33')](_0x3af7bd[_0x4909('0x2a')][_0x4909('0x33')]);_0x4cecf1[_0x4909('0x34')]=qs[_0x4909('0x2b')](_[_0x4909('0x35')](_0x3af7bd['query'],_0x251b0a[_0x4909('0x2b')]),_0x383dd8);if(_0x3af7bd['query'][_0x4909('0x36')]){_0x4cecf1[_0x4909('0x34')]=_[_0x4909('0x37')](_0x4cecf1['where'],{'$or':_['map'](_0x383dd8,function(_0x1b937c){if(_0x1b937c[_0x4909('0x27')]!=='VIRTUAL'){var _0x1e6f50={};_0x1e6f50[_0x1b937c['name']]={'$like':'%'+_0x3af7bd[_0x4909('0x2a')][_0x4909('0x36')]+'%'};return _0x1e6f50;}})});}_0x4cecf1=_[_0x4909('0x37')]({},_0x4cecf1,_0x3af7bd[_0x4909('0x38')]);var _0xb27ac1={'where':_0x4cecf1['where']};return db[_0x4909('0x39')][_0x4909('0x19')](_0xb27ac1)['then'](function(_0x2861a8){_0x2eaa5e[_0x4909('0x19')]=_0x2861a8;if(_0x3af7bd[_0x4909('0x2a')][_0x4909('0x3a')]){_0x4cecf1[_0x4909('0x3b')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4909('0x3c')](_0x4cecf1);})[_0x4909('0x1f')](function(_0x466cb0){_0x2eaa5e[_0x4909('0x3d')]=_0x466cb0;return _0x2eaa5e;})[_0x4909('0x1f')](respondWithFilteredResult(_0x49e25f,_0x4cecf1))[_0x4909('0x3e')](handleError(_0x49e25f,null));};exports[_0x4909('0x3f')]=function(_0x5b30af,_0x15f688){var _0x419c1b={'raw':!![],'where':{'id':_0x5b30af[_0x4909('0x40')]['id']}},_0x7be539={};_0x7be539[_0x4909('0x2d')]=_['keys'](db[_0x4909('0x39')]['rawAttributes']);_0x7be539[_0x4909('0x2a')]=_[_0x4909('0x41')](_0x5b30af[_0x4909('0x2a')]);_0x7be539['filters']=_[_0x4909('0x2c')](_0x7be539[_0x4909('0x2d')],_0x7be539['query']);_0x419c1b[_0x4909('0x2e')]=_['intersection'](_0x7be539[_0x4909('0x2d')],qs[_0x4909('0x2f')](_0x5b30af[_0x4909('0x2a')][_0x4909('0x2f')]));_0x419c1b['attributes']=_0x419c1b[_0x4909('0x2e')][_0x4909('0x30')]?_0x419c1b[_0x4909('0x2e')]:_0x7be539['model'];if(_0x5b30af[_0x4909('0x2a')]['includeAll']){_0x419c1b[_0x4909('0x3b')]=[{'all':!![]}];}_0x419c1b=_['merge']({},_0x419c1b,_0x5b30af['options']);return db[_0x4909('0x39')][_0x4909('0x42')](_0x419c1b)['then'](handleEntityNotFound(_0x15f688,null))['then'](respondWithResult(_0x15f688,null))[_0x4909('0x3e')](handleError(_0x15f688,null));};exports[_0x4909('0x43')]=function(_0x19c6e2,_0x104781){return db[_0x4909('0x39')][_0x4909('0x43')](_0x19c6e2[_0x4909('0x44')],{})[_0x4909('0x1f')](respondWithResult(_0x104781,0xc9))['catch'](handleError(_0x104781,null));};exports[_0x4909('0x1e')]=function(_0x3c5ae4,_0x4dcd25){if(_0x3c5ae4[_0x4909('0x44')]['id']){delete _0x3c5ae4[_0x4909('0x44')]['id'];}return db[_0x4909('0x39')][_0x4909('0x42')]({'where':{'id':_0x3c5ae4[_0x4909('0x40')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x4dcd25,null))[_0x4909('0x1f')](saveUpdates(_0x3c5ae4[_0x4909('0x44')],null))['then'](respondWithResult(_0x4dcd25,null))[_0x4909('0x3e')](handleError(_0x4dcd25,null));};exports[_0x4909('0x20')]=function(_0x44f210,_0x5a7d03){return db[_0x4909('0x39')][_0x4909('0x42')]({'where':{'id':_0x44f210[_0x4909('0x40')]['id']}})[_0x4909('0x1f')](handleEntityNotFound(_0x5a7d03,null))[_0x4909('0x1f')](removeEntity(_0x5a7d03,null))[_0x4909('0x3e')](handleError(_0x5a7d03,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 6590deb..1b6192a 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 _0xbf13=['../../config/logger','api','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util'];(function(_0x9564af,_0x577e06){var _0x15dfad=function(_0x2413a8){while(--_0x2413a8){_0x9564af['push'](_0x9564af['shift']());}};_0x15dfad(++_0x577e06);}(_0xbf13,0xe2));var _0x3bf1=function(_0x22500e,_0x550954){_0x22500e=_0x22500e-0x0;var _0x3452e3=_0xbf13[_0x22500e];return _0x3452e3;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var logger=require(_0x3bf1('0x2'))(_0x3bf1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3bf1('0x4'));var fs=require('fs');var path=require(_0x3bf1('0x5'));var rimraf=require('rimraf');var config=require(_0x3bf1('0x6'));var attributes=require(_0x3bf1('0x7'));module[_0x3bf1('0x8')]=function(_0x227e3a,_0x172690){return _0x227e3a['define']('FreshsalesField',attributes,{'tableName':_0x3bf1('0x9'),'paranoid':![],'indexes':[{'name':_0x3bf1('0xa'),'fields':['idField',_0x3bf1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa064=['path','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3b629c,_0x52a4b7){var _0x9dc71b=function(_0x549101){while(--_0x549101){_0x3b629c['push'](_0x3b629c['shift']());}};_0x9dc71b(++_0x52a4b7);}(_0xa064,0x192));var _0x4a06=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0xa064[_0x2c3a8f];return _0x189412;};'use strict';var _=require(_0x4a06('0x0'));var util=require(_0x4a06('0x1'));var logger=require(_0x4a06('0x2'))(_0x4a06('0x3'));var moment=require(_0x4a06('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a06('0x5'));var rimraf=require('rimraf');var config=require(_0x4a06('0x6'));var attributes=require(_0x4a06('0x7'));module['exports']=function(_0x3f2099,_0x54c9ed){return _0x3f2099['define'](_0x4a06('0x8'),attributes,{'tableName':_0x4a06('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0x4a06('0xa')],'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 5749af9..8ba57f2 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 _0x2a07=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x30f3b7,_0x224df1){var _0x249068=function(_0x54609e){while(--_0x54609e){_0x30f3b7['push'](_0x30f3b7['shift']());}};_0x249068(++_0x224df1);}(_0x2a07,0x74));var _0x72a0=function(_0x3ffd40,_0x4c65b8){_0x3ffd40=_0x3ffd40-0x0;var _0x14309d=_0x2a07[_0x3ffd40];return _0x14309d;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x524e,0x15e));var _0xe524=function(_0x1dda75,_0x4936ab){_0x1dda75=_0x1dda75-0x0;var _0xd9f07b=_0x524e[_0x1dda75];return _0xd9f07b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index ce36a0d..df4c941 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(_0x2e3671,_0x27065d){var _0x4f9c39=function(_0x10ae6d){while(--_0x10ae6d){_0x2e3671['push'](_0x2e3671['shift']());}};_0x4f9c39(++_0x27065d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x36c1df,_0x3dec7d){var _0x17b291=function(_0x584d4b){while(--_0x584d4b){_0x36c1df['push'](_0x36c1df['shift']());}};_0x17b291(++_0x3dec7d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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 0b42852..7cb86b2 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 _0x3c6a=['STRING','username','integrationTab','newTab','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3c6a,0xd1));var _0xa3c6=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x3c6a[_0x26fc81];return _0x9feece;};'use strict';var Sequelize=require('sequelize');module[_0xa3c6('0x0')]={'name':{'type':Sequelize[_0xa3c6('0x1')]},'description':{'type':Sequelize[_0xa3c6('0x1')]},'username':{'type':Sequelize[_0xa3c6('0x1')],'unique':_0xa3c6('0x2')},'remoteUri':{'type':Sequelize[_0xa3c6('0x1')]},'password':{'type':Sequelize[_0xa3c6('0x1')]},'clientId':{'type':Sequelize[_0xa3c6('0x1')]},'clientSecret':{'type':Sequelize[_0xa3c6('0x1')]},'securityToken':{'type':Sequelize[_0xa3c6('0x1')]},'serverUrl':{'type':Sequelize[_0xa3c6('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa3c6('0x3'),_0xa3c6('0x4')),'defaultValue':_0xa3c6('0x3')}}; \ No newline at end of file +var _0x6426=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x6426,0x15b));var _0x6642=function(_0x52cd46,_0x487e80){_0x52cd46=_0x52cd46-0x0;var _0x134204=_0x6426[_0x52cd46];return _0x134204;};'use strict';var Sequelize=require(_0x6642('0x0'));module[_0x6642('0x1')]={'name':{'type':Sequelize[_0x6642('0x2')]},'description':{'type':Sequelize[_0x6642('0x2')]},'username':{'type':Sequelize[_0x6642('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x6642('0x2')]},'password':{'type':Sequelize[_0x6642('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6642('0x2')]},'securityToken':{'type':Sequelize[_0x6642('0x2')]},'serverUrl':{'type':Sequelize[_0x6642('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6642('0x3')](_0x6642('0x4'),_0x6642('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5d5eb68..f18af84 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 _0x4cad=['fields','attributes','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','SalesforceAccount','includeAll','findAll','rows','catch','params','keys','include','find','create','body','getConfigurations','findOne','length','nolimit','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientSecret','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','includes','label','custom','picklistValues','value','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','rawAttributes','type','key','map','intersection','model','query'];(function(_0x55e565,_0x371bf7){var _0x21b288=function(_0x3fabcf){while(--_0x3fabcf){_0x55e565['push'](_0x55e565['shift']());}};_0x21b288(++_0x371bf7);}(_0x4cad,0x1b9));var _0xd4ca=function(_0xc2e65d,_0x37b1b4){_0xc2e65d=_0xc2e65d-0x0;var _0x5b8c86=_0x4cad[_0xc2e65d];return _0x5b8c86;};'use strict';var emlformat=require(_0xd4ca('0x0'));var rimraf=require(_0xd4ca('0x1'));var zipdir=require(_0xd4ca('0x2'));var jsonpatch=require(_0xd4ca('0x3'));var rp=require('request-promise');var moment=require(_0xd4ca('0x4'));var BPromise=require(_0xd4ca('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4ca('0x6'));var sox=require(_0xd4ca('0x7'));var csv=require(_0xd4ca('0x8'));var ejs=require(_0xd4ca('0x9'));var fs=require('fs');var fs_extra=require(_0xd4ca('0xa'));var _=require(_0xd4ca('0xb'));var squel=require(_0xd4ca('0xc'));var crypto=require(_0xd4ca('0xd'));var jsforce=require(_0xd4ca('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd4ca('0xf'));var Papa=require('papaparse');var Redis=require(_0xd4ca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd4ca('0x11'));var as=require(_0xd4ca('0x12'));var hardwareService=require(_0xd4ca('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd4ca('0x14'));var config=require(_0xd4ca('0x15'));var licenseUtil=require(_0xd4ca('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd4ca('0x17'));function respondWithStatusCode(_0x2e6fd9,_0x20f5e3){_0x20f5e3=_0x20f5e3||0xcc;return function(_0xb8cb04){if(_0xb8cb04){return _0x2e6fd9[_0xd4ca('0x18')](_0x20f5e3);}return _0x2e6fd9[_0xd4ca('0x19')](_0x20f5e3)['end']();};}function respondWithResult(_0x5b64e1,_0x271e7d){_0x271e7d=_0x271e7d||0xc8;return function(_0x4f5f6c){if(_0x4f5f6c){return _0x5b64e1['status'](_0x271e7d)['json'](_0x4f5f6c);}};}function respondWithFilteredResult(_0x367822,_0x59bbd6){return function(_0x29d85c){if(_0x29d85c){var _0x52d788=typeof _0x59bbd6['offset']===_0xd4ca('0x1a')&&typeof _0x59bbd6[_0xd4ca('0x1b')]===_0xd4ca('0x1a');var _0x22b5c9=_0x29d85c[_0xd4ca('0x1c')];var _0x13b21a=_0x52d788?0x0:_0x59bbd6['offset'];var _0x125776=_0x52d788?_0x29d85c[_0xd4ca('0x1c')]:_0x59bbd6[_0xd4ca('0x1d')]+_0x59bbd6['limit'];var _0x34f5cf;if(_0x125776>=_0x22b5c9){_0x125776=_0x22b5c9;_0x34f5cf=0xc8;}else{_0x34f5cf=0xce;}_0x367822['status'](_0x34f5cf);return _0x367822[_0xd4ca('0x1e')](_0xd4ca('0x1f'),_0x13b21a+'-'+_0x125776+'/'+_0x22b5c9)[_0xd4ca('0x20')](_0x29d85c);}return null;};}function patchUpdates(_0x31d0ce){return function(_0x535cde){try{jsonpatch[_0xd4ca('0x21')](_0x535cde,_0x31d0ce,!![]);}catch(_0x5653f5){return BPromise[_0xd4ca('0x22')](_0x5653f5);}return _0x535cde[_0xd4ca('0x23')]();};}function saveUpdates(_0x29589d,_0x958dc1){return function(_0x43a47c){if(_0x43a47c){return _0x43a47c[_0xd4ca('0x24')](_0x29589d)[_0xd4ca('0x25')](function(_0x209026){return _0x209026;});}return null;};}function removeEntity(_0x4bad7d,_0x59bb6b){return function(_0xb28225){if(_0xb28225){return _0xb28225[_0xd4ca('0x26')]()['then'](function(){_0x4bad7d[_0xd4ca('0x19')](0xcc)[_0xd4ca('0x27')]();});}};}function handleEntityNotFound(_0x4035e0,_0x471081){return function(_0x1ce357){if(!_0x1ce357){_0x4035e0[_0xd4ca('0x18')](0x194);}return _0x1ce357;};}function handleError(_0xc00818,_0x24614c){_0x24614c=_0x24614c||0x1f4;return function(_0x1fb0b8){logger[_0xd4ca('0x28')](_0x1fb0b8[_0xd4ca('0x29')]);if(_0x1fb0b8[_0xd4ca('0x2a')]){delete _0x1fb0b8[_0xd4ca('0x2a')];}_0xc00818['status'](_0x24614c)[_0xd4ca('0x2b')](_0x1fb0b8);};}exports['index']=function(_0x526f39,_0x1bb4bf){var _0x5203df={},_0x1fa926={},_0x348d70={'count':0x0,'rows':[]};var _0x262934=_['map'](db['SalesforceAccount'][_0xd4ca('0x2c')],function(_0x5286c5){return{'name':_0x5286c5['fieldName'],'type':_0x5286c5[_0xd4ca('0x2d')][_0xd4ca('0x2e')]};});_0x1fa926['model']=_[_0xd4ca('0x2f')](_0x262934,_0xd4ca('0x2a'));_0x1fa926['query']=_['keys'](_0x526f39['query']);_0x1fa926['filters']=_[_0xd4ca('0x30')](_0x1fa926[_0xd4ca('0x31')],_0x1fa926[_0xd4ca('0x32')]);_0x5203df['attributes']=_[_0xd4ca('0x30')](_0x1fa926[_0xd4ca('0x31')],qs['fields'](_0x526f39['query'][_0xd4ca('0x33')]));_0x5203df[_0xd4ca('0x34')]=_0x5203df[_0xd4ca('0x34')]['length']?_0x5203df['attributes']:_0x1fa926['model'];if(!_0x526f39[_0xd4ca('0x32')][_0xd4ca('0x35')]('nolimit')){_0x5203df['limit']=qs[_0xd4ca('0x1b')](_0x526f39[_0xd4ca('0x32')][_0xd4ca('0x1b')]);_0x5203df[_0xd4ca('0x1d')]=qs[_0xd4ca('0x1d')](_0x526f39[_0xd4ca('0x32')][_0xd4ca('0x1d')]);}_0x5203df[_0xd4ca('0x36')]=qs[_0xd4ca('0x37')](_0x526f39[_0xd4ca('0x32')][_0xd4ca('0x37')]);_0x5203df[_0xd4ca('0x38')]=qs[_0xd4ca('0x39')](_[_0xd4ca('0x3a')](_0x526f39[_0xd4ca('0x32')],_0x1fa926[_0xd4ca('0x39')]),_0x262934);if(_0x526f39[_0xd4ca('0x32')]['filter']){_0x5203df[_0xd4ca('0x38')]=_[_0xd4ca('0x3b')](_0x5203df[_0xd4ca('0x38')],{'$or':_[_0xd4ca('0x2f')](_0x262934,function(_0x237313){if(_0x237313[_0xd4ca('0x2d')]!=='VIRTUAL'){var _0x9b5bbe={};_0x9b5bbe[_0x237313[_0xd4ca('0x2a')]]={'$like':'%'+_0x526f39['query'][_0xd4ca('0x3c')]+'%'};return _0x9b5bbe;}})});}_0x5203df=_[_0xd4ca('0x3b')]({},_0x5203df,_0x526f39[_0xd4ca('0x3d')]);var _0x58ec4a={'where':_0x5203df[_0xd4ca('0x38')]};return db[_0xd4ca('0x3e')][_0xd4ca('0x1c')](_0x58ec4a)[_0xd4ca('0x25')](function(_0xbda2e1){_0x348d70['count']=_0xbda2e1;if(_0x526f39['query'][_0xd4ca('0x3f')]){_0x5203df['include']=[{'all':!![]}];}return db[_0xd4ca('0x3e')][_0xd4ca('0x40')](_0x5203df);})[_0xd4ca('0x25')](function(_0x44c6df){_0x348d70[_0xd4ca('0x41')]=_0x44c6df;return _0x348d70;})[_0xd4ca('0x25')](respondWithFilteredResult(_0x1bb4bf,_0x5203df))[_0xd4ca('0x42')](handleError(_0x1bb4bf,null));};exports['show']=function(_0x50662a,_0x154de7){var _0x3132ee={'raw':![],'where':{'id':_0x50662a[_0xd4ca('0x43')]['id']}},_0x59fd64={};_0x59fd64[_0xd4ca('0x31')]=_[_0xd4ca('0x44')](db['SalesforceAccount']['rawAttributes']);_0x59fd64[_0xd4ca('0x32')]=_['keys'](_0x50662a[_0xd4ca('0x32')]);_0x59fd64[_0xd4ca('0x39')]=_[_0xd4ca('0x30')](_0x59fd64[_0xd4ca('0x31')],_0x59fd64[_0xd4ca('0x32')]);_0x3132ee['attributes']=_[_0xd4ca('0x30')](_0x59fd64[_0xd4ca('0x31')],qs[_0xd4ca('0x33')](_0x50662a[_0xd4ca('0x32')][_0xd4ca('0x33')]));_0x3132ee[_0xd4ca('0x34')]=_0x3132ee[_0xd4ca('0x34')]['length']?_0x3132ee[_0xd4ca('0x34')]:_0x59fd64[_0xd4ca('0x31')];if(_0x50662a[_0xd4ca('0x32')][_0xd4ca('0x3f')]){_0x3132ee[_0xd4ca('0x45')]=[{'all':!![]}];}_0x3132ee=_[_0xd4ca('0x3b')]({},_0x3132ee,_0x50662a[_0xd4ca('0x3d')]);return db[_0xd4ca('0x3e')][_0xd4ca('0x46')](_0x3132ee)[_0xd4ca('0x25')](handleEntityNotFound(_0x154de7,null))['then'](respondWithResult(_0x154de7,null))[_0xd4ca('0x42')](handleError(_0x154de7,null));};exports[_0xd4ca('0x47')]=function(_0x155819,_0x1cf019){return db[_0xd4ca('0x3e')]['create'](_0x155819['body'],{})[_0xd4ca('0x25')](respondWithResult(_0x1cf019,0xc9))[_0xd4ca('0x42')](handleError(_0x1cf019,null));};exports[_0xd4ca('0x24')]=function(_0x4ca4f6,_0x253898){if(_0x4ca4f6[_0xd4ca('0x48')]['id']){delete _0x4ca4f6['body']['id'];}return db[_0xd4ca('0x3e')]['find']({'where':{'id':_0x4ca4f6[_0xd4ca('0x43')]['id']}})[_0xd4ca('0x25')](handleEntityNotFound(_0x253898,null))['then'](saveUpdates(_0x4ca4f6[_0xd4ca('0x48')],null))[_0xd4ca('0x25')](respondWithResult(_0x253898,null))[_0xd4ca('0x42')](handleError(_0x253898,null));};exports['destroy']=function(_0x3a235a,_0x48fb6a){return db['SalesforceAccount'][_0xd4ca('0x46')]({'where':{'id':_0x3a235a[_0xd4ca('0x43')]['id']}})[_0xd4ca('0x25')](handleEntityNotFound(_0x48fb6a,null))[_0xd4ca('0x25')](removeEntity(_0x48fb6a,null))[_0xd4ca('0x42')](handleError(_0x48fb6a,null));};exports[_0xd4ca('0x49')]=function(_0x304a46,_0x55c3a4,_0x1fef0a){var _0x4c9591={};var _0x500b8b={};var _0x129122;var _0x53f1f1;return db[_0xd4ca('0x3e')][_0xd4ca('0x4a')]({'where':{'id':_0x304a46['params']['id']}})[_0xd4ca('0x25')](handleEntityNotFound(_0x55c3a4,null))[_0xd4ca('0x25')](function(_0x37361e){if(_0x37361e){_0x129122=_0x37361e;_0x500b8b[_0xd4ca('0x31')]=_[_0xd4ca('0x44')](db['SalesforceConfiguration']['rawAttributes']);_0x500b8b[_0xd4ca('0x32')]=_['keys'](_0x304a46['query']);_0x500b8b[_0xd4ca('0x39')]=_[_0xd4ca('0x30')](_0x500b8b['model'],_0x500b8b[_0xd4ca('0x32')]);_0x4c9591['attributes']=_['intersection'](_0x500b8b[_0xd4ca('0x31')],qs[_0xd4ca('0x33')](_0x304a46[_0xd4ca('0x32')][_0xd4ca('0x33')]));_0x4c9591[_0xd4ca('0x34')]=_0x4c9591[_0xd4ca('0x34')]['length']?_0x4c9591[_0xd4ca('0x34')]:_0x500b8b[_0xd4ca('0x31')];_0x4c9591[_0xd4ca('0x36')]=qs['sort'](_0x304a46[_0xd4ca('0x32')]['sort']);_0x4c9591[_0xd4ca('0x38')]=qs['filters'](_[_0xd4ca('0x3a')](_0x304a46['query'],_0x500b8b['filters']));if(_0x304a46[_0xd4ca('0x32')]['filter']){_0x4c9591[_0xd4ca('0x38')]=_[_0xd4ca('0x3b')](_0x4c9591[_0xd4ca('0x38')],{'$or':_[_0xd4ca('0x2f')](_0x4c9591[_0xd4ca('0x34')],function(_0x53bd54){var _0x5553e4={};_0x5553e4[_0x53bd54]={'$like':'%'+_0x304a46[_0xd4ca('0x32')][_0xd4ca('0x3c')]+'%'};return _0x5553e4;})});}_0x4c9591=_[_0xd4ca('0x3b')]({},_0x4c9591,_0x304a46[_0xd4ca('0x3d')]);return _0x129122[_0xd4ca('0x49')](_0x4c9591);}})['then'](function(_0x5ecc6a){if(_0x5ecc6a){_0x53f1f1=_0x5ecc6a[_0xd4ca('0x4b')];if(!_0x304a46[_0xd4ca('0x32')]['hasOwnProperty'](_0xd4ca('0x4c'))){_0x4c9591[_0xd4ca('0x1b')]=qs[_0xd4ca('0x1b')](_0x304a46[_0xd4ca('0x32')]['limit']);_0x4c9591[_0xd4ca('0x1d')]=qs[_0xd4ca('0x1d')](_0x304a46[_0xd4ca('0x32')][_0xd4ca('0x1d')]);}return _0x129122['getConfigurations'](_0x4c9591);}})[_0xd4ca('0x25')](function(_0x233614){if(_0x233614){return _0x233614?{'count':_0x53f1f1,'rows':_0x233614}:null;}})[_0xd4ca('0x25')](respondWithResult(_0x55c3a4,null))[_0xd4ca('0x42')](handleError(_0x55c3a4,null));};exports[_0xd4ca('0x4d')]=function(_0x58fb35,_0x223c14,_0x10cc5e){if(_0x58fb35[_0xd4ca('0x48')]['id']){delete _0x58fb35[_0xd4ca('0x48')]['id'];}return db[_0xd4ca('0x3e')][_0xd4ca('0x4a')]({'where':{'id':_0x58fb35[_0xd4ca('0x43')]['id']}})[_0xd4ca('0x25')](handleEntityNotFound(_0x223c14,null))[_0xd4ca('0x25')](function(_0x372ee0){if(_0x372ee0){_0x58fb35['body']['AccountId']=_0x372ee0['id'];_0x58fb35['body'][_0xd4ca('0x4e')]=integrations['getSubjects'](_0x58fb35[_0xd4ca('0x48')][_0xd4ca('0x4f')],_0x58fb35[_0xd4ca('0x48')][_0xd4ca('0x2d')]);_0x58fb35[_0xd4ca('0x48')][_0xd4ca('0x50')]=integrations[_0xd4ca('0x51')](_0x58fb35[_0xd4ca('0x48')][_0xd4ca('0x4f')],_0x58fb35[_0xd4ca('0x48')]['type']);return db[_0xd4ca('0x52')][_0xd4ca('0x47')](_0x58fb35[_0xd4ca('0x48')],{'include':[{'model':db[_0xd4ca('0x53')],'as':_0xd4ca('0x4e')},{'model':db[_0xd4ca('0x53')],'as':_0xd4ca('0x50')}]});}return null;})[_0xd4ca('0x25')](respondWithResult(_0x223c14,null))['catch'](handleError(_0x223c14,null));};exports[_0xd4ca('0x54')]=function(_0x33054e,_0x1c5764,_0xb7916e){var _0x5e0fd2;var _0x44e855='';var _0x42b473=_0xd4ca('0x55');return db[_0xd4ca('0x3e')][_0xd4ca('0x4a')]({'where':{'id':_0x33054e[_0xd4ca('0x43')]['id']},'attributes':['id',_0xd4ca('0x56'),'clientId',_0xd4ca('0x57'),'username',_0xd4ca('0x58'),_0xd4ca('0x59')]})[_0xd4ca('0x25')](handleEntityNotFound(_0x1c5764,null))[_0xd4ca('0x25')](function(_0xc2b425){if(_0xc2b425){_0x44e855=_0xc2b425[_0xd4ca('0x56')];var _0x1eee30=_0x44e855[_0xd4ca('0x5a')](-0x1);if(_0x1eee30==='/'){_0x44e855=_0x44e855[_0xd4ca('0x5b')](0x0,_0x44e855[_0xd4ca('0x5c')](_0x1eee30));}_0x5e0fd2=new jsforce[(_0xd4ca('0x5d'))]({'oauth2':{'loginUrl':_0x44e855,'clientId':_0xc2b425['clientId'],'clientSecret':_0xc2b425[_0xd4ca('0x57')]}});return _0x5e0fd2[_0xd4ca('0x5e')](_0xc2b425['username'],_0xc2b425[_0xd4ca('0x58')][_0xd4ca('0x5f')](_0xc2b425[_0xd4ca('0x59')]));}})[_0xd4ca('0x25')](function(_0x10c6d4){if(_0x10c6d4){if(!_[_0xd4ca('0x60')](_0x33054e[_0xd4ca('0x32')][_0xd4ca('0x61')])){_0x42b473=_0x33054e[_0xd4ca('0x32')]['ticketType'];}return _0x5e0fd2[_0xd4ca('0x62')](_0x42b473)['describe']();}})[_0xd4ca('0x25')](function(_0x1116f6){var _0x4d4174=[_0xd4ca('0x63'),_0xd4ca('0x64'),_0xd4ca('0x65'),_0xd4ca('0x66'),_0xd4ca('0x67'),_0xd4ca('0x68')];var _0x1d3963=[_0xd4ca('0x69'),_0xd4ca('0x6a'),_0xd4ca('0x6b'),_0xd4ca('0x6c'),_0xd4ca('0x6d'),_0xd4ca('0x6e'),'phone'];if(_0x1116f6){_['remove'](_0x1116f6[_0xd4ca('0x33')],function(_0x16384){return _0x4d4174[_0xd4ca('0x6f')](_0x16384['name'])||!_0x1d3963[_0xd4ca('0x6f')](_0x16384[_0xd4ca('0x2d')]);});return{'count':_0x1116f6[_0xd4ca('0x33')][_0xd4ca('0x4b')],'rows':_[_0xd4ca('0x2f')](_0x1116f6[_0xd4ca('0x33')],function(_0x1cb886){return{'id':_0x1cb886[_0xd4ca('0x2a')],'name':_0x1cb886[_0xd4ca('0x70')],'custom':_0x1cb886[_0xd4ca('0x71')],'options':_0x1cb886[_0xd4ca('0x72')][_0xd4ca('0x4b')]>0x0?_[_0xd4ca('0x2f')](_0x1cb886[_0xd4ca('0x72')],function(_0x4549a1){return{'name':_0x4549a1[_0xd4ca('0x70')],'value':_0x4549a1[_0xd4ca('0x73')]};}):_0x1cb886[_0xd4ca('0x2d')]==_0xd4ca('0x6c')?[{'name':'True','value':_0xd4ca('0x74')},{'name':_0xd4ca('0x75'),'value':'false'}]:[]};})};}})[_0xd4ca('0x25')](respondWithResult(_0x1c5764,null))[_0xd4ca('0x42')](function(_0x304560){var _0x189c3f=_0x33054e[_0xd4ca('0x32')][_0xd4ca('0x76')]?0x1f4:_0x304560[_0xd4ca('0x77')]||0x1f4;logger[_0xd4ca('0x28')](_0xd4ca('0x78'),_0xd4ca('0x54'),_0x189c3f,JSON[_0xd4ca('0x79')](_0x304560));delete _0x304560['name'];if(_0x189c3f===0x191){_0x189c3f=0x190;}_0x1c5764[_0xd4ca('0x19')](_0x189c3f)[_0xd4ca('0x2b')](_0x33054e[_0xd4ca('0x32')][_0xd4ca('0x76')]?{'message':_0xd4ca('0x7a'),'statusCode':_0x304560[_0xd4ca('0x77')]}:_0x304560);});}; \ No newline at end of file +var _0x84c2=['send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Task','remoteUri','clientSecret','username','password','slice','substring','lastIndexOf','Connection','clientId','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','Subject','Description','string','int','picklist','textarea','phone','remove','includes','custom','picklistValues','label','value','boolean','True','true','False','false','test','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','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','../../config/license/util','status','end','limit','undefined','count','offset','set','Content-Range','json','save','then','destroy','sendStatus','error','stack','name'];(function(_0x59f3d7,_0x189bb6){var _0x3d072d=function(_0x5d5f7f){while(--_0x5d5f7f){_0x59f3d7['push'](_0x59f3d7['shift']());}};_0x3d072d(++_0x189bb6);}(_0x84c2,0x14f));var _0x284c=function(_0x322718,_0x228645){_0x322718=_0x322718-0x0;var _0x5f43d1=_0x84c2[_0x322718];return _0x5f43d1;};'use strict';var emlformat=require(_0x284c('0x0'));var rimraf=require(_0x284c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x284c('0x2'));var rp=require(_0x284c('0x3'));var moment=require('moment');var BPromise=require(_0x284c('0x4'));var Mustache=require(_0x284c('0x5'));var util=require('util');var path=require(_0x284c('0x6'));var sox=require('sox');var csv=require(_0x284c('0x7'));var ejs=require(_0x284c('0x8'));var fs=require('fs');var fs_extra=require(_0x284c('0x9'));var _=require('lodash');var squel=require(_0x284c('0xa'));var crypto=require(_0x284c('0xb'));var jsforce=require(_0x284c('0xc'));var deskjs=require(_0x284c('0xd'));var toCsv=require(_0x284c('0x7'));var querystring=require(_0x284c('0xe'));var Papa=require(_0x284c('0xf'));var Redis=require(_0x284c('0x10'));var authService=require(_0x284c('0x11'));var qs=require(_0x284c('0x12'));var as=require(_0x284c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x284c('0x14'));var utils=require(_0x284c('0x15'));var config=require(_0x284c('0x16'));var licenseUtil=require(_0x284c('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd2fb14,_0x509041){_0x509041=_0x509041||0xcc;return function(_0x7e862a){if(_0x7e862a){return _0xd2fb14['sendStatus'](_0x509041);}return _0xd2fb14[_0x284c('0x18')](_0x509041)[_0x284c('0x19')]();};}function respondWithResult(_0x5583f2,_0x3697d1){_0x3697d1=_0x3697d1||0xc8;return function(_0x1930a9){if(_0x1930a9){return _0x5583f2[_0x284c('0x18')](_0x3697d1)['json'](_0x1930a9);}};}function respondWithFilteredResult(_0x5e79e7,_0x3201ab){return function(_0x26a7ce){if(_0x26a7ce){var _0x6b8930=typeof _0x3201ab['offset']==='undefined'&&typeof _0x3201ab[_0x284c('0x1a')]===_0x284c('0x1b');var _0x38ed71=_0x26a7ce[_0x284c('0x1c')];var _0x44542f=_0x6b8930?0x0:_0x3201ab['offset'];var _0x5c5eac=_0x6b8930?_0x26a7ce[_0x284c('0x1c')]:_0x3201ab[_0x284c('0x1d')]+_0x3201ab['limit'];var _0x519935;if(_0x5c5eac>=_0x38ed71){_0x5c5eac=_0x38ed71;_0x519935=0xc8;}else{_0x519935=0xce;}_0x5e79e7[_0x284c('0x18')](_0x519935);return _0x5e79e7[_0x284c('0x1e')](_0x284c('0x1f'),_0x44542f+'-'+_0x5c5eac+'/'+_0x38ed71)[_0x284c('0x20')](_0x26a7ce);}return null;};}function patchUpdates(_0x330d1b){return function(_0x5f11f6){try{jsonpatch['apply'](_0x5f11f6,_0x330d1b,!![]);}catch(_0x16559e){return BPromise['reject'](_0x16559e);}return _0x5f11f6[_0x284c('0x21')]();};}function saveUpdates(_0x117594,_0x386bf3){return function(_0x3d3a6d){if(_0x3d3a6d){return _0x3d3a6d['update'](_0x117594)[_0x284c('0x22')](function(_0x1d2ec0){return _0x1d2ec0;});}return null;};}function removeEntity(_0x2c94c2,_0xf5841a){return function(_0xac8f0f){if(_0xac8f0f){return _0xac8f0f[_0x284c('0x23')]()[_0x284c('0x22')](function(){_0x2c94c2[_0x284c('0x18')](0xcc)[_0x284c('0x19')]();});}};}function handleEntityNotFound(_0x106571,_0x28df0f){return function(_0x129c1f){if(!_0x129c1f){_0x106571[_0x284c('0x24')](0x194);}return _0x129c1f;};}function handleError(_0x7380b2,_0xb1a43){_0xb1a43=_0xb1a43||0x1f4;return function(_0xfea43d){logger[_0x284c('0x25')](_0xfea43d[_0x284c('0x26')]);if(_0xfea43d[_0x284c('0x27')]){delete _0xfea43d[_0x284c('0x27')];}_0x7380b2[_0x284c('0x18')](_0xb1a43)[_0x284c('0x28')](_0xfea43d);};}exports[_0x284c('0x29')]=function(_0x4055dc,_0x3e9e9b){var _0x46b7b4={},_0x3eaf78={},_0x3c9294={'count':0x0,'rows':[]};var _0x4ae7e9=_[_0x284c('0x2a')](db[_0x284c('0x2b')][_0x284c('0x2c')],function(_0x38b15a){return{'name':_0x38b15a[_0x284c('0x2d')],'type':_0x38b15a[_0x284c('0x2e')][_0x284c('0x2f')]};});_0x3eaf78['model']=_[_0x284c('0x2a')](_0x4ae7e9,_0x284c('0x27'));_0x3eaf78[_0x284c('0x30')]=_['keys'](_0x4055dc[_0x284c('0x30')]);_0x3eaf78[_0x284c('0x31')]=_[_0x284c('0x32')](_0x3eaf78[_0x284c('0x33')],_0x3eaf78[_0x284c('0x30')]);_0x46b7b4[_0x284c('0x34')]=_['intersection'](_0x3eaf78[_0x284c('0x33')],qs[_0x284c('0x35')](_0x4055dc[_0x284c('0x30')][_0x284c('0x35')]));_0x46b7b4[_0x284c('0x34')]=_0x46b7b4[_0x284c('0x34')][_0x284c('0x36')]?_0x46b7b4['attributes']:_0x3eaf78[_0x284c('0x33')];if(!_0x4055dc[_0x284c('0x30')][_0x284c('0x37')](_0x284c('0x38'))){_0x46b7b4['limit']=qs[_0x284c('0x1a')](_0x4055dc[_0x284c('0x30')][_0x284c('0x1a')]);_0x46b7b4[_0x284c('0x1d')]=qs[_0x284c('0x1d')](_0x4055dc[_0x284c('0x30')]['offset']);}_0x46b7b4[_0x284c('0x39')]=qs['sort'](_0x4055dc[_0x284c('0x30')][_0x284c('0x3a')]);_0x46b7b4[_0x284c('0x3b')]=qs[_0x284c('0x31')](_[_0x284c('0x3c')](_0x4055dc[_0x284c('0x30')],_0x3eaf78[_0x284c('0x31')]),_0x4ae7e9);if(_0x4055dc[_0x284c('0x30')][_0x284c('0x3d')]){_0x46b7b4[_0x284c('0x3b')]=_[_0x284c('0x3e')](_0x46b7b4[_0x284c('0x3b')],{'$or':_[_0x284c('0x2a')](_0x4ae7e9,function(_0x528952){if(_0x528952[_0x284c('0x2e')]!==_0x284c('0x3f')){var _0x30241e={};_0x30241e[_0x528952[_0x284c('0x27')]]={'$like':'%'+_0x4055dc[_0x284c('0x30')][_0x284c('0x3d')]+'%'};return _0x30241e;}})});}_0x46b7b4=_[_0x284c('0x3e')]({},_0x46b7b4,_0x4055dc[_0x284c('0x40')]);var _0x3283b0={'where':_0x46b7b4[_0x284c('0x3b')]};return db['SalesforceAccount'][_0x284c('0x1c')](_0x3283b0)[_0x284c('0x22')](function(_0x2e0f8e){_0x3c9294['count']=_0x2e0f8e;if(_0x4055dc[_0x284c('0x30')][_0x284c('0x41')]){_0x46b7b4[_0x284c('0x42')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x284c('0x43')](_0x46b7b4);})[_0x284c('0x22')](function(_0x186516){_0x3c9294[_0x284c('0x44')]=_0x186516;return _0x3c9294;})[_0x284c('0x22')](respondWithFilteredResult(_0x3e9e9b,_0x46b7b4))['catch'](handleError(_0x3e9e9b,null));};exports[_0x284c('0x45')]=function(_0x2655e4,_0xb8c729){var _0x4f3a5c={'raw':![],'where':{'id':_0x2655e4[_0x284c('0x46')]['id']}},_0x1b28d9={};_0x1b28d9[_0x284c('0x33')]=_[_0x284c('0x47')](db[_0x284c('0x2b')][_0x284c('0x2c')]);_0x1b28d9['query']=_[_0x284c('0x47')](_0x2655e4[_0x284c('0x30')]);_0x1b28d9['filters']=_['intersection'](_0x1b28d9['model'],_0x1b28d9[_0x284c('0x30')]);_0x4f3a5c[_0x284c('0x34')]=_[_0x284c('0x32')](_0x1b28d9[_0x284c('0x33')],qs['fields'](_0x2655e4[_0x284c('0x30')]['fields']));_0x4f3a5c[_0x284c('0x34')]=_0x4f3a5c[_0x284c('0x34')]['length']?_0x4f3a5c['attributes']:_0x1b28d9[_0x284c('0x33')];if(_0x2655e4['query']['includeAll']){_0x4f3a5c[_0x284c('0x42')]=[{'all':!![]}];}_0x4f3a5c=_[_0x284c('0x3e')]({},_0x4f3a5c,_0x2655e4[_0x284c('0x40')]);return db['SalesforceAccount'][_0x284c('0x48')](_0x4f3a5c)[_0x284c('0x22')](handleEntityNotFound(_0xb8c729,null))[_0x284c('0x22')](respondWithResult(_0xb8c729,null))[_0x284c('0x49')](handleError(_0xb8c729,null));};exports[_0x284c('0x4a')]=function(_0x2a5e66,_0x18125b){return db[_0x284c('0x2b')][_0x284c('0x4a')](_0x2a5e66['body'],{})[_0x284c('0x22')](respondWithResult(_0x18125b,0xc9))['catch'](handleError(_0x18125b,null));};exports['update']=function(_0x546eda,_0x3ea357){if(_0x546eda[_0x284c('0x4b')]['id']){delete _0x546eda['body']['id'];}return db[_0x284c('0x2b')][_0x284c('0x48')]({'where':{'id':_0x546eda[_0x284c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3ea357,null))[_0x284c('0x22')](saveUpdates(_0x546eda[_0x284c('0x4b')],null))[_0x284c('0x22')](respondWithResult(_0x3ea357,null))[_0x284c('0x49')](handleError(_0x3ea357,null));};exports[_0x284c('0x23')]=function(_0x1e9c1e,_0x43dc2b){return db['SalesforceAccount'][_0x284c('0x48')]({'where':{'id':_0x1e9c1e['params']['id']}})['then'](handleEntityNotFound(_0x43dc2b,null))['then'](removeEntity(_0x43dc2b,null))[_0x284c('0x49')](handleError(_0x43dc2b,null));};exports['getConfigurations']=function(_0x48c41f,_0x4ff5b4,_0x5598c7){var _0x5ebdfa={};var _0x90250b={};var _0x55952e;var _0xe9d2c3;return db[_0x284c('0x2b')][_0x284c('0x4c')]({'where':{'id':_0x48c41f[_0x284c('0x46')]['id']}})[_0x284c('0x22')](handleEntityNotFound(_0x4ff5b4,null))['then'](function(_0x1c6a2d){if(_0x1c6a2d){_0x55952e=_0x1c6a2d;_0x90250b[_0x284c('0x33')]=_[_0x284c('0x47')](db[_0x284c('0x4d')][_0x284c('0x2c')]);_0x90250b['query']=_[_0x284c('0x47')](_0x48c41f[_0x284c('0x30')]);_0x90250b['filters']=_[_0x284c('0x32')](_0x90250b[_0x284c('0x33')],_0x90250b[_0x284c('0x30')]);_0x5ebdfa[_0x284c('0x34')]=_[_0x284c('0x32')](_0x90250b['model'],qs['fields'](_0x48c41f[_0x284c('0x30')][_0x284c('0x35')]));_0x5ebdfa[_0x284c('0x34')]=_0x5ebdfa[_0x284c('0x34')][_0x284c('0x36')]?_0x5ebdfa['attributes']:_0x90250b[_0x284c('0x33')];_0x5ebdfa[_0x284c('0x39')]=qs[_0x284c('0x3a')](_0x48c41f[_0x284c('0x30')][_0x284c('0x3a')]);_0x5ebdfa[_0x284c('0x3b')]=qs[_0x284c('0x31')](_[_0x284c('0x3c')](_0x48c41f['query'],_0x90250b[_0x284c('0x31')]));if(_0x48c41f[_0x284c('0x30')][_0x284c('0x3d')]){_0x5ebdfa[_0x284c('0x3b')]=_['merge'](_0x5ebdfa[_0x284c('0x3b')],{'$or':_[_0x284c('0x2a')](_0x5ebdfa[_0x284c('0x34')],function(_0x36c855){var _0x4edc62={};_0x4edc62[_0x36c855]={'$like':'%'+_0x48c41f[_0x284c('0x30')][_0x284c('0x3d')]+'%'};return _0x4edc62;})});}_0x5ebdfa=_['merge']({},_0x5ebdfa,_0x48c41f[_0x284c('0x40')]);return _0x55952e[_0x284c('0x4e')](_0x5ebdfa);}})['then'](function(_0x553993){if(_0x553993){_0xe9d2c3=_0x553993['length'];if(!_0x48c41f['query'][_0x284c('0x37')](_0x284c('0x38'))){_0x5ebdfa[_0x284c('0x1a')]=qs['limit'](_0x48c41f[_0x284c('0x30')][_0x284c('0x1a')]);_0x5ebdfa[_0x284c('0x1d')]=qs[_0x284c('0x1d')](_0x48c41f[_0x284c('0x30')][_0x284c('0x1d')]);}return _0x55952e[_0x284c('0x4e')](_0x5ebdfa);}})[_0x284c('0x22')](function(_0x20e4e2){if(_0x20e4e2){return _0x20e4e2?{'count':_0xe9d2c3,'rows':_0x20e4e2}:null;}})[_0x284c('0x22')](respondWithResult(_0x4ff5b4,null))[_0x284c('0x49')](handleError(_0x4ff5b4,null));};exports[_0x284c('0x4f')]=function(_0x54a00f,_0x4747da,_0x46db56){if(_0x54a00f['body']['id']){delete _0x54a00f[_0x284c('0x4b')]['id'];}return db[_0x284c('0x2b')][_0x284c('0x4c')]({'where':{'id':_0x54a00f['params']['id']}})['then'](handleEntityNotFound(_0x4747da,null))[_0x284c('0x22')](function(_0x43c8a9){if(_0x43c8a9){_0x54a00f[_0x284c('0x4b')][_0x284c('0x50')]=_0x43c8a9['id'];_0x54a00f[_0x284c('0x4b')][_0x284c('0x51')]=integrations['getSubjects'](_0x54a00f[_0x284c('0x4b')][_0x284c('0x52')],_0x54a00f[_0x284c('0x4b')][_0x284c('0x2e')]);_0x54a00f['body'][_0x284c('0x53')]=integrations[_0x284c('0x54')](_0x54a00f[_0x284c('0x4b')]['channel'],_0x54a00f[_0x284c('0x4b')][_0x284c('0x2e')]);return db['SalesforceConfiguration'][_0x284c('0x4a')](_0x54a00f['body'],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4747da,null))[_0x284c('0x49')](handleError(_0x4747da,null));};exports['getFields']=function(_0x6676d7,_0x3c4b1d,_0xf8eace){var _0x12c712;var _0x576ffb='';var _0x540ac5=_0x284c('0x55');return db[_0x284c('0x2b')][_0x284c('0x4c')]({'where':{'id':_0x6676d7[_0x284c('0x46')]['id']},'attributes':['id',_0x284c('0x56'),'clientId',_0x284c('0x57'),_0x284c('0x58'),_0x284c('0x59'),'securityToken']})[_0x284c('0x22')](handleEntityNotFound(_0x3c4b1d,null))['then'](function(_0xd6b5ec){if(_0xd6b5ec){_0x576ffb=_0xd6b5ec[_0x284c('0x56')];var _0x5656aa=_0x576ffb[_0x284c('0x5a')](-0x1);if(_0x5656aa==='/'){_0x576ffb=_0x576ffb[_0x284c('0x5b')](0x0,_0x576ffb[_0x284c('0x5c')](_0x5656aa));}_0x12c712=new jsforce[(_0x284c('0x5d'))]({'oauth2':{'loginUrl':_0x576ffb,'clientId':_0xd6b5ec[_0x284c('0x5e')],'clientSecret':_0xd6b5ec[_0x284c('0x57')]}});return _0x12c712['login'](_0xd6b5ec[_0x284c('0x58')],_0xd6b5ec[_0x284c('0x59')][_0x284c('0x5f')](_0xd6b5ec['securityToken']));}})[_0x284c('0x22')](function(_0x3320bc){if(_0x3320bc){if(!_[_0x284c('0x60')](_0x6676d7[_0x284c('0x30')][_0x284c('0x61')])){_0x540ac5=_0x6676d7['query'][_0x284c('0x61')];}return _0x12c712['sobject'](_0x540ac5)[_0x284c('0x62')]();}})[_0x284c('0x22')](function(_0x37e1c0){var _0x1928a2=[_0x284c('0x63'),_0x284c('0x64'),_0x284c('0x65'),'IsRecurrence',_0x284c('0x66'),_0x284c('0x67')];var _0x49ec0b=[_0x284c('0x68'),_0x284c('0x69'),_0x284c('0x6a'),'boolean','email',_0x284c('0x6b'),_0x284c('0x6c')];if(_0x37e1c0){_[_0x284c('0x6d')](_0x37e1c0[_0x284c('0x35')],function(_0x276eaa){return _0x1928a2[_0x284c('0x6e')](_0x276eaa[_0x284c('0x27')])||!_0x49ec0b[_0x284c('0x6e')](_0x276eaa['type']);});return{'count':_0x37e1c0['fields'][_0x284c('0x36')],'rows':_['map'](_0x37e1c0[_0x284c('0x35')],function(_0x5700e5){return{'id':_0x5700e5[_0x284c('0x27')],'name':_0x5700e5['label'],'custom':_0x5700e5[_0x284c('0x6f')],'options':_0x5700e5[_0x284c('0x70')][_0x284c('0x36')]>0x0?_[_0x284c('0x2a')](_0x5700e5[_0x284c('0x70')],function(_0x5166ff){return{'name':_0x5166ff[_0x284c('0x71')],'value':_0x5166ff[_0x284c('0x72')]};}):_0x5700e5['type']==_0x284c('0x73')?[{'name':_0x284c('0x74'),'value':_0x284c('0x75')},{'name':_0x284c('0x76'),'value':_0x284c('0x77')}]:[]};})};}})[_0x284c('0x22')](respondWithResult(_0x3c4b1d,null))[_0x284c('0x49')](function(_0x4925a0){var _0x318c9a=_0x6676d7['query'][_0x284c('0x78')]?0x1f4:_0x4925a0['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x284c('0x79'),_0x318c9a,JSON[_0x284c('0x7a')](_0x4925a0));delete _0x4925a0[_0x284c('0x27')];if(_0x318c9a===0x191){_0x318c9a=0x190;}_0x3c4b1d[_0x284c('0x18')](_0x318c9a)[_0x284c('0x28')](_0x6676d7['query'][_0x284c('0x78')]?{'message':_0x284c('0x7b'),'statusCode':_0x4925a0[_0x284c('0x7c')]}:_0x4925a0);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1cb55b6..69ba1c8 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 _0x3931=['rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x42f0d1,_0x45fe4a){var _0x43f981=function(_0x5882e8){while(--_0x5882e8){_0x42f0d1['push'](_0x42f0d1['shift']());}};_0x43f981(++_0x45fe4a);}(_0x3931,0x14c));var _0x1393=function(_0x543fe4,_0x445071){_0x543fe4=_0x543fe4-0x0;var _0x5783dd=_0x3931[_0x543fe4];return _0x5783dd;};'use strict';var _=require('lodash');var util=require(_0x1393('0x0'));var logger=require(_0x1393('0x1'))(_0x1393('0x2'));var moment=require(_0x1393('0x3'));var BPromise=require(_0x1393('0x4'));var rp=require(_0x1393('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1393('0x6'));var config=require(_0x1393('0x7'));var attributes=require(_0x1393('0x8'));var integrations=require(_0x1393('0x9'));module['exports']=function(_0x52c156,_0x2cfe88){return _0x52c156[_0x1393('0xa')](_0x1393('0xb'),attributes,{'tableName':_0x1393('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1542=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x588335,_0x35a72b){var _0x2ccfde=function(_0x21fa3b){while(--_0x21fa3b){_0x588335['push'](_0x588335['shift']());}};_0x2ccfde(++_0x35a72b);}(_0x1542,0x116));var _0x2154=function(_0x4e1386,_0x2bc8a0){_0x4e1386=_0x4e1386-0x0;var _0x240049=_0x1542[_0x4e1386];return _0x240049;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var logger=require(_0x2154('0x2'))(_0x2154('0x3'));var moment=require(_0x2154('0x4'));var BPromise=require('bluebird');var rp=require(_0x2154('0x5'));var fs=require('fs');var path=require(_0x2154('0x6'));var rimraf=require(_0x2154('0x7'));var config=require('../../config/environment');var attributes=require(_0x2154('0x8'));var integrations=require(_0x2154('0x9'));module['exports']=function(_0x13d9c2,_0x23abb5){return _0x13d9c2[_0x2154('0xa')](_0x2154('0xb'),attributes,{'tableName':_0x2154('0xc'),'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 13c8dcb..59e76ea 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 _0x67d1=['SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug'];(function(_0x58f924,_0x2c014c){var _0x168ba6=function(_0x24a9cc){while(--_0x24a9cc){_0x58f924['push'](_0x58f924['shift']());}};_0x168ba6(++_0x2c014c);}(_0x67d1,0xf1));var _0x167d=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x67d1[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var moment=require(_0x167d('0x1'));var BPromise=require('bluebird');var rs=require(_0x167d('0x2'));var fs=require('fs');var Redis=require(_0x167d('0x3'));var db=require(_0x167d('0x4'))['db'];var utils=require(_0x167d('0x5'));var logger=require('../../config/logger')(_0x167d('0x6'));var config=require(_0x167d('0x7'));var jayson=require(_0x167d('0x8'));var client=jayson[_0x167d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x737b3f,_0x546152,_0x56a2b6){return new BPromise(function(_0x1445bd,_0x1053ef){return client[_0x167d('0xa')](_0x737b3f,_0x56a2b6)[_0x167d('0xb')](function(_0x4747df){logger[_0x167d('0xc')](_0x167d('0xd'),_0x546152,'request\x20sent');logger[_0x167d('0xe')](_0x167d('0xf'),_0x546152,_0x167d('0x10'),JSON[_0x167d('0x11')](_0x4747df));if(_0x4747df[_0x167d('0x12')]){if(_0x4747df[_0x167d('0x12')]['code']===0x1f4){logger[_0x167d('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x546152,_0x4747df[_0x167d('0x12')][_0x167d('0x13')]);return _0x1053ef(_0x4747df['error'][_0x167d('0x13')]);}logger[_0x167d('0x12')](_0x167d('0xd'),_0x546152,_0x4747df[_0x167d('0x12')][_0x167d('0x13')]);return _0x1445bd(_0x4747df['error']['message']);}else{logger[_0x167d('0xc')](_0x167d('0xd'),_0x546152,_0x167d('0x10'));_0x1445bd(_0x4747df['result'][_0x167d('0x13')]);}})['catch'](function(_0x43fd94){logger['error'](_0x167d('0xd'),_0x546152,_0x43fd94);_0x1053ef(_0x43fd94);});});}exports[_0x167d('0x14')]=function(_0x1e1611){var _0x49e343=this;return new Promise(function(_0x6db64f,_0xdf1845){return db[_0x167d('0x15')]['findAll']({'raw':_0x1e1611[_0x167d('0x16')]?_0x1e1611[_0x167d('0x16')][_0x167d('0x17')]===undefined?!![]:![]:!![],'where':_0x1e1611[_0x167d('0x16')]?_0x1e1611[_0x167d('0x16')][_0x167d('0x18')]||null:null,'attributes':_0x1e1611['options']?_0x1e1611['options'][_0x167d('0x19')]||null:null,'limit':_0x1e1611['options']?_0x1e1611[_0x167d('0x16')][_0x167d('0x1a')]||null:null,'include':_0x1e1611['options']?_0x1e1611['options'][_0x167d('0x1b')]?_[_0x167d('0x1c')](_0x1e1611[_0x167d('0x16')][_0x167d('0x1b')],function(_0x53a29f){return{'model':db[_0x53a29f[_0x167d('0x1d')]],'as':_0x53a29f['as'],'attributes':_0x53a29f[_0x167d('0x19')],'include':_0x53a29f[_0x167d('0x1b')]?_[_0x167d('0x1c')](_0x53a29f['include'],function(_0x36fda8){return{'model':db[_0x36fda8[_0x167d('0x1d')]],'as':_0x36fda8['as'],'attributes':_0x36fda8[_0x167d('0x19')],'include':_0x36fda8[_0x167d('0x1b')]?_[_0x167d('0x1c')](_0x36fda8['include'],function(_0xbc5f2b){return{'model':db[_0xbc5f2b['model']],'as':_0xbc5f2b['as'],'attributes':_0xbc5f2b[_0x167d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x167d('0xb')](function(_0x3d5b1c){logger[_0x167d('0xc')](_0x167d('0x14'),_0x1e1611);logger[_0x167d('0xe')]('GetSalesforceAccount',_0x1e1611,JSON[_0x167d('0x11')](_0x3d5b1c));_0x6db64f(_0x3d5b1c);})['catch'](function(_0x382851){logger[_0x167d('0x12')]('GetSalesforceAccount',_0x382851[_0x167d('0x13')],_0x1e1611);_0xdf1845(_0x49e343[_0x167d('0x12')](0x1f4,_0x382851['message']));});});};exports[_0x167d('0x1e')]=function(_0x5dafc5){var _0x4c0956=this;return new Promise(function(_0x1ab301,_0x3cfb1d){return db[_0x167d('0x15')]['find']({'raw':_0x5dafc5['options']?_0x5dafc5[_0x167d('0x16')][_0x167d('0x17')]===undefined?!![]:![]:!![],'where':_0x5dafc5[_0x167d('0x16')]?_0x5dafc5[_0x167d('0x16')]['where']||null:null,'attributes':_0x5dafc5['options']?_0x5dafc5['options'][_0x167d('0x19')]||null:null,'include':_0x5dafc5[_0x167d('0x16')]?_0x5dafc5['options'][_0x167d('0x1b')]?_['map'](_0x5dafc5[_0x167d('0x16')][_0x167d('0x1b')],function(_0x43192f){return{'model':db[_0x43192f['model']],'as':_0x43192f['as'],'attributes':_0x43192f[_0x167d('0x19')],'include':_0x43192f[_0x167d('0x1b')]?_[_0x167d('0x1c')](_0x43192f[_0x167d('0x1b')],function(_0x47d982){return{'model':db[_0x47d982[_0x167d('0x1d')]],'as':_0x47d982['as'],'attributes':_0x47d982['attributes'],'include':_0x47d982[_0x167d('0x1b')]?_[_0x167d('0x1c')](_0x47d982[_0x167d('0x1b')],function(_0x10df94){return{'model':db[_0x10df94[_0x167d('0x1d')]],'as':_0x10df94['as'],'attributes':_0x10df94['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59c39c){logger[_0x167d('0xc')](_0x167d('0x1e'),_0x5dafc5);logger[_0x167d('0xe')](_0x167d('0x1e'),_0x5dafc5,JSON[_0x167d('0x11')](_0x59c39c));_0x1ab301(_0x59c39c);})[_0x167d('0x1f')](function(_0x16fac2){logger[_0x167d('0x12')](_0x167d('0x1e'),_0x16fac2[_0x167d('0x13')],_0x5dafc5);_0x3cfb1d(_0x4c0956['error'](0x1f4,_0x16fac2[_0x167d('0x13')]));});});}; \ No newline at end of file +var _0x62c9=['../../config/environment','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','attributes','model','debug','ShowSalesforceAccount','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x52de47,_0xe29fb8){var _0x1a6a3f=function(_0x3f3d19){while(--_0x3f3d19){_0x52de47['push'](_0x52de47['shift']());}};_0x1a6a3f(++_0xe29fb8);}(_0x62c9,0x133));var _0x962c=function(_0x3dea54,_0x27386b){_0x3dea54=_0x3dea54-0x0;var _0x12dd89=_0x62c9[_0x3dea54];return _0x12dd89;};'use strict';var _=require('lodash');var util=require(_0x962c('0x0'));var moment=require(_0x962c('0x1'));var BPromise=require(_0x962c('0x2'));var rs=require(_0x962c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x962c('0x4'))['db'];var utils=require(_0x962c('0x5'));var logger=require(_0x962c('0x6'))(_0x962c('0x7'));var config=require(_0x962c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x962c('0x9')][_0x962c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4afe38,_0x2debfb,_0x20fb9e){return new BPromise(function(_0x3f90b8,_0x4b4a4f){return client[_0x962c('0xb')](_0x4afe38,_0x20fb9e)[_0x962c('0xc')](function(_0x376355){logger['info'](_0x962c('0xd'),_0x2debfb,_0x962c('0xe'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x2debfb,_0x962c('0xe'),JSON[_0x962c('0xf')](_0x376355));if(_0x376355[_0x962c('0x10')]){if(_0x376355[_0x962c('0x10')]['code']===0x1f4){logger[_0x962c('0x10')](_0x962c('0xd'),_0x2debfb,_0x376355[_0x962c('0x10')][_0x962c('0x11')]);return _0x4b4a4f(_0x376355['error'][_0x962c('0x11')]);}logger['error'](_0x962c('0xd'),_0x2debfb,_0x376355['error'][_0x962c('0x11')]);return _0x3f90b8(_0x376355[_0x962c('0x10')][_0x962c('0x11')]);}else{logger[_0x962c('0x12')](_0x962c('0xd'),_0x2debfb,_0x962c('0xe'));_0x3f90b8(_0x376355[_0x962c('0x13')]['message']);}})[_0x962c('0x14')](function(_0x41da1e){logger[_0x962c('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x2debfb,_0x41da1e);_0x4b4a4f(_0x41da1e);});});}exports[_0x962c('0x15')]=function(_0x2c456a){var _0x41bc75=this;return new Promise(function(_0x222844,_0xef9738){return db[_0x962c('0x16')][_0x962c('0x17')]({'raw':_0x2c456a[_0x962c('0x18')]?_0x2c456a[_0x962c('0x18')][_0x962c('0x19')]===undefined?!![]:![]:!![],'where':_0x2c456a['options']?_0x2c456a[_0x962c('0x18')]['where']||null:null,'attributes':_0x2c456a[_0x962c('0x18')]?_0x2c456a[_0x962c('0x18')]['attributes']||null:null,'limit':_0x2c456a[_0x962c('0x18')]?_0x2c456a[_0x962c('0x18')][_0x962c('0x1a')]||null:null,'include':_0x2c456a[_0x962c('0x18')]?_0x2c456a[_0x962c('0x18')][_0x962c('0x1b')]?_[_0x962c('0x1c')](_0x2c456a[_0x962c('0x18')][_0x962c('0x1b')],function(_0x2a3517){return{'model':db[_0x2a3517['model']],'as':_0x2a3517['as'],'attributes':_0x2a3517[_0x962c('0x1d')],'include':_0x2a3517[_0x962c('0x1b')]?_[_0x962c('0x1c')](_0x2a3517['include'],function(_0x2bc1d2){return{'model':db[_0x2bc1d2[_0x962c('0x1e')]],'as':_0x2bc1d2['as'],'attributes':_0x2bc1d2[_0x962c('0x1d')],'include':_0x2bc1d2['include']?_[_0x962c('0x1c')](_0x2bc1d2['include'],function(_0x214826){return{'model':db[_0x214826[_0x962c('0x1e')]],'as':_0x214826['as'],'attributes':_0x214826[_0x962c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xed744e){logger['info'](_0x962c('0x15'),_0x2c456a);logger[_0x962c('0x1f')]('GetSalesforceAccount',_0x2c456a,JSON['stringify'](_0xed744e));_0x222844(_0xed744e);})['catch'](function(_0x2d218b){logger['error'](_0x962c('0x15'),_0x2d218b[_0x962c('0x11')],_0x2c456a);_0xef9738(_0x41bc75['error'](0x1f4,_0x2d218b[_0x962c('0x11')]));});});};exports[_0x962c('0x20')]=function(_0x515e98){var _0x5d2571=this;return new Promise(function(_0x4304a7,_0x5b40d7){return db[_0x962c('0x16')][_0x962c('0x21')]({'raw':_0x515e98[_0x962c('0x18')]?_0x515e98['options'][_0x962c('0x19')]===undefined?!![]:![]:!![],'where':_0x515e98[_0x962c('0x18')]?_0x515e98[_0x962c('0x18')][_0x962c('0x22')]||null:null,'attributes':_0x515e98[_0x962c('0x18')]?_0x515e98[_0x962c('0x18')][_0x962c('0x1d')]||null:null,'include':_0x515e98[_0x962c('0x18')]?_0x515e98[_0x962c('0x18')]['include']?_['map'](_0x515e98[_0x962c('0x18')][_0x962c('0x1b')],function(_0x1a6fc3){return{'model':db[_0x1a6fc3[_0x962c('0x1e')]],'as':_0x1a6fc3['as'],'attributes':_0x1a6fc3[_0x962c('0x1d')],'include':_0x1a6fc3[_0x962c('0x1b')]?_[_0x962c('0x1c')](_0x1a6fc3['include'],function(_0x3e5a57){return{'model':db[_0x3e5a57[_0x962c('0x1e')]],'as':_0x3e5a57['as'],'attributes':_0x3e5a57[_0x962c('0x1d')],'include':_0x3e5a57[_0x962c('0x1b')]?_[_0x962c('0x1c')](_0x3e5a57[_0x962c('0x1b')],function(_0x3f8edf){return{'model':db[_0x3f8edf[_0x962c('0x1e')]],'as':_0x3f8edf['as'],'attributes':_0x3f8edf[_0x962c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x962c('0xc')](function(_0x45bf31){logger[_0x962c('0x12')](_0x962c('0x20'),_0x515e98);logger[_0x962c('0x1f')](_0x962c('0x20'),_0x515e98,JSON['stringify'](_0x45bf31));_0x4304a7(_0x45bf31);})['catch'](function(_0x17063f){logger[_0x962c('0x10')](_0x962c('0x20'),_0x17063f[_0x962c('0x11')],_0x515e98);_0x5b40d7(_0x5d2571[_0x962c('0x10')](0x1f4,_0x17063f['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 797163a..88fcbf4 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x3226d9,_0x3c84fa){var _0x400576=function(_0x53b226){while(--_0x53b226){_0x3226d9['push'](_0x3226d9['shift']());}};_0x400576(++_0x3c84fa);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _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(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x0b0e,0x187));var _0xe0b0=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x0b0e[_0x23c73d];return _0x36ba47;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index ab50cd2..ec5b0f7 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 _0xbf4a=['Case','contact_lead','contact','lead','account_contact_lead','account','sequelize','exports','STRING','Task'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0xbf4a,0x146));var _0xabf4=function(_0x1167c0,_0x35949a){_0x1167c0=_0x1167c0-0x0;var _0x20219d=_0xbf4a[_0x1167c0];return _0x20219d;};'use strict';var Sequelize=require(_0xabf4('0x0'));module[_0xabf4('0x1')]={'name':{'type':Sequelize[_0xabf4('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xabf4('0x3'),_0xabf4('0x4')),'defaultValue':_0xabf4('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xabf4('0x5'),_0xabf4('0x6'),_0xabf4('0x7'),_0xabf4('0x8'),_0xabf4('0x9')),'defaultValue':_0xabf4('0x5')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xabf4('0x6'),_0xabf4('0x7'),_0xabf4('0x9')),'defaultValue':_0xabf4('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xabf4('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xabf4('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xabf4('0x2')]}}; \ No newline at end of file +var _0xac49=['Task','contact_lead','contact','lead','account','nothing','exports','STRING','ENUM'];(function(_0x22744c,_0x269583){var _0x29c07f=function(_0x5bd3bc){while(--_0x5bd3bc){_0x22744c['push'](_0x22744c['shift']());}};_0x29c07f(++_0x269583);}(_0xac49,0x126));var _0x9ac4=function(_0x58595d,_0x4fa6c7){_0x58595d=_0x58595d-0x0;var _0xaa0273=_0xac49[_0x58595d];return _0xaa0273;};'use strict';var Sequelize=require('sequelize');module[_0x9ac4('0x0')]={'name':{'type':Sequelize[_0x9ac4('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x9ac4('0x2')](_0x9ac4('0x3'),'Case'),'defaultValue':_0x9ac4('0x3')},'moduleSearch':{'type':Sequelize[_0x9ac4('0x2')](_0x9ac4('0x4'),_0x9ac4('0x5'),_0x9ac4('0x6'),'account_contact_lead',_0x9ac4('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x9ac4('0x2')](_0x9ac4('0x8'),_0x9ac4('0x5'),'lead',_0x9ac4('0x7')),'defaultValue':_0x9ac4('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x9ac4('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x9ac4('0x1')]},'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 dfc7ff7..73248ce 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 _0x4832=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','getFields','findOne','SalesforceField','length','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x21af22,_0x3b5456){var _0x4f3f34=function(_0x399432){while(--_0x399432){_0x21af22['push'](_0x21af22['shift']());}};_0x4f3f34(++_0x3b5456);}(_0x4832,0x183));var _0x2483=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x4832[_0x254b22];return _0x1279db;};'use strict';var emlformat=require(_0x2483('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2483('0x1'));var jsonpatch=require(_0x2483('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2483('0x3'));var Mustache=require(_0x2483('0x4'));var util=require(_0x2483('0x5'));var path=require(_0x2483('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2483('0x7'));var fs=require('fs');var fs_extra=require(_0x2483('0x8'));var _=require(_0x2483('0x9'));var squel=require('squel');var crypto=require(_0x2483('0xa'));var jsforce=require(_0x2483('0xb'));var deskjs=require(_0x2483('0xc'));var toCsv=require(_0x2483('0xd'));var querystring=require(_0x2483('0xe'));var Papa=require('papaparse');var Redis=require(_0x2483('0xf'));var authService=require(_0x2483('0x10'));var qs=require(_0x2483('0x11'));var as=require(_0x2483('0x12'));var hardwareService=require(_0x2483('0x13'));var logger=require('../../config/logger')(_0x2483('0x14'));var utils=require(_0x2483('0x15'));var config=require(_0x2483('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2483('0x17'))['db'];function respondWithStatusCode(_0x2e7eac,_0x15df8e){_0x15df8e=_0x15df8e||0xcc;return function(_0x3a136c){if(_0x3a136c){return _0x2e7eac[_0x2483('0x18')](_0x15df8e);}return _0x2e7eac[_0x2483('0x19')](_0x15df8e)['end']();};}function respondWithResult(_0x20c40d,_0x49b16f){_0x49b16f=_0x49b16f||0xc8;return function(_0x2a66a5){if(_0x2a66a5){return _0x20c40d[_0x2483('0x19')](_0x49b16f)[_0x2483('0x1a')](_0x2a66a5);}};}function respondWithFilteredResult(_0x371145,_0x6a6aeb){return function(_0x115227){if(_0x115227){var _0x31ad09=typeof _0x6a6aeb[_0x2483('0x1b')]===_0x2483('0x1c')&&typeof _0x6a6aeb[_0x2483('0x1d')]===_0x2483('0x1c');var _0x374245=_0x115227[_0x2483('0x1e')];var _0x1f9892=_0x31ad09?0x0:_0x6a6aeb[_0x2483('0x1b')];var _0xad1bd3=_0x31ad09?_0x115227['count']:_0x6a6aeb[_0x2483('0x1b')]+_0x6a6aeb[_0x2483('0x1d')];var _0x35f07f;if(_0xad1bd3>=_0x374245){_0xad1bd3=_0x374245;_0x35f07f=0xc8;}else{_0x35f07f=0xce;}_0x371145['status'](_0x35f07f);return _0x371145[_0x2483('0x1f')](_0x2483('0x20'),_0x1f9892+'-'+_0xad1bd3+'/'+_0x374245)[_0x2483('0x1a')](_0x115227);}return null;};}function patchUpdates(_0x2f91c3){return function(_0x3f5c28){try{jsonpatch[_0x2483('0x21')](_0x3f5c28,_0x2f91c3,!![]);}catch(_0x412783){return BPromise[_0x2483('0x22')](_0x412783);}return _0x3f5c28[_0x2483('0x23')]();};}function saveUpdates(_0x363540,_0x2ba5e0){return function(_0x10d422){if(_0x10d422){return _0x10d422['update'](_0x363540)['then'](function(_0x3ac3ca){return _0x3ac3ca;});}return null;};}function removeEntity(_0x39584d,_0x3f8ae8){return function(_0x3d31ad){if(_0x3d31ad){return _0x3d31ad[_0x2483('0x24')]()[_0x2483('0x25')](function(){_0x39584d['status'](0xcc)[_0x2483('0x26')]();});}};}function handleEntityNotFound(_0x1762e1,_0x27cb0a){return function(_0x14b8fc){if(!_0x14b8fc){_0x1762e1[_0x2483('0x18')](0x194);}return _0x14b8fc;};}function handleError(_0x596f5d,_0x3e3e5b){_0x3e3e5b=_0x3e3e5b||0x1f4;return function(_0x5ebe34){logger[_0x2483('0x27')](_0x5ebe34[_0x2483('0x28')]);if(_0x5ebe34[_0x2483('0x29')]){delete _0x5ebe34[_0x2483('0x29')];}_0x596f5d[_0x2483('0x19')](_0x3e3e5b)[_0x2483('0x2a')](_0x5ebe34);};}exports['index']=function(_0x2f0622,_0x3b2977){var _0x336f9d={},_0x3191da={},_0x955f69={'count':0x0,'rows':[]};var _0x5034c8=_[_0x2483('0x2b')](db[_0x2483('0x2c')][_0x2483('0x2d')],function(_0x71469f){return{'name':_0x71469f['fieldName'],'type':_0x71469f[_0x2483('0x2e')][_0x2483('0x2f')]};});_0x3191da[_0x2483('0x30')]=_[_0x2483('0x2b')](_0x5034c8,_0x2483('0x29'));_0x3191da[_0x2483('0x31')]=_[_0x2483('0x32')](_0x2f0622[_0x2483('0x31')]);_0x3191da[_0x2483('0x33')]=_['intersection'](_0x3191da[_0x2483('0x30')],_0x3191da[_0x2483('0x31')]);_0x336f9d['attributes']=_[_0x2483('0x34')](_0x3191da[_0x2483('0x30')],qs[_0x2483('0x35')](_0x2f0622[_0x2483('0x31')][_0x2483('0x35')]));_0x336f9d['attributes']=_0x336f9d[_0x2483('0x36')]['length']?_0x336f9d[_0x2483('0x36')]:_0x3191da[_0x2483('0x30')];if(!_0x2f0622['query'][_0x2483('0x37')](_0x2483('0x38'))){_0x336f9d[_0x2483('0x1d')]=qs[_0x2483('0x1d')](_0x2f0622[_0x2483('0x31')][_0x2483('0x1d')]);_0x336f9d['offset']=qs[_0x2483('0x1b')](_0x2f0622[_0x2483('0x31')][_0x2483('0x1b')]);}_0x336f9d[_0x2483('0x39')]=qs[_0x2483('0x3a')](_0x2f0622['query'][_0x2483('0x3a')]);_0x336f9d[_0x2483('0x3b')]=qs[_0x2483('0x33')](_[_0x2483('0x3c')](_0x2f0622[_0x2483('0x31')],_0x3191da[_0x2483('0x33')]),_0x5034c8);if(_0x2f0622[_0x2483('0x31')][_0x2483('0x3d')]){_0x336f9d['where']=_['merge'](_0x336f9d['where'],{'$or':_[_0x2483('0x2b')](_0x5034c8,function(_0x3d1256){if(_0x3d1256[_0x2483('0x2e')]!==_0x2483('0x3e')){var _0x1c90cd={};_0x1c90cd[_0x3d1256[_0x2483('0x29')]]={'$like':'%'+_0x2f0622[_0x2483('0x31')][_0x2483('0x3d')]+'%'};return _0x1c90cd;}})});}_0x336f9d=_[_0x2483('0x3f')]({},_0x336f9d,_0x2f0622[_0x2483('0x40')]);var _0x5c0cac={'where':_0x336f9d['where']};return db[_0x2483('0x2c')][_0x2483('0x1e')](_0x5c0cac)[_0x2483('0x25')](function(_0x3e18ec){_0x955f69['count']=_0x3e18ec;if(_0x2f0622[_0x2483('0x31')][_0x2483('0x41')]){_0x336f9d[_0x2483('0x42')]=[{'all':!![]}];}return db[_0x2483('0x2c')][_0x2483('0x43')](_0x336f9d);})[_0x2483('0x25')](function(_0x4e5d76){_0x955f69[_0x2483('0x44')]=_0x4e5d76;return _0x955f69;})[_0x2483('0x25')](respondWithFilteredResult(_0x3b2977,_0x336f9d))[_0x2483('0x45')](handleError(_0x3b2977,null));};exports['show']=function(_0xcd0a9c,_0x296812){var _0x1253be={'raw':![],'where':{'id':_0xcd0a9c['params']['id']}},_0x23c736={};_0x23c736[_0x2483('0x30')]=_[_0x2483('0x32')](db[_0x2483('0x2c')][_0x2483('0x2d')]);_0x23c736['query']=_['keys'](_0xcd0a9c[_0x2483('0x31')]);_0x23c736[_0x2483('0x33')]=_['intersection'](_0x23c736['model'],_0x23c736[_0x2483('0x31')]);_0x1253be['attributes']=_[_0x2483('0x34')](_0x23c736[_0x2483('0x30')],qs[_0x2483('0x35')](_0xcd0a9c[_0x2483('0x31')][_0x2483('0x35')]));_0x1253be[_0x2483('0x36')]=_0x1253be['attributes']['length']?_0x1253be[_0x2483('0x36')]:_0x23c736[_0x2483('0x30')];if(_0xcd0a9c[_0x2483('0x31')][_0x2483('0x41')]){_0x1253be[_0x2483('0x42')]=[{'all':!![]}];}_0x1253be=_[_0x2483('0x3f')]({},_0x1253be,_0xcd0a9c[_0x2483('0x40')]);return db[_0x2483('0x2c')][_0x2483('0x46')](_0x1253be)['then'](handleEntityNotFound(_0x296812,null))[_0x2483('0x25')](respondWithResult(_0x296812,null))[_0x2483('0x45')](handleError(_0x296812,null));};exports[_0x2483('0x47')]=function(_0x1c92db,_0x2e0969){return db['SalesforceConfiguration'][_0x2483('0x47')](_0x1c92db[_0x2483('0x48')],{})[_0x2483('0x25')](respondWithResult(_0x2e0969,0xc9))['catch'](handleError(_0x2e0969,null));};exports[_0x2483('0x49')]=function(_0x56bb66,_0x52e2ce){if(_0x56bb66[_0x2483('0x48')]['id']){delete _0x56bb66[_0x2483('0x48')]['id'];}return db[_0x2483('0x2c')][_0x2483('0x46')]({'where':{'id':_0x56bb66[_0x2483('0x4a')]['id']}})[_0x2483('0x25')](handleEntityNotFound(_0x52e2ce,null))[_0x2483('0x25')](saveUpdates(_0x56bb66[_0x2483('0x48')],null))[_0x2483('0x25')](respondWithResult(_0x52e2ce,null))['catch'](handleError(_0x52e2ce,null));};exports['destroy']=function(_0x731047,_0x38c684){return db['SalesforceConfiguration']['find']({'where':{'id':_0x731047['params']['id']}})[_0x2483('0x25')](handleEntityNotFound(_0x38c684,null))[_0x2483('0x25')](removeEntity(_0x38c684,null))[_0x2483('0x45')](handleError(_0x38c684,null));};exports[_0x2483('0x4b')]=function(_0x21ed47,_0x528f7a,_0x201ffb){var _0x49a785={};var _0xe43678={};var _0x5b5dda;var _0x429971;return db[_0x2483('0x2c')][_0x2483('0x4c')]({'where':{'id':_0x21ed47[_0x2483('0x4a')]['id']}})[_0x2483('0x25')](handleEntityNotFound(_0x528f7a,null))[_0x2483('0x25')](function(_0x37587){if(_0x37587){_0x5b5dda=_0x37587;_0xe43678['model']=_[_0x2483('0x32')](db[_0x2483('0x4d')][_0x2483('0x2d')]);_0xe43678[_0x2483('0x31')]=_[_0x2483('0x32')](_0x21ed47[_0x2483('0x31')]);_0xe43678[_0x2483('0x33')]=_[_0x2483('0x34')](_0xe43678[_0x2483('0x30')],_0xe43678['query']);_0x49a785[_0x2483('0x36')]=_[_0x2483('0x34')](_0xe43678['model'],qs[_0x2483('0x35')](_0x21ed47[_0x2483('0x31')][_0x2483('0x35')]));_0x49a785[_0x2483('0x36')]=_0x49a785[_0x2483('0x36')][_0x2483('0x4e')]?_0x49a785[_0x2483('0x36')]:_0xe43678['model'];_0x49a785[_0x2483('0x39')]=qs[_0x2483('0x3a')](_0x21ed47[_0x2483('0x31')][_0x2483('0x3a')]);_0x49a785[_0x2483('0x3b')]=qs[_0x2483('0x33')](_[_0x2483('0x3c')](_0x21ed47[_0x2483('0x31')],_0xe43678[_0x2483('0x33')]));if(_0x21ed47['query']['filter']){_0x49a785[_0x2483('0x3b')]=_[_0x2483('0x3f')](_0x49a785[_0x2483('0x3b')],{'$or':_[_0x2483('0x2b')](_0x49a785[_0x2483('0x36')],function(_0x5db251){var _0xadd368={};_0xadd368[_0x5db251]={'$like':'%'+_0x21ed47['query'][_0x2483('0x3d')]+'%'};return _0xadd368;})});}_0x49a785=_[_0x2483('0x3f')]({},_0x49a785,_0x21ed47[_0x2483('0x40')]);return _0x5b5dda[_0x2483('0x4b')](_0x49a785);}})[_0x2483('0x25')](function(_0x5a718b){if(_0x5a718b){_0x429971=_0x5a718b[_0x2483('0x4e')];if(!_0x21ed47[_0x2483('0x31')][_0x2483('0x37')](_0x2483('0x38'))){_0x49a785[_0x2483('0x1d')]=qs[_0x2483('0x1d')](_0x21ed47[_0x2483('0x31')][_0x2483('0x1d')]);_0x49a785[_0x2483('0x1b')]=qs[_0x2483('0x1b')](_0x21ed47[_0x2483('0x31')][_0x2483('0x1b')]);}return _0x5b5dda[_0x2483('0x4b')](_0x49a785);}})[_0x2483('0x25')](function(_0x3f6998){if(_0x3f6998){return _0x3f6998?{'count':_0x429971,'rows':_0x3f6998}:null;}})[_0x2483('0x25')](respondWithResult(_0x528f7a,null))[_0x2483('0x45')](handleError(_0x528f7a,null));};exports[_0x2483('0x4f')]=function(_0x8aaf2d,_0x5da98c,_0x226af8){var _0x788a96={};var _0x37d0b={};var _0x283e8c;var _0x242bdc;return db[_0x2483('0x2c')]['findOne']({'where':{'id':_0x8aaf2d[_0x2483('0x4a')]['id']}})[_0x2483('0x25')](handleEntityNotFound(_0x5da98c,null))[_0x2483('0x25')](function(_0x4532ab){if(_0x4532ab){_0x283e8c=_0x4532ab;_0x37d0b[_0x2483('0x30')]=_[_0x2483('0x32')](db[_0x2483('0x4d')]['rawAttributes']);_0x37d0b['query']=_[_0x2483('0x32')](_0x8aaf2d['query']);_0x37d0b[_0x2483('0x33')]=_['intersection'](_0x37d0b[_0x2483('0x30')],_0x37d0b['query']);_0x788a96[_0x2483('0x36')]=_[_0x2483('0x34')](_0x37d0b[_0x2483('0x30')],qs[_0x2483('0x35')](_0x8aaf2d['query'][_0x2483('0x35')]));_0x788a96[_0x2483('0x36')]=_0x788a96[_0x2483('0x36')][_0x2483('0x4e')]?_0x788a96[_0x2483('0x36')]:_0x37d0b['model'];_0x788a96['order']=qs[_0x2483('0x3a')](_0x8aaf2d[_0x2483('0x31')][_0x2483('0x3a')]);_0x788a96['where']=qs[_0x2483('0x33')](_[_0x2483('0x3c')](_0x8aaf2d[_0x2483('0x31')],_0x37d0b[_0x2483('0x33')]));if(_0x8aaf2d[_0x2483('0x31')][_0x2483('0x3d')]){_0x788a96[_0x2483('0x3b')]=_[_0x2483('0x3f')](_0x788a96[_0x2483('0x3b')],{'$or':_[_0x2483('0x2b')](_0x788a96[_0x2483('0x36')],function(_0x3f2a26){var _0x35df1d={};_0x35df1d[_0x3f2a26]={'$like':'%'+_0x8aaf2d[_0x2483('0x31')][_0x2483('0x3d')]+'%'};return _0x35df1d;})});}_0x788a96=_[_0x2483('0x3f')]({},_0x788a96,_0x8aaf2d[_0x2483('0x40')]);return _0x283e8c[_0x2483('0x4f')](_0x788a96);}})['then'](function(_0x3a1fd4){if(_0x3a1fd4){_0x242bdc=_0x3a1fd4[_0x2483('0x4e')];if(!_0x8aaf2d[_0x2483('0x31')][_0x2483('0x37')](_0x2483('0x38'))){_0x788a96[_0x2483('0x1d')]=qs[_0x2483('0x1d')](_0x8aaf2d['query'][_0x2483('0x1d')]);_0x788a96[_0x2483('0x1b')]=qs[_0x2483('0x1b')](_0x8aaf2d[_0x2483('0x31')][_0x2483('0x1b')]);}return _0x283e8c[_0x2483('0x4f')](_0x788a96);}})[_0x2483('0x25')](function(_0xa97161){if(_0xa97161){return _0xa97161?{'count':_0x242bdc,'rows':_0xa97161}:null;}})['then'](respondWithResult(_0x5da98c,null))[_0x2483('0x45')](handleError(_0x5da98c,null));};exports['getDescriptions']=function(_0x3d0bb8,_0x5d87b0,_0x2307a2){var _0x2f6a29={};var _0x3f6631={};var _0x11f348;var _0x150803;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x3d0bb8[_0x2483('0x4a')]['id']}})[_0x2483('0x25')](handleEntityNotFound(_0x5d87b0,null))[_0x2483('0x25')](function(_0x342eca){if(_0x342eca){_0x11f348=_0x342eca;_0x3f6631[_0x2483('0x30')]=_[_0x2483('0x32')](db[_0x2483('0x4d')][_0x2483('0x2d')]);_0x3f6631[_0x2483('0x31')]=_['keys'](_0x3d0bb8[_0x2483('0x31')]);_0x3f6631['filters']=_['intersection'](_0x3f6631[_0x2483('0x30')],_0x3f6631[_0x2483('0x31')]);_0x2f6a29[_0x2483('0x36')]=_[_0x2483('0x34')](_0x3f6631['model'],qs[_0x2483('0x35')](_0x3d0bb8[_0x2483('0x31')]['fields']));_0x2f6a29[_0x2483('0x36')]=_0x2f6a29[_0x2483('0x36')][_0x2483('0x4e')]?_0x2f6a29['attributes']:_0x3f6631['model'];_0x2f6a29[_0x2483('0x39')]=qs['sort'](_0x3d0bb8[_0x2483('0x31')]['sort']);_0x2f6a29[_0x2483('0x3b')]=qs['filters'](_[_0x2483('0x3c')](_0x3d0bb8[_0x2483('0x31')],_0x3f6631[_0x2483('0x33')]));if(_0x3d0bb8[_0x2483('0x31')][_0x2483('0x3d')]){_0x2f6a29[_0x2483('0x3b')]=_[_0x2483('0x3f')](_0x2f6a29[_0x2483('0x3b')],{'$or':_['map'](_0x2f6a29[_0x2483('0x36')],function(_0x1b2201){var _0x5b6ac8={};_0x5b6ac8[_0x1b2201]={'$like':'%'+_0x3d0bb8[_0x2483('0x31')][_0x2483('0x3d')]+'%'};return _0x5b6ac8;})});}_0x2f6a29=_['merge']({},_0x2f6a29,_0x3d0bb8[_0x2483('0x40')]);return _0x11f348['getDescriptions'](_0x2f6a29);}})['then'](function(_0x312439){if(_0x312439){_0x150803=_0x312439[_0x2483('0x4e')];if(!_0x3d0bb8[_0x2483('0x31')][_0x2483('0x37')](_0x2483('0x38'))){_0x2f6a29['limit']=qs[_0x2483('0x1d')](_0x3d0bb8[_0x2483('0x31')]['limit']);_0x2f6a29[_0x2483('0x1b')]=qs[_0x2483('0x1b')](_0x3d0bb8[_0x2483('0x31')][_0x2483('0x1b')]);}return _0x11f348[_0x2483('0x50')](_0x2f6a29);}})[_0x2483('0x25')](function(_0x785bfc){if(_0x785bfc){return _0x785bfc?{'count':_0x150803,'rows':_0x785bfc}:null;}})[_0x2483('0x25')](respondWithResult(_0x5d87b0,null))['catch'](handleError(_0x5d87b0,null));}; \ No newline at end of file +var _0xcfab=['include','findAll','rows','catch','show','params','keys','intersection','find','create','body','update','getFields','findOne','SalesforceField','length','rawAttributes','getDescriptions','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll'];(function(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0xcfab,0x1e0));var _0xbcfa=function(_0x24aae5,_0x2a718c){_0x24aae5=_0x24aae5-0x0;var _0xd5d26b=_0xcfab[_0x24aae5];return _0xd5d26b;};'use strict';var emlformat=require(_0xbcfa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcfa('0x2'));var moment=require('moment');var BPromise=require(_0xbcfa('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbcfa('0x4'));var sox=require(_0xbcfa('0x5'));var csv=require(_0xbcfa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcfa('0x7'));var _=require(_0xbcfa('0x8'));var squel=require(_0xbcfa('0x9'));var crypto=require(_0xbcfa('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcfa('0x6'));var querystring=require(_0xbcfa('0xb'));var Papa=require('papaparse');var Redis=require(_0xbcfa('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xbcfa('0xd'));var as=require(_0xbcfa('0xe'));var hardwareService=require(_0xbcfa('0xf'));var logger=require('../../config/logger')(_0xbcfa('0x10'));var utils=require(_0xbcfa('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xbcfa('0x12'));var db=require(_0xbcfa('0x13'))['db'];function respondWithStatusCode(_0x59518c,_0x22b679){_0x22b679=_0x22b679||0xcc;return function(_0x53bd3d){if(_0x53bd3d){return _0x59518c[_0xbcfa('0x14')](_0x22b679);}return _0x59518c[_0xbcfa('0x15')](_0x22b679)[_0xbcfa('0x16')]();};}function respondWithResult(_0xdba47d,_0x398351){_0x398351=_0x398351||0xc8;return function(_0x3c9217){if(_0x3c9217){return _0xdba47d[_0xbcfa('0x15')](_0x398351)[_0xbcfa('0x17')](_0x3c9217);}};}function respondWithFilteredResult(_0x4a8336,_0x30888b){return function(_0x503a6b){if(_0x503a6b){var _0x4609b0=typeof _0x30888b['offset']===_0xbcfa('0x18')&&typeof _0x30888b[_0xbcfa('0x19')]===_0xbcfa('0x18');var _0x10c09c=_0x503a6b['count'];var _0x4643ae=_0x4609b0?0x0:_0x30888b[_0xbcfa('0x1a')];var _0x326625=_0x4609b0?_0x503a6b[_0xbcfa('0x1b')]:_0x30888b[_0xbcfa('0x1a')]+_0x30888b[_0xbcfa('0x19')];var _0x432b06;if(_0x326625>=_0x10c09c){_0x326625=_0x10c09c;_0x432b06=0xc8;}else{_0x432b06=0xce;}_0x4a8336['status'](_0x432b06);return _0x4a8336[_0xbcfa('0x1c')](_0xbcfa('0x1d'),_0x4643ae+'-'+_0x326625+'/'+_0x10c09c)[_0xbcfa('0x17')](_0x503a6b);}return null;};}function patchUpdates(_0x4433ef){return function(_0x20727c){try{jsonpatch[_0xbcfa('0x1e')](_0x20727c,_0x4433ef,!![]);}catch(_0x5d9e04){return BPromise[_0xbcfa('0x1f')](_0x5d9e04);}return _0x20727c[_0xbcfa('0x20')]();};}function saveUpdates(_0x20d3fa,_0x39d9ed){return function(_0x43fb22){if(_0x43fb22){return _0x43fb22['update'](_0x20d3fa)[_0xbcfa('0x21')](function(_0x7d5ba1){return _0x7d5ba1;});}return null;};}function removeEntity(_0x5e4c06,_0x53e866){return function(_0x4a9a10){if(_0x4a9a10){return _0x4a9a10[_0xbcfa('0x22')]()[_0xbcfa('0x21')](function(){_0x5e4c06[_0xbcfa('0x15')](0xcc)[_0xbcfa('0x16')]();});}};}function handleEntityNotFound(_0x58043d,_0xd2ad52){return function(_0x8549af){if(!_0x8549af){_0x58043d[_0xbcfa('0x14')](0x194);}return _0x8549af;};}function handleError(_0x576f2b,_0x252257){_0x252257=_0x252257||0x1f4;return function(_0x375123){logger['error'](_0x375123[_0xbcfa('0x23')]);if(_0x375123[_0xbcfa('0x24')]){delete _0x375123[_0xbcfa('0x24')];}_0x576f2b[_0xbcfa('0x15')](_0x252257)[_0xbcfa('0x25')](_0x375123);};}exports[_0xbcfa('0x26')]=function(_0x3e12f7,_0x4e84c3){var _0x5398fb={},_0x4a8eec={},_0x39777c={'count':0x0,'rows':[]};var _0x25fbd9=_[_0xbcfa('0x27')](db[_0xbcfa('0x28')]['rawAttributes'],function(_0x503a81){return{'name':_0x503a81[_0xbcfa('0x29')],'type':_0x503a81[_0xbcfa('0x2a')]['key']};});_0x4a8eec['model']=_[_0xbcfa('0x27')](_0x25fbd9,_0xbcfa('0x24'));_0x4a8eec['query']=_['keys'](_0x3e12f7[_0xbcfa('0x2b')]);_0x4a8eec[_0xbcfa('0x2c')]=_['intersection'](_0x4a8eec[_0xbcfa('0x2d')],_0x4a8eec[_0xbcfa('0x2b')]);_0x5398fb['attributes']=_['intersection'](_0x4a8eec[_0xbcfa('0x2d')],qs[_0xbcfa('0x2e')](_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x2e')]));_0x5398fb[_0xbcfa('0x2f')]=_0x5398fb[_0xbcfa('0x2f')]['length']?_0x5398fb[_0xbcfa('0x2f')]:_0x4a8eec['model'];if(!_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x30')](_0xbcfa('0x31'))){_0x5398fb[_0xbcfa('0x19')]=qs['limit'](_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x19')]);_0x5398fb[_0xbcfa('0x1a')]=qs['offset'](_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x1a')]);}_0x5398fb[_0xbcfa('0x32')]=qs[_0xbcfa('0x33')](_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x33')]);_0x5398fb[_0xbcfa('0x34')]=qs['filters'](_[_0xbcfa('0x35')](_0x3e12f7[_0xbcfa('0x2b')],_0x4a8eec[_0xbcfa('0x2c')]),_0x25fbd9);if(_0x3e12f7[_0xbcfa('0x2b')]['filter']){_0x5398fb['where']=_[_0xbcfa('0x36')](_0x5398fb['where'],{'$or':_[_0xbcfa('0x27')](_0x25fbd9,function(_0x4f45a9){if(_0x4f45a9['type']!==_0xbcfa('0x37')){var _0x536e6e={};_0x536e6e[_0x4f45a9[_0xbcfa('0x24')]]={'$like':'%'+_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x38')]+'%'};return _0x536e6e;}})});}_0x5398fb=_[_0xbcfa('0x36')]({},_0x5398fb,_0x3e12f7[_0xbcfa('0x39')]);var _0x4e0fc2={'where':_0x5398fb[_0xbcfa('0x34')]};return db[_0xbcfa('0x28')][_0xbcfa('0x1b')](_0x4e0fc2)[_0xbcfa('0x21')](function(_0x4a602c){_0x39777c['count']=_0x4a602c;if(_0x3e12f7[_0xbcfa('0x2b')][_0xbcfa('0x3a')]){_0x5398fb[_0xbcfa('0x3b')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xbcfa('0x3c')](_0x5398fb);})[_0xbcfa('0x21')](function(_0x32450e){_0x39777c[_0xbcfa('0x3d')]=_0x32450e;return _0x39777c;})[_0xbcfa('0x21')](respondWithFilteredResult(_0x4e84c3,_0x5398fb))[_0xbcfa('0x3e')](handleError(_0x4e84c3,null));};exports[_0xbcfa('0x3f')]=function(_0xe9722f,_0x5a54ff){var _0x48f68d={'raw':![],'where':{'id':_0xe9722f[_0xbcfa('0x40')]['id']}},_0x145c75={};_0x145c75[_0xbcfa('0x2d')]=_[_0xbcfa('0x41')](db[_0xbcfa('0x28')]['rawAttributes']);_0x145c75['query']=_[_0xbcfa('0x41')](_0xe9722f[_0xbcfa('0x2b')]);_0x145c75['filters']=_[_0xbcfa('0x42')](_0x145c75[_0xbcfa('0x2d')],_0x145c75['query']);_0x48f68d['attributes']=_[_0xbcfa('0x42')](_0x145c75[_0xbcfa('0x2d')],qs[_0xbcfa('0x2e')](_0xe9722f[_0xbcfa('0x2b')][_0xbcfa('0x2e')]));_0x48f68d[_0xbcfa('0x2f')]=_0x48f68d[_0xbcfa('0x2f')]['length']?_0x48f68d[_0xbcfa('0x2f')]:_0x145c75[_0xbcfa('0x2d')];if(_0xe9722f['query']['includeAll']){_0x48f68d[_0xbcfa('0x3b')]=[{'all':!![]}];}_0x48f68d=_[_0xbcfa('0x36')]({},_0x48f68d,_0xe9722f[_0xbcfa('0x39')]);return db['SalesforceConfiguration'][_0xbcfa('0x43')](_0x48f68d)['then'](handleEntityNotFound(_0x5a54ff,null))['then'](respondWithResult(_0x5a54ff,null))[_0xbcfa('0x3e')](handleError(_0x5a54ff,null));};exports[_0xbcfa('0x44')]=function(_0x12b2b2,_0x966468){return db[_0xbcfa('0x28')][_0xbcfa('0x44')](_0x12b2b2[_0xbcfa('0x45')],{})[_0xbcfa('0x21')](respondWithResult(_0x966468,0xc9))['catch'](handleError(_0x966468,null));};exports[_0xbcfa('0x46')]=function(_0x646c67,_0x3d5159){if(_0x646c67[_0xbcfa('0x45')]['id']){delete _0x646c67[_0xbcfa('0x45')]['id'];}return db['SalesforceConfiguration'][_0xbcfa('0x43')]({'where':{'id':_0x646c67['params']['id']}})[_0xbcfa('0x21')](handleEntityNotFound(_0x3d5159,null))[_0xbcfa('0x21')](saveUpdates(_0x646c67[_0xbcfa('0x45')],null))[_0xbcfa('0x21')](respondWithResult(_0x3d5159,null))[_0xbcfa('0x3e')](handleError(_0x3d5159,null));};exports[_0xbcfa('0x22')]=function(_0x107748,_0x95e037){return db[_0xbcfa('0x28')][_0xbcfa('0x43')]({'where':{'id':_0x107748[_0xbcfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x95e037,null))[_0xbcfa('0x21')](removeEntity(_0x95e037,null))['catch'](handleError(_0x95e037,null));};exports[_0xbcfa('0x47')]=function(_0x449227,_0x4116fb,_0x292ec4){var _0xff744d={};var _0x463d60={};var _0x4bf07c;var _0x3eb370;return db['SalesforceConfiguration'][_0xbcfa('0x48')]({'where':{'id':_0x449227[_0xbcfa('0x40')]['id']}})[_0xbcfa('0x21')](handleEntityNotFound(_0x4116fb,null))[_0xbcfa('0x21')](function(_0x1080a7){if(_0x1080a7){_0x4bf07c=_0x1080a7;_0x463d60['model']=_['keys'](db[_0xbcfa('0x49')]['rawAttributes']);_0x463d60[_0xbcfa('0x2b')]=_[_0xbcfa('0x41')](_0x449227[_0xbcfa('0x2b')]);_0x463d60[_0xbcfa('0x2c')]=_[_0xbcfa('0x42')](_0x463d60[_0xbcfa('0x2d')],_0x463d60['query']);_0xff744d[_0xbcfa('0x2f')]=_[_0xbcfa('0x42')](_0x463d60[_0xbcfa('0x2d')],qs[_0xbcfa('0x2e')](_0x449227['query'][_0xbcfa('0x2e')]));_0xff744d[_0xbcfa('0x2f')]=_0xff744d[_0xbcfa('0x2f')][_0xbcfa('0x4a')]?_0xff744d[_0xbcfa('0x2f')]:_0x463d60[_0xbcfa('0x2d')];_0xff744d[_0xbcfa('0x32')]=qs[_0xbcfa('0x33')](_0x449227[_0xbcfa('0x2b')]['sort']);_0xff744d[_0xbcfa('0x34')]=qs[_0xbcfa('0x2c')](_[_0xbcfa('0x35')](_0x449227[_0xbcfa('0x2b')],_0x463d60[_0xbcfa('0x2c')]));if(_0x449227[_0xbcfa('0x2b')][_0xbcfa('0x38')]){_0xff744d[_0xbcfa('0x34')]=_[_0xbcfa('0x36')](_0xff744d[_0xbcfa('0x34')],{'$or':_[_0xbcfa('0x27')](_0xff744d[_0xbcfa('0x2f')],function(_0x294899){var _0x2866ca={};_0x2866ca[_0x294899]={'$like':'%'+_0x449227[_0xbcfa('0x2b')][_0xbcfa('0x38')]+'%'};return _0x2866ca;})});}_0xff744d=_[_0xbcfa('0x36')]({},_0xff744d,_0x449227[_0xbcfa('0x39')]);return _0x4bf07c[_0xbcfa('0x47')](_0xff744d);}})['then'](function(_0x285cfc){if(_0x285cfc){_0x3eb370=_0x285cfc[_0xbcfa('0x4a')];if(!_0x449227[_0xbcfa('0x2b')][_0xbcfa('0x30')](_0xbcfa('0x31'))){_0xff744d[_0xbcfa('0x19')]=qs[_0xbcfa('0x19')](_0x449227['query']['limit']);_0xff744d[_0xbcfa('0x1a')]=qs[_0xbcfa('0x1a')](_0x449227[_0xbcfa('0x2b')][_0xbcfa('0x1a')]);}return _0x4bf07c[_0xbcfa('0x47')](_0xff744d);}})[_0xbcfa('0x21')](function(_0x533230){if(_0x533230){return _0x533230?{'count':_0x3eb370,'rows':_0x533230}:null;}})[_0xbcfa('0x21')](respondWithResult(_0x4116fb,null))[_0xbcfa('0x3e')](handleError(_0x4116fb,null));};exports['getSubjects']=function(_0x4c78d8,_0xad2fd4,_0x4d5532){var _0x41de31={};var _0x56c7c3={};var _0x504598;var _0x24076c;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4c78d8[_0xbcfa('0x40')]['id']}})[_0xbcfa('0x21')](handleEntityNotFound(_0xad2fd4,null))['then'](function(_0x21acd2){if(_0x21acd2){_0x504598=_0x21acd2;_0x56c7c3[_0xbcfa('0x2d')]=_[_0xbcfa('0x41')](db[_0xbcfa('0x49')][_0xbcfa('0x4b')]);_0x56c7c3['query']=_['keys'](_0x4c78d8['query']);_0x56c7c3[_0xbcfa('0x2c')]=_[_0xbcfa('0x42')](_0x56c7c3[_0xbcfa('0x2d')],_0x56c7c3[_0xbcfa('0x2b')]);_0x41de31[_0xbcfa('0x2f')]=_[_0xbcfa('0x42')](_0x56c7c3[_0xbcfa('0x2d')],qs[_0xbcfa('0x2e')](_0x4c78d8['query'][_0xbcfa('0x2e')]));_0x41de31[_0xbcfa('0x2f')]=_0x41de31[_0xbcfa('0x2f')]['length']?_0x41de31[_0xbcfa('0x2f')]:_0x56c7c3['model'];_0x41de31['order']=qs[_0xbcfa('0x33')](_0x4c78d8[_0xbcfa('0x2b')]['sort']);_0x41de31[_0xbcfa('0x34')]=qs['filters'](_[_0xbcfa('0x35')](_0x4c78d8[_0xbcfa('0x2b')],_0x56c7c3[_0xbcfa('0x2c')]));if(_0x4c78d8[_0xbcfa('0x2b')]['filter']){_0x41de31['where']=_[_0xbcfa('0x36')](_0x41de31[_0xbcfa('0x34')],{'$or':_[_0xbcfa('0x27')](_0x41de31[_0xbcfa('0x2f')],function(_0x5a02f4){var _0x53a2fb={};_0x53a2fb[_0x5a02f4]={'$like':'%'+_0x4c78d8[_0xbcfa('0x2b')][_0xbcfa('0x38')]+'%'};return _0x53a2fb;})});}_0x41de31=_[_0xbcfa('0x36')]({},_0x41de31,_0x4c78d8[_0xbcfa('0x39')]);return _0x504598['getSubjects'](_0x41de31);}})['then'](function(_0x30a579){if(_0x30a579){_0x24076c=_0x30a579[_0xbcfa('0x4a')];if(!_0x4c78d8['query']['hasOwnProperty'](_0xbcfa('0x31'))){_0x41de31['limit']=qs[_0xbcfa('0x19')](_0x4c78d8[_0xbcfa('0x2b')][_0xbcfa('0x19')]);_0x41de31[_0xbcfa('0x1a')]=qs[_0xbcfa('0x1a')](_0x4c78d8['query'][_0xbcfa('0x1a')]);}return _0x504598['getSubjects'](_0x41de31);}})['then'](function(_0xca0067){if(_0xca0067){return _0xca0067?{'count':_0x24076c,'rows':_0xca0067}:null;}})[_0xbcfa('0x21')](respondWithResult(_0xad2fd4,null))['catch'](handleError(_0xad2fd4,null));};exports[_0xbcfa('0x4c')]=function(_0xa46af2,_0x2f723d,_0x138eac){var _0x2d9e67={};var _0x5d9911={};var _0x2ab9d9;var _0x552a41;return db[_0xbcfa('0x28')]['findOne']({'where':{'id':_0xa46af2[_0xbcfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f723d,null))[_0xbcfa('0x21')](function(_0x3102c1){if(_0x3102c1){_0x2ab9d9=_0x3102c1;_0x5d9911[_0xbcfa('0x2d')]=_[_0xbcfa('0x41')](db['SalesforceField'][_0xbcfa('0x4b')]);_0x5d9911['query']=_['keys'](_0xa46af2['query']);_0x5d9911[_0xbcfa('0x2c')]=_['intersection'](_0x5d9911[_0xbcfa('0x2d')],_0x5d9911[_0xbcfa('0x2b')]);_0x2d9e67['attributes']=_[_0xbcfa('0x42')](_0x5d9911[_0xbcfa('0x2d')],qs[_0xbcfa('0x2e')](_0xa46af2['query'][_0xbcfa('0x2e')]));_0x2d9e67[_0xbcfa('0x2f')]=_0x2d9e67[_0xbcfa('0x2f')][_0xbcfa('0x4a')]?_0x2d9e67['attributes']:_0x5d9911[_0xbcfa('0x2d')];_0x2d9e67['order']=qs[_0xbcfa('0x33')](_0xa46af2[_0xbcfa('0x2b')][_0xbcfa('0x33')]);_0x2d9e67[_0xbcfa('0x34')]=qs['filters'](_['pick'](_0xa46af2[_0xbcfa('0x2b')],_0x5d9911[_0xbcfa('0x2c')]));if(_0xa46af2[_0xbcfa('0x2b')][_0xbcfa('0x38')]){_0x2d9e67[_0xbcfa('0x34')]=_[_0xbcfa('0x36')](_0x2d9e67[_0xbcfa('0x34')],{'$or':_[_0xbcfa('0x27')](_0x2d9e67['attributes'],function(_0x4534cd){var _0x29534f={};_0x29534f[_0x4534cd]={'$like':'%'+_0xa46af2[_0xbcfa('0x2b')]['filter']+'%'};return _0x29534f;})});}_0x2d9e67=_['merge']({},_0x2d9e67,_0xa46af2[_0xbcfa('0x39')]);return _0x2ab9d9[_0xbcfa('0x4c')](_0x2d9e67);}})[_0xbcfa('0x21')](function(_0x2fad3b){if(_0x2fad3b){_0x552a41=_0x2fad3b[_0xbcfa('0x4a')];if(!_0xa46af2[_0xbcfa('0x2b')]['hasOwnProperty'](_0xbcfa('0x31'))){_0x2d9e67[_0xbcfa('0x19')]=qs[_0xbcfa('0x19')](_0xa46af2[_0xbcfa('0x2b')][_0xbcfa('0x19')]);_0x2d9e67['offset']=qs[_0xbcfa('0x1a')](_0xa46af2[_0xbcfa('0x2b')]['offset']);}return _0x2ab9d9[_0xbcfa('0x4c')](_0x2d9e67);}})[_0xbcfa('0x21')](function(_0x229fbe){if(_0x229fbe){return _0x229fbe?{'count':_0x552a41,'rows':_0x229fbe}:null;}})['then'](respondWithResult(_0x2f723d,null))['catch'](handleError(_0x2f723d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9288c2a..3dd4d2f 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 _0x62ba=['path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','moment','request-promise'];(function(_0x5f124a,_0x34e5d2){var _0x3717c1=function(_0x16e713){while(--_0x16e713){_0x5f124a['push'](_0x5f124a['shift']());}};_0x3717c1(++_0x34e5d2);}(_0x62ba,0x19e));var _0xa62b=function(_0x59d46d,_0x400167){_0x59d46d=_0x59d46d-0x0;var _0x294f37=_0x62ba[_0x59d46d];return _0x294f37;};'use strict';var _=require(_0xa62b('0x0'));var util=require('util');var logger=require(_0xa62b('0x1'))('api');var moment=require(_0xa62b('0x2'));var BPromise=require('bluebird');var rp=require(_0xa62b('0x3'));var fs=require('fs');var path=require(_0xa62b('0x4'));var rimraf=require(_0xa62b('0x5'));var config=require(_0xa62b('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xa62b('0x7')]=function(_0x56fe72,_0x33efd6){return _0x56fe72[_0xa62b('0x8')](_0xa62b('0x9'),attributes,{'tableName':_0xa62b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db5=['./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x1db5,0x1f0));var _0x51db=function(_0x4042d6,_0x558a2e){_0x4042d6=_0x4042d6-0x0;var _0x58548a=_0x1db5[_0x4042d6];return _0x58548a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51db('0x0'))(_0x51db('0x1'));var moment=require(_0x51db('0x2'));var BPromise=require(_0x51db('0x3'));var rp=require(_0x51db('0x4'));var fs=require('fs');var path=require(_0x51db('0x5'));var rimraf=require(_0x51db('0x6'));var config=require(_0x51db('0x7'));var attributes=require(_0x51db('0x8'));module[_0x51db('0x9')]=function(_0x4d0eba,_0x26fcd9){return _0x4d0eba[_0x51db('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x51db('0xb'),'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 548291c..797355d 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 _0x3c00=['message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4ab3d3,_0x2514df){var _0x49b7f6=function(_0x2265e0){while(--_0x2265e0){_0x4ab3d3['push'](_0x4ab3d3['shift']());}};_0x49b7f6(++_0x2514df);}(_0x3c00,0xcc));var _0x03c0=function(_0x573dc9,_0x9b60a7){_0x573dc9=_0x573dc9-0x0;var _0x287ece=_0x3c00[_0x573dc9];return _0x287ece;};'use strict';var _=require(_0x03c0('0x0'));var util=require(_0x03c0('0x1'));var moment=require('moment');var BPromise=require(_0x03c0('0x2'));var rs=require(_0x03c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03c0('0x4'))['db'];var utils=require(_0x03c0('0x5'));var logger=require('../../config/logger')(_0x03c0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x03c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x8815a7,_0x48fdf7,_0x53af0c){return new BPromise(function(_0x21fd75,_0x1a0e53){return client[_0x03c0('0x8')](_0x8815a7,_0x53af0c)['then'](function(_0x3deb2f){logger['info'](_0x03c0('0x9'),_0x48fdf7,_0x03c0('0xa'));logger[_0x03c0('0xb')](_0x03c0('0xc'),_0x48fdf7,_0x03c0('0xa'),JSON[_0x03c0('0xd')](_0x3deb2f));if(_0x3deb2f[_0x03c0('0xe')]){if(_0x3deb2f[_0x03c0('0xe')][_0x03c0('0xf')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x48fdf7,_0x3deb2f[_0x03c0('0xe')][_0x03c0('0x10')]);return _0x1a0e53(_0x3deb2f[_0x03c0('0xe')][_0x03c0('0x10')]);}logger[_0x03c0('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x48fdf7,_0x3deb2f[_0x03c0('0xe')][_0x03c0('0x10')]);return _0x21fd75(_0x3deb2f[_0x03c0('0xe')][_0x03c0('0x10')]);}else{logger[_0x03c0('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x48fdf7,_0x03c0('0xa'));_0x21fd75(_0x3deb2f[_0x03c0('0x12')][_0x03c0('0x10')]);}})[_0x03c0('0x13')](function(_0x52cb0f){logger[_0x03c0('0xe')](_0x03c0('0x9'),_0x48fdf7,_0x52cb0f);_0x1a0e53(_0x52cb0f);});});} \ No newline at end of file +var _0x0ee0=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x0ee0,0xa0));var _0x00ee=function(_0x3c3584,_0x4b4c59){_0x3c3584=_0x3c3584-0x0;var _0x4dc3d6=_0x0ee0[_0x3c3584];return _0x4dc3d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x00ee('0x0'));var BPromise=require('bluebird');var rs=require(_0x00ee('0x1'));var fs=require('fs');var Redis=require(_0x00ee('0x2'));var db=require(_0x00ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x00ee('0x4'))(_0x00ee('0x5'));var config=require(_0x00ee('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x00ee('0x7')][_0x00ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x562c96,_0x280365,_0x48580e){return new BPromise(function(_0x47916c,_0x258e20){return client[_0x00ee('0x9')](_0x562c96,_0x48580e)['then'](function(_0x5a1aed){logger[_0x00ee('0xa')](_0x00ee('0xb'),_0x280365,_0x00ee('0xc'));logger[_0x00ee('0xd')](_0x00ee('0xe'),_0x280365,_0x00ee('0xc'),JSON['stringify'](_0x5a1aed));if(_0x5a1aed[_0x00ee('0xf')]){if(_0x5a1aed[_0x00ee('0xf')][_0x00ee('0x10')]===0x1f4){logger['error'](_0x00ee('0xb'),_0x280365,_0x5a1aed[_0x00ee('0xf')][_0x00ee('0x11')]);return _0x258e20(_0x5a1aed[_0x00ee('0xf')]['message']);}logger[_0x00ee('0xf')](_0x00ee('0xb'),_0x280365,_0x5a1aed[_0x00ee('0xf')][_0x00ee('0x11')]);return _0x47916c(_0x5a1aed[_0x00ee('0xf')][_0x00ee('0x11')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x280365,_0x00ee('0xc'));_0x47916c(_0x5a1aed[_0x00ee('0x12')][_0x00ee('0x11')]);}})[_0x00ee('0x13')](function(_0x2e992f){logger[_0x00ee('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x280365,_0x2e992f);_0x258e20(_0x2e992f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 1109385..b5600f0 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 _0xc1a5=['create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x14ee8e,_0x1d7547){var _0x1d2f47=function(_0x41be29){while(--_0x41be29){_0x14ee8e['push'](_0x14ee8e['shift']());}};_0x1d2f47(++_0x1d7547);}(_0xc1a5,0x1cc));var _0x5c1a=function(_0x439abd,_0x2d3355){_0x439abd=_0x439abd-0x0;var _0xa1effc=_0xc1a5[_0x439abd];return _0xa1effc;};'use strict';var multer=require(_0x5c1a('0x0'));var util=require(_0x5c1a('0x1'));var path=require(_0x5c1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c1a('0x3'));var router=express[_0x5c1a('0x4')]();var fs_extra=require(_0x5c1a('0x5'));var auth=require(_0x5c1a('0x6'));var interaction=require(_0x5c1a('0x7'));var config=require('../../config/environment');var controller=require(_0x5c1a('0x8'));router[_0x5c1a('0x9')]('/',auth['isAuthenticated'](),controller[_0x5c1a('0xa')]);router[_0x5c1a('0x9')](_0x5c1a('0xb'),auth[_0x5c1a('0xc')](),controller[_0x5c1a('0xd')]);router[_0x5c1a('0xe')]('/',auth[_0x5c1a('0xc')](),controller[_0x5c1a('0xf')]);router[_0x5c1a('0x10')](_0x5c1a('0xb'),auth[_0x5c1a('0xc')](),controller[_0x5c1a('0x11')]);router[_0x5c1a('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x416c=['path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x416c,0x164));var _0xc416=function(_0x12f29c,_0x591a84){_0x12f29c=_0x12f29c-0x0;var _0x4b10c7=_0x416c[_0x12f29c];return _0x4b10c7;};'use strict';var multer=require(_0xc416('0x0'));var util=require('util');var path=require(_0xc416('0x1'));var timeout=require(_0xc416('0x2'));var express=require(_0xc416('0x3'));var router=express[_0xc416('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc416('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0xc416('0x6')]('/',auth[_0xc416('0x7')](),controller[_0xc416('0x8')]);router[_0xc416('0x6')](_0xc416('0x9'),auth['isAuthenticated'](),controller[_0xc416('0xa')]);router[_0xc416('0xb')]('/',auth['isAuthenticated'](),controller[_0xc416('0xc')]);router[_0xc416('0xd')](_0xc416('0x9'),auth[_0xc416('0x7')](),controller['update']);router[_0xc416('0xe')](_0xc416('0x9'),auth[_0xc416('0x7')](),controller[_0xc416('0xf')]);module[_0xc416('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index fb58ec0..e559159 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 _0x9a9e=['customVariable','sequelize','ENUM','variable','keyValue','picklist','string','STRING'];(function(_0x141c8b,_0x40a89d){var _0xa7d317=function(_0x1380e3){while(--_0x1380e3){_0x141c8b['push'](_0x141c8b['shift']());}};_0xa7d317(++_0x40a89d);}(_0x9a9e,0x91));var _0xe9a9=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x9a9e[_0x480bc8];return _0x28c245;};'use strict';var Sequelize=require(_0xe9a9('0x0'));module['exports']={'type':{'type':Sequelize[_0xe9a9('0x1')]('string',_0xe9a9('0x2'),'customVariable',_0xe9a9('0x3'),_0xe9a9('0x4')),'defaultValue':_0xe9a9('0x5')},'content':{'type':Sequelize[_0xe9a9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe9a9('0x1')](_0xe9a9('0x5'),_0xe9a9('0x2'),_0xe9a9('0x7'))},'keyContent':{'type':Sequelize[_0xe9a9('0x6')]},'idField':{'type':Sequelize[_0xe9a9('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e79=['picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0x14359e,_0x22f998){var _0x38585c=function(_0x1bcae1){while(--_0x1bcae1){_0x14359e['push'](_0x14359e['shift']());}};_0x38585c(++_0x22f998);}(_0x6e79,0x193));var _0x96e7=function(_0xd24405,_0x5cb1f7){_0xd24405=_0xd24405-0x0;var _0xbab586=_0x6e79[_0xd24405];return _0xbab586;};'use strict';var Sequelize=require(_0x96e7('0x0'));module[_0x96e7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x96e7('0x2'),_0x96e7('0x3'),_0x96e7('0x4'),'keyValue',_0x96e7('0x5')),'defaultValue':_0x96e7('0x2')},'content':{'type':Sequelize[_0x96e7('0x6')]},'key':{'type':Sequelize[_0x96e7('0x6')]},'keyType':{'type':Sequelize[_0x96e7('0x7')](_0x96e7('0x2'),'variable',_0x96e7('0x4'))},'keyContent':{'type':Sequelize[_0x96e7('0x6')]},'idField':{'type':Sequelize[_0x96e7('0x6')]},'variableName':{'type':Sequelize[_0x96e7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9518a1a..59ac9ac 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 _0xb4a4=['fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0xd01545,_0x1331b6){var _0x1b479a=function(_0x1bea4e){while(--_0x1bea4e){_0xd01545['push'](_0xd01545['shift']());}};_0x1b479a(++_0x1331b6);}(_0xb4a4,0x1ac));var _0x4b4a=function(_0x3ad8b6,_0x2f8939){_0x3ad8b6=_0x3ad8b6-0x0;var _0x40b1d4=_0xb4a4[_0x3ad8b6];return _0x40b1d4;};'use strict';var emlformat=require(_0x4b4a('0x0'));var rimraf=require(_0x4b4a('0x1'));var zipdir=require(_0x4b4a('0x2'));var jsonpatch=require(_0x4b4a('0x3'));var rp=require(_0x4b4a('0x4'));var moment=require(_0x4b4a('0x5'));var BPromise=require(_0x4b4a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b4a('0x7'));var sox=require(_0x4b4a('0x8'));var csv=require(_0x4b4a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b4a('0xa'));var _=require(_0x4b4a('0xb'));var squel=require(_0x4b4a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4b4a('0xd'));var Papa=require(_0x4b4a('0xe'));var Redis=require(_0x4b4a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4b4a('0x10'));var as=require(_0x4b4a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b4a('0x12'))(_0x4b4a('0x13'));var utils=require('../../config/utils');var config=require(_0x4b4a('0x14'));var licenseUtil=require(_0x4b4a('0x15'));var db=require(_0x4b4a('0x16'))['db'];function respondWithStatusCode(_0x337067,_0x2eafb7){_0x2eafb7=_0x2eafb7||0xcc;return function(_0x53ea1e){if(_0x53ea1e){return _0x337067[_0x4b4a('0x17')](_0x2eafb7);}return _0x337067['status'](_0x2eafb7)[_0x4b4a('0x18')]();};}function respondWithResult(_0xeeedd4,_0x399558){_0x399558=_0x399558||0xc8;return function(_0x24acdc){if(_0x24acdc){return _0xeeedd4[_0x4b4a('0x19')](_0x399558)[_0x4b4a('0x1a')](_0x24acdc);}};}function respondWithFilteredResult(_0x49f792,_0x28dc88){return function(_0x2e9b1a){if(_0x2e9b1a){var _0x36db11=typeof _0x28dc88[_0x4b4a('0x1b')]===_0x4b4a('0x1c')&&typeof _0x28dc88['limit']===_0x4b4a('0x1c');var _0x1236ed=_0x2e9b1a[_0x4b4a('0x1d')];var _0x305ab1=_0x36db11?0x0:_0x28dc88['offset'];var _0x8987d4=_0x36db11?_0x2e9b1a[_0x4b4a('0x1d')]:_0x28dc88['offset']+_0x28dc88['limit'];var _0x27a0e9;if(_0x8987d4>=_0x1236ed){_0x8987d4=_0x1236ed;_0x27a0e9=0xc8;}else{_0x27a0e9=0xce;}_0x49f792[_0x4b4a('0x19')](_0x27a0e9);return _0x49f792[_0x4b4a('0x1e')](_0x4b4a('0x1f'),_0x305ab1+'-'+_0x8987d4+'/'+_0x1236ed)[_0x4b4a('0x1a')](_0x2e9b1a);}return null;};}function patchUpdates(_0x4bd6ce){return function(_0x63f3c0){try{jsonpatch[_0x4b4a('0x20')](_0x63f3c0,_0x4bd6ce,!![]);}catch(_0x356965){return BPromise[_0x4b4a('0x21')](_0x356965);}return _0x63f3c0[_0x4b4a('0x22')]();};}function saveUpdates(_0x37f5c0,_0x397dc0){return function(_0x5ade81){if(_0x5ade81){return _0x5ade81[_0x4b4a('0x23')](_0x37f5c0)[_0x4b4a('0x24')](function(_0x2233f7){return _0x2233f7;});}return null;};}function removeEntity(_0x36674c,_0x2cda62){return function(_0x285ccd){if(_0x285ccd){return _0x285ccd[_0x4b4a('0x25')]()[_0x4b4a('0x24')](function(){_0x36674c[_0x4b4a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b3a1,_0x11b886){return function(_0x5187bc){if(!_0x5187bc){_0x57b3a1[_0x4b4a('0x17')](0x194);}return _0x5187bc;};}function handleError(_0x281156,_0x438d1c){_0x438d1c=_0x438d1c||0x1f4;return function(_0x4df4dc){logger[_0x4b4a('0x26')](_0x4df4dc[_0x4b4a('0x27')]);if(_0x4df4dc[_0x4b4a('0x28')]){delete _0x4df4dc[_0x4b4a('0x28')];}_0x281156[_0x4b4a('0x19')](_0x438d1c)['send'](_0x4df4dc);};}exports[_0x4b4a('0x29')]=function(_0x448310,_0x12605a){var _0x2d945c={},_0x33dfff={},_0x37cdcc={'count':0x0,'rows':[]};var _0x1a88f1=_[_0x4b4a('0x2a')](db[_0x4b4a('0x2b')]['rawAttributes'],function(_0x4dda2a){return{'name':_0x4dda2a[_0x4b4a('0x2c')],'type':_0x4dda2a[_0x4b4a('0x2d')][_0x4b4a('0x2e')]};});_0x33dfff[_0x4b4a('0x2f')]=_[_0x4b4a('0x2a')](_0x1a88f1,_0x4b4a('0x28'));_0x33dfff['query']=_[_0x4b4a('0x30')](_0x448310[_0x4b4a('0x31')]);_0x33dfff[_0x4b4a('0x32')]=_['intersection'](_0x33dfff['model'],_0x33dfff['query']);_0x2d945c[_0x4b4a('0x33')]=_[_0x4b4a('0x34')](_0x33dfff[_0x4b4a('0x2f')],qs[_0x4b4a('0x35')](_0x448310[_0x4b4a('0x31')][_0x4b4a('0x35')]));_0x2d945c[_0x4b4a('0x33')]=_0x2d945c[_0x4b4a('0x33')]['length']?_0x2d945c['attributes']:_0x33dfff[_0x4b4a('0x2f')];if(!_0x448310[_0x4b4a('0x31')]['hasOwnProperty'](_0x4b4a('0x36'))){_0x2d945c['limit']=qs[_0x4b4a('0x37')](_0x448310['query'][_0x4b4a('0x37')]);_0x2d945c[_0x4b4a('0x1b')]=qs[_0x4b4a('0x1b')](_0x448310['query'][_0x4b4a('0x1b')]);}_0x2d945c[_0x4b4a('0x38')]=qs[_0x4b4a('0x39')](_0x448310[_0x4b4a('0x31')][_0x4b4a('0x39')]);_0x2d945c[_0x4b4a('0x3a')]=qs['filters'](_[_0x4b4a('0x3b')](_0x448310[_0x4b4a('0x31')],_0x33dfff[_0x4b4a('0x32')]),_0x1a88f1);if(_0x448310[_0x4b4a('0x31')]['filter']){_0x2d945c[_0x4b4a('0x3a')]=_[_0x4b4a('0x3c')](_0x2d945c[_0x4b4a('0x3a')],{'$or':_['map'](_0x1a88f1,function(_0x7d68aa){if(_0x7d68aa[_0x4b4a('0x2d')]!==_0x4b4a('0x3d')){var _0x2b3639={};_0x2b3639[_0x7d68aa[_0x4b4a('0x28')]]={'$like':'%'+_0x448310['query'][_0x4b4a('0x3e')]+'%'};return _0x2b3639;}})});}_0x2d945c=_[_0x4b4a('0x3c')]({},_0x2d945c,_0x448310['options']);var _0x11d5b4={'where':_0x2d945c[_0x4b4a('0x3a')]};return db['SalesforceField'][_0x4b4a('0x1d')](_0x11d5b4)[_0x4b4a('0x24')](function(_0x39663e){_0x37cdcc[_0x4b4a('0x1d')]=_0x39663e;if(_0x448310[_0x4b4a('0x31')][_0x4b4a('0x3f')]){_0x2d945c[_0x4b4a('0x40')]=[{'all':!![]}];}return db[_0x4b4a('0x2b')][_0x4b4a('0x41')](_0x2d945c);})[_0x4b4a('0x24')](function(_0x23128b){_0x37cdcc[_0x4b4a('0x42')]=_0x23128b;return _0x37cdcc;})['then'](respondWithFilteredResult(_0x12605a,_0x2d945c))[_0x4b4a('0x43')](handleError(_0x12605a,null));};exports['show']=function(_0x440703,_0x213e07){var _0x44016b={'raw':!![],'where':{'id':_0x440703[_0x4b4a('0x44')]['id']}},_0x712bf1={};_0x712bf1[_0x4b4a('0x2f')]=_[_0x4b4a('0x30')](db[_0x4b4a('0x2b')]['rawAttributes']);_0x712bf1[_0x4b4a('0x31')]=_[_0x4b4a('0x30')](_0x440703[_0x4b4a('0x31')]);_0x712bf1['filters']=_[_0x4b4a('0x34')](_0x712bf1[_0x4b4a('0x2f')],_0x712bf1[_0x4b4a('0x31')]);_0x44016b[_0x4b4a('0x33')]=_['intersection'](_0x712bf1[_0x4b4a('0x2f')],qs['fields'](_0x440703[_0x4b4a('0x31')][_0x4b4a('0x35')]));_0x44016b['attributes']=_0x44016b[_0x4b4a('0x33')][_0x4b4a('0x45')]?_0x44016b[_0x4b4a('0x33')]:_0x712bf1[_0x4b4a('0x2f')];if(_0x440703[_0x4b4a('0x31')][_0x4b4a('0x3f')]){_0x44016b[_0x4b4a('0x40')]=[{'all':!![]}];}_0x44016b=_[_0x4b4a('0x3c')]({},_0x44016b,_0x440703['options']);return db['SalesforceField'][_0x4b4a('0x46')](_0x44016b)[_0x4b4a('0x24')](handleEntityNotFound(_0x213e07,null))[_0x4b4a('0x24')](respondWithResult(_0x213e07,null))[_0x4b4a('0x43')](handleError(_0x213e07,null));};exports[_0x4b4a('0x47')]=function(_0x196c8f,_0x25f637){return db[_0x4b4a('0x2b')][_0x4b4a('0x47')](_0x196c8f[_0x4b4a('0x48')],{})[_0x4b4a('0x24')](respondWithResult(_0x25f637,0xc9))['catch'](handleError(_0x25f637,null));};exports[_0x4b4a('0x23')]=function(_0x5ac7e1,_0x44e5c0){if(_0x5ac7e1[_0x4b4a('0x48')]['id']){delete _0x5ac7e1[_0x4b4a('0x48')]['id'];}return db[_0x4b4a('0x2b')]['find']({'where':{'id':_0x5ac7e1[_0x4b4a('0x44')]['id']}})[_0x4b4a('0x24')](handleEntityNotFound(_0x44e5c0,null))[_0x4b4a('0x24')](saveUpdates(_0x5ac7e1['body'],null))[_0x4b4a('0x24')](respondWithResult(_0x44e5c0,null))[_0x4b4a('0x43')](handleError(_0x44e5c0,null));};exports[_0x4b4a('0x25')]=function(_0x39e559,_0x18548d){return db[_0x4b4a('0x2b')][_0x4b4a('0x46')]({'where':{'id':_0x39e559[_0x4b4a('0x44')]['id']}})[_0x4b4a('0x24')](handleEntityNotFound(_0x18548d,null))['then'](removeEntity(_0x18548d,null))[_0x4b4a('0x43')](handleError(_0x18548d,null));}; \ No newline at end of file +var _0xa572=['intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','SalesforceField','fieldName','key','model','map','query'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa572,0x14d));var _0x2a57=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xa572[_0x4bacb6];return _0x58c029;};'use strict';var emlformat=require(_0x2a57('0x0'));var rimraf=require(_0x2a57('0x1'));var zipdir=require(_0x2a57('0x2'));var jsonpatch=require(_0x2a57('0x3'));var rp=require(_0x2a57('0x4'));var moment=require(_0x2a57('0x5'));var BPromise=require(_0x2a57('0x6'));var Mustache=require(_0x2a57('0x7'));var util=require(_0x2a57('0x8'));var path=require(_0x2a57('0x9'));var sox=require(_0x2a57('0xa'));var csv=require(_0x2a57('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a57('0xc'));var _=require(_0x2a57('0xd'));var squel=require(_0x2a57('0xe'));var crypto=require(_0x2a57('0xf'));var jsforce=require(_0x2a57('0x10'));var deskjs=require(_0x2a57('0x11'));var toCsv=require(_0x2a57('0xb'));var querystring=require(_0x2a57('0x12'));var Papa=require(_0x2a57('0x13'));var Redis=require(_0x2a57('0x14'));var authService=require(_0x2a57('0x15'));var qs=require(_0x2a57('0x16'));var as=require(_0x2a57('0x17'));var hardwareService=require(_0x2a57('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x2a57('0x19'));var config=require(_0x2a57('0x1a'));var licenseUtil=require(_0x2a57('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32fc2c,_0x5e2c06){_0x5e2c06=_0x5e2c06||0xcc;return function(_0x420f19){if(_0x420f19){return _0x32fc2c[_0x2a57('0x1c')](_0x5e2c06);}return _0x32fc2c[_0x2a57('0x1d')](_0x5e2c06)[_0x2a57('0x1e')]();};}function respondWithResult(_0xdc51da,_0x504deb){_0x504deb=_0x504deb||0xc8;return function(_0x3e3c16){if(_0x3e3c16){return _0xdc51da[_0x2a57('0x1d')](_0x504deb)[_0x2a57('0x1f')](_0x3e3c16);}};}function respondWithFilteredResult(_0x4cc859,_0x2572a9){return function(_0x192d6e){if(_0x192d6e){var _0x198f10=typeof _0x2572a9[_0x2a57('0x20')]===_0x2a57('0x21')&&typeof _0x2572a9[_0x2a57('0x22')]===_0x2a57('0x21');var _0x4c8c9a=_0x192d6e['count'];var _0x1c0be3=_0x198f10?0x0:_0x2572a9['offset'];var _0x2ea626=_0x198f10?_0x192d6e[_0x2a57('0x23')]:_0x2572a9[_0x2a57('0x20')]+_0x2572a9[_0x2a57('0x22')];var _0x6ed76d;if(_0x2ea626>=_0x4c8c9a){_0x2ea626=_0x4c8c9a;_0x6ed76d=0xc8;}else{_0x6ed76d=0xce;}_0x4cc859['status'](_0x6ed76d);return _0x4cc859['set'](_0x2a57('0x24'),_0x1c0be3+'-'+_0x2ea626+'/'+_0x4c8c9a)['json'](_0x192d6e);}return null;};}function patchUpdates(_0x5020d3){return function(_0x18c857){try{jsonpatch[_0x2a57('0x25')](_0x18c857,_0x5020d3,!![]);}catch(_0x479906){return BPromise[_0x2a57('0x26')](_0x479906);}return _0x18c857[_0x2a57('0x27')]();};}function saveUpdates(_0x455d48,_0x3f8d25){return function(_0x403f4d){if(_0x403f4d){return _0x403f4d['update'](_0x455d48)['then'](function(_0x2d4ebe){return _0x2d4ebe;});}return null;};}function removeEntity(_0xb5c24e,_0x2bc16a){return function(_0x244953){if(_0x244953){return _0x244953[_0x2a57('0x28')]()[_0x2a57('0x29')](function(){_0xb5c24e[_0x2a57('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x538011,_0x3f4565){return function(_0x42f6ed){if(!_0x42f6ed){_0x538011[_0x2a57('0x1c')](0x194);}return _0x42f6ed;};}function handleError(_0x2a9ed1,_0xc327f1){_0xc327f1=_0xc327f1||0x1f4;return function(_0x40a7ea){logger['error'](_0x40a7ea[_0x2a57('0x2a')]);if(_0x40a7ea[_0x2a57('0x2b')]){delete _0x40a7ea[_0x2a57('0x2b')];}_0x2a9ed1[_0x2a57('0x1d')](_0xc327f1)[_0x2a57('0x2c')](_0x40a7ea);};}exports[_0x2a57('0x2d')]=function(_0x2d8a82,_0x2cbe1e){var _0x5129f3={},_0x39e132={},_0x5f20cf={'count':0x0,'rows':[]};var _0x249d1a=_['map'](db[_0x2a57('0x2e')]['rawAttributes'],function(_0x58d6d0){return{'name':_0x58d6d0[_0x2a57('0x2f')],'type':_0x58d6d0['type'][_0x2a57('0x30')]};});_0x39e132[_0x2a57('0x31')]=_[_0x2a57('0x32')](_0x249d1a,_0x2a57('0x2b'));_0x39e132[_0x2a57('0x33')]=_['keys'](_0x2d8a82[_0x2a57('0x33')]);_0x39e132['filters']=_[_0x2a57('0x34')](_0x39e132['model'],_0x39e132[_0x2a57('0x33')]);_0x5129f3['attributes']=_['intersection'](_0x39e132[_0x2a57('0x31')],qs[_0x2a57('0x35')](_0x2d8a82[_0x2a57('0x33')]['fields']));_0x5129f3['attributes']=_0x5129f3[_0x2a57('0x36')][_0x2a57('0x37')]?_0x5129f3['attributes']:_0x39e132[_0x2a57('0x31')];if(!_0x2d8a82[_0x2a57('0x33')]['hasOwnProperty'](_0x2a57('0x38'))){_0x5129f3[_0x2a57('0x22')]=qs[_0x2a57('0x22')](_0x2d8a82[_0x2a57('0x33')][_0x2a57('0x22')]);_0x5129f3[_0x2a57('0x20')]=qs['offset'](_0x2d8a82[_0x2a57('0x33')][_0x2a57('0x20')]);}_0x5129f3[_0x2a57('0x39')]=qs[_0x2a57('0x3a')](_0x2d8a82['query']['sort']);_0x5129f3['where']=qs[_0x2a57('0x3b')](_['pick'](_0x2d8a82['query'],_0x39e132[_0x2a57('0x3b')]),_0x249d1a);if(_0x2d8a82[_0x2a57('0x33')][_0x2a57('0x3c')]){_0x5129f3[_0x2a57('0x3d')]=_[_0x2a57('0x3e')](_0x5129f3[_0x2a57('0x3d')],{'$or':_[_0x2a57('0x32')](_0x249d1a,function(_0x51f628){if(_0x51f628['type']!=='VIRTUAL'){var _0x5d9de8={};_0x5d9de8[_0x51f628[_0x2a57('0x2b')]]={'$like':'%'+_0x2d8a82[_0x2a57('0x33')]['filter']+'%'};return _0x5d9de8;}})});}_0x5129f3=_[_0x2a57('0x3e')]({},_0x5129f3,_0x2d8a82[_0x2a57('0x3f')]);var _0x286cec={'where':_0x5129f3['where']};return db[_0x2a57('0x2e')][_0x2a57('0x23')](_0x286cec)[_0x2a57('0x29')](function(_0x23fe85){_0x5f20cf['count']=_0x23fe85;if(_0x2d8a82[_0x2a57('0x33')][_0x2a57('0x40')]){_0x5129f3[_0x2a57('0x41')]=[{'all':!![]}];}return db[_0x2a57('0x2e')][_0x2a57('0x42')](_0x5129f3);})[_0x2a57('0x29')](function(_0x5c0503){_0x5f20cf[_0x2a57('0x43')]=_0x5c0503;return _0x5f20cf;})[_0x2a57('0x29')](respondWithFilteredResult(_0x2cbe1e,_0x5129f3))[_0x2a57('0x44')](handleError(_0x2cbe1e,null));};exports[_0x2a57('0x45')]=function(_0x434a5b,_0x38b4ce){var _0x5c6102={'raw':!![],'where':{'id':_0x434a5b[_0x2a57('0x46')]['id']}},_0x24cb1d={};_0x24cb1d['model']=_[_0x2a57('0x47')](db[_0x2a57('0x2e')][_0x2a57('0x48')]);_0x24cb1d[_0x2a57('0x33')]=_[_0x2a57('0x47')](_0x434a5b[_0x2a57('0x33')]);_0x24cb1d['filters']=_['intersection'](_0x24cb1d['model'],_0x24cb1d['query']);_0x5c6102[_0x2a57('0x36')]=_[_0x2a57('0x34')](_0x24cb1d[_0x2a57('0x31')],qs['fields'](_0x434a5b['query'][_0x2a57('0x35')]));_0x5c6102[_0x2a57('0x36')]=_0x5c6102['attributes'][_0x2a57('0x37')]?_0x5c6102[_0x2a57('0x36')]:_0x24cb1d[_0x2a57('0x31')];if(_0x434a5b[_0x2a57('0x33')]['includeAll']){_0x5c6102['include']=[{'all':!![]}];}_0x5c6102=_[_0x2a57('0x3e')]({},_0x5c6102,_0x434a5b['options']);return db['SalesforceField'][_0x2a57('0x49')](_0x5c6102)[_0x2a57('0x29')](handleEntityNotFound(_0x38b4ce,null))['then'](respondWithResult(_0x38b4ce,null))[_0x2a57('0x44')](handleError(_0x38b4ce,null));};exports[_0x2a57('0x4a')]=function(_0x5ab5d4,_0x36fbef){return db[_0x2a57('0x2e')][_0x2a57('0x4a')](_0x5ab5d4[_0x2a57('0x4b')],{})['then'](respondWithResult(_0x36fbef,0xc9))[_0x2a57('0x44')](handleError(_0x36fbef,null));};exports[_0x2a57('0x4c')]=function(_0xddcbee,_0x345006){if(_0xddcbee[_0x2a57('0x4b')]['id']){delete _0xddcbee[_0x2a57('0x4b')]['id'];}return db[_0x2a57('0x2e')][_0x2a57('0x49')]({'where':{'id':_0xddcbee[_0x2a57('0x46')]['id']}})[_0x2a57('0x29')](handleEntityNotFound(_0x345006,null))[_0x2a57('0x29')](saveUpdates(_0xddcbee[_0x2a57('0x4b')],null))[_0x2a57('0x29')](respondWithResult(_0x345006,null))[_0x2a57('0x44')](handleError(_0x345006,null));};exports['destroy']=function(_0x137da6,_0x2bdcc6){return db[_0x2a57('0x2e')][_0x2a57('0x49')]({'where':{'id':_0x137da6[_0x2a57('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bdcc6,null))[_0x2a57('0x29')](removeEntity(_0x2bdcc6,null))[_0x2a57('0x44')](handleError(_0x2bdcc6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 6861d43..6214d9e 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 _0x0b89=['util','../../config/logger','moment','bluebird','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','lodash'];(function(_0x398f4e,_0x1081b2){var _0x5dbcba=function(_0x6f2cca){while(--_0x6f2cca){_0x398f4e['push'](_0x398f4e['shift']());}};_0x5dbcba(++_0x1081b2);}(_0x0b89,0x1cb));var _0x90b8=function(_0x3d17d8,_0x1fa1a7){_0x3d17d8=_0x3d17d8-0x0;var _0x3ca057=_0x0b89[_0x3d17d8];return _0x3ca057;};'use strict';var _=require(_0x90b8('0x0'));var util=require(_0x90b8('0x1'));var logger=require(_0x90b8('0x2'))('api');var moment=require(_0x90b8('0x3'));var BPromise=require(_0x90b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90b8('0x5'));module[_0x90b8('0x6')]=function(_0x365ee8,_0x3d5b03){return _0x365ee8[_0x90b8('0x7')]('SalesforceField',attributes,{'tableName':_0x90b8('0x8'),'paranoid':![],'indexes':[{'name':_0x90b8('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7084=['request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fee03,_0x251295){var _0x90a85=function(_0x16a1c2){while(--_0x16a1c2){_0x2fee03['push'](_0x2fee03['shift']());}};_0x90a85(++_0x251295);}(_0x7084,0xfa));var _0x4708=function(_0x2c3f35,_0x57221b){_0x2c3f35=_0x2c3f35-0x0;var _0xf9105e=_0x7084[_0x2c3f35];return _0xf9105e;};'use strict';var _=require(_0x4708('0x0'));var util=require(_0x4708('0x1'));var logger=require(_0x4708('0x2'))(_0x4708('0x3'));var moment=require(_0x4708('0x4'));var BPromise=require(_0x4708('0x5'));var rp=require(_0x4708('0x6'));var fs=require('fs');var path=require(_0x4708('0x7'));var rimraf=require(_0x4708('0x8'));var config=require(_0x4708('0x9'));var attributes=require(_0x4708('0xa'));module[_0x4708('0xb')]=function(_0xbaddc9,_0x5a73cd){return _0xbaddc9['define'](_0x4708('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x4708('0xd'),'fields':[_0x4708('0xe'),_0x4708('0xf')],'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 72aaf9d..9c1cd83 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 _0x48a3=['error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x547515,_0x41c2c4){var _0x2fdecf=function(_0x55f20e){while(--_0x55f20e){_0x547515['push'](_0x547515['shift']());}};_0x2fdecf(++_0x41c2c4);}(_0x48a3,0xcc));var _0x348a=function(_0x34b071,_0x415c5b){_0x34b071=_0x34b071-0x0;var _0x1b391d=_0x48a3[_0x34b071];return _0x1b391d;};'use strict';var _=require(_0x348a('0x0'));var util=require(_0x348a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x348a('0x2'));var fs=require('fs');var Redis=require(_0x348a('0x3'));var db=require(_0x348a('0x4'))['db'];var utils=require(_0x348a('0x5'));var logger=require('../../config/logger')(_0x348a('0x6'));var config=require(_0x348a('0x7'));var jayson=require(_0x348a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4451fd,_0x428ba8,_0xbb26a7){return new BPromise(function(_0x121253,_0x4da856){return client[_0x348a('0x9')](_0x4451fd,_0xbb26a7)[_0x348a('0xa')](function(_0x5039ed){logger[_0x348a('0xb')](_0x348a('0xc'),_0x428ba8,_0x348a('0xd'));logger[_0x348a('0xe')](_0x348a('0xf'),_0x428ba8,_0x348a('0xd'),JSON['stringify'](_0x5039ed));if(_0x5039ed['error']){if(_0x5039ed[_0x348a('0x10')][_0x348a('0x11')]===0x1f4){logger[_0x348a('0x10')](_0x348a('0xc'),_0x428ba8,_0x5039ed[_0x348a('0x10')][_0x348a('0x12')]);return _0x4da856(_0x5039ed[_0x348a('0x10')][_0x348a('0x12')]);}logger[_0x348a('0x10')](_0x348a('0xc'),_0x428ba8,_0x5039ed[_0x348a('0x10')][_0x348a('0x12')]);return _0x121253(_0x5039ed[_0x348a('0x10')][_0x348a('0x12')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x428ba8,_0x348a('0xd'));_0x121253(_0x5039ed[_0x348a('0x13')][_0x348a('0x12')]);}})['catch'](function(_0x2b39c4){logger[_0x348a('0x10')]('SalesforceField,\x20%s,\x20%s',_0x428ba8,_0x2b39c4);_0x4da856(_0x2b39c4);});});} \ No newline at end of file +var _0xa703=['SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x483709,_0x37708e){var _0x43b326=function(_0x42744f){while(--_0x42744f){_0x483709['push'](_0x483709['shift']());}};_0x43b326(++_0x37708e);}(_0xa703,0x94));var _0x3a70=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa703[_0x411add];return _0x238242;};'use strict';var _=require(_0x3a70('0x0'));var util=require(_0x3a70('0x1'));var moment=require(_0x3a70('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a70('0x3'));var fs=require('fs');var Redis=require(_0x3a70('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a70('0x5'));var logger=require(_0x3a70('0x6'))(_0x3a70('0x7'));var config=require(_0x3a70('0x8'));var jayson=require(_0x3a70('0x9'));var client=jayson[_0x3a70('0xa')][_0x3a70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x135453,_0x398a23,_0x457888){return new BPromise(function(_0x21b0dc,_0x3adc73){return client[_0x3a70('0xc')](_0x135453,_0x457888)['then'](function(_0x4997bf){logger[_0x3a70('0xd')]('SalesforceField,\x20%s,\x20%s',_0x398a23,_0x3a70('0xe'));logger[_0x3a70('0xf')](_0x3a70('0x10'),_0x398a23,_0x3a70('0xe'),JSON[_0x3a70('0x11')](_0x4997bf));if(_0x4997bf[_0x3a70('0x12')]){if(_0x4997bf[_0x3a70('0x12')][_0x3a70('0x13')]===0x1f4){logger[_0x3a70('0x12')](_0x3a70('0x14'),_0x398a23,_0x4997bf[_0x3a70('0x12')][_0x3a70('0x15')]);return _0x3adc73(_0x4997bf[_0x3a70('0x12')][_0x3a70('0x15')]);}logger[_0x3a70('0x12')](_0x3a70('0x14'),_0x398a23,_0x4997bf[_0x3a70('0x12')][_0x3a70('0x15')]);return _0x21b0dc(_0x4997bf['error'][_0x3a70('0x15')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x398a23,_0x3a70('0xe'));_0x21b0dc(_0x4997bf[_0x3a70('0x16')][_0x3a70('0x15')]);}})[_0x3a70('0x17')](function(_0x5047d2){logger['error'](_0x3a70('0x14'),_0x398a23,_0x5047d2);_0x3adc73(_0x5047d2);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0a96f50..ea4537d 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 _0x4711=['./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5eac33,_0x126183){var _0x5a5f17=function(_0x292781){while(--_0x292781){_0x5eac33['push'](_0x5eac33['shift']());}};_0x5a5f17(++_0x126183);}(_0x4711,0x10c));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1471('0x0'));var util=require(_0x1471('0x1'));var path=require(_0x1471('0x2'));var timeout=require(_0x1471('0x3'));var express=require(_0x1471('0x4'));var router=express[_0x1471('0x5')]();var fs_extra=require(_0x1471('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1471('0x7'));var config=require('../../config/environment');var controller=require(_0x1471('0x8'));router[_0x1471('0x9')]('/',auth[_0x1471('0xa')](),controller[_0x1471('0xb')]);router[_0x1471('0x9')]('/:id',auth[_0x1471('0xa')](),controller[_0x1471('0xc')]);router[_0x1471('0x9')](_0x1471('0xd'),auth[_0x1471('0xa')](),controller['getConfigurations']);router['get'](_0x1471('0xe'),auth[_0x1471('0xa')](),controller[_0x1471('0xf')]);router[_0x1471('0x10')]('/',auth[_0x1471('0xa')](),controller[_0x1471('0x11')]);router[_0x1471('0x10')](_0x1471('0xd'),auth['isAuthenticated'](),controller[_0x1471('0x12')]);router[_0x1471('0x13')](_0x1471('0x14'),auth[_0x1471('0xa')](),controller[_0x1471('0x15')]);router['delete'](_0x1471('0x14'),auth[_0x1471('0xa')](),controller[_0x1471('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4058=['isAuthenticated','index','get','/:id','/:id/configurations','getFields','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0x4058,0x129));var _0x8405=function(_0x5c5faf,_0x18e0ac){_0x5c5faf=_0x5c5faf-0x0;var _0x5ef14d=_0x4058[_0x5c5faf];return _0x5ef14d;};'use strict';var multer=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var path=require(_0x8405('0x2'));var timeout=require(_0x8405('0x3'));var express=require(_0x8405('0x4'));var router=express[_0x8405('0x5')]();var fs_extra=require(_0x8405('0x6'));var auth=require(_0x8405('0x7'));var interaction=require(_0x8405('0x8'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x8405('0x9')](),controller[_0x8405('0xa')]);router[_0x8405('0xb')](_0x8405('0xc'),auth[_0x8405('0x9')](),controller['show']);router[_0x8405('0xb')](_0x8405('0xd'),auth[_0x8405('0x9')](),controller['getConfigurations']);router[_0x8405('0xb')]('/:id/fields',auth[_0x8405('0x9')](),controller[_0x8405('0xe')]);router['post']('/',auth[_0x8405('0x9')](),controller[_0x8405('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8405('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8405('0x9')](),controller[_0x8405('0x11')]);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 04cbaa3..b36126f 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 _0x6078=['username','remoteUri','sequelize','exports','STRING'];(function(_0x59de8a,_0xbf84e){var _0x337bc4=function(_0x5b0c05){while(--_0x5b0c05){_0x59de8a['push'](_0x59de8a['shift']());}};_0x337bc4(++_0xbf84e);}(_0x6078,0x1ec));var _0x8607=function(_0x168e04,_0x2d0c3a){_0x168e04=_0x168e04-0x0;var _0x551d64=_0x6078[_0x168e04];return _0x551d64;};'use strict';var Sequelize=require(_0x8607('0x0'));module[_0x8607('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8607('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8607('0x3')},'password':{'type':Sequelize[_0x8607('0x2')]},'email':{'type':Sequelize[_0x8607('0x2')]},'remoteUri':{'type':Sequelize[_0x8607('0x2')],'unique':_0x8607('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8aaa=['STRING','sequelize','exports'];(function(_0x398acc,_0x21f70b){var _0x6a9478=function(_0x57591d){while(--_0x57591d){_0x398acc['push'](_0x398acc['shift']());}};_0x6a9478(++_0x21f70b);}(_0x8aaa,0x14b));var _0xa8aa=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x8aaa[_0x107f10];return _0x811cab;};'use strict';var Sequelize=require(_0xa8aa('0x0'));module[_0xa8aa('0x1')]={'name':{'type':Sequelize[_0xa8aa('0x2')]},'description':{'type':Sequelize[_0xa8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa8aa('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa8aa('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 1c2412f..28fed02 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 _0x4264=['sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','offset','set','Content-Range','reject','then','destroy','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','update','find','findOne','ServicenowConfiguration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','knowledge','subcategory','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','priority','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','close_code','delivery_task','work_start','business_stc','additional_assignee_list','description','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','urgency','problem_id','company','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','location','username','password','email','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','error','send','Wrong\x20credentials','statusCode','boolean','True','true','False','false'];(function(_0x56e86a,_0x514475){var _0x49a80a=function(_0x997829){while(--_0x997829){_0x56e86a['push'](_0x56e86a['shift']());}};_0x49a80a(++_0x514475);}(_0x4264,0xbe));var _0x4426=function(_0x2869f5,_0x30fb8d){_0x2869f5=_0x2869f5-0x0;var _0x2ec4da=_0x4264[_0x2869f5];return _0x2ec4da;};'use strict';var emlformat=require(_0x4426('0x0'));var rimraf=require(_0x4426('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4426('0x2'));var rp=require(_0x4426('0x3'));var moment=require(_0x4426('0x4'));var BPromise=require(_0x4426('0x5'));var Mustache=require(_0x4426('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4426('0x7'));var csv=require(_0x4426('0x8'));var ejs=require(_0x4426('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4426('0xa'));var squel=require(_0x4426('0xb'));var crypto=require(_0x4426('0xc'));var jsforce=require(_0x4426('0xd'));var deskjs=require(_0x4426('0xe'));var toCsv=require(_0x4426('0x8'));var querystring=require(_0x4426('0xf'));var Papa=require(_0x4426('0x10'));var Redis=require('ioredis');var authService=require(_0x4426('0x11'));var qs=require(_0x4426('0x12'));var as=require(_0x4426('0x13'));var hardwareService=require(_0x4426('0x14'));var logger=require(_0x4426('0x15'))(_0x4426('0x16'));var utils=require(_0x4426('0x17'));var config=require(_0x4426('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4426('0x19'))['db'];var integrations=require(_0x4426('0x1a'));function respondWithStatusCode(_0x574ada,_0x2b4bb8){_0x2b4bb8=_0x2b4bb8||0xcc;return function(_0x5b2fef){if(_0x5b2fef){return _0x574ada['sendStatus'](_0x2b4bb8);}return _0x574ada['status'](_0x2b4bb8)['end']();};}function respondWithResult(_0x1df9c1,_0x1ce44f){_0x1ce44f=_0x1ce44f||0xc8;return function(_0x2ae62f){if(_0x2ae62f){return _0x1df9c1[_0x4426('0x1b')](_0x1ce44f)[_0x4426('0x1c')](_0x2ae62f);}};}function respondWithFilteredResult(_0x5d0b14,_0x14de48){return function(_0x3b7394){if(_0x3b7394){var _0x2a841b=typeof _0x14de48['offset']===_0x4426('0x1d')&&typeof _0x14de48[_0x4426('0x1e')]===_0x4426('0x1d');var _0x30d90a=_0x3b7394['count'];var _0x2a2bad=_0x2a841b?0x0:_0x14de48[_0x4426('0x1f')];var _0x3258cc=_0x2a841b?_0x3b7394['count']:_0x14de48[_0x4426('0x1f')]+_0x14de48[_0x4426('0x1e')];var _0x15841d;if(_0x3258cc>=_0x30d90a){_0x3258cc=_0x30d90a;_0x15841d=0xc8;}else{_0x15841d=0xce;}_0x5d0b14[_0x4426('0x1b')](_0x15841d);return _0x5d0b14[_0x4426('0x20')](_0x4426('0x21'),_0x2a2bad+'-'+_0x3258cc+'/'+_0x30d90a)['json'](_0x3b7394);}return null;};}function patchUpdates(_0x5fed41){return function(_0x2c44b2){try{jsonpatch['apply'](_0x2c44b2,_0x5fed41,!![]);}catch(_0x3fc5c6){return BPromise[_0x4426('0x22')](_0x3fc5c6);}return _0x2c44b2['save']();};}function saveUpdates(_0x4c4adf,_0x3957a9){return function(_0x255760){if(_0x255760){return _0x255760['update'](_0x4c4adf)[_0x4426('0x23')](function(_0x50ed48){return _0x50ed48;});}return null;};}function removeEntity(_0x337c78,_0x4ecc03){return function(_0x3e2e29){if(_0x3e2e29){return _0x3e2e29[_0x4426('0x24')]()['then'](function(){_0x337c78[_0x4426('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530d2f,_0x3c8774){return function(_0xd674c2){if(!_0xd674c2){_0x530d2f['sendStatus'](0x194);}return _0xd674c2;};}function handleError(_0xe6b920,_0x347015){_0x347015=_0x347015||0x1f4;return function(_0x491f0a){logger['error'](_0x491f0a[_0x4426('0x25')]);if(_0x491f0a[_0x4426('0x26')]){delete _0x491f0a[_0x4426('0x26')];}_0xe6b920[_0x4426('0x1b')](_0x347015)['send'](_0x491f0a);};}exports[_0x4426('0x27')]=function(_0x1821cb,_0x4fe377){var _0x29cbdf={},_0x579bfc={},_0x1cfeae={'count':0x0,'rows':[]};var _0x3c5a39=_[_0x4426('0x28')](db[_0x4426('0x29')][_0x4426('0x2a')],function(_0xe49e2){return{'name':_0xe49e2[_0x4426('0x2b')],'type':_0xe49e2[_0x4426('0x2c')][_0x4426('0x2d')]};});_0x579bfc[_0x4426('0x2e')]=_[_0x4426('0x28')](_0x3c5a39,_0x4426('0x26'));_0x579bfc[_0x4426('0x2f')]=_[_0x4426('0x30')](_0x1821cb['query']);_0x579bfc[_0x4426('0x31')]=_[_0x4426('0x32')](_0x579bfc[_0x4426('0x2e')],_0x579bfc['query']);_0x29cbdf[_0x4426('0x33')]=_[_0x4426('0x32')](_0x579bfc[_0x4426('0x2e')],qs[_0x4426('0x34')](_0x1821cb['query']['fields']));_0x29cbdf[_0x4426('0x33')]=_0x29cbdf['attributes']['length']?_0x29cbdf['attributes']:_0x579bfc[_0x4426('0x2e')];if(!_0x1821cb[_0x4426('0x2f')][_0x4426('0x35')]('nolimit')){_0x29cbdf[_0x4426('0x1e')]=qs[_0x4426('0x1e')](_0x1821cb[_0x4426('0x2f')][_0x4426('0x1e')]);_0x29cbdf[_0x4426('0x1f')]=qs[_0x4426('0x1f')](_0x1821cb[_0x4426('0x2f')][_0x4426('0x1f')]);}_0x29cbdf[_0x4426('0x36')]=qs['sort'](_0x1821cb[_0x4426('0x2f')][_0x4426('0x37')]);_0x29cbdf[_0x4426('0x38')]=qs[_0x4426('0x31')](_[_0x4426('0x39')](_0x1821cb[_0x4426('0x2f')],_0x579bfc[_0x4426('0x31')]),_0x3c5a39);if(_0x1821cb['query']['filter']){_0x29cbdf[_0x4426('0x38')]=_[_0x4426('0x3a')](_0x29cbdf[_0x4426('0x38')],{'$or':_[_0x4426('0x28')](_0x3c5a39,function(_0x278ff6){if(_0x278ff6[_0x4426('0x2c')]!==_0x4426('0x3b')){var _0x311a5f={};_0x311a5f[_0x278ff6[_0x4426('0x26')]]={'$like':'%'+_0x1821cb['query'][_0x4426('0x3c')]+'%'};return _0x311a5f;}})});}_0x29cbdf=_['merge']({},_0x29cbdf,_0x1821cb['options']);var _0x509651={'where':_0x29cbdf[_0x4426('0x38')]};return db[_0x4426('0x29')]['count'](_0x509651)[_0x4426('0x23')](function(_0x4f2c95){_0x1cfeae['count']=_0x4f2c95;if(_0x1821cb[_0x4426('0x2f')][_0x4426('0x3d')]){_0x29cbdf[_0x4426('0x3e')]=[{'all':!![]}];}return db[_0x4426('0x29')][_0x4426('0x3f')](_0x29cbdf);})['then'](function(_0x203f9c){_0x1cfeae[_0x4426('0x40')]=_0x203f9c;return _0x1cfeae;})[_0x4426('0x23')](respondWithFilteredResult(_0x4fe377,_0x29cbdf))[_0x4426('0x41')](handleError(_0x4fe377,null));};exports[_0x4426('0x42')]=function(_0x29086a,_0x2789b7){var _0x595fd4={'raw':![],'where':{'id':_0x29086a[_0x4426('0x43')]['id']}},_0x597257={};_0x597257[_0x4426('0x2e')]=_['keys'](db[_0x4426('0x29')][_0x4426('0x2a')]);_0x597257[_0x4426('0x2f')]=_[_0x4426('0x30')](_0x29086a[_0x4426('0x2f')]);_0x597257[_0x4426('0x31')]=_['intersection'](_0x597257[_0x4426('0x2e')],_0x597257['query']);_0x595fd4['attributes']=_[_0x4426('0x32')](_0x597257[_0x4426('0x2e')],qs[_0x4426('0x34')](_0x29086a[_0x4426('0x2f')][_0x4426('0x34')]));_0x595fd4[_0x4426('0x33')]=_0x595fd4[_0x4426('0x33')][_0x4426('0x44')]?_0x595fd4[_0x4426('0x33')]:_0x597257[_0x4426('0x2e')];if(_0x29086a[_0x4426('0x2f')][_0x4426('0x3d')]){_0x595fd4['include']=[{'all':!![]}];}_0x595fd4=_[_0x4426('0x3a')]({},_0x595fd4,_0x29086a[_0x4426('0x45')]);return db['ServicenowAccount']['find'](_0x595fd4)[_0x4426('0x23')](handleEntityNotFound(_0x2789b7,null))[_0x4426('0x23')](respondWithResult(_0x2789b7,null))[_0x4426('0x41')](handleError(_0x2789b7,null));};exports[_0x4426('0x46')]=function(_0x5eab19,_0x2cc3f8){return db[_0x4426('0x29')][_0x4426('0x46')](_0x5eab19[_0x4426('0x47')],{})['then'](respondWithResult(_0x2cc3f8,0xc9))[_0x4426('0x41')](handleError(_0x2cc3f8,null));};exports[_0x4426('0x48')]=function(_0x37df74,_0x103995){if(_0x37df74[_0x4426('0x47')]['id']){delete _0x37df74[_0x4426('0x47')]['id'];}return db['ServicenowAccount'][_0x4426('0x49')]({'where':{'id':_0x37df74[_0x4426('0x43')]['id']}})[_0x4426('0x23')](handleEntityNotFound(_0x103995,null))[_0x4426('0x23')](saveUpdates(_0x37df74[_0x4426('0x47')],null))[_0x4426('0x23')](respondWithResult(_0x103995,null))['catch'](handleError(_0x103995,null));};exports['destroy']=function(_0x5cdba4,_0x1f6ded){return db[_0x4426('0x29')][_0x4426('0x49')]({'where':{'id':_0x5cdba4['params']['id']}})[_0x4426('0x23')](handleEntityNotFound(_0x1f6ded,null))[_0x4426('0x23')](removeEntity(_0x1f6ded,null))[_0x4426('0x41')](handleError(_0x1f6ded,null));};exports['getConfigurations']=function(_0xa0a68d,_0x16b11e,_0x1c0c5a){var _0x856120={};var _0x42f4b4={};var _0x199332;var _0x1436c8;return db[_0x4426('0x29')][_0x4426('0x4a')]({'where':{'id':_0xa0a68d[_0x4426('0x43')]['id']}})[_0x4426('0x23')](handleEntityNotFound(_0x16b11e,null))[_0x4426('0x23')](function(_0x35aa17){if(_0x35aa17){_0x199332=_0x35aa17;_0x42f4b4[_0x4426('0x2e')]=_[_0x4426('0x30')](db[_0x4426('0x4b')][_0x4426('0x2a')]);_0x42f4b4['query']=_[_0x4426('0x30')](_0xa0a68d[_0x4426('0x2f')]);_0x42f4b4[_0x4426('0x31')]=_[_0x4426('0x32')](_0x42f4b4[_0x4426('0x2e')],_0x42f4b4[_0x4426('0x2f')]);_0x856120[_0x4426('0x33')]=_[_0x4426('0x32')](_0x42f4b4[_0x4426('0x2e')],qs[_0x4426('0x34')](_0xa0a68d[_0x4426('0x2f')][_0x4426('0x34')]));_0x856120[_0x4426('0x33')]=_0x856120[_0x4426('0x33')][_0x4426('0x44')]?_0x856120[_0x4426('0x33')]:_0x42f4b4[_0x4426('0x2e')];_0x856120['order']=qs['sort'](_0xa0a68d[_0x4426('0x2f')][_0x4426('0x37')]);_0x856120[_0x4426('0x38')]=qs['filters'](_[_0x4426('0x39')](_0xa0a68d[_0x4426('0x2f')],_0x42f4b4[_0x4426('0x31')]));if(_0xa0a68d['query']['filter']){_0x856120[_0x4426('0x38')]=_[_0x4426('0x3a')](_0x856120['where'],{'$or':_['map'](_0x856120[_0x4426('0x33')],function(_0x1058e8){var _0x426b14={};_0x426b14[_0x1058e8]={'$like':'%'+_0xa0a68d[_0x4426('0x2f')][_0x4426('0x3c')]+'%'};return _0x426b14;})});}_0x856120=_['merge']({},_0x856120,_0xa0a68d[_0x4426('0x45')]);return _0x199332[_0x4426('0x4c')](_0x856120);}})[_0x4426('0x23')](function(_0x19b9e5){if(_0x19b9e5){_0x1436c8=_0x19b9e5['length'];if(!_0xa0a68d['query'][_0x4426('0x35')](_0x4426('0x4d'))){_0x856120[_0x4426('0x1e')]=qs[_0x4426('0x1e')](_0xa0a68d[_0x4426('0x2f')]['limit']);_0x856120[_0x4426('0x1f')]=qs['offset'](_0xa0a68d[_0x4426('0x2f')][_0x4426('0x1f')]);}return _0x199332['getConfigurations'](_0x856120);}})[_0x4426('0x23')](function(_0x5cfe38){if(_0x5cfe38){return _0x5cfe38?{'count':_0x1436c8,'rows':_0x5cfe38}:null;}})[_0x4426('0x23')](respondWithResult(_0x16b11e,null))[_0x4426('0x41')](handleError(_0x16b11e,null));};exports[_0x4426('0x4e')]=function(_0x5b6e3f,_0x1882d1,_0xde213f){if(_0x5b6e3f[_0x4426('0x47')]['id']){delete _0x5b6e3f[_0x4426('0x47')]['id'];}return db['ServicenowAccount'][_0x4426('0x4a')]({'where':{'id':_0x5b6e3f[_0x4426('0x43')]['id']}})[_0x4426('0x23')](handleEntityNotFound(_0x1882d1,null))[_0x4426('0x23')](function(_0x3ce498){if(_0x3ce498){_0x5b6e3f['body']['AccountId']=_0x3ce498['id'];_0x5b6e3f[_0x4426('0x47')][_0x4426('0x4f')]=integrations[_0x4426('0x50')](_0x5b6e3f[_0x4426('0x47')]['channel'],_0x5b6e3f[_0x4426('0x47')][_0x4426('0x2c')]);_0x5b6e3f[_0x4426('0x47')][_0x4426('0x51')]=integrations[_0x4426('0x52')](_0x5b6e3f[_0x4426('0x47')][_0x4426('0x53')],_0x5b6e3f[_0x4426('0x47')][_0x4426('0x2c')]);return db[_0x4426('0x4b')][_0x4426('0x46')](_0x5b6e3f[_0x4426('0x47')],{'include':[{'model':db['ServicenowField'],'as':_0x4426('0x4f')},{'model':db[_0x4426('0x54')],'as':'Descriptions'}]});}return null;})[_0x4426('0x23')](respondWithResult(_0x1882d1,null))[_0x4426('0x41')](handleError(_0x1882d1,null));};exports[_0x4426('0x55')]=function(_0x272ed8,_0x501fd2,_0x2f6fe3){var _0x3d19c6=[_0x4426('0x56'),'hold_reason',_0x4426('0x57'),_0x4426('0x58'),'close_code','notify',_0x4426('0x59'),_0x4426('0x5a'),_0x4426('0x5b')];var _0x239972=[_0x4426('0x5c'),'made_sla',_0x4426('0x5d'),_0x4426('0x5e'),_0x4426('0x5f'),_0x4426('0x60'),'child_incidents',_0x4426('0x61'),_0x4426('0x62'),_0x4426('0x63'),_0x4426('0x64'),_0x4426('0x65'),'opened_by','user_input',_0x4426('0x66'),_0x4426('0x67'),_0x4426('0x68'),_0x4426('0x69'),'knowledge',_0x4426('0x36'),_0x4426('0x6a'),_0x4426('0x6b'),'cmdb_ci',_0x4426('0x6c'),_0x4426('0x6d'),_0x4426('0x6e'),_0x4426('0x6f'),_0x4426('0x70'),_0x4426('0x71'),'sys_domain_path','rfc',_0x4426('0x72'),_0x4426('0x73'),_0x4426('0x74'),_0x4426('0x75'),'group_list',_0x4426('0x76'),_0x4426('0x77'),_0x4426('0x78'),'caller_id',_0x4426('0x79'),'subcategory',_0x4426('0x7a'),_0x4426('0x7b'),_0x4426('0x7c'),'correlation_display',_0x4426('0x7d'),_0x4426('0x7e'),'assignment_group',_0x4426('0x7f'),_0x4426('0x80'),_0x4426('0x81'),'calendar_duration',_0x4426('0x82'),_0x4426('0x83'),'close_notes',_0x4426('0x84'),'follow_up',_0x4426('0x85'),_0x4426('0x86'),_0x4426('0x87'),'reopened_by',_0x4426('0x59'),_0x4426('0x88'),_0x4426('0x89'),_0x4426('0x8a'),'reassignment_count',_0x4426('0x8b'),_0x4426('0x8c'),'severity','comments',_0x4426('0x8d'),_0x4426('0x8e'),_0x4426('0x8f'),_0x4426('0x90'),_0x4426('0x91'),_0x4426('0x92'),_0x4426('0x93'),_0x4426('0x94'),_0x4426('0x95'),'correlation_id',_0x4426('0x96'),_0x4426('0x5b')];var _0x52c56b='';var _0x28ff13='';var _0x291a1a=[];var _0x11aef5='';var _0x1df173='';var _0x1fcd17=[];var _0x33ee1d='';var _0x1b8a94='';var _0x37d067={};var _0x1541e9='';return db[_0x4426('0x29')][_0x4426('0x4a')]({'where':{'id':_0x272ed8['params']['id']},'attributes':['id',_0x4426('0x97'),_0x4426('0x98'),_0x4426('0x99'),_0x4426('0x9a'),'serverUrl']})['then'](handleEntityNotFound(_0x501fd2,null))[_0x4426('0x23')](function(_0x436a24){if(_0x436a24){_0x1541e9=_0x436a24[_0x4426('0x9a')];var _0x3b40a0=_0x1541e9['slice'](-0x1);if(_0x3b40a0==='/'){_0x1541e9=_0x1541e9[_0x4426('0x9b')](0x0,_0x1541e9[_0x4426('0x9c')](_0x3b40a0));}_0x1b8a94=util[_0x4426('0x9d')](_0x4426('0x9e'),_0x1541e9);_0x33ee1d=util[_0x4426('0x9d')](_0x4426('0x9f'),_0x1541e9);_0x37d067={'user':_0x436a24[_0x4426('0x97')],'pass':_0x436a24[_0x4426('0x98')]};var _0x403f2f={'method':_0x4426('0xa0'),'uri':_0x1b8a94+_0x4426('0xa1'),'auth':_0x37d067,'json':!![]};return rp(_0x403f2f);}})[_0x4426('0x23')](function(_0xe334d4){if(_0xe334d4['result'][_0x4426('0x44')]>0x0){_0x52c56b=_0xe334d4[_0x4426('0xa2')];}console[_0x4426('0xa3')]('incident\x20table\x20objects',_0x52c56b);_0x1fcd17=[];_0x28ff13=Object[_0x4426('0xa4')]([],_0x52c56b);_[_0x4426('0xa5')](_0x28ff13,function(_0x5cd44c){return!_0x3d19c6[_0x4426('0xa6')](_0x5cd44c[_0x4426('0x26')]);});_0x28ff13[_0x4426('0xa7')](function(_0x1572d6){var _0x2f5a98=createFieldObject(_0x33ee1d,_0x37d067,_0x1572d6[_0x4426('0xa8')],_0x1572d6[_0x4426('0x26')],_0x1572d6[_0x4426('0xa9')],![]);_0x1fcd17['push'](_0x2f5a98);});return Promise[_0x4426('0xaa')](_0x1fcd17);})['then'](function(_0x3cfeb0){_0x291a1a=_0x3cfeb0;_0x11aef5=Object[_0x4426('0xa4')]([],_0x52c56b);console['log'](_0x4426('0xab'),_0x52c56b);_[_0x4426('0xa5')](_0x11aef5,function(_0x1f2f4b){return _0x239972[_0x4426('0xa6')](_0x1f2f4b['name']);});console[_0x4426('0xa3')](_0x4426('0xac'),_0x11aef5);_0x1fcd17=[];_0x11aef5['forEach'](function(_0x3c68f6){var _0x30c1e4=createFieldObject(_0x33ee1d,_0x37d067,_0x3c68f6[_0x4426('0xa8')],_0x3c68f6[_0x4426('0x26')],_0x3c68f6[_0x4426('0xa9')],!![]);_0x1fcd17[_0x4426('0xad')](_0x30c1e4);});return Promise[_0x4426('0xaa')](_0x1fcd17);})[_0x4426('0x23')](function(_0x1ae14a){_0x1df173=_0x1ae14a;var _0x329515=_0x291a1a[_0x4426('0xae')](_0x1df173);return{'count':_0x329515[_0x4426('0x44')],'rows':_0x329515};})[_0x4426('0x23')](respondWithResult(_0x501fd2,null))['catch'](function(_0xec9f6){console[_0x4426('0xa3')](_0x4426('0xaf')+_0xec9f6);var _0x37cb19=_0x272ed8['query'][_0x4426('0xb0')]?0x1f4:_0xec9f6['statusCode']||0x1f4;logger[_0x4426('0xb1')](_0xec9f6['stack']);delete _0xec9f6[_0x4426('0x26')];if(_0x37cb19===0x191){_0x37cb19=0x190;}_0x501fd2[_0x4426('0x1b')](_0x37cb19)[_0x4426('0xb2')](_0x272ed8[_0x4426('0x2f')]['test']?{'message':_0x4426('0xb3'),'statusCode':_0xec9f6[_0x4426('0xb4')]}:_0xec9f6);});};function createFieldObject(_0x5d68b7,_0x19222c,_0x3a1369,_0x4bfceb,_0x563707,_0x28b2c6){return new Promise(function(_0x548e8e,_0xe8013a){var _0x213852={'id':_0x4bfceb,'name':_0x563707,'custom':_0x28b2c6};if(_0x3a1369===_0x4426('0xb5')){_0x213852[_0x4426('0x45')]=[{'name':_0x4426('0xb6'),'value':_0x4426('0xb7')},{'name':_0x4426('0xb8'),'value':_0x4426('0xb9')}];_0x548e8e(_0x213852);}else{var _0x2a4808={'method':_0x4426('0xa0'),'uri':_0x5d68b7+_0x4426('0xba')+_0x4bfceb,'auth':_0x19222c,'json':!![]};return rp(_0x2a4808)[_0x4426('0x23')](function(_0xd6f69){var _0x33d754=[];if(_0xd6f69[_0x4426('0xa2')][_0x4426('0x44')]>0x0){_0xd6f69['result'][_0x4426('0xa7')](function(_0x12b494){if(_0x12b494['inactive']===_0x4426('0xb9')){var _0x2901b6={'name':_0x12b494[_0x4426('0xa9')],'value':_0x12b494[_0x4426('0xbb')]};_0x33d754['push'](_0x2901b6);}});}_0x213852[_0x4426('0x45')]=_0x33d754;if(_0x213852[_0x4426('0x45')][_0x4426('0x44')]>0x0){_0x548e8e(_0x213852);}else{if(_0x28b2c6==![]){_0x548e8e();}else{_0x548e8e(_0x213852);}}});}});} \ No newline at end of file +var _0x5bb8=['index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','findOne','ServicenowConfiguration','nolimit','getConfigurations','addConfiguration','AccountId','channel','type','Descriptions','ServicenowField','Subjects','getFields','hold_reason','subcategory','close_code','parent','made_sla','caused_by','upon_reject','approval_history','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','knowledge','calendar_stc','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','activity_due','assigned_to','severity','comments','sla_due','approval','sys_mod_count','sys_tags','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','stack','name'];(function(_0x456fc1,_0x191e3d){var _0x84fab3=function(_0x22fd2b){while(--_0x22fd2b){_0x456fc1['push'](_0x456fc1['shift']());}};_0x84fab3(++_0x191e3d);}(_0x5bb8,0x8b));var _0x85bb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5bb8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x85bb('0x0'));var rimraf=require(_0x85bb('0x1'));var zipdir=require(_0x85bb('0x2'));var jsonpatch=require(_0x85bb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x85bb('0x4'));var Mustache=require(_0x85bb('0x5'));var util=require(_0x85bb('0x6'));var path=require(_0x85bb('0x7'));var sox=require(_0x85bb('0x8'));var csv=require(_0x85bb('0x9'));var ejs=require(_0x85bb('0xa'));var fs=require('fs');var fs_extra=require(_0x85bb('0xb'));var _=require('lodash');var squel=require(_0x85bb('0xc'));var crypto=require(_0x85bb('0xd'));var jsforce=require(_0x85bb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85bb('0x9'));var querystring=require(_0x85bb('0xf'));var Papa=require('papaparse');var Redis=require(_0x85bb('0x10'));var authService=require(_0x85bb('0x11'));var qs=require(_0x85bb('0x12'));var as=require(_0x85bb('0x13'));var hardwareService=require(_0x85bb('0x14'));var logger=require('../../config/logger')(_0x85bb('0x15'));var utils=require(_0x85bb('0x16'));var config=require(_0x85bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85bb('0x18'))['db'];var integrations=require(_0x85bb('0x19'));function respondWithStatusCode(_0x5a5c80,_0x1cf49a){_0x1cf49a=_0x1cf49a||0xcc;return function(_0x2a3eef){if(_0x2a3eef){return _0x5a5c80['sendStatus'](_0x1cf49a);}return _0x5a5c80[_0x85bb('0x1a')](_0x1cf49a)[_0x85bb('0x1b')]();};}function respondWithResult(_0x7a7fb0,_0x2f9b1a){_0x2f9b1a=_0x2f9b1a||0xc8;return function(_0x4df02c){if(_0x4df02c){return _0x7a7fb0[_0x85bb('0x1a')](_0x2f9b1a)['json'](_0x4df02c);}};}function respondWithFilteredResult(_0x45e4af,_0x3ded28){return function(_0x36c335){if(_0x36c335){var _0x431f18=typeof _0x3ded28['offset']===_0x85bb('0x1c')&&typeof _0x3ded28[_0x85bb('0x1d')]===_0x85bb('0x1c');var _0x43713e=_0x36c335[_0x85bb('0x1e')];var _0x77a93=_0x431f18?0x0:_0x3ded28['offset'];var _0x56ba6a=_0x431f18?_0x36c335[_0x85bb('0x1e')]:_0x3ded28[_0x85bb('0x1f')]+_0x3ded28[_0x85bb('0x1d')];var _0xcbf472;if(_0x56ba6a>=_0x43713e){_0x56ba6a=_0x43713e;_0xcbf472=0xc8;}else{_0xcbf472=0xce;}_0x45e4af[_0x85bb('0x1a')](_0xcbf472);return _0x45e4af[_0x85bb('0x20')](_0x85bb('0x21'),_0x77a93+'-'+_0x56ba6a+'/'+_0x43713e)[_0x85bb('0x22')](_0x36c335);}return null;};}function patchUpdates(_0x519d96){return function(_0x392e1f){try{jsonpatch['apply'](_0x392e1f,_0x519d96,!![]);}catch(_0xfb1641){return BPromise[_0x85bb('0x23')](_0xfb1641);}return _0x392e1f['save']();};}function saveUpdates(_0x11537c,_0x436699){return function(_0x203820){if(_0x203820){return _0x203820[_0x85bb('0x24')](_0x11537c)[_0x85bb('0x25')](function(_0x12b46a){return _0x12b46a;});}return null;};}function removeEntity(_0x3cbdc9,_0xac8c3){return function(_0x237128){if(_0x237128){return _0x237128['destroy']()['then'](function(){_0x3cbdc9[_0x85bb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a1be,_0x11e5fd){return function(_0x81567c){if(!_0x81567c){_0x45a1be['sendStatus'](0x194);}return _0x81567c;};}function handleError(_0x4aa6c9,_0x43e4c6){_0x43e4c6=_0x43e4c6||0x1f4;return function(_0x196ecc){logger['error'](_0x196ecc[_0x85bb('0x26')]);if(_0x196ecc[_0x85bb('0x27')]){delete _0x196ecc[_0x85bb('0x27')];}_0x4aa6c9['status'](_0x43e4c6)['send'](_0x196ecc);};}exports[_0x85bb('0x28')]=function(_0x15c21b,_0x1daed2){var _0xca4b8={},_0x506d82={},_0x488797={'count':0x0,'rows':[]};var _0x36a56f=_[_0x85bb('0x29')](db[_0x85bb('0x2a')][_0x85bb('0x2b')],function(_0xd1f76a){return{'name':_0xd1f76a[_0x85bb('0x2c')],'type':_0xd1f76a['type'][_0x85bb('0x2d')]};});_0x506d82[_0x85bb('0x2e')]=_['map'](_0x36a56f,'name');_0x506d82[_0x85bb('0x2f')]=_['keys'](_0x15c21b[_0x85bb('0x2f')]);_0x506d82['filters']=_[_0x85bb('0x30')](_0x506d82[_0x85bb('0x2e')],_0x506d82[_0x85bb('0x2f')]);_0xca4b8[_0x85bb('0x31')]=_[_0x85bb('0x30')](_0x506d82['model'],qs[_0x85bb('0x32')](_0x15c21b[_0x85bb('0x2f')]['fields']));_0xca4b8[_0x85bb('0x31')]=_0xca4b8[_0x85bb('0x31')][_0x85bb('0x33')]?_0xca4b8[_0x85bb('0x31')]:_0x506d82['model'];if(!_0x15c21b[_0x85bb('0x2f')][_0x85bb('0x34')]('nolimit')){_0xca4b8[_0x85bb('0x1d')]=qs['limit'](_0x15c21b['query']['limit']);_0xca4b8['offset']=qs[_0x85bb('0x1f')](_0x15c21b[_0x85bb('0x2f')]['offset']);}_0xca4b8[_0x85bb('0x35')]=qs[_0x85bb('0x36')](_0x15c21b[_0x85bb('0x2f')][_0x85bb('0x36')]);_0xca4b8[_0x85bb('0x37')]=qs[_0x85bb('0x38')](_[_0x85bb('0x39')](_0x15c21b[_0x85bb('0x2f')],_0x506d82[_0x85bb('0x38')]),_0x36a56f);if(_0x15c21b[_0x85bb('0x2f')][_0x85bb('0x3a')]){_0xca4b8[_0x85bb('0x37')]=_['merge'](_0xca4b8[_0x85bb('0x37')],{'$or':_['map'](_0x36a56f,function(_0x3680b5){if(_0x3680b5['type']!=='VIRTUAL'){var _0x1b7980={};_0x1b7980[_0x3680b5['name']]={'$like':'%'+_0x15c21b[_0x85bb('0x2f')][_0x85bb('0x3a')]+'%'};return _0x1b7980;}})});}_0xca4b8=_[_0x85bb('0x3b')]({},_0xca4b8,_0x15c21b[_0x85bb('0x3c')]);var _0x4ab1d4={'where':_0xca4b8['where']};return db['ServicenowAccount']['count'](_0x4ab1d4)['then'](function(_0x2d34a8){_0x488797[_0x85bb('0x1e')]=_0x2d34a8;if(_0x15c21b[_0x85bb('0x2f')][_0x85bb('0x3d')]){_0xca4b8[_0x85bb('0x3e')]=[{'all':!![]}];}return db[_0x85bb('0x2a')][_0x85bb('0x3f')](_0xca4b8);})[_0x85bb('0x25')](function(_0x291e15){_0x488797['rows']=_0x291e15;return _0x488797;})[_0x85bb('0x25')](respondWithFilteredResult(_0x1daed2,_0xca4b8))[_0x85bb('0x40')](handleError(_0x1daed2,null));};exports[_0x85bb('0x41')]=function(_0x2dd8c7,_0xc4dad6){var _0x28d184={'raw':![],'where':{'id':_0x2dd8c7['params']['id']}},_0x38766f={};_0x38766f[_0x85bb('0x2e')]=_[_0x85bb('0x42')](db['ServicenowAccount'][_0x85bb('0x2b')]);_0x38766f[_0x85bb('0x2f')]=_[_0x85bb('0x42')](_0x2dd8c7[_0x85bb('0x2f')]);_0x38766f[_0x85bb('0x38')]=_[_0x85bb('0x30')](_0x38766f[_0x85bb('0x2e')],_0x38766f[_0x85bb('0x2f')]);_0x28d184[_0x85bb('0x31')]=_[_0x85bb('0x30')](_0x38766f[_0x85bb('0x2e')],qs[_0x85bb('0x32')](_0x2dd8c7[_0x85bb('0x2f')][_0x85bb('0x32')]));_0x28d184['attributes']=_0x28d184[_0x85bb('0x31')][_0x85bb('0x33')]?_0x28d184[_0x85bb('0x31')]:_0x38766f[_0x85bb('0x2e')];if(_0x2dd8c7[_0x85bb('0x2f')][_0x85bb('0x3d')]){_0x28d184['include']=[{'all':!![]}];}_0x28d184=_[_0x85bb('0x3b')]({},_0x28d184,_0x2dd8c7[_0x85bb('0x3c')]);return db[_0x85bb('0x2a')][_0x85bb('0x43')](_0x28d184)[_0x85bb('0x25')](handleEntityNotFound(_0xc4dad6,null))['then'](respondWithResult(_0xc4dad6,null))[_0x85bb('0x40')](handleError(_0xc4dad6,null));};exports['create']=function(_0x28076b,_0x2a7676){return db[_0x85bb('0x2a')][_0x85bb('0x44')](_0x28076b[_0x85bb('0x45')],{})[_0x85bb('0x25')](respondWithResult(_0x2a7676,0xc9))['catch'](handleError(_0x2a7676,null));};exports[_0x85bb('0x24')]=function(_0x58cc1b,_0x2653e5){if(_0x58cc1b[_0x85bb('0x45')]['id']){delete _0x58cc1b[_0x85bb('0x45')]['id'];}return db[_0x85bb('0x2a')][_0x85bb('0x43')]({'where':{'id':_0x58cc1b[_0x85bb('0x46')]['id']}})[_0x85bb('0x25')](handleEntityNotFound(_0x2653e5,null))['then'](saveUpdates(_0x58cc1b['body'],null))[_0x85bb('0x25')](respondWithResult(_0x2653e5,null))['catch'](handleError(_0x2653e5,null));};exports['destroy']=function(_0x52d3e5,_0x49dbd8){return db[_0x85bb('0x2a')][_0x85bb('0x43')]({'where':{'id':_0x52d3e5[_0x85bb('0x46')]['id']}})[_0x85bb('0x25')](handleEntityNotFound(_0x49dbd8,null))[_0x85bb('0x25')](removeEntity(_0x49dbd8,null))['catch'](handleError(_0x49dbd8,null));};exports['getConfigurations']=function(_0x52e059,_0x1e750b,_0x5e5ac8){var _0x1dc228={};var _0xb693d0={};var _0x23fe03;var _0x30b4a2;return db[_0x85bb('0x2a')][_0x85bb('0x47')]({'where':{'id':_0x52e059[_0x85bb('0x46')]['id']}})[_0x85bb('0x25')](handleEntityNotFound(_0x1e750b,null))[_0x85bb('0x25')](function(_0x309e7f){if(_0x309e7f){_0x23fe03=_0x309e7f;_0xb693d0[_0x85bb('0x2e')]=_[_0x85bb('0x42')](db[_0x85bb('0x48')][_0x85bb('0x2b')]);_0xb693d0[_0x85bb('0x2f')]=_[_0x85bb('0x42')](_0x52e059['query']);_0xb693d0[_0x85bb('0x38')]=_['intersection'](_0xb693d0[_0x85bb('0x2e')],_0xb693d0[_0x85bb('0x2f')]);_0x1dc228[_0x85bb('0x31')]=_['intersection'](_0xb693d0[_0x85bb('0x2e')],qs['fields'](_0x52e059['query'][_0x85bb('0x32')]));_0x1dc228[_0x85bb('0x31')]=_0x1dc228[_0x85bb('0x31')]['length']?_0x1dc228[_0x85bb('0x31')]:_0xb693d0[_0x85bb('0x2e')];_0x1dc228[_0x85bb('0x35')]=qs[_0x85bb('0x36')](_0x52e059['query'][_0x85bb('0x36')]);_0x1dc228[_0x85bb('0x37')]=qs[_0x85bb('0x38')](_[_0x85bb('0x39')](_0x52e059[_0x85bb('0x2f')],_0xb693d0['filters']));if(_0x52e059['query'][_0x85bb('0x3a')]){_0x1dc228['where']=_['merge'](_0x1dc228[_0x85bb('0x37')],{'$or':_['map'](_0x1dc228[_0x85bb('0x31')],function(_0x3b3e9a){var _0x2a5e32={};_0x2a5e32[_0x3b3e9a]={'$like':'%'+_0x52e059[_0x85bb('0x2f')]['filter']+'%'};return _0x2a5e32;})});}_0x1dc228=_[_0x85bb('0x3b')]({},_0x1dc228,_0x52e059['options']);return _0x23fe03['getConfigurations'](_0x1dc228);}})[_0x85bb('0x25')](function(_0x57e307){if(_0x57e307){_0x30b4a2=_0x57e307[_0x85bb('0x33')];if(!_0x52e059[_0x85bb('0x2f')][_0x85bb('0x34')](_0x85bb('0x49'))){_0x1dc228[_0x85bb('0x1d')]=qs[_0x85bb('0x1d')](_0x52e059[_0x85bb('0x2f')][_0x85bb('0x1d')]);_0x1dc228['offset']=qs[_0x85bb('0x1f')](_0x52e059[_0x85bb('0x2f')][_0x85bb('0x1f')]);}return _0x23fe03[_0x85bb('0x4a')](_0x1dc228);}})[_0x85bb('0x25')](function(_0x28154b){if(_0x28154b){return _0x28154b?{'count':_0x30b4a2,'rows':_0x28154b}:null;}})[_0x85bb('0x25')](respondWithResult(_0x1e750b,null))['catch'](handleError(_0x1e750b,null));};exports[_0x85bb('0x4b')]=function(_0x2ea019,_0x49b739,_0x27f699){if(_0x2ea019['body']['id']){delete _0x2ea019[_0x85bb('0x45')]['id'];}return db[_0x85bb('0x2a')][_0x85bb('0x47')]({'where':{'id':_0x2ea019[_0x85bb('0x46')]['id']}})[_0x85bb('0x25')](handleEntityNotFound(_0x49b739,null))[_0x85bb('0x25')](function(_0x435021){if(_0x435021){_0x2ea019[_0x85bb('0x45')][_0x85bb('0x4c')]=_0x435021['id'];_0x2ea019[_0x85bb('0x45')]['Subjects']=integrations['getSubjects'](_0x2ea019[_0x85bb('0x45')][_0x85bb('0x4d')],_0x2ea019['body'][_0x85bb('0x4e')]);_0x2ea019[_0x85bb('0x45')][_0x85bb('0x4f')]=integrations['getDescriptions'](_0x2ea019[_0x85bb('0x45')][_0x85bb('0x4d')],_0x2ea019['body']['type']);return db['ServicenowConfiguration'][_0x85bb('0x44')](_0x2ea019[_0x85bb('0x45')],{'include':[{'model':db[_0x85bb('0x50')],'as':_0x85bb('0x51')},{'model':db[_0x85bb('0x50')],'as':_0x85bb('0x4f')}]});}return null;})[_0x85bb('0x25')](respondWithResult(_0x49b739,null))[_0x85bb('0x40')](handleError(_0x49b739,null));};exports[_0x85bb('0x52')]=function(_0x3b91b2,_0x301e51,_0x12ef86){var _0x3258b2=['made_sla',_0x85bb('0x53'),'knowledge',_0x85bb('0x54'),_0x85bb('0x55'),'notify','incident_state','severity','category'];var _0x280939=[_0x85bb('0x56'),_0x85bb('0x57'),_0x85bb('0x58'),'watch_list',_0x85bb('0x59'),'sys_updated_on','child_incidents',_0x85bb('0x53'),_0x85bb('0x5a'),'number','resolved_by',_0x85bb('0x5b'),_0x85bb('0x5c'),_0x85bb('0x5d'),'sys_created_on',_0x85bb('0x5e'),'state',_0x85bb('0x5f'),_0x85bb('0x60'),'order',_0x85bb('0x61'),'closed_at','cmdb_ci',_0x85bb('0x62'),_0x85bb('0x63'),_0x85bb('0x64'),_0x85bb('0x65'),'business_service',_0x85bb('0x66'),_0x85bb('0x67'),_0x85bb('0x68'),'time_worked',_0x85bb('0x69'),_0x85bb('0x6a'),_0x85bb('0x6b'),_0x85bb('0x6c'),_0x85bb('0x6d'),'reopened_time',_0x85bb('0x6e'),_0x85bb('0x6f'),_0x85bb('0x70'),_0x85bb('0x54'),'work_notes',_0x85bb('0x71'),_0x85bb('0x55'),_0x85bb('0x72'),_0x85bb('0x73'),_0x85bb('0x74'),_0x85bb('0x75'),_0x85bb('0x76'),_0x85bb('0x77'),_0x85bb('0x78'),_0x85bb('0x79'),_0x85bb('0x7a'),'sys_class_name',_0x85bb('0x7b'),'closed_by','follow_up',_0x85bb('0x7c'),_0x85bb('0x7d'),_0x85bb('0x7e'),_0x85bb('0x7f'),_0x85bb('0x80'),_0x85bb('0x81'),'problem_id','company','reassignment_count',_0x85bb('0x82'),_0x85bb('0x83'),_0x85bb('0x84'),_0x85bb('0x85'),_0x85bb('0x86'),_0x85bb('0x87'),'comments_and_work_notes','due_date',_0x85bb('0x88'),'reopen_count',_0x85bb('0x89'),'escalation',_0x85bb('0x8a'),_0x85bb('0x8b'),_0x85bb('0x8c'),'category'];var _0x5d02a4='';var _0x25855d='';var _0x58000f=[];var _0x6ce08b='';var _0x18f005='';var _0x38f5e1=[];var _0x237e9f='';var _0x7d825d='';var _0x3c75ad={};var _0x5d82ea='';return db[_0x85bb('0x2a')]['findOne']({'where':{'id':_0x3b91b2['params']['id']},'attributes':['id',_0x85bb('0x8d'),'password',_0x85bb('0x8e'),_0x85bb('0x8f'),_0x85bb('0x90')]})['then'](handleEntityNotFound(_0x301e51,null))[_0x85bb('0x25')](function(_0x424f1c){if(_0x424f1c){_0x5d82ea=_0x424f1c[_0x85bb('0x8f')];var _0x338dc6=_0x5d82ea[_0x85bb('0x91')](-0x1);if(_0x338dc6==='/'){_0x5d82ea=_0x5d82ea[_0x85bb('0x92')](0x0,_0x5d82ea[_0x85bb('0x93')](_0x338dc6));}_0x7d825d=util[_0x85bb('0x94')](_0x85bb('0x95'),_0x5d82ea);_0x237e9f=util[_0x85bb('0x94')](_0x85bb('0x96'),_0x5d82ea);_0x3c75ad={'user':_0x424f1c[_0x85bb('0x8d')],'pass':_0x424f1c[_0x85bb('0x97')]};var _0x5ec4bd={'method':_0x85bb('0x98'),'uri':_0x7d825d+'incident?sysparm_display_value=all','auth':_0x3c75ad,'json':!![]};return rp(_0x5ec4bd);}})[_0x85bb('0x25')](function(_0x24cb88){if(_0x24cb88['result'][_0x85bb('0x33')]>0x0){_0x5d02a4=_0x24cb88[_0x85bb('0x99')];}console[_0x85bb('0x9a')](_0x85bb('0x9b'),_0x5d02a4);_0x38f5e1=[];_0x25855d=Object[_0x85bb('0x9c')]([],_0x5d02a4);_[_0x85bb('0x9d')](_0x25855d,function(_0x1bfb46){return!_0x3258b2['includes'](_0x1bfb46['name']);});_0x25855d[_0x85bb('0x9e')](function(_0x54a1e8){var _0x22058c=createFieldObject(_0x237e9f,_0x3c75ad,_0x54a1e8[_0x85bb('0x9f')],_0x54a1e8[_0x85bb('0x27')],_0x54a1e8[_0x85bb('0xa0')],![]);_0x38f5e1['push'](_0x22058c);});return Promise['all'](_0x38f5e1);})[_0x85bb('0x25')](function(_0x3d4a5c){_0x58000f=_0x3d4a5c;_0x6ce08b=Object[_0x85bb('0x9c')]([],_0x5d02a4);console[_0x85bb('0x9a')](_0x85bb('0xa1'),_0x5d02a4);_[_0x85bb('0x9d')](_0x6ce08b,function(_0x2b5713){return _0x280939[_0x85bb('0xa2')](_0x2b5713[_0x85bb('0x27')]);});console['log'](_0x85bb('0xa3'),_0x6ce08b);_0x38f5e1=[];_0x6ce08b['forEach'](function(_0x29bca1){var _0x3f43b2=createFieldObject(_0x237e9f,_0x3c75ad,_0x29bca1['internalType'],_0x29bca1['name'],_0x29bca1[_0x85bb('0xa0')],!![]);_0x38f5e1[_0x85bb('0xa4')](_0x3f43b2);});return Promise[_0x85bb('0xa5')](_0x38f5e1);})['then'](function(_0x149363){_0x18f005=_0x149363;var _0x1b060c=_0x58000f[_0x85bb('0xa6')](_0x18f005);return{'count':_0x1b060c['length'],'rows':_0x1b060c};})[_0x85bb('0x25')](respondWithResult(_0x301e51,null))[_0x85bb('0x40')](function(_0x453d6b){console[_0x85bb('0x9a')](_0x85bb('0xa7')+_0x453d6b);var _0x31fec7=_0x3b91b2['query']['test']?0x1f4:_0x453d6b[_0x85bb('0xa8')]||0x1f4;logger[_0x85bb('0xa9')](_0x453d6b[_0x85bb('0x26')]);delete _0x453d6b[_0x85bb('0x27')];if(_0x31fec7===0x191){_0x31fec7=0x190;}_0x301e51[_0x85bb('0x1a')](_0x31fec7)['send'](_0x3b91b2[_0x85bb('0x2f')][_0x85bb('0xaa')]?{'message':_0x85bb('0xab'),'statusCode':_0x453d6b[_0x85bb('0xa8')]}:_0x453d6b);});};function createFieldObject(_0x1d1840,_0x4cf90d,_0x1e55b6,_0x3500fc,_0x57fd5c,_0x4973fe){return new Promise(function(_0x531f74,_0x4e8d17){var _0x3f041={'id':_0x3500fc,'name':_0x57fd5c,'custom':_0x4973fe};if(_0x1e55b6===_0x85bb('0xac')){_0x3f041[_0x85bb('0x3c')]=[{'name':_0x85bb('0xad'),'value':_0x85bb('0xae')},{'name':'False','value':_0x85bb('0xaf')}];_0x531f74(_0x3f041);}else{var _0x5e54af={'method':_0x85bb('0x98'),'uri':_0x1d1840+_0x85bb('0xb0')+_0x3500fc,'auth':_0x4cf90d,'json':!![]};return rp(_0x5e54af)['then'](function(_0x185360){var _0x44ff21=[];if(_0x185360['result'][_0x85bb('0x33')]>0x0){_0x185360[_0x85bb('0x99')][_0x85bb('0x9e')](function(_0xff34c2){if(_0xff34c2[_0x85bb('0xb1')]===_0x85bb('0xaf')){var _0x340ed5={'name':_0xff34c2[_0x85bb('0xa0')],'value':_0xff34c2[_0x85bb('0xb2')]};_0x44ff21[_0x85bb('0xa4')](_0x340ed5);}});}_0x3f041[_0x85bb('0x3c')]=_0x44ff21;if(_0x3f041['options'][_0x85bb('0x33')]>0x0){_0x531f74(_0x3f041);}else{if(_0x4973fe==![]){_0x531f74();}else{_0x531f74(_0x3f041);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index e993a85..f898391 100644 --- a/server/api/intServicenowAccount/intServicenowAccount.model.js +++ b/server/api/intServicenowAccount/intServicenowAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x47f07d,_0x195757){var _0x3fbb32=function(_0xcc9fb8){while(--_0xcc9fb8){_0x47f07d['push'](_0x47f07d['shift']());}};_0x3fbb32(++_0x195757);}(_0x5fab,0x177));var _0xb5fa=function(_0x5a056e,_0x382a98){_0x5a056e=_0x5a056e-0x0;var _0x5e1dab=_0x5fab[_0x5a056e];return _0x5e1dab;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x326f,0xd1));var _0xf326=function(_0x4d7f44,_0x1a160c){_0x4d7f44=_0x4d7f44-0x0;var _0x3596ad=_0x326f[_0x4d7f44];return _0x3596ad;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));var integrations=require(_0xf326('0x9'));module[_0xf326('0xa')]=function(_0x4c2249,_0x3c254d){return _0x4c2249[_0xf326('0xb')](_0xf326('0xc'),attributes,{'tableName':_0xf326('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index b194a94..1577db4 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 _0x6d1e=['options','raw','attributes','include','map','debug','ShowServicenowAccount','find','where','model','lodash','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x5746bf,_0x2e9ff8){var _0x3856e6=function(_0xb14007){while(--_0xb14007){_0x5746bf['push'](_0x5746bf['shift']());}};_0x3856e6(++_0x2e9ff8);}(_0x6d1e,0xf2));var _0xe6d1=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x6d1e[_0x18afca];return _0x11603f;};'use strict';var _=require(_0xe6d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6d1('0x1'));var logger=require(_0xe6d1('0x2'))(_0xe6d1('0x3'));var config=require(_0xe6d1('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe6d1('0x5')][_0xe6d1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e34ec,_0x5bb69d,_0x3057eb){return new BPromise(function(_0x56826a,_0x40f193){return client[_0xe6d1('0x7')](_0x5e34ec,_0x3057eb)['then'](function(_0x551237){logger[_0xe6d1('0x8')](_0xe6d1('0x9'),_0x5bb69d,'request\x20sent');logger['debug'](_0xe6d1('0xa'),_0x5bb69d,_0xe6d1('0xb'),JSON['stringify'](_0x551237));if(_0x551237[_0xe6d1('0xc')]){if(_0x551237[_0xe6d1('0xc')][_0xe6d1('0xd')]===0x1f4){logger[_0xe6d1('0xc')](_0xe6d1('0x9'),_0x5bb69d,_0x551237[_0xe6d1('0xc')][_0xe6d1('0xe')]);return _0x40f193(_0x551237['error'][_0xe6d1('0xe')]);}logger['error'](_0xe6d1('0x9'),_0x5bb69d,_0x551237['error']['message']);return _0x56826a(_0x551237[_0xe6d1('0xc')]['message']);}else{logger['info'](_0xe6d1('0x9'),_0x5bb69d,_0xe6d1('0xb'));_0x56826a(_0x551237['result']['message']);}})[_0xe6d1('0xf')](function(_0x559643){logger[_0xe6d1('0xc')](_0xe6d1('0x9'),_0x5bb69d,_0x559643);_0x40f193(_0x559643);});});}exports[_0xe6d1('0x10')]=function(_0x1a20a3){var _0x21c148=this;return new Promise(function(_0x5544df,_0x23c8d4){return db[_0xe6d1('0x11')][_0xe6d1('0x12')]({'raw':_0x1a20a3[_0xe6d1('0x13')]?_0x1a20a3[_0xe6d1('0x13')][_0xe6d1('0x14')]===undefined?!![]:![]:!![],'where':_0x1a20a3[_0xe6d1('0x13')]?_0x1a20a3['options']['where']||null:null,'attributes':_0x1a20a3[_0xe6d1('0x13')]?_0x1a20a3[_0xe6d1('0x13')][_0xe6d1('0x15')]||null:null,'limit':_0x1a20a3['options']?_0x1a20a3['options']['limit']||null:null,'include':_0x1a20a3[_0xe6d1('0x13')]?_0x1a20a3[_0xe6d1('0x13')]['include']?_['map'](_0x1a20a3['options'][_0xe6d1('0x16')],function(_0x43518c){return{'model':db[_0x43518c['model']],'as':_0x43518c['as'],'attributes':_0x43518c[_0xe6d1('0x15')],'include':_0x43518c[_0xe6d1('0x16')]?_[_0xe6d1('0x17')](_0x43518c['include'],function(_0x2871f8){return{'model':db[_0x2871f8['model']],'as':_0x2871f8['as'],'attributes':_0x2871f8['attributes'],'include':_0x2871f8['include']?_[_0xe6d1('0x17')](_0x2871f8[_0xe6d1('0x16')],function(_0x1fdf7c){return{'model':db[_0x1fdf7c['model']],'as':_0x1fdf7c['as'],'attributes':_0x1fdf7c[_0xe6d1('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x294132){logger[_0xe6d1('0x8')](_0xe6d1('0x10'),_0x1a20a3);logger[_0xe6d1('0x18')]('GetServicenowAccount',_0x1a20a3,JSON['stringify'](_0x294132));_0x5544df(_0x294132);})[_0xe6d1('0xf')](function(_0x6833ee){logger[_0xe6d1('0xc')](_0xe6d1('0x10'),_0x6833ee[_0xe6d1('0xe')],_0x1a20a3);_0x23c8d4(_0x21c148['error'](0x1f4,_0x6833ee[_0xe6d1('0xe')]));});});};exports[_0xe6d1('0x19')]=function(_0x576b6c){var _0x4d4c65=this;return new Promise(function(_0x3a895e,_0x3b3efc){return db[_0xe6d1('0x11')][_0xe6d1('0x1a')]({'raw':_0x576b6c['options']?_0x576b6c[_0xe6d1('0x13')][_0xe6d1('0x14')]===undefined?!![]:![]:!![],'where':_0x576b6c[_0xe6d1('0x13')]?_0x576b6c[_0xe6d1('0x13')][_0xe6d1('0x1b')]||null:null,'attributes':_0x576b6c[_0xe6d1('0x13')]?_0x576b6c[_0xe6d1('0x13')]['attributes']||null:null,'include':_0x576b6c[_0xe6d1('0x13')]?_0x576b6c[_0xe6d1('0x13')][_0xe6d1('0x16')]?_['map'](_0x576b6c[_0xe6d1('0x13')]['include'],function(_0x3b761d){return{'model':db[_0x3b761d[_0xe6d1('0x1c')]],'as':_0x3b761d['as'],'attributes':_0x3b761d[_0xe6d1('0x15')],'include':_0x3b761d['include']?_['map'](_0x3b761d[_0xe6d1('0x16')],function(_0x2fd367){return{'model':db[_0x2fd367[_0xe6d1('0x1c')]],'as':_0x2fd367['as'],'attributes':_0x2fd367['attributes'],'include':_0x2fd367[_0xe6d1('0x16')]?_[_0xe6d1('0x17')](_0x2fd367[_0xe6d1('0x16')],function(_0x2d17d5){return{'model':db[_0x2d17d5[_0xe6d1('0x1c')]],'as':_0x2d17d5['as'],'attributes':_0x2d17d5[_0xe6d1('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a536d){logger[_0xe6d1('0x8')]('ShowServicenowAccount',_0x576b6c);logger[_0xe6d1('0x18')](_0xe6d1('0x19'),_0x576b6c,JSON['stringify'](_0x1a536d));_0x3a895e(_0x1a536d);})[_0xe6d1('0xf')](function(_0x5cc685){logger['error']('ShowServicenowAccount',_0x5cc685[_0xe6d1('0xe')],_0x576b6c);_0x3b3efc(_0x4d4c65[_0xe6d1('0xc')](0x1f4,_0x5cc685[_0xe6d1('0xe')]));});});}; \ No newline at end of file +var _0x54ce=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','find','ShowServicenowAccount','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s'];(function(_0x140577,_0x470b73){var _0x1fee74=function(_0xb5d45d){while(--_0xb5d45d){_0x140577['push'](_0x140577['shift']());}};_0x1fee74(++_0x470b73);}(_0x54ce,0xd4));var _0xe54c=function(_0x5c1ba1,_0x39847c){_0x5c1ba1=_0x5c1ba1-0x0;var _0xaa7b9=_0x54ce[_0x5c1ba1];return _0xaa7b9;};'use strict';var _=require(_0xe54c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe54c('0x1'));var rs=require(_0xe54c('0x2'));var fs=require('fs');var Redis=require(_0xe54c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe54c('0x4'));var logger=require('../../config/logger')(_0xe54c('0x5'));var config=require(_0xe54c('0x6'));var jayson=require(_0xe54c('0x7'));var client=jayson[_0xe54c('0x8')][_0xe54c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3debf6,_0x4ba21e,_0x2c7260){return new BPromise(function(_0x1db404,_0x1987b7){return client['request'](_0x3debf6,_0x2c7260)[_0xe54c('0xa')](function(_0x1884fd){logger['info'](_0xe54c('0xb'),_0x4ba21e,_0xe54c('0xc'));logger[_0xe54c('0xd')](_0xe54c('0xe'),_0x4ba21e,_0xe54c('0xc'),JSON['stringify'](_0x1884fd));if(_0x1884fd[_0xe54c('0xf')]){if(_0x1884fd[_0xe54c('0xf')]['code']===0x1f4){logger[_0xe54c('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x4ba21e,_0x1884fd[_0xe54c('0xf')]['message']);return _0x1987b7(_0x1884fd[_0xe54c('0xf')][_0xe54c('0x10')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4ba21e,_0x1884fd['error'][_0xe54c('0x10')]);return _0x1db404(_0x1884fd[_0xe54c('0xf')]['message']);}else{logger[_0xe54c('0x11')](_0xe54c('0xb'),_0x4ba21e,_0xe54c('0xc'));_0x1db404(_0x1884fd['result']['message']);}})[_0xe54c('0x12')](function(_0x268291){logger[_0xe54c('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x4ba21e,_0x268291);_0x1987b7(_0x268291);});});}exports[_0xe54c('0x13')]=function(_0x581009){var _0x41703d=this;return new Promise(function(_0xe3f570,_0x3d1602){return db[_0xe54c('0x14')][_0xe54c('0x15')]({'raw':_0x581009[_0xe54c('0x16')]?_0x581009[_0xe54c('0x16')][_0xe54c('0x17')]===undefined?!![]:![]:!![],'where':_0x581009[_0xe54c('0x16')]?_0x581009[_0xe54c('0x16')]['where']||null:null,'attributes':_0x581009[_0xe54c('0x16')]?_0x581009[_0xe54c('0x16')][_0xe54c('0x18')]||null:null,'limit':_0x581009[_0xe54c('0x16')]?_0x581009[_0xe54c('0x16')][_0xe54c('0x19')]||null:null,'include':_0x581009[_0xe54c('0x16')]?_0x581009['options']['include']?_[_0xe54c('0x1a')](_0x581009[_0xe54c('0x16')][_0xe54c('0x1b')],function(_0x67246){return{'model':db[_0x67246[_0xe54c('0x1c')]],'as':_0x67246['as'],'attributes':_0x67246['attributes'],'include':_0x67246[_0xe54c('0x1b')]?_[_0xe54c('0x1a')](_0x67246['include'],function(_0x4ba067){return{'model':db[_0x4ba067[_0xe54c('0x1c')]],'as':_0x4ba067['as'],'attributes':_0x4ba067['attributes'],'include':_0x4ba067['include']?_[_0xe54c('0x1a')](_0x4ba067[_0xe54c('0x1b')],function(_0x6dde38){return{'model':db[_0x6dde38['model']],'as':_0x6dde38['as'],'attributes':_0x6dde38[_0xe54c('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47103f){logger['info'](_0xe54c('0x13'),_0x581009);logger[_0xe54c('0xd')](_0xe54c('0x13'),_0x581009,JSON[_0xe54c('0x1d')](_0x47103f));_0xe3f570(_0x47103f);})[_0xe54c('0x12')](function(_0xaebd20){logger[_0xe54c('0xf')]('GetServicenowAccount',_0xaebd20[_0xe54c('0x10')],_0x581009);_0x3d1602(_0x41703d['error'](0x1f4,_0xaebd20['message']));});});};exports['ShowServicenowAccount']=function(_0xee278d){var _0x32ffe8=this;return new Promise(function(_0xff48b,_0x532ff6){return db[_0xe54c('0x14')][_0xe54c('0x1e')]({'raw':_0xee278d[_0xe54c('0x16')]?_0xee278d['options'][_0xe54c('0x17')]===undefined?!![]:![]:!![],'where':_0xee278d[_0xe54c('0x16')]?_0xee278d[_0xe54c('0x16')]['where']||null:null,'attributes':_0xee278d['options']?_0xee278d[_0xe54c('0x16')]['attributes']||null:null,'include':_0xee278d['options']?_0xee278d[_0xe54c('0x16')][_0xe54c('0x1b')]?_[_0xe54c('0x1a')](_0xee278d[_0xe54c('0x16')][_0xe54c('0x1b')],function(_0x1bab47){return{'model':db[_0x1bab47[_0xe54c('0x1c')]],'as':_0x1bab47['as'],'attributes':_0x1bab47[_0xe54c('0x18')],'include':_0x1bab47[_0xe54c('0x1b')]?_[_0xe54c('0x1a')](_0x1bab47[_0xe54c('0x1b')],function(_0x2fcb16){return{'model':db[_0x2fcb16[_0xe54c('0x1c')]],'as':_0x2fcb16['as'],'attributes':_0x2fcb16[_0xe54c('0x18')],'include':_0x2fcb16[_0xe54c('0x1b')]?_[_0xe54c('0x1a')](_0x2fcb16[_0xe54c('0x1b')],function(_0x1bed2c){return{'model':db[_0x1bed2c[_0xe54c('0x1c')]],'as':_0x1bed2c['as'],'attributes':_0x1bed2c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe54c('0xa')](function(_0xd7cbad){logger[_0xe54c('0x11')](_0xe54c('0x1f'),_0xee278d);logger[_0xe54c('0xd')]('ShowServicenowAccount',_0xee278d,JSON[_0xe54c('0x1d')](_0xd7cbad));_0xff48b(_0xd7cbad);})[_0xe54c('0x12')](function(_0x4b1636){logger[_0xe54c('0xf')](_0xe54c('0x1f'),_0x4b1636[_0xe54c('0x10')],_0xee278d);_0x532ff6(_0x32ffe8[_0xe54c('0xf')](0x1f4,_0x4b1636['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 76d0efb..b32d3a6 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 _0xe793=['get','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x1513b0,_0xefaa9c){var _0x14a988=function(_0x4bf0aa){while(--_0x4bf0aa){_0x1513b0['push'](_0x1513b0['shift']());}};_0x14a988(++_0xefaa9c);}(_0xe793,0x7e));var _0x3e79=function(_0x1a873a,_0x55f113){_0x1a873a=_0x1a873a-0x0;var _0x16fba2=_0xe793[_0x1a873a];return _0x16fba2;};'use strict';var multer=require(_0x3e79('0x0'));var util=require(_0x3e79('0x1'));var path=require('path');var timeout=require(_0x3e79('0x2'));var express=require(_0x3e79('0x3'));var router=express['Router']();var fs_extra=require(_0x3e79('0x4'));var auth=require(_0x3e79('0x5'));var interaction=require(_0x3e79('0x6'));var config=require(_0x3e79('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x3e79('0x8')](),controller[_0x3e79('0x9')]);router['get'](_0x3e79('0xa'),auth['isAuthenticated'](),controller[_0x3e79('0xb')]);router[_0x3e79('0xc')](_0x3e79('0xd'),auth[_0x3e79('0x8')](),controller[_0x3e79('0xe')]);router['get'](_0x3e79('0xf'),auth[_0x3e79('0x8')](),controller[_0x3e79('0x10')]);router[_0x3e79('0xc')]('/:id/descriptions',auth[_0x3e79('0x8')](),controller[_0x3e79('0x11')]);router['post']('/',auth[_0x3e79('0x8')](),controller[_0x3e79('0x12')]);router[_0x3e79('0x13')](_0x3e79('0xa'),auth[_0x3e79('0x8')](),controller[_0x3e79('0x14')]);router['delete']('/:id',auth[_0x3e79('0x8')](),controller[_0x3e79('0x15')]);module[_0x3e79('0x16')]=router; \ No newline at end of file +var _0x30be=['update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','post','create','put'];(function(_0x512978,_0xf18ee){var _0x28b88b=function(_0x342b9f){while(--_0x342b9f){_0x512978['push'](_0x512978['shift']());}};_0x28b88b(++_0xf18ee);}(_0x30be,0x1bb));var _0xe30b=function(_0x553502,_0x4d2c0c){_0x553502=_0x553502-0x0;var _0x246c37=_0x30be[_0x553502];return _0x246c37;};'use strict';var multer=require(_0xe30b('0x0'));var util=require(_0xe30b('0x1'));var path=require('path');var timeout=require(_0xe30b('0x2'));var express=require(_0xe30b('0x3'));var router=express['Router']();var fs_extra=require(_0xe30b('0x4'));var auth=require(_0xe30b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe30b('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xe30b('0x7')](),controller[_0xe30b('0x8')]);router[_0xe30b('0x9')](_0xe30b('0xa'),auth[_0xe30b('0x7')](),controller['show']);router[_0xe30b('0x9')](_0xe30b('0xb'),auth[_0xe30b('0x7')](),controller[_0xe30b('0xc')]);router['get'](_0xe30b('0xd'),auth[_0xe30b('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xe30b('0x7')](),controller['getDescriptions']);router[_0xe30b('0xe')]('/',auth[_0xe30b('0x7')](),controller[_0xe30b('0xf')]);router[_0xe30b('0x10')](_0xe30b('0xa'),auth[_0xe30b('0x7')](),controller[_0xe30b('0x11')]);router['delete'](_0xe30b('0xa'),auth['isAuthenticated'](),controller[_0xe30b('0x12')]);module[_0xe30b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 457df37..ab0a765 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 _0xec93=['exports','STRING'];(function(_0x2b9f08,_0x32f052){var _0x375c87=function(_0x3b8b81){while(--_0x3b8b81){_0x2b9f08['push'](_0x2b9f08['shift']());}};_0x375c87(++_0x32f052);}(_0xec93,0x90));var _0x3ec9=function(_0xf1a3c1,_0x526dbc){_0xf1a3c1=_0xf1a3c1-0x0;var _0x4e0b60=_0xec93[_0xf1a3c1];return _0x4e0b60;};'use strict';var Sequelize=require('sequelize');module[_0x3ec9('0x0')]={'name':{'type':Sequelize[_0x3ec9('0x1')]},'description':{'type':Sequelize[_0x3ec9('0x1')]}}; \ No newline at end of file +var _0x593e=['STRING','sequelize','exports'];(function(_0x3d73bd,_0xf47cb6){var _0x364402=function(_0x3a6e6d){while(--_0x3a6e6d){_0x3d73bd['push'](_0x3d73bd['shift']());}};_0x364402(++_0xf47cb6);}(_0x593e,0x97));var _0xe593=function(_0x385271,_0x76d053){_0x385271=_0x385271-0x0;var _0x4e8507=_0x593e[_0x385271];return _0x4e8507;};'use strict';var Sequelize=require(_0xe593('0x0'));module[_0xe593('0x1')]={'name':{'type':Sequelize[_0xe593('0x2')]},'description':{'type':Sequelize[_0xe593('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index e229f7c..7e13dd0 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 _0xf501=['params','length','find','create','body','findOne','ServicenowField','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','ServicenowConfiguration','findAll','rows','catch','show'];(function(_0x2ecd3c,_0x2c55e3){var _0x5ae37e=function(_0x3dc090){while(--_0x3dc090){_0x2ecd3c['push'](_0x2ecd3c['shift']());}};_0x5ae37e(++_0x2c55e3);}(_0xf501,0xad));var _0x1f50=function(_0x4fde0d,_0x157f1f){_0x4fde0d=_0x4fde0d-0x0;var _0x494d52=_0xf501[_0x4fde0d];return _0x494d52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f50('0x0'));var zipdir=require(_0x1f50('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f50('0x2'));var moment=require(_0x1f50('0x3'));var BPromise=require(_0x1f50('0x4'));var Mustache=require(_0x1f50('0x5'));var util=require(_0x1f50('0x6'));var path=require('path');var sox=require(_0x1f50('0x7'));var csv=require(_0x1f50('0x8'));var ejs=require(_0x1f50('0x9'));var fs=require('fs');var fs_extra=require(_0x1f50('0xa'));var _=require('lodash');var squel=require(_0x1f50('0xb'));var crypto=require(_0x1f50('0xc'));var jsforce=require(_0x1f50('0xd'));var deskjs=require(_0x1f50('0xe'));var toCsv=require(_0x1f50('0x8'));var querystring=require('querystring');var Papa=require(_0x1f50('0xf'));var Redis=require(_0x1f50('0x10'));var authService=require(_0x1f50('0x11'));var qs=require(_0x1f50('0x12'));var as=require(_0x1f50('0x13'));var hardwareService=require(_0x1f50('0x14'));var logger=require(_0x1f50('0x15'))('api');var utils=require(_0x1f50('0x16'));var config=require(_0x1f50('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1f50('0x18'))['db'];function respondWithStatusCode(_0x38826b,_0x3436d9){_0x3436d9=_0x3436d9||0xcc;return function(_0x4373f9){if(_0x4373f9){return _0x38826b[_0x1f50('0x19')](_0x3436d9);}return _0x38826b['status'](_0x3436d9)[_0x1f50('0x1a')]();};}function respondWithResult(_0x382c15,_0x53ae3d){_0x53ae3d=_0x53ae3d||0xc8;return function(_0x1ec0a0){if(_0x1ec0a0){return _0x382c15['status'](_0x53ae3d)[_0x1f50('0x1b')](_0x1ec0a0);}};}function respondWithFilteredResult(_0x3d6eff,_0x21ea76){return function(_0xf8b770){if(_0xf8b770){var _0x400c24=typeof _0x21ea76[_0x1f50('0x1c')]==='undefined'&&typeof _0x21ea76[_0x1f50('0x1d')]==='undefined';var _0x5761c5=_0xf8b770['count'];var _0x4d9dd8=_0x400c24?0x0:_0x21ea76[_0x1f50('0x1c')];var _0x40ded8=_0x400c24?_0xf8b770[_0x1f50('0x1e')]:_0x21ea76['offset']+_0x21ea76['limit'];var _0x13266f;if(_0x40ded8>=_0x5761c5){_0x40ded8=_0x5761c5;_0x13266f=0xc8;}else{_0x13266f=0xce;}_0x3d6eff[_0x1f50('0x1f')](_0x13266f);return _0x3d6eff[_0x1f50('0x20')]('Content-Range',_0x4d9dd8+'-'+_0x40ded8+'/'+_0x5761c5)['json'](_0xf8b770);}return null;};}function patchUpdates(_0x377b58){return function(_0x1d1de2){try{jsonpatch[_0x1f50('0x21')](_0x1d1de2,_0x377b58,!![]);}catch(_0x47c255){return BPromise[_0x1f50('0x22')](_0x47c255);}return _0x1d1de2[_0x1f50('0x23')]();};}function saveUpdates(_0x36d45f,_0x3133fa){return function(_0x8fea83){if(_0x8fea83){return _0x8fea83[_0x1f50('0x24')](_0x36d45f)[_0x1f50('0x25')](function(_0x2f4a15){return _0x2f4a15;});}return null;};}function removeEntity(_0x31c730,_0x253ff1){return function(_0x1d5ebb){if(_0x1d5ebb){return _0x1d5ebb[_0x1f50('0x26')]()[_0x1f50('0x25')](function(){_0x31c730[_0x1f50('0x1f')](0xcc)[_0x1f50('0x1a')]();});}};}function handleEntityNotFound(_0x2c2bff,_0x263938){return function(_0x5dd129){if(!_0x5dd129){_0x2c2bff[_0x1f50('0x19')](0x194);}return _0x5dd129;};}function handleError(_0x5dd96d,_0x4ee102){_0x4ee102=_0x4ee102||0x1f4;return function(_0x5039c7){logger[_0x1f50('0x27')](_0x5039c7['stack']);if(_0x5039c7[_0x1f50('0x28')]){delete _0x5039c7[_0x1f50('0x28')];}_0x5dd96d[_0x1f50('0x1f')](_0x4ee102)[_0x1f50('0x29')](_0x5039c7);};}exports[_0x1f50('0x2a')]=function(_0x3e9135,_0x14fbd4){var _0x5503cf={},_0x460dbe={},_0x429bd0={'count':0x0,'rows':[]};var _0x14e69c=_['map'](db['ServicenowConfiguration'][_0x1f50('0x2b')],function(_0x2e4c43){return{'name':_0x2e4c43['fieldName'],'type':_0x2e4c43[_0x1f50('0x2c')][_0x1f50('0x2d')]};});_0x460dbe[_0x1f50('0x2e')]=_[_0x1f50('0x2f')](_0x14e69c,'name');_0x460dbe['query']=_[_0x1f50('0x30')](_0x3e9135[_0x1f50('0x31')]);_0x460dbe[_0x1f50('0x32')]=_[_0x1f50('0x33')](_0x460dbe['model'],_0x460dbe[_0x1f50('0x31')]);_0x5503cf['attributes']=_[_0x1f50('0x33')](_0x460dbe[_0x1f50('0x2e')],qs[_0x1f50('0x34')](_0x3e9135[_0x1f50('0x31')][_0x1f50('0x34')]));_0x5503cf[_0x1f50('0x35')]=_0x5503cf[_0x1f50('0x35')]['length']?_0x5503cf[_0x1f50('0x35')]:_0x460dbe[_0x1f50('0x2e')];if(!_0x3e9135['query']['hasOwnProperty'](_0x1f50('0x36'))){_0x5503cf[_0x1f50('0x1d')]=qs['limit'](_0x3e9135[_0x1f50('0x31')]['limit']);_0x5503cf[_0x1f50('0x1c')]=qs[_0x1f50('0x1c')](_0x3e9135[_0x1f50('0x31')][_0x1f50('0x1c')]);}_0x5503cf[_0x1f50('0x37')]=qs[_0x1f50('0x38')](_0x3e9135[_0x1f50('0x31')][_0x1f50('0x38')]);_0x5503cf[_0x1f50('0x39')]=qs['filters'](_[_0x1f50('0x3a')](_0x3e9135['query'],_0x460dbe[_0x1f50('0x32')]),_0x14e69c);if(_0x3e9135[_0x1f50('0x31')]['filter']){_0x5503cf[_0x1f50('0x39')]=_[_0x1f50('0x3b')](_0x5503cf[_0x1f50('0x39')],{'$or':_[_0x1f50('0x2f')](_0x14e69c,function(_0x1d5b65){if(_0x1d5b65[_0x1f50('0x2c')]!==_0x1f50('0x3c')){var _0x4c86aa={};_0x4c86aa[_0x1d5b65['name']]={'$like':'%'+_0x3e9135[_0x1f50('0x31')][_0x1f50('0x3d')]+'%'};return _0x4c86aa;}})});}_0x5503cf=_[_0x1f50('0x3b')]({},_0x5503cf,_0x3e9135[_0x1f50('0x3e')]);var _0x34f935={'where':_0x5503cf['where']};return db['ServicenowConfiguration'][_0x1f50('0x1e')](_0x34f935)[_0x1f50('0x25')](function(_0xec2c5c){_0x429bd0['count']=_0xec2c5c;if(_0x3e9135['query'][_0x1f50('0x3f')]){_0x5503cf[_0x1f50('0x40')]=[{'all':!![]}];}return db[_0x1f50('0x41')][_0x1f50('0x42')](_0x5503cf);})[_0x1f50('0x25')](function(_0x422890){_0x429bd0[_0x1f50('0x43')]=_0x422890;return _0x429bd0;})[_0x1f50('0x25')](respondWithFilteredResult(_0x14fbd4,_0x5503cf))[_0x1f50('0x44')](handleError(_0x14fbd4,null));};exports[_0x1f50('0x45')]=function(_0xe45814,_0x11994e){var _0x751a4e={'raw':![],'where':{'id':_0xe45814[_0x1f50('0x46')]['id']}},_0xa8bf97={};_0xa8bf97['model']=_['keys'](db[_0x1f50('0x41')][_0x1f50('0x2b')]);_0xa8bf97[_0x1f50('0x31')]=_[_0x1f50('0x30')](_0xe45814[_0x1f50('0x31')]);_0xa8bf97[_0x1f50('0x32')]=_['intersection'](_0xa8bf97['model'],_0xa8bf97[_0x1f50('0x31')]);_0x751a4e[_0x1f50('0x35')]=_['intersection'](_0xa8bf97['model'],qs[_0x1f50('0x34')](_0xe45814[_0x1f50('0x31')][_0x1f50('0x34')]));_0x751a4e[_0x1f50('0x35')]=_0x751a4e[_0x1f50('0x35')][_0x1f50('0x47')]?_0x751a4e[_0x1f50('0x35')]:_0xa8bf97[_0x1f50('0x2e')];if(_0xe45814[_0x1f50('0x31')]['includeAll']){_0x751a4e['include']=[{'all':!![]}];}_0x751a4e=_[_0x1f50('0x3b')]({},_0x751a4e,_0xe45814[_0x1f50('0x3e')]);return db[_0x1f50('0x41')][_0x1f50('0x48')](_0x751a4e)[_0x1f50('0x25')](handleEntityNotFound(_0x11994e,null))[_0x1f50('0x25')](respondWithResult(_0x11994e,null))['catch'](handleError(_0x11994e,null));};exports['create']=function(_0x131bd6,_0x3d22b8){return db[_0x1f50('0x41')][_0x1f50('0x49')](_0x131bd6[_0x1f50('0x4a')],{})[_0x1f50('0x25')](respondWithResult(_0x3d22b8,0xc9))[_0x1f50('0x44')](handleError(_0x3d22b8,null));};exports[_0x1f50('0x24')]=function(_0x4e2ab9,_0x2040cb){if(_0x4e2ab9[_0x1f50('0x4a')]['id']){delete _0x4e2ab9[_0x1f50('0x4a')]['id'];}return db[_0x1f50('0x41')][_0x1f50('0x48')]({'where':{'id':_0x4e2ab9['params']['id']}})[_0x1f50('0x25')](handleEntityNotFound(_0x2040cb,null))['then'](saveUpdates(_0x4e2ab9['body'],null))[_0x1f50('0x25')](respondWithResult(_0x2040cb,null))['catch'](handleError(_0x2040cb,null));};exports[_0x1f50('0x26')]=function(_0x252586,_0x308d22){return db[_0x1f50('0x41')]['find']({'where':{'id':_0x252586['params']['id']}})[_0x1f50('0x25')](handleEntityNotFound(_0x308d22,null))[_0x1f50('0x25')](removeEntity(_0x308d22,null))[_0x1f50('0x44')](handleError(_0x308d22,null));};exports['getFields']=function(_0x2b4e16,_0x365024,_0x349766){var _0x5d42cc={};var _0x25ca91={};var _0x1e8766;var _0x105775;return db[_0x1f50('0x41')][_0x1f50('0x4b')]({'where':{'id':_0x2b4e16['params']['id']}})[_0x1f50('0x25')](handleEntityNotFound(_0x365024,null))[_0x1f50('0x25')](function(_0x501a0f){if(_0x501a0f){_0x1e8766=_0x501a0f;_0x25ca91[_0x1f50('0x2e')]=_[_0x1f50('0x30')](db[_0x1f50('0x4c')][_0x1f50('0x2b')]);_0x25ca91[_0x1f50('0x31')]=_[_0x1f50('0x30')](_0x2b4e16[_0x1f50('0x31')]);_0x25ca91[_0x1f50('0x32')]=_['intersection'](_0x25ca91['model'],_0x25ca91['query']);_0x5d42cc[_0x1f50('0x35')]=_[_0x1f50('0x33')](_0x25ca91[_0x1f50('0x2e')],qs['fields'](_0x2b4e16[_0x1f50('0x31')]['fields']));_0x5d42cc['attributes']=_0x5d42cc['attributes'][_0x1f50('0x47')]?_0x5d42cc[_0x1f50('0x35')]:_0x25ca91['model'];_0x5d42cc[_0x1f50('0x37')]=qs[_0x1f50('0x38')](_0x2b4e16[_0x1f50('0x31')]['sort']);_0x5d42cc[_0x1f50('0x39')]=qs[_0x1f50('0x32')](_[_0x1f50('0x3a')](_0x2b4e16[_0x1f50('0x31')],_0x25ca91[_0x1f50('0x32')]));if(_0x2b4e16['query'][_0x1f50('0x3d')]){_0x5d42cc[_0x1f50('0x39')]=_['merge'](_0x5d42cc[_0x1f50('0x39')],{'$or':_['map'](_0x5d42cc[_0x1f50('0x35')],function(_0x5cee48){var _0x571d23={};_0x571d23[_0x5cee48]={'$like':'%'+_0x2b4e16[_0x1f50('0x31')][_0x1f50('0x3d')]+'%'};return _0x571d23;})});}_0x5d42cc=_[_0x1f50('0x3b')]({},_0x5d42cc,_0x2b4e16[_0x1f50('0x3e')]);return _0x1e8766[_0x1f50('0x4d')](_0x5d42cc);}})['then'](function(_0x1aa310){if(_0x1aa310){_0x105775=_0x1aa310['length'];if(!_0x2b4e16['query'][_0x1f50('0x4e')](_0x1f50('0x36'))){_0x5d42cc[_0x1f50('0x1d')]=qs[_0x1f50('0x1d')](_0x2b4e16[_0x1f50('0x31')][_0x1f50('0x1d')]);_0x5d42cc[_0x1f50('0x1c')]=qs['offset'](_0x2b4e16[_0x1f50('0x31')]['offset']);}return _0x1e8766[_0x1f50('0x4d')](_0x5d42cc);}})[_0x1f50('0x25')](function(_0x2f7da8){if(_0x2f7da8){return _0x2f7da8?{'count':_0x105775,'rows':_0x2f7da8}:null;}})[_0x1f50('0x25')](respondWithResult(_0x365024,null))[_0x1f50('0x44')](handleError(_0x365024,null));};exports[_0x1f50('0x4f')]=function(_0x6d407e,_0x271d6e,_0xb37934){var _0x3b2bae={};var _0x20236b={};var _0x5107d0;var _0x139259;return db[_0x1f50('0x41')][_0x1f50('0x4b')]({'where':{'id':_0x6d407e[_0x1f50('0x46')]['id']}})[_0x1f50('0x25')](handleEntityNotFound(_0x271d6e,null))[_0x1f50('0x25')](function(_0x25dc5c){if(_0x25dc5c){_0x5107d0=_0x25dc5c;_0x20236b[_0x1f50('0x2e')]=_[_0x1f50('0x30')](db[_0x1f50('0x4c')][_0x1f50('0x2b')]);_0x20236b[_0x1f50('0x31')]=_[_0x1f50('0x30')](_0x6d407e[_0x1f50('0x31')]);_0x20236b[_0x1f50('0x32')]=_[_0x1f50('0x33')](_0x20236b[_0x1f50('0x2e')],_0x20236b['query']);_0x3b2bae[_0x1f50('0x35')]=_[_0x1f50('0x33')](_0x20236b['model'],qs[_0x1f50('0x34')](_0x6d407e[_0x1f50('0x31')][_0x1f50('0x34')]));_0x3b2bae[_0x1f50('0x35')]=_0x3b2bae[_0x1f50('0x35')][_0x1f50('0x47')]?_0x3b2bae[_0x1f50('0x35')]:_0x20236b[_0x1f50('0x2e')];_0x3b2bae[_0x1f50('0x37')]=qs[_0x1f50('0x38')](_0x6d407e[_0x1f50('0x31')][_0x1f50('0x38')]);_0x3b2bae[_0x1f50('0x39')]=qs[_0x1f50('0x32')](_[_0x1f50('0x3a')](_0x6d407e['query'],_0x20236b[_0x1f50('0x32')]));if(_0x6d407e[_0x1f50('0x31')][_0x1f50('0x3d')]){_0x3b2bae[_0x1f50('0x39')]=_[_0x1f50('0x3b')](_0x3b2bae[_0x1f50('0x39')],{'$or':_[_0x1f50('0x2f')](_0x3b2bae['attributes'],function(_0x5bcd46){var _0xa24db3={};_0xa24db3[_0x5bcd46]={'$like':'%'+_0x6d407e[_0x1f50('0x31')][_0x1f50('0x3d')]+'%'};return _0xa24db3;})});}_0x3b2bae=_[_0x1f50('0x3b')]({},_0x3b2bae,_0x6d407e['options']);return _0x5107d0[_0x1f50('0x4f')](_0x3b2bae);}})['then'](function(_0x325bee){if(_0x325bee){_0x139259=_0x325bee[_0x1f50('0x47')];if(!_0x6d407e['query'][_0x1f50('0x4e')](_0x1f50('0x36'))){_0x3b2bae[_0x1f50('0x1d')]=qs['limit'](_0x6d407e[_0x1f50('0x31')][_0x1f50('0x1d')]);_0x3b2bae['offset']=qs[_0x1f50('0x1c')](_0x6d407e[_0x1f50('0x31')][_0x1f50('0x1c')]);}return _0x5107d0['getSubjects'](_0x3b2bae);}})[_0x1f50('0x25')](function(_0x39264b){if(_0x39264b){return _0x39264b?{'count':_0x139259,'rows':_0x39264b}:null;}})[_0x1f50('0x25')](respondWithResult(_0x271d6e,null))[_0x1f50('0x44')](handleError(_0x271d6e,null));};exports[_0x1f50('0x50')]=function(_0xcf0cb0,_0x52f4be,_0x8cc3e0){var _0x186424={};var _0x1996ed={};var _0x4654fd;var _0x33bbcd;return db[_0x1f50('0x41')][_0x1f50('0x4b')]({'where':{'id':_0xcf0cb0['params']['id']}})[_0x1f50('0x25')](handleEntityNotFound(_0x52f4be,null))['then'](function(_0x517b6b){if(_0x517b6b){_0x4654fd=_0x517b6b;_0x1996ed['model']=_[_0x1f50('0x30')](db[_0x1f50('0x4c')][_0x1f50('0x2b')]);_0x1996ed[_0x1f50('0x31')]=_[_0x1f50('0x30')](_0xcf0cb0[_0x1f50('0x31')]);_0x1996ed[_0x1f50('0x32')]=_[_0x1f50('0x33')](_0x1996ed[_0x1f50('0x2e')],_0x1996ed[_0x1f50('0x31')]);_0x186424[_0x1f50('0x35')]=_[_0x1f50('0x33')](_0x1996ed[_0x1f50('0x2e')],qs[_0x1f50('0x34')](_0xcf0cb0[_0x1f50('0x31')][_0x1f50('0x34')]));_0x186424[_0x1f50('0x35')]=_0x186424[_0x1f50('0x35')][_0x1f50('0x47')]?_0x186424['attributes']:_0x1996ed[_0x1f50('0x2e')];_0x186424[_0x1f50('0x37')]=qs[_0x1f50('0x38')](_0xcf0cb0[_0x1f50('0x31')][_0x1f50('0x38')]);_0x186424[_0x1f50('0x39')]=qs[_0x1f50('0x32')](_[_0x1f50('0x3a')](_0xcf0cb0[_0x1f50('0x31')],_0x1996ed['filters']));if(_0xcf0cb0['query']['filter']){_0x186424[_0x1f50('0x39')]=_[_0x1f50('0x3b')](_0x186424['where'],{'$or':_[_0x1f50('0x2f')](_0x186424['attributes'],function(_0x5c72ff){var _0x444269={};_0x444269[_0x5c72ff]={'$like':'%'+_0xcf0cb0['query'][_0x1f50('0x3d')]+'%'};return _0x444269;})});}_0x186424=_[_0x1f50('0x3b')]({},_0x186424,_0xcf0cb0[_0x1f50('0x3e')]);return _0x4654fd[_0x1f50('0x50')](_0x186424);}})[_0x1f50('0x25')](function(_0x3c5529){if(_0x3c5529){_0x33bbcd=_0x3c5529[_0x1f50('0x47')];if(!_0xcf0cb0[_0x1f50('0x31')][_0x1f50('0x4e')]('nolimit')){_0x186424[_0x1f50('0x1d')]=qs['limit'](_0xcf0cb0[_0x1f50('0x31')]['limit']);_0x186424[_0x1f50('0x1c')]=qs[_0x1f50('0x1c')](_0xcf0cb0[_0x1f50('0x31')]['offset']);}return _0x4654fd['getDescriptions'](_0x186424);}})['then'](function(_0x5e736b){if(_0x5e736b){return _0x5e736b?{'count':_0x33bbcd,'rows':_0x5e736b}:null;}})[_0x1f50('0x25')](respondWithResult(_0x52f4be,null))[_0x1f50('0x44')](handleError(_0x52f4be,null));}; \ No newline at end of file +var _0x5ceb=['path','sox','to-csv','fs-extra','lodash','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','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','map','options','ServicenowConfiguration','findAll','rows','catch','params','intersection','include','create','body','find','getFields','ServicenowField','pick','nolimit','getSubjects','findOne','getDescriptions','order','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x155b14,_0x1fcfa9){var _0x135ccb=function(_0x2a5e77){while(--_0x2a5e77){_0x155b14['push'](_0x155b14['shift']());}};_0x135ccb(++_0x1fcfa9);}(_0x5ceb,0x18e));var _0xb5ce=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5ceb[_0x2d89ce];return _0x3fad10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5ce('0x0'));var zipdir=require(_0xb5ce('0x1'));var jsonpatch=require(_0xb5ce('0x2'));var rp=require('request-promise');var moment=require(_0xb5ce('0x3'));var BPromise=require(_0xb5ce('0x4'));var Mustache=require(_0xb5ce('0x5'));var util=require(_0xb5ce('0x6'));var path=require(_0xb5ce('0x7'));var sox=require(_0xb5ce('0x8'));var csv=require(_0xb5ce('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5ce('0xa'));var _=require(_0xb5ce('0xb'));var squel=require('squel');var crypto=require(_0xb5ce('0xc'));var jsforce=require(_0xb5ce('0xd'));var deskjs=require(_0xb5ce('0xe'));var toCsv=require(_0xb5ce('0x9'));var querystring=require(_0xb5ce('0xf'));var Papa=require(_0xb5ce('0x10'));var Redis=require('ioredis');var authService=require(_0xb5ce('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb5ce('0x12'));var hardwareService=require(_0xb5ce('0x13'));var logger=require(_0xb5ce('0x14'))(_0xb5ce('0x15'));var utils=require(_0xb5ce('0x16'));var config=require(_0xb5ce('0x17'));var licenseUtil=require(_0xb5ce('0x18'));var db=require(_0xb5ce('0x19'))['db'];function respondWithStatusCode(_0x4b035a,_0x35f473){_0x35f473=_0x35f473||0xcc;return function(_0x54c6fb){if(_0x54c6fb){return _0x4b035a['sendStatus'](_0x35f473);}return _0x4b035a[_0xb5ce('0x1a')](_0x35f473)[_0xb5ce('0x1b')]();};}function respondWithResult(_0x2ddccf,_0x522b8d){_0x522b8d=_0x522b8d||0xc8;return function(_0x47bdd3){if(_0x47bdd3){return _0x2ddccf[_0xb5ce('0x1a')](_0x522b8d)['json'](_0x47bdd3);}};}function respondWithFilteredResult(_0x1d8d6b,_0x5c7183){return function(_0x452575){if(_0x452575){var _0x216ea7=typeof _0x5c7183[_0xb5ce('0x1c')]===_0xb5ce('0x1d')&&typeof _0x5c7183[_0xb5ce('0x1e')]===_0xb5ce('0x1d');var _0x55d3aa=_0x452575[_0xb5ce('0x1f')];var _0x966474=_0x216ea7?0x0:_0x5c7183['offset'];var _0x401637=_0x216ea7?_0x452575[_0xb5ce('0x1f')]:_0x5c7183[_0xb5ce('0x1c')]+_0x5c7183[_0xb5ce('0x1e')];var _0x2ae6f3;if(_0x401637>=_0x55d3aa){_0x401637=_0x55d3aa;_0x2ae6f3=0xc8;}else{_0x2ae6f3=0xce;}_0x1d8d6b[_0xb5ce('0x1a')](_0x2ae6f3);return _0x1d8d6b[_0xb5ce('0x20')](_0xb5ce('0x21'),_0x966474+'-'+_0x401637+'/'+_0x55d3aa)[_0xb5ce('0x22')](_0x452575);}return null;};}function patchUpdates(_0x1f8ed1){return function(_0xf51bb5){try{jsonpatch['apply'](_0xf51bb5,_0x1f8ed1,!![]);}catch(_0x33e567){return BPromise[_0xb5ce('0x23')](_0x33e567);}return _0xf51bb5[_0xb5ce('0x24')]();};}function saveUpdates(_0x450912,_0x2dd94b){return function(_0x5a6cfc){if(_0x5a6cfc){return _0x5a6cfc[_0xb5ce('0x25')](_0x450912)['then'](function(_0x1d4d0a){return _0x1d4d0a;});}return null;};}function removeEntity(_0x342eb7,_0xc4e923){return function(_0x49255f){if(_0x49255f){return _0x49255f[_0xb5ce('0x26')]()[_0xb5ce('0x27')](function(){_0x342eb7[_0xb5ce('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9635b5,_0x505e27){return function(_0x23fd23){if(!_0x23fd23){_0x9635b5[_0xb5ce('0x28')](0x194);}return _0x23fd23;};}function handleError(_0x349634,_0x2e2bde){_0x2e2bde=_0x2e2bde||0x1f4;return function(_0x3748f3){logger[_0xb5ce('0x29')](_0x3748f3[_0xb5ce('0x2a')]);if(_0x3748f3[_0xb5ce('0x2b')]){delete _0x3748f3[_0xb5ce('0x2b')];}_0x349634['status'](_0x2e2bde)['send'](_0x3748f3);};}exports[_0xb5ce('0x2c')]=function(_0x299a67,_0x167d75){var _0x1b9a16={},_0x32bf72={},_0x3fe3f8={'count':0x0,'rows':[]};var _0x5764d4=_['map'](db['ServicenowConfiguration'][_0xb5ce('0x2d')],function(_0x162646){return{'name':_0x162646[_0xb5ce('0x2e')],'type':_0x162646[_0xb5ce('0x2f')][_0xb5ce('0x30')]};});_0x32bf72['model']=_['map'](_0x5764d4,_0xb5ce('0x2b'));_0x32bf72[_0xb5ce('0x31')]=_[_0xb5ce('0x32')](_0x299a67[_0xb5ce('0x31')]);_0x32bf72[_0xb5ce('0x33')]=_['intersection'](_0x32bf72[_0xb5ce('0x34')],_0x32bf72['query']);_0x1b9a16['attributes']=_['intersection'](_0x32bf72['model'],qs[_0xb5ce('0x35')](_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x35')]));_0x1b9a16[_0xb5ce('0x36')]=_0x1b9a16[_0xb5ce('0x36')][_0xb5ce('0x37')]?_0x1b9a16[_0xb5ce('0x36')]:_0x32bf72[_0xb5ce('0x34')];if(!_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x38')]('nolimit')){_0x1b9a16['limit']=qs[_0xb5ce('0x1e')](_0x299a67[_0xb5ce('0x31')]['limit']);_0x1b9a16['offset']=qs['offset'](_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x1c')]);}_0x1b9a16['order']=qs[_0xb5ce('0x39')](_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x39')]);_0x1b9a16[_0xb5ce('0x3a')]=qs[_0xb5ce('0x33')](_['pick'](_0x299a67[_0xb5ce('0x31')],_0x32bf72[_0xb5ce('0x33')]),_0x5764d4);if(_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x3b')]){_0x1b9a16[_0xb5ce('0x3a')]=_[_0xb5ce('0x3c')](_0x1b9a16[_0xb5ce('0x3a')],{'$or':_[_0xb5ce('0x3d')](_0x5764d4,function(_0x52bd48){if(_0x52bd48[_0xb5ce('0x2f')]!=='VIRTUAL'){var _0x5041f1={};_0x5041f1[_0x52bd48[_0xb5ce('0x2b')]]={'$like':'%'+_0x299a67[_0xb5ce('0x31')][_0xb5ce('0x3b')]+'%'};return _0x5041f1;}})});}_0x1b9a16=_[_0xb5ce('0x3c')]({},_0x1b9a16,_0x299a67[_0xb5ce('0x3e')]);var _0x402a8f={'where':_0x1b9a16[_0xb5ce('0x3a')]};return db['ServicenowConfiguration'][_0xb5ce('0x1f')](_0x402a8f)[_0xb5ce('0x27')](function(_0x15b3fc){_0x3fe3f8[_0xb5ce('0x1f')]=_0x15b3fc;if(_0x299a67[_0xb5ce('0x31')]['includeAll']){_0x1b9a16['include']=[{'all':!![]}];}return db[_0xb5ce('0x3f')][_0xb5ce('0x40')](_0x1b9a16);})[_0xb5ce('0x27')](function(_0x5a2e81){_0x3fe3f8[_0xb5ce('0x41')]=_0x5a2e81;return _0x3fe3f8;})['then'](respondWithFilteredResult(_0x167d75,_0x1b9a16))[_0xb5ce('0x42')](handleError(_0x167d75,null));};exports['show']=function(_0x3fb20b,_0x3ab8cc){var _0x347689={'raw':![],'where':{'id':_0x3fb20b[_0xb5ce('0x43')]['id']}},_0x5b326e={};_0x5b326e['model']=_['keys'](db['ServicenowConfiguration'][_0xb5ce('0x2d')]);_0x5b326e[_0xb5ce('0x31')]=_[_0xb5ce('0x32')](_0x3fb20b[_0xb5ce('0x31')]);_0x5b326e[_0xb5ce('0x33')]=_[_0xb5ce('0x44')](_0x5b326e[_0xb5ce('0x34')],_0x5b326e[_0xb5ce('0x31')]);_0x347689[_0xb5ce('0x36')]=_[_0xb5ce('0x44')](_0x5b326e['model'],qs[_0xb5ce('0x35')](_0x3fb20b[_0xb5ce('0x31')][_0xb5ce('0x35')]));_0x347689['attributes']=_0x347689[_0xb5ce('0x36')][_0xb5ce('0x37')]?_0x347689['attributes']:_0x5b326e[_0xb5ce('0x34')];if(_0x3fb20b[_0xb5ce('0x31')]['includeAll']){_0x347689[_0xb5ce('0x45')]=[{'all':!![]}];}_0x347689=_[_0xb5ce('0x3c')]({},_0x347689,_0x3fb20b[_0xb5ce('0x3e')]);return db[_0xb5ce('0x3f')]['find'](_0x347689)[_0xb5ce('0x27')](handleEntityNotFound(_0x3ab8cc,null))[_0xb5ce('0x27')](respondWithResult(_0x3ab8cc,null))[_0xb5ce('0x42')](handleError(_0x3ab8cc,null));};exports[_0xb5ce('0x46')]=function(_0x4c668e,_0x2fcba1){return db[_0xb5ce('0x3f')]['create'](_0x4c668e[_0xb5ce('0x47')],{})[_0xb5ce('0x27')](respondWithResult(_0x2fcba1,0xc9))[_0xb5ce('0x42')](handleError(_0x2fcba1,null));};exports[_0xb5ce('0x25')]=function(_0x1bcd72,_0x5a12ff){if(_0x1bcd72[_0xb5ce('0x47')]['id']){delete _0x1bcd72['body']['id'];}return db[_0xb5ce('0x3f')][_0xb5ce('0x48')]({'where':{'id':_0x1bcd72['params']['id']}})[_0xb5ce('0x27')](handleEntityNotFound(_0x5a12ff,null))['then'](saveUpdates(_0x1bcd72[_0xb5ce('0x47')],null))['then'](respondWithResult(_0x5a12ff,null))['catch'](handleError(_0x5a12ff,null));};exports[_0xb5ce('0x26')]=function(_0x5a8ab8,_0x15d81a){return db[_0xb5ce('0x3f')][_0xb5ce('0x48')]({'where':{'id':_0x5a8ab8[_0xb5ce('0x43')]['id']}})[_0xb5ce('0x27')](handleEntityNotFound(_0x15d81a,null))['then'](removeEntity(_0x15d81a,null))[_0xb5ce('0x42')](handleError(_0x15d81a,null));};exports[_0xb5ce('0x49')]=function(_0x45a68b,_0x26d37a,_0xed9726){var _0x3f82a={};var _0x142c06={};var _0x2119fb;var _0x4153ee;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x45a68b[_0xb5ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x26d37a,null))[_0xb5ce('0x27')](function(_0x20e647){if(_0x20e647){_0x2119fb=_0x20e647;_0x142c06[_0xb5ce('0x34')]=_[_0xb5ce('0x32')](db[_0xb5ce('0x4a')][_0xb5ce('0x2d')]);_0x142c06[_0xb5ce('0x31')]=_[_0xb5ce('0x32')](_0x45a68b[_0xb5ce('0x31')]);_0x142c06['filters']=_['intersection'](_0x142c06['model'],_0x142c06[_0xb5ce('0x31')]);_0x3f82a[_0xb5ce('0x36')]=_[_0xb5ce('0x44')](_0x142c06[_0xb5ce('0x34')],qs['fields'](_0x45a68b[_0xb5ce('0x31')][_0xb5ce('0x35')]));_0x3f82a[_0xb5ce('0x36')]=_0x3f82a['attributes']['length']?_0x3f82a[_0xb5ce('0x36')]:_0x142c06[_0xb5ce('0x34')];_0x3f82a['order']=qs[_0xb5ce('0x39')](_0x45a68b[_0xb5ce('0x31')]['sort']);_0x3f82a[_0xb5ce('0x3a')]=qs[_0xb5ce('0x33')](_[_0xb5ce('0x4b')](_0x45a68b[_0xb5ce('0x31')],_0x142c06[_0xb5ce('0x33')]));if(_0x45a68b[_0xb5ce('0x31')][_0xb5ce('0x3b')]){_0x3f82a[_0xb5ce('0x3a')]=_[_0xb5ce('0x3c')](_0x3f82a[_0xb5ce('0x3a')],{'$or':_[_0xb5ce('0x3d')](_0x3f82a[_0xb5ce('0x36')],function(_0x20567d){var _0x3c9f07={};_0x3c9f07[_0x20567d]={'$like':'%'+_0x45a68b['query']['filter']+'%'};return _0x3c9f07;})});}_0x3f82a=_[_0xb5ce('0x3c')]({},_0x3f82a,_0x45a68b[_0xb5ce('0x3e')]);return _0x2119fb[_0xb5ce('0x49')](_0x3f82a);}})[_0xb5ce('0x27')](function(_0x5df886){if(_0x5df886){_0x4153ee=_0x5df886[_0xb5ce('0x37')];if(!_0x45a68b[_0xb5ce('0x31')][_0xb5ce('0x38')](_0xb5ce('0x4c'))){_0x3f82a['limit']=qs[_0xb5ce('0x1e')](_0x45a68b[_0xb5ce('0x31')][_0xb5ce('0x1e')]);_0x3f82a[_0xb5ce('0x1c')]=qs[_0xb5ce('0x1c')](_0x45a68b['query'][_0xb5ce('0x1c')]);}return _0x2119fb[_0xb5ce('0x49')](_0x3f82a);}})['then'](function(_0x3e494e){if(_0x3e494e){return _0x3e494e?{'count':_0x4153ee,'rows':_0x3e494e}:null;}})['then'](respondWithResult(_0x26d37a,null))[_0xb5ce('0x42')](handleError(_0x26d37a,null));};exports[_0xb5ce('0x4d')]=function(_0x212fc5,_0x57c8e8,_0x1a8eef){var _0x514387={};var _0x591eda={};var _0x1e637b;var _0x1d74e2;return db[_0xb5ce('0x3f')][_0xb5ce('0x4e')]({'where':{'id':_0x212fc5[_0xb5ce('0x43')]['id']}})['then'](handleEntityNotFound(_0x57c8e8,null))['then'](function(_0x1397e1){if(_0x1397e1){_0x1e637b=_0x1397e1;_0x591eda['model']=_['keys'](db[_0xb5ce('0x4a')][_0xb5ce('0x2d')]);_0x591eda['query']=_[_0xb5ce('0x32')](_0x212fc5[_0xb5ce('0x31')]);_0x591eda[_0xb5ce('0x33')]=_[_0xb5ce('0x44')](_0x591eda['model'],_0x591eda[_0xb5ce('0x31')]);_0x514387[_0xb5ce('0x36')]=_[_0xb5ce('0x44')](_0x591eda[_0xb5ce('0x34')],qs[_0xb5ce('0x35')](_0x212fc5[_0xb5ce('0x31')]['fields']));_0x514387['attributes']=_0x514387['attributes'][_0xb5ce('0x37')]?_0x514387['attributes']:_0x591eda[_0xb5ce('0x34')];_0x514387['order']=qs['sort'](_0x212fc5[_0xb5ce('0x31')]['sort']);_0x514387[_0xb5ce('0x3a')]=qs['filters'](_[_0xb5ce('0x4b')](_0x212fc5[_0xb5ce('0x31')],_0x591eda['filters']));if(_0x212fc5[_0xb5ce('0x31')][_0xb5ce('0x3b')]){_0x514387['where']=_[_0xb5ce('0x3c')](_0x514387[_0xb5ce('0x3a')],{'$or':_[_0xb5ce('0x3d')](_0x514387[_0xb5ce('0x36')],function(_0x263142){var _0x146a67={};_0x146a67[_0x263142]={'$like':'%'+_0x212fc5[_0xb5ce('0x31')][_0xb5ce('0x3b')]+'%'};return _0x146a67;})});}_0x514387=_[_0xb5ce('0x3c')]({},_0x514387,_0x212fc5[_0xb5ce('0x3e')]);return _0x1e637b[_0xb5ce('0x4d')](_0x514387);}})[_0xb5ce('0x27')](function(_0x41bbf4){if(_0x41bbf4){_0x1d74e2=_0x41bbf4[_0xb5ce('0x37')];if(!_0x212fc5[_0xb5ce('0x31')][_0xb5ce('0x38')](_0xb5ce('0x4c'))){_0x514387[_0xb5ce('0x1e')]=qs[_0xb5ce('0x1e')](_0x212fc5['query']['limit']);_0x514387[_0xb5ce('0x1c')]=qs[_0xb5ce('0x1c')](_0x212fc5[_0xb5ce('0x31')][_0xb5ce('0x1c')]);}return _0x1e637b[_0xb5ce('0x4d')](_0x514387);}})[_0xb5ce('0x27')](function(_0x16f4ab){if(_0x16f4ab){return _0x16f4ab?{'count':_0x1d74e2,'rows':_0x16f4ab}:null;}})[_0xb5ce('0x27')](respondWithResult(_0x57c8e8,null))[_0xb5ce('0x42')](handleError(_0x57c8e8,null));};exports[_0xb5ce('0x4f')]=function(_0x1c9e2b,_0x4a0c8f,_0x135b7f){var _0x523b5c={};var _0x294f67={};var _0xe00c2b;var _0x9f270b;return db[_0xb5ce('0x3f')][_0xb5ce('0x4e')]({'where':{'id':_0x1c9e2b[_0xb5ce('0x43')]['id']}})[_0xb5ce('0x27')](handleEntityNotFound(_0x4a0c8f,null))['then'](function(_0x5aac17){if(_0x5aac17){_0xe00c2b=_0x5aac17;_0x294f67[_0xb5ce('0x34')]=_[_0xb5ce('0x32')](db[_0xb5ce('0x4a')][_0xb5ce('0x2d')]);_0x294f67[_0xb5ce('0x31')]=_[_0xb5ce('0x32')](_0x1c9e2b['query']);_0x294f67[_0xb5ce('0x33')]=_[_0xb5ce('0x44')](_0x294f67[_0xb5ce('0x34')],_0x294f67[_0xb5ce('0x31')]);_0x523b5c[_0xb5ce('0x36')]=_[_0xb5ce('0x44')](_0x294f67[_0xb5ce('0x34')],qs[_0xb5ce('0x35')](_0x1c9e2b[_0xb5ce('0x31')]['fields']));_0x523b5c[_0xb5ce('0x36')]=_0x523b5c[_0xb5ce('0x36')][_0xb5ce('0x37')]?_0x523b5c[_0xb5ce('0x36')]:_0x294f67['model'];_0x523b5c[_0xb5ce('0x50')]=qs['sort'](_0x1c9e2b[_0xb5ce('0x31')]['sort']);_0x523b5c[_0xb5ce('0x3a')]=qs['filters'](_['pick'](_0x1c9e2b['query'],_0x294f67[_0xb5ce('0x33')]));if(_0x1c9e2b[_0xb5ce('0x31')]['filter']){_0x523b5c[_0xb5ce('0x3a')]=_['merge'](_0x523b5c['where'],{'$or':_[_0xb5ce('0x3d')](_0x523b5c[_0xb5ce('0x36')],function(_0x1c8b31){var _0x1440cf={};_0x1440cf[_0x1c8b31]={'$like':'%'+_0x1c9e2b[_0xb5ce('0x31')][_0xb5ce('0x3b')]+'%'};return _0x1440cf;})});}_0x523b5c=_['merge']({},_0x523b5c,_0x1c9e2b[_0xb5ce('0x3e')]);return _0xe00c2b[_0xb5ce('0x4f')](_0x523b5c);}})[_0xb5ce('0x27')](function(_0x43c936){if(_0x43c936){_0x9f270b=_0x43c936[_0xb5ce('0x37')];if(!_0x1c9e2b[_0xb5ce('0x31')][_0xb5ce('0x38')](_0xb5ce('0x4c'))){_0x523b5c[_0xb5ce('0x1e')]=qs[_0xb5ce('0x1e')](_0x1c9e2b[_0xb5ce('0x31')][_0xb5ce('0x1e')]);_0x523b5c[_0xb5ce('0x1c')]=qs['offset'](_0x1c9e2b[_0xb5ce('0x31')][_0xb5ce('0x1c')]);}return _0xe00c2b[_0xb5ce('0x4f')](_0x523b5c);}})[_0xb5ce('0x27')](function(_0x211a61){if(_0x211a61){return _0x211a61?{'count':_0x9f270b,'rows':_0x211a61}:null;}})['then'](respondWithResult(_0x4a0c8f,null))[_0xb5ce('0x42')](handleError(_0x4a0c8f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6d75c39..d5cc7f0 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 _0xda2d=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x30e641,_0x390ad9){var _0x13b6ae=function(_0x5c9b43){while(--_0x5c9b43){_0x30e641['push'](_0x30e641['shift']());}};_0x13b6ae(++_0x390ad9);}(_0xda2d,0x102));var _0xdda2=function(_0x2c535b,_0xaa9ff8){_0x2c535b=_0x2c535b-0x0;var _0x516ee4=_0xda2d[_0x2c535b];return _0x516ee4;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9efc=['../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','path'];(function(_0x11a05f,_0x35d167){var _0x5019dd=function(_0x2ba7b4){while(--_0x2ba7b4){_0x11a05f['push'](_0x11a05f['shift']());}};_0x5019dd(++_0x35d167);}(_0x9efc,0x19c));var _0xc9ef=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0x9efc[_0x289a67];return _0x572b49;};'use strict';var _=require(_0xc9ef('0x0'));var util=require(_0xc9ef('0x1'));var logger=require(_0xc9ef('0x2'))(_0xc9ef('0x3'));var moment=require(_0xc9ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9ef('0x5'));var rimraf=require('rimraf');var config=require(_0xc9ef('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xc9ef('0x7')]=function(_0x5eae9a,_0x40bed3){return _0x5eae9a[_0xc9ef('0x8')](_0xc9ef('0x9'),attributes,{'tableName':_0xc9ef('0xa'),'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 149c8df..84711ed 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 _0x0348=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x543e72,_0x4caa75){var _0x35aa66=function(_0x40b6a2){while(--_0x40b6a2){_0x543e72['push'](_0x543e72['shift']());}};_0x35aa66(++_0x4caa75);}(_0x0348,0x1e9));var _0x8034=function(_0x38ff1e,_0x3b9385){_0x38ff1e=_0x38ff1e-0x0;var _0x3755d4=_0x0348[_0x38ff1e];return _0x3755d4;};'use strict';var _=require('lodash');var util=require(_0x8034('0x0'));var moment=require('moment');var BPromise=require(_0x8034('0x1'));var rs=require(_0x8034('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8034('0x3'))['db'];var utils=require(_0x8034('0x4'));var logger=require(_0x8034('0x5'))(_0x8034('0x6'));var config=require(_0x8034('0x7'));var jayson=require(_0x8034('0x8'));var client=jayson[_0x8034('0x9')][_0x8034('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dfb10,_0x317fac,_0x1b9897){return new BPromise(function(_0x308814,_0x3ffa94){return client[_0x8034('0xb')](_0x5dfb10,_0x1b9897)[_0x8034('0xc')](function(_0x1ed3a9){logger[_0x8034('0xd')](_0x8034('0xe'),_0x317fac,_0x8034('0xf'));logger[_0x8034('0x10')](_0x8034('0x11'),_0x317fac,'request\x20sent',JSON[_0x8034('0x12')](_0x1ed3a9));if(_0x1ed3a9['error']){if(_0x1ed3a9[_0x8034('0x13')]['code']===0x1f4){logger[_0x8034('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x317fac,_0x1ed3a9['error'][_0x8034('0x14')]);return _0x3ffa94(_0x1ed3a9[_0x8034('0x13')][_0x8034('0x14')]);}logger['error'](_0x8034('0xe'),_0x317fac,_0x1ed3a9['error'][_0x8034('0x14')]);return _0x308814(_0x1ed3a9['error'][_0x8034('0x14')]);}else{logger[_0x8034('0xd')](_0x8034('0xe'),_0x317fac,_0x8034('0xf'));_0x308814(_0x1ed3a9['result']['message']);}})[_0x8034('0x15')](function(_0x40f002){logger[_0x8034('0x13')](_0x8034('0xe'),_0x317fac,_0x40f002);_0x3ffa94(_0x40f002);});});} \ No newline at end of file +var _0xf31b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1d4233,_0x564968){var _0x302b73=function(_0x262183){while(--_0x262183){_0x1d4233['push'](_0x1d4233['shift']());}};_0x302b73(++_0x564968);}(_0xf31b,0x1a0));var _0xbf31=function(_0x3eb484,_0x524fe0){_0x3eb484=_0x3eb484-0x0;var _0x123e70=_0xf31b[_0x3eb484];return _0x123e70;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var moment=require(_0xbf31('0x2'));var BPromise=require(_0xbf31('0x3'));var rs=require(_0xbf31('0x4'));var fs=require('fs');var Redis=require(_0xbf31('0x5'));var db=require(_0xbf31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf31('0x7'))(_0xbf31('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf31('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcf6c0f,_0xde14a4,_0x547919){return new BPromise(function(_0x4d02dd,_0x3da1a2){return client['request'](_0xcf6c0f,_0x547919)[_0xbf31('0xa')](function(_0x23d576){logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));logger[_0xbf31('0xe')](_0xbf31('0xf'),_0xde14a4,_0xbf31('0xd'),JSON[_0xbf31('0x10')](_0x23d576));if(_0x23d576[_0xbf31('0x11')]){if(_0x23d576[_0xbf31('0x11')][_0xbf31('0x12')]===0x1f4){logger[_0xbf31('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xde14a4,_0x23d576['error']['message']);return _0x3da1a2(_0x23d576['error'][_0xbf31('0x13')]);}logger[_0xbf31('0x11')](_0xbf31('0xc'),_0xde14a4,_0x23d576[_0xbf31('0x11')]['message']);return _0x4d02dd(_0x23d576['error'][_0xbf31('0x13')]);}else{logger[_0xbf31('0xb')](_0xbf31('0xc'),_0xde14a4,_0xbf31('0xd'));_0x4d02dd(_0x23d576[_0xbf31('0x14')]['message']);}})[_0xbf31('0x15')](function(_0x5e9b58){logger['error'](_0xbf31('0xc'),_0xde14a4,_0x5e9b58);_0x3da1a2(_0x5e9b58);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 0628b30..729d82a 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 _0x1de6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','delete','exports','multer','path','connect-timeout','express'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x1de6,0x140));var _0x61de=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0x1de6[_0x280c4b];return _0x2a5e90;};'use strict';var multer=require(_0x61de('0x0'));var util=require('util');var path=require(_0x61de('0x1'));var timeout=require(_0x61de('0x2'));var express=require(_0x61de('0x3'));var router=express[_0x61de('0x4')]();var fs_extra=require(_0x61de('0x5'));var auth=require(_0x61de('0x6'));var interaction=require(_0x61de('0x7'));var config=require(_0x61de('0x8'));var controller=require(_0x61de('0x9'));router[_0x61de('0xa')]('/',auth[_0x61de('0xb')](),controller[_0x61de('0xc')]);router[_0x61de('0xa')](_0x61de('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x61de('0xe')]('/',auth[_0x61de('0xb')](),controller[_0x61de('0xf')]);router['put'](_0x61de('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x61de('0x10')](_0x61de('0xd'),auth[_0x61de('0xb')](),controller['destroy']);module[_0x61de('0x11')]=router; \ No newline at end of file +var _0x04ba=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04ba,0x198));var _0xa04b=function(_0x581eb3,_0x113874){_0x581eb3=_0x581eb3-0x0;var _0x326ed3=_0x04ba[_0x581eb3];return _0x326ed3;};'use strict';var multer=require(_0xa04b('0x0'));var util=require(_0xa04b('0x1'));var path=require(_0xa04b('0x2'));var timeout=require(_0xa04b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa04b('0x4'));var auth=require(_0xa04b('0x5'));var interaction=require(_0xa04b('0x6'));var config=require(_0xa04b('0x7'));var controller=require(_0xa04b('0x8'));router[_0xa04b('0x9')]('/',auth[_0xa04b('0xa')](),controller[_0xa04b('0xb')]);router[_0xa04b('0x9')]('/:id',auth[_0xa04b('0xa')](),controller[_0xa04b('0xc')]);router['post']('/',auth[_0xa04b('0xa')](),controller['create']);router['put'](_0xa04b('0xd'),auth['isAuthenticated'](),controller[_0xa04b('0xe')]);router[_0xa04b('0xf')](_0xa04b('0xd'),auth[_0xa04b('0xa')](),controller[_0xa04b('0x10')]);module[_0xa04b('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 02306cc..2e3071b 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 _0xd254=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x11b3f4,_0x371c17){var _0x47af1d=function(_0x11d38d){while(--_0x11d38d){_0x11b3f4['push'](_0x11b3f4['shift']());}};_0x47af1d(++_0x371c17);}(_0xd254,0x1e1));var _0x4d25=function(_0x247fbd,_0x319e79){_0x247fbd=_0x247fbd-0x0;var _0x452044=_0xd254[_0x247fbd];return _0x452044;};'use strict';var Sequelize=require(_0x4d25('0x0'));module[_0x4d25('0x1')]={'type':{'type':Sequelize[_0x4d25('0x2')](_0x4d25('0x3'),'variable',_0x4d25('0x4'),_0x4d25('0x5'),_0x4d25('0x6')),'defaultValue':_0x4d25('0x3')},'content':{'type':Sequelize[_0x4d25('0x7')]},'key':{'type':Sequelize[_0x4d25('0x7')]},'keyType':{'type':Sequelize[_0x4d25('0x2')](_0x4d25('0x3'),_0x4d25('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x4d25('0x7')]},'idField':{'type':Sequelize[_0x4d25('0x7')]},'nameField':{'type':Sequelize[_0x4d25('0x7')]},'customField':{'type':Sequelize[_0x4d25('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4d25('0x7')]}}; \ No newline at end of file +var _0x975d=['variable','BOOLEAN','exports','ENUM','customVariable','keyValue','STRING'];(function(_0x64f29e,_0x4b5843){var _0x54a094=function(_0x5356e5){while(--_0x5356e5){_0x64f29e['push'](_0x64f29e['shift']());}};_0x54a094(++_0x4b5843);}(_0x975d,0xb1));var _0xd975=function(_0x59749e,_0x624afc){_0x59749e=_0x59749e-0x0;var _0x17c576=_0x975d[_0x59749e];return _0x17c576;};'use strict';var Sequelize=require('sequelize');module[_0xd975('0x0')]={'type':{'type':Sequelize[_0xd975('0x1')]('string','variable',_0xd975('0x2'),_0xd975('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xd975('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd975('0x1')]('string',_0xd975('0x5'),_0xd975('0x2'))},'keyContent':{'type':Sequelize[_0xd975('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd975('0x4')]},'customField':{'type':Sequelize[_0xd975('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd975('0x4')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 7f97730..3576d6c 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 _0xdbbe=['filter','merge','type','VIRTUAL','ServicenowField','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xdbbe,0x1de));var _0xedbb=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xdbbe[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xedbb('0x0'));var rimraf=require(_0xedbb('0x1'));var zipdir=require(_0xedbb('0x2'));var jsonpatch=require(_0xedbb('0x3'));var rp=require(_0xedbb('0x4'));var moment=require(_0xedbb('0x5'));var BPromise=require(_0xedbb('0x6'));var Mustache=require(_0xedbb('0x7'));var util=require('util');var path=require(_0xedbb('0x8'));var sox=require(_0xedbb('0x9'));var csv=require(_0xedbb('0xa'));var ejs=require(_0xedbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedbb('0xc'));var squel=require(_0xedbb('0xd'));var crypto=require(_0xedbb('0xe'));var jsforce=require(_0xedbb('0xf'));var deskjs=require(_0xedbb('0x10'));var toCsv=require(_0xedbb('0xa'));var querystring=require(_0xedbb('0x11'));var Papa=require(_0xedbb('0x12'));var Redis=require(_0xedbb('0x13'));var authService=require(_0xedbb('0x14'));var qs=require(_0xedbb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedbb('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xedbb('0x17'));var config=require(_0xedbb('0x18'));var licenseUtil=require(_0xedbb('0x19'));var db=require(_0xedbb('0x1a'))['db'];function respondWithStatusCode(_0x4732e7,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x4f434b){if(_0x4f434b){return _0x4732e7[_0xedbb('0x1b')](_0x4468e8);}return _0x4732e7[_0xedbb('0x1c')](_0x4468e8)[_0xedbb('0x1d')]();};}function respondWithResult(_0x3e681b,_0x41336a){_0x41336a=_0x41336a||0xc8;return function(_0x2be697){if(_0x2be697){return _0x3e681b['status'](_0x41336a)[_0xedbb('0x1e')](_0x2be697);}};}function respondWithFilteredResult(_0x1f1414,_0x37574e){return function(_0x20bb40){if(_0x20bb40){var _0x3be71e=typeof _0x37574e[_0xedbb('0x1f')]===_0xedbb('0x20')&&typeof _0x37574e[_0xedbb('0x21')]===_0xedbb('0x20');var _0x26a293=_0x20bb40['count'];var _0x3007aa=_0x3be71e?0x0:_0x37574e[_0xedbb('0x1f')];var _0x396f38=_0x3be71e?_0x20bb40[_0xedbb('0x22')]:_0x37574e[_0xedbb('0x1f')]+_0x37574e[_0xedbb('0x21')];var _0x57daca;if(_0x396f38>=_0x26a293){_0x396f38=_0x26a293;_0x57daca=0xc8;}else{_0x57daca=0xce;}_0x1f1414[_0xedbb('0x1c')](_0x57daca);return _0x1f1414[_0xedbb('0x23')](_0xedbb('0x24'),_0x3007aa+'-'+_0x396f38+'/'+_0x26a293)[_0xedbb('0x1e')](_0x20bb40);}return null;};}function patchUpdates(_0x30de46){return function(_0x1d851d){try{jsonpatch['apply'](_0x1d851d,_0x30de46,!![]);}catch(_0x4f0698){return BPromise['reject'](_0x4f0698);}return _0x1d851d[_0xedbb('0x25')]();};}function saveUpdates(_0x4a91d0,_0x1eb3c3){return function(_0x2975fc){if(_0x2975fc){return _0x2975fc[_0xedbb('0x26')](_0x4a91d0)[_0xedbb('0x27')](function(_0x151201){return _0x151201;});}return null;};}function removeEntity(_0x49bc5a,_0x38ddf5){return function(_0x1f54fc){if(_0x1f54fc){return _0x1f54fc['destroy']()[_0xedbb('0x27')](function(){_0x49bc5a['status'](0xcc)[_0xedbb('0x1d')]();});}};}function handleEntityNotFound(_0x237d37,_0x4afb18){return function(_0x532518){if(!_0x532518){_0x237d37['sendStatus'](0x194);}return _0x532518;};}function handleError(_0x3e9b1a,_0xd92e7f){_0xd92e7f=_0xd92e7f||0x1f4;return function(_0x5eb589){logger[_0xedbb('0x28')](_0x5eb589[_0xedbb('0x29')]);if(_0x5eb589[_0xedbb('0x2a')]){delete _0x5eb589[_0xedbb('0x2a')];}_0x3e9b1a[_0xedbb('0x1c')](_0xd92e7f)['send'](_0x5eb589);};}exports[_0xedbb('0x2b')]=function(_0x16854b,_0x12b35d){var _0x4840ef={},_0x5c31c6={},_0x568133={'count':0x0,'rows':[]};var _0x3065ad=_['map'](db['ServicenowField'][_0xedbb('0x2c')],function(_0x44501e){return{'name':_0x44501e[_0xedbb('0x2d')],'type':_0x44501e['type'][_0xedbb('0x2e')]};});_0x5c31c6['model']=_[_0xedbb('0x2f')](_0x3065ad,_0xedbb('0x2a'));_0x5c31c6[_0xedbb('0x30')]=_[_0xedbb('0x31')](_0x16854b[_0xedbb('0x30')]);_0x5c31c6[_0xedbb('0x32')]=_[_0xedbb('0x33')](_0x5c31c6[_0xedbb('0x34')],_0x5c31c6['query']);_0x4840ef['attributes']=_[_0xedbb('0x33')](_0x5c31c6['model'],qs[_0xedbb('0x35')](_0x16854b[_0xedbb('0x30')]['fields']));_0x4840ef[_0xedbb('0x36')]=_0x4840ef['attributes']['length']?_0x4840ef[_0xedbb('0x36')]:_0x5c31c6[_0xedbb('0x34')];if(!_0x16854b['query'][_0xedbb('0x37')](_0xedbb('0x38'))){_0x4840ef[_0xedbb('0x21')]=qs[_0xedbb('0x21')](_0x16854b[_0xedbb('0x30')][_0xedbb('0x21')]);_0x4840ef[_0xedbb('0x1f')]=qs[_0xedbb('0x1f')](_0x16854b[_0xedbb('0x30')][_0xedbb('0x1f')]);}_0x4840ef[_0xedbb('0x39')]=qs[_0xedbb('0x3a')](_0x16854b[_0xedbb('0x30')][_0xedbb('0x3a')]);_0x4840ef[_0xedbb('0x3b')]=qs[_0xedbb('0x32')](_[_0xedbb('0x3c')](_0x16854b[_0xedbb('0x30')],_0x5c31c6['filters']),_0x3065ad);if(_0x16854b[_0xedbb('0x30')][_0xedbb('0x3d')]){_0x4840ef['where']=_[_0xedbb('0x3e')](_0x4840ef[_0xedbb('0x3b')],{'$or':_[_0xedbb('0x2f')](_0x3065ad,function(_0x1cf742){if(_0x1cf742[_0xedbb('0x3f')]!==_0xedbb('0x40')){var _0xbee48f={};_0xbee48f[_0x1cf742[_0xedbb('0x2a')]]={'$like':'%'+_0x16854b['query']['filter']+'%'};return _0xbee48f;}})});}_0x4840ef=_[_0xedbb('0x3e')]({},_0x4840ef,_0x16854b['options']);var _0xb17ae4={'where':_0x4840ef[_0xedbb('0x3b')]};return db[_0xedbb('0x41')][_0xedbb('0x22')](_0xb17ae4)['then'](function(_0x468181){_0x568133[_0xedbb('0x22')]=_0x468181;if(_0x16854b['query']['includeAll']){_0x4840ef[_0xedbb('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0xedbb('0x43')](_0x4840ef);})[_0xedbb('0x27')](function(_0x3d6681){_0x568133[_0xedbb('0x44')]=_0x3d6681;return _0x568133;})['then'](respondWithFilteredResult(_0x12b35d,_0x4840ef))[_0xedbb('0x45')](handleError(_0x12b35d,null));};exports[_0xedbb('0x46')]=function(_0x344401,_0x4f7c8f){var _0x42a1d3={'raw':!![],'where':{'id':_0x344401[_0xedbb('0x47')]['id']}},_0x513563={};_0x513563[_0xedbb('0x34')]=_[_0xedbb('0x31')](db['ServicenowField']['rawAttributes']);_0x513563[_0xedbb('0x30')]=_['keys'](_0x344401[_0xedbb('0x30')]);_0x513563[_0xedbb('0x32')]=_[_0xedbb('0x33')](_0x513563['model'],_0x513563[_0xedbb('0x30')]);_0x42a1d3[_0xedbb('0x36')]=_[_0xedbb('0x33')](_0x513563[_0xedbb('0x34')],qs[_0xedbb('0x35')](_0x344401[_0xedbb('0x30')][_0xedbb('0x35')]));_0x42a1d3[_0xedbb('0x36')]=_0x42a1d3['attributes'][_0xedbb('0x48')]?_0x42a1d3[_0xedbb('0x36')]:_0x513563[_0xedbb('0x34')];if(_0x344401['query']['includeAll']){_0x42a1d3[_0xedbb('0x42')]=[{'all':!![]}];}_0x42a1d3=_[_0xedbb('0x3e')]({},_0x42a1d3,_0x344401[_0xedbb('0x49')]);return db[_0xedbb('0x41')][_0xedbb('0x4a')](_0x42a1d3)[_0xedbb('0x27')](handleEntityNotFound(_0x4f7c8f,null))[_0xedbb('0x27')](respondWithResult(_0x4f7c8f,null))['catch'](handleError(_0x4f7c8f,null));};exports[_0xedbb('0x4b')]=function(_0x26e2c9,_0x42520b){return db[_0xedbb('0x41')][_0xedbb('0x4b')](_0x26e2c9['body'],{})['then'](respondWithResult(_0x42520b,0xc9))['catch'](handleError(_0x42520b,null));};exports[_0xedbb('0x26')]=function(_0x3d69cd,_0x3b54b6){if(_0x3d69cd[_0xedbb('0x4c')]['id']){delete _0x3d69cd[_0xedbb('0x4c')]['id'];}return db[_0xedbb('0x41')][_0xedbb('0x4a')]({'where':{'id':_0x3d69cd[_0xedbb('0x47')]['id']}})[_0xedbb('0x27')](handleEntityNotFound(_0x3b54b6,null))[_0xedbb('0x27')](saveUpdates(_0x3d69cd[_0xedbb('0x4c')],null))[_0xedbb('0x27')](respondWithResult(_0x3b54b6,null))[_0xedbb('0x45')](handleError(_0x3b54b6,null));};exports['destroy']=function(_0x300c5d,_0x37628b){return db[_0xedbb('0x41')]['find']({'where':{'id':_0x300c5d['params']['id']}})['then'](handleEntityNotFound(_0x37628b,null))[_0xedbb('0x27')](removeEntity(_0x37628b,null))[_0xedbb('0x45')](handleError(_0x37628b,null));}; \ No newline at end of file +var _0xbc56=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','ServicenowField','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x4c5f11,_0x28dd13){var _0x5aaebe=function(_0x83e09c){while(--_0x83e09c){_0x4c5f11['push'](_0x4c5f11['shift']());}};_0x5aaebe(++_0x28dd13);}(_0xbc56,0x13d));var _0x6bc5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbc56[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x6bc5('0x0'));var rimraf=require(_0x6bc5('0x1'));var zipdir=require(_0x6bc5('0x2'));var jsonpatch=require(_0x6bc5('0x3'));var rp=require(_0x6bc5('0x4'));var moment=require(_0x6bc5('0x5'));var BPromise=require(_0x6bc5('0x6'));var Mustache=require(_0x6bc5('0x7'));var util=require('util');var path=require(_0x6bc5('0x8'));var sox=require('sox');var csv=require(_0x6bc5('0x9'));var ejs=require(_0x6bc5('0xa'));var fs=require('fs');var fs_extra=require(_0x6bc5('0xb'));var _=require(_0x6bc5('0xc'));var squel=require(_0x6bc5('0xd'));var crypto=require(_0x6bc5('0xe'));var jsforce=require(_0x6bc5('0xf'));var deskjs=require(_0x6bc5('0x10'));var toCsv=require(_0x6bc5('0x9'));var querystring=require(_0x6bc5('0x11'));var Papa=require(_0x6bc5('0x12'));var Redis=require(_0x6bc5('0x13'));var authService=require(_0x6bc5('0x14'));var qs=require(_0x6bc5('0x15'));var as=require(_0x6bc5('0x16'));var hardwareService=require(_0x6bc5('0x17'));var logger=require(_0x6bc5('0x18'))(_0x6bc5('0x19'));var utils=require(_0x6bc5('0x1a'));var config=require(_0x6bc5('0x1b'));var licenseUtil=require(_0x6bc5('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178da6,_0x516ef2){_0x516ef2=_0x516ef2||0xcc;return function(_0x2c66f9){if(_0x2c66f9){return _0x178da6[_0x6bc5('0x1d')](_0x516ef2);}return _0x178da6[_0x6bc5('0x1e')](_0x516ef2)[_0x6bc5('0x1f')]();};}function respondWithResult(_0x483d1c,_0x31ecab){_0x31ecab=_0x31ecab||0xc8;return function(_0x52b54e){if(_0x52b54e){return _0x483d1c['status'](_0x31ecab)[_0x6bc5('0x20')](_0x52b54e);}};}function respondWithFilteredResult(_0x16465a,_0x5f2348){return function(_0x185566){if(_0x185566){var _0x191b52=typeof _0x5f2348[_0x6bc5('0x21')]===_0x6bc5('0x22')&&typeof _0x5f2348[_0x6bc5('0x23')]===_0x6bc5('0x22');var _0x4e82a8=_0x185566[_0x6bc5('0x24')];var _0x14eab1=_0x191b52?0x0:_0x5f2348[_0x6bc5('0x21')];var _0x30cb5e=_0x191b52?_0x185566['count']:_0x5f2348['offset']+_0x5f2348[_0x6bc5('0x23')];var _0x3a2d57;if(_0x30cb5e>=_0x4e82a8){_0x30cb5e=_0x4e82a8;_0x3a2d57=0xc8;}else{_0x3a2d57=0xce;}_0x16465a['status'](_0x3a2d57);return _0x16465a[_0x6bc5('0x25')]('Content-Range',_0x14eab1+'-'+_0x30cb5e+'/'+_0x4e82a8)[_0x6bc5('0x20')](_0x185566);}return null;};}function patchUpdates(_0x3782da){return function(_0x32570f){try{jsonpatch[_0x6bc5('0x26')](_0x32570f,_0x3782da,!![]);}catch(_0x49d76d){return BPromise[_0x6bc5('0x27')](_0x49d76d);}return _0x32570f[_0x6bc5('0x28')]();};}function saveUpdates(_0x4b61f7,_0x45d3b4){return function(_0x5f039e){if(_0x5f039e){return _0x5f039e[_0x6bc5('0x29')](_0x4b61f7)['then'](function(_0x597177){return _0x597177;});}return null;};}function removeEntity(_0x11d6c8,_0x23a0c3){return function(_0xbc7c4){if(_0xbc7c4){return _0xbc7c4[_0x6bc5('0x2a')]()[_0x6bc5('0x2b')](function(){_0x11d6c8[_0x6bc5('0x1e')](0xcc)[_0x6bc5('0x1f')]();});}};}function handleEntityNotFound(_0xf429d,_0x25c216){return function(_0x43827e){if(!_0x43827e){_0xf429d[_0x6bc5('0x1d')](0x194);}return _0x43827e;};}function handleError(_0x2ff5b0,_0x1e0285){_0x1e0285=_0x1e0285||0x1f4;return function(_0x3c4b88){logger[_0x6bc5('0x2c')](_0x3c4b88[_0x6bc5('0x2d')]);if(_0x3c4b88[_0x6bc5('0x2e')]){delete _0x3c4b88[_0x6bc5('0x2e')];}_0x2ff5b0[_0x6bc5('0x1e')](_0x1e0285)[_0x6bc5('0x2f')](_0x3c4b88);};}exports[_0x6bc5('0x30')]=function(_0xe98841,_0x1aa5fe){var _0x521dd4={},_0x2d89d3={},_0x8f6464={'count':0x0,'rows':[]};var _0x55d736=_[_0x6bc5('0x31')](db['ServicenowField'][_0x6bc5('0x32')],function(_0x14fb9b){return{'name':_0x14fb9b[_0x6bc5('0x33')],'type':_0x14fb9b[_0x6bc5('0x34')][_0x6bc5('0x35')]};});_0x2d89d3[_0x6bc5('0x36')]=_[_0x6bc5('0x31')](_0x55d736,_0x6bc5('0x2e'));_0x2d89d3['query']=_[_0x6bc5('0x37')](_0xe98841[_0x6bc5('0x38')]);_0x2d89d3[_0x6bc5('0x39')]=_[_0x6bc5('0x3a')](_0x2d89d3[_0x6bc5('0x36')],_0x2d89d3['query']);_0x521dd4[_0x6bc5('0x3b')]=_[_0x6bc5('0x3a')](_0x2d89d3[_0x6bc5('0x36')],qs[_0x6bc5('0x3c')](_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x3c')]));_0x521dd4[_0x6bc5('0x3b')]=_0x521dd4[_0x6bc5('0x3b')]['length']?_0x521dd4['attributes']:_0x2d89d3[_0x6bc5('0x36')];if(!_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x3d')]('nolimit')){_0x521dd4[_0x6bc5('0x23')]=qs['limit'](_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x23')]);_0x521dd4[_0x6bc5('0x21')]=qs['offset'](_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x21')]);}_0x521dd4[_0x6bc5('0x3e')]=qs[_0x6bc5('0x3f')](_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x3f')]);_0x521dd4[_0x6bc5('0x40')]=qs[_0x6bc5('0x39')](_['pick'](_0xe98841[_0x6bc5('0x38')],_0x2d89d3[_0x6bc5('0x39')]),_0x55d736);if(_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x41')]){_0x521dd4[_0x6bc5('0x40')]=_['merge'](_0x521dd4[_0x6bc5('0x40')],{'$or':_['map'](_0x55d736,function(_0x4882cc){if(_0x4882cc[_0x6bc5('0x34')]!==_0x6bc5('0x42')){var _0x276c12={};_0x276c12[_0x4882cc['name']]={'$like':'%'+_0xe98841[_0x6bc5('0x38')][_0x6bc5('0x41')]+'%'};return _0x276c12;}})});}_0x521dd4=_[_0x6bc5('0x43')]({},_0x521dd4,_0xe98841[_0x6bc5('0x44')]);var _0x5a753b={'where':_0x521dd4[_0x6bc5('0x40')]};return db['ServicenowField'][_0x6bc5('0x24')](_0x5a753b)[_0x6bc5('0x2b')](function(_0x13ee71){_0x8f6464['count']=_0x13ee71;if(_0xe98841['query']['includeAll']){_0x521dd4[_0x6bc5('0x45')]=[{'all':!![]}];}return db[_0x6bc5('0x46')][_0x6bc5('0x47')](_0x521dd4);})[_0x6bc5('0x2b')](function(_0x1c51cf){_0x8f6464[_0x6bc5('0x48')]=_0x1c51cf;return _0x8f6464;})[_0x6bc5('0x2b')](respondWithFilteredResult(_0x1aa5fe,_0x521dd4))[_0x6bc5('0x49')](handleError(_0x1aa5fe,null));};exports[_0x6bc5('0x4a')]=function(_0x3e778b,_0x313dec){var _0x2e1fe7={'raw':!![],'where':{'id':_0x3e778b[_0x6bc5('0x4b')]['id']}},_0x33f84f={};_0x33f84f['model']=_[_0x6bc5('0x37')](db[_0x6bc5('0x46')][_0x6bc5('0x32')]);_0x33f84f['query']=_['keys'](_0x3e778b['query']);_0x33f84f[_0x6bc5('0x39')]=_[_0x6bc5('0x3a')](_0x33f84f[_0x6bc5('0x36')],_0x33f84f[_0x6bc5('0x38')]);_0x2e1fe7[_0x6bc5('0x3b')]=_['intersection'](_0x33f84f[_0x6bc5('0x36')],qs['fields'](_0x3e778b[_0x6bc5('0x38')][_0x6bc5('0x3c')]));_0x2e1fe7[_0x6bc5('0x3b')]=_0x2e1fe7['attributes']['length']?_0x2e1fe7[_0x6bc5('0x3b')]:_0x33f84f[_0x6bc5('0x36')];if(_0x3e778b[_0x6bc5('0x38')][_0x6bc5('0x4c')]){_0x2e1fe7[_0x6bc5('0x45')]=[{'all':!![]}];}_0x2e1fe7=_[_0x6bc5('0x43')]({},_0x2e1fe7,_0x3e778b['options']);return db[_0x6bc5('0x46')][_0x6bc5('0x4d')](_0x2e1fe7)[_0x6bc5('0x2b')](handleEntityNotFound(_0x313dec,null))['then'](respondWithResult(_0x313dec,null))[_0x6bc5('0x49')](handleError(_0x313dec,null));};exports[_0x6bc5('0x4e')]=function(_0x18e534,_0xffdcce){return db[_0x6bc5('0x46')]['create'](_0x18e534['body'],{})['then'](respondWithResult(_0xffdcce,0xc9))[_0x6bc5('0x49')](handleError(_0xffdcce,null));};exports[_0x6bc5('0x29')]=function(_0x574a4d,_0x305dd3){if(_0x574a4d['body']['id']){delete _0x574a4d[_0x6bc5('0x4f')]['id'];}return db[_0x6bc5('0x46')][_0x6bc5('0x4d')]({'where':{'id':_0x574a4d['params']['id']}})['then'](handleEntityNotFound(_0x305dd3,null))[_0x6bc5('0x2b')](saveUpdates(_0x574a4d[_0x6bc5('0x4f')],null))[_0x6bc5('0x2b')](respondWithResult(_0x305dd3,null))[_0x6bc5('0x49')](handleError(_0x305dd3,null));};exports[_0x6bc5('0x2a')]=function(_0x51f510,_0x4a8675){return db['ServicenowField'][_0x6bc5('0x4d')]({'where':{'id':_0x51f510[_0x6bc5('0x4b')]['id']}})[_0x6bc5('0x2b')](handleEntityNotFound(_0x4a8675,null))[_0x6bc5('0x2b')](removeEntity(_0x4a8675,null))['catch'](handleError(_0x4a8675,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6f6996b..17c2b5b 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 _0x8a97=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x8a97,0x15c));var _0x78a9=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8a97[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x78a9('0x0'));var util=require(_0x78a9('0x1'));var logger=require(_0x78a9('0x2'))(_0x78a9('0x3'));var moment=require(_0x78a9('0x4'));var BPromise=require(_0x78a9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78a9('0x6'));var rimraf=require(_0x78a9('0x7'));var config=require(_0x78a9('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x78a9('0x9')]=function(_0x4cd92b,_0x1e196d){return _0x4cd92b['define']('ServicenowField',attributes,{'tableName':_0x78a9('0xa'),'paranoid':![],'indexes':[{'name':_0x78a9('0xb'),'fields':[_0x78a9('0xc'),_0x78a9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6735=['int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','define','ServicenowField'];(function(_0x188035,_0x187149){var _0x2dd828=function(_0x4b408a){while(--_0x4b408a){_0x188035['push'](_0x188035['shift']());}};_0x2dd828(++_0x187149);}(_0x6735,0x18f));var _0x5673=function(_0x47d348,_0x7066d9){_0x47d348=_0x47d348-0x0;var _0x1769ad=_0x6735[_0x47d348];return _0x1769ad;};'use strict';var _=require(_0x5673('0x0'));var util=require(_0x5673('0x1'));var logger=require(_0x5673('0x2'))('api');var moment=require(_0x5673('0x3'));var BPromise=require(_0x5673('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5673('0x5'));var config=require(_0x5673('0x6'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x59fe9d,_0x278ac6){return _0x59fe9d[_0x5673('0x7')](_0x5673('0x8'),attributes,{'tableName':_0x5673('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5673('0xa'),_0x5673('0xb')],'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 851beee..a677fb2 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0xbdb7[_0x401d67];return _0x25076b;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x5c69d6,_0x3ef3ba){_0x5c69d6=_0x5c69d6-0x0;var _0x1dd929=_0xac4a[_0x5c69d6];return _0x1dd929;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 28dd69d..5e6c3ac 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(_0xdbfee7,_0x483f80){var _0x57a714=function(_0x3b0e80){while(--_0x3b0e80){_0xdbfee7['push'](_0xdbfee7['shift']());}};_0x57a714(++_0x483f80);}(_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 +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(_0x54b72e,_0x4d3c59){var _0x49096a=function(_0xf8b66a){while(--_0xf8b66a){_0x54b72e['push'](_0x54b72e['shift']());}};_0x49096a(++_0x4d3c59);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 071ebf6..4a5afec 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(_0x3b001e,_0x2cab62){var _0x320d75=function(_0x563d4c){while(--_0x563d4c){_0x3b001e['push'](_0x3b001e['shift']());}};_0x320d75(++_0x2cab62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x162774,_0x3c11ab){var _0x5cc297=function(_0x48ba64){while(--_0x48ba64){_0x162774['push'](_0x162774['shift']());}};_0x5cc297(++_0x3c11ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'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 08aad3a..a7d0c06 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 _0x695b=['ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','findOne','keys','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x417538,_0x5a1ad6){var _0x3b15b1=function(_0x46e2dd){while(--_0x46e2dd){_0x417538['push'](_0x417538['shift']());}};_0x3b15b1(++_0x5a1ad6);}(_0x695b,0x74));var _0xb695=function(_0x471ac1,_0x2d40ce){_0x471ac1=_0x471ac1-0x0;var _0x4b5fd0=_0x695b[_0x471ac1];return _0x4b5fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb695('0x0'));var zipdir=require(_0xb695('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb695('0x2'));var moment=require(_0xb695('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb695('0x4'));var util=require(_0xb695('0x5'));var path=require(_0xb695('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb695('0x7'));var fs=require('fs');var fs_extra=require(_0xb695('0x8'));var _=require(_0xb695('0x9'));var squel=require(_0xb695('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb695('0xb'));var toCsv=require(_0xb695('0xc'));var querystring=require('querystring');var Papa=require(_0xb695('0xd'));var Redis=require(_0xb695('0xe'));var authService=require(_0xb695('0xf'));var qs=require(_0xb695('0x10'));var as=require(_0xb695('0x11'));var hardwareService=require(_0xb695('0x12'));var logger=require(_0xb695('0x13'))(_0xb695('0x14'));var utils=require(_0xb695('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb695('0x16'));var db=require(_0xb695('0x17'))['db'];var integrations=require(_0xb695('0x18'));function respondWithStatusCode(_0x4e3e29,_0x33fcf2){_0x33fcf2=_0x33fcf2||0xcc;return function(_0x481b65){if(_0x481b65){return _0x4e3e29[_0xb695('0x19')](_0x33fcf2);}return _0x4e3e29['status'](_0x33fcf2)[_0xb695('0x1a')]();};}function respondWithResult(_0x1044bd,_0x13f57e){_0x13f57e=_0x13f57e||0xc8;return function(_0x2bcbd0){if(_0x2bcbd0){return _0x1044bd[_0xb695('0x1b')](_0x13f57e)[_0xb695('0x1c')](_0x2bcbd0);}};}function respondWithFilteredResult(_0x3e72dc,_0x4ad9a0){return function(_0x277fce){if(_0x277fce){var _0x4a4101=typeof _0x4ad9a0[_0xb695('0x1d')]===_0xb695('0x1e')&&typeof _0x4ad9a0[_0xb695('0x1f')]===_0xb695('0x1e');var _0x3ce455=_0x277fce[_0xb695('0x20')];var _0x3dbbb5=_0x4a4101?0x0:_0x4ad9a0['offset'];var _0x1cb581=_0x4a4101?_0x277fce[_0xb695('0x20')]:_0x4ad9a0[_0xb695('0x1d')]+_0x4ad9a0[_0xb695('0x1f')];var _0x411952;if(_0x1cb581>=_0x3ce455){_0x1cb581=_0x3ce455;_0x411952=0xc8;}else{_0x411952=0xce;}_0x3e72dc[_0xb695('0x1b')](_0x411952);return _0x3e72dc[_0xb695('0x21')]('Content-Range',_0x3dbbb5+'-'+_0x1cb581+'/'+_0x3ce455)['json'](_0x277fce);}return null;};}function patchUpdates(_0x28b4e0){return function(_0x1c76e9){try{jsonpatch['apply'](_0x1c76e9,_0x28b4e0,!![]);}catch(_0x62bbfc){return BPromise[_0xb695('0x22')](_0x62bbfc);}return _0x1c76e9[_0xb695('0x23')]();};}function saveUpdates(_0x504fc3,_0x1edabf){return function(_0x173ea4){if(_0x173ea4){return _0x173ea4[_0xb695('0x24')](_0x504fc3)[_0xb695('0x25')](function(_0x47a05a){return _0x47a05a;});}return null;};}function removeEntity(_0x27ff98,_0x6024f7){return function(_0x2df222){if(_0x2df222){return _0x2df222[_0xb695('0x26')]()['then'](function(){_0x27ff98[_0xb695('0x1b')](0xcc)[_0xb695('0x1a')]();});}};}function handleEntityNotFound(_0x55ef3b,_0x54d07){return function(_0x202bc1){if(!_0x202bc1){_0x55ef3b['sendStatus'](0x194);}return _0x202bc1;};}function handleError(_0x51f606,_0x343be2){_0x343be2=_0x343be2||0x1f4;return function(_0x3e6b33){logger[_0xb695('0x27')](_0x3e6b33['stack']);if(_0x3e6b33[_0xb695('0x28')]){delete _0x3e6b33[_0xb695('0x28')];}_0x51f606[_0xb695('0x1b')](_0x343be2)[_0xb695('0x29')](_0x3e6b33);};}exports['index']=function(_0x279025,_0x5b3842){var _0x11337a={},_0x9010ab={},_0x2c4217={'count':0x0,'rows':[]};var _0x3f151c=_[_0xb695('0x2a')](db[_0xb695('0x2b')][_0xb695('0x2c')],function(_0x3c916e){return{'name':_0x3c916e[_0xb695('0x2d')],'type':_0x3c916e[_0xb695('0x2e')]['key']};});_0x9010ab[_0xb695('0x2f')]=_['map'](_0x3f151c,_0xb695('0x28'));_0x9010ab[_0xb695('0x30')]=_['keys'](_0x279025[_0xb695('0x30')]);_0x9010ab['filters']=_[_0xb695('0x31')](_0x9010ab[_0xb695('0x2f')],_0x9010ab[_0xb695('0x30')]);_0x11337a[_0xb695('0x32')]=_[_0xb695('0x31')](_0x9010ab['model'],qs[_0xb695('0x33')](_0x279025['query']['fields']));_0x11337a[_0xb695('0x32')]=_0x11337a[_0xb695('0x32')][_0xb695('0x34')]?_0x11337a[_0xb695('0x32')]:_0x9010ab[_0xb695('0x2f')];if(!_0x279025['query'][_0xb695('0x35')](_0xb695('0x36'))){_0x11337a[_0xb695('0x1f')]=qs[_0xb695('0x1f')](_0x279025[_0xb695('0x30')][_0xb695('0x1f')]);_0x11337a[_0xb695('0x1d')]=qs[_0xb695('0x1d')](_0x279025[_0xb695('0x30')][_0xb695('0x1d')]);}_0x11337a['order']=qs[_0xb695('0x37')](_0x279025['query'][_0xb695('0x37')]);_0x11337a[_0xb695('0x38')]=qs[_0xb695('0x39')](_[_0xb695('0x3a')](_0x279025[_0xb695('0x30')],_0x9010ab['filters']),_0x3f151c);if(_0x279025['query'][_0xb695('0x3b')]){_0x11337a[_0xb695('0x38')]=_[_0xb695('0x3c')](_0x11337a['where'],{'$or':_[_0xb695('0x2a')](_0x3f151c,function(_0x228ba4){if(_0x228ba4[_0xb695('0x2e')]!=='VIRTUAL'){var _0x1409ab={};_0x1409ab[_0x228ba4['name']]={'$like':'%'+_0x279025[_0xb695('0x30')][_0xb695('0x3b')]+'%'};return _0x1409ab;}})});}_0x11337a=_['merge']({},_0x11337a,_0x279025['options']);var _0x362c89={'where':_0x11337a['where']};return db[_0xb695('0x2b')][_0xb695('0x20')](_0x362c89)['then'](function(_0x5167fd){_0x2c4217[_0xb695('0x20')]=_0x5167fd;if(_0x279025['query'][_0xb695('0x3d')]){_0x11337a[_0xb695('0x3e')]=[{'all':!![]}];}return db[_0xb695('0x2b')][_0xb695('0x3f')](_0x11337a);})['then'](function(_0x40fdd7){_0x2c4217[_0xb695('0x40')]=_0x40fdd7;return _0x2c4217;})['then'](respondWithFilteredResult(_0x5b3842,_0x11337a))['catch'](handleError(_0x5b3842,null));};exports[_0xb695('0x41')]=function(_0x56c3c4,_0x43ac1a){var _0x536fb4={'raw':![],'where':{'id':_0x56c3c4[_0xb695('0x42')]['id']}},_0x1bfea7={};_0x1bfea7['model']=_['keys'](db[_0xb695('0x2b')]['rawAttributes']);_0x1bfea7[_0xb695('0x30')]=_['keys'](_0x56c3c4[_0xb695('0x30')]);_0x1bfea7[_0xb695('0x39')]=_[_0xb695('0x31')](_0x1bfea7[_0xb695('0x2f')],_0x1bfea7[_0xb695('0x30')]);_0x536fb4[_0xb695('0x32')]=_[_0xb695('0x31')](_0x1bfea7['model'],qs[_0xb695('0x33')](_0x56c3c4[_0xb695('0x30')]['fields']));_0x536fb4['attributes']=_0x536fb4[_0xb695('0x32')][_0xb695('0x34')]?_0x536fb4[_0xb695('0x32')]:_0x1bfea7[_0xb695('0x2f')];if(_0x56c3c4['query'][_0xb695('0x3d')]){_0x536fb4[_0xb695('0x3e')]=[{'all':!![]}];}_0x536fb4=_[_0xb695('0x3c')]({},_0x536fb4,_0x56c3c4[_0xb695('0x43')]);return db[_0xb695('0x2b')][_0xb695('0x44')](_0x536fb4)[_0xb695('0x25')](handleEntityNotFound(_0x43ac1a,null))['then'](respondWithResult(_0x43ac1a,null))[_0xb695('0x45')](handleError(_0x43ac1a,null));};exports[_0xb695('0x46')]=function(_0x3a254b,_0x11a12b){return db[_0xb695('0x2b')][_0xb695('0x46')](_0x3a254b[_0xb695('0x47')],{})[_0xb695('0x25')](respondWithResult(_0x11a12b,0xc9))[_0xb695('0x45')](handleError(_0x11a12b,null));};exports[_0xb695('0x24')]=function(_0x4e4764,_0x5800c9){if(_0x4e4764[_0xb695('0x47')]['id']){delete _0x4e4764[_0xb695('0x47')]['id'];}return db[_0xb695('0x2b')]['find']({'where':{'id':_0x4e4764[_0xb695('0x42')]['id']}})[_0xb695('0x25')](handleEntityNotFound(_0x5800c9,null))['then'](saveUpdates(_0x4e4764['body'],null))['then'](respondWithResult(_0x5800c9,null))[_0xb695('0x45')](handleError(_0x5800c9,null));};exports[_0xb695('0x26')]=function(_0x110201,_0x3c3c05){return db[_0xb695('0x2b')][_0xb695('0x44')]({'where':{'id':_0x110201[_0xb695('0x42')]['id']}})[_0xb695('0x25')](handleEntityNotFound(_0x3c3c05,null))[_0xb695('0x25')](removeEntity(_0x3c3c05,null))[_0xb695('0x45')](handleError(_0x3c3c05,null));};exports['getConfigurations']=function(_0x15ce6c,_0x4d61a2,_0x51d64a){var _0x338902={};var _0x21f3e0={};var _0x4b938d;var _0x114c4a;return db['SugarcrmAccount'][_0xb695('0x48')]({'where':{'id':_0x15ce6c[_0xb695('0x42')]['id']}})[_0xb695('0x25')](handleEntityNotFound(_0x4d61a2,null))[_0xb695('0x25')](function(_0x26e828){if(_0x26e828){_0x4b938d=_0x26e828;_0x21f3e0[_0xb695('0x2f')]=_[_0xb695('0x49')](db['SugarcrmConfiguration'][_0xb695('0x2c')]);_0x21f3e0['query']=_[_0xb695('0x49')](_0x15ce6c['query']);_0x21f3e0[_0xb695('0x39')]=_[_0xb695('0x31')](_0x21f3e0[_0xb695('0x2f')],_0x21f3e0[_0xb695('0x30')]);_0x338902[_0xb695('0x32')]=_['intersection'](_0x21f3e0['model'],qs[_0xb695('0x33')](_0x15ce6c[_0xb695('0x30')][_0xb695('0x33')]));_0x338902[_0xb695('0x32')]=_0x338902[_0xb695('0x32')][_0xb695('0x34')]?_0x338902['attributes']:_0x21f3e0[_0xb695('0x2f')];_0x338902[_0xb695('0x4a')]=qs[_0xb695('0x37')](_0x15ce6c[_0xb695('0x30')][_0xb695('0x37')]);_0x338902['where']=qs[_0xb695('0x39')](_[_0xb695('0x3a')](_0x15ce6c[_0xb695('0x30')],_0x21f3e0['filters']));if(_0x15ce6c[_0xb695('0x30')][_0xb695('0x3b')]){_0x338902[_0xb695('0x38')]=_[_0xb695('0x3c')](_0x338902[_0xb695('0x38')],{'$or':_[_0xb695('0x2a')](_0x338902['attributes'],function(_0x34141d){var _0x4ad6a0={};_0x4ad6a0[_0x34141d]={'$like':'%'+_0x15ce6c[_0xb695('0x30')][_0xb695('0x3b')]+'%'};return _0x4ad6a0;})});}_0x338902=_[_0xb695('0x3c')]({},_0x338902,_0x15ce6c[_0xb695('0x43')]);return _0x4b938d[_0xb695('0x4b')](_0x338902);}})[_0xb695('0x25')](function(_0x155363){if(_0x155363){_0x114c4a=_0x155363[_0xb695('0x34')];if(!_0x15ce6c[_0xb695('0x30')]['hasOwnProperty'](_0xb695('0x36'))){_0x338902[_0xb695('0x1f')]=qs[_0xb695('0x1f')](_0x15ce6c[_0xb695('0x30')][_0xb695('0x1f')]);_0x338902[_0xb695('0x1d')]=qs[_0xb695('0x1d')](_0x15ce6c[_0xb695('0x30')][_0xb695('0x1d')]);}return _0x4b938d[_0xb695('0x4b')](_0x338902);}})[_0xb695('0x25')](function(_0x214d21){if(_0x214d21){return _0x214d21?{'count':_0x114c4a,'rows':_0x214d21}:null;}})['then'](respondWithResult(_0x4d61a2,null))[_0xb695('0x45')](handleError(_0x4d61a2,null));};exports[_0xb695('0x4c')]=function(_0xd3595d,_0x2d094e,_0x377314){if(_0xd3595d[_0xb695('0x47')]['id']){delete _0xd3595d[_0xb695('0x47')]['id'];}return db[_0xb695('0x2b')][_0xb695('0x48')]({'where':{'id':_0xd3595d['params']['id']}})[_0xb695('0x25')](handleEntityNotFound(_0x2d094e,null))[_0xb695('0x25')](function(_0x5728f1){if(_0x5728f1){_0xd3595d[_0xb695('0x47')][_0xb695('0x4d')]=_0x5728f1['id'];_0xd3595d[_0xb695('0x47')][_0xb695('0x4e')]=integrations[_0xb695('0x4f')](_0xd3595d[_0xb695('0x47')]['channel'],_0xd3595d[_0xb695('0x47')][_0xb695('0x2e')]);_0xd3595d[_0xb695('0x47')][_0xb695('0x50')]=integrations[_0xb695('0x51')](_0xd3595d['body'][_0xb695('0x52')],_0xd3595d[_0xb695('0x47')][_0xb695('0x2e')]);return db[_0xb695('0x53')][_0xb695('0x46')](_0xd3595d['body'],{'include':[{'model':db[_0xb695('0x54')],'as':_0xb695('0x4e')},{'model':db['SugarcrmField'],'as':_0xb695('0x50')}]});}return null;})[_0xb695('0x25')](respondWithResult(_0x2d094e,null))[_0xb695('0x45')](handleError(_0x2d094e,null));};exports['getFields']=function(_0xdff9fe,_0x674d61,_0x21b34c){var _0x500a45='';var _0xe07655=['id',_0xb695('0x28'),_0xb695('0x55'),_0xb695('0x56'),_0xb695('0x57'),_0xb695('0x58'),'duration_hours',_0xb695('0x59'),_0xb695('0x5a'),_0xb695('0x5b'),_0xb695('0x5c'),_0xb695('0x5d')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0xdff9fe[_0xb695('0x42')]['id']},'attributes':['id',_0xb695('0x5e'),_0xb695('0x5f'),_0xb695('0x60')]})[_0xb695('0x25')](handleEntityNotFound(_0x674d61,null))[_0xb695('0x25')](function(_0x47e1fb){if(_0x47e1fb){_0x500a45=_0x47e1fb[_0xb695('0x60')];var _0x1d8ece=_0x500a45[_0xb695('0x61')](-0x1);if(_0x1d8ece==='/'){_0x500a45=_0x500a45['substring'](0x0,_0x500a45[_0xb695('0x62')](_0x1d8ece));}return rp({'method':_0xb695('0x63'),'uri':util[_0xb695('0x64')](_0xb695('0x65'),_0x500a45,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb695('0x66'),'input_type':_0xb695('0x67'),'response_type':_0xb695('0x67'),'rest_data':JSON[_0xb695('0x68')]({'user_auth':{'user_name':_0x47e1fb[_0xb695('0x5e')],'password':_0x47e1fb['password'],'encryption':_0xb695('0x69')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xb695('0x25')](function(_0x237c5e){if(_0x237c5e&&_0x237c5e[_0xb695('0x28')]!==_0xb695('0x6a')&&_0x237c5e[_0xb695('0x28')]!==_0xb695('0x6b')){return rp({'method':'POST','uri':util[_0xb695('0x64')](_0xb695('0x65'),_0x500a45,_0xb695('0x6c')),'json':!![],'form':{'method':_0xb695('0x6d'),'input_type':_0xb695('0x67'),'response_type':_0xb695('0x67'),'rest_data':JSON[_0xb695('0x68')]({'session':_0x237c5e['id'],'module_name':_0xb695('0x6e')})}})['then'](function(_0x1d87fe){if(_0x1d87fe){var _0x49fcee=_['values'](_0x1d87fe[_0xb695('0x6f')]);_[_0xb695('0x70')](_0x49fcee,function(_0x294d1c){return _0xe07655[_0xb695('0x71')](_0x294d1c[_0xb695('0x28')]);});return{'count':_0x49fcee[_0xb695('0x34')],'rows':_[_0xb695('0x2a')](_0x49fcee,function(_0x4bfe61){return{'id':_0x4bfe61[_0xb695('0x28')],'name':_0x4bfe61[_0xb695('0x72')],'custom':_[_0xb695('0x73')](_0x4bfe61[_0xb695('0x28')],'_c')?!![]:![],'options':_0x4bfe61[_0xb695('0x43')]?_[_0xb695('0x2a')](_[_0xb695('0x74')](_0x4bfe61[_0xb695('0x43')]),function(_0x2493ae){return{'name':_0x2493ae[_0xb695('0x75')],'value':_0x2493ae[_0xb695('0x28')]};}):[]};})};}})[_0xb695('0x25')](respondWithResult(_0x674d61,null))[_0xb695('0x45')](function(_0x58a671){var _0x251e54=_0xdff9fe[_0xb695('0x30')][_0xb695('0x76')]?0x1f4:_0x58a671[_0xb695('0x77')]||0x1f4;logger[_0xb695('0x27')](_0xb695('0x78'),_0xb695('0x79'),_0x251e54,JSON[_0xb695('0x68')](_0x58a671));delete _0x58a671[_0xb695('0x28')];if(_0x251e54===0x191){_0x251e54=0x190;}_0x674d61[_0xb695('0x1b')](_0x251e54)[_0xb695('0x29')](_0xdff9fe[_0xb695('0x30')][_0xb695('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x58a671['statusCode']}:_0x58a671);});}else{var _0x497c80=0x1f4;_0x674d61['status'](_0x497c80)['send']({'message':_0xb695('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1762=['label','endsWith','options','values','value','test','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','send','index','SugarcrmAccount','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','rawAttributes','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','created_by','description','date_start','duration_hours','parent_id','parent_type','direction','username','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','password','Invalid\x20Login','format','get_module_fields','Calls','module_fields','includes'];(function(_0x5b463d,_0x4c0149){var _0x342661=function(_0x2ad2de){while(--_0x2ad2de){_0x5b463d['push'](_0x5b463d['shift']());}};_0x342661(++_0x4c0149);}(_0x1762,0xed));var _0x2176=function(_0x316bcd,_0x560e96){_0x316bcd=_0x316bcd-0x0;var _0x2dce07=_0x1762[_0x316bcd];return _0x2dce07;};'use strict';var emlformat=require(_0x2176('0x0'));var rimraf=require(_0x2176('0x1'));var zipdir=require(_0x2176('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2176('0x3'));var moment=require(_0x2176('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2176('0x5'));var util=require(_0x2176('0x6'));var path=require(_0x2176('0x7'));var sox=require(_0x2176('0x8'));var csv=require(_0x2176('0x9'));var ejs=require(_0x2176('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2176('0xb'));var squel=require(_0x2176('0xc'));var crypto=require(_0x2176('0xd'));var jsforce=require(_0x2176('0xe'));var deskjs=require(_0x2176('0xf'));var toCsv=require(_0x2176('0x9'));var querystring=require('querystring');var Papa=require(_0x2176('0x10'));var Redis=require(_0x2176('0x11'));var authService=require(_0x2176('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2176('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2176('0x14'));var utils=require(_0x2176('0x15'));var config=require(_0x2176('0x16'));var licenseUtil=require(_0x2176('0x17'));var db=require(_0x2176('0x18'))['db'];var integrations=require(_0x2176('0x19'));function respondWithStatusCode(_0x365c5e,_0x19a797){_0x19a797=_0x19a797||0xcc;return function(_0x4c8443){if(_0x4c8443){return _0x365c5e[_0x2176('0x1a')](_0x19a797);}return _0x365c5e[_0x2176('0x1b')](_0x19a797)[_0x2176('0x1c')]();};}function respondWithResult(_0x334b7b,_0x122045){_0x122045=_0x122045||0xc8;return function(_0x4b7fab){if(_0x4b7fab){return _0x334b7b['status'](_0x122045)[_0x2176('0x1d')](_0x4b7fab);}};}function respondWithFilteredResult(_0x52d4ff,_0x21148a){return function(_0x11304e){if(_0x11304e){var _0x212ce7=typeof _0x21148a[_0x2176('0x1e')]===_0x2176('0x1f')&&typeof _0x21148a[_0x2176('0x20')]===_0x2176('0x1f');var _0x2b39a6=_0x11304e[_0x2176('0x21')];var _0x1e1408=_0x212ce7?0x0:_0x21148a[_0x2176('0x1e')];var _0x37f124=_0x212ce7?_0x11304e[_0x2176('0x21')]:_0x21148a[_0x2176('0x1e')]+_0x21148a[_0x2176('0x20')];var _0x1568e8;if(_0x37f124>=_0x2b39a6){_0x37f124=_0x2b39a6;_0x1568e8=0xc8;}else{_0x1568e8=0xce;}_0x52d4ff['status'](_0x1568e8);return _0x52d4ff['set']('Content-Range',_0x1e1408+'-'+_0x37f124+'/'+_0x2b39a6)[_0x2176('0x1d')](_0x11304e);}return null;};}function patchUpdates(_0x2f2671){return function(_0xaea0dc){try{jsonpatch[_0x2176('0x22')](_0xaea0dc,_0x2f2671,!![]);}catch(_0x3b79ea){return BPromise[_0x2176('0x23')](_0x3b79ea);}return _0xaea0dc[_0x2176('0x24')]();};}function saveUpdates(_0x54ed1b,_0x3e03e2){return function(_0x146f27){if(_0x146f27){return _0x146f27[_0x2176('0x25')](_0x54ed1b)[_0x2176('0x26')](function(_0xe35b8){return _0xe35b8;});}return null;};}function removeEntity(_0x36d511,_0x455d49){return function(_0x40af74){if(_0x40af74){return _0x40af74['destroy']()['then'](function(){_0x36d511[_0x2176('0x1b')](0xcc)[_0x2176('0x1c')]();});}};}function handleEntityNotFound(_0x43f6f0,_0x5c900c){return function(_0x20a5d1){if(!_0x20a5d1){_0x43f6f0[_0x2176('0x1a')](0x194);}return _0x20a5d1;};}function handleError(_0x103d05,_0x17ae6a){_0x17ae6a=_0x17ae6a||0x1f4;return function(_0x104922){logger['error'](_0x104922[_0x2176('0x27')]);if(_0x104922[_0x2176('0x28')]){delete _0x104922[_0x2176('0x28')];}_0x103d05[_0x2176('0x1b')](_0x17ae6a)[_0x2176('0x29')](_0x104922);};}exports[_0x2176('0x2a')]=function(_0x416d8e,_0x496121){var _0x20d2b0={},_0x2477d3={},_0x132207={'count':0x0,'rows':[]};var _0x479f85=_['map'](db[_0x2176('0x2b')]['rawAttributes'],function(_0x30b025){return{'name':_0x30b025[_0x2176('0x2c')],'type':_0x30b025[_0x2176('0x2d')]['key']};});_0x2477d3[_0x2176('0x2e')]=_[_0x2176('0x2f')](_0x479f85,_0x2176('0x28'));_0x2477d3[_0x2176('0x30')]=_[_0x2176('0x31')](_0x416d8e[_0x2176('0x30')]);_0x2477d3[_0x2176('0x32')]=_[_0x2176('0x33')](_0x2477d3[_0x2176('0x2e')],_0x2477d3[_0x2176('0x30')]);_0x20d2b0[_0x2176('0x34')]=_[_0x2176('0x33')](_0x2477d3[_0x2176('0x2e')],qs[_0x2176('0x35')](_0x416d8e[_0x2176('0x30')]['fields']));_0x20d2b0[_0x2176('0x34')]=_0x20d2b0[_0x2176('0x34')]['length']?_0x20d2b0[_0x2176('0x34')]:_0x2477d3[_0x2176('0x2e')];if(!_0x416d8e[_0x2176('0x30')][_0x2176('0x36')](_0x2176('0x37'))){_0x20d2b0['limit']=qs[_0x2176('0x20')](_0x416d8e['query'][_0x2176('0x20')]);_0x20d2b0['offset']=qs[_0x2176('0x1e')](_0x416d8e['query'][_0x2176('0x1e')]);}_0x20d2b0[_0x2176('0x38')]=qs[_0x2176('0x39')](_0x416d8e[_0x2176('0x30')][_0x2176('0x39')]);_0x20d2b0['where']=qs[_0x2176('0x32')](_[_0x2176('0x3a')](_0x416d8e['query'],_0x2477d3[_0x2176('0x32')]),_0x479f85);if(_0x416d8e[_0x2176('0x30')][_0x2176('0x3b')]){_0x20d2b0[_0x2176('0x3c')]=_[_0x2176('0x3d')](_0x20d2b0['where'],{'$or':_[_0x2176('0x2f')](_0x479f85,function(_0x399659){if(_0x399659['type']!==_0x2176('0x3e')){var _0xa48978={};_0xa48978[_0x399659['name']]={'$like':'%'+_0x416d8e['query'][_0x2176('0x3b')]+'%'};return _0xa48978;}})});}_0x20d2b0=_[_0x2176('0x3d')]({},_0x20d2b0,_0x416d8e['options']);var _0x2ba0f5={'where':_0x20d2b0[_0x2176('0x3c')]};return db[_0x2176('0x2b')][_0x2176('0x21')](_0x2ba0f5)['then'](function(_0x5f0490){_0x132207[_0x2176('0x21')]=_0x5f0490;if(_0x416d8e[_0x2176('0x30')][_0x2176('0x3f')]){_0x20d2b0[_0x2176('0x40')]=[{'all':!![]}];}return db[_0x2176('0x2b')][_0x2176('0x41')](_0x20d2b0);})['then'](function(_0x28b537){_0x132207['rows']=_0x28b537;return _0x132207;})[_0x2176('0x26')](respondWithFilteredResult(_0x496121,_0x20d2b0))[_0x2176('0x42')](handleError(_0x496121,null));};exports[_0x2176('0x43')]=function(_0x4dee51,_0xd82007){var _0x589dfb={'raw':![],'where':{'id':_0x4dee51[_0x2176('0x44')]['id']}},_0xfbc855={};_0xfbc855[_0x2176('0x2e')]=_['keys'](db[_0x2176('0x2b')]['rawAttributes']);_0xfbc855[_0x2176('0x30')]=_[_0x2176('0x31')](_0x4dee51[_0x2176('0x30')]);_0xfbc855['filters']=_[_0x2176('0x33')](_0xfbc855[_0x2176('0x2e')],_0xfbc855['query']);_0x589dfb[_0x2176('0x34')]=_[_0x2176('0x33')](_0xfbc855[_0x2176('0x2e')],qs[_0x2176('0x35')](_0x4dee51[_0x2176('0x30')]['fields']));_0x589dfb[_0x2176('0x34')]=_0x589dfb['attributes'][_0x2176('0x45')]?_0x589dfb[_0x2176('0x34')]:_0xfbc855[_0x2176('0x2e')];if(_0x4dee51[_0x2176('0x30')]['includeAll']){_0x589dfb[_0x2176('0x40')]=[{'all':!![]}];}_0x589dfb=_['merge']({},_0x589dfb,_0x4dee51['options']);return db[_0x2176('0x2b')][_0x2176('0x46')](_0x589dfb)['then'](handleEntityNotFound(_0xd82007,null))[_0x2176('0x26')](respondWithResult(_0xd82007,null))[_0x2176('0x42')](handleError(_0xd82007,null));};exports['create']=function(_0x3effb8,_0x1c0e9a){return db['SugarcrmAccount'][_0x2176('0x47')](_0x3effb8[_0x2176('0x48')],{})['then'](respondWithResult(_0x1c0e9a,0xc9))['catch'](handleError(_0x1c0e9a,null));};exports[_0x2176('0x25')]=function(_0x373b93,_0x3f80c2){if(_0x373b93['body']['id']){delete _0x373b93[_0x2176('0x48')]['id'];}return db[_0x2176('0x2b')][_0x2176('0x46')]({'where':{'id':_0x373b93[_0x2176('0x44')]['id']}})[_0x2176('0x26')](handleEntityNotFound(_0x3f80c2,null))[_0x2176('0x26')](saveUpdates(_0x373b93['body'],null))[_0x2176('0x26')](respondWithResult(_0x3f80c2,null))[_0x2176('0x42')](handleError(_0x3f80c2,null));};exports['destroy']=function(_0x40ac6e,_0x1e31ed){return db[_0x2176('0x2b')]['find']({'where':{'id':_0x40ac6e['params']['id']}})[_0x2176('0x26')](handleEntityNotFound(_0x1e31ed,null))[_0x2176('0x26')](removeEntity(_0x1e31ed,null))[_0x2176('0x42')](handleError(_0x1e31ed,null));};exports[_0x2176('0x49')]=function(_0x4ebcbf,_0x4ce573,_0x702814){var _0x3f3ef6={};var _0xb9ccc8={};var _0x50543b;var _0x5576cc;return db['SugarcrmAccount'][_0x2176('0x4a')]({'where':{'id':_0x4ebcbf[_0x2176('0x44')]['id']}})[_0x2176('0x26')](handleEntityNotFound(_0x4ce573,null))[_0x2176('0x26')](function(_0xa1454c){if(_0xa1454c){_0x50543b=_0xa1454c;_0xb9ccc8[_0x2176('0x2e')]=_[_0x2176('0x31')](db[_0x2176('0x4b')][_0x2176('0x4c')]);_0xb9ccc8['query']=_[_0x2176('0x31')](_0x4ebcbf[_0x2176('0x30')]);_0xb9ccc8[_0x2176('0x32')]=_['intersection'](_0xb9ccc8[_0x2176('0x2e')],_0xb9ccc8[_0x2176('0x30')]);_0x3f3ef6[_0x2176('0x34')]=_[_0x2176('0x33')](_0xb9ccc8['model'],qs['fields'](_0x4ebcbf[_0x2176('0x30')]['fields']));_0x3f3ef6[_0x2176('0x34')]=_0x3f3ef6[_0x2176('0x34')][_0x2176('0x45')]?_0x3f3ef6['attributes']:_0xb9ccc8[_0x2176('0x2e')];_0x3f3ef6[_0x2176('0x38')]=qs[_0x2176('0x39')](_0x4ebcbf[_0x2176('0x30')][_0x2176('0x39')]);_0x3f3ef6['where']=qs[_0x2176('0x32')](_[_0x2176('0x3a')](_0x4ebcbf[_0x2176('0x30')],_0xb9ccc8[_0x2176('0x32')]));if(_0x4ebcbf[_0x2176('0x30')]['filter']){_0x3f3ef6['where']=_[_0x2176('0x3d')](_0x3f3ef6['where'],{'$or':_['map'](_0x3f3ef6[_0x2176('0x34')],function(_0x58ec9c){var _0x183324={};_0x183324[_0x58ec9c]={'$like':'%'+_0x4ebcbf[_0x2176('0x30')]['filter']+'%'};return _0x183324;})});}_0x3f3ef6=_[_0x2176('0x3d')]({},_0x3f3ef6,_0x4ebcbf['options']);return _0x50543b[_0x2176('0x49')](_0x3f3ef6);}})['then'](function(_0x52822a){if(_0x52822a){_0x5576cc=_0x52822a['length'];if(!_0x4ebcbf[_0x2176('0x30')][_0x2176('0x36')](_0x2176('0x37'))){_0x3f3ef6[_0x2176('0x20')]=qs[_0x2176('0x20')](_0x4ebcbf['query'][_0x2176('0x20')]);_0x3f3ef6['offset']=qs[_0x2176('0x1e')](_0x4ebcbf[_0x2176('0x30')][_0x2176('0x1e')]);}return _0x50543b[_0x2176('0x49')](_0x3f3ef6);}})[_0x2176('0x26')](function(_0xffb8ed){if(_0xffb8ed){return _0xffb8ed?{'count':_0x5576cc,'rows':_0xffb8ed}:null;}})[_0x2176('0x26')](respondWithResult(_0x4ce573,null))['catch'](handleError(_0x4ce573,null));};exports['addConfiguration']=function(_0x2e9761,_0x59c2e4,_0xab59a2){if(_0x2e9761[_0x2176('0x48')]['id']){delete _0x2e9761[_0x2176('0x48')]['id'];}return db[_0x2176('0x2b')][_0x2176('0x4a')]({'where':{'id':_0x2e9761[_0x2176('0x44')]['id']}})['then'](handleEntityNotFound(_0x59c2e4,null))['then'](function(_0x1533d0){if(_0x1533d0){_0x2e9761[_0x2176('0x48')][_0x2176('0x4d')]=_0x1533d0['id'];_0x2e9761[_0x2176('0x48')]['Subjects']=integrations[_0x2176('0x4e')](_0x2e9761[_0x2176('0x48')][_0x2176('0x4f')],_0x2e9761['body']['type']);_0x2e9761['body'][_0x2176('0x50')]=integrations[_0x2176('0x51')](_0x2e9761['body'][_0x2176('0x4f')],_0x2e9761['body'][_0x2176('0x2d')]);return db[_0x2176('0x4b')][_0x2176('0x47')](_0x2e9761[_0x2176('0x48')],{'include':[{'model':db[_0x2176('0x52')],'as':_0x2176('0x53')},{'model':db[_0x2176('0x52')],'as':_0x2176('0x50')}]});}return null;})['then'](respondWithResult(_0x59c2e4,null))[_0x2176('0x42')](handleError(_0x59c2e4,null));};exports[_0x2176('0x54')]=function(_0x34e163,_0x1cde63,_0x468c0f){var _0x360a0c='';var _0x164c5e=['id',_0x2176('0x28'),'assigned_user_id',_0x2176('0x55'),_0x2176('0x56'),_0x2176('0x57'),_0x2176('0x58'),'duration_minutes',_0x2176('0x59'),_0x2176('0x5a'),'parent_name',_0x2176('0x5b')];return db[_0x2176('0x2b')][_0x2176('0x4a')]({'where':{'id':_0x34e163[_0x2176('0x44')]['id']},'attributes':['id',_0x2176('0x5c'),'password','remoteUri']})[_0x2176('0x26')](handleEntityNotFound(_0x1cde63,null))[_0x2176('0x26')](function(_0x3877de){if(_0x3877de){_0x360a0c=_0x3877de['remoteUri'];var _0x2a0b90=_0x360a0c[_0x2176('0x5d')](-0x1);if(_0x2a0b90==='/'){_0x360a0c=_0x360a0c[_0x2176('0x5e')](0x0,_0x360a0c[_0x2176('0x5f')](_0x2a0b90));}return rp({'method':_0x2176('0x60'),'uri':util['format'](_0x2176('0x61'),_0x360a0c,_0x2176('0x62')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x2176('0x63'),'rest_data':JSON[_0x2176('0x64')]({'user_auth':{'user_name':_0x3877de['username'],'password':_0x3877de[_0x2176('0x65')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x2176('0x26')](function(_0x43d2d8){if(_0x43d2d8&&_0x43d2d8[_0x2176('0x28')]!==_0x2176('0x66')&&_0x43d2d8[_0x2176('0x28')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x2176('0x67')](_0x2176('0x61'),_0x360a0c,_0x2176('0x62')),'json':!![],'form':{'method':_0x2176('0x68'),'input_type':_0x2176('0x63'),'response_type':'JSON','rest_data':JSON[_0x2176('0x64')]({'session':_0x43d2d8['id'],'module_name':_0x2176('0x69')})}})[_0x2176('0x26')](function(_0x234c82){if(_0x234c82){var _0xbfe494=_['values'](_0x234c82[_0x2176('0x6a')]);_['remove'](_0xbfe494,function(_0x1600e8){return _0x164c5e[_0x2176('0x6b')](_0x1600e8[_0x2176('0x28')]);});return{'count':_0xbfe494[_0x2176('0x45')],'rows':_[_0x2176('0x2f')](_0xbfe494,function(_0x48231c){return{'id':_0x48231c[_0x2176('0x28')],'name':_0x48231c[_0x2176('0x6c')],'custom':_[_0x2176('0x6d')](_0x48231c[_0x2176('0x28')],'_c')?!![]:![],'options':_0x48231c[_0x2176('0x6e')]?_[_0x2176('0x2f')](_[_0x2176('0x6f')](_0x48231c['options']),function(_0x518df0){return{'name':_0x518df0[_0x2176('0x70')],'value':_0x518df0[_0x2176('0x28')]};}):[]};})};}})[_0x2176('0x26')](respondWithResult(_0x1cde63,null))[_0x2176('0x42')](function(_0x3fc950){var _0x299540=_0x34e163['query'][_0x2176('0x71')]?0x1f4:_0x3fc950['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2176('0x54'),_0x299540,JSON['stringify'](_0x3fc950));delete _0x3fc950[_0x2176('0x28')];if(_0x299540===0x191){_0x299540=0x190;}_0x1cde63[_0x2176('0x1b')](_0x299540)[_0x2176('0x29')](_0x34e163[_0x2176('0x30')][_0x2176('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x3fc950[_0x2176('0x72')]}:_0x3fc950);});}else{var _0x2a022e=0x1f4;_0x1cde63[_0x2176('0x1b')](_0x2a022e)[_0x2176('0x29')]({'message':'Wrong\x20credentials','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 afd4624..2e45b53 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 _0x53a6=['api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x529dea,_0x3cb8ab){var _0x2116a7=function(_0x4a841e){while(--_0x4a841e){_0x529dea['push'](_0x529dea['shift']());}};_0x2116a7(++_0x3cb8ab);}(_0x53a6,0x193));var _0x653a=function(_0x1a4612,_0x427b89){_0x1a4612=_0x1a4612-0x0;var _0xab8caf=_0x53a6[_0x1a4612];return _0xab8caf;};'use strict';var _=require(_0x653a('0x0'));var util=require(_0x653a('0x1'));var logger=require(_0x653a('0x2'))(_0x653a('0x3'));var moment=require(_0x653a('0x4'));var BPromise=require('bluebird');var rp=require(_0x653a('0x5'));var fs=require('fs');var path=require(_0x653a('0x6'));var rimraf=require(_0x653a('0x7'));var config=require(_0x653a('0x8'));var attributes=require(_0x653a('0x9'));var integrations=require(_0x653a('0xa'));module[_0x653a('0xb')]=function(_0x2f7796,_0x36b81f){return _0x2f7796['define'](_0x653a('0xc'),attributes,{'tableName':_0x653a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8f2=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x183aea,_0x2a88b5){var _0x1ea092=function(_0x126028){while(--_0x126028){_0x183aea['push'](_0x183aea['shift']());}};_0x1ea092(++_0x2a88b5);}(_0xc8f2,0x120));var _0x2c8f=function(_0x594ce8,_0x5a5931){_0x594ce8=_0x594ce8-0x0;var _0x565556=_0xc8f2[_0x594ce8];return _0x565556;};'use strict';var _=require(_0x2c8f('0x0'));var util=require('util');var logger=require(_0x2c8f('0x1'))(_0x2c8f('0x2'));var moment=require(_0x2c8f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c8f('0x4'));var rimraf=require(_0x2c8f('0x5'));var config=require(_0x2c8f('0x6'));var attributes=require(_0x2c8f('0x7'));var integrations=require(_0x2c8f('0x8'));module[_0x2c8f('0x9')]=function(_0x3be988,_0x5c547c){return _0x3be988[_0x2c8f('0xa')](_0x2c8f('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','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 08c6867..1a2777b 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 _0xa90f=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowSugarcrmAccount','find','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x53ab55,_0x492f31){var _0x37776f=function(_0x4cb98c){while(--_0x4cb98c){_0x53ab55['push'](_0x53ab55['shift']());}};_0x37776f(++_0x492f31);}(_0xa90f,0x1b5));var _0xfa90=function(_0x5fc42c,_0x42ff9a){_0x5fc42c=_0x5fc42c-0x0;var _0x3b791a=_0xa90f[_0x5fc42c];return _0x3b791a;};'use strict';var _=require(_0xfa90('0x0'));var util=require('util');var moment=require(_0xfa90('0x1'));var BPromise=require(_0xfa90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa90('0x3'))['db'];var utils=require(_0xfa90('0x4'));var logger=require(_0xfa90('0x5'))('rpc');var config=require(_0xfa90('0x6'));var jayson=require(_0xfa90('0x7'));var client=jayson[_0xfa90('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb486f2,_0x316fd2,_0x273d50){return new BPromise(function(_0x568941,_0x43b897){return client[_0xfa90('0x9')](_0xb486f2,_0x273d50)[_0xfa90('0xa')](function(_0x4f59c0){logger[_0xfa90('0xb')](_0xfa90('0xc'),_0x316fd2,_0xfa90('0xd'));logger[_0xfa90('0xe')](_0xfa90('0xf'),_0x316fd2,_0xfa90('0xd'),JSON['stringify'](_0x4f59c0));if(_0x4f59c0['error']){if(_0x4f59c0[_0xfa90('0x10')]['code']===0x1f4){logger[_0xfa90('0x10')](_0xfa90('0xc'),_0x316fd2,_0x4f59c0[_0xfa90('0x10')][_0xfa90('0x11')]);return _0x43b897(_0x4f59c0['error'][_0xfa90('0x11')]);}logger[_0xfa90('0x10')](_0xfa90('0xc'),_0x316fd2,_0x4f59c0[_0xfa90('0x10')][_0xfa90('0x11')]);return _0x568941(_0x4f59c0[_0xfa90('0x10')][_0xfa90('0x11')]);}else{logger[_0xfa90('0xb')](_0xfa90('0xc'),_0x316fd2,_0xfa90('0xd'));_0x568941(_0x4f59c0[_0xfa90('0x12')][_0xfa90('0x11')]);}})[_0xfa90('0x13')](function(_0x458d7c){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x316fd2,_0x458d7c);_0x43b897(_0x458d7c);});});}exports[_0xfa90('0x14')]=function(_0x1b4186){var _0x4dfd50=this;return new Promise(function(_0x1fd45b,_0x183a06){return db[_0xfa90('0x15')][_0xfa90('0x16')]({'raw':_0x1b4186[_0xfa90('0x17')]?_0x1b4186['options'][_0xfa90('0x18')]===undefined?!![]:![]:!![],'where':_0x1b4186[_0xfa90('0x17')]?_0x1b4186[_0xfa90('0x17')][_0xfa90('0x19')]||null:null,'attributes':_0x1b4186[_0xfa90('0x17')]?_0x1b4186[_0xfa90('0x17')][_0xfa90('0x1a')]||null:null,'limit':_0x1b4186[_0xfa90('0x17')]?_0x1b4186[_0xfa90('0x17')][_0xfa90('0x1b')]||null:null,'include':_0x1b4186['options']?_0x1b4186[_0xfa90('0x17')][_0xfa90('0x1c')]?_['map'](_0x1b4186[_0xfa90('0x17')][_0xfa90('0x1c')],function(_0x187719){return{'model':db[_0x187719['model']],'as':_0x187719['as'],'attributes':_0x187719[_0xfa90('0x1a')],'include':_0x187719[_0xfa90('0x1c')]?_[_0xfa90('0x1d')](_0x187719['include'],function(_0x5cb5b6){return{'model':db[_0x5cb5b6[_0xfa90('0x1e')]],'as':_0x5cb5b6['as'],'attributes':_0x5cb5b6['attributes'],'include':_0x5cb5b6[_0xfa90('0x1c')]?_['map'](_0x5cb5b6[_0xfa90('0x1c')],function(_0x1cff93){return{'model':db[_0x1cff93[_0xfa90('0x1e')]],'as':_0x1cff93['as'],'attributes':_0x1cff93['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa90('0xa')](function(_0x15c3f9){logger[_0xfa90('0xb')](_0xfa90('0x14'),_0x1b4186);logger['debug']('GetSugarcrmAccount',_0x1b4186,JSON[_0xfa90('0x1f')](_0x15c3f9));_0x1fd45b(_0x15c3f9);})[_0xfa90('0x13')](function(_0x3a445d){logger[_0xfa90('0x10')](_0xfa90('0x14'),_0x3a445d[_0xfa90('0x11')],_0x1b4186);_0x183a06(_0x4dfd50[_0xfa90('0x10')](0x1f4,_0x3a445d[_0xfa90('0x11')]));});});};exports[_0xfa90('0x20')]=function(_0x29395c){var _0x14c26e=this;return new Promise(function(_0x13cc64,_0xd61fb3){return db[_0xfa90('0x15')][_0xfa90('0x21')]({'raw':_0x29395c[_0xfa90('0x17')]?_0x29395c['options'][_0xfa90('0x18')]===undefined?!![]:![]:!![],'where':_0x29395c[_0xfa90('0x17')]?_0x29395c['options'][_0xfa90('0x19')]||null:null,'attributes':_0x29395c['options']?_0x29395c[_0xfa90('0x17')]['attributes']||null:null,'include':_0x29395c['options']?_0x29395c[_0xfa90('0x17')]['include']?_[_0xfa90('0x1d')](_0x29395c[_0xfa90('0x17')][_0xfa90('0x1c')],function(_0x536f78){return{'model':db[_0x536f78[_0xfa90('0x1e')]],'as':_0x536f78['as'],'attributes':_0x536f78[_0xfa90('0x1a')],'include':_0x536f78[_0xfa90('0x1c')]?_[_0xfa90('0x1d')](_0x536f78[_0xfa90('0x1c')],function(_0x43d63e){return{'model':db[_0x43d63e[_0xfa90('0x1e')]],'as':_0x43d63e['as'],'attributes':_0x43d63e['attributes'],'include':_0x43d63e[_0xfa90('0x1c')]?_['map'](_0x43d63e[_0xfa90('0x1c')],function(_0x5864b5){return{'model':db[_0x5864b5['model']],'as':_0x5864b5['as'],'attributes':_0x5864b5[_0xfa90('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfa90('0xa')](function(_0x126b3b){logger['info'](_0xfa90('0x20'),_0x29395c);logger[_0xfa90('0xe')](_0xfa90('0x20'),_0x29395c,JSON[_0xfa90('0x1f')](_0x126b3b));_0x13cc64(_0x126b3b);})['catch'](function(_0x4742a9){logger[_0xfa90('0x10')](_0xfa90('0x20'),_0x4742a9[_0xfa90('0x11')],_0x29395c);_0xd61fb3(_0x14c26e[_0xfa90('0x10')](0x1f4,_0x4742a9[_0xfa90('0x11')]));});});}; \ No newline at end of file +var _0x812b=['limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','SugarcrmAccount','options','where','attributes'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x812b,0x1cf));var _0xb812=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x812b[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0xb812('0x0'));var util=require(_0xb812('0x1'));var moment=require(_0xb812('0x2'));var BPromise=require(_0xb812('0x3'));var rs=require(_0xb812('0x4'));var fs=require('fs');var Redis=require(_0xb812('0x5'));var db=require(_0xb812('0x6'))['db'];var utils=require(_0xb812('0x7'));var logger=require(_0xb812('0x8'))(_0xb812('0x9'));var config=require('../../config/environment');var jayson=require(_0xb812('0xa'));var client=jayson['client'][_0xb812('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5783b6,_0x4b4f9e,_0x505d16){return new BPromise(function(_0x576520,_0x1d36df){return client[_0xb812('0xc')](_0x5783b6,_0x505d16)[_0xb812('0xd')](function(_0x21416a){logger[_0xb812('0xe')](_0xb812('0xf'),_0x4b4f9e,'request\x20sent');logger[_0xb812('0x10')](_0xb812('0x11'),_0x4b4f9e,_0xb812('0x12'),JSON[_0xb812('0x13')](_0x21416a));if(_0x21416a[_0xb812('0x14')]){if(_0x21416a['error']['code']===0x1f4){logger[_0xb812('0x14')](_0xb812('0xf'),_0x4b4f9e,_0x21416a['error']['message']);return _0x1d36df(_0x21416a[_0xb812('0x14')][_0xb812('0x15')]);}logger[_0xb812('0x14')](_0xb812('0xf'),_0x4b4f9e,_0x21416a[_0xb812('0x14')]['message']);return _0x576520(_0x21416a['error'][_0xb812('0x15')]);}else{logger[_0xb812('0xe')](_0xb812('0xf'),_0x4b4f9e,_0xb812('0x12'));_0x576520(_0x21416a[_0xb812('0x16')][_0xb812('0x15')]);}})['catch'](function(_0x18d90e){logger[_0xb812('0x14')](_0xb812('0xf'),_0x4b4f9e,_0x18d90e);_0x1d36df(_0x18d90e);});});}exports['GetSugarcrmAccount']=function(_0x33a3ca){var _0x573a57=this;return new Promise(function(_0x278a43,_0x1b32f6){return db[_0xb812('0x17')]['findAll']({'raw':_0x33a3ca[_0xb812('0x18')]?_0x33a3ca[_0xb812('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x33a3ca[_0xb812('0x18')]?_0x33a3ca[_0xb812('0x18')][_0xb812('0x19')]||null:null,'attributes':_0x33a3ca[_0xb812('0x18')]?_0x33a3ca[_0xb812('0x18')][_0xb812('0x1a')]||null:null,'limit':_0x33a3ca[_0xb812('0x18')]?_0x33a3ca['options'][_0xb812('0x1b')]||null:null,'include':_0x33a3ca[_0xb812('0x18')]?_0x33a3ca[_0xb812('0x18')][_0xb812('0x1c')]?_[_0xb812('0x1d')](_0x33a3ca[_0xb812('0x18')]['include'],function(_0x50b519){return{'model':db[_0x50b519[_0xb812('0x1e')]],'as':_0x50b519['as'],'attributes':_0x50b519[_0xb812('0x1a')],'include':_0x50b519[_0xb812('0x1c')]?_[_0xb812('0x1d')](_0x50b519[_0xb812('0x1c')],function(_0x390cf6){return{'model':db[_0x390cf6[_0xb812('0x1e')]],'as':_0x390cf6['as'],'attributes':_0x390cf6[_0xb812('0x1a')],'include':_0x390cf6['include']?_[_0xb812('0x1d')](_0x390cf6['include'],function(_0x2dc068){return{'model':db[_0x2dc068[_0xb812('0x1e')]],'as':_0x2dc068['as'],'attributes':_0x2dc068[_0xb812('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb812('0xd')](function(_0x3cc3cf){logger[_0xb812('0xe')](_0xb812('0x1f'),_0x33a3ca);logger[_0xb812('0x10')](_0xb812('0x1f'),_0x33a3ca,JSON[_0xb812('0x13')](_0x3cc3cf));_0x278a43(_0x3cc3cf);})['catch'](function(_0x2dbf41){logger['error']('GetSugarcrmAccount',_0x2dbf41[_0xb812('0x15')],_0x33a3ca);_0x1b32f6(_0x573a57[_0xb812('0x14')](0x1f4,_0x2dbf41[_0xb812('0x15')]));});});};exports[_0xb812('0x20')]=function(_0xd6f117){var _0x2e6ef6=this;return new Promise(function(_0x17b497,_0x3541c8){return db[_0xb812('0x17')][_0xb812('0x21')]({'raw':_0xd6f117['options']?_0xd6f117[_0xb812('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xd6f117[_0xb812('0x18')]?_0xd6f117[_0xb812('0x18')][_0xb812('0x19')]||null:null,'attributes':_0xd6f117[_0xb812('0x18')]?_0xd6f117['options'][_0xb812('0x1a')]||null:null,'include':_0xd6f117[_0xb812('0x18')]?_0xd6f117['options'][_0xb812('0x1c')]?_[_0xb812('0x1d')](_0xd6f117['options'][_0xb812('0x1c')],function(_0x312d69){return{'model':db[_0x312d69[_0xb812('0x1e')]],'as':_0x312d69['as'],'attributes':_0x312d69[_0xb812('0x1a')],'include':_0x312d69['include']?_[_0xb812('0x1d')](_0x312d69[_0xb812('0x1c')],function(_0x2bfd8d){return{'model':db[_0x2bfd8d[_0xb812('0x1e')]],'as':_0x2bfd8d['as'],'attributes':_0x2bfd8d[_0xb812('0x1a')],'include':_0x2bfd8d['include']?_[_0xb812('0x1d')](_0x2bfd8d['include'],function(_0x1a01c3){return{'model':db[_0x1a01c3[_0xb812('0x1e')]],'as':_0x1a01c3['as'],'attributes':_0x1a01c3[_0xb812('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb812('0xd')](function(_0x4b1ae0){logger[_0xb812('0xe')]('ShowSugarcrmAccount',_0xd6f117);logger[_0xb812('0x10')](_0xb812('0x20'),_0xd6f117,JSON[_0xb812('0x13')](_0x4b1ae0));_0x17b497(_0x4b1ae0);})[_0xb812('0x22')](function(_0x1c00d6){logger['error'](_0xb812('0x20'),_0x1c00d6['message'],_0xd6f117);_0x3541c8(_0x2e6ef6[_0xb812('0x14')](0x1f4,_0x1c00d6[_0xb812('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ce837f0..097b344 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 _0x7fab=['/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x7fab,0x1dd));var _0xb7fa=function(_0x1c0f8d,_0x1adacb){_0x1c0f8d=_0x1c0f8d-0x0;var _0x108dd2=_0x7fab[_0x1c0f8d];return _0x108dd2;};'use strict';var multer=require(_0xb7fa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7fa('0x1'));var express=require(_0xb7fa('0x2'));var router=express['Router']();var fs_extra=require(_0xb7fa('0x3'));var auth=require(_0xb7fa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0xb7fa('0x5')](),controller[_0xb7fa('0x6')]);router[_0xb7fa('0x7')](_0xb7fa('0x8'),auth[_0xb7fa('0x5')](),controller['show']);router[_0xb7fa('0x7')](_0xb7fa('0x9'),auth['isAuthenticated'](),controller[_0xb7fa('0xa')]);router[_0xb7fa('0x7')](_0xb7fa('0xb'),auth[_0xb7fa('0x5')](),controller['getSubjects']);router[_0xb7fa('0x7')]('/:id/descriptions',auth[_0xb7fa('0x5')](),controller[_0xb7fa('0xc')]);router['post']('/',auth[_0xb7fa('0x5')](),controller[_0xb7fa('0xd')]);router[_0xb7fa('0xe')](_0xb7fa('0x8'),auth[_0xb7fa('0x5')](),controller[_0xb7fa('0xf')]);router[_0xb7fa('0x10')](_0xb7fa('0x8'),auth['isAuthenticated'](),controller[_0xb7fa('0x11')]);module['exports']=router; \ No newline at end of file +var _0x378c=['/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x378c,0x137));var _0xc378=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x378c[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xc378('0x0'));var util=require(_0xc378('0x1'));var path=require('path');var timeout=require(_0xc378('0x2'));var express=require(_0xc378('0x3'));var router=express[_0xc378('0x4')]();var fs_extra=require(_0xc378('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc378('0x6'));var controller=require(_0xc378('0x7'));router[_0xc378('0x8')]('/',auth[_0xc378('0x9')](),controller[_0xc378('0xa')]);router[_0xc378('0x8')](_0xc378('0xb'),auth[_0xc378('0x9')](),controller[_0xc378('0xc')]);router['get'](_0xc378('0xd'),auth[_0xc378('0x9')](),controller[_0xc378('0xe')]);router[_0xc378('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xc378('0xf')]);router[_0xc378('0x8')](_0xc378('0x10'),auth[_0xc378('0x9')](),controller['getDescriptions']);router[_0xc378('0x11')]('/',auth[_0xc378('0x9')](),controller[_0xc378('0x12')]);router[_0xc378('0x13')](_0xc378('0xb'),auth[_0xc378('0x9')](),controller[_0xc378('0x14')]);router[_0xc378('0x15')]('/:id',auth[_0xc378('0x9')](),controller[_0xc378('0x16')]);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 e105442..fc73115 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 _0x796b=['exports','STRING','sequelize'];(function(_0x3567c2,_0x1ed368){var _0x594a04=function(_0x1439bb){while(--_0x1439bb){_0x3567c2['push'](_0x3567c2['shift']());}};_0x594a04(++_0x1ed368);}(_0x796b,0xbc));var _0xb796=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0x796b[_0x261e29];return _0x25ef43;};'use strict';var Sequelize=require(_0xb796('0x0'));module[_0xb796('0x1')]={'name':{'type':Sequelize[_0xb796('0x2')]},'description':{'type':Sequelize[_0xb796('0x2')]}}; \ No newline at end of file +var _0x315a=['STRING','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x315a,0xc3));var _0xa315=function(_0x546539,_0x44e2b2){_0x546539=_0x546539-0x0;var _0x3b2235=_0x315a[_0x546539];return _0x3b2235;};'use strict';var Sequelize=require('sequelize');module[_0xa315('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa315('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 973c857..40cfe19 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 _0xa4e3=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','json','save','update','then','destroy','stack','name','send','index','SugarcrmConfiguration','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','catch','create','body','find','findOne','SugarcrmField','hasOwnProperty','nolimit','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0xdf3655,_0x3df389){var _0x5099be=function(_0x57d162){while(--_0x57d162){_0xdf3655['push'](_0xdf3655['shift']());}};_0x5099be(++_0x3df389);}(_0xa4e3,0x9d));var _0x3a4e=function(_0x5b4c2e,_0x5dba78){_0x5b4c2e=_0x5b4c2e-0x0;var _0x3a00c7=_0xa4e3[_0x5b4c2e];return _0x3a00c7;};'use strict';var emlformat=require(_0x3a4e('0x0'));var rimraf=require(_0x3a4e('0x1'));var zipdir=require(_0x3a4e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a4e('0x3'));var moment=require(_0x3a4e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a4e('0x5'));var util=require(_0x3a4e('0x6'));var path=require(_0x3a4e('0x7'));var sox=require('sox');var csv=require(_0x3a4e('0x8'));var ejs=require(_0x3a4e('0x9'));var fs=require('fs');var fs_extra=require(_0x3a4e('0xa'));var _=require(_0x3a4e('0xb'));var squel=require(_0x3a4e('0xc'));var crypto=require(_0x3a4e('0xd'));var jsforce=require(_0x3a4e('0xe'));var deskjs=require(_0x3a4e('0xf'));var toCsv=require(_0x3a4e('0x8'));var querystring=require(_0x3a4e('0x10'));var Papa=require(_0x3a4e('0x11'));var Redis=require(_0x3a4e('0x12'));var authService=require(_0x3a4e('0x13'));var qs=require(_0x3a4e('0x14'));var as=require(_0x3a4e('0x15'));var hardwareService=require(_0x3a4e('0x16'));var logger=require(_0x3a4e('0x17'))('api');var utils=require(_0x3a4e('0x18'));var config=require(_0x3a4e('0x19'));var licenseUtil=require(_0x3a4e('0x1a'));var db=require(_0x3a4e('0x1b'))['db'];function respondWithStatusCode(_0x1810ec,_0x55bd36){_0x55bd36=_0x55bd36||0xcc;return function(_0x394ff3){if(_0x394ff3){return _0x1810ec['sendStatus'](_0x55bd36);}return _0x1810ec[_0x3a4e('0x1c')](_0x55bd36)[_0x3a4e('0x1d')]();};}function respondWithResult(_0x48c9e6,_0x592db1){_0x592db1=_0x592db1||0xc8;return function(_0x3d92e3){if(_0x3d92e3){return _0x48c9e6[_0x3a4e('0x1c')](_0x592db1)['json'](_0x3d92e3);}};}function respondWithFilteredResult(_0x283cca,_0x2d3fb5){return function(_0x2a7b80){if(_0x2a7b80){var _0x651d2e=typeof _0x2d3fb5['offset']==='undefined'&&typeof _0x2d3fb5['limit']===_0x3a4e('0x1e');var _0x22ead9=_0x2a7b80[_0x3a4e('0x1f')];var _0xdbb267=_0x651d2e?0x0:_0x2d3fb5[_0x3a4e('0x20')];var _0x1aaa3e=_0x651d2e?_0x2a7b80['count']:_0x2d3fb5[_0x3a4e('0x20')]+_0x2d3fb5['limit'];var _0x2c1d01;if(_0x1aaa3e>=_0x22ead9){_0x1aaa3e=_0x22ead9;_0x2c1d01=0xc8;}else{_0x2c1d01=0xce;}_0x283cca[_0x3a4e('0x1c')](_0x2c1d01);return _0x283cca[_0x3a4e('0x21')]('Content-Range',_0xdbb267+'-'+_0x1aaa3e+'/'+_0x22ead9)[_0x3a4e('0x22')](_0x2a7b80);}return null;};}function patchUpdates(_0xb6aea2){return function(_0x45587e){try{jsonpatch['apply'](_0x45587e,_0xb6aea2,!![]);}catch(_0x2d7e62){return BPromise['reject'](_0x2d7e62);}return _0x45587e[_0x3a4e('0x23')]();};}function saveUpdates(_0x2f9f10,_0x57ee18){return function(_0x163297){if(_0x163297){return _0x163297[_0x3a4e('0x24')](_0x2f9f10)[_0x3a4e('0x25')](function(_0x120aa){return _0x120aa;});}return null;};}function removeEntity(_0x2a0e75,_0x3696e9){return function(_0x57b33f){if(_0x57b33f){return _0x57b33f[_0x3a4e('0x26')]()[_0x3a4e('0x25')](function(){_0x2a0e75[_0x3a4e('0x1c')](0xcc)[_0x3a4e('0x1d')]();});}};}function handleEntityNotFound(_0x16d3d1,_0x1c83c5){return function(_0x56488c){if(!_0x56488c){_0x16d3d1['sendStatus'](0x194);}return _0x56488c;};}function handleError(_0x2f2e4a,_0x2be4bd){_0x2be4bd=_0x2be4bd||0x1f4;return function(_0x1b7310){logger['error'](_0x1b7310[_0x3a4e('0x27')]);if(_0x1b7310[_0x3a4e('0x28')]){delete _0x1b7310[_0x3a4e('0x28')];}_0x2f2e4a[_0x3a4e('0x1c')](_0x2be4bd)[_0x3a4e('0x29')](_0x1b7310);};}exports[_0x3a4e('0x2a')]=function(_0x245c10,_0x1ce1e3){var _0x19077d={},_0x1ecf22={},_0x34b6ce={'count':0x0,'rows':[]};var _0x2c5ad8=_['map'](db[_0x3a4e('0x2b')]['rawAttributes'],function(_0x572492){return{'name':_0x572492[_0x3a4e('0x2c')],'type':_0x572492[_0x3a4e('0x2d')][_0x3a4e('0x2e')]};});_0x1ecf22[_0x3a4e('0x2f')]=_['map'](_0x2c5ad8,_0x3a4e('0x28'));_0x1ecf22['query']=_[_0x3a4e('0x30')](_0x245c10['query']);_0x1ecf22[_0x3a4e('0x31')]=_[_0x3a4e('0x32')](_0x1ecf22['model'],_0x1ecf22[_0x3a4e('0x33')]);_0x19077d[_0x3a4e('0x34')]=_[_0x3a4e('0x32')](_0x1ecf22['model'],qs[_0x3a4e('0x35')](_0x245c10[_0x3a4e('0x33')]['fields']));_0x19077d[_0x3a4e('0x34')]=_0x19077d[_0x3a4e('0x34')][_0x3a4e('0x36')]?_0x19077d[_0x3a4e('0x34')]:_0x1ecf22[_0x3a4e('0x2f')];if(!_0x245c10[_0x3a4e('0x33')]['hasOwnProperty']('nolimit')){_0x19077d[_0x3a4e('0x37')]=qs[_0x3a4e('0x37')](_0x245c10[_0x3a4e('0x33')][_0x3a4e('0x37')]);_0x19077d[_0x3a4e('0x20')]=qs[_0x3a4e('0x20')](_0x245c10[_0x3a4e('0x33')][_0x3a4e('0x20')]);}_0x19077d[_0x3a4e('0x38')]=qs['sort'](_0x245c10[_0x3a4e('0x33')][_0x3a4e('0x39')]);_0x19077d[_0x3a4e('0x3a')]=qs[_0x3a4e('0x31')](_[_0x3a4e('0x3b')](_0x245c10[_0x3a4e('0x33')],_0x1ecf22[_0x3a4e('0x31')]),_0x2c5ad8);if(_0x245c10['query'][_0x3a4e('0x3c')]){_0x19077d[_0x3a4e('0x3a')]=_[_0x3a4e('0x3d')](_0x19077d[_0x3a4e('0x3a')],{'$or':_[_0x3a4e('0x3e')](_0x2c5ad8,function(_0x379457){if(_0x379457[_0x3a4e('0x2d')]!==_0x3a4e('0x3f')){var _0x32c2fe={};_0x32c2fe[_0x379457[_0x3a4e('0x28')]]={'$like':'%'+_0x245c10['query']['filter']+'%'};return _0x32c2fe;}})});}_0x19077d=_['merge']({},_0x19077d,_0x245c10[_0x3a4e('0x40')]);var _0x2faf46={'where':_0x19077d['where']};return db[_0x3a4e('0x2b')][_0x3a4e('0x1f')](_0x2faf46)['then'](function(_0x19b6d8){_0x34b6ce['count']=_0x19b6d8;if(_0x245c10[_0x3a4e('0x33')][_0x3a4e('0x41')]){_0x19077d[_0x3a4e('0x42')]=[{'all':!![]}];}return db[_0x3a4e('0x2b')][_0x3a4e('0x43')](_0x19077d);})[_0x3a4e('0x25')](function(_0x577dac){_0x34b6ce['rows']=_0x577dac;return _0x34b6ce;})[_0x3a4e('0x25')](respondWithFilteredResult(_0x1ce1e3,_0x19077d))['catch'](handleError(_0x1ce1e3,null));};exports['show']=function(_0x4286f2,_0x153572){var _0xd8ad81={'raw':![],'where':{'id':_0x4286f2[_0x3a4e('0x44')]['id']}},_0x35cda1={};_0x35cda1[_0x3a4e('0x2f')]=_['keys'](db['SugarcrmConfiguration'][_0x3a4e('0x45')]);_0x35cda1[_0x3a4e('0x33')]=_['keys'](_0x4286f2['query']);_0x35cda1[_0x3a4e('0x31')]=_[_0x3a4e('0x32')](_0x35cda1[_0x3a4e('0x2f')],_0x35cda1['query']);_0xd8ad81[_0x3a4e('0x34')]=_[_0x3a4e('0x32')](_0x35cda1[_0x3a4e('0x2f')],qs[_0x3a4e('0x35')](_0x4286f2[_0x3a4e('0x33')][_0x3a4e('0x35')]));_0xd8ad81[_0x3a4e('0x34')]=_0xd8ad81[_0x3a4e('0x34')][_0x3a4e('0x36')]?_0xd8ad81[_0x3a4e('0x34')]:_0x35cda1[_0x3a4e('0x2f')];if(_0x4286f2[_0x3a4e('0x33')][_0x3a4e('0x41')]){_0xd8ad81[_0x3a4e('0x42')]=[{'all':!![]}];}_0xd8ad81=_['merge']({},_0xd8ad81,_0x4286f2[_0x3a4e('0x40')]);return db['SugarcrmConfiguration']['find'](_0xd8ad81)['then'](handleEntityNotFound(_0x153572,null))['then'](respondWithResult(_0x153572,null))[_0x3a4e('0x46')](handleError(_0x153572,null));};exports[_0x3a4e('0x47')]=function(_0x3fdc88,_0x4eafdf){return db[_0x3a4e('0x2b')]['create'](_0x3fdc88[_0x3a4e('0x48')],{})[_0x3a4e('0x25')](respondWithResult(_0x4eafdf,0xc9))[_0x3a4e('0x46')](handleError(_0x4eafdf,null));};exports[_0x3a4e('0x24')]=function(_0x1085b6,_0x3eb52e){if(_0x1085b6['body']['id']){delete _0x1085b6[_0x3a4e('0x48')]['id'];}return db[_0x3a4e('0x2b')][_0x3a4e('0x49')]({'where':{'id':_0x1085b6[_0x3a4e('0x44')]['id']}})[_0x3a4e('0x25')](handleEntityNotFound(_0x3eb52e,null))['then'](saveUpdates(_0x1085b6['body'],null))[_0x3a4e('0x25')](respondWithResult(_0x3eb52e,null))[_0x3a4e('0x46')](handleError(_0x3eb52e,null));};exports[_0x3a4e('0x26')]=function(_0x1e6b40,_0x323142){return db[_0x3a4e('0x2b')][_0x3a4e('0x49')]({'where':{'id':_0x1e6b40[_0x3a4e('0x44')]['id']}})[_0x3a4e('0x25')](handleEntityNotFound(_0x323142,null))[_0x3a4e('0x25')](removeEntity(_0x323142,null))['catch'](handleError(_0x323142,null));};exports['getFields']=function(_0x2d073c,_0x1a2d11,_0x1eb0b4){var _0x334bcf={};var _0x49041c={};var _0x1d6bc9;var _0xf2a937;return db[_0x3a4e('0x2b')][_0x3a4e('0x4a')]({'where':{'id':_0x2d073c['params']['id']}})[_0x3a4e('0x25')](handleEntityNotFound(_0x1a2d11,null))['then'](function(_0x22836e){if(_0x22836e){_0x1d6bc9=_0x22836e;_0x49041c['model']=_[_0x3a4e('0x30')](db[_0x3a4e('0x4b')][_0x3a4e('0x45')]);_0x49041c['query']=_['keys'](_0x2d073c['query']);_0x49041c['filters']=_[_0x3a4e('0x32')](_0x49041c[_0x3a4e('0x2f')],_0x49041c[_0x3a4e('0x33')]);_0x334bcf['attributes']=_[_0x3a4e('0x32')](_0x49041c['model'],qs['fields'](_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x35')]));_0x334bcf[_0x3a4e('0x34')]=_0x334bcf[_0x3a4e('0x34')][_0x3a4e('0x36')]?_0x334bcf['attributes']:_0x49041c[_0x3a4e('0x2f')];_0x334bcf['order']=qs['sort'](_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x39')]);_0x334bcf[_0x3a4e('0x3a')]=qs['filters'](_[_0x3a4e('0x3b')](_0x2d073c[_0x3a4e('0x33')],_0x49041c[_0x3a4e('0x31')]));if(_0x2d073c['query'][_0x3a4e('0x3c')]){_0x334bcf[_0x3a4e('0x3a')]=_[_0x3a4e('0x3d')](_0x334bcf['where'],{'$or':_[_0x3a4e('0x3e')](_0x334bcf[_0x3a4e('0x34')],function(_0x245d1a){var _0x569834={};_0x569834[_0x245d1a]={'$like':'%'+_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x3c')]+'%'};return _0x569834;})});}_0x334bcf=_['merge']({},_0x334bcf,_0x2d073c[_0x3a4e('0x40')]);return _0x1d6bc9['getFields'](_0x334bcf);}})[_0x3a4e('0x25')](function(_0x2ea641){if(_0x2ea641){_0xf2a937=_0x2ea641[_0x3a4e('0x36')];if(!_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x4c')](_0x3a4e('0x4d'))){_0x334bcf['limit']=qs['limit'](_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x37')]);_0x334bcf[_0x3a4e('0x20')]=qs[_0x3a4e('0x20')](_0x2d073c[_0x3a4e('0x33')][_0x3a4e('0x20')]);}return _0x1d6bc9[_0x3a4e('0x4e')](_0x334bcf);}})[_0x3a4e('0x25')](function(_0x3e633d){if(_0x3e633d){return _0x3e633d?{'count':_0xf2a937,'rows':_0x3e633d}:null;}})['then'](respondWithResult(_0x1a2d11,null))[_0x3a4e('0x46')](handleError(_0x1a2d11,null));};exports[_0x3a4e('0x4f')]=function(_0x417add,_0x555ecb,_0x1d7e37){var _0x1ee995={};var _0x55c61f={};var _0x26adab;var _0x56fe07;return db[_0x3a4e('0x2b')][_0x3a4e('0x4a')]({'where':{'id':_0x417add[_0x3a4e('0x44')]['id']}})[_0x3a4e('0x25')](handleEntityNotFound(_0x555ecb,null))[_0x3a4e('0x25')](function(_0x3811cc){if(_0x3811cc){_0x26adab=_0x3811cc;_0x55c61f[_0x3a4e('0x2f')]=_[_0x3a4e('0x30')](db['SugarcrmField'][_0x3a4e('0x45')]);_0x55c61f[_0x3a4e('0x33')]=_['keys'](_0x417add[_0x3a4e('0x33')]);_0x55c61f[_0x3a4e('0x31')]=_['intersection'](_0x55c61f['model'],_0x55c61f[_0x3a4e('0x33')]);_0x1ee995[_0x3a4e('0x34')]=_[_0x3a4e('0x32')](_0x55c61f[_0x3a4e('0x2f')],qs['fields'](_0x417add[_0x3a4e('0x33')][_0x3a4e('0x35')]));_0x1ee995[_0x3a4e('0x34')]=_0x1ee995[_0x3a4e('0x34')][_0x3a4e('0x36')]?_0x1ee995[_0x3a4e('0x34')]:_0x55c61f['model'];_0x1ee995[_0x3a4e('0x38')]=qs[_0x3a4e('0x39')](_0x417add[_0x3a4e('0x33')][_0x3a4e('0x39')]);_0x1ee995[_0x3a4e('0x3a')]=qs['filters'](_[_0x3a4e('0x3b')](_0x417add['query'],_0x55c61f['filters']));if(_0x417add['query'][_0x3a4e('0x3c')]){_0x1ee995[_0x3a4e('0x3a')]=_[_0x3a4e('0x3d')](_0x1ee995['where'],{'$or':_[_0x3a4e('0x3e')](_0x1ee995[_0x3a4e('0x34')],function(_0x25adf2){var _0x3648a1={};_0x3648a1[_0x25adf2]={'$like':'%'+_0x417add[_0x3a4e('0x33')]['filter']+'%'};return _0x3648a1;})});}_0x1ee995=_[_0x3a4e('0x3d')]({},_0x1ee995,_0x417add[_0x3a4e('0x40')]);return _0x26adab[_0x3a4e('0x4f')](_0x1ee995);}})[_0x3a4e('0x25')](function(_0x126264){if(_0x126264){_0x56fe07=_0x126264[_0x3a4e('0x36')];if(!_0x417add[_0x3a4e('0x33')]['hasOwnProperty'](_0x3a4e('0x4d'))){_0x1ee995[_0x3a4e('0x37')]=qs['limit'](_0x417add[_0x3a4e('0x33')][_0x3a4e('0x37')]);_0x1ee995['offset']=qs[_0x3a4e('0x20')](_0x417add[_0x3a4e('0x33')][_0x3a4e('0x20')]);}return _0x26adab[_0x3a4e('0x4f')](_0x1ee995);}})[_0x3a4e('0x25')](function(_0x1a1b3d){if(_0x1a1b3d){return _0x1a1b3d?{'count':_0x56fe07,'rows':_0x1a1b3d}:null;}})[_0x3a4e('0x25')](respondWithResult(_0x555ecb,null))[_0x3a4e('0x46')](handleError(_0x555ecb,null));};exports[_0x3a4e('0x50')]=function(_0x5a663c,_0x38d53e,_0x2700ff){var _0xe009ae={};var _0x43c39f={};var _0x1f559b;var _0x218f56;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x5a663c[_0x3a4e('0x44')]['id']}})[_0x3a4e('0x25')](handleEntityNotFound(_0x38d53e,null))[_0x3a4e('0x25')](function(_0x1ea6e4){if(_0x1ea6e4){_0x1f559b=_0x1ea6e4;_0x43c39f[_0x3a4e('0x2f')]=_[_0x3a4e('0x30')](db[_0x3a4e('0x4b')][_0x3a4e('0x45')]);_0x43c39f[_0x3a4e('0x33')]=_[_0x3a4e('0x30')](_0x5a663c[_0x3a4e('0x33')]);_0x43c39f[_0x3a4e('0x31')]=_[_0x3a4e('0x32')](_0x43c39f[_0x3a4e('0x2f')],_0x43c39f[_0x3a4e('0x33')]);_0xe009ae['attributes']=_['intersection'](_0x43c39f['model'],qs[_0x3a4e('0x35')](_0x5a663c[_0x3a4e('0x33')]['fields']));_0xe009ae[_0x3a4e('0x34')]=_0xe009ae[_0x3a4e('0x34')][_0x3a4e('0x36')]?_0xe009ae[_0x3a4e('0x34')]:_0x43c39f[_0x3a4e('0x2f')];_0xe009ae[_0x3a4e('0x38')]=qs[_0x3a4e('0x39')](_0x5a663c['query'][_0x3a4e('0x39')]);_0xe009ae['where']=qs['filters'](_[_0x3a4e('0x3b')](_0x5a663c[_0x3a4e('0x33')],_0x43c39f[_0x3a4e('0x31')]));if(_0x5a663c[_0x3a4e('0x33')][_0x3a4e('0x3c')]){_0xe009ae[_0x3a4e('0x3a')]=_[_0x3a4e('0x3d')](_0xe009ae[_0x3a4e('0x3a')],{'$or':_[_0x3a4e('0x3e')](_0xe009ae[_0x3a4e('0x34')],function(_0xd34cd4){var _0x5cb0f0={};_0x5cb0f0[_0xd34cd4]={'$like':'%'+_0x5a663c[_0x3a4e('0x33')]['filter']+'%'};return _0x5cb0f0;})});}_0xe009ae=_['merge']({},_0xe009ae,_0x5a663c[_0x3a4e('0x40')]);return _0x1f559b[_0x3a4e('0x50')](_0xe009ae);}})[_0x3a4e('0x25')](function(_0x2db944){if(_0x2db944){_0x218f56=_0x2db944[_0x3a4e('0x36')];if(!_0x5a663c[_0x3a4e('0x33')][_0x3a4e('0x4c')](_0x3a4e('0x4d'))){_0xe009ae['limit']=qs[_0x3a4e('0x37')](_0x5a663c[_0x3a4e('0x33')][_0x3a4e('0x37')]);_0xe009ae[_0x3a4e('0x20')]=qs[_0x3a4e('0x20')](_0x5a663c[_0x3a4e('0x33')][_0x3a4e('0x20')]);}return _0x1f559b['getDescriptions'](_0xe009ae);}})[_0x3a4e('0x25')](function(_0x1ca753){if(_0x1ca753){return _0x1ca753?{'count':_0x218f56,'rows':_0x1ca753}:null;}})[_0x3a4e('0x25')](respondWithResult(_0x38d53e,null))[_0x3a4e('0x46')](handleError(_0x38d53e,null));}; \ No newline at end of file +var _0xa289=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x199ece,_0x4821c9){var _0xdce235=function(_0x1ed922){while(--_0x1ed922){_0x199ece['push'](_0x199ece['shift']());}};_0xdce235(++_0x4821c9);}(_0xa289,0x1e9));var _0x9a28=function(_0x5c47de,_0xc8cf92){_0x5c47de=_0x5c47de-0x0;var _0x49f279=_0xa289[_0x5c47de];return _0x49f279;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a28('0x0'));var zipdir=require(_0x9a28('0x1'));var jsonpatch=require(_0x9a28('0x2'));var rp=require(_0x9a28('0x3'));var moment=require(_0x9a28('0x4'));var BPromise=require(_0x9a28('0x5'));var Mustache=require('mustache');var util=require(_0x9a28('0x6'));var path=require(_0x9a28('0x7'));var sox=require(_0x9a28('0x8'));var csv=require(_0x9a28('0x9'));var ejs=require(_0x9a28('0xa'));var fs=require('fs');var fs_extra=require(_0x9a28('0xb'));var _=require(_0x9a28('0xc'));var squel=require(_0x9a28('0xd'));var crypto=require(_0x9a28('0xe'));var jsforce=require(_0x9a28('0xf'));var deskjs=require(_0x9a28('0x10'));var toCsv=require(_0x9a28('0x9'));var querystring=require(_0x9a28('0x11'));var Papa=require(_0x9a28('0x12'));var Redis=require(_0x9a28('0x13'));var authService=require(_0x9a28('0x14'));var qs=require(_0x9a28('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a28('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9a28('0x17'));var db=require(_0x9a28('0x18'))['db'];function respondWithStatusCode(_0x1ccad7,_0x309afb){_0x309afb=_0x309afb||0xcc;return function(_0x484aa7){if(_0x484aa7){return _0x1ccad7[_0x9a28('0x19')](_0x309afb);}return _0x1ccad7[_0x9a28('0x1a')](_0x309afb)[_0x9a28('0x1b')]();};}function respondWithResult(_0x507da9,_0x1f06c9){_0x1f06c9=_0x1f06c9||0xc8;return function(_0x20aaed){if(_0x20aaed){return _0x507da9[_0x9a28('0x1a')](_0x1f06c9)[_0x9a28('0x1c')](_0x20aaed);}};}function respondWithFilteredResult(_0x3fc3fb,_0x185a01){return function(_0x30bf77){if(_0x30bf77){var _0x3d6dd3=typeof _0x185a01[_0x9a28('0x1d')]===_0x9a28('0x1e')&&typeof _0x185a01[_0x9a28('0x1f')]===_0x9a28('0x1e');var _0x3002d9=_0x30bf77['count'];var _0x168147=_0x3d6dd3?0x0:_0x185a01[_0x9a28('0x1d')];var _0x55e60b=_0x3d6dd3?_0x30bf77[_0x9a28('0x20')]:_0x185a01[_0x9a28('0x1d')]+_0x185a01[_0x9a28('0x1f')];var _0x449927;if(_0x55e60b>=_0x3002d9){_0x55e60b=_0x3002d9;_0x449927=0xc8;}else{_0x449927=0xce;}_0x3fc3fb[_0x9a28('0x1a')](_0x449927);return _0x3fc3fb[_0x9a28('0x21')](_0x9a28('0x22'),_0x168147+'-'+_0x55e60b+'/'+_0x3002d9)[_0x9a28('0x1c')](_0x30bf77);}return null;};}function patchUpdates(_0x5d7b51){return function(_0x2ee944){try{jsonpatch[_0x9a28('0x23')](_0x2ee944,_0x5d7b51,!![]);}catch(_0x481e17){return BPromise[_0x9a28('0x24')](_0x481e17);}return _0x2ee944[_0x9a28('0x25')]();};}function saveUpdates(_0x14d4bf,_0x364724){return function(_0x4f60bb){if(_0x4f60bb){return _0x4f60bb[_0x9a28('0x26')](_0x14d4bf)[_0x9a28('0x27')](function(_0x2a5ff6){return _0x2a5ff6;});}return null;};}function removeEntity(_0x29f97e,_0x48c8e4){return function(_0x4959bf){if(_0x4959bf){return _0x4959bf[_0x9a28('0x28')]()[_0x9a28('0x27')](function(){_0x29f97e[_0x9a28('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6117,_0x38eedc){return function(_0x398d9d){if(!_0x398d9d){_0x2b6117[_0x9a28('0x19')](0x194);}return _0x398d9d;};}function handleError(_0x257554,_0x41e059){_0x41e059=_0x41e059||0x1f4;return function(_0x1750c3){logger[_0x9a28('0x29')](_0x1750c3[_0x9a28('0x2a')]);if(_0x1750c3[_0x9a28('0x2b')]){delete _0x1750c3[_0x9a28('0x2b')];}_0x257554[_0x9a28('0x1a')](_0x41e059)[_0x9a28('0x2c')](_0x1750c3);};}exports['index']=function(_0x59b8bc,_0x1032b8){var _0xf6872a={},_0x2e7473={},_0x293c50={'count':0x0,'rows':[]};var _0x41ec4c=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x2b2a43){return{'name':_0x2b2a43[_0x9a28('0x2d')],'type':_0x2b2a43[_0x9a28('0x2e')][_0x9a28('0x2f')]};});_0x2e7473[_0x9a28('0x30')]=_[_0x9a28('0x31')](_0x41ec4c,'name');_0x2e7473[_0x9a28('0x32')]=_[_0x9a28('0x33')](_0x59b8bc[_0x9a28('0x32')]);_0x2e7473[_0x9a28('0x34')]=_[_0x9a28('0x35')](_0x2e7473[_0x9a28('0x30')],_0x2e7473['query']);_0xf6872a[_0x9a28('0x36')]=_[_0x9a28('0x35')](_0x2e7473[_0x9a28('0x30')],qs['fields'](_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x37')]));_0xf6872a[_0x9a28('0x36')]=_0xf6872a[_0x9a28('0x36')][_0x9a28('0x38')]?_0xf6872a[_0x9a28('0x36')]:_0x2e7473[_0x9a28('0x30')];if(!_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x39')](_0x9a28('0x3a'))){_0xf6872a['limit']=qs[_0x9a28('0x1f')](_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x1f')]);_0xf6872a[_0x9a28('0x1d')]=qs[_0x9a28('0x1d')](_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x1d')]);}_0xf6872a[_0x9a28('0x3b')]=qs[_0x9a28('0x3c')](_0x59b8bc['query'][_0x9a28('0x3c')]);_0xf6872a[_0x9a28('0x3d')]=qs['filters'](_[_0x9a28('0x3e')](_0x59b8bc['query'],_0x2e7473[_0x9a28('0x34')]),_0x41ec4c);if(_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x3f')]){_0xf6872a[_0x9a28('0x3d')]=_[_0x9a28('0x40')](_0xf6872a[_0x9a28('0x3d')],{'$or':_['map'](_0x41ec4c,function(_0x54bc7a){if(_0x54bc7a[_0x9a28('0x2e')]!==_0x9a28('0x41')){var _0x3db4fc={};_0x3db4fc[_0x54bc7a['name']]={'$like':'%'+_0x59b8bc[_0x9a28('0x32')][_0x9a28('0x3f')]+'%'};return _0x3db4fc;}})});}_0xf6872a=_[_0x9a28('0x40')]({},_0xf6872a,_0x59b8bc[_0x9a28('0x42')]);var _0x3120b8={'where':_0xf6872a['where']};return db[_0x9a28('0x43')][_0x9a28('0x20')](_0x3120b8)[_0x9a28('0x27')](function(_0x5a00e0){_0x293c50[_0x9a28('0x20')]=_0x5a00e0;if(_0x59b8bc[_0x9a28('0x32')]['includeAll']){_0xf6872a[_0x9a28('0x44')]=[{'all':!![]}];}return db[_0x9a28('0x43')][_0x9a28('0x45')](_0xf6872a);})[_0x9a28('0x27')](function(_0x8fefde){_0x293c50[_0x9a28('0x46')]=_0x8fefde;return _0x293c50;})[_0x9a28('0x27')](respondWithFilteredResult(_0x1032b8,_0xf6872a))[_0x9a28('0x47')](handleError(_0x1032b8,null));};exports[_0x9a28('0x48')]=function(_0x1a3cb1,_0xbe34e5){var _0x58d8bc={'raw':![],'where':{'id':_0x1a3cb1[_0x9a28('0x49')]['id']}},_0x3e97ec={};_0x3e97ec[_0x9a28('0x30')]=_['keys'](db[_0x9a28('0x43')][_0x9a28('0x4a')]);_0x3e97ec[_0x9a28('0x32')]=_['keys'](_0x1a3cb1[_0x9a28('0x32')]);_0x3e97ec[_0x9a28('0x34')]=_['intersection'](_0x3e97ec[_0x9a28('0x30')],_0x3e97ec[_0x9a28('0x32')]);_0x58d8bc['attributes']=_[_0x9a28('0x35')](_0x3e97ec[_0x9a28('0x30')],qs[_0x9a28('0x37')](_0x1a3cb1['query'][_0x9a28('0x37')]));_0x58d8bc[_0x9a28('0x36')]=_0x58d8bc['attributes']['length']?_0x58d8bc['attributes']:_0x3e97ec[_0x9a28('0x30')];if(_0x1a3cb1[_0x9a28('0x32')][_0x9a28('0x4b')]){_0x58d8bc[_0x9a28('0x44')]=[{'all':!![]}];}_0x58d8bc=_[_0x9a28('0x40')]({},_0x58d8bc,_0x1a3cb1[_0x9a28('0x42')]);return db[_0x9a28('0x43')][_0x9a28('0x4c')](_0x58d8bc)[_0x9a28('0x27')](handleEntityNotFound(_0xbe34e5,null))[_0x9a28('0x27')](respondWithResult(_0xbe34e5,null))[_0x9a28('0x47')](handleError(_0xbe34e5,null));};exports[_0x9a28('0x4d')]=function(_0x3e783d,_0x3488e3){return db[_0x9a28('0x43')][_0x9a28('0x4d')](_0x3e783d[_0x9a28('0x4e')],{})[_0x9a28('0x27')](respondWithResult(_0x3488e3,0xc9))['catch'](handleError(_0x3488e3,null));};exports[_0x9a28('0x26')]=function(_0x387be4,_0x58d68a){if(_0x387be4[_0x9a28('0x4e')]['id']){delete _0x387be4['body']['id'];}return db[_0x9a28('0x43')][_0x9a28('0x4c')]({'where':{'id':_0x387be4[_0x9a28('0x49')]['id']}})[_0x9a28('0x27')](handleEntityNotFound(_0x58d68a,null))[_0x9a28('0x27')](saveUpdates(_0x387be4[_0x9a28('0x4e')],null))['then'](respondWithResult(_0x58d68a,null))[_0x9a28('0x47')](handleError(_0x58d68a,null));};exports['destroy']=function(_0x2aa278,_0x1ce0fc){return db[_0x9a28('0x43')][_0x9a28('0x4c')]({'where':{'id':_0x2aa278['params']['id']}})[_0x9a28('0x27')](handleEntityNotFound(_0x1ce0fc,null))[_0x9a28('0x27')](removeEntity(_0x1ce0fc,null))[_0x9a28('0x47')](handleError(_0x1ce0fc,null));};exports[_0x9a28('0x4f')]=function(_0x51e6b9,_0x74f3f,_0x58b058){var _0x3d6a80={};var _0x4abab2={};var _0x471dee;var _0x7e37c4;return db[_0x9a28('0x43')][_0x9a28('0x50')]({'where':{'id':_0x51e6b9[_0x9a28('0x49')]['id']}})['then'](handleEntityNotFound(_0x74f3f,null))[_0x9a28('0x27')](function(_0x9b99d4){if(_0x9b99d4){_0x471dee=_0x9b99d4;_0x4abab2['model']=_[_0x9a28('0x33')](db['SugarcrmField'][_0x9a28('0x4a')]);_0x4abab2['query']=_['keys'](_0x51e6b9[_0x9a28('0x32')]);_0x4abab2[_0x9a28('0x34')]=_[_0x9a28('0x35')](_0x4abab2[_0x9a28('0x30')],_0x4abab2[_0x9a28('0x32')]);_0x3d6a80[_0x9a28('0x36')]=_[_0x9a28('0x35')](_0x4abab2[_0x9a28('0x30')],qs['fields'](_0x51e6b9[_0x9a28('0x32')][_0x9a28('0x37')]));_0x3d6a80[_0x9a28('0x36')]=_0x3d6a80['attributes'][_0x9a28('0x38')]?_0x3d6a80[_0x9a28('0x36')]:_0x4abab2[_0x9a28('0x30')];_0x3d6a80[_0x9a28('0x3b')]=qs['sort'](_0x51e6b9[_0x9a28('0x32')]['sort']);_0x3d6a80['where']=qs['filters'](_[_0x9a28('0x3e')](_0x51e6b9[_0x9a28('0x32')],_0x4abab2[_0x9a28('0x34')]));if(_0x51e6b9[_0x9a28('0x32')][_0x9a28('0x3f')]){_0x3d6a80[_0x9a28('0x3d')]=_['merge'](_0x3d6a80[_0x9a28('0x3d')],{'$or':_[_0x9a28('0x31')](_0x3d6a80[_0x9a28('0x36')],function(_0x4167f1){var _0x33fc46={};_0x33fc46[_0x4167f1]={'$like':'%'+_0x51e6b9[_0x9a28('0x32')][_0x9a28('0x3f')]+'%'};return _0x33fc46;})});}_0x3d6a80=_[_0x9a28('0x40')]({},_0x3d6a80,_0x51e6b9['options']);return _0x471dee['getFields'](_0x3d6a80);}})['then'](function(_0x303a55){if(_0x303a55){_0x7e37c4=_0x303a55[_0x9a28('0x38')];if(!_0x51e6b9[_0x9a28('0x32')]['hasOwnProperty'](_0x9a28('0x3a'))){_0x3d6a80[_0x9a28('0x1f')]=qs[_0x9a28('0x1f')](_0x51e6b9['query'][_0x9a28('0x1f')]);_0x3d6a80['offset']=qs['offset'](_0x51e6b9[_0x9a28('0x32')][_0x9a28('0x1d')]);}return _0x471dee[_0x9a28('0x4f')](_0x3d6a80);}})['then'](function(_0xe9cd2b){if(_0xe9cd2b){return _0xe9cd2b?{'count':_0x7e37c4,'rows':_0xe9cd2b}:null;}})[_0x9a28('0x27')](respondWithResult(_0x74f3f,null))[_0x9a28('0x47')](handleError(_0x74f3f,null));};exports['getSubjects']=function(_0x3c9b9c,_0xc2c404,_0x176604){var _0x4f0b1a={};var _0x25f212={};var _0x126506;var _0x52cc03;return db[_0x9a28('0x43')][_0x9a28('0x50')]({'where':{'id':_0x3c9b9c['params']['id']}})[_0x9a28('0x27')](handleEntityNotFound(_0xc2c404,null))['then'](function(_0x12bf2a){if(_0x12bf2a){_0x126506=_0x12bf2a;_0x25f212[_0x9a28('0x30')]=_['keys'](db[_0x9a28('0x51')][_0x9a28('0x4a')]);_0x25f212[_0x9a28('0x32')]=_['keys'](_0x3c9b9c['query']);_0x25f212[_0x9a28('0x34')]=_[_0x9a28('0x35')](_0x25f212[_0x9a28('0x30')],_0x25f212[_0x9a28('0x32')]);_0x4f0b1a['attributes']=_[_0x9a28('0x35')](_0x25f212[_0x9a28('0x30')],qs[_0x9a28('0x37')](_0x3c9b9c[_0x9a28('0x32')][_0x9a28('0x37')]));_0x4f0b1a[_0x9a28('0x36')]=_0x4f0b1a[_0x9a28('0x36')][_0x9a28('0x38')]?_0x4f0b1a['attributes']:_0x25f212[_0x9a28('0x30')];_0x4f0b1a[_0x9a28('0x3b')]=qs[_0x9a28('0x3c')](_0x3c9b9c[_0x9a28('0x32')][_0x9a28('0x3c')]);_0x4f0b1a[_0x9a28('0x3d')]=qs[_0x9a28('0x34')](_[_0x9a28('0x3e')](_0x3c9b9c[_0x9a28('0x32')],_0x25f212[_0x9a28('0x34')]));if(_0x3c9b9c[_0x9a28('0x32')]['filter']){_0x4f0b1a[_0x9a28('0x3d')]=_[_0x9a28('0x40')](_0x4f0b1a['where'],{'$or':_[_0x9a28('0x31')](_0x4f0b1a[_0x9a28('0x36')],function(_0x5023e0){var _0x44fc01={};_0x44fc01[_0x5023e0]={'$like':'%'+_0x3c9b9c[_0x9a28('0x32')][_0x9a28('0x3f')]+'%'};return _0x44fc01;})});}_0x4f0b1a=_[_0x9a28('0x40')]({},_0x4f0b1a,_0x3c9b9c[_0x9a28('0x42')]);return _0x126506[_0x9a28('0x52')](_0x4f0b1a);}})[_0x9a28('0x27')](function(_0x818753){if(_0x818753){_0x52cc03=_0x818753[_0x9a28('0x38')];if(!_0x3c9b9c['query'][_0x9a28('0x39')](_0x9a28('0x3a'))){_0x4f0b1a[_0x9a28('0x1f')]=qs[_0x9a28('0x1f')](_0x3c9b9c['query'][_0x9a28('0x1f')]);_0x4f0b1a['offset']=qs[_0x9a28('0x1d')](_0x3c9b9c[_0x9a28('0x32')][_0x9a28('0x1d')]);}return _0x126506[_0x9a28('0x52')](_0x4f0b1a);}})[_0x9a28('0x27')](function(_0x386928){if(_0x386928){return _0x386928?{'count':_0x52cc03,'rows':_0x386928}:null;}})[_0x9a28('0x27')](respondWithResult(_0xc2c404,null))[_0x9a28('0x47')](handleError(_0xc2c404,null));};exports[_0x9a28('0x53')]=function(_0x324ce1,_0x139180,_0x39747d){var _0x1b9077={};var _0x406d33={};var _0x5df3ff;var _0x2808bc;return db[_0x9a28('0x43')]['findOne']({'where':{'id':_0x324ce1[_0x9a28('0x49')]['id']}})[_0x9a28('0x27')](handleEntityNotFound(_0x139180,null))[_0x9a28('0x27')](function(_0xd4bab1){if(_0xd4bab1){_0x5df3ff=_0xd4bab1;_0x406d33[_0x9a28('0x30')]=_[_0x9a28('0x33')](db['SugarcrmField'][_0x9a28('0x4a')]);_0x406d33[_0x9a28('0x32')]=_['keys'](_0x324ce1[_0x9a28('0x32')]);_0x406d33[_0x9a28('0x34')]=_['intersection'](_0x406d33[_0x9a28('0x30')],_0x406d33[_0x9a28('0x32')]);_0x1b9077[_0x9a28('0x36')]=_[_0x9a28('0x35')](_0x406d33['model'],qs[_0x9a28('0x37')](_0x324ce1[_0x9a28('0x32')][_0x9a28('0x37')]));_0x1b9077[_0x9a28('0x36')]=_0x1b9077[_0x9a28('0x36')]['length']?_0x1b9077['attributes']:_0x406d33['model'];_0x1b9077[_0x9a28('0x3b')]=qs[_0x9a28('0x3c')](_0x324ce1[_0x9a28('0x32')][_0x9a28('0x3c')]);_0x1b9077[_0x9a28('0x3d')]=qs['filters'](_[_0x9a28('0x3e')](_0x324ce1[_0x9a28('0x32')],_0x406d33[_0x9a28('0x34')]));if(_0x324ce1[_0x9a28('0x32')][_0x9a28('0x3f')]){_0x1b9077[_0x9a28('0x3d')]=_[_0x9a28('0x40')](_0x1b9077[_0x9a28('0x3d')],{'$or':_[_0x9a28('0x31')](_0x1b9077['attributes'],function(_0xb21673){var _0xb2c7fa={};_0xb2c7fa[_0xb21673]={'$like':'%'+_0x324ce1[_0x9a28('0x32')][_0x9a28('0x3f')]+'%'};return _0xb2c7fa;})});}_0x1b9077=_[_0x9a28('0x40')]({},_0x1b9077,_0x324ce1[_0x9a28('0x42')]);return _0x5df3ff[_0x9a28('0x53')](_0x1b9077);}})[_0x9a28('0x27')](function(_0x440faa){if(_0x440faa){_0x2808bc=_0x440faa['length'];if(!_0x324ce1[_0x9a28('0x32')]['hasOwnProperty'](_0x9a28('0x3a'))){_0x1b9077[_0x9a28('0x1f')]=qs['limit'](_0x324ce1['query'][_0x9a28('0x1f')]);_0x1b9077[_0x9a28('0x1d')]=qs['offset'](_0x324ce1['query'][_0x9a28('0x1d')]);}return _0x5df3ff[_0x9a28('0x53')](_0x1b9077);}})[_0x9a28('0x27')](function(_0x4fe6b1){if(_0x4fe6b1){return _0x4fe6b1?{'count':_0x2808bc,'rows':_0x4fe6b1}:null;}})['then'](respondWithResult(_0x139180,null))[_0x9a28('0x47')](handleError(_0x139180,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 49e6785..458b9dd 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 _0xd8a5=['bluebird','request-promise','path','rimraf','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment'];(function(_0x2ccab9,_0x42969d){var _0x20e296=function(_0x58ef89){while(--_0x58ef89){_0x2ccab9['push'](_0x2ccab9['shift']());}};_0x20e296(++_0x42969d);}(_0xd8a5,0x134));var _0x5d8a=function(_0x290e6b,_0x363257){_0x290e6b=_0x290e6b-0x0;var _0x377506=_0xd8a5[_0x290e6b];return _0x377506;};'use strict';var _=require(_0x5d8a('0x0'));var util=require(_0x5d8a('0x1'));var logger=require(_0x5d8a('0x2'))('api');var moment=require(_0x5d8a('0x3'));var BPromise=require(_0x5d8a('0x4'));var rp=require(_0x5d8a('0x5'));var fs=require('fs');var path=require(_0x5d8a('0x6'));var rimraf=require(_0x5d8a('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x5d8a('0x8')]=function(_0x484a3c,_0x42cc88){return _0x484a3c[_0x5d8a('0x9')](_0x5d8a('0xa'),attributes,{'tableName':_0x5d8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd19=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api'];(function(_0x59cea3,_0xba8b5d){var _0x1ea4c0=function(_0x2f2fb2){while(--_0x2f2fb2){_0x59cea3['push'](_0x59cea3['shift']());}};_0x1ea4c0(++_0xba8b5d);}(_0xdd19,0x107));var _0x9dd1=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xdd19[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0x9dd1('0x0'));var logger=require(_0x9dd1('0x1'))(_0x9dd1('0x2'));var moment=require(_0x9dd1('0x3'));var BPromise=require(_0x9dd1('0x4'));var rp=require(_0x9dd1('0x5'));var fs=require('fs');var path=require(_0x9dd1('0x6'));var rimraf=require(_0x9dd1('0x7'));var config=require(_0x9dd1('0x8'));var attributes=require(_0x9dd1('0x9'));module[_0x9dd1('0xa')]=function(_0x21b496,_0x11f949){return _0x21b496[_0x9dd1('0xb')](_0x9dd1('0xc'),attributes,{'tableName':_0x9dd1('0xd'),'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 09ccbd9..46ddd7e 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 _0xf27d=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0xf27d,0xa2));var _0xdf27=function(_0x11618a,_0x3308e3){_0x11618a=_0x11618a-0x0;var _0xb81fa9=_0xf27d[_0x11618a];return _0xb81fa9;};'use strict';var _=require(_0xdf27('0x0'));var util=require(_0xdf27('0x1'));var moment=require(_0xdf27('0x2'));var BPromise=require(_0xdf27('0x3'));var rs=require(_0xdf27('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf27('0x5'))['db'];var utils=require(_0xdf27('0x6'));var logger=require('../../config/logger')(_0xdf27('0x7'));var config=require(_0xdf27('0x8'));var jayson=require(_0xdf27('0x9'));var client=jayson[_0xdf27('0xa')][_0xdf27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x371b9e,_0xa21ff3,_0x55f955){return new BPromise(function(_0x3ae68f,_0x55d9b4){return client[_0xdf27('0xc')](_0x371b9e,_0x55f955)[_0xdf27('0xd')](function(_0x5d01b8){logger[_0xdf27('0xe')](_0xdf27('0xf'),_0xa21ff3,_0xdf27('0x10'));logger[_0xdf27('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xa21ff3,'request\x20sent',JSON[_0xdf27('0x12')](_0x5d01b8));if(_0x5d01b8[_0xdf27('0x13')]){if(_0x5d01b8[_0xdf27('0x13')][_0xdf27('0x14')]===0x1f4){logger[_0xdf27('0x13')](_0xdf27('0xf'),_0xa21ff3,_0x5d01b8[_0xdf27('0x13')][_0xdf27('0x15')]);return _0x55d9b4(_0x5d01b8[_0xdf27('0x13')]['message']);}logger[_0xdf27('0x13')](_0xdf27('0xf'),_0xa21ff3,_0x5d01b8[_0xdf27('0x13')][_0xdf27('0x15')]);return _0x3ae68f(_0x5d01b8[_0xdf27('0x13')][_0xdf27('0x15')]);}else{logger['info'](_0xdf27('0xf'),_0xa21ff3,'request\x20sent');_0x3ae68f(_0x5d01b8[_0xdf27('0x16')]['message']);}})[_0xdf27('0x17')](function(_0x4bd77d){logger[_0xdf27('0x13')](_0xdf27('0xf'),_0xa21ff3,_0x4bd77d);_0x55d9b4(_0x4bd77d);});});} \ No newline at end of file +var _0x94eb=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x257896,_0x8de612){var _0x1ff242=function(_0x8ea06a){while(--_0x8ea06a){_0x257896['push'](_0x257896['shift']());}};_0x1ff242(++_0x8de612);}(_0x94eb,0x8c));var _0xb94e=function(_0x2dcbf8,_0x371e68){_0x2dcbf8=_0x2dcbf8-0x0;var _0x3d09f3=_0x94eb[_0x2dcbf8];return _0x3d09f3;};'use strict';var _=require(_0xb94e('0x0'));var util=require(_0xb94e('0x1'));var moment=require(_0xb94e('0x2'));var BPromise=require(_0xb94e('0x3'));var rs=require(_0xb94e('0x4'));var fs=require('fs');var Redis=require(_0xb94e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb94e('0x6'));var logger=require(_0xb94e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb94e('0x8'));var client=jayson['client'][_0xb94e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80d0f9,_0x433034,_0x4de3fa){return new BPromise(function(_0x2bba42,_0x4b756e){return client['request'](_0x80d0f9,_0x4de3fa)[_0xb94e('0xa')](function(_0x1af8a1){logger['info'](_0xb94e('0xb'),_0x433034,_0xb94e('0xc'));logger['debug'](_0xb94e('0xd'),_0x433034,_0xb94e('0xc'),JSON[_0xb94e('0xe')](_0x1af8a1));if(_0x1af8a1['error']){if(_0x1af8a1[_0xb94e('0xf')]['code']===0x1f4){logger['error'](_0xb94e('0xb'),_0x433034,_0x1af8a1[_0xb94e('0xf')][_0xb94e('0x10')]);return _0x4b756e(_0x1af8a1[_0xb94e('0xf')][_0xb94e('0x10')]);}logger['error'](_0xb94e('0xb'),_0x433034,_0x1af8a1[_0xb94e('0xf')][_0xb94e('0x10')]);return _0x2bba42(_0x1af8a1['error'][_0xb94e('0x10')]);}else{logger[_0xb94e('0x11')](_0xb94e('0xb'),_0x433034,_0xb94e('0xc'));_0x2bba42(_0x1af8a1[_0xb94e('0x12')][_0xb94e('0x10')]);}})[_0xb94e('0x13')](function(_0x56b444){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x433034,_0x56b444);_0x4b756e(_0x56b444);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e28105c..b58fd4d 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 _0x0ccf=['put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x0ccf,0xe1));var _0xf0cc=function(_0x3abdf1,_0xbf6648){_0x3abdf1=_0x3abdf1-0x0;var _0x160b12=_0x0ccf[_0x3abdf1];return _0x160b12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf0cc('0x0'));var timeout=require(_0xf0cc('0x1'));var express=require(_0xf0cc('0x2'));var router=express[_0xf0cc('0x3')]();var fs_extra=require(_0xf0cc('0x4'));var auth=require(_0xf0cc('0x5'));var interaction=require(_0xf0cc('0x6'));var config=require(_0xf0cc('0x7'));var controller=require('./intSugarcrmField.controller');router[_0xf0cc('0x8')]('/',auth['isAuthenticated'](),controller[_0xf0cc('0x9')]);router[_0xf0cc('0x8')](_0xf0cc('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf0cc('0xb')](),controller[_0xf0cc('0xc')]);router[_0xf0cc('0xd')](_0xf0cc('0xa'),auth[_0xf0cc('0xb')](),controller[_0xf0cc('0xe')]);router['delete'](_0xf0cc('0xa'),auth['isAuthenticated'](),controller[_0xf0cc('0xf')]);module[_0xf0cc('0x10')]=router; \ No newline at end of file +var _0xaed9=['connect-timeout','Router','fs-extra','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3302a6,_0x4d7c36){var _0x5433dd=function(_0x2fb83b){while(--_0x2fb83b){_0x3302a6['push'](_0x3302a6['shift']());}};_0x5433dd(++_0x4d7c36);}(_0xaed9,0x1eb));var _0x9aed=function(_0x54783e,_0xe85a52){_0x54783e=_0x54783e-0x0;var _0x4b03f4=_0xaed9[_0x54783e];return _0x4b03f4;};'use strict';var multer=require(_0x9aed('0x0'));var util=require(_0x9aed('0x1'));var path=require('path');var timeout=require(_0x9aed('0x2'));var express=require('express');var router=express[_0x9aed('0x3')]();var fs_extra=require(_0x9aed('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9aed('0x5'));router[_0x9aed('0x6')]('/',auth[_0x9aed('0x7')](),controller[_0x9aed('0x8')]);router['get'](_0x9aed('0x9'),auth[_0x9aed('0x7')](),controller[_0x9aed('0xa')]);router[_0x9aed('0xb')]('/',auth[_0x9aed('0x7')](),controller[_0x9aed('0xc')]);router['put'](_0x9aed('0x9'),auth[_0x9aed('0x7')](),controller[_0x9aed('0xd')]);router[_0x9aed('0xe')](_0x9aed('0x9'),auth['isAuthenticated'](),controller[_0x9aed('0xf')]);module[_0x9aed('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e518992..40f624a 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 _0x408e=['BOOLEAN','sequelize','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x38963f,_0x3c6b68){var _0x294a20=function(_0xdfc75){while(--_0xdfc75){_0x38963f['push'](_0x38963f['shift']());}};_0x294a20(++_0x3c6b68);}(_0x408e,0x18d));var _0xe408=function(_0x311aad,_0x54d658){_0x311aad=_0x311aad-0x0;var _0x1779bd=_0x408e[_0x311aad];return _0x1779bd;};'use strict';var Sequelize=require(_0xe408('0x0'));module['exports']={'type':{'type':Sequelize[_0xe408('0x1')](_0xe408('0x2'),_0xe408('0x3'),'customVariable',_0xe408('0x4'),_0xe408('0x5')),'defaultValue':_0xe408('0x2')},'content':{'type':Sequelize[_0xe408('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xe408('0x3'),_0xe408('0x7'))},'keyContent':{'type':Sequelize[_0xe408('0x6')]},'idField':{'type':Sequelize[_0xe408('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe408('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe408('0x6')]}}; \ No newline at end of file +var _0x88e5=['string','customVariable','picklist','STRING','variable','BOOLEAN','exports','ENUM'];(function(_0x3de59f,_0x38ee89){var _0x1363fc=function(_0x2fb89c){while(--_0x2fb89c){_0x3de59f['push'](_0x3de59f['shift']());}};_0x1363fc(++_0x38ee89);}(_0x88e5,0xf6));var _0x588e=function(_0x38218d,_0x487a3d){_0x38218d=_0x38218d-0x0;var _0x273c9c=_0x88e5[_0x38218d];return _0x273c9c;};'use strict';var Sequelize=require('sequelize');module[_0x588e('0x0')]={'type':{'type':Sequelize[_0x588e('0x1')](_0x588e('0x2'),'variable',_0x588e('0x3'),'keyValue',_0x588e('0x4')),'defaultValue':_0x588e('0x2')},'content':{'type':Sequelize[_0x588e('0x5')]},'key':{'type':Sequelize[_0x588e('0x5')]},'keyType':{'type':Sequelize[_0x588e('0x1')](_0x588e('0x2'),_0x588e('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x588e('0x5')]},'idField':{'type':Sequelize[_0x588e('0x5')]},'nameField':{'type':Sequelize[_0x588e('0x5')]},'customField':{'type':Sequelize[_0x588e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x588e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index ab49324..abccd86 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 _0xdc9e=['rawAttributes','fieldName','type','key','model','map','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','reject','save','then','destroy','error','stack','name','send','index','SugarcrmField'];(function(_0x3b5170,_0x1bc38c){var _0x3afd14=function(_0x15af13){while(--_0x15af13){_0x3b5170['push'](_0x3b5170['shift']());}};_0x3afd14(++_0x1bc38c);}(_0xdc9e,0xc0));var _0xedc9=function(_0xcfa2e0,_0x40dd3d){_0xcfa2e0=_0xcfa2e0-0x0;var _0x1dc2b1=_0xdc9e[_0xcfa2e0];return _0x1dc2b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xedc9('0x0'));var jsonpatch=require(_0xedc9('0x1'));var rp=require(_0xedc9('0x2'));var moment=require(_0xedc9('0x3'));var BPromise=require(_0xedc9('0x4'));var Mustache=require(_0xedc9('0x5'));var util=require(_0xedc9('0x6'));var path=require(_0xedc9('0x7'));var sox=require(_0xedc9('0x8'));var csv=require(_0xedc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedc9('0xa'));var _=require(_0xedc9('0xb'));var squel=require(_0xedc9('0xc'));var crypto=require(_0xedc9('0xd'));var jsforce=require(_0xedc9('0xe'));var deskjs=require(_0xedc9('0xf'));var toCsv=require(_0xedc9('0x9'));var querystring=require(_0xedc9('0x10'));var Papa=require(_0xedc9('0x11'));var Redis=require(_0xedc9('0x12'));var authService=require(_0xedc9('0x13'));var qs=require(_0xedc9('0x14'));var as=require(_0xedc9('0x15'));var hardwareService=require(_0xedc9('0x16'));var logger=require(_0xedc9('0x17'))(_0xedc9('0x18'));var utils=require(_0xedc9('0x19'));var config=require(_0xedc9('0x1a'));var licenseUtil=require(_0xedc9('0x1b'));var db=require(_0xedc9('0x1c'))['db'];function respondWithStatusCode(_0x375c8c,_0x4d1dbf){_0x4d1dbf=_0x4d1dbf||0xcc;return function(_0x3cd214){if(_0x3cd214){return _0x375c8c[_0xedc9('0x1d')](_0x4d1dbf);}return _0x375c8c['status'](_0x4d1dbf)[_0xedc9('0x1e')]();};}function respondWithResult(_0x36f4be,_0x1b1997){_0x1b1997=_0x1b1997||0xc8;return function(_0xf3bd79){if(_0xf3bd79){return _0x36f4be[_0xedc9('0x1f')](_0x1b1997)[_0xedc9('0x20')](_0xf3bd79);}};}function respondWithFilteredResult(_0x13b8ad,_0x33df29){return function(_0x501207){if(_0x501207){var _0x40b799=typeof _0x33df29['offset']==='undefined'&&typeof _0x33df29[_0xedc9('0x21')]===_0xedc9('0x22');var _0x288328=_0x501207[_0xedc9('0x23')];var _0x4aa88a=_0x40b799?0x0:_0x33df29[_0xedc9('0x24')];var _0x52f789=_0x40b799?_0x501207[_0xedc9('0x23')]:_0x33df29[_0xedc9('0x24')]+_0x33df29[_0xedc9('0x21')];var _0x355abf;if(_0x52f789>=_0x288328){_0x52f789=_0x288328;_0x355abf=0xc8;}else{_0x355abf=0xce;}_0x13b8ad[_0xedc9('0x1f')](_0x355abf);return _0x13b8ad['set'](_0xedc9('0x25'),_0x4aa88a+'-'+_0x52f789+'/'+_0x288328)[_0xedc9('0x20')](_0x501207);}return null;};}function patchUpdates(_0x59f3e5){return function(_0x34dea0){try{jsonpatch['apply'](_0x34dea0,_0x59f3e5,!![]);}catch(_0x4abe56){return BPromise[_0xedc9('0x26')](_0x4abe56);}return _0x34dea0[_0xedc9('0x27')]();};}function saveUpdates(_0x2a9681,_0x9a0fa2){return function(_0x28c46a){if(_0x28c46a){return _0x28c46a['update'](_0x2a9681)[_0xedc9('0x28')](function(_0x41c05f){return _0x41c05f;});}return null;};}function removeEntity(_0x40b5f1,_0x4bca19){return function(_0x1dd257){if(_0x1dd257){return _0x1dd257[_0xedc9('0x29')]()['then'](function(){_0x40b5f1[_0xedc9('0x1f')](0xcc)[_0xedc9('0x1e')]();});}};}function handleEntityNotFound(_0x26e26c,_0x25fa06){return function(_0x2b960d){if(!_0x2b960d){_0x26e26c[_0xedc9('0x1d')](0x194);}return _0x2b960d;};}function handleError(_0x2f323d,_0x1fee15){_0x1fee15=_0x1fee15||0x1f4;return function(_0x1156ea){logger[_0xedc9('0x2a')](_0x1156ea[_0xedc9('0x2b')]);if(_0x1156ea[_0xedc9('0x2c')]){delete _0x1156ea[_0xedc9('0x2c')];}_0x2f323d[_0xedc9('0x1f')](_0x1fee15)[_0xedc9('0x2d')](_0x1156ea);};}exports[_0xedc9('0x2e')]=function(_0x3ac256,_0x438cb2){var _0x2e7baf={},_0x20af03={},_0x5f47ad={'count':0x0,'rows':[]};var _0x169b0b=_['map'](db[_0xedc9('0x2f')][_0xedc9('0x30')],function(_0x37be0b){return{'name':_0x37be0b[_0xedc9('0x31')],'type':_0x37be0b[_0xedc9('0x32')][_0xedc9('0x33')]};});_0x20af03[_0xedc9('0x34')]=_[_0xedc9('0x35')](_0x169b0b,_0xedc9('0x2c'));_0x20af03['query']=_['keys'](_0x3ac256['query']);_0x20af03[_0xedc9('0x36')]=_['intersection'](_0x20af03['model'],_0x20af03[_0xedc9('0x37')]);_0x2e7baf['attributes']=_[_0xedc9('0x38')](_0x20af03['model'],qs[_0xedc9('0x39')](_0x3ac256[_0xedc9('0x37')]['fields']));_0x2e7baf[_0xedc9('0x3a')]=_0x2e7baf[_0xedc9('0x3a')][_0xedc9('0x3b')]?_0x2e7baf['attributes']:_0x20af03[_0xedc9('0x34')];if(!_0x3ac256[_0xedc9('0x37')][_0xedc9('0x3c')](_0xedc9('0x3d'))){_0x2e7baf[_0xedc9('0x21')]=qs[_0xedc9('0x21')](_0x3ac256[_0xedc9('0x37')][_0xedc9('0x21')]);_0x2e7baf['offset']=qs[_0xedc9('0x24')](_0x3ac256[_0xedc9('0x37')]['offset']);}_0x2e7baf[_0xedc9('0x3e')]=qs['sort'](_0x3ac256['query'][_0xedc9('0x3f')]);_0x2e7baf[_0xedc9('0x40')]=qs[_0xedc9('0x36')](_['pick'](_0x3ac256['query'],_0x20af03[_0xedc9('0x36')]),_0x169b0b);if(_0x3ac256[_0xedc9('0x37')][_0xedc9('0x41')]){_0x2e7baf['where']=_[_0xedc9('0x42')](_0x2e7baf[_0xedc9('0x40')],{'$or':_[_0xedc9('0x35')](_0x169b0b,function(_0x5e5e5c){if(_0x5e5e5c[_0xedc9('0x32')]!==_0xedc9('0x43')){var _0x128075={};_0x128075[_0x5e5e5c[_0xedc9('0x2c')]]={'$like':'%'+_0x3ac256[_0xedc9('0x37')][_0xedc9('0x41')]+'%'};return _0x128075;}})});}_0x2e7baf=_[_0xedc9('0x42')]({},_0x2e7baf,_0x3ac256[_0xedc9('0x44')]);var _0x485320={'where':_0x2e7baf['where']};return db[_0xedc9('0x2f')][_0xedc9('0x23')](_0x485320)['then'](function(_0x359c26){_0x5f47ad[_0xedc9('0x23')]=_0x359c26;if(_0x3ac256[_0xedc9('0x37')][_0xedc9('0x45')]){_0x2e7baf[_0xedc9('0x46')]=[{'all':!![]}];}return db[_0xedc9('0x2f')][_0xedc9('0x47')](_0x2e7baf);})[_0xedc9('0x28')](function(_0x17ba6c){_0x5f47ad[_0xedc9('0x48')]=_0x17ba6c;return _0x5f47ad;})[_0xedc9('0x28')](respondWithFilteredResult(_0x438cb2,_0x2e7baf))[_0xedc9('0x49')](handleError(_0x438cb2,null));};exports[_0xedc9('0x4a')]=function(_0x362bed,_0x454baf){var _0x4afbfc={'raw':!![],'where':{'id':_0x362bed[_0xedc9('0x4b')]['id']}},_0x2df14a={};_0x2df14a['model']=_[_0xedc9('0x4c')](db[_0xedc9('0x2f')][_0xedc9('0x30')]);_0x2df14a['query']=_['keys'](_0x362bed[_0xedc9('0x37')]);_0x2df14a['filters']=_[_0xedc9('0x38')](_0x2df14a['model'],_0x2df14a[_0xedc9('0x37')]);_0x4afbfc['attributes']=_['intersection'](_0x2df14a[_0xedc9('0x34')],qs[_0xedc9('0x39')](_0x362bed['query'][_0xedc9('0x39')]));_0x4afbfc[_0xedc9('0x3a')]=_0x4afbfc['attributes'][_0xedc9('0x3b')]?_0x4afbfc[_0xedc9('0x3a')]:_0x2df14a[_0xedc9('0x34')];if(_0x362bed[_0xedc9('0x37')]['includeAll']){_0x4afbfc[_0xedc9('0x46')]=[{'all':!![]}];}_0x4afbfc=_[_0xedc9('0x42')]({},_0x4afbfc,_0x362bed[_0xedc9('0x44')]);return db['SugarcrmField'][_0xedc9('0x4d')](_0x4afbfc)[_0xedc9('0x28')](handleEntityNotFound(_0x454baf,null))[_0xedc9('0x28')](respondWithResult(_0x454baf,null))[_0xedc9('0x49')](handleError(_0x454baf,null));};exports[_0xedc9('0x4e')]=function(_0x498e73,_0x124536){return db[_0xedc9('0x2f')][_0xedc9('0x4e')](_0x498e73[_0xedc9('0x4f')],{})['then'](respondWithResult(_0x124536,0xc9))['catch'](handleError(_0x124536,null));};exports['update']=function(_0x3e7c35,_0x53a0b3){if(_0x3e7c35['body']['id']){delete _0x3e7c35[_0xedc9('0x4f')]['id'];}return db[_0xedc9('0x2f')][_0xedc9('0x4d')]({'where':{'id':_0x3e7c35[_0xedc9('0x4b')]['id']}})[_0xedc9('0x28')](handleEntityNotFound(_0x53a0b3,null))[_0xedc9('0x28')](saveUpdates(_0x3e7c35['body'],null))[_0xedc9('0x28')](respondWithResult(_0x53a0b3,null))[_0xedc9('0x49')](handleError(_0x53a0b3,null));};exports[_0xedc9('0x29')]=function(_0x6bcc60,_0x1adfb3){return db[_0xedc9('0x2f')][_0xedc9('0x4d')]({'where':{'id':_0x6bcc60['params']['id']}})[_0xedc9('0x28')](handleEntityNotFound(_0x1adfb3,null))['then'](removeEntity(_0x1adfb3,null))[_0xedc9('0x49')](handleError(_0x1adfb3,null));}; \ No newline at end of file +var _0xa066=['set','apply','reject','save','then','destroy','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x145a69,_0x243b63){var _0x34ebfb=function(_0x29bfca){while(--_0x29bfca){_0x145a69['push'](_0x145a69['shift']());}};_0x34ebfb(++_0x243b63);}(_0xa066,0xc1));var _0x6a06=function(_0x223af8,_0x58016f){_0x223af8=_0x223af8-0x0;var _0x4699f=_0xa066[_0x223af8];return _0x4699f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a06('0x0'));var zipdir=require(_0x6a06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6a06('0x2'));var BPromise=require(_0x6a06('0x3'));var Mustache=require(_0x6a06('0x4'));var util=require(_0x6a06('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x6a06('0x6'));var ejs=require(_0x6a06('0x7'));var fs=require('fs');var fs_extra=require(_0x6a06('0x8'));var _=require(_0x6a06('0x9'));var squel=require(_0x6a06('0xa'));var crypto=require(_0x6a06('0xb'));var jsforce=require(_0x6a06('0xc'));var deskjs=require(_0x6a06('0xd'));var toCsv=require(_0x6a06('0x6'));var querystring=require('querystring');var Papa=require(_0x6a06('0xe'));var Redis=require(_0x6a06('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6a06('0x10'));var as=require(_0x6a06('0x11'));var hardwareService=require(_0x6a06('0x12'));var logger=require(_0x6a06('0x13'))(_0x6a06('0x14'));var utils=require(_0x6a06('0x15'));var config=require(_0x6a06('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a06('0x17'))['db'];function respondWithStatusCode(_0x5dc120,_0x2133cf){_0x2133cf=_0x2133cf||0xcc;return function(_0x3dd7ec){if(_0x3dd7ec){return _0x5dc120[_0x6a06('0x18')](_0x2133cf);}return _0x5dc120['status'](_0x2133cf)[_0x6a06('0x19')]();};}function respondWithResult(_0x1b1c02,_0x105535){_0x105535=_0x105535||0xc8;return function(_0x353202){if(_0x353202){return _0x1b1c02[_0x6a06('0x1a')](_0x105535)[_0x6a06('0x1b')](_0x353202);}};}function respondWithFilteredResult(_0x58deda,_0xad3996){return function(_0x3151e4){if(_0x3151e4){var _0x3332cd=typeof _0xad3996[_0x6a06('0x1c')]===_0x6a06('0x1d')&&typeof _0xad3996[_0x6a06('0x1e')]===_0x6a06('0x1d');var _0x27be96=_0x3151e4[_0x6a06('0x1f')];var _0x35a521=_0x3332cd?0x0:_0xad3996[_0x6a06('0x1c')];var _0x5bd3b8=_0x3332cd?_0x3151e4['count']:_0xad3996[_0x6a06('0x1c')]+_0xad3996[_0x6a06('0x1e')];var _0x2a893e;if(_0x5bd3b8>=_0x27be96){_0x5bd3b8=_0x27be96;_0x2a893e=0xc8;}else{_0x2a893e=0xce;}_0x58deda[_0x6a06('0x1a')](_0x2a893e);return _0x58deda[_0x6a06('0x20')]('Content-Range',_0x35a521+'-'+_0x5bd3b8+'/'+_0x27be96)[_0x6a06('0x1b')](_0x3151e4);}return null;};}function patchUpdates(_0x23bb86){return function(_0x4d6113){try{jsonpatch[_0x6a06('0x21')](_0x4d6113,_0x23bb86,!![]);}catch(_0x241b3e){return BPromise[_0x6a06('0x22')](_0x241b3e);}return _0x4d6113[_0x6a06('0x23')]();};}function saveUpdates(_0x284b8a,_0x5a04ff){return function(_0x36a892){if(_0x36a892){return _0x36a892['update'](_0x284b8a)[_0x6a06('0x24')](function(_0x494350){return _0x494350;});}return null;};}function removeEntity(_0x57efce,_0x49f4bb){return function(_0x1c3fc7){if(_0x1c3fc7){return _0x1c3fc7[_0x6a06('0x25')]()[_0x6a06('0x24')](function(){_0x57efce[_0x6a06('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a70fc,_0x234f73){return function(_0x1d3386){if(!_0x1d3386){_0x5a70fc[_0x6a06('0x18')](0x194);}return _0x1d3386;};}function handleError(_0x5705a1,_0x39733f){_0x39733f=_0x39733f||0x1f4;return function(_0x25301c){logger['error'](_0x25301c[_0x6a06('0x26')]);if(_0x25301c[_0x6a06('0x27')]){delete _0x25301c['name'];}_0x5705a1[_0x6a06('0x1a')](_0x39733f)[_0x6a06('0x28')](_0x25301c);};}exports[_0x6a06('0x29')]=function(_0x12043e,_0x5dc1d9){var _0x453207={},_0x3bc266={},_0x5a47fd={'count':0x0,'rows':[]};var _0x38b494=_['map'](db[_0x6a06('0x2a')][_0x6a06('0x2b')],function(_0x1417d9){return{'name':_0x1417d9[_0x6a06('0x2c')],'type':_0x1417d9[_0x6a06('0x2d')]['key']};});_0x3bc266[_0x6a06('0x2e')]=_['map'](_0x38b494,'name');_0x3bc266[_0x6a06('0x2f')]=_[_0x6a06('0x30')](_0x12043e[_0x6a06('0x2f')]);_0x3bc266['filters']=_[_0x6a06('0x31')](_0x3bc266['model'],_0x3bc266['query']);_0x453207['attributes']=_[_0x6a06('0x31')](_0x3bc266[_0x6a06('0x2e')],qs['fields'](_0x12043e['query'][_0x6a06('0x32')]));_0x453207[_0x6a06('0x33')]=_0x453207[_0x6a06('0x33')]['length']?_0x453207['attributes']:_0x3bc266[_0x6a06('0x2e')];if(!_0x12043e[_0x6a06('0x2f')][_0x6a06('0x34')](_0x6a06('0x35'))){_0x453207[_0x6a06('0x1e')]=qs[_0x6a06('0x1e')](_0x12043e['query'][_0x6a06('0x1e')]);_0x453207[_0x6a06('0x1c')]=qs[_0x6a06('0x1c')](_0x12043e[_0x6a06('0x2f')][_0x6a06('0x1c')]);}_0x453207[_0x6a06('0x36')]=qs[_0x6a06('0x37')](_0x12043e[_0x6a06('0x2f')][_0x6a06('0x37')]);_0x453207[_0x6a06('0x38')]=qs[_0x6a06('0x39')](_[_0x6a06('0x3a')](_0x12043e[_0x6a06('0x2f')],_0x3bc266[_0x6a06('0x39')]),_0x38b494);if(_0x12043e['query']['filter']){_0x453207[_0x6a06('0x38')]=_[_0x6a06('0x3b')](_0x453207['where'],{'$or':_[_0x6a06('0x3c')](_0x38b494,function(_0x1a08c1){if(_0x1a08c1[_0x6a06('0x2d')]!==_0x6a06('0x3d')){var _0x44f31e={};_0x44f31e[_0x1a08c1['name']]={'$like':'%'+_0x12043e[_0x6a06('0x2f')][_0x6a06('0x3e')]+'%'};return _0x44f31e;}})});}_0x453207=_[_0x6a06('0x3b')]({},_0x453207,_0x12043e[_0x6a06('0x3f')]);var _0x50658f={'where':_0x453207[_0x6a06('0x38')]};return db[_0x6a06('0x2a')]['count'](_0x50658f)[_0x6a06('0x24')](function(_0x37e254){_0x5a47fd[_0x6a06('0x1f')]=_0x37e254;if(_0x12043e[_0x6a06('0x2f')][_0x6a06('0x40')]){_0x453207[_0x6a06('0x41')]=[{'all':!![]}];}return db[_0x6a06('0x2a')][_0x6a06('0x42')](_0x453207);})[_0x6a06('0x24')](function(_0x24737d){_0x5a47fd[_0x6a06('0x43')]=_0x24737d;return _0x5a47fd;})[_0x6a06('0x24')](respondWithFilteredResult(_0x5dc1d9,_0x453207))['catch'](handleError(_0x5dc1d9,null));};exports[_0x6a06('0x44')]=function(_0x4b0067,_0x1ebe07){var _0xb2a27b={'raw':!![],'where':{'id':_0x4b0067[_0x6a06('0x45')]['id']}},_0x304d57={};_0x304d57[_0x6a06('0x2e')]=_[_0x6a06('0x30')](db[_0x6a06('0x2a')][_0x6a06('0x2b')]);_0x304d57[_0x6a06('0x2f')]=_[_0x6a06('0x30')](_0x4b0067[_0x6a06('0x2f')]);_0x304d57[_0x6a06('0x39')]=_[_0x6a06('0x31')](_0x304d57[_0x6a06('0x2e')],_0x304d57[_0x6a06('0x2f')]);_0xb2a27b[_0x6a06('0x33')]=_['intersection'](_0x304d57[_0x6a06('0x2e')],qs[_0x6a06('0x32')](_0x4b0067[_0x6a06('0x2f')]['fields']));_0xb2a27b[_0x6a06('0x33')]=_0xb2a27b[_0x6a06('0x33')]['length']?_0xb2a27b[_0x6a06('0x33')]:_0x304d57[_0x6a06('0x2e')];if(_0x4b0067['query'][_0x6a06('0x40')]){_0xb2a27b[_0x6a06('0x41')]=[{'all':!![]}];}_0xb2a27b=_[_0x6a06('0x3b')]({},_0xb2a27b,_0x4b0067[_0x6a06('0x3f')]);return db[_0x6a06('0x2a')][_0x6a06('0x46')](_0xb2a27b)['then'](handleEntityNotFound(_0x1ebe07,null))[_0x6a06('0x24')](respondWithResult(_0x1ebe07,null))[_0x6a06('0x47')](handleError(_0x1ebe07,null));};exports[_0x6a06('0x48')]=function(_0x28376a,_0x5140b6){return db[_0x6a06('0x2a')][_0x6a06('0x48')](_0x28376a[_0x6a06('0x49')],{})[_0x6a06('0x24')](respondWithResult(_0x5140b6,0xc9))[_0x6a06('0x47')](handleError(_0x5140b6,null));};exports[_0x6a06('0x4a')]=function(_0x172020,_0x2e69c9){if(_0x172020[_0x6a06('0x49')]['id']){delete _0x172020[_0x6a06('0x49')]['id'];}return db[_0x6a06('0x2a')][_0x6a06('0x46')]({'where':{'id':_0x172020['params']['id']}})['then'](handleEntityNotFound(_0x2e69c9,null))[_0x6a06('0x24')](saveUpdates(_0x172020['body'],null))[_0x6a06('0x24')](respondWithResult(_0x2e69c9,null))['catch'](handleError(_0x2e69c9,null));};exports[_0x6a06('0x25')]=function(_0x26ff57,_0x313a4c){return db['SugarcrmField'][_0x6a06('0x46')]({'where':{'id':_0x26ff57[_0x6a06('0x45')]['id']}})['then'](handleEntityNotFound(_0x313a4c,null))[_0x6a06('0x24')](removeEntity(_0x313a4c,null))[_0x6a06('0x47')](handleError(_0x313a4c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5feb34f..de0c8da 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 _0x201a=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','path','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x45de25,_0x1fa0a2){var _0x783497=function(_0x3b6858){while(--_0x3b6858){_0x45de25['push'](_0x45de25['shift']());}};_0x783497(++_0x1fa0a2);}(_0x201a,0x102));var _0xa201=function(_0x557d47,_0x34c5a2){_0x557d47=_0x557d47-0x0;var _0x342b74=_0x201a[_0x557d47];return _0x342b74;};'use strict';var _=require(_0xa201('0x0'));var util=require(_0xa201('0x1'));var logger=require('../../config/logger')(_0xa201('0x2'));var moment=require(_0xa201('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa201('0x4'));var rimraf=require('rimraf');var config=require(_0xa201('0x5'));var attributes=require(_0xa201('0x6'));module[_0xa201('0x7')]=function(_0x1744d7,_0x16ee6e){return _0x1744d7[_0xa201('0x8')](_0xa201('0x9'),attributes,{'tableName':_0xa201('0xa'),'paranoid':![],'indexes':[{'name':_0xa201('0xb'),'fields':[_0xa201('0xc'),_0xa201('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbb54=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x287528,_0x2fbba7){var _0xc05e28=function(_0x264866){while(--_0x264866){_0x287528['push'](_0x287528['shift']());}};_0xc05e28(++_0x2fbba7);}(_0xbb54,0x1f4));var _0x4bb5=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0xbb54[_0x2eec1f];return _0x543075;};'use strict';var _=require(_0x4bb5('0x0'));var util=require(_0x4bb5('0x1'));var logger=require(_0x4bb5('0x2'))('api');var moment=require(_0x4bb5('0x3'));var BPromise=require('bluebird');var rp=require(_0x4bb5('0x4'));var fs=require('fs');var path=require(_0x4bb5('0x5'));var rimraf=require(_0x4bb5('0x6'));var config=require(_0x4bb5('0x7'));var attributes=require(_0x4bb5('0x8'));module[_0x4bb5('0x9')]=function(_0x1f5982,_0x324164){return _0x1f5982[_0x4bb5('0xa')](_0x4bb5('0xb'),attributes,{'tableName':_0x4bb5('0xc'),'paranoid':![],'indexes':[{'name':_0x4bb5('0xd'),'fields':[_0x4bb5('0xe'),'FieldId'],'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 3e5ee58..2b642b1 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 _0x1cab=['util','moment','bluebird','ioredis','../../config/logger','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2d9f7f,_0x3e4f01){var _0x47de15=function(_0x22c42e){while(--_0x22c42e){_0x2d9f7f['push'](_0x2d9f7f['shift']());}};_0x47de15(++_0x3e4f01);}(_0x1cab,0x1b5));var _0xb1ca=function(_0x4c2649,_0xdbe427){_0x4c2649=_0x4c2649-0x0;var _0x2b3041=_0x1cab[_0x4c2649];return _0x2b3041;};'use strict';var _=require('lodash');var util=require(_0xb1ca('0x0'));var moment=require(_0xb1ca('0x1'));var BPromise=require(_0xb1ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb1ca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb1ca('0x5'));var client=jayson[_0xb1ca('0x6')][_0xb1ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfb7a81,_0x562df9,_0x170173){return new BPromise(function(_0x4328b1,_0x2a8a91){return client[_0xb1ca('0x8')](_0xfb7a81,_0x170173)[_0xb1ca('0x9')](function(_0x414f59){logger['info'](_0xb1ca('0xa'),_0x562df9,_0xb1ca('0xb'));logger[_0xb1ca('0xc')](_0xb1ca('0xd'),_0x562df9,_0xb1ca('0xb'),JSON[_0xb1ca('0xe')](_0x414f59));if(_0x414f59[_0xb1ca('0xf')]){if(_0x414f59[_0xb1ca('0xf')][_0xb1ca('0x10')]===0x1f4){logger[_0xb1ca('0xf')](_0xb1ca('0xa'),_0x562df9,_0x414f59[_0xb1ca('0xf')][_0xb1ca('0x11')]);return _0x2a8a91(_0x414f59[_0xb1ca('0xf')][_0xb1ca('0x11')]);}logger[_0xb1ca('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x562df9,_0x414f59['error'][_0xb1ca('0x11')]);return _0x4328b1(_0x414f59[_0xb1ca('0xf')][_0xb1ca('0x11')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x562df9,_0xb1ca('0xb'));_0x4328b1(_0x414f59[_0xb1ca('0x12')][_0xb1ca('0x11')]);}})['catch'](function(_0x8c6f86){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x562df9,_0x8c6f86);_0x2a8a91(_0x8c6f86);});});} \ No newline at end of file +var _0x4487=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0x91ac07,_0x19410e){var _0x40e947=function(_0x4d9555){while(--_0x4d9555){_0x91ac07['push'](_0x91ac07['shift']());}};_0x40e947(++_0x19410e);}(_0x4487,0x1e9));var _0x7448=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x4487[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x7448('0x0'));var util=require(_0x7448('0x1'));var moment=require(_0x7448('0x2'));var BPromise=require(_0x7448('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7448('0x4'))['db'];var utils=require(_0x7448('0x5'));var logger=require(_0x7448('0x6'))(_0x7448('0x7'));var config=require(_0x7448('0x8'));var jayson=require(_0x7448('0x9'));var client=jayson[_0x7448('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x315000,_0x2d1da9,_0x410781){return new BPromise(function(_0x46e501,_0x299670){return client[_0x7448('0xb')](_0x315000,_0x410781)[_0x7448('0xc')](function(_0x13e3bb){logger[_0x7448('0xd')](_0x7448('0xe'),_0x2d1da9,'request\x20sent');logger[_0x7448('0xf')](_0x7448('0x10'),_0x2d1da9,_0x7448('0x11'),JSON[_0x7448('0x12')](_0x13e3bb));if(_0x13e3bb[_0x7448('0x13')]){if(_0x13e3bb['error'][_0x7448('0x14')]===0x1f4){logger['error'](_0x7448('0xe'),_0x2d1da9,_0x13e3bb[_0x7448('0x13')][_0x7448('0x15')]);return _0x299670(_0x13e3bb[_0x7448('0x13')][_0x7448('0x15')]);}logger[_0x7448('0x13')](_0x7448('0xe'),_0x2d1da9,_0x13e3bb[_0x7448('0x13')]['message']);return _0x46e501(_0x13e3bb[_0x7448('0x13')][_0x7448('0x15')]);}else{logger['info'](_0x7448('0xe'),_0x2d1da9,_0x7448('0x11'));_0x46e501(_0x13e3bb[_0x7448('0x16')]['message']);}})[_0x7448('0x17')](function(_0x3f65eb){logger[_0x7448('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x2d1da9,_0x3f65eb);_0x299670(_0x3f65eb);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 3946ad3..26e6123 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 _0x865d=['../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0x865d,0x1d9));var _0xd865=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x865d[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0xd865('0x0'));var util=require(_0xd865('0x1'));var path=require(_0xd865('0x2'));var timeout=require(_0xd865('0x3'));var express=require(_0xd865('0x4'));var router=express[_0xd865('0x5')]();var fs_extra=require(_0xd865('0x6'));var auth=require(_0xd865('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd865('0x8'));var controller=require(_0xd865('0x9'));router[_0xd865('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd865('0xb'),auth[_0xd865('0xc')](),controller[_0xd865('0xd')]);router[_0xd865('0xa')](_0xd865('0xe'),auth['isAuthenticated'](),controller[_0xd865('0xf')]);router[_0xd865('0xa')](_0xd865('0x10'),auth['isAuthenticated'](),controller[_0xd865('0x11')]);router[_0xd865('0x12')]('/',auth[_0xd865('0xc')](),controller[_0xd865('0x13')]);router[_0xd865('0x12')]('/:id/configurations',auth[_0xd865('0xc')](),controller['addConfiguration']);router[_0xd865('0x14')]('/:id',auth[_0xd865('0xc')](),controller[_0xd865('0x15')]);router['delete'](_0xd865('0xb'),auth[_0xd865('0xc')](),controller[_0xd865('0x16')]);module[_0xd865('0x17')]=router; \ No newline at end of file +var _0xf2c7=['isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0xf2c7[_0x3a3758];return _0x1a9234;};'use strict';var multer=require(_0x7f2c('0x0'));var util=require(_0x7f2c('0x1'));var path=require(_0x7f2c('0x2'));var timeout=require(_0x7f2c('0x3'));var express=require('express');var router=express[_0x7f2c('0x4')]();var fs_extra=require(_0x7f2c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f2c('0x6'));var controller=require('./intVtigerAccount.controller');router[_0x7f2c('0x7')]('/',auth[_0x7f2c('0x8')](),controller['index']);router[_0x7f2c('0x7')](_0x7f2c('0x9'),auth[_0x7f2c('0x8')](),controller['show']);router[_0x7f2c('0x7')](_0x7f2c('0xa'),auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xb')]);router[_0x7f2c('0x7')](_0x7f2c('0xc'),auth['isAuthenticated'](),controller[_0x7f2c('0xd')]);router[_0x7f2c('0xe')]('/',auth[_0x7f2c('0x8')](),controller[_0x7f2c('0xf')]);router[_0x7f2c('0xe')](_0x7f2c('0xa'),auth[_0x7f2c('0x8')](),controller[_0x7f2c('0x10')]);router[_0x7f2c('0x11')]('/:id',auth[_0x7f2c('0x8')](),controller['update']);router[_0x7f2c('0x12')](_0x7f2c('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 57d6b9b..0c33279 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 _0x8014=['sequelize','exports','STRING'];(function(_0x154bc7,_0x4ab188){var _0x38d238=function(_0x201285){while(--_0x201285){_0x154bc7['push'](_0x154bc7['shift']());}};_0x38d238(++_0x4ab188);}(_0x8014,0x192));var _0x4801=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x8014[_0x120123];return _0x3bec4c;};'use strict';var Sequelize=require(_0x4801('0x0'));module[_0x4801('0x1')]={'name':{'type':Sequelize[_0x4801('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4801('0x2')]},'username':{'type':Sequelize[_0x4801('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4801('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x4801('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4801('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4801('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc550=['STRING','HelpDesk','sequelize','exports'];(function(_0x20a811,_0x27aae2){var _0x3f1ace=function(_0x2e4f55){while(--_0x2e4f55){_0x20a811['push'](_0x20a811['shift']());}};_0x3f1ace(++_0x27aae2);}(_0xc550,0x172));var _0x0c55=function(_0x6923ea,_0x4b5785){_0x6923ea=_0x6923ea-0x0;var _0x37b5d1=_0xc550[_0x6923ea];return _0x37b5d1;};'use strict';var Sequelize=require(_0x0c55('0x0'));module[_0x0c55('0x1')]={'name':{'type':Sequelize[_0x0c55('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0c55('0x2')]},'username':{'type':Sequelize[_0x0c55('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0c55('0x3')},'remoteUri':{'type':Sequelize[_0x0c55('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0c55('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index b2e99c9..eead29b 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 _0xc015=['describe','reference','includes','remove','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','statusCode','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','format','%s/webservice.php','GET','getchallenge','success','POST','result','token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc015,0x182));var _0x5c01=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0xc015[_0x212bf5];return _0xfcad21;};'use strict';var emlformat=require(_0x5c01('0x0'));var rimraf=require(_0x5c01('0x1'));var zipdir=require(_0x5c01('0x2'));var jsonpatch=require(_0x5c01('0x3'));var rp=require(_0x5c01('0x4'));var moment=require(_0x5c01('0x5'));var BPromise=require(_0x5c01('0x6'));var Mustache=require(_0x5c01('0x7'));var util=require('util');var path=require(_0x5c01('0x8'));var sox=require(_0x5c01('0x9'));var csv=require('to-csv');var ejs=require(_0x5c01('0xa'));var fs=require('fs');var fs_extra=require(_0x5c01('0xb'));var _=require(_0x5c01('0xc'));var squel=require('squel');var crypto=require(_0x5c01('0xd'));var jsforce=require(_0x5c01('0xe'));var deskjs=require(_0x5c01('0xf'));var toCsv=require(_0x5c01('0x10'));var querystring=require(_0x5c01('0x11'));var Papa=require(_0x5c01('0x12'));var Redis=require(_0x5c01('0x13'));var authService=require(_0x5c01('0x14'));var qs=require(_0x5c01('0x15'));var as=require(_0x5c01('0x16'));var hardwareService=require(_0x5c01('0x17'));var logger=require(_0x5c01('0x18'))(_0x5c01('0x19'));var utils=require(_0x5c01('0x1a'));var config=require(_0x5c01('0x1b'));var licenseUtil=require(_0x5c01('0x1c'));var db=require(_0x5c01('0x1d'))['db'];var integrations=require(_0x5c01('0x1e'));function respondWithStatusCode(_0x4b0c6d,_0x16a3b3){_0x16a3b3=_0x16a3b3||0xcc;return function(_0x22df48){if(_0x22df48){return _0x4b0c6d['sendStatus'](_0x16a3b3);}return _0x4b0c6d[_0x5c01('0x1f')](_0x16a3b3)[_0x5c01('0x20')]();};}function respondWithResult(_0xf3a1b0,_0x18bd02){_0x18bd02=_0x18bd02||0xc8;return function(_0x16c67f){if(_0x16c67f){return _0xf3a1b0[_0x5c01('0x1f')](_0x18bd02)['json'](_0x16c67f);}};}function respondWithFilteredResult(_0x3a3739,_0x3c66ca){return function(_0x6515c7){if(_0x6515c7){var _0x44d0b5=typeof _0x3c66ca[_0x5c01('0x21')]===_0x5c01('0x22')&&typeof _0x3c66ca[_0x5c01('0x23')]===_0x5c01('0x22');var _0x302c12=_0x6515c7[_0x5c01('0x24')];var _0x21fe7e=_0x44d0b5?0x0:_0x3c66ca[_0x5c01('0x21')];var _0x38f0fa=_0x44d0b5?_0x6515c7[_0x5c01('0x24')]:_0x3c66ca[_0x5c01('0x21')]+_0x3c66ca['limit'];var _0x5cb2df;if(_0x38f0fa>=_0x302c12){_0x38f0fa=_0x302c12;_0x5cb2df=0xc8;}else{_0x5cb2df=0xce;}_0x3a3739[_0x5c01('0x1f')](_0x5cb2df);return _0x3a3739['set']('Content-Range',_0x21fe7e+'-'+_0x38f0fa+'/'+_0x302c12)[_0x5c01('0x25')](_0x6515c7);}return null;};}function patchUpdates(_0x1be3bf){return function(_0x3637b1){try{jsonpatch[_0x5c01('0x26')](_0x3637b1,_0x1be3bf,!![]);}catch(_0x2ea4e2){return BPromise[_0x5c01('0x27')](_0x2ea4e2);}return _0x3637b1[_0x5c01('0x28')]();};}function saveUpdates(_0x21d1c0,_0x2bd6c3){return function(_0x552ff5){if(_0x552ff5){return _0x552ff5[_0x5c01('0x29')](_0x21d1c0)[_0x5c01('0x2a')](function(_0x16d3be){return _0x16d3be;});}return null;};}function removeEntity(_0x111a8f,_0x2cc05e){return function(_0x156413){if(_0x156413){return _0x156413[_0x5c01('0x2b')]()['then'](function(){_0x111a8f[_0x5c01('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f91e0,_0x1a7c02){return function(_0x351238){if(!_0x351238){_0x3f91e0[_0x5c01('0x2c')](0x194);}return _0x351238;};}function handleError(_0x5e1db3,_0x1533dc){_0x1533dc=_0x1533dc||0x1f4;return function(_0x306b67){logger[_0x5c01('0x2d')](_0x306b67[_0x5c01('0x2e')]);if(_0x306b67[_0x5c01('0x2f')]){delete _0x306b67[_0x5c01('0x2f')];}_0x5e1db3[_0x5c01('0x1f')](_0x1533dc)[_0x5c01('0x30')](_0x306b67);};}exports[_0x5c01('0x31')]=function(_0x2f6e90,_0x2c91ad){var _0x2f989a={},_0x30b5ac={},_0xde587={'count':0x0,'rows':[]};var _0x2df597=_[_0x5c01('0x32')](db[_0x5c01('0x33')][_0x5c01('0x34')],function(_0x4447d3){return{'name':_0x4447d3[_0x5c01('0x35')],'type':_0x4447d3[_0x5c01('0x36')][_0x5c01('0x37')]};});_0x30b5ac[_0x5c01('0x38')]=_[_0x5c01('0x32')](_0x2df597,_0x5c01('0x2f'));_0x30b5ac[_0x5c01('0x39')]=_[_0x5c01('0x3a')](_0x2f6e90[_0x5c01('0x39')]);_0x30b5ac[_0x5c01('0x3b')]=_['intersection'](_0x30b5ac[_0x5c01('0x38')],_0x30b5ac['query']);_0x2f989a[_0x5c01('0x3c')]=_[_0x5c01('0x3d')](_0x30b5ac['model'],qs[_0x5c01('0x3e')](_0x2f6e90[_0x5c01('0x39')][_0x5c01('0x3e')]));_0x2f989a[_0x5c01('0x3c')]=_0x2f989a[_0x5c01('0x3c')][_0x5c01('0x3f')]?_0x2f989a['attributes']:_0x30b5ac[_0x5c01('0x38')];if(!_0x2f6e90['query']['hasOwnProperty']('nolimit')){_0x2f989a[_0x5c01('0x23')]=qs['limit'](_0x2f6e90[_0x5c01('0x39')]['limit']);_0x2f989a[_0x5c01('0x21')]=qs[_0x5c01('0x21')](_0x2f6e90[_0x5c01('0x39')]['offset']);}_0x2f989a[_0x5c01('0x40')]=qs[_0x5c01('0x41')](_0x2f6e90['query'][_0x5c01('0x41')]);_0x2f989a[_0x5c01('0x42')]=qs['filters'](_[_0x5c01('0x43')](_0x2f6e90[_0x5c01('0x39')],_0x30b5ac[_0x5c01('0x3b')]),_0x2df597);if(_0x2f6e90[_0x5c01('0x39')][_0x5c01('0x44')]){_0x2f989a[_0x5c01('0x42')]=_[_0x5c01('0x45')](_0x2f989a[_0x5c01('0x42')],{'$or':_[_0x5c01('0x32')](_0x2df597,function(_0x3e68ce){if(_0x3e68ce[_0x5c01('0x36')]!==_0x5c01('0x46')){var _0x2f3d0e={};_0x2f3d0e[_0x3e68ce['name']]={'$like':'%'+_0x2f6e90[_0x5c01('0x39')]['filter']+'%'};return _0x2f3d0e;}})});}_0x2f989a=_['merge']({},_0x2f989a,_0x2f6e90[_0x5c01('0x47')]);var _0x54020e={'where':_0x2f989a[_0x5c01('0x42')]};return db['VtigerAccount'][_0x5c01('0x24')](_0x54020e)[_0x5c01('0x2a')](function(_0x420946){_0xde587[_0x5c01('0x24')]=_0x420946;if(_0x2f6e90[_0x5c01('0x39')][_0x5c01('0x48')]){_0x2f989a[_0x5c01('0x49')]=[{'all':!![]}];}return db[_0x5c01('0x33')]['findAll'](_0x2f989a);})[_0x5c01('0x2a')](function(_0x53454b){_0xde587[_0x5c01('0x4a')]=_0x53454b;return _0xde587;})[_0x5c01('0x2a')](respondWithFilteredResult(_0x2c91ad,_0x2f989a))[_0x5c01('0x4b')](handleError(_0x2c91ad,null));};exports[_0x5c01('0x4c')]=function(_0x3333d8,_0x132a11){var _0x323904={'raw':![],'where':{'id':_0x3333d8[_0x5c01('0x4d')]['id']}},_0x1ef151={};_0x1ef151[_0x5c01('0x38')]=_[_0x5c01('0x3a')](db[_0x5c01('0x33')]['rawAttributes']);_0x1ef151[_0x5c01('0x39')]=_[_0x5c01('0x3a')](_0x3333d8[_0x5c01('0x39')]);_0x1ef151[_0x5c01('0x3b')]=_[_0x5c01('0x3d')](_0x1ef151['model'],_0x1ef151['query']);_0x323904[_0x5c01('0x3c')]=_[_0x5c01('0x3d')](_0x1ef151[_0x5c01('0x38')],qs[_0x5c01('0x3e')](_0x3333d8['query'][_0x5c01('0x3e')]));_0x323904[_0x5c01('0x3c')]=_0x323904[_0x5c01('0x3c')][_0x5c01('0x3f')]?_0x323904[_0x5c01('0x3c')]:_0x1ef151[_0x5c01('0x38')];if(_0x3333d8['query'][_0x5c01('0x48')]){_0x323904['include']=[{'all':!![]}];}_0x323904=_[_0x5c01('0x45')]({},_0x323904,_0x3333d8[_0x5c01('0x47')]);return db[_0x5c01('0x33')][_0x5c01('0x4e')](_0x323904)[_0x5c01('0x2a')](handleEntityNotFound(_0x132a11,null))['then'](respondWithResult(_0x132a11,null))[_0x5c01('0x4b')](handleError(_0x132a11,null));};exports[_0x5c01('0x4f')]=function(_0x447cfc,_0x253661){return db[_0x5c01('0x33')][_0x5c01('0x4f')](_0x447cfc['body'],{})[_0x5c01('0x2a')](respondWithResult(_0x253661,0xc9))[_0x5c01('0x4b')](handleError(_0x253661,null));};exports[_0x5c01('0x29')]=function(_0x3f64fe,_0x508d1){if(_0x3f64fe['body']['id']){delete _0x3f64fe[_0x5c01('0x50')]['id'];}return db[_0x5c01('0x33')][_0x5c01('0x4e')]({'where':{'id':_0x3f64fe[_0x5c01('0x4d')]['id']}})[_0x5c01('0x2a')](handleEntityNotFound(_0x508d1,null))[_0x5c01('0x2a')](saveUpdates(_0x3f64fe[_0x5c01('0x50')],null))['then'](respondWithResult(_0x508d1,null))[_0x5c01('0x4b')](handleError(_0x508d1,null));};exports[_0x5c01('0x2b')]=function(_0x26efec,_0x4cf801){return db[_0x5c01('0x33')][_0x5c01('0x4e')]({'where':{'id':_0x26efec[_0x5c01('0x4d')]['id']}})[_0x5c01('0x2a')](handleEntityNotFound(_0x4cf801,null))[_0x5c01('0x2a')](removeEntity(_0x4cf801,null))[_0x5c01('0x4b')](handleError(_0x4cf801,null));};exports[_0x5c01('0x51')]=function(_0x5022d2,_0x45df27,_0x4648e0){var _0x28bfc5={};var _0x107e5b={};var _0x3514a0;var _0x912102;return db[_0x5c01('0x33')][_0x5c01('0x52')]({'where':{'id':_0x5022d2[_0x5c01('0x4d')]['id']}})[_0x5c01('0x2a')](handleEntityNotFound(_0x45df27,null))[_0x5c01('0x2a')](function(_0x12ca0b){if(_0x12ca0b){_0x3514a0=_0x12ca0b;_0x107e5b['model']=_[_0x5c01('0x3a')](db[_0x5c01('0x53')][_0x5c01('0x34')]);_0x107e5b[_0x5c01('0x39')]=_[_0x5c01('0x3a')](_0x5022d2['query']);_0x107e5b[_0x5c01('0x3b')]=_[_0x5c01('0x3d')](_0x107e5b[_0x5c01('0x38')],_0x107e5b[_0x5c01('0x39')]);_0x28bfc5[_0x5c01('0x3c')]=_['intersection'](_0x107e5b[_0x5c01('0x38')],qs['fields'](_0x5022d2[_0x5c01('0x39')][_0x5c01('0x3e')]));_0x28bfc5[_0x5c01('0x3c')]=_0x28bfc5[_0x5c01('0x3c')][_0x5c01('0x3f')]?_0x28bfc5[_0x5c01('0x3c')]:_0x107e5b[_0x5c01('0x38')];_0x28bfc5['order']=qs[_0x5c01('0x41')](_0x5022d2['query'][_0x5c01('0x41')]);_0x28bfc5['where']=qs[_0x5c01('0x3b')](_['pick'](_0x5022d2[_0x5c01('0x39')],_0x107e5b[_0x5c01('0x3b')]));if(_0x5022d2[_0x5c01('0x39')][_0x5c01('0x44')]){_0x28bfc5[_0x5c01('0x42')]=_['merge'](_0x28bfc5[_0x5c01('0x42')],{'$or':_['map'](_0x28bfc5[_0x5c01('0x3c')],function(_0x3cb3e2){var _0x5d36f9={};_0x5d36f9[_0x3cb3e2]={'$like':'%'+_0x5022d2[_0x5c01('0x39')][_0x5c01('0x44')]+'%'};return _0x5d36f9;})});}_0x28bfc5=_[_0x5c01('0x45')]({},_0x28bfc5,_0x5022d2[_0x5c01('0x47')]);return _0x3514a0[_0x5c01('0x51')](_0x28bfc5);}})[_0x5c01('0x2a')](function(_0x3cdce5){if(_0x3cdce5){_0x912102=_0x3cdce5[_0x5c01('0x3f')];if(!_0x5022d2[_0x5c01('0x39')][_0x5c01('0x54')](_0x5c01('0x55'))){_0x28bfc5[_0x5c01('0x23')]=qs['limit'](_0x5022d2[_0x5c01('0x39')][_0x5c01('0x23')]);_0x28bfc5[_0x5c01('0x21')]=qs[_0x5c01('0x21')](_0x5022d2[_0x5c01('0x39')]['offset']);}return _0x3514a0['getConfigurations'](_0x28bfc5);}})[_0x5c01('0x2a')](function(_0x5a44f1){if(_0x5a44f1){return _0x5a44f1?{'count':_0x912102,'rows':_0x5a44f1}:null;}})[_0x5c01('0x2a')](respondWithResult(_0x45df27,null))[_0x5c01('0x4b')](handleError(_0x45df27,null));};exports[_0x5c01('0x56')]=function(_0x4253f0,_0x542725,_0x5a458c){if(_0x4253f0['body']['id']){delete _0x4253f0[_0x5c01('0x50')]['id'];}return db[_0x5c01('0x33')][_0x5c01('0x52')]({'where':{'id':_0x4253f0[_0x5c01('0x4d')]['id']}})[_0x5c01('0x2a')](handleEntityNotFound(_0x542725,null))[_0x5c01('0x2a')](function(_0xdab43a){if(_0xdab43a){_0x4253f0[_0x5c01('0x50')][_0x5c01('0x57')]=_0xdab43a['id'];_0x4253f0[_0x5c01('0x50')][_0x5c01('0x58')]=integrations[_0x5c01('0x59')](_0x4253f0[_0x5c01('0x50')][_0x5c01('0x5a')],_0x4253f0[_0x5c01('0x50')][_0x5c01('0x36')]);_0x4253f0[_0x5c01('0x50')][_0x5c01('0x5b')]=integrations[_0x5c01('0x5c')](_0x4253f0[_0x5c01('0x50')][_0x5c01('0x5a')],_0x4253f0[_0x5c01('0x50')]['type']);return db[_0x5c01('0x53')]['create'](_0x4253f0[_0x5c01('0x50')],{'include':[{'model':db[_0x5c01('0x5d')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x5c01('0x5b')}]});}return null;})[_0x5c01('0x2a')](respondWithResult(_0x542725,null))[_0x5c01('0x4b')](handleError(_0x542725,null));};var md5=require(_0x5c01('0x5e'));exports[_0x5c01('0x5f')]=function(_0x2766c0,_0x30eeb3,_0x438f07){var _0x3ef689=null;var _0x5068fd=null;var _0x449c8c=null;var _0x1b2184=null;var _0xe163c3='';return db[_0x5c01('0x33')]['findOne']({'where':{'id':_0x2766c0['params']['id']},'attributes':['id',_0x5c01('0x2f'),_0x5c01('0x60'),_0x5c01('0x61'),_0x5c01('0x62'),_0x5c01('0x63'),_0x5c01('0x64'),_0x5c01('0x65')]})[_0x5c01('0x2a')](handleEntityNotFound(_0x30eeb3,null))['then'](function(_0xaa3625){if(_0xaa3625){_0x3ef689=_0xaa3625[_0x5c01('0x60')];_0x5068fd=_0xaa3625[_0x5c01('0x65')];_0x449c8c=_0xaa3625['moduleName'];_0xe163c3=_0xaa3625[_0x5c01('0x63')];var _0x3fc311=_0xe163c3['slice'](-0x1);if(_0x3fc311==='/'){_0xe163c3=_0xe163c3['substring'](0x0,_0xe163c3['lastIndexOf'](_0x3fc311));}_0x1b2184=util[_0x5c01('0x66')](_0x5c01('0x67'),_0xe163c3);var _0x4a4ddc={'method':_0x5c01('0x68'),'uri':_0x1b2184,'qs':{'operation':_0x5c01('0x69'),'username':_0xaa3625[_0x5c01('0x60')]},'json':!![]};return rp(_0x4a4ddc);}})['then'](function(_0x4aee6a){if(_0x4aee6a[_0x5c01('0x6a')]){var _0x1794d9={'method':_0x5c01('0x6b'),'uri':_0x1b2184,'form':{'operation':'login','username':_0x3ef689,'accessKey':md5(_0x4aee6a[_0x5c01('0x6c')][_0x5c01('0x6d')]+_0x5068fd)},'json':!![]};return rp(_0x1794d9);}})[_0x5c01('0x2a')](function(_0x2c05d6){if(_0x2c05d6[_0x5c01('0x6a')]){var _0x39dff6={'method':'GET','uri':_0x1b2184,'qs':{'operation':_0x5c01('0x6e'),'username':_0x3ef689,'sessionName':_0x2c05d6['result']['sessionName'],'elementType':_0x449c8c},'json':!![]};return rp(_0x39dff6);}})[_0x5c01('0x2a')](function(_0x33972f){if(_0x33972f[_0x5c01('0x6a')]){var _0x15b2b5=['autogenerated',_0x5c01('0x6f'),'owner'];_['remove'](_0x33972f['result'][_0x5c01('0x3e')],function(_0x3c3aba){return _0x15b2b5[_0x5c01('0x70')](_0x3c3aba[_0x5c01('0x36')][_0x5c01('0x2f')]);});_[_0x5c01('0x71')](_0x33972f[_0x5c01('0x6c')][_0x5c01('0x3e')],function(_0x3ae7cf){return _0x3ae7cf['editable']==='false';});return{'count':_0x33972f['result'][_0x5c01('0x3e')][_0x5c01('0x3f')],'rows':_[_0x5c01('0x32')](_0x33972f[_0x5c01('0x6c')][_0x5c01('0x3e')],function(_0x5bf199){return{'id':_0x5bf199['name'],'name':_0x5bf199[_0x5c01('0x72')],'custom':_[_0x5c01('0x73')](_0x5bf199[_0x5c01('0x2f')],_0x5c01('0x74'))?!![]:![],'options':_0x5bf199[_0x5c01('0x36')]['name']===_0x5c01('0x75')&&_0x5bf199[_0x5c01('0x36')][_0x5c01('0x76')]['length']>0x0?_[_0x5c01('0x32')](_0x5bf199[_0x5c01('0x36')]['picklistValues'],function(_0x176cff){return{'name':_0x176cff[_0x5c01('0x72')],'value':_0x176cff['value']};}):[]};})};}})[_0x5c01('0x2a')](respondWithResult(_0x30eeb3,null))[_0x5c01('0x4b')](function(_0x590139){console[_0x5c01('0x77')](_0x5c01('0x78')+_0x590139);var _0x38aadf=_0x2766c0[_0x5c01('0x39')]['test']?0x1f4:_0x590139[_0x5c01('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5c01('0x5f'),_0x38aadf,JSON[_0x5c01('0x7a')](_0x590139));delete _0x590139['name'];if(_0x38aadf===0x191){_0x38aadf=0x190;}_0x30eeb3[_0x5c01('0x1f')](_0x38aadf)[_0x5c01('0x30')](_0x2766c0['query'][_0x5c01('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x590139[_0x5c01('0x79')]}:_0x590139);});}; \ No newline at end of file +var _0x89d9=['create','body','getConfigurations','findOne','VtigerConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','GET','getchallenge','success','login','token','result','sessionName','autogenerated','reference','owner','includes','remove','false','label','startsWith','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','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','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerAccount','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','rows','catch','show','params','rawAttributes','includeAll','include','find'];(function(_0x25bb6b,_0x544cab){var _0x23163f=function(_0x1920f8){while(--_0x1920f8){_0x25bb6b['push'](_0x25bb6b['shift']());}};_0x23163f(++_0x544cab);}(_0x89d9,0x124));var _0x989d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x89d9[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x989d('0x0'));var rimraf=require(_0x989d('0x1'));var zipdir=require(_0x989d('0x2'));var jsonpatch=require(_0x989d('0x3'));var rp=require(_0x989d('0x4'));var moment=require(_0x989d('0x5'));var BPromise=require(_0x989d('0x6'));var Mustache=require('mustache');var util=require(_0x989d('0x7'));var path=require('path');var sox=require(_0x989d('0x8'));var csv=require(_0x989d('0x9'));var ejs=require(_0x989d('0xa'));var fs=require('fs');var fs_extra=require(_0x989d('0xb'));var _=require('lodash');var squel=require(_0x989d('0xc'));var crypto=require(_0x989d('0xd'));var jsforce=require(_0x989d('0xe'));var deskjs=require(_0x989d('0xf'));var toCsv=require(_0x989d('0x9'));var querystring=require(_0x989d('0x10'));var Papa=require(_0x989d('0x11'));var Redis=require(_0x989d('0x12'));var authService=require(_0x989d('0x13'));var qs=require(_0x989d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x989d('0x15'));var logger=require(_0x989d('0x16'))(_0x989d('0x17'));var utils=require(_0x989d('0x18'));var config=require(_0x989d('0x19'));var licenseUtil=require(_0x989d('0x1a'));var db=require(_0x989d('0x1b'))['db'];var integrations=require(_0x989d('0x1c'));function respondWithStatusCode(_0x4f5a78,_0x14896f){_0x14896f=_0x14896f||0xcc;return function(_0x2b32a2){if(_0x2b32a2){return _0x4f5a78[_0x989d('0x1d')](_0x14896f);}return _0x4f5a78[_0x989d('0x1e')](_0x14896f)[_0x989d('0x1f')]();};}function respondWithResult(_0x449c93,_0x2cf361){_0x2cf361=_0x2cf361||0xc8;return function(_0x2ebe47){if(_0x2ebe47){return _0x449c93[_0x989d('0x1e')](_0x2cf361)[_0x989d('0x20')](_0x2ebe47);}};}function respondWithFilteredResult(_0x55b937,_0x454971){return function(_0x18967b){if(_0x18967b){var _0x461d1b=typeof _0x454971[_0x989d('0x21')]===_0x989d('0x22')&&typeof _0x454971['limit']===_0x989d('0x22');var _0x45338c=_0x18967b[_0x989d('0x23')];var _0x4aea91=_0x461d1b?0x0:_0x454971[_0x989d('0x21')];var _0x494004=_0x461d1b?_0x18967b[_0x989d('0x23')]:_0x454971['offset']+_0x454971[_0x989d('0x24')];var _0xecae62;if(_0x494004>=_0x45338c){_0x494004=_0x45338c;_0xecae62=0xc8;}else{_0xecae62=0xce;}_0x55b937[_0x989d('0x1e')](_0xecae62);return _0x55b937[_0x989d('0x25')](_0x989d('0x26'),_0x4aea91+'-'+_0x494004+'/'+_0x45338c)['json'](_0x18967b);}return null;};}function patchUpdates(_0x35a9b8){return function(_0x2d1d32){try{jsonpatch[_0x989d('0x27')](_0x2d1d32,_0x35a9b8,!![]);}catch(_0x3fd85f){return BPromise[_0x989d('0x28')](_0x3fd85f);}return _0x2d1d32[_0x989d('0x29')]();};}function saveUpdates(_0x4979c9,_0x5ce917){return function(_0x477f42){if(_0x477f42){return _0x477f42[_0x989d('0x2a')](_0x4979c9)[_0x989d('0x2b')](function(_0x25f61a){return _0x25f61a;});}return null;};}function removeEntity(_0x1ef4df,_0x25c9e8){return function(_0x5666ea){if(_0x5666ea){return _0x5666ea[_0x989d('0x2c')]()[_0x989d('0x2b')](function(){_0x1ef4df[_0x989d('0x1e')](0xcc)[_0x989d('0x1f')]();});}};}function handleEntityNotFound(_0x15dca5,_0x6b9af1){return function(_0x26d802){if(!_0x26d802){_0x15dca5['sendStatus'](0x194);}return _0x26d802;};}function handleError(_0x4ecfc9,_0x5d1151){_0x5d1151=_0x5d1151||0x1f4;return function(_0x98e5e6){logger['error'](_0x98e5e6[_0x989d('0x2d')]);if(_0x98e5e6[_0x989d('0x2e')]){delete _0x98e5e6[_0x989d('0x2e')];}_0x4ecfc9['status'](_0x5d1151)[_0x989d('0x2f')](_0x98e5e6);};}exports[_0x989d('0x30')]=function(_0x869978,_0x3f1ba0){var _0x22e6e4={},_0xe3a1e5={},_0x33b77a={'count':0x0,'rows':[]};var _0x3fa234=_[_0x989d('0x31')](db[_0x989d('0x32')]['rawAttributes'],function(_0x18c867){return{'name':_0x18c867[_0x989d('0x33')],'type':_0x18c867[_0x989d('0x34')][_0x989d('0x35')]};});_0xe3a1e5['model']=_[_0x989d('0x31')](_0x3fa234,'name');_0xe3a1e5['query']=_[_0x989d('0x36')](_0x869978['query']);_0xe3a1e5[_0x989d('0x37')]=_[_0x989d('0x38')](_0xe3a1e5['model'],_0xe3a1e5[_0x989d('0x39')]);_0x22e6e4[_0x989d('0x3a')]=_[_0x989d('0x38')](_0xe3a1e5[_0x989d('0x3b')],qs[_0x989d('0x3c')](_0x869978[_0x989d('0x39')][_0x989d('0x3c')]));_0x22e6e4[_0x989d('0x3a')]=_0x22e6e4[_0x989d('0x3a')][_0x989d('0x3d')]?_0x22e6e4[_0x989d('0x3a')]:_0xe3a1e5[_0x989d('0x3b')];if(!_0x869978['query'][_0x989d('0x3e')]('nolimit')){_0x22e6e4['limit']=qs[_0x989d('0x24')](_0x869978[_0x989d('0x39')][_0x989d('0x24')]);_0x22e6e4[_0x989d('0x21')]=qs['offset'](_0x869978[_0x989d('0x39')]['offset']);}_0x22e6e4[_0x989d('0x3f')]=qs[_0x989d('0x40')](_0x869978[_0x989d('0x39')][_0x989d('0x40')]);_0x22e6e4[_0x989d('0x41')]=qs[_0x989d('0x37')](_['pick'](_0x869978[_0x989d('0x39')],_0xe3a1e5[_0x989d('0x37')]),_0x3fa234);if(_0x869978['query'][_0x989d('0x42')]){_0x22e6e4[_0x989d('0x41')]=_[_0x989d('0x43')](_0x22e6e4[_0x989d('0x41')],{'$or':_[_0x989d('0x31')](_0x3fa234,function(_0x46c82e){if(_0x46c82e[_0x989d('0x34')]!=='VIRTUAL'){var _0x260023={};_0x260023[_0x46c82e[_0x989d('0x2e')]]={'$like':'%'+_0x869978[_0x989d('0x39')]['filter']+'%'};return _0x260023;}})});}_0x22e6e4=_[_0x989d('0x43')]({},_0x22e6e4,_0x869978[_0x989d('0x44')]);var _0x21785c={'where':_0x22e6e4[_0x989d('0x41')]};return db['VtigerAccount'][_0x989d('0x23')](_0x21785c)['then'](function(_0x57058a){_0x33b77a[_0x989d('0x23')]=_0x57058a;if(_0x869978[_0x989d('0x39')]['includeAll']){_0x22e6e4['include']=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x22e6e4);})[_0x989d('0x2b')](function(_0x35d1fb){_0x33b77a[_0x989d('0x45')]=_0x35d1fb;return _0x33b77a;})['then'](respondWithFilteredResult(_0x3f1ba0,_0x22e6e4))[_0x989d('0x46')](handleError(_0x3f1ba0,null));};exports[_0x989d('0x47')]=function(_0x1330b2,_0x438acc){var _0x16cdcc={'raw':![],'where':{'id':_0x1330b2[_0x989d('0x48')]['id']}},_0x5ab19b={};_0x5ab19b[_0x989d('0x3b')]=_[_0x989d('0x36')](db['VtigerAccount'][_0x989d('0x49')]);_0x5ab19b['query']=_[_0x989d('0x36')](_0x1330b2['query']);_0x5ab19b[_0x989d('0x37')]=_[_0x989d('0x38')](_0x5ab19b['model'],_0x5ab19b[_0x989d('0x39')]);_0x16cdcc['attributes']=_['intersection'](_0x5ab19b[_0x989d('0x3b')],qs['fields'](_0x1330b2[_0x989d('0x39')][_0x989d('0x3c')]));_0x16cdcc[_0x989d('0x3a')]=_0x16cdcc['attributes'][_0x989d('0x3d')]?_0x16cdcc['attributes']:_0x5ab19b[_0x989d('0x3b')];if(_0x1330b2[_0x989d('0x39')][_0x989d('0x4a')]){_0x16cdcc[_0x989d('0x4b')]=[{'all':!![]}];}_0x16cdcc=_[_0x989d('0x43')]({},_0x16cdcc,_0x1330b2[_0x989d('0x44')]);return db['VtigerAccount'][_0x989d('0x4c')](_0x16cdcc)['then'](handleEntityNotFound(_0x438acc,null))[_0x989d('0x2b')](respondWithResult(_0x438acc,null))[_0x989d('0x46')](handleError(_0x438acc,null));};exports[_0x989d('0x4d')]=function(_0x47a8bb,_0x320bf2){return db['VtigerAccount'][_0x989d('0x4d')](_0x47a8bb['body'],{})['then'](respondWithResult(_0x320bf2,0xc9))[_0x989d('0x46')](handleError(_0x320bf2,null));};exports[_0x989d('0x2a')]=function(_0x34370b,_0x5ae521){if(_0x34370b['body']['id']){delete _0x34370b[_0x989d('0x4e')]['id'];}return db[_0x989d('0x32')]['find']({'where':{'id':_0x34370b['params']['id']}})[_0x989d('0x2b')](handleEntityNotFound(_0x5ae521,null))[_0x989d('0x2b')](saveUpdates(_0x34370b['body'],null))['then'](respondWithResult(_0x5ae521,null))['catch'](handleError(_0x5ae521,null));};exports[_0x989d('0x2c')]=function(_0x1d4cd9,_0x34bf45){return db[_0x989d('0x32')][_0x989d('0x4c')]({'where':{'id':_0x1d4cd9['params']['id']}})[_0x989d('0x2b')](handleEntityNotFound(_0x34bf45,null))[_0x989d('0x2b')](removeEntity(_0x34bf45,null))['catch'](handleError(_0x34bf45,null));};exports[_0x989d('0x4f')]=function(_0x14bdda,_0x1b9e6b,_0x1940cc){var _0x13d751={};var _0x1e8671={};var _0x2fb735;var _0xab5f7c;return db['VtigerAccount'][_0x989d('0x50')]({'where':{'id':_0x14bdda[_0x989d('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b9e6b,null))[_0x989d('0x2b')](function(_0xf7540c){if(_0xf7540c){_0x2fb735=_0xf7540c;_0x1e8671[_0x989d('0x3b')]=_['keys'](db[_0x989d('0x51')][_0x989d('0x49')]);_0x1e8671[_0x989d('0x39')]=_[_0x989d('0x36')](_0x14bdda[_0x989d('0x39')]);_0x1e8671[_0x989d('0x37')]=_[_0x989d('0x38')](_0x1e8671['model'],_0x1e8671[_0x989d('0x39')]);_0x13d751['attributes']=_[_0x989d('0x38')](_0x1e8671[_0x989d('0x3b')],qs['fields'](_0x14bdda[_0x989d('0x39')]['fields']));_0x13d751[_0x989d('0x3a')]=_0x13d751['attributes'][_0x989d('0x3d')]?_0x13d751[_0x989d('0x3a')]:_0x1e8671[_0x989d('0x3b')];_0x13d751['order']=qs['sort'](_0x14bdda[_0x989d('0x39')]['sort']);_0x13d751[_0x989d('0x41')]=qs[_0x989d('0x37')](_[_0x989d('0x52')](_0x14bdda[_0x989d('0x39')],_0x1e8671[_0x989d('0x37')]));if(_0x14bdda[_0x989d('0x39')]['filter']){_0x13d751[_0x989d('0x41')]=_['merge'](_0x13d751[_0x989d('0x41')],{'$or':_[_0x989d('0x31')](_0x13d751[_0x989d('0x3a')],function(_0x5b8ed4){var _0x260282={};_0x260282[_0x5b8ed4]={'$like':'%'+_0x14bdda['query']['filter']+'%'};return _0x260282;})});}_0x13d751=_[_0x989d('0x43')]({},_0x13d751,_0x14bdda[_0x989d('0x44')]);return _0x2fb735[_0x989d('0x4f')](_0x13d751);}})[_0x989d('0x2b')](function(_0x7e1ce6){if(_0x7e1ce6){_0xab5f7c=_0x7e1ce6['length'];if(!_0x14bdda[_0x989d('0x39')][_0x989d('0x3e')](_0x989d('0x53'))){_0x13d751[_0x989d('0x24')]=qs[_0x989d('0x24')](_0x14bdda['query'][_0x989d('0x24')]);_0x13d751[_0x989d('0x21')]=qs[_0x989d('0x21')](_0x14bdda[_0x989d('0x39')][_0x989d('0x21')]);}return _0x2fb735['getConfigurations'](_0x13d751);}})[_0x989d('0x2b')](function(_0x29de0b){if(_0x29de0b){return _0x29de0b?{'count':_0xab5f7c,'rows':_0x29de0b}:null;}})[_0x989d('0x2b')](respondWithResult(_0x1b9e6b,null))[_0x989d('0x46')](handleError(_0x1b9e6b,null));};exports[_0x989d('0x54')]=function(_0x349a0d,_0xceafc1,_0x4fcd15){if(_0x349a0d[_0x989d('0x4e')]['id']){delete _0x349a0d['body']['id'];}return db[_0x989d('0x32')][_0x989d('0x50')]({'where':{'id':_0x349a0d[_0x989d('0x48')]['id']}})[_0x989d('0x2b')](handleEntityNotFound(_0xceafc1,null))['then'](function(_0x32e238){if(_0x32e238){_0x349a0d[_0x989d('0x4e')][_0x989d('0x55')]=_0x32e238['id'];_0x349a0d['body'][_0x989d('0x56')]=integrations[_0x989d('0x57')](_0x349a0d[_0x989d('0x4e')][_0x989d('0x58')],_0x349a0d[_0x989d('0x4e')][_0x989d('0x34')]);_0x349a0d[_0x989d('0x4e')][_0x989d('0x59')]=integrations[_0x989d('0x5a')](_0x349a0d[_0x989d('0x4e')][_0x989d('0x58')],_0x349a0d[_0x989d('0x4e')]['type']);return db['VtigerConfiguration']['create'](_0x349a0d[_0x989d('0x4e')],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xceafc1,null))[_0x989d('0x46')](handleError(_0xceafc1,null));};var md5=require(_0x989d('0x5b'));exports[_0x989d('0x5c')]=function(_0x291225,_0x103b82,_0x133432){var _0x4c6c9e=null;var _0x2a4aa8=null;var _0x411ccd=null;var _0x411f55=null;var _0x153b54='';return db[_0x989d('0x32')][_0x989d('0x50')]({'where':{'id':_0x291225['params']['id']},'attributes':['id',_0x989d('0x2e'),_0x989d('0x5d'),'description',_0x989d('0x5e'),_0x989d('0x5f'),_0x989d('0x60'),_0x989d('0x61')]})[_0x989d('0x2b')](handleEntityNotFound(_0x103b82,null))[_0x989d('0x2b')](function(_0x441e15){if(_0x441e15){_0x4c6c9e=_0x441e15[_0x989d('0x5d')];_0x2a4aa8=_0x441e15[_0x989d('0x61')];_0x411ccd=_0x441e15[_0x989d('0x5e')];_0x153b54=_0x441e15[_0x989d('0x5f')];var _0x3ecee9=_0x153b54['slice'](-0x1);if(_0x3ecee9==='/'){_0x153b54=_0x153b54[_0x989d('0x62')](0x0,_0x153b54[_0x989d('0x63')](_0x3ecee9));}_0x411f55=util['format']('%s/webservice.php',_0x153b54);var _0x2c9010={'method':_0x989d('0x64'),'uri':_0x411f55,'qs':{'operation':_0x989d('0x65'),'username':_0x441e15[_0x989d('0x5d')]},'json':!![]};return rp(_0x2c9010);}})[_0x989d('0x2b')](function(_0x475d07){if(_0x475d07[_0x989d('0x66')]){var _0xc79781={'method':'POST','uri':_0x411f55,'form':{'operation':_0x989d('0x67'),'username':_0x4c6c9e,'accessKey':md5(_0x475d07['result'][_0x989d('0x68')]+_0x2a4aa8)},'json':!![]};return rp(_0xc79781);}})[_0x989d('0x2b')](function(_0x37971a){if(_0x37971a[_0x989d('0x66')]){var _0x42fe6e={'method':_0x989d('0x64'),'uri':_0x411f55,'qs':{'operation':'describe','username':_0x4c6c9e,'sessionName':_0x37971a[_0x989d('0x69')][_0x989d('0x6a')],'elementType':_0x411ccd},'json':!![]};return rp(_0x42fe6e);}})[_0x989d('0x2b')](function(_0x533499){if(_0x533499[_0x989d('0x66')]){var _0x4b42d9=[_0x989d('0x6b'),_0x989d('0x6c'),_0x989d('0x6d')];_['remove'](_0x533499[_0x989d('0x69')][_0x989d('0x3c')],function(_0x226d3a){return _0x4b42d9[_0x989d('0x6e')](_0x226d3a['type'][_0x989d('0x2e')]);});_[_0x989d('0x6f')](_0x533499['result'][_0x989d('0x3c')],function(_0x40907f){return _0x40907f['editable']===_0x989d('0x70');});return{'count':_0x533499[_0x989d('0x69')][_0x989d('0x3c')]['length'],'rows':_[_0x989d('0x31')](_0x533499[_0x989d('0x69')][_0x989d('0x3c')],function(_0x1e974d){return{'id':_0x1e974d['name'],'name':_0x1e974d[_0x989d('0x71')],'custom':_[_0x989d('0x72')](_0x1e974d[_0x989d('0x2e')],'cf_')?!![]:![],'options':_0x1e974d[_0x989d('0x34')][_0x989d('0x2e')]===_0x989d('0x73')&&_0x1e974d[_0x989d('0x34')][_0x989d('0x74')][_0x989d('0x3d')]>0x0?_[_0x989d('0x31')](_0x1e974d[_0x989d('0x34')][_0x989d('0x74')],function(_0x3ec47e){return{'name':_0x3ec47e['label'],'value':_0x3ec47e['value']};}):[]};})};}})[_0x989d('0x2b')](respondWithResult(_0x103b82,null))[_0x989d('0x46')](function(_0x7fa1bd){console[_0x989d('0x75')](_0x989d('0x76')+_0x7fa1bd);var _0x4c82d9=_0x291225[_0x989d('0x39')][_0x989d('0x77')]?0x1f4:_0x7fa1bd[_0x989d('0x78')]||0x1f4;logger[_0x989d('0x79')](_0x989d('0x7a'),_0x989d('0x5c'),_0x4c82d9,JSON['stringify'](_0x7fa1bd));delete _0x7fa1bd[_0x989d('0x2e')];if(_0x4c82d9===0x191){_0x4c82d9=0x190;}_0x103b82[_0x989d('0x1e')](_0x4c82d9)[_0x989d('0x2f')](_0x291225[_0x989d('0x39')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x7fa1bd[_0x989d('0x78')]}:_0x7fa1bd);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f75bad1..f2c5247 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 _0x19df=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1be763,_0x568b31){var _0x300410=function(_0x5a8d8a){while(--_0x5a8d8a){_0x1be763['push'](_0x1be763['shift']());}};_0x300410(++_0x568b31);}(_0x19df,0x1eb));var _0xf19d=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0x19df[_0x10c51f];return _0x56a0cd;};'use strict';var _=require(_0xf19d('0x0'));var util=require(_0xf19d('0x1'));var logger=require(_0xf19d('0x2'))(_0xf19d('0x3'));var moment=require(_0xf19d('0x4'));var BPromise=require(_0xf19d('0x5'));var rp=require(_0xf19d('0x6'));var fs=require('fs');var path=require(_0xf19d('0x7'));var rimraf=require(_0xf19d('0x8'));var config=require(_0xf19d('0x9'));var attributes=require(_0xf19d('0xa'));var integrations=require(_0xf19d('0xb'));module[_0xf19d('0xc')]=function(_0x423ff3,_0x335cb1){return _0x423ff3[_0xf19d('0xd')](_0xf19d('0xe'),attributes,{'tableName':_0xf19d('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2df7=['path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5462c6,_0x30efa7){var _0x1fc3ca=function(_0x241620){while(--_0x241620){_0x5462c6['push'](_0x5462c6['shift']());}};_0x1fc3ca(++_0x30efa7);}(_0x2df7,0x1f4));var _0x72df=function(_0x53e96a,_0x298bc3){_0x53e96a=_0x53e96a-0x0;var _0x643b1a=_0x2df7[_0x53e96a];return _0x643b1a;};'use strict';var _=require(_0x72df('0x0'));var util=require('util');var logger=require(_0x72df('0x1'))(_0x72df('0x2'));var moment=require(_0x72df('0x3'));var BPromise=require(_0x72df('0x4'));var rp=require(_0x72df('0x5'));var fs=require('fs');var path=require(_0x72df('0x6'));var rimraf=require('rimraf');var config=require(_0x72df('0x7'));var attributes=require(_0x72df('0x8'));var integrations=require(_0x72df('0x9'));module['exports']=function(_0x16b1ea,_0x3c0c59){return _0x16b1ea['define']('VtigerAccount',attributes,{'tableName':_0x72df('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 261b25c..d7b0daa 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 _0xeb74=['attributes','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map'];(function(_0x303fed,_0x5eecd3){var _0x1d9585=function(_0x5ab3b5){while(--_0x5ab3b5){_0x303fed['push'](_0x303fed['shift']());}};_0x1d9585(++_0x5eecd3);}(_0xeb74,0xe3));var _0x4eb7=function(_0x5b97ee,_0x2ef7b9){_0x5b97ee=_0x5b97ee-0x0;var _0xcfd22=_0xeb74[_0x5b97ee];return _0xcfd22;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')]({'raw':_0x3b6d41['options']?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')]['attributes']||null:null,'limit':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1d')]||null:null,'include':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0x13e871){return{'model':db[_0x13e871['model']],'as':_0x13e871['as'],'attributes':_0x13e871[_0x4eb7('0x20')],'include':_0x13e871[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x13e871[_0x4eb7('0x1e')],function(_0x3e0da2){return{'model':db[_0x3e0da2[_0x4eb7('0x21')]],'as':_0x3e0da2['as'],'attributes':_0x3e0da2[_0x4eb7('0x20')],'include':_0x3e0da2[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x3e0da2[_0x4eb7('0x1e')],function(_0xf83c11){return{'model':db[_0xf83c11[_0x4eb7('0x21')]],'as':_0xf83c11['as'],'attributes':_0xf83c11[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x433794){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger[_0x4eb7('0xe')](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x22')](_0x433794));_0x302e16(_0x433794);})[_0x4eb7('0x16')](function(_0x17030a){logger[_0x4eb7('0x11')]('GetVtigerAccount',_0x17030a[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478['error'](0x1f4,_0x17030a[_0x4eb7('0x13')]));});});};exports[_0x4eb7('0x23')]=function(_0xc5aa21){var _0x1fe298=this;return new Promise(function(_0x468195,_0x1cec8e){return db[_0x4eb7('0x18')][_0x4eb7('0x24')]({'raw':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21['options'][_0x4eb7('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5aa21['options']?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1c')]||null:null,'attributes':_0xc5aa21['options']?_0xc5aa21['options'][_0x4eb7('0x20')]||null:null,'include':_0xc5aa21[_0x4eb7('0x1a')]?_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')]?_['map'](_0xc5aa21[_0x4eb7('0x1a')][_0x4eb7('0x1e')],function(_0xcc9bb4){return{'model':db[_0xcc9bb4[_0x4eb7('0x21')]],'as':_0xcc9bb4['as'],'attributes':_0xcc9bb4[_0x4eb7('0x20')],'include':_0xcc9bb4['include']?_[_0x4eb7('0x1f')](_0xcc9bb4[_0x4eb7('0x1e')],function(_0x31cc6d){return{'model':db[_0x31cc6d['model']],'as':_0x31cc6d['as'],'attributes':_0x31cc6d[_0x4eb7('0x20')],'include':_0x31cc6d[_0x4eb7('0x1e')]?_[_0x4eb7('0x1f')](_0x31cc6d['include'],function(_0x70f2b2){return{'model':db[_0x70f2b2['model']],'as':_0x70f2b2['as'],'attributes':_0x70f2b2[_0x4eb7('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4eb7('0xc')](function(_0x392fa3){logger[_0x4eb7('0x14')]('ShowVtigerAccount',_0xc5aa21);logger[_0x4eb7('0xe')](_0x4eb7('0x23'),_0xc5aa21,JSON[_0x4eb7('0x22')](_0x392fa3));_0x468195(_0x392fa3);})[_0x4eb7('0x16')](function(_0x4f0cce){logger['error']('ShowVtigerAccount',_0x4f0cce[_0x4eb7('0x13')],_0xc5aa21);_0x1cec8e(_0x1fe298[_0x4eb7('0x11')](0x1f4,_0x4f0cce[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0xe5b5=['GetVtigerAccount','VtigerAccount','options','where','attributes','include','map','model','debug','ShowVtigerAccount','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x5bc158,_0x20ba90){var _0x288d43=function(_0x4e1c7f){while(--_0x4e1c7f){_0x5bc158['push'](_0x5bc158['shift']());}};_0x288d43(++_0x20ba90);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe5b5[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}exports[_0x5e5b('0x19')]=function(_0x45a091){var _0x4c5f9a=this;return new Promise(function(_0xe5aa6b,_0x1560e1){return db[_0x5e5b('0x1a')]['findAll']({'raw':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1c')]||null:null,'attributes':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1d')]||null:null,'limit':_0x45a091[_0x5e5b('0x1b')]?_0x45a091[_0x5e5b('0x1b')]['limit']||null:null,'include':_0x45a091['options']?_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x45a091[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x28cd95){return{'model':db[_0x28cd95[_0x5e5b('0x20')]],'as':_0x28cd95['as'],'attributes':_0x28cd95[_0x5e5b('0x1d')],'include':_0x28cd95[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x28cd95[_0x5e5b('0x1e')],function(_0x4da321){return{'model':db[_0x4da321[_0x5e5b('0x20')]],'as':_0x4da321['as'],'attributes':_0x4da321[_0x5e5b('0x1d')],'include':_0x4da321[_0x5e5b('0x1e')]?_['map'](_0x4da321[_0x5e5b('0x1e')],function(_0xdb2863){return{'model':db[_0xdb2863['model']],'as':_0xdb2863['as'],'attributes':_0xdb2863[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x39ce16){logger[_0x5e5b('0x10')](_0x5e5b('0x19'),_0x45a091);logger[_0x5e5b('0x21')](_0x5e5b('0x19'),_0x45a091,JSON[_0x5e5b('0x13')](_0x39ce16));_0xe5aa6b(_0x39ce16);})[_0x5e5b('0x18')](function(_0x42da3b){logger[_0x5e5b('0x14')](_0x5e5b('0x19'),_0x42da3b['message'],_0x45a091);_0x1560e1(_0x4c5f9a['error'](0x1f4,_0x42da3b[_0x5e5b('0x16')]));});});};exports[_0x5e5b('0x22')]=function(_0xb68419){var _0x3dcdab=this;return new Promise(function(_0x12f1ee,_0x4b9be8){return db[_0x5e5b('0x1a')]['find']({'raw':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x23')]===undefined?!![]:![]:!![],'where':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1c')]||null:null,'attributes':_0xb68419[_0x5e5b('0x1b')]?_0xb68419['options'][_0x5e5b('0x1d')]||null:null,'include':_0xb68419[_0x5e5b('0x1b')]?_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0xb68419[_0x5e5b('0x1b')][_0x5e5b('0x1e')],function(_0x317451){return{'model':db[_0x317451['model']],'as':_0x317451['as'],'attributes':_0x317451[_0x5e5b('0x1d')],'include':_0x317451[_0x5e5b('0x1e')]?_[_0x5e5b('0x1f')](_0x317451[_0x5e5b('0x1e')],function(_0x7da7a5){return{'model':db[_0x7da7a5[_0x5e5b('0x20')]],'as':_0x7da7a5['as'],'attributes':_0x7da7a5['attributes'],'include':_0x7da7a5['include']?_[_0x5e5b('0x1f')](_0x7da7a5[_0x5e5b('0x1e')],function(_0x8ec651){return{'model':db[_0x8ec651['model']],'as':_0x8ec651['as'],'attributes':_0x8ec651[_0x5e5b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5e5b('0xf')](function(_0x18f5ba){logger[_0x5e5b('0x10')]('ShowVtigerAccount',_0xb68419);logger[_0x5e5b('0x21')](_0x5e5b('0x22'),_0xb68419,JSON['stringify'](_0x18f5ba));_0x12f1ee(_0x18f5ba);})['catch'](function(_0xe9c586){logger[_0x5e5b('0x14')](_0x5e5b('0x22'),_0xe9c586['message'],_0xb68419);_0x4b9be8(_0x3dcdab[_0x5e5b('0x14')](0x1f4,_0xe9c586['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index c4f591a..c3b2ba0 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 _0xd343=['post','create','put','update','exports','util','path','connect-timeout','express','../../components/auth/service','./intVtigerConfiguration.controller','isAuthenticated','/:id','show','get','getFields','/:id/descriptions','getDescriptions'];(function(_0x5a7db4,_0x1a512b){var _0x3c18f1=function(_0x4d3faf){while(--_0x4d3faf){_0x5a7db4['push'](_0x5a7db4['shift']());}};_0x3c18f1(++_0x1a512b);}(_0xd343,0x1d9));var _0x3d34=function(_0x273efe,_0x1af253){_0x273efe=_0x273efe-0x0;var _0x163b9e=_0xd343[_0x273efe];return _0x163b9e;};'use strict';var multer=require('multer');var util=require(_0x3d34('0x0'));var path=require(_0x3d34('0x1'));var timeout=require(_0x3d34('0x2'));var express=require(_0x3d34('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3d34('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3d34('0x5'));router['get']('/',auth[_0x3d34('0x6')](),controller['index']);router['get'](_0x3d34('0x7'),auth[_0x3d34('0x6')](),controller[_0x3d34('0x8')]);router[_0x3d34('0x9')]('/:id/fields',auth[_0x3d34('0x6')](),controller[_0x3d34('0xa')]);router[_0x3d34('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x3d34('0x9')](_0x3d34('0xb'),auth['isAuthenticated'](),controller[_0x3d34('0xc')]);router[_0x3d34('0xd')]('/',auth[_0x3d34('0x6')](),controller[_0x3d34('0xe')]);router[_0x3d34('0xf')]('/:id',auth[_0x3d34('0x6')](),controller[_0x3d34('0x10')]);router['delete']('/:id',auth[_0x3d34('0x6')](),controller['destroy']);module[_0x3d34('0x11')]=router; \ No newline at end of file +var _0x7022=['./intVtigerConfiguration.controller','get','isAuthenticated','index','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','delete','destroy','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5e5750,_0xcb55a7){var _0x7a6ea5=function(_0x2aea6d){while(--_0x2aea6d){_0x5e5750['push'](_0x5e5750['shift']());}};_0x7a6ea5(++_0xcb55a7);}(_0x7022,0x78));var _0x2702=function(_0x3de187,_0x1c2750){_0x3de187=_0x3de187-0x0;var _0x298599=_0x7022[_0x3de187];return _0x298599;};'use strict';var multer=require('multer');var util=require(_0x2702('0x0'));var path=require(_0x2702('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2702('0x2')]();var fs_extra=require(_0x2702('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2702('0x4'));var config=require(_0x2702('0x5'));var controller=require(_0x2702('0x6'));router[_0x2702('0x7')]('/',auth[_0x2702('0x8')](),controller[_0x2702('0x9')]);router['get']('/:id',auth[_0x2702('0x8')](),controller['show']);router[_0x2702('0x7')]('/:id/fields',auth[_0x2702('0x8')](),controller['getFields']);router[_0x2702('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2702('0xa')]);router[_0x2702('0x7')](_0x2702('0xb'),auth[_0x2702('0x8')](),controller[_0x2702('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2702('0xd')]);router[_0x2702('0xe')](_0x2702('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x2702('0x10')](_0x2702('0xf'),auth[_0x2702('0x8')](),controller[_0x2702('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8c3fe2d..3a6939d 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 _0xcfa2=['STRING','sequelize'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xcfa2,0xdd));var _0x2cfa=function(_0x2c1a0d,_0x367236){_0x2c1a0d=_0x2c1a0d-0x0;var _0x187a70=_0xcfa2[_0x2c1a0d];return _0x187a70;};'use strict';var Sequelize=require(_0x2cfa('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2cfa('0x1')]}}; \ No newline at end of file +var _0x23da=['STRING','exports'];(function(_0x8cea57,_0x290172){var _0x25ce1d=function(_0x152c9a){while(--_0x152c9a){_0x8cea57['push'](_0x8cea57['shift']());}};_0x25ce1d(++_0x290172);}(_0x23da,0xe7));var _0xa23d=function(_0x1fb3f4,_0x191a2c){_0x1fb3f4=_0x1fb3f4-0x0;var _0x19f230=_0x23da[_0x1fb3f4];return _0x19f230;};'use strict';var Sequelize=require('sequelize');module[_0xa23d('0x0')]={'name':{'type':Sequelize[_0xa23d('0x1')]},'description':{'type':Sequelize[_0xa23d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 6d8eced..fe974f4 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 _0x89b5=['update','then','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','save'];(function(_0x5eb9c1,_0x477c4b){var _0x371df6=function(_0x360e73){while(--_0x360e73){_0x5eb9c1['push'](_0x5eb9c1['shift']());}};_0x371df6(++_0x477c4b);}(_0x89b5,0x16d));var _0x589b=function(_0x193661,_0x35603a){_0x193661=_0x193661-0x0;var _0x5913e7=_0x89b5[_0x193661];return _0x5913e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x589b('0x0'));var zipdir=require(_0x589b('0x1'));var jsonpatch=require(_0x589b('0x2'));var rp=require(_0x589b('0x3'));var moment=require('moment');var BPromise=require(_0x589b('0x4'));var Mustache=require(_0x589b('0x5'));var util=require(_0x589b('0x6'));var path=require(_0x589b('0x7'));var sox=require(_0x589b('0x8'));var csv=require(_0x589b('0x9'));var ejs=require(_0x589b('0xa'));var fs=require('fs');var fs_extra=require(_0x589b('0xb'));var _=require(_0x589b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x589b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x589b('0x9'));var querystring=require(_0x589b('0xe'));var Papa=require(_0x589b('0xf'));var Redis=require('ioredis');var authService=require(_0x589b('0x10'));var qs=require(_0x589b('0x11'));var as=require(_0x589b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x589b('0x13'))('api');var utils=require(_0x589b('0x14'));var config=require(_0x589b('0x15'));var licenseUtil=require(_0x589b('0x16'));var db=require(_0x589b('0x17'))['db'];function respondWithStatusCode(_0x299757,_0x1a4384){_0x1a4384=_0x1a4384||0xcc;return function(_0x5c26d3){if(_0x5c26d3){return _0x299757[_0x589b('0x18')](_0x1a4384);}return _0x299757['status'](_0x1a4384)[_0x589b('0x19')]();};}function respondWithResult(_0x2fb807,_0x570a73){_0x570a73=_0x570a73||0xc8;return function(_0x2eaa6c){if(_0x2eaa6c){return _0x2fb807[_0x589b('0x1a')](_0x570a73)[_0x589b('0x1b')](_0x2eaa6c);}};}function respondWithFilteredResult(_0x21bb30,_0x2288a5){return function(_0x32529b){if(_0x32529b){var _0x381179=typeof _0x2288a5['offset']===_0x589b('0x1c')&&typeof _0x2288a5['limit']===_0x589b('0x1c');var _0x4739c9=_0x32529b[_0x589b('0x1d')];var _0x37c74b=_0x381179?0x0:_0x2288a5[_0x589b('0x1e')];var _0x4b7cde=_0x381179?_0x32529b[_0x589b('0x1d')]:_0x2288a5['offset']+_0x2288a5[_0x589b('0x1f')];var _0x578a8d;if(_0x4b7cde>=_0x4739c9){_0x4b7cde=_0x4739c9;_0x578a8d=0xc8;}else{_0x578a8d=0xce;}_0x21bb30[_0x589b('0x1a')](_0x578a8d);return _0x21bb30[_0x589b('0x20')]('Content-Range',_0x37c74b+'-'+_0x4b7cde+'/'+_0x4739c9)[_0x589b('0x1b')](_0x32529b);}return null;};}function patchUpdates(_0x535099){return function(_0x5d580c){try{jsonpatch[_0x589b('0x21')](_0x5d580c,_0x535099,!![]);}catch(_0x44ed3a){return BPromise['reject'](_0x44ed3a);}return _0x5d580c[_0x589b('0x22')]();};}function saveUpdates(_0x231e75,_0x46e182){return function(_0xe9d43c){if(_0xe9d43c){return _0xe9d43c[_0x589b('0x23')](_0x231e75)['then'](function(_0x40c953){return _0x40c953;});}return null;};}function removeEntity(_0x2cba4f,_0x397030){return function(_0x4ca37b){if(_0x4ca37b){return _0x4ca37b['destroy']()[_0x589b('0x24')](function(){_0x2cba4f[_0x589b('0x1a')](0xcc)[_0x589b('0x19')]();});}};}function handleEntityNotFound(_0x389fd2,_0x15f11e){return function(_0x324e90){if(!_0x324e90){_0x389fd2[_0x589b('0x18')](0x194);}return _0x324e90;};}function handleError(_0x576ab1,_0x270777){_0x270777=_0x270777||0x1f4;return function(_0x483c47){logger[_0x589b('0x25')](_0x483c47[_0x589b('0x26')]);if(_0x483c47[_0x589b('0x27')]){delete _0x483c47['name'];}_0x576ab1['status'](_0x270777)[_0x589b('0x28')](_0x483c47);};}exports[_0x589b('0x29')]=function(_0x3aee92,_0x564ff1){var _0x2e76cf={},_0x462553={},_0x2b8bce={'count':0x0,'rows':[]};var _0xa1d1bf=_[_0x589b('0x2a')](db[_0x589b('0x2b')][_0x589b('0x2c')],function(_0x469efe){return{'name':_0x469efe['fieldName'],'type':_0x469efe[_0x589b('0x2d')]['key']};});_0x462553['model']=_[_0x589b('0x2a')](_0xa1d1bf,_0x589b('0x27'));_0x462553[_0x589b('0x2e')]=_['keys'](_0x3aee92[_0x589b('0x2e')]);_0x462553[_0x589b('0x2f')]=_[_0x589b('0x30')](_0x462553[_0x589b('0x31')],_0x462553[_0x589b('0x2e')]);_0x2e76cf[_0x589b('0x32')]=_['intersection'](_0x462553[_0x589b('0x31')],qs[_0x589b('0x33')](_0x3aee92[_0x589b('0x2e')][_0x589b('0x33')]));_0x2e76cf[_0x589b('0x32')]=_0x2e76cf[_0x589b('0x32')][_0x589b('0x34')]?_0x2e76cf['attributes']:_0x462553[_0x589b('0x31')];if(!_0x3aee92[_0x589b('0x2e')][_0x589b('0x35')](_0x589b('0x36'))){_0x2e76cf[_0x589b('0x1f')]=qs[_0x589b('0x1f')](_0x3aee92[_0x589b('0x2e')][_0x589b('0x1f')]);_0x2e76cf[_0x589b('0x1e')]=qs[_0x589b('0x1e')](_0x3aee92[_0x589b('0x2e')][_0x589b('0x1e')]);}_0x2e76cf[_0x589b('0x37')]=qs[_0x589b('0x38')](_0x3aee92[_0x589b('0x2e')][_0x589b('0x38')]);_0x2e76cf[_0x589b('0x39')]=qs[_0x589b('0x2f')](_[_0x589b('0x3a')](_0x3aee92[_0x589b('0x2e')],_0x462553[_0x589b('0x2f')]),_0xa1d1bf);if(_0x3aee92['query'][_0x589b('0x3b')]){_0x2e76cf['where']=_[_0x589b('0x3c')](_0x2e76cf[_0x589b('0x39')],{'$or':_[_0x589b('0x2a')](_0xa1d1bf,function(_0x1e3de6){if(_0x1e3de6[_0x589b('0x2d')]!==_0x589b('0x3d')){var _0x3c48f9={};_0x3c48f9[_0x1e3de6['name']]={'$like':'%'+_0x3aee92['query'][_0x589b('0x3b')]+'%'};return _0x3c48f9;}})});}_0x2e76cf=_[_0x589b('0x3c')]({},_0x2e76cf,_0x3aee92[_0x589b('0x3e')]);var _0xa71b09={'where':_0x2e76cf[_0x589b('0x39')]};return db['VtigerConfiguration']['count'](_0xa71b09)[_0x589b('0x24')](function(_0xda3e97){_0x2b8bce[_0x589b('0x1d')]=_0xda3e97;if(_0x3aee92[_0x589b('0x2e')][_0x589b('0x3f')]){_0x2e76cf['include']=[{'all':!![]}];}return db[_0x589b('0x2b')][_0x589b('0x40')](_0x2e76cf);})[_0x589b('0x24')](function(_0x49730e){_0x2b8bce[_0x589b('0x41')]=_0x49730e;return _0x2b8bce;})[_0x589b('0x24')](respondWithFilteredResult(_0x564ff1,_0x2e76cf))[_0x589b('0x42')](handleError(_0x564ff1,null));};exports[_0x589b('0x43')]=function(_0x17f947,_0x255aa8){var _0x1d9c42={'raw':![],'where':{'id':_0x17f947['params']['id']}},_0x423147={};_0x423147[_0x589b('0x31')]=_['keys'](db[_0x589b('0x2b')][_0x589b('0x2c')]);_0x423147[_0x589b('0x2e')]=_[_0x589b('0x44')](_0x17f947['query']);_0x423147[_0x589b('0x2f')]=_[_0x589b('0x30')](_0x423147['model'],_0x423147[_0x589b('0x2e')]);_0x1d9c42[_0x589b('0x32')]=_['intersection'](_0x423147['model'],qs['fields'](_0x17f947[_0x589b('0x2e')][_0x589b('0x33')]));_0x1d9c42[_0x589b('0x32')]=_0x1d9c42[_0x589b('0x32')][_0x589b('0x34')]?_0x1d9c42[_0x589b('0x32')]:_0x423147[_0x589b('0x31')];if(_0x17f947[_0x589b('0x2e')]['includeAll']){_0x1d9c42[_0x589b('0x45')]=[{'all':!![]}];}_0x1d9c42=_[_0x589b('0x3c')]({},_0x1d9c42,_0x17f947[_0x589b('0x3e')]);return db[_0x589b('0x2b')][_0x589b('0x46')](_0x1d9c42)[_0x589b('0x24')](handleEntityNotFound(_0x255aa8,null))[_0x589b('0x24')](respondWithResult(_0x255aa8,null))['catch'](handleError(_0x255aa8,null));};exports[_0x589b('0x47')]=function(_0x183a0f,_0x3f2dd){return db[_0x589b('0x2b')][_0x589b('0x47')](_0x183a0f[_0x589b('0x48')],{})[_0x589b('0x24')](respondWithResult(_0x3f2dd,0xc9))[_0x589b('0x42')](handleError(_0x3f2dd,null));};exports[_0x589b('0x23')]=function(_0x173bce,_0x242c6c){if(_0x173bce[_0x589b('0x48')]['id']){delete _0x173bce[_0x589b('0x48')]['id'];}return db[_0x589b('0x2b')][_0x589b('0x46')]({'where':{'id':_0x173bce[_0x589b('0x49')]['id']}})[_0x589b('0x24')](handleEntityNotFound(_0x242c6c,null))[_0x589b('0x24')](saveUpdates(_0x173bce[_0x589b('0x48')],null))[_0x589b('0x24')](respondWithResult(_0x242c6c,null))[_0x589b('0x42')](handleError(_0x242c6c,null));};exports[_0x589b('0x4a')]=function(_0x2cbb70,_0xc38867){return db[_0x589b('0x2b')][_0x589b('0x46')]({'where':{'id':_0x2cbb70[_0x589b('0x49')]['id']}})[_0x589b('0x24')](handleEntityNotFound(_0xc38867,null))['then'](removeEntity(_0xc38867,null))[_0x589b('0x42')](handleError(_0xc38867,null));};exports[_0x589b('0x4b')]=function(_0x2fd4f4,_0x334ad8,_0x2f5d6e){var _0xf8d708={};var _0x437e1a={};var _0x482827;var _0x51b360;return db[_0x589b('0x2b')][_0x589b('0x4c')]({'where':{'id':_0x2fd4f4[_0x589b('0x49')]['id']}})[_0x589b('0x24')](handleEntityNotFound(_0x334ad8,null))[_0x589b('0x24')](function(_0x223914){if(_0x223914){_0x482827=_0x223914;_0x437e1a[_0x589b('0x31')]=_['keys'](db[_0x589b('0x4d')]['rawAttributes']);_0x437e1a[_0x589b('0x2e')]=_[_0x589b('0x44')](_0x2fd4f4[_0x589b('0x2e')]);_0x437e1a[_0x589b('0x2f')]=_[_0x589b('0x30')](_0x437e1a[_0x589b('0x31')],_0x437e1a['query']);_0xf8d708[_0x589b('0x32')]=_['intersection'](_0x437e1a['model'],qs[_0x589b('0x33')](_0x2fd4f4[_0x589b('0x2e')][_0x589b('0x33')]));_0xf8d708[_0x589b('0x32')]=_0xf8d708[_0x589b('0x32')][_0x589b('0x34')]?_0xf8d708[_0x589b('0x32')]:_0x437e1a[_0x589b('0x31')];_0xf8d708[_0x589b('0x37')]=qs[_0x589b('0x38')](_0x2fd4f4['query'][_0x589b('0x38')]);_0xf8d708[_0x589b('0x39')]=qs[_0x589b('0x2f')](_[_0x589b('0x3a')](_0x2fd4f4[_0x589b('0x2e')],_0x437e1a[_0x589b('0x2f')]));if(_0x2fd4f4[_0x589b('0x2e')][_0x589b('0x3b')]){_0xf8d708[_0x589b('0x39')]=_[_0x589b('0x3c')](_0xf8d708[_0x589b('0x39')],{'$or':_[_0x589b('0x2a')](_0xf8d708['attributes'],function(_0x1e44c9){var _0x19713d={};_0x19713d[_0x1e44c9]={'$like':'%'+_0x2fd4f4['query'][_0x589b('0x3b')]+'%'};return _0x19713d;})});}_0xf8d708=_[_0x589b('0x3c')]({},_0xf8d708,_0x2fd4f4[_0x589b('0x3e')]);return _0x482827[_0x589b('0x4b')](_0xf8d708);}})[_0x589b('0x24')](function(_0xb75b98){if(_0xb75b98){_0x51b360=_0xb75b98['length'];if(!_0x2fd4f4[_0x589b('0x2e')][_0x589b('0x35')]('nolimit')){_0xf8d708[_0x589b('0x1f')]=qs[_0x589b('0x1f')](_0x2fd4f4[_0x589b('0x2e')]['limit']);_0xf8d708[_0x589b('0x1e')]=qs[_0x589b('0x1e')](_0x2fd4f4[_0x589b('0x2e')][_0x589b('0x1e')]);}return _0x482827['getFields'](_0xf8d708);}})['then'](function(_0x1b9bb4){if(_0x1b9bb4){return _0x1b9bb4?{'count':_0x51b360,'rows':_0x1b9bb4}:null;}})[_0x589b('0x24')](respondWithResult(_0x334ad8,null))[_0x589b('0x42')](handleError(_0x334ad8,null));};exports[_0x589b('0x4e')]=function(_0x315ca3,_0x111701,_0x33cab7){var _0x2d5326={};var _0x1529a2={};var _0x456d2b;var _0x3ab179;return db[_0x589b('0x2b')][_0x589b('0x4c')]({'where':{'id':_0x315ca3[_0x589b('0x49')]['id']}})[_0x589b('0x24')](handleEntityNotFound(_0x111701,null))[_0x589b('0x24')](function(_0x241c12){if(_0x241c12){_0x456d2b=_0x241c12;_0x1529a2[_0x589b('0x31')]=_['keys'](db[_0x589b('0x4d')][_0x589b('0x2c')]);_0x1529a2[_0x589b('0x2e')]=_[_0x589b('0x44')](_0x315ca3[_0x589b('0x2e')]);_0x1529a2['filters']=_[_0x589b('0x30')](_0x1529a2[_0x589b('0x31')],_0x1529a2[_0x589b('0x2e')]);_0x2d5326[_0x589b('0x32')]=_[_0x589b('0x30')](_0x1529a2[_0x589b('0x31')],qs[_0x589b('0x33')](_0x315ca3[_0x589b('0x2e')]['fields']));_0x2d5326[_0x589b('0x32')]=_0x2d5326[_0x589b('0x32')][_0x589b('0x34')]?_0x2d5326[_0x589b('0x32')]:_0x1529a2[_0x589b('0x31')];_0x2d5326[_0x589b('0x37')]=qs['sort'](_0x315ca3['query']['sort']);_0x2d5326[_0x589b('0x39')]=qs[_0x589b('0x2f')](_['pick'](_0x315ca3[_0x589b('0x2e')],_0x1529a2[_0x589b('0x2f')]));if(_0x315ca3[_0x589b('0x2e')][_0x589b('0x3b')]){_0x2d5326[_0x589b('0x39')]=_[_0x589b('0x3c')](_0x2d5326[_0x589b('0x39')],{'$or':_[_0x589b('0x2a')](_0x2d5326[_0x589b('0x32')],function(_0x290b13){var _0x3f1c6e={};_0x3f1c6e[_0x290b13]={'$like':'%'+_0x315ca3[_0x589b('0x2e')][_0x589b('0x3b')]+'%'};return _0x3f1c6e;})});}_0x2d5326=_[_0x589b('0x3c')]({},_0x2d5326,_0x315ca3['options']);return _0x456d2b[_0x589b('0x4e')](_0x2d5326);}})['then'](function(_0x560d58){if(_0x560d58){_0x3ab179=_0x560d58[_0x589b('0x34')];if(!_0x315ca3[_0x589b('0x2e')][_0x589b('0x35')](_0x589b('0x36'))){_0x2d5326[_0x589b('0x1f')]=qs[_0x589b('0x1f')](_0x315ca3[_0x589b('0x2e')][_0x589b('0x1f')]);_0x2d5326[_0x589b('0x1e')]=qs[_0x589b('0x1e')](_0x315ca3[_0x589b('0x2e')][_0x589b('0x1e')]);}return _0x456d2b['getSubjects'](_0x2d5326);}})[_0x589b('0x24')](function(_0x37a09c){if(_0x37a09c){return _0x37a09c?{'count':_0x3ab179,'rows':_0x37a09c}:null;}})[_0x589b('0x24')](respondWithResult(_0x111701,null))['catch'](handleError(_0x111701,null));};exports['getDescriptions']=function(_0x39081b,_0xfdaeb9,_0x1e1e29){var _0x2759c8={};var _0x52612b={};var _0x3ed163;var _0x308777;return db['VtigerConfiguration'][_0x589b('0x4c')]({'where':{'id':_0x39081b[_0x589b('0x49')]['id']}})[_0x589b('0x24')](handleEntityNotFound(_0xfdaeb9,null))[_0x589b('0x24')](function(_0x54a77b){if(_0x54a77b){_0x3ed163=_0x54a77b;_0x52612b[_0x589b('0x31')]=_[_0x589b('0x44')](db['VtigerField'][_0x589b('0x2c')]);_0x52612b['query']=_['keys'](_0x39081b['query']);_0x52612b[_0x589b('0x2f')]=_['intersection'](_0x52612b['model'],_0x52612b['query']);_0x2759c8[_0x589b('0x32')]=_[_0x589b('0x30')](_0x52612b[_0x589b('0x31')],qs[_0x589b('0x33')](_0x39081b[_0x589b('0x2e')][_0x589b('0x33')]));_0x2759c8[_0x589b('0x32')]=_0x2759c8[_0x589b('0x32')][_0x589b('0x34')]?_0x2759c8['attributes']:_0x52612b[_0x589b('0x31')];_0x2759c8[_0x589b('0x37')]=qs[_0x589b('0x38')](_0x39081b[_0x589b('0x2e')][_0x589b('0x38')]);_0x2759c8[_0x589b('0x39')]=qs[_0x589b('0x2f')](_[_0x589b('0x3a')](_0x39081b[_0x589b('0x2e')],_0x52612b[_0x589b('0x2f')]));if(_0x39081b[_0x589b('0x2e')][_0x589b('0x3b')]){_0x2759c8[_0x589b('0x39')]=_[_0x589b('0x3c')](_0x2759c8[_0x589b('0x39')],{'$or':_[_0x589b('0x2a')](_0x2759c8[_0x589b('0x32')],function(_0x2d749d){var _0x57c4ad={};_0x57c4ad[_0x2d749d]={'$like':'%'+_0x39081b['query'][_0x589b('0x3b')]+'%'};return _0x57c4ad;})});}_0x2759c8=_['merge']({},_0x2759c8,_0x39081b['options']);return _0x3ed163[_0x589b('0x4f')](_0x2759c8);}})[_0x589b('0x24')](function(_0x416572){if(_0x416572){_0x308777=_0x416572[_0x589b('0x34')];if(!_0x39081b[_0x589b('0x2e')][_0x589b('0x35')]('nolimit')){_0x2759c8[_0x589b('0x1f')]=qs['limit'](_0x39081b[_0x589b('0x2e')]['limit']);_0x2759c8[_0x589b('0x1e')]=qs['offset'](_0x39081b[_0x589b('0x2e')]['offset']);}return _0x3ed163[_0x589b('0x4f')](_0x2759c8);}})[_0x589b('0x24')](function(_0x12cb7f){if(_0x12cb7f){return _0x12cb7f?{'count':_0x308777,'rows':_0x12cb7f}:null;}})[_0x589b('0x24')](respondWithResult(_0xfdaeb9,null))['catch'](handleError(_0xfdaeb9,null));}; \ No newline at end of file +var _0xe7be=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','error','name','send','map','VtigerConfiguration','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','merge','where','options','includeAll','include','catch','params','rawAttributes','find','create','body','getFields','findOne','VtigerField','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce'];(function(_0x3cfa6f,_0x56f736){var _0xf3c1c4=function(_0x188701){while(--_0x188701){_0x3cfa6f['push'](_0x3cfa6f['shift']());}};_0xf3c1c4(++_0x56f736);}(_0xe7be,0x16a));var _0xee7b=function(_0x3a0f28,_0x29376){_0x3a0f28=_0x3a0f28-0x0;var _0x17110a=_0xe7be[_0x3a0f28];return _0x17110a;};'use strict';var emlformat=require(_0xee7b('0x0'));var rimraf=require(_0xee7b('0x1'));var zipdir=require(_0xee7b('0x2'));var jsonpatch=require(_0xee7b('0x3'));var rp=require('request-promise');var moment=require(_0xee7b('0x4'));var BPromise=require(_0xee7b('0x5'));var Mustache=require(_0xee7b('0x6'));var util=require(_0xee7b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xee7b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee7b('0x9'));var _=require(_0xee7b('0xa'));var squel=require(_0xee7b('0xb'));var crypto=require('crypto');var jsforce=require(_0xee7b('0xc'));var deskjs=require(_0xee7b('0xd'));var toCsv=require(_0xee7b('0x8'));var querystring=require(_0xee7b('0xe'));var Papa=require(_0xee7b('0xf'));var Redis=require('ioredis');var authService=require(_0xee7b('0x10'));var qs=require(_0xee7b('0x11'));var as=require(_0xee7b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7b('0x13'))(_0xee7b('0x14'));var utils=require(_0xee7b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee7b('0x16'));var db=require(_0xee7b('0x17'))['db'];function respondWithStatusCode(_0x1c19c8,_0x562dee){_0x562dee=_0x562dee||0xcc;return function(_0x535e0d){if(_0x535e0d){return _0x1c19c8[_0xee7b('0x18')](_0x562dee);}return _0x1c19c8['status'](_0x562dee)[_0xee7b('0x19')]();};}function respondWithResult(_0x231f8d,_0xb82a8b){_0xb82a8b=_0xb82a8b||0xc8;return function(_0x1ee8e7){if(_0x1ee8e7){return _0x231f8d['status'](_0xb82a8b)[_0xee7b('0x1a')](_0x1ee8e7);}};}function respondWithFilteredResult(_0x8806e1,_0x12515b){return function(_0x427650){if(_0x427650){var _0x4093ef=typeof _0x12515b[_0xee7b('0x1b')]==='undefined'&&typeof _0x12515b['limit']===_0xee7b('0x1c');var _0x4ab366=_0x427650['count'];var _0x430dd2=_0x4093ef?0x0:_0x12515b[_0xee7b('0x1b')];var _0x1e8c9b=_0x4093ef?_0x427650[_0xee7b('0x1d')]:_0x12515b[_0xee7b('0x1b')]+_0x12515b['limit'];var _0x532447;if(_0x1e8c9b>=_0x4ab366){_0x1e8c9b=_0x4ab366;_0x532447=0xc8;}else{_0x532447=0xce;}_0x8806e1['status'](_0x532447);return _0x8806e1[_0xee7b('0x1e')]('Content-Range',_0x430dd2+'-'+_0x1e8c9b+'/'+_0x4ab366)[_0xee7b('0x1a')](_0x427650);}return null;};}function patchUpdates(_0x574a77){return function(_0x5d0104){try{jsonpatch[_0xee7b('0x1f')](_0x5d0104,_0x574a77,!![]);}catch(_0xbcd573){return BPromise[_0xee7b('0x20')](_0xbcd573);}return _0x5d0104[_0xee7b('0x21')]();};}function saveUpdates(_0x33b5a7,_0x223040){return function(_0x5e7c8f){if(_0x5e7c8f){return _0x5e7c8f[_0xee7b('0x22')](_0x33b5a7)['then'](function(_0x3effc7){return _0x3effc7;});}return null;};}function removeEntity(_0x1dd22b,_0x2ecab2){return function(_0x17cbd1){if(_0x17cbd1){return _0x17cbd1[_0xee7b('0x23')]()[_0xee7b('0x24')](function(){_0x1dd22b['status'](0xcc)[_0xee7b('0x19')]();});}};}function handleEntityNotFound(_0x1464c3,_0x163339){return function(_0x3575b4){if(!_0x3575b4){_0x1464c3['sendStatus'](0x194);}return _0x3575b4;};}function handleError(_0x40904c,_0x241b11){_0x241b11=_0x241b11||0x1f4;return function(_0x360160){logger[_0xee7b('0x25')](_0x360160['stack']);if(_0x360160[_0xee7b('0x26')]){delete _0x360160[_0xee7b('0x26')];}_0x40904c['status'](_0x241b11)[_0xee7b('0x27')](_0x360160);};}exports['index']=function(_0x12e347,_0x3a5216){var _0x4fda5d={},_0x1ed251={},_0x333909={'count':0x0,'rows':[]};var _0x44c040=_[_0xee7b('0x28')](db[_0xee7b('0x29')]['rawAttributes'],function(_0x178615){return{'name':_0x178615[_0xee7b('0x2a')],'type':_0x178615[_0xee7b('0x2b')]['key']};});_0x1ed251[_0xee7b('0x2c')]=_[_0xee7b('0x28')](_0x44c040,'name');_0x1ed251[_0xee7b('0x2d')]=_[_0xee7b('0x2e')](_0x12e347[_0xee7b('0x2d')]);_0x1ed251['filters']=_['intersection'](_0x1ed251[_0xee7b('0x2c')],_0x1ed251['query']);_0x4fda5d[_0xee7b('0x2f')]=_[_0xee7b('0x30')](_0x1ed251[_0xee7b('0x2c')],qs[_0xee7b('0x31')](_0x12e347[_0xee7b('0x2d')][_0xee7b('0x31')]));_0x4fda5d['attributes']=_0x4fda5d[_0xee7b('0x2f')][_0xee7b('0x32')]?_0x4fda5d['attributes']:_0x1ed251[_0xee7b('0x2c')];if(!_0x12e347[_0xee7b('0x2d')][_0xee7b('0x33')](_0xee7b('0x34'))){_0x4fda5d[_0xee7b('0x35')]=qs['limit'](_0x12e347[_0xee7b('0x2d')]['limit']);_0x4fda5d[_0xee7b('0x1b')]=qs[_0xee7b('0x1b')](_0x12e347['query']['offset']);}_0x4fda5d[_0xee7b('0x36')]=qs[_0xee7b('0x37')](_0x12e347[_0xee7b('0x2d')][_0xee7b('0x37')]);_0x4fda5d['where']=qs[_0xee7b('0x38')](_[_0xee7b('0x39')](_0x12e347[_0xee7b('0x2d')],_0x1ed251[_0xee7b('0x38')]),_0x44c040);if(_0x12e347[_0xee7b('0x2d')]['filter']){_0x4fda5d['where']=_[_0xee7b('0x3a')](_0x4fda5d[_0xee7b('0x3b')],{'$or':_[_0xee7b('0x28')](_0x44c040,function(_0x1059db){if(_0x1059db['type']!=='VIRTUAL'){var _0x3b99a3={};_0x3b99a3[_0x1059db[_0xee7b('0x26')]]={'$like':'%'+_0x12e347[_0xee7b('0x2d')]['filter']+'%'};return _0x3b99a3;}})});}_0x4fda5d=_[_0xee7b('0x3a')]({},_0x4fda5d,_0x12e347[_0xee7b('0x3c')]);var _0x38f132={'where':_0x4fda5d['where']};return db['VtigerConfiguration'][_0xee7b('0x1d')](_0x38f132)['then'](function(_0x4e6e97){_0x333909['count']=_0x4e6e97;if(_0x12e347['query'][_0xee7b('0x3d')]){_0x4fda5d[_0xee7b('0x3e')]=[{'all':!![]}];}return db[_0xee7b('0x29')]['findAll'](_0x4fda5d);})[_0xee7b('0x24')](function(_0x52f564){_0x333909['rows']=_0x52f564;return _0x333909;})[_0xee7b('0x24')](respondWithFilteredResult(_0x3a5216,_0x4fda5d))[_0xee7b('0x3f')](handleError(_0x3a5216,null));};exports['show']=function(_0x514464,_0x3e4b2e){var _0x5cb4ee={'raw':![],'where':{'id':_0x514464[_0xee7b('0x40')]['id']}},_0x22f6be={};_0x22f6be['model']=_['keys'](db[_0xee7b('0x29')][_0xee7b('0x41')]);_0x22f6be[_0xee7b('0x2d')]=_[_0xee7b('0x2e')](_0x514464[_0xee7b('0x2d')]);_0x22f6be['filters']=_[_0xee7b('0x30')](_0x22f6be[_0xee7b('0x2c')],_0x22f6be[_0xee7b('0x2d')]);_0x5cb4ee[_0xee7b('0x2f')]=_['intersection'](_0x22f6be['model'],qs[_0xee7b('0x31')](_0x514464[_0xee7b('0x2d')][_0xee7b('0x31')]));_0x5cb4ee[_0xee7b('0x2f')]=_0x5cb4ee[_0xee7b('0x2f')]['length']?_0x5cb4ee[_0xee7b('0x2f')]:_0x22f6be[_0xee7b('0x2c')];if(_0x514464[_0xee7b('0x2d')]['includeAll']){_0x5cb4ee[_0xee7b('0x3e')]=[{'all':!![]}];}_0x5cb4ee=_['merge']({},_0x5cb4ee,_0x514464[_0xee7b('0x3c')]);return db[_0xee7b('0x29')][_0xee7b('0x42')](_0x5cb4ee)['then'](handleEntityNotFound(_0x3e4b2e,null))[_0xee7b('0x24')](respondWithResult(_0x3e4b2e,null))['catch'](handleError(_0x3e4b2e,null));};exports[_0xee7b('0x43')]=function(_0x4d583c,_0xfa0247){return db[_0xee7b('0x29')]['create'](_0x4d583c[_0xee7b('0x44')],{})['then'](respondWithResult(_0xfa0247,0xc9))[_0xee7b('0x3f')](handleError(_0xfa0247,null));};exports['update']=function(_0x4d93d5,_0x3f9607){if(_0x4d93d5[_0xee7b('0x44')]['id']){delete _0x4d93d5['body']['id'];}return db[_0xee7b('0x29')][_0xee7b('0x42')]({'where':{'id':_0x4d93d5[_0xee7b('0x40')]['id']}})['then'](handleEntityNotFound(_0x3f9607,null))[_0xee7b('0x24')](saveUpdates(_0x4d93d5[_0xee7b('0x44')],null))[_0xee7b('0x24')](respondWithResult(_0x3f9607,null))['catch'](handleError(_0x3f9607,null));};exports[_0xee7b('0x23')]=function(_0xd9a19f,_0x3eac6e){return db[_0xee7b('0x29')][_0xee7b('0x42')]({'where':{'id':_0xd9a19f[_0xee7b('0x40')]['id']}})[_0xee7b('0x24')](handleEntityNotFound(_0x3eac6e,null))[_0xee7b('0x24')](removeEntity(_0x3eac6e,null))['catch'](handleError(_0x3eac6e,null));};exports[_0xee7b('0x45')]=function(_0x2f800e,_0x32e877,_0x4e3cc1){var _0x494ef5={};var _0x5d8f05={};var _0x5d8b71;var _0x2072a4;return db[_0xee7b('0x29')][_0xee7b('0x46')]({'where':{'id':_0x2f800e[_0xee7b('0x40')]['id']}})['then'](handleEntityNotFound(_0x32e877,null))[_0xee7b('0x24')](function(_0x37ea68){if(_0x37ea68){_0x5d8b71=_0x37ea68;_0x5d8f05['model']=_[_0xee7b('0x2e')](db[_0xee7b('0x47')][_0xee7b('0x41')]);_0x5d8f05[_0xee7b('0x2d')]=_[_0xee7b('0x2e')](_0x2f800e[_0xee7b('0x2d')]);_0x5d8f05[_0xee7b('0x38')]=_[_0xee7b('0x30')](_0x5d8f05[_0xee7b('0x2c')],_0x5d8f05[_0xee7b('0x2d')]);_0x494ef5[_0xee7b('0x2f')]=_['intersection'](_0x5d8f05[_0xee7b('0x2c')],qs[_0xee7b('0x31')](_0x2f800e[_0xee7b('0x2d')][_0xee7b('0x31')]));_0x494ef5[_0xee7b('0x2f')]=_0x494ef5[_0xee7b('0x2f')][_0xee7b('0x32')]?_0x494ef5[_0xee7b('0x2f')]:_0x5d8f05[_0xee7b('0x2c')];_0x494ef5[_0xee7b('0x36')]=qs[_0xee7b('0x37')](_0x2f800e[_0xee7b('0x2d')]['sort']);_0x494ef5[_0xee7b('0x3b')]=qs[_0xee7b('0x38')](_[_0xee7b('0x39')](_0x2f800e[_0xee7b('0x2d')],_0x5d8f05[_0xee7b('0x38')]));if(_0x2f800e[_0xee7b('0x2d')][_0xee7b('0x48')]){_0x494ef5['where']=_[_0xee7b('0x3a')](_0x494ef5[_0xee7b('0x3b')],{'$or':_[_0xee7b('0x28')](_0x494ef5[_0xee7b('0x2f')],function(_0x48dcca){var _0x59a8dd={};_0x59a8dd[_0x48dcca]={'$like':'%'+_0x2f800e[_0xee7b('0x2d')]['filter']+'%'};return _0x59a8dd;})});}_0x494ef5=_[_0xee7b('0x3a')]({},_0x494ef5,_0x2f800e[_0xee7b('0x3c')]);return _0x5d8b71[_0xee7b('0x45')](_0x494ef5);}})['then'](function(_0x5efc5f){if(_0x5efc5f){_0x2072a4=_0x5efc5f['length'];if(!_0x2f800e[_0xee7b('0x2d')][_0xee7b('0x33')]('nolimit')){_0x494ef5[_0xee7b('0x35')]=qs[_0xee7b('0x35')](_0x2f800e['query']['limit']);_0x494ef5[_0xee7b('0x1b')]=qs['offset'](_0x2f800e['query'][_0xee7b('0x1b')]);}return _0x5d8b71[_0xee7b('0x45')](_0x494ef5);}})[_0xee7b('0x24')](function(_0x4f9b2a){if(_0x4f9b2a){return _0x4f9b2a?{'count':_0x2072a4,'rows':_0x4f9b2a}:null;}})[_0xee7b('0x24')](respondWithResult(_0x32e877,null))[_0xee7b('0x3f')](handleError(_0x32e877,null));};exports[_0xee7b('0x49')]=function(_0x4bd604,_0x893955,_0x254fe3){var _0x4b2555={};var _0x49fa7f={};var _0x41090e;var _0x5ad3ad;return db[_0xee7b('0x29')][_0xee7b('0x46')]({'where':{'id':_0x4bd604[_0xee7b('0x40')]['id']}})[_0xee7b('0x24')](handleEntityNotFound(_0x893955,null))[_0xee7b('0x24')](function(_0x1694f9){if(_0x1694f9){_0x41090e=_0x1694f9;_0x49fa7f[_0xee7b('0x2c')]=_[_0xee7b('0x2e')](db[_0xee7b('0x47')][_0xee7b('0x41')]);_0x49fa7f[_0xee7b('0x2d')]=_[_0xee7b('0x2e')](_0x4bd604[_0xee7b('0x2d')]);_0x49fa7f[_0xee7b('0x38')]=_[_0xee7b('0x30')](_0x49fa7f[_0xee7b('0x2c')],_0x49fa7f[_0xee7b('0x2d')]);_0x4b2555[_0xee7b('0x2f')]=_[_0xee7b('0x30')](_0x49fa7f[_0xee7b('0x2c')],qs[_0xee7b('0x31')](_0x4bd604[_0xee7b('0x2d')]['fields']));_0x4b2555[_0xee7b('0x2f')]=_0x4b2555[_0xee7b('0x2f')]['length']?_0x4b2555[_0xee7b('0x2f')]:_0x49fa7f['model'];_0x4b2555[_0xee7b('0x36')]=qs[_0xee7b('0x37')](_0x4bd604['query']['sort']);_0x4b2555[_0xee7b('0x3b')]=qs['filters'](_['pick'](_0x4bd604[_0xee7b('0x2d')],_0x49fa7f[_0xee7b('0x38')]));if(_0x4bd604['query'][_0xee7b('0x48')]){_0x4b2555[_0xee7b('0x3b')]=_['merge'](_0x4b2555['where'],{'$or':_['map'](_0x4b2555['attributes'],function(_0xfcbad){var _0x5aeb52={};_0x5aeb52[_0xfcbad]={'$like':'%'+_0x4bd604[_0xee7b('0x2d')][_0xee7b('0x48')]+'%'};return _0x5aeb52;})});}_0x4b2555=_['merge']({},_0x4b2555,_0x4bd604[_0xee7b('0x3c')]);return _0x41090e[_0xee7b('0x49')](_0x4b2555);}})[_0xee7b('0x24')](function(_0x42147b){if(_0x42147b){_0x5ad3ad=_0x42147b['length'];if(!_0x4bd604[_0xee7b('0x2d')][_0xee7b('0x33')](_0xee7b('0x34'))){_0x4b2555[_0xee7b('0x35')]=qs[_0xee7b('0x35')](_0x4bd604[_0xee7b('0x2d')][_0xee7b('0x35')]);_0x4b2555[_0xee7b('0x1b')]=qs[_0xee7b('0x1b')](_0x4bd604[_0xee7b('0x2d')]['offset']);}return _0x41090e['getSubjects'](_0x4b2555);}})[_0xee7b('0x24')](function(_0x14e3c1){if(_0x14e3c1){return _0x14e3c1?{'count':_0x5ad3ad,'rows':_0x14e3c1}:null;}})['then'](respondWithResult(_0x893955,null))['catch'](handleError(_0x893955,null));};exports[_0xee7b('0x4a')]=function(_0x13a231,_0x3f8b64,_0x2b9918){var _0x2f33a8={};var _0x3b96f1={};var _0x4880e1;var _0x9f844e;return db[_0xee7b('0x29')][_0xee7b('0x46')]({'where':{'id':_0x13a231['params']['id']}})[_0xee7b('0x24')](handleEntityNotFound(_0x3f8b64,null))[_0xee7b('0x24')](function(_0x5f21d4){if(_0x5f21d4){_0x4880e1=_0x5f21d4;_0x3b96f1[_0xee7b('0x2c')]=_[_0xee7b('0x2e')](db['VtigerField']['rawAttributes']);_0x3b96f1[_0xee7b('0x2d')]=_[_0xee7b('0x2e')](_0x13a231[_0xee7b('0x2d')]);_0x3b96f1['filters']=_[_0xee7b('0x30')](_0x3b96f1[_0xee7b('0x2c')],_0x3b96f1['query']);_0x2f33a8['attributes']=_[_0xee7b('0x30')](_0x3b96f1[_0xee7b('0x2c')],qs['fields'](_0x13a231[_0xee7b('0x2d')][_0xee7b('0x31')]));_0x2f33a8['attributes']=_0x2f33a8[_0xee7b('0x2f')][_0xee7b('0x32')]?_0x2f33a8['attributes']:_0x3b96f1[_0xee7b('0x2c')];_0x2f33a8['order']=qs[_0xee7b('0x37')](_0x13a231[_0xee7b('0x2d')]['sort']);_0x2f33a8[_0xee7b('0x3b')]=qs[_0xee7b('0x38')](_['pick'](_0x13a231[_0xee7b('0x2d')],_0x3b96f1[_0xee7b('0x38')]));if(_0x13a231[_0xee7b('0x2d')]['filter']){_0x2f33a8[_0xee7b('0x3b')]=_[_0xee7b('0x3a')](_0x2f33a8[_0xee7b('0x3b')],{'$or':_[_0xee7b('0x28')](_0x2f33a8[_0xee7b('0x2f')],function(_0x2f93dd){var _0x121bda={};_0x121bda[_0x2f93dd]={'$like':'%'+_0x13a231['query'][_0xee7b('0x48')]+'%'};return _0x121bda;})});}_0x2f33a8=_[_0xee7b('0x3a')]({},_0x2f33a8,_0x13a231[_0xee7b('0x3c')]);return _0x4880e1[_0xee7b('0x4a')](_0x2f33a8);}})[_0xee7b('0x24')](function(_0x282441){if(_0x282441){_0x9f844e=_0x282441['length'];if(!_0x13a231['query'][_0xee7b('0x33')](_0xee7b('0x34'))){_0x2f33a8['limit']=qs['limit'](_0x13a231['query']['limit']);_0x2f33a8[_0xee7b('0x1b')]=qs[_0xee7b('0x1b')](_0x13a231['query'][_0xee7b('0x1b')]);}return _0x4880e1[_0xee7b('0x4a')](_0x2f33a8);}})[_0xee7b('0x24')](function(_0x203571){if(_0x203571){return _0x203571?{'count':_0x9f844e,'rows':_0x203571}:null;}})[_0xee7b('0x24')](respondWithResult(_0x3f8b64,null))[_0xee7b('0x3f')](handleError(_0x3f8b64,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bdee770..5bd65cd 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 _0x4c64=['request-promise','path','rimraf','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api','moment','bluebird'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x4c64,0x15c));var _0x44c6=function(_0x4ba6cf,_0x4da8ca){_0x4ba6cf=_0x4ba6cf-0x0;var _0x40bc2b=_0x4c64[_0x4ba6cf];return _0x40bc2b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44c6('0x0'))(_0x44c6('0x1'));var moment=require(_0x44c6('0x2'));var BPromise=require(_0x44c6('0x3'));var rp=require(_0x44c6('0x4'));var fs=require('fs');var path=require(_0x44c6('0x5'));var rimraf=require(_0x44c6('0x6'));var config=require('../../config/environment');var attributes=require(_0x44c6('0x7'));module['exports']=function(_0x4d45a3,_0x21d408){return _0x4d45a3[_0x44c6('0x8')](_0x44c6('0x9'),attributes,{'tableName':_0x44c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c4b=['../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','util','api','moment','bluebird','path','rimraf'];(function(_0x573751,_0x2a49d3){var _0x2ced1c=function(_0x3710c8){while(--_0x3710c8){_0x573751['push'](_0x573751['shift']());}};_0x2ced1c(++_0x2a49d3);}(_0x5c4b,0x86));var _0xb5c4=function(_0x2b86d4,_0x45e314){_0x2b86d4=_0x2b86d4-0x0;var _0x141ab1=_0x5c4b[_0x2b86d4];return _0x141ab1;};'use strict';var _=require('lodash');var util=require(_0xb5c4('0x0'));var logger=require('../../config/logger')(_0xb5c4('0x1'));var moment=require(_0xb5c4('0x2'));var BPromise=require(_0xb5c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5c4('0x4'));var rimraf=require(_0xb5c4('0x5'));var config=require(_0xb5c4('0x6'));var attributes=require(_0xb5c4('0x7'));module[_0xb5c4('0x8')]=function(_0x27e2f6,_0x35eebd){return _0x27e2f6['define'](_0xb5c4('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 3219c76..941eb3d 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 _0xe604=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xe604,0x171));var _0x4e60=function(_0x435520,_0x3a280a){_0x435520=_0x435520-0x0;var _0x18d93d=_0xe604[_0x435520];return _0x18d93d;};'use strict';var _=require(_0x4e60('0x0'));var util=require(_0x4e60('0x1'));var moment=require(_0x4e60('0x2'));var BPromise=require(_0x4e60('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e60('0x4'));var db=require(_0x4e60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e60('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e60('0x7'));var client=jayson[_0x4e60('0x8')][_0x4e60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5601e3,_0x2fe925,_0x4d1ac3){return new BPromise(function(_0x45c9d2,_0x6b1b12){return client[_0x4e60('0xa')](_0x5601e3,_0x4d1ac3)[_0x4e60('0xb')](function(_0x33ba60){logger[_0x4e60('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2fe925,_0x4e60('0xd'));logger[_0x4e60('0xe')](_0x4e60('0xf'),_0x2fe925,_0x4e60('0xd'),JSON[_0x4e60('0x10')](_0x33ba60));if(_0x33ba60[_0x4e60('0x11')]){if(_0x33ba60[_0x4e60('0x11')]['code']===0x1f4){logger[_0x4e60('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x2fe925,_0x33ba60[_0x4e60('0x11')][_0x4e60('0x12')]);return _0x6b1b12(_0x33ba60[_0x4e60('0x11')][_0x4e60('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2fe925,_0x33ba60[_0x4e60('0x11')][_0x4e60('0x12')]);return _0x45c9d2(_0x33ba60[_0x4e60('0x11')][_0x4e60('0x12')]);}else{logger[_0x4e60('0xc')](_0x4e60('0x13'),_0x2fe925,_0x4e60('0xd'));_0x45c9d2(_0x33ba60[_0x4e60('0x14')]['message']);}})[_0x4e60('0x15')](function(_0x492d9a){logger[_0x4e60('0x11')](_0x4e60('0x13'),_0x2fe925,_0x492d9a);_0x6b1b12(_0x492d9a);});});} \ No newline at end of file +var _0xac3a=['client','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','info','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x432ec8,_0x99f2a4){var _0x304800=function(_0x52ef5a){while(--_0x52ef5a){_0x432ec8['push'](_0x432ec8['shift']());}};_0x304800(++_0x99f2a4);}(_0xac3a,0xaf));var _0xaac3=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xac3a[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaac3('0x0'));var BPromise=require(_0xaac3('0x1'));var rs=require(_0xaac3('0x2'));var fs=require('fs');var Redis=require(_0xaac3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaac3('0x4'));var logger=require(_0xaac3('0x5'))(_0xaac3('0x6'));var config=require(_0xaac3('0x7'));var jayson=require(_0xaac3('0x8'));var client=jayson[_0xaac3('0x9')][_0xaac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38ba2a,_0x5e6015,_0x236518){return new BPromise(function(_0x1a0ec9,_0x2125c8){return client[_0xaac3('0xb')](_0x38ba2a,_0x236518)[_0xaac3('0xc')](function(_0x1ec4d5){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x5e6015,_0xaac3('0xd'));logger[_0xaac3('0xe')](_0xaac3('0xf'),_0x5e6015,_0xaac3('0xd'),JSON[_0xaac3('0x10')](_0x1ec4d5));if(_0x1ec4d5['error']){if(_0x1ec4d5[_0xaac3('0x11')][_0xaac3('0x12')]===0x1f4){logger[_0xaac3('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x5e6015,_0x1ec4d5['error'][_0xaac3('0x13')]);return _0x2125c8(_0x1ec4d5['error'][_0xaac3('0x13')]);}logger[_0xaac3('0x11')](_0xaac3('0x14'),_0x5e6015,_0x1ec4d5[_0xaac3('0x11')][_0xaac3('0x13')]);return _0x1a0ec9(_0x1ec4d5[_0xaac3('0x11')]['message']);}else{logger[_0xaac3('0x15')](_0xaac3('0x14'),_0x5e6015,_0xaac3('0xd'));_0x1a0ec9(_0x1ec4d5[_0xaac3('0x16')]['message']);}})['catch'](function(_0x3fc659){logger['error'](_0xaac3('0x14'),_0x5e6015,_0x3fc659);_0x2125c8(_0x3fc659);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index f2cb8c8..4abc27a 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 _0x52cb=['fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x52cb,0x140));var _0xb52c=function(_0x20c7b6,_0x458b6a){_0x20c7b6=_0x20c7b6-0x0;var _0x243741=_0x52cb[_0x20c7b6];return _0x243741;};'use strict';var multer=require(_0xb52c('0x0'));var util=require(_0xb52c('0x1'));var path=require(_0xb52c('0x2'));var timeout=require(_0xb52c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb52c('0x4'));var auth=require(_0xb52c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb52c('0x6'));var controller=require(_0xb52c('0x7'));router[_0xb52c('0x8')]('/',auth['isAuthenticated'](),controller[_0xb52c('0x9')]);router['get'](_0xb52c('0xa'),auth[_0xb52c('0xb')](),controller[_0xb52c('0xc')]);router['post']('/',auth[_0xb52c('0xb')](),controller[_0xb52c('0xd')]);router[_0xb52c('0xe')](_0xb52c('0xa'),auth[_0xb52c('0xb')](),controller[_0xb52c('0xf')]);router[_0xb52c('0x10')]('/:id',auth[_0xb52c('0xb')](),controller[_0xb52c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x51bd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x51bd,0x73));var _0xd51b=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x51bd[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0xd51b('0x0'));var path=require('path');var timeout=require(_0xd51b('0x1'));var express=require(_0xd51b('0x2'));var router=express[_0xd51b('0x3')]();var fs_extra=require(_0xd51b('0x4'));var auth=require(_0xd51b('0x5'));var interaction=require(_0xd51b('0x6'));var config=require(_0xd51b('0x7'));var controller=require(_0xd51b('0x8'));router[_0xd51b('0x9')]('/',auth[_0xd51b('0xa')](),controller[_0xd51b('0xb')]);router[_0xd51b('0x9')]('/:id',auth[_0xd51b('0xa')](),controller[_0xd51b('0xc')]);router[_0xd51b('0xd')]('/',auth[_0xd51b('0xa')](),controller[_0xd51b('0xe')]);router['put']('/:id',auth[_0xd51b('0xa')](),controller[_0xd51b('0xf')]);router[_0xd51b('0x10')](_0xd51b('0x11'),auth[_0xd51b('0xa')](),controller[_0xd51b('0x12')]);module[_0xd51b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e525035..85acfc4 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 _0xcea3=['STRING','exports','string','variable','customVariable','keyValue','picklist'];(function(_0xce1e7e,_0x573352){var _0x375c35=function(_0x1c1598){while(--_0x1c1598){_0xce1e7e['push'](_0xce1e7e['shift']());}};_0x375c35(++_0x573352);}(_0xcea3,0x1cf));var _0x3cea=function(_0x2ee4ae,_0xcc134a){_0x2ee4ae=_0x2ee4ae-0x0;var _0x1de567=_0xcea3[_0x2ee4ae];return _0x1de567;};'use strict';var Sequelize=require('sequelize');module[_0x3cea('0x0')]={'type':{'type':Sequelize['ENUM'](_0x3cea('0x1'),_0x3cea('0x2'),_0x3cea('0x3'),_0x3cea('0x4'),_0x3cea('0x5')),'defaultValue':_0x3cea('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3cea('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x3cea('0x1'),'variable',_0x3cea('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3cea('0x6')]},'nameField':{'type':Sequelize[_0x3cea('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3cea('0x6')]}}; \ No newline at end of file +var _0xebe2=['exports','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x7b4399,_0x3927df){var _0x4136b6=function(_0x21a50d){while(--_0x21a50d){_0x7b4399['push'](_0x7b4399['shift']());}};_0x4136b6(++_0x3927df);}(_0xebe2,0xb3));var _0x2ebe=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0xebe2[_0x269c42];return _0x4dad76;};'use strict';var Sequelize=require(_0x2ebe('0x0'));module[_0x2ebe('0x1')]={'type':{'type':Sequelize[_0x2ebe('0x2')](_0x2ebe('0x3'),_0x2ebe('0x4'),'customVariable',_0x2ebe('0x5'),_0x2ebe('0x6')),'defaultValue':_0x2ebe('0x3')},'content':{'type':Sequelize[_0x2ebe('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2ebe('0x3'),_0x2ebe('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x2ebe('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2ebe('0x7')]},'customField':{'type':Sequelize[_0x2ebe('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 17e2f45..3f1cc3c 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 _0x6dff=['fieldName','type','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','reject','save','update','then','destroy','stack','name','index','VtigerField'];(function(_0xb4e052,_0x1d3cb6){var _0x5197e7=function(_0x9bc429){while(--_0x9bc429){_0xb4e052['push'](_0xb4e052['shift']());}};_0x5197e7(++_0x1d3cb6);}(_0x6dff,0xab));var _0xf6df=function(_0x15c6e5,_0x16f5b5){_0x15c6e5=_0x15c6e5-0x0;var _0x3245ee=_0x6dff[_0x15c6e5];return _0x3245ee;};'use strict';var emlformat=require(_0xf6df('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6df('0x1'));var jsonpatch=require(_0xf6df('0x2'));var rp=require(_0xf6df('0x3'));var moment=require(_0xf6df('0x4'));var BPromise=require(_0xf6df('0x5'));var Mustache=require(_0xf6df('0x6'));var util=require(_0xf6df('0x7'));var path=require(_0xf6df('0x8'));var sox=require('sox');var csv=require(_0xf6df('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6df('0xa'));var _=require(_0xf6df('0xb'));var squel=require('squel');var crypto=require(_0xf6df('0xc'));var jsforce=require(_0xf6df('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf6df('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf6df('0xe'));var authService=require(_0xf6df('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf6df('0x10'));var hardwareService=require(_0xf6df('0x11'));var logger=require(_0xf6df('0x12'))(_0xf6df('0x13'));var utils=require(_0xf6df('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf6df('0x15'));var db=require(_0xf6df('0x16'))['db'];function respondWithStatusCode(_0x31c8e3,_0x91e45f){_0x91e45f=_0x91e45f||0xcc;return function(_0x1b4ab2){if(_0x1b4ab2){return _0x31c8e3[_0xf6df('0x17')](_0x91e45f);}return _0x31c8e3['status'](_0x91e45f)[_0xf6df('0x18')]();};}function respondWithResult(_0x54597a,_0x256bcc){_0x256bcc=_0x256bcc||0xc8;return function(_0x52a91d){if(_0x52a91d){return _0x54597a[_0xf6df('0x19')](_0x256bcc)[_0xf6df('0x1a')](_0x52a91d);}};}function respondWithFilteredResult(_0x13a401,_0x452c87){return function(_0x133388){if(_0x133388){var _0x48701f=typeof _0x452c87[_0xf6df('0x1b')]===_0xf6df('0x1c')&&typeof _0x452c87[_0xf6df('0x1d')]===_0xf6df('0x1c');var _0x45945b=_0x133388['count'];var _0x375cd5=_0x48701f?0x0:_0x452c87[_0xf6df('0x1b')];var _0x20e387=_0x48701f?_0x133388['count']:_0x452c87[_0xf6df('0x1b')]+_0x452c87[_0xf6df('0x1d')];var _0x287904;if(_0x20e387>=_0x45945b){_0x20e387=_0x45945b;_0x287904=0xc8;}else{_0x287904=0xce;}_0x13a401[_0xf6df('0x19')](_0x287904);return _0x13a401['set']('Content-Range',_0x375cd5+'-'+_0x20e387+'/'+_0x45945b)[_0xf6df('0x1a')](_0x133388);}return null;};}function patchUpdates(_0x178e7d){return function(_0x485bfb){try{jsonpatch['apply'](_0x485bfb,_0x178e7d,!![]);}catch(_0x3e8b27){return BPromise[_0xf6df('0x1e')](_0x3e8b27);}return _0x485bfb[_0xf6df('0x1f')]();};}function saveUpdates(_0x47507b,_0x2c6364){return function(_0x42bde8){if(_0x42bde8){return _0x42bde8[_0xf6df('0x20')](_0x47507b)[_0xf6df('0x21')](function(_0x24aaea){return _0x24aaea;});}return null;};}function removeEntity(_0x40896e,_0x552772){return function(_0x532e85){if(_0x532e85){return _0x532e85[_0xf6df('0x22')]()[_0xf6df('0x21')](function(){_0x40896e[_0xf6df('0x19')](0xcc)[_0xf6df('0x18')]();});}};}function handleEntityNotFound(_0x399189,_0x288186){return function(_0x1167a3){if(!_0x1167a3){_0x399189[_0xf6df('0x17')](0x194);}return _0x1167a3;};}function handleError(_0x1d80df,_0xc0cd3d){_0xc0cd3d=_0xc0cd3d||0x1f4;return function(_0x4574ea){logger['error'](_0x4574ea[_0xf6df('0x23')]);if(_0x4574ea[_0xf6df('0x24')]){delete _0x4574ea[_0xf6df('0x24')];}_0x1d80df[_0xf6df('0x19')](_0xc0cd3d)['send'](_0x4574ea);};}exports[_0xf6df('0x25')]=function(_0x594772,_0x434dba){var _0x4237fa={},_0x3211f2={},_0x3d2aae={'count':0x0,'rows':[]};var _0x53cfd6=_['map'](db[_0xf6df('0x26')]['rawAttributes'],function(_0x3e62b9){return{'name':_0x3e62b9[_0xf6df('0x27')],'type':_0x3e62b9[_0xf6df('0x28')]['key']};});_0x3211f2['model']=_[_0xf6df('0x29')](_0x53cfd6,'name');_0x3211f2[_0xf6df('0x2a')]=_[_0xf6df('0x2b')](_0x594772[_0xf6df('0x2a')]);_0x3211f2[_0xf6df('0x2c')]=_['intersection'](_0x3211f2['model'],_0x3211f2['query']);_0x4237fa[_0xf6df('0x2d')]=_[_0xf6df('0x2e')](_0x3211f2[_0xf6df('0x2f')],qs['fields'](_0x594772[_0xf6df('0x2a')][_0xf6df('0x30')]));_0x4237fa[_0xf6df('0x2d')]=_0x4237fa[_0xf6df('0x2d')][_0xf6df('0x31')]?_0x4237fa[_0xf6df('0x2d')]:_0x3211f2[_0xf6df('0x2f')];if(!_0x594772['query'][_0xf6df('0x32')](_0xf6df('0x33'))){_0x4237fa['limit']=qs[_0xf6df('0x1d')](_0x594772[_0xf6df('0x2a')]['limit']);_0x4237fa['offset']=qs[_0xf6df('0x1b')](_0x594772[_0xf6df('0x2a')][_0xf6df('0x1b')]);}_0x4237fa[_0xf6df('0x34')]=qs[_0xf6df('0x35')](_0x594772[_0xf6df('0x2a')][_0xf6df('0x35')]);_0x4237fa[_0xf6df('0x36')]=qs[_0xf6df('0x2c')](_[_0xf6df('0x37')](_0x594772[_0xf6df('0x2a')],_0x3211f2['filters']),_0x53cfd6);if(_0x594772['query'][_0xf6df('0x38')]){_0x4237fa[_0xf6df('0x36')]=_[_0xf6df('0x39')](_0x4237fa['where'],{'$or':_[_0xf6df('0x29')](_0x53cfd6,function(_0x4c5779){if(_0x4c5779[_0xf6df('0x28')]!==_0xf6df('0x3a')){var _0x568fd1={};_0x568fd1[_0x4c5779[_0xf6df('0x24')]]={'$like':'%'+_0x594772['query'][_0xf6df('0x38')]+'%'};return _0x568fd1;}})});}_0x4237fa=_['merge']({},_0x4237fa,_0x594772['options']);var _0x5b5265={'where':_0x4237fa[_0xf6df('0x36')]};return db[_0xf6df('0x26')][_0xf6df('0x3b')](_0x5b5265)['then'](function(_0x36a40e){_0x3d2aae[_0xf6df('0x3b')]=_0x36a40e;if(_0x594772[_0xf6df('0x2a')]['includeAll']){_0x4237fa[_0xf6df('0x3c')]=[{'all':!![]}];}return db[_0xf6df('0x26')][_0xf6df('0x3d')](_0x4237fa);})[_0xf6df('0x21')](function(_0x527466){_0x3d2aae[_0xf6df('0x3e')]=_0x527466;return _0x3d2aae;})['then'](respondWithFilteredResult(_0x434dba,_0x4237fa))[_0xf6df('0x3f')](handleError(_0x434dba,null));};exports[_0xf6df('0x40')]=function(_0x1fd74b,_0x3e364d){var _0x37977e={'raw':!![],'where':{'id':_0x1fd74b[_0xf6df('0x41')]['id']}},_0x39a733={};_0x39a733[_0xf6df('0x2f')]=_['keys'](db[_0xf6df('0x26')][_0xf6df('0x42')]);_0x39a733['query']=_[_0xf6df('0x2b')](_0x1fd74b[_0xf6df('0x2a')]);_0x39a733[_0xf6df('0x2c')]=_[_0xf6df('0x2e')](_0x39a733['model'],_0x39a733[_0xf6df('0x2a')]);_0x37977e['attributes']=_[_0xf6df('0x2e')](_0x39a733['model'],qs[_0xf6df('0x30')](_0x1fd74b[_0xf6df('0x2a')][_0xf6df('0x30')]));_0x37977e['attributes']=_0x37977e[_0xf6df('0x2d')]['length']?_0x37977e[_0xf6df('0x2d')]:_0x39a733[_0xf6df('0x2f')];if(_0x1fd74b[_0xf6df('0x2a')]['includeAll']){_0x37977e[_0xf6df('0x3c')]=[{'all':!![]}];}_0x37977e=_[_0xf6df('0x39')]({},_0x37977e,_0x1fd74b['options']);return db[_0xf6df('0x26')]['find'](_0x37977e)[_0xf6df('0x21')](handleEntityNotFound(_0x3e364d,null))['then'](respondWithResult(_0x3e364d,null))[_0xf6df('0x3f')](handleError(_0x3e364d,null));};exports[_0xf6df('0x43')]=function(_0x11bba1,_0x128fe0){return db['VtigerField'][_0xf6df('0x43')](_0x11bba1[_0xf6df('0x44')],{})[_0xf6df('0x21')](respondWithResult(_0x128fe0,0xc9))[_0xf6df('0x3f')](handleError(_0x128fe0,null));};exports[_0xf6df('0x20')]=function(_0x5c5fd9,_0x5079c1){if(_0x5c5fd9[_0xf6df('0x44')]['id']){delete _0x5c5fd9['body']['id'];}return db['VtigerField'][_0xf6df('0x45')]({'where':{'id':_0x5c5fd9[_0xf6df('0x41')]['id']}})['then'](handleEntityNotFound(_0x5079c1,null))[_0xf6df('0x21')](saveUpdates(_0x5c5fd9[_0xf6df('0x44')],null))[_0xf6df('0x21')](respondWithResult(_0x5079c1,null))[_0xf6df('0x3f')](handleError(_0x5079c1,null));};exports['destroy']=function(_0x131860,_0x1c44a5){return db[_0xf6df('0x26')][_0xf6df('0x45')]({'where':{'id':_0x131860[_0xf6df('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c44a5,null))[_0xf6df('0x21')](removeEntity(_0x1c44a5,null))['catch'](handleError(_0x1c44a5,null));}; \ No newline at end of file +var _0xaf4e=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','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','offset','count','limit','status','set','json','apply','reject','update','destroy','then','error','stack','name','send','VtigerField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields'];(function(_0x29dbda,_0x15dc63){var _0x1c7c81=function(_0x2b878d){while(--_0x2b878d){_0x29dbda['push'](_0x29dbda['shift']());}};_0x1c7c81(++_0x15dc63);}(_0xaf4e,0xa8));var _0xeaf4=function(_0xf31e74,_0x27854c){_0xf31e74=_0xf31e74-0x0;var _0x2222b2=_0xaf4e[_0xf31e74];return _0x2222b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeaf4('0x0'));var zipdir=require(_0xeaf4('0x1'));var jsonpatch=require(_0xeaf4('0x2'));var rp=require(_0xeaf4('0x3'));var moment=require('moment');var BPromise=require(_0xeaf4('0x4'));var Mustache=require(_0xeaf4('0x5'));var util=require(_0xeaf4('0x6'));var path=require(_0xeaf4('0x7'));var sox=require(_0xeaf4('0x8'));var csv=require(_0xeaf4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeaf4('0xa'));var _=require(_0xeaf4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeaf4('0xc'));var deskjs=require(_0xeaf4('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeaf4('0xe'));var Redis=require(_0xeaf4('0xf'));var authService=require(_0xeaf4('0x10'));var qs=require(_0xeaf4('0x11'));var as=require(_0xeaf4('0x12'));var hardwareService=require(_0xeaf4('0x13'));var logger=require(_0xeaf4('0x14'))('api');var utils=require(_0xeaf4('0x15'));var config=require(_0xeaf4('0x16'));var licenseUtil=require(_0xeaf4('0x17'));var db=require(_0xeaf4('0x18'))['db'];function respondWithStatusCode(_0x22b277,_0x3c9786){_0x3c9786=_0x3c9786||0xcc;return function(_0x380e3a){if(_0x380e3a){return _0x22b277[_0xeaf4('0x19')](_0x3c9786);}return _0x22b277['status'](_0x3c9786)[_0xeaf4('0x1a')]();};}function respondWithResult(_0x5e5a88,_0xe5f014){_0xe5f014=_0xe5f014||0xc8;return function(_0x109214){if(_0x109214){return _0x5e5a88['status'](_0xe5f014)['json'](_0x109214);}};}function respondWithFilteredResult(_0x3c216f,_0x120a9f){return function(_0x498c65){if(_0x498c65){var _0x492f1e=typeof _0x120a9f[_0xeaf4('0x1b')]==='undefined'&&typeof _0x120a9f['limit']==='undefined';var _0x2599ca=_0x498c65[_0xeaf4('0x1c')];var _0x46b765=_0x492f1e?0x0:_0x120a9f[_0xeaf4('0x1b')];var _0x191e68=_0x492f1e?_0x498c65[_0xeaf4('0x1c')]:_0x120a9f[_0xeaf4('0x1b')]+_0x120a9f[_0xeaf4('0x1d')];var _0x21eb15;if(_0x191e68>=_0x2599ca){_0x191e68=_0x2599ca;_0x21eb15=0xc8;}else{_0x21eb15=0xce;}_0x3c216f[_0xeaf4('0x1e')](_0x21eb15);return _0x3c216f[_0xeaf4('0x1f')]('Content-Range',_0x46b765+'-'+_0x191e68+'/'+_0x2599ca)[_0xeaf4('0x20')](_0x498c65);}return null;};}function patchUpdates(_0x6abcf3){return function(_0x540442){try{jsonpatch[_0xeaf4('0x21')](_0x540442,_0x6abcf3,!![]);}catch(_0x5af1bd){return BPromise[_0xeaf4('0x22')](_0x5af1bd);}return _0x540442['save']();};}function saveUpdates(_0x1cf0be,_0x18f0a6){return function(_0x8411e){if(_0x8411e){return _0x8411e[_0xeaf4('0x23')](_0x1cf0be)['then'](function(_0x315435){return _0x315435;});}return null;};}function removeEntity(_0x4db6e9,_0x772139){return function(_0x412643){if(_0x412643){return _0x412643[_0xeaf4('0x24')]()[_0xeaf4('0x25')](function(){_0x4db6e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dac9a,_0x377502){return function(_0x2b30c5){if(!_0x2b30c5){_0x1dac9a['sendStatus'](0x194);}return _0x2b30c5;};}function handleError(_0x142067,_0x228b8f){_0x228b8f=_0x228b8f||0x1f4;return function(_0x2dc5a4){logger[_0xeaf4('0x26')](_0x2dc5a4[_0xeaf4('0x27')]);if(_0x2dc5a4[_0xeaf4('0x28')]){delete _0x2dc5a4[_0xeaf4('0x28')];}_0x142067[_0xeaf4('0x1e')](_0x228b8f)[_0xeaf4('0x29')](_0x2dc5a4);};}exports['index']=function(_0x489e88,_0x40f3b6){var _0x4e1f9d={},_0x215305={},_0x29708e={'count':0x0,'rows':[]};var _0x3348ec=_['map'](db[_0xeaf4('0x2a')]['rawAttributes'],function(_0x2ff51c){return{'name':_0x2ff51c[_0xeaf4('0x2b')],'type':_0x2ff51c[_0xeaf4('0x2c')][_0xeaf4('0x2d')]};});_0x215305[_0xeaf4('0x2e')]=_[_0xeaf4('0x2f')](_0x3348ec,_0xeaf4('0x28'));_0x215305[_0xeaf4('0x30')]=_[_0xeaf4('0x31')](_0x489e88['query']);_0x215305[_0xeaf4('0x32')]=_[_0xeaf4('0x33')](_0x215305[_0xeaf4('0x2e')],_0x215305[_0xeaf4('0x30')]);_0x4e1f9d[_0xeaf4('0x34')]=_[_0xeaf4('0x33')](_0x215305[_0xeaf4('0x2e')],qs[_0xeaf4('0x35')](_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x35')]));_0x4e1f9d['attributes']=_0x4e1f9d[_0xeaf4('0x34')][_0xeaf4('0x36')]?_0x4e1f9d[_0xeaf4('0x34')]:_0x215305[_0xeaf4('0x2e')];if(!_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x37')](_0xeaf4('0x38'))){_0x4e1f9d[_0xeaf4('0x1d')]=qs[_0xeaf4('0x1d')](_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x1d')]);_0x4e1f9d[_0xeaf4('0x1b')]=qs[_0xeaf4('0x1b')](_0x489e88['query']['offset']);}_0x4e1f9d[_0xeaf4('0x39')]=qs[_0xeaf4('0x3a')](_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x3a')]);_0x4e1f9d[_0xeaf4('0x3b')]=qs[_0xeaf4('0x32')](_[_0xeaf4('0x3c')](_0x489e88[_0xeaf4('0x30')],_0x215305[_0xeaf4('0x32')]),_0x3348ec);if(_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x3d')]){_0x4e1f9d[_0xeaf4('0x3b')]=_['merge'](_0x4e1f9d[_0xeaf4('0x3b')],{'$or':_[_0xeaf4('0x2f')](_0x3348ec,function(_0x33e68a){if(_0x33e68a[_0xeaf4('0x2c')]!==_0xeaf4('0x3e')){var _0x41afc3={};_0x41afc3[_0x33e68a['name']]={'$like':'%'+_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x3d')]+'%'};return _0x41afc3;}})});}_0x4e1f9d=_[_0xeaf4('0x3f')]({},_0x4e1f9d,_0x489e88[_0xeaf4('0x40')]);var _0x104487={'where':_0x4e1f9d[_0xeaf4('0x3b')]};return db[_0xeaf4('0x2a')]['count'](_0x104487)[_0xeaf4('0x25')](function(_0x35fd82){_0x29708e[_0xeaf4('0x1c')]=_0x35fd82;if(_0x489e88[_0xeaf4('0x30')][_0xeaf4('0x41')]){_0x4e1f9d[_0xeaf4('0x42')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x4e1f9d);})['then'](function(_0x3e5e90){_0x29708e[_0xeaf4('0x43')]=_0x3e5e90;return _0x29708e;})[_0xeaf4('0x25')](respondWithFilteredResult(_0x40f3b6,_0x4e1f9d))[_0xeaf4('0x44')](handleError(_0x40f3b6,null));};exports[_0xeaf4('0x45')]=function(_0x14b61c,_0x46391d){var _0x8c876e={'raw':!![],'where':{'id':_0x14b61c[_0xeaf4('0x46')]['id']}},_0x496092={};_0x496092[_0xeaf4('0x2e')]=_['keys'](db[_0xeaf4('0x2a')][_0xeaf4('0x47')]);_0x496092[_0xeaf4('0x30')]=_[_0xeaf4('0x31')](_0x14b61c[_0xeaf4('0x30')]);_0x496092[_0xeaf4('0x32')]=_[_0xeaf4('0x33')](_0x496092[_0xeaf4('0x2e')],_0x496092[_0xeaf4('0x30')]);_0x8c876e[_0xeaf4('0x34')]=_[_0xeaf4('0x33')](_0x496092[_0xeaf4('0x2e')],qs[_0xeaf4('0x35')](_0x14b61c['query'][_0xeaf4('0x35')]));_0x8c876e[_0xeaf4('0x34')]=_0x8c876e[_0xeaf4('0x34')][_0xeaf4('0x36')]?_0x8c876e[_0xeaf4('0x34')]:_0x496092[_0xeaf4('0x2e')];if(_0x14b61c[_0xeaf4('0x30')]['includeAll']){_0x8c876e[_0xeaf4('0x42')]=[{'all':!![]}];}_0x8c876e=_[_0xeaf4('0x3f')]({},_0x8c876e,_0x14b61c['options']);return db[_0xeaf4('0x2a')][_0xeaf4('0x48')](_0x8c876e)[_0xeaf4('0x25')](handleEntityNotFound(_0x46391d,null))[_0xeaf4('0x25')](respondWithResult(_0x46391d,null))['catch'](handleError(_0x46391d,null));};exports['create']=function(_0x304f19,_0xd7f15b){return db[_0xeaf4('0x2a')]['create'](_0x304f19[_0xeaf4('0x49')],{})[_0xeaf4('0x25')](respondWithResult(_0xd7f15b,0xc9))[_0xeaf4('0x44')](handleError(_0xd7f15b,null));};exports[_0xeaf4('0x23')]=function(_0x5d3d50,_0x1244de){if(_0x5d3d50[_0xeaf4('0x49')]['id']){delete _0x5d3d50[_0xeaf4('0x49')]['id'];}return db[_0xeaf4('0x2a')][_0xeaf4('0x48')]({'where':{'id':_0x5d3d50['params']['id']}})[_0xeaf4('0x25')](handleEntityNotFound(_0x1244de,null))[_0xeaf4('0x25')](saveUpdates(_0x5d3d50[_0xeaf4('0x49')],null))[_0xeaf4('0x25')](respondWithResult(_0x1244de,null))['catch'](handleError(_0x1244de,null));};exports['destroy']=function(_0x129a6a,_0x4f1004){return db['VtigerField'][_0xeaf4('0x48')]({'where':{'id':_0x129a6a['params']['id']}})['then'](handleEntityNotFound(_0x4f1004,null))[_0xeaf4('0x25')](removeEntity(_0x4f1004,null))[_0xeaf4('0x44')](handleError(_0x4f1004,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6acb54b..c608e30 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 _0xdbf3=['exports','VtigerField','idField','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes'];(function(_0x409da1,_0x16cc4a){var _0x330c56=function(_0xe66049){while(--_0xe66049){_0x409da1['push'](_0x409da1['shift']());}};_0x330c56(++_0x16cc4a);}(_0xdbf3,0x18f));var _0x3dbf=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xdbf3[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0x3dbf('0x0'));var util=require(_0x3dbf('0x1'));var logger=require(_0x3dbf('0x2'))(_0x3dbf('0x3'));var moment=require(_0x3dbf('0x4'));var BPromise=require(_0x3dbf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dbf('0x6'));var rimraf=require('rimraf');var config=require(_0x3dbf('0x7'));var attributes=require(_0x3dbf('0x8'));module[_0x3dbf('0x9')]=function(_0x1cfe23,_0x1c3fbf){return _0x1cfe23['define'](_0x3dbf('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x3dbf('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaca=['FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x4abc43,_0x3eb728){var _0x5c30e4=function(_0x5f223d){while(--_0x5f223d){_0x4abc43['push'](_0x4abc43['shift']());}};_0x5c30e4(++_0x3eb728);}(_0xbaca,0x1eb));var _0xabac=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0xbaca[_0x26a906];return _0x495575;};'use strict';var _=require('lodash');var util=require(_0xabac('0x0'));var logger=require('../../config/logger')(_0xabac('0x1'));var moment=require(_0xabac('0x2'));var BPromise=require(_0xabac('0x3'));var rp=require(_0xabac('0x4'));var fs=require('fs');var path=require(_0xabac('0x5'));var rimraf=require(_0xabac('0x6'));var config=require(_0xabac('0x7'));var attributes=require(_0xabac('0x8'));module[_0xabac('0x9')]=function(_0x53c9da,_0x3314bd){return _0x53c9da['define']('VtigerField',attributes,{'tableName':_0xabac('0xa'),'paranoid':![],'indexes':[{'name':_0xabac('0xb'),'fields':[_0xabac('0xc'),_0xabac('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 54c8641..47ede4b 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 _0xf6bc=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c0b22,_0x56d46a){var _0x16a8a6=function(_0x268ef6){while(--_0x268ef6){_0x5c0b22['push'](_0x5c0b22['shift']());}};_0x16a8a6(++_0x56d46a);}(_0xf6bc,0x68));var _0xcf6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf6b('0x0'));var util=require(_0xcf6b('0x1'));var moment=require(_0xcf6b('0x2'));var BPromise=require(_0xcf6b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf6b('0x4'));var db=require(_0xcf6b('0x5'))['db'];var utils=require(_0xcf6b('0x6'));var logger=require(_0xcf6b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf6b('0x8'));var client=jayson[_0xcf6b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383a5e,_0x252e50,_0x5735b8){return new BPromise(function(_0x36502d,_0x4f3762){return client['request'](_0x383a5e,_0x5735b8)['then'](function(_0xf6a11d){logger[_0xcf6b('0xa')](_0xcf6b('0xb'),_0x252e50,_0xcf6b('0xc'));logger[_0xcf6b('0xd')](_0xcf6b('0xe'),_0x252e50,_0xcf6b('0xc'),JSON[_0xcf6b('0xf')](_0xf6a11d));if(_0xf6a11d[_0xcf6b('0x10')]){if(_0xf6a11d[_0xcf6b('0x10')]['code']===0x1f4){logger[_0xcf6b('0x10')](_0xcf6b('0xb'),_0x252e50,_0xf6a11d['error'][_0xcf6b('0x11')]);return _0x4f3762(_0xf6a11d[_0xcf6b('0x10')][_0xcf6b('0x11')]);}logger[_0xcf6b('0x10')](_0xcf6b('0xb'),_0x252e50,_0xf6a11d[_0xcf6b('0x10')][_0xcf6b('0x11')]);return _0x36502d(_0xf6a11d['error'][_0xcf6b('0x11')]);}else{logger[_0xcf6b('0xa')]('VtigerField,\x20%s,\x20%s',_0x252e50,'request\x20sent');_0x36502d(_0xf6a11d[_0xcf6b('0x12')][_0xcf6b('0x11')]);}})[_0xcf6b('0x13')](function(_0x623b71){logger[_0xcf6b('0x10')](_0xcf6b('0xb'),_0x252e50,_0x623b71);_0x4f3762(_0x623b71);});});} \ No newline at end of file +var _0x98ff=['jayson/promise','http','then','info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x5501a0,_0x4a8072){var _0x36cfc3=function(_0x592a1c){while(--_0x592a1c){_0x5501a0['push'](_0x5501a0['shift']());}};_0x36cfc3(++_0x4a8072);}(_0x98ff,0x1d8));var _0xf98f=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x98ff[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xf98f('0x0'));var util=require(_0xf98f('0x1'));var moment=require('moment');var BPromise=require(_0xf98f('0x2'));var rs=require(_0xf98f('0x3'));var fs=require('fs');var Redis=require(_0xf98f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf98f('0x5'));var logger=require('../../config/logger')(_0xf98f('0x6'));var config=require(_0xf98f('0x7'));var jayson=require(_0xf98f('0x8'));var client=jayson['client'][_0xf98f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3960a3,_0x4af698,_0xfc8cb4){return new BPromise(function(_0x577ad0,_0x3d294d){return client['request'](_0x3960a3,_0xfc8cb4)[_0xf98f('0xa')](function(_0x5f2182){logger[_0xf98f('0xb')]('VtigerField,\x20%s,\x20%s',_0x4af698,'request\x20sent');logger['debug'](_0xf98f('0xc'),_0x4af698,_0xf98f('0xd'),JSON[_0xf98f('0xe')](_0x5f2182));if(_0x5f2182[_0xf98f('0xf')]){if(_0x5f2182[_0xf98f('0xf')][_0xf98f('0x10')]===0x1f4){logger[_0xf98f('0xf')](_0xf98f('0x11'),_0x4af698,_0x5f2182[_0xf98f('0xf')][_0xf98f('0x12')]);return _0x3d294d(_0x5f2182[_0xf98f('0xf')][_0xf98f('0x12')]);}logger[_0xf98f('0xf')](_0xf98f('0x11'),_0x4af698,_0x5f2182[_0xf98f('0xf')][_0xf98f('0x12')]);return _0x577ad0(_0x5f2182[_0xf98f('0xf')][_0xf98f('0x12')]);}else{logger['info'](_0xf98f('0x11'),_0x4af698,_0xf98f('0xd'));_0x577ad0(_0x5f2182['result']['message']);}})[_0xf98f('0x13')](function(_0x5e040e){logger[_0xf98f('0xf')]('VtigerField,\x20%s,\x20%s',_0x4af698,_0x5e040e);_0x3d294d(_0x5e040e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 9f79f27..ec558c6 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 _0xe9e9=['put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration'];(function(_0x3ab04c,_0x3e990c){var _0x3582df=function(_0x129e37){while(--_0x129e37){_0x3ab04c['push'](_0x3ab04c['shift']());}};_0x3582df(++_0x3e990c);}(_0xe9e9,0x7b));var _0x9e9e=function(_0x1a68df,_0x5b5910){_0x1a68df=_0x1a68df-0x0;var _0x11af5b=_0xe9e9[_0x1a68df];return _0x11af5b;};'use strict';var multer=require(_0x9e9e('0x0'));var util=require(_0x9e9e('0x1'));var path=require(_0x9e9e('0x2'));var timeout=require(_0x9e9e('0x3'));var express=require(_0x9e9e('0x4'));var router=express['Router']();var fs_extra=require(_0x9e9e('0x5'));var auth=require(_0x9e9e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e9e('0x7'));var controller=require(_0x9e9e('0x8'));router[_0x9e9e('0x9')]('/',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xb')]);router[_0x9e9e('0x9')](_0x9e9e('0xc'),auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xd')]);router['get']('/:id/configurations',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0xe')]);router[_0x9e9e('0x9')](_0x9e9e('0xf'),auth[_0x9e9e('0xa')](),controller[_0x9e9e('0x10')]);router[_0x9e9e('0x11')]('/',auth[_0x9e9e('0xa')](),controller[_0x9e9e('0x12')]);router['post'](_0x9e9e('0x13'),auth['isAuthenticated'](),controller[_0x9e9e('0x14')]);router[_0x9e9e('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9e9e('0x16')]);router['delete'](_0x9e9e('0xc'),auth[_0x9e9e('0xa')](),controller[_0x9e9e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd651=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x41f5a5,_0x472566){var _0x4e5949=function(_0x4dae4b){while(--_0x4dae4b){_0x41f5a5['push'](_0x41f5a5['shift']());}};_0x4e5949(++_0x472566);}(_0xd651,0xad));var _0x1d65=function(_0x22c764,_0xa5260f){_0x22c764=_0x22c764-0x0;var _0x324499=_0xd651[_0x22c764];return _0x324499;};'use strict';var multer=require(_0x1d65('0x0'));var util=require('util');var path=require(_0x1d65('0x1'));var timeout=require(_0x1d65('0x2'));var express=require(_0x1d65('0x3'));var router=express[_0x1d65('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1d65('0x5'));var interaction=require(_0x1d65('0x6'));var config=require(_0x1d65('0x7'));var controller=require(_0x1d65('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d65('0x9')](_0x1d65('0xa'),auth[_0x1d65('0xb')](),controller[_0x1d65('0xc')]);router[_0x1d65('0x9')](_0x1d65('0xd'),auth[_0x1d65('0xb')](),controller[_0x1d65('0xe')]);router[_0x1d65('0x9')](_0x1d65('0xf'),auth[_0x1d65('0xb')](),controller['getFields']);router[_0x1d65('0x10')]('/',auth[_0x1d65('0xb')](),controller[_0x1d65('0x11')]);router[_0x1d65('0x10')](_0x1d65('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x1d65('0xa'),auth[_0x1d65('0xb')](),controller[_0x1d65('0x12')]);router[_0x1d65('0x13')](_0x1d65('0xa'),auth[_0x1d65('0xb')](),controller[_0x1d65('0x14')]);module[_0x1d65('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index bd3a371..1c601c7 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 _0x4888=['password','token','exports','STRING','username','remoteUri','ENUM'];(function(_0x723830,_0x221944){var _0x915161=function(_0x16e125){while(--_0x16e125){_0x723830['push'](_0x723830['shift']());}};_0x915161(++_0x221944);}(_0x4888,0x198));var _0x8488=function(_0x327040,_0x6f7206){_0x327040=_0x327040-0x0;var _0x201070=_0x4888[_0x327040];return _0x201070;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'password':{'type':Sequelize[_0x8488('0x1')]},'token':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8488('0x3')},'authType':{'type':Sequelize[_0x8488('0x4')](_0x8488('0x5'),_0x8488('0x6')),'defaultValue':_0x8488('0x5')},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x2d0b=['integrationTab','newTab','exports','STRING','username','ENUM','token','password'];(function(_0x406ba5,_0x39fa4b){var _0x557db7=function(_0x40f28b){while(--_0x40f28b){_0x406ba5['push'](_0x406ba5['shift']());}};_0x557db7(++_0x39fa4b);}(_0x2d0b,0x102));var _0xb2d0=function(_0x9fe6f4,_0x51526f){_0x9fe6f4=_0x9fe6f4-0x0;var _0x1415a3=_0x2d0b[_0x9fe6f4];return _0x1415a3;};'use strict';var Sequelize=require('sequelize');module[_0xb2d0('0x0')]={'name':{'type':Sequelize[_0xb2d0('0x1')]},'description':{'type':Sequelize[_0xb2d0('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb2d0('0x2')},'password':{'type':Sequelize[_0xb2d0('0x1')]},'token':{'type':Sequelize[_0xb2d0('0x1')]},'remoteUri':{'type':Sequelize[_0xb2d0('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xb2d0('0x3')]('password',_0xb2d0('0x4')),'defaultValue':_0xb2d0('0x5')},'serverUrl':{'type':Sequelize[_0xb2d0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb2d0('0x3')](_0xb2d0('0x6'),_0xb2d0('0x7')),'defaultValue':_0xb2d0('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d543321..c5af43c 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 _0x4e81=['limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','show','params','find','catch','create','body','findOne','ZendeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','ZendeskField','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','password','headers','Basic\x20%s','toString','base64','format','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined'];(function(_0x1f5673,_0x5ba351){var _0x490762=function(_0x52d3e3){while(--_0x52d3e3){_0x1f5673['push'](_0x1f5673['shift']());}};_0x490762(++_0x5ba351);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x4e81[_0x5f25b3];return _0x4ab9bf;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x14e8('0x19'));function respondWithStatusCode(_0x59c6c9,_0x2607ef){_0x2607ef=_0x2607ef||0xcc;return function(_0x341d40){if(_0x341d40){return _0x59c6c9[_0x14e8('0x1a')](_0x2607ef);}return _0x59c6c9['status'](_0x2607ef)[_0x14e8('0x1b')]();};}function respondWithResult(_0x4e1064,_0x458e4a){_0x458e4a=_0x458e4a||0xc8;return function(_0x58d26e){if(_0x58d26e){return _0x4e1064[_0x14e8('0x1c')](_0x458e4a)[_0x14e8('0x1d')](_0x58d26e);}};}function respondWithFilteredResult(_0xc6101f,_0x135996){return function(_0x52e64f){if(_0x52e64f){var _0x10c4a9=typeof _0x135996[_0x14e8('0x1e')]===_0x14e8('0x1f')&&typeof _0x135996[_0x14e8('0x20')]===_0x14e8('0x1f');var _0x1f1a0d=_0x52e64f[_0x14e8('0x21')];var _0x462259=_0x10c4a9?0x0:_0x135996['offset'];var _0x328c5a=_0x10c4a9?_0x52e64f[_0x14e8('0x21')]:_0x135996[_0x14e8('0x1e')]+_0x135996[_0x14e8('0x20')];var _0x246c5d;if(_0x328c5a>=_0x1f1a0d){_0x328c5a=_0x1f1a0d;_0x246c5d=0xc8;}else{_0x246c5d=0xce;}_0xc6101f['status'](_0x246c5d);return _0xc6101f[_0x14e8('0x22')](_0x14e8('0x23'),_0x462259+'-'+_0x328c5a+'/'+_0x1f1a0d)[_0x14e8('0x1d')](_0x52e64f);}return null;};}function patchUpdates(_0x48e30a){return function(_0x2c3f45){try{jsonpatch['apply'](_0x2c3f45,_0x48e30a,!![]);}catch(_0x4cca43){return BPromise[_0x14e8('0x24')](_0x4cca43);}return _0x2c3f45[_0x14e8('0x25')]();};}function saveUpdates(_0x117b00,_0xcf673){return function(_0x4ad25d){if(_0x4ad25d){return _0x4ad25d[_0x14e8('0x26')](_0x117b00)['then'](function(_0x31bdd3){return _0x31bdd3;});}return null;};}function removeEntity(_0x185a0e,_0x4ffc8b){return function(_0x58a3a1){if(_0x58a3a1){return _0x58a3a1['destroy']()[_0x14e8('0x27')](function(){_0x185a0e[_0x14e8('0x1c')](0xcc)[_0x14e8('0x1b')]();});}};}function handleEntityNotFound(_0x20bfe8,_0x333d44){return function(_0x57eb46){if(!_0x57eb46){_0x20bfe8[_0x14e8('0x1a')](0x194);}return _0x57eb46;};}function handleError(_0x3fd96d,_0x3c09cb){_0x3c09cb=_0x3c09cb||0x1f4;return function(_0x2f5818){logger[_0x14e8('0x28')](_0x2f5818[_0x14e8('0x29')]);if(_0x2f5818[_0x14e8('0x2a')]){delete _0x2f5818['name'];}_0x3fd96d[_0x14e8('0x1c')](_0x3c09cb)[_0x14e8('0x2b')](_0x2f5818);};}exports[_0x14e8('0x2c')]=function(_0x5f5abb,_0x48eed0){var _0x5cacd7={},_0x8fe0e2={},_0x2a408d={'count':0x0,'rows':[]};var _0x567385=_[_0x14e8('0x2d')](db[_0x14e8('0x2e')][_0x14e8('0x2f')],function(_0xa83433){return{'name':_0xa83433['fieldName'],'type':_0xa83433[_0x14e8('0x30')][_0x14e8('0x31')]};});_0x8fe0e2[_0x14e8('0x32')]=_[_0x14e8('0x2d')](_0x567385,_0x14e8('0x2a'));_0x8fe0e2['query']=_[_0x14e8('0x33')](_0x5f5abb[_0x14e8('0x34')]);_0x8fe0e2[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x8fe0e2['model'],_0x8fe0e2[_0x14e8('0x34')]);_0x5cacd7['attributes']=_[_0x14e8('0x36')](_0x8fe0e2[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x37')]));_0x5cacd7[_0x14e8('0x38')]=_0x5cacd7[_0x14e8('0x38')][_0x14e8('0x39')]?_0x5cacd7[_0x14e8('0x38')]:_0x8fe0e2[_0x14e8('0x32')];if(!_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3a')]('nolimit')){_0x5cacd7['limit']=qs['limit'](_0x5f5abb[_0x14e8('0x34')]['limit']);_0x5cacd7[_0x14e8('0x1e')]=qs['offset'](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x1e')]);}_0x5cacd7[_0x14e8('0x3b')]=qs[_0x14e8('0x3c')](_0x5f5abb['query'][_0x14e8('0x3c')]);_0x5cacd7['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x5f5abb[_0x14e8('0x34')],_0x8fe0e2[_0x14e8('0x35')]),_0x567385);if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x5cacd7['where']=_[_0x14e8('0x3f')](_0x5cacd7['where'],{'$or':_[_0x14e8('0x2d')](_0x567385,function(_0x20f69d){if(_0x20f69d[_0x14e8('0x30')]!=='VIRTUAL'){var _0x27d51b={};_0x27d51b[_0x20f69d[_0x14e8('0x2a')]]={'$like':'%'+_0x5f5abb['query'][_0x14e8('0x3e')]+'%'};return _0x27d51b;}})});}_0x5cacd7=_[_0x14e8('0x3f')]({},_0x5cacd7,_0x5f5abb[_0x14e8('0x40')]);var _0x3a7aa7={'where':_0x5cacd7[_0x14e8('0x41')]};return db[_0x14e8('0x2e')][_0x14e8('0x21')](_0x3a7aa7)[_0x14e8('0x27')](function(_0x33743a){_0x2a408d[_0x14e8('0x21')]=_0x33743a;if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x42')]){_0x5cacd7[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2e')][_0x14e8('0x44')](_0x5cacd7);})['then'](function(_0x24c9e6){_0x2a408d['rows']=_0x24c9e6;return _0x2a408d;})['then'](respondWithFilteredResult(_0x48eed0,_0x5cacd7))['catch'](handleError(_0x48eed0,null));};exports[_0x14e8('0x45')]=function(_0x5ed821,_0x46a3c4){var _0x45bff0={'raw':![],'where':{'id':_0x5ed821[_0x14e8('0x46')]['id']}},_0x7907e8={};_0x7907e8[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x2e')][_0x14e8('0x2f')]);_0x7907e8[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x5ed821[_0x14e8('0x34')]);_0x7907e8['filters']=_[_0x14e8('0x36')](_0x7907e8[_0x14e8('0x32')],_0x7907e8[_0x14e8('0x34')]);_0x45bff0[_0x14e8('0x38')]=_['intersection'](_0x7907e8[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5ed821['query']['fields']));_0x45bff0[_0x14e8('0x38')]=_0x45bff0['attributes']['length']?_0x45bff0[_0x14e8('0x38')]:_0x7907e8[_0x14e8('0x32')];if(_0x5ed821['query'][_0x14e8('0x42')]){_0x45bff0[_0x14e8('0x43')]=[{'all':!![]}];}_0x45bff0=_['merge']({},_0x45bff0,_0x5ed821[_0x14e8('0x40')]);return db[_0x14e8('0x2e')][_0x14e8('0x47')](_0x45bff0)[_0x14e8('0x27')](handleEntityNotFound(_0x46a3c4,null))[_0x14e8('0x27')](respondWithResult(_0x46a3c4,null))[_0x14e8('0x48')](handleError(_0x46a3c4,null));};exports[_0x14e8('0x49')]=function(_0x2541ad,_0x146e2c){return db[_0x14e8('0x2e')][_0x14e8('0x49')](_0x2541ad[_0x14e8('0x4a')],{})[_0x14e8('0x27')](respondWithResult(_0x146e2c,0xc9))[_0x14e8('0x48')](handleError(_0x146e2c,null));};exports[_0x14e8('0x26')]=function(_0x1f50bc,_0x59820f){if(_0x1f50bc[_0x14e8('0x4a')]['id']){delete _0x1f50bc['body']['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x47')]({'where':{'id':_0x1f50bc[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x59820f,null))['then'](saveUpdates(_0x1f50bc['body'],null))['then'](respondWithResult(_0x59820f,null))[_0x14e8('0x48')](handleError(_0x59820f,null));};exports['destroy']=function(_0x55f9b0,_0xd2b281){return db[_0x14e8('0x2e')]['find']({'where':{'id':_0x55f9b0[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0xd2b281,null))[_0x14e8('0x27')](removeEntity(_0xd2b281,null))[_0x14e8('0x48')](handleError(_0xd2b281,null));};exports['getConfigurations']=function(_0x519c9c,_0x1cdcca,_0xc602b1){var _0x15464a={};var _0x3a09b7={};var _0x41b5ab;var _0x2fbac7;return db['ZendeskAccount'][_0x14e8('0x4b')]({'where':{'id':_0x519c9c[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x1cdcca,null))[_0x14e8('0x27')](function(_0x5e6083){if(_0x5e6083){_0x41b5ab=_0x5e6083;_0x3a09b7[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x4c')][_0x14e8('0x2f')]);_0x3a09b7['query']=_[_0x14e8('0x33')](_0x519c9c[_0x14e8('0x34')]);_0x3a09b7[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x3a09b7[_0x14e8('0x32')],_0x3a09b7[_0x14e8('0x34')]);_0x15464a[_0x14e8('0x38')]=_[_0x14e8('0x36')](_0x3a09b7['model'],qs['fields'](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x37')]));_0x15464a[_0x14e8('0x38')]=_0x15464a[_0x14e8('0x38')][_0x14e8('0x39')]?_0x15464a['attributes']:_0x3a09b7['model'];_0x15464a['order']=qs[_0x14e8('0x3c')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3c')]);_0x15464a['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x519c9c[_0x14e8('0x34')],_0x3a09b7['filters']));if(_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x15464a[_0x14e8('0x41')]=_[_0x14e8('0x3f')](_0x15464a[_0x14e8('0x41')],{'$or':_[_0x14e8('0x2d')](_0x15464a[_0x14e8('0x38')],function(_0x12a2b3){var _0x2da07b={};_0x2da07b[_0x12a2b3]={'$like':'%'+_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]+'%'};return _0x2da07b;})});}_0x15464a=_['merge']({},_0x15464a,_0x519c9c[_0x14e8('0x40')]);return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x38e79a){if(_0x38e79a){_0x2fbac7=_0x38e79a[_0x14e8('0x39')];if(!_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3a')](_0x14e8('0x4e'))){_0x15464a[_0x14e8('0x20')]=qs[_0x14e8('0x20')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x20')]);_0x15464a['offset']=qs[_0x14e8('0x1e')](_0x519c9c[_0x14e8('0x34')]['offset']);}return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x31e785){if(_0x31e785){return _0x31e785?{'count':_0x2fbac7,'rows':_0x31e785}:null;}})[_0x14e8('0x27')](respondWithResult(_0x1cdcca,null))[_0x14e8('0x48')](handleError(_0x1cdcca,null));};exports[_0x14e8('0x4f')]=function(_0x139405,_0x5b6e28,_0x4c30dd){if(_0x139405['body']['id']){delete _0x139405[_0x14e8('0x4a')]['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x4b')]({'where':{'id':_0x139405[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x5b6e28,null))[_0x14e8('0x27')](function(_0x402956){if(_0x402956){_0x139405['body'][_0x14e8('0x50')]=_0x402956['id'];_0x139405[_0x14e8('0x4a')]['Subjects']=integrations[_0x14e8('0x51')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405['body']['type']);_0x139405[_0x14e8('0x4a')][_0x14e8('0x52')]=integrations[_0x14e8('0x53')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405[_0x14e8('0x4a')][_0x14e8('0x30')]);return db[_0x14e8('0x4c')][_0x14e8('0x49')](_0x139405[_0x14e8('0x4a')],{'include':[{'model':db[_0x14e8('0x54')],'as':'Subjects'},{'model':db[_0x14e8('0x54')],'as':_0x14e8('0x52')}]});}return null;})[_0x14e8('0x27')](respondWithResult(_0x5b6e28,null))['catch'](handleError(_0x5b6e28,null));};exports['getFields']=function(_0x20a598,_0x53d0c8,_0x25f63c){var _0x5cbce8='';return db[_0x14e8('0x2e')]['findOne']({'where':{'id':_0x20a598[_0x14e8('0x46')]['id']},'attributes':['id',_0x14e8('0x55'),'password',_0x14e8('0x56'),_0x14e8('0x57'),_0x14e8('0x58')]})[_0x14e8('0x27')](handleEntityNotFound(_0x53d0c8,null))[_0x14e8('0x27')](function(_0x6dee32){if(_0x6dee32){_0x5cbce8=_0x6dee32[_0x14e8('0x58')];var _0x2ba695=_0x5cbce8[_0x14e8('0x59')](-0x1);if(_0x2ba695==='/'){_0x5cbce8=_0x5cbce8[_0x14e8('0x5a')](0x0,_0x5cbce8[_0x14e8('0x5b')](_0x2ba695));}var _0x2e0e7d={'method':_0x14e8('0x5c'),'uri':util['format']('%s/%s',_0x5cbce8,'ticket_fields'),'json':!![]};switch(_0x6dee32[_0x14e8('0x57')]){case _0x14e8('0x5d'):_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util['format']('%s:%s',_0x6dee32['username'],_0x6dee32[_0x14e8('0x5d')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;case'token':_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util[_0x14e8('0x62')](_0x14e8('0x63'),_0x6dee32[_0x14e8('0x55')],_0x6dee32[_0x14e8('0x56')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;default:throw new db[(_0x14e8('0x64'))][(_0x14e8('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x2e0e7d);}})[_0x14e8('0x27')](function(_0x4eb2ef){if(_0x4eb2ef){var _0x355395=[_0x14e8('0x66'),_0x14e8('0x67'),_0x14e8('0x68'),_0x14e8('0x69')];_[_0x14e8('0x6a')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x308617){return _0x355395[_0x14e8('0x6c')](_0x308617['type']);});return{'count':_0x4eb2ef[_0x14e8('0x6b')][_0x14e8('0x39')],'rows':_[_0x14e8('0x2d')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x492757){return{'id':_0x492757['id'],'name':_0x492757[_0x14e8('0x6d')]>0x7?_0x492757[_0x14e8('0x6e')]:_0x492757[_0x14e8('0x30')],'custom':_0x492757[_0x14e8('0x6d')]>0x7?!![]:![],'options':_0x492757['system_field_options']?_0x492757[_0x14e8('0x6f')]:_0x492757['custom_field_options']?_0x492757[_0x14e8('0x70')]:[]};})};}})['then'](respondWithResult(_0x53d0c8,null))['catch'](function(_0x3e820f){var _0xb68079=_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?0x1f4:_0x3e820f[_0x14e8('0x72')]||0x1f4;logger[_0x14e8('0x28')](_0x14e8('0x73'),_0x14e8('0x74'),_0xb68079,JSON[_0x14e8('0x75')](_0x3e820f));delete _0x3e820f[_0x14e8('0x2a')];if(_0xb68079===0x191){_0xb68079=0x190;}_0x53d0c8[_0x14e8('0x1c')](_0xb68079)['send'](_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?{'message':_0x14e8('0x76'),'statusCode':_0x3e820f['statusCode']}:_0x3e820f);});}; \ No newline at end of file +var _0x91a7=['includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ZendeskAccount','count','include','rows','params','keys','includeAll','find','catch','create','body','destroy','getConfigurations','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','findOne','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','headers','toString','base64','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x1d0f4a,_0x287d84){var _0x4e8e47=function(_0x145b4b){while(--_0x145b4b){_0x1d0f4a['push'](_0x1d0f4a['shift']());}};_0x4e8e47(++_0x287d84);}(_0x91a7,0xe7));var _0x791a=function(_0x52675c,_0x3b0387){_0x52675c=_0x52675c-0x0;var _0x345227=_0x91a7[_0x52675c];return _0x345227;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5daecd,_0xc92016){_0xc92016=_0xc92016||0xcc;return function(_0x2f2d8d){if(_0x2f2d8d){return _0x5daecd['sendStatus'](_0xc92016);}return _0x5daecd[_0x791a('0x16')](_0xc92016)[_0x791a('0x17')]();};}function respondWithResult(_0x5d5b11,_0x2887f0){_0x2887f0=_0x2887f0||0xc8;return function(_0x31b86d){if(_0x31b86d){return _0x5d5b11[_0x791a('0x16')](_0x2887f0)[_0x791a('0x18')](_0x31b86d);}};}function respondWithFilteredResult(_0x55e845,_0x2ce2e0){return function(_0x575d11){if(_0x575d11){var _0x43dea6=typeof _0x2ce2e0[_0x791a('0x19')]==='undefined'&&typeof _0x2ce2e0[_0x791a('0x1a')]==='undefined';var _0x35fe48=_0x575d11['count'];var _0x4a84ee=_0x43dea6?0x0:_0x2ce2e0['offset'];var _0x40f0d3=_0x43dea6?_0x575d11['count']:_0x2ce2e0['offset']+_0x2ce2e0[_0x791a('0x1a')];var _0x5a702e;if(_0x40f0d3>=_0x35fe48){_0x40f0d3=_0x35fe48;_0x5a702e=0xc8;}else{_0x5a702e=0xce;}_0x55e845[_0x791a('0x16')](_0x5a702e);return _0x55e845[_0x791a('0x1b')]('Content-Range',_0x4a84ee+'-'+_0x40f0d3+'/'+_0x35fe48)[_0x791a('0x18')](_0x575d11);}return null;};}function patchUpdates(_0xcb5e66){return function(_0x234514){try{jsonpatch[_0x791a('0x1c')](_0x234514,_0xcb5e66,!![]);}catch(_0x530e32){return BPromise[_0x791a('0x1d')](_0x530e32);}return _0x234514[_0x791a('0x1e')]();};}function saveUpdates(_0x25bae5,_0x9e17b5){return function(_0x3200dd){if(_0x3200dd){return _0x3200dd[_0x791a('0x1f')](_0x25bae5)[_0x791a('0x20')](function(_0x45a67d){return _0x45a67d;});}return null;};}function removeEntity(_0x323c6a,_0xe8e452){return function(_0x137992){if(_0x137992){return _0x137992['destroy']()[_0x791a('0x20')](function(){_0x323c6a[_0x791a('0x16')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x2966b8,_0x4d748a){return function(_0x456480){if(!_0x456480){_0x2966b8[_0x791a('0x21')](0x194);}return _0x456480;};}function handleError(_0x51dcca,_0xdfa84f){_0xdfa84f=_0xdfa84f||0x1f4;return function(_0x1785f5){logger[_0x791a('0x22')](_0x1785f5['stack']);if(_0x1785f5[_0x791a('0x23')]){delete _0x1785f5[_0x791a('0x23')];}_0x51dcca[_0x791a('0x16')](_0xdfa84f)[_0x791a('0x24')](_0x1785f5);};}exports[_0x791a('0x25')]=function(_0x1a9c6b,_0x628816){var _0x889534={},_0x58bbc0={},_0xbc3436={'count':0x0,'rows':[]};var _0x9e9332=_[_0x791a('0x26')](db['ZendeskAccount'][_0x791a('0x27')],function(_0x5df656){return{'name':_0x5df656[_0x791a('0x28')],'type':_0x5df656[_0x791a('0x29')][_0x791a('0x2a')]};});_0x58bbc0[_0x791a('0x2b')]=_[_0x791a('0x26')](_0x9e9332,_0x791a('0x23'));_0x58bbc0[_0x791a('0x2c')]=_['keys'](_0x1a9c6b[_0x791a('0x2c')]);_0x58bbc0[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],_0x58bbc0[_0x791a('0x2c')]);_0x889534['attributes']=_[_0x791a('0x2e')](_0x58bbc0[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x2f')]));_0x889534['attributes']=_0x889534[_0x791a('0x30')][_0x791a('0x31')]?_0x889534[_0x791a('0x30')]:_0x58bbc0[_0x791a('0x2b')];if(!_0x1a9c6b[_0x791a('0x2c')]['hasOwnProperty'](_0x791a('0x32'))){_0x889534['limit']=qs[_0x791a('0x1a')](_0x1a9c6b['query']['limit']);_0x889534[_0x791a('0x19')]=qs[_0x791a('0x19')](_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x19')]);}_0x889534[_0x791a('0x33')]=qs[_0x791a('0x34')](_0x1a9c6b[_0x791a('0x2c')]['sort']);_0x889534[_0x791a('0x35')]=qs['filters'](_[_0x791a('0x36')](_0x1a9c6b['query'],_0x58bbc0[_0x791a('0x2d')]),_0x9e9332);if(_0x1a9c6b[_0x791a('0x2c')]['filter']){_0x889534[_0x791a('0x35')]=_[_0x791a('0x37')](_0x889534['where'],{'$or':_[_0x791a('0x26')](_0x9e9332,function(_0x165e2b){if(_0x165e2b[_0x791a('0x29')]!==_0x791a('0x38')){var _0x29d267={};_0x29d267[_0x165e2b[_0x791a('0x23')]]={'$like':'%'+_0x1a9c6b[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x29d267;}})});}_0x889534=_[_0x791a('0x37')]({},_0x889534,_0x1a9c6b[_0x791a('0x3a')]);var _0x587481={'where':_0x889534[_0x791a('0x35')]};return db[_0x791a('0x3b')][_0x791a('0x3c')](_0x587481)['then'](function(_0xf4e2fa){_0xbc3436['count']=_0xf4e2fa;if(_0x1a9c6b['query']['includeAll']){_0x889534[_0x791a('0x3d')]=[{'all':!![]}];}return db[_0x791a('0x3b')]['findAll'](_0x889534);})[_0x791a('0x20')](function(_0x2d1692){_0xbc3436[_0x791a('0x3e')]=_0x2d1692;return _0xbc3436;})[_0x791a('0x20')](respondWithFilteredResult(_0x628816,_0x889534))['catch'](handleError(_0x628816,null));};exports['show']=function(_0x57b9ba,_0x2f0395){var _0x216dd3={'raw':![],'where':{'id':_0x57b9ba[_0x791a('0x3f')]['id']}},_0x4e0191={};_0x4e0191[_0x791a('0x2b')]=_[_0x791a('0x40')](db[_0x791a('0x3b')]['rawAttributes']);_0x4e0191[_0x791a('0x2c')]=_['keys'](_0x57b9ba[_0x791a('0x2c')]);_0x4e0191[_0x791a('0x2d')]=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],_0x4e0191[_0x791a('0x2c')]);_0x216dd3['attributes']=_[_0x791a('0x2e')](_0x4e0191[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0x57b9ba[_0x791a('0x2c')][_0x791a('0x2f')]));_0x216dd3['attributes']=_0x216dd3[_0x791a('0x30')][_0x791a('0x31')]?_0x216dd3['attributes']:_0x4e0191['model'];if(_0x57b9ba[_0x791a('0x2c')][_0x791a('0x41')]){_0x216dd3[_0x791a('0x3d')]=[{'all':!![]}];}_0x216dd3=_['merge']({},_0x216dd3,_0x57b9ba['options']);return db[_0x791a('0x3b')][_0x791a('0x42')](_0x216dd3)['then'](handleEntityNotFound(_0x2f0395,null))[_0x791a('0x20')](respondWithResult(_0x2f0395,null))[_0x791a('0x43')](handleError(_0x2f0395,null));};exports[_0x791a('0x44')]=function(_0x549980,_0x5a30a6){return db[_0x791a('0x3b')][_0x791a('0x44')](_0x549980[_0x791a('0x45')],{})[_0x791a('0x20')](respondWithResult(_0x5a30a6,0xc9))['catch'](handleError(_0x5a30a6,null));};exports[_0x791a('0x1f')]=function(_0x9f768a,_0x4e6d0d){if(_0x9f768a[_0x791a('0x45')]['id']){delete _0x9f768a['body']['id'];}return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x9f768a[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4e6d0d,null))[_0x791a('0x20')](saveUpdates(_0x9f768a[_0x791a('0x45')],null))[_0x791a('0x20')](respondWithResult(_0x4e6d0d,null))['catch'](handleError(_0x4e6d0d,null));};exports[_0x791a('0x46')]=function(_0x1fd826,_0x4bffa6){return db[_0x791a('0x3b')][_0x791a('0x42')]({'where':{'id':_0x1fd826['params']['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4bffa6,null))[_0x791a('0x20')](removeEntity(_0x4bffa6,null))[_0x791a('0x43')](handleError(_0x4bffa6,null));};exports[_0x791a('0x47')]=function(_0xd5ec90,_0x4d82eb,_0x4ab42f){var _0x5a616f={};var _0x305033={};var _0x51b556;var _0x4c7555;return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0xd5ec90[_0x791a('0x3f')]['id']}})[_0x791a('0x20')](handleEntityNotFound(_0x4d82eb,null))['then'](function(_0x5166b5){if(_0x5166b5){_0x51b556=_0x5166b5;_0x305033[_0x791a('0x2b')]=_['keys'](db[_0x791a('0x48')][_0x791a('0x27')]);_0x305033[_0x791a('0x2c')]=_['keys'](_0xd5ec90[_0x791a('0x2c')]);_0x305033[_0x791a('0x2d')]=_['intersection'](_0x305033[_0x791a('0x2b')],_0x305033[_0x791a('0x2c')]);_0x5a616f[_0x791a('0x30')]=_[_0x791a('0x2e')](_0x305033[_0x791a('0x2b')],qs[_0x791a('0x2f')](_0xd5ec90['query']['fields']));_0x5a616f[_0x791a('0x30')]=_0x5a616f['attributes'][_0x791a('0x31')]?_0x5a616f[_0x791a('0x30')]:_0x305033[_0x791a('0x2b')];_0x5a616f[_0x791a('0x33')]=qs[_0x791a('0x34')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x34')]);_0x5a616f['where']=qs[_0x791a('0x2d')](_[_0x791a('0x36')](_0xd5ec90[_0x791a('0x2c')],_0x305033[_0x791a('0x2d')]));if(_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]){_0x5a616f[_0x791a('0x35')]=_['merge'](_0x5a616f[_0x791a('0x35')],{'$or':_['map'](_0x5a616f['attributes'],function(_0x1cc240){var _0x3c81e2={};_0x3c81e2[_0x1cc240]={'$like':'%'+_0xd5ec90[_0x791a('0x2c')][_0x791a('0x39')]+'%'};return _0x3c81e2;})});}_0x5a616f=_[_0x791a('0x37')]({},_0x5a616f,_0xd5ec90[_0x791a('0x3a')]);return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x2bfb66){if(_0x2bfb66){_0x4c7555=_0x2bfb66[_0x791a('0x31')];if(!_0xd5ec90[_0x791a('0x2c')][_0x791a('0x49')](_0x791a('0x32'))){_0x5a616f[_0x791a('0x1a')]=qs[_0x791a('0x1a')](_0xd5ec90[_0x791a('0x2c')][_0x791a('0x1a')]);_0x5a616f[_0x791a('0x19')]=qs[_0x791a('0x19')](_0xd5ec90[_0x791a('0x2c')]['offset']);}return _0x51b556[_0x791a('0x47')](_0x5a616f);}})[_0x791a('0x20')](function(_0x380087){if(_0x380087){return _0x380087?{'count':_0x4c7555,'rows':_0x380087}:null;}})[_0x791a('0x20')](respondWithResult(_0x4d82eb,null))[_0x791a('0x43')](handleError(_0x4d82eb,null));};exports['addConfiguration']=function(_0x42ce59,_0x3d24bd,_0x277774){if(_0x42ce59[_0x791a('0x45')]['id']){delete _0x42ce59['body']['id'];}return db[_0x791a('0x3b')]['findOne']({'where':{'id':_0x42ce59['params']['id']}})['then'](handleEntityNotFound(_0x3d24bd,null))['then'](function(_0x22aaf2){if(_0x22aaf2){_0x42ce59[_0x791a('0x45')][_0x791a('0x4a')]=_0x22aaf2['id'];_0x42ce59[_0x791a('0x45')][_0x791a('0x4b')]=integrations[_0x791a('0x4c')](_0x42ce59[_0x791a('0x45')]['channel'],_0x42ce59['body'][_0x791a('0x29')]);_0x42ce59[_0x791a('0x45')]['Descriptions']=integrations['getDescriptions'](_0x42ce59[_0x791a('0x45')][_0x791a('0x4d')],_0x42ce59['body'][_0x791a('0x29')]);return db[_0x791a('0x48')][_0x791a('0x44')](_0x42ce59[_0x791a('0x45')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x791a('0x4e')],'as':_0x791a('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d24bd,null))[_0x791a('0x43')](handleError(_0x3d24bd,null));};exports[_0x791a('0x50')]=function(_0x10b51f,_0x3838c4,_0x565c83){var _0x24efc2='';return db[_0x791a('0x3b')][_0x791a('0x51')]({'where':{'id':_0x10b51f[_0x791a('0x3f')]['id']},'attributes':['id',_0x791a('0x52'),_0x791a('0x53'),_0x791a('0x54'),_0x791a('0x55'),'remoteUri']})['then'](handleEntityNotFound(_0x3838c4,null))['then'](function(_0xf8ac72){if(_0xf8ac72){_0x24efc2=_0xf8ac72[_0x791a('0x56')];var _0x1118a8=_0x24efc2[_0x791a('0x57')](-0x1);if(_0x1118a8==='/'){_0x24efc2=_0x24efc2[_0x791a('0x58')](0x0,_0x24efc2[_0x791a('0x59')](_0x1118a8));}var _0x348e54={'method':_0x791a('0x5a'),'uri':util[_0x791a('0x5b')](_0x791a('0x5c'),_0x24efc2,'ticket_fields'),'json':!![]};switch(_0xf8ac72[_0x791a('0x55')]){case _0x791a('0x53'):_0x348e54['headers']={'Authorization':util[_0x791a('0x5b')](_0x791a('0x5d'),new Buffer(util['format']('%s:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x53')]))['toString']('base64'))};break;case _0x791a('0x54'):_0x348e54[_0x791a('0x5e')]={'Authorization':util[_0x791a('0x5b')]('Basic\x20%s',new Buffer(util[_0x791a('0x5b')]('%s/token:%s',_0xf8ac72[_0x791a('0x52')],_0xf8ac72[_0x791a('0x54')]))[_0x791a('0x5f')](_0x791a('0x60')))};break;default:throw new db[(_0x791a('0x61'))][(_0x791a('0x62'))]('Unknown\x20authentication\x20type');}return rp(_0x348e54);}})[_0x791a('0x20')](function(_0x2e666e){if(_0x2e666e){var _0x41d1a5=[_0x791a('0x63'),_0x791a('0x64'),_0x791a('0x65'),_0x791a('0x66')];_[_0x791a('0x67')](_0x2e666e[_0x791a('0x68')],function(_0x203fc5){return _0x41d1a5[_0x791a('0x69')](_0x203fc5[_0x791a('0x29')]);});return{'count':_0x2e666e[_0x791a('0x68')][_0x791a('0x31')],'rows':_[_0x791a('0x26')](_0x2e666e[_0x791a('0x68')],function(_0x3272c0){return{'id':_0x3272c0['id'],'name':_0x3272c0[_0x791a('0x6a')]>0x7?_0x3272c0['title']:_0x3272c0[_0x791a('0x29')],'custom':_0x3272c0[_0x791a('0x6a')]>0x7?!![]:![],'options':_0x3272c0[_0x791a('0x6b')]?_0x3272c0[_0x791a('0x6b')]:_0x3272c0[_0x791a('0x6c')]?_0x3272c0['custom_field_options']:[]};})};}})[_0x791a('0x20')](respondWithResult(_0x3838c4,null))['catch'](function(_0x467d65){var _0x48b8dc=_0x10b51f[_0x791a('0x2c')][_0x791a('0x6d')]?0x1f4:_0x467d65['statusCode']||0x1f4;logger[_0x791a('0x22')](_0x791a('0x6e'),_0x791a('0x50'),_0x48b8dc,JSON['stringify'](_0x467d65));delete _0x467d65[_0x791a('0x23')];if(_0x48b8dc===0x191){_0x48b8dc=0x190;}_0x3838c4['status'](_0x48b8dc)[_0x791a('0x24')](_0x10b51f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x467d65[_0x791a('0x6f')]}:_0x467d65);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 3a34aea..00cdf23 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 _0xc6fd=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0xc6fd,0x11d));var _0xdc6f=function(_0x22e4db,_0x3df78b){_0x22e4db=_0x22e4db-0x0;var _0x542583=_0xc6fd[_0x22e4db];return _0x542583;};'use strict';var _=require(_0xdc6f('0x0'));var util=require(_0xdc6f('0x1'));var logger=require('../../config/logger')(_0xdc6f('0x2'));var moment=require(_0xdc6f('0x3'));var BPromise=require(_0xdc6f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc6f('0x5'));var rimraf=require(_0xdc6f('0x6'));var config=require(_0xdc6f('0x7'));var attributes=require(_0xdc6f('0x8'));var integrations=require(_0xdc6f('0x9'));module[_0xdc6f('0xa')]=function(_0x502ce8,_0x2bc134){return _0x502ce8[_0xdc6f('0xb')](_0xdc6f('0xc'),attributes,{'tableName':_0xdc6f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2802=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x2802,0xd1));var _0x2280=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x2802[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require('lodash');var util=require(_0x2280('0x0'));var logger=require(_0x2280('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2280('0x2'));var rp=require(_0x2280('0x3'));var fs=require('fs');var path=require(_0x2280('0x4'));var rimraf=require(_0x2280('0x5'));var config=require(_0x2280('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x2280('0x7'));module[_0x2280('0x8')]=function(_0x5a783c,_0x3c21e2){return _0x5a783c[_0x2280('0x9')](_0x2280('0xa'),attributes,{'tableName':_0x2280('0xb'),'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 5571160..1ce820f 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 _0xe585=['where','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ZendeskAccount','options','raw'];(function(_0x42120b,_0x37c565){var _0x5cef94=function(_0x241e81){while(--_0x241e81){_0x42120b['push'](_0x42120b['shift']());}};_0x5cef94(++_0x37c565);}(_0xe585,0x9a));var _0x5e58=function(_0x427975,_0x2b2956){_0x427975=_0x427975-0x0;var _0x227be5=_0xe585[_0x427975];return _0x227be5;};'use strict';var _=require(_0x5e58('0x0'));var util=require('util');var moment=require(_0x5e58('0x1'));var BPromise=require('bluebird');var rs=require(_0x5e58('0x2'));var fs=require('fs');var Redis=require(_0x5e58('0x3'));var db=require(_0x5e58('0x4'))['db'];var utils=require(_0x5e58('0x5'));var logger=require(_0x5e58('0x6'))(_0x5e58('0x7'));var config=require(_0x5e58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5e58('0x9')][_0x5e58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x351ad4,_0x30f05b,_0x3e8b0f){return new BPromise(function(_0x587424,_0x244ee5){return client[_0x5e58('0xb')](_0x351ad4,_0x3e8b0f)[_0x5e58('0xc')](function(_0x57cf49){logger['info'](_0x5e58('0xd'),_0x30f05b,_0x5e58('0xe'));logger[_0x5e58('0xf')](_0x5e58('0x10'),_0x30f05b,'request\x20sent',JSON['stringify'](_0x57cf49));if(_0x57cf49[_0x5e58('0x11')]){if(_0x57cf49['error'][_0x5e58('0x12')]===0x1f4){logger[_0x5e58('0x11')](_0x5e58('0xd'),_0x30f05b,_0x57cf49[_0x5e58('0x11')][_0x5e58('0x13')]);return _0x244ee5(_0x57cf49[_0x5e58('0x11')][_0x5e58('0x13')]);}logger['error'](_0x5e58('0xd'),_0x30f05b,_0x57cf49[_0x5e58('0x11')][_0x5e58('0x13')]);return _0x587424(_0x57cf49[_0x5e58('0x11')]['message']);}else{logger[_0x5e58('0x14')](_0x5e58('0xd'),_0x30f05b,'request\x20sent');_0x587424(_0x57cf49[_0x5e58('0x15')]['message']);}})[_0x5e58('0x16')](function(_0xdade30){logger['error'](_0x5e58('0xd'),_0x30f05b,_0xdade30);_0x244ee5(_0xdade30);});});}exports['GetZendeskAccount']=function(_0x3ecfb8){var _0x4f67c6=this;return new Promise(function(_0x1b2c82,_0x4edbc0){return db[_0x5e58('0x17')]['findAll']({'raw':_0x3ecfb8[_0x5e58('0x18')]?_0x3ecfb8['options'][_0x5e58('0x19')]===undefined?!![]:![]:!![],'where':_0x3ecfb8[_0x5e58('0x18')]?_0x3ecfb8[_0x5e58('0x18')][_0x5e58('0x1a')]||null:null,'attributes':_0x3ecfb8['options']?_0x3ecfb8[_0x5e58('0x18')][_0x5e58('0x1b')]||null:null,'limit':_0x3ecfb8['options']?_0x3ecfb8[_0x5e58('0x18')][_0x5e58('0x1c')]||null:null,'include':_0x3ecfb8[_0x5e58('0x18')]?_0x3ecfb8['options'][_0x5e58('0x1d')]?_[_0x5e58('0x1e')](_0x3ecfb8['options'][_0x5e58('0x1d')],function(_0x378e8d){return{'model':db[_0x378e8d['model']],'as':_0x378e8d['as'],'attributes':_0x378e8d[_0x5e58('0x1b')],'include':_0x378e8d['include']?_[_0x5e58('0x1e')](_0x378e8d[_0x5e58('0x1d')],function(_0x3856ad){return{'model':db[_0x3856ad[_0x5e58('0x1f')]],'as':_0x3856ad['as'],'attributes':_0x3856ad['attributes'],'include':_0x3856ad[_0x5e58('0x1d')]?_[_0x5e58('0x1e')](_0x3856ad['include'],function(_0x4313ac){return{'model':db[_0x4313ac[_0x5e58('0x1f')]],'as':_0x4313ac['as'],'attributes':_0x4313ac[_0x5e58('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5e58('0xc')](function(_0x2401b8){logger[_0x5e58('0x14')](_0x5e58('0x20'),_0x3ecfb8);logger[_0x5e58('0xf')](_0x5e58('0x20'),_0x3ecfb8,JSON[_0x5e58('0x21')](_0x2401b8));_0x1b2c82(_0x2401b8);})[_0x5e58('0x16')](function(_0x133e58){logger[_0x5e58('0x11')]('GetZendeskAccount',_0x133e58[_0x5e58('0x13')],_0x3ecfb8);_0x4edbc0(_0x4f67c6[_0x5e58('0x11')](0x1f4,_0x133e58[_0x5e58('0x13')]));});});};exports[_0x5e58('0x22')]=function(_0x216594){var _0x2052c8=this;return new Promise(function(_0x21dd2a,_0x5ade0d){return db['ZendeskAccount'][_0x5e58('0x23')]({'raw':_0x216594[_0x5e58('0x18')]?_0x216594[_0x5e58('0x18')][_0x5e58('0x19')]===undefined?!![]:![]:!![],'where':_0x216594['options']?_0x216594[_0x5e58('0x18')][_0x5e58('0x1a')]||null:null,'attributes':_0x216594[_0x5e58('0x18')]?_0x216594[_0x5e58('0x18')][_0x5e58('0x1b')]||null:null,'include':_0x216594['options']?_0x216594[_0x5e58('0x18')][_0x5e58('0x1d')]?_['map'](_0x216594[_0x5e58('0x18')][_0x5e58('0x1d')],function(_0x5a1aeb){return{'model':db[_0x5a1aeb[_0x5e58('0x1f')]],'as':_0x5a1aeb['as'],'attributes':_0x5a1aeb['attributes'],'include':_0x5a1aeb['include']?_['map'](_0x5a1aeb[_0x5e58('0x1d')],function(_0x2ee3ea){return{'model':db[_0x2ee3ea['model']],'as':_0x2ee3ea['as'],'attributes':_0x2ee3ea['attributes'],'include':_0x2ee3ea['include']?_[_0x5e58('0x1e')](_0x2ee3ea[_0x5e58('0x1d')],function(_0x2292bd){return{'model':db[_0x2292bd['model']],'as':_0x2292bd['as'],'attributes':_0x2292bd['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e58('0xc')](function(_0x44c7a0){logger['info']('ShowZendeskAccount',_0x216594);logger[_0x5e58('0xf')](_0x5e58('0x22'),_0x216594,JSON[_0x5e58('0x21')](_0x44c7a0));_0x21dd2a(_0x44c7a0);})[_0x5e58('0x16')](function(_0x1bad03){logger[_0x5e58('0x11')](_0x5e58('0x22'),_0x1bad03['message'],_0x216594);_0x5ade0d(_0x2052c8['error'](0x1f4,_0x1bad03[_0x5e58('0x13')]));});});}; \ No newline at end of file +var _0x627a=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash'];(function(_0x50f395,_0x86f564){var _0x3d6ac6=function(_0x15f91a){while(--_0x15f91a){_0x50f395['push'](_0x50f395['shift']());}};_0x3d6ac6(++_0x86f564);}(_0x627a,0xae));var _0xa627=function(_0x2ac2eb,_0x252bf8){_0x2ac2eb=_0x2ac2eb-0x0;var _0x2383f7=_0x627a[_0x2ac2eb];return _0x2383f7;};'use strict';var _=require(_0xa627('0x0'));var util=require(_0xa627('0x1'));var moment=require('moment');var BPromise=require(_0xa627('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa627('0x3'));var db=require(_0xa627('0x4'))['db'];var utils=require(_0xa627('0x5'));var logger=require(_0xa627('0x6'))(_0xa627('0x7'));var config=require('../../config/environment');var jayson=require(_0xa627('0x8'));var client=jayson['client'][_0xa627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cc8eb,_0xff1f4d,_0x5184fe){return new BPromise(function(_0x1e1fd0,_0x4fad84){return client[_0xa627('0xa')](_0x1cc8eb,_0x5184fe)[_0xa627('0xb')](function(_0x27fdc9){logger[_0xa627('0xc')](_0xa627('0xd'),_0xff1f4d,_0xa627('0xe'));logger[_0xa627('0xf')](_0xa627('0x10'),_0xff1f4d,_0xa627('0xe'),JSON[_0xa627('0x11')](_0x27fdc9));if(_0x27fdc9[_0xa627('0x12')]){if(_0x27fdc9[_0xa627('0x12')]['code']===0x1f4){logger[_0xa627('0x12')](_0xa627('0xd'),_0xff1f4d,_0x27fdc9['error'][_0xa627('0x13')]);return _0x4fad84(_0x27fdc9[_0xa627('0x12')]['message']);}logger[_0xa627('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0xff1f4d,_0x27fdc9[_0xa627('0x12')][_0xa627('0x13')]);return _0x1e1fd0(_0x27fdc9['error'][_0xa627('0x13')]);}else{logger[_0xa627('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xff1f4d,'request\x20sent');_0x1e1fd0(_0x27fdc9[_0xa627('0x14')][_0xa627('0x13')]);}})[_0xa627('0x15')](function(_0x478483){logger[_0xa627('0x12')](_0xa627('0xd'),_0xff1f4d,_0x478483);_0x4fad84(_0x478483);});});}exports['GetZendeskAccount']=function(_0x191ab9){var _0x123d94=this;return new Promise(function(_0x38797f,_0x3941ab){return db[_0xa627('0x16')][_0xa627('0x17')]({'raw':_0x191ab9[_0xa627('0x18')]?_0x191ab9[_0xa627('0x18')][_0xa627('0x19')]===undefined?!![]:![]:!![],'where':_0x191ab9[_0xa627('0x18')]?_0x191ab9[_0xa627('0x18')][_0xa627('0x1a')]||null:null,'attributes':_0x191ab9[_0xa627('0x18')]?_0x191ab9['options'][_0xa627('0x1b')]||null:null,'limit':_0x191ab9['options']?_0x191ab9[_0xa627('0x18')][_0xa627('0x1c')]||null:null,'include':_0x191ab9[_0xa627('0x18')]?_0x191ab9[_0xa627('0x18')][_0xa627('0x1d')]?_['map'](_0x191ab9['options'][_0xa627('0x1d')],function(_0x1a1f8b){return{'model':db[_0x1a1f8b['model']],'as':_0x1a1f8b['as'],'attributes':_0x1a1f8b[_0xa627('0x1b')],'include':_0x1a1f8b[_0xa627('0x1d')]?_['map'](_0x1a1f8b[_0xa627('0x1d')],function(_0x48a86d){return{'model':db[_0x48a86d['model']],'as':_0x48a86d['as'],'attributes':_0x48a86d[_0xa627('0x1b')],'include':_0x48a86d[_0xa627('0x1d')]?_[_0xa627('0x1e')](_0x48a86d[_0xa627('0x1d')],function(_0x51eb2f){return{'model':db[_0x51eb2f[_0xa627('0x1f')]],'as':_0x51eb2f['as'],'attributes':_0x51eb2f[_0xa627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa627('0xb')](function(_0x1067a4){logger[_0xa627('0xc')](_0xa627('0x20'),_0x191ab9);logger[_0xa627('0xf')]('GetZendeskAccount',_0x191ab9,JSON[_0xa627('0x11')](_0x1067a4));_0x38797f(_0x1067a4);})[_0xa627('0x15')](function(_0x46bb65){logger[_0xa627('0x12')]('GetZendeskAccount',_0x46bb65[_0xa627('0x13')],_0x191ab9);_0x3941ab(_0x123d94[_0xa627('0x12')](0x1f4,_0x46bb65[_0xa627('0x13')]));});});};exports[_0xa627('0x21')]=function(_0x3f7ca3){var _0x239f58=this;return new Promise(function(_0x162eb2,_0x3a2ea3){return db[_0xa627('0x16')][_0xa627('0x22')]({'raw':_0x3f7ca3[_0xa627('0x18')]?_0x3f7ca3[_0xa627('0x18')][_0xa627('0x19')]===undefined?!![]:![]:!![],'where':_0x3f7ca3[_0xa627('0x18')]?_0x3f7ca3['options']['where']||null:null,'attributes':_0x3f7ca3[_0xa627('0x18')]?_0x3f7ca3[_0xa627('0x18')][_0xa627('0x1b')]||null:null,'include':_0x3f7ca3['options']?_0x3f7ca3[_0xa627('0x18')][_0xa627('0x1d')]?_['map'](_0x3f7ca3['options'][_0xa627('0x1d')],function(_0x5e7518){return{'model':db[_0x5e7518['model']],'as':_0x5e7518['as'],'attributes':_0x5e7518[_0xa627('0x1b')],'include':_0x5e7518['include']?_[_0xa627('0x1e')](_0x5e7518[_0xa627('0x1d')],function(_0x22bb29){return{'model':db[_0x22bb29[_0xa627('0x1f')]],'as':_0x22bb29['as'],'attributes':_0x22bb29['attributes'],'include':_0x22bb29['include']?_['map'](_0x22bb29[_0xa627('0x1d')],function(_0x323600){return{'model':db[_0x323600['model']],'as':_0x323600['as'],'attributes':_0x323600[_0xa627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa627('0xb')](function(_0x429179){logger[_0xa627('0xc')](_0xa627('0x21'),_0x3f7ca3);logger[_0xa627('0xf')](_0xa627('0x21'),_0x3f7ca3,JSON[_0xa627('0x11')](_0x429179));_0x162eb2(_0x429179);})[_0xa627('0x15')](function(_0x3da153){logger[_0xa627('0x12')](_0xa627('0x21'),_0x3da153[_0xa627('0x13')],_0x3f7ca3);_0x3a2ea3(_0x239f58[_0xa627('0x12')](0x1f4,_0x3da153[_0xa627('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 460ad7c..5c0a4a8 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 _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x2f9b8d,_0x2335f3){var _0x4367e0=function(_0x361993){while(--_0x361993){_0x2f9b8d['push'](_0x2f9b8d['shift']());}};_0x4367e0(++_0x2335f3);}(_0xa571,0x107));var _0x1a57=function(_0x14f55c,_0x2adaaf){_0x14f55c=_0x14f55c-0x0;var _0x513e7a=_0xa571[_0x14f55c];return _0x513e7a;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file +var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x32f845,_0x335cb9){var _0x3c0de4=function(_0x44c308){while(--_0x44c308){_0x32f845['push'](_0x32f845['shift']());}};_0x3c0de4(++_0x335cb9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b3ef0ac..51115e0 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 _0xfea0=['exports','STRING'];(function(_0x4a3e52,_0x279057){var _0x5e10d0=function(_0x46b05d){while(--_0x46b05d){_0x4a3e52['push'](_0x4a3e52['shift']());}};_0x5e10d0(++_0x279057);}(_0xfea0,0x132));var _0x0fea=function(_0x23b44b,_0x55c618){_0x23b44b=_0x23b44b-0x0;var _0x37d039=_0xfea0[_0x23b44b];return _0x37d039;};'use strict';var Sequelize=require('sequelize');module[_0x0fea('0x0')]={'name':{'type':Sequelize[_0x0fea('0x1')]},'description':{'type':Sequelize[_0x0fea('0x1')]}}; \ No newline at end of file +var _0x7b76=['STRING','sequelize','exports'];(function(_0x5ef75c,_0xf23664){var _0x5c5309=function(_0x4c4229){while(--_0x4c4229){_0x5ef75c['push'](_0x5ef75c['shift']());}};_0x5c5309(++_0xf23664);}(_0x7b76,0x1cf));var _0x67b7=function(_0x54e5b0,_0x2a0cde){_0x54e5b0=_0x54e5b0-0x0;var _0x32761f=_0x7b76[_0x54e5b0];return _0x32761f;};'use strict';var Sequelize=require(_0x67b7('0x0'));module[_0x67b7('0x1')]={'name':{'type':Sequelize[_0x67b7('0x2')]},'description':{'type':Sequelize[_0x67b7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 5ded6a6..a488e0f 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 _0x6d42=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','keys','find','create','body','update','params','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0x6d42,0x137));var _0x26d4=function(_0x55ed46,_0x1277ed){_0x55ed46=_0x55ed46-0x0;var _0x2465f4=_0x6d42[_0x55ed46];return _0x2465f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26d4('0x0'));var zipdir=require(_0x26d4('0x1'));var jsonpatch=require(_0x26d4('0x2'));var rp=require(_0x26d4('0x3'));var moment=require(_0x26d4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x26d4('0x5'));var path=require(_0x26d4('0x6'));var sox=require(_0x26d4('0x7'));var csv=require(_0x26d4('0x8'));var ejs=require(_0x26d4('0x9'));var fs=require('fs');var fs_extra=require(_0x26d4('0xa'));var _=require(_0x26d4('0xb'));var squel=require(_0x26d4('0xc'));var crypto=require('crypto');var jsforce=require(_0x26d4('0xd'));var deskjs=require(_0x26d4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26d4('0xf'));var Papa=require(_0x26d4('0x10'));var Redis=require(_0x26d4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26d4('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x26d4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x26d4('0x14'))['db'];function respondWithStatusCode(_0x2fd1ef,_0x28a1fa){_0x28a1fa=_0x28a1fa||0xcc;return function(_0x46cafe){if(_0x46cafe){return _0x2fd1ef[_0x26d4('0x15')](_0x28a1fa);}return _0x2fd1ef[_0x26d4('0x16')](_0x28a1fa)[_0x26d4('0x17')]();};}function respondWithResult(_0x34aedf,_0x37b8c0){_0x37b8c0=_0x37b8c0||0xc8;return function(_0x8f11e4){if(_0x8f11e4){return _0x34aedf[_0x26d4('0x16')](_0x37b8c0)[_0x26d4('0x18')](_0x8f11e4);}};}function respondWithFilteredResult(_0x147354,_0x15db98){return function(_0x42c26f){if(_0x42c26f){var _0x347039=typeof _0x15db98[_0x26d4('0x19')]===_0x26d4('0x1a')&&typeof _0x15db98[_0x26d4('0x1b')]===_0x26d4('0x1a');var _0x5be322=_0x42c26f[_0x26d4('0x1c')];var _0x137f3b=_0x347039?0x0:_0x15db98[_0x26d4('0x19')];var _0x562b0d=_0x347039?_0x42c26f['count']:_0x15db98[_0x26d4('0x19')]+_0x15db98[_0x26d4('0x1b')];var _0x46235d;if(_0x562b0d>=_0x5be322){_0x562b0d=_0x5be322;_0x46235d=0xc8;}else{_0x46235d=0xce;}_0x147354[_0x26d4('0x16')](_0x46235d);return _0x147354[_0x26d4('0x1d')](_0x26d4('0x1e'),_0x137f3b+'-'+_0x562b0d+'/'+_0x5be322)[_0x26d4('0x18')](_0x42c26f);}return null;};}function patchUpdates(_0x6e2364){return function(_0x27e1cc){try{jsonpatch[_0x26d4('0x1f')](_0x27e1cc,_0x6e2364,!![]);}catch(_0x2085b0){return BPromise['reject'](_0x2085b0);}return _0x27e1cc['save']();};}function saveUpdates(_0x9c19d0,_0x30896e){return function(_0x41193f){if(_0x41193f){return _0x41193f['update'](_0x9c19d0)[_0x26d4('0x20')](function(_0x3e0673){return _0x3e0673;});}return null;};}function removeEntity(_0x452d1d,_0xf47df6){return function(_0x334ce9){if(_0x334ce9){return _0x334ce9['destroy']()[_0x26d4('0x20')](function(){_0x452d1d[_0x26d4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42d51b,_0x4f8609){return function(_0x1757ef){if(!_0x1757ef){_0x42d51b['sendStatus'](0x194);}return _0x1757ef;};}function handleError(_0x3a2fb6,_0x3734c0){_0x3734c0=_0x3734c0||0x1f4;return function(_0x5a4d6f){logger[_0x26d4('0x21')](_0x5a4d6f[_0x26d4('0x22')]);if(_0x5a4d6f[_0x26d4('0x23')]){delete _0x5a4d6f[_0x26d4('0x23')];}_0x3a2fb6[_0x26d4('0x16')](_0x3734c0)['send'](_0x5a4d6f);};}exports[_0x26d4('0x24')]=function(_0x5360ab,_0x263908){var _0x3b5117={},_0x217531={},_0x4f4ac3={'count':0x0,'rows':[]};var _0x287323=_[_0x26d4('0x25')](db[_0x26d4('0x26')][_0x26d4('0x27')],function(_0x2b5b1b){return{'name':_0x2b5b1b[_0x26d4('0x28')],'type':_0x2b5b1b['type'][_0x26d4('0x29')]};});_0x217531['model']=_['map'](_0x287323,_0x26d4('0x23'));_0x217531[_0x26d4('0x2a')]=_['keys'](_0x5360ab[_0x26d4('0x2a')]);_0x217531[_0x26d4('0x2b')]=_['intersection'](_0x217531['model'],_0x217531['query']);_0x3b5117[_0x26d4('0x2c')]=_[_0x26d4('0x2d')](_0x217531[_0x26d4('0x2e')],qs[_0x26d4('0x2f')](_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x2f')]));_0x3b5117[_0x26d4('0x2c')]=_0x3b5117['attributes'][_0x26d4('0x30')]?_0x3b5117[_0x26d4('0x2c')]:_0x217531[_0x26d4('0x2e')];if(!_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x31')](_0x26d4('0x32'))){_0x3b5117[_0x26d4('0x1b')]=qs[_0x26d4('0x1b')](_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x1b')]);_0x3b5117['offset']=qs[_0x26d4('0x19')](_0x5360ab[_0x26d4('0x2a')]['offset']);}_0x3b5117[_0x26d4('0x33')]=qs[_0x26d4('0x34')](_0x5360ab['query'][_0x26d4('0x34')]);_0x3b5117['where']=qs[_0x26d4('0x2b')](_[_0x26d4('0x35')](_0x5360ab[_0x26d4('0x2a')],_0x217531[_0x26d4('0x2b')]),_0x287323);if(_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x36')]){_0x3b5117['where']=_['merge'](_0x3b5117[_0x26d4('0x37')],{'$or':_[_0x26d4('0x25')](_0x287323,function(_0xca0873){if(_0xca0873['type']!==_0x26d4('0x38')){var _0x5a9bda={};_0x5a9bda[_0xca0873[_0x26d4('0x23')]]={'$like':'%'+_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x36')]+'%'};return _0x5a9bda;}})});}_0x3b5117=_[_0x26d4('0x39')]({},_0x3b5117,_0x5360ab[_0x26d4('0x3a')]);var _0x5c0faf={'where':_0x3b5117[_0x26d4('0x37')]};return db[_0x26d4('0x26')][_0x26d4('0x1c')](_0x5c0faf)[_0x26d4('0x20')](function(_0x4a218c){_0x4f4ac3[_0x26d4('0x1c')]=_0x4a218c;if(_0x5360ab[_0x26d4('0x2a')][_0x26d4('0x3b')]){_0x3b5117[_0x26d4('0x3c')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x3b5117);})[_0x26d4('0x20')](function(_0x33f899){_0x4f4ac3[_0x26d4('0x3d')]=_0x33f899;return _0x4f4ac3;})[_0x26d4('0x20')](respondWithFilteredResult(_0x263908,_0x3b5117))[_0x26d4('0x3e')](handleError(_0x263908,null));};exports[_0x26d4('0x3f')]=function(_0x261e93,_0x487147){var _0x571f75={'raw':![],'where':{'id':_0x261e93['params']['id']}},_0x4b8122={};_0x4b8122['model']=_[_0x26d4('0x40')](db[_0x26d4('0x26')][_0x26d4('0x27')]);_0x4b8122['query']=_['keys'](_0x261e93[_0x26d4('0x2a')]);_0x4b8122[_0x26d4('0x2b')]=_[_0x26d4('0x2d')](_0x4b8122[_0x26d4('0x2e')],_0x4b8122[_0x26d4('0x2a')]);_0x571f75[_0x26d4('0x2c')]=_[_0x26d4('0x2d')](_0x4b8122['model'],qs[_0x26d4('0x2f')](_0x261e93[_0x26d4('0x2a')][_0x26d4('0x2f')]));_0x571f75[_0x26d4('0x2c')]=_0x571f75[_0x26d4('0x2c')][_0x26d4('0x30')]?_0x571f75[_0x26d4('0x2c')]:_0x4b8122[_0x26d4('0x2e')];if(_0x261e93[_0x26d4('0x2a')][_0x26d4('0x3b')]){_0x571f75[_0x26d4('0x3c')]=[{'all':!![]}];}_0x571f75=_[_0x26d4('0x39')]({},_0x571f75,_0x261e93[_0x26d4('0x3a')]);return db[_0x26d4('0x26')][_0x26d4('0x41')](_0x571f75)[_0x26d4('0x20')](handleEntityNotFound(_0x487147,null))[_0x26d4('0x20')](respondWithResult(_0x487147,null))[_0x26d4('0x3e')](handleError(_0x487147,null));};exports[_0x26d4('0x42')]=function(_0x4b7fed,_0x4223b3){return db['ZendeskConfiguration'][_0x26d4('0x42')](_0x4b7fed[_0x26d4('0x43')],{})[_0x26d4('0x20')](respondWithResult(_0x4223b3,0xc9))[_0x26d4('0x3e')](handleError(_0x4223b3,null));};exports[_0x26d4('0x44')]=function(_0x1e9d64,_0x81b332){if(_0x1e9d64[_0x26d4('0x43')]['id']){delete _0x1e9d64[_0x26d4('0x43')]['id'];}return db['ZendeskConfiguration'][_0x26d4('0x41')]({'where':{'id':_0x1e9d64[_0x26d4('0x45')]['id']}})[_0x26d4('0x20')](handleEntityNotFound(_0x81b332,null))[_0x26d4('0x20')](saveUpdates(_0x1e9d64['body'],null))[_0x26d4('0x20')](respondWithResult(_0x81b332,null))[_0x26d4('0x3e')](handleError(_0x81b332,null));};exports['destroy']=function(_0x367fd1,_0x14b611){return db[_0x26d4('0x26')]['find']({'where':{'id':_0x367fd1[_0x26d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x14b611,null))[_0x26d4('0x20')](removeEntity(_0x14b611,null))[_0x26d4('0x3e')](handleError(_0x14b611,null));};exports['getFields']=function(_0x228f08,_0xa9b143,_0x33ad19){var _0x4e2d99={};var _0x4d69f4={};var _0x40ced1;var _0x2de588;return db[_0x26d4('0x26')][_0x26d4('0x46')]({'where':{'id':_0x228f08[_0x26d4('0x45')]['id']}})[_0x26d4('0x20')](handleEntityNotFound(_0xa9b143,null))[_0x26d4('0x20')](function(_0x8d59a6){if(_0x8d59a6){_0x40ced1=_0x8d59a6;_0x4d69f4['model']=_[_0x26d4('0x40')](db[_0x26d4('0x47')][_0x26d4('0x27')]);_0x4d69f4[_0x26d4('0x2a')]=_[_0x26d4('0x40')](_0x228f08[_0x26d4('0x2a')]);_0x4d69f4['filters']=_['intersection'](_0x4d69f4['model'],_0x4d69f4[_0x26d4('0x2a')]);_0x4e2d99[_0x26d4('0x2c')]=_[_0x26d4('0x2d')](_0x4d69f4[_0x26d4('0x2e')],qs[_0x26d4('0x2f')](_0x228f08['query'][_0x26d4('0x2f')]));_0x4e2d99[_0x26d4('0x2c')]=_0x4e2d99[_0x26d4('0x2c')]['length']?_0x4e2d99[_0x26d4('0x2c')]:_0x4d69f4['model'];_0x4e2d99[_0x26d4('0x33')]=qs[_0x26d4('0x34')](_0x228f08[_0x26d4('0x2a')][_0x26d4('0x34')]);_0x4e2d99['where']=qs[_0x26d4('0x2b')](_[_0x26d4('0x35')](_0x228f08[_0x26d4('0x2a')],_0x4d69f4[_0x26d4('0x2b')]));if(_0x228f08['query'][_0x26d4('0x36')]){_0x4e2d99[_0x26d4('0x37')]=_['merge'](_0x4e2d99[_0x26d4('0x37')],{'$or':_[_0x26d4('0x25')](_0x4e2d99[_0x26d4('0x2c')],function(_0x55e2b4){var _0x4eedc5={};_0x4eedc5[_0x55e2b4]={'$like':'%'+_0x228f08[_0x26d4('0x2a')][_0x26d4('0x36')]+'%'};return _0x4eedc5;})});}_0x4e2d99=_[_0x26d4('0x39')]({},_0x4e2d99,_0x228f08[_0x26d4('0x3a')]);return _0x40ced1[_0x26d4('0x48')](_0x4e2d99);}})[_0x26d4('0x20')](function(_0x380c53){if(_0x380c53){_0x2de588=_0x380c53[_0x26d4('0x30')];if(!_0x228f08[_0x26d4('0x2a')][_0x26d4('0x31')](_0x26d4('0x32'))){_0x4e2d99[_0x26d4('0x1b')]=qs[_0x26d4('0x1b')](_0x228f08['query'][_0x26d4('0x1b')]);_0x4e2d99['offset']=qs[_0x26d4('0x19')](_0x228f08['query'][_0x26d4('0x19')]);}return _0x40ced1[_0x26d4('0x48')](_0x4e2d99);}})['then'](function(_0x2dc70e){if(_0x2dc70e){return _0x2dc70e?{'count':_0x2de588,'rows':_0x2dc70e}:null;}})[_0x26d4('0x20')](respondWithResult(_0xa9b143,null))[_0x26d4('0x3e')](handleError(_0xa9b143,null));};exports[_0x26d4('0x49')]=function(_0x13a84a,_0xced7f6,_0x5dd4aa){var _0x16fce8={};var _0x291fee={};var _0x4df6d1;var _0x470f8c;return db[_0x26d4('0x26')]['findOne']({'where':{'id':_0x13a84a[_0x26d4('0x45')]['id']}})[_0x26d4('0x20')](handleEntityNotFound(_0xced7f6,null))[_0x26d4('0x20')](function(_0x29f706){if(_0x29f706){_0x4df6d1=_0x29f706;_0x291fee['model']=_[_0x26d4('0x40')](db['ZendeskField'][_0x26d4('0x27')]);_0x291fee[_0x26d4('0x2a')]=_[_0x26d4('0x40')](_0x13a84a[_0x26d4('0x2a')]);_0x291fee[_0x26d4('0x2b')]=_[_0x26d4('0x2d')](_0x291fee['model'],_0x291fee[_0x26d4('0x2a')]);_0x16fce8[_0x26d4('0x2c')]=_[_0x26d4('0x2d')](_0x291fee['model'],qs[_0x26d4('0x2f')](_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x2f')]));_0x16fce8[_0x26d4('0x2c')]=_0x16fce8[_0x26d4('0x2c')][_0x26d4('0x30')]?_0x16fce8[_0x26d4('0x2c')]:_0x291fee['model'];_0x16fce8[_0x26d4('0x33')]=qs[_0x26d4('0x34')](_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x34')]);_0x16fce8[_0x26d4('0x37')]=qs[_0x26d4('0x2b')](_['pick'](_0x13a84a['query'],_0x291fee[_0x26d4('0x2b')]));if(_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x36')]){_0x16fce8[_0x26d4('0x37')]=_[_0x26d4('0x39')](_0x16fce8[_0x26d4('0x37')],{'$or':_[_0x26d4('0x25')](_0x16fce8[_0x26d4('0x2c')],function(_0x450c0d){var _0x2ff078={};_0x2ff078[_0x450c0d]={'$like':'%'+_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x36')]+'%'};return _0x2ff078;})});}_0x16fce8=_[_0x26d4('0x39')]({},_0x16fce8,_0x13a84a[_0x26d4('0x3a')]);return _0x4df6d1[_0x26d4('0x49')](_0x16fce8);}})[_0x26d4('0x20')](function(_0x42e06c){if(_0x42e06c){_0x470f8c=_0x42e06c[_0x26d4('0x30')];if(!_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x31')](_0x26d4('0x32'))){_0x16fce8[_0x26d4('0x1b')]=qs[_0x26d4('0x1b')](_0x13a84a['query'][_0x26d4('0x1b')]);_0x16fce8['offset']=qs[_0x26d4('0x19')](_0x13a84a[_0x26d4('0x2a')][_0x26d4('0x19')]);}return _0x4df6d1[_0x26d4('0x49')](_0x16fce8);}})[_0x26d4('0x20')](function(_0x12a597){if(_0x12a597){return _0x12a597?{'count':_0x470f8c,'rows':_0x12a597}:null;}})[_0x26d4('0x20')](respondWithResult(_0xced7f6,null))[_0x26d4('0x3e')](handleError(_0xced7f6,null));};exports['getDescriptions']=function(_0x6ff44e,_0x5a7c63,_0x19e544){var _0x1ad0ba={};var _0xe061fd={};var _0x3669ec;var _0x30dd8b;return db[_0x26d4('0x26')][_0x26d4('0x46')]({'where':{'id':_0x6ff44e[_0x26d4('0x45')]['id']}})[_0x26d4('0x20')](handleEntityNotFound(_0x5a7c63,null))[_0x26d4('0x20')](function(_0x15552b){if(_0x15552b){_0x3669ec=_0x15552b;_0xe061fd[_0x26d4('0x2e')]=_[_0x26d4('0x40')](db['ZendeskField'][_0x26d4('0x27')]);_0xe061fd[_0x26d4('0x2a')]=_['keys'](_0x6ff44e[_0x26d4('0x2a')]);_0xe061fd[_0x26d4('0x2b')]=_[_0x26d4('0x2d')](_0xe061fd[_0x26d4('0x2e')],_0xe061fd[_0x26d4('0x2a')]);_0x1ad0ba[_0x26d4('0x2c')]=_[_0x26d4('0x2d')](_0xe061fd[_0x26d4('0x2e')],qs['fields'](_0x6ff44e[_0x26d4('0x2a')]['fields']));_0x1ad0ba[_0x26d4('0x2c')]=_0x1ad0ba[_0x26d4('0x2c')]['length']?_0x1ad0ba[_0x26d4('0x2c')]:_0xe061fd['model'];_0x1ad0ba[_0x26d4('0x33')]=qs[_0x26d4('0x34')](_0x6ff44e[_0x26d4('0x2a')][_0x26d4('0x34')]);_0x1ad0ba[_0x26d4('0x37')]=qs[_0x26d4('0x2b')](_[_0x26d4('0x35')](_0x6ff44e[_0x26d4('0x2a')],_0xe061fd[_0x26d4('0x2b')]));if(_0x6ff44e[_0x26d4('0x2a')]['filter']){_0x1ad0ba[_0x26d4('0x37')]=_[_0x26d4('0x39')](_0x1ad0ba['where'],{'$or':_[_0x26d4('0x25')](_0x1ad0ba[_0x26d4('0x2c')],function(_0x12456e){var _0x785bc9={};_0x785bc9[_0x12456e]={'$like':'%'+_0x6ff44e[_0x26d4('0x2a')][_0x26d4('0x36')]+'%'};return _0x785bc9;})});}_0x1ad0ba=_[_0x26d4('0x39')]({},_0x1ad0ba,_0x6ff44e[_0x26d4('0x3a')]);return _0x3669ec[_0x26d4('0x4a')](_0x1ad0ba);}})[_0x26d4('0x20')](function(_0x3cf3e8){if(_0x3cf3e8){_0x30dd8b=_0x3cf3e8['length'];if(!_0x6ff44e[_0x26d4('0x2a')][_0x26d4('0x31')](_0x26d4('0x32'))){_0x1ad0ba[_0x26d4('0x1b')]=qs[_0x26d4('0x1b')](_0x6ff44e[_0x26d4('0x2a')]['limit']);_0x1ad0ba[_0x26d4('0x19')]=qs[_0x26d4('0x19')](_0x6ff44e['query']['offset']);}return _0x3669ec[_0x26d4('0x4a')](_0x1ad0ba);}})[_0x26d4('0x20')](function(_0x37d6d9){if(_0x37d6d9){return _0x37d6d9?{'count':_0x30dd8b,'rows':_0x37d6d9}:null;}})[_0x26d4('0x20')](respondWithResult(_0x5a7c63,null))[_0x26d4('0x3e')](handleError(_0x5a7c63,null));};exports[_0x26d4('0x4b')]=function(_0x321aa,_0x5370aa,_0x3060d4){var _0x4189e7={};var _0x1f17e9={};var _0x5b908d;var _0x351700;return db[_0x26d4('0x26')][_0x26d4('0x46')]({'where':{'id':_0x321aa['params']['id']}})[_0x26d4('0x20')](handleEntityNotFound(_0x5370aa,null))['then'](function(_0x4be935){if(_0x4be935){_0x5b908d=_0x4be935;_0x1f17e9[_0x26d4('0x2e')]=_[_0x26d4('0x40')](db[_0x26d4('0x4c')][_0x26d4('0x27')]);_0x1f17e9['query']=_['keys'](_0x321aa[_0x26d4('0x2a')]);_0x1f17e9[_0x26d4('0x2b')]=_[_0x26d4('0x2d')](_0x1f17e9[_0x26d4('0x2e')],_0x1f17e9['query']);_0x4189e7[_0x26d4('0x2c')]=_['intersection'](_0x1f17e9['model'],qs[_0x26d4('0x2f')](_0x321aa[_0x26d4('0x2a')][_0x26d4('0x2f')]));_0x4189e7[_0x26d4('0x2c')]=_0x4189e7[_0x26d4('0x2c')][_0x26d4('0x30')]?_0x4189e7[_0x26d4('0x2c')]:_0x1f17e9[_0x26d4('0x2e')];_0x4189e7[_0x26d4('0x33')]=qs[_0x26d4('0x34')](_0x321aa['query']['sort']);_0x4189e7['where']=qs[_0x26d4('0x2b')](_['pick'](_0x321aa[_0x26d4('0x2a')],_0x1f17e9[_0x26d4('0x2b')]));if(_0x321aa[_0x26d4('0x2a')][_0x26d4('0x36')]){_0x4189e7[_0x26d4('0x37')]=_[_0x26d4('0x39')](_0x4189e7[_0x26d4('0x37')],{'$or':_[_0x26d4('0x25')](_0x4189e7[_0x26d4('0x2c')],function(_0x309412){var _0x44c84d={};_0x44c84d[_0x309412]={'$like':'%'+_0x321aa[_0x26d4('0x2a')][_0x26d4('0x36')]+'%'};return _0x44c84d;})});}_0x4189e7=_[_0x26d4('0x39')]({},_0x4189e7,_0x321aa[_0x26d4('0x3a')]);return _0x5b908d[_0x26d4('0x4b')](_0x4189e7);}})[_0x26d4('0x20')](function(_0x1ad302){if(_0x1ad302){_0x351700=_0x1ad302['length'];if(!_0x321aa['query']['hasOwnProperty'](_0x26d4('0x32'))){_0x4189e7[_0x26d4('0x1b')]=qs[_0x26d4('0x1b')](_0x321aa['query'][_0x26d4('0x1b')]);_0x4189e7[_0x26d4('0x19')]=qs[_0x26d4('0x19')](_0x321aa[_0x26d4('0x2a')][_0x26d4('0x19')]);}return _0x5b908d[_0x26d4('0x4b')](_0x4189e7);}})[_0x26d4('0x20')](function(_0x3c8ff5){if(_0x3c8ff5){return _0x3c8ff5?{'count':_0x351700,'rows':_0x3c8ff5}:null;}})[_0x26d4('0x20')](respondWithResult(_0x5370aa,null))[_0x26d4('0x3e')](handleError(_0x5370aa,null));};exports[_0x26d4('0x4d')]=function(_0x47e311,_0xce266b,_0x188bd6){if(_0x47e311[_0x26d4('0x43')]['id']){delete _0x47e311[_0x26d4('0x43')]['id'];}return db[_0x26d4('0x26')][_0x26d4('0x46')]({'where':{'id':_0x47e311[_0x26d4('0x45')]['id']}})['then'](handleEntityNotFound(_0xce266b,null))[_0x26d4('0x20')](function(_0x2fb268){if(_0x2fb268){return _0x2fb268['setTags'](_0x47e311[_0x26d4('0x43')][_0x26d4('0x4e')]||[]);}return null;})[_0x26d4('0x20')](respondWithResult(_0xce266b,null))[_0x26d4('0x3e')](handleError(_0xce266b,null));}; \ No newline at end of file +var _0x1d93=['findOne','ZendeskField','pick','merge','getFields','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','destroy'];(function(_0x3c0c9e,_0x3ecdee){var _0x5ba5fe=function(_0x1f4a60){while(--_0x1f4a60){_0x3c0c9e['push'](_0x3c0c9e['shift']());}};_0x5ba5fe(++_0x3ecdee);}(_0x1d93,0x10b));var _0x31d9=function(_0x38fcbb,_0xd2b478){_0x38fcbb=_0x38fcbb-0x0;var _0x4bbb75=_0x1d93[_0x38fcbb];return _0x4bbb75;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31d9('0x0'));var zipdir=require(_0x31d9('0x1'));var jsonpatch=require(_0x31d9('0x2'));var rp=require(_0x31d9('0x3'));var moment=require(_0x31d9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31d9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x31d9('0x6'));var fs=require('fs');var fs_extra=require(_0x31d9('0x7'));var _=require(_0x31d9('0x8'));var squel=require('squel');var crypto=require(_0x31d9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x31d9('0xa'));var toCsv=require(_0x31d9('0xb'));var querystring=require('querystring');var Papa=require(_0x31d9('0xc'));var Redis=require('ioredis');var authService=require(_0x31d9('0xd'));var qs=require(_0x31d9('0xe'));var as=require(_0x31d9('0xf'));var hardwareService=require(_0x31d9('0x10'));var logger=require(_0x31d9('0x11'))(_0x31d9('0x12'));var utils=require(_0x31d9('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x31d9('0x14'))['db'];function respondWithStatusCode(_0x241596,_0x3e89ad){_0x3e89ad=_0x3e89ad||0xcc;return function(_0x18b3a2){if(_0x18b3a2){return _0x241596[_0x31d9('0x15')](_0x3e89ad);}return _0x241596[_0x31d9('0x16')](_0x3e89ad)[_0x31d9('0x17')]();};}function respondWithResult(_0x57bcbf,_0x4887e3){_0x4887e3=_0x4887e3||0xc8;return function(_0x3d2a43){if(_0x3d2a43){return _0x57bcbf[_0x31d9('0x16')](_0x4887e3)[_0x31d9('0x18')](_0x3d2a43);}};}function respondWithFilteredResult(_0x2c8562,_0x1bae1d){return function(_0x5c06e9){if(_0x5c06e9){var _0x5e6881=typeof _0x1bae1d[_0x31d9('0x19')]===_0x31d9('0x1a')&&typeof _0x1bae1d[_0x31d9('0x1b')]===_0x31d9('0x1a');var _0xcb9642=_0x5c06e9[_0x31d9('0x1c')];var _0x45457b=_0x5e6881?0x0:_0x1bae1d[_0x31d9('0x19')];var _0x3d8db6=_0x5e6881?_0x5c06e9[_0x31d9('0x1c')]:_0x1bae1d[_0x31d9('0x19')]+_0x1bae1d['limit'];var _0x107bf6;if(_0x3d8db6>=_0xcb9642){_0x3d8db6=_0xcb9642;_0x107bf6=0xc8;}else{_0x107bf6=0xce;}_0x2c8562['status'](_0x107bf6);return _0x2c8562[_0x31d9('0x1d')](_0x31d9('0x1e'),_0x45457b+'-'+_0x3d8db6+'/'+_0xcb9642)['json'](_0x5c06e9);}return null;};}function patchUpdates(_0x3d7c21){return function(_0x121fac){try{jsonpatch[_0x31d9('0x1f')](_0x121fac,_0x3d7c21,!![]);}catch(_0x5d0913){return BPromise[_0x31d9('0x20')](_0x5d0913);}return _0x121fac[_0x31d9('0x21')]();};}function saveUpdates(_0x545c21,_0x578565){return function(_0x480c3d){if(_0x480c3d){return _0x480c3d['update'](_0x545c21)[_0x31d9('0x22')](function(_0x38ea80){return _0x38ea80;});}return null;};}function removeEntity(_0x5b192e,_0x9ffbad){return function(_0x2dd0d1){if(_0x2dd0d1){return _0x2dd0d1['destroy']()[_0x31d9('0x22')](function(){_0x5b192e[_0x31d9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392c79,_0x37a2bb){return function(_0xec5056){if(!_0xec5056){_0x392c79[_0x31d9('0x15')](0x194);}return _0xec5056;};}function handleError(_0x328a34,_0x5646c1){_0x5646c1=_0x5646c1||0x1f4;return function(_0xa98685){logger[_0x31d9('0x23')](_0xa98685[_0x31d9('0x24')]);if(_0xa98685['name']){delete _0xa98685[_0x31d9('0x25')];}_0x328a34[_0x31d9('0x16')](_0x5646c1)[_0x31d9('0x26')](_0xa98685);};}exports[_0x31d9('0x27')]=function(_0x513444,_0x38f978){var _0x1a497b={},_0x57c161={},_0xcc466e={'count':0x0,'rows':[]};var _0x4f798f=_[_0x31d9('0x28')](db[_0x31d9('0x29')]['rawAttributes'],function(_0x5d2a7f){return{'name':_0x5d2a7f[_0x31d9('0x2a')],'type':_0x5d2a7f[_0x31d9('0x2b')][_0x31d9('0x2c')]};});_0x57c161[_0x31d9('0x2d')]=_[_0x31d9('0x28')](_0x4f798f,'name');_0x57c161[_0x31d9('0x2e')]=_[_0x31d9('0x2f')](_0x513444[_0x31d9('0x2e')]);_0x57c161[_0x31d9('0x30')]=_[_0x31d9('0x31')](_0x57c161[_0x31d9('0x2d')],_0x57c161[_0x31d9('0x2e')]);_0x1a497b[_0x31d9('0x32')]=_['intersection'](_0x57c161[_0x31d9('0x2d')],qs[_0x31d9('0x33')](_0x513444[_0x31d9('0x2e')][_0x31d9('0x33')]));_0x1a497b['attributes']=_0x1a497b[_0x31d9('0x32')][_0x31d9('0x34')]?_0x1a497b[_0x31d9('0x32')]:_0x57c161[_0x31d9('0x2d')];if(!_0x513444[_0x31d9('0x2e')]['hasOwnProperty'](_0x31d9('0x35'))){_0x1a497b['limit']=qs[_0x31d9('0x1b')](_0x513444[_0x31d9('0x2e')][_0x31d9('0x1b')]);_0x1a497b[_0x31d9('0x19')]=qs[_0x31d9('0x19')](_0x513444['query']['offset']);}_0x1a497b[_0x31d9('0x36')]=qs[_0x31d9('0x37')](_0x513444[_0x31d9('0x2e')][_0x31d9('0x37')]);_0x1a497b[_0x31d9('0x38')]=qs[_0x31d9('0x30')](_['pick'](_0x513444[_0x31d9('0x2e')],_0x57c161[_0x31d9('0x30')]),_0x4f798f);if(_0x513444[_0x31d9('0x2e')][_0x31d9('0x39')]){_0x1a497b[_0x31d9('0x38')]=_['merge'](_0x1a497b[_0x31d9('0x38')],{'$or':_[_0x31d9('0x28')](_0x4f798f,function(_0x2ea2e1){if(_0x2ea2e1[_0x31d9('0x2b')]!==_0x31d9('0x3a')){var _0x502b00={};_0x502b00[_0x2ea2e1[_0x31d9('0x25')]]={'$like':'%'+_0x513444['query'][_0x31d9('0x39')]+'%'};return _0x502b00;}})});}_0x1a497b=_['merge']({},_0x1a497b,_0x513444[_0x31d9('0x3b')]);var _0xc8b424={'where':_0x1a497b[_0x31d9('0x38')]};return db['ZendeskConfiguration'][_0x31d9('0x1c')](_0xc8b424)['then'](function(_0x5cbd03){_0xcc466e['count']=_0x5cbd03;if(_0x513444[_0x31d9('0x2e')][_0x31d9('0x3c')]){_0x1a497b[_0x31d9('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x31d9('0x3e')](_0x1a497b);})[_0x31d9('0x22')](function(_0x5c1e70){_0xcc466e[_0x31d9('0x3f')]=_0x5c1e70;return _0xcc466e;})[_0x31d9('0x22')](respondWithFilteredResult(_0x38f978,_0x1a497b))['catch'](handleError(_0x38f978,null));};exports[_0x31d9('0x40')]=function(_0x3968f8,_0x4c6c6c){var _0x9d6a96={'raw':![],'where':{'id':_0x3968f8[_0x31d9('0x41')]['id']}},_0x54fd7d={};_0x54fd7d['model']=_[_0x31d9('0x2f')](db['ZendeskConfiguration'][_0x31d9('0x42')]);_0x54fd7d[_0x31d9('0x2e')]=_[_0x31d9('0x2f')](_0x3968f8[_0x31d9('0x2e')]);_0x54fd7d['filters']=_[_0x31d9('0x31')](_0x54fd7d[_0x31d9('0x2d')],_0x54fd7d[_0x31d9('0x2e')]);_0x9d6a96[_0x31d9('0x32')]=_[_0x31d9('0x31')](_0x54fd7d[_0x31d9('0x2d')],qs['fields'](_0x3968f8[_0x31d9('0x2e')][_0x31d9('0x33')]));_0x9d6a96['attributes']=_0x9d6a96[_0x31d9('0x32')][_0x31d9('0x34')]?_0x9d6a96['attributes']:_0x54fd7d[_0x31d9('0x2d')];if(_0x3968f8[_0x31d9('0x2e')]['includeAll']){_0x9d6a96[_0x31d9('0x3d')]=[{'all':!![]}];}_0x9d6a96=_['merge']({},_0x9d6a96,_0x3968f8[_0x31d9('0x3b')]);return db[_0x31d9('0x29')][_0x31d9('0x43')](_0x9d6a96)[_0x31d9('0x22')](handleEntityNotFound(_0x4c6c6c,null))['then'](respondWithResult(_0x4c6c6c,null))[_0x31d9('0x44')](handleError(_0x4c6c6c,null));};exports[_0x31d9('0x45')]=function(_0x4d4fdc,_0x470c85){return db[_0x31d9('0x29')][_0x31d9('0x45')](_0x4d4fdc[_0x31d9('0x46')],{})[_0x31d9('0x22')](respondWithResult(_0x470c85,0xc9))[_0x31d9('0x44')](handleError(_0x470c85,null));};exports[_0x31d9('0x47')]=function(_0x518b75,_0x54dbfa){if(_0x518b75[_0x31d9('0x46')]['id']){delete _0x518b75[_0x31d9('0x46')]['id'];}return db[_0x31d9('0x29')]['find']({'where':{'id':_0x518b75[_0x31d9('0x41')]['id']}})[_0x31d9('0x22')](handleEntityNotFound(_0x54dbfa,null))[_0x31d9('0x22')](saveUpdates(_0x518b75[_0x31d9('0x46')],null))[_0x31d9('0x22')](respondWithResult(_0x54dbfa,null))[_0x31d9('0x44')](handleError(_0x54dbfa,null));};exports[_0x31d9('0x48')]=function(_0x33bcbf,_0x1a4fab){return db[_0x31d9('0x29')][_0x31d9('0x43')]({'where':{'id':_0x33bcbf['params']['id']}})['then'](handleEntityNotFound(_0x1a4fab,null))[_0x31d9('0x22')](removeEntity(_0x1a4fab,null))[_0x31d9('0x44')](handleError(_0x1a4fab,null));};exports['getFields']=function(_0x240a49,_0x512c6f,_0x2491c0){var _0x426c05={};var _0x8c16b7={};var _0x52a6f5;var _0x30b5c7;return db[_0x31d9('0x29')][_0x31d9('0x49')]({'where':{'id':_0x240a49['params']['id']}})[_0x31d9('0x22')](handleEntityNotFound(_0x512c6f,null))[_0x31d9('0x22')](function(_0x496669){if(_0x496669){_0x52a6f5=_0x496669;_0x8c16b7['model']=_[_0x31d9('0x2f')](db[_0x31d9('0x4a')][_0x31d9('0x42')]);_0x8c16b7['query']=_['keys'](_0x240a49[_0x31d9('0x2e')]);_0x8c16b7[_0x31d9('0x30')]=_[_0x31d9('0x31')](_0x8c16b7['model'],_0x8c16b7[_0x31d9('0x2e')]);_0x426c05[_0x31d9('0x32')]=_['intersection'](_0x8c16b7[_0x31d9('0x2d')],qs[_0x31d9('0x33')](_0x240a49['query']['fields']));_0x426c05[_0x31d9('0x32')]=_0x426c05[_0x31d9('0x32')][_0x31d9('0x34')]?_0x426c05[_0x31d9('0x32')]:_0x8c16b7['model'];_0x426c05[_0x31d9('0x36')]=qs[_0x31d9('0x37')](_0x240a49[_0x31d9('0x2e')]['sort']);_0x426c05[_0x31d9('0x38')]=qs[_0x31d9('0x30')](_[_0x31d9('0x4b')](_0x240a49['query'],_0x8c16b7[_0x31d9('0x30')]));if(_0x240a49[_0x31d9('0x2e')]['filter']){_0x426c05[_0x31d9('0x38')]=_['merge'](_0x426c05[_0x31d9('0x38')],{'$or':_[_0x31d9('0x28')](_0x426c05[_0x31d9('0x32')],function(_0x1f69bf){var _0x2ca8f9={};_0x2ca8f9[_0x1f69bf]={'$like':'%'+_0x240a49[_0x31d9('0x2e')][_0x31d9('0x39')]+'%'};return _0x2ca8f9;})});}_0x426c05=_[_0x31d9('0x4c')]({},_0x426c05,_0x240a49[_0x31d9('0x3b')]);return _0x52a6f5['getFields'](_0x426c05);}})[_0x31d9('0x22')](function(_0x5457b1){if(_0x5457b1){_0x30b5c7=_0x5457b1[_0x31d9('0x34')];if(!_0x240a49[_0x31d9('0x2e')]['hasOwnProperty'](_0x31d9('0x35'))){_0x426c05[_0x31d9('0x1b')]=qs[_0x31d9('0x1b')](_0x240a49[_0x31d9('0x2e')][_0x31d9('0x1b')]);_0x426c05[_0x31d9('0x19')]=qs['offset'](_0x240a49[_0x31d9('0x2e')]['offset']);}return _0x52a6f5[_0x31d9('0x4d')](_0x426c05);}})['then'](function(_0x496a29){if(_0x496a29){return _0x496a29?{'count':_0x30b5c7,'rows':_0x496a29}:null;}})[_0x31d9('0x22')](respondWithResult(_0x512c6f,null))[_0x31d9('0x44')](handleError(_0x512c6f,null));};exports[_0x31d9('0x4e')]=function(_0x396925,_0x40b819,_0x19fafa){var _0x6dc106={};var _0x44a487={};var _0x38c607;var _0x547985;return db['ZendeskConfiguration'][_0x31d9('0x49')]({'where':{'id':_0x396925[_0x31d9('0x41')]['id']}})[_0x31d9('0x22')](handleEntityNotFound(_0x40b819,null))[_0x31d9('0x22')](function(_0x5b802b){if(_0x5b802b){_0x38c607=_0x5b802b;_0x44a487[_0x31d9('0x2d')]=_['keys'](db[_0x31d9('0x4a')][_0x31d9('0x42')]);_0x44a487['query']=_[_0x31d9('0x2f')](_0x396925[_0x31d9('0x2e')]);_0x44a487[_0x31d9('0x30')]=_[_0x31d9('0x31')](_0x44a487[_0x31d9('0x2d')],_0x44a487['query']);_0x6dc106[_0x31d9('0x32')]=_[_0x31d9('0x31')](_0x44a487[_0x31d9('0x2d')],qs[_0x31d9('0x33')](_0x396925['query'][_0x31d9('0x33')]));_0x6dc106[_0x31d9('0x32')]=_0x6dc106['attributes'][_0x31d9('0x34')]?_0x6dc106[_0x31d9('0x32')]:_0x44a487[_0x31d9('0x2d')];_0x6dc106[_0x31d9('0x36')]=qs[_0x31d9('0x37')](_0x396925[_0x31d9('0x2e')][_0x31d9('0x37')]);_0x6dc106[_0x31d9('0x38')]=qs[_0x31d9('0x30')](_[_0x31d9('0x4b')](_0x396925[_0x31d9('0x2e')],_0x44a487['filters']));if(_0x396925[_0x31d9('0x2e')]['filter']){_0x6dc106[_0x31d9('0x38')]=_[_0x31d9('0x4c')](_0x6dc106[_0x31d9('0x38')],{'$or':_[_0x31d9('0x28')](_0x6dc106[_0x31d9('0x32')],function(_0x329552){var _0x196645={};_0x196645[_0x329552]={'$like':'%'+_0x396925[_0x31d9('0x2e')][_0x31d9('0x39')]+'%'};return _0x196645;})});}_0x6dc106=_[_0x31d9('0x4c')]({},_0x6dc106,_0x396925[_0x31d9('0x3b')]);return _0x38c607[_0x31d9('0x4e')](_0x6dc106);}})[_0x31d9('0x22')](function(_0x3a8d3c){if(_0x3a8d3c){_0x547985=_0x3a8d3c[_0x31d9('0x34')];if(!_0x396925[_0x31d9('0x2e')][_0x31d9('0x4f')](_0x31d9('0x35'))){_0x6dc106[_0x31d9('0x1b')]=qs[_0x31d9('0x1b')](_0x396925[_0x31d9('0x2e')]['limit']);_0x6dc106[_0x31d9('0x19')]=qs[_0x31d9('0x19')](_0x396925[_0x31d9('0x2e')][_0x31d9('0x19')]);}return _0x38c607[_0x31d9('0x4e')](_0x6dc106);}})[_0x31d9('0x22')](function(_0x49744f){if(_0x49744f){return _0x49744f?{'count':_0x547985,'rows':_0x49744f}:null;}})[_0x31d9('0x22')](respondWithResult(_0x40b819,null))[_0x31d9('0x44')](handleError(_0x40b819,null));};exports['getDescriptions']=function(_0x3f3646,_0x146cc1,_0x54813a){var _0x333f15={};var _0x460eaa={};var _0x4c56bf;var _0x3e3693;return db['ZendeskConfiguration'][_0x31d9('0x49')]({'where':{'id':_0x3f3646[_0x31d9('0x41')]['id']}})['then'](handleEntityNotFound(_0x146cc1,null))[_0x31d9('0x22')](function(_0x3051bf){if(_0x3051bf){_0x4c56bf=_0x3051bf;_0x460eaa['model']=_[_0x31d9('0x2f')](db[_0x31d9('0x4a')]['rawAttributes']);_0x460eaa['query']=_[_0x31d9('0x2f')](_0x3f3646[_0x31d9('0x2e')]);_0x460eaa['filters']=_[_0x31d9('0x31')](_0x460eaa['model'],_0x460eaa[_0x31d9('0x2e')]);_0x333f15[_0x31d9('0x32')]=_['intersection'](_0x460eaa['model'],qs['fields'](_0x3f3646[_0x31d9('0x2e')][_0x31d9('0x33')]));_0x333f15[_0x31d9('0x32')]=_0x333f15[_0x31d9('0x32')][_0x31d9('0x34')]?_0x333f15[_0x31d9('0x32')]:_0x460eaa[_0x31d9('0x2d')];_0x333f15['order']=qs[_0x31d9('0x37')](_0x3f3646[_0x31d9('0x2e')][_0x31d9('0x37')]);_0x333f15[_0x31d9('0x38')]=qs[_0x31d9('0x30')](_[_0x31d9('0x4b')](_0x3f3646[_0x31d9('0x2e')],_0x460eaa[_0x31d9('0x30')]));if(_0x3f3646['query']['filter']){_0x333f15[_0x31d9('0x38')]=_[_0x31d9('0x4c')](_0x333f15['where'],{'$or':_[_0x31d9('0x28')](_0x333f15[_0x31d9('0x32')],function(_0x26f4b9){var _0x2ac15e={};_0x2ac15e[_0x26f4b9]={'$like':'%'+_0x3f3646[_0x31d9('0x2e')]['filter']+'%'};return _0x2ac15e;})});}_0x333f15=_[_0x31d9('0x4c')]({},_0x333f15,_0x3f3646[_0x31d9('0x3b')]);return _0x4c56bf[_0x31d9('0x50')](_0x333f15);}})['then'](function(_0x3432b2){if(_0x3432b2){_0x3e3693=_0x3432b2[_0x31d9('0x34')];if(!_0x3f3646[_0x31d9('0x2e')][_0x31d9('0x4f')](_0x31d9('0x35'))){_0x333f15[_0x31d9('0x1b')]=qs[_0x31d9('0x1b')](_0x3f3646['query']['limit']);_0x333f15[_0x31d9('0x19')]=qs[_0x31d9('0x19')](_0x3f3646[_0x31d9('0x2e')][_0x31d9('0x19')]);}return _0x4c56bf['getDescriptions'](_0x333f15);}})[_0x31d9('0x22')](function(_0x46fae3){if(_0x46fae3){return _0x46fae3?{'count':_0x3e3693,'rows':_0x46fae3}:null;}})['then'](respondWithResult(_0x146cc1,null))[_0x31d9('0x44')](handleError(_0x146cc1,null));};exports[_0x31d9('0x51')]=function(_0x3526a9,_0x161b81,_0x33f4c4){var _0x3c2b6b={};var _0x39a14b={};var _0x672d6c;var _0xfbc451;return db[_0x31d9('0x29')][_0x31d9('0x49')]({'where':{'id':_0x3526a9[_0x31d9('0x41')]['id']}})[_0x31d9('0x22')](handleEntityNotFound(_0x161b81,null))[_0x31d9('0x22')](function(_0x2bd964){if(_0x2bd964){_0x672d6c=_0x2bd964;_0x39a14b[_0x31d9('0x2d')]=_[_0x31d9('0x2f')](db[_0x31d9('0x52')][_0x31d9('0x42')]);_0x39a14b[_0x31d9('0x2e')]=_['keys'](_0x3526a9['query']);_0x39a14b[_0x31d9('0x30')]=_[_0x31d9('0x31')](_0x39a14b[_0x31d9('0x2d')],_0x39a14b[_0x31d9('0x2e')]);_0x3c2b6b['attributes']=_['intersection'](_0x39a14b[_0x31d9('0x2d')],qs[_0x31d9('0x33')](_0x3526a9['query']['fields']));_0x3c2b6b['attributes']=_0x3c2b6b[_0x31d9('0x32')]['length']?_0x3c2b6b['attributes']:_0x39a14b[_0x31d9('0x2d')];_0x3c2b6b[_0x31d9('0x36')]=qs[_0x31d9('0x37')](_0x3526a9[_0x31d9('0x2e')]['sort']);_0x3c2b6b[_0x31d9('0x38')]=qs[_0x31d9('0x30')](_[_0x31d9('0x4b')](_0x3526a9[_0x31d9('0x2e')],_0x39a14b[_0x31d9('0x30')]));if(_0x3526a9['query'][_0x31d9('0x39')]){_0x3c2b6b[_0x31d9('0x38')]=_['merge'](_0x3c2b6b[_0x31d9('0x38')],{'$or':_[_0x31d9('0x28')](_0x3c2b6b['attributes'],function(_0x4c5ac5){var _0x28f5fe={};_0x28f5fe[_0x4c5ac5]={'$like':'%'+_0x3526a9[_0x31d9('0x2e')][_0x31d9('0x39')]+'%'};return _0x28f5fe;})});}_0x3c2b6b=_['merge']({},_0x3c2b6b,_0x3526a9[_0x31d9('0x3b')]);return _0x672d6c[_0x31d9('0x51')](_0x3c2b6b);}})[_0x31d9('0x22')](function(_0x51927b){if(_0x51927b){_0xfbc451=_0x51927b[_0x31d9('0x34')];if(!_0x3526a9['query'][_0x31d9('0x4f')](_0x31d9('0x35'))){_0x3c2b6b['limit']=qs[_0x31d9('0x1b')](_0x3526a9[_0x31d9('0x2e')][_0x31d9('0x1b')]);_0x3c2b6b[_0x31d9('0x19')]=qs[_0x31d9('0x19')](_0x3526a9[_0x31d9('0x2e')]['offset']);}return _0x672d6c[_0x31d9('0x51')](_0x3c2b6b);}})[_0x31d9('0x22')](function(_0x4d3e19){if(_0x4d3e19){return _0x4d3e19?{'count':_0xfbc451,'rows':_0x4d3e19}:null;}})[_0x31d9('0x22')](respondWithResult(_0x161b81,null))['catch'](handleError(_0x161b81,null));};exports[_0x31d9('0x53')]=function(_0x1f1853,_0x731202,_0x2bafaa){if(_0x1f1853[_0x31d9('0x46')]['id']){delete _0x1f1853[_0x31d9('0x46')]['id'];}return db['ZendeskConfiguration'][_0x31d9('0x49')]({'where':{'id':_0x1f1853['params']['id']}})['then'](handleEntityNotFound(_0x731202,null))['then'](function(_0x143dde){if(_0x143dde){return _0x143dde[_0x31d9('0x53')](_0x1f1853[_0x31d9('0x46')][_0x31d9('0x54')]||[]);}return null;})[_0x31d9('0x22')](respondWithResult(_0x731202,null))[_0x31d9('0x44')](handleError(_0x731202,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index dee2ab2..8d5fdd0 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 _0x7916=['../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','ZendeskConfiguration','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7916,0x128));var _0x6791=function(_0x52e978,_0x49de10){_0x52e978=_0x52e978-0x0;var _0x4f6afc=_0x7916[_0x52e978];return _0x4f6afc;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var logger=require(_0x6791('0x1'))(_0x6791('0x2'));var moment=require('moment');var BPromise=require(_0x6791('0x3'));var rp=require(_0x6791('0x4'));var fs=require('fs');var path=require(_0x6791('0x5'));var rimraf=require(_0x6791('0x6'));var config=require('../../config/environment');var attributes=require(_0x6791('0x7'));module['exports']=function(_0x3ca328,_0x3277a8){return _0x3ca328['define'](_0x6791('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa478=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x1779d6,_0x1a79ec){var _0x358ade=function(_0x55f1cc){while(--_0x55f1cc){_0x1779d6['push'](_0x1779d6['shift']());}};_0x358ade(++_0x1a79ec);}(_0xa478,0x136));var _0x8a47=function(_0x5c814d,_0x4d81c7){_0x5c814d=_0x5c814d-0x0;var _0x89b71=_0xa478[_0x5c814d];return _0x89b71;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var logger=require(_0x8a47('0x2'))(_0x8a47('0x3'));var moment=require(_0x8a47('0x4'));var BPromise=require(_0x8a47('0x5'));var rp=require(_0x8a47('0x6'));var fs=require('fs');var path=require(_0x8a47('0x7'));var rimraf=require(_0x8a47('0x8'));var config=require(_0x8a47('0x9'));var attributes=require(_0x8a47('0xa'));module[_0x8a47('0xb')]=function(_0x50226a,_0x413787){return _0x50226a[_0x8a47('0xc')](_0x8a47('0xd'),attributes,{'tableName':_0x8a47('0xe'),'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 bd2b9eb..8648df2 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 _0xfead=['info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1a7090,_0x113b24){var _0x644b94=function(_0x1c4f75){while(--_0x1c4f75){_0x1a7090['push'](_0x1a7090['shift']());}};_0x644b94(++_0x113b24);}(_0xfead,0x159));var _0xdfea=function(_0x411e50,_0x4db852){_0x411e50=_0x411e50-0x0;var _0x2c9ec1=_0xfead[_0x411e50];return _0x2c9ec1;};'use strict';var _=require(_0xdfea('0x0'));var util=require('util');var moment=require(_0xdfea('0x1'));var BPromise=require(_0xdfea('0x2'));var rs=require(_0xdfea('0x3'));var fs=require('fs');var Redis=require(_0xdfea('0x4'));var db=require(_0xdfea('0x5'))['db'];var utils=require(_0xdfea('0x6'));var logger=require(_0xdfea('0x7'))(_0xdfea('0x8'));var config=require(_0xdfea('0x9'));var jayson=require(_0xdfea('0xa'));var client=jayson[_0xdfea('0xb')][_0xdfea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb3e48c,_0x4215b9,_0x394e3d){return new BPromise(function(_0x3c74c2,_0x57b4d7){return client[_0xdfea('0xd')](_0xb3e48c,_0x394e3d)[_0xdfea('0xe')](function(_0x15a22e){logger[_0xdfea('0xf')](_0xdfea('0x10'),_0x4215b9,_0xdfea('0x11'));logger[_0xdfea('0x12')](_0xdfea('0x13'),_0x4215b9,_0xdfea('0x11'),JSON[_0xdfea('0x14')](_0x15a22e));if(_0x15a22e[_0xdfea('0x15')]){if(_0x15a22e['error']['code']===0x1f4){logger['error'](_0xdfea('0x10'),_0x4215b9,_0x15a22e[_0xdfea('0x15')]['message']);return _0x57b4d7(_0x15a22e[_0xdfea('0x15')]['message']);}logger[_0xdfea('0x15')](_0xdfea('0x10'),_0x4215b9,_0x15a22e[_0xdfea('0x15')]['message']);return _0x3c74c2(_0x15a22e[_0xdfea('0x15')][_0xdfea('0x16')]);}else{logger[_0xdfea('0xf')](_0xdfea('0x10'),_0x4215b9,_0xdfea('0x11'));_0x3c74c2(_0x15a22e['result'][_0xdfea('0x16')]);}})[_0xdfea('0x17')](function(_0x44f84d){logger[_0xdfea('0x15')](_0xdfea('0x10'),_0x4215b9,_0x44f84d);_0x57b4d7(_0x44f84d);});});} \ No newline at end of file +var _0x8bed=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x2cf10c,_0x941fc7){var _0x38bd94=function(_0x452de6){while(--_0x452de6){_0x2cf10c['push'](_0x2cf10c['shift']());}};_0x38bd94(++_0x941fc7);}(_0x8bed,0x140));var _0xd8be=function(_0x39c4b6,_0x394a3b){_0x39c4b6=_0x39c4b6-0x0;var _0x2562ba=_0x8bed[_0x39c4b6];return _0x2562ba;};'use strict';var _=require(_0xd8be('0x0'));var util=require(_0xd8be('0x1'));var moment=require('moment');var BPromise=require(_0xd8be('0x2'));var rs=require(_0xd8be('0x3'));var fs=require('fs');var Redis=require(_0xd8be('0x4'));var db=require(_0xd8be('0x5'))['db'];var utils=require(_0xd8be('0x6'));var logger=require(_0xd8be('0x7'))(_0xd8be('0x8'));var config=require(_0xd8be('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd8be('0xa')][_0xd8be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26d082,_0x561b34,_0x4ebd30){return new BPromise(function(_0xe05dfd,_0x3e656b){return client['request'](_0x26d082,_0x4ebd30)[_0xd8be('0xc')](function(_0x14e5db){logger[_0xd8be('0xd')](_0xd8be('0xe'),_0x561b34,_0xd8be('0xf'));logger[_0xd8be('0x10')](_0xd8be('0x11'),_0x561b34,_0xd8be('0xf'),JSON[_0xd8be('0x12')](_0x14e5db));if(_0x14e5db[_0xd8be('0x13')]){if(_0x14e5db[_0xd8be('0x13')][_0xd8be('0x14')]===0x1f4){logger[_0xd8be('0x13')](_0xd8be('0xe'),_0x561b34,_0x14e5db['error'][_0xd8be('0x15')]);return _0x3e656b(_0x14e5db['error']['message']);}logger[_0xd8be('0x13')](_0xd8be('0xe'),_0x561b34,_0x14e5db[_0xd8be('0x13')][_0xd8be('0x15')]);return _0xe05dfd(_0x14e5db[_0xd8be('0x13')][_0xd8be('0x15')]);}else{logger[_0xd8be('0xd')](_0xd8be('0xe'),_0x561b34,_0xd8be('0xf'));_0xe05dfd(_0x14e5db[_0xd8be('0x16')][_0xd8be('0x15')]);}})['catch'](function(_0xcbcaad){logger[_0xd8be('0x13')](_0xd8be('0xe'),_0x561b34,_0xcbcaad);_0x3e656b(_0xcbcaad);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ef5ff73..721b0ad 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 _0x94ee=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','/:id','show','create','put','delete'];(function(_0x189e47,_0x4fa398){var _0x5c375b=function(_0x349e8c){while(--_0x349e8c){_0x189e47['push'](_0x189e47['shift']());}};_0x5c375b(++_0x4fa398);}(_0x94ee,0x1bb));var _0xe94e=function(_0x399b11,_0x33f5f5){_0x399b11=_0x399b11-0x0;var _0x1fc9a0=_0x94ee[_0x399b11];return _0x1fc9a0;};'use strict';var multer=require(_0xe94e('0x0'));var util=require(_0xe94e('0x1'));var path=require(_0xe94e('0x2'));var timeout=require(_0xe94e('0x3'));var express=require(_0xe94e('0x4'));var router=express[_0xe94e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe94e('0x6'));var interaction=require(_0xe94e('0x7'));var config=require('../../config/environment');var controller=require(_0xe94e('0x8'));router['get']('/',auth[_0xe94e('0x9')](),controller[_0xe94e('0xa')]);router['get'](_0xe94e('0xb'),auth[_0xe94e('0x9')](),controller[_0xe94e('0xc')]);router['post']('/',auth[_0xe94e('0x9')](),controller[_0xe94e('0xd')]);router[_0xe94e('0xe')](_0xe94e('0xb'),auth[_0xe94e('0x9')](),controller['update']);router[_0xe94e('0xf')](_0xe94e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe94e('0x10')]=router; \ No newline at end of file +var _0x3329=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','multer'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x3329,0x197));var _0x9332=function(_0x3233d9,_0x36572a){_0x3233d9=_0x3233d9-0x0;var _0x43ec92=_0x3329[_0x3233d9];return _0x43ec92;};'use strict';var multer=require(_0x9332('0x0'));var util=require(_0x9332('0x1'));var path=require(_0x9332('0x2'));var timeout=require('connect-timeout');var express=require(_0x9332('0x3'));var router=express[_0x9332('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9332('0x5'));var interaction=require(_0x9332('0x6'));var config=require('../../config/environment');var controller=require(_0x9332('0x7'));router[_0x9332('0x8')]('/',auth[_0x9332('0x9')](),controller[_0x9332('0xa')]);router[_0x9332('0x8')](_0x9332('0xb'),auth[_0x9332('0x9')](),controller['show']);router['post']('/',auth[_0x9332('0x9')](),controller[_0x9332('0xc')]);router[_0x9332('0xd')](_0x9332('0xb'),auth['isAuthenticated'](),controller[_0x9332('0xe')]);router[_0x9332('0xf')](_0x9332('0xb'),auth[_0x9332('0x9')](),controller[_0x9332('0x10')]);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 cd2e456..11a596a 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 _0x4a3f=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x4aa168,_0x184fce){var _0x5ca074=function(_0x139178){while(--_0x139178){_0x4aa168['push'](_0x4aa168['shift']());}};_0x5ca074(++_0x184fce);}(_0x4a3f,0x177));var _0xf4a3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x4a3f[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0xf4a3('0x0'));module[_0xf4a3('0x1')]={'type':{'type':Sequelize[_0xf4a3('0x2')](_0xf4a3('0x3'),_0xf4a3('0x4'),_0xf4a3('0x5'),_0xf4a3('0x6'),_0xf4a3('0x7')),'defaultValue':_0xf4a3('0x3')},'content':{'type':Sequelize[_0xf4a3('0x8')]},'key':{'type':Sequelize[_0xf4a3('0x8')]},'keyType':{'type':Sequelize[_0xf4a3('0x2')]('string',_0xf4a3('0x4'),_0xf4a3('0x5'))},'keyContent':{'type':Sequelize[_0xf4a3('0x8')]},'idField':{'type':Sequelize[_0xf4a3('0x8')]},'nameField':{'type':Sequelize[_0xf4a3('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf4a3('0x8')]}}; \ No newline at end of file +var _0x158c=['string','variable','customVariable','STRING','ENUM'];(function(_0x47549b,_0x1b2865){var _0x3cdb1b=function(_0x37f58c){while(--_0x37f58c){_0x47549b['push'](_0x47549b['shift']());}};_0x3cdb1b(++_0x1b2865);}(_0x158c,0x77));var _0xc158=function(_0x21155f,_0x3b4fc8){_0x21155f=_0x21155f-0x0;var _0xd89496=_0x158c[_0x21155f];return _0xd89496;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc158('0x0')](_0xc158('0x1'),_0xc158('0x2'),_0xc158('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc158('0x4')]},'keyType':{'type':Sequelize[_0xc158('0x0')](_0xc158('0x1'),_0xc158('0x2'),_0xc158('0x3'))},'keyContent':{'type':Sequelize[_0xc158('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc158('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc158('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index a504e8c..2314b6d 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 _0xa25b=['rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ZendeskField','findAll','includeAll','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','index','map'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0xa25b,0x170));var _0xba25=function(_0x37fa2c,_0x4f3630){_0x37fa2c=_0x37fa2c-0x0;var _0x3a2b16=_0xa25b[_0x37fa2c];return _0x3a2b16;};'use strict';var emlformat=require(_0xba25('0x0'));var rimraf=require(_0xba25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba25('0x2'));var rp=require('request-promise');var moment=require(_0xba25('0x3'));var BPromise=require(_0xba25('0x4'));var Mustache=require(_0xba25('0x5'));var util=require(_0xba25('0x6'));var path=require('path');var sox=require(_0xba25('0x7'));var csv=require(_0xba25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba25('0x9'));var _=require(_0xba25('0xa'));var squel=require(_0xba25('0xb'));var crypto=require(_0xba25('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba25('0x8'));var querystring=require(_0xba25('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba25('0xe'));var qs=require(_0xba25('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba25('0x10'));var logger=require(_0xba25('0x11'))(_0xba25('0x12'));var utils=require(_0xba25('0x13'));var config=require(_0xba25('0x14'));var licenseUtil=require(_0xba25('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3edb4,_0x1b24e2){_0x1b24e2=_0x1b24e2||0xcc;return function(_0x7bb6c6){if(_0x7bb6c6){return _0xb3edb4[_0xba25('0x16')](_0x1b24e2);}return _0xb3edb4[_0xba25('0x17')](_0x1b24e2)[_0xba25('0x18')]();};}function respondWithResult(_0x177a1c,_0xb2b04b){_0xb2b04b=_0xb2b04b||0xc8;return function(_0xf018fa){if(_0xf018fa){return _0x177a1c[_0xba25('0x17')](_0xb2b04b)[_0xba25('0x19')](_0xf018fa);}};}function respondWithFilteredResult(_0x508e45,_0xe0d90f){return function(_0x4bb993){if(_0x4bb993){var _0x1b0a2e=typeof _0xe0d90f['offset']==='undefined'&&typeof _0xe0d90f[_0xba25('0x1a')]==='undefined';var _0x32fba5=_0x4bb993[_0xba25('0x1b')];var _0x12e841=_0x1b0a2e?0x0:_0xe0d90f[_0xba25('0x1c')];var _0x102c45=_0x1b0a2e?_0x4bb993[_0xba25('0x1b')]:_0xe0d90f[_0xba25('0x1c')]+_0xe0d90f[_0xba25('0x1a')];var _0x13503b;if(_0x102c45>=_0x32fba5){_0x102c45=_0x32fba5;_0x13503b=0xc8;}else{_0x13503b=0xce;}_0x508e45[_0xba25('0x17')](_0x13503b);return _0x508e45[_0xba25('0x1d')](_0xba25('0x1e'),_0x12e841+'-'+_0x102c45+'/'+_0x32fba5)[_0xba25('0x19')](_0x4bb993);}return null;};}function patchUpdates(_0x10ac9a){return function(_0x5281cd){try{jsonpatch['apply'](_0x5281cd,_0x10ac9a,!![]);}catch(_0x2df31c){return BPromise[_0xba25('0x1f')](_0x2df31c);}return _0x5281cd['save']();};}function saveUpdates(_0x4486f1,_0x1d511f){return function(_0x5061bf){if(_0x5061bf){return _0x5061bf[_0xba25('0x20')](_0x4486f1)[_0xba25('0x21')](function(_0xea430e){return _0xea430e;});}return null;};}function removeEntity(_0x3827d5,_0x4638b8){return function(_0x30e4a3){if(_0x30e4a3){return _0x30e4a3[_0xba25('0x22')]()[_0xba25('0x21')](function(){_0x3827d5[_0xba25('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279669,_0x3394f4){return function(_0x136d97){if(!_0x136d97){_0x279669[_0xba25('0x16')](0x194);}return _0x136d97;};}function handleError(_0x374551,_0x3a454f){_0x3a454f=_0x3a454f||0x1f4;return function(_0x21e47a){logger[_0xba25('0x23')](_0x21e47a[_0xba25('0x24')]);if(_0x21e47a[_0xba25('0x25')]){delete _0x21e47a['name'];}_0x374551[_0xba25('0x17')](_0x3a454f)['send'](_0x21e47a);};}exports[_0xba25('0x26')]=function(_0x34137d,_0x4b0d23){var _0x4242cb={},_0x41737e={},_0x241ed3={'count':0x0,'rows':[]};var _0x2193df=_[_0xba25('0x27')](db['ZendeskField'][_0xba25('0x28')],function(_0x52d19b){return{'name':_0x52d19b[_0xba25('0x29')],'type':_0x52d19b[_0xba25('0x2a')]['key']};});_0x41737e['model']=_['map'](_0x2193df,_0xba25('0x25'));_0x41737e['query']=_[_0xba25('0x2b')](_0x34137d[_0xba25('0x2c')]);_0x41737e[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x41737e['model'],_0x41737e['query']);_0x4242cb[_0xba25('0x2f')]=_[_0xba25('0x2e')](_0x41737e[_0xba25('0x30')],qs[_0xba25('0x31')](_0x34137d[_0xba25('0x2c')][_0xba25('0x31')]));_0x4242cb[_0xba25('0x2f')]=_0x4242cb[_0xba25('0x2f')][_0xba25('0x32')]?_0x4242cb[_0xba25('0x2f')]:_0x41737e[_0xba25('0x30')];if(!_0x34137d[_0xba25('0x2c')][_0xba25('0x33')](_0xba25('0x34'))){_0x4242cb[_0xba25('0x1a')]=qs['limit'](_0x34137d[_0xba25('0x2c')][_0xba25('0x1a')]);_0x4242cb[_0xba25('0x1c')]=qs[_0xba25('0x1c')](_0x34137d[_0xba25('0x2c')][_0xba25('0x1c')]);}_0x4242cb['order']=qs[_0xba25('0x35')](_0x34137d[_0xba25('0x2c')][_0xba25('0x35')]);_0x4242cb[_0xba25('0x36')]=qs['filters'](_[_0xba25('0x37')](_0x34137d['query'],_0x41737e['filters']),_0x2193df);if(_0x34137d[_0xba25('0x2c')][_0xba25('0x38')]){_0x4242cb[_0xba25('0x36')]=_[_0xba25('0x39')](_0x4242cb['where'],{'$or':_['map'](_0x2193df,function(_0x396a0f){if(_0x396a0f[_0xba25('0x2a')]!==_0xba25('0x3a')){var _0x2c5872={};_0x2c5872[_0x396a0f[_0xba25('0x25')]]={'$like':'%'+_0x34137d[_0xba25('0x2c')][_0xba25('0x38')]+'%'};return _0x2c5872;}})});}_0x4242cb=_['merge']({},_0x4242cb,_0x34137d['options']);var _0x215b46={'where':_0x4242cb[_0xba25('0x36')]};return db[_0xba25('0x3b')]['count'](_0x215b46)[_0xba25('0x21')](function(_0x293ce4){_0x241ed3[_0xba25('0x1b')]=_0x293ce4;if(_0x34137d[_0xba25('0x2c')]['includeAll']){_0x4242cb['include']=[{'all':!![]}];}return db['ZendeskField'][_0xba25('0x3c')](_0x4242cb);})['then'](function(_0x32d2ba){_0x241ed3['rows']=_0x32d2ba;return _0x241ed3;})[_0xba25('0x21')](respondWithFilteredResult(_0x4b0d23,_0x4242cb))['catch'](handleError(_0x4b0d23,null));};exports['show']=function(_0x1b04cf,_0x466007){var _0x39dd96={'raw':!![],'where':{'id':_0x1b04cf['params']['id']}},_0x12d46c={};_0x12d46c[_0xba25('0x30')]=_[_0xba25('0x2b')](db[_0xba25('0x3b')][_0xba25('0x28')]);_0x12d46c[_0xba25('0x2c')]=_[_0xba25('0x2b')](_0x1b04cf[_0xba25('0x2c')]);_0x12d46c[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x12d46c[_0xba25('0x30')],_0x12d46c[_0xba25('0x2c')]);_0x39dd96[_0xba25('0x2f')]=_[_0xba25('0x2e')](_0x12d46c[_0xba25('0x30')],qs[_0xba25('0x31')](_0x1b04cf['query'][_0xba25('0x31')]));_0x39dd96['attributes']=_0x39dd96[_0xba25('0x2f')][_0xba25('0x32')]?_0x39dd96[_0xba25('0x2f')]:_0x12d46c[_0xba25('0x30')];if(_0x1b04cf[_0xba25('0x2c')][_0xba25('0x3d')]){_0x39dd96['include']=[{'all':!![]}];}_0x39dd96=_[_0xba25('0x39')]({},_0x39dd96,_0x1b04cf[_0xba25('0x3e')]);return db[_0xba25('0x3b')][_0xba25('0x3f')](_0x39dd96)['then'](handleEntityNotFound(_0x466007,null))[_0xba25('0x21')](respondWithResult(_0x466007,null))[_0xba25('0x40')](handleError(_0x466007,null));};exports[_0xba25('0x41')]=function(_0x1a1513,_0x51384d){return db[_0xba25('0x3b')][_0xba25('0x41')](_0x1a1513[_0xba25('0x42')],{})['then'](respondWithResult(_0x51384d,0xc9))[_0xba25('0x40')](handleError(_0x51384d,null));};exports['update']=function(_0x3b9c64,_0x43226c){if(_0x3b9c64[_0xba25('0x42')]['id']){delete _0x3b9c64['body']['id'];}return db[_0xba25('0x3b')][_0xba25('0x3f')]({'where':{'id':_0x3b9c64[_0xba25('0x43')]['id']}})[_0xba25('0x21')](handleEntityNotFound(_0x43226c,null))['then'](saveUpdates(_0x3b9c64['body'],null))[_0xba25('0x21')](respondWithResult(_0x43226c,null))['catch'](handleError(_0x43226c,null));};exports[_0xba25('0x22')]=function(_0x5600fe,_0x5226b6){return db[_0xba25('0x3b')][_0xba25('0x3f')]({'where':{'id':_0x5600fe[_0xba25('0x43')]['id']}})['then'](handleEntityNotFound(_0x5226b6,null))[_0xba25('0x21')](removeEntity(_0x5226b6,null))[_0xba25('0x40')](handleError(_0x5226b6,null));}; \ No newline at end of file +var _0x006b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ZendeskField','rawAttributes','type','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x006b,0x83));var _0xb006=function(_0x5007be,_0x5a8c4b){_0x5007be=_0x5007be-0x0;var _0x22f469=_0x006b[_0x5007be];return _0x22f469;};'use strict';var emlformat=require(_0xb006('0x0'));var rimraf=require(_0xb006('0x1'));var zipdir=require(_0xb006('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb006('0x3'));var moment=require(_0xb006('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb006('0x5'));var util=require(_0xb006('0x6'));var path=require(_0xb006('0x7'));var sox=require(_0xb006('0x8'));var csv=require(_0xb006('0x9'));var ejs=require(_0xb006('0xa'));var fs=require('fs');var fs_extra=require(_0xb006('0xb'));var _=require(_0xb006('0xc'));var squel=require(_0xb006('0xd'));var crypto=require(_0xb006('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb006('0xf'));var Papa=require(_0xb006('0x10'));var Redis=require(_0xb006('0x11'));var authService=require(_0xb006('0x12'));var qs=require(_0xb006('0x13'));var as=require(_0xb006('0x14'));var hardwareService=require(_0xb006('0x15'));var logger=require(_0xb006('0x16'))(_0xb006('0x17'));var utils=require(_0xb006('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb006('0x19'));var db=require(_0xb006('0x1a'))['db'];function respondWithStatusCode(_0x20fde5,_0x2fd557){_0x2fd557=_0x2fd557||0xcc;return function(_0x17b1c6){if(_0x17b1c6){return _0x20fde5[_0xb006('0x1b')](_0x2fd557);}return _0x20fde5['status'](_0x2fd557)[_0xb006('0x1c')]();};}function respondWithResult(_0x272b65,_0x33f1d6){_0x33f1d6=_0x33f1d6||0xc8;return function(_0x5483ca){if(_0x5483ca){return _0x272b65[_0xb006('0x1d')](_0x33f1d6)[_0xb006('0x1e')](_0x5483ca);}};}function respondWithFilteredResult(_0x3aa62f,_0x407f5d){return function(_0x113ab3){if(_0x113ab3){var _0x2f4d1c=typeof _0x407f5d[_0xb006('0x1f')]===_0xb006('0x20')&&typeof _0x407f5d[_0xb006('0x21')]===_0xb006('0x20');var _0x27b4bb=_0x113ab3[_0xb006('0x22')];var _0x517515=_0x2f4d1c?0x0:_0x407f5d[_0xb006('0x1f')];var _0x28283f=_0x2f4d1c?_0x113ab3['count']:_0x407f5d[_0xb006('0x1f')]+_0x407f5d[_0xb006('0x21')];var _0x917713;if(_0x28283f>=_0x27b4bb){_0x28283f=_0x27b4bb;_0x917713=0xc8;}else{_0x917713=0xce;}_0x3aa62f[_0xb006('0x1d')](_0x917713);return _0x3aa62f['set'](_0xb006('0x23'),_0x517515+'-'+_0x28283f+'/'+_0x27b4bb)[_0xb006('0x1e')](_0x113ab3);}return null;};}function patchUpdates(_0x1fe14f){return function(_0x3b15e3){try{jsonpatch[_0xb006('0x24')](_0x3b15e3,_0x1fe14f,!![]);}catch(_0x575378){return BPromise['reject'](_0x575378);}return _0x3b15e3[_0xb006('0x25')]();};}function saveUpdates(_0x248b64,_0x149a82){return function(_0x1dc092){if(_0x1dc092){return _0x1dc092[_0xb006('0x26')](_0x248b64)[_0xb006('0x27')](function(_0x3aed3c){return _0x3aed3c;});}return null;};}function removeEntity(_0x3c6f45,_0x337e19){return function(_0x1841d6){if(_0x1841d6){return _0x1841d6[_0xb006('0x28')]()[_0xb006('0x27')](function(){_0x3c6f45[_0xb006('0x1d')](0xcc)[_0xb006('0x1c')]();});}};}function handleEntityNotFound(_0x394035,_0x27c2f7){return function(_0xf9a6e9){if(!_0xf9a6e9){_0x394035[_0xb006('0x1b')](0x194);}return _0xf9a6e9;};}function handleError(_0x928b4f,_0x528fec){_0x528fec=_0x528fec||0x1f4;return function(_0x287243){logger[_0xb006('0x29')](_0x287243[_0xb006('0x2a')]);if(_0x287243[_0xb006('0x2b')]){delete _0x287243['name'];}_0x928b4f[_0xb006('0x1d')](_0x528fec)[_0xb006('0x2c')](_0x287243);};}exports['index']=function(_0x128878,_0x5d99e7){var _0x1d92f4={},_0x1ded08={},_0x9cc519={'count':0x0,'rows':[]};var _0x7b42e6=_[_0xb006('0x2d')](db[_0xb006('0x2e')][_0xb006('0x2f')],function(_0x2026ef){return{'name':_0x2026ef['fieldName'],'type':_0x2026ef[_0xb006('0x30')]['key']};});_0x1ded08[_0xb006('0x31')]=_[_0xb006('0x2d')](_0x7b42e6,_0xb006('0x2b'));_0x1ded08['query']=_['keys'](_0x128878['query']);_0x1ded08[_0xb006('0x32')]=_[_0xb006('0x33')](_0x1ded08[_0xb006('0x31')],_0x1ded08[_0xb006('0x34')]);_0x1d92f4['attributes']=_[_0xb006('0x33')](_0x1ded08['model'],qs[_0xb006('0x35')](_0x128878[_0xb006('0x34')][_0xb006('0x35')]));_0x1d92f4['attributes']=_0x1d92f4[_0xb006('0x36')][_0xb006('0x37')]?_0x1d92f4['attributes']:_0x1ded08[_0xb006('0x31')];if(!_0x128878[_0xb006('0x34')][_0xb006('0x38')](_0xb006('0x39'))){_0x1d92f4[_0xb006('0x21')]=qs[_0xb006('0x21')](_0x128878[_0xb006('0x34')]['limit']);_0x1d92f4['offset']=qs[_0xb006('0x1f')](_0x128878[_0xb006('0x34')][_0xb006('0x1f')]);}_0x1d92f4[_0xb006('0x3a')]=qs[_0xb006('0x3b')](_0x128878[_0xb006('0x34')][_0xb006('0x3b')]);_0x1d92f4[_0xb006('0x3c')]=qs[_0xb006('0x32')](_['pick'](_0x128878['query'],_0x1ded08[_0xb006('0x32')]),_0x7b42e6);if(_0x128878[_0xb006('0x34')][_0xb006('0x3d')]){_0x1d92f4[_0xb006('0x3c')]=_[_0xb006('0x3e')](_0x1d92f4[_0xb006('0x3c')],{'$or':_[_0xb006('0x2d')](_0x7b42e6,function(_0x501a66){if(_0x501a66[_0xb006('0x30')]!==_0xb006('0x3f')){var _0x191922={};_0x191922[_0x501a66[_0xb006('0x2b')]]={'$like':'%'+_0x128878[_0xb006('0x34')][_0xb006('0x3d')]+'%'};return _0x191922;}})});}_0x1d92f4=_[_0xb006('0x3e')]({},_0x1d92f4,_0x128878[_0xb006('0x40')]);var _0x36fe7a={'where':_0x1d92f4[_0xb006('0x3c')]};return db[_0xb006('0x2e')][_0xb006('0x22')](_0x36fe7a)['then'](function(_0xf84245){_0x9cc519[_0xb006('0x22')]=_0xf84245;if(_0x128878[_0xb006('0x34')][_0xb006('0x41')]){_0x1d92f4['include']=[{'all':!![]}];}return db[_0xb006('0x2e')][_0xb006('0x42')](_0x1d92f4);})['then'](function(_0x556196){_0x9cc519[_0xb006('0x43')]=_0x556196;return _0x9cc519;})[_0xb006('0x27')](respondWithFilteredResult(_0x5d99e7,_0x1d92f4))[_0xb006('0x44')](handleError(_0x5d99e7,null));};exports[_0xb006('0x45')]=function(_0x5d7878,_0x34a421){var _0x535152={'raw':!![],'where':{'id':_0x5d7878['params']['id']}},_0x3daa19={};_0x3daa19[_0xb006('0x31')]=_[_0xb006('0x46')](db['ZendeskField'][_0xb006('0x2f')]);_0x3daa19[_0xb006('0x34')]=_[_0xb006('0x46')](_0x5d7878['query']);_0x3daa19[_0xb006('0x32')]=_[_0xb006('0x33')](_0x3daa19[_0xb006('0x31')],_0x3daa19['query']);_0x535152[_0xb006('0x36')]=_[_0xb006('0x33')](_0x3daa19[_0xb006('0x31')],qs[_0xb006('0x35')](_0x5d7878[_0xb006('0x34')]['fields']));_0x535152[_0xb006('0x36')]=_0x535152['attributes'][_0xb006('0x37')]?_0x535152[_0xb006('0x36')]:_0x3daa19[_0xb006('0x31')];if(_0x5d7878[_0xb006('0x34')]['includeAll']){_0x535152[_0xb006('0x47')]=[{'all':!![]}];}_0x535152=_[_0xb006('0x3e')]({},_0x535152,_0x5d7878[_0xb006('0x40')]);return db[_0xb006('0x2e')][_0xb006('0x48')](_0x535152)[_0xb006('0x27')](handleEntityNotFound(_0x34a421,null))['then'](respondWithResult(_0x34a421,null))['catch'](handleError(_0x34a421,null));};exports[_0xb006('0x49')]=function(_0x4fa57a,_0x5f1515){return db['ZendeskField'][_0xb006('0x49')](_0x4fa57a[_0xb006('0x4a')],{})['then'](respondWithResult(_0x5f1515,0xc9))[_0xb006('0x44')](handleError(_0x5f1515,null));};exports['update']=function(_0xd9bad3,_0x464d9c){if(_0xd9bad3[_0xb006('0x4a')]['id']){delete _0xd9bad3[_0xb006('0x4a')]['id'];}return db[_0xb006('0x2e')]['find']({'where':{'id':_0xd9bad3[_0xb006('0x4b')]['id']}})[_0xb006('0x27')](handleEntityNotFound(_0x464d9c,null))[_0xb006('0x27')](saveUpdates(_0xd9bad3['body'],null))['then'](respondWithResult(_0x464d9c,null))['catch'](handleError(_0x464d9c,null));};exports[_0xb006('0x28')]=function(_0x219df9,_0xdb8bc5){return db['ZendeskField'][_0xb006('0x48')]({'where':{'id':_0x219df9['params']['id']}})[_0xb006('0x27')](handleEntityNotFound(_0xdb8bc5,null))[_0xb006('0x27')](removeEntity(_0xdb8bc5,null))['catch'](handleError(_0xdb8bc5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index f1ff3f9..788485e 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 _0x90b5=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','./intZendeskField.attributes','exports'];(function(_0x2eb59b,_0x4aa705){var _0xcf8606=function(_0xc79ab1){while(--_0xc79ab1){_0x2eb59b['push'](_0x2eb59b['shift']());}};_0xcf8606(++_0x4aa705);}(_0x90b5,0xe1));var _0x590b=function(_0x616fe6,_0x3f86cb){_0x616fe6=_0x616fe6-0x0;var _0xd63c76=_0x90b5[_0x616fe6];return _0xd63c76;};'use strict';var _=require(_0x590b('0x0'));var util=require(_0x590b('0x1'));var logger=require(_0x590b('0x2'))(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x590b('0x5'));var rimraf=require(_0x590b('0x6'));var config=require('../../config/environment');var attributes=require(_0x590b('0x7'));module[_0x590b('0x8')]=function(_0x467f2a,_0xf54af9){return _0x467f2a['define']('ZendeskField',attributes,{'tableName':_0x590b('0x9'),'paranoid':![],'indexes':[{'name':_0x590b('0xa'),'fields':[_0x590b('0xb'),_0x590b('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1da0=['define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x1da0,0x14a));var _0x01da=function(_0x5e2862,_0x4760eb){_0x5e2862=_0x5e2862-0x0;var _0x8dcad4=_0x1da0[_0x5e2862];return _0x8dcad4;};'use strict';var _=require('lodash');var util=require(_0x01da('0x0'));var logger=require('../../config/logger')(_0x01da('0x1'));var moment=require(_0x01da('0x2'));var BPromise=require(_0x01da('0x3'));var rp=require(_0x01da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01da('0x5'));var attributes=require(_0x01da('0x6'));module[_0x01da('0x7')]=function(_0x374a52,_0x29849e){return _0x374a52[_0x01da('0x8')]('ZendeskField',attributes,{'tableName':_0x01da('0x9'),'paranoid':![],'indexes':[{'name':_0x01da('0xa'),'fields':[_0x01da('0xb'),_0x01da('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 abe135c..11b9fe1 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 _0x3845=['result','catch','lodash','bluebird','ioredis','../../config/utils','jayson/promise','client','http','request','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x3845,0x1bc));var _0x5384=function(_0x4293b5,_0x45689a){_0x4293b5=_0x4293b5-0x0;var _0xf27aee=_0x3845[_0x4293b5];return _0xf27aee;};'use strict';var _=require(_0x5384('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5384('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5384('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5384('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5384('0x4'));var client=jayson[_0x5384('0x5')][_0x5384('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15604b,_0x34dabc,_0x22196b){return new BPromise(function(_0x35f84c,_0x46d959){return client[_0x5384('0x7')](_0x15604b,_0x22196b)['then'](function(_0x317af7){logger['info'](_0x5384('0x8'),_0x34dabc,_0x5384('0x9'));logger[_0x5384('0xa')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x34dabc,'request\x20sent',JSON[_0x5384('0xb')](_0x317af7));if(_0x317af7[_0x5384('0xc')]){if(_0x317af7[_0x5384('0xc')][_0x5384('0xd')]===0x1f4){logger[_0x5384('0xc')](_0x5384('0x8'),_0x34dabc,_0x317af7[_0x5384('0xc')]['message']);return _0x46d959(_0x317af7['error'][_0x5384('0xe')]);}logger['error'](_0x5384('0x8'),_0x34dabc,_0x317af7['error'][_0x5384('0xe')]);return _0x35f84c(_0x317af7[_0x5384('0xc')][_0x5384('0xe')]);}else{logger['info'](_0x5384('0x8'),_0x34dabc,_0x5384('0x9'));_0x35f84c(_0x317af7[_0x5384('0xf')]['message']);}})[_0x5384('0x10')](function(_0x5ef86d){logger['error'](_0x5384('0x8'),_0x34dabc,_0x5ef86d);_0x46d959(_0x5ef86d);});});} \ No newline at end of file +var _0x0dca=['http','info','debug','request\x20sent','stringify','error','message','ZendeskField,\x20%s,\x20%s','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa4b622,_0x4eb352){var _0x2f0c72=function(_0x54ef6a){while(--_0x54ef6a){_0xa4b622['push'](_0xa4b622['shift']());}};_0x2f0c72(++_0x4eb352);}(_0x0dca,0x13a));var _0xa0dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0dca[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa0dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0dc('0x1'));var fs=require('fs');var Redis=require(_0xa0dc('0x2'));var db=require(_0xa0dc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0dc('0x4'))(_0xa0dc('0x5'));var config=require(_0xa0dc('0x6'));var jayson=require(_0xa0dc('0x7'));var client=jayson[_0xa0dc('0x8')][_0xa0dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb980a7,_0x53f968,_0x315e98){return new BPromise(function(_0x259b6b,_0x41f69b){return client['request'](_0xb980a7,_0x315e98)['then'](function(_0x1ac73f){logger[_0xa0dc('0xa')]('ZendeskField,\x20%s,\x20%s',_0x53f968,'request\x20sent');logger[_0xa0dc('0xb')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x53f968,_0xa0dc('0xc'),JSON[_0xa0dc('0xd')](_0x1ac73f));if(_0x1ac73f[_0xa0dc('0xe')]){if(_0x1ac73f[_0xa0dc('0xe')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x53f968,_0x1ac73f[_0xa0dc('0xe')][_0xa0dc('0xf')]);return _0x41f69b(_0x1ac73f[_0xa0dc('0xe')][_0xa0dc('0xf')]);}logger[_0xa0dc('0xe')](_0xa0dc('0x10'),_0x53f968,_0x1ac73f['error'][_0xa0dc('0xf')]);return _0x259b6b(_0x1ac73f[_0xa0dc('0xe')][_0xa0dc('0xf')]);}else{logger[_0xa0dc('0xa')](_0xa0dc('0x10'),_0x53f968,_0xa0dc('0xc'));_0x259b6b(_0x1ac73f[_0xa0dc('0x11')]['message']);}})[_0xa0dc('0x12')](function(_0x24a0df){logger['error']('ZendeskField,\x20%s,\x20%s',_0x53f968,_0x24a0df);_0x41f69b(_0x24a0df);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 59577b3..9761da8 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 _0x6b4b=['getConfigurations','/:id/fields','post','create','/:id/configurations','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x6b4b,0x9d));var _0xb6b4=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x6b4b[_0x220f3f];return _0x1f170e;};'use strict';var multer=require('multer');var util=require(_0xb6b4('0x0'));var path=require(_0xb6b4('0x1'));var timeout=require(_0xb6b4('0x2'));var express=require('express');var router=express[_0xb6b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb6b4('0x4'));var interaction=require(_0xb6b4('0x5'));var config=require(_0xb6b4('0x6'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xb6b4('0x7')](),controller[_0xb6b4('0x8')]);router[_0xb6b4('0x9')](_0xb6b4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb6b4('0x9')]('/:id/configurations',auth[_0xb6b4('0x7')](),controller[_0xb6b4('0xb')]);router[_0xb6b4('0x9')](_0xb6b4('0xc'),auth[_0xb6b4('0x7')](),controller['getFields']);router[_0xb6b4('0xd')]('/',auth['isAuthenticated'](),controller[_0xb6b4('0xe')]);router[_0xb6b4('0xd')](_0xb6b4('0xf'),auth[_0xb6b4('0x7')](),controller['addConfiguration']);router[_0xb6b4('0x10')](_0xb6b4('0xa'),auth[_0xb6b4('0x7')](),controller[_0xb6b4('0x11')]);router[_0xb6b4('0x12')](_0xb6b4('0xa'),auth['isAuthenticated'](),controller[_0xb6b4('0x13')]);module[_0xb6b4('0x14')]=router; \ No newline at end of file +var _0xde15=['get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index'];(function(_0x5b0a4a,_0x11a985){var _0x2ce5c6=function(_0x4b3a55){while(--_0x4b3a55){_0x5b0a4a['push'](_0x5b0a4a['shift']());}};_0x2ce5c6(++_0x11a985);}(_0xde15,0x12e));var _0x5de1=function(_0x1b3a3d,_0x277f32){_0x1b3a3d=_0x1b3a3d-0x0;var _0x312e4c=_0xde15[_0x1b3a3d];return _0x312e4c;};'use strict';var multer=require(_0x5de1('0x0'));var util=require(_0x5de1('0x1'));var path=require('path');var timeout=require(_0x5de1('0x2'));var express=require(_0x5de1('0x3'));var router=express['Router']();var fs_extra=require(_0x5de1('0x4'));var auth=require(_0x5de1('0x5'));var interaction=require(_0x5de1('0x6'));var config=require('../../config/environment');var controller=require(_0x5de1('0x7'));router['get']('/',auth[_0x5de1('0x8')](),controller[_0x5de1('0x9')]);router[_0x5de1('0xa')](_0x5de1('0xb'),auth[_0x5de1('0x8')](),controller[_0x5de1('0xc')]);router[_0x5de1('0xa')](_0x5de1('0xd'),auth[_0x5de1('0x8')](),controller[_0x5de1('0xe')]);router[_0x5de1('0xa')](_0x5de1('0xf'),auth['isAuthenticated'](),controller[_0x5de1('0x10')]);router[_0x5de1('0x11')]('/',auth[_0x5de1('0x8')](),controller[_0x5de1('0x12')]);router[_0x5de1('0x11')](_0x5de1('0xd'),auth[_0x5de1('0x8')](),controller[_0x5de1('0x13')]);router[_0x5de1('0x14')]('/:id',auth[_0x5de1('0x8')](),controller['update']);router[_0x5de1('0x15')](_0x5de1('0xb'),auth[_0x5de1('0x8')](),controller[_0x5de1('0x16')]);module[_0x5de1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 2db5226..35e3cd8 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 _0x00bb=['STRING','sequelize','exports'];(function(_0x570b91,_0x2e802c){var _0x534a6b=function(_0x24b6e9){while(--_0x24b6e9){_0x570b91['push'](_0x570b91['shift']());}};_0x534a6b(++_0x2e802c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x00bb[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb00b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb00b('0x2')]},'clientSecret':{'type':Sequelize[_0xb00b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb00b('0x2')]},'refreshToken':{'type':Sequelize[_0xb00b('0x2')]}}; \ No newline at end of file +var _0xd2ea=['sequelize','exports','STRING'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xd2ea,0x15f));var _0xad2e=function(_0x3c5b0b,_0xb23555){_0x3c5b0b=_0x3c5b0b-0x0;var _0x1a986a=_0xd2ea[_0x3c5b0b];return _0x1a986a;};'use strict';var Sequelize=require(_0xad2e('0x0'));module[_0xad2e('0x1')]={'name':{'type':Sequelize[_0xad2e('0x2')]},'description':{'type':Sequelize[_0xad2e('0x2')]},'host':{'type':Sequelize[_0xad2e('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xad2e('0x2')]},'clientSecret':{'type':Sequelize[_0xad2e('0x2')]},'serverUrl':{'type':Sequelize[_0xad2e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xad2e('0x2')]},'refreshToken':{'type':Sequelize[_0xad2e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index afe25a9..d140b0e 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 _0x1dce=['https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','create','body','getConfigurations','ZohoConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x39def5,_0x277d82){var _0xfa0567=function(_0x515754){while(--_0x515754){_0x39def5['push'](_0x39def5['shift']());}};_0xfa0567(++_0x277d82);}(_0x1dce,0x1a9));var _0xe1dc=function(_0x3f7855,_0x535342){_0x3f7855=_0x3f7855-0x0;var _0x301fb7=_0x1dce[_0x3f7855];return _0x301fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1dc('0x0'));var jsonpatch=require(_0xe1dc('0x1'));var rp=require(_0xe1dc('0x2'));var moment=require(_0xe1dc('0x3'));var BPromise=require(_0xe1dc('0x4'));var Mustache=require(_0xe1dc('0x5'));var util=require('util');var path=require(_0xe1dc('0x6'));var sox=require(_0xe1dc('0x7'));var csv=require('to-csv');var ejs=require(_0xe1dc('0x8'));var fs=require('fs');var fs_extra=require(_0xe1dc('0x9'));var _=require(_0xe1dc('0xa'));var squel=require(_0xe1dc('0xb'));var crypto=require(_0xe1dc('0xc'));var jsforce=require(_0xe1dc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe1dc('0xe'));var Redis=require(_0xe1dc('0xf'));var authService=require(_0xe1dc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1dc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xe1dc('0x12'));var licenseUtil=require(_0xe1dc('0x13'));var db=require(_0xe1dc('0x14'))['db'];var integrations=require(_0xe1dc('0x15'));function respondWithStatusCode(_0x319ee1,_0x5c1a3b){_0x5c1a3b=_0x5c1a3b||0xcc;return function(_0x48797d){if(_0x48797d){return _0x319ee1[_0xe1dc('0x16')](_0x5c1a3b);}return _0x319ee1[_0xe1dc('0x17')](_0x5c1a3b)[_0xe1dc('0x18')]();};}function respondWithResult(_0x1e39dd,_0x1ae552){_0x1ae552=_0x1ae552||0xc8;return function(_0x45edfc){if(_0x45edfc){return _0x1e39dd['status'](_0x1ae552)[_0xe1dc('0x19')](_0x45edfc);}};}function respondWithFilteredResult(_0x342bcc,_0xa7ea85){return function(_0xd9a239){if(_0xd9a239){var _0x653e6d=typeof _0xa7ea85['offset']===_0xe1dc('0x1a')&&typeof _0xa7ea85['limit']===_0xe1dc('0x1a');var _0x4390a6=_0xd9a239[_0xe1dc('0x1b')];var _0x31ff2c=_0x653e6d?0x0:_0xa7ea85[_0xe1dc('0x1c')];var _0x5d6946=_0x653e6d?_0xd9a239['count']:_0xa7ea85['offset']+_0xa7ea85[_0xe1dc('0x1d')];var _0x2fce0c;if(_0x5d6946>=_0x4390a6){_0x5d6946=_0x4390a6;_0x2fce0c=0xc8;}else{_0x2fce0c=0xce;}_0x342bcc[_0xe1dc('0x17')](_0x2fce0c);return _0x342bcc[_0xe1dc('0x1e')](_0xe1dc('0x1f'),_0x31ff2c+'-'+_0x5d6946+'/'+_0x4390a6)['json'](_0xd9a239);}return null;};}function patchUpdates(_0x1491af){return function(_0x280c8b){try{jsonpatch[_0xe1dc('0x20')](_0x280c8b,_0x1491af,!![]);}catch(_0xd14894){return BPromise[_0xe1dc('0x21')](_0xd14894);}return _0x280c8b['save']();};}function saveUpdates(_0x5bf4f0,_0x5da487){return function(_0x2fc325){if(_0x2fc325){return _0x2fc325[_0xe1dc('0x22')](_0x5bf4f0)[_0xe1dc('0x23')](function(_0x477ac1){return _0x477ac1;});}return null;};}function removeEntity(_0x161586,_0x5a6cb0){return function(_0x1652ce){if(_0x1652ce){return _0x1652ce[_0xe1dc('0x24')]()['then'](function(){_0x161586['status'](0xcc)[_0xe1dc('0x18')]();});}};}function handleEntityNotFound(_0x4c111a,_0x15a845){return function(_0x3684d8){if(!_0x3684d8){_0x4c111a[_0xe1dc('0x16')](0x194);}return _0x3684d8;};}function handleError(_0x2cbd2a,_0x204dcc){_0x204dcc=_0x204dcc||0x1f4;return function(_0x15e2d9){logger[_0xe1dc('0x25')](_0x15e2d9[_0xe1dc('0x26')]);if(_0x15e2d9[_0xe1dc('0x27')]){delete _0x15e2d9[_0xe1dc('0x27')];}_0x2cbd2a[_0xe1dc('0x17')](_0x204dcc)[_0xe1dc('0x28')](_0x15e2d9);};}exports[_0xe1dc('0x29')]=function(_0x369159,_0x5f37e3){var _0x45ce96={},_0x2c6a5e={},_0x209117={'count':0x0,'rows':[]};var _0x635e39=_[_0xe1dc('0x2a')](db[_0xe1dc('0x2b')][_0xe1dc('0x2c')],function(_0x2a162d){return{'name':_0x2a162d[_0xe1dc('0x2d')],'type':_0x2a162d[_0xe1dc('0x2e')][_0xe1dc('0x2f')]};});_0x2c6a5e['model']=_['map'](_0x635e39,'name');_0x2c6a5e[_0xe1dc('0x30')]=_[_0xe1dc('0x31')](_0x369159[_0xe1dc('0x30')]);_0x2c6a5e['filters']=_['intersection'](_0x2c6a5e[_0xe1dc('0x32')],_0x2c6a5e['query']);_0x45ce96[_0xe1dc('0x33')]=_['intersection'](_0x2c6a5e['model'],qs['fields'](_0x369159['query'][_0xe1dc('0x34')]));_0x45ce96['attributes']=_0x45ce96[_0xe1dc('0x33')][_0xe1dc('0x35')]?_0x45ce96[_0xe1dc('0x33')]:_0x2c6a5e['model'];if(!_0x369159[_0xe1dc('0x30')][_0xe1dc('0x36')](_0xe1dc('0x37'))){_0x45ce96['limit']=qs[_0xe1dc('0x1d')](_0x369159[_0xe1dc('0x30')][_0xe1dc('0x1d')]);_0x45ce96[_0xe1dc('0x1c')]=qs['offset'](_0x369159[_0xe1dc('0x30')][_0xe1dc('0x1c')]);}_0x45ce96[_0xe1dc('0x38')]=qs['sort'](_0x369159['query'][_0xe1dc('0x39')]);_0x45ce96['where']=qs['filters'](_['pick'](_0x369159['query'],_0x2c6a5e[_0xe1dc('0x3a')]),_0x635e39);if(_0x369159[_0xe1dc('0x30')][_0xe1dc('0x3b')]){_0x45ce96[_0xe1dc('0x3c')]=_[_0xe1dc('0x3d')](_0x45ce96[_0xe1dc('0x3c')],{'$or':_[_0xe1dc('0x2a')](_0x635e39,function(_0x301494){if(_0x301494[_0xe1dc('0x2e')]!==_0xe1dc('0x3e')){var _0x50c2cd={};_0x50c2cd[_0x301494['name']]={'$like':'%'+_0x369159[_0xe1dc('0x30')]['filter']+'%'};return _0x50c2cd;}})});}_0x45ce96=_[_0xe1dc('0x3d')]({},_0x45ce96,_0x369159[_0xe1dc('0x3f')]);var _0x26def5={'where':_0x45ce96[_0xe1dc('0x3c')]};return db['ZohoAccount'][_0xe1dc('0x1b')](_0x26def5)[_0xe1dc('0x23')](function(_0x593574){_0x209117[_0xe1dc('0x1b')]=_0x593574;if(_0x369159[_0xe1dc('0x30')][_0xe1dc('0x40')]){_0x45ce96[_0xe1dc('0x41')]=[{'all':!![]}];}return db[_0xe1dc('0x2b')][_0xe1dc('0x42')](_0x45ce96);})['then'](function(_0x1c8036){_0x209117['rows']=_0x1c8036;return _0x209117;})[_0xe1dc('0x23')](respondWithFilteredResult(_0x5f37e3,_0x45ce96))[_0xe1dc('0x43')](handleError(_0x5f37e3,null));};exports[_0xe1dc('0x44')]=function(_0x1c0342,_0x567f69){var _0x4bb87c={'raw':![],'where':{'id':_0x1c0342[_0xe1dc('0x45')]['id']}},_0x3b9310={};_0x3b9310[_0xe1dc('0x32')]=_['keys'](db[_0xe1dc('0x2b')][_0xe1dc('0x2c')]);_0x3b9310[_0xe1dc('0x30')]=_[_0xe1dc('0x31')](_0x1c0342[_0xe1dc('0x30')]);_0x3b9310['filters']=_['intersection'](_0x3b9310[_0xe1dc('0x32')],_0x3b9310[_0xe1dc('0x30')]);_0x4bb87c[_0xe1dc('0x33')]=_[_0xe1dc('0x46')](_0x3b9310[_0xe1dc('0x32')],qs[_0xe1dc('0x34')](_0x1c0342[_0xe1dc('0x30')][_0xe1dc('0x34')]));_0x4bb87c['attributes']=_0x4bb87c['attributes'][_0xe1dc('0x35')]?_0x4bb87c['attributes']:_0x3b9310[_0xe1dc('0x32')];if(_0x1c0342[_0xe1dc('0x30')][_0xe1dc('0x40')]){_0x4bb87c[_0xe1dc('0x41')]=[{'all':!![]}];}_0x4bb87c=_['merge']({},_0x4bb87c,_0x1c0342[_0xe1dc('0x3f')]);return db[_0xe1dc('0x2b')]['find'](_0x4bb87c)['then'](handleEntityNotFound(_0x567f69,null))[_0xe1dc('0x23')](respondWithResult(_0x567f69,null))['catch'](handleError(_0x567f69,null));};exports[_0xe1dc('0x47')]=function(_0x4869d7,_0x965a3c){return db['ZohoAccount'][_0xe1dc('0x47')](_0x4869d7[_0xe1dc('0x48')],{})['then'](respondWithResult(_0x965a3c,0xc9))['catch'](handleError(_0x965a3c,null));};exports['update']=function(_0x42042f,_0x138a44){if(_0x42042f['body']['id']){delete _0x42042f[_0xe1dc('0x48')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x42042f[_0xe1dc('0x45')]['id']}})[_0xe1dc('0x23')](handleEntityNotFound(_0x138a44,null))['then'](saveUpdates(_0x42042f['body'],null))[_0xe1dc('0x23')](respondWithResult(_0x138a44,null))[_0xe1dc('0x43')](handleError(_0x138a44,null));};exports['destroy']=function(_0x32fa8e,_0x7d1292){return db[_0xe1dc('0x2b')]['find']({'where':{'id':_0x32fa8e['params']['id']}})[_0xe1dc('0x23')](handleEntityNotFound(_0x7d1292,null))[_0xe1dc('0x23')](removeEntity(_0x7d1292,null))['catch'](handleError(_0x7d1292,null));};exports[_0xe1dc('0x49')]=function(_0x419a7f,_0x2b2e41,_0x22722b){var _0x29d4d2={};var _0x45709c={};var _0x1c09b3;var _0x440133;return db['ZohoAccount']['findOne']({'where':{'id':_0x419a7f[_0xe1dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b2e41,null))[_0xe1dc('0x23')](function(_0x1555e5){if(_0x1555e5){_0x1c09b3=_0x1555e5;_0x45709c[_0xe1dc('0x32')]=_[_0xe1dc('0x31')](db[_0xe1dc('0x4a')][_0xe1dc('0x2c')]);_0x45709c['query']=_[_0xe1dc('0x31')](_0x419a7f[_0xe1dc('0x30')]);_0x45709c[_0xe1dc('0x3a')]=_['intersection'](_0x45709c[_0xe1dc('0x32')],_0x45709c['query']);_0x29d4d2[_0xe1dc('0x33')]=_[_0xe1dc('0x46')](_0x45709c[_0xe1dc('0x32')],qs['fields'](_0x419a7f[_0xe1dc('0x30')][_0xe1dc('0x34')]));_0x29d4d2[_0xe1dc('0x33')]=_0x29d4d2['attributes'][_0xe1dc('0x35')]?_0x29d4d2[_0xe1dc('0x33')]:_0x45709c['model'];_0x29d4d2['order']=qs[_0xe1dc('0x39')](_0x419a7f[_0xe1dc('0x30')][_0xe1dc('0x39')]);_0x29d4d2[_0xe1dc('0x3c')]=qs[_0xe1dc('0x3a')](_['pick'](_0x419a7f[_0xe1dc('0x30')],_0x45709c[_0xe1dc('0x3a')]));if(_0x419a7f[_0xe1dc('0x30')]['filter']){_0x29d4d2[_0xe1dc('0x3c')]=_[_0xe1dc('0x3d')](_0x29d4d2['where'],{'$or':_[_0xe1dc('0x2a')](_0x29d4d2[_0xe1dc('0x33')],function(_0x592b93){var _0x1d77ef={};_0x1d77ef[_0x592b93]={'$like':'%'+_0x419a7f[_0xe1dc('0x30')][_0xe1dc('0x3b')]+'%'};return _0x1d77ef;})});}_0x29d4d2=_['merge']({},_0x29d4d2,_0x419a7f['options']);return _0x1c09b3[_0xe1dc('0x49')](_0x29d4d2);}})[_0xe1dc('0x23')](function(_0x1eb287){if(_0x1eb287){_0x440133=_0x1eb287[_0xe1dc('0x35')];if(!_0x419a7f[_0xe1dc('0x30')][_0xe1dc('0x36')](_0xe1dc('0x37'))){_0x29d4d2[_0xe1dc('0x1d')]=qs['limit'](_0x419a7f['query'][_0xe1dc('0x1d')]);_0x29d4d2['offset']=qs[_0xe1dc('0x1c')](_0x419a7f[_0xe1dc('0x30')][_0xe1dc('0x1c')]);}return _0x1c09b3[_0xe1dc('0x49')](_0x29d4d2);}})[_0xe1dc('0x23')](function(_0x47ec2e){if(_0x47ec2e){return _0x47ec2e?{'count':_0x440133,'rows':_0x47ec2e}:null;}})[_0xe1dc('0x23')](respondWithResult(_0x2b2e41,null))[_0xe1dc('0x43')](handleError(_0x2b2e41,null));};exports[_0xe1dc('0x4b')]=function(_0x47c483,_0x2fddd8,_0x1ee0e0){if(_0x47c483[_0xe1dc('0x48')]['id']){delete _0x47c483[_0xe1dc('0x48')]['id'];}return db[_0xe1dc('0x2b')][_0xe1dc('0x4c')]({'where':{'id':_0x47c483[_0xe1dc('0x45')]['id']}})[_0xe1dc('0x23')](handleEntityNotFound(_0x2fddd8,null))['then'](function(_0x42a373){if(_0x42a373){_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x4d')]=_0x42a373['id'];_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x4e')]=integrations[_0xe1dc('0x4f')](_0x47c483['body']['channel'],_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x2e')]);_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x50')]=integrations[_0xe1dc('0x51')](_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x52')],_0x47c483[_0xe1dc('0x48')][_0xe1dc('0x2e')]);return db[_0xe1dc('0x4a')][_0xe1dc('0x47')](_0x47c483[_0xe1dc('0x48')],{'include':[{'model':db[_0xe1dc('0x53')],'as':_0xe1dc('0x4e')},{'model':db[_0xe1dc('0x53')],'as':'Descriptions'}]});}return null;})[_0xe1dc('0x23')](respondWithResult(_0x2fddd8,null))['catch'](handleError(_0x2fddd8,null));};function getAccessToken(_0x3d2eec){return new Promise(function(_0x503d7b,_0x5a7d59){var _0x1a7270;switch(_0x3d2eec[_0xe1dc('0x54')]){case'US':_0x1a7270=_0xe1dc('0x55');break;case'AU':_0x1a7270=_0xe1dc('0x56');break;case'EU':_0x1a7270=_0xe1dc('0x57');break;case'IN':_0x1a7270=_0xe1dc('0x58');break;case'CN':_0x1a7270=_0xe1dc('0x59');break;default:_0x1a7270=_0xe1dc('0x57');break;}var _0x1d544f={'method':_0xe1dc('0x5a'),'uri':_0x1a7270+_0xe1dc('0x5b'),'qs':{'refresh_token':_0x3d2eec[_0xe1dc('0x5c')],'client_id':_0x3d2eec[_0xe1dc('0x5d')],'client_secret':_0x3d2eec[_0xe1dc('0x5e')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1d544f)['then'](function(_0x42e331){if(_0x42e331[_0xe1dc('0x5f')]){_0x503d7b(_0x42e331['access_token']);}else{_0x5a7d59(_0xe1dc('0x60'));}})[_0xe1dc('0x43')](function(_0xa7fff1){_0x5a7d59(_0xa7fff1);});});}exports[_0xe1dc('0x61')]=function(_0x56f55c,_0xd04957,_0x22e7e5){var _0x238ca4,_0x2433bb,_0x4d6975,_0x322e1b,_0x9e2f5e;return db[_0xe1dc('0x2b')][_0xe1dc('0x4c')]({'where':{'id':_0x56f55c[_0xe1dc('0x45')]['id']},'attributes':['id',_0xe1dc('0x62'),_0xe1dc('0x54'),_0xe1dc('0x5d'),'clientSecret','serverUrl',_0xe1dc('0x63'),_0xe1dc('0x5c')]})['then'](handleEntityNotFound(_0xd04957,null))['then'](function(_0x207123){_0x9e2f5e=_0x207123;_0x238ca4=_0x9e2f5e[_0xe1dc('0x62')];_0x2433bb=_0x238ca4==='zoho.eu'?'eu':_0xe1dc('0x64');_0x4d6975=_0x9e2f5e['serverUrl'];var _0x24e6b2=_0x4d6975[_0xe1dc('0x65')](-0x1);if(_0x24e6b2==='/'||_0x24e6b2==='\x5c'||_0x24e6b2===':'){_0x4d6975=_0x4d6975[_0xe1dc('0x66')](0x0,_0x4d6975['lastIndexOf'](_0x24e6b2));}if(!_0x9e2f5e[_0xe1dc('0x5c')]){throw new Error(_0xe1dc('0x67'));}return getAccessToken(_0x9e2f5e);})['then'](function(_0x1ac983){if(_0x1ac983){return rp({'method':_0xe1dc('0x68'),'uri':util[_0xe1dc('0x69')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x2433bb),'qs':{'module':_0xe1dc('0x6a')},'headers':{'Authorization':_0xe1dc('0x6b')+_0x1ac983},'json':!![]});}})[_0xe1dc('0x23')](function(_0x5acb73){if(_0x5acb73){if(_0x5acb73[_0xe1dc('0x6c')]&&_0x5acb73['response']['error']){throw new Error(_0x5acb73[_0xe1dc('0x6c')][_0xe1dc('0x25')][_0xe1dc('0x6d')]);}var _0x1cdc03=[];var _0x4a6dda=[];var _0x148796=[_0xe1dc('0x6e'),_0xe1dc('0x6f'),'Description','WhoId',_0xe1dc('0x70'),_0xe1dc('0x71'),_0xe1dc('0x72'),_0xe1dc('0x73')];_0x4a6dda=_['remove'](_0x5acb73['fields'],function(_0x263a3b){return _0x148796[_0xe1dc('0x74')](_0x263a3b[_0xe1dc('0x75')]);});for(var _0x8d3ba8=0x0;_0x8d3ba8<_0x4a6dda[_0xe1dc('0x35')];_0x8d3ba8++){if(_0x4a6dda[_0x8d3ba8]['system_mandatory']===![]){_0x1cdc03[_0xe1dc('0x76')]({'id':_0x4a6dda[_0x8d3ba8]['id'],'name':_0x4a6dda[_0x8d3ba8][_0xe1dc('0x77')],'custom':_0x4a6dda[_0x8d3ba8][_0xe1dc('0x78')],'options':_0x4a6dda[_0x8d3ba8][_0xe1dc('0x79')]===_0xe1dc('0x7a')&&_0x4a6dda[_0x8d3ba8][_0xe1dc('0x7b')]['length']>-0x1?_[_0xe1dc('0x2a')](_0x4a6dda[_0x8d3ba8]['pick_list_values'],function(_0x53f371){return{'name':_0x53f371,'value':_0x53f371};}):[]});}}return{'count':_0x1cdc03[_0xe1dc('0x35')],'rows':_0x1cdc03};}else{return{'count':0x0,'rows':[]};}})[_0xe1dc('0x23')](respondWithResult(_0xd04957,null))['catch'](function(_0x24c385){var _0x1e9200=_0x56f55c['query'][_0xe1dc('0x7c')]?0x1f4:_0x24c385[_0xe1dc('0x7d')]||0x1f4;logger[_0xe1dc('0x25')](_0xe1dc('0x7e'),_0xe1dc('0x61'),_0x1e9200,JSON['stringify'](_0x24c385));delete _0x24c385['name'];if(_0x1e9200===0x191){_0x1e9200=0x190;}_0xd04957[_0xe1dc('0x17')](_0x1e9200)[_0xe1dc('0x28')](_0x56f55c[_0xe1dc('0x30')]['test']?{'message':_0xe1dc('0x7f'),'statusCode':_0x24c385[_0xe1dc('0x7d')]}:_0x24c385);});}; \ No newline at end of file +var _0x07c9=['../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','where','merge','includeAll','findAll','rows','params','include','options','find','catch','create','body','update','getConfigurations','findOne','ZohoConfiguration','length','filter','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','clientSecret','serverUrl','code','refreshToken','zoho.eu','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2a6604,_0x2682a4){var _0x49068c=function(_0x134826){while(--_0x134826){_0x2a6604['push'](_0x2a6604['shift']());}};_0x49068c(++_0x2682a4);}(_0x07c9,0x6f));var _0x907c=function(_0x1f74e0,_0x350511){_0x1f74e0=_0x1f74e0-0x0;var _0x2606bc=_0x07c9[_0x1f74e0];return _0x2606bc;};'use strict';var emlformat=require(_0x907c('0x0'));var rimraf=require(_0x907c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x907c('0x2'));var rp=require(_0x907c('0x3'));var moment=require(_0x907c('0x4'));var BPromise=require(_0x907c('0x5'));var Mustache=require(_0x907c('0x6'));var util=require(_0x907c('0x7'));var path=require(_0x907c('0x8'));var sox=require(_0x907c('0x9'));var csv=require(_0x907c('0xa'));var ejs=require(_0x907c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x907c('0xc'));var squel=require(_0x907c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x907c('0xe'));var toCsv=require(_0x907c('0xa'));var querystring=require(_0x907c('0xf'));var Papa=require(_0x907c('0x10'));var Redis=require(_0x907c('0x11'));var authService=require(_0x907c('0x12'));var qs=require(_0x907c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x907c('0x14'))('api');var utils=require(_0x907c('0x15'));var config=require(_0x907c('0x16'));var licenseUtil=require(_0x907c('0x17'));var db=require(_0x907c('0x18'))['db'];var integrations=require(_0x907c('0x19'));function respondWithStatusCode(_0x35ba40,_0x4e252d){_0x4e252d=_0x4e252d||0xcc;return function(_0x57e505){if(_0x57e505){return _0x35ba40[_0x907c('0x1a')](_0x4e252d);}return _0x35ba40[_0x907c('0x1b')](_0x4e252d)[_0x907c('0x1c')]();};}function respondWithResult(_0x1a2c47,_0x4f2f69){_0x4f2f69=_0x4f2f69||0xc8;return function(_0x5e151e){if(_0x5e151e){return _0x1a2c47[_0x907c('0x1b')](_0x4f2f69)['json'](_0x5e151e);}};}function respondWithFilteredResult(_0x5da4ec,_0x24beb4){return function(_0x2c6aa9){if(_0x2c6aa9){var _0x49e02c=typeof _0x24beb4['offset']===_0x907c('0x1d')&&typeof _0x24beb4['limit']===_0x907c('0x1d');var _0x3ccc66=_0x2c6aa9[_0x907c('0x1e')];var _0x323414=_0x49e02c?0x0:_0x24beb4[_0x907c('0x1f')];var _0x29db5c=_0x49e02c?_0x2c6aa9[_0x907c('0x1e')]:_0x24beb4[_0x907c('0x1f')]+_0x24beb4[_0x907c('0x20')];var _0x11b6ab;if(_0x29db5c>=_0x3ccc66){_0x29db5c=_0x3ccc66;_0x11b6ab=0xc8;}else{_0x11b6ab=0xce;}_0x5da4ec[_0x907c('0x1b')](_0x11b6ab);return _0x5da4ec['set'](_0x907c('0x21'),_0x323414+'-'+_0x29db5c+'/'+_0x3ccc66)['json'](_0x2c6aa9);}return null;};}function patchUpdates(_0x4dee41){return function(_0x1c9e03){try{jsonpatch[_0x907c('0x22')](_0x1c9e03,_0x4dee41,!![]);}catch(_0x5c9a46){return BPromise[_0x907c('0x23')](_0x5c9a46);}return _0x1c9e03[_0x907c('0x24')]();};}function saveUpdates(_0x4b2d2e,_0x48f82a){return function(_0x58a73d){if(_0x58a73d){return _0x58a73d['update'](_0x4b2d2e)['then'](function(_0x18e8a8){return _0x18e8a8;});}return null;};}function removeEntity(_0xdeecde,_0x3f56ad){return function(_0x29a966){if(_0x29a966){return _0x29a966[_0x907c('0x25')]()[_0x907c('0x26')](function(){_0xdeecde[_0x907c('0x1b')](0xcc)[_0x907c('0x1c')]();});}};}function handleEntityNotFound(_0x38a55b,_0x329895){return function(_0xd6ff59){if(!_0xd6ff59){_0x38a55b[_0x907c('0x1a')](0x194);}return _0xd6ff59;};}function handleError(_0x5c14f4,_0x576304){_0x576304=_0x576304||0x1f4;return function(_0x16bf45){logger[_0x907c('0x27')](_0x16bf45[_0x907c('0x28')]);if(_0x16bf45[_0x907c('0x29')]){delete _0x16bf45['name'];}_0x5c14f4[_0x907c('0x1b')](_0x576304)[_0x907c('0x2a')](_0x16bf45);};}exports[_0x907c('0x2b')]=function(_0x5ee598,_0x5da345){var _0x3171c4={},_0x530a1d={},_0x5b58ee={'count':0x0,'rows':[]};var _0x23f563=_[_0x907c('0x2c')](db[_0x907c('0x2d')][_0x907c('0x2e')],function(_0x1bf0d9){return{'name':_0x1bf0d9[_0x907c('0x2f')],'type':_0x1bf0d9['type'][_0x907c('0x30')]};});_0x530a1d[_0x907c('0x31')]=_[_0x907c('0x2c')](_0x23f563,_0x907c('0x29'));_0x530a1d[_0x907c('0x32')]=_[_0x907c('0x33')](_0x5ee598['query']);_0x530a1d['filters']=_[_0x907c('0x34')](_0x530a1d['model'],_0x530a1d[_0x907c('0x32')]);_0x3171c4[_0x907c('0x35')]=_[_0x907c('0x34')](_0x530a1d[_0x907c('0x31')],qs[_0x907c('0x36')](_0x5ee598[_0x907c('0x32')][_0x907c('0x36')]));_0x3171c4[_0x907c('0x35')]=_0x3171c4[_0x907c('0x35')]['length']?_0x3171c4['attributes']:_0x530a1d[_0x907c('0x31')];if(!_0x5ee598[_0x907c('0x32')]['hasOwnProperty'](_0x907c('0x37'))){_0x3171c4['limit']=qs['limit'](_0x5ee598[_0x907c('0x32')][_0x907c('0x20')]);_0x3171c4['offset']=qs['offset'](_0x5ee598[_0x907c('0x32')]['offset']);}_0x3171c4[_0x907c('0x38')]=qs['sort'](_0x5ee598[_0x907c('0x32')][_0x907c('0x39')]);_0x3171c4['where']=qs[_0x907c('0x3a')](_[_0x907c('0x3b')](_0x5ee598[_0x907c('0x32')],_0x530a1d[_0x907c('0x3a')]),_0x23f563);if(_0x5ee598['query']['filter']){_0x3171c4[_0x907c('0x3c')]=_[_0x907c('0x3d')](_0x3171c4[_0x907c('0x3c')],{'$or':_['map'](_0x23f563,function(_0x47e1b9){if(_0x47e1b9['type']!=='VIRTUAL'){var _0x51d754={};_0x51d754[_0x47e1b9['name']]={'$like':'%'+_0x5ee598[_0x907c('0x32')]['filter']+'%'};return _0x51d754;}})});}_0x3171c4=_[_0x907c('0x3d')]({},_0x3171c4,_0x5ee598['options']);var _0x39b7ed={'where':_0x3171c4[_0x907c('0x3c')]};return db[_0x907c('0x2d')]['count'](_0x39b7ed)[_0x907c('0x26')](function(_0x10b370){_0x5b58ee[_0x907c('0x1e')]=_0x10b370;if(_0x5ee598[_0x907c('0x32')][_0x907c('0x3e')]){_0x3171c4['include']=[{'all':!![]}];}return db[_0x907c('0x2d')][_0x907c('0x3f')](_0x3171c4);})['then'](function(_0x1f6be9){_0x5b58ee[_0x907c('0x40')]=_0x1f6be9;return _0x5b58ee;})[_0x907c('0x26')](respondWithFilteredResult(_0x5da345,_0x3171c4))['catch'](handleError(_0x5da345,null));};exports['show']=function(_0x12c632,_0x3d3bb4){var _0x261610={'raw':![],'where':{'id':_0x12c632[_0x907c('0x41')]['id']}},_0x2477fe={};_0x2477fe[_0x907c('0x31')]=_[_0x907c('0x33')](db[_0x907c('0x2d')][_0x907c('0x2e')]);_0x2477fe[_0x907c('0x32')]=_[_0x907c('0x33')](_0x12c632['query']);_0x2477fe['filters']=_['intersection'](_0x2477fe['model'],_0x2477fe[_0x907c('0x32')]);_0x261610['attributes']=_[_0x907c('0x34')](_0x2477fe[_0x907c('0x31')],qs[_0x907c('0x36')](_0x12c632['query'][_0x907c('0x36')]));_0x261610[_0x907c('0x35')]=_0x261610[_0x907c('0x35')]['length']?_0x261610[_0x907c('0x35')]:_0x2477fe[_0x907c('0x31')];if(_0x12c632[_0x907c('0x32')][_0x907c('0x3e')]){_0x261610[_0x907c('0x42')]=[{'all':!![]}];}_0x261610=_[_0x907c('0x3d')]({},_0x261610,_0x12c632[_0x907c('0x43')]);return db[_0x907c('0x2d')][_0x907c('0x44')](_0x261610)['then'](handleEntityNotFound(_0x3d3bb4,null))['then'](respondWithResult(_0x3d3bb4,null))[_0x907c('0x45')](handleError(_0x3d3bb4,null));};exports[_0x907c('0x46')]=function(_0x55439c,_0x243c55){return db[_0x907c('0x2d')][_0x907c('0x46')](_0x55439c[_0x907c('0x47')],{})[_0x907c('0x26')](respondWithResult(_0x243c55,0xc9))[_0x907c('0x45')](handleError(_0x243c55,null));};exports[_0x907c('0x48')]=function(_0x541a18,_0xe960ae){if(_0x541a18['body']['id']){delete _0x541a18[_0x907c('0x47')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x541a18['params']['id']}})[_0x907c('0x26')](handleEntityNotFound(_0xe960ae,null))[_0x907c('0x26')](saveUpdates(_0x541a18[_0x907c('0x47')],null))[_0x907c('0x26')](respondWithResult(_0xe960ae,null))[_0x907c('0x45')](handleError(_0xe960ae,null));};exports['destroy']=function(_0x26241c,_0x1d30f6){return db[_0x907c('0x2d')][_0x907c('0x44')]({'where':{'id':_0x26241c['params']['id']}})[_0x907c('0x26')](handleEntityNotFound(_0x1d30f6,null))[_0x907c('0x26')](removeEntity(_0x1d30f6,null))[_0x907c('0x45')](handleError(_0x1d30f6,null));};exports[_0x907c('0x49')]=function(_0x2f78ac,_0x4a946a,_0x21f149){var _0x37c9b2={};var _0x49322b={};var _0x26fa64;var _0x4be840;return db[_0x907c('0x2d')][_0x907c('0x4a')]({'where':{'id':_0x2f78ac[_0x907c('0x41')]['id']}})[_0x907c('0x26')](handleEntityNotFound(_0x4a946a,null))[_0x907c('0x26')](function(_0x26dc88){if(_0x26dc88){_0x26fa64=_0x26dc88;_0x49322b['model']=_[_0x907c('0x33')](db[_0x907c('0x4b')][_0x907c('0x2e')]);_0x49322b[_0x907c('0x32')]=_[_0x907c('0x33')](_0x2f78ac[_0x907c('0x32')]);_0x49322b['filters']=_[_0x907c('0x34')](_0x49322b['model'],_0x49322b[_0x907c('0x32')]);_0x37c9b2[_0x907c('0x35')]=_[_0x907c('0x34')](_0x49322b['model'],qs[_0x907c('0x36')](_0x2f78ac['query'][_0x907c('0x36')]));_0x37c9b2[_0x907c('0x35')]=_0x37c9b2[_0x907c('0x35')][_0x907c('0x4c')]?_0x37c9b2[_0x907c('0x35')]:_0x49322b['model'];_0x37c9b2[_0x907c('0x38')]=qs[_0x907c('0x39')](_0x2f78ac[_0x907c('0x32')][_0x907c('0x39')]);_0x37c9b2[_0x907c('0x3c')]=qs['filters'](_[_0x907c('0x3b')](_0x2f78ac[_0x907c('0x32')],_0x49322b['filters']));if(_0x2f78ac['query'][_0x907c('0x4d')]){_0x37c9b2[_0x907c('0x3c')]=_[_0x907c('0x3d')](_0x37c9b2['where'],{'$or':_[_0x907c('0x2c')](_0x37c9b2[_0x907c('0x35')],function(_0x21f00d){var _0x387767={};_0x387767[_0x21f00d]={'$like':'%'+_0x2f78ac['query'][_0x907c('0x4d')]+'%'};return _0x387767;})});}_0x37c9b2=_[_0x907c('0x3d')]({},_0x37c9b2,_0x2f78ac[_0x907c('0x43')]);return _0x26fa64['getConfigurations'](_0x37c9b2);}})[_0x907c('0x26')](function(_0x5488e1){if(_0x5488e1){_0x4be840=_0x5488e1[_0x907c('0x4c')];if(!_0x2f78ac['query']['hasOwnProperty'](_0x907c('0x37'))){_0x37c9b2[_0x907c('0x20')]=qs[_0x907c('0x20')](_0x2f78ac[_0x907c('0x32')][_0x907c('0x20')]);_0x37c9b2[_0x907c('0x1f')]=qs[_0x907c('0x1f')](_0x2f78ac[_0x907c('0x32')][_0x907c('0x1f')]);}return _0x26fa64[_0x907c('0x49')](_0x37c9b2);}})['then'](function(_0xd2f556){if(_0xd2f556){return _0xd2f556?{'count':_0x4be840,'rows':_0xd2f556}:null;}})[_0x907c('0x26')](respondWithResult(_0x4a946a,null))[_0x907c('0x45')](handleError(_0x4a946a,null));};exports['addConfiguration']=function(_0x298924,_0x5d1f23,_0xf23b4f){if(_0x298924[_0x907c('0x47')]['id']){delete _0x298924['body']['id'];}return db[_0x907c('0x2d')][_0x907c('0x4a')]({'where':{'id':_0x298924[_0x907c('0x41')]['id']}})[_0x907c('0x26')](handleEntityNotFound(_0x5d1f23,null))[_0x907c('0x26')](function(_0x54df3f){if(_0x54df3f){_0x298924[_0x907c('0x47')][_0x907c('0x4e')]=_0x54df3f['id'];_0x298924[_0x907c('0x47')][_0x907c('0x4f')]=integrations[_0x907c('0x50')](_0x298924[_0x907c('0x47')][_0x907c('0x51')],_0x298924[_0x907c('0x47')][_0x907c('0x52')]);_0x298924['body'][_0x907c('0x53')]=integrations[_0x907c('0x54')](_0x298924['body'][_0x907c('0x51')],_0x298924[_0x907c('0x47')]['type']);return db[_0x907c('0x4b')][_0x907c('0x46')](_0x298924[_0x907c('0x47')],{'include':[{'model':db[_0x907c('0x55')],'as':_0x907c('0x4f')},{'model':db[_0x907c('0x55')],'as':'Descriptions'}]});}return null;})[_0x907c('0x26')](respondWithResult(_0x5d1f23,null))[_0x907c('0x45')](handleError(_0x5d1f23,null));};function getAccessToken(_0x3db5c7){return new Promise(function(_0x5d89fc,_0x161f73){var _0x15481f;switch(_0x3db5c7['zone']){case'US':_0x15481f=_0x907c('0x56');break;case'AU':_0x15481f=_0x907c('0x57');break;case'EU':_0x15481f=_0x907c('0x58');break;case'IN':_0x15481f=_0x907c('0x59');break;case'CN':_0x15481f=_0x907c('0x5a');break;default:_0x15481f=_0x907c('0x58');break;}var _0x5a8f1d={'method':_0x907c('0x5b'),'uri':_0x15481f+_0x907c('0x5c'),'qs':{'refresh_token':_0x3db5c7['refreshToken'],'client_id':_0x3db5c7[_0x907c('0x5d')],'client_secret':_0x3db5c7['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5a8f1d)[_0x907c('0x26')](function(_0xa735f8){if(_0xa735f8[_0x907c('0x5e')]){_0x5d89fc(_0xa735f8[_0x907c('0x5e')]);}else{_0x161f73(_0x907c('0x5f'));}})['catch'](function(_0x4fcde2){_0x161f73(_0x4fcde2);});});}exports['getFields']=function(_0x5c0b26,_0x4f4240,_0x7b8f0){var _0x181f54,_0x83fe94,_0x2cb283,_0x546dee,_0x2a506e;return db[_0x907c('0x2d')]['findOne']({'where':{'id':_0x5c0b26[_0x907c('0x41')]['id']},'attributes':['id',_0x907c('0x60'),_0x907c('0x61'),_0x907c('0x5d'),_0x907c('0x62'),_0x907c('0x63'),_0x907c('0x64'),_0x907c('0x65')]})[_0x907c('0x26')](handleEntityNotFound(_0x4f4240,null))[_0x907c('0x26')](function(_0x574073){_0x2a506e=_0x574073;_0x181f54=_0x2a506e[_0x907c('0x60')];_0x83fe94=_0x181f54===_0x907c('0x66')?'eu':'com';_0x2cb283=_0x2a506e[_0x907c('0x63')];var _0x267409=_0x2cb283[_0x907c('0x67')](-0x1);if(_0x267409==='/'||_0x267409==='\x5c'||_0x267409===':'){_0x2cb283=_0x2cb283[_0x907c('0x68')](0x0,_0x2cb283[_0x907c('0x69')](_0x267409));}if(!_0x2a506e[_0x907c('0x65')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2a506e);})[_0x907c('0x26')](function(_0x22b5fd){if(_0x22b5fd){return rp({'method':_0x907c('0x6a'),'uri':util['format'](_0x907c('0x6b'),_0x83fe94),'qs':{'module':'Calls'},'headers':{'Authorization':_0x907c('0x6c')+_0x22b5fd},'json':!![]});}})['then'](function(_0x1c7c6e){if(_0x1c7c6e){if(_0x1c7c6e[_0x907c('0x6d')]&&_0x1c7c6e[_0x907c('0x6d')][_0x907c('0x27')]){throw new Error(_0x1c7c6e[_0x907c('0x6d')][_0x907c('0x27')]['message']);}var _0x15e8b8=[];var _0x1edc89=[];var _0x276cab=[_0x907c('0x6e'),_0x907c('0x6f'),_0x907c('0x70'),_0x907c('0x71'),_0x907c('0x72'),_0x907c('0x73'),'Call_Start_Time',_0x907c('0x74')];_0x1edc89=_[_0x907c('0x75')](_0x1c7c6e[_0x907c('0x36')],function(_0x259216){return _0x276cab[_0x907c('0x76')](_0x259216['api_name']);});for(var _0x5dc59d=0x0;_0x5dc59d<_0x1edc89[_0x907c('0x4c')];_0x5dc59d++){if(_0x1edc89[_0x5dc59d][_0x907c('0x77')]===![]){_0x15e8b8[_0x907c('0x78')]({'id':_0x1edc89[_0x5dc59d]['id'],'name':_0x1edc89[_0x5dc59d][_0x907c('0x79')],'custom':_0x1edc89[_0x5dc59d][_0x907c('0x7a')],'options':_0x1edc89[_0x5dc59d][_0x907c('0x7b')]===_0x907c('0x7c')&&_0x1edc89[_0x5dc59d][_0x907c('0x7d')][_0x907c('0x4c')]>-0x1?_[_0x907c('0x2c')](_0x1edc89[_0x5dc59d][_0x907c('0x7d')],function(_0x44bcb6){return{'name':_0x44bcb6,'value':_0x44bcb6};}):[]});}}return{'count':_0x15e8b8[_0x907c('0x4c')],'rows':_0x15e8b8};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4f4240,null))[_0x907c('0x45')](function(_0x501be5){var _0x591a04=_0x5c0b26[_0x907c('0x32')][_0x907c('0x7e')]?0x1f4:_0x501be5[_0x907c('0x7f')]||0x1f4;logger[_0x907c('0x27')](_0x907c('0x80'),'getFields',_0x591a04,JSON[_0x907c('0x81')](_0x501be5));delete _0x501be5[_0x907c('0x29')];if(_0x591a04===0x191){_0x591a04=0x190;}_0x4f4240[_0x907c('0x1b')](_0x591a04)[_0x907c('0x2a')](_0x5c0b26[_0x907c('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x501be5[_0x907c('0x7f')]}:_0x501be5);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 1a00f21..ba550b5 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 _0x48cb=['inspect','catch','name','https://accounts.zoho.com','POST','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x36a479,_0x30abcb){var _0xe08592=function(_0x16a301){while(--_0x16a301){_0x36a479['push'](_0x36a479['shift']());}};_0xe08592(++_0x30abcb);}(_0x48cb,0x14d));var _0xb48c=function(_0xe4f1c0,_0x17dae3){_0xe4f1c0=_0xe4f1c0-0x0;var _0x16e788=_0x48cb[_0xe4f1c0];return _0x16e788;};'use strict';var _=require(_0xb48c('0x0'));var util=require('util');var logger=require(_0xb48c('0x1'))('api');var moment=require(_0xb48c('0x2'));var BPromise=require(_0xb48c('0x3'));var rp=require(_0xb48c('0x4'));var fs=require('fs');var path=require(_0xb48c('0x5'));var rimraf=require(_0xb48c('0x6'));var config=require(_0xb48c('0x7'));var attributes=require(_0xb48c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xb48c('0x9')]=function(_0x57939f,_0xb4d5b2){return _0x57939f[_0xb48c('0xa')]('ZohoAccount',attributes,{'tableName':_0xb48c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27ecff,_0x49c57f,_0x5dfcae){if(_0x27ecff[_0xb48c('0xc')](_0xb48c('0xd'))||_0x27ecff['changed'](_0xb48c('0xe'))||_0x27ecff[_0xb48c('0xc')](_0xb48c('0xf'))||_0x27ecff[_0xb48c('0xc')](_0xb48c('0x10'))||_0x27ecff[_0xb48c('0xc')](_0xb48c('0x11'))||_0x27ecff[_0xb48c('0xc')](_0xb48c('0x12'))){var _0x2240a3,_0x286d97;_0x2240a3=_0x27ecff['serverUrl'];var _0xbceb89=_0x2240a3['slice'](-0x1);if(_0xbceb89==='/'||_0xbceb89==='\x5c'||_0xbceb89===':'){_0x2240a3=_0x2240a3[_0xb48c('0x13')](0x0,_0x2240a3[_0xb48c('0x14')](_0xbceb89));}switch(_0x27ecff[_0xb48c('0xd')]){case'US':_0x286d97='https://accounts.zoho.com';break;case'AU':_0x286d97=_0xb48c('0x15');break;case'IN':_0x286d97=_0xb48c('0x16');break;case'CN':_0x286d97=_0xb48c('0x17');break;default:_0x286d97='https://accounts.zoho.eu';break;}var _0x56c87f={'method':'POST','uri':_0x286d97+_0xb48c('0x18'),'form':{'grant_type':_0xb48c('0x19'),'client_id':_0x27ecff['clientId'],'client_secret':_0x27ecff[_0xb48c('0x10')],'redirect_uri':_0x27ecff[_0xb48c('0xe')],'code':_0x27ecff[_0xb48c('0x11')]},'headers':{'Content-Type':_0xb48c('0x1a')}};return rp(_0x56c87f)[_0xb48c('0x1b')](function(_0x774dbc){var _0x48e7b2=JSON[_0xb48c('0x1c')](_0x774dbc);if(_0x48e7b2[_0xb48c('0x1d')]){_0x27ecff[_0xb48c('0x1e')]=_0x48e7b2[_0xb48c('0x1d')];logger[_0xb48c('0x1f')](util[_0xb48c('0x20')](_0xb48c('0x21'),_0x27ecff['name'],_0x27ecff['id']));}else{logger[_0xb48c('0x22')](util[_0xb48c('0x20')](_0xb48c('0x23'),_0x27ecff['name'],_0x27ecff['id']),util[_0xb48c('0x24')](_0x48e7b2,{'showHidden':![],'depth':null}));}return _0x5dfcae(null,_0x49c57f);})[_0xb48c('0x25')](function(_0x334ebd){logger[_0xb48c('0x22')](util[_0xb48c('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x27ecff[_0xb48c('0x26')],_0x27ecff['id']),util[_0xb48c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x5dfcae(_0x334ebd);});}else{return _0x5dfcae(null,_0x49c57f);}},'beforeUpdate':function(_0x6550d5,_0x3a46f8,_0x161326){if(_0x6550d5[_0xb48c('0xc')](_0xb48c('0xd'))||_0x6550d5[_0xb48c('0xc')]('serverUrl')||_0x6550d5[_0xb48c('0xc')]('clientId')||_0x6550d5['changed']('clientSecret')||_0x6550d5[_0xb48c('0xc')](_0xb48c('0x11'))||_0x6550d5['changed'](_0xb48c('0x12'))){var _0x3bfcf5,_0x3bcb52;_0x3bfcf5=_0x6550d5['serverUrl'];var _0x506a94=_0x3bfcf5['slice'](-0x1);if(_0x506a94==='/'||_0x506a94==='\x5c'||_0x506a94===':'){_0x3bfcf5=_0x3bfcf5[_0xb48c('0x13')](0x0,_0x3bfcf5[_0xb48c('0x14')](_0x506a94));}switch(_0x6550d5[_0xb48c('0xd')]){case'US':_0x3bcb52=_0xb48c('0x27');break;case'AU':_0x3bcb52='https://accounts.zoho.com.au';break;case'IN':_0x3bcb52=_0xb48c('0x16');break;case'CN':_0x3bcb52=_0xb48c('0x17');break;default:_0x3bcb52='https://accounts.zoho.eu';break;}var _0x296db6={'method':_0xb48c('0x28'),'uri':_0x3bcb52+_0xb48c('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x6550d5[_0xb48c('0xf')],'client_secret':_0x6550d5['clientSecret'],'redirect_uri':_0x6550d5[_0xb48c('0xe')],'code':_0x6550d5['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x296db6)[_0xb48c('0x1b')](function(_0x3d4782){var _0x387ccd=JSON[_0xb48c('0x1c')](_0x3d4782);if(_0x387ccd[_0xb48c('0x1d')]){_0x6550d5[_0xb48c('0x1e')]=_0x387ccd[_0xb48c('0x1d')];logger[_0xb48c('0x1f')](util[_0xb48c('0x20')](_0xb48c('0x21'),_0x6550d5[_0xb48c('0x26')],_0x6550d5['id']));}else{logger[_0xb48c('0x22')](util['format'](_0xb48c('0x23'),_0x6550d5[_0xb48c('0x26')],_0x6550d5['id']),util[_0xb48c('0x24')](_0x387ccd,{'showHidden':![],'depth':null}));}return _0x161326(null,_0x3a46f8);})[_0xb48c('0x25')](function(_0x53b5f4){logger['error'](util[_0xb48c('0x20')](_0xb48c('0x23'),_0x6550d5[_0xb48c('0x26')],_0x6550d5['id']),util[_0xb48c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x161326(_0x53b5f4);});}else{return _0x161326(null,_0x3a46f8);}}}});}; \ No newline at end of file +var _0x5e9a=['https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','clientSecret','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','name','format','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','lodash','util','../../config/logger','api','request-promise','path','rimraf','./intZohoAccount.attributes','define','changed','zone','serverUrl','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5e9a,0x160));var _0xa5e9=function(_0x1e117b,_0x5e0e9e){_0x1e117b=_0x1e117b-0x0;var _0x5ea37e=_0x5e9a[_0x1e117b];return _0x5ea37e;};'use strict';var _=require(_0xa5e9('0x0'));var util=require(_0xa5e9('0x1'));var logger=require(_0xa5e9('0x2'))(_0xa5e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa5e9('0x4'));var fs=require('fs');var path=require(_0xa5e9('0x5'));var rimraf=require(_0xa5e9('0x6'));var config=require('../../config/environment');var attributes=require(_0xa5e9('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x126d09,_0x251e1c){return _0x126d09[_0xa5e9('0x8')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b1191,_0x578d49,_0x74fa93){if(_0x5b1191[_0xa5e9('0x9')](_0xa5e9('0xa'))||_0x5b1191['changed'](_0xa5e9('0xb'))||_0x5b1191['changed']('clientId')||_0x5b1191[_0xa5e9('0x9')]('clientSecret')||_0x5b1191[_0xa5e9('0x9')](_0xa5e9('0xc'))||_0x5b1191[_0xa5e9('0x9')](_0xa5e9('0xd'))){var _0x2d30c3,_0x592aad;_0x2d30c3=_0x5b1191[_0xa5e9('0xb')];var _0x4325d8=_0x2d30c3[_0xa5e9('0xe')](-0x1);if(_0x4325d8==='/'||_0x4325d8==='\x5c'||_0x4325d8===':'){_0x2d30c3=_0x2d30c3['substring'](0x0,_0x2d30c3[_0xa5e9('0xf')](_0x4325d8));}switch(_0x5b1191[_0xa5e9('0xa')]){case'US':_0x592aad=_0xa5e9('0x10');break;case'AU':_0x592aad=_0xa5e9('0x11');break;case'IN':_0x592aad=_0xa5e9('0x12');break;case'CN':_0x592aad=_0xa5e9('0x13');break;default:_0x592aad=_0xa5e9('0x14');break;}var _0x4382e1={'method':_0xa5e9('0x15'),'uri':_0x592aad+_0xa5e9('0x16'),'form':{'grant_type':_0xa5e9('0x17'),'client_id':_0x5b1191[_0xa5e9('0x18')],'client_secret':_0x5b1191[_0xa5e9('0x19')],'redirect_uri':_0x5b1191['serverUrl'],'code':_0x5b1191[_0xa5e9('0xc')]},'headers':{'Content-Type':_0xa5e9('0x1a')}};return rp(_0x4382e1)[_0xa5e9('0x1b')](function(_0x55fdfd){var _0x3a95ae=JSON['parse'](_0x55fdfd);if(_0x3a95ae[_0xa5e9('0x1c')]){_0x5b1191[_0xa5e9('0x1d')]=_0x3a95ae[_0xa5e9('0x1c')];logger[_0xa5e9('0x1e')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5b1191[_0xa5e9('0x1f')],_0x5b1191['id']));}else{logger['error'](util[_0xa5e9('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5b1191['name'],_0x5b1191['id']),util[_0xa5e9('0x21')](_0x3a95ae,{'showHidden':![],'depth':null}));}return _0x74fa93(null,_0x578d49);})['catch'](function(_0x4b7f17){logger['error'](util[_0xa5e9('0x20')](_0xa5e9('0x22'),_0x5b1191[_0xa5e9('0x1f')],_0x5b1191['id']),util[_0xa5e9('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x74fa93(_0x4b7f17);});}else{return _0x74fa93(null,_0x578d49);}},'beforeUpdate':function(_0x44fb26,_0x44038b,_0x32ff93){if(_0x44fb26[_0xa5e9('0x9')](_0xa5e9('0xa'))||_0x44fb26['changed']('serverUrl')||_0x44fb26['changed'](_0xa5e9('0x18'))||_0x44fb26[_0xa5e9('0x9')]('clientSecret')||_0x44fb26['changed']('code')||_0x44fb26[_0xa5e9('0x9')](_0xa5e9('0xd'))){var _0x42fa77,_0x2e72ad;_0x42fa77=_0x44fb26[_0xa5e9('0xb')];var _0x28a6e4=_0x42fa77['slice'](-0x1);if(_0x28a6e4==='/'||_0x28a6e4==='\x5c'||_0x28a6e4===':'){_0x42fa77=_0x42fa77['substring'](0x0,_0x42fa77[_0xa5e9('0xf')](_0x28a6e4));}switch(_0x44fb26[_0xa5e9('0xa')]){case'US':_0x2e72ad=_0xa5e9('0x10');break;case'AU':_0x2e72ad='https://accounts.zoho.com.au';break;case'IN':_0x2e72ad=_0xa5e9('0x12');break;case'CN':_0x2e72ad=_0xa5e9('0x13');break;default:_0x2e72ad=_0xa5e9('0x14');break;}var _0x32973e={'method':_0xa5e9('0x15'),'uri':_0x2e72ad+_0xa5e9('0x16'),'form':{'grant_type':_0xa5e9('0x17'),'client_id':_0x44fb26[_0xa5e9('0x18')],'client_secret':_0x44fb26[_0xa5e9('0x19')],'redirect_uri':_0x44fb26[_0xa5e9('0xb')],'code':_0x44fb26['code']},'headers':{'Content-Type':_0xa5e9('0x1a')}};return rp(_0x32973e)[_0xa5e9('0x1b')](function(_0xbb7ab8){var _0x4fa6bf=JSON['parse'](_0xbb7ab8);if(_0x4fa6bf[_0xa5e9('0x1c')]){_0x44fb26[_0xa5e9('0x1d')]=_0x4fa6bf[_0xa5e9('0x1c')];logger[_0xa5e9('0x1e')](util[_0xa5e9('0x20')](_0xa5e9('0x23'),_0x44fb26[_0xa5e9('0x1f')],_0x44fb26['id']));}else{logger[_0xa5e9('0x24')](util[_0xa5e9('0x20')](_0xa5e9('0x22'),_0x44fb26[_0xa5e9('0x1f')],_0x44fb26['id']),util['inspect'](_0x4fa6bf,{'showHidden':![],'depth':null}));}return _0x32ff93(null,_0x44038b);})['catch'](function(_0x49ed9e){logger[_0xa5e9('0x24')](util['format'](_0xa5e9('0x22'),_0x44fb26[_0xa5e9('0x1f')],_0x44fb26['id']),util[_0xa5e9('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x32ff93(_0x49ed9e);});}else{return _0x32ff93(null,_0x44038b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 4cdf3cf..644b76b 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 _0x3445=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','ZohoAccount','options','where','attributes','limit','map','include','model','ShowZohoAccount','find','lodash','util','moment'];(function(_0x54891f,_0x52d9b0){var _0x59c5f0=function(_0x4a165c){while(--_0x4a165c){_0x54891f['push'](_0x54891f['shift']());}};_0x59c5f0(++_0x52d9b0);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});}exports[_0x5344('0x17')]=function(_0x215fbd){var _0x517b16=this;return new Promise(function(_0x4fb036,_0x508e34){return db[_0x5344('0x18')]['findAll']({'raw':_0x215fbd['options']?_0x215fbd['options']['raw']===undefined?!![]:![]:!![],'where':_0x215fbd[_0x5344('0x19')]?_0x215fbd[_0x5344('0x19')][_0x5344('0x1a')]||null:null,'attributes':_0x215fbd[_0x5344('0x19')]?_0x215fbd[_0x5344('0x19')][_0x5344('0x1b')]||null:null,'limit':_0x215fbd[_0x5344('0x19')]?_0x215fbd[_0x5344('0x19')][_0x5344('0x1c')]||null:null,'include':_0x215fbd[_0x5344('0x19')]?_0x215fbd['options']['include']?_[_0x5344('0x1d')](_0x215fbd[_0x5344('0x19')][_0x5344('0x1e')],function(_0x434e0d){return{'model':db[_0x434e0d[_0x5344('0x1f')]],'as':_0x434e0d['as'],'attributes':_0x434e0d['attributes'],'include':_0x434e0d[_0x5344('0x1e')]?_[_0x5344('0x1d')](_0x434e0d[_0x5344('0x1e')],function(_0x477c0a){return{'model':db[_0x477c0a['model']],'as':_0x477c0a['as'],'attributes':_0x477c0a[_0x5344('0x1b')],'include':_0x477c0a[_0x5344('0x1e')]?_[_0x5344('0x1d')](_0x477c0a[_0x5344('0x1e')],function(_0x4c120c){return{'model':db[_0x4c120c['model']],'as':_0x4c120c['as'],'attributes':_0x4c120c[_0x5344('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5344('0xb')](function(_0x3471a9){logger[_0x5344('0xc')]('GetZohoAccount',_0x215fbd);logger[_0x5344('0xe')](_0x5344('0x17'),_0x215fbd,JSON[_0x5344('0x10')](_0x3471a9));_0x4fb036(_0x3471a9);})[_0x5344('0x16')](function(_0x1867d6){logger[_0x5344('0x11')](_0x5344('0x17'),_0x1867d6['message'],_0x215fbd);_0x508e34(_0x517b16[_0x5344('0x11')](0x1f4,_0x1867d6['message']));});});};exports[_0x5344('0x20')]=function(_0x2ad28e){var _0x3dbb4e=this;return new Promise(function(_0xdaa060,_0x43a1e2){return db[_0x5344('0x18')][_0x5344('0x21')]({'raw':_0x2ad28e[_0x5344('0x19')]?_0x2ad28e[_0x5344('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2ad28e[_0x5344('0x19')]?_0x2ad28e[_0x5344('0x19')][_0x5344('0x1a')]||null:null,'attributes':_0x2ad28e[_0x5344('0x19')]?_0x2ad28e['options'][_0x5344('0x1b')]||null:null,'include':_0x2ad28e[_0x5344('0x19')]?_0x2ad28e['options'][_0x5344('0x1e')]?_[_0x5344('0x1d')](_0x2ad28e['options'][_0x5344('0x1e')],function(_0x3c0988){return{'model':db[_0x3c0988['model']],'as':_0x3c0988['as'],'attributes':_0x3c0988[_0x5344('0x1b')],'include':_0x3c0988[_0x5344('0x1e')]?_['map'](_0x3c0988[_0x5344('0x1e')],function(_0x332a1d){return{'model':db[_0x332a1d[_0x5344('0x1f')]],'as':_0x332a1d['as'],'attributes':_0x332a1d[_0x5344('0x1b')],'include':_0x332a1d[_0x5344('0x1e')]?_['map'](_0x332a1d['include'],function(_0x3fafb1){return{'model':db[_0x3fafb1['model']],'as':_0x3fafb1['as'],'attributes':_0x3fafb1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a430){logger[_0x5344('0xc')](_0x5344('0x20'),_0x2ad28e);logger['debug'](_0x5344('0x20'),_0x2ad28e,JSON['stringify'](_0x45a430));_0xdaa060(_0x45a430);})['catch'](function(_0x5e812f){logger[_0x5344('0x11')](_0x5344('0x20'),_0x5e812f[_0x5344('0x13')],_0x2ad28e);_0x43a1e2(_0x3dbb4e[_0x5344('0x11')](0x1f4,_0x5e812f[_0x5344('0x13')]));});});}; \ No newline at end of file +var _0x404d=['stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','find','debug','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ZohoAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1b750b,_0x169ef9){var _0xd300b3=function(_0x244e01){while(--_0x244e01){_0x1b750b['push'](_0x1b750b['shift']());}};_0xd300b3(++_0x169ef9);}(_0x404d,0x1e9));var _0xd404=function(_0x1010f0,_0x5b5042){_0x1010f0=_0x1010f0-0x0;var _0x5617a1=_0x404d[_0x1010f0];return _0x5617a1;};'use strict';var _=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var moment=require(_0xd404('0x2'));var BPromise=require(_0xd404('0x3'));var rs=require(_0xd404('0x4'));var fs=require('fs');var Redis=require(_0xd404('0x5'));var db=require(_0xd404('0x6'))['db'];var utils=require(_0xd404('0x7'));var logger=require(_0xd404('0x8'))('rpc');var config=require(_0xd404('0x9'));var jayson=require(_0xd404('0xa'));var client=jayson['client'][_0xd404('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7faf39,_0x5da99f,_0x5c335f){return new BPromise(function(_0x10021a,_0x3d7e8a){return client['request'](_0x7faf39,_0x5c335f)['then'](function(_0x3096f0){logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5da99f,_0xd404('0xe'),JSON[_0xd404('0xf')](_0x3096f0));if(_0x3096f0['error']){if(_0x3096f0[_0xd404('0x10')][_0xd404('0x11')]===0x1f4){logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x3d7e8a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}logger[_0xd404('0x10')](_0xd404('0xd'),_0x5da99f,_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);return _0x10021a(_0x3096f0[_0xd404('0x10')][_0xd404('0x12')]);}else{logger[_0xd404('0xc')](_0xd404('0xd'),_0x5da99f,_0xd404('0xe'));_0x10021a(_0x3096f0[_0xd404('0x13')][_0xd404('0x12')]);}})[_0xd404('0x14')](function(_0x155186){logger['error'](_0xd404('0xd'),_0x5da99f,_0x155186);_0x3d7e8a(_0x155186);});});}exports[_0xd404('0x15')]=function(_0x5e19e4){var _0x3a5a16=this;return new Promise(function(_0x149fa5,_0x5e15c0){return db[_0xd404('0x16')][_0xd404('0x17')]({'raw':_0x5e19e4[_0xd404('0x18')]?_0x5e19e4['options'][_0xd404('0x19')]===undefined?!![]:![]:!![],'where':_0x5e19e4[_0xd404('0x18')]?_0x5e19e4[_0xd404('0x18')][_0xd404('0x1a')]||null:null,'attributes':_0x5e19e4[_0xd404('0x18')]?_0x5e19e4[_0xd404('0x18')][_0xd404('0x1b')]||null:null,'limit':_0x5e19e4['options']?_0x5e19e4[_0xd404('0x18')][_0xd404('0x1c')]||null:null,'include':_0x5e19e4['options']?_0x5e19e4[_0xd404('0x18')]['include']?_['map'](_0x5e19e4[_0xd404('0x18')][_0xd404('0x1d')],function(_0x133232){return{'model':db[_0x133232[_0xd404('0x1e')]],'as':_0x133232['as'],'attributes':_0x133232['attributes'],'include':_0x133232[_0xd404('0x1d')]?_[_0xd404('0x1f')](_0x133232[_0xd404('0x1d')],function(_0x55cfde){return{'model':db[_0x55cfde['model']],'as':_0x55cfde['as'],'attributes':_0x55cfde[_0xd404('0x1b')],'include':_0x55cfde[_0xd404('0x1d')]?_[_0xd404('0x1f')](_0x55cfde[_0xd404('0x1d')],function(_0x1ddf0d){return{'model':db[_0x1ddf0d[_0xd404('0x1e')]],'as':_0x1ddf0d['as'],'attributes':_0x1ddf0d[_0xd404('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd404('0x20')](function(_0x586b97){logger['info'](_0xd404('0x15'),_0x5e19e4);logger['debug'](_0xd404('0x15'),_0x5e19e4,JSON['stringify'](_0x586b97));_0x149fa5(_0x586b97);})[_0xd404('0x14')](function(_0x1e6341){logger[_0xd404('0x10')](_0xd404('0x15'),_0x1e6341[_0xd404('0x12')],_0x5e19e4);_0x5e15c0(_0x3a5a16[_0xd404('0x10')](0x1f4,_0x1e6341[_0xd404('0x12')]));});});};exports['ShowZohoAccount']=function(_0x585b67){var _0xc60d87=this;return new Promise(function(_0x541c78,_0x51663f){return db[_0xd404('0x16')][_0xd404('0x21')]({'raw':_0x585b67[_0xd404('0x18')]?_0x585b67['options'][_0xd404('0x19')]===undefined?!![]:![]:!![],'where':_0x585b67['options']?_0x585b67[_0xd404('0x18')][_0xd404('0x1a')]||null:null,'attributes':_0x585b67['options']?_0x585b67[_0xd404('0x18')][_0xd404('0x1b')]||null:null,'include':_0x585b67[_0xd404('0x18')]?_0x585b67[_0xd404('0x18')][_0xd404('0x1d')]?_['map'](_0x585b67[_0xd404('0x18')][_0xd404('0x1d')],function(_0x39a3d0){return{'model':db[_0x39a3d0['model']],'as':_0x39a3d0['as'],'attributes':_0x39a3d0[_0xd404('0x1b')],'include':_0x39a3d0[_0xd404('0x1d')]?_[_0xd404('0x1f')](_0x39a3d0[_0xd404('0x1d')],function(_0x5a6389){return{'model':db[_0x5a6389['model']],'as':_0x5a6389['as'],'attributes':_0x5a6389[_0xd404('0x1b')],'include':_0x5a6389[_0xd404('0x1d')]?_[_0xd404('0x1f')](_0x5a6389[_0xd404('0x1d')],function(_0x3ad796){return{'model':db[_0x3ad796[_0xd404('0x1e')]],'as':_0x3ad796['as'],'attributes':_0x3ad796['attributes']};}):[]};}):[]};}):[]:[]})[_0xd404('0x20')](function(_0xd143f3){logger[_0xd404('0xc')]('ShowZohoAccount',_0x585b67);logger[_0xd404('0x22')](_0xd404('0x23'),_0x585b67,JSON[_0xd404('0xf')](_0xd143f3));_0x541c78(_0xd143f3);})['catch'](function(_0x32d376){logger[_0xd404('0x10')](_0xd404('0x23'),_0x32d376['message'],_0x585b67);_0x51663f(_0xc60d87[_0xd404('0x10')](0x1f4,_0x32d376[_0xd404('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1ff83f6..ffc8f67 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 _0x4f89=['getDescriptions','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x415062,_0x1ee7e8){var _0x33b9e5=function(_0x4110fb){while(--_0x4110fb){_0x415062['push'](_0x415062['shift']());}};_0x33b9e5(++_0x1ee7e8);}(_0x4f89,0x90));var _0x94f8=function(_0x5e2be7,_0x54d69c){_0x5e2be7=_0x5e2be7-0x0;var _0x18997a=_0x4f89[_0x5e2be7];return _0x18997a;};'use strict';var multer=require('multer');var util=require(_0x94f8('0x0'));var path=require(_0x94f8('0x1'));var timeout=require(_0x94f8('0x2'));var express=require(_0x94f8('0x3'));var router=express[_0x94f8('0x4')]();var fs_extra=require(_0x94f8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x94f8('0x6'));var config=require('../../config/environment');var controller=require(_0x94f8('0x7'));router['get']('/',auth[_0x94f8('0x8')](),controller[_0x94f8('0x9')]);router[_0x94f8('0xa')](_0x94f8('0xb'),auth[_0x94f8('0x8')](),controller[_0x94f8('0xc')]);router['get'](_0x94f8('0xd'),auth['isAuthenticated'](),controller[_0x94f8('0xe')]);router[_0x94f8('0xa')](_0x94f8('0xf'),auth[_0x94f8('0x8')](),controller[_0x94f8('0x10')]);router[_0x94f8('0xa')]('/:id/descriptions',auth[_0x94f8('0x8')](),controller[_0x94f8('0x11')]);router[_0x94f8('0x12')]('/',auth['isAuthenticated'](),controller[_0x94f8('0x13')]);router['put'](_0x94f8('0xb'),auth[_0x94f8('0x8')](),controller[_0x94f8('0x14')]);router[_0x94f8('0x15')]('/:id',auth[_0x94f8('0x8')](),controller[_0x94f8('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3ad2=['/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','/:id','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0xc0a7a6,_0x5cc59c){var _0x3cb01a=function(_0xd35f72){while(--_0xd35f72){_0xc0a7a6['push'](_0xc0a7a6['shift']());}};_0x3cb01a(++_0x5cc59c);}(_0x3ad2,0x1f0));var _0x23ad=function(_0x7b534f,_0x8e91bc){_0x7b534f=_0x7b534f-0x0;var _0x2fae25=_0x3ad2[_0x7b534f];return _0x2fae25;};'use strict';var multer=require(_0x23ad('0x0'));var util=require(_0x23ad('0x1'));var path=require(_0x23ad('0x2'));var timeout=require(_0x23ad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x23ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x23ad('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x23ad('0x6')]('/',auth[_0x23ad('0x7')](),controller['index']);router['get']('/:id',auth[_0x23ad('0x7')](),controller['show']);router['get'](_0x23ad('0x8'),auth[_0x23ad('0x7')](),controller['getFields']);router[_0x23ad('0x6')](_0x23ad('0x9'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x23ad('0x6')](_0x23ad('0xa'),auth[_0x23ad('0x7')](),controller[_0x23ad('0xb')]);router[_0x23ad('0xc')]('/',auth[_0x23ad('0x7')](),controller[_0x23ad('0xd')]);router[_0x23ad('0xe')]('/:id',auth[_0x23ad('0x7')](),controller['update']);router[_0x23ad('0xf')](_0x23ad('0x10'),auth[_0x23ad('0x7')](),controller[_0x23ad('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 6c683c5..eb4fd8d 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 _0x3f0f=['ENUM','lead','nothing','contact_lead','contact','exports'];(function(_0x58250e,_0x2dd117){var _0x51fd03=function(_0x360a72){while(--_0x360a72){_0x58250e['push'](_0x58250e['shift']());}};_0x51fd03(++_0x2dd117);}(_0x3f0f,0x1a3));var _0xf3f0=function(_0x358e7a,_0x20fdf0){_0x358e7a=_0x358e7a-0x0;var _0x55aaf0=_0x3f0f[_0x358e7a];return _0x55aaf0;};'use strict';var Sequelize=require('sequelize');module[_0xf3f0('0x0')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xf3f0('0x1')](_0xf3f0('0x2'),'contact',_0xf3f0('0x3')),'defaultValue':_0xf3f0('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xf3f0('0x4'),_0xf3f0('0x5'),_0xf3f0('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa33b=['nothing','contact_lead','sequelize','exports','STRING','ENUM','lead','contact'];(function(_0x34eeb0,_0x510b41){var _0x4718b2=function(_0x504694){while(--_0x504694){_0x34eeb0['push'](_0x34eeb0['shift']());}};_0x4718b2(++_0x510b41);}(_0xa33b,0xd2));var _0xba33=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa33b[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0xba33('0x0'));module[_0xba33('0x1')]={'name':{'type':Sequelize[_0xba33('0x2')]},'moduleCreate':{'type':Sequelize[_0xba33('0x3')](_0xba33('0x4'),_0xba33('0x5'),_0xba33('0x6')),'defaultValue':_0xba33('0x4')},'moduleSearch':{'type':Sequelize[_0xba33('0x3')](_0xba33('0x7'),'contact',_0xba33('0x4')),'defaultValue':_0xba33('0x7')},'description':{'type':Sequelize[_0xba33('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 0e1f0ca..8ab8bfd 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 _0xcaf6=['attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','findAll','rows','params','includeAll','include','merge','find','catch','create','body','getFields','findOne','ZohoField','sort','getSubjects','getDescriptions','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','end','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x228110,_0x405f4f){var _0xd5b4f2=function(_0x5b15ff){while(--_0x5b15ff){_0x228110['push'](_0x228110['shift']());}};_0xd5b4f2(++_0x405f4f);}(_0xcaf6,0x16e));var _0x6caf=function(_0x157d23,_0x4027b9){_0x157d23=_0x157d23-0x0;var _0x5b93cc=_0xcaf6[_0x157d23];return _0x5b93cc;};'use strict';var emlformat=require(_0x6caf('0x0'));var rimraf=require(_0x6caf('0x1'));var zipdir=require(_0x6caf('0x2'));var jsonpatch=require(_0x6caf('0x3'));var rp=require(_0x6caf('0x4'));var moment=require(_0x6caf('0x5'));var BPromise=require(_0x6caf('0x6'));var Mustache=require(_0x6caf('0x7'));var util=require(_0x6caf('0x8'));var path=require(_0x6caf('0x9'));var sox=require(_0x6caf('0xa'));var csv=require('to-csv');var ejs=require(_0x6caf('0xb'));var fs=require('fs');var fs_extra=require(_0x6caf('0xc'));var _=require('lodash');var squel=require(_0x6caf('0xd'));var crypto=require(_0x6caf('0xe'));var jsforce=require(_0x6caf('0xf'));var deskjs=require(_0x6caf('0x10'));var toCsv=require(_0x6caf('0x11'));var querystring=require(_0x6caf('0x12'));var Papa=require(_0x6caf('0x13'));var Redis=require(_0x6caf('0x14'));var authService=require(_0x6caf('0x15'));var qs=require(_0x6caf('0x16'));var as=require(_0x6caf('0x17'));var hardwareService=require(_0x6caf('0x18'));var logger=require('../../config/logger')(_0x6caf('0x19'));var utils=require(_0x6caf('0x1a'));var config=require(_0x6caf('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x6caf('0x1c'))['db'];function respondWithStatusCode(_0x14b2d5,_0x48c3a2){_0x48c3a2=_0x48c3a2||0xcc;return function(_0x2363d8){if(_0x2363d8){return _0x14b2d5[_0x6caf('0x1d')](_0x48c3a2);}return _0x14b2d5[_0x6caf('0x1e')](_0x48c3a2)['end']();};}function respondWithResult(_0xed270e,_0xcab2dd){_0xcab2dd=_0xcab2dd||0xc8;return function(_0x34b1b3){if(_0x34b1b3){return _0xed270e['status'](_0xcab2dd)['json'](_0x34b1b3);}};}function respondWithFilteredResult(_0x4259d7,_0x25d32a){return function(_0x3ba7ba){if(_0x3ba7ba){var _0x1a3209=typeof _0x25d32a[_0x6caf('0x1f')]===_0x6caf('0x20')&&typeof _0x25d32a[_0x6caf('0x21')]==='undefined';var _0x69844f=_0x3ba7ba[_0x6caf('0x22')];var _0x2ef1c9=_0x1a3209?0x0:_0x25d32a[_0x6caf('0x1f')];var _0x581b67=_0x1a3209?_0x3ba7ba[_0x6caf('0x22')]:_0x25d32a[_0x6caf('0x1f')]+_0x25d32a[_0x6caf('0x21')];var _0x5237a1;if(_0x581b67>=_0x69844f){_0x581b67=_0x69844f;_0x5237a1=0xc8;}else{_0x5237a1=0xce;}_0x4259d7[_0x6caf('0x1e')](_0x5237a1);return _0x4259d7[_0x6caf('0x23')](_0x6caf('0x24'),_0x2ef1c9+'-'+_0x581b67+'/'+_0x69844f)[_0x6caf('0x25')](_0x3ba7ba);}return null;};}function patchUpdates(_0x153a72){return function(_0x2ff492){try{jsonpatch[_0x6caf('0x26')](_0x2ff492,_0x153a72,!![]);}catch(_0x55f717){return BPromise[_0x6caf('0x27')](_0x55f717);}return _0x2ff492['save']();};}function saveUpdates(_0x43ece1,_0x160074){return function(_0x44dc5c){if(_0x44dc5c){return _0x44dc5c[_0x6caf('0x28')](_0x43ece1)['then'](function(_0x500e69){return _0x500e69;});}return null;};}function removeEntity(_0x1ed115,_0x5a4526){return function(_0x53d921){if(_0x53d921){return _0x53d921[_0x6caf('0x29')]()[_0x6caf('0x2a')](function(){_0x1ed115[_0x6caf('0x1e')](0xcc)[_0x6caf('0x2b')]();});}};}function handleEntityNotFound(_0x5dce3e,_0x354ea9){return function(_0x359563){if(!_0x359563){_0x5dce3e[_0x6caf('0x1d')](0x194);}return _0x359563;};}function handleError(_0x4fb7e5,_0x1a3645){_0x1a3645=_0x1a3645||0x1f4;return function(_0x2690f4){logger['error'](_0x2690f4[_0x6caf('0x2c')]);if(_0x2690f4[_0x6caf('0x2d')]){delete _0x2690f4[_0x6caf('0x2d')];}_0x4fb7e5[_0x6caf('0x1e')](_0x1a3645)[_0x6caf('0x2e')](_0x2690f4);};}exports['index']=function(_0x559809,_0x44df96){var _0x62807f={},_0x21d25a={},_0x58375b={'count':0x0,'rows':[]};var _0x98db40=_[_0x6caf('0x2f')](db[_0x6caf('0x30')][_0x6caf('0x31')],function(_0x4ae6d8){return{'name':_0x4ae6d8[_0x6caf('0x32')],'type':_0x4ae6d8[_0x6caf('0x33')][_0x6caf('0x34')]};});_0x21d25a[_0x6caf('0x35')]=_['map'](_0x98db40,'name');_0x21d25a[_0x6caf('0x36')]=_[_0x6caf('0x37')](_0x559809[_0x6caf('0x36')]);_0x21d25a[_0x6caf('0x38')]=_[_0x6caf('0x39')](_0x21d25a['model'],_0x21d25a[_0x6caf('0x36')]);_0x62807f['attributes']=_[_0x6caf('0x39')](_0x21d25a['model'],qs[_0x6caf('0x3a')](_0x559809['query']['fields']));_0x62807f[_0x6caf('0x3b')]=_0x62807f[_0x6caf('0x3b')][_0x6caf('0x3c')]?_0x62807f[_0x6caf('0x3b')]:_0x21d25a[_0x6caf('0x35')];if(!_0x559809[_0x6caf('0x36')][_0x6caf('0x3d')](_0x6caf('0x3e'))){_0x62807f['limit']=qs[_0x6caf('0x21')](_0x559809[_0x6caf('0x36')]['limit']);_0x62807f[_0x6caf('0x1f')]=qs['offset'](_0x559809[_0x6caf('0x36')]['offset']);}_0x62807f[_0x6caf('0x3f')]=qs['sort'](_0x559809[_0x6caf('0x36')]['sort']);_0x62807f[_0x6caf('0x40')]=qs['filters'](_[_0x6caf('0x41')](_0x559809[_0x6caf('0x36')],_0x21d25a['filters']),_0x98db40);if(_0x559809['query'][_0x6caf('0x42')]){_0x62807f[_0x6caf('0x40')]=_['merge'](_0x62807f[_0x6caf('0x40')],{'$or':_['map'](_0x98db40,function(_0x240daa){if(_0x240daa['type']!==_0x6caf('0x43')){var _0x51803b={};_0x51803b[_0x240daa['name']]={'$like':'%'+_0x559809[_0x6caf('0x36')]['filter']+'%'};return _0x51803b;}})});}_0x62807f=_['merge']({},_0x62807f,_0x559809[_0x6caf('0x44')]);var _0x134e1b={'where':_0x62807f[_0x6caf('0x40')]};return db['ZohoConfiguration'][_0x6caf('0x22')](_0x134e1b)[_0x6caf('0x2a')](function(_0x17e93c){_0x58375b[_0x6caf('0x22')]=_0x17e93c;if(_0x559809['query']['includeAll']){_0x62807f['include']=[{'all':!![]}];}return db[_0x6caf('0x30')][_0x6caf('0x45')](_0x62807f);})[_0x6caf('0x2a')](function(_0x464b4c){_0x58375b[_0x6caf('0x46')]=_0x464b4c;return _0x58375b;})[_0x6caf('0x2a')](respondWithFilteredResult(_0x44df96,_0x62807f))['catch'](handleError(_0x44df96,null));};exports['show']=function(_0x5924ef,_0xae7946){var _0x2a6416={'raw':![],'where':{'id':_0x5924ef[_0x6caf('0x47')]['id']}},_0x5e9b3c={};_0x5e9b3c[_0x6caf('0x35')]=_[_0x6caf('0x37')](db[_0x6caf('0x30')][_0x6caf('0x31')]);_0x5e9b3c[_0x6caf('0x36')]=_[_0x6caf('0x37')](_0x5924ef[_0x6caf('0x36')]);_0x5e9b3c[_0x6caf('0x38')]=_['intersection'](_0x5e9b3c[_0x6caf('0x35')],_0x5e9b3c['query']);_0x2a6416[_0x6caf('0x3b')]=_[_0x6caf('0x39')](_0x5e9b3c[_0x6caf('0x35')],qs['fields'](_0x5924ef[_0x6caf('0x36')][_0x6caf('0x3a')]));_0x2a6416[_0x6caf('0x3b')]=_0x2a6416['attributes'][_0x6caf('0x3c')]?_0x2a6416[_0x6caf('0x3b')]:_0x5e9b3c[_0x6caf('0x35')];if(_0x5924ef[_0x6caf('0x36')][_0x6caf('0x48')]){_0x2a6416[_0x6caf('0x49')]=[{'all':!![]}];}_0x2a6416=_[_0x6caf('0x4a')]({},_0x2a6416,_0x5924ef[_0x6caf('0x44')]);return db['ZohoConfiguration'][_0x6caf('0x4b')](_0x2a6416)[_0x6caf('0x2a')](handleEntityNotFound(_0xae7946,null))[_0x6caf('0x2a')](respondWithResult(_0xae7946,null))[_0x6caf('0x4c')](handleError(_0xae7946,null));};exports[_0x6caf('0x4d')]=function(_0x4bcd55,_0x113488){return db[_0x6caf('0x30')]['create'](_0x4bcd55[_0x6caf('0x4e')],{})[_0x6caf('0x2a')](respondWithResult(_0x113488,0xc9))[_0x6caf('0x4c')](handleError(_0x113488,null));};exports['update']=function(_0x358eb4,_0x1cc687){if(_0x358eb4[_0x6caf('0x4e')]['id']){delete _0x358eb4[_0x6caf('0x4e')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x358eb4[_0x6caf('0x47')]['id']}})[_0x6caf('0x2a')](handleEntityNotFound(_0x1cc687,null))[_0x6caf('0x2a')](saveUpdates(_0x358eb4[_0x6caf('0x4e')],null))[_0x6caf('0x2a')](respondWithResult(_0x1cc687,null))['catch'](handleError(_0x1cc687,null));};exports['destroy']=function(_0x380c41,_0x43d514){return db[_0x6caf('0x30')]['find']({'where':{'id':_0x380c41['params']['id']}})['then'](handleEntityNotFound(_0x43d514,null))[_0x6caf('0x2a')](removeEntity(_0x43d514,null))[_0x6caf('0x4c')](handleError(_0x43d514,null));};exports[_0x6caf('0x4f')]=function(_0x3e3da2,_0x27cc25,_0x523f75){var _0x319f35={};var _0x4cddfe={};var _0x48002f;var _0x562ca1;return db[_0x6caf('0x30')][_0x6caf('0x50')]({'where':{'id':_0x3e3da2['params']['id']}})[_0x6caf('0x2a')](handleEntityNotFound(_0x27cc25,null))['then'](function(_0x5cfd41){if(_0x5cfd41){_0x48002f=_0x5cfd41;_0x4cddfe[_0x6caf('0x35')]=_[_0x6caf('0x37')](db[_0x6caf('0x51')][_0x6caf('0x31')]);_0x4cddfe[_0x6caf('0x36')]=_[_0x6caf('0x37')](_0x3e3da2[_0x6caf('0x36')]);_0x4cddfe['filters']=_[_0x6caf('0x39')](_0x4cddfe[_0x6caf('0x35')],_0x4cddfe[_0x6caf('0x36')]);_0x319f35[_0x6caf('0x3b')]=_['intersection'](_0x4cddfe[_0x6caf('0x35')],qs[_0x6caf('0x3a')](_0x3e3da2['query'][_0x6caf('0x3a')]));_0x319f35[_0x6caf('0x3b')]=_0x319f35[_0x6caf('0x3b')]['length']?_0x319f35[_0x6caf('0x3b')]:_0x4cddfe[_0x6caf('0x35')];_0x319f35[_0x6caf('0x3f')]=qs[_0x6caf('0x52')](_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x52')]);_0x319f35['where']=qs[_0x6caf('0x38')](_[_0x6caf('0x41')](_0x3e3da2[_0x6caf('0x36')],_0x4cddfe['filters']));if(_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x42')]){_0x319f35['where']=_['merge'](_0x319f35[_0x6caf('0x40')],{'$or':_[_0x6caf('0x2f')](_0x319f35[_0x6caf('0x3b')],function(_0x17e165){var _0x1b1d47={};_0x1b1d47[_0x17e165]={'$like':'%'+_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x42')]+'%'};return _0x1b1d47;})});}_0x319f35=_[_0x6caf('0x4a')]({},_0x319f35,_0x3e3da2[_0x6caf('0x44')]);return _0x48002f['getFields'](_0x319f35);}})[_0x6caf('0x2a')](function(_0xe96e90){if(_0xe96e90){_0x562ca1=_0xe96e90[_0x6caf('0x3c')];if(!_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x3d')](_0x6caf('0x3e'))){_0x319f35[_0x6caf('0x21')]=qs[_0x6caf('0x21')](_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x21')]);_0x319f35[_0x6caf('0x1f')]=qs[_0x6caf('0x1f')](_0x3e3da2[_0x6caf('0x36')][_0x6caf('0x1f')]);}return _0x48002f[_0x6caf('0x4f')](_0x319f35);}})['then'](function(_0x8f9032){if(_0x8f9032){return _0x8f9032?{'count':_0x562ca1,'rows':_0x8f9032}:null;}})[_0x6caf('0x2a')](respondWithResult(_0x27cc25,null))[_0x6caf('0x4c')](handleError(_0x27cc25,null));};exports[_0x6caf('0x53')]=function(_0x3f8f27,_0x387994,_0x1090a8){var _0x13a626={};var _0x391bfc={};var _0x1eba30;var _0x450c61;return db[_0x6caf('0x30')]['findOne']({'where':{'id':_0x3f8f27[_0x6caf('0x47')]['id']}})['then'](handleEntityNotFound(_0x387994,null))[_0x6caf('0x2a')](function(_0x671209){if(_0x671209){_0x1eba30=_0x671209;_0x391bfc[_0x6caf('0x35')]=_[_0x6caf('0x37')](db[_0x6caf('0x51')]['rawAttributes']);_0x391bfc[_0x6caf('0x36')]=_[_0x6caf('0x37')](_0x3f8f27[_0x6caf('0x36')]);_0x391bfc[_0x6caf('0x38')]=_[_0x6caf('0x39')](_0x391bfc[_0x6caf('0x35')],_0x391bfc['query']);_0x13a626[_0x6caf('0x3b')]=_['intersection'](_0x391bfc[_0x6caf('0x35')],qs[_0x6caf('0x3a')](_0x3f8f27[_0x6caf('0x36')][_0x6caf('0x3a')]));_0x13a626[_0x6caf('0x3b')]=_0x13a626[_0x6caf('0x3b')]['length']?_0x13a626['attributes']:_0x391bfc[_0x6caf('0x35')];_0x13a626[_0x6caf('0x3f')]=qs['sort'](_0x3f8f27[_0x6caf('0x36')][_0x6caf('0x52')]);_0x13a626[_0x6caf('0x40')]=qs[_0x6caf('0x38')](_[_0x6caf('0x41')](_0x3f8f27[_0x6caf('0x36')],_0x391bfc[_0x6caf('0x38')]));if(_0x3f8f27['query'][_0x6caf('0x42')]){_0x13a626[_0x6caf('0x40')]=_[_0x6caf('0x4a')](_0x13a626[_0x6caf('0x40')],{'$or':_[_0x6caf('0x2f')](_0x13a626[_0x6caf('0x3b')],function(_0x3aff75){var _0x3d1489={};_0x3d1489[_0x3aff75]={'$like':'%'+_0x3f8f27[_0x6caf('0x36')][_0x6caf('0x42')]+'%'};return _0x3d1489;})});}_0x13a626=_[_0x6caf('0x4a')]({},_0x13a626,_0x3f8f27['options']);return _0x1eba30[_0x6caf('0x53')](_0x13a626);}})[_0x6caf('0x2a')](function(_0x5424e7){if(_0x5424e7){_0x450c61=_0x5424e7[_0x6caf('0x3c')];if(!_0x3f8f27[_0x6caf('0x36')][_0x6caf('0x3d')](_0x6caf('0x3e'))){_0x13a626[_0x6caf('0x21')]=qs['limit'](_0x3f8f27[_0x6caf('0x36')]['limit']);_0x13a626['offset']=qs['offset'](_0x3f8f27[_0x6caf('0x36')][_0x6caf('0x1f')]);}return _0x1eba30[_0x6caf('0x53')](_0x13a626);}})['then'](function(_0x272e20){if(_0x272e20){return _0x272e20?{'count':_0x450c61,'rows':_0x272e20}:null;}})[_0x6caf('0x2a')](respondWithResult(_0x387994,null))[_0x6caf('0x4c')](handleError(_0x387994,null));};exports[_0x6caf('0x54')]=function(_0xdbad9b,_0x128b78,_0x3b85ae){var _0x338969={};var _0x5603f1={};var _0x21e99d;var _0x123251;return db[_0x6caf('0x30')][_0x6caf('0x50')]({'where':{'id':_0xdbad9b['params']['id']}})[_0x6caf('0x2a')](handleEntityNotFound(_0x128b78,null))['then'](function(_0x448fac){if(_0x448fac){_0x21e99d=_0x448fac;_0x5603f1[_0x6caf('0x35')]=_[_0x6caf('0x37')](db[_0x6caf('0x51')]['rawAttributes']);_0x5603f1['query']=_[_0x6caf('0x37')](_0xdbad9b[_0x6caf('0x36')]);_0x5603f1[_0x6caf('0x38')]=_[_0x6caf('0x39')](_0x5603f1[_0x6caf('0x35')],_0x5603f1[_0x6caf('0x36')]);_0x338969[_0x6caf('0x3b')]=_[_0x6caf('0x39')](_0x5603f1['model'],qs[_0x6caf('0x3a')](_0xdbad9b[_0x6caf('0x36')]['fields']));_0x338969[_0x6caf('0x3b')]=_0x338969[_0x6caf('0x3b')][_0x6caf('0x3c')]?_0x338969[_0x6caf('0x3b')]:_0x5603f1[_0x6caf('0x35')];_0x338969[_0x6caf('0x3f')]=qs[_0x6caf('0x52')](_0xdbad9b[_0x6caf('0x36')][_0x6caf('0x52')]);_0x338969['where']=qs[_0x6caf('0x38')](_[_0x6caf('0x41')](_0xdbad9b['query'],_0x5603f1[_0x6caf('0x38')]));if(_0xdbad9b['query'][_0x6caf('0x42')]){_0x338969['where']=_['merge'](_0x338969[_0x6caf('0x40')],{'$or':_['map'](_0x338969[_0x6caf('0x3b')],function(_0x20fe34){var _0xbcff45={};_0xbcff45[_0x20fe34]={'$like':'%'+_0xdbad9b[_0x6caf('0x36')][_0x6caf('0x42')]+'%'};return _0xbcff45;})});}_0x338969=_[_0x6caf('0x4a')]({},_0x338969,_0xdbad9b[_0x6caf('0x44')]);return _0x21e99d[_0x6caf('0x54')](_0x338969);}})[_0x6caf('0x2a')](function(_0x59547c){if(_0x59547c){_0x123251=_0x59547c[_0x6caf('0x3c')];if(!_0xdbad9b[_0x6caf('0x36')][_0x6caf('0x3d')](_0x6caf('0x3e'))){_0x338969['limit']=qs[_0x6caf('0x21')](_0xdbad9b[_0x6caf('0x36')][_0x6caf('0x21')]);_0x338969['offset']=qs[_0x6caf('0x1f')](_0xdbad9b['query']['offset']);}return _0x21e99d[_0x6caf('0x54')](_0x338969);}})[_0x6caf('0x2a')](function(_0x352dbd){if(_0x352dbd){return _0x352dbd?{'count':_0x123251,'rows':_0x352dbd}:null;}})[_0x6caf('0x2a')](respondWithResult(_0x128b78,null))[_0x6caf('0x4c')](handleError(_0x128b78,null));}; \ No newline at end of file +var _0xde09=['json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','end','error','name','send','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','update','ZohoField','pick','options','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status'];(function(_0x244d80,_0x372fa3){var _0x1c06ab=function(_0x5cb2d5){while(--_0x5cb2d5){_0x244d80['push'](_0x244d80['shift']());}};_0x1c06ab(++_0x372fa3);}(_0xde09,0x116));var _0x9de0=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xde09[_0x819464];return _0x49dcc0;};'use strict';var emlformat=require(_0x9de0('0x0'));var rimraf=require(_0x9de0('0x1'));var zipdir=require(_0x9de0('0x2'));var jsonpatch=require(_0x9de0('0x3'));var rp=require('request-promise');var moment=require(_0x9de0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9de0('0x5'));var util=require('util');var path=require(_0x9de0('0x6'));var sox=require(_0x9de0('0x7'));var csv=require(_0x9de0('0x8'));var ejs=require(_0x9de0('0x9'));var fs=require('fs');var fs_extra=require(_0x9de0('0xa'));var _=require('lodash');var squel=require(_0x9de0('0xb'));var crypto=require('crypto');var jsforce=require(_0x9de0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9de0('0xd'));var Papa=require(_0x9de0('0xe'));var Redis=require(_0x9de0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9de0('0x10'));var as=require(_0x9de0('0x11'));var hardwareService=require(_0x9de0('0x12'));var logger=require('../../config/logger')(_0x9de0('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1809,_0x1281b8){_0x1281b8=_0x1281b8||0xcc;return function(_0x3fb9ee){if(_0x3fb9ee){return _0x5f1809[_0x9de0('0x14')](_0x1281b8);}return _0x5f1809[_0x9de0('0x15')](_0x1281b8)['end']();};}function respondWithResult(_0x31ab16,_0x132773){_0x132773=_0x132773||0xc8;return function(_0x2ad2dc){if(_0x2ad2dc){return _0x31ab16[_0x9de0('0x15')](_0x132773)[_0x9de0('0x16')](_0x2ad2dc);}};}function respondWithFilteredResult(_0x2c31aa,_0x241dcd){return function(_0x248899){if(_0x248899){var _0x591899=typeof _0x241dcd[_0x9de0('0x17')]===_0x9de0('0x18')&&typeof _0x241dcd['limit']===_0x9de0('0x18');var _0x4814e2=_0x248899[_0x9de0('0x19')];var _0x888ad7=_0x591899?0x0:_0x241dcd['offset'];var _0x17ce1c=_0x591899?_0x248899['count']:_0x241dcd[_0x9de0('0x17')]+_0x241dcd[_0x9de0('0x1a')];var _0x5b70d7;if(_0x17ce1c>=_0x4814e2){_0x17ce1c=_0x4814e2;_0x5b70d7=0xc8;}else{_0x5b70d7=0xce;}_0x2c31aa[_0x9de0('0x15')](_0x5b70d7);return _0x2c31aa[_0x9de0('0x1b')](_0x9de0('0x1c'),_0x888ad7+'-'+_0x17ce1c+'/'+_0x4814e2)[_0x9de0('0x16')](_0x248899);}return null;};}function patchUpdates(_0x10a569){return function(_0x30606a){try{jsonpatch['apply'](_0x30606a,_0x10a569,!![]);}catch(_0x220100){return BPromise[_0x9de0('0x1d')](_0x220100);}return _0x30606a['save']();};}function saveUpdates(_0x1d65a7,_0x47dea8){return function(_0x4c6980){if(_0x4c6980){return _0x4c6980['update'](_0x1d65a7)[_0x9de0('0x1e')](function(_0x1297f6){return _0x1297f6;});}return null;};}function removeEntity(_0x4f9d7e,_0x5a3cf0){return function(_0x27995e){if(_0x27995e){return _0x27995e[_0x9de0('0x1f')]()[_0x9de0('0x1e')](function(){_0x4f9d7e['status'](0xcc)[_0x9de0('0x20')]();});}};}function handleEntityNotFound(_0x56b654,_0xaeea50){return function(_0x3a39fd){if(!_0x3a39fd){_0x56b654['sendStatus'](0x194);}return _0x3a39fd;};}function handleError(_0x2bf1c,_0x1a80e6){_0x1a80e6=_0x1a80e6||0x1f4;return function(_0x33d164){logger[_0x9de0('0x21')](_0x33d164['stack']);if(_0x33d164[_0x9de0('0x22')]){delete _0x33d164[_0x9de0('0x22')];}_0x2bf1c[_0x9de0('0x15')](_0x1a80e6)[_0x9de0('0x23')](_0x33d164);};}exports['index']=function(_0x296d08,_0x1a3176){var _0x4a1f53={},_0x79d3d7={},_0x3d5206={'count':0x0,'rows':[]};var _0x1644b8=_[_0x9de0('0x24')](db[_0x9de0('0x25')]['rawAttributes'],function(_0x4e607a){return{'name':_0x4e607a[_0x9de0('0x26')],'type':_0x4e607a[_0x9de0('0x27')][_0x9de0('0x28')]};});_0x79d3d7[_0x9de0('0x29')]=_[_0x9de0('0x24')](_0x1644b8,_0x9de0('0x22'));_0x79d3d7[_0x9de0('0x2a')]=_[_0x9de0('0x2b')](_0x296d08['query']);_0x79d3d7[_0x9de0('0x2c')]=_[_0x9de0('0x2d')](_0x79d3d7[_0x9de0('0x29')],_0x79d3d7[_0x9de0('0x2a')]);_0x4a1f53['attributes']=_['intersection'](_0x79d3d7[_0x9de0('0x29')],qs['fields'](_0x296d08[_0x9de0('0x2a')][_0x9de0('0x2e')]));_0x4a1f53[_0x9de0('0x2f')]=_0x4a1f53['attributes'][_0x9de0('0x30')]?_0x4a1f53[_0x9de0('0x2f')]:_0x79d3d7[_0x9de0('0x29')];if(!_0x296d08['query'][_0x9de0('0x31')](_0x9de0('0x32'))){_0x4a1f53[_0x9de0('0x1a')]=qs['limit'](_0x296d08[_0x9de0('0x2a')]['limit']);_0x4a1f53[_0x9de0('0x17')]=qs[_0x9de0('0x17')](_0x296d08[_0x9de0('0x2a')]['offset']);}_0x4a1f53[_0x9de0('0x33')]=qs[_0x9de0('0x34')](_0x296d08[_0x9de0('0x2a')][_0x9de0('0x34')]);_0x4a1f53['where']=qs[_0x9de0('0x2c')](_['pick'](_0x296d08[_0x9de0('0x2a')],_0x79d3d7['filters']),_0x1644b8);if(_0x296d08[_0x9de0('0x2a')][_0x9de0('0x35')]){_0x4a1f53['where']=_[_0x9de0('0x36')](_0x4a1f53[_0x9de0('0x37')],{'$or':_[_0x9de0('0x24')](_0x1644b8,function(_0x14fded){if(_0x14fded[_0x9de0('0x27')]!==_0x9de0('0x38')){var _0x202583={};_0x202583[_0x14fded[_0x9de0('0x22')]]={'$like':'%'+_0x296d08[_0x9de0('0x2a')][_0x9de0('0x35')]+'%'};return _0x202583;}})});}_0x4a1f53=_[_0x9de0('0x36')]({},_0x4a1f53,_0x296d08['options']);var _0x38eeea={'where':_0x4a1f53['where']};return db[_0x9de0('0x25')][_0x9de0('0x19')](_0x38eeea)[_0x9de0('0x1e')](function(_0x343a5d){_0x3d5206[_0x9de0('0x19')]=_0x343a5d;if(_0x296d08[_0x9de0('0x2a')]['includeAll']){_0x4a1f53[_0x9de0('0x39')]=[{'all':!![]}];}return db[_0x9de0('0x25')][_0x9de0('0x3a')](_0x4a1f53);})[_0x9de0('0x1e')](function(_0xb33149){_0x3d5206['rows']=_0xb33149;return _0x3d5206;})[_0x9de0('0x1e')](respondWithFilteredResult(_0x1a3176,_0x4a1f53))[_0x9de0('0x3b')](handleError(_0x1a3176,null));};exports[_0x9de0('0x3c')]=function(_0x429eee,_0x129ae9){var _0x1f7ebd={'raw':![],'where':{'id':_0x429eee[_0x9de0('0x3d')]['id']}},_0x1538cc={};_0x1538cc[_0x9de0('0x29')]=_[_0x9de0('0x2b')](db[_0x9de0('0x25')][_0x9de0('0x3e')]);_0x1538cc[_0x9de0('0x2a')]=_[_0x9de0('0x2b')](_0x429eee['query']);_0x1538cc[_0x9de0('0x2c')]=_[_0x9de0('0x2d')](_0x1538cc['model'],_0x1538cc[_0x9de0('0x2a')]);_0x1f7ebd[_0x9de0('0x2f')]=_['intersection'](_0x1538cc[_0x9de0('0x29')],qs['fields'](_0x429eee[_0x9de0('0x2a')]['fields']));_0x1f7ebd['attributes']=_0x1f7ebd[_0x9de0('0x2f')][_0x9de0('0x30')]?_0x1f7ebd[_0x9de0('0x2f')]:_0x1538cc[_0x9de0('0x29')];if(_0x429eee[_0x9de0('0x2a')][_0x9de0('0x3f')]){_0x1f7ebd[_0x9de0('0x39')]=[{'all':!![]}];}_0x1f7ebd=_[_0x9de0('0x36')]({},_0x1f7ebd,_0x429eee['options']);return db[_0x9de0('0x25')][_0x9de0('0x40')](_0x1f7ebd)[_0x9de0('0x1e')](handleEntityNotFound(_0x129ae9,null))['then'](respondWithResult(_0x129ae9,null))[_0x9de0('0x3b')](handleError(_0x129ae9,null));};exports[_0x9de0('0x41')]=function(_0x3dcaad,_0x538301){return db[_0x9de0('0x25')][_0x9de0('0x41')](_0x3dcaad[_0x9de0('0x42')],{})['then'](respondWithResult(_0x538301,0xc9))['catch'](handleError(_0x538301,null));};exports[_0x9de0('0x43')]=function(_0x1655cf,_0x2c40e4){if(_0x1655cf[_0x9de0('0x42')]['id']){delete _0x1655cf[_0x9de0('0x42')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x1655cf[_0x9de0('0x3d')]['id']}})[_0x9de0('0x1e')](handleEntityNotFound(_0x2c40e4,null))['then'](saveUpdates(_0x1655cf[_0x9de0('0x42')],null))[_0x9de0('0x1e')](respondWithResult(_0x2c40e4,null))[_0x9de0('0x3b')](handleError(_0x2c40e4,null));};exports['destroy']=function(_0x34dbc1,_0x17701a){return db[_0x9de0('0x25')][_0x9de0('0x40')]({'where':{'id':_0x34dbc1[_0x9de0('0x3d')]['id']}})[_0x9de0('0x1e')](handleEntityNotFound(_0x17701a,null))['then'](removeEntity(_0x17701a,null))['catch'](handleError(_0x17701a,null));};exports['getFields']=function(_0x287b3c,_0x383cd0,_0x4777e6){var _0xc99dac={};var _0x3643a5={};var _0x5abb4f;var _0x2f5b7d;return db[_0x9de0('0x25')]['findOne']({'where':{'id':_0x287b3c[_0x9de0('0x3d')]['id']}})[_0x9de0('0x1e')](handleEntityNotFound(_0x383cd0,null))['then'](function(_0x3c967d){if(_0x3c967d){_0x5abb4f=_0x3c967d;_0x3643a5[_0x9de0('0x29')]=_[_0x9de0('0x2b')](db[_0x9de0('0x44')][_0x9de0('0x3e')]);_0x3643a5[_0x9de0('0x2a')]=_[_0x9de0('0x2b')](_0x287b3c['query']);_0x3643a5['filters']=_[_0x9de0('0x2d')](_0x3643a5[_0x9de0('0x29')],_0x3643a5[_0x9de0('0x2a')]);_0xc99dac[_0x9de0('0x2f')]=_['intersection'](_0x3643a5['model'],qs['fields'](_0x287b3c[_0x9de0('0x2a')][_0x9de0('0x2e')]));_0xc99dac['attributes']=_0xc99dac['attributes']['length']?_0xc99dac[_0x9de0('0x2f')]:_0x3643a5['model'];_0xc99dac[_0x9de0('0x33')]=qs[_0x9de0('0x34')](_0x287b3c['query'][_0x9de0('0x34')]);_0xc99dac[_0x9de0('0x37')]=qs[_0x9de0('0x2c')](_[_0x9de0('0x45')](_0x287b3c[_0x9de0('0x2a')],_0x3643a5[_0x9de0('0x2c')]));if(_0x287b3c[_0x9de0('0x2a')][_0x9de0('0x35')]){_0xc99dac[_0x9de0('0x37')]=_[_0x9de0('0x36')](_0xc99dac[_0x9de0('0x37')],{'$or':_[_0x9de0('0x24')](_0xc99dac[_0x9de0('0x2f')],function(_0x16ab9b){var _0x59dee0={};_0x59dee0[_0x16ab9b]={'$like':'%'+_0x287b3c[_0x9de0('0x2a')]['filter']+'%'};return _0x59dee0;})});}_0xc99dac=_[_0x9de0('0x36')]({},_0xc99dac,_0x287b3c[_0x9de0('0x46')]);return _0x5abb4f[_0x9de0('0x47')](_0xc99dac);}})['then'](function(_0x5f0096){if(_0x5f0096){_0x2f5b7d=_0x5f0096[_0x9de0('0x30')];if(!_0x287b3c['query'][_0x9de0('0x31')]('nolimit')){_0xc99dac['limit']=qs[_0x9de0('0x1a')](_0x287b3c[_0x9de0('0x2a')][_0x9de0('0x1a')]);_0xc99dac[_0x9de0('0x17')]=qs[_0x9de0('0x17')](_0x287b3c[_0x9de0('0x2a')][_0x9de0('0x17')]);}return _0x5abb4f['getFields'](_0xc99dac);}})['then'](function(_0x31d38e){if(_0x31d38e){return _0x31d38e?{'count':_0x2f5b7d,'rows':_0x31d38e}:null;}})['then'](respondWithResult(_0x383cd0,null))['catch'](handleError(_0x383cd0,null));};exports[_0x9de0('0x48')]=function(_0x1865de,_0x407951,_0x246d0c){var _0xd64ef8={};var _0x26e6bb={};var _0x55c5d0;var _0x524079;return db[_0x9de0('0x25')][_0x9de0('0x49')]({'where':{'id':_0x1865de['params']['id']}})[_0x9de0('0x1e')](handleEntityNotFound(_0x407951,null))[_0x9de0('0x1e')](function(_0x2d0271){if(_0x2d0271){_0x55c5d0=_0x2d0271;_0x26e6bb[_0x9de0('0x29')]=_['keys'](db[_0x9de0('0x44')][_0x9de0('0x3e')]);_0x26e6bb[_0x9de0('0x2a')]=_[_0x9de0('0x2b')](_0x1865de[_0x9de0('0x2a')]);_0x26e6bb[_0x9de0('0x2c')]=_['intersection'](_0x26e6bb[_0x9de0('0x29')],_0x26e6bb[_0x9de0('0x2a')]);_0xd64ef8['attributes']=_[_0x9de0('0x2d')](_0x26e6bb[_0x9de0('0x29')],qs[_0x9de0('0x2e')](_0x1865de[_0x9de0('0x2a')][_0x9de0('0x2e')]));_0xd64ef8[_0x9de0('0x2f')]=_0xd64ef8['attributes'][_0x9de0('0x30')]?_0xd64ef8[_0x9de0('0x2f')]:_0x26e6bb[_0x9de0('0x29')];_0xd64ef8[_0x9de0('0x33')]=qs['sort'](_0x1865de[_0x9de0('0x2a')]['sort']);_0xd64ef8[_0x9de0('0x37')]=qs['filters'](_[_0x9de0('0x45')](_0x1865de['query'],_0x26e6bb['filters']));if(_0x1865de['query'][_0x9de0('0x35')]){_0xd64ef8[_0x9de0('0x37')]=_[_0x9de0('0x36')](_0xd64ef8[_0x9de0('0x37')],{'$or':_[_0x9de0('0x24')](_0xd64ef8[_0x9de0('0x2f')],function(_0x3d4623){var _0x1d525d={};_0x1d525d[_0x3d4623]={'$like':'%'+_0x1865de[_0x9de0('0x2a')][_0x9de0('0x35')]+'%'};return _0x1d525d;})});}_0xd64ef8=_['merge']({},_0xd64ef8,_0x1865de[_0x9de0('0x46')]);return _0x55c5d0[_0x9de0('0x48')](_0xd64ef8);}})[_0x9de0('0x1e')](function(_0x44ab15){if(_0x44ab15){_0x524079=_0x44ab15[_0x9de0('0x30')];if(!_0x1865de[_0x9de0('0x2a')][_0x9de0('0x31')](_0x9de0('0x32'))){_0xd64ef8[_0x9de0('0x1a')]=qs[_0x9de0('0x1a')](_0x1865de[_0x9de0('0x2a')][_0x9de0('0x1a')]);_0xd64ef8[_0x9de0('0x17')]=qs[_0x9de0('0x17')](_0x1865de[_0x9de0('0x2a')][_0x9de0('0x17')]);}return _0x55c5d0[_0x9de0('0x48')](_0xd64ef8);}})[_0x9de0('0x1e')](function(_0x554bae){if(_0x554bae){return _0x554bae?{'count':_0x524079,'rows':_0x554bae}:null;}})['then'](respondWithResult(_0x407951,null))[_0x9de0('0x3b')](handleError(_0x407951,null));};exports[_0x9de0('0x4a')]=function(_0x3ef11a,_0x35fd36,_0x1ffd38){var _0x5c4608={};var _0x574d4e={};var _0xbba2a;var _0x2c4dee;return db[_0x9de0('0x25')][_0x9de0('0x49')]({'where':{'id':_0x3ef11a[_0x9de0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35fd36,null))[_0x9de0('0x1e')](function(_0x2ce398){if(_0x2ce398){_0xbba2a=_0x2ce398;_0x574d4e[_0x9de0('0x29')]=_[_0x9de0('0x2b')](db['ZohoField']['rawAttributes']);_0x574d4e[_0x9de0('0x2a')]=_[_0x9de0('0x2b')](_0x3ef11a['query']);_0x574d4e[_0x9de0('0x2c')]=_[_0x9de0('0x2d')](_0x574d4e['model'],_0x574d4e[_0x9de0('0x2a')]);_0x5c4608[_0x9de0('0x2f')]=_[_0x9de0('0x2d')](_0x574d4e[_0x9de0('0x29')],qs[_0x9de0('0x2e')](_0x3ef11a[_0x9de0('0x2a')][_0x9de0('0x2e')]));_0x5c4608['attributes']=_0x5c4608[_0x9de0('0x2f')]['length']?_0x5c4608[_0x9de0('0x2f')]:_0x574d4e[_0x9de0('0x29')];_0x5c4608[_0x9de0('0x33')]=qs[_0x9de0('0x34')](_0x3ef11a[_0x9de0('0x2a')]['sort']);_0x5c4608[_0x9de0('0x37')]=qs[_0x9de0('0x2c')](_[_0x9de0('0x45')](_0x3ef11a[_0x9de0('0x2a')],_0x574d4e[_0x9de0('0x2c')]));if(_0x3ef11a['query'][_0x9de0('0x35')]){_0x5c4608[_0x9de0('0x37')]=_[_0x9de0('0x36')](_0x5c4608[_0x9de0('0x37')],{'$or':_['map'](_0x5c4608[_0x9de0('0x2f')],function(_0x5ae3d8){var _0x2a1091={};_0x2a1091[_0x5ae3d8]={'$like':'%'+_0x3ef11a[_0x9de0('0x2a')]['filter']+'%'};return _0x2a1091;})});}_0x5c4608=_[_0x9de0('0x36')]({},_0x5c4608,_0x3ef11a[_0x9de0('0x46')]);return _0xbba2a[_0x9de0('0x4a')](_0x5c4608);}})[_0x9de0('0x1e')](function(_0xa9a349){if(_0xa9a349){_0x2c4dee=_0xa9a349['length'];if(!_0x3ef11a[_0x9de0('0x2a')]['hasOwnProperty']('nolimit')){_0x5c4608[_0x9de0('0x1a')]=qs[_0x9de0('0x1a')](_0x3ef11a[_0x9de0('0x2a')]['limit']);_0x5c4608[_0x9de0('0x17')]=qs[_0x9de0('0x17')](_0x3ef11a[_0x9de0('0x2a')][_0x9de0('0x17')]);}return _0xbba2a[_0x9de0('0x4a')](_0x5c4608);}})['then'](function(_0x2fa496){if(_0x2fa496){return _0x2fa496?{'count':_0x2c4dee,'rows':_0x2fa496}:null;}})['then'](respondWithResult(_0x35fd36,null))['catch'](handleError(_0x35fd36,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 16faa4a..bd001c4 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 _0xcf51=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x14110c,_0x219c1c){var _0x142c81=function(_0x3d7b66){while(--_0x3d7b66){_0x14110c['push'](_0x14110c['shift']());}};_0x142c81(++_0x219c1c);}(_0xcf51,0x90));var _0x1cf5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf51[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1cf5('0x0'));var util=require('util');var logger=require(_0x1cf5('0x1'))('api');var moment=require(_0x1cf5('0x2'));var BPromise=require(_0x1cf5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cf5('0x4'));var rimraf=require('rimraf');var config=require(_0x1cf5('0x5'));var attributes=require('./intZohoConfiguration.attributes');module[_0x1cf5('0x6')]=function(_0x348205,_0x35285e){return _0x348205[_0x1cf5('0x7')](_0x1cf5('0x8'),attributes,{'tableName':_0x1cf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c76=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2abd03,_0x15bd78){var _0x397306=function(_0x203b1e){while(--_0x203b1e){_0x2abd03['push'](_0x2abd03['shift']());}};_0x397306(++_0x15bd78);}(_0x2c76,0x158));var _0x62c7=function(_0x2a2a4d,_0x1cd0d1){_0x2a2a4d=_0x2a2a4d-0x0;var _0x2c3e20=_0x2c76[_0x2a2a4d];return _0x2c3e20;};'use strict';var _=require('lodash');var util=require(_0x62c7('0x0'));var logger=require(_0x62c7('0x1'))(_0x62c7('0x2'));var moment=require(_0x62c7('0x3'));var BPromise=require(_0x62c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x62c7('0x5'));var rimraf=require(_0x62c7('0x6'));var config=require(_0x62c7('0x7'));var attributes=require(_0x62c7('0x8'));module[_0x62c7('0x9')]=function(_0x14d51c,_0xa076d6){return _0x14d51c[_0x62c7('0xa')](_0x62c7('0xb'),attributes,{'tableName':_0x62c7('0xc'),'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 b7e244d..2d439a4 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 _0xa2d8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x48b330,_0x3658db){var _0x516976=function(_0x531775){while(--_0x531775){_0x48b330['push'](_0x48b330['shift']());}};_0x516976(++_0x3658db);}(_0xa2d8,0x88));var _0x8a2d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa2d8[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x8a2d('0x0'));var util=require('util');var moment=require(_0x8a2d('0x1'));var BPromise=require(_0x8a2d('0x2'));var rs=require(_0x8a2d('0x3'));var fs=require('fs');var Redis=require(_0x8a2d('0x4'));var db=require(_0x8a2d('0x5'))['db'];var utils=require(_0x8a2d('0x6'));var logger=require(_0x8a2d('0x7'))(_0x8a2d('0x8'));var config=require(_0x8a2d('0x9'));var jayson=require(_0x8a2d('0xa'));var client=jayson[_0x8a2d('0xb')][_0x8a2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8ef124,_0x5ab74c,_0x550558){return new BPromise(function(_0x562c30,_0x150253){return client[_0x8a2d('0xd')](_0x8ef124,_0x550558)[_0x8a2d('0xe')](function(_0x2e1894){logger[_0x8a2d('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ab74c,_0x8a2d('0x10'));logger['debug'](_0x8a2d('0x11'),_0x5ab74c,_0x8a2d('0x10'),JSON['stringify'](_0x2e1894));if(_0x2e1894[_0x8a2d('0x12')]){if(_0x2e1894[_0x8a2d('0x12')]['code']===0x1f4){logger[_0x8a2d('0x12')](_0x8a2d('0x13'),_0x5ab74c,_0x2e1894['error'][_0x8a2d('0x14')]);return _0x150253(_0x2e1894[_0x8a2d('0x12')]['message']);}logger[_0x8a2d('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ab74c,_0x2e1894[_0x8a2d('0x12')]['message']);return _0x562c30(_0x2e1894[_0x8a2d('0x12')][_0x8a2d('0x14')]);}else{logger[_0x8a2d('0xf')](_0x8a2d('0x13'),_0x5ab74c,_0x8a2d('0x10'));_0x562c30(_0x2e1894[_0x8a2d('0x15')]['message']);}})[_0x8a2d('0x16')](function(_0x4c6cb1){logger[_0x8a2d('0x12')](_0x8a2d('0x13'),_0x5ab74c,_0x4c6cb1);_0x150253(_0x4c6cb1);});});} \ No newline at end of file +var _0x2cbc=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x53e51e,_0x416eaa){var _0x48c2fb=function(_0x461bd1){while(--_0x461bd1){_0x53e51e['push'](_0x53e51e['shift']());}};_0x48c2fb(++_0x416eaa);}(_0x2cbc,0xb0));var _0xc2cb=function(_0x87dd0e,_0x390eec){_0x87dd0e=_0x87dd0e-0x0;var _0x3f6891=_0x2cbc[_0x87dd0e];return _0x3f6891;};'use strict';var _=require(_0xc2cb('0x0'));var util=require(_0xc2cb('0x1'));var moment=require(_0xc2cb('0x2'));var BPromise=require(_0xc2cb('0x3'));var rs=require(_0xc2cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2cb('0x5'))['db'];var utils=require(_0xc2cb('0x6'));var logger=require('../../config/logger')(_0xc2cb('0x7'));var config=require(_0xc2cb('0x8'));var jayson=require(_0xc2cb('0x9'));var client=jayson[_0xc2cb('0xa')][_0xc2cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ad2e0,_0x10c9a7,_0x45af25){return new BPromise(function(_0x425eda,_0x582ed1){return client['request'](_0x5ad2e0,_0x45af25)[_0xc2cb('0xc')](function(_0x330c43){logger[_0xc2cb('0xd')](_0xc2cb('0xe'),_0x10c9a7,_0xc2cb('0xf'));logger['debug'](_0xc2cb('0x10'),_0x10c9a7,'request\x20sent',JSON[_0xc2cb('0x11')](_0x330c43));if(_0x330c43[_0xc2cb('0x12')]){if(_0x330c43['error'][_0xc2cb('0x13')]===0x1f4){logger[_0xc2cb('0x12')](_0xc2cb('0xe'),_0x10c9a7,_0x330c43['error'][_0xc2cb('0x14')]);return _0x582ed1(_0x330c43['error'][_0xc2cb('0x14')]);}logger['error'](_0xc2cb('0xe'),_0x10c9a7,_0x330c43[_0xc2cb('0x12')][_0xc2cb('0x14')]);return _0x425eda(_0x330c43[_0xc2cb('0x12')][_0xc2cb('0x14')]);}else{logger[_0xc2cb('0xd')](_0xc2cb('0xe'),_0x10c9a7,_0xc2cb('0xf'));_0x425eda(_0x330c43['result'][_0xc2cb('0x14')]);}})[_0xc2cb('0x15')](function(_0x2263fc){logger[_0xc2cb('0x12')](_0xc2cb('0xe'),_0x10c9a7,_0x2263fc);_0x582ed1(_0x2263fc);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0299d91..3ad780e 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 _0xaee1=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0x2f1823,_0x2ab6e5){var _0x544f66=function(_0x3e9c88){while(--_0x3e9c88){_0x2f1823['push'](_0x2f1823['shift']());}};_0x544f66(++_0x2ab6e5);}(_0xaee1,0xc1));var _0x1aee=function(_0x5aecfe,_0x1cba44){_0x5aecfe=_0x5aecfe-0x0;var _0x12dc69=_0xaee1[_0x5aecfe];return _0x12dc69;};'use strict';var multer=require(_0x1aee('0x0'));var util=require(_0x1aee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1aee('0x2')]();var fs_extra=require(_0x1aee('0x3'));var auth=require(_0x1aee('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1aee('0x5'));router[_0x1aee('0x6')]('/',auth[_0x1aee('0x7')](),controller[_0x1aee('0x8')]);router['get'](_0x1aee('0x9'),auth['isAuthenticated'](),controller[_0x1aee('0xa')]);router[_0x1aee('0xb')]('/',auth[_0x1aee('0x7')](),controller[_0x1aee('0xc')]);router[_0x1aee('0xd')](_0x1aee('0x9'),auth[_0x1aee('0x7')](),controller[_0x1aee('0xe')]);router[_0x1aee('0xf')](_0x1aee('0x9'),auth['isAuthenticated'](),controller[_0x1aee('0x10')]);module[_0x1aee('0x11')]=router; \ No newline at end of file +var _0xc139=['isAuthenticated','index','/:id','show','post','put','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x40a9e7,_0x1a57c4){var _0x303082=function(_0x13c3fd){while(--_0x13c3fd){_0x40a9e7['push'](_0x40a9e7['shift']());}};_0x303082(++_0x1a57c4);}(_0xc139,0x16d));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9c13('0x0'));var path=require(_0x9c13('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c13('0x2'));var router=express[_0x9c13('0x3')]();var fs_extra=require(_0x9c13('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9c13('0x5'));var config=require(_0x9c13('0x6'));var controller=require(_0x9c13('0x7'));router[_0x9c13('0x8')]('/',auth[_0x9c13('0x9')](),controller[_0x9c13('0xa')]);router[_0x9c13('0x8')](_0x9c13('0xb'),auth[_0x9c13('0x9')](),controller[_0x9c13('0xc')]);router[_0x9c13('0xd')]('/',auth[_0x9c13('0x9')](),controller['create']);router[_0x9c13('0xe')]('/:id',auth[_0x9c13('0x9')](),controller['update']);router[_0x9c13('0xf')](_0x9c13('0xb'),auth[_0x9c13('0x9')](),controller['destroy']);module[_0x9c13('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1173162..608d91a 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 _0xbd3c=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbd3c,0xfe));var _0xcbd3=function(_0x4ac7c0,_0x1f82db){_0x4ac7c0=_0x4ac7c0-0x0;var _0x2a62b9=_0xbd3c[_0x4ac7c0];return _0x2a62b9;};'use strict';var Sequelize=require(_0xcbd3('0x0'));module[_0xcbd3('0x1')]={'type':{'type':Sequelize[_0xcbd3('0x2')](_0xcbd3('0x3'),_0xcbd3('0x4'),'customVariable',_0xcbd3('0x5'),_0xcbd3('0x6')),'defaultValue':_0xcbd3('0x3')},'content':{'type':Sequelize[_0xcbd3('0x7')]},'key':{'type':Sequelize[_0xcbd3('0x7')]},'keyType':{'type':Sequelize[_0xcbd3('0x2')](_0xcbd3('0x3'),'variable',_0xcbd3('0x8'))},'keyContent':{'type':Sequelize[_0xcbd3('0x7')]},'idField':{'type':Sequelize[_0xcbd3('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcbd3('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcbd3('0x7')]}}; \ No newline at end of file +var _0x0be9=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports','string'];(function(_0x8d27d6,_0x25cae2){var _0x9634ae=function(_0x4139af){while(--_0x4139af){_0x8d27d6['push'](_0x8d27d6['shift']());}};_0x9634ae(++_0x25cae2);}(_0x0be9,0x1ad));var _0x90be=function(_0x58641f,_0x2622d4){_0x58641f=_0x58641f-0x0;var _0x2505b1=_0x0be9[_0x58641f];return _0x2505b1;};'use strict';var Sequelize=require(_0x90be('0x0'));module[_0x90be('0x1')]={'type':{'type':Sequelize['ENUM'](_0x90be('0x2'),_0x90be('0x3'),_0x90be('0x4'),_0x90be('0x5'),'picklist'),'defaultValue':_0x90be('0x2')},'content':{'type':Sequelize[_0x90be('0x6')]},'key':{'type':Sequelize[_0x90be('0x6')]},'keyType':{'type':Sequelize[_0x90be('0x7')](_0x90be('0x2'),'variable',_0x90be('0x4'))},'keyContent':{'type':Sequelize[_0x90be('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x90be('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90be('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 20377b6..4f50b76 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 _0xdc9b=['then','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','update','destroy'];(function(_0x11865a,_0x279597){var _0x2aa36c=function(_0x32f9b4){while(--_0x32f9b4){_0x11865a['push'](_0x11865a['shift']());}};_0x2aa36c(++_0x279597);}(_0xdc9b,0x70));var _0xbdc9=function(_0x46a134,_0x2e3f67){_0x46a134=_0x46a134-0x0;var _0x3c4677=_0xdc9b[_0x46a134];return _0x3c4677;};'use strict';var emlformat=require(_0xbdc9('0x0'));var rimraf=require(_0xbdc9('0x1'));var zipdir=require(_0xbdc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbdc9('0x3'));var moment=require(_0xbdc9('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbdc9('0x5'));var path=require(_0xbdc9('0x6'));var sox=require('sox');var csv=require(_0xbdc9('0x7'));var ejs=require(_0xbdc9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdc9('0x9'));var squel=require('squel');var crypto=require(_0xbdc9('0xa'));var jsforce=require(_0xbdc9('0xb'));var deskjs=require(_0xbdc9('0xc'));var toCsv=require(_0xbdc9('0x7'));var querystring=require(_0xbdc9('0xd'));var Papa=require(_0xbdc9('0xe'));var Redis=require(_0xbdc9('0xf'));var authService=require(_0xbdc9('0x10'));var qs=require(_0xbdc9('0x11'));var as=require(_0xbdc9('0x12'));var hardwareService=require(_0xbdc9('0x13'));var logger=require(_0xbdc9('0x14'))(_0xbdc9('0x15'));var utils=require(_0xbdc9('0x16'));var config=require(_0xbdc9('0x17'));var licenseUtil=require(_0xbdc9('0x18'));var db=require(_0xbdc9('0x19'))['db'];function respondWithStatusCode(_0x465acf,_0x12a807){_0x12a807=_0x12a807||0xcc;return function(_0x2784c1){if(_0x2784c1){return _0x465acf[_0xbdc9('0x1a')](_0x12a807);}return _0x465acf['status'](_0x12a807)[_0xbdc9('0x1b')]();};}function respondWithResult(_0x505617,_0x4b220e){_0x4b220e=_0x4b220e||0xc8;return function(_0x180f38){if(_0x180f38){return _0x505617[_0xbdc9('0x1c')](_0x4b220e)['json'](_0x180f38);}};}function respondWithFilteredResult(_0x2ace40,_0x386607){return function(_0x37e210){if(_0x37e210){var _0x18bd36=typeof _0x386607[_0xbdc9('0x1d')]===_0xbdc9('0x1e')&&typeof _0x386607['limit']==='undefined';var _0x1756e6=_0x37e210[_0xbdc9('0x1f')];var _0x32b094=_0x18bd36?0x0:_0x386607['offset'];var _0x4f60f4=_0x18bd36?_0x37e210[_0xbdc9('0x1f')]:_0x386607[_0xbdc9('0x1d')]+_0x386607['limit'];var _0x7d3d9f;if(_0x4f60f4>=_0x1756e6){_0x4f60f4=_0x1756e6;_0x7d3d9f=0xc8;}else{_0x7d3d9f=0xce;}_0x2ace40[_0xbdc9('0x1c')](_0x7d3d9f);return _0x2ace40[_0xbdc9('0x20')]('Content-Range',_0x32b094+'-'+_0x4f60f4+'/'+_0x1756e6)[_0xbdc9('0x21')](_0x37e210);}return null;};}function patchUpdates(_0x37e81f){return function(_0x2d4b57){try{jsonpatch[_0xbdc9('0x22')](_0x2d4b57,_0x37e81f,!![]);}catch(_0x35671a){return BPromise[_0xbdc9('0x23')](_0x35671a);}return _0x2d4b57['save']();};}function saveUpdates(_0x48f5a7,_0x2d9831){return function(_0x26f72){if(_0x26f72){return _0x26f72[_0xbdc9('0x24')](_0x48f5a7)['then'](function(_0x2604fb){return _0x2604fb;});}return null;};}function removeEntity(_0x1b24a7,_0x586c1d){return function(_0x715fa1){if(_0x715fa1){return _0x715fa1[_0xbdc9('0x25')]()[_0xbdc9('0x26')](function(){_0x1b24a7[_0xbdc9('0x1c')](0xcc)[_0xbdc9('0x1b')]();});}};}function handleEntityNotFound(_0x27c6c7,_0xdaffa9){return function(_0x41f103){if(!_0x41f103){_0x27c6c7[_0xbdc9('0x1a')](0x194);}return _0x41f103;};}function handleError(_0x58d243,_0x406014){_0x406014=_0x406014||0x1f4;return function(_0x1a1324){logger['error'](_0x1a1324[_0xbdc9('0x27')]);if(_0x1a1324[_0xbdc9('0x28')]){delete _0x1a1324[_0xbdc9('0x28')];}_0x58d243[_0xbdc9('0x1c')](_0x406014)[_0xbdc9('0x29')](_0x1a1324);};}exports[_0xbdc9('0x2a')]=function(_0x4b42ff,_0x1e1397){var _0x36b0dd={},_0x1cb43b={},_0x5338ea={'count':0x0,'rows':[]};var _0x5ba682=_['map'](db[_0xbdc9('0x2b')][_0xbdc9('0x2c')],function(_0x121629){return{'name':_0x121629[_0xbdc9('0x2d')],'type':_0x121629[_0xbdc9('0x2e')][_0xbdc9('0x2f')]};});_0x1cb43b['model']=_[_0xbdc9('0x30')](_0x5ba682,_0xbdc9('0x28'));_0x1cb43b[_0xbdc9('0x31')]=_[_0xbdc9('0x32')](_0x4b42ff['query']);_0x1cb43b[_0xbdc9('0x33')]=_[_0xbdc9('0x34')](_0x1cb43b[_0xbdc9('0x35')],_0x1cb43b[_0xbdc9('0x31')]);_0x36b0dd[_0xbdc9('0x36')]=_['intersection'](_0x1cb43b[_0xbdc9('0x35')],qs['fields'](_0x4b42ff[_0xbdc9('0x31')][_0xbdc9('0x37')]));_0x36b0dd[_0xbdc9('0x36')]=_0x36b0dd[_0xbdc9('0x36')][_0xbdc9('0x38')]?_0x36b0dd[_0xbdc9('0x36')]:_0x1cb43b[_0xbdc9('0x35')];if(!_0x4b42ff[_0xbdc9('0x31')][_0xbdc9('0x39')]('nolimit')){_0x36b0dd[_0xbdc9('0x3a')]=qs[_0xbdc9('0x3a')](_0x4b42ff['query'][_0xbdc9('0x3a')]);_0x36b0dd['offset']=qs['offset'](_0x4b42ff['query'][_0xbdc9('0x1d')]);}_0x36b0dd['order']=qs[_0xbdc9('0x3b')](_0x4b42ff['query'][_0xbdc9('0x3b')]);_0x36b0dd[_0xbdc9('0x3c')]=qs[_0xbdc9('0x33')](_[_0xbdc9('0x3d')](_0x4b42ff['query'],_0x1cb43b[_0xbdc9('0x33')]),_0x5ba682);if(_0x4b42ff['query'][_0xbdc9('0x3e')]){_0x36b0dd[_0xbdc9('0x3c')]=_['merge'](_0x36b0dd[_0xbdc9('0x3c')],{'$or':_['map'](_0x5ba682,function(_0x24927e){if(_0x24927e[_0xbdc9('0x2e')]!==_0xbdc9('0x3f')){var _0x35815f={};_0x35815f[_0x24927e[_0xbdc9('0x28')]]={'$like':'%'+_0x4b42ff[_0xbdc9('0x31')]['filter']+'%'};return _0x35815f;}})});}_0x36b0dd=_['merge']({},_0x36b0dd,_0x4b42ff[_0xbdc9('0x40')]);var _0x589698={'where':_0x36b0dd['where']};return db[_0xbdc9('0x2b')][_0xbdc9('0x1f')](_0x589698)[_0xbdc9('0x26')](function(_0x2211b7){_0x5338ea[_0xbdc9('0x1f')]=_0x2211b7;if(_0x4b42ff[_0xbdc9('0x31')]['includeAll']){_0x36b0dd[_0xbdc9('0x41')]=[{'all':!![]}];}return db[_0xbdc9('0x2b')][_0xbdc9('0x42')](_0x36b0dd);})[_0xbdc9('0x26')](function(_0x2b5a59){_0x5338ea[_0xbdc9('0x43')]=_0x2b5a59;return _0x5338ea;})[_0xbdc9('0x26')](respondWithFilteredResult(_0x1e1397,_0x36b0dd))['catch'](handleError(_0x1e1397,null));};exports[_0xbdc9('0x44')]=function(_0x1b7921,_0x53074d){var _0x4847b1={'raw':!![],'where':{'id':_0x1b7921[_0xbdc9('0x45')]['id']}},_0x537138={};_0x537138[_0xbdc9('0x35')]=_[_0xbdc9('0x32')](db['ZohoField'][_0xbdc9('0x2c')]);_0x537138[_0xbdc9('0x31')]=_[_0xbdc9('0x32')](_0x1b7921['query']);_0x537138[_0xbdc9('0x33')]=_[_0xbdc9('0x34')](_0x537138[_0xbdc9('0x35')],_0x537138[_0xbdc9('0x31')]);_0x4847b1[_0xbdc9('0x36')]=_['intersection'](_0x537138[_0xbdc9('0x35')],qs[_0xbdc9('0x37')](_0x1b7921[_0xbdc9('0x31')][_0xbdc9('0x37')]));_0x4847b1[_0xbdc9('0x36')]=_0x4847b1[_0xbdc9('0x36')][_0xbdc9('0x38')]?_0x4847b1['attributes']:_0x537138[_0xbdc9('0x35')];if(_0x1b7921[_0xbdc9('0x31')]['includeAll']){_0x4847b1[_0xbdc9('0x41')]=[{'all':!![]}];}_0x4847b1=_[_0xbdc9('0x46')]({},_0x4847b1,_0x1b7921[_0xbdc9('0x40')]);return db[_0xbdc9('0x2b')][_0xbdc9('0x47')](_0x4847b1)[_0xbdc9('0x26')](handleEntityNotFound(_0x53074d,null))[_0xbdc9('0x26')](respondWithResult(_0x53074d,null))[_0xbdc9('0x48')](handleError(_0x53074d,null));};exports[_0xbdc9('0x49')]=function(_0x2679a4,_0x4eceed){return db[_0xbdc9('0x2b')][_0xbdc9('0x49')](_0x2679a4[_0xbdc9('0x4a')],{})['then'](respondWithResult(_0x4eceed,0xc9))[_0xbdc9('0x48')](handleError(_0x4eceed,null));};exports['update']=function(_0x5793c0,_0x21ba50){if(_0x5793c0[_0xbdc9('0x4a')]['id']){delete _0x5793c0[_0xbdc9('0x4a')]['id'];}return db[_0xbdc9('0x2b')]['find']({'where':{'id':_0x5793c0[_0xbdc9('0x45')]['id']}})[_0xbdc9('0x26')](handleEntityNotFound(_0x21ba50,null))[_0xbdc9('0x26')](saveUpdates(_0x5793c0['body'],null))['then'](respondWithResult(_0x21ba50,null))[_0xbdc9('0x48')](handleError(_0x21ba50,null));};exports[_0xbdc9('0x25')]=function(_0x430ed2,_0x5e1621){return db[_0xbdc9('0x2b')][_0xbdc9('0x47')]({'where':{'id':_0x430ed2[_0xbdc9('0x45')]['id']}})[_0xbdc9('0x26')](handleEntityNotFound(_0x5e1621,null))[_0xbdc9('0x26')](removeEntity(_0x5e1621,null))[_0xbdc9('0x48')](handleError(_0x5e1621,null));}; \ No newline at end of file +var _0x8b75=['fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','stack','name','index','ZohoField'];(function(_0x516ae3,_0x54ae17){var _0x1ea0c4=function(_0xa0d7b){while(--_0xa0d7b){_0x516ae3['push'](_0x516ae3['shift']());}};_0x1ea0c4(++_0x54ae17);}(_0x8b75,0xb7));var _0x58b7=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x8b75[_0x373dee];return _0x46798f;};'use strict';var emlformat=require(_0x58b7('0x0'));var rimraf=require(_0x58b7('0x1'));var zipdir=require(_0x58b7('0x2'));var jsonpatch=require(_0x58b7('0x3'));var rp=require(_0x58b7('0x4'));var moment=require(_0x58b7('0x5'));var BPromise=require(_0x58b7('0x6'));var Mustache=require(_0x58b7('0x7'));var util=require(_0x58b7('0x8'));var path=require('path');var sox=require(_0x58b7('0x9'));var csv=require('to-csv');var ejs=require(_0x58b7('0xa'));var fs=require('fs');var fs_extra=require(_0x58b7('0xb'));var _=require(_0x58b7('0xc'));var squel=require(_0x58b7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x58b7('0xe'));var toCsv=require(_0x58b7('0xf'));var querystring=require(_0x58b7('0x10'));var Papa=require(_0x58b7('0x11'));var Redis=require(_0x58b7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x58b7('0x13'));var logger=require(_0x58b7('0x14'))(_0x58b7('0x15'));var utils=require(_0x58b7('0x16'));var config=require(_0x58b7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x58b7('0x18'))['db'];function respondWithStatusCode(_0x16b3ad,_0x58353d){_0x58353d=_0x58353d||0xcc;return function(_0x5b6234){if(_0x5b6234){return _0x16b3ad['sendStatus'](_0x58353d);}return _0x16b3ad[_0x58b7('0x19')](_0x58353d)[_0x58b7('0x1a')]();};}function respondWithResult(_0x567c0a,_0x17e2c1){_0x17e2c1=_0x17e2c1||0xc8;return function(_0x59fd56){if(_0x59fd56){return _0x567c0a[_0x58b7('0x19')](_0x17e2c1)[_0x58b7('0x1b')](_0x59fd56);}};}function respondWithFilteredResult(_0x10266f,_0x368ba7){return function(_0x11b1f6){if(_0x11b1f6){var _0x4b6d36=typeof _0x368ba7[_0x58b7('0x1c')]===_0x58b7('0x1d')&&typeof _0x368ba7[_0x58b7('0x1e')]==='undefined';var _0x2bef8b=_0x11b1f6['count'];var _0x238825=_0x4b6d36?0x0:_0x368ba7[_0x58b7('0x1c')];var _0x3440cc=_0x4b6d36?_0x11b1f6[_0x58b7('0x1f')]:_0x368ba7[_0x58b7('0x1c')]+_0x368ba7[_0x58b7('0x1e')];var _0x1e72a2;if(_0x3440cc>=_0x2bef8b){_0x3440cc=_0x2bef8b;_0x1e72a2=0xc8;}else{_0x1e72a2=0xce;}_0x10266f['status'](_0x1e72a2);return _0x10266f['set'](_0x58b7('0x20'),_0x238825+'-'+_0x3440cc+'/'+_0x2bef8b)[_0x58b7('0x1b')](_0x11b1f6);}return null;};}function patchUpdates(_0x3da9c4){return function(_0x15497c){try{jsonpatch[_0x58b7('0x21')](_0x15497c,_0x3da9c4,!![]);}catch(_0x4834da){return BPromise[_0x58b7('0x22')](_0x4834da);}return _0x15497c[_0x58b7('0x23')]();};}function saveUpdates(_0x391b26,_0x323c15){return function(_0x1c995b){if(_0x1c995b){return _0x1c995b['update'](_0x391b26)[_0x58b7('0x24')](function(_0x5344eb){return _0x5344eb;});}return null;};}function removeEntity(_0x10abfd,_0x203ad1){return function(_0x5e22b5){if(_0x5e22b5){return _0x5e22b5['destroy']()[_0x58b7('0x24')](function(){_0x10abfd[_0x58b7('0x19')](0xcc)[_0x58b7('0x1a')]();});}};}function handleEntityNotFound(_0x29490d,_0x392b77){return function(_0x3f1df8){if(!_0x3f1df8){_0x29490d[_0x58b7('0x25')](0x194);}return _0x3f1df8;};}function handleError(_0x2dd553,_0x12dc0f){_0x12dc0f=_0x12dc0f||0x1f4;return function(_0x45d120){logger['error'](_0x45d120[_0x58b7('0x26')]);if(_0x45d120[_0x58b7('0x27')]){delete _0x45d120[_0x58b7('0x27')];}_0x2dd553[_0x58b7('0x19')](_0x12dc0f)['send'](_0x45d120);};}exports[_0x58b7('0x28')]=function(_0x3caed,_0x4b762d){var _0x3dd6d0={},_0x511e52={},_0x19d7e0={'count':0x0,'rows':[]};var _0x1171c6=_['map'](db[_0x58b7('0x29')]['rawAttributes'],function(_0x551a83){return{'name':_0x551a83[_0x58b7('0x2a')],'type':_0x551a83['type']['key']};});_0x511e52[_0x58b7('0x2b')]=_[_0x58b7('0x2c')](_0x1171c6,_0x58b7('0x27'));_0x511e52[_0x58b7('0x2d')]=_[_0x58b7('0x2e')](_0x3caed['query']);_0x511e52[_0x58b7('0x2f')]=_[_0x58b7('0x30')](_0x511e52[_0x58b7('0x2b')],_0x511e52['query']);_0x3dd6d0[_0x58b7('0x31')]=_[_0x58b7('0x30')](_0x511e52['model'],qs[_0x58b7('0x32')](_0x3caed[_0x58b7('0x2d')][_0x58b7('0x32')]));_0x3dd6d0['attributes']=_0x3dd6d0[_0x58b7('0x31')][_0x58b7('0x33')]?_0x3dd6d0[_0x58b7('0x31')]:_0x511e52[_0x58b7('0x2b')];if(!_0x3caed[_0x58b7('0x2d')][_0x58b7('0x34')](_0x58b7('0x35'))){_0x3dd6d0['limit']=qs[_0x58b7('0x1e')](_0x3caed[_0x58b7('0x2d')]['limit']);_0x3dd6d0['offset']=qs[_0x58b7('0x1c')](_0x3caed[_0x58b7('0x2d')][_0x58b7('0x1c')]);}_0x3dd6d0[_0x58b7('0x36')]=qs[_0x58b7('0x37')](_0x3caed[_0x58b7('0x2d')]['sort']);_0x3dd6d0[_0x58b7('0x38')]=qs[_0x58b7('0x2f')](_[_0x58b7('0x39')](_0x3caed['query'],_0x511e52[_0x58b7('0x2f')]),_0x1171c6);if(_0x3caed[_0x58b7('0x2d')]['filter']){_0x3dd6d0[_0x58b7('0x38')]=_[_0x58b7('0x3a')](_0x3dd6d0['where'],{'$or':_[_0x58b7('0x2c')](_0x1171c6,function(_0x1bf342){if(_0x1bf342[_0x58b7('0x3b')]!==_0x58b7('0x3c')){var _0x5cbdc7={};_0x5cbdc7[_0x1bf342['name']]={'$like':'%'+_0x3caed[_0x58b7('0x2d')][_0x58b7('0x3d')]+'%'};return _0x5cbdc7;}})});}_0x3dd6d0=_[_0x58b7('0x3a')]({},_0x3dd6d0,_0x3caed[_0x58b7('0x3e')]);var _0x47cc6f={'where':_0x3dd6d0[_0x58b7('0x38')]};return db[_0x58b7('0x29')][_0x58b7('0x1f')](_0x47cc6f)[_0x58b7('0x24')](function(_0x20a218){_0x19d7e0[_0x58b7('0x1f')]=_0x20a218;if(_0x3caed['query'][_0x58b7('0x3f')]){_0x3dd6d0[_0x58b7('0x40')]=[{'all':!![]}];}return db[_0x58b7('0x29')][_0x58b7('0x41')](_0x3dd6d0);})[_0x58b7('0x24')](function(_0xc63bee){_0x19d7e0[_0x58b7('0x42')]=_0xc63bee;return _0x19d7e0;})['then'](respondWithFilteredResult(_0x4b762d,_0x3dd6d0))[_0x58b7('0x43')](handleError(_0x4b762d,null));};exports[_0x58b7('0x44')]=function(_0x457bae,_0x4cecd5){var _0x567e71={'raw':!![],'where':{'id':_0x457bae[_0x58b7('0x45')]['id']}},_0x2d4727={};_0x2d4727[_0x58b7('0x2b')]=_[_0x58b7('0x2e')](db[_0x58b7('0x29')][_0x58b7('0x46')]);_0x2d4727[_0x58b7('0x2d')]=_[_0x58b7('0x2e')](_0x457bae[_0x58b7('0x2d')]);_0x2d4727[_0x58b7('0x2f')]=_[_0x58b7('0x30')](_0x2d4727[_0x58b7('0x2b')],_0x2d4727[_0x58b7('0x2d')]);_0x567e71[_0x58b7('0x31')]=_[_0x58b7('0x30')](_0x2d4727[_0x58b7('0x2b')],qs['fields'](_0x457bae[_0x58b7('0x2d')][_0x58b7('0x32')]));_0x567e71[_0x58b7('0x31')]=_0x567e71[_0x58b7('0x31')][_0x58b7('0x33')]?_0x567e71['attributes']:_0x2d4727[_0x58b7('0x2b')];if(_0x457bae[_0x58b7('0x2d')][_0x58b7('0x3f')]){_0x567e71[_0x58b7('0x40')]=[{'all':!![]}];}_0x567e71=_['merge']({},_0x567e71,_0x457bae[_0x58b7('0x3e')]);return db[_0x58b7('0x29')][_0x58b7('0x47')](_0x567e71)[_0x58b7('0x24')](handleEntityNotFound(_0x4cecd5,null))['then'](respondWithResult(_0x4cecd5,null))['catch'](handleError(_0x4cecd5,null));};exports['create']=function(_0x15295e,_0x544e5d){return db[_0x58b7('0x29')][_0x58b7('0x48')](_0x15295e[_0x58b7('0x49')],{})[_0x58b7('0x24')](respondWithResult(_0x544e5d,0xc9))[_0x58b7('0x43')](handleError(_0x544e5d,null));};exports['update']=function(_0x6c1433,_0x36de67){if(_0x6c1433[_0x58b7('0x49')]['id']){delete _0x6c1433[_0x58b7('0x49')]['id'];}return db[_0x58b7('0x29')][_0x58b7('0x47')]({'where':{'id':_0x6c1433[_0x58b7('0x45')]['id']}})['then'](handleEntityNotFound(_0x36de67,null))[_0x58b7('0x24')](saveUpdates(_0x6c1433['body'],null))[_0x58b7('0x24')](respondWithResult(_0x36de67,null))[_0x58b7('0x43')](handleError(_0x36de67,null));};exports[_0x58b7('0x4a')]=function(_0x4b472d,_0x458be5){return db[_0x58b7('0x29')][_0x58b7('0x47')]({'where':{'id':_0x4b472d[_0x58b7('0x45')]['id']}})[_0x58b7('0x24')](handleEntityNotFound(_0x458be5,null))['then'](removeEntity(_0x458be5,null))[_0x58b7('0x43')](handleError(_0x458be5,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a817e42..e5cf7e1 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 _0x5204=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0x5204,0xdf));var _0x4520=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x5204[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./intZohoField.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'paranoid':![],'indexes':[{'name':_0x4520('0xc'),'fields':['idField',_0x4520('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4325=['../../config/environment','./intZohoField.attributes','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','rimraf'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));module['exports']=function(_0x209e2e,_0xbb0075){return _0x209e2e['define'](_0x5432('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5432('0x9'),'fields':[_0x5432('0xa'),_0x5432('0xb')],'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 e9be7ef..3f3c4b6 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 _0x5675=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x5675,0x97));var _0x5567=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x5675[_0x266618];return _0x54dbf5;};'use strict';var _=require(_0x5567('0x0'));var util=require(_0x5567('0x1'));var moment=require(_0x5567('0x2'));var BPromise=require(_0x5567('0x3'));var rs=require(_0x5567('0x4'));var fs=require('fs');var Redis=require(_0x5567('0x5'));var db=require(_0x5567('0x6'))['db'];var utils=require(_0x5567('0x7'));var logger=require(_0x5567('0x8'))(_0x5567('0x9'));var config=require(_0x5567('0xa'));var jayson=require(_0x5567('0xb'));var client=jayson['client'][_0x5567('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21b00f,_0x51843f,_0x63c720){return new BPromise(function(_0x2412cd,_0x19e193){return client[_0x5567('0xd')](_0x21b00f,_0x63c720)[_0x5567('0xe')](function(_0x93ddf3){logger[_0x5567('0xf')](_0x5567('0x10'),_0x51843f,_0x5567('0x11'));logger[_0x5567('0x12')](_0x5567('0x13'),_0x51843f,_0x5567('0x11'),JSON['stringify'](_0x93ddf3));if(_0x93ddf3[_0x5567('0x14')]){if(_0x93ddf3[_0x5567('0x14')][_0x5567('0x15')]===0x1f4){logger[_0x5567('0x14')]('ZohoField,\x20%s,\x20%s',_0x51843f,_0x93ddf3[_0x5567('0x14')][_0x5567('0x16')]);return _0x19e193(_0x93ddf3[_0x5567('0x14')][_0x5567('0x16')]);}logger[_0x5567('0x14')](_0x5567('0x10'),_0x51843f,_0x93ddf3[_0x5567('0x14')][_0x5567('0x16')]);return _0x2412cd(_0x93ddf3[_0x5567('0x14')][_0x5567('0x16')]);}else{logger[_0x5567('0xf')](_0x5567('0x10'),_0x51843f,_0x5567('0x11'));_0x2412cd(_0x93ddf3['result'][_0x5567('0x16')]);}})[_0x5567('0x17')](function(_0xa3f5b){logger[_0x5567('0x14')](_0x5567('0x10'),_0x51843f,_0xa3f5b);_0x19e193(_0xa3f5b);});});} \ No newline at end of file +var _0x94ff=['rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa45395,_0x5579e6){var _0x3c83d2=function(_0x5d013c){while(--_0x5d013c){_0xa45395['push'](_0xa45395['shift']());}};_0x3c83d2(++_0x5579e6);}(_0x94ff,0x6a));var _0xf94f=function(_0x40edd0,_0x5733d3){_0x40edd0=_0x40edd0-0x0;var _0x3e8338=_0x94ff[_0x40edd0];return _0x3e8338;};'use strict';var _=require(_0xf94f('0x0'));var util=require(_0xf94f('0x1'));var moment=require(_0xf94f('0x2'));var BPromise=require(_0xf94f('0x3'));var rs=require(_0xf94f('0x4'));var fs=require('fs');var Redis=require(_0xf94f('0x5'));var db=require(_0xf94f('0x6'))['db'];var utils=require(_0xf94f('0x7'));var logger=require(_0xf94f('0x8'))(_0xf94f('0x9'));var config=require('../../config/environment');var jayson=require(_0xf94f('0xa'));var client=jayson[_0xf94f('0xb')][_0xf94f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47b4b2,_0x4c0a79,_0x1fb9bb){return new BPromise(function(_0x1e996e,_0xc4ec5){return client[_0xf94f('0xd')](_0x47b4b2,_0x1fb9bb)[_0xf94f('0xe')](function(_0x472ef0){logger[_0xf94f('0xf')](_0xf94f('0x10'),_0x4c0a79,_0xf94f('0x11'));logger[_0xf94f('0x12')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4c0a79,'request\x20sent',JSON['stringify'](_0x472ef0));if(_0x472ef0[_0xf94f('0x13')]){if(_0x472ef0[_0xf94f('0x13')][_0xf94f('0x14')]===0x1f4){logger[_0xf94f('0x13')]('ZohoField,\x20%s,\x20%s',_0x4c0a79,_0x472ef0['error']['message']);return _0xc4ec5(_0x472ef0[_0xf94f('0x13')][_0xf94f('0x15')]);}logger[_0xf94f('0x13')]('ZohoField,\x20%s,\x20%s',_0x4c0a79,_0x472ef0[_0xf94f('0x13')][_0xf94f('0x15')]);return _0x1e996e(_0x472ef0[_0xf94f('0x13')]['message']);}else{logger['info'](_0xf94f('0x10'),_0x4c0a79,'request\x20sent');_0x1e996e(_0x472ef0['result'][_0xf94f('0x15')]);}})[_0xf94f('0x16')](function(_0xed5f4f){logger['error'](_0xf94f('0x10'),_0x4c0a79,_0xed5f4f);_0xc4ec5(_0xed5f4f);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7c10ca1..f8afe03 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x367cb2,_0x4d422e){var _0x5f505b=function(_0x3463e7){while(--_0x3463e7){_0x367cb2['push'](_0x367cb2['shift']());}};_0x5f505b(++_0x4d422e);}(_0x70e0,0x17b));var _0x070e=function(_0x25ce97,_0x3c3a45){_0x25ce97=_0x25ce97-0x0;var _0x3cee7b=_0x70e0[_0x25ce97];return _0x3cee7b;};'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 1f0689c..b539f55 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 _0x91d1=['unique_name_and_version','INTEGER','BOOLEAN','exports','STRING'];(function(_0x185e34,_0x1d8732){var _0x2e8d2b=function(_0x45bd65){while(--_0x45bd65){_0x185e34['push'](_0x185e34['shift']());}};_0x2e8d2b(++_0x1d8732);}(_0x91d1,0x17a));var _0x191d=function(_0x3905b1,_0x2bddb9){_0x3905b1=_0x3905b1-0x0;var _0xd4525f=_0x91d1[_0x3905b1];return _0xd4525f;};'use strict';var Sequelize=require('sequelize');module[_0x191d('0x0')]={'name':{'type':Sequelize[_0x191d('0x1')],'allowNull':![],'unique':_0x191d('0x2')},'version':{'type':Sequelize[_0x191d('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x191d('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x191d('0x1')]},'path':{'type':Sequelize[_0x191d('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x191d('0x3')]},'active':{'type':Sequelize[_0x191d('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x191d('0x1')]},'state':{'type':Sequelize[_0x191d('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x8a1b=['app.js','INTEGER','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x13ac6c,_0x41abd0){var _0x5331ea=function(_0x12e76a){while(--_0x12e76a){_0x13ac6c['push'](_0x13ac6c['shift']());}};_0x5331ea(++_0x41abd0);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x5124cc,_0x967120){_0x5124cc=_0x5124cc-0x0;var _0x542bdd=_0x8a1b[_0x5124cc];return _0x542bdd;};'use strict';var Sequelize=require(_0xb8a1('0x0'));module[_0xb8a1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb8a1('0x2')},'version':{'type':Sequelize[_0xb8a1('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0xb8a1('0x4')},'filename':{'type':Sequelize[_0xb8a1('0x3')]},'path':{'type':Sequelize[_0xb8a1('0x3')]},'type':{'type':Sequelize[_0xb8a1('0x3')]},'size':{'type':Sequelize[_0xb8a1('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xb8a1('0x3')]},'logo':{'type':Sequelize[_0xb8a1('0x3')]},'state':{'type':Sequelize[_0xb8a1('0x3')],'unique':_0xb8a1('0x6')},'description':{'type':Sequelize[_0xb8a1('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb8a1('0x3')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 9e59379..c593624 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 _0xacf4=['VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type'];(function(_0x92cb12,_0x275b21){var _0x15eae8=function(_0x417536){while(--_0x417536){_0x92cb12['push'](_0x92cb12['shift']());}};_0x15eae8(++_0x275b21);}(_0xacf4,0xe7));var _0x4acf=function(_0x506739,_0x30fb31){_0x506739=_0x506739-0x0;var _0x58e6fa=_0xacf4[_0x506739];return _0x58e6fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['Integration'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['Integration']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));}; \ No newline at end of file +var _0x53ec=['count','set','Content-Range','apply','reject','save','then','sendStatus','name','send','map','Integration','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','rows','show','params','include','find','catch','create','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x53ec,0x192));var _0xc53e=function(_0x52f4b8,_0x5eaed9){_0x52f4b8=_0x52f4b8-0x0;var _0x52c0f9=_0x53ec[_0x52f4b8];return _0x52c0f9;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];function respondWithStatusCode(_0x863fa,_0x4203aa){_0x4203aa=_0x4203aa||0xcc;return function(_0x56f0e5){if(_0x56f0e5){return _0x863fa['sendStatus'](_0x4203aa);}return _0x863fa[_0xc53e('0x18')](_0x4203aa)[_0xc53e('0x19')]();};}function respondWithResult(_0x7cd798,_0x3d2e17){_0x3d2e17=_0x3d2e17||0xc8;return function(_0x358ef3){if(_0x358ef3){return _0x7cd798[_0xc53e('0x18')](_0x3d2e17)[_0xc53e('0x1a')](_0x358ef3);}};}function respondWithFilteredResult(_0x19c0d1,_0x455e4d){return function(_0x2ad6eb){if(_0x2ad6eb){var _0x5b0a88=typeof _0x455e4d[_0xc53e('0x1b')]===_0xc53e('0x1c')&&typeof _0x455e4d[_0xc53e('0x1d')]===_0xc53e('0x1c');var _0x15333b=_0x2ad6eb[_0xc53e('0x1e')];var _0x164016=_0x5b0a88?0x0:_0x455e4d[_0xc53e('0x1b')];var _0x3b550e=_0x5b0a88?_0x2ad6eb['count']:_0x455e4d['offset']+_0x455e4d[_0xc53e('0x1d')];var _0x2a5bac;if(_0x3b550e>=_0x15333b){_0x3b550e=_0x15333b;_0x2a5bac=0xc8;}else{_0x2a5bac=0xce;}_0x19c0d1[_0xc53e('0x18')](_0x2a5bac);return _0x19c0d1[_0xc53e('0x1f')](_0xc53e('0x20'),_0x164016+'-'+_0x3b550e+'/'+_0x15333b)[_0xc53e('0x1a')](_0x2ad6eb);}return null;};}function patchUpdates(_0x15a015){return function(_0x25702b){try{jsonpatch[_0xc53e('0x21')](_0x25702b,_0x15a015,!![]);}catch(_0x401af6){return BPromise[_0xc53e('0x22')](_0x401af6);}return _0x25702b[_0xc53e('0x23')]();};}function saveUpdates(_0x426467,_0x4fb695){return function(_0x47cfdd){if(_0x47cfdd){return _0x47cfdd['update'](_0x426467)[_0xc53e('0x24')](function(_0x384218){return _0x384218;});}return null;};}function removeEntity(_0x7591c1,_0x4015c8){return function(_0x180811){if(_0x180811){return _0x180811['destroy']()['then'](function(){_0x7591c1[_0xc53e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae55e,_0x3a5ce8){return function(_0x443179){if(!_0x443179){_0x1ae55e[_0xc53e('0x25')](0x194);}return _0x443179;};}function handleError(_0x63c5dc,_0x4df8cf){_0x4df8cf=_0x4df8cf||0x1f4;return function(_0x398e7a){logger['error'](_0x398e7a['stack']);if(_0x398e7a['name']){delete _0x398e7a[_0xc53e('0x26')];}_0x63c5dc['status'](_0x4df8cf)[_0xc53e('0x27')](_0x398e7a);};}exports['index']=function(_0x24a77e,_0x5112d2){var _0x5ce216={},_0x8f0ee6={},_0x6a62b0={'count':0x0,'rows':[]};var _0x42dec1=_[_0xc53e('0x28')](db[_0xc53e('0x29')][_0xc53e('0x2a')],function(_0x3280fe){return{'name':_0x3280fe[_0xc53e('0x2b')],'type':_0x3280fe['type'][_0xc53e('0x2c')]};});_0x8f0ee6[_0xc53e('0x2d')]=_[_0xc53e('0x28')](_0x42dec1,'name');_0x8f0ee6[_0xc53e('0x2e')]=_['keys'](_0x24a77e[_0xc53e('0x2e')]);_0x8f0ee6[_0xc53e('0x2f')]=_['intersection'](_0x8f0ee6['model'],_0x8f0ee6[_0xc53e('0x2e')]);_0x5ce216[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x8f0ee6[_0xc53e('0x2d')],qs[_0xc53e('0x32')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x5ce216[_0xc53e('0x30')]=_0x5ce216['attributes'][_0xc53e('0x33')]?_0x5ce216[_0xc53e('0x30')]:_0x8f0ee6[_0xc53e('0x2d')];if(!_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5ce216[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x24a77e[_0xc53e('0x2e')]['limit']);_0x5ce216[_0xc53e('0x1b')]=qs['offset'](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x1b')]);}_0x5ce216['order']=qs[_0xc53e('0x36')](_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x36')]);_0x5ce216['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x37')](_0x24a77e[_0xc53e('0x2e')],_0x8f0ee6[_0xc53e('0x2f')]),_0x42dec1);if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]){_0x5ce216[_0xc53e('0x39')]=_['merge'](_0x5ce216[_0xc53e('0x39')],{'$or':_[_0xc53e('0x28')](_0x42dec1,function(_0x2db711){if(_0x2db711['type']!==_0xc53e('0x3a')){var _0x5e8ab7={};_0x5e8ab7[_0x2db711[_0xc53e('0x26')]]={'$like':'%'+_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x38')]+'%'};return _0x5e8ab7;}})});}_0x5ce216=_[_0xc53e('0x3b')]({},_0x5ce216,_0x24a77e[_0xc53e('0x3c')]);var _0x5507d0={'where':_0x5ce216[_0xc53e('0x39')]};return db[_0xc53e('0x29')]['count'](_0x5507d0)['then'](function(_0x5e9e15){_0x6a62b0['count']=_0x5e9e15;if(_0x24a77e[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x5ce216['include']=[{'all':!![]}];}return db[_0xc53e('0x29')]['findAll'](_0x5ce216);})['then'](function(_0x53447e){_0x6a62b0[_0xc53e('0x3e')]=_0x53447e;return _0x6a62b0;})['then'](respondWithFilteredResult(_0x5112d2,_0x5ce216))['catch'](handleError(_0x5112d2,null));};exports[_0xc53e('0x3f')]=function(_0x53a82f,_0x422088){var _0x360af9={'raw':![],'where':{'id':_0x53a82f[_0xc53e('0x40')]['id']}},_0x49f204={};_0x49f204[_0xc53e('0x2d')]=_['keys'](db[_0xc53e('0x29')]['rawAttributes']);_0x49f204['query']=_['keys'](_0x53a82f['query']);_0x49f204[_0xc53e('0x2f')]=_[_0xc53e('0x31')](_0x49f204[_0xc53e('0x2d')],_0x49f204['query']);_0x360af9[_0xc53e('0x30')]=_[_0xc53e('0x31')](_0x49f204['model'],qs['fields'](_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x32')]));_0x360af9[_0xc53e('0x30')]=_0x360af9['attributes'][_0xc53e('0x33')]?_0x360af9[_0xc53e('0x30')]:_0x49f204[_0xc53e('0x2d')];if(_0x53a82f[_0xc53e('0x2e')][_0xc53e('0x3d')]){_0x360af9[_0xc53e('0x41')]=[{'all':!![]}];}_0x360af9=_[_0xc53e('0x3b')]({},_0x360af9,_0x53a82f['options']);return db[_0xc53e('0x29')][_0xc53e('0x42')](_0x360af9)[_0xc53e('0x24')](handleEntityNotFound(_0x422088,null))['then'](respondWithResult(_0x422088,null))[_0xc53e('0x43')](handleError(_0x422088,null));};exports[_0xc53e('0x44')]=function(_0x4458c8,_0x15e744){return db[_0xc53e('0x29')][_0xc53e('0x44')](_0x4458c8['body'],{})[_0xc53e('0x24')](respondWithResult(_0x15e744,0xc9))[_0xc53e('0x43')](handleError(_0x15e744,null));};exports[_0xc53e('0x45')]=function(_0x5a6e41,_0x33d45c){if(_0x5a6e41[_0xc53e('0x46')]['id']){delete _0x5a6e41[_0xc53e('0x46')]['id'];}return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x5a6e41[_0xc53e('0x40')]['id']}})[_0xc53e('0x24')](handleEntityNotFound(_0x33d45c,null))[_0xc53e('0x24')](saveUpdates(_0x5a6e41[_0xc53e('0x46')],null))[_0xc53e('0x24')](respondWithResult(_0x33d45c,null))['catch'](handleError(_0x33d45c,null));};exports[_0xc53e('0x47')]=function(_0x17cf13,_0x38520c){return db[_0xc53e('0x29')][_0xc53e('0x42')]({'where':{'id':_0x17cf13['params']['id']}})['then'](handleEntityNotFound(_0x38520c,null))[_0xc53e('0x24')](removeEntity(_0x38520c,null))['catch'](handleError(_0x38520c,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 82519ad..42d5034 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 _0xfeda=['bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0x4d504e,_0x265d27){var _0x3737bb=function(_0x2a22f9){while(--_0x2a22f9){_0x4d504e['push'](_0x4d504e['shift']());}};_0x3737bb(++_0x265d27);}(_0xfeda,0x6c));var _0xafed=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfeda[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xafed('0x0'));var util=require(_0xafed('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xafed('0x2'));var rp=require(_0xafed('0x3'));var fs=require('fs');var path=require(_0xafed('0x4'));var rimraf=require(_0xafed('0x5'));var config=require('../../config/environment');var attributes=require(_0xafed('0x6'));module[_0xafed('0x7')]=function(_0x2f207c,_0x4d7552){return _0x2f207c[_0xafed('0x8')](_0xafed('0x9'),attributes,{'tableName':_0xafed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa981=['../../config/logger','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa981,0x12a));var _0x1a98=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0xa981[_0x2cacef];return _0x289ba6;};'use strict';var _=require(_0x1a98('0x0'));var util=require(_0x1a98('0x1'));var logger=require(_0x1a98('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a98('0x3'));var rp=require(_0x1a98('0x4'));var fs=require('fs');var path=require(_0x1a98('0x5'));var rimraf=require(_0x1a98('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a98('0x7'));module[_0x1a98('0x8')]=function(_0x1d7192,_0x4d04f1){return _0x1d7192[_0x1a98('0x9')]('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 5f19caf..ccff380 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4fcce9,_0x34391a){var _0x1d5a34=function(_0x566046){while(--_0x566046){_0x4fcce9['push'](_0x4fcce9['shift']());}};_0x1d5a34(++_0x34391a);}(_0x2ef3,0xba));var _0x32ef=function(_0x13c98e,_0x849b39){_0x13c98e=_0x13c98e-0x0;var _0x545230=_0x2ef3[_0x13c98e];return _0x545230;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x524e,0x15e));var _0xe524=function(_0x4a2ade,_0x32ce71){_0x4a2ade=_0x4a2ade-0x0;var _0x23887d=_0x524e[_0x4a2ade];return _0x23887d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 97bd8aa..34cc855 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 _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x2db4c1,_0x3d87fd){var _0x3fe1c3=function(_0x85a2d2){while(--_0x85a2d2){_0x2db4c1['push'](_0x2db4c1['shift']());}};_0x3fe1c3(++_0x3d87fd);}(_0x1a85,0x178));var _0x51a8=function(_0x58b900,_0x4067f4){_0x58b900=_0x58b900-0x0;var _0x142565=_0x1a85[_0x58b900];return _0x142565;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file +var _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a31e3,_0x3ed43a){var _0x329bd5=function(_0xbd1d6e){while(--_0xbd1d6e){_0x3a31e3['push'](_0x3a31e3['shift']());}};_0x329bd5(++_0x3ed43a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1a1769,_0x1ae48f){_0x1a1769=_0x1a1769-0x0;var _0x506409=_0xc6ac[_0x1a1769];return _0x506409;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0eb4cb1..668f834 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 _0x37eb=['INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','exports','STRING','DATE'];(function(_0x45fca1,_0x4786c7){var _0x3e3cf1=function(_0x13be67){while(--_0x13be67){_0x45fca1['push'](_0x45fca1['shift']());}};_0x3e3cf1(++_0x4786c7);}(_0x37eb,0x7f));var _0xb37e=function(_0x2bdbcc,_0x2c698b){_0x2bdbcc=_0x2bdbcc-0x0;var _0x798c3f=_0x37eb[_0x2bdbcc];return _0x798c3f;};'use strict';var Sequelize=require('sequelize');module[_0xb37e('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xb37e('0x1')]},'exitStatus':{'type':Sequelize[_0xb37e('0x1')]},'ticketId':{'type':Sequelize[_0xb37e('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb37e('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb37e('0x1')]},'interface':{'type':Sequelize[_0xb37e('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xb37e('0x2')]},'agentconnectAt':{'type':Sequelize[_0xb37e('0x2')]},'holdtime':{'type':Sequelize[_0xb37e('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xb37e('0x3')]},'agentacw':{'type':Sequelize[_0xb37e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb37e('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xb37e('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb37e('0x2')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb37e('0x1')]},'channelstate':{'type':Sequelize[_0xb37e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb37e('0x1')]},'connectedlinenum':{'type':Sequelize[_0xb37e('0x1')]},'connectedlinename':{'type':Sequelize[_0xb37e('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb37e('0x1')]},'context':{'type':Sequelize[_0xb37e('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb37e('0x1')]},'destchannel':{'type':Sequelize[_0xb37e('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb37e('0x1')]},'destcalleridname':{'type':Sequelize[_0xb37e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb37e('0x1')]},'destlanguage':{'type':Sequelize[_0xb37e('0x1')]},'destaccountcode':{'type':Sequelize[_0xb37e('0x1')]},'destcontext':{'type':Sequelize[_0xb37e('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb37e('0x1')]},'destuniqueid':{'type':Sequelize[_0xb37e('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xb37e('0x1')]},'subject':{'type':Sequelize[_0xb37e('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xb37e('0x1')]},'cc':{'type':Sequelize[_0xb37e('0x1')]},'attachment':{'type':Sequelize[_0xb37e('0x5')]},'html':{'type':Sequelize[_0xb37e('0x5')]},'text':{'type':Sequelize[_0xb37e('0x5')]},'status':{'type':Sequelize[_0xb37e('0x6')](_0xb37e('0x7'),_0xb37e('0x8'),'RECEIVED',_0xb37e('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xb37e('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xb37e('0x3')]}}; \ No newline at end of file +var _0x8da1=['ENUM','SENT','SENDING','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8da1,0x88));var _0x18da=function(_0x10d43e,_0x4e5d08){_0x10d43e=_0x10d43e-0x0;var _0xbcf9a5=_0x8da1[_0x10d43e];return _0xbcf9a5;};'use strict';var Sequelize=require(_0x18da('0x0'));module[_0x18da('0x1')]={'integration':{'type':Sequelize[_0x18da('0x2')]},'eventChannel':{'type':Sequelize[_0x18da('0x2')]},'exitStatus':{'type':Sequelize[_0x18da('0x2')]},'ticketId':{'type':Sequelize[_0x18da('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x18da('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x18da('0x2')]},'interface':{'type':Sequelize[_0x18da('0x2')]},'membername':{'type':Sequelize[_0x18da('0x2')]},'agentcalledAt':{'type':Sequelize[_0x18da('0x3')]},'agentconnectAt':{'type':Sequelize[_0x18da('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x18da('0x3')]},'talktime':{'type':Sequelize[_0x18da('0x4')]},'agentacw':{'type':Sequelize[_0x18da('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x18da('0x4')]},'reason':{'type':Sequelize[_0x18da('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x18da('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x18da('0x3')]},'agentdump':{'type':Sequelize[_0x18da('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x18da('0x3')]},'lastevent':{'type':Sequelize[_0x18da('0x2')]},'channel':{'type':Sequelize[_0x18da('0x2')]},'channelstate':{'type':Sequelize[_0x18da('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x18da('0x2')]},'connectedlinename':{'type':Sequelize[_0x18da('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x18da('0x2')]},'context':{'type':Sequelize[_0x18da('0x2')]},'exten':{'type':Sequelize[_0x18da('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x18da('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x18da('0x2')]},'destcalleridnum':{'type':Sequelize[_0x18da('0x2')]},'destcalleridname':{'type':Sequelize[_0x18da('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x18da('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x18da('0x2')]},'destaccountcode':{'type':Sequelize[_0x18da('0x2')]},'destcontext':{'type':Sequelize[_0x18da('0x2')]},'destexten':{'type':Sequelize[_0x18da('0x2')]},'destpriority':{'type':Sequelize[_0x18da('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x18da('0x2')]},'inReplyTo':{'type':Sequelize[_0x18da('0x2')]},'subject':{'type':Sequelize[_0x18da('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x18da('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x18da('0x6')]},'text':{'type':Sequelize[_0x18da('0x6')]},'status':{'type':Sequelize[_0x18da('0x7')](_0x18da('0x8'),_0x18da('0x9'),'RECEIVED',_0x18da('0xa'))},'url':{'type':Sequelize[_0x18da('0x2')]},'app':{'type':Sequelize[_0x18da('0x2')]},'appdata':{'type':Sequelize[_0x18da('0x2')]},'projectId':{'type':Sequelize[_0x18da('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 30b773b..9c6ed54 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 _0x9c04=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','filters','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3ed2ac,_0x4b26c8){var _0x3596ff=function(_0x24cfe5){while(--_0x24cfe5){_0x3ed2ac['push'](_0x3ed2ac['shift']());}};_0x3596ff(++_0x4b26c8);}(_0x9c04,0xd4));var _0x49c0=function(_0x4ea571,_0x524bc2){_0x4ea571=_0x4ea571-0x0;var _0x122eba=_0x9c04[_0x4ea571];return _0x122eba;};'use strict';var emlformat=require(_0x49c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49c0('0x1'));var jsonpatch=require(_0x49c0('0x2'));var rp=require('request-promise');var moment=require(_0x49c0('0x3'));var BPromise=require(_0x49c0('0x4'));var Mustache=require(_0x49c0('0x5'));var util=require(_0x49c0('0x6'));var path=require('path');var sox=require(_0x49c0('0x7'));var csv=require('to-csv');var ejs=require(_0x49c0('0x8'));var fs=require('fs');var fs_extra=require(_0x49c0('0x9'));var _=require(_0x49c0('0xa'));var squel=require('squel');var crypto=require(_0x49c0('0xb'));var jsforce=require(_0x49c0('0xc'));var deskjs=require(_0x49c0('0xd'));var toCsv=require(_0x49c0('0xe'));var querystring=require(_0x49c0('0xf'));var Papa=require('papaparse');var Redis=require(_0x49c0('0x10'));var authService=require(_0x49c0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x49c0('0x12'));var hardwareService=require(_0x49c0('0x13'));var logger=require(_0x49c0('0x14'))(_0x49c0('0x15'));var utils=require(_0x49c0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x49c0('0x17'));var db=require(_0x49c0('0x18'))['db'];function respondWithStatusCode(_0xa0e35b,_0xb7e45a){_0xb7e45a=_0xb7e45a||0xcc;return function(_0x33811e){if(_0x33811e){return _0xa0e35b['sendStatus'](_0xb7e45a);}return _0xa0e35b[_0x49c0('0x19')](_0xb7e45a)[_0x49c0('0x1a')]();};}function respondWithResult(_0x261924,_0x90beea){_0x90beea=_0x90beea||0xc8;return function(_0x19bd72){if(_0x19bd72){return _0x261924[_0x49c0('0x19')](_0x90beea)[_0x49c0('0x1b')](_0x19bd72);}};}function respondWithFilteredResult(_0xd15543,_0x5373d7){return function(_0x56dd72){if(_0x56dd72){var _0x2060fc=typeof _0x5373d7['offset']==='undefined'&&typeof _0x5373d7['limit']==='undefined';var _0x5de1b9=_0x56dd72[_0x49c0('0x1c')];var _0x258d92=_0x2060fc?0x0:_0x5373d7['offset'];var _0x15d024=_0x2060fc?_0x56dd72[_0x49c0('0x1c')]:_0x5373d7[_0x49c0('0x1d')]+_0x5373d7['limit'];var _0x25b2a3;if(_0x15d024>=_0x5de1b9){_0x15d024=_0x5de1b9;_0x25b2a3=0xc8;}else{_0x25b2a3=0xce;}_0xd15543[_0x49c0('0x19')](_0x25b2a3);return _0xd15543[_0x49c0('0x1e')](_0x49c0('0x1f'),_0x258d92+'-'+_0x15d024+'/'+_0x5de1b9)[_0x49c0('0x1b')](_0x56dd72);}return null;};}function patchUpdates(_0xcbf0d9){return function(_0x5d3cc4){try{jsonpatch['apply'](_0x5d3cc4,_0xcbf0d9,!![]);}catch(_0x180ff7){return BPromise[_0x49c0('0x20')](_0x180ff7);}return _0x5d3cc4[_0x49c0('0x21')]();};}function saveUpdates(_0x3b3b99,_0x12f3c8){return function(_0x51d258){if(_0x51d258){return _0x51d258[_0x49c0('0x22')](_0x3b3b99)['then'](function(_0x3730bd){return _0x3730bd;});}return null;};}function removeEntity(_0x1c13e4,_0x4a5f45){return function(_0xbc00da){if(_0xbc00da){return _0xbc00da[_0x49c0('0x23')]()['then'](function(){_0x1c13e4['status'](0xcc)[_0x49c0('0x1a')]();});}};}function handleEntityNotFound(_0x51b979,_0x26bf7b){return function(_0x43e862){if(!_0x43e862){_0x51b979[_0x49c0('0x24')](0x194);}return _0x43e862;};}function handleError(_0x5d4583,_0x216b2f){_0x216b2f=_0x216b2f||0x1f4;return function(_0x490168){logger[_0x49c0('0x25')](_0x490168[_0x49c0('0x26')]);if(_0x490168[_0x49c0('0x27')]){delete _0x490168[_0x49c0('0x27')];}_0x5d4583[_0x49c0('0x19')](_0x216b2f)[_0x49c0('0x28')](_0x490168);};}exports[_0x49c0('0x29')]=function(_0x5019e3,_0x4d6198){var _0x12ac50={},_0x7bf1c9={},_0xb643b2={'count':0x0,'rows':[]};var _0x511ebc=_[_0x49c0('0x2a')](db[_0x49c0('0x2b')][_0x49c0('0x2c')],function(_0x3640b2){return{'name':_0x3640b2[_0x49c0('0x2d')],'type':_0x3640b2[_0x49c0('0x2e')]['key']};});_0x7bf1c9[_0x49c0('0x2f')]=_['map'](_0x511ebc,_0x49c0('0x27'));_0x7bf1c9[_0x49c0('0x30')]=_[_0x49c0('0x31')](_0x5019e3[_0x49c0('0x30')]);_0x7bf1c9['filters']=_[_0x49c0('0x32')](_0x7bf1c9[_0x49c0('0x2f')],_0x7bf1c9[_0x49c0('0x30')]);_0x12ac50[_0x49c0('0x33')]=_[_0x49c0('0x32')](_0x7bf1c9[_0x49c0('0x2f')],qs['fields'](_0x5019e3[_0x49c0('0x30')]['fields']));_0x12ac50[_0x49c0('0x33')]=_0x12ac50[_0x49c0('0x33')][_0x49c0('0x34')]?_0x12ac50[_0x49c0('0x33')]:_0x7bf1c9[_0x49c0('0x2f')];if(!_0x5019e3[_0x49c0('0x30')][_0x49c0('0x35')](_0x49c0('0x36'))){_0x12ac50[_0x49c0('0x37')]=qs[_0x49c0('0x37')](_0x5019e3[_0x49c0('0x30')][_0x49c0('0x37')]);_0x12ac50[_0x49c0('0x1d')]=qs[_0x49c0('0x1d')](_0x5019e3['query']['offset']);}_0x12ac50[_0x49c0('0x38')]=qs[_0x49c0('0x39')](_0x5019e3[_0x49c0('0x30')][_0x49c0('0x39')]);_0x12ac50[_0x49c0('0x3a')]=qs['filters'](_[_0x49c0('0x3b')](_0x5019e3[_0x49c0('0x30')],_0x7bf1c9['filters']),_0x511ebc);if(_0x5019e3[_0x49c0('0x30')][_0x49c0('0x3c')]){_0x12ac50['where']=_[_0x49c0('0x3d')](_0x12ac50[_0x49c0('0x3a')],{'$or':_['map'](_0x511ebc,function(_0x4bc6ea){if(_0x4bc6ea[_0x49c0('0x2e')]!==_0x49c0('0x3e')){var _0x1afbce={};_0x1afbce[_0x4bc6ea[_0x49c0('0x27')]]={'$like':'%'+_0x5019e3[_0x49c0('0x30')][_0x49c0('0x3c')]+'%'};return _0x1afbce;}})});}_0x12ac50=_[_0x49c0('0x3d')]({},_0x12ac50,_0x5019e3['options']);var _0x36f1c1={'where':_0x12ac50[_0x49c0('0x3a')]};return db['IntegrationReport']['count'](_0x36f1c1)[_0x49c0('0x3f')](function(_0x2d9f0a){_0xb643b2[_0x49c0('0x1c')]=_0x2d9f0a;if(_0x5019e3[_0x49c0('0x30')][_0x49c0('0x40')]){_0x12ac50[_0x49c0('0x41')]=[{'all':!![]}];}return db[_0x49c0('0x2b')][_0x49c0('0x42')](_0x12ac50);})[_0x49c0('0x3f')](function(_0xe2a46f){_0xb643b2[_0x49c0('0x43')]=_0xe2a46f;return _0xb643b2;})[_0x49c0('0x3f')](respondWithFilteredResult(_0x4d6198,_0x12ac50))[_0x49c0('0x44')](handleError(_0x4d6198,null));};exports[_0x49c0('0x45')]=function(_0x2dcf88,_0x12d901){var _0x21c83a={'raw':![],'where':{'id':_0x2dcf88[_0x49c0('0x46')]['id']}},_0x37fc30={};_0x37fc30[_0x49c0('0x2f')]=_[_0x49c0('0x31')](db[_0x49c0('0x2b')]['rawAttributes']);_0x37fc30[_0x49c0('0x30')]=_[_0x49c0('0x31')](_0x2dcf88['query']);_0x37fc30[_0x49c0('0x47')]=_[_0x49c0('0x32')](_0x37fc30['model'],_0x37fc30[_0x49c0('0x30')]);_0x21c83a[_0x49c0('0x33')]=_[_0x49c0('0x32')](_0x37fc30[_0x49c0('0x2f')],qs[_0x49c0('0x48')](_0x2dcf88[_0x49c0('0x30')][_0x49c0('0x48')]));_0x21c83a[_0x49c0('0x33')]=_0x21c83a[_0x49c0('0x33')][_0x49c0('0x34')]?_0x21c83a[_0x49c0('0x33')]:_0x37fc30[_0x49c0('0x2f')];if(_0x2dcf88[_0x49c0('0x30')][_0x49c0('0x40')]){_0x21c83a['include']=[{'all':!![]}];}_0x21c83a=_[_0x49c0('0x3d')]({},_0x21c83a,_0x2dcf88[_0x49c0('0x49')]);return db['IntegrationReport'][_0x49c0('0x4a')](_0x21c83a)[_0x49c0('0x3f')](handleEntityNotFound(_0x12d901,null))[_0x49c0('0x3f')](respondWithResult(_0x12d901,null))[_0x49c0('0x44')](handleError(_0x12d901,null));};exports[_0x49c0('0x4b')]=function(_0x15ec43,_0x3d81a8){return db[_0x49c0('0x2b')][_0x49c0('0x4b')](_0x15ec43[_0x49c0('0x4c')],{})[_0x49c0('0x3f')](respondWithResult(_0x3d81a8,0xc9))['catch'](handleError(_0x3d81a8,null));};exports[_0x49c0('0x22')]=function(_0x3c0f26,_0x2ef03d){if(_0x3c0f26[_0x49c0('0x4c')]['id']){delete _0x3c0f26[_0x49c0('0x4c')]['id'];}return db['IntegrationReport'][_0x49c0('0x4a')]({'where':{'id':_0x3c0f26[_0x49c0('0x46')]['id']}})[_0x49c0('0x3f')](handleEntityNotFound(_0x2ef03d,null))['then'](saveUpdates(_0x3c0f26['body'],null))[_0x49c0('0x3f')](respondWithResult(_0x2ef03d,null))['catch'](handleError(_0x2ef03d,null));};exports[_0x49c0('0x23')]=function(_0x427c20,_0x3b2c21){return db['IntegrationReport']['find']({'where':{'id':_0x427c20['params']['id']}})['then'](handleEntityNotFound(_0x3b2c21,null))['then'](removeEntity(_0x3b2c21,null))[_0x49c0('0x44')](handleError(_0x3b2c21,null));};exports[_0x49c0('0x4d')]=function(_0xd0ea4e,_0x1619a9){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x1619a9,null))[_0x49c0('0x44')](handleError(_0x1619a9,null));}; \ No newline at end of file +var _0x0fdf=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','error','name','index','IntegrationReport','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','rows','catch','show','params','keys','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service'];(function(_0xd13171,_0xc54453){var _0x452bd0=function(_0x3c0628){while(--_0x3c0628){_0xd13171['push'](_0xd13171['shift']());}};_0x452bd0(++_0xc54453);}(_0x0fdf,0xfd));var _0xf0fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fdf[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0fd('0x0'));var zipdir=require(_0xf0fd('0x1'));var jsonpatch=require(_0xf0fd('0x2'));var rp=require('request-promise');var moment=require(_0xf0fd('0x3'));var BPromise=require(_0xf0fd('0x4'));var Mustache=require(_0xf0fd('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf0fd('0x6'));var csv=require('to-csv');var ejs=require(_0xf0fd('0x7'));var fs=require('fs');var fs_extra=require(_0xf0fd('0x8'));var _=require(_0xf0fd('0x9'));var squel=require(_0xf0fd('0xa'));var crypto=require(_0xf0fd('0xb'));var jsforce=require(_0xf0fd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf0fd('0xd'));var Redis=require('ioredis');var authService=require(_0xf0fd('0xe'));var qs=require(_0xf0fd('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0fd('0x10'));var logger=require(_0xf0fd('0x11'))(_0xf0fd('0x12'));var utils=require('../../config/utils');var config=require(_0xf0fd('0x13'));var licenseUtil=require(_0xf0fd('0x14'));var db=require(_0xf0fd('0x15'))['db'];function respondWithStatusCode(_0x39b0b8,_0x47c743){_0x47c743=_0x47c743||0xcc;return function(_0x160666){if(_0x160666){return _0x39b0b8[_0xf0fd('0x16')](_0x47c743);}return _0x39b0b8[_0xf0fd('0x17')](_0x47c743)[_0xf0fd('0x18')]();};}function respondWithResult(_0x502975,_0xaf4d0c){_0xaf4d0c=_0xaf4d0c||0xc8;return function(_0x10c497){if(_0x10c497){return _0x502975[_0xf0fd('0x17')](_0xaf4d0c)['json'](_0x10c497);}};}function respondWithFilteredResult(_0x2779c2,_0xcf960f){return function(_0x220558){if(_0x220558){var _0x2c319a=typeof _0xcf960f[_0xf0fd('0x19')]===_0xf0fd('0x1a')&&typeof _0xcf960f['limit']==='undefined';var _0x3a2cac=_0x220558[_0xf0fd('0x1b')];var _0xdf7d3b=_0x2c319a?0x0:_0xcf960f[_0xf0fd('0x19')];var _0x38fe72=_0x2c319a?_0x220558['count']:_0xcf960f[_0xf0fd('0x19')]+_0xcf960f[_0xf0fd('0x1c')];var _0x2ae536;if(_0x38fe72>=_0x3a2cac){_0x38fe72=_0x3a2cac;_0x2ae536=0xc8;}else{_0x2ae536=0xce;}_0x2779c2['status'](_0x2ae536);return _0x2779c2[_0xf0fd('0x1d')]('Content-Range',_0xdf7d3b+'-'+_0x38fe72+'/'+_0x3a2cac)[_0xf0fd('0x1e')](_0x220558);}return null;};}function patchUpdates(_0x107331){return function(_0x1d9fc0){try{jsonpatch[_0xf0fd('0x1f')](_0x1d9fc0,_0x107331,!![]);}catch(_0x592471){return BPromise['reject'](_0x592471);}return _0x1d9fc0[_0xf0fd('0x20')]();};}function saveUpdates(_0x1e5c06,_0x57b39b){return function(_0x1e5366){if(_0x1e5366){return _0x1e5366[_0xf0fd('0x21')](_0x1e5c06)[_0xf0fd('0x22')](function(_0x286591){return _0x286591;});}return null;};}function removeEntity(_0x5045ed,_0x5ec9fd){return function(_0x4ebc19){if(_0x4ebc19){return _0x4ebc19[_0xf0fd('0x23')]()[_0xf0fd('0x22')](function(){_0x5045ed[_0xf0fd('0x17')](0xcc)[_0xf0fd('0x18')]();});}};}function handleEntityNotFound(_0x25017f,_0x52b3fd){return function(_0x179ef4){if(!_0x179ef4){_0x25017f[_0xf0fd('0x16')](0x194);}return _0x179ef4;};}function handleError(_0x12d821,_0x39b028){_0x39b028=_0x39b028||0x1f4;return function(_0x3056e6){logger[_0xf0fd('0x24')](_0x3056e6['stack']);if(_0x3056e6[_0xf0fd('0x25')]){delete _0x3056e6['name'];}_0x12d821[_0xf0fd('0x17')](_0x39b028)['send'](_0x3056e6);};}exports[_0xf0fd('0x26')]=function(_0xfc8439,_0x408965){var _0x5846f2={},_0x252f4f={},_0x15cb1e={'count':0x0,'rows':[]};var _0x468be0=_['map'](db[_0xf0fd('0x27')][_0xf0fd('0x28')],function(_0x1dae50){return{'name':_0x1dae50['fieldName'],'type':_0x1dae50['type']['key']};});_0x252f4f[_0xf0fd('0x29')]=_['map'](_0x468be0,_0xf0fd('0x25'));_0x252f4f[_0xf0fd('0x2a')]=_['keys'](_0xfc8439[_0xf0fd('0x2a')]);_0x252f4f['filters']=_[_0xf0fd('0x2b')](_0x252f4f[_0xf0fd('0x29')],_0x252f4f[_0xf0fd('0x2a')]);_0x5846f2[_0xf0fd('0x2c')]=_[_0xf0fd('0x2b')](_0x252f4f[_0xf0fd('0x29')],qs[_0xf0fd('0x2d')](_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x2d')]));_0x5846f2[_0xf0fd('0x2c')]=_0x5846f2[_0xf0fd('0x2c')][_0xf0fd('0x2e')]?_0x5846f2['attributes']:_0x252f4f[_0xf0fd('0x29')];if(!_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x2f')](_0xf0fd('0x30'))){_0x5846f2[_0xf0fd('0x1c')]=qs['limit'](_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x1c')]);_0x5846f2['offset']=qs[_0xf0fd('0x19')](_0xfc8439['query']['offset']);}_0x5846f2[_0xf0fd('0x31')]=qs[_0xf0fd('0x32')](_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x32')]);_0x5846f2[_0xf0fd('0x33')]=qs[_0xf0fd('0x34')](_['pick'](_0xfc8439[_0xf0fd('0x2a')],_0x252f4f[_0xf0fd('0x34')]),_0x468be0);if(_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x35')]){_0x5846f2[_0xf0fd('0x33')]=_['merge'](_0x5846f2[_0xf0fd('0x33')],{'$or':_['map'](_0x468be0,function(_0x312f98){if(_0x312f98['type']!==_0xf0fd('0x36')){var _0x53df10={};_0x53df10[_0x312f98[_0xf0fd('0x25')]]={'$like':'%'+_0xfc8439[_0xf0fd('0x2a')]['filter']+'%'};return _0x53df10;}})});}_0x5846f2=_['merge']({},_0x5846f2,_0xfc8439[_0xf0fd('0x37')]);var _0x41cbaa={'where':_0x5846f2[_0xf0fd('0x33')]};return db['IntegrationReport'][_0xf0fd('0x1b')](_0x41cbaa)[_0xf0fd('0x22')](function(_0x140344){_0x15cb1e[_0xf0fd('0x1b')]=_0x140344;if(_0xfc8439[_0xf0fd('0x2a')][_0xf0fd('0x38')]){_0x5846f2['include']=[{'all':!![]}];}return db[_0xf0fd('0x27')]['findAll'](_0x5846f2);})[_0xf0fd('0x22')](function(_0x2c4ca9){_0x15cb1e[_0xf0fd('0x39')]=_0x2c4ca9;return _0x15cb1e;})['then'](respondWithFilteredResult(_0x408965,_0x5846f2))[_0xf0fd('0x3a')](handleError(_0x408965,null));};exports[_0xf0fd('0x3b')]=function(_0x18d003,_0x3a61e6){var _0xe75e19={'raw':![],'where':{'id':_0x18d003[_0xf0fd('0x3c')]['id']}},_0x531f53={};_0x531f53[_0xf0fd('0x29')]=_[_0xf0fd('0x3d')](db[_0xf0fd('0x27')][_0xf0fd('0x28')]);_0x531f53['query']=_[_0xf0fd('0x3d')](_0x18d003[_0xf0fd('0x2a')]);_0x531f53[_0xf0fd('0x34')]=_[_0xf0fd('0x2b')](_0x531f53[_0xf0fd('0x29')],_0x531f53['query']);_0xe75e19['attributes']=_['intersection'](_0x531f53[_0xf0fd('0x29')],qs['fields'](_0x18d003[_0xf0fd('0x2a')][_0xf0fd('0x2d')]));_0xe75e19[_0xf0fd('0x2c')]=_0xe75e19[_0xf0fd('0x2c')]['length']?_0xe75e19[_0xf0fd('0x2c')]:_0x531f53['model'];if(_0x18d003[_0xf0fd('0x2a')][_0xf0fd('0x38')]){_0xe75e19['include']=[{'all':!![]}];}_0xe75e19=_[_0xf0fd('0x3e')]({},_0xe75e19,_0x18d003[_0xf0fd('0x37')]);return db[_0xf0fd('0x27')][_0xf0fd('0x3f')](_0xe75e19)['then'](handleEntityNotFound(_0x3a61e6,null))[_0xf0fd('0x22')](respondWithResult(_0x3a61e6,null))[_0xf0fd('0x3a')](handleError(_0x3a61e6,null));};exports['create']=function(_0x234470,_0x4c95f0){return db[_0xf0fd('0x27')][_0xf0fd('0x40')](_0x234470['body'],{})['then'](respondWithResult(_0x4c95f0,0xc9))['catch'](handleError(_0x4c95f0,null));};exports[_0xf0fd('0x21')]=function(_0x4aae75,_0x399f9b){if(_0x4aae75[_0xf0fd('0x41')]['id']){delete _0x4aae75['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x4aae75[_0xf0fd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x399f9b,null))[_0xf0fd('0x22')](saveUpdates(_0x4aae75[_0xf0fd('0x41')],null))[_0xf0fd('0x22')](respondWithResult(_0x399f9b,null))[_0xf0fd('0x3a')](handleError(_0x399f9b,null));};exports[_0xf0fd('0x23')]=function(_0x5b4926,_0x290099){return db[_0xf0fd('0x27')][_0xf0fd('0x3f')]({'where':{'id':_0x5b4926[_0xf0fd('0x3c')]['id']}})[_0xf0fd('0x22')](handleEntityNotFound(_0x290099,null))['then'](removeEntity(_0x290099,null))[_0xf0fd('0x3a')](handleError(_0x290099,null));};exports[_0xf0fd('0x42')]=function(_0xccc46b,_0x1a6da9){return db[_0xf0fd('0x27')][_0xf0fd('0x42')]()[_0xf0fd('0x22')](respondWithResult(_0x1a6da9,null))[_0xf0fd('0x3a')](handleError(_0x1a6da9,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6d6d3ef..f479277 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 _0x6a56=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util'];(function(_0x6bada1,_0x280ed5){var _0x91fc3b=function(_0x1348b8){while(--_0x1348b8){_0x6bada1['push'](_0x6bada1['shift']());}};_0x91fc3b(++_0x280ed5);}(_0x6a56,0xec));var _0x66a5=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0x6a56[_0x2718c7];return _0x59d89c;};'use strict';var _=require(_0x66a5('0x0'));var util=require(_0x66a5('0x1'));var logger=require(_0x66a5('0x2'))(_0x66a5('0x3'));var moment=require(_0x66a5('0x4'));var BPromise=require(_0x66a5('0x5'));var rp=require(_0x66a5('0x6'));var fs=require('fs');var path=require(_0x66a5('0x7'));var rimraf=require(_0x66a5('0x8'));var config=require(_0x66a5('0x9'));var attributes=require(_0x66a5('0xa'));module['exports']=function(_0x283a24,_0x104065){return _0x283a24[_0x66a5('0xb')](_0x66a5('0xc'),attributes,{'tableName':_0x66a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc75=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x5a8b69,_0x4a5566){var _0x4f18f1=function(_0x2db485){while(--_0x2db485){_0x5a8b69['push'](_0x5a8b69['shift']());}};_0x4f18f1(++_0x4a5566);}(_0xbc75,0x8f));var _0x5bc7=function(_0x3ae555,_0x278d97){_0x3ae555=_0x3ae555-0x0;var _0x465b3e=_0xbc75[_0x3ae555];return _0x465b3e;};'use strict';var _=require('lodash');var util=require(_0x5bc7('0x0'));var logger=require(_0x5bc7('0x1'))(_0x5bc7('0x2'));var moment=require(_0x5bc7('0x3'));var BPromise=require(_0x5bc7('0x4'));var rp=require(_0x5bc7('0x5'));var fs=require('fs');var path=require(_0x5bc7('0x6'));var rimraf=require(_0x5bc7('0x7'));var config=require('../../config/environment');var attributes=require(_0x5bc7('0x8'));module[_0x5bc7('0x9')]=function(_0x567d59,_0x3d25fe){return _0x567d59[_0x5bc7('0xa')](_0x5bc7('0xb'),attributes,{'tableName':_0x5bc7('0xc'),'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 5c92605..0ab6992 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 _0x6d38=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x250da3,_0x118122){var _0x5be8c7=function(_0x445100){while(--_0x445100){_0x250da3['push'](_0x250da3['shift']());}};_0x5be8c7(++_0x118122);}(_0x6d38,0x1ef));var _0x86d3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6d38[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x260aa2,_0x6bb7e7){var _0x160e09=function(_0x5a44dd){while(--_0x5a44dd){_0x260aa2['push'](_0x260aa2['shift']());}};_0x160e09(++_0x6bb7e7);}(_0xda19,0xd5));var _0x9da1=function(_0x56d140,_0xc30f69){_0x56d140=_0x56d140-0x0;var _0x27fc08=_0xda19[_0x56d140];return _0x27fc08;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 4d161be..8b9b10d 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 _0x2899=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','getIntervals','post','isAuthenticated','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2899,0xfe));var _0x9289=function(_0x5e68db,_0x40b061){_0x5e68db=_0x5e68db-0x0;var _0x4297f4=_0x2899[_0x5e68db];return _0x4297f4;};'use strict';var multer=require(_0x9289('0x0'));var util=require(_0x9289('0x1'));var path=require(_0x9289('0x2'));var timeout=require(_0x9289('0x3'));var express=require(_0x9289('0x4'));var router=express[_0x9289('0x5')]();var fs_extra=require(_0x9289('0x6'));var auth=require(_0x9289('0x7'));var interaction=require(_0x9289('0x8'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x9289('0x9')]('/',auth['isAuthenticated'](),controller[_0x9289('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x9289('0xb')]);router[_0x9289('0xc')]('/',auth[_0x9289('0xd')](),controller[_0x9289('0xe')]);router[_0x9289('0xc')]('/:id/sub_intervals',auth[_0x9289('0xd')](),controller[_0x9289('0xf')]);router[_0x9289('0xc')](_0x9289('0x10'),auth[_0x9289('0xd')](),controller[_0x9289('0x11')]);router[_0x9289('0x12')](_0x9289('0x13'),auth[_0x9289('0xd')](),controller[_0x9289('0x14')]);router[_0x9289('0x15')]('/:id',auth[_0x9289('0xd')](),controller['destroy']);module[_0x9289('0x16')]=router; \ No newline at end of file +var _0xea1c=['./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x546177,_0x6e3ac8){var _0x3c8963=function(_0x48704d){while(--_0x48704d){_0x546177['push'](_0x546177['shift']());}};_0x3c8963(++_0x6e3ac8);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcea1('0x0'));var timeout=require(_0xcea1('0x1'));var express=require(_0xcea1('0x2'));var router=express[_0xcea1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcea1('0x4'));var interaction=require(_0xcea1('0x5'));var config=require(_0xcea1('0x6'));var controller=require(_0xcea1('0x7'));router[_0xcea1('0x8')]('/',auth[_0xcea1('0x9')](),controller[_0xcea1('0xa')]);router[_0xcea1('0x8')](_0xcea1('0xb'),auth[_0xcea1('0x9')](),controller[_0xcea1('0xc')]);router['get'](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0xe')]);router['post']('/',auth[_0xcea1('0x9')](),controller[_0xcea1('0xf')]);router[_0xcea1('0x10')](_0xcea1('0xd'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x11')]);router[_0xcea1('0x10')](_0xcea1('0x12'),auth[_0xcea1('0x9')](),controller[_0xcea1('0x13')]);router[_0xcea1('0x14')]('/:id',auth[_0xcea1('0x9')](),controller['update']);router[_0xcea1('0x15')](_0xcea1('0xb'),auth[_0xcea1('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index e4fa806..9038675 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 _0x2611=['STRING','sequelize','exports'];(function(_0x69d91e,_0x12fec6){var _0x381436=function(_0x9a01a0){while(--_0x9a01a0){_0x69d91e['push'](_0x69d91e['shift']());}};_0x381436(++_0x12fec6);}(_0x2611,0x67));var _0x1261=function(_0x1ee1ce,_0x4c2ce2){_0x1ee1ce=_0x1ee1ce-0x0;var _0x3dcd9c=_0x2611[_0x1ee1ce];return _0x3dcd9c;};'use strict';var Sequelize=require(_0x1261('0x0'));module[_0x1261('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1261('0x2')]},'interval':{'type':Sequelize[_0x1261('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xbbb6=['STRING','sequelize'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xbbb6,0x159));var _0x6bbb=function(_0x21bb2f,_0x180f19){_0x21bb2f=_0x21bb2f-0x0;var _0x4cd8d1=_0xbbb6[_0x21bb2f];return _0x4cd8d1;};'use strict';var Sequelize=require(_0x6bbb('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6bbb('0x1')]},'interval':{'type':Sequelize[_0x6bbb('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 c14d894..6ca69b8 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 _0x9117=['show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','addInterval','getIntervals','order','pick','addIntervals','findOne','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','get','Intervals','UserProfileResource','sendStatus','error','name','send','index','map','Interval','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','findAll','rows','catch'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9117,0x72));var _0x7911=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x9117[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require(_0x7911('0x0'));var rimraf=require(_0x7911('0x1'));var zipdir=require(_0x7911('0x2'));var jsonpatch=require(_0x7911('0x3'));var rp=require(_0x7911('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7911('0x5'));var util=require(_0x7911('0x6'));var path=require(_0x7911('0x7'));var sox=require(_0x7911('0x8'));var csv=require(_0x7911('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7911('0xa'));var _=require(_0x7911('0xb'));var squel=require(_0x7911('0xc'));var crypto=require(_0x7911('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7911('0x9'));var querystring=require(_0x7911('0xe'));var Papa=require(_0x7911('0xf'));var Redis=require(_0x7911('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7911('0x11'));var as=require(_0x7911('0x12'));var hardwareService=require(_0x7911('0x13'));var logger=require('../../config/logger')(_0x7911('0x14'));var utils=require('../../config/utils');var config=require(_0x7911('0x15'));var licenseUtil=require(_0x7911('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0x7911('0x17'));function respondWithStatusCode(_0x9e49ec,_0x377289){_0x377289=_0x377289||0xcc;return function(_0x467454){if(_0x467454){return _0x9e49ec['sendStatus'](_0x377289);}return _0x9e49ec[_0x7911('0x18')](_0x377289)[_0x7911('0x19')]();};}function respondWithResult(_0x5d4cbb,_0x421db6){_0x421db6=_0x421db6||0xc8;return function(_0x56a5e2){if(_0x56a5e2){return _0x5d4cbb[_0x7911('0x18')](_0x421db6)[_0x7911('0x1a')](_0x56a5e2);}};}function respondWithFilteredResult(_0x80c70c,_0x5e7e20){return function(_0x4eb19f){if(_0x4eb19f){var _0xfa153d=typeof _0x5e7e20[_0x7911('0x1b')]===_0x7911('0x1c')&&typeof _0x5e7e20[_0x7911('0x1d')]===_0x7911('0x1c');var _0x1c7497=_0x4eb19f[_0x7911('0x1e')];var _0x21880a=_0xfa153d?0x0:_0x5e7e20[_0x7911('0x1b')];var _0x2a359b=_0xfa153d?_0x4eb19f['count']:_0x5e7e20[_0x7911('0x1b')]+_0x5e7e20[_0x7911('0x1d')];var _0x24ab9f;if(_0x2a359b>=_0x1c7497){_0x2a359b=_0x1c7497;_0x24ab9f=0xc8;}else{_0x24ab9f=0xce;}_0x80c70c[_0x7911('0x18')](_0x24ab9f);return _0x80c70c['set']('Content-Range',_0x21880a+'-'+_0x2a359b+'/'+_0x1c7497)[_0x7911('0x1a')](_0x4eb19f);}return null;};}function patchUpdates(_0x12d498){return function(_0x2a4c4b){try{jsonpatch[_0x7911('0x1f')](_0x2a4c4b,_0x12d498,!![]);}catch(_0x3b7e59){return BPromise[_0x7911('0x20')](_0x3b7e59);}return _0x2a4c4b[_0x7911('0x21')]();};}function saveUpdates(_0x58ab99,_0x31b1ba){return function(_0x5c1a79){if(_0x5c1a79){return _0x5c1a79['update'](_0x58ab99)['then'](function(_0x1ca4cb){return _0x1ca4cb;});}return null;};}function removeEntity(_0xfa8934,_0x14f55b){return function(_0x1b9692){if(_0x1b9692){return _0x1b9692[_0x7911('0x22')]()[_0x7911('0x23')](function(){var _0x328b3e=_0x1b9692[_0x7911('0x24')]({'plain':!![]});var _0x26ccac=_0x7911('0x25');return db[_0x7911('0x26')][_0x7911('0x22')]({'where':{'type':_0x26ccac,'resourceId':_0x328b3e['id']}})[_0x7911('0x23')](function(){return _0x1b9692;});})[_0x7911('0x23')](function(){_0xfa8934['status'](0xcc)[_0x7911('0x19')]();});}};}function handleEntityNotFound(_0x3c3f92,_0x46d865){return function(_0x5a91ba){if(!_0x5a91ba){_0x3c3f92[_0x7911('0x27')](0x194);}return _0x5a91ba;};}function handleError(_0x38b699,_0x3920e4){_0x3920e4=_0x3920e4||0x1f4;return function(_0x49ca2d){logger[_0x7911('0x28')](_0x49ca2d['stack']);if(_0x49ca2d[_0x7911('0x29')]){delete _0x49ca2d[_0x7911('0x29')];}_0x38b699[_0x7911('0x18')](_0x3920e4)[_0x7911('0x2a')](_0x49ca2d);};}exports[_0x7911('0x2b')]=function(_0x53e377,_0x174fe1){var _0xceddcb={},_0x3010e2={},_0x4f2415={'count':0x0,'rows':[]};var _0x562bc8=_[_0x7911('0x2c')](db[_0x7911('0x2d')]['rawAttributes'],function(_0x5e493a){return{'name':_0x5e493a[_0x7911('0x2e')],'type':_0x5e493a[_0x7911('0x2f')][_0x7911('0x30')]};});_0x3010e2[_0x7911('0x31')]=_[_0x7911('0x2c')](_0x562bc8,'name');_0x3010e2[_0x7911('0x32')]=_[_0x7911('0x33')](_0x53e377[_0x7911('0x32')]);_0x3010e2[_0x7911('0x34')]=_['intersection'](_0x3010e2['model'],_0x3010e2[_0x7911('0x32')]);_0xceddcb[_0x7911('0x35')]=_[_0x7911('0x36')](_0x3010e2[_0x7911('0x31')],qs[_0x7911('0x37')](_0x53e377['query'][_0x7911('0x37')]));_0xceddcb[_0x7911('0x35')]=_0xceddcb[_0x7911('0x35')][_0x7911('0x38')]?_0xceddcb[_0x7911('0x35')]:_0x3010e2[_0x7911('0x31')];if(!_0x53e377[_0x7911('0x32')][_0x7911('0x39')](_0x7911('0x3a'))){_0xceddcb[_0x7911('0x1d')]=qs[_0x7911('0x1d')](_0x53e377[_0x7911('0x32')][_0x7911('0x1d')]);_0xceddcb[_0x7911('0x1b')]=qs[_0x7911('0x1b')](_0x53e377[_0x7911('0x32')][_0x7911('0x1b')]);}_0xceddcb['order']=qs[_0x7911('0x3b')](_0x53e377['query'][_0x7911('0x3b')]);_0xceddcb[_0x7911('0x3c')]=qs[_0x7911('0x34')](_['pick'](_0x53e377[_0x7911('0x32')],_0x3010e2[_0x7911('0x34')]),_0x562bc8);if(_0x53e377[_0x7911('0x32')][_0x7911('0x3d')]){_0xceddcb[_0x7911('0x3c')]=_['merge'](_0xceddcb['where'],{'$or':_['map'](_0x562bc8,function(_0x3dce4a){if(_0x3dce4a[_0x7911('0x2f')]!==_0x7911('0x3e')){var _0x641390={};_0x641390[_0x3dce4a['name']]={'$like':'%'+_0x53e377['query']['filter']+'%'};return _0x641390;}})});}_0xceddcb=_[_0x7911('0x3f')]({},_0xceddcb,_0x53e377[_0x7911('0x40')]);var _0xbb536c={'where':_0xceddcb[_0x7911('0x3c')]};return db['Interval']['count'](_0xbb536c)[_0x7911('0x23')](function(_0x3e520b){_0x4f2415[_0x7911('0x1e')]=_0x3e520b;if(_0x53e377['query']['includeAll']){_0xceddcb['include']=[{'all':!![]}];}return db[_0x7911('0x2d')][_0x7911('0x41')](_0xceddcb);})['then'](function(_0x2b8442){_0x4f2415[_0x7911('0x42')]=_0x2b8442;return _0x4f2415;})['then'](respondWithFilteredResult(_0x174fe1,_0xceddcb))[_0x7911('0x43')](handleError(_0x174fe1,null));};exports[_0x7911('0x44')]=function(_0x4b45df,_0x31b18c){var _0x23caea={'raw':!![],'where':{'id':_0x4b45df[_0x7911('0x45')]['id']}},_0x3b2c3a={};_0x3b2c3a[_0x7911('0x31')]=_[_0x7911('0x33')](db[_0x7911('0x2d')][_0x7911('0x46')]);_0x3b2c3a[_0x7911('0x32')]=_[_0x7911('0x33')](_0x4b45df[_0x7911('0x32')]);_0x3b2c3a['filters']=_[_0x7911('0x36')](_0x3b2c3a[_0x7911('0x31')],_0x3b2c3a['query']);_0x23caea[_0x7911('0x35')]=_[_0x7911('0x36')](_0x3b2c3a['model'],qs['fields'](_0x4b45df['query'][_0x7911('0x37')]));_0x23caea[_0x7911('0x35')]=_0x23caea['attributes'][_0x7911('0x38')]?_0x23caea[_0x7911('0x35')]:_0x3b2c3a[_0x7911('0x31')];if(_0x4b45df[_0x7911('0x32')][_0x7911('0x47')]){_0x23caea[_0x7911('0x48')]=[{'all':!![]}];}_0x23caea=_[_0x7911('0x3f')]({},_0x23caea,_0x4b45df[_0x7911('0x40')]);return db[_0x7911('0x2d')][_0x7911('0x49')](_0x23caea)[_0x7911('0x23')](handleEntityNotFound(_0x31b18c,null))[_0x7911('0x23')](respondWithResult(_0x31b18c,null))[_0x7911('0x43')](handleError(_0x31b18c,null));};exports[_0x7911('0x4a')]=function(_0x418f39,_0x456f46){return db[_0x7911('0x2d')][_0x7911('0x4a')](_0x418f39[_0x7911('0x4b')],{})[_0x7911('0x23')](function(_0x23868d){var _0x4dbb7d=_0x418f39[_0x7911('0x4c')][_0x7911('0x24')]({'plain':!![]});if(!_0x4dbb7d)throw new Error(_0x7911('0x4d'));if(_0x4dbb7d[_0x7911('0x4e')]===_0x7911('0x4c')){var _0x1165b0=_0x23868d[_0x7911('0x24')]({'plain':!![]});var _0x172848=_0x7911('0x25');return db[_0x7911('0x4f')][_0x7911('0x49')]({'where':{'name':_0x172848,'userProfileId':_0x4dbb7d[_0x7911('0x50')]},'raw':!![]})[_0x7911('0x23')](function(_0x3c9e70){if(_0x3c9e70&&_0x3c9e70[_0x7911('0x51')]===0x0){return db[_0x7911('0x26')]['create']({'name':_0x1165b0[_0x7911('0x29')],'resourceId':_0x1165b0['id'],'type':_0x3c9e70[_0x7911('0x29')],'sectionId':_0x3c9e70['id']},{})[_0x7911('0x23')](function(){return _0x23868d;});}else{return _0x23868d;}})[_0x7911('0x43')](function(_0x55a904){logger[_0x7911('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55a904);throw _0x55a904;});}return _0x23868d;})[_0x7911('0x23')](respondWithResult(_0x456f46,0xc9))[_0x7911('0x43')](handleError(_0x456f46,null));};exports[_0x7911('0x52')]=function(_0x290ef9,_0x4acae1){if(_0x290ef9[_0x7911('0x4b')]['id']){delete _0x290ef9[_0x7911('0x4b')]['id'];}return db['Interval']['find']({'where':{'id':_0x290ef9[_0x7911('0x45')]['id']}})[_0x7911('0x23')](handleEntityNotFound(_0x4acae1,null))[_0x7911('0x23')](saveUpdates(_0x290ef9[_0x7911('0x4b')],null))['then'](respondWithResult(_0x4acae1,null))[_0x7911('0x43')](handleError(_0x4acae1,null));};exports[_0x7911('0x22')]=function(_0x358d97,_0x31c09f){return db[_0x7911('0x2d')]['find']({'where':{'id':_0x358d97[_0x7911('0x45')]['id']}})[_0x7911('0x23')](handleEntityNotFound(_0x31c09f,null))[_0x7911('0x23')](removeEntity(_0x31c09f,null))[_0x7911('0x43')](handleError(_0x31c09f,null));};exports[_0x7911('0x53')]=function(_0x1f3d2b,_0x5c32e6,_0x462d56){if(_0x1f3d2b[_0x7911('0x4b')]['id']){delete _0x1f3d2b[_0x7911('0x4b')]['id'];}return db[_0x7911('0x2d')][_0x7911('0x49')]({'where':{'id':_0x1f3d2b[_0x7911('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c32e6,null))[_0x7911('0x23')](function(_0x1dfb92){if(_0x1dfb92){_0x1f3d2b[_0x7911('0x4b')]['IntervalId']=_0x1dfb92['id'];return db[_0x7911('0x2d')][_0x7911('0x4a')](_0x1f3d2b[_0x7911('0x4b')]);}})[_0x7911('0x23')](respondWithResult(_0x5c32e6,null))['catch'](handleError(_0x5c32e6,null));};exports[_0x7911('0x54')]=function(_0x493f19,_0x268992,_0x18c178){var _0x4f52c9={};var _0x497ea9={};var _0x12d775;var _0x3d6407;return db[_0x7911('0x2d')]['findOne']({'where':{'id':_0x493f19['params']['id']}})[_0x7911('0x23')](handleEntityNotFound(_0x268992,null))[_0x7911('0x23')](function(_0x19b7d2){if(_0x19b7d2){_0x12d775=_0x19b7d2;_0x497ea9['model']=_['keys'](db[_0x7911('0x2d')][_0x7911('0x46')]);_0x497ea9[_0x7911('0x32')]=_['keys'](_0x493f19[_0x7911('0x32')]);_0x497ea9[_0x7911('0x34')]=_[_0x7911('0x36')](_0x497ea9[_0x7911('0x31')],_0x497ea9[_0x7911('0x32')]);_0x4f52c9[_0x7911('0x35')]=_['intersection'](_0x497ea9[_0x7911('0x31')],qs[_0x7911('0x37')](_0x493f19[_0x7911('0x32')][_0x7911('0x37')]));_0x4f52c9['attributes']=_0x4f52c9[_0x7911('0x35')][_0x7911('0x38')]?_0x4f52c9[_0x7911('0x35')]:_0x497ea9['model'];_0x4f52c9[_0x7911('0x55')]=qs[_0x7911('0x3b')](_0x493f19[_0x7911('0x32')][_0x7911('0x3b')]);_0x4f52c9[_0x7911('0x3c')]=qs[_0x7911('0x34')](_[_0x7911('0x56')](_0x493f19[_0x7911('0x32')],_0x497ea9['filters']));if(_0x493f19[_0x7911('0x32')][_0x7911('0x3d')]){_0x4f52c9['where']=_[_0x7911('0x3f')](_0x4f52c9[_0x7911('0x3c')],{'$or':_[_0x7911('0x2c')](_0x4f52c9['attributes'],function(_0x4ae7db){var _0x512fb2={};_0x512fb2[_0x4ae7db]={'$like':'%'+_0x493f19[_0x7911('0x32')]['filter']+'%'};return _0x512fb2;})});}_0x4f52c9=_['merge']({},_0x4f52c9,_0x493f19[_0x7911('0x40')]);return _0x12d775['getIntervals'](_0x4f52c9);}})[_0x7911('0x23')](function(_0x4a58b9){if(_0x4a58b9){_0x3d6407=_0x4a58b9[_0x7911('0x38')];if(!_0x493f19[_0x7911('0x32')][_0x7911('0x39')](_0x7911('0x3a'))){_0x4f52c9['limit']=qs[_0x7911('0x1d')](_0x493f19[_0x7911('0x32')][_0x7911('0x1d')]);_0x4f52c9[_0x7911('0x1b')]=qs[_0x7911('0x1b')](_0x493f19[_0x7911('0x32')]['offset']);}return _0x12d775['getIntervals'](_0x4f52c9);}})[_0x7911('0x23')](function(_0xa8373d){if(_0xa8373d){return _0xa8373d?{'count':_0x3d6407,'rows':_0xa8373d}:null;}})['then'](respondWithResult(_0x268992,null))[_0x7911('0x43')](handleError(_0x268992,null));};exports[_0x7911('0x57')]=function(_0x603857,_0x37d03a,_0xb58efd){return db['Interval'][_0x7911('0x58')]({'where':{'id':_0x603857[_0x7911('0x45')]['id']}})[_0x7911('0x23')](handleEntityNotFound(_0x37d03a,null))[_0x7911('0x23')](function(_0x51e261){if(_0x51e261){return db['sequelize']['transaction'](function(_0x2c6e66){return db[_0x7911('0x2d')][_0x7911('0x22')]({'where':{'IntervalId':_0x603857[_0x7911('0x45')]['id']},'transaction':_0x2c6e66})['then'](function(_0xa7eeed){var _0x25bffc=_[_0x7911('0x2c')](_0x603857['body'],function(_0x36933c){delete _0x36933c['id'];_0x36933c[_0x7911('0x59')]=_0x603857[_0x7911('0x45')]['id'];return _0x36933c;});return db['Interval'][_0x7911('0x5a')](_0x25bffc,{'transaction':_0x2c6e66});});})['then'](function(){return db['Interval'][_0x7911('0x41')]({'where':{'IntervalId':_0x603857[_0x7911('0x45')]['id']}});});}})[_0x7911('0x23')](respondWithResult(_0x37d03a,null))['catch'](handleError(_0x37d03a,null));}; \ No newline at end of file +var _0x95b1=['keys','rawAttributes','sort','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','fieldName','key','model','map','query','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','Interval','includeAll','include','findAll','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','findOne'];(function(_0x5553a3,_0x2e737d){var _0x4ce977=function(_0x297ae8){while(--_0x297ae8){_0x5553a3['push'](_0x5553a3['shift']());}};_0x4ce977(++_0x2e737d);}(_0x95b1,0x178));var _0x195b=function(_0x5ced4f,_0x5d2ab7){_0x5ced4f=_0x5ced4f-0x0;var _0x125c1c=_0x95b1[_0x5ced4f];return _0x125c1c;};'use strict';var emlformat=require(_0x195b('0x0'));var rimraf=require(_0x195b('0x1'));var zipdir=require(_0x195b('0x2'));var jsonpatch=require(_0x195b('0x3'));var rp=require('request-promise');var moment=require(_0x195b('0x4'));var BPromise=require(_0x195b('0x5'));var Mustache=require(_0x195b('0x6'));var util=require(_0x195b('0x7'));var path=require(_0x195b('0x8'));var sox=require(_0x195b('0x9'));var csv=require('to-csv');var ejs=require(_0x195b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x195b('0xb'));var squel=require(_0x195b('0xc'));var crypto=require('crypto');var jsforce=require(_0x195b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x195b('0xe'));var Papa=require(_0x195b('0xf'));var Redis=require(_0x195b('0x10'));var authService=require(_0x195b('0x11'));var qs=require(_0x195b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x195b('0x13'))(_0x195b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x195b('0x15'));var db=require(_0x195b('0x16'))['db'];var extensions=require(_0x195b('0x17'));function respondWithStatusCode(_0x399047,_0x46091a){_0x46091a=_0x46091a||0xcc;return function(_0x5467e5){if(_0x5467e5){return _0x399047[_0x195b('0x18')](_0x46091a);}return _0x399047['status'](_0x46091a)[_0x195b('0x19')]();};}function respondWithResult(_0x84fc0a,_0x2f16d5){_0x2f16d5=_0x2f16d5||0xc8;return function(_0x19211b){if(_0x19211b){return _0x84fc0a[_0x195b('0x1a')](_0x2f16d5)[_0x195b('0x1b')](_0x19211b);}};}function respondWithFilteredResult(_0x5a277c,_0x29da54){return function(_0x50bf4e){if(_0x50bf4e){var _0x470876=typeof _0x29da54[_0x195b('0x1c')]===_0x195b('0x1d')&&typeof _0x29da54[_0x195b('0x1e')]===_0x195b('0x1d');var _0xa72597=_0x50bf4e['count'];var _0x5870d4=_0x470876?0x0:_0x29da54[_0x195b('0x1c')];var _0x33eaf9=_0x470876?_0x50bf4e[_0x195b('0x1f')]:_0x29da54[_0x195b('0x1c')]+_0x29da54[_0x195b('0x1e')];var _0x13f51c;if(_0x33eaf9>=_0xa72597){_0x33eaf9=_0xa72597;_0x13f51c=0xc8;}else{_0x13f51c=0xce;}_0x5a277c['status'](_0x13f51c);return _0x5a277c[_0x195b('0x20')](_0x195b('0x21'),_0x5870d4+'-'+_0x33eaf9+'/'+_0xa72597)[_0x195b('0x1b')](_0x50bf4e);}return null;};}function patchUpdates(_0x2a86bd){return function(_0x3cacd6){try{jsonpatch[_0x195b('0x22')](_0x3cacd6,_0x2a86bd,!![]);}catch(_0x47ff59){return BPromise[_0x195b('0x23')](_0x47ff59);}return _0x3cacd6[_0x195b('0x24')]();};}function saveUpdates(_0x106aaa,_0x3acbca){return function(_0x232cd1){if(_0x232cd1){return _0x232cd1[_0x195b('0x25')](_0x106aaa)[_0x195b('0x26')](function(_0x3e4fde){return _0x3e4fde;});}return null;};}function removeEntity(_0xd01ccb,_0x206356){return function(_0x325f64){if(_0x325f64){return _0x325f64[_0x195b('0x27')]()[_0x195b('0x26')](function(){var _0x1fbb36=_0x325f64[_0x195b('0x28')]({'plain':!![]});var _0x360efe='Intervals';return db[_0x195b('0x29')]['destroy']({'where':{'type':_0x360efe,'resourceId':_0x1fbb36['id']}})[_0x195b('0x26')](function(){return _0x325f64;});})[_0x195b('0x26')](function(){_0xd01ccb[_0x195b('0x1a')](0xcc)[_0x195b('0x19')]();});}};}function handleEntityNotFound(_0x538beb,_0xb3f711){return function(_0x3687a2){if(!_0x3687a2){_0x538beb[_0x195b('0x18')](0x194);}return _0x3687a2;};}function handleError(_0x34078d,_0x4b7f63){_0x4b7f63=_0x4b7f63||0x1f4;return function(_0x19c1f6){logger[_0x195b('0x2a')](_0x19c1f6[_0x195b('0x2b')]);if(_0x19c1f6[_0x195b('0x2c')]){delete _0x19c1f6[_0x195b('0x2c')];}_0x34078d[_0x195b('0x1a')](_0x4b7f63)[_0x195b('0x2d')](_0x19c1f6);};}exports['index']=function(_0x3c06c9,_0x2ca6aa){var _0x52f3ed={},_0x19ed0b={},_0x3c1699={'count':0x0,'rows':[]};var _0x193eb1=_['map'](db['Interval']['rawAttributes'],function(_0x2293c5){return{'name':_0x2293c5[_0x195b('0x2e')],'type':_0x2293c5['type'][_0x195b('0x2f')]};});_0x19ed0b[_0x195b('0x30')]=_[_0x195b('0x31')](_0x193eb1,'name');_0x19ed0b[_0x195b('0x32')]=_['keys'](_0x3c06c9[_0x195b('0x32')]);_0x19ed0b['filters']=_[_0x195b('0x33')](_0x19ed0b[_0x195b('0x30')],_0x19ed0b[_0x195b('0x32')]);_0x52f3ed[_0x195b('0x34')]=_[_0x195b('0x33')](_0x19ed0b[_0x195b('0x30')],qs[_0x195b('0x35')](_0x3c06c9[_0x195b('0x32')][_0x195b('0x35')]));_0x52f3ed['attributes']=_0x52f3ed[_0x195b('0x34')]['length']?_0x52f3ed[_0x195b('0x34')]:_0x19ed0b['model'];if(!_0x3c06c9[_0x195b('0x32')][_0x195b('0x36')]('nolimit')){_0x52f3ed['limit']=qs[_0x195b('0x1e')](_0x3c06c9[_0x195b('0x32')]['limit']);_0x52f3ed[_0x195b('0x1c')]=qs['offset'](_0x3c06c9['query']['offset']);}_0x52f3ed[_0x195b('0x37')]=qs['sort'](_0x3c06c9['query']['sort']);_0x52f3ed[_0x195b('0x38')]=qs[_0x195b('0x39')](_[_0x195b('0x3a')](_0x3c06c9[_0x195b('0x32')],_0x19ed0b[_0x195b('0x39')]),_0x193eb1);if(_0x3c06c9[_0x195b('0x32')][_0x195b('0x3b')]){_0x52f3ed[_0x195b('0x38')]=_[_0x195b('0x3c')](_0x52f3ed['where'],{'$or':_[_0x195b('0x31')](_0x193eb1,function(_0x2def7d){if(_0x2def7d[_0x195b('0x3d')]!==_0x195b('0x3e')){var _0x240443={};_0x240443[_0x2def7d[_0x195b('0x2c')]]={'$like':'%'+_0x3c06c9[_0x195b('0x32')][_0x195b('0x3b')]+'%'};return _0x240443;}})});}_0x52f3ed=_[_0x195b('0x3c')]({},_0x52f3ed,_0x3c06c9[_0x195b('0x3f')]);var _0xd998eb={'where':_0x52f3ed[_0x195b('0x38')]};return db[_0x195b('0x40')][_0x195b('0x1f')](_0xd998eb)[_0x195b('0x26')](function(_0x468943){_0x3c1699['count']=_0x468943;if(_0x3c06c9[_0x195b('0x32')][_0x195b('0x41')]){_0x52f3ed[_0x195b('0x42')]=[{'all':!![]}];}return db[_0x195b('0x40')][_0x195b('0x43')](_0x52f3ed);})[_0x195b('0x26')](function(_0x178932){_0x3c1699['rows']=_0x178932;return _0x3c1699;})['then'](respondWithFilteredResult(_0x2ca6aa,_0x52f3ed))[_0x195b('0x44')](handleError(_0x2ca6aa,null));};exports['show']=function(_0x2fd547,_0x5584ae){var _0x15213c={'raw':!![],'where':{'id':_0x2fd547[_0x195b('0x45')]['id']}},_0x4c67fb={};_0x4c67fb[_0x195b('0x30')]=_['keys'](db['Interval']['rawAttributes']);_0x4c67fb[_0x195b('0x32')]=_['keys'](_0x2fd547['query']);_0x4c67fb[_0x195b('0x39')]=_[_0x195b('0x33')](_0x4c67fb[_0x195b('0x30')],_0x4c67fb[_0x195b('0x32')]);_0x15213c['attributes']=_['intersection'](_0x4c67fb[_0x195b('0x30')],qs[_0x195b('0x35')](_0x2fd547['query'][_0x195b('0x35')]));_0x15213c[_0x195b('0x34')]=_0x15213c[_0x195b('0x34')][_0x195b('0x46')]?_0x15213c[_0x195b('0x34')]:_0x4c67fb['model'];if(_0x2fd547['query']['includeAll']){_0x15213c[_0x195b('0x42')]=[{'all':!![]}];}_0x15213c=_[_0x195b('0x3c')]({},_0x15213c,_0x2fd547['options']);return db[_0x195b('0x40')]['find'](_0x15213c)[_0x195b('0x26')](handleEntityNotFound(_0x5584ae,null))[_0x195b('0x26')](respondWithResult(_0x5584ae,null))[_0x195b('0x44')](handleError(_0x5584ae,null));};exports[_0x195b('0x47')]=function(_0x59b426,_0x10cbbf){return db[_0x195b('0x40')][_0x195b('0x47')](_0x59b426[_0x195b('0x48')],{})[_0x195b('0x26')](function(_0x11369e){var _0xc4d769=_0x59b426[_0x195b('0x49')][_0x195b('0x28')]({'plain':!![]});if(!_0xc4d769)throw new Error(_0x195b('0x4a'));if(_0xc4d769['role']==='user'){var _0x22e90d=_0x11369e[_0x195b('0x28')]({'plain':!![]});var _0x4ced9b=_0x195b('0x4b');return db[_0x195b('0x4c')][_0x195b('0x4d')]({'where':{'name':_0x4ced9b,'userProfileId':_0xc4d769[_0x195b('0x4e')]},'raw':!![]})[_0x195b('0x26')](function(_0x11e1d3){if(_0x11e1d3&&_0x11e1d3[_0x195b('0x4f')]===0x0){return db[_0x195b('0x29')][_0x195b('0x47')]({'name':_0x22e90d['name'],'resourceId':_0x22e90d['id'],'type':_0x11e1d3[_0x195b('0x2c')],'sectionId':_0x11e1d3['id']},{})[_0x195b('0x26')](function(){return _0x11369e;});}else{return _0x11369e;}})[_0x195b('0x44')](function(_0x3e3677){logger['error'](_0x195b('0x50'),_0x3e3677);throw _0x3e3677;});}return _0x11369e;})[_0x195b('0x26')](respondWithResult(_0x10cbbf,0xc9))[_0x195b('0x44')](handleError(_0x10cbbf,null));};exports[_0x195b('0x25')]=function(_0x4e628e,_0x16f7d0){if(_0x4e628e[_0x195b('0x48')]['id']){delete _0x4e628e['body']['id'];}return db[_0x195b('0x40')][_0x195b('0x4d')]({'where':{'id':_0x4e628e[_0x195b('0x45')]['id']}})['then'](handleEntityNotFound(_0x16f7d0,null))[_0x195b('0x26')](saveUpdates(_0x4e628e[_0x195b('0x48')],null))['then'](respondWithResult(_0x16f7d0,null))[_0x195b('0x44')](handleError(_0x16f7d0,null));};exports[_0x195b('0x27')]=function(_0x3005c3,_0x2408b1){return db[_0x195b('0x40')][_0x195b('0x4d')]({'where':{'id':_0x3005c3[_0x195b('0x45')]['id']}})[_0x195b('0x26')](handleEntityNotFound(_0x2408b1,null))[_0x195b('0x26')](removeEntity(_0x2408b1,null))['catch'](handleError(_0x2408b1,null));};exports[_0x195b('0x51')]=function(_0xa7dc3d,_0x1a8053,_0x349d9d){if(_0xa7dc3d[_0x195b('0x48')]['id']){delete _0xa7dc3d[_0x195b('0x48')]['id'];}return db[_0x195b('0x40')][_0x195b('0x4d')]({'where':{'id':_0xa7dc3d[_0x195b('0x45')]['id']}})[_0x195b('0x26')](handleEntityNotFound(_0x1a8053,null))[_0x195b('0x26')](function(_0xe63c03){if(_0xe63c03){_0xa7dc3d[_0x195b('0x48')][_0x195b('0x52')]=_0xe63c03['id'];return db['Interval'][_0x195b('0x47')](_0xa7dc3d[_0x195b('0x48')]);}})[_0x195b('0x26')](respondWithResult(_0x1a8053,null))['catch'](handleError(_0x1a8053,null));};exports['getIntervals']=function(_0x54f664,_0x5263a8,_0x1ac3cf){var _0x5bdf8e={};var _0x4d6a78={};var _0x56c65b;var _0x44d2de;return db[_0x195b('0x40')][_0x195b('0x53')]({'where':{'id':_0x54f664[_0x195b('0x45')]['id']}})[_0x195b('0x26')](handleEntityNotFound(_0x5263a8,null))['then'](function(_0x13833b){if(_0x13833b){_0x56c65b=_0x13833b;_0x4d6a78[_0x195b('0x30')]=_[_0x195b('0x54')](db['Interval'][_0x195b('0x55')]);_0x4d6a78['query']=_[_0x195b('0x54')](_0x54f664[_0x195b('0x32')]);_0x4d6a78[_0x195b('0x39')]=_[_0x195b('0x33')](_0x4d6a78['model'],_0x4d6a78[_0x195b('0x32')]);_0x5bdf8e[_0x195b('0x34')]=_[_0x195b('0x33')](_0x4d6a78[_0x195b('0x30')],qs[_0x195b('0x35')](_0x54f664[_0x195b('0x32')]['fields']));_0x5bdf8e[_0x195b('0x34')]=_0x5bdf8e[_0x195b('0x34')][_0x195b('0x46')]?_0x5bdf8e[_0x195b('0x34')]:_0x4d6a78['model'];_0x5bdf8e[_0x195b('0x37')]=qs[_0x195b('0x56')](_0x54f664[_0x195b('0x32')][_0x195b('0x56')]);_0x5bdf8e['where']=qs['filters'](_[_0x195b('0x3a')](_0x54f664[_0x195b('0x32')],_0x4d6a78[_0x195b('0x39')]));if(_0x54f664[_0x195b('0x32')]['filter']){_0x5bdf8e[_0x195b('0x38')]=_[_0x195b('0x3c')](_0x5bdf8e[_0x195b('0x38')],{'$or':_[_0x195b('0x31')](_0x5bdf8e[_0x195b('0x34')],function(_0x55a4d3){var _0x4fc0b7={};_0x4fc0b7[_0x55a4d3]={'$like':'%'+_0x54f664[_0x195b('0x32')][_0x195b('0x3b')]+'%'};return _0x4fc0b7;})});}_0x5bdf8e=_[_0x195b('0x3c')]({},_0x5bdf8e,_0x54f664[_0x195b('0x3f')]);return _0x56c65b[_0x195b('0x57')](_0x5bdf8e);}})[_0x195b('0x26')](function(_0x13022b){if(_0x13022b){_0x44d2de=_0x13022b['length'];if(!_0x54f664[_0x195b('0x32')]['hasOwnProperty']('nolimit')){_0x5bdf8e[_0x195b('0x1e')]=qs[_0x195b('0x1e')](_0x54f664[_0x195b('0x32')][_0x195b('0x1e')]);_0x5bdf8e[_0x195b('0x1c')]=qs[_0x195b('0x1c')](_0x54f664[_0x195b('0x32')]['offset']);}return _0x56c65b[_0x195b('0x57')](_0x5bdf8e);}})[_0x195b('0x26')](function(_0x26cc79){if(_0x26cc79){return _0x26cc79?{'count':_0x44d2de,'rows':_0x26cc79}:null;}})[_0x195b('0x26')](respondWithResult(_0x5263a8,null))[_0x195b('0x44')](handleError(_0x5263a8,null));};exports[_0x195b('0x58')]=function(_0x10bcae,_0x5028fd,_0x57119d){return db['Interval']['findOne']({'where':{'id':_0x10bcae[_0x195b('0x45')]['id']}})[_0x195b('0x26')](handleEntityNotFound(_0x5028fd,null))['then'](function(_0x41f1b5){if(_0x41f1b5){return db[_0x195b('0x59')][_0x195b('0x5a')](function(_0xb34d29){return db[_0x195b('0x40')]['destroy']({'where':{'IntervalId':_0x10bcae[_0x195b('0x45')]['id']},'transaction':_0xb34d29})[_0x195b('0x26')](function(_0x2a57ef){var _0x29845b=_['map'](_0x10bcae[_0x195b('0x48')],function(_0x233786){delete _0x233786['id'];_0x233786[_0x195b('0x52')]=_0x10bcae[_0x195b('0x45')]['id'];return _0x233786;});return db['Interval'][_0x195b('0x5b')](_0x29845b,{'transaction':_0xb34d29});});})['then'](function(){return db[_0x195b('0x40')][_0x195b('0x43')]({'where':{'IntervalId':_0x10bcae[_0x195b('0x45')]['id']}});});}})[_0x195b('0x26')](respondWithResult(_0x5028fd,null))[_0x195b('0x44')](handleError(_0x5028fd,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index c0752c8..4b684f2 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 _0x137b=['rewrite','interval','string','then','map','ifTime','reduce','./interval.attributes','../../utils/iftime','exports','define','tools_intervals'];(function(_0x56d6f0,_0x25ded3){var _0x39fe78=function(_0x23f339){while(--_0x23f339){_0x56d6f0['push'](_0x56d6f0['shift']());}};_0x39fe78(++_0x25ded3);}(_0x137b,0x1f3));var _0xb137=function(_0x2ae5ce,_0x481760){_0x2ae5ce=_0x2ae5ce-0x0;var _0x3ccd3c=_0x137b[_0x2ae5ce];return _0x3ccd3c;};'use strict';var attributes=require(_0xb137('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xb137('0x1'))['iftime'];module[_0xb137('0x2')]=function(_0x6811ae){return _0x6811ae[_0xb137('0x3')]('Interval',attributes,{'tableName':_0xb137('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2721a0){extensions['rewrite'](_0x6811ae,_0x2721a0);},'afterBulkCreate':function(_0x278809,_0x2fb10d,_0x5d7ef9){_0x5d7ef9();extensions[_0xb137('0x5')](_0x6811ae,_0x278809[0x0]);},'afterUpdate':function(_0x39fe4a){extensions[_0xb137('0x5')](_0x6811ae,_0x39fe4a);},'afterDestroy':function(_0x2d76bf){extensions[_0xb137('0x5')](_0x6811ae,_0x2d76bf);}},'instanceMethods':{'ifTime':function(_0x23d6b2=undefined,_0x1aab71=new Date()){if(typeof this[_0xb137('0x6')]===_0xb137('0x7')){return iftime(this[_0xb137('0x6')],_0x23d6b2,_0x1aab71);}else{return this['getIntervals']()[_0xb137('0x8')](function(_0x42bc20){return Promise['all'](_0x42bc20[_0xb137('0x9')](function(_0x517a68){return _0x517a68[_0xb137('0xa')](_0x23d6b2,_0x1aab71);}));})[_0xb137('0x8')](function(_0x4d334f){return _0x4d334f[_0xb137('0xb')](function(_0x4552d6,_0x3b519c){return _0x4552d6||_0x3b519c;},![]);});}}}});}; \ No newline at end of file +var _0x0725=['all','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','getIntervals','then'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x0725,0xff));var _0x5072=function(_0x4d8e4f,_0x2b2953){_0x4d8e4f=_0x4d8e4f-0x0;var _0x43abd0=_0x0725[_0x4d8e4f];return _0x43abd0;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x5072('0x0'));var iftime=require(_0x5072('0x1'))[_0x5072('0x2')];module[_0x5072('0x3')]=function(_0x9430e5){return _0x9430e5[_0x5072('0x4')](_0x5072('0x5'),attributes,{'tableName':_0x5072('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bf38d){extensions[_0x5072('0x7')](_0x9430e5,_0x3bf38d);},'afterBulkCreate':function(_0xd185f6,_0x86a2fe,_0x153d6b){_0x153d6b();extensions[_0x5072('0x7')](_0x9430e5,_0xd185f6[0x0]);},'afterUpdate':function(_0x2debdb){extensions[_0x5072('0x7')](_0x9430e5,_0x2debdb);},'afterDestroy':function(_0x81fa2c){extensions[_0x5072('0x7')](_0x9430e5,_0x81fa2c);}},'instanceMethods':{'ifTime':function(_0x2d1f57=undefined,_0x1955f5=new Date()){if(typeof this[_0x5072('0x8')]==='string'){return iftime(this[_0x5072('0x8')],_0x2d1f57,_0x1955f5);}else{return this[_0x5072('0x9')]()[_0x5072('0xa')](function(_0x2b528a){return Promise[_0x5072('0xb')](_0x2b528a['map'](function(_0x579112){return _0x579112[_0x5072('0xc')](_0x2d1f57,_0x1955f5);}));})[_0x5072('0xa')](function(_0x192bcd){return _0x192bcd[_0x5072('0xd')](function(_0x539331,_0x55ca17){return _0x539331||_0x55ca17;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 86829e9..8eb7f9d 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 _0xf3d4=['rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','message','error','ShowInterval','find','info','stringify','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','IntervalIftime','resolve','catch','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0xf3d4,0x1d4));var _0x4f3d=function(_0x6a380d,_0x37527b){_0x6a380d=_0x6a380d-0x0;var _0xc76b5a=_0xf3d4[_0x6a380d];return _0xc76b5a;};'use strict';var _=require('lodash');var util=require(_0x4f3d('0x0'));var db=require(_0x4f3d('0x1'))['db'];var iftime=require(_0x4f3d('0x2'))[_0x4f3d('0x3')];var logger=require(_0x4f3d('0x4'))(_0x4f3d('0x5'));exports[_0x4f3d('0x6')]=function(_0x5159d1){var _0x2a5c5f=this;return new Promise(function(_0x174f05,_0xc5ab66){return db[_0x4f3d('0x7')][_0x4f3d('0x8')]({'raw':_0x5159d1[_0x4f3d('0x9')]?_0x5159d1[_0x4f3d('0x9')][_0x4f3d('0xa')]===undefined?!![]:![]:!![],'where':_0x5159d1[_0x4f3d('0x9')]?_0x5159d1['options'][_0x4f3d('0xb')]||null:null,'attributes':_0x5159d1['options']?_0x5159d1[_0x4f3d('0x9')][_0x4f3d('0xc')]||null:null,'limit':_0x5159d1['options']?_0x5159d1[_0x4f3d('0x9')][_0x4f3d('0xd')]||null:null,'include':_0x5159d1['options']?_0x5159d1['options']['include']?_['map'](_0x5159d1[_0x4f3d('0x9')]['include'],function(_0x3e94ad){return{'model':db[_0x3e94ad['model']],'as':_0x3e94ad['as'],'attributes':_0x3e94ad['attributes'],'include':_0x3e94ad[_0x4f3d('0xe')]?_['map'](_0x3e94ad['include'],function(_0x5a66d5){return{'model':db[_0x5a66d5['model']],'as':_0x5a66d5['as'],'attributes':_0x5a66d5['attributes'],'include':_0x5a66d5[_0x4f3d('0xe')]?_[_0x4f3d('0xf')](_0x5a66d5[_0x4f3d('0xe')],function(_0x46cd1b){return{'model':db[_0x46cd1b[_0x4f3d('0x10')]],'as':_0x46cd1b['as'],'attributes':_0x46cd1b[_0x4f3d('0xc')]};}):[]};}):[]};}):[]:[]})[_0x4f3d('0x11')](function(_0x2b3614){logger['info'](_0x4f3d('0x6'),_0x5159d1);logger[_0x4f3d('0x12')](_0x4f3d('0x6'),_0x5159d1,JSON['stringify'](_0x2b3614));_0x174f05(_0x2b3614);})['catch'](function(_0x588cad){logger['error']('GetInterval',_0x588cad[_0x4f3d('0x13')],_0x5159d1);_0xc5ab66(_0x2a5c5f[_0x4f3d('0x14')](0x1f4,_0x588cad[_0x4f3d('0x13')]));});});};exports[_0x4f3d('0x15')]=function(_0x5e6391){var _0x23ff30=this;return new Promise(function(_0x415ac6,_0x497ce5){return db['Interval'][_0x4f3d('0x16')]({'raw':_0x5e6391[_0x4f3d('0x9')]?_0x5e6391[_0x4f3d('0x9')][_0x4f3d('0xa')]===undefined?!![]:![]:!![],'where':_0x5e6391['options']?_0x5e6391[_0x4f3d('0x9')][_0x4f3d('0xb')]||null:null,'attributes':_0x5e6391[_0x4f3d('0x9')]?_0x5e6391[_0x4f3d('0x9')][_0x4f3d('0xc')]||null:null,'include':_0x5e6391[_0x4f3d('0x9')]?_0x5e6391[_0x4f3d('0x9')][_0x4f3d('0xe')]?_[_0x4f3d('0xf')](_0x5e6391['options'][_0x4f3d('0xe')],function(_0x1d834b){return{'model':db[_0x1d834b[_0x4f3d('0x10')]],'as':_0x1d834b['as'],'attributes':_0x1d834b['attributes'],'include':_0x1d834b[_0x4f3d('0xe')]?_['map'](_0x1d834b['include'],function(_0x5e494e){return{'model':db[_0x5e494e[_0x4f3d('0x10')]],'as':_0x5e494e['as'],'attributes':_0x5e494e['attributes'],'include':_0x5e494e[_0x4f3d('0xe')]?_[_0x4f3d('0xf')](_0x5e494e['include'],function(_0x390675){return{'model':db[_0x390675[_0x4f3d('0x10')]],'as':_0x390675['as'],'attributes':_0x390675[_0x4f3d('0xc')]};}):[]};}):[]};}):[]:[]})[_0x4f3d('0x11')](function(_0x4f17b0){logger[_0x4f3d('0x17')](_0x4f3d('0x15'),_0x5e6391);logger['debug'](_0x4f3d('0x15'),_0x5e6391,JSON[_0x4f3d('0x18')](_0x4f17b0));_0x415ac6(_0x4f17b0);})['catch'](function(_0x516172){logger[_0x4f3d('0x14')](_0x4f3d('0x15'),_0x516172[_0x4f3d('0x13')],_0x5e6391);_0x497ce5(_0x23ff30[_0x4f3d('0x14')](0x1f4,_0x516172[_0x4f3d('0x13')]));});});};function checkArrayOfIntervals(_0x54fdc3,_0xfeb462){var _0x587e71=[];return db[_0x4f3d('0x7')][_0x4f3d('0x8')]({'where':{'id':_0x54fdc3}})[_0x4f3d('0x11')](function(_0x1dc53d){_0x587e71=_0x1dc53d;return Promise[_0x4f3d('0x19')](_0x587e71[_0x4f3d('0xf')](function(_0x46c91a){return _0x46c91a['ifTime'](_0xfeb462);}));})[_0x4f3d('0x11')](function(_0x5c5ac3){var _0x458ade=_0x5c5ac3[_0x4f3d('0x1a')](function(_0x16c880,_0x286d8c){return _0x16c880||_0x286d8c;},![]);logger[_0x4f3d('0x17')](util[_0x4f3d('0x1b')](_0x4f3d('0x1c'),_0x587e71[_0x4f3d('0xf')](function(_0x21671b){return _0x21671b[_0x4f3d('0x1d')];})[_0x4f3d('0x1e')](',\x20'),_0x587e71['map'](function(_0x1c5f0d){return _0x1c5f0d['id'];})[_0x4f3d('0x1e')](',\x20')));return _0x458ade;});}function checkSingleInterval(_0x1798dc,_0x4d3c9d){return db[_0x4f3d('0x7')][_0x4f3d('0x1f')](_0x1798dc)['then'](function(_0x395807){if(_0x395807){logger['info'](util['format'](_0x4f3d('0x20'),_0x395807[_0x4f3d('0x1d')],_0x395807['id']));return _0x395807[_0x4f3d('0x21')](_0x4d3c9d);}});}exports['IntervalIftime']=function(_0x659388){var _0x43d5c3=_0x659388['intervalIds'];var _0x510560=Array[_0x4f3d('0x22')](_0x659388['intervals'])?_0x659388[_0x4f3d('0x23')]:typeof _0x659388['intervals']==='string'?[_0x659388[_0x4f3d('0x23')]]:[];var _0x473144=_0x659388[_0x4f3d('0x24')]||undefined;var _0x58f82b=![];if(_0x510560[_0x4f3d('0x25')]){logger['info'](util[_0x4f3d('0x1b')](_0x4f3d('0x26'),_0x510560[_0x4f3d('0x1e')](';\x20')));}if(_0x473144){logger[_0x4f3d('0x17')](util['format'](_0x4f3d('0x27'),_0x473144));}logger[_0x4f3d('0x12')]('Iftime',_0x58f82b);logger['silly'](_0x4f3d('0x28'),_0x659388);return Promise[_0x4f3d('0x29')]()[_0x4f3d('0x11')](function(){if(Array[_0x4f3d('0x22')](_0x43d5c3)){return checkArrayOfIntervals(_0x43d5c3,_0x473144);}else if(_0x43d5c3){return checkSingleInterval(_0x43d5c3,_0x473144);}})[_0x4f3d('0x11')](function(_0x111644){var _0x2ef3c9=_0x510560['reduce'](function(_0x16a3d4,_0x5b5540){return _0x16a3d4||iftime(_0x5b5540,_0x473144);},![]);_0x58f82b=_0x111644||_0x2ef3c9;return _0x58f82b;})[_0x4f3d('0x2a')](function(_0x12a6a4){logger[_0x4f3d('0x14')](_0x4f3d('0x28'),_0x659388,_0x12a6a4);throw this[_0x4f3d('0x14')](0x1f4,_0x12a6a4[_0x4f3d('0x13')]);});}; \ No newline at end of file +var _0x6b75=['stringify','all','ifTime','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','IntervalIftime','resolve','reduce','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','include','model','map','then','info','debug','catch','error','message','ShowInterval','find'];(function(_0x42c9a1,_0x38f036){var _0x51e81a=function(_0x36a3ac){while(--_0x36a3ac){_0x42c9a1['push'](_0x42c9a1['shift']());}};_0x51e81a(++_0x38f036);}(_0x6b75,0x6b));var _0x56b7=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x6b75[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x56b7('0x0'));var util=require(_0x56b7('0x1'));var db=require(_0x56b7('0x2'))['db'];var iftime=require(_0x56b7('0x3'))[_0x56b7('0x4')];var logger=require(_0x56b7('0x5'))(_0x56b7('0x6'));exports[_0x56b7('0x7')]=function(_0x482eac){var _0xd3c6c1=this;return new Promise(function(_0x209ce2,_0x3209ac){return db[_0x56b7('0x8')][_0x56b7('0x9')]({'raw':_0x482eac['options']?_0x482eac[_0x56b7('0xa')][_0x56b7('0xb')]===undefined?!![]:![]:!![],'where':_0x482eac[_0x56b7('0xa')]?_0x482eac['options'][_0x56b7('0xc')]||null:null,'attributes':_0x482eac['options']?_0x482eac[_0x56b7('0xa')][_0x56b7('0xd')]||null:null,'limit':_0x482eac[_0x56b7('0xa')]?_0x482eac['options']['limit']||null:null,'include':_0x482eac[_0x56b7('0xa')]?_0x482eac[_0x56b7('0xa')]['include']?_['map'](_0x482eac['options'][_0x56b7('0xe')],function(_0x2e83e6){return{'model':db[_0x2e83e6[_0x56b7('0xf')]],'as':_0x2e83e6['as'],'attributes':_0x2e83e6[_0x56b7('0xd')],'include':_0x2e83e6['include']?_[_0x56b7('0x10')](_0x2e83e6[_0x56b7('0xe')],function(_0x11d5a8){return{'model':db[_0x11d5a8[_0x56b7('0xf')]],'as':_0x11d5a8['as'],'attributes':_0x11d5a8['attributes'],'include':_0x11d5a8[_0x56b7('0xe')]?_[_0x56b7('0x10')](_0x11d5a8[_0x56b7('0xe')],function(_0x51a564){return{'model':db[_0x51a564['model']],'as':_0x51a564['as'],'attributes':_0x51a564[_0x56b7('0xd')]};}):[]};}):[]};}):[]:[]})[_0x56b7('0x11')](function(_0x46cf7){logger[_0x56b7('0x12')](_0x56b7('0x7'),_0x482eac);logger[_0x56b7('0x13')](_0x56b7('0x7'),_0x482eac,JSON['stringify'](_0x46cf7));_0x209ce2(_0x46cf7);})[_0x56b7('0x14')](function(_0x1343d4){logger[_0x56b7('0x15')](_0x56b7('0x7'),_0x1343d4['message'],_0x482eac);_0x3209ac(_0xd3c6c1['error'](0x1f4,_0x1343d4[_0x56b7('0x16')]));});});};exports[_0x56b7('0x17')]=function(_0x3587c8){var _0x429478=this;return new Promise(function(_0x59151a,_0x487c91){return db['Interval'][_0x56b7('0x18')]({'raw':_0x3587c8[_0x56b7('0xa')]?_0x3587c8[_0x56b7('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x3587c8[_0x56b7('0xa')]?_0x3587c8[_0x56b7('0xa')]['where']||null:null,'attributes':_0x3587c8[_0x56b7('0xa')]?_0x3587c8[_0x56b7('0xa')]['attributes']||null:null,'include':_0x3587c8[_0x56b7('0xa')]?_0x3587c8[_0x56b7('0xa')]['include']?_[_0x56b7('0x10')](_0x3587c8[_0x56b7('0xa')][_0x56b7('0xe')],function(_0x7117f5){return{'model':db[_0x7117f5[_0x56b7('0xf')]],'as':_0x7117f5['as'],'attributes':_0x7117f5[_0x56b7('0xd')],'include':_0x7117f5['include']?_[_0x56b7('0x10')](_0x7117f5['include'],function(_0x4d3f9e){return{'model':db[_0x4d3f9e[_0x56b7('0xf')]],'as':_0x4d3f9e['as'],'attributes':_0x4d3f9e[_0x56b7('0xd')],'include':_0x4d3f9e['include']?_['map'](_0x4d3f9e[_0x56b7('0xe')],function(_0x7c9b3e){return{'model':db[_0x7c9b3e[_0x56b7('0xf')]],'as':_0x7c9b3e['as'],'attributes':_0x7c9b3e[_0x56b7('0xd')]};}):[]};}):[]};}):[]:[]})[_0x56b7('0x11')](function(_0x271871){logger[_0x56b7('0x12')](_0x56b7('0x17'),_0x3587c8);logger[_0x56b7('0x13')](_0x56b7('0x17'),_0x3587c8,JSON[_0x56b7('0x19')](_0x271871));_0x59151a(_0x271871);})['catch'](function(_0x4f68f1){logger[_0x56b7('0x15')]('ShowInterval',_0x4f68f1['message'],_0x3587c8);_0x487c91(_0x429478[_0x56b7('0x15')](0x1f4,_0x4f68f1[_0x56b7('0x16')]));});});};function checkArrayOfIntervals(_0xfd1566,_0x3a3243){var _0x5a290d=[];return db['Interval'][_0x56b7('0x9')]({'where':{'id':_0xfd1566}})[_0x56b7('0x11')](function(_0x1e260e){_0x5a290d=_0x1e260e;return Promise[_0x56b7('0x1a')](_0x5a290d[_0x56b7('0x10')](function(_0x47a78d){return _0x47a78d[_0x56b7('0x1b')](_0x3a3243);}));})['then'](function(_0x3bad77){var _0x159846=_0x3bad77['reduce'](function(_0x53b9e7,_0x176c2c){return _0x53b9e7||_0x176c2c;},![]);logger[_0x56b7('0x12')](util[_0x56b7('0x1c')](_0x56b7('0x1d'),_0x5a290d[_0x56b7('0x10')](function(_0x5ba8f0){return _0x5ba8f0['name'];})[_0x56b7('0x1e')](',\x20'),_0x5a290d[_0x56b7('0x10')](function(_0x446123){return _0x446123['id'];})[_0x56b7('0x1e')](',\x20')));return _0x159846;});}function checkSingleInterval(_0x28aca3,_0x166675){return db[_0x56b7('0x8')][_0x56b7('0x1f')](_0x28aca3)[_0x56b7('0x11')](function(_0xb357f7){if(_0xb357f7){logger['info'](util[_0x56b7('0x1c')](_0x56b7('0x20'),_0xb357f7['name'],_0xb357f7['id']));return _0xb357f7[_0x56b7('0x1b')](_0x166675);}});}exports['IntervalIftime']=function(_0x2b05d9){var _0x5d8e17=_0x2b05d9['intervalIds'];var _0x46d507=Array[_0x56b7('0x21')](_0x2b05d9[_0x56b7('0x22')])?_0x2b05d9['intervals']:typeof _0x2b05d9[_0x56b7('0x22')]===_0x56b7('0x23')?[_0x2b05d9[_0x56b7('0x22')]]:[];var _0x2f7bb0=_0x2b05d9[_0x56b7('0x24')]||undefined;var _0x2037ef=![];if(_0x46d507[_0x56b7('0x25')]){logger[_0x56b7('0x12')](util['format'](_0x56b7('0x26'),_0x46d507['join'](';\x20')));}if(_0x2f7bb0){logger['info'](util['format'](_0x56b7('0x27'),_0x2f7bb0));}logger[_0x56b7('0x13')](_0x56b7('0x28'),_0x2037ef);logger['silly'](_0x56b7('0x29'),_0x2b05d9);return Promise[_0x56b7('0x2a')]()[_0x56b7('0x11')](function(){if(Array[_0x56b7('0x21')](_0x5d8e17)){return checkArrayOfIntervals(_0x5d8e17,_0x2f7bb0);}else if(_0x5d8e17){return checkSingleInterval(_0x5d8e17,_0x2f7bb0);}})[_0x56b7('0x11')](function(_0x2485b5){var _0x143afa=_0x46d507[_0x56b7('0x2b')](function(_0x3b2ac3,_0x33f18c){return _0x3b2ac3||iftime(_0x33f18c,_0x2f7bb0);},![]);_0x2037ef=_0x2485b5||_0x143afa;return _0x2037ef;})[_0x56b7('0x14')](function(_0x153c62){logger[_0x56b7('0x15')](_0x56b7('0x29'),_0x2b05d9,_0x153c62);throw this[_0x56b7('0x15')](0x1f4,_0x153c62[_0x56b7('0x16')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index bfccf50..9989e71 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x2810fd,_0x503353){var _0x255289=function(_0x1dcbb9){while(--_0x1dcbb9){_0x2810fd['push'](_0x2810fd['shift']());}};_0x255289(++_0x503353);}(_0x2032,0xd9));var _0x2203=function(_0x567ebf,_0x59c8c8){_0x567ebf=_0x567ebf-0x0;var _0x5f08d7=_0x2032[_0x567ebf];return _0x5f08d7;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x593f2e,_0x1b6d9f){var _0x1004ca=function(_0x104739){while(--_0x104739){_0x593f2e['push'](_0x593f2e['shift']());}};_0x1004ca(++_0x1b6d9f);}(_0x2032,0xd9));var _0x2203=function(_0x272897,_0x180dc7){_0x272897=_0x272897-0x0;var _0x3e2950=_0x2032[_0x272897];return _0x3e2950;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f2bc9b2..a9762da 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 _0x0e48=['newToken','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','base64','request','utf8','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','send','body','headers','x-forwarded-for','remoteAddress','bluebird','https','../../config/logger','api','3eAmWpBVP0','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken'];(function(_0x3ec133,_0x92dbbb){var _0x4721d6=function(_0x1d1aed){while(--_0x1d1aed){_0x3ec133['push'](_0x3ec133['shift']());}};_0x4721d6(++_0x92dbbb);}(_0x0e48,0x157));var _0x80e4=function(_0xc8624c,_0x4fe987){_0xc8624c=_0xc8624c-0x0;var _0x54bc53=_0x0e48[_0xc8624c];return _0x54bc53;};'use strict';var BPromise=require(_0x80e4('0x0'));var https=require(_0x80e4('0x1'));var logger=require(_0x80e4('0x2'))(_0x80e4('0x3'));var USERNAME='support';var PASSWORD=_0x80e4('0x4');function openIssue(_0x30617d,_0x4eb67c){var _0x2b7614={'fields':{'project':{'key':_0x30617d['key']||'MOTGUI'},'summary':(_0x30617d[_0x80e4('0x5')]||_0x80e4('0x6'))+_0x80e4('0x7')+_0x30617d['ip'],'description':_0x30617d[_0x80e4('0x8')]||JSON[_0x80e4('0x9')](_0x30617d),'issuetype':{'name':_0x30617d[_0x80e4('0xa')]||_0x80e4('0xb')}}};_0x2b7614[_0x80e4('0xc')][_0x80e4('0xd')]=_0x30617d[_0x80e4('0xe')];_0x2b7614[_0x80e4('0xc')][_0x80e4('0xf')]=_0x30617d[_0x80e4('0x10')];_0x2b7614[_0x80e4('0xc')]['customfield_11502']=_0x30617d[_0x80e4('0x11')];_0x2b7614[_0x80e4('0xc')]['customfield_11503']=_0x30617d['name'];_0x2b7614[_0x80e4('0xc')]['customfield_11504']=_0x30617d[_0x80e4('0x12')];_0x2b7614[_0x80e4('0xc')][_0x80e4('0x13')]=_0x30617d['ip'];var _0x3f3c69={'host':_0x80e4('0x14'),'port':0x1bb,'path':_0x80e4('0x15'),'method':_0x80e4('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x80e4('0x17'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x80e4('0x18'))}};var _0x6964a1=JSON[_0x80e4('0x9')](_0x2b7614);var _0x5c1672=https[_0x80e4('0x19')](_0x3f3c69,function(_0x33f5b5){_0x33f5b5['setEncoding'](_0x80e4('0x1a'));var _0x237451='';_0x33f5b5['on'](_0x80e4('0x1b'),function(_0x15e2c8){_0x237451+=_0x15e2c8;});_0x33f5b5['on'](_0x80e4('0x1c'),function(){if(_0x4eb67c){return _0x4eb67c[_0x80e4('0x1d')](_0x33f5b5[_0x80e4('0x1e')])[_0x80e4('0x1f')](JSON['parse'](_0x237451));}});});_0x5c1672['on']('error',function(_0xda5d48){if(_0x4eb67c){return _0x4eb67c[_0x80e4('0x1d')](0x1f4)[_0x80e4('0x1f')]({'errors':[{'message':_0x80e4('0x20'),'type':_0x80e4('0x21')}]});}});_0x5c1672[_0x80e4('0x22')](_0x6964a1);_0x5c1672[_0x80e4('0x1c')]();}exports['openIssue']=openIssue;exports[_0x80e4('0x23')]=function(_0x3bafaf,_0x4c85c6){_0x3bafaf[_0x80e4('0x24')]['ip']=_0x3bafaf[_0x80e4('0x25')][_0x80e4('0x26')]||_0x3bafaf['connection']['remoteAddress']||_0x3bafaf['socket'][_0x80e4('0x27')]||_0x3bafaf['connection']['socket'][_0x80e4('0x27')];return openIssue(_0x3bafaf[_0x80e4('0x24')],_0x4c85c6);}; \ No newline at end of file +var _0xc60f=['customfield_11502','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','status','statusCode','error','json','api.jira','write','end','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken'];(function(_0xdc2c8b,_0x2fe46c){var _0x51c24f=function(_0x37793d){while(--_0x37793d){_0xdc2c8b['push'](_0xdc2c8b['shift']());}};_0x51c24f(++_0x2fe46c);}(_0xc60f,0x1c9));var _0xfc60=function(_0x376f36,_0x37b4f7){_0x376f36=_0x376f36-0x0;var _0x57427e=_0xc60f[_0x376f36];return _0x57427e;};'use strict';var BPromise=require('bluebird');var https=require(_0xfc60('0x0'));var logger=require('../../config/logger')(_0xfc60('0x1'));var USERNAME=_0xfc60('0x2');var PASSWORD=_0xfc60('0x3');function openIssue(_0x46e7e6,_0x15a4aa){var _0x4c7b38={'fields':{'project':{'key':_0x46e7e6[_0xfc60('0x4')]||_0xfc60('0x5')},'summary':(_0x46e7e6[_0xfc60('0x6')]||'Report')+_0xfc60('0x7')+_0x46e7e6['ip'],'description':_0x46e7e6[_0xfc60('0x8')]||JSON[_0xfc60('0x9')](_0x46e7e6),'issuetype':{'name':_0x46e7e6['issuetype']||_0xfc60('0xa')}}};_0x4c7b38[_0xfc60('0xb')][_0xfc60('0xc')]=_0x46e7e6[_0xfc60('0xd')];_0x4c7b38[_0xfc60('0xb')][_0xfc60('0xe')]=_0x46e7e6[_0xfc60('0xf')];_0x4c7b38[_0xfc60('0xb')][_0xfc60('0x10')]=_0x46e7e6['newToken'];_0x4c7b38[_0xfc60('0xb')]['customfield_11503']=_0x46e7e6[_0xfc60('0x11')];_0x4c7b38[_0xfc60('0xb')][_0xfc60('0x12')]=_0x46e7e6['reason'];_0x4c7b38[_0xfc60('0xb')]['customfield_10102']=_0x46e7e6['ip'];var _0x488777={'host':_0xfc60('0x13'),'port':0x1bb,'path':_0xfc60('0x14'),'method':_0xfc60('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xfc60('0x16'),'Authorization':_0xfc60('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xfc60('0x18')](_0xfc60('0x19'))}};var _0x3021e4=JSON[_0xfc60('0x9')](_0x4c7b38);var _0x2baeb6=https[_0xfc60('0x1a')](_0x488777,function(_0x17b2d4){_0x17b2d4[_0xfc60('0x1b')](_0xfc60('0x1c'));var _0x5a5933='';_0x17b2d4['on']('data',function(_0x324e01){_0x5a5933+=_0x324e01;});_0x17b2d4['on']('end',function(){if(_0x15a4aa){return _0x15a4aa[_0xfc60('0x1d')](_0x17b2d4[_0xfc60('0x1e')])['json'](JSON['parse'](_0x5a5933));}});});_0x2baeb6['on'](_0xfc60('0x1f'),function(_0x5e0b97){if(_0x15a4aa){return _0x15a4aa[_0xfc60('0x1d')](0x1f4)[_0xfc60('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xfc60('0x21')}]});}});_0x2baeb6[_0xfc60('0x22')](_0x3021e4);_0x2baeb6[_0xfc60('0x23')]();}exports[_0xfc60('0x24')]=openIssue;exports[_0xfc60('0x25')]=function(_0x224777,_0x49aa8b){_0x224777[_0xfc60('0x26')]['ip']=_0x224777['headers'][_0xfc60('0x27')]||_0x224777[_0xfc60('0x28')][_0xfc60('0x29')]||_0x224777[_0xfc60('0x2a')][_0xfc60('0x29')]||_0x224777[_0xfc60('0x28')][_0xfc60('0x2a')][_0xfc60('0x29')];return openIssue(_0x224777[_0xfc60('0x26')],_0x49aa8b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5aaa75a..bd4f1d0 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 _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x17ba,0xab));var _0xa17b=function(_0x2cb070,_0x46ef3b){_0x2cb070=_0x2cb070-0x0;var _0x29dbd4=_0x17ba[_0x2cb070];return _0x29dbd4;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file +var _0xf3cd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update'];(function(_0x50a8ab,_0x2525fa){var _0x13f124=function(_0x15c86a){while(--_0x15c86a){_0x50a8ab['push'](_0x50a8ab['shift']());}};_0x13f124(++_0x2525fa);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0xf3cd[_0x5a4b16];return _0x5236dc;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./jscriptyAnswerReport.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller['describe']);router[_0xdf3c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0xe')]('/',auth['isAuthenticated'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x10')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0x13')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller['destroy']);module[_0xdf3c('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index b6af1a3..1ccae89 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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x23da2d,_0x13f77f){_0x23da2d=_0x23da2d-0x0;var _0xc3a4f=_0x7a54[_0x23da2d];return _0xc3a4f;};'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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x32540a,_0x133b1c){_0x32540a=_0x32540a-0x0;var _0x324c4e=_0x7a54[_0x32540a];return _0x324c4e;};'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 1d80258..27862df 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 _0xd67b=['include','findAll','rows','catch','show','keys','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x47d58d,_0x432b9e){var _0x28295e=function(_0x5949fc){while(--_0x5949fc){_0x47d58d['push'](_0x47d58d['shift']());}};_0x28295e(++_0x432b9e);}(_0xd67b,0x133));var _0xbd67=function(_0x3b2dbd,_0x49dadd){_0x3b2dbd=_0x3b2dbd-0x0;var _0x2a680f=_0xd67b[_0x3b2dbd];return _0x2a680f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd67('0x1'));var rp=require(_0xbd67('0x2'));var moment=require(_0xbd67('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbd67('0x4'));var util=require('util');var path=require(_0xbd67('0x5'));var sox=require('sox');var csv=require(_0xbd67('0x6'));var ejs=require(_0xbd67('0x7'));var fs=require('fs');var fs_extra=require(_0xbd67('0x8'));var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x6'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var licenseUtil=require(_0xbd67('0x16'));var db=require(_0xbd67('0x17'))['db'];function respondWithStatusCode(_0xb05237,_0x3621ad){_0x3621ad=_0x3621ad||0xcc;return function(_0x32bd81){if(_0x32bd81){return _0xb05237[_0xbd67('0x18')](_0x3621ad);}return _0xb05237[_0xbd67('0x19')](_0x3621ad)['end']();};}function respondWithResult(_0xbe923c,_0x46d881){_0x46d881=_0x46d881||0xc8;return function(_0x2a5efd){if(_0x2a5efd){return _0xbe923c[_0xbd67('0x19')](_0x46d881)[_0xbd67('0x1a')](_0x2a5efd);}};}function respondWithFilteredResult(_0x23b626,_0x44c025){return function(_0xbdd027){if(_0xbdd027){var _0xa45c76=typeof _0x44c025[_0xbd67('0x1b')]==='undefined'&&typeof _0x44c025['limit']===_0xbd67('0x1c');var _0x475e36=_0xbdd027[_0xbd67('0x1d')];var _0x47d066=_0xa45c76?0x0:_0x44c025[_0xbd67('0x1b')];var _0x2e0e21=_0xa45c76?_0xbdd027[_0xbd67('0x1d')]:_0x44c025['offset']+_0x44c025[_0xbd67('0x1e')];var _0x5ceb31;if(_0x2e0e21>=_0x475e36){_0x2e0e21=_0x475e36;_0x5ceb31=0xc8;}else{_0x5ceb31=0xce;}_0x23b626[_0xbd67('0x19')](_0x5ceb31);return _0x23b626[_0xbd67('0x1f')](_0xbd67('0x20'),_0x47d066+'-'+_0x2e0e21+'/'+_0x475e36)['json'](_0xbdd027);}return null;};}function patchUpdates(_0x3c4102){return function(_0x40ec96){try{jsonpatch[_0xbd67('0x21')](_0x40ec96,_0x3c4102,!![]);}catch(_0x32037f){return BPromise[_0xbd67('0x22')](_0x32037f);}return _0x40ec96[_0xbd67('0x23')]();};}function saveUpdates(_0x5a95b6,_0x3ee2f1){return function(_0x36a634){if(_0x36a634){return _0x36a634[_0xbd67('0x24')](_0x5a95b6)[_0xbd67('0x25')](function(_0x8a7174){return _0x8a7174;});}return null;};}function removeEntity(_0x33fd8c,_0x46c519){return function(_0x922df8){if(_0x922df8){return _0x922df8[_0xbd67('0x26')]()[_0xbd67('0x25')](function(){_0x33fd8c[_0xbd67('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b75dc,_0x5a5227){return function(_0x25bf7a){if(!_0x25bf7a){_0x3b75dc[_0xbd67('0x18')](0x194);}return _0x25bf7a;};}function handleError(_0x144b89,_0x4bbee7){_0x4bbee7=_0x4bbee7||0x1f4;return function(_0x14f5c3){logger[_0xbd67('0x27')](_0x14f5c3['stack']);if(_0x14f5c3[_0xbd67('0x28')]){delete _0x14f5c3[_0xbd67('0x28')];}_0x144b89[_0xbd67('0x19')](_0x4bbee7)[_0xbd67('0x29')](_0x14f5c3);};}exports[_0xbd67('0x2a')]=function(_0x55c2d4,_0x5975dc){var _0x41856b={},_0x310d21={},_0x4675ac={'count':0x0,'rows':[]};var _0x44eced=_[_0xbd67('0x2b')](db[_0xbd67('0x2c')][_0xbd67('0x2d')],function(_0x2e123e){return{'name':_0x2e123e[_0xbd67('0x2e')],'type':_0x2e123e[_0xbd67('0x2f')]['key']};});_0x310d21['model']=_[_0xbd67('0x2b')](_0x44eced,_0xbd67('0x28'));_0x310d21[_0xbd67('0x30')]=_['keys'](_0x55c2d4[_0xbd67('0x30')]);_0x310d21[_0xbd67('0x31')]=_[_0xbd67('0x32')](_0x310d21[_0xbd67('0x33')],_0x310d21['query']);_0x41856b['attributes']=_['intersection'](_0x310d21[_0xbd67('0x33')],qs[_0xbd67('0x34')](_0x55c2d4[_0xbd67('0x30')]['fields']));_0x41856b['attributes']=_0x41856b[_0xbd67('0x35')][_0xbd67('0x36')]?_0x41856b[_0xbd67('0x35')]:_0x310d21[_0xbd67('0x33')];if(!_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x37')]('nolimit')){_0x41856b[_0xbd67('0x1e')]=qs[_0xbd67('0x1e')](_0x55c2d4[_0xbd67('0x30')]['limit']);_0x41856b[_0xbd67('0x1b')]=qs['offset'](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x1b')]);}_0x41856b['order']=qs[_0xbd67('0x38')](_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x38')]);_0x41856b[_0xbd67('0x39')]=qs[_0xbd67('0x31')](_[_0xbd67('0x3a')](_0x55c2d4['query'],_0x310d21[_0xbd67('0x31')]),_0x44eced);if(_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x3b')]){_0x41856b[_0xbd67('0x39')]=_[_0xbd67('0x3c')](_0x41856b['where'],{'$or':_['map'](_0x44eced,function(_0x363cbe){if(_0x363cbe[_0xbd67('0x2f')]!==_0xbd67('0x3d')){var _0x4f0952={};_0x4f0952[_0x363cbe[_0xbd67('0x28')]]={'$like':'%'+_0x55c2d4[_0xbd67('0x30')][_0xbd67('0x3b')]+'%'};return _0x4f0952;}})});}_0x41856b=_[_0xbd67('0x3c')]({},_0x41856b,_0x55c2d4['options']);var _0x577986={'where':_0x41856b['where']};return db['JscriptyAnswerReport']['count'](_0x577986)[_0xbd67('0x25')](function(_0x5a6b2d){_0x4675ac['count']=_0x5a6b2d;if(_0x55c2d4['query'][_0xbd67('0x3e')]){_0x41856b[_0xbd67('0x3f')]=[{'all':!![]}];}return db[_0xbd67('0x2c')][_0xbd67('0x40')](_0x41856b);})['then'](function(_0x41f158){_0x4675ac[_0xbd67('0x41')]=_0x41f158;return _0x4675ac;})[_0xbd67('0x25')](respondWithFilteredResult(_0x5975dc,_0x41856b))[_0xbd67('0x42')](handleError(_0x5975dc,null));};exports[_0xbd67('0x43')]=function(_0x2da4fb,_0x17add8){var _0x532c9b={'raw':!![],'where':{'id':_0x2da4fb['params']['id']}},_0x121146={};_0x121146[_0xbd67('0x33')]=_[_0xbd67('0x44')](db[_0xbd67('0x2c')][_0xbd67('0x2d')]);_0x121146[_0xbd67('0x30')]=_[_0xbd67('0x44')](_0x2da4fb[_0xbd67('0x30')]);_0x121146[_0xbd67('0x31')]=_['intersection'](_0x121146[_0xbd67('0x33')],_0x121146[_0xbd67('0x30')]);_0x532c9b['attributes']=_[_0xbd67('0x32')](_0x121146[_0xbd67('0x33')],qs[_0xbd67('0x34')](_0x2da4fb['query']['fields']));_0x532c9b[_0xbd67('0x35')]=_0x532c9b[_0xbd67('0x35')][_0xbd67('0x36')]?_0x532c9b['attributes']:_0x121146[_0xbd67('0x33')];if(_0x2da4fb[_0xbd67('0x30')]['includeAll']){_0x532c9b['include']=[{'all':!![]}];}_0x532c9b=_['merge']({},_0x532c9b,_0x2da4fb['options']);return db[_0xbd67('0x2c')][_0xbd67('0x45')](_0x532c9b)[_0xbd67('0x25')](handleEntityNotFound(_0x17add8,null))[_0xbd67('0x25')](respondWithResult(_0x17add8,null))[_0xbd67('0x42')](handleError(_0x17add8,null));};exports['create']=function(_0x4543ce,_0x171d86){return db['JscriptyAnswerReport'][_0xbd67('0x46')](_0x4543ce[_0xbd67('0x47')],{})[_0xbd67('0x25')](respondWithResult(_0x171d86,0xc9))[_0xbd67('0x42')](handleError(_0x171d86,null));};exports[_0xbd67('0x24')]=function(_0x5ea5cc,_0x29662b){if(_0x5ea5cc['body']['id']){delete _0x5ea5cc[_0xbd67('0x47')]['id'];}return db[_0xbd67('0x2c')]['find']({'where':{'id':_0x5ea5cc[_0xbd67('0x48')]['id']}})[_0xbd67('0x25')](handleEntityNotFound(_0x29662b,null))[_0xbd67('0x25')](saveUpdates(_0x5ea5cc['body'],null))[_0xbd67('0x25')](respondWithResult(_0x29662b,null))[_0xbd67('0x42')](handleError(_0x29662b,null));};exports[_0xbd67('0x26')]=function(_0x79f8ba,_0x42cc5a){return db[_0xbd67('0x2c')][_0xbd67('0x45')]({'where':{'id':_0x79f8ba['params']['id']}})['then'](handleEntityNotFound(_0x42cc5a,null))[_0xbd67('0x25')](removeEntity(_0x42cc5a,null))[_0xbd67('0x42')](handleError(_0x42cc5a,null));};exports[_0xbd67('0x49')]=function(_0x30d66e,_0x3d092){return db['JscriptyAnswerReport']['describe']()[_0xbd67('0x25')](respondWithResult(_0x3d092,null))[_0xbd67('0x42')](handleError(_0x3d092,null));}; \ No newline at end of file +var _0xb46f=['JscriptyAnswerReport','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map'];(function(_0x250bf4,_0x5cf7f0){var _0x38936a=function(_0x39e9e9){while(--_0x39e9e9){_0x250bf4['push'](_0x250bf4['shift']());}};_0x38936a(++_0x5cf7f0);}(_0xb46f,0xb6));var _0xfb46=function(_0x502de5,_0x2ea21c){_0x502de5=_0x502de5-0x0;var _0x586926=_0xb46f[_0x502de5];return _0x586926;};'use strict';var emlformat=require(_0xfb46('0x0'));var rimraf=require(_0xfb46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb46('0x2'));var rp=require(_0xfb46('0x3'));var moment=require(_0xfb46('0x4'));var BPromise=require(_0xfb46('0x5'));var Mustache=require(_0xfb46('0x6'));var util=require('util');var path=require(_0xfb46('0x7'));var sox=require('sox');var csv=require(_0xfb46('0x8'));var ejs=require(_0xfb46('0x9'));var fs=require('fs');var fs_extra=require(_0xfb46('0xa'));var _=require(_0xfb46('0xb'));var squel=require(_0xfb46('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb46('0xd'));var deskjs=require(_0xfb46('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfb46('0x10'));var hardwareService=require(_0xfb46('0x11'));var logger=require(_0xfb46('0x12'))(_0xfb46('0x13'));var utils=require(_0xfb46('0x14'));var config=require(_0xfb46('0x15'));var licenseUtil=require(_0xfb46('0x16'));var db=require(_0xfb46('0x17'))['db'];function respondWithStatusCode(_0xa0034b,_0x1527e1){_0x1527e1=_0x1527e1||0xcc;return function(_0x57c68b){if(_0x57c68b){return _0xa0034b['sendStatus'](_0x1527e1);}return _0xa0034b[_0xfb46('0x18')](_0x1527e1)['end']();};}function respondWithResult(_0x41ebd9,_0x47bdf3){_0x47bdf3=_0x47bdf3||0xc8;return function(_0x572e04){if(_0x572e04){return _0x41ebd9[_0xfb46('0x18')](_0x47bdf3)[_0xfb46('0x19')](_0x572e04);}};}function respondWithFilteredResult(_0xf3fdbd,_0x348b3e){return function(_0x4ec418){if(_0x4ec418){var _0x230774=typeof _0x348b3e[_0xfb46('0x1a')]===_0xfb46('0x1b')&&typeof _0x348b3e['limit']===_0xfb46('0x1b');var _0x10fc0c=_0x4ec418['count'];var _0x523d15=_0x230774?0x0:_0x348b3e[_0xfb46('0x1a')];var _0x473136=_0x230774?_0x4ec418[_0xfb46('0x1c')]:_0x348b3e[_0xfb46('0x1a')]+_0x348b3e[_0xfb46('0x1d')];var _0x23c6ee;if(_0x473136>=_0x10fc0c){_0x473136=_0x10fc0c;_0x23c6ee=0xc8;}else{_0x23c6ee=0xce;}_0xf3fdbd[_0xfb46('0x18')](_0x23c6ee);return _0xf3fdbd[_0xfb46('0x1e')](_0xfb46('0x1f'),_0x523d15+'-'+_0x473136+'/'+_0x10fc0c)[_0xfb46('0x19')](_0x4ec418);}return null;};}function patchUpdates(_0x1c820a){return function(_0x2ee6db){try{jsonpatch['apply'](_0x2ee6db,_0x1c820a,!![]);}catch(_0x1b838a){return BPromise[_0xfb46('0x20')](_0x1b838a);}return _0x2ee6db[_0xfb46('0x21')]();};}function saveUpdates(_0x5b19b3,_0x1b05d0){return function(_0x2f8f6f){if(_0x2f8f6f){return _0x2f8f6f[_0xfb46('0x22')](_0x5b19b3)[_0xfb46('0x23')](function(_0x1010e0){return _0x1010e0;});}return null;};}function removeEntity(_0x52f392,_0x36c00a){return function(_0x5a8dde){if(_0x5a8dde){return _0x5a8dde[_0xfb46('0x24')]()[_0xfb46('0x23')](function(){_0x52f392[_0xfb46('0x18')](0xcc)[_0xfb46('0x25')]();});}};}function handleEntityNotFound(_0xf9bbd1,_0x3359fb){return function(_0x254f6c){if(!_0x254f6c){_0xf9bbd1['sendStatus'](0x194);}return _0x254f6c;};}function handleError(_0x1f4dcb,_0x2e354c){_0x2e354c=_0x2e354c||0x1f4;return function(_0x309c7f){logger[_0xfb46('0x26')](_0x309c7f[_0xfb46('0x27')]);if(_0x309c7f[_0xfb46('0x28')]){delete _0x309c7f[_0xfb46('0x28')];}_0x1f4dcb[_0xfb46('0x18')](_0x2e354c)[_0xfb46('0x29')](_0x309c7f);};}exports['index']=function(_0x21da44,_0x3852a0){var _0x1d691e={},_0x1f1f3a={},_0x5f4afa={'count':0x0,'rows':[]};var _0x7b983=_[_0xfb46('0x2a')](db[_0xfb46('0x2b')][_0xfb46('0x2c')],function(_0x846e43){return{'name':_0x846e43['fieldName'],'type':_0x846e43[_0xfb46('0x2d')][_0xfb46('0x2e')]};});_0x1f1f3a['model']=_[_0xfb46('0x2a')](_0x7b983,'name');_0x1f1f3a[_0xfb46('0x2f')]=_['keys'](_0x21da44[_0xfb46('0x2f')]);_0x1f1f3a['filters']=_[_0xfb46('0x30')](_0x1f1f3a[_0xfb46('0x31')],_0x1f1f3a['query']);_0x1d691e[_0xfb46('0x32')]=_[_0xfb46('0x30')](_0x1f1f3a['model'],qs[_0xfb46('0x33')](_0x21da44[_0xfb46('0x2f')]['fields']));_0x1d691e['attributes']=_0x1d691e[_0xfb46('0x32')][_0xfb46('0x34')]?_0x1d691e[_0xfb46('0x32')]:_0x1f1f3a[_0xfb46('0x31')];if(!_0x21da44[_0xfb46('0x2f')][_0xfb46('0x35')](_0xfb46('0x36'))){_0x1d691e[_0xfb46('0x1d')]=qs[_0xfb46('0x1d')](_0x21da44['query'][_0xfb46('0x1d')]);_0x1d691e['offset']=qs['offset'](_0x21da44[_0xfb46('0x2f')][_0xfb46('0x1a')]);}_0x1d691e[_0xfb46('0x37')]=qs[_0xfb46('0x38')](_0x21da44[_0xfb46('0x2f')][_0xfb46('0x38')]);_0x1d691e[_0xfb46('0x39')]=qs[_0xfb46('0x3a')](_['pick'](_0x21da44[_0xfb46('0x2f')],_0x1f1f3a[_0xfb46('0x3a')]),_0x7b983);if(_0x21da44[_0xfb46('0x2f')][_0xfb46('0x3b')]){_0x1d691e['where']=_[_0xfb46('0x3c')](_0x1d691e[_0xfb46('0x39')],{'$or':_[_0xfb46('0x2a')](_0x7b983,function(_0x10d9a4){if(_0x10d9a4[_0xfb46('0x2d')]!==_0xfb46('0x3d')){var _0x34ed65={};_0x34ed65[_0x10d9a4[_0xfb46('0x28')]]={'$like':'%'+_0x21da44['query'][_0xfb46('0x3b')]+'%'};return _0x34ed65;}})});}_0x1d691e=_[_0xfb46('0x3c')]({},_0x1d691e,_0x21da44[_0xfb46('0x3e')]);var _0x4a2366={'where':_0x1d691e[_0xfb46('0x39')]};return db[_0xfb46('0x2b')][_0xfb46('0x1c')](_0x4a2366)['then'](function(_0x2e28a0){_0x5f4afa['count']=_0x2e28a0;if(_0x21da44['query'][_0xfb46('0x3f')]){_0x1d691e[_0xfb46('0x40')]=[{'all':!![]}];}return db[_0xfb46('0x2b')][_0xfb46('0x41')](_0x1d691e);})[_0xfb46('0x23')](function(_0x2979c4){_0x5f4afa[_0xfb46('0x42')]=_0x2979c4;return _0x5f4afa;})[_0xfb46('0x23')](respondWithFilteredResult(_0x3852a0,_0x1d691e))[_0xfb46('0x43')](handleError(_0x3852a0,null));};exports[_0xfb46('0x44')]=function(_0x54014a,_0x1f2b7e){var _0x4482dc={'raw':!![],'where':{'id':_0x54014a[_0xfb46('0x45')]['id']}},_0x2d73c2={};_0x2d73c2[_0xfb46('0x31')]=_[_0xfb46('0x46')](db['JscriptyAnswerReport']['rawAttributes']);_0x2d73c2[_0xfb46('0x2f')]=_[_0xfb46('0x46')](_0x54014a[_0xfb46('0x2f')]);_0x2d73c2[_0xfb46('0x3a')]=_[_0xfb46('0x30')](_0x2d73c2['model'],_0x2d73c2['query']);_0x4482dc['attributes']=_[_0xfb46('0x30')](_0x2d73c2['model'],qs['fields'](_0x54014a[_0xfb46('0x2f')][_0xfb46('0x33')]));_0x4482dc[_0xfb46('0x32')]=_0x4482dc['attributes'][_0xfb46('0x34')]?_0x4482dc['attributes']:_0x2d73c2[_0xfb46('0x31')];if(_0x54014a[_0xfb46('0x2f')][_0xfb46('0x3f')]){_0x4482dc[_0xfb46('0x40')]=[{'all':!![]}];}_0x4482dc=_[_0xfb46('0x3c')]({},_0x4482dc,_0x54014a[_0xfb46('0x3e')]);return db[_0xfb46('0x2b')][_0xfb46('0x47')](_0x4482dc)[_0xfb46('0x23')](handleEntityNotFound(_0x1f2b7e,null))[_0xfb46('0x23')](respondWithResult(_0x1f2b7e,null))[_0xfb46('0x43')](handleError(_0x1f2b7e,null));};exports[_0xfb46('0x48')]=function(_0x32aaed,_0x29e38c){return db[_0xfb46('0x2b')]['create'](_0x32aaed[_0xfb46('0x49')],{})[_0xfb46('0x23')](respondWithResult(_0x29e38c,0xc9))[_0xfb46('0x43')](handleError(_0x29e38c,null));};exports[_0xfb46('0x22')]=function(_0x68bed4,_0x5ca78f){if(_0x68bed4[_0xfb46('0x49')]['id']){delete _0x68bed4[_0xfb46('0x49')]['id'];}return db[_0xfb46('0x2b')][_0xfb46('0x47')]({'where':{'id':_0x68bed4[_0xfb46('0x45')]['id']}})[_0xfb46('0x23')](handleEntityNotFound(_0x5ca78f,null))[_0xfb46('0x23')](saveUpdates(_0x68bed4[_0xfb46('0x49')],null))[_0xfb46('0x23')](respondWithResult(_0x5ca78f,null))[_0xfb46('0x43')](handleError(_0x5ca78f,null));};exports['destroy']=function(_0x50802c,_0x3b4c5c){return db[_0xfb46('0x2b')][_0xfb46('0x47')]({'where':{'id':_0x50802c[_0xfb46('0x45')]['id']}})[_0xfb46('0x23')](handleEntityNotFound(_0x3b4c5c,null))['then'](removeEntity(_0x3b4c5c,null))[_0xfb46('0x43')](handleError(_0x3b4c5c,null));};exports[_0xfb46('0x4a')]=function(_0x530484,_0x467c15){return db['JscriptyAnswerReport'][_0xfb46('0x4a')]()['then'](respondWithResult(_0x467c15,null))['catch'](handleError(_0x467c15,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6b02c2d..a5ad76c 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 _0x3eec=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x55d35b,_0x57ec0d){var _0x15dd37=function(_0x3d5f30){while(--_0x3d5f30){_0x55d35b['push'](_0x55d35b['shift']());}};_0x15dd37(++_0x57ec0d);}(_0x3eec,0x1a3));var _0xc3ee=function(_0x811890,_0x1b5121){_0x811890=_0x811890-0x0;var _0x19cef5=_0x3eec[_0x811890];return _0x19cef5;};'use strict';var _=require(_0xc3ee('0x0'));var util=require('util');var logger=require(_0xc3ee('0x1'))(_0xc3ee('0x2'));var moment=require(_0xc3ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xc3ee('0x4'));var fs=require('fs');var path=require(_0xc3ee('0x5'));var rimraf=require(_0xc3ee('0x6'));var config=require(_0xc3ee('0x7'));var attributes=require(_0xc3ee('0x8'));module[_0xc3ee('0x9')]=function(_0x436840,_0xb69d46){return _0x436840['define'](_0xc3ee('0xa'),attributes,{'tableName':_0xc3ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8450=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5c0a8a,_0x4358ae){var _0x39cb95=function(_0x383073){while(--_0x383073){_0x5c0a8a['push'](_0x5c0a8a['shift']());}};_0x39cb95(++_0x4358ae);}(_0x8450,0x1c0));var _0x0845=function(_0x282f48,_0x12eeaa){_0x282f48=_0x282f48-0x0;var _0x5e5c9b=_0x8450[_0x282f48];return _0x5e5c9b;};'use strict';var _=require(_0x0845('0x0'));var util=require('util');var logger=require(_0x0845('0x1'))(_0x0845('0x2'));var moment=require(_0x0845('0x3'));var BPromise=require(_0x0845('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0845('0x5'));var rimraf=require(_0x0845('0x6'));var config=require(_0x0845('0x7'));var attributes=require(_0x0845('0x8'));module[_0x0845('0x9')]=function(_0x16b041,_0x52d730){return _0x16b041[_0x0845('0xa')](_0x0845('0xb'),attributes,{'tableName':_0x0845('0xc'),'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 61a9142..b38bd2b 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 _0x6567=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6567,0x1b4));var _0x7656=function(_0x184177,_0x3e35aa){_0x184177=_0x184177-0x0;var _0x396625=_0x6567[_0x184177];return _0x396625;};'use strict';var _=require('lodash');var util=require(_0x7656('0x0'));var moment=require(_0x7656('0x1'));var BPromise=require('bluebird');var rs=require(_0x7656('0x2'));var fs=require('fs');var Redis=require(_0x7656('0x3'));var db=require(_0x7656('0x4'))['db'];var utils=require(_0x7656('0x5'));var logger=require('../../config/logger')(_0x7656('0x6'));var config=require('../../config/environment');var jayson=require(_0x7656('0x7'));var client=jayson['client'][_0x7656('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23d9b0,_0x2161a1,_0x430df9){return new BPromise(function(_0x3bc92b,_0x258def){return client[_0x7656('0x9')](_0x23d9b0,_0x430df9)[_0x7656('0xa')](function(_0x5dcacc){logger[_0x7656('0xb')](_0x7656('0xc'),_0x2161a1,_0x7656('0xd'));logger[_0x7656('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2161a1,_0x7656('0xd'),JSON[_0x7656('0xf')](_0x5dcacc));if(_0x5dcacc[_0x7656('0x10')]){if(_0x5dcacc['error'][_0x7656('0x11')]===0x1f4){logger[_0x7656('0x10')](_0x7656('0xc'),_0x2161a1,_0x5dcacc[_0x7656('0x10')][_0x7656('0x12')]);return _0x258def(_0x5dcacc[_0x7656('0x10')]['message']);}logger[_0x7656('0x10')](_0x7656('0xc'),_0x2161a1,_0x5dcacc[_0x7656('0x10')][_0x7656('0x12')]);return _0x3bc92b(_0x5dcacc[_0x7656('0x10')]['message']);}else{logger[_0x7656('0xb')](_0x7656('0xc'),_0x2161a1,'request\x20sent');_0x3bc92b(_0x5dcacc['result'][_0x7656('0x12')]);}})[_0x7656('0x13')](function(_0x4187a4){logger[_0x7656('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2161a1,_0x4187a4);_0x258def(_0x4187a4);});});} \ No newline at end of file +var _0x8544=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x17f45b,_0x190a68){var _0x9b5759=function(_0x28dfb5){while(--_0x28dfb5){_0x17f45b['push'](_0x17f45b['shift']());}};_0x9b5759(++_0x190a68);}(_0x8544,0x11c));var _0x4854=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x8544[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x4854('0x0'));var util=require(_0x4854('0x1'));var moment=require(_0x4854('0x2'));var BPromise=require(_0x4854('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4854('0x4'));var db=require(_0x4854('0x5'))['db'];var utils=require(_0x4854('0x6'));var logger=require(_0x4854('0x7'))(_0x4854('0x8'));var config=require(_0x4854('0x9'));var jayson=require(_0x4854('0xa'));var client=jayson[_0x4854('0xb')][_0x4854('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xedfab5,_0x3079a8,_0x89c1e4){return new BPromise(function(_0x2265a7,_0x219f1b){return client[_0x4854('0xd')](_0xedfab5,_0x89c1e4)[_0x4854('0xe')](function(_0x5d1d1f){logger[_0x4854('0xf')](_0x4854('0x10'),_0x3079a8,_0x4854('0x11'));logger[_0x4854('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3079a8,_0x4854('0x11'),JSON[_0x4854('0x13')](_0x5d1d1f));if(_0x5d1d1f[_0x4854('0x14')]){if(_0x5d1d1f['error'][_0x4854('0x15')]===0x1f4){logger[_0x4854('0x14')](_0x4854('0x10'),_0x3079a8,_0x5d1d1f[_0x4854('0x14')][_0x4854('0x16')]);return _0x219f1b(_0x5d1d1f[_0x4854('0x14')][_0x4854('0x16')]);}logger[_0x4854('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3079a8,_0x5d1d1f[_0x4854('0x14')][_0x4854('0x16')]);return _0x2265a7(_0x5d1d1f[_0x4854('0x14')]['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3079a8,'request\x20sent');_0x2265a7(_0x5d1d1f[_0x4854('0x17')][_0x4854('0x16')]);}})[_0x4854('0x18')](function(_0x229a86){logger[_0x4854('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3079a8,_0x229a86);_0x219f1b(_0x229a86);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 5e4bc8e..ce7b20e 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 _0x2110=['delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','index','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update'];(function(_0x5dc53a,_0x3fd215){var _0x4bc0f1=function(_0x460ba4){while(--_0x460ba4){_0x5dc53a['push'](_0x5dc53a['shift']());}};_0x4bc0f1(++_0x3fd215);}(_0x2110,0x7e));var _0x0211=function(_0x2b0094,_0x1be73d){_0x2b0094=_0x2b0094-0x0;var _0x19e5e6=_0x2110[_0x2b0094];return _0x19e5e6;};'use strict';var multer=require(_0x0211('0x0'));var util=require(_0x0211('0x1'));var path=require(_0x0211('0x2'));var timeout=require(_0x0211('0x3'));var express=require(_0x0211('0x4'));var router=express['Router']();var fs_extra=require(_0x0211('0x5'));var auth=require(_0x0211('0x6'));var interaction=require(_0x0211('0x7'));var config=require('../../config/environment');var controller=require(_0x0211('0x8'));router[_0x0211('0x9')]('/',auth['isAuthenticated'](),controller[_0x0211('0xa')]);router[_0x0211('0x9')](_0x0211('0xb'),auth[_0x0211('0xc')](),controller['show']);router[_0x0211('0x9')](_0x0211('0xd'),auth[_0x0211('0xc')](),controller[_0x0211('0xe')]);router[_0x0211('0x9')](_0x0211('0xf'),auth[_0x0211('0xc')](),controller['getAnswers']);router[_0x0211('0x9')](_0x0211('0x10'),auth[_0x0211('0xc')](),timeout(_0x0211('0x11')),controller[_0x0211('0x12')]);router[_0x0211('0x13')]('/',auth[_0x0211('0xc')](),controller[_0x0211('0x14')]);router[_0x0211('0x13')](_0x0211('0x15'),auth[_0x0211('0xc')](),controller[_0x0211('0x16')]);router['put'](_0x0211('0xb'),auth[_0x0211('0xc')](),controller[_0x0211('0x17')]);router[_0x0211('0x18')](_0x0211('0xb'),auth[_0x0211('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x503d=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','post','create','/:id/clone','clone','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1b9948,_0x14f392){var _0x4245fa=function(_0x4b61aa){while(--_0x4b61aa){_0x1b9948['push'](_0x1b9948['shift']());}};_0x4245fa(++_0x14f392);}(_0x503d,0x132));var _0xd503=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0x503d[_0x5b13c3];return _0x3d6780;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd503('0x0'));var timeout=require(_0xd503('0x1'));var express=require(_0xd503('0x2'));var router=express[_0xd503('0x3')]();var fs_extra=require(_0xd503('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd503('0x5'));var config=require(_0xd503('0x6'));var controller=require('./jscriptyProject.controller');router[_0xd503('0x7')]('/',auth[_0xd503('0x8')](),controller[_0xd503('0x9')]);router[_0xd503('0x7')](_0xd503('0xa'),auth[_0xd503('0x8')](),controller[_0xd503('0xb')]);router[_0xd503('0x7')](_0xd503('0xc'),auth[_0xd503('0x8')](),controller[_0xd503('0xd')]);router['get'](_0xd503('0xe'),auth[_0xd503('0x8')](),controller['getAnswers']);router[_0xd503('0x7')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xd503('0xf')),controller[_0xd503('0x10')]);router[_0xd503('0x11')]('/',auth[_0xd503('0x8')](),controller[_0xd503('0x12')]);router[_0xd503('0x11')](_0xd503('0x13'),auth[_0xd503('0x8')](),controller[_0xd503('0x14')]);router[_0xd503('0x15')](_0xd503('0xa'),auth[_0xd503('0x8')](),controller['update']);router[_0xd503('0x16')](_0xd503('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xd503('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 48e8304..39e3bd3 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 _0x1736=['STRING','name','long','isObjectLike','stringify','setDataValue','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x1736,0xa1));var _0x6173=function(_0x299af9,_0x26b2d6){_0x299af9=_0x299af9-0x0;var _0x261254=_0x1736[_0x299af9];return _0x261254;};'use strict';var Sequelize=require(_0x6173('0x0'));var _=require(_0x6173('0x1'));var util=require(_0x6173('0x2'));module[_0x6173('0x3')]={'name':{'type':Sequelize[_0x6173('0x4')],'unique':_0x6173('0x5')},'description':{'type':Sequelize[_0x6173('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x6173('0x6')),'set':function(_0x2f2a84){if(_[_0x6173('0x7')](_0x2f2a84)){this['setDataValue']('formData',JSON[_0x6173('0x8')](_0x2f2a84));}else if(_['isString'](_0x2f2a84)){this['setDataValue']('formData',_0x2f2a84);}else{this[_0x6173('0x9')](_0x6173('0xa'),util['format'](_0x6173('0xb'),this[_0x6173('0xc')](_0x6173('0x5'))||'',this[_0x6173('0xc')](_0x6173('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6173('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6173('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xdfc4=['TEXT','isObjectLike','formData','stringify','setDataValue','format','getDataValue','description','BOOLEAN','sequelize','lodash','STRING','name'];(function(_0x4d6a8d,_0xdc29de){var _0x4c9a03=function(_0x562dd4){while(--_0x562dd4){_0x4d6a8d['push'](_0x4d6a8d['shift']());}};_0x4c9a03(++_0xdc29de);}(_0xdfc4,0xe6));var _0x4dfc=function(_0x11d541,_0xc8fe9){_0x11d541=_0x11d541-0x0;var _0x3e612a=_0xdfc4[_0x11d541];return _0x3e612a;};'use strict';var Sequelize=require(_0x4dfc('0x0'));var _=require(_0x4dfc('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x4dfc('0x2')],'unique':_0x4dfc('0x3')},'description':{'type':Sequelize[_0x4dfc('0x2')]},'formData':{'type':Sequelize[_0x4dfc('0x4')]('long'),'set':function(_0x29fc6a){if(_[_0x4dfc('0x5')](_0x29fc6a)){this['setDataValue'](_0x4dfc('0x6'),JSON[_0x4dfc('0x7')](_0x29fc6a));}else if(_['isString'](_0x29fc6a)){this[_0x4dfc('0x8')](_0x4dfc('0x6'),_0x29fc6a);}else{this[_0x4dfc('0x8')]('formData',util[_0x4dfc('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x4dfc('0x3'))||'',this[_0x4dfc('0xa')](_0x4dfc('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4dfc('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4dfc('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 09e11f0..9813feb 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 _0xc648=['Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','Projects','UserProfileResource','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','UserProfileSection','error','clone','omit','createdAt','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','getAnswers','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv'];(function(_0x59cbbe,_0x3a65fb){var _0x52eb4b=function(_0x58d553){while(--_0x58d553){_0x59cbbe['push'](_0x59cbbe['shift']());}};_0x52eb4b(++_0x3a65fb);}(_0xc648,0x171));var _0x8c64=function(_0x3a7094,_0x3a9ee0){_0x3a7094=_0x3a7094-0x0;var _0x290c49=_0xc648[_0x3a7094];return _0x290c49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c64('0x0'));var zipdir=require(_0x8c64('0x1'));var jsonpatch=require(_0x8c64('0x2'));var rp=require(_0x8c64('0x3'));var moment=require(_0x8c64('0x4'));var BPromise=require(_0x8c64('0x5'));var Mustache=require(_0x8c64('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8c64('0x7'));var ejs=require(_0x8c64('0x8'));var fs=require('fs');var fs_extra=require(_0x8c64('0x9'));var _=require(_0x8c64('0xa'));var squel=require('squel');var crypto=require(_0x8c64('0xb'));var jsforce=require(_0x8c64('0xc'));var deskjs=require(_0x8c64('0xd'));var toCsv=require(_0x8c64('0x7'));var querystring=require(_0x8c64('0xe'));var Papa=require('papaparse');var Redis=require(_0x8c64('0xf'));var authService=require(_0x8c64('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8c64('0x11'));var hardwareService=require(_0x8c64('0x12'));var logger=require(_0x8c64('0x13'))(_0x8c64('0x14'));var utils=require(_0x8c64('0x15'));var config=require(_0x8c64('0x16'));var licenseUtil=require(_0x8c64('0x17'));var db=require(_0x8c64('0x18'))['db'];function respondWithStatusCode(_0x3834e6,_0x19a173){_0x19a173=_0x19a173||0xcc;return function(_0x54e0f0){if(_0x54e0f0){return _0x3834e6[_0x8c64('0x19')](_0x19a173);}return _0x3834e6[_0x8c64('0x1a')](_0x19a173)[_0x8c64('0x1b')]();};}function respondWithResult(_0x36e227,_0x3a4cbf){_0x3a4cbf=_0x3a4cbf||0xc8;return function(_0xeb374){if(_0xeb374){return _0x36e227[_0x8c64('0x1a')](_0x3a4cbf)['json'](_0xeb374);}};}function respondWithFilteredResult(_0x14df4a,_0x16c84e){return function(_0x4dbf8d){if(_0x4dbf8d){var _0xfacf06=typeof _0x16c84e[_0x8c64('0x1c')]==='undefined'&&typeof _0x16c84e[_0x8c64('0x1d')]===_0x8c64('0x1e');var _0x511608=_0x4dbf8d['count'];var _0x20931c=_0xfacf06?0x0:_0x16c84e[_0x8c64('0x1c')];var _0x4be59b=_0xfacf06?_0x4dbf8d[_0x8c64('0x1f')]:_0x16c84e[_0x8c64('0x1c')]+_0x16c84e['limit'];var _0x4d7350;if(_0x4be59b>=_0x511608){_0x4be59b=_0x511608;_0x4d7350=0xc8;}else{_0x4d7350=0xce;}_0x14df4a['status'](_0x4d7350);return _0x14df4a[_0x8c64('0x20')]('Content-Range',_0x20931c+'-'+_0x4be59b+'/'+_0x511608)['json'](_0x4dbf8d);}return null;};}function patchUpdates(_0x45839d){return function(_0x6d288f){try{jsonpatch[_0x8c64('0x21')](_0x6d288f,_0x45839d,!![]);}catch(_0x2c837c){return BPromise[_0x8c64('0x22')](_0x2c837c);}return _0x6d288f[_0x8c64('0x23')]();};}function saveUpdates(_0x4e7853,_0x28b7dd){return function(_0x51c459){if(_0x51c459){return _0x51c459[_0x8c64('0x24')](_0x4e7853)['then'](function(_0x2624dc){return _0x2624dc;});}return null;};}function removeEntity(_0x3f9a8a,_0x4b2f7b){return function(_0x400bf7){if(_0x400bf7){return _0x400bf7[_0x8c64('0x25')]()[_0x8c64('0x26')](function(){var _0x55e11c=_0x400bf7[_0x8c64('0x27')]({'plain':!![]});var _0x4ddd8f=_0x8c64('0x28');return db[_0x8c64('0x29')][_0x8c64('0x25')]({'where':{'type':_0x4ddd8f,'resourceId':_0x55e11c['id']}})[_0x8c64('0x26')](function(){return _0x400bf7;});})[_0x8c64('0x26')](function(){_0x3f9a8a['status'](0xcc)[_0x8c64('0x1b')]();});}};}function handleEntityNotFound(_0x5cf51b,_0x4c1367){return function(_0x3649f9){if(!_0x3649f9){_0x5cf51b['sendStatus'](0x194);}return _0x3649f9;};}function handleError(_0x33027f,_0x1b4c9d){_0x1b4c9d=_0x1b4c9d||0x1f4;return function(_0x1cf017){logger['error'](_0x1cf017[_0x8c64('0x2a')]);if(_0x1cf017[_0x8c64('0x2b')]){delete _0x1cf017[_0x8c64('0x2b')];}_0x33027f[_0x8c64('0x1a')](_0x1b4c9d)[_0x8c64('0x2c')](_0x1cf017);};}exports[_0x8c64('0x2d')]=function(_0x1fa44e,_0x1e2706){var _0x55ff15={},_0x4f86cd={},_0x5b2e57={'count':0x0,'rows':[]};var _0x187113=_[_0x8c64('0x2e')](db[_0x8c64('0x2f')][_0x8c64('0x30')],function(_0x4d9b73){return{'name':_0x4d9b73[_0x8c64('0x31')],'type':_0x4d9b73[_0x8c64('0x32')]['key']};});_0x4f86cd[_0x8c64('0x33')]=_['map'](_0x187113,'name');_0x4f86cd[_0x8c64('0x34')]=_[_0x8c64('0x35')](_0x1fa44e['query']);_0x4f86cd['filters']=_['intersection'](_0x4f86cd[_0x8c64('0x33')],_0x4f86cd[_0x8c64('0x34')]);_0x55ff15[_0x8c64('0x36')]=_[_0x8c64('0x37')](_0x4f86cd[_0x8c64('0x33')],qs[_0x8c64('0x38')](_0x1fa44e[_0x8c64('0x34')][_0x8c64('0x38')]));_0x55ff15[_0x8c64('0x36')]=_0x55ff15['attributes'][_0x8c64('0x39')]?_0x55ff15[_0x8c64('0x36')]:_0x4f86cd[_0x8c64('0x33')];if(!_0x1fa44e['query'][_0x8c64('0x3a')](_0x8c64('0x3b'))){_0x55ff15[_0x8c64('0x1d')]=qs['limit'](_0x1fa44e[_0x8c64('0x34')][_0x8c64('0x1d')]);_0x55ff15[_0x8c64('0x1c')]=qs[_0x8c64('0x1c')](_0x1fa44e[_0x8c64('0x34')][_0x8c64('0x1c')]);}_0x55ff15[_0x8c64('0x3c')]=qs[_0x8c64('0x3d')](_0x1fa44e[_0x8c64('0x34')][_0x8c64('0x3d')]);_0x55ff15[_0x8c64('0x3e')]=qs[_0x8c64('0x3f')](_[_0x8c64('0x40')](_0x1fa44e[_0x8c64('0x34')],_0x4f86cd['filters']),_0x187113);if(_0x1fa44e['query'][_0x8c64('0x41')]){_0x55ff15[_0x8c64('0x3e')]=_[_0x8c64('0x42')](_0x55ff15[_0x8c64('0x3e')],{'$or':_['map'](_0x187113,function(_0x46e491){if(_0x46e491[_0x8c64('0x32')]!==_0x8c64('0x43')){var _0xca6ea6={};_0xca6ea6[_0x46e491[_0x8c64('0x2b')]]={'$like':'%'+_0x1fa44e['query'][_0x8c64('0x41')]+'%'};return _0xca6ea6;}})});}_0x55ff15=_[_0x8c64('0x42')]({},_0x55ff15,_0x1fa44e['options']);var _0x4ac643={'where':_0x55ff15['where']};return db['JscriptyProject'][_0x8c64('0x1f')](_0x4ac643)[_0x8c64('0x26')](function(_0x5f3c6d){_0x5b2e57[_0x8c64('0x1f')]=_0x5f3c6d;if(_0x1fa44e[_0x8c64('0x34')][_0x8c64('0x44')]){_0x55ff15[_0x8c64('0x45')]=[{'all':!![]}];}return db[_0x8c64('0x2f')][_0x8c64('0x46')](_0x55ff15);})[_0x8c64('0x26')](function(_0x311803){_0x5b2e57[_0x8c64('0x47')]=_0x311803;return _0x5b2e57;})[_0x8c64('0x26')](respondWithFilteredResult(_0x1e2706,_0x55ff15))[_0x8c64('0x48')](handleError(_0x1e2706,null));};exports['show']=function(_0x47096f,_0x23db42){var _0x145c90={'raw':![],'where':{'id':_0x47096f[_0x8c64('0x49')]['id']}},_0x55c965={};_0x55c965[_0x8c64('0x33')]=_[_0x8c64('0x35')](db['JscriptyProject'][_0x8c64('0x30')]);_0x55c965[_0x8c64('0x34')]=_[_0x8c64('0x35')](_0x47096f[_0x8c64('0x34')]);_0x55c965[_0x8c64('0x3f')]=_[_0x8c64('0x37')](_0x55c965['model'],_0x55c965[_0x8c64('0x34')]);_0x145c90[_0x8c64('0x36')]=_[_0x8c64('0x37')](_0x55c965[_0x8c64('0x33')],qs[_0x8c64('0x38')](_0x47096f[_0x8c64('0x34')][_0x8c64('0x38')]));_0x145c90[_0x8c64('0x36')]=_0x145c90[_0x8c64('0x36')][_0x8c64('0x39')]?_0x145c90[_0x8c64('0x36')]:_0x55c965[_0x8c64('0x33')];if(_0x47096f[_0x8c64('0x34')][_0x8c64('0x44')]){_0x145c90[_0x8c64('0x45')]=[{'all':!![]}];}_0x145c90=_['merge']({},_0x145c90,_0x47096f[_0x8c64('0x4a')]);return db[_0x8c64('0x2f')][_0x8c64('0x4b')](_0x145c90)[_0x8c64('0x26')](handleEntityNotFound(_0x23db42,null))[_0x8c64('0x26')](respondWithResult(_0x23db42,null))[_0x8c64('0x48')](handleError(_0x23db42,null));};exports['create']=function(_0x2503a7,_0x19d248){return db[_0x8c64('0x2f')][_0x8c64('0x4c')](_0x2503a7[_0x8c64('0x4d')],{})[_0x8c64('0x26')](function(_0x500bea){var _0x4ac42d=_0x2503a7[_0x8c64('0x4e')][_0x8c64('0x27')]({'plain':!![]});if(!_0x4ac42d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ac42d['role']===_0x8c64('0x4e')){var _0x2987cb=_0x500bea[_0x8c64('0x27')]({'plain':!![]});var _0x2027a9=_0x8c64('0x28');return db[_0x8c64('0x4f')][_0x8c64('0x4b')]({'where':{'name':_0x2027a9,'userProfileId':_0x4ac42d['userProfileId']},'raw':!![]})[_0x8c64('0x26')](function(_0x4774b1){if(_0x4774b1&&_0x4774b1['autoAssociation']===0x0){return db[_0x8c64('0x29')][_0x8c64('0x4c')]({'name':_0x2987cb['name'],'resourceId':_0x2987cb['id'],'type':_0x4774b1[_0x8c64('0x2b')],'sectionId':_0x4774b1['id']},{})[_0x8c64('0x26')](function(){return _0x500bea;});}else{return _0x500bea;}})[_0x8c64('0x48')](function(_0x11b346){logger[_0x8c64('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11b346);throw _0x11b346;});}return _0x500bea;})[_0x8c64('0x26')](respondWithResult(_0x19d248,0xc9))[_0x8c64('0x48')](handleError(_0x19d248,null));};exports[_0x8c64('0x51')]=function(_0x163b75,_0x54d8a0){var _0x518cf5={'where':{'id':_0x163b75['params']['id']}},_0x1a1a1f={};_0x1a1a1f[_0x8c64('0x33')]=_[_0x8c64('0x35')](db[_0x8c64('0x2f')]['rawAttributes']);_0x518cf5[_0x8c64('0x36')]=_[_0x8c64('0x37')](_0x1a1a1f[_0x8c64('0x33')],qs[_0x8c64('0x38')](_0x163b75['query'][_0x8c64('0x38')]));_0x518cf5['attributes']=_0x518cf5['attributes'][_0x8c64('0x39')]?_0x518cf5[_0x8c64('0x36')]:_0x1a1a1f['model'];if(_0x163b75[_0x8c64('0x34')][_0x8c64('0x44')]){_0x518cf5[_0x8c64('0x45')]=[{'all':!![]}];}_0x518cf5=_[_0x8c64('0x42')]({},_0x518cf5,_0x163b75[_0x8c64('0x4a')]);return db['JscriptyProject']['find'](_0x518cf5)[_0x8c64('0x26')](handleEntityNotFound(_0x54d8a0,null))['then'](function(_0x423870){if(_0x423870){var _0x253649=_0x423870[_0x8c64('0x27')]({'plain':!![]});_0x253649=qs[_0x8c64('0x52')](_0x253649,['id',_0x8c64('0x53'),'updatedAt']);_0x163b75['body']=_['omit'](_0x163b75[_0x8c64('0x4d')],['id',_0x8c64('0x53'),'updatedAt']);return db[_0x8c64('0x2f')][_0x8c64('0x4c')](_['merge'](_0x253649,_0x163b75[_0x8c64('0x4d')]),{'include':_0x163b75[_0x8c64('0x34')][_0x8c64('0x44')]?[{'all':!![]}]:undefined})[_0x8c64('0x26')](function(_0x3932b4){var _0x2ea374=_0x163b75[_0x8c64('0x4e')][_0x8c64('0x27')]({'plain':!![]});if(!_0x2ea374)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ea374[_0x8c64('0x54')]===_0x8c64('0x4e')){var _0x22cef3=_0x3932b4['get']({'plain':!![]});var _0x1c56ec=_0x8c64('0x28');return db[_0x8c64('0x4f')][_0x8c64('0x4b')]({'where':{'name':_0x1c56ec,'userProfileId':_0x2ea374[_0x8c64('0x55')]},'raw':!![]})['then'](function(_0x56d42f){if(_0x56d42f&&_0x56d42f[_0x8c64('0x56')]===0x0){return db['UserProfileResource'][_0x8c64('0x4c')]({'name':_0x22cef3[_0x8c64('0x2b')],'resourceId':_0x22cef3['id'],'type':_0x56d42f['name'],'sectionId':_0x56d42f['id']},{})[_0x8c64('0x26')](function(){return _0x3932b4;});}else{return _0x3932b4;}})[_0x8c64('0x48')](function(_0x1b01a6){logger[_0x8c64('0x50')](_0x8c64('0x57'),_0x1b01a6);throw _0x1b01a6;});}return _0x3932b4;});}})[_0x8c64('0x26')](respondWithResult(_0x54d8a0,0xc9))['catch'](handleError(_0x54d8a0,null));};exports[_0x8c64('0x24')]=function(_0x466b69,_0xb6f2ea){if(_0x466b69[_0x8c64('0x4d')]['id']){delete _0x466b69['body']['id'];}return db['JscriptyProject'][_0x8c64('0x4b')]({'where':{'id':_0x466b69[_0x8c64('0x49')]['id']}})[_0x8c64('0x26')](handleEntityNotFound(_0xb6f2ea,null))[_0x8c64('0x26')](saveUpdates(_0x466b69[_0x8c64('0x4d')],null))[_0x8c64('0x26')](respondWithResult(_0xb6f2ea,null))[_0x8c64('0x48')](handleError(_0xb6f2ea,null));};exports['destroy']=function(_0xe05543,_0x14fed4){return db['JscriptyProject'][_0x8c64('0x4b')]({'where':{'id':_0xe05543['params']['id']}})[_0x8c64('0x26')](handleEntityNotFound(_0x14fed4,null))[_0x8c64('0x26')](removeEntity(_0x14fed4,null))['catch'](handleError(_0x14fed4,null));};exports[_0x8c64('0x58')]=function(_0x213f56,_0x5991ae,_0x4a2684){var _0x2cf7a8={'raw':!![],'where':{}};var _0x224991={};var _0x193fb6={'count':0x0,'rows':[]};return db[_0x8c64('0x2f')][_0x8c64('0x59')]({'where':{'id':_0x213f56[_0x8c64('0x49')]['id']}})[_0x8c64('0x26')](handleEntityNotFound(_0x5991ae,null))[_0x8c64('0x26')](function(_0x16c600){if(_0x16c600){_0x224991[_0x8c64('0x33')]=_[_0x8c64('0x35')](db[_0x8c64('0x5a')][_0x8c64('0x30')]);_0x224991[_0x8c64('0x34')]=_[_0x8c64('0x35')](_0x213f56[_0x8c64('0x34')]);_0x224991['filters']=_['intersection'](_0x224991['model'],_0x224991[_0x8c64('0x34')]);_0x2cf7a8[_0x8c64('0x36')]=_[_0x8c64('0x37')](_0x224991[_0x8c64('0x33')],qs[_0x8c64('0x38')](_0x213f56[_0x8c64('0x34')][_0x8c64('0x38')]));_0x2cf7a8[_0x8c64('0x36')]=_0x2cf7a8['attributes']['length']?_0x2cf7a8[_0x8c64('0x36')]:_0x224991[_0x8c64('0x33')];if(!_0x213f56['query'][_0x8c64('0x3a')](_0x8c64('0x3b'))){_0x2cf7a8[_0x8c64('0x1d')]=qs[_0x8c64('0x1d')](_0x213f56[_0x8c64('0x34')][_0x8c64('0x1d')]);_0x2cf7a8['offset']=qs[_0x8c64('0x1c')](_0x213f56['query']['offset']);}_0x2cf7a8[_0x8c64('0x3c')]=qs[_0x8c64('0x3d')](_0x213f56[_0x8c64('0x34')][_0x8c64('0x3d')]);_0x2cf7a8[_0x8c64('0x3e')]=qs[_0x8c64('0x3f')](_[_0x8c64('0x40')](_0x213f56[_0x8c64('0x34')],_0x224991[_0x8c64('0x3f')]));_0x2cf7a8[_0x8c64('0x3e')]['ProjectId']=_0x16c600['id'];if(_0x213f56[_0x8c64('0x34')][_0x8c64('0x41')]){_0x2cf7a8['where']=_[_0x8c64('0x42')](_0x2cf7a8[_0x8c64('0x3e')],{'$or':_[_0x8c64('0x2e')](_0x2cf7a8['attributes'],function(_0x267d7f){var _0x3797d4={};_0x3797d4[_0x267d7f]={'$like':'%'+_0x213f56['query'][_0x8c64('0x41')]+'%'};return _0x3797d4;})});}_0x2cf7a8=_[_0x8c64('0x42')]({},_0x2cf7a8,_0x213f56['options']);return db[_0x8c64('0x5a')][_0x8c64('0x1f')]({'where':_0x2cf7a8['where']})[_0x8c64('0x26')](function(_0x1a04db){_0x193fb6[_0x8c64('0x1f')]=_0x1a04db;if(_0x213f56['query']['includeAll']){_0x2cf7a8[_0x8c64('0x45')]=[{'all':!![]}];}return db[_0x8c64('0x5a')][_0x8c64('0x46')](_0x2cf7a8);})[_0x8c64('0x26')](function(_0x2d1085){_0x193fb6[_0x8c64('0x47')]=_0x2d1085;return _0x193fb6;});}})[_0x8c64('0x26')](respondWithFilteredResult(_0x5991ae,_0x2cf7a8))[_0x8c64('0x48')](handleError(_0x5991ae,null));};exports[_0x8c64('0x5b')]=function(_0x5a680e,_0x1bd1d7,_0x263513){var _0x221430={'raw':!![],'where':{}};var _0x459c5a={};var _0x807604={'count':0x0,'rows':[]};return db[_0x8c64('0x2f')][_0x8c64('0x59')]({'where':{'id':_0x5a680e[_0x8c64('0x49')]['id']}})['then'](handleEntityNotFound(_0x1bd1d7,null))[_0x8c64('0x26')](function(_0x46de6e){if(_0x46de6e){_0x459c5a[_0x8c64('0x33')]=_[_0x8c64('0x35')](db['JscriptyAnswerReport'][_0x8c64('0x30')]);_0x459c5a[_0x8c64('0x34')]=_[_0x8c64('0x35')](_0x5a680e[_0x8c64('0x34')]);_0x459c5a[_0x8c64('0x3f')]=_[_0x8c64('0x37')](_0x459c5a['model'],_0x459c5a[_0x8c64('0x34')]);_0x221430[_0x8c64('0x36')]=_['intersection'](_0x459c5a[_0x8c64('0x33')],qs['fields'](_0x5a680e[_0x8c64('0x34')][_0x8c64('0x38')]));_0x221430['attributes']=_0x221430[_0x8c64('0x36')][_0x8c64('0x39')]?_0x221430['attributes']:_0x459c5a['model'];if(!_0x5a680e[_0x8c64('0x34')][_0x8c64('0x3a')](_0x8c64('0x3b'))){_0x221430[_0x8c64('0x1d')]=qs[_0x8c64('0x1d')](_0x5a680e['query'][_0x8c64('0x1d')]);_0x221430[_0x8c64('0x1c')]=qs[_0x8c64('0x1c')](_0x5a680e['query'][_0x8c64('0x1c')]);}_0x221430['order']=qs[_0x8c64('0x3d')](_0x5a680e['query']['sort']);_0x221430[_0x8c64('0x3e')]=qs[_0x8c64('0x3f')](_[_0x8c64('0x40')](_0x5a680e[_0x8c64('0x34')],_0x459c5a[_0x8c64('0x3f')]));_0x221430[_0x8c64('0x3e')][_0x8c64('0x5c')]=_0x46de6e['id'];if(_0x5a680e[_0x8c64('0x34')][_0x8c64('0x41')]){_0x221430['where']=_[_0x8c64('0x42')](_0x221430[_0x8c64('0x3e')],{'$or':_[_0x8c64('0x2e')](_0x221430[_0x8c64('0x36')],function(_0x59b6d3){var _0xdfe435={};_0xdfe435[_0x59b6d3]={'$like':'%'+_0x5a680e['query'][_0x8c64('0x41')]+'%'};return _0xdfe435;})});}_0x221430=_['merge']({},_0x221430,_0x5a680e[_0x8c64('0x4a')]);return db['JscriptyAnswerReport'][_0x8c64('0x1f')]({'where':_0x221430[_0x8c64('0x3e')]})[_0x8c64('0x26')](function(_0x4f5131){_0x807604[_0x8c64('0x1f')]=_0x4f5131;if(_0x5a680e[_0x8c64('0x34')][_0x8c64('0x44')]){_0x221430[_0x8c64('0x45')]=[{'all':!![]}];}return db[_0x8c64('0x5d')][_0x8c64('0x46')](_0x221430);})['then'](function(_0x2d6664){_0x807604[_0x8c64('0x47')]=_0x2d6664;return _0x807604;});}})['then'](respondWithFilteredResult(_0x1bd1d7,_0x221430))[_0x8c64('0x48')](handleError(_0x1bd1d7,null));};function char(_0x3231f1){return _0x8c64('0x5e')===typeof _0x3231f1?String[_0x8c64('0x5f')][_0x8c64('0x21')](null,arguments):_0x3231f1;}function needsEncapsulation(_0x53fc6f){return!!_0x53fc6f&&(_0x53fc6f[_0x8c64('0x60')]()[_0x8c64('0x61')](char(0xd))>=0x0||_0x53fc6f['toString']()[_0x8c64('0x61')](char(0xa))>=0x0||_0x53fc6f['toString']()['indexOf'](char(0x2c))>=0x0||_0x53fc6f['toString']()[_0x8c64('0x61')](char(0x22))>=0x0);}function encapsulate(_0x346559){var _0xc9153=char(0x22),_0x5d19c5='\x5c'+char(0x22),_0x1fe005=_0x346559['toString']()[_0x8c64('0x62')](new RegExp(_0xc9153,'g'),_0x5d19c5);return _0xc9153+_0x1fe005+_0xc9153;}exports[_0x8c64('0x63')]=function(_0x5c4982,_0x328ee4,_0x441ea9){var _0x4126d6,_0x254c91;var _0x38bf6b={'where':{'ProjectId':_0x5c4982['params']['id']}};if(_0x5c4982[_0x8c64('0x34')][_0x8c64('0x64')]){_0x38bf6b[_0x8c64('0x3e')][_0x8c64('0x65')]=JSON[_0x8c64('0x66')](_0x5c4982[_0x8c64('0x34')][_0x8c64('0x64')]);}return db[_0x8c64('0x5a')]['findAll'](_0x38bf6b)['then'](handleEntityNotFound(_0x328ee4,null))[_0x8c64('0x26')](function(_0x4d382e){if(_0x4d382e){_0x4126d6=_0x4d382e;return db[_0x8c64('0x67')][_0x8c64('0x46')]({'where':{'SessionId':{'$in':_['map'](_0x4126d6,'id')},'ProjectId':_0x5c4982[_0x8c64('0x49')]['id']},'order':_0x8c64('0x68')});}})[_0x8c64('0x26')](handleEntityNotFound(_0x328ee4,null))[_0x8c64('0x26')](function(_0x50ef8e){if(_0x50ef8e){_0x254c91=_0x50ef8e;var _0x459b34={};for(var _0x1ebbb8=0x0,_0x50f45b=_0x254c91['length'];_0x1ebbb8<_0x50f45b;_0x1ebbb8++){if(!_0x459b34['hasOwnProperty'](_0x254c91[_0x1ebbb8][_0x8c64('0x69')])){_0x459b34[_0x254c91[_0x1ebbb8][_0x8c64('0x69')]]=needsEncapsulation(_0x254c91[_0x1ebbb8][_0x8c64('0x6a')])?encapsulate(_0x254c91[_0x1ebbb8]['question']):_0x254c91[_0x1ebbb8][_0x8c64('0x6a')];}}var _0x22a26b=[],_0x2fe0bd={};for(var _0x47d4fa=0x0,_0x5d7e0f=_0x4126d6[_0x8c64('0x39')];_0x47d4fa<_0x5d7e0f;_0x47d4fa++){_0x2fe0bd={'ProjectId':_0x5c4982[_0x8c64('0x49')]['id'],'SessionId':_0x4126d6[_0x47d4fa]['id'],'StartTime':moment(_0x4126d6[_0x47d4fa]['starttime'])[_0x8c64('0x6b')](_0x8c64('0x6c'))};for(var _0x2f8972=0x0,_0x4eccec=_0x254c91[_0x8c64('0x39')];_0x2f8972<_0x4eccec;_0x2f8972++){if(_0x254c91[_0x2f8972][_0x8c64('0x6d')]==_0x4126d6[_0x47d4fa]['id']&&_0x459b34['hasOwnProperty'](_0x254c91[_0x2f8972][_0x8c64('0x69')])){_0x2fe0bd[_0x459b34[_0x254c91[_0x2f8972]['questionId']]]=_0x254c91[_0x2f8972][_0x8c64('0x6e')];}}for(var _0x29035d in _0x459b34){if(!_0x2fe0bd['hasOwnProperty'](_0x459b34[_0x29035d])){_0x2fe0bd[_0x459b34[_0x29035d]]=null;}}_0x22a26b['push'](_0x2fe0bd);}return _0x22a26b;}})[_0x8c64('0x26')](function(_0x38b42e){if(!_[_0x8c64('0x6f')](_0x38b42e)){var _0x33ec2c=toCsv(_0x38b42e);var _0x2e7ef8=Date[_0x8c64('0x70')]();fs[_0x8c64('0x71')](util[_0x8c64('0x6b')](_0x8c64('0x72'),_0x5c4982[_0x8c64('0x49')]['id'],_0x2e7ef8),_0x33ec2c);_0x328ee4[_0x8c64('0x73')](_0x8c64('0x74'),_0x8c64('0x75')+util['format'](_0x8c64('0x76'),_0x5c4982[_0x8c64('0x49')]['id'],_0x2e7ef8));_0x328ee4[_0x8c64('0x73')](_0x8c64('0x77'),_0x8c64('0x78'));return _0x328ee4[_0x8c64('0x79')](util[_0x8c64('0x6b')](_0x8c64('0x72'),_0x5c4982[_0x8c64('0x49')]['id'],_0x2e7ef8));}else{return _0x328ee4['sendStatus'](0xcc);}})['catch'](handleError(_0x328ee4,null));}; \ No newline at end of file +var _0x065e=['update','then','destroy','UserProfileResource','error','name','send','index','map','JscriptyProject','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','autoAssociation','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','parse','startTime','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x065e,0x1a7));var _0xe065=function(_0x2b522e,_0xf42ddc){_0x2b522e=_0x2b522e-0x0;var _0x3ade0e=_0x065e[_0x2b522e];return _0x3ade0e;};'use strict';var emlformat=require(_0xe065('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe065('0x1'));var moment=require(_0xe065('0x2'));var BPromise=require(_0xe065('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe065('0x4'));var sox=require(_0xe065('0x5'));var csv=require('to-csv');var ejs=require(_0xe065('0x6'));var fs=require('fs');var fs_extra=require(_0xe065('0x7'));var _=require(_0xe065('0x8'));var squel=require('squel');var crypto=require(_0xe065('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe065('0xa'));var toCsv=require(_0xe065('0xb'));var querystring=require(_0xe065('0xc'));var Papa=require(_0xe065('0xd'));var Redis=require(_0xe065('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe065('0xf'));var as=require(_0xe065('0x10'));var hardwareService=require(_0xe065('0x11'));var logger=require(_0xe065('0x12'))(_0xe065('0x13'));var utils=require(_0xe065('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe065('0x15'))['db'];function respondWithStatusCode(_0x13b697,_0xf5ab44){_0xf5ab44=_0xf5ab44||0xcc;return function(_0x5bd30f){if(_0x5bd30f){return _0x13b697[_0xe065('0x16')](_0xf5ab44);}return _0x13b697[_0xe065('0x17')](_0xf5ab44)[_0xe065('0x18')]();};}function respondWithResult(_0x2e9480,_0x29297b){_0x29297b=_0x29297b||0xc8;return function(_0x541985){if(_0x541985){return _0x2e9480[_0xe065('0x17')](_0x29297b)[_0xe065('0x19')](_0x541985);}};}function respondWithFilteredResult(_0x15d365,_0xc5ef4f){return function(_0x434e07){if(_0x434e07){var _0x352206=typeof _0xc5ef4f[_0xe065('0x1a')]==='undefined'&&typeof _0xc5ef4f[_0xe065('0x1b')]===_0xe065('0x1c');var _0x54d260=_0x434e07[_0xe065('0x1d')];var _0x1d2f7a=_0x352206?0x0:_0xc5ef4f[_0xe065('0x1a')];var _0x14c97c=_0x352206?_0x434e07[_0xe065('0x1d')]:_0xc5ef4f[_0xe065('0x1a')]+_0xc5ef4f[_0xe065('0x1b')];var _0x5000e1;if(_0x14c97c>=_0x54d260){_0x14c97c=_0x54d260;_0x5000e1=0xc8;}else{_0x5000e1=0xce;}_0x15d365[_0xe065('0x17')](_0x5000e1);return _0x15d365['set'](_0xe065('0x1e'),_0x1d2f7a+'-'+_0x14c97c+'/'+_0x54d260)[_0xe065('0x19')](_0x434e07);}return null;};}function patchUpdates(_0x55f55c){return function(_0x1c6567){try{jsonpatch['apply'](_0x1c6567,_0x55f55c,!![]);}catch(_0xe26e9b){return BPromise[_0xe065('0x1f')](_0xe26e9b);}return _0x1c6567[_0xe065('0x20')]();};}function saveUpdates(_0x110556,_0x3ecd13){return function(_0x105cb2){if(_0x105cb2){return _0x105cb2[_0xe065('0x21')](_0x110556)[_0xe065('0x22')](function(_0x1c5dd9){return _0x1c5dd9;});}return null;};}function removeEntity(_0x5081a3,_0x7208af){return function(_0x43b712){if(_0x43b712){return _0x43b712[_0xe065('0x23')]()[_0xe065('0x22')](function(){var _0x5e8b60=_0x43b712['get']({'plain':!![]});var _0x164965='Projects';return db[_0xe065('0x24')][_0xe065('0x23')]({'where':{'type':_0x164965,'resourceId':_0x5e8b60['id']}})[_0xe065('0x22')](function(){return _0x43b712;});})[_0xe065('0x22')](function(){_0x5081a3[_0xe065('0x17')](0xcc)[_0xe065('0x18')]();});}};}function handleEntityNotFound(_0x3b1caf,_0x26a159){return function(_0x52cd9c){if(!_0x52cd9c){_0x3b1caf['sendStatus'](0x194);}return _0x52cd9c;};}function handleError(_0x14de01,_0x10e6ba){_0x10e6ba=_0x10e6ba||0x1f4;return function(_0x23aee9){logger[_0xe065('0x25')](_0x23aee9['stack']);if(_0x23aee9[_0xe065('0x26')]){delete _0x23aee9['name'];}_0x14de01['status'](_0x10e6ba)[_0xe065('0x27')](_0x23aee9);};}exports[_0xe065('0x28')]=function(_0x2aa766,_0x5b8523){var _0x883747={},_0x59b915={},_0x12679d={'count':0x0,'rows':[]};var _0x46db7e=_[_0xe065('0x29')](db[_0xe065('0x2a')]['rawAttributes'],function(_0x3f02b2){return{'name':_0x3f02b2['fieldName'],'type':_0x3f02b2[_0xe065('0x2b')][_0xe065('0x2c')]};});_0x59b915['model']=_[_0xe065('0x29')](_0x46db7e,'name');_0x59b915[_0xe065('0x2d')]=_['keys'](_0x2aa766[_0xe065('0x2d')]);_0x59b915[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],_0x59b915['query']);_0x883747[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x59b915[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x32')]));_0x883747['attributes']=_0x883747[_0xe065('0x31')][_0xe065('0x33')]?_0x883747['attributes']:_0x59b915[_0xe065('0x30')];if(!_0x2aa766[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0x883747[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x2aa766[_0xe065('0x2d')]['limit']);_0x883747[_0xe065('0x1a')]=qs['offset'](_0x2aa766[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x883747[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x2aa766[_0xe065('0x2d')][_0xe065('0x37')]);_0x883747['where']=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x2aa766[_0xe065('0x2d')],_0x59b915['filters']),_0x46db7e);if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]){_0x883747[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x883747[_0xe065('0x3a')],{'$or':_['map'](_0x46db7e,function(_0x341740){if(_0x341740[_0xe065('0x2b')]!=='VIRTUAL'){var _0x236e75={};_0x236e75[_0x341740['name']]={'$like':'%'+_0x2aa766[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x236e75;}})});}_0x883747=_['merge']({},_0x883747,_0x2aa766[_0xe065('0x3c')]);var _0x20c881={'where':_0x883747['where']};return db[_0xe065('0x2a')][_0xe065('0x1d')](_0x20c881)[_0xe065('0x22')](function(_0x44a3f6){_0x12679d[_0xe065('0x1d')]=_0x44a3f6;if(_0x2aa766[_0xe065('0x2d')][_0xe065('0x3d')]){_0x883747[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x2a')][_0xe065('0x3f')](_0x883747);})[_0xe065('0x22')](function(_0x4364c3){_0x12679d[_0xe065('0x40')]=_0x4364c3;return _0x12679d;})['then'](respondWithFilteredResult(_0x5b8523,_0x883747))['catch'](handleError(_0x5b8523,null));};exports[_0xe065('0x41')]=function(_0x2bf092,_0x5ee4ec){var _0x3ba838={'raw':![],'where':{'id':_0x2bf092[_0xe065('0x42')]['id']}},_0x448044={};_0x448044[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x448044[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x2bf092['query']);_0x448044[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],_0x448044['query']);_0x3ba838[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x448044[_0xe065('0x30')],qs[_0xe065('0x32')](_0x2bf092['query'][_0xe065('0x32')]));_0x3ba838[_0xe065('0x31')]=_0x3ba838[_0xe065('0x31')][_0xe065('0x33')]?_0x3ba838[_0xe065('0x31')]:_0x448044[_0xe065('0x30')];if(_0x2bf092[_0xe065('0x2d')]['includeAll']){_0x3ba838[_0xe065('0x3e')]=[{'all':!![]}];}_0x3ba838=_[_0xe065('0x3b')]({},_0x3ba838,_0x2bf092[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x3ba838)[_0xe065('0x22')](handleEntityNotFound(_0x5ee4ec,null))[_0xe065('0x22')](respondWithResult(_0x5ee4ec,null))['catch'](handleError(_0x5ee4ec,null));};exports[_0xe065('0x46')]=function(_0x5a2360,_0x45fe1f){return db[_0xe065('0x2a')][_0xe065('0x46')](_0x5a2360['body'],{})[_0xe065('0x22')](function(_0x16898c){var _0x3ab70d=_0x5a2360[_0xe065('0x47')][_0xe065('0x48')]({'plain':!![]});if(!_0x3ab70d)throw new Error(_0xe065('0x49'));if(_0x3ab70d[_0xe065('0x4a')]===_0xe065('0x47')){var _0x3095c8=_0x16898c[_0xe065('0x48')]({'plain':!![]});var _0x3f91a2=_0xe065('0x4b');return db[_0xe065('0x4c')]['find']({'where':{'name':_0x3f91a2,'userProfileId':_0x3ab70d['userProfileId']},'raw':!![]})['then'](function(_0x23ba0b){if(_0x23ba0b&&_0x23ba0b['autoAssociation']===0x0){return db[_0xe065('0x24')][_0xe065('0x46')]({'name':_0x3095c8[_0xe065('0x26')],'resourceId':_0x3095c8['id'],'type':_0x23ba0b['name'],'sectionId':_0x23ba0b['id']},{})[_0xe065('0x22')](function(){return _0x16898c;});}else{return _0x16898c;}})[_0xe065('0x4d')](function(_0x5cce78){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x5cce78);throw _0x5cce78;});}return _0x16898c;})[_0xe065('0x22')](respondWithResult(_0x45fe1f,0xc9))[_0xe065('0x4d')](handleError(_0x45fe1f,null));};exports[_0xe065('0x4f')]=function(_0x1ea568,_0xe77af6){var _0x2f0ed5={'where':{'id':_0x1ea568[_0xe065('0x42')]['id']}},_0x43480d={};_0x43480d['model']=_[_0xe065('0x43')](db[_0xe065('0x2a')][_0xe065('0x44')]);_0x2f0ed5[_0xe065('0x31')]=_['intersection'](_0x43480d[_0xe065('0x30')],qs[_0xe065('0x32')](_0x1ea568[_0xe065('0x2d')][_0xe065('0x32')]));_0x2f0ed5['attributes']=_0x2f0ed5[_0xe065('0x31')][_0xe065('0x33')]?_0x2f0ed5[_0xe065('0x31')]:_0x43480d['model'];if(_0x1ea568[_0xe065('0x2d')][_0xe065('0x3d')]){_0x2f0ed5[_0xe065('0x3e')]=[{'all':!![]}];}_0x2f0ed5=_[_0xe065('0x3b')]({},_0x2f0ed5,_0x1ea568[_0xe065('0x3c')]);return db[_0xe065('0x2a')][_0xe065('0x45')](_0x2f0ed5)[_0xe065('0x22')](handleEntityNotFound(_0xe77af6,null))[_0xe065('0x22')](function(_0x5ec6fe){if(_0x5ec6fe){var _0x2accad=_0x5ec6fe['get']({'plain':!![]});_0x2accad=qs[_0xe065('0x50')](_0x2accad,['id',_0xe065('0x51'),_0xe065('0x52')]);_0x1ea568['body']=_['omit'](_0x1ea568['body'],['id',_0xe065('0x51'),_0xe065('0x52')]);return db[_0xe065('0x2a')][_0xe065('0x46')](_[_0xe065('0x3b')](_0x2accad,_0x1ea568[_0xe065('0x53')]),{'include':_0x1ea568[_0xe065('0x2d')][_0xe065('0x3d')]?[{'all':!![]}]:undefined})[_0xe065('0x22')](function(_0x3169fa){var _0x25ec8a=_0x1ea568['user']['get']({'plain':!![]});if(!_0x25ec8a)throw new Error(_0xe065('0x49'));if(_0x25ec8a[_0xe065('0x4a')]==='user'){var _0x276c17=_0x3169fa['get']({'plain':!![]});var _0x4f4dca=_0xe065('0x4b');return db[_0xe065('0x4c')][_0xe065('0x45')]({'where':{'name':_0x4f4dca,'userProfileId':_0x25ec8a[_0xe065('0x54')]},'raw':!![]})[_0xe065('0x22')](function(_0x817baf){if(_0x817baf&&_0x817baf[_0xe065('0x55')]===0x0){return db['UserProfileResource'][_0xe065('0x46')]({'name':_0x276c17[_0xe065('0x26')],'resourceId':_0x276c17['id'],'type':_0x817baf[_0xe065('0x26')],'sectionId':_0x817baf['id']},{})[_0xe065('0x22')](function(){return _0x3169fa;});}else{return _0x3169fa;}})[_0xe065('0x4d')](function(_0x4f35a6){logger[_0xe065('0x25')](_0xe065('0x4e'),_0x4f35a6);throw _0x4f35a6;});}return _0x3169fa;});}})[_0xe065('0x22')](respondWithResult(_0xe77af6,0xc9))[_0xe065('0x4d')](handleError(_0xe77af6,null));};exports[_0xe065('0x21')]=function(_0xfce2e,_0x5af9d5){if(_0xfce2e['body']['id']){delete _0xfce2e['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0xfce2e[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x5af9d5,null))[_0xe065('0x22')](saveUpdates(_0xfce2e[_0xe065('0x53')],null))[_0xe065('0x22')](respondWithResult(_0x5af9d5,null))[_0xe065('0x4d')](handleError(_0x5af9d5,null));};exports[_0xe065('0x23')]=function(_0x4084a0,_0x507fd2){return db['JscriptyProject'][_0xe065('0x45')]({'where':{'id':_0x4084a0[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x507fd2,null))['then'](removeEntity(_0x507fd2,null))[_0xe065('0x4d')](handleError(_0x507fd2,null));};exports[_0xe065('0x56')]=function(_0x113a0f,_0x4765a0,_0x136e40){var _0x2c0b2e={'raw':!![],'where':{}};var _0xac5395={};var _0x199ca3={'count':0x0,'rows':[]};return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x113a0f[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x4765a0,null))[_0xe065('0x22')](function(_0xc0ebe8){if(_0xc0ebe8){_0xac5395[_0xe065('0x30')]=_[_0xe065('0x43')](db[_0xe065('0x58')][_0xe065('0x44')]);_0xac5395['query']=_[_0xe065('0x43')](_0x113a0f[_0xe065('0x2d')]);_0xac5395[_0xe065('0x2e')]=_[_0xe065('0x2f')](_0xac5395[_0xe065('0x30')],_0xac5395[_0xe065('0x2d')]);_0x2c0b2e[_0xe065('0x31')]=_[_0xe065('0x2f')](_0xac5395[_0xe065('0x30')],qs[_0xe065('0x32')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x32')]));_0x2c0b2e[_0xe065('0x31')]=_0x2c0b2e[_0xe065('0x31')][_0xe065('0x33')]?_0x2c0b2e[_0xe065('0x31')]:_0xac5395[_0xe065('0x30')];if(!_0x113a0f['query'][_0xe065('0x34')](_0xe065('0x35'))){_0x2c0b2e[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x1b')]);_0x2c0b2e[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x113a0f[_0xe065('0x2d')][_0xe065('0x1a')]);}_0x2c0b2e['order']=qs['sort'](_0x113a0f[_0xe065('0x2d')]['sort']);_0x2c0b2e[_0xe065('0x3a')]=qs['filters'](_[_0xe065('0x38')](_0x113a0f[_0xe065('0x2d')],_0xac5395[_0xe065('0x2e')]));_0x2c0b2e[_0xe065('0x3a')][_0xe065('0x59')]=_0xc0ebe8['id'];if(_0x113a0f[_0xe065('0x2d')][_0xe065('0x39')]){_0x2c0b2e[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0x2c0b2e['where'],{'$or':_[_0xe065('0x29')](_0x2c0b2e[_0xe065('0x31')],function(_0x134d0a){var _0x3f8e32={};_0x3f8e32[_0x134d0a]={'$like':'%'+_0x113a0f['query'][_0xe065('0x39')]+'%'};return _0x3f8e32;})});}_0x2c0b2e=_[_0xe065('0x3b')]({},_0x2c0b2e,_0x113a0f[_0xe065('0x3c')]);return db['JscriptySessionReport'][_0xe065('0x1d')]({'where':_0x2c0b2e[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x52f0ac){_0x199ca3[_0xe065('0x1d')]=_0x52f0ac;if(_0x113a0f[_0xe065('0x2d')]['includeAll']){_0x2c0b2e['include']=[{'all':!![]}];}return db[_0xe065('0x58')][_0xe065('0x3f')](_0x2c0b2e);})[_0xe065('0x22')](function(_0x3f3878){_0x199ca3[_0xe065('0x40')]=_0x3f3878;return _0x199ca3;});}})['then'](respondWithFilteredResult(_0x4765a0,_0x2c0b2e))['catch'](handleError(_0x4765a0,null));};exports[_0xe065('0x5a')]=function(_0x1263f7,_0x4bed1d,_0x13e0ed){var _0xb32a44={'raw':!![],'where':{}};var _0x3d9fe8={};var _0x3251df={'count':0x0,'rows':[]};return db[_0xe065('0x2a')][_0xe065('0x57')]({'where':{'id':_0x1263f7[_0xe065('0x42')]['id']}})[_0xe065('0x22')](handleEntityNotFound(_0x4bed1d,null))[_0xe065('0x22')](function(_0x1ec81f){if(_0x1ec81f){_0x3d9fe8['model']=_['keys'](db[_0xe065('0x5b')][_0xe065('0x44')]);_0x3d9fe8[_0xe065('0x2d')]=_[_0xe065('0x43')](_0x1263f7[_0xe065('0x2d')]);_0x3d9fe8['filters']=_[_0xe065('0x2f')](_0x3d9fe8[_0xe065('0x30')],_0x3d9fe8[_0xe065('0x2d')]);_0xb32a44[_0xe065('0x31')]=_[_0xe065('0x2f')](_0x3d9fe8[_0xe065('0x30')],qs[_0xe065('0x32')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x32')]));_0xb32a44[_0xe065('0x31')]=_0xb32a44[_0xe065('0x31')]['length']?_0xb32a44[_0xe065('0x31')]:_0x3d9fe8[_0xe065('0x30')];if(!_0x1263f7[_0xe065('0x2d')][_0xe065('0x34')](_0xe065('0x35'))){_0xb32a44[_0xe065('0x1b')]=qs[_0xe065('0x1b')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x1b')]);_0xb32a44[_0xe065('0x1a')]=qs[_0xe065('0x1a')](_0x1263f7[_0xe065('0x2d')]['offset']);}_0xb32a44[_0xe065('0x36')]=qs[_0xe065('0x37')](_0x1263f7[_0xe065('0x2d')][_0xe065('0x37')]);_0xb32a44[_0xe065('0x3a')]=qs[_0xe065('0x2e')](_[_0xe065('0x38')](_0x1263f7[_0xe065('0x2d')],_0x3d9fe8[_0xe065('0x2e')]));_0xb32a44[_0xe065('0x3a')][_0xe065('0x59')]=_0x1ec81f['id'];if(_0x1263f7[_0xe065('0x2d')][_0xe065('0x39')]){_0xb32a44[_0xe065('0x3a')]=_[_0xe065('0x3b')](_0xb32a44[_0xe065('0x3a')],{'$or':_[_0xe065('0x29')](_0xb32a44[_0xe065('0x31')],function(_0x105eaa){var _0x2052fb={};_0x2052fb[_0x105eaa]={'$like':'%'+_0x1263f7[_0xe065('0x2d')][_0xe065('0x39')]+'%'};return _0x2052fb;})});}_0xb32a44=_[_0xe065('0x3b')]({},_0xb32a44,_0x1263f7[_0xe065('0x3c')]);return db[_0xe065('0x5b')][_0xe065('0x1d')]({'where':_0xb32a44[_0xe065('0x3a')]})[_0xe065('0x22')](function(_0x3a53a4){_0x3251df[_0xe065('0x1d')]=_0x3a53a4;if(_0x1263f7[_0xe065('0x2d')][_0xe065('0x3d')]){_0xb32a44[_0xe065('0x3e')]=[{'all':!![]}];}return db[_0xe065('0x5b')][_0xe065('0x3f')](_0xb32a44);})[_0xe065('0x22')](function(_0x23f071){_0x3251df[_0xe065('0x40')]=_0x23f071;return _0x3251df;});}})[_0xe065('0x22')](respondWithFilteredResult(_0x4bed1d,_0xb32a44))[_0xe065('0x4d')](handleError(_0x4bed1d,null));};function char(_0x4da03f){return _0xe065('0x5c')===typeof _0x4da03f?String[_0xe065('0x5d')][_0xe065('0x5e')](null,arguments):_0x4da03f;}function needsEncapsulation(_0xe199d7){return!!_0xe199d7&&(_0xe199d7[_0xe065('0x5f')]()[_0xe065('0x60')](char(0xd))>=0x0||_0xe199d7[_0xe065('0x5f')]()[_0xe065('0x60')](char(0xa))>=0x0||_0xe199d7['toString']()[_0xe065('0x60')](char(0x2c))>=0x0||_0xe199d7['toString']()[_0xe065('0x60')](char(0x22))>=0x0);}function encapsulate(_0x550c0b){var _0x110f5e=char(0x22),_0x1fed2d='\x5c'+char(0x22),_0x19e3cf=_0x550c0b[_0xe065('0x5f')]()['replace'](new RegExp(_0x110f5e,'g'),_0x1fed2d);return _0x110f5e+_0x19e3cf+_0x110f5e;}exports['getSummary']=function(_0x27606f,_0x40431a,_0x40fe42){var _0x47c3f8,_0x2b7964;var _0x32d7af={'where':{'ProjectId':_0x27606f[_0xe065('0x42')]['id']}};if(_0x27606f['query']['startTime']){_0x32d7af['where']['starttime']=JSON[_0xe065('0x61')](_0x27606f[_0xe065('0x2d')][_0xe065('0x62')]);}return db[_0xe065('0x58')][_0xe065('0x3f')](_0x32d7af)['then'](handleEntityNotFound(_0x40431a,null))[_0xe065('0x22')](function(_0xa524d8){if(_0xa524d8){_0x47c3f8=_0xa524d8;return db['JscriptyQuestionReport'][_0xe065('0x3f')]({'where':{'SessionId':{'$in':_['map'](_0x47c3f8,'id')},'ProjectId':_0x27606f[_0xe065('0x42')]['id']},'order':'-createdAt'});}})[_0xe065('0x22')](handleEntityNotFound(_0x40431a,null))[_0xe065('0x22')](function(_0xde5ead){if(_0xde5ead){_0x2b7964=_0xde5ead;var _0x2c1d4c={};for(var _0x201009=0x0,_0x24a944=_0x2b7964[_0xe065('0x33')];_0x201009<_0x24a944;_0x201009++){if(!_0x2c1d4c[_0xe065('0x34')](_0x2b7964[_0x201009][_0xe065('0x63')])){_0x2c1d4c[_0x2b7964[_0x201009][_0xe065('0x63')]]=needsEncapsulation(_0x2b7964[_0x201009][_0xe065('0x64')])?encapsulate(_0x2b7964[_0x201009][_0xe065('0x64')]):_0x2b7964[_0x201009][_0xe065('0x64')];}}var _0x168fd8=[],_0x518683={};for(var _0x4e98f8=0x0,_0x3709ea=_0x47c3f8[_0xe065('0x33')];_0x4e98f8<_0x3709ea;_0x4e98f8++){_0x518683={'ProjectId':_0x27606f['params']['id'],'SessionId':_0x47c3f8[_0x4e98f8]['id'],'StartTime':moment(_0x47c3f8[_0x4e98f8][_0xe065('0x65')])[_0xe065('0x66')](_0xe065('0x67'))};for(var _0x18271d=0x0,_0x368b31=_0x2b7964[_0xe065('0x33')];_0x18271d<_0x368b31;_0x18271d++){if(_0x2b7964[_0x18271d][_0xe065('0x68')]==_0x47c3f8[_0x4e98f8]['id']&&_0x2c1d4c['hasOwnProperty'](_0x2b7964[_0x18271d]['questionId'])){_0x518683[_0x2c1d4c[_0x2b7964[_0x18271d][_0xe065('0x63')]]]=_0x2b7964[_0x18271d][_0xe065('0x69')];}}for(var _0x343413 in _0x2c1d4c){if(!_0x518683[_0xe065('0x34')](_0x2c1d4c[_0x343413])){_0x518683[_0x2c1d4c[_0x343413]]=null;}}_0x168fd8['push'](_0x518683);}return _0x168fd8;}})[_0xe065('0x22')](function(_0x33f41c){if(!_[_0xe065('0x6a')](_0x33f41c)){var _0x444ef8=toCsv(_0x33f41c);var _0x30ff95=Date[_0xe065('0x6b')]();fs['writeFileSync'](util[_0xe065('0x66')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x27606f['params']['id'],_0x30ff95),_0x444ef8);_0x40431a[_0xe065('0x6c')](_0xe065('0x6d'),_0xe065('0x6e')+util[_0xe065('0x66')]('Jscripty_Project_%d_Summary_%s.csv',_0x27606f[_0xe065('0x42')]['id'],_0x30ff95));_0x40431a[_0xe065('0x6c')]('Content-type',_0xe065('0x6f'));return _0x40431a[_0xe065('0x70')](util[_0xe065('0x66')](_0xe065('0x71'),_0x27606f[_0xe065('0x42')]['id'],_0x30ff95));}else{return _0x40431a['sendStatus'](0xcc);}})[_0xe065('0x4d')](handleError(_0x40431a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 335dedf..dd9a3e8 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 _0x4403=['JscriptyProject','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','define'];(function(_0x5501c8,_0x400d3e){var _0x19824d=function(_0x56076b){while(--_0x56076b){_0x5501c8['push'](_0x5501c8['shift']());}};_0x19824d(++_0x400d3e);}(_0x4403,0x179));var _0x3440=function(_0xed353f,_0x4ddc1c){_0xed353f=_0xed353f-0x0;var _0x205fde=_0x4403[_0xed353f];return _0x205fde;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3440('0x0'));var moment=require('moment');var BPromise=require(_0x3440('0x1'));var rp=require(_0x3440('0x2'));var fs=require('fs');var path=require(_0x3440('0x3'));var rimraf=require(_0x3440('0x4'));var config=require('../../config/environment');var attributes=require(_0x3440('0x5'));module['exports']=function(_0x5904cb,_0x1e5e8d){return _0x5904cb[_0x3440('0x6')](_0x3440('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23d3=['../../config/environment','exports','define','jscripty_projects','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x23d3,0xe8));var _0x323d=function(_0x45a161,_0x15e34e){_0x45a161=_0x45a161-0x0;var _0x54de39=_0x23d3[_0x45a161];return _0x54de39;};'use strict';var _=require(_0x323d('0x0'));var util=require(_0x323d('0x1'));var logger=require(_0x323d('0x2'))('api');var moment=require(_0x323d('0x3'));var BPromise=require(_0x323d('0x4'));var rp=require(_0x323d('0x5'));var fs=require('fs');var path=require(_0x323d('0x6'));var rimraf=require(_0x323d('0x7'));var config=require(_0x323d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x323d('0x9')]=function(_0x34f513,_0x160a18){return _0x34f513[_0x323d('0xa')]('JscriptyProject',attributes,{'tableName':_0x323d('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 532d01e..866ffc9 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x58e8b1,_0xaa993e){var _0x35ab42=function(_0x12480c){while(--_0x12480c){_0x58e8b1['push'](_0x58e8b1['shift']());}};_0x35ab42(++_0xaa993e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5e85f9,_0x136a52){_0x5e85f9=_0x5e85f9-0x0;var _0x178ecc=_0xb43b[_0x5e85f9];return _0x178ecc;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _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(_0x77d513,_0xf0775b){var _0x5a0853=function(_0x445c91){while(--_0x445c91){_0x77d513['push'](_0x77d513['shift']());}};_0x5a0853(++_0xf0775b);}(_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 6dce8bd..5856ecd 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 _0xb779=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x4a3165,_0x5200ce){var _0x184ad9=function(_0x7ddff5){while(--_0x7ddff5){_0x4a3165['push'](_0x4a3165['shift']());}};_0x184ad9(++_0x5200ce);}(_0xb779,0x6f));var _0x9b77=function(_0x350ce9,_0x1f4694){_0x350ce9=_0x350ce9-0x0;var _0x34bccc=_0xb779[_0x350ce9];return _0x34bccc;};'use strict';var multer=require(_0x9b77('0x0'));var util=require('util');var path=require(_0x9b77('0x1'));var timeout=require(_0x9b77('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9b77('0x3'));var auth=require(_0x9b77('0x4'));var interaction=require(_0x9b77('0x5'));var config=require(_0x9b77('0x6'));var controller=require(_0x9b77('0x7'));router[_0x9b77('0x8')]('/',auth[_0x9b77('0x9')](),controller[_0x9b77('0xa')]);router['get']('/describe',auth[_0x9b77('0x9')](),controller['describe']);router[_0x9b77('0x8')](_0x9b77('0xb'),auth[_0x9b77('0x9')](),controller[_0x9b77('0xc')]);router[_0x9b77('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b77('0xe')]);router[_0x9b77('0xf')](_0x9b77('0xb'),auth[_0x9b77('0x9')](),controller[_0x9b77('0x10')]);router[_0x9b77('0x11')](_0x9b77('0xb'),auth[_0x9b77('0x9')](),controller['destroy']);module[_0x9b77('0x12')]=router; \ No newline at end of file +var _0xa443=['index','describe','/:id','show','put','update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x4e2240,_0x47e093){var _0x18a33f=function(_0x27bd55){while(--_0x27bd55){_0x4e2240['push'](_0x4e2240['shift']());}};_0x18a33f(++_0x47e093);}(_0xa443,0xc7));var _0x3a44=function(_0x4e81eb,_0x1a1e7c){_0x4e81eb=_0x4e81eb-0x0;var _0x4f52e3=_0xa443[_0x4e81eb];return _0x4f52e3;};'use strict';var multer=require(_0x3a44('0x0'));var util=require(_0x3a44('0x1'));var path=require(_0x3a44('0x2'));var timeout=require(_0x3a44('0x3'));var express=require(_0x3a44('0x4'));var router=express[_0x3a44('0x5')]();var fs_extra=require(_0x3a44('0x6'));var auth=require(_0x3a44('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3a44('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x3a44('0x9')]('/',auth['isAuthenticated'](),controller[_0x3a44('0xa')]);router[_0x3a44('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x3a44('0xb')]);router[_0x3a44('0x9')](_0x3a44('0xc'),auth['isAuthenticated'](),controller[_0x3a44('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3a44('0xe')](_0x3a44('0xc'),auth['isAuthenticated'](),controller[_0x3a44('0xf')]);router[_0x3a44('0x10')](_0x3a44('0xc'),auth[_0x3a44('0x11')](),controller[_0x3a44('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index b2ebfa8..a85410c 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7a54,0x106));var _0x47a5=function(_0x2c54e2,_0x1aa44a){_0x2c54e2=_0x2c54e2-0x0;var _0x481123=_0x7a54[_0x2c54e2];return _0x481123;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7a54,0x106));var _0x47a5=function(_0x22e1ec,_0x4b485e){_0x22e1ec=_0x22e1ec-0x0;var _0x3c0217=_0x7a54[_0x22e1ec];return _0x3c0217;};'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 290651e..dd9a2ed 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 _0x5336=['catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','rows'];(function(_0x4e5496,_0x389137){var _0x3d7bdb=function(_0x3dc8a8){while(--_0x3dc8a8){_0x4e5496['push'](_0x4e5496['shift']());}};_0x3d7bdb(++_0x389137);}(_0x5336,0x13a));var _0x6533=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x5336[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x6533('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6533('0x1'));var jsonpatch=require(_0x6533('0x2'));var rp=require(_0x6533('0x3'));var moment=require(_0x6533('0x4'));var BPromise=require(_0x6533('0x5'));var Mustache=require(_0x6533('0x6'));var util=require(_0x6533('0x7'));var path=require(_0x6533('0x8'));var sox=require(_0x6533('0x9'));var csv=require('to-csv');var ejs=require(_0x6533('0xa'));var fs=require('fs');var fs_extra=require(_0x6533('0xb'));var _=require(_0x6533('0xc'));var squel=require(_0x6533('0xd'));var crypto=require(_0x6533('0xe'));var jsforce=require(_0x6533('0xf'));var deskjs=require(_0x6533('0x10'));var toCsv=require(_0x6533('0x11'));var querystring=require(_0x6533('0x12'));var Papa=require(_0x6533('0x13'));var Redis=require(_0x6533('0x14'));var authService=require(_0x6533('0x15'));var qs=require(_0x6533('0x16'));var as=require(_0x6533('0x17'));var hardwareService=require(_0x6533('0x18'));var logger=require(_0x6533('0x19'))('api');var utils=require(_0x6533('0x1a'));var config=require(_0x6533('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x6533('0x1c'))['db'];function respondWithStatusCode(_0xb0adea,_0x5a8ccd){_0x5a8ccd=_0x5a8ccd||0xcc;return function(_0x494389){if(_0x494389){return _0xb0adea[_0x6533('0x1d')](_0x5a8ccd);}return _0xb0adea[_0x6533('0x1e')](_0x5a8ccd)['end']();};}function respondWithResult(_0x5de227,_0x510086){_0x510086=_0x510086||0xc8;return function(_0x39a335){if(_0x39a335){return _0x5de227[_0x6533('0x1e')](_0x510086)[_0x6533('0x1f')](_0x39a335);}};}function respondWithFilteredResult(_0x2e6e76,_0xf12a86){return function(_0x37c2ea){if(_0x37c2ea){var _0x269de5=typeof _0xf12a86[_0x6533('0x20')]==='undefined'&&typeof _0xf12a86[_0x6533('0x21')]===_0x6533('0x22');var _0x31244d=_0x37c2ea[_0x6533('0x23')];var _0xd82f2f=_0x269de5?0x0:_0xf12a86[_0x6533('0x20')];var _0x24a557=_0x269de5?_0x37c2ea[_0x6533('0x23')]:_0xf12a86[_0x6533('0x20')]+_0xf12a86['limit'];var _0x2190f3;if(_0x24a557>=_0x31244d){_0x24a557=_0x31244d;_0x2190f3=0xc8;}else{_0x2190f3=0xce;}_0x2e6e76[_0x6533('0x1e')](_0x2190f3);return _0x2e6e76['set'](_0x6533('0x24'),_0xd82f2f+'-'+_0x24a557+'/'+_0x31244d)[_0x6533('0x1f')](_0x37c2ea);}return null;};}function patchUpdates(_0x4040f2){return function(_0x38c048){try{jsonpatch[_0x6533('0x25')](_0x38c048,_0x4040f2,!![]);}catch(_0x7832b9){return BPromise['reject'](_0x7832b9);}return _0x38c048[_0x6533('0x26')]();};}function saveUpdates(_0x385f98,_0x49a910){return function(_0x252b38){if(_0x252b38){return _0x252b38[_0x6533('0x27')](_0x385f98)[_0x6533('0x28')](function(_0x3e7d98){return _0x3e7d98;});}return null;};}function removeEntity(_0xfb2049,_0x5eb3d7){return function(_0x48c526){if(_0x48c526){return _0x48c526[_0x6533('0x29')]()[_0x6533('0x28')](function(){_0xfb2049['status'](0xcc)[_0x6533('0x2a')]();});}};}function handleEntityNotFound(_0x11204d,_0x180356){return function(_0x24844a){if(!_0x24844a){_0x11204d['sendStatus'](0x194);}return _0x24844a;};}function handleError(_0x594795,_0xafd382){_0xafd382=_0xafd382||0x1f4;return function(_0x52111b){logger[_0x6533('0x2b')](_0x52111b['stack']);if(_0x52111b['name']){delete _0x52111b[_0x6533('0x2c')];}_0x594795[_0x6533('0x1e')](_0xafd382)[_0x6533('0x2d')](_0x52111b);};}exports[_0x6533('0x2e')]=function(_0x599727,_0x337c3c){var _0x29c87={},_0x47e8c3={},_0x2efa87={'count':0x0,'rows':[]};var _0x438838=_[_0x6533('0x2f')](db[_0x6533('0x30')][_0x6533('0x31')],function(_0x52868f){return{'name':_0x52868f[_0x6533('0x32')],'type':_0x52868f[_0x6533('0x33')][_0x6533('0x34')]};});_0x47e8c3['model']=_[_0x6533('0x2f')](_0x438838,'name');_0x47e8c3[_0x6533('0x35')]=_[_0x6533('0x36')](_0x599727[_0x6533('0x35')]);_0x47e8c3['filters']=_[_0x6533('0x37')](_0x47e8c3['model'],_0x47e8c3['query']);_0x29c87['attributes']=_['intersection'](_0x47e8c3[_0x6533('0x38')],qs[_0x6533('0x39')](_0x599727[_0x6533('0x35')][_0x6533('0x39')]));_0x29c87[_0x6533('0x3a')]=_0x29c87[_0x6533('0x3a')]['length']?_0x29c87[_0x6533('0x3a')]:_0x47e8c3[_0x6533('0x38')];if(!_0x599727['query'][_0x6533('0x3b')](_0x6533('0x3c'))){_0x29c87[_0x6533('0x21')]=qs['limit'](_0x599727[_0x6533('0x35')]['limit']);_0x29c87[_0x6533('0x20')]=qs['offset'](_0x599727['query'][_0x6533('0x20')]);}_0x29c87[_0x6533('0x3d')]=qs[_0x6533('0x3e')](_0x599727[_0x6533('0x35')][_0x6533('0x3e')]);_0x29c87[_0x6533('0x3f')]=qs['filters'](_['pick'](_0x599727[_0x6533('0x35')],_0x47e8c3[_0x6533('0x40')]),_0x438838);if(_0x599727[_0x6533('0x35')]['filter']){_0x29c87[_0x6533('0x3f')]=_[_0x6533('0x41')](_0x29c87[_0x6533('0x3f')],{'$or':_[_0x6533('0x2f')](_0x438838,function(_0x3764b0){if(_0x3764b0[_0x6533('0x33')]!=='VIRTUAL'){var _0x5c34d8={};_0x5c34d8[_0x3764b0[_0x6533('0x2c')]]={'$like':'%'+_0x599727[_0x6533('0x35')][_0x6533('0x42')]+'%'};return _0x5c34d8;}})});}_0x29c87=_[_0x6533('0x41')]({},_0x29c87,_0x599727[_0x6533('0x43')]);var _0x39fb73={'where':_0x29c87[_0x6533('0x3f')]};return db[_0x6533('0x30')][_0x6533('0x23')](_0x39fb73)[_0x6533('0x28')](function(_0x3ad18d){_0x2efa87[_0x6533('0x23')]=_0x3ad18d;if(_0x599727['query'][_0x6533('0x44')]){_0x29c87[_0x6533('0x45')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x29c87);})[_0x6533('0x28')](function(_0x5eb261){_0x2efa87[_0x6533('0x46')]=_0x5eb261;return _0x2efa87;})[_0x6533('0x28')](respondWithFilteredResult(_0x337c3c,_0x29c87))[_0x6533('0x47')](handleError(_0x337c3c,null));};exports['show']=function(_0x29b8f4,_0x212168){var _0x23b0be={'raw':!![],'where':{'id':_0x29b8f4[_0x6533('0x48')]['id']}},_0x17355c={};_0x17355c[_0x6533('0x38')]=_[_0x6533('0x36')](db[_0x6533('0x30')]['rawAttributes']);_0x17355c[_0x6533('0x35')]=_[_0x6533('0x36')](_0x29b8f4['query']);_0x17355c[_0x6533('0x40')]=_[_0x6533('0x37')](_0x17355c[_0x6533('0x38')],_0x17355c[_0x6533('0x35')]);_0x23b0be['attributes']=_['intersection'](_0x17355c[_0x6533('0x38')],qs[_0x6533('0x39')](_0x29b8f4[_0x6533('0x35')][_0x6533('0x39')]));_0x23b0be['attributes']=_0x23b0be[_0x6533('0x3a')]['length']?_0x23b0be[_0x6533('0x3a')]:_0x17355c['model'];if(_0x29b8f4[_0x6533('0x35')][_0x6533('0x44')]){_0x23b0be['include']=[{'all':!![]}];}_0x23b0be=_['merge']({},_0x23b0be,_0x29b8f4[_0x6533('0x43')]);return db[_0x6533('0x30')][_0x6533('0x49')](_0x23b0be)[_0x6533('0x28')](handleEntityNotFound(_0x212168,null))[_0x6533('0x28')](respondWithResult(_0x212168,null))[_0x6533('0x47')](handleError(_0x212168,null));};exports[_0x6533('0x4a')]=function(_0x5dda82,_0x5f4ba0){return db[_0x6533('0x30')]['create'](_0x5dda82[_0x6533('0x4b')],{})[_0x6533('0x28')](respondWithResult(_0x5f4ba0,0xc9))['catch'](handleError(_0x5f4ba0,null));};exports[_0x6533('0x27')]=function(_0x12d49a,_0x7eaec9){if(_0x12d49a[_0x6533('0x4b')]['id']){delete _0x12d49a[_0x6533('0x4b')]['id'];}return db[_0x6533('0x30')][_0x6533('0x49')]({'where':{'id':_0x12d49a[_0x6533('0x48')]['id']}})['then'](handleEntityNotFound(_0x7eaec9,null))[_0x6533('0x28')](saveUpdates(_0x12d49a[_0x6533('0x4b')],null))[_0x6533('0x28')](respondWithResult(_0x7eaec9,null))['catch'](handleError(_0x7eaec9,null));};exports[_0x6533('0x29')]=function(_0x19c869,_0x527266){return db[_0x6533('0x30')][_0x6533('0x49')]({'where':{'id':_0x19c869['params']['id']}})[_0x6533('0x28')](handleEntityNotFound(_0x527266,null))[_0x6533('0x28')](removeEntity(_0x527266,null))[_0x6533('0x47')](handleError(_0x527266,null));};exports[_0x6533('0x4c')]=function(_0x345055,_0x8d5784){return db['JscriptyQuestionReport']['describe']()[_0x6533('0x28')](respondWithResult(_0x8d5784,null))['catch'](handleError(_0x8d5784,null));}; \ No newline at end of file +var _0x9ae7=['../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','end','sendStatus','error','name','send','JscriptyQuestionReport','fieldName','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','show','rawAttributes','include','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5e343c,_0x5d5c6a){var _0x497243=function(_0x49bcda){while(--_0x49bcda){_0x5e343c['push'](_0x5e343c['shift']());}};_0x497243(++_0x5d5c6a);}(_0x9ae7,0x106));var _0x79ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ae7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x79ae('0x0'));var rimraf=require(_0x79ae('0x1'));var zipdir=require(_0x79ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x79ae('0x3'));var BPromise=require(_0x79ae('0x4'));var Mustache=require(_0x79ae('0x5'));var util=require(_0x79ae('0x6'));var path=require(_0x79ae('0x7'));var sox=require(_0x79ae('0x8'));var csv=require('to-csv');var ejs=require(_0x79ae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79ae('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x79ae('0xb'));var deskjs=require(_0x79ae('0xc'));var toCsv=require('to-csv');var querystring=require(_0x79ae('0xd'));var Papa=require(_0x79ae('0xe'));var Redis=require(_0x79ae('0xf'));var authService=require(_0x79ae('0x10'));var qs=require(_0x79ae('0x11'));var as=require(_0x79ae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x79ae('0x13'));var licenseUtil=require(_0x79ae('0x14'));var db=require(_0x79ae('0x15'))['db'];function respondWithStatusCode(_0x5c3b64,_0x2ccd71){_0x2ccd71=_0x2ccd71||0xcc;return function(_0xfbdf7e){if(_0xfbdf7e){return _0x5c3b64['sendStatus'](_0x2ccd71);}return _0x5c3b64['status'](_0x2ccd71)['end']();};}function respondWithResult(_0x3ed94c,_0x963d6e){_0x963d6e=_0x963d6e||0xc8;return function(_0x4bd8e5){if(_0x4bd8e5){return _0x3ed94c[_0x79ae('0x16')](_0x963d6e)[_0x79ae('0x17')](_0x4bd8e5);}};}function respondWithFilteredResult(_0x5aa118,_0x3d6250){return function(_0x352e6e){if(_0x352e6e){var _0x415280=typeof _0x3d6250[_0x79ae('0x18')]===_0x79ae('0x19')&&typeof _0x3d6250[_0x79ae('0x1a')]===_0x79ae('0x19');var _0x960eaa=_0x352e6e[_0x79ae('0x1b')];var _0x49637a=_0x415280?0x0:_0x3d6250[_0x79ae('0x18')];var _0x5c526c=_0x415280?_0x352e6e[_0x79ae('0x1b')]:_0x3d6250[_0x79ae('0x18')]+_0x3d6250['limit'];var _0x288af4;if(_0x5c526c>=_0x960eaa){_0x5c526c=_0x960eaa;_0x288af4=0xc8;}else{_0x288af4=0xce;}_0x5aa118[_0x79ae('0x16')](_0x288af4);return _0x5aa118[_0x79ae('0x1c')](_0x79ae('0x1d'),_0x49637a+'-'+_0x5c526c+'/'+_0x960eaa)['json'](_0x352e6e);}return null;};}function patchUpdates(_0xc15860){return function(_0x372df3){try{jsonpatch[_0x79ae('0x1e')](_0x372df3,_0xc15860,!![]);}catch(_0x258fc8){return BPromise[_0x79ae('0x1f')](_0x258fc8);}return _0x372df3[_0x79ae('0x20')]();};}function saveUpdates(_0x24dbd6,_0x1224f5){return function(_0x44b802){if(_0x44b802){return _0x44b802['update'](_0x24dbd6)['then'](function(_0x30edc7){return _0x30edc7;});}return null;};}function removeEntity(_0x387232,_0x2f1bd4){return function(_0x162503){if(_0x162503){return _0x162503['destroy']()['then'](function(){_0x387232[_0x79ae('0x16')](0xcc)[_0x79ae('0x21')]();});}};}function handleEntityNotFound(_0x2bf217,_0xd70713){return function(_0x55b51b){if(!_0x55b51b){_0x2bf217[_0x79ae('0x22')](0x194);}return _0x55b51b;};}function handleError(_0x345dfa,_0x418352){_0x418352=_0x418352||0x1f4;return function(_0x520b3f){logger[_0x79ae('0x23')](_0x520b3f['stack']);if(_0x520b3f[_0x79ae('0x24')]){delete _0x520b3f[_0x79ae('0x24')];}_0x345dfa['status'](_0x418352)[_0x79ae('0x25')](_0x520b3f);};}exports['index']=function(_0x106205,_0x36da09){var _0x1e93b6={},_0x49be9b={},_0x17da6f={'count':0x0,'rows':[]};var _0x2fdf35=_['map'](db[_0x79ae('0x26')]['rawAttributes'],function(_0x354785){return{'name':_0x354785[_0x79ae('0x27')],'type':_0x354785['type'][_0x79ae('0x28')]};});_0x49be9b['model']=_[_0x79ae('0x29')](_0x2fdf35,'name');_0x49be9b[_0x79ae('0x2a')]=_[_0x79ae('0x2b')](_0x106205[_0x79ae('0x2a')]);_0x49be9b[_0x79ae('0x2c')]=_[_0x79ae('0x2d')](_0x49be9b['model'],_0x49be9b['query']);_0x1e93b6[_0x79ae('0x2e')]=_[_0x79ae('0x2d')](_0x49be9b[_0x79ae('0x2f')],qs[_0x79ae('0x30')](_0x106205[_0x79ae('0x2a')][_0x79ae('0x30')]));_0x1e93b6[_0x79ae('0x2e')]=_0x1e93b6[_0x79ae('0x2e')][_0x79ae('0x31')]?_0x1e93b6['attributes']:_0x49be9b[_0x79ae('0x2f')];if(!_0x106205[_0x79ae('0x2a')][_0x79ae('0x32')]('nolimit')){_0x1e93b6[_0x79ae('0x1a')]=qs[_0x79ae('0x1a')](_0x106205[_0x79ae('0x2a')]['limit']);_0x1e93b6['offset']=qs['offset'](_0x106205[_0x79ae('0x2a')]['offset']);}_0x1e93b6['order']=qs['sort'](_0x106205[_0x79ae('0x2a')][_0x79ae('0x33')]);_0x1e93b6[_0x79ae('0x34')]=qs['filters'](_[_0x79ae('0x35')](_0x106205['query'],_0x49be9b['filters']),_0x2fdf35);if(_0x106205[_0x79ae('0x2a')][_0x79ae('0x36')]){_0x1e93b6[_0x79ae('0x34')]=_[_0x79ae('0x37')](_0x1e93b6[_0x79ae('0x34')],{'$or':_['map'](_0x2fdf35,function(_0x1eeb2b){if(_0x1eeb2b['type']!==_0x79ae('0x38')){var _0x2383a1={};_0x2383a1[_0x1eeb2b['name']]={'$like':'%'+_0x106205[_0x79ae('0x2a')]['filter']+'%'};return _0x2383a1;}})});}_0x1e93b6=_['merge']({},_0x1e93b6,_0x106205[_0x79ae('0x39')]);var _0x3aa4a8={'where':_0x1e93b6[_0x79ae('0x34')]};return db['JscriptyQuestionReport'][_0x79ae('0x1b')](_0x3aa4a8)[_0x79ae('0x3a')](function(_0x1cb1b6){_0x17da6f['count']=_0x1cb1b6;if(_0x106205['query'][_0x79ae('0x3b')]){_0x1e93b6['include']=[{'all':!![]}];}return db[_0x79ae('0x26')]['findAll'](_0x1e93b6);})[_0x79ae('0x3a')](function(_0x52c93a){_0x17da6f[_0x79ae('0x3c')]=_0x52c93a;return _0x17da6f;})[_0x79ae('0x3a')](respondWithFilteredResult(_0x36da09,_0x1e93b6))['catch'](handleError(_0x36da09,null));};exports[_0x79ae('0x3d')]=function(_0x3bbe6b,_0x455f75){var _0x177794={'raw':!![],'where':{'id':_0x3bbe6b['params']['id']}},_0x402a1e={};_0x402a1e[_0x79ae('0x2f')]=_['keys'](db['JscriptyQuestionReport'][_0x79ae('0x3e')]);_0x402a1e[_0x79ae('0x2a')]=_[_0x79ae('0x2b')](_0x3bbe6b[_0x79ae('0x2a')]);_0x402a1e[_0x79ae('0x2c')]=_[_0x79ae('0x2d')](_0x402a1e['model'],_0x402a1e[_0x79ae('0x2a')]);_0x177794[_0x79ae('0x2e')]=_['intersection'](_0x402a1e[_0x79ae('0x2f')],qs[_0x79ae('0x30')](_0x3bbe6b[_0x79ae('0x2a')]['fields']));_0x177794[_0x79ae('0x2e')]=_0x177794[_0x79ae('0x2e')]['length']?_0x177794[_0x79ae('0x2e')]:_0x402a1e['model'];if(_0x3bbe6b[_0x79ae('0x2a')][_0x79ae('0x3b')]){_0x177794[_0x79ae('0x3f')]=[{'all':!![]}];}_0x177794=_[_0x79ae('0x37')]({},_0x177794,_0x3bbe6b[_0x79ae('0x39')]);return db['JscriptyQuestionReport'][_0x79ae('0x40')](_0x177794)[_0x79ae('0x3a')](handleEntityNotFound(_0x455f75,null))[_0x79ae('0x3a')](respondWithResult(_0x455f75,null))['catch'](handleError(_0x455f75,null));};exports[_0x79ae('0x41')]=function(_0x34235f,_0x25fedf){return db['JscriptyQuestionReport']['create'](_0x34235f['body'],{})['then'](respondWithResult(_0x25fedf,0xc9))[_0x79ae('0x42')](handleError(_0x25fedf,null));};exports[_0x79ae('0x43')]=function(_0x384319,_0x198c46){if(_0x384319[_0x79ae('0x44')]['id']){delete _0x384319[_0x79ae('0x44')]['id'];}return db[_0x79ae('0x26')][_0x79ae('0x40')]({'where':{'id':_0x384319['params']['id']}})[_0x79ae('0x3a')](handleEntityNotFound(_0x198c46,null))[_0x79ae('0x3a')](saveUpdates(_0x384319[_0x79ae('0x44')],null))[_0x79ae('0x3a')](respondWithResult(_0x198c46,null))[_0x79ae('0x42')](handleError(_0x198c46,null));};exports['destroy']=function(_0x79eac3,_0x165864){return db['JscriptyQuestionReport'][_0x79ae('0x40')]({'where':{'id':_0x79eac3['params']['id']}})[_0x79ae('0x3a')](handleEntityNotFound(_0x165864,null))['then'](removeEntity(_0x165864,null))[_0x79ae('0x42')](handleError(_0x165864,null));};exports['describe']=function(_0x56eb7a,_0x4c1885){return db[_0x79ae('0x26')][_0x79ae('0x45')]()['then'](respondWithResult(_0x4c1885,null))[_0x79ae('0x42')](handleError(_0x4c1885,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index e6b2656..3b519b0 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 _0xa015=['request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','moment','bluebird'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xa015,0xa4));var _0x5a01=function(_0x273b49,_0x645b27){_0x273b49=_0x273b49-0x0;var _0x31b839=_0xa015[_0x273b49];return _0x31b839;};'use strict';var _=require(_0x5a01('0x0'));var util=require(_0x5a01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5a01('0x2'));var BPromise=require(_0x5a01('0x3'));var rp=require(_0x5a01('0x4'));var fs=require('fs');var path=require(_0x5a01('0x5'));var rimraf=require(_0x5a01('0x6'));var config=require(_0x5a01('0x7'));var attributes=require(_0x5a01('0x8'));module[_0x5a01('0x9')]=function(_0x36a8ef,_0x1d9cfd){return _0x36a8ef[_0x5a01('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x5a01('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa02f=['rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5eb685,_0x22a871){var _0x58de9a=function(_0x119a9b){while(--_0x119a9b){_0x5eb685['push'](_0x5eb685['shift']());}};_0x58de9a(++_0x22a871);}(_0xa02f,0x131));var _0xfa02=function(_0x2d4ebb,_0x507cf4){_0x2d4ebb=_0x2d4ebb-0x0;var _0x31f741=_0xa02f[_0x2d4ebb];return _0x31f741;};'use strict';var _=require(_0xfa02('0x0'));var util=require(_0xfa02('0x1'));var logger=require(_0xfa02('0x2'))(_0xfa02('0x3'));var moment=require(_0xfa02('0x4'));var BPromise=require(_0xfa02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa02('0x6'));var rimraf=require(_0xfa02('0x7'));var config=require('../../config/environment');var attributes=require(_0xfa02('0x8'));module[_0xfa02('0x9')]=function(_0xa5db51,_0x4dbdd1){return _0xa5db51[_0xfa02('0xa')](_0xfa02('0xb'),attributes,{'tableName':'report_jscripty_questions','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 485adb3..1b24ba5 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 _0xe4f7=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xaa49c2,_0x31a2bd){var _0x1a7d17=function(_0x407fbe){while(--_0x407fbe){_0xaa49c2['push'](_0xaa49c2['shift']());}};_0x1a7d17(++_0x31a2bd);}(_0xe4f7,0x97));var _0x7e4f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe4f7[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x7e4f('0x0'));var util=require(_0x7e4f('0x1'));var moment=require(_0x7e4f('0x2'));var BPromise=require(_0x7e4f('0x3'));var rs=require(_0x7e4f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e4f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e4f('0x6'));var client=jayson[_0x7e4f('0x7')][_0x7e4f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14c054,_0x4f65d3,_0x4a973f){return new BPromise(function(_0x46bece,_0x570066){return client[_0x7e4f('0x9')](_0x14c054,_0x4a973f)[_0x7e4f('0xa')](function(_0x11a5cc){logger[_0x7e4f('0xb')](_0x7e4f('0xc'),_0x4f65d3,_0x7e4f('0xd'));logger[_0x7e4f('0xe')](_0x7e4f('0xf'),_0x4f65d3,_0x7e4f('0xd'),JSON[_0x7e4f('0x10')](_0x11a5cc));if(_0x11a5cc[_0x7e4f('0x11')]){if(_0x11a5cc[_0x7e4f('0x11')][_0x7e4f('0x12')]===0x1f4){logger['error'](_0x7e4f('0xc'),_0x4f65d3,_0x11a5cc[_0x7e4f('0x11')]['message']);return _0x570066(_0x11a5cc[_0x7e4f('0x11')][_0x7e4f('0x13')]);}logger[_0x7e4f('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4f65d3,_0x11a5cc[_0x7e4f('0x11')][_0x7e4f('0x13')]);return _0x46bece(_0x11a5cc[_0x7e4f('0x11')]['message']);}else{logger[_0x7e4f('0xb')](_0x7e4f('0xc'),_0x4f65d3,_0x7e4f('0xd'));_0x46bece(_0x11a5cc['result'][_0x7e4f('0x13')]);}})[_0x7e4f('0x14')](function(_0x28d738){logger['error'](_0x7e4f('0xc'),_0x4f65d3,_0x28d738);_0x570066(_0x28d738);});});} \ No newline at end of file +var _0x9d39=['client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5dd26c,_0x4636f9){var _0x37457e=function(_0x28e497){while(--_0x28e497){_0x5dd26c['push'](_0x5dd26c['shift']());}};_0x37457e(++_0x4636f9);}(_0x9d39,0xf4));var _0x99d3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9d39[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x99d3('0x0'));var util=require('util');var moment=require(_0x99d3('0x1'));var BPromise=require(_0x99d3('0x2'));var rs=require(_0x99d3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99d3('0x4'))['db'];var utils=require(_0x99d3('0x5'));var logger=require(_0x99d3('0x6'))('rpc');var config=require(_0x99d3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x99d3('0x8')][_0x99d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3eb2f9,_0x4d5bb1,_0x550111){return new BPromise(function(_0x35a82b,_0x171ec6){return client[_0x99d3('0xa')](_0x3eb2f9,_0x550111)['then'](function(_0x26f54f){logger[_0x99d3('0xb')](_0x99d3('0xc'),_0x4d5bb1,_0x99d3('0xd'));logger[_0x99d3('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4d5bb1,_0x99d3('0xd'),JSON[_0x99d3('0xf')](_0x26f54f));if(_0x26f54f[_0x99d3('0x10')]){if(_0x26f54f[_0x99d3('0x10')][_0x99d3('0x11')]===0x1f4){logger[_0x99d3('0x10')](_0x99d3('0xc'),_0x4d5bb1,_0x26f54f[_0x99d3('0x10')][_0x99d3('0x12')]);return _0x171ec6(_0x26f54f[_0x99d3('0x10')][_0x99d3('0x12')]);}logger[_0x99d3('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d5bb1,_0x26f54f[_0x99d3('0x10')][_0x99d3('0x12')]);return _0x35a82b(_0x26f54f[_0x99d3('0x10')]['message']);}else{logger[_0x99d3('0xb')](_0x99d3('0xc'),_0x4d5bb1,_0x99d3('0xd'));_0x35a82b(_0x26f54f[_0x99d3('0x13')][_0x99d3('0x12')]);}})[_0x99d3('0x14')](function(_0xde34e7){logger[_0x99d3('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d5bb1,_0xde34e7);_0x171ec6(_0xde34e7);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 1126002..90e911b 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 _0x1583=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','getQuestions','post','put','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x1583,0xc9));var _0x3158=function(_0x2aa2fd,_0x50235b){_0x2aa2fd=_0x2aa2fd-0x0;var _0x1e74a3=_0x1583[_0x2aa2fd];return _0x1e74a3;};'use strict';var multer=require(_0x3158('0x0'));var util=require(_0x3158('0x1'));var path=require(_0x3158('0x2'));var timeout=require(_0x3158('0x3'));var express=require(_0x3158('0x4'));var router=express[_0x3158('0x5')]();var fs_extra=require(_0x3158('0x6'));var auth=require(_0x3158('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3158('0x8'));var controller=require(_0x3158('0x9'));router[_0x3158('0xa')]('/',auth[_0x3158('0xb')](),controller[_0x3158('0xc')]);router[_0x3158('0xa')](_0x3158('0xd'),auth[_0x3158('0xb')](),controller[_0x3158('0xe')]);router[_0x3158('0xa')]('/:id',auth[_0x3158('0xb')](),controller['show']);router[_0x3158('0xa')]('/:id/questions',auth[_0x3158('0xb')](),controller[_0x3158('0xf')]);router[_0x3158('0x10')]('/',auth[_0x3158('0xb')](),controller['create']);router[_0x3158('0x11')]('/:id',auth[_0x3158('0xb')](),controller[_0x3158('0x12')]);router['delete'](_0x3158('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x3158('0x14')]=router; \ No newline at end of file +var _0x508a=['/:id','show','getQuestions','put','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x508a,0x1e2));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa508('0x0'));var util=require('util');var path=require(_0xa508('0x1'));var timeout=require('connect-timeout');var express=require(_0xa508('0x2'));var router=express[_0xa508('0x3')]();var fs_extra=require(_0xa508('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa508('0x5'));var config=require(_0xa508('0x6'));var controller=require(_0xa508('0x7'));router[_0xa508('0x8')]('/',auth[_0xa508('0x9')](),controller['index']);router[_0xa508('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa508('0xa')]);router[_0xa508('0x8')](_0xa508('0xb'),auth[_0xa508('0x9')](),controller[_0xa508('0xc')]);router[_0xa508('0x8')]('/:id/questions',auth[_0xa508('0x9')](),controller[_0xa508('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa508('0xe')]('/:id',auth[_0xa508('0x9')](),controller['update']);router[_0xa508('0xf')](_0xa508('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa508('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 18e2e43..727255a 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 _0x9136=['sequelize','exports','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x33f1f1,_0x3f2a10){var _0x3052d4=function(_0x2d62ad){while(--_0x2d62ad){_0x33f1f1['push'](_0x33f1f1['shift']());}};_0x3052d4(++_0x3f2a10);}(_0x9136,0x138));var _0x6913=function(_0x522802,_0x174e2f){_0x522802=_0x522802-0x0;var _0x4e31c7=_0x9136[_0x522802];return _0x4e31c7;};'use strict';var moment=require('moment');var Sequelize=require(_0x6913('0x0'));module[_0x6913('0x1')]={'starttime':{'type':Sequelize[_0x6913('0x2')],'set':function(_0x381faa){this[_0x6913('0x3')]('starttime',_0x381faa);this[_0x6913('0x3')](_0x6913('0x4'),moment()['format'](_0x6913('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6913('0x6')]},'projectname':{'type':Sequelize[_0x6913('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6913('0x6')]},'calleridname':{'type':Sequelize[_0x6913('0x6')]},'calleridnum':{'type':Sequelize[_0x6913('0x6')]},'completed':{'type':Sequelize[_0x6913('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xf1e9=['format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','moment','sequelize','exports','setDataValue','endtime'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf1e9,0x1ea));var _0x9f1e=function(_0x3f0700,_0x19f3ad){_0x3f0700=_0x3f0700-0x0;var _0x1662a9=_0xf1e9[_0x3f0700];return _0x1662a9;};'use strict';var moment=require(_0x9f1e('0x0'));var Sequelize=require(_0x9f1e('0x1'));module[_0x9f1e('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x4ade5c){this[_0x9f1e('0x3')]('starttime',_0x4ade5c);this['setDataValue'](_0x9f1e('0x4'),moment()[_0x9f1e('0x5')](_0x9f1e('0x6')));}},'endtime':{'type':Sequelize[_0x9f1e('0x7')]},'membername':{'type':Sequelize[_0x9f1e('0x8')]},'projectname':{'type':Sequelize[_0x9f1e('0x8')]},'queue':{'type':Sequelize[_0x9f1e('0x8')]},'uniqueid':{'type':Sequelize[_0x9f1e('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9f1e('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 1042848..014631f 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 _0x39b2=['ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','intersection','include','create','update','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','order','pick','rows','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x4c4e97,_0x594020){var _0x53f7ef=function(_0x417320){while(--_0x417320){_0x4c4e97['push'](_0x4c4e97['shift']());}};_0x53f7ef(++_0x594020);}(_0x39b2,0xe3));var _0x239b=function(_0x23c7ef,_0x5d624b){_0x23c7ef=_0x23c7ef-0x0;var _0x14d98c=_0x39b2[_0x23c7ef];return _0x14d98c;};'use strict';var emlformat=require(_0x239b('0x0'));var rimraf=require(_0x239b('0x1'));var zipdir=require(_0x239b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x239b('0x3'));var moment=require(_0x239b('0x4'));var BPromise=require(_0x239b('0x5'));var Mustache=require(_0x239b('0x6'));var util=require(_0x239b('0x7'));var path=require('path');var sox=require(_0x239b('0x8'));var csv=require(_0x239b('0x9'));var ejs=require(_0x239b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x239b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x239b('0xc'));var deskjs=require(_0x239b('0xd'));var toCsv=require(_0x239b('0x9'));var querystring=require(_0x239b('0xe'));var Papa=require(_0x239b('0xf'));var Redis=require(_0x239b('0x10'));var authService=require(_0x239b('0x11'));var qs=require(_0x239b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x239b('0x13'));var logger=require(_0x239b('0x14'))(_0x239b('0x15'));var utils=require(_0x239b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x239b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3726ee,_0x1fdccb){_0x1fdccb=_0x1fdccb||0xcc;return function(_0x54cf06){if(_0x54cf06){return _0x3726ee[_0x239b('0x18')](_0x1fdccb);}return _0x3726ee[_0x239b('0x19')](_0x1fdccb)[_0x239b('0x1a')]();};}function respondWithResult(_0x13fbf3,_0x78de50){_0x78de50=_0x78de50||0xc8;return function(_0x552f01){if(_0x552f01){return _0x13fbf3[_0x239b('0x19')](_0x78de50)['json'](_0x552f01);}};}function respondWithFilteredResult(_0xc73439,_0x3dfb7d){return function(_0x290f37){if(_0x290f37){var _0x58ab5c=typeof _0x3dfb7d[_0x239b('0x1b')]===_0x239b('0x1c')&&typeof _0x3dfb7d[_0x239b('0x1d')]===_0x239b('0x1c');var _0x31f51b=_0x290f37[_0x239b('0x1e')];var _0x10e434=_0x58ab5c?0x0:_0x3dfb7d[_0x239b('0x1b')];var _0x87b077=_0x58ab5c?_0x290f37['count']:_0x3dfb7d['offset']+_0x3dfb7d[_0x239b('0x1d')];var _0x3e1140;if(_0x87b077>=_0x31f51b){_0x87b077=_0x31f51b;_0x3e1140=0xc8;}else{_0x3e1140=0xce;}_0xc73439['status'](_0x3e1140);return _0xc73439[_0x239b('0x1f')](_0x239b('0x20'),_0x10e434+'-'+_0x87b077+'/'+_0x31f51b)[_0x239b('0x21')](_0x290f37);}return null;};}function patchUpdates(_0xd785a8){return function(_0x5ec14f){try{jsonpatch[_0x239b('0x22')](_0x5ec14f,_0xd785a8,!![]);}catch(_0x2a72ca){return BPromise['reject'](_0x2a72ca);}return _0x5ec14f['save']();};}function saveUpdates(_0x309f96,_0x284e4d){return function(_0x1ace6c){if(_0x1ace6c){return _0x1ace6c['update'](_0x309f96)[_0x239b('0x23')](function(_0x240617){return _0x240617;});}return null;};}function removeEntity(_0x354599,_0x340bdf){return function(_0x29af30){if(_0x29af30){return _0x29af30['destroy']()[_0x239b('0x23')](function(){_0x354599[_0x239b('0x19')](0xcc)[_0x239b('0x1a')]();});}};}function handleEntityNotFound(_0x3e6754,_0xfa8783){return function(_0x5c1a5d){if(!_0x5c1a5d){_0x3e6754[_0x239b('0x18')](0x194);}return _0x5c1a5d;};}function handleError(_0x282d84,_0x5b435e){_0x5b435e=_0x5b435e||0x1f4;return function(_0x15236e){logger['error'](_0x15236e[_0x239b('0x24')]);if(_0x15236e[_0x239b('0x25')]){delete _0x15236e[_0x239b('0x25')];}_0x282d84[_0x239b('0x19')](_0x5b435e)[_0x239b('0x26')](_0x15236e);};}exports[_0x239b('0x27')]=function(_0x26c2c5,_0x837f5){var _0x4c9dd9={},_0x11580e={},_0x2b3f12={'count':0x0,'rows':[]};var _0x1eb8c6=_[_0x239b('0x28')](db[_0x239b('0x29')][_0x239b('0x2a')],function(_0x3591ab){return{'name':_0x3591ab[_0x239b('0x2b')],'type':_0x3591ab[_0x239b('0x2c')][_0x239b('0x2d')]};});_0x11580e[_0x239b('0x2e')]=_[_0x239b('0x28')](_0x1eb8c6,_0x239b('0x25'));_0x11580e[_0x239b('0x2f')]=_[_0x239b('0x30')](_0x26c2c5[_0x239b('0x2f')]);_0x11580e[_0x239b('0x31')]=_['intersection'](_0x11580e[_0x239b('0x2e')],_0x11580e['query']);_0x4c9dd9[_0x239b('0x32')]=_['intersection'](_0x11580e[_0x239b('0x2e')],qs[_0x239b('0x33')](_0x26c2c5[_0x239b('0x2f')][_0x239b('0x33')]));_0x4c9dd9['attributes']=_0x4c9dd9[_0x239b('0x32')][_0x239b('0x34')]?_0x4c9dd9[_0x239b('0x32')]:_0x11580e[_0x239b('0x2e')];if(!_0x26c2c5['query']['hasOwnProperty']('nolimit')){_0x4c9dd9[_0x239b('0x1d')]=qs['limit'](_0x26c2c5[_0x239b('0x2f')]['limit']);_0x4c9dd9[_0x239b('0x1b')]=qs[_0x239b('0x1b')](_0x26c2c5[_0x239b('0x2f')][_0x239b('0x1b')]);}_0x4c9dd9['order']=qs[_0x239b('0x35')](_0x26c2c5[_0x239b('0x2f')]['sort']);_0x4c9dd9['where']=qs[_0x239b('0x31')](_['pick'](_0x26c2c5[_0x239b('0x2f')],_0x11580e[_0x239b('0x31')]),_0x1eb8c6);if(_0x26c2c5[_0x239b('0x2f')][_0x239b('0x36')]){_0x4c9dd9[_0x239b('0x37')]=_[_0x239b('0x38')](_0x4c9dd9[_0x239b('0x37')],{'$or':_[_0x239b('0x28')](_0x1eb8c6,function(_0x50f640){if(_0x50f640[_0x239b('0x2c')]!==_0x239b('0x39')){var _0x1e84d4={};_0x1e84d4[_0x50f640[_0x239b('0x25')]]={'$like':'%'+_0x26c2c5[_0x239b('0x2f')]['filter']+'%'};return _0x1e84d4;}})});}_0x4c9dd9=_[_0x239b('0x38')]({},_0x4c9dd9,_0x26c2c5[_0x239b('0x3a')]);var _0x40fe8f={'where':_0x4c9dd9['where']};return db[_0x239b('0x29')][_0x239b('0x1e')](_0x40fe8f)['then'](function(_0x4614b6){_0x2b3f12[_0x239b('0x1e')]=_0x4614b6;if(_0x26c2c5['query'][_0x239b('0x3b')]){_0x4c9dd9['include']=[{'all':!![]}];}return db[_0x239b('0x29')][_0x239b('0x3c')](_0x4c9dd9);})['then'](function(_0xbb0c5){_0x2b3f12['rows']=_0xbb0c5;return _0x2b3f12;})['then'](respondWithFilteredResult(_0x837f5,_0x4c9dd9))[_0x239b('0x3d')](handleError(_0x837f5,null));};exports[_0x239b('0x3e')]=function(_0x505045,_0x49acbe){var _0x7b0ab6={'raw':!![],'where':{'id':_0x505045[_0x239b('0x3f')]['id']}},_0x403997={};_0x403997[_0x239b('0x2e')]=_[_0x239b('0x30')](db['JscriptySessionReport']['rawAttributes']);_0x403997[_0x239b('0x2f')]=_['keys'](_0x505045[_0x239b('0x2f')]);_0x403997[_0x239b('0x31')]=_[_0x239b('0x40')](_0x403997[_0x239b('0x2e')],_0x403997[_0x239b('0x2f')]);_0x7b0ab6[_0x239b('0x32')]=_[_0x239b('0x40')](_0x403997[_0x239b('0x2e')],qs[_0x239b('0x33')](_0x505045[_0x239b('0x2f')][_0x239b('0x33')]));_0x7b0ab6[_0x239b('0x32')]=_0x7b0ab6[_0x239b('0x32')][_0x239b('0x34')]?_0x7b0ab6['attributes']:_0x403997['model'];if(_0x505045[_0x239b('0x2f')]['includeAll']){_0x7b0ab6[_0x239b('0x41')]=[{'all':!![]}];}_0x7b0ab6=_['merge']({},_0x7b0ab6,_0x505045[_0x239b('0x3a')]);return db['JscriptySessionReport']['find'](_0x7b0ab6)['then'](handleEntityNotFound(_0x49acbe,null))[_0x239b('0x23')](respondWithResult(_0x49acbe,null))['catch'](handleError(_0x49acbe,null));};exports[_0x239b('0x42')]=function(_0x489f7d,_0x1f9f7b){return db[_0x239b('0x29')][_0x239b('0x42')](_0x489f7d['body'],{})['then'](respondWithResult(_0x1f9f7b,0xc9))[_0x239b('0x3d')](handleError(_0x1f9f7b,null));};exports[_0x239b('0x43')]=function(_0x54c81c,_0x880721){if(_0x54c81c['body']['id']){delete _0x54c81c[_0x239b('0x44')]['id'];}return db[_0x239b('0x29')][_0x239b('0x45')]({'where':{'id':_0x54c81c[_0x239b('0x3f')]['id']}})[_0x239b('0x23')](handleEntityNotFound(_0x880721,null))['then'](saveUpdates(_0x54c81c['body'],null))['then'](respondWithResult(_0x880721,null))[_0x239b('0x3d')](handleError(_0x880721,null));};exports[_0x239b('0x46')]=function(_0x35a284,_0x68cac3){return db['JscriptySessionReport'][_0x239b('0x45')]({'where':{'id':_0x35a284[_0x239b('0x3f')]['id']}})[_0x239b('0x23')](handleEntityNotFound(_0x68cac3,null))[_0x239b('0x23')](removeEntity(_0x68cac3,null))[_0x239b('0x3d')](handleError(_0x68cac3,null));};exports[_0x239b('0x47')]=function(_0x35e5ac,_0x39d2ef){return db[_0x239b('0x29')][_0x239b('0x47')]()[_0x239b('0x23')](respondWithResult(_0x39d2ef,null))['catch'](handleError(_0x39d2ef,null));};exports[_0x239b('0x48')]=function(_0x1dc900,_0x370f36,_0x105b70){var _0x27148e={'raw':!![],'where':{}};var _0x510394={};var _0x40f42c={'count':0x0,'rows':[]};return db[_0x239b('0x29')][_0x239b('0x49')]({'where':{'id':_0x1dc900[_0x239b('0x3f')]['id']}})[_0x239b('0x23')](handleEntityNotFound(_0x370f36,null))[_0x239b('0x23')](function(_0x562149){if(_0x562149){_0x510394[_0x239b('0x2e')]=_[_0x239b('0x30')](db[_0x239b('0x4a')][_0x239b('0x2a')]);_0x510394[_0x239b('0x2f')]=_['keys'](_0x1dc900[_0x239b('0x2f')]);_0x510394[_0x239b('0x31')]=_[_0x239b('0x40')](_0x510394[_0x239b('0x2e')],_0x510394[_0x239b('0x2f')]);_0x27148e['attributes']=_[_0x239b('0x40')](_0x510394[_0x239b('0x2e')],qs[_0x239b('0x33')](_0x1dc900[_0x239b('0x2f')][_0x239b('0x33')]));_0x27148e[_0x239b('0x32')]=_0x27148e[_0x239b('0x32')][_0x239b('0x34')]?_0x27148e[_0x239b('0x32')]:_0x510394['model'];if(!_0x1dc900[_0x239b('0x2f')]['hasOwnProperty'](_0x239b('0x4b'))){_0x27148e[_0x239b('0x1d')]=qs[_0x239b('0x1d')](_0x1dc900[_0x239b('0x2f')][_0x239b('0x1d')]);_0x27148e['offset']=qs[_0x239b('0x1b')](_0x1dc900[_0x239b('0x2f')][_0x239b('0x1b')]);}_0x27148e[_0x239b('0x4c')]=qs[_0x239b('0x35')](_0x1dc900[_0x239b('0x2f')][_0x239b('0x35')]);_0x27148e['where']=qs[_0x239b('0x31')](_[_0x239b('0x4d')](_0x1dc900[_0x239b('0x2f')],_0x510394['filters']));_0x27148e[_0x239b('0x37')]['SessionId']=_0x562149['id'];if(_0x1dc900[_0x239b('0x2f')][_0x239b('0x36')]){_0x27148e['where']=_[_0x239b('0x38')](_0x27148e[_0x239b('0x37')],{'$or':_[_0x239b('0x28')](_0x27148e[_0x239b('0x32')],function(_0x57af49){var _0x42b4a4={};_0x42b4a4[_0x57af49]={'$like':'%'+_0x1dc900[_0x239b('0x2f')]['filter']+'%'};return _0x42b4a4;})});}_0x27148e=_[_0x239b('0x38')]({},_0x27148e,_0x1dc900[_0x239b('0x3a')]);return db[_0x239b('0x4a')][_0x239b('0x1e')]({'where':_0x27148e[_0x239b('0x37')]})[_0x239b('0x23')](function(_0x7f3561){_0x40f42c[_0x239b('0x1e')]=_0x7f3561;if(_0x1dc900[_0x239b('0x2f')][_0x239b('0x3b')]){_0x27148e[_0x239b('0x41')]=[{'all':!![]}];}return db[_0x239b('0x4a')]['findAll'](_0x27148e);})[_0x239b('0x23')](function(_0x5d34d0){_0x40f42c[_0x239b('0x4e')]=_0x5d34d0;return _0x40f42c;});}})[_0x239b('0x23')](respondWithFilteredResult(_0x370f36,_0x27148e))['catch'](handleError(_0x370f36,null));}; \ No newline at end of file +var _0x8323=['fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','create','catch','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x8323,0x14d));var _0x3832=function(_0x18b60f,_0x331115){_0x18b60f=_0x18b60f-0x0;var _0x4bc451=_0x8323[_0x18b60f];return _0x4bc451;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3832('0x0'));var zipdir=require(_0x3832('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3832('0x2'));var moment=require(_0x3832('0x3'));var BPromise=require(_0x3832('0x4'));var Mustache=require('mustache');var util=require(_0x3832('0x5'));var path=require(_0x3832('0x6'));var sox=require(_0x3832('0x7'));var csv=require(_0x3832('0x8'));var ejs=require(_0x3832('0x9'));var fs=require('fs');var fs_extra=require(_0x3832('0xa'));var _=require(_0x3832('0xb'));var squel=require(_0x3832('0xc'));var crypto=require(_0x3832('0xd'));var jsforce=require(_0x3832('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3832('0x8'));var querystring=require('querystring');var Papa=require(_0x3832('0xf'));var Redis=require(_0x3832('0x10'));var authService=require(_0x3832('0x11'));var qs=require(_0x3832('0x12'));var as=require(_0x3832('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3832('0x14'));var utils=require('../../config/utils');var config=require(_0x3832('0x15'));var licenseUtil=require(_0x3832('0x16'));var db=require(_0x3832('0x17'))['db'];function respondWithStatusCode(_0x197319,_0x30e0fb){_0x30e0fb=_0x30e0fb||0xcc;return function(_0x180d5d){if(_0x180d5d){return _0x197319['sendStatus'](_0x30e0fb);}return _0x197319['status'](_0x30e0fb)[_0x3832('0x18')]();};}function respondWithResult(_0x1bfc1b,_0x537160){_0x537160=_0x537160||0xc8;return function(_0x14f1a5){if(_0x14f1a5){return _0x1bfc1b[_0x3832('0x19')](_0x537160)['json'](_0x14f1a5);}};}function respondWithFilteredResult(_0x21756d,_0x39fe9f){return function(_0x3b4aba){if(_0x3b4aba){var _0x28e4c7=typeof _0x39fe9f['offset']===_0x3832('0x1a')&&typeof _0x39fe9f[_0x3832('0x1b')]===_0x3832('0x1a');var _0x2a2640=_0x3b4aba[_0x3832('0x1c')];var _0x12436a=_0x28e4c7?0x0:_0x39fe9f['offset'];var _0x1d0836=_0x28e4c7?_0x3b4aba[_0x3832('0x1c')]:_0x39fe9f[_0x3832('0x1d')]+_0x39fe9f[_0x3832('0x1b')];var _0x1eca96;if(_0x1d0836>=_0x2a2640){_0x1d0836=_0x2a2640;_0x1eca96=0xc8;}else{_0x1eca96=0xce;}_0x21756d[_0x3832('0x19')](_0x1eca96);return _0x21756d[_0x3832('0x1e')](_0x3832('0x1f'),_0x12436a+'-'+_0x1d0836+'/'+_0x2a2640)['json'](_0x3b4aba);}return null;};}function patchUpdates(_0x682f54){return function(_0x23083a){try{jsonpatch[_0x3832('0x20')](_0x23083a,_0x682f54,!![]);}catch(_0x509dc3){return BPromise[_0x3832('0x21')](_0x509dc3);}return _0x23083a[_0x3832('0x22')]();};}function saveUpdates(_0x3ea47e,_0x146c5d){return function(_0x2624f5){if(_0x2624f5){return _0x2624f5['update'](_0x3ea47e)[_0x3832('0x23')](function(_0x41eacc){return _0x41eacc;});}return null;};}function removeEntity(_0x3acf88,_0x54a22f){return function(_0x46a9ed){if(_0x46a9ed){return _0x46a9ed[_0x3832('0x24')]()[_0x3832('0x23')](function(){_0x3acf88[_0x3832('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3933a9,_0x4ad19e){return function(_0x80f1d1){if(!_0x80f1d1){_0x3933a9[_0x3832('0x25')](0x194);}return _0x80f1d1;};}function handleError(_0x56c4db,_0x3e16de){_0x3e16de=_0x3e16de||0x1f4;return function(_0x17a3a6){logger[_0x3832('0x26')](_0x17a3a6[_0x3832('0x27')]);if(_0x17a3a6[_0x3832('0x28')]){delete _0x17a3a6[_0x3832('0x28')];}_0x56c4db[_0x3832('0x19')](_0x3e16de)['send'](_0x17a3a6);};}exports['index']=function(_0x400d99,_0xedec1c){var _0x37873c={},_0x3399f9={},_0x462454={'count':0x0,'rows':[]};var _0x5d03ab=_[_0x3832('0x29')](db[_0x3832('0x2a')][_0x3832('0x2b')],function(_0x41ebb5){return{'name':_0x41ebb5[_0x3832('0x2c')],'type':_0x41ebb5[_0x3832('0x2d')][_0x3832('0x2e')]};});_0x3399f9['model']=_[_0x3832('0x29')](_0x5d03ab,'name');_0x3399f9[_0x3832('0x2f')]=_[_0x3832('0x30')](_0x400d99[_0x3832('0x2f')]);_0x3399f9['filters']=_[_0x3832('0x31')](_0x3399f9['model'],_0x3399f9['query']);_0x37873c[_0x3832('0x32')]=_[_0x3832('0x31')](_0x3399f9[_0x3832('0x33')],qs[_0x3832('0x34')](_0x400d99['query'][_0x3832('0x34')]));_0x37873c[_0x3832('0x32')]=_0x37873c[_0x3832('0x32')][_0x3832('0x35')]?_0x37873c[_0x3832('0x32')]:_0x3399f9[_0x3832('0x33')];if(!_0x400d99[_0x3832('0x2f')][_0x3832('0x36')]('nolimit')){_0x37873c['limit']=qs['limit'](_0x400d99[_0x3832('0x2f')]['limit']);_0x37873c[_0x3832('0x1d')]=qs[_0x3832('0x1d')](_0x400d99[_0x3832('0x2f')]['offset']);}_0x37873c[_0x3832('0x37')]=qs[_0x3832('0x38')](_0x400d99['query'][_0x3832('0x38')]);_0x37873c[_0x3832('0x39')]=qs['filters'](_[_0x3832('0x3a')](_0x400d99[_0x3832('0x2f')],_0x3399f9[_0x3832('0x3b')]),_0x5d03ab);if(_0x400d99[_0x3832('0x2f')]['filter']){_0x37873c[_0x3832('0x39')]=_[_0x3832('0x3c')](_0x37873c[_0x3832('0x39')],{'$or':_[_0x3832('0x29')](_0x5d03ab,function(_0x29cb5d){if(_0x29cb5d[_0x3832('0x2d')]!==_0x3832('0x3d')){var _0x512086={};_0x512086[_0x29cb5d[_0x3832('0x28')]]={'$like':'%'+_0x400d99[_0x3832('0x2f')][_0x3832('0x3e')]+'%'};return _0x512086;}})});}_0x37873c=_[_0x3832('0x3c')]({},_0x37873c,_0x400d99[_0x3832('0x3f')]);var _0x3974b8={'where':_0x37873c[_0x3832('0x39')]};return db[_0x3832('0x2a')][_0x3832('0x1c')](_0x3974b8)[_0x3832('0x23')](function(_0x15aea9){_0x462454[_0x3832('0x1c')]=_0x15aea9;if(_0x400d99['query'][_0x3832('0x40')]){_0x37873c[_0x3832('0x41')]=[{'all':!![]}];}return db[_0x3832('0x2a')][_0x3832('0x42')](_0x37873c);})[_0x3832('0x23')](function(_0x536f8f){_0x462454['rows']=_0x536f8f;return _0x462454;})[_0x3832('0x23')](respondWithFilteredResult(_0xedec1c,_0x37873c))['catch'](handleError(_0xedec1c,null));};exports[_0x3832('0x43')]=function(_0x55d988,_0x352171){var _0x3a39a1={'raw':!![],'where':{'id':_0x55d988[_0x3832('0x44')]['id']}},_0x1b3a90={};_0x1b3a90[_0x3832('0x33')]=_[_0x3832('0x30')](db['JscriptySessionReport'][_0x3832('0x2b')]);_0x1b3a90[_0x3832('0x2f')]=_[_0x3832('0x30')](_0x55d988['query']);_0x1b3a90[_0x3832('0x3b')]=_['intersection'](_0x1b3a90[_0x3832('0x33')],_0x1b3a90['query']);_0x3a39a1[_0x3832('0x32')]=_[_0x3832('0x31')](_0x1b3a90['model'],qs[_0x3832('0x34')](_0x55d988[_0x3832('0x2f')][_0x3832('0x34')]));_0x3a39a1['attributes']=_0x3a39a1[_0x3832('0x32')][_0x3832('0x35')]?_0x3a39a1['attributes']:_0x1b3a90[_0x3832('0x33')];if(_0x55d988[_0x3832('0x2f')][_0x3832('0x40')]){_0x3a39a1['include']=[{'all':!![]}];}_0x3a39a1=_[_0x3832('0x3c')]({},_0x3a39a1,_0x55d988[_0x3832('0x3f')]);return db[_0x3832('0x2a')]['find'](_0x3a39a1)[_0x3832('0x23')](handleEntityNotFound(_0x352171,null))[_0x3832('0x23')](respondWithResult(_0x352171,null))['catch'](handleError(_0x352171,null));};exports[_0x3832('0x45')]=function(_0x4197ff,_0x5be694){return db[_0x3832('0x2a')]['create'](_0x4197ff['body'],{})[_0x3832('0x23')](respondWithResult(_0x5be694,0xc9))[_0x3832('0x46')](handleError(_0x5be694,null));};exports['update']=function(_0x2fe612,_0x51ea7f){if(_0x2fe612[_0x3832('0x47')]['id']){delete _0x2fe612[_0x3832('0x47')]['id'];}return db[_0x3832('0x2a')][_0x3832('0x48')]({'where':{'id':_0x2fe612['params']['id']}})[_0x3832('0x23')](handleEntityNotFound(_0x51ea7f,null))[_0x3832('0x23')](saveUpdates(_0x2fe612[_0x3832('0x47')],null))[_0x3832('0x23')](respondWithResult(_0x51ea7f,null))[_0x3832('0x46')](handleError(_0x51ea7f,null));};exports[_0x3832('0x24')]=function(_0x382e82,_0x6bb79f){return db[_0x3832('0x2a')]['find']({'where':{'id':_0x382e82[_0x3832('0x44')]['id']}})[_0x3832('0x23')](handleEntityNotFound(_0x6bb79f,null))[_0x3832('0x23')](removeEntity(_0x6bb79f,null))[_0x3832('0x46')](handleError(_0x6bb79f,null));};exports['describe']=function(_0x60f980,_0x55622c){return db[_0x3832('0x2a')][_0x3832('0x49')]()['then'](respondWithResult(_0x55622c,null))['catch'](handleError(_0x55622c,null));};exports[_0x3832('0x4a')]=function(_0x14049a,_0x47745f,_0x424ccb){var _0x432d23={'raw':!![],'where':{}};var _0x34b0a9={};var _0x51011a={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x3832('0x4b')]({'where':{'id':_0x14049a['params']['id']}})[_0x3832('0x23')](handleEntityNotFound(_0x47745f,null))[_0x3832('0x23')](function(_0x3185da){if(_0x3185da){_0x34b0a9[_0x3832('0x33')]=_[_0x3832('0x30')](db[_0x3832('0x4c')][_0x3832('0x2b')]);_0x34b0a9[_0x3832('0x2f')]=_[_0x3832('0x30')](_0x14049a[_0x3832('0x2f')]);_0x34b0a9['filters']=_[_0x3832('0x31')](_0x34b0a9[_0x3832('0x33')],_0x34b0a9[_0x3832('0x2f')]);_0x432d23[_0x3832('0x32')]=_[_0x3832('0x31')](_0x34b0a9[_0x3832('0x33')],qs[_0x3832('0x34')](_0x14049a[_0x3832('0x2f')]['fields']));_0x432d23[_0x3832('0x32')]=_0x432d23[_0x3832('0x32')]['length']?_0x432d23[_0x3832('0x32')]:_0x34b0a9[_0x3832('0x33')];if(!_0x14049a[_0x3832('0x2f')][_0x3832('0x36')]('nolimit')){_0x432d23['limit']=qs[_0x3832('0x1b')](_0x14049a['query'][_0x3832('0x1b')]);_0x432d23[_0x3832('0x1d')]=qs[_0x3832('0x1d')](_0x14049a['query']['offset']);}_0x432d23[_0x3832('0x37')]=qs[_0x3832('0x38')](_0x14049a[_0x3832('0x2f')][_0x3832('0x38')]);_0x432d23[_0x3832('0x39')]=qs[_0x3832('0x3b')](_[_0x3832('0x3a')](_0x14049a[_0x3832('0x2f')],_0x34b0a9[_0x3832('0x3b')]));_0x432d23[_0x3832('0x39')]['SessionId']=_0x3185da['id'];if(_0x14049a[_0x3832('0x2f')]['filter']){_0x432d23[_0x3832('0x39')]=_[_0x3832('0x3c')](_0x432d23[_0x3832('0x39')],{'$or':_[_0x3832('0x29')](_0x432d23[_0x3832('0x32')],function(_0x3a4db8){var _0x3880a2={};_0x3880a2[_0x3a4db8]={'$like':'%'+_0x14049a[_0x3832('0x2f')][_0x3832('0x3e')]+'%'};return _0x3880a2;})});}_0x432d23=_[_0x3832('0x3c')]({},_0x432d23,_0x14049a[_0x3832('0x3f')]);return db['JscriptyQuestionReport'][_0x3832('0x1c')]({'where':_0x432d23[_0x3832('0x39')]})[_0x3832('0x23')](function(_0x1c4696){_0x51011a['count']=_0x1c4696;if(_0x14049a[_0x3832('0x2f')]['includeAll']){_0x432d23['include']=[{'all':!![]}];}return db[_0x3832('0x4c')][_0x3832('0x42')](_0x432d23);})[_0x3832('0x23')](function(_0x1f5404){_0x51011a['rows']=_0x1f5404;return _0x51011a;});}})[_0x3832('0x23')](respondWithFilteredResult(_0x47745f,_0x432d23))['catch'](handleError(_0x47745f,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index da82656..f916bfc 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 _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x2e078f,_0x22ff51){var _0x23cce3=function(_0x3ebe0f){while(--_0x3ebe0f){_0x2e078f['push'](_0x2e078f['shift']());}};_0x23cce3(++_0x22ff51);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x47aeb5,_0x1a4b86){_0x47aeb5=_0x47aeb5-0x0;var _0x46dda0=_0xbd51[_0x47aeb5];return _0x46dda0;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','api','moment','bluebird','path'];(function(_0x5ce419,_0xf05351){var _0x186689=function(_0x3a5cb9){while(--_0x3a5cb9){_0x5ce419['push'](_0x5ce419['shift']());}};_0x186689(++_0xf05351);}(_0xeff8,0x186));var _0x8eff=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0xeff8[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index afeb4d7..c28eb7d 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 _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0x430c,0x1a1));var _0xc430=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x430c[_0x541260];return _0x1dd2b5;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file +var _0x5464=['info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x435c1d,_0x4dcf72){var _0x4b17ee=function(_0x569715){while(--_0x569715){_0x435c1d['push'](_0x435c1d['shift']());}};_0x4b17ee(++_0x4dcf72);}(_0x5464,0x15d));var _0x4546=function(_0x25b324,_0x26dc30){_0x25b324=_0x25b324-0x0;var _0x4cfad6=_0x5464[_0x25b324];return _0x4cfad6;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5e09,_0x224c7c,_0x36c875){return new BPromise(function(_0x1a76c1,_0x2e860a){return client[_0x4546('0x9')](_0x5c5e09,_0x36c875)[_0x4546('0xa')](function(_0x11d63e){logger[_0x4546('0xb')](_0x4546('0xc'),_0x224c7c,'request\x20sent');logger[_0x4546('0xd')](_0x4546('0xe'),_0x224c7c,_0x4546('0xf'),JSON['stringify'](_0x11d63e));if(_0x11d63e[_0x4546('0x10')]){if(_0x11d63e[_0x4546('0x10')][_0x4546('0x11')]===0x1f4){logger[_0x4546('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error'][_0x4546('0x12')]);return _0x2e860a(_0x11d63e['error']['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x11d63e['error']['message']);return _0x1a76c1(_0x11d63e[_0x4546('0x10')]['message']);}else{logger[_0x4546('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x224c7c,_0x4546('0xf'));_0x1a76c1(_0x11d63e['result'][_0x4546('0x12')]);}})[_0x4546('0x13')](function(_0x24b32a){logger[_0x4546('0x10')](_0x4546('0xc'),_0x224c7c,_0x24b32a);_0x2e860a(_0x24b32a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index a880d73..9135e2a 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 _0x5e63=['isAuthenticated','get','downloadLogFile','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put'];(function(_0x5bcd7d,_0x3de531){var _0x6d0a15=function(_0x48cfff){while(--_0x48cfff){_0x5bcd7d['push'](_0x5bcd7d['shift']());}};_0x6d0a15(++_0x3de531);}(_0x5e63,0x17a));var _0x35e6=function(_0x3ba336,_0x53f49f){_0x3ba336=_0x3ba336-0x0;var _0x27d765=_0x5e63[_0x3ba336];return _0x27d765;};'use strict';var multer=require(_0x35e6('0x0'));var util=require(_0x35e6('0x1'));var path=require(_0x35e6('0x2'));var timeout=require(_0x35e6('0x3'));var express=require(_0x35e6('0x4'));var router=express[_0x35e6('0x5')]();var fs_extra=require(_0x35e6('0x6'));var auth=require(_0x35e6('0x7'));var interaction=require(_0x35e6('0x8'));var config=require(_0x35e6('0x9'));var controller=require('./license.controller');router['get']('/',controller[_0x35e6('0xa')]);router[_0x35e6('0xb')]('/:id',auth[_0x35e6('0xc')](),controller['update']);router[_0x35e6('0xd')]('/download_log_file',auth[_0x35e6('0xc')](),controller[_0x35e6('0xe')]);module['exports']=router; \ No newline at end of file +var _0x94af=['./license.controller','index','put','/:id','isAuthenticated','get','/download_log_file','downloadLogFile','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x313532,_0x33e75f){var _0x44bc16=function(_0x31ab32){while(--_0x31ab32){_0x313532['push'](_0x313532['shift']());}};_0x44bc16(++_0x33e75f);}(_0x94af,0x18f));var _0xf94a=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x94af[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0xf94a('0x0'));var util=require('util');var path=require(_0xf94a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf94a('0x2'));var router=express['Router']();var fs_extra=require(_0xf94a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf94a('0x4'));var config=require(_0xf94a('0x5'));var controller=require(_0xf94a('0x6'));router['get']('/',controller[_0xf94a('0x7')]);router[_0xf94a('0x8')](_0xf94a('0x9'),auth[_0xf94a('0xa')](),controller['update']);router[_0xf94a('0xb')](_0xf94a('0xc'),auth[_0xf94a('0xa')](),controller[_0xf94a('0xd')]);module[_0xf94a('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 96677cc..51b4b31 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 _0x2700=['STRING','sequelize','exports','TEXT'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x2700,0x19d));var _0x0270=function(_0xdc94fa,_0x4ed3ad){_0xdc94fa=_0xdc94fa-0x0;var _0x129090=_0x2700[_0xdc94fa];return _0x129090;};'use strict';var Sequelize=require(_0x0270('0x0'));module[_0x0270('0x1')]={'license':{'type':Sequelize[_0x0270('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0270('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc729=['STRING','sequelize','TEXT'];(function(_0x2a30dd,_0x2b6429){var _0xa5b379=function(_0x48e1f0){while(--_0x48e1f0){_0x2a30dd['push'](_0x2a30dd['shift']());}};_0xa5b379(++_0x2b6429);}(_0xc729,0x142));var _0x9c72=function(_0x22a8ff,_0x3cfd02){_0x22a8ff=_0x22a8ff-0x0;var _0x35b165=_0xc729[_0x22a8ff];return _0x35b165;};'use strict';var Sequelize=require(_0x9c72('0x0'));module['exports']={'license':{'type':Sequelize[_0x9c72('0x1')]},'data1':{'type':Sequelize[_0x9c72('0x2')]},'data2':{'type':Sequelize[_0x9c72('0x2')]},'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 25f3d19..c2a9046 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 _0xfc54=['params','get','checkLicense','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','zip-dir','fast-json-patch','moment','mustache','path','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','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','length','merge','options','getLicense','catch','body','find'];(function(_0x554ce5,_0x7e9a8a){var _0x3ec7b4=function(_0x4629e8){while(--_0x4629e8){_0x554ce5['push'](_0x554ce5['shift']());}};_0x3ec7b4(++_0x7e9a8a);}(_0xfc54,0x1a6));var _0x4fc5=function(_0x4b2ed7,_0x5b3100){_0x4b2ed7=_0x4b2ed7-0x0;var _0x55a953=_0xfc54[_0x4b2ed7];return _0x55a953;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4fc5('0x0'));var jsonpatch=require(_0x4fc5('0x1'));var rp=require('request-promise');var moment=require(_0x4fc5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4fc5('0x3'));var util=require('util');var path=require(_0x4fc5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4fc5('0x5'));var deskjs=require(_0x4fc5('0x6'));var toCsv=require(_0x4fc5('0x7'));var querystring=require(_0x4fc5('0x8'));var Papa=require(_0x4fc5('0x9'));var Redis=require(_0x4fc5('0xa'));var authService=require(_0x4fc5('0xb'));var qs=require(_0x4fc5('0xc'));var as=require(_0x4fc5('0xd'));var hardwareService=require(_0x4fc5('0xe'));var logger=require(_0x4fc5('0xf'))(_0x4fc5('0x10'));var utils=require(_0x4fc5('0x11'));var config=require(_0x4fc5('0x12'));var licenseUtil=require(_0x4fc5('0x13'));var db=require(_0x4fc5('0x14'))['db'];function respondWithStatusCode(_0xad5caa,_0x44d730){_0x44d730=_0x44d730||0xcc;return function(_0x55b61b){if(_0x55b61b){return _0xad5caa['sendStatus'](_0x44d730);}return _0xad5caa[_0x4fc5('0x15')](_0x44d730)[_0x4fc5('0x16')]();};}function respondWithResult(_0x10a7f8,_0x1ac4b7){_0x1ac4b7=_0x1ac4b7||0xc8;return function(_0x1c7311){if(_0x1c7311){return _0x10a7f8['status'](_0x1ac4b7)['json'](_0x1c7311);}};}function respondWithFilteredResult(_0x471a8d,_0x1261b5){return function(_0x545787){if(_0x545787){var _0x1698ae=typeof _0x1261b5[_0x4fc5('0x17')]===_0x4fc5('0x18')&&typeof _0x1261b5[_0x4fc5('0x19')]===_0x4fc5('0x18');var _0x5c09e9=_0x545787[_0x4fc5('0x1a')];var _0xe3b8c6=_0x1698ae?0x0:_0x1261b5['offset'];var _0x2b1ad8=_0x1698ae?_0x545787[_0x4fc5('0x1a')]:_0x1261b5[_0x4fc5('0x17')]+_0x1261b5['limit'];var _0x48013;if(_0x2b1ad8>=_0x5c09e9){_0x2b1ad8=_0x5c09e9;_0x48013=0xc8;}else{_0x48013=0xce;}_0x471a8d[_0x4fc5('0x15')](_0x48013);return _0x471a8d[_0x4fc5('0x1b')](_0x4fc5('0x1c'),_0xe3b8c6+'-'+_0x2b1ad8+'/'+_0x5c09e9)[_0x4fc5('0x1d')](_0x545787);}return null;};}function patchUpdates(_0x1a246d){return function(_0xd7dce4){try{jsonpatch['apply'](_0xd7dce4,_0x1a246d,!![]);}catch(_0x88fba2){return BPromise['reject'](_0x88fba2);}return _0xd7dce4[_0x4fc5('0x1e')]();};}function saveUpdates(_0x5dc6e2,_0x2c739e){return function(_0x2d370d){if(_0x2d370d){return _0x2d370d['update'](_0x5dc6e2)[_0x4fc5('0x1f')](function(_0x5410ad){return _0x5410ad;});}return null;};}function removeEntity(_0x5e12cb,_0x10210c){return function(_0x2d6079){if(_0x2d6079){return _0x2d6079[_0x4fc5('0x20')]()[_0x4fc5('0x1f')](function(){_0x5e12cb[_0x4fc5('0x15')](0xcc)[_0x4fc5('0x16')]();});}};}function handleEntityNotFound(_0x75eb1d,_0x2bfa9c){return function(_0x287494){if(!_0x287494){_0x75eb1d[_0x4fc5('0x21')](0x194);}return _0x287494;};}function handleError(_0x45eceb,_0x59c5a4){_0x59c5a4=_0x59c5a4||0x1f4;return function(_0x6073a4){logger[_0x4fc5('0x22')](_0x6073a4[_0x4fc5('0x23')]);if(_0x6073a4[_0x4fc5('0x24')]){delete _0x6073a4[_0x4fc5('0x24')];}_0x45eceb[_0x4fc5('0x15')](_0x59c5a4)[_0x4fc5('0x25')](_0x6073a4);};}var utilLicense=require(_0x4fc5('0x13'));exports[_0x4fc5('0x26')]=function(_0x2b39a0,_0x406329){var _0x1a6eb8={'raw':!![],'where':{'id':0x1}},_0x1512c6={};_0x1512c6[_0x4fc5('0x27')]=_[_0x4fc5('0x28')](db[_0x4fc5('0x29')][_0x4fc5('0x2a')]);_0x1512c6[_0x4fc5('0x2b')]=_[_0x4fc5('0x28')](_0x2b39a0['query']);_0x1512c6[_0x4fc5('0x2c')]=_['intersection'](_0x1512c6[_0x4fc5('0x27')],_0x1512c6[_0x4fc5('0x2b')]);_0x1a6eb8['attributes']=_[_0x4fc5('0x2d')](_0x1512c6[_0x4fc5('0x27')],qs['fields'](_0x2b39a0[_0x4fc5('0x2b')]['fields']));_0x1a6eb8[_0x4fc5('0x2e')]=_0x1a6eb8[_0x4fc5('0x2e')][_0x4fc5('0x2f')]?_0x1a6eb8[_0x4fc5('0x2e')]:_0x1512c6[_0x4fc5('0x27')];_0x1a6eb8=_[_0x4fc5('0x30')]({},_0x1a6eb8,_0x2b39a0[_0x4fc5('0x31')]);return utilLicense[_0x4fc5('0x32')](_0x1a6eb8)[_0x4fc5('0x1f')](respondWithResult(_0x406329,null))[_0x4fc5('0x33')](handleError(_0x406329,null));};exports['update']=function(_0x4fe9d9,_0x24a1fe){if(_0x4fe9d9[_0x4fc5('0x34')]['id']){delete _0x4fe9d9[_0x4fc5('0x34')]['id'];}return db[_0x4fc5('0x29')][_0x4fc5('0x35')]({'where':{'id':_0x4fe9d9[_0x4fc5('0x36')]['id']}})[_0x4fc5('0x1f')](handleEntityNotFound(_0x24a1fe,null))[_0x4fc5('0x1f')](function(_0x559551){var _0x34808b=_0x559551[_0x4fc5('0x37')]({'plain':!![]});return utilLicense[_0x4fc5('0x38')](_0x34808b,_0x4fe9d9[_0x4fc5('0x34')]['key']);})[_0x4fc5('0x1f')](function(_0x5dc1ff){if(!_0x5dc1ff['demo']){return saveUpdates(_0x4fe9d9[_0x4fc5('0x34')],null);}return _0x5dc1ff;})[_0x4fc5('0x1f')](respondWithResult(_0x24a1fe,null))[_0x4fc5('0x33')](handleError(_0x24a1fe,null));};exports['downloadLogFile']=function(_0x5a1a70,_0xbc53ce){var _0x9487bc=_0x4fc5('0x39');var _0x56783a=path[_0x4fc5('0x3a')](_0x4fc5('0x3b'),_0x4fc5('0x3c'),_0x4fc5('0x3d'),_0x9487bc);_0xbc53ce[_0x4fc5('0x3e')](_0x4fc5('0x3f'),_0x4fc5('0x40')+_0x9487bc);_0xbc53ce[_0x4fc5('0x1b')](_0x4fc5('0x41'),_0x4fc5('0x42'));_0xbc53ce[_0x4fc5('0x43')](_0x56783a);}; \ No newline at end of file +var _0xc765=['util','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','length','merge','catch','body','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','set','Content-Type','text/plain','download','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xadb97b,_0x52998d){var _0x762a0f=function(_0x49a5cc){while(--_0x49a5cc){_0xadb97b['push'](_0xadb97b['shift']());}};_0x762a0f(++_0x52998d);}(_0xc765,0x82));var _0x5c76=function(_0x1f993d,_0x579c8f){_0x1f993d=_0x1f993d-0x0;var _0x3c1190=_0xc765[_0x1f993d];return _0x3c1190;};'use strict';var emlformat=require(_0x5c76('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c76('0x1'));var rp=require(_0x5c76('0x2'));var moment=require(_0x5c76('0x3'));var BPromise=require(_0x5c76('0x4'));var Mustache=require(_0x5c76('0x5'));var util=require(_0x5c76('0x6'));var path=require('path');var sox=require(_0x5c76('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c76('0x8'));var _=require('lodash');var squel=require(_0x5c76('0x9'));var crypto=require('crypto');var jsforce=require(_0x5c76('0xa'));var deskjs=require(_0x5c76('0xb'));var toCsv=require(_0x5c76('0xc'));var querystring=require(_0x5c76('0xd'));var Papa=require(_0x5c76('0xe'));var Redis=require(_0x5c76('0xf'));var authService=require(_0x5c76('0x10'));var qs=require(_0x5c76('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c76('0x12'));var logger=require(_0x5c76('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c76('0x14'));var db=require(_0x5c76('0x15'))['db'];function respondWithStatusCode(_0x2723a0,_0xe533c1){_0xe533c1=_0xe533c1||0xcc;return function(_0x3e2b97){if(_0x3e2b97){return _0x2723a0['sendStatus'](_0xe533c1);}return _0x2723a0[_0x5c76('0x16')](_0xe533c1)['end']();};}function respondWithResult(_0x4f7c00,_0x55f210){_0x55f210=_0x55f210||0xc8;return function(_0x11e89d){if(_0x11e89d){return _0x4f7c00[_0x5c76('0x16')](_0x55f210)[_0x5c76('0x17')](_0x11e89d);}};}function respondWithFilteredResult(_0x410d86,_0x345171){return function(_0x2eeec3){if(_0x2eeec3){var _0x10ba44=typeof _0x345171['offset']===_0x5c76('0x18')&&typeof _0x345171['limit']===_0x5c76('0x18');var _0xa61739=_0x2eeec3[_0x5c76('0x19')];var _0x363000=_0x10ba44?0x0:_0x345171[_0x5c76('0x1a')];var _0x466be4=_0x10ba44?_0x2eeec3['count']:_0x345171[_0x5c76('0x1a')]+_0x345171['limit'];var _0x2103bf;if(_0x466be4>=_0xa61739){_0x466be4=_0xa61739;_0x2103bf=0xc8;}else{_0x2103bf=0xce;}_0x410d86[_0x5c76('0x16')](_0x2103bf);return _0x410d86['set'](_0x5c76('0x1b'),_0x363000+'-'+_0x466be4+'/'+_0xa61739)[_0x5c76('0x17')](_0x2eeec3);}return null;};}function patchUpdates(_0x4971c5){return function(_0x5138ba){try{jsonpatch[_0x5c76('0x1c')](_0x5138ba,_0x4971c5,!![]);}catch(_0x488e83){return BPromise[_0x5c76('0x1d')](_0x488e83);}return _0x5138ba[_0x5c76('0x1e')]();};}function saveUpdates(_0x39412f,_0x1096c3){return function(_0x13c701){if(_0x13c701){return _0x13c701[_0x5c76('0x1f')](_0x39412f)[_0x5c76('0x20')](function(_0x4671a0){return _0x4671a0;});}return null;};}function removeEntity(_0x2ef7dd,_0xd87a4c){return function(_0x546d4a){if(_0x546d4a){return _0x546d4a[_0x5c76('0x21')]()[_0x5c76('0x20')](function(){_0x2ef7dd[_0x5c76('0x16')](0xcc)[_0x5c76('0x22')]();});}};}function handleEntityNotFound(_0xd83331,_0x57af12){return function(_0x5c74cb){if(!_0x5c74cb){_0xd83331[_0x5c76('0x23')](0x194);}return _0x5c74cb;};}function handleError(_0xfca3ff,_0xd06642){_0xd06642=_0xd06642||0x1f4;return function(_0x5e9cb5){logger['error'](_0x5e9cb5[_0x5c76('0x24')]);if(_0x5e9cb5[_0x5c76('0x25')]){delete _0x5e9cb5[_0x5c76('0x25')];}_0xfca3ff[_0x5c76('0x16')](_0xd06642)[_0x5c76('0x26')](_0x5e9cb5);};}var utilLicense=require(_0x5c76('0x14'));exports['index']=function(_0x2c2623,_0x60cc4c){var _0x1d006b={'raw':!![],'where':{'id':0x1}},_0x20ec6a={};_0x20ec6a['model']=_[_0x5c76('0x27')](db[_0x5c76('0x28')][_0x5c76('0x29')]);_0x20ec6a[_0x5c76('0x2a')]=_[_0x5c76('0x27')](_0x2c2623[_0x5c76('0x2a')]);_0x20ec6a[_0x5c76('0x2b')]=_[_0x5c76('0x2c')](_0x20ec6a[_0x5c76('0x2d')],_0x20ec6a[_0x5c76('0x2a')]);_0x1d006b[_0x5c76('0x2e')]=_[_0x5c76('0x2c')](_0x20ec6a[_0x5c76('0x2d')],qs[_0x5c76('0x2f')](_0x2c2623[_0x5c76('0x2a')][_0x5c76('0x2f')]));_0x1d006b['attributes']=_0x1d006b['attributes'][_0x5c76('0x30')]?_0x1d006b[_0x5c76('0x2e')]:_0x20ec6a['model'];_0x1d006b=_[_0x5c76('0x31')]({},_0x1d006b,_0x2c2623['options']);return utilLicense['getLicense'](_0x1d006b)['then'](respondWithResult(_0x60cc4c,null))[_0x5c76('0x32')](handleError(_0x60cc4c,null));};exports['update']=function(_0x43cfb7,_0x5b00a8){if(_0x43cfb7[_0x5c76('0x33')]['id']){delete _0x43cfb7[_0x5c76('0x33')]['id'];}return db[_0x5c76('0x28')]['find']({'where':{'id':_0x43cfb7[_0x5c76('0x34')]['id']}})[_0x5c76('0x20')](handleEntityNotFound(_0x5b00a8,null))[_0x5c76('0x20')](function(_0x57e388){var _0x2d739f=_0x57e388['get']({'plain':!![]});return utilLicense[_0x5c76('0x35')](_0x2d739f,_0x43cfb7['body'][_0x5c76('0x36')]);})[_0x5c76('0x20')](function(_0x125948){if(!_0x125948[_0x5c76('0x37')]){return saveUpdates(_0x43cfb7[_0x5c76('0x33')],null);}return _0x125948;})[_0x5c76('0x20')](respondWithResult(_0x5b00a8,null))['catch'](handleError(_0x5b00a8,null));};exports[_0x5c76('0x38')]=function(_0x35cb86,_0x247616){var _0x2e706b=_0x5c76('0x39');var _0xa59a72=path[_0x5c76('0x3a')](_0x5c76('0x3b'),_0x5c76('0x3c'),'xcally',_0x2e706b);_0x247616[_0x5c76('0x3d')](_0x5c76('0x3e'),_0x5c76('0x3f')+_0x2e706b);_0x247616[_0x5c76('0x40')](_0x5c76('0x41'),_0x5c76('0x42'));_0x247616[_0x5c76('0x43')](_0xa59a72);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 8e96b84..62cad58 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 _0x94f1=['License','license','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define'];(function(_0x19b2a8,_0x4eea6a){var _0x482f2c=function(_0x11fd06){while(--_0x11fd06){_0x19b2a8['push'](_0x19b2a8['shift']());}};_0x482f2c(++_0x4eea6a);}(_0x94f1,0x1bc));var _0x194f=function(_0x18e411,_0xd68451){_0x18e411=_0x18e411-0x0;var _0x10e8f6=_0x94f1[_0x18e411];return _0x10e8f6;};'use strict';var _=require('lodash');var util=require(_0x194f('0x0'));var logger=require(_0x194f('0x1'))(_0x194f('0x2'));var moment=require(_0x194f('0x3'));var BPromise=require(_0x194f('0x4'));var rp=require(_0x194f('0x5'));var fs=require('fs');var path=require(_0x194f('0x6'));var rimraf=require('rimraf');var config=require(_0x194f('0x7'));var attributes=require(_0x194f('0x8'));module[_0x194f('0x9')]=function(_0x2790d5,_0x5c59ea){return _0x2790d5[_0x194f('0xa')](_0x194f('0xb'),attributes,{'tableName':_0x194f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd010=['path','rimraf','../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5e72f4,_0x2d1896){var _0x37db29=function(_0x56b894){while(--_0x56b894){_0x5e72f4['push'](_0x5e72f4['shift']());}};_0x37db29(++_0x2d1896);}(_0xd010,0xd2));var _0x0d01=function(_0x13f11b,_0x57c23b){_0x13f11b=_0x13f11b-0x0;var _0x4d8f1e=_0xd010[_0x13f11b];return _0x4d8f1e;};'use strict';var _=require(_0x0d01('0x0'));var util=require(_0x0d01('0x1'));var logger=require(_0x0d01('0x2'))(_0x0d01('0x3'));var moment=require(_0x0d01('0x4'));var BPromise=require('bluebird');var rp=require(_0x0d01('0x5'));var fs=require('fs');var path=require(_0x0d01('0x6'));var rimraf=require(_0x0d01('0x7'));var config=require(_0x0d01('0x8'));var attributes=require(_0x0d01('0x9'));module[_0x0d01('0xa')]=function(_0x20d179,_0xc1b71b){return _0x20d179[_0x0d01('0xb')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a0e7217..cab22a3 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 _0x937d=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x937d,0x185));var _0xd937=function(_0x481ecb,_0x49f0a3){_0x481ecb=_0x481ecb-0x0;var _0x24e4e6=_0x937d[_0x481ecb];return _0x24e4e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd937('0x0'));var BPromise=require(_0xd937('0x1'));var rs=require(_0xd937('0x2'));var fs=require('fs');var Redis=require(_0xd937('0x3'));var db=require(_0xd937('0x4'))['db'];var utils=require(_0xd937('0x5'));var logger=require(_0xd937('0x6'))('rpc');var config=require(_0xd937('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd937('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20caf3,_0x6f1511,_0x3deec9){return new BPromise(function(_0x4207d6,_0x55c5a5){return client['request'](_0x20caf3,_0x3deec9)[_0xd937('0x9')](function(_0x58c775){logger[_0xd937('0xa')](_0xd937('0xb'),_0x6f1511,_0xd937('0xc'));logger[_0xd937('0xd')](_0xd937('0xe'),_0x6f1511,_0xd937('0xc'),JSON[_0xd937('0xf')](_0x58c775));if(_0x58c775[_0xd937('0x10')]){if(_0x58c775['error'][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')](_0xd937('0xb'),_0x6f1511,_0x58c775[_0xd937('0x10')]['message']);return _0x55c5a5(_0x58c775[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0xb'),_0x6f1511,_0x58c775[_0xd937('0x10')]['message']);return _0x4207d6(_0x58c775[_0xd937('0x10')][_0xd937('0x12')]);}else{logger[_0xd937('0xa')](_0xd937('0xb'),_0x6f1511,'request\x20sent');_0x4207d6(_0x58c775['result'][_0xd937('0x12')]);}})['catch'](function(_0x584995){logger[_0xd937('0x10')](_0xd937('0xb'),_0x6f1511,_0x584995);_0x55c5a5(_0x584995);});});} \ No newline at end of file +var _0x4b1f=['error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4e16f8,_0x115ca3){var _0xef3db2=function(_0x4549f0){while(--_0x4549f0){_0x4e16f8['push'](_0x4e16f8['shift']());}};_0xef3db2(++_0x115ca3);}(_0x4b1f,0x82));var _0xf4b1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4b1f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var moment=require(_0xf4b1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4b1('0x3'));var db=require(_0xf4b1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4b1('0x5'))('rpc');var config=require(_0xf4b1('0x6'));var jayson=require(_0xf4b1('0x7'));var client=jayson[_0xf4b1('0x8')][_0xf4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e44ab,_0x262c45,_0x31cf06){return new BPromise(function(_0x417b84,_0x304001){return client[_0xf4b1('0xa')](_0x3e44ab,_0x31cf06)[_0xf4b1('0xb')](function(_0x1d05d4){logger[_0xf4b1('0xc')](_0xf4b1('0xd'),_0x262c45,'request\x20sent');logger['debug'](_0xf4b1('0xe'),_0x262c45,_0xf4b1('0xf'),JSON[_0xf4b1('0x10')](_0x1d05d4));if(_0x1d05d4[_0xf4b1('0x11')]){if(_0x1d05d4['error'][_0xf4b1('0x12')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x262c45,_0x1d05d4[_0xf4b1('0x11')][_0xf4b1('0x13')]);return _0x304001(_0x1d05d4['error'][_0xf4b1('0x13')]);}logger[_0xf4b1('0x11')]('License,\x20%s,\x20%s',_0x262c45,_0x1d05d4[_0xf4b1('0x11')][_0xf4b1('0x13')]);return _0x417b84(_0x1d05d4[_0xf4b1('0x11')][_0xf4b1('0x13')]);}else{logger['info'](_0xf4b1('0xd'),_0x262c45,_0xf4b1('0xf'));_0x417b84(_0x1d05d4['result'][_0xf4b1('0x13')]);}})[_0xf4b1('0x14')](function(_0x1bfe2a){logger[_0xf4b1('0x11')](_0xf4b1('0xd'),_0x262c45,_0x1bfe2a);_0x304001(_0x1bfe2a);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9d4ac1d..12d66c4 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 _0x64ec=['/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','addImap','addSmtp','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp'];(function(_0x2e02de,_0x36f412){var _0xb7fe60=function(_0x2cf3a8){while(--_0x2cf3a8){_0x2e02de['push'](_0x2e02de['shift']());}};_0xb7fe60(++_0x36f412);}(_0x64ec,0x183));var _0xc64e=function(_0x1b936f,_0x377390){_0x1b936f=_0x1b936f-0x0;var _0x136be2=_0x64ec[_0x1b936f];return _0x136be2;};'use strict';var multer=require(_0xc64e('0x0'));var util=require('util');var path=require(_0xc64e('0x1'));var timeout=require('connect-timeout');var express=require(_0xc64e('0x2'));var router=express[_0xc64e('0x3')]();var fs_extra=require(_0xc64e('0x4'));var auth=require(_0xc64e('0x5'));var interaction=require(_0xc64e('0x6'));var config=require(_0xc64e('0x7'));var controller=require(_0xc64e('0x8'));router[_0xc64e('0x9')]('/',auth[_0xc64e('0xa')](),controller[_0xc64e('0xb')]);router[_0xc64e('0x9')](_0xc64e('0xc'),auth[_0xc64e('0xa')](),controller[_0xc64e('0xd')]);router['get'](_0xc64e('0xe'),auth[_0xc64e('0xa')](),controller[_0xc64e('0xf')]);router[_0xc64e('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xc64e('0x9')]('/:id/canned_answers',auth[_0xc64e('0xa')](),controller['getAnswers']);router[_0xc64e('0x9')](_0xc64e('0x10'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x11')]);router[_0xc64e('0x9')](_0xc64e('0x12'),auth['isAuthenticated'](),controller[_0xc64e('0x13')]);router[_0xc64e('0x9')](_0xc64e('0x14'),auth['isAuthenticated'](),controller[_0xc64e('0x15')]);router[_0xc64e('0x9')](_0xc64e('0x16'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x17')]);router[_0xc64e('0x9')]('/:id/messages',auth[_0xc64e('0xa')](),controller[_0xc64e('0x18')]);router[_0xc64e('0x9')](_0xc64e('0x19'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x1a')]);router[_0xc64e('0x9')](_0xc64e('0x1b'),auth['isAuthenticated'](),controller[_0xc64e('0x1c')]);router[_0xc64e('0x1d')](_0xc64e('0x1e'),auth['isAuthenticated'](),controller[_0xc64e('0x1f')]);router[_0xc64e('0x1d')](_0xc64e('0x20'),auth['isAuthenticated'](),controller[_0xc64e('0x21')]);router['post']('/',auth[_0xc64e('0xa')](),controller['create']);router[_0xc64e('0x1d')](_0xc64e('0x10'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x22')]);router[_0xc64e('0x1d')](_0xc64e('0x12'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x23')]);router[_0xc64e('0x1d')]('/:id/interactions',auth[_0xc64e('0xa')](),controller['addInteraction']);router[_0xc64e('0x1d')](_0xc64e('0x16'),auth['isAuthenticated'](),controller['addApplications']);router[_0xc64e('0x1d')](_0xc64e('0x24'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x25')]);router[_0xc64e('0x1d')](_0xc64e('0x1b'),auth['isAuthenticated'](),controller[_0xc64e('0x26')]);router['put'](_0xc64e('0xe'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x27')]);router[_0xc64e('0x28')](_0xc64e('0x1e'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x29')]);router[_0xc64e('0x28')](_0xc64e('0x20'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x2a')]);router[_0xc64e('0x28')](_0xc64e('0x10'),auth[_0xc64e('0xa')](),controller[_0xc64e('0x2b')]);router[_0xc64e('0x28')]('/:id/out_servers',auth[_0xc64e('0xa')](),controller[_0xc64e('0x2c')]);router[_0xc64e('0x28')](_0xc64e('0xe'),auth[_0xc64e('0xa')](),controller['destroy']);router[_0xc64e('0x28')]('/:id/users',auth[_0xc64e('0xa')](),controller['removeAgents']);module[_0xc64e('0x2d')]=router; \ No newline at end of file +var _0x0a22=['getAgents','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','send','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','/:id','destroy','removeAgents','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x0a22,0xcc));var _0x20a2=function(_0x1d0ce7,_0x5938f1){_0x1d0ce7=_0x1d0ce7-0x0;var _0x27d94d=_0x0a22[_0x1d0ce7];return _0x27d94d;};'use strict';var multer=require(_0x20a2('0x0'));var util=require(_0x20a2('0x1'));var path=require(_0x20a2('0x2'));var timeout=require(_0x20a2('0x3'));var express=require('express');var router=express[_0x20a2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x20a2('0x5'));var config=require(_0x20a2('0x6'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0x20a2('0x7')](),controller['index']);router[_0x20a2('0x8')](_0x20a2('0x9'),auth[_0x20a2('0x7')](),controller[_0x20a2('0xa')]);router[_0x20a2('0x8')]('/:id',auth[_0x20a2('0x7')](),controller[_0x20a2('0xb')]);router[_0x20a2('0x8')]('/:id/dispositions',auth[_0x20a2('0x7')](),controller[_0x20a2('0xc')]);router[_0x20a2('0x8')](_0x20a2('0xd'),auth[_0x20a2('0x7')](),controller[_0x20a2('0xe')]);router['get'](_0x20a2('0xf'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x10')]);router[_0x20a2('0x8')]('/:id/out_servers',auth[_0x20a2('0x7')](),controller[_0x20a2('0x11')]);router['get'](_0x20a2('0x12'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x13')]);router[_0x20a2('0x8')](_0x20a2('0x14'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x15')]);router[_0x20a2('0x8')]('/:id/messages',auth[_0x20a2('0x7')](),controller[_0x20a2('0x16')]);router[_0x20a2('0x8')](_0x20a2('0x17'),auth['isAuthenticated'](),controller[_0x20a2('0x18')]);router[_0x20a2('0x8')](_0x20a2('0x19'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x1a')]);router[_0x20a2('0x1b')](_0x20a2('0x1c'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x1d')]);router[_0x20a2('0x1b')](_0x20a2('0xd'),auth['isAuthenticated'](),controller[_0x20a2('0x1e')]);router['post']('/',auth[_0x20a2('0x7')](),controller[_0x20a2('0x1f')]);router[_0x20a2('0x1b')](_0x20a2('0xf'),auth[_0x20a2('0x7')](),controller['addImap']);router['post'](_0x20a2('0x20'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x21')]);router[_0x20a2('0x1b')](_0x20a2('0x12'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x22')]);router[_0x20a2('0x1b')]('/:id/applications',auth[_0x20a2('0x7')](),controller[_0x20a2('0x23')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x20a2('0x24')]);router[_0x20a2('0x1b')](_0x20a2('0x19'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x25')]);router['put']('/:id',auth[_0x20a2('0x7')](),controller[_0x20a2('0x26')]);router[_0x20a2('0x27')](_0x20a2('0x1c'),auth['isAuthenticated'](),controller[_0x20a2('0x28')]);router[_0x20a2('0x27')](_0x20a2('0xd'),auth[_0x20a2('0x7')](),controller['removeAnswers']);router['delete'](_0x20a2('0xf'),auth['isAuthenticated'](),controller[_0x20a2('0x29')]);router[_0x20a2('0x27')](_0x20a2('0x20'),auth['isAuthenticated'](),controller[_0x20a2('0x2a')]);router['delete'](_0x20a2('0x2b'),auth[_0x20a2('0x7')](),controller[_0x20a2('0x2c')]);router['delete']('/:id/users',auth[_0x20a2('0x7')](),controller[_0x20a2('0x2d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 06b9bac..ab2ed3f 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 _0x486e=['custom','getDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider'];(function(_0x50a45f,_0x428399){var _0x5279ef=function(_0x5c2bb3){while(--_0x5c2bb3){_0x50a45f['push'](_0x50a45f['shift']());}};_0x5279ef(++_0x428399);}(_0x486e,0x1d0));var _0xe486=function(_0x409ad2,_0x5129c1){_0x409ad2=_0x409ad2-0x0;var _0x595b5f=_0x486e[_0x409ad2];return _0x595b5f;};'use strict';var Sequelize=require(_0xe486('0x0'));module[_0xe486('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe486('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xe486('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe486('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe486('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xe486('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe486('0x2')],'allowNull':![],'defaultValue':_0xe486('0x5')},'fontSize':{'type':Sequelize[_0xe486('0x6')](0x2)[_0xe486('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe486('0x4')],'defaultValue':function(){return _0xe486('0x8');}},'notificationSound':{'type':Sequelize[_0xe486('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe486('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe486('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe486('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe486('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe486('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe486('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe486('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xe486('0x3')],'defaultValue':![],'comment':_0xe486('0xa'),'set':function(_0x2ef8a1){if(!_0x2ef8a1)this[_0xe486('0xb')]('mandatoryDispositionPauseId',null);this[_0xe486('0xb')](_0xe486('0xc'),_0x2ef8a1);}},'provider':{'type':Sequelize[_0xe486('0xd')](_0xe486('0xe'),_0xe486('0xf'),_0xe486('0x10'),_0xe486('0x11')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xe486('0x12')))return _0xe486('0x13');return this[_0xe486('0x14')](_0xe486('0x12'));},'set':function(_0x4ca3a7){if(_0x4ca3a7===_0xe486('0x13'))_0x4ca3a7=null;return this[_0xe486('0xb')](_0xe486('0x12'),_0x4ca3a7);}}}; \ No newline at end of file +var _0xc38d=['STRING','BOOLEAN','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','provider','sequelize','exports'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0xc38d,0x11e));var _0xdc38=function(_0x360f68,_0x2f686c){_0x360f68=_0x360f68-0x0;var _0x29a1a1=_0xc38d[_0x360f68];return _0x29a1a1;};'use strict';var Sequelize=require(_0xdc38('0x0'));module[_0xdc38('0x1')]={'description':{'type':Sequelize[_0xdc38('0x2')]},'name':{'type':Sequelize[_0xdc38('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xdc38('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xdc38('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xdc38('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xdc38('0x4')](0x2)[_0xdc38('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xdc38('0x6')],'defaultValue':function(){return _0xdc38('0x7');}},'notificationSound':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdc38('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdc38('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc38('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdc38('0x8'),'set':function(_0x4fa971){if(!_0x4fa971)this[_0xdc38('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xdc38('0xa'),_0x4fa971);}},'provider':{'type':Sequelize[_0xdc38('0xb')](_0xdc38('0xc'),_0xdc38('0xd'),_0xdc38('0xe'),_0xdc38('0xf')),'defaultValue':null,'get':function(){if(!this[_0xdc38('0x10')](_0xdc38('0x11')))return'custom';return this['getDataValue'](_0xdc38('0x11'));},'set':function(_0x239e3b){if(_0x239e3b==='custom')_0x239e3b=null;return this[_0xdc38('0x9')]('provider',_0x239e3b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 37e35d9..b055070 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 _0xc321=['addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','defaults','subject','attach','out','format','messageId','Interaction','Messages','verifySmtp','ValidationError','addAgents','spread','removeAgents','isArray','emit','User','getAgents','moment','bluebird','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./mailAccount.socket','jayson/promise','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','end','status','offset','undefined','limit','count','set','json','destroy','get','sendStatus','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','authentication','Imap','Smtp','index','MailServerOut','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','merge','options','MailAccount','include','findAll','show','params','MailServerIn','Pause','rawAttributes','includeAll','update','body','custom','provider','find','Mail\x20Account\x20not\x20found','service','describe','addDisposition','MailAccountId','Disposition','getDispositions','filter','rows','removeDispositions','ids','addAnswer','CannedAnswer','create','removeAnswers','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag'];(function(_0x5d9ccd,_0x38dfaa){var _0x171778=function(_0x736193){while(--_0x736193){_0x5d9ccd['push'](_0x5d9ccd['shift']());}};_0x171778(++_0x38dfaa);}(_0xc321,0x1b5));var _0x1c32=function(_0x3596b3,_0x462774){_0x3596b3=_0x3596b3-0x0;var _0x289464=_0xc321[_0x3596b3];return _0x289464;};'use strict';var moment=require(_0x1c32('0x0'));var BPromise=require(_0x1c32('0x1'));var util=require('util');var path=require('path');var _=require(_0x1c32('0x2'));var juice=require(_0x1c32('0x3'));var Redis=require(_0x1c32('0x4'));var qs=require(_0x1c32('0x5'));var logger=require(_0x1c32('0x6'))(_0x1c32('0x7'));var config=require(_0x1c32('0x8'));var db=require('../../mysqldb')['db'];config[_0x1c32('0x9')]=_['defaults'](config[_0x1c32('0x9')],{'host':_0x1c32('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c32('0x9')]));require(_0x1c32('0xb'))['register'](socket);var jayson=require(_0x1c32('0xc'));var client=jayson['client'][_0x1c32('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x5a3418,_0xf4a2aa,_0x2c376e,_0x44ef0a){return new BPromise(function(_0x3dbd18,_0x33f98f){var _0x339b34=_0x44ef0a||client;return _0x339b34[_0x1c32('0xe')](_0x5a3418,_0x2c376e)[_0x1c32('0xf')](function(_0x1291e9){logger[_0x1c32('0x10')]('MailAccount,\x20%s,\x20%s',_0xf4a2aa,_0x1c32('0x11'));logger['debug'](_0x1c32('0x12'),_0xf4a2aa,_0x1c32('0x11'),JSON[_0x1c32('0x13')](_0x1291e9));if(_0x1291e9[_0x1c32('0x14')]){if(_0x1291e9['error'][_0x1c32('0x15')]===0x1f4){logger[_0x1c32('0x14')](_0x1c32('0x16'),_0xf4a2aa,_0x1291e9[_0x1c32('0x14')][_0x1c32('0x17')]);return _0x33f98f(_0x1291e9[_0x1c32('0x14')][_0x1c32('0x17')]);}logger[_0x1c32('0x14')]('MailAccount,\x20%s,\x20%s',_0xf4a2aa,_0x1291e9[_0x1c32('0x14')][_0x1c32('0x17')]);return _0x3dbd18(_0x1291e9[_0x1c32('0x14')][_0x1c32('0x17')]);}else{logger[_0x1c32('0x10')]('MailAccount,\x20%s,\x20%s',_0xf4a2aa,_0x1c32('0x11'));_0x3dbd18(_0x1291e9[_0x1c32('0x18')]['message']);}})[_0x1c32('0x19')](function(_0x565217){logger['error']('MailAccount,\x20%s,\x20%s',_0xf4a2aa,_0x565217);_0x33f98f(_0x565217);});});}function respondWithStatusCode(_0x24cde7,_0x4ed200){_0x4ed200=_0x4ed200||0xcc;return function(_0x2552f1){if(_0x2552f1){return _0x24cde7['sendStatus'](_0x4ed200);}return _0x24cde7['status'](_0x4ed200)[_0x1c32('0x1a')]();};}function respondWithResult(_0x165323,_0x1b0743){_0x1b0743=_0x1b0743||0xc8;return function(_0x1ce317){if(_0x1ce317){return _0x165323[_0x1c32('0x1b')](_0x1b0743)['json'](_0x1ce317);}};}function respondWithFilteredResult(_0x1966db,_0x43c48f){return function(_0x813a9c){if(_0x813a9c){var _0x456e25=typeof _0x43c48f[_0x1c32('0x1c')]===_0x1c32('0x1d')&&typeof _0x43c48f[_0x1c32('0x1e')]===_0x1c32('0x1d');var _0x2f0e16=_0x813a9c[_0x1c32('0x1f')];var _0x387a18=_0x456e25?0x0:_0x43c48f['offset'];var _0x5a13fd=_0x456e25?_0x813a9c[_0x1c32('0x1f')]:_0x43c48f[_0x1c32('0x1c')]+_0x43c48f[_0x1c32('0x1e')];var _0x17f027;if(_0x5a13fd>=_0x2f0e16){_0x5a13fd=_0x2f0e16;_0x17f027=0xc8;}else{_0x17f027=0xce;}_0x1966db[_0x1c32('0x1b')](_0x17f027);return _0x1966db[_0x1c32('0x20')]('Content-Range',_0x387a18+'-'+_0x5a13fd+'/'+_0x2f0e16)[_0x1c32('0x21')](_0x813a9c);}return null;};}function saveUpdates(_0x1c9b69){return function(_0x484800){if(_0x484800){return _0x484800['update'](_0x1c9b69)['then'](function(_0x276ef9){return _0x276ef9;});}return null;};}function removeEntity(_0xb0e41){return function(_0x2db2cb){if(_0x2db2cb){return _0x2db2cb[_0x1c32('0x22')]()['then'](function(){var _0x2678f0=_0x2db2cb[_0x1c32('0x23')]({'plain':!![]});var _0xd69746='MailAccounts';return db['UserProfileResource'][_0x1c32('0x22')]({'where':{'type':_0xd69746,'resourceId':_0x2678f0['id']}})[_0x1c32('0xf')](function(){return _0x2db2cb;});})[_0x1c32('0xf')](function(){_0xb0e41[_0x1c32('0x1b')](0xcc)[_0x1c32('0x1a')]();});}};}function handleEntityNotFound(_0x494235){return function(_0x144134){if(!_0x144134){_0x494235[_0x1c32('0x24')](0x194);}return _0x144134;};}function handleError(_0x1adf64,_0x23c773){_0x23c773=_0x23c773||0x1f4;return function(_0x53e82f){logger[_0x1c32('0x14')](_0x53e82f['stack']);if(_0x53e82f['name']){delete _0x53e82f[_0x1c32('0x25')];}_0x1adf64['status'](_0x23c773)[_0x1c32('0x26')](_0x53e82f);};}function getImapHost(_0x9cfd98){switch(_0x9cfd98){case _0x1c32('0x27'):return _0x1c32('0x28');case _0x1c32('0x29'):return _0x1c32('0x2a');case'hotmail':return'imap-mail.outlook.com';case'outlook365':return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x9cfd98);}function getSmtpHost(_0x52954c){switch(_0x52954c){case _0x1c32('0x27'):return'smtp.gmail.com';case _0x1c32('0x29'):return _0x1c32('0x2b');case _0x1c32('0x2c'):return _0x1c32('0x2d');case _0x1c32('0x2e'):return _0x1c32('0x2f');}throw new Error('Unknown\x20email\x20service\x20provider',_0x52954c);}function getAuthenticationOptions(_0x53c69f,_0x522382){var _0x5cc708={};var _0x4d48e8={};if(_0x53c69f){_0x5cc708[_0x1c32('0x30')]=_0x4d48e8[_0x1c32('0x30')]=_0x522382[_0x1c32('0x31')];_0x5cc708[_0x1c32('0x32')]=_0x4d48e8['pass']=_0x522382[_0x1c32('0x32')];if(_0x522382[_0x1c32('0x33')]){_0x5cc708[_0x1c32('0x33')]=_0x4d48e8[_0x1c32('0x33')]=!![];_0x5cc708[_0x1c32('0x34')]=_0x4d48e8[_0x1c32('0x34')]=_0x522382[_0x1c32('0x34')];_0x5cc708[_0x1c32('0x32')]=_0x4d48e8[_0x1c32('0x35')]=null;}else{_0x5cc708[_0x1c32('0x34')]=_0x4d48e8[_0x1c32('0x34')]=null;}_0x5cc708[_0x1c32('0x36')]=getImapHost(_0x53c69f);_0x5cc708[_0x1c32('0x37')]=0x3e1;_0x4d48e8['host']=getSmtpHost(_0x53c69f);_0x4d48e8[_0x1c32('0x37')]=0x24b;_0x4d48e8[_0x1c32('0x38')]=![];_0x5cc708['service']=_0x4d48e8['service']=null;}else{if(_0x522382[_0x1c32('0x39')]){_0x5cc708[_0x1c32('0x30')]=_0x4d48e8['user']=_0x522382[_0x1c32('0x31')];_0x5cc708['password']=_0x4d48e8[_0x1c32('0x35')]=_0x522382[_0x1c32('0x32')];}else{_0x5cc708[_0x1c32('0x39')]=_0x4d48e8[_0x1c32('0x39')]=![];_0x5cc708[_0x1c32('0x30')]=_0x4d48e8[_0x1c32('0x30')]=null;_0x5cc708['password']=_0x4d48e8['pass']=null;}_0x5cc708[_0x1c32('0x36')]=_0x522382['Imap'][_0x1c32('0x36')];_0x5cc708[_0x1c32('0x37')]=_0x522382[_0x1c32('0x3a')][_0x1c32('0x37')];_0x4d48e8[_0x1c32('0x36')]=_0x522382[_0x1c32('0x3b')][_0x1c32('0x36')];_0x4d48e8['port']=_0x522382[_0x1c32('0x3b')][_0x1c32('0x37')];}return{'Imap':_0x5cc708,'Smtp':_0x4d48e8};}exports[_0x1c32('0x3c')]=function(_0x1dd735,_0x385a3e){var _0x3d60d4={'include':[{'model':db['MailServerIn'],'as':_0x1c32('0x3a')},{'model':db[_0x1c32('0x3d')],'as':_0x1c32('0x3b')},{'model':db['Pause'],'as':_0x1c32('0x3e')}]},_0x134187={},_0x432090={'count':0x0,'rows':[]};var _0x3e184d=_[_0x1c32('0x3f')](db['MailAccount']['rawAttributes'],function(_0x5687b6){return{'name':_0x5687b6[_0x1c32('0x40')],'type':_0x5687b6[_0x1c32('0x41')][_0x1c32('0x42')]};});_0x134187[_0x1c32('0x43')]=_['map'](_0x3e184d,_0x1c32('0x25'));_0x134187[_0x1c32('0x44')]=_[_0x1c32('0x45')](_0x1dd735[_0x1c32('0x44')]);_0x134187['filters']=_[_0x1c32('0x46')](_0x134187[_0x1c32('0x43')],_0x134187[_0x1c32('0x44')]);_0x3d60d4[_0x1c32('0x47')]=_[_0x1c32('0x46')](_0x134187[_0x1c32('0x43')],qs[_0x1c32('0x48')](_0x1dd735[_0x1c32('0x44')][_0x1c32('0x48')]));_0x3d60d4[_0x1c32('0x47')]=_0x3d60d4[_0x1c32('0x47')][_0x1c32('0x49')]?_0x3d60d4[_0x1c32('0x47')]:_0x134187['model'];if(!_0x1dd735[_0x1c32('0x44')][_0x1c32('0x4a')](_0x1c32('0x4b'))){_0x3d60d4['limit']=qs[_0x1c32('0x1e')](_0x1dd735[_0x1c32('0x44')][_0x1c32('0x1e')]);_0x3d60d4[_0x1c32('0x1c')]=qs['offset'](_0x1dd735[_0x1c32('0x44')][_0x1c32('0x1c')]);}_0x3d60d4[_0x1c32('0x4c')]=qs[_0x1c32('0x4d')](_0x1dd735[_0x1c32('0x44')]['sort']);_0x3d60d4['where']=qs[_0x1c32('0x4e')](_[_0x1c32('0x4f')](_0x1dd735[_0x1c32('0x44')],_0x134187[_0x1c32('0x4e')]),_0x3e184d);if(_0x1dd735[_0x1c32('0x44')]['filter']){_0x3d60d4[_0x1c32('0x50')]=_['merge'](_0x3d60d4[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x3e184d,function(_0x5561d4){if(_0x5561d4['type']!==_0x1c32('0x51')){var _0x184f61={};_0x184f61[_0x5561d4[_0x1c32('0x25')]]={'$like':'%'+_0x1dd735[_0x1c32('0x44')]['filter']+'%'};return _0x184f61;}})});}_0x3d60d4=_[_0x1c32('0x52')]({},_0x3d60d4,_0x1dd735[_0x1c32('0x53')]);var _0x32e956={'where':_0x3d60d4[_0x1c32('0x50')]};return db[_0x1c32('0x54')][_0x1c32('0x1f')](_0x32e956)[_0x1c32('0xf')](function(_0xf41005){_0x432090['count']=_0xf41005;if(_0x1dd735[_0x1c32('0x44')]['includeAll']){_0x3d60d4[_0x1c32('0x55')]=[{'all':!![]}];}return db[_0x1c32('0x54')][_0x1c32('0x56')](_0x3d60d4);})[_0x1c32('0xf')](function(_0x280473){_0x432090['rows']=_0x280473;return _0x432090;})[_0x1c32('0xf')](respondWithFilteredResult(_0x385a3e,_0x3d60d4))[_0x1c32('0x19')](handleError(_0x385a3e,null));};exports[_0x1c32('0x57')]=function(_0x57e828,_0x2f2629){var _0x495dc1={'raw':![],'where':{'id':_0x57e828[_0x1c32('0x58')]['id']},'include':[{'model':db[_0x1c32('0x59')],'as':_0x1c32('0x3a')},{'model':db[_0x1c32('0x3d')],'as':_0x1c32('0x3b')},{'model':db[_0x1c32('0x5a')],'as':_0x1c32('0x3e')}]},_0x3fdeea={};_0x3fdeea[_0x1c32('0x43')]=_[_0x1c32('0x45')](db['MailAccount'][_0x1c32('0x5b')]);_0x3fdeea['query']=_[_0x1c32('0x45')](_0x57e828[_0x1c32('0x44')]);_0x3fdeea[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0x3fdeea['model'],_0x3fdeea[_0x1c32('0x44')]);_0x495dc1[_0x1c32('0x47')]=_['intersection'](_0x3fdeea['model'],qs[_0x1c32('0x48')](_0x57e828[_0x1c32('0x44')]['fields']));_0x495dc1[_0x1c32('0x47')]=_0x495dc1[_0x1c32('0x47')][_0x1c32('0x49')]?_0x495dc1['attributes']:_0x3fdeea[_0x1c32('0x43')];if(_0x57e828[_0x1c32('0x44')][_0x1c32('0x5c')]){_0x495dc1[_0x1c32('0x55')]=[{'all':!![]}];}_0x495dc1=_['merge']({},_0x495dc1,_0x57e828[_0x1c32('0x53')]);return db['MailAccount']['find'](_0x495dc1)['then'](handleEntityNotFound(_0x2f2629,null))[_0x1c32('0xf')](respondWithResult(_0x2f2629,null))['catch'](handleError(_0x2f2629,null));};exports[_0x1c32('0x5d')]=function(_0x2a04eb,_0x1506a1){if(_0x2a04eb[_0x1c32('0x5e')]['id']){delete _0x2a04eb[_0x1c32('0x5e')]['id'];}var _0x263e26=_0x2a04eb[_0x1c32('0x5e')]['provider']===_0x1c32('0x5f')?null:_0x2a04eb['body'][_0x1c32('0x60')];var _0x256d32=_0x2a04eb[_0x1c32('0x5e')]['Imap']||{};var _0xc9971e=_0x2a04eb['body']['Smtp']||{};if(_0x263e26){_0x256d32[_0x1c32('0x36')]=getImapHost(_0x263e26);_0x256d32[_0x1c32('0x37')]=0x3e1;_0xc9971e['host']=getSmtpHost(_0x263e26);_0xc9971e[_0x1c32('0x37')]=0x24b;_0xc9971e[_0x1c32('0x38')]=![];}if(_0xc9971e[_0x1c32('0x33')]){_0xc9971e['secure']=![];}else{_0xc9971e[_0x1c32('0x34')]=null;}if(!_0x256d32['modernAuthentication'])_0x256d32[_0x1c32('0x34')]=null;_0x2a04eb[_0x1c32('0x5e')]['Imap']=_0x256d32;_0x2a04eb[_0x1c32('0x5e')]['Smtp']=_0xc9971e;return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x2a04eb[_0x1c32('0x58')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x1c32('0x3b')},{'model':db['Pause'],'as':_0x1c32('0x3e')}]})[_0x1c32('0xf')](handleEntityNotFound(_0x1506a1,null))[_0x1c32('0xf')](function(_0x387f19){if(!_0x387f19)throw new Error(_0x1c32('0x62'));if(_0x387f19[_0x1c32('0x63')])delete _0x2a04eb[_0x1c32('0x5e')][_0x1c32('0x3a')];return _0x387f19;})[_0x1c32('0xf')](saveUpdates(_0x2a04eb[_0x1c32('0x5e')],null))[_0x1c32('0xf')](function(_0x5e13dd){if(!_0x2a04eb[_0x1c32('0x5e')][_0x1c32('0x3a')])return _0x5e13dd;return db[_0x1c32('0x59')][_0x1c32('0x5d')](_0x2a04eb[_0x1c32('0x5e')][_0x1c32('0x3a')],{'where':{'MailAccountId':_0x5e13dd['id']}})['then'](function(){return _0x5e13dd;});})[_0x1c32('0xf')](function(_0x4409ac){if(!_0x2a04eb[_0x1c32('0x5e')][_0x1c32('0x3b')])return _0x4409ac;return db['MailServerOut'][_0x1c32('0x5d')](_0x2a04eb[_0x1c32('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x4409ac['id']}})[_0x1c32('0xf')](function(){return _0x4409ac;});})[_0x1c32('0xf')](respondWithResult(_0x1506a1,null))['catch'](handleError(_0x1506a1,null));};exports['describe']=function(_0x1ad5d3,_0x5e4f69){return db[_0x1c32('0x54')][_0x1c32('0x64')]()[_0x1c32('0xf')](respondWithResult(_0x5e4f69,null))[_0x1c32('0x19')](handleError(_0x5e4f69,null));};exports[_0x1c32('0x65')]=function(_0x744277,_0x4cb514){if(_0x744277[_0x1c32('0x5e')]['id']){delete _0x744277[_0x1c32('0x5e')]['id'];}return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x744277[_0x1c32('0x58')]['id']}})['then'](handleEntityNotFound(_0x4cb514,null))['then'](function(_0x4ffd2c){if(_0x4ffd2c){_0x744277[_0x1c32('0x5e')][_0x1c32('0x66')]=_0x4ffd2c['id'];return db[_0x1c32('0x67')]['create'](_0x744277[_0x1c32('0x5e')]);}})[_0x1c32('0xf')](respondWithResult(_0x4cb514,null))[_0x1c32('0x19')](handleError(_0x4cb514,null));};exports[_0x1c32('0x68')]=function(_0x405edf,_0x4a0fc2){var _0x1c5812={'raw':![],'where':{}};var _0x27b8f7={};var _0x1c18d9={'count':0x0,'rows':[]};return db[_0x1c32('0x54')]['findOne']({'where':{'id':_0x405edf[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4a0fc2,null))[_0x1c32('0xf')](function(_0x91ab1a){if(_0x91ab1a){_0x27b8f7[_0x1c32('0x43')]=_['keys'](db[_0x1c32('0x67')][_0x1c32('0x5b')]);_0x27b8f7['query']=_[_0x1c32('0x45')](_0x405edf[_0x1c32('0x44')]);_0x27b8f7[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0x27b8f7[_0x1c32('0x43')],_0x27b8f7[_0x1c32('0x44')]);_0x1c5812[_0x1c32('0x47')]=_[_0x1c32('0x46')](_0x27b8f7['model'],qs['fields'](_0x405edf[_0x1c32('0x44')][_0x1c32('0x48')]));_0x1c5812['attributes']=_0x1c5812['attributes'][_0x1c32('0x49')]?_0x1c5812[_0x1c32('0x47')]:_0x27b8f7['model'];if(!_0x405edf['query'][_0x1c32('0x4a')](_0x1c32('0x4b'))){_0x1c5812[_0x1c32('0x1e')]=qs[_0x1c32('0x1e')](_0x405edf[_0x1c32('0x44')][_0x1c32('0x1e')]);_0x1c5812[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0x405edf[_0x1c32('0x44')]['offset']);}_0x1c5812[_0x1c32('0x4c')]=qs[_0x1c32('0x4d')](_0x405edf[_0x1c32('0x44')][_0x1c32('0x4d')]);_0x1c5812[_0x1c32('0x50')]=qs[_0x1c32('0x4e')](_['pick'](_0x405edf[_0x1c32('0x44')],_0x27b8f7[_0x1c32('0x4e')]));_0x1c5812[_0x1c32('0x50')][_0x1c32('0x66')]=_0x91ab1a['id'];if(_0x405edf[_0x1c32('0x44')][_0x1c32('0x69')]){_0x1c5812[_0x1c32('0x50')]=_['merge'](_0x1c5812[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x1c5812[_0x1c32('0x47')],function(_0x183f3b){var _0x5e9a32={};_0x5e9a32[_0x183f3b]={'$like':'%'+_0x405edf[_0x1c32('0x44')][_0x1c32('0x69')]+'%'};return _0x5e9a32;})});}_0x1c5812=_[_0x1c32('0x52')]({},_0x1c5812,_0x405edf[_0x1c32('0x53')]);return db[_0x1c32('0x67')][_0x1c32('0x1f')]({'where':_0x1c5812[_0x1c32('0x50')]})['then'](function(_0x390196){_0x1c18d9[_0x1c32('0x1f')]=_0x390196;if(_0x405edf[_0x1c32('0x44')][_0x1c32('0x5c')]){_0x1c5812[_0x1c32('0x55')]=[{'all':!![]}];}return db[_0x1c32('0x67')][_0x1c32('0x56')](_0x1c5812);})['then'](function(_0x249ed6){_0x1c18d9[_0x1c32('0x6a')]=_0x249ed6;return _0x1c18d9;});}})['then'](respondWithFilteredResult(_0x4a0fc2,_0x1c5812))[_0x1c32('0x19')](handleError(_0x4a0fc2,null));};exports[_0x1c32('0x6b')]=function(_0x1a3c1f,_0x134866){return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x1a3c1f[_0x1c32('0x58')]['id']}})['then'](handleEntityNotFound(_0x134866,null))[_0x1c32('0xf')](function(_0x3110d1){if(_0x3110d1){return _0x3110d1[_0x1c32('0x6b')](_0x1a3c1f[_0x1c32('0x44')][_0x1c32('0x6c')]);}})[_0x1c32('0xf')](respondWithStatusCode(_0x134866,null))[_0x1c32('0x19')](handleError(_0x134866,null));};exports[_0x1c32('0x6d')]=function(_0xe9dce6,_0x4bbb78){if(_0xe9dce6[_0x1c32('0x5e')]['id']){delete _0xe9dce6[_0x1c32('0x5e')]['id'];}return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0xe9dce6[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4bbb78,null))[_0x1c32('0xf')](function(_0x6d315a){if(_0x6d315a){_0xe9dce6[_0x1c32('0x5e')][_0x1c32('0x66')]=_0x6d315a['id'];return db[_0x1c32('0x6e')][_0x1c32('0x6f')](_0xe9dce6[_0x1c32('0x5e')]);}})['then'](respondWithResult(_0x4bbb78,null))[_0x1c32('0x19')](handleError(_0x4bbb78,null));};exports['getAnswers']=function(_0x5884b0,_0x46a5dd){var _0x3d70c8={'raw':![],'where':{}};var _0x434e64={};var _0x97bde8={'count':0x0,'rows':[]};return db[_0x1c32('0x54')]['findOne']({'where':{'id':_0x5884b0[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x46a5dd,null))[_0x1c32('0xf')](function(_0x25dfb3){if(_0x25dfb3){_0x434e64[_0x1c32('0x43')]=_[_0x1c32('0x45')](db['CannedAnswer']['rawAttributes']);_0x434e64['query']=_[_0x1c32('0x45')](_0x5884b0[_0x1c32('0x44')]);_0x434e64[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0x434e64[_0x1c32('0x43')],_0x434e64[_0x1c32('0x44')]);_0x3d70c8['attributes']=_[_0x1c32('0x46')](_0x434e64[_0x1c32('0x43')],qs['fields'](_0x5884b0[_0x1c32('0x44')][_0x1c32('0x48')]));_0x3d70c8['attributes']=_0x3d70c8[_0x1c32('0x47')][_0x1c32('0x49')]?_0x3d70c8[_0x1c32('0x47')]:_0x434e64['model'];if(!_0x5884b0['query']['hasOwnProperty'](_0x1c32('0x4b'))){_0x3d70c8[_0x1c32('0x1e')]=qs['limit'](_0x5884b0[_0x1c32('0x44')]['limit']);_0x3d70c8[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0x5884b0[_0x1c32('0x44')][_0x1c32('0x1c')]);}_0x3d70c8[_0x1c32('0x4c')]=qs[_0x1c32('0x4d')](_0x5884b0[_0x1c32('0x44')][_0x1c32('0x4d')]);_0x3d70c8[_0x1c32('0x50')]=qs[_0x1c32('0x4e')](_[_0x1c32('0x4f')](_0x5884b0[_0x1c32('0x44')],_0x434e64[_0x1c32('0x4e')]));_0x3d70c8[_0x1c32('0x50')][_0x1c32('0x66')]=_0x25dfb3['id'];if(_0x5884b0[_0x1c32('0x44')][_0x1c32('0x69')]){_0x3d70c8[_0x1c32('0x50')]=_[_0x1c32('0x52')](_0x3d70c8[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x3d70c8[_0x1c32('0x47')],function(_0x25ff86){var _0x1a7705={};_0x1a7705[_0x25ff86]={'$like':'%'+_0x5884b0[_0x1c32('0x44')]['filter']+'%'};return _0x1a7705;})});}_0x3d70c8=_[_0x1c32('0x52')]({},_0x3d70c8,_0x5884b0['options']);return db[_0x1c32('0x6e')][_0x1c32('0x1f')]({'where':_0x3d70c8[_0x1c32('0x50')]})[_0x1c32('0xf')](function(_0x39f312){_0x97bde8[_0x1c32('0x1f')]=_0x39f312;if(_0x5884b0[_0x1c32('0x44')][_0x1c32('0x5c')]){_0x3d70c8[_0x1c32('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1c32('0x56')](_0x3d70c8);})[_0x1c32('0xf')](function(_0xd22d5f){_0x97bde8[_0x1c32('0x6a')]=_0xd22d5f;return _0x97bde8;});}})[_0x1c32('0xf')](respondWithFilteredResult(_0x46a5dd,_0x3d70c8))[_0x1c32('0x19')](handleError(_0x46a5dd,null));};exports[_0x1c32('0x70')]=function(_0x3a6c8a,_0x4421b4){return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x3a6c8a['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4421b4,null))[_0x1c32('0xf')](function(_0x127ae9){if(_0x127ae9){return _0x127ae9[_0x1c32('0x70')](_0x3a6c8a[_0x1c32('0x44')][_0x1c32('0x6c')]);}})[_0x1c32('0xf')](respondWithStatusCode(_0x4421b4,null))['catch'](handleError(_0x4421b4,null));};exports[_0x1c32('0x6f')]=function(_0x1618b9,_0x169324){var _0x1c9a93={'name':_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x25')],'key':_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x42')],'provider':_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x60')]===_0x1c32('0x5f')?null:_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x60')],'email':_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x71')],'ListId':_0x1618b9['body'][_0x1c32('0x72')],'active':!_[_0x1c32('0x73')](_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x74')])?_0x1618b9[_0x1c32('0x5e')][_0x1c32('0x74')]:!![],'description':_0x1618b9[_0x1c32('0x5e')]['description']||null};var _0x4886be=getAuthenticationOptions(_0x1c9a93[_0x1c32('0x60')],_0x1618b9[_0x1c32('0x5e')]);_0x1c9a93[_0x1c32('0x3a')]=_0x4886be['Imap'];_0x1c9a93[_0x1c32('0x3b')]=_0x4886be['Smtp'];return db[_0x1c32('0x54')][_0x1c32('0x6f')](_0x1c9a93,{'include':[{'model':db[_0x1c32('0x3d')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x1c32('0x3a')}]})['then'](function(_0x58156a){var _0xc81803=_0x1618b9[_0x1c32('0x30')][_0x1c32('0x23')]({'plain':!![]});if(!_0xc81803)throw new Error(_0x1c32('0x75'));if(_0xc81803[_0x1c32('0x76')]===_0x1c32('0x30')){var _0x214cc9=_0x58156a['get']({'plain':!![]});return db[_0x1c32('0x77')][_0x1c32('0x61')]({'where':{'name':_0x1c32('0x78'),'userProfileId':_0xc81803[_0x1c32('0x79')]},'raw':!![]})[_0x1c32('0xf')](function(_0x521259){if(_0x521259&&_0x521259[_0x1c32('0x7a')]===0x0){return db['UserProfileResource'][_0x1c32('0x6f')]({'name':_0x214cc9[_0x1c32('0x25')],'resourceId':_0x214cc9['id'],'type':_0x521259[_0x1c32('0x25')],'sectionId':_0x521259['id']},{})['then'](function(){return _0x58156a;});}else{return _0x58156a;}})[_0x1c32('0x19')](function(_0x226d57){logger[_0x1c32('0x14')](_0x1c32('0x7b'),_0x226d57);throw _0x226d57;});}return _0x58156a;})[_0x1c32('0xf')](respondWithResult(_0x169324,0xc9))[_0x1c32('0x19')](handleError(_0x169324,null));};exports[_0x1c32('0x7c')]=function(_0x41b5da,_0x396679){return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0x41b5da['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x396679,null))['then'](function(_0x449ca9){if(_0x449ca9){return _0x449ca9[_0x1c32('0x7c')]();}return null;})[_0x1c32('0xf')](respondWithResult(_0x396679,null))[_0x1c32('0x19')](handleError(_0x396679,null));};exports[_0x1c32('0x7e')]=function(_0x444075,_0x30e95f){if(_0x444075['body']['id']){delete _0x444075[_0x1c32('0x5e')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x444075[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x30e95f,null))[_0x1c32('0xf')](function(_0x59f46b){if(_0x59f46b){_0x444075[_0x1c32('0x5e')][_0x1c32('0x66')]=_0x59f46b['id'];return db[_0x1c32('0x59')][_0x1c32('0x6f')](_0x444075[_0x1c32('0x5e')]);}})[_0x1c32('0xf')](respondWithResult(_0x30e95f,null))[_0x1c32('0x19')](handleError(_0x30e95f,null));};exports['removeImap']=function(_0x2fcfa6,_0x3c43fe){return db[_0x1c32('0x54')]['findOne']({'where':{'id':_0x2fcfa6[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x3c43fe,null))['then'](function(_0x6caccc){if(_0x6caccc){return _0x6caccc[_0x1c32('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x3c43fe,null))[_0x1c32('0x19')](handleError(_0x3c43fe,null));};exports[_0x1c32('0x80')]=function(_0x31abcd,_0x1c9e1b){return db[_0x1c32('0x54')]['findOne']({'where':{'id':_0x31abcd['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x1c9e1b,null))[_0x1c32('0xf')](function(_0x3733fb){if(_0x3733fb){return _0x3733fb['getSmtp']();}return null;})['then'](respondWithResult(_0x1c9e1b,null))[_0x1c32('0x19')](handleError(_0x1c9e1b,null));};exports[_0x1c32('0x81')]=function(_0x3126bf,_0x5f2ba9){if(_0x3126bf[_0x1c32('0x5e')]['id']){delete _0x3126bf['body']['id'];}return db[_0x1c32('0x54')]['find']({'where':{'id':_0x3126bf['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x5f2ba9,null))['then'](function(_0xefa363){if(_0xefa363){_0x3126bf[_0x1c32('0x5e')][_0x1c32('0x66')]=_0xefa363['id'];return db['MailServerOut']['create'](_0x3126bf[_0x1c32('0x5e')]);}})[_0x1c32('0xf')](respondWithResult(_0x5f2ba9,null))[_0x1c32('0x19')](handleError(_0x5f2ba9,null));};exports[_0x1c32('0x82')]=function(_0xc37dda,_0x360a87){return db['MailAccount']['findOne']({'where':{'id':_0xc37dda[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x360a87,null))['then'](function(_0x5daad4){if(_0x5daad4){return _0x5daad4[_0x1c32('0x83')](null);}return null;})[_0x1c32('0xf')](respondWithStatusCode(_0x360a87,null))[_0x1c32('0x19')](handleError(_0x360a87,null));};exports[_0x1c32('0x84')]=function(_0x2e6c4f,_0x4126b5){return db[_0x1c32('0x85')][_0x1c32('0x61')]({'where':{'id':_0x2e6c4f[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4126b5,null))[_0x1c32('0xf')](function(_0x37a643){if(_0x37a643){return _0x37a643['addInteraction'](_0x2e6c4f[_0x1c32('0x5e')][_0x1c32('0x6c')],_[_0x1c32('0x86')](_0x2e6c4f[_0x1c32('0x5e')],['ids','id'])||{});}})[_0x1c32('0xf')](respondWithResult(_0x4126b5,null))['catch'](handleError(_0x4126b5,null));};exports[_0x1c32('0x87')]=function(_0xa8c95e,_0x4349b8){var _0x1a8048={'raw':![],'where':{}};var _0x27468c={};var _0xbf3534={'count':0x0,'rows':[]};return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0xa8c95e['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4349b8,null))[_0x1c32('0xf')](function(_0xf6688e){if(_0xf6688e){_0x27468c[_0x1c32('0x43')]=_[_0x1c32('0x45')](db[_0x1c32('0x85')]['rawAttributes']);_0x27468c[_0x1c32('0x44')]=_[_0x1c32('0x45')](_0xa8c95e['query']);_0x27468c['filters']=_[_0x1c32('0x46')](_0x27468c[_0x1c32('0x43')],_0x27468c[_0x1c32('0x44')]);_0x1a8048['attributes']=_[_0x1c32('0x46')](_0x27468c['model'],qs[_0x1c32('0x48')](_0xa8c95e['query']['fields']));_0x1a8048[_0x1c32('0x47')]=_0x1a8048['attributes']['length']?_0x1a8048['attributes']:_0x27468c[_0x1c32('0x43')];if(!_0xa8c95e['query'][_0x1c32('0x4a')](_0x1c32('0x4b'))){_0x1a8048['limit']=qs[_0x1c32('0x1e')](_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x1e')]);_0x1a8048[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x1c')]);}_0x1a8048['order']=qs[_0x1c32('0x4d')](_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x4d')]);_0x1a8048['where']=qs[_0x1c32('0x4e')](_['pick'](_0xa8c95e[_0x1c32('0x44')],_0x27468c[_0x1c32('0x4e')]));_0x1a8048[_0x1c32('0x50')][_0x1c32('0x66')]=_0xf6688e['id'];if(_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x69')]){_0x1a8048['where']=_['merge'](_0x1a8048['where'],{'$or':_[_0x1c32('0x3f')](_0x1a8048[_0x1c32('0x47')],function(_0x288520){var _0x449a9d={};_0x449a9d[_0x288520]={'$like':'%'+_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x69')]+'%'};return _0x449a9d;})});}_0x1a8048=_[_0x1c32('0x52')]({},_0x1a8048,_0xa8c95e[_0x1c32('0x53')]);return db[_0x1c32('0x85')][_0x1c32('0x1f')]({'where':_0x1a8048[_0x1c32('0x50')]})[_0x1c32('0xf')](function(_0x3b4ae7){_0xbf3534['count']=_0x3b4ae7;if(_0xa8c95e[_0x1c32('0x44')]['includeAll']){_0x1a8048[_0x1c32('0x55')]=[{'model':db[_0x1c32('0x88')],'as':_0x1c32('0x89'),'required':![]},{'model':db['User'],'as':_0x1c32('0x8a'),'attributes':[_0x1c32('0x25'),_0x1c32('0x8b'),_0x1c32('0x8c')],'required':![]},{'model':db[_0x1c32('0x8d')],'as':_0x1c32('0x8e'),'attributes':['id','name',_0x1c32('0x8f')],'where':_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x90')]?{'id':_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x90')]}:undefined,'required':_0xa8c95e[_0x1c32('0x44')][_0x1c32('0x90')]?!![]:![]}];}return db[_0x1c32('0x85')][_0x1c32('0x56')](_0x1a8048);})[_0x1c32('0xf')](function(_0x207d6b){_0xbf3534[_0x1c32('0x6a')]=_0x207d6b;return _0xbf3534;});}})[_0x1c32('0xf')](respondWithFilteredResult(_0x4349b8,_0x1a8048))[_0x1c32('0x19')](handleError(_0x4349b8,null));};exports[_0x1c32('0x91')]=function addApplications(_0x3b7e69,_0x427dd5){var _0x11fd95=_0x3b7e69['params']['id'];var _0x2c9194=_0x3b7e69['body'];var _0x5a8a94=0xc8;var _0x220ea0=null;return db[_0x1c32('0x92')]['transaction']({'isolationLevel':db[_0x1c32('0x92')]['Transaction'][_0x1c32('0x93')][_0x1c32('0x94')]},function(_0x25edb2){return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0x11fd95},'transaction':_0x25edb2})[_0x1c32('0xf')](function(_0x4aa9c0){if(_0x4aa9c0){return db[_0x1c32('0x95')][_0x1c32('0x22')]({'where':{'MailAccountId':_0x11fd95},'transaction':_0x25edb2})[_0x1c32('0xf')](function(){var _0x33a5ab=_[_0x1c32('0x3f')](_0x2c9194,function(_0x8a62a6){_0x8a62a6['MailAccountId']=_0x11fd95;return _0x8a62a6;});return db['MailApplication'][_0x1c32('0x96')](_0x33a5ab,{'transaction':_0x25edb2});});}else{_0x5a8a94=0x194;_0x220ea0=[];}});})[_0x1c32('0xf')](function(){if(_0x5a8a94!==0x194){return db[_0x1c32('0x95')][_0x1c32('0x97')]({'where':{'MailAccountId':_0x11fd95},'order':_0x1c32('0x98')})['then'](function(_0x1c9ee6){_0x220ea0=_0x1c9ee6;});}})[_0x1c32('0x19')](function(_0x9794a7){_0x5a8a94=0x1f4;logger[_0x1c32('0x14')](_0x9794a7[_0x1c32('0x99')]);if(_0x9794a7['name']){delete _0x9794a7[_0x1c32('0x25')];}_0x220ea0=_0x9794a7;})['finally'](function(){if(_0x220ea0===null){_0x427dd5[_0x1c32('0x24')](_0x5a8a94);}else{if(_0x5a8a94===0x1f4){_0x427dd5[_0x1c32('0x1b')](_0x5a8a94)[_0x1c32('0x26')](_0x220ea0);}else{_0x427dd5[_0x1c32('0x1b')](_0x5a8a94)[_0x1c32('0x21')](_0x220ea0);}}});};exports[_0x1c32('0x9a')]=function(_0xcd9470,_0x10942b){var _0x5af372={};var _0x527eed={};var _0x244272;var _0x49c397;return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0xcd9470[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x10942b,null))[_0x1c32('0xf')](function(_0x9b4214){if(_0x9b4214){_0x244272=_0x9b4214;_0x527eed[_0x1c32('0x43')]=_[_0x1c32('0x45')](db[_0x1c32('0x95')][_0x1c32('0x5b')]);_0x527eed[_0x1c32('0x44')]=_['keys'](_0xcd9470[_0x1c32('0x44')]);_0x527eed[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0x527eed['model'],_0x527eed[_0x1c32('0x44')]);_0x5af372[_0x1c32('0x47')]=_[_0x1c32('0x46')](_0x527eed[_0x1c32('0x43')],qs[_0x1c32('0x48')](_0xcd9470[_0x1c32('0x44')]['fields']));_0x5af372[_0x1c32('0x47')]=_0x5af372[_0x1c32('0x47')][_0x1c32('0x49')]?_0x5af372[_0x1c32('0x47')]:_0x527eed[_0x1c32('0x43')];_0x5af372[_0x1c32('0x4c')]=qs[_0x1c32('0x4d')](_0xcd9470[_0x1c32('0x44')][_0x1c32('0x4d')]);_0x5af372[_0x1c32('0x50')]=qs[_0x1c32('0x4e')](_[_0x1c32('0x4f')](_0xcd9470[_0x1c32('0x44')],_0x527eed[_0x1c32('0x4e')]));if(_0xcd9470[_0x1c32('0x44')][_0x1c32('0x69')]){_0x5af372[_0x1c32('0x50')]=_[_0x1c32('0x52')](_0x5af372[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x5af372[_0x1c32('0x47')],function(_0x23ef91){var _0x3a8890={};_0x3a8890[_0x23ef91]={'$like':'%'+_0xcd9470['query'][_0x1c32('0x69')]+'%'};return _0x3a8890;})});}_0x5af372=_[_0x1c32('0x52')]({},_0x5af372,_0xcd9470[_0x1c32('0x53')]);return _0x244272[_0x1c32('0x9a')](_0x5af372);}})[_0x1c32('0xf')](function(_0x112f3b){if(_0x112f3b){_0x49c397=_0x112f3b[_0x1c32('0x49')];if(!_0xcd9470['query']['hasOwnProperty'](_0x1c32('0x4b'))){_0x5af372['limit']=qs[_0x1c32('0x1e')](_0xcd9470[_0x1c32('0x44')][_0x1c32('0x1e')]);_0x5af372[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0xcd9470[_0x1c32('0x44')][_0x1c32('0x1c')]);}return _0x244272[_0x1c32('0x9a')](_0x5af372);}})['then'](function(_0xda9617){if(_0xda9617){return _0xda9617?{'count':_0x49c397,'rows':_0xda9617}:null;}})['then'](respondWithResult(_0x10942b,null))[_0x1c32('0x19')](handleError(_0x10942b,null));};exports[_0x1c32('0x9b')]=function(_0x325d88,_0x5d101b){var _0x200a51={'raw':!![],'where':{}};var _0xb84f3d={};var _0xd90032={'count':0x0,'rows':[]};return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0x325d88[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x5d101b,null))[_0x1c32('0xf')](function(_0x199bcc){if(_0x199bcc){_0xb84f3d['model']=_[_0x1c32('0x45')](db[_0x1c32('0x9c')][_0x1c32('0x5b')]);_0xb84f3d[_0x1c32('0x44')]=_[_0x1c32('0x45')](_0x325d88['query']);_0xb84f3d[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0xb84f3d[_0x1c32('0x43')],_0xb84f3d['query']);_0x200a51[_0x1c32('0x47')]=_[_0x1c32('0x46')](_0xb84f3d[_0x1c32('0x43')],qs[_0x1c32('0x48')](_0x325d88[_0x1c32('0x44')][_0x1c32('0x48')]));_0x200a51[_0x1c32('0x47')]=_0x200a51[_0x1c32('0x47')][_0x1c32('0x49')]?_0x200a51[_0x1c32('0x47')]:_0xb84f3d[_0x1c32('0x43')];if(!_0x325d88[_0x1c32('0x44')][_0x1c32('0x4a')]('nolimit')){_0x200a51[_0x1c32('0x1e')]=qs[_0x1c32('0x1e')](_0x325d88[_0x1c32('0x44')][_0x1c32('0x1e')]);_0x200a51[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0x325d88[_0x1c32('0x44')][_0x1c32('0x1c')]);}_0x200a51[_0x1c32('0x4c')]=qs[_0x1c32('0x4d')](_0x325d88[_0x1c32('0x44')][_0x1c32('0x4d')]);_0x200a51[_0x1c32('0x50')]=qs['filters'](_[_0x1c32('0x4f')](_0x325d88[_0x1c32('0x44')],_0xb84f3d[_0x1c32('0x4e')]));_0x200a51[_0x1c32('0x50')]['MailAccountId']=_0x199bcc['id'];if(_0x325d88[_0x1c32('0x44')][_0x1c32('0x69')]){_0x200a51[_0x1c32('0x50')]=_[_0x1c32('0x52')](_0x200a51[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x200a51[_0x1c32('0x47')],function(_0x1f3d5d){var _0x189c88={};_0x189c88[_0x1f3d5d]={'$like':'%'+_0x325d88[_0x1c32('0x44')][_0x1c32('0x69')]+'%'};return _0x189c88;})});}if(_0x325d88[_0x1c32('0x44')]['$gte']){var _0x1e7776=_0x325d88[_0x1c32('0x44')][_0x1c32('0x9d')][_0x1c32('0x9e')](',');var _0x139e93={};_0x139e93[_0x1e7776[0x0]]={'$gte':moment(_0x1e7776[0x1])['format'](_0x1c32('0x9f'))};_0x200a51['where']=_['merge'](_0x200a51[_0x1c32('0x50')],_0x139e93);}_0x200a51=_[_0x1c32('0x52')]({},_0x200a51,_0x325d88[_0x1c32('0x53')]);return db[_0x1c32('0x9c')][_0x1c32('0x1f')]({'where':_0x200a51[_0x1c32('0x50')]})['then'](function(_0x2c8485){_0xd90032['count']=_0x2c8485;if(_0x325d88[_0x1c32('0x44')][_0x1c32('0x5c')]){_0x200a51['include']=[{'all':!![]}];}return db['MailMessage'][_0x1c32('0x56')](_0x200a51);})[_0x1c32('0xf')](function(_0x1d4cc6){if(_0x325d88[_0x1c32('0x44')][_0x1c32('0xa0')]==='true'){for(var _0x237375=0x0;_0x237375<_0x1d4cc6['length'];_0x237375++){_0x1d4cc6[_0x237375][_0x1c32('0x5e')]=juice(_0x1d4cc6[_0x237375][_0x1c32('0x5e')]);}}_0xd90032[_0x1c32('0x6a')]=_0x1d4cc6;return _0xd90032;});}})[_0x1c32('0xf')](respondWithFilteredResult(_0x5d101b,_0x200a51))[_0x1c32('0x19')](handleError(_0x5d101b,null));};exports[_0x1c32('0x26')]=function(_0x55dfbb,_0x4d1c72){var _0x3b2345,_0x18c075={},_0x3102c5;if(_0x55dfbb['body']['to']){_0x3102c5=_0x55dfbb[_0x1c32('0x5e')]['to'][_0x1c32('0x9e')](',')[0x0];}return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x55dfbb[_0x1c32('0x58')]['id']},'include':[{'model':db[_0x1c32('0xa1')],'as':_0x1c32('0xa2'),'include':[{'model':db[_0x1c32('0x88')],'as':_0x1c32('0xa3'),'where':{'email':_0x3102c5},'limit':0x1,'order':[[_0x1c32('0xa4'),_0x1c32('0xa5')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1c32('0xa6')],'as':_0x1c32('0xa6'),'raw':!![]}]}]})[_0x1c32('0xf')](handleEntityNotFound(_0x4d1c72,null))['then'](function(_0x416026){if(!_0x416026)return;_0x3b2345=_0x416026;if(!_0x416026['Smtp'])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x1c32('0x73')](_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa7')])){_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa7')]=util['format'](_0x1c32('0xa8'),_0x416026[_0x1c32('0x25')],_0x416026['email']||_0x416026['Smtp']['user']);}if(_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa9')]&&_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa9')][_0x1c32('0x49')]){for(var _0x18eca6=0x0;_0x18eca6<_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa9')][_0x1c32('0x49')];_0x18eca6+=0x1){_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa9')][_0x18eca6]={'filename':_0x55dfbb['body'][_0x1c32('0xa9')][_0x18eca6][_0x1c32('0x25')],'path':path[_0x1c32('0xaa')](config['root'],_0x1c32('0xab'),_0x55dfbb[_0x1c32('0x5e')]['attachments'][_0x18eca6][_0x1c32('0xac')])};}}var _0x3ebaaa=_0x416026[_0x1c32('0xad')]();return respondWithRpcPromise(_0x1c32('0xae'),_0x1c32('0xaf'),{'account':_0x3ebaaa,'message':_0x55dfbb[_0x1c32('0x5e')]});})[_0x1c32('0xf')](function(_0x3b0657){if(!_0x3b0657)return;_0x18c075=_0x3b0657;if(!_0x3b2345[_0x1c32('0xa2')])throw new Error(_0x1c32('0xb0'));if(_0x3b2345[_0x1c32('0xa2')][_0x1c32('0xa3')]['length'])return _0x3b2345[_0x1c32('0xa2')]['Contacts'][0x0];return db[_0x1c32('0x88')][_0x1c32('0x6f')](_[_0x1c32('0xb1')](_0x55dfbb['body'],{'firstName':_0x55dfbb[_0x1c32('0x5e')]['to'],'email':_0x55dfbb[_0x1c32('0x5e')]['to'],'phone':_0x55dfbb[_0x1c32('0x5e')]['to'],'ListId':_0x3b2345[_0x1c32('0x72')]}));})[_0x1c32('0xf')](function(_0x4078b2){if(!_0x4078b2)return;var _0xc82a7a={'UserId':_0x55dfbb[_0x1c32('0x30')]['id'],'ContactId':_0x4078b2['id'],'MailAccountId':_0x3b2345['id'],'inReplyTo':_0x18c075['messageId'],'to':_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xa7')],'cc':_0x55dfbb['body']['cc'],'subject':_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xb2')],'attach':_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xb3')],'firstMsgDirection':_0x1c32('0xb4'),'lastMsgAt':moment()[_0x1c32('0xb5')](_0x1c32('0x9f')),'lastMsgDirection':_0x1c32('0xb4'),'Messages':[_['merge'](_0x55dfbb['body'],{'messageId':_0x18c075[_0x1c32('0xb6')],'sentAt':moment()['format'](_0x1c32('0x9f')),'read':!![],'MailAccountId':_0x3b2345['id'],'UserId':_0x55dfbb[_0x1c32('0x30')]['id'],'ContactId':_0x4078b2['id']})]};if(_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xb7')]){_0xc82a7a=_[_0x1c32('0x52')](_0xc82a7a,_0x55dfbb[_0x1c32('0x5e')][_0x1c32('0xb7')]);}return db[_0x1c32('0x85')]['create'](_0xc82a7a,{'include':[{'model':db[_0x1c32('0x9c')],'as':_0x1c32('0xb8')}]});})[_0x1c32('0xf')](respondWithResult(_0x4d1c72,null))[_0x1c32('0x19')](handleError(_0x4d1c72,null));};exports[_0x1c32('0xb9')]=function(_0x2d859c,_0x365ca4){return db[_0x1c32('0x54')][_0x1c32('0x61')]({'where':{'id':_0x2d859c[_0x1c32('0x58')]['id']},'include':[{'model':db[_0x1c32('0x3d')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1c32('0xa6')],'as':_0x1c32('0xa6'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x365ca4,null))[_0x1c32('0xf')](function(_0x31f0b0){if(!_0x31f0b0[_0x1c32('0x3b')])return;var _0x154634=_0x31f0b0[_0x1c32('0xad')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x154634});})[_0x1c32('0xf')](respondWithResult(_0x365ca4,null))[_0x1c32('0x19')](handleError(_0x365ca4,null));};exports['destroy']=function(_0x296f34,_0x11c84d){return db['MailAccount'][_0x1c32('0x61')]({'where':{'id':_0x296f34['params']['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x11c84d,null))[_0x1c32('0xf')](function(_0x126b1a){if(_0x126b1a&&_0x126b1a[_0x1c32('0x63')]){throw new db['Sequelize'][(_0x1c32('0xba'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x126b1a;})['then'](removeEntity(_0x11c84d,null))['catch'](handleError(_0x11c84d,null));};exports['addAgents']=function(_0x1ab758,_0x4c07d9){return db[_0x1c32('0x54')]['find']({'where':{'id':_0x1ab758[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0x4c07d9,null))[_0x1c32('0xf')](function(_0x320a38){if(_0x320a38){return _0x320a38[_0x1c32('0xbb')](_0x1ab758[_0x1c32('0x5e')]['ids'],_['omit'](_0x1ab758[_0x1c32('0x5e')],[_0x1c32('0x6c'),'id'])||{})[_0x1c32('0xbc')](function(_0x482f6a){for(var _0x5ab420=0x0;_0x5ab420<_0x1ab758[_0x1c32('0x5e')][_0x1c32('0x6c')][_0x1c32('0x49')];_0x5ab420+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x1ab758[_0x1c32('0x5e')][_0x1c32('0x6c')][_0x5ab420]),'MailAccountId':Number(_0x1ab758[_0x1c32('0x58')]['id'])});}return _0x482f6a;});}})[_0x1c32('0xf')](respondWithResult(_0x4c07d9,null))[_0x1c32('0x19')](handleError(_0x4c07d9,null));};exports[_0x1c32('0xbd')]=function(_0x50763e,_0x2a8d1d){return db['MailAccount']['find']({'where':{'id':_0x50763e[_0x1c32('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a8d1d,null))[_0x1c32('0xf')](function(_0x37d684){if(_0x37d684){return _0x37d684[_0x1c32('0xbd')](_0x50763e[_0x1c32('0x44')][_0x1c32('0x6c')])['then'](function(){if(_[_0x1c32('0xbe')](_0x50763e[_0x1c32('0x44')][_0x1c32('0x6c')])){for(var _0x19c510=0x0;_0x19c510<_0x50763e[_0x1c32('0x44')][_0x1c32('0x6c')][_0x1c32('0x49')];_0x19c510+=0x1){socket[_0x1c32('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x50763e[_0x1c32('0x44')]['ids'][_0x19c510]),'MailAccountId':Number(_0x50763e[_0x1c32('0x58')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x50763e['query']['ids']),'MailAccountId':Number(_0x50763e[_0x1c32('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a8d1d,null))[_0x1c32('0x19')](handleError(_0x2a8d1d,null));};exports['getAgents']=function(_0x32e397,_0xe64e6b){var _0x4618e5={};var _0x32932b={};var _0x218547;var _0xbf55f3;return db[_0x1c32('0x54')][_0x1c32('0x7d')]({'where':{'id':_0x32e397[_0x1c32('0x58')]['id']}})[_0x1c32('0xf')](handleEntityNotFound(_0xe64e6b,null))[_0x1c32('0xf')](function(_0x35ffc0){if(_0x35ffc0){_0x218547=_0x35ffc0;_0x32932b['model']=_[_0x1c32('0x45')](db[_0x1c32('0xc0')][_0x1c32('0x5b')]);_0x32932b[_0x1c32('0x44')]=_[_0x1c32('0x45')](_0x32e397[_0x1c32('0x44')]);_0x32932b[_0x1c32('0x4e')]=_[_0x1c32('0x46')](_0x32932b['model'],_0x32932b['query']);_0x4618e5['attributes']=_['intersection'](_0x32932b[_0x1c32('0x43')],qs[_0x1c32('0x48')](_0x32e397[_0x1c32('0x44')][_0x1c32('0x48')]));_0x4618e5[_0x1c32('0x47')]=_0x4618e5['attributes'][_0x1c32('0x49')]?_0x4618e5[_0x1c32('0x47')]:_0x32932b[_0x1c32('0x43')];_0x4618e5[_0x1c32('0x4c')]=qs['sort'](_0x32e397['query'][_0x1c32('0x4d')]);_0x4618e5[_0x1c32('0x50')]=qs[_0x1c32('0x4e')](_[_0x1c32('0x4f')](_0x32e397['query'],_0x32932b[_0x1c32('0x4e')]));if(_0x32e397[_0x1c32('0x44')]['filter']){_0x4618e5[_0x1c32('0x50')]=_[_0x1c32('0x52')](_0x4618e5[_0x1c32('0x50')],{'$or':_[_0x1c32('0x3f')](_0x4618e5[_0x1c32('0x47')],function(_0x3d13f3){var _0x3589df={};_0x3589df[_0x3d13f3]={'$like':'%'+_0x32e397[_0x1c32('0x44')]['filter']+'%'};return _0x3589df;})});}_0x4618e5=_[_0x1c32('0x52')]({},_0x4618e5,_0x32e397[_0x1c32('0x53')]);return _0x218547[_0x1c32('0xc1')](_0x4618e5);}})['then'](function(_0x4a7f7e){if(_0x4a7f7e){_0xbf55f3=_0x4a7f7e[_0x1c32('0x49')];if(!_0x32e397[_0x1c32('0x44')]['hasOwnProperty']('nolimit')){_0x4618e5[_0x1c32('0x1e')]=qs[_0x1c32('0x1e')](_0x32e397['query'][_0x1c32('0x1e')]);_0x4618e5[_0x1c32('0x1c')]=qs[_0x1c32('0x1c')](_0x32e397['query']['offset']);}return _0x218547[_0x1c32('0xc1')](_0x4618e5);}})[_0x1c32('0xf')](function(_0x174699){if(_0x174699){return _0x174699?{'count':_0xbf55f3,'rows':_0x174699}:null;}})[_0x1c32('0xf')](respondWithResult(_0xe64e6b,null))[_0x1c32('0x19')](handleError(_0xe64e6b,null));}; \ No newline at end of file +var _0xd86c=['VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','./mailAccount.socket','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','code','error','message','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','then','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','yahoo','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','Pause','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','show','params','mandatoryDispositionPause','body','custom','provider','secure','find','Mail\x20Account\x20not\x20found','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','findOne','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','ListId','isNil','active','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','omit','CmContact','User','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','split','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','out','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd86c,0xc5));var _0xcd86=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xd86c[_0x22b68a];return _0x1ac67a;};'use strict';var moment=require(_0xcd86('0x0'));var BPromise=require(_0xcd86('0x1'));var util=require(_0xcd86('0x2'));var path=require(_0xcd86('0x3'));var _=require(_0xcd86('0x4'));var juice=require(_0xcd86('0x5'));var Redis=require(_0xcd86('0x6'));var qs=require(_0xcd86('0x7'));var logger=require(_0xcd86('0x8'))('api');var config=require(_0xcd86('0x9'));var db=require(_0xcd86('0xa'))['db'];config[_0xcd86('0xb')]=_[_0xcd86('0xc')](config[_0xcd86('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd86('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcd86('0xe')]({'port':0x232b});function respondWithRpcPromise(_0xb1a3bc,_0x26eb4f,_0x2a4aba,_0x4d970a){return new BPromise(function(_0x464b7c,_0x4f633c){var _0x58df76=_0x4d970a||client;return _0x58df76['request'](_0xb1a3bc,_0x2a4aba)['then'](function(_0x2adf70){logger[_0xcd86('0xf')](_0xcd86('0x10'),_0x26eb4f,_0xcd86('0x11'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x26eb4f,_0xcd86('0x11'),JSON['stringify'](_0x2adf70));if(_0x2adf70['error']){if(_0x2adf70['error'][_0xcd86('0x12')]===0x1f4){logger[_0xcd86('0x13')](_0xcd86('0x10'),_0x26eb4f,_0x2adf70['error'][_0xcd86('0x14')]);return _0x4f633c(_0x2adf70[_0xcd86('0x13')][_0xcd86('0x14')]);}logger[_0xcd86('0x13')](_0xcd86('0x10'),_0x26eb4f,_0x2adf70[_0xcd86('0x13')][_0xcd86('0x14')]);return _0x464b7c(_0x2adf70[_0xcd86('0x13')][_0xcd86('0x14')]);}else{logger[_0xcd86('0xf')](_0xcd86('0x10'),_0x26eb4f,_0xcd86('0x11'));_0x464b7c(_0x2adf70['result'][_0xcd86('0x14')]);}})[_0xcd86('0x15')](function(_0x96f8dd){logger[_0xcd86('0x13')](_0xcd86('0x10'),_0x26eb4f,_0x96f8dd);_0x4f633c(_0x96f8dd);});});}function respondWithStatusCode(_0x42ee4f,_0x43fd50){_0x43fd50=_0x43fd50||0xcc;return function(_0x58d091){if(_0x58d091){return _0x42ee4f[_0xcd86('0x16')](_0x43fd50);}return _0x42ee4f[_0xcd86('0x17')](_0x43fd50)['end']();};}function respondWithResult(_0x42d7b2,_0x467b43){_0x467b43=_0x467b43||0xc8;return function(_0x450308){if(_0x450308){return _0x42d7b2[_0xcd86('0x17')](_0x467b43)[_0xcd86('0x18')](_0x450308);}};}function respondWithFilteredResult(_0x599a70,_0xb899e8){return function(_0x5db7c8){if(_0x5db7c8){var _0x44c451=typeof _0xb899e8[_0xcd86('0x19')]==='undefined'&&typeof _0xb899e8[_0xcd86('0x1a')]===_0xcd86('0x1b');var _0x329bab=_0x5db7c8[_0xcd86('0x1c')];var _0x2fbbdf=_0x44c451?0x0:_0xb899e8[_0xcd86('0x19')];var _0x5c100d=_0x44c451?_0x5db7c8[_0xcd86('0x1c')]:_0xb899e8[_0xcd86('0x19')]+_0xb899e8[_0xcd86('0x1a')];var _0x3e58a0;if(_0x5c100d>=_0x329bab){_0x5c100d=_0x329bab;_0x3e58a0=0xc8;}else{_0x3e58a0=0xce;}_0x599a70[_0xcd86('0x17')](_0x3e58a0);return _0x599a70['set'](_0xcd86('0x1d'),_0x2fbbdf+'-'+_0x5c100d+'/'+_0x329bab)['json'](_0x5db7c8);}return null;};}function saveUpdates(_0x29e5f1){return function(_0x2c437a){if(_0x2c437a){return _0x2c437a['update'](_0x29e5f1)[_0xcd86('0x1e')](function(_0x2700b8){return _0x2700b8;});}return null;};}function removeEntity(_0x22ce4c){return function(_0x4f1ae8){if(_0x4f1ae8){return _0x4f1ae8[_0xcd86('0x1f')]()[_0xcd86('0x1e')](function(){var _0x2a5e35=_0x4f1ae8[_0xcd86('0x20')]({'plain':!![]});var _0x153227=_0xcd86('0x21');return db[_0xcd86('0x22')][_0xcd86('0x1f')]({'where':{'type':_0x153227,'resourceId':_0x2a5e35['id']}})[_0xcd86('0x1e')](function(){return _0x4f1ae8;});})[_0xcd86('0x1e')](function(){_0x22ce4c[_0xcd86('0x17')](0xcc)[_0xcd86('0x23')]();});}};}function handleEntityNotFound(_0x2d0f3d){return function(_0x52a889){if(!_0x52a889){_0x2d0f3d['sendStatus'](0x194);}return _0x52a889;};}function handleError(_0x22f34b,_0x470c73){_0x470c73=_0x470c73||0x1f4;return function(_0x5a4a7){logger[_0xcd86('0x13')](_0x5a4a7[_0xcd86('0x24')]);if(_0x5a4a7[_0xcd86('0x25')]){delete _0x5a4a7[_0xcd86('0x25')];}_0x22f34b[_0xcd86('0x17')](_0x470c73)[_0xcd86('0x26')](_0x5a4a7);};}function getImapHost(_0x21c797){switch(_0x21c797){case _0xcd86('0x27'):return _0xcd86('0x28');case'yahoo':return _0xcd86('0x29');case'hotmail':return _0xcd86('0x2a');case _0xcd86('0x2b'):return _0xcd86('0x2c');}throw new Error('Unknown\x20email\x20service\x20provider',_0x21c797);}function getSmtpHost(_0x27fbab){switch(_0x27fbab){case'gmail':return'smtp.gmail.com';case _0xcd86('0x2d'):return _0xcd86('0x2e');case _0xcd86('0x2f'):return _0xcd86('0x30');case _0xcd86('0x2b'):return _0xcd86('0x31');}throw new Error(_0xcd86('0x32'),_0x27fbab);}function getAuthenticationOptions(_0x12dcfa,_0x33efba){var _0x54810f={};var _0x381044={};if(_0x12dcfa){_0x54810f[_0xcd86('0x33')]=_0x381044[_0xcd86('0x33')]=_0x33efba[_0xcd86('0x34')];_0x54810f[_0xcd86('0x35')]=_0x381044[_0xcd86('0x36')]=_0x33efba[_0xcd86('0x35')];if(_0x33efba[_0xcd86('0x37')]){_0x54810f[_0xcd86('0x37')]=_0x381044['modernAuthentication']=!![];_0x54810f[_0xcd86('0x38')]=_0x381044[_0xcd86('0x38')]=_0x33efba[_0xcd86('0x38')];_0x54810f[_0xcd86('0x35')]=_0x381044[_0xcd86('0x36')]=null;}else{_0x54810f[_0xcd86('0x38')]=_0x381044[_0xcd86('0x38')]=null;}_0x54810f[_0xcd86('0x39')]=getImapHost(_0x12dcfa);_0x54810f[_0xcd86('0x3a')]=0x3e1;_0x381044[_0xcd86('0x39')]=getSmtpHost(_0x12dcfa);_0x381044['port']=0x24b;_0x381044['secure']=![];_0x54810f['service']=_0x381044[_0xcd86('0x3b')]=null;}else{if(_0x33efba[_0xcd86('0x3c')]){_0x54810f[_0xcd86('0x33')]=_0x381044[_0xcd86('0x33')]=_0x33efba[_0xcd86('0x34')];_0x54810f[_0xcd86('0x35')]=_0x381044[_0xcd86('0x36')]=_0x33efba['password'];}else{_0x54810f[_0xcd86('0x3c')]=_0x381044[_0xcd86('0x3c')]=![];_0x54810f[_0xcd86('0x33')]=_0x381044[_0xcd86('0x33')]=null;_0x54810f['password']=_0x381044[_0xcd86('0x36')]=null;}_0x54810f[_0xcd86('0x39')]=_0x33efba[_0xcd86('0x3d')][_0xcd86('0x39')];_0x54810f[_0xcd86('0x3a')]=_0x33efba['Imap'][_0xcd86('0x3a')];_0x381044[_0xcd86('0x39')]=_0x33efba[_0xcd86('0x3e')][_0xcd86('0x39')];_0x381044['port']=_0x33efba[_0xcd86('0x3e')]['port'];}return{'Imap':_0x54810f,'Smtp':_0x381044};}exports[_0xcd86('0x3f')]=function(_0x5ed4f4,_0x1283b7){var _0x13b0eb={'include':[{'model':db[_0xcd86('0x40')],'as':_0xcd86('0x3d')},{'model':db['MailServerOut'],'as':_0xcd86('0x3e')},{'model':db[_0xcd86('0x41')],'as':'mandatoryDispositionPause'}]},_0x2341f4={},_0x2da7c3={'count':0x0,'rows':[]};var _0x1e4616=_[_0xcd86('0x42')](db['MailAccount'][_0xcd86('0x43')],function(_0x3e34e3){return{'name':_0x3e34e3[_0xcd86('0x44')],'type':_0x3e34e3[_0xcd86('0x45')][_0xcd86('0x46')]};});_0x2341f4['model']=_[_0xcd86('0x42')](_0x1e4616,_0xcd86('0x25'));_0x2341f4['query']=_[_0xcd86('0x47')](_0x5ed4f4['query']);_0x2341f4[_0xcd86('0x48')]=_[_0xcd86('0x49')](_0x2341f4[_0xcd86('0x4a')],_0x2341f4[_0xcd86('0x4b')]);_0x13b0eb[_0xcd86('0x4c')]=_[_0xcd86('0x49')](_0x2341f4[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x13b0eb[_0xcd86('0x4c')]=_0x13b0eb[_0xcd86('0x4c')][_0xcd86('0x4e')]?_0x13b0eb[_0xcd86('0x4c')]:_0x2341f4[_0xcd86('0x4a')];if(!_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x4f')](_0xcd86('0x50'))){_0x13b0eb['limit']=qs[_0xcd86('0x1a')](_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x1a')]);_0x13b0eb[_0xcd86('0x19')]=qs['offset'](_0x5ed4f4[_0xcd86('0x4b')]['offset']);}_0x13b0eb[_0xcd86('0x51')]=qs['sort'](_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x52')]);_0x13b0eb[_0xcd86('0x53')]=qs[_0xcd86('0x48')](_[_0xcd86('0x54')](_0x5ed4f4[_0xcd86('0x4b')],_0x2341f4[_0xcd86('0x48')]),_0x1e4616);if(_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x13b0eb[_0xcd86('0x53')]=_[_0xcd86('0x56')](_0x13b0eb[_0xcd86('0x53')],{'$or':_[_0xcd86('0x42')](_0x1e4616,function(_0x59be46){if(_0x59be46[_0xcd86('0x45')]!==_0xcd86('0x57')){var _0x13520b={};_0x13520b[_0x59be46[_0xcd86('0x25')]]={'$like':'%'+_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x55')]+'%'};return _0x13520b;}})});}_0x13b0eb=_[_0xcd86('0x56')]({},_0x13b0eb,_0x5ed4f4[_0xcd86('0x58')]);var _0x2f31fc={'where':_0x13b0eb[_0xcd86('0x53')]};return db[_0xcd86('0x59')][_0xcd86('0x1c')](_0x2f31fc)['then'](function(_0xbce39b){_0x2da7c3[_0xcd86('0x1c')]=_0xbce39b;if(_0x5ed4f4[_0xcd86('0x4b')][_0xcd86('0x5a')]){_0x13b0eb[_0xcd86('0x5b')]=[{'all':!![]}];}return db[_0xcd86('0x59')][_0xcd86('0x5c')](_0x13b0eb);})[_0xcd86('0x1e')](function(_0x41f823){_0x2da7c3['rows']=_0x41f823;return _0x2da7c3;})[_0xcd86('0x1e')](respondWithFilteredResult(_0x1283b7,_0x13b0eb))['catch'](handleError(_0x1283b7,null));};exports[_0xcd86('0x5d')]=function(_0x46b62a,_0x38cbea){var _0xab16c5={'raw':![],'where':{'id':_0x46b62a[_0xcd86('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xcd86('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xcd86('0x41')],'as':_0xcd86('0x5f')}]},_0xc13948={};_0xc13948[_0xcd86('0x4a')]=_[_0xcd86('0x47')](db['MailAccount'][_0xcd86('0x43')]);_0xc13948[_0xcd86('0x4b')]=_[_0xcd86('0x47')](_0x46b62a['query']);_0xc13948[_0xcd86('0x48')]=_[_0xcd86('0x49')](_0xc13948[_0xcd86('0x4a')],_0xc13948[_0xcd86('0x4b')]);_0xab16c5[_0xcd86('0x4c')]=_[_0xcd86('0x49')](_0xc13948[_0xcd86('0x4a')],qs['fields'](_0x46b62a[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0xab16c5[_0xcd86('0x4c')]=_0xab16c5[_0xcd86('0x4c')][_0xcd86('0x4e')]?_0xab16c5[_0xcd86('0x4c')]:_0xc13948[_0xcd86('0x4a')];if(_0x46b62a[_0xcd86('0x4b')][_0xcd86('0x5a')]){_0xab16c5[_0xcd86('0x5b')]=[{'all':!![]}];}_0xab16c5=_[_0xcd86('0x56')]({},_0xab16c5,_0x46b62a[_0xcd86('0x58')]);return db[_0xcd86('0x59')]['find'](_0xab16c5)['then'](handleEntityNotFound(_0x38cbea,null))[_0xcd86('0x1e')](respondWithResult(_0x38cbea,null))['catch'](handleError(_0x38cbea,null));};exports['update']=function(_0x5410b5,_0x15a491){if(_0x5410b5[_0xcd86('0x60')]['id']){delete _0x5410b5[_0xcd86('0x60')]['id'];}var _0x164346=_0x5410b5[_0xcd86('0x60')]['provider']===_0xcd86('0x61')?null:_0x5410b5[_0xcd86('0x60')][_0xcd86('0x62')];var _0x862718=_0x5410b5[_0xcd86('0x60')]['Imap']||{};var _0x3b3b6d=_0x5410b5['body'][_0xcd86('0x3e')]||{};if(_0x164346){_0x862718[_0xcd86('0x39')]=getImapHost(_0x164346);_0x862718[_0xcd86('0x3a')]=0x3e1;_0x3b3b6d[_0xcd86('0x39')]=getSmtpHost(_0x164346);_0x3b3b6d['port']=0x24b;_0x3b3b6d[_0xcd86('0x63')]=![];}if(_0x3b3b6d['modernAuthentication']){_0x3b3b6d[_0xcd86('0x63')]=![];}else{_0x3b3b6d['CloudProviderId']=null;}if(!_0x862718[_0xcd86('0x37')])_0x862718[_0xcd86('0x38')]=null;_0x5410b5['body'][_0xcd86('0x3d')]=_0x862718;_0x5410b5['body'][_0xcd86('0x3e')]=_0x3b3b6d;return db['MailAccount'][_0xcd86('0x64')]({'where':{'id':_0x5410b5[_0xcd86('0x5e')]['id']},'include':[{'model':db[_0xcd86('0x40')],'as':_0xcd86('0x3d')},{'model':db['MailServerOut'],'as':_0xcd86('0x3e')},{'model':db[_0xcd86('0x41')],'as':_0xcd86('0x5f')}]})[_0xcd86('0x1e')](handleEntityNotFound(_0x15a491,null))['then'](function(_0x3fc92d){if(!_0x3fc92d)throw new Error(_0xcd86('0x65'));if(_0x3fc92d[_0xcd86('0x3b')])delete _0x5410b5[_0xcd86('0x60')][_0xcd86('0x3d')];return _0x3fc92d;})[_0xcd86('0x1e')](saveUpdates(_0x5410b5['body'],null))[_0xcd86('0x1e')](function(_0x2cbd45){if(!_0x5410b5[_0xcd86('0x60')][_0xcd86('0x3d')])return _0x2cbd45;return db[_0xcd86('0x40')]['update'](_0x5410b5[_0xcd86('0x60')][_0xcd86('0x3d')],{'where':{'MailAccountId':_0x2cbd45['id']}})[_0xcd86('0x1e')](function(){return _0x2cbd45;});})['then'](function(_0x12c20d){if(!_0x5410b5[_0xcd86('0x60')][_0xcd86('0x3e')])return _0x12c20d;return db[_0xcd86('0x66')]['update'](_0x5410b5[_0xcd86('0x60')][_0xcd86('0x3e')],{'where':{'MailAccountId':_0x12c20d['id']}})[_0xcd86('0x1e')](function(){return _0x12c20d;});})['then'](respondWithResult(_0x15a491,null))[_0xcd86('0x15')](handleError(_0x15a491,null));};exports[_0xcd86('0x67')]=function(_0x1b5681,_0x1a477c){return db[_0xcd86('0x59')][_0xcd86('0x67')]()['then'](respondWithResult(_0x1a477c,null))[_0xcd86('0x15')](handleError(_0x1a477c,null));};exports[_0xcd86('0x68')]=function(_0x3eb0d6,_0x5b32c9){if(_0x3eb0d6[_0xcd86('0x60')]['id']){delete _0x3eb0d6['body']['id'];}return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x3eb0d6[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x5b32c9,null))[_0xcd86('0x1e')](function(_0x446990){if(_0x446990){_0x3eb0d6['body'][_0xcd86('0x69')]=_0x446990['id'];return db[_0xcd86('0x6a')][_0xcd86('0x6b')](_0x3eb0d6[_0xcd86('0x60')]);}})['then'](respondWithResult(_0x5b32c9,null))[_0xcd86('0x15')](handleError(_0x5b32c9,null));};exports['getDispositions']=function(_0x427755,_0x51893d){var _0x2dd412={'raw':![],'where':{}};var _0x4490c9={};var _0x488cbc={'count':0x0,'rows':[]};return db[_0xcd86('0x59')][_0xcd86('0x6c')]({'where':{'id':_0x427755[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x51893d,null))[_0xcd86('0x1e')](function(_0x80e46d){if(_0x80e46d){_0x4490c9[_0xcd86('0x4a')]=_[_0xcd86('0x47')](db['Disposition']['rawAttributes']);_0x4490c9[_0xcd86('0x4b')]=_[_0xcd86('0x47')](_0x427755[_0xcd86('0x4b')]);_0x4490c9[_0xcd86('0x48')]=_['intersection'](_0x4490c9['model'],_0x4490c9[_0xcd86('0x4b')]);_0x2dd412['attributes']=_['intersection'](_0x4490c9[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x427755[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x2dd412['attributes']=_0x2dd412['attributes'][_0xcd86('0x4e')]?_0x2dd412[_0xcd86('0x4c')]:_0x4490c9[_0xcd86('0x4a')];if(!_0x427755['query'][_0xcd86('0x4f')](_0xcd86('0x50'))){_0x2dd412[_0xcd86('0x1a')]=qs['limit'](_0x427755[_0xcd86('0x4b')][_0xcd86('0x1a')]);_0x2dd412[_0xcd86('0x19')]=qs['offset'](_0x427755['query'][_0xcd86('0x19')]);}_0x2dd412[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0x427755[_0xcd86('0x4b')][_0xcd86('0x52')]);_0x2dd412['where']=qs[_0xcd86('0x48')](_[_0xcd86('0x54')](_0x427755[_0xcd86('0x4b')],_0x4490c9[_0xcd86('0x48')]));_0x2dd412[_0xcd86('0x53')]['MailAccountId']=_0x80e46d['id'];if(_0x427755[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x2dd412['where']=_['merge'](_0x2dd412[_0xcd86('0x53')],{'$or':_[_0xcd86('0x42')](_0x2dd412[_0xcd86('0x4c')],function(_0x3a708e){var _0x9afb5d={};_0x9afb5d[_0x3a708e]={'$like':'%'+_0x427755[_0xcd86('0x4b')]['filter']+'%'};return _0x9afb5d;})});}_0x2dd412=_[_0xcd86('0x56')]({},_0x2dd412,_0x427755['options']);return db['Disposition']['count']({'where':_0x2dd412[_0xcd86('0x53')]})['then'](function(_0xcaf643){_0x488cbc[_0xcd86('0x1c')]=_0xcaf643;if(_0x427755['query'][_0xcd86('0x5a')]){_0x2dd412[_0xcd86('0x5b')]=[{'all':!![]}];}return db[_0xcd86('0x6a')][_0xcd86('0x5c')](_0x2dd412);})[_0xcd86('0x1e')](function(_0x170a29){_0x488cbc[_0xcd86('0x6d')]=_0x170a29;return _0x488cbc;});}})[_0xcd86('0x1e')](respondWithFilteredResult(_0x51893d,_0x2dd412))[_0xcd86('0x15')](handleError(_0x51893d,null));};exports[_0xcd86('0x6e')]=function(_0x259fb4,_0x52f1a2){return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x259fb4['params']['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x52f1a2,null))[_0xcd86('0x1e')](function(_0x14f7c3){if(_0x14f7c3){return _0x14f7c3[_0xcd86('0x6e')](_0x259fb4[_0xcd86('0x4b')]['ids']);}})[_0xcd86('0x1e')](respondWithStatusCode(_0x52f1a2,null))[_0xcd86('0x15')](handleError(_0x52f1a2,null));};exports[_0xcd86('0x6f')]=function(_0x48a6d6,_0xc3d771){if(_0x48a6d6['body']['id']){delete _0x48a6d6['body']['id'];}return db[_0xcd86('0x59')]['find']({'where':{'id':_0x48a6d6[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0xc3d771,null))[_0xcd86('0x1e')](function(_0x42b81c){if(_0x42b81c){_0x48a6d6[_0xcd86('0x60')][_0xcd86('0x69')]=_0x42b81c['id'];return db[_0xcd86('0x70')][_0xcd86('0x6b')](_0x48a6d6[_0xcd86('0x60')]);}})[_0xcd86('0x1e')](respondWithResult(_0xc3d771,null))[_0xcd86('0x15')](handleError(_0xc3d771,null));};exports[_0xcd86('0x71')]=function(_0x5af30b,_0x575ce9){var _0x426f6a={'raw':![],'where':{}};var _0xf7d4e1={};var _0x4ad530={'count':0x0,'rows':[]};return db[_0xcd86('0x59')]['findOne']({'where':{'id':_0x5af30b['params']['id']}})['then'](handleEntityNotFound(_0x575ce9,null))[_0xcd86('0x1e')](function(_0x2d0735){if(_0x2d0735){_0xf7d4e1[_0xcd86('0x4a')]=_[_0xcd86('0x47')](db[_0xcd86('0x70')][_0xcd86('0x43')]);_0xf7d4e1[_0xcd86('0x4b')]=_[_0xcd86('0x47')](_0x5af30b['query']);_0xf7d4e1['filters']=_[_0xcd86('0x49')](_0xf7d4e1[_0xcd86('0x4a')],_0xf7d4e1[_0xcd86('0x4b')]);_0x426f6a[_0xcd86('0x4c')]=_[_0xcd86('0x49')](_0xf7d4e1[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x5af30b[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x426f6a[_0xcd86('0x4c')]=_0x426f6a[_0xcd86('0x4c')][_0xcd86('0x4e')]?_0x426f6a['attributes']:_0xf7d4e1['model'];if(!_0x5af30b[_0xcd86('0x4b')][_0xcd86('0x4f')](_0xcd86('0x50'))){_0x426f6a[_0xcd86('0x1a')]=qs['limit'](_0x5af30b['query']['limit']);_0x426f6a[_0xcd86('0x19')]=qs[_0xcd86('0x19')](_0x5af30b[_0xcd86('0x4b')][_0xcd86('0x19')]);}_0x426f6a[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0x5af30b[_0xcd86('0x4b')][_0xcd86('0x52')]);_0x426f6a[_0xcd86('0x53')]=qs[_0xcd86('0x48')](_[_0xcd86('0x54')](_0x5af30b[_0xcd86('0x4b')],_0xf7d4e1[_0xcd86('0x48')]));_0x426f6a[_0xcd86('0x53')][_0xcd86('0x69')]=_0x2d0735['id'];if(_0x5af30b[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x426f6a[_0xcd86('0x53')]=_['merge'](_0x426f6a['where'],{'$or':_[_0xcd86('0x42')](_0x426f6a[_0xcd86('0x4c')],function(_0x3f5243){var _0x1be537={};_0x1be537[_0x3f5243]={'$like':'%'+_0x5af30b['query']['filter']+'%'};return _0x1be537;})});}_0x426f6a=_[_0xcd86('0x56')]({},_0x426f6a,_0x5af30b[_0xcd86('0x58')]);return db[_0xcd86('0x70')][_0xcd86('0x1c')]({'where':_0x426f6a[_0xcd86('0x53')]})[_0xcd86('0x1e')](function(_0x2f4e87){_0x4ad530[_0xcd86('0x1c')]=_0x2f4e87;if(_0x5af30b['query'][_0xcd86('0x5a')]){_0x426f6a[_0xcd86('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcd86('0x5c')](_0x426f6a);})[_0xcd86('0x1e')](function(_0x3cd444){_0x4ad530[_0xcd86('0x6d')]=_0x3cd444;return _0x4ad530;});}})['then'](respondWithFilteredResult(_0x575ce9,_0x426f6a))[_0xcd86('0x15')](handleError(_0x575ce9,null));};exports[_0xcd86('0x72')]=function(_0x59d652,_0x316f7d){return db['MailAccount']['find']({'where':{'id':_0x59d652['params']['id']}})['then'](handleEntityNotFound(_0x316f7d,null))[_0xcd86('0x1e')](function(_0x51e541){if(_0x51e541){return _0x51e541['removeAnswers'](_0x59d652[_0xcd86('0x4b')][_0xcd86('0x73')]);}})['then'](respondWithStatusCode(_0x316f7d,null))['catch'](handleError(_0x316f7d,null));};exports[_0xcd86('0x6b')]=function(_0x51d1eb,_0x293a9d){var _0x21f685={'name':_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x25')],'key':_0x51d1eb[_0xcd86('0x60')]['key'],'provider':_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x62')]===_0xcd86('0x61')?null:_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x62')],'email':_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x74')],'ListId':_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x75')],'active':!_[_0xcd86('0x76')](_0x51d1eb[_0xcd86('0x60')][_0xcd86('0x77')])?_0x51d1eb['body'][_0xcd86('0x77')]:!![],'description':_0x51d1eb[_0xcd86('0x60')]['description']||null};var _0x265736=getAuthenticationOptions(_0x21f685[_0xcd86('0x62')],_0x51d1eb['body']);_0x21f685[_0xcd86('0x3d')]=_0x265736[_0xcd86('0x3d')];_0x21f685[_0xcd86('0x3e')]=_0x265736['Smtp'];return db[_0xcd86('0x59')]['create'](_0x21f685,{'include':[{'model':db[_0xcd86('0x66')],'as':_0xcd86('0x3e')},{'model':db[_0xcd86('0x40')],'as':_0xcd86('0x3d')}]})[_0xcd86('0x1e')](function(_0x481c43){var _0x4efb56=_0x51d1eb[_0xcd86('0x33')][_0xcd86('0x20')]({'plain':!![]});if(!_0x4efb56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4efb56[_0xcd86('0x78')]==='user'){var _0x25d6da=_0x481c43[_0xcd86('0x20')]({'plain':!![]});return db[_0xcd86('0x79')][_0xcd86('0x64')]({'where':{'name':'MailAccounts','userProfileId':_0x4efb56['userProfileId']},'raw':!![]})['then'](function(_0x3a12f7){if(_0x3a12f7&&_0x3a12f7[_0xcd86('0x7a')]===0x0){return db[_0xcd86('0x22')][_0xcd86('0x6b')]({'name':_0x25d6da['name'],'resourceId':_0x25d6da['id'],'type':_0x3a12f7[_0xcd86('0x25')],'sectionId':_0x3a12f7['id']},{})[_0xcd86('0x1e')](function(){return _0x481c43;});}else{return _0x481c43;}})['catch'](function(_0x236c77){logger[_0xcd86('0x13')](_0xcd86('0x7b'),_0x236c77);throw _0x236c77;});}return _0x481c43;})[_0xcd86('0x1e')](respondWithResult(_0x293a9d,0xc9))[_0xcd86('0x15')](handleError(_0x293a9d,null));};exports[_0xcd86('0x7c')]=function(_0xd6024a,_0x2302a8){return db[_0xcd86('0x59')][_0xcd86('0x6c')]({'where':{'id':_0xd6024a[_0xcd86('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2302a8,null))[_0xcd86('0x1e')](function(_0x5a10b3){if(_0x5a10b3){return _0x5a10b3[_0xcd86('0x7c')]();}return null;})['then'](respondWithResult(_0x2302a8,null))[_0xcd86('0x15')](handleError(_0x2302a8,null));};exports[_0xcd86('0x7d')]=function(_0x42adbd,_0x2b6340){if(_0x42adbd[_0xcd86('0x60')]['id']){delete _0x42adbd[_0xcd86('0x60')]['id'];}return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x42adbd[_0xcd86('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2b6340,null))[_0xcd86('0x1e')](function(_0x284414){if(_0x284414){_0x42adbd[_0xcd86('0x60')][_0xcd86('0x69')]=_0x284414['id'];return db[_0xcd86('0x40')][_0xcd86('0x6b')](_0x42adbd['body']);}})[_0xcd86('0x1e')](respondWithResult(_0x2b6340,null))[_0xcd86('0x15')](handleError(_0x2b6340,null));};exports[_0xcd86('0x7e')]=function(_0x251884,_0x3dc33c){return db[_0xcd86('0x59')][_0xcd86('0x6c')]({'where':{'id':_0x251884['params']['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x3dc33c,null))[_0xcd86('0x1e')](function(_0x59f03e){if(_0x59f03e){return _0x59f03e[_0xcd86('0x7f')](null);}return null;})['then'](respondWithStatusCode(_0x3dc33c,null))[_0xcd86('0x15')](handleError(_0x3dc33c,null));};exports[_0xcd86('0x80')]=function(_0x12ce96,_0x27245d){return db['MailAccount'][_0xcd86('0x6c')]({'where':{'id':_0x12ce96[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x27245d,null))[_0xcd86('0x1e')](function(_0x4a8cb1){if(_0x4a8cb1){return _0x4a8cb1[_0xcd86('0x80')]();}return null;})[_0xcd86('0x1e')](respondWithResult(_0x27245d,null))[_0xcd86('0x15')](handleError(_0x27245d,null));};exports[_0xcd86('0x81')]=function(_0x443222,_0x263e5c){if(_0x443222[_0xcd86('0x60')]['id']){delete _0x443222[_0xcd86('0x60')]['id'];}return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x443222[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x263e5c,null))[_0xcd86('0x1e')](function(_0xad3c87){if(_0xad3c87){_0x443222[_0xcd86('0x60')][_0xcd86('0x69')]=_0xad3c87['id'];return db[_0xcd86('0x66')]['create'](_0x443222[_0xcd86('0x60')]);}})[_0xcd86('0x1e')](respondWithResult(_0x263e5c,null))[_0xcd86('0x15')](handleError(_0x263e5c,null));};exports[_0xcd86('0x82')]=function(_0x12c09d,_0x5ed694){return db[_0xcd86('0x59')][_0xcd86('0x6c')]({'where':{'id':_0x12c09d[_0xcd86('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5ed694,null))[_0xcd86('0x1e')](function(_0xd81db9){if(_0xd81db9){return _0xd81db9['setSmtp'](null);}return null;})[_0xcd86('0x1e')](respondWithStatusCode(_0x5ed694,null))[_0xcd86('0x15')](handleError(_0x5ed694,null));};exports[_0xcd86('0x83')]=function(_0x2ac705,_0xb61a38){return db[_0xcd86('0x84')][_0xcd86('0x64')]({'where':{'id':_0x2ac705['params']['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0xb61a38,null))[_0xcd86('0x1e')](function(_0x45d43d){if(_0x45d43d){return _0x45d43d[_0xcd86('0x83')](_0x2ac705['body'][_0xcd86('0x73')],_[_0xcd86('0x85')](_0x2ac705['body'],[_0xcd86('0x73'),'id'])||{});}})[_0xcd86('0x1e')](respondWithResult(_0xb61a38,null))[_0xcd86('0x15')](handleError(_0xb61a38,null));};exports['getInteractions']=function(_0xdd76c1,_0x28f0bc){var _0x5a9c0e={'raw':![],'where':{}};var _0x3e2f38={};var _0x42fbfe={'count':0x0,'rows':[]};return db[_0xcd86('0x59')]['findOne']({'where':{'id':_0xdd76c1[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x28f0bc,null))[_0xcd86('0x1e')](function(_0x215aae){if(_0x215aae){_0x3e2f38[_0xcd86('0x4a')]=_[_0xcd86('0x47')](db[_0xcd86('0x84')]['rawAttributes']);_0x3e2f38[_0xcd86('0x4b')]=_['keys'](_0xdd76c1[_0xcd86('0x4b')]);_0x3e2f38['filters']=_[_0xcd86('0x49')](_0x3e2f38[_0xcd86('0x4a')],_0x3e2f38[_0xcd86('0x4b')]);_0x5a9c0e['attributes']=_[_0xcd86('0x49')](_0x3e2f38[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x5a9c0e[_0xcd86('0x4c')]=_0x5a9c0e[_0xcd86('0x4c')]['length']?_0x5a9c0e[_0xcd86('0x4c')]:_0x3e2f38['model'];if(!_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x4f')]('nolimit')){_0x5a9c0e['limit']=qs['limit'](_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x1a')]);_0x5a9c0e[_0xcd86('0x19')]=qs['offset'](_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x19')]);}_0x5a9c0e[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x52')]);_0x5a9c0e['where']=qs[_0xcd86('0x48')](_[_0xcd86('0x54')](_0xdd76c1['query'],_0x3e2f38[_0xcd86('0x48')]));_0x5a9c0e[_0xcd86('0x53')]['MailAccountId']=_0x215aae['id'];if(_0xdd76c1['query'][_0xcd86('0x55')]){_0x5a9c0e[_0xcd86('0x53')]=_[_0xcd86('0x56')](_0x5a9c0e['where'],{'$or':_[_0xcd86('0x42')](_0x5a9c0e[_0xcd86('0x4c')],function(_0x13a9ed){var _0x4e2b38={};_0x4e2b38[_0x13a9ed]={'$like':'%'+_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x55')]+'%'};return _0x4e2b38;})});}_0x5a9c0e=_[_0xcd86('0x56')]({},_0x5a9c0e,_0xdd76c1[_0xcd86('0x58')]);return db[_0xcd86('0x84')][_0xcd86('0x1c')]({'where':_0x5a9c0e['where']})['then'](function(_0xcabfca){_0x42fbfe[_0xcd86('0x1c')]=_0xcabfca;if(_0xdd76c1['query'][_0xcd86('0x5a')]){_0x5a9c0e[_0xcd86('0x5b')]=[{'model':db[_0xcd86('0x86')],'as':'Contact','required':![]},{'model':db[_0xcd86('0x87')],'as':'Owner','attributes':[_0xcd86('0x25'),_0xcd86('0x88'),_0xcd86('0x89')],'required':![]},{'model':db[_0xcd86('0x8a')],'as':'Tags','attributes':['id','name',_0xcd86('0x8b')],'where':_0xdd76c1['query'][_0xcd86('0x8c')]?{'id':_0xdd76c1[_0xcd86('0x4b')][_0xcd86('0x8c')]}:undefined,'required':_0xdd76c1[_0xcd86('0x4b')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xcd86('0x5c')](_0x5a9c0e);})['then'](function(_0x3411bc){_0x42fbfe[_0xcd86('0x6d')]=_0x3411bc;return _0x42fbfe;});}})[_0xcd86('0x1e')](respondWithFilteredResult(_0x28f0bc,_0x5a9c0e))[_0xcd86('0x15')](handleError(_0x28f0bc,null));};exports[_0xcd86('0x8d')]=function addApplications(_0x3b8689,_0x5d892b){var _0x2a1e83=_0x3b8689[_0xcd86('0x5e')]['id'];var _0x1dc698=_0x3b8689[_0xcd86('0x60')];var _0x3a690a=0xc8;var _0x4c5707=null;return db[_0xcd86('0x8e')][_0xcd86('0x8f')]({'isolationLevel':db[_0xcd86('0x8e')][_0xcd86('0x90')][_0xcd86('0x91')][_0xcd86('0x92')]},function(_0x3fc9c1){return db[_0xcd86('0x59')][_0xcd86('0x6c')]({'where':{'id':_0x2a1e83},'transaction':_0x3fc9c1})['then'](function(_0xd80841){if(_0xd80841){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x2a1e83},'transaction':_0x3fc9c1})['then'](function(){var _0x1107fd=_[_0xcd86('0x42')](_0x1dc698,function(_0x59e57b){_0x59e57b[_0xcd86('0x69')]=_0x2a1e83;return _0x59e57b;});return db[_0xcd86('0x93')][_0xcd86('0x94')](_0x1107fd,{'transaction':_0x3fc9c1});});}else{_0x3a690a=0x194;_0x4c5707=[];}});})['then'](function(){if(_0x3a690a!==0x194){return db[_0xcd86('0x93')][_0xcd86('0x95')]({'where':{'MailAccountId':_0x2a1e83},'order':_0xcd86('0x96')})['then'](function(_0x471dbe){_0x4c5707=_0x471dbe;});}})[_0xcd86('0x15')](function(_0x51f479){_0x3a690a=0x1f4;logger['error'](_0x51f479[_0xcd86('0x24')]);if(_0x51f479['name']){delete _0x51f479[_0xcd86('0x25')];}_0x4c5707=_0x51f479;})[_0xcd86('0x97')](function(){if(_0x4c5707===null){_0x5d892b['sendStatus'](_0x3a690a);}else{if(_0x3a690a===0x1f4){_0x5d892b[_0xcd86('0x17')](_0x3a690a)[_0xcd86('0x26')](_0x4c5707);}else{_0x5d892b['status'](_0x3a690a)[_0xcd86('0x18')](_0x4c5707);}}});};exports['getApplications']=function(_0x197063,_0x4f2cd9){var _0x2f0f40={};var _0x344205={};var _0x2dddda;var _0x176087;return db[_0xcd86('0x59')]['findOne']({'where':{'id':_0x197063[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x4f2cd9,null))['then'](function(_0x354f8e){if(_0x354f8e){_0x2dddda=_0x354f8e;_0x344205[_0xcd86('0x4a')]=_['keys'](db[_0xcd86('0x93')]['rawAttributes']);_0x344205['query']=_[_0xcd86('0x47')](_0x197063[_0xcd86('0x4b')]);_0x344205[_0xcd86('0x48')]=_[_0xcd86('0x49')](_0x344205[_0xcd86('0x4a')],_0x344205[_0xcd86('0x4b')]);_0x2f0f40['attributes']=_[_0xcd86('0x49')](_0x344205[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x197063[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x2f0f40[_0xcd86('0x4c')]=_0x2f0f40[_0xcd86('0x4c')][_0xcd86('0x4e')]?_0x2f0f40[_0xcd86('0x4c')]:_0x344205[_0xcd86('0x4a')];_0x2f0f40[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0x197063['query'][_0xcd86('0x52')]);_0x2f0f40[_0xcd86('0x53')]=qs['filters'](_[_0xcd86('0x54')](_0x197063[_0xcd86('0x4b')],_0x344205[_0xcd86('0x48')]));if(_0x197063[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x2f0f40[_0xcd86('0x53')]=_[_0xcd86('0x56')](_0x2f0f40['where'],{'$or':_[_0xcd86('0x42')](_0x2f0f40[_0xcd86('0x4c')],function(_0x8c3024){var _0xe69b49={};_0xe69b49[_0x8c3024]={'$like':'%'+_0x197063[_0xcd86('0x4b')][_0xcd86('0x55')]+'%'};return _0xe69b49;})});}_0x2f0f40=_[_0xcd86('0x56')]({},_0x2f0f40,_0x197063['options']);return _0x2dddda[_0xcd86('0x98')](_0x2f0f40);}})[_0xcd86('0x1e')](function(_0x207597){if(_0x207597){_0x176087=_0x207597[_0xcd86('0x4e')];if(!_0x197063[_0xcd86('0x4b')][_0xcd86('0x4f')](_0xcd86('0x50'))){_0x2f0f40[_0xcd86('0x1a')]=qs[_0xcd86('0x1a')](_0x197063[_0xcd86('0x4b')]['limit']);_0x2f0f40[_0xcd86('0x19')]=qs[_0xcd86('0x19')](_0x197063['query'][_0xcd86('0x19')]);}return _0x2dddda[_0xcd86('0x98')](_0x2f0f40);}})[_0xcd86('0x1e')](function(_0x340ee1){if(_0x340ee1){return _0x340ee1?{'count':_0x176087,'rows':_0x340ee1}:null;}})[_0xcd86('0x1e')](respondWithResult(_0x4f2cd9,null))['catch'](handleError(_0x4f2cd9,null));};exports[_0xcd86('0x99')]=function(_0x19ca26,_0x7ba693){var _0x1297ae={'raw':!![],'where':{}};var _0x45a48a={};var _0x4e7485={'count':0x0,'rows':[]};return db['MailAccount'][_0xcd86('0x6c')]({'where':{'id':_0x19ca26[_0xcd86('0x5e')]['id']}})['then'](handleEntityNotFound(_0x7ba693,null))[_0xcd86('0x1e')](function(_0x35ce38){if(_0x35ce38){_0x45a48a['model']=_['keys'](db[_0xcd86('0x9a')][_0xcd86('0x43')]);_0x45a48a[_0xcd86('0x4b')]=_['keys'](_0x19ca26[_0xcd86('0x4b')]);_0x45a48a['filters']=_[_0xcd86('0x49')](_0x45a48a[_0xcd86('0x4a')],_0x45a48a['query']);_0x1297ae[_0xcd86('0x4c')]=_['intersection'](_0x45a48a[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x4d')]));_0x1297ae['attributes']=_0x1297ae['attributes']['length']?_0x1297ae[_0xcd86('0x4c')]:_0x45a48a[_0xcd86('0x4a')];if(!_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x4f')](_0xcd86('0x50'))){_0x1297ae[_0xcd86('0x1a')]=qs[_0xcd86('0x1a')](_0x19ca26[_0xcd86('0x4b')]['limit']);_0x1297ae[_0xcd86('0x19')]=qs[_0xcd86('0x19')](_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x19')]);}_0x1297ae[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x52')]);_0x1297ae[_0xcd86('0x53')]=qs[_0xcd86('0x48')](_['pick'](_0x19ca26['query'],_0x45a48a[_0xcd86('0x48')]));_0x1297ae[_0xcd86('0x53')][_0xcd86('0x69')]=_0x35ce38['id'];if(_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x1297ae[_0xcd86('0x53')]=_[_0xcd86('0x56')](_0x1297ae['where'],{'$or':_[_0xcd86('0x42')](_0x1297ae[_0xcd86('0x4c')],function(_0x4dbf37){var _0x166170={};_0x166170[_0x4dbf37]={'$like':'%'+_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x55')]+'%'};return _0x166170;})});}if(_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x9b')]){var _0xf34796=_0x19ca26[_0xcd86('0x4b')][_0xcd86('0x9b')]['split'](',');var _0x208d92={};_0x208d92[_0xf34796[0x0]]={'$gte':moment(_0xf34796[0x1])[_0xcd86('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1297ae['where']=_[_0xcd86('0x56')](_0x1297ae[_0xcd86('0x53')],_0x208d92);}_0x1297ae=_[_0xcd86('0x56')]({},_0x1297ae,_0x19ca26[_0xcd86('0x58')]);return db[_0xcd86('0x9a')]['count']({'where':_0x1297ae['where']})['then'](function(_0x94cf2e){_0x4e7485[_0xcd86('0x1c')]=_0x94cf2e;if(_0x19ca26[_0xcd86('0x4b')]['includeAll']){_0x1297ae[_0xcd86('0x5b')]=[{'all':!![]}];}return db['MailMessage'][_0xcd86('0x5c')](_0x1297ae);})[_0xcd86('0x1e')](function(_0x591b4a){if(_0x19ca26[_0xcd86('0x4b')]['inlineCss']==='true'){for(var _0x514020=0x0;_0x514020<_0x591b4a[_0xcd86('0x4e')];_0x514020++){_0x591b4a[_0x514020][_0xcd86('0x60')]=juice(_0x591b4a[_0x514020][_0xcd86('0x60')]);}}_0x4e7485[_0xcd86('0x6d')]=_0x591b4a;return _0x4e7485;});}})[_0xcd86('0x1e')](respondWithFilteredResult(_0x7ba693,_0x1297ae))[_0xcd86('0x15')](handleError(_0x7ba693,null));};exports[_0xcd86('0x26')]=function(_0x4fcf21,_0x584112){var _0x1ce06d,_0x482781={},_0x4d94c9;if(_0x4fcf21[_0xcd86('0x60')]['to']){_0x4d94c9=_0x4fcf21[_0xcd86('0x60')]['to'][_0xcd86('0x9d')](',')[0x0];}return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x4fcf21['params']['id']},'include':[{'model':db[_0xcd86('0x9e')],'as':_0xcd86('0x9f'),'include':[{'model':db[_0xcd86('0x86')],'as':_0xcd86('0xa0'),'where':{'email':_0x4d94c9},'limit':0x1,'order':[[_0xcd86('0xa1'),_0xcd86('0xa2')]]}]},{'model':db[_0xcd86('0x66')],'as':_0xcd86('0x3e'),'raw':!![],'include':[{'model':db[_0xcd86('0xa3')],'as':_0xcd86('0xa3'),'raw':!![]}]}]})[_0xcd86('0x1e')](handleEntityNotFound(_0x584112,null))['then'](function(_0x53a52d){if(!_0x53a52d)return;_0x1ce06d=_0x53a52d;if(!_0x53a52d[_0xcd86('0x3e')])throw new Error(_0xcd86('0xa4'));if(_[_0xcd86('0x76')](_0x4fcf21[_0xcd86('0x60')][_0xcd86('0xa5')])){_0x4fcf21['body'][_0xcd86('0xa5')]=util[_0xcd86('0x9c')](_0xcd86('0xa6'),_0x53a52d[_0xcd86('0x25')],_0x53a52d[_0xcd86('0x74')]||_0x53a52d[_0xcd86('0x3e')][_0xcd86('0x33')]);}if(_0x4fcf21[_0xcd86('0x60')][_0xcd86('0xa7')]&&_0x4fcf21['body'][_0xcd86('0xa7')]['length']){for(var _0x4c9c0f=0x0;_0x4c9c0f<_0x4fcf21[_0xcd86('0x60')]['attachments'][_0xcd86('0x4e')];_0x4c9c0f+=0x1){_0x4fcf21['body']['attachments'][_0x4c9c0f]={'filename':_0x4fcf21['body'][_0xcd86('0xa7')][_0x4c9c0f][_0xcd86('0x25')],'path':path[_0xcd86('0xa8')](config[_0xcd86('0xa9')],_0xcd86('0xaa'),_0x4fcf21[_0xcd86('0x60')][_0xcd86('0xa7')][_0x4c9c0f][_0xcd86('0xab')])};}}var _0x3c64e3=_0x53a52d['getSmtpOptions']();return respondWithRpcPromise(_0xcd86('0xac'),_0xcd86('0xad'),{'account':_0x3c64e3,'message':_0x4fcf21[_0xcd86('0x60')]});})[_0xcd86('0x1e')](function(_0x4d17b7){if(!_0x4d17b7)return;_0x482781=_0x4d17b7;if(!_0x1ce06d[_0xcd86('0x9f')])throw new Error(_0xcd86('0xae'));if(_0x1ce06d[_0xcd86('0x9f')]['Contacts'][_0xcd86('0x4e')])return _0x1ce06d[_0xcd86('0x9f')][_0xcd86('0xa0')][0x0];return db[_0xcd86('0x86')][_0xcd86('0x6b')](_[_0xcd86('0xc')](_0x4fcf21['body'],{'firstName':_0x4fcf21[_0xcd86('0x60')]['to'],'email':_0x4fcf21[_0xcd86('0x60')]['to'],'phone':_0x4fcf21[_0xcd86('0x60')]['to'],'ListId':_0x1ce06d[_0xcd86('0x75')]}));})[_0xcd86('0x1e')](function(_0x4c95a4){if(!_0x4c95a4)return;var _0x31f010={'UserId':_0x4fcf21[_0xcd86('0x33')]['id'],'ContactId':_0x4c95a4['id'],'MailAccountId':_0x1ce06d['id'],'inReplyTo':_0x482781['messageId'],'to':_0x4fcf21[_0xcd86('0x60')][_0xcd86('0xa5')],'cc':_0x4fcf21[_0xcd86('0x60')]['cc'],'subject':_0x4fcf21[_0xcd86('0x60')]['subject'],'attach':_0x4fcf21[_0xcd86('0x60')]['attach'],'firstMsgDirection':_0xcd86('0xaf'),'lastMsgAt':moment()[_0xcd86('0x9c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xcd86('0xaf'),'Messages':[_[_0xcd86('0x56')](_0x4fcf21['body'],{'messageId':_0x482781[_0xcd86('0xb0')],'sentAt':moment()[_0xcd86('0x9c')](_0xcd86('0xb1')),'read':!![],'MailAccountId':_0x1ce06d['id'],'UserId':_0x4fcf21[_0xcd86('0x33')]['id'],'ContactId':_0x4c95a4['id']})]};if(_0x4fcf21[_0xcd86('0x60')][_0xcd86('0xb2')]){_0x31f010=_[_0xcd86('0x56')](_0x31f010,_0x4fcf21[_0xcd86('0x60')]['Interaction']);}return db[_0xcd86('0x84')]['create'](_0x31f010,{'include':[{'model':db[_0xcd86('0x9a')],'as':'Messages'}]});})['then'](respondWithResult(_0x584112,null))['catch'](handleError(_0x584112,null));};exports['verifySmtp']=function(_0x5b56ce,_0x442906){return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x5b56ce['params']['id']},'include':[{'model':db[_0xcd86('0x66')],'as':_0xcd86('0x3e'),'raw':!![],'include':[{'model':db[_0xcd86('0xa3')],'as':_0xcd86('0xa3'),'raw':!![]}]}]})[_0xcd86('0x1e')](handleEntityNotFound(_0x442906,null))[_0xcd86('0x1e')](function(_0x57e295){if(!_0x57e295[_0xcd86('0x3e')])return;var _0x3a82d1=_0x57e295['getSmtpOptions']();return respondWithRpcPromise(_0xcd86('0xb3'),'verifySmtp',{'account':_0x3a82d1});})['then'](respondWithResult(_0x442906,null))[_0xcd86('0x15')](handleError(_0x442906,null));};exports[_0xcd86('0x1f')]=function(_0x7bc960,_0x514786){return db['MailAccount'][_0xcd86('0x64')]({'where':{'id':_0x7bc960['params']['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x514786,null))[_0xcd86('0x1e')](function(_0x1413f0){if(_0x1413f0&&_0x1413f0[_0xcd86('0x3b')]){throw new db['Sequelize'][(_0xcd86('0xb4'))](_0xcd86('0xb5'));}return _0x1413f0;})[_0xcd86('0x1e')](removeEntity(_0x514786,null))['catch'](handleError(_0x514786,null));};exports['addAgents']=function(_0x49a772,_0x57b524){return db[_0xcd86('0x59')]['find']({'where':{'id':_0x49a772[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x57b524,null))['then'](function(_0x2ea559){if(_0x2ea559){return _0x2ea559['addAgents'](_0x49a772[_0xcd86('0x60')][_0xcd86('0x73')],_[_0xcd86('0x85')](_0x49a772[_0xcd86('0x60')],[_0xcd86('0x73'),'id'])||{})[_0xcd86('0xb6')](function(_0x95878a){for(var _0xa4f6d3=0x0;_0xa4f6d3<_0x49a772['body'][_0xcd86('0x73')][_0xcd86('0x4e')];_0xa4f6d3+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x49a772[_0xcd86('0x60')][_0xcd86('0x73')][_0xa4f6d3]),'MailAccountId':Number(_0x49a772[_0xcd86('0x5e')]['id'])});}return _0x95878a;});}})['then'](respondWithResult(_0x57b524,null))['catch'](handleError(_0x57b524,null));};exports[_0xcd86('0xb7')]=function(_0x43bbb7,_0x2f4918){return db[_0xcd86('0x59')][_0xcd86('0x64')]({'where':{'id':_0x43bbb7[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x2f4918,null))[_0xcd86('0x1e')](function(_0x20091a){if(_0x20091a){return _0x20091a[_0xcd86('0xb7')](_0x43bbb7['query']['ids'])[_0xcd86('0x1e')](function(){if(_[_0xcd86('0xb8')](_0x43bbb7['query']['ids'])){for(var _0x538bab=0x0;_0x538bab<_0x43bbb7[_0xcd86('0x4b')]['ids'][_0xcd86('0x4e')];_0x538bab+=0x1){socket[_0xcd86('0xb9')](_0xcd86('0xba'),{'UserId':Number(_0x43bbb7[_0xcd86('0x4b')][_0xcd86('0x73')][_0x538bab]),'MailAccountId':Number(_0x43bbb7[_0xcd86('0x5e')]['id'])});}}else{socket[_0xcd86('0xb9')](_0xcd86('0xba'),{'UserId':Number(_0x43bbb7[_0xcd86('0x4b')][_0xcd86('0x73')]),'MailAccountId':Number(_0x43bbb7[_0xcd86('0x5e')]['id'])});}});}})[_0xcd86('0x1e')](respondWithStatusCode(_0x2f4918,null))[_0xcd86('0x15')](handleError(_0x2f4918,null));};exports[_0xcd86('0xbb')]=function(_0x2d0358,_0x1de0b8){var _0x583102={};var _0x5a2c2e={};var _0x3527a9;var _0x889883;return db[_0xcd86('0x59')]['findOne']({'where':{'id':_0x2d0358[_0xcd86('0x5e')]['id']}})[_0xcd86('0x1e')](handleEntityNotFound(_0x1de0b8,null))['then'](function(_0x42b095){if(_0x42b095){_0x3527a9=_0x42b095;_0x5a2c2e[_0xcd86('0x4a')]=_['keys'](db[_0xcd86('0x87')]['rawAttributes']);_0x5a2c2e[_0xcd86('0x4b')]=_[_0xcd86('0x47')](_0x2d0358['query']);_0x5a2c2e[_0xcd86('0x48')]=_['intersection'](_0x5a2c2e[_0xcd86('0x4a')],_0x5a2c2e['query']);_0x583102[_0xcd86('0x4c')]=_[_0xcd86('0x49')](_0x5a2c2e[_0xcd86('0x4a')],qs[_0xcd86('0x4d')](_0x2d0358[_0xcd86('0x4b')]['fields']));_0x583102['attributes']=_0x583102[_0xcd86('0x4c')][_0xcd86('0x4e')]?_0x583102[_0xcd86('0x4c')]:_0x5a2c2e[_0xcd86('0x4a')];_0x583102[_0xcd86('0x51')]=qs[_0xcd86('0x52')](_0x2d0358['query'][_0xcd86('0x52')]);_0x583102[_0xcd86('0x53')]=qs['filters'](_['pick'](_0x2d0358[_0xcd86('0x4b')],_0x5a2c2e[_0xcd86('0x48')]));if(_0x2d0358[_0xcd86('0x4b')][_0xcd86('0x55')]){_0x583102[_0xcd86('0x53')]=_[_0xcd86('0x56')](_0x583102[_0xcd86('0x53')],{'$or':_['map'](_0x583102[_0xcd86('0x4c')],function(_0x31d3a4){var _0x2e8bba={};_0x2e8bba[_0x31d3a4]={'$like':'%'+_0x2d0358[_0xcd86('0x4b')][_0xcd86('0x55')]+'%'};return _0x2e8bba;})});}_0x583102=_[_0xcd86('0x56')]({},_0x583102,_0x2d0358[_0xcd86('0x58')]);return _0x3527a9['getAgents'](_0x583102);}})[_0xcd86('0x1e')](function(_0x32e22b){if(_0x32e22b){_0x889883=_0x32e22b[_0xcd86('0x4e')];if(!_0x2d0358[_0xcd86('0x4b')][_0xcd86('0x4f')]('nolimit')){_0x583102['limit']=qs[_0xcd86('0x1a')](_0x2d0358[_0xcd86('0x4b')][_0xcd86('0x1a')]);_0x583102[_0xcd86('0x19')]=qs['offset'](_0x2d0358[_0xcd86('0x4b')][_0xcd86('0x19')]);}return _0x3527a9[_0xcd86('0xbb')](_0x583102);}})[_0xcd86('0x1e')](function(_0x12bb9d){if(_0x12bb9d){return _0x12bb9d?{'count':_0x889883,'rows':_0x12bb9d}:null;}})[_0xcd86('0x1e')](respondWithResult(_0x1de0b8,null))[_0xcd86('0x15')](handleError(_0x1de0b8,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 5b5c2e5..6fedb38 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 _0xe1d3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x4796eb,_0x2f8389){var _0x1fb1a4=function(_0x1c4717){while(--_0x1c4717){_0x4796eb['push'](_0x4796eb['shift']());}};_0x1fb1a4(++_0x2f8389);}(_0xe1d3,0x159));var _0x3e1d=function(_0x32b473,_0xc85e5c){_0x32b473=_0x32b473-0x0;var _0x135881=_0xe1d3[_0x32b473];return _0x135881;};'use strict';var EventEmitter=require(_0x3e1d('0x0'));var MailAccount=require(_0x3e1d('0x1'))['db'][_0x3e1d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3e1d('0x3')](0x0);var events={'afterCreate':_0x3e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x3e1d('0x5')};function emitEvent(_0x4a0768){return function(_0x23f59b,_0x38df15,_0x4f6337){MailAccountEvents['emit'](_0x4a0768+':'+_0x23f59b['id'],_0x23f59b);MailAccountEvents[_0x3e1d('0x6')](_0x4a0768,_0x23f59b);_0x4f6337(null);};}for(var e in events){if(events[_0x3e1d('0x7')](e)){var event=events[e];MailAccount[_0x3e1d('0x8')](e,emitEvent(event));}}module[_0x3e1d('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x99fd=['emit','hasOwnProperty','hook','events','MailAccount','setMaxListeners','save','update','remove'];(function(_0xa5e821,_0x4dd2f6){var _0x62d0cd=function(_0x119f86){while(--_0x119f86){_0xa5e821['push'](_0xa5e821['shift']());}};_0x62d0cd(++_0x4dd2f6);}(_0x99fd,0x1e0));var _0xd99f=function(_0x3f74e3,_0x431a36){_0x3f74e3=_0x3f74e3-0x0;var _0x1fe8f3=_0x99fd[_0x3f74e3];return _0x1fe8f3;};'use strict';var EventEmitter=require(_0xd99f('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xd99f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd99f('0x2')](0x0);var events={'afterCreate':_0xd99f('0x3'),'afterUpdate':_0xd99f('0x4'),'afterDestroy':_0xd99f('0x5')};function emitEvent(_0x5813e3){return function(_0x14889c,_0x56745b,_0x58e1e7){MailAccountEvents[_0xd99f('0x6')](_0x5813e3+':'+_0x14889c['id'],_0x14889c);MailAccountEvents[_0xd99f('0x6')](_0x5813e3,_0x14889c);_0x58e1e7(null);};}for(var e in events){if(events[_0xd99f('0x7')](e)){var event=events[e];MailAccount[_0xd99f('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index dfc252d..c514be2 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 _0x15e5=['define','provider','custom','service','host','Smtp','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','CloudProvider','data5','pass'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15e5,0x13b));var _0x515e=function(_0x1f781e,_0x217901){_0x1f781e=_0x1f781e-0x0;var _0x3bcd3a=_0x15e5[_0x1f781e];return _0x3bcd3a;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x51b1e2){return _0x51b1e2[_0x515e('0x0')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x581c0c=this;var _0x195bd6={'id':_0x581c0c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x581c0c[_0x515e('0x1')]!==_0x515e('0x2')){_0x195bd6[_0x515e('0x3')]=_0x581c0c['provider'];}else{_0x195bd6[_0x515e('0x4')]=_0x581c0c[_0x515e('0x5')][_0x515e('0x4')];_0x195bd6['port']=_0x581c0c['Smtp']['port'];_0x195bd6[_0x515e('0x6')]=_0x581c0c[_0x515e('0x5')]['secure'];}if(_0x581c0c[_0x515e('0x5')][_0x515e('0x7')]){if(_0x581c0c['Smtp'][_0x515e('0x8')]){if(!_0x581c0c['Smtp']['CloudProvider'])throw new Error(_0x515e('0x9'));_0x195bd6[_0x515e('0xa')]={'type':'OAuth2','user':_0x581c0c[_0x515e('0x5')][_0x515e('0xb')],'accessToken':_0x581c0c[_0x515e('0x5')][_0x515e('0xc')][_0x515e('0xd')]};}else{_0x195bd6['auth']={'user':_0x581c0c[_0x515e('0x5')][_0x515e('0xb')],'pass':_0x581c0c[_0x515e('0x5')][_0x515e('0xe')]};}}return _0x195bd6;}}});}; \ No newline at end of file +var _0x840e=['exports','MailAccount','mail_accounts','custom','service','provider','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes'];(function(_0x3ed442,_0x95f9c9){var _0x4b0865=function(_0x54645a){while(--_0x54645a){_0x3ed442['push'](_0x3ed442['shift']());}};_0x4b0865(++_0x95f9c9);}(_0x840e,0x1b7));var _0xe840=function(_0x4ffa03,_0x363a82){_0x4ffa03=_0x4ffa03-0x0;var _0x30d661=_0x840e[_0x4ffa03];return _0x30d661;};'use strict';var attributes=require(_0xe840('0x0'));module[_0xe840('0x1')]=function(_0xc02b1a){return _0xc02b1a['define'](_0xe840('0x2'),attributes,{'tableName':_0xe840('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x27a0df=this;var _0x5c1cd9={'id':_0x27a0df['id'],'tls':{'rejectUnauthorized':![]}};if(_0x27a0df['provider']!==_0xe840('0x4')){_0x5c1cd9[_0xe840('0x5')]=_0x27a0df[_0xe840('0x6')];}else{_0x5c1cd9[_0xe840('0x7')]=_0x27a0df[_0xe840('0x8')][_0xe840('0x7')];_0x5c1cd9[_0xe840('0x9')]=_0x27a0df[_0xe840('0x8')][_0xe840('0x9')];_0x5c1cd9['secure']=_0x27a0df['Smtp'][_0xe840('0xa')];}if(_0x27a0df['Smtp'][_0xe840('0xb')]){if(_0x27a0df[_0xe840('0x8')][_0xe840('0xc')]){if(!_0x27a0df[_0xe840('0x8')][_0xe840('0xd')])throw new Error(_0xe840('0xe'));_0x5c1cd9[_0xe840('0xf')]={'type':_0xe840('0x10'),'user':_0x27a0df[_0xe840('0x8')][_0xe840('0x11')],'accessToken':_0x27a0df[_0xe840('0x8')][_0xe840('0xd')][_0xe840('0x12')]};}else{_0x5c1cd9[_0xe840('0xf')]={'user':_0x27a0df['Smtp'][_0xe840('0x11')],'pass':_0x27a0df['Smtp'][_0xe840('0x13')]};}}return _0x5c1cd9;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index bb667b9..068bb34 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 _0x4137=['Smtp','CloudProvider','get','omit','Applications','applications','priority','asc','push','length','Contacts','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC','MailServerOut'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var BPromise=require(_0x7413('0x2'));var rs=require(_0x7413('0x3'));var Redis=require(_0x7413('0x4'));var db=require(_0x7413('0x5'))['db'];var logger=require(_0x7413('0x6'))(_0x7413('0x7'));var config=require(_0x7413('0x8'));var jayson=require(_0x7413('0x9'));var client=jayson[_0x7413('0xa')][_0x7413('0xb')]({'port':0x232c});config['redis']=_[_0x7413('0xc')](config[_0x7413('0xd')],{'host':_0x7413('0xe'),'port':0x18eb});var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);function respondWithRpcPromise(_0x4e320b,_0x422bf5,_0x2f4b54){return new BPromise(function(_0x50fde0,_0x29f124){return client[_0x7413('0x12')](_0x4e320b,_0x2f4b54)[_0x7413('0x13')](function(_0x3e026b){logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));logger[_0x7413('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'),JSON[_0x7413('0x17')](_0x3e026b));if(_0x3e026b[_0x7413('0x18')]){if(_0x3e026b['error']['code']===0x1f4){logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b[_0x7413('0x18')]['message']);return _0x29f124(_0x3e026b[_0x7413('0x18')][_0x7413('0x1a')]);}logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b['error']['message']);return _0x50fde0(_0x3e026b[_0x7413('0x18')]['message']);}else{logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));_0x50fde0(_0x3e026b[_0x7413('0x1b')][_0x7413('0x1a')]);}})[_0x7413('0x1c')](function(_0x2a3417){logger[_0x7413('0x18')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x2a3417);_0x29f124(_0x2a3417);});});}exports[_0x7413('0x1d')]=function(_0x17c062){var _0x11f8a1=this;return new Promise(function(_0xfe5b8c,_0x5bee15){return db[_0x7413('0x1e')][_0x7413('0x1f')]({'raw':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x21')]===undefined?!![]:![]:!![],'where':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x22')]||null:null,'attributes':_0x17c062['options']?_0x17c062['options'][_0x7413('0x23')]||null:null,'limit':_0x17c062['options']?_0x17c062[_0x7413('0x20')][_0x7413('0x24')]||null:null,'include':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x25')]?_[_0x7413('0x26')](_0x17c062[_0x7413('0x20')][_0x7413('0x25')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x25')]?_['map'](_0x1d455b[_0x7413('0x25')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x27')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes'],'include':_0x71cbb4[_0x7413('0x25')]?_[_0x7413('0x26')](_0x71cbb4[_0x7413('0x25')],function(_0x4843fd){return{'model':db[_0x4843fd[_0x7413('0x27')]],'as':_0x4843fd['as'],'attributes':_0x4843fd[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dce7){logger['info'](_0x7413('0x1d'),_0x17c062);logger[_0x7413('0x16')](_0x7413('0x1d'),_0x17c062,JSON[_0x7413('0x17')](_0x24dce7));_0xfe5b8c(_0x24dce7);})[_0x7413('0x1c')](function(_0x2004ea){logger['error'](_0x7413('0x1d'),_0x2004ea[_0x7413('0x1a')],_0x17c062);_0x5bee15(_0x11f8a1[_0x7413('0x18')](0x1f4,_0x2004ea[_0x7413('0x1a')]));});});};exports[_0x7413('0x28')]=function(_0x256395){var _0x185cfe=this;return new Promise(function(_0x5b4426,_0xd763f9){return db[_0x7413('0x1e')][_0x7413('0x29')]({'raw':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x22')]||null:null,'attributes':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['attributes']||null:null,'include':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x25')]?_[_0x7413('0x26')](_0x256395['options']['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x27')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x23')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x25')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x23')],'include':_0x5a92ab['include']?_[_0x7413('0x26')](_0x5a92ab[_0x7413('0x25')],function(_0xf34b21){return{'model':db[_0xf34b21[_0x7413('0x27')]],'as':_0xf34b21['as'],'attributes':_0xf34b21[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58bd2){if(_0x256395[_0x7413('0x20')][_0x7413('0x2a')]===!![])_0xa58bd2[_0x7413('0x2b')](_0x7413('0x2c'),_0xa58bd2[_0x7413('0x2d')]());logger[_0x7413('0x14')](_0x7413('0x28'),_0x256395);logger[_0x7413('0x16')](_0x7413('0x28'),_0x256395,JSON[_0x7413('0x17')](_0xa58bd2));_0x5b4426(_0xa58bd2);})[_0x7413('0x1c')](function(_0x5a9791){logger[_0x7413('0x18')]('ShowMailAccount',_0x5a9791['message'],_0x256395);_0xd763f9(_0x185cfe['error'](0x1f4,_0x5a9791['message']));});});};exports['NotifyMailAccount']=function(_0x44af7d){var _0x4c1770=this;return new Promise(function(_0x535e49,_0x5dc077){var _0x4d0008={'body':_0x44af7d['body'],'channel':_0x7413('0x2e')};var _0x32f1e8=_[_0x7413('0x2f')](_[_0x7413('0x30')](db[_0x7413('0x31')]['rawAttributes']),[_0x7413('0x32'),'updatedAt',_0x7413('0x33'),_0x7413('0x34')]);var _0xa063d1=![];if(_0x44af7d[_0x7413('0x35')]['id']){delete _0x44af7d[_0x7413('0x35')]['id'];}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x37')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x38')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x35')])||_0x44af7d['body'][_0x7413('0x35')]===''){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x39')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x3b')+_0x32f1e8));}if(!_[_0x7413('0x3c')](_0x32f1e8,_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770['error'](0x1f4,_0x7413('0x3d')+_0x32f1e8));}var _0x52a088={};_0x52a088[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d[_0x7413('0x35')][_0x7413('0x37')];return db[_0x7413('0x1e')][_0x7413('0x29')]({'where':{'id':_0x44af7d[_0x7413('0x3e')]['id']},'include':[{'model':db[_0x7413('0x3f')],'as':_0x7413('0x40'),'include':[{'model':db[_0x7413('0x31')],'as':'Contacts','where':_0x52a088,'limit':0x1,'order':[['updatedAt',_0x7413('0x41')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7413('0x42')],'as':_0x7413('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7413('0x44')}]}]})['then'](function(_0x562bae){if(_0x562bae&&_0x562bae[_0x7413('0x40')]){var _0x5f263e=_0x562bae[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x3e')]=_[_0x7413('0x46')](_0x5f263e,[_0x7413('0x47'),_0x7413('0x40')]);_0x4d0008[_0x7413('0x3e')][_0x7413('0x2c')]=_0x562bae[_0x7413('0x2d')]();_0x4d0008[_0x7413('0x48')]=_0x5f263e[_0x7413('0x47')];_0x4d0008['list']=_0x5f263e[_0x7413('0x40')];_0x4d0008['applications']=_['orderBy'](_0x4d0008['applications'],[_0x7413('0x49')],[_0x7413('0x4a')]);if(_0x4d0008[_0x7413('0x3e')]&&_0x4d0008[_0x7413('0x3e')]['autoclose']){_0x4d0008['applications'][_0x7413('0x4b')]({'id':0x0,'priority':_0x4d0008['applications'][_0x7413('0x4c')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4d0008['account']['Applications']){delete _0x4d0008[_0x7413('0x3e')][_0x7413('0x47')];}if(_0x4d0008[_0x7413('0x3e')][_0x7413('0x40')]){delete _0x4d0008[_0x7413('0x3e')]['List'];}if(_0x5f263e[_0x7413('0x40')][_0x7413('0x4d')][_0x7413('0x4c')]){return _0x5f263e['List'][_0x7413('0x4d')][0x0];}var _0x5c3324=_['defaults'](_0x44af7d[_0x7413('0x35')],{'firstName':_0x44af7d[_0x7413('0x35')][_0x7413('0x37')],'ListId':_0x5f263e[_0x7413('0x34')]});_0x5c3324[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d['body'][_0x7413('0x37')];return db['CmContact'][_0x7413('0x4e')](_0x5c3324);}else{throw new Error('List\x20not\x20found');}})[_0x7413('0x13')](function(_0x4d4faa){_0x4d0008[_0x7413('0x4f')]=_0x4d4faa;if(_0x4d4faa){if(!_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x50')]){_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')]=rs['generate']()+'\x20'+_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'];}var _0x3ce34c={'ContactId':_0x4d4faa['id'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'inReplyTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x52')],'lastMsgAt':moment()[_0x7413('0x53')](_0x7413('0x54')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x44af7d['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x7413('0x50')],'where':{'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['inReplyTo']}}]})[_0x7413('0x13')](function(_0xb7dd83){if(_0xb7dd83){return[_0xb7dd83,![]];}return db[_0x7413('0x55')][_0x7413('0x4e')](_0x3ce34c)[_0x7413('0x13')](function(_0x3db284){return[_0x3db284,!![]];});});}else{throw new Error(_0x7413('0x56'));}})[_0x7413('0x57')](function(_0x1ec131,_0x47512d){if(_0x1ec131){_0xa063d1=_0x47512d;if(!_0x47512d){return _0x1ec131[_0x7413('0x58')]({'inReplyTo':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['messageId'],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x1ec131[_0x7413('0x52')]?_0x1ec131['attach']:_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x7413('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7413('0x54')),'lastMsgDirection':'in'});}else{return _0x1ec131;}}})[_0x7413('0x13')](function(_0x167c6b){_0x4d0008[_0x7413('0x59')]=_0x167c6b[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x59')][_0x7413('0x5a')]=_0xa063d1;return db[_0x7413('0x5b')]['create']({'body':_0x44af7d[_0x7413('0x35')]['body'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'MailInteractionId':_0x167c6b['id'],'direction':'in','ContactId':_0x4d0008[_0x7413('0x4f')]['id'],'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x50')],'from':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'to':_0x44af7d[_0x7413('0x35')]['message']['to'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')]['attach'],'Attachments':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attachments'],'originTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x5c')],'originCc':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x5d')],'bcc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5e')],'ChatWebsiteId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5f')]||'Email','ChatOfflineMessageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x60')]||null},{'include':[{'model':db[_0x7413('0x61')],'as':_0x7413('0x62')}]});})[_0x7413('0x13')](function(_0x46e9f8){_0x4d0008[_0x7413('0x1a')]=_0x46e9f8;if(_0x4d0008[_0x7413('0x59')]['UserId']){return db[_0x7413('0x63')][_0x7413('0x29')]({'attributes':['id',_0x7413('0x64')],'where':{'id':_0x4d0008[_0x7413('0x59')][_0x7413('0x65')]}})[_0x7413('0x13')](function(_0x4c9d1b){if(_0x4c9d1b){_0x4d0008[_0x7413('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c9d1b[_0x7413('0x64')]+','+(_0x4d0008[_0x7413('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0x66')});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);})[_0x7413('0x13')](function(_0x2d361c){_0x535e49(_0x2d361c);})[_0x7413('0x1c')](function(_0x5f4765){_0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x5f4765['message']));});});}; \ No newline at end of file +var _0x2ef3=['result','catch','MailAccount','findAll','options','attributes','limit','model','include','map','GetMailAccount','find','raw','smtp','setDataValue','smtpOptions','ShowMailAccount','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','getSmtpOptions','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','create','List\x20not\x20found','messageId','generate','attach','MailInteraction','update','subject','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','ChatWebsiteId','Email','ChatOfflineMessageId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x13043c,_0x130974){var _0x229d58=function(_0x2ef019){while(--_0x2ef019){_0x13043c['push'](_0x13043c['shift']());}};_0x229d58(++_0x130974);}(_0x2ef3,0xba));var _0x32ef=function(_0x57071b,_0x9b6731){_0x57071b=_0x57071b-0x0;var _0x368819=_0x2ef3[_0x57071b];return _0x368819;};'use strict';var _=require(_0x32ef('0x0'));var moment=require(_0x32ef('0x1'));var BPromise=require(_0x32ef('0x2'));var rs=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var db=require(_0x32ef('0x5'))['db'];var logger=require('../../config/logger')(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x8')][_0x32ef('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0x32ef('0xa')],{'host':_0x32ef('0xb'),'port':0x18eb});var socket=require(_0x32ef('0xc'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xd'))[_0x32ef('0xe')](socket);function respondWithRpcPromise(_0x2484a0,_0x2bbb50,_0x28275c){return new BPromise(function(_0x77df79,_0x56eb42){return client['request'](_0x2484a0,_0x28275c)[_0x32ef('0xf')](function(_0x33281d){logger[_0x32ef('0x10')](_0x32ef('0x11'),_0x2bbb50,'request\x20sent');logger[_0x32ef('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x2bbb50,_0x32ef('0x13'),JSON['stringify'](_0x33281d));if(_0x33281d[_0x32ef('0x14')]){if(_0x33281d[_0x32ef('0x14')]['code']===0x1f4){logger['error'](_0x32ef('0x11'),_0x2bbb50,_0x33281d['error'][_0x32ef('0x15')]);return _0x56eb42(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}logger[_0x32ef('0x14')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,_0x33281d['error']['message']);return _0x77df79(_0x33281d[_0x32ef('0x14')][_0x32ef('0x15')]);}else{logger[_0x32ef('0x10')]('MailAccount,\x20%s,\x20%s',_0x2bbb50,'request\x20sent');_0x77df79(_0x33281d[_0x32ef('0x16')][_0x32ef('0x15')]);}})[_0x32ef('0x17')](function(_0x57863c){logger[_0x32ef('0x14')](_0x32ef('0x11'),_0x2bbb50,_0x57863c);_0x56eb42(_0x57863c);});});}exports['GetMailAccount']=function(_0x304505){var _0x314ef1=this;return new Promise(function(_0x26aff3,_0x251084){return db[_0x32ef('0x18')][_0x32ef('0x19')]({'raw':_0x304505['options']?_0x304505[_0x32ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['where']||null:null,'attributes':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')][_0x32ef('0x1b')]||null:null,'limit':_0x304505['options']?_0x304505['options'][_0x32ef('0x1c')]||null:null,'include':_0x304505[_0x32ef('0x1a')]?_0x304505[_0x32ef('0x1a')]['include']?_['map'](_0x304505[_0x32ef('0x1a')]['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1d')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1b')],'include':_0x51a412[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x51a412[_0x32ef('0x1e')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1d')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1b')],'include':_0x234175[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x234175[_0x32ef('0x1e')],function(_0xba4b3f){return{'model':db[_0xba4b3f['model']],'as':_0xba4b3f['as'],'attributes':_0xba4b3f[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x5a04cd){logger[_0x32ef('0x10')](_0x32ef('0x20'),_0x304505);logger[_0x32ef('0x12')](_0x32ef('0x20'),_0x304505,JSON['stringify'](_0x5a04cd));_0x26aff3(_0x5a04cd);})[_0x32ef('0x17')](function(_0x22bf86){logger[_0x32ef('0x14')](_0x32ef('0x20'),_0x22bf86[_0x32ef('0x15')],_0x304505);_0x251084(_0x314ef1[_0x32ef('0x14')](0x1f4,_0x22bf86[_0x32ef('0x15')]));});});};exports['ShowMailAccount']=function(_0x36ac37){var _0x537214=this;return new Promise(function(_0x38bf73,_0x2b6c6a){return db['MailAccount'][_0x32ef('0x21')]({'raw':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x22')]===undefined?!![]:![]:!![],'where':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options']['where']||null:null,'attributes':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37['options'][_0x32ef('0x1b')]||null:null,'include':_0x36ac37[_0x32ef('0x1a')]?_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x36ac37[_0x32ef('0x1a')]['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1b')],'include':_0x482d3a[_0x32ef('0x1e')]?_[_0x32ef('0x1f')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1d')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1b')],'include':_0x4fb402[_0x32ef('0x1e')]?_['map'](_0x4fb402['include'],function(_0xcbdec8){return{'model':db[_0xcbdec8[_0x32ef('0x1d')]],'as':_0xcbdec8['as'],'attributes':_0xcbdec8[_0x32ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xf')](function(_0x3a7c49){if(_0x36ac37[_0x32ef('0x1a')][_0x32ef('0x23')]===!![])_0x3a7c49[_0x32ef('0x24')](_0x32ef('0x25'),_0x3a7c49['getSmtpOptions']());logger[_0x32ef('0x10')](_0x32ef('0x26'),_0x36ac37);logger[_0x32ef('0x12')]('ShowMailAccount',_0x36ac37,JSON[_0x32ef('0x27')](_0x3a7c49));_0x38bf73(_0x3a7c49);})[_0x32ef('0x17')](function(_0x879e33){logger[_0x32ef('0x14')](_0x32ef('0x26'),_0x879e33[_0x32ef('0x15')],_0x36ac37);_0x2b6c6a(_0x537214[_0x32ef('0x14')](0x1f4,_0x879e33[_0x32ef('0x15')]));});});};exports[_0x32ef('0x28')]=function(_0x57a3c0){var _0xb4db74=this;return new Promise(function(_0x4615b4,_0x48e071){var _0x3cac2e={'body':_0x57a3c0[_0x32ef('0x29')],'channel':_0x32ef('0x2a')};var _0x1733e3=_[_0x32ef('0x2b')](_[_0x32ef('0x2c')](db[_0x32ef('0x2d')]['rawAttributes']),['createdAt',_0x32ef('0x2e'),_0x32ef('0x2f'),_0x32ef('0x30')]);var _0x765c63=![];if(_0x57a3c0['body']['id']){delete _0x57a3c0[_0x32ef('0x29')]['id'];}if(_[_0x32ef('0x31')](_0x57a3c0['body'][_0x32ef('0x32')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x33')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')])||_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x29')]===''){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x32ef('0x34')));}if(_[_0x32ef('0x31')](_0x57a3c0[_0x32ef('0x29')]['mapKey'])){return _0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1733e3));}if(!_[_0x32ef('0x35')](_0x1733e3,_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')])){return _0x48e071(_0xb4db74['error'](0x1f4,_0x32ef('0x37')+_0x1733e3));}var _0x230ac9={};_0x230ac9[_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x36')]]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x18')]['find']({'where':{'id':_0x57a3c0['account']['id']},'include':[{'model':db[_0x32ef('0x38')],'as':_0x32ef('0x39'),'include':[{'model':db[_0x32ef('0x2d')],'as':_0x32ef('0x3a'),'where':_0x230ac9,'limit':0x1,'order':[[_0x32ef('0x2e'),_0x32ef('0x3b')]]}]},{'model':db[_0x32ef('0x3c')],'as':_0x32ef('0x3d')},{'model':db[_0x32ef('0x3e')],'as':_0x32ef('0x3f'),'include':[{'model':db[_0x32ef('0x40')],'as':_0x32ef('0x40')}]}]})[_0x32ef('0xf')](function(_0x4c2534){if(_0x4c2534&&_0x4c2534[_0x32ef('0x39')]){var _0x12fbd7=_0x4c2534[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x42')]=_[_0x32ef('0x43')](_0x12fbd7,[_0x32ef('0x3d'),_0x32ef('0x39')]);_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x25')]=_0x4c2534[_0x32ef('0x44')]();_0x3cac2e[_0x32ef('0x45')]=_0x12fbd7[_0x32ef('0x3d')];_0x3cac2e[_0x32ef('0x46')]=_0x12fbd7[_0x32ef('0x39')];_0x3cac2e[_0x32ef('0x45')]=_[_0x32ef('0x47')](_0x3cac2e[_0x32ef('0x45')],[_0x32ef('0x48')],['asc']);if(_0x3cac2e['account']&&_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x49')]){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4a')]({'id':0x0,'priority':_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x4b')]+0x1,'app':_0x32ef('0x4c'),'appdata':_0x32ef('0x49'),'interval':_0x32ef('0x4d')});}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x3d')]){delete _0x3cac2e['account'][_0x32ef('0x3d')];}if(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')]){delete _0x3cac2e[_0x32ef('0x42')][_0x32ef('0x39')];}if(_0x12fbd7[_0x32ef('0x39')]['Contacts'][_0x32ef('0x4b')]){return _0x12fbd7[_0x32ef('0x39')][_0x32ef('0x3a')][0x0];}var _0x56b7ce=_[_0x32ef('0x4e')](_0x57a3c0['body'],{'firstName':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')],'ListId':_0x12fbd7['ListId']});_0x56b7ce[_0x57a3c0[_0x32ef('0x29')]['mapKey']]=_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x32')];return db[_0x32ef('0x2d')][_0x32ef('0x4f')](_0x56b7ce);}else{throw new Error(_0x32ef('0x50'));}})[_0x32ef('0xf')](function(_0x42c7f4){_0x3cac2e['contact']=_0x42c7f4;if(_0x42c7f4){if(!_0x57a3c0['body'][_0x32ef('0x15')]['messageId']){_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')]=rs[_0x32ef('0x52')]()+'\x20'+_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x32')];}var _0x316547={'ContactId':_0x42c7f4['id'],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['messageId'],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0['body'][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['subject'],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x32ef('0x54')]['find']({'where':{'closed':![],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x32ef('0x51')],'where':{'messageId':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['inReplyTo']}}]})[_0x32ef('0xf')](function(_0x222b24){if(_0x222b24){return[_0x222b24,![]];}return db[_0x32ef('0x54')]['create'](_0x316547)[_0x32ef('0xf')](function(_0x12b7f8){return[_0x12b7f8,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x2e20dc,_0x3a6697){if(_0x2e20dc){_0x765c63=_0x3a6697;if(!_0x3a6697){return _0x2e20dc[_0x32ef('0x55')]({'inReplyTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x51')],'to':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x32')],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x2e20dc[_0x32ef('0x53')]?_0x2e20dc[_0x32ef('0x53')]:_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x53')],'substatus':null,'substatusAt':moment()[_0x32ef('0x57')](_0x32ef('0x58')),'lastMsgAt':moment()[_0x32ef('0x57')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2e20dc;}}})['then'](function(_0x2125de){_0x3cac2e[_0x32ef('0x59')]=_0x2125de[_0x32ef('0x41')]({'plain':!![]});_0x3cac2e[_0x32ef('0x59')][_0x32ef('0x5a')]=_0x765c63;return db['MailMessage'][_0x32ef('0x4f')]({'body':_0x57a3c0['body'][_0x32ef('0x29')],'MailAccountId':_0x57a3c0[_0x32ef('0x42')]['id'],'MailInteractionId':_0x2125de['id'],'direction':'in','ContactId':_0x3cac2e['contact']['id'],'messageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x51')],'from':_0x57a3c0[_0x32ef('0x29')]['message']['from'],'to':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['to'],'cc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['cc'],'subject':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x56')],'attach':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x53')],'Attachments':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5b')],'originTo':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')][_0x32ef('0x5c')],'originCc':_0x57a3c0[_0x32ef('0x29')]['message']['originCc'],'bcc':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['bcc'],'ChatWebsiteId':_0x57a3c0[_0x32ef('0x29')]['message'][_0x32ef('0x5d')]||null,'originChannel':_0x57a3c0[_0x32ef('0x29')][_0x32ef('0x15')]['originChannel']||_0x32ef('0x5e'),'ChatOfflineMessageId':_0x57a3c0['body'][_0x32ef('0x15')][_0x32ef('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x32ef('0xf')](function(_0x5970db){_0x3cac2e[_0x32ef('0x15')]=_0x5970db;if(_0x3cac2e['interaction'][_0x32ef('0x60')]){return db[_0x32ef('0x61')][_0x32ef('0x21')]({'attributes':['id','name'],'where':{'id':_0x3cac2e['interaction']['UserId']}})[_0x32ef('0xf')](function(_0x5e5766){if(_0x5e5766){_0x3cac2e[_0x32ef('0x45')][_0x32ef('0x62')]({'id':0x0,'priority':0x0,'app':_0x32ef('0x63'),'appdata':_0x5e5766[_0x32ef('0x64')]+','+(_0x3cac2e[_0x32ef('0x42')][_0x32ef('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x32ef('0x66'),'startRouting',_0x3cac2e);});}return respondWithRpcPromise('Start',_0x32ef('0x67'),_0x3cac2e);})['then'](function(_0x145e27){_0x4615b4(_0x145e27);})[_0x32ef('0x17')](function(_0x4d64ec){_0x48e071(_0xb4db74[_0x32ef('0x14')](0x1f4,_0x4d64ec[_0x32ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 353ffbb..7b47f94 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 _0x5bf9=['length','save','remove','update','emit','removeListener','register'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x5bf9,0xa2));var _0x95bf=function(_0x3eada3,_0x3572ed){_0x3eada3=_0x3eada3-0x0;var _0x3d6779=_0x5bf9[_0x3eada3];return _0x3d6779;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x95bf('0x0'),_0x95bf('0x1'),_0x95bf('0x2')];function createListener(_0x5a279a,_0x28b665){return function(_0x405352){_0x28b665[_0x95bf('0x3')](_0x5a279a,_0x405352);};}function removeListener(_0x4fc39e,_0x4525bc){return function(){MailAccountEvents[_0x95bf('0x4')](_0x4fc39e,_0x4525bc);};}exports[_0x95bf('0x5')]=function(_0x2cd685){for(var _0x298fc6=0x0,_0x47de40=events[_0x95bf('0x6')];_0x298fc6<_0x47de40;_0x298fc6++){var _0x487e36=events[_0x298fc6];var _0x3b3f63=createListener('mailAccount:'+_0x487e36,_0x2cd685);MailAccountEvents['on'](_0x487e36,_0x3b3f63);}}; \ No newline at end of file +var _0x60e0=['update','emit','register','mailAccount:','./mailAccount.events'];(function(_0x416f7d,_0x520481){var _0x2aca73=function(_0x26ef87){while(--_0x26ef87){_0x416f7d['push'](_0x416f7d['shift']());}};_0x2aca73(++_0x520481);}(_0x60e0,0x176));var _0x060e=function(_0x72e232,_0x3baec6){_0x72e232=_0x72e232-0x0;var _0x4f497c=_0x60e0[_0x72e232];return _0x4f497c;};'use strict';var MailAccountEvents=require(_0x060e('0x0'));var events=['save','remove',_0x060e('0x1')];function createListener(_0x5c842d,_0x256ca7){return function(_0x46598a){_0x256ca7[_0x060e('0x2')](_0x5c842d,_0x46598a);};}function removeListener(_0x419c26,_0x2a6e9f){return function(){MailAccountEvents['removeListener'](_0x419c26,_0x2a6e9f);};}exports[_0x060e('0x3')]=function(_0x2b4242){for(var _0x407136=0x0,_0x52c937=events['length'];_0x407136<_0x52c937;_0x407136++){var _0xedfa6c=events[_0x407136];var _0x3e50a2=createListener(_0x060e('0x4')+_0xedfa6c,_0x2b4242);MailAccountEvents['on'](_0xedfa6c,_0x3e50a2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 4b3a4d9..4b0509a 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 _0xac80=['../../config/environment','get','/:id','isAuthenticated','update','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e1f74,_0x567dc9){var _0x4fba1e=function(_0x3023bc){while(--_0x3023bc){_0x3e1f74['push'](_0x3e1f74['shift']());}};_0x4fba1e(++_0x567dc9);}(_0xac80,0x11b));var _0x0ac8=function(_0x114fec,_0x5dd74a){_0x114fec=_0x114fec-0x0;var _0x56a690=_0xac80[_0x114fec];return _0x56a690;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ac8('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ac8('0x1')]();var fs_extra=require(_0x0ac8('0x2'));var auth=require(_0x0ac8('0x3'));var interaction=require(_0x0ac8('0x4'));var config=require(_0x0ac8('0x5'));var controller=require('./mailApplication.controller');router[_0x0ac8('0x6')](_0x0ac8('0x7'),auth[_0x0ac8('0x8')](),controller['show']);router['put']('/:id',auth[_0x0ac8('0x8')](),controller[_0x0ac8('0x9')]);router[_0x0ac8('0xa')](_0x0ac8('0x7'),auth['isAuthenticated'](),controller[_0x0ac8('0xb')]);module['exports']=router; \ No newline at end of file +var _0x8fed=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','put','isAuthenticated','delete','destroy','multer'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8fed,0x18f));var _0xd8fe=function(_0x482833,_0x2b1059){_0x482833=_0x482833-0x0;var _0x26a75a=_0x8fed[_0x482833];return _0x26a75a;};'use strict';var multer=require(_0xd8fe('0x0'));var util=require(_0xd8fe('0x1'));var path=require(_0xd8fe('0x2'));var timeout=require(_0xd8fe('0x3'));var express=require(_0xd8fe('0x4'));var router=express[_0xd8fe('0x5')]();var fs_extra=require(_0xd8fe('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd8fe('0x7'));var config=require(_0xd8fe('0x8'));var controller=require(_0xd8fe('0x9'));router[_0xd8fe('0xa')](_0xd8fe('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd8fe('0xc')]('/:id',auth[_0xd8fe('0xd')](),controller['update']);router[_0xd8fe('0xe')](_0xd8fe('0xb'),auth[_0xd8fe('0xd')](),controller[_0xd8fe('0xf')]);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 eacaa71..268e983 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 _0xff24=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0xff24,0x109));var _0x4ff2=function(_0x3cd74c,_0x33f558){_0x3cd74c=_0x3cd74c-0x0;var _0xa61b9f=_0xff24[_0x3cd74c];return _0xa61b9f;};'use strict';var Sequelize=require(_0x4ff2('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4ff2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4ff2('0x2')],'allowNull':![],'defaultValue':_0x4ff2('0x3')},'appdata':{'type':Sequelize[_0x4ff2('0x4')]()},'description':{'type':Sequelize[_0x4ff2('0x2')]},'interval':{'type':Sequelize[_0x4ff2('0x2')],'defaultValue':_0x4ff2('0x5')}}; \ No newline at end of file +var _0xb5c7=['sequelize','STRING','noop'];(function(_0x94780e,_0x4b9354){var _0x2bfd86=function(_0x31b474){while(--_0x31b474){_0x94780e['push'](_0x94780e['shift']());}};_0x2bfd86(++_0x4b9354);}(_0xb5c7,0xc3));var _0x7b5c=function(_0x12cf7b,_0x55dbb9){_0x12cf7b=_0x12cf7b-0x0;var _0x90b7b5=_0xb5c7[_0x12cf7b];return _0x90b7b5;};'use strict';var Sequelize=require(_0x7b5c('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7b5c('0x1')],'allowNull':![],'defaultValue':_0x7b5c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7b5c('0x1')]},'interval':{'type':Sequelize[_0x7b5c('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9a3d613..31cbc80 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 _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(_0x2a9e6f,_0x216211){var _0x1159d1=function(_0x86dcc0){while(--_0x86dcc0){_0x2a9e6f['push'](_0x2a9e6f['shift']());}};_0x1159d1(++_0x216211);}(_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 +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1786b8,_0x23061b){var _0x5d9797=function(_0x45b88c){while(--_0x45b88c){_0x1786b8['push'](_0x1786b8['shift']());}};_0x5d9797(++_0x23061b);}(_0xac4a,0x13f));var _0xaac4=function(_0x2951d2,_0x3a969b){_0x2951d2=_0x2951d2-0x0;var _0x123315=_0xac4a[_0x2951d2];return _0x123315;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 38b1ccc..68fb0ea 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 _0x7bbf=['bluebird','path','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7bbf,0x19e));var _0xf7bb=function(_0x11689e,_0x4572b0){_0x11689e=_0x11689e-0x0;var _0x2a8c31=_0x7bbf[_0x11689e];return _0x2a8c31;};'use strict';var _=require(_0xf7bb('0x0'));var util=require(_0xf7bb('0x1'));var logger=require(_0xf7bb('0x2'))(_0xf7bb('0x3'));var moment=require('moment');var BPromise=require(_0xf7bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7bb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf7bb('0x6'));module[_0xf7bb('0x7')]=function(_0x52bf25,_0xf83043){return _0x52bf25['define'](_0xf7bb('0x8'),attributes,{'tableName':_0xf7bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf7bb('0xa')});}; \ No newline at end of file +var _0xcf38=['api','moment','request-promise','path','rimraf','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x28ae95,_0x4536c9){var _0x5d3a74=function(_0x4f3211){while(--_0x4f3211){_0x28ae95['push'](_0x28ae95['shift']());}};_0x5d3a74(++_0x4536c9);}(_0xcf38,0xe7));var _0x8cf3=function(_0x544463,_0x214963){_0x544463=_0x544463-0x0;var _0x1add2a=_0xcf38[_0x544463];return _0x1add2a;};'use strict';var _=require(_0x8cf3('0x0'));var util=require(_0x8cf3('0x1'));var logger=require(_0x8cf3('0x2'))(_0x8cf3('0x3'));var moment=require(_0x8cf3('0x4'));var BPromise=require('bluebird');var rp=require(_0x8cf3('0x5'));var fs=require('fs');var path=require(_0x8cf3('0x6'));var rimraf=require(_0x8cf3('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x8cf3('0x8')]=function(_0xf6c52c,_0x3b37f7){return _0xf6c52c[_0x8cf3('0x9')](_0x8cf3('0xa'),attributes,{'tableName':_0x8cf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8cf3('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 4072eda..9ba5efc 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 _0x0b6e=['client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','then','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb84be7,_0x51247e){var _0x1b03e2=function(_0x40b89a){while(--_0x40b89a){_0xb84be7['push'](_0xb84be7['shift']());}};_0x1b03e2(++_0x51247e);}(_0x0b6e,0x164));var _0xe0b6=function(_0x15e782,_0x4f825d){_0x15e782=_0x15e782-0x0;var _0x2ea84b=_0x0b6e[_0x15e782];return _0x2ea84b;};'use strict';var _=require(_0xe0b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe0b6('0x1'));var rs=require(_0xe0b6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0b6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0b6('0x4'))(_0xe0b6('0x5'));var config=require(_0xe0b6('0x6'));var jayson=require(_0xe0b6('0x7'));var client=jayson[_0xe0b6('0x8')][_0xe0b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42f8e9,_0x290bf1,_0x24cec8){return new BPromise(function(_0x2e3362,_0x5c47a3){return client['request'](_0x42f8e9,_0x24cec8)['then'](function(_0x1200cb){logger[_0xe0b6('0xa')](_0xe0b6('0xb'),_0x290bf1,_0xe0b6('0xc'));logger['debug'](_0xe0b6('0xd'),_0x290bf1,_0xe0b6('0xc'),JSON[_0xe0b6('0xe')](_0x1200cb));if(_0x1200cb['error']){if(_0x1200cb[_0xe0b6('0xf')][_0xe0b6('0x10')]===0x1f4){logger[_0xe0b6('0xf')](_0xe0b6('0xb'),_0x290bf1,_0x1200cb[_0xe0b6('0xf')][_0xe0b6('0x11')]);return _0x5c47a3(_0x1200cb[_0xe0b6('0xf')][_0xe0b6('0x11')]);}logger[_0xe0b6('0xf')]('MailApplication,\x20%s,\x20%s',_0x290bf1,_0x1200cb[_0xe0b6('0xf')][_0xe0b6('0x11')]);return _0x2e3362(_0x1200cb['error'][_0xe0b6('0x11')]);}else{logger[_0xe0b6('0xa')](_0xe0b6('0xb'),_0x290bf1,'request\x20sent');_0x2e3362(_0x1200cb['result'][_0xe0b6('0x11')]);}})[_0xe0b6('0x12')](function(_0x5c2a52){logger[_0xe0b6('0xf')](_0xe0b6('0xb'),_0x290bf1,_0x5c2a52);_0x5c47a3(_0x5c2a52);});});}exports[_0xe0b6('0x13')]=function(_0x44ec42){var _0x277169=this;return new Promise(function(_0x46f782,_0x101cf5){return db[_0xe0b6('0x14')][_0xe0b6('0x15')](_0x44ec42[_0xe0b6('0x16')],{'raw':_0x44ec42[_0xe0b6('0x17')]?_0x44ec42[_0xe0b6('0x17')][_0xe0b6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44ec42[_0xe0b6('0x17')]?_0x44ec42[_0xe0b6('0x17')][_0xe0b6('0x19')]||null:null,'attributes':_0x44ec42[_0xe0b6('0x17')]?_0x44ec42[_0xe0b6('0x17')][_0xe0b6('0x1a')]||null:null,'limit':_0x44ec42['options']?_0x44ec42[_0xe0b6('0x17')]['limit']||null:null})[_0xe0b6('0x1b')](function(_0x1e0f3e){logger['info'](_0xe0b6('0x13'),_0x44ec42);logger['debug'](_0xe0b6('0x13'),_0x44ec42,JSON[_0xe0b6('0xe')](_0x1e0f3e));_0x46f782(_0x1e0f3e);})[_0xe0b6('0x12')](function(_0x574583){logger['error']('UpdateMailApplication',_0x574583['message'],_0x44ec42);_0x101cf5(_0x277169[_0xe0b6('0xf')](0x1f4,_0x574583[_0xe0b6('0x11')]));});});}; \ No newline at end of file +var _0xf6b2=['UpdateMailApplication','MailApplication','options','raw','where','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x30b2c6,_0x1eafe8){var _0x42052d=function(_0xfeb539){while(--_0xfeb539){_0x30b2c6['push'](_0x30b2c6['shift']());}};_0x42052d(++_0x1eafe8);}(_0xf6b2,0x115));var _0x2f6b=function(_0x165e9f,_0x318732){_0x165e9f=_0x165e9f-0x0;var _0x430a9e=_0xf6b2[_0x165e9f];return _0x430a9e;};'use strict';var _=require(_0x2f6b('0x0'));var util=require(_0x2f6b('0x1'));var moment=require(_0x2f6b('0x2'));var BPromise=require(_0x2f6b('0x3'));var rs=require(_0x2f6b('0x4'));var fs=require('fs');var Redis=require(_0x2f6b('0x5'));var db=require(_0x2f6b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f6b('0x7'))(_0x2f6b('0x8'));var config=require(_0x2f6b('0x9'));var jayson=require(_0x2f6b('0xa'));var client=jayson['client'][_0x2f6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dac0d,_0x106ea6,_0x495dbe){return new BPromise(function(_0x3cb513,_0x5b9cc7){return client[_0x2f6b('0xc')](_0x5dac0d,_0x495dbe)['then'](function(_0x3f5d14){logger[_0x2f6b('0xd')](_0x2f6b('0xe'),_0x106ea6,'request\x20sent');logger[_0x2f6b('0xf')](_0x2f6b('0x10'),_0x106ea6,'request\x20sent',JSON[_0x2f6b('0x11')](_0x3f5d14));if(_0x3f5d14['error']){if(_0x3f5d14['error']['code']===0x1f4){logger['error'](_0x2f6b('0xe'),_0x106ea6,_0x3f5d14[_0x2f6b('0x12')][_0x2f6b('0x13')]);return _0x5b9cc7(_0x3f5d14[_0x2f6b('0x12')]['message']);}logger[_0x2f6b('0x12')](_0x2f6b('0xe'),_0x106ea6,_0x3f5d14[_0x2f6b('0x12')][_0x2f6b('0x13')]);return _0x3cb513(_0x3f5d14[_0x2f6b('0x12')]['message']);}else{logger[_0x2f6b('0xd')](_0x2f6b('0xe'),_0x106ea6,_0x2f6b('0x14'));_0x3cb513(_0x3f5d14[_0x2f6b('0x15')][_0x2f6b('0x13')]);}})[_0x2f6b('0x16')](function(_0x2ccf6d){logger[_0x2f6b('0x12')](_0x2f6b('0xe'),_0x106ea6,_0x2ccf6d);_0x5b9cc7(_0x2ccf6d);});});}exports[_0x2f6b('0x17')]=function(_0x187965){var _0x4ad4a7=this;return new Promise(function(_0x555d1d,_0x51d204){return db[_0x2f6b('0x18')]['update'](_0x187965['body'],{'raw':_0x187965['options']?_0x187965[_0x2f6b('0x19')][_0x2f6b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x187965[_0x2f6b('0x19')]?_0x187965[_0x2f6b('0x19')][_0x2f6b('0x1b')]||null:null,'attributes':_0x187965['options']?_0x187965[_0x2f6b('0x19')]['attributes']||null:null,'limit':_0x187965[_0x2f6b('0x19')]?_0x187965[_0x2f6b('0x19')][_0x2f6b('0x1c')]||null:null})[_0x2f6b('0x1d')](function(_0x492827){logger[_0x2f6b('0xd')](_0x2f6b('0x17'),_0x187965);logger[_0x2f6b('0xf')](_0x2f6b('0x17'),_0x187965,JSON['stringify'](_0x492827));_0x555d1d(_0x492827);})[_0x2f6b('0x16')](function(_0x57b1ee){logger[_0x2f6b('0x12')](_0x2f6b('0x17'),_0x57b1ee[_0x2f6b('0x13')],_0x187965);_0x51d204(_0x4ad4a7['error'](0x1f4,_0x57b1ee[_0x2f6b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index c8ece99..5dc8a1e 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 _0x0e1f=['exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','/:id/tags','tracked','mailinteraction:addtags','put','mailinteraction:update','update','mail','mailinteraction:destroy','destroy'];(function(_0x180bd3,_0x240488){var _0x2c7250=function(_0x949746){while(--_0x949746){_0x180bd3['push'](_0x180bd3['shift']());}};_0x2c7250(++_0x240488);}(_0x0e1f,0x139));var _0xf0e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e1f[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0xf0e1('0x0'));var router=express[_0xf0e1('0x1')]();var auth=require(_0xf0e1('0x2'));var interaction=require(_0xf0e1('0x3'));var controller=require(_0xf0e1('0x4'));router[_0xf0e1('0x5')]('/',auth[_0xf0e1('0x6')](),controller[_0xf0e1('0x7')]);router[_0xf0e1('0x5')](_0xf0e1('0x8'),auth[_0xf0e1('0x6')](),controller[_0xf0e1('0x9')]);router[_0xf0e1('0x5')](_0xf0e1('0xa'),auth['isAuthenticated'](),controller[_0xf0e1('0xb')]);router[_0xf0e1('0x5')]('/:id/messages',auth[_0xf0e1('0x6')](),controller[_0xf0e1('0xc')]);router[_0xf0e1('0x5')](_0xf0e1('0xd'),auth[_0xf0e1('0x6')](),controller['download']);router[_0xf0e1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf0e1('0xe')](_0xf0e1('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0xf0e1('0xe')](_0xf0e1('0x10'),auth['isAuthenticated'](),interaction[_0xf0e1('0x11')]('mail',_0xf0e1('0x12')),controller['addTags']);router[_0xf0e1('0x13')](_0xf0e1('0xa'),auth[_0xf0e1('0x6')](),interaction[_0xf0e1('0x11')]('mail',_0xf0e1('0x14')),controller[_0xf0e1('0x15')]);router['delete'](_0xf0e1('0xa'),auth[_0xf0e1('0x6')](),interaction['tracked'](_0xf0e1('0x16'),_0xf0e1('0x17')),controller[_0xf0e1('0x18')]);router['delete'](_0xf0e1('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0xf0e1('0x19')]=router; \ No newline at end of file +var _0xf699=['mail','mailinteraction:destroy','destroy','/:id/tags','removeTags','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','/:id','/:id/download','download','post','create','/:id/messages','addMessage','tracked','mailinteraction:addtags','addTags','put','mailinteraction:update','delete'];(function(_0x57dc4b,_0x5b23d3){var _0x1304c1=function(_0x3ccee2){while(--_0x3ccee2){_0x57dc4b['push'](_0x57dc4b['shift']());}};_0x1304c1(++_0x5b23d3);}(_0xf699,0x1c7));var _0x9f69=function(_0x472c85,_0x401195){_0x472c85=_0x472c85-0x0;var _0x5dfe9d=_0xf699[_0x472c85];return _0x5dfe9d;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x9f69('0x0'));var interaction=require(_0x9f69('0x1'));var controller=require(_0x9f69('0x2'));router[_0x9f69('0x3')]('/',auth['isAuthenticated'](),controller[_0x9f69('0x4')]);router[_0x9f69('0x3')](_0x9f69('0x5'),auth[_0x9f69('0x6')](),controller['describe']);router[_0x9f69('0x3')](_0x9f69('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9f69('0x3')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x9f69('0x3')](_0x9f69('0x8'),auth[_0x9f69('0x6')](),controller[_0x9f69('0x9')]);router[_0x9f69('0xa')]('/',auth[_0x9f69('0x6')](),controller[_0x9f69('0xb')]);router[_0x9f69('0xa')](_0x9f69('0xc'),auth[_0x9f69('0x6')](),controller[_0x9f69('0xd')]);router[_0x9f69('0xa')]('/:id/tags',auth[_0x9f69('0x6')](),interaction[_0x9f69('0xe')]('mail',_0x9f69('0xf')),controller[_0x9f69('0x10')]);router[_0x9f69('0x11')]('/:id',auth[_0x9f69('0x6')](),interaction['tracked']('mail',_0x9f69('0x12')),controller['update']);router[_0x9f69('0x13')](_0x9f69('0x7'),auth[_0x9f69('0x6')](),interaction['tracked'](_0x9f69('0x14'),_0x9f69('0x15')),controller[_0x9f69('0x16')]);router[_0x9f69('0x13')](_0x9f69('0x17'),auth[_0x9f69('0x6')](),controller[_0x9f69('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 3992fe1..303a8b9 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 _0xb6af=['ENUM','BOOLEAN','sequelize','iconv','exports','DATE','STRING','TEXT','long','out'];(function(_0x55edf0,_0x24c842){var _0x47b114=function(_0x2cc2f4){while(--_0x2cc2f4){_0x55edf0['push'](_0x55edf0['shift']());}};_0x47b114(++_0x24c842);}(_0xb6af,0x1ce));var _0xfb6a=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0xb6af[_0x55b037];return _0x5f1053;};'use strict';var Sequelize=require(_0xfb6a('0x0'));var iconv=require(_0xfb6a('0x1'));module[_0xfb6a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfb6a('0x3')]},'disposition':{'type':Sequelize[_0xfb6a('0x4')]},'secondDisposition':{'type':Sequelize[_0xfb6a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfb6a('0x4')]},'note':{'type':Sequelize[_0xfb6a('0x4')]},'inReplyTo':{'type':Sequelize[_0xfb6a('0x4')](0x1fe)},'to':{'type':Sequelize[_0xfb6a('0x4')]},'cc':{'type':Sequelize[_0xfb6a('0x5')](_0xfb6a('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfb6a('0x3')]},'substatus':{'type':Sequelize[_0xfb6a('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xfb6a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfb6a('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfb6a('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfb6a('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x9b70=['iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','sequelize'];(function(_0xcdd786,_0x1ed6d3){var _0x4b6fe0=function(_0x3a3f92){while(--_0x3a3f92){_0xcdd786['push'](_0xcdd786['shift']());}};_0x4b6fe0(++_0x1ed6d3);}(_0x9b70,0x8b));var _0x09b7=function(_0x189dbd,_0x1d3cad){_0x189dbd=_0x189dbd-0x0;var _0x7861fb=_0x9b70[_0x189dbd];return _0x7861fb;};'use strict';var Sequelize=require(_0x09b7('0x0'));var iconv=require(_0x09b7('0x1'));module[_0x09b7('0x2')]={'closed':{'type':Sequelize[_0x09b7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x09b7('0x4')]},'secondDisposition':{'type':Sequelize[_0x09b7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x09b7('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x09b7('0x4')](0x1fe)},'to':{'type':Sequelize[_0x09b7('0x4')]},'cc':{'type':Sequelize[_0x09b7('0x5')](_0x09b7('0x6'))},'subject':{'type':Sequelize[_0x09b7('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x09b7('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x09b7('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x09b7('0x8')]('in',_0x09b7('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x09b7('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x09b7('0x8')]('in',_0x09b7('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x09b7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 5a0cb7b..b211027 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 _0xc982=['addMessage','ids','omit','getMessages','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','where','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','true','rows','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','toString','join','server','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','from','bcc','get','each','missing.recipient@your.company.com','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','./mailInteraction.socket','register','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','sendStatus','error','stack','name','send','fieldName','type','key','getOptions','findAll','mail','query','user','show','params','model','keys','MailInteraction','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','catch','MailMessage'];(function(_0x3e2116,_0x58c921){var _0x4e2952=function(_0x380424){while(--_0x380424){_0x3e2116['push'](_0x3e2116['shift']());}};_0x4e2952(++_0x58c921);}(_0xc982,0x180));var _0x2c98=function(_0xf8bd98,_0x722df){_0xf8bd98=_0xf8bd98-0x0;var _0x34e8af=_0xc982[_0xf8bd98];return _0x34e8af;};'use strict';var emlformat=require(_0x2c98('0x0'));var rimraf=require(_0x2c98('0x1'));var zipdir=require('zip-dir');var moment=require(_0x2c98('0x2'));var BPromise=require(_0x2c98('0x3'));var util=require(_0x2c98('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x2c98('0x5'));var juice=require(_0x2c98('0x6'));var Redis=require('ioredis');var interaction=require(_0x2c98('0x7'));var qs=require(_0x2c98('0x8'));var logger=require(_0x2c98('0x9'))(_0x2c98('0xa'));var config=require(_0x2c98('0xb'));var db=require(_0x2c98('0xc'))['db'];var htmlEntities=require(_0x2c98('0xd'));config['redis']=_['defaults'](config[_0x2c98('0xe')],{'host':_0x2c98('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c98('0xe')]));require(_0x2c98('0x10'))[_0x2c98('0x11')](socket);function respondWithStatusCode(_0x50aa3c,_0x59fce5){_0x59fce5=_0x59fce5||0xcc;return function(_0x3ec064){if(_0x3ec064){return _0x50aa3c['sendStatus'](_0x59fce5);}return _0x50aa3c['status'](_0x59fce5)[_0x2c98('0x12')]();};}function respondWithResult(_0x424af1,_0x56a300){_0x56a300=_0x56a300||0xc8;return function(_0x52c83e){if(_0x52c83e){return _0x424af1[_0x2c98('0x13')](_0x56a300)[_0x2c98('0x14')](_0x52c83e);}};}function respondWithFilteredResult(_0x35cb5e,_0x18e462){return function(_0x576fae){if(_0x576fae){var _0x1b9cb9=typeof _0x18e462[_0x2c98('0x15')]===_0x2c98('0x16')&&typeof _0x18e462['limit']===_0x2c98('0x16');var _0x16908f=_0x576fae[_0x2c98('0x17')];var _0x14898d=_0x1b9cb9?0x0:_0x18e462[_0x2c98('0x15')];var _0x53b901=_0x1b9cb9?_0x576fae[_0x2c98('0x17')]:_0x18e462[_0x2c98('0x15')]+_0x18e462[_0x2c98('0x18')];var _0x3f3d06;if(_0x53b901>=_0x16908f){_0x53b901=_0x16908f;_0x3f3d06=0xc8;}else{_0x3f3d06=0xce;}_0x35cb5e[_0x2c98('0x13')](_0x3f3d06);return _0x35cb5e[_0x2c98('0x19')](_0x2c98('0x1a'),_0x14898d+'-'+_0x53b901+'/'+_0x16908f)[_0x2c98('0x14')](_0x576fae);}return null;};}function saveUpdates(_0x48b2f0){return function(_0xfc23a){if(_0xfc23a){return _0xfc23a[_0x2c98('0x1b')](_0x48b2f0)['then'](function(_0x396556){return _0x396556;});}return null;};}function removeEntity(_0x2a0bcc){return function(_0xe33696){if(_0xe33696){return _0xe33696['destroy']()[_0x2c98('0x1c')](function(){_0x2a0bcc[_0x2c98('0x13')](0xcc)[_0x2c98('0x12')]();});}};}function handleEntityNotFound(_0x3bd13f){return function(_0xc9f58a){if(!_0xc9f58a){_0x3bd13f[_0x2c98('0x1d')](0x194);}return _0xc9f58a;};}function handleError(_0x3ef8fe,_0x3d5fbf){_0x3d5fbf=_0x3d5fbf||0x1f4;return function(_0x3555bb){logger[_0x2c98('0x1e')](_0x3555bb[_0x2c98('0x1f')]);if(_0x3555bb[_0x2c98('0x20')]){delete _0x3555bb[_0x2c98('0x20')];}_0x3ef8fe[_0x2c98('0x13')](_0x3d5fbf)[_0x2c98('0x21')](_0x3555bb);};}exports['index']=function(_0x5f247d,_0x200751){var _0x723332={};var _0x4ffae4=_['map'](db['MailInteraction']['rawAttributes'],function(_0x2e7ae9){return{'name':_0x2e7ae9[_0x2c98('0x22')],'type':_0x2e7ae9[_0x2c98('0x23')][_0x2c98('0x24')]};});_0x723332=qs[_0x2c98('0x25')](_0x4ffae4,_0x5f247d);return interaction[_0x2c98('0x26')](_0x2c98('0x27'),_0x5f247d[_0x2c98('0x28')],_0x5f247d[_0x2c98('0x29')],_0x723332,_0x4ffae4)[_0x2c98('0x1c')](respondWithFilteredResult(_0x200751,_0x723332))['catch'](handleError(_0x200751,null));};exports[_0x2c98('0x2a')]=function(_0x182df0,_0x79ec02){var _0x1663ed={'raw':![],'where':{'id':_0x182df0[_0x2c98('0x2b')]['id']}},_0x20f211={};_0x20f211[_0x2c98('0x2c')]=_[_0x2c98('0x2d')](db[_0x2c98('0x2e')]['rawAttributes']);_0x20f211['query']=_['keys'](_0x182df0[_0x2c98('0x28')]);_0x20f211[_0x2c98('0x2f')]=_[_0x2c98('0x30')](_0x20f211[_0x2c98('0x2c')],_0x20f211['query']);_0x1663ed[_0x2c98('0x31')]=_[_0x2c98('0x30')](_0x20f211['model'],qs[_0x2c98('0x32')](_0x182df0[_0x2c98('0x28')]['fields']));_0x1663ed['attributes']=_0x1663ed[_0x2c98('0x31')][_0x2c98('0x33')]?_0x1663ed[_0x2c98('0x31')]:_0x20f211[_0x2c98('0x2c')];if(_0x182df0['query'][_0x2c98('0x34')]){_0x1663ed['include']=[{'all':!![]}];}_0x1663ed=_[_0x2c98('0x35')]({},_0x1663ed,_0x182df0[_0x2c98('0x36')]);return db[_0x2c98('0x2e')][_0x2c98('0x37')](_0x1663ed)[_0x2c98('0x1c')](handleEntityNotFound(_0x79ec02,null))[_0x2c98('0x1c')](respondWithResult(_0x79ec02,null))['catch'](handleError(_0x79ec02,null));};exports[_0x2c98('0x38')]=function(_0x1a6959,_0x310aef){return db[_0x2c98('0x2e')]['create'](_0x1a6959[_0x2c98('0x39')],{})[_0x2c98('0x1c')](respondWithResult(_0x310aef,0xc9))[_0x2c98('0x3a')](handleError(_0x310aef,null));};exports[_0x2c98('0x1b')]=function(_0x4ee2bf,_0x369873){if(_0x4ee2bf['body']['id']){delete _0x4ee2bf[_0x2c98('0x39')]['id'];}return db[_0x2c98('0x2e')][_0x2c98('0x37')]({'where':{'id':_0x4ee2bf[_0x2c98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x369873,null))[_0x2c98('0x1c')](saveUpdates(_0x4ee2bf['body'],null))['then'](respondWithResult(_0x369873,null))[_0x2c98('0x3a')](handleError(_0x369873,null));};exports['destroy']=function(_0x4b5463,_0x48f8d8){return db['MailInteraction'][_0x2c98('0x37')]({'where':{'id':_0x4b5463[_0x2c98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x48f8d8,null))[_0x2c98('0x1c')](removeEntity(_0x48f8d8,null))[_0x2c98('0x3a')](handleError(_0x48f8d8,null));};exports['describe']=function(_0x1c5cf1,_0x396409){return db['MailInteraction']['describe']()[_0x2c98('0x1c')](respondWithResult(_0x396409,null))['catch'](handleError(_0x396409,null));};exports['addMessage']=function(_0x5aaba2,_0x3f3347){return db[_0x2c98('0x3b')][_0x2c98('0x37')]({'where':{'id':_0x5aaba2[_0x2c98('0x2b')]['id']}})[_0x2c98('0x1c')](handleEntityNotFound(_0x3f3347,null))[_0x2c98('0x1c')](function(_0x170dc1){if(_0x170dc1){return _0x170dc1[_0x2c98('0x3c')](_0x5aaba2[_0x2c98('0x39')][_0x2c98('0x3d')],_[_0x2c98('0x3e')](_0x5aaba2[_0x2c98('0x39')],[_0x2c98('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3f3347,null))[_0x2c98('0x3a')](handleError(_0x3f3347,null));};exports[_0x2c98('0x3f')]=function(_0x39b04b,_0xc239c5){var _0x5cb3fc={'raw':![],'where':{}};var _0x2c8d1f={};var _0x1e5cce={'count':0x0,'rows':[]};return db[_0x2c98('0x2e')]['findOne']({'where':{'id':_0x39b04b[_0x2c98('0x2b')]['id']}})[_0x2c98('0x1c')](handleEntityNotFound(_0xc239c5,null))['then'](function(_0xe2f20c){if(_0xe2f20c){_0x2c8d1f[_0x2c98('0x2c')]=_['keys'](db[_0x2c98('0x3b')][_0x2c98('0x40')]);_0x2c8d1f[_0x2c98('0x28')]=_[_0x2c98('0x2d')](_0x39b04b['query']);_0x2c8d1f[_0x2c98('0x2f')]=_[_0x2c98('0x30')](_0x2c8d1f[_0x2c98('0x2c')],_0x2c8d1f[_0x2c98('0x28')]);_0x5cb3fc[_0x2c98('0x31')]=_[_0x2c98('0x30')](_0x2c8d1f[_0x2c98('0x2c')],qs[_0x2c98('0x32')](_0x39b04b[_0x2c98('0x28')][_0x2c98('0x32')]));_0x5cb3fc[_0x2c98('0x31')]=_0x5cb3fc[_0x2c98('0x31')][_0x2c98('0x33')]?_0x5cb3fc['attributes']:_0x2c8d1f['model'];if(!_0x39b04b[_0x2c98('0x28')][_0x2c98('0x41')](_0x2c98('0x42'))){_0x5cb3fc[_0x2c98('0x18')]=qs[_0x2c98('0x18')](_0x39b04b['query'][_0x2c98('0x18')]);_0x5cb3fc[_0x2c98('0x15')]=qs[_0x2c98('0x15')](_0x39b04b['query']['offset']);}_0x5cb3fc[_0x2c98('0x43')]=qs[_0x2c98('0x44')](_0x39b04b[_0x2c98('0x28')][_0x2c98('0x44')]);_0x5cb3fc['where']=qs[_0x2c98('0x2f')](_[_0x2c98('0x45')](_0x39b04b[_0x2c98('0x28')],_0x2c8d1f[_0x2c98('0x2f')]));_0x5cb3fc['where']['MailInteractionId']=_0xe2f20c['id'];if(_0x39b04b['query']['filter']){_0x5cb3fc[_0x2c98('0x46')]=_[_0x2c98('0x35')](_0x5cb3fc[_0x2c98('0x46')],{'$or':_[_0x2c98('0x47')](_0x5cb3fc[_0x2c98('0x31')],function(_0x56686e){var _0x5f53b2={};_0x5f53b2[_0x56686e]={'$like':'%'+_0x39b04b[_0x2c98('0x28')][_0x2c98('0x48')]+'%'};return _0x5f53b2;})});}if(_0x39b04b[_0x2c98('0x28')]['$gte']){var _0x51bb56=_0x39b04b[_0x2c98('0x28')][_0x2c98('0x49')][_0x2c98('0x4a')](',');var _0x55fb8a={};_0x55fb8a[_0x51bb56[0x0]]={'$gte':moment(_0x51bb56[0x1])[_0x2c98('0x4b')](_0x2c98('0x4c'))};_0x5cb3fc['where']=_['merge'](_0x5cb3fc['where'],_0x55fb8a);}_0x5cb3fc=_[_0x2c98('0x35')]({},_0x5cb3fc,_0x39b04b[_0x2c98('0x36')]);return db[_0x2c98('0x3b')][_0x2c98('0x17')]({'where':_0x5cb3fc['where']})[_0x2c98('0x1c')](function(_0x3f5820){_0x1e5cce[_0x2c98('0x17')]=_0x3f5820;if(_0x39b04b[_0x2c98('0x28')][_0x2c98('0x34')]){_0x5cb3fc[_0x2c98('0x4d')]=[{'all':!![]}];}return db[_0x2c98('0x3b')][_0x2c98('0x26')](_0x5cb3fc);})[_0x2c98('0x1c')](function(_0x1c3273){if(_0x39b04b[_0x2c98('0x28')]['inlineCss']===_0x2c98('0x4e')){for(var _0x394693=0x0;_0x394693<_0x1c3273[_0x2c98('0x33')];_0x394693++){_0x1c3273[_0x394693][_0x2c98('0x39')]=juice(_0x1c3273[_0x394693][_0x2c98('0x39')]);}}_0x1e5cce[_0x2c98('0x4f')]=_0x1c3273;return _0x1e5cce;});}})[_0x2c98('0x1c')](respondWithFilteredResult(_0xc239c5,_0x5cb3fc))['catch'](handleError(_0xc239c5,null));};exports['addTags']=function(_0x152356,_0x1fcab2){return db[_0x2c98('0x2e')]['find']({'where':{'id':_0x152356[_0x2c98('0x2b')]['id']}})[_0x2c98('0x1c')](handleEntityNotFound(_0x1fcab2,null))[_0x2c98('0x1c')](function(_0x182c55){if(_0x182c55){return _0x182c55[_0x2c98('0x50')](_0x152356[_0x2c98('0x39')][_0x2c98('0x3d')],_[_0x2c98('0x3e')](_0x152356['body'],[_0x2c98('0x3d'),'id'])||{})[_0x2c98('0x51')](function(){return db['Tag'][_0x2c98('0x26')]({'attributes':['id',_0x2c98('0x20'),_0x2c98('0x52')],'where':{'id':_0x152356['body'][_0x2c98('0x3d')]}});})[_0x2c98('0x1c')](function(_0x5be482){socket[_0x2c98('0x53')](_0x2c98('0x54'),{'id':Number(_0x152356['params']['id']),'tags':_0x5be482||[]});return{'id':Number(_0x152356['params']['id']),'tags':_0x5be482||[]};});}})[_0x2c98('0x1c')](respondWithResult(_0x1fcab2,null))[_0x2c98('0x3a')](handleError(_0x1fcab2,null));};exports[_0x2c98('0x55')]=function(_0x324788,_0x3b0fd5){return db[_0x2c98('0x2e')][_0x2c98('0x37')]({'where':{'id':_0x324788[_0x2c98('0x2b')]['id']}})[_0x2c98('0x1c')](handleEntityNotFound(_0x3b0fd5,null))['then'](function(_0xa188c9){if(_0xa188c9){return _0xa188c9['removeTags'](_0x324788[_0x2c98('0x28')][_0x2c98('0x3d')]);}})[_0x2c98('0x1c')](respondWithStatusCode(_0x3b0fd5,null))[_0x2c98('0x3a')](handleError(_0x3b0fd5,null));};exports[_0x2c98('0x56')]=function(_0x594d33,_0x3feca4){var _0x5c6073=moment()['unix']()[_0x2c98('0x57')]();var _0x2cd1b6=path[_0x2c98('0x58')](config['root'],_0x2c98('0x59'),'files','tmp');var _0x563325=path[_0x2c98('0x58')](config[_0x2c98('0x5a')],_0x2c98('0x59'),'files',_0x2c98('0x5b'));var _0x6186cb=path[_0x2c98('0x58')](_0x2cd1b6,_0x5c6073);var _0x3f85e2=util[_0x2c98('0x4b')](_0x2c98('0x5c'),_0x594d33['params']['id'],_0x5c6073);var _0x48f4a6=path['join'](_0x2cd1b6,_0x3f85e2);var _0x1f9328=[];if(_0x594d33[_0x2c98('0x28')][_0x2c98('0x5b')]){_0x1f9328['push']({'model':db[_0x2c98('0x5d')],'as':_0x2c98('0x5e'),'raw':!![]});}var _0x586147=[{'model':db[_0x2c98('0x3b')],'as':_0x2c98('0x5f'),'attributes':['id',_0x2c98('0x39'),_0x2c98('0x60'),'to','cc',_0x2c98('0x61'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x2c98('0x44')]('id'),'include':_0x1f9328}];return db[_0x2c98('0x2e')][_0x2c98('0x37')]({'where':{'id':_0x594d33[_0x2c98('0x2b')]['id']},'include':_0x586147})[_0x2c98('0x1c')](handleEntityNotFound(_0x3feca4,null))[_0x2c98('0x1c')](function(_0x3f1d47){if(_0x3f1d47&&_0x3f1d47['Messages']){var _0x43ff41=_0x3f1d47[_0x2c98('0x62')]({'plain':!![]});fs['mkdirSync'](_0x6186cb);return BPromise[_0x2c98('0x63')](_0x43ff41[_0x2c98('0x5f')],function(_0x377850,_0x31c3d6){var _0x4124a3={'from':_0x377850[_0x2c98('0x60')],'to':_0x377850['to']||_0x2c98('0x64'),'subject':_0x377850[_0x2c98('0x65')],'html':htmlEntities[_0x2c98('0x66')](_0x377850[_0x2c98('0x39')]),'headers':{'Date':moment(_0x377850[_0x2c98('0x67')])[_0x2c98('0x4b')](_0x2c98('0x68'))},'attachments':[]};if(_0x377850['cc']){_0x4124a3[_0x2c98('0x69')]['Cc']=_0x377850['cc'];}if(_0x377850[_0x2c98('0x61')]){_0x4124a3[_0x2c98('0x69')]['Bcc']=_0x377850['bcc'];}return new BPromise(function(_0x7a268b,_0x48bb71){if(_0x377850[_0x2c98('0x5e')]){for(var _0x22e8b1=0x0;_0x22e8b1<_0x377850[_0x2c98('0x5e')]['length'];_0x22e8b1++){var _0x120369=_0x377850['Attachments'][_0x22e8b1];var _0x408bbf=path[_0x2c98('0x58')](_0x563325,_0x120369['basename']);if(fs['existsSync'](_0x408bbf)){_0x4124a3[_0x2c98('0x5b')][_0x2c98('0x6a')]({'name':_0x120369['name'],'contentType':_0x120369[_0x2c98('0x23')],'data':fs[_0x2c98('0x6b')](_0x408bbf)});}}}emlformat[_0x2c98('0x6c')](_0x4124a3,function(_0x15f40f,_0x2f547e){if(_0x15f40f)return _0x48bb71(_0x15f40f);fs['writeFileSync'](path[_0x2c98('0x58')](_0x6186cb,util[_0x2c98('0x4b')](_0x2c98('0x6d'),_0x31c3d6)),_0x2f547e);return _0x7a268b(_0x2f547e);});});})[_0x2c98('0x1c')](function(){return new BPromise(function(_0x108f04,_0x2e22db){zipdir(_0x6186cb,{'saveTo':_0x48f4a6},function(_0x23ddfe,_0x1a88d2){if(_0x23ddfe)return _0x2e22db(_0x23ddfe);return _0x108f04(_0x1a88d2);});})[_0x2c98('0x1c')](function(){return new BPromise(function(_0x51566a,_0x562749){rimraf(_0x6186cb,function(_0x25ef36){if(_0x25ef36)_0x562749(_0x25ef36);return _0x51566a();});});})[_0x2c98('0x1c')](function(){return _0x3feca4['download'](_0x48f4a6,_0x3f85e2,function(_0x54dcac){if(!_0x54dcac)fs[_0x2c98('0x6e')](_0x48f4a6);});});});}else{return _0x3feca4[_0x2c98('0x1d')](0xc8);}})[_0x2c98('0x3a')](handleError(_0x3feca4,null));}; \ No newline at end of file +var _0x0ffd=['MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','unix','toString','join','root','tmp','files','transcript-%d-%s.zip','attachments','push','Attachment','Attachments','Messages','from','missing.recipient@your.company.com','subject','createdAt','headers','bcc','basename','existsSync','build','message%d.eml','download','zip-dir','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','then','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','destroy','describe','addMessage','ids','omit','getMessages','MailMessage','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0ffd,0x101));var _0xd0ff=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0ffd[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd0ff('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xd0ff('0x1'));var path=require(_0xd0ff('0x2'));var fs=require('fs');var _=require(_0xd0ff('0x3'));var juice=require('juice');var Redis=require(_0xd0ff('0x4'));var interaction=require(_0xd0ff('0x5'));var qs=require(_0xd0ff('0x6'));var logger=require(_0xd0ff('0x7'))('api');var config=require(_0xd0ff('0x8'));var db=require(_0xd0ff('0x9'))['db'];var htmlEntities=require(_0xd0ff('0xa'));config[_0xd0ff('0xb')]=_[_0xd0ff('0xc')](config[_0xd0ff('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0ff('0xd'))(new Redis(config[_0xd0ff('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x53b244,_0x189e11){_0x189e11=_0x189e11||0xcc;return function(_0x5192f0){if(_0x5192f0){return _0x53b244[_0xd0ff('0xe')](_0x189e11);}return _0x53b244[_0xd0ff('0xf')](_0x189e11)[_0xd0ff('0x10')]();};}function respondWithResult(_0x20ce32,_0x32bdb6){_0x32bdb6=_0x32bdb6||0xc8;return function(_0x3579e4){if(_0x3579e4){return _0x20ce32[_0xd0ff('0xf')](_0x32bdb6)[_0xd0ff('0x11')](_0x3579e4);}};}function respondWithFilteredResult(_0x40cc9b,_0x243b7d){return function(_0x2121e8){if(_0x2121e8){var _0x387ba0=typeof _0x243b7d[_0xd0ff('0x12')]===_0xd0ff('0x13')&&typeof _0x243b7d[_0xd0ff('0x14')]===_0xd0ff('0x13');var _0x3dae60=_0x2121e8[_0xd0ff('0x15')];var _0x543943=_0x387ba0?0x0:_0x243b7d[_0xd0ff('0x12')];var _0x10d173=_0x387ba0?_0x2121e8['count']:_0x243b7d['offset']+_0x243b7d['limit'];var _0x5a3327;if(_0x10d173>=_0x3dae60){_0x10d173=_0x3dae60;_0x5a3327=0xc8;}else{_0x5a3327=0xce;}_0x40cc9b['status'](_0x5a3327);return _0x40cc9b['set'](_0xd0ff('0x16'),_0x543943+'-'+_0x10d173+'/'+_0x3dae60)[_0xd0ff('0x11')](_0x2121e8);}return null;};}function saveUpdates(_0x15b1b5){return function(_0x2609bb){if(_0x2609bb){return _0x2609bb['update'](_0x15b1b5)[_0xd0ff('0x17')](function(_0x5a1884){return _0x5a1884;});}return null;};}function removeEntity(_0x4689fd){return function(_0x4b4abc){if(_0x4b4abc){return _0x4b4abc['destroy']()[_0xd0ff('0x17')](function(){_0x4689fd[_0xd0ff('0xf')](0xcc)[_0xd0ff('0x10')]();});}};}function handleEntityNotFound(_0x3e4ea9){return function(_0x272187){if(!_0x272187){_0x3e4ea9[_0xd0ff('0xe')](0x194);}return _0x272187;};}function handleError(_0x559838,_0xf6078d){_0xf6078d=_0xf6078d||0x1f4;return function(_0x322887){logger[_0xd0ff('0x18')](_0x322887[_0xd0ff('0x19')]);if(_0x322887[_0xd0ff('0x1a')]){delete _0x322887[_0xd0ff('0x1a')];}_0x559838[_0xd0ff('0xf')](_0xf6078d)[_0xd0ff('0x1b')](_0x322887);};}exports[_0xd0ff('0x1c')]=function(_0x46b483,_0x3a932d){var _0x2c7466={};var _0x371333=_[_0xd0ff('0x1d')](db[_0xd0ff('0x1e')][_0xd0ff('0x1f')],function(_0x27c8f2){return{'name':_0x27c8f2[_0xd0ff('0x20')],'type':_0x27c8f2[_0xd0ff('0x21')][_0xd0ff('0x22')]};});_0x2c7466=qs[_0xd0ff('0x23')](_0x371333,_0x46b483);return interaction[_0xd0ff('0x24')](_0xd0ff('0x25'),_0x46b483['query'],_0x46b483[_0xd0ff('0x26')],_0x2c7466,_0x371333)[_0xd0ff('0x17')](respondWithFilteredResult(_0x3a932d,_0x2c7466))[_0xd0ff('0x27')](handleError(_0x3a932d,null));};exports[_0xd0ff('0x28')]=function(_0x382a4,_0x1b0693){var _0xf4af7f={'raw':![],'where':{'id':_0x382a4[_0xd0ff('0x29')]['id']}},_0x53a954={};_0x53a954[_0xd0ff('0x2a')]=_[_0xd0ff('0x2b')](db[_0xd0ff('0x1e')]['rawAttributes']);_0x53a954[_0xd0ff('0x2c')]=_[_0xd0ff('0x2b')](_0x382a4[_0xd0ff('0x2c')]);_0x53a954[_0xd0ff('0x2d')]=_[_0xd0ff('0x2e')](_0x53a954[_0xd0ff('0x2a')],_0x53a954[_0xd0ff('0x2c')]);_0xf4af7f[_0xd0ff('0x2f')]=_[_0xd0ff('0x2e')](_0x53a954['model'],qs[_0xd0ff('0x30')](_0x382a4[_0xd0ff('0x2c')][_0xd0ff('0x30')]));_0xf4af7f[_0xd0ff('0x2f')]=_0xf4af7f[_0xd0ff('0x2f')][_0xd0ff('0x31')]?_0xf4af7f[_0xd0ff('0x2f')]:_0x53a954[_0xd0ff('0x2a')];if(_0x382a4[_0xd0ff('0x2c')][_0xd0ff('0x32')]){_0xf4af7f[_0xd0ff('0x33')]=[{'all':!![]}];}_0xf4af7f=_[_0xd0ff('0x34')]({},_0xf4af7f,_0x382a4[_0xd0ff('0x35')]);return db['MailInteraction'][_0xd0ff('0x36')](_0xf4af7f)[_0xd0ff('0x17')](handleEntityNotFound(_0x1b0693,null))[_0xd0ff('0x17')](respondWithResult(_0x1b0693,null))[_0xd0ff('0x27')](handleError(_0x1b0693,null));};exports[_0xd0ff('0x37')]=function(_0x512ede,_0xf78bfd){return db['MailInteraction']['create'](_0x512ede[_0xd0ff('0x38')],{})[_0xd0ff('0x17')](respondWithResult(_0xf78bfd,0xc9))[_0xd0ff('0x27')](handleError(_0xf78bfd,null));};exports[_0xd0ff('0x39')]=function(_0x2352b3,_0x23a627){if(_0x2352b3[_0xd0ff('0x38')]['id']){delete _0x2352b3[_0xd0ff('0x38')]['id'];}return db[_0xd0ff('0x1e')][_0xd0ff('0x36')]({'where':{'id':_0x2352b3[_0xd0ff('0x29')]['id']}})[_0xd0ff('0x17')](handleEntityNotFound(_0x23a627,null))[_0xd0ff('0x17')](saveUpdates(_0x2352b3['body'],null))[_0xd0ff('0x17')](respondWithResult(_0x23a627,null))[_0xd0ff('0x27')](handleError(_0x23a627,null));};exports[_0xd0ff('0x3a')]=function(_0x5ad800,_0x5582b8){return db[_0xd0ff('0x1e')]['find']({'where':{'id':_0x5ad800['params']['id']}})[_0xd0ff('0x17')](handleEntityNotFound(_0x5582b8,null))[_0xd0ff('0x17')](removeEntity(_0x5582b8,null))[_0xd0ff('0x27')](handleError(_0x5582b8,null));};exports[_0xd0ff('0x3b')]=function(_0x2a4a56,_0xd2776f){return db[_0xd0ff('0x1e')]['describe']()[_0xd0ff('0x17')](respondWithResult(_0xd2776f,null))[_0xd0ff('0x27')](handleError(_0xd2776f,null));};exports[_0xd0ff('0x3c')]=function(_0x29f47b,_0x308336){return db['MailMessage']['find']({'where':{'id':_0x29f47b[_0xd0ff('0x29')]['id']}})['then'](handleEntityNotFound(_0x308336,null))[_0xd0ff('0x17')](function(_0x2394ee){if(_0x2394ee){return _0x2394ee[_0xd0ff('0x3c')](_0x29f47b[_0xd0ff('0x38')][_0xd0ff('0x3d')],_[_0xd0ff('0x3e')](_0x29f47b[_0xd0ff('0x38')],[_0xd0ff('0x3d'),'id'])||{});}})[_0xd0ff('0x17')](respondWithResult(_0x308336,null))[_0xd0ff('0x27')](handleError(_0x308336,null));};exports[_0xd0ff('0x3f')]=function(_0x38e6ac,_0x51c23b){var _0x2887d7={'raw':![],'where':{}};var _0x62251e={};var _0x30e015={'count':0x0,'rows':[]};return db[_0xd0ff('0x1e')]['findOne']({'where':{'id':_0x38e6ac[_0xd0ff('0x29')]['id']}})[_0xd0ff('0x17')](handleEntityNotFound(_0x51c23b,null))[_0xd0ff('0x17')](function(_0xa0b1b){if(_0xa0b1b){_0x62251e['model']=_['keys'](db[_0xd0ff('0x40')][_0xd0ff('0x1f')]);_0x62251e['query']=_['keys'](_0x38e6ac[_0xd0ff('0x2c')]);_0x62251e['filters']=_[_0xd0ff('0x2e')](_0x62251e[_0xd0ff('0x2a')],_0x62251e[_0xd0ff('0x2c')]);_0x2887d7[_0xd0ff('0x2f')]=_[_0xd0ff('0x2e')](_0x62251e['model'],qs[_0xd0ff('0x30')](_0x38e6ac['query']['fields']));_0x2887d7[_0xd0ff('0x2f')]=_0x2887d7['attributes'][_0xd0ff('0x31')]?_0x2887d7[_0xd0ff('0x2f')]:_0x62251e[_0xd0ff('0x2a')];if(!_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x41')](_0xd0ff('0x42'))){_0x2887d7[_0xd0ff('0x14')]=qs[_0xd0ff('0x14')](_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x14')]);_0x2887d7[_0xd0ff('0x12')]=qs[_0xd0ff('0x12')](_0x38e6ac[_0xd0ff('0x2c')]['offset']);}_0x2887d7['order']=qs['sort'](_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x43')]);_0x2887d7[_0xd0ff('0x44')]=qs[_0xd0ff('0x2d')](_[_0xd0ff('0x45')](_0x38e6ac[_0xd0ff('0x2c')],_0x62251e[_0xd0ff('0x2d')]));_0x2887d7[_0xd0ff('0x44')][_0xd0ff('0x46')]=_0xa0b1b['id'];if(_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x47')]){_0x2887d7[_0xd0ff('0x44')]=_[_0xd0ff('0x34')](_0x2887d7[_0xd0ff('0x44')],{'$or':_[_0xd0ff('0x1d')](_0x2887d7['attributes'],function(_0x537f6b){var _0xa013de={};_0xa013de[_0x537f6b]={'$like':'%'+_0x38e6ac['query'][_0xd0ff('0x47')]+'%'};return _0xa013de;})});}if(_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x48')]){var _0x5934d2=_0x38e6ac[_0xd0ff('0x2c')]['$gte'][_0xd0ff('0x49')](',');var _0x4764a8={};_0x4764a8[_0x5934d2[0x0]]={'$gte':moment(_0x5934d2[0x1])[_0xd0ff('0x4a')](_0xd0ff('0x4b'))};_0x2887d7[_0xd0ff('0x44')]=_[_0xd0ff('0x34')](_0x2887d7[_0xd0ff('0x44')],_0x4764a8);}_0x2887d7=_[_0xd0ff('0x34')]({},_0x2887d7,_0x38e6ac[_0xd0ff('0x35')]);return db[_0xd0ff('0x40')][_0xd0ff('0x15')]({'where':_0x2887d7[_0xd0ff('0x44')]})[_0xd0ff('0x17')](function(_0x2e9176){_0x30e015[_0xd0ff('0x15')]=_0x2e9176;if(_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x32')]){_0x2887d7[_0xd0ff('0x33')]=[{'all':!![]}];}return db['MailMessage'][_0xd0ff('0x24')](_0x2887d7);})[_0xd0ff('0x17')](function(_0x3dd846){if(_0x38e6ac[_0xd0ff('0x2c')][_0xd0ff('0x4c')]===_0xd0ff('0x4d')){for(var _0x35619c=0x0;_0x35619c<_0x3dd846[_0xd0ff('0x31')];_0x35619c++){_0x3dd846[_0x35619c][_0xd0ff('0x38')]=juice(_0x3dd846[_0x35619c][_0xd0ff('0x38')]);}}_0x30e015[_0xd0ff('0x4e')]=_0x3dd846;return _0x30e015;});}})[_0xd0ff('0x17')](respondWithFilteredResult(_0x51c23b,_0x2887d7))[_0xd0ff('0x27')](handleError(_0x51c23b,null));};exports[_0xd0ff('0x4f')]=function(_0x2b1759,_0x499993){return db['MailInteraction'][_0xd0ff('0x36')]({'where':{'id':_0x2b1759[_0xd0ff('0x29')]['id']}})[_0xd0ff('0x17')](handleEntityNotFound(_0x499993,null))[_0xd0ff('0x17')](function(_0x305dc0){if(_0x305dc0){return _0x305dc0[_0xd0ff('0x50')](_0x2b1759[_0xd0ff('0x38')]['ids'],_[_0xd0ff('0x3e')](_0x2b1759[_0xd0ff('0x38')],[_0xd0ff('0x3d'),'id'])||{})[_0xd0ff('0x51')](function(){return db[_0xd0ff('0x52')][_0xd0ff('0x24')]({'attributes':['id',_0xd0ff('0x1a'),_0xd0ff('0x53')],'where':{'id':_0x2b1759[_0xd0ff('0x38')][_0xd0ff('0x3d')]}});})['then'](function(_0x2913d1){socket[_0xd0ff('0x54')](_0xd0ff('0x55'),{'id':Number(_0x2b1759[_0xd0ff('0x29')]['id']),'tags':_0x2913d1||[]});return{'id':Number(_0x2b1759[_0xd0ff('0x29')]['id']),'tags':_0x2913d1||[]};});}})[_0xd0ff('0x17')](respondWithResult(_0x499993,null))['catch'](handleError(_0x499993,null));};exports['removeTags']=function(_0x4b125e,_0x3f28d0){return db[_0xd0ff('0x1e')][_0xd0ff('0x36')]({'where':{'id':_0x4b125e[_0xd0ff('0x29')]['id']}})[_0xd0ff('0x17')](handleEntityNotFound(_0x3f28d0,null))[_0xd0ff('0x17')](function(_0x4b8743){if(_0x4b8743){return _0x4b8743['removeTags'](_0x4b125e[_0xd0ff('0x2c')][_0xd0ff('0x3d')]);}})[_0xd0ff('0x17')](respondWithStatusCode(_0x3f28d0,null))['catch'](handleError(_0x3f28d0,null));};exports['download']=function(_0x354e0c,_0x5f4041){var _0x4eb774=moment()[_0xd0ff('0x56')]()[_0xd0ff('0x57')]();var _0x51aafd=path[_0xd0ff('0x58')](config[_0xd0ff('0x59')],'server','files',_0xd0ff('0x5a'));var _0x473ae8=path['join'](config['root'],'server',_0xd0ff('0x5b'),'attachments');var _0x2e5327=path[_0xd0ff('0x58')](_0x51aafd,_0x4eb774);var _0xabd600=util[_0xd0ff('0x4a')](_0xd0ff('0x5c'),_0x354e0c['params']['id'],_0x4eb774);var _0x2a9f7f=path['join'](_0x51aafd,_0xabd600);var _0x11a066=[];if(_0x354e0c[_0xd0ff('0x2c')][_0xd0ff('0x5d')]){_0x11a066[_0xd0ff('0x5e')]({'model':db[_0xd0ff('0x5f')],'as':_0xd0ff('0x60'),'raw':!![]});}var _0xdc5e4d=[{'model':db[_0xd0ff('0x40')],'as':_0xd0ff('0x61'),'attributes':['id','body',_0xd0ff('0x62'),'to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs[_0xd0ff('0x43')]('id'),'include':_0x11a066}];return db[_0xd0ff('0x1e')][_0xd0ff('0x36')]({'where':{'id':_0x354e0c[_0xd0ff('0x29')]['id']},'include':_0xdc5e4d})['then'](handleEntityNotFound(_0x5f4041,null))[_0xd0ff('0x17')](function(_0x155346){if(_0x155346&&_0x155346['Messages']){var _0x401290=_0x155346['get']({'plain':!![]});fs['mkdirSync'](_0x2e5327);return BPromise['each'](_0x401290['Messages'],function(_0x186f23,_0x290cea){var _0x7d33ea={'from':_0x186f23[_0xd0ff('0x62')],'to':_0x186f23['to']||_0xd0ff('0x63'),'subject':_0x186f23[_0xd0ff('0x64')],'html':htmlEntities['decode'](_0x186f23['body']),'headers':{'Date':moment(_0x186f23[_0xd0ff('0x65')])[_0xd0ff('0x4a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x186f23['cc']){_0x7d33ea[_0xd0ff('0x66')]['Cc']=_0x186f23['cc'];}if(_0x186f23[_0xd0ff('0x67')]){_0x7d33ea[_0xd0ff('0x66')]['Bcc']=_0x186f23['bcc'];}return new BPromise(function(_0x4ee32b,_0x1f202e){if(_0x186f23[_0xd0ff('0x60')]){for(var _0x401c45=0x0;_0x401c45<_0x186f23[_0xd0ff('0x60')][_0xd0ff('0x31')];_0x401c45++){var _0xca97a9=_0x186f23['Attachments'][_0x401c45];var _0xc78ca8=path['join'](_0x473ae8,_0xca97a9[_0xd0ff('0x68')]);if(fs[_0xd0ff('0x69')](_0xc78ca8)){_0x7d33ea[_0xd0ff('0x5d')]['push']({'name':_0xca97a9[_0xd0ff('0x1a')],'contentType':_0xca97a9[_0xd0ff('0x21')],'data':fs['readFileSync'](_0xc78ca8)});}}}emlformat[_0xd0ff('0x6a')](_0x7d33ea,function(_0x2b203a,_0x5c04fe){if(_0x2b203a)return _0x1f202e(_0x2b203a);fs['writeFileSync'](path[_0xd0ff('0x58')](_0x2e5327,util[_0xd0ff('0x4a')](_0xd0ff('0x6b'),_0x290cea)),_0x5c04fe);return _0x4ee32b(_0x5c04fe);});});})[_0xd0ff('0x17')](function(){return new BPromise(function(_0x400dbe,_0xfbdfe7){zipdir(_0x2e5327,{'saveTo':_0x2a9f7f},function(_0x5e5b03,_0x2016b6){if(_0x5e5b03)return _0xfbdfe7(_0x5e5b03);return _0x400dbe(_0x2016b6);});})[_0xd0ff('0x17')](function(){return new BPromise(function(_0x3c019e,_0x3c1ab5){rimraf(_0x2e5327,function(_0x414adf){if(_0x414adf)_0x3c1ab5(_0x414adf);return _0x3c019e();});});})[_0xd0ff('0x17')](function(){return _0x5f4041[_0xd0ff('0x6c')](_0x2a9f7f,_0xabd600,function(_0x33c8db){if(!_0x33c8db)fs['unlinkSync'](_0x2a9f7f);});});});}else{return _0x5f4041[_0xd0ff('0xe')](0xc8);}})['catch'](handleError(_0x5f4041,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index bbb660f..e2df367 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 _0x0031=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x589836,_0xb55c8f){var _0x4da440=function(_0xc1b430){while(--_0xc1b430){_0x589836['push'](_0x589836['shift']());}};_0x4da440(++_0xb55c8f);}(_0x0031,0x198));var _0x1003=function(_0x2b6e30,_0x1d6692){_0x2b6e30=_0x2b6e30-0x0;var _0x8b4af1=_0x0031[_0x2b6e30];return _0x8b4af1;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x1003('0x0'))['db'][_0x1003('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x1003('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1003('0x3')](0x0);var events={'afterCreate':_0x1003('0x4'),'afterUpdate':_0x1003('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3f1ddc){return function(_0x40aad1,_0x544730,_0x4f7df4){_0x40aad1[_0x1003('0x6')]({'attributes':['id'],'raw':!![]})[_0x1003('0x7')](function(_0x135223){_0x40aad1[_0x1003('0x8')](_0x1003('0x9'),_0x135223['map'](function(_0x563d50){return{'id':_0x563d50['id']};}));return MailMessage[_0x1003('0xa')]({'where':{'MailInteractionId':_0x40aad1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1003('0x7')](function(_0x23dd12){_0x40aad1['setDataValue'](_0x1003('0xb'),_0x23dd12[_0x1003('0xc')]);MailInteractionEvents['emit'](_0x3f1ddc+':'+_0x40aad1['id'],_0x40aad1);MailInteractionEvents[_0x1003('0xd')](_0x3f1ddc,_0x40aad1);_0x4f7df4(null);})['catch'](_0x4f7df4(null));};}for(var e in events){if(events[_0x1003('0xe')](e)){var event=events[e];MailInteraction[_0x1003('0xf')](e,emitEvent(event));}}module[_0x1003('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x4145=['then','Users','map','setDataValue','emit','catch','hook','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers'];(function(_0x45493c,_0x39478b){var _0xe89240=function(_0x45dee9){while(--_0x45dee9){_0x45493c['push'](_0x45493c['shift']());}};_0xe89240(++_0x39478b);}(_0x4145,0xbb));var _0x5414=function(_0x184aa5,_0x568b04){_0x184aa5=_0x184aa5-0x0;var _0x31ae0b=_0x4145[_0x184aa5];return _0x31ae0b;};'use strict';var EventEmitter=require(_0x5414('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x5414('0x1')];var MailMessage=require(_0x5414('0x2'))['db'][_0x5414('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x5414('0x4')](0x0);var events={'afterCreate':_0x5414('0x5'),'afterUpdate':'update','afterDestroy':_0x5414('0x6')};function emitEvent(_0xd33dd4){return function(_0x49785c,_0x5667b8,_0x3d8c81){_0x49785c[_0x5414('0x7')]({'attributes':['id'],'raw':!![]})[_0x5414('0x8')](function(_0x416a28){_0x49785c['setDataValue'](_0x5414('0x9'),_0x416a28[_0x5414('0xa')](function(_0x4a5e96){return{'id':_0x4a5e96['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x49785c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5414('0x8')](function(_0x3a9a0f){_0x49785c[_0x5414('0xb')]('unreadMessages',_0x3a9a0f['length']);MailInteractionEvents['emit'](_0xd33dd4+':'+_0x49785c['id'],_0x49785c);MailInteractionEvents[_0x5414('0xc')](_0xd33dd4,_0x49785c);_0x3d8c81(null);})[_0x5414('0xd')](_0x3d8c81(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5414('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 5d525b2..71e10f4 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 _0x7684=['fti_mail_interactions','subject','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','models','MailMessage','then','catch','utf8mb4','util','../../config/logger','api','moment','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions'];(function(_0x5e3480,_0x350fa5){var _0x10452e=function(_0x2dd2a9){while(--_0x2dd2a9){_0x5e3480['push'](_0x5e3480['shift']());}};_0x10452e(++_0x350fa5);}(_0x7684,0x139));var _0x4768=function(_0x2b157c,_0x5cf335){_0x2b157c=_0x2b157c-0x0;var _0x2d8d43=_0x7684[_0x2b157c];return _0x2d8d43;};'use strict';var _=require('lodash');var util=require(_0x4768('0x0'));var logger=require(_0x4768('0x1'))(_0x4768('0x2'));var moment=require(_0x4768('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4768('0x4'));var config=require(_0x4768('0x5'));var attributes=require(_0x4768('0x6'));module['exports']=function(_0x4d27da,_0x10aac6){return _0x4d27da['define'](_0x4768('0x7'),attributes,{'tableName':_0x4768('0x8'),'paranoid':![],'indexes':[{'name':_0x4768('0x9'),'fields':[_0x4768('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x11fa92,_0x656728,_0x981440){if(_0x11fa92[_0x4768('0xb')]){_0x11fa92['substatusAt']=moment()[_0x4768('0xc')](_0x4768('0xd'));}if(_0x11fa92[_0x4768('0xe')]){_0x11fa92[_0x4768('0xf')]=moment()[_0x4768('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x981440(null,_0x656728);},'beforeUpdate':function(_0x3e1ed0,_0x8c9786,_0x3a698f){if(_0x3e1ed0[_0x4768('0x10')](_0x4768('0xb'))){_0x3e1ed0[_0x4768('0x11')]=_0x3e1ed0[_0x4768('0xb')]?moment()['format'](_0x4768('0xd')):null;}if(_0x3e1ed0[_0x4768('0x10')]('closed')){_0x3e1ed0[_0x4768('0xf')]=moment()[_0x4768('0xc')](_0x4768('0xd'));_0x3e1ed0[_0x4768('0xb')]=null;_0x3e1ed0['substatusAt']=null;}_0x3a698f(null,_0x3e1ed0);},'afterUpdate':function(_0xa146ce,_0x235d4e,_0x300d32){var _0x21081a=_0x4d27da[_0x4768('0x12')];var _0x3e26f1=_0xa146ce['get']({'plain':!![]});if(_0x3e26f1[_0x4768('0xe')]){return _0x21081a[_0x4768('0x13')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3e26f1['id']}})[_0x4768('0x14')](function(){_0x300d32();})[_0x4768('0x15')](function(_0x3102d4){_0x300d32(_0x3102d4);});}else{_0x300d32();}}},'charset':_0x4768('0x16'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5f48=['format','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatusAt','closed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','../../config/environment','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0x5f48,0xa9));var _0x85f4=function(_0xb9cb64,_0x4feed6){_0xb9cb64=_0xb9cb64-0x0;var _0x4fe3d8=_0x5f48[_0xb9cb64];return _0x4fe3d8;};'use strict';var _=require(_0x85f4('0x0'));var util=require(_0x85f4('0x1'));var logger=require('../../config/logger')(_0x85f4('0x2'));var moment=require('moment');var BPromise=require(_0x85f4('0x3'));var rp=require(_0x85f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85f4('0x5'));var attributes=require('./mailInteraction.attributes');module[_0x85f4('0x6')]=function(_0x56e6e9,_0x2ddf3a){return _0x56e6e9[_0x85f4('0x7')](_0x85f4('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x85f4('0x9'),'fields':[_0x85f4('0xa'),'to'],'type':_0x85f4('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f656f,_0x245bd6,_0x40882c){if(_0x3f656f[_0x85f4('0xc')]){_0x3f656f['substatusAt']=moment()[_0x85f4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3f656f['closed']){_0x3f656f[_0x85f4('0xe')]=moment()[_0x85f4('0xd')](_0x85f4('0xf'));}_0x40882c(null,_0x245bd6);},'beforeUpdate':function(_0x1e8139,_0x2f066d,_0x3b3cfc){if(_0x1e8139[_0x85f4('0x10')]('substatus')){_0x1e8139[_0x85f4('0x11')]=_0x1e8139[_0x85f4('0xc')]?moment()[_0x85f4('0xd')](_0x85f4('0xf')):null;}if(_0x1e8139['changed'](_0x85f4('0x12'))){_0x1e8139[_0x85f4('0xe')]=moment()[_0x85f4('0xd')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e8139[_0x85f4('0xc')]=null;_0x1e8139[_0x85f4('0x11')]=null;}_0x3b3cfc(null,_0x1e8139);},'afterUpdate':function(_0x281135,_0x55189e,_0x3c9f8b){var _0x20b6ba=_0x56e6e9[_0x85f4('0x13')];var _0x551ca9=_0x281135[_0x85f4('0x14')]({'plain':!![]});if(_0x551ca9[_0x85f4('0x12')]){return _0x20b6ba[_0x85f4('0x15')][_0x85f4('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x551ca9['id']}})[_0x85f4('0x17')](function(){_0x3c9f8b();})['catch'](function(_0x5ad283){_0x3c9f8b(_0x5ad283);});}else{_0x3c9f8b();}}},'charset':_0x85f4('0x18'),'collate':_0x85f4('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index f2e3376..e3d388a 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 _0xa973=['then','stringify','find','body','ids','spread','AddTags','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','./mailInteraction.socket','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','limit'];(function(_0x14199d,_0x176df7){var _0x377f44=function(_0x235de4){while(--_0x235de4){_0x14199d['push'](_0x14199d['shift']());}};_0x377f44(++_0x176df7);}(_0xa973,0x73));var _0x3a97=function(_0x490cbe,_0x3fc51f){_0x490cbe=_0x490cbe-0x0;var _0x58d3e0=_0xa973[_0x490cbe];return _0x58d3e0;};'use strict';var _=require(_0x3a97('0x0'));var util=require(_0x3a97('0x1'));var moment=require(_0x3a97('0x2'));var BPromise=require(_0x3a97('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3a97('0x4'));var logger=require('../../config/logger')(_0x3a97('0x5'));var config=require(_0x3a97('0x6'));var jayson=require(_0x3a97('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x3a97('0x8')]=_['defaults'](config['redis'],{'host':_0x3a97('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a97('0x8')]));require(_0x3a97('0xa'))[_0x3a97('0xb')](socket);function respondWithRpcPromise(_0x21b409,_0x59c496,_0x149c6d){return new BPromise(function(_0x499bca,_0x21fa2d){return client[_0x3a97('0xc')](_0x21b409,_0x149c6d)['then'](function(_0x11d382){logger[_0x3a97('0xd')]('MailInteraction,\x20%s,\x20%s',_0x59c496,_0x3a97('0xe'));logger[_0x3a97('0xf')](_0x3a97('0x10'),_0x59c496,_0x3a97('0xe'),JSON['stringify'](_0x11d382));if(_0x11d382[_0x3a97('0x11')]){if(_0x11d382[_0x3a97('0x11')][_0x3a97('0x12')]===0x1f4){logger[_0x3a97('0x11')](_0x3a97('0x13'),_0x59c496,_0x11d382[_0x3a97('0x11')][_0x3a97('0x14')]);return _0x21fa2d(_0x11d382[_0x3a97('0x11')]['message']);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x59c496,_0x11d382['error'][_0x3a97('0x14')]);return _0x499bca(_0x11d382['error'][_0x3a97('0x14')]);}else{logger[_0x3a97('0xd')](_0x3a97('0x13'),_0x59c496,'request\x20sent');_0x499bca(_0x11d382[_0x3a97('0x15')]['message']);}})[_0x3a97('0x16')](function(_0x100ae9){logger[_0x3a97('0x11')](_0x3a97('0x13'),_0x59c496,_0x100ae9);_0x21fa2d(_0x100ae9);});});}exports[_0x3a97('0x17')]=function(_0x148cab){var _0x528430=this;return new Promise(function(_0x5ddd0f,_0x1bb912){return db[_0x3a97('0x18')][_0x3a97('0x19')](_0x148cab['body'],{'raw':_0x148cab[_0x3a97('0x1a')]?_0x148cab['options'][_0x3a97('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x148cab[_0x3a97('0x1a')]?_0x148cab['options']['where']||null:null,'attributes':_0x148cab['options']?_0x148cab[_0x3a97('0x1a')]['attributes']||null:null,'limit':_0x148cab[_0x3a97('0x1a')]?_0x148cab[_0x3a97('0x1a')][_0x3a97('0x1c')]||null:null})[_0x3a97('0x1d')](function(_0x384e2f){logger[_0x3a97('0xd')](_0x3a97('0x17'),_0x148cab);logger[_0x3a97('0xf')]('UpdateMailInteraction',_0x148cab,JSON[_0x3a97('0x1e')](_0x384e2f));_0x5ddd0f(_0x384e2f);})['catch'](function(_0x25f82c){logger[_0x3a97('0x11')](_0x3a97('0x17'),_0x25f82c[_0x3a97('0x14')],_0x148cab);_0x1bb912(_0x528430[_0x3a97('0x11')](0x1f4,_0x25f82c[_0x3a97('0x14')]));});});};exports['AddTagsToMailInteraction']=function(_0x154a08){return new Promise(function(_0x332516,_0x425857){return db['MailInteraction'][_0x3a97('0x1f')]({'where':_0x154a08['options']?_0x154a08[_0x3a97('0x1a')]['where']||null:null})[_0x3a97('0x1d')](function(_0x3a81b3){if(_0x3a81b3){return _0x3a81b3['addTags'](_0x154a08[_0x3a97('0x20')]['ids'],_['omit'](_0x154a08[_0x3a97('0x20')],[_0x3a97('0x21'),'id'])||{});}})[_0x3a97('0x22')](function(_0x1324ae){logger[_0x3a97('0xd')]('AddTags',_0x154a08);logger['debug']('AddTags',_0x154a08,JSON[_0x3a97('0x1e')](_0x1324ae));_0x332516(_0x1324ae);})['catch'](function(_0x5ed2b6){logger[_0x3a97('0x11')](_0x3a97('0x23'),_0x5ed2b6[_0x3a97('0x14')],_0x154a08);_0x425857(_this[_0x3a97('0x11')](0x1f4,_0x5ed2b6[_0x3a97('0x14')]));});});}; \ No newline at end of file +var _0x1228=['redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','limit','debug','AddTagsToMailInteraction','addTags','ids','spread','AddTags','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x3fc655,_0x284c1a){var _0x4417f3=function(_0x1dfaa0){while(--_0x1dfaa0){_0x3fc655['push'](_0x3fc655['shift']());}};_0x4417f3(++_0x284c1a);}(_0x1228,0x12f));var _0x8122=function(_0x5d7375,_0x358589){_0x5d7375=_0x5d7375-0x0;var _0x3f0da4=_0x1228[_0x5d7375];return _0x3f0da4;};'use strict';var _=require(_0x8122('0x0'));var util=require('util');var moment=require(_0x8122('0x1'));var BPromise=require('bluebird');var rs=require(_0x8122('0x2'));var fs=require('fs');var Redis=require(_0x8122('0x3'));var db=require(_0x8122('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8122('0x5'))(_0x8122('0x6'));var config=require('../../config/environment');var jayson=require(_0x8122('0x7'));var client=jayson[_0x8122('0x8')]['http']({'port':0x232a});config[_0x8122('0x9')]=_[_0x8122('0xa')](config['redis'],{'host':_0x8122('0xb'),'port':0x18eb});var socket=require(_0x8122('0xc'))(new Redis(config['redis']));require(_0x8122('0xd'))[_0x8122('0xe')](socket);function respondWithRpcPromise(_0x4a1378,_0x5a7875,_0x4fa7b3){return new BPromise(function(_0x52f48b,_0x208043){return client['request'](_0x4a1378,_0x4fa7b3)[_0x8122('0xf')](function(_0x23a9e4){logger[_0x8122('0x10')]('MailInteraction,\x20%s,\x20%s',_0x5a7875,_0x8122('0x11'));logger['debug'](_0x8122('0x12'),_0x5a7875,_0x8122('0x11'),JSON[_0x8122('0x13')](_0x23a9e4));if(_0x23a9e4[_0x8122('0x14')]){if(_0x23a9e4[_0x8122('0x14')][_0x8122('0x15')]===0x1f4){logger[_0x8122('0x14')](_0x8122('0x16'),_0x5a7875,_0x23a9e4[_0x8122('0x14')][_0x8122('0x17')]);return _0x208043(_0x23a9e4[_0x8122('0x14')][_0x8122('0x17')]);}logger['error'](_0x8122('0x16'),_0x5a7875,_0x23a9e4['error'][_0x8122('0x17')]);return _0x52f48b(_0x23a9e4['error'][_0x8122('0x17')]);}else{logger[_0x8122('0x10')](_0x8122('0x16'),_0x5a7875,_0x8122('0x11'));_0x52f48b(_0x23a9e4['result']['message']);}})['catch'](function(_0x56a926){logger[_0x8122('0x14')](_0x8122('0x16'),_0x5a7875,_0x56a926);_0x208043(_0x56a926);});});}exports[_0x8122('0x18')]=function(_0x5a5a57){var _0x5df55f=this;return new Promise(function(_0x1162a8,_0x174321){return db[_0x8122('0x19')]['update'](_0x5a5a57[_0x8122('0x1a')],{'raw':_0x5a5a57[_0x8122('0x1b')]?_0x5a5a57[_0x8122('0x1b')][_0x8122('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a5a57[_0x8122('0x1b')]?_0x5a5a57[_0x8122('0x1b')][_0x8122('0x1d')]||null:null,'attributes':_0x5a5a57[_0x8122('0x1b')]?_0x5a5a57['options'][_0x8122('0x1e')]||null:null,'limit':_0x5a5a57['options']?_0x5a5a57[_0x8122('0x1b')][_0x8122('0x1f')]||null:null})[_0x8122('0xf')](function(_0x2f04d5){logger[_0x8122('0x10')](_0x8122('0x18'),_0x5a5a57);logger[_0x8122('0x20')](_0x8122('0x18'),_0x5a5a57,JSON[_0x8122('0x13')](_0x2f04d5));_0x1162a8(_0x2f04d5);})['catch'](function(_0x1258d7){logger[_0x8122('0x14')](_0x8122('0x18'),_0x1258d7[_0x8122('0x17')],_0x5a5a57);_0x174321(_0x5df55f[_0x8122('0x14')](0x1f4,_0x1258d7[_0x8122('0x17')]));});});};exports[_0x8122('0x21')]=function(_0xf56451){return new Promise(function(_0x45bdaa,_0x4610b1){return db['MailInteraction']['find']({'where':_0xf56451[_0x8122('0x1b')]?_0xf56451[_0x8122('0x1b')]['where']||null:null})['then'](function(_0x12da0c){if(_0x12da0c){return _0x12da0c[_0x8122('0x22')](_0xf56451[_0x8122('0x1a')]['ids'],_['omit'](_0xf56451[_0x8122('0x1a')],[_0x8122('0x23'),'id'])||{});}})[_0x8122('0x24')](function(_0x14d77b){logger[_0x8122('0x10')](_0x8122('0x25'),_0xf56451);logger[_0x8122('0x20')](_0x8122('0x25'),_0xf56451,JSON[_0x8122('0x13')](_0x14d77b));_0x45bdaa(_0x14d77b);})[_0x8122('0x26')](function(_0x51af4d){logger[_0x8122('0x14')](_0x8122('0x25'),_0x51af4d[_0x8122('0x17')],_0xf56451);_0x4610b1(_this[_0x8122('0x14')](0x1f4,_0x51af4d[_0x8122('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5c103cb..16b56f9 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 _0x22fa=['removeListener','register','length','mailInteraction:','save','emit'];(function(_0x23f0d0,_0x40ef17){var _0x5544fc=function(_0x171842){while(--_0x171842){_0x23f0d0['push'](_0x23f0d0['shift']());}};_0x5544fc(++_0x40ef17);}(_0x22fa,0x1c6));var _0xa22f=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x22fa[_0x533110];return _0xc3c866;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa22f('0x0'),'remove','update'];function createListener(_0x8ebdd8,_0x30bd61){return function(_0x18473c){_0x30bd61[_0xa22f('0x1')](_0x8ebdd8,_0x18473c);};}function removeListener(_0x136009,_0xd0ea5c){return function(){MailInteractionEvents[_0xa22f('0x2')](_0x136009,_0xd0ea5c);};}exports[_0xa22f('0x3')]=function(_0x494435){for(var _0x35e3e8=0x0,_0x17d84f=events[_0xa22f('0x4')];_0x35e3e8<_0x17d84f;_0x35e3e8++){var _0xc3eb6a=events[_0x35e3e8];var _0x45e717=createListener(_0xa22f('0x5')+_0xc3eb6a,_0x494435);MailInteractionEvents['on'](_0xc3eb6a,_0x45e717);}}; \ No newline at end of file +var _0x2742=['removeListener','register','length','mailInteraction:','save','remove','update'];(function(_0x541788,_0x216823){var _0x452aeb=function(_0x585c58){while(--_0x585c58){_0x541788['push'](_0x541788['shift']());}};_0x452aeb(++_0x216823);}(_0x2742,0x6d));var _0x2274=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2742[_0x321bb2];return _0x9c12ed;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2274('0x0'),_0x2274('0x1'),_0x2274('0x2')];function createListener(_0x36c77d,_0x298d93){return function(_0x6f0dfe){_0x298d93['emit'](_0x36c77d,_0x6f0dfe);};}function removeListener(_0x276ff0,_0x34ede2){return function(){MailInteractionEvents[_0x2274('0x3')](_0x276ff0,_0x34ede2);};}exports[_0x2274('0x4')]=function(_0xfaf36c){for(var _0x52a0c2=0x0,_0x48aea6=events[_0x2274('0x5')];_0x52a0c2<_0x48aea6;_0x52a0c2++){var _0x2e8fbb=events[_0x52a0c2];var _0x289b46=createListener(_0x2274('0x6')+_0x2e8fbb,_0xfaf36c);MailInteractionEvents['on'](_0x2e8fbb,_0x289b46);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 91bae8a..fae24d5 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 _0xe87e=['reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','mail','mailmessage:create','create','put','update','accept'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe87e,0x17d));var _0xee87=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe87e[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xee87('0x0'));var util=require(_0xee87('0x1'));var path=require(_0xee87('0x2'));var timeout=require(_0xee87('0x3'));var express=require(_0xee87('0x4'));var router=express['Router']();var fs_extra=require(_0xee87('0x5'));var auth=require(_0xee87('0x6'));var interaction=require(_0xee87('0x7'));var config=require(_0xee87('0x8'));var controller=require(_0xee87('0x9'));router[_0xee87('0xa')]('/',auth[_0xee87('0xb')](),controller['index']);router['get'](_0xee87('0xc'),auth[_0xee87('0xb')](),controller[_0xee87('0xd')]);router[_0xee87('0xa')](_0xee87('0xe'),auth['isAuthenticated'](),controller[_0xee87('0xf')]);router[_0xee87('0xa')](_0xee87('0x10'),auth[_0xee87('0xb')](),controller['download']);router[_0xee87('0x11')]('/',auth[_0xee87('0xb')](),interaction['tracked'](_0xee87('0x12'),_0xee87('0x13')),controller[_0xee87('0x14')]);router[_0xee87('0x15')](_0xee87('0xe'),auth[_0xee87('0xb')](),controller[_0xee87('0x16')]);router[_0xee87('0x15')]('/:id/accept',auth[_0xee87('0xb')](),controller[_0xee87('0x17')]);router['put']('/:id/reject',auth[_0xee87('0xb')](),controller[_0xee87('0x18')]);router['delete'](_0xee87('0xe'),auth[_0xee87('0xb')](),controller[_0xee87('0x19')]);module[_0xee87('0x1a')]=router; \ No newline at end of file +var _0x96cc=['/:id/download','post','tracked','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4faa01,_0x549229){var _0x5ed806=function(_0x2bdeb9){while(--_0x2bdeb9){_0x4faa01['push'](_0x4faa01['shift']());}};_0x5ed806(++_0x549229);}(_0x96cc,0x16c));var _0xc96c=function(_0x2503f2,_0x305c53){_0x2503f2=_0x2503f2-0x0;var _0x13ab2c=_0x96cc[_0x2503f2];return _0x13ab2c;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0x9')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller['show']);router[_0xc96c('0x9')](_0xc96c('0xe'),auth[_0xc96c('0xa')](),controller['download']);router[_0xc96c('0xf')]('/',auth['isAuthenticated'](),interaction[_0xc96c('0x10')]('mail',_0xc96c('0x11')),controller[_0xc96c('0x12')]);router[_0xc96c('0x13')](_0xc96c('0xd'),auth['isAuthenticated'](),controller[_0xc96c('0x14')]);router[_0xc96c('0x13')](_0xc96c('0x15'),auth[_0xc96c('0xa')](),controller['accept']);router[_0xc96c('0x13')](_0xc96c('0x16'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x17')]);router[_0xc96c('0x18')](_0xc96c('0xd'),auth[_0xc96c('0xa')](),controller[_0xc96c('0x19')]);module[_0xc96c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a8aeea8..b97b800 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 _0x9e69=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','STRING','DATE','INTEGER','Email','Chat','sequelize'];(function(_0x352883,_0x2e324a){var _0x232968=function(_0x4e61e5){while(--_0x4e61e5){_0x352883['push'](_0x352883['shift']());}};_0x232968(++_0x2e324a);}(_0x9e69,0x144));var _0x99e6=function(_0x2d0c6b,_0x162605){_0x2d0c6b=_0x2d0c6b-0x0;var _0x31e6b1=_0x9e69[_0x2d0c6b];return _0x31e6b1;};'use strict';var Sequelize=require(_0x99e6('0x0'));var _=require(_0x99e6('0x1'));module[_0x99e6('0x2')]={'body':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x5'))},'read':{'type':Sequelize[_0x99e6('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x99e6('0x7')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x99e6('0x8')](0x1fe)},'from':{'type':Sequelize[_0x99e6('0x8')]},'to':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4'))},'cc':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4'))},'bcc':{'type':Sequelize[_0x99e6('0x3')]('long')},'subject':{'type':Sequelize[_0x99e6('0x3')]},'sentAt':{'type':Sequelize[_0x99e6('0x9')]},'attach':{'type':Sequelize[_0x99e6('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x99e6('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x99e6('0x9')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x99e6('0x3')](_0x99e6('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x99e6('0xb'),_0x99e6('0xc')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xc05c=['sequelize','lodash','exports','TEXT','long','medium','out','STRING','DATE','INTEGER','BOOLEAN','Email'];(function(_0x285aec,_0x133151){var _0x44a977=function(_0x243a4b){while(--_0x243a4b){_0x285aec['push'](_0x285aec['shift']());}};_0x44a977(++_0x133151);}(_0xc05c,0xc0));var _0xcc05=function(_0x2efc70,_0x53145a){_0x2efc70=_0x2efc70-0x0;var _0x50ed0f=_0xc05c[_0x2efc70];return _0x50ed0f;};'use strict';var Sequelize=require(_0xcc05('0x0'));var _=require(_0xcc05('0x1'));module[_0xcc05('0x2')]={'body':{'type':Sequelize[_0xcc05('0x3')](_0xcc05('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xcc05('0x3')](_0xcc05('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xcc05('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcc05('0x7')](0x1fe)},'from':{'type':Sequelize[_0xcc05('0x7')]},'to':{'type':Sequelize[_0xcc05('0x3')](_0xcc05('0x4'))},'cc':{'type':Sequelize[_0xcc05('0x3')](_0xcc05('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xcc05('0x8')]},'attach':{'type':Sequelize[_0xcc05('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcc05('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcc05('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0xcc05('0x3')](_0xcc05('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xcc05('0xb'),'Chat'),'defaultValue':_0xcc05('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 6247f86..fd8dbe0 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 _0x2b74=['internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','reject','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','sequelize','Sequelize','email','event','rejectmessage','download','unix','server','files','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','headers','Bcc','existsSync','push','build','writeFileSync','eml-format','moment','bluebird','lodash','html-to-text','../../config/logger','mail-interactions','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','limit','undefined','count','offset','set','Content-Range','update','destroy','then','status','sendStatus','stack','name','send','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','include','find','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','UserId','agent','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname'];(function(_0x105b20,_0x388d13){var _0x357455=function(_0x5b28d7){while(--_0x5b28d7){_0x105b20['push'](_0x105b20['shift']());}};_0x357455(++_0x388d13);}(_0x2b74,0xbf));var _0x42b7=function(_0x1787ce,_0x4cbc90){_0x1787ce=_0x1787ce-0x0;var _0x150c53=_0x2b74[_0x1787ce];return _0x150c53;};'use strict';var emlformat=require(_0x42b7('0x0'));var moment=require(_0x42b7('0x1'));var BPromise=require(_0x42b7('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x42b7('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x42b7('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x42b7('0x5'))('api');var interaction_log=require(_0x42b7('0x5'))(_0x42b7('0x6'));var config=require('../../config/environment');var db=require(_0x42b7('0x7'))['db'];config[_0x42b7('0x8')]=_[_0x42b7('0x9')](config[_0x42b7('0x8')],{'host':_0x42b7('0xa'),'port':0x18eb});var socket=require(_0x42b7('0xb'))(new Redis(config[_0x42b7('0x8')]));var htmlEntities=require(_0x42b7('0xc'));require(_0x42b7('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x42b7('0xe')][_0x42b7('0xf')]({'port':0x232b});var client9002=jayson[_0x42b7('0xe')][_0x42b7('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x1b0dd8,_0x41ff2f,_0x31f7f7,_0x181e47){return new BPromise(function(_0xf6d35d,_0x275da8){var _0x19cf60=_0x181e47||client;return _0x19cf60[_0x42b7('0x10')](_0x1b0dd8,_0x31f7f7)['then'](function(_0x5bd812){logger[_0x42b7('0x11')](_0x42b7('0x12'),_0x41ff2f,_0x42b7('0x13'));logger[_0x42b7('0x14')](_0x42b7('0x15'),_0x41ff2f,_0x42b7('0x13'),JSON[_0x42b7('0x16')](_0x5bd812));if(_0x5bd812['error']){if(_0x5bd812[_0x42b7('0x17')][_0x42b7('0x18')]===0x1f4){logger[_0x42b7('0x17')](_0x42b7('0x12'),_0x41ff2f,_0x5bd812[_0x42b7('0x17')][_0x42b7('0x19')]);return _0x275da8(_0x5bd812[_0x42b7('0x17')][_0x42b7('0x19')]);}logger[_0x42b7('0x17')](_0x42b7('0x12'),_0x41ff2f,_0x5bd812[_0x42b7('0x17')][_0x42b7('0x19')]);return _0xf6d35d(_0x5bd812['error'][_0x42b7('0x19')]);}else{logger[_0x42b7('0x11')](_0x42b7('0x12'),_0x41ff2f,_0x42b7('0x13'));_0xf6d35d(_0x5bd812[_0x42b7('0x1a')]['message']);}})[_0x42b7('0x1b')](function(_0x2b7b85){logger[_0x42b7('0x17')](_0x42b7('0x12'),_0x41ff2f,_0x2b7b85);_0x275da8(_0x2b7b85);});});}function respondWithResult(_0x2c1538,_0x359a16){_0x359a16=_0x359a16||0xc8;return function(_0x42217a){if(_0x42217a){return _0x2c1538['status'](_0x359a16)[_0x42b7('0x1c')](_0x42217a);}};}function respondWithFilteredResult(_0x144484,_0x43d24c){return function(_0x4dafad){if(_0x4dafad){var _0x56caaf=typeof _0x43d24c['offset']==='undefined'&&typeof _0x43d24c[_0x42b7('0x1d')]===_0x42b7('0x1e');var _0x24266f=_0x4dafad[_0x42b7('0x1f')];var _0x3d5d2d=_0x56caaf?0x0:_0x43d24c['offset'];var _0x6974ea=_0x56caaf?_0x4dafad[_0x42b7('0x1f')]:_0x43d24c[_0x42b7('0x20')]+_0x43d24c[_0x42b7('0x1d')];var _0x4ac71d;if(_0x6974ea>=_0x24266f){_0x6974ea=_0x24266f;_0x4ac71d=0xc8;}else{_0x4ac71d=0xce;}_0x144484['status'](_0x4ac71d);return _0x144484[_0x42b7('0x21')](_0x42b7('0x22'),_0x3d5d2d+'-'+_0x6974ea+'/'+_0x24266f)['json'](_0x4dafad);}return null;};}function saveUpdates(_0x5ab43d){return function(_0x388a8b){if(_0x388a8b){return _0x388a8b[_0x42b7('0x23')](_0x5ab43d)['then'](function(_0x4305eb){return _0x4305eb;});}return null;};}function removeEntity(_0x4675c0){return function(_0x5b4d3b){if(_0x5b4d3b){return _0x5b4d3b[_0x42b7('0x24')]()[_0x42b7('0x25')](function(){_0x4675c0[_0x42b7('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x678cc3){return function(_0x143826){if(!_0x143826){_0x678cc3[_0x42b7('0x27')](0x194);}return _0x143826;};}function handleError(_0x3af58d,_0x44220b){_0x44220b=_0x44220b||0x1f4;return function(_0x4ab1be){logger[_0x42b7('0x17')](_0x4ab1be[_0x42b7('0x28')]);if(_0x4ab1be[_0x42b7('0x29')]){delete _0x4ab1be[_0x42b7('0x29')];}_0x3af58d[_0x42b7('0x26')](_0x44220b)[_0x42b7('0x2a')](_0x4ab1be);};}exports['index']=function(_0x3dfd63,_0x538e6b){var _0x11ead4={},_0x50b169={},_0x527f16={'count':0x0,'rows':[]};var _0x158b64=_[_0x42b7('0x2b')](db[_0x42b7('0x2c')]['rawAttributes'],function(_0x5943ba){return{'name':_0x5943ba[_0x42b7('0x2d')],'type':_0x5943ba[_0x42b7('0x2e')][_0x42b7('0x2f')]};});_0x50b169[_0x42b7('0x30')]=_[_0x42b7('0x2b')](_0x158b64,_0x42b7('0x29'));_0x50b169[_0x42b7('0x31')]=_[_0x42b7('0x32')](_0x3dfd63[_0x42b7('0x31')]);_0x50b169[_0x42b7('0x33')]=_[_0x42b7('0x34')](_0x50b169[_0x42b7('0x30')],_0x50b169[_0x42b7('0x31')]);_0x11ead4[_0x42b7('0x35')]=_[_0x42b7('0x34')](_0x50b169[_0x42b7('0x30')],qs[_0x42b7('0x36')](_0x3dfd63[_0x42b7('0x31')][_0x42b7('0x36')]));_0x11ead4[_0x42b7('0x35')]=_0x11ead4['attributes'][_0x42b7('0x37')]?_0x11ead4[_0x42b7('0x35')]:_0x50b169[_0x42b7('0x30')];if(!_0x3dfd63[_0x42b7('0x31')][_0x42b7('0x38')]('nolimit')){_0x11ead4['limit']=qs['limit'](_0x3dfd63[_0x42b7('0x31')][_0x42b7('0x1d')]);_0x11ead4[_0x42b7('0x20')]=qs[_0x42b7('0x20')](_0x3dfd63[_0x42b7('0x31')][_0x42b7('0x20')]);}_0x11ead4[_0x42b7('0x39')]=qs[_0x42b7('0x3a')](_0x3dfd63['query'][_0x42b7('0x3a')]);_0x11ead4[_0x42b7('0x3b')]=qs[_0x42b7('0x33')](_[_0x42b7('0x3c')](_0x3dfd63[_0x42b7('0x31')],_0x50b169[_0x42b7('0x33')]),_0x158b64);if(_0x3dfd63['query'][_0x42b7('0x3d')]){_0x11ead4[_0x42b7('0x3b')]=_[_0x42b7('0x3e')](_0x11ead4[_0x42b7('0x3b')],{'$or':_[_0x42b7('0x2b')](_0x158b64,function(_0x45e90e){if(_0x45e90e[_0x42b7('0x2e')]!==_0x42b7('0x3f')){var _0x380195={};_0x380195[_0x45e90e['name']]={'$like':'%'+_0x3dfd63[_0x42b7('0x31')]['filter']+'%'};return _0x380195;}})});}_0x11ead4=_[_0x42b7('0x3e')]({},_0x11ead4,_0x3dfd63[_0x42b7('0x40')]);var _0x120e58={'where':_0x11ead4[_0x42b7('0x3b')]};return db[_0x42b7('0x2c')][_0x42b7('0x1f')](_0x120e58)[_0x42b7('0x25')](function(_0x402cc3){_0x527f16[_0x42b7('0x1f')]=_0x402cc3;if(_0x3dfd63[_0x42b7('0x31')][_0x42b7('0x41')]){_0x11ead4['include']=[{'all':!![]}];}return db[_0x42b7('0x2c')][_0x42b7('0x42')](_0x11ead4);})[_0x42b7('0x25')](function(_0x3fb62f){_0x527f16[_0x42b7('0x43')]=_0x3fb62f;return _0x527f16;})[_0x42b7('0x25')](respondWithFilteredResult(_0x538e6b,_0x11ead4))['catch'](handleError(_0x538e6b,null));};exports['show']=function(_0x455aeb,_0x2cb88b){var _0x43c3c8={'raw':!![],'where':{'id':_0x455aeb[_0x42b7('0x44')]['id']}},_0x1e338a={};_0x1e338a[_0x42b7('0x30')]=_[_0x42b7('0x32')](db[_0x42b7('0x2c')][_0x42b7('0x45')]);_0x1e338a['query']=_[_0x42b7('0x32')](_0x455aeb[_0x42b7('0x31')]);_0x1e338a[_0x42b7('0x33')]=_['intersection'](_0x1e338a[_0x42b7('0x30')],_0x1e338a[_0x42b7('0x31')]);_0x43c3c8['attributes']=_[_0x42b7('0x34')](_0x1e338a[_0x42b7('0x30')],qs['fields'](_0x455aeb['query']['fields']));_0x43c3c8['attributes']=_0x43c3c8[_0x42b7('0x35')][_0x42b7('0x37')]?_0x43c3c8[_0x42b7('0x35')]:_0x1e338a[_0x42b7('0x30')];if(_0x455aeb[_0x42b7('0x31')][_0x42b7('0x41')]){_0x43c3c8[_0x42b7('0x46')]=[{'all':!![]}];}_0x43c3c8=_[_0x42b7('0x3e')]({},_0x43c3c8,_0x455aeb['options']);return db['MailMessage'][_0x42b7('0x47')](_0x43c3c8)[_0x42b7('0x25')](handleEntityNotFound(_0x2cb88b,null))[_0x42b7('0x25')](respondWithResult(_0x2cb88b,null))[_0x42b7('0x1b')](handleError(_0x2cb88b,null));};exports['update']=function(_0x31cdd9,_0x4dfd13){if(_0x31cdd9[_0x42b7('0x48')]['id']){delete _0x31cdd9['body']['id'];}return db[_0x42b7('0x2c')][_0x42b7('0x47')]({'where':{'id':_0x31cdd9['params']['id']}})[_0x42b7('0x25')](handleEntityNotFound(_0x4dfd13,null))[_0x42b7('0x25')](saveUpdates(_0x31cdd9[_0x42b7('0x48')],null))[_0x42b7('0x25')](respondWithResult(_0x4dfd13,null))[_0x42b7('0x1b')](handleError(_0x4dfd13,null));};exports[_0x42b7('0x24')]=function(_0xb999a2,_0x546b16){return db[_0x42b7('0x2c')][_0x42b7('0x47')]({'where':{'id':_0xb999a2[_0x42b7('0x44')]['id']}})[_0x42b7('0x25')](handleEntityNotFound(_0x546b16,null))['then'](removeEntity(_0x546b16,null))[_0x42b7('0x1b')](handleError(_0x546b16,null));};exports[_0x42b7('0x49')]=function(_0x344f3e,_0x4831fe){return db['MailMessage'][_0x42b7('0x49')]()[_0x42b7('0x25')](respondWithResult(_0x4831fe,null))[_0x42b7('0x1b')](handleError(_0x4831fe,null));};exports[_0x42b7('0x4a')]=function(_0x4c85c7,_0x2ba194){return db[_0x42b7('0x2c')]['create'](_0x4c85c7['body'])[_0x42b7('0x25')](function(_0x46f246){if(_0x46f246){if(_0x46f246[_0x42b7('0x4b')]===_0x42b7('0x4c')&&!_0x46f246['secret']){var _0x2a1141,_0x4459e4,_0x5b1d83;if(_0x4c85c7[_0x42b7('0x48')]['to']){_0x4459e4=_0x4c85c7[_0x42b7('0x48')]['to'][_0x42b7('0x4d')](',')[0x0];}return db[_0x42b7('0x4e')][_0x42b7('0x4f')]({'where':{'id':_0x46f246[_0x42b7('0x50')]},'include':[{'model':db['CmList'],'as':_0x42b7('0x51'),'include':[{'model':db[_0x42b7('0x52')],'as':_0x42b7('0x53'),'where':{'email':_0x4459e4},'limit':0x1,'order':[[_0x42b7('0x54'),_0x42b7('0x55')]]}]},{'model':db[_0x42b7('0x56')],'as':_0x42b7('0x57'),'raw':!![],'include':[{'model':db[_0x42b7('0x58')],'as':_0x42b7('0x58'),'raw':!![]}]}]})['then'](function(_0xde16e3){_0x2a1141=_0xde16e3;if(!_0x2a1141||!_0x2a1141[_0x42b7('0x57')])return;var _0x227d66=_0x2a1141[_0x42b7('0x59')]();if(_0x4c85c7[_0x42b7('0x48')]['attachments']&&_0x4c85c7[_0x42b7('0x48')]['attachments'][_0x42b7('0x37')]){for(var _0x2e3cc6=0x0;_0x2e3cc6<_0x4c85c7[_0x42b7('0x48')][_0x42b7('0x5a')]['length'];_0x2e3cc6+=0x1){_0x4c85c7['body'][_0x42b7('0x5a')][_0x2e3cc6]={'filename':_0x4c85c7[_0x42b7('0x48')][_0x42b7('0x5a')][_0x2e3cc6][_0x42b7('0x29')],'path':path[_0x42b7('0x5b')](config[_0x42b7('0x5c')],_0x42b7('0x5d'),_0x4c85c7['body'][_0x42b7('0x5a')][_0x2e3cc6][_0x42b7('0x5e')])};}}_0x5b1d83={'account':_0x227d66,'message':_0x4c85c7['body']};return;})[_0x42b7('0x25')](function(){if(_0x2a1141[_0x42b7('0x51')]){if(_0x2a1141[_0x42b7('0x51')][_0x42b7('0x53')][_0x42b7('0x37')]){return _0x2a1141[_0x42b7('0x51')][_0x42b7('0x53')][0x0];}else{return db[_0x42b7('0x52')]['create'](_['defaults'](_0x4c85c7[_0x42b7('0x48')],{'firstName':_0x4c85c7[_0x42b7('0x48')]['to'],'email':_0x4c85c7[_0x42b7('0x48')]['to'],'phone':_0x4c85c7[_0x42b7('0x48')]['to'],'ListId':_0x2a1141[_0x42b7('0x5f')]}));}}else{throw new Error(_0x42b7('0x60'));}})[_0x42b7('0x25')](function(){if(_0x5b1d83){return respondWithRpcPromise('SendMail',_0x42b7('0x61'),_0x5b1d83,client9003)['then'](function(_0x393770){return _0x46f246[_0x42b7('0x23')]({'read':!![],'messageId':_0x393770[_0x42b7('0x62')],'sentAt':moment()[_0x42b7('0x63')](_0x42b7('0x64'))});})[_0x42b7('0x1b')](function(_0x10c0c1){logger['error']('%s',JSON[_0x42b7('0x16')](_0x10c0c1));return _0x46f246;});}return _0x46f246;});}return _0x46f246;}})[_0x42b7('0x25')](respondWithResult(_0x2ba194,0xc9))['catch'](handleError(_0x2ba194,null));};exports[_0x42b7('0x65')]=function(_0x193686,_0x3162e9){var _0xb04353={'agent':{},'channel':_0x42b7('0x66')};if(_0x193686[_0x42b7('0x48')]['id']){delete _0x193686[_0x42b7('0x48')]['id'];}_0x193686[_0x42b7('0x48')]['read']=!![];_0x193686['body'][_0x42b7('0x67')]=moment()[_0x42b7('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x193686[_0x42b7('0x48')]['UserId']=_0x193686[_0x42b7('0x48')][_0x42b7('0x68')]||_0x193686['user']['id'];_0xb04353[_0x42b7('0x69')]['id']=_0x193686[_0x42b7('0x48')]['UserId'];return db[_0x42b7('0x2c')][_0x42b7('0x47')]({'where':{'id':_0x193686[_0x42b7('0x44')]['id'],'UserId':null}})[_0x42b7('0x25')](handleEntityNotFound(_0x3162e9,null))[_0x42b7('0x25')](saveUpdates(_0x193686[_0x42b7('0x48')],null))[_0x42b7('0x25')](function(_0x5901dc){if(_0x5901dc){_0xb04353[_0x42b7('0x19')]=_0x5901dc[_0x42b7('0x6a')]({'plain':!![]});return db[_0x42b7('0x6b')][_0x42b7('0x47')]({'where':{'id':_0x5901dc['MailInteractionId']}});}return null;})[_0x42b7('0x25')](handleEntityNotFound(_0x3162e9,null))[_0x42b7('0x25')](function(_0x9f4096){if(_0x9f4096){return _0x9f4096[_0x42b7('0x23')]({'UserId':_0x193686[_0x42b7('0x48')][_0x42b7('0x68')],'read1stAt':_['isNil'](_0x9f4096[_0x42b7('0x6c')])?moment()['format'](_0x42b7('0x64')):undefined});}return null;})['then'](function(_0x35ce9f){if(_0x35ce9f){_0xb04353[_0x42b7('0x6d')]=_0x35ce9f[_0x42b7('0x6a')]({'plain':!![]});interaction_log[_0x42b7('0x11')](_0x42b7('0x6e'),_0x193686[_0x42b7('0x6f')]['id'],_0x193686[_0x42b7('0x6f')][_0x42b7('0x29')],_0x193686[_0x42b7('0x6f')][_0x42b7('0x70')],_0xb04353[_0x42b7('0x6d')]['id'],_0x193686[_0x42b7('0x48')]?JSON['stringify'](_0x193686[_0x42b7('0x48')]):_0x42b7('0x71'));return respondWithRpcPromise(_0x42b7('0x72'),_0x42b7('0x73'),_0xb04353);}return null;})['then'](function(_0x2351c4){var _0x38ab33=_0x42b7('0x74')+_0x2351c4[_0x42b7('0x19')][_0x42b7('0x75')];return db['sequelize'][_0x42b7('0x31')](_0x38ab33,{'type':db['Sequelize'][_0x42b7('0x76')][_0x42b7('0x77')],'raw':!![]})[_0x42b7('0x25')](function(_0x20a656){return _0x20a656;});})[_0x42b7('0x25')](function(_0xcbdc4b){if(_0xcbdc4b){_0xb04353[_0x42b7('0x19')][_0x42b7('0x78')]=_0xcbdc4b[0x0];if(!_0x193686[_0x42b7('0x48')][_0x42b7('0x68')])return;return db[_0x42b7('0x79')]['find']({'where':{'id':_0x193686[_0x42b7('0x48')][_0x42b7('0x68')],'role':_0x42b7('0x69')},'attributes':['id','name',_0x42b7('0x7a'),'email',_0x42b7('0x7b')],'raw':!![]});}return null;})[_0x42b7('0x25')](function(_0x43ab98){if(!_0x43ab98)return null;_0xb04353[_0x42b7('0x19')]['agent']=_0x43ab98;return _0xb04353;})[_0x42b7('0x25')](function(_0x37c4e0){if(_0x37c4e0){if(_0x193686[_0x42b7('0x48')][_0x42b7('0x7c')]){_0xb04353[_0x42b7('0x19')][_0x42b7('0x7d')]=util['format'](_0x42b7('0x7e'),_0x193686[_0x42b7('0x6f')][_0x42b7('0x29')]);_0xb04353['message'][_0x42b7('0x7f')]=_0xb04353[_0x42b7('0x7f')];_0xb04353[_0x42b7('0x19')][_0x42b7('0x80')]=_0xb04353['channel'];_0xb04353[_0x42b7('0x19')]['event']='accept';_0xb04353[_0x42b7('0x19')][_0x42b7('0x48')]=htmlToText[_0x42b7('0x81')](_0xb04353[_0x42b7('0x19')][_0x42b7('0x48')]);return respondWithRpcPromise(_0x42b7('0x82'),'EventManager',{'event':'acceptmessage','message':_0xb04353[_0x42b7('0x19')]},client9002)[_0x42b7('0x25')](function(){return _0xb04353;});}return _0xb04353;}return null;})[_0x42b7('0x25')](respondWithResult(_0x3162e9,null))[_0x42b7('0x1b')](handleError(_0x3162e9,null));};exports[_0x42b7('0x83')]=function(_0x4643de,_0x5b08c4){var _0x3c9fc4={'agent':{},'channel':_0x42b7('0x66')};if(_0x4643de['body']['id']){delete _0x4643de[_0x42b7('0x48')]['id'];}_0x4643de[_0x42b7('0x48')][_0x42b7('0x68')]=_0x4643de['body'][_0x42b7('0x68')]||_0x4643de['user']['id'];_0x3c9fc4['agent']['id']=_0x4643de[_0x42b7('0x48')][_0x42b7('0x68')];return db[_0x42b7('0x2c')][_0x42b7('0x47')]({'where':{'id':_0x4643de[_0x42b7('0x44')]['id'],'UserId':null}})[_0x42b7('0x25')](handleEntityNotFound(_0x5b08c4,null))[_0x42b7('0x25')](function(_0xc5d641){if(_0xc5d641){_0x3c9fc4[_0x42b7('0x19')]=_0xc5d641[_0x42b7('0x6a')]({'plain':!![]});return db[_0x42b7('0x6b')]['find']({'where':{'id':_0xc5d641[_0x42b7('0x84')]}});}return null;})[_0x42b7('0x25')](handleEntityNotFound(_0x5b08c4,null))['then'](function(_0x298d44){if(_0x298d44){_0x3c9fc4[_0x42b7('0x6d')]=_0x298d44[_0x42b7('0x6a')]({'plain':!![]});interaction_log['info'](_0x42b7('0x85'),_0x4643de[_0x42b7('0x6f')]['id'],_0x4643de[_0x42b7('0x6f')]['name'],_0x4643de['user']['role'],_0x3c9fc4[_0x42b7('0x6d')]['id'],_0x4643de[_0x42b7('0x48')]?JSON[_0x42b7('0x16')](_0x4643de[_0x42b7('0x48')]):'null');return respondWithRpcPromise(_0x42b7('0x86'),'rejectMessage',_0x3c9fc4);}return null;})[_0x42b7('0x25')](function(_0x1142e1){var _0x5410ab=_0x42b7('0x74')+_0x1142e1[_0x42b7('0x19')][_0x42b7('0x75')];return db[_0x42b7('0x87')]['query'](_0x5410ab,{'type':db[_0x42b7('0x88')][_0x42b7('0x76')][_0x42b7('0x77')],'raw':!![]})['then'](function(_0x592f17){return _0x592f17;});})['then'](function(_0x34ee3f){if(_0x34ee3f){_0x3c9fc4[_0x42b7('0x19')][_0x42b7('0x78')]=_0x34ee3f[0x0];if(!_0x4643de['body']['UserId'])return;return db['User'][_0x42b7('0x47')]({'where':{'id':_0x4643de['body']['UserId'],'role':_0x42b7('0x69')},'attributes':['id',_0x42b7('0x29'),_0x42b7('0x7a'),_0x42b7('0x89'),_0x42b7('0x7b')],'raw':!![]});}return null;})[_0x42b7('0x25')](function(_0x30c0dd){if(!_0x30c0dd)return null;_0x3c9fc4[_0x42b7('0x19')][_0x42b7('0x69')]=_0x30c0dd;return _0x3c9fc4;})[_0x42b7('0x25')](function(_0x55949a){if(_0x55949a){_0x55949a['message'][_0x42b7('0x7d')]=util[_0x42b7('0x63')]('SIP/%s',_0x4643de[_0x42b7('0x6f')][_0x42b7('0x29')]);_0x55949a[_0x42b7('0x19')][_0x42b7('0x7f')]=_0x3c9fc4[_0x42b7('0x7f')];_0x55949a[_0x42b7('0x19')][_0x42b7('0x80')]=_0x3c9fc4['channel'];_0x55949a[_0x42b7('0x19')][_0x42b7('0x8a')]=_0x42b7('0x83');_0x55949a[_0x42b7('0x19')][_0x42b7('0x48')]=htmlToText[_0x42b7('0x81')](_0x3c9fc4[_0x42b7('0x19')][_0x42b7('0x48')]);respondWithRpcPromise(_0x42b7('0x82'),_0x42b7('0x82'),{'event':_0x42b7('0x8b'),'message':_0x55949a[_0x42b7('0x19')]},client9002);return _0x3c9fc4;}return null;})[_0x42b7('0x25')](respondWithResult(_0x5b08c4,null))['catch'](handleError(_0x5b08c4,null));};exports[_0x42b7('0x8c')]=function(_0x59969e,_0x14fa44){var _0x224179=moment()[_0x42b7('0x8d')]()['toString']();var _0x1c405f=path[_0x42b7('0x5b')](config[_0x42b7('0x5c')],_0x42b7('0x8e'),_0x42b7('0x8f'),'tmp');var _0x3937b6=path[_0x42b7('0x5b')](config['root'],_0x42b7('0x8e'),_0x42b7('0x8f'),_0x42b7('0x5a'));var _0x7ddf7b=util[_0x42b7('0x63')](_0x42b7('0x90'),_0x224179);return db[_0x42b7('0x2c')][_0x42b7('0x47')]({'where':{'id':_0x59969e[_0x42b7('0x44')]['id']},'attributes':['id','body',_0x42b7('0x91'),'to','cc',_0x42b7('0x92'),_0x42b7('0x93'),_0x42b7('0x94')],'include':_0x59969e['query'][_0x42b7('0x5a')]?[{'model':db[_0x42b7('0x95')],'as':_0x42b7('0x96')}]:undefined})['then'](handleEntityNotFound(_0x14fa44,null))[_0x42b7('0x25')](function(_0x8dbbc8){if(_0x8dbbc8){var _0x156a2f=_0x8dbbc8;var _0x3d71ff={'from':_0x156a2f[_0x42b7('0x91')],'to':_0x156a2f['to'],'subject':_0x156a2f[_0x42b7('0x93')],'html':htmlEntities['decode'](_0x156a2f[_0x42b7('0x48')]),'headers':{'Date':moment(_0x156a2f['createdAt'])[_0x42b7('0x63')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x8dbbc8['cc']){_0x3d71ff[_0x42b7('0x97')]['Cc']=_0x8dbbc8['cc'];}if(_0x8dbbc8[_0x42b7('0x92')]){_0x3d71ff[_0x42b7('0x97')][_0x42b7('0x98')]=_0x8dbbc8['bcc'];}return new BPromise(function(_0x5d4239,_0x391d62){if(_0x8dbbc8[_0x42b7('0x96')]){for(var _0x326b05=0x0;_0x326b05<_0x8dbbc8['Attachments'][_0x42b7('0x37')];_0x326b05++){var _0x5ce042=_0x8dbbc8[_0x42b7('0x96')][_0x326b05];var _0x6a1ea2=path[_0x42b7('0x5b')](_0x3937b6,_0x5ce042['basename']);if(fs[_0x42b7('0x99')](_0x6a1ea2)){_0x3d71ff['attachments'][_0x42b7('0x9a')]({'name':_0x5ce042[_0x42b7('0x29')],'contentType':_0x5ce042['type'],'data':fs['readFileSync'](_0x6a1ea2)});}}}emlformat[_0x42b7('0x9b')](_0x3d71ff,function(_0x353ade,_0x2fab2a){if(_0x353ade)return _0x391d62(_0x353ade);fs[_0x42b7('0x9c')](path[_0x42b7('0x5b')](_0x1c405f,_0x7ddf7b),_0x2fab2a);return _0x5d4239(_0x2fab2a);});});}})[_0x42b7('0x25')](function(_0xadce1e){if(_0xadce1e){return _0x14fa44[_0x42b7('0x8c')](path[_0x42b7('0x5b')](_0x1c405f,_0x7ddf7b),_0x7ddf7b,function(_0x36345f){if(!_0x36345f)fs['unlinkSync'](path['join'](_0x1c405f,_0x7ddf7b));});}})[_0x42b7('0x1b')](handleError(_0x14fa44,null));}; \ No newline at end of file +var _0xa84d=['stack','send','index','MailMessage','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','findAll','rows','catch','show','params','keys','intersection','includeAll','include','find','update','body','describe','direction','out','secret','MailAccount','findOne','MailAccountId','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','List','create','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','user','agent','get','MailInteraction','isNil','read1stAt','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','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','unix','toString','server','tmp','files','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','offset','undefined','count','limit','status','set','Content-Range','json','destroy','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa84d,0x11b));var _0xda84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa84d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xda84('0x0'));var moment=require('moment');var BPromise=require(_0xda84('0x1'));var util=require('util');var path=require(_0xda84('0x2'));var fs=require('fs');var _=require(_0xda84('0x3'));var Redis=require(_0xda84('0x4'));var htmlToText=require(_0xda84('0x5'));var qs=require(_0xda84('0x6'));var logger=require(_0xda84('0x7'))(_0xda84('0x8'));var interaction_log=require(_0xda84('0x7'))(_0xda84('0x9'));var config=require(_0xda84('0xa'));var db=require(_0xda84('0xb'))['db'];config[_0xda84('0xc')]=_[_0xda84('0xd')](config[_0xda84('0xc')],{'host':_0xda84('0xe'),'port':0x18eb});var socket=require(_0xda84('0xf'))(new Redis(config[_0xda84('0xc')]));var htmlEntities=require(_0xda84('0x10'));require(_0xda84('0x11'))[_0xda84('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0xda84('0x13')][_0xda84('0x14')]({'port':0x232c});var client9003=jayson[_0xda84('0x13')][_0xda84('0x14')]({'port':0x232b});var client9002=jayson[_0xda84('0x13')][_0xda84('0x14')]({'port':0x232a});function respondWithRpcPromise(_0xbf9f30,_0x2907a2,_0x2454dc,_0x4b05df){return new BPromise(function(_0x1c5776,_0x27f6ef){var _0x2741cc=_0x4b05df||client;return _0x2741cc[_0xda84('0x15')](_0xbf9f30,_0x2454dc)[_0xda84('0x16')](function(_0x4c608a){logger[_0xda84('0x17')](_0xda84('0x18'),_0x2907a2,_0xda84('0x19'));logger[_0xda84('0x1a')](_0xda84('0x1b'),_0x2907a2,_0xda84('0x19'),JSON[_0xda84('0x1c')](_0x4c608a));if(_0x4c608a[_0xda84('0x1d')]){if(_0x4c608a[_0xda84('0x1d')][_0xda84('0x1e')]===0x1f4){logger['error'](_0xda84('0x18'),_0x2907a2,_0x4c608a[_0xda84('0x1d')]['message']);return _0x27f6ef(_0x4c608a['error'][_0xda84('0x1f')]);}logger[_0xda84('0x1d')](_0xda84('0x18'),_0x2907a2,_0x4c608a[_0xda84('0x1d')]['message']);return _0x1c5776(_0x4c608a[_0xda84('0x1d')][_0xda84('0x1f')]);}else{logger[_0xda84('0x17')](_0xda84('0x18'),_0x2907a2,_0xda84('0x19'));_0x1c5776(_0x4c608a[_0xda84('0x20')]['message']);}})['catch'](function(_0x2e5522){logger[_0xda84('0x1d')]('MailMessage,\x20%s,\x20%s',_0x2907a2,_0x2e5522);_0x27f6ef(_0x2e5522);});});}function respondWithResult(_0x22785e,_0x355f03){_0x355f03=_0x355f03||0xc8;return function(_0x444e8d){if(_0x444e8d){return _0x22785e['status'](_0x355f03)['json'](_0x444e8d);}};}function respondWithFilteredResult(_0x1a23be,_0x31fb6e){return function(_0x86f204){if(_0x86f204){var _0x2a2224=typeof _0x31fb6e[_0xda84('0x21')]===_0xda84('0x22')&&typeof _0x31fb6e['limit']===_0xda84('0x22');var _0xaf567b=_0x86f204[_0xda84('0x23')];var _0x548db7=_0x2a2224?0x0:_0x31fb6e[_0xda84('0x21')];var _0x516d38=_0x2a2224?_0x86f204[_0xda84('0x23')]:_0x31fb6e['offset']+_0x31fb6e[_0xda84('0x24')];var _0x4f1b0e;if(_0x516d38>=_0xaf567b){_0x516d38=_0xaf567b;_0x4f1b0e=0xc8;}else{_0x4f1b0e=0xce;}_0x1a23be[_0xda84('0x25')](_0x4f1b0e);return _0x1a23be[_0xda84('0x26')](_0xda84('0x27'),_0x548db7+'-'+_0x516d38+'/'+_0xaf567b)[_0xda84('0x28')](_0x86f204);}return null;};}function saveUpdates(_0x42d60b){return function(_0x162933){if(_0x162933){return _0x162933['update'](_0x42d60b)[_0xda84('0x16')](function(_0xd9d3c2){return _0xd9d3c2;});}return null;};}function removeEntity(_0x19432c){return function(_0x20f231){if(_0x20f231){return _0x20f231[_0xda84('0x29')]()['then'](function(){_0x19432c[_0xda84('0x25')](0xcc)[_0xda84('0x2a')]();});}};}function handleEntityNotFound(_0x4de297){return function(_0x12bc77){if(!_0x12bc77){_0x4de297['sendStatus'](0x194);}return _0x12bc77;};}function handleError(_0x4cc77f,_0x31bcc9){_0x31bcc9=_0x31bcc9||0x1f4;return function(_0x2cb7fe){logger[_0xda84('0x1d')](_0x2cb7fe[_0xda84('0x2b')]);if(_0x2cb7fe['name']){delete _0x2cb7fe['name'];}_0x4cc77f[_0xda84('0x25')](_0x31bcc9)[_0xda84('0x2c')](_0x2cb7fe);};}exports[_0xda84('0x2d')]=function(_0x46e730,_0x1c1a65){var _0x403555={},_0x40dcfb={},_0x210c05={'count':0x0,'rows':[]};var _0x4d7a25=_['map'](db[_0xda84('0x2e')][_0xda84('0x2f')],function(_0x16d058){return{'name':_0x16d058[_0xda84('0x30')],'type':_0x16d058[_0xda84('0x31')][_0xda84('0x32')]};});_0x40dcfb[_0xda84('0x33')]=_['map'](_0x4d7a25,_0xda84('0x34'));_0x40dcfb[_0xda84('0x35')]=_['keys'](_0x46e730[_0xda84('0x35')]);_0x40dcfb[_0xda84('0x36')]=_['intersection'](_0x40dcfb['model'],_0x40dcfb[_0xda84('0x35')]);_0x403555[_0xda84('0x37')]=_['intersection'](_0x40dcfb[_0xda84('0x33')],qs[_0xda84('0x38')](_0x46e730['query'][_0xda84('0x38')]));_0x403555['attributes']=_0x403555[_0xda84('0x37')][_0xda84('0x39')]?_0x403555[_0xda84('0x37')]:_0x40dcfb[_0xda84('0x33')];if(!_0x46e730[_0xda84('0x35')][_0xda84('0x3a')](_0xda84('0x3b'))){_0x403555[_0xda84('0x24')]=qs['limit'](_0x46e730['query']['limit']);_0x403555['offset']=qs[_0xda84('0x21')](_0x46e730['query'][_0xda84('0x21')]);}_0x403555[_0xda84('0x3c')]=qs['sort'](_0x46e730['query'][_0xda84('0x3d')]);_0x403555[_0xda84('0x3e')]=qs[_0xda84('0x36')](_[_0xda84('0x3f')](_0x46e730['query'],_0x40dcfb[_0xda84('0x36')]),_0x4d7a25);if(_0x46e730['query']['filter']){_0x403555[_0xda84('0x3e')]=_[_0xda84('0x40')](_0x403555['where'],{'$or':_[_0xda84('0x41')](_0x4d7a25,function(_0x38d9df){if(_0x38d9df[_0xda84('0x31')]!==_0xda84('0x42')){var _0x4f4148={};_0x4f4148[_0x38d9df[_0xda84('0x34')]]={'$like':'%'+_0x46e730['query']['filter']+'%'};return _0x4f4148;}})});}_0x403555=_['merge']({},_0x403555,_0x46e730[_0xda84('0x43')]);var _0x2a6981={'where':_0x403555[_0xda84('0x3e')]};return db['MailMessage'][_0xda84('0x23')](_0x2a6981)['then'](function(_0x382fe7){_0x210c05[_0xda84('0x23')]=_0x382fe7;if(_0x46e730[_0xda84('0x35')]['includeAll']){_0x403555['include']=[{'all':!![]}];}return db[_0xda84('0x2e')][_0xda84('0x44')](_0x403555);})[_0xda84('0x16')](function(_0x226e0d){_0x210c05[_0xda84('0x45')]=_0x226e0d;return _0x210c05;})[_0xda84('0x16')](respondWithFilteredResult(_0x1c1a65,_0x403555))[_0xda84('0x46')](handleError(_0x1c1a65,null));};exports[_0xda84('0x47')]=function(_0x2e1629,_0x4475b9){var _0x2b363c={'raw':!![],'where':{'id':_0x2e1629[_0xda84('0x48')]['id']}},_0x27244e={};_0x27244e[_0xda84('0x33')]=_[_0xda84('0x49')](db[_0xda84('0x2e')]['rawAttributes']);_0x27244e[_0xda84('0x35')]=_[_0xda84('0x49')](_0x2e1629[_0xda84('0x35')]);_0x27244e[_0xda84('0x36')]=_[_0xda84('0x4a')](_0x27244e[_0xda84('0x33')],_0x27244e[_0xda84('0x35')]);_0x2b363c[_0xda84('0x37')]=_[_0xda84('0x4a')](_0x27244e['model'],qs[_0xda84('0x38')](_0x2e1629['query'][_0xda84('0x38')]));_0x2b363c[_0xda84('0x37')]=_0x2b363c[_0xda84('0x37')][_0xda84('0x39')]?_0x2b363c['attributes']:_0x27244e[_0xda84('0x33')];if(_0x2e1629[_0xda84('0x35')][_0xda84('0x4b')]){_0x2b363c[_0xda84('0x4c')]=[{'all':!![]}];}_0x2b363c=_[_0xda84('0x40')]({},_0x2b363c,_0x2e1629[_0xda84('0x43')]);return db['MailMessage'][_0xda84('0x4d')](_0x2b363c)['then'](handleEntityNotFound(_0x4475b9,null))[_0xda84('0x16')](respondWithResult(_0x4475b9,null))['catch'](handleError(_0x4475b9,null));};exports[_0xda84('0x4e')]=function(_0x28b2a6,_0xe1a935){if(_0x28b2a6['body']['id']){delete _0x28b2a6[_0xda84('0x4f')]['id'];}return db[_0xda84('0x2e')][_0xda84('0x4d')]({'where':{'id':_0x28b2a6[_0xda84('0x48')]['id']}})['then'](handleEntityNotFound(_0xe1a935,null))[_0xda84('0x16')](saveUpdates(_0x28b2a6[_0xda84('0x4f')],null))[_0xda84('0x16')](respondWithResult(_0xe1a935,null))[_0xda84('0x46')](handleError(_0xe1a935,null));};exports[_0xda84('0x29')]=function(_0x404ef7,_0x3da4c2){return db[_0xda84('0x2e')][_0xda84('0x4d')]({'where':{'id':_0x404ef7[_0xda84('0x48')]['id']}})[_0xda84('0x16')](handleEntityNotFound(_0x3da4c2,null))[_0xda84('0x16')](removeEntity(_0x3da4c2,null))[_0xda84('0x46')](handleError(_0x3da4c2,null));};exports[_0xda84('0x50')]=function(_0x4ddcb2,_0x314faa){return db[_0xda84('0x2e')]['describe']()[_0xda84('0x16')](respondWithResult(_0x314faa,null))[_0xda84('0x46')](handleError(_0x314faa,null));};exports['create']=function(_0x1b1297,_0x4046bb){return db[_0xda84('0x2e')]['create'](_0x1b1297['body'])[_0xda84('0x16')](function(_0x5d73a1){if(_0x5d73a1){if(_0x5d73a1[_0xda84('0x51')]===_0xda84('0x52')&&!_0x5d73a1[_0xda84('0x53')]){var _0x533051,_0x18d2d5,_0x582a19;if(_0x1b1297[_0xda84('0x4f')]['to']){_0x18d2d5=_0x1b1297[_0xda84('0x4f')]['to']['split'](',')[0x0];}return db[_0xda84('0x54')][_0xda84('0x55')]({'where':{'id':_0x5d73a1[_0xda84('0x56')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xda84('0x57')],'as':_0xda84('0x58'),'where':{'email':_0x18d2d5},'limit':0x1,'order':[[_0xda84('0x59'),'DESC']]}]},{'model':db[_0xda84('0x5a')],'as':_0xda84('0x5b'),'raw':!![],'include':[{'model':db[_0xda84('0x5c')],'as':_0xda84('0x5c'),'raw':!![]}]}]})['then'](function(_0x5ac3f6){_0x533051=_0x5ac3f6;if(!_0x533051||!_0x533051[_0xda84('0x5b')])return;var _0x1fa4e9=_0x533051['getSmtpOptions']();if(_0x1b1297[_0xda84('0x4f')]['attachments']&&_0x1b1297[_0xda84('0x4f')][_0xda84('0x5d')][_0xda84('0x39')]){for(var _0x792b5c=0x0;_0x792b5c<_0x1b1297[_0xda84('0x4f')][_0xda84('0x5d')][_0xda84('0x39')];_0x792b5c+=0x1){_0x1b1297[_0xda84('0x4f')]['attachments'][_0x792b5c]={'filename':_0x1b1297[_0xda84('0x4f')][_0xda84('0x5d')][_0x792b5c][_0xda84('0x34')],'path':path[_0xda84('0x5e')](config[_0xda84('0x5f')],_0xda84('0x60'),_0x1b1297['body']['attachments'][_0x792b5c][_0xda84('0x61')])};}}_0x582a19={'account':_0x1fa4e9,'message':_0x1b1297['body']};return;})[_0xda84('0x16')](function(){if(_0x533051[_0xda84('0x62')]){if(_0x533051['List']['Contacts'][_0xda84('0x39')]){return _0x533051[_0xda84('0x62')][_0xda84('0x58')][0x0];}else{return db['CmContact'][_0xda84('0x63')](_[_0xda84('0xd')](_0x1b1297['body'],{'firstName':_0x1b1297[_0xda84('0x4f')]['to'],'email':_0x1b1297[_0xda84('0x4f')]['to'],'phone':_0x1b1297['body']['to'],'ListId':_0x533051[_0xda84('0x64')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xda84('0x16')](function(){if(_0x582a19){return respondWithRpcPromise(_0xda84('0x65'),'sendMail',_0x582a19,client9003)[_0xda84('0x16')](function(_0x3db899){return _0x5d73a1[_0xda84('0x4e')]({'read':!![],'messageId':_0x3db899[_0xda84('0x66')],'sentAt':moment()[_0xda84('0x67')](_0xda84('0x68'))});})['catch'](function(_0x475aad){logger[_0xda84('0x1d')]('%s',JSON[_0xda84('0x1c')](_0x475aad));return _0x5d73a1;});}return _0x5d73a1;});}return _0x5d73a1;}})[_0xda84('0x16')](respondWithResult(_0x4046bb,0xc9))[_0xda84('0x46')](handleError(_0x4046bb,null));};exports[_0xda84('0x69')]=function(_0x1ce529,_0x3cef8a){var _0xa3d8a6={'agent':{},'channel':'mail'};if(_0x1ce529[_0xda84('0x4f')]['id']){delete _0x1ce529['body']['id'];}_0x1ce529[_0xda84('0x4f')]['read']=!![];_0x1ce529['body'][_0xda84('0x6a')]=moment()[_0xda84('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ce529[_0xda84('0x4f')][_0xda84('0x6b')]=_0x1ce529['body'][_0xda84('0x6b')]||_0x1ce529[_0xda84('0x6c')]['id'];_0xa3d8a6[_0xda84('0x6d')]['id']=_0x1ce529['body'][_0xda84('0x6b')];return db[_0xda84('0x2e')][_0xda84('0x4d')]({'where':{'id':_0x1ce529[_0xda84('0x48')]['id'],'UserId':null}})[_0xda84('0x16')](handleEntityNotFound(_0x3cef8a,null))[_0xda84('0x16')](saveUpdates(_0x1ce529['body'],null))[_0xda84('0x16')](function(_0x3f0951){if(_0x3f0951){_0xa3d8a6[_0xda84('0x1f')]=_0x3f0951[_0xda84('0x6e')]({'plain':!![]});return db[_0xda84('0x6f')][_0xda84('0x4d')]({'where':{'id':_0x3f0951['MailInteractionId']}});}return null;})[_0xda84('0x16')](handleEntityNotFound(_0x3cef8a,null))[_0xda84('0x16')](function(_0x16c83e){if(_0x16c83e){return _0x16c83e[_0xda84('0x4e')]({'UserId':_0x1ce529[_0xda84('0x4f')][_0xda84('0x6b')],'read1stAt':_[_0xda84('0x70')](_0x16c83e[_0xda84('0x71')])?moment()[_0xda84('0x67')](_0xda84('0x68')):undefined});}return null;})['then'](function(_0x18e016){if(_0x18e016){_0xa3d8a6[_0xda84('0x72')]=_0x18e016['get']({'plain':!![]});interaction_log[_0xda84('0x17')](_0xda84('0x73'),_0x1ce529[_0xda84('0x6c')]['id'],_0x1ce529[_0xda84('0x6c')][_0xda84('0x34')],_0x1ce529['user'][_0xda84('0x74')],_0xa3d8a6[_0xda84('0x72')]['id'],_0x1ce529[_0xda84('0x4f')]?JSON[_0xda84('0x1c')](_0x1ce529['body']):_0xda84('0x75'));return respondWithRpcPromise('AcceptMessage',_0xda84('0x76'),_0xa3d8a6);}return null;})[_0xda84('0x16')](function(_0x5dcb5c){var _0xa5b321=_0xda84('0x77')+_0x5dcb5c['message'][_0xda84('0x78')];return db[_0xda84('0x79')]['query'](_0xa5b321,{'type':db[_0xda84('0x7a')][_0xda84('0x7b')][_0xda84('0x7c')],'raw':!![]})['then'](function(_0x21b7a4){return _0x21b7a4;});})[_0xda84('0x16')](function(_0x47ec16){if(_0x47ec16){_0xa3d8a6['message'][_0xda84('0x7d')]=_0x47ec16[0x0];if(!_0x1ce529['body'][_0xda84('0x6b')])return;return db[_0xda84('0x7e')]['find']({'where':{'id':_0x1ce529[_0xda84('0x4f')]['UserId'],'role':_0xda84('0x6d')},'attributes':['id','name',_0xda84('0x7f'),_0xda84('0x80'),_0xda84('0x81')],'raw':!![]});}return null;})[_0xda84('0x16')](function(_0x11456c){if(!_0x11456c)return null;_0xa3d8a6[_0xda84('0x1f')][_0xda84('0x6d')]=_0x11456c;return _0xa3d8a6;})[_0xda84('0x16')](function(_0x2131e0){if(_0x2131e0){if(_0x1ce529['body'][_0xda84('0x82')]){_0xa3d8a6['message'][_0xda84('0x83')]=util[_0xda84('0x67')](_0xda84('0x84'),_0x1ce529[_0xda84('0x6c')][_0xda84('0x34')]);_0xa3d8a6[_0xda84('0x1f')][_0xda84('0x85')]=_0xa3d8a6[_0xda84('0x85')];_0xa3d8a6['message'][_0xda84('0x86')]=_0xa3d8a6[_0xda84('0x85')];_0xa3d8a6['message'][_0xda84('0x87')]=_0xda84('0x69');_0xa3d8a6['message'][_0xda84('0x4f')]=htmlToText[_0xda84('0x88')](_0xa3d8a6['message'][_0xda84('0x4f')]);return respondWithRpcPromise(_0xda84('0x89'),'EventManager',{'event':'acceptmessage','message':_0xa3d8a6[_0xda84('0x1f')]},client9002)[_0xda84('0x16')](function(){return _0xa3d8a6;});}return _0xa3d8a6;}return null;})['then'](respondWithResult(_0x3cef8a,null))['catch'](handleError(_0x3cef8a,null));};exports[_0xda84('0x8a')]=function(_0x332385,_0x16bb66){var _0x25778e={'agent':{},'channel':_0xda84('0x8b')};if(_0x332385[_0xda84('0x4f')]['id']){delete _0x332385[_0xda84('0x4f')]['id'];}_0x332385[_0xda84('0x4f')][_0xda84('0x6b')]=_0x332385[_0xda84('0x4f')][_0xda84('0x6b')]||_0x332385[_0xda84('0x6c')]['id'];_0x25778e[_0xda84('0x6d')]['id']=_0x332385[_0xda84('0x4f')][_0xda84('0x6b')];return db[_0xda84('0x2e')][_0xda84('0x4d')]({'where':{'id':_0x332385[_0xda84('0x48')]['id'],'UserId':null}})[_0xda84('0x16')](handleEntityNotFound(_0x16bb66,null))[_0xda84('0x16')](function(_0x149625){if(_0x149625){_0x25778e[_0xda84('0x1f')]=_0x149625[_0xda84('0x6e')]({'plain':!![]});return db['MailInteraction'][_0xda84('0x4d')]({'where':{'id':_0x149625[_0xda84('0x8c')]}});}return null;})['then'](handleEntityNotFound(_0x16bb66,null))[_0xda84('0x16')](function(_0x58d07a){if(_0x58d07a){_0x25778e[_0xda84('0x72')]=_0x58d07a['get']({'plain':!![]});interaction_log['info'](_0xda84('0x8d'),_0x332385[_0xda84('0x6c')]['id'],_0x332385['user'][_0xda84('0x34')],_0x332385[_0xda84('0x6c')][_0xda84('0x74')],_0x25778e[_0xda84('0x72')]['id'],_0x332385[_0xda84('0x4f')]?JSON[_0xda84('0x1c')](_0x332385[_0xda84('0x4f')]):_0xda84('0x75'));return respondWithRpcPromise(_0xda84('0x8e'),_0xda84('0x8f'),_0x25778e);}return null;})[_0xda84('0x16')](function(_0x752393){var _0x164223=_0xda84('0x77')+_0x752393['message']['ContactId'];return db['sequelize'][_0xda84('0x35')](_0x164223,{'type':db[_0xda84('0x7a')][_0xda84('0x7b')]['SELECT'],'raw':!![]})[_0xda84('0x16')](function(_0x9f5a0d){return _0x9f5a0d;});})[_0xda84('0x16')](function(_0x4b7c06){if(_0x4b7c06){_0x25778e['message']['contact']=_0x4b7c06[0x0];if(!_0x332385[_0xda84('0x4f')]['UserId'])return;return db[_0xda84('0x7e')]['find']({'where':{'id':_0x332385[_0xda84('0x4f')][_0xda84('0x6b')],'role':_0xda84('0x6d')},'attributes':['id',_0xda84('0x34'),_0xda84('0x7f'),_0xda84('0x80'),_0xda84('0x81')],'raw':!![]});}return null;})[_0xda84('0x16')](function(_0x3c7a5f){if(!_0x3c7a5f)return null;_0x25778e[_0xda84('0x1f')]['agent']=_0x3c7a5f;return _0x25778e;})[_0xda84('0x16')](function(_0x1dc29e){if(_0x1dc29e){_0x1dc29e[_0xda84('0x1f')][_0xda84('0x83')]=util[_0xda84('0x67')](_0xda84('0x84'),_0x332385[_0xda84('0x6c')][_0xda84('0x34')]);_0x1dc29e[_0xda84('0x1f')][_0xda84('0x85')]=_0x25778e[_0xda84('0x85')];_0x1dc29e['message'][_0xda84('0x86')]=_0x25778e[_0xda84('0x85')];_0x1dc29e[_0xda84('0x1f')][_0xda84('0x87')]=_0xda84('0x8a');_0x1dc29e[_0xda84('0x1f')][_0xda84('0x4f')]=htmlToText[_0xda84('0x88')](_0x25778e['message'][_0xda84('0x4f')]);respondWithRpcPromise(_0xda84('0x89'),_0xda84('0x89'),{'event':_0xda84('0x90'),'message':_0x1dc29e[_0xda84('0x1f')]},client9002);return _0x25778e;}return null;})[_0xda84('0x16')](respondWithResult(_0x16bb66,null))[_0xda84('0x46')](handleError(_0x16bb66,null));};exports['download']=function(_0x632934,_0x4394d5){var _0x1a79f4=moment()[_0xda84('0x91')]()[_0xda84('0x92')]();var _0x174d07=path[_0xda84('0x5e')](config[_0xda84('0x5f')],_0xda84('0x93'),'files',_0xda84('0x94'));var _0x22c8e5=path[_0xda84('0x5e')](config['root'],'server',_0xda84('0x95'),_0xda84('0x5d'));var _0x4d2e3f=util[_0xda84('0x67')]('message-%s.eml',_0x1a79f4);return db[_0xda84('0x2e')][_0xda84('0x4d')]({'where':{'id':_0x632934[_0xda84('0x48')]['id']},'attributes':['id',_0xda84('0x4f'),_0xda84('0x96'),'to','cc',_0xda84('0x97'),_0xda84('0x98'),_0xda84('0x99')],'include':_0x632934[_0xda84('0x35')][_0xda84('0x5d')]?[{'model':db[_0xda84('0x9a')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x4394d5,null))[_0xda84('0x16')](function(_0x174f4c){if(_0x174f4c){var _0x12e101=_0x174f4c;var _0x41cb70={'from':_0x12e101[_0xda84('0x96')],'to':_0x12e101['to'],'subject':_0x12e101[_0xda84('0x98')],'html':htmlEntities['decode'](_0x12e101[_0xda84('0x4f')]),'headers':{'Date':moment(_0x12e101[_0xda84('0x99')])[_0xda84('0x67')](_0xda84('0x9b'))},'attachments':[]};if(_0x174f4c['cc']){_0x41cb70[_0xda84('0x9c')]['Cc']=_0x174f4c['cc'];}if(_0x174f4c['bcc']){_0x41cb70['headers']['Bcc']=_0x174f4c[_0xda84('0x97')];}return new BPromise(function(_0x3c56a2,_0x168d82){if(_0x174f4c[_0xda84('0x9d')]){for(var _0x2d4f2a=0x0;_0x2d4f2a<_0x174f4c[_0xda84('0x9d')][_0xda84('0x39')];_0x2d4f2a++){var _0x70430b=_0x174f4c[_0xda84('0x9d')][_0x2d4f2a];var _0x238032=path['join'](_0x22c8e5,_0x70430b[_0xda84('0x61')]);if(fs['existsSync'](_0x238032)){_0x41cb70[_0xda84('0x5d')][_0xda84('0x9e')]({'name':_0x70430b[_0xda84('0x34')],'contentType':_0x70430b[_0xda84('0x31')],'data':fs[_0xda84('0x9f')](_0x238032)});}}}emlformat['build'](_0x41cb70,function(_0x9f2af1,_0x25b735){if(_0x9f2af1)return _0x168d82(_0x9f2af1);fs[_0xda84('0xa0')](path[_0xda84('0x5e')](_0x174d07,_0x4d2e3f),_0x25b735);return _0x3c56a2(_0x25b735);});});}})[_0xda84('0x16')](function(_0xf1946b){if(_0xf1946b){return _0x4394d5[_0xda84('0xa1')](path['join'](_0x174d07,_0x4d2e3f),_0x4d2e3f,function(_0x1356b1){if(!_0x1356b1)fs[_0xda84('0xa2')](path[_0xda84('0x5e')](_0x174d07,_0x4d2e3f));});}})[_0xda84('0x46')](handleError(_0x4394d5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bcfe98d..f9a089d 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 _0xc7ec=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x37ac4e,_0x3139f0){var _0x228486=function(_0x1bc945){while(--_0x1bc945){_0x37ac4e['push'](_0x37ac4e['shift']());}};_0x228486(++_0x3139f0);}(_0xc7ec,0xe7));var _0xcc7e=function(_0x1bc750,_0x23f442){_0x1bc750=_0x1bc750-0x0;var _0xcd51da=_0xc7ec[_0x1bc750];return _0xcd51da;};'use strict';var EventEmitter=require(_0xcc7e('0x0'));var MailMessage=require(_0xcc7e('0x1'))['db'][_0xcc7e('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xcc7e('0x3')](0x0);var events={'afterCreate':_0xcc7e('0x4'),'afterUpdate':_0xcc7e('0x5'),'afterDestroy':_0xcc7e('0x6')};function emitEvent(_0x11b34e){return function(_0x3c6905,_0x5657e6,_0x2c2cf2){MailMessageEvents[_0xcc7e('0x7')](_0x11b34e+':'+_0x3c6905['id'],_0x3c6905);MailMessageEvents[_0xcc7e('0x7')](_0x11b34e,_0x3c6905);_0x2c2cf2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xcc7e('0x8')](e,emitEvent(event));}}module[_0xcc7e('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x5e31=['hook','exports','events','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x1a5354,_0x31f17a){var _0x85504a=function(_0x2adf97){while(--_0x2adf97){_0x1a5354['push'](_0x1a5354['shift']());}};_0x85504a(++_0x31f17a);}(_0x5e31,0x1da));var _0x15e3=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0x5e31[_0x5341ff];return _0x53be58;};'use strict';var EventEmitter=require(_0x15e3('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x15e3('0x1')](0x0);var events={'afterCreate':_0x15e3('0x2'),'afterUpdate':'update','afterDestroy':_0x15e3('0x3')};function emitEvent(_0xf230b0){return function(_0x265c25,_0x39a9d9,_0x5d5cab){MailMessageEvents[_0x15e3('0x4')](_0xf230b0+':'+_0x265c25['id'],_0x265c25);MailMessageEvents[_0x15e3('0x4')](_0xf230b0,_0x265c25);_0x5d5cab(null);};}for(var e in events){if(events[_0x15e3('0x5')](e)){var event=events[e];MailMessage[_0x15e3('0x6')](e,emitEvent(event));}}module[_0x15e3('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index baea322..cb3e442 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 _0x75bb=['UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil'];(function(_0x15881f,_0x13877b){var _0x53a886=function(_0x2405a5){while(--_0x2405a5){_0x15881f['push'](_0x15881f['shift']());}};_0x53a886(++_0x13877b);}(_0x75bb,0xdd));var _0xb75b=function(_0x4a07d4,_0x25d95f){_0x4a07d4=_0x4a07d4-0x0;var _0x53ee8a=_0x75bb[_0x4a07d4];return _0x53ee8a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb75b('0x0'))(_0xb75b('0x1'));var moment=require(_0xb75b('0x2'));var BPromise=require(_0xb75b('0x3'));var rp=require('request-promise');var htmlToText=require(_0xb75b('0x4'));var fs=require('fs');var path=require(_0xb75b('0x5'));var rimraf=require(_0xb75b('0x6'));var config=require(_0xb75b('0x7'));var attributes=require(_0xb75b('0x8'));module[_0xb75b('0x9')]=function(_0xcd3cd4,_0x2536c4){return _0xcd3cd4[_0xb75b('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb75b('0xb')]},{'name':_0xb75b('0xc'),'fields':[_0xb75b('0xd'),_0xb75b('0xe')],'type':_0xb75b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x179fc2,_0x47fff0,_0x27907a){if(_0x179fc2[_0xb75b('0x10')]){_0x179fc2[_0xb75b('0xd')]=htmlToText[_0xb75b('0x11')](_0x179fc2[_0xb75b('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x27907a(null,_0x47fff0);},'afterCreate':function(_0x4a3989,_0x41153f,_0x5bb6a7){var _0x2528bd=_0xcd3cd4[_0xb75b('0x12')];var _0x5f3bc9=_0x4a3989[_0xb75b('0x13')]({'plain':!![]});if(_0x5f3bc9[_0xb75b('0x14')][_0xb75b('0x15')]()==='in'||_0x5f3bc9[_0xb75b('0x14')][_0xb75b('0x15')]()===_0xb75b('0x16')&&!_0x5f3bc9['secret']&&!_[_0xb75b('0x17')](_0x5f3bc9[_0xb75b('0x18')])){_0x2528bd[_0xb75b('0x19')][_0xb75b('0x1a')]({'where':{'id':_0x5f3bc9[_0xb75b('0x1b')]}})[_0xb75b('0x1c')](function(_0x4698ac){if(_0x4698ac){_0x4698ac[_0xb75b('0x1d')]({'lastMsgAt':_0x5f3bc9[_0xb75b('0x1e')],'lastMsgDirection':_0x5f3bc9[_0xb75b('0x14')]['toLowerCase']()});}})[_0xb75b('0x1f')](function(_0x341f2c){console[_0xb75b('0x20')](_0x341f2c);});}_0x5bb6a7();}},'charset':_0xb75b('0x21'),'collate':_0xb75b('0x22')});}; \ No newline at end of file +var _0x830a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','MailInteraction','findOne','then','update','createdAt','error','utf8mb4'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0x830a,0x1e1));var _0xa830=function(_0x1f6bd0,_0x164443){_0x1f6bd0=_0x1f6bd0-0x0;var _0x33e8d1=_0x830a[_0x1f6bd0];return _0x33e8d1;};'use strict';var _=require(_0xa830('0x0'));var util=require(_0xa830('0x1'));var logger=require(_0xa830('0x2'))(_0xa830('0x3'));var moment=require(_0xa830('0x4'));var BPromise=require(_0xa830('0x5'));var rp=require(_0xa830('0x6'));var htmlToText=require(_0xa830('0x7'));var fs=require('fs');var path=require(_0xa830('0x8'));var rimraf=require(_0xa830('0x9'));var config=require('../../config/environment');var attributes=require(_0xa830('0xa'));module[_0xa830('0xb')]=function(_0x53a4ad,_0xf8d485){return _0x53a4ad[_0xa830('0xc')](_0xa830('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xa830('0xe'),'subject'],'type':_0xa830('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4b94ee,_0x410349,_0x75a89a){if(_0x4b94ee[_0xa830('0x10')]){_0x4b94ee[_0xa830('0xe')]=htmlToText[_0xa830('0x11')](_0x4b94ee['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x75a89a(null,_0x410349);},'afterCreate':function(_0x19c917,_0x449082,_0x526673){var _0x25d3c9=_0x53a4ad[_0xa830('0x12')];var _0x116668=_0x19c917[_0xa830('0x13')]({'plain':!![]});if(_0x116668[_0xa830('0x14')]['toLowerCase']()==='in'||_0x116668['direction'][_0xa830('0x15')]()===_0xa830('0x16')&&!_0x116668['secret']&&!_[_0xa830('0x17')](_0x116668['UserId'])){_0x25d3c9[_0xa830('0x18')][_0xa830('0x19')]({'where':{'id':_0x116668['MailInteractionId']}})[_0xa830('0x1a')](function(_0x10e1c7){if(_0x10e1c7){_0x10e1c7[_0xa830('0x1b')]({'lastMsgAt':_0x116668[_0xa830('0x1c')],'lastMsgDirection':_0x116668['direction'][_0xa830('0x15')]()});}})['catch'](function(_0x3712a6){console[_0xa830('0x1d')](_0x3712a6);});}_0x526673();}},'charset':_0xa830('0x1e'),'collate':_0xa830('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 5b69856..4d8fd12 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 _0x9582=['client','http','redis','defaults','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44ac38,_0x34ca5a){var _0x54c8b5=function(_0x4c4e8d){while(--_0x4c4e8d){_0x44ac38['push'](_0x44ac38['shift']());}};_0x54c8b5(++_0x34ca5a);}(_0x9582,0x95));var _0x2958=function(_0x30f766,_0x3cf140){_0x30f766=_0x30f766-0x0;var _0x4867e4=_0x9582[_0x30f766];return _0x4867e4;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});config[_0x2958('0xd')]=_[_0x2958('0xe')](config[_0x2958('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2958('0xd')]));require('./mailMessage.socket')[_0x2958('0xf')](socket);function respondWithRpcPromise(_0x51e460,_0x44cccc,_0x5ef23c){return new BPromise(function(_0x3aacfa,_0x29776c){return client[_0x2958('0x10')](_0x51e460,_0x5ef23c)[_0x2958('0x11')](function(_0x11ec8d){logger['info'](_0x2958('0x12'),_0x44cccc,_0x2958('0x13'));logger[_0x2958('0x14')](_0x2958('0x15'),_0x44cccc,_0x2958('0x13'),JSON[_0x2958('0x16')](_0x11ec8d));if(_0x11ec8d[_0x2958('0x17')]){if(_0x11ec8d[_0x2958('0x17')]['code']===0x1f4){logger[_0x2958('0x17')](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x29776c(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}logger['error'](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x3aacfa(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x44cccc,_0x2958('0x13'));_0x3aacfa(_0x11ec8d[_0x2958('0x19')][_0x2958('0x18')]);}})[_0x2958('0x1a')](function(_0x27599c){logger['error'](_0x2958('0x12'),_0x44cccc,_0x27599c);_0x29776c(_0x27599c);});});}exports[_0x2958('0x1b')]=function(_0x1a12fa){var _0x57b6c5=this;return new Promise(function(_0x1e77eb,_0x53b100){return db[_0x2958('0x1c')]['create'](_0x1a12fa['body'],{'raw':_0x1a12fa[_0x2958('0x1d')]?_0x1a12fa[_0x2958('0x1d')][_0x2958('0x1e')]===undefined?!![]:![]:!![]})[_0x2958('0x11')](function(_0x2202f8){logger[_0x2958('0x1f')](_0x2958('0x1b'),_0x1a12fa);logger[_0x2958('0x14')](_0x2958('0x1b'),_0x1a12fa,JSON[_0x2958('0x16')](_0x2202f8));_0x1e77eb(_0x2202f8);})[_0x2958('0x1a')](function(_0xd58ae1){logger[_0x2958('0x17')](_0x2958('0x1b'),_0xd58ae1[_0x2958('0x18')],_0x1a12fa);_0x53b100(_0x57b6c5['error'](0x1f4,_0xd58ae1['message']));});});}; \ No newline at end of file +var _0x8952=['error','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','stringify','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8952,0x17e));var _0x2895=function(_0x510e99,_0x7cebde){_0x510e99=_0x510e99-0x0;var _0x54b6fa=_0x8952[_0x510e99];return _0x54b6fa;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}exports['CreateMailMessage']=function(_0x493851){var _0x442cfa=this;return new Promise(function(_0x12c2fb,_0x3ec4da){return db['MailMessage'][_0x2895('0x1a')](_0x493851[_0x2895('0x1b')],{'raw':_0x493851[_0x2895('0x1c')]?_0x493851[_0x2895('0x1c')][_0x2895('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x30c6c3){logger[_0x2895('0x10')]('CreateMailMessage',_0x493851);logger[_0x2895('0x12')](_0x2895('0x1e'),_0x493851,JSON[_0x2895('0x13')](_0x30c6c3));_0x12c2fb(_0x30c6c3);})['catch'](function(_0x4e884f){logger[_0x2895('0x15')](_0x2895('0x1e'),_0x4e884f[_0x2895('0x16')],_0x493851);_0x3ec4da(_0x442cfa['error'](0x1f4,_0x4e884f[_0x2895('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e7552c6..5435a15 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 _0x9cff=['save','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0x18bd6a,_0x16f14d){var _0x1957e2=function(_0x26ddec){while(--_0x26ddec){_0x18bd6a['push'](_0x18bd6a['shift']());}};_0x1957e2(++_0x16f14d);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x5701ba,_0x2fb60f){_0x5701ba=_0x5701ba-0x0;var _0x3f1567=_0x9cff[_0x5701ba];return _0x3f1567;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xf9cf('0x0'),_0xf9cf('0x1'),_0xf9cf('0x2')];function createListener(_0x55364a,_0x197da2){return function(_0x142fc6){_0x197da2[_0xf9cf('0x3')](_0x55364a,_0x142fc6);};}function removeListener(_0x5060e0,_0x2da91){return function(){MailMessageEvents[_0xf9cf('0x4')](_0x5060e0,_0x2da91);};}exports[_0xf9cf('0x5')]=function(_0x183113){for(var _0xcacbdc=0x0,_0x27e2b1=events[_0xf9cf('0x6')];_0xcacbdc<_0x27e2b1;_0xcacbdc++){var _0x19d7f9=events[_0xcacbdc];var _0x1c29f6=createListener(_0xf9cf('0x7')+_0x19d7f9,_0x183113);MailMessageEvents['on'](_0x19d7f9,_0x1c29f6);}}; \ No newline at end of file +var _0x9ac8=['./mailMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x2d030f,_0x5ca7b6){var _0x53fabd=function(_0x2159b2){while(--_0x2159b2){_0x2d030f['push'](_0x2d030f['shift']());}};_0x53fabd(++_0x5ca7b6);}(_0x9ac8,0x12d));var _0x89ac=function(_0x37cb79,_0x5aba0d){_0x37cb79=_0x37cb79-0x0;var _0x5cca18=_0x9ac8[_0x37cb79];return _0x5cca18;};'use strict';var MailMessageEvents=require(_0x89ac('0x0'));var events=['save',_0x89ac('0x1'),_0x89ac('0x2')];function createListener(_0x5d688b,_0x159f92){return function(_0x58e60f){_0x159f92[_0x89ac('0x3')](_0x5d688b,_0x58e60f);};}function removeListener(_0x37a194,_0x23cea6){return function(){MailMessageEvents[_0x89ac('0x4')](_0x37a194,_0x23cea6);};}exports[_0x89ac('0x5')]=function(_0x3b2e55){for(var _0x3efdb2=0x0,_0xa72062=events[_0x89ac('0x6')];_0x3efdb2<_0xa72062;_0x3efdb2++){var _0x2fb31e=events[_0x3efdb2];var _0x5ab509=createListener('mailMessage:'+_0x2fb31e,_0x3b2e55);MailMessageEvents['on'](_0x2fb31e,_0x5ab509);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 54eee8e..2cfe1aa 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 _0x5b27=['destroy','removeTeams','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','delete'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x5b27,0x1f0));var _0x75b2=function(_0x1acb50,_0x532124){_0x1acb50=_0x1acb50-0x0;var _0x470c18=_0x5b27[_0x1acb50];return _0x470c18;};'use strict';var multer=require(_0x75b2('0x0'));var util=require(_0x75b2('0x1'));var path=require(_0x75b2('0x2'));var timeout=require('connect-timeout');var express=require(_0x75b2('0x3'));var router=express[_0x75b2('0x4')]();var fs_extra=require(_0x75b2('0x5'));var auth=require(_0x75b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x75b2('0x7'));var controller=require(_0x75b2('0x8'));router[_0x75b2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75b2('0x9')](_0x75b2('0xa'),auth[_0x75b2('0xb')](),controller[_0x75b2('0xc')]);router[_0x75b2('0x9')](_0x75b2('0xd'),auth[_0x75b2('0xb')](),controller[_0x75b2('0xe')]);router[_0x75b2('0x9')](_0x75b2('0xf'),auth[_0x75b2('0xb')](),controller[_0x75b2('0x10')]);router[_0x75b2('0x9')](_0x75b2('0x11'),auth[_0x75b2('0xb')](),controller[_0x75b2('0x12')]);router[_0x75b2('0x9')](_0x75b2('0x13'),auth['isAuthenticated'](),controller[_0x75b2('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x75b2('0x15')]);router[_0x75b2('0x16')](_0x75b2('0x11'),auth['isAuthenticated'](),controller[_0x75b2('0x17')]);router[_0x75b2('0x16')]('/:id/users',auth[_0x75b2('0xb')](),controller['addAgents']);router[_0x75b2('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x75b2('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x75b2('0x1a')]);router[_0x75b2('0x19')](_0x75b2('0x11'),auth[_0x75b2('0xb')](),controller[_0x75b2('0x1b')]);router['delete'](_0x75b2('0x13'),auth['isAuthenticated'](),controller[_0x75b2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x8877=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','update','delete','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xf45d60,_0x1687dc){var _0x4c8873=function(_0x16b62e){while(--_0x16b62e){_0xf45d60['push'](_0xf45d60['shift']());}};_0x4c8873(++_0x1687dc);}(_0x8877,0x1e8));var _0x7887=function(_0x458cc9,_0x339c9c){_0x458cc9=_0x458cc9-0x0;var _0x2ed851=_0x8877[_0x458cc9];return _0x2ed851;};'use strict';var multer=require('multer');var util=require(_0x7887('0x0'));var path=require('path');var timeout=require(_0x7887('0x1'));var express=require(_0x7887('0x2'));var router=express[_0x7887('0x3')]();var fs_extra=require(_0x7887('0x4'));var auth=require(_0x7887('0x5'));var interaction=require(_0x7887('0x6'));var config=require(_0x7887('0x7'));var controller=require('./mailQueue.controller');router[_0x7887('0x8')]('/',auth[_0x7887('0x9')](),controller[_0x7887('0xa')]);router[_0x7887('0x8')](_0x7887('0xb'),auth[_0x7887('0x9')](),controller[_0x7887('0xc')]);router[_0x7887('0x8')](_0x7887('0xd'),auth[_0x7887('0x9')](),controller[_0x7887('0xe')]);router[_0x7887('0x8')](_0x7887('0xf'),auth[_0x7887('0x9')](),controller['getMembers']);router[_0x7887('0x8')](_0x7887('0x10'),auth[_0x7887('0x9')](),controller[_0x7887('0x11')]);router[_0x7887('0x8')](_0x7887('0x12'),auth['isAuthenticated'](),controller[_0x7887('0x13')]);router[_0x7887('0x14')]('/',auth[_0x7887('0x9')](),controller[_0x7887('0x15')]);router[_0x7887('0x14')](_0x7887('0x10'),auth[_0x7887('0x9')](),controller[_0x7887('0x16')]);router['post'](_0x7887('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x7887('0xd'),auth[_0x7887('0x9')](),controller[_0x7887('0x17')]);router[_0x7887('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7887('0x18')](_0x7887('0x10'),auth[_0x7887('0x9')](),controller['removeTeams']);router[_0x7887('0x18')](_0x7887('0x12'),auth['isAuthenticated'](),controller[_0x7887('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index e8fa61b..f64ffa4 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 _0x5e7f=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x48936c,_0x477494){var _0x27cf2a=function(_0x57731c){while(--_0x57731c){_0x48936c['push'](_0x48936c['shift']());}};_0x27cf2a(++_0x477494);}(_0x5e7f,0x78));var _0xf5e7=function(_0x19db71,_0x528dec){_0x19db71=_0x19db71-0x0;var _0xc71bae=_0x5e7f[_0x19db71];return _0xc71bae;};'use strict';var Sequelize=require(_0xf5e7('0x0'));module[_0xf5e7('0x1')]={'name':{'type':Sequelize[_0xf5e7('0x2')],'unique':_0xf5e7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf5e7('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf5e7('0x4')](_0xf5e7('0x5'),_0xf5e7('0x6'),_0xf5e7('0x7'))}}; \ No newline at end of file +var _0x7a71=['roundrobin','sequelize','STRING','INTEGER'];(function(_0x2ac25e,_0x564c19){var _0x11ba31=function(_0x293c0d){while(--_0x293c0d){_0x2ac25e['push'](_0x2ac25e['shift']());}};_0x11ba31(++_0x564c19);}(_0x7a71,0x6d));var _0x17a7=function(_0xb99305,_0x1bc9d1){_0xb99305=_0xb99305-0x0;var _0x3cb356=_0x7a71[_0xb99305];return _0x3cb356;};'use strict';var Sequelize=require(_0x17a7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x17a7('0x1')]},'timeout':{'type':Sequelize[_0x17a7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x17a7('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 7b29188..395364b 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 _0xff30=['destroy','then','get','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','MailQueue','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','UserMailQueue','hasOwnProperty','MailQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','User','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/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xff30,0x104));var _0x0ff3=function(_0x135d93,_0x3552e3){_0x135d93=_0x135d93-0x0;var _0x1fbde5=_0xff30[_0x135d93];return _0x1fbde5;};'use strict';var emlformat=require(_0x0ff3('0x0'));var rimraf=require(_0x0ff3('0x1'));var zipdir=require(_0x0ff3('0x2'));var jsonpatch=require(_0x0ff3('0x3'));var rp=require(_0x0ff3('0x4'));var moment=require(_0x0ff3('0x5'));var BPromise=require(_0x0ff3('0x6'));var Mustache=require(_0x0ff3('0x7'));var util=require(_0x0ff3('0x8'));var path=require(_0x0ff3('0x9'));var sox=require(_0x0ff3('0xa'));var csv=require(_0x0ff3('0xb'));var ejs=require(_0x0ff3('0xc'));var fs=require('fs');var fs_extra=require(_0x0ff3('0xd'));var _=require(_0x0ff3('0xe'));var squel=require(_0x0ff3('0xf'));var crypto=require(_0x0ff3('0x10'));var jsforce=require(_0x0ff3('0x11'));var deskjs=require(_0x0ff3('0x12'));var toCsv=require('to-csv');var querystring=require(_0x0ff3('0x13'));var Papa=require(_0x0ff3('0x14'));var Redis=require(_0x0ff3('0x15'));var authService=require(_0x0ff3('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x0ff3('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ff3('0x18'))(_0x0ff3('0x19'));var utils=require(_0x0ff3('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0ff3('0x1b'))['db'];config[_0x0ff3('0x1c')]=_[_0x0ff3('0x1d')](config[_0x0ff3('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ff3('0x1e'))(new Redis(config[_0x0ff3('0x1c')]));require('./mailQueue.socket')[_0x0ff3('0x1f')](socket);function respondWithStatusCode(_0x142012,_0x96a3e1){_0x96a3e1=_0x96a3e1||0xcc;return function(_0x4b828d){if(_0x4b828d){return _0x142012[_0x0ff3('0x20')](_0x96a3e1);}return _0x142012[_0x0ff3('0x21')](_0x96a3e1)['end']();};}function respondWithResult(_0x25b6b4,_0x47b25b){_0x47b25b=_0x47b25b||0xc8;return function(_0x5b7021){if(_0x5b7021){return _0x25b6b4[_0x0ff3('0x21')](_0x47b25b)[_0x0ff3('0x22')](_0x5b7021);}};}function respondWithFilteredResult(_0x243351,_0x54294f){return function(_0x30307a){if(_0x30307a){var _0x21a357=typeof _0x54294f[_0x0ff3('0x23')]===_0x0ff3('0x24')&&typeof _0x54294f[_0x0ff3('0x25')]==='undefined';var _0x5cb310=_0x30307a[_0x0ff3('0x26')];var _0x25e25c=_0x21a357?0x0:_0x54294f['offset'];var _0x5c9125=_0x21a357?_0x30307a['count']:_0x54294f[_0x0ff3('0x23')]+_0x54294f[_0x0ff3('0x25')];var _0x2e2ee9;if(_0x5c9125>=_0x5cb310){_0x5c9125=_0x5cb310;_0x2e2ee9=0xc8;}else{_0x2e2ee9=0xce;}_0x243351[_0x0ff3('0x21')](_0x2e2ee9);return _0x243351[_0x0ff3('0x27')](_0x0ff3('0x28'),_0x25e25c+'-'+_0x5c9125+'/'+_0x5cb310)[_0x0ff3('0x22')](_0x30307a);}return null;};}function patchUpdates(_0x3649a6){return function(_0x5ce2f4){try{jsonpatch[_0x0ff3('0x29')](_0x5ce2f4,_0x3649a6,!![]);}catch(_0xfcf74a){return BPromise[_0x0ff3('0x2a')](_0xfcf74a);}return _0x5ce2f4[_0x0ff3('0x2b')]();};}function saveUpdates(_0x53b0b3,_0x12f2bd){return function(_0x5c4c14){if(_0x5c4c14){return _0x5c4c14['update'](_0x53b0b3)['then'](function(_0x4def7b){return _0x4def7b;});}return null;};}function removeEntity(_0x162f0e,_0x7969bc){return function(_0x53007e){if(_0x53007e){return _0x53007e[_0x0ff3('0x2c')]()[_0x0ff3('0x2d')](function(){var _0x151819=_0x53007e[_0x0ff3('0x2e')]({'plain':!![]});var _0x4a7dab=_0x0ff3('0x2f');return db[_0x0ff3('0x30')][_0x0ff3('0x2c')]({'where':{'type':_0x4a7dab,'resourceId':_0x151819['id']}})[_0x0ff3('0x2d')](function(){return _0x53007e;});})['then'](function(){_0x162f0e[_0x0ff3('0x21')](0xcc)[_0x0ff3('0x31')]();});}};}function handleEntityNotFound(_0x5bc412,_0x118ae6){return function(_0x2a3115){if(!_0x2a3115){_0x5bc412['sendStatus'](0x194);}return _0x2a3115;};}function handleError(_0x197ac8,_0x42cda6){_0x42cda6=_0x42cda6||0x1f4;return function(_0x240162){logger[_0x0ff3('0x32')](_0x240162[_0x0ff3('0x33')]);if(_0x240162[_0x0ff3('0x34')]){delete _0x240162[_0x0ff3('0x34')];}_0x197ac8[_0x0ff3('0x21')](_0x42cda6)[_0x0ff3('0x35')](_0x240162);};}exports[_0x0ff3('0x36')]=function(_0x4bc1b5,_0x7e8698){var _0x4fdd9a={},_0x422b09={},_0x26ecac={'count':0x0,'rows':[]};var _0xca7746=_[_0x0ff3('0x37')](db['MailQueue'][_0x0ff3('0x38')],function(_0x49baff){return{'name':_0x49baff[_0x0ff3('0x39')],'type':_0x49baff[_0x0ff3('0x3a')][_0x0ff3('0x3b')]};});_0x422b09[_0x0ff3('0x3c')]=_[_0x0ff3('0x37')](_0xca7746,_0x0ff3('0x34'));_0x422b09[_0x0ff3('0x3d')]=_[_0x0ff3('0x3e')](_0x4bc1b5[_0x0ff3('0x3d')]);_0x422b09['filters']=_[_0x0ff3('0x3f')](_0x422b09[_0x0ff3('0x3c')],_0x422b09[_0x0ff3('0x3d')]);_0x4fdd9a[_0x0ff3('0x40')]=_[_0x0ff3('0x3f')](_0x422b09[_0x0ff3('0x3c')],qs[_0x0ff3('0x41')](_0x4bc1b5[_0x0ff3('0x3d')][_0x0ff3('0x41')]));_0x4fdd9a[_0x0ff3('0x40')]=_0x4fdd9a[_0x0ff3('0x40')][_0x0ff3('0x42')]?_0x4fdd9a[_0x0ff3('0x40')]:_0x422b09['model'];if(!_0x4bc1b5['query']['hasOwnProperty']('nolimit')){_0x4fdd9a[_0x0ff3('0x25')]=qs[_0x0ff3('0x25')](_0x4bc1b5[_0x0ff3('0x3d')][_0x0ff3('0x25')]);_0x4fdd9a[_0x0ff3('0x23')]=qs[_0x0ff3('0x23')](_0x4bc1b5['query'][_0x0ff3('0x23')]);}_0x4fdd9a[_0x0ff3('0x43')]=qs[_0x0ff3('0x44')](_0x4bc1b5[_0x0ff3('0x3d')][_0x0ff3('0x44')]);_0x4fdd9a[_0x0ff3('0x45')]=qs[_0x0ff3('0x46')](_[_0x0ff3('0x47')](_0x4bc1b5[_0x0ff3('0x3d')],_0x422b09[_0x0ff3('0x46')]),_0xca7746);if(_0x4bc1b5['query'][_0x0ff3('0x48')]){_0x4fdd9a[_0x0ff3('0x45')]=_[_0x0ff3('0x49')](_0x4fdd9a[_0x0ff3('0x45')],{'$or':_[_0x0ff3('0x37')](_0xca7746,function(_0x57ed2e){if(_0x57ed2e['type']!==_0x0ff3('0x4a')){var _0x200b2d={};_0x200b2d[_0x57ed2e[_0x0ff3('0x34')]]={'$like':'%'+_0x4bc1b5['query'][_0x0ff3('0x48')]+'%'};return _0x200b2d;}})});}_0x4fdd9a=_[_0x0ff3('0x49')]({},_0x4fdd9a,_0x4bc1b5['options']);var _0x42aff6={'where':_0x4fdd9a[_0x0ff3('0x45')]};return db[_0x0ff3('0x4b')]['count'](_0x42aff6)[_0x0ff3('0x2d')](function(_0x57a608){_0x26ecac[_0x0ff3('0x26')]=_0x57a608;if(_0x4bc1b5[_0x0ff3('0x3d')]['includeAll']){_0x4fdd9a[_0x0ff3('0x4c')]=[{'all':!![]}];}return db['MailQueue'][_0x0ff3('0x4d')](_0x4fdd9a);})[_0x0ff3('0x2d')](function(_0xd6fba8){_0x26ecac[_0x0ff3('0x4e')]=_0xd6fba8;return _0x26ecac;})[_0x0ff3('0x2d')](respondWithFilteredResult(_0x7e8698,_0x4fdd9a))[_0x0ff3('0x4f')](handleError(_0x7e8698,null));};exports[_0x0ff3('0x50')]=function(_0x3ad6ff,_0x54f369){var _0x1f6fbb={'raw':!![],'where':{'id':_0x3ad6ff[_0x0ff3('0x51')]['id']}},_0x25ad47={};_0x25ad47['model']=_[_0x0ff3('0x3e')](db['MailQueue']['rawAttributes']);_0x25ad47[_0x0ff3('0x3d')]=_[_0x0ff3('0x3e')](_0x3ad6ff[_0x0ff3('0x3d')]);_0x25ad47[_0x0ff3('0x46')]=_[_0x0ff3('0x3f')](_0x25ad47['model'],_0x25ad47['query']);_0x1f6fbb[_0x0ff3('0x40')]=_[_0x0ff3('0x3f')](_0x25ad47[_0x0ff3('0x3c')],qs['fields'](_0x3ad6ff['query'][_0x0ff3('0x41')]));_0x1f6fbb['attributes']=_0x1f6fbb[_0x0ff3('0x40')][_0x0ff3('0x42')]?_0x1f6fbb[_0x0ff3('0x40')]:_0x25ad47[_0x0ff3('0x3c')];if(_0x3ad6ff['query'][_0x0ff3('0x52')]){_0x1f6fbb['include']=[{'all':!![]}];}_0x1f6fbb=_[_0x0ff3('0x49')]({},_0x1f6fbb,_0x3ad6ff[_0x0ff3('0x53')]);return db[_0x0ff3('0x4b')][_0x0ff3('0x54')](_0x1f6fbb)[_0x0ff3('0x2d')](handleEntityNotFound(_0x54f369,null))[_0x0ff3('0x2d')](respondWithResult(_0x54f369,null))[_0x0ff3('0x4f')](handleError(_0x54f369,null));};exports[_0x0ff3('0x55')]=function(_0x511145,_0x459687){return db['MailQueue'][_0x0ff3('0x55')](_0x511145[_0x0ff3('0x56')],{})['then'](function(_0x5b21b0){var _0x5876f0=_0x511145['user'][_0x0ff3('0x2e')]({'plain':!![]});if(!_0x5876f0)throw new Error(_0x0ff3('0x57'));if(_0x5876f0[_0x0ff3('0x58')]==='user'){var _0x4550fc=_0x5b21b0[_0x0ff3('0x2e')]({'plain':!![]});var _0x131d9e=_0x0ff3('0x2f');return db[_0x0ff3('0x59')][_0x0ff3('0x54')]({'where':{'name':_0x131d9e,'userProfileId':_0x5876f0[_0x0ff3('0x5a')]},'raw':!![]})[_0x0ff3('0x2d')](function(_0x3bc12b){if(_0x3bc12b&&_0x3bc12b[_0x0ff3('0x5b')]===0x0){return db['UserProfileResource'][_0x0ff3('0x55')]({'name':_0x4550fc[_0x0ff3('0x34')],'resourceId':_0x4550fc['id'],'type':_0x3bc12b['name'],'sectionId':_0x3bc12b['id']},{})[_0x0ff3('0x2d')](function(){return _0x5b21b0;});}else{return _0x5b21b0;}})[_0x0ff3('0x4f')](function(_0x38488f){logger['error'](_0x0ff3('0x5c'),_0x38488f);throw _0x38488f;});}return _0x5b21b0;})[_0x0ff3('0x2d')](respondWithResult(_0x459687,0xc9))[_0x0ff3('0x4f')](handleError(_0x459687,null));};exports[_0x0ff3('0x5d')]=function(_0xfd024d,_0x41432f){if(_0xfd024d[_0x0ff3('0x56')]['id']){delete _0xfd024d[_0x0ff3('0x56')]['id'];}return db[_0x0ff3('0x4b')][_0x0ff3('0x54')]({'where':{'id':_0xfd024d[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](handleEntityNotFound(_0x41432f,null))[_0x0ff3('0x2d')](saveUpdates(_0xfd024d[_0x0ff3('0x56')],null))['then'](respondWithResult(_0x41432f,null))['catch'](handleError(_0x41432f,null));};exports[_0x0ff3('0x2c')]=function(_0x3a3f07,_0x535742){return db['MailQueue'][_0x0ff3('0x54')]({'where':{'id':_0x3a3f07[_0x0ff3('0x51')]['id']}})['then'](handleEntityNotFound(_0x535742,null))[_0x0ff3('0x2d')](removeEntity(_0x535742,null))[_0x0ff3('0x4f')](handleError(_0x535742,null));};exports[_0x0ff3('0x5e')]=function(_0x5d9bb3,_0x596027){return db[_0x0ff3('0x4b')][_0x0ff3('0x5e')]()[_0x0ff3('0x2d')](respondWithResult(_0x596027,null))[_0x0ff3('0x4f')](handleError(_0x596027,null));};exports['getMembers']=function(_0x20c1cc,_0x46c1f8,_0x25e46d){var _0x18f3bf={'raw':!![],'where':{}},_0x4acf56={},_0x4c1b0d;return db['MailQueue']['findOne']({'where':{'id':_0x20c1cc[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](handleEntityNotFound(_0x46c1f8,null))[_0x0ff3('0x2d')](function(_0x29ae63){if(_0x29ae63){_0x4c1b0d=_0x29ae63[_0x0ff3('0x2e')]({'plain':!![]});_0x4acf56['model']=_['keys'](db[_0x0ff3('0x5f')][_0x0ff3('0x38')]);_0x4acf56[_0x0ff3('0x3d')]=_['keys'](_0x20c1cc['query']);_0x4acf56[_0x0ff3('0x46')]=_['intersection'](_0x4acf56[_0x0ff3('0x3c')],_0x4acf56[_0x0ff3('0x3d')]);_0x18f3bf[_0x0ff3('0x40')]=_['intersection'](_0x4acf56[_0x0ff3('0x3c')],qs[_0x0ff3('0x41')](_0x20c1cc[_0x0ff3('0x3d')]['fields']));_0x18f3bf[_0x0ff3('0x40')]=_0x18f3bf[_0x0ff3('0x40')]['length']?_0x18f3bf['attributes']:_0x4acf56[_0x0ff3('0x3c')];if(!_0x20c1cc[_0x0ff3('0x3d')][_0x0ff3('0x60')]('nolimit')){_0x18f3bf['limit']=qs[_0x0ff3('0x25')](_0x20c1cc[_0x0ff3('0x3d')][_0x0ff3('0x25')]);_0x18f3bf[_0x0ff3('0x23')]=qs[_0x0ff3('0x23')](_0x20c1cc['query'][_0x0ff3('0x23')]);}_0x18f3bf[_0x0ff3('0x43')]=qs['sort'](_0x20c1cc['query'][_0x0ff3('0x44')]);_0x18f3bf['where']=qs['filters'](_[_0x0ff3('0x47')](_0x20c1cc['query'],_0x4acf56[_0x0ff3('0x46')]));_0x18f3bf[_0x0ff3('0x45')][_0x0ff3('0x61')]=_0x29ae63['id'];if(_0x20c1cc[_0x0ff3('0x3d')][_0x0ff3('0x48')]){_0x18f3bf[_0x0ff3('0x45')]=_[_0x0ff3('0x49')](_0x18f3bf['where'],{'$or':_['map'](_0x18f3bf[_0x0ff3('0x40')],function(_0x983119){var _0x1692a5={};_0x1692a5[_0x983119]={'$like':'%'+_0x20c1cc[_0x0ff3('0x3d')]['filter']+'%'};return _0x1692a5;})});}_0x18f3bf=_[_0x0ff3('0x49')]({},_0x18f3bf,_0x20c1cc[_0x0ff3('0x53')]);return db['UserMailQueue'][_0x0ff3('0x4d')](_0x18f3bf);}})[_0x0ff3('0x2d')](function(_0x6dd22b){if(_0x6dd22b){return db['User'][_0x0ff3('0x62')]({'where':{'id':_[_0x0ff3('0x37')](_0x6dd22b,_0x0ff3('0x63')),'role':_0x0ff3('0x64')},'attributes':['id',_0x0ff3('0x34'),'mailPause',_0x0ff3('0x65'),_0x0ff3('0x66')]});}})[_0x0ff3('0x2d')](function(_0x2834d4){if(_0x2834d4){return{'count':_0x2834d4[_0x0ff3('0x26')],'rows':_[_0x0ff3('0x37')](_0x2834d4[_0x0ff3('0x4e')],function(_0x54833b){return{'membername':_0x54833b[_0x0ff3('0x34')],'UserId':_0x54833b['id'],'queue_name':_0x4c1b0d[_0x0ff3('0x34')],'MailQueueId':_0x4c1b0d['id'],'interface':util[_0x0ff3('0x67')](_0x0ff3('0x68'),_0x0ff3('0x69'),_0x54833b[_0x0ff3('0x34')]),'penalty':0x0,'paused':_0x54833b['mailPause'],'createdAt':_0x54833b['createdAt'],'updatedAt':_0x54833b[_0x0ff3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x46c1f8,_0x18f3bf))[_0x0ff3('0x4f')](handleError(_0x46c1f8,null));};exports[_0x0ff3('0x6a')]=function(_0x6e4e7b,_0x1ad45c,_0x38e7bc){var _0x5f50e1={};var _0x39327c={};var _0x37218a;var _0x1052d8;return db['MailQueue'][_0x0ff3('0x6b')]({'where':{'id':_0x6e4e7b[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](handleEntityNotFound(_0x1ad45c,null))[_0x0ff3('0x2d')](function(_0x5252fe){if(_0x5252fe){_0x37218a=_0x5252fe;_0x39327c[_0x0ff3('0x3c')]=_[_0x0ff3('0x3e')](db[_0x0ff3('0x6c')][_0x0ff3('0x38')]);_0x39327c[_0x0ff3('0x3d')]=_['keys'](_0x6e4e7b[_0x0ff3('0x3d')]);_0x39327c['filters']=_[_0x0ff3('0x3f')](_0x39327c[_0x0ff3('0x3c')],_0x39327c[_0x0ff3('0x3d')]);_0x5f50e1[_0x0ff3('0x40')]=_[_0x0ff3('0x3f')](_0x39327c[_0x0ff3('0x3c')],qs[_0x0ff3('0x41')](_0x6e4e7b[_0x0ff3('0x3d')][_0x0ff3('0x41')]));_0x5f50e1[_0x0ff3('0x40')]=_0x5f50e1['attributes'][_0x0ff3('0x42')]?_0x5f50e1[_0x0ff3('0x40')]:_0x39327c[_0x0ff3('0x3c')];_0x5f50e1[_0x0ff3('0x43')]=qs[_0x0ff3('0x44')](_0x6e4e7b[_0x0ff3('0x3d')][_0x0ff3('0x44')]);_0x5f50e1[_0x0ff3('0x45')]=qs[_0x0ff3('0x46')](_[_0x0ff3('0x47')](_0x6e4e7b['query'],_0x39327c[_0x0ff3('0x46')]));if(_0x6e4e7b[_0x0ff3('0x3d')]['filter']){_0x5f50e1[_0x0ff3('0x45')]=_[_0x0ff3('0x49')](_0x5f50e1[_0x0ff3('0x45')],{'$or':_[_0x0ff3('0x37')](_0x5f50e1['attributes'],function(_0x261fb8){var _0x284834={};_0x284834[_0x261fb8]={'$like':'%'+_0x6e4e7b['query'][_0x0ff3('0x48')]+'%'};return _0x284834;})});}_0x5f50e1=_[_0x0ff3('0x49')]({},_0x5f50e1,_0x6e4e7b[_0x0ff3('0x53')]);return _0x37218a[_0x0ff3('0x6a')](_0x5f50e1);}})['then'](function(_0x3b257){if(_0x3b257){_0x1052d8=_0x3b257['length'];if(!_0x6e4e7b[_0x0ff3('0x3d')]['hasOwnProperty'](_0x0ff3('0x6d'))){_0x5f50e1[_0x0ff3('0x25')]=qs[_0x0ff3('0x25')](_0x6e4e7b[_0x0ff3('0x3d')]['limit']);_0x5f50e1[_0x0ff3('0x23')]=qs['offset'](_0x6e4e7b[_0x0ff3('0x3d')][_0x0ff3('0x23')]);}return _0x37218a[_0x0ff3('0x6a')](_0x5f50e1);}})[_0x0ff3('0x2d')](function(_0x2582f0){if(_0x2582f0){return _0x2582f0?{'count':_0x1052d8,'rows':_0x2582f0}:null;}})['then'](respondWithResult(_0x1ad45c,null))[_0x0ff3('0x4f')](handleError(_0x1ad45c,null));};exports[_0x0ff3('0x6e')]=function(_0x32acc4,_0x156631,_0x511cd6){var _0x111549=_0x32acc4[_0x0ff3('0x56')][_0x0ff3('0x6f')];return db[_0x0ff3('0x6c')]['findAll']({'where':{'id':_0x111549},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ff3('0x70'),'attributes':['id',_0x0ff3('0x34'),_0x0ff3('0x71'),_0x0ff3('0x72'),_0x0ff3('0x73')],'raw':!![]}]})[_0x0ff3('0x2d')](function(_0x442a5b){if(_0x442a5b){var _0x5cef09=_['flatMap'](_0x442a5b,function(_0x417eb0){var _0x56fe2e=_0x417eb0[_0x0ff3('0x2e')]({'plain':!![]});return _0x56fe2e[_0x0ff3('0x70')];});return db[_0x0ff3('0x4b')][_0x0ff3('0x54')]({'where':{'id':_0x32acc4[_0x0ff3('0x51')]['id']}})['then'](function(_0x1676e8){return db[_0x0ff3('0x74')][_0x0ff3('0x75')](function(_0xa1e10b){return _0x1676e8[_0x0ff3('0x6e')](_0x111549,{'transaction':_0xa1e10b})['then'](function(){return BPromise[_0x0ff3('0x76')](_0x5cef09,function(_0x3a6aa7){return db[_0x0ff3('0x5f')][_0x0ff3('0x77')]({'where':{'UserId':_0x3a6aa7['id'],'MailQueueId':_0x32acc4[_0x0ff3('0x51')]['id']},'transaction':_0xa1e10b});});})[_0x0ff3('0x2d')](function(){_0x5cef09[_0x0ff3('0x78')](function(_0x1d9b3f){socket[_0x0ff3('0x79')](_0x0ff3('0x7a'),{'UserId':_0x1d9b3f['id'],'MailQueueId':_0x1676e8['id']});});});});});}})[_0x0ff3('0x2d')](respondWithStatusCode(_0x156631,null))[_0x0ff3('0x4f')](handleError(_0x156631,null));};exports[_0x0ff3('0x7b')]=function(_0x5c6dfb,_0x5eb5bd,_0xc286e7){return db[_0x0ff3('0x6c')]['findAll']({'where':{'id':_0x5c6dfb[_0x0ff3('0x3d')][_0x0ff3('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ff3('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5eb5bd,null))['then'](function(_0x31d407){var _0x2490cf=_[_0x0ff3('0x37')](_0x31d407,'id');var _0x43e25c=[];var _0x105b53=[];var _0x55e367=squel[_0x0ff3('0x7c')]();_0x55e367['field'](_0x0ff3('0x7d'))[_0x0ff3('0x7e')](_0x0ff3('0x7f'),'tq')['join'](_0x0ff3('0x80'),'ut',_0x0ff3('0x81'))[_0x0ff3('0x45')](_0x0ff3('0x82'),_0x5c6dfb[_0x0ff3('0x51')]['id']);for(var _0xd0cdf1=0x0;_0xd0cdf1<_0x31d407[_0x0ff3('0x42')];_0xd0cdf1+=0x1){let _0xbe094=_0x31d407[_0xd0cdf1];for(var _0x41da80=0x0;_0x41da80<_0xbe094[_0x0ff3('0x70')][_0x0ff3('0x42')];_0x41da80+=0x1){let _0x3cd1bb=_0xbe094[_0x0ff3('0x70')][_0x41da80];var _0x2f0671=_0x55e367['clone']();_0x2f0671[_0x0ff3('0x45')](_0x0ff3('0x83'),_0x3cd1bb['id']);_0x105b53[_0x0ff3('0x84')](db[_0x0ff3('0x74')]['query'](_0x2f0671[_0x0ff3('0x85')](),{'type':db['sequelize'][_0x0ff3('0x86')][_0x0ff3('0x87')]})[_0x0ff3('0x2d')](function(_0x13a8dc){if(_0x13a8dc[_0x0ff3('0x42')]===0x1){return _0x3cd1bb['id'];}else{var _0x2add4e=_[_0x0ff3('0x88')](_[_0x0ff3('0x37')](_0x13a8dc,_0x0ff3('0x89')),function(_0x27f2ac){return _[_0x0ff3('0x8a')](_0x2490cf,_0x27f2ac);});if(_0x2add4e){return _0x3cd1bb['id'];}}}));}}return BPromise[_0x0ff3('0x8b')](_0x105b53)[_0x0ff3('0x2d')](function(_0x3c444e){_0x43e25c=_(_0x43e25c)[_0x0ff3('0x8c')](_0x3c444e)[_0x0ff3('0x8d')]()[_0x0ff3('0x8e')]();return db[_0x0ff3('0x4b')][_0x0ff3('0x54')]({'where':{'id':_0x5c6dfb[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](function(_0x41660f){return db['sequelize'][_0x0ff3('0x75')](function(_0x1736c4){return _0x41660f[_0x0ff3('0x7b')](_0x5c6dfb[_0x0ff3('0x3d')][_0x0ff3('0x6f')],{'transaction':_0x1736c4})['then'](function(){if(!_[_0x0ff3('0x8f')](_0x43e25c)){return _0x41660f[_0x0ff3('0x90')](_0x43e25c,{'transaction':_0x1736c4});}})[_0x0ff3('0x2d')](function(){_0x43e25c['forEach'](function(_0x40e82d){socket['emit']('userMailQueue:remove',{'UserId':_0x40e82d,'MailQueueId':_0x41660f['id']});});});});});});})[_0x0ff3('0x2d')](respondWithStatusCode(_0x5eb5bd,null))[_0x0ff3('0x4f')](handleError(_0x5eb5bd,null));};exports[_0x0ff3('0x91')]=function(_0x9cd7f8,_0x586b2e,_0x441b65){return db[_0x0ff3('0x4b')][_0x0ff3('0x54')]({'where':{'id':_0x9cd7f8[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](handleEntityNotFound(_0x586b2e,null))['then'](function(_0x1acd55){if(_0x1acd55){return _0x1acd55['addAgents'](_0x9cd7f8['body'][_0x0ff3('0x6f')],_[_0x0ff3('0x92')](_0x9cd7f8[_0x0ff3('0x56')],[_0x0ff3('0x6f'),'id'])||{})[_0x0ff3('0x93')](function(_0x2ed6c5){for(var _0x4adaa8=0x0;_0x4adaa8<_0x9cd7f8[_0x0ff3('0x56')]['ids']['length'];_0x4adaa8+=0x1){socket[_0x0ff3('0x79')]('userMailQueue:save',{'UserId':Number(_0x9cd7f8['body'][_0x0ff3('0x6f')][_0x4adaa8]),'MailQueueId':Number(_0x9cd7f8[_0x0ff3('0x51')]['id'])});}return _0x2ed6c5;});}})[_0x0ff3('0x2d')](respondWithResult(_0x586b2e,null))[_0x0ff3('0x4f')](handleError(_0x586b2e,null));};exports['removeAgents']=function(_0x1ce3fe,_0x4930ea,_0x401c4e){return db[_0x0ff3('0x4b')][_0x0ff3('0x54')]({'where':{'id':_0x1ce3fe[_0x0ff3('0x51')]['id']}})['then'](handleEntityNotFound(_0x4930ea,null))[_0x0ff3('0x2d')](function(_0x2b3705){if(_0x2b3705){return _0x2b3705[_0x0ff3('0x90')](_0x1ce3fe[_0x0ff3('0x3d')]['ids'])[_0x0ff3('0x2d')](function(){if(_[_0x0ff3('0x94')](_0x1ce3fe['query'][_0x0ff3('0x6f')])){for(var _0x466250=0x0;_0x466250<_0x1ce3fe['query'][_0x0ff3('0x6f')][_0x0ff3('0x42')];_0x466250+=0x1){socket[_0x0ff3('0x79')](_0x0ff3('0x95'),{'UserId':Number(_0x1ce3fe[_0x0ff3('0x3d')][_0x0ff3('0x6f')][_0x466250]),'MailQueueId':Number(_0x1ce3fe[_0x0ff3('0x51')]['id'])});}}else{socket['emit'](_0x0ff3('0x95'),{'UserId':Number(_0x1ce3fe[_0x0ff3('0x3d')]['ids']),'MailQueueId':Number(_0x1ce3fe[_0x0ff3('0x51')]['id'])});}});}})[_0x0ff3('0x2d')](respondWithStatusCode(_0x4930ea,null))[_0x0ff3('0x4f')](handleError(_0x4930ea,null));};exports[_0x0ff3('0x96')]=function(_0xffbe68,_0x501600,_0x21b831){var _0x38cd0a={};var _0x3e0d4a={};var _0xd89643;var _0x462e3c;return db[_0x0ff3('0x4b')][_0x0ff3('0x6b')]({'where':{'id':_0xffbe68[_0x0ff3('0x51')]['id']}})[_0x0ff3('0x2d')](handleEntityNotFound(_0x501600,null))[_0x0ff3('0x2d')](function(_0x9e75ce){if(_0x9e75ce){_0xd89643=_0x9e75ce;_0x3e0d4a[_0x0ff3('0x3c')]=_['keys'](db[_0x0ff3('0x97')][_0x0ff3('0x38')]);_0x3e0d4a[_0x0ff3('0x3d')]=_[_0x0ff3('0x3e')](_0xffbe68['query']);_0x3e0d4a[_0x0ff3('0x46')]=_[_0x0ff3('0x3f')](_0x3e0d4a['model'],_0x3e0d4a[_0x0ff3('0x3d')]);_0x38cd0a[_0x0ff3('0x40')]=_['intersection'](_0x3e0d4a['model'],qs[_0x0ff3('0x41')](_0xffbe68[_0x0ff3('0x3d')][_0x0ff3('0x41')]));_0x38cd0a['attributes']=_0x38cd0a[_0x0ff3('0x40')][_0x0ff3('0x42')]?_0x38cd0a[_0x0ff3('0x40')]:_0x3e0d4a[_0x0ff3('0x3c')];_0x38cd0a[_0x0ff3('0x43')]=qs['sort'](_0xffbe68[_0x0ff3('0x3d')]['sort']);_0x38cd0a[_0x0ff3('0x45')]=qs[_0x0ff3('0x46')](_['pick'](_0xffbe68[_0x0ff3('0x3d')],_0x3e0d4a[_0x0ff3('0x46')]));if(_0xffbe68[_0x0ff3('0x3d')][_0x0ff3('0x48')]){_0x38cd0a['where']=_['merge'](_0x38cd0a['where'],{'$or':_[_0x0ff3('0x37')](_0x38cd0a[_0x0ff3('0x40')],function(_0x410cf8){var _0x1b1736={};_0x1b1736[_0x410cf8]={'$like':'%'+_0xffbe68[_0x0ff3('0x3d')]['filter']+'%'};return _0x1b1736;})});}_0x38cd0a=_[_0x0ff3('0x49')]({},_0x38cd0a,_0xffbe68['options']);return _0xd89643[_0x0ff3('0x96')](_0x38cd0a);}})[_0x0ff3('0x2d')](function(_0x1da4ea){if(_0x1da4ea){_0x462e3c=_0x1da4ea[_0x0ff3('0x42')];if(!_0xffbe68[_0x0ff3('0x3d')][_0x0ff3('0x60')](_0x0ff3('0x6d'))){_0x38cd0a['limit']=qs['limit'](_0xffbe68[_0x0ff3('0x3d')]['limit']);_0x38cd0a[_0x0ff3('0x23')]=qs[_0x0ff3('0x23')](_0xffbe68[_0x0ff3('0x3d')][_0x0ff3('0x23')]);}return _0xd89643[_0x0ff3('0x96')](_0x38cd0a);}})['then'](function(_0x74d3fe){if(_0x74d3fe){return _0x74d3fe?{'count':_0x462e3c,'rows':_0x74d3fe}:null;}})[_0x0ff3('0x2d')](respondWithResult(_0x501600,null))[_0x0ff3('0x4f')](handleError(_0x501600,null));}; \ No newline at end of file +var _0xb48d=['crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','apply','then','get','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','MailQueue','includeAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','hasOwnProperty','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','ids','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','emit','userMailQueue:remove','addAgents','spread','isArray','findOne','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x519954,_0x1a47aa){var _0x4e17e0=function(_0x339a40){while(--_0x339a40){_0x519954['push'](_0x519954['shift']());}};_0x4e17e0(++_0x1a47aa);}(_0xb48d,0x194));var _0xdb48=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xb48d[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require(_0xdb48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb48('0x2'));var moment=require(_0xdb48('0x3'));var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require('util');var path=require(_0xdb48('0x6'));var sox=require('sox');var csv=require(_0xdb48('0x7'));var ejs=require(_0xdb48('0x8'));var fs=require('fs');var fs_extra=require(_0xdb48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x7'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0xf'));var logger=require(_0xdb48('0x10'))(_0xdb48('0x11'));var utils=require('../../config/utils');var config=require(_0xdb48('0x12'));var licenseUtil=require(_0xdb48('0x13'));var db=require('../../mysqldb')['db'];config[_0xdb48('0x14')]=_[_0xdb48('0x15')](config[_0xdb48('0x14')],{'host':_0xdb48('0x16'),'port':0x18eb});var socket=require(_0xdb48('0x17'))(new Redis(config[_0xdb48('0x14')]));require('./mailQueue.socket')[_0xdb48('0x18')](socket);function respondWithStatusCode(_0x142eaf,_0x33c327){_0x33c327=_0x33c327||0xcc;return function(_0x4ae67f){if(_0x4ae67f){return _0x142eaf[_0xdb48('0x19')](_0x33c327);}return _0x142eaf['status'](_0x33c327)[_0xdb48('0x1a')]();};}function respondWithResult(_0x3180d7,_0x364e57){_0x364e57=_0x364e57||0xc8;return function(_0x3531cb){if(_0x3531cb){return _0x3180d7[_0xdb48('0x1b')](_0x364e57)['json'](_0x3531cb);}};}function respondWithFilteredResult(_0x488997,_0x3c646f){return function(_0x38099a){if(_0x38099a){var _0x4a2d3f=typeof _0x3c646f[_0xdb48('0x1c')]===_0xdb48('0x1d')&&typeof _0x3c646f['limit']==='undefined';var _0x1432a9=_0x38099a[_0xdb48('0x1e')];var _0x370f5b=_0x4a2d3f?0x0:_0x3c646f['offset'];var _0x287ddd=_0x4a2d3f?_0x38099a[_0xdb48('0x1e')]:_0x3c646f['offset']+_0x3c646f[_0xdb48('0x1f')];var _0x3fb75a;if(_0x287ddd>=_0x1432a9){_0x287ddd=_0x1432a9;_0x3fb75a=0xc8;}else{_0x3fb75a=0xce;}_0x488997[_0xdb48('0x1b')](_0x3fb75a);return _0x488997[_0xdb48('0x20')](_0xdb48('0x21'),_0x370f5b+'-'+_0x287ddd+'/'+_0x1432a9)['json'](_0x38099a);}return null;};}function patchUpdates(_0x2746c4){return function(_0x465d95){try{jsonpatch[_0xdb48('0x22')](_0x465d95,_0x2746c4,!![]);}catch(_0x5a33a0){return BPromise['reject'](_0x5a33a0);}return _0x465d95['save']();};}function saveUpdates(_0x3ad23a,_0x3cdbbd){return function(_0x1b4fc7){if(_0x1b4fc7){return _0x1b4fc7['update'](_0x3ad23a)[_0xdb48('0x23')](function(_0x4d29d1){return _0x4d29d1;});}return null;};}function removeEntity(_0x3b3344,_0x3a5bdd){return function(_0x161e7f){if(_0x161e7f){return _0x161e7f['destroy']()['then'](function(){var _0x139139=_0x161e7f[_0xdb48('0x24')]({'plain':!![]});var _0xf473a0='MailQueues';return db[_0xdb48('0x25')][_0xdb48('0x26')]({'where':{'type':_0xf473a0,'resourceId':_0x139139['id']}})['then'](function(){return _0x161e7f;});})['then'](function(){_0x3b3344[_0xdb48('0x1b')](0xcc)[_0xdb48('0x1a')]();});}};}function handleEntityNotFound(_0x2adb1e,_0x2f55c6){return function(_0x549b18){if(!_0x549b18){_0x2adb1e[_0xdb48('0x19')](0x194);}return _0x549b18;};}function handleError(_0x2b3bb6,_0x25d2c8){_0x25d2c8=_0x25d2c8||0x1f4;return function(_0x560ad6){logger[_0xdb48('0x27')](_0x560ad6[_0xdb48('0x28')]);if(_0x560ad6[_0xdb48('0x29')]){delete _0x560ad6[_0xdb48('0x29')];}_0x2b3bb6[_0xdb48('0x1b')](_0x25d2c8)[_0xdb48('0x2a')](_0x560ad6);};}exports['index']=function(_0x3f0ad1,_0x1fd8a0){var _0x1a9385={},_0x63201d={},_0x27371a={'count':0x0,'rows':[]};var _0x387182=_['map'](db['MailQueue'][_0xdb48('0x2b')],function(_0xc26449){return{'name':_0xc26449[_0xdb48('0x2c')],'type':_0xc26449[_0xdb48('0x2d')][_0xdb48('0x2e')]};});_0x63201d[_0xdb48('0x2f')]=_[_0xdb48('0x30')](_0x387182,_0xdb48('0x29'));_0x63201d[_0xdb48('0x31')]=_['keys'](_0x3f0ad1[_0xdb48('0x31')]);_0x63201d[_0xdb48('0x32')]=_[_0xdb48('0x33')](_0x63201d[_0xdb48('0x2f')],_0x63201d['query']);_0x1a9385['attributes']=_[_0xdb48('0x33')](_0x63201d[_0xdb48('0x2f')],qs[_0xdb48('0x34')](_0x3f0ad1[_0xdb48('0x31')][_0xdb48('0x34')]));_0x1a9385[_0xdb48('0x35')]=_0x1a9385[_0xdb48('0x35')][_0xdb48('0x36')]?_0x1a9385['attributes']:_0x63201d['model'];if(!_0x3f0ad1[_0xdb48('0x31')]['hasOwnProperty'](_0xdb48('0x37'))){_0x1a9385[_0xdb48('0x1f')]=qs[_0xdb48('0x1f')](_0x3f0ad1[_0xdb48('0x31')][_0xdb48('0x1f')]);_0x1a9385[_0xdb48('0x1c')]=qs[_0xdb48('0x1c')](_0x3f0ad1[_0xdb48('0x31')]['offset']);}_0x1a9385[_0xdb48('0x38')]=qs[_0xdb48('0x39')](_0x3f0ad1['query'][_0xdb48('0x39')]);_0x1a9385[_0xdb48('0x3a')]=qs[_0xdb48('0x32')](_[_0xdb48('0x3b')](_0x3f0ad1['query'],_0x63201d['filters']),_0x387182);if(_0x3f0ad1[_0xdb48('0x31')][_0xdb48('0x3c')]){_0x1a9385['where']=_['merge'](_0x1a9385[_0xdb48('0x3a')],{'$or':_[_0xdb48('0x30')](_0x387182,function(_0xb6a8e8){if(_0xb6a8e8[_0xdb48('0x2d')]!=='VIRTUAL'){var _0x4c6916={};_0x4c6916[_0xb6a8e8[_0xdb48('0x29')]]={'$like':'%'+_0x3f0ad1[_0xdb48('0x31')][_0xdb48('0x3c')]+'%'};return _0x4c6916;}})});}_0x1a9385=_[_0xdb48('0x3d')]({},_0x1a9385,_0x3f0ad1[_0xdb48('0x3e')]);var _0x2a6ab0={'where':_0x1a9385[_0xdb48('0x3a')]};return db[_0xdb48('0x3f')][_0xdb48('0x1e')](_0x2a6ab0)['then'](function(_0x3accdb){_0x27371a[_0xdb48('0x1e')]=_0x3accdb;if(_0x3f0ad1['query'][_0xdb48('0x40')]){_0x1a9385['include']=[{'all':!![]}];}return db[_0xdb48('0x3f')]['findAll'](_0x1a9385);})[_0xdb48('0x23')](function(_0x114121){_0x27371a[_0xdb48('0x41')]=_0x114121;return _0x27371a;})[_0xdb48('0x23')](respondWithFilteredResult(_0x1fd8a0,_0x1a9385))[_0xdb48('0x42')](handleError(_0x1fd8a0,null));};exports[_0xdb48('0x43')]=function(_0x28cd41,_0x33f324){var _0x44c22b={'raw':!![],'where':{'id':_0x28cd41[_0xdb48('0x44')]['id']}},_0x282c09={};_0x282c09[_0xdb48('0x2f')]=_[_0xdb48('0x45')](db[_0xdb48('0x3f')][_0xdb48('0x2b')]);_0x282c09[_0xdb48('0x31')]=_[_0xdb48('0x45')](_0x28cd41[_0xdb48('0x31')]);_0x282c09[_0xdb48('0x32')]=_['intersection'](_0x282c09['model'],_0x282c09[_0xdb48('0x31')]);_0x44c22b[_0xdb48('0x35')]=_[_0xdb48('0x33')](_0x282c09['model'],qs[_0xdb48('0x34')](_0x28cd41[_0xdb48('0x31')][_0xdb48('0x34')]));_0x44c22b[_0xdb48('0x35')]=_0x44c22b[_0xdb48('0x35')]['length']?_0x44c22b[_0xdb48('0x35')]:_0x282c09['model'];if(_0x28cd41[_0xdb48('0x31')][_0xdb48('0x40')]){_0x44c22b[_0xdb48('0x46')]=[{'all':!![]}];}_0x44c22b=_[_0xdb48('0x3d')]({},_0x44c22b,_0x28cd41['options']);return db[_0xdb48('0x3f')]['find'](_0x44c22b)[_0xdb48('0x23')](handleEntityNotFound(_0x33f324,null))[_0xdb48('0x23')](respondWithResult(_0x33f324,null))[_0xdb48('0x42')](handleError(_0x33f324,null));};exports[_0xdb48('0x47')]=function(_0x388d5d,_0x40ec47){return db[_0xdb48('0x3f')][_0xdb48('0x47')](_0x388d5d[_0xdb48('0x48')],{})[_0xdb48('0x23')](function(_0x4b5cc7){var _0x4b689a=_0x388d5d[_0xdb48('0x49')][_0xdb48('0x24')]({'plain':!![]});if(!_0x4b689a)throw new Error(_0xdb48('0x4a'));if(_0x4b689a[_0xdb48('0x4b')]==='user'){var _0x5c9b2d=_0x4b5cc7['get']({'plain':!![]});var _0x3d3500=_0xdb48('0x4c');return db[_0xdb48('0x4d')]['find']({'where':{'name':_0x3d3500,'userProfileId':_0x4b689a[_0xdb48('0x4e')]},'raw':!![]})['then'](function(_0x255d47){if(_0x255d47&&_0x255d47[_0xdb48('0x4f')]===0x0){return db[_0xdb48('0x25')]['create']({'name':_0x5c9b2d['name'],'resourceId':_0x5c9b2d['id'],'type':_0x255d47[_0xdb48('0x29')],'sectionId':_0x255d47['id']},{})[_0xdb48('0x23')](function(){return _0x4b5cc7;});}else{return _0x4b5cc7;}})[_0xdb48('0x42')](function(_0xe5c337){logger['error'](_0xdb48('0x50'),_0xe5c337);throw _0xe5c337;});}return _0x4b5cc7;})[_0xdb48('0x23')](respondWithResult(_0x40ec47,0xc9))[_0xdb48('0x42')](handleError(_0x40ec47,null));};exports[_0xdb48('0x51')]=function(_0x1c8bc8,_0x18797c){if(_0x1c8bc8[_0xdb48('0x48')]['id']){delete _0x1c8bc8['body']['id'];}return db['MailQueue'][_0xdb48('0x52')]({'where':{'id':_0x1c8bc8[_0xdb48('0x44')]['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x18797c,null))[_0xdb48('0x23')](saveUpdates(_0x1c8bc8['body'],null))[_0xdb48('0x23')](respondWithResult(_0x18797c,null))[_0xdb48('0x42')](handleError(_0x18797c,null));};exports['destroy']=function(_0x54da00,_0x2a1ca6){return db[_0xdb48('0x3f')]['find']({'where':{'id':_0x54da00['params']['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x2a1ca6,null))[_0xdb48('0x23')](removeEntity(_0x2a1ca6,null))['catch'](handleError(_0x2a1ca6,null));};exports[_0xdb48('0x53')]=function(_0x1e61ca,_0x2def82){return db[_0xdb48('0x3f')][_0xdb48('0x53')]()['then'](respondWithResult(_0x2def82,null))['catch'](handleError(_0x2def82,null));};exports['getMembers']=function(_0x8c092a,_0x3dda78,_0x281792){var _0x57db60={'raw':!![],'where':{}},_0x14790b={},_0x2d9866;return db[_0xdb48('0x3f')]['findOne']({'where':{'id':_0x8c092a[_0xdb48('0x44')]['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x3dda78,null))[_0xdb48('0x23')](function(_0x1fa64a){if(_0x1fa64a){_0x2d9866=_0x1fa64a[_0xdb48('0x24')]({'plain':!![]});_0x14790b[_0xdb48('0x2f')]=_[_0xdb48('0x45')](db['UserMailQueue']['rawAttributes']);_0x14790b['query']=_[_0xdb48('0x45')](_0x8c092a[_0xdb48('0x31')]);_0x14790b[_0xdb48('0x32')]=_['intersection'](_0x14790b[_0xdb48('0x2f')],_0x14790b['query']);_0x57db60[_0xdb48('0x35')]=_['intersection'](_0x14790b[_0xdb48('0x2f')],qs[_0xdb48('0x34')](_0x8c092a['query']['fields']));_0x57db60[_0xdb48('0x35')]=_0x57db60[_0xdb48('0x35')][_0xdb48('0x36')]?_0x57db60[_0xdb48('0x35')]:_0x14790b[_0xdb48('0x2f')];if(!_0x8c092a[_0xdb48('0x31')][_0xdb48('0x54')](_0xdb48('0x37'))){_0x57db60['limit']=qs[_0xdb48('0x1f')](_0x8c092a[_0xdb48('0x31')][_0xdb48('0x1f')]);_0x57db60[_0xdb48('0x1c')]=qs[_0xdb48('0x1c')](_0x8c092a[_0xdb48('0x31')][_0xdb48('0x1c')]);}_0x57db60['order']=qs['sort'](_0x8c092a[_0xdb48('0x31')][_0xdb48('0x39')]);_0x57db60[_0xdb48('0x3a')]=qs[_0xdb48('0x32')](_[_0xdb48('0x3b')](_0x8c092a[_0xdb48('0x31')],_0x14790b[_0xdb48('0x32')]));_0x57db60['where'][_0xdb48('0x55')]=_0x1fa64a['id'];if(_0x8c092a[_0xdb48('0x31')]['filter']){_0x57db60[_0xdb48('0x3a')]=_[_0xdb48('0x3d')](_0x57db60[_0xdb48('0x3a')],{'$or':_[_0xdb48('0x30')](_0x57db60[_0xdb48('0x35')],function(_0x1cbe8d){var _0x52b9af={};_0x52b9af[_0x1cbe8d]={'$like':'%'+_0x8c092a[_0xdb48('0x31')][_0xdb48('0x3c')]+'%'};return _0x52b9af;})});}_0x57db60=_[_0xdb48('0x3d')]({},_0x57db60,_0x8c092a['options']);return db[_0xdb48('0x56')][_0xdb48('0x57')](_0x57db60);}})[_0xdb48('0x23')](function(_0x3b9462){if(_0x3b9462){return db[_0xdb48('0x58')][_0xdb48('0x59')]({'where':{'id':_[_0xdb48('0x30')](_0x3b9462,_0xdb48('0x5a')),'role':_0xdb48('0x5b')},'attributes':['id',_0xdb48('0x29'),_0xdb48('0x5c'),_0xdb48('0x5d'),_0xdb48('0x5e')]});}})[_0xdb48('0x23')](function(_0x4ea810){if(_0x4ea810){return{'count':_0x4ea810[_0xdb48('0x1e')],'rows':_['map'](_0x4ea810[_0xdb48('0x41')],function(_0x40c8be){return{'membername':_0x40c8be['name'],'UserId':_0x40c8be['id'],'queue_name':_0x2d9866[_0xdb48('0x29')],'MailQueueId':_0x2d9866['id'],'interface':util[_0xdb48('0x5f')](_0xdb48('0x60'),_0xdb48('0x61'),_0x40c8be['name']),'penalty':0x0,'paused':_0x40c8be['mailPause'],'createdAt':_0x40c8be[_0xdb48('0x5e')],'updatedAt':_0x40c8be['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdb48('0x23')](respondWithFilteredResult(_0x3dda78,_0x57db60))[_0xdb48('0x42')](handleError(_0x3dda78,null));};exports[_0xdb48('0x62')]=function(_0x2dead5,_0x4d9e43,_0x37574f){var _0x1a434d={};var _0x3b6687={};var _0x57a1e4;var _0x199273;return db[_0xdb48('0x3f')]['findOne']({'where':{'id':_0x2dead5['params']['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x4d9e43,null))[_0xdb48('0x23')](function(_0x33db5f){if(_0x33db5f){_0x57a1e4=_0x33db5f;_0x3b6687[_0xdb48('0x2f')]=_[_0xdb48('0x45')](db[_0xdb48('0x63')][_0xdb48('0x2b')]);_0x3b6687[_0xdb48('0x31')]=_[_0xdb48('0x45')](_0x2dead5[_0xdb48('0x31')]);_0x3b6687['filters']=_[_0xdb48('0x33')](_0x3b6687[_0xdb48('0x2f')],_0x3b6687[_0xdb48('0x31')]);_0x1a434d[_0xdb48('0x35')]=_[_0xdb48('0x33')](_0x3b6687[_0xdb48('0x2f')],qs['fields'](_0x2dead5['query'][_0xdb48('0x34')]));_0x1a434d[_0xdb48('0x35')]=_0x1a434d[_0xdb48('0x35')][_0xdb48('0x36')]?_0x1a434d[_0xdb48('0x35')]:_0x3b6687['model'];_0x1a434d[_0xdb48('0x38')]=qs[_0xdb48('0x39')](_0x2dead5['query']['sort']);_0x1a434d[_0xdb48('0x3a')]=qs[_0xdb48('0x32')](_[_0xdb48('0x3b')](_0x2dead5[_0xdb48('0x31')],_0x3b6687[_0xdb48('0x32')]));if(_0x2dead5['query'][_0xdb48('0x3c')]){_0x1a434d[_0xdb48('0x3a')]=_[_0xdb48('0x3d')](_0x1a434d[_0xdb48('0x3a')],{'$or':_['map'](_0x1a434d[_0xdb48('0x35')],function(_0x15ae08){var _0x364b60={};_0x364b60[_0x15ae08]={'$like':'%'+_0x2dead5[_0xdb48('0x31')][_0xdb48('0x3c')]+'%'};return _0x364b60;})});}_0x1a434d=_['merge']({},_0x1a434d,_0x2dead5[_0xdb48('0x3e')]);return _0x57a1e4[_0xdb48('0x62')](_0x1a434d);}})[_0xdb48('0x23')](function(_0x2c95a2){if(_0x2c95a2){_0x199273=_0x2c95a2[_0xdb48('0x36')];if(!_0x2dead5[_0xdb48('0x31')]['hasOwnProperty'](_0xdb48('0x37'))){_0x1a434d['limit']=qs[_0xdb48('0x1f')](_0x2dead5['query'][_0xdb48('0x1f')]);_0x1a434d[_0xdb48('0x1c')]=qs['offset'](_0x2dead5[_0xdb48('0x31')][_0xdb48('0x1c')]);}return _0x57a1e4[_0xdb48('0x62')](_0x1a434d);}})[_0xdb48('0x23')](function(_0x5dcfd0){if(_0x5dcfd0){return _0x5dcfd0?{'count':_0x199273,'rows':_0x5dcfd0}:null;}})[_0xdb48('0x23')](respondWithResult(_0x4d9e43,null))[_0xdb48('0x42')](handleError(_0x4d9e43,null));};exports[_0xdb48('0x64')]=function(_0x3ca08b,_0x3e04a5,_0x381845){var _0x4136b0=_0x3ca08b[_0xdb48('0x48')]['ids'];return db[_0xdb48('0x63')][_0xdb48('0x57')]({'where':{'id':_0x4136b0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdb48('0x65'),'attributes':['id',_0xdb48('0x29'),'online','voicePause',_0xdb48('0x66')],'raw':!![]}]})['then'](function(_0xa97d2b){if(_0xa97d2b){var _0x585bc6=_[_0xdb48('0x67')](_0xa97d2b,function(_0x22d66a){var _0x1344e4=_0x22d66a[_0xdb48('0x24')]({'plain':!![]});return _0x1344e4['Agents'];});return db['MailQueue'][_0xdb48('0x52')]({'where':{'id':_0x3ca08b['params']['id']}})[_0xdb48('0x23')](function(_0x337ce7){return db[_0xdb48('0x68')][_0xdb48('0x69')](function(_0x14f634){return _0x337ce7['addTeams'](_0x4136b0,{'transaction':_0x14f634})['then'](function(){return BPromise[_0xdb48('0x6a')](_0x585bc6,function(_0x101615){return db[_0xdb48('0x56')][_0xdb48('0x6b')]({'where':{'UserId':_0x101615['id'],'MailQueueId':_0x3ca08b[_0xdb48('0x44')]['id']},'transaction':_0x14f634});});})['then'](function(){_0x585bc6[_0xdb48('0x6c')](function(_0x1a8f48){socket['emit'](_0xdb48('0x6d'),{'UserId':_0x1a8f48['id'],'MailQueueId':_0x337ce7['id']});});});});});}})[_0xdb48('0x23')](respondWithStatusCode(_0x3e04a5,null))['catch'](handleError(_0x3e04a5,null));};exports[_0xdb48('0x6e')]=function(_0x5ab026,_0x4c393f,_0x3a4252){return db[_0xdb48('0x63')][_0xdb48('0x57')]({'where':{'id':_0x5ab026['query'][_0xdb48('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xdb48('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c393f,null))[_0xdb48('0x23')](function(_0x160f25){var _0x545fdd=_[_0xdb48('0x30')](_0x160f25,'id');var _0x4f414a=[];var _0x68e20f=[];var _0x1e54d5=squel['select']();_0x1e54d5[_0xdb48('0x70')](_0xdb48('0x71'))['from'](_0xdb48('0x72'),'tq')[_0xdb48('0x73')](_0xdb48('0x74'),'ut',_0xdb48('0x75'))['where'](_0xdb48('0x76'),_0x5ab026[_0xdb48('0x44')]['id']);for(var _0x499cf3=0x0;_0x499cf3<_0x160f25[_0xdb48('0x36')];_0x499cf3+=0x1){let _0x3026a0=_0x160f25[_0x499cf3];for(var _0x310810=0x0;_0x310810<_0x3026a0[_0xdb48('0x65')]['length'];_0x310810+=0x1){let _0x517e22=_0x3026a0[_0xdb48('0x65')][_0x310810];var _0x137010=_0x1e54d5[_0xdb48('0x77')]();_0x137010['where'](_0xdb48('0x78'),_0x517e22['id']);_0x68e20f['push'](db['sequelize'][_0xdb48('0x31')](_0x137010['toString'](),{'type':db[_0xdb48('0x68')][_0xdb48('0x79')][_0xdb48('0x7a')]})[_0xdb48('0x23')](function(_0x3d32b6){if(_0x3d32b6[_0xdb48('0x36')]===0x1){return _0x517e22['id'];}else{var _0x17155c=_[_0xdb48('0x7b')](_['map'](_0x3d32b6,_0xdb48('0x7c')),function(_0xc68157){return _[_0xdb48('0x7d')](_0x545fdd,_0xc68157);});if(_0x17155c){return _0x517e22['id'];}}}));}}return BPromise[_0xdb48('0x7e')](_0x68e20f)[_0xdb48('0x23')](function(_0xe68c7f){_0x4f414a=_(_0x4f414a)[_0xdb48('0x7f')](_0xe68c7f)[_0xdb48('0x80')]()[_0xdb48('0x81')]();return db[_0xdb48('0x3f')][_0xdb48('0x52')]({'where':{'id':_0x5ab026[_0xdb48('0x44')]['id']}})[_0xdb48('0x23')](function(_0xbd7f1){return db[_0xdb48('0x68')][_0xdb48('0x69')](function(_0x3a4df0){return _0xbd7f1['removeTeams'](_0x5ab026[_0xdb48('0x31')]['ids'],{'transaction':_0x3a4df0})['then'](function(){if(!_['isEmpty'](_0x4f414a)){return _0xbd7f1[_0xdb48('0x82')](_0x4f414a,{'transaction':_0x3a4df0});}})[_0xdb48('0x23')](function(){_0x4f414a['forEach'](function(_0x38e951){socket[_0xdb48('0x83')](_0xdb48('0x84'),{'UserId':_0x38e951,'MailQueueId':_0xbd7f1['id']});});});});});});})[_0xdb48('0x23')](respondWithStatusCode(_0x4c393f,null))[_0xdb48('0x42')](handleError(_0x4c393f,null));};exports[_0xdb48('0x85')]=function(_0x19f54d,_0x376bc0,_0x4b8527){return db[_0xdb48('0x3f')][_0xdb48('0x52')]({'where':{'id':_0x19f54d[_0xdb48('0x44')]['id']}})['then'](handleEntityNotFound(_0x376bc0,null))[_0xdb48('0x23')](function(_0x597e38){if(_0x597e38){return _0x597e38[_0xdb48('0x85')](_0x19f54d['body']['ids'],_['omit'](_0x19f54d[_0xdb48('0x48')],[_0xdb48('0x6f'),'id'])||{})[_0xdb48('0x86')](function(_0x1d9cbc){for(var _0x21f253=0x0;_0x21f253<_0x19f54d[_0xdb48('0x48')][_0xdb48('0x6f')]['length'];_0x21f253+=0x1){socket[_0xdb48('0x83')](_0xdb48('0x6d'),{'UserId':Number(_0x19f54d[_0xdb48('0x48')][_0xdb48('0x6f')][_0x21f253]),'MailQueueId':Number(_0x19f54d[_0xdb48('0x44')]['id'])});}return _0x1d9cbc;});}})[_0xdb48('0x23')](respondWithResult(_0x376bc0,null))[_0xdb48('0x42')](handleError(_0x376bc0,null));};exports[_0xdb48('0x82')]=function(_0x88b1ed,_0x74036d,_0x12053b){return db[_0xdb48('0x3f')][_0xdb48('0x52')]({'where':{'id':_0x88b1ed[_0xdb48('0x44')]['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x74036d,null))[_0xdb48('0x23')](function(_0x5ac69d){if(_0x5ac69d){return _0x5ac69d[_0xdb48('0x82')](_0x88b1ed[_0xdb48('0x31')]['ids'])[_0xdb48('0x23')](function(){if(_[_0xdb48('0x87')](_0x88b1ed[_0xdb48('0x31')][_0xdb48('0x6f')])){for(var _0x5e6549=0x0;_0x5e6549<_0x88b1ed['query']['ids'][_0xdb48('0x36')];_0x5e6549+=0x1){socket[_0xdb48('0x83')](_0xdb48('0x84'),{'UserId':Number(_0x88b1ed[_0xdb48('0x31')][_0xdb48('0x6f')][_0x5e6549]),'MailQueueId':Number(_0x88b1ed['params']['id'])});}}else{socket['emit'](_0xdb48('0x84'),{'UserId':Number(_0x88b1ed[_0xdb48('0x31')]['ids']),'MailQueueId':Number(_0x88b1ed['params']['id'])});}});}})[_0xdb48('0x23')](respondWithStatusCode(_0x74036d,null))[_0xdb48('0x42')](handleError(_0x74036d,null));};exports['getAgents']=function(_0x436828,_0x27ef67,_0xd188ab){var _0x59f5a9={};var _0x175aa0={};var _0x319c0c;var _0x1d2251;return db[_0xdb48('0x3f')][_0xdb48('0x88')]({'where':{'id':_0x436828[_0xdb48('0x44')]['id']}})[_0xdb48('0x23')](handleEntityNotFound(_0x27ef67,null))[_0xdb48('0x23')](function(_0x19d7d0){if(_0x19d7d0){_0x319c0c=_0x19d7d0;_0x175aa0[_0xdb48('0x2f')]=_[_0xdb48('0x45')](db[_0xdb48('0x58')][_0xdb48('0x2b')]);_0x175aa0[_0xdb48('0x31')]=_[_0xdb48('0x45')](_0x436828[_0xdb48('0x31')]);_0x175aa0[_0xdb48('0x32')]=_[_0xdb48('0x33')](_0x175aa0[_0xdb48('0x2f')],_0x175aa0['query']);_0x59f5a9['attributes']=_['intersection'](_0x175aa0[_0xdb48('0x2f')],qs[_0xdb48('0x34')](_0x436828['query']['fields']));_0x59f5a9[_0xdb48('0x35')]=_0x59f5a9['attributes'][_0xdb48('0x36')]?_0x59f5a9[_0xdb48('0x35')]:_0x175aa0[_0xdb48('0x2f')];_0x59f5a9[_0xdb48('0x38')]=qs[_0xdb48('0x39')](_0x436828[_0xdb48('0x31')]['sort']);_0x59f5a9['where']=qs['filters'](_[_0xdb48('0x3b')](_0x436828[_0xdb48('0x31')],_0x175aa0['filters']));if(_0x436828[_0xdb48('0x31')][_0xdb48('0x3c')]){_0x59f5a9['where']=_[_0xdb48('0x3d')](_0x59f5a9[_0xdb48('0x3a')],{'$or':_[_0xdb48('0x30')](_0x59f5a9[_0xdb48('0x35')],function(_0x4d1f59){var _0x391147={};_0x391147[_0x4d1f59]={'$like':'%'+_0x436828[_0xdb48('0x31')][_0xdb48('0x3c')]+'%'};return _0x391147;})});}_0x59f5a9=_[_0xdb48('0x3d')]({},_0x59f5a9,_0x436828['options']);return _0x319c0c[_0xdb48('0x89')](_0x59f5a9);}})[_0xdb48('0x23')](function(_0x572f8b){if(_0x572f8b){_0x1d2251=_0x572f8b[_0xdb48('0x36')];if(!_0x436828[_0xdb48('0x31')][_0xdb48('0x54')](_0xdb48('0x37'))){_0x59f5a9[_0xdb48('0x1f')]=qs[_0xdb48('0x1f')](_0x436828[_0xdb48('0x31')][_0xdb48('0x1f')]);_0x59f5a9['offset']=qs[_0xdb48('0x1c')](_0x436828['query'][_0xdb48('0x1c')]);}return _0x319c0c[_0xdb48('0x89')](_0x59f5a9);}})[_0xdb48('0x23')](function(_0x5066a8){if(_0x5066a8){return _0x5066a8?{'count':_0x1d2251,'rows':_0x5066a8}:null;}})[_0xdb48('0x23')](respondWithResult(_0x27ef67,null))[_0xdb48('0x42')](handleError(_0x27ef67,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 653b66e..696e07f 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 _0xd29d=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x2cda71,_0x87924e){var _0x15aa46=function(_0x975abc){while(--_0x975abc){_0x2cda71['push'](_0x2cda71['shift']());}};_0x15aa46(++_0x87924e);}(_0xd29d,0x6d));var _0xdd29=function(_0x2c37ad,_0x49b45e){_0x2c37ad=_0x2c37ad-0x0;var _0xfb4a30=_0xd29d[_0x2c37ad];return _0xfb4a30;};'use strict';var EventEmitter=require(_0xdd29('0x0'));var MailQueue=require(_0xdd29('0x1'))['db'][_0xdd29('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xdd29('0x3')](0x0);var events={'afterCreate':_0xdd29('0x4'),'afterUpdate':_0xdd29('0x5'),'afterDestroy':_0xdd29('0x6')};function emitEvent(_0x15e6a4){return function(_0x29885a,_0xb4426b,_0x7d41ab){MailQueueEvents[_0xdd29('0x7')](_0x15e6a4+':'+_0x29885a['id'],_0x29885a);MailQueueEvents[_0xdd29('0x7')](_0x15e6a4,_0x29885a);_0x7d41ab(null);};}for(var e in events){if(events[_0xdd29('0x8')](e)){var event=events[e];MailQueue[_0xdd29('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x5ea2=['../../mysqldb','MailQueue','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x451c3c,_0x4d260d){var _0x195fde=function(_0x443824){while(--_0x443824){_0x451c3c['push'](_0x451c3c['shift']());}};_0x195fde(++_0x4d260d);}(_0x5ea2,0x158));var _0x25ea=function(_0x551c3a,_0x175bc0){_0x551c3a=_0x551c3a-0x0;var _0x30bfe9=_0x5ea2[_0x551c3a];return _0x30bfe9;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x25ea('0x0'))['db'][_0x25ea('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x25ea('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25ea('0x3'),'afterDestroy':_0x25ea('0x4')};function emitEvent(_0x117d08){return function(_0x491284,_0x9e4dba,_0x1c2a9a){MailQueueEvents[_0x25ea('0x5')](_0x117d08+':'+_0x491284['id'],_0x491284);MailQueueEvents[_0x25ea('0x5')](_0x117d08,_0x491284);_0x1c2a9a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x25ea('0x6')](e,emitEvent(event));}}module[_0x25ea('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 1ddc209..9551ee0 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 _0xae4f=['./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae4f,0x130));var _0xfae4=function(_0x4bf882,_0x490049){_0x4bf882=_0x4bf882-0x0;var _0x1a01ad=_0xae4f[_0x4bf882];return _0x1a01ad;};'use strict';var _=require(_0xfae4('0x0'));var util=require(_0xfae4('0x1'));var logger=require(_0xfae4('0x2'))(_0xfae4('0x3'));var moment=require(_0xfae4('0x4'));var BPromise=require(_0xfae4('0x5'));var rp=require(_0xfae4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfae4('0x7'));var attributes=require(_0xfae4('0x8'));module[_0xfae4('0x9')]=function(_0xe14b89,_0x45948c){return _0xe14b89[_0xfae4('0xa')](_0xfae4('0xb'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe0d=['MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x1fba9a,_0x3553e0){var _0x41413d=function(_0x118ca1){while(--_0x118ca1){_0x1fba9a['push'](_0x1fba9a['shift']());}};_0x41413d(++_0x3553e0);}(_0xbe0d,0x79));var _0xdbe0=function(_0x1698f6,_0x441e4b){_0x1698f6=_0x1698f6-0x0;var _0x11d58f=_0xbe0d[_0x1698f6];return _0x11d58f;};'use strict';var _=require(_0xdbe0('0x0'));var util=require(_0xdbe0('0x1'));var logger=require(_0xdbe0('0x2'))(_0xdbe0('0x3'));var moment=require(_0xdbe0('0x4'));var BPromise=require(_0xdbe0('0x5'));var rp=require(_0xdbe0('0x6'));var fs=require('fs');var path=require(_0xdbe0('0x7'));var rimraf=require('rimraf');var config=require(_0xdbe0('0x8'));var attributes=require('./mailQueue.attributes');module[_0xdbe0('0x9')]=function(_0x19a176,_0xbbd0bb){return _0x19a176[_0xdbe0('0xa')](_0xdbe0('0xb'),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 f7f8e73..d8d1627 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 _0x5b56=['http','redis','localhost','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x65a691,_0x5be493){var _0x5a285a=function(_0xa63d86){while(--_0xa63d86){_0x65a691['push'](_0x65a691['shift']());}};_0x5a285a(++_0x5be493);}(_0x5b56,0x9a));var _0x65b5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5b56[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x65b5('0x0'));var util=require(_0x65b5('0x1'));var moment=require(_0x65b5('0x2'));var BPromise=require(_0x65b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65b5('0x4'));var db=require(_0x65b5('0x5'))['db'];var utils=require(_0x65b5('0x6'));var logger=require(_0x65b5('0x7'))('rpc');var config=require(_0x65b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x65b5('0x9')][_0x65b5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x65b5('0xb')],{'host':_0x65b5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x65b5('0xd'))[_0x65b5('0xe')](socket);function respondWithRpcPromise(_0x546e29,_0x24aea1,_0x19b91d){return new BPromise(function(_0x2b7847,_0x32ee91){return client[_0x65b5('0xf')](_0x546e29,_0x19b91d)[_0x65b5('0x10')](function(_0x125465){logger['info'](_0x65b5('0x11'),_0x24aea1,'request\x20sent');logger[_0x65b5('0x12')](_0x65b5('0x13'),_0x24aea1,_0x65b5('0x14'),JSON[_0x65b5('0x15')](_0x125465));if(_0x125465[_0x65b5('0x16')]){if(_0x125465[_0x65b5('0x16')][_0x65b5('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x24aea1,_0x125465[_0x65b5('0x16')][_0x65b5('0x18')]);return _0x32ee91(_0x125465['error'][_0x65b5('0x18')]);}logger[_0x65b5('0x16')](_0x65b5('0x11'),_0x24aea1,_0x125465['error']['message']);return _0x2b7847(_0x125465[_0x65b5('0x16')]['message']);}else{logger[_0x65b5('0x19')](_0x65b5('0x11'),_0x24aea1,_0x65b5('0x14'));_0x2b7847(_0x125465[_0x65b5('0x1a')]['message']);}})[_0x65b5('0x1b')](function(_0x53fcc1){logger[_0x65b5('0x16')]('MailQueue,\x20%s,\x20%s',_0x24aea1,_0x53fcc1);_0x32ee91(_0x53fcc1);});});}exports['GetMailQueue']=function(_0x5a96cc){var _0x47e19d=this;return new Promise(function(_0x523bc2,_0x1cf92b){return db[_0x65b5('0x1c')][_0x65b5('0x1d')]({'raw':_0x5a96cc[_0x65b5('0x1e')]?_0x5a96cc['options'][_0x65b5('0x1f')]===undefined?!![]:![]:!![],'where':_0x5a96cc['options']?_0x5a96cc[_0x65b5('0x1e')][_0x65b5('0x20')]||null:null,'attributes':_0x5a96cc[_0x65b5('0x1e')]?_0x5a96cc[_0x65b5('0x1e')][_0x65b5('0x21')]||null:null,'limit':_0x5a96cc['options']?_0x5a96cc['options'][_0x65b5('0x22')]||null:null,'include':_0x5a96cc[_0x65b5('0x1e')]?_0x5a96cc[_0x65b5('0x1e')][_0x65b5('0x23')]?_['map'](_0x5a96cc[_0x65b5('0x1e')]['include'],function(_0x219da2){return{'model':db[_0x219da2[_0x65b5('0x24')]],'as':_0x219da2['as'],'attributes':_0x219da2[_0x65b5('0x21')],'include':_0x219da2[_0x65b5('0x23')]?_[_0x65b5('0x25')](_0x219da2['include'],function(_0x2090f5){return{'model':db[_0x2090f5[_0x65b5('0x24')]],'as':_0x2090f5['as'],'attributes':_0x2090f5[_0x65b5('0x21')],'include':_0x2090f5['include']?_[_0x65b5('0x25')](_0x2090f5[_0x65b5('0x23')],function(_0x3c4c0d){return{'model':db[_0x3c4c0d['model']],'as':_0x3c4c0d['as'],'attributes':_0x3c4c0d[_0x65b5('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaa01d){logger[_0x65b5('0x19')](_0x65b5('0x26'),_0x5a96cc);logger[_0x65b5('0x12')](_0x65b5('0x26'),_0x5a96cc,JSON[_0x65b5('0x15')](_0xaa01d));_0x523bc2(_0xaa01d);})[_0x65b5('0x1b')](function(_0xc2b7d7){logger[_0x65b5('0x16')](_0x65b5('0x26'),_0xc2b7d7[_0x65b5('0x18')],_0x5a96cc);_0x1cf92b(_0x47e19d[_0x65b5('0x16')](0x1f4,_0xc2b7d7[_0x65b5('0x18')]));});});};exports[_0x65b5('0x27')]=function(_0xe568b7){var _0x48ee64=this;return new Promise(function(_0x3edcb4,_0x581dcb){return db['MailQueue'][_0x65b5('0x28')]({'raw':_0xe568b7[_0x65b5('0x1e')]?_0xe568b7[_0x65b5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xe568b7[_0x65b5('0x1e')]?_0xe568b7[_0x65b5('0x1e')][_0x65b5('0x20')]||null:null,'attributes':_0xe568b7[_0x65b5('0x1e')]?_0xe568b7[_0x65b5('0x1e')][_0x65b5('0x21')]||null:null,'include':_0xe568b7[_0x65b5('0x1e')]?_0xe568b7[_0x65b5('0x1e')][_0x65b5('0x23')]?_['map'](_0xe568b7[_0x65b5('0x1e')][_0x65b5('0x23')],function(_0x53f5af){return{'model':db[_0x53f5af['model']],'as':_0x53f5af['as'],'attributes':_0x53f5af['attributes'],'include':_0x53f5af[_0x65b5('0x23')]?_[_0x65b5('0x25')](_0x53f5af[_0x65b5('0x23')],function(_0x120c2e){return{'model':db[_0x120c2e[_0x65b5('0x24')]],'as':_0x120c2e['as'],'attributes':_0x120c2e[_0x65b5('0x21')],'include':_0x120c2e[_0x65b5('0x23')]?_[_0x65b5('0x25')](_0x120c2e['include'],function(_0x3f75c3){return{'model':db[_0x3f75c3[_0x65b5('0x24')]],'as':_0x3f75c3['as'],'attributes':_0x3f75c3[_0x65b5('0x21')]};}):[]};}):[]};}):[]:[]})[_0x65b5('0x10')](function(_0x28bdd2){logger[_0x65b5('0x19')](_0x65b5('0x27'),_0xe568b7);logger[_0x65b5('0x12')]('ShowMailQueue',_0xe568b7,JSON[_0x65b5('0x15')](_0x28bdd2));_0x3edcb4(_0x28bdd2);})[_0x65b5('0x1b')](function(_0x45f2a1){logger['error']('ShowMailQueue',_0x45f2a1['message'],_0xe568b7);_0x581dcb(_0x48ee64[_0x65b5('0x16')](0x1f4,_0x45f2a1[_0x65b5('0x18')]));});});}; \ No newline at end of file +var _0x1edd=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','ShowMailQueue','find'];(function(_0x46ae4b,_0x195c41){var _0x8aea66=function(_0x1538cc){while(--_0x1538cc){_0x46ae4b['push'](_0x46ae4b['shift']());}};_0x8aea66(++_0x195c41);}(_0x1edd,0xcd));var _0xd1ed=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x1edd[_0x3ef45e];return _0x69e7c;};'use strict';var _=require(_0xd1ed('0x0'));var util=require(_0xd1ed('0x1'));var moment=require(_0xd1ed('0x2'));var BPromise=require(_0xd1ed('0x3'));var rs=require(_0xd1ed('0x4'));var fs=require('fs');var Redis=require(_0xd1ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1ed('0x6'));var logger=require(_0xd1ed('0x7'))('rpc');var config=require(_0xd1ed('0x8'));var jayson=require(_0xd1ed('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd1ed('0xa')]=_[_0xd1ed('0xb')](config[_0xd1ed('0xa')],{'host':_0xd1ed('0xc'),'port':0x18eb});var socket=require(_0xd1ed('0xd'))(new Redis(config['redis']));require(_0xd1ed('0xe'))[_0xd1ed('0xf')](socket);function respondWithRpcPromise(_0x3db2c4,_0x11c73a,_0x24824f){return new BPromise(function(_0x5107a6,_0x5ee467){return client[_0xd1ed('0x10')](_0x3db2c4,_0x24824f)['then'](function(_0x233aba){logger['info'](_0xd1ed('0x11'),_0x11c73a,_0xd1ed('0x12'));logger['debug'](_0xd1ed('0x13'),_0x11c73a,_0xd1ed('0x12'),JSON[_0xd1ed('0x14')](_0x233aba));if(_0x233aba[_0xd1ed('0x15')]){if(_0x233aba[_0xd1ed('0x15')][_0xd1ed('0x16')]===0x1f4){logger['error'](_0xd1ed('0x11'),_0x11c73a,_0x233aba['error'][_0xd1ed('0x17')]);return _0x5ee467(_0x233aba[_0xd1ed('0x15')][_0xd1ed('0x17')]);}logger['error'](_0xd1ed('0x11'),_0x11c73a,_0x233aba[_0xd1ed('0x15')]['message']);return _0x5107a6(_0x233aba[_0xd1ed('0x15')][_0xd1ed('0x17')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x11c73a,_0xd1ed('0x12'));_0x5107a6(_0x233aba[_0xd1ed('0x18')][_0xd1ed('0x17')]);}})[_0xd1ed('0x19')](function(_0x5b30f3){logger[_0xd1ed('0x15')](_0xd1ed('0x11'),_0x11c73a,_0x5b30f3);_0x5ee467(_0x5b30f3);});});}exports[_0xd1ed('0x1a')]=function(_0xfaac7f){var _0x35a50a=this;return new Promise(function(_0x5d0f90,_0x4b5a5e){return db[_0xd1ed('0x1b')][_0xd1ed('0x1c')]({'raw':_0xfaac7f[_0xd1ed('0x1d')]?_0xfaac7f['options'][_0xd1ed('0x1e')]===undefined?!![]:![]:!![],'where':_0xfaac7f[_0xd1ed('0x1d')]?_0xfaac7f[_0xd1ed('0x1d')][_0xd1ed('0x1f')]||null:null,'attributes':_0xfaac7f['options']?_0xfaac7f[_0xd1ed('0x1d')][_0xd1ed('0x20')]||null:null,'limit':_0xfaac7f[_0xd1ed('0x1d')]?_0xfaac7f['options'][_0xd1ed('0x21')]||null:null,'include':_0xfaac7f[_0xd1ed('0x1d')]?_0xfaac7f[_0xd1ed('0x1d')][_0xd1ed('0x22')]?_[_0xd1ed('0x23')](_0xfaac7f[_0xd1ed('0x1d')][_0xd1ed('0x22')],function(_0x1472a8){return{'model':db[_0x1472a8['model']],'as':_0x1472a8['as'],'attributes':_0x1472a8[_0xd1ed('0x20')],'include':_0x1472a8[_0xd1ed('0x22')]?_['map'](_0x1472a8[_0xd1ed('0x22')],function(_0x3b6899){return{'model':db[_0x3b6899[_0xd1ed('0x24')]],'as':_0x3b6899['as'],'attributes':_0x3b6899[_0xd1ed('0x20')],'include':_0x3b6899[_0xd1ed('0x22')]?_['map'](_0x3b6899[_0xd1ed('0x22')],function(_0x6c544d){return{'model':db[_0x6c544d['model']],'as':_0x6c544d['as'],'attributes':_0x6c544d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1ed('0x25')](function(_0x2f6dc1){logger['info'](_0xd1ed('0x1a'),_0xfaac7f);logger[_0xd1ed('0x26')](_0xd1ed('0x1a'),_0xfaac7f,JSON[_0xd1ed('0x14')](_0x2f6dc1));_0x5d0f90(_0x2f6dc1);})[_0xd1ed('0x19')](function(_0x1b4d92){logger[_0xd1ed('0x15')](_0xd1ed('0x1a'),_0x1b4d92[_0xd1ed('0x17')],_0xfaac7f);_0x4b5a5e(_0x35a50a['error'](0x1f4,_0x1b4d92[_0xd1ed('0x17')]));});});};exports[_0xd1ed('0x27')]=function(_0x3ba3b2){var _0x3f7b07=this;return new Promise(function(_0x5cc247,_0x3343f5){return db['MailQueue'][_0xd1ed('0x28')]({'raw':_0x3ba3b2[_0xd1ed('0x1d')]?_0x3ba3b2['options'][_0xd1ed('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ba3b2['options']?_0x3ba3b2[_0xd1ed('0x1d')][_0xd1ed('0x1f')]||null:null,'attributes':_0x3ba3b2['options']?_0x3ba3b2[_0xd1ed('0x1d')][_0xd1ed('0x20')]||null:null,'include':_0x3ba3b2[_0xd1ed('0x1d')]?_0x3ba3b2[_0xd1ed('0x1d')]['include']?_[_0xd1ed('0x23')](_0x3ba3b2[_0xd1ed('0x1d')][_0xd1ed('0x22')],function(_0x32e53a){return{'model':db[_0x32e53a['model']],'as':_0x32e53a['as'],'attributes':_0x32e53a[_0xd1ed('0x20')],'include':_0x32e53a['include']?_['map'](_0x32e53a[_0xd1ed('0x22')],function(_0x2177bb){return{'model':db[_0x2177bb[_0xd1ed('0x24')]],'as':_0x2177bb['as'],'attributes':_0x2177bb[_0xd1ed('0x20')],'include':_0x2177bb[_0xd1ed('0x22')]?_[_0xd1ed('0x23')](_0x2177bb['include'],function(_0x573e91){return{'model':db[_0x573e91['model']],'as':_0x573e91['as'],'attributes':_0x573e91['attributes']};}):[]};}):[]};}):[]:[]})[_0xd1ed('0x25')](function(_0x2f8dbb){logger['info'](_0xd1ed('0x27'),_0x3ba3b2);logger['debug'](_0xd1ed('0x27'),_0x3ba3b2,JSON[_0xd1ed('0x14')](_0x2f8dbb));_0x5cc247(_0x2f8dbb);})[_0xd1ed('0x19')](function(_0x338ea6){logger[_0xd1ed('0x15')](_0xd1ed('0x27'),_0x338ea6['message'],_0x3ba3b2);_0x3343f5(_0x3f7b07[_0xd1ed('0x15')](0x1f4,_0x338ea6[_0xd1ed('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 2b2696c..3c28726 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 _0x3b6b=['save','update','emit','register','length'];(function(_0x2d620b,_0x371793){var _0x256963=function(_0x47dd0b){while(--_0x47dd0b){_0x2d620b['push'](_0x2d620b['shift']());}};_0x256963(++_0x371793);}(_0x3b6b,0x87));var _0xb3b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b6b[_0x321bb2];return _0x9c12ed;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xb3b6('0x0'),'remove',_0xb3b6('0x1')];function createListener(_0xe471e,_0x25964e){return function(_0x4cec82){_0x25964e[_0xb3b6('0x2')](_0xe471e,_0x4cec82);};}function removeListener(_0x4d4b6e,_0x2da3ee){return function(){MailQueueEvents['removeListener'](_0x4d4b6e,_0x2da3ee);};}exports[_0xb3b6('0x3')]=function(_0x107d64){for(var _0x847895=0x0,_0x5b782e=events[_0xb3b6('0x4')];_0x847895<_0x5b782e;_0x847895++){var _0x3be0b9=events[_0x847895];var _0x34ea2b=createListener('mailQueue:'+_0x3be0b9,_0x107d64);MailQueueEvents['on'](_0x3be0b9,_0x34ea2b);}}; \ No newline at end of file +var _0x6a31=['register','length','mailQueue:','./mailQueue.events','save','update','emit','removeListener'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x6a31,0x73));var _0x16a3=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x6a31[_0x1a8f86];return _0x20d876;};'use strict';var MailQueueEvents=require(_0x16a3('0x0'));var events=[_0x16a3('0x1'),'remove',_0x16a3('0x2')];function createListener(_0x560da4,_0x366c53){return function(_0x31ccc1){_0x366c53[_0x16a3('0x3')](_0x560da4,_0x31ccc1);};}function removeListener(_0x22033f,_0x4fd810){return function(){MailQueueEvents[_0x16a3('0x4')](_0x22033f,_0x4fd810);};}exports[_0x16a3('0x5')]=function(_0x50f272){for(var _0x3efb6=0x0,_0x1e9576=events[_0x16a3('0x6')];_0x3efb6<_0x1e9576;_0x3efb6++){var _0x5677c8=events[_0x3efb6];var _0x22d8dc=createListener(_0x16a3('0x7')+_0x5677c8,_0x50f272);MailQueueEvents['on'](_0x5677c8,_0x22d8dc);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 189e01b..d341b68 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 _0x8c7b=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3e22b2,_0x213163){var _0x1b14a9=function(_0x58302e){while(--_0x58302e){_0x3e22b2['push'](_0x3e22b2['shift']());}};_0x1b14a9(++_0x213163);}(_0x8c7b,0x15b));var _0xb8c7=function(_0x190273,_0x285318){_0x190273=_0x190273-0x0;var _0x57e940=_0x8c7b[_0x190273];return _0x57e940;};'use strict';var multer=require(_0xb8c7('0x0'));var util=require('util');var path=require(_0xb8c7('0x1'));var timeout=require(_0xb8c7('0x2'));var express=require('express');var router=express[_0xb8c7('0x3')]();var fs_extra=require(_0xb8c7('0x4'));var auth=require(_0xb8c7('0x5'));var interaction=require(_0xb8c7('0x6'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xb8c7('0x7')]('/',auth[_0xb8c7('0x8')](),controller[_0xb8c7('0x9')]);router[_0xb8c7('0x7')](_0xb8c7('0xa'),auth['isAuthenticated'](),controller[_0xb8c7('0xb')]);router[_0xb8c7('0x7')](_0xb8c7('0xc'),auth[_0xb8c7('0x8')](),controller[_0xb8c7('0xd')]);router[_0xb8c7('0xe')]('/',auth['isAuthenticated'](),controller[_0xb8c7('0xf')]);router[_0xb8c7('0x10')](_0xb8c7('0xc'),auth[_0xb8c7('0x8')](),controller[_0xb8c7('0x11')]);router[_0xb8c7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb8c7('0x13')]);module[_0xb8c7('0x14')]=router; \ No newline at end of file +var _0xc233=['isAuthenticated','index','/describe','describe','post','create','put','delete','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x15fdf2,_0x2373fa){var _0x15d9d7=function(_0x22d3a4){while(--_0x22d3a4){_0x15fdf2['push'](_0x15fdf2['shift']());}};_0x15d9d7(++_0x2373fa);}(_0xc233,0x6a));var _0x3c23=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0xc233[_0x53d172];return _0x1bd0a2;};'use strict';var multer=require(_0x3c23('0x0'));var util=require('util');var path=require(_0x3c23('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c23('0x2'));var router=express[_0x3c23('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3c23('0x4'));var interaction=require(_0x3c23('0x5'));var config=require(_0x3c23('0x6'));var controller=require('./mailQueueReport.controller');router[_0x3c23('0x7')]('/',auth[_0x3c23('0x8')](),controller[_0x3c23('0x9')]);router['get'](_0x3c23('0xa'),auth[_0x3c23('0x8')](),controller[_0x3c23('0xb')]);router[_0x3c23('0x7')]('/:id',auth[_0x3c23('0x8')](),controller['show']);router[_0x3c23('0xc')]('/',auth[_0x3c23('0x8')](),controller[_0x3c23('0xd')]);router[_0x3c23('0xe')]('/:id',auth[_0x3c23('0x8')](),controller['update']);router[_0x3c23('0xf')](_0x3c23('0x10'),auth['isAuthenticated'](),controller[_0x3c23('0x11')]);module[_0x3c23('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 58d99ed..3c1fdd3 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 _0x457b=['exports','STRING','DATE'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x457b,0x1b6));var _0xb457=function(_0x16a154,_0x40df38){_0x16a154=_0x16a154-0x0;var _0x5b674c=_0x457b[_0x16a154];return _0x5b674c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xb457('0x0')]={'uniqueid':{'type':Sequelize[_0xb457('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb457('0x1')]},'joinAt':{'type':Sequelize[_0xb457('0x2')]},'leaveAt':{'type':Sequelize[_0xb457('0x2')]},'acceptAt':{'type':Sequelize[_0xb457('0x2')]},'exitAt':{'type':Sequelize[_0xb457('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa48b=['STRING','moment','sequelize','exports','DATE'];(function(_0x28b384,_0x414f5f){var _0x436003=function(_0x138f41){while(--_0x138f41){_0x28b384['push'](_0x28b384['shift']());}};_0x436003(++_0x414f5f);}(_0xa48b,0xc4));var _0xba48=function(_0x1a72de,_0x427b56){_0x1a72de=_0x1a72de-0x0;var _0x34f762=_0xa48b[_0x1a72de];return _0x34f762;};'use strict';var moment=require(_0xba48('0x0'));var Sequelize=require(_0xba48('0x1'));module[_0xba48('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba48('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba48('0x3')]},'reason':{'type':Sequelize[_0xba48('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d0fa221..65f5642 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 _0xdf55=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x5f0bb6,_0x1874a9){var _0x14cdcf=function(_0x4373e9){while(--_0x4373e9){_0x5f0bb6['push'](_0x5f0bb6['shift']());}};_0x14cdcf(++_0x1874a9);}(_0xdf55,0x83));var _0x5df5=function(_0x1e6ca5,_0xfb9d62){_0x1e6ca5=_0x1e6ca5-0x0;var _0xf1e27=_0xdf55[_0x1e6ca5];return _0xf1e27;};'use strict';var emlformat=require(_0x5df5('0x0'));var rimraf=require(_0x5df5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5df5('0x2'));var rp=require(_0x5df5('0x3'));var moment=require('moment');var BPromise=require(_0x5df5('0x4'));var Mustache=require(_0x5df5('0x5'));var util=require(_0x5df5('0x6'));var path=require('path');var sox=require(_0x5df5('0x7'));var csv=require(_0x5df5('0x8'));var ejs=require(_0x5df5('0x9'));var fs=require('fs');var fs_extra=require(_0x5df5('0xa'));var _=require(_0x5df5('0xb'));var squel=require(_0x5df5('0xc'));var crypto=require(_0x5df5('0xd'));var jsforce=require(_0x5df5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5df5('0x8'));var querystring=require(_0x5df5('0xf'));var Papa=require(_0x5df5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5df5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df5('0x12'));var logger=require(_0x5df5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x5df5('0x14'));var licenseUtil=require(_0x5df5('0x15'));var db=require(_0x5df5('0x16'))['db'];function respondWithStatusCode(_0x4c3d6f,_0xe8bcd8){_0xe8bcd8=_0xe8bcd8||0xcc;return function(_0xb4a4fe){if(_0xb4a4fe){return _0x4c3d6f[_0x5df5('0x17')](_0xe8bcd8);}return _0x4c3d6f[_0x5df5('0x18')](_0xe8bcd8)[_0x5df5('0x19')]();};}function respondWithResult(_0x956317,_0x555d3f){_0x555d3f=_0x555d3f||0xc8;return function(_0x30fd32){if(_0x30fd32){return _0x956317['status'](_0x555d3f)[_0x5df5('0x1a')](_0x30fd32);}};}function respondWithFilteredResult(_0x33f818,_0x5b0ad9){return function(_0x3657c8){if(_0x3657c8){var _0x282d53=typeof _0x5b0ad9['offset']===_0x5df5('0x1b')&&typeof _0x5b0ad9[_0x5df5('0x1c')]==='undefined';var _0x9a52c9=_0x3657c8[_0x5df5('0x1d')];var _0xb7e1c2=_0x282d53?0x0:_0x5b0ad9[_0x5df5('0x1e')];var _0x215d59=_0x282d53?_0x3657c8['count']:_0x5b0ad9['offset']+_0x5b0ad9[_0x5df5('0x1c')];var _0x5d8dfd;if(_0x215d59>=_0x9a52c9){_0x215d59=_0x9a52c9;_0x5d8dfd=0xc8;}else{_0x5d8dfd=0xce;}_0x33f818[_0x5df5('0x18')](_0x5d8dfd);return _0x33f818[_0x5df5('0x1f')](_0x5df5('0x20'),_0xb7e1c2+'-'+_0x215d59+'/'+_0x9a52c9)[_0x5df5('0x1a')](_0x3657c8);}return null;};}function patchUpdates(_0x1deae7){return function(_0x4b4b57){try{jsonpatch[_0x5df5('0x21')](_0x4b4b57,_0x1deae7,!![]);}catch(_0x39d8a1){return BPromise[_0x5df5('0x22')](_0x39d8a1);}return _0x4b4b57[_0x5df5('0x23')]();};}function saveUpdates(_0x28efc8,_0x382999){return function(_0x59ff67){if(_0x59ff67){return _0x59ff67[_0x5df5('0x24')](_0x28efc8)[_0x5df5('0x25')](function(_0x8742a7){return _0x8742a7;});}return null;};}function removeEntity(_0x446bba,_0x5ca542){return function(_0x4358ba){if(_0x4358ba){return _0x4358ba[_0x5df5('0x26')]()[_0x5df5('0x25')](function(){_0x446bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x532923,_0x357fb0){return function(_0x3ff82e){if(!_0x3ff82e){_0x532923[_0x5df5('0x17')](0x194);}return _0x3ff82e;};}function handleError(_0xa7f4b3,_0x1baf52){_0x1baf52=_0x1baf52||0x1f4;return function(_0x1fd83c){logger[_0x5df5('0x27')](_0x1fd83c[_0x5df5('0x28')]);if(_0x1fd83c['name']){delete _0x1fd83c[_0x5df5('0x29')];}_0xa7f4b3['status'](_0x1baf52)[_0x5df5('0x2a')](_0x1fd83c);};}exports[_0x5df5('0x2b')]=function(_0x5bc181,_0x3854d0){var _0x4945c6={},_0xd2b213={},_0x4cccf1={'count':0x0,'rows':[]};var _0x2e1885=_['map'](db[_0x5df5('0x2c')]['rawAttributes'],function(_0x2f91e3){return{'name':_0x2f91e3[_0x5df5('0x2d')],'type':_0x2f91e3[_0x5df5('0x2e')]['key']};});_0xd2b213[_0x5df5('0x2f')]=_[_0x5df5('0x30')](_0x2e1885,_0x5df5('0x29'));_0xd2b213[_0x5df5('0x31')]=_[_0x5df5('0x32')](_0x5bc181[_0x5df5('0x31')]);_0xd2b213[_0x5df5('0x33')]=_['intersection'](_0xd2b213['model'],_0xd2b213[_0x5df5('0x31')]);_0x4945c6[_0x5df5('0x34')]=_[_0x5df5('0x35')](_0xd2b213[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x5bc181[_0x5df5('0x31')]['fields']));_0x4945c6[_0x5df5('0x34')]=_0x4945c6[_0x5df5('0x34')][_0x5df5('0x37')]?_0x4945c6[_0x5df5('0x34')]:_0xd2b213['model'];if(!_0x5bc181[_0x5df5('0x31')]['hasOwnProperty'](_0x5df5('0x38'))){_0x4945c6[_0x5df5('0x1c')]=qs['limit'](_0x5bc181[_0x5df5('0x31')]['limit']);_0x4945c6[_0x5df5('0x1e')]=qs[_0x5df5('0x1e')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x1e')]);}_0x4945c6['order']=qs[_0x5df5('0x39')](_0x5bc181[_0x5df5('0x31')][_0x5df5('0x39')]);_0x4945c6[_0x5df5('0x3a')]=qs['filters'](_[_0x5df5('0x3b')](_0x5bc181[_0x5df5('0x31')],_0xd2b213[_0x5df5('0x33')]),_0x2e1885);if(_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]){_0x4945c6[_0x5df5('0x3a')]=_[_0x5df5('0x3d')](_0x4945c6['where'],{'$or':_[_0x5df5('0x30')](_0x2e1885,function(_0x3102c7){if(_0x3102c7['type']!==_0x5df5('0x3e')){var _0x217844={};_0x217844[_0x3102c7['name']]={'$like':'%'+_0x5bc181[_0x5df5('0x31')][_0x5df5('0x3c')]+'%'};return _0x217844;}})});}_0x4945c6=_[_0x5df5('0x3d')]({},_0x4945c6,_0x5bc181[_0x5df5('0x3f')]);var _0x235f3e={'where':_0x4945c6[_0x5df5('0x3a')]};return db[_0x5df5('0x2c')][_0x5df5('0x1d')](_0x235f3e)['then'](function(_0x5e6c93){_0x4cccf1[_0x5df5('0x1d')]=_0x5e6c93;if(_0x5bc181['query'][_0x5df5('0x40')]){_0x4945c6[_0x5df5('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0x5df5('0x42')](_0x4945c6);})[_0x5df5('0x25')](function(_0x23e592){_0x4cccf1[_0x5df5('0x43')]=_0x23e592;return _0x4cccf1;})[_0x5df5('0x25')](respondWithFilteredResult(_0x3854d0,_0x4945c6))[_0x5df5('0x44')](handleError(_0x3854d0,null));};exports[_0x5df5('0x45')]=function(_0x3902a1,_0x5824c3){var _0x42b562={'raw':!![],'where':{'id':_0x3902a1[_0x5df5('0x46')]['id']}},_0x4a4057={};_0x4a4057[_0x5df5('0x2f')]=_[_0x5df5('0x32')](db[_0x5df5('0x2c')][_0x5df5('0x47')]);_0x4a4057['query']=_[_0x5df5('0x32')](_0x3902a1[_0x5df5('0x31')]);_0x4a4057[_0x5df5('0x33')]=_['intersection'](_0x4a4057[_0x5df5('0x2f')],_0x4a4057[_0x5df5('0x31')]);_0x42b562['attributes']=_[_0x5df5('0x35')](_0x4a4057[_0x5df5('0x2f')],qs[_0x5df5('0x36')](_0x3902a1[_0x5df5('0x31')]['fields']));_0x42b562[_0x5df5('0x34')]=_0x42b562[_0x5df5('0x34')]['length']?_0x42b562[_0x5df5('0x34')]:_0x4a4057[_0x5df5('0x2f')];if(_0x3902a1[_0x5df5('0x31')]['includeAll']){_0x42b562[_0x5df5('0x41')]=[{'all':!![]}];}_0x42b562=_[_0x5df5('0x3d')]({},_0x42b562,_0x3902a1[_0x5df5('0x3f')]);return db[_0x5df5('0x2c')]['find'](_0x42b562)[_0x5df5('0x25')](handleEntityNotFound(_0x5824c3,null))[_0x5df5('0x25')](respondWithResult(_0x5824c3,null))[_0x5df5('0x44')](handleError(_0x5824c3,null));};exports[_0x5df5('0x48')]=function(_0x14f9ca,_0x5f44cb){return db['MailQueueReport'][_0x5df5('0x48')](_0x14f9ca['body'],{})[_0x5df5('0x25')](respondWithResult(_0x5f44cb,0xc9))[_0x5df5('0x44')](handleError(_0x5f44cb,null));};exports[_0x5df5('0x24')]=function(_0x28108e,_0x48462e){if(_0x28108e[_0x5df5('0x49')]['id']){delete _0x28108e[_0x5df5('0x49')]['id'];}return db[_0x5df5('0x2c')][_0x5df5('0x4a')]({'where':{'id':_0x28108e[_0x5df5('0x46')]['id']}})[_0x5df5('0x25')](handleEntityNotFound(_0x48462e,null))['then'](saveUpdates(_0x28108e[_0x5df5('0x49')],null))['then'](respondWithResult(_0x48462e,null))[_0x5df5('0x44')](handleError(_0x48462e,null));};exports[_0x5df5('0x26')]=function(_0x17288f,_0x4d1ebd){return db[_0x5df5('0x2c')]['find']({'where':{'id':_0x17288f[_0x5df5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d1ebd,null))[_0x5df5('0x25')](removeEntity(_0x4d1ebd,null))[_0x5df5('0x44')](handleError(_0x4d1ebd,null));};exports[_0x5df5('0x4b')]=function(_0x5997c1,_0x3d92a3){return db[_0x5df5('0x2c')]['describe']()[_0x5df5('0x25')](respondWithResult(_0x3d92a3,null))[_0x5df5('0x44')](handleError(_0x3d92a3,null));}; \ No newline at end of file +var _0xb145=['includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','MailQueueReport','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x17ffb7,_0xec2320){var _0x351813=function(_0x1c5d0d){while(--_0x1c5d0d){_0x17ffb7['push'](_0x17ffb7['shift']());}};_0x351813(++_0xec2320);}(_0xb145,0xa3));var _0x5b14=function(_0x4cdb0f,_0x3d1080){_0x4cdb0f=_0x4cdb0f-0x0;var _0x7f81d9=_0xb145[_0x4cdb0f];return _0x7f81d9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];function respondWithStatusCode(_0x1903a5,_0xc33723){_0xc33723=_0xc33723||0xcc;return function(_0x1cb56b){if(_0x1cb56b){return _0x1903a5[_0x5b14('0x19')](_0xc33723);}return _0x1903a5[_0x5b14('0x1a')](_0xc33723)['end']();};}function respondWithResult(_0x27b34b,_0x16f2a1){_0x16f2a1=_0x16f2a1||0xc8;return function(_0x35fb8b){if(_0x35fb8b){return _0x27b34b[_0x5b14('0x1a')](_0x16f2a1)[_0x5b14('0x1b')](_0x35fb8b);}};}function respondWithFilteredResult(_0x2a8fe5,_0x68f695){return function(_0xe5af75){if(_0xe5af75){var _0x183b0a=typeof _0x68f695[_0x5b14('0x1c')]===_0x5b14('0x1d')&&typeof _0x68f695[_0x5b14('0x1e')]==='undefined';var _0x24cfd0=_0xe5af75['count'];var _0x48d395=_0x183b0a?0x0:_0x68f695['offset'];var _0x3f397d=_0x183b0a?_0xe5af75[_0x5b14('0x1f')]:_0x68f695[_0x5b14('0x1c')]+_0x68f695[_0x5b14('0x1e')];var _0x3786f7;if(_0x3f397d>=_0x24cfd0){_0x3f397d=_0x24cfd0;_0x3786f7=0xc8;}else{_0x3786f7=0xce;}_0x2a8fe5[_0x5b14('0x1a')](_0x3786f7);return _0x2a8fe5[_0x5b14('0x20')]('Content-Range',_0x48d395+'-'+_0x3f397d+'/'+_0x24cfd0)['json'](_0xe5af75);}return null;};}function patchUpdates(_0x4fa079){return function(_0x4f4717){try{jsonpatch[_0x5b14('0x21')](_0x4f4717,_0x4fa079,!![]);}catch(_0x9a9495){return BPromise[_0x5b14('0x22')](_0x9a9495);}return _0x4f4717['save']();};}function saveUpdates(_0x1018d9,_0x1577f7){return function(_0x4857c7){if(_0x4857c7){return _0x4857c7[_0x5b14('0x23')](_0x1018d9)[_0x5b14('0x24')](function(_0x50951f){return _0x50951f;});}return null;};}function removeEntity(_0x33a293,_0x54073f){return function(_0x59282c){if(_0x59282c){return _0x59282c['destroy']()['then'](function(){_0x33a293[_0x5b14('0x1a')](0xcc)[_0x5b14('0x25')]();});}};}function handleEntityNotFound(_0x153a25,_0x5da505){return function(_0x46f86a){if(!_0x46f86a){_0x153a25[_0x5b14('0x19')](0x194);}return _0x46f86a;};}function handleError(_0x2ac7b0,_0x143648){_0x143648=_0x143648||0x1f4;return function(_0xe6851b){logger[_0x5b14('0x26')](_0xe6851b[_0x5b14('0x27')]);if(_0xe6851b[_0x5b14('0x28')]){delete _0xe6851b[_0x5b14('0x28')];}_0x2ac7b0[_0x5b14('0x1a')](_0x143648)[_0x5b14('0x29')](_0xe6851b);};}exports[_0x5b14('0x2a')]=function(_0x1c3c52,_0x266bbe){var _0x4cfd66={},_0x370fcd={},_0x18a76d={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x5b14('0x2b')][_0x5b14('0x2c')],function(_0x5dca4f){return{'name':_0x5dca4f['fieldName'],'type':_0x5dca4f[_0x5b14('0x2d')]['key']};});_0x370fcd[_0x5b14('0x2e')]=_[_0x5b14('0x2f')](_0x53b13d,'name');_0x370fcd['query']=_[_0x5b14('0x30')](_0x1c3c52[_0x5b14('0x31')]);_0x370fcd[_0x5b14('0x32')]=_['intersection'](_0x370fcd[_0x5b14('0x2e')],_0x370fcd['query']);_0x4cfd66[_0x5b14('0x33')]=_[_0x5b14('0x34')](_0x370fcd[_0x5b14('0x2e')],qs[_0x5b14('0x35')](_0x1c3c52['query'][_0x5b14('0x35')]));_0x4cfd66[_0x5b14('0x33')]=_0x4cfd66[_0x5b14('0x33')][_0x5b14('0x36')]?_0x4cfd66['attributes']:_0x370fcd[_0x5b14('0x2e')];if(!_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x37')]('nolimit')){_0x4cfd66[_0x5b14('0x1e')]=qs['limit'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x1e')]);_0x4cfd66['offset']=qs[_0x5b14('0x1c')](_0x1c3c52[_0x5b14('0x31')]['offset']);}_0x4cfd66[_0x5b14('0x38')]=qs['sort'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x39')]);_0x4cfd66[_0x5b14('0x3a')]=qs[_0x5b14('0x32')](_['pick'](_0x1c3c52[_0x5b14('0x31')],_0x370fcd[_0x5b14('0x32')]),_0x53b13d);if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]){_0x4cfd66[_0x5b14('0x3a')]=_[_0x5b14('0x3c')](_0x4cfd66[_0x5b14('0x3a')],{'$or':_[_0x5b14('0x2f')](_0x53b13d,function(_0x4f647c){if(_0x4f647c[_0x5b14('0x2d')]!==_0x5b14('0x3d')){var _0x3f9d1d={};_0x3f9d1d[_0x4f647c[_0x5b14('0x28')]]={'$like':'%'+_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]+'%'};return _0x3f9d1d;}})});}_0x4cfd66=_[_0x5b14('0x3c')]({},_0x4cfd66,_0x1c3c52['options']);var _0x2ebaa8={'where':_0x4cfd66['where']};return db[_0x5b14('0x2b')][_0x5b14('0x1f')](_0x2ebaa8)['then'](function(_0x4c05ac){_0x18a76d['count']=_0x4c05ac;if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3e')]){_0x4cfd66['include']=[{'all':!![]}];}return db[_0x5b14('0x2b')][_0x5b14('0x3f')](_0x4cfd66);})[_0x5b14('0x24')](function(_0x3d0369){_0x18a76d[_0x5b14('0x40')]=_0x3d0369;return _0x18a76d;})['then'](respondWithFilteredResult(_0x266bbe,_0x4cfd66))[_0x5b14('0x41')](handleError(_0x266bbe,null));};exports[_0x5b14('0x42')]=function(_0x4fb46e,_0x996aee){var _0x985e69={'raw':!![],'where':{'id':_0x4fb46e[_0x5b14('0x43')]['id']}},_0x5cc257={};_0x5cc257['model']=_[_0x5b14('0x30')](db[_0x5b14('0x2b')][_0x5b14('0x2c')]);_0x5cc257[_0x5b14('0x31')]=_['keys'](_0x4fb46e[_0x5b14('0x31')]);_0x5cc257[_0x5b14('0x32')]=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],_0x5cc257['query']);_0x985e69['attributes']=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],qs['fields'](_0x4fb46e[_0x5b14('0x31')]['fields']));_0x985e69[_0x5b14('0x33')]=_0x985e69[_0x5b14('0x33')][_0x5b14('0x36')]?_0x985e69[_0x5b14('0x33')]:_0x5cc257[_0x5b14('0x2e')];if(_0x4fb46e['query'][_0x5b14('0x3e')]){_0x985e69[_0x5b14('0x44')]=[{'all':!![]}];}_0x985e69=_[_0x5b14('0x3c')]({},_0x985e69,_0x4fb46e[_0x5b14('0x45')]);return db[_0x5b14('0x2b')]['find'](_0x985e69)['then'](handleEntityNotFound(_0x996aee,null))[_0x5b14('0x24')](respondWithResult(_0x996aee,null))['catch'](handleError(_0x996aee,null));};exports['create']=function(_0x4825b4,_0x35d00d){return db[_0x5b14('0x2b')][_0x5b14('0x46')](_0x4825b4[_0x5b14('0x47')],{})[_0x5b14('0x24')](respondWithResult(_0x35d00d,0xc9))[_0x5b14('0x41')](handleError(_0x35d00d,null));};exports[_0x5b14('0x23')]=function(_0x4d2bee,_0x548e1c){if(_0x4d2bee['body']['id']){delete _0x4d2bee['body']['id'];}return db['MailQueueReport'][_0x5b14('0x48')]({'where':{'id':_0x4d2bee[_0x5b14('0x43')]['id']}})[_0x5b14('0x24')](handleEntityNotFound(_0x548e1c,null))[_0x5b14('0x24')](saveUpdates(_0x4d2bee[_0x5b14('0x47')],null))['then'](respondWithResult(_0x548e1c,null))['catch'](handleError(_0x548e1c,null));};exports[_0x5b14('0x49')]=function(_0xd6ea50,_0x58b18e){return db[_0x5b14('0x2b')][_0x5b14('0x48')]({'where':{'id':_0xd6ea50['params']['id']}})['then'](handleEntityNotFound(_0x58b18e,null))[_0x5b14('0x24')](removeEntity(_0x58b18e,null))[_0x5b14('0x41')](handleError(_0x58b18e,null));};exports[_0x5b14('0x4a')]=function(_0x5d3782,_0x1a51d5){return db[_0x5b14('0x2b')][_0x5b14('0x4a')]()[_0x5b14('0x24')](respondWithResult(_0x1a51d5,null))[_0x5b14('0x41')](handleError(_0x1a51d5,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 721a407..ef213cb 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 _0x0bba=['MailQueueReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','./mailQueueReport.attributes','exports','define'];(function(_0x14b767,_0x577e84){var _0x22267a=function(_0xa87ebc){while(--_0xa87ebc){_0x14b767['push'](_0x14b767['shift']());}};_0x22267a(++_0x577e84);}(_0x0bba,0xe9));var _0xa0bb=function(_0x3adee3,_0x5bda11){_0x3adee3=_0x3adee3-0x0;var _0x15605a=_0x0bba[_0x3adee3];return _0x15605a;};'use strict';var _=require(_0xa0bb('0x0'));var util=require(_0xa0bb('0x1'));var logger=require(_0xa0bb('0x2'))('api');var moment=require(_0xa0bb('0x3'));var BPromise=require('bluebird');var rp=require(_0xa0bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0bb('0x5'));var config=require('../../config/environment');var attributes=require(_0xa0bb('0x6'));module[_0xa0bb('0x7')]=function(_0x3e0c8f,_0x28c5d2){return _0x3e0c8f[_0xa0bb('0x8')](_0xa0bb('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xa0bb('0xa'),'fields':[_0xa0bb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6bfc=['bluebird','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api'];(function(_0xdeb19d,_0x23a222){var _0x538674=function(_0x2c4cb8){while(--_0x2c4cb8){_0xdeb19d['push'](_0xdeb19d['shift']());}};_0x538674(++_0x23a222);}(_0x6bfc,0x159));var _0xc6bf=function(_0x1cf7bc,_0x5c2a8b){_0x1cf7bc=_0x1cf7bc-0x0;var _0x297670=_0x6bfc[_0x1cf7bc];return _0x297670;};'use strict';var _=require('lodash');var util=require(_0xc6bf('0x0'));var logger=require(_0xc6bf('0x1'))(_0xc6bf('0x2'));var moment=require('moment');var BPromise=require(_0xc6bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6bf('0x4'));var rimraf=require('rimraf');var config=require(_0xc6bf('0x5'));var attributes=require(_0xc6bf('0x6'));module[_0xc6bf('0x7')]=function(_0x4a999e,_0x27a5d9){return _0x4a999e[_0xc6bf('0x8')](_0xc6bf('0x9'),attributes,{'tableName':_0xc6bf('0xa'),'paranoid':![],'indexes':[{'name':_0xc6bf('0xb'),'fields':[_0xc6bf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 9dab263..09c3296 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x26c334,_0x4ebb05){var _0x145c7b=function(_0x34bf49){while(--_0x34bf49){_0x26c334['push'](_0x26c334['shift']());}};_0x145c7b(++_0x4ebb05);}(_0x326f,0xd1));var _0xf326=function(_0x5a0026,_0xbb4a94){_0x5a0026=_0x5a0026-0x0;var _0x3ced18=_0x326f[_0x5a0026];return _0x3ced18;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ 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(_0x4f4433,_0x20a5c3){var _0x17d83e=function(_0x4b519d){while(--_0x4b519d){_0x4f4433['push'](_0x4f4433['shift']());}};_0x17d83e(++_0x20a5c3);}(_0xadb5,0xad));var _0x5adb=function(_0x49fadd,_0x5c6f85){_0x49fadd=_0x49fadd-0x0;var _0x48eff3=_0xadb5[_0x49fadd];return _0x48eff3;};'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 32ec81d..a65358e 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4da6c4,_0x2f2213){var _0x48feaa=function(_0x4b42af){while(--_0x4b42af){_0x4da6c4['push'](_0x4da6c4['shift']());}};_0x48feaa(++_0x2f2213);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xbf6c00,_0x4e6044){var _0xa24b7=function(_0xa76ef5){while(--_0xa76ef5){_0xbf6c00['push'](_0xbf6c00['shift']());}};_0xa24b7(++_0x4e6044);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xe6e78c,_0x582369){_0xe6e78c=_0xe6e78c-0x0;var _0x2a09c8=_0xcb91[_0xe6e78c];return _0x2a09c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c16ca7e..4871697 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 _0x41f7=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xf8935d,_0x5cdb50){var _0x2d25b8=function(_0x416964){while(--_0x416964){_0xf8935d['push'](_0xf8935d['shift']());}};_0x2d25b8(++_0x5cdb50);}(_0x41f7,0x1c5));var _0x741f=function(_0x202b50,_0x1d440b){_0x202b50=_0x202b50-0x0;var _0x4436ef=_0x41f7[_0x202b50];return _0x4436ef;};'use strict';var Sequelize=require(_0x741f('0x0'));module[_0x741f('0x1')]={'description':{'type':Sequelize[_0x741f('0x2')]},'host':{'type':Sequelize[_0x741f('0x2')]},'authentication':{'type':Sequelize[_0x741f('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x741f('0x2')]},'password':{'type':Sequelize[_0x741f('0x2')]},'port':{'type':Sequelize[_0x741f('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x741f('0x2')]},'modernAuthentication':{'type':Sequelize[_0x741f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x618b=['BOOLEAN','STRING','INTEGER','sequelize','exports'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x618b,0x14d));var _0xb618=function(_0x2b829b,_0x1c2d52){_0x2b829b=_0x2b829b-0x0;var _0x3e951f=_0x618b[_0x2b829b];return _0x3e951f;};'use strict';var Sequelize=require(_0xb618('0x0'));module[_0xb618('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb618('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xb618('0x3')]},'password':{'type':Sequelize[_0xb618('0x3')]},'port':{'type':Sequelize[_0xb618('0x4')]},'tls':{'type':Sequelize[_0xb618('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb618('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb618('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index b789099..84bbf8a 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 _0x4a0c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger'];(function(_0x1a68e7,_0x379dc3){var _0x3b66f3=function(_0x4b00ae){while(--_0x4b00ae){_0x1a68e7['push'](_0x1a68e7['shift']());}};_0x3b66f3(++_0x379dc3);}(_0x4a0c,0x1e7));var _0xc4a0=function(_0x46ff3f,_0xcc4d4a){_0x46ff3f=_0x46ff3f-0x0;var _0x1a7e94=_0x4a0c[_0x46ff3f];return _0x1a7e94;};'use strict';var _=require(_0xc4a0('0x0'));var util=require(_0xc4a0('0x1'));var logger=require(_0xc4a0('0x2'))(_0xc4a0('0x3'));var moment=require(_0xc4a0('0x4'));var BPromise=require(_0xc4a0('0x5'));var rp=require(_0xc4a0('0x6'));var fs=require('fs');var path=require(_0xc4a0('0x7'));var rimraf=require(_0xc4a0('0x8'));var config=require(_0xc4a0('0x9'));var attributes=require(_0xc4a0('0xa'));module[_0xc4a0('0xb')]=function(_0x1f2e87,_0x4834e4){return _0x1f2e87[_0xc4a0('0xc')](_0xc4a0('0xd'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf25=['api','moment','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger'];(function(_0x5e10b1,_0x48b784){var _0x5c8830=function(_0x42f942){while(--_0x42f942){_0x5e10b1['push'](_0x5e10b1['shift']());}};_0x5c8830(++_0x48b784);}(_0xcf25,0xb3));var _0x5cf2=function(_0x24f4c4,_0x17e225){_0x24f4c4=_0x24f4c4-0x0;var _0x5f4a99=_0xcf25[_0x24f4c4];return _0x5f4a99;};'use strict';var _=require(_0x5cf2('0x0'));var util=require(_0x5cf2('0x1'));var logger=require(_0x5cf2('0x2'))(_0x5cf2('0x3'));var moment=require(_0x5cf2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cf2('0x5'));var rimraf=require(_0x5cf2('0x6'));var config=require(_0x5cf2('0x7'));var attributes=require(_0x5cf2('0x8'));module[_0x5cf2('0x9')]=function(_0x5cd4a3,_0x10b0ce){return _0x5cd4a3[_0x5cf2('0xa')](_0x5cf2('0xb'),attributes,{'tableName':_0x5cf2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index f7912e6..71bc8ab 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 _0x90db=['message','result','catch','GetMailServerIn','options','raw','where','attributes','limit','include','map','model','debug','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x90db,0x1c0));var _0xb90d=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x90db[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require('lodash');var util=require(_0xb90d('0x0'));var moment=require(_0xb90d('0x1'));var BPromise=require(_0xb90d('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')(_0xb90d('0x3'));var config=require(_0xb90d('0x4'));var jayson=require(_0xb90d('0x5'));var client=jayson[_0xb90d('0x6')][_0xb90d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d8398,_0x180781,_0x126e17){return new BPromise(function(_0x2ef5e6,_0x108b88){return client[_0xb90d('0x8')](_0x2d8398,_0x126e17)[_0xb90d('0x9')](function(_0x48c4f6){logger[_0xb90d('0xa')](_0xb90d('0xb'),_0x180781,_0xb90d('0xc'));logger['debug'](_0xb90d('0xd'),_0x180781,_0xb90d('0xc'),JSON[_0xb90d('0xe')](_0x48c4f6));if(_0x48c4f6[_0xb90d('0xf')]){if(_0x48c4f6[_0xb90d('0xf')]['code']===0x1f4){logger[_0xb90d('0xf')]('MailServerIn,\x20%s,\x20%s',_0x180781,_0x48c4f6[_0xb90d('0xf')][_0xb90d('0x10')]);return _0x108b88(_0x48c4f6[_0xb90d('0xf')][_0xb90d('0x10')]);}logger[_0xb90d('0xf')](_0xb90d('0xb'),_0x180781,_0x48c4f6[_0xb90d('0xf')]['message']);return _0x2ef5e6(_0x48c4f6[_0xb90d('0xf')]['message']);}else{logger[_0xb90d('0xa')](_0xb90d('0xb'),_0x180781,'request\x20sent');_0x2ef5e6(_0x48c4f6[_0xb90d('0x11')]['message']);}})[_0xb90d('0x12')](function(_0x396f3f){logger[_0xb90d('0xf')](_0xb90d('0xb'),_0x180781,_0x396f3f);_0x108b88(_0x396f3f);});});}exports[_0xb90d('0x13')]=function(_0x47ee5d){var _0x135bf2=this;return new Promise(function(_0x4bd383,_0x2cd352){return db['MailServerIn']['findAll']({'raw':_0x47ee5d[_0xb90d('0x14')]?_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x15')]===undefined?!![]:![]:!![],'where':_0x47ee5d[_0xb90d('0x14')]?_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x16')]||null:null,'attributes':_0x47ee5d['options']?_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x17')]||null:null,'limit':_0x47ee5d['options']?_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x18')]||null:null,'include':_0x47ee5d[_0xb90d('0x14')]?_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x19')]?_[_0xb90d('0x1a')](_0x47ee5d[_0xb90d('0x14')][_0xb90d('0x19')],function(_0x37b8ec){return{'model':db[_0x37b8ec[_0xb90d('0x1b')]],'as':_0x37b8ec['as'],'attributes':_0x37b8ec[_0xb90d('0x17')],'include':_0x37b8ec[_0xb90d('0x19')]?_[_0xb90d('0x1a')](_0x37b8ec['include'],function(_0x280ec3){return{'model':db[_0x280ec3['model']],'as':_0x280ec3['as'],'attributes':_0x280ec3[_0xb90d('0x17')],'include':_0x280ec3[_0xb90d('0x19')]?_[_0xb90d('0x1a')](_0x280ec3[_0xb90d('0x19')],function(_0x31aee9){return{'model':db[_0x31aee9[_0xb90d('0x1b')]],'as':_0x31aee9['as'],'attributes':_0x31aee9[_0xb90d('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb90d('0x9')](function(_0x29d8ea){logger[_0xb90d('0xa')]('GetMailServerIn',_0x47ee5d);logger[_0xb90d('0x1c')](_0xb90d('0x13'),_0x47ee5d,JSON[_0xb90d('0xe')](_0x29d8ea));_0x4bd383(_0x29d8ea);})[_0xb90d('0x12')](function(_0x1f9151){logger[_0xb90d('0xf')]('GetMailServerIn',_0x1f9151['message'],_0x47ee5d);_0x2cd352(_0x135bf2['error'](0x1f4,_0x1f9151[_0xb90d('0x10')]));});});}; \ No newline at end of file +var _0x20bc=['catch','GetMailServerIn','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x52ab84,_0x384d32){var _0x481d6a=function(_0x2dc2cc){while(--_0x2dc2cc){_0x52ab84['push'](_0x52ab84['shift']());}};_0x481d6a(++_0x384d32);}(_0x20bc,0xb5));var _0xc20b=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x20bc[_0x263f9d];return _0x4c4efa;};'use strict';var _=require(_0xc20b('0x0'));var util=require(_0xc20b('0x1'));var moment=require('moment');var BPromise=require(_0xc20b('0x2'));var rs=require(_0xc20b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc20b('0x4'))['db'];var utils=require(_0xc20b('0x5'));var logger=require(_0xc20b('0x6'))(_0xc20b('0x7'));var config=require(_0xc20b('0x8'));var jayson=require(_0xc20b('0x9'));var client=jayson[_0xc20b('0xa')][_0xc20b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c171b,_0x16db57,_0x30d929){return new BPromise(function(_0x15a272,_0x65d1f8){return client['request'](_0x3c171b,_0x30d929)[_0xc20b('0xc')](function(_0x974295){logger['info'](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));logger[_0xc20b('0xf')](_0xc20b('0x10'),_0x16db57,'request\x20sent',JSON[_0xc20b('0x11')](_0x974295));if(_0x974295[_0xc20b('0x12')]){if(_0x974295['error'][_0xc20b('0x13')]===0x1f4){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x65d1f8(_0x974295[_0xc20b('0x12')]['message']);}logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x15a272(_0x974295['error']['message']);}else{logger[_0xc20b('0x15')](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));_0x15a272(_0x974295[_0xc20b('0x16')]['message']);}})[_0xc20b('0x17')](function(_0x37c42f){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x37c42f);_0x65d1f8(_0x37c42f);});});}exports[_0xc20b('0x18')]=function(_0x5e349c){var _0x541ebe=this;return new Promise(function(_0x583e3f,_0x3ecba2){return db['MailServerIn'][_0xc20b('0x19')]({'raw':_0x5e349c[_0xc20b('0x1a')]?_0x5e349c[_0xc20b('0x1a')][_0xc20b('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e349c['options']?_0x5e349c[_0xc20b('0x1a')][_0xc20b('0x1c')]||null:null,'attributes':_0x5e349c[_0xc20b('0x1a')]?_0x5e349c['options']['attributes']||null:null,'limit':_0x5e349c[_0xc20b('0x1a')]?_0x5e349c[_0xc20b('0x1a')][_0xc20b('0x1d')]||null:null,'include':_0x5e349c[_0xc20b('0x1a')]?_0x5e349c[_0xc20b('0x1a')][_0xc20b('0x1e')]?_[_0xc20b('0x1f')](_0x5e349c[_0xc20b('0x1a')]['include'],function(_0x324796){return{'model':db[_0x324796[_0xc20b('0x20')]],'as':_0x324796['as'],'attributes':_0x324796[_0xc20b('0x21')],'include':_0x324796[_0xc20b('0x1e')]?_[_0xc20b('0x1f')](_0x324796[_0xc20b('0x1e')],function(_0x1d1704){return{'model':db[_0x1d1704[_0xc20b('0x20')]],'as':_0x1d1704['as'],'attributes':_0x1d1704[_0xc20b('0x21')],'include':_0x1d1704[_0xc20b('0x1e')]?_['map'](_0x1d1704[_0xc20b('0x1e')],function(_0x58881c){return{'model':db[_0x58881c[_0xc20b('0x20')]],'as':_0x58881c['as'],'attributes':_0x58881c[_0xc20b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54aba5){logger[_0xc20b('0x15')](_0xc20b('0x18'),_0x5e349c);logger['debug'](_0xc20b('0x18'),_0x5e349c,JSON[_0xc20b('0x11')](_0x54aba5));_0x583e3f(_0x54aba5);})[_0xc20b('0x17')](function(_0x49af8d){logger[_0xc20b('0x12')]('GetMailServerIn',_0x49af8d[_0xc20b('0x14')],_0x5e349c);_0x3ecba2(_0x541ebe[_0xc20b('0x12')](0x1f4,_0x49af8d['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 5518631..a3a1605 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x368984,_0x4ca8c6){_0x368984=_0x368984-0x0;var _0x2faea3=_0x7a54[_0x368984];return _0x2faea3;};'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(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7a54,0x106));var _0x47a5=function(_0x272b3a,_0x19d313){_0x272b3a=_0x272b3a-0x0;var _0x502bfd=_0x7a54[_0x272b3a];return _0x502bfd;};'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 b24df07..724f9bf 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 _0x2547=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x2547,0x1cd));var _0x7254=function(_0x401856,_0x57189c){_0x401856=_0x401856-0x0;var _0x5f0d0d=_0x2547[_0x401856];return _0x5f0d0d;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'description':{'type':Sequelize[_0x7254('0x1')]},'host':{'type':Sequelize[_0x7254('0x1')]},'user':{'type':Sequelize[_0x7254('0x1')]},'pass':{'type':Sequelize[_0x7254('0x1')]},'port':{'type':Sequelize[_0x7254('0x2')]},'secure':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x7254('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf45e=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x49b73b,_0x1ad0e7){var _0x4f7344=function(_0x5cb780){while(--_0x5cb780){_0x49b73b['push'](_0x49b73b['shift']());}};_0x4f7344(++_0x1ad0e7);}(_0xf45e,0x115));var _0xef45=function(_0x3637a2,_0x3de087){_0x3637a2=_0x3637a2-0x0;var _0x439550=_0xf45e[_0x3637a2];return _0x439550;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'description':{'type':Sequelize[_0xef45('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xef45('0x1')]},'pass':{'type':Sequelize[_0xef45('0x1')]},'port':{'type':Sequelize[_0xef45('0x2')]},'secure':{'type':Sequelize[_0xef45('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xef45('0x1')]},'authentication':{'type':Sequelize[_0xef45('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xef45('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 8c77123..68747b0 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 _0x7c75=['model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','rows','show','keys','rawAttributes','length','includeAll','find','create','body','catch','params','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','then','error','stack','name','index','map','MailServerOut','fieldName','key'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7c75,0x69));var _0x57c7=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7c75[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0x57c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x57c7('0x1'));var rp=require('request-promise');var moment=require(_0x57c7('0x2'));var BPromise=require(_0x57c7('0x3'));var Mustache=require(_0x57c7('0x4'));var util=require('util');var path=require(_0x57c7('0x5'));var sox=require(_0x57c7('0x6'));var csv=require(_0x57c7('0x7'));var ejs=require(_0x57c7('0x8'));var fs=require('fs');var fs_extra=require(_0x57c7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x57c7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x57c7('0x7'));var querystring=require(_0x57c7('0xb'));var Papa=require(_0x57c7('0xc'));var Redis=require(_0x57c7('0xd'));var authService=require(_0x57c7('0xe'));var qs=require(_0x57c7('0xf'));var as=require(_0x57c7('0x10'));var hardwareService=require(_0x57c7('0x11'));var logger=require(_0x57c7('0x12'))(_0x57c7('0x13'));var utils=require(_0x57c7('0x14'));var config=require(_0x57c7('0x15'));var licenseUtil=require(_0x57c7('0x16'));var db=require(_0x57c7('0x17'))['db'];function respondWithStatusCode(_0x5f2d81,_0x16a92c){_0x16a92c=_0x16a92c||0xcc;return function(_0x37f563){if(_0x37f563){return _0x5f2d81[_0x57c7('0x18')](_0x16a92c);}return _0x5f2d81['status'](_0x16a92c)[_0x57c7('0x19')]();};}function respondWithResult(_0x372f35,_0x52adc0){_0x52adc0=_0x52adc0||0xc8;return function(_0x30c3c5){if(_0x30c3c5){return _0x372f35['status'](_0x52adc0)[_0x57c7('0x1a')](_0x30c3c5);}};}function respondWithFilteredResult(_0x84518,_0x1d75b8){return function(_0x10945d){if(_0x10945d){var _0x37a98c=typeof _0x1d75b8[_0x57c7('0x1b')]==='undefined'&&typeof _0x1d75b8[_0x57c7('0x1c')]===_0x57c7('0x1d');var _0x1adaef=_0x10945d[_0x57c7('0x1e')];var _0x12bf2d=_0x37a98c?0x0:_0x1d75b8[_0x57c7('0x1b')];var _0x1322c0=_0x37a98c?_0x10945d['count']:_0x1d75b8['offset']+_0x1d75b8[_0x57c7('0x1c')];var _0x5a3ff1;if(_0x1322c0>=_0x1adaef){_0x1322c0=_0x1adaef;_0x5a3ff1=0xc8;}else{_0x5a3ff1=0xce;}_0x84518[_0x57c7('0x1f')](_0x5a3ff1);return _0x84518[_0x57c7('0x20')](_0x57c7('0x21'),_0x12bf2d+'-'+_0x1322c0+'/'+_0x1adaef)[_0x57c7('0x1a')](_0x10945d);}return null;};}function patchUpdates(_0x1964bf){return function(_0x26d34d){try{jsonpatch[_0x57c7('0x22')](_0x26d34d,_0x1964bf,!![]);}catch(_0x3f1264){return BPromise[_0x57c7('0x23')](_0x3f1264);}return _0x26d34d['save']();};}function saveUpdates(_0x391567,_0x11fe7a){return function(_0xbb811b){if(_0xbb811b){return _0xbb811b['update'](_0x391567)[_0x57c7('0x24')](function(_0x5e0f1f){return _0x5e0f1f;});}return null;};}function removeEntity(_0x7244e6,_0x4f1147){return function(_0x211b09){if(_0x211b09){return _0x211b09['destroy']()[_0x57c7('0x24')](function(){_0x7244e6['status'](0xcc)[_0x57c7('0x19')]();});}};}function handleEntityNotFound(_0x2d3659,_0x451162){return function(_0x5d241c){if(!_0x5d241c){_0x2d3659[_0x57c7('0x18')](0x194);}return _0x5d241c;};}function handleError(_0x2f12ed,_0x38edf9){_0x38edf9=_0x38edf9||0x1f4;return function(_0x4d8174){logger[_0x57c7('0x25')](_0x4d8174[_0x57c7('0x26')]);if(_0x4d8174['name']){delete _0x4d8174[_0x57c7('0x27')];}_0x2f12ed[_0x57c7('0x1f')](_0x38edf9)['send'](_0x4d8174);};}exports[_0x57c7('0x28')]=function(_0x12e250,_0x2c72dd){var _0x7986b7={},_0x32da85={},_0x3cf6e1={'count':0x0,'rows':[]};var _0x51c560=_[_0x57c7('0x29')](db[_0x57c7('0x2a')]['rawAttributes'],function(_0x58617a){return{'name':_0x58617a[_0x57c7('0x2b')],'type':_0x58617a['type'][_0x57c7('0x2c')]};});_0x32da85[_0x57c7('0x2d')]=_['map'](_0x51c560,'name');_0x32da85[_0x57c7('0x2e')]=_['keys'](_0x12e250[_0x57c7('0x2e')]);_0x32da85['filters']=_[_0x57c7('0x2f')](_0x32da85[_0x57c7('0x2d')],_0x32da85['query']);_0x7986b7[_0x57c7('0x30')]=_[_0x57c7('0x2f')](_0x32da85[_0x57c7('0x2d')],qs[_0x57c7('0x31')](_0x12e250[_0x57c7('0x2e')][_0x57c7('0x31')]));_0x7986b7[_0x57c7('0x30')]=_0x7986b7[_0x57c7('0x30')]['length']?_0x7986b7[_0x57c7('0x30')]:_0x32da85['model'];if(!_0x12e250[_0x57c7('0x2e')][_0x57c7('0x32')](_0x57c7('0x33'))){_0x7986b7[_0x57c7('0x1c')]=qs['limit'](_0x12e250['query'][_0x57c7('0x1c')]);_0x7986b7['offset']=qs[_0x57c7('0x1b')](_0x12e250[_0x57c7('0x2e')][_0x57c7('0x1b')]);}_0x7986b7[_0x57c7('0x34')]=qs['sort'](_0x12e250['query'][_0x57c7('0x35')]);_0x7986b7[_0x57c7('0x36')]=qs[_0x57c7('0x37')](_[_0x57c7('0x38')](_0x12e250[_0x57c7('0x2e')],_0x32da85[_0x57c7('0x37')]),_0x51c560);if(_0x12e250[_0x57c7('0x2e')][_0x57c7('0x39')]){_0x7986b7[_0x57c7('0x36')]=_['merge'](_0x7986b7[_0x57c7('0x36')],{'$or':_[_0x57c7('0x29')](_0x51c560,function(_0x40d63f){if(_0x40d63f[_0x57c7('0x3a')]!==_0x57c7('0x3b')){var _0x35d5ee={};_0x35d5ee[_0x40d63f[_0x57c7('0x27')]]={'$like':'%'+_0x12e250[_0x57c7('0x2e')][_0x57c7('0x39')]+'%'};return _0x35d5ee;}})});}_0x7986b7=_[_0x57c7('0x3c')]({},_0x7986b7,_0x12e250[_0x57c7('0x3d')]);var _0x2a0c1d={'where':_0x7986b7[_0x57c7('0x36')]};return db['MailServerOut'][_0x57c7('0x1e')](_0x2a0c1d)[_0x57c7('0x24')](function(_0x459771){_0x3cf6e1['count']=_0x459771;if(_0x12e250[_0x57c7('0x2e')]['includeAll']){_0x7986b7[_0x57c7('0x3e')]=[{'all':!![]}];}return db[_0x57c7('0x2a')]['findAll'](_0x7986b7);})[_0x57c7('0x24')](function(_0x12f7ca){_0x3cf6e1[_0x57c7('0x3f')]=_0x12f7ca;return _0x3cf6e1;})[_0x57c7('0x24')](respondWithFilteredResult(_0x2c72dd,_0x7986b7))['catch'](handleError(_0x2c72dd,null));};exports[_0x57c7('0x40')]=function(_0x295d17,_0x5b2374){var _0x44550f={'raw':!![],'where':{'id':_0x295d17['params']['id']}},_0x456ff7={};_0x456ff7['model']=_[_0x57c7('0x41')](db[_0x57c7('0x2a')][_0x57c7('0x42')]);_0x456ff7[_0x57c7('0x2e')]=_[_0x57c7('0x41')](_0x295d17[_0x57c7('0x2e')]);_0x456ff7[_0x57c7('0x37')]=_[_0x57c7('0x2f')](_0x456ff7[_0x57c7('0x2d')],_0x456ff7[_0x57c7('0x2e')]);_0x44550f['attributes']=_[_0x57c7('0x2f')](_0x456ff7[_0x57c7('0x2d')],qs[_0x57c7('0x31')](_0x295d17['query'][_0x57c7('0x31')]));_0x44550f[_0x57c7('0x30')]=_0x44550f[_0x57c7('0x30')][_0x57c7('0x43')]?_0x44550f[_0x57c7('0x30')]:_0x456ff7[_0x57c7('0x2d')];if(_0x295d17['query'][_0x57c7('0x44')]){_0x44550f[_0x57c7('0x3e')]=[{'all':!![]}];}_0x44550f=_[_0x57c7('0x3c')]({},_0x44550f,_0x295d17[_0x57c7('0x3d')]);return db[_0x57c7('0x2a')][_0x57c7('0x45')](_0x44550f)[_0x57c7('0x24')](handleEntityNotFound(_0x5b2374,null))[_0x57c7('0x24')](respondWithResult(_0x5b2374,null))['catch'](handleError(_0x5b2374,null));};exports[_0x57c7('0x46')]=function(_0x1467ea,_0x451b64){return db[_0x57c7('0x2a')][_0x57c7('0x46')](_0x1467ea[_0x57c7('0x47')],{})[_0x57c7('0x24')](respondWithResult(_0x451b64,0xc9))[_0x57c7('0x48')](handleError(_0x451b64,null));};exports['update']=function(_0x1be097,_0x10315d){if(_0x1be097['body']['id']){delete _0x1be097[_0x57c7('0x47')]['id'];}return db[_0x57c7('0x2a')][_0x57c7('0x45')]({'where':{'id':_0x1be097[_0x57c7('0x49')]['id']}})['then'](handleEntityNotFound(_0x10315d,null))[_0x57c7('0x24')](saveUpdates(_0x1be097[_0x57c7('0x47')],null))['then'](respondWithResult(_0x10315d,null))['catch'](handleError(_0x10315d,null));};exports[_0x57c7('0x4a')]=function(_0xc39909,_0x5c6a15){return db['MailServerOut'][_0x57c7('0x45')]({'where':{'id':_0xc39909['params']['id']}})['then'](handleEntityNotFound(_0x5c6a15,null))[_0x57c7('0x24')](removeEntity(_0x5c6a15,null))['catch'](handleError(_0x5c6a15,null));}; \ No newline at end of file +var _0x4dde=['desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','params','intersection','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2a83af,_0x4fa9ed){var _0x2e1648=function(_0x59c429){while(--_0x59c429){_0x2a83af['push'](_0x2a83af['shift']());}};_0x2e1648(++_0x4fa9ed);}(_0x4dde,0x1a7));var _0xe4dd=function(_0x5ad64c,_0x10b434){_0x5ad64c=_0x5ad64c-0x0;var _0x45e603=_0x4dde[_0x5ad64c];return _0x45e603;};'use strict';var emlformat=require(_0xe4dd('0x0'));var rimraf=require(_0xe4dd('0x1'));var zipdir=require(_0xe4dd('0x2'));var jsonpatch=require(_0xe4dd('0x3'));var rp=require(_0xe4dd('0x4'));var moment=require(_0xe4dd('0x5'));var BPromise=require(_0xe4dd('0x6'));var Mustache=require('mustache');var util=require(_0xe4dd('0x7'));var path=require(_0xe4dd('0x8'));var sox=require('sox');var csv=require(_0xe4dd('0x9'));var ejs=require(_0xe4dd('0xa'));var fs=require('fs');var fs_extra=require(_0xe4dd('0xb'));var _=require(_0xe4dd('0xc'));var squel=require(_0xe4dd('0xd'));var crypto=require(_0xe4dd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe4dd('0xf'));var toCsv=require(_0xe4dd('0x9'));var querystring=require(_0xe4dd('0x10'));var Papa=require(_0xe4dd('0x11'));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(_0xe4dd('0x12'));var logger=require(_0xe4dd('0x13'))(_0xe4dd('0x14'));var utils=require('../../config/utils');var config=require(_0xe4dd('0x15'));var licenseUtil=require(_0xe4dd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aea4f,_0x2da7b3){_0x2da7b3=_0x2da7b3||0xcc;return function(_0x52c906){if(_0x52c906){return _0x1aea4f[_0xe4dd('0x17')](_0x2da7b3);}return _0x1aea4f['status'](_0x2da7b3)['end']();};}function respondWithResult(_0x513ba2,_0x2cf312){_0x2cf312=_0x2cf312||0xc8;return function(_0x15bc48){if(_0x15bc48){return _0x513ba2['status'](_0x2cf312)[_0xe4dd('0x18')](_0x15bc48);}};}function respondWithFilteredResult(_0xc6e360,_0x132c31){return function(_0x545ada){if(_0x545ada){var _0x5171c2=typeof _0x132c31[_0xe4dd('0x19')]==='undefined'&&typeof _0x132c31[_0xe4dd('0x1a')]===_0xe4dd('0x1b');var _0x3e3169=_0x545ada[_0xe4dd('0x1c')];var _0x3c1211=_0x5171c2?0x0:_0x132c31['offset'];var _0x4831c1=_0x5171c2?_0x545ada[_0xe4dd('0x1c')]:_0x132c31['offset']+_0x132c31[_0xe4dd('0x1a')];var _0x4f38c6;if(_0x4831c1>=_0x3e3169){_0x4831c1=_0x3e3169;_0x4f38c6=0xc8;}else{_0x4f38c6=0xce;}_0xc6e360[_0xe4dd('0x1d')](_0x4f38c6);return _0xc6e360[_0xe4dd('0x1e')](_0xe4dd('0x1f'),_0x3c1211+'-'+_0x4831c1+'/'+_0x3e3169)[_0xe4dd('0x18')](_0x545ada);}return null;};}function patchUpdates(_0x1fade3){return function(_0x43f283){try{jsonpatch['apply'](_0x43f283,_0x1fade3,!![]);}catch(_0x6b83a8){return BPromise[_0xe4dd('0x20')](_0x6b83a8);}return _0x43f283[_0xe4dd('0x21')]();};}function saveUpdates(_0x44ad77,_0x532e44){return function(_0x2d5588){if(_0x2d5588){return _0x2d5588[_0xe4dd('0x22')](_0x44ad77)[_0xe4dd('0x23')](function(_0x40ab2e){return _0x40ab2e;});}return null;};}function removeEntity(_0x114bca,_0x2ae5ce){return function(_0x32ce05){if(_0x32ce05){return _0x32ce05['destroy']()[_0xe4dd('0x23')](function(){_0x114bca[_0xe4dd('0x1d')](0xcc)[_0xe4dd('0x24')]();});}};}function handleEntityNotFound(_0x3298aa,_0x3e3b1d){return function(_0x4b8210){if(!_0x4b8210){_0x3298aa[_0xe4dd('0x17')](0x194);}return _0x4b8210;};}function handleError(_0x3e2087,_0x5146a2){_0x5146a2=_0x5146a2||0x1f4;return function(_0x3c67f4){logger[_0xe4dd('0x25')](_0x3c67f4[_0xe4dd('0x26')]);if(_0x3c67f4[_0xe4dd('0x27')]){delete _0x3c67f4[_0xe4dd('0x27')];}_0x3e2087[_0xe4dd('0x1d')](_0x5146a2)[_0xe4dd('0x28')](_0x3c67f4);};}exports[_0xe4dd('0x29')]=function(_0xc2a464,_0x374dba){var _0x3c4ee9={},_0x238462={},_0x431d3f={'count':0x0,'rows':[]};var _0xf8af67=_[_0xe4dd('0x2a')](db[_0xe4dd('0x2b')][_0xe4dd('0x2c')],function(_0x482c1f){return{'name':_0x482c1f[_0xe4dd('0x2d')],'type':_0x482c1f[_0xe4dd('0x2e')]['key']};});_0x238462[_0xe4dd('0x2f')]=_[_0xe4dd('0x2a')](_0xf8af67,_0xe4dd('0x27'));_0x238462[_0xe4dd('0x30')]=_[_0xe4dd('0x31')](_0xc2a464[_0xe4dd('0x30')]);_0x238462['filters']=_['intersection'](_0x238462[_0xe4dd('0x2f')],_0x238462[_0xe4dd('0x30')]);_0x3c4ee9[_0xe4dd('0x32')]=_['intersection'](_0x238462[_0xe4dd('0x2f')],qs[_0xe4dd('0x33')](_0xc2a464[_0xe4dd('0x30')][_0xe4dd('0x33')]));_0x3c4ee9['attributes']=_0x3c4ee9[_0xe4dd('0x32')][_0xe4dd('0x34')]?_0x3c4ee9[_0xe4dd('0x32')]:_0x238462[_0xe4dd('0x2f')];if(!_0xc2a464[_0xe4dd('0x30')][_0xe4dd('0x35')](_0xe4dd('0x36'))){_0x3c4ee9[_0xe4dd('0x1a')]=qs[_0xe4dd('0x1a')](_0xc2a464[_0xe4dd('0x30')]['limit']);_0x3c4ee9[_0xe4dd('0x19')]=qs[_0xe4dd('0x19')](_0xc2a464['query'][_0xe4dd('0x19')]);}_0x3c4ee9[_0xe4dd('0x37')]=qs[_0xe4dd('0x38')](_0xc2a464['query']['sort']);_0x3c4ee9[_0xe4dd('0x39')]=qs['filters'](_[_0xe4dd('0x3a')](_0xc2a464[_0xe4dd('0x30')],_0x238462[_0xe4dd('0x3b')]),_0xf8af67);if(_0xc2a464[_0xe4dd('0x30')][_0xe4dd('0x3c')]){_0x3c4ee9[_0xe4dd('0x39')]=_[_0xe4dd('0x3d')](_0x3c4ee9['where'],{'$or':_[_0xe4dd('0x2a')](_0xf8af67,function(_0x3b9b03){if(_0x3b9b03['type']!==_0xe4dd('0x3e')){var _0x11ee17={};_0x11ee17[_0x3b9b03[_0xe4dd('0x27')]]={'$like':'%'+_0xc2a464[_0xe4dd('0x30')][_0xe4dd('0x3c')]+'%'};return _0x11ee17;}})});}_0x3c4ee9=_[_0xe4dd('0x3d')]({},_0x3c4ee9,_0xc2a464[_0xe4dd('0x3f')]);var _0x123ce5={'where':_0x3c4ee9[_0xe4dd('0x39')]};return db[_0xe4dd('0x2b')]['count'](_0x123ce5)[_0xe4dd('0x23')](function(_0x1b599e){_0x431d3f[_0xe4dd('0x1c')]=_0x1b599e;if(_0xc2a464[_0xe4dd('0x30')][_0xe4dd('0x40')]){_0x3c4ee9[_0xe4dd('0x41')]=[{'all':!![]}];}return db[_0xe4dd('0x2b')]['findAll'](_0x3c4ee9);})[_0xe4dd('0x23')](function(_0x3de29c){_0x431d3f[_0xe4dd('0x42')]=_0x3de29c;return _0x431d3f;})[_0xe4dd('0x23')](respondWithFilteredResult(_0x374dba,_0x3c4ee9))['catch'](handleError(_0x374dba,null));};exports['show']=function(_0x10a267,_0x169dbb){var _0x3de58d={'raw':!![],'where':{'id':_0x10a267[_0xe4dd('0x43')]['id']}},_0x5bc71f={};_0x5bc71f['model']=_[_0xe4dd('0x31')](db[_0xe4dd('0x2b')][_0xe4dd('0x2c')]);_0x5bc71f['query']=_[_0xe4dd('0x31')](_0x10a267['query']);_0x5bc71f[_0xe4dd('0x3b')]=_[_0xe4dd('0x44')](_0x5bc71f[_0xe4dd('0x2f')],_0x5bc71f[_0xe4dd('0x30')]);_0x3de58d[_0xe4dd('0x32')]=_[_0xe4dd('0x44')](_0x5bc71f[_0xe4dd('0x2f')],qs[_0xe4dd('0x33')](_0x10a267['query'][_0xe4dd('0x33')]));_0x3de58d[_0xe4dd('0x32')]=_0x3de58d['attributes'][_0xe4dd('0x34')]?_0x3de58d[_0xe4dd('0x32')]:_0x5bc71f[_0xe4dd('0x2f')];if(_0x10a267[_0xe4dd('0x30')][_0xe4dd('0x40')]){_0x3de58d[_0xe4dd('0x41')]=[{'all':!![]}];}_0x3de58d=_[_0xe4dd('0x3d')]({},_0x3de58d,_0x10a267[_0xe4dd('0x3f')]);return db['MailServerOut']['find'](_0x3de58d)[_0xe4dd('0x23')](handleEntityNotFound(_0x169dbb,null))[_0xe4dd('0x23')](respondWithResult(_0x169dbb,null))[_0xe4dd('0x45')](handleError(_0x169dbb,null));};exports['create']=function(_0x17ae69,_0x334a71){return db[_0xe4dd('0x2b')][_0xe4dd('0x46')](_0x17ae69[_0xe4dd('0x47')],{})['then'](respondWithResult(_0x334a71,0xc9))['catch'](handleError(_0x334a71,null));};exports[_0xe4dd('0x22')]=function(_0x3abecb,_0x15732d){if(_0x3abecb[_0xe4dd('0x47')]['id']){delete _0x3abecb[_0xe4dd('0x47')]['id'];}return db[_0xe4dd('0x2b')]['find']({'where':{'id':_0x3abecb[_0xe4dd('0x43')]['id']}})[_0xe4dd('0x23')](handleEntityNotFound(_0x15732d,null))[_0xe4dd('0x23')](saveUpdates(_0x3abecb[_0xe4dd('0x47')],null))[_0xe4dd('0x23')](respondWithResult(_0x15732d,null))['catch'](handleError(_0x15732d,null));};exports[_0xe4dd('0x48')]=function(_0x326d67,_0x2cb73b){return db[_0xe4dd('0x2b')]['find']({'where':{'id':_0x326d67['params']['id']}})[_0xe4dd('0x23')](handleEntityNotFound(_0x2cb73b,null))[_0xe4dd('0x23')](removeEntity(_0x2cb73b,null))[_0xe4dd('0x45')](handleError(_0x2cb73b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index bdf5387..d7cf614 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 _0x061d=['mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x34fedc,_0x30255f){var _0xbd34b=function(_0x25b598){while(--_0x25b598){_0x34fedc['push'](_0x34fedc['shift']());}};_0xbd34b(++_0x30255f);}(_0x061d,0x64));var _0xd061=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x061d[_0x37c22c];return _0x119d79;};'use strict';var _=require('lodash');var util=require(_0xd061('0x0'));var logger=require(_0xd061('0x1'))(_0xd061('0x2'));var moment=require(_0xd061('0x3'));var BPromise=require(_0xd061('0x4'));var rp=require(_0xd061('0x5'));var fs=require('fs');var path=require(_0xd061('0x6'));var rimraf=require(_0xd061('0x7'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xd061('0x8')]=function(_0x217bbb,_0x118ec0){return _0x217bbb[_0xd061('0x9')]('MailServerOut',attributes,{'tableName':_0xd061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ce1=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0x0ce1,0x97));var _0x10ce=function(_0x4e5ca9,_0x23d2cd){_0x4e5ca9=_0x4e5ca9-0x0;var _0x552ad5=_0x0ce1[_0x4e5ca9];return _0x552ad5;};'use strict';var _=require(_0x10ce('0x0'));var util=require(_0x10ce('0x1'));var logger=require(_0x10ce('0x2'))(_0x10ce('0x3'));var moment=require(_0x10ce('0x4'));var BPromise=require(_0x10ce('0x5'));var rp=require(_0x10ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10ce('0x7'));var config=require(_0x10ce('0x8'));var attributes=require(_0x10ce('0x9'));module[_0x10ce('0xa')]=function(_0x4550dd,_0xd020e9){return _0x4550dd[_0x10ce('0xb')](_0x10ce('0xc'),attributes,{'tableName':_0x10ce('0xd'),'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 9226a5a..3ad2068 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x38a977,_0x5ddc61){var _0x138533=function(_0x3bc1f4){while(--_0x3bc1f4){_0x38a977['push'](_0x38a977['shift']());}};_0x138533(++_0x5ddc61);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _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(_0x16779c,_0x5502a2){var _0xcf8cb1=function(_0x8cc706){while(--_0x8cc706){_0x16779c['push'](_0x16779c['shift']());}};_0xcf8cb1(++_0x5502a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b0f29,_0x3d6f36){_0x5b0f29=_0x5b0f29-0x0;var _0x27a26a=_0x5f2f[_0x5b0f29];return _0x27a26a;};'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 d750d80..fd1fae5 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 _0x255a=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ef7fc,_0x397554){var _0x47df5e=function(_0xa593ee){while(--_0xa593ee){_0x3ef7fc['push'](_0x3ef7fc['shift']());}};_0x47df5e(++_0x397554);}(_0x255a,0xdd));var _0xa255=function(_0x4fac9e,_0x44ed3){_0x4fac9e=_0x4fac9e-0x0;var _0x3177a5=_0x255a[_0x4fac9e];return _0x3177a5;};'use strict';var multer=require(_0xa255('0x0'));var util=require('util');var path=require(_0xa255('0x1'));var timeout=require(_0xa255('0x2'));var express=require(_0xa255('0x3'));var router=express[_0xa255('0x4')]();var fs_extra=require(_0xa255('0x5'));var auth=require(_0xa255('0x6'));var interaction=require(_0xa255('0x7'));var config=require(_0xa255('0x8'));var controller=require(_0xa255('0x9'));router[_0xa255('0xa')]('/',auth[_0xa255('0xb')](),controller[_0xa255('0xc')]);router[_0xa255('0xa')](_0xa255('0xd'),auth[_0xa255('0xb')](),controller[_0xa255('0xe')]);router[_0xa255('0xa')](_0xa255('0xf'),auth[_0xa255('0xb')](),controller[_0xa255('0x10')]);router[_0xa255('0x11')]('/',auth[_0xa255('0xb')](),controller['create']);router[_0xa255('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa255('0x13')]);router[_0xa255('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xa255('0x15')]);module[_0xa255('0x16')]=router; \ No newline at end of file +var _0x88c6=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x88c6,0x6c));var _0x688c=function(_0x14153a,_0x127448){_0x14153a=_0x14153a-0x0;var _0x3ad489=_0x88c6[_0x14153a];return _0x3ad489;};'use strict';var multer=require(_0x688c('0x0'));var util=require(_0x688c('0x1'));var path=require(_0x688c('0x2'));var timeout=require(_0x688c('0x3'));var express=require('express');var router=express[_0x688c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x688c('0x5'));var interaction=require(_0x688c('0x6'));var config=require(_0x688c('0x7'));var controller=require(_0x688c('0x8'));router[_0x688c('0x9')]('/',auth[_0x688c('0xa')](),controller[_0x688c('0xb')]);router['get'](_0x688c('0xc'),auth[_0x688c('0xa')](),controller[_0x688c('0xd')]);router[_0x688c('0x9')](_0x688c('0xe'),auth[_0x688c('0xa')](),controller['show']);router[_0x688c('0xf')]('/',auth[_0x688c('0xa')](),controller[_0x688c('0x10')]);router[_0x688c('0x11')]('/:id',auth[_0x688c('0xa')](),controller[_0x688c('0x12')]);router[_0x688c('0x13')](_0x688c('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x688c('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 3b04eac..f3212da 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 _0xeff8=['name','STRING','sequelize','exports'];(function(_0x4c95a7,_0x58159c){var _0x841ebd=function(_0x45551b){while(--_0x45551b){_0x4c95a7['push'](_0x4c95a7['shift']());}};_0x841ebd(++_0x58159c);}(_0xeff8,0x186));var _0x8eff=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xeff8[_0x33bc64];return _0x3fdd34;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8eff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0x4300=['sequelize'];(function(_0x146938,_0x55b3ee){var _0x43c72b=function(_0x449f4d){while(--_0x449f4d){_0x146938['push'](_0x146938['shift']());}};_0x43c72b(++_0x55b3ee);}(_0x4300,0x1a6));var _0x0430=function(_0xee684,_0x3656f9){_0xee684=_0xee684-0x0;var _0x12cbe6=_0x4300[_0xee684];return _0x12cbe6;};'use strict';var Sequelize=require(_0x0430('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 14e4573..670c7ee 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 _0x1023=['error','stack','name','send','index','MailSubstatus','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','params','rawAttributes','keys','find','create','body','update','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','save','then','destroy'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x1023,0xc1));var _0x3102=function(_0x6852cf,_0x26e3eb){_0x6852cf=_0x6852cf-0x0;var _0x7fa6cb=_0x1023[_0x6852cf];return _0x7fa6cb;};'use strict';var emlformat=require(_0x3102('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3102('0x1'));var moment=require(_0x3102('0x2'));var BPromise=require(_0x3102('0x3'));var Mustache=require(_0x3102('0x4'));var util=require(_0x3102('0x5'));var path=require(_0x3102('0x6'));var sox=require(_0x3102('0x7'));var csv=require(_0x3102('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3102('0x9'));var _=require(_0x3102('0xa'));var squel=require('squel');var crypto=require(_0x3102('0xb'));var jsforce=require(_0x3102('0xc'));var deskjs=require(_0x3102('0xd'));var toCsv=require(_0x3102('0x8'));var querystring=require(_0x3102('0xe'));var Papa=require(_0x3102('0xf'));var Redis=require(_0x3102('0x10'));var authService=require(_0x3102('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3102('0x12'));var hardwareService=require(_0x3102('0x13'));var logger=require(_0x3102('0x14'))(_0x3102('0x15'));var utils=require('../../config/utils');var config=require(_0x3102('0x16'));var licenseUtil=require(_0x3102('0x17'));var db=require(_0x3102('0x18'))['db'];function respondWithStatusCode(_0x3c37c7,_0x2ef5b4){_0x2ef5b4=_0x2ef5b4||0xcc;return function(_0x5f00f9){if(_0x5f00f9){return _0x3c37c7[_0x3102('0x19')](_0x2ef5b4);}return _0x3c37c7[_0x3102('0x1a')](_0x2ef5b4)[_0x3102('0x1b')]();};}function respondWithResult(_0x184bdc,_0x2f61f8){_0x2f61f8=_0x2f61f8||0xc8;return function(_0x1b95db){if(_0x1b95db){return _0x184bdc[_0x3102('0x1a')](_0x2f61f8)['json'](_0x1b95db);}};}function respondWithFilteredResult(_0x2619fc,_0x36d955){return function(_0x22069f){if(_0x22069f){var _0xb21269=typeof _0x36d955[_0x3102('0x1c')]==='undefined'&&typeof _0x36d955[_0x3102('0x1d')]==='undefined';var _0x425316=_0x22069f[_0x3102('0x1e')];var _0x547f1b=_0xb21269?0x0:_0x36d955['offset'];var _0x25918a=_0xb21269?_0x22069f[_0x3102('0x1e')]:_0x36d955[_0x3102('0x1c')]+_0x36d955['limit'];var _0x326eca;if(_0x25918a>=_0x425316){_0x25918a=_0x425316;_0x326eca=0xc8;}else{_0x326eca=0xce;}_0x2619fc[_0x3102('0x1a')](_0x326eca);return _0x2619fc[_0x3102('0x1f')]('Content-Range',_0x547f1b+'-'+_0x25918a+'/'+_0x425316)[_0x3102('0x20')](_0x22069f);}return null;};}function patchUpdates(_0x27f57e){return function(_0x503e03){try{jsonpatch[_0x3102('0x21')](_0x503e03,_0x27f57e,!![]);}catch(_0x40933b){return BPromise[_0x3102('0x22')](_0x40933b);}return _0x503e03[_0x3102('0x23')]();};}function saveUpdates(_0x3d7e24,_0x2be245){return function(_0x285216){if(_0x285216){return _0x285216['update'](_0x3d7e24)[_0x3102('0x24')](function(_0x41c19d){return _0x41c19d;});}return null;};}function removeEntity(_0x2477f3,_0x55ca3f){return function(_0x11e5de){if(_0x11e5de){return _0x11e5de[_0x3102('0x25')]()[_0x3102('0x24')](function(){_0x2477f3[_0x3102('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2770d9,_0x195039){return function(_0x673b0d){if(!_0x673b0d){_0x2770d9['sendStatus'](0x194);}return _0x673b0d;};}function handleError(_0x178ebb,_0x36231e){_0x36231e=_0x36231e||0x1f4;return function(_0x598a5a){logger[_0x3102('0x26')](_0x598a5a[_0x3102('0x27')]);if(_0x598a5a[_0x3102('0x28')]){delete _0x598a5a['name'];}_0x178ebb[_0x3102('0x1a')](_0x36231e)[_0x3102('0x29')](_0x598a5a);};}exports[_0x3102('0x2a')]=function(_0x24226a,_0x3a7d55){var _0x1768c2={},_0x348eb3={},_0x273c07={'count':0x0,'rows':[]};var _0x4de37d=_['map'](db[_0x3102('0x2b')]['rawAttributes'],function(_0x170491){return{'name':_0x170491[_0x3102('0x2c')],'type':_0x170491[_0x3102('0x2d')][_0x3102('0x2e')]};});_0x348eb3[_0x3102('0x2f')]=_['map'](_0x4de37d,_0x3102('0x28'));_0x348eb3[_0x3102('0x30')]=_['keys'](_0x24226a[_0x3102('0x30')]);_0x348eb3[_0x3102('0x31')]=_[_0x3102('0x32')](_0x348eb3[_0x3102('0x2f')],_0x348eb3[_0x3102('0x30')]);_0x1768c2[_0x3102('0x33')]=_[_0x3102('0x32')](_0x348eb3['model'],qs[_0x3102('0x34')](_0x24226a[_0x3102('0x30')][_0x3102('0x34')]));_0x1768c2[_0x3102('0x33')]=_0x1768c2[_0x3102('0x33')][_0x3102('0x35')]?_0x1768c2[_0x3102('0x33')]:_0x348eb3[_0x3102('0x2f')];if(!_0x24226a[_0x3102('0x30')][_0x3102('0x36')](_0x3102('0x37'))){_0x1768c2[_0x3102('0x1d')]=qs[_0x3102('0x1d')](_0x24226a['query'][_0x3102('0x1d')]);_0x1768c2['offset']=qs[_0x3102('0x1c')](_0x24226a[_0x3102('0x30')][_0x3102('0x1c')]);}_0x1768c2[_0x3102('0x38')]=qs[_0x3102('0x39')](_0x24226a[_0x3102('0x30')][_0x3102('0x39')]);_0x1768c2[_0x3102('0x3a')]=qs[_0x3102('0x31')](_[_0x3102('0x3b')](_0x24226a[_0x3102('0x30')],_0x348eb3[_0x3102('0x31')]),_0x4de37d);if(_0x24226a[_0x3102('0x30')][_0x3102('0x3c')]){_0x1768c2[_0x3102('0x3a')]=_[_0x3102('0x3d')](_0x1768c2[_0x3102('0x3a')],{'$or':_['map'](_0x4de37d,function(_0x5a2586){if(_0x5a2586[_0x3102('0x2d')]!==_0x3102('0x3e')){var _0x4671d0={};_0x4671d0[_0x5a2586[_0x3102('0x28')]]={'$like':'%'+_0x24226a[_0x3102('0x30')]['filter']+'%'};return _0x4671d0;}})});}_0x1768c2=_['merge']({},_0x1768c2,_0x24226a[_0x3102('0x3f')]);var _0x55fdb4={'where':_0x1768c2['where']};return db['MailSubstatus'][_0x3102('0x1e')](_0x55fdb4)['then'](function(_0xadc45){_0x273c07[_0x3102('0x1e')]=_0xadc45;if(_0x24226a['query'][_0x3102('0x40')]){_0x1768c2['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x3102('0x41')](_0x1768c2);})[_0x3102('0x24')](function(_0x53fe0b){_0x273c07[_0x3102('0x42')]=_0x53fe0b;return _0x273c07;})[_0x3102('0x24')](respondWithFilteredResult(_0x3a7d55,_0x1768c2))[_0x3102('0x43')](handleError(_0x3a7d55,null));};exports[_0x3102('0x44')]=function(_0x23b742,_0x2a957a){var _0x28af68={'raw':!![],'where':{'id':_0x23b742[_0x3102('0x45')]['id']}},_0xa07adc={};_0xa07adc[_0x3102('0x2f')]=_['keys'](db['MailSubstatus'][_0x3102('0x46')]);_0xa07adc['query']=_[_0x3102('0x47')](_0x23b742[_0x3102('0x30')]);_0xa07adc['filters']=_[_0x3102('0x32')](_0xa07adc['model'],_0xa07adc[_0x3102('0x30')]);_0x28af68[_0x3102('0x33')]=_[_0x3102('0x32')](_0xa07adc[_0x3102('0x2f')],qs[_0x3102('0x34')](_0x23b742[_0x3102('0x30')][_0x3102('0x34')]));_0x28af68[_0x3102('0x33')]=_0x28af68['attributes'][_0x3102('0x35')]?_0x28af68['attributes']:_0xa07adc[_0x3102('0x2f')];if(_0x23b742['query'][_0x3102('0x40')]){_0x28af68['include']=[{'all':!![]}];}_0x28af68=_['merge']({},_0x28af68,_0x23b742[_0x3102('0x3f')]);return db[_0x3102('0x2b')][_0x3102('0x48')](_0x28af68)['then'](handleEntityNotFound(_0x2a957a,null))[_0x3102('0x24')](respondWithResult(_0x2a957a,null))[_0x3102('0x43')](handleError(_0x2a957a,null));};exports[_0x3102('0x49')]=function(_0x207d6e,_0x1eb6f8){return db[_0x3102('0x2b')][_0x3102('0x49')](_0x207d6e[_0x3102('0x4a')],{})['then'](respondWithResult(_0x1eb6f8,0xc9))[_0x3102('0x43')](handleError(_0x1eb6f8,null));};exports[_0x3102('0x4b')]=function(_0x117be8,_0x69494c){if(_0x117be8['body']['id']){delete _0x117be8[_0x3102('0x4a')]['id'];}return db['MailSubstatus'][_0x3102('0x48')]({'where':{'id':_0x117be8[_0x3102('0x45')]['id']}})[_0x3102('0x24')](handleEntityNotFound(_0x69494c,null))['then'](saveUpdates(_0x117be8[_0x3102('0x4a')],null))[_0x3102('0x24')](respondWithResult(_0x69494c,null))['catch'](handleError(_0x69494c,null));};exports[_0x3102('0x25')]=function(_0x268d95,_0x9aba30){return db['MailSubstatus'][_0x3102('0x48')]({'where':{'id':_0x268d95[_0x3102('0x45')]['id']}})[_0x3102('0x24')](handleEntityNotFound(_0x9aba30,null))[_0x3102('0x24')](removeEntity(_0x9aba30,null))[_0x3102('0x43')](handleError(_0x9aba30,null));};exports[_0x3102('0x4c')]=function(_0x1d1dc9,_0x376600){return db[_0x3102('0x2b')][_0x3102('0x4c')]()[_0x3102('0x24')](respondWithResult(_0x376600,null))['catch'](handleError(_0x376600,null));}; \ No newline at end of file +var _0xdbde=['offset','undefined','limit','count','apply','reject','update','then','destroy','error','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','filters','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3b2421,_0xf30f91){var _0x288bde=function(_0x1d1db6){while(--_0x1d1db6){_0x3b2421['push'](_0x3b2421['shift']());}};_0x288bde(++_0xf30f91);}(_0xdbde,0x14c));var _0xedbd=function(_0x44bb12,_0x524525){_0x44bb12=_0x44bb12-0x0;var _0x26f50c=_0xdbde[_0x44bb12];return _0x26f50c;};'use strict';var emlformat=require(_0xedbd('0x0'));var rimraf=require(_0xedbd('0x1'));var zipdir=require(_0xedbd('0x2'));var jsonpatch=require(_0xedbd('0x3'));var rp=require('request-promise');var moment=require(_0xedbd('0x4'));var BPromise=require(_0xedbd('0x5'));var Mustache=require(_0xedbd('0x6'));var util=require('util');var path=require(_0xedbd('0x7'));var sox=require(_0xedbd('0x8'));var csv=require(_0xedbd('0x9'));var ejs=require(_0xedbd('0xa'));var fs=require('fs');var fs_extra=require(_0xedbd('0xb'));var _=require(_0xedbd('0xc'));var squel=require(_0xedbd('0xd'));var crypto=require(_0xedbd('0xe'));var jsforce=require(_0xedbd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xedbd('0x9'));var querystring=require(_0xedbd('0x10'));var Papa=require(_0xedbd('0x11'));var Redis=require('ioredis');var authService=require(_0xedbd('0x12'));var qs=require(_0xedbd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedbd('0x14'));var logger=require('../../config/logger')(_0xedbd('0x15'));var utils=require('../../config/utils');var config=require(_0xedbd('0x16'));var licenseUtil=require(_0xedbd('0x17'));var db=require(_0xedbd('0x18'))['db'];function respondWithStatusCode(_0x2919db,_0x72cf6a){_0x72cf6a=_0x72cf6a||0xcc;return function(_0x28ff0f){if(_0x28ff0f){return _0x2919db[_0xedbd('0x19')](_0x72cf6a);}return _0x2919db[_0xedbd('0x1a')](_0x72cf6a)[_0xedbd('0x1b')]();};}function respondWithResult(_0x18fb20,_0x3c3378){_0x3c3378=_0x3c3378||0xc8;return function(_0x225187){if(_0x225187){return _0x18fb20['status'](_0x3c3378)['json'](_0x225187);}};}function respondWithFilteredResult(_0xdee1bc,_0x28b6f1){return function(_0x5abb26){if(_0x5abb26){var _0xa87d0f=typeof _0x28b6f1[_0xedbd('0x1c')]===_0xedbd('0x1d')&&typeof _0x28b6f1[_0xedbd('0x1e')]===_0xedbd('0x1d');var _0x1dabe4=_0x5abb26[_0xedbd('0x1f')];var _0x37de68=_0xa87d0f?0x0:_0x28b6f1['offset'];var _0x3ca859=_0xa87d0f?_0x5abb26[_0xedbd('0x1f')]:_0x28b6f1[_0xedbd('0x1c')]+_0x28b6f1[_0xedbd('0x1e')];var _0x44d615;if(_0x3ca859>=_0x1dabe4){_0x3ca859=_0x1dabe4;_0x44d615=0xc8;}else{_0x44d615=0xce;}_0xdee1bc[_0xedbd('0x1a')](_0x44d615);return _0xdee1bc['set']('Content-Range',_0x37de68+'-'+_0x3ca859+'/'+_0x1dabe4)['json'](_0x5abb26);}return null;};}function patchUpdates(_0x32c5e8){return function(_0xa84baa){try{jsonpatch[_0xedbd('0x20')](_0xa84baa,_0x32c5e8,!![]);}catch(_0x2f3630){return BPromise[_0xedbd('0x21')](_0x2f3630);}return _0xa84baa['save']();};}function saveUpdates(_0x5e6a3f,_0x200468){return function(_0xdff31c){if(_0xdff31c){return _0xdff31c[_0xedbd('0x22')](_0x5e6a3f)[_0xedbd('0x23')](function(_0x3433c6){return _0x3433c6;});}return null;};}function removeEntity(_0x4117ff,_0x5d2f58){return function(_0x1bedc1){if(_0x1bedc1){return _0x1bedc1[_0xedbd('0x24')]()[_0xedbd('0x23')](function(){_0x4117ff['status'](0xcc)[_0xedbd('0x1b')]();});}};}function handleEntityNotFound(_0xc69519,_0x57e345){return function(_0x53328e){if(!_0x53328e){_0xc69519[_0xedbd('0x19')](0x194);}return _0x53328e;};}function handleError(_0x1e73df,_0x3299a0){_0x3299a0=_0x3299a0||0x1f4;return function(_0x3a823c){logger[_0xedbd('0x25')](_0x3a823c['stack']);if(_0x3a823c[_0xedbd('0x26')]){delete _0x3a823c[_0xedbd('0x26')];}_0x1e73df[_0xedbd('0x1a')](_0x3299a0)[_0xedbd('0x27')](_0x3a823c);};}exports[_0xedbd('0x28')]=function(_0x330ad6,_0x441d7b){var _0x4cd06a={},_0x48c1cb={},_0x1e00c4={'count':0x0,'rows':[]};var _0x488e99=_[_0xedbd('0x29')](db[_0xedbd('0x2a')]['rawAttributes'],function(_0x24c0ea){return{'name':_0x24c0ea[_0xedbd('0x2b')],'type':_0x24c0ea[_0xedbd('0x2c')][_0xedbd('0x2d')]};});_0x48c1cb[_0xedbd('0x2e')]=_[_0xedbd('0x29')](_0x488e99,'name');_0x48c1cb[_0xedbd('0x2f')]=_[_0xedbd('0x30')](_0x330ad6[_0xedbd('0x2f')]);_0x48c1cb['filters']=_[_0xedbd('0x31')](_0x48c1cb[_0xedbd('0x2e')],_0x48c1cb[_0xedbd('0x2f')]);_0x4cd06a['attributes']=_[_0xedbd('0x31')](_0x48c1cb['model'],qs[_0xedbd('0x32')](_0x330ad6['query'][_0xedbd('0x32')]));_0x4cd06a[_0xedbd('0x33')]=_0x4cd06a[_0xedbd('0x33')]['length']?_0x4cd06a[_0xedbd('0x33')]:_0x48c1cb['model'];if(!_0x330ad6[_0xedbd('0x2f')][_0xedbd('0x34')]('nolimit')){_0x4cd06a[_0xedbd('0x1e')]=qs[_0xedbd('0x1e')](_0x330ad6['query'][_0xedbd('0x1e')]);_0x4cd06a['offset']=qs[_0xedbd('0x1c')](_0x330ad6[_0xedbd('0x2f')][_0xedbd('0x1c')]);}_0x4cd06a[_0xedbd('0x35')]=qs['sort'](_0x330ad6[_0xedbd('0x2f')]['sort']);_0x4cd06a[_0xedbd('0x36')]=qs['filters'](_['pick'](_0x330ad6[_0xedbd('0x2f')],_0x48c1cb['filters']),_0x488e99);if(_0x330ad6[_0xedbd('0x2f')][_0xedbd('0x37')]){_0x4cd06a[_0xedbd('0x36')]=_[_0xedbd('0x38')](_0x4cd06a[_0xedbd('0x36')],{'$or':_['map'](_0x488e99,function(_0x5445ff){if(_0x5445ff['type']!==_0xedbd('0x39')){var _0x46eb71={};_0x46eb71[_0x5445ff['name']]={'$like':'%'+_0x330ad6[_0xedbd('0x2f')][_0xedbd('0x37')]+'%'};return _0x46eb71;}})});}_0x4cd06a=_[_0xedbd('0x38')]({},_0x4cd06a,_0x330ad6[_0xedbd('0x3a')]);var _0xc9aeea={'where':_0x4cd06a['where']};return db[_0xedbd('0x2a')][_0xedbd('0x1f')](_0xc9aeea)[_0xedbd('0x23')](function(_0x188a4d){_0x1e00c4[_0xedbd('0x1f')]=_0x188a4d;if(_0x330ad6[_0xedbd('0x2f')][_0xedbd('0x3b')]){_0x4cd06a[_0xedbd('0x3c')]=[{'all':!![]}];}return db[_0xedbd('0x2a')][_0xedbd('0x3d')](_0x4cd06a);})[_0xedbd('0x23')](function(_0xd41e7c){_0x1e00c4[_0xedbd('0x3e')]=_0xd41e7c;return _0x1e00c4;})['then'](respondWithFilteredResult(_0x441d7b,_0x4cd06a))['catch'](handleError(_0x441d7b,null));};exports[_0xedbd('0x3f')]=function(_0x48b15c,_0x4a2484){var _0x370311={'raw':!![],'where':{'id':_0x48b15c[_0xedbd('0x40')]['id']}},_0x3c8c15={};_0x3c8c15[_0xedbd('0x2e')]=_[_0xedbd('0x30')](db[_0xedbd('0x2a')][_0xedbd('0x41')]);_0x3c8c15[_0xedbd('0x2f')]=_[_0xedbd('0x30')](_0x48b15c[_0xedbd('0x2f')]);_0x3c8c15[_0xedbd('0x42')]=_[_0xedbd('0x31')](_0x3c8c15[_0xedbd('0x2e')],_0x3c8c15['query']);_0x370311[_0xedbd('0x33')]=_[_0xedbd('0x31')](_0x3c8c15[_0xedbd('0x2e')],qs[_0xedbd('0x32')](_0x48b15c[_0xedbd('0x2f')][_0xedbd('0x32')]));_0x370311[_0xedbd('0x33')]=_0x370311[_0xedbd('0x33')]['length']?_0x370311[_0xedbd('0x33')]:_0x3c8c15[_0xedbd('0x2e')];if(_0x48b15c['query'][_0xedbd('0x3b')]){_0x370311[_0xedbd('0x3c')]=[{'all':!![]}];}_0x370311=_[_0xedbd('0x38')]({},_0x370311,_0x48b15c[_0xedbd('0x3a')]);return db[_0xedbd('0x2a')]['find'](_0x370311)[_0xedbd('0x23')](handleEntityNotFound(_0x4a2484,null))[_0xedbd('0x23')](respondWithResult(_0x4a2484,null))[_0xedbd('0x43')](handleError(_0x4a2484,null));};exports[_0xedbd('0x44')]=function(_0x3b1c22,_0x49d99e){return db[_0xedbd('0x2a')][_0xedbd('0x44')](_0x3b1c22[_0xedbd('0x45')],{})[_0xedbd('0x23')](respondWithResult(_0x49d99e,0xc9))[_0xedbd('0x43')](handleError(_0x49d99e,null));};exports['update']=function(_0x5151a3,_0xdfad2){if(_0x5151a3[_0xedbd('0x45')]['id']){delete _0x5151a3[_0xedbd('0x45')]['id'];}return db[_0xedbd('0x2a')][_0xedbd('0x46')]({'where':{'id':_0x5151a3['params']['id']}})[_0xedbd('0x23')](handleEntityNotFound(_0xdfad2,null))['then'](saveUpdates(_0x5151a3[_0xedbd('0x45')],null))[_0xedbd('0x23')](respondWithResult(_0xdfad2,null))['catch'](handleError(_0xdfad2,null));};exports[_0xedbd('0x24')]=function(_0x3573e3,_0x3b5878){return db[_0xedbd('0x2a')][_0xedbd('0x46')]({'where':{'id':_0x3573e3[_0xedbd('0x40')]['id']}})[_0xedbd('0x23')](handleEntityNotFound(_0x3b5878,null))[_0xedbd('0x23')](removeEntity(_0x3b5878,null))[_0xedbd('0x43')](handleError(_0x3b5878,null));};exports[_0xedbd('0x47')]=function(_0x3583ad,_0x3fef73){return db[_0xedbd('0x2a')]['describe']()['then'](respondWithResult(_0x3fef73,null))[_0xedbd('0x43')](handleError(_0x3fef73,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ab7cd3b..be03715 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 _0x8633=['setMaxListeners','update','emit','hook','events','../../mysqldb','MailSubstatus'];(function(_0x56c394,_0x5e9757){var _0x1eeb36=function(_0x302142){while(--_0x302142){_0x56c394['push'](_0x56c394['shift']());}};_0x1eeb36(++_0x5e9757);}(_0x8633,0x66));var _0x3863=function(_0x391cb2,_0x13d9f7){_0x391cb2=_0x391cb2-0x0;var _0xf9bd33=_0x8633[_0x391cb2];return _0xf9bd33;};'use strict';var EventEmitter=require(_0x3863('0x0'));var MailSubstatus=require(_0x3863('0x1'))['db'][_0x3863('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3863('0x3')](0x0);var events={'afterUpdate':_0x3863('0x4')};function emitEvent(_0x1aae83){return function(_0x38faf4,_0x915456,_0x12f854){MailSubstatusEvents['emit'](_0x1aae83+':'+_0x38faf4['id'],_0x38faf4);MailSubstatusEvents[_0x3863('0x5')](_0x1aae83,_0x38faf4);_0x12f854(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x3863('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x14b3=['exports','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5a9f75,_0xee4b04){var _0x514e5f=function(_0x5d3104){while(--_0x5d3104){_0x5a9f75['push'](_0x5a9f75['shift']());}};_0x514e5f(++_0xee4b04);}(_0x14b3,0x1d9));var _0x314b=function(_0x493fc9,_0x597cf9){_0x493fc9=_0x493fc9-0x0;var _0x3a90c3=_0x14b3[_0x493fc9];return _0x3a90c3;};'use strict';var EventEmitter=require(_0x314b('0x0'));var MailSubstatus=require(_0x314b('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x314b('0x2')](0x0);var events={'afterUpdate':_0x314b('0x3')};function emitEvent(_0x3b8db6){return function(_0x262ce6,_0x4fd6cd,_0x235b6a){MailSubstatusEvents['emit'](_0x3b8db6+':'+_0x262ce6['id'],_0x262ce6);MailSubstatusEvents[_0x314b('0x4')](_0x3b8db6,_0x262ce6);_0x235b6a(null);};}for(var e in events){if(events[_0x314b('0x5')](e)){var event=events[e];MailSubstatus[_0x314b('0x6')](e,emitEvent(event));}}module[_0x314b('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f1398a3..22b301c 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 _0xba4d=['_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x469055,_0xda421f){var _0x413d57=function(_0x583ffc){while(--_0x583ffc){_0x469055['push'](_0x469055['shift']());}};_0x413d57(++_0xda421f);}(_0xba4d,0xab));var _0xdba4=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0xba4d[_0x47d6dc];return _0x1a1c93;};'use strict';var attributes=require(_0xdba4('0x0'));module[_0xdba4('0x1')]=function(_0x28d84f){var _0x258243=_0x28d84f[_0xdba4('0x2')];return _0x28d84f[_0xdba4('0x3')]('MailSubstatus',attributes,{'tableName':_0xdba4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x308f68,_0x118578,_0x17c2a4){return _0x258243[_0xdba4('0x5')][_0xdba4('0x6')]({'value':_0x308f68[_0xdba4('0x7')]},{'where':{'field':_0xdba4('0x8'),'value':_0x308f68[_0xdba4('0x9')][_0xdba4('0x7')]}})[_0xdba4('0xa')](function(){_0x17c2a4();})[_0xdba4('0xb')](function(_0x25d9a5){_0x17c2a4(_0x25d9a5);});}}});}; \ No newline at end of file +var _0xc94b=['./mailSubstatus.attributes','exports','models','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','then'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc94b,0x17a));var _0xbc94=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xc94b[_0x1ae5ab];return _0x1ce001;};'use strict';var attributes=require(_0xbc94('0x0'));module[_0xbc94('0x1')]=function(_0x380714){var _0x227146=_0x380714[_0xbc94('0x2')];return _0x380714['define'](_0xbc94('0x3'),attributes,{'tableName':_0xbc94('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x36d687,_0x407291,_0x3d9cae){return _0x227146[_0xbc94('0x5')]['update']({'value':_0x36d687[_0xbc94('0x6')]},{'where':{'field':_0xbc94('0x7'),'value':_0x36d687['_previousDataValues']['name']}})[_0xbc94('0x8')](function(){_0x3d9cae();})['catch'](function(_0x1f4ea3){_0x3d9cae(_0x1f4ea3);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 80128f6..064f37a 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 _0x2b33=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x1cadd9,_0x4e73e9){var _0x3778e0=function(_0x50fe71){while(--_0x50fe71){_0x1cadd9['push'](_0x1cadd9['shift']());}};_0x3778e0(++_0x4e73e9);}(_0x2b33,0x18b));var _0x32b3=function(_0x43f161,_0x3f5d32){_0x43f161=_0x43f161-0x0;var _0x143df4=_0x2b33[_0x43f161];return _0x143df4;};'use strict';var _=require(_0x32b3('0x0'));var util=require(_0x32b3('0x1'));var moment=require(_0x32b3('0x2'));var BPromise=require(_0x32b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32b3('0x4'))['db'];var utils=require(_0x32b3('0x5'));var logger=require(_0x32b3('0x6'))(_0x32b3('0x7'));var config=require('../../config/environment');var jayson=require(_0x32b3('0x8'));var client=jayson['client'][_0x32b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x565774,_0x431b29,_0x25e607){return new BPromise(function(_0x373bdf,_0x55c029){return client['request'](_0x565774,_0x25e607)[_0x32b3('0xa')](function(_0x1abf00){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x431b29,_0x32b3('0xb'));logger['debug'](_0x32b3('0xc'),_0x431b29,_0x32b3('0xb'),JSON[_0x32b3('0xd')](_0x1abf00));if(_0x1abf00[_0x32b3('0xe')]){if(_0x1abf00['error'][_0x32b3('0xf')]===0x1f4){logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x431b29,_0x1abf00['error'][_0x32b3('0x11')]);return _0x55c029(_0x1abf00[_0x32b3('0xe')][_0x32b3('0x11')]);}logger['error'](_0x32b3('0x10'),_0x431b29,_0x1abf00[_0x32b3('0xe')][_0x32b3('0x11')]);return _0x373bdf(_0x1abf00['error'][_0x32b3('0x11')]);}else{logger[_0x32b3('0x12')](_0x32b3('0x10'),_0x431b29,'request\x20sent');_0x373bdf(_0x1abf00['result'][_0x32b3('0x11')]);}})[_0x32b3('0x13')](function(_0x3ca167){logger[_0x32b3('0xe')](_0x32b3('0x10'),_0x431b29,_0x3ca167);_0x55c029(_0x3ca167);});});} \ No newline at end of file +var _0xe3a8=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3c8f26,_0x453699){var _0x5a4dd7=function(_0xd5c4b9){while(--_0xd5c4b9){_0x3c8f26['push'](_0x3c8f26['shift']());}};_0x5a4dd7(++_0x453699);}(_0xe3a8,0x121));var _0x8e3a=function(_0x5f12a0,_0x52b913){_0x5f12a0=_0x5f12a0-0x0;var _0x5dd3f8=_0xe3a8[_0x5f12a0];return _0x5dd3f8;};'use strict';var _=require(_0x8e3a('0x0'));var util=require(_0x8e3a('0x1'));var moment=require('moment');var BPromise=require(_0x8e3a('0x2'));var rs=require(_0x8e3a('0x3'));var fs=require('fs');var Redis=require(_0x8e3a('0x4'));var db=require(_0x8e3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e3a('0x6'))(_0x8e3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e3a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcc540e,_0x162291,_0x2f3282){return new BPromise(function(_0x398880,_0x1f03c7){return client['request'](_0xcc540e,_0x2f3282)[_0x8e3a('0x9')](function(_0x1a765e){logger[_0x8e3a('0xa')](_0x8e3a('0xb'),_0x162291,_0x8e3a('0xc'));logger[_0x8e3a('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x162291,_0x8e3a('0xc'),JSON['stringify'](_0x1a765e));if(_0x1a765e[_0x8e3a('0xe')]){if(_0x1a765e[_0x8e3a('0xe')][_0x8e3a('0xf')]===0x1f4){logger[_0x8e3a('0xe')](_0x8e3a('0xb'),_0x162291,_0x1a765e[_0x8e3a('0xe')][_0x8e3a('0x10')]);return _0x1f03c7(_0x1a765e[_0x8e3a('0xe')]['message']);}logger[_0x8e3a('0xe')](_0x8e3a('0xb'),_0x162291,_0x1a765e[_0x8e3a('0xe')][_0x8e3a('0x10')]);return _0x398880(_0x1a765e[_0x8e3a('0xe')][_0x8e3a('0x10')]);}else{logger[_0x8e3a('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x162291,_0x8e3a('0xc'));_0x398880(_0x1a765e[_0x8e3a('0x11')][_0x8e3a('0x10')]);}})['catch'](function(_0x4c7592){logger[_0x8e3a('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x162291,_0x4c7592);_0x1f03c7(_0x4c7592);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index bc7b6b5..48898c7 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 _0x1bf2=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x510382,_0x3be94a){var _0x579779=function(_0x41a2d3){while(--_0x41a2d3){_0x510382['push'](_0x510382['shift']());}};_0x579779(++_0x3be94a);}(_0x1bf2,0xb1));var _0x21bf=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x1bf2[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x21bf('0x0'));var util=require(_0x21bf('0x1'));var path=require(_0x21bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x21bf('0x3'));var router=express[_0x21bf('0x4')]();var fs_extra=require(_0x21bf('0x5'));var auth=require(_0x21bf('0x6'));var interaction=require(_0x21bf('0x7'));var config=require(_0x21bf('0x8'));var controller=require(_0x21bf('0x9'));router['get']('/',auth[_0x21bf('0xa')](),controller['index']);router[_0x21bf('0xb')](_0x21bf('0xc'),auth['isAuthenticated'](),controller[_0x21bf('0xd')]);router[_0x21bf('0xb')](_0x21bf('0xe'),auth['isAuthenticated'](),controller[_0x21bf('0xf')]);router[_0x21bf('0x10')]('/',auth[_0x21bf('0xa')](),controller['create']);router[_0x21bf('0x11')](_0x21bf('0xe'),auth[_0x21bf('0xa')](),controller[_0x21bf('0x12')]);router[_0x21bf('0x13')]('/:id',auth[_0x21bf('0xa')](),controller[_0x21bf('0x14')]);module[_0x21bf('0x15')]=router; \ No newline at end of file +var _0xd401=['../../config/environment','get','/describe','describe','show','post','isAuthenticated','create','put','/:id','update','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x59026b,_0x12ace5){var _0x2c6152=function(_0x193dc2){while(--_0x193dc2){_0x59026b['push'](_0x59026b['shift']());}};_0x2c6152(++_0x12ace5);}(_0xd401,0x13e));var _0x1d40=function(_0x2d2d97,_0x42643e){_0x2d2d97=_0x2d2d97-0x0;var _0x5a7287=_0xd401[_0x2d2d97];return _0x5a7287;};'use strict';var multer=require(_0x1d40('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d40('0x1'));var router=express[_0x1d40('0x2')]();var fs_extra=require(_0x1d40('0x3'));var auth=require(_0x1d40('0x4'));var interaction=require(_0x1d40('0x5'));var config=require(_0x1d40('0x6'));var controller=require('./mailTransferReport.controller');router[_0x1d40('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d40('0x7')](_0x1d40('0x8'),auth['isAuthenticated'](),controller[_0x1d40('0x9')]);router[_0x1d40('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x1d40('0xa')]);router[_0x1d40('0xb')]('/',auth[_0x1d40('0xc')](),controller[_0x1d40('0xd')]);router[_0x1d40('0xe')](_0x1d40('0xf'),auth[_0x1d40('0xc')](),controller[_0x1d40('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1d40('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 56b6b69..9eb017d 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1bfc31,_0x2c60fb){var _0x31a200=function(_0x5ea834){while(--_0x5ea834){_0x1bfc31['push'](_0x1bfc31['shift']());}};_0x31a200(++_0x2c60fb);}(_0x70e0,0x17b));var _0x070e=function(_0x2582e4,_0x370981){_0x2582e4=_0x2582e4-0x0;var _0x300d14=_0x70e0[_0x2582e4];return _0x300d14;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1c0a03,_0x456e53){var _0x4154fe=function(_0x59ed53){while(--_0x59ed53){_0x1c0a03['push'](_0x1c0a03['shift']());}};_0x4154fe(++_0x456e53);}(_0xedd9,0xfc));var _0x9edd=function(_0x5b30de,_0x5470ee){_0x5b30de=_0x5b30de-0x0;var _0x3b45d8=_0xedd9[_0x5b30de];return _0x3b45d8;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 79d1055..9912c67 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 _0xa117=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','name','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','params','includeAll','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa117,0x178));var _0x7a11=function(_0x32541e,_0x4d0a31){_0x32541e=_0x32541e-0x0;var _0x11e9ad=_0xa117[_0x32541e];return _0x11e9ad;};'use strict';var emlformat=require(_0x7a11('0x0'));var rimraf=require(_0x7a11('0x1'));var zipdir=require(_0x7a11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a11('0x3'));var BPromise=require(_0x7a11('0x4'));var Mustache=require(_0x7a11('0x5'));var util=require(_0x7a11('0x6'));var path=require(_0x7a11('0x7'));var sox=require(_0x7a11('0x8'));var csv=require(_0x7a11('0x9'));var ejs=require(_0x7a11('0xa'));var fs=require('fs');var fs_extra=require(_0x7a11('0xb'));var _=require(_0x7a11('0xc'));var squel=require(_0x7a11('0xd'));var crypto=require(_0x7a11('0xe'));var jsforce=require(_0x7a11('0xf'));var deskjs=require(_0x7a11('0x10'));var toCsv=require(_0x7a11('0x9'));var querystring=require(_0x7a11('0x11'));var Papa=require(_0x7a11('0x12'));var Redis=require(_0x7a11('0x13'));var authService=require(_0x7a11('0x14'));var qs=require(_0x7a11('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a11('0x16'));var logger=require(_0x7a11('0x17'))(_0x7a11('0x18'));var utils=require(_0x7a11('0x19'));var config=require(_0x7a11('0x1a'));var licenseUtil=require(_0x7a11('0x1b'));var db=require(_0x7a11('0x1c'))['db'];function respondWithStatusCode(_0x201d52,_0x1b4348){_0x1b4348=_0x1b4348||0xcc;return function(_0xf10aad){if(_0xf10aad){return _0x201d52['sendStatus'](_0x1b4348);}return _0x201d52['status'](_0x1b4348)[_0x7a11('0x1d')]();};}function respondWithResult(_0x44ae10,_0xbd7f45){_0xbd7f45=_0xbd7f45||0xc8;return function(_0x37d7b6){if(_0x37d7b6){return _0x44ae10[_0x7a11('0x1e')](_0xbd7f45)[_0x7a11('0x1f')](_0x37d7b6);}};}function respondWithFilteredResult(_0xb517b6,_0x3b417c){return function(_0x26609f){if(_0x26609f){var _0x1e924d=typeof _0x3b417c[_0x7a11('0x20')]===_0x7a11('0x21')&&typeof _0x3b417c[_0x7a11('0x22')]===_0x7a11('0x21');var _0x27c204=_0x26609f[_0x7a11('0x23')];var _0x1f11fa=_0x1e924d?0x0:_0x3b417c[_0x7a11('0x20')];var _0x51bca1=_0x1e924d?_0x26609f['count']:_0x3b417c['offset']+_0x3b417c[_0x7a11('0x22')];var _0xbf1fb6;if(_0x51bca1>=_0x27c204){_0x51bca1=_0x27c204;_0xbf1fb6=0xc8;}else{_0xbf1fb6=0xce;}_0xb517b6['status'](_0xbf1fb6);return _0xb517b6[_0x7a11('0x24')]('Content-Range',_0x1f11fa+'-'+_0x51bca1+'/'+_0x27c204)[_0x7a11('0x1f')](_0x26609f);}return null;};}function patchUpdates(_0x5b4fe2){return function(_0x54082f){try{jsonpatch[_0x7a11('0x25')](_0x54082f,_0x5b4fe2,!![]);}catch(_0x599f25){return BPromise['reject'](_0x599f25);}return _0x54082f[_0x7a11('0x26')]();};}function saveUpdates(_0x4c2e17,_0x341db6){return function(_0x37f11d){if(_0x37f11d){return _0x37f11d['update'](_0x4c2e17)[_0x7a11('0x27')](function(_0x5c2f0c){return _0x5c2f0c;});}return null;};}function removeEntity(_0x2aa326,_0x3eb7a0){return function(_0x1964ef){if(_0x1964ef){return _0x1964ef[_0x7a11('0x28')]()[_0x7a11('0x27')](function(){_0x2aa326[_0x7a11('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7b62,_0x43344a){return function(_0x2a6ef9){if(!_0x2a6ef9){_0x5e7b62['sendStatus'](0x194);}return _0x2a6ef9;};}function handleError(_0x15a71d,_0x1cb1f8){_0x1cb1f8=_0x1cb1f8||0x1f4;return function(_0x3ccfa1){logger[_0x7a11('0x29')](_0x3ccfa1[_0x7a11('0x2a')]);if(_0x3ccfa1['name']){delete _0x3ccfa1[_0x7a11('0x2b')];}_0x15a71d[_0x7a11('0x1e')](_0x1cb1f8)['send'](_0x3ccfa1);};}exports[_0x7a11('0x2c')]=function(_0x4ffc51,_0x18e0c6){var _0x26d555={},_0x4bfe47={},_0x1b08a7={'count':0x0,'rows':[]};var _0x1ca528=_['map'](db[_0x7a11('0x2d')][_0x7a11('0x2e')],function(_0x515c3b){return{'name':_0x515c3b[_0x7a11('0x2f')],'type':_0x515c3b[_0x7a11('0x30')][_0x7a11('0x31')]};});_0x4bfe47[_0x7a11('0x32')]=_[_0x7a11('0x33')](_0x1ca528,_0x7a11('0x2b'));_0x4bfe47[_0x7a11('0x34')]=_[_0x7a11('0x35')](_0x4ffc51[_0x7a11('0x34')]);_0x4bfe47[_0x7a11('0x36')]=_[_0x7a11('0x37')](_0x4bfe47[_0x7a11('0x32')],_0x4bfe47[_0x7a11('0x34')]);_0x26d555[_0x7a11('0x38')]=_['intersection'](_0x4bfe47[_0x7a11('0x32')],qs[_0x7a11('0x39')](_0x4ffc51[_0x7a11('0x34')][_0x7a11('0x39')]));_0x26d555[_0x7a11('0x38')]=_0x26d555[_0x7a11('0x38')][_0x7a11('0x3a')]?_0x26d555['attributes']:_0x4bfe47[_0x7a11('0x32')];if(!_0x4ffc51[_0x7a11('0x34')][_0x7a11('0x3b')](_0x7a11('0x3c'))){_0x26d555[_0x7a11('0x22')]=qs[_0x7a11('0x22')](_0x4ffc51['query'][_0x7a11('0x22')]);_0x26d555['offset']=qs[_0x7a11('0x20')](_0x4ffc51['query'][_0x7a11('0x20')]);}_0x26d555[_0x7a11('0x3d')]=qs[_0x7a11('0x3e')](_0x4ffc51['query'][_0x7a11('0x3e')]);_0x26d555[_0x7a11('0x3f')]=qs[_0x7a11('0x36')](_['pick'](_0x4ffc51[_0x7a11('0x34')],_0x4bfe47[_0x7a11('0x36')]),_0x1ca528);if(_0x4ffc51['query'][_0x7a11('0x40')]){_0x26d555[_0x7a11('0x3f')]=_[_0x7a11('0x41')](_0x26d555[_0x7a11('0x3f')],{'$or':_[_0x7a11('0x33')](_0x1ca528,function(_0x373fda){if(_0x373fda[_0x7a11('0x30')]!==_0x7a11('0x42')){var _0x13d3ac={};_0x13d3ac[_0x373fda[_0x7a11('0x2b')]]={'$like':'%'+_0x4ffc51[_0x7a11('0x34')][_0x7a11('0x40')]+'%'};return _0x13d3ac;}})});}_0x26d555=_[_0x7a11('0x41')]({},_0x26d555,_0x4ffc51['options']);var _0x1106a3={'where':_0x26d555['where']};return db[_0x7a11('0x2d')][_0x7a11('0x23')](_0x1106a3)[_0x7a11('0x27')](function(_0xf471d7){_0x1b08a7[_0x7a11('0x23')]=_0xf471d7;if(_0x4ffc51[_0x7a11('0x34')]['includeAll']){_0x26d555[_0x7a11('0x43')]=[{'all':!![]}];}return db[_0x7a11('0x2d')][_0x7a11('0x44')](_0x26d555);})[_0x7a11('0x27')](function(_0x6426bd){_0x1b08a7[_0x7a11('0x45')]=_0x6426bd;return _0x1b08a7;})[_0x7a11('0x27')](respondWithFilteredResult(_0x18e0c6,_0x26d555))[_0x7a11('0x46')](handleError(_0x18e0c6,null));};exports['show']=function(_0x1a7dac,_0x941f63){var _0x3793cc={'raw':!![],'where':{'id':_0x1a7dac[_0x7a11('0x47')]['id']}},_0x5f4cdf={};_0x5f4cdf[_0x7a11('0x32')]=_[_0x7a11('0x35')](db[_0x7a11('0x2d')][_0x7a11('0x2e')]);_0x5f4cdf[_0x7a11('0x34')]=_[_0x7a11('0x35')](_0x1a7dac[_0x7a11('0x34')]);_0x5f4cdf['filters']=_[_0x7a11('0x37')](_0x5f4cdf['model'],_0x5f4cdf[_0x7a11('0x34')]);_0x3793cc[_0x7a11('0x38')]=_['intersection'](_0x5f4cdf[_0x7a11('0x32')],qs['fields'](_0x1a7dac[_0x7a11('0x34')]['fields']));_0x3793cc[_0x7a11('0x38')]=_0x3793cc[_0x7a11('0x38')][_0x7a11('0x3a')]?_0x3793cc[_0x7a11('0x38')]:_0x5f4cdf['model'];if(_0x1a7dac[_0x7a11('0x34')][_0x7a11('0x48')]){_0x3793cc[_0x7a11('0x43')]=[{'all':!![]}];}_0x3793cc=_[_0x7a11('0x41')]({},_0x3793cc,_0x1a7dac[_0x7a11('0x49')]);return db[_0x7a11('0x2d')]['find'](_0x3793cc)[_0x7a11('0x27')](handleEntityNotFound(_0x941f63,null))['then'](respondWithResult(_0x941f63,null))[_0x7a11('0x46')](handleError(_0x941f63,null));};exports[_0x7a11('0x4a')]=function(_0x1051b2,_0x4598d3){return db['MailTransferReport'][_0x7a11('0x4a')](_0x1051b2[_0x7a11('0x4b')],{})['then'](respondWithResult(_0x4598d3,0xc9))['catch'](handleError(_0x4598d3,null));};exports[_0x7a11('0x4c')]=function(_0x1d8306,_0x469df1){if(_0x1d8306[_0x7a11('0x4b')]['id']){delete _0x1d8306[_0x7a11('0x4b')]['id'];}return db['MailTransferReport'][_0x7a11('0x4d')]({'where':{'id':_0x1d8306[_0x7a11('0x47')]['id']}})['then'](handleEntityNotFound(_0x469df1,null))[_0x7a11('0x27')](saveUpdates(_0x1d8306[_0x7a11('0x4b')],null))['then'](respondWithResult(_0x469df1,null))[_0x7a11('0x46')](handleError(_0x469df1,null));};exports[_0x7a11('0x28')]=function(_0x598e2c,_0x4eee62){return db[_0x7a11('0x2d')]['find']({'where':{'id':_0x598e2c[_0x7a11('0x47')]['id']}})[_0x7a11('0x27')](handleEntityNotFound(_0x4eee62,null))[_0x7a11('0x27')](removeEntity(_0x4eee62,null))['catch'](handleError(_0x4eee62,null));};exports[_0x7a11('0x4e')]=function(_0x50cebb,_0x2afffb){return db[_0x7a11('0x2d')]['describe']()[_0x7a11('0x27')](respondWithResult(_0x2afffb,null))[_0x7a11('0x46')](handleError(_0x2afffb,null));}; \ No newline at end of file +var _0x0fd0=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','MailTransferReport','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x519c7f,_0x175403){var _0x1cf34b=function(_0x2d0487){while(--_0x2d0487){_0x519c7f['push'](_0x519c7f['shift']());}};_0x1cf34b(++_0x175403);}(_0x0fd0,0x171));var _0x00fd=function(_0x2c9413,_0x3d42db){_0x2c9413=_0x2c9413-0x0;var _0xc74f50=_0x0fd0[_0x2c9413];return _0xc74f50;};'use strict';var emlformat=require(_0x00fd('0x0'));var rimraf=require(_0x00fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00fd('0x2'));var rp=require('request-promise');var moment=require(_0x00fd('0x3'));var BPromise=require(_0x00fd('0x4'));var Mustache=require(_0x00fd('0x5'));var util=require(_0x00fd('0x6'));var path=require('path');var sox=require(_0x00fd('0x7'));var csv=require(_0x00fd('0x8'));var ejs=require(_0x00fd('0x9'));var fs=require('fs');var fs_extra=require(_0x00fd('0xa'));var _=require(_0x00fd('0xb'));var squel=require(_0x00fd('0xc'));var crypto=require(_0x00fd('0xd'));var jsforce=require(_0x00fd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x00fd('0x8'));var querystring=require(_0x00fd('0xf'));var Papa=require(_0x00fd('0x10'));var Redis=require(_0x00fd('0x11'));var authService=require(_0x00fd('0x12'));var qs=require(_0x00fd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x00fd('0x14'))('api');var utils=require(_0x00fd('0x15'));var config=require(_0x00fd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x00fd('0x17'))['db'];function respondWithStatusCode(_0x5353a0,_0x12f4fa){_0x12f4fa=_0x12f4fa||0xcc;return function(_0x18dc97){if(_0x18dc97){return _0x5353a0[_0x00fd('0x18')](_0x12f4fa);}return _0x5353a0[_0x00fd('0x19')](_0x12f4fa)[_0x00fd('0x1a')]();};}function respondWithResult(_0x2ba2b4,_0x1f91b3){_0x1f91b3=_0x1f91b3||0xc8;return function(_0x483e01){if(_0x483e01){return _0x2ba2b4[_0x00fd('0x19')](_0x1f91b3)[_0x00fd('0x1b')](_0x483e01);}};}function respondWithFilteredResult(_0x1d7429,_0x2b9ca6){return function(_0x32e37){if(_0x32e37){var _0x3f1f4d=typeof _0x2b9ca6['offset']===_0x00fd('0x1c')&&typeof _0x2b9ca6[_0x00fd('0x1d')]===_0x00fd('0x1c');var _0x2b7348=_0x32e37[_0x00fd('0x1e')];var _0xb785ed=_0x3f1f4d?0x0:_0x2b9ca6[_0x00fd('0x1f')];var _0x5e8d76=_0x3f1f4d?_0x32e37['count']:_0x2b9ca6[_0x00fd('0x1f')]+_0x2b9ca6[_0x00fd('0x1d')];var _0x494f3e;if(_0x5e8d76>=_0x2b7348){_0x5e8d76=_0x2b7348;_0x494f3e=0xc8;}else{_0x494f3e=0xce;}_0x1d7429[_0x00fd('0x19')](_0x494f3e);return _0x1d7429[_0x00fd('0x20')](_0x00fd('0x21'),_0xb785ed+'-'+_0x5e8d76+'/'+_0x2b7348)[_0x00fd('0x1b')](_0x32e37);}return null;};}function patchUpdates(_0x324f85){return function(_0x10da67){try{jsonpatch[_0x00fd('0x22')](_0x10da67,_0x324f85,!![]);}catch(_0x59ba32){return BPromise[_0x00fd('0x23')](_0x59ba32);}return _0x10da67['save']();};}function saveUpdates(_0x4ad4e5,_0x4b36e3){return function(_0x326006){if(_0x326006){return _0x326006[_0x00fd('0x24')](_0x4ad4e5)[_0x00fd('0x25')](function(_0x54c043){return _0x54c043;});}return null;};}function removeEntity(_0x1eede9,_0x394290){return function(_0x1b42e4){if(_0x1b42e4){return _0x1b42e4[_0x00fd('0x26')]()[_0x00fd('0x25')](function(){_0x1eede9[_0x00fd('0x19')](0xcc)[_0x00fd('0x1a')]();});}};}function handleEntityNotFound(_0x2466b8,_0x49a184){return function(_0x5cc4ab){if(!_0x5cc4ab){_0x2466b8['sendStatus'](0x194);}return _0x5cc4ab;};}function handleError(_0x343bf3,_0x4c152e){_0x4c152e=_0x4c152e||0x1f4;return function(_0x2858e9){logger[_0x00fd('0x27')](_0x2858e9[_0x00fd('0x28')]);if(_0x2858e9[_0x00fd('0x29')]){delete _0x2858e9[_0x00fd('0x29')];}_0x343bf3['status'](_0x4c152e)['send'](_0x2858e9);};}exports['index']=function(_0x25a610,_0x5aa311){var _0x412879={},_0x209cb8={},_0x4357cc={'count':0x0,'rows':[]};var _0xc6dd77=_[_0x00fd('0x2a')](db[_0x00fd('0x2b')]['rawAttributes'],function(_0x26553e){return{'name':_0x26553e[_0x00fd('0x2c')],'type':_0x26553e[_0x00fd('0x2d')]['key']};});_0x209cb8['model']=_[_0x00fd('0x2a')](_0xc6dd77,_0x00fd('0x29'));_0x209cb8[_0x00fd('0x2e')]=_[_0x00fd('0x2f')](_0x25a610[_0x00fd('0x2e')]);_0x209cb8[_0x00fd('0x30')]=_[_0x00fd('0x31')](_0x209cb8[_0x00fd('0x32')],_0x209cb8['query']);_0x412879[_0x00fd('0x33')]=_[_0x00fd('0x31')](_0x209cb8[_0x00fd('0x32')],qs[_0x00fd('0x34')](_0x25a610[_0x00fd('0x2e')][_0x00fd('0x34')]));_0x412879[_0x00fd('0x33')]=_0x412879[_0x00fd('0x33')][_0x00fd('0x35')]?_0x412879[_0x00fd('0x33')]:_0x209cb8[_0x00fd('0x32')];if(!_0x25a610[_0x00fd('0x2e')][_0x00fd('0x36')]('nolimit')){_0x412879[_0x00fd('0x1d')]=qs[_0x00fd('0x1d')](_0x25a610[_0x00fd('0x2e')]['limit']);_0x412879[_0x00fd('0x1f')]=qs[_0x00fd('0x1f')](_0x25a610[_0x00fd('0x2e')][_0x00fd('0x1f')]);}_0x412879[_0x00fd('0x37')]=qs[_0x00fd('0x38')](_0x25a610['query']['sort']);_0x412879['where']=qs[_0x00fd('0x30')](_[_0x00fd('0x39')](_0x25a610[_0x00fd('0x2e')],_0x209cb8[_0x00fd('0x30')]),_0xc6dd77);if(_0x25a610[_0x00fd('0x2e')]['filter']){_0x412879[_0x00fd('0x3a')]=_[_0x00fd('0x3b')](_0x412879[_0x00fd('0x3a')],{'$or':_[_0x00fd('0x2a')](_0xc6dd77,function(_0x4c9109){if(_0x4c9109['type']!==_0x00fd('0x3c')){var _0x31dc92={};_0x31dc92[_0x4c9109[_0x00fd('0x29')]]={'$like':'%'+_0x25a610[_0x00fd('0x2e')][_0x00fd('0x3d')]+'%'};return _0x31dc92;}})});}_0x412879=_[_0x00fd('0x3b')]({},_0x412879,_0x25a610[_0x00fd('0x3e')]);var _0x3db76a={'where':_0x412879[_0x00fd('0x3a')]};return db[_0x00fd('0x2b')]['count'](_0x3db76a)[_0x00fd('0x25')](function(_0x338c96){_0x4357cc['count']=_0x338c96;if(_0x25a610['query'][_0x00fd('0x3f')]){_0x412879[_0x00fd('0x40')]=[{'all':!![]}];}return db[_0x00fd('0x2b')][_0x00fd('0x41')](_0x412879);})['then'](function(_0x345a85){_0x4357cc[_0x00fd('0x42')]=_0x345a85;return _0x4357cc;})['then'](respondWithFilteredResult(_0x5aa311,_0x412879))[_0x00fd('0x43')](handleError(_0x5aa311,null));};exports[_0x00fd('0x44')]=function(_0x28b7db,_0x8e8d37){var _0x15ab70={'raw':!![],'where':{'id':_0x28b7db[_0x00fd('0x45')]['id']}},_0x430d25={};_0x430d25[_0x00fd('0x32')]=_[_0x00fd('0x2f')](db['MailTransferReport'][_0x00fd('0x46')]);_0x430d25['query']=_[_0x00fd('0x2f')](_0x28b7db[_0x00fd('0x2e')]);_0x430d25[_0x00fd('0x30')]=_[_0x00fd('0x31')](_0x430d25['model'],_0x430d25[_0x00fd('0x2e')]);_0x15ab70['attributes']=_['intersection'](_0x430d25[_0x00fd('0x32')],qs[_0x00fd('0x34')](_0x28b7db[_0x00fd('0x2e')][_0x00fd('0x34')]));_0x15ab70['attributes']=_0x15ab70['attributes'][_0x00fd('0x35')]?_0x15ab70[_0x00fd('0x33')]:_0x430d25[_0x00fd('0x32')];if(_0x28b7db[_0x00fd('0x2e')]['includeAll']){_0x15ab70[_0x00fd('0x40')]=[{'all':!![]}];}_0x15ab70=_[_0x00fd('0x3b')]({},_0x15ab70,_0x28b7db[_0x00fd('0x3e')]);return db['MailTransferReport'][_0x00fd('0x47')](_0x15ab70)[_0x00fd('0x25')](handleEntityNotFound(_0x8e8d37,null))[_0x00fd('0x25')](respondWithResult(_0x8e8d37,null))[_0x00fd('0x43')](handleError(_0x8e8d37,null));};exports['create']=function(_0x286490,_0x5f0add){return db[_0x00fd('0x2b')][_0x00fd('0x48')](_0x286490['body'],{})[_0x00fd('0x25')](respondWithResult(_0x5f0add,0xc9))[_0x00fd('0x43')](handleError(_0x5f0add,null));};exports[_0x00fd('0x24')]=function(_0x5952c1,_0x4547e8){if(_0x5952c1[_0x00fd('0x49')]['id']){delete _0x5952c1[_0x00fd('0x49')]['id'];}return db['MailTransferReport'][_0x00fd('0x47')]({'where':{'id':_0x5952c1[_0x00fd('0x45')]['id']}})[_0x00fd('0x25')](handleEntityNotFound(_0x4547e8,null))[_0x00fd('0x25')](saveUpdates(_0x5952c1['body'],null))[_0x00fd('0x25')](respondWithResult(_0x4547e8,null))[_0x00fd('0x43')](handleError(_0x4547e8,null));};exports['destroy']=function(_0x26a839,_0xf93b1c){return db[_0x00fd('0x2b')]['find']({'where':{'id':_0x26a839[_0x00fd('0x45')]['id']}})[_0x00fd('0x25')](handleEntityNotFound(_0xf93b1c,null))[_0x00fd('0x25')](removeEntity(_0xf93b1c,null))[_0x00fd('0x43')](handleError(_0xf93b1c,null));};exports['describe']=function(_0x42ac3c,_0x153654){return db[_0x00fd('0x2b')][_0x00fd('0x4a')]()[_0x00fd('0x25')](respondWithResult(_0x153654,null))[_0x00fd('0x43')](handleError(_0x153654,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 90db2e4..826f89d 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 _0x0b78=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[{'name':_0x80b7('0xa'),'fields':[_0x80b7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5a7=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash'];(function(_0x3a9c4e,_0x493850){var _0xc8d93d=function(_0x298aa7){while(--_0x298aa7){_0x3a9c4e['push'](_0x3a9c4e['shift']());}};_0xc8d93d(++_0x493850);}(_0xf5a7,0x133));var _0x7f5a=function(_0x49c510,_0x2f5dff){_0x49c510=_0x49c510-0x0;var _0xa9eec6=_0xf5a7[_0x49c510];return _0xa9eec6;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('MailTransferReport',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[{'name':_0x7f5a('0xd'),'fields':[_0x7f5a('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 de6937b..8334eaf 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 _0x245e=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','info'];(function(_0x183f4f,_0x13fd67){var _0x5f312f=function(_0x12570b){while(--_0x12570b){_0x183f4f['push'](_0x183f4f['shift']());}};_0x5f312f(++_0x13fd67);}(_0x245e,0x16e));var _0xe245=function(_0x109e60,_0x43eff1){_0x109e60=_0x109e60-0x0;var _0x2376d4=_0x245e[_0x109e60];return _0x2376d4;};'use strict';var _=require(_0xe245('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe245('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe245('0x2'));var db=require(_0xe245('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe245('0x4'))('rpc');var config=require(_0xe245('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe245('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xd954fb,_0x269e42,_0x1f72fc){return new BPromise(function(_0x4b882e,_0x144537){return client['request'](_0xd954fb,_0x1f72fc)['then'](function(_0x111729){logger[_0xe245('0x7')](_0xe245('0x8'),_0x269e42,_0xe245('0x9'));logger[_0xe245('0xa')](_0xe245('0xb'),_0x269e42,_0xe245('0x9'),JSON[_0xe245('0xc')](_0x111729));if(_0x111729['error']){if(_0x111729[_0xe245('0xd')][_0xe245('0xe')]===0x1f4){logger[_0xe245('0xd')](_0xe245('0x8'),_0x269e42,_0x111729['error']['message']);return _0x144537(_0x111729['error'][_0xe245('0xf')]);}logger['error'](_0xe245('0x8'),_0x269e42,_0x111729[_0xe245('0xd')][_0xe245('0xf')]);return _0x4b882e(_0x111729[_0xe245('0xd')][_0xe245('0xf')]);}else{logger['info'](_0xe245('0x8'),_0x269e42,_0xe245('0x9'));_0x4b882e(_0x111729[_0xe245('0x10')]['message']);}})['catch'](function(_0xe4829){logger[_0xe245('0xd')](_0xe245('0x8'),_0x269e42,_0xe4829);_0x144537(_0xe4829);});});} \ No newline at end of file +var _0xd054=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x509410,_0x5e915a){var _0x49eeae=function(_0x3b11b9){while(--_0x3b11b9){_0x509410['push'](_0x509410['shift']());}};_0x49eeae(++_0x5e915a);}(_0xd054,0x1b2));var _0x4d05=function(_0x3faaf3,_0x4cbb63){_0x3faaf3=_0x3faaf3-0x0;var _0x8b3744=_0xd054[_0x3faaf3];return _0x8b3744;};'use strict';var _=require(_0x4d05('0x0'));var util=require(_0x4d05('0x1'));var moment=require('moment');var BPromise=require(_0x4d05('0x2'));var rs=require(_0x4d05('0x3'));var fs=require('fs');var Redis=require(_0x4d05('0x4'));var db=require(_0x4d05('0x5'))['db'];var utils=require(_0x4d05('0x6'));var logger=require(_0x4d05('0x7'))(_0x4d05('0x8'));var config=require(_0x4d05('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4d05('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23174a,_0x5d6b8c,_0x473a0e){return new BPromise(function(_0x50c06a,_0x5620f2){return client[_0x4d05('0xb')](_0x23174a,_0x473a0e)['then'](function(_0x22a9df){logger[_0x4d05('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x5d6b8c,_0x4d05('0xd'));logger[_0x4d05('0xe')](_0x4d05('0xf'),_0x5d6b8c,'request\x20sent',JSON[_0x4d05('0x10')](_0x22a9df));if(_0x22a9df[_0x4d05('0x11')]){if(_0x22a9df['error']['code']===0x1f4){logger[_0x4d05('0x11')](_0x4d05('0x12'),_0x5d6b8c,_0x22a9df[_0x4d05('0x11')][_0x4d05('0x13')]);return _0x5620f2(_0x22a9df['error'][_0x4d05('0x13')]);}logger[_0x4d05('0x11')](_0x4d05('0x12'),_0x5d6b8c,_0x22a9df[_0x4d05('0x11')]['message']);return _0x50c06a(_0x22a9df[_0x4d05('0x11')]['message']);}else{logger[_0x4d05('0xc')](_0x4d05('0x12'),_0x5d6b8c,_0x4d05('0xd'));_0x50c06a(_0x22a9df[_0x4d05('0x14')][_0x4d05('0x13')]);}})[_0x4d05('0x15')](function(_0x1a9ae5){logger[_0x4d05('0x11')](_0x4d05('0x12'),_0x5d6b8c,_0x1a9ae5);_0x5620f2(_0x1a9ae5);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 9271143..cf9e598 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 _0xeea8=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','isAuthenticated','get','describe','/:id','create','put','update','destroy','exports','multer','util'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0xeea8,0x1d2));var _0x8eea=function(_0x2e9611,_0x9e39ea){_0x2e9611=_0x2e9611-0x0;var _0xbd817a=_0xeea8[_0x2e9611];return _0xbd817a;};'use strict';var multer=require(_0x8eea('0x0'));var util=require(_0x8eea('0x1'));var path=require(_0x8eea('0x2'));var timeout=require(_0x8eea('0x3'));var express=require(_0x8eea('0x4'));var router=express['Router']();var fs_extra=require(_0x8eea('0x5'));var auth=require(_0x8eea('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8eea('0x7'));var controller=require(_0x8eea('0x8'));router['get']('/',auth[_0x8eea('0x9')](),controller['index']);router[_0x8eea('0xa')]('/describe',auth[_0x8eea('0x9')](),controller[_0x8eea('0xb')]);router[_0x8eea('0xa')](_0x8eea('0xc'),auth[_0x8eea('0x9')](),controller['show']);router['post']('/',auth[_0x8eea('0x9')](),controller[_0x8eea('0xd')]);router[_0x8eea('0xe')](_0x8eea('0xc'),auth[_0x8eea('0x9')](),controller[_0x8eea('0xf')]);router['delete'](_0x8eea('0xc'),auth[_0x8eea('0x9')](),controller[_0x8eea('0x10')]);module[_0x8eea('0x11')]=router; \ No newline at end of file +var _0x61b6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','exports','multer','path'];(function(_0x566760,_0x1f7104){var _0x30ca6d=function(_0x3aa193){while(--_0x3aa193){_0x566760['push'](_0x566760['shift']());}};_0x30ca6d(++_0x1f7104);}(_0x61b6,0x1a2));var _0x661b=function(_0xfc81ea,_0x360207){_0xfc81ea=_0xfc81ea-0x0;var _0x116727=_0x61b6[_0xfc81ea];return _0x116727;};'use strict';var multer=require(_0x661b('0x0'));var util=require('util');var path=require(_0x661b('0x1'));var timeout=require(_0x661b('0x2'));var express=require(_0x661b('0x3'));var router=express[_0x661b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x661b('0x5'));var interaction=require(_0x661b('0x6'));var config=require('../../config/environment');var controller=require(_0x661b('0x7'));router[_0x661b('0x8')]('/',auth['isAuthenticated'](),controller[_0x661b('0x9')]);router['get'](_0x661b('0xa'),auth[_0x661b('0xb')](),controller[_0x661b('0xc')]);router[_0x661b('0x8')](_0x661b('0xd'),auth[_0x661b('0xb')](),controller[_0x661b('0xe')]);router[_0x661b('0xf')]('/',auth[_0x661b('0xb')](),controller['create']);router[_0x661b('0x10')]('/:id',auth[_0x661b('0xb')](),controller[_0x661b('0x11')]);router[_0x661b('0x12')](_0x661b('0xd'),auth[_0x661b('0xb')](),controller['destroy']);module[_0x661b('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 3cc325a..9455c29 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 _0xe661=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','sequelize','moment','exports'];(function(_0x533db2,_0x5613ba){var _0x9e98f9=function(_0x5be317){while(--_0x5be317){_0x533db2['push'](_0x533db2['shift']());}};_0x9e98f9(++_0x5613ba);}(_0xe661,0x184));var _0x1e66=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe661[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x1e66('0x0'));var moment=require(_0x1e66('0x1'));module[_0x1e66('0x2')]={'channel':{'type':Sequelize[_0x1e66('0x3')]},'membername':{'type':Sequelize[_0x1e66('0x3')]},'interface':{'type':Sequelize[_0x1e66('0x3')]},'type':{'type':Sequelize[_0x1e66('0x3')],'defaultValue':_0x1e66('0x4'),'comment':_0x1e66('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1e66('0x6')],'set':function(_0x53738f){var _0x5c1dd1=moment(_0x53738f);var _0x29cc44=moment(this[_0x1e66('0x7')](_0x1e66('0x8')));var _0x1801ab=_0x5c1dd1['diff'](_0x29cc44,_0x1e66('0x9'));this[_0x1e66('0xa')]('exitAt',_0x53738f);this[_0x1e66('0xa')](_0x1e66('0xb'),_0x1801ab>=0x0?_0x1801ab:null);}},'data1':{'type':Sequelize[_0x1e66('0x3')],'comment':_0x1e66('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x1e66('0xd')},'data3':{'type':Sequelize[_0x1e66('0x3')],'comment':_0x1e66('0xe')},'data4':{'type':Sequelize[_0x1e66('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x1e66('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x1e66('0x10')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x21ab=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds'];(function(_0x51294b,_0x2d01c8){var _0x5e2794=function(_0x5ea6e0){while(--_0x5ea6e0){_0x51294b['push'](_0x51294b['shift']());}};_0x5e2794(++_0x2d01c8);}(_0x21ab,0x8e));var _0xb21a=function(_0x425ecd,_0x1e1bed){_0x425ecd=_0x425ecd-0x0;var _0xddc406=_0x21ab[_0x425ecd];return _0xddc406;};'use strict';var Sequelize=require(_0xb21a('0x0'));var moment=require(_0xb21a('0x1'));module[_0xb21a('0x2')]={'channel':{'type':Sequelize[_0xb21a('0x3')]},'membername':{'type':Sequelize[_0xb21a('0x3')]},'interface':{'type':Sequelize[_0xb21a('0x3')]},'type':{'type':Sequelize[_0xb21a('0x3')],'defaultValue':_0xb21a('0x4'),'comment':_0xb21a('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xb21a('0x6')]},'exitAt':{'type':Sequelize[_0xb21a('0x6')],'set':function(_0x25519a){var _0x5f2dc9=moment(_0x25519a);var _0x58cfd0=moment(this[_0xb21a('0x7')](_0xb21a('0x8')));var _0x1cbd4e=_0x5f2dc9[_0xb21a('0x9')](_0x58cfd0,_0xb21a('0xa'));this[_0xb21a('0xb')]('exitAt',_0x25519a);this[_0xb21a('0xb')](_0xb21a('0xc'),_0x1cbd4e>=0x0?_0x1cbd4e:null);}},'data1':{'type':Sequelize[_0xb21a('0x3')],'comment':_0xb21a('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xb21a('0xe')},'data3':{'type':Sequelize[_0xb21a('0x3')],'comment':_0xb21a('0xf')},'data4':{'type':Sequelize[_0xb21a('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xb21a('0x3')],'comment':_0xb21a('0x10')},'role':{'type':Sequelize[_0xb21a('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index f4d7a21..bcdec6e 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x55ca,0x126));var _0xa55c=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x55ca[_0x158da6];return _0x429c30;};'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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x28c261,_0x4cc3b4){var _0x1983a9=function(_0x552c21){while(--_0x552c21){_0x28c261['push'](_0x28c261['shift']());}};_0x1983a9(++_0x4cc3b4);}(_0x3e74,0x175));var _0x43e7=function(_0x5a0896,_0x52312a){_0x5a0896=_0x5a0896-0x0;var _0x5a58b2=_0x3e74[_0x5a0896];return _0x5a58b2;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 732c4b5..e668f66 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 _0x40b7=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40b7,0x1e2));var _0x740b=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x40b7[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x740b('0x0'));var util=require(_0x740b('0x1'));var logger=require(_0x740b('0x2'))(_0x740b('0x3'));var moment=require(_0x740b('0x4'));var BPromise=require('bluebird');var rp=require(_0x740b('0x5'));var fs=require('fs');var path=require(_0x740b('0x6'));var rimraf=require(_0x740b('0x7'));var config=require(_0x740b('0x8'));var attributes=require(_0x740b('0x9'));module[_0x740b('0xa')]=function(_0x551015,_0x2c68c0){return _0x551015[_0x740b('0xb')](_0x740b('0xc'),attributes,{'tableName':_0x740b('0xd'),'paranoid':![],'indexes':[{'name':_0x740b('0xe'),'fields':[_0x740b('0xf'),_0x740b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x96f1=['./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x167ebd,_0x51a9ba){var _0x17af42=function(_0x23c24f){while(--_0x23c24f){_0x167ebd['push'](_0x167ebd['shift']());}};_0x17af42(++_0x51a9ba);}(_0x96f1,0x19c));var _0x196f=function(_0x193551,_0x29ab95){_0x193551=_0x193551-0x0;var _0x188c8f=_0x96f1[_0x193551];return _0x188c8f;};'use strict';var _=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var logger=require(_0x196f('0x2'))(_0x196f('0x3'));var moment=require(_0x196f('0x4'));var BPromise=require(_0x196f('0x5'));var rp=require(_0x196f('0x6'));var fs=require('fs');var path=require(_0x196f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x196f('0x8'));module[_0x196f('0x9')]=function(_0x267906,_0x1f401c){return _0x267906[_0x196f('0xa')]('MemberReport',attributes,{'tableName':_0x196f('0xb'),'paranoid':![],'indexes':[{'name':_0x196f('0xc'),'fields':[_0x196f('0xd'),_0x196f('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 7688cb1..e5d3185 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 _0xe5e0=['result','catch','GetMemberReport','findAll','options','raw','attributes','limit','include','map','model','CreateMemberReport','MemberReport','UpdateMemberReport','update','body','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x3e0aa1,_0xdaf360){_0x3e0aa1=_0x3e0aa1-0x0;var _0x4b1470=_0xe5e0[_0x3e0aa1];return _0x4b1470;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var moment=require(_0x0e5e('0x2'));var BPromise=require(_0x0e5e('0x3'));var rs=require(_0x0e5e('0x4'));var fs=require('fs');var Redis=require(_0x0e5e('0x5'));var db=require(_0x0e5e('0x6'))['db'];var utils=require(_0x0e5e('0x7'));var logger=require(_0x0e5e('0x8'))('rpc');var config=require(_0x0e5e('0x9'));var jayson=require(_0x0e5e('0xa'));var client=jayson[_0x0e5e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9800,_0x437362,_0x827738){return new BPromise(function(_0x4093cc,_0x6eba1c){return client[_0x0e5e('0xc')](_0x4b9800,_0x827738)[_0x0e5e('0xd')](function(_0x4b8feb){logger['info']('MemberReport,\x20%s,\x20%s',_0x437362,_0x0e5e('0xe'));logger[_0x0e5e('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x437362,'request\x20sent',JSON[_0x0e5e('0x10')](_0x4b8feb));if(_0x4b8feb[_0x0e5e('0x11')]){if(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x12')]===0x1f4){logger['error'](_0x0e5e('0x13'),_0x437362,_0x4b8feb[_0x0e5e('0x11')]['message']);return _0x6eba1c(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);}logger[_0x0e5e('0x11')]('MemberReport,\x20%s,\x20%s',_0x437362,_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);return _0x4093cc(_0x4b8feb[_0x0e5e('0x11')][_0x0e5e('0x14')]);}else{logger[_0x0e5e('0x15')](_0x0e5e('0x13'),_0x437362,'request\x20sent');_0x4093cc(_0x4b8feb[_0x0e5e('0x16')][_0x0e5e('0x14')]);}})[_0x0e5e('0x17')](function(_0x245920){logger[_0x0e5e('0x11')]('MemberReport,\x20%s,\x20%s',_0x437362,_0x245920);_0x6eba1c(_0x245920);});});}exports[_0x0e5e('0x18')]=function(_0x2efa7f){var _0x4bfc60=this;return new Promise(function(_0x29597b,_0x3fd280){return db['MemberReport'][_0x0e5e('0x19')]({'raw':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')]['where']||null:null,'attributes':_0x2efa7f['options']?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1c')]||null:null,'limit':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1d')]||null:null,'include':_0x2efa7f[_0x0e5e('0x1a')]?_0x2efa7f[_0x0e5e('0x1a')][_0x0e5e('0x1e')]?_[_0x0e5e('0x1f')](_0x2efa7f[_0x0e5e('0x1a')]['include'],function(_0x742ee8){return{'model':db[_0x742ee8[_0x0e5e('0x20')]],'as':_0x742ee8['as'],'attributes':_0x742ee8[_0x0e5e('0x1c')],'include':_0x742ee8[_0x0e5e('0x1e')]?_[_0x0e5e('0x1f')](_0x742ee8[_0x0e5e('0x1e')],function(_0x46cbd7){return{'model':db[_0x46cbd7['model']],'as':_0x46cbd7['as'],'attributes':_0x46cbd7[_0x0e5e('0x1c')],'include':_0x46cbd7['include']?_[_0x0e5e('0x1f')](_0x46cbd7[_0x0e5e('0x1e')],function(_0x5e3a60){return{'model':db[_0x5e3a60[_0x0e5e('0x20')]],'as':_0x5e3a60['as'],'attributes':_0x5e3a60[_0x0e5e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0e5e('0xd')](function(_0x563870){logger[_0x0e5e('0x15')]('GetMemberReport',_0x2efa7f);logger[_0x0e5e('0xf')](_0x0e5e('0x18'),_0x2efa7f,JSON[_0x0e5e('0x10')](_0x563870));_0x29597b(_0x563870);})['catch'](function(_0x38930f){logger[_0x0e5e('0x11')](_0x0e5e('0x18'),_0x38930f[_0x0e5e('0x14')],_0x2efa7f);_0x3fd280(_0x4bfc60[_0x0e5e('0x11')](0x1f4,_0x38930f[_0x0e5e('0x14')]));});});};exports[_0x0e5e('0x21')]=function(_0x4ca32e){var _0x34455b=this;return new Promise(function(_0x43a2be,_0x2c7dff){return db[_0x0e5e('0x22')]['create'](_0x4ca32e['body'],{'raw':_0x4ca32e['options']?_0x4ca32e['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x44b4e7){logger[_0x0e5e('0x15')](_0x0e5e('0x21'),_0x4ca32e);logger['debug'](_0x0e5e('0x21'),_0x4ca32e,JSON['stringify'](_0x44b4e7));_0x43a2be(_0x44b4e7);})['catch'](function(_0x1fc5c5){logger[_0x0e5e('0x11')](_0x0e5e('0x21'),_0x1fc5c5[_0x0e5e('0x14')],_0x4ca32e);_0x2c7dff(_0x34455b[_0x0e5e('0x11')](0x1f4,_0x1fc5c5['message']));});});};exports[_0x0e5e('0x23')]=function(_0x3621c9){var _0x308f4d=this;return new Promise(function(_0x1744d9,_0x38871b){return db[_0x0e5e('0x22')][_0x0e5e('0x24')](_0x3621c9[_0x0e5e('0x25')],{'raw':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9['options'][_0x0e5e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9[_0x0e5e('0x1a')][_0x0e5e('0x26')]||null:null,'attributes':_0x3621c9['options']?_0x3621c9[_0x0e5e('0x1a')]['attributes']||null:null,'limit':_0x3621c9[_0x0e5e('0x1a')]?_0x3621c9[_0x0e5e('0x1a')][_0x0e5e('0x1d')]||null:null})['then'](function(_0x471b0f){logger[_0x0e5e('0x15')](_0x0e5e('0x23'),_0x3621c9);logger['debug']('UpdateMemberReport',_0x3621c9,JSON[_0x0e5e('0x10')](_0x471b0f));_0x1744d9(_0x471b0f);})[_0x0e5e('0x17')](function(_0x3a962c){logger['error'](_0x0e5e('0x23'),_0x3a962c[_0x0e5e('0x14')],_0x3621c9);_0x38871b(_0x308f4d[_0x0e5e('0x11')](0x1f4,_0x3a962c[_0x0e5e('0x14')]));});});}; \ No newline at end of file +var _0xc03e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','map','model','CreateMemberReport','create','body','raw','UpdateMemberReport','update','lodash','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xc03e,0x15a));var _0xec03=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xc03e[_0x16e57d];return _0x40239c;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec03('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec03('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xec03('0x3'));var logger=require(_0xec03('0x4'))(_0xec03('0x5'));var config=require(_0xec03('0x6'));var jayson=require(_0xec03('0x7'));var client=jayson[_0xec03('0x8')][_0xec03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcaaf03,_0x278f90,_0x529ebd){return new BPromise(function(_0x4205e9,_0xb0638e){return client[_0xec03('0xa')](_0xcaaf03,_0x529ebd)[_0xec03('0xb')](function(_0x4d7e09){logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));logger[_0xec03('0xf')](_0xec03('0x10'),_0x278f90,_0xec03('0xe'),JSON[_0xec03('0x11')](_0x4d7e09));if(_0x4d7e09[_0xec03('0x12')]){if(_0x4d7e09['error'][_0xec03('0x13')]===0x1f4){logger[_0xec03('0x12')](_0xec03('0xd'),_0x278f90,_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);return _0xb0638e(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}logger[_0xec03('0x12')]('MemberReport,\x20%s,\x20%s',_0x278f90,_0x4d7e09['error']['message']);return _0x4205e9(_0x4d7e09[_0xec03('0x12')][_0xec03('0x14')]);}else{logger[_0xec03('0xc')](_0xec03('0xd'),_0x278f90,_0xec03('0xe'));_0x4205e9(_0x4d7e09[_0xec03('0x15')][_0xec03('0x14')]);}})[_0xec03('0x16')](function(_0x5c2f1a){logger[_0xec03('0x12')]('MemberReport,\x20%s,\x20%s',_0x278f90,_0x5c2f1a);_0xb0638e(_0x5c2f1a);});});}exports[_0xec03('0x17')]=function(_0x5e8ae2){var _0x25292d=this;return new Promise(function(_0x5b3e04,_0x57dc2d){return db[_0xec03('0x18')][_0xec03('0x19')]({'raw':_0x5e8ae2[_0xec03('0x1a')]?_0x5e8ae2[_0xec03('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e8ae2[_0xec03('0x1a')]?_0x5e8ae2['options'][_0xec03('0x1b')]||null:null,'attributes':_0x5e8ae2[_0xec03('0x1a')]?_0x5e8ae2[_0xec03('0x1a')][_0xec03('0x1c')]||null:null,'limit':_0x5e8ae2[_0xec03('0x1a')]?_0x5e8ae2[_0xec03('0x1a')][_0xec03('0x1d')]||null:null,'include':_0x5e8ae2[_0xec03('0x1a')]?_0x5e8ae2['options'][_0xec03('0x1e')]?_[_0xec03('0x1f')](_0x5e8ae2[_0xec03('0x1a')][_0xec03('0x1e')],function(_0x33de1e){return{'model':db[_0x33de1e[_0xec03('0x20')]],'as':_0x33de1e['as'],'attributes':_0x33de1e['attributes'],'include':_0x33de1e[_0xec03('0x1e')]?_[_0xec03('0x1f')](_0x33de1e['include'],function(_0x2bfcf6){return{'model':db[_0x2bfcf6[_0xec03('0x20')]],'as':_0x2bfcf6['as'],'attributes':_0x2bfcf6[_0xec03('0x1c')],'include':_0x2bfcf6[_0xec03('0x1e')]?_[_0xec03('0x1f')](_0x2bfcf6['include'],function(_0x73cc4f){return{'model':db[_0x73cc4f[_0xec03('0x20')]],'as':_0x73cc4f['as'],'attributes':_0x73cc4f[_0xec03('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xec03('0xb')](function(_0x29e904){logger['info'](_0xec03('0x17'),_0x5e8ae2);logger[_0xec03('0xf')]('GetMemberReport',_0x5e8ae2,JSON['stringify'](_0x29e904));_0x5b3e04(_0x29e904);})[_0xec03('0x16')](function(_0x12b5c9){logger[_0xec03('0x12')](_0xec03('0x17'),_0x12b5c9[_0xec03('0x14')],_0x5e8ae2);_0x57dc2d(_0x25292d[_0xec03('0x12')](0x1f4,_0x12b5c9[_0xec03('0x14')]));});});};exports[_0xec03('0x21')]=function(_0x51fad6){var _0x28f60c=this;return new Promise(function(_0x31c08d,_0x2bd889){return db[_0xec03('0x18')][_0xec03('0x22')](_0x51fad6[_0xec03('0x23')],{'raw':_0x51fad6[_0xec03('0x1a')]?_0x51fad6[_0xec03('0x1a')][_0xec03('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x5d441b){logger['info'](_0xec03('0x21'),_0x51fad6);logger[_0xec03('0xf')](_0xec03('0x21'),_0x51fad6,JSON[_0xec03('0x11')](_0x5d441b));_0x31c08d(_0x5d441b);})['catch'](function(_0x576d5e){logger['error']('CreateMemberReport',_0x576d5e[_0xec03('0x14')],_0x51fad6);_0x2bd889(_0x28f60c[_0xec03('0x12')](0x1f4,_0x576d5e[_0xec03('0x14')]));});});};exports[_0xec03('0x25')]=function(_0x11c75b){var _0x3d7d98=this;return new Promise(function(_0x23a26b,_0x1cee38){return db[_0xec03('0x18')][_0xec03('0x26')](_0x11c75b[_0xec03('0x23')],{'raw':_0x11c75b[_0xec03('0x1a')]?_0x11c75b['options'][_0xec03('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11c75b[_0xec03('0x1a')]?_0x11c75b[_0xec03('0x1a')]['where']||null:null,'attributes':_0x11c75b[_0xec03('0x1a')]?_0x11c75b[_0xec03('0x1a')][_0xec03('0x1c')]||null:null,'limit':_0x11c75b[_0xec03('0x1a')]?_0x11c75b[_0xec03('0x1a')][_0xec03('0x1d')]||null:null})[_0xec03('0xb')](function(_0x3c55b7){logger[_0xec03('0xc')](_0xec03('0x25'),_0x11c75b);logger[_0xec03('0xf')]('UpdateMemberReport',_0x11c75b,JSON[_0xec03('0x11')](_0x3c55b7));_0x23a26b(_0x3c55b7);})[_0xec03('0x16')](function(_0x37819a){logger[_0xec03('0x12')](_0xec03('0x25'),_0x37819a[_0xec03('0x14')],_0x11c75b);_0x1cee38(_0x3d7d98[_0xec03('0x12')](0x1f4,_0x37819a[_0xec03('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 38f3a28..cd52735 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 _0xa482=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express'];(function(_0x13b9e9,_0x1d7b9f){var _0xff84d7=function(_0x3b61ba){while(--_0x3b61ba){_0x13b9e9['push'](_0x13b9e9['shift']());}};_0xff84d7(++_0x1d7b9f);}(_0xa482,0x181));var _0x2a48=function(_0x3749b1,_0x4a6576){_0x3749b1=_0x3749b1-0x0;var _0xd86177=_0xa482[_0x3749b1];return _0xd86177;};'use strict';var multer=require(_0x2a48('0x0'));var util=require(_0x2a48('0x1'));var path=require(_0x2a48('0x2'));var timeout=require(_0x2a48('0x3'));var express=require(_0x2a48('0x4'));var router=express[_0x2a48('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2a48('0x6'));var interaction=require(_0x2a48('0x7'));var config=require(_0x2a48('0x8'));var controller=require(_0x2a48('0x9'));router[_0x2a48('0xa')]('/',controller[_0x2a48('0xb')]);module[_0x2a48('0xc')]=router; \ No newline at end of file +var _0x59b0=['index','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x2baa5d,_0x42a1cb){var _0x88bf18=function(_0x45385f){while(--_0x45385f){_0x2baa5d['push'](_0x2baa5d['shift']());}};_0x88bf18(++_0x42a1cb);}(_0x59b0,0x188));var _0x059b=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x59b0[_0x87506e];return _0x5496a4;};'use strict';var multer=require(_0x059b('0x0'));var util=require('util');var path=require(_0x059b('0x1'));var timeout=require('connect-timeout');var express=require(_0x059b('0x2'));var router=express[_0x059b('0x3')]();var fs_extra=require(_0x059b('0x4'));var auth=require(_0x059b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x059b('0x6'));var controller=require('./migration.controller');router[_0x059b('0x7')]('/',controller[_0x059b('0x8')]);module[_0x059b('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 00189b5..84099ec 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 _0x2d7a=['STRING','version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d7a,0x104));var _0xa2d7=function(_0x5c80b7,_0x5c6250){_0x5c80b7=_0x5c80b7-0x0;var _0x4a20a7=_0x2d7a[_0x5c80b7];return _0x4a20a7;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xa2d7('0x0')],'unique':_0xa2d7('0x1')}}; \ No newline at end of file +var _0x52cb=['version','sequelize','exports','STRING'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x52cb,0x91));var _0xb52c=function(_0x2d4f98,_0x173ded){_0x2d4f98=_0x2d4f98-0x0;var _0x3b6084=_0x52cb[_0x2d4f98];return _0x3b6084;};'use strict';var Sequelize=require(_0xb52c('0x0'));module[_0xb52c('0x1')]={'version':{'type':Sequelize[_0xb52c('0x2')],'unique':_0xb52c('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6088d4a..4d1fc9a 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 _0x3590=['count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','send','index','Migration','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','includeAll','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0x3590,0x130));var _0x0359=function(_0x46979b,_0x1a80da){_0x46979b=_0x46979b-0x0;var _0x19785a=_0x3590[_0x46979b];return _0x19785a;};'use strict';var emlformat=require(_0x0359('0x0'));var rimraf=require(_0x0359('0x1'));var zipdir=require(_0x0359('0x2'));var jsonpatch=require(_0x0359('0x3'));var rp=require(_0x0359('0x4'));var moment=require(_0x0359('0x5'));var BPromise=require(_0x0359('0x6'));var Mustache=require('mustache');var util=require(_0x0359('0x7'));var path=require(_0x0359('0x8'));var sox=require(_0x0359('0x9'));var csv=require(_0x0359('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0359('0xb'));var _=require(_0x0359('0xc'));var squel=require(_0x0359('0xd'));var crypto=require(_0x0359('0xe'));var jsforce=require(_0x0359('0xf'));var deskjs=require(_0x0359('0x10'));var toCsv=require(_0x0359('0xa'));var querystring=require('querystring');var Papa=require(_0x0359('0x11'));var Redis=require(_0x0359('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0359('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0359('0x14'))(_0x0359('0x15'));var utils=require(_0x0359('0x16'));var config=require(_0x0359('0x17'));var licenseUtil=require(_0x0359('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509c1b,_0x260cd3){_0x260cd3=_0x260cd3||0xcc;return function(_0x412a04){if(_0x412a04){return _0x509c1b[_0x0359('0x19')](_0x260cd3);}return _0x509c1b[_0x0359('0x1a')](_0x260cd3)[_0x0359('0x1b')]();};}function respondWithResult(_0x245b25,_0x30bd3d){_0x30bd3d=_0x30bd3d||0xc8;return function(_0x49fd9c){if(_0x49fd9c){return _0x245b25[_0x0359('0x1a')](_0x30bd3d)[_0x0359('0x1c')](_0x49fd9c);}};}function respondWithFilteredResult(_0x2e1fd9,_0x54314e){return function(_0x553574){if(_0x553574){var _0x266747=typeof _0x54314e[_0x0359('0x1d')]===_0x0359('0x1e')&&typeof _0x54314e['limit']===_0x0359('0x1e');var _0x928fcd=_0x553574[_0x0359('0x1f')];var _0x48bc91=_0x266747?0x0:_0x54314e[_0x0359('0x1d')];var _0x245a2d=_0x266747?_0x553574['count']:_0x54314e[_0x0359('0x1d')]+_0x54314e[_0x0359('0x20')];var _0x4bdbc4;if(_0x245a2d>=_0x928fcd){_0x245a2d=_0x928fcd;_0x4bdbc4=0xc8;}else{_0x4bdbc4=0xce;}_0x2e1fd9['status'](_0x4bdbc4);return _0x2e1fd9[_0x0359('0x21')](_0x0359('0x22'),_0x48bc91+'-'+_0x245a2d+'/'+_0x928fcd)['json'](_0x553574);}return null;};}function patchUpdates(_0xf85f49){return function(_0x5d7021){try{jsonpatch[_0x0359('0x23')](_0x5d7021,_0xf85f49,!![]);}catch(_0x5903c0){return BPromise[_0x0359('0x24')](_0x5903c0);}return _0x5d7021['save']();};}function saveUpdates(_0x237e9e,_0xf27df5){return function(_0x2f290e){if(_0x2f290e){return _0x2f290e[_0x0359('0x25')](_0x237e9e)[_0x0359('0x26')](function(_0x4a82b6){return _0x4a82b6;});}return null;};}function removeEntity(_0x2c6852,_0x1a002a){return function(_0x1cd14f){if(_0x1cd14f){return _0x1cd14f[_0x0359('0x27')]()[_0x0359('0x26')](function(){_0x2c6852[_0x0359('0x1a')](0xcc)[_0x0359('0x1b')]();});}};}function handleEntityNotFound(_0x794d2,_0xcdfb3e){return function(_0x28244c){if(!_0x28244c){_0x794d2[_0x0359('0x19')](0x194);}return _0x28244c;};}function handleError(_0x4ad6fd,_0x48c7b8){_0x48c7b8=_0x48c7b8||0x1f4;return function(_0x50cc01){logger['error'](_0x50cc01[_0x0359('0x28')]);if(_0x50cc01['name']){delete _0x50cc01['name'];}_0x4ad6fd[_0x0359('0x1a')](_0x48c7b8)[_0x0359('0x29')](_0x50cc01);};}exports[_0x0359('0x2a')]=function(_0x13cca3,_0x535b72){var _0x3486df={},_0x117773={},_0x37119d={'count':0x0,'rows':[]};var _0x12d3cd=_['map'](db[_0x0359('0x2b')][_0x0359('0x2c')],function(_0x3531d7){return{'name':_0x3531d7[_0x0359('0x2d')],'type':_0x3531d7[_0x0359('0x2e')]['key']};});_0x117773[_0x0359('0x2f')]=_['map'](_0x12d3cd,_0x0359('0x30'));_0x117773[_0x0359('0x31')]=_[_0x0359('0x32')](_0x13cca3[_0x0359('0x31')]);_0x117773[_0x0359('0x33')]=_['intersection'](_0x117773['model'],_0x117773['query']);_0x3486df[_0x0359('0x34')]=_[_0x0359('0x35')](_0x117773['model'],qs['fields'](_0x13cca3[_0x0359('0x31')]['fields']));_0x3486df['attributes']=_0x3486df[_0x0359('0x34')]['length']?_0x3486df[_0x0359('0x34')]:_0x117773['model'];if(!_0x13cca3[_0x0359('0x31')][_0x0359('0x36')](_0x0359('0x37'))){_0x3486df['limit']=qs[_0x0359('0x20')](_0x13cca3[_0x0359('0x31')][_0x0359('0x20')]);_0x3486df[_0x0359('0x1d')]=qs['offset'](_0x13cca3[_0x0359('0x31')][_0x0359('0x1d')]);}_0x3486df[_0x0359('0x38')]=qs['sort'](_0x13cca3['query']['sort']);_0x3486df[_0x0359('0x39')]=qs['filters'](_[_0x0359('0x3a')](_0x13cca3['query'],_0x117773[_0x0359('0x33')]),_0x12d3cd);if(_0x13cca3['query'][_0x0359('0x3b')]){_0x3486df[_0x0359('0x39')]=_['merge'](_0x3486df[_0x0359('0x39')],{'$or':_[_0x0359('0x3c')](_0x12d3cd,function(_0x2a591a){if(_0x2a591a[_0x0359('0x2e')]!==_0x0359('0x3d')){var _0x5bc136={};_0x5bc136[_0x2a591a[_0x0359('0x30')]]={'$like':'%'+_0x13cca3[_0x0359('0x31')][_0x0359('0x3b')]+'%'};return _0x5bc136;}})});}_0x3486df=_[_0x0359('0x3e')]({},_0x3486df,_0x13cca3['options']);var _0x14d215={'where':_0x3486df[_0x0359('0x39')]};return db[_0x0359('0x2b')][_0x0359('0x1f')](_0x14d215)[_0x0359('0x26')](function(_0x22bdc6){_0x37119d[_0x0359('0x1f')]=_0x22bdc6;if(_0x13cca3[_0x0359('0x31')][_0x0359('0x3f')]){_0x3486df['include']=[{'all':!![]}];}return db[_0x0359('0x2b')][_0x0359('0x40')](_0x3486df);})[_0x0359('0x26')](function(_0x9d97f7){_0x37119d[_0x0359('0x41')]=_0x9d97f7;return _0x37119d;})[_0x0359('0x26')](respondWithFilteredResult(_0x535b72,_0x3486df))[_0x0359('0x42')](handleError(_0x535b72,null));}; \ No newline at end of file +var _0x78b9=['apply','reject','save','destroy','then','stack','name','send','Migration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','type','options','includeAll','include','findAll','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x5d6cbb,_0x28bd38){var _0x5d0bc9=function(_0x8060fe){while(--_0x8060fe){_0x5d6cbb['push'](_0x5d6cbb['shift']());}};_0x5d0bc9(++_0x28bd38);}(_0x78b9,0x123));var _0x978b=function(_0x46b697,_0xe71b0f){_0x46b697=_0x46b697-0x0;var _0x18fd3e=_0x78b9[_0x46b697];return _0x18fd3e;};'use strict';var emlformat=require(_0x978b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x978b('0x1'));var jsonpatch=require(_0x978b('0x2'));var rp=require(_0x978b('0x3'));var moment=require(_0x978b('0x4'));var BPromise=require(_0x978b('0x5'));var Mustache=require(_0x978b('0x6'));var util=require(_0x978b('0x7'));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(_0x978b('0x8'));var _=require(_0x978b('0x9'));var squel=require(_0x978b('0xa'));var crypto=require(_0x978b('0xb'));var jsforce=require(_0x978b('0xc'));var deskjs=require(_0x978b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x978b('0xe'));var Papa=require(_0x978b('0xf'));var Redis=require(_0x978b('0x10'));var authService=require(_0x978b('0x11'));var qs=require(_0x978b('0x12'));var as=require(_0x978b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x978b('0x14'))(_0x978b('0x15'));var utils=require(_0x978b('0x16'));var config=require(_0x978b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x978b('0x18'))['db'];function respondWithStatusCode(_0x3644b3,_0x21fc33){_0x21fc33=_0x21fc33||0xcc;return function(_0x4dae19){if(_0x4dae19){return _0x3644b3[_0x978b('0x19')](_0x21fc33);}return _0x3644b3[_0x978b('0x1a')](_0x21fc33)[_0x978b('0x1b')]();};}function respondWithResult(_0x10d02c,_0x27ec08){_0x27ec08=_0x27ec08||0xc8;return function(_0x1175df){if(_0x1175df){return _0x10d02c[_0x978b('0x1a')](_0x27ec08)[_0x978b('0x1c')](_0x1175df);}};}function respondWithFilteredResult(_0x4c845b,_0x4068d9){return function(_0x1adb5c){if(_0x1adb5c){var _0x42de73=typeof _0x4068d9[_0x978b('0x1d')]===_0x978b('0x1e')&&typeof _0x4068d9[_0x978b('0x1f')]===_0x978b('0x1e');var _0x2d0b9b=_0x1adb5c['count'];var _0x17641a=_0x42de73?0x0:_0x4068d9[_0x978b('0x1d')];var _0xbe000e=_0x42de73?_0x1adb5c[_0x978b('0x20')]:_0x4068d9[_0x978b('0x1d')]+_0x4068d9['limit'];var _0x281fa1;if(_0xbe000e>=_0x2d0b9b){_0xbe000e=_0x2d0b9b;_0x281fa1=0xc8;}else{_0x281fa1=0xce;}_0x4c845b['status'](_0x281fa1);return _0x4c845b['set'](_0x978b('0x21'),_0x17641a+'-'+_0xbe000e+'/'+_0x2d0b9b)[_0x978b('0x1c')](_0x1adb5c);}return null;};}function patchUpdates(_0x317970){return function(_0x10a184){try{jsonpatch[_0x978b('0x22')](_0x10a184,_0x317970,!![]);}catch(_0x2457ba){return BPromise[_0x978b('0x23')](_0x2457ba);}return _0x10a184[_0x978b('0x24')]();};}function saveUpdates(_0x3c3ce7,_0x36af6b){return function(_0x46b4c1){if(_0x46b4c1){return _0x46b4c1['update'](_0x3c3ce7)['then'](function(_0x25e7a2){return _0x25e7a2;});}return null;};}function removeEntity(_0x283eac,_0x516a09){return function(_0x2e67e8){if(_0x2e67e8){return _0x2e67e8[_0x978b('0x25')]()[_0x978b('0x26')](function(){_0x283eac[_0x978b('0x1a')](0xcc)[_0x978b('0x1b')]();});}};}function handleEntityNotFound(_0x1cab7a,_0x3f404f){return function(_0x32aade){if(!_0x32aade){_0x1cab7a[_0x978b('0x19')](0x194);}return _0x32aade;};}function handleError(_0x69cba,_0x1b28fc){_0x1b28fc=_0x1b28fc||0x1f4;return function(_0x44fc33){logger['error'](_0x44fc33[_0x978b('0x27')]);if(_0x44fc33[_0x978b('0x28')]){delete _0x44fc33[_0x978b('0x28')];}_0x69cba['status'](_0x1b28fc)[_0x978b('0x29')](_0x44fc33);};}exports['index']=function(_0x54e12c,_0x32b776){var _0x47fbbd={},_0x31e323={},_0xbdc3fb={'count':0x0,'rows':[]};var _0x460b3d=_['map'](db[_0x978b('0x2a')][_0x978b('0x2b')],function(_0x580c8e){return{'name':_0x580c8e[_0x978b('0x2c')],'type':_0x580c8e['type'][_0x978b('0x2d')]};});_0x31e323[_0x978b('0x2e')]=_[_0x978b('0x2f')](_0x460b3d,_0x978b('0x28'));_0x31e323[_0x978b('0x30')]=_[_0x978b('0x31')](_0x54e12c[_0x978b('0x30')]);_0x31e323[_0x978b('0x32')]=_[_0x978b('0x33')](_0x31e323[_0x978b('0x2e')],_0x31e323[_0x978b('0x30')]);_0x47fbbd['attributes']=_[_0x978b('0x33')](_0x31e323[_0x978b('0x2e')],qs[_0x978b('0x34')](_0x54e12c[_0x978b('0x30')]['fields']));_0x47fbbd[_0x978b('0x35')]=_0x47fbbd[_0x978b('0x35')][_0x978b('0x36')]?_0x47fbbd[_0x978b('0x35')]:_0x31e323['model'];if(!_0x54e12c['query']['hasOwnProperty'](_0x978b('0x37'))){_0x47fbbd[_0x978b('0x1f')]=qs[_0x978b('0x1f')](_0x54e12c['query']['limit']);_0x47fbbd[_0x978b('0x1d')]=qs[_0x978b('0x1d')](_0x54e12c[_0x978b('0x30')]['offset']);}_0x47fbbd['order']=qs[_0x978b('0x38')](_0x54e12c[_0x978b('0x30')]['sort']);_0x47fbbd[_0x978b('0x39')]=qs[_0x978b('0x32')](_['pick'](_0x54e12c[_0x978b('0x30')],_0x31e323[_0x978b('0x32')]),_0x460b3d);if(_0x54e12c['query'][_0x978b('0x3a')]){_0x47fbbd[_0x978b('0x39')]=_['merge'](_0x47fbbd['where'],{'$or':_[_0x978b('0x2f')](_0x460b3d,function(_0x1acca9){if(_0x1acca9[_0x978b('0x3b')]!=='VIRTUAL'){var _0x3ce807={};_0x3ce807[_0x1acca9[_0x978b('0x28')]]={'$like':'%'+_0x54e12c[_0x978b('0x30')][_0x978b('0x3a')]+'%'};return _0x3ce807;}})});}_0x47fbbd=_['merge']({},_0x47fbbd,_0x54e12c[_0x978b('0x3c')]);var _0x3be7a0={'where':_0x47fbbd[_0x978b('0x39')]};return db[_0x978b('0x2a')][_0x978b('0x20')](_0x3be7a0)[_0x978b('0x26')](function(_0x142b44){_0xbdc3fb[_0x978b('0x20')]=_0x142b44;if(_0x54e12c[_0x978b('0x30')][_0x978b('0x3d')]){_0x47fbbd[_0x978b('0x3e')]=[{'all':!![]}];}return db['Migration'][_0x978b('0x3f')](_0x47fbbd);})['then'](function(_0x201df5){_0xbdc3fb['rows']=_0x201df5;return _0xbdc3fb;})[_0x978b('0x26')](respondWithFilteredResult(_0x32b776,_0x47fbbd))[_0x978b('0x40')](handleError(_0x32b776,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a2a3e3a..9fdb87d 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 _0x06f5=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger'];(function(_0x106343,_0x4526d6){var _0x59bf6b=function(_0x392792){while(--_0x392792){_0x106343['push'](_0x106343['shift']());}};_0x59bf6b(++_0x4526d6);}(_0x06f5,0x76));var _0x506f=function(_0x141d07,_0x2bb46b){_0x141d07=_0x141d07-0x0;var _0x18d21f=_0x06f5[_0x141d07];return _0x18d21f;};'use strict';var _=require(_0x506f('0x0'));var util=require('util');var logger=require(_0x506f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x506f('0x2'));var rp=require(_0x506f('0x3'));var fs=require('fs');var path=require(_0x506f('0x4'));var rimraf=require(_0x506f('0x5'));var config=require(_0x506f('0x6'));var attributes=require(_0x506f('0x7'));module[_0x506f('0x8')]=function(_0x4fbe79,_0x34c352){return _0x4fbe79[_0x506f('0x9')](_0x506f('0xa'),attributes,{'tableName':_0x506f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3225=['Migration','migrations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3225,0x9e));var _0x5322=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3225[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5322('0x0'));var logger=require(_0x5322('0x1'))(_0x5322('0x2'));var moment=require(_0x5322('0x3'));var BPromise=require(_0x5322('0x4'));var rp=require(_0x5322('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5322('0x6'));var config=require(_0x5322('0x7'));var attributes=require('./migration.attributes');module[_0x5322('0x8')]=function(_0x43deb1,_0x4b7256){return _0x43deb1[_0x5322('0x9')](_0x5322('0xa'),attributes,{'tableName':_0x5322('0xb'),'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 c8e76e1..6fdf538 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 _0x35ff=['request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4320f2,_0x5c05a3){var _0x292332=function(_0x3bdea9){while(--_0x3bdea9){_0x4320f2['push'](_0x4320f2['shift']());}};_0x292332(++_0x5c05a3);}(_0x35ff,0xb3));var _0xf35f=function(_0x17f58f,_0x43cdc4){_0x17f58f=_0x17f58f-0x0;var _0x50de75=_0x35ff[_0x17f58f];return _0x50de75;};'use strict';var _=require('lodash');var util=require(_0xf35f('0x0'));var moment=require(_0xf35f('0x1'));var BPromise=require('bluebird');var rs=require(_0xf35f('0x2'));var fs=require('fs');var Redis=require(_0xf35f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf35f('0x4'));var logger=require('../../config/logger')(_0xf35f('0x5'));var config=require(_0xf35f('0x6'));var jayson=require(_0xf35f('0x7'));var client=jayson[_0xf35f('0x8')][_0xf35f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4321e9,_0x58144a,_0x3e3aaa){return new BPromise(function(_0x1922af,_0x37df94){return client[_0xf35f('0xa')](_0x4321e9,_0x3e3aaa)['then'](function(_0x406771){logger[_0xf35f('0xb')](_0xf35f('0xc'),_0x58144a,_0xf35f('0xd'));logger[_0xf35f('0xe')](_0xf35f('0xf'),_0x58144a,_0xf35f('0xd'),JSON['stringify'](_0x406771));if(_0x406771[_0xf35f('0x10')]){if(_0x406771[_0xf35f('0x10')][_0xf35f('0x11')]===0x1f4){logger[_0xf35f('0x10')](_0xf35f('0xc'),_0x58144a,_0x406771[_0xf35f('0x10')][_0xf35f('0x12')]);return _0x37df94(_0x406771[_0xf35f('0x10')]['message']);}logger[_0xf35f('0x10')]('Migration,\x20%s,\x20%s',_0x58144a,_0x406771[_0xf35f('0x10')][_0xf35f('0x12')]);return _0x1922af(_0x406771['error'][_0xf35f('0x12')]);}else{logger[_0xf35f('0xb')](_0xf35f('0xc'),_0x58144a,_0xf35f('0xd'));_0x1922af(_0x406771[_0xf35f('0x13')]['message']);}})[_0xf35f('0x14')](function(_0x3e400b){logger[_0xf35f('0x10')](_0xf35f('0xc'),_0x58144a,_0x3e400b);_0x37df94(_0x3e400b);});});} \ No newline at end of file +var _0x3a25=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x139489,_0x4addf1){var _0xb34a41=function(_0x4a1417){while(--_0x4a1417){_0x139489['push'](_0x139489['shift']());}};_0xb34a41(++_0x4addf1);}(_0x3a25,0x15d));var _0x53a2=function(_0x1ab65a,_0x81de97){_0x1ab65a=_0x1ab65a-0x0;var _0x541211=_0x3a25[_0x1ab65a];return _0x541211;};'use strict';var _=require(_0x53a2('0x0'));var util=require(_0x53a2('0x1'));var moment=require(_0x53a2('0x2'));var BPromise=require(_0x53a2('0x3'));var rs=require(_0x53a2('0x4'));var fs=require('fs');var Redis=require(_0x53a2('0x5'));var db=require(_0x53a2('0x6'))['db'];var utils=require(_0x53a2('0x7'));var logger=require(_0x53a2('0x8'))(_0x53a2('0x9'));var config=require(_0x53a2('0xa'));var jayson=require(_0x53a2('0xb'));var client=jayson[_0x53a2('0xc')][_0x53a2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409fff,_0x4d53b8,_0x3ee956){return new BPromise(function(_0x5dc70e,_0x17aa09){return client[_0x53a2('0xe')](_0x409fff,_0x3ee956)[_0x53a2('0xf')](function(_0x42bf42){logger[_0x53a2('0x10')](_0x53a2('0x11'),_0x4d53b8,_0x53a2('0x12'));logger[_0x53a2('0x13')](_0x53a2('0x14'),_0x4d53b8,_0x53a2('0x12'),JSON['stringify'](_0x42bf42));if(_0x42bf42['error']){if(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x16')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x17aa09(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}logger['error']('Migration,\x20%s,\x20%s',_0x4d53b8,_0x42bf42['error'][_0x53a2('0x17')]);return _0x5dc70e(_0x42bf42[_0x53a2('0x15')][_0x53a2('0x17')]);}else{logger[_0x53a2('0x10')]('Migration,\x20%s,\x20%s',_0x4d53b8,_0x53a2('0x12'));_0x5dc70e(_0x42bf42[_0x53a2('0x18')][_0x53a2('0x17')]);}})[_0x53a2('0x19')](function(_0x34c7de){logger['error']('Migration,\x20%s,\x20%s',_0x4d53b8,_0x34c7de);_0x17aa09(_0x34c7de);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index fcf8cd6..884a7b9 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 _0x4351=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','create','put','/:id','delete','exports'];(function(_0x5664b0,_0x1ebb39){var _0x22ea5a=function(_0x1bc4ea){while(--_0x1bc4ea){_0x5664b0['push'](_0x5664b0['shift']());}};_0x22ea5a(++_0x1ebb39);}(_0x4351,0x1b5));var _0x1435=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x4351[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require(_0x1435('0x2'));var timeout=require(_0x1435('0x3'));var express=require(_0x1435('0x4'));var router=express[_0x1435('0x5')]();var fs_extra=require(_0x1435('0x6'));var auth=require(_0x1435('0x7'));var interaction=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var controller=require(_0x1435('0xa'));router[_0x1435('0xb')]('/',auth[_0x1435('0xc')](),controller[_0x1435('0xd')]);router[_0x1435('0xb')]('/:id',auth[_0x1435('0xc')](),controller['show']);router['post']('/',auth[_0x1435('0xc')](),controller[_0x1435('0xe')]);router[_0x1435('0xf')](_0x1435('0x10'),auth[_0x1435('0xc')](),controller['update']);router[_0x1435('0x11')](_0x1435('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x1435('0x12')]=router; \ No newline at end of file +var _0x2905=['create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','/:id','show'];(function(_0x20933a,_0x3467ca){var _0x2a217a=function(_0x139491){while(--_0x139491){_0x20933a['push'](_0x20933a['shift']());}};_0x2a217a(++_0x3467ca);}(_0x2905,0x19c));var _0x5290=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2905[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x5290('0x0'));var util=require(_0x5290('0x1'));var path=require(_0x5290('0x2'));var timeout=require('connect-timeout');var express=require(_0x5290('0x3'));var router=express[_0x5290('0x4')]();var fs_extra=require(_0x5290('0x5'));var auth=require(_0x5290('0x6'));var interaction=require(_0x5290('0x7'));var config=require('../../config/environment');var controller=require(_0x5290('0x8'));router[_0x5290('0x9')]('/',auth[_0x5290('0xa')](),controller['index']);router['get'](_0x5290('0xb'),auth[_0x5290('0xa')](),controller[_0x5290('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5290('0xd')]);router[_0x5290('0xe')](_0x5290('0xb'),auth['isAuthenticated'](),controller[_0x5290('0xf')]);router['delete']('/:id',auth[_0x5290('0xa')](),controller['destroy']);module[_0x5290('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 5f0e838..1ac7945 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 _0x4b69=['stun','turn','STRING','exports','ENUM','localnet','externip'];(function(_0x44143e,_0x2051f3){var _0x4ea47c=function(_0x262f78){while(--_0x262f78){_0x44143e['push'](_0x44143e['shift']());}};_0x4ea47c(++_0x2051f3);}(_0x4b69,0x114));var _0x94b6=function(_0x4d120d,_0x55a2c9){_0x4d120d=_0x4d120d-0x0;var _0x12b156=_0x4b69[_0x4d120d];return _0x12b156;};'use strict';var Sequelize=require('sequelize');module[_0x94b6('0x0')]={'type':{'type':Sequelize[_0x94b6('0x1')](_0x94b6('0x2'),_0x94b6('0x3'),_0x94b6('0x4'),_0x94b6('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x94b6('0x6')]},'password':{'type':Sequelize[_0x94b6('0x6')]}}; \ No newline at end of file +var _0xf63e=['exports','ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x2023b8,_0x5092a2){var _0x3dfd32=function(_0x22ae29){while(--_0x22ae29){_0x2023b8['push'](_0x2023b8['shift']());}};_0x3dfd32(++_0x5092a2);}(_0xf63e,0xa0));var _0xef63=function(_0xd7b6db,_0x57d326){_0xd7b6db=_0xd7b6db-0x0;var _0x2381b6=_0xf63e[_0xd7b6db];return _0x2381b6;};'use strict';var Sequelize=require(_0xef63('0x0'));module[_0xef63('0x1')]={'type':{'type':Sequelize[_0xef63('0x2')](_0xef63('0x3'),_0xef63('0x4'),_0xef63('0x5'),'turn')},'value':{'type':Sequelize[_0xef63('0x6')]},'username':{'type':Sequelize[_0xef63('0x6')]},'password':{'type':Sequelize[_0xef63('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4b01512..fde7fed 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 _0x7784=['json','undefined','count','offset','set','Content-Range','update','destroy','end','sendStatus','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','limit','sort','filters','pick','filter','where','VIRTUAL','options','Network','includeAll','include','show','params','keys','length','merge','create','body','findAll','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','root','chan_sip.so','find','toUpperCase','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','ejs','api','../../mysqldb','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status'];(function(_0x3db3e7,_0x216d9b){var _0x536668=function(_0x381d37){while(--_0x381d37){_0x3db3e7['push'](_0x3db3e7['shift']());}};_0x536668(++_0x216d9b);}(_0x7784,0x17b));var _0x4778=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7784[_0x5b644e];return _0x49c6bf;};'use strict';var util=require('util');var path=require('path');var ejs=require(_0x4778('0x0'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4778('0x1'));var config=require('../../config/environment');var db=require(_0x4778('0x2'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x4778('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x502408,_0x514d37,_0x1770e5,_0x46c70b){return new Promise(function(_0x55619f,_0x104662){var _0x233d93=_0x46c70b||client;return _0x233d93[_0x4778('0x4')](_0x502408,_0x1770e5)[_0x4778('0x5')](function(_0x42aed0){logger['info'](_0x4778('0x6'),_0x514d37,_0x4778('0x7'));logger[_0x4778('0x8')](_0x4778('0x9'),_0x514d37,_0x4778('0x7'),JSON['stringify'](_0x42aed0));if(_0x42aed0[_0x4778('0xa')]){if(_0x42aed0[_0x4778('0xa')]['code']===0x1f4){logger[_0x4778('0xa')](_0x4778('0x6'),_0x514d37,_0x42aed0[_0x4778('0xa')][_0x4778('0xb')]);return _0x104662(_0x42aed0[_0x4778('0xa')][_0x4778('0xb')]);}logger['error'](_0x4778('0x6'),_0x514d37,_0x42aed0[_0x4778('0xa')]['message']);return _0x55619f(_0x42aed0['error'][_0x4778('0xb')]);}else{logger[_0x4778('0xc')](_0x4778('0x6'),_0x514d37,_0x4778('0x7'));_0x55619f(_0x42aed0[_0x4778('0xd')][_0x4778('0xb')]);}})[_0x4778('0xe')](function(_0x2e30cb){logger[_0x4778('0xa')](_0x4778('0x6'),_0x514d37,_0x2e30cb);_0x104662(_0x2e30cb);});});}function respondWithResult(_0x5e711a,_0x155b7f){_0x155b7f=_0x155b7f||0xc8;return function(_0x69b1ca){if(_0x69b1ca){return _0x5e711a[_0x4778('0xf')](_0x155b7f)[_0x4778('0x10')](_0x69b1ca);}};}function respondWithFilteredResult(_0x46ddb5,_0x1e4aac){return function(_0xfa3763){if(_0xfa3763){var _0x2eb69c=typeof _0x1e4aac['offset']===_0x4778('0x11')&&typeof _0x1e4aac['limit']===_0x4778('0x11');var _0x578b78=_0xfa3763[_0x4778('0x12')];var _0x2518ca=_0x2eb69c?0x0:_0x1e4aac['offset'];var _0x17e597=_0x2eb69c?_0xfa3763[_0x4778('0x12')]:_0x1e4aac[_0x4778('0x13')]+_0x1e4aac['limit'];var _0x55c997;if(_0x17e597>=_0x578b78){_0x17e597=_0x578b78;_0x55c997=0xc8;}else{_0x55c997=0xce;}_0x46ddb5[_0x4778('0xf')](_0x55c997);return _0x46ddb5[_0x4778('0x14')](_0x4778('0x15'),_0x2518ca+'-'+_0x17e597+'/'+_0x578b78)[_0x4778('0x10')](_0xfa3763);}return null;};}function saveUpdates(_0x23ce09){return function(_0x43b327){if(_0x43b327){return _0x43b327[_0x4778('0x16')](_0x23ce09)[_0x4778('0x5')](function(_0x45ac77){return _0x45ac77;});}return null;};}function removeEntity(_0x519d1e){return function(_0x591be8){if(_0x591be8){return _0x591be8[_0x4778('0x17')]()[_0x4778('0x5')](function(){_0x519d1e['status'](0xcc)[_0x4778('0x18')]();});}};}function handleEntityNotFound(_0x430822){return function(_0x514737){if(!_0x514737){_0x430822[_0x4778('0x19')](0x194);}return _0x514737;};}function handleError(_0x108d60,_0xbdc8ec){_0xbdc8ec=_0xbdc8ec||0x1f4;return function(_0x5f2186){logger[_0x4778('0xa')](_0x5f2186['stack']);if(_0x5f2186[_0x4778('0x1a')]){delete _0x5f2186[_0x4778('0x1a')];}_0x108d60[_0x4778('0xf')](_0xbdc8ec)[_0x4778('0x1b')](_0x5f2186);};}exports[_0x4778('0x1c')]=function(_0x25570c,_0x47c82b){var _0x385459={},_0x5e25c7={},_0x1ff418={'count':0x0,'rows':[]};var _0x1a8fee=_['map'](db['Network'][_0x4778('0x1d')],function(_0x867dcd){return{'name':_0x867dcd[_0x4778('0x1e')],'type':_0x867dcd[_0x4778('0x1f')][_0x4778('0x20')]};});_0x5e25c7['model']=_[_0x4778('0x21')](_0x1a8fee,_0x4778('0x1a'));_0x5e25c7[_0x4778('0x22')]=_['keys'](_0x25570c[_0x4778('0x22')]);_0x5e25c7['filters']=_[_0x4778('0x23')](_0x5e25c7[_0x4778('0x24')],_0x5e25c7[_0x4778('0x22')]);_0x385459[_0x4778('0x25')]=_['intersection'](_0x5e25c7[_0x4778('0x24')],qs[_0x4778('0x26')](_0x25570c[_0x4778('0x22')]['fields']));_0x385459['attributes']=_0x385459['attributes']['length']?_0x385459['attributes']:_0x5e25c7[_0x4778('0x24')];if(!_0x25570c[_0x4778('0x22')]['hasOwnProperty']('nolimit')){_0x385459[_0x4778('0x27')]=qs[_0x4778('0x27')](_0x25570c[_0x4778('0x22')]['limit']);_0x385459[_0x4778('0x13')]=qs[_0x4778('0x13')](_0x25570c['query'][_0x4778('0x13')]);}_0x385459['order']=qs['sort'](_0x25570c[_0x4778('0x22')][_0x4778('0x28')]);_0x385459['where']=qs[_0x4778('0x29')](_[_0x4778('0x2a')](_0x25570c[_0x4778('0x22')],_0x5e25c7[_0x4778('0x29')]),_0x1a8fee);if(_0x25570c[_0x4778('0x22')][_0x4778('0x2b')]){_0x385459['where']=_['merge'](_0x385459[_0x4778('0x2c')],{'$or':_['map'](_0x1a8fee,function(_0x25c6b0){if(_0x25c6b0[_0x4778('0x1f')]!==_0x4778('0x2d')){var _0x20cb9b={};_0x20cb9b[_0x25c6b0[_0x4778('0x1a')]]={'$like':'%'+_0x25570c['query'][_0x4778('0x2b')]+'%'};return _0x20cb9b;}})});}_0x385459=_['merge']({},_0x385459,_0x25570c[_0x4778('0x2e')]);var _0x1f0742={'where':_0x385459[_0x4778('0x2c')]};return db[_0x4778('0x2f')]['count'](_0x1f0742)['then'](function(_0x3291ec){_0x1ff418[_0x4778('0x12')]=_0x3291ec;if(_0x25570c['query'][_0x4778('0x30')]){_0x385459[_0x4778('0x31')]=[{'all':!![]}];}return db[_0x4778('0x2f')]['findAll'](_0x385459);})['then'](function(_0x342b9c){_0x1ff418['rows']=_0x342b9c;return _0x1ff418;})[_0x4778('0x5')](respondWithFilteredResult(_0x47c82b,_0x385459))[_0x4778('0xe')](handleError(_0x47c82b,null));};exports[_0x4778('0x32')]=function(_0x1acba1,_0x1e0327){var _0x34efe7={'raw':!![],'where':{'id':_0x1acba1[_0x4778('0x33')]['id']}},_0x5615b4={};_0x5615b4[_0x4778('0x24')]=_[_0x4778('0x34')](db[_0x4778('0x2f')][_0x4778('0x1d')]);_0x5615b4[_0x4778('0x22')]=_[_0x4778('0x34')](_0x1acba1[_0x4778('0x22')]);_0x5615b4[_0x4778('0x29')]=_['intersection'](_0x5615b4[_0x4778('0x24')],_0x5615b4[_0x4778('0x22')]);_0x34efe7['attributes']=_['intersection'](_0x5615b4[_0x4778('0x24')],qs[_0x4778('0x26')](_0x1acba1[_0x4778('0x22')]['fields']));_0x34efe7[_0x4778('0x25')]=_0x34efe7['attributes'][_0x4778('0x35')]?_0x34efe7[_0x4778('0x25')]:_0x5615b4[_0x4778('0x24')];if(_0x1acba1[_0x4778('0x22')][_0x4778('0x30')]){_0x34efe7[_0x4778('0x31')]=[{'all':!![]}];}_0x34efe7=_[_0x4778('0x36')]({},_0x34efe7,_0x1acba1[_0x4778('0x2e')]);return db['Network']['find'](_0x34efe7)[_0x4778('0x5')](handleEntityNotFound(_0x1e0327,null))['then'](respondWithResult(_0x1e0327,null))[_0x4778('0xe')](handleError(_0x1e0327,null));};exports[_0x4778('0x37')]=function(_0x1cb05f,_0x2fbf44){var _0x106204;return db['Network'][_0x4778('0x37')](_0x1cb05f[_0x4778('0x38')],{'raw':!![]})[_0x4778('0x5')](function(_0x161236){_0x106204=_0x161236;return db[_0x4778('0x2f')][_0x4778('0x39')]({'where':{'type':_0x1cb05f['body'][_0x4778('0x1f')]},'raw':!![]});})[_0x4778('0x5')](function(_0x3fc8f5){if(_0x106204[_0x4778('0x1f')]['toUpperCase']()==_0x4778('0x3a')){var _0x5e9028=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config['root'],_0x4778('0x3d')),_0x4778('0x3e'));var _0x46426f=ejs[_0x4778('0x3f')](_0x5e9028,{'networks':_0x3fc8f5||[]});fs[_0x4778('0x40')](_0x4778('0x41'),_0x46426f);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x37'),{'module':'res_stun_monitor.so'});}else if(_0x106204[_0x4778('0x1f')]['toUpperCase']()==_0x4778('0x43')){var _0x4219b9=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config[_0x4778('0x44')],'server/files/templates/turn_multiple.ejs'),_0x4778('0x3e'));var _0x38e147=ejs[_0x4778('0x3f')](_0x4219b9,{'networks':_0x3fc8f5||[]});fs[_0x4778('0x40')]('/etc/asterisk/turn_xcally.conf',_0x38e147);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x37'),{'module':'res_stun_monitor.so'});}else{var _0x5aa642=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config[_0x4778('0x44')],'server/files/templates/network.ejs'),'utf8');var _0x201a61=ejs[_0x4778('0x3f')](_0x5aa642,{'networks':_0x3fc8f5||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x1cb05f[_0x4778('0x38')][_0x4778('0x1f')]['toLowerCase']()),_0x201a61);return respondWithRpcPromise('Reload',_0x4778('0x37'),{'module':_0x4778('0x45')});}})[_0x4778('0x5')](function(){return _0x106204;})[_0x4778('0x5')](respondWithResult(_0x2fbf44,0xc9))[_0x4778('0xe')](handleError(_0x2fbf44,null));};exports['update']=function(_0x5d6fac,_0x38838b){var _0x534008;return db[_0x4778('0x2f')][_0x4778('0x46')]({'where':{'id':_0x5d6fac[_0x4778('0x33')]['id']}})[_0x4778('0x5')](handleEntityNotFound(_0x38838b,null))[_0x4778('0x5')](saveUpdates(_0x5d6fac[_0x4778('0x38')],null))[_0x4778('0x5')](function(_0x18674e){if(_0x18674e){_0x534008=_0x18674e;return db[_0x4778('0x2f')][_0x4778('0x39')]({'where':{'type':_0x534008[_0x4778('0x1f')]},'raw':!![]});}return null;})[_0x4778('0x5')](function(_0x3cc68c){if(_0x534008[_0x4778('0x1f')][_0x4778('0x47')]()==_0x4778('0x3a')){var _0xdcf121=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config[_0x4778('0x44')],_0x4778('0x3d')),_0x4778('0x3e'));var _0x143ef1=ejs[_0x4778('0x3f')](_0xdcf121,{'networks':_0x3cc68c||[]});fs[_0x4778('0x40')]('/etc/asterisk/stun_xcally.conf',_0x143ef1);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x16'),{'module':_0x4778('0x48')});}else if(_0x534008[_0x4778('0x1f')]['toUpperCase']()==_0x4778('0x43')){var _0x23acc9=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config[_0x4778('0x44')],_0x4778('0x49')),_0x4778('0x3e'));var _0x2f3e4f=ejs[_0x4778('0x3f')](_0x23acc9,{'networks':_0x3cc68c||[]});fs[_0x4778('0x40')](_0x4778('0x4a'),_0x2f3e4f);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x16'),{'module':'res_stun_monitor.so'});}else{var _0x3ba16f=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config['root'],_0x4778('0x4b')),'utf8');var _0x163fcc=ejs[_0x4778('0x3f')](_0x3ba16f,{'networks':_0x3cc68c||[]});fs[_0x4778('0x40')](util[_0x4778('0x4c')](_0x4778('0x4d'),_0x5d6fac[_0x4778('0x38')]['type'][_0x4778('0x4e')]()),_0x163fcc);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x16'),{'module':_0x4778('0x45')});}})[_0x4778('0x5')](function(_0x11d07a){if(_0x11d07a){return _0x534008;}return null;})['then'](respondWithResult(_0x38838b,null))['catch'](handleError(_0x38838b,null));};exports[_0x4778('0x17')]=function(_0x120d7d,_0x153993){var _0x30072b;return db[_0x4778('0x2f')][_0x4778('0x46')]({'where':{'id':_0x120d7d[_0x4778('0x33')]['id']}})[_0x4778('0x5')](function(_0x2d87b5){_0x30072b=_0x2d87b5;return _0x2d87b5;})[_0x4778('0x5')](handleEntityNotFound(_0x153993,null))[_0x4778('0x5')](removeEntity(_0x153993,null))[_0x4778('0x5')](function(){if(_0x30072b){return db['Network'][_0x4778('0x39')]({'where':{'type':_0x30072b['type']},'raw':!![]});}})[_0x4778('0x5')](function(_0x6e6191){if(_0x30072b[_0x4778('0x1f')][_0x4778('0x47')]()==_0x4778('0x3a')){var _0x72e5e1=fs[_0x4778('0x3b')](path['join'](config[_0x4778('0x44')],'server/files/templates/stun_multiple.ejs'),_0x4778('0x3e'));var _0x1a43b7=ejs[_0x4778('0x3f')](_0x72e5e1,{'networks':_0x6e6191||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1a43b7);return respondWithRpcPromise('Reload',_0x4778('0x17'),{'module':_0x4778('0x48')});}else if(_0x30072b[_0x4778('0x1f')]['toUpperCase']()==_0x4778('0x43')){var _0x47a642=fs[_0x4778('0x3b')](path['join'](config[_0x4778('0x44')],_0x4778('0x49')),_0x4778('0x3e'));var _0xa01a0e=ejs[_0x4778('0x3f')](_0x47a642,{'networks':_0x6e6191||[]});fs[_0x4778('0x40')](_0x4778('0x4a'),_0xa01a0e);return respondWithRpcPromise(_0x4778('0x42'),_0x4778('0x17'),{'module':_0x4778('0x48')});}else{var _0x134747=fs[_0x4778('0x3b')](path[_0x4778('0x3c')](config[_0x4778('0x44')],'server/files/templates/network.ejs'),'utf8');var _0x18d21f=ejs['render'](_0x134747,{'networks':_0x6e6191||[]});fs[_0x4778('0x40')](util[_0x4778('0x4c')](_0x4778('0x4d'),_0x30072b[_0x4778('0x1f')]['toLowerCase']()),_0x18d21f);return respondWithRpcPromise('Reload',_0x4778('0x17'),{'module':_0x4778('0x45')});}})[_0x4778('0xe')](handleError(_0x153993,null));}; \ No newline at end of file +var _0xec90=['then','info','Network,\x20%s,\x20%s','request\x20sent','debug','code','error','message','catch','offset','undefined','limit','status','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','Network','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','include','findAll','rows','show','rawAttributes','length','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','writeFileSync','format','toLowerCase','chan_sip.so','params','res_stun_monitor.so','TURN','/etc/asterisk/sip_xcally_%s.conf','path','ejs','lodash','../../components/parsers/qs','../../mysqldb','jayson/promise','client','http','request'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xec90,0x191));var _0x0ec9=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xec90[_0x39e283];return _0x7de89f;};'use strict';var util=require('util');var path=require(_0x0ec9('0x0'));var ejs=require(_0x0ec9('0x1'));var fs=require('fs');var _=require(_0x0ec9('0x2'));var qs=require(_0x0ec9('0x3'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x0ec9('0x4'))['db'];var jayson=require(_0x0ec9('0x5'));var client=jayson[_0x0ec9('0x6')][_0x0ec9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x62b8c6,_0x16cb91,_0x2c5ff,_0x4eaf72){return new Promise(function(_0x1a2b78,_0x147671){var _0x5d930d=_0x4eaf72||client;return _0x5d930d[_0x0ec9('0x8')](_0x62b8c6,_0x2c5ff)[_0x0ec9('0x9')](function(_0x357ca4){logger[_0x0ec9('0xa')](_0x0ec9('0xb'),_0x16cb91,_0x0ec9('0xc'));logger[_0x0ec9('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x16cb91,_0x0ec9('0xc'),JSON['stringify'](_0x357ca4));if(_0x357ca4['error']){if(_0x357ca4['error'][_0x0ec9('0xe')]===0x1f4){logger[_0x0ec9('0xf')](_0x0ec9('0xb'),_0x16cb91,_0x357ca4[_0x0ec9('0xf')]['message']);return _0x147671(_0x357ca4['error'][_0x0ec9('0x10')]);}logger[_0x0ec9('0xf')](_0x0ec9('0xb'),_0x16cb91,_0x357ca4[_0x0ec9('0xf')][_0x0ec9('0x10')]);return _0x1a2b78(_0x357ca4['error']['message']);}else{logger[_0x0ec9('0xa')](_0x0ec9('0xb'),_0x16cb91,_0x0ec9('0xc'));_0x1a2b78(_0x357ca4['result'][_0x0ec9('0x10')]);}})[_0x0ec9('0x11')](function(_0x5bb374){logger['error'](_0x0ec9('0xb'),_0x16cb91,_0x5bb374);_0x147671(_0x5bb374);});});}function respondWithResult(_0x126a8e,_0x3bcd7d){_0x3bcd7d=_0x3bcd7d||0xc8;return function(_0x4a4f11){if(_0x4a4f11){return _0x126a8e['status'](_0x3bcd7d)['json'](_0x4a4f11);}};}function respondWithFilteredResult(_0x11625f,_0x431f3f){return function(_0x1db421){if(_0x1db421){var _0x3b4bdd=typeof _0x431f3f[_0x0ec9('0x12')]===_0x0ec9('0x13')&&typeof _0x431f3f[_0x0ec9('0x14')]===_0x0ec9('0x13');var _0x5e15ae=_0x1db421['count'];var _0x19e40e=_0x3b4bdd?0x0:_0x431f3f[_0x0ec9('0x12')];var _0x3b0c26=_0x3b4bdd?_0x1db421['count']:_0x431f3f['offset']+_0x431f3f[_0x0ec9('0x14')];var _0x597017;if(_0x3b0c26>=_0x5e15ae){_0x3b0c26=_0x5e15ae;_0x597017=0xc8;}else{_0x597017=0xce;}_0x11625f[_0x0ec9('0x15')](_0x597017);return _0x11625f[_0x0ec9('0x16')](_0x0ec9('0x17'),_0x19e40e+'-'+_0x3b0c26+'/'+_0x5e15ae)['json'](_0x1db421);}return null;};}function saveUpdates(_0x28e84e){return function(_0x1501ac){if(_0x1501ac){return _0x1501ac[_0x0ec9('0x18')](_0x28e84e)['then'](function(_0xc28e9){return _0xc28e9;});}return null;};}function removeEntity(_0x2f171c){return function(_0x2a1a6c){if(_0x2a1a6c){return _0x2a1a6c[_0x0ec9('0x19')]()[_0x0ec9('0x9')](function(){_0x2f171c[_0x0ec9('0x15')](0xcc)[_0x0ec9('0x1a')]();});}};}function handleEntityNotFound(_0x4d9191){return function(_0x2590c0){if(!_0x2590c0){_0x4d9191[_0x0ec9('0x1b')](0x194);}return _0x2590c0;};}function handleError(_0x6486f8,_0x2f8b33){_0x2f8b33=_0x2f8b33||0x1f4;return function(_0x5893af){logger[_0x0ec9('0xf')](_0x5893af[_0x0ec9('0x1c')]);if(_0x5893af[_0x0ec9('0x1d')]){delete _0x5893af['name'];}_0x6486f8['status'](_0x2f8b33)['send'](_0x5893af);};}exports[_0x0ec9('0x1e')]=function(_0x4d8b48,_0x46e92b){var _0x453dd2={},_0x3d9dcc={},_0x7d2de1={'count':0x0,'rows':[]};var _0x50e716=_[_0x0ec9('0x1f')](db[_0x0ec9('0x20')]['rawAttributes'],function(_0x5b4fa5){return{'name':_0x5b4fa5[_0x0ec9('0x21')],'type':_0x5b4fa5[_0x0ec9('0x22')][_0x0ec9('0x23')]};});_0x3d9dcc[_0x0ec9('0x24')]=_[_0x0ec9('0x1f')](_0x50e716,_0x0ec9('0x1d'));_0x3d9dcc[_0x0ec9('0x25')]=_[_0x0ec9('0x26')](_0x4d8b48[_0x0ec9('0x25')]);_0x3d9dcc[_0x0ec9('0x27')]=_[_0x0ec9('0x28')](_0x3d9dcc[_0x0ec9('0x24')],_0x3d9dcc[_0x0ec9('0x25')]);_0x453dd2[_0x0ec9('0x29')]=_[_0x0ec9('0x28')](_0x3d9dcc[_0x0ec9('0x24')],qs[_0x0ec9('0x2a')](_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x2a')]));_0x453dd2[_0x0ec9('0x29')]=_0x453dd2[_0x0ec9('0x29')]['length']?_0x453dd2[_0x0ec9('0x29')]:_0x3d9dcc[_0x0ec9('0x24')];if(!_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x2b')](_0x0ec9('0x2c'))){_0x453dd2[_0x0ec9('0x14')]=qs[_0x0ec9('0x14')](_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x14')]);_0x453dd2['offset']=qs['offset'](_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x12')]);}_0x453dd2['order']=qs['sort'](_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x2d')]);_0x453dd2[_0x0ec9('0x2e')]=qs['filters'](_[_0x0ec9('0x2f')](_0x4d8b48['query'],_0x3d9dcc[_0x0ec9('0x27')]),_0x50e716);if(_0x4d8b48[_0x0ec9('0x25')][_0x0ec9('0x30')]){_0x453dd2[_0x0ec9('0x2e')]=_[_0x0ec9('0x31')](_0x453dd2[_0x0ec9('0x2e')],{'$or':_[_0x0ec9('0x1f')](_0x50e716,function(_0x3b1113){if(_0x3b1113['type']!=='VIRTUAL'){var _0x19f7d6={};_0x19f7d6[_0x3b1113[_0x0ec9('0x1d')]]={'$like':'%'+_0x4d8b48[_0x0ec9('0x25')]['filter']+'%'};return _0x19f7d6;}})});}_0x453dd2=_[_0x0ec9('0x31')]({},_0x453dd2,_0x4d8b48[_0x0ec9('0x32')]);var _0x3eefb9={'where':_0x453dd2[_0x0ec9('0x2e')]};return db[_0x0ec9('0x20')][_0x0ec9('0x33')](_0x3eefb9)[_0x0ec9('0x9')](function(_0x4b53ae){_0x7d2de1[_0x0ec9('0x33')]=_0x4b53ae;if(_0x4d8b48[_0x0ec9('0x25')]['includeAll']){_0x453dd2[_0x0ec9('0x34')]=[{'all':!![]}];}return db[_0x0ec9('0x20')][_0x0ec9('0x35')](_0x453dd2);})[_0x0ec9('0x9')](function(_0x4d3d95){_0x7d2de1[_0x0ec9('0x36')]=_0x4d3d95;return _0x7d2de1;})[_0x0ec9('0x9')](respondWithFilteredResult(_0x46e92b,_0x453dd2))[_0x0ec9('0x11')](handleError(_0x46e92b,null));};exports[_0x0ec9('0x37')]=function(_0x3212cd,_0x57512e){var _0x2aaebd={'raw':!![],'where':{'id':_0x3212cd['params']['id']}},_0x5594dc={};_0x5594dc[_0x0ec9('0x24')]=_['keys'](db[_0x0ec9('0x20')][_0x0ec9('0x38')]);_0x5594dc[_0x0ec9('0x25')]=_['keys'](_0x3212cd['query']);_0x5594dc[_0x0ec9('0x27')]=_[_0x0ec9('0x28')](_0x5594dc[_0x0ec9('0x24')],_0x5594dc[_0x0ec9('0x25')]);_0x2aaebd[_0x0ec9('0x29')]=_['intersection'](_0x5594dc[_0x0ec9('0x24')],qs[_0x0ec9('0x2a')](_0x3212cd[_0x0ec9('0x25')][_0x0ec9('0x2a')]));_0x2aaebd['attributes']=_0x2aaebd['attributes'][_0x0ec9('0x39')]?_0x2aaebd['attributes']:_0x5594dc[_0x0ec9('0x24')];if(_0x3212cd['query']['includeAll']){_0x2aaebd[_0x0ec9('0x34')]=[{'all':!![]}];}_0x2aaebd=_[_0x0ec9('0x31')]({},_0x2aaebd,_0x3212cd[_0x0ec9('0x32')]);return db[_0x0ec9('0x20')][_0x0ec9('0x3a')](_0x2aaebd)[_0x0ec9('0x9')](handleEntityNotFound(_0x57512e,null))['then'](respondWithResult(_0x57512e,null))[_0x0ec9('0x11')](handleError(_0x57512e,null));};exports[_0x0ec9('0x3b')]=function(_0x2378e7,_0xd890c3){var _0x261d6f;return db[_0x0ec9('0x20')][_0x0ec9('0x3b')](_0x2378e7[_0x0ec9('0x3c')],{'raw':!![]})[_0x0ec9('0x9')](function(_0x4bd531){_0x261d6f=_0x4bd531;return db[_0x0ec9('0x20')][_0x0ec9('0x35')]({'where':{'type':_0x2378e7['body'][_0x0ec9('0x22')]},'raw':!![]});})[_0x0ec9('0x9')](function(_0x1da42c){if(_0x261d6f[_0x0ec9('0x22')][_0x0ec9('0x3d')]()==_0x0ec9('0x3e')){var _0x1fd921=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],_0x0ec9('0x42')),_0x0ec9('0x43'));var _0x10a1ca=ejs['render'](_0x1fd921,{'networks':_0x1da42c||[]});fs['writeFileSync'](_0x0ec9('0x44'),_0x10a1ca);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x261d6f[_0x0ec9('0x22')][_0x0ec9('0x3d')]()=='TURN'){var _0x3a2a17=fs['readFileSync'](path['join'](config['root'],_0x0ec9('0x45')),_0x0ec9('0x43'));var _0x885bd7=ejs[_0x0ec9('0x46')](_0x3a2a17,{'networks':_0x1da42c||[]});fs['writeFileSync'](_0x0ec9('0x47'),_0x885bd7);return respondWithRpcPromise(_0x0ec9('0x48'),_0x0ec9('0x3b'),{'module':'res_stun_monitor.so'});}else{var _0x8517e2=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],_0x0ec9('0x49')),_0x0ec9('0x43'));var _0x216a0e=ejs[_0x0ec9('0x46')](_0x8517e2,{'networks':_0x1da42c||[]});fs[_0x0ec9('0x4a')](util[_0x0ec9('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x2378e7[_0x0ec9('0x3c')][_0x0ec9('0x22')][_0x0ec9('0x4c')]()),_0x216a0e);return respondWithRpcPromise(_0x0ec9('0x48'),_0x0ec9('0x3b'),{'module':_0x0ec9('0x4d')});}})[_0x0ec9('0x9')](function(){return _0x261d6f;})[_0x0ec9('0x9')](respondWithResult(_0xd890c3,0xc9))['catch'](handleError(_0xd890c3,null));};exports['update']=function(_0x2e8c26,_0x52a8ed){var _0x527eb0;return db[_0x0ec9('0x20')]['find']({'where':{'id':_0x2e8c26[_0x0ec9('0x4e')]['id']}})[_0x0ec9('0x9')](handleEntityNotFound(_0x52a8ed,null))['then'](saveUpdates(_0x2e8c26[_0x0ec9('0x3c')],null))[_0x0ec9('0x9')](function(_0x41ba4c){if(_0x41ba4c){_0x527eb0=_0x41ba4c;return db[_0x0ec9('0x20')][_0x0ec9('0x35')]({'where':{'type':_0x527eb0['type']},'raw':!![]});}return null;})['then'](function(_0x12e304){if(_0x527eb0[_0x0ec9('0x22')]['toUpperCase']()=='STUN'){var _0x2fa422=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config['root'],_0x0ec9('0x42')),_0x0ec9('0x43'));var _0x17d6d0=ejs[_0x0ec9('0x46')](_0x2fa422,{'networks':_0x12e304||[]});fs[_0x0ec9('0x4a')](_0x0ec9('0x44'),_0x17d6d0);return respondWithRpcPromise('Reload','update',{'module':_0x0ec9('0x4f')});}else if(_0x527eb0[_0x0ec9('0x22')][_0x0ec9('0x3d')]()==_0x0ec9('0x50')){var _0x1cc445=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],_0x0ec9('0x45')),_0x0ec9('0x43'));var _0x524700=ejs[_0x0ec9('0x46')](_0x1cc445,{'networks':_0x12e304||[]});fs[_0x0ec9('0x4a')](_0x0ec9('0x47'),_0x524700);return respondWithRpcPromise('Reload',_0x0ec9('0x18'),{'module':'res_stun_monitor.so'});}else{var _0x2007f6=fs[_0x0ec9('0x3f')](path['join'](config[_0x0ec9('0x41')],'server/files/templates/network.ejs'),_0x0ec9('0x43'));var _0x216e88=ejs['render'](_0x2007f6,{'networks':_0x12e304||[]});fs['writeFileSync'](util[_0x0ec9('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x2e8c26[_0x0ec9('0x3c')][_0x0ec9('0x22')]['toLowerCase']()),_0x216e88);return respondWithRpcPromise('Reload',_0x0ec9('0x18'),{'module':'chan_sip.so'});}})[_0x0ec9('0x9')](function(_0x3166ed){if(_0x3166ed){return _0x527eb0;}return null;})['then'](respondWithResult(_0x52a8ed,null))[_0x0ec9('0x11')](handleError(_0x52a8ed,null));};exports[_0x0ec9('0x19')]=function(_0x28ad65,_0x5a1fa7){var _0xbdeb55;return db[_0x0ec9('0x20')][_0x0ec9('0x3a')]({'where':{'id':_0x28ad65[_0x0ec9('0x4e')]['id']}})[_0x0ec9('0x9')](function(_0x4de7e6){_0xbdeb55=_0x4de7e6;return _0x4de7e6;})[_0x0ec9('0x9')](handleEntityNotFound(_0x5a1fa7,null))[_0x0ec9('0x9')](removeEntity(_0x5a1fa7,null))[_0x0ec9('0x9')](function(){if(_0xbdeb55){return db[_0x0ec9('0x20')][_0x0ec9('0x35')]({'where':{'type':_0xbdeb55['type']},'raw':!![]});}})['then'](function(_0x3e334a){if(_0xbdeb55['type']['toUpperCase']()==_0x0ec9('0x3e')){var _0x283e18=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],'server/files/templates/stun_multiple.ejs'),_0x0ec9('0x43'));var _0x26f018=ejs[_0x0ec9('0x46')](_0x283e18,{'networks':_0x3e334a||[]});fs[_0x0ec9('0x4a')](_0x0ec9('0x44'),_0x26f018);return respondWithRpcPromise(_0x0ec9('0x48'),_0x0ec9('0x19'),{'module':_0x0ec9('0x4f')});}else if(_0xbdeb55['type'][_0x0ec9('0x3d')]()==_0x0ec9('0x50')){var _0x1ab7e0=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],_0x0ec9('0x45')),'utf8');var _0x2f7105=ejs[_0x0ec9('0x46')](_0x1ab7e0,{'networks':_0x3e334a||[]});fs[_0x0ec9('0x4a')](_0x0ec9('0x47'),_0x2f7105);return respondWithRpcPromise(_0x0ec9('0x48'),'destroy',{'module':_0x0ec9('0x4f')});}else{var _0x2a4b61=fs[_0x0ec9('0x3f')](path[_0x0ec9('0x40')](config[_0x0ec9('0x41')],'server/files/templates/network.ejs'),_0x0ec9('0x43'));var _0x17fcc4=ejs[_0x0ec9('0x46')](_0x2a4b61,{'networks':_0x3e334a||[]});fs[_0x0ec9('0x4a')](util['format'](_0x0ec9('0x51'),_0xbdeb55['type'][_0x0ec9('0x4c')]()),_0x17fcc4);return respondWithRpcPromise(_0x0ec9('0x48'),_0x0ec9('0x19'),{'module':'chan_sip.so'});}})[_0x0ec9('0x11')](handleError(_0x5a1fa7,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f96a8f2..369a1ad 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 _0xfc03=['./network.attributes','exports','define','network','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x2d170b,_0x507408){var _0x2423da=function(_0x59c266){while(--_0x59c266){_0x2d170b['push'](_0x2d170b['shift']());}};_0x2423da(++_0x507408);}(_0xfc03,0x16f));var _0x3fc0=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xfc03[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x3fc0('0x0'));var util=require('util');var logger=require(_0x3fc0('0x1'))(_0x3fc0('0x2'));var moment=require('moment');var BPromise=require(_0x3fc0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fc0('0x4'));var rimraf=require(_0x3fc0('0x5'));var config=require(_0x3fc0('0x6'));var attributes=require(_0x3fc0('0x7'));module[_0x3fc0('0x8')]=function(_0x389bfb,_0x2b4ef6){return _0x389bfb[_0x3fc0('0x9')]('Network',attributes,{'tableName':_0x3fc0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76dc=['rimraf','exports','network','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76dc,0x1f2));var _0xc76d=function(_0x2a638f,_0x20db3f){_0x2a638f=_0x2a638f-0x0;var _0x836eff=_0x76dc[_0x2a638f];return _0x836eff;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var logger=require(_0xc76d('0x2'))(_0xc76d('0x3'));var moment=require('moment');var BPromise=require(_0xc76d('0x4'));var rp=require(_0xc76d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc76d('0x6'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xc76d('0x7')]=function(_0x29ab70,_0x1c86fc){return _0x29ab70['define']('Network',attributes,{'tableName':_0xc76d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 0afaffe..828b1d5 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x3e6ed7,_0x3a1aae){_0x3e6ed7=_0x3e6ed7-0x0;var _0x427b09=_0x7a54[_0x3e6ed7];return _0x427b09;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7feb45,_0x56dd63){var _0x31650f=function(_0x3754d8){while(--_0x3754d8){_0x7feb45['push'](_0x7feb45['shift']());}};_0x31650f(++_0x56dd63);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 84a57bc..90d077e 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 _0x6bb6=['delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getApplications','/:id/interactions','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','notify','/:id/applications','addApplications','/:id/users','/:id/send','send','put'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x6bb6,0xae));var _0x66bb=function(_0x4cce2f,_0x78a347){_0x4cce2f=_0x4cce2f-0x0;var _0x19b1ba=_0x6bb6[_0x4cce2f];return _0x19b1ba;};'use strict';var multer=require(_0x66bb('0x0'));var util=require(_0x66bb('0x1'));var path=require(_0x66bb('0x2'));var timeout=require(_0x66bb('0x3'));var express=require(_0x66bb('0x4'));var router=express[_0x66bb('0x5')]();var fs_extra=require(_0x66bb('0x6'));var auth=require(_0x66bb('0x7'));var interaction=require(_0x66bb('0x8'));var config=require(_0x66bb('0x9'));var controller=require(_0x66bb('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x66bb('0xb')]);router[_0x66bb('0xc')](_0x66bb('0xd'),auth[_0x66bb('0xe')](),controller[_0x66bb('0xf')]);router['get'](_0x66bb('0x10'),auth[_0x66bb('0xe')](),controller[_0x66bb('0x11')]);router[_0x66bb('0xc')](_0x66bb('0x12'),auth[_0x66bb('0xe')](),controller[_0x66bb('0x13')]);router[_0x66bb('0xc')]('/:id/canned_answers',auth[_0x66bb('0xe')](),controller[_0x66bb('0x14')]);router['get']('/:id/applications',auth[_0x66bb('0xe')](),controller[_0x66bb('0x15')]);router[_0x66bb('0xc')](_0x66bb('0x16'),auth[_0x66bb('0xe')](),controller['getInteractions']);router[_0x66bb('0xc')]('/:id/users',auth[_0x66bb('0xe')](),controller[_0x66bb('0x17')]);router[_0x66bb('0x18')]('/',auth[_0x66bb('0xe')](),controller[_0x66bb('0x19')]);router[_0x66bb('0x18')](_0x66bb('0x12'),auth['isAuthenticated'](),controller[_0x66bb('0x1a')]);router[_0x66bb('0x18')](_0x66bb('0x1b'),auth[_0x66bb('0xe')](),controller[_0x66bb('0x1c')]);router[_0x66bb('0x18')]('/:id/notify',controller[_0x66bb('0x1d')]);router[_0x66bb('0x18')](_0x66bb('0x1e'),auth[_0x66bb('0xe')](),controller[_0x66bb('0x1f')]);router[_0x66bb('0x18')](_0x66bb('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x66bb('0x18')](_0x66bb('0x21'),auth['isAuthenticated'](),controller[_0x66bb('0x22')]);router[_0x66bb('0x23')]('/:id',auth[_0x66bb('0xe')](),controller['update']);router[_0x66bb('0x24')]('/:id',auth[_0x66bb('0xe')](),controller[_0x66bb('0x25')]);router['delete'](_0x66bb('0x12'),auth[_0x66bb('0xe')](),controller[_0x66bb('0x26')]);router[_0x66bb('0x24')](_0x66bb('0x1b'),auth['isAuthenticated'](),controller[_0x66bb('0x27')]);router['delete'](_0x66bb('0x20'),auth['isAuthenticated'](),controller[_0x66bb('0x28')]);module[_0x66bb('0x29')]=router; \ No newline at end of file +var _0x2ace=['removeAnswers','removeAgents','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','update','destroy','delete','removeDispositions'];(function(_0x382719,_0x91d5cb){var _0x48cff9=function(_0xf539c3){while(--_0xf539c3){_0x382719['push'](_0x382719['shift']());}};_0x48cff9(++_0x91d5cb);}(_0x2ace,0xaa));var _0xe2ac=function(_0x208961,_0x5e6cf6){_0x208961=_0x208961-0x0;var _0x4236f5=_0x2ace[_0x208961];return _0x4236f5;};'use strict';var multer=require(_0xe2ac('0x0'));var util=require(_0xe2ac('0x1'));var path=require(_0xe2ac('0x2'));var timeout=require('connect-timeout');var express=require(_0xe2ac('0x3'));var router=express[_0xe2ac('0x4')]();var fs_extra=require(_0xe2ac('0x5'));var auth=require(_0xe2ac('0x6'));var interaction=require(_0xe2ac('0x7'));var config=require(_0xe2ac('0x8'));var controller=require(_0xe2ac('0x9'));router[_0xe2ac('0xa')]('/',auth['isAuthenticated'](),controller[_0xe2ac('0xb')]);router[_0xe2ac('0xa')](_0xe2ac('0xc'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0xe')]);router[_0xe2ac('0xa')](_0xe2ac('0xf'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x10')]);router[_0xe2ac('0xa')](_0xe2ac('0x11'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x12')]);router[_0xe2ac('0xa')](_0xe2ac('0x13'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x14')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0xe2ac('0x15')]);router[_0xe2ac('0xa')](_0xe2ac('0x16'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x17')]);router[_0xe2ac('0xa')](_0xe2ac('0x18'),auth['isAuthenticated'](),controller[_0xe2ac('0x19')]);router[_0xe2ac('0x1a')]('/',auth[_0xe2ac('0xd')](),controller['create']);router[_0xe2ac('0x1a')]('/:id/dispositions',auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x1b')]);router[_0xe2ac('0x1a')](_0xe2ac('0x13'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x1c')]);router[_0xe2ac('0x1a')](_0xe2ac('0x1d'),controller[_0xe2ac('0x1e')]);router[_0xe2ac('0x1a')](_0xe2ac('0x1f'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x20')]);router[_0xe2ac('0x1a')](_0xe2ac('0x18'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x21')]);router[_0xe2ac('0x1a')](_0xe2ac('0x22'),auth['isAuthenticated'](),controller[_0xe2ac('0x23')]);router['put'](_0xe2ac('0xf'),auth['isAuthenticated'](),controller[_0xe2ac('0x24')]);router['delete'](_0xe2ac('0xf'),auth['isAuthenticated'](),controller[_0xe2ac('0x25')]);router[_0xe2ac('0x26')](_0xe2ac('0x11'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x27')]);router[_0xe2ac('0x26')](_0xe2ac('0x13'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x28')]);router[_0xe2ac('0x26')](_0xe2ac('0x18'),auth[_0xe2ac('0xd')](),controller[_0xe2ac('0x29')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 1a94fe6..0777c30 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 _0x0dc4=['randomstring','exports','STRING','name','generate','TEXT','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x4a8f71,_0x4c441f){var _0x66afa3=function(_0x5883fd){while(--_0x5883fd){_0x4a8f71['push'](_0x4a8f71['shift']());}};_0x66afa3(++_0x4c441f);}(_0x0dc4,0x74));var _0x40dc=function(_0x166e88,_0x1bae10){_0x166e88=_0x166e88-0x0;var _0x43ec68=_0x0dc4[_0x166e88];return _0x43ec68;};'use strict';var Sequelize=require(_0x40dc('0x0'));var rs=require(_0x40dc('0x1'));module[_0x40dc('0x2')]={'name':{'type':Sequelize[_0x40dc('0x3')],'unique':_0x40dc('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x40dc('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x40dc('0x5')]();}},'replyUri':{'type':Sequelize[_0x40dc('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x40dc('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x40dc('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x40dc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x40dc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x40dc('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x40dc('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x40dc('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x40dc('0x8')],'defaultValue':![],'comment':_0x40dc('0xa'),'set':function(_0x9814f3){if(!_0x9814f3)this[_0x40dc('0xb')](_0x40dc('0xc'),null);this[_0x40dc('0xb')]('mandatoryDisposition',_0x9814f3);}}}; \ No newline at end of file +var _0x0328=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x42f56f,_0x42fbc1){var _0x23edca=function(_0x392050){while(--_0x392050){_0x42f56f['push'](_0x42f56f['shift']());}};_0x23edca(++_0x42fbc1);}(_0x0328,0x148));var _0x8032=function(_0x292fda,_0x4cd0b7){_0x292fda=_0x292fda-0x0;var _0x53fd5c=_0x0328[_0x292fda];return _0x53fd5c;};'use strict';var Sequelize=require(_0x8032('0x0'));var rs=require(_0x8032('0x1'));module[_0x8032('0x2')]={'name':{'type':Sequelize[_0x8032('0x3')],'unique':_0x8032('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x8032('0x3')]},'token':{'type':Sequelize[_0x8032('0x3')],'defaultValue':function(){return rs[_0x8032('0x5')]();}},'replyUri':{'type':Sequelize[_0x8032('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8032('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8032('0x6')],'defaultValue':function(){return _0x8032('0x7');}},'notificationSound':{'type':Sequelize[_0x8032('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8032('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8032('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8032('0x3')]},'queueTransfer':{'type':Sequelize[_0x8032('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8032('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8032('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8032('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8032('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8032('0xb'),'set':function(_0x239d74){if(!_0x239d74)this[_0x8032('0xc')]('mandatoryDispositionPauseId',null);this[_0x8032('0xc')](_0x8032('0xd'),_0x239d74);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f77c7da..7d6b4f1 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 _0x3248=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','finally','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','map','OpenchannelAccount','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','mandatoryDispositionPause','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3248,0x1bc));var _0x8324=function(_0xe5e849,_0x35f26a){_0xe5e849=_0xe5e849-0x0;var _0xec9fe=_0x3248[_0xe5e849];return _0xec9fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8324('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));var BPromise=require(_0x8324('0x3'));var Mustache=require(_0x8324('0x4'));var util=require(_0x8324('0x5'));var path=require(_0x8324('0x6'));var sox=require('sox');var csv=require(_0x8324('0x7'));var ejs=require(_0x8324('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8324('0x9'));var squel=require(_0x8324('0xa'));var crypto=require(_0x8324('0xb'));var jsforce=require(_0x8324('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8324('0x7'));var querystring=require(_0x8324('0xd'));var Papa=require(_0x8324('0xe'));var Redis=require(_0x8324('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8324('0x10'));var as=require(_0x8324('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8324('0x12'))(_0x8324('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8324('0x14'))['db'];config[_0x8324('0x15')]=_[_0x8324('0x16')](config[_0x8324('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8324('0x17'))(new Redis(config[_0x8324('0x15')]));require(_0x8324('0x18'))[_0x8324('0x19')](socket);var jayson=require(_0x8324('0x1a'));var client=jayson['client'][_0x8324('0x1b')]({'port':0x232c});var client9002=jayson[_0x8324('0x1c')][_0x8324('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3b1a18,_0x3f8f66,_0x5ecb20,_0x8da92c){return new BPromise(function(_0xaf20a5,_0x2c5ab2){var _0x3ea132=_0x8da92c||client;return _0x3ea132['request'](_0x3b1a18,_0x5ecb20)['then'](function(_0x47b5e1){logger['info'](_0x8324('0x1d'),_0x3f8f66,_0x8324('0x1e'));logger[_0x8324('0x1f')](_0x8324('0x20'),_0x3f8f66,'request\x20sent',JSON[_0x8324('0x21')](_0x47b5e1));if(_0x47b5e1[_0x8324('0x22')]){if(_0x47b5e1[_0x8324('0x22')][_0x8324('0x23')]===0x1f4){logger[_0x8324('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x3f8f66,_0x47b5e1[_0x8324('0x22')][_0x8324('0x24')]);return _0x2c5ab2(_0x47b5e1[_0x8324('0x22')]['message']);}logger[_0x8324('0x22')](_0x8324('0x1d'),_0x3f8f66,_0x47b5e1[_0x8324('0x22')][_0x8324('0x24')]);return _0xaf20a5(_0x47b5e1[_0x8324('0x22')]['message']);}else{logger[_0x8324('0x25')](_0x8324('0x1d'),_0x3f8f66,'request\x20sent');_0xaf20a5(_0x47b5e1[_0x8324('0x26')][_0x8324('0x24')]);}})[_0x8324('0x27')](function(_0x43717d){logger[_0x8324('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x3f8f66,_0x43717d);_0x2c5ab2(_0x43717d);});});}function respondWithStatusCode(_0x575845,_0x3e5233){_0x3e5233=_0x3e5233||0xcc;return function(_0x3569db){if(_0x3569db){return _0x575845[_0x8324('0x28')](_0x3e5233);}return _0x575845[_0x8324('0x29')](_0x3e5233)[_0x8324('0x2a')]();};}function respondWithResult(_0x41e2fd,_0x5b2a1a){_0x5b2a1a=_0x5b2a1a||0xc8;return function(_0x329ccc){if(_0x329ccc){return _0x41e2fd['status'](_0x5b2a1a)['json'](_0x329ccc);}};}function respondWithFilteredResult(_0x3f8f4b,_0x3afd87){return function(_0x28ba63){if(_0x28ba63){var _0x2cf245=typeof _0x3afd87[_0x8324('0x2b')]==='undefined'&&typeof _0x3afd87['limit']===_0x8324('0x2c');var _0x57cf98=_0x28ba63['count'];var _0x562798=_0x2cf245?0x0:_0x3afd87['offset'];var _0x4f67b0=_0x2cf245?_0x28ba63[_0x8324('0x2d')]:_0x3afd87[_0x8324('0x2b')]+_0x3afd87[_0x8324('0x2e')];var _0x6e06dd;if(_0x4f67b0>=_0x57cf98){_0x4f67b0=_0x57cf98;_0x6e06dd=0xc8;}else{_0x6e06dd=0xce;}_0x3f8f4b['status'](_0x6e06dd);return _0x3f8f4b[_0x8324('0x2f')](_0x8324('0x30'),_0x562798+'-'+_0x4f67b0+'/'+_0x57cf98)[_0x8324('0x31')](_0x28ba63);}return null;};}function patchUpdates(_0x509589){return function(_0x446b4f){try{jsonpatch[_0x8324('0x32')](_0x446b4f,_0x509589,!![]);}catch(_0x9c769){return BPromise['reject'](_0x9c769);}return _0x446b4f[_0x8324('0x33')]();};}function saveUpdates(_0x33bbd7,_0x5a59d9){return function(_0x134dcc){if(_0x134dcc){return _0x134dcc[_0x8324('0x34')](_0x33bbd7)[_0x8324('0x35')](function(_0x70f40f){return _0x70f40f;});}return null;};}function removeEntity(_0x4abc44,_0x200889){return function(_0x8d8ab3){if(_0x8d8ab3){return _0x8d8ab3[_0x8324('0x36')]()[_0x8324('0x35')](function(){var _0x2ac8ca=_0x8d8ab3[_0x8324('0x37')]({'plain':!![]});var _0x57d38d=_0x8324('0x38');return db[_0x8324('0x39')][_0x8324('0x36')]({'where':{'type':_0x57d38d,'resourceId':_0x2ac8ca['id']}})[_0x8324('0x35')](function(){return _0x8d8ab3;});})[_0x8324('0x35')](function(){_0x4abc44[_0x8324('0x29')](0xcc)[_0x8324('0x2a')]();});}};}function handleEntityNotFound(_0x541868,_0x1f37b7){return function(_0x459cb1){if(!_0x459cb1){_0x541868[_0x8324('0x28')](0x194);}return _0x459cb1;};}function handleError(_0x231dd9,_0x2dea70){_0x2dea70=_0x2dea70||0x1f4;return function(_0x135bde){logger[_0x8324('0x22')](_0x135bde[_0x8324('0x3a')]);if(_0x135bde['name']){delete _0x135bde[_0x8324('0x3b')];}_0x231dd9[_0x8324('0x29')](_0x2dea70)[_0x8324('0x3c')](_0x135bde);};}exports[_0x8324('0x3d')]=function(_0x23a6d8,_0x2df903){var _0x1fb84f={'include':[{'model':db[_0x8324('0x3e')],'as':'mandatoryDispositionPause'}]},_0xdf610a={},_0x158b19={'count':0x0,'rows':[]};var _0x3ecc37=_[_0x8324('0x3f')](db[_0x8324('0x40')]['rawAttributes'],function(_0x44e349){return{'name':_0x44e349[_0x8324('0x41')],'type':_0x44e349[_0x8324('0x42')]['key']};});_0xdf610a[_0x8324('0x43')]=_[_0x8324('0x3f')](_0x3ecc37,'name');_0xdf610a['query']=_['keys'](_0x23a6d8[_0x8324('0x44')]);_0xdf610a['filters']=_[_0x8324('0x45')](_0xdf610a[_0x8324('0x43')],_0xdf610a[_0x8324('0x44')]);_0x1fb84f[_0x8324('0x46')]=_[_0x8324('0x45')](_0xdf610a[_0x8324('0x43')],qs[_0x8324('0x47')](_0x23a6d8['query'][_0x8324('0x47')]));_0x1fb84f[_0x8324('0x46')]=_0x1fb84f[_0x8324('0x46')][_0x8324('0x48')]?_0x1fb84f[_0x8324('0x46')]:_0xdf610a['model'];if(!_0x23a6d8[_0x8324('0x44')][_0x8324('0x49')](_0x8324('0x4a'))){_0x1fb84f[_0x8324('0x2e')]=qs[_0x8324('0x2e')](_0x23a6d8[_0x8324('0x44')]['limit']);_0x1fb84f[_0x8324('0x2b')]=qs[_0x8324('0x2b')](_0x23a6d8['query'][_0x8324('0x2b')]);}_0x1fb84f[_0x8324('0x4b')]=qs['sort'](_0x23a6d8[_0x8324('0x44')][_0x8324('0x4c')]);_0x1fb84f[_0x8324('0x4d')]=qs[_0x8324('0x4e')](_[_0x8324('0x4f')](_0x23a6d8[_0x8324('0x44')],_0xdf610a[_0x8324('0x4e')]),_0x3ecc37);if(_0x23a6d8[_0x8324('0x44')][_0x8324('0x50')]){_0x1fb84f['where']=_[_0x8324('0x51')](_0x1fb84f[_0x8324('0x4d')],{'$or':_[_0x8324('0x3f')](_0x3ecc37,function(_0x4bafe6){if(_0x4bafe6[_0x8324('0x42')]!==_0x8324('0x52')){var _0x489b2a={};_0x489b2a[_0x4bafe6[_0x8324('0x3b')]]={'$like':'%'+_0x23a6d8[_0x8324('0x44')]['filter']+'%'};return _0x489b2a;}})});}_0x1fb84f=_['merge']({},_0x1fb84f,_0x23a6d8['options']);var _0x528749={'where':_0x1fb84f[_0x8324('0x4d')]};return db['OpenchannelAccount'][_0x8324('0x2d')](_0x528749)[_0x8324('0x35')](function(_0x6b9fae){_0x158b19[_0x8324('0x2d')]=_0x6b9fae;if(_0x23a6d8[_0x8324('0x44')][_0x8324('0x53')]){_0x1fb84f['include']=[{'all':!![]}];}return db[_0x8324('0x40')][_0x8324('0x54')](_0x1fb84f);})[_0x8324('0x35')](function(_0x3e2d15){_0x158b19[_0x8324('0x55')]=_0x3e2d15;return _0x158b19;})[_0x8324('0x35')](respondWithFilteredResult(_0x2df903,_0x1fb84f))['catch'](handleError(_0x2df903,null));};exports[_0x8324('0x56')]=function(_0x4b7de6,_0x33c0af){var _0x93a07b={'raw':![],'where':{'id':_0x4b7de6[_0x8324('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x8324('0x58')}]},_0x3aee16={};_0x3aee16[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0x40')]['rawAttributes']);_0x3aee16[_0x8324('0x44')]=_[_0x8324('0x59')](_0x4b7de6['query']);_0x3aee16['filters']=_[_0x8324('0x45')](_0x3aee16[_0x8324('0x43')],_0x3aee16['query']);_0x93a07b[_0x8324('0x46')]=_[_0x8324('0x45')](_0x3aee16[_0x8324('0x43')],qs['fields'](_0x4b7de6[_0x8324('0x44')][_0x8324('0x47')]));_0x93a07b[_0x8324('0x46')]=_0x93a07b[_0x8324('0x46')][_0x8324('0x48')]?_0x93a07b[_0x8324('0x46')]:_0x3aee16[_0x8324('0x43')];if(_0x4b7de6[_0x8324('0x44')][_0x8324('0x53')]){_0x93a07b[_0x8324('0x5a')]=[{'all':!![]}];}_0x93a07b=_[_0x8324('0x51')]({},_0x93a07b,_0x4b7de6[_0x8324('0x5b')]);return db[_0x8324('0x40')][_0x8324('0x5c')](_0x93a07b)['then'](handleEntityNotFound(_0x33c0af,null))[_0x8324('0x35')](respondWithResult(_0x33c0af,null))[_0x8324('0x27')](handleError(_0x33c0af,null));};exports['create']=function(_0xa43499,_0x24a2e6){return db[_0x8324('0x40')][_0x8324('0x5d')](_0xa43499['body'],{})[_0x8324('0x35')](function(_0x826085){var _0x35b37e=_0xa43499[_0x8324('0x5e')][_0x8324('0x37')]({'plain':!![]});if(!_0x35b37e)throw new Error(_0x8324('0x5f'));if(_0x35b37e[_0x8324('0x60')]===_0x8324('0x5e')){var _0x5b38d8=_0x826085[_0x8324('0x37')]({'plain':!![]});var _0x328f43='OpenchannelAccounts';return db[_0x8324('0x61')][_0x8324('0x5c')]({'where':{'name':_0x328f43,'userProfileId':_0x35b37e[_0x8324('0x62')]},'raw':!![]})[_0x8324('0x35')](function(_0xbf76f8){if(_0xbf76f8&&_0xbf76f8[_0x8324('0x63')]===0x0){return db['UserProfileResource'][_0x8324('0x5d')]({'name':_0x5b38d8['name'],'resourceId':_0x5b38d8['id'],'type':_0xbf76f8[_0x8324('0x3b')],'sectionId':_0xbf76f8['id']},{})[_0x8324('0x35')](function(){return _0x826085;});}else{return _0x826085;}})[_0x8324('0x27')](function(_0x3288d6){logger[_0x8324('0x22')](_0x8324('0x64'),_0x3288d6);throw _0x3288d6;});}return _0x826085;})[_0x8324('0x35')](respondWithResult(_0x24a2e6,0xc9))[_0x8324('0x27')](handleError(_0x24a2e6,null));};exports[_0x8324('0x34')]=function(_0x200e18,_0x1b9148){if(_0x200e18[_0x8324('0x65')]['id']){delete _0x200e18[_0x8324('0x65')]['id'];}return db['OpenchannelAccount'][_0x8324('0x5c')]({'where':{'id':_0x200e18['params']['id']},'include':[{'model':db[_0x8324('0x3e')],'as':_0x8324('0x58')}]})['then'](handleEntityNotFound(_0x1b9148,null))[_0x8324('0x35')](saveUpdates(_0x200e18[_0x8324('0x65')],null))[_0x8324('0x35')](respondWithResult(_0x1b9148,null))[_0x8324('0x27')](handleError(_0x1b9148,null));};exports[_0x8324('0x36')]=function(_0x56a536,_0x59fc5c){return db['OpenchannelAccount'][_0x8324('0x5c')]({'where':{'id':_0x56a536['params']['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x59fc5c,null))[_0x8324('0x35')](removeEntity(_0x59fc5c,null))['catch'](handleError(_0x59fc5c,null));};exports[_0x8324('0x66')]=function(_0x32c619,_0x170664){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x170664,null))[_0x8324('0x27')](handleError(_0x170664,null));};exports[_0x8324('0x67')]=function(_0x804db3,_0x5e77e1,_0x367d45){if(_0x804db3['body']['id']){delete _0x804db3[_0x8324('0x65')]['id'];}return db[_0x8324('0x40')]['find']({'where':{'id':_0x804db3[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x5e77e1,null))[_0x8324('0x35')](function(_0x40d927){if(_0x40d927){_0x804db3[_0x8324('0x65')][_0x8324('0x68')]=_0x40d927['id'];return db[_0x8324('0x69')][_0x8324('0x5d')](_0x804db3[_0x8324('0x65')]);}})[_0x8324('0x35')](respondWithResult(_0x5e77e1,null))['catch'](handleError(_0x5e77e1,null));};exports[_0x8324('0x6a')]=function(_0x5653ac,_0x3a9696,_0x5eded9){var _0x2075c5={'raw':![],'where':{}};var _0x4d8416={};var _0x3674ce={'count':0x0,'rows':[]};return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x5653ac[_0x8324('0x57')]['id']}})['then'](handleEntityNotFound(_0x3a9696,null))[_0x8324('0x35')](function(_0x4d6188){if(_0x4d6188){_0x4d8416[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0x69')][_0x8324('0x6c')]);_0x4d8416['query']=_['keys'](_0x5653ac[_0x8324('0x44')]);_0x4d8416[_0x8324('0x4e')]=_['intersection'](_0x4d8416[_0x8324('0x43')],_0x4d8416[_0x8324('0x44')]);_0x2075c5[_0x8324('0x46')]=_[_0x8324('0x45')](_0x4d8416[_0x8324('0x43')],qs[_0x8324('0x47')](_0x5653ac[_0x8324('0x44')][_0x8324('0x47')]));_0x2075c5[_0x8324('0x46')]=_0x2075c5[_0x8324('0x46')][_0x8324('0x48')]?_0x2075c5['attributes']:_0x4d8416[_0x8324('0x43')];if(!_0x5653ac[_0x8324('0x44')][_0x8324('0x49')](_0x8324('0x4a'))){_0x2075c5[_0x8324('0x2e')]=qs['limit'](_0x5653ac['query'][_0x8324('0x2e')]);_0x2075c5[_0x8324('0x2b')]=qs[_0x8324('0x2b')](_0x5653ac[_0x8324('0x44')][_0x8324('0x2b')]);}_0x2075c5[_0x8324('0x4b')]=qs[_0x8324('0x4c')](_0x5653ac[_0x8324('0x44')][_0x8324('0x4c')]);_0x2075c5[_0x8324('0x4d')]=qs[_0x8324('0x4e')](_[_0x8324('0x4f')](_0x5653ac[_0x8324('0x44')],_0x4d8416['filters']));_0x2075c5[_0x8324('0x4d')][_0x8324('0x68')]=_0x4d6188['id'];if(_0x5653ac[_0x8324('0x44')][_0x8324('0x50')]){_0x2075c5[_0x8324('0x4d')]=_[_0x8324('0x51')](_0x2075c5['where'],{'$or':_[_0x8324('0x3f')](_0x2075c5[_0x8324('0x46')],function(_0x432770){var _0x3e345d={};_0x3e345d[_0x432770]={'$like':'%'+_0x5653ac[_0x8324('0x44')]['filter']+'%'};return _0x3e345d;})});}_0x2075c5=_[_0x8324('0x51')]({},_0x2075c5,_0x5653ac[_0x8324('0x5b')]);return db[_0x8324('0x69')]['count']({'where':_0x2075c5[_0x8324('0x4d')]})[_0x8324('0x35')](function(_0x5d7942){_0x3674ce[_0x8324('0x2d')]=_0x5d7942;if(_0x5653ac['query']['includeAll']){_0x2075c5[_0x8324('0x5a')]=[{'all':!![]}];}return db[_0x8324('0x69')]['findAll'](_0x2075c5);})['then'](function(_0x166813){_0x3674ce[_0x8324('0x55')]=_0x166813;return _0x3674ce;});}})[_0x8324('0x35')](respondWithFilteredResult(_0x3a9696,_0x2075c5))['catch'](handleError(_0x3a9696,null));};exports['removeDispositions']=function(_0x1da881,_0x1e0cd4,_0xff03af){return db[_0x8324('0x40')][_0x8324('0x5c')]({'where':{'id':_0x1da881[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x1e0cd4,null))[_0x8324('0x35')](function(_0x565f8b){if(_0x565f8b){return _0x565f8b[_0x8324('0x6d')](_0x1da881[_0x8324('0x44')][_0x8324('0x6e')]);}})[_0x8324('0x35')](respondWithStatusCode(_0x1e0cd4,null))[_0x8324('0x27')](handleError(_0x1e0cd4,null));};exports[_0x8324('0x6f')]=function(_0x5d035c,_0x7dfc2,_0x1e1a26){if(_0x5d035c[_0x8324('0x65')]['id']){delete _0x5d035c[_0x8324('0x65')]['id'];}return db[_0x8324('0x40')]['find']({'where':{'id':_0x5d035c[_0x8324('0x57')]['id']}})['then'](handleEntityNotFound(_0x7dfc2,null))[_0x8324('0x35')](function(_0x209c03){if(_0x209c03){_0x5d035c[_0x8324('0x65')]['OpenchannelAccountId']=_0x209c03['id'];return db[_0x8324('0x70')][_0x8324('0x5d')](_0x5d035c['body']);}})[_0x8324('0x35')](respondWithResult(_0x7dfc2,null))[_0x8324('0x27')](handleError(_0x7dfc2,null));};exports[_0x8324('0x71')]=function(_0x294219,_0x1f2d59,_0x1ed463){var _0x4c64d4={'raw':![],'where':{}};var _0x1649e2={};var _0x2671cf={'count':0x0,'rows':[]};return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x294219[_0x8324('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f2d59,null))[_0x8324('0x35')](function(_0x1d3ea2){if(_0x1d3ea2){_0x1649e2[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0x70')]['rawAttributes']);_0x1649e2[_0x8324('0x44')]=_[_0x8324('0x59')](_0x294219['query']);_0x1649e2['filters']=_[_0x8324('0x45')](_0x1649e2[_0x8324('0x43')],_0x1649e2[_0x8324('0x44')]);_0x4c64d4[_0x8324('0x46')]=_[_0x8324('0x45')](_0x1649e2[_0x8324('0x43')],qs[_0x8324('0x47')](_0x294219[_0x8324('0x44')][_0x8324('0x47')]));_0x4c64d4[_0x8324('0x46')]=_0x4c64d4[_0x8324('0x46')][_0x8324('0x48')]?_0x4c64d4['attributes']:_0x1649e2[_0x8324('0x43')];if(!_0x294219[_0x8324('0x44')][_0x8324('0x49')](_0x8324('0x4a'))){_0x4c64d4[_0x8324('0x2e')]=qs[_0x8324('0x2e')](_0x294219['query'][_0x8324('0x2e')]);_0x4c64d4['offset']=qs[_0x8324('0x2b')](_0x294219['query'][_0x8324('0x2b')]);}_0x4c64d4[_0x8324('0x4b')]=qs[_0x8324('0x4c')](_0x294219[_0x8324('0x44')]['sort']);_0x4c64d4[_0x8324('0x4d')]=qs[_0x8324('0x4e')](_[_0x8324('0x4f')](_0x294219[_0x8324('0x44')],_0x1649e2[_0x8324('0x4e')]));_0x4c64d4[_0x8324('0x4d')][_0x8324('0x68')]=_0x1d3ea2['id'];if(_0x294219[_0x8324('0x44')][_0x8324('0x50')]){_0x4c64d4[_0x8324('0x4d')]=_[_0x8324('0x51')](_0x4c64d4['where'],{'$or':_[_0x8324('0x3f')](_0x4c64d4[_0x8324('0x46')],function(_0x35bbb4){var _0x52a16b={};_0x52a16b[_0x35bbb4]={'$like':'%'+_0x294219[_0x8324('0x44')][_0x8324('0x50')]+'%'};return _0x52a16b;})});}_0x4c64d4=_[_0x8324('0x51')]({},_0x4c64d4,_0x294219['options']);return db['CannedAnswer'][_0x8324('0x2d')]({'where':_0x4c64d4[_0x8324('0x4d')]})[_0x8324('0x35')](function(_0x2c0342){_0x2671cf['count']=_0x2c0342;if(_0x294219[_0x8324('0x44')][_0x8324('0x53')]){_0x4c64d4[_0x8324('0x5a')]=[{'all':!![]}];}return db[_0x8324('0x70')][_0x8324('0x54')](_0x4c64d4);})[_0x8324('0x35')](function(_0x1a51dd){_0x2671cf[_0x8324('0x55')]=_0x1a51dd;return _0x2671cf;});}})['then'](respondWithFilteredResult(_0x1f2d59,_0x4c64d4))[_0x8324('0x27')](handleError(_0x1f2d59,null));};exports[_0x8324('0x72')]=function(_0xa1286,_0x34d99b,_0x1a159c){return db[_0x8324('0x40')][_0x8324('0x5c')]({'where':{'id':_0xa1286[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x34d99b,null))[_0x8324('0x35')](function(_0x199a99){if(_0x199a99){return _0x199a99[_0x8324('0x72')](_0xa1286[_0x8324('0x44')][_0x8324('0x6e')]);}})[_0x8324('0x35')](respondWithStatusCode(_0x34d99b,null))[_0x8324('0x27')](handleError(_0x34d99b,null));};exports[_0x8324('0x73')]=function(_0x3dbbe9,_0x2d98e9,_0x4e273d){var _0x2abdd1={'body':_0x3dbbe9[_0x8324('0x65')],'channel':'openchannel'};var _0x45b21b=[];var _0x516b4f=[];var _0x1f552a={};var _0x4060aa=![];return db[_0x8324('0x74')][_0x8324('0x66')]()[_0x8324('0x35')](function(_0x38f77b){if(!_0x38f77b){throw new db['Sequelize'][(_0x8324('0x75'))]('no\x20available\x20attributes');}_0x45b21b=_[_0x8324('0x76')](_[_0x8324('0x59')](_0x38f77b),[_0x8324('0x77'),_0x8324('0x78')]);_0x516b4f=_[_0x8324('0x76')](_['keys'](_0x38f77b),[_0x8324('0x77'),_0x8324('0x78'),'CompanyId',_0x8324('0x79')]);if(_0x3dbbe9[_0x8324('0x65')]['id']){delete _0x3dbbe9['body']['id'];}if(_[_0x8324('0x7a')](_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7b')])){throw new db['Sequelize'][(_0x8324('0x75'))](_0x8324('0x7c'));}if(_[_0x8324('0x7a')](_0x3dbbe9[_0x8324('0x65')][_0x8324('0x65')])||_0x3dbbe9[_0x8324('0x65')]['body']===''){throw new db[(_0x8324('0x7d'))][(_0x8324('0x75'))](_0x8324('0x7e'));}if(_[_0x8324('0x7a')](_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7f')])){throw new db[(_0x8324('0x7d'))][(_0x8324('0x75'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x516b4f);}if(!_[_0x8324('0x80')](_0x516b4f,_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7f')])){throw new db[(_0x8324('0x7d'))][(_0x8324('0x75'))](_0x8324('0x81')+_0x516b4f);}_0x1f552a[_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7f')]]=_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7b')];})[_0x8324('0x35')](function(){return db[_0x8324('0x40')][_0x8324('0x5c')]({'where':{'id':_0x3dbbe9['params']['id']},'include':[{'model':db[_0x8324('0x82')],'as':_0x8324('0x83'),'include':[{'model':db[_0x8324('0x74')],'as':_0x8324('0x84'),'where':_0x1f552a,'limit':0x1,'order':[[_0x8324('0x78'),_0x8324('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0x8324('0x86')}]});})['then'](handleEntityNotFound(_0x2d98e9,null))[_0x8324('0x35')](function(_0x338a4c){if(_0x338a4c&&_0x338a4c['List']){_0x2abdd1[_0x8324('0x87')]=_0x338a4c;_0x2abdd1[_0x8324('0x88')]=_0x338a4c['Applications'];_0x2abdd1[_0x8324('0x89')]=_0x338a4c[_0x8324('0x83')];_0x2abdd1[_0x8324('0x88')]=_[_0x8324('0x8a')](_0x2abdd1[_0x8324('0x88')],[_0x8324('0x8b')],['asc']);if(_0x2abdd1[_0x8324('0x87')][_0x8324('0x86')]){delete _0x2abdd1[_0x8324('0x87')][_0x8324('0x86')];}if(_0x2abdd1[_0x8324('0x87')][_0x8324('0x83')]&&_0x2abdd1[_0x8324('0x87')][_0x8324('0x83')][_0x8324('0x84')][_0x8324('0x48')]){return _0x2abdd1[_0x8324('0x87')][_0x8324('0x83')][_0x8324('0x84')][0x0];}var _0x51f253=_[_0x8324('0x16')](_0x3dbbe9[_0x8324('0x65')],{'firstName':_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7b')],'ListId':_0x338a4c[_0x8324('0x79')]});_0x51f253[_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7f')]]=_0x3dbbe9[_0x8324('0x65')][_0x8324('0x7b')];return db[_0x8324('0x74')]['create'](_0x51f253,{'fields':_0x45b21b,'raw':!![]});}})[_0x8324('0x35')](handleEntityNotFound(_0x2d98e9,null))[_0x8324('0x35')](function(_0x27983b){_0x2abdd1[_0x8324('0x8c')]=_0x27983b;if(_0x27983b){var _0x51c8b1={'ContactId':_0x27983b['id'],'OpenchannelAccountId':_0x3dbbe9[_0x8324('0x57')]['id'],'from':(_0x27983b['firstName']||'')+'\x20'+(_0x27983b[_0x8324('0x8d')]||'')};var _0x6f1174={'OpenchannelAccountId':_0x3dbbe9[_0x8324('0x57')]['id'],'closed':![]};if(_0x3dbbe9[_0x8324('0x65')]['threadId']){_0x6f1174[_0x8324('0x8e')]=_0x3dbbe9['body'][_0x8324('0x8e')];return db['OpenchannelInteraction'][_0x8324('0x5c')]({'where':_0x6f1174})[_0x8324('0x35')](function(_0x1566d3){if(_0x1566d3){return[_0x1566d3,![]];}_0x51c8b1[_0x8324('0x8e')]=_0x3dbbe9['body']['threadId'];_0x51c8b1[_0x8324('0x8f')]=_0x3dbbe9[_0x8324('0x65')][_0x8324('0x8f')];return db[_0x8324('0x90')][_0x8324('0x5d')](_0x51c8b1)[_0x8324('0x35')](function(_0x170466){return[_0x170466,!![]];});});}else{_0x6f1174[_0x8324('0x8e')]=null;}_0x6f1174[_0x8324('0x91')]=_0x27983b['id'];return db['OpenchannelInteraction'][_0x8324('0x5c')]({'where':_0x6f1174})[_0x8324('0x35')](function(_0x416df6){if(_0x416df6){return[_0x416df6,![]];}return db['OpenchannelInteraction'][_0x8324('0x5d')](_0x51c8b1)['then'](function(_0x51996a){return[_0x51996a,!![]];});});}})[_0x8324('0x92')](function(_0x292d40,_0x5bbd4e){if(_0x292d40){_0x4060aa=_0x5bbd4e;if(!_0x5bbd4e){var _0x4004f1={'from':(_0x2abdd1[_0x8324('0x8c')][_0x8324('0x93')]||'')+'\x20'+(_0x2abdd1[_0x8324('0x8c')][_0x8324('0x8d')]||'')};if(_0x3dbbe9[_0x8324('0x65')][_0x8324('0x8e')]&&_0x3dbbe9[_0x8324('0x65')][_0x8324('0x94')]&&_0x3dbbe9[_0x8324('0x65')]['threadId']!=_0x3dbbe9[_0x8324('0x65')][_0x8324('0x94')]){_0x4004f1[_0x8324('0x8e')]=_0x3dbbe9[_0x8324('0x65')][_0x8324('0x94')];}return _0x292d40[_0x8324('0x34')](_0x4004f1);}else{return _0x292d40;}}})[_0x8324('0x35')](function(_0x25eb75){_0x2abdd1[_0x8324('0x95')]=_0x25eb75['get']({'plain':!![]});_0x2abdd1['interaction']['created']=_0x4060aa;if(_0x2abdd1['interaction'][_0x8324('0x96')]){if(_0x2abdd1[_0x8324('0x87')][_0x8324('0x97')]){_0x2abdd1[_0x8324('0x88')][_0x8324('0x98')]({'id':0x0,'priority':_0x2abdd1[_0x8324('0x88')][_0x8324('0x48')]+0x1,'app':'close','appdata':_0x8324('0x99'),'interval':_0x8324('0x9a')});}}return db[_0x8324('0x9b')][_0x8324('0x5d')]({'body':_0x3dbbe9[_0x8324('0x65')]['body'],'OpenchannelAccountId':_0x3dbbe9[_0x8324('0x57')]['id'],'OpenchannelInteractionId':_0x25eb75['id'],'direction':'in','ContactId':_0x2abdd1['contact']['id'],'AttachmentId':_0x3dbbe9['body'][_0x8324('0x9c')]});})['then'](function(_0x1de60d){_0x2abdd1[_0x8324('0x24')]=_0x1de60d;if(_0x2abdd1[_0x8324('0x95')]['UserId']){return db[_0x8324('0x9d')][_0x8324('0x5c')]({'attributes':['id','name'],'where':{'id':_0x2abdd1[_0x8324('0x95')][_0x8324('0x9e')]}})['then'](function(_0x470f1f){if(_0x470f1f){_0x2abdd1[_0x8324('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8324('0x9f'),'appdata':_0x470f1f['name']+','+(_0x2abdd1['account'][_0x8324('0xa0')]||0xa),'interval':'*,*,*,*'});_0x2abdd1[_0x8324('0xa1')]=![];}return respondWithRpcPromise(_0x8324('0xa2'),_0x8324('0xa3'),_0x2abdd1);});}return respondWithRpcPromise(_0x8324('0xa2'),_0x8324('0xa3'),_0x2abdd1);})[_0x8324('0x35')](function(_0x5aa7e1){respondWithRpcPromise(_0x8324('0xa4'),_0x8324('0xa4'),{'event':_0x8324('0x73'),'message':_0x5aa7e1},client9002);return _0x5aa7e1;})[_0x8324('0x35')](respondWithResult(_0x2d98e9,null))[_0x8324('0x27')](handleError(_0x2d98e9,null));};exports[_0x8324('0xa5')]=function(_0x20d3ef,_0x36bd03){var _0x3c42c3=_0x20d3ef[_0x8324('0x57')]['id'];var _0x1f326e=_0x20d3ef[_0x8324('0x65')];var _0x23d9df=0xc8;var _0x4ade3c=null;return db[_0x8324('0xa6')][_0x8324('0xa7')]({'isolationLevel':db[_0x8324('0xa6')]['Transaction'][_0x8324('0xa8')]['READ_COMMITTED']},function(_0x7201cc){return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x3c42c3},'transaction':_0x7201cc})[_0x8324('0x35')](function(_0x4de8f1){if(_0x4de8f1){return db['OpenchannelApplication'][_0x8324('0x36')]({'where':{'OpenchannelAccountId':_0x3c42c3},'transaction':_0x7201cc})['then'](function(){var _0x2f4b3c=_[_0x8324('0x3f')](_0x1f326e,function(_0x5491e5){_0x5491e5[_0x8324('0x68')]=_0x3c42c3;return _0x5491e5;});return db[_0x8324('0xa9')][_0x8324('0xaa')](_0x2f4b3c,{'transaction':_0x7201cc});});}else{_0x23d9df=0x194;_0x4ade3c=[];}});})[_0x8324('0x35')](function(){if(_0x23d9df!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3c42c3},'order':'priority'})['then'](function(_0x1b9abe){_0x4ade3c=_0x1b9abe;});}})[_0x8324('0x27')](function(_0x17fc92){_0x23d9df=0x1f4;logger[_0x8324('0x22')](_0x17fc92[_0x8324('0x3a')]);if(_0x17fc92['name']){delete _0x17fc92[_0x8324('0x3b')];}_0x4ade3c=_0x17fc92;})[_0x8324('0xab')](function(){if(_0x4ade3c===null){_0x36bd03[_0x8324('0x28')](_0x23d9df);}else{if(_0x23d9df===0x1f4){_0x36bd03['status'](_0x23d9df)[_0x8324('0x3c')](_0x4ade3c);}else{_0x36bd03[_0x8324('0x29')](_0x23d9df)['json'](_0x4ade3c);}}});};exports[_0x8324('0xac')]=function(_0x47c0f2,_0x51bdc9,_0x32488d){var _0x35e3d6={};var _0x3f472c={};var _0x490fa5;var _0x31efba;return db[_0x8324('0x40')]['findOne']({'where':{'id':_0x47c0f2[_0x8324('0x57')]['id']}})['then'](handleEntityNotFound(_0x51bdc9,null))[_0x8324('0x35')](function(_0xd17505){if(_0xd17505){_0x490fa5=_0xd17505;_0x3f472c[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0xa9')]['rawAttributes']);_0x3f472c[_0x8324('0x44')]=_['keys'](_0x47c0f2[_0x8324('0x44')]);_0x3f472c[_0x8324('0x4e')]=_[_0x8324('0x45')](_0x3f472c[_0x8324('0x43')],_0x3f472c[_0x8324('0x44')]);_0x35e3d6[_0x8324('0x46')]=_[_0x8324('0x45')](_0x3f472c[_0x8324('0x43')],qs['fields'](_0x47c0f2[_0x8324('0x44')][_0x8324('0x47')]));_0x35e3d6['attributes']=_0x35e3d6[_0x8324('0x46')][_0x8324('0x48')]?_0x35e3d6[_0x8324('0x46')]:_0x3f472c[_0x8324('0x43')];_0x35e3d6[_0x8324('0x4b')]=qs[_0x8324('0x4c')](_0x47c0f2['query'][_0x8324('0x4c')]);_0x35e3d6[_0x8324('0x4d')]=qs[_0x8324('0x4e')](_['pick'](_0x47c0f2[_0x8324('0x44')],_0x3f472c['filters']));if(_0x47c0f2[_0x8324('0x44')]['filter']){_0x35e3d6[_0x8324('0x4d')]=_[_0x8324('0x51')](_0x35e3d6['where'],{'$or':_[_0x8324('0x3f')](_0x35e3d6[_0x8324('0x46')],function(_0x490b90){var _0x21c09b={};_0x21c09b[_0x490b90]={'$like':'%'+_0x47c0f2['query']['filter']+'%'};return _0x21c09b;})});}_0x35e3d6=_[_0x8324('0x51')]({},_0x35e3d6,_0x47c0f2[_0x8324('0x5b')]);return _0x490fa5[_0x8324('0xac')](_0x35e3d6);}})['then'](function(_0x148622){if(_0x148622){_0x31efba=_0x148622[_0x8324('0x48')];if(!_0x47c0f2[_0x8324('0x44')]['hasOwnProperty'](_0x8324('0x4a'))){_0x35e3d6[_0x8324('0x2e')]=qs[_0x8324('0x2e')](_0x47c0f2[_0x8324('0x44')][_0x8324('0x2e')]);_0x35e3d6['offset']=qs[_0x8324('0x2b')](_0x47c0f2[_0x8324('0x44')][_0x8324('0x2b')]);}return _0x490fa5[_0x8324('0xac')](_0x35e3d6);}})['then'](function(_0x2b828c){if(_0x2b828c){return _0x2b828c?{'count':_0x31efba,'rows':_0x2b828c}:null;}})['then'](respondWithResult(_0x51bdc9,null))[_0x8324('0x27')](handleError(_0x51bdc9,null));};exports['getInteractions']=function(_0x1c6900,_0x42b1c3,_0x260503){var _0x3c5175={'raw':![],'where':{}};var _0x2c8ab5={};var _0x1f6a04={'count':0x0,'rows':[]};return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x1c6900[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x42b1c3,null))['then'](function(_0x1db061){if(_0x1db061){_0x2c8ab5[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0x90')][_0x8324('0x6c')]);_0x2c8ab5['query']=_[_0x8324('0x59')](_0x1c6900[_0x8324('0x44')]);_0x2c8ab5['filters']=_[_0x8324('0x45')](_0x2c8ab5[_0x8324('0x43')],_0x2c8ab5[_0x8324('0x44')]);_0x3c5175['attributes']=_[_0x8324('0x45')](_0x2c8ab5[_0x8324('0x43')],qs[_0x8324('0x47')](_0x1c6900[_0x8324('0x44')]['fields']));_0x3c5175[_0x8324('0x46')]=_0x3c5175['attributes'][_0x8324('0x48')]?_0x3c5175[_0x8324('0x46')]:_0x2c8ab5['model'];if(!_0x1c6900[_0x8324('0x44')][_0x8324('0x49')](_0x8324('0x4a'))){_0x3c5175[_0x8324('0x2e')]=qs['limit'](_0x1c6900[_0x8324('0x44')][_0x8324('0x2e')]);_0x3c5175[_0x8324('0x2b')]=qs[_0x8324('0x2b')](_0x1c6900[_0x8324('0x44')]['offset']);}_0x3c5175['order']=qs[_0x8324('0x4c')](_0x1c6900[_0x8324('0x44')]['sort']);_0x3c5175[_0x8324('0x4d')]=qs['filters'](_[_0x8324('0x4f')](_0x1c6900[_0x8324('0x44')],_0x2c8ab5[_0x8324('0x4e')]));_0x3c5175[_0x8324('0x4d')][_0x8324('0x68')]=_0x1db061['id'];if(_0x1c6900[_0x8324('0x44')][_0x8324('0x50')]){_0x3c5175[_0x8324('0x4d')]=_['merge'](_0x3c5175['where'],{'$or':_[_0x8324('0x3f')](_0x3c5175[_0x8324('0x46')],function(_0x53c9e2){var _0x5e90a7={};_0x5e90a7[_0x53c9e2]={'$like':'%'+_0x1c6900[_0x8324('0x44')]['filter']+'%'};return _0x5e90a7;})});}_0x3c5175=_[_0x8324('0x51')]({},_0x3c5175,_0x1c6900[_0x8324('0x5b')]);return db[_0x8324('0x90')][_0x8324('0x2d')]({'where':_0x3c5175[_0x8324('0x4d')]})[_0x8324('0x35')](function(_0x5d843a){_0x1f6a04['count']=_0x5d843a;if(_0x1c6900['query']['includeAll']){_0x3c5175[_0x8324('0x5a')]=[{'model':db['CmContact'],'as':_0x8324('0xad'),'required':![]},{'model':db['User'],'as':_0x8324('0xae'),'attributes':[_0x8324('0x3b'),_0x8324('0xaf'),_0x8324('0xb0')],'required':![]},{'model':db[_0x8324('0xb1')],'as':'Tags','attributes':['id','name',_0x8324('0xb2')],'where':_0x1c6900[_0x8324('0x44')][_0x8324('0xb3')]?{'id':_0x1c6900[_0x8324('0x44')][_0x8324('0xb3')]}:undefined,'required':_0x1c6900[_0x8324('0x44')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x8324('0x54')](_0x3c5175);})[_0x8324('0x35')](function(_0x2e7e77){_0x1f6a04[_0x8324('0x55')]=_0x2e7e77;return _0x1f6a04;});}})[_0x8324('0x35')](respondWithFilteredResult(_0x42b1c3,_0x3c5175))[_0x8324('0x27')](handleError(_0x42b1c3,null));};exports['addAgents']=function(_0x35f571,_0x36763f,_0xf36bc1){return db[_0x8324('0x40')]['find']({'where':{'id':_0x35f571[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x36763f,null))[_0x8324('0x35')](function(_0x346c46){if(_0x346c46){return _0x346c46[_0x8324('0xb4')](_0x35f571[_0x8324('0x65')][_0x8324('0x6e')],_[_0x8324('0xb5')](_0x35f571[_0x8324('0x65')],['ids','id'])||{})[_0x8324('0x92')](function(_0x265907){for(var _0xe90fd1=0x0;_0xe90fd1<_0x35f571[_0x8324('0x65')][_0x8324('0x6e')][_0x8324('0x48')];_0xe90fd1+=0x1){socket[_0x8324('0xb6')](_0x8324('0xb7'),{'UserId':Number(_0x35f571[_0x8324('0x65')][_0x8324('0x6e')][_0xe90fd1]),'OpenchannelAccountId':Number(_0x35f571[_0x8324('0x57')]['id'])});}return _0x265907;});}})[_0x8324('0x35')](respondWithResult(_0x36763f,null))[_0x8324('0x27')](handleError(_0x36763f,null));};exports[_0x8324('0xb8')]=function(_0x4a1ba5,_0x469b27,_0x2ccf10){return db[_0x8324('0x40')]['find']({'where':{'id':_0x4a1ba5[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x469b27,null))[_0x8324('0x35')](function(_0x3b2426){if(_0x3b2426){return _0x3b2426[_0x8324('0xb8')](_0x4a1ba5[_0x8324('0x44')][_0x8324('0x6e')])[_0x8324('0x35')](function(){if(_[_0x8324('0xb9')](_0x4a1ba5[_0x8324('0x44')]['ids'])){for(var _0x4323a3=0x0;_0x4323a3<_0x4a1ba5['query'][_0x8324('0x6e')]['length'];_0x4323a3+=0x1){socket['emit'](_0x8324('0xba'),{'UserId':Number(_0x4a1ba5[_0x8324('0x44')][_0x8324('0x6e')][_0x4323a3]),'OpenchannelAccountId':Number(_0x4a1ba5[_0x8324('0x57')]['id'])});}}else{socket['emit'](_0x8324('0xba'),{'UserId':Number(_0x4a1ba5[_0x8324('0x44')][_0x8324('0x6e')]),'OpenchannelAccountId':Number(_0x4a1ba5[_0x8324('0x57')]['id'])});}});}})[_0x8324('0x35')](respondWithStatusCode(_0x469b27,null))[_0x8324('0x27')](handleError(_0x469b27,null));};exports['getAgents']=function(_0x154d08,_0x12d296,_0x23f9f7){var _0x302698={};var _0x56459a={};var _0x557ba2;var _0x5ac153;return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x154d08[_0x8324('0x57')]['id']}})['then'](handleEntityNotFound(_0x12d296,null))[_0x8324('0x35')](function(_0x3c0818){if(_0x3c0818){_0x557ba2=_0x3c0818;_0x56459a[_0x8324('0x43')]=_[_0x8324('0x59')](db[_0x8324('0x9d')]['rawAttributes']);_0x56459a['query']=_[_0x8324('0x59')](_0x154d08['query']);_0x56459a[_0x8324('0x4e')]=_[_0x8324('0x45')](_0x56459a[_0x8324('0x43')],_0x56459a[_0x8324('0x44')]);_0x302698['attributes']=_[_0x8324('0x45')](_0x56459a['model'],qs[_0x8324('0x47')](_0x154d08[_0x8324('0x44')]['fields']));_0x302698[_0x8324('0x46')]=_0x302698['attributes'][_0x8324('0x48')]?_0x302698[_0x8324('0x46')]:_0x56459a[_0x8324('0x43')];_0x302698[_0x8324('0x4b')]=qs[_0x8324('0x4c')](_0x154d08[_0x8324('0x44')]['sort']);_0x302698[_0x8324('0x4d')]=qs[_0x8324('0x4e')](_[_0x8324('0x4f')](_0x154d08[_0x8324('0x44')],_0x56459a['filters']));if(_0x154d08['query'][_0x8324('0x50')]){_0x302698[_0x8324('0x4d')]=_[_0x8324('0x51')](_0x302698[_0x8324('0x4d')],{'$or':_[_0x8324('0x3f')](_0x302698['attributes'],function(_0x944d17){var _0x2954ae={};_0x2954ae[_0x944d17]={'$like':'%'+_0x154d08[_0x8324('0x44')][_0x8324('0x50')]+'%'};return _0x2954ae;})});}_0x302698=_[_0x8324('0x51')]({},_0x302698,_0x154d08['options']);return _0x557ba2[_0x8324('0xbb')](_0x302698);}})[_0x8324('0x35')](function(_0x257c28){if(_0x257c28){_0x5ac153=_0x257c28[_0x8324('0x48')];if(!_0x154d08[_0x8324('0x44')][_0x8324('0x49')](_0x8324('0x4a'))){_0x302698[_0x8324('0x2e')]=qs[_0x8324('0x2e')](_0x154d08[_0x8324('0x44')][_0x8324('0x2e')]);_0x302698[_0x8324('0x2b')]=qs[_0x8324('0x2b')](_0x154d08[_0x8324('0x44')][_0x8324('0x2b')]);}return _0x557ba2[_0x8324('0xbb')](_0x302698);}})[_0x8324('0x35')](function(_0x5d547b){if(_0x5d547b){return _0x5d547b?{'count':_0x5ac153,'rows':_0x5d547b}:null;}})[_0x8324('0x35')](respondWithResult(_0x12d296,null))[_0x8324('0x27')](handleError(_0x12d296,null));};exports[_0x8324('0x3c')]=function(_0x39fd69,_0x46c8ff,_0x490ff2){var _0xe3dccb,_0x25e541,_0x5e2ff4;if(_['isNil'](_0x39fd69['body']['body'])||_0x39fd69[_0x8324('0x65')]['body']===''){throw new db['Sequelize'][(_0x8324('0x75'))](_0x8324('0x7e'));}if(_[_0x8324('0x7a')](_0x39fd69[_0x8324('0x65')]['to'])){}_0xe3dccb=_0x39fd69[_0x8324('0x65')]['to'];return db[_0x8324('0x40')][_0x8324('0x6b')]({'where':{'id':_0x39fd69[_0x8324('0x57')]['id']}})[_0x8324('0x35')](handleEntityNotFound(_0x46c8ff,null))['then'](function(_0x5eac0e){if(_0x5eac0e){return db[_0x8324('0x40')][_0x8324('0x5c')]({'where':{'id':_0x5eac0e['id']},'include':[{'model':db[_0x8324('0x82')],'as':_0x8324('0x83'),'include':[{'model':db[_0x8324('0x74')],'as':_0x8324('0x84'),'where':{[_0x5eac0e[_0x8324('0x7f')]]:_0xe3dccb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8324('0x35')](handleEntityNotFound(_0x46c8ff,null))['then'](function(_0x12a3c4){if(_0x12a3c4&&_0x12a3c4[_0x8324('0x83')]){_0x25e541=_0x12a3c4['get']({'plain':!![]});if(_0x25e541['List']&&_0x25e541['List']['Contacts'][_0x8324('0x48')]){return _0x25e541[_0x8324('0x83')]['Contacts'][0x0];}return db['CmContact'][_0x8324('0x5d')](_[_0x8324('0x16')](_0x39fd69['body'],{'firstName':_0xe3dccb,[_0x12a3c4['mapKey']]:_0xe3dccb,'phone':_0xe3dccb,'ListId':_0x25e541[_0x8324('0x79')]}));}})[_0x8324('0x35')](handleEntityNotFound(_0x46c8ff,null))[_0x8324('0x35')](function(_0xcbb91f){if(_0xcbb91f){_0x5e2ff4=_0xcbb91f;return db[_0x8324('0x90')][_0x8324('0x5c')]({'where':{'ContactId':_0x5e2ff4['id'],'closed':![],'OpenchannelAccountId':_0x25e541['id']}})['then'](function(_0x2fca09){if(_0x2fca09){return[_0x2fca09,![]];}return db[_0x8324('0x90')][_0x8324('0x5d')]({'UserId':_0x39fd69['user']['id'],'ContactId':_0x5e2ff4['id'],'OpenchannelAccountId':_0x25e541['id'],'lastMsgDirection':_0x8324('0xbc'),'firstMsgDirection':_0x8324('0xbc'),'Messages':[_[_0x8324('0x51')](_0x39fd69['body'],{'read':![],'body':_0x39fd69['body'][_0x8324('0x65')],'OpenchannelAccountId':_0x25e541['id'],'UserId':_0x39fd69['user']['id'],'ContactId':_0x5e2ff4['id']})]},{'include':[{'model':db[_0x8324('0x9b')],'as':_0x8324('0xbd')}]})[_0x8324('0x35')](function(_0x34156d){return[_0x34156d,!![]];});});}})[_0x8324('0x92')](function(_0x529a8b,_0x3fb450){if(_0x3fb450){return _0x529a8b;}return db[_0x8324('0x9b')][_0x8324('0x5d')](_[_0x8324('0x51')](_0x39fd69[_0x8324('0x65')],{'read':![],'body':_0x39fd69[_0x8324('0x65')]['body'],'OpenchannelAccountId':_0x25e541['id'],'OpenchannelInteractionId':_0x529a8b['id'],'UserId':_0x39fd69[_0x8324('0x5e')]['id'],'ContactId':_0x5e2ff4['id']}))[_0x8324('0x35')](function(_0x31c79b){_0x529a8b[_0x8324('0xbe')]['Messages']=[];_0x529a8b[_0x8324('0xbe')][_0x8324('0xbd')]['push'](_0x31c79b['dataValues']);return _0x529a8b;});});}})['then'](respondWithResult(_0x46c8ff,null))['catch'](handleError(_0x46c8ff,null));}; \ No newline at end of file +var _0x8d37=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','request','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelAccounts','stack','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','name','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','OpenchannelAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','mapKey','includes','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','from','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','forcedOwnership','Start','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','DESC','out','OpenchannelMessage','Messages','dataValues','eml-format'];(function(_0x23e690,_0x1ed185){var _0xb8768c=function(_0x51ffeb){while(--_0x51ffeb){_0x23e690['push'](_0x23e690['shift']());}};_0xb8768c(++_0x1ed185);}(_0x8d37,0xbc));var _0x78d3=function(_0x1cfe5d,_0x3aa762){_0x1cfe5d=_0x1cfe5d-0x0;var _0x496e7d=_0x8d37[_0x1cfe5d];return _0x496e7d;};'use strict';var emlformat=require(_0x78d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78d3('0x1'));var jsonpatch=require(_0x78d3('0x2'));var rp=require(_0x78d3('0x3'));var moment=require(_0x78d3('0x4'));var BPromise=require(_0x78d3('0x5'));var Mustache=require(_0x78d3('0x6'));var util=require(_0x78d3('0x7'));var path=require('path');var sox=require(_0x78d3('0x8'));var csv=require(_0x78d3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78d3('0xa'));var _=require(_0x78d3('0xb'));var squel=require('squel');var crypto=require(_0x78d3('0xc'));var jsforce=require(_0x78d3('0xd'));var deskjs=require(_0x78d3('0xe'));var toCsv=require(_0x78d3('0x9'));var querystring=require(_0x78d3('0xf'));var Papa=require(_0x78d3('0x10'));var Redis=require('ioredis');var authService=require(_0x78d3('0x11'));var qs=require(_0x78d3('0x12'));var as=require(_0x78d3('0x13'));var hardwareService=require(_0x78d3('0x14'));var logger=require(_0x78d3('0x15'))('api');var utils=require(_0x78d3('0x16'));var config=require(_0x78d3('0x17'));var licenseUtil=require(_0x78d3('0x18'));var db=require(_0x78d3('0x19'))['db'];config[_0x78d3('0x1a')]=_[_0x78d3('0x1b')](config[_0x78d3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x78d3('0x1c'))(new Redis(config[_0x78d3('0x1a')]));require(_0x78d3('0x1d'))['register'](socket);var jayson=require(_0x78d3('0x1e'));var client=jayson['client'][_0x78d3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x78d3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5aa7c9,_0xf0d7fa,_0x37aec9,_0x58a812){return new BPromise(function(_0x55608f,_0x427a87){var _0x9fedb1=_0x58a812||client;return _0x9fedb1[_0x78d3('0x20')](_0x5aa7c9,_0x37aec9)['then'](function(_0x55e489){logger[_0x78d3('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0xf0d7fa,'request\x20sent');logger['debug'](_0x78d3('0x22'),_0xf0d7fa,_0x78d3('0x23'),JSON[_0x78d3('0x24')](_0x55e489));if(_0x55e489['error']){if(_0x55e489[_0x78d3('0x25')][_0x78d3('0x26')]===0x1f4){logger['error'](_0x78d3('0x27'),_0xf0d7fa,_0x55e489[_0x78d3('0x25')][_0x78d3('0x28')]);return _0x427a87(_0x55e489[_0x78d3('0x25')][_0x78d3('0x28')]);}logger[_0x78d3('0x25')](_0x78d3('0x27'),_0xf0d7fa,_0x55e489[_0x78d3('0x25')][_0x78d3('0x28')]);return _0x55608f(_0x55e489[_0x78d3('0x25')]['message']);}else{logger[_0x78d3('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0xf0d7fa,_0x78d3('0x23'));_0x55608f(_0x55e489[_0x78d3('0x29')]['message']);}})['catch'](function(_0x51b236){logger[_0x78d3('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0xf0d7fa,_0x51b236);_0x427a87(_0x51b236);});});}function respondWithStatusCode(_0x4cdcf1,_0x1aa479){_0x1aa479=_0x1aa479||0xcc;return function(_0x361803){if(_0x361803){return _0x4cdcf1[_0x78d3('0x2a')](_0x1aa479);}return _0x4cdcf1[_0x78d3('0x2b')](_0x1aa479)[_0x78d3('0x2c')]();};}function respondWithResult(_0x5c0507,_0xfa0a51){_0xfa0a51=_0xfa0a51||0xc8;return function(_0x2f442f){if(_0x2f442f){return _0x5c0507[_0x78d3('0x2b')](_0xfa0a51)[_0x78d3('0x2d')](_0x2f442f);}};}function respondWithFilteredResult(_0x18dcd4,_0x4300ea){return function(_0x291fa8){if(_0x291fa8){var _0x3aa051=typeof _0x4300ea[_0x78d3('0x2e')]===_0x78d3('0x2f')&&typeof _0x4300ea[_0x78d3('0x30')]===_0x78d3('0x2f');var _0x29f3cc=_0x291fa8[_0x78d3('0x31')];var _0x5314c0=_0x3aa051?0x0:_0x4300ea[_0x78d3('0x2e')];var _0x1bf593=_0x3aa051?_0x291fa8[_0x78d3('0x31')]:_0x4300ea[_0x78d3('0x2e')]+_0x4300ea[_0x78d3('0x30')];var _0x663f58;if(_0x1bf593>=_0x29f3cc){_0x1bf593=_0x29f3cc;_0x663f58=0xc8;}else{_0x663f58=0xce;}_0x18dcd4[_0x78d3('0x2b')](_0x663f58);return _0x18dcd4['set'](_0x78d3('0x32'),_0x5314c0+'-'+_0x1bf593+'/'+_0x29f3cc)[_0x78d3('0x2d')](_0x291fa8);}return null;};}function patchUpdates(_0x4c7170){return function(_0x5e219c){try{jsonpatch[_0x78d3('0x33')](_0x5e219c,_0x4c7170,!![]);}catch(_0x4b457a){return BPromise[_0x78d3('0x34')](_0x4b457a);}return _0x5e219c[_0x78d3('0x35')]();};}function saveUpdates(_0xd5d02f,_0x13a162){return function(_0x586754){if(_0x586754){return _0x586754[_0x78d3('0x36')](_0xd5d02f)['then'](function(_0x1e4611){return _0x1e4611;});}return null;};}function removeEntity(_0x565c18,_0x57ca0e){return function(_0x1a1a45){if(_0x1a1a45){return _0x1a1a45[_0x78d3('0x37')]()[_0x78d3('0x38')](function(){var _0x54297a=_0x1a1a45[_0x78d3('0x39')]({'plain':!![]});var _0x57eb33=_0x78d3('0x3a');return db['UserProfileResource'][_0x78d3('0x37')]({'where':{'type':_0x57eb33,'resourceId':_0x54297a['id']}})[_0x78d3('0x38')](function(){return _0x1a1a45;});})[_0x78d3('0x38')](function(){_0x565c18['status'](0xcc)[_0x78d3('0x2c')]();});}};}function handleEntityNotFound(_0x88ae51,_0x2b0ce1){return function(_0x2fd535){if(!_0x2fd535){_0x88ae51[_0x78d3('0x2a')](0x194);}return _0x2fd535;};}function handleError(_0x3c78c9,_0xd77ee6){_0xd77ee6=_0xd77ee6||0x1f4;return function(_0x12b58){logger[_0x78d3('0x25')](_0x12b58[_0x78d3('0x3b')]);if(_0x12b58['name']){delete _0x12b58['name'];}_0x3c78c9[_0x78d3('0x2b')](_0xd77ee6)[_0x78d3('0x3c')](_0x12b58);};}exports[_0x78d3('0x3d')]=function(_0x14aff0,_0x2d8d88){var _0x4d2643={'include':[{'model':db[_0x78d3('0x3e')],'as':_0x78d3('0x3f')}]},_0x1e2015={},_0x47174c={'count':0x0,'rows':[]};var _0x22afab=_[_0x78d3('0x40')](db['OpenchannelAccount']['rawAttributes'],function(_0x11afbc){return{'name':_0x11afbc[_0x78d3('0x41')],'type':_0x11afbc[_0x78d3('0x42')][_0x78d3('0x43')]};});_0x1e2015[_0x78d3('0x44')]=_[_0x78d3('0x40')](_0x22afab,_0x78d3('0x45'));_0x1e2015['query']=_[_0x78d3('0x46')](_0x14aff0['query']);_0x1e2015['filters']=_[_0x78d3('0x47')](_0x1e2015[_0x78d3('0x44')],_0x1e2015[_0x78d3('0x48')]);_0x4d2643[_0x78d3('0x49')]=_['intersection'](_0x1e2015[_0x78d3('0x44')],qs[_0x78d3('0x4a')](_0x14aff0['query']['fields']));_0x4d2643['attributes']=_0x4d2643[_0x78d3('0x49')]['length']?_0x4d2643[_0x78d3('0x49')]:_0x1e2015[_0x78d3('0x44')];if(!_0x14aff0[_0x78d3('0x48')][_0x78d3('0x4b')](_0x78d3('0x4c'))){_0x4d2643[_0x78d3('0x30')]=qs[_0x78d3('0x30')](_0x14aff0[_0x78d3('0x48')][_0x78d3('0x30')]);_0x4d2643[_0x78d3('0x2e')]=qs['offset'](_0x14aff0[_0x78d3('0x48')][_0x78d3('0x2e')]);}_0x4d2643[_0x78d3('0x4d')]=qs[_0x78d3('0x4e')](_0x14aff0[_0x78d3('0x48')][_0x78d3('0x4e')]);_0x4d2643[_0x78d3('0x4f')]=qs['filters'](_[_0x78d3('0x50')](_0x14aff0[_0x78d3('0x48')],_0x1e2015[_0x78d3('0x51')]),_0x22afab);if(_0x14aff0[_0x78d3('0x48')]['filter']){_0x4d2643[_0x78d3('0x4f')]=_['merge'](_0x4d2643[_0x78d3('0x4f')],{'$or':_[_0x78d3('0x40')](_0x22afab,function(_0x359826){if(_0x359826['type']!==_0x78d3('0x52')){var _0x568aa7={};_0x568aa7[_0x359826[_0x78d3('0x45')]]={'$like':'%'+_0x14aff0[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0x568aa7;}})});}_0x4d2643=_[_0x78d3('0x54')]({},_0x4d2643,_0x14aff0['options']);var _0x3537c9={'where':_0x4d2643[_0x78d3('0x4f')]};return db[_0x78d3('0x55')][_0x78d3('0x31')](_0x3537c9)[_0x78d3('0x38')](function(_0x498fe6){_0x47174c[_0x78d3('0x31')]=_0x498fe6;if(_0x14aff0[_0x78d3('0x48')][_0x78d3('0x56')]){_0x4d2643[_0x78d3('0x57')]=[{'all':!![]}];}return db[_0x78d3('0x55')][_0x78d3('0x58')](_0x4d2643);})[_0x78d3('0x38')](function(_0x33cbca){_0x47174c[_0x78d3('0x59')]=_0x33cbca;return _0x47174c;})[_0x78d3('0x38')](respondWithFilteredResult(_0x2d8d88,_0x4d2643))[_0x78d3('0x5a')](handleError(_0x2d8d88,null));};exports[_0x78d3('0x5b')]=function(_0x5a1f02,_0x3eb210){var _0x2d77a4={'raw':![],'where':{'id':_0x5a1f02[_0x78d3('0x5c')]['id']},'include':[{'model':db[_0x78d3('0x3e')],'as':_0x78d3('0x3f')}]},_0x331589={};_0x331589[_0x78d3('0x44')]=_['keys'](db[_0x78d3('0x55')][_0x78d3('0x5d')]);_0x331589[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0x5a1f02[_0x78d3('0x48')]);_0x331589[_0x78d3('0x51')]=_['intersection'](_0x331589[_0x78d3('0x44')],_0x331589[_0x78d3('0x48')]);_0x2d77a4['attributes']=_['intersection'](_0x331589[_0x78d3('0x44')],qs['fields'](_0x5a1f02[_0x78d3('0x48')][_0x78d3('0x4a')]));_0x2d77a4[_0x78d3('0x49')]=_0x2d77a4['attributes'][_0x78d3('0x5e')]?_0x2d77a4[_0x78d3('0x49')]:_0x331589[_0x78d3('0x44')];if(_0x5a1f02[_0x78d3('0x48')][_0x78d3('0x56')]){_0x2d77a4[_0x78d3('0x57')]=[{'all':!![]}];}_0x2d77a4=_['merge']({},_0x2d77a4,_0x5a1f02[_0x78d3('0x5f')]);return db[_0x78d3('0x55')]['find'](_0x2d77a4)['then'](handleEntityNotFound(_0x3eb210,null))[_0x78d3('0x38')](respondWithResult(_0x3eb210,null))[_0x78d3('0x5a')](handleError(_0x3eb210,null));};exports[_0x78d3('0x60')]=function(_0xd5f772,_0x55eada){return db[_0x78d3('0x55')][_0x78d3('0x60')](_0xd5f772[_0x78d3('0x61')],{})[_0x78d3('0x38')](function(_0x398fbe){var _0x4b8843=_0xd5f772[_0x78d3('0x62')][_0x78d3('0x39')]({'plain':!![]});if(!_0x4b8843)throw new Error(_0x78d3('0x63'));if(_0x4b8843[_0x78d3('0x64')]===_0x78d3('0x62')){var _0x175f13=_0x398fbe[_0x78d3('0x39')]({'plain':!![]});var _0x464644=_0x78d3('0x3a');return db[_0x78d3('0x65')]['find']({'where':{'name':_0x464644,'userProfileId':_0x4b8843[_0x78d3('0x66')]},'raw':!![]})[_0x78d3('0x38')](function(_0x172588){if(_0x172588&&_0x172588[_0x78d3('0x67')]===0x0){return db[_0x78d3('0x68')][_0x78d3('0x60')]({'name':_0x175f13[_0x78d3('0x45')],'resourceId':_0x175f13['id'],'type':_0x172588['name'],'sectionId':_0x172588['id']},{})['then'](function(){return _0x398fbe;});}else{return _0x398fbe;}})[_0x78d3('0x5a')](function(_0x3a7744){logger[_0x78d3('0x25')](_0x78d3('0x69'),_0x3a7744);throw _0x3a7744;});}return _0x398fbe;})[_0x78d3('0x38')](respondWithResult(_0x55eada,0xc9))[_0x78d3('0x5a')](handleError(_0x55eada,null));};exports[_0x78d3('0x36')]=function(_0x90b62,_0x32a9c1){if(_0x90b62[_0x78d3('0x61')]['id']){delete _0x90b62[_0x78d3('0x61')]['id'];}return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x90b62[_0x78d3('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x78d3('0x3f')}]})[_0x78d3('0x38')](handleEntityNotFound(_0x32a9c1,null))[_0x78d3('0x38')](saveUpdates(_0x90b62[_0x78d3('0x61')],null))[_0x78d3('0x38')](respondWithResult(_0x32a9c1,null))[_0x78d3('0x5a')](handleError(_0x32a9c1,null));};exports[_0x78d3('0x37')]=function(_0x42b201,_0xe08cd5){return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x42b201[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0xe08cd5,null))[_0x78d3('0x38')](removeEntity(_0xe08cd5,null))['catch'](handleError(_0xe08cd5,null));};exports[_0x78d3('0x6b')]=function(_0x23a179,_0xb7a828){return db[_0x78d3('0x55')][_0x78d3('0x6b')]()[_0x78d3('0x38')](respondWithResult(_0xb7a828,null))[_0x78d3('0x5a')](handleError(_0xb7a828,null));};exports['addDisposition']=function(_0x4c1113,_0x231543,_0x3fed88){if(_0x4c1113[_0x78d3('0x61')]['id']){delete _0x4c1113['body']['id'];}return db['OpenchannelAccount'][_0x78d3('0x6a')]({'where':{'id':_0x4c1113[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x231543,null))['then'](function(_0x4f6de9){if(_0x4f6de9){_0x4c1113[_0x78d3('0x61')][_0x78d3('0x6c')]=_0x4f6de9['id'];return db[_0x78d3('0x6d')]['create'](_0x4c1113[_0x78d3('0x61')]);}})[_0x78d3('0x38')](respondWithResult(_0x231543,null))[_0x78d3('0x5a')](handleError(_0x231543,null));};exports['getDispositions']=function(_0xb803ea,_0x3bbb42,_0x594cd2){var _0x3b6638={'raw':![],'where':{}};var _0x1637eb={};var _0x385dbc={'count':0x0,'rows':[]};return db[_0x78d3('0x55')][_0x78d3('0x6e')]({'where':{'id':_0xb803ea[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x3bbb42,null))[_0x78d3('0x38')](function(_0x28be16){if(_0x28be16){_0x1637eb['model']=_[_0x78d3('0x46')](db[_0x78d3('0x6d')]['rawAttributes']);_0x1637eb[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0xb803ea[_0x78d3('0x48')]);_0x1637eb[_0x78d3('0x51')]=_[_0x78d3('0x47')](_0x1637eb[_0x78d3('0x44')],_0x1637eb[_0x78d3('0x48')]);_0x3b6638[_0x78d3('0x49')]=_[_0x78d3('0x47')](_0x1637eb[_0x78d3('0x44')],qs[_0x78d3('0x4a')](_0xb803ea['query']['fields']));_0x3b6638[_0x78d3('0x49')]=_0x3b6638[_0x78d3('0x49')]['length']?_0x3b6638[_0x78d3('0x49')]:_0x1637eb[_0x78d3('0x44')];if(!_0xb803ea[_0x78d3('0x48')][_0x78d3('0x4b')](_0x78d3('0x4c'))){_0x3b6638[_0x78d3('0x30')]=qs[_0x78d3('0x30')](_0xb803ea['query'][_0x78d3('0x30')]);_0x3b6638[_0x78d3('0x2e')]=qs[_0x78d3('0x2e')](_0xb803ea[_0x78d3('0x48')][_0x78d3('0x2e')]);}_0x3b6638['order']=qs['sort'](_0xb803ea['query'][_0x78d3('0x4e')]);_0x3b6638[_0x78d3('0x4f')]=qs[_0x78d3('0x51')](_['pick'](_0xb803ea['query'],_0x1637eb[_0x78d3('0x51')]));_0x3b6638[_0x78d3('0x4f')][_0x78d3('0x6c')]=_0x28be16['id'];if(_0xb803ea[_0x78d3('0x48')][_0x78d3('0x53')]){_0x3b6638['where']=_['merge'](_0x3b6638[_0x78d3('0x4f')],{'$or':_[_0x78d3('0x40')](_0x3b6638[_0x78d3('0x49')],function(_0x8ea725){var _0xa3e56a={};_0xa3e56a[_0x8ea725]={'$like':'%'+_0xb803ea[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0xa3e56a;})});}_0x3b6638=_[_0x78d3('0x54')]({},_0x3b6638,_0xb803ea[_0x78d3('0x5f')]);return db[_0x78d3('0x6d')]['count']({'where':_0x3b6638[_0x78d3('0x4f')]})['then'](function(_0x5b97d0){_0x385dbc[_0x78d3('0x31')]=_0x5b97d0;if(_0xb803ea[_0x78d3('0x48')][_0x78d3('0x56')]){_0x3b6638[_0x78d3('0x57')]=[{'all':!![]}];}return db[_0x78d3('0x6d')][_0x78d3('0x58')](_0x3b6638);})[_0x78d3('0x38')](function(_0x1940b3){_0x385dbc[_0x78d3('0x59')]=_0x1940b3;return _0x385dbc;});}})['then'](respondWithFilteredResult(_0x3bbb42,_0x3b6638))[_0x78d3('0x5a')](handleError(_0x3bbb42,null));};exports[_0x78d3('0x6f')]=function(_0x15e511,_0x4f21a0,_0x55bbac){return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x15e511[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x4f21a0,null))['then'](function(_0x2fd217){if(_0x2fd217){return _0x2fd217['removeDispositions'](_0x15e511[_0x78d3('0x48')][_0x78d3('0x70')]);}})['then'](respondWithStatusCode(_0x4f21a0,null))[_0x78d3('0x5a')](handleError(_0x4f21a0,null));};exports[_0x78d3('0x71')]=function(_0x31af58,_0x225356,_0x128d4b){if(_0x31af58[_0x78d3('0x61')]['id']){delete _0x31af58[_0x78d3('0x61')]['id'];}return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x31af58[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x225356,null))[_0x78d3('0x38')](function(_0x164a60){if(_0x164a60){_0x31af58[_0x78d3('0x61')][_0x78d3('0x6c')]=_0x164a60['id'];return db[_0x78d3('0x72')]['create'](_0x31af58['body']);}})[_0x78d3('0x38')](respondWithResult(_0x225356,null))[_0x78d3('0x5a')](handleError(_0x225356,null));};exports['getAnswers']=function(_0x17843e,_0x503a4c,_0x48a439){var _0x104ce0={'raw':![],'where':{}};var _0x5c21d7={};var _0x3dcf85={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x78d3('0x6e')]({'where':{'id':_0x17843e[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x503a4c,null))[_0x78d3('0x38')](function(_0x475457){if(_0x475457){_0x5c21d7['model']=_[_0x78d3('0x46')](db[_0x78d3('0x72')][_0x78d3('0x5d')]);_0x5c21d7[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0x17843e['query']);_0x5c21d7[_0x78d3('0x51')]=_[_0x78d3('0x47')](_0x5c21d7[_0x78d3('0x44')],_0x5c21d7[_0x78d3('0x48')]);_0x104ce0[_0x78d3('0x49')]=_['intersection'](_0x5c21d7[_0x78d3('0x44')],qs[_0x78d3('0x4a')](_0x17843e[_0x78d3('0x48')][_0x78d3('0x4a')]));_0x104ce0[_0x78d3('0x49')]=_0x104ce0[_0x78d3('0x49')][_0x78d3('0x5e')]?_0x104ce0[_0x78d3('0x49')]:_0x5c21d7[_0x78d3('0x44')];if(!_0x17843e[_0x78d3('0x48')][_0x78d3('0x4b')](_0x78d3('0x4c'))){_0x104ce0[_0x78d3('0x30')]=qs['limit'](_0x17843e[_0x78d3('0x48')][_0x78d3('0x30')]);_0x104ce0[_0x78d3('0x2e')]=qs[_0x78d3('0x2e')](_0x17843e[_0x78d3('0x48')][_0x78d3('0x2e')]);}_0x104ce0[_0x78d3('0x4d')]=qs[_0x78d3('0x4e')](_0x17843e[_0x78d3('0x48')][_0x78d3('0x4e')]);_0x104ce0['where']=qs['filters'](_['pick'](_0x17843e[_0x78d3('0x48')],_0x5c21d7[_0x78d3('0x51')]));_0x104ce0[_0x78d3('0x4f')][_0x78d3('0x6c')]=_0x475457['id'];if(_0x17843e['query']['filter']){_0x104ce0[_0x78d3('0x4f')]=_['merge'](_0x104ce0['where'],{'$or':_['map'](_0x104ce0[_0x78d3('0x49')],function(_0x5a4fa0){var _0x42ad7a={};_0x42ad7a[_0x5a4fa0]={'$like':'%'+_0x17843e[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0x42ad7a;})});}_0x104ce0=_[_0x78d3('0x54')]({},_0x104ce0,_0x17843e[_0x78d3('0x5f')]);return db[_0x78d3('0x72')]['count']({'where':_0x104ce0[_0x78d3('0x4f')]})[_0x78d3('0x38')](function(_0x4ef77c){_0x3dcf85[_0x78d3('0x31')]=_0x4ef77c;if(_0x17843e[_0x78d3('0x48')][_0x78d3('0x56')]){_0x104ce0['include']=[{'all':!![]}];}return db[_0x78d3('0x72')]['findAll'](_0x104ce0);})[_0x78d3('0x38')](function(_0x541c3c){_0x3dcf85[_0x78d3('0x59')]=_0x541c3c;return _0x3dcf85;});}})['then'](respondWithFilteredResult(_0x503a4c,_0x104ce0))['catch'](handleError(_0x503a4c,null));};exports[_0x78d3('0x73')]=function(_0x3fd3a5,_0x9b4415,_0x1c937b){return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x3fd3a5[_0x78d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x9b4415,null))[_0x78d3('0x38')](function(_0x417869){if(_0x417869){return _0x417869[_0x78d3('0x73')](_0x3fd3a5[_0x78d3('0x48')][_0x78d3('0x70')]);}})[_0x78d3('0x38')](respondWithStatusCode(_0x9b4415,null))[_0x78d3('0x5a')](handleError(_0x9b4415,null));};exports[_0x78d3('0x74')]=function(_0x3f6f5b,_0x380d2a,_0x5591f3){var _0x2deb14={'body':_0x3f6f5b[_0x78d3('0x61')],'channel':'openchannel'};var _0x1f945a=[];var _0x2a21c2=[];var _0x1c7f48={};var _0x56e742=![];return db[_0x78d3('0x75')][_0x78d3('0x6b')]()[_0x78d3('0x38')](function(_0x261e3a){if(!_0x261e3a){throw new db[(_0x78d3('0x76'))][(_0x78d3('0x77'))](_0x78d3('0x78'));}_0x1f945a=_[_0x78d3('0x79')](_[_0x78d3('0x46')](_0x261e3a),[_0x78d3('0x7a'),'updatedAt']);_0x2a21c2=_[_0x78d3('0x79')](_[_0x78d3('0x46')](_0x261e3a),[_0x78d3('0x7a'),_0x78d3('0x7b'),_0x78d3('0x7c'),_0x78d3('0x7d')]);if(_0x3f6f5b[_0x78d3('0x61')]['id']){delete _0x3f6f5b['body']['id'];}if(_[_0x78d3('0x7e')](_0x3f6f5b[_0x78d3('0x61')]['from'])){throw new db[(_0x78d3('0x76'))][(_0x78d3('0x77'))]('from\x20is\x20mandatory');}if(_[_0x78d3('0x7e')](_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x61')])||_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x61')]===''){throw new db[(_0x78d3('0x76'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x7f')])){throw new db[(_0x78d3('0x76'))][(_0x78d3('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a21c2);}if(!_[_0x78d3('0x80')](_0x2a21c2,_0x3f6f5b[_0x78d3('0x61')]['mapKey'])){throw new db[(_0x78d3('0x76'))][(_0x78d3('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a21c2);}_0x1c7f48[_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x7f')]]=_0x3f6f5b[_0x78d3('0x61')]['from'];})[_0x78d3('0x38')](function(){return db[_0x78d3('0x55')][_0x78d3('0x6a')]({'where':{'id':_0x3f6f5b['params']['id']},'include':[{'model':db['CmList'],'as':_0x78d3('0x81'),'include':[{'model':db[_0x78d3('0x75')],'as':_0x78d3('0x82'),'where':_0x1c7f48,'limit':0x1,'order':[[_0x78d3('0x7b'),'DESC']]}]},{'model':db[_0x78d3('0x83')],'as':_0x78d3('0x84')}]});})[_0x78d3('0x38')](handleEntityNotFound(_0x380d2a,null))[_0x78d3('0x38')](function(_0x214fee){if(_0x214fee&&_0x214fee[_0x78d3('0x81')]){_0x2deb14[_0x78d3('0x85')]=_0x214fee;_0x2deb14[_0x78d3('0x86')]=_0x214fee[_0x78d3('0x84')];_0x2deb14[_0x78d3('0x87')]=_0x214fee['List'];_0x2deb14[_0x78d3('0x86')]=_[_0x78d3('0x88')](_0x2deb14['applications'],[_0x78d3('0x89')],[_0x78d3('0x8a')]);if(_0x2deb14['account'][_0x78d3('0x84')]){delete _0x2deb14['account'][_0x78d3('0x84')];}if(_0x2deb14['account'][_0x78d3('0x81')]&&_0x2deb14[_0x78d3('0x85')][_0x78d3('0x81')][_0x78d3('0x82')][_0x78d3('0x5e')]){return _0x2deb14['account']['List'][_0x78d3('0x82')][0x0];}var _0x5792c8=_[_0x78d3('0x1b')](_0x3f6f5b[_0x78d3('0x61')],{'firstName':_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8b')],'ListId':_0x214fee['ListId']});_0x5792c8[_0x3f6f5b['body'][_0x78d3('0x7f')]]=_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8b')];return db[_0x78d3('0x75')][_0x78d3('0x60')](_0x5792c8,{'fields':_0x1f945a,'raw':!![]});}})['then'](handleEntityNotFound(_0x380d2a,null))[_0x78d3('0x38')](function(_0x51e760){_0x2deb14['contact']=_0x51e760;if(_0x51e760){var _0x9dd928={'ContactId':_0x51e760['id'],'OpenchannelAccountId':_0x3f6f5b['params']['id'],'from':(_0x51e760['firstName']||'')+'\x20'+(_0x51e760[_0x78d3('0x8c')]||'')};var _0xc03329={'OpenchannelAccountId':_0x3f6f5b[_0x78d3('0x5c')]['id'],'closed':![]};if(_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8d')]){_0xc03329['threadId']=_0x3f6f5b['body']['threadId'];return db[_0x78d3('0x8e')]['find']({'where':_0xc03329})[_0x78d3('0x38')](function(_0xe57d77){if(_0xe57d77){return[_0xe57d77,![]];}_0x9dd928[_0x78d3('0x8d')]=_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8d')];_0x9dd928[_0x78d3('0x8f')]=_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8f')];return db[_0x78d3('0x8e')]['create'](_0x9dd928)['then'](function(_0x12f107){return[_0x12f107,!![]];});});}else{_0xc03329[_0x78d3('0x8d')]=null;}_0xc03329[_0x78d3('0x90')]=_0x51e760['id'];return db[_0x78d3('0x8e')][_0x78d3('0x6a')]({'where':_0xc03329})['then'](function(_0x2f7841){if(_0x2f7841){return[_0x2f7841,![]];}return db[_0x78d3('0x8e')][_0x78d3('0x60')](_0x9dd928)[_0x78d3('0x38')](function(_0x751cf3){return[_0x751cf3,!![]];});});}})[_0x78d3('0x91')](function(_0x315f1c,_0x4bb46b){if(_0x315f1c){_0x56e742=_0x4bb46b;if(!_0x4bb46b){var _0x4c5f05={'from':(_0x2deb14[_0x78d3('0x92')]['firstName']||'')+'\x20'+(_0x2deb14[_0x78d3('0x92')]['lastName']||'')};if(_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x8d')]&&_0x3f6f5b['body']['messageId']&&_0x3f6f5b['body'][_0x78d3('0x8d')]!=_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x93')]){_0x4c5f05[_0x78d3('0x8d')]=_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x93')];}return _0x315f1c[_0x78d3('0x36')](_0x4c5f05);}else{return _0x315f1c;}}})[_0x78d3('0x38')](function(_0x86b57){_0x2deb14[_0x78d3('0x94')]=_0x86b57[_0x78d3('0x39')]({'plain':!![]});_0x2deb14[_0x78d3('0x94')][_0x78d3('0x95')]=_0x56e742;if(_0x2deb14['interaction'][_0x78d3('0x95')]){if(_0x2deb14['account']['autoclose']){_0x2deb14[_0x78d3('0x86')][_0x78d3('0x96')]({'id':0x0,'priority':_0x2deb14['applications'][_0x78d3('0x5e')]+0x1,'app':_0x78d3('0x97'),'appdata':_0x78d3('0x98'),'interval':_0x78d3('0x99')});}}return db['OpenchannelMessage']['create']({'body':_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x61')],'OpenchannelAccountId':_0x3f6f5b[_0x78d3('0x5c')]['id'],'OpenchannelInteractionId':_0x86b57['id'],'direction':'in','ContactId':_0x2deb14['contact']['id'],'AttachmentId':_0x3f6f5b[_0x78d3('0x61')][_0x78d3('0x9a')]});})[_0x78d3('0x38')](function(_0x51fe5c){_0x2deb14[_0x78d3('0x28')]=_0x51fe5c;if(_0x2deb14[_0x78d3('0x94')][_0x78d3('0x9b')]){return db[_0x78d3('0x9c')]['find']({'attributes':['id',_0x78d3('0x45')],'where':{'id':_0x2deb14[_0x78d3('0x94')][_0x78d3('0x9b')]}})[_0x78d3('0x38')](function(_0x1b4f65){if(_0x1b4f65){_0x2deb14['applications'][_0x78d3('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1b4f65['name']+','+(_0x2deb14[_0x78d3('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0x78d3('0x99')});_0x2deb14[_0x78d3('0x9e')]=![];}return respondWithRpcPromise(_0x78d3('0x9f'),'startRouting',_0x2deb14);});}return respondWithRpcPromise(_0x78d3('0x9f'),'startRouting',_0x2deb14);})[_0x78d3('0x38')](function(_0x1f7042){respondWithRpcPromise('EventManager',_0x78d3('0xa0'),{'event':_0x78d3('0x74'),'message':_0x1f7042},client9002);return _0x1f7042;})['then'](respondWithResult(_0x380d2a,null))[_0x78d3('0x5a')](handleError(_0x380d2a,null));};exports[_0x78d3('0xa1')]=function(_0x4c7311,_0x245027){var _0x244e1d=_0x4c7311[_0x78d3('0x5c')]['id'];var _0x5e5762=_0x4c7311[_0x78d3('0x61')];var _0x2a4fdc=0xc8;var _0x46113a=null;return db[_0x78d3('0xa2')][_0x78d3('0xa3')]({'isolationLevel':db[_0x78d3('0xa2')]['Transaction'][_0x78d3('0xa4')][_0x78d3('0xa5')]},function(_0x495db6){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x244e1d},'transaction':_0x495db6})[_0x78d3('0x38')](function(_0x4f7daf){if(_0x4f7daf){return db[_0x78d3('0x83')][_0x78d3('0x37')]({'where':{'OpenchannelAccountId':_0x244e1d},'transaction':_0x495db6})[_0x78d3('0x38')](function(){var _0x4ac5d1=_['map'](_0x5e5762,function(_0x1d2250){_0x1d2250['OpenchannelAccountId']=_0x244e1d;return _0x1d2250;});return db[_0x78d3('0x83')]['bulkCreate'](_0x4ac5d1,{'transaction':_0x495db6});});}else{_0x2a4fdc=0x194;_0x46113a=[];}});})[_0x78d3('0x38')](function(){if(_0x2a4fdc!==0x194){return db[_0x78d3('0x83')][_0x78d3('0xa6')]({'where':{'OpenchannelAccountId':_0x244e1d},'order':_0x78d3('0x89')})[_0x78d3('0x38')](function(_0x21dcb8){_0x46113a=_0x21dcb8;});}})[_0x78d3('0x5a')](function(_0x2ff636){_0x2a4fdc=0x1f4;logger[_0x78d3('0x25')](_0x2ff636['stack']);if(_0x2ff636[_0x78d3('0x45')]){delete _0x2ff636[_0x78d3('0x45')];}_0x46113a=_0x2ff636;})['finally'](function(){if(_0x46113a===null){_0x245027['sendStatus'](_0x2a4fdc);}else{if(_0x2a4fdc===0x1f4){_0x245027['status'](_0x2a4fdc)[_0x78d3('0x3c')](_0x46113a);}else{_0x245027[_0x78d3('0x2b')](_0x2a4fdc)[_0x78d3('0x2d')](_0x46113a);}}});};exports['getApplications']=function(_0xa8dfd0,_0x33019e,_0x184ff2){var _0x27ed85={};var _0x4cb028={};var _0x416209;var _0x185b65;return db[_0x78d3('0x55')][_0x78d3('0x6e')]({'where':{'id':_0xa8dfd0['params']['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x33019e,null))['then'](function(_0x5b2240){if(_0x5b2240){_0x416209=_0x5b2240;_0x4cb028[_0x78d3('0x44')]=_['keys'](db[_0x78d3('0x83')][_0x78d3('0x5d')]);_0x4cb028[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0xa8dfd0['query']);_0x4cb028[_0x78d3('0x51')]=_['intersection'](_0x4cb028[_0x78d3('0x44')],_0x4cb028[_0x78d3('0x48')]);_0x27ed85[_0x78d3('0x49')]=_[_0x78d3('0x47')](_0x4cb028[_0x78d3('0x44')],qs[_0x78d3('0x4a')](_0xa8dfd0[_0x78d3('0x48')][_0x78d3('0x4a')]));_0x27ed85['attributes']=_0x27ed85['attributes'][_0x78d3('0x5e')]?_0x27ed85[_0x78d3('0x49')]:_0x4cb028[_0x78d3('0x44')];_0x27ed85[_0x78d3('0x4d')]=qs['sort'](_0xa8dfd0['query']['sort']);_0x27ed85['where']=qs['filters'](_[_0x78d3('0x50')](_0xa8dfd0['query'],_0x4cb028[_0x78d3('0x51')]));if(_0xa8dfd0[_0x78d3('0x48')][_0x78d3('0x53')]){_0x27ed85['where']=_[_0x78d3('0x54')](_0x27ed85[_0x78d3('0x4f')],{'$or':_[_0x78d3('0x40')](_0x27ed85[_0x78d3('0x49')],function(_0x4031b4){var _0x1f5a65={};_0x1f5a65[_0x4031b4]={'$like':'%'+_0xa8dfd0[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0x1f5a65;})});}_0x27ed85=_[_0x78d3('0x54')]({},_0x27ed85,_0xa8dfd0[_0x78d3('0x5f')]);return _0x416209['getApplications'](_0x27ed85);}})[_0x78d3('0x38')](function(_0x1ad93d){if(_0x1ad93d){_0x185b65=_0x1ad93d[_0x78d3('0x5e')];if(!_0xa8dfd0[_0x78d3('0x48')][_0x78d3('0x4b')](_0x78d3('0x4c'))){_0x27ed85[_0x78d3('0x30')]=qs[_0x78d3('0x30')](_0xa8dfd0[_0x78d3('0x48')][_0x78d3('0x30')]);_0x27ed85['offset']=qs[_0x78d3('0x2e')](_0xa8dfd0['query'][_0x78d3('0x2e')]);}return _0x416209['getApplications'](_0x27ed85);}})[_0x78d3('0x38')](function(_0x1ac8c7){if(_0x1ac8c7){return _0x1ac8c7?{'count':_0x185b65,'rows':_0x1ac8c7}:null;}})[_0x78d3('0x38')](respondWithResult(_0x33019e,null))[_0x78d3('0x5a')](handleError(_0x33019e,null));};exports[_0x78d3('0xa7')]=function(_0xc93420,_0x3c28f4,_0xb6993a){var _0xc6b9a4={'raw':![],'where':{}};var _0x4ff70d={};var _0x4ecc0b={'count':0x0,'rows':[]};return db[_0x78d3('0x55')][_0x78d3('0x6e')]({'where':{'id':_0xc93420[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x3c28f4,null))['then'](function(_0x55f370){if(_0x55f370){_0x4ff70d[_0x78d3('0x44')]=_['keys'](db[_0x78d3('0x8e')][_0x78d3('0x5d')]);_0x4ff70d[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0xc93420['query']);_0x4ff70d['filters']=_[_0x78d3('0x47')](_0x4ff70d[_0x78d3('0x44')],_0x4ff70d[_0x78d3('0x48')]);_0xc6b9a4['attributes']=_[_0x78d3('0x47')](_0x4ff70d['model'],qs[_0x78d3('0x4a')](_0xc93420[_0x78d3('0x48')][_0x78d3('0x4a')]));_0xc6b9a4['attributes']=_0xc6b9a4[_0x78d3('0x49')]['length']?_0xc6b9a4[_0x78d3('0x49')]:_0x4ff70d[_0x78d3('0x44')];if(!_0xc93420['query'][_0x78d3('0x4b')]('nolimit')){_0xc6b9a4[_0x78d3('0x30')]=qs['limit'](_0xc93420[_0x78d3('0x48')][_0x78d3('0x30')]);_0xc6b9a4['offset']=qs[_0x78d3('0x2e')](_0xc93420['query'][_0x78d3('0x2e')]);}_0xc6b9a4[_0x78d3('0x4d')]=qs[_0x78d3('0x4e')](_0xc93420[_0x78d3('0x48')][_0x78d3('0x4e')]);_0xc6b9a4[_0x78d3('0x4f')]=qs[_0x78d3('0x51')](_[_0x78d3('0x50')](_0xc93420[_0x78d3('0x48')],_0x4ff70d[_0x78d3('0x51')]));_0xc6b9a4['where'][_0x78d3('0x6c')]=_0x55f370['id'];if(_0xc93420[_0x78d3('0x48')][_0x78d3('0x53')]){_0xc6b9a4[_0x78d3('0x4f')]=_[_0x78d3('0x54')](_0xc6b9a4[_0x78d3('0x4f')],{'$or':_[_0x78d3('0x40')](_0xc6b9a4[_0x78d3('0x49')],function(_0x1e15b5){var _0x358885={};_0x358885[_0x1e15b5]={'$like':'%'+_0xc93420[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0x358885;})});}_0xc6b9a4=_[_0x78d3('0x54')]({},_0xc6b9a4,_0xc93420[_0x78d3('0x5f')]);return db['OpenchannelInteraction'][_0x78d3('0x31')]({'where':_0xc6b9a4['where']})['then'](function(_0x590df0){_0x4ecc0b[_0x78d3('0x31')]=_0x590df0;if(_0xc93420[_0x78d3('0x48')][_0x78d3('0x56')]){_0xc6b9a4[_0x78d3('0x57')]=[{'model':db[_0x78d3('0x75')],'as':'Contact','required':![]},{'model':db[_0x78d3('0x9c')],'as':_0x78d3('0xa8'),'attributes':[_0x78d3('0x45'),_0x78d3('0xa9'),_0x78d3('0xaa')],'required':![]},{'model':db[_0x78d3('0xab')],'as':_0x78d3('0xac'),'attributes':['id','name',_0x78d3('0xad')],'where':_0xc93420[_0x78d3('0x48')][_0x78d3('0xae')]?{'id':_0xc93420[_0x78d3('0x48')][_0x78d3('0xae')]}:undefined,'required':_0xc93420['query'][_0x78d3('0xae')]?!![]:![]}];}return db[_0x78d3('0x8e')]['findAll'](_0xc6b9a4);})[_0x78d3('0x38')](function(_0x16e476){_0x4ecc0b[_0x78d3('0x59')]=_0x16e476;return _0x4ecc0b;});}})[_0x78d3('0x38')](respondWithFilteredResult(_0x3c28f4,_0xc6b9a4))['catch'](handleError(_0x3c28f4,null));};exports[_0x78d3('0xaf')]=function(_0x360898,_0x328b7f,_0x46ccd1){return db['OpenchannelAccount'][_0x78d3('0x6a')]({'where':{'id':_0x360898[_0x78d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x328b7f,null))[_0x78d3('0x38')](function(_0x45c0a2){if(_0x45c0a2){return _0x45c0a2[_0x78d3('0xaf')](_0x360898[_0x78d3('0x61')][_0x78d3('0x70')],_['omit'](_0x360898[_0x78d3('0x61')],[_0x78d3('0x70'),'id'])||{})['spread'](function(_0x5579b5){for(var _0x26c7c3=0x0;_0x26c7c3<_0x360898[_0x78d3('0x61')]['ids']['length'];_0x26c7c3+=0x1){socket[_0x78d3('0xb0')](_0x78d3('0xb1'),{'UserId':Number(_0x360898[_0x78d3('0x61')][_0x78d3('0x70')][_0x26c7c3]),'OpenchannelAccountId':Number(_0x360898['params']['id'])});}return _0x5579b5;});}})[_0x78d3('0x38')](respondWithResult(_0x328b7f,null))[_0x78d3('0x5a')](handleError(_0x328b7f,null));};exports[_0x78d3('0xb2')]=function(_0x4eaa63,_0x42176e,_0x2a757e){return db[_0x78d3('0x55')]['find']({'where':{'id':_0x4eaa63[_0x78d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x42176e,null))['then'](function(_0x2d9954){if(_0x2d9954){return _0x2d9954[_0x78d3('0xb2')](_0x4eaa63[_0x78d3('0x48')][_0x78d3('0x70')])[_0x78d3('0x38')](function(){if(_[_0x78d3('0xb3')](_0x4eaa63[_0x78d3('0x48')][_0x78d3('0x70')])){for(var _0x19e65a=0x0;_0x19e65a<_0x4eaa63[_0x78d3('0x48')][_0x78d3('0x70')][_0x78d3('0x5e')];_0x19e65a+=0x1){socket['emit'](_0x78d3('0xb4'),{'UserId':Number(_0x4eaa63[_0x78d3('0x48')]['ids'][_0x19e65a]),'OpenchannelAccountId':Number(_0x4eaa63['params']['id'])});}}else{socket[_0x78d3('0xb0')](_0x78d3('0xb4'),{'UserId':Number(_0x4eaa63[_0x78d3('0x48')][_0x78d3('0x70')]),'OpenchannelAccountId':Number(_0x4eaa63[_0x78d3('0x5c')]['id'])});}});}})[_0x78d3('0x38')](respondWithStatusCode(_0x42176e,null))[_0x78d3('0x5a')](handleError(_0x42176e,null));};exports[_0x78d3('0xb5')]=function(_0x2060bf,_0x5cf631,_0x148a32){var _0x20f6a2={};var _0xc26ac2={};var _0x4b8d5d;var _0x590905;return db['OpenchannelAccount'][_0x78d3('0x6e')]({'where':{'id':_0x2060bf[_0x78d3('0x5c')]['id']}})[_0x78d3('0x38')](handleEntityNotFound(_0x5cf631,null))[_0x78d3('0x38')](function(_0x417121){if(_0x417121){_0x4b8d5d=_0x417121;_0xc26ac2[_0x78d3('0x44')]=_[_0x78d3('0x46')](db['User'][_0x78d3('0x5d')]);_0xc26ac2[_0x78d3('0x48')]=_[_0x78d3('0x46')](_0x2060bf[_0x78d3('0x48')]);_0xc26ac2[_0x78d3('0x51')]=_[_0x78d3('0x47')](_0xc26ac2['model'],_0xc26ac2[_0x78d3('0x48')]);_0x20f6a2[_0x78d3('0x49')]=_['intersection'](_0xc26ac2['model'],qs['fields'](_0x2060bf['query'][_0x78d3('0x4a')]));_0x20f6a2[_0x78d3('0x49')]=_0x20f6a2[_0x78d3('0x49')]['length']?_0x20f6a2[_0x78d3('0x49')]:_0xc26ac2[_0x78d3('0x44')];_0x20f6a2[_0x78d3('0x4d')]=qs['sort'](_0x2060bf[_0x78d3('0x48')]['sort']);_0x20f6a2[_0x78d3('0x4f')]=qs[_0x78d3('0x51')](_[_0x78d3('0x50')](_0x2060bf[_0x78d3('0x48')],_0xc26ac2[_0x78d3('0x51')]));if(_0x2060bf['query']['filter']){_0x20f6a2[_0x78d3('0x4f')]=_[_0x78d3('0x54')](_0x20f6a2[_0x78d3('0x4f')],{'$or':_['map'](_0x20f6a2[_0x78d3('0x49')],function(_0x4231b2){var _0x12400b={};_0x12400b[_0x4231b2]={'$like':'%'+_0x2060bf[_0x78d3('0x48')][_0x78d3('0x53')]+'%'};return _0x12400b;})});}_0x20f6a2=_[_0x78d3('0x54')]({},_0x20f6a2,_0x2060bf[_0x78d3('0x5f')]);return _0x4b8d5d['getAgents'](_0x20f6a2);}})['then'](function(_0x394626){if(_0x394626){_0x590905=_0x394626['length'];if(!_0x2060bf[_0x78d3('0x48')]['hasOwnProperty'](_0x78d3('0x4c'))){_0x20f6a2[_0x78d3('0x30')]=qs['limit'](_0x2060bf[_0x78d3('0x48')][_0x78d3('0x30')]);_0x20f6a2[_0x78d3('0x2e')]=qs[_0x78d3('0x2e')](_0x2060bf[_0x78d3('0x48')][_0x78d3('0x2e')]);}return _0x4b8d5d['getAgents'](_0x20f6a2);}})[_0x78d3('0x38')](function(_0x1c7164){if(_0x1c7164){return _0x1c7164?{'count':_0x590905,'rows':_0x1c7164}:null;}})[_0x78d3('0x38')](respondWithResult(_0x5cf631,null))[_0x78d3('0x5a')](handleError(_0x5cf631,null));};exports[_0x78d3('0x3c')]=function(_0x2fe5a2,_0x1cbe62,_0x3f9c5d){var _0x2981f3,_0x2ce67b,_0x2e0c59;if(_[_0x78d3('0x7e')](_0x2fe5a2[_0x78d3('0x61')][_0x78d3('0x61')])||_0x2fe5a2['body'][_0x78d3('0x61')]===''){throw new db[(_0x78d3('0x76'))][(_0x78d3('0x77'))](_0x78d3('0xb6'));}if(_[_0x78d3('0x7e')](_0x2fe5a2[_0x78d3('0x61')]['to'])){}_0x2981f3=_0x2fe5a2[_0x78d3('0x61')]['to'];return db[_0x78d3('0x55')]['findOne']({'where':{'id':_0x2fe5a2[_0x78d3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1cbe62,null))[_0x78d3('0x38')](function(_0x240cc1){if(_0x240cc1){return db[_0x78d3('0x55')]['find']({'where':{'id':_0x240cc1['id']},'include':[{'model':db[_0x78d3('0xb7')],'as':_0x78d3('0x81'),'include':[{'model':db[_0x78d3('0x75')],'as':_0x78d3('0x82'),'where':{[_0x240cc1[_0x78d3('0x7f')]]:_0x2981f3},'limit':0x1,'order':[[_0x78d3('0x7b'),_0x78d3('0xb8')]]}]}]})[_0x78d3('0x38')](handleEntityNotFound(_0x1cbe62,null))[_0x78d3('0x38')](function(_0x12f3b7){if(_0x12f3b7&&_0x12f3b7['List']){_0x2ce67b=_0x12f3b7[_0x78d3('0x39')]({'plain':!![]});if(_0x2ce67b[_0x78d3('0x81')]&&_0x2ce67b[_0x78d3('0x81')][_0x78d3('0x82')][_0x78d3('0x5e')]){return _0x2ce67b[_0x78d3('0x81')][_0x78d3('0x82')][0x0];}return db[_0x78d3('0x75')][_0x78d3('0x60')](_[_0x78d3('0x1b')](_0x2fe5a2['body'],{'firstName':_0x2981f3,[_0x12f3b7[_0x78d3('0x7f')]]:_0x2981f3,'phone':_0x2981f3,'ListId':_0x2ce67b[_0x78d3('0x7d')]}));}})[_0x78d3('0x38')](handleEntityNotFound(_0x1cbe62,null))[_0x78d3('0x38')](function(_0x5d5379){if(_0x5d5379){_0x2e0c59=_0x5d5379;return db[_0x78d3('0x8e')]['find']({'where':{'ContactId':_0x2e0c59['id'],'closed':![],'OpenchannelAccountId':_0x2ce67b['id']}})[_0x78d3('0x38')](function(_0x2e7dea){if(_0x2e7dea){return[_0x2e7dea,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x2fe5a2['user']['id'],'ContactId':_0x2e0c59['id'],'OpenchannelAccountId':_0x2ce67b['id'],'lastMsgDirection':_0x78d3('0xb9'),'firstMsgDirection':_0x78d3('0xb9'),'Messages':[_[_0x78d3('0x54')](_0x2fe5a2[_0x78d3('0x61')],{'read':![],'body':_0x2fe5a2[_0x78d3('0x61')][_0x78d3('0x61')],'OpenchannelAccountId':_0x2ce67b['id'],'UserId':_0x2fe5a2['user']['id'],'ContactId':_0x2e0c59['id']})]},{'include':[{'model':db[_0x78d3('0xba')],'as':_0x78d3('0xbb')}]})['then'](function(_0xd0fa22){return[_0xd0fa22,!![]];});});}})[_0x78d3('0x91')](function(_0xc16e79,_0xdc7014){if(_0xdc7014){return _0xc16e79;}return db[_0x78d3('0xba')][_0x78d3('0x60')](_[_0x78d3('0x54')](_0x2fe5a2['body'],{'read':![],'body':_0x2fe5a2['body'][_0x78d3('0x61')],'OpenchannelAccountId':_0x2ce67b['id'],'OpenchannelInteractionId':_0xc16e79['id'],'UserId':_0x2fe5a2['user']['id'],'ContactId':_0x2e0c59['id']}))['then'](function(_0x5d6fef){_0xc16e79[_0x78d3('0xbc')]['Messages']=[];_0xc16e79[_0x78d3('0xbc')]['Messages']['push'](_0x5d6fef[_0x78d3('0xbc')]);return _0xc16e79;});});}})[_0x78d3('0x38')](respondWithResult(_0x1cbe62,null))[_0x78d3('0x5a')](handleError(_0x1cbe62,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 41f62a2..ae76a37 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa571,0x107));var _0x1a57=function(_0x3c07f8,_0x55082f){_0x3c07f8=_0x3c07f8-0x0;var _0x139006=_0xa571[_0x3c07f8];return _0x139006;};'use strict';var EventEmitter=require(_0x1a57('0x0'));var OpenchannelAccount=require(_0x1a57('0x1'))['db'][_0x1a57('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1a57('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a57('0x4'),'afterDestroy':_0x1a57('0x5')};function emitEvent(_0x4d5f7a){return function(_0x5ec815,_0x1f2c44,_0x5067fa){OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a+':'+_0x5ec815['id'],_0x5ec815);OpenchannelAccountEvents[_0x1a57('0x6')](_0x4d5f7a,_0x5ec815);_0x5067fa(null);};}for(var e in events){if(events[_0x1a57('0x7')](e)){var event=events[e];OpenchannelAccount[_0x1a57('0x8')](e,emitEvent(event));}}module[_0x1a57('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x2547=['hasOwnProperty','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x171fa7,_0x587eca){var _0xc894e1=function(_0x43d7c7){while(--_0x43d7c7){_0x171fa7['push'](_0x171fa7['shift']());}};_0xc894e1(++_0x587eca);}(_0x2547,0x1cd));var _0x7254=function(_0x20dcb1,_0x587cb1){_0x20dcb1=_0x20dcb1-0x0;var _0x122153=_0x2547[_0x20dcb1];return _0x122153;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);OpenchannelAccountEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4f03690..c48f9db 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(_0x535ab9,_0x4f2747){var _0x199e35=function(_0x4ef1cb){while(--_0x4ef1cb){_0x535ab9['push'](_0x535ab9['shift']());}};_0x199e35(++_0x4f2747);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x56410b,_0x326d05){var _0x3348e7=function(_0x5c5ac3){while(--_0x5c5ac3){_0x56410b['push'](_0x56410b['shift']());}};_0x3348e7(++_0x326d05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 57b508c..26c8d14 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 _0x594d=['defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis'];(function(_0x1d1c37,_0x5b558f){var _0x439189=function(_0x1fb3ea){while(--_0x1fb3ea){_0x1d1c37['push'](_0x1d1c37['shift']());}};_0x439189(++_0x5b558f);}(_0x594d,0x92));var _0xd594=function(_0x4f2ace,_0x3887b5){_0x4f2ace=_0x4f2ace-0x0;var _0x19e481=_0x594d[_0x4f2ace];return _0x19e481;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});config[_0xd594('0x9')]=_[_0xd594('0xa')](config[_0xd594('0x9')],{'host':_0xd594('0xb'),'port':0x18eb});var socket=require(_0xd594('0xc'))(new Redis(config[_0xd594('0x9')]));require(_0xd594('0xd'))[_0xd594('0xe')](socket);function respondWithRpcPromise(_0x143886,_0x20411b,_0x564835){return new BPromise(function(_0x31e19b,_0x3f0381){return client[_0xd594('0xf')](_0x143886,_0x564835)['then'](function(_0xeba835){logger[_0xd594('0x10')](_0xd594('0x11'),_0x20411b,_0xd594('0x12'));logger[_0xd594('0x13')](_0xd594('0x14'),_0x20411b,_0xd594('0x12'),JSON['stringify'](_0xeba835));if(_0xeba835['error']){if(_0xeba835[_0xd594('0x15')][_0xd594('0x16')]===0x1f4){logger['error'](_0xd594('0x11'),_0x20411b,_0xeba835['error'][_0xd594('0x17')]);return _0x3f0381(_0xeba835[_0xd594('0x15')][_0xd594('0x17')]);}logger['error'](_0xd594('0x11'),_0x20411b,_0xeba835['error']['message']);return _0x31e19b(_0xeba835[_0xd594('0x15')][_0xd594('0x17')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x20411b,_0xd594('0x12'));_0x31e19b(_0xeba835[_0xd594('0x18')]['message']);}})[_0xd594('0x19')](function(_0x559962){logger[_0xd594('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x20411b,_0x559962);_0x3f0381(_0x559962);});});} \ No newline at end of file +var _0xa74f=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then'];(function(_0xc6d7ab,_0x40f000){var _0x3b56d5=function(_0x52bc18){while(--_0x52bc18){_0xc6d7ab['push'](_0xc6d7ab['shift']());}};_0x3b56d5(++_0x40f000);}(_0xa74f,0x9a));var _0xfa74=function(_0x4429e0,_0xee6f1f){_0x4429e0=_0x4429e0-0x0;var _0x51a5b3=_0xa74f[_0x4429e0];return _0x51a5b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});config[_0xfa74('0x7')]=_[_0xfa74('0x8')](config[_0xfa74('0x7')],{'host':_0xfa74('0x9'),'port':0x18eb});var socket=require(_0xfa74('0xa'))(new Redis(config['redis']));require(_0xfa74('0xb'))[_0xfa74('0xc')](socket);function respondWithRpcPromise(_0x355e37,_0x2a405e,_0x4d118c){return new BPromise(function(_0x46117e,_0x4f8891){return client['request'](_0x355e37,_0x4d118c)[_0xfa74('0xd')](function(_0x1d919d){logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x2a405e,_0xfa74('0x12'),JSON[_0xfa74('0x13')](_0x1d919d));if(_0x1d919d['error']){if(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x15')]===0x1f4){logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')]['message']);return _0x4f8891(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);}logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);return _0x46117e(_0x1d919d[_0xfa74('0x14')]['message']);}else{logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');_0x46117e(_0x1d919d['result'][_0xfa74('0x16')]);}})[_0xfa74('0x17')](function(_0xb8fe6b){logger['error'](_0xfa74('0xf'),_0x2a405e,_0xb8fe6b);_0x4f8891(_0xb8fe6b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 0f4d4ca..1628173 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 _0xd8cc=['removeListener','length','openchannelAccount:','./openchannelAccount.events','save','emit'];(function(_0x289f45,_0x27317c){var _0x30716b=function(_0x356dde){while(--_0x356dde){_0x289f45['push'](_0x289f45['shift']());}};_0x30716b(++_0x27317c);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xd8cc[_0x3b7a0c];return _0x3bb70f;};'use strict';var OpenchannelAccountEvents=require(_0xcd8c('0x0'));var events=[_0xcd8c('0x1'),'remove','update'];function createListener(_0x1576d8,_0x7f40a7){return function(_0x1a1e1e){_0x7f40a7[_0xcd8c('0x2')](_0x1576d8,_0x1a1e1e);};}function removeListener(_0x58d2c9,_0x2dad29){return function(){OpenchannelAccountEvents[_0xcd8c('0x3')](_0x58d2c9,_0x2dad29);};}exports['register']=function(_0x5776fc){for(var _0x233d52=0x0,_0x55c4ed=events[_0xcd8c('0x4')];_0x233d52<_0x55c4ed;_0x233d52++){var _0x5814b4=events[_0x233d52];var _0x4740bf=createListener(_0xcd8c('0x5')+_0x5814b4,_0x5776fc);OpenchannelAccountEvents['on'](_0x5814b4,_0x4740bf);}}; \ No newline at end of file +var _0x7980=['emit','removeListener','length','./openchannelAccount.events','save','remove','update'];(function(_0x36547c,_0x49f530){var _0x409167=function(_0x4aa4bd){while(--_0x4aa4bd){_0x36547c['push'](_0x36547c['shift']());}};_0x409167(++_0x49f530);}(_0x7980,0xab));var _0x0798=function(_0x4cb771,_0xc51cc1){_0x4cb771=_0x4cb771-0x0;var _0x46a034=_0x7980[_0x4cb771];return _0x46a034;};'use strict';var OpenchannelAccountEvents=require(_0x0798('0x0'));var events=[_0x0798('0x1'),_0x0798('0x2'),_0x0798('0x3')];function createListener(_0x3181e9,_0x48285b){return function(_0x3a9ff7){_0x48285b[_0x0798('0x4')](_0x3181e9,_0x3a9ff7);};}function removeListener(_0xecc24f,_0x1637db){return function(){OpenchannelAccountEvents[_0x0798('0x5')](_0xecc24f,_0x1637db);};}exports['register']=function(_0x22a0f0){for(var _0x557325=0x0,_0x1e534f=events[_0x0798('0x6')];_0x557325<_0x1e534f;_0x557325++){var _0x467859=events[_0x557325];var _0x54da10=createListener('openchannelAccount:'+_0x467859,_0x22a0f0);OpenchannelAccountEvents['on'](_0x467859,_0x54da10);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8a19b72..d035d81 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 _0xb086=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x4b025d,_0x506030){var _0x479740=function(_0x5a561e){while(--_0x5a561e){_0x4b025d['push'](_0x4b025d['shift']());}};_0x479740(++_0x506030);}(_0xb086,0xa7));var _0x6b08=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb086[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x6b08('0x0'));var util=require(_0x6b08('0x1'));var path=require('path');var timeout=require(_0x6b08('0x2'));var express=require(_0x6b08('0x3'));var router=express[_0x6b08('0x4')]();var fs_extra=require(_0x6b08('0x5'));var auth=require(_0x6b08('0x6'));var interaction=require(_0x6b08('0x7'));var config=require(_0x6b08('0x8'));var controller=require(_0x6b08('0x9'));router[_0x6b08('0xa')]('/',auth[_0x6b08('0xb')](),controller[_0x6b08('0xc')]);router['get'](_0x6b08('0xd'),auth['isAuthenticated'](),controller[_0x6b08('0xe')]);router[_0x6b08('0xf')]('/',auth[_0x6b08('0xb')](),controller[_0x6b08('0x10')]);router[_0x6b08('0x11')]('/:id',auth[_0x6b08('0xb')](),controller[_0x6b08('0x12')]);router['delete']('/:id',auth[_0x6b08('0xb')](),controller[_0x6b08('0x13')]);module[_0x6b08('0x14')]=router; \ No newline at end of file +var _0x012d=['./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xc60f4a,_0x4d710e){var _0x97c8c1=function(_0xa8667a){while(--_0xa8667a){_0xc60f4a['push'](_0xc60f4a['shift']());}};_0x97c8c1(++_0x4d710e);}(_0x012d,0xca));var _0xd012=function(_0x49d280,_0x33d68f){_0x49d280=_0x49d280-0x0;var _0x25274a=_0x012d[_0x49d280];return _0x25274a;};'use strict';var multer=require('multer');var util=require(_0xd012('0x0'));var path=require(_0xd012('0x1'));var timeout=require(_0xd012('0x2'));var express=require(_0xd012('0x3'));var router=express['Router']();var fs_extra=require(_0xd012('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd012('0x5'));var config=require('../../config/environment');var controller=require(_0xd012('0x6'));router[_0xd012('0x7')]('/',auth[_0xd012('0x8')](),controller[_0xd012('0x9')]);router[_0xd012('0x7')](_0xd012('0xa'),auth[_0xd012('0x8')](),controller['show']);router[_0xd012('0xb')]('/',auth[_0xd012('0x8')](),controller[_0xd012('0xc')]);router[_0xd012('0xd')](_0xd012('0xa'),auth[_0xd012('0x8')](),controller['update']);router[_0xd012('0xe')](_0xd012('0xa'),auth[_0xd012('0x8')](),controller['destroy']);module[_0xd012('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 217c568..bb483bb 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 _0xf1c4=['STRING','noop','*,*,*,*','INTEGER'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0xf1c4,0x15b));var _0x4f1c=function(_0x562828,_0x20f804){_0x562828=_0x562828-0x0;var _0xa72383=_0xf1c4[_0x562828];return _0xa72383;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x4f1c('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x4f1c('0x1')],'allowNull':![],'defaultValue':_0x4f1c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4f1c('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4f1c('0x3')}}; \ No newline at end of file +var _0xf811=['INTEGER','STRING','exports'];(function(_0x24a127,_0x485506){var _0x1c130=function(_0x479f83){while(--_0x479f83){_0x24a127['push'](_0x24a127['shift']());}};_0x1c130(++_0x485506);}(_0xf811,0x1bb));var _0x1f81=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xf811[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require('sequelize');module[_0x1f81('0x0')]={'priority':{'type':Sequelize[_0x1f81('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1f81('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1f81('0x2')]},'interval':{'type':Sequelize[_0x1f81('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ae2d9f9..fcb0cbc 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 _0xf529=['stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','error'];(function(_0x27cd32,_0x24ff36){var _0x405e89=function(_0x46c8e2){while(--_0x46c8e2){_0x27cd32['push'](_0x27cd32['shift']());}};_0x405e89(++_0x24ff36);}(_0xf529,0x70));var _0x9f52=function(_0x3e8732,_0x51741d){_0x3e8732=_0x3e8732-0x0;var _0x434ede=_0xf529[_0x3e8732];return _0x434ede;};'use strict';var emlformat=require(_0x9f52('0x0'));var rimraf=require(_0x9f52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f52('0x2'));var rp=require(_0x9f52('0x3'));var moment=require(_0x9f52('0x4'));var BPromise=require(_0x9f52('0x5'));var Mustache=require(_0x9f52('0x6'));var util=require(_0x9f52('0x7'));var path=require(_0x9f52('0x8'));var sox=require(_0x9f52('0x9'));var csv=require(_0x9f52('0xa'));var ejs=require(_0x9f52('0xb'));var fs=require('fs');var fs_extra=require(_0x9f52('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9f52('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f52('0xe'));var toCsv=require(_0x9f52('0xa'));var querystring=require('querystring');var Papa=require(_0x9f52('0xf'));var Redis=require(_0x9f52('0x10'));var authService=require(_0x9f52('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f52('0x12'));var hardwareService=require(_0x9f52('0x13'));var logger=require(_0x9f52('0x14'))(_0x9f52('0x15'));var utils=require(_0x9f52('0x16'));var config=require(_0x9f52('0x17'));var licenseUtil=require(_0x9f52('0x18'));var db=require(_0x9f52('0x19'))['db'];function respondWithStatusCode(_0x134cc9,_0x405ccf){_0x405ccf=_0x405ccf||0xcc;return function(_0x18ce88){if(_0x18ce88){return _0x134cc9[_0x9f52('0x1a')](_0x405ccf);}return _0x134cc9['status'](_0x405ccf)[_0x9f52('0x1b')]();};}function respondWithResult(_0x448d7b,_0x576839){_0x576839=_0x576839||0xc8;return function(_0x5b3c84){if(_0x5b3c84){return _0x448d7b[_0x9f52('0x1c')](_0x576839)[_0x9f52('0x1d')](_0x5b3c84);}};}function respondWithFilteredResult(_0x49d817,_0x2a5c0a){return function(_0x3ed1e2){if(_0x3ed1e2){var _0x3cc29b=typeof _0x2a5c0a[_0x9f52('0x1e')]==='undefined'&&typeof _0x2a5c0a[_0x9f52('0x1f')]===_0x9f52('0x20');var _0x4d8539=_0x3ed1e2[_0x9f52('0x21')];var _0x39bdc6=_0x3cc29b?0x0:_0x2a5c0a[_0x9f52('0x1e')];var _0x5eb9ad=_0x3cc29b?_0x3ed1e2[_0x9f52('0x21')]:_0x2a5c0a[_0x9f52('0x1e')]+_0x2a5c0a[_0x9f52('0x1f')];var _0x42819c;if(_0x5eb9ad>=_0x4d8539){_0x5eb9ad=_0x4d8539;_0x42819c=0xc8;}else{_0x42819c=0xce;}_0x49d817[_0x9f52('0x1c')](_0x42819c);return _0x49d817[_0x9f52('0x22')](_0x9f52('0x23'),_0x39bdc6+'-'+_0x5eb9ad+'/'+_0x4d8539)[_0x9f52('0x1d')](_0x3ed1e2);}return null;};}function patchUpdates(_0x40bacc){return function(_0x3e736b){try{jsonpatch['apply'](_0x3e736b,_0x40bacc,!![]);}catch(_0x550f32){return BPromise['reject'](_0x550f32);}return _0x3e736b['save']();};}function saveUpdates(_0x5715b4,_0x457008){return function(_0x5c5df6){if(_0x5c5df6){return _0x5c5df6[_0x9f52('0x24')](_0x5715b4)['then'](function(_0x15655d){return _0x15655d;});}return null;};}function removeEntity(_0x843f69,_0x4e790a){return function(_0x3a4c08){if(_0x3a4c08){return _0x3a4c08[_0x9f52('0x25')]()[_0x9f52('0x26')](function(){_0x843f69[_0x9f52('0x1c')](0xcc)[_0x9f52('0x1b')]();});}};}function handleEntityNotFound(_0x3b9425,_0x21abe3){return function(_0x39ff85){if(!_0x39ff85){_0x3b9425[_0x9f52('0x1a')](0x194);}return _0x39ff85;};}function handleError(_0x46dde1,_0x20808a){_0x20808a=_0x20808a||0x1f4;return function(_0x7fb4cd){logger[_0x9f52('0x27')](_0x7fb4cd[_0x9f52('0x28')]);if(_0x7fb4cd[_0x9f52('0x29')]){delete _0x7fb4cd['name'];}_0x46dde1[_0x9f52('0x1c')](_0x20808a)[_0x9f52('0x2a')](_0x7fb4cd);};}exports[_0x9f52('0x2b')]=function(_0x48b6ab,_0x4557f1){var _0x5263a9={},_0x22ce24={},_0x344c9c={'count':0x0,'rows':[]};var _0x559077=_[_0x9f52('0x2c')](db[_0x9f52('0x2d')]['rawAttributes'],function(_0x125cc9){return{'name':_0x125cc9[_0x9f52('0x2e')],'type':_0x125cc9[_0x9f52('0x2f')][_0x9f52('0x30')]};});_0x22ce24[_0x9f52('0x31')]=_[_0x9f52('0x2c')](_0x559077,_0x9f52('0x29'));_0x22ce24['query']=_['keys'](_0x48b6ab[_0x9f52('0x32')]);_0x22ce24[_0x9f52('0x33')]=_['intersection'](_0x22ce24[_0x9f52('0x31')],_0x22ce24['query']);_0x5263a9[_0x9f52('0x34')]=_[_0x9f52('0x35')](_0x22ce24[_0x9f52('0x31')],qs[_0x9f52('0x36')](_0x48b6ab['query']['fields']));_0x5263a9[_0x9f52('0x34')]=_0x5263a9['attributes'][_0x9f52('0x37')]?_0x5263a9[_0x9f52('0x34')]:_0x22ce24[_0x9f52('0x31')];if(!_0x48b6ab[_0x9f52('0x32')][_0x9f52('0x38')](_0x9f52('0x39'))){_0x5263a9['limit']=qs['limit'](_0x48b6ab[_0x9f52('0x32')][_0x9f52('0x1f')]);_0x5263a9[_0x9f52('0x1e')]=qs['offset'](_0x48b6ab['query'][_0x9f52('0x1e')]);}_0x5263a9['order']=qs[_0x9f52('0x3a')](_0x48b6ab['query']['sort']);_0x5263a9[_0x9f52('0x3b')]=qs['filters'](_[_0x9f52('0x3c')](_0x48b6ab['query'],_0x22ce24[_0x9f52('0x33')]),_0x559077);if(_0x48b6ab['query'][_0x9f52('0x3d')]){_0x5263a9[_0x9f52('0x3b')]=_['merge'](_0x5263a9[_0x9f52('0x3b')],{'$or':_[_0x9f52('0x2c')](_0x559077,function(_0x82d927){if(_0x82d927[_0x9f52('0x2f')]!=='VIRTUAL'){var _0x19fd7a={};_0x19fd7a[_0x82d927[_0x9f52('0x29')]]={'$like':'%'+_0x48b6ab[_0x9f52('0x32')][_0x9f52('0x3d')]+'%'};return _0x19fd7a;}})});}_0x5263a9=_[_0x9f52('0x3e')]({},_0x5263a9,_0x48b6ab[_0x9f52('0x3f')]);var _0x399916={'where':_0x5263a9[_0x9f52('0x3b')]};return db[_0x9f52('0x2d')][_0x9f52('0x21')](_0x399916)['then'](function(_0x3c0999){_0x344c9c[_0x9f52('0x21')]=_0x3c0999;if(_0x48b6ab[_0x9f52('0x32')][_0x9f52('0x40')]){_0x5263a9['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x9f52('0x41')](_0x5263a9);})[_0x9f52('0x26')](function(_0x36384b){_0x344c9c[_0x9f52('0x42')]=_0x36384b;return _0x344c9c;})[_0x9f52('0x26')](respondWithFilteredResult(_0x4557f1,_0x5263a9))[_0x9f52('0x43')](handleError(_0x4557f1,null));};exports[_0x9f52('0x44')]=function(_0x2f54b7,_0x32affe){var _0x38529a={'raw':!![],'where':{'id':_0x2f54b7['params']['id']}},_0x4c52ea={};_0x4c52ea['model']=_[_0x9f52('0x45')](db[_0x9f52('0x2d')][_0x9f52('0x46')]);_0x4c52ea[_0x9f52('0x32')]=_[_0x9f52('0x45')](_0x2f54b7['query']);_0x4c52ea[_0x9f52('0x33')]=_[_0x9f52('0x35')](_0x4c52ea[_0x9f52('0x31')],_0x4c52ea[_0x9f52('0x32')]);_0x38529a['attributes']=_[_0x9f52('0x35')](_0x4c52ea[_0x9f52('0x31')],qs[_0x9f52('0x36')](_0x2f54b7[_0x9f52('0x32')]['fields']));_0x38529a[_0x9f52('0x34')]=_0x38529a[_0x9f52('0x34')][_0x9f52('0x37')]?_0x38529a[_0x9f52('0x34')]:_0x4c52ea[_0x9f52('0x31')];if(_0x2f54b7[_0x9f52('0x32')][_0x9f52('0x40')]){_0x38529a[_0x9f52('0x47')]=[{'all':!![]}];}_0x38529a=_['merge']({},_0x38529a,_0x2f54b7[_0x9f52('0x3f')]);return db[_0x9f52('0x2d')][_0x9f52('0x48')](_0x38529a)[_0x9f52('0x26')](handleEntityNotFound(_0x32affe,null))[_0x9f52('0x26')](respondWithResult(_0x32affe,null))[_0x9f52('0x43')](handleError(_0x32affe,null));};exports['create']=function(_0x57708b,_0x215378){return db[_0x9f52('0x2d')][_0x9f52('0x49')](_0x57708b[_0x9f52('0x4a')],{})[_0x9f52('0x26')](respondWithResult(_0x215378,0xc9))[_0x9f52('0x43')](handleError(_0x215378,null));};exports['update']=function(_0x2cffce,_0x46804b){if(_0x2cffce['body']['id']){delete _0x2cffce[_0x9f52('0x4a')]['id'];}return db[_0x9f52('0x2d')][_0x9f52('0x48')]({'where':{'id':_0x2cffce['params']['id']}})[_0x9f52('0x26')](handleEntityNotFound(_0x46804b,null))[_0x9f52('0x26')](saveUpdates(_0x2cffce['body'],null))[_0x9f52('0x26')](respondWithResult(_0x46804b,null))[_0x9f52('0x43')](handleError(_0x46804b,null));};exports[_0x9f52('0x25')]=function(_0x3c088f,_0x897add){return db[_0x9f52('0x2d')][_0x9f52('0x48')]({'where':{'id':_0x3c088f[_0x9f52('0x4b')]['id']}})[_0x9f52('0x26')](handleEntityNotFound(_0x897add,null))[_0x9f52('0x26')](removeEntity(_0x897add,null))['catch'](handleError(_0x897add,null));}; \ No newline at end of file +var _0x0519=['../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x0519,0x1bb));var _0x9051=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0519[_0x3c4dad];return _0x1a4f49;};'use strict';var emlformat=require(_0x9051('0x0'));var rimraf=require(_0x9051('0x1'));var zipdir=require(_0x9051('0x2'));var jsonpatch=require(_0x9051('0x3'));var rp=require(_0x9051('0x4'));var moment=require(_0x9051('0x5'));var BPromise=require(_0x9051('0x6'));var Mustache=require('mustache');var util=require(_0x9051('0x7'));var path=require(_0x9051('0x8'));var sox=require(_0x9051('0x9'));var csv=require(_0x9051('0xa'));var ejs=require(_0x9051('0xb'));var fs=require('fs');var fs_extra=require(_0x9051('0xc'));var _=require('lodash');var squel=require(_0x9051('0xd'));var crypto=require(_0x9051('0xe'));var jsforce=require(_0x9051('0xf'));var deskjs=require(_0x9051('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9051('0x11'));var Papa=require(_0x9051('0x12'));var Redis=require('ioredis');var authService=require(_0x9051('0x13'));var qs=require(_0x9051('0x14'));var as=require(_0x9051('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9051('0x16'));var utils=require(_0x9051('0x17'));var config=require(_0x9051('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9051('0x19'))['db'];function respondWithStatusCode(_0x351184,_0x362de3){_0x362de3=_0x362de3||0xcc;return function(_0x227e42){if(_0x227e42){return _0x351184['sendStatus'](_0x362de3);}return _0x351184['status'](_0x362de3)[_0x9051('0x1a')]();};}function respondWithResult(_0x343725,_0x522712){_0x522712=_0x522712||0xc8;return function(_0x4b7a6d){if(_0x4b7a6d){return _0x343725[_0x9051('0x1b')](_0x522712)[_0x9051('0x1c')](_0x4b7a6d);}};}function respondWithFilteredResult(_0x11dbed,_0x10d052){return function(_0x1a2ab0){if(_0x1a2ab0){var _0x595d44=typeof _0x10d052['offset']==='undefined'&&typeof _0x10d052['limit']===_0x9051('0x1d');var _0x3bb718=_0x1a2ab0[_0x9051('0x1e')];var _0x32beb5=_0x595d44?0x0:_0x10d052['offset'];var _0xd1c44e=_0x595d44?_0x1a2ab0[_0x9051('0x1e')]:_0x10d052[_0x9051('0x1f')]+_0x10d052[_0x9051('0x20')];var _0x273390;if(_0xd1c44e>=_0x3bb718){_0xd1c44e=_0x3bb718;_0x273390=0xc8;}else{_0x273390=0xce;}_0x11dbed[_0x9051('0x1b')](_0x273390);return _0x11dbed[_0x9051('0x21')](_0x9051('0x22'),_0x32beb5+'-'+_0xd1c44e+'/'+_0x3bb718)[_0x9051('0x1c')](_0x1a2ab0);}return null;};}function patchUpdates(_0x57fe84){return function(_0x264164){try{jsonpatch[_0x9051('0x23')](_0x264164,_0x57fe84,!![]);}catch(_0x24ec47){return BPromise[_0x9051('0x24')](_0x24ec47);}return _0x264164[_0x9051('0x25')]();};}function saveUpdates(_0x7dc905,_0x140b0e){return function(_0x306767){if(_0x306767){return _0x306767[_0x9051('0x26')](_0x7dc905)[_0x9051('0x27')](function(_0x416ce4){return _0x416ce4;});}return null;};}function removeEntity(_0x52f60d,_0x14a246){return function(_0x15893c){if(_0x15893c){return _0x15893c[_0x9051('0x28')]()['then'](function(){_0x52f60d[_0x9051('0x1b')](0xcc)[_0x9051('0x1a')]();});}};}function handleEntityNotFound(_0x174245,_0x2ed465){return function(_0x1b0e1a){if(!_0x1b0e1a){_0x174245[_0x9051('0x29')](0x194);}return _0x1b0e1a;};}function handleError(_0x14d1e7,_0x50a447){_0x50a447=_0x50a447||0x1f4;return function(_0x543867){logger[_0x9051('0x2a')](_0x543867[_0x9051('0x2b')]);if(_0x543867[_0x9051('0x2c')]){delete _0x543867['name'];}_0x14d1e7[_0x9051('0x1b')](_0x50a447)['send'](_0x543867);};}exports[_0x9051('0x2d')]=function(_0x87168b,_0x1c2b30){var _0x11e724={},_0x4ec10f={},_0x45990a={'count':0x0,'rows':[]};var _0x59afde=_[_0x9051('0x2e')](db[_0x9051('0x2f')][_0x9051('0x30')],function(_0x15e192){return{'name':_0x15e192[_0x9051('0x31')],'type':_0x15e192['type'][_0x9051('0x32')]};});_0x4ec10f['model']=_[_0x9051('0x2e')](_0x59afde,_0x9051('0x2c'));_0x4ec10f[_0x9051('0x33')]=_[_0x9051('0x34')](_0x87168b['query']);_0x4ec10f[_0x9051('0x35')]=_[_0x9051('0x36')](_0x4ec10f[_0x9051('0x37')],_0x4ec10f[_0x9051('0x33')]);_0x11e724[_0x9051('0x38')]=_[_0x9051('0x36')](_0x4ec10f[_0x9051('0x37')],qs[_0x9051('0x39')](_0x87168b['query'][_0x9051('0x39')]));_0x11e724['attributes']=_0x11e724[_0x9051('0x38')]['length']?_0x11e724[_0x9051('0x38')]:_0x4ec10f['model'];if(!_0x87168b[_0x9051('0x33')]['hasOwnProperty'](_0x9051('0x3a'))){_0x11e724[_0x9051('0x20')]=qs[_0x9051('0x20')](_0x87168b[_0x9051('0x33')]['limit']);_0x11e724[_0x9051('0x1f')]=qs[_0x9051('0x1f')](_0x87168b[_0x9051('0x33')][_0x9051('0x1f')]);}_0x11e724[_0x9051('0x3b')]=qs['sort'](_0x87168b['query'][_0x9051('0x3c')]);_0x11e724[_0x9051('0x3d')]=qs[_0x9051('0x35')](_[_0x9051('0x3e')](_0x87168b[_0x9051('0x33')],_0x4ec10f[_0x9051('0x35')]),_0x59afde);if(_0x87168b[_0x9051('0x33')][_0x9051('0x3f')]){_0x11e724[_0x9051('0x3d')]=_[_0x9051('0x40')](_0x11e724[_0x9051('0x3d')],{'$or':_[_0x9051('0x2e')](_0x59afde,function(_0x564bd7){if(_0x564bd7['type']!==_0x9051('0x41')){var _0x406d3d={};_0x406d3d[_0x564bd7[_0x9051('0x2c')]]={'$like':'%'+_0x87168b[_0x9051('0x33')][_0x9051('0x3f')]+'%'};return _0x406d3d;}})});}_0x11e724=_[_0x9051('0x40')]({},_0x11e724,_0x87168b[_0x9051('0x42')]);var _0x13601c={'where':_0x11e724['where']};return db[_0x9051('0x2f')]['count'](_0x13601c)[_0x9051('0x27')](function(_0x2f4c43){_0x45990a[_0x9051('0x1e')]=_0x2f4c43;if(_0x87168b[_0x9051('0x33')][_0x9051('0x43')]){_0x11e724[_0x9051('0x44')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x9051('0x45')](_0x11e724);})['then'](function(_0x2b2d86){_0x45990a[_0x9051('0x46')]=_0x2b2d86;return _0x45990a;})[_0x9051('0x27')](respondWithFilteredResult(_0x1c2b30,_0x11e724))[_0x9051('0x47')](handleError(_0x1c2b30,null));};exports[_0x9051('0x48')]=function(_0x5e6e3d,_0xbf58f7){var _0x3cb6a0={'raw':!![],'where':{'id':_0x5e6e3d[_0x9051('0x49')]['id']}},_0x43132f={};_0x43132f[_0x9051('0x37')]=_[_0x9051('0x34')](db[_0x9051('0x2f')][_0x9051('0x30')]);_0x43132f[_0x9051('0x33')]=_['keys'](_0x5e6e3d['query']);_0x43132f[_0x9051('0x35')]=_['intersection'](_0x43132f[_0x9051('0x37')],_0x43132f[_0x9051('0x33')]);_0x3cb6a0[_0x9051('0x38')]=_[_0x9051('0x36')](_0x43132f[_0x9051('0x37')],qs[_0x9051('0x39')](_0x5e6e3d[_0x9051('0x33')][_0x9051('0x39')]));_0x3cb6a0[_0x9051('0x38')]=_0x3cb6a0[_0x9051('0x38')][_0x9051('0x4a')]?_0x3cb6a0[_0x9051('0x38')]:_0x43132f[_0x9051('0x37')];if(_0x5e6e3d['query']['includeAll']){_0x3cb6a0[_0x9051('0x44')]=[{'all':!![]}];}_0x3cb6a0=_[_0x9051('0x40')]({},_0x3cb6a0,_0x5e6e3d[_0x9051('0x42')]);return db['OpenchannelApplication']['find'](_0x3cb6a0)['then'](handleEntityNotFound(_0xbf58f7,null))[_0x9051('0x27')](respondWithResult(_0xbf58f7,null))[_0x9051('0x47')](handleError(_0xbf58f7,null));};exports[_0x9051('0x4b')]=function(_0x182855,_0x1c4ca6){return db[_0x9051('0x2f')][_0x9051('0x4b')](_0x182855[_0x9051('0x4c')],{})[_0x9051('0x27')](respondWithResult(_0x1c4ca6,0xc9))['catch'](handleError(_0x1c4ca6,null));};exports[_0x9051('0x26')]=function(_0x3e5f57,_0x1c6db3){if(_0x3e5f57['body']['id']){delete _0x3e5f57['body']['id'];}return db[_0x9051('0x2f')][_0x9051('0x4d')]({'where':{'id':_0x3e5f57[_0x9051('0x49')]['id']}})[_0x9051('0x27')](handleEntityNotFound(_0x1c6db3,null))[_0x9051('0x27')](saveUpdates(_0x3e5f57['body'],null))[_0x9051('0x27')](respondWithResult(_0x1c6db3,null))[_0x9051('0x47')](handleError(_0x1c6db3,null));};exports['destroy']=function(_0x4c6e94,_0xd3922e){return db['OpenchannelApplication']['find']({'where':{'id':_0x4c6e94[_0x9051('0x49')]['id']}})[_0x9051('0x27')](handleEntityNotFound(_0xd3922e,null))['then'](removeEntity(_0xd3922e,null))[_0x9051('0x47')](handleError(_0xd3922e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index eaebfd5..ae37a30 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 _0x2477=['bluebird','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x13d929,_0xab3e09){var _0x27eb3b=function(_0x4690e9){while(--_0x4690e9){_0x13d929['push'](_0x13d929['shift']());}};_0x27eb3b(++_0xab3e09);}(_0x2477,0x134));var _0x7247=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x2477[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x7247('0x0'));var util=require('util');var logger=require(_0x7247('0x1'))(_0x7247('0x2'));var moment=require(_0x7247('0x3'));var BPromise=require(_0x7247('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7247('0x5'));var config=require(_0x7247('0x6'));var attributes=require(_0x7247('0x7'));module[_0x7247('0x8')]=function(_0x3b4ac6,_0x22533b){return _0x3b4ac6['define'](_0x7247('0x9'),attributes,{'tableName':_0x7247('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7247('0xb'),'collate':_0x7247('0xc')});}; \ No newline at end of file +var _0xf391=['bluebird','request-promise','../../config/environment','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','util','api','moment'];(function(_0x1cc555,_0x39d154){var _0x442a72=function(_0x156f3a){while(--_0x156f3a){_0x1cc555['push'](_0x1cc555['shift']());}};_0x442a72(++_0x39d154);}(_0xf391,0x1d3));var _0x1f39=function(_0x3e3905,_0x574a7c){_0x3e3905=_0x3e3905-0x0;var _0x6c62e3=_0xf391[_0x3e3905];return _0x6c62e3;};'use strict';var _=require('lodash');var util=require(_0x1f39('0x0'));var logger=require('../../config/logger')(_0x1f39('0x1'));var moment=require(_0x1f39('0x2'));var BPromise=require(_0x1f39('0x3'));var rp=require(_0x1f39('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f39('0x5'));var attributes=require(_0x1f39('0x6'));module[_0x1f39('0x7')]=function(_0x385d0f,_0x339c1a){return _0x385d0f['define']('OpenchannelApplication',attributes,{'tableName':_0x1f39('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f39('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 62fca10..28c0589 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 _0xdd89=['then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x12e22b,_0x52f025){var _0x2a6eb8=function(_0x47dd4){while(--_0x47dd4){_0x12e22b['push'](_0x12e22b['shift']());}};_0x2a6eb8(++_0x52f025);}(_0xdd89,0xcb));var _0x9dd8=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0xdd89[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x9dd8('0x0'));var util=require(_0x9dd8('0x1'));var moment=require(_0x9dd8('0x2'));var BPromise=require(_0x9dd8('0x3'));var rs=require(_0x9dd8('0x4'));var fs=require('fs');var Redis=require(_0x9dd8('0x5'));var db=require(_0x9dd8('0x6'))['db'];var utils=require(_0x9dd8('0x7'));var logger=require(_0x9dd8('0x8'))(_0x9dd8('0x9'));var config=require(_0x9dd8('0xa'));var jayson=require(_0x9dd8('0xb'));var client=jayson[_0x9dd8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38daea,_0xbf28f,_0x44f5a7){return new BPromise(function(_0xf84ecc,_0x762d12){return client[_0x9dd8('0xd')](_0x38daea,_0x44f5a7)[_0x9dd8('0xe')](function(_0x569c9c){logger[_0x9dd8('0xf')](_0x9dd8('0x10'),_0xbf28f,'request\x20sent');logger[_0x9dd8('0x11')](_0x9dd8('0x12'),_0xbf28f,_0x9dd8('0x13'),JSON['stringify'](_0x569c9c));if(_0x569c9c[_0x9dd8('0x14')]){if(_0x569c9c['error'][_0x9dd8('0x15')]===0x1f4){logger['error'](_0x9dd8('0x10'),_0xbf28f,_0x569c9c[_0x9dd8('0x14')][_0x9dd8('0x16')]);return _0x762d12(_0x569c9c[_0x9dd8('0x14')][_0x9dd8('0x16')]);}logger[_0x9dd8('0x14')](_0x9dd8('0x10'),_0xbf28f,_0x569c9c[_0x9dd8('0x14')]['message']);return _0xf84ecc(_0x569c9c[_0x9dd8('0x14')]['message']);}else{logger[_0x9dd8('0xf')](_0x9dd8('0x10'),_0xbf28f,_0x9dd8('0x13'));_0xf84ecc(_0x569c9c['result'][_0x9dd8('0x16')]);}})[_0x9dd8('0x17')](function(_0x36a101){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0xbf28f,_0x36a101);_0x762d12(_0x36a101);});});}exports[_0x9dd8('0x18')]=function(_0x23b83a){var _0x431295=this;return new Promise(function(_0x3a2e68,_0x357202){return db['OpenchannelApplication']['update'](_0x23b83a[_0x9dd8('0x19')],{'raw':_0x23b83a[_0x9dd8('0x1a')]?_0x23b83a[_0x9dd8('0x1a')][_0x9dd8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b83a[_0x9dd8('0x1a')]?_0x23b83a[_0x9dd8('0x1a')][_0x9dd8('0x1c')]||null:null,'attributes':_0x23b83a['options']?_0x23b83a[_0x9dd8('0x1a')][_0x9dd8('0x1d')]||null:null,'limit':_0x23b83a[_0x9dd8('0x1a')]?_0x23b83a[_0x9dd8('0x1a')]['limit']||null:null})[_0x9dd8('0xe')](function(_0x1d46db){logger[_0x9dd8('0xf')](_0x9dd8('0x18'),_0x23b83a);logger[_0x9dd8('0x11')](_0x9dd8('0x18'),_0x23b83a,JSON[_0x9dd8('0x1e')](_0x1d46db));_0x3a2e68(_0x1d46db);})[_0x9dd8('0x17')](function(_0x12a8ab){logger[_0x9dd8('0x14')](_0x9dd8('0x18'),_0x12a8ab[_0x9dd8('0x16')],_0x23b83a);_0x357202(_0x431295[_0x9dd8('0x14')](0x1f4,_0x12a8ab[_0x9dd8('0x16')]));});});}; \ No newline at end of file +var _0xe7c6=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','then','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x4d171c,_0x1163b8){var _0x104420=function(_0x454c19){while(--_0x454c19){_0x4d171c['push'](_0x4d171c['shift']());}};_0x104420(++_0x1163b8);}(_0xe7c6,0xa8));var _0x6e7c=function(_0xbf963c,_0xddc291){_0xbf963c=_0xbf963c-0x0;var _0x451c5d=_0xe7c6[_0xbf963c];return _0x451c5d;};'use strict';var _=require('lodash');var util=require(_0x6e7c('0x0'));var moment=require(_0x6e7c('0x1'));var BPromise=require(_0x6e7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e7c('0x3'));var db=require(_0x6e7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e7c('0x5'))(_0x6e7c('0x6'));var config=require(_0x6e7c('0x7'));var jayson=require(_0x6e7c('0x8'));var client=jayson[_0x6e7c('0x9')][_0x6e7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbcba22,_0x20e6a3,_0x175514){return new BPromise(function(_0x1f8530,_0x4ab35e){return client['request'](_0xbcba22,_0x175514)['then'](function(_0x1a99f7){logger[_0x6e7c('0xb')](_0x6e7c('0xc'),_0x20e6a3,_0x6e7c('0xd'));logger['debug'](_0x6e7c('0xe'),_0x20e6a3,'request\x20sent',JSON[_0x6e7c('0xf')](_0x1a99f7));if(_0x1a99f7[_0x6e7c('0x10')]){if(_0x1a99f7[_0x6e7c('0x10')][_0x6e7c('0x11')]===0x1f4){logger['error'](_0x6e7c('0xc'),_0x20e6a3,_0x1a99f7[_0x6e7c('0x10')][_0x6e7c('0x12')]);return _0x4ab35e(_0x1a99f7['error'][_0x6e7c('0x12')]);}logger[_0x6e7c('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x20e6a3,_0x1a99f7[_0x6e7c('0x10')][_0x6e7c('0x12')]);return _0x1f8530(_0x1a99f7[_0x6e7c('0x10')][_0x6e7c('0x12')]);}else{logger['info'](_0x6e7c('0xc'),_0x20e6a3,_0x6e7c('0xd'));_0x1f8530(_0x1a99f7['result']['message']);}})[_0x6e7c('0x13')](function(_0x286a54){logger['error'](_0x6e7c('0xc'),_0x20e6a3,_0x286a54);_0x4ab35e(_0x286a54);});});}exports[_0x6e7c('0x14')]=function(_0x911a4b){var _0x597495=this;return new Promise(function(_0x31c730,_0x4fe0c3){return db[_0x6e7c('0x15')][_0x6e7c('0x16')](_0x911a4b[_0x6e7c('0x17')],{'raw':_0x911a4b[_0x6e7c('0x18')]?_0x911a4b[_0x6e7c('0x18')][_0x6e7c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x911a4b[_0x6e7c('0x18')]?_0x911a4b['options'][_0x6e7c('0x1a')]||null:null,'attributes':_0x911a4b[_0x6e7c('0x18')]?_0x911a4b[_0x6e7c('0x18')]['attributes']||null:null,'limit':_0x911a4b[_0x6e7c('0x18')]?_0x911a4b[_0x6e7c('0x18')][_0x6e7c('0x1b')]||null:null})[_0x6e7c('0x1c')](function(_0x5b9016){logger['info'](_0x6e7c('0x14'),_0x911a4b);logger[_0x6e7c('0x1d')](_0x6e7c('0x14'),_0x911a4b,JSON[_0x6e7c('0xf')](_0x5b9016));_0x31c730(_0x5b9016);})[_0x6e7c('0x13')](function(_0xf0fe0b){logger[_0x6e7c('0x10')]('UpdateOpenchannelApplication',_0xf0fe0b['message'],_0x911a4b);_0x4fe0c3(_0x597495[_0x6e7c('0x10')](0x1f4,_0xf0fe0b[_0x6e7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index e242a66..c84f1f2 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 _0x3708=['addMessage','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/:id','show','/:id/messages','/:id/download','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3708,0x1cb));var _0x8370=function(_0x44f481,_0x307be6){_0x44f481=_0x44f481-0x0;var _0x1462f7=_0x3708[_0x44f481];return _0x1462f7;};'use strict';var multer=require(_0x8370('0x0'));var util=require('util');var path=require(_0x8370('0x1'));var timeout=require(_0x8370('0x2'));var express=require(_0x8370('0x3'));var router=express[_0x8370('0x4')]();var fs_extra=require(_0x8370('0x5'));var auth=require(_0x8370('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8370('0x7'));var controller=require(_0x8370('0x8'));router[_0x8370('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8370('0x9')]('/describe',auth[_0x8370('0xa')](),controller['describe']);router['get'](_0x8370('0xb'),auth['isAuthenticated'](),controller[_0x8370('0xc')]);router[_0x8370('0x9')](_0x8370('0xd'),auth[_0x8370('0xa')](),controller['getMessages']);router[_0x8370('0x9')](_0x8370('0xe'),auth[_0x8370('0xa')](),controller['download']);router[_0x8370('0xf')]('/',auth[_0x8370('0xa')](),controller[_0x8370('0x10')]);router[_0x8370('0xf')](_0x8370('0xd'),auth['isAuthenticated'](),controller[_0x8370('0x11')]);router[_0x8370('0xf')]('/:id/tags',auth[_0x8370('0xa')](),interaction[_0x8370('0x12')](_0x8370('0x13'),'openchannelinteraction:addtags'),controller[_0x8370('0x14')]);router[_0x8370('0x15')](_0x8370('0xb'),auth[_0x8370('0xa')](),interaction[_0x8370('0x12')]('openchannel',_0x8370('0x16')),controller[_0x8370('0x17')]);router[_0x8370('0x18')](_0x8370('0xb'),auth[_0x8370('0xa')](),interaction[_0x8370('0x12')](_0x8370('0x13'),'openchannelinteraction:destroy'),controller[_0x8370('0x19')]);router['delete']('/:id/tags',auth[_0x8370('0xa')](),controller[_0x8370('0x1a')]);module[_0x8370('0x1b')]=router; \ No newline at end of file +var _0x2f46=['./openchannelInteraction.controller','isAuthenticated','get','describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2f46,0x118));var _0x62f4=function(_0x33c60d,_0x13ebf2){_0x33c60d=_0x33c60d-0x0;var _0x1d852f=_0x2f46[_0x33c60d];return _0x1d852f;};'use strict';var multer=require(_0x62f4('0x0'));var util=require(_0x62f4('0x1'));var path=require(_0x62f4('0x2'));var timeout=require(_0x62f4('0x3'));var express=require(_0x62f4('0x4'));var router=express[_0x62f4('0x5')]();var fs_extra=require(_0x62f4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x62f4('0x7'));var config=require('../../config/environment');var controller=require(_0x62f4('0x8'));router['get']('/',auth[_0x62f4('0x9')](),controller['index']);router[_0x62f4('0xa')]('/describe',auth[_0x62f4('0x9')](),controller[_0x62f4('0xb')]);router[_0x62f4('0xa')](_0x62f4('0xc'),auth[_0x62f4('0x9')](),controller['show']);router[_0x62f4('0xa')](_0x62f4('0xd'),auth[_0x62f4('0x9')](),controller['getMessages']);router[_0x62f4('0xa')](_0x62f4('0xe'),auth[_0x62f4('0x9')](),controller[_0x62f4('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x62f4('0x10')]);router[_0x62f4('0x11')](_0x62f4('0xd'),auth[_0x62f4('0x9')](),controller[_0x62f4('0x12')]);router[_0x62f4('0x11')](_0x62f4('0x13'),auth['isAuthenticated'](),interaction[_0x62f4('0x14')](_0x62f4('0x15'),_0x62f4('0x16')),controller[_0x62f4('0x17')]);router[_0x62f4('0x18')]('/:id',auth[_0x62f4('0x9')](),interaction[_0x62f4('0x14')]('openchannel',_0x62f4('0x19')),controller[_0x62f4('0x1a')]);router[_0x62f4('0x1b')](_0x62f4('0xc'),auth[_0x62f4('0x9')](),interaction[_0x62f4('0x14')]('openchannel',_0x62f4('0x1c')),controller[_0x62f4('0x1d')]);router['delete']('/:id/tags',auth[_0x62f4('0x9')](),controller[_0x62f4('0x1e')]);module[_0x62f4('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 d751a62..77598c4 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 _0xe57e=['ENUM','out','sequelize','BOOLEAN','DATE','STRING'];(function(_0x1e234f,_0x7da15d){var _0x5cfdab=function(_0x4d060a){while(--_0x4d060a){_0x1e234f['push'](_0x1e234f['shift']());}};_0x5cfdab(++_0x7da15d);}(_0xe57e,0xf2));var _0xee57=function(_0x4a9c8a,_0x2f82ee){_0x4a9c8a=_0x4a9c8a-0x0;var _0x439cc7=_0xe57e[_0x4a9c8a];return _0x439cc7;};'use strict';var Sequelize=require(_0xee57('0x0'));module['exports']={'closed':{'type':Sequelize[_0xee57('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xee57('0x2')]},'disposition':{'type':Sequelize[_0xee57('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xee57('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xee57('0x3')]},'externalUrl':{'type':Sequelize[_0xee57('0x3')]},'lastMsgAt':{'type':Sequelize[_0xee57('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xee57('0x4')]('in',_0xee57('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xee57('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xee57('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x121d=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x121d,0xea));var _0xd121=function(_0x17de13,_0x5a71a2){_0x17de13=_0x17de13-0x0;var _0x1dc96c=_0x121d[_0x17de13];return _0x1dc96c;};'use strict';var Sequelize=require(_0xd121('0x0'));module[_0xd121('0x1')]={'closed':{'type':Sequelize[_0xd121('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd121('0x3')]},'disposition':{'type':Sequelize[_0xd121('0x4')]},'secondDisposition':{'type':Sequelize[_0xd121('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd121('0x4')]},'note':{'type':Sequelize[_0xd121('0x4')]},'read1stAt':{'type':Sequelize[_0xd121('0x3')]},'threadId':{'type':Sequelize[_0xd121('0x4')]},'externalUrl':{'type':Sequelize[_0xd121('0x4')]},'lastMsgAt':{'type':Sequelize[_0xd121('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xd121('0x5')]('in',_0xd121('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd121('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xd121('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index a68de7a..d7642f2 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 _0xa74d=['getOptions','findAll','openchannel','query','user','catch','show','from','params','model','rawAttributes','keys','intersection','attributes','fields','length','include','merge','options','find','create','update','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','pick','OpenchannelInteractionId','where','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','OpenchannelAccount','Account','get','mkdirSync','Owner','N.A.','closed','closedAt','disposition','threadId','Private','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','value','renderFile','views','downloadInteraction.ejs','transcript-','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','map','OpenchannelInteraction','type'];(function(_0x1dd6eb,_0x40feb4){var _0x288435=function(_0x3ca654){while(--_0x3ca654){_0x1dd6eb['push'](_0x1dd6eb['shift']());}};_0x288435(++_0x40feb4);}(_0xa74d,0x15f));var _0xda74=function(_0x1c240e,_0x17de31){_0x1c240e=_0x1c240e-0x0;var _0x2026de=_0xa74d[_0x1c240e];return _0x2026de;};'use strict';var rimraf=require(_0xda74('0x0'));var zipdir=require(_0xda74('0x1'));var moment=require(_0xda74('0x2'));var util=require('util');var path=require(_0xda74('0x3'));var ejs=require(_0xda74('0x4'));var fs=require('fs');var _=require(_0xda74('0x5'));var Redis=require(_0xda74('0x6'));var interaction=require(_0xda74('0x7'));var qs=require(_0xda74('0x8'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0xda74('0x9'));var db=require('../../mysqldb')['db'];config[_0xda74('0xa')]=_[_0xda74('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda74('0xc'))(new Redis(config[_0xda74('0xa')]));require('./openchannelInteraction.socket')[_0xda74('0xd')](socket);function respondWithStatusCode(_0x449446,_0x515bcb){_0x515bcb=_0x515bcb||0xcc;return function(_0x21efe9){if(_0x21efe9){return _0x449446[_0xda74('0xe')](_0x515bcb);}return _0x449446[_0xda74('0xf')](_0x515bcb)[_0xda74('0x10')]();};}function respondWithResult(_0x16b620,_0x1e9bb0){_0x1e9bb0=_0x1e9bb0||0xc8;return function(_0x3f11fd){if(_0x3f11fd){return _0x16b620[_0xda74('0xf')](_0x1e9bb0)['json'](_0x3f11fd);}};}function respondWithFilteredResult(_0x40e092,_0x436c8f){return function(_0x1db93e){if(_0x1db93e){var _0x23dd42=typeof _0x436c8f[_0xda74('0x11')]===_0xda74('0x12')&&typeof _0x436c8f[_0xda74('0x13')]===_0xda74('0x12');var _0x2d8082=_0x1db93e[_0xda74('0x14')];var _0x2f35ee=_0x23dd42?0x0:_0x436c8f[_0xda74('0x11')];var _0x3e38a4=_0x23dd42?_0x1db93e['count']:_0x436c8f['offset']+_0x436c8f['limit'];var _0x1e1463;if(_0x3e38a4>=_0x2d8082){_0x3e38a4=_0x2d8082;_0x1e1463=0xc8;}else{_0x1e1463=0xce;}_0x40e092['status'](_0x1e1463);return _0x40e092[_0xda74('0x15')](_0xda74('0x16'),_0x2f35ee+'-'+_0x3e38a4+'/'+_0x2d8082)['json'](_0x1db93e);}return null;};}function saveUpdates(_0x148665){return function(_0x49245a){if(_0x49245a){return _0x49245a['update'](_0x148665)[_0xda74('0x17')](function(_0x5de03e){return _0x5de03e;});}return null;};}function removeEntity(_0x110882){return function(_0x4a4acb){if(_0x4a4acb){return _0x4a4acb[_0xda74('0x18')]()[_0xda74('0x17')](function(){_0x110882['status'](0xcc)[_0xda74('0x10')]();});}};}function handleEntityNotFound(_0x4ef851){return function(_0x45c45e){if(!_0x45c45e){_0x4ef851[_0xda74('0xe')](0x194);}return _0x45c45e;};}function handleError(_0x5ac67b,_0x3d1b34){_0x3d1b34=_0x3d1b34||0x1f4;return function(_0x577033){logger[_0xda74('0x19')](_0x577033['stack']);if(_0x577033[_0xda74('0x1a')]){delete _0x577033['name'];}_0x5ac67b['status'](_0x3d1b34)['send'](_0x577033);};}exports['index']=function(_0x4788f8,_0x26fd8e){var _0x3e0f16={};var _0x4f362a=_[_0xda74('0x1b')](db[_0xda74('0x1c')]['rawAttributes'],function(_0x27a3cf){return{'name':_0x27a3cf['fieldName'],'type':_0x27a3cf[_0xda74('0x1d')]['key']};});_0x3e0f16=qs[_0xda74('0x1e')](_0x4f362a,_0x4788f8);return interaction[_0xda74('0x1f')](_0xda74('0x20'),_0x4788f8[_0xda74('0x21')],_0x4788f8[_0xda74('0x22')],_0x3e0f16,_0x4f362a)[_0xda74('0x17')](respondWithFilteredResult(_0x26fd8e,_0x3e0f16))[_0xda74('0x23')](handleError(_0x26fd8e,null));};exports[_0xda74('0x24')]=function(_0x23e1e1,_0x216361){var _0x977446={};if(_0x23e1e1['query'][_0xda74('0x1d')]&&_0x23e1e1['query'][_0xda74('0x1d')]===_0xda74('0x25')){_0x977446['from']=_0x23e1e1['params']['id'];}else{_0x977446['id']=_0x23e1e1[_0xda74('0x26')]['id'];}var _0x50218e={'raw':![],'where':_0x977446},_0xdfa1ea={};_0xdfa1ea[_0xda74('0x27')]=_['keys'](db[_0xda74('0x1c')][_0xda74('0x28')]);_0xdfa1ea[_0xda74('0x21')]=_[_0xda74('0x29')](_0x23e1e1[_0xda74('0x21')]);_0xdfa1ea['filters']=_[_0xda74('0x2a')](_0xdfa1ea[_0xda74('0x27')],_0xdfa1ea[_0xda74('0x21')]);_0x50218e[_0xda74('0x2b')]=_['intersection'](_0xdfa1ea[_0xda74('0x27')],qs['fields'](_0x23e1e1[_0xda74('0x21')][_0xda74('0x2c')]));_0x50218e['attributes']=_0x50218e[_0xda74('0x2b')][_0xda74('0x2d')]?_0x50218e[_0xda74('0x2b')]:_0xdfa1ea[_0xda74('0x27')];if(_0x23e1e1[_0xda74('0x21')]['includeAll']){_0x50218e[_0xda74('0x2e')]=[{'all':!![]}];}_0x50218e=_[_0xda74('0x2f')]({},_0x50218e,_0x23e1e1[_0xda74('0x30')]);return db[_0xda74('0x1c')][_0xda74('0x31')](_0x50218e)[_0xda74('0x17')](handleEntityNotFound(_0x216361,null))[_0xda74('0x17')](respondWithResult(_0x216361,null))['catch'](handleError(_0x216361,null));};exports[_0xda74('0x32')]=function(_0x4fe94e,_0x265c00){return db[_0xda74('0x1c')][_0xda74('0x32')](_0x4fe94e['body'],{})['then'](respondWithResult(_0x265c00,0xc9))[_0xda74('0x23')](handleError(_0x265c00,null));};exports[_0xda74('0x33')]=function(_0x51108d,_0x12b4ff){if(_0x51108d[_0xda74('0x34')]['id']){delete _0x51108d[_0xda74('0x34')]['id'];}return db[_0xda74('0x1c')][_0xda74('0x31')]({'where':{'id':_0x51108d[_0xda74('0x26')]['id']}})[_0xda74('0x17')](handleEntityNotFound(_0x12b4ff,null))['then'](saveUpdates(_0x51108d[_0xda74('0x34')],null))[_0xda74('0x17')](respondWithResult(_0x12b4ff,null))[_0xda74('0x23')](handleError(_0x12b4ff,null));};exports['destroy']=function(_0x1f3a9c,_0x4130ec){return db[_0xda74('0x1c')][_0xda74('0x31')]({'where':{'id':_0x1f3a9c['params']['id']}})[_0xda74('0x17')](handleEntityNotFound(_0x4130ec,null))[_0xda74('0x17')](removeEntity(_0x4130ec,null))['catch'](handleError(_0x4130ec,null));};exports[_0xda74('0x35')]=function(_0x2435eb,_0x4dc500){return db[_0xda74('0x1c')][_0xda74('0x35')]()[_0xda74('0x17')](respondWithResult(_0x4dc500,null))[_0xda74('0x23')](handleError(_0x4dc500,null));};exports[_0xda74('0x36')]=function(_0x537ade,_0x5edc0a){return db[_0xda74('0x37')][_0xda74('0x31')]({'where':{'id':_0x537ade[_0xda74('0x26')]['id']}})['then'](handleEntityNotFound(_0x5edc0a,null))[_0xda74('0x17')](function(_0x305f4f){if(_0x305f4f){return _0x305f4f['addMessage'](_0x537ade[_0xda74('0x34')]['ids'],_[_0xda74('0x38')](_0x537ade[_0xda74('0x34')],[_0xda74('0x39'),'id'])||{});}})['then'](respondWithResult(_0x5edc0a,null))[_0xda74('0x23')](handleError(_0x5edc0a,null));};exports[_0xda74('0x3a')]=function(_0x3428c9,_0xf8a3ca){var _0x74200a={'raw':![],'where':{}};var _0x22b662={};var _0x326cec={'count':0x0,'rows':[]};return db[_0xda74('0x1c')][_0xda74('0x3b')]({'where':{'id':_0x3428c9[_0xda74('0x26')]['id']}})['then'](handleEntityNotFound(_0xf8a3ca,null))[_0xda74('0x17')](function(_0x7020de){if(_0x7020de){_0x22b662['model']=_[_0xda74('0x29')](db[_0xda74('0x37')][_0xda74('0x28')]);_0x22b662['query']=_['keys'](_0x3428c9[_0xda74('0x21')]);_0x22b662[_0xda74('0x3c')]=_['intersection'](_0x22b662[_0xda74('0x27')],_0x22b662[_0xda74('0x21')]);_0x74200a[_0xda74('0x2b')]=_[_0xda74('0x2a')](_0x22b662[_0xda74('0x27')],qs[_0xda74('0x2c')](_0x3428c9[_0xda74('0x21')][_0xda74('0x2c')]));_0x74200a[_0xda74('0x2b')]=_0x74200a[_0xda74('0x2b')]['length']?_0x74200a[_0xda74('0x2b')]:_0x22b662[_0xda74('0x27')];if(!_0x3428c9[_0xda74('0x21')][_0xda74('0x3d')](_0xda74('0x3e'))){_0x74200a[_0xda74('0x13')]=qs[_0xda74('0x13')](_0x3428c9[_0xda74('0x21')][_0xda74('0x13')]);_0x74200a[_0xda74('0x11')]=qs[_0xda74('0x11')](_0x3428c9[_0xda74('0x21')]['offset']);}_0x74200a[_0xda74('0x3f')]=qs['sort'](_0x3428c9[_0xda74('0x21')][_0xda74('0x40')]);_0x74200a['where']=qs[_0xda74('0x3c')](_[_0xda74('0x41')](_0x3428c9[_0xda74('0x21')],_0x22b662[_0xda74('0x3c')]));_0x74200a['where'][_0xda74('0x42')]=_0x7020de['id'];if(_0x3428c9[_0xda74('0x21')]['filter']){_0x74200a['where']=_[_0xda74('0x2f')](_0x74200a[_0xda74('0x43')],{'$or':_[_0xda74('0x1b')](_0x74200a[_0xda74('0x2b')],function(_0x4ef244){var _0xbffffc={};_0xbffffc[_0x4ef244]={'$like':'%'+_0x3428c9[_0xda74('0x21')][_0xda74('0x44')]+'%'};return _0xbffffc;})});}if(_0x3428c9[_0xda74('0x21')][_0xda74('0x45')]){var _0x340de4=_0x3428c9[_0xda74('0x21')][_0xda74('0x45')]['split'](',');var _0x12c088={};_0x12c088[_0x340de4[0x0]]={'$gte':moment(_0x340de4[0x1])[_0xda74('0x46')](_0xda74('0x47'))};_0x74200a['where']=_[_0xda74('0x2f')](_0x74200a[_0xda74('0x43')],_0x12c088);}_0x74200a=_[_0xda74('0x2f')]({},_0x74200a,_0x3428c9[_0xda74('0x30')]);return db[_0xda74('0x37')]['count']({'where':_0x74200a['where']})['then'](function(_0x13461a){_0x326cec[_0xda74('0x14')]=_0x13461a;if(_0x3428c9[_0xda74('0x21')][_0xda74('0x48')]){_0x74200a[_0xda74('0x2e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xda74('0x1f')](_0x74200a);})['then'](function(_0x26f59f){_0x326cec['rows']=_0x26f59f;return _0x326cec;});}})[_0xda74('0x17')](respondWithFilteredResult(_0xf8a3ca,_0x74200a))[_0xda74('0x23')](handleError(_0xf8a3ca,null));};exports['addTags']=function(_0x233e3c,_0x2c7f05){return db[_0xda74('0x1c')][_0xda74('0x31')]({'where':{'id':_0x233e3c[_0xda74('0x26')]['id']}})[_0xda74('0x17')](handleEntityNotFound(_0x2c7f05,null))[_0xda74('0x17')](function(_0xfb498a){if(_0xfb498a){return _0xfb498a[_0xda74('0x49')](_0x233e3c['body'][_0xda74('0x39')],_[_0xda74('0x38')](_0x233e3c[_0xda74('0x34')],[_0xda74('0x39'),'id'])||{})['spread'](function(){return db[_0xda74('0x4a')][_0xda74('0x1f')]({'attributes':['id',_0xda74('0x1a'),_0xda74('0x4b')],'where':{'id':_0x233e3c['body'][_0xda74('0x39')]}});})[_0xda74('0x17')](function(_0x33594d){socket[_0xda74('0x4c')](_0xda74('0x4d'),{'id':Number(_0x233e3c[_0xda74('0x26')]['id']),'tags':_0x33594d||[]});return{'id':Number(_0x233e3c[_0xda74('0x26')]['id']),'tags':_0x33594d||[]};});}})[_0xda74('0x17')](respondWithResult(_0x2c7f05,null))[_0xda74('0x23')](handleError(_0x2c7f05,null));};exports[_0xda74('0x4e')]=function(_0xdae9f9,_0x12b98c){return db['OpenchannelInteraction'][_0xda74('0x31')]({'where':{'id':_0xdae9f9[_0xda74('0x26')]['id']}})[_0xda74('0x17')](handleEntityNotFound(_0x12b98c,null))[_0xda74('0x17')](function(_0x1c2f80){if(_0x1c2f80){return _0x1c2f80[_0xda74('0x4e')](_0xdae9f9[_0xda74('0x21')][_0xda74('0x39')]);}})[_0xda74('0x17')](respondWithStatusCode(_0x12b98c,null))[_0xda74('0x23')](handleError(_0x12b98c,null));};exports[_0xda74('0x4f')]=function(_0x27b1d5,_0x12cd72){var _0x539d1a=moment()[_0xda74('0x50')]()[_0xda74('0x51')]();var _0x2fcc08=path['join'](config[_0xda74('0x52')],_0xda74('0x53'),_0xda74('0x54'),_0xda74('0x55'));var _0x53f3a9=path[_0xda74('0x56')](config[_0xda74('0x52')],_0xda74('0x53'),_0xda74('0x54'),_0xda74('0x57'));var _0x4dcffe=path['join'](_0x2fcc08,_0x539d1a);var _0x2f381d=util[_0xda74('0x46')](_0xda74('0x58'),_0x27b1d5[_0xda74('0x26')]['id'],_0x539d1a);var _0x560741=path['join'](_0x2fcc08,_0x2f381d);var _0x13ed20=[];_0x13ed20[_0xda74('0x59')]({'model':db[_0xda74('0x5a')],'as':_0xda74('0x5a'),'attributes':['id',_0xda74('0x5b')],'raw':!![]});_0x13ed20[_0xda74('0x59')]({'model':db['CmContact'],'as':_0xda74('0x5c'),'attributes':['id',_0xda74('0x5d'),_0xda74('0x5e')],'raw':!![]});if(_0x27b1d5['query'][_0xda74('0x57')]){_0x13ed20[_0xda74('0x59')]({'model':db[_0xda74('0x5f')],'as':_0xda74('0x5f'),'raw':!![]});}var _0x4c184f=[{'model':db[_0xda74('0x37')],'as':_0xda74('0x60'),'attributes':['id',_0xda74('0x34'),_0xda74('0x61'),'direction',_0xda74('0x62'),_0xda74('0x63')],'include':_0x13ed20}];_0x4c184f[_0xda74('0x59')]({'model':db[_0xda74('0x64')],'as':_0xda74('0x65'),'attributes':['id',_0xda74('0x1a')]});_0x4c184f[_0xda74('0x59')]({'model':db[_0xda74('0x5a')],'as':'Owner','attributes':['id',_0xda74('0x5b')]});return db[_0xda74('0x1c')][_0xda74('0x31')]({'where':{'id':_0x27b1d5[_0xda74('0x26')]['id']},'include':_0x4c184f})[_0xda74('0x17')](handleEntityNotFound(_0x12cd72,null))[_0xda74('0x17')](function(_0x1c7103){if(_0x1c7103){var _0x5e1f7e=_0x1c7103[_0xda74('0x66')]({'plain':!![]});fs[_0xda74('0x67')](_0x4dcffe);var _0x1081ee={'channel':'Openchannel','account':_0x5e1f7e['Account'][_0xda74('0x1a')],'agent':_0x5e1f7e[_0xda74('0x68')]?_0x5e1f7e[_0xda74('0x68')][_0xda74('0x5b')]:_0xda74('0x69'),'createdAt':moment(_0x5e1f7e[_0xda74('0x61')])[_0xda74('0x46')](_0xda74('0x47'))['toString'](),'closedAt':_0x5e1f7e[_0xda74('0x6a')]?moment(_0x5e1f7e[_0xda74('0x6b')])[_0xda74('0x46')](_0xda74('0x47'))['toString']():'','disposition':_0x5e1f7e[_0xda74('0x6c')],'visibility':_0x5e1f7e[_0xda74('0x6d')]?'Public':_0xda74('0x6e'),'messages':_(_0x5e1f7e['Messages'])[_0xda74('0x44')]({'secret':![]})[_0xda74('0x1b')](function(_0x5d318b){if(_0x5d318b[_0xda74('0x5f')]){var _0x1ca68f=path['join'](_0x53f3a9,_0x5d318b['Attachment']['basename']);if(fs[_0xda74('0x6f')](_0x1ca68f)){fs[_0xda74('0x70')](_0x1ca68f)[_0xda74('0x71')](fs[_0xda74('0x72')](path[_0xda74('0x56')](_0x4dcffe,_0x5d318b['Attachment'][_0xda74('0x73')])));}}return{'date':moment(_0x5d318b['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xda74('0x51')](),'sender':_0x5d318b[_0xda74('0x74')]===_0xda74('0x75')?_0x5d318b[_0xda74('0x5a')]?_0x5d318b[_0xda74('0x5a')]['fullname']:'System':_0x5d318b[_0xda74('0x5c')]['firstName']+(_0x5d318b['Contact'][_0xda74('0x5e')]?'\x20'+_0x5d318b[_0xda74('0x5c')][_0xda74('0x5e')]:''),'body':_0x5d318b['Attachment']?_0x5d318b[_0xda74('0x5f')][_0xda74('0x73')]:_0x5d318b[_0xda74('0x34')],'direction':_0x5d318b['direction']==='out'?'A':'C','secret':_0x5d318b[_0xda74('0x62')],'read':_0x5d318b['read'],'attachment':_0x5d318b[_0xda74('0x5f')]};})[_0xda74('0x76')]()};return ejs[_0xda74('0x77')](path[_0xda74('0x56')](config[_0xda74('0x52')],_0xda74('0x53'),_0xda74('0x78'),_0xda74('0x79')),{'interaction':_0x1081ee})[_0xda74('0x17')](function(_0x3a9b68){var _0x14679=path[_0xda74('0x56')](_0x4dcffe,_0xda74('0x7a')+_0x5e1f7e['id']+'-'+_0x539d1a+'.pdf');var _0x1b0c82={'path':_0x14679,'channel':_0xda74('0x7b'),'interactionId':_0x5e1f7e['id']};return pdf[_0xda74('0x7c')](_0x3a9b68,_0x1b0c82);})[_0xda74('0x17')](function(){return new Promise(function(_0x15071b,_0x1d6ec1){zipdir(_0x4dcffe,{'saveTo':_0x560741},function(_0x533ca2,_0x575c6b){if(_0x533ca2)return _0x1d6ec1(_0x533ca2);return _0x15071b(_0x575c6b);});})['then'](function(){return new Promise(function(_0x5bd3ea,_0x1e9afd){rimraf(_0x4dcffe,function(_0x1ef6e9){if(_0x1ef6e9)_0x1e9afd(_0x1ef6e9);return _0x5bd3ea();});});})[_0xda74('0x17')](function(){return _0x12cd72[_0xda74('0x4f')](_0x560741,_0x2f381d,function(_0x38ad86){if(_0x38ad86){logger[_0xda74('0x19')](_0xda74('0x7d'),_0x38ad86);}else{fs[_0xda74('0x7e')](_0x560741);}});});});}else{return _0x12cd72[_0xda74('0xe')](0xc8);}})[_0xda74('0x23')](handleError(_0x12cd72,null));}; \ No newline at end of file +var _0xeabe=['YYYY-MM-DD\x20HH:mm:ss','count','includeAll','rows','addTags','setTags','omit','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','get','mkdirSync','Openchannel','Account','Owner','closed','closedAt','disposition','threadId','Public','basename','createReadStream','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','offset','set','Content-Range','update','then','destroy','end','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','catch','from','params','keys','filters','intersection','model','attributes','fields','length','include','options','find','create','body','describe','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','merge','filter','$gte','format'];(function(_0x5c85c6,_0xb3300b){var _0x5df35a=function(_0x57c602){while(--_0x57c602){_0x5c85c6['push'](_0x5c85c6['shift']());}};_0x5df35a(++_0xb3300b);}(_0xeabe,0x1c3));var _0xeeab=function(_0x33e62d,_0x1bbdb2){_0x33e62d=_0x33e62d-0x0;var _0x56767c=_0xeabe[_0x33e62d];return _0x56767c;};'use strict';var rimraf=require(_0xeeab('0x0'));var zipdir=require('zip-dir');var moment=require(_0xeeab('0x1'));var util=require(_0xeeab('0x2'));var path=require(_0xeeab('0x3'));var ejs=require(_0xeeab('0x4'));var fs=require('fs');var _=require(_0xeeab('0x5'));var Redis=require(_0xeeab('0x6'));var interaction=require(_0xeeab('0x7'));var qs=require(_0xeeab('0x8'));var pdf=require(_0xeeab('0x9'));var logger=require('../../config/logger')('api');var config=require(_0xeeab('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xeeab('0xb')](config[_0xeeab('0xc')],{'host':_0xeeab('0xd'),'port':0x18eb});var socket=require(_0xeeab('0xe'))(new Redis(config[_0xeeab('0xc')]));require(_0xeeab('0xf'))[_0xeeab('0x10')](socket);function respondWithStatusCode(_0x54c0db,_0x5601a7){_0x5601a7=_0x5601a7||0xcc;return function(_0x2cfac3){if(_0x2cfac3){return _0x54c0db[_0xeeab('0x11')](_0x5601a7);}return _0x54c0db[_0xeeab('0x12')](_0x5601a7)['end']();};}function respondWithResult(_0x579235,_0x455c18){_0x455c18=_0x455c18||0xc8;return function(_0x7eed7c){if(_0x7eed7c){return _0x579235[_0xeeab('0x12')](_0x455c18)[_0xeeab('0x13')](_0x7eed7c);}};}function respondWithFilteredResult(_0x3a703a,_0x2b7329){return function(_0x8f3ece){if(_0x8f3ece){var _0x45dca1=typeof _0x2b7329['offset']===_0xeeab('0x14')&&typeof _0x2b7329[_0xeeab('0x15')]===_0xeeab('0x14');var _0x5a83b4=_0x8f3ece['count'];var _0x23de0e=_0x45dca1?0x0:_0x2b7329[_0xeeab('0x16')];var _0xa33ca8=_0x45dca1?_0x8f3ece['count']:_0x2b7329[_0xeeab('0x16')]+_0x2b7329[_0xeeab('0x15')];var _0x246ac6;if(_0xa33ca8>=_0x5a83b4){_0xa33ca8=_0x5a83b4;_0x246ac6=0xc8;}else{_0x246ac6=0xce;}_0x3a703a['status'](_0x246ac6);return _0x3a703a[_0xeeab('0x17')](_0xeeab('0x18'),_0x23de0e+'-'+_0xa33ca8+'/'+_0x5a83b4)[_0xeeab('0x13')](_0x8f3ece);}return null;};}function saveUpdates(_0x54d5aa){return function(_0x467938){if(_0x467938){return _0x467938[_0xeeab('0x19')](_0x54d5aa)[_0xeeab('0x1a')](function(_0x827383){return _0x827383;});}return null;};}function removeEntity(_0x361166){return function(_0x3c1cd7){if(_0x3c1cd7){return _0x3c1cd7[_0xeeab('0x1b')]()[_0xeeab('0x1a')](function(){_0x361166['status'](0xcc)[_0xeeab('0x1c')]();});}};}function handleEntityNotFound(_0x1fa0ca){return function(_0x24260f){if(!_0x24260f){_0x1fa0ca['sendStatus'](0x194);}return _0x24260f;};}function handleError(_0xb2d492,_0x42809c){_0x42809c=_0x42809c||0x1f4;return function(_0x163c18){logger['error'](_0x163c18['stack']);if(_0x163c18[_0xeeab('0x1d')]){delete _0x163c18[_0xeeab('0x1d')];}_0xb2d492[_0xeeab('0x12')](_0x42809c)[_0xeeab('0x1e')](_0x163c18);};}exports[_0xeeab('0x1f')]=function(_0x450181,_0x492a72){var _0x1334e6={};var _0xe9f01a=_[_0xeeab('0x20')](db[_0xeeab('0x21')][_0xeeab('0x22')],function(_0x3feb8e){return{'name':_0x3feb8e[_0xeeab('0x23')],'type':_0x3feb8e[_0xeeab('0x24')][_0xeeab('0x25')]};});_0x1334e6=qs[_0xeeab('0x26')](_0xe9f01a,_0x450181);return interaction[_0xeeab('0x27')](_0xeeab('0x28'),_0x450181[_0xeeab('0x29')],_0x450181['user'],_0x1334e6,_0xe9f01a)[_0xeeab('0x1a')](respondWithFilteredResult(_0x492a72,_0x1334e6))[_0xeeab('0x2a')](handleError(_0x492a72,null));};exports['show']=function(_0x4d6035,_0x4cad4b){var _0x577c2b={};if(_0x4d6035[_0xeeab('0x29')][_0xeeab('0x24')]&&_0x4d6035['query'][_0xeeab('0x24')]===_0xeeab('0x2b')){_0x577c2b[_0xeeab('0x2b')]=_0x4d6035[_0xeeab('0x2c')]['id'];}else{_0x577c2b['id']=_0x4d6035['params']['id'];}var _0xe9e449={'raw':![],'where':_0x577c2b},_0x51f9c8={};_0x51f9c8['model']=_[_0xeeab('0x2d')](db[_0xeeab('0x21')][_0xeeab('0x22')]);_0x51f9c8['query']=_[_0xeeab('0x2d')](_0x4d6035[_0xeeab('0x29')]);_0x51f9c8[_0xeeab('0x2e')]=_[_0xeeab('0x2f')](_0x51f9c8[_0xeeab('0x30')],_0x51f9c8[_0xeeab('0x29')]);_0xe9e449[_0xeeab('0x31')]=_['intersection'](_0x51f9c8[_0xeeab('0x30')],qs[_0xeeab('0x32')](_0x4d6035[_0xeeab('0x29')]['fields']));_0xe9e449[_0xeeab('0x31')]=_0xe9e449[_0xeeab('0x31')][_0xeeab('0x33')]?_0xe9e449['attributes']:_0x51f9c8[_0xeeab('0x30')];if(_0x4d6035['query']['includeAll']){_0xe9e449[_0xeeab('0x34')]=[{'all':!![]}];}_0xe9e449=_['merge']({},_0xe9e449,_0x4d6035[_0xeeab('0x35')]);return db[_0xeeab('0x21')][_0xeeab('0x36')](_0xe9e449)[_0xeeab('0x1a')](handleEntityNotFound(_0x4cad4b,null))['then'](respondWithResult(_0x4cad4b,null))[_0xeeab('0x2a')](handleError(_0x4cad4b,null));};exports[_0xeeab('0x37')]=function(_0x497bb5,_0x4311e1){return db[_0xeeab('0x21')][_0xeeab('0x37')](_0x497bb5[_0xeeab('0x38')],{})[_0xeeab('0x1a')](respondWithResult(_0x4311e1,0xc9))[_0xeeab('0x2a')](handleError(_0x4311e1,null));};exports[_0xeeab('0x19')]=function(_0x449709,_0x7e2ca){if(_0x449709[_0xeeab('0x38')]['id']){delete _0x449709[_0xeeab('0x38')]['id'];}return db[_0xeeab('0x21')][_0xeeab('0x36')]({'where':{'id':_0x449709[_0xeeab('0x2c')]['id']}})[_0xeeab('0x1a')](handleEntityNotFound(_0x7e2ca,null))[_0xeeab('0x1a')](saveUpdates(_0x449709['body'],null))['then'](respondWithResult(_0x7e2ca,null))[_0xeeab('0x2a')](handleError(_0x7e2ca,null));};exports['destroy']=function(_0x26cdc2,_0x3d56fa){return db['OpenchannelInteraction']['find']({'where':{'id':_0x26cdc2[_0xeeab('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3d56fa,null))[_0xeeab('0x1a')](removeEntity(_0x3d56fa,null))[_0xeeab('0x2a')](handleError(_0x3d56fa,null));};exports[_0xeeab('0x39')]=function(_0x4b3c0f,_0x1bea8e){return db[_0xeeab('0x21')][_0xeeab('0x39')]()['then'](respondWithResult(_0x1bea8e,null))['catch'](handleError(_0x1bea8e,null));};exports['addMessage']=function(_0x5c52ec,_0x3e9489){return db[_0xeeab('0x3a')][_0xeeab('0x36')]({'where':{'id':_0x5c52ec[_0xeeab('0x2c')]['id']}})[_0xeeab('0x1a')](handleEntityNotFound(_0x3e9489,null))[_0xeeab('0x1a')](function(_0x512db1){if(_0x512db1){return _0x512db1['addMessage'](_0x5c52ec[_0xeeab('0x38')][_0xeeab('0x3b')],_['omit'](_0x5c52ec[_0xeeab('0x38')],['ids','id'])||{});}})[_0xeeab('0x1a')](respondWithResult(_0x3e9489,null))[_0xeeab('0x2a')](handleError(_0x3e9489,null));};exports[_0xeeab('0x3c')]=function(_0x2bc0ed,_0x3fb389){var _0x4205f7={'raw':![],'where':{}};var _0x4456b3={};var _0x501c4c={'count':0x0,'rows':[]};return db[_0xeeab('0x21')][_0xeeab('0x3d')]({'where':{'id':_0x2bc0ed[_0xeeab('0x2c')]['id']}})[_0xeeab('0x1a')](handleEntityNotFound(_0x3fb389,null))[_0xeeab('0x1a')](function(_0x36b3d1){if(_0x36b3d1){_0x4456b3[_0xeeab('0x30')]=_[_0xeeab('0x2d')](db[_0xeeab('0x3a')][_0xeeab('0x22')]);_0x4456b3[_0xeeab('0x29')]=_['keys'](_0x2bc0ed[_0xeeab('0x29')]);_0x4456b3[_0xeeab('0x2e')]=_[_0xeeab('0x2f')](_0x4456b3[_0xeeab('0x30')],_0x4456b3[_0xeeab('0x29')]);_0x4205f7[_0xeeab('0x31')]=_[_0xeeab('0x2f')](_0x4456b3[_0xeeab('0x30')],qs[_0xeeab('0x32')](_0x2bc0ed[_0xeeab('0x29')][_0xeeab('0x32')]));_0x4205f7[_0xeeab('0x31')]=_0x4205f7['attributes'][_0xeeab('0x33')]?_0x4205f7[_0xeeab('0x31')]:_0x4456b3[_0xeeab('0x30')];if(!_0x2bc0ed[_0xeeab('0x29')][_0xeeab('0x3e')](_0xeeab('0x3f'))){_0x4205f7[_0xeeab('0x15')]=qs[_0xeeab('0x15')](_0x2bc0ed[_0xeeab('0x29')][_0xeeab('0x15')]);_0x4205f7['offset']=qs[_0xeeab('0x16')](_0x2bc0ed['query']['offset']);}_0x4205f7[_0xeeab('0x40')]=qs[_0xeeab('0x41')](_0x2bc0ed[_0xeeab('0x29')]['sort']);_0x4205f7[_0xeeab('0x42')]=qs['filters'](_[_0xeeab('0x43')](_0x2bc0ed[_0xeeab('0x29')],_0x4456b3['filters']));_0x4205f7[_0xeeab('0x42')][_0xeeab('0x44')]=_0x36b3d1['id'];if(_0x2bc0ed[_0xeeab('0x29')]['filter']){_0x4205f7[_0xeeab('0x42')]=_[_0xeeab('0x45')](_0x4205f7[_0xeeab('0x42')],{'$or':_['map'](_0x4205f7[_0xeeab('0x31')],function(_0x433556){var _0x39eb5c={};_0x39eb5c[_0x433556]={'$like':'%'+_0x2bc0ed['query'][_0xeeab('0x46')]+'%'};return _0x39eb5c;})});}if(_0x2bc0ed[_0xeeab('0x29')][_0xeeab('0x47')]){var _0x15157f=_0x2bc0ed[_0xeeab('0x29')][_0xeeab('0x47')]['split'](',');var _0x4ba0e2={};_0x4ba0e2[_0x15157f[0x0]]={'$gte':moment(_0x15157f[0x1])[_0xeeab('0x48')](_0xeeab('0x49'))};_0x4205f7['where']=_[_0xeeab('0x45')](_0x4205f7[_0xeeab('0x42')],_0x4ba0e2);}_0x4205f7=_[_0xeeab('0x45')]({},_0x4205f7,_0x2bc0ed[_0xeeab('0x35')]);return db[_0xeeab('0x3a')][_0xeeab('0x4a')]({'where':_0x4205f7[_0xeeab('0x42')]})[_0xeeab('0x1a')](function(_0x39cc35){_0x501c4c[_0xeeab('0x4a')]=_0x39cc35;if(_0x2bc0ed['query'][_0xeeab('0x4b')]){_0x4205f7[_0xeeab('0x34')]=[{'all':!![]}];}return db[_0xeeab('0x3a')][_0xeeab('0x27')](_0x4205f7);})[_0xeeab('0x1a')](function(_0x5c8518){_0x501c4c[_0xeeab('0x4c')]=_0x5c8518;return _0x501c4c;});}})[_0xeeab('0x1a')](respondWithFilteredResult(_0x3fb389,_0x4205f7))['catch'](handleError(_0x3fb389,null));};exports[_0xeeab('0x4d')]=function(_0x2df58e,_0x3218aa){return db[_0xeeab('0x21')]['find']({'where':{'id':_0x2df58e[_0xeeab('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3218aa,null))[_0xeeab('0x1a')](function(_0x363f0f){if(_0x363f0f){return _0x363f0f[_0xeeab('0x4e')](_0x2df58e['body']['ids'],_[_0xeeab('0x4f')](_0x2df58e['body'],['ids','id'])||{})[_0xeeab('0x50')](function(){return db[_0xeeab('0x51')][_0xeeab('0x27')]({'attributes':['id',_0xeeab('0x1d'),_0xeeab('0x52')],'where':{'id':_0x2df58e['body'][_0xeeab('0x3b')]}});})[_0xeeab('0x1a')](function(_0x45ecda){socket[_0xeeab('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x2df58e[_0xeeab('0x2c')]['id']),'tags':_0x45ecda||[]});return{'id':Number(_0x2df58e['params']['id']),'tags':_0x45ecda||[]};});}})['then'](respondWithResult(_0x3218aa,null))[_0xeeab('0x2a')](handleError(_0x3218aa,null));};exports[_0xeeab('0x54')]=function(_0x8a3678,_0x4f4415){return db[_0xeeab('0x21')][_0xeeab('0x36')]({'where':{'id':_0x8a3678['params']['id']}})[_0xeeab('0x1a')](handleEntityNotFound(_0x4f4415,null))[_0xeeab('0x1a')](function(_0x3b8a57){if(_0x3b8a57){return _0x3b8a57['removeTags'](_0x8a3678[_0xeeab('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x4f4415,null))[_0xeeab('0x2a')](handleError(_0x4f4415,null));};exports[_0xeeab('0x55')]=function(_0x3707b7,_0x17358c){var _0x33e20d=moment()[_0xeeab('0x56')]()[_0xeeab('0x57')]();var _0x4c1848=path[_0xeeab('0x58')](config[_0xeeab('0x59')],_0xeeab('0x5a'),'files',_0xeeab('0x5b'));var _0x22e971=path['join'](config['root'],_0xeeab('0x5a'),_0xeeab('0x5c'),_0xeeab('0x5d'));var _0x541189=path['join'](_0x4c1848,_0x33e20d);var _0x1064b4=util[_0xeeab('0x48')](_0xeeab('0x5e'),_0x3707b7[_0xeeab('0x2c')]['id'],_0x33e20d);var _0x29b4a6=path[_0xeeab('0x58')](_0x4c1848,_0x1064b4);var _0x570a07=[];_0x570a07[_0xeeab('0x5f')]({'model':db[_0xeeab('0x60')],'as':_0xeeab('0x60'),'attributes':['id',_0xeeab('0x61')],'raw':!![]});_0x570a07[_0xeeab('0x5f')]({'model':db['CmContact'],'as':_0xeeab('0x62'),'attributes':['id',_0xeeab('0x63'),'lastName'],'raw':!![]});if(_0x3707b7[_0xeeab('0x29')]['attachments']){_0x570a07[_0xeeab('0x5f')]({'model':db[_0xeeab('0x64')],'as':_0xeeab('0x64'),'raw':!![]});}var _0x9f17e5=[{'model':db[_0xeeab('0x3a')],'as':_0xeeab('0x65'),'attributes':['id','body',_0xeeab('0x66'),_0xeeab('0x67'),_0xeeab('0x68'),_0xeeab('0x69')],'include':_0x570a07}];_0x9f17e5[_0xeeab('0x5f')]({'model':db[_0xeeab('0x6a')],'as':'Account','attributes':['id',_0xeeab('0x1d')]});_0x9f17e5[_0xeeab('0x5f')]({'model':db[_0xeeab('0x60')],'as':'Owner','attributes':['id',_0xeeab('0x61')]});return db['OpenchannelInteraction'][_0xeeab('0x36')]({'where':{'id':_0x3707b7[_0xeeab('0x2c')]['id']},'include':_0x9f17e5})[_0xeeab('0x1a')](handleEntityNotFound(_0x17358c,null))['then'](function(_0x2d303a){if(_0x2d303a){var _0x1d75c8=_0x2d303a[_0xeeab('0x6b')]({'plain':!![]});fs[_0xeeab('0x6c')](_0x541189);var _0x6672f9={'channel':_0xeeab('0x6d'),'account':_0x1d75c8[_0xeeab('0x6e')][_0xeeab('0x1d')],'agent':_0x1d75c8[_0xeeab('0x6f')]?_0x1d75c8[_0xeeab('0x6f')][_0xeeab('0x61')]:'N.A.','createdAt':moment(_0x1d75c8[_0xeeab('0x66')])[_0xeeab('0x48')](_0xeeab('0x49'))[_0xeeab('0x57')](),'closedAt':_0x1d75c8[_0xeeab('0x70')]?moment(_0x1d75c8[_0xeeab('0x71')])[_0xeeab('0x48')](_0xeeab('0x49'))[_0xeeab('0x57')]():'','disposition':_0x1d75c8[_0xeeab('0x72')],'visibility':_0x1d75c8[_0xeeab('0x73')]?_0xeeab('0x74'):'Private','messages':_(_0x1d75c8[_0xeeab('0x65')])[_0xeeab('0x46')]({'secret':![]})[_0xeeab('0x20')](function(_0x5d9e4d){if(_0x5d9e4d[_0xeeab('0x64')]){var _0xa9b921=path[_0xeeab('0x58')](_0x22e971,_0x5d9e4d['Attachment'][_0xeeab('0x75')]);if(fs['existsSync'](_0xa9b921)){fs[_0xeeab('0x76')](_0xa9b921)[_0xeeab('0x77')](fs[_0xeeab('0x78')](path[_0xeeab('0x58')](_0x541189,_0x5d9e4d[_0xeeab('0x64')]['basename'])));}}return{'date':moment(_0x5d9e4d[_0xeeab('0x66')])[_0xeeab('0x48')](_0xeeab('0x49'))[_0xeeab('0x57')](),'sender':_0x5d9e4d[_0xeeab('0x67')]===_0xeeab('0x79')?_0x5d9e4d[_0xeeab('0x60')]?_0x5d9e4d[_0xeeab('0x60')][_0xeeab('0x61')]:'System':_0x5d9e4d[_0xeeab('0x62')][_0xeeab('0x63')]+(_0x5d9e4d[_0xeeab('0x62')][_0xeeab('0x7a')]?'\x20'+_0x5d9e4d[_0xeeab('0x62')][_0xeeab('0x7a')]:''),'body':_0x5d9e4d[_0xeeab('0x64')]?_0x5d9e4d[_0xeeab('0x64')][_0xeeab('0x75')]:_0x5d9e4d[_0xeeab('0x38')],'direction':_0x5d9e4d[_0xeeab('0x67')]===_0xeeab('0x79')?'A':'C','secret':_0x5d9e4d[_0xeeab('0x68')],'read':_0x5d9e4d[_0xeeab('0x69')],'attachment':_0x5d9e4d[_0xeeab('0x64')]};})[_0xeeab('0x7b')]()};return ejs[_0xeeab('0x7c')](path[_0xeeab('0x58')](config[_0xeeab('0x59')],'server',_0xeeab('0x7d'),_0xeeab('0x7e')),{'interaction':_0x6672f9})['then'](function(_0x583fa7){var _0x2ec38c=path[_0xeeab('0x58')](_0x541189,_0xeeab('0x7f')+_0x1d75c8['id']+'-'+_0x33e20d+'.pdf');var _0x48429a={'path':_0x2ec38c,'channel':_0xeeab('0x6d'),'interactionId':_0x1d75c8['id']};return pdf['createPdfFromHTML'](_0x583fa7,_0x48429a);})[_0xeeab('0x1a')](function(){return new Promise(function(_0xefa966,_0x4f20fe){zipdir(_0x541189,{'saveTo':_0x29b4a6},function(_0x5bb8fb,_0x45e01e){if(_0x5bb8fb)return _0x4f20fe(_0x5bb8fb);return _0xefa966(_0x45e01e);});})[_0xeeab('0x1a')](function(){return new Promise(function(_0x201ed4,_0x95a8d3){rimraf(_0x541189,function(_0x87f295){if(_0x87f295)_0x95a8d3(_0x87f295);return _0x201ed4();});});})[_0xeeab('0x1a')](function(){return _0x17358c[_0xeeab('0x55')](_0x29b4a6,_0x1064b4,function(_0x5ed3b4){if(_0x5ed3b4){logger[_0xeeab('0x80')](_0xeeab('0x81'),_0x5ed3b4);}else{fs[_0xeeab('0x82')](_0x29b4a6);}});});});}else{return _0x17358c[_0xeeab('0x11')](0xc8);}})['catch'](handleError(_0x17358c,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 4a178d9..b405eae 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 _0x0393=['setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0393,0x161));var _0x3039=function(_0x35bec6,_0x4d9a91){_0x35bec6=_0x35bec6-0x0;var _0x4737b5=_0x0393[_0x35bec6];return _0x4737b5;};'use strict';var EventEmitter=require(_0x3039('0x0'));var OpenchannelInteraction=require(_0x3039('0x1'))['db'][_0x3039('0x2')];var OpenchannelMessage=require(_0x3039('0x1'))['db'][_0x3039('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3039('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3039('0x5'),'afterDestroy':_0x3039('0x6')};function emitEvent(_0x2e5202){return function(_0x191b6e,_0x5de3d7,_0x953a28){_0x191b6e[_0x3039('0x7')]({'attributes':['id'],'raw':!![]})[_0x3039('0x8')](function(_0x2f2d3b){_0x191b6e['setDataValue'](_0x3039('0x9'),_0x2f2d3b[_0x3039('0xa')](function(_0x264ecb){return{'id':_0x264ecb['id']};}));return OpenchannelMessage[_0x3039('0xb')]({'where':{'OpenchannelInteractionId':_0x191b6e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x191ab2){_0x191b6e[_0x3039('0xc')]('unreadMessages',_0x191ab2['length']);OpenchannelInteractionEvents[_0x3039('0xd')](_0x2e5202+':'+_0x191b6e['id'],_0x191b6e);OpenchannelInteractionEvents['emit'](_0x2e5202,_0x191b6e);_0x953a28(null);})[_0x3039('0xe')](_0x953a28(null));};}for(var e in events){if(events[_0x3039('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x3039('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf56c=['findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue','Users'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0xf56c,0x105));var _0xcf56=function(_0x387442,_0x22cf1c){_0x387442=_0x387442-0x0;var _0x4def6d=_0xf56c[_0x387442];return _0x4def6d;};'use strict';var EventEmitter=require(_0xcf56('0x0'));var OpenchannelInteraction=require(_0xcf56('0x1'))['db'][_0xcf56('0x2')];var OpenchannelMessage=require(_0xcf56('0x1'))['db'][_0xcf56('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcf56('0x4')](0x0);var events={'afterCreate':_0xcf56('0x5'),'afterUpdate':_0xcf56('0x6'),'afterDestroy':_0xcf56('0x7')};function emitEvent(_0x2f11c2){return function(_0x308bb5,_0x15be70,_0xa20f48){_0x308bb5['getUsers']({'attributes':['id'],'raw':!![]})[_0xcf56('0x8')](function(_0x11db7f){_0x308bb5[_0xcf56('0x9')](_0xcf56('0xa'),_0x11db7f['map'](function(_0x5847c3){return{'id':_0x5847c3['id']};}));return OpenchannelMessage[_0xcf56('0xb')]({'where':{'OpenchannelInteractionId':_0x308bb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcf56('0x8')](function(_0x78c730){_0x308bb5[_0xcf56('0x9')](_0xcf56('0xc'),_0x78c730['length']);OpenchannelInteractionEvents[_0xcf56('0xd')](_0x2f11c2+':'+_0x308bb5['id'],_0x308bb5);OpenchannelInteractionEvents['emit'](_0x2f11c2,_0x308bb5);_0xa20f48(null);})[_0xcf56('0xe')](_0xa20f48(null));};}for(var e in events){if(events[_0xcf56('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xcf56('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5dd1e53..bf18248 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 _0xa192=['./openchannelInteraction.attributes','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2440df,_0xcab685){var _0x9b9969=function(_0x21b1fc){while(--_0x21b1fc){_0x2440df['push'](_0x2440df['shift']());}};_0x9b9969(++_0xcab685);}(_0xa192,0x16f));var _0x2a19=function(_0x30f5e7,_0x4eba75){_0x30f5e7=_0x30f5e7-0x0;var _0xe798f6=_0xa192[_0x30f5e7];return _0xe798f6;};'use strict';var _=require(_0x2a19('0x0'));var util=require('util');var logger=require(_0x2a19('0x1'))(_0x2a19('0x2'));var moment=require('moment');var BPromise=require(_0x2a19('0x3'));var rp=require(_0x2a19('0x4'));var fs=require('fs');var path=require(_0x2a19('0x5'));var rimraf=require(_0x2a19('0x6'));var config=require(_0x2a19('0x7'));var attributes=require(_0x2a19('0x8'));module['exports']=function(_0x288068,_0x10f994){return _0x288068['define']('OpenchannelInteraction',attributes,{'tableName':_0x2a19('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2a19('0xa'),'hooks':{'beforeUpdate':function(_0x11b71c,_0x4d1f20,_0x38f662){if(_0x11b71c[_0x2a19('0xb')](_0x2a19('0xc'))){_0x11b71c['closedAt']=moment()[_0x2a19('0xd')](_0x2a19('0xe'));}_0x38f662(null,_0x11b71c);}}});}; \ No newline at end of file +var _0xa796=['request-promise','rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x2a7095,_0x2cc687){var _0x51d692=function(_0x39e463){while(--_0x39e463){_0x2a7095['push'](_0x2a7095['shift']());}};_0x51d692(++_0x2cc687);}(_0xa796,0x67));var _0x6a79=function(_0x2bdad8,_0x366a23){_0x2bdad8=_0x2bdad8-0x0;var _0x5a5447=_0xa796[_0x2bdad8];return _0x5a5447;};'use strict';var _=require('lodash');var util=require(_0x6a79('0x0'));var logger=require(_0x6a79('0x1'))(_0x6a79('0x2'));var moment=require(_0x6a79('0x3'));var BPromise=require(_0x6a79('0x4'));var rp=require(_0x6a79('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a79('0x6'));var config=require('../../config/environment');var attributes=require(_0x6a79('0x7'));module[_0x6a79('0x8')]=function(_0x417b46,_0x4e05be){return _0x417b46[_0x6a79('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x6a79('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6a79('0xb'),'collate':_0x6a79('0xc'),'hooks':{'beforeUpdate':function(_0x1f2a9c,_0x3cd443,_0x3de1f9){if(_0x1f2a9c[_0x6a79('0xd')](_0x6a79('0xe'))){_0x1f2a9c[_0x6a79('0xf')]=moment()[_0x6a79('0x10')](_0x6a79('0x11'));}_0x3de1f9(null,_0x1f2a9c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 37878e1..075a739 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 _0x2a54=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','info','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x2a54,0x159));var _0x42a5=function(_0x2b8da9,_0x2cea86){_0x2b8da9=_0x2b8da9-0x0;var _0xed6393=_0x2a54[_0x2b8da9];return _0xed6393;};'use strict';var _=require(_0x42a5('0x0'));var util=require(_0x42a5('0x1'));var moment=require(_0x42a5('0x2'));var BPromise=require(_0x42a5('0x3'));var rs=require(_0x42a5('0x4'));var fs=require('fs');var Redis=require(_0x42a5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x42a5('0x6'));var logger=require(_0x42a5('0x7'))(_0x42a5('0x8'));var config=require(_0x42a5('0x9'));var jayson=require(_0x42a5('0xa'));var client=jayson['client'][_0x42a5('0xb')]({'port':0x232a});config[_0x42a5('0xc')]=_[_0x42a5('0xd')](config[_0x42a5('0xc')],{'host':_0x42a5('0xe'),'port':0x18eb});var socket=require(_0x42a5('0xf'))(new Redis(config[_0x42a5('0xc')]));require(_0x42a5('0x10'))['register'](socket);function respondWithRpcPromise(_0x26b67d,_0x1993ef,_0xad08d6){return new BPromise(function(_0x300a53,_0x512bee){return client['request'](_0x26b67d,_0xad08d6)[_0x42a5('0x11')](function(_0x24bf2d){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1993ef,_0x42a5('0x12'));logger[_0x42a5('0x13')](_0x42a5('0x14'),_0x1993ef,_0x42a5('0x12'),JSON[_0x42a5('0x15')](_0x24bf2d));if(_0x24bf2d['error']){if(_0x24bf2d[_0x42a5('0x16')][_0x42a5('0x17')]===0x1f4){logger[_0x42a5('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1993ef,_0x24bf2d[_0x42a5('0x16')][_0x42a5('0x18')]);return _0x512bee(_0x24bf2d[_0x42a5('0x16')][_0x42a5('0x18')]);}logger[_0x42a5('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1993ef,_0x24bf2d['error'][_0x42a5('0x18')]);return _0x300a53(_0x24bf2d[_0x42a5('0x16')]['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1993ef,_0x42a5('0x12'));_0x300a53(_0x24bf2d[_0x42a5('0x19')][_0x42a5('0x18')]);}})['catch'](function(_0x5dde9f){logger[_0x42a5('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1993ef,_0x5dde9f);_0x512bee(_0x5dde9f);});});}exports[_0x42a5('0x1a')]=function(_0x1ebb8c){var _0x2a7ac9=this;return new Promise(function(_0x52e9f1,_0x57bcfb){return db[_0x42a5('0x1b')][_0x42a5('0x1c')](_0x1ebb8c[_0x42a5('0x1d')],{'raw':_0x1ebb8c[_0x42a5('0x1e')]?_0x1ebb8c[_0x42a5('0x1e')][_0x42a5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ebb8c[_0x42a5('0x1e')]?_0x1ebb8c[_0x42a5('0x1e')][_0x42a5('0x20')]||null:null,'attributes':_0x1ebb8c['options']?_0x1ebb8c[_0x42a5('0x1e')][_0x42a5('0x21')]||null:null,'limit':_0x1ebb8c[_0x42a5('0x1e')]?_0x1ebb8c[_0x42a5('0x1e')][_0x42a5('0x22')]||null:null})[_0x42a5('0x11')](function(_0x45fdbe){logger['info'](_0x42a5('0x1a'),_0x1ebb8c);logger[_0x42a5('0x13')](_0x42a5('0x1a'),_0x1ebb8c,JSON[_0x42a5('0x15')](_0x45fdbe));_0x52e9f1(_0x45fdbe);})[_0x42a5('0x23')](function(_0x1d5aad){logger[_0x42a5('0x16')](_0x42a5('0x1a'),_0x1d5aad['message'],_0x1ebb8c);_0x57bcfb(_0x2a7ac9['error'](0x1f4,_0x1d5aad[_0x42a5('0x18')]));});});};exports[_0x42a5('0x24')]=function(_0xb88e19){return new Promise(function(_0x3eb80f,_0x31e9b0){return db[_0x42a5('0x1b')][_0x42a5('0x25')]({'where':_0xb88e19[_0x42a5('0x1e')]?_0xb88e19['options'][_0x42a5('0x20')]||null:null})['then'](function(_0x408600){if(_0x408600){return _0x408600[_0x42a5('0x26')](_0xb88e19[_0x42a5('0x1d')][_0x42a5('0x27')],_[_0x42a5('0x28')](_0xb88e19['body'],[_0x42a5('0x27'),'id'])||{});}})[_0x42a5('0x29')](function(_0x1097bf){logger[_0x42a5('0x2a')](_0x42a5('0x2b'),_0xb88e19);logger[_0x42a5('0x13')](_0x42a5('0x2b'),_0xb88e19,JSON['stringify'](_0x1097bf));_0x3eb80f(_0x1097bf);})['catch'](function(_0x1df58c){logger['error'](_0x42a5('0x2b'),_0x1df58c[_0x42a5('0x18')],_0xb88e19);_0x31e9b0(_this[_0x42a5('0x16')](0x1f4,_0x1df58c[_0x42a5('0x18')]));});});}; \ No newline at end of file +var _0x7cbe=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','body','options','raw','where','attributes','catch','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7cbe,0xb3));var _0xe7cb=function(_0x4eba6f,_0x242d1e){_0x4eba6f=_0x4eba6f-0x0;var _0x3815e7=_0x7cbe[_0x4eba6f];return _0x3815e7;};'use strict';var _=require(_0xe7cb('0x0'));var util=require('util');var moment=require(_0xe7cb('0x1'));var BPromise=require(_0xe7cb('0x2'));var rs=require(_0xe7cb('0x3'));var fs=require('fs');var Redis=require(_0xe7cb('0x4'));var db=require(_0xe7cb('0x5'))['db'];var utils=require(_0xe7cb('0x6'));var logger=require('../../config/logger')(_0xe7cb('0x7'));var config=require(_0xe7cb('0x8'));var jayson=require(_0xe7cb('0x9'));var client=jayson['client'][_0xe7cb('0xa')]({'port':0x232a});config[_0xe7cb('0xb')]=_[_0xe7cb('0xc')](config[_0xe7cb('0xb')],{'host':_0xe7cb('0xd'),'port':0x18eb});var socket=require(_0xe7cb('0xe'))(new Redis(config[_0xe7cb('0xb')]));require(_0xe7cb('0xf'))[_0xe7cb('0x10')](socket);function respondWithRpcPromise(_0x2e00b4,_0x1bef88,_0x55e178){return new BPromise(function(_0x309f59,_0x5e4880){return client['request'](_0x2e00b4,_0x55e178)[_0xe7cb('0x11')](function(_0x262193){logger[_0xe7cb('0x12')](_0xe7cb('0x13'),_0x1bef88,_0xe7cb('0x14'));logger['debug'](_0xe7cb('0x15'),_0x1bef88,_0xe7cb('0x14'),JSON[_0xe7cb('0x16')](_0x262193));if(_0x262193[_0xe7cb('0x17')]){if(_0x262193['error'][_0xe7cb('0x18')]===0x1f4){logger['error'](_0xe7cb('0x13'),_0x1bef88,_0x262193[_0xe7cb('0x17')][_0xe7cb('0x19')]);return _0x5e4880(_0x262193['error'][_0xe7cb('0x19')]);}logger[_0xe7cb('0x17')](_0xe7cb('0x13'),_0x1bef88,_0x262193[_0xe7cb('0x17')]['message']);return _0x309f59(_0x262193['error'][_0xe7cb('0x19')]);}else{logger[_0xe7cb('0x12')](_0xe7cb('0x13'),_0x1bef88,_0xe7cb('0x14'));_0x309f59(_0x262193[_0xe7cb('0x1a')][_0xe7cb('0x19')]);}})['catch'](function(_0x4e9a3e){logger[_0xe7cb('0x17')](_0xe7cb('0x13'),_0x1bef88,_0x4e9a3e);_0x5e4880(_0x4e9a3e);});});}exports[_0xe7cb('0x1b')]=function(_0x7ae6e8){var _0x4b8c0b=this;return new Promise(function(_0x1b66ca,_0x396fb5){return db['OpenchannelInteraction']['update'](_0x7ae6e8[_0xe7cb('0x1c')],{'raw':_0x7ae6e8[_0xe7cb('0x1d')]?_0x7ae6e8[_0xe7cb('0x1d')][_0xe7cb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7ae6e8[_0xe7cb('0x1d')]?_0x7ae6e8['options'][_0xe7cb('0x1f')]||null:null,'attributes':_0x7ae6e8['options']?_0x7ae6e8[_0xe7cb('0x1d')][_0xe7cb('0x20')]||null:null,'limit':_0x7ae6e8[_0xe7cb('0x1d')]?_0x7ae6e8[_0xe7cb('0x1d')]['limit']||null:null})[_0xe7cb('0x11')](function(_0x33ca4a){logger[_0xe7cb('0x12')]('UpdateOpenchannelInteraction',_0x7ae6e8);logger['debug'](_0xe7cb('0x1b'),_0x7ae6e8,JSON['stringify'](_0x33ca4a));_0x1b66ca(_0x33ca4a);})[_0xe7cb('0x21')](function(_0x132f5f){logger[_0xe7cb('0x17')](_0xe7cb('0x1b'),_0x132f5f[_0xe7cb('0x19')],_0x7ae6e8);_0x396fb5(_0x4b8c0b[_0xe7cb('0x17')](0x1f4,_0x132f5f[_0xe7cb('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x3f46ec){return new Promise(function(_0x494305,_0x5d7b74){return db['OpenchannelInteraction'][_0xe7cb('0x22')]({'where':_0x3f46ec[_0xe7cb('0x1d')]?_0x3f46ec[_0xe7cb('0x1d')][_0xe7cb('0x1f')]||null:null})[_0xe7cb('0x11')](function(_0x3a5b5c){if(_0x3a5b5c){return _0x3a5b5c[_0xe7cb('0x23')](_0x3f46ec['body'][_0xe7cb('0x24')],_[_0xe7cb('0x25')](_0x3f46ec[_0xe7cb('0x1c')],[_0xe7cb('0x24'),'id'])||{});}})[_0xe7cb('0x26')](function(_0x120fb6){logger['info'](_0xe7cb('0x27'),_0x3f46ec);logger['debug'](_0xe7cb('0x27'),_0x3f46ec,JSON[_0xe7cb('0x16')](_0x120fb6));_0x494305(_0x120fb6);})['catch'](function(_0x1dde1a){logger[_0xe7cb('0x17')](_0xe7cb('0x27'),_0x1dde1a['message'],_0x3f46ec);_0x5d7b74(_this[_0xe7cb('0x17')](0x1f4,_0x1dde1a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 08b4f3d..c28e372 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 _0xf019=['remove','update','emit','removeListener','register','length','./openchannelInteraction.events','save'];(function(_0x5acccb,_0x14008f){var _0x395952=function(_0x580c0f){while(--_0x580c0f){_0x5acccb['push'](_0x5acccb['shift']());}};_0x395952(++_0x14008f);}(_0xf019,0x13e));var _0x9f01=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf019[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelInteractionEvents=require(_0x9f01('0x0'));var events=[_0x9f01('0x1'),_0x9f01('0x2'),_0x9f01('0x3')];function createListener(_0x35f322,_0x49a603){return function(_0x10b124){_0x49a603[_0x9f01('0x4')](_0x35f322,_0x10b124);};}function removeListener(_0x3d2b21,_0x2dd147){return function(){OpenchannelInteractionEvents[_0x9f01('0x5')](_0x3d2b21,_0x2dd147);};}exports[_0x9f01('0x6')]=function(_0x118db5){for(var _0x5a6236=0x0,_0x5adb1c=events[_0x9f01('0x7')];_0x5a6236<_0x5adb1c;_0x5a6236++){var _0xe677dc=events[_0x5a6236];var _0xa98eb0=createListener('openchannelInteraction:'+_0xe677dc,_0x118db5);OpenchannelInteractionEvents['on'](_0xe677dc,_0xa98eb0);}}; \ No newline at end of file +var _0xa724=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x5b9770,_0x14df6a){var _0x196a8b=function(_0x28d243){while(--_0x28d243){_0x5b9770['push'](_0x5b9770['shift']());}};_0x196a8b(++_0x14df6a);}(_0xa724,0x1ec));var _0x4a72=function(_0x446ce8,_0x429d42){_0x446ce8=_0x446ce8-0x0;var _0x293492=_0xa724[_0x446ce8];return _0x293492;};'use strict';var OpenchannelInteractionEvents=require(_0x4a72('0x0'));var events=[_0x4a72('0x1'),_0x4a72('0x2'),_0x4a72('0x3')];function createListener(_0x5d1b51,_0x24de37){return function(_0x470cbb){_0x24de37[_0x4a72('0x4')](_0x5d1b51,_0x470cbb);};}function removeListener(_0x3726c6,_0x351b47){return function(){OpenchannelInteractionEvents[_0x4a72('0x5')](_0x3726c6,_0x351b47);};}exports[_0x4a72('0x6')]=function(_0x4be45f){for(var _0x1a3012=0x0,_0x3819bc=events[_0x4a72('0x7')];_0x1a3012<_0x3819bc;_0x1a3012++){var _0x1c33d0=events[_0x1a3012];var _0x3d84a9=createListener(_0x4a72('0x8')+_0x1c33d0,_0x4be45f);OpenchannelInteractionEvents['on'](_0x1c33d0,_0x3d84a9);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 0ff04a5..1bff0bc 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x3a8049,_0x508772){var _0x27800b=function(_0x59fde1){while(--_0x59fde1){_0x3a8049['push'](_0x3a8049['shift']());}};_0x27800b(++_0x508772);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 00fb3ac..4985661 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 _0xb9e7=['ENUM','out','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0xb9e7[_0x3cb3ca];return _0x214366;};'use strict';var Sequelize=require('sequelize');module[_0x7b9e('0x0')]={'body':{'type':Sequelize[_0x7b9e('0x1')](_0x7b9e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7b9e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7b9e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b9e('0x4')]('in','out'),'defaultValue':_0x7b9e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7b9e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7b9e('0x1')]}}; \ No newline at end of file +var _0xd4a2=['sequelize','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xd4a2,0x173));var _0x2d4a=function(_0x577f26,_0x3c58c2){_0x577f26=_0x577f26-0x0;var _0x1b1d52=_0xd4a2[_0x577f26];return _0x1b1d52;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2d4a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2d4a('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2d4a('0x4')]},'providerName':{'type':Sequelize[_0x2d4a('0x5')]},'providerResponse':{'type':Sequelize[_0x2d4a('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c00c0d8..a5acd3c 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 _0x6a9f=['info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','include','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','jayson/promise','client','http','then'];(function(_0x347498,_0x332242){var _0x334f2b=function(_0x4156d1){while(--_0x4156d1){_0x347498['push'](_0x347498['shift']());}};_0x334f2b(++_0x332242);}(_0x6a9f,0x1e0));var _0xf6a9=function(_0x41943a,_0x1f9064){_0x41943a=_0x41943a-0x0;var _0x447f92=_0x6a9f[_0x41943a];return _0x447f92;};'use strict';var emlformat=require(_0xf6a9('0x0'));var rimraf=require(_0xf6a9('0x1'));var zipdir=require(_0xf6a9('0x2'));var jsonpatch=require(_0xf6a9('0x3'));var rp=require('request-promise');var moment=require(_0xf6a9('0x4'));var BPromise=require(_0xf6a9('0x5'));var Mustache=require('mustache');var util=require(_0xf6a9('0x6'));var path=require('path');var sox=require(_0xf6a9('0x7'));var csv=require(_0xf6a9('0x8'));var ejs=require(_0xf6a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6a9('0xa'));var squel=require(_0xf6a9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf6a9('0xc'));var toCsv=require(_0xf6a9('0x8'));var querystring=require(_0xf6a9('0xd'));var Papa=require(_0xf6a9('0xe'));var Redis=require('ioredis');var authService=require(_0xf6a9('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf6a9('0x10'));var hardwareService=require(_0xf6a9('0x11'));var logger=require(_0xf6a9('0x12'))('api');var utils=require(_0xf6a9('0x13'));var config=require(_0xf6a9('0x14'));var licenseUtil=require(_0xf6a9('0x15'));var db=require(_0xf6a9('0x16'))['db'];config['redis']=_[_0xf6a9('0x17')](config['redis'],{'host':_0xf6a9('0x18'),'port':0x18eb});var socket=require(_0xf6a9('0x19'))(new Redis(config[_0xf6a9('0x1a')]));require(_0xf6a9('0x1b'))['register'](socket);var jayson=require(_0xf6a9('0x1c'));var client=jayson[_0xf6a9('0x1d')][_0xf6a9('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xf6a9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4ddbd5,_0x14593d,_0x3af325,_0x23bbe4){return new BPromise(function(_0x177e9d,_0x24009f){var _0x10bbd9=_0x23bbe4||client;return _0x10bbd9['request'](_0x4ddbd5,_0x3af325)[_0xf6a9('0x1f')](function(_0x1580e0){logger[_0xf6a9('0x20')](_0xf6a9('0x21'),_0x14593d,'request\x20sent');logger[_0xf6a9('0x22')](_0xf6a9('0x23'),_0x14593d,_0xf6a9('0x24'),JSON[_0xf6a9('0x25')](_0x1580e0));if(_0x1580e0[_0xf6a9('0x26')]){if(_0x1580e0[_0xf6a9('0x26')][_0xf6a9('0x27')]===0x1f4){logger['error'](_0xf6a9('0x21'),_0x14593d,_0x1580e0['error'][_0xf6a9('0x28')]);return _0x24009f(_0x1580e0[_0xf6a9('0x26')][_0xf6a9('0x28')]);}logger[_0xf6a9('0x26')](_0xf6a9('0x21'),_0x14593d,_0x1580e0['error'][_0xf6a9('0x28')]);return _0x177e9d(_0x1580e0[_0xf6a9('0x26')][_0xf6a9('0x28')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x14593d,_0xf6a9('0x24'));_0x177e9d(_0x1580e0[_0xf6a9('0x29')]['message']);}})[_0xf6a9('0x2a')](function(_0x3c6bc8){logger[_0xf6a9('0x26')](_0xf6a9('0x21'),_0x14593d,_0x3c6bc8);_0x24009f(_0x3c6bc8);});});}function respondWithStatusCode(_0x37bce7,_0x2744e5){_0x2744e5=_0x2744e5||0xcc;return function(_0x47b3ec){if(_0x47b3ec){return _0x37bce7[_0xf6a9('0x2b')](_0x2744e5);}return _0x37bce7[_0xf6a9('0x2c')](_0x2744e5)[_0xf6a9('0x2d')]();};}function respondWithResult(_0x134a03,_0x3a9677){_0x3a9677=_0x3a9677||0xc8;return function(_0x3a1d56){if(_0x3a1d56){return _0x134a03['status'](_0x3a9677)[_0xf6a9('0x2e')](_0x3a1d56);}};}function respondWithFilteredResult(_0x43f7cb,_0x113d88){return function(_0x26ca94){if(_0x26ca94){var _0x52fb4e=typeof _0x113d88[_0xf6a9('0x2f')]===_0xf6a9('0x30')&&typeof _0x113d88['limit']===_0xf6a9('0x30');var _0x3d4875=_0x26ca94[_0xf6a9('0x31')];var _0xf3ea36=_0x52fb4e?0x0:_0x113d88['offset'];var _0x1edab8=_0x52fb4e?_0x26ca94['count']:_0x113d88['offset']+_0x113d88[_0xf6a9('0x32')];var _0x13bb4c;if(_0x1edab8>=_0x3d4875){_0x1edab8=_0x3d4875;_0x13bb4c=0xc8;}else{_0x13bb4c=0xce;}_0x43f7cb[_0xf6a9('0x2c')](_0x13bb4c);return _0x43f7cb[_0xf6a9('0x33')](_0xf6a9('0x34'),_0xf3ea36+'-'+_0x1edab8+'/'+_0x3d4875)['json'](_0x26ca94);}return null;};}function patchUpdates(_0xf1fd0c){return function(_0x499099){try{jsonpatch[_0xf6a9('0x35')](_0x499099,_0xf1fd0c,!![]);}catch(_0x143415){return BPromise[_0xf6a9('0x36')](_0x143415);}return _0x499099['save']();};}function saveUpdates(_0x226731,_0x29229d){return function(_0x5d8ca0){if(_0x5d8ca0){return _0x5d8ca0['update'](_0x226731)['then'](function(_0x3f6d18){return _0x3f6d18;});}return null;};}function removeEntity(_0x1c5df7,_0x38460d){return function(_0x16eacd){if(_0x16eacd){return _0x16eacd[_0xf6a9('0x37')]()['then'](function(){_0x1c5df7['status'](0xcc)[_0xf6a9('0x2d')]();});}};}function handleEntityNotFound(_0x42c1f0,_0x59a867){return function(_0x3d35da){if(!_0x3d35da){_0x42c1f0['sendStatus'](0x194);}return _0x3d35da;};}function handleError(_0x174e52,_0x428a3e){_0x428a3e=_0x428a3e||0x1f4;return function(_0x2728f8){logger[_0xf6a9('0x26')](_0x2728f8[_0xf6a9('0x38')]);if(_0x2728f8[_0xf6a9('0x39')]){delete _0x2728f8['name'];}_0x174e52[_0xf6a9('0x2c')](_0x428a3e)[_0xf6a9('0x3a')](_0x2728f8);};}exports['index']=function(_0x24aa53,_0x4932a8){var _0x509f9e={},_0x1413aa={},_0xccca96={'count':0x0,'rows':[]};var _0x2139e6=_[_0xf6a9('0x3b')](db[_0xf6a9('0x3c')][_0xf6a9('0x3d')],function(_0x13b8fe){return{'name':_0x13b8fe['fieldName'],'type':_0x13b8fe['type']['key']};});_0x1413aa[_0xf6a9('0x3e')]=_[_0xf6a9('0x3b')](_0x2139e6,'name');_0x1413aa['query']=_[_0xf6a9('0x3f')](_0x24aa53['query']);_0x1413aa[_0xf6a9('0x40')]=_[_0xf6a9('0x41')](_0x1413aa[_0xf6a9('0x3e')],_0x1413aa[_0xf6a9('0x42')]);_0x509f9e[_0xf6a9('0x43')]=_[_0xf6a9('0x41')](_0x1413aa['model'],qs[_0xf6a9('0x44')](_0x24aa53['query']['fields']));_0x509f9e[_0xf6a9('0x43')]=_0x509f9e[_0xf6a9('0x43')]['length']?_0x509f9e['attributes']:_0x1413aa[_0xf6a9('0x3e')];if(!_0x24aa53[_0xf6a9('0x42')][_0xf6a9('0x45')](_0xf6a9('0x46'))){_0x509f9e['limit']=qs[_0xf6a9('0x32')](_0x24aa53[_0xf6a9('0x42')][_0xf6a9('0x32')]);_0x509f9e[_0xf6a9('0x2f')]=qs[_0xf6a9('0x2f')](_0x24aa53['query'][_0xf6a9('0x2f')]);}_0x509f9e[_0xf6a9('0x47')]=qs['sort'](_0x24aa53[_0xf6a9('0x42')]['sort']);_0x509f9e[_0xf6a9('0x48')]=qs['filters'](_[_0xf6a9('0x49')](_0x24aa53['query'],_0x1413aa[_0xf6a9('0x40')]),_0x2139e6);if(_0x24aa53[_0xf6a9('0x42')]['filter']){_0x509f9e[_0xf6a9('0x48')]=_[_0xf6a9('0x4a')](_0x509f9e[_0xf6a9('0x48')],{'$or':_['map'](_0x2139e6,function(_0x4283fe){if(_0x4283fe['type']!==_0xf6a9('0x4b')){var _0x5018b1={};_0x5018b1[_0x4283fe[_0xf6a9('0x39')]]={'$like':'%'+_0x24aa53[_0xf6a9('0x42')][_0xf6a9('0x4c')]+'%'};return _0x5018b1;}})});}_0x509f9e=_[_0xf6a9('0x4a')]({},_0x509f9e,_0x24aa53[_0xf6a9('0x4d')]);var _0x190ac4={'where':_0x509f9e[_0xf6a9('0x48')]};return db['OpenchannelMessage']['count'](_0x190ac4)[_0xf6a9('0x1f')](function(_0x545232){_0xccca96[_0xf6a9('0x31')]=_0x545232;if(_0x24aa53[_0xf6a9('0x42')][_0xf6a9('0x4e')]){_0x509f9e['include']=[{'all':!![]}];}return db[_0xf6a9('0x3c')][_0xf6a9('0x4f')](_0x509f9e);})[_0xf6a9('0x1f')](function(_0x1b96ae){_0xccca96[_0xf6a9('0x50')]=_0x1b96ae;return _0xccca96;})[_0xf6a9('0x1f')](respondWithFilteredResult(_0x4932a8,_0x509f9e))['catch'](handleError(_0x4932a8,null));};exports[_0xf6a9('0x51')]=function(_0x290219,_0x16f3da){var _0x500de6={'raw':!![],'where':{'id':_0x290219['params']['id']}},_0x54cfae={};_0x54cfae['model']=_[_0xf6a9('0x3f')](db[_0xf6a9('0x3c')][_0xf6a9('0x3d')]);_0x54cfae['query']=_[_0xf6a9('0x3f')](_0x290219[_0xf6a9('0x42')]);_0x54cfae['filters']=_[_0xf6a9('0x41')](_0x54cfae['model'],_0x54cfae[_0xf6a9('0x42')]);_0x500de6['attributes']=_[_0xf6a9('0x41')](_0x54cfae[_0xf6a9('0x3e')],qs[_0xf6a9('0x44')](_0x290219[_0xf6a9('0x42')][_0xf6a9('0x44')]));_0x500de6[_0xf6a9('0x43')]=_0x500de6[_0xf6a9('0x43')]['length']?_0x500de6[_0xf6a9('0x43')]:_0x54cfae[_0xf6a9('0x3e')];if(_0x290219['query'][_0xf6a9('0x4e')]){_0x500de6[_0xf6a9('0x52')]=[{'all':!![]}];}_0x500de6=_[_0xf6a9('0x4a')]({},_0x500de6,_0x290219[_0xf6a9('0x4d')]);return db[_0xf6a9('0x3c')][_0xf6a9('0x53')](_0x500de6)['then'](handleEntityNotFound(_0x16f3da,null))[_0xf6a9('0x1f')](respondWithResult(_0x16f3da,null))[_0xf6a9('0x2a')](handleError(_0x16f3da,null));};exports[_0xf6a9('0x54')]=function(_0x3203b6,_0x443ef3){return db[_0xf6a9('0x3c')]['create'](_0x3203b6[_0xf6a9('0x55')],{})['then'](respondWithResult(_0x443ef3,0xc9))[_0xf6a9('0x2a')](handleError(_0x443ef3,null));};exports[_0xf6a9('0x56')]=function(_0x978933,_0x151bd1){if(_0x978933[_0xf6a9('0x55')]['id']){delete _0x978933[_0xf6a9('0x55')]['id'];}return db[_0xf6a9('0x3c')][_0xf6a9('0x53')]({'where':{'id':_0x978933[_0xf6a9('0x57')]['id']}})[_0xf6a9('0x1f')](handleEntityNotFound(_0x151bd1,null))[_0xf6a9('0x1f')](saveUpdates(_0x978933[_0xf6a9('0x55')],null))[_0xf6a9('0x1f')](respondWithResult(_0x151bd1,null))[_0xf6a9('0x2a')](handleError(_0x151bd1,null));};exports[_0xf6a9('0x37')]=function(_0x5b0ab0,_0x41949f){return db['OpenchannelMessage'][_0xf6a9('0x53')]({'where':{'id':_0x5b0ab0[_0xf6a9('0x57')]['id']}})[_0xf6a9('0x1f')](handleEntityNotFound(_0x41949f,null))[_0xf6a9('0x1f')](removeEntity(_0x41949f,null))[_0xf6a9('0x2a')](handleError(_0x41949f,null));};exports[_0xf6a9('0x58')]=function(_0x4e0409,_0x24cc9e){return db[_0xf6a9('0x3c')][_0xf6a9('0x58')]()['then'](respondWithResult(_0x24cc9e,null))[_0xf6a9('0x2a')](handleError(_0x24cc9e,null));};var interaction_log=require(_0xf6a9('0x12'))(_0xf6a9('0x59'));exports[_0xf6a9('0x5a')]=function(_0x431591,_0x326acd,_0xb4d86){var _0x35800b={'agent':{},'channel':_0xf6a9('0x5b')};if(_0x431591[_0xf6a9('0x55')]['id']){delete _0x431591[_0xf6a9('0x55')]['id'];}_0x431591['body'][_0xf6a9('0x5c')]=!![];_0x431591['body']['readAt']=moment()[_0xf6a9('0x5d')](_0xf6a9('0x5e'));_0x431591[_0xf6a9('0x55')][_0xf6a9('0x5f')]=_0x431591['body'][_0xf6a9('0x5f')]||_0x431591[_0xf6a9('0x60')]['id'];_0x35800b[_0xf6a9('0x61')]['id']=_0x431591[_0xf6a9('0x55')]['UserId'];return db[_0xf6a9('0x3c')]['find']({'where':{'id':_0x431591[_0xf6a9('0x57')]['id'],'UserId':null}})[_0xf6a9('0x1f')](handleEntityNotFound(_0x326acd,null))[_0xf6a9('0x1f')](saveUpdates(_0x431591[_0xf6a9('0x55')],null))[_0xf6a9('0x1f')](function(_0x2e8053){if(_0x2e8053){_0x35800b[_0xf6a9('0x28')]=_0x2e8053[_0xf6a9('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf6a9('0x53')]({'where':{'id':_0x2e8053[_0xf6a9('0x63')]}});}return null;})[_0xf6a9('0x1f')](handleEntityNotFound(_0x326acd,null))[_0xf6a9('0x1f')](function(_0xb80df8){if(_0xb80df8){return _0xb80df8[_0xf6a9('0x56')]({'UserId':_0x431591['body']['UserId'],'read1stAt':_[_0xf6a9('0x64')](_0xb80df8['read1stAt'])?moment()[_0xf6a9('0x5d')](_0xf6a9('0x5e')):undefined});}return null;})[_0xf6a9('0x1f')](function(_0x140f09){if(_0x140f09){_0x35800b[_0xf6a9('0x65')]=_0x140f09[_0xf6a9('0x62')]({'plain':!![]});interaction_log[_0xf6a9('0x20')](_0xf6a9('0x66'),_0x431591[_0xf6a9('0x60')]['id'],_0x431591['user']['name'],_0x431591[_0xf6a9('0x60')]['role'],_0x35800b[_0xf6a9('0x65')]['id'],_0x431591[_0xf6a9('0x55')]?JSON['stringify'](_0x431591[_0xf6a9('0x55')]):_0xf6a9('0x67'));return respondWithRpcPromise(_0xf6a9('0x68'),_0xf6a9('0x69'),_0x35800b);}return null;})['then'](function(_0x643f85){var _0x1ecebe=_0xf6a9('0x6a')+_0x643f85[_0xf6a9('0x28')][_0xf6a9('0x6b')];return db[_0xf6a9('0x6c')][_0xf6a9('0x42')](_0x1ecebe,{'type':db[_0xf6a9('0x6d')][_0xf6a9('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x3fc15c){return _0x3fc15c;});})['then'](function(_0x133ea1){if(_0x133ea1){_0x35800b[_0xf6a9('0x28')][_0xf6a9('0x6f')]=_0x133ea1[0x0];if(!_0x431591[_0xf6a9('0x55')][_0xf6a9('0x5f')])return;return db[_0xf6a9('0x70')]['find']({'where':{'id':_0x431591[_0xf6a9('0x55')]['UserId'],'role':'agent'},'attributes':['id','name',_0xf6a9('0x71'),_0xf6a9('0x72'),'internal'],'raw':!![]});}return null;})[_0xf6a9('0x1f')](function(_0x4624ff){if(!_0x4624ff)return null;_0x35800b[_0xf6a9('0x28')][_0xf6a9('0x61')]=_0x4624ff;return _0x35800b;})['then'](function(_0x43dadf){if(_0x43dadf){if(_0x431591[_0xf6a9('0x55')][_0xf6a9('0x73')]){_0x35800b[_0xf6a9('0x28')][_0xf6a9('0x74')]=util['format']('SIP/%s',_0x431591['user'][_0xf6a9('0x39')]);_0x35800b['message'][_0xf6a9('0x75')]=_0x35800b[_0xf6a9('0x75')];_0x35800b[_0xf6a9('0x28')][_0xf6a9('0x76')]=_0x35800b[_0xf6a9('0x75')];_0x35800b['message'][_0xf6a9('0x77')]=_0xf6a9('0x5a');return respondWithRpcPromise('EventManager',_0xf6a9('0x78'),{'event':_0xf6a9('0x79'),'message':_0x35800b[_0xf6a9('0x28')]},client9002)[_0xf6a9('0x1f')](function(){return _0x35800b;});}return _0x35800b;}return null;})[_0xf6a9('0x1f')](respondWithResult(_0x326acd,null))[_0xf6a9('0x2a')](handleError(_0x326acd,null));};var interaction_log=require('../../config/logger')(_0xf6a9('0x59'));exports[_0xf6a9('0x36')]=function(_0x5e99cf,_0x289e86,_0x51cb9b){var _0x5c861d={'agent':{},'channel':_0xf6a9('0x5b')};if(_0x5e99cf[_0xf6a9('0x55')]['id']){delete _0x5e99cf[_0xf6a9('0x55')]['id'];}_0x5e99cf[_0xf6a9('0x55')][_0xf6a9('0x5f')]=_0x5e99cf[_0xf6a9('0x55')][_0xf6a9('0x5f')]||_0x5e99cf[_0xf6a9('0x60')]['id'];_0x5c861d[_0xf6a9('0x61')]['id']=_0x5e99cf[_0xf6a9('0x55')][_0xf6a9('0x5f')];return db[_0xf6a9('0x3c')][_0xf6a9('0x53')]({'where':{'id':_0x5e99cf[_0xf6a9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x289e86,null))[_0xf6a9('0x1f')](function(_0xeb2fd){if(_0xeb2fd){_0x5c861d[_0xf6a9('0x28')]=_0xeb2fd[_0xf6a9('0x62')]({'plain':!![]});return db[_0xf6a9('0x7a')]['find']({'where':{'id':_0xeb2fd[_0xf6a9('0x63')]}});}return null;})[_0xf6a9('0x1f')](handleEntityNotFound(_0x289e86,null))[_0xf6a9('0x1f')](function(_0xe29065){if(_0xe29065){_0x5c861d['interaction']=_0xe29065[_0xf6a9('0x62')]({'plain':!![]});interaction_log['info'](_0xf6a9('0x7b'),_0x5e99cf[_0xf6a9('0x60')]['id'],_0x5e99cf[_0xf6a9('0x60')][_0xf6a9('0x39')],_0x5e99cf[_0xf6a9('0x60')]['role'],_0x5c861d['interaction']['id'],_0x5e99cf[_0xf6a9('0x55')]?JSON[_0xf6a9('0x25')](_0x5e99cf[_0xf6a9('0x55')]):_0xf6a9('0x67'));return respondWithRpcPromise(_0xf6a9('0x7c'),_0xf6a9('0x7d'),_0x5c861d);}return null;})[_0xf6a9('0x1f')](function(_0x548ab7){var _0x543382=_0xf6a9('0x6a')+_0x548ab7[_0xf6a9('0x28')]['ContactId'];return db[_0xf6a9('0x6c')][_0xf6a9('0x42')](_0x543382,{'type':db[_0xf6a9('0x6d')][_0xf6a9('0x6e')]['SELECT'],'raw':!![]})[_0xf6a9('0x1f')](function(_0x2a3e5e){return _0x2a3e5e;});})[_0xf6a9('0x1f')](function(_0x342d69){if(_0x342d69){_0x5c861d[_0xf6a9('0x28')][_0xf6a9('0x6f')]=_0x342d69[0x0];if(!_0x5e99cf[_0xf6a9('0x55')][_0xf6a9('0x5f')])return;return db[_0xf6a9('0x70')]['find']({'where':{'id':_0x5e99cf[_0xf6a9('0x55')][_0xf6a9('0x5f')],'role':_0xf6a9('0x61')},'attributes':['id',_0xf6a9('0x39'),_0xf6a9('0x71'),'email',_0xf6a9('0x7e')],'raw':!![]});}return null;})['then'](function(_0x405d40){if(!_0x405d40)return null;_0x5c861d[_0xf6a9('0x28')][_0xf6a9('0x61')]=_0x405d40;return _0x5c861d;})[_0xf6a9('0x1f')](function(_0x4bc164){if(_0x4bc164){_0x4bc164[_0xf6a9('0x28')]['interface']=util[_0xf6a9('0x5d')]('SIP/%s',_0x5e99cf[_0xf6a9('0x60')][_0xf6a9('0x39')]);_0x4bc164['message'][_0xf6a9('0x75')]=_0x5c861d[_0xf6a9('0x75')];_0x4bc164[_0xf6a9('0x28')][_0xf6a9('0x76')]=_0x5c861d['channel'];_0x4bc164[_0xf6a9('0x28')][_0xf6a9('0x77')]=_0xf6a9('0x36');respondWithRpcPromise(_0xf6a9('0x78'),_0xf6a9('0x78'),{'event':_0xf6a9('0x7f'),'message':_0x4bc164[_0xf6a9('0x28')]},client9002);return _0x5c861d;}return null;})['then'](respondWithResult(_0x289e86,null))['catch'](handleError(_0x289e86,null));}; \ No newline at end of file +var _0x142f=['length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelMessage','includeAll','include','findAll','show','find','create','body','update','params','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','internal','manual','SIP/%s','channel','event','EventManager','RejectMessage','sequelize','SELECT','User','email','interface','rejectmessage','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','then','destroy','sendStatus','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x52e101,_0x308802){var _0x5ac202=function(_0x2948b2){while(--_0x2948b2){_0x52e101['push'](_0x52e101['shift']());}};_0x5ac202(++_0x308802);}(_0x142f,0x136));var _0xf142=function(_0x313fb7,_0xde30fb){_0x313fb7=_0x313fb7-0x0;var _0x358b83=_0x142f[_0x313fb7];return _0x358b83;};'use strict';var emlformat=require(_0xf142('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf142('0x1'));var rp=require(_0xf142('0x2'));var moment=require(_0xf142('0x3'));var BPromise=require(_0xf142('0x4'));var Mustache=require(_0xf142('0x5'));var util=require(_0xf142('0x6'));var path=require(_0xf142('0x7'));var sox=require(_0xf142('0x8'));var csv=require(_0xf142('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf142('0xa'));var _=require(_0xf142('0xb'));var squel=require(_0xf142('0xc'));var crypto=require('crypto');var jsforce=require(_0xf142('0xd'));var deskjs=require(_0xf142('0xe'));var toCsv=require(_0xf142('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf142('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf142('0x10'));var as=require(_0xf142('0x11'));var hardwareService=require(_0xf142('0x12'));var logger=require(_0xf142('0x13'))(_0xf142('0x14'));var utils=require('../../config/utils');var config=require(_0xf142('0x15'));var licenseUtil=require(_0xf142('0x16'));var db=require(_0xf142('0x17'))['db'];config['redis']=_[_0xf142('0x18')](config['redis'],{'host':_0xf142('0x19'),'port':0x18eb});var socket=require(_0xf142('0x1a'))(new Redis(config[_0xf142('0x1b')]));require(_0xf142('0x1c'))['register'](socket);var jayson=require(_0xf142('0x1d'));var client=jayson[_0xf142('0x1e')][_0xf142('0x1f')]({'port':0x232c});var client9002=jayson[_0xf142('0x1e')][_0xf142('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1bc407,_0x5b907e,_0x23844d,_0x438d9d){return new BPromise(function(_0x57ed2e,_0x133de1){var _0x2b677a=_0x438d9d||client;return _0x2b677a[_0xf142('0x20')](_0x1bc407,_0x23844d)['then'](function(_0x1c02f5){logger[_0xf142('0x21')](_0xf142('0x22'),_0x5b907e,_0xf142('0x23'));logger[_0xf142('0x24')](_0xf142('0x25'),_0x5b907e,_0xf142('0x23'),JSON['stringify'](_0x1c02f5));if(_0x1c02f5[_0xf142('0x26')]){if(_0x1c02f5[_0xf142('0x26')][_0xf142('0x27')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x5b907e,_0x1c02f5[_0xf142('0x26')]['message']);return _0x133de1(_0x1c02f5[_0xf142('0x26')]['message']);}logger[_0xf142('0x26')](_0xf142('0x22'),_0x5b907e,_0x1c02f5[_0xf142('0x26')]['message']);return _0x57ed2e(_0x1c02f5['error']['message']);}else{logger[_0xf142('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x5b907e,_0xf142('0x23'));_0x57ed2e(_0x1c02f5['result'][_0xf142('0x28')]);}})[_0xf142('0x29')](function(_0x53d75d){logger[_0xf142('0x26')](_0xf142('0x22'),_0x5b907e,_0x53d75d);_0x133de1(_0x53d75d);});});}function respondWithStatusCode(_0x22a39e,_0x68dc73){_0x68dc73=_0x68dc73||0xcc;return function(_0x151ee7){if(_0x151ee7){return _0x22a39e['sendStatus'](_0x68dc73);}return _0x22a39e[_0xf142('0x2a')](_0x68dc73)[_0xf142('0x2b')]();};}function respondWithResult(_0x5b6193,_0x45ad07){_0x45ad07=_0x45ad07||0xc8;return function(_0x3b192a){if(_0x3b192a){return _0x5b6193['status'](_0x45ad07)['json'](_0x3b192a);}};}function respondWithFilteredResult(_0x3da9e9,_0x219e93){return function(_0x481b76){if(_0x481b76){var _0x2dad80=typeof _0x219e93[_0xf142('0x2c')]==='undefined'&&typeof _0x219e93[_0xf142('0x2d')]===_0xf142('0x2e');var _0x3d4a13=_0x481b76['count'];var _0x4500e0=_0x2dad80?0x0:_0x219e93[_0xf142('0x2c')];var _0x193d83=_0x2dad80?_0x481b76[_0xf142('0x2f')]:_0x219e93['offset']+_0x219e93[_0xf142('0x2d')];var _0xbdf83e;if(_0x193d83>=_0x3d4a13){_0x193d83=_0x3d4a13;_0xbdf83e=0xc8;}else{_0xbdf83e=0xce;}_0x3da9e9[_0xf142('0x2a')](_0xbdf83e);return _0x3da9e9[_0xf142('0x30')](_0xf142('0x31'),_0x4500e0+'-'+_0x193d83+'/'+_0x3d4a13)[_0xf142('0x32')](_0x481b76);}return null;};}function patchUpdates(_0x1dd818){return function(_0x3973d0){try{jsonpatch[_0xf142('0x33')](_0x3973d0,_0x1dd818,!![]);}catch(_0x5bf1e9){return BPromise[_0xf142('0x34')](_0x5bf1e9);}return _0x3973d0['save']();};}function saveUpdates(_0x329653,_0x565670){return function(_0x2c41e9){if(_0x2c41e9){return _0x2c41e9['update'](_0x329653)[_0xf142('0x35')](function(_0x4a41f6){return _0x4a41f6;});}return null;};}function removeEntity(_0xe85913,_0x4e5a5e){return function(_0x58d7ad){if(_0x58d7ad){return _0x58d7ad[_0xf142('0x36')]()[_0xf142('0x35')](function(){_0xe85913[_0xf142('0x2a')](0xcc)[_0xf142('0x2b')]();});}};}function handleEntityNotFound(_0x2dbc77,_0x14381e){return function(_0x8cb6cf){if(!_0x8cb6cf){_0x2dbc77[_0xf142('0x37')](0x194);}return _0x8cb6cf;};}function handleError(_0x35f39f,_0x1b3951){_0x1b3951=_0x1b3951||0x1f4;return function(_0x29122b){logger[_0xf142('0x26')](_0x29122b['stack']);if(_0x29122b[_0xf142('0x38')]){delete _0x29122b['name'];}_0x35f39f[_0xf142('0x2a')](_0x1b3951)['send'](_0x29122b);};}exports[_0xf142('0x39')]=function(_0x5aaffe,_0x5f239d){var _0x4fbd8b={},_0x33a4b2={},_0x149d6c={'count':0x0,'rows':[]};var _0x39b228=_['map'](db['OpenchannelMessage'][_0xf142('0x3a')],function(_0x375712){return{'name':_0x375712['fieldName'],'type':_0x375712['type'][_0xf142('0x3b')]};});_0x33a4b2[_0xf142('0x3c')]=_[_0xf142('0x3d')](_0x39b228,_0xf142('0x38'));_0x33a4b2[_0xf142('0x3e')]=_[_0xf142('0x3f')](_0x5aaffe[_0xf142('0x3e')]);_0x33a4b2[_0xf142('0x40')]=_[_0xf142('0x41')](_0x33a4b2['model'],_0x33a4b2[_0xf142('0x3e')]);_0x4fbd8b['attributes']=_['intersection'](_0x33a4b2['model'],qs[_0xf142('0x42')](_0x5aaffe[_0xf142('0x3e')][_0xf142('0x42')]));_0x4fbd8b[_0xf142('0x43')]=_0x4fbd8b['attributes'][_0xf142('0x44')]?_0x4fbd8b[_0xf142('0x43')]:_0x33a4b2[_0xf142('0x3c')];if(!_0x5aaffe['query']['hasOwnProperty'](_0xf142('0x45'))){_0x4fbd8b[_0xf142('0x2d')]=qs[_0xf142('0x2d')](_0x5aaffe['query']['limit']);_0x4fbd8b[_0xf142('0x2c')]=qs[_0xf142('0x2c')](_0x5aaffe[_0xf142('0x3e')][_0xf142('0x2c')]);}_0x4fbd8b[_0xf142('0x46')]=qs[_0xf142('0x47')](_0x5aaffe[_0xf142('0x3e')][_0xf142('0x47')]);_0x4fbd8b[_0xf142('0x48')]=qs[_0xf142('0x40')](_[_0xf142('0x49')](_0x5aaffe['query'],_0x33a4b2[_0xf142('0x40')]),_0x39b228);if(_0x5aaffe['query'][_0xf142('0x4a')]){_0x4fbd8b[_0xf142('0x48')]=_[_0xf142('0x4b')](_0x4fbd8b[_0xf142('0x48')],{'$or':_['map'](_0x39b228,function(_0x7fc38){if(_0x7fc38['type']!==_0xf142('0x4c')){var _0x1d169e={};_0x1d169e[_0x7fc38[_0xf142('0x38')]]={'$like':'%'+_0x5aaffe[_0xf142('0x3e')][_0xf142('0x4a')]+'%'};return _0x1d169e;}})});}_0x4fbd8b=_[_0xf142('0x4b')]({},_0x4fbd8b,_0x5aaffe['options']);var _0x314b10={'where':_0x4fbd8b['where']};return db[_0xf142('0x4d')][_0xf142('0x2f')](_0x314b10)['then'](function(_0xd35afd){_0x149d6c['count']=_0xd35afd;if(_0x5aaffe[_0xf142('0x3e')][_0xf142('0x4e')]){_0x4fbd8b[_0xf142('0x4f')]=[{'all':!![]}];}return db[_0xf142('0x4d')][_0xf142('0x50')](_0x4fbd8b);})[_0xf142('0x35')](function(_0x12997e){_0x149d6c['rows']=_0x12997e;return _0x149d6c;})['then'](respondWithFilteredResult(_0x5f239d,_0x4fbd8b))[_0xf142('0x29')](handleError(_0x5f239d,null));};exports[_0xf142('0x51')]=function(_0x590ec7,_0x134ec1){var _0x27ec71={'raw':!![],'where':{'id':_0x590ec7['params']['id']}},_0x1e1d6d={};_0x1e1d6d[_0xf142('0x3c')]=_[_0xf142('0x3f')](db[_0xf142('0x4d')]['rawAttributes']);_0x1e1d6d['query']=_[_0xf142('0x3f')](_0x590ec7[_0xf142('0x3e')]);_0x1e1d6d[_0xf142('0x40')]=_[_0xf142('0x41')](_0x1e1d6d[_0xf142('0x3c')],_0x1e1d6d[_0xf142('0x3e')]);_0x27ec71[_0xf142('0x43')]=_[_0xf142('0x41')](_0x1e1d6d[_0xf142('0x3c')],qs[_0xf142('0x42')](_0x590ec7[_0xf142('0x3e')][_0xf142('0x42')]));_0x27ec71[_0xf142('0x43')]=_0x27ec71['attributes']['length']?_0x27ec71[_0xf142('0x43')]:_0x1e1d6d[_0xf142('0x3c')];if(_0x590ec7[_0xf142('0x3e')][_0xf142('0x4e')]){_0x27ec71[_0xf142('0x4f')]=[{'all':!![]}];}_0x27ec71=_[_0xf142('0x4b')]({},_0x27ec71,_0x590ec7['options']);return db[_0xf142('0x4d')][_0xf142('0x52')](_0x27ec71)[_0xf142('0x35')](handleEntityNotFound(_0x134ec1,null))[_0xf142('0x35')](respondWithResult(_0x134ec1,null))[_0xf142('0x29')](handleError(_0x134ec1,null));};exports[_0xf142('0x53')]=function(_0x1958ff,_0x3e5695){return db[_0xf142('0x4d')][_0xf142('0x53')](_0x1958ff[_0xf142('0x54')],{})[_0xf142('0x35')](respondWithResult(_0x3e5695,0xc9))[_0xf142('0x29')](handleError(_0x3e5695,null));};exports[_0xf142('0x55')]=function(_0x1a07ff,_0x2c668a){if(_0x1a07ff[_0xf142('0x54')]['id']){delete _0x1a07ff[_0xf142('0x54')]['id'];}return db[_0xf142('0x4d')][_0xf142('0x52')]({'where':{'id':_0x1a07ff['params']['id']}})[_0xf142('0x35')](handleEntityNotFound(_0x2c668a,null))[_0xf142('0x35')](saveUpdates(_0x1a07ff[_0xf142('0x54')],null))[_0xf142('0x35')](respondWithResult(_0x2c668a,null))['catch'](handleError(_0x2c668a,null));};exports[_0xf142('0x36')]=function(_0x5a5867,_0x1112a3){return db['OpenchannelMessage']['find']({'where':{'id':_0x5a5867[_0xf142('0x56')]['id']}})[_0xf142('0x35')](handleEntityNotFound(_0x1112a3,null))['then'](removeEntity(_0x1112a3,null))[_0xf142('0x29')](handleError(_0x1112a3,null));};exports[_0xf142('0x57')]=function(_0x3cc131,_0x402a9a){return db['OpenchannelMessage']['describe']()['then'](respondWithResult(_0x402a9a,null))[_0xf142('0x29')](handleError(_0x402a9a,null));};var interaction_log=require(_0xf142('0x13'))(_0xf142('0x58'));exports[_0xf142('0x59')]=function(_0x2f56db,_0x5c1482,_0x167c70){var _0x3b9ea0={'agent':{},'channel':_0xf142('0x5a')};if(_0x2f56db[_0xf142('0x54')]['id']){delete _0x2f56db[_0xf142('0x54')]['id'];}_0x2f56db[_0xf142('0x54')]['read']=!![];_0x2f56db['body'][_0xf142('0x5b')]=moment()[_0xf142('0x5c')](_0xf142('0x5d'));_0x2f56db[_0xf142('0x54')][_0xf142('0x5e')]=_0x2f56db['body'][_0xf142('0x5e')]||_0x2f56db['user']['id'];_0x3b9ea0[_0xf142('0x5f')]['id']=_0x2f56db[_0xf142('0x54')][_0xf142('0x5e')];return db['OpenchannelMessage'][_0xf142('0x52')]({'where':{'id':_0x2f56db[_0xf142('0x56')]['id'],'UserId':null}})[_0xf142('0x35')](handleEntityNotFound(_0x5c1482,null))['then'](saveUpdates(_0x2f56db[_0xf142('0x54')],null))[_0xf142('0x35')](function(_0x5c0650){if(_0x5c0650){_0x3b9ea0[_0xf142('0x28')]=_0x5c0650[_0xf142('0x60')]({'plain':!![]});return db[_0xf142('0x61')]['find']({'where':{'id':_0x5c0650[_0xf142('0x62')]}});}return null;})[_0xf142('0x35')](handleEntityNotFound(_0x5c1482,null))[_0xf142('0x35')](function(_0x397443){if(_0x397443){return _0x397443['update']({'UserId':_0x2f56db[_0xf142('0x54')][_0xf142('0x5e')],'read1stAt':_[_0xf142('0x63')](_0x397443['read1stAt'])?moment()[_0xf142('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x2618b1){if(_0x2618b1){_0x3b9ea0[_0xf142('0x64')]=_0x2618b1[_0xf142('0x60')]({'plain':!![]});interaction_log[_0xf142('0x21')](_0xf142('0x65'),_0x2f56db[_0xf142('0x66')]['id'],_0x2f56db[_0xf142('0x66')][_0xf142('0x38')],_0x2f56db['user'][_0xf142('0x67')],_0x3b9ea0['interaction']['id'],_0x2f56db[_0xf142('0x54')]?JSON[_0xf142('0x68')](_0x2f56db[_0xf142('0x54')]):_0xf142('0x69'));return respondWithRpcPromise(_0xf142('0x6a'),'acceptMessage',_0x3b9ea0);}return null;})[_0xf142('0x35')](function(_0x2b3110){var _0x272b29=_0xf142('0x6b')+_0x2b3110['message'][_0xf142('0x6c')];return db['sequelize']['query'](_0x272b29,{'type':db[_0xf142('0x6d')][_0xf142('0x6e')]['SELECT'],'raw':!![]})[_0xf142('0x35')](function(_0x4cf369){return _0x4cf369;});})[_0xf142('0x35')](function(_0x5dadec){if(_0x5dadec){_0x3b9ea0['message'][_0xf142('0x6f')]=_0x5dadec[0x0];if(!_0x2f56db[_0xf142('0x54')][_0xf142('0x5e')])return;return db['User']['find']({'where':{'id':_0x2f56db['body'][_0xf142('0x5e')],'role':_0xf142('0x5f')},'attributes':['id','name',_0xf142('0x70'),'email',_0xf142('0x71')],'raw':!![]});}return null;})[_0xf142('0x35')](function(_0x261304){if(!_0x261304)return null;_0x3b9ea0[_0xf142('0x28')][_0xf142('0x5f')]=_0x261304;return _0x3b9ea0;})[_0xf142('0x35')](function(_0x22490d){if(_0x22490d){if(_0x2f56db[_0xf142('0x54')][_0xf142('0x72')]){_0x3b9ea0[_0xf142('0x28')]['interface']=util[_0xf142('0x5c')](_0xf142('0x73'),_0x2f56db[_0xf142('0x66')][_0xf142('0x38')]);_0x3b9ea0[_0xf142('0x28')][_0xf142('0x74')]=_0x3b9ea0[_0xf142('0x74')];_0x3b9ea0[_0xf142('0x28')]['motionChannel']=_0x3b9ea0[_0xf142('0x74')];_0x3b9ea0[_0xf142('0x28')][_0xf142('0x75')]=_0xf142('0x59');return respondWithRpcPromise('EventManager',_0xf142('0x76'),{'event':'acceptmessage','message':_0x3b9ea0[_0xf142('0x28')]},client9002)[_0xf142('0x35')](function(){return _0x3b9ea0;});}return _0x3b9ea0;}return null;})[_0xf142('0x35')](respondWithResult(_0x5c1482,null))[_0xf142('0x29')](handleError(_0x5c1482,null));};var interaction_log=require(_0xf142('0x13'))(_0xf142('0x58'));exports[_0xf142('0x34')]=function(_0x15c5e9,_0x1d8289,_0x4bcdd9){var _0xe8bcc3={'agent':{},'channel':_0xf142('0x5a')};if(_0x15c5e9[_0xf142('0x54')]['id']){delete _0x15c5e9['body']['id'];}_0x15c5e9[_0xf142('0x54')]['UserId']=_0x15c5e9[_0xf142('0x54')][_0xf142('0x5e')]||_0x15c5e9[_0xf142('0x66')]['id'];_0xe8bcc3[_0xf142('0x5f')]['id']=_0x15c5e9[_0xf142('0x54')][_0xf142('0x5e')];return db[_0xf142('0x4d')]['find']({'where':{'id':_0x15c5e9[_0xf142('0x56')]['id'],'UserId':null}})[_0xf142('0x35')](handleEntityNotFound(_0x1d8289,null))[_0xf142('0x35')](function(_0x3f7a11){if(_0x3f7a11){_0xe8bcc3[_0xf142('0x28')]=_0x3f7a11[_0xf142('0x60')]({'plain':!![]});return db['OpenchannelInteraction'][_0xf142('0x52')]({'where':{'id':_0x3f7a11[_0xf142('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1d8289,null))[_0xf142('0x35')](function(_0x177dce){if(_0x177dce){_0xe8bcc3[_0xf142('0x64')]=_0x177dce['get']({'plain':!![]});interaction_log[_0xf142('0x21')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x15c5e9['user']['id'],_0x15c5e9[_0xf142('0x66')]['name'],_0x15c5e9[_0xf142('0x66')][_0xf142('0x67')],_0xe8bcc3['interaction']['id'],_0x15c5e9[_0xf142('0x54')]?JSON[_0xf142('0x68')](_0x15c5e9[_0xf142('0x54')]):_0xf142('0x69'));return respondWithRpcPromise(_0xf142('0x77'),'rejectMessage',_0xe8bcc3);}return null;})['then'](function(_0x465a56){var _0x3229c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x465a56[_0xf142('0x28')][_0xf142('0x6c')];return db[_0xf142('0x78')][_0xf142('0x3e')](_0x3229c7,{'type':db[_0xf142('0x6d')][_0xf142('0x6e')][_0xf142('0x79')],'raw':!![]})[_0xf142('0x35')](function(_0x47a03e){return _0x47a03e;});})[_0xf142('0x35')](function(_0x37c2d3){if(_0x37c2d3){_0xe8bcc3[_0xf142('0x28')]['contact']=_0x37c2d3[0x0];if(!_0x15c5e9[_0xf142('0x54')][_0xf142('0x5e')])return;return db[_0xf142('0x7a')]['find']({'where':{'id':_0x15c5e9['body'][_0xf142('0x5e')],'role':'agent'},'attributes':['id',_0xf142('0x38'),_0xf142('0x70'),_0xf142('0x7b'),_0xf142('0x71')],'raw':!![]});}return null;})[_0xf142('0x35')](function(_0x1816b2){if(!_0x1816b2)return null;_0xe8bcc3['message'][_0xf142('0x5f')]=_0x1816b2;return _0xe8bcc3;})[_0xf142('0x35')](function(_0xf3e5d7){if(_0xf3e5d7){_0xf3e5d7['message'][_0xf142('0x7c')]=util[_0xf142('0x5c')](_0xf142('0x73'),_0x15c5e9[_0xf142('0x66')][_0xf142('0x38')]);_0xf3e5d7['message'][_0xf142('0x74')]=_0xe8bcc3[_0xf142('0x74')];_0xf3e5d7[_0xf142('0x28')]['motionChannel']=_0xe8bcc3[_0xf142('0x74')];_0xf3e5d7['message']['event']=_0xf142('0x34');respondWithRpcPromise('EventManager',_0xf142('0x76'),{'event':_0xf142('0x7d'),'message':_0xf3e5d7[_0xf142('0x28')]},client9002);return _0xe8bcc3;}return null;})[_0xf142('0x35')](respondWithResult(_0x1d8289,null))['catch'](handleError(_0x1d8289,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 99a06df..5000091 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 _0x7bed=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x19c57a,_0x5c9c7c){var _0x576a08=function(_0x929c62){while(--_0x929c62){_0x19c57a['push'](_0x19c57a['shift']());}};_0x576a08(++_0x5c9c7c);}(_0x7bed,0x1c8));var _0xd7be=function(_0x29d13f,_0x421cd5){_0x29d13f=_0x29d13f-0x0;var _0x55a873=_0x7bed[_0x29d13f];return _0x55a873;};'use strict';var EventEmitter=require(_0xd7be('0x0'));var OpenchannelMessage=require(_0xd7be('0x1'))['db'][_0xd7be('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd7be('0x3')](0x0);var events={'afterCreate':_0xd7be('0x4'),'afterUpdate':'update','afterDestroy':_0xd7be('0x5')};function emitEvent(_0x30d13c){return function(_0x5645e4,_0x478d73,_0x5d9ca4){OpenchannelMessageEvents[_0xd7be('0x6')](_0x30d13c+':'+_0x5645e4['id'],_0x5645e4);OpenchannelMessageEvents[_0xd7be('0x6')](_0x30d13c,_0x5645e4);_0x5d9ca4(null);};}for(var e in events){if(events[_0xd7be('0x7')](e)){var event=events[e];OpenchannelMessage[_0xd7be('0x8')](e,emitEvent(event));}}module[_0xd7be('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x33bd=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x24a08b,_0x174509){var _0x545301=function(_0x29f771){while(--_0x29f771){_0x24a08b['push'](_0x24a08b['shift']());}};_0x545301(++_0x174509);}(_0x33bd,0x156));var _0xd33b=function(_0x22f004,_0x3968b3){_0x22f004=_0x22f004-0x0;var _0x3c9907=_0x33bd[_0x22f004];return _0x3c9907;};'use strict';var EventEmitter=require(_0xd33b('0x0'));var OpenchannelMessage=require(_0xd33b('0x1'))['db'][_0xd33b('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd33b('0x3')](0x0);var events={'afterCreate':_0xd33b('0x4'),'afterUpdate':_0xd33b('0x5'),'afterDestroy':_0xd33b('0x6')};function emitEvent(_0x6cec73){return function(_0x1b62d9,_0x1d39f8,_0x38096e){OpenchannelMessageEvents[_0xd33b('0x7')](_0x6cec73+':'+_0x1b62d9['id'],_0x1b62d9);OpenchannelMessageEvents[_0xd33b('0x7')](_0x6cec73,_0x1b62d9);_0x38096e(null);};}for(var e in events){if(events[_0xd33b('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd33b('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 62601ce..446d269 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 _0x42ec=['replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','POST','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','direction','catch','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys'];(function(_0x265a2f,_0x2061ce){var _0x4e3e3e=function(_0x20802c){while(--_0x20802c){_0x265a2f['push'](_0x265a2f['shift']());}};_0x4e3e3e(++_0x2061ce);}(_0x42ec,0x73));var _0xc42e=function(_0x3f8d91,_0x5d8882){_0x3f8d91=_0x3f8d91-0x0;var _0x1480e4=_0x42ec[_0x3f8d91];return _0x1480e4;};'use strict';var _=require('lodash');var util=require(_0xc42e('0x0'));var logger=require(_0xc42e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc42e('0x2'));var fs=require('fs');var path=require(_0xc42e('0x3'));var rimraf=require(_0xc42e('0x4'));var config=require(_0xc42e('0x5'));var attributes=require(_0xc42e('0x6'));module['exports']=function(_0x3d356d,_0x137bb6){return _0x3d356d[_0xc42e('0x7')](_0xc42e('0x8'),attributes,{'tableName':_0xc42e('0x9'),'paranoid':![],'indexes':[{'name':_0xc42e('0xa'),'fields':[_0xc42e('0xb')],'type':_0xc42e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x204205,_0x31e2b2,_0x933e30){var _0x2e2a7d=_0x3d356d[_0xc42e('0xd')];var _0xc89097=_0x204205[_0xc42e('0xe')]({'plain':!![]});if(_0xc89097['direction'][_0xc42e('0xf')]()==='in'||_0xc89097['direction']['toLowerCase']()===_0xc42e('0x10')&&!_0xc89097['secret']&&!_[_0xc42e('0x11')](_0xc89097['UserId'])){_0x2e2a7d[_0xc42e('0x12')][_0xc42e('0x13')]({'where':{'id':_0xc89097[_0xc42e('0x14')]}})[_0xc42e('0x15')](function(_0x201498){if(_0x201498){_0x201498[_0xc42e('0x16')]({'lastMsgAt':_0xc89097[_0xc42e('0x17')],'lastMsgDirection':_0xc89097[_0xc42e('0x18')][_0xc42e('0xf')]()});}})[_0xc42e('0x19')](function(_0x53ac5a){console['error'](_0x53ac5a);});}if(_0xc89097[_0xc42e('0x18')]==='out'&&!_0xc89097[_0xc42e('0x1a')]){var _0x43b6fb;_0x2e2a7d[_0xc42e('0x1b')][_0xc42e('0x1c')]()[_0xc42e('0x15')](function(_0x10567b){return _0x2e2a7d[_0xc42e('0x1d')][_0xc42e('0x1e')]({'where':{'id':_0xc89097[_0xc42e('0x1f')]},'include':[{'model':_0x2e2a7d[_0xc42e('0x12')],'as':_0xc42e('0x20'),'where':{'id':_0xc89097['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x2e2a7d['CmContact'],'as':_0xc42e('0x21'),'attributes':_[_0xc42e('0x22')](_0x10567b)}]}]});})['then'](function(_0x586c75){_0x43b6fb=_0x586c75[_0xc42e('0xe')]({'plain':!![]});if(_0x43b6fb&&_0x43b6fb[_0xc42e('0x23')]){logger['info'](_0xc42e('0x24'),_0xc42e('0x25'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0xc89097['id'],_0x43b6fb[_0xc42e('0x23')]));if(_0x43b6fb[_0xc42e('0x20')]&&_0x43b6fb[_0xc42e('0x20')][_0xc42e('0x26')]){_0xc89097[_0xc42e('0x27')]=_[_0xc42e('0x28')](_0x43b6fb[_0xc42e('0x20')][0x0],'Contact');_0xc89097[_0xc42e('0x21')]=_0x43b6fb[_0xc42e('0x20')][0x0][_0xc42e('0x21')];}var _0x31e2b2={'method':_0xc42e('0x29'),'uri':encodeURI(_0x43b6fb['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x31e2b2['method']){case _0xc42e('0x2a'):_0x31e2b2['qs']=_0xc89097;break;case'POST':_0x31e2b2[_0xc42e('0xb')]=_0xc89097;break;}return rp(_0x31e2b2)[_0xc42e('0x15')](function(_0x2f440d){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xc42e('0x25'),util[_0xc42e('0x2b')](_0xc42e('0x2c'),_0xc89097['id'],_0x43b6fb[_0xc42e('0x23')]));if(_0x2f440d[_0xc42e('0xb')][_0xc42e('0x2d')]&&_0x2f440d[_0xc42e('0xb')]['threadId']!=_0xc89097[_0xc42e('0x27')][_0xc42e('0x2d')]){return _0x2e2a7d[_0xc42e('0x12')][_0xc42e('0x16')]({'threadId':_0x2f440d[_0xc42e('0xb')][_0xc42e('0x2d')]},{'where':{'id':_0xc89097['Interaction']['id']}});}else{return;}})[_0xc42e('0x15')](function(){return _0x204205[_0xc42e('0x16')]({'read':!![]});})[_0xc42e('0x19')](function(_0x245853){logger[_0xc42e('0x2e')](_0xc42e('0x24'),_0xc42e('0x25'),util[_0xc42e('0x2f')](_0x245853,{'showHidden':![],'depth':null}));_0x933e30();});}else{_0x933e30();}})['finally'](function(){_0x933e30();});}else{_0x933e30();}}},'charset':_0xc42e('0x30'),'collate':_0xc42e('0x31')});}; \ No newline at end of file +var _0x4a58=['out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','method','GET','POST','info','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','body','models','get','direction','toLowerCase'];(function(_0x1b8cda,_0x110f20){var _0x3b4a91=function(_0x1fec14){while(--_0x1fec14){_0x1b8cda['push'](_0x1b8cda['shift']());}};_0x3b4a91(++_0x110f20);}(_0x4a58,0x181));var _0x84a5=function(_0xb1c60b,_0x385134){_0xb1c60b=_0xb1c60b-0x0;var _0x4c391d=_0x4a58[_0xb1c60b];return _0x4c391d;};'use strict';var _=require('lodash');var util=require(_0x84a5('0x0'));var logger=require(_0x84a5('0x1'))(_0x84a5('0x2'));var moment=require('moment');var BPromise=require(_0x84a5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84a5('0x4'));var rimraf=require(_0x84a5('0x5'));var config=require(_0x84a5('0x6'));var attributes=require(_0x84a5('0x7'));module[_0x84a5('0x8')]=function(_0x2fb8ad,_0x552d84){return _0x2fb8ad['define'](_0x84a5('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x84a5('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51616b,_0x5d0def,_0x56aadd){var _0x1e20f6=_0x2fb8ad[_0x84a5('0xb')];var _0x1d6410=_0x51616b[_0x84a5('0xc')]({'plain':!![]});if(_0x1d6410[_0x84a5('0xd')][_0x84a5('0xe')]()==='in'||_0x1d6410[_0x84a5('0xd')][_0x84a5('0xe')]()===_0x84a5('0xf')&&!_0x1d6410[_0x84a5('0x10')]&&!_['isNil'](_0x1d6410[_0x84a5('0x11')])){_0x1e20f6[_0x84a5('0x12')][_0x84a5('0x13')]({'where':{'id':_0x1d6410[_0x84a5('0x14')]}})[_0x84a5('0x15')](function(_0x4efe7e){if(_0x4efe7e){_0x4efe7e[_0x84a5('0x16')]({'lastMsgAt':_0x1d6410[_0x84a5('0x17')],'lastMsgDirection':_0x1d6410[_0x84a5('0xd')]['toLowerCase']()});}})[_0x84a5('0x18')](function(_0x289746){console[_0x84a5('0x19')](_0x289746);});}if(_0x1d6410[_0x84a5('0xd')]===_0x84a5('0xf')&&!_0x1d6410[_0x84a5('0x10')]){var _0x50e30d;_0x1e20f6[_0x84a5('0x1a')][_0x84a5('0x1b')]()['then'](function(_0x5b8f26){return _0x1e20f6[_0x84a5('0x1c')]['find']({'where':{'id':_0x1d6410[_0x84a5('0x1d')]},'include':[{'model':_0x1e20f6[_0x84a5('0x12')],'as':'Interactions','where':{'id':_0x1d6410[_0x84a5('0x14')]},'limit':0x1,'include':[{'model':_0x1e20f6['CmContact'],'as':_0x84a5('0x1e'),'attributes':_[_0x84a5('0x1f')](_0x5b8f26)}]}]});})[_0x84a5('0x15')](function(_0x2e6665){_0x50e30d=_0x2e6665['get']({'plain':!![]});if(_0x50e30d&&_0x50e30d[_0x84a5('0x20')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x84a5('0x21'),util['format'](_0x84a5('0x22'),_0x1d6410['id'],_0x50e30d['replyUri']));if(_0x50e30d['Interactions']&&_0x50e30d[_0x84a5('0x23')][_0x84a5('0x24')]){_0x1d6410[_0x84a5('0x25')]=_[_0x84a5('0x26')](_0x50e30d[_0x84a5('0x23')][0x0],'Contact');_0x1d6410[_0x84a5('0x1e')]=_0x50e30d['Interactions'][0x0][_0x84a5('0x1e')];}var _0x5d0def={'method':'POST','uri':encodeURI(_0x50e30d['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5d0def[_0x84a5('0x27')]){case _0x84a5('0x28'):_0x5d0def['qs']=_0x1d6410;break;case _0x84a5('0x29'):_0x5d0def[_0x84a5('0xa')]=_0x1d6410;break;}return rp(_0x5d0def)[_0x84a5('0x15')](function(_0x36ca98){logger[_0x84a5('0x2a')](_0x84a5('0x2b'),_0x84a5('0x21'),util[_0x84a5('0x2c')](_0x84a5('0x2d'),_0x1d6410['id'],_0x50e30d[_0x84a5('0x20')]));if(_0x36ca98['body'][_0x84a5('0x2e')]&&_0x36ca98[_0x84a5('0xa')][_0x84a5('0x2e')]!=_0x1d6410[_0x84a5('0x25')][_0x84a5('0x2e')]){return _0x1e20f6[_0x84a5('0x12')]['update']({'threadId':_0x36ca98[_0x84a5('0xa')][_0x84a5('0x2e')]},{'where':{'id':_0x1d6410['Interaction']['id']}});}else{return;}})['then'](function(){return _0x51616b[_0x84a5('0x16')]({'read':!![]});})[_0x84a5('0x18')](function(_0x327c4d){logger['error'](_0x84a5('0x2b'),'afterCreate',util[_0x84a5('0x2f')](_0x327c4d,{'showHidden':![],'depth':null}));_0x56aadd();});}else{_0x56aadd();}})[_0x84a5('0x30')](function(){_0x56aadd();});}else{_0x56aadd();}}},'charset':_0x84a5('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index fe09ce2..a812801 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 _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(_0x567bd7,_0x394cfa){var _0x589c66=function(_0xa2e6d6){while(--_0xa2e6d6){_0x567bd7['push'](_0x567bd7['shift']());}};_0x589c66(++_0x394cfa);}(_0x7a54,0x106));var _0x47a5=function(_0x106c50,_0x79ab97){_0x106c50=_0x106c50-0x0;var _0x9362d4=_0x7a54[_0x106c50];return _0x9362d4;};'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 +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d80b2,_0x3477b9){var _0x5c334c=function(_0x1dcbdd){while(--_0x1dcbdd){_0x3d80b2['push'](_0x3d80b2['shift']());}};_0x5c334c(++_0x3477b9);}(_0x1261,0x144));var _0x1126=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0x1261[_0x4014e5];return _0x4ee8b7;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 4bd244a..e060f48 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 _0xd0c9=['openchannelMessage:','./openchannelMessage.events','save','emit','length'];(function(_0x320465,_0x5eff07){var _0x18414f=function(_0x311959){while(--_0x311959){_0x320465['push'](_0x320465['shift']());}};_0x18414f(++_0x5eff07);}(_0xd0c9,0xe2));var _0x9d0c=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xd0c9[_0x346737];return _0x1ade2e;};'use strict';var OpenchannelMessageEvents=require(_0x9d0c('0x0'));var events=[_0x9d0c('0x1'),'remove','update'];function createListener(_0x5d3eb1,_0x154c38){return function(_0x2eff0e){_0x154c38[_0x9d0c('0x2')](_0x5d3eb1,_0x2eff0e);};}function removeListener(_0x5922f1,_0x3b4b50){return function(){OpenchannelMessageEvents['removeListener'](_0x5922f1,_0x3b4b50);};}exports['register']=function(_0x6749){for(var _0x5bcaf9=0x0,_0x3eec5f=events[_0x9d0c('0x3')];_0x5bcaf9<_0x3eec5f;_0x5bcaf9++){var _0x308d9e=events[_0x5bcaf9];var _0x413a70=createListener(_0x9d0c('0x4')+_0x308d9e,_0x6749);OpenchannelMessageEvents['on'](_0x308d9e,_0x413a70);}}; \ No newline at end of file +var _0x2718=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x2718,0x18d));var _0x8271=function(_0x14e958,_0x215a08){_0x14e958=_0x14e958-0x0;var _0x30959a=_0x2718[_0x14e958];return _0x30959a;};'use strict';var OpenchannelMessageEvents=require(_0x8271('0x0'));var events=[_0x8271('0x1'),_0x8271('0x2'),_0x8271('0x3')];function createListener(_0x2b2dcb,_0x2ebda6){return function(_0x5d04a1){_0x2ebda6[_0x8271('0x4')](_0x2b2dcb,_0x5d04a1);};}function removeListener(_0x53c2cf,_0x30887d){return function(){OpenchannelMessageEvents[_0x8271('0x5')](_0x53c2cf,_0x30887d);};}exports[_0x8271('0x6')]=function(_0x1b5f5b){for(var _0x46c3ea=0x0,_0x481387=events[_0x8271('0x7')];_0x46c3ea<_0x481387;_0x46c3ea++){var _0x103581=events[_0x46c3ea];var _0x599a2f=createListener(_0x8271('0x8')+_0x103581,_0x1b5f5b);OpenchannelMessageEvents['on'](_0x103581,_0x599a2f);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index cdb327c..0d9ccbf 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 _0xd614=['describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','isAuthenticated'];(function(_0x4a24d7,_0x332bba){var _0xdde72c=function(_0x3269f7){while(--_0x3269f7){_0x4a24d7['push'](_0x4a24d7['shift']());}};_0xdde72c(++_0x332bba);}(_0xd614,0xe0));var _0x4d61=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd614[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x4d61('0x0'));var util=require('util');var path=require(_0x4d61('0x1'));var timeout=require(_0x4d61('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d61('0x3'));var auth=require(_0x4d61('0x4'));var interaction=require(_0x4d61('0x5'));var config=require('../../config/environment');var controller=require(_0x4d61('0x6'));router[_0x4d61('0x7')]('/',auth['isAuthenticated'](),controller[_0x4d61('0x8')]);router[_0x4d61('0x7')]('/describe',auth[_0x4d61('0x9')](),controller[_0x4d61('0xa')]);router[_0x4d61('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4d61('0xb')]);router[_0x4d61('0x7')](_0x4d61('0xc'),auth[_0x4d61('0x9')](),controller['getMembers']);router[_0x4d61('0x7')](_0x4d61('0xd'),auth[_0x4d61('0x9')](),controller[_0x4d61('0xe')]);router['get'](_0x4d61('0xf'),auth[_0x4d61('0x9')](),controller[_0x4d61('0x10')]);router[_0x4d61('0x11')]('/',auth[_0x4d61('0x9')](),controller[_0x4d61('0x12')]);router[_0x4d61('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4d61('0x13')]);router[_0x4d61('0x11')](_0x4d61('0xf'),auth['isAuthenticated'](),controller[_0x4d61('0x14')]);router[_0x4d61('0x15')]('/:id',auth[_0x4d61('0x9')](),controller['update']);router[_0x4d61('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x4d61('0x17')]);router['delete'](_0x4d61('0xd'),auth[_0x4d61('0x9')](),controller[_0x4d61('0x18')]);router[_0x4d61('0x16')](_0x4d61('0xf'),auth[_0x4d61('0x9')](),controller[_0x4d61('0x19')]);module['exports']=router; \ No newline at end of file +var _0xdb3b=['addTeams','addAgents','put','update','removeTeams','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/users','create','post','/:id/teams'];(function(_0x67748b,_0x25f304){var _0xdef940=function(_0x343cb3){while(--_0x343cb3){_0x67748b['push'](_0x67748b['shift']());}};_0xdef940(++_0x25f304);}(_0xdb3b,0x1aa));var _0xbdb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb3b[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xbdb3('0x0'));var util=require(_0xbdb3('0x1'));var path=require(_0xbdb3('0x2'));var timeout=require(_0xbdb3('0x3'));var express=require('express');var router=express[_0xbdb3('0x4')]();var fs_extra=require(_0xbdb3('0x5'));var auth=require(_0xbdb3('0x6'));var interaction=require(_0xbdb3('0x7'));var config=require(_0xbdb3('0x8'));var controller=require(_0xbdb3('0x9'));router[_0xbdb3('0xa')]('/',auth[_0xbdb3('0xb')](),controller[_0xbdb3('0xc')]);router[_0xbdb3('0xa')](_0xbdb3('0xd'),auth['isAuthenticated'](),controller[_0xbdb3('0xe')]);router[_0xbdb3('0xa')](_0xbdb3('0xf'),auth['isAuthenticated'](),controller[_0xbdb3('0x10')]);router[_0xbdb3('0xa')](_0xbdb3('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbdb3('0xa')]('/:id/teams',auth[_0xbdb3('0xb')](),controller['getTeams']);router[_0xbdb3('0xa')](_0xbdb3('0x12'),auth[_0xbdb3('0xb')](),controller['getAgents']);router['post']('/',auth[_0xbdb3('0xb')](),controller[_0xbdb3('0x13')]);router[_0xbdb3('0x14')](_0xbdb3('0x15'),auth['isAuthenticated'](),controller[_0xbdb3('0x16')]);router[_0xbdb3('0x14')]('/:id/users',auth[_0xbdb3('0xb')](),controller[_0xbdb3('0x17')]);router[_0xbdb3('0x18')](_0xbdb3('0xf'),auth[_0xbdb3('0xb')](),controller[_0xbdb3('0x19')]);router['delete'](_0xbdb3('0xf'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xbdb3('0x15'),auth[_0xbdb3('0xb')](),controller[_0xbdb3('0x1a')]);router[_0xbdb3('0x1b')]('/:id/users',auth[_0xbdb3('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 447f987..3da6b07 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 _0x1dc1=['rrmemory','beepall','sequelize','exports','name'];(function(_0x58cbc5,_0x3de123){var _0x38a8d9=function(_0x3a92be){while(--_0x3a92be){_0x58cbc5['push'](_0x58cbc5['shift']());}};_0x38a8d9(++_0x3de123);}(_0x1dc1,0xa2));var _0x11dc=function(_0x65b0bd,_0x2eeabb){_0x65b0bd=_0x65b0bd-0x0;var _0x2d5306=_0x1dc1[_0x65b0bd];return _0x2d5306;};'use strict';var Sequelize=require(_0x11dc('0x0'));module[_0x11dc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x11dc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x11dc('0x3'),_0x11dc('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x1ca0=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0xa930c1,_0xe1865d){var _0x52ba84=function(_0x58e9ec){while(--_0x58e9ec){_0xa930c1['push'](_0xa930c1['shift']());}};_0x52ba84(++_0xe1865d);}(_0x1ca0,0x16f));var _0x01ca=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x1ca0[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x01ca('0x0'));module[_0x01ca('0x1')]={'name':{'type':Sequelize[_0x01ca('0x2')],'unique':_0x01ca('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01ca('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01ca('0x4')](_0x01ca('0x5'),_0x01ca('0x6'),_0x01ca('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6d93478..e2c2779 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 _0xc740=['userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','addTeams','Agents','online','interface','flatMap','transaction','each','forEach','removeTeams','Team','select','field','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','TeamId','union','ids','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','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/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','offset','undefined','count','set','Content-Range','reject','update','then','destroy','end','stack','name','index','OpenchannelQueue','rawAttributes','type','key','model','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','map','VIRTUAL','options','includeAll','findAll','catch','keys','intersection','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection'];(function(_0x11832c,_0x433277){var _0x38b8c8=function(_0x50a881){while(--_0x50a881){_0x11832c['push'](_0x11832c['shift']());}};_0x38b8c8(++_0x433277);}(_0xc740,0xbf));var _0x0c74=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xc740[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x0c74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c74('0x1'));var jsonpatch=require(_0x0c74('0x2'));var rp=require(_0x0c74('0x3'));var moment=require(_0x0c74('0x4'));var BPromise=require(_0x0c74('0x5'));var Mustache=require(_0x0c74('0x6'));var util=require(_0x0c74('0x7'));var path=require(_0x0c74('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0c74('0x9'));var fs=require('fs');var fs_extra=require(_0x0c74('0xa'));var _=require(_0x0c74('0xb'));var squel=require(_0x0c74('0xc'));var crypto=require(_0x0c74('0xd'));var jsforce=require(_0x0c74('0xe'));var deskjs=require(_0x0c74('0xf'));var toCsv=require(_0x0c74('0x10'));var querystring=require('querystring');var Papa=require(_0x0c74('0x11'));var Redis=require(_0x0c74('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0c74('0x13'));var as=require(_0x0c74('0x14'));var hardwareService=require(_0x0c74('0x15'));var logger=require(_0x0c74('0x16'))(_0x0c74('0x17'));var utils=require(_0x0c74('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0c74('0x19'));var db=require(_0x0c74('0x1a'))['db'];config['redis']=_[_0x0c74('0x1b')](config[_0x0c74('0x1c')],{'host':_0x0c74('0x1d'),'port':0x18eb});var socket=require(_0x0c74('0x1e'))(new Redis(config[_0x0c74('0x1c')]));require(_0x0c74('0x1f'))[_0x0c74('0x20')](socket);function respondWithStatusCode(_0x23fe53,_0x3166f7){_0x3166f7=_0x3166f7||0xcc;return function(_0x29e2c0){if(_0x29e2c0){return _0x23fe53[_0x0c74('0x21')](_0x3166f7);}return _0x23fe53[_0x0c74('0x22')](_0x3166f7)['end']();};}function respondWithResult(_0x28a8e5,_0x4ce47a){_0x4ce47a=_0x4ce47a||0xc8;return function(_0x2d7a3b){if(_0x2d7a3b){return _0x28a8e5[_0x0c74('0x22')](_0x4ce47a)['json'](_0x2d7a3b);}};}function respondWithFilteredResult(_0x3a0e5a,_0x31d1dd){return function(_0x411b5f){if(_0x411b5f){var _0x449e50=typeof _0x31d1dd[_0x0c74('0x23')]===_0x0c74('0x24')&&typeof _0x31d1dd['limit']===_0x0c74('0x24');var _0x24768c=_0x411b5f[_0x0c74('0x25')];var _0x4ec762=_0x449e50?0x0:_0x31d1dd[_0x0c74('0x23')];var _0x13938c=_0x449e50?_0x411b5f['count']:_0x31d1dd[_0x0c74('0x23')]+_0x31d1dd['limit'];var _0x310a75;if(_0x13938c>=_0x24768c){_0x13938c=_0x24768c;_0x310a75=0xc8;}else{_0x310a75=0xce;}_0x3a0e5a[_0x0c74('0x22')](_0x310a75);return _0x3a0e5a[_0x0c74('0x26')](_0x0c74('0x27'),_0x4ec762+'-'+_0x13938c+'/'+_0x24768c)['json'](_0x411b5f);}return null;};}function patchUpdates(_0x423aaa){return function(_0x5a350d){try{jsonpatch['apply'](_0x5a350d,_0x423aaa,!![]);}catch(_0x50a722){return BPromise[_0x0c74('0x28')](_0x50a722);}return _0x5a350d['save']();};}function saveUpdates(_0x5d85fb,_0x2a6620){return function(_0x5741ce){if(_0x5741ce){return _0x5741ce[_0x0c74('0x29')](_0x5d85fb)[_0x0c74('0x2a')](function(_0xabcfd){return _0xabcfd;});}return null;};}function removeEntity(_0x236979,_0x531304){return function(_0x12053f){if(_0x12053f){return _0x12053f[_0x0c74('0x2b')]()[_0x0c74('0x2a')](function(){var _0x4992e6=_0x12053f['get']({'plain':!![]});var _0x3a051c='OpenchannelQueues';return db['UserProfileResource'][_0x0c74('0x2b')]({'where':{'type':_0x3a051c,'resourceId':_0x4992e6['id']}})['then'](function(){return _0x12053f;});})[_0x0c74('0x2a')](function(){_0x236979['status'](0xcc)[_0x0c74('0x2c')]();});}};}function handleEntityNotFound(_0x2e7c8b,_0x2d4942){return function(_0x3af450){if(!_0x3af450){_0x2e7c8b[_0x0c74('0x21')](0x194);}return _0x3af450;};}function handleError(_0x43107c,_0x54f3f8){_0x54f3f8=_0x54f3f8||0x1f4;return function(_0x37de83){logger['error'](_0x37de83[_0x0c74('0x2d')]);if(_0x37de83[_0x0c74('0x2e')]){delete _0x37de83['name'];}_0x43107c[_0x0c74('0x22')](_0x54f3f8)['send'](_0x37de83);};}exports[_0x0c74('0x2f')]=function(_0x44d738,_0x107ad2){var _0x2f1eca={},_0x2b0e05={},_0x5bf72e={'count':0x0,'rows':[]};var _0x2719c7=_['map'](db[_0x0c74('0x30')][_0x0c74('0x31')],function(_0x46cb2e){return{'name':_0x46cb2e['fieldName'],'type':_0x46cb2e[_0x0c74('0x32')][_0x0c74('0x33')]};});_0x2b0e05['model']=_['map'](_0x2719c7,'name');_0x2b0e05['query']=_['keys'](_0x44d738['query']);_0x2b0e05['filters']=_['intersection'](_0x2b0e05[_0x0c74('0x34')],_0x2b0e05[_0x0c74('0x35')]);_0x2f1eca['attributes']=_['intersection'](_0x2b0e05[_0x0c74('0x34')],qs['fields'](_0x44d738['query'][_0x0c74('0x36')]));_0x2f1eca[_0x0c74('0x37')]=_0x2f1eca[_0x0c74('0x37')]['length']?_0x2f1eca[_0x0c74('0x37')]:_0x2b0e05[_0x0c74('0x34')];if(!_0x44d738[_0x0c74('0x35')][_0x0c74('0x38')](_0x0c74('0x39'))){_0x2f1eca[_0x0c74('0x3a')]=qs['limit'](_0x44d738[_0x0c74('0x35')][_0x0c74('0x3a')]);_0x2f1eca[_0x0c74('0x23')]=qs[_0x0c74('0x23')](_0x44d738[_0x0c74('0x35')]['offset']);}_0x2f1eca[_0x0c74('0x3b')]=qs[_0x0c74('0x3c')](_0x44d738['query'][_0x0c74('0x3c')]);_0x2f1eca[_0x0c74('0x3d')]=qs[_0x0c74('0x3e')](_[_0x0c74('0x3f')](_0x44d738[_0x0c74('0x35')],_0x2b0e05[_0x0c74('0x3e')]),_0x2719c7);if(_0x44d738['query']['filter']){_0x2f1eca[_0x0c74('0x3d')]=_[_0x0c74('0x40')](_0x2f1eca[_0x0c74('0x3d')],{'$or':_[_0x0c74('0x41')](_0x2719c7,function(_0x590331){if(_0x590331[_0x0c74('0x32')]!==_0x0c74('0x42')){var _0x439c9a={};_0x439c9a[_0x590331[_0x0c74('0x2e')]]={'$like':'%'+_0x44d738[_0x0c74('0x35')]['filter']+'%'};return _0x439c9a;}})});}_0x2f1eca=_[_0x0c74('0x40')]({},_0x2f1eca,_0x44d738[_0x0c74('0x43')]);var _0x796e4e={'where':_0x2f1eca['where']};return db[_0x0c74('0x30')][_0x0c74('0x25')](_0x796e4e)[_0x0c74('0x2a')](function(_0x1be858){_0x5bf72e['count']=_0x1be858;if(_0x44d738[_0x0c74('0x35')][_0x0c74('0x44')]){_0x2f1eca['include']=[{'all':!![]}];}return db[_0x0c74('0x30')][_0x0c74('0x45')](_0x2f1eca);})[_0x0c74('0x2a')](function(_0x26d1b6){_0x5bf72e['rows']=_0x26d1b6;return _0x5bf72e;})[_0x0c74('0x2a')](respondWithFilteredResult(_0x107ad2,_0x2f1eca))[_0x0c74('0x46')](handleError(_0x107ad2,null));};exports['show']=function(_0x88a410,_0x3430b3){var _0xe3aa43={'raw':!![],'where':{'id':_0x88a410['params']['id']}},_0x156b81={};_0x156b81[_0x0c74('0x34')]=_[_0x0c74('0x47')](db[_0x0c74('0x30')][_0x0c74('0x31')]);_0x156b81[_0x0c74('0x35')]=_[_0x0c74('0x47')](_0x88a410[_0x0c74('0x35')]);_0x156b81[_0x0c74('0x3e')]=_[_0x0c74('0x48')](_0x156b81[_0x0c74('0x34')],_0x156b81['query']);_0xe3aa43['attributes']=_[_0x0c74('0x48')](_0x156b81[_0x0c74('0x34')],qs['fields'](_0x88a410['query'][_0x0c74('0x36')]));_0xe3aa43[_0x0c74('0x37')]=_0xe3aa43[_0x0c74('0x37')][_0x0c74('0x49')]?_0xe3aa43[_0x0c74('0x37')]:_0x156b81[_0x0c74('0x34')];if(_0x88a410['query']['includeAll']){_0xe3aa43['include']=[{'all':!![]}];}_0xe3aa43=_['merge']({},_0xe3aa43,_0x88a410[_0x0c74('0x43')]);return db[_0x0c74('0x30')][_0x0c74('0x4a')](_0xe3aa43)[_0x0c74('0x2a')](handleEntityNotFound(_0x3430b3,null))[_0x0c74('0x2a')](respondWithResult(_0x3430b3,null))[_0x0c74('0x46')](handleError(_0x3430b3,null));};exports[_0x0c74('0x4b')]=function(_0x2cc7cf,_0x1acd45){return db[_0x0c74('0x30')][_0x0c74('0x4b')](_0x2cc7cf[_0x0c74('0x4c')],{})['then'](function(_0x3ba779){var _0xcdce05=_0x2cc7cf[_0x0c74('0x4d')][_0x0c74('0x4e')]({'plain':!![]});if(!_0xcdce05)throw new Error(_0x0c74('0x4f'));if(_0xcdce05[_0x0c74('0x50')]===_0x0c74('0x4d')){var _0xaf576c=_0x3ba779[_0x0c74('0x4e')]({'plain':!![]});var _0x140a62=_0x0c74('0x51');return db[_0x0c74('0x52')]['find']({'where':{'name':_0x140a62,'userProfileId':_0xcdce05[_0x0c74('0x53')]},'raw':!![]})['then'](function(_0x40f583){if(_0x40f583&&_0x40f583['autoAssociation']===0x0){return db[_0x0c74('0x54')][_0x0c74('0x4b')]({'name':_0xaf576c[_0x0c74('0x2e')],'resourceId':_0xaf576c['id'],'type':_0x40f583[_0x0c74('0x2e')],'sectionId':_0x40f583['id']},{})[_0x0c74('0x2a')](function(){return _0x3ba779;});}else{return _0x3ba779;}})[_0x0c74('0x46')](function(_0x130427){logger[_0x0c74('0x55')](_0x0c74('0x56'),_0x130427);throw _0x130427;});}return _0x3ba779;})[_0x0c74('0x2a')](respondWithResult(_0x1acd45,0xc9))[_0x0c74('0x46')](handleError(_0x1acd45,null));};exports[_0x0c74('0x29')]=function(_0x3950ec,_0x2d9cb1){if(_0x3950ec[_0x0c74('0x4c')]['id']){delete _0x3950ec[_0x0c74('0x4c')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x3950ec[_0x0c74('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d9cb1,null))[_0x0c74('0x2a')](saveUpdates(_0x3950ec[_0x0c74('0x4c')],null))['then'](respondWithResult(_0x2d9cb1,null))['catch'](handleError(_0x2d9cb1,null));};exports['destroy']=function(_0x479f70,_0x138fd9){return db[_0x0c74('0x30')]['find']({'where':{'id':_0x479f70[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x138fd9,null))['then'](removeEntity(_0x138fd9,null))[_0x0c74('0x46')](handleError(_0x138fd9,null));};exports['describe']=function(_0x2f9def,_0x46c8c5){return db['OpenchannelQueue'][_0x0c74('0x58')]()['then'](respondWithResult(_0x46c8c5,null))[_0x0c74('0x46')](handleError(_0x46c8c5,null));};exports[_0x0c74('0x59')]=function(_0x2633ef,_0x201fc7,_0xe47ba8){var _0x511f4c={'raw':!![],'where':{}},_0x83a792={},_0x9be6b8;return db['OpenchannelQueue'][_0x0c74('0x5a')]({'where':{'id':_0x2633ef[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x201fc7,null))[_0x0c74('0x2a')](function(_0x35bf61){if(_0x35bf61){_0x9be6b8=_0x35bf61[_0x0c74('0x4e')]({'plain':!![]});_0x83a792[_0x0c74('0x34')]=_['keys'](db[_0x0c74('0x5b')][_0x0c74('0x31')]);_0x83a792['query']=_[_0x0c74('0x47')](_0x2633ef[_0x0c74('0x35')]);_0x83a792[_0x0c74('0x3e')]=_[_0x0c74('0x48')](_0x83a792[_0x0c74('0x34')],_0x83a792[_0x0c74('0x35')]);_0x511f4c[_0x0c74('0x37')]=_[_0x0c74('0x48')](_0x83a792[_0x0c74('0x34')],qs[_0x0c74('0x36')](_0x2633ef[_0x0c74('0x35')][_0x0c74('0x36')]));_0x511f4c[_0x0c74('0x37')]=_0x511f4c['attributes'][_0x0c74('0x49')]?_0x511f4c[_0x0c74('0x37')]:_0x83a792[_0x0c74('0x34')];if(!_0x2633ef[_0x0c74('0x35')][_0x0c74('0x38')](_0x0c74('0x39'))){_0x511f4c[_0x0c74('0x3a')]=qs[_0x0c74('0x3a')](_0x2633ef[_0x0c74('0x35')]['limit']);_0x511f4c[_0x0c74('0x23')]=qs[_0x0c74('0x23')](_0x2633ef[_0x0c74('0x35')]['offset']);}_0x511f4c['order']=qs[_0x0c74('0x3c')](_0x2633ef['query']['sort']);_0x511f4c['where']=qs[_0x0c74('0x3e')](_[_0x0c74('0x3f')](_0x2633ef[_0x0c74('0x35')],_0x83a792[_0x0c74('0x3e')]));_0x511f4c['where']['OpenchannelQueueId']=_0x35bf61['id'];if(_0x2633ef['query'][_0x0c74('0x5c')]){_0x511f4c[_0x0c74('0x3d')]=_[_0x0c74('0x40')](_0x511f4c[_0x0c74('0x3d')],{'$or':_['map'](_0x511f4c[_0x0c74('0x37')],function(_0xd99f6a){var _0x4aa1e2={};_0x4aa1e2[_0xd99f6a]={'$like':'%'+_0x2633ef[_0x0c74('0x35')][_0x0c74('0x5c')]+'%'};return _0x4aa1e2;})});}_0x511f4c=_['merge']({},_0x511f4c,_0x2633ef['options']);return db[_0x0c74('0x5b')][_0x0c74('0x45')](_0x511f4c);}})[_0x0c74('0x2a')](function(_0x5a5e79){if(_0x5a5e79){return db[_0x0c74('0x5d')][_0x0c74('0x5e')]({'where':{'id':_['map'](_0x5a5e79,_0x0c74('0x5f')),'role':_0x0c74('0x60')},'attributes':['id','name','openchannelPause',_0x0c74('0x61'),_0x0c74('0x62')]});}})[_0x0c74('0x2a')](function(_0x47425c){if(_0x47425c){return{'count':_0x47425c[_0x0c74('0x25')],'rows':_[_0x0c74('0x41')](_0x47425c[_0x0c74('0x63')],function(_0x89af37){return{'membername':_0x89af37[_0x0c74('0x2e')],'UserId':_0x89af37['id'],'queue_name':_0x9be6b8[_0x0c74('0x2e')],'OpenchannelQueueId':_0x9be6b8['id'],'interface':util['format'](_0x0c74('0x64'),_0x0c74('0x65'),_0x89af37['name']),'penalty':0x0,'paused':_0x89af37['openchannelPause'],'createdAt':_0x89af37[_0x0c74('0x62')],'updatedAt':_0x89af37['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x201fc7,_0x511f4c))['catch'](handleError(_0x201fc7,null));};exports[_0x0c74('0x66')]=function(_0x3c5866,_0x209607,_0x46037e){var _0x3f4163={};var _0xfef4a={};var _0x1c5034;var _0x5358e9;return db[_0x0c74('0x30')]['findOne']({'where':{'id':_0x3c5866[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x209607,null))[_0x0c74('0x2a')](function(_0x39a604){if(_0x39a604){_0x1c5034=_0x39a604;_0xfef4a['model']=_[_0x0c74('0x47')](db['Team']['rawAttributes']);_0xfef4a[_0x0c74('0x35')]=_['keys'](_0x3c5866[_0x0c74('0x35')]);_0xfef4a[_0x0c74('0x3e')]=_[_0x0c74('0x48')](_0xfef4a[_0x0c74('0x34')],_0xfef4a['query']);_0x3f4163['attributes']=_['intersection'](_0xfef4a[_0x0c74('0x34')],qs['fields'](_0x3c5866[_0x0c74('0x35')][_0x0c74('0x36')]));_0x3f4163[_0x0c74('0x37')]=_0x3f4163['attributes'][_0x0c74('0x49')]?_0x3f4163[_0x0c74('0x37')]:_0xfef4a['model'];_0x3f4163['order']=qs[_0x0c74('0x3c')](_0x3c5866[_0x0c74('0x35')]['sort']);_0x3f4163[_0x0c74('0x3d')]=qs[_0x0c74('0x3e')](_[_0x0c74('0x3f')](_0x3c5866[_0x0c74('0x35')],_0xfef4a[_0x0c74('0x3e')]));if(_0x3c5866[_0x0c74('0x35')]['filter']){_0x3f4163[_0x0c74('0x3d')]=_[_0x0c74('0x40')](_0x3f4163['where'],{'$or':_[_0x0c74('0x41')](_0x3f4163[_0x0c74('0x37')],function(_0x51e68a){var _0x584fe2={};_0x584fe2[_0x51e68a]={'$like':'%'+_0x3c5866[_0x0c74('0x35')][_0x0c74('0x5c')]+'%'};return _0x584fe2;})});}_0x3f4163=_[_0x0c74('0x40')]({},_0x3f4163,_0x3c5866[_0x0c74('0x43')]);return _0x1c5034[_0x0c74('0x66')](_0x3f4163);}})[_0x0c74('0x2a')](function(_0x582da5){if(_0x582da5){_0x5358e9=_0x582da5[_0x0c74('0x49')];if(!_0x3c5866['query'][_0x0c74('0x38')](_0x0c74('0x39'))){_0x3f4163[_0x0c74('0x3a')]=qs[_0x0c74('0x3a')](_0x3c5866[_0x0c74('0x35')][_0x0c74('0x3a')]);_0x3f4163[_0x0c74('0x23')]=qs[_0x0c74('0x23')](_0x3c5866[_0x0c74('0x35')][_0x0c74('0x23')]);}return _0x1c5034[_0x0c74('0x66')](_0x3f4163);}})[_0x0c74('0x2a')](function(_0x229c77){if(_0x229c77){return _0x229c77?{'count':_0x5358e9,'rows':_0x229c77}:null;}})[_0x0c74('0x2a')](respondWithResult(_0x209607,null))[_0x0c74('0x46')](handleError(_0x209607,null));};exports[_0x0c74('0x67')]=function(_0x3124cf,_0x239345,_0x3fba22){var _0x5abe71=_0x3124cf[_0x0c74('0x4c')]['ids'];return db['Team'][_0x0c74('0x45')]({'where':{'id':_0x5abe71},'attributes':['id'],'include':[{'model':db[_0x0c74('0x5d')],'as':_0x0c74('0x68'),'attributes':['id','name',_0x0c74('0x69'),'voicePause',_0x0c74('0x6a')],'raw':!![]}]})[_0x0c74('0x2a')](function(_0x3ce14d){if(_0x3ce14d){var _0x260f95=_[_0x0c74('0x6b')](_0x3ce14d,function(_0xc317ea){var _0x4c4f34=_0xc317ea[_0x0c74('0x4e')]({'plain':!![]});return _0x4c4f34[_0x0c74('0x68')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x3124cf[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](function(_0x114133){return db['sequelize'][_0x0c74('0x6c')](function(_0x40e3ff){return _0x114133[_0x0c74('0x67')](_0x5abe71,{'transaction':_0x40e3ff})[_0x0c74('0x2a')](function(){return BPromise[_0x0c74('0x6d')](_0x260f95,function(_0xcbe522){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0xcbe522['id'],'OpenchannelQueueId':_0x3124cf[_0x0c74('0x57')]['id']},'transaction':_0x40e3ff});});})[_0x0c74('0x2a')](function(){_0x260f95[_0x0c74('0x6e')](function(_0x5db687){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x5db687['id'],'OpenchannelQueueId':_0x114133['id']});});});});});}})[_0x0c74('0x2a')](respondWithStatusCode(_0x239345,null))[_0x0c74('0x46')](handleError(_0x239345,null));};exports[_0x0c74('0x6f')]=function(_0x26d01e,_0x257673,_0x4ebf5f){return db[_0x0c74('0x70')][_0x0c74('0x45')]({'where':{'id':_0x26d01e[_0x0c74('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0c74('0x5d')],'as':_0x0c74('0x68'),'attributes':['id'],'raw':!![]}]})[_0x0c74('0x2a')](handleEntityNotFound(_0x257673,null))[_0x0c74('0x2a')](function(_0x422d4c){var _0x2d8354=_[_0x0c74('0x41')](_0x422d4c,'id');var _0x2f60a7=[];var _0x5117bb=[];var _0x486e3b=squel[_0x0c74('0x71')]();_0x486e3b[_0x0c74('0x72')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')['join']('user_has_teams','ut',_0x0c74('0x73'))[_0x0c74('0x3d')](_0x0c74('0x74'),_0x26d01e[_0x0c74('0x57')]['id']);for(var _0x3573d6=0x0;_0x3573d6<_0x422d4c[_0x0c74('0x49')];_0x3573d6+=0x1){let _0x39b271=_0x422d4c[_0x3573d6];for(var _0x5d519f=0x0;_0x5d519f<_0x39b271[_0x0c74('0x68')][_0x0c74('0x49')];_0x5d519f+=0x1){let _0xe0320a=_0x39b271['Agents'][_0x5d519f];var _0xa3f128=_0x486e3b[_0x0c74('0x75')]();_0xa3f128[_0x0c74('0x3d')](_0x0c74('0x76'),_0xe0320a['id']);_0x5117bb[_0x0c74('0x77')](db['sequelize']['query'](_0xa3f128[_0x0c74('0x78')](),{'type':db[_0x0c74('0x79')][_0x0c74('0x7a')]['SELECT']})['then'](function(_0x409c19){if(_0x409c19[_0x0c74('0x49')]===0x1){return _0xe0320a['id'];}else{var _0x439668=_[_0x0c74('0x7b')](_['map'](_0x409c19,_0x0c74('0x7c')),function(_0x58d25f){return _['includes'](_0x2d8354,_0x58d25f);});if(_0x439668){return _0xe0320a['id'];}}}));}}return BPromise['all'](_0x5117bb)[_0x0c74('0x2a')](function(_0x336a20){_0x2f60a7=_(_0x2f60a7)[_0x0c74('0x7d')](_0x336a20)['compact']()['value']();return db[_0x0c74('0x30')][_0x0c74('0x4a')]({'where':{'id':_0x26d01e[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](function(_0x2f6578){return db[_0x0c74('0x79')][_0x0c74('0x6c')](function(_0x37df1a){return _0x2f6578[_0x0c74('0x6f')](_0x26d01e[_0x0c74('0x35')][_0x0c74('0x7e')],{'transaction':_0x37df1a})[_0x0c74('0x2a')](function(){if(!_[_0x0c74('0x7f')](_0x2f60a7)){return _0x2f6578[_0x0c74('0x80')](_0x2f60a7,{'transaction':_0x37df1a});}})[_0x0c74('0x2a')](function(){_0x2f60a7[_0x0c74('0x6e')](function(_0x4e3d87){socket[_0x0c74('0x81')](_0x0c74('0x82'),{'UserId':_0x4e3d87,'OpenchannelQueueId':_0x2f6578['id']});});});});});});})[_0x0c74('0x2a')](respondWithStatusCode(_0x257673,null))['catch'](handleError(_0x257673,null));};exports[_0x0c74('0x83')]=function(_0x5e3212,_0x4e52cd,_0x334610){return db[_0x0c74('0x30')][_0x0c74('0x4a')]({'where':{'id':_0x5e3212[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x4e52cd,null))['then'](function(_0xe1b4a9){if(_0xe1b4a9){return _0xe1b4a9['addAgents'](_0x5e3212[_0x0c74('0x4c')][_0x0c74('0x7e')],_[_0x0c74('0x84')](_0x5e3212['body'],[_0x0c74('0x7e'),'id'])||{})[_0x0c74('0x85')](function(_0xea1b11){for(var _0x4cd6d8=0x0;_0x4cd6d8<_0x5e3212[_0x0c74('0x4c')][_0x0c74('0x7e')][_0x0c74('0x49')];_0x4cd6d8+=0x1){socket[_0x0c74('0x81')](_0x0c74('0x86'),{'UserId':Number(_0x5e3212[_0x0c74('0x4c')][_0x0c74('0x7e')][_0x4cd6d8]),'OpenchannelQueueId':Number(_0x5e3212[_0x0c74('0x57')]['id'])});}return _0xea1b11;});}})[_0x0c74('0x2a')](respondWithResult(_0x4e52cd,null))[_0x0c74('0x46')](handleError(_0x4e52cd,null));};exports['removeAgents']=function(_0x2c378e,_0x1b4674,_0x4da359){return db[_0x0c74('0x30')][_0x0c74('0x4a')]({'where':{'id':_0x2c378e[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x1b4674,null))[_0x0c74('0x2a')](function(_0x3dc814){if(_0x3dc814){return _0x3dc814[_0x0c74('0x80')](_0x2c378e[_0x0c74('0x35')][_0x0c74('0x7e')])[_0x0c74('0x2a')](function(){if(_[_0x0c74('0x87')](_0x2c378e[_0x0c74('0x35')]['ids'])){for(var _0x3e35bd=0x0;_0x3e35bd<_0x2c378e[_0x0c74('0x35')][_0x0c74('0x7e')][_0x0c74('0x49')];_0x3e35bd+=0x1){socket[_0x0c74('0x81')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2c378e[_0x0c74('0x35')]['ids'][_0x3e35bd]),'OpenchannelQueueId':Number(_0x2c378e[_0x0c74('0x57')]['id'])});}}else{socket[_0x0c74('0x81')](_0x0c74('0x82'),{'UserId':Number(_0x2c378e['query'][_0x0c74('0x7e')]),'OpenchannelQueueId':Number(_0x2c378e[_0x0c74('0x57')]['id'])});}});}})[_0x0c74('0x2a')](respondWithStatusCode(_0x1b4674,null))['catch'](handleError(_0x1b4674,null));};exports[_0x0c74('0x88')]=function(_0x5ec825,_0x53bff7,_0x51bd4f){var _0x2ae67b={};var _0x4ef9dc={};var _0x4ab381;var _0x3b2d01;return db['OpenchannelQueue'][_0x0c74('0x5a')]({'where':{'id':_0x5ec825[_0x0c74('0x57')]['id']}})[_0x0c74('0x2a')](handleEntityNotFound(_0x53bff7,null))[_0x0c74('0x2a')](function(_0xf78ae5){if(_0xf78ae5){_0x4ab381=_0xf78ae5;_0x4ef9dc[_0x0c74('0x34')]=_[_0x0c74('0x47')](db[_0x0c74('0x5d')]['rawAttributes']);_0x4ef9dc[_0x0c74('0x35')]=_[_0x0c74('0x47')](_0x5ec825[_0x0c74('0x35')]);_0x4ef9dc[_0x0c74('0x3e')]=_[_0x0c74('0x48')](_0x4ef9dc['model'],_0x4ef9dc[_0x0c74('0x35')]);_0x2ae67b[_0x0c74('0x37')]=_['intersection'](_0x4ef9dc[_0x0c74('0x34')],qs[_0x0c74('0x36')](_0x5ec825[_0x0c74('0x35')][_0x0c74('0x36')]));_0x2ae67b[_0x0c74('0x37')]=_0x2ae67b['attributes']['length']?_0x2ae67b[_0x0c74('0x37')]:_0x4ef9dc[_0x0c74('0x34')];_0x2ae67b[_0x0c74('0x3b')]=qs['sort'](_0x5ec825[_0x0c74('0x35')][_0x0c74('0x3c')]);_0x2ae67b['where']=qs['filters'](_[_0x0c74('0x3f')](_0x5ec825[_0x0c74('0x35')],_0x4ef9dc[_0x0c74('0x3e')]));if(_0x5ec825[_0x0c74('0x35')][_0x0c74('0x5c')]){_0x2ae67b[_0x0c74('0x3d')]=_[_0x0c74('0x40')](_0x2ae67b[_0x0c74('0x3d')],{'$or':_[_0x0c74('0x41')](_0x2ae67b[_0x0c74('0x37')],function(_0x3d442a){var _0x5cddfb={};_0x5cddfb[_0x3d442a]={'$like':'%'+_0x5ec825['query'][_0x0c74('0x5c')]+'%'};return _0x5cddfb;})});}_0x2ae67b=_[_0x0c74('0x40')]({},_0x2ae67b,_0x5ec825[_0x0c74('0x43')]);return _0x4ab381['getAgents'](_0x2ae67b);}})['then'](function(_0x3f98ba){if(_0x3f98ba){_0x3b2d01=_0x3f98ba[_0x0c74('0x49')];if(!_0x5ec825['query'][_0x0c74('0x38')](_0x0c74('0x39'))){_0x2ae67b[_0x0c74('0x3a')]=qs[_0x0c74('0x3a')](_0x5ec825[_0x0c74('0x35')][_0x0c74('0x3a')]);_0x2ae67b['offset']=qs['offset'](_0x5ec825['query'][_0x0c74('0x23')]);}return _0x4ab381[_0x0c74('0x88')](_0x2ae67b);}})['then'](function(_0x4296d0){if(_0x4296d0){return _0x4296d0?{'count':_0x3b2d01,'rows':_0x4296d0}:null;}})['then'](respondWithResult(_0x53bff7,null))['catch'](handleError(_0x53bff7,null));}; \ No newline at end of file +var _0x0e8d=['union','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','destroy','then','get','OpenchannelQueues','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','findOne','UserOpenchannelQueue','length','hasOwnProperty','User','UserId','agent','openchannelPause','updatedAt','format','%s/%s','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','all'];(function(_0x2e17ee,_0x2ca16d){var _0x3155ba=function(_0x3e2f01){while(--_0x3e2f01){_0x2e17ee['push'](_0x2e17ee['shift']());}};_0x3155ba(++_0x2ca16d);}(_0x0e8d,0x117));var _0xd0e8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0e8d[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xd0e8('0x0'));var rimraf=require(_0xd0e8('0x1'));var zipdir=require(_0xd0e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0e8('0x3'));var moment=require(_0xd0e8('0x4'));var BPromise=require(_0xd0e8('0x5'));var Mustache=require(_0xd0e8('0x6'));var util=require(_0xd0e8('0x7'));var path=require(_0xd0e8('0x8'));var sox=require(_0xd0e8('0x9'));var csv=require(_0xd0e8('0xa'));var ejs=require(_0xd0e8('0xb'));var fs=require('fs');var fs_extra=require(_0xd0e8('0xc'));var _=require(_0xd0e8('0xd'));var squel=require('squel');var crypto=require(_0xd0e8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd0e8('0xf'));var toCsv=require(_0xd0e8('0xa'));var querystring=require(_0xd0e8('0x10'));var Papa=require(_0xd0e8('0x11'));var Redis=require(_0xd0e8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd0e8('0x13'));var as=require(_0xd0e8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0e8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd0e8('0x16'));var licenseUtil=require(_0xd0e8('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0e8('0x18')](config[_0xd0e8('0x19')],{'host':_0xd0e8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd0e8('0x19')]));require(_0xd0e8('0x1b'))['register'](socket);function respondWithStatusCode(_0x1a499a,_0x3d7f2f){_0x3d7f2f=_0x3d7f2f||0xcc;return function(_0x3769d2){if(_0x3769d2){return _0x1a499a[_0xd0e8('0x1c')](_0x3d7f2f);}return _0x1a499a[_0xd0e8('0x1d')](_0x3d7f2f)[_0xd0e8('0x1e')]();};}function respondWithResult(_0x5ac3df,_0x12fd14){_0x12fd14=_0x12fd14||0xc8;return function(_0xf5f359){if(_0xf5f359){return _0x5ac3df['status'](_0x12fd14)['json'](_0xf5f359);}};}function respondWithFilteredResult(_0x3e4ed1,_0x4332e1){return function(_0x583b35){if(_0x583b35){var _0x5a6bdf=typeof _0x4332e1[_0xd0e8('0x1f')]==='undefined'&&typeof _0x4332e1['limit']===_0xd0e8('0x20');var _0x31b5d6=_0x583b35['count'];var _0x2021e1=_0x5a6bdf?0x0:_0x4332e1['offset'];var _0x3f5112=_0x5a6bdf?_0x583b35['count']:_0x4332e1[_0xd0e8('0x1f')]+_0x4332e1[_0xd0e8('0x21')];var _0x459a7e;if(_0x3f5112>=_0x31b5d6){_0x3f5112=_0x31b5d6;_0x459a7e=0xc8;}else{_0x459a7e=0xce;}_0x3e4ed1[_0xd0e8('0x1d')](_0x459a7e);return _0x3e4ed1[_0xd0e8('0x22')](_0xd0e8('0x23'),_0x2021e1+'-'+_0x3f5112+'/'+_0x31b5d6)[_0xd0e8('0x24')](_0x583b35);}return null;};}function patchUpdates(_0x5f20ee){return function(_0x2cf485){try{jsonpatch[_0xd0e8('0x25')](_0x2cf485,_0x5f20ee,!![]);}catch(_0xbaae27){return BPromise[_0xd0e8('0x26')](_0xbaae27);}return _0x2cf485[_0xd0e8('0x27')]();};}function saveUpdates(_0x1ec48,_0x597cc2){return function(_0x34ae5c){if(_0x34ae5c){return _0x34ae5c['update'](_0x1ec48)['then'](function(_0x329d87){return _0x329d87;});}return null;};}function removeEntity(_0xdb7d60,_0xb6d0df){return function(_0x9526c5){if(_0x9526c5){return _0x9526c5[_0xd0e8('0x28')]()[_0xd0e8('0x29')](function(){var _0x2e9a57=_0x9526c5[_0xd0e8('0x2a')]({'plain':!![]});var _0x46a43=_0xd0e8('0x2b');return db['UserProfileResource'][_0xd0e8('0x28')]({'where':{'type':_0x46a43,'resourceId':_0x2e9a57['id']}})[_0xd0e8('0x29')](function(){return _0x9526c5;});})['then'](function(){_0xdb7d60[_0xd0e8('0x1d')](0xcc)[_0xd0e8('0x1e')]();});}};}function handleEntityNotFound(_0x420363,_0x367e0a){return function(_0x5d9070){if(!_0x5d9070){_0x420363[_0xd0e8('0x1c')](0x194);}return _0x5d9070;};}function handleError(_0x121eaf,_0x485f96){_0x485f96=_0x485f96||0x1f4;return function(_0x54d3fb){logger[_0xd0e8('0x2c')](_0x54d3fb[_0xd0e8('0x2d')]);if(_0x54d3fb[_0xd0e8('0x2e')]){delete _0x54d3fb[_0xd0e8('0x2e')];}_0x121eaf[_0xd0e8('0x1d')](_0x485f96)[_0xd0e8('0x2f')](_0x54d3fb);};}exports[_0xd0e8('0x30')]=function(_0x48499f,_0x44f5e0){var _0x1392b4={},_0x23ef37={},_0x47b22a={'count':0x0,'rows':[]};var _0x5156b5=_[_0xd0e8('0x31')](db[_0xd0e8('0x32')][_0xd0e8('0x33')],function(_0x5c71b9){return{'name':_0x5c71b9[_0xd0e8('0x34')],'type':_0x5c71b9[_0xd0e8('0x35')]['key']};});_0x23ef37[_0xd0e8('0x36')]=_[_0xd0e8('0x31')](_0x5156b5,_0xd0e8('0x2e'));_0x23ef37['query']=_[_0xd0e8('0x37')](_0x48499f[_0xd0e8('0x38')]);_0x23ef37[_0xd0e8('0x39')]=_[_0xd0e8('0x3a')](_0x23ef37[_0xd0e8('0x36')],_0x23ef37[_0xd0e8('0x38')]);_0x1392b4[_0xd0e8('0x3b')]=_[_0xd0e8('0x3a')](_0x23ef37[_0xd0e8('0x36')],qs['fields'](_0x48499f['query'][_0xd0e8('0x3c')]));_0x1392b4[_0xd0e8('0x3b')]=_0x1392b4[_0xd0e8('0x3b')]['length']?_0x1392b4['attributes']:_0x23ef37[_0xd0e8('0x36')];if(!_0x48499f[_0xd0e8('0x38')]['hasOwnProperty'](_0xd0e8('0x3d'))){_0x1392b4[_0xd0e8('0x21')]=qs['limit'](_0x48499f[_0xd0e8('0x38')]['limit']);_0x1392b4[_0xd0e8('0x1f')]=qs[_0xd0e8('0x1f')](_0x48499f[_0xd0e8('0x38')][_0xd0e8('0x1f')]);}_0x1392b4[_0xd0e8('0x3e')]=qs['sort'](_0x48499f[_0xd0e8('0x38')][_0xd0e8('0x3f')]);_0x1392b4[_0xd0e8('0x40')]=qs[_0xd0e8('0x39')](_[_0xd0e8('0x41')](_0x48499f[_0xd0e8('0x38')],_0x23ef37[_0xd0e8('0x39')]),_0x5156b5);if(_0x48499f[_0xd0e8('0x38')][_0xd0e8('0x42')]){_0x1392b4['where']=_[_0xd0e8('0x43')](_0x1392b4[_0xd0e8('0x40')],{'$or':_[_0xd0e8('0x31')](_0x5156b5,function(_0x5a2fff){if(_0x5a2fff[_0xd0e8('0x35')]!==_0xd0e8('0x44')){var _0x47f4d5={};_0x47f4d5[_0x5a2fff[_0xd0e8('0x2e')]]={'$like':'%'+_0x48499f[_0xd0e8('0x38')]['filter']+'%'};return _0x47f4d5;}})});}_0x1392b4=_[_0xd0e8('0x43')]({},_0x1392b4,_0x48499f['options']);var _0x5e6078={'where':_0x1392b4[_0xd0e8('0x40')]};return db['OpenchannelQueue'][_0xd0e8('0x45')](_0x5e6078)[_0xd0e8('0x29')](function(_0x4bd807){_0x47b22a[_0xd0e8('0x45')]=_0x4bd807;if(_0x48499f[_0xd0e8('0x38')][_0xd0e8('0x46')]){_0x1392b4[_0xd0e8('0x47')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xd0e8('0x48')](_0x1392b4);})[_0xd0e8('0x29')](function(_0x365b5e){_0x47b22a[_0xd0e8('0x49')]=_0x365b5e;return _0x47b22a;})[_0xd0e8('0x29')](respondWithFilteredResult(_0x44f5e0,_0x1392b4))[_0xd0e8('0x4a')](handleError(_0x44f5e0,null));};exports['show']=function(_0x334072,_0xe5917f){var _0x116cd4={'raw':!![],'where':{'id':_0x334072[_0xd0e8('0x4b')]['id']}},_0xe0736f={};_0xe0736f[_0xd0e8('0x36')]=_[_0xd0e8('0x37')](db['OpenchannelQueue'][_0xd0e8('0x33')]);_0xe0736f[_0xd0e8('0x38')]=_[_0xd0e8('0x37')](_0x334072[_0xd0e8('0x38')]);_0xe0736f[_0xd0e8('0x39')]=_[_0xd0e8('0x3a')](_0xe0736f[_0xd0e8('0x36')],_0xe0736f[_0xd0e8('0x38')]);_0x116cd4[_0xd0e8('0x3b')]=_[_0xd0e8('0x3a')](_0xe0736f[_0xd0e8('0x36')],qs[_0xd0e8('0x3c')](_0x334072[_0xd0e8('0x38')]['fields']));_0x116cd4[_0xd0e8('0x3b')]=_0x116cd4[_0xd0e8('0x3b')]['length']?_0x116cd4['attributes']:_0xe0736f[_0xd0e8('0x36')];if(_0x334072[_0xd0e8('0x38')][_0xd0e8('0x46')]){_0x116cd4[_0xd0e8('0x47')]=[{'all':!![]}];}_0x116cd4=_[_0xd0e8('0x43')]({},_0x116cd4,_0x334072[_0xd0e8('0x4c')]);return db[_0xd0e8('0x32')][_0xd0e8('0x4d')](_0x116cd4)[_0xd0e8('0x29')](handleEntityNotFound(_0xe5917f,null))[_0xd0e8('0x29')](respondWithResult(_0xe5917f,null))[_0xd0e8('0x4a')](handleError(_0xe5917f,null));};exports[_0xd0e8('0x4e')]=function(_0x58d5b0,_0x5fec77){return db[_0xd0e8('0x32')][_0xd0e8('0x4e')](_0x58d5b0[_0xd0e8('0x4f')],{})[_0xd0e8('0x29')](function(_0x48775b){var _0x1d0ab6=_0x58d5b0[_0xd0e8('0x50')][_0xd0e8('0x2a')]({'plain':!![]});if(!_0x1d0ab6)throw new Error(_0xd0e8('0x51'));if(_0x1d0ab6['role']===_0xd0e8('0x50')){var _0x4daad3=_0x48775b[_0xd0e8('0x2a')]({'plain':!![]});var _0x2bd646='OpenchannelQueues';return db[_0xd0e8('0x52')]['find']({'where':{'name':_0x2bd646,'userProfileId':_0x1d0ab6[_0xd0e8('0x53')]},'raw':!![]})['then'](function(_0xad47f3){if(_0xad47f3&&_0xad47f3[_0xd0e8('0x54')]===0x0){return db[_0xd0e8('0x55')][_0xd0e8('0x4e')]({'name':_0x4daad3[_0xd0e8('0x2e')],'resourceId':_0x4daad3['id'],'type':_0xad47f3[_0xd0e8('0x2e')],'sectionId':_0xad47f3['id']},{})[_0xd0e8('0x29')](function(){return _0x48775b;});}else{return _0x48775b;}})['catch'](function(_0x555dd6){logger[_0xd0e8('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x555dd6);throw _0x555dd6;});}return _0x48775b;})[_0xd0e8('0x29')](respondWithResult(_0x5fec77,0xc9))[_0xd0e8('0x4a')](handleError(_0x5fec77,null));};exports[_0xd0e8('0x56')]=function(_0x546656,_0x2d0dd3){if(_0x546656['body']['id']){delete _0x546656[_0xd0e8('0x4f')]['id'];}return db[_0xd0e8('0x32')][_0xd0e8('0x4d')]({'where':{'id':_0x546656[_0xd0e8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2d0dd3,null))[_0xd0e8('0x29')](saveUpdates(_0x546656['body'],null))[_0xd0e8('0x29')](respondWithResult(_0x2d0dd3,null))[_0xd0e8('0x4a')](handleError(_0x2d0dd3,null));};exports[_0xd0e8('0x28')]=function(_0x13f3f3,_0x2f3a48){return db[_0xd0e8('0x32')][_0xd0e8('0x4d')]({'where':{'id':_0x13f3f3[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0x2f3a48,null))[_0xd0e8('0x29')](removeEntity(_0x2f3a48,null))['catch'](handleError(_0x2f3a48,null));};exports[_0xd0e8('0x57')]=function(_0x2eea8a,_0x4ed6c7){return db['OpenchannelQueue']['describe']()[_0xd0e8('0x29')](respondWithResult(_0x4ed6c7,null))[_0xd0e8('0x4a')](handleError(_0x4ed6c7,null));};exports['getMembers']=function(_0x58bd0b,_0x1049e1,_0x49c4bb){var _0x1ddf55={'raw':!![],'where':{}},_0x58cecd={},_0xac957d;return db['OpenchannelQueue'][_0xd0e8('0x58')]({'where':{'id':_0x58bd0b[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0x1049e1,null))[_0xd0e8('0x29')](function(_0x5da0a3){if(_0x5da0a3){_0xac957d=_0x5da0a3[_0xd0e8('0x2a')]({'plain':!![]});_0x58cecd[_0xd0e8('0x36')]=_[_0xd0e8('0x37')](db[_0xd0e8('0x59')]['rawAttributes']);_0x58cecd[_0xd0e8('0x38')]=_[_0xd0e8('0x37')](_0x58bd0b[_0xd0e8('0x38')]);_0x58cecd[_0xd0e8('0x39')]=_[_0xd0e8('0x3a')](_0x58cecd[_0xd0e8('0x36')],_0x58cecd[_0xd0e8('0x38')]);_0x1ddf55[_0xd0e8('0x3b')]=_['intersection'](_0x58cecd[_0xd0e8('0x36')],qs[_0xd0e8('0x3c')](_0x58bd0b[_0xd0e8('0x38')]['fields']));_0x1ddf55[_0xd0e8('0x3b')]=_0x1ddf55['attributes'][_0xd0e8('0x5a')]?_0x1ddf55[_0xd0e8('0x3b')]:_0x58cecd[_0xd0e8('0x36')];if(!_0x58bd0b['query'][_0xd0e8('0x5b')](_0xd0e8('0x3d'))){_0x1ddf55[_0xd0e8('0x21')]=qs['limit'](_0x58bd0b[_0xd0e8('0x38')][_0xd0e8('0x21')]);_0x1ddf55['offset']=qs[_0xd0e8('0x1f')](_0x58bd0b[_0xd0e8('0x38')][_0xd0e8('0x1f')]);}_0x1ddf55[_0xd0e8('0x3e')]=qs[_0xd0e8('0x3f')](_0x58bd0b[_0xd0e8('0x38')][_0xd0e8('0x3f')]);_0x1ddf55['where']=qs[_0xd0e8('0x39')](_[_0xd0e8('0x41')](_0x58bd0b[_0xd0e8('0x38')],_0x58cecd[_0xd0e8('0x39')]));_0x1ddf55[_0xd0e8('0x40')]['OpenchannelQueueId']=_0x5da0a3['id'];if(_0x58bd0b[_0xd0e8('0x38')]['filter']){_0x1ddf55[_0xd0e8('0x40')]=_['merge'](_0x1ddf55[_0xd0e8('0x40')],{'$or':_['map'](_0x1ddf55[_0xd0e8('0x3b')],function(_0xd5c2a1){var _0x2d4700={};_0x2d4700[_0xd5c2a1]={'$like':'%'+_0x58bd0b[_0xd0e8('0x38')][_0xd0e8('0x42')]+'%'};return _0x2d4700;})});}_0x1ddf55=_[_0xd0e8('0x43')]({},_0x1ddf55,_0x58bd0b[_0xd0e8('0x4c')]);return db['UserOpenchannelQueue'][_0xd0e8('0x48')](_0x1ddf55);}})[_0xd0e8('0x29')](function(_0x10d679){if(_0x10d679){return db[_0xd0e8('0x5c')]['findAndCountAll']({'where':{'id':_[_0xd0e8('0x31')](_0x10d679,_0xd0e8('0x5d')),'role':_0xd0e8('0x5e')},'attributes':['id','name',_0xd0e8('0x5f'),_0xd0e8('0x60'),'createdAt']});}})[_0xd0e8('0x29')](function(_0x2e9904){if(_0x2e9904){return{'count':_0x2e9904[_0xd0e8('0x45')],'rows':_[_0xd0e8('0x31')](_0x2e9904[_0xd0e8('0x49')],function(_0x18db04){return{'membername':_0x18db04[_0xd0e8('0x2e')],'UserId':_0x18db04['id'],'queue_name':_0xac957d[_0xd0e8('0x2e')],'OpenchannelQueueId':_0xac957d['id'],'interface':util[_0xd0e8('0x61')](_0xd0e8('0x62'),'SIP',_0x18db04[_0xd0e8('0x2e')]),'penalty':0x0,'paused':_0x18db04['openchannelPause'],'createdAt':_0x18db04[_0xd0e8('0x63')],'updatedAt':_0x18db04[_0xd0e8('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1049e1,_0x1ddf55))[_0xd0e8('0x4a')](handleError(_0x1049e1,null));};exports[_0xd0e8('0x64')]=function(_0x2bd221,_0xcf548c,_0x4ae9a4){var _0x4cc703={};var _0x59d3ae={};var _0x2744a7;var _0x27d157;return db[_0xd0e8('0x32')][_0xd0e8('0x58')]({'where':{'id':_0x2bd221[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0xcf548c,null))[_0xd0e8('0x29')](function(_0x2307eb){if(_0x2307eb){_0x2744a7=_0x2307eb;_0x59d3ae['model']=_[_0xd0e8('0x37')](db['Team'][_0xd0e8('0x33')]);_0x59d3ae[_0xd0e8('0x38')]=_[_0xd0e8('0x37')](_0x2bd221[_0xd0e8('0x38')]);_0x59d3ae[_0xd0e8('0x39')]=_[_0xd0e8('0x3a')](_0x59d3ae['model'],_0x59d3ae[_0xd0e8('0x38')]);_0x4cc703['attributes']=_[_0xd0e8('0x3a')](_0x59d3ae['model'],qs[_0xd0e8('0x3c')](_0x2bd221['query']['fields']));_0x4cc703[_0xd0e8('0x3b')]=_0x4cc703['attributes'][_0xd0e8('0x5a')]?_0x4cc703['attributes']:_0x59d3ae[_0xd0e8('0x36')];_0x4cc703[_0xd0e8('0x3e')]=qs[_0xd0e8('0x3f')](_0x2bd221[_0xd0e8('0x38')][_0xd0e8('0x3f')]);_0x4cc703[_0xd0e8('0x40')]=qs[_0xd0e8('0x39')](_['pick'](_0x2bd221[_0xd0e8('0x38')],_0x59d3ae[_0xd0e8('0x39')]));if(_0x2bd221[_0xd0e8('0x38')][_0xd0e8('0x42')]){_0x4cc703[_0xd0e8('0x40')]=_[_0xd0e8('0x43')](_0x4cc703[_0xd0e8('0x40')],{'$or':_['map'](_0x4cc703['attributes'],function(_0xfd92a7){var _0x207299={};_0x207299[_0xfd92a7]={'$like':'%'+_0x2bd221[_0xd0e8('0x38')][_0xd0e8('0x42')]+'%'};return _0x207299;})});}_0x4cc703=_[_0xd0e8('0x43')]({},_0x4cc703,_0x2bd221['options']);return _0x2744a7[_0xd0e8('0x64')](_0x4cc703);}})[_0xd0e8('0x29')](function(_0x306768){if(_0x306768){_0x27d157=_0x306768['length'];if(!_0x2bd221[_0xd0e8('0x38')][_0xd0e8('0x5b')](_0xd0e8('0x3d'))){_0x4cc703[_0xd0e8('0x21')]=qs[_0xd0e8('0x21')](_0x2bd221[_0xd0e8('0x38')]['limit']);_0x4cc703[_0xd0e8('0x1f')]=qs[_0xd0e8('0x1f')](_0x2bd221[_0xd0e8('0x38')]['offset']);}return _0x2744a7[_0xd0e8('0x64')](_0x4cc703);}})[_0xd0e8('0x29')](function(_0x24ce19){if(_0x24ce19){return _0x24ce19?{'count':_0x27d157,'rows':_0x24ce19}:null;}})[_0xd0e8('0x29')](respondWithResult(_0xcf548c,null))[_0xd0e8('0x4a')](handleError(_0xcf548c,null));};exports[_0xd0e8('0x65')]=function(_0x5ebf39,_0x2a3bd2,_0x5aacc9){var _0x2fb6d9=_0x5ebf39[_0xd0e8('0x4f')][_0xd0e8('0x66')];return db[_0xd0e8('0x67')][_0xd0e8('0x48')]({'where':{'id':_0x2fb6d9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd0e8('0x68'),'attributes':['id',_0xd0e8('0x2e'),_0xd0e8('0x69'),_0xd0e8('0x6a'),_0xd0e8('0x6b')],'raw':!![]}]})[_0xd0e8('0x29')](function(_0x321cc9){if(_0x321cc9){var _0x3cb645=_['flatMap'](_0x321cc9,function(_0x23fede){var _0x27faf8=_0x23fede['get']({'plain':!![]});return _0x27faf8['Agents'];});return db[_0xd0e8('0x32')][_0xd0e8('0x4d')]({'where':{'id':_0x5ebf39['params']['id']}})['then'](function(_0x300170){return db[_0xd0e8('0x6c')][_0xd0e8('0x6d')](function(_0x28699e){return _0x300170[_0xd0e8('0x65')](_0x2fb6d9,{'transaction':_0x28699e})['then'](function(){return BPromise['each'](_0x3cb645,function(_0x349779){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x349779['id'],'OpenchannelQueueId':_0x5ebf39['params']['id']},'transaction':_0x28699e});});})[_0xd0e8('0x29')](function(){_0x3cb645[_0xd0e8('0x6e')](function(_0x40aed8){socket[_0xd0e8('0x6f')]('userOpenchannelQueue:save',{'UserId':_0x40aed8['id'],'OpenchannelQueueId':_0x300170['id']});});});});});}})[_0xd0e8('0x29')](respondWithStatusCode(_0x2a3bd2,null))['catch'](handleError(_0x2a3bd2,null));};exports[_0xd0e8('0x70')]=function(_0x4ea949,_0x39bbd1,_0x1748df){return db[_0xd0e8('0x67')][_0xd0e8('0x48')]({'where':{'id':_0x4ea949['query'][_0xd0e8('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd0e8('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd0e8('0x29')](handleEntityNotFound(_0x39bbd1,null))[_0xd0e8('0x29')](function(_0x382ade){var _0x16d958=_[_0xd0e8('0x31')](_0x382ade,'id');var _0x508acf=[];var _0x196ea5=[];var _0x580484=squel[_0xd0e8('0x71')]();_0x580484[_0xd0e8('0x72')](_0xd0e8('0x73'))[_0xd0e8('0x74')](_0xd0e8('0x75'),'tq')['join'](_0xd0e8('0x76'),'ut',_0xd0e8('0x77'))[_0xd0e8('0x40')](_0xd0e8('0x78'),_0x4ea949[_0xd0e8('0x4b')]['id']);for(var _0x2b1050=0x0;_0x2b1050<_0x382ade['length'];_0x2b1050+=0x1){let _0x424496=_0x382ade[_0x2b1050];for(var _0x1be7df=0x0;_0x1be7df<_0x424496[_0xd0e8('0x68')][_0xd0e8('0x5a')];_0x1be7df+=0x1){let _0x350353=_0x424496['Agents'][_0x1be7df];var _0x876764=_0x580484[_0xd0e8('0x79')]();_0x876764['where'](_0xd0e8('0x7a'),_0x350353['id']);_0x196ea5['push'](db[_0xd0e8('0x6c')][_0xd0e8('0x38')](_0x876764[_0xd0e8('0x7b')](),{'type':db[_0xd0e8('0x6c')]['QueryTypes']['SELECT']})[_0xd0e8('0x29')](function(_0x1fe988){if(_0x1fe988[_0xd0e8('0x5a')]===0x1){return _0x350353['id'];}else{var _0x348520=_[_0xd0e8('0x7c')](_['map'](_0x1fe988,'TeamId'),function(_0xec319d){return _['includes'](_0x16d958,_0xec319d);});if(_0x348520){return _0x350353['id'];}}}));}}return BPromise[_0xd0e8('0x7d')](_0x196ea5)[_0xd0e8('0x29')](function(_0x44915f){_0x508acf=_(_0x508acf)[_0xd0e8('0x7e')](_0x44915f)['compact']()[_0xd0e8('0x7f')]();return db[_0xd0e8('0x32')][_0xd0e8('0x4d')]({'where':{'id':_0x4ea949[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](function(_0x4f0097){return db[_0xd0e8('0x6c')][_0xd0e8('0x6d')](function(_0x666d4c){return _0x4f0097[_0xd0e8('0x70')](_0x4ea949[_0xd0e8('0x38')][_0xd0e8('0x66')],{'transaction':_0x666d4c})[_0xd0e8('0x29')](function(){if(!_[_0xd0e8('0x80')](_0x508acf)){return _0x4f0097[_0xd0e8('0x81')](_0x508acf,{'transaction':_0x666d4c});}})[_0xd0e8('0x29')](function(){_0x508acf[_0xd0e8('0x6e')](function(_0x374c13){socket['emit'](_0xd0e8('0x82'),{'UserId':_0x374c13,'OpenchannelQueueId':_0x4f0097['id']});});});});});});})['then'](respondWithStatusCode(_0x39bbd1,null))[_0xd0e8('0x4a')](handleError(_0x39bbd1,null));};exports['addAgents']=function(_0xba1643,_0x4b8a77,_0x1d558a){return db[_0xd0e8('0x32')]['find']({'where':{'id':_0xba1643[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0x4b8a77,null))[_0xd0e8('0x29')](function(_0x49f5e3){if(_0x49f5e3){return _0x49f5e3[_0xd0e8('0x83')](_0xba1643['body'][_0xd0e8('0x66')],_['omit'](_0xba1643['body'],['ids','id'])||{})['spread'](function(_0x42011e){for(var _0x4b81de=0x0;_0x4b81de<_0xba1643[_0xd0e8('0x4f')][_0xd0e8('0x66')][_0xd0e8('0x5a')];_0x4b81de+=0x1){socket[_0xd0e8('0x6f')](_0xd0e8('0x84'),{'UserId':Number(_0xba1643[_0xd0e8('0x4f')][_0xd0e8('0x66')][_0x4b81de]),'OpenchannelQueueId':Number(_0xba1643[_0xd0e8('0x4b')]['id'])});}return _0x42011e;});}})[_0xd0e8('0x29')](respondWithResult(_0x4b8a77,null))['catch'](handleError(_0x4b8a77,null));};exports[_0xd0e8('0x81')]=function(_0x32f2d0,_0x146cb3,_0x106bd3){return db[_0xd0e8('0x32')][_0xd0e8('0x4d')]({'where':{'id':_0x32f2d0[_0xd0e8('0x4b')]['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0x146cb3,null))[_0xd0e8('0x29')](function(_0x2fe256){if(_0x2fe256){return _0x2fe256[_0xd0e8('0x81')](_0x32f2d0[_0xd0e8('0x38')][_0xd0e8('0x66')])[_0xd0e8('0x29')](function(){if(_[_0xd0e8('0x85')](_0x32f2d0[_0xd0e8('0x38')][_0xd0e8('0x66')])){for(var _0x145942=0x0;_0x145942<_0x32f2d0['query']['ids'][_0xd0e8('0x5a')];_0x145942+=0x1){socket[_0xd0e8('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x32f2d0[_0xd0e8('0x38')][_0xd0e8('0x66')][_0x145942]),'OpenchannelQueueId':Number(_0x32f2d0['params']['id'])});}}else{socket[_0xd0e8('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x32f2d0[_0xd0e8('0x38')][_0xd0e8('0x66')]),'OpenchannelQueueId':Number(_0x32f2d0[_0xd0e8('0x4b')]['id'])});}});}})[_0xd0e8('0x29')](respondWithStatusCode(_0x146cb3,null))['catch'](handleError(_0x146cb3,null));};exports[_0xd0e8('0x86')]=function(_0x2efc2d,_0x57f9fe,_0x3ab8cc){var _0x32dc42={};var _0x5653a8={};var _0x298793;var _0x7173a6;return db['OpenchannelQueue'][_0xd0e8('0x58')]({'where':{'id':_0x2efc2d['params']['id']}})[_0xd0e8('0x29')](handleEntityNotFound(_0x57f9fe,null))[_0xd0e8('0x29')](function(_0xe1d0a0){if(_0xe1d0a0){_0x298793=_0xe1d0a0;_0x5653a8[_0xd0e8('0x36')]=_[_0xd0e8('0x37')](db[_0xd0e8('0x5c')]['rawAttributes']);_0x5653a8[_0xd0e8('0x38')]=_[_0xd0e8('0x37')](_0x2efc2d[_0xd0e8('0x38')]);_0x5653a8[_0xd0e8('0x39')]=_[_0xd0e8('0x3a')](_0x5653a8[_0xd0e8('0x36')],_0x5653a8[_0xd0e8('0x38')]);_0x32dc42[_0xd0e8('0x3b')]=_[_0xd0e8('0x3a')](_0x5653a8[_0xd0e8('0x36')],qs[_0xd0e8('0x3c')](_0x2efc2d[_0xd0e8('0x38')]['fields']));_0x32dc42[_0xd0e8('0x3b')]=_0x32dc42['attributes']['length']?_0x32dc42[_0xd0e8('0x3b')]:_0x5653a8[_0xd0e8('0x36')];_0x32dc42['order']=qs[_0xd0e8('0x3f')](_0x2efc2d['query'][_0xd0e8('0x3f')]);_0x32dc42[_0xd0e8('0x40')]=qs[_0xd0e8('0x39')](_[_0xd0e8('0x41')](_0x2efc2d[_0xd0e8('0x38')],_0x5653a8['filters']));if(_0x2efc2d[_0xd0e8('0x38')][_0xd0e8('0x42')]){_0x32dc42[_0xd0e8('0x40')]=_[_0xd0e8('0x43')](_0x32dc42['where'],{'$or':_[_0xd0e8('0x31')](_0x32dc42[_0xd0e8('0x3b')],function(_0x2ad156){var _0x134589={};_0x134589[_0x2ad156]={'$like':'%'+_0x2efc2d[_0xd0e8('0x38')]['filter']+'%'};return _0x134589;})});}_0x32dc42=_[_0xd0e8('0x43')]({},_0x32dc42,_0x2efc2d[_0xd0e8('0x4c')]);return _0x298793['getAgents'](_0x32dc42);}})[_0xd0e8('0x29')](function(_0x38baac){if(_0x38baac){_0x7173a6=_0x38baac['length'];if(!_0x2efc2d[_0xd0e8('0x38')][_0xd0e8('0x5b')](_0xd0e8('0x3d'))){_0x32dc42['limit']=qs[_0xd0e8('0x21')](_0x2efc2d[_0xd0e8('0x38')][_0xd0e8('0x21')]);_0x32dc42[_0xd0e8('0x1f')]=qs['offset'](_0x2efc2d[_0xd0e8('0x38')][_0xd0e8('0x1f')]);}return _0x298793[_0xd0e8('0x86')](_0x32dc42);}})[_0xd0e8('0x29')](function(_0x46c537){if(_0x46c537){return _0x46c537?{'count':_0x7173a6,'rows':_0x46c537}:null;}})[_0xd0e8('0x29')](respondWithResult(_0x57f9fe,null))[_0xd0e8('0x4a')](handleError(_0x57f9fe,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6ffe87e..b918bba 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 _0x0cb8=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x4f2bec,_0xa74720){var _0x285678=function(_0x3cbabb){while(--_0x3cbabb){_0x4f2bec['push'](_0x4f2bec['shift']());}};_0x285678(++_0xa74720);}(_0x0cb8,0xe7));var _0x80cb=function(_0x48fa0e,_0x245150){_0x48fa0e=_0x48fa0e-0x0;var _0x50fa45=_0x0cb8[_0x48fa0e];return _0x50fa45;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x80cb('0x0'))['db'][_0x80cb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x80cb('0x2')](0x0);var events={'afterCreate':_0x80cb('0x3'),'afterUpdate':_0x80cb('0x4'),'afterDestroy':_0x80cb('0x5')};function emitEvent(_0x1bb516){return function(_0x9f57e1,_0x3d283b,_0x308a78){OpenchannelQueueEvents[_0x80cb('0x6')](_0x1bb516+':'+_0x9f57e1['id'],_0x9f57e1);OpenchannelQueueEvents['emit'](_0x1bb516,_0x9f57e1);_0x308a78(null);};}for(var e in events){if(events[_0x80cb('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x019d=['remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x2d3206,_0x434cf5){var _0x18702d=function(_0x4e0735){while(--_0x4e0735){_0x2d3206['push'](_0x2d3206['shift']());}};_0x18702d(++_0x434cf5);}(_0x019d,0x82));var _0xd019=function(_0x52fd18,_0x4aaab8){_0x52fd18=_0x52fd18-0x0;var _0x5b1a30=_0x019d[_0x52fd18];return _0x5b1a30;};'use strict';var EventEmitter=require(_0xd019('0x0'));var OpenchannelQueue=require(_0xd019('0x1'))['db'][_0xd019('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd019('0x3')](0x0);var events={'afterCreate':_0xd019('0x4'),'afterUpdate':'update','afterDestroy':_0xd019('0x5')};function emitEvent(_0x5b0326){return function(_0x5ea7f1,_0x43de42,_0x227aa4){OpenchannelQueueEvents[_0xd019('0x6')](_0x5b0326+':'+_0x5ea7f1['id'],_0x5ea7f1);OpenchannelQueueEvents['emit'](_0x5b0326,_0x5ea7f1);_0x227aa4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xd019('0x7')](e,emitEvent(event));}}module[_0xd019('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 f282e1e..44cc4ec 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 _0xb650=['openchannel_queues','util','../../config/logger','api','request-promise','path','../../config/environment','./openchannelQueue.attributes','define'];(function(_0x5de02c,_0x2bca83){var _0x5bee77=function(_0x447356){while(--_0x447356){_0x5de02c['push'](_0x5de02c['shift']());}};_0x5bee77(++_0x2bca83);}(_0xb650,0x1ba));var _0x0b65=function(_0x578c1a,_0x3e720f){_0x578c1a=_0x578c1a-0x0;var _0x1cfbac=_0xb650[_0x578c1a];return _0x1cfbac;};'use strict';var _=require('lodash');var util=require(_0x0b65('0x0'));var logger=require(_0x0b65('0x1'))(_0x0b65('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b65('0x3'));var fs=require('fs');var path=require(_0x0b65('0x4'));var rimraf=require('rimraf');var config=require(_0x0b65('0x5'));var attributes=require(_0x0b65('0x6'));module['exports']=function(_0x3ff1f6,_0x7922e4){return _0x3ff1f6[_0x0b65('0x7')]('OpenchannelQueue',attributes,{'tableName':_0x0b65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe323=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','api'];(function(_0x4f3359,_0x190803){var _0x36e206=function(_0x110a40){while(--_0x110a40){_0x4f3359['push'](_0x4f3359['shift']());}};_0x36e206(++_0x190803);}(_0xe323,0x11f));var _0x3e32=function(_0x13d8b8,_0x277294){_0x13d8b8=_0x13d8b8-0x0;var _0x549e27=_0xe323[_0x13d8b8];return _0x549e27;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3e32('0x0'));var moment=require(_0x3e32('0x1'));var BPromise=require(_0x3e32('0x2'));var rp=require(_0x3e32('0x3'));var fs=require('fs');var path=require(_0x3e32('0x4'));var rimraf=require(_0x3e32('0x5'));var config=require(_0x3e32('0x6'));var attributes=require(_0x3e32('0x7'));module[_0x3e32('0x8')]=function(_0x33fee7,_0xcc6f84){return _0x33fee7[_0x3e32('0x9')](_0x3e32('0xa'),attributes,{'tableName':_0x3e32('0xb'),'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 cae396e..50b4026 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 _0x09d6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetOpenchannelQueue','options','raw','where','limit','include','map','model','attributes','debug','stringify','OpenchannelQueue','find','ShowOpenchannelQueue','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x25b70c,_0x2383d4){var _0x4ed70e=function(_0x42aa18){while(--_0x42aa18){_0x25b70c['push'](_0x25b70c['shift']());}};_0x4ed70e(++_0x2383d4);}(_0x09d6,0xeb));var _0x609d=function(_0x4238d7,_0x15b20b){_0x4238d7=_0x4238d7-0x0;var _0x284414=_0x09d6[_0x4238d7];return _0x284414;};'use strict';var _=require('lodash');var util=require(_0x609d('0x0'));var moment=require(_0x609d('0x1'));var BPromise=require('bluebird');var rs=require(_0x609d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x609d('0x3'))['db'];var utils=require(_0x609d('0x4'));var logger=require(_0x609d('0x5'))(_0x609d('0x6'));var config=require(_0x609d('0x7'));var jayson=require(_0x609d('0x8'));var client=jayson[_0x609d('0x9')][_0x609d('0xa')]({'port':0x232a});config[_0x609d('0xb')]=_[_0x609d('0xc')](config['redis'],{'host':_0x609d('0xd'),'port':0x18eb});var socket=require(_0x609d('0xe'))(new Redis(config[_0x609d('0xb')]));require('./openchannelQueue.socket')[_0x609d('0xf')](socket);function respondWithRpcPromise(_0x3e96b1,_0x2f1eb2,_0x2d4a33){return new BPromise(function(_0x4bb37d,_0x38f712){return client['request'](_0x3e96b1,_0x2d4a33)[_0x609d('0x10')](function(_0x38a0fd){logger['info'](_0x609d('0x11'),_0x2f1eb2,_0x609d('0x12'));logger['debug'](_0x609d('0x13'),_0x2f1eb2,_0x609d('0x12'),JSON['stringify'](_0x38a0fd));if(_0x38a0fd[_0x609d('0x14')]){if(_0x38a0fd['error'][_0x609d('0x15')]===0x1f4){logger['error'](_0x609d('0x11'),_0x2f1eb2,_0x38a0fd[_0x609d('0x14')][_0x609d('0x16')]);return _0x38f712(_0x38a0fd['error'][_0x609d('0x16')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2f1eb2,_0x38a0fd[_0x609d('0x14')][_0x609d('0x16')]);return _0x4bb37d(_0x38a0fd[_0x609d('0x14')][_0x609d('0x16')]);}else{logger[_0x609d('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x2f1eb2,'request\x20sent');_0x4bb37d(_0x38a0fd[_0x609d('0x18')][_0x609d('0x16')]);}})[_0x609d('0x19')](function(_0x22d8f3){logger[_0x609d('0x14')](_0x609d('0x11'),_0x2f1eb2,_0x22d8f3);_0x38f712(_0x22d8f3);});});}exports[_0x609d('0x1a')]=function(_0x7da921){var _0x175a46=this;return new Promise(function(_0x61be9,_0xb7a7e6){return db['OpenchannelQueue']['findAll']({'raw':_0x7da921[_0x609d('0x1b')]?_0x7da921[_0x609d('0x1b')][_0x609d('0x1c')]===undefined?!![]:![]:!![],'where':_0x7da921[_0x609d('0x1b')]?_0x7da921[_0x609d('0x1b')][_0x609d('0x1d')]||null:null,'attributes':_0x7da921[_0x609d('0x1b')]?_0x7da921[_0x609d('0x1b')]['attributes']||null:null,'limit':_0x7da921[_0x609d('0x1b')]?_0x7da921['options'][_0x609d('0x1e')]||null:null,'include':_0x7da921[_0x609d('0x1b')]?_0x7da921[_0x609d('0x1b')][_0x609d('0x1f')]?_[_0x609d('0x20')](_0x7da921['options'][_0x609d('0x1f')],function(_0x2ece76){return{'model':db[_0x2ece76[_0x609d('0x21')]],'as':_0x2ece76['as'],'attributes':_0x2ece76['attributes'],'include':_0x2ece76[_0x609d('0x1f')]?_[_0x609d('0x20')](_0x2ece76[_0x609d('0x1f')],function(_0x5757f4){return{'model':db[_0x5757f4['model']],'as':_0x5757f4['as'],'attributes':_0x5757f4[_0x609d('0x22')],'include':_0x5757f4[_0x609d('0x1f')]?_[_0x609d('0x20')](_0x5757f4['include'],function(_0x5b7e41){return{'model':db[_0x5b7e41[_0x609d('0x21')]],'as':_0x5b7e41['as'],'attributes':_0x5b7e41[_0x609d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x609d('0x10')](function(_0x40bc83){logger[_0x609d('0x17')](_0x609d('0x1a'),_0x7da921);logger[_0x609d('0x23')](_0x609d('0x1a'),_0x7da921,JSON[_0x609d('0x24')](_0x40bc83));_0x61be9(_0x40bc83);})[_0x609d('0x19')](function(_0x2aa32f){logger[_0x609d('0x14')]('GetOpenchannelQueue',_0x2aa32f[_0x609d('0x16')],_0x7da921);_0xb7a7e6(_0x175a46[_0x609d('0x14')](0x1f4,_0x2aa32f['message']));});});};exports['ShowOpenchannelQueue']=function(_0x2e3520){var _0x4a800e=this;return new Promise(function(_0x3aecbc,_0x585481){return db[_0x609d('0x25')][_0x609d('0x26')]({'raw':_0x2e3520[_0x609d('0x1b')]?_0x2e3520[_0x609d('0x1b')][_0x609d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e3520[_0x609d('0x1b')]?_0x2e3520[_0x609d('0x1b')][_0x609d('0x1d')]||null:null,'attributes':_0x2e3520[_0x609d('0x1b')]?_0x2e3520[_0x609d('0x1b')]['attributes']||null:null,'include':_0x2e3520[_0x609d('0x1b')]?_0x2e3520[_0x609d('0x1b')][_0x609d('0x1f')]?_[_0x609d('0x20')](_0x2e3520[_0x609d('0x1b')][_0x609d('0x1f')],function(_0x521f87){return{'model':db[_0x521f87[_0x609d('0x21')]],'as':_0x521f87['as'],'attributes':_0x521f87[_0x609d('0x22')],'include':_0x521f87['include']?_['map'](_0x521f87[_0x609d('0x1f')],function(_0x3277fd){return{'model':db[_0x3277fd['model']],'as':_0x3277fd['as'],'attributes':_0x3277fd['attributes'],'include':_0x3277fd[_0x609d('0x1f')]?_[_0x609d('0x20')](_0x3277fd[_0x609d('0x1f')],function(_0x586869){return{'model':db[_0x586869['model']],'as':_0x586869['as'],'attributes':_0x586869['attributes']};}):[]};}):[]};}):[]:[]})[_0x609d('0x10')](function(_0x34d12b){logger[_0x609d('0x17')](_0x609d('0x27'),_0x2e3520);logger[_0x609d('0x23')](_0x609d('0x27'),_0x2e3520,JSON[_0x609d('0x24')](_0x34d12b));_0x3aecbc(_0x34d12b);})[_0x609d('0x19')](function(_0x1c2130){logger[_0x609d('0x14')](_0x609d('0x27'),_0x1c2130['message'],_0x2e3520);_0x585481(_0x4a800e['error'](0x1f4,_0x1c2130[_0x609d('0x16')]));});});}; \ No newline at end of file +var _0xcdc6=['find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','include','map','model','attributes','then','stringify','ShowOpenchannelQueue'];(function(_0x7f7d62,_0x93eec1){var _0x33939c=function(_0x34d176){while(--_0x34d176){_0x7f7d62['push'](_0x7f7d62['shift']());}};_0x33939c(++_0x93eec1);}(_0xcdc6,0x112));var _0x6cdc=function(_0x39504d,_0x372633){_0x39504d=_0x39504d-0x0;var _0x6c3829=_0xcdc6[_0x39504d];return _0x6c3829;};'use strict';var _=require(_0x6cdc('0x0'));var util=require(_0x6cdc('0x1'));var moment=require(_0x6cdc('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cdc('0x3'));var fs=require('fs');var Redis=require(_0x6cdc('0x4'));var db=require(_0x6cdc('0x5'))['db'];var utils=require(_0x6cdc('0x6'));var logger=require(_0x6cdc('0x7'))(_0x6cdc('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cdc('0x9')][_0x6cdc('0xa')]({'port':0x232a});config[_0x6cdc('0xb')]=_[_0x6cdc('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6cdc('0xd'))(new Redis(config['redis']));require(_0x6cdc('0xe'))[_0x6cdc('0xf')](socket);function respondWithRpcPromise(_0x20a2cc,_0x17095b,_0x29fc49){return new BPromise(function(_0x2cb484,_0xb12952){return client[_0x6cdc('0x10')](_0x20a2cc,_0x29fc49)['then'](function(_0xad4d4a){logger[_0x6cdc('0x11')](_0x6cdc('0x12'),_0x17095b,_0x6cdc('0x13'));logger[_0x6cdc('0x14')](_0x6cdc('0x15'),_0x17095b,'request\x20sent',JSON['stringify'](_0xad4d4a));if(_0xad4d4a['error']){if(_0xad4d4a['error']['code']===0x1f4){logger['error'](_0x6cdc('0x12'),_0x17095b,_0xad4d4a[_0x6cdc('0x16')][_0x6cdc('0x17')]);return _0xb12952(_0xad4d4a['error'][_0x6cdc('0x17')]);}logger[_0x6cdc('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x17095b,_0xad4d4a[_0x6cdc('0x16')][_0x6cdc('0x17')]);return _0x2cb484(_0xad4d4a[_0x6cdc('0x16')][_0x6cdc('0x17')]);}else{logger[_0x6cdc('0x11')](_0x6cdc('0x12'),_0x17095b,'request\x20sent');_0x2cb484(_0xad4d4a[_0x6cdc('0x18')][_0x6cdc('0x17')]);}})[_0x6cdc('0x19')](function(_0x149553){logger[_0x6cdc('0x16')](_0x6cdc('0x12'),_0x17095b,_0x149553);_0xb12952(_0x149553);});});}exports[_0x6cdc('0x1a')]=function(_0x496f64){var _0x366ab5=this;return new Promise(function(_0x160acc,_0x33dcd5){return db['OpenchannelQueue'][_0x6cdc('0x1b')]({'raw':_0x496f64[_0x6cdc('0x1c')]?_0x496f64[_0x6cdc('0x1c')][_0x6cdc('0x1d')]===undefined?!![]:![]:!![],'where':_0x496f64[_0x6cdc('0x1c')]?_0x496f64[_0x6cdc('0x1c')][_0x6cdc('0x1e')]||null:null,'attributes':_0x496f64[_0x6cdc('0x1c')]?_0x496f64[_0x6cdc('0x1c')]['attributes']||null:null,'limit':_0x496f64[_0x6cdc('0x1c')]?_0x496f64[_0x6cdc('0x1c')]['limit']||null:null,'include':_0x496f64[_0x6cdc('0x1c')]?_0x496f64[_0x6cdc('0x1c')][_0x6cdc('0x1f')]?_[_0x6cdc('0x20')](_0x496f64[_0x6cdc('0x1c')][_0x6cdc('0x1f')],function(_0x547f80){return{'model':db[_0x547f80['model']],'as':_0x547f80['as'],'attributes':_0x547f80['attributes'],'include':_0x547f80['include']?_[_0x6cdc('0x20')](_0x547f80[_0x6cdc('0x1f')],function(_0x20d1fc){return{'model':db[_0x20d1fc[_0x6cdc('0x21')]],'as':_0x20d1fc['as'],'attributes':_0x20d1fc[_0x6cdc('0x22')],'include':_0x20d1fc['include']?_['map'](_0x20d1fc[_0x6cdc('0x1f')],function(_0x142661){return{'model':db[_0x142661['model']],'as':_0x142661['as'],'attributes':_0x142661[_0x6cdc('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6cdc('0x23')](function(_0xc3d4f3){logger[_0x6cdc('0x11')](_0x6cdc('0x1a'),_0x496f64);logger[_0x6cdc('0x14')](_0x6cdc('0x1a'),_0x496f64,JSON[_0x6cdc('0x24')](_0xc3d4f3));_0x160acc(_0xc3d4f3);})[_0x6cdc('0x19')](function(_0x16b5cd){logger['error']('GetOpenchannelQueue',_0x16b5cd[_0x6cdc('0x17')],_0x496f64);_0x33dcd5(_0x366ab5[_0x6cdc('0x16')](0x1f4,_0x16b5cd['message']));});});};exports[_0x6cdc('0x25')]=function(_0x2ba713){var _0x478a14=this;return new Promise(function(_0x47cb3a,_0x37f745){return db['OpenchannelQueue'][_0x6cdc('0x26')]({'raw':_0x2ba713[_0x6cdc('0x1c')]?_0x2ba713[_0x6cdc('0x1c')][_0x6cdc('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ba713['options']?_0x2ba713['options'][_0x6cdc('0x1e')]||null:null,'attributes':_0x2ba713[_0x6cdc('0x1c')]?_0x2ba713[_0x6cdc('0x1c')][_0x6cdc('0x22')]||null:null,'include':_0x2ba713['options']?_0x2ba713['options'][_0x6cdc('0x1f')]?_['map'](_0x2ba713[_0x6cdc('0x1c')][_0x6cdc('0x1f')],function(_0x306165){return{'model':db[_0x306165[_0x6cdc('0x21')]],'as':_0x306165['as'],'attributes':_0x306165[_0x6cdc('0x22')],'include':_0x306165[_0x6cdc('0x1f')]?_[_0x6cdc('0x20')](_0x306165[_0x6cdc('0x1f')],function(_0x521951){return{'model':db[_0x521951[_0x6cdc('0x21')]],'as':_0x521951['as'],'attributes':_0x521951[_0x6cdc('0x22')],'include':_0x521951[_0x6cdc('0x1f')]?_['map'](_0x521951[_0x6cdc('0x1f')],function(_0x46f241){return{'model':db[_0x46f241[_0x6cdc('0x21')]],'as':_0x46f241['as'],'attributes':_0x46f241[_0x6cdc('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e5cda){logger[_0x6cdc('0x11')](_0x6cdc('0x25'),_0x2ba713);logger[_0x6cdc('0x14')](_0x6cdc('0x25'),_0x2ba713,JSON[_0x6cdc('0x24')](_0x5e5cda));_0x47cb3a(_0x5e5cda);})['catch'](function(_0x4f602c){logger[_0x6cdc('0x16')](_0x6cdc('0x25'),_0x4f602c[_0x6cdc('0x17')],_0x2ba713);_0x37f745(_0x478a14[_0x6cdc('0x16')](0x1f4,_0x4f602c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ce2ba68..3a520e5 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 _0x25de=['remove','update','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x2c82e8,_0xb74690){var _0x4ad3f9=function(_0x5c357f){while(--_0x5c357f){_0x2c82e8['push'](_0x2c82e8['shift']());}};_0x4ad3f9(++_0xb74690);}(_0x25de,0x176));var _0xe25d=function(_0x233716,_0x346676){_0x233716=_0x233716-0x0;var _0x302298=_0x25de[_0x233716];return _0x302298;};'use strict';var OpenchannelQueueEvents=require(_0xe25d('0x0'));var events=[_0xe25d('0x1'),_0xe25d('0x2'),_0xe25d('0x3')];function createListener(_0x3fcaf1,_0x1e0121){return function(_0x201d95){_0x1e0121['emit'](_0x3fcaf1,_0x201d95);};}function removeListener(_0x4e02ca,_0x54b97e){return function(){OpenchannelQueueEvents[_0xe25d('0x4')](_0x4e02ca,_0x54b97e);};}exports[_0xe25d('0x5')]=function(_0x22ca71){for(var _0x3f2b78=0x0,_0x417a83=events[_0xe25d('0x6')];_0x3f2b78<_0x417a83;_0x3f2b78++){var _0x2c6cfd=events[_0x3f2b78];var _0x2cac3a=createListener(_0xe25d('0x7')+_0x2c6cfd,_0x22ca71);OpenchannelQueueEvents['on'](_0x2c6cfd,_0x2cac3a);}}; \ No newline at end of file +var _0x6725=['remove','update','emit','./openchannelQueue.events','save'];(function(_0x5cb7d6,_0x5485ae){var _0x28171c=function(_0x56718b){while(--_0x56718b){_0x5cb7d6['push'](_0x5cb7d6['shift']());}};_0x28171c(++_0x5485ae);}(_0x6725,0x1a2));var _0x5672=function(_0x1d51b8,_0x4d503){_0x1d51b8=_0x1d51b8-0x0;var _0x3b3a59=_0x6725[_0x1d51b8];return _0x3b3a59;};'use strict';var OpenchannelQueueEvents=require(_0x5672('0x0'));var events=[_0x5672('0x1'),_0x5672('0x2'),_0x5672('0x3')];function createListener(_0x4bc362,_0x28df7d){return function(_0x366435){_0x28df7d[_0x5672('0x4')](_0x4bc362,_0x366435);};}function removeListener(_0x43ca1d,_0x349976){return function(){OpenchannelQueueEvents['removeListener'](_0x43ca1d,_0x349976);};}exports['register']=function(_0x33e21f){for(var _0x3d42cb=0x0,_0x485ee5=events['length'];_0x3d42cb<_0x485ee5;_0x3d42cb++){var _0x5673d6=events[_0x3d42cb];var _0x10fd06=createListener('openchannelQueue:'+_0x5673d6,_0x33e21f);OpenchannelQueueEvents['on'](_0x5673d6,_0x10fd06);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5166605..a104990 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 _0x3dc2=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3dc2,0x92));var _0x23dc=function(_0x22b4f5,_0x2ab6cc){_0x22b4f5=_0x22b4f5-0x0;var _0x24e062=_0x3dc2[_0x22b4f5];return _0x24e062;};'use strict';var multer=require(_0x23dc('0x0'));var util=require(_0x23dc('0x1'));var path=require(_0x23dc('0x2'));var timeout=require(_0x23dc('0x3'));var express=require('express');var router=express[_0x23dc('0x4')]();var fs_extra=require(_0x23dc('0x5'));var auth=require(_0x23dc('0x6'));var interaction=require(_0x23dc('0x7'));var config=require(_0x23dc('0x8'));var controller=require(_0x23dc('0x9'));router[_0x23dc('0xa')]('/',auth[_0x23dc('0xb')](),controller['index']);router[_0x23dc('0xa')](_0x23dc('0xc'),auth['isAuthenticated'](),controller[_0x23dc('0xd')]);router[_0x23dc('0xa')](_0x23dc('0xe'),auth['isAuthenticated'](),controller[_0x23dc('0xf')]);router[_0x23dc('0x10')]('/',auth['isAuthenticated'](),controller[_0x23dc('0x11')]);router[_0x23dc('0x12')](_0x23dc('0xe'),auth[_0x23dc('0xb')](),controller['update']);router[_0x23dc('0x13')](_0x23dc('0xe'),auth['isAuthenticated'](),controller[_0x23dc('0x14')]);module[_0x23dc('0x15')]=router; \ No newline at end of file +var _0xe4b1=['index','/describe','describe','/:id','show','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated'];(function(_0xe7dfa7,_0x3d17ee){var _0x1a9fbf=function(_0x2ef98a){while(--_0x2ef98a){_0xe7dfa7['push'](_0xe7dfa7['shift']());}};_0x1a9fbf(++_0x3d17ee);}(_0xe4b1,0x1b8));var _0x1e4b=function(_0x2cf062,_0x3c15c6){_0x2cf062=_0x2cf062-0x0;var _0x376203=_0xe4b1[_0x2cf062];return _0x376203;};'use strict';var multer=require(_0x1e4b('0x0'));var util=require(_0x1e4b('0x1'));var path=require('path');var timeout=require(_0x1e4b('0x2'));var express=require(_0x1e4b('0x3'));var router=express[_0x1e4b('0x4')]();var fs_extra=require(_0x1e4b('0x5'));var auth=require(_0x1e4b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e4b('0x7'));router[_0x1e4b('0x8')]('/',auth[_0x1e4b('0x9')](),controller[_0x1e4b('0xa')]);router[_0x1e4b('0x8')](_0x1e4b('0xb'),auth[_0x1e4b('0x9')](),controller[_0x1e4b('0xc')]);router[_0x1e4b('0x8')](_0x1e4b('0xd'),auth[_0x1e4b('0x9')](),controller[_0x1e4b('0xe')]);router['post']('/',auth[_0x1e4b('0x9')](),controller['create']);router[_0x1e4b('0xf')](_0x1e4b('0xd'),auth[_0x1e4b('0x9')](),controller['update']);router['delete'](_0x1e4b('0xd'),auth['isAuthenticated'](),controller[_0x1e4b('0x10')]);module[_0x1e4b('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 9639da2..3def02a 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 _0x7b06=['DATE','moment','sequelize','exports','STRING'];(function(_0x326f25,_0x9dd03b){var _0x2c876b=function(_0x2691ee){while(--_0x2691ee){_0x326f25['push'](_0x326f25['shift']());}};_0x2c876b(++_0x9dd03b);}(_0x7b06,0x173));var _0x67b0=function(_0x171e4d,_0x4f2493){_0x171e4d=_0x171e4d-0x0;var _0x2d2bf4=_0x7b06[_0x171e4d];return _0x2d2bf4;};'use strict';var moment=require(_0x67b0('0x0'));var Sequelize=require(_0x67b0('0x1'));module[_0x67b0('0x2')]={'uniqueid':{'type':Sequelize[_0x67b0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x67b0('0x3')]},'joinAt':{'type':Sequelize[_0x67b0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x67b0('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5704=['exports','STRING','DATE'];(function(_0x2f3aa2,_0x100f54){var _0x4e35d5=function(_0x3b707a){while(--_0x3b707a){_0x2f3aa2['push'](_0x2f3aa2['shift']());}};_0x4e35d5(++_0x100f54);}(_0x5704,0x1e3));var _0x4570=function(_0x163a1c,_0x4f81ea){_0x163a1c=_0x163a1c-0x0;var _0x239113=_0x5704[_0x163a1c];return _0x239113;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4570('0x0')]={'uniqueid':{'type':Sequelize[_0x4570('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x4570('0x1')]},'joinAt':{'type':Sequelize[_0x4570('0x2')]},'leaveAt':{'type':Sequelize[_0x4570('0x2')]},'acceptAt':{'type':Sequelize[_0x4570('0x2')]},'exitAt':{'type':Sequelize[_0x4570('0x2')]},'reason':{'type':Sequelize[_0x4570('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 601312e..aac9b87 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 _0x5494=['bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5494,0xe9));var _0x4549=function(_0x116482,_0x35ddae){_0x116482=_0x116482-0x0;var _0x56db37=_0x5494[_0x116482];return _0x56db37;};'use strict';var emlformat=require(_0x4549('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4549('0x1'));var jsonpatch=require(_0x4549('0x2'));var rp=require(_0x4549('0x3'));var moment=require('moment');var BPromise=require(_0x4549('0x4'));var Mustache=require('mustache');var util=require(_0x4549('0x5'));var path=require(_0x4549('0x6'));var sox=require('sox');var csv=require(_0x4549('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4549('0x8'));var _=require(_0x4549('0x9'));var squel=require(_0x4549('0xa'));var crypto=require(_0x4549('0xb'));var jsforce=require(_0x4549('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4549('0xd'));var Papa=require(_0x4549('0xe'));var Redis=require(_0x4549('0xf'));var authService=require(_0x4549('0x10'));var qs=require(_0x4549('0x11'));var as=require(_0x4549('0x12'));var hardwareService=require(_0x4549('0x13'));var logger=require(_0x4549('0x14'))(_0x4549('0x15'));var utils=require(_0x4549('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4549('0x17'));var db=require(_0x4549('0x18'))['db'];function respondWithStatusCode(_0x480e6d,_0x58ffbd){_0x58ffbd=_0x58ffbd||0xcc;return function(_0x3ef325){if(_0x3ef325){return _0x480e6d[_0x4549('0x19')](_0x58ffbd);}return _0x480e6d[_0x4549('0x1a')](_0x58ffbd)['end']();};}function respondWithResult(_0x2d0fd5,_0x9e8b0f){_0x9e8b0f=_0x9e8b0f||0xc8;return function(_0x554b0d){if(_0x554b0d){return _0x2d0fd5[_0x4549('0x1a')](_0x9e8b0f)[_0x4549('0x1b')](_0x554b0d);}};}function respondWithFilteredResult(_0x351dd0,_0x11a4d9){return function(_0x13edb1){if(_0x13edb1){var _0x3c56b5=typeof _0x11a4d9[_0x4549('0x1c')]===_0x4549('0x1d')&&typeof _0x11a4d9[_0x4549('0x1e')]===_0x4549('0x1d');var _0x302270=_0x13edb1['count'];var _0x389a1b=_0x3c56b5?0x0:_0x11a4d9[_0x4549('0x1c')];var _0x5a0870=_0x3c56b5?_0x13edb1['count']:_0x11a4d9[_0x4549('0x1c')]+_0x11a4d9[_0x4549('0x1e')];var _0x5be0d8;if(_0x5a0870>=_0x302270){_0x5a0870=_0x302270;_0x5be0d8=0xc8;}else{_0x5be0d8=0xce;}_0x351dd0[_0x4549('0x1a')](_0x5be0d8);return _0x351dd0[_0x4549('0x1f')](_0x4549('0x20'),_0x389a1b+'-'+_0x5a0870+'/'+_0x302270)[_0x4549('0x1b')](_0x13edb1);}return null;};}function patchUpdates(_0x31361d){return function(_0x1f473c){try{jsonpatch[_0x4549('0x21')](_0x1f473c,_0x31361d,!![]);}catch(_0x184720){return BPromise[_0x4549('0x22')](_0x184720);}return _0x1f473c['save']();};}function saveUpdates(_0x5b7792,_0x4c0f4e){return function(_0x10b2eb){if(_0x10b2eb){return _0x10b2eb[_0x4549('0x23')](_0x5b7792)['then'](function(_0x461cbd){return _0x461cbd;});}return null;};}function removeEntity(_0x537e18,_0x1e3e17){return function(_0x366fe2){if(_0x366fe2){return _0x366fe2[_0x4549('0x24')]()[_0x4549('0x25')](function(){_0x537e18[_0x4549('0x1a')](0xcc)[_0x4549('0x26')]();});}};}function handleEntityNotFound(_0x46de1c,_0x5d7f9b){return function(_0xe6160b){if(!_0xe6160b){_0x46de1c[_0x4549('0x19')](0x194);}return _0xe6160b;};}function handleError(_0xe9582a,_0x5019a4){_0x5019a4=_0x5019a4||0x1f4;return function(_0xb2ff9){logger[_0x4549('0x27')](_0xb2ff9[_0x4549('0x28')]);if(_0xb2ff9[_0x4549('0x29')]){delete _0xb2ff9[_0x4549('0x29')];}_0xe9582a['status'](_0x5019a4)[_0x4549('0x2a')](_0xb2ff9);};}exports[_0x4549('0x2b')]=function(_0x2c5f01,_0x547628){var _0xb965bf={},_0x4bad24={},_0x227fa0={'count':0x0,'rows':[]};var _0x1a2bca=_[_0x4549('0x2c')](db[_0x4549('0x2d')]['rawAttributes'],function(_0x43c287){return{'name':_0x43c287[_0x4549('0x2e')],'type':_0x43c287[_0x4549('0x2f')][_0x4549('0x30')]};});_0x4bad24[_0x4549('0x31')]=_[_0x4549('0x2c')](_0x1a2bca,_0x4549('0x29'));_0x4bad24[_0x4549('0x32')]=_[_0x4549('0x33')](_0x2c5f01[_0x4549('0x32')]);_0x4bad24[_0x4549('0x34')]=_[_0x4549('0x35')](_0x4bad24[_0x4549('0x31')],_0x4bad24[_0x4549('0x32')]);_0xb965bf['attributes']=_[_0x4549('0x35')](_0x4bad24['model'],qs['fields'](_0x2c5f01[_0x4549('0x32')][_0x4549('0x36')]));_0xb965bf[_0x4549('0x37')]=_0xb965bf[_0x4549('0x37')][_0x4549('0x38')]?_0xb965bf['attributes']:_0x4bad24[_0x4549('0x31')];if(!_0x2c5f01[_0x4549('0x32')][_0x4549('0x39')]('nolimit')){_0xb965bf[_0x4549('0x1e')]=qs[_0x4549('0x1e')](_0x2c5f01['query'][_0x4549('0x1e')]);_0xb965bf[_0x4549('0x1c')]=qs[_0x4549('0x1c')](_0x2c5f01[_0x4549('0x32')][_0x4549('0x1c')]);}_0xb965bf[_0x4549('0x3a')]=qs[_0x4549('0x3b')](_0x2c5f01[_0x4549('0x32')]['sort']);_0xb965bf['where']=qs[_0x4549('0x34')](_[_0x4549('0x3c')](_0x2c5f01[_0x4549('0x32')],_0x4bad24['filters']),_0x1a2bca);if(_0x2c5f01['query'][_0x4549('0x3d')]){_0xb965bf[_0x4549('0x3e')]=_['merge'](_0xb965bf['where'],{'$or':_[_0x4549('0x2c')](_0x1a2bca,function(_0x58fac2){if(_0x58fac2[_0x4549('0x2f')]!==_0x4549('0x3f')){var _0x567d4a={};_0x567d4a[_0x58fac2[_0x4549('0x29')]]={'$like':'%'+_0x2c5f01[_0x4549('0x32')][_0x4549('0x3d')]+'%'};return _0x567d4a;}})});}_0xb965bf=_[_0x4549('0x40')]({},_0xb965bf,_0x2c5f01[_0x4549('0x41')]);var _0x1d83ce={'where':_0xb965bf['where']};return db[_0x4549('0x2d')][_0x4549('0x42')](_0x1d83ce)['then'](function(_0x12487b){_0x227fa0[_0x4549('0x42')]=_0x12487b;if(_0x2c5f01[_0x4549('0x32')][_0x4549('0x43')]){_0xb965bf[_0x4549('0x44')]=[{'all':!![]}];}return db[_0x4549('0x2d')][_0x4549('0x45')](_0xb965bf);})['then'](function(_0x2d7bf8){_0x227fa0[_0x4549('0x46')]=_0x2d7bf8;return _0x227fa0;})[_0x4549('0x25')](respondWithFilteredResult(_0x547628,_0xb965bf))[_0x4549('0x47')](handleError(_0x547628,null));};exports[_0x4549('0x48')]=function(_0x157a9b,_0xbe3ad8){var _0x5e062b={'raw':!![],'where':{'id':_0x157a9b['params']['id']}},_0x1911e2={};_0x1911e2[_0x4549('0x31')]=_[_0x4549('0x33')](db[_0x4549('0x2d')][_0x4549('0x49')]);_0x1911e2['query']=_['keys'](_0x157a9b[_0x4549('0x32')]);_0x1911e2[_0x4549('0x34')]=_[_0x4549('0x35')](_0x1911e2[_0x4549('0x31')],_0x1911e2[_0x4549('0x32')]);_0x5e062b['attributes']=_['intersection'](_0x1911e2['model'],qs[_0x4549('0x36')](_0x157a9b['query'][_0x4549('0x36')]));_0x5e062b[_0x4549('0x37')]=_0x5e062b['attributes']['length']?_0x5e062b[_0x4549('0x37')]:_0x1911e2[_0x4549('0x31')];if(_0x157a9b[_0x4549('0x32')]['includeAll']){_0x5e062b[_0x4549('0x44')]=[{'all':!![]}];}_0x5e062b=_[_0x4549('0x40')]({},_0x5e062b,_0x157a9b[_0x4549('0x41')]);return db['OpenchannelQueueReport'][_0x4549('0x4a')](_0x5e062b)[_0x4549('0x25')](handleEntityNotFound(_0xbe3ad8,null))[_0x4549('0x25')](respondWithResult(_0xbe3ad8,null))[_0x4549('0x47')](handleError(_0xbe3ad8,null));};exports[_0x4549('0x4b')]=function(_0x4e9bdf,_0x36baa9){return db[_0x4549('0x2d')][_0x4549('0x4b')](_0x4e9bdf[_0x4549('0x4c')],{})[_0x4549('0x25')](respondWithResult(_0x36baa9,0xc9))['catch'](handleError(_0x36baa9,null));};exports[_0x4549('0x23')]=function(_0x3eadac,_0x314730){if(_0x3eadac['body']['id']){delete _0x3eadac[_0x4549('0x4c')]['id'];}return db['OpenchannelQueueReport'][_0x4549('0x4a')]({'where':{'id':_0x3eadac[_0x4549('0x4d')]['id']}})[_0x4549('0x25')](handleEntityNotFound(_0x314730,null))[_0x4549('0x25')](saveUpdates(_0x3eadac[_0x4549('0x4c')],null))[_0x4549('0x25')](respondWithResult(_0x314730,null))[_0x4549('0x47')](handleError(_0x314730,null));};exports['destroy']=function(_0x581089,_0xced3b){return db[_0x4549('0x2d')][_0x4549('0x4a')]({'where':{'id':_0x581089[_0x4549('0x4d')]['id']}})[_0x4549('0x25')](handleEntityNotFound(_0xced3b,null))[_0x4549('0x25')](removeEntity(_0xced3b,null))[_0x4549('0x47')](handleError(_0xced3b,null));};exports[_0x4549('0x4e')]=function(_0x5672f,_0x11ad87){return db[_0x4549('0x2d')][_0x4549('0x4e')]()[_0x4549('0x25')](respondWithResult(_0x11ad87,null))[_0x4549('0x47')](handleError(_0x11ad87,null));}; \ No newline at end of file +var _0x67df=['index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','count','Content-Range','apply','save','update','then','status','error','stack','name'];(function(_0x34a530,_0x30af52){var _0x51e097=function(_0x23b63b){while(--_0x23b63b){_0x34a530['push'](_0x34a530['shift']());}};_0x51e097(++_0x30af52);}(_0x67df,0x193));var _0xf67d=function(_0x30855b,_0x2b1436){_0x30855b=_0x30855b-0x0;var _0x341bfa=_0x67df[_0x30855b];return _0x341bfa;};'use strict';var emlformat=require(_0xf67d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf67d('0x1'));var rp=require(_0xf67d('0x2'));var moment=require(_0xf67d('0x3'));var BPromise=require(_0xf67d('0x4'));var Mustache=require(_0xf67d('0x5'));var util=require(_0xf67d('0x6'));var path=require(_0xf67d('0x7'));var sox=require(_0xf67d('0x8'));var csv=require(_0xf67d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf67d('0xa'));var _=require(_0xf67d('0xb'));var squel=require(_0xf67d('0xc'));var crypto=require(_0xf67d('0xd'));var jsforce=require(_0xf67d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf67d('0x9'));var querystring=require(_0xf67d('0xf'));var Papa=require(_0xf67d('0x10'));var Redis=require(_0xf67d('0x11'));var authService=require(_0xf67d('0x12'));var qs=require(_0xf67d('0x13'));var as=require(_0xf67d('0x14'));var hardwareService=require(_0xf67d('0x15'));var logger=require(_0xf67d('0x16'))('api');var utils=require(_0xf67d('0x17'));var config=require(_0xf67d('0x18'));var licenseUtil=require(_0xf67d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fddc2,_0xb21aa0){_0xb21aa0=_0xb21aa0||0xcc;return function(_0x3cff56){if(_0x3cff56){return _0x1fddc2[_0xf67d('0x1a')](_0xb21aa0);}return _0x1fddc2['status'](_0xb21aa0)[_0xf67d('0x1b')]();};}function respondWithResult(_0x157fc6,_0x454c29){_0x454c29=_0x454c29||0xc8;return function(_0x520460){if(_0x520460){return _0x157fc6['status'](_0x454c29)[_0xf67d('0x1c')](_0x520460);}};}function respondWithFilteredResult(_0x414471,_0x42a9f1){return function(_0x1a39f6){if(_0x1a39f6){var _0x29f57f=typeof _0x42a9f1['offset']===_0xf67d('0x1d')&&typeof _0x42a9f1[_0xf67d('0x1e')]==='undefined';var _0x33c33e=_0x1a39f6[_0xf67d('0x1f')];var _0x5bddc3=_0x29f57f?0x0:_0x42a9f1['offset'];var _0x3c20d1=_0x29f57f?_0x1a39f6[_0xf67d('0x1f')]:_0x42a9f1['offset']+_0x42a9f1[_0xf67d('0x1e')];var _0x202507;if(_0x3c20d1>=_0x33c33e){_0x3c20d1=_0x33c33e;_0x202507=0xc8;}else{_0x202507=0xce;}_0x414471['status'](_0x202507);return _0x414471['set'](_0xf67d('0x20'),_0x5bddc3+'-'+_0x3c20d1+'/'+_0x33c33e)['json'](_0x1a39f6);}return null;};}function patchUpdates(_0x5eee35){return function(_0x1c91bf){try{jsonpatch[_0xf67d('0x21')](_0x1c91bf,_0x5eee35,!![]);}catch(_0x208908){return BPromise['reject'](_0x208908);}return _0x1c91bf[_0xf67d('0x22')]();};}function saveUpdates(_0xe7e85f,_0x578979){return function(_0x3b24b6){if(_0x3b24b6){return _0x3b24b6[_0xf67d('0x23')](_0xe7e85f)[_0xf67d('0x24')](function(_0x149e78){return _0x149e78;});}return null;};}function removeEntity(_0x5ba27b,_0x12abef){return function(_0x4d3d47){if(_0x4d3d47){return _0x4d3d47['destroy']()['then'](function(){_0x5ba27b[_0xf67d('0x25')](0xcc)[_0xf67d('0x1b')]();});}};}function handleEntityNotFound(_0x2d5534,_0x5edc1c){return function(_0x5629c7){if(!_0x5629c7){_0x2d5534[_0xf67d('0x1a')](0x194);}return _0x5629c7;};}function handleError(_0x52d8e6,_0x901fd4){_0x901fd4=_0x901fd4||0x1f4;return function(_0x2bb1e0){logger[_0xf67d('0x26')](_0x2bb1e0[_0xf67d('0x27')]);if(_0x2bb1e0[_0xf67d('0x28')]){delete _0x2bb1e0[_0xf67d('0x28')];}_0x52d8e6[_0xf67d('0x25')](_0x901fd4)['send'](_0x2bb1e0);};}exports[_0xf67d('0x29')]=function(_0x30e5ed,_0x3a22d5){var _0xc33a68={},_0x1ca684={},_0x1b44ce={'count':0x0,'rows':[]};var _0x3f4b85=_[_0xf67d('0x2a')](db[_0xf67d('0x2b')][_0xf67d('0x2c')],function(_0x1c1476){return{'name':_0x1c1476[_0xf67d('0x2d')],'type':_0x1c1476[_0xf67d('0x2e')][_0xf67d('0x2f')]};});_0x1ca684[_0xf67d('0x30')]=_[_0xf67d('0x2a')](_0x3f4b85,_0xf67d('0x28'));_0x1ca684['query']=_[_0xf67d('0x31')](_0x30e5ed['query']);_0x1ca684[_0xf67d('0x32')]=_[_0xf67d('0x33')](_0x1ca684[_0xf67d('0x30')],_0x1ca684[_0xf67d('0x34')]);_0xc33a68[_0xf67d('0x35')]=_['intersection'](_0x1ca684[_0xf67d('0x30')],qs[_0xf67d('0x36')](_0x30e5ed[_0xf67d('0x34')][_0xf67d('0x36')]));_0xc33a68[_0xf67d('0x35')]=_0xc33a68[_0xf67d('0x35')][_0xf67d('0x37')]?_0xc33a68[_0xf67d('0x35')]:_0x1ca684[_0xf67d('0x30')];if(!_0x30e5ed['query']['hasOwnProperty'](_0xf67d('0x38'))){_0xc33a68['limit']=qs[_0xf67d('0x1e')](_0x30e5ed[_0xf67d('0x34')][_0xf67d('0x1e')]);_0xc33a68[_0xf67d('0x39')]=qs[_0xf67d('0x39')](_0x30e5ed[_0xf67d('0x34')][_0xf67d('0x39')]);}_0xc33a68[_0xf67d('0x3a')]=qs[_0xf67d('0x3b')](_0x30e5ed['query'][_0xf67d('0x3b')]);_0xc33a68[_0xf67d('0x3c')]=qs[_0xf67d('0x32')](_['pick'](_0x30e5ed[_0xf67d('0x34')],_0x1ca684[_0xf67d('0x32')]),_0x3f4b85);if(_0x30e5ed['query'][_0xf67d('0x3d')]){_0xc33a68[_0xf67d('0x3c')]=_[_0xf67d('0x3e')](_0xc33a68['where'],{'$or':_[_0xf67d('0x2a')](_0x3f4b85,function(_0x4ac858){if(_0x4ac858[_0xf67d('0x2e')]!==_0xf67d('0x3f')){var _0x22141b={};_0x22141b[_0x4ac858[_0xf67d('0x28')]]={'$like':'%'+_0x30e5ed[_0xf67d('0x34')][_0xf67d('0x3d')]+'%'};return _0x22141b;}})});}_0xc33a68=_['merge']({},_0xc33a68,_0x30e5ed[_0xf67d('0x40')]);var _0x227f9e={'where':_0xc33a68['where']};return db[_0xf67d('0x2b')][_0xf67d('0x1f')](_0x227f9e)[_0xf67d('0x24')](function(_0x31e78c){_0x1b44ce[_0xf67d('0x1f')]=_0x31e78c;if(_0x30e5ed[_0xf67d('0x34')][_0xf67d('0x41')]){_0xc33a68[_0xf67d('0x42')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0xc33a68);})['then'](function(_0x2aaf29){_0x1b44ce[_0xf67d('0x43')]=_0x2aaf29;return _0x1b44ce;})[_0xf67d('0x24')](respondWithFilteredResult(_0x3a22d5,_0xc33a68))[_0xf67d('0x44')](handleError(_0x3a22d5,null));};exports['show']=function(_0x46b0a9,_0x5d56c2){var _0x1f4e38={'raw':!![],'where':{'id':_0x46b0a9[_0xf67d('0x45')]['id']}},_0x36b1c2={};_0x36b1c2['model']=_[_0xf67d('0x31')](db[_0xf67d('0x2b')]['rawAttributes']);_0x36b1c2[_0xf67d('0x34')]=_[_0xf67d('0x31')](_0x46b0a9[_0xf67d('0x34')]);_0x36b1c2['filters']=_['intersection'](_0x36b1c2[_0xf67d('0x30')],_0x36b1c2[_0xf67d('0x34')]);_0x1f4e38[_0xf67d('0x35')]=_[_0xf67d('0x33')](_0x36b1c2['model'],qs[_0xf67d('0x36')](_0x46b0a9['query'][_0xf67d('0x36')]));_0x1f4e38[_0xf67d('0x35')]=_0x1f4e38[_0xf67d('0x35')][_0xf67d('0x37')]?_0x1f4e38['attributes']:_0x36b1c2['model'];if(_0x46b0a9[_0xf67d('0x34')]['includeAll']){_0x1f4e38[_0xf67d('0x42')]=[{'all':!![]}];}_0x1f4e38=_[_0xf67d('0x3e')]({},_0x1f4e38,_0x46b0a9['options']);return db[_0xf67d('0x2b')][_0xf67d('0x46')](_0x1f4e38)[_0xf67d('0x24')](handleEntityNotFound(_0x5d56c2,null))['then'](respondWithResult(_0x5d56c2,null))[_0xf67d('0x44')](handleError(_0x5d56c2,null));};exports[_0xf67d('0x47')]=function(_0x196fb1,_0x57293a){return db['OpenchannelQueueReport']['create'](_0x196fb1[_0xf67d('0x48')],{})['then'](respondWithResult(_0x57293a,0xc9))[_0xf67d('0x44')](handleError(_0x57293a,null));};exports['update']=function(_0x57239d,_0x27e16b){if(_0x57239d['body']['id']){delete _0x57239d[_0xf67d('0x48')]['id'];}return db[_0xf67d('0x2b')]['find']({'where':{'id':_0x57239d['params']['id']}})[_0xf67d('0x24')](handleEntityNotFound(_0x27e16b,null))['then'](saveUpdates(_0x57239d[_0xf67d('0x48')],null))[_0xf67d('0x24')](respondWithResult(_0x27e16b,null))[_0xf67d('0x44')](handleError(_0x27e16b,null));};exports['destroy']=function(_0x2b02bf,_0x226a4f){return db['OpenchannelQueueReport'][_0xf67d('0x46')]({'where':{'id':_0x2b02bf[_0xf67d('0x45')]['id']}})[_0xf67d('0x24')](handleEntityNotFound(_0x226a4f,null))[_0xf67d('0x24')](removeEntity(_0x226a4f,null))[_0xf67d('0x44')](handleError(_0x226a4f,null));};exports[_0xf67d('0x49')]=function(_0x853df4,_0x5b709d){return db[_0xf67d('0x2b')][_0xf67d('0x49')]()[_0xf67d('0x24')](respondWithResult(_0x5b709d,null))['catch'](handleError(_0x5b709d,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f42ac34..6bf6b11 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 _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x576be9,_0x5dd358){var _0x5b5e13=function(_0x4bd1c1){while(--_0x4bd1c1){_0x576be9['push'](_0x576be9['shift']());}};_0x5b5e13(++_0x5dd358);}(_0x2ef3,0xba));var _0x32ef=function(_0x3cf580,_0x50e65e){_0x3cf580=_0x3cf580-0x0;var _0x2ba171=_0x2ef3[_0x3cf580];return _0x2ba171;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xc582b4,_0x3eecca){var _0x386664=function(_0x4a9638){while(--_0x4a9638){_0xc582b4['push'](_0xc582b4['shift']());}};_0x386664(++_0x3eecca);}(_0xe14b,0x93));var _0xbe14=function(_0x4eed89,_0x108efd){_0x4eed89=_0x4eed89-0x0;var _0x1d6ded=_0xe14b[_0x4eed89];return _0x1d6ded;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 860c0a0..6862216 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7a0=['where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','catch','CreateOpenchannelQueueReport','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','body'];(function(_0x4fae7c,_0x3ae08e){var _0x55e350=function(_0x54bcb6){while(--_0x54bcb6){_0x4fae7c['push'](_0x4fae7c['shift']());}};_0x55e350(++_0x3ae08e);}(_0xd7a0,0x163));var _0x0d7a=function(_0x4a7d06,_0x4cbb90){_0x4a7d06=_0x4a7d06-0x0;var _0x283136=_0xd7a0[_0x4a7d06];return _0x283136;};'use strict';var _=require(_0x0d7a('0x0'));var util=require(_0x0d7a('0x1'));var moment=require('moment');var BPromise=require(_0x0d7a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d7a('0x3'));var db=require(_0x0d7a('0x4'))['db'];var utils=require(_0x0d7a('0x5'));var logger=require(_0x0d7a('0x6'))(_0x0d7a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d7a('0x8'));var client=jayson[_0x0d7a('0x9')][_0x0d7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16461e,_0x22b404,_0x371b7d){return new BPromise(function(_0x1514ae,_0x55d585){return client[_0x0d7a('0xb')](_0x16461e,_0x371b7d)[_0x0d7a('0xc')](function(_0x450d42){logger[_0x0d7a('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'));logger[_0x0d7a('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x22b404,_0x0d7a('0xe'),JSON[_0x0d7a('0x10')](_0x450d42));if(_0x450d42[_0x0d7a('0x11')]){if(_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x12')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x450d42[_0x0d7a('0x11')][_0x0d7a('0x13')]);return _0x55d585(_0x450d42[_0x0d7a('0x11')]['message']);}logger[_0x0d7a('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x22b404,_0x450d42['error'][_0x0d7a('0x13')]);return _0x1514ae(_0x450d42['error'][_0x0d7a('0x13')]);}else{logger[_0x0d7a('0xd')](_0x0d7a('0x14'),_0x22b404,_0x0d7a('0xe'));_0x1514ae(_0x450d42['result'][_0x0d7a('0x13')]);}})[_0x0d7a('0x15')](function(_0x497cbb){logger[_0x0d7a('0x11')](_0x0d7a('0x14'),_0x22b404,_0x497cbb);_0x55d585(_0x497cbb);});});}exports[_0x0d7a('0x16')]=function(_0x406b0c){var _0x5c54a6=this;return new Promise(function(_0x2180fa,_0x4cfcdc){return db['OpenchannelQueueReport']['create'](_0x406b0c['body'],{'raw':_0x406b0c[_0x0d7a('0x17')]?_0x406b0c['options'][_0x0d7a('0x18')]===undefined?!![]:![]:!![]})[_0x0d7a('0xc')](function(_0x4c997f){logger[_0x0d7a('0xd')](_0x0d7a('0x16'),_0x406b0c);logger[_0x0d7a('0xf')](_0x0d7a('0x16'),_0x406b0c,JSON['stringify'](_0x4c997f));_0x2180fa(_0x4c997f);})[_0x0d7a('0x15')](function(_0x2c11b6){logger[_0x0d7a('0x11')]('CreateOpenchannelQueueReport',_0x2c11b6['message'],_0x406b0c);_0x4cfcdc(_0x5c54a6[_0x0d7a('0x11')](0x1f4,_0x2c11b6[_0x0d7a('0x13')]));});});};exports[_0x0d7a('0x19')]=function(_0x1944ba){var _0x9c73d4=this;return new Promise(function(_0x551171,_0x14670c){return db[_0x0d7a('0x1a')][_0x0d7a('0x1b')](_0x1944ba[_0x0d7a('0x1c')],{'raw':_0x1944ba['options']?_0x1944ba['options'][_0x0d7a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba[_0x0d7a('0x17')][_0x0d7a('0x1d')]||null:null,'attributes':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba[_0x0d7a('0x17')][_0x0d7a('0x1e')]||null:null,'limit':_0x1944ba[_0x0d7a('0x17')]?_0x1944ba['options'][_0x0d7a('0x1f')]||null:null})['then'](function(_0x33ce6c){logger[_0x0d7a('0xd')](_0x0d7a('0x19'),_0x1944ba);logger[_0x0d7a('0xf')](_0x0d7a('0x19'),_0x1944ba,JSON['stringify'](_0x33ce6c));_0x551171(_0x33ce6c);})[_0x0d7a('0x15')](function(_0xfc200a){logger[_0x0d7a('0x11')]('UpdateOpenchannelQueueReport',_0xfc200a[_0x0d7a('0x13')],_0x1944ba);_0x14670c(_0x9c73d4[_0x0d7a('0x11')](0x1f4,_0xfc200a['message']));});});}; \ No newline at end of file +var _0x1a37=['error','message','catch','CreateOpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d3906,_0x12c2b1){var _0x175d32=function(_0xc3a202){while(--_0xc3a202){_0x3d3906['push'](_0x3d3906['shift']());}};_0x175d32(++_0x12c2b1);}(_0x1a37,0xb4));var _0x71a3=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x1a37[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['OpenchannelQueueReport'][_0x71a3('0x16')](_0x5d4dee[_0x71a3('0x17')],{'raw':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1ab947){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON['stringify'](_0x1ab947));_0x27bfb4(_0x1ab947);})[_0x71a3('0x14')](function(_0x5bbaee){logger[_0x71a3('0x12')](_0x71a3('0x15'),_0x5bbaee[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2[_0x71a3('0x12')](0x1f4,_0x5bbaee[_0x71a3('0x13')]));});});};exports[_0x71a3('0x1a')]=function(_0x5f33c5){var _0x26e6e7=this;return new Promise(function(_0x299d1d,_0xb9c195){return db[_0x71a3('0x1b')][_0x71a3('0x1c')](_0x5f33c5['body'],{'raw':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5['options'][_0x71a3('0x1d')]||null:null,'attributes':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')][_0x71a3('0x1e')]||null:null,'limit':_0x5f33c5[_0x71a3('0x18')]?_0x5f33c5[_0x71a3('0x18')][_0x71a3('0x1f')]||null:null})[_0x71a3('0x20')](function(_0x305eb1){logger[_0x71a3('0xc')](_0x71a3('0x1a'),_0x5f33c5);logger[_0x71a3('0xf')]('UpdateOpenchannelQueueReport',_0x5f33c5,JSON[_0x71a3('0x11')](_0x305eb1));_0x299d1d(_0x305eb1);})[_0x71a3('0x14')](function(_0x334db0){logger[_0x71a3('0x12')]('UpdateOpenchannelQueueReport',_0x334db0[_0x71a3('0x13')],_0x5f33c5);_0xb9c195(_0x26e6e7[_0x71a3('0x12')](0x1f4,_0x334db0[_0x71a3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 30bfa3a..8ee008f 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 _0x2c98=['../../config/environment','./openchannelTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x216b45,_0x2e47d9){var _0x589b66=function(_0x275cbd){while(--_0x275cbd){_0x216b45['push'](_0x216b45['shift']());}};_0x589b66(++_0x2e47d9);}(_0x2c98,0xb0));var _0x82c9=function(_0x1eca81,_0x586160){_0x1eca81=_0x1eca81-0x0;var _0x353020=_0x2c98[_0x1eca81];return _0x353020;};'use strict';var multer=require('multer');var util=require(_0x82c9('0x0'));var path=require(_0x82c9('0x1'));var timeout=require(_0x82c9('0x2'));var express=require(_0x82c9('0x3'));var router=express[_0x82c9('0x4')]();var fs_extra=require(_0x82c9('0x5'));var auth=require(_0x82c9('0x6'));var interaction=require(_0x82c9('0x7'));var config=require(_0x82c9('0x8'));var controller=require(_0x82c9('0x9'));router[_0x82c9('0xa')]('/',auth['isAuthenticated'](),controller[_0x82c9('0xb')]);router[_0x82c9('0xa')](_0x82c9('0xc'),auth['isAuthenticated'](),controller[_0x82c9('0xd')]);router[_0x82c9('0xa')]('/:id',auth[_0x82c9('0xe')](),controller[_0x82c9('0xf')]);router[_0x82c9('0x10')]('/',auth['isAuthenticated'](),controller[_0x82c9('0x11')]);router[_0x82c9('0x12')]('/:id',auth[_0x82c9('0xe')](),controller[_0x82c9('0x13')]);router[_0x82c9('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x82c9('0x15')]);module[_0x82c9('0x16')]=router; \ No newline at end of file +var _0x871a=['destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x871a,0x152));var _0xa871=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x871a[_0x24875d];return _0x181471;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa871('0x0'));var express=require(_0xa871('0x1'));var router=express[_0xa871('0x2')]();var fs_extra=require(_0xa871('0x3'));var auth=require(_0xa871('0x4'));var interaction=require(_0xa871('0x5'));var config=require(_0xa871('0x6'));var controller=require(_0xa871('0x7'));router[_0xa871('0x8')]('/',auth[_0xa871('0x9')](),controller[_0xa871('0xa')]);router[_0xa871('0x8')]('/describe',auth[_0xa871('0x9')](),controller[_0xa871('0xb')]);router[_0xa871('0x8')](_0xa871('0xc'),auth[_0xa871('0x9')](),controller[_0xa871('0xd')]);router[_0xa871('0xe')]('/',auth[_0xa871('0x9')](),controller[_0xa871('0xf')]);router[_0xa871('0x10')](_0xa871('0xc'),auth[_0xa871('0x9')](),controller[_0xa871('0x11')]);router[_0xa871('0x12')](_0xa871('0xc'),auth['isAuthenticated'](),controller[_0xa871('0x13')]);module[_0xa871('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index baed225..43f1d6b 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x376705,_0x5d69bf){var _0x66fd62=function(_0x559a3d){while(--_0x559a3d){_0x376705['push'](_0x376705['shift']());}};_0x66fd62(++_0x5d69bf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'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(_0x32b3cb,_0x3d41aa){var _0x3c8f7c=function(_0x2bf4b1){while(--_0x2bf4b1){_0x32b3cb['push'](_0x32b3cb['shift']());}};_0x3c8f7c(++_0x3d41aa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xcb91[_0x903228];return _0xcec81d;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 9ac0c14..cd0a256 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 _0x18bd=['end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','name','send','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','params','keys','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x379b8a,_0x29848f){var _0x19266a=function(_0x1aa8b8){while(--_0x1aa8b8){_0x379b8a['push'](_0x379b8a['shift']());}};_0x19266a(++_0x29848f);}(_0x18bd,0x1f3));var _0xd18b=function(_0x542df3,_0x22df83){_0x542df3=_0x542df3-0x0;var _0x14ba9a=_0x18bd[_0x542df3];return _0x14ba9a;};'use strict';var emlformat=require(_0xd18b('0x0'));var rimraf=require(_0xd18b('0x1'));var zipdir=require(_0xd18b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd18b('0x3'));var moment=require(_0xd18b('0x4'));var BPromise=require(_0xd18b('0x5'));var Mustache=require(_0xd18b('0x6'));var util=require(_0xd18b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd18b('0x8'));var ejs=require(_0xd18b('0x9'));var fs=require('fs');var fs_extra=require(_0xd18b('0xa'));var _=require(_0xd18b('0xb'));var squel=require(_0xd18b('0xc'));var crypto=require(_0xd18b('0xd'));var jsforce=require(_0xd18b('0xe'));var deskjs=require(_0xd18b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd18b('0x10'));var Papa=require('papaparse');var Redis=require(_0xd18b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd18b('0x12'));var as=require(_0xd18b('0x13'));var hardwareService=require(_0xd18b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd18b('0x15'));var config=require(_0xd18b('0x16'));var licenseUtil=require(_0xd18b('0x17'));var db=require(_0xd18b('0x18'))['db'];function respondWithStatusCode(_0xa8fd91,_0x428aa1){_0x428aa1=_0x428aa1||0xcc;return function(_0x57aba7){if(_0x57aba7){return _0xa8fd91['sendStatus'](_0x428aa1);}return _0xa8fd91[_0xd18b('0x19')](_0x428aa1)[_0xd18b('0x1a')]();};}function respondWithResult(_0x63ca,_0xca8642){_0xca8642=_0xca8642||0xc8;return function(_0x256ce3){if(_0x256ce3){return _0x63ca[_0xd18b('0x19')](_0xca8642)[_0xd18b('0x1b')](_0x256ce3);}};}function respondWithFilteredResult(_0x5e3724,_0x4eb471){return function(_0x55445e){if(_0x55445e){var _0x5d0257=typeof _0x4eb471[_0xd18b('0x1c')]===_0xd18b('0x1d')&&typeof _0x4eb471[_0xd18b('0x1e')]===_0xd18b('0x1d');var _0x402da5=_0x55445e['count'];var _0xa889f2=_0x5d0257?0x0:_0x4eb471[_0xd18b('0x1c')];var _0x1b9672=_0x5d0257?_0x55445e['count']:_0x4eb471[_0xd18b('0x1c')]+_0x4eb471['limit'];var _0x1b52f0;if(_0x1b9672>=_0x402da5){_0x1b9672=_0x402da5;_0x1b52f0=0xc8;}else{_0x1b52f0=0xce;}_0x5e3724[_0xd18b('0x19')](_0x1b52f0);return _0x5e3724[_0xd18b('0x1f')](_0xd18b('0x20'),_0xa889f2+'-'+_0x1b9672+'/'+_0x402da5)[_0xd18b('0x1b')](_0x55445e);}return null;};}function patchUpdates(_0x48ec45){return function(_0x4da576){try{jsonpatch[_0xd18b('0x21')](_0x4da576,_0x48ec45,!![]);}catch(_0x5d5bbb){return BPromise[_0xd18b('0x22')](_0x5d5bbb);}return _0x4da576[_0xd18b('0x23')]();};}function saveUpdates(_0x19c90d,_0x144cc5){return function(_0x5b13bc){if(_0x5b13bc){return _0x5b13bc[_0xd18b('0x24')](_0x19c90d)[_0xd18b('0x25')](function(_0x3ee2d1){return _0x3ee2d1;});}return null;};}function removeEntity(_0x14514e,_0x2d5bfc){return function(_0x438945){if(_0x438945){return _0x438945['destroy']()[_0xd18b('0x25')](function(){_0x14514e[_0xd18b('0x19')](0xcc)[_0xd18b('0x1a')]();});}};}function handleEntityNotFound(_0x528b86,_0x2b8adb){return function(_0xbb442){if(!_0xbb442){_0x528b86['sendStatus'](0x194);}return _0xbb442;};}function handleError(_0x1d7b09,_0x4dbc27){_0x4dbc27=_0x4dbc27||0x1f4;return function(_0x5073ea){logger['error'](_0x5073ea['stack']);if(_0x5073ea[_0xd18b('0x26')]){delete _0x5073ea['name'];}_0x1d7b09[_0xd18b('0x19')](_0x4dbc27)[_0xd18b('0x27')](_0x5073ea);};}exports['index']=function(_0x352a6,_0x5d3e20){var _0x3df6ab={},_0x4caa0e={},_0x42440f={'count':0x0,'rows':[]};var _0x1ba63f=_['map'](db[_0xd18b('0x28')][_0xd18b('0x29')],function(_0x273e6a){return{'name':_0x273e6a[_0xd18b('0x2a')],'type':_0x273e6a[_0xd18b('0x2b')][_0xd18b('0x2c')]};});_0x4caa0e[_0xd18b('0x2d')]=_[_0xd18b('0x2e')](_0x1ba63f,_0xd18b('0x26'));_0x4caa0e[_0xd18b('0x2f')]=_['keys'](_0x352a6['query']);_0x4caa0e['filters']=_[_0xd18b('0x30')](_0x4caa0e[_0xd18b('0x2d')],_0x4caa0e[_0xd18b('0x2f')]);_0x3df6ab[_0xd18b('0x31')]=_['intersection'](_0x4caa0e[_0xd18b('0x2d')],qs[_0xd18b('0x32')](_0x352a6[_0xd18b('0x2f')][_0xd18b('0x32')]));_0x3df6ab['attributes']=_0x3df6ab[_0xd18b('0x31')][_0xd18b('0x33')]?_0x3df6ab[_0xd18b('0x31')]:_0x4caa0e[_0xd18b('0x2d')];if(!_0x352a6[_0xd18b('0x2f')][_0xd18b('0x34')](_0xd18b('0x35'))){_0x3df6ab[_0xd18b('0x1e')]=qs[_0xd18b('0x1e')](_0x352a6[_0xd18b('0x2f')][_0xd18b('0x1e')]);_0x3df6ab[_0xd18b('0x1c')]=qs['offset'](_0x352a6[_0xd18b('0x2f')][_0xd18b('0x1c')]);}_0x3df6ab[_0xd18b('0x36')]=qs[_0xd18b('0x37')](_0x352a6[_0xd18b('0x2f')][_0xd18b('0x37')]);_0x3df6ab[_0xd18b('0x38')]=qs[_0xd18b('0x39')](_[_0xd18b('0x3a')](_0x352a6[_0xd18b('0x2f')],_0x4caa0e[_0xd18b('0x39')]),_0x1ba63f);if(_0x352a6[_0xd18b('0x2f')][_0xd18b('0x3b')]){_0x3df6ab[_0xd18b('0x38')]=_[_0xd18b('0x3c')](_0x3df6ab['where'],{'$or':_[_0xd18b('0x2e')](_0x1ba63f,function(_0x1516de){if(_0x1516de[_0xd18b('0x2b')]!=='VIRTUAL'){var _0x1bf82b={};_0x1bf82b[_0x1516de[_0xd18b('0x26')]]={'$like':'%'+_0x352a6[_0xd18b('0x2f')][_0xd18b('0x3b')]+'%'};return _0x1bf82b;}})});}_0x3df6ab=_['merge']({},_0x3df6ab,_0x352a6[_0xd18b('0x3d')]);var _0x5e46a1={'where':_0x3df6ab['where']};return db[_0xd18b('0x28')][_0xd18b('0x3e')](_0x5e46a1)[_0xd18b('0x25')](function(_0x2cd7d0){_0x42440f[_0xd18b('0x3e')]=_0x2cd7d0;if(_0x352a6['query'][_0xd18b('0x3f')]){_0x3df6ab[_0xd18b('0x40')]=[{'all':!![]}];}return db[_0xd18b('0x28')][_0xd18b('0x41')](_0x3df6ab);})[_0xd18b('0x25')](function(_0x4f547a){_0x42440f[_0xd18b('0x42')]=_0x4f547a;return _0x42440f;})[_0xd18b('0x25')](respondWithFilteredResult(_0x5d3e20,_0x3df6ab))['catch'](handleError(_0x5d3e20,null));};exports['show']=function(_0x2b09d5,_0x31a524){var _0x1fc937={'raw':!![],'where':{'id':_0x2b09d5[_0xd18b('0x43')]['id']}},_0x4fbcdf={};_0x4fbcdf[_0xd18b('0x2d')]=_[_0xd18b('0x44')](db[_0xd18b('0x28')][_0xd18b('0x29')]);_0x4fbcdf[_0xd18b('0x2f')]=_['keys'](_0x2b09d5['query']);_0x4fbcdf['filters']=_[_0xd18b('0x30')](_0x4fbcdf[_0xd18b('0x2d')],_0x4fbcdf[_0xd18b('0x2f')]);_0x1fc937[_0xd18b('0x31')]=_[_0xd18b('0x30')](_0x4fbcdf['model'],qs['fields'](_0x2b09d5[_0xd18b('0x2f')]['fields']));_0x1fc937[_0xd18b('0x31')]=_0x1fc937[_0xd18b('0x31')][_0xd18b('0x33')]?_0x1fc937[_0xd18b('0x31')]:_0x4fbcdf[_0xd18b('0x2d')];if(_0x2b09d5[_0xd18b('0x2f')][_0xd18b('0x3f')]){_0x1fc937['include']=[{'all':!![]}];}_0x1fc937=_[_0xd18b('0x3c')]({},_0x1fc937,_0x2b09d5[_0xd18b('0x3d')]);return db[_0xd18b('0x28')][_0xd18b('0x45')](_0x1fc937)[_0xd18b('0x25')](handleEntityNotFound(_0x31a524,null))[_0xd18b('0x25')](respondWithResult(_0x31a524,null))['catch'](handleError(_0x31a524,null));};exports[_0xd18b('0x46')]=function(_0x5e2750,_0x377236){return db[_0xd18b('0x28')][_0xd18b('0x46')](_0x5e2750[_0xd18b('0x47')],{})[_0xd18b('0x25')](respondWithResult(_0x377236,0xc9))[_0xd18b('0x48')](handleError(_0x377236,null));};exports[_0xd18b('0x24')]=function(_0x17d4d0,_0x4b47da){if(_0x17d4d0[_0xd18b('0x47')]['id']){delete _0x17d4d0[_0xd18b('0x47')]['id'];}return db['OpenchannelTransferReport'][_0xd18b('0x45')]({'where':{'id':_0x17d4d0[_0xd18b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b47da,null))[_0xd18b('0x25')](saveUpdates(_0x17d4d0[_0xd18b('0x47')],null))[_0xd18b('0x25')](respondWithResult(_0x4b47da,null))['catch'](handleError(_0x4b47da,null));};exports[_0xd18b('0x49')]=function(_0x120411,_0x379317){return db[_0xd18b('0x28')][_0xd18b('0x45')]({'where':{'id':_0x120411[_0xd18b('0x43')]['id']}})['then'](handleEntityNotFound(_0x379317,null))[_0xd18b('0x25')](removeEntity(_0x379317,null))['catch'](handleError(_0x379317,null));};exports[_0xd18b('0x4a')]=function(_0x15302d,_0x143bab){return db[_0xd18b('0x28')][_0xd18b('0x4a')]()['then'](respondWithResult(_0x143bab,null))[_0xd18b('0x48')](handleError(_0x143bab,null));}; \ No newline at end of file +var _0x2cc7=['set','save','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','fields','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x1623f4,_0x33c897){var _0x52e5cd=function(_0x4dd166){while(--_0x4dd166){_0x1623f4['push'](_0x1623f4['shift']());}};_0x52e5cd(++_0x33c897);}(_0x2cc7,0x70));var _0x72cc=function(_0x1b5171,_0x2cd6e3){_0x1b5171=_0x1b5171-0x0;var _0x2d099f=_0x2cc7[_0x1b5171];return _0x2d099f;};'use strict';var emlformat=require(_0x72cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72cc('0x1'));var jsonpatch=require(_0x72cc('0x2'));var rp=require(_0x72cc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x72cc('0x4'));var util=require(_0x72cc('0x5'));var path=require(_0x72cc('0x6'));var sox=require(_0x72cc('0x7'));var csv=require(_0x72cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72cc('0x9'));var squel=require(_0x72cc('0xa'));var crypto=require(_0x72cc('0xb'));var jsforce=require(_0x72cc('0xc'));var deskjs=require(_0x72cc('0xd'));var toCsv=require(_0x72cc('0x8'));var querystring=require(_0x72cc('0xe'));var Papa=require(_0x72cc('0xf'));var Redis=require('ioredis');var authService=require(_0x72cc('0x10'));var qs=require(_0x72cc('0x11'));var as=require(_0x72cc('0x12'));var hardwareService=require(_0x72cc('0x13'));var logger=require(_0x72cc('0x14'))('api');var utils=require(_0x72cc('0x15'));var config=require(_0x72cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x72cc('0x17'))['db'];function respondWithStatusCode(_0x1c4719,_0x16f3ac){_0x16f3ac=_0x16f3ac||0xcc;return function(_0x295ccc){if(_0x295ccc){return _0x1c4719[_0x72cc('0x18')](_0x16f3ac);}return _0x1c4719[_0x72cc('0x19')](_0x16f3ac)[_0x72cc('0x1a')]();};}function respondWithResult(_0x387c4d,_0x5dd7c1){_0x5dd7c1=_0x5dd7c1||0xc8;return function(_0x5edbe1){if(_0x5edbe1){return _0x387c4d[_0x72cc('0x19')](_0x5dd7c1)[_0x72cc('0x1b')](_0x5edbe1);}};}function respondWithFilteredResult(_0x580eac,_0xa351ce){return function(_0x530864){if(_0x530864){var _0x3dc902=typeof _0xa351ce[_0x72cc('0x1c')]===_0x72cc('0x1d')&&typeof _0xa351ce[_0x72cc('0x1e')]==='undefined';var _0x5127d2=_0x530864[_0x72cc('0x1f')];var _0x29faa2=_0x3dc902?0x0:_0xa351ce[_0x72cc('0x1c')];var _0x3b0a04=_0x3dc902?_0x530864[_0x72cc('0x1f')]:_0xa351ce[_0x72cc('0x1c')]+_0xa351ce[_0x72cc('0x1e')];var _0x1b1df8;if(_0x3b0a04>=_0x5127d2){_0x3b0a04=_0x5127d2;_0x1b1df8=0xc8;}else{_0x1b1df8=0xce;}_0x580eac[_0x72cc('0x19')](_0x1b1df8);return _0x580eac[_0x72cc('0x20')]('Content-Range',_0x29faa2+'-'+_0x3b0a04+'/'+_0x5127d2)[_0x72cc('0x1b')](_0x530864);}return null;};}function patchUpdates(_0x346b81){return function(_0x1c28b2){try{jsonpatch['apply'](_0x1c28b2,_0x346b81,!![]);}catch(_0x43520b){return BPromise['reject'](_0x43520b);}return _0x1c28b2[_0x72cc('0x21')]();};}function saveUpdates(_0x21f1e5,_0x22227e){return function(_0x361d3f){if(_0x361d3f){return _0x361d3f['update'](_0x21f1e5)[_0x72cc('0x22')](function(_0x3ec9f5){return _0x3ec9f5;});}return null;};}function removeEntity(_0x497baa,_0x16a076){return function(_0x436985){if(_0x436985){return _0x436985['destroy']()['then'](function(){_0x497baa[_0x72cc('0x19')](0xcc)[_0x72cc('0x1a')]();});}};}function handleEntityNotFound(_0x2654a0,_0x4cc70c){return function(_0x41d453){if(!_0x41d453){_0x2654a0[_0x72cc('0x18')](0x194);}return _0x41d453;};}function handleError(_0x213e64,_0xa4313b){_0xa4313b=_0xa4313b||0x1f4;return function(_0x1b5dfb){logger[_0x72cc('0x23')](_0x1b5dfb[_0x72cc('0x24')]);if(_0x1b5dfb[_0x72cc('0x25')]){delete _0x1b5dfb[_0x72cc('0x25')];}_0x213e64[_0x72cc('0x19')](_0xa4313b)[_0x72cc('0x26')](_0x1b5dfb);};}exports[_0x72cc('0x27')]=function(_0x124811,_0x6412fb){var _0x1fcd9c={},_0x5494bf={},_0x17c301={'count':0x0,'rows':[]};var _0x1e65a5=_[_0x72cc('0x28')](db[_0x72cc('0x29')][_0x72cc('0x2a')],function(_0x2a9c9b){return{'name':_0x2a9c9b['fieldName'],'type':_0x2a9c9b[_0x72cc('0x2b')][_0x72cc('0x2c')]};});_0x5494bf[_0x72cc('0x2d')]=_[_0x72cc('0x28')](_0x1e65a5,_0x72cc('0x25'));_0x5494bf[_0x72cc('0x2e')]=_[_0x72cc('0x2f')](_0x124811[_0x72cc('0x2e')]);_0x5494bf['filters']=_[_0x72cc('0x30')](_0x5494bf[_0x72cc('0x2d')],_0x5494bf[_0x72cc('0x2e')]);_0x1fcd9c['attributes']=_['intersection'](_0x5494bf[_0x72cc('0x2d')],qs['fields'](_0x124811[_0x72cc('0x2e')]['fields']));_0x1fcd9c[_0x72cc('0x31')]=_0x1fcd9c[_0x72cc('0x31')][_0x72cc('0x32')]?_0x1fcd9c['attributes']:_0x5494bf[_0x72cc('0x2d')];if(!_0x124811[_0x72cc('0x2e')][_0x72cc('0x33')](_0x72cc('0x34'))){_0x1fcd9c[_0x72cc('0x1e')]=qs[_0x72cc('0x1e')](_0x124811[_0x72cc('0x2e')]['limit']);_0x1fcd9c['offset']=qs[_0x72cc('0x1c')](_0x124811[_0x72cc('0x2e')][_0x72cc('0x1c')]);}_0x1fcd9c['order']=qs['sort'](_0x124811['query']['sort']);_0x1fcd9c[_0x72cc('0x35')]=qs[_0x72cc('0x36')](_[_0x72cc('0x37')](_0x124811['query'],_0x5494bf[_0x72cc('0x36')]),_0x1e65a5);if(_0x124811[_0x72cc('0x2e')][_0x72cc('0x38')]){_0x1fcd9c[_0x72cc('0x35')]=_[_0x72cc('0x39')](_0x1fcd9c['where'],{'$or':_[_0x72cc('0x28')](_0x1e65a5,function(_0x4c72b5){if(_0x4c72b5[_0x72cc('0x2b')]!==_0x72cc('0x3a')){var _0x3a2ba8={};_0x3a2ba8[_0x4c72b5[_0x72cc('0x25')]]={'$like':'%'+_0x124811['query']['filter']+'%'};return _0x3a2ba8;}})});}_0x1fcd9c=_['merge']({},_0x1fcd9c,_0x124811[_0x72cc('0x3b')]);var _0x8c12b5={'where':_0x1fcd9c[_0x72cc('0x35')]};return db[_0x72cc('0x29')][_0x72cc('0x1f')](_0x8c12b5)[_0x72cc('0x22')](function(_0x17198c){_0x17c301[_0x72cc('0x1f')]=_0x17198c;if(_0x124811[_0x72cc('0x2e')][_0x72cc('0x3c')]){_0x1fcd9c['include']=[{'all':!![]}];}return db[_0x72cc('0x29')][_0x72cc('0x3d')](_0x1fcd9c);})[_0x72cc('0x22')](function(_0x4d4d66){_0x17c301[_0x72cc('0x3e')]=_0x4d4d66;return _0x17c301;})['then'](respondWithFilteredResult(_0x6412fb,_0x1fcd9c))[_0x72cc('0x3f')](handleError(_0x6412fb,null));};exports['show']=function(_0x2ff385,_0x4bb002){var _0x4a0572={'raw':!![],'where':{'id':_0x2ff385[_0x72cc('0x40')]['id']}},_0x187840={};_0x187840[_0x72cc('0x2d')]=_[_0x72cc('0x2f')](db[_0x72cc('0x29')][_0x72cc('0x2a')]);_0x187840['query']=_[_0x72cc('0x2f')](_0x2ff385[_0x72cc('0x2e')]);_0x187840[_0x72cc('0x36')]=_['intersection'](_0x187840[_0x72cc('0x2d')],_0x187840[_0x72cc('0x2e')]);_0x4a0572[_0x72cc('0x31')]=_[_0x72cc('0x30')](_0x187840[_0x72cc('0x2d')],qs[_0x72cc('0x41')](_0x2ff385[_0x72cc('0x2e')][_0x72cc('0x41')]));_0x4a0572[_0x72cc('0x31')]=_0x4a0572[_0x72cc('0x31')][_0x72cc('0x32')]?_0x4a0572[_0x72cc('0x31')]:_0x187840[_0x72cc('0x2d')];if(_0x2ff385['query'][_0x72cc('0x3c')]){_0x4a0572['include']=[{'all':!![]}];}_0x4a0572=_[_0x72cc('0x39')]({},_0x4a0572,_0x2ff385[_0x72cc('0x3b')]);return db[_0x72cc('0x29')][_0x72cc('0x42')](_0x4a0572)[_0x72cc('0x22')](handleEntityNotFound(_0x4bb002,null))[_0x72cc('0x22')](respondWithResult(_0x4bb002,null))['catch'](handleError(_0x4bb002,null));};exports['create']=function(_0x5aa1ba,_0x4d7e7c){return db[_0x72cc('0x29')][_0x72cc('0x43')](_0x5aa1ba[_0x72cc('0x44')],{})[_0x72cc('0x22')](respondWithResult(_0x4d7e7c,0xc9))[_0x72cc('0x3f')](handleError(_0x4d7e7c,null));};exports[_0x72cc('0x45')]=function(_0x3b1e0c,_0xb68da4){if(_0x3b1e0c[_0x72cc('0x44')]['id']){delete _0x3b1e0c['body']['id'];}return db[_0x72cc('0x29')]['find']({'where':{'id':_0x3b1e0c[_0x72cc('0x40')]['id']}})[_0x72cc('0x22')](handleEntityNotFound(_0xb68da4,null))[_0x72cc('0x22')](saveUpdates(_0x3b1e0c['body'],null))[_0x72cc('0x22')](respondWithResult(_0xb68da4,null))[_0x72cc('0x3f')](handleError(_0xb68da4,null));};exports[_0x72cc('0x46')]=function(_0x54f504,_0x50fe8e){return db[_0x72cc('0x29')][_0x72cc('0x42')]({'where':{'id':_0x54f504[_0x72cc('0x40')]['id']}})[_0x72cc('0x22')](handleEntityNotFound(_0x50fe8e,null))['then'](removeEntity(_0x50fe8e,null))['catch'](handleError(_0x50fe8e,null));};exports['describe']=function(_0xfeba43,_0x16ab13){return db[_0x72cc('0x29')][_0x72cc('0x47')]()[_0x72cc('0x22')](respondWithResult(_0x16ab13,null))[_0x72cc('0x3f')](handleError(_0x16ab13,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 4ff59be..8e35a24 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 _0x8877=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x12728d,_0x32395e){var _0x15a6d3=function(_0x26d030){while(--_0x26d030){_0x12728d['push'](_0x12728d['shift']());}};_0x15a6d3(++_0x32395e);}(_0x8877,0x179));var _0x7887=function(_0xf3668b,_0x17bf5d){_0xf3668b=_0xf3668b-0x0;var _0x1007d2=_0x8877[_0xf3668b];return _0x1007d2;};'use strict';var _=require(_0x7887('0x0'));var util=require('util');var logger=require(_0x7887('0x1'))(_0x7887('0x2'));var moment=require(_0x7887('0x3'));var BPromise=require('bluebird');var rp=require(_0x7887('0x4'));var fs=require('fs');var path=require(_0x7887('0x5'));var rimraf=require(_0x7887('0x6'));var config=require(_0x7887('0x7'));var attributes=require(_0x7887('0x8'));module[_0x7887('0x9')]=function(_0x3069dd,_0x286f7a){return _0x3069dd['define'](_0x7887('0xa'),attributes,{'tableName':_0x7887('0xb'),'paranoid':![],'indexes':[{'name':_0x7887('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdf68=['report_openchannel_transfer','uniqueid','moment','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport'];(function(_0x573325,_0x2f2fa5){var _0x1987bb=function(_0x2dfffa){while(--_0x2dfffa){_0x573325['push'](_0x573325['shift']());}};_0x1987bb(++_0x2f2fa5);}(_0xdf68,0x106));var _0x8df6=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xdf68[_0x2fb87c];return _0x43038b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8df6('0x0'));var BPromise=require('bluebird');var rp=require(_0x8df6('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8df6('0x2'));var config=require(_0x8df6('0x3'));var attributes=require(_0x8df6('0x4'));module[_0x8df6('0x5')]=function(_0x34af0d,_0x37f6df){return _0x34af0d[_0x8df6('0x6')](_0x8df6('0x7'),attributes,{'tableName':_0x8df6('0x8'),'paranoid':![],'indexes':[{'name':_0x8df6('0x9'),'fields':[_0x8df6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d435a8a..6bfa9c4 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 _0xcb66=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x32f2b5,_0x3e7573){var _0x4acddb=function(_0x2358bb){while(--_0x2358bb){_0x32f2b5['push'](_0x32f2b5['shift']());}};_0x4acddb(++_0x3e7573);}(_0xcb66,0x19f));var _0x6cb6=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xcb66[_0x20845e];return _0x28cf2b;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var moment=require(_0x6cb6('0x1'));var BPromise=require(_0x6cb6('0x2'));var rs=require(_0x6cb6('0x3'));var fs=require('fs');var Redis=require(_0x6cb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cb6('0x5'));var logger=require(_0x6cb6('0x6'))(_0x6cb6('0x7'));var config=require(_0x6cb6('0x8'));var jayson=require(_0x6cb6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x174f39,_0x1595c9,_0x1028b3){return new BPromise(function(_0x4145f2,_0x1d0ee9){return client[_0x6cb6('0xa')](_0x174f39,_0x1028b3)[_0x6cb6('0xb')](function(_0x2b8e56){logger[_0x6cb6('0xc')](_0x6cb6('0xd'),_0x1595c9,_0x6cb6('0xe'));logger[_0x6cb6('0xf')](_0x6cb6('0x10'),_0x1595c9,'request\x20sent',JSON['stringify'](_0x2b8e56));if(_0x2b8e56['error']){if(_0x2b8e56['error'][_0x6cb6('0x11')]===0x1f4){logger[_0x6cb6('0x12')](_0x6cb6('0xd'),_0x1595c9,_0x2b8e56[_0x6cb6('0x12')]['message']);return _0x1d0ee9(_0x2b8e56[_0x6cb6('0x12')][_0x6cb6('0x13')]);}logger['error'](_0x6cb6('0xd'),_0x1595c9,_0x2b8e56[_0x6cb6('0x12')]['message']);return _0x4145f2(_0x2b8e56[_0x6cb6('0x12')][_0x6cb6('0x13')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1595c9,'request\x20sent');_0x4145f2(_0x2b8e56['result'][_0x6cb6('0x13')]);}})[_0x6cb6('0x14')](function(_0x9c901a){logger[_0x6cb6('0x12')](_0x6cb6('0xd'),_0x1595c9,_0x9c901a);_0x1d0ee9(_0x9c901a);});});} \ No newline at end of file +var _0x9c5a=['http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xa343c1,_0x2f18b6){var _0x135c86=function(_0x4afa94){while(--_0x4afa94){_0xa343c1['push'](_0xa343c1['shift']());}};_0x135c86(++_0x2f18b6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xff6233,_0x340fc3){_0xff6233=_0xff6233-0x0;var _0x2699a7=_0x9c5a[_0xff6233];return _0x2699a7;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var moment=require('moment');var BPromise=require(_0xa9c5('0x2'));var rs=require(_0xa9c5('0x3'));var fs=require('fs');var Redis=require(_0xa9c5('0x4'));var db=require(_0xa9c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa9c5('0x6'))(_0xa9c5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa9c5('0x8'));var client=jayson['client'][_0xa9c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3df556,_0x4cb597,_0x4b6db6){return new BPromise(function(_0x3d6b50,_0x16f331){return client['request'](_0x3df556,_0x4b6db6)[_0xa9c5('0xa')](function(_0x97f9e2){logger['info'](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x4cb597,_0xa9c5('0xc'),JSON[_0xa9c5('0xd')](_0x97f9e2));if(_0x97f9e2[_0xa9c5('0xe')]){if(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0xf')]===0x1f4){logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x16f331(_0x97f9e2[_0xa9c5('0xe')]['message']);}logger[_0xa9c5('0xe')](_0xa9c5('0xb'),_0x4cb597,_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);return _0x3d6b50(_0x97f9e2[_0xa9c5('0xe')][_0xa9c5('0x10')]);}else{logger[_0xa9c5('0x11')](_0xa9c5('0xb'),_0x4cb597,_0xa9c5('0xc'));_0x3d6b50(_0x97f9e2[_0xa9c5('0x12')]['message']);}})[_0xa9c5('0x13')](function(_0xd85c32){logger[_0xa9c5('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4cb597,_0xd85c32);_0x16f331(_0xd85c32);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1679b47..2d73fd9 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 _0xd423=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','multer','util'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xd423,0x7c));var _0x3d42=function(_0x23288c,_0x7bcfcd){_0x23288c=_0x23288c-0x0;var _0x1305a6=_0xd423[_0x23288c];return _0x1305a6;};'use strict';var multer=require(_0x3d42('0x0'));var util=require(_0x3d42('0x1'));var path=require(_0x3d42('0x2'));var timeout=require(_0x3d42('0x3'));var express=require(_0x3d42('0x4'));var router=express[_0x3d42('0x5')]();var fs_extra=require(_0x3d42('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d42('0x7'));var config=require(_0x3d42('0x8'));var controller=require(_0x3d42('0x9'));router[_0x3d42('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3d42('0xa')](_0x3d42('0xb'),auth[_0x3d42('0xc')](),controller[_0x3d42('0xd')]);router[_0x3d42('0xe')]('/',auth[_0x3d42('0xc')](),controller['create']);router[_0x3d42('0xf')]('/:id',auth[_0x3d42('0xc')](),controller['update']);router[_0x3d42('0x10')](_0x3d42('0xb'),auth[_0x3d42('0xc')](),controller[_0x3d42('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6504=['isAuthenticated','index','get','/:id','show','create','put','destroy','exports','path','../../components/auth/service','./pause.controller'];(function(_0x346681,_0x53ba33){var _0x5e20cb=function(_0x2644c1){while(--_0x2644c1){_0x346681['push'](_0x346681['shift']());}};_0x5e20cb(++_0x53ba33);}(_0x6504,0xe1));var _0x4650=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6504[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4650('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4650('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4650('0x2'));router['get']('/',auth[_0x4650('0x3')](),controller[_0x4650('0x4')]);router[_0x4650('0x5')](_0x4650('0x6'),auth[_0x4650('0x3')](),controller[_0x4650('0x7')]);router['post']('/',auth[_0x4650('0x3')](),controller[_0x4650('0x8')]);router[_0x4650('0x9')]('/:id',auth[_0x4650('0x3')](),controller['update']);router['delete']('/:id',auth[_0x4650('0x3')](),controller[_0x4650('0xa')]);module[_0x4650('0xb')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index d00f6c9..43c2c01 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 _0xca67=['sequelize','STRING','name'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xca67,0xae));var _0x7ca6=function(_0x196958,_0x27d26c){_0x196958=_0x196958-0x0;var _0x10ccfb=_0xca67[_0x196958];return _0x10ccfb;};'use strict';var Sequelize=require(_0x7ca6('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ca6('0x1')],'unique':_0x7ca6('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7ca6('0x1')]}}; \ No newline at end of file +var _0x4a0f=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a0f,0x1ba));var _0xf4a0=function(_0x43cf1a,_0x3cc9a3){_0x43cf1a=_0x43cf1a-0x0;var _0x351155=_0x4a0f[_0x43cf1a];return _0x351155;};'use strict';var Sequelize=require(_0xf4a0('0x0'));module[_0xf4a0('0x1')]={'name':{'type':Sequelize[_0xf4a0('0x2')],'unique':_0xf4a0('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c024e29..da0b288 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 _0xc3f5=['sendStatus','status','end','json','limit','undefined','count','offset','set','reject','save','update','then','destroy','Pauses','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Pause','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xc3f5,0xe4));var _0x5c3f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc3f5[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x5c3f('0x0'));var rimraf=require(_0x5c3f('0x1'));var zipdir=require(_0x5c3f('0x2'));var jsonpatch=require(_0x5c3f('0x3'));var rp=require(_0x5c3f('0x4'));var moment=require(_0x5c3f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c3f('0x6'));var util=require(_0x5c3f('0x7'));var path=require(_0x5c3f('0x8'));var sox=require(_0x5c3f('0x9'));var csv=require(_0x5c3f('0xa'));var ejs=require(_0x5c3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5c3f('0xd'));var deskjs=require(_0x5c3f('0xe'));var toCsv=require(_0x5c3f('0xa'));var querystring=require(_0x5c3f('0xf'));var Papa=require(_0x5c3f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c3f('0x11'));var as=require(_0x5c3f('0x12'));var hardwareService=require(_0x5c3f('0x13'));var logger=require(_0x5c3f('0x14'))(_0x5c3f('0x15'));var utils=require(_0x5c3f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5c3f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d3ad,_0x7bf717){_0x7bf717=_0x7bf717||0xcc;return function(_0x397158){if(_0x397158){return _0x25d3ad[_0x5c3f('0x18')](_0x7bf717);}return _0x25d3ad[_0x5c3f('0x19')](_0x7bf717)[_0x5c3f('0x1a')]();};}function respondWithResult(_0x44a01a,_0x4dc10e){_0x4dc10e=_0x4dc10e||0xc8;return function(_0x34bf39){if(_0x34bf39){return _0x44a01a[_0x5c3f('0x19')](_0x4dc10e)[_0x5c3f('0x1b')](_0x34bf39);}};}function respondWithFilteredResult(_0x31975c,_0x3181bf){return function(_0x42c92e){if(_0x42c92e){var _0x5a19e2=typeof _0x3181bf['offset']==='undefined'&&typeof _0x3181bf[_0x5c3f('0x1c')]===_0x5c3f('0x1d');var _0x2d054a=_0x42c92e[_0x5c3f('0x1e')];var _0x218e53=_0x5a19e2?0x0:_0x3181bf[_0x5c3f('0x1f')];var _0xda67ff=_0x5a19e2?_0x42c92e[_0x5c3f('0x1e')]:_0x3181bf[_0x5c3f('0x1f')]+_0x3181bf[_0x5c3f('0x1c')];var _0x5eab81;if(_0xda67ff>=_0x2d054a){_0xda67ff=_0x2d054a;_0x5eab81=0xc8;}else{_0x5eab81=0xce;}_0x31975c[_0x5c3f('0x19')](_0x5eab81);return _0x31975c[_0x5c3f('0x20')]('Content-Range',_0x218e53+'-'+_0xda67ff+'/'+_0x2d054a)['json'](_0x42c92e);}return null;};}function patchUpdates(_0x2681c6){return function(_0x18afc7){try{jsonpatch['apply'](_0x18afc7,_0x2681c6,!![]);}catch(_0x3c1bae){return BPromise[_0x5c3f('0x21')](_0x3c1bae);}return _0x18afc7[_0x5c3f('0x22')]();};}function saveUpdates(_0x57229d,_0x1e3604){return function(_0x290c14){if(_0x290c14){return _0x290c14[_0x5c3f('0x23')](_0x57229d)[_0x5c3f('0x24')](function(_0x2b5cc8){return _0x2b5cc8;});}return null;};}function removeEntity(_0x5e20c6,_0x289cba){return function(_0x382c32){if(_0x382c32){return _0x382c32[_0x5c3f('0x25')]()[_0x5c3f('0x24')](function(){var _0x363367=_0x382c32['get']({'plain':!![]});var _0x224bf2=_0x5c3f('0x26');return db['UserProfileResource'][_0x5c3f('0x25')]({'where':{'type':_0x224bf2,'resourceId':_0x363367['id']}})[_0x5c3f('0x24')](function(){return _0x382c32;});})[_0x5c3f('0x24')](function(){_0x5e20c6['status'](0xcc)[_0x5c3f('0x1a')]();});}};}function handleEntityNotFound(_0x41d04b,_0x1141f1){return function(_0x4f4132){if(!_0x4f4132){_0x41d04b[_0x5c3f('0x18')](0x194);}return _0x4f4132;};}function handleError(_0x4fe03a,_0x2267d0){_0x2267d0=_0x2267d0||0x1f4;return function(_0x2fdd93){logger['error'](_0x2fdd93[_0x5c3f('0x27')]);if(_0x2fdd93[_0x5c3f('0x28')]){delete _0x2fdd93['name'];}_0x4fe03a[_0x5c3f('0x19')](_0x2267d0)[_0x5c3f('0x29')](_0x2fdd93);};}exports[_0x5c3f('0x2a')]=function(_0x758330,_0x1af9b2){var _0x18b60f={},_0x3ad200={},_0x5867b1={'count':0x0,'rows':[]};var _0x1eb1ce=_[_0x5c3f('0x2b')](db['Pause'][_0x5c3f('0x2c')],function(_0x4d56b4){return{'name':_0x4d56b4[_0x5c3f('0x2d')],'type':_0x4d56b4[_0x5c3f('0x2e')][_0x5c3f('0x2f')]};});_0x3ad200[_0x5c3f('0x30')]=_[_0x5c3f('0x2b')](_0x1eb1ce,_0x5c3f('0x28'));_0x3ad200[_0x5c3f('0x31')]=_[_0x5c3f('0x32')](_0x758330[_0x5c3f('0x31')]);_0x3ad200[_0x5c3f('0x33')]=_[_0x5c3f('0x34')](_0x3ad200[_0x5c3f('0x30')],_0x3ad200[_0x5c3f('0x31')]);_0x18b60f[_0x5c3f('0x35')]=_[_0x5c3f('0x34')](_0x3ad200[_0x5c3f('0x30')],qs[_0x5c3f('0x36')](_0x758330['query'][_0x5c3f('0x36')]));_0x18b60f['attributes']=_0x18b60f[_0x5c3f('0x35')][_0x5c3f('0x37')]?_0x18b60f[_0x5c3f('0x35')]:_0x3ad200[_0x5c3f('0x30')];if(!_0x758330[_0x5c3f('0x31')][_0x5c3f('0x38')](_0x5c3f('0x39'))){_0x18b60f[_0x5c3f('0x1c')]=qs[_0x5c3f('0x1c')](_0x758330[_0x5c3f('0x31')][_0x5c3f('0x1c')]);_0x18b60f[_0x5c3f('0x1f')]=qs[_0x5c3f('0x1f')](_0x758330[_0x5c3f('0x31')][_0x5c3f('0x1f')]);}_0x18b60f[_0x5c3f('0x3a')]=qs['sort'](_0x758330[_0x5c3f('0x31')][_0x5c3f('0x3b')]);_0x18b60f[_0x5c3f('0x3c')]=qs[_0x5c3f('0x33')](_[_0x5c3f('0x3d')](_0x758330['query'],_0x3ad200[_0x5c3f('0x33')]),_0x1eb1ce);if(_0x758330[_0x5c3f('0x31')][_0x5c3f('0x3e')]){_0x18b60f[_0x5c3f('0x3c')]=_[_0x5c3f('0x3f')](_0x18b60f[_0x5c3f('0x3c')],{'$or':_[_0x5c3f('0x2b')](_0x1eb1ce,function(_0x34cf43){if(_0x34cf43['type']!=='VIRTUAL'){var _0x55bf2b={};_0x55bf2b[_0x34cf43['name']]={'$like':'%'+_0x758330['query'][_0x5c3f('0x3e')]+'%'};return _0x55bf2b;}})});}_0x18b60f=_[_0x5c3f('0x3f')]({},_0x18b60f,_0x758330[_0x5c3f('0x40')]);var _0x47b215={'where':_0x18b60f[_0x5c3f('0x3c')]};return db[_0x5c3f('0x41')][_0x5c3f('0x1e')](_0x47b215)[_0x5c3f('0x24')](function(_0x4ff61f){_0x5867b1[_0x5c3f('0x1e')]=_0x4ff61f;if(_0x758330[_0x5c3f('0x31')][_0x5c3f('0x42')]){_0x18b60f[_0x5c3f('0x43')]=[{'all':!![]}];}return db[_0x5c3f('0x41')]['findAll'](_0x18b60f);})[_0x5c3f('0x24')](function(_0xedb070){_0x5867b1[_0x5c3f('0x44')]=_0xedb070;return _0x5867b1;})[_0x5c3f('0x24')](respondWithFilteredResult(_0x1af9b2,_0x18b60f))[_0x5c3f('0x45')](handleError(_0x1af9b2,null));};exports[_0x5c3f('0x46')]=function(_0x56c678,_0x420a5b){var _0x360764={'raw':!![],'where':{'id':_0x56c678[_0x5c3f('0x47')]['id']}},_0x2f7984={};_0x2f7984['model']=_['keys'](db['Pause'][_0x5c3f('0x2c')]);_0x2f7984['query']=_[_0x5c3f('0x32')](_0x56c678[_0x5c3f('0x31')]);_0x2f7984[_0x5c3f('0x33')]=_['intersection'](_0x2f7984[_0x5c3f('0x30')],_0x2f7984[_0x5c3f('0x31')]);_0x360764[_0x5c3f('0x35')]=_[_0x5c3f('0x34')](_0x2f7984[_0x5c3f('0x30')],qs[_0x5c3f('0x36')](_0x56c678[_0x5c3f('0x31')][_0x5c3f('0x36')]));_0x360764['attributes']=_0x360764[_0x5c3f('0x35')][_0x5c3f('0x37')]?_0x360764[_0x5c3f('0x35')]:_0x2f7984[_0x5c3f('0x30')];if(_0x56c678['query']['includeAll']){_0x360764['include']=[{'all':!![]}];}_0x360764=_[_0x5c3f('0x3f')]({},_0x360764,_0x56c678['options']);return db[_0x5c3f('0x41')][_0x5c3f('0x48')](_0x360764)['then'](handleEntityNotFound(_0x420a5b,null))[_0x5c3f('0x24')](respondWithResult(_0x420a5b,null))[_0x5c3f('0x45')](handleError(_0x420a5b,null));};exports['create']=function(_0x133e34,_0xbf8f70){return db[_0x5c3f('0x41')][_0x5c3f('0x49')](_0x133e34[_0x5c3f('0x4a')],{})['then'](function(_0x1ea0bc){var _0x3aa218=_0x133e34[_0x5c3f('0x4b')]['get']({'plain':!![]});if(!_0x3aa218)throw new Error(_0x5c3f('0x4c'));if(_0x3aa218[_0x5c3f('0x4d')]==='user'){var _0x1ea526=_0x1ea0bc['get']({'plain':!![]});var _0x12b0a3=_0x5c3f('0x26');return db[_0x5c3f('0x4e')][_0x5c3f('0x48')]({'where':{'name':_0x12b0a3,'userProfileId':_0x3aa218[_0x5c3f('0x4f')]},'raw':!![]})[_0x5c3f('0x24')](function(_0x3ac43e){if(_0x3ac43e&&_0x3ac43e[_0x5c3f('0x50')]===0x0){return db[_0x5c3f('0x51')][_0x5c3f('0x49')]({'name':_0x1ea526[_0x5c3f('0x28')],'resourceId':_0x1ea526['id'],'type':_0x3ac43e[_0x5c3f('0x28')],'sectionId':_0x3ac43e['id']},{})[_0x5c3f('0x24')](function(){return _0x1ea0bc;});}else{return _0x1ea0bc;}})[_0x5c3f('0x45')](function(_0x29e65f){logger[_0x5c3f('0x52')](_0x5c3f('0x53'),_0x29e65f);throw _0x29e65f;});}return _0x1ea0bc;})[_0x5c3f('0x24')](respondWithResult(_0xbf8f70,0xc9))[_0x5c3f('0x45')](handleError(_0xbf8f70,null));};exports[_0x5c3f('0x23')]=function(_0x1e8d34,_0x23a67f){if(_0x1e8d34[_0x5c3f('0x4a')]['id']){delete _0x1e8d34[_0x5c3f('0x4a')]['id'];}return db[_0x5c3f('0x41')][_0x5c3f('0x48')]({'where':{'id':_0x1e8d34['params']['id']}})['then'](handleEntityNotFound(_0x23a67f,null))['then'](saveUpdates(_0x1e8d34[_0x5c3f('0x4a')],null))['then'](respondWithResult(_0x23a67f,null))[_0x5c3f('0x45')](handleError(_0x23a67f,null));};exports[_0x5c3f('0x25')]=function(_0x14155e,_0x4aa179){return db['Pause'][_0x5c3f('0x48')]({'where':{'id':_0x14155e[_0x5c3f('0x47')]['id']}})[_0x5c3f('0x24')](handleEntityNotFound(_0x4aa179,null))[_0x5c3f('0x24')](removeEntity(_0x4aa179,null))[_0x5c3f('0x45')](handleError(_0x4aa179,null));}; \ No newline at end of file +var _0xddb2=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Pauses','UserProfileResource','destroy','sendStatus','error','name','index','map','Pause','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xddb2,0x19f));var _0x2ddb=function(_0x32ee28,_0xaa58d){_0x32ee28=_0x32ee28-0x0;var _0x13048e=_0xddb2[_0x32ee28];return _0x13048e;};'use strict';var emlformat=require(_0x2ddb('0x0'));var rimraf=require(_0x2ddb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ddb('0x2'));var rp=require('request-promise');var moment=require(_0x2ddb('0x3'));var BPromise=require(_0x2ddb('0x4'));var Mustache=require('mustache');var util=require(_0x2ddb('0x5'));var path=require(_0x2ddb('0x6'));var sox=require('sox');var csv=require(_0x2ddb('0x7'));var ejs=require(_0x2ddb('0x8'));var fs=require('fs');var fs_extra=require(_0x2ddb('0x9'));var _=require(_0x2ddb('0xa'));var squel=require(_0x2ddb('0xb'));var crypto=require(_0x2ddb('0xc'));var jsforce=require(_0x2ddb('0xd'));var deskjs=require(_0x2ddb('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2ddb('0xf'));var Papa=require('papaparse');var Redis=require(_0x2ddb('0x10'));var authService=require(_0x2ddb('0x11'));var qs=require(_0x2ddb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ddb('0x13'));var logger=require(_0x2ddb('0x14'))(_0x2ddb('0x15'));var utils=require(_0x2ddb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2ddb('0x17'));var db=require(_0x2ddb('0x18'))['db'];function respondWithStatusCode(_0x3d8eca,_0x233dc8){_0x233dc8=_0x233dc8||0xcc;return function(_0x1eee52){if(_0x1eee52){return _0x3d8eca['sendStatus'](_0x233dc8);}return _0x3d8eca[_0x2ddb('0x19')](_0x233dc8)[_0x2ddb('0x1a')]();};}function respondWithResult(_0x4cb498,_0xaebae8){_0xaebae8=_0xaebae8||0xc8;return function(_0x573609){if(_0x573609){return _0x4cb498[_0x2ddb('0x19')](_0xaebae8)[_0x2ddb('0x1b')](_0x573609);}};}function respondWithFilteredResult(_0x49cfdb,_0x29c1e9){return function(_0x5bbff1){if(_0x5bbff1){var _0x3d3d4a=typeof _0x29c1e9[_0x2ddb('0x1c')]===_0x2ddb('0x1d')&&typeof _0x29c1e9[_0x2ddb('0x1e')]===_0x2ddb('0x1d');var _0x1ac7a8=_0x5bbff1[_0x2ddb('0x1f')];var _0x10ec3b=_0x3d3d4a?0x0:_0x29c1e9[_0x2ddb('0x1c')];var _0x19c059=_0x3d3d4a?_0x5bbff1['count']:_0x29c1e9[_0x2ddb('0x1c')]+_0x29c1e9[_0x2ddb('0x1e')];var _0x4aa752;if(_0x19c059>=_0x1ac7a8){_0x19c059=_0x1ac7a8;_0x4aa752=0xc8;}else{_0x4aa752=0xce;}_0x49cfdb['status'](_0x4aa752);return _0x49cfdb[_0x2ddb('0x20')](_0x2ddb('0x21'),_0x10ec3b+'-'+_0x19c059+'/'+_0x1ac7a8)[_0x2ddb('0x1b')](_0x5bbff1);}return null;};}function patchUpdates(_0x22143a){return function(_0x2c84c3){try{jsonpatch['apply'](_0x2c84c3,_0x22143a,!![]);}catch(_0x47fa5c){return BPromise[_0x2ddb('0x22')](_0x47fa5c);}return _0x2c84c3[_0x2ddb('0x23')]();};}function saveUpdates(_0x327ea7,_0x3eb537){return function(_0x88bb5b){if(_0x88bb5b){return _0x88bb5b[_0x2ddb('0x24')](_0x327ea7)[_0x2ddb('0x25')](function(_0x291acd){return _0x291acd;});}return null;};}function removeEntity(_0x2d99f6,_0x1f9b58){return function(_0x516f87){if(_0x516f87){return _0x516f87['destroy']()[_0x2ddb('0x25')](function(){var _0x57d580=_0x516f87[_0x2ddb('0x26')]({'plain':!![]});var _0x1d2992=_0x2ddb('0x27');return db[_0x2ddb('0x28')][_0x2ddb('0x29')]({'where':{'type':_0x1d2992,'resourceId':_0x57d580['id']}})[_0x2ddb('0x25')](function(){return _0x516f87;});})[_0x2ddb('0x25')](function(){_0x2d99f6[_0x2ddb('0x19')](0xcc)[_0x2ddb('0x1a')]();});}};}function handleEntityNotFound(_0x1f7ade,_0x140103){return function(_0x210fda){if(!_0x210fda){_0x1f7ade[_0x2ddb('0x2a')](0x194);}return _0x210fda;};}function handleError(_0xb06ea0,_0x4436ba){_0x4436ba=_0x4436ba||0x1f4;return function(_0x5bfb86){logger[_0x2ddb('0x2b')](_0x5bfb86['stack']);if(_0x5bfb86[_0x2ddb('0x2c')]){delete _0x5bfb86['name'];}_0xb06ea0['status'](_0x4436ba)['send'](_0x5bfb86);};}exports[_0x2ddb('0x2d')]=function(_0x381e4e,_0x4e7010){var _0x413973={},_0x40e6ff={},_0x10eaf0={'count':0x0,'rows':[]};var _0x40557d=_[_0x2ddb('0x2e')](db[_0x2ddb('0x2f')]['rawAttributes'],function(_0x10123a){return{'name':_0x10123a['fieldName'],'type':_0x10123a[_0x2ddb('0x30')][_0x2ddb('0x31')]};});_0x40e6ff[_0x2ddb('0x32')]=_[_0x2ddb('0x2e')](_0x40557d,_0x2ddb('0x2c'));_0x40e6ff['query']=_[_0x2ddb('0x33')](_0x381e4e[_0x2ddb('0x34')]);_0x40e6ff[_0x2ddb('0x35')]=_[_0x2ddb('0x36')](_0x40e6ff[_0x2ddb('0x32')],_0x40e6ff[_0x2ddb('0x34')]);_0x413973[_0x2ddb('0x37')]=_[_0x2ddb('0x36')](_0x40e6ff[_0x2ddb('0x32')],qs[_0x2ddb('0x38')](_0x381e4e['query'][_0x2ddb('0x38')]));_0x413973[_0x2ddb('0x37')]=_0x413973['attributes']['length']?_0x413973[_0x2ddb('0x37')]:_0x40e6ff[_0x2ddb('0x32')];if(!_0x381e4e['query']['hasOwnProperty'](_0x2ddb('0x39'))){_0x413973['limit']=qs[_0x2ddb('0x1e')](_0x381e4e['query'][_0x2ddb('0x1e')]);_0x413973['offset']=qs[_0x2ddb('0x1c')](_0x381e4e[_0x2ddb('0x34')][_0x2ddb('0x1c')]);}_0x413973[_0x2ddb('0x3a')]=qs[_0x2ddb('0x3b')](_0x381e4e[_0x2ddb('0x34')][_0x2ddb('0x3b')]);_0x413973[_0x2ddb('0x3c')]=qs[_0x2ddb('0x35')](_['pick'](_0x381e4e[_0x2ddb('0x34')],_0x40e6ff['filters']),_0x40557d);if(_0x381e4e[_0x2ddb('0x34')]['filter']){_0x413973['where']=_['merge'](_0x413973[_0x2ddb('0x3c')],{'$or':_['map'](_0x40557d,function(_0x159d17){if(_0x159d17[_0x2ddb('0x30')]!=='VIRTUAL'){var _0x1569be={};_0x1569be[_0x159d17['name']]={'$like':'%'+_0x381e4e[_0x2ddb('0x34')][_0x2ddb('0x3d')]+'%'};return _0x1569be;}})});}_0x413973=_[_0x2ddb('0x3e')]({},_0x413973,_0x381e4e[_0x2ddb('0x3f')]);var _0x580a59={'where':_0x413973[_0x2ddb('0x3c')]};return db[_0x2ddb('0x2f')][_0x2ddb('0x1f')](_0x580a59)[_0x2ddb('0x25')](function(_0x2e44df){_0x10eaf0['count']=_0x2e44df;if(_0x381e4e[_0x2ddb('0x34')]['includeAll']){_0x413973[_0x2ddb('0x40')]=[{'all':!![]}];}return db['Pause'][_0x2ddb('0x41')](_0x413973);})[_0x2ddb('0x25')](function(_0x2538ed){_0x10eaf0[_0x2ddb('0x42')]=_0x2538ed;return _0x10eaf0;})[_0x2ddb('0x25')](respondWithFilteredResult(_0x4e7010,_0x413973))[_0x2ddb('0x43')](handleError(_0x4e7010,null));};exports['show']=function(_0x2f7751,_0x3f4c62){var _0x20e4e3={'raw':!![],'where':{'id':_0x2f7751['params']['id']}},_0x315e3f={};_0x315e3f['model']=_[_0x2ddb('0x33')](db['Pause'][_0x2ddb('0x44')]);_0x315e3f[_0x2ddb('0x34')]=_[_0x2ddb('0x33')](_0x2f7751['query']);_0x315e3f[_0x2ddb('0x35')]=_[_0x2ddb('0x36')](_0x315e3f['model'],_0x315e3f[_0x2ddb('0x34')]);_0x20e4e3['attributes']=_[_0x2ddb('0x36')](_0x315e3f[_0x2ddb('0x32')],qs[_0x2ddb('0x38')](_0x2f7751[_0x2ddb('0x34')][_0x2ddb('0x38')]));_0x20e4e3[_0x2ddb('0x37')]=_0x20e4e3[_0x2ddb('0x37')][_0x2ddb('0x45')]?_0x20e4e3[_0x2ddb('0x37')]:_0x315e3f[_0x2ddb('0x32')];if(_0x2f7751[_0x2ddb('0x34')][_0x2ddb('0x46')]){_0x20e4e3['include']=[{'all':!![]}];}_0x20e4e3=_[_0x2ddb('0x3e')]({},_0x20e4e3,_0x2f7751[_0x2ddb('0x3f')]);return db[_0x2ddb('0x2f')][_0x2ddb('0x47')](_0x20e4e3)[_0x2ddb('0x25')](handleEntityNotFound(_0x3f4c62,null))[_0x2ddb('0x25')](respondWithResult(_0x3f4c62,null))[_0x2ddb('0x43')](handleError(_0x3f4c62,null));};exports['create']=function(_0x5d6730,_0x58adbd){return db['Pause'][_0x2ddb('0x48')](_0x5d6730['body'],{})[_0x2ddb('0x25')](function(_0x3543aa){var _0x2cb120=_0x5d6730[_0x2ddb('0x49')]['get']({'plain':!![]});if(!_0x2cb120)throw new Error(_0x2ddb('0x4a'));if(_0x2cb120[_0x2ddb('0x4b')]===_0x2ddb('0x49')){var _0x3851d6=_0x3543aa['get']({'plain':!![]});var _0xba8bab=_0x2ddb('0x27');return db[_0x2ddb('0x4c')][_0x2ddb('0x47')]({'where':{'name':_0xba8bab,'userProfileId':_0x2cb120[_0x2ddb('0x4d')]},'raw':!![]})[_0x2ddb('0x25')](function(_0xf64b09){if(_0xf64b09&&_0xf64b09[_0x2ddb('0x4e')]===0x0){return db[_0x2ddb('0x28')]['create']({'name':_0x3851d6[_0x2ddb('0x2c')],'resourceId':_0x3851d6['id'],'type':_0xf64b09[_0x2ddb('0x2c')],'sectionId':_0xf64b09['id']},{})[_0x2ddb('0x25')](function(){return _0x3543aa;});}else{return _0x3543aa;}})[_0x2ddb('0x43')](function(_0x15169d){logger[_0x2ddb('0x2b')](_0x2ddb('0x4f'),_0x15169d);throw _0x15169d;});}return _0x3543aa;})[_0x2ddb('0x25')](respondWithResult(_0x58adbd,0xc9))[_0x2ddb('0x43')](handleError(_0x58adbd,null));};exports[_0x2ddb('0x24')]=function(_0x3b64ef,_0x4742c8){if(_0x3b64ef[_0x2ddb('0x50')]['id']){delete _0x3b64ef[_0x2ddb('0x50')]['id'];}return db[_0x2ddb('0x2f')][_0x2ddb('0x47')]({'where':{'id':_0x3b64ef[_0x2ddb('0x51')]['id']}})[_0x2ddb('0x25')](handleEntityNotFound(_0x4742c8,null))[_0x2ddb('0x25')](saveUpdates(_0x3b64ef[_0x2ddb('0x50')],null))[_0x2ddb('0x25')](respondWithResult(_0x4742c8,null))[_0x2ddb('0x43')](handleError(_0x4742c8,null));};exports[_0x2ddb('0x29')]=function(_0x5bc45a,_0x2a3633){return db[_0x2ddb('0x2f')][_0x2ddb('0x47')]({'where':{'id':_0x5bc45a[_0x2ddb('0x51')]['id']}})[_0x2ddb('0x25')](handleEntityNotFound(_0x2a3633,null))[_0x2ddb('0x25')](removeEntity(_0x2a3633,null))[_0x2ddb('0x43')](handleError(_0x2a3633,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 10e0931..27bcfd4 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x40a32f,_0x38c8ba){var _0x30ebb7=function(_0x2f52c9){while(--_0x2f52c9){_0x40a32f['push'](_0x40a32f['shift']());}};_0x30ebb7(++_0x38c8ba);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e352c,_0x25764c){_0x1e352c=_0x1e352c-0x0;var _0x3bd1ba=_0x1cb9[_0x1e352c];return _0x3bd1ba;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0xba76ce,_0x3c76d5){var _0x5b8dd7=function(_0x4e786b){while(--_0x4e786b){_0xba76ce['push'](_0xba76ce['shift']());}};_0x5b8dd7(++_0x3c76d5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x53ffa9,_0x5a3490){_0x53ffa9=_0x53ffa9-0x0;var _0x4ca80b=_0x8ef6[_0x53ffa9];return _0x4ca80b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'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 ad0b656..79bc083 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(_0x59715,_0x55cb29){var _0x15b459=function(_0x20fce8){while(--_0x20fce8){_0x59715['push'](_0x59715['shift']());}};_0x15b459(++_0x55cb29);}(_0xb10b,0x12a));var _0xbb10=function(_0xa1ae5c,_0x44beef){_0xa1ae5c=_0xa1ae5c-0x0;var _0x4573c1=_0xb10b[_0xa1ae5c];return _0x4573c1;};'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 _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(_0x63dbc5,_0x3367c0){var _0x1e4b4c=function(_0xbaf99a){while(--_0xbaf99a){_0x63dbc5['push'](_0x63dbc5['shift']());}};_0x1e4b4c(++_0x3367c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x14562a,_0x4d3bed){_0x14562a=_0x14562a-0x0;var _0x1d1f9a=_0xb10b[_0x14562a];return _0x1d1f9a;};'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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 816a064..d282900 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 _0x222f=['index','webhookGet','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','replace','format','extname','now','post','single','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x222f,0x1a4));var _0xf222=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x222f[_0x53758c];return _0x425eff;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./plugin.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/webhook',controller[_0xf222('0xa')]);router[_0xf222('0x8')]('/:id',auth[_0xf222('0xb')](),controller[_0xf222('0xc')]);router[_0xf222('0x8')](_0xf222('0xd'),auth[_0xf222('0xb')](),controller[_0xf222('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e29ad,_0x405080,_0x226dbd){_0x226dbd(null,path[_0xf222('0xf')](config['root'],_0xf222('0x10')));},'filename':function(_0x2850c7,_0x2a6965,_0x3d3d29){_0x2a6965[_0xf222('0x11')]=_0x2a6965[_0xf222('0x11')][_0xf222('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3d3d29(null,util[_0xf222('0x13')]('%s-%s%s',path['basename'](_0x2a6965[_0xf222('0x11')],path[_0xf222('0x14')](_0x2a6965['originalname'])),Date[_0xf222('0x15')](),path[_0xf222('0x14')](_0x2a6965[_0xf222('0x11')])));}})});router[_0xf222('0x16')]('/',upload[_0xf222('0x17')](_0xf222('0x18')),controller[_0xf222('0x19')]);router['post'](_0xf222('0x1a'),controller[_0xf222('0x1b')]);router[_0xf222('0x1c')](_0xf222('0x1d'),auth[_0xf222('0xb')](),controller[_0xf222('0x1e')]);router[_0xf222('0x1f')]('/:id',auth[_0xf222('0xb')](),controller[_0xf222('0x1f')]);module[_0xf222('0x20')]=router; \ No newline at end of file +var _0x0ba7=['../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','diskStorage','server/files/plugins','originalname','format','basename','extname','now','post','single','file','upload','webhookPost','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x32710e,_0x59a3de){var _0x48f027=function(_0x130aed){while(--_0x130aed){_0x32710e['push'](_0x32710e['shift']());}};_0x48f027(++_0x59a3de);}(_0x0ba7,0x16d));var _0x70ba=function(_0x2d518c,_0x546e89){_0x2d518c=_0x2d518c-0x0;var _0x1989fb=_0x0ba7[_0x2d518c];return _0x1989fb;};'use strict';var multer=require(_0x70ba('0x0'));var util=require('util');var path=require(_0x70ba('0x1'));var timeout=require(_0x70ba('0x2'));var express=require(_0x70ba('0x3'));var router=express[_0x70ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x70ba('0x5'));var interaction=require(_0x70ba('0x6'));var config=require(_0x70ba('0x7'));var controller=require(_0x70ba('0x8'));router[_0x70ba('0x9')]('/',auth[_0x70ba('0xa')](),controller[_0x70ba('0xb')]);router[_0x70ba('0x9')](_0x70ba('0xc'),controller[_0x70ba('0xd')]);router[_0x70ba('0x9')](_0x70ba('0xe'),auth[_0x70ba('0xa')](),controller[_0x70ba('0xf')]);router[_0x70ba('0x9')]('/:id/download',auth[_0x70ba('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x70ba('0x10')]({'destination':function(_0x258604,_0xfc4de3,_0x3cf8ab){_0x3cf8ab(null,path['join'](config['root'],_0x70ba('0x11')));},'filename':function(_0x4a2c2e,_0xd6580e,_0x5e94c7){_0xd6580e[_0x70ba('0x12')]=_0xd6580e[_0x70ba('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e94c7(null,util[_0x70ba('0x13')]('%s-%s%s',path[_0x70ba('0x14')](_0xd6580e[_0x70ba('0x12')],path[_0x70ba('0x15')](_0xd6580e[_0x70ba('0x12')])),Date[_0x70ba('0x16')](),path[_0x70ba('0x15')](_0xd6580e[_0x70ba('0x12')])));}})});router[_0x70ba('0x17')]('/',upload[_0x70ba('0x18')](_0x70ba('0x19')),controller[_0x70ba('0x1a')]);router[_0x70ba('0x17')](_0x70ba('0xc'),controller[_0x70ba('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70ba('0x1c')]);router[_0x70ba('0x1d')](_0x70ba('0xe'),auth[_0x70ba('0xa')](),controller[_0x70ba('0x1d')]);module[_0x70ba('0x1e')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index ced66f7..3c823b0 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 _0x03af=['ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x14caa6,_0x25097d){var _0x4d5cc1=function(_0x22d3a3){while(--_0x22d3a3){_0x14caa6['push'](_0x14caa6['shift']());}};_0x4d5cc1(++_0x25097d);}(_0x03af,0xb3));var _0xf03a=function(_0x357b36,_0x3b63e7){_0x357b36=_0x357b36-0x0;var _0x287f03=_0x03af[_0x357b36];return _0x287f03;};'use strict';var Sequelize=require(_0xf03a('0x0'));module[_0xf03a('0x1')]={'name':{'type':Sequelize[_0xf03a('0x2')]},'type':{'type':Sequelize[_0xf03a('0x3')](_0xf03a('0x4'),'script')},'description':{'type':Sequelize[_0xf03a('0x5')]},'version':{'type':Sequelize[_0xf03a('0x5')]},'path':{'type':Sequelize[_0xf03a('0x2')],'comment':_0xf03a('0x6')},'active':{'type':Sequelize[_0xf03a('0x7')],'defaultValue':0x0,'comment':_0xf03a('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xf03a('0x9'),_0xf03a('0xa'),_0xf03a('0xb'),_0xf03a('0xc')),'defaultValue':_0xf03a('0xb'),'comment':_0xf03a('0xd')},'icon':{'type':Sequelize[_0xf03a('0x2')]},'adminUrl':{'type':Sequelize[_0xf03a('0x2')]},'agentUrl':{'type':Sequelize[_0xf03a('0x2')]},'scriptName':{'type':Sequelize[_0xf03a('0x2')]},'scriptPath':{'type':Sequelize[_0xf03a('0x2')]}}; \ No newline at end of file +var _0xa570=['agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xa570,0xe0));var _0x0a57=function(_0x565e3c,_0xbe61c6){_0x565e3c=_0x565e3c-0x0;var _0x145dd8=_0xa570[_0x565e3c];return _0x145dd8;};'use strict';var Sequelize=require(_0x0a57('0x0'));module[_0x0a57('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0a57('0x2')](_0x0a57('0x3'),_0x0a57('0x4'))},'description':{'type':Sequelize[_0x0a57('0x5')]},'version':{'type':Sequelize[_0x0a57('0x5')]},'path':{'type':Sequelize[_0x0a57('0x6')],'comment':_0x0a57('0x7')},'active':{'type':Sequelize[_0x0a57('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x0a57('0x2')](_0x0a57('0x9'),_0x0a57('0xa'),_0x0a57('0xb'),'never'),'defaultValue':_0x0a57('0xb'),'comment':_0x0a57('0xc')},'icon':{'type':Sequelize[_0x0a57('0x6')]},'adminUrl':{'type':Sequelize[_0x0a57('0x6')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x0a57('0x6')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 3c8be31..52c28a6 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 _0x7497=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Plugin','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','download','path','root','server/files/plugins','format','%s.zip','basename','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','join','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','file','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Plugins','create','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','sendStatus','webhookPost'];(function(_0x5c46e2,_0x55f667){var _0x2c24c4=function(_0x3f9cfa){while(--_0x3f9cfa){_0x5c46e2['push'](_0x5c46e2['shift']());}};_0x2c24c4(++_0x55f667);}(_0x7497,0xa9));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7749('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7749('0x1'));var jsonpatch=require(_0x7749('0x2'));var rp=require(_0x7749('0x3'));var moment=require('moment');var BPromise=require(_0x7749('0x4'));var Mustache=require('mustache');var util=require(_0x7749('0x5'));var path=require('path');var sox=require(_0x7749('0x6'));var csv=require(_0x7749('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7749('0x8'));var _=require(_0x7749('0x9'));var squel=require(_0x7749('0xa'));var crypto=require('crypto');var jsforce=require(_0x7749('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7749('0x7'));var querystring=require(_0x7749('0xc'));var Papa=require(_0x7749('0xd'));var extract=require(_0x7749('0xe'));var rimraf=require(_0x7749('0xf'));var archiver=require(_0x7749('0x10'));var Redis=require(_0x7749('0x11'));var authService=require(_0x7749('0x12'));var qs=require(_0x7749('0x13'));var as=require(_0x7749('0x14'));var hardwareService=require(_0x7749('0x15'));var logger=require(_0x7749('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x7749('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7749('0x18'))['db'];config[_0x7749('0x19')]=_['defaults'](config[_0x7749('0x19')],{'host':_0x7749('0x1a'),'port':0x18eb});var socket=require(_0x7749('0x1b'))(new Redis(config[_0x7749('0x19')]));require(_0x7749('0x1c'))[_0x7749('0x1d')](socket);function respondWithStatusCode(_0x6ac1f0,_0x147d33){_0x147d33=_0x147d33||0xcc;return function(_0x23a1cf){if(_0x23a1cf){return _0x6ac1f0['sendStatus'](_0x147d33);}return _0x6ac1f0[_0x7749('0x1e')](_0x147d33)[_0x7749('0x1f')]();};}function respondWithResult(_0x286a0a,_0x50f0eb){_0x50f0eb=_0x50f0eb||0xc8;return function(_0x5b698a){if(_0x5b698a){return _0x286a0a[_0x7749('0x1e')](_0x50f0eb)[_0x7749('0x20')](_0x5b698a);}};}function respondWithFilteredResult(_0x25d800,_0x146580){return function(_0x47c0dc){if(_0x47c0dc){var _0x5245bb=typeof _0x146580[_0x7749('0x21')]===_0x7749('0x22')&&typeof _0x146580[_0x7749('0x23')]==='undefined';var _0x5282ca=_0x47c0dc[_0x7749('0x24')];var _0x532bb3=_0x5245bb?0x0:_0x146580[_0x7749('0x21')];var _0x3ea5f7=_0x5245bb?_0x47c0dc[_0x7749('0x24')]:_0x146580[_0x7749('0x21')]+_0x146580[_0x7749('0x23')];var _0x489246;if(_0x3ea5f7>=_0x5282ca){_0x3ea5f7=_0x5282ca;_0x489246=0xc8;}else{_0x489246=0xce;}_0x25d800[_0x7749('0x1e')](_0x489246);return _0x25d800[_0x7749('0x25')](_0x7749('0x26'),_0x532bb3+'-'+_0x3ea5f7+'/'+_0x5282ca)['json'](_0x47c0dc);}return null;};}function patchUpdates(_0x64128b){return function(_0x165312){try{jsonpatch[_0x7749('0x27')](_0x165312,_0x64128b,!![]);}catch(_0x10ccdd){return BPromise[_0x7749('0x28')](_0x10ccdd);}return _0x165312[_0x7749('0x29')]();};}function saveUpdates(_0x14882e,_0x21bab9){return function(_0x1a246f){if(_0x1a246f){return _0x1a246f[_0x7749('0x2a')](_0x14882e)[_0x7749('0x2b')](function(_0x333a9b){return _0x333a9b;});}return null;};}function removeEntity(_0x541393,_0x104bcd){return function(_0x1f6630){if(_0x1f6630){return _0x1f6630[_0x7749('0x2c')]()[_0x7749('0x2b')](function(){var _0x46566e=_0x1f6630[_0x7749('0x2d')]({'plain':!![]});var _0x50810f='Plugins';return db[_0x7749('0x2e')][_0x7749('0x2c')]({'where':{'type':_0x50810f,'resourceId':_0x46566e['id']}})[_0x7749('0x2b')](function(){return _0x1f6630;});})['then'](function(){_0x541393[_0x7749('0x1e')](0xcc)[_0x7749('0x1f')]();});}};}function handleEntityNotFound(_0x4e5bce,_0x200869){return function(_0x84d44c){if(!_0x84d44c){_0x4e5bce['sendStatus'](0x194);}return _0x84d44c;};}function handleError(_0x10de84,_0x165161){_0x165161=_0x165161||0x1f4;return function(_0xa78c){logger[_0x7749('0x2f')](_0xa78c['stack']);if(_0xa78c[_0x7749('0x30')]){delete _0xa78c[_0x7749('0x30')];}_0x10de84[_0x7749('0x1e')](_0x165161)['send'](_0xa78c);};}exports[_0x7749('0x31')]=function(_0x2206f2,_0x24e7c5){var _0x4b221d={},_0x360fb6={},_0x26b303={'count':0x0,'rows':[]};var _0x2ceb73=_[_0x7749('0x32')](db[_0x7749('0x33')]['rawAttributes'],function(_0x1a9484){return{'name':_0x1a9484['fieldName'],'type':_0x1a9484[_0x7749('0x34')][_0x7749('0x35')]};});_0x360fb6[_0x7749('0x36')]=_[_0x7749('0x32')](_0x2ceb73,_0x7749('0x30'));_0x360fb6['query']=_['keys'](_0x2206f2[_0x7749('0x37')]);_0x360fb6[_0x7749('0x38')]=_[_0x7749('0x39')](_0x360fb6[_0x7749('0x36')],_0x360fb6[_0x7749('0x37')]);_0x4b221d[_0x7749('0x3a')]=_['intersection'](_0x360fb6[_0x7749('0x36')],qs['fields'](_0x2206f2[_0x7749('0x37')][_0x7749('0x3b')]));_0x4b221d[_0x7749('0x3a')]=_0x4b221d['attributes'][_0x7749('0x3c')]?_0x4b221d[_0x7749('0x3a')]:_0x360fb6['model'];if(!_0x2206f2[_0x7749('0x37')][_0x7749('0x3d')](_0x7749('0x3e'))){_0x4b221d[_0x7749('0x23')]=qs[_0x7749('0x23')](_0x2206f2[_0x7749('0x37')][_0x7749('0x23')]);_0x4b221d[_0x7749('0x21')]=qs['offset'](_0x2206f2[_0x7749('0x37')][_0x7749('0x21')]);}_0x4b221d[_0x7749('0x3f')]=qs[_0x7749('0x40')](_0x2206f2['query'][_0x7749('0x40')]);_0x4b221d[_0x7749('0x41')]=qs[_0x7749('0x38')](_[_0x7749('0x42')](_0x2206f2['query'],_0x360fb6[_0x7749('0x38')]),_0x2ceb73);if(_0x2206f2[_0x7749('0x37')][_0x7749('0x43')]){_0x4b221d[_0x7749('0x41')]=_['merge'](_0x4b221d[_0x7749('0x41')],{'$or':_[_0x7749('0x32')](_0x2ceb73,function(_0x3faa14){if(_0x3faa14['type']!==_0x7749('0x44')){var _0x58cc0e={};_0x58cc0e[_0x3faa14[_0x7749('0x30')]]={'$like':'%'+_0x2206f2['query'][_0x7749('0x43')]+'%'};return _0x58cc0e;}})});}_0x4b221d=_[_0x7749('0x45')]({},_0x4b221d,_0x2206f2[_0x7749('0x46')]);var _0x13f890={'where':_0x4b221d[_0x7749('0x41')]};return db[_0x7749('0x33')][_0x7749('0x24')](_0x13f890)[_0x7749('0x2b')](function(_0x3a66aa){_0x26b303[_0x7749('0x24')]=_0x3a66aa;if(_0x2206f2[_0x7749('0x37')]['includeAll']){_0x4b221d[_0x7749('0x47')]=[{'all':!![]}];}return db[_0x7749('0x33')][_0x7749('0x48')](_0x4b221d);})['then'](function(_0x412997){_0x26b303[_0x7749('0x49')]=_0x412997;return _0x26b303;})[_0x7749('0x2b')](respondWithFilteredResult(_0x24e7c5,_0x4b221d))[_0x7749('0x4a')](handleError(_0x24e7c5,null));};exports[_0x7749('0x4b')]=function(_0x25927a,_0x2e0a65){var _0x180793={'raw':!![],'where':{'id':_0x25927a[_0x7749('0x4c')]['id']}},_0xe6c084={};_0xe6c084[_0x7749('0x36')]=_[_0x7749('0x4d')](db[_0x7749('0x33')][_0x7749('0x4e')]);_0xe6c084[_0x7749('0x37')]=_[_0x7749('0x4d')](_0x25927a[_0x7749('0x37')]);_0xe6c084['filters']=_[_0x7749('0x39')](_0xe6c084[_0x7749('0x36')],_0xe6c084[_0x7749('0x37')]);_0x180793['attributes']=_[_0x7749('0x39')](_0xe6c084['model'],qs['fields'](_0x25927a[_0x7749('0x37')][_0x7749('0x3b')]));_0x180793[_0x7749('0x3a')]=_0x180793[_0x7749('0x3a')][_0x7749('0x3c')]?_0x180793[_0x7749('0x3a')]:_0xe6c084[_0x7749('0x36')];if(_0x25927a['query'][_0x7749('0x4f')]){_0x180793['include']=[{'all':!![]}];}_0x180793=_[_0x7749('0x45')]({},_0x180793,_0x25927a[_0x7749('0x46')]);return db[_0x7749('0x33')][_0x7749('0x50')](_0x180793)[_0x7749('0x2b')](handleEntityNotFound(_0x2e0a65,null))[_0x7749('0x2b')](respondWithResult(_0x2e0a65,null))[_0x7749('0x4a')](handleError(_0x2e0a65,null));};exports[_0x7749('0x51')]=function(_0x9c242a,_0x4b0b5c,_0x6bd0){return db['Plugin']['find']({'where':{'id':_0x9c242a[_0x7749('0x4c')]['id']},'attributes':['name',_0x7749('0x52')],'raw':!![]})[_0x7749('0x2b')](handleEntityNotFound(_0x4b0b5c,null))[_0x7749('0x2b')](function(_0x570128){if(_0x570128){var _0xaba441=path['join'](config[_0x7749('0x53')],_0x7749('0x54'),util[_0x7749('0x55')](_0x7749('0x56'),path[_0x7749('0x57')](_0x570128[_0x7749('0x52')])));var _0x1746fa=fs['createWriteStream'](_0xaba441);var _0x59d0da=archiver(_0x7749('0x58'),{'zlib':{'level':0x9}});_0x59d0da['on'](_0x7749('0x59'),function(_0x307ee3){if(_0x307ee3['code']===_0x7749('0x5a')){logger[_0x7749('0x2f')](_0x307ee3);}else{throw new db[(_0x7749('0x5b'))][(_0x7749('0x5c'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x59d0da['on'](_0x7749('0x2f'),function(_0x4ad766){throw new db[(_0x7749('0x5b'))][(_0x7749('0x5c'))](_0x7749('0x5d'));});_0x59d0da['pipe'](_0x1746fa);_0x59d0da[_0x7749('0x5e')]('**/*',{'cwd':path[_0x7749('0x5f')](config['root'],_0x7749('0x54'),path[_0x7749('0x60')](_0x570128['path'])),'ignore':[path['join'](path[_0x7749('0x57')](_0x570128[_0x7749('0x52')]),_0x7749('0x61')),path[_0x7749('0x5f')](path[_0x7749('0x57')](_0x570128[_0x7749('0x52')]),'attachments/**/*')],'nodir':!![]})[_0x7749('0x62')]();_0x1746fa['on'](_0x7749('0x63'),function(){if(!fs['existsSync'](_0xaba441)){throw new db['Sequelize'][(_0x7749('0x5c'))](_0x7749('0x64'));}return _0x4b0b5c['download'](_0xaba441,util[_0x7749('0x55')](_0x7749('0x56'),path['basename'](_0x570128['path'])),function(_0x50ae3d){if(_0x50ae3d){throw new db[(_0x7749('0x5b'))]['Error'](_0x7749('0x65'));}fs[_0x7749('0x66')](_0xaba441);logger[_0x7749('0x67')](_0x7749('0x68'));logger[_0x7749('0x67')]('Temporary\x20file\x20removed');});});}return null;})[_0x7749('0x4a')](handleError(_0x4b0b5c,null));};exports[_0x7749('0x69')]=function(_0x4f7170,_0x5447f5,_0x18d329){var _0x46bdac=path['basename'](_0x4f7170['file'][_0x7749('0x6a')],path['extname'](_0x4f7170['file']['filename']));var _0x59f20a=path[_0x7749('0x5f')](config['root'],'server/files/plugins',_0x4f7170[_0x7749('0x6b')]['filename']);var _0x4b4ab2=path[_0x7749('0x5f')](config[_0x7749('0x53')],_0x7749('0x54'),_0x46bdac);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x59f20a);logger[_0x7749('0x67')](_0x7749('0x6c'),_0x4b4ab2);try{fs[_0x7749('0x6d')](_0x59f20a,parseInt('0777',0x8));extract(_0x59f20a,{'dir':_0x4b4ab2},function(_0x1f250c){if(_0x1f250c){logger[_0x7749('0x2f')](_0x1f250c);handleError(_0x1f250c,!![]);};var _0x3ef527=fs[_0x7749('0x6e')](_0x4b4ab2);if(_0x3ef527[_0x7749('0x3c')]>0x1){removeReferences(_0x59f20a,_0x4b4ab2);logger[_0x7749('0x2f')](_0x7749('0x6f'));return _0x18d329(new Error(_0x7749('0x6f')));}var _0xa62c0e=fs['lstatSync'](path[_0x7749('0x5f')](_0x4b4ab2,_0x3ef527[0x0]));if(_0xa62c0e[_0x7749('0x70')]()){removeReferences(_0x59f20a,_0x4b4ab2);logger[_0x7749('0x2f')]('Invalid\x20plugin\x20structure');return _0x18d329(new Error(_0x7749('0x6f')));}if(_0xa62c0e['isDirectory']()){var _0x4b95de=fs[_0x7749('0x6e')](path[_0x7749('0x5f')](_0x4b4ab2,_0x3ef527[0x0]));if(_0x4b95de[_0x7749('0x3c')]===0x0){removeReferences(_0x59f20a,_0x4b4ab2);logger[_0x7749('0x2f')]('Invalid\x20plugin\x20structure');return _0x18d329(new Error('Invalid\x20plugin\x20structure'));}var _0x2b6b17=_0x4b95de[_0x7749('0x71')](function(_0x745ee2){return _0x745ee2==='manifest.json';});if(!_0x2b6b17){return _0x18d329(new Error(_0x7749('0x72')));}var _0x4f670f=fs[_0x7749('0x73')](path['join'](_0x4b4ab2,_0x3ef527[0x0],_0x7749('0x74')));var _0x190a8d=JSON[_0x7749('0x75')](_0x4f670f);if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x30')]){return _0x18d329(new Error(_0x7749('0x76')));}if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x34')]){return _0x18d329(new Error(_0x7749('0x77')));}if('undefined'==typeof _0x190a8d['version']){return _0x18d329(new Error(_0x7749('0x78')));}if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x79')]){return _0x18d329(new Error(_0x7749('0x7a')));}if(_0x190a8d['type']===_0x7749('0x7b')){if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x7c')]){return _0x18d329(new Error(_0x7749('0x7d')));}if('undefined'==typeof _0x190a8d['parameters'][_0x7749('0x7c')][_0x7749('0x7e')]&&_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x7c')]['agent']){return _0x18d329(new Error(_0x7749('0x7f')));}}else if(_0x190a8d[_0x7749('0x34')]===_0x7749('0x80')){if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x81')]){return _0x18d329(new Error(_0x7749('0x82')));}if(_0x7749('0x22')==typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x83')]){return _0x18d329(new Error(_0x7749('0x84')));}}else{return _0x18d329(new Error(_0x7749('0x85')));}var _0x73509e=_0x190a8d['name'];var _0x12f35b=_0x190a8d[_0x7749('0x86')];var _0x5d06d3=_0x190a8d['type'];var _0x2b27eb=_0x190a8d[_0x7749('0x87')]?_0x190a8d['sidebar']:_0x7749('0x88');var _0x113f1d=_0x190a8d[_0x7749('0x89')]?_0x190a8d['icon']:_0x7749('0x8a');var _0x426d42='';var _0x38e030='';var _0x1852ac='';var _0x4bf539='';var _0x368637=_0x190a8d['version'];if(_0x5d06d3===_0x7749('0x7b')){if('undefined'!=typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x7c')][_0x7749('0x7e')]){var _0x1898a8=_0x190a8d[_0x7749('0x79')][_0x7749('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1898a8)){_0x426d42=path[_0x7749('0x5f')](_0x7749('0x8b'),_0x46bdac,_0x3ef527[0x0],_0x1898a8);}else{_0x426d42=_0x1898a8;}}else{logger[_0x7749('0x67')](_0x7749('0x8c'));}if('undefined'!=typeof _0x190a8d[_0x7749('0x79')][_0x7749('0x7c')][_0x7749('0x8d')]){var _0x40e5ab=_0x190a8d[_0x7749('0x79')][_0x7749('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7749('0x8e')](_0x40e5ab)){_0x38e030=path[_0x7749('0x5f')](_0x7749('0x8b'),_0x46bdac,_0x3ef527[0x0],_0x40e5ab);}else{_0x38e030=_0x40e5ab;}}else{logger[_0x7749('0x67')](_0x7749('0x8f'));}}else if(_0x5d06d3===_0x7749('0x80')){_0x1852ac=_0x190a8d['parameters']['scriptName'];_0x4bf539=_0x190a8d['parameters']['scriptPath'];if(_0x7749('0x22')!=typeof _0x190a8d[_0x7749('0x79')]['views']){if(_0x7749('0x22')!=typeof _0x190a8d['parameters'][_0x7749('0x7c')]['admin']){var _0x1898a8=_0x190a8d[_0x7749('0x79')][_0x7749('0x7c')][_0x7749('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x7749('0x8e')](_0x1898a8)){_0x426d42=path['join']('plugins',_0x46bdac,_0x3ef527[0x0],_0x1898a8);}else{_0x426d42=_0x1898a8;}}if('undefined'!=typeof _0x190a8d[_0x7749('0x79')]['views']['agent']){var _0x40e5ab=_0x190a8d[_0x7749('0x79')][_0x7749('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x40e5ab)){_0x38e030=path[_0x7749('0x5f')](_0x7749('0x8b'),_0x46bdac,_0x3ef527[0x0],_0x40e5ab);}else{_0x38e030=_0x40e5ab;}}}}var _0x5af056={'name':_0x73509e,'description':_0x12f35b,'path':path[_0x7749('0x5f')](_0x46bdac,_0x3ef527[0x0]),'type':_0x5d06d3,'sidebar':_0x2b27eb,'icon':_0x113f1d,'adminUrl':_0x426d42,'agentUrl':_0x38e030,'scriptName':_0x1852ac,'scriptPath':_0x4bf539,'version':_0x368637};removeReferences(_0x59f20a,null);return db[_0x7749('0x33')]['create'](_0x5af056)[_0x7749('0x2b')](function(_0x19b168){var _0x115736={'role':_0x4f7170['body'][_0x7749('0x90')],'userProfileId':_0x4f7170[_0x7749('0x91')][_0x7749('0x92')]};if(!_0x115736)throw new Error(_0x7749('0x93'));if(_0x115736['role']==='user'){var _0x5afd4c=_0x19b168[_0x7749('0x2d')]({'plain':!![]});return db[_0x7749('0x94')][_0x7749('0x50')]({'where':{'name':_0x7749('0x95'),'userProfileId':_0x115736['userProfileId']},'raw':!![]})[_0x7749('0x2b')](function(_0x4b22f1){if(_0x4b22f1&&_0x4b22f1['autoAssociation']===0x0){return db[_0x7749('0x2e')][_0x7749('0x96')]({'name':_0x5afd4c[_0x7749('0x30')],'resourceId':_0x5afd4c['id'],'type':_0x4b22f1['name'],'sectionId':_0x4b22f1['id']},{})[_0x7749('0x2b')](function(){return _0x19b168;});}else{return _0x19b168;}})[_0x7749('0x4a')](function(_0x53002c){logger[_0x7749('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53002c);throw _0x53002c;});}return _0x19b168;})[_0x7749('0x2b')](respondWithResult(_0x5447f5,null))['catch'](handleError(_0x5447f5,null));}});}catch(_0x2f6e4f){_0x5447f5['status'](0x1f4)[_0x7749('0x97')](_0x2f6e4f);}};function removeReferences(_0x65cd27,_0x3a0033){try{if(_0x65cd27){fs[_0x7749('0x66')](_0x65cd27);logger[_0x7749('0x67')](_0x7749('0x98'));}if(_0x3a0033){rimraf(_0x3a0033,function(){});logger['info'](_0x7749('0x99'));}}catch(_0x231009){logger[_0x7749('0x2f')](_0x231009);}}exports[_0x7749('0x2a')]=function(_0x4595d1,_0x4c35b9,_0x55ce3a){return db['Plugin'][_0x7749('0x50')]({'where':{'id':_0x4595d1[_0x7749('0x4c')]['id']}})[_0x7749('0x2b')](handleEntityNotFound(_0x4c35b9,null))['then'](saveUpdates(_0x4595d1[_0x7749('0x91')],null))[_0x7749('0x2b')](respondWithResult(_0x4c35b9,null))['catch'](handleError(_0x4c35b9,null));};exports['delete']=function(_0x32e664,_0x5cf0cb,_0x582686){return db[_0x7749('0x33')][_0x7749('0x50')]({'where':{'id':_0x32e664[_0x7749('0x4c')]['id']}})[_0x7749('0x2b')](function(_0x42f18a){if(_0x42f18a){return _0x42f18a[_0x7749('0x2c')]();}})[_0x7749('0x2b')](function(_0x3f24be){rimraf(path['join'](config[_0x7749('0x53')],'server/files/plugins',path[_0x7749('0x60')](_0x3f24be[_0x7749('0x52')])),function(){});return _0x3f24be;})['then'](handleEntityNotFound(_0x5cf0cb,null))[_0x7749('0x2b')](respondWithStatusCode(_0x5cf0cb,null))[_0x7749('0x4a')](handleError(_0x5cf0cb,null));};exports[_0x7749('0x9a')]=function(_0x41a03f,_0x2f1d23,_0x18ac34){return BPromise[_0x7749('0x9b')]()[_0x7749('0x2b')](function(){if(!_0x41a03f['query'][_0x7749('0x52')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x41a03f['query'][_0x7749('0x9c')]){throw new Error(_0x7749('0x9d'));}var _0x3e57c0=_0x41a03f[_0x7749('0x37')][_0x7749('0x9e')]?_0x41a03f[_0x7749('0x37')][_0x7749('0x9e')]+':'+_0x41a03f[_0x7749('0x37')]['port']:_0x7749('0x9f')+_0x41a03f[_0x7749('0x37')][_0x7749('0x9c')];var _0x11cc28=_0x41a03f['query'][_0x7749('0x20')]?_0x41a03f[_0x7749('0x37')][_0x7749('0x20')]:!![];var _0x18e5c3=_0x41a03f['query'][_0x7749('0xa0')]?_0x41a03f['query'][_0x7749('0xa0')]:null;var _0x407d43={'method':_0x41a03f[_0x7749('0xa1')],'uri':util[_0x7749('0x55')](_0x7749('0xa2'),_0x3e57c0,_0x41a03f[_0x7749('0x37')][_0x7749('0x52')]),'json':_0x11cc28,'resolveWithFullResponse':!![],'encoding':_0x18e5c3,'qs':_0x41a03f[_0x7749('0x37')]};if(_0x41a03f[_0x7749('0xa3')]){_0x407d43[_0x7749('0xa3')]=_0x41a03f[_0x7749('0xa3')];if(_0x407d43[_0x7749('0xa3')]['content-length']){delete _0x407d43[_0x7749('0xa3')][_0x7749('0xa4')];}}if(_0x407d43[_0x7749('0xa3')][_0x7749('0xa5')]){delete _0x407d43[_0x7749('0xa3')][_0x7749('0xa5')];}return rp(_0x407d43);})[_0x7749('0x2b')](function(_0x111069){if(_0x111069){_0x2f1d23['set'](_0x111069[_0x7749('0xa3')]);logger['info'](_0x111069[_0x7749('0x91')]);if(_['endsWith'](_0x41a03f[_0x7749('0x37')][_0x7749('0x52')],_0x7749('0x51'))&&_0x111069[_0x7749('0xa6')]==0x1f4){return _0x2f1d23[_0x7749('0xa7')](_0x111069[_0x7749('0xa6')]);}else{return _0x2f1d23[_0x7749('0x1e')](_0x111069['statusCode'])[_0x7749('0x97')](_0x111069[_0x7749('0x91')]);}}else{return _0x2f1d23[_0x7749('0xa7')](0xc8);}})[_0x7749('0x4a')](handleError(_0x2f1d23,null));};exports[_0x7749('0xa8')]=function(_0x270e21,_0x250623,_0x14dba1){return BPromise[_0x7749('0x9b')]()[_0x7749('0x2b')](function(){if(!_0x270e21[_0x7749('0x37')][_0x7749('0x52')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x270e21[_0x7749('0x37')][_0x7749('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x11a8bc=_0x270e21[_0x7749('0x37')]['hostname']?_0x270e21[_0x7749('0x37')]['hostname']+':'+_0x270e21[_0x7749('0x37')]['port']:_0x7749('0x9f')+_0x270e21[_0x7749('0x37')][_0x7749('0x9c')];var _0x251a7e=_0x270e21[_0x7749('0x37')][_0x7749('0x20')]?_0x270e21[_0x7749('0x37')][_0x7749('0x20')]:!![];var _0x25b8b5=_0x270e21[_0x7749('0x37')]['encoding']?_0x270e21[_0x7749('0x37')][_0x7749('0xa0')]:null;var _0x29868f={'method':_0x270e21[_0x7749('0xa1')],'uri':util['format']('%s%s',_0x11a8bc,_0x270e21['query'][_0x7749('0x52')]),'json':_0x251a7e,'resolveWithFullResponse':!![],'encoding':_0x25b8b5,'body':_0x270e21[_0x7749('0x91')]};if(_0x270e21[_0x7749('0xa3')]){_0x29868f[_0x7749('0xa3')]=_0x270e21[_0x7749('0xa3')];if(_0x29868f[_0x7749('0xa3')]['content-length']){delete _0x29868f[_0x7749('0xa3')]['content-length'];}}if(_0x29868f[_0x7749('0xa3')][_0x7749('0xa5')]){delete _0x29868f['headers'][_0x7749('0xa5')];}return rp(_0x29868f);})['then'](function(_0x5073eb){if(_0x5073eb){_0x250623[_0x7749('0x25')](_0x5073eb[_0x7749('0xa3')]);logger['info'](_0x5073eb[_0x7749('0x91')]);return _0x250623['status'](_0x5073eb[_0x7749('0xa6')])[_0x7749('0x97')](_0x5073eb[_0x7749('0x91')]);}else{return _0x250623[_0x7749('0xa7')](0xc8);}})['catch'](handleError(_0x250623,null));}; \ No newline at end of file +var _0xbdbf=['limit','set','Content-Range','json','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','name','send','index','map','Plugin','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','type','includeAll','findAll','rows','catch','show','length','include','options','find','download','params','join','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','root','Plugin\x20upload\x20filepath:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','parameters','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','content-type','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','../../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','status','end','offset','undefined','count'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xbdbf,0x88));var _0xfbdb=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xbdbf[_0x2aea9e];return _0x430b92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfbdb('0x0'));var zipdir=require(_0xfbdb('0x1'));var jsonpatch=require(_0xfbdb('0x2'));var rp=require(_0xfbdb('0x3'));var moment=require(_0xfbdb('0x4'));var BPromise=require(_0xfbdb('0x5'));var Mustache=require(_0xfbdb('0x6'));var util=require(_0xfbdb('0x7'));var path=require(_0xfbdb('0x8'));var sox=require(_0xfbdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfbdb('0xa'));var _=require(_0xfbdb('0xb'));var squel=require(_0xfbdb('0xc'));var crypto=require(_0xfbdb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfbdb('0xe'));var toCsv=require(_0xfbdb('0xf'));var querystring=require(_0xfbdb('0x10'));var Papa=require(_0xfbdb('0x11'));var extract=require(_0xfbdb('0x12'));var rimraf=require(_0xfbdb('0x0'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0xfbdb('0x13'));var qs=require(_0xfbdb('0x14'));var as=require(_0xfbdb('0x15'));var hardwareService=require(_0xfbdb('0x16'));var logger=require('../../config/logger')(_0xfbdb('0x17'));var utils=require(_0xfbdb('0x18'));var config=require(_0xfbdb('0x19'));var licenseUtil=require(_0xfbdb('0x1a'));var db=require(_0xfbdb('0x1b'))['db'];config[_0xfbdb('0x1c')]=_[_0xfbdb('0x1d')](config[_0xfbdb('0x1c')],{'host':_0xfbdb('0x1e'),'port':0x18eb});var socket=require(_0xfbdb('0x1f'))(new Redis(config[_0xfbdb('0x1c')]));require(_0xfbdb('0x20'))[_0xfbdb('0x21')](socket);function respondWithStatusCode(_0x59e7bf,_0x40772d){_0x40772d=_0x40772d||0xcc;return function(_0x4681c5){if(_0x4681c5){return _0x59e7bf['sendStatus'](_0x40772d);}return _0x59e7bf[_0xfbdb('0x22')](_0x40772d)[_0xfbdb('0x23')]();};}function respondWithResult(_0x177086,_0x355b58){_0x355b58=_0x355b58||0xc8;return function(_0x22f6c8){if(_0x22f6c8){return _0x177086[_0xfbdb('0x22')](_0x355b58)['json'](_0x22f6c8);}};}function respondWithFilteredResult(_0x1d6800,_0x5048b6){return function(_0x719cea){if(_0x719cea){var _0x58e6f1=typeof _0x5048b6[_0xfbdb('0x24')]===_0xfbdb('0x25')&&typeof _0x5048b6['limit']===_0xfbdb('0x25');var _0x5a852f=_0x719cea[_0xfbdb('0x26')];var _0x22240c=_0x58e6f1?0x0:_0x5048b6[_0xfbdb('0x24')];var _0x3bfeb0=_0x58e6f1?_0x719cea[_0xfbdb('0x26')]:_0x5048b6[_0xfbdb('0x24')]+_0x5048b6[_0xfbdb('0x27')];var _0x27c079;if(_0x3bfeb0>=_0x5a852f){_0x3bfeb0=_0x5a852f;_0x27c079=0xc8;}else{_0x27c079=0xce;}_0x1d6800[_0xfbdb('0x22')](_0x27c079);return _0x1d6800[_0xfbdb('0x28')](_0xfbdb('0x29'),_0x22240c+'-'+_0x3bfeb0+'/'+_0x5a852f)[_0xfbdb('0x2a')](_0x719cea);}return null;};}function patchUpdates(_0x183cbb){return function(_0xfaad69){try{jsonpatch['apply'](_0xfaad69,_0x183cbb,!![]);}catch(_0x1adae9){return BPromise[_0xfbdb('0x2b')](_0x1adae9);}return _0xfaad69[_0xfbdb('0x2c')]();};}function saveUpdates(_0x2e9d8b,_0x58ff31){return function(_0x25b4ea){if(_0x25b4ea){return _0x25b4ea[_0xfbdb('0x2d')](_0x2e9d8b)[_0xfbdb('0x2e')](function(_0x2a38a2){return _0x2a38a2;});}return null;};}function removeEntity(_0x513fbb,_0x266507){return function(_0x41f9f0){if(_0x41f9f0){return _0x41f9f0[_0xfbdb('0x2f')]()[_0xfbdb('0x2e')](function(){var _0x1b118f=_0x41f9f0[_0xfbdb('0x30')]({'plain':!![]});var _0x2b0d72=_0xfbdb('0x31');return db[_0xfbdb('0x32')][_0xfbdb('0x2f')]({'where':{'type':_0x2b0d72,'resourceId':_0x1b118f['id']}})[_0xfbdb('0x2e')](function(){return _0x41f9f0;});})['then'](function(){_0x513fbb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bd5af,_0x1d00a9){return function(_0x207255){if(!_0x207255){_0x1bd5af[_0xfbdb('0x33')](0x194);}return _0x207255;};}function handleError(_0x3a20fd,_0x3a8138){_0x3a8138=_0x3a8138||0x1f4;return function(_0x3b9188){logger[_0xfbdb('0x34')](_0x3b9188['stack']);if(_0x3b9188[_0xfbdb('0x35')]){delete _0x3b9188[_0xfbdb('0x35')];}_0x3a20fd['status'](_0x3a8138)[_0xfbdb('0x36')](_0x3b9188);};}exports[_0xfbdb('0x37')]=function(_0x8ee9c,_0x317025){var _0x548996={},_0x373757={},_0x58e246={'count':0x0,'rows':[]};var _0x13dbdc=_[_0xfbdb('0x38')](db[_0xfbdb('0x39')][_0xfbdb('0x3a')],function(_0x5d5292){return{'name':_0x5d5292['fieldName'],'type':_0x5d5292['type'][_0xfbdb('0x3b')]};});_0x373757[_0xfbdb('0x3c')]=_[_0xfbdb('0x38')](_0x13dbdc,'name');_0x373757[_0xfbdb('0x3d')]=_[_0xfbdb('0x3e')](_0x8ee9c['query']);_0x373757[_0xfbdb('0x3f')]=_[_0xfbdb('0x40')](_0x373757['model'],_0x373757[_0xfbdb('0x3d')]);_0x548996['attributes']=_[_0xfbdb('0x40')](_0x373757[_0xfbdb('0x3c')],qs[_0xfbdb('0x41')](_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x41')]));_0x548996[_0xfbdb('0x42')]=_0x548996[_0xfbdb('0x42')]['length']?_0x548996['attributes']:_0x373757['model'];if(!_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x43')]('nolimit')){_0x548996['limit']=qs[_0xfbdb('0x27')](_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x27')]);_0x548996[_0xfbdb('0x24')]=qs[_0xfbdb('0x24')](_0x8ee9c['query'][_0xfbdb('0x24')]);}_0x548996['order']=qs[_0xfbdb('0x44')](_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x44')]);_0x548996[_0xfbdb('0x45')]=qs[_0xfbdb('0x3f')](_['pick'](_0x8ee9c[_0xfbdb('0x3d')],_0x373757['filters']),_0x13dbdc);if(_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x46')]){_0x548996[_0xfbdb('0x45')]=_[_0xfbdb('0x47')](_0x548996[_0xfbdb('0x45')],{'$or':_[_0xfbdb('0x38')](_0x13dbdc,function(_0x5dfcf8){if(_0x5dfcf8[_0xfbdb('0x48')]!=='VIRTUAL'){var _0x162d59={};_0x162d59[_0x5dfcf8[_0xfbdb('0x35')]]={'$like':'%'+_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x46')]+'%'};return _0x162d59;}})});}_0x548996=_[_0xfbdb('0x47')]({},_0x548996,_0x8ee9c['options']);var _0x4a3041={'where':_0x548996[_0xfbdb('0x45')]};return db[_0xfbdb('0x39')][_0xfbdb('0x26')](_0x4a3041)['then'](function(_0x3002cf){_0x58e246[_0xfbdb('0x26')]=_0x3002cf;if(_0x8ee9c[_0xfbdb('0x3d')][_0xfbdb('0x49')]){_0x548996['include']=[{'all':!![]}];}return db[_0xfbdb('0x39')][_0xfbdb('0x4a')](_0x548996);})[_0xfbdb('0x2e')](function(_0x2fe222){_0x58e246[_0xfbdb('0x4b')]=_0x2fe222;return _0x58e246;})[_0xfbdb('0x2e')](respondWithFilteredResult(_0x317025,_0x548996))[_0xfbdb('0x4c')](handleError(_0x317025,null));};exports[_0xfbdb('0x4d')]=function(_0x305930,_0x56fbbd){var _0x1f3174={'raw':!![],'where':{'id':_0x305930['params']['id']}},_0x3534e2={};_0x3534e2[_0xfbdb('0x3c')]=_['keys'](db[_0xfbdb('0x39')]['rawAttributes']);_0x3534e2['query']=_['keys'](_0x305930[_0xfbdb('0x3d')]);_0x3534e2[_0xfbdb('0x3f')]=_[_0xfbdb('0x40')](_0x3534e2[_0xfbdb('0x3c')],_0x3534e2['query']);_0x1f3174[_0xfbdb('0x42')]=_['intersection'](_0x3534e2[_0xfbdb('0x3c')],qs[_0xfbdb('0x41')](_0x305930[_0xfbdb('0x3d')][_0xfbdb('0x41')]));_0x1f3174[_0xfbdb('0x42')]=_0x1f3174[_0xfbdb('0x42')][_0xfbdb('0x4e')]?_0x1f3174[_0xfbdb('0x42')]:_0x3534e2[_0xfbdb('0x3c')];if(_0x305930['query'][_0xfbdb('0x49')]){_0x1f3174[_0xfbdb('0x4f')]=[{'all':!![]}];}_0x1f3174=_['merge']({},_0x1f3174,_0x305930[_0xfbdb('0x50')]);return db[_0xfbdb('0x39')][_0xfbdb('0x51')](_0x1f3174)[_0xfbdb('0x2e')](handleEntityNotFound(_0x56fbbd,null))[_0xfbdb('0x2e')](respondWithResult(_0x56fbbd,null))['catch'](handleError(_0x56fbbd,null));};exports[_0xfbdb('0x52')]=function(_0x3457e8,_0x5334cd,_0x2f5bd4){return db[_0xfbdb('0x39')]['find']({'where':{'id':_0x3457e8[_0xfbdb('0x53')]['id']},'attributes':['name',_0xfbdb('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x5334cd,null))[_0xfbdb('0x2e')](function(_0x1202eb){if(_0x1202eb){var _0x2faed2=path[_0xfbdb('0x54')](config['root'],_0xfbdb('0x55'),util['format'](_0xfbdb('0x56'),path[_0xfbdb('0x57')](_0x1202eb['path'])));var _0x4013a8=fs[_0xfbdb('0x58')](_0x2faed2);var _0x1cf830=archiver(_0xfbdb('0x59'),{'zlib':{'level':0x9}});_0x1cf830['on'](_0xfbdb('0x5a'),function(_0x5454c2){if(_0x5454c2[_0xfbdb('0x5b')]===_0xfbdb('0x5c')){logger[_0xfbdb('0x34')](_0x5454c2);}else{throw new db[(_0xfbdb('0x5d'))]['Error'](_0xfbdb('0x5e'));}});_0x1cf830['on'](_0xfbdb('0x34'),function(_0x47d569){throw new db['Sequelize'][(_0xfbdb('0x5f'))](_0xfbdb('0x5e'));});_0x1cf830['pipe'](_0x4013a8);_0x1cf830[_0xfbdb('0x60')](_0xfbdb('0x61'),{'cwd':path[_0xfbdb('0x54')](config['root'],'server/files/plugins',path[_0xfbdb('0x62')](_0x1202eb[_0xfbdb('0x8')])),'ignore':[path['join'](path['basename'](_0x1202eb[_0xfbdb('0x8')]),_0xfbdb('0x63')),path[_0xfbdb('0x54')](path['basename'](_0x1202eb[_0xfbdb('0x8')]),_0xfbdb('0x64'))],'nodir':!![]})[_0xfbdb('0x65')]();_0x4013a8['on'](_0xfbdb('0x66'),function(){if(!fs[_0xfbdb('0x67')](_0x2faed2)){throw new db[(_0xfbdb('0x5d'))][(_0xfbdb('0x5f'))](_0xfbdb('0x68'));}return _0x5334cd[_0xfbdb('0x52')](_0x2faed2,util['format']('%s.zip',path[_0xfbdb('0x57')](_0x1202eb[_0xfbdb('0x8')])),function(_0x173e06){if(_0x173e06){throw new db['Sequelize'][(_0xfbdb('0x5f'))](_0xfbdb('0x69'));}fs[_0xfbdb('0x6a')](_0x2faed2);logger['info'](_0xfbdb('0x6b'));logger[_0xfbdb('0x6c')](_0xfbdb('0x6d'));});});}return null;})[_0xfbdb('0x4c')](handleError(_0x5334cd,null));};exports[_0xfbdb('0x6e')]=function(_0x5bc5ba,_0x287ce6,_0x454d02){var _0x4a6afb=path[_0xfbdb('0x57')](_0x5bc5ba[_0xfbdb('0x6f')][_0xfbdb('0x70')],path['extname'](_0x5bc5ba[_0xfbdb('0x6f')][_0xfbdb('0x70')]));var _0x29ceac=path[_0xfbdb('0x54')](config[_0xfbdb('0x71')],_0xfbdb('0x55'),_0x5bc5ba[_0xfbdb('0x6f')][_0xfbdb('0x70')]);var _0x1e1b60=path[_0xfbdb('0x54')](config['root'],_0xfbdb('0x55'),_0x4a6afb);logger['info'](_0xfbdb('0x72'),_0x29ceac);logger[_0xfbdb('0x6c')]('Plugin\x20upload\x20destination:\x20%s',_0x1e1b60);try{fs[_0xfbdb('0x73')](_0x29ceac,parseInt('0777',0x8));extract(_0x29ceac,{'dir':_0x1e1b60},function(_0x329d9d){if(_0x329d9d){logger[_0xfbdb('0x34')](_0x329d9d);handleError(_0x329d9d,!![]);};var _0x55e8bf=fs[_0xfbdb('0x74')](_0x1e1b60);if(_0x55e8bf[_0xfbdb('0x4e')]>0x1){removeReferences(_0x29ceac,_0x1e1b60);logger[_0xfbdb('0x34')](_0xfbdb('0x75'));return _0x454d02(new Error('Invalid\x20plugin\x20structure'));}var _0x626df9=fs[_0xfbdb('0x76')](path['join'](_0x1e1b60,_0x55e8bf[0x0]));if(_0x626df9[_0xfbdb('0x77')]()){removeReferences(_0x29ceac,_0x1e1b60);logger[_0xfbdb('0x34')]('Invalid\x20plugin\x20structure');return _0x454d02(new Error(_0xfbdb('0x75')));}if(_0x626df9[_0xfbdb('0x78')]()){var _0x3e48f6=fs[_0xfbdb('0x74')](path[_0xfbdb('0x54')](_0x1e1b60,_0x55e8bf[0x0]));if(_0x3e48f6[_0xfbdb('0x4e')]===0x0){removeReferences(_0x29ceac,_0x1e1b60);logger[_0xfbdb('0x34')](_0xfbdb('0x75'));return _0x454d02(new Error('Invalid\x20plugin\x20structure'));}var _0x4d6f28=_0x3e48f6[_0xfbdb('0x79')](function(_0x18f59c){return _0x18f59c==='manifest.json';});if(!_0x4d6f28){return _0x454d02(new Error('Plugin\x20manifest\x20missing'));}var _0x59f05a=fs['readFileSync'](path[_0xfbdb('0x54')](_0x1e1b60,_0x55e8bf[0x0],_0xfbdb('0x7a')));var _0x11da4e=JSON[_0xfbdb('0x7b')](_0x59f05a);if(_0xfbdb('0x25')==typeof _0x11da4e['name']){return _0x454d02(new Error(_0xfbdb('0x7c')));}if(_0xfbdb('0x25')==typeof _0x11da4e[_0xfbdb('0x48')]){return _0x454d02(new Error(_0xfbdb('0x7d')));}if(_0xfbdb('0x25')==typeof _0x11da4e[_0xfbdb('0x7e')]){return _0x454d02(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xfbdb('0x25')==typeof _0x11da4e['parameters']){return _0x454d02(new Error(_0xfbdb('0x7f')));}if(_0x11da4e[_0xfbdb('0x48')]==='html'){if(_0xfbdb('0x25')==typeof _0x11da4e['parameters'][_0xfbdb('0x80')]){return _0x454d02(new Error(_0xfbdb('0x81')));}if('undefined'==typeof _0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')]['admin']&&'undefined'==typeof _0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')][_0xfbdb('0x83')]){return _0x454d02(new Error(_0xfbdb('0x84')));}}else if(_0x11da4e[_0xfbdb('0x48')]===_0xfbdb('0x85')){if(_0xfbdb('0x25')==typeof _0x11da4e[_0xfbdb('0x82')]['scriptName']){return _0x454d02(new Error(_0xfbdb('0x86')));}if(_0xfbdb('0x25')==typeof _0x11da4e['parameters'][_0xfbdb('0x87')]){return _0x454d02(new Error(_0xfbdb('0x88')));}}else{return _0x454d02(new Error(_0xfbdb('0x89')));}var _0x412528=_0x11da4e[_0xfbdb('0x35')];var _0x2d922e=_0x11da4e['description'];var _0x583292=_0x11da4e['type'];var _0x3ddf17=_0x11da4e['sidebar']?_0x11da4e[_0xfbdb('0x8a')]:_0xfbdb('0x8b');var _0x148aca=_0x11da4e[_0xfbdb('0x8c')]?_0x11da4e['icon']:'icon-apps';var _0x3760d7='';var _0x59e7fc='';var _0x2ec548='';var _0x48c803='';var _0x589cce=_0x11da4e[_0xfbdb('0x7e')];if(_0x583292===_0xfbdb('0x8d')){if(_0xfbdb('0x25')!=typeof _0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')]['admin']){var _0x9aa6d7=_0x11da4e[_0xfbdb('0x82')]['views'][_0xfbdb('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0xfbdb('0x8f')](_0x9aa6d7)){_0x3760d7=path[_0xfbdb('0x54')]('plugins',_0x4a6afb,_0x55e8bf[0x0],_0x9aa6d7);}else{_0x3760d7=_0x9aa6d7;}}else{logger[_0xfbdb('0x6c')](_0xfbdb('0x90'));}if(_0xfbdb('0x25')!=typeof _0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')]['agent']){var _0x1dccba=_0x11da4e['parameters'][_0xfbdb('0x80')][_0xfbdb('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xfbdb('0x8f')](_0x1dccba)){_0x59e7fc=path['join'](_0xfbdb('0x91'),_0x4a6afb,_0x55e8bf[0x0],_0x1dccba);}else{_0x59e7fc=_0x1dccba;}}else{logger[_0xfbdb('0x6c')](_0xfbdb('0x92'));}}else if(_0x583292==='script'){_0x2ec548=_0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x93')];_0x48c803=_0x11da4e[_0xfbdb('0x82')]['scriptPath'];if(_0xfbdb('0x25')!=typeof _0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')]){if('undefined'!=typeof _0x11da4e[_0xfbdb('0x82')]['views']['admin']){var _0x9aa6d7=_0x11da4e['parameters'][_0xfbdb('0x80')][_0xfbdb('0x8e')];if(!/^(f|ht)tps?:\/\//i[_0xfbdb('0x8f')](_0x9aa6d7)){_0x3760d7=path[_0xfbdb('0x54')]('plugins',_0x4a6afb,_0x55e8bf[0x0],_0x9aa6d7);}else{_0x3760d7=_0x9aa6d7;}}if('undefined'!=typeof _0x11da4e['parameters']['views']['agent']){var _0x1dccba=_0x11da4e[_0xfbdb('0x82')][_0xfbdb('0x80')][_0xfbdb('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xfbdb('0x8f')](_0x1dccba)){_0x59e7fc=path[_0xfbdb('0x54')](_0xfbdb('0x91'),_0x4a6afb,_0x55e8bf[0x0],_0x1dccba);}else{_0x59e7fc=_0x1dccba;}}}}var _0x4ccb63={'name':_0x412528,'description':_0x2d922e,'path':path[_0xfbdb('0x54')](_0x4a6afb,_0x55e8bf[0x0]),'type':_0x583292,'sidebar':_0x3ddf17,'icon':_0x148aca,'adminUrl':_0x3760d7,'agentUrl':_0x59e7fc,'scriptName':_0x2ec548,'scriptPath':_0x48c803,'version':_0x589cce};removeReferences(_0x29ceac,null);return db[_0xfbdb('0x39')][_0xfbdb('0x94')](_0x4ccb63)[_0xfbdb('0x2e')](function(_0x38357d){var _0x4ee111={'role':_0x5bc5ba[_0xfbdb('0x95')][_0xfbdb('0x96')],'userProfileId':_0x5bc5ba[_0xfbdb('0x95')][_0xfbdb('0x97')]};if(!_0x4ee111)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ee111[_0xfbdb('0x96')]===_0xfbdb('0x98')){var _0x3699c8=_0x38357d['get']({'plain':!![]});return db[_0xfbdb('0x99')][_0xfbdb('0x51')]({'where':{'name':_0xfbdb('0x31'),'userProfileId':_0x4ee111[_0xfbdb('0x97')]},'raw':!![]})[_0xfbdb('0x2e')](function(_0x269192){if(_0x269192&&_0x269192[_0xfbdb('0x9a')]===0x0){return db[_0xfbdb('0x32')]['create']({'name':_0x3699c8[_0xfbdb('0x35')],'resourceId':_0x3699c8['id'],'type':_0x269192['name'],'sectionId':_0x269192['id']},{})['then'](function(){return _0x38357d;});}else{return _0x38357d;}})[_0xfbdb('0x4c')](function(_0x37d9e9){logger[_0xfbdb('0x34')](_0xfbdb('0x9b'),_0x37d9e9);throw _0x37d9e9;});}return _0x38357d;})[_0xfbdb('0x2e')](respondWithResult(_0x287ce6,null))[_0xfbdb('0x4c')](handleError(_0x287ce6,null));}});}catch(_0x393631){_0x287ce6[_0xfbdb('0x22')](0x1f4)[_0xfbdb('0x36')](_0x393631);}};function removeReferences(_0x422b23,_0x1b6702){try{if(_0x422b23){fs[_0xfbdb('0x6a')](_0x422b23);logger['info'](_0xfbdb('0x9c'));}if(_0x1b6702){rimraf(_0x1b6702,function(){});logger[_0xfbdb('0x6c')](_0xfbdb('0x9d'));}}catch(_0x2451b0){logger[_0xfbdb('0x34')](_0x2451b0);}}exports[_0xfbdb('0x2d')]=function(_0x1b1889,_0x5eab5e,_0x26cb08){return db[_0xfbdb('0x39')][_0xfbdb('0x51')]({'where':{'id':_0x1b1889[_0xfbdb('0x53')]['id']}})['then'](handleEntityNotFound(_0x5eab5e,null))[_0xfbdb('0x2e')](saveUpdates(_0x1b1889[_0xfbdb('0x95')],null))[_0xfbdb('0x2e')](respondWithResult(_0x5eab5e,null))[_0xfbdb('0x4c')](handleError(_0x5eab5e,null));};exports['delete']=function(_0x2864bf,_0x530d5d,_0x2bb733){return db[_0xfbdb('0x39')]['find']({'where':{'id':_0x2864bf[_0xfbdb('0x53')]['id']}})['then'](function(_0x55b2b7){if(_0x55b2b7){return _0x55b2b7[_0xfbdb('0x2f')]();}})[_0xfbdb('0x2e')](function(_0x762bc5){rimraf(path[_0xfbdb('0x54')](config[_0xfbdb('0x71')],'server/files/plugins',path[_0xfbdb('0x62')](_0x762bc5[_0xfbdb('0x8')])),function(){});return _0x762bc5;})['then'](handleEntityNotFound(_0x530d5d,null))[_0xfbdb('0x2e')](respondWithStatusCode(_0x530d5d,null))['catch'](handleError(_0x530d5d,null));};exports[_0xfbdb('0x9e')]=function(_0x1f350c,_0x5e07d3,_0x14ffcc){return BPromise[_0xfbdb('0x9f')]()['then'](function(){if(!_0x1f350c[_0xfbdb('0x3d')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1f350c['query'][_0xfbdb('0xa0')]){throw new Error(_0xfbdb('0xa1'));}var _0x469105=_0x1f350c['query'][_0xfbdb('0xa2')]?_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0xa2')]+':'+_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0xa0')]:_0xfbdb('0xa3')+_0x1f350c[_0xfbdb('0x3d')]['port'];var _0x25c465=_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0x2a')]?_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0x2a')]:!![];var _0x4139c5=_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0xa4')]?_0x1f350c['query'][_0xfbdb('0xa4')]:null;var _0x185c70={'method':_0x1f350c[_0xfbdb('0xa5')],'uri':util[_0xfbdb('0xa6')](_0xfbdb('0xa7'),_0x469105,_0x1f350c[_0xfbdb('0x3d')][_0xfbdb('0x8')]),'json':_0x25c465,'resolveWithFullResponse':!![],'encoding':_0x4139c5,'qs':_0x1f350c[_0xfbdb('0x3d')]};if(_0x1f350c[_0xfbdb('0xa8')]){_0x185c70['headers']=_0x1f350c['headers'];if(_0x185c70[_0xfbdb('0xa8')][_0xfbdb('0xa9')]){delete _0x185c70[_0xfbdb('0xa8')][_0xfbdb('0xa9')];}}if(_0x185c70[_0xfbdb('0xa8')]['content-type']){delete _0x185c70['headers']['content-type'];}return rp(_0x185c70);})['then'](function(_0x474b10){if(_0x474b10){_0x5e07d3[_0xfbdb('0x28')](_0x474b10[_0xfbdb('0xa8')]);logger['info'](_0x474b10[_0xfbdb('0x95')]);if(_[_0xfbdb('0xaa')](_0x1f350c['query'][_0xfbdb('0x8')],_0xfbdb('0x52'))&&_0x474b10[_0xfbdb('0xab')]==0x1f4){return _0x5e07d3[_0xfbdb('0x33')](_0x474b10[_0xfbdb('0xab')]);}else{return _0x5e07d3[_0xfbdb('0x22')](_0x474b10['statusCode'])[_0xfbdb('0x36')](_0x474b10['body']);}}else{return _0x5e07d3[_0xfbdb('0x33')](0xc8);}})[_0xfbdb('0x4c')](handleError(_0x5e07d3,null));};exports[_0xfbdb('0xac')]=function(_0xb2205f,_0xfdb8a0,_0x7bb92){return BPromise[_0xfbdb('0x9f')]()[_0xfbdb('0x2e')](function(){if(!_0xb2205f[_0xfbdb('0x3d')][_0xfbdb('0x8')]){throw new Error(_0xfbdb('0xad'));}if(!_0xb2205f[_0xfbdb('0x3d')][_0xfbdb('0xa0')]){throw new Error(_0xfbdb('0xa1'));}var _0x110373=_0xb2205f['query'][_0xfbdb('0xa2')]?_0xb2205f[_0xfbdb('0x3d')]['hostname']+':'+_0xb2205f[_0xfbdb('0x3d')][_0xfbdb('0xa0')]:'http://localhost:'+_0xb2205f[_0xfbdb('0x3d')]['port'];var _0x1d729b=_0xb2205f['query'][_0xfbdb('0x2a')]?_0xb2205f[_0xfbdb('0x3d')]['json']:!![];var _0x2f7a6b=_0xb2205f['query']['encoding']?_0xb2205f['query'][_0xfbdb('0xa4')]:null;var _0x218d44={'method':_0xb2205f['method'],'uri':util[_0xfbdb('0xa6')](_0xfbdb('0xa7'),_0x110373,_0xb2205f[_0xfbdb('0x3d')]['path']),'json':_0x1d729b,'resolveWithFullResponse':!![],'encoding':_0x2f7a6b,'body':_0xb2205f[_0xfbdb('0x95')]};if(_0xb2205f[_0xfbdb('0xa8')]){_0x218d44['headers']=_0xb2205f['headers'];if(_0x218d44[_0xfbdb('0xa8')]['content-length']){delete _0x218d44[_0xfbdb('0xa8')][_0xfbdb('0xa9')];}}if(_0x218d44[_0xfbdb('0xa8')][_0xfbdb('0xae')]){delete _0x218d44[_0xfbdb('0xa8')][_0xfbdb('0xae')];}return rp(_0x218d44);})[_0xfbdb('0x2e')](function(_0x573ec3){if(_0x573ec3){_0xfdb8a0[_0xfbdb('0x28')](_0x573ec3[_0xfbdb('0xa8')]);logger[_0xfbdb('0x6c')](_0x573ec3[_0xfbdb('0x95')]);return _0xfdb8a0[_0xfbdb('0x22')](_0x573ec3[_0xfbdb('0xab')])['send'](_0x573ec3['body']);}else{return _0xfdb8a0['sendStatus'](0xc8);}})[_0xfbdb('0x4c')](handleError(_0xfdb8a0,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 9c79a92..2062220 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 _0xf360=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','save'];(function(_0x49fc33,_0x517141){var _0x3524e3=function(_0x3d1fe1){while(--_0x3d1fe1){_0x49fc33['push'](_0x49fc33['shift']());}};_0x3524e3(++_0x517141);}(_0xf360,0x9e));var _0x0f36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf360[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x0f36('0x0'));var Plugin=require(_0x0f36('0x1'))['db'][_0x0f36('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f36('0x3'),'afterUpdate':'update','afterDestroy':_0x0f36('0x4')};function emitEvent(_0x2906c1){return function(_0x181766,_0x5e1019,_0x43fb76){PluginEvents[_0x0f36('0x5')](_0x2906c1+':'+_0x181766['id'],_0x181766);PluginEvents[_0x0f36('0x5')](_0x2906c1,_0x181766);_0x43fb76(null);};}for(var e in events){if(events[_0x0f36('0x6')](e)){var event=events[e];Plugin[_0x0f36('0x7')](e,emitEvent(event));}}module[_0x0f36('0x8')]=PluginEvents; \ No newline at end of file +var _0x48e3=['../../mysqldb','setMaxListeners','remove','emit','hook','events'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x48e3,0xe9));var _0x348e=function(_0x227fb1,_0x216662){_0x227fb1=_0x227fb1-0x0;var _0x59081a=_0x48e3[_0x227fb1];return _0x59081a;};'use strict';var EventEmitter=require(_0x348e('0x0'));var Plugin=require(_0x348e('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x348e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x348e('0x3')};function emitEvent(_0x52d228){return function(_0xf98d97,_0x1250c0,_0x580d4d){PluginEvents[_0x348e('0x4')](_0x52d228+':'+_0xf98d97['id'],_0xf98d97);PluginEvents['emit'](_0x52d228,_0xf98d97);_0x580d4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x348e('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 296691b..afb650e 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 _0xf3b1=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','lodash'];(function(_0x42e6e7,_0x1fb21e){var _0xea9870=function(_0x729e60){while(--_0x729e60){_0x42e6e7['push'](_0x42e6e7['shift']());}};_0xea9870(++_0x1fb21e);}(_0xf3b1,0x137));var _0x1f3b=function(_0x2d9762,_0x52dfb6){_0x2d9762=_0x2d9762-0x0;var _0x21cf65=_0xf3b1[_0x2d9762];return _0x21cf65;};'use strict';var _=require(_0x1f3b('0x0'));var util=require(_0x1f3b('0x1'));var logger=require(_0x1f3b('0x2'))(_0x1f3b('0x3'));var moment=require(_0x1f3b('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f3b('0x5'));var fs=require('fs');var path=require(_0x1f3b('0x6'));var rimraf=require(_0x1f3b('0x7'));var config=require(_0x1f3b('0x8'));var attributes=require(_0x1f3b('0x9'));module['exports']=function(_0x5f0f80,_0x1c2f19){return _0x5f0f80[_0x1f3b('0xa')](_0x1f3b('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x291b=['../../config/logger','api','moment','bluebird','../../config/environment','exports','define','Plugin','plugins','lodash','util'];(function(_0x1e2372,_0x2ea876){var _0x4cd59b=function(_0x5d85cd){while(--_0x5d85cd){_0x1e2372['push'](_0x1e2372['shift']());}};_0x4cd59b(++_0x2ea876);}(_0x291b,0x98));var _0xb291=function(_0x525e56,_0x1f0f2f){_0x525e56=_0x525e56-0x0;var _0x525252=_0x291b[_0x525e56];return _0x525252;};'use strict';var _=require(_0xb291('0x0'));var util=require(_0xb291('0x1'));var logger=require(_0xb291('0x2'))(_0xb291('0x3'));var moment=require(_0xb291('0x4'));var BPromise=require(_0xb291('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb291('0x6'));var attributes=require('./plugin.attributes');module[_0xb291('0x7')]=function(_0x98637,_0x429a12){return _0x98637[_0xb291('0x8')](_0xb291('0x9'),attributes,{'tableName':_0xb291('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 c720bcf..af334ea 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 _0xdda7=['code','error','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','http','redis','defaults','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1ca995,_0x458edc){var _0x6c1cbb=function(_0x109124){while(--_0x109124){_0x1ca995['push'](_0x1ca995['shift']());}};_0x6c1cbb(++_0x458edc);}(_0xdda7,0x184));var _0x7dda=function(_0x46852d,_0x3fce4f){_0x46852d=_0x46852d-0x0;var _0x40c05a=_0xdda7[_0x46852d];return _0x40c05a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7dda('0x0'));var BPromise=require(_0x7dda('0x1'));var rs=require(_0x7dda('0x2'));var fs=require('fs');var Redis=require(_0x7dda('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7dda('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7dda('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7dda('0x6')]({'port':0x232a});config[_0x7dda('0x7')]=_[_0x7dda('0x8')](config['redis'],{'host':_0x7dda('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0x7dda('0xa')](socket);function respondWithRpcPromise(_0xa21e8e,_0x1232d7,_0x610c5f){return new BPromise(function(_0x41354d,_0x5edfc4){return client[_0x7dda('0xb')](_0xa21e8e,_0x610c5f)[_0x7dda('0xc')](function(_0x261b1a){logger[_0x7dda('0xd')](_0x7dda('0xe'),_0x1232d7,_0x7dda('0xf'));logger[_0x7dda('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x1232d7,_0x7dda('0xf'),JSON[_0x7dda('0x11')](_0x261b1a));if(_0x261b1a['error']){if(_0x261b1a['error'][_0x7dda('0x12')]===0x1f4){logger[_0x7dda('0x13')]('Plugin,\x20%s,\x20%s',_0x1232d7,_0x261b1a[_0x7dda('0x13')][_0x7dda('0x14')]);return _0x5edfc4(_0x261b1a[_0x7dda('0x13')]['message']);}logger[_0x7dda('0x13')](_0x7dda('0xe'),_0x1232d7,_0x261b1a['error'][_0x7dda('0x14')]);return _0x41354d(_0x261b1a['error'][_0x7dda('0x14')]);}else{logger[_0x7dda('0xd')]('Plugin,\x20%s,\x20%s',_0x1232d7,_0x7dda('0xf'));_0x41354d(_0x261b1a[_0x7dda('0x15')][_0x7dda('0x14')]);}})[_0x7dda('0x16')](function(_0x356b47){logger['error'](_0x7dda('0xe'),_0x1232d7,_0x356b47);_0x5edfc4(_0x356b47);});});}exports['CreatePlugin']=function(_0x497583){var _0x1558c0=this;return new Promise(function(_0x141306,_0x2fa167){return db[_0x7dda('0x17')][_0x7dda('0x18')](_0x497583[_0x7dda('0x19')],{'raw':_0x497583[_0x7dda('0x1a')]?_0x497583[_0x7dda('0x1a')][_0x7dda('0x1b')]===undefined?!![]:![]:!![]})[_0x7dda('0xc')](function(_0x31bba0){logger[_0x7dda('0xd')](_0x7dda('0x1c'),_0x497583);logger[_0x7dda('0x10')](_0x7dda('0x1c'),_0x497583,JSON[_0x7dda('0x11')](_0x31bba0));_0x141306(_0x31bba0);})[_0x7dda('0x16')](function(_0x2b9c11){logger[_0x7dda('0x13')]('CreatePlugin',_0x2b9c11[_0x7dda('0x14')],_0x497583);_0x2fa167(_0x1558c0[_0x7dda('0x13')](0x1f4,_0x2b9c11[_0x7dda('0x14')]));});});}; \ No newline at end of file +var _0xcef6=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','then','info','request\x20sent','stringify','error','code','Plugin,\x20%s,\x20%s','message','Plugin','create','body','options','raw','CreatePlugin','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4611bb,_0x16f2a7){var _0x4ab34a=function(_0x2f28c6){while(--_0x2f28c6){_0x4611bb['push'](_0x4611bb['shift']());}};_0x4ab34a(++_0x16f2a7);}(_0xcef6,0x16e));var _0x6cef=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xcef6[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require(_0x6cef('0x0'));var util=require(_0x6cef('0x1'));var moment=require(_0x6cef('0x2'));var BPromise=require(_0x6cef('0x3'));var rs=require(_0x6cef('0x4'));var fs=require('fs');var Redis=require(_0x6cef('0x5'));var db=require(_0x6cef('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6cef('0x7'));var config=require(_0x6cef('0x8'));var jayson=require(_0x6cef('0x9'));var client=jayson[_0x6cef('0xa')][_0x6cef('0xb')]({'port':0x232a});config[_0x6cef('0xc')]=_[_0x6cef('0xd')](config[_0x6cef('0xc')],{'host':_0x6cef('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6cef('0xc')]));require(_0x6cef('0xf'))['register'](socket);function respondWithRpcPromise(_0x2b2ef0,_0x1f27b8,_0x4e293a){return new BPromise(function(_0x5723ea,_0x4b813c){return client['request'](_0x2b2ef0,_0x4e293a)[_0x6cef('0x10')](function(_0x55780c){logger[_0x6cef('0x11')]('Plugin,\x20%s,\x20%s',_0x1f27b8,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x1f27b8,_0x6cef('0x12'),JSON[_0x6cef('0x13')](_0x55780c));if(_0x55780c[_0x6cef('0x14')]){if(_0x55780c[_0x6cef('0x14')][_0x6cef('0x15')]===0x1f4){logger['error'](_0x6cef('0x16'),_0x1f27b8,_0x55780c['error']['message']);return _0x4b813c(_0x55780c[_0x6cef('0x14')]['message']);}logger['error'](_0x6cef('0x16'),_0x1f27b8,_0x55780c['error'][_0x6cef('0x17')]);return _0x5723ea(_0x55780c[_0x6cef('0x14')][_0x6cef('0x17')]);}else{logger[_0x6cef('0x11')]('Plugin,\x20%s,\x20%s',_0x1f27b8,'request\x20sent');_0x5723ea(_0x55780c['result'][_0x6cef('0x17')]);}})['catch'](function(_0xd7706d){logger[_0x6cef('0x14')]('Plugin,\x20%s,\x20%s',_0x1f27b8,_0xd7706d);_0x4b813c(_0xd7706d);});});}exports['CreatePlugin']=function(_0x12fe9d){var _0x3c587c=this;return new Promise(function(_0x3fdb76,_0x936773){return db[_0x6cef('0x18')][_0x6cef('0x19')](_0x12fe9d[_0x6cef('0x1a')],{'raw':_0x12fe9d[_0x6cef('0x1b')]?_0x12fe9d[_0x6cef('0x1b')][_0x6cef('0x1c')]===undefined?!![]:![]:!![]})[_0x6cef('0x10')](function(_0x13fed5){logger['info'](_0x6cef('0x1d'),_0x12fe9d);logger['debug'](_0x6cef('0x1d'),_0x12fe9d,JSON[_0x6cef('0x13')](_0x13fed5));_0x3fdb76(_0x13fed5);})[_0x6cef('0x1e')](function(_0x2220bc){logger[_0x6cef('0x14')](_0x6cef('0x1d'),_0x2220bc[_0x6cef('0x17')],_0x12fe9d);_0x936773(_0x3c587c[_0x6cef('0x14')](0x1f4,_0x2220bc[_0x6cef('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 7056de7..bab4c18 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 _0xc94d=['remove','update','removeListener','register','length','plugin:','./plugin.events'];(function(_0x36ee36,_0xdf9e87){var _0xb2d25c=function(_0x3820a9){while(--_0x3820a9){_0x36ee36['push'](_0x36ee36['shift']());}};_0xb2d25c(++_0xdf9e87);}(_0xc94d,0x1b1));var _0xdc94=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc94d[_0x14add3];return _0x4a174f;};'use strict';var PluginEvents=require(_0xdc94('0x0'));var events=['save',_0xdc94('0x1'),_0xdc94('0x2')];function createListener(_0x1fbbd0,_0x4d5eee){return function(_0x423560){_0x4d5eee['emit'](_0x1fbbd0,_0x423560);};}function removeListener(_0xa13690,_0x5f5483){return function(){PluginEvents[_0xdc94('0x3')](_0xa13690,_0x5f5483);};}exports[_0xdc94('0x4')]=function(_0x27341c){for(var _0x116dce=0x0,_0x45a0ad=events[_0xdc94('0x5')];_0x116dce<_0x45a0ad;_0x116dce++){var _0x590809=events[_0x116dce];var _0x37f8b4=createListener(_0xdc94('0x6')+_0x590809,_0x27341c);PluginEvents['on'](_0x590809,_0x37f8b4);}}; \ No newline at end of file +var _0xd294=['update','emit','removeListener','length'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd294,0x174));var _0x4d29=function(_0x3a63fd,_0x587403){_0x3a63fd=_0x3a63fd-0x0;var _0x57cae3=_0xd294[_0x3a63fd];return _0x57cae3;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0x4d29('0x0')];function createListener(_0x204ba7,_0x3e336f){return function(_0x15e4e2){_0x3e336f[_0x4d29('0x1')](_0x204ba7,_0x15e4e2);};}function removeListener(_0x1cd9a1,_0x42d4f0){return function(){PluginEvents[_0x4d29('0x2')](_0x1cd9a1,_0x42d4f0);};}exports['register']=function(_0x210005){for(var _0x4c8992=0x0,_0x1740f9=events[_0x4d29('0x3')];_0x4c8992<_0x1740f9;_0x4c8992++){var _0x3768bb=events[_0x4c8992];var _0x2a4dee=createListener('plugin:'+_0x3768bb,_0x210005);PluginEvents['on'](_0x3768bb,_0x2a4dee);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index dc253c1..8c41b9b 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(_0x370ab6,_0x394181){var _0x437ca0=function(_0x41d305){while(--_0x41d305){_0x370ab6['push'](_0x370ab6['shift']());}};_0x437ca0(++_0x394181);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x25fc5f,_0x23a454){var _0x5ebcfa=function(_0x2f0e67){while(--_0x2f0e67){_0x25fc5f['push'](_0x25fc5f['shift']());}};_0x5ebcfa(++_0x23a454);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./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 495749a..42a29db 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 _0x2dae=['stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error'];(function(_0x2ecf03,_0x2adccf){var _0x4418ab=function(_0x201f87){while(--_0x201f87){_0x2ecf03['push'](_0x2ecf03['shift']());}};_0x4418ab(++_0x2adccf);}(_0x2dae,0xc3));var _0xe2da=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x2dae[_0xcfc44];return _0x307a25;};'use strict';var _=require(_0xe2da('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var path=require(_0xe2da('0x3'));var exec=require(_0xe2da('0x4'))[_0xe2da('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x25b9f2,_0x439b5d){return function(_0x77e45e){if(!_0x77e45e){_0x25b9f2[_0xe2da('0x6')](0x194);;}return _0x77e45e;};}function respondWithResult(_0x523c60,_0x3e3e25){_0x3e3e25=_0x3e3e25||0xc8;return function(_0x89c70b){if(_0x89c70b){return _0x523c60[_0xe2da('0x7')](_0x3e3e25)[_0xe2da('0x8')](_0x89c70b);}return null;};}function handleError(_0x238da3,_0x1c71ea){_0x1c71ea=_0x1c71ea||0x1f4;return function(_0x29960a){logger[_0xe2da('0x9')](_0x29960a[_0xe2da('0xa')]);if(_0x29960a['name']){delete _0x29960a[_0xe2da('0xb')];}_0x238da3[_0xe2da('0x7')](_0x1c71ea)[_0xe2da('0xc')](_0x29960a);};}function execChildProcess(){return new BPromise(function(_0x17086c,_0x3c1309){exec(_0xe2da('0xd'),function(_0x1a29b9,_0x173244,_0x5aab71){logger[_0xe2da('0xe')](_0x173244);logger['info'](_0x5aab71);if(_0x1a29b9){logger[_0xe2da('0x9')](_0x1a29b9);return _0x3c1309(_0x1a29b9);}return _0x17086c(_0x173244);});});}exports[_0xe2da('0xf')]=function(_0x37064e,_0x411b9f){return pm2[_0xe2da('0x10')]()[_0xe2da('0x11')](function(_0x295a86){if(_0x295a86){var _0x48584b=_[_0xe2da('0x12')](_0x295a86,function(_0x5e1702){return _0x5e1702['name']===_0xe2da('0x13')||_0x5e1702[_0xe2da('0xb')]===_0xe2da('0x14');});return{'rows':_0x48584b,'count':_0x48584b['length']};}return null;})[_0xe2da('0x11')](respondWithResult(_0x411b9f,null))[_0xe2da('0x15')](handleError(_0x411b9f,null));};exports[_0xe2da('0x16')]=function(_0x33568f,_0x4e1623){return pm2[_0xe2da('0x17')](_0x33568f[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x4e1623,null))[_0xe2da('0x11')](handleEntityNotFound(_0x4e1623,null))[_0xe2da('0x15')](handleError(_0x4e1623,null));};exports['create']=function(_0x56eeb1,_0x2e16b2){if(_0x56eeb1['body'][_0xe2da('0xb')]&&_0x56eeb1[_0xe2da('0x19')][_0xe2da('0x1a')]){var _0x203d36=path[_0xe2da('0x1b')](__dirname,_0xe2da('0x1c'),_0x56eeb1['body'][_0xe2da('0x1a')]);var _0x53cc4e=process[_0xe2da('0x1d')]();process[_0xe2da('0x1e')](path[_0xe2da('0x1f')](_0x203d36));return execChildProcess()[_0xe2da('0x11')](function(_0x30dea4){process[_0xe2da('0x1e')](_0x53cc4e);return pm2[_0xe2da('0x20')]({'name':_0x56eeb1[_0xe2da('0x19')]['name'],'script':_0x203d36});})[_0xe2da('0x11')](function(_0x357bff){pm2[_0xe2da('0x21')]();return _0x357bff[0x0];})[_0xe2da('0x11')](respondWithResult(_0x2e16b2,0xc9))[_0xe2da('0x15')](handleError(_0x2e16b2,null));}else{return _0x2e16b2[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xe2da('0x22')]=function(_0x3e23d7,_0x1dc228){if(_0x3e23d7[_0xe2da('0x19')]['id']){delete _0x3e23d7[_0xe2da('0x19')]['id'];}var _0x2b6c9e={'online':_0xe2da('0x23'),'stopped':_0xe2da('0x24')};if(_0x2b6c9e['hasOwnProperty'](_0x3e23d7['body']['status'])){return pm2[_0x2b6c9e[_0x3e23d7[_0xe2da('0x19')][_0xe2da('0x7')]]](_0x3e23d7[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x1dc228,0xc8))['catch'](handleError(_0x1dc228,null));}else{return _0x1dc228['status'](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x25')});}};exports[_0xe2da('0x26')]=function(_0x39f983,_0x7ab5ee){if(_0x39f983[_0xe2da('0x19')]['id']){delete _0x39f983[_0xe2da('0x19')]['id'];}if(_0x39f983[_0xe2da('0x18')]['id']){return pm2[_0xe2da('0x27')](_0x39f983['params']['id'])['then'](function(_0x672767){pm2[_0xe2da('0x21')]();return _0x672767[0x0];})[_0xe2da('0x11')](respondWithResult(_0x7ab5ee,null))[_0xe2da('0x15')](handleError(_0x7ab5ee,null));}else{return _0x7ab5ee[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x28')});}}; \ No newline at end of file +var _0xd2ea=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path'];(function(_0x591a86,_0x10cabd){var _0x23f775=function(_0x9ca226){while(--_0x9ca226){_0x591a86['push'](_0x591a86['shift']());}};_0x23f775(++_0x10cabd);}(_0xd2ea,0x15f));var _0xad2e=function(_0x33ce55,_0x5141d0){_0x33ce55=_0x33ce55-0x0;var _0x4ee7cb=_0xd2ea[_0x33ce55];return _0x4ee7cb;};'use strict';var _=require(_0xad2e('0x0'));var pm2=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var path=require(_0xad2e('0x4'));var exec=require('child_process')[_0xad2e('0x5')];var BPromise=require(_0xad2e('0x6'));function handleEntityNotFound(_0xcba7cb,_0x3e0741){return function(_0x2afdc4){if(!_0x2afdc4){_0xcba7cb[_0xad2e('0x7')](0x194);;}return _0x2afdc4;};}function respondWithResult(_0x29e97f,_0x592e8b){_0x592e8b=_0x592e8b||0xc8;return function(_0x3b5170){if(_0x3b5170){return _0x29e97f[_0xad2e('0x8')](_0x592e8b)[_0xad2e('0x9')](_0x3b5170);}return null;};}function handleError(_0x5710ac,_0x1e0e9e){_0x1e0e9e=_0x1e0e9e||0x1f4;return function(_0x19bb0d){logger['error'](_0x19bb0d[_0xad2e('0xa')]);if(_0x19bb0d['name']){delete _0x19bb0d[_0xad2e('0xb')];}_0x5710ac[_0xad2e('0x8')](_0x1e0e9e)[_0xad2e('0xc')](_0x19bb0d);};}function execChildProcess(){return new BPromise(function(_0x24c5da,_0x489f25){exec(_0xad2e('0xd'),function(_0x5707a5,_0x42d2ac,_0x347559){logger[_0xad2e('0xe')](_0x42d2ac);logger[_0xad2e('0xe')](_0x347559);if(_0x5707a5){logger['error'](_0x5707a5);return _0x489f25(_0x5707a5);}return _0x24c5da(_0x42d2ac);});});}exports[_0xad2e('0xf')]=function(_0x59201f,_0x1a91ce){return pm2['list']()['then'](function(_0x4a812b){if(_0x4a812b){var _0x5c96a7=_[_0xad2e('0x10')](_0x4a812b,function(_0x282780){return _0x282780[_0xad2e('0xb')]===_0xad2e('0x11')||_0x282780[_0xad2e('0xb')]===_0xad2e('0x12');});return{'rows':_0x5c96a7,'count':_0x5c96a7[_0xad2e('0x13')]};}return null;})[_0xad2e('0x14')](respondWithResult(_0x1a91ce,null))[_0xad2e('0x15')](handleError(_0x1a91ce,null));};exports[_0xad2e('0x16')]=function(_0x2af208,_0x39c5e4){return pm2[_0xad2e('0x17')](_0x2af208[_0xad2e('0x18')]['id'])[_0xad2e('0x14')](respondWithResult(_0x39c5e4,null))['then'](handleEntityNotFound(_0x39c5e4,null))[_0xad2e('0x15')](handleError(_0x39c5e4,null));};exports[_0xad2e('0x19')]=function(_0x489585,_0x50eb1a){if(_0x489585['body']['name']&&_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]){var _0x5549db=path[_0xad2e('0x1c')](__dirname,_0xad2e('0x1d'),_0x489585[_0xad2e('0x1a')][_0xad2e('0x1b')]);var _0x23c0b6=process[_0xad2e('0x1e')]();process[_0xad2e('0x1f')](path[_0xad2e('0x20')](_0x5549db));return execChildProcess()[_0xad2e('0x14')](function(_0xd907a9){process[_0xad2e('0x1f')](_0x23c0b6);return pm2[_0xad2e('0x21')]({'name':_0x489585[_0xad2e('0x1a')]['name'],'script':_0x5549db});})[_0xad2e('0x14')](function(_0x2e8887){pm2[_0xad2e('0x22')]();return _0x2e8887[0x0];})[_0xad2e('0x14')](respondWithResult(_0x50eb1a,0xc9))[_0xad2e('0x15')](handleError(_0x50eb1a,null));}else{return _0x50eb1a[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x23')});}};exports[_0xad2e('0x24')]=function(_0x50d446,_0x356a19){if(_0x50d446['body']['id']){delete _0x50d446[_0xad2e('0x1a')]['id'];}var _0x28ef72={'online':_0xad2e('0x25'),'stopped':_0xad2e('0x26')};if(_0x28ef72[_0xad2e('0x27')](_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')])){return pm2[_0x28ef72[_0x50d446[_0xad2e('0x1a')][_0xad2e('0x8')]]](_0x50d446[_0xad2e('0x18')]['id'])['then'](respondWithResult(_0x356a19,0xc8))[_0xad2e('0x15')](handleError(_0x356a19,null));}else{return _0x356a19[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':_0xad2e('0x28')});}};exports[_0xad2e('0x29')]=function(_0x9b4a23,_0x409f58){if(_0x9b4a23[_0xad2e('0x1a')]['id']){delete _0x9b4a23[_0xad2e('0x1a')]['id'];}if(_0x9b4a23[_0xad2e('0x18')]['id']){return pm2[_0xad2e('0x2a')](_0x9b4a23['params']['id'])[_0xad2e('0x14')](function(_0x55e1dc){pm2[_0xad2e('0x22')]();return _0x55e1dc[0x0];})[_0xad2e('0x14')](respondWithResult(_0x409f58,null))[_0xad2e('0x15')](handleError(_0x409f58,null));}else{return _0x409f58[_0xad2e('0x8')](0x1f4)[_0xad2e('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 76b3c06..4b80276 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 _0x7484=['/queues','getQueues','exports','express','Router','../../components/auth/service','get','/agents','isAuthenticated','getAgents'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0x7484,0x17f));var _0x4748=function(_0x2d736e,_0x5ef3ee){_0x2d736e=_0x2d736e-0x0;var _0x2231c8=_0x7484[_0x2d736e];return _0x2231c8;};'use strict';var express=require(_0x4748('0x0'));var router=express[_0x4748('0x1')]();var auth=require(_0x4748('0x2'));var controller=require('./realtime.controller');router[_0x4748('0x3')](_0x4748('0x4'),auth[_0x4748('0x5')](),controller[_0x4748('0x6')]);router['get'](_0x4748('0x7'),auth[_0x4748('0x5')](),controller[_0x4748('0x8')]);module[_0x4748('0x9')]=router; \ No newline at end of file +var _0xf826=['Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','express'];(function(_0x1e3334,_0x5cbea4){var _0x3728de=function(_0x367a37){while(--_0x367a37){_0x1e3334['push'](_0x1e3334['shift']());}};_0x3728de(++_0x5cbea4);}(_0xf826,0x11f));var _0x6f82=function(_0x5c9520,_0x2c9380){_0x5c9520=_0x5c9520-0x0;var _0x2dd5ba=_0xf826[_0x5c9520];return _0x2dd5ba;};'use strict';var express=require(_0x6f82('0x0'));var router=express[_0x6f82('0x1')]();var auth=require(_0x6f82('0x2'));var controller=require(_0x6f82('0x3'));router[_0x6f82('0x4')](_0x6f82('0x5'),auth[_0x6f82('0x6')](),controller[_0x6f82('0x7')]);router[_0x6f82('0x4')]('/queues',auth[_0x6f82('0x6')](),controller['getQueues']);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index cd2d295..a3a403a 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 _0x6453=['../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','offset','undefined','limit','count','status','Content-Range','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','globalStatus','sort','validateSortParameter','getUpdatedSortOptions','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','role','raw','sequelize','literal','forEach','*pause','Pause','push','where','merge','user','userProfileId','Agents','agent','User','findAndCountAll','find','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','split','pick','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','Queue','voice','outbound','dialActive','dialMethod','getOptions','QueueCampaigns','startCase','Queues','name','filter','UserProfile','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents'];(function(_0x58e4cb,_0x322bbc){var _0x3b8a49=function(_0xbd9d4){while(--_0xbd9d4){_0x58e4cb['push'](_0x58e4cb['shift']());}};_0x3b8a49(++_0x322bbc);}(_0x6453,0x1ef));var _0x3645=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x6453[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require(_0x3645('0x0'));var util=require(_0x3645('0x1'));var rta=require(_0x3645('0x2'));var rtq=require(_0x3645('0x3'));var qs=require(_0x3645('0x4'));var utils=require(_0x3645('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x3645('0x6'))[_0x3645('0x7')];var APIHandleError=require(_0x3645('0x6'))['handleError'];function respondWithFilteredResult(_0x1c4c5c,_0x1615f3){return function(_0x33d294){if(_0x33d294){var _0x150e00=typeof _0x1615f3[_0x3645('0x8')]===_0x3645('0x9')&&typeof _0x1615f3[_0x3645('0xa')]===_0x3645('0x9');var _0x35891a=_0x33d294[_0x3645('0xb')];var _0xb9c62a=_0x150e00?0x0:_0x1615f3[_0x3645('0x8')];var _0x50daa9=_0x150e00?_0x33d294['count']:_0x1615f3[_0x3645('0x8')]+_0x1615f3[_0x3645('0xa')];var _0x1bb1be;if(_0x50daa9>=_0x35891a){_0x50daa9=_0x35891a;_0x1bb1be=0xc8;}else{_0x1bb1be=0xce;}_0x1c4c5c[_0x3645('0xc')](_0x1bb1be);return _0x1c4c5c['set'](_0x3645('0xd'),_0xb9c62a+'-'+_0x50daa9+'/'+_0x35891a)['json'](_0x33d294);}return null;};}exports[_0x3645('0xe')]=function(_0x3575ec,_0x2a80c7){var _0x2310ee={'count':0x0,'rows':[]};var _0x1fc7be={};var _0x5b12cf;var _0x3f4cc1=utils[_0x3645('0xf')]();var _0x20766c;var _0x2cf053;var _0x4d8eec=_0x3575ec[_0x3645('0x10')][_0x3645('0x11')];var _0x4cfc6b=_0x3575ec[_0x3645('0x10')][_0x3645('0x12')];var _0x2fb25a=_0x3575ec[_0x3645('0x10')][_0x3645('0x13')];var _0x94972=_0x4cfc6b===_0x3645('0x14')||_0x4cfc6b==='*pause'?!![]:![];var _0x407a96=[];var _0x15cfde;var _0x3785a3;Promise[_0x3645('0x15')]()[_0x3645('0x16')](function(){if(_0x3575ec[_0x3645('0x10')][_0x3645('0x17')]){if(!utils[_0x3645('0x18')](_0x3575ec[_0x3645('0x10')]['channel'])){throw new APIBadRequestError(util[_0x3645('0x19')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3575ec[_0x3645('0x10')][_0x3645('0x17')]));}_0x5b12cf=_0x3575ec[_0x3645('0x10')][_0x3645('0x17')]['toLowerCase']();}if(!_0x3575ec[_0x3645('0x10')]['sort']||!_0x3575ec['query']['sort']['includes'](_0x3645('0x1a'))){_0x3575ec['query'][_0x3645('0x1b')]=rta[_0x3645('0x1c')](_0x3575ec[_0x3645('0x10')]['sort']);return;}var _0x43dd4d=rta[_0x3645('0x1d')](_0x3575ec[_0x3645('0x10')][_0x3645('0x1b')]);_0x3575ec['query']['sort']=_0x43dd4d[_0x3645('0x1e')]['join'](',');_0x15cfde=_0x43dd4d[_0x3645('0x1f')];})['then'](function(){if(!_0x4d8eec){return[];}return rta[_0x3645('0x20')](_0x4d8eec,_0x5b12cf);})['then'](function(_0x67d0d8){_0x407a96=_0x67d0d8;return rta[_0x3645('0x21')]();})[_0x3645('0x16')](function(_0x126838){_0x2cf053=_0x126838[_0x3645('0x22')];if((!_0x4cfc6b||_0x94972)&&!_0x15cfde){return _0x407a96;}if(_0x15cfde&&!_0x4cfc6b){return rta[_0x3645('0x23')](_0x2cf053,_0x407a96,_0x15cfde);}else{return rta[_0x3645('0x24')](_0x2cf053,_0x407a96,_0x4cfc6b);}})[_0x3645('0x16')](function(_0x3d938f){_0x407a96=_0x3d938f;var _0x4d5080=![];if(_0x407a96[_0x3645('0x25')]===0x0){if(_0x4d8eec||_0x4cfc6b){_0x4d5080=!![];}if(_0x94972){_0x4d5080=![];}}if(_0x4d5080){return _0x2310ee;}var _0x40d952=_[_0x3645('0x26')](db['User'][_0x3645('0x27')],function(_0x6becdc){return{'name':_0x6becdc[_0x3645('0x28')],'type':_0x6becdc[_0x3645('0x29')]['key']};});_0x3575ec[_0x3645('0x10')][_0x3645('0x2a')]='agent';_0x3575ec[_0x3645('0x10')]['online']=!![];_0x1fc7be=qs['getOptions'](_0x40d952,_0x3575ec);_0x1fc7be[_0x3645('0x2b')]=!![];var _0x15bb86=[];if(_0x407a96['length']>0x0){_0x15bb86['push']({'id':{'$in':_0x407a96}});if(_0x15cfde&&!_0x4cfc6b){_0x3785a3=[db[_0x3645('0x2c')][_0x3645('0x2d')]('FIELD(id,'+_0x407a96+')')];_0x1fc7be[_0x3645('0x1f')]=_0x3785a3;}}if(_0x94972){_0x3f4cc1[_0x3645('0x2e')](function(_0x3d6170){var _0x57aed2=!![];if(_0x4cfc6b===_0x3645('0x2f')&&_0x5b12cf!==_0x3d6170){_0x57aed2=![];}_0x15bb86['push']({[_0x3d6170+_0x3645('0x30')]:_0x57aed2});});if(_0x2fb25a){_0x15bb86['push']({'pauseType':_0x2fb25a});}}else if(_0x4cfc6b){_0x3f4cc1[_0x3645('0x2e')](function(_0x9677b0){_0x15bb86[_0x3645('0x31')]({[_0x9677b0+_0x3645('0x30')]:![]});});}_0x1fc7be[_0x3645('0x32')]=_[_0x3645('0x33')](_0x1fc7be[_0x3645('0x32')],{'$and':_0x15bb86});if(_0x3575ec[_0x3645('0x34')][_0x3645('0x2a')]===_0x3645('0x34')){var _0x54124d={'params':{'id':_0x3575ec[_0x3645('0x34')][_0x3645('0x35')]},'query':{'section':_0x3645('0x36'),'role':_0x3645('0x37'),'online':!![],'raw':!![],'ids':_0x407a96,'customSorting':_0x3785a3}};if(_0x94972){_0x54124d[_0x3645('0x10')]['extraQueryConditions']=_0x15bb86;}_0x54124d[_0x3645('0x10')]=Object['assign'](_0x54124d[_0x3645('0x10')],_0x3575ec[_0x3645('0x10')]);delete _0x54124d[_0x3645('0x10')]['id'];return db['UserProfile']['getResources'](_0x54124d);}return db[_0x3645('0x38')][_0x3645('0x39')](_0x1fc7be);})[_0x3645('0x16')](function(_0x553960){_0x2310ee[_0x3645('0xb')]=_0x553960[_0x3645('0xb')];_0x20766c=_0x553960[_0x3645('0x22')];return _0x20766c[_0x3645('0x26')](function(_0x533bb3){var _0x4445b2=_[_0x3645('0x3a')](_0x2cf053,['id',_0x533bb3['id']]);if(_0x4445b2){var _0x22c379=rta[_0x3645('0x3b')](_0x4445b2);_['merge'](_0x533bb3,_0x22c379);}_0x533bb3[_0x3645('0x1a')]=rta[_0x3645('0x3c')](_0x533bb3);if(_0x533bb3[_0x3645('0x1a')]['includes'](_0x3645('0x14'))){_0x3f4cc1[_0x3645('0x2e')](function(_0x3702bc){if(_0x533bb3[_0x3702bc+'Pause']){_0x533bb3[_0x3702bc+_0x3645('0x3d')]=_0x3645('0x14');}});}return _0x533bb3;});})[_0x3645('0x16')](function(_0x2fd25f){if(!_0x15cfde||_0x3785a3){return _0x2fd25f;}return rta[_0x3645('0x3e')](_0x2fd25f,_0x15cfde);})[_0x3645('0x16')](function(_0x222679){var _0xef9b80=null;if(_0x3575ec[_0x3645('0x10')][_0x3645('0x1e')]){var _0x2aaadd=_0x3575ec[_0x3645('0x10')][_0x3645('0x1e')][_0x3645('0x3f')](',');_0xef9b80=_0x222679[_0x3645('0x26')](function(_0x35d94a){return _[_0x3645('0x40')](_0x35d94a,_0x2aaadd);});}_0x2310ee[_0x3645('0x22')]=_0xef9b80||_0x222679;return _0x2310ee;})[_0x3645('0x16')](respondWithFilteredResult(_0x2a80c7,_0x1fc7be))[_0x3645('0x41')](APIHandleError(_0x2a80c7));};exports[_0x3645('0x42')]=function(_0x1d802e,_0x6d272b){var _0x3ab782={'count':0x0,'rows':[]};var _0xa96c57={};var _0x446609;var _0x36fa30;var _0x25ac92;Promise[_0x3645('0x15')]()['then'](function(){if(_0x1d802e[_0x3645('0x10')][_0x3645('0x17')]){if(!utils[_0x3645('0x18')](_0x1d802e[_0x3645('0x10')]['channel'])){throw new APIBadRequestError(util[_0x3645('0x19')](_0x3645('0x43'),_0x1d802e[_0x3645('0x10')][_0x3645('0x17')]));}_0x446609=_0x1d802e['query'][_0x3645('0x17')][_0x3645('0x44')]();}var _0x3683c2=_['startCase'](_0x446609)+_0x3645('0x45');var _0x1d948d=_[_0x3645('0x26')](db[_0x3683c2][_0x3645('0x27')],function(_0x14d645){return{'name':_0x14d645[_0x3645('0x28')],'type':_0x14d645[_0x3645('0x29')]['key']};});if(!_0x1d802e[_0x3645('0x10')][_0x3645('0x1e')]){var _0xbd426e=['id','name'];if(_0x446609===_0x3645('0x46')){_0xbd426e[_0x3645('0x31')](_0x3645('0x29'));if(_0x1d802e[_0x3645('0x10')]['type']===_0x3645('0x47')){_0xbd426e[_0x3645('0x31')]([_0x3645('0x48'),_0x3645('0x49')]);}}_0x1d802e[_0x3645('0x10')][_0x3645('0x1e')]=_0xbd426e['join'](',');}_0xa96c57=qs[_0x3645('0x4a')](_0x1d948d,_0x1d802e);if(_0x1d802e[_0x3645('0x34')][_0x3645('0x2a')]===_0x3645('0x34')){var _0x1f828f={'params':{'id':_0x1d802e['user']['userProfileId']},'query':{'section':_0x446609===_0x3645('0x46')&&_0x1d802e[_0x3645('0x10')][_0x3645('0x29')]===_0x3645('0x47')?_0x3645('0x4b'):_[_0x3645('0x4c')](_0x446609)+_0x3645('0x4d'),'type':_0x1d802e[_0x3645('0x10')][_0x3645('0x29')],'nolimit':!![],'sort':_0x3645('0x4e'),'filter':_0x1d802e[_0x3645('0x10')][_0x3645('0x4f')]}};return db[_0x3645('0x50')]['getResources'](_0x1f828f);}return db[_0x3683c2][_0x3645('0x39')](_0xa96c57);})['then'](function(_0x29be2b){_0x3ab782[_0x3645('0xb')]=_0x29be2b['count'];_0x36fa30=_0x29be2b['rows'];return rtq[_0x3645('0x51')](_0x1d802e,_0x446609);})[_0x3645('0x16')](function(_0xf9d465){_0x25ac92=_0xf9d465[_0x3645('0x22')];return rtq[_0x3645('0x52')](_0x36fa30,_0x25ac92,_0x446609,_0x1d802e[_0x3645('0x10')][_0x3645('0x29')]);})[_0x3645('0x16')](function(_0x20a7e8){_0x3ab782[_0x3645('0x22')]=_0x20a7e8;return _0x3ab782;})['then'](respondWithFilteredResult(_0x6d272b,_0xa96c57))[_0x3645('0x41')](APIHandleError(_0x6d272b));}; \ No newline at end of file +var _0x7c70=['name','filter','getRealtimeQueues','initializeQueues','lodash','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','limit','count','status','set','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','getUpdatedSortOptions','fields','join','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','getOptions','push','sequelize','literal','FIELD(id,','order','forEach','*pause','Pause','where','user','userProfileId','Agents','agent','extraQueryConditions','UserProfile','getResources','findAndCountAll','globalStatus','getAgentStatus','Status','split','pick','catch','getQueues','startCase','Queue','voice','outbound','dialActive','dialMethod','QueueCampaigns','Queues'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7c70,0xfd));var _0x07c7=function(_0x1aa835,_0x23e8ac){_0x1aa835=_0x1aa835-0x0;var _0x5ad5c7=_0x7c70[_0x1aa835];return _0x5ad5c7;};'use strict';var _=require(_0x07c7('0x0'));var util=require('util');var rta=require(_0x07c7('0x1'));var rtq=require(_0x07c7('0x2'));var qs=require(_0x07c7('0x3'));var utils=require(_0x07c7('0x4'));var db=require(_0x07c7('0x5'))['db'];var APIBadRequestError=require(_0x07c7('0x6'))['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0x07c7('0x7')];function respondWithFilteredResult(_0xf36f4b,_0x43edb4){return function(_0x2bd8d1){if(_0x2bd8d1){var _0x16495e=typeof _0x43edb4[_0x07c7('0x8')]===_0x07c7('0x9')&&typeof _0x43edb4[_0x07c7('0xa')]===_0x07c7('0x9');var _0x4fd57=_0x2bd8d1[_0x07c7('0xb')];var _0x3d15cd=_0x16495e?0x0:_0x43edb4['offset'];var _0x960d7f=_0x16495e?_0x2bd8d1['count']:_0x43edb4['offset']+_0x43edb4[_0x07c7('0xa')];var _0x493be7;if(_0x960d7f>=_0x4fd57){_0x960d7f=_0x4fd57;_0x493be7=0xc8;}else{_0x493be7=0xce;}_0xf36f4b[_0x07c7('0xc')](_0x493be7);return _0xf36f4b[_0x07c7('0xd')]('Content-Range',_0x3d15cd+'-'+_0x960d7f+'/'+_0x4fd57)[_0x07c7('0xe')](_0x2bd8d1);}return null;};}exports[_0x07c7('0xf')]=function(_0x1fefc5,_0x18f8a7){var _0x3e69a2={'count':0x0,'rows':[]};var _0x479945={};var _0x2bf06a;var _0x44ed29=utils[_0x07c7('0x10')]();var _0x1c6f42;var _0x1d5746;var _0x4db8ad=_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x12')];var _0x2ec345=_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x13')];var _0x2c8d0a=_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x14')];var _0x53864b=_0x2ec345===_0x07c7('0x15')||_0x2ec345==='*pause'?!![]:![];var _0x4a532d=[];var _0x3d1fcf;var _0x11e446;Promise[_0x07c7('0x16')]()[_0x07c7('0x17')](function(){if(_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x18')]){if(!utils[_0x07c7('0x19')](_0x1fefc5['query'][_0x07c7('0x18')])){throw new APIBadRequestError(util[_0x07c7('0x1a')](_0x07c7('0x1b'),_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x18')]));}_0x2bf06a=_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x18')][_0x07c7('0x1c')]();}if(!_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x1d')]||!_0x1fefc5[_0x07c7('0x11')]['sort'][_0x07c7('0x1e')]('globalStatus')){_0x1fefc5[_0x07c7('0x11')]['sort']=rta['validateSortParameter'](_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x1d')]);return;}var _0x1d528d=rta[_0x07c7('0x1f')](_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x1d')]);_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x1d')]=_0x1d528d[_0x07c7('0x20')][_0x07c7('0x21')](',');_0x3d1fcf=_0x1d528d['order'];})['then'](function(){if(!_0x4db8ad){return[];}return rta['getAgentIdsByQueues'](_0x4db8ad,_0x2bf06a);})['then'](function(_0x2ef298){_0x4a532d=_0x2ef298;return rta[_0x07c7('0x22')]();})[_0x07c7('0x17')](function(_0x181cd4){_0x1d5746=_0x181cd4[_0x07c7('0x23')];if((!_0x2ec345||_0x53864b)&&!_0x3d1fcf){return _0x4a532d;}if(_0x3d1fcf&&!_0x2ec345){return rta[_0x07c7('0x24')](_0x1d5746,_0x4a532d,_0x3d1fcf);}else{return rta[_0x07c7('0x25')](_0x1d5746,_0x4a532d,_0x2ec345);}})['then'](function(_0x2d37b7){_0x4a532d=_0x2d37b7;var _0x562971=![];if(_0x4a532d[_0x07c7('0x26')]===0x0){if(_0x4db8ad||_0x2ec345){_0x562971=!![];}if(_0x53864b){_0x562971=![];}}if(_0x562971){return _0x3e69a2;}var _0x10a2a0=_[_0x07c7('0x27')](db[_0x07c7('0x28')][_0x07c7('0x29')],function(_0x55c42b){return{'name':_0x55c42b[_0x07c7('0x2a')],'type':_0x55c42b[_0x07c7('0x2b')][_0x07c7('0x2c')]};});_0x1fefc5['query'][_0x07c7('0x2d')]='agent';_0x1fefc5[_0x07c7('0x11')]['online']=!![];_0x479945=qs[_0x07c7('0x2e')](_0x10a2a0,_0x1fefc5);_0x479945['raw']=!![];var _0x579c3a=[];if(_0x4a532d[_0x07c7('0x26')]>0x0){_0x579c3a[_0x07c7('0x2f')]({'id':{'$in':_0x4a532d}});if(_0x3d1fcf&&!_0x2ec345){_0x11e446=[db[_0x07c7('0x30')][_0x07c7('0x31')](_0x07c7('0x32')+_0x4a532d+')')];_0x479945[_0x07c7('0x33')]=_0x11e446;}}if(_0x53864b){_0x44ed29[_0x07c7('0x34')](function(_0x2b8c60){var _0x1f5247=!![];if(_0x2ec345===_0x07c7('0x35')&&_0x2bf06a!==_0x2b8c60){_0x1f5247=![];}_0x579c3a[_0x07c7('0x2f')]({[_0x2b8c60+_0x07c7('0x36')]:_0x1f5247});});if(_0x2c8d0a){_0x579c3a['push']({'pauseType':_0x2c8d0a});}}else if(_0x2ec345){_0x44ed29['forEach'](function(_0x47fcc8){_0x579c3a['push']({[_0x47fcc8+_0x07c7('0x36')]:![]});});}_0x479945[_0x07c7('0x37')]=_['merge'](_0x479945['where'],{'$and':_0x579c3a});if(_0x1fefc5[_0x07c7('0x38')][_0x07c7('0x2d')]===_0x07c7('0x38')){var _0xfe4696={'params':{'id':_0x1fefc5['user'][_0x07c7('0x39')]},'query':{'section':_0x07c7('0x3a'),'role':_0x07c7('0x3b'),'online':!![],'raw':!![],'ids':_0x4a532d,'customSorting':_0x11e446}};if(_0x53864b){_0xfe4696[_0x07c7('0x11')][_0x07c7('0x3c')]=_0x579c3a;}_0xfe4696[_0x07c7('0x11')]=Object['assign'](_0xfe4696['query'],_0x1fefc5[_0x07c7('0x11')]);delete _0xfe4696[_0x07c7('0x11')]['id'];return db[_0x07c7('0x3d')][_0x07c7('0x3e')](_0xfe4696);}return db[_0x07c7('0x28')][_0x07c7('0x3f')](_0x479945);})[_0x07c7('0x17')](function(_0x5b3553){_0x3e69a2[_0x07c7('0xb')]=_0x5b3553[_0x07c7('0xb')];_0x1c6f42=_0x5b3553[_0x07c7('0x23')];return _0x1c6f42[_0x07c7('0x27')](function(_0x4a5bff){var _0x1614bb=_['find'](_0x1d5746,['id',_0x4a5bff['id']]);if(_0x1614bb){var _0x5930dc=rta['filterAgentAttributes'](_0x1614bb);_['merge'](_0x4a5bff,_0x5930dc);}_0x4a5bff[_0x07c7('0x40')]=rta[_0x07c7('0x41')](_0x4a5bff);if(_0x4a5bff[_0x07c7('0x40')][_0x07c7('0x1e')](_0x07c7('0x15'))){_0x44ed29[_0x07c7('0x34')](function(_0x4dd548){if(_0x4a5bff[_0x4dd548+_0x07c7('0x36')]){_0x4a5bff[_0x4dd548+_0x07c7('0x42')]=_0x07c7('0x15');}});}return _0x4a5bff;});})[_0x07c7('0x17')](function(_0x37d454){if(!_0x3d1fcf||_0x11e446){return _0x37d454;}return rta['sortAgentsByStatus'](_0x37d454,_0x3d1fcf);})[_0x07c7('0x17')](function(_0x17551f){var _0x37431b=null;if(_0x1fefc5[_0x07c7('0x11')][_0x07c7('0x20')]){var _0x3a671f=_0x1fefc5['query'][_0x07c7('0x20')][_0x07c7('0x43')](',');_0x37431b=_0x17551f[_0x07c7('0x27')](function(_0x30dacb){return _[_0x07c7('0x44')](_0x30dacb,_0x3a671f);});}_0x3e69a2[_0x07c7('0x23')]=_0x37431b||_0x17551f;return _0x3e69a2;})[_0x07c7('0x17')](respondWithFilteredResult(_0x18f8a7,_0x479945))[_0x07c7('0x45')](APIHandleError(_0x18f8a7));};exports[_0x07c7('0x46')]=function(_0x395d16,_0x44b3da){var _0x52c23e={'count':0x0,'rows':[]};var _0x5661ca={};var _0x156211;var _0x121f0d;var _0x1ec903;Promise[_0x07c7('0x16')]()[_0x07c7('0x17')](function(){if(_0x395d16[_0x07c7('0x11')][_0x07c7('0x18')]){if(!utils[_0x07c7('0x19')](_0x395d16[_0x07c7('0x11')][_0x07c7('0x18')])){throw new APIBadRequestError(util[_0x07c7('0x1a')](_0x07c7('0x1b'),_0x395d16['query'][_0x07c7('0x18')]));}_0x156211=_0x395d16['query']['channel']['toLowerCase']();}var _0x47a76e=_[_0x07c7('0x47')](_0x156211)+_0x07c7('0x48');var _0x4d85bc=_[_0x07c7('0x27')](db[_0x47a76e][_0x07c7('0x29')],function(_0x4d1cfc){return{'name':_0x4d1cfc[_0x07c7('0x2a')],'type':_0x4d1cfc[_0x07c7('0x2b')][_0x07c7('0x2c')]};});if(!_0x395d16['query'][_0x07c7('0x20')]){var _0x71dd1=['id','name'];if(_0x156211===_0x07c7('0x49')){_0x71dd1['push'](_0x07c7('0x2b'));if(_0x395d16[_0x07c7('0x11')]['type']===_0x07c7('0x4a')){_0x71dd1[_0x07c7('0x2f')]([_0x07c7('0x4b'),_0x07c7('0x4c')]);}}_0x395d16[_0x07c7('0x11')][_0x07c7('0x20')]=_0x71dd1[_0x07c7('0x21')](',');}_0x5661ca=qs['getOptions'](_0x4d85bc,_0x395d16);if(_0x395d16[_0x07c7('0x38')]['role']===_0x07c7('0x38')){var _0x17b52d={'params':{'id':_0x395d16['user'][_0x07c7('0x39')]},'query':{'section':_0x156211===_0x07c7('0x49')&&_0x395d16[_0x07c7('0x11')][_0x07c7('0x2b')]==='outbound'?_0x07c7('0x4d'):_['startCase'](_0x156211)+_0x07c7('0x4e'),'type':_0x395d16[_0x07c7('0x11')][_0x07c7('0x2b')],'nolimit':!![],'sort':_0x07c7('0x4f'),'filter':_0x395d16['query'][_0x07c7('0x50')]}};return db[_0x07c7('0x3d')][_0x07c7('0x3e')](_0x17b52d);}return db[_0x47a76e][_0x07c7('0x3f')](_0x5661ca);})[_0x07c7('0x17')](function(_0x5d1684){_0x52c23e['count']=_0x5d1684[_0x07c7('0xb')];_0x121f0d=_0x5d1684['rows'];return rtq[_0x07c7('0x51')](_0x395d16,_0x156211);})[_0x07c7('0x17')](function(_0x1ddaba){_0x1ec903=_0x1ddaba[_0x07c7('0x23')];return rtq[_0x07c7('0x52')](_0x121f0d,_0x1ec903,_0x156211,_0x395d16[_0x07c7('0x11')]['type']);})['then'](function(_0xad1669){_0x52c23e[_0x07c7('0x23')]=_0xad1669;return _0x52c23e;})[_0x07c7('0x17')](respondWithFilteredResult(_0x44b3da,_0x5661ca))[_0x07c7('0x45')](APIHandleError(_0x44b3da));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 8b37ecb..7752375 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xca54f9,_0x1d837b){var _0x183c63=function(_0x4729a8){while(--_0x4729a8){_0xca54f9['push'](_0xca54f9['shift']());}};_0x183c63(++_0x1d837b);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 4480401..61ef00c 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 _0x0d91=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x2e69bc,_0x598313){var _0xe9c60=function(_0xf9cf85){while(--_0xf9cf85){_0x2e69bc['push'](_0x2e69bc['shift']());}};_0xe9c60(++_0x598313);}(_0x0d91,0x76));var _0x10d9=function(_0x44ccf0,_0x446087){_0x44ccf0=_0x44ccf0-0x0;var _0x101f26=_0x0d91[_0x44ccf0];return _0x101f26;};'use strict';var Sequelize=require(_0x10d9('0x0'));module[_0x10d9('0x1')]={'state':{'type':Sequelize[_0x10d9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x10d9('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x10d9('0x3')]},'starttime':{'type':Sequelize[_0x10d9('0x4')]},'responsetime':{'type':Sequelize[_0x10d9('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x10d9('0x3')]},'campaigntype':{'type':Sequelize[_0x10d9('0x3')]},'membername':{'type':Sequelize[_0x10d9('0x3')]}}; \ No newline at end of file +var _0x99a0=['STRING','sequelize','exports','DATE'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0x99a0,0x121));var _0x099a=function(_0x157fc0,_0xcfef20){_0x157fc0=_0x157fc0-0x0;var _0x4d78f7=_0x99a0[_0x157fc0];return _0x4d78f7;};'use strict';var Sequelize=require(_0x099a('0x0'));module[_0x099a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x099a('0x2')]},'responsetime':{'type':Sequelize[_0x099a('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x099a('0x3')]},'campaigntype':{'type':Sequelize[_0x099a('0x3')]},'membername':{'type':Sequelize[_0x099a('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a284b70..1326cfa 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 _0xd65f=['report_agent_preview','../../config/logger','api','bluebird','request-promise','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview'];(function(_0x35b395,_0x5561a8){var _0x28c3f7=function(_0xd4fcf5){while(--_0xd4fcf5){_0x35b395['push'](_0x35b395['shift']());}};_0x28c3f7(++_0x5561a8);}(_0xd65f,0x121));var _0xfd65=function(_0x4be730,_0x341fe4){_0x4be730=_0x4be730-0x0;var _0x54bbe5=_0xd65f[_0x4be730];return _0x54bbe5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd65('0x0'))(_0xfd65('0x1'));var moment=require('moment');var BPromise=require(_0xfd65('0x2'));var rp=require(_0xfd65('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd65('0x4'));var attributes=require(_0xfd65('0x5'));module['exports']=function(_0x471590,_0x47acaf){return _0x471590[_0xfd65('0x6')](_0xfd65('0x7'),attributes,{'tableName':_0xfd65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e0d=['ReportAgentPreview','report_agent_preview','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x60dd8d,_0x1e7522){var _0x1a0827=function(_0xc92ed0){while(--_0xc92ed0){_0x60dd8d['push'](_0x60dd8d['shift']());}};_0x1a0827(++_0x1e7522);}(_0x5e0d,0x141));var _0xd5e0=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x5e0d[_0x5d7227];return _0x15ac55;};'use strict';var _=require('lodash');var util=require(_0xd5e0('0x0'));var logger=require('../../config/logger')(_0xd5e0('0x1'));var moment=require('moment');var BPromise=require(_0xd5e0('0x2'));var rp=require(_0xd5e0('0x3'));var fs=require('fs');var path=require(_0xd5e0('0x4'));var rimraf=require(_0xd5e0('0x5'));var config=require(_0xd5e0('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xd5e0('0x7')]=function(_0x5ee0b9,_0x55ded6){return _0x5ee0b9[_0xd5e0('0x8')](_0xd5e0('0x9'),attributes,{'tableName':_0xd5e0('0xa'),'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 4489019..aa6e5bd 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 _0x75fd=['client','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ReportAgentPreview,\x20%s,\x20%s','catch','ReportAgentPreview','create','options','raw','CreateReportAgentPreview','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9d43fc,_0x6bd984){var _0x53bb19=function(_0x3604b9){while(--_0x3604b9){_0x9d43fc['push'](_0x9d43fc['shift']());}};_0x53bb19(++_0x6bd984);}(_0x75fd,0x197));var _0xd75f=function(_0x497936,_0x591ab1){_0x497936=_0x497936-0x0;var _0x484a28=_0x75fd[_0x497936];return _0x484a28;};'use strict';var _=require(_0xd75f('0x0'));var util=require('util');var moment=require(_0xd75f('0x1'));var BPromise=require(_0xd75f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd75f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd75f('0x4'));var logger=require(_0xd75f('0x5'))(_0xd75f('0x6'));var config=require(_0xd75f('0x7'));var jayson=require(_0xd75f('0x8'));var client=jayson[_0xd75f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4613eb,_0x5dda6b,_0x3c8973){return new BPromise(function(_0x14d6a3,_0x159d55){return client[_0xd75f('0xa')](_0x4613eb,_0x3c8973)['then'](function(_0x1c8026){logger[_0xd75f('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dda6b,_0xd75f('0xc'));logger[_0xd75f('0xd')](_0xd75f('0xe'),_0x5dda6b,'request\x20sent',JSON[_0xd75f('0xf')](_0x1c8026));if(_0x1c8026['error']){if(_0x1c8026['error'][_0xd75f('0x10')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x5dda6b,_0x1c8026[_0xd75f('0x11')][_0xd75f('0x12')]);return _0x159d55(_0x1c8026[_0xd75f('0x11')]['message']);}logger[_0xd75f('0x11')](_0xd75f('0x13'),_0x5dda6b,_0x1c8026[_0xd75f('0x11')]['message']);return _0x14d6a3(_0x1c8026[_0xd75f('0x11')][_0xd75f('0x12')]);}else{logger[_0xd75f('0xb')](_0xd75f('0x13'),_0x5dda6b,_0xd75f('0xc'));_0x14d6a3(_0x1c8026['result'][_0xd75f('0x12')]);}})[_0xd75f('0x14')](function(_0x588521){logger[_0xd75f('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x5dda6b,_0x588521);_0x159d55(_0x588521);});});}exports['CreateReportAgentPreview']=function(_0x2445fe){var _0x430d5a=this;return new Promise(function(_0x2cb911,_0x114545){return db[_0xd75f('0x15')][_0xd75f('0x16')](_0x2445fe['body'],{'raw':_0x2445fe['options']?_0x2445fe[_0xd75f('0x17')][_0xd75f('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x279f82){logger['info'](_0xd75f('0x19'),_0x2445fe);logger[_0xd75f('0xd')](_0xd75f('0x19'),_0x2445fe,JSON[_0xd75f('0xf')](_0x279f82));_0x2cb911(_0x279f82);})[_0xd75f('0x14')](function(_0x56a914){logger[_0xd75f('0x11')](_0xd75f('0x19'),_0x56a914['message'],_0x2445fe);_0x114545(_0x430d5a['error'](0x1f4,_0x56a914[_0xd75f('0x12')]));});});}; \ No newline at end of file +var _0xd5f3=['debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ReportAgentPreview','create','options','CreateReportAgentPreview'];(function(_0xc869e5,_0x348320){var _0x4c7b4b=function(_0x246647){while(--_0x246647){_0xc869e5['push'](_0xc869e5['shift']());}};_0x4c7b4b(++_0x348320);}(_0xd5f3,0xa2));var _0x3d5f=function(_0x1eb7de,_0x45b6f9){_0x1eb7de=_0x1eb7de-0x0;var _0x586ce6=_0xd5f3[_0x1eb7de];return _0x586ce6;};'use strict';var _=require('lodash');var util=require(_0x3d5f('0x0'));var moment=require(_0x3d5f('0x1'));var BPromise=require(_0x3d5f('0x2'));var rs=require(_0x3d5f('0x3'));var fs=require('fs');var Redis=require(_0x3d5f('0x4'));var db=require(_0x3d5f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3d5f('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e72db,_0x357cd0,_0x5d6948){return new BPromise(function(_0x5750a6,_0x431b7a){return client[_0x3d5f('0x7')](_0x3e72db,_0x5d6948)[_0x3d5f('0x8')](function(_0x3fe936){logger[_0x3d5f('0x9')](_0x3d5f('0xa'),_0x357cd0,_0x3d5f('0xb'));logger['debug'](_0x3d5f('0xc'),_0x357cd0,'request\x20sent',JSON[_0x3d5f('0xd')](_0x3fe936));if(_0x3fe936[_0x3d5f('0xe')]){if(_0x3fe936[_0x3d5f('0xe')][_0x3d5f('0xf')]===0x1f4){logger[_0x3d5f('0xe')](_0x3d5f('0xa'),_0x357cd0,_0x3fe936['error'][_0x3d5f('0x10')]);return _0x431b7a(_0x3fe936[_0x3d5f('0xe')][_0x3d5f('0x10')]);}logger[_0x3d5f('0xe')](_0x3d5f('0xa'),_0x357cd0,_0x3fe936[_0x3d5f('0xe')][_0x3d5f('0x10')]);return _0x5750a6(_0x3fe936['error'][_0x3d5f('0x10')]);}else{logger[_0x3d5f('0x9')](_0x3d5f('0xa'),_0x357cd0,_0x3d5f('0xb'));_0x5750a6(_0x3fe936['result'][_0x3d5f('0x10')]);}})[_0x3d5f('0x11')](function(_0x3f1d87){logger[_0x3d5f('0xe')](_0x3d5f('0xa'),_0x357cd0,_0x3f1d87);_0x431b7a(_0x3f1d87);});});}exports['CreateReportAgentPreview']=function(_0x1d2260){var _0x61a178=this;return new Promise(function(_0x428fac,_0x27873a){return db[_0x3d5f('0x12')][_0x3d5f('0x13')](_0x1d2260['body'],{'raw':_0x1d2260[_0x3d5f('0x14')]?_0x1d2260['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x486427){logger[_0x3d5f('0x9')](_0x3d5f('0x15'),_0x1d2260);logger[_0x3d5f('0x16')]('CreateReportAgentPreview',_0x1d2260,JSON[_0x3d5f('0xd')](_0x486427));_0x428fac(_0x486427);})[_0x3d5f('0x11')](function(_0x195db8){logger[_0x3d5f('0xe')](_0x3d5f('0x15'),_0x195db8[_0x3d5f('0x10')],_0x1d2260);_0x27873a(_0x61a178['error'](0x1f4,_0x195db8[_0x3d5f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a859a21..312611d 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 _0xd578=['showVoiceQueues','put','updateVoiceQueue','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelRedirect','/voice/queues/:id'];(function(_0x887ac3,_0x4e6921){var _0x1afc7b=function(_0x519bba){while(--_0x519bba){_0x887ac3['push'](_0x887ac3['shift']());}};_0x1afc7b(++_0x4e6921);}(_0xd578,0x19c));var _0x8d57=function(_0x21a75b,_0xd941d7){_0x21a75b=_0x21a75b-0x0;var _0x156911=_0xd578[_0x21a75b];return _0x156911;};'use strict';var multer=require(_0x8d57('0x0'));var util=require(_0x8d57('0x1'));var path=require('path');var express=require(_0x8d57('0x2'));var router=express[_0x8d57('0x3')]();var auth=require(_0x8d57('0x4'));var controller=require(_0x8d57('0x5'));router[_0x8d57('0x6')](_0x8d57('0x7'),auth[_0x8d57('0x8')](),controller['voiceChannels']);router[_0x8d57('0x6')](_0x8d57('0x9'),auth[_0x8d57('0x8')](),controller['voiceChannelMixMonitor']);router[_0x8d57('0x6')](_0x8d57('0xa'),auth[_0x8d57('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x8d57('0x6')](_0x8d57('0xb'),auth[_0x8d57('0x8')](),controller['voiceQueues']);router[_0x8d57('0x6')]('/chat/queues',auth[_0x8d57('0x8')](),controller['chatQueues']);router[_0x8d57('0x6')]('/mail/queues',auth[_0x8d57('0x8')](),controller[_0x8d57('0xc')]);router['get'](_0x8d57('0xd'),auth[_0x8d57('0x8')](),controller[_0x8d57('0xe')]);router[_0x8d57('0x6')]('/openchannel/queues',auth[_0x8d57('0x8')](),controller['openchannelQueues']);router['get'](_0x8d57('0xf'),auth['isAuthenticated'](),controller[_0x8d57('0x10')]);router['get'](_0x8d57('0x11'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get']('/fax/queues',auth[_0x8d57('0x8')](),controller[_0x8d57('0x12')]);router['get'](_0x8d57('0x13'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x14')]);router[_0x8d57('0x6')](_0x8d57('0x15'),auth[_0x8d57('0x8')](),controller['voiceQueuesChannels']);router[_0x8d57('0x6')](_0x8d57('0x16'),auth['isAuthenticated'](),controller[_0x8d57('0x17')]);router[_0x8d57('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x8d57('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x8d57('0x8')](),controller[_0x8d57('0x18')]);router[_0x8d57('0x6')](_0x8d57('0x19'),auth['isAuthenticated'](),controller[_0x8d57('0x1a')]);router[_0x8d57('0x1b')](_0x8d57('0x19'),auth['isAuthenticated'](),controller[_0x8d57('0x1c')]);router[_0x8d57('0x6')]('/outbound',auth[_0x8d57('0x8')](),controller['outbound']);router[_0x8d57('0x6')](_0x8d57('0x1d'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x1e')]);router['get'](_0x8d57('0x1f'),auth[_0x8d57('0x8')](),controller['agents']);router[_0x8d57('0x1b')](_0x8d57('0x20'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x21')]);router[_0x8d57('0x6')](_0x8d57('0x22'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x23')]);router[_0x8d57('0x6')](_0x8d57('0x24'),auth['isAuthenticated'](),controller[_0x8d57('0x25')]);router[_0x8d57('0x6')](_0x8d57('0x26'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x27')]);router[_0x8d57('0x6')](_0x8d57('0x28'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x8d57('0x6')](_0x8d57('0x29'),auth['isAuthenticated'](),controller[_0x8d57('0x2a')]);router[_0x8d57('0x6')](_0x8d57('0x2b'),auth[_0x8d57('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x8d57('0x6')](_0x8d57('0x2c'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x2d')]);router[_0x8d57('0x6')](_0x8d57('0x2e'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x2f')]);router[_0x8d57('0x6')]('/sms/queues/waitinginteractions',auth[_0x8d57('0x8')](),controller[_0x8d57('0x30')]);router[_0x8d57('0x6')](_0x8d57('0x31'),auth['isAuthenticated'](),controller[_0x8d57('0x32')]);router[_0x8d57('0x6')]('/fax/queues/waitinginteractions',auth[_0x8d57('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x8d57('0x33')](_0x8d57('0x34'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x35')](_0x8d57('0x36')));router[_0x8d57('0x6')](_0x8d57('0x37'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x8d57('0x33')]('/chat/queues/:id/notify',auth['isAuthenticated'](),controller[_0x8d57('0x35')]('chat'));router[_0x8d57('0x6')](_0x8d57('0x38'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x39')]);router[_0x8d57('0x33')](_0x8d57('0x3a'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x35')](_0x8d57('0x3b')));router[_0x8d57('0x6')](_0x8d57('0x3c'),auth[_0x8d57('0x8')](),controller['showFaxQueues']);router[_0x8d57('0x33')](_0x8d57('0x3d'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x35')](_0x8d57('0x3e')));router[_0x8d57('0x6')](_0x8d57('0x3f'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post'](_0x8d57('0x40'),auth['isAuthenticated'](),controller[_0x8d57('0x35')]('sms'));router['post'](_0x8d57('0x41'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x35')](_0x8d57('0x42')));router[_0x8d57('0x6')](_0x8d57('0x43'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x44')]);router['get'](_0x8d57('0x45'),auth[_0x8d57('0x8')](),controller['showWhatsappQueues']);router['post'](_0x8d57('0x46'),auth[_0x8d57('0x8')](),controller[_0x8d57('0x47')]);module[_0x8d57('0x48')]=router; \ No newline at end of file +var _0xfca9=['util','path','express','Router','../../components/auth/service','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports'];(function(_0x42fc5f,_0x32964e){var _0x2b6486=function(_0x20744b){while(--_0x20744b){_0x42fc5f['push'](_0x42fc5f['shift']());}};_0x2b6486(++_0x32964e);}(_0xfca9,0x140));var _0x9fca=function(_0x3eda55,_0x3cd55c){_0x3eda55=_0x3eda55-0x0;var _0x5baf92=_0xfca9[_0x3eda55];return _0x5baf92;};'use strict';var multer=require('multer');var util=require(_0x9fca('0x0'));var path=require(_0x9fca('0x1'));var express=require(_0x9fca('0x2'));var router=express[_0x9fca('0x3')]();var auth=require(_0x9fca('0x4'));var controller=require('./rpc.controller');router[_0x9fca('0x5')]('/voice/channels',auth[_0x9fca('0x6')](),controller[_0x9fca('0x7')]);router['get'](_0x9fca('0x8'),auth[_0x9fca('0x6')](),controller['voiceChannelMixMonitor']);router[_0x9fca('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x9fca('0x6')](),controller[_0x9fca('0x9')]);router[_0x9fca('0x5')]('/voice/queues',auth[_0x9fca('0x6')](),controller[_0x9fca('0xa')]);router[_0x9fca('0x5')](_0x9fca('0xb'),auth[_0x9fca('0x6')](),controller[_0x9fca('0xc')]);router[_0x9fca('0x5')](_0x9fca('0xd'),auth[_0x9fca('0x6')](),controller[_0x9fca('0xe')]);router[_0x9fca('0x5')](_0x9fca('0xf'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x10')]);router['get']('/openchannel/queues',auth[_0x9fca('0x6')](),controller['openchannelQueues']);router[_0x9fca('0x5')](_0x9fca('0x11'),auth[_0x9fca('0x6')](),controller['smsQueues']);router[_0x9fca('0x5')](_0x9fca('0x12'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x13')]);router[_0x9fca('0x5')](_0x9fca('0x14'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x15')]);router[_0x9fca('0x5')](_0x9fca('0x16'),auth['isAuthenticated'](),controller[_0x9fca('0x17')]);router[_0x9fca('0x5')](_0x9fca('0x18'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x19')]);router[_0x9fca('0x5')](_0x9fca('0x1a'),auth['isAuthenticated'](),controller[_0x9fca('0x1b')]);router[_0x9fca('0x5')](_0x9fca('0x1c'),auth[_0x9fca('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x9fca('0x5')](_0x9fca('0x1d'),auth['isAuthenticated'](),controller[_0x9fca('0x1e')]);router['get']('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x9fca('0x1f')]);router['put'](_0x9fca('0x20'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x21')]);router[_0x9fca('0x5')](_0x9fca('0x22'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x23')]);router[_0x9fca('0x5')](_0x9fca('0x24'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x25')]);router[_0x9fca('0x5')](_0x9fca('0x26'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x27')]);router[_0x9fca('0x28')](_0x9fca('0x29'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x2a')]);router[_0x9fca('0x5')](_0x9fca('0x2b'),auth[_0x9fca('0x6')](),controller['telephones']);router[_0x9fca('0x5')](_0x9fca('0x2c'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x2d')]);router[_0x9fca('0x5')]('/campaigns',auth[_0x9fca('0x6')](),controller[_0x9fca('0x2e')]);router[_0x9fca('0x5')](_0x9fca('0x2f'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x30')]);router[_0x9fca('0x5')](_0x9fca('0x31'),auth[_0x9fca('0x6')](),controller['chatQueuesWaitingInteractions']);router[_0x9fca('0x5')]('/mail/queues/waitinginteractions',auth[_0x9fca('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x9fca('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x9fca('0x6')](),controller[_0x9fca('0x32')]);router[_0x9fca('0x5')](_0x9fca('0x33'),auth[_0x9fca('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x9fca('0x34'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x35')]);router[_0x9fca('0x5')](_0x9fca('0x36'),auth[_0x9fca('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x9fca('0x5')](_0x9fca('0x37'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x38')]);router[_0x9fca('0x39')](_0x9fca('0x3a'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x3b')](_0x9fca('0x3c')));router[_0x9fca('0x5')](_0x9fca('0x3d'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x3e')]);router[_0x9fca('0x39')](_0x9fca('0x3f'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x3b')](_0x9fca('0x40')));router[_0x9fca('0x5')]('/chat/queues/:id',auth[_0x9fca('0x6')](),controller[_0x9fca('0x41')]);router['post']('/fax/queues/:id/notify',auth[_0x9fca('0x6')](),controller['queueNotify'](_0x9fca('0x42')));router[_0x9fca('0x5')](_0x9fca('0x43'),auth['isAuthenticated'](),controller[_0x9fca('0x44')]);router[_0x9fca('0x39')](_0x9fca('0x45'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x3b')](_0x9fca('0x46')));router[_0x9fca('0x5')]('/openchannel/queues/:id',auth[_0x9fca('0x6')](),controller['showOpenchannelQueues']);router[_0x9fca('0x39')](_0x9fca('0x47'),auth[_0x9fca('0x6')](),controller['queueNotify'](_0x9fca('0x48')));router[_0x9fca('0x39')](_0x9fca('0x49'),auth['isAuthenticated'](),controller[_0x9fca('0x3b')](_0x9fca('0x4a')));router[_0x9fca('0x5')]('/sms/queues/:id',auth[_0x9fca('0x6')](),controller[_0x9fca('0x4b')]);router[_0x9fca('0x5')](_0x9fca('0x4c'),auth[_0x9fca('0x6')](),controller[_0x9fca('0x4d')]);router['post']('/agents/:id/notify',auth[_0x9fca('0x6')](),controller[_0x9fca('0x4e')]);module[_0x9fca('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 7b75268..c0879c4 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 _0xed1f=['voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','queue','MessageId','From','QueueId','TransferReport','create','Start','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','update','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','catch','json','sendStatus','stack','name','status','isNil','rows','find','VoiceChannels','query'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xed1f,0x6a));var _0xfed1=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xed1f[_0x565ed7];return _0x183ad7;};'use strict';var BPromise=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var _=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var db=require(_0xfed1('0x4'))['db'];var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var jayson=require(_0xfed1('0x7'));var amiClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232a});var mailClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232b});var routingClient=jayson[_0xfed1('0x8')][_0xfed1('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){var _0x42dd5c=_0x2a6082?_0x2a6082:amiClient;return _0x42dd5c[_0xfed1('0xa')](_0x380e18,_0x612b38)['then'](function(_0x1414be){if(_0x1414be[_0xfed1('0xb')]){if(_0x1414be['error'][_0xfed1('0xc')]===0x1f4){return _0x568d48(_0x1414be['error'][_0xfed1('0xd')]);}return _0x2967ef(_0x1414be[_0xfed1('0xb')]['message']);}else{_0x2967ef(_0x1414be['result']);}})[_0xfed1('0xe')](function(_0xe84ba6){_0x568d48(_0xe84ba6);});});}function respondWithResult(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xc8;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['status'](_0x17f4fe)[_0xfed1('0xf')](_0x5a3469);}return _0x569a6e[_0xfed1('0x10')](0x194);};}function handleError(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0x1f4;return function(_0x5b9455){logger['error'](_0x5b9455[_0xfed1('0x11')]);if(_0x5b9455[_0xfed1('0x12')]){delete _0x5b9455[_0xfed1('0x12')];}_0x532537[_0xfed1('0x13')](_0x2dde3a)['send'](_0x5b9455);};}function findById(_0x1a00f6){return function(_0x4af928){if(!_[_0xfed1('0x14')](_0x1a00f6)&&!_[_0xfed1('0x14')](_0x4af928)&&!_['isNil'](_0x4af928[_0xfed1('0x15')])){return _[_0xfed1('0x16')](_0x4af928['rows'],function(_0x59509b){return _0x59509b['id']==_0x1a00f6;});}return null;};}exports['voiceChannels']=function(_0x1e5afb,_0x51f12a){return respondWithRpcPromise(_0xfed1('0x17'),_0x1e5afb[_0xfed1('0x18')])['then'](respondWithResult(_0x51f12a,null))[_0xfed1('0xe')](handleError(_0x51f12a,null));};exports[_0xfed1('0x19')]=function(_0x59ee9d,_0x3ce944){return respondWithRpcPromise(_0xfed1('0x1a'),_[_0xfed1('0x1b')](_0x59ee9d[_0xfed1('0x18')],_0x59ee9d['params']))[_0xfed1('0x1c')](respondWithResult(_0x3ce944,null))['catch'](handleError(_0x3ce944,null));};exports[_0xfed1('0x1d')]=function(_0x1317c8,_0x37c384){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xfed1('0x1b')](_0x1317c8['query'],_0x1317c8[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x37c384,null))[_0xfed1('0xe')](handleError(_0x37c384,null));};exports[_0xfed1('0x1f')]=function(_0x186ecc,_0x1199b7){return respondWithRpcPromise('VoiceQueues',_0x186ecc[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1199b7,null))['catch'](handleError(_0x1199b7,null));};exports[_0xfed1('0x20')]=function(_0x2b9dd2,_0x1b871a){return respondWithRpcPromise(_0xfed1('0x21'),_0x2b9dd2[_0xfed1('0x18')])[_0xfed1('0x1c')](findById(_0x2b9dd2['params']['id']))[_0xfed1('0x1c')](respondWithResult(_0x1b871a,null))['catch'](handleError(_0x1b871a,null));};exports[_0xfed1('0x22')]=function(_0x4e5249,_0x53b0c9){return respondWithRpcPromise(_0xfed1('0x23'),_[_0xfed1('0x1b')](_0x4e5249[_0xfed1('0x24')],_0x4e5249['params']))[_0xfed1('0x1c')](respondWithResult(_0x53b0c9,null))[_0xfed1('0xe')](handleError(_0x53b0c9,null));};exports[_0xfed1('0x25')]=function(_0x383955,_0x12399f){return respondWithRpcPromise(_0xfed1('0x26'),_['merge'](_0x383955[_0xfed1('0x18')],_0x383955[_0xfed1('0x1e')]))['then'](respondWithResult(_0x12399f,null))['catch'](handleError(_0x12399f,null));};exports[_0xfed1('0x27')]=function(_0x2d10f5,_0x2def09){return respondWithRpcPromise(_0xfed1('0x28'),_0x2d10f5[_0xfed1('0x18')])['then'](respondWithResult(_0x2def09,null))[_0xfed1('0xe')](handleError(_0x2def09,null));};exports[_0xfed1('0x29')]=function(_0x10143b,_0x349de1){return respondWithRpcPromise(_0xfed1('0x2a'),_['merge'](_0x10143b[_0xfed1('0x18')],_0x10143b['params']))[_0xfed1('0x1c')](respondWithResult(_0x349de1,null))[_0xfed1('0xe')](handleError(_0x349de1,null));};exports[_0xfed1('0x2b')]=function(_0x321c1b,_0x1c0523){return respondWithRpcPromise(_0xfed1('0x2c'),_[_0xfed1('0x1b')](_0x321c1b[_0xfed1('0x18')],_0x321c1b['params']))[_0xfed1('0x1c')](respondWithResult(_0x1c0523,null))[_0xfed1('0xe')](handleError(_0x1c0523,null));};exports[_0xfed1('0x2d')]=function(_0x28adfc,_0x57da75){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xfed1('0x1b')](_0x28adfc[_0xfed1('0x18')],_0x28adfc[_0xfed1('0x1e')]))[_0xfed1('0x1c')](respondWithResult(_0x57da75,null))[_0xfed1('0xe')](handleError(_0x57da75,null));};exports[_0xfed1('0x2e')]=function(_0x46a150,_0x2f183c){return respondWithRpcPromise('Outbound',_0x46a150['query'])[_0xfed1('0x1c')](respondWithResult(_0x2f183c,null))[_0xfed1('0xe')](handleError(_0x2f183c,null));};exports['outboundChannels']=function(_0x1dae7c,_0x15339c){return respondWithRpcPromise(_0xfed1('0x2f'),_0x1dae7c[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x15339c,null))[_0xfed1('0xe')](handleError(_0x15339c,null));};exports[_0xfed1('0x30')]=function(_0x4118d4,_0x3c27de){var _0x5f3e1f;return respondWithRpcPromise('Agents',_0x4118d4['query'])[_0xfed1('0x1c')](function(_0x340e3c){_0x5f3e1f=_0x340e3c;return respondWithRpcPromise(_0xfed1('0x31'),_0x4118d4['query'],routingClient);})[_0xfed1('0x1c')](function(_0x4a0b04){return _[_0xfed1('0x1b')]({},_0x4a0b04,_0x5f3e1f);})[_0xfed1('0x1c')](respondWithResult(_0x3c27de,null))[_0xfed1('0xe')](handleError(_0x3c27de,null));};exports['agentCapacity']=function(_0x20bdae,_0x6f1647){if(_0x20bdae[_0xfed1('0x24')]&&_0x20bdae['body'][_0xfed1('0x32')]&&_0x20bdae['user']&&_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]){for(var _0x229fc7 in _0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')]){if(_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0xfed1('0x34')](_0x229fc7)){db[_0xfed1('0x35')]['findAll']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'exitAt':null,'uniqueid':_0x20bdae['body']['interaction'][_0x229fc7]&&_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')]?{'$notIn':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7]}:{'$ne':null}}})[_0xfed1('0x1c')](function(_0x2547ee){var _0x24bf7a=moment()[_0xfed1('0x38')](_0xfed1('0x39'));for(var _0x61f65b=0x0,_0x1db6dc=_0x2547ee['length'];_0x61f65b<_0x1db6dc;_0x61f65b+=0x1){_0x2547ee[_0x61f65b][_0xfed1('0x3a')]({'exitAt':_0x24bf7a});}});for(var _0xb61d09=0x0;_0xb61d09<_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xfed1('0x37')];_0xb61d09+=0x1){db[_0xfed1('0x35')]['findOrCreate']({'where':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'type':_0xfed1('0x36'),'uniqueid':_0x20bdae['body'][_0xfed1('0x32')][_0x229fc7][_0xb61d09],'exitAt':null},'defaults':{'channel':_0x229fc7,'membername':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')],'interface':_[_0xfed1('0x14')](_0x20bdae['user'][_0xfed1('0x3b')])?util[_0xfed1('0x38')](_0xfed1('0x3c'),_0x20bdae[_0xfed1('0x33')][_0xfed1('0x12')]):_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3b')],'type':_0xfed1('0x36'),'enterAt':moment()[_0xfed1('0x38')](_0xfed1('0x39')),'role':_0xfed1('0x3d'),'internal':_0x20bdae[_0xfed1('0x33')][_0xfed1('0x3e')],'uniqueid':_0x20bdae[_0xfed1('0x24')][_0xfed1('0x32')][_0x229fc7][_0xb61d09]}});}}}}return respondWithRpcPromise(_0xfed1('0x3f'),{'id':_0x20bdae[_0xfed1('0x1e')]['id'],'capacity':_0x20bdae[_0xfed1('0x24')]['capacity']},routingClient)['then'](respondWithResult(_0x6f1647,null))[_0xfed1('0xe')](handleError(_0x6f1647,null));};exports[_0xfed1('0x40')]=function(_0x5be0c3,_0x1358c1){return respondWithRpcPromise('Telephones',_0x5be0c3[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x1358c1,null))['catch'](handleError(_0x1358c1,null));};exports['trunks']=function(_0x49f696,_0x2376b3){return respondWithRpcPromise(_0xfed1('0x41'),_0x49f696[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x2376b3,null))[_0xfed1('0xe')](handleError(_0x2376b3,null));};exports[_0xfed1('0x42')]=function(_0x1a9f22,_0x144102){return respondWithRpcPromise(_0xfed1('0x43'),_0x1a9f22[_0xfed1('0x18')])['then'](respondWithResult(_0x144102,null))['catch'](handleError(_0x144102,null));};exports[_0xfed1('0x44')]=function(_0x2a2eaa,_0x3f4db7){return respondWithRpcPromise(_0xfed1('0x45'),_0x2a2eaa[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x3f4db7,null))[_0xfed1('0xe')](handleError(_0x3f4db7,null));};exports[_0xfed1('0x46')]=function(_0x117e25,_0x427fa6){return respondWithRpcPromise(_0xfed1('0x45'),_0x117e25[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x117e25[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x427fa6,null))[_0xfed1('0xe')](handleError(_0x427fa6,null));};exports[_0xfed1('0x47')]=function(_0x54eb53,_0x5b167b){return respondWithRpcPromise(_0xfed1('0x48'),_0x54eb53[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5b167b,null))[_0xfed1('0xe')](handleError(_0x5b167b,null));};exports[_0xfed1('0x49')]=function(_0x41a22a,_0x2ccdc3){return respondWithRpcPromise(_0xfed1('0x48'),_0x41a22a[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x41a22a[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x2ccdc3,null))[_0xfed1('0xe')](handleError(_0x2ccdc3,null));};exports[_0xfed1('0x4a')]=function(_0x59ecc4,_0x30cf99){return respondWithRpcPromise('MailAccounts',_0x59ecc4['query'],mailClient)[_0xfed1('0x1c')](respondWithResult(_0x30cf99,null))['catch'](handleError(_0x30cf99,null));};exports[_0xfed1('0x4b')]=function(_0x5acc45,_0x390fc0){return respondWithRpcPromise(_0xfed1('0x4c'),_0x5acc45['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390fc0,null))[_0xfed1('0xe')](handleError(_0x390fc0,null));};exports['showOpenchannelQueues']=function(_0x29b51e,_0x41b407){return respondWithRpcPromise(_0xfed1('0x4c'),_0x29b51e[_0xfed1('0x18')],routingClient)['then'](findById(_0x29b51e[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x41b407,null))[_0xfed1('0xe')](handleError(_0x41b407,null));};exports[_0xfed1('0x4d')]=function(_0x23347a,_0xf4e660){return respondWithRpcPromise(_0xfed1('0x4e'),_0x23347a[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0xf4e660,null))[_0xfed1('0xe')](handleError(_0xf4e660,null));};exports[_0xfed1('0x4f')]=function(_0x18e958,_0x4112c1){return respondWithRpcPromise(_0xfed1('0x4e'),_0x18e958[_0xfed1('0x18')],routingClient)['then'](findById(_0x18e958['params']['id']))['then'](respondWithResult(_0x4112c1,null))[_0xfed1('0xe')](handleError(_0x4112c1,null));};exports[_0xfed1('0x50')]=function(_0x3aea22,_0x2fb9b2){return respondWithRpcPromise('WhatsappQueues',_0x3aea22[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x2fb9b2,null))[_0xfed1('0xe')](handleError(_0x2fb9b2,null));};exports[_0xfed1('0x51')]=function(_0x18af7d,_0x3beef3){return respondWithRpcPromise(_0xfed1('0x52'),_0x18af7d['query'],routingClient)[_0xfed1('0x1c')](findById(_0x18af7d[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x3beef3,null))['catch'](handleError(_0x3beef3,null));};exports[_0xfed1('0x53')]=function(_0x103628,_0x28dbaa){return respondWithRpcPromise(_0xfed1('0x54'),_0x103628['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x28dbaa,null))['catch'](handleError(_0x28dbaa,null));};exports[_0xfed1('0x55')]=function(_0x2d64d3,_0x4b685b){return respondWithRpcPromise('FaxQueues',_0x2d64d3[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](findById(_0x2d64d3[_0xfed1('0x1e')]['id']))[_0xfed1('0x1c')](respondWithResult(_0x4b685b,null))['catch'](handleError(_0x4b685b,null));};exports[_0xfed1('0x56')]=function(_0x440e40,_0x42bc11){return respondWithRpcPromise(_0xfed1('0x57'),_0x440e40[_0xfed1('0x18')])[_0xfed1('0x1c')](respondWithResult(_0x42bc11,null))['catch'](handleError(_0x42bc11,null));};exports[_0xfed1('0x58')]=function(_0x93411d,_0x5ceedd){return respondWithRpcPromise(_0xfed1('0x59'),_0x93411d[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x5ceedd,null))[_0xfed1('0xe')](handleError(_0x5ceedd,null));};exports[_0xfed1('0x5a')]=function(_0x26ecb9,_0x4fc7b5){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x26ecb9[_0xfed1('0x18')],routingClient)['then'](respondWithResult(_0x4fc7b5,null))[_0xfed1('0xe')](handleError(_0x4fc7b5,null));};exports[_0xfed1('0x5b')]=function(_0x5d8742,_0xdc237c){return respondWithRpcPromise(_0xfed1('0x5c'),_0x5d8742[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xdc237c,null))[_0xfed1('0xe')](handleError(_0xdc237c,null));};exports[_0xfed1('0x5d')]=function(_0x4104fe,_0x49213b){return respondWithRpcPromise(_0xfed1('0x5c'),_0x4104fe[_0xfed1('0x18')],routingClient)['then'](function(_0x544605){if(_0x4104fe[_0xfed1('0x18')]['type']!==undefined){var _0x1f4e2b=_(_0x544605[_0xfed1('0x15')])[_0xfed1('0x5e')]([_0x4104fe['query'][_0xfed1('0x5f')],_0x4104fe[_0xfed1('0x1e')]['id']])[_0xfed1('0x60')](_0xfed1('0x61'))[_0xfed1('0x62')]()['value']();return _0x544605[_0xfed1('0x15')][_0xfed1('0x5e')](function(_0x45348d){return _0x1f4e2b[_0xfed1('0x63')](_0x45348d[_0xfed1('0x61')])>-0x1;});}else{return _0x544605['rows'][_0xfed1('0x5e')](function(_0xe74336){return _0xe74336[_0xfed1('0x61')]===parseInt(_0x4104fe[_0xfed1('0x1e')]['id']);});}})[_0xfed1('0x1c')](respondWithResult(_0x49213b,null))[_0xfed1('0xe')](handleError(_0x49213b,null));};exports[_0xfed1('0x64')]=function(_0x4238bd,_0x390eb0){return respondWithRpcPromise(_0xfed1('0x65'),_0x4238bd['query'],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x390eb0,null))[_0xfed1('0xe')](handleError(_0x390eb0,null));};exports[_0xfed1('0x66')]=function(_0x383d34,_0x194f42){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x383d34[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0x194f42,null))[_0xfed1('0xe')](handleError(_0x194f42,null));};exports[_0xfed1('0x67')]=function(_0x221ed8,_0xb76860){return respondWithRpcPromise(_0xfed1('0x68'),_0x221ed8[_0xfed1('0x18')],routingClient)[_0xfed1('0x1c')](respondWithResult(_0xb76860,null))['catch'](handleError(_0xb76860,null));};exports['queueNotify']=function(_0xc3b72a){return function(_0x547d9c,_0x25cebc){var _0x3ab92e,_0x483b16;var _0x4b355d=_['capitalize'](_0xc3b72a);var _0x304cc0=_0xc3b72a==='chat'?_0xfed1('0x69'):'Account';return db[_0x4b355d+_0xfed1('0x6a')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x547d9c[_0xfed1('0x1e')]['id']}})[_0xfed1('0x1c')](function(_0x3c6ddd){if(_['isNil'](_0x3c6ddd)){throw new Error(_0x4b355d+_0xfed1('0x6c'));}_0x3ab92e=_0x3c6ddd;return db[_0x4b355d+_0xfed1('0x6d')]['findOne']({'where':{'id':_0x547d9c[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x4b355d+'Interaction'],'as':_0xfed1('0x6f')},{'model':db[_0x4b355d+_0x304cc0],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x5cf634){if(_[_0xfed1('0x14')](_0x5cf634)){throw new Error(_0x4b355d+_0xfed1('0x71'));}_0x483b16=_0x5cf634;return _0x5cf634['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0xc81c8f={'uniqueid':_0xc3b72a+'.'+_0x483b16['id']+'.'+_0x483b16[_0xfed1('0x6f')]['id'],'FromUserId':_0x547d9c['user']['id'],'type':_0xfed1('0x72')};_0xc81c8f[_0x4b355d+_0xfed1('0x73')]=_0x483b16['id'];_0xc81c8f[_0x4b355d+'InteractionId']=_0x483b16['Interaction']['id'];_0xc81c8f[_0xfed1('0x74')+_0x4b355d+_0x304cc0+'Id']=_0x483b16[_0xfed1('0x70')]['id'];_0xc81c8f['To'+_0x4b355d+_0xfed1('0x75')]=_0x3ab92e['id'];return db[_0x4b355d+_0xfed1('0x76')][_0xfed1('0x77')](_0xc81c8f);})[_0xfed1('0x1c')](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0xc3b72a,'interaction':_0x483b16[_0xfed1('0x6f')],'message':_0x483b16,'account':_0x483b16[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x72'),'appdata':_0x3ab92e[_0xfed1('0x12')]+','+(_0x483b16[_0xfed1('0x70')]['queueTransferTimeout']||0x12c),'interval':_0xfed1('0x79')}]},routingClient);})[_0xfed1('0x1c')](respondWithResult(_0x25cebc,null))['catch'](handleError(_0x25cebc,null));};};exports[_0xfed1('0x7a')]=function(_0x1f721d,_0x5f5d42){var _0x3d4aee,_0x408ee0;if(_[_0xfed1('0x14')](_0x1f721d[_0xfed1('0x24')]['channel'])){throw new Error(_0xfed1('0x7b'));}var _0x24ab18=_0x1f721d[_0xfed1('0x24')][_0xfed1('0x7c')];var _0x1ecef6=_[_0xfed1('0x7d')](_0x24ab18);var _0x2d0cbb=_0x24ab18===_0xfed1('0x7e')?'Website':_0xfed1('0x70');return db[_0xfed1('0x7f')][_0xfed1('0x6b')]({'raw':!![],'where':{'id':_0x1f721d['params']['id'],'role':_0xfed1('0x3d')}})[_0xfed1('0x1c')](function(_0x45a677){if(_['isNil'](_0x45a677)){throw new Error('Agent\x20not\x20found');}_0x3d4aee=_0x45a677;return db[_0x1ecef6+_0xfed1('0x6d')][_0xfed1('0x6b')]({'where':{'id':_0x1f721d[_0xfed1('0x24')][_0xfed1('0x6e')]},'include':[{'model':db[_0x1ecef6+_0xfed1('0x6f')],'as':_0xfed1('0x6f')},{'model':db[_0x1ecef6+_0x2d0cbb],'as':_0xfed1('0x70')}]});})[_0xfed1('0x1c')](function(_0x130eb2){if(_[_0xfed1('0x14')](_0x130eb2)){throw new Error(_0x1ecef6+_0xfed1('0x71'));}_0x408ee0=_0x130eb2;return _0x130eb2[_0xfed1('0x80')]({'read':0x0,'readAt':null,'UserId':null});})[_0xfed1('0x1c')](function(){var _0x18b086={'uniqueid':_0x24ab18+'.'+_0x408ee0['id']+'.'+_0x408ee0[_0xfed1('0x6f')]['id'],'FromUserId':_0x1f721d[_0xfed1('0x33')]['id'],'type':_0xfed1('0x72'),'ToUserId':_0x3d4aee['id']};_0x18b086[_0x1ecef6+_0xfed1('0x73')]=_0x408ee0['id'];_0x18b086[_0x1ecef6+_0xfed1('0x81')]=_0x408ee0[_0xfed1('0x6f')]['id'];_0x18b086['From'+_0x1ecef6+_0x2d0cbb+'Id']=_0x408ee0[_0xfed1('0x70')]['id'];return db[_0x1ecef6+_0xfed1('0x76')][_0xfed1('0x77')](_0x18b086);})['then'](function(){return respondWithRpcPromise(_0xfed1('0x78'),{'channel':_0x24ab18,'interaction':_0x408ee0[_0xfed1('0x6f')],'message':_0x408ee0,'account':_0x408ee0[_0xfed1('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0xfed1('0x3d'),'appdata':_0x3d4aee[_0xfed1('0x12')]+','+(_0x408ee0[_0xfed1('0x70')][_0xfed1('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x5f5d42,null))[_0xfed1('0xe')](handleError(_0x5f5d42,null));}; \ No newline at end of file +var _0x46ed=['send','isNil','rows','VoiceChannels','query','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','\x20Message\x20not\x20found','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','name'];(function(_0x482e6a,_0x7f7a4a){var _0x12f8b2=function(_0x48fd8c){while(--_0x48fd8c){_0x482e6a['push'](_0x482e6a['shift']());}};_0x12f8b2(++_0x7f7a4a);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xd46e('0x0'));var moment=require(_0xd46e('0x1'));var _=require('lodash');var util=require(_0xd46e('0x2'));var db=require(_0xd46e('0x3'))['db'];var logger=require(_0xd46e('0x4'))('api');var jayson=require(_0xd46e('0x5'));var amiClient=jayson[_0xd46e('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232b});var routingClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){var _0x19e4f4=_0x437ea0?_0x437ea0:amiClient;return _0x19e4f4[_0xd46e('0x8')](_0x45e680,_0x855f24)['then'](function(_0x7b2d69){if(_0x7b2d69[_0xd46e('0x9')]){if(_0x7b2d69['error'][_0xd46e('0xa')]===0x1f4){return _0x31259b(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}return _0x144687(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}else{_0x144687(_0x7b2d69[_0xd46e('0xc')]);}})['catch'](function(_0x24c54b){_0x31259b(_0x24c54b);});});}function respondWithResult(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xc8;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0xd')](_0x48550b)['json'](_0xf3048c);}return _0x5bc1da['sendStatus'](0x194);};}function handleError(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0x1f4;return function(_0x1e9aae){logger[_0xd46e('0x9')](_0x1e9aae['stack']);if(_0x1e9aae[_0xd46e('0xe')]){delete _0x1e9aae[_0xd46e('0xe')];}_0xacd799[_0xd46e('0xd')](_0x4688ae)[_0xd46e('0xf')](_0x1e9aae);};}function findById(_0x36a317){return function(_0x47fa8f){if(!_[_0xd46e('0x10')](_0x36a317)&&!_[_0xd46e('0x10')](_0x47fa8f)&&!_[_0xd46e('0x10')](_0x47fa8f['rows'])){return _['find'](_0x47fa8f[_0xd46e('0x11')],function(_0x1bd574){return _0x1bd574['id']==_0x36a317;});}return null;};}exports['voiceChannels']=function(_0x4fd1f2,_0x2d6f2c){return respondWithRpcPromise(_0xd46e('0x12'),_0x4fd1f2[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x2d6f2c,null))[_0xd46e('0x15')](handleError(_0x2d6f2c,null));};exports[_0xd46e('0x16')]=function(_0x3b5fa4,_0x327b7e){return respondWithRpcPromise(_0xd46e('0x17'),_[_0xd46e('0x18')](_0x3b5fa4[_0xd46e('0x13')],_0x3b5fa4['params']))[_0xd46e('0x14')](respondWithResult(_0x327b7e,null))[_0xd46e('0x15')](handleError(_0x327b7e,null));};exports[_0xd46e('0x19')]=function(_0x45ce0b,_0x128246){return respondWithRpcPromise(_0xd46e('0x1a'),_[_0xd46e('0x18')](_0x45ce0b[_0xd46e('0x13')],_0x45ce0b[_0xd46e('0x1b')]))['then'](respondWithResult(_0x128246,null))[_0xd46e('0x15')](handleError(_0x128246,null));};exports['voiceQueues']=function(_0x4b8f6a,_0x371054){return respondWithRpcPromise(_0xd46e('0x1c'),_0x4b8f6a[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x371054,null))[_0xd46e('0x15')](handleError(_0x371054,null));};exports[_0xd46e('0x1d')]=function(_0x1740d1,_0x4dab6a){return respondWithRpcPromise(_0xd46e('0x1c'),_0x1740d1[_0xd46e('0x13')])[_0xd46e('0x14')](findById(_0x1740d1[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4dab6a,null))[_0xd46e('0x15')](handleError(_0x4dab6a,null));};exports['updateVoiceQueue']=function(_0x465d54,_0x3a1ced){return respondWithRpcPromise(_0xd46e('0x1e'),_[_0xd46e('0x18')](_0x465d54[_0xd46e('0x1f')],_0x465d54[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x3a1ced,null))[_0xd46e('0x15')](handleError(_0x3a1ced,null));};exports[_0xd46e('0x20')]=function(_0x45ea47,_0x2ff785){return respondWithRpcPromise(_0xd46e('0x21'),_[_0xd46e('0x18')](_0x45ea47['query'],_0x45ea47[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x2ff785,null))[_0xd46e('0x15')](handleError(_0x2ff785,null));};exports[_0xd46e('0x22')]=function(_0x5ef248,_0x2eed3a){return respondWithRpcPromise(_0xd46e('0x23'),_0x5ef248['query'])[_0xd46e('0x14')](respondWithResult(_0x2eed3a,null))[_0xd46e('0x15')](handleError(_0x2eed3a,null));};exports['voiceQueuesChannel']=function(_0x306458,_0x1c15c9){return respondWithRpcPromise(_0xd46e('0x24'),_['merge'](_0x306458['query'],_0x306458[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x1c15c9,null))[_0xd46e('0x15')](handleError(_0x1c15c9,null));};exports[_0xd46e('0x25')]=function(_0x83526a,_0x423de9){return respondWithRpcPromise(_0xd46e('0x26'),_[_0xd46e('0x18')](_0x83526a['query'],_0x83526a[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x423de9,null))[_0xd46e('0x15')](handleError(_0x423de9,null));};exports[_0xd46e('0x27')]=function(_0x1fa66c,_0x1e0897){return respondWithRpcPromise(_0xd46e('0x28'),_['merge'](_0x1fa66c[_0xd46e('0x13')],_0x1fa66c[_0xd46e('0x1b')]))['then'](respondWithResult(_0x1e0897,null))[_0xd46e('0x15')](handleError(_0x1e0897,null));};exports[_0xd46e('0x29')]=function(_0x12ccf8,_0x3b6e67){return respondWithRpcPromise('Outbound',_0x12ccf8[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x3b6e67,null))[_0xd46e('0x15')](handleError(_0x3b6e67,null));};exports[_0xd46e('0x2a')]=function(_0xefe5f4,_0x1f58ad){return respondWithRpcPromise(_0xd46e('0x2b'),_0xefe5f4[_0xd46e('0x13')])['then'](respondWithResult(_0x1f58ad,null))[_0xd46e('0x15')](handleError(_0x1f58ad,null));};exports[_0xd46e('0x2c')]=function(_0xc83ea1,_0x25657a){var _0x165ce8;return respondWithRpcPromise('Agents',_0xc83ea1[_0xd46e('0x13')])['then'](function(_0x55230d){_0x165ce8=_0x55230d;return respondWithRpcPromise('Agents',_0xc83ea1['query'],routingClient);})[_0xd46e('0x14')](function(_0x54949f){return _[_0xd46e('0x18')]({},_0x54949f,_0x165ce8);})[_0xd46e('0x14')](respondWithResult(_0x25657a,null))['catch'](handleError(_0x25657a,null));};exports[_0xd46e('0x2d')]=function(_0x4114e6,_0x3bd5e9){if(_0x4114e6[_0xd46e('0x1f')]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')]&&_0x4114e6[_0xd46e('0x2f')]&&_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]){for(var _0xec367d in _0x4114e6[_0xd46e('0x1f')]['interaction']){if(_0x4114e6['body']['interaction'][_0xd46e('0x30')](_0xec367d)){db['MemberReport'][_0xd46e('0x31')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':_0xd46e('0x32'),'exitAt':null,'uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]['length']?{'$notIn':_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d]}:{'$ne':null}}})[_0xd46e('0x14')](function(_0x196e51){var _0x41a983=moment()[_0xd46e('0x33')](_0xd46e('0x34'));for(var _0x5d65ca=0x0,_0x384b6e=_0x196e51[_0xd46e('0x35')];_0x5d65ca<_0x384b6e;_0x5d65ca+=0x1){_0x196e51[_0x5d65ca][_0xd46e('0x36')]({'exitAt':_0x41a983});}});for(var _0xac268d=0x0;_0xac268d<_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d][_0xd46e('0x35')];_0xac268d+=0x1){db[_0xd46e('0x37')][_0xd46e('0x38')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':'INTERACTION','uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d][_0xac268d],'exitAt':null},'defaults':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'interface':_[_0xd46e('0x10')](_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')])?util[_0xd46e('0x33')]('SIP/%s',_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]):_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')],'type':_0xd46e('0x32'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd46e('0x3a'),'internal':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x3b')],'uniqueid':_0x4114e6['body']['interaction'][_0xec367d][_0xac268d]}});}}}}return respondWithRpcPromise(_0xd46e('0x3c'),{'id':_0x4114e6[_0xd46e('0x1b')]['id'],'capacity':_0x4114e6['body'][_0xd46e('0x3d')]},routingClient)[_0xd46e('0x14')](respondWithResult(_0x3bd5e9,null))[_0xd46e('0x15')](handleError(_0x3bd5e9,null));};exports[_0xd46e('0x3e')]=function(_0x1bd8a5,_0x34d4ca){return respondWithRpcPromise(_0xd46e('0x3f'),_0x1bd8a5[_0xd46e('0x13')])['then'](respondWithResult(_0x34d4ca,null))[_0xd46e('0x15')](handleError(_0x34d4ca,null));};exports[_0xd46e('0x40')]=function(_0x1c7f92,_0x63ee74){return respondWithRpcPromise('Trunks',_0x1c7f92['query'])[_0xd46e('0x14')](respondWithResult(_0x63ee74,null))['catch'](handleError(_0x63ee74,null));};exports[_0xd46e('0x41')]=function(_0x2af20b,_0x393cb9){return respondWithRpcPromise(_0xd46e('0x42'),_0x2af20b[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x393cb9,null))['catch'](handleError(_0x393cb9,null));};exports[_0xd46e('0x43')]=function(_0x354739,_0x51f45a){return respondWithRpcPromise('ChatQueues',_0x354739[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x51f45a,null))[_0xd46e('0x15')](handleError(_0x51f45a,null));};exports[_0xd46e('0x44')]=function(_0x1886e6,_0x2cc676){return respondWithRpcPromise(_0xd46e('0x45'),_0x1886e6[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x1886e6[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x2cc676,null))[_0xd46e('0x15')](handleError(_0x2cc676,null));};exports[_0xd46e('0x46')]=function(_0x402df2,_0x47a86c){return respondWithRpcPromise(_0xd46e('0x47'),_0x402df2[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x47a86c,null))[_0xd46e('0x15')](handleError(_0x47a86c,null));};exports['showMailQueues']=function(_0x636f15,_0x36e18a){return respondWithRpcPromise(_0xd46e('0x47'),_0x636f15[_0xd46e('0x13')],routingClient)['then'](findById(_0x636f15[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x36e18a,null))['catch'](handleError(_0x36e18a,null));};exports['mailAccounts']=function(_0x45e102,_0xd59920){return respondWithRpcPromise(_0xd46e('0x48'),_0x45e102['query'],mailClient)['then'](respondWithResult(_0xd59920,null))[_0xd46e('0x15')](handleError(_0xd59920,null));};exports[_0xd46e('0x49')]=function(_0x1f310d,_0x263425){return respondWithRpcPromise(_0xd46e('0x4a'),_0x1f310d[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x263425,null))[_0xd46e('0x15')](handleError(_0x263425,null));};exports[_0xd46e('0x4b')]=function(_0x2a172c,_0x4af44){return respondWithRpcPromise(_0xd46e('0x4a'),_0x2a172c[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2a172c[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4af44,null))['catch'](handleError(_0x4af44,null));};exports[_0xd46e('0x4c')]=function(_0x1a3771,_0x3a2dec){return respondWithRpcPromise('SmsQueues',_0x1a3771[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x3a2dec,null))['catch'](handleError(_0x3a2dec,null));};exports[_0xd46e('0x4d')]=function(_0x2c86fe,_0x1801d4){return respondWithRpcPromise('SmsQueues',_0x2c86fe[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2c86fe[_0xd46e('0x1b')]['id']))['then'](respondWithResult(_0x1801d4,null))[_0xd46e('0x15')](handleError(_0x1801d4,null));};exports['whatsappQueues']=function(_0x32eed0,_0x148187){return respondWithRpcPromise(_0xd46e('0x4e'),_0x32eed0['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x148187,null))[_0xd46e('0x15')](handleError(_0x148187,null));};exports[_0xd46e('0x4f')]=function(_0xbce76f,_0x502f37){return respondWithRpcPromise(_0xd46e('0x4e'),_0xbce76f[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0xbce76f[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x502f37,null))[_0xd46e('0x15')](handleError(_0x502f37,null));};exports[_0xd46e('0x50')]=function(_0x41057c,_0x24be84){return respondWithRpcPromise('FaxQueues',_0x41057c['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x24be84,null))[_0xd46e('0x15')](handleError(_0x24be84,null));};exports[_0xd46e('0x51')]=function(_0x2fff69,_0x249938){return respondWithRpcPromise('FaxQueues',_0x2fff69[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2fff69[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x249938,null))['catch'](handleError(_0x249938,null));};exports[_0xd46e('0x52')]=function(_0x9dd439,_0x5a36df){return respondWithRpcPromise(_0xd46e('0x53'),_0x9dd439[_0xd46e('0x13')])['then'](respondWithResult(_0x5a36df,null))[_0xd46e('0x15')](handleError(_0x5a36df,null));};exports[_0xd46e('0x54')]=function(_0x566e65,_0x44ba36){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x566e65[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x44ba36,null))['catch'](handleError(_0x44ba36,null));};exports['mailQueuesWaitingInteractions']=function(_0x475133,_0x3eb6b){return respondWithRpcPromise(_0xd46e('0x55'),_0x475133[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x3eb6b,null))[_0xd46e('0x15')](handleError(_0x3eb6b,null));};exports[_0xd46e('0x56')]=function(_0x510a1e,_0x10bcdb){return respondWithRpcPromise(_0xd46e('0x57'),_0x510a1e[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x10bcdb,null))[_0xd46e('0x15')](handleError(_0x10bcdb,null));};exports[_0xd46e('0x58')]=function(_0x21f193,_0xaf7c79){return respondWithRpcPromise(_0xd46e('0x57'),_0x21f193['query'],routingClient)[_0xd46e('0x14')](function(_0x1c1bae){if(_0x21f193['query'][_0xd46e('0x59')]!==undefined){var _0x3ba83f=_(_0x1c1bae[_0xd46e('0x11')])[_0xd46e('0x5a')]([_0x21f193[_0xd46e('0x13')][_0xd46e('0x59')],_0x21f193['params']['id']])['map'](_0xd46e('0x5b'))[_0xd46e('0x5c')]()['value']();return _0x1c1bae['rows']['filter'](function(_0x825746){return _0x3ba83f[_0xd46e('0x5d')](_0x825746[_0xd46e('0x5b')])>-0x1;});}else{return _0x1c1bae['rows'][_0xd46e('0x5a')](function(_0x69ade9){return _0x69ade9[_0xd46e('0x5b')]===parseInt(_0x21f193['params']['id']);});}})['then'](respondWithResult(_0xaf7c79,null))['catch'](handleError(_0xaf7c79,null));};exports['smsQueuesWaitingInteractions']=function(_0x2d4410,_0x5d7c51){return respondWithRpcPromise(_0xd46e('0x5e'),_0x2d4410['query'],routingClient)['then'](respondWithResult(_0x5d7c51,null))[_0xd46e('0x15')](handleError(_0x5d7c51,null));};exports[_0xd46e('0x5f')]=function(_0x3df2c2,_0x2754ff){return respondWithRpcPromise(_0xd46e('0x60'),_0x3df2c2[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x2754ff,null))['catch'](handleError(_0x2754ff,null));};exports[_0xd46e('0x61')]=function(_0x383919,_0x114f2c){return respondWithRpcPromise(_0xd46e('0x62'),_0x383919['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x114f2c,null))[_0xd46e('0x15')](handleError(_0x114f2c,null));};exports['queueNotify']=function(_0x1309b5){return function(_0x483ef1,_0x2abaee){var _0x24a2e1,_0x5b54b6;var _0x59fb83=_[_0xd46e('0x63')](_0x1309b5);var _0x2c11b8=_0x1309b5===_0xd46e('0x64')?'Website':_0xd46e('0x65');return db[_0x59fb83+_0xd46e('0x66')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x483ef1[_0xd46e('0x1b')]['id']}})[_0xd46e('0x14')](function(_0x88460a){if(_[_0xd46e('0x10')](_0x88460a)){throw new Error(_0x59fb83+_0xd46e('0x68'));}_0x24a2e1=_0x88460a;return db[_0x59fb83+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x483ef1[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x59fb83+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x59fb83+_0x2c11b8],'as':_0xd46e('0x65')}]});})[_0xd46e('0x14')](function(_0x441f73){if(_[_0xd46e('0x10')](_0x441f73)){throw new Error(_0x59fb83+'\x20Message\x20not\x20found');}_0x5b54b6=_0x441f73;return _0x441f73[_0xd46e('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3436ff={'uniqueid':_0x1309b5+'.'+_0x5b54b6['id']+'.'+_0x5b54b6[_0xd46e('0x6b')]['id'],'FromUserId':_0x483ef1['user']['id'],'type':_0xd46e('0x6d')};_0x3436ff[_0x59fb83+_0xd46e('0x6e')]=_0x5b54b6['id'];_0x3436ff[_0x59fb83+_0xd46e('0x6f')]=_0x5b54b6[_0xd46e('0x6b')]['id'];_0x3436ff[_0xd46e('0x70')+_0x59fb83+_0x2c11b8+'Id']=_0x5b54b6[_0xd46e('0x65')]['id'];_0x3436ff['To'+_0x59fb83+_0xd46e('0x71')]=_0x24a2e1['id'];return db[_0x59fb83+_0xd46e('0x72')][_0xd46e('0x73')](_0x3436ff);})[_0xd46e('0x14')](function(){return respondWithRpcPromise(_0xd46e('0x74'),{'channel':_0x1309b5,'interaction':_0x5b54b6['Interaction'],'message':_0x5b54b6,'account':_0x5b54b6['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd46e('0x6d'),'appdata':_0x24a2e1[_0xd46e('0xe')]+','+(_0x5b54b6[_0xd46e('0x65')][_0xd46e('0x75')]||0x12c),'interval':_0xd46e('0x76')}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0x2abaee,null))['catch'](handleError(_0x2abaee,null));};};exports[_0xd46e('0x77')]=function(_0x127604,_0xa254f5){var _0x2c9703,_0x41443d;if(_[_0xd46e('0x10')](_0x127604['body'][_0xd46e('0x78')])){throw new Error(_0xd46e('0x79'));}var _0x59067a=_0x127604[_0xd46e('0x1f')][_0xd46e('0x78')];var _0x9e222d=_[_0xd46e('0x63')](_0x59067a);var _0x97ee80=_0x59067a===_0xd46e('0x64')?_0xd46e('0x7a'):_0xd46e('0x65');return db[_0xd46e('0x7b')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x127604[_0xd46e('0x1b')]['id'],'role':_0xd46e('0x3a')}})[_0xd46e('0x14')](function(_0x30dcfc){if(_['isNil'](_0x30dcfc)){throw new Error('Agent\x20not\x20found');}_0x2c9703=_0x30dcfc;return db[_0x9e222d+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x127604[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x9e222d+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x9e222d+_0x97ee80],'as':'Account'}]});})[_0xd46e('0x14')](function(_0x216143){if(_[_0xd46e('0x10')](_0x216143)){throw new Error(_0x9e222d+_0xd46e('0x7c'));}_0x41443d=_0x216143;return _0x216143['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd46e('0x14')](function(){var _0x191b48={'uniqueid':_0x59067a+'.'+_0x41443d['id']+'.'+_0x41443d['Interaction']['id'],'FromUserId':_0x127604[_0xd46e('0x2f')]['id'],'type':'queue','ToUserId':_0x2c9703['id']};_0x191b48[_0x9e222d+'MessageId']=_0x41443d['id'];_0x191b48[_0x9e222d+_0xd46e('0x6f')]=_0x41443d[_0xd46e('0x6b')]['id'];_0x191b48[_0xd46e('0x70')+_0x9e222d+_0x97ee80+'Id']=_0x41443d[_0xd46e('0x65')]['id'];return db[_0x9e222d+'TransferReport']['create'](_0x191b48);})[_0xd46e('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x59067a,'interaction':_0x41443d[_0xd46e('0x6b')],'message':_0x41443d,'account':_0x41443d['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2c9703[_0xd46e('0xe')]+','+(_0x41443d[_0xd46e('0x65')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0xa254f5,null))[_0xd46e('0x15')](handleError(_0xa254f5,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5d72a09..b77e5e4 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 _0xff2b=['put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id/run','run','post','create'];(function(_0x2c3412,_0x40edf6){var _0x246d2c=function(_0x1760ba){while(--_0x1760ba){_0x2c3412['push'](_0x2c3412['shift']());}};_0x246d2c(++_0x40edf6);}(_0xff2b,0x155));var _0xbff2=function(_0xed1509,_0x37f093){_0xed1509=_0xed1509-0x0;var _0x336cc3=_0xff2b[_0xed1509];return _0x336cc3;};'use strict';var multer=require(_0xbff2('0x0'));var util=require(_0xbff2('0x1'));var path=require(_0xbff2('0x2'));var timeout=require('connect-timeout');var express=require(_0xbff2('0x3'));var router=express[_0xbff2('0x4')]();var fs_extra=require(_0xbff2('0x5'));var auth=require(_0xbff2('0x6'));var interaction=require(_0xbff2('0x7'));var config=require('../../config/environment');var controller=require(_0xbff2('0x8'));router[_0xbff2('0x9')]('/',auth[_0xbff2('0xa')](),controller[_0xbff2('0xb')]);router['get']('/:id',auth[_0xbff2('0xa')](),controller['show']);router[_0xbff2('0x9')](_0xbff2('0xc'),auth['isAuthenticated'](),controller[_0xbff2('0xd')]);router[_0xbff2('0xe')]('/',auth[_0xbff2('0xa')](),controller[_0xbff2('0xf')]);router[_0xbff2('0x10')](_0xbff2('0x11'),auth[_0xbff2('0xa')](),controller[_0xbff2('0x12')]);router[_0xbff2('0x13')]('/:id',auth[_0xbff2('0xa')](),controller['destroy']);module[_0xbff2('0x14')]=router; \ No newline at end of file +var _0xaf0c=['post','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xaf0c,0x100));var _0xcaf0=function(_0xc0be57,_0x2d1e96){_0xc0be57=_0xc0be57-0x0;var _0x2d786d=_0xaf0c[_0xc0be57];return _0x2d786d;};'use strict';var multer=require(_0xcaf0('0x0'));var util=require(_0xcaf0('0x1'));var path=require(_0xcaf0('0x2'));var timeout=require(_0xcaf0('0x3'));var express=require('express');var router=express[_0xcaf0('0x4')]();var fs_extra=require(_0xcaf0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcaf0('0x6'));router[_0xcaf0('0x7')]('/',auth[_0xcaf0('0x8')](),controller[_0xcaf0('0x9')]);router[_0xcaf0('0x7')](_0xcaf0('0xa'),auth[_0xcaf0('0x8')](),controller[_0xcaf0('0xb')]);router['get'](_0xcaf0('0xc'),auth['isAuthenticated'](),controller[_0xcaf0('0xd')]);router[_0xcaf0('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xcaf0('0xa'),auth[_0xcaf0('0x8')](),controller['update']);router[_0xcaf0('0xf')](_0xcaf0('0xa'),auth[_0xcaf0('0x8')](),controller[_0xcaf0('0x10')]);module[_0xcaf0('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 9afa6c4..08753c0 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 _0xbc38=['csv','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','months','weeks','hours','minutes','days'];(function(_0xd28d70,_0x5c2d12){var _0x4aa4f7=function(_0x4222c8){while(--_0x4222c8){_0xd28d70['push'](_0xd28d70['shift']());}};_0x4aa4f7(++_0x5c2d12);}(_0xbc38,0xd4));var _0x8bc3=function(_0xba61fc,_0x4a4fa4){_0xba61fc=_0xba61fc-0x0;var _0x55752c=_0xbc38[_0xba61fc];return _0x55752c;};'use strict';var Sequelize=require('sequelize');module[_0x8bc3('0x0')]={'name':{'type':Sequelize[_0x8bc3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8bc3('0x1')]},'active':{'type':Sequelize[_0x8bc3('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8bc3('0x1')],'allowNull':![],'defaultValue':_0x8bc3('0x3')},'startAt':{'type':Sequelize[_0x8bc3('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8bc3('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8bc3('0x5')](_0x8bc3('0x6'),'quarters',_0x8bc3('0x7'),_0x8bc3('0x8'),'days',_0x8bc3('0x9'),_0x8bc3('0xa')),'allowNull':![],'defaultValue':_0x8bc3('0xb')},'output':{'type':Sequelize[_0x8bc3('0x5')](_0x8bc3('0xc'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x8bc3('0xc')},'type':{'type':Sequelize[_0x8bc3('0x5')](_0x8bc3('0xd'),_0x8bc3('0xe')),'allowNull':![],'defaultValue':_0x8bc3('0xd')},'sendMail':{'type':Sequelize[_0x8bc3('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x8bc3('0x1')]},'cc':{'type':Sequelize[_0x8bc3('0xf')]},'bcc':{'type':Sequelize[_0x8bc3('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x8bc3('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x41bf=['quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM'];(function(_0x5aa243,_0x42f129){var _0x294839=function(_0x3496f6){while(--_0x3496f6){_0x5aa243['push'](_0x5aa243['shift']());}};_0x294839(++_0x42f129);}(_0x41bf,0x1c1));var _0xf41b=function(_0x5822cd,_0x569401){_0x5822cd=_0x5822cd-0x0;var _0x358517=_0x41bf[_0x5822cd];return _0x358517;};'use strict';var Sequelize=require(_0xf41b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf41b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xf41b('0x1')]},'active':{'type':Sequelize[_0xf41b('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf41b('0x3')},'startAt':{'type':Sequelize[_0xf41b('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf41b('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf41b('0x6')]('years',_0xf41b('0x7'),_0xf41b('0x8'),_0xf41b('0x9'),_0xf41b('0xa'),_0xf41b('0xb'),_0xf41b('0xc')),'allowNull':![],'defaultValue':_0xf41b('0xa')},'output':{'type':Sequelize['ENUM'](_0xf41b('0xd'),_0xf41b('0xe'),_0xf41b('0xf')),'allowNull':![],'defaultValue':_0xf41b('0xd')},'type':{'type':Sequelize[_0xf41b('0x6')](_0xf41b('0x10'),_0xf41b('0x11')),'allowNull':![],'defaultValue':_0xf41b('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf41b('0x1')]},'cc':{'type':Sequelize[_0xf41b('0x12')]},'bcc':{'type':Sequelize[_0xf41b('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xf41b('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 f1abe28..09e1b80 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 _0xfed0=['bluebird','util','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','then','destroy','get','end','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','keys','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','filters','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x38b5db,_0x9555ee){var _0x43bee1=function(_0x2afb12){while(--_0x2afb12){_0x38b5db['push'](_0x38b5db['shift']());}};_0x43bee1(++_0x9555ee);}(_0xfed0,0xeb));var _0x0fed=function(_0x14dfef,_0x1594ef){_0x14dfef=_0x14dfef-0x0;var _0x454ed6=_0xfed0[_0x14dfef];return _0x454ed6;};'use strict';var emlformat=require(_0x0fed('0x0'));var rimraf=require(_0x0fed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fed('0x2'));var rp=require(_0x0fed('0x3'));var moment=require(_0x0fed('0x4'));var BPromise=require(_0x0fed('0x5'));var Mustache=require('mustache');var util=require(_0x0fed('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0fed('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fed('0x8'));var squel=require(_0x0fed('0x9'));var crypto=require('crypto');var jsforce=require(_0x0fed('0xa'));var deskjs=require(_0x0fed('0xb'));var toCsv=require(_0x0fed('0xc'));var querystring=require('querystring');var Papa=require(_0x0fed('0xd'));var Redis=require(_0x0fed('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fed('0xf'));var as=require(_0x0fed('0x10'));var hardwareService=require(_0x0fed('0x11'));var logger=require('../../config/logger')(_0x0fed('0x12'));var utils=require(_0x0fed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0fed('0x14'));var db=require(_0x0fed('0x15'))['db'];function respondWithStatusCode(_0x3151d5,_0x154b48){_0x154b48=_0x154b48||0xcc;return function(_0x451ca5){if(_0x451ca5){return _0x3151d5[_0x0fed('0x16')](_0x154b48);}return _0x3151d5[_0x0fed('0x17')](_0x154b48)['end']();};}function respondWithResult(_0x7f1b12,_0x3c997e){_0x3c997e=_0x3c997e||0xc8;return function(_0x193e2f){if(_0x193e2f){return _0x7f1b12['status'](_0x3c997e)[_0x0fed('0x18')](_0x193e2f);}};}function respondWithFilteredResult(_0x3e1ba3,_0x370584){return function(_0x15dc32){if(_0x15dc32){var _0x339e1d=typeof _0x370584[_0x0fed('0x19')]===_0x0fed('0x1a')&&typeof _0x370584[_0x0fed('0x1b')]===_0x0fed('0x1a');var _0x5300f0=_0x15dc32[_0x0fed('0x1c')];var _0x3fe0fa=_0x339e1d?0x0:_0x370584[_0x0fed('0x19')];var _0x7b21f8=_0x339e1d?_0x15dc32[_0x0fed('0x1c')]:_0x370584[_0x0fed('0x19')]+_0x370584[_0x0fed('0x1b')];var _0x306eee;if(_0x7b21f8>=_0x5300f0){_0x7b21f8=_0x5300f0;_0x306eee=0xc8;}else{_0x306eee=0xce;}_0x3e1ba3[_0x0fed('0x17')](_0x306eee);return _0x3e1ba3['set']('Content-Range',_0x3fe0fa+'-'+_0x7b21f8+'/'+_0x5300f0)['json'](_0x15dc32);}return null;};}function patchUpdates(_0x5d520f){return function(_0x10cb8c){try{jsonpatch['apply'](_0x10cb8c,_0x5d520f,!![]);}catch(_0x1652be){return BPromise[_0x0fed('0x1d')](_0x1652be);}return _0x10cb8c[_0x0fed('0x1e')]();};}function saveUpdates(_0x2d2fe2,_0x1d5cd0){return function(_0x245b74){if(_0x245b74){return _0x245b74['update'](_0x2d2fe2)[_0x0fed('0x1f')](function(_0x24fe3c){return _0x24fe3c;});}return null;};}function removeEntity(_0xdb41ec,_0x1552d7){return function(_0x478ed9){if(_0x478ed9){return _0x478ed9[_0x0fed('0x20')]()['then'](function(){var _0x1c395f=_0x478ed9[_0x0fed('0x21')]({'plain':!![]});var _0x588a5a='Scheduler';return db['UserProfileResource'][_0x0fed('0x20')]({'where':{'type':_0x588a5a,'resourceId':_0x1c395f['id']}})[_0x0fed('0x1f')](function(){return _0x478ed9;});})[_0x0fed('0x1f')](function(){_0xdb41ec[_0x0fed('0x17')](0xcc)[_0x0fed('0x22')]();});}};}function handleEntityNotFound(_0x65ca53,_0x27e0ca){return function(_0x20d369){if(!_0x20d369){_0x65ca53[_0x0fed('0x16')](0x194);}return _0x20d369;};}function handleError(_0x2e01ad,_0x1d4d9d){_0x1d4d9d=_0x1d4d9d||0x1f4;return function(_0x30b428){logger['error'](_0x30b428[_0x0fed('0x23')]);if(_0x30b428[_0x0fed('0x24')]){delete _0x30b428[_0x0fed('0x24')];}_0x2e01ad[_0x0fed('0x17')](_0x1d4d9d)[_0x0fed('0x25')](_0x30b428);};}exports[_0x0fed('0x26')]=function(_0x52a441,_0x4fb474){var _0x360ddc={},_0x271066={},_0x383039={'count':0x0,'rows':[]};var _0xa8c13d=_[_0x0fed('0x27')](db[_0x0fed('0x28')][_0x0fed('0x29')],function(_0x293177){return{'name':_0x293177[_0x0fed('0x2a')],'type':_0x293177[_0x0fed('0x2b')]['key']};});_0x271066[_0x0fed('0x2c')]=_['map'](_0xa8c13d,_0x0fed('0x24'));_0x271066['query']=_[_0x0fed('0x2d')](_0x52a441['query']);_0x271066['filters']=_[_0x0fed('0x2e')](_0x271066[_0x0fed('0x2c')],_0x271066['query']);_0x360ddc[_0x0fed('0x2f')]=_[_0x0fed('0x2e')](_0x271066[_0x0fed('0x2c')],qs[_0x0fed('0x30')](_0x52a441[_0x0fed('0x31')][_0x0fed('0x30')]));_0x360ddc[_0x0fed('0x2f')]=_0x360ddc[_0x0fed('0x2f')][_0x0fed('0x32')]?_0x360ddc[_0x0fed('0x2f')]:_0x271066[_0x0fed('0x2c')];if(!_0x52a441['query']['hasOwnProperty'](_0x0fed('0x33'))){_0x360ddc[_0x0fed('0x1b')]=qs[_0x0fed('0x1b')](_0x52a441[_0x0fed('0x31')][_0x0fed('0x1b')]);_0x360ddc[_0x0fed('0x19')]=qs['offset'](_0x52a441['query'][_0x0fed('0x19')]);}_0x360ddc[_0x0fed('0x34')]=qs['sort'](_0x52a441[_0x0fed('0x31')][_0x0fed('0x35')]);_0x360ddc[_0x0fed('0x36')]=qs['filters'](_[_0x0fed('0x37')](_0x52a441[_0x0fed('0x31')],_0x271066['filters']),_0xa8c13d);if(_0x52a441[_0x0fed('0x31')]['filter']){_0x360ddc[_0x0fed('0x36')]=_[_0x0fed('0x38')](_0x360ddc[_0x0fed('0x36')],{'$or':_[_0x0fed('0x27')](_0xa8c13d,function(_0x3f7b7d){if(_0x3f7b7d[_0x0fed('0x2b')]!=='VIRTUAL'){var _0x351a8f={};_0x351a8f[_0x3f7b7d[_0x0fed('0x24')]]={'$like':'%'+_0x52a441[_0x0fed('0x31')][_0x0fed('0x39')]+'%'};return _0x351a8f;}})});}_0x360ddc=_[_0x0fed('0x38')]({},_0x360ddc,_0x52a441[_0x0fed('0x3a')]);var _0x32f651={'where':_0x360ddc[_0x0fed('0x36')]};return db[_0x0fed('0x28')][_0x0fed('0x1c')](_0x32f651)['then'](function(_0x55d4d5){_0x383039[_0x0fed('0x1c')]=_0x55d4d5;if(_0x52a441['query']['includeAll']){_0x360ddc[_0x0fed('0x3b')]=[{'all':!![]}];}return db['Schedule'][_0x0fed('0x3c')](_0x360ddc);})['then'](function(_0x3b8164){_0x383039[_0x0fed('0x3d')]=_0x3b8164;return _0x383039;})['then'](respondWithFilteredResult(_0x4fb474,_0x360ddc))[_0x0fed('0x3e')](handleError(_0x4fb474,null));};exports[_0x0fed('0x3f')]=function(_0x23beb3,_0x27d95e){var _0x228258={'raw':![],'where':{'id':_0x23beb3[_0x0fed('0x40')]['id']}},_0x565cc2={};_0x565cc2['model']=_[_0x0fed('0x2d')](db[_0x0fed('0x28')][_0x0fed('0x29')]);_0x565cc2[_0x0fed('0x31')]=_[_0x0fed('0x2d')](_0x23beb3[_0x0fed('0x31')]);_0x565cc2[_0x0fed('0x41')]=_[_0x0fed('0x2e')](_0x565cc2[_0x0fed('0x2c')],_0x565cc2[_0x0fed('0x31')]);_0x228258['attributes']=_['intersection'](_0x565cc2[_0x0fed('0x2c')],qs[_0x0fed('0x30')](_0x23beb3['query']['fields']));_0x228258[_0x0fed('0x2f')]=_0x228258[_0x0fed('0x2f')][_0x0fed('0x32')]?_0x228258[_0x0fed('0x2f')]:_0x565cc2[_0x0fed('0x2c')];if(_0x23beb3[_0x0fed('0x31')][_0x0fed('0x42')]){_0x228258[_0x0fed('0x3b')]=[{'all':!![]}];}_0x228258=_[_0x0fed('0x38')]({},_0x228258,_0x23beb3[_0x0fed('0x3a')]);return db[_0x0fed('0x28')][_0x0fed('0x43')](_0x228258)[_0x0fed('0x1f')](handleEntityNotFound(_0x27d95e,null))['then'](respondWithResult(_0x27d95e,null))['catch'](handleError(_0x27d95e,null));};exports[_0x0fed('0x44')]=function(_0x5775da,_0x182d99){return db[_0x0fed('0x28')]['create'](_0x5775da[_0x0fed('0x45')],{})[_0x0fed('0x1f')](function(_0x33ec09){var _0x5817cc=_0x5775da[_0x0fed('0x46')][_0x0fed('0x21')]({'plain':!![]});if(!_0x5817cc)throw new Error(_0x0fed('0x47'));if(_0x5817cc[_0x0fed('0x48')]===_0x0fed('0x46')){var _0x1678b0=_0x33ec09[_0x0fed('0x21')]({'plain':!![]});var _0x54f83f='Scheduler';return db['UserProfileSection'][_0x0fed('0x43')]({'where':{'name':_0x54f83f,'userProfileId':_0x5817cc[_0x0fed('0x49')]},'raw':!![]})[_0x0fed('0x1f')](function(_0x5f1139){if(_0x5f1139&&_0x5f1139[_0x0fed('0x4a')]===0x0){return db[_0x0fed('0x4b')][_0x0fed('0x44')]({'name':_0x1678b0[_0x0fed('0x24')],'resourceId':_0x1678b0['id'],'type':_0x5f1139[_0x0fed('0x24')],'sectionId':_0x5f1139['id']},{})['then'](function(){return _0x33ec09;});}else{return _0x33ec09;}})[_0x0fed('0x3e')](function(_0x451579){logger[_0x0fed('0x4c')](_0x0fed('0x4d'),_0x451579);throw _0x451579;});}return _0x33ec09;})['then'](respondWithResult(_0x182d99,0xc9))['catch'](handleError(_0x182d99,null));};exports[_0x0fed('0x4e')]=function(_0xa1bea3,_0x294a9a){if(_0xa1bea3[_0x0fed('0x45')]['id']){delete _0xa1bea3[_0x0fed('0x45')]['id'];}return db[_0x0fed('0x28')][_0x0fed('0x43')]({'where':{'id':_0xa1bea3['params']['id']}})[_0x0fed('0x1f')](handleEntityNotFound(_0x294a9a,null))['then'](saveUpdates(_0xa1bea3['body'],null))[_0x0fed('0x1f')](respondWithResult(_0x294a9a,null))['catch'](handleError(_0x294a9a,null));};exports['destroy']=function(_0x468b3c,_0x476f8c){return db[_0x0fed('0x28')]['find']({'where':{'id':_0x468b3c[_0x0fed('0x40')]['id']}})[_0x0fed('0x1f')](handleEntityNotFound(_0x476f8c,null))['then'](removeEntity(_0x476f8c,null))[_0x0fed('0x3e')](handleError(_0x476f8c,null));};exports[_0x0fed('0x4f')]=function(_0x39e3da,_0x10c21c,_0x477977){var _0x1fc5c7=require('../../config/schedule');return db['Schedule'][_0x0fed('0x43')]({'where':{'id':_0x39e3da[_0x0fed('0x40')]['id']},'raw':!![]})[_0x0fed('0x1f')](handleEntityNotFound(_0x10c21c,null))[_0x0fed('0x1f')](function(){_0x1fc5c7['run'](_0x39e3da[_0x0fed('0x40')]['id']);})[_0x0fed('0x1f')](respondWithStatusCode(_0x10c21c,null))[_0x0fed('0x3e')](handleError(_0x10c21c,null));}; \ No newline at end of file +var _0x1d3b=['update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','merge','VIRTUAL','filter','count','include','findAll','show','params','keys','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','Content-Range','reject','save'];(function(_0x507a18,_0x1323ee){var _0x1e9de4=function(_0x3b0cc2){while(--_0x3b0cc2){_0x507a18['push'](_0x507a18['shift']());}};_0x1e9de4(++_0x1323ee);}(_0x1d3b,0x136));var _0xb1d3=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x1d3b[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0xb1d3('0x0'));var rimraf=require(_0xb1d3('0x1'));var zipdir=require(_0xb1d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1d3('0x3'));var moment=require(_0xb1d3('0x4'));var BPromise=require(_0xb1d3('0x5'));var Mustache=require(_0xb1d3('0x6'));var util=require(_0xb1d3('0x7'));var path=require(_0xb1d3('0x8'));var sox=require(_0xb1d3('0x9'));var csv=require(_0xb1d3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1d3('0xb'));var _=require(_0xb1d3('0xc'));var squel=require(_0xb1d3('0xd'));var crypto=require('crypto');var jsforce=require(_0xb1d3('0xe'));var deskjs=require(_0xb1d3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb1d3('0x10'));var Papa=require('papaparse');var Redis=require(_0xb1d3('0x11'));var authService=require(_0xb1d3('0x12'));var qs=require(_0xb1d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1d3('0x14'));var logger=require(_0xb1d3('0x15'))(_0xb1d3('0x16'));var utils=require('../../config/utils');var config=require(_0xb1d3('0x17'));var licenseUtil=require(_0xb1d3('0x18'));var db=require(_0xb1d3('0x19'))['db'];function respondWithStatusCode(_0x372f9c,_0x308ae0){_0x308ae0=_0x308ae0||0xcc;return function(_0x3af827){if(_0x3af827){return _0x372f9c['sendStatus'](_0x308ae0);}return _0x372f9c[_0xb1d3('0x1a')](_0x308ae0)[_0xb1d3('0x1b')]();};}function respondWithResult(_0x5a6588,_0x30898c){_0x30898c=_0x30898c||0xc8;return function(_0x324891){if(_0x324891){return _0x5a6588[_0xb1d3('0x1a')](_0x30898c)[_0xb1d3('0x1c')](_0x324891);}};}function respondWithFilteredResult(_0x3f241a,_0x48d6a8){return function(_0x4d7751){if(_0x4d7751){var _0x2b5b94=typeof _0x48d6a8['offset']===_0xb1d3('0x1d')&&typeof _0x48d6a8[_0xb1d3('0x1e')]==='undefined';var _0xb421c9=_0x4d7751['count'];var _0x458baf=_0x2b5b94?0x0:_0x48d6a8['offset'];var _0x4bff4b=_0x2b5b94?_0x4d7751['count']:_0x48d6a8['offset']+_0x48d6a8['limit'];var _0x489459;if(_0x4bff4b>=_0xb421c9){_0x4bff4b=_0xb421c9;_0x489459=0xc8;}else{_0x489459=0xce;}_0x3f241a['status'](_0x489459);return _0x3f241a['set'](_0xb1d3('0x1f'),_0x458baf+'-'+_0x4bff4b+'/'+_0xb421c9)[_0xb1d3('0x1c')](_0x4d7751);}return null;};}function patchUpdates(_0x588f90){return function(_0x37e2bd){try{jsonpatch['apply'](_0x37e2bd,_0x588f90,!![]);}catch(_0x5abddc){return BPromise[_0xb1d3('0x20')](_0x5abddc);}return _0x37e2bd[_0xb1d3('0x21')]();};}function saveUpdates(_0x2b7e99,_0x582547){return function(_0x285ca1){if(_0x285ca1){return _0x285ca1[_0xb1d3('0x22')](_0x2b7e99)[_0xb1d3('0x23')](function(_0x1e6b8a){return _0x1e6b8a;});}return null;};}function removeEntity(_0x9a4c00,_0x46e7eb){return function(_0x26d6cc){if(_0x26d6cc){return _0x26d6cc[_0xb1d3('0x24')]()[_0xb1d3('0x23')](function(){var _0x340f3b=_0x26d6cc[_0xb1d3('0x25')]({'plain':!![]});var _0x13183b=_0xb1d3('0x26');return db[_0xb1d3('0x27')][_0xb1d3('0x24')]({'where':{'type':_0x13183b,'resourceId':_0x340f3b['id']}})[_0xb1d3('0x23')](function(){return _0x26d6cc;});})[_0xb1d3('0x23')](function(){_0x9a4c00[_0xb1d3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x62e8e7,_0x29762d){return function(_0x479562){if(!_0x479562){_0x62e8e7[_0xb1d3('0x28')](0x194);}return _0x479562;};}function handleError(_0x10ee16,_0x2f60cc){_0x2f60cc=_0x2f60cc||0x1f4;return function(_0x5e1838){logger[_0xb1d3('0x29')](_0x5e1838[_0xb1d3('0x2a')]);if(_0x5e1838[_0xb1d3('0x2b')]){delete _0x5e1838[_0xb1d3('0x2b')];}_0x10ee16['status'](_0x2f60cc)[_0xb1d3('0x2c')](_0x5e1838);};}exports[_0xb1d3('0x2d')]=function(_0x4d7460,_0x3a9617){var _0x17047d={},_0x6ac321={},_0xa507c0={'count':0x0,'rows':[]};var _0x3da909=_[_0xb1d3('0x2e')](db[_0xb1d3('0x2f')][_0xb1d3('0x30')],function(_0xf0b6ff){return{'name':_0xf0b6ff[_0xb1d3('0x31')],'type':_0xf0b6ff[_0xb1d3('0x32')]['key']};});_0x6ac321['model']=_[_0xb1d3('0x2e')](_0x3da909,'name');_0x6ac321[_0xb1d3('0x33')]=_['keys'](_0x4d7460[_0xb1d3('0x33')]);_0x6ac321['filters']=_[_0xb1d3('0x34')](_0x6ac321[_0xb1d3('0x35')],_0x6ac321['query']);_0x17047d[_0xb1d3('0x36')]=_[_0xb1d3('0x34')](_0x6ac321[_0xb1d3('0x35')],qs['fields'](_0x4d7460['query'][_0xb1d3('0x37')]));_0x17047d['attributes']=_0x17047d[_0xb1d3('0x36')][_0xb1d3('0x38')]?_0x17047d[_0xb1d3('0x36')]:_0x6ac321[_0xb1d3('0x35')];if(!_0x4d7460['query'][_0xb1d3('0x39')](_0xb1d3('0x3a'))){_0x17047d[_0xb1d3('0x1e')]=qs[_0xb1d3('0x1e')](_0x4d7460['query']['limit']);_0x17047d[_0xb1d3('0x3b')]=qs[_0xb1d3('0x3b')](_0x4d7460[_0xb1d3('0x33')][_0xb1d3('0x3b')]);}_0x17047d[_0xb1d3('0x3c')]=qs['sort'](_0x4d7460[_0xb1d3('0x33')][_0xb1d3('0x3d')]);_0x17047d[_0xb1d3('0x3e')]=qs[_0xb1d3('0x3f')](_['pick'](_0x4d7460[_0xb1d3('0x33')],_0x6ac321['filters']),_0x3da909);if(_0x4d7460[_0xb1d3('0x33')]['filter']){_0x17047d[_0xb1d3('0x3e')]=_[_0xb1d3('0x40')](_0x17047d['where'],{'$or':_[_0xb1d3('0x2e')](_0x3da909,function(_0x359aeb){if(_0x359aeb['type']!==_0xb1d3('0x41')){var _0x3b894a={};_0x3b894a[_0x359aeb[_0xb1d3('0x2b')]]={'$like':'%'+_0x4d7460[_0xb1d3('0x33')][_0xb1d3('0x42')]+'%'};return _0x3b894a;}})});}_0x17047d=_[_0xb1d3('0x40')]({},_0x17047d,_0x4d7460['options']);var _0x1b5c9c={'where':_0x17047d[_0xb1d3('0x3e')]};return db['Schedule'][_0xb1d3('0x43')](_0x1b5c9c)[_0xb1d3('0x23')](function(_0x433f51){_0xa507c0[_0xb1d3('0x43')]=_0x433f51;if(_0x4d7460[_0xb1d3('0x33')]['includeAll']){_0x17047d[_0xb1d3('0x44')]=[{'all':!![]}];}return db[_0xb1d3('0x2f')][_0xb1d3('0x45')](_0x17047d);})[_0xb1d3('0x23')](function(_0x4e855a){_0xa507c0['rows']=_0x4e855a;return _0xa507c0;})['then'](respondWithFilteredResult(_0x3a9617,_0x17047d))['catch'](handleError(_0x3a9617,null));};exports[_0xb1d3('0x46')]=function(_0x4dec18,_0x2bf3e2){var _0x4561cf={'raw':![],'where':{'id':_0x4dec18[_0xb1d3('0x47')]['id']}},_0x2d3427={};_0x2d3427[_0xb1d3('0x35')]=_[_0xb1d3('0x48')](db[_0xb1d3('0x2f')][_0xb1d3('0x30')]);_0x2d3427[_0xb1d3('0x33')]=_[_0xb1d3('0x48')](_0x4dec18[_0xb1d3('0x33')]);_0x2d3427[_0xb1d3('0x3f')]=_[_0xb1d3('0x34')](_0x2d3427[_0xb1d3('0x35')],_0x2d3427[_0xb1d3('0x33')]);_0x4561cf[_0xb1d3('0x36')]=_[_0xb1d3('0x34')](_0x2d3427[_0xb1d3('0x35')],qs[_0xb1d3('0x37')](_0x4dec18['query'][_0xb1d3('0x37')]));_0x4561cf['attributes']=_0x4561cf[_0xb1d3('0x36')][_0xb1d3('0x38')]?_0x4561cf[_0xb1d3('0x36')]:_0x2d3427[_0xb1d3('0x35')];if(_0x4dec18[_0xb1d3('0x33')]['includeAll']){_0x4561cf[_0xb1d3('0x44')]=[{'all':!![]}];}_0x4561cf=_[_0xb1d3('0x40')]({},_0x4561cf,_0x4dec18[_0xb1d3('0x49')]);return db[_0xb1d3('0x2f')][_0xb1d3('0x4a')](_0x4561cf)[_0xb1d3('0x23')](handleEntityNotFound(_0x2bf3e2,null))[_0xb1d3('0x23')](respondWithResult(_0x2bf3e2,null))[_0xb1d3('0x4b')](handleError(_0x2bf3e2,null));};exports['create']=function(_0xe11260,_0x487d29){return db[_0xb1d3('0x2f')]['create'](_0xe11260[_0xb1d3('0x4c')],{})[_0xb1d3('0x23')](function(_0x4ca563){var _0x5b8d85=_0xe11260[_0xb1d3('0x4d')][_0xb1d3('0x25')]({'plain':!![]});if(!_0x5b8d85)throw new Error(_0xb1d3('0x4e'));if(_0x5b8d85[_0xb1d3('0x4f')]===_0xb1d3('0x4d')){var _0x2171af=_0x4ca563[_0xb1d3('0x25')]({'plain':!![]});var _0x2ed712=_0xb1d3('0x26');return db[_0xb1d3('0x50')][_0xb1d3('0x4a')]({'where':{'name':_0x2ed712,'userProfileId':_0x5b8d85[_0xb1d3('0x51')]},'raw':!![]})[_0xb1d3('0x23')](function(_0x373a53){if(_0x373a53&&_0x373a53[_0xb1d3('0x52')]===0x0){return db[_0xb1d3('0x27')][_0xb1d3('0x53')]({'name':_0x2171af[_0xb1d3('0x2b')],'resourceId':_0x2171af['id'],'type':_0x373a53[_0xb1d3('0x2b')],'sectionId':_0x373a53['id']},{})['then'](function(){return _0x4ca563;});}else{return _0x4ca563;}})['catch'](function(_0x1058ce){logger[_0xb1d3('0x29')](_0xb1d3('0x54'),_0x1058ce);throw _0x1058ce;});}return _0x4ca563;})[_0xb1d3('0x23')](respondWithResult(_0x487d29,0xc9))[_0xb1d3('0x4b')](handleError(_0x487d29,null));};exports[_0xb1d3('0x22')]=function(_0x41f780,_0x52ee73){if(_0x41f780[_0xb1d3('0x4c')]['id']){delete _0x41f780[_0xb1d3('0x4c')]['id'];}return db[_0xb1d3('0x2f')][_0xb1d3('0x4a')]({'where':{'id':_0x41f780[_0xb1d3('0x47')]['id']}})['then'](handleEntityNotFound(_0x52ee73,null))[_0xb1d3('0x23')](saveUpdates(_0x41f780[_0xb1d3('0x4c')],null))[_0xb1d3('0x23')](respondWithResult(_0x52ee73,null))['catch'](handleError(_0x52ee73,null));};exports[_0xb1d3('0x24')]=function(_0x5957c2,_0x30cd96){return db[_0xb1d3('0x2f')][_0xb1d3('0x4a')]({'where':{'id':_0x5957c2[_0xb1d3('0x47')]['id']}})[_0xb1d3('0x23')](handleEntityNotFound(_0x30cd96,null))[_0xb1d3('0x23')](removeEntity(_0x30cd96,null))[_0xb1d3('0x4b')](handleError(_0x30cd96,null));};exports['run']=function(_0x4bade0,_0x1bf283,_0x58ee25){var _0xa4956=require(_0xb1d3('0x55'));return db[_0xb1d3('0x2f')][_0xb1d3('0x4a')]({'where':{'id':_0x4bade0[_0xb1d3('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1bf283,null))['then'](function(){_0xa4956['run'](_0x4bade0['params']['id']);})['then'](respondWithStatusCode(_0x1bf283,null))['catch'](handleError(_0x1bf283,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 9a33ed8..7048bc0 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 _0x0ee9=['tools_schedules','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x1d5458,_0x3acf09){var _0x9bf6f=function(_0x8d948c){while(--_0x8d948c){_0x1d5458['push'](_0x1d5458['shift']());}};_0x9bf6f(++_0x3acf09);}(_0x0ee9,0x139));var _0x90ee=function(_0x2b3893,_0x12d9fc){_0x2b3893=_0x2b3893-0x0;var _0xe49e58=_0x0ee9[_0x2b3893];return _0xe49e58;};'use strict';var _=require(_0x90ee('0x0'));var util=require(_0x90ee('0x1'));var logger=require('../../config/logger')(_0x90ee('0x2'));var moment=require('moment');var BPromise=require(_0x90ee('0x3'));var rp=require(_0x90ee('0x4'));var fs=require('fs');var path=require(_0x90ee('0x5'));var rimraf=require(_0x90ee('0x6'));var config=require(_0x90ee('0x7'));var attributes=require(_0x90ee('0x8'));module[_0x90ee('0x9')]=function(_0x3906b3,_0x440cc0){return _0x3906b3[_0x90ee('0xa')](_0x90ee('0xb'),attributes,{'tableName':_0x90ee('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e6f=['path','./schedule.attributes','exports','define','Schedule','lodash','util','api','moment','bluebird','request-promise'];(function(_0x315216,_0x15d0cc){var _0x4dfb84=function(_0x7e1a19){while(--_0x7e1a19){_0x315216['push'](_0x315216['shift']());}};_0x4dfb84(++_0x15d0cc);}(_0x4e6f,0x1b2));var _0xf4e6=function(_0x2ad281,_0x5f26b8){_0x2ad281=_0x2ad281-0x0;var _0x1ee938=_0x4e6f[_0x2ad281];return _0x1ee938;};'use strict';var _=require(_0xf4e6('0x0'));var util=require(_0xf4e6('0x1'));var logger=require('../../config/logger')(_0xf4e6('0x2'));var moment=require(_0xf4e6('0x3'));var BPromise=require(_0xf4e6('0x4'));var rp=require(_0xf4e6('0x5'));var fs=require('fs');var path=require(_0xf4e6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4e6('0x7'));module[_0xf4e6('0x8')]=function(_0x2198bc,_0x1a35eb){return _0x2198bc[_0xf4e6('0x9')](_0xf4e6('0xa'),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 a5456c3..496830d 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 _0x493c=['rpc','../../config/environment','jayson/promise','request','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xa4dc1a,_0x357ff0){var _0x23518e=function(_0x4ddd94){while(--_0x4ddd94){_0xa4dc1a['push'](_0xa4dc1a['shift']());}};_0x23518e(++_0x357ff0);}(_0x493c,0xe9));var _0xc493=function(_0xb0a484,_0x1cbb4f){_0xb0a484=_0xb0a484-0x0;var _0x3f464d=_0x493c[_0xb0a484];return _0x3f464d;};'use strict';var _=require(_0xc493('0x0'));var util=require('util');var moment=require(_0xc493('0x1'));var BPromise=require(_0xc493('0x2'));var rs=require(_0xc493('0x3'));var fs=require('fs');var Redis=require(_0xc493('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc493('0x5'));var logger=require(_0xc493('0x6'))(_0xc493('0x7'));var config=require(_0xc493('0x8'));var jayson=require(_0xc493('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x156cb9,_0x6645ec,_0x2c4c30){return new BPromise(function(_0xa0d6db,_0x1fb113){return client[_0xc493('0xa')](_0x156cb9,_0x2c4c30)[_0xc493('0xb')](function(_0xfaf559){logger['info'](_0xc493('0xc'),_0x6645ec,_0xc493('0xd'));logger['debug'](_0xc493('0xe'),_0x6645ec,'request\x20sent',JSON[_0xc493('0xf')](_0xfaf559));if(_0xfaf559[_0xc493('0x10')]){if(_0xfaf559['error'][_0xc493('0x11')]===0x1f4){logger[_0xc493('0x10')](_0xc493('0xc'),_0x6645ec,_0xfaf559['error'][_0xc493('0x12')]);return _0x1fb113(_0xfaf559[_0xc493('0x10')][_0xc493('0x12')]);}logger[_0xc493('0x10')](_0xc493('0xc'),_0x6645ec,_0xfaf559[_0xc493('0x10')][_0xc493('0x12')]);return _0xa0d6db(_0xfaf559[_0xc493('0x10')][_0xc493('0x12')]);}else{logger['info'](_0xc493('0xc'),_0x6645ec,'request\x20sent');_0xa0d6db(_0xfaf559[_0xc493('0x13')][_0xc493('0x12')]);}})['catch'](function(_0x20c6e7){logger[_0xc493('0x10')](_0xc493('0xc'),_0x6645ec,_0x20c6e7);_0x1fb113(_0x20c6e7);});});} \ No newline at end of file +var _0x7820=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash'];(function(_0x3d1ec3,_0x1fa038){var _0x3aabcb=function(_0x16af6c){while(--_0x16af6c){_0x3d1ec3['push'](_0x3d1ec3['shift']());}};_0x3aabcb(++_0x1fa038);}(_0x7820,0x1cd));var _0x0782=function(_0x3fce89,_0x295603){_0x3fce89=_0x3fce89-0x0;var _0xd90307=_0x7820[_0x3fce89];return _0xd90307;};'use strict';var _=require(_0x0782('0x0'));var util=require(_0x0782('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0782('0x2'));var fs=require('fs');var Redis=require(_0x0782('0x3'));var db=require(_0x0782('0x4'))['db'];var utils=require(_0x0782('0x5'));var logger=require(_0x0782('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0782('0x7'));var client=jayson[_0x0782('0x8')][_0x0782('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fb4b4,_0x2206d4,_0xd4b579){return new BPromise(function(_0x53096c,_0x3fa11e){return client[_0x0782('0xa')](_0x2fb4b4,_0xd4b579)[_0x0782('0xb')](function(_0x32e0e3){logger[_0x0782('0xc')](_0x0782('0xd'),_0x2206d4,'request\x20sent');logger[_0x0782('0xe')](_0x0782('0xf'),_0x2206d4,_0x0782('0x10'),JSON['stringify'](_0x32e0e3));if(_0x32e0e3[_0x0782('0x11')]){if(_0x32e0e3['error'][_0x0782('0x12')]===0x1f4){logger[_0x0782('0x11')](_0x0782('0xd'),_0x2206d4,_0x32e0e3[_0x0782('0x11')]['message']);return _0x3fa11e(_0x32e0e3['error']['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x2206d4,_0x32e0e3[_0x0782('0x11')]['message']);return _0x53096c(_0x32e0e3[_0x0782('0x11')][_0x0782('0x13')]);}else{logger[_0x0782('0xc')]('Schedule,\x20%s,\x20%s',_0x2206d4,_0x0782('0x10'));_0x53096c(_0x32e0e3['result'][_0x0782('0x13')]);}})[_0x0782('0x14')](function(_0x1aef67){logger[_0x0782('0x11')]('Schedule,\x20%s,\x20%s',_0x2206d4,_0x1aef67);_0x3fa11e(_0x1aef67);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8dc8553..91d4b2b 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 _0xc179=['isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe'];(function(_0x40d683,_0x43a7c7){var _0x17daf6=function(_0x3b2681){while(--_0x3b2681){_0x40d683['push'](_0x40d683['shift']());}};_0x17daf6(++_0x43a7c7);}(_0xc179,0xa2));var _0x9c17=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xc179[_0x487ab4];return _0x3bef77;};'use strict';var multer=require(_0x9c17('0x0'));var util=require(_0x9c17('0x1'));var path=require(_0x9c17('0x2'));var timeout=require(_0x9c17('0x3'));var express=require('express');var router=express[_0x9c17('0x4')]();var fs_extra=require(_0x9c17('0x5'));var auth=require(_0x9c17('0x6'));var interaction=require(_0x9c17('0x7'));var config=require(_0x9c17('0x8'));var controller=require(_0x9c17('0x9'));router[_0x9c17('0xa')]('/',auth['isAuthenticated'](),controller[_0x9c17('0xb')]);router[_0x9c17('0xa')](_0x9c17('0xc'),auth[_0x9c17('0xd')](),controller['describe']);router['get'](_0x9c17('0xe'),auth[_0x9c17('0xd')](),controller[_0x9c17('0xf')]);router['get'](_0x9c17('0x10'),auth[_0x9c17('0xd')](),controller[_0x9c17('0x11')]);router[_0x9c17('0x12')]('/',auth[_0x9c17('0xd')](),controller[_0x9c17('0x13')]);router[_0x9c17('0x14')]('/:id',auth[_0x9c17('0xd')](),controller[_0x9c17('0x15')]);router[_0x9c17('0x16')](_0x9c17('0xe'),auth[_0x9c17('0xd')](),controller[_0x9c17('0x17')]);module[_0x9c17('0x18')]=router; \ No newline at end of file +var _0x86fc=['show','/:id/download','download','post','create','put','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2976bb,_0x5c5add){var _0x26c340=function(_0x2a3d59){while(--_0x2a3d59){_0x2976bb['push'](_0x2976bb['shift']());}};_0x26c340(++_0x5c5add);}(_0x86fc,0x1c0));var _0xc86f=function(_0x5568e5,_0x32d3ef){_0x5568e5=_0x5568e5-0x0;var _0x3f5bd1=_0x86fc[_0x5568e5];return _0x3f5bd1;};'use strict';var multer=require('multer');var util=require(_0xc86f('0x0'));var path=require('path');var timeout=require(_0xc86f('0x1'));var express=require(_0xc86f('0x2'));var router=express[_0xc86f('0x3')]();var fs_extra=require(_0xc86f('0x4'));var auth=require(_0xc86f('0x5'));var interaction=require(_0xc86f('0x6'));var config=require('../../config/environment');var controller=require(_0xc86f('0x7'));router[_0xc86f('0x8')]('/',auth[_0xc86f('0x9')](),controller[_0xc86f('0xa')]);router[_0xc86f('0x8')](_0xc86f('0xb'),auth[_0xc86f('0x9')](),controller[_0xc86f('0xc')]);router[_0xc86f('0x8')](_0xc86f('0xd'),auth['isAuthenticated'](),controller[_0xc86f('0xe')]);router[_0xc86f('0x8')](_0xc86f('0xf'),auth['isAuthenticated'](),controller[_0xc86f('0x10')]);router[_0xc86f('0x11')]('/',auth[_0xc86f('0x9')](),controller[_0xc86f('0x12')]);router[_0xc86f('0x13')]('/:id',auth[_0xc86f('0x9')](),controller['update']);router['delete'](_0xc86f('0xd'),auth['isAuthenticated'](),controller[_0xc86f('0x14')]);module[_0xc86f('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 438fd8c..367d20a 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 _0x5b6e=['setDataValue','INTEGER','subtract','duration','startedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','createdAt','format','updatedAt','sequelize','moment','../../config/environment','VIRTUAL','getDataValue','value','STRING','replace'];(function(_0x1920cf,_0x46bd86){var _0x43d99f=function(_0x3fc706){while(--_0x3fc706){_0x1920cf['push'](_0x1920cf['shift']());}};_0x43d99f(++_0x46bd86);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x484817,_0x27f1dd){_0x484817=_0x484817-0x0;var _0x233d86=_0x5b6e[_0x484817];return _0x233d86;};'use strict';var Sequelize=require(_0xe5b6('0x0'));var moment=require(_0xe5b6('0x1'));var path=require('path');var config=require(_0xe5b6('0x2'));module['exports']={'format':{'type':Sequelize[_0xe5b6('0x3')],'get':function(){return this[_0xe5b6('0x4')](_0xe5b6('0x5'))?path['extname'](this['getDataValue'](_0xe5b6('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xe5b6('0x6')]},'channel':{'type':Sequelize[_0xe5b6('0x6')]},'value':{'type':Sequelize[_0xe5b6('0x6')],'set':function(_0x554d53){var _0x17ec5f=_0x554d53[_0xe5b6('0x7')](/\\/g,'/');this[_0xe5b6('0x8')]('value',_0x17ec5f);}},'rating':{'type':Sequelize[_0xe5b6('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x3f908a){this[_0xe5b6('0x8')]('startedAt',moment()[_0xe5b6('0xa')](_0x3f908a,'ms'));this[_0xe5b6('0x8')]('closedAt',moment());this[_0xe5b6('0x8')](_0xe5b6('0xb'),_0x3f908a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe5b6('0x4')](_0xe5b6('0xc')))['format'](_0xe5b6('0xd'))[_0xe5b6('0xe')]();}},'closedAt':{'type':Sequelize[_0xe5b6('0xf')],'get':function(){return moment(this[_0xe5b6('0x4')](_0xe5b6('0x10')))['format'](_0xe5b6('0xd'))[_0xe5b6('0xe')]();}},'createdAt':{'type':Sequelize[_0xe5b6('0xf')],'get':function(){return moment(this[_0xe5b6('0x4')](_0xe5b6('0x11')))[_0xe5b6('0x12')](_0xe5b6('0xd'))[_0xe5b6('0xe')]();}},'updatedAt':{'type':Sequelize[_0xe5b6('0xf')],'get':function(){return moment(this[_0xe5b6('0x4')](_0xe5b6('0x13')))['format'](_0xe5b6('0xd'))['toString']();}}}; \ No newline at end of file +var _0x47d6=['INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue'];(function(_0x3ddf26,_0x15c898){var _0x32a6c3=function(_0x32e45f){while(--_0x32e45f){_0x3ddf26['push'](_0x3ddf26['shift']());}};_0x32a6c3(++_0x15c898);}(_0x47d6,0x13f));var _0x647d=function(_0x2a675a,_0x1e54a5){_0x2a675a=_0x2a675a-0x0;var _0xe71a1c=_0x47d6[_0x2a675a];return _0xe71a1c;};'use strict';var Sequelize=require(_0x647d('0x0'));var moment=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var config=require(_0x647d('0x3'));module[_0x647d('0x4')]={'format':{'type':Sequelize[_0x647d('0x5')],'get':function(){return this[_0x647d('0x6')](_0x647d('0x7'))?path[_0x647d('0x8')](this[_0x647d('0x6')](_0x647d('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x647d('0x9')]},'channel':{'type':Sequelize[_0x647d('0x9')]},'value':{'type':Sequelize[_0x647d('0x9')],'set':function(_0x1db1db){var _0x1c6a88=_0x1db1db['replace'](/\\/g,'/');this[_0x647d('0xa')](_0x647d('0x7'),_0x1c6a88);}},'rating':{'type':Sequelize[_0x647d('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x647d('0xb')],'set':function(_0x414518){this[_0x647d('0xa')](_0x647d('0xc'),moment()[_0x647d('0xd')](_0x414518,'ms'));this[_0x647d('0xa')](_0x647d('0xe'),moment());this[_0x647d('0xa')](_0x647d('0xf'),_0x414518);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x647d('0xc')))[_0x647d('0x10')](_0x647d('0x11'))[_0x647d('0x12')]();}},'closedAt':{'type':Sequelize[_0x647d('0x13')],'get':function(){return moment(this[_0x647d('0x6')](_0x647d('0xe')))[_0x647d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x647d('0x12')]();}},'createdAt':{'type':Sequelize[_0x647d('0x13')],'get':function(){return moment(this['getDataValue'](_0x647d('0x14')))[_0x647d('0x10')](_0x647d('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x647d('0x6')](_0x647d('0x15')))[_0x647d('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x647d('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index a8e10e3..6fe1074 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 _0x81bd=['Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','duration','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','secrets','recording','join','server/files/screen_recordings'];(function(_0x4b52c4,_0x5e247e){var _0x59b0cb=function(_0x4eda76){while(--_0x4eda76){_0x4b52c4['push'](_0x4b52c4['shift']());}};_0x59b0cb(++_0x5e247e);}(_0x81bd,0x7c));var _0xd81b=function(_0xb8fd40,_0x23030a){_0xb8fd40=_0xb8fd40-0x0;var _0x46fcde=_0x81bd[_0xb8fd40];return _0x46fcde;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2ccedf,_0x1bf351){return function(_0x596389){if(!_0x596389){_0x2ccedf[_0xd81b('0x1b')](0x194);}return _0x596389;};}function handleError(_0x99dbc9,_0xe3637a){_0xe3637a=_0xe3637a||0x1f4;return function(_0x31b9fd){logger[_0xd81b('0x2a')](_0x31b9fd[_0xd81b('0x2b')]);if(_0x31b9fd[_0xd81b('0x2c')]){delete _0x31b9fd[_0xd81b('0x2c')];}_0x99dbc9[_0xd81b('0x1d')](_0xe3637a)['send'](_0x31b9fd);};}exports[_0xd81b('0x2d')]=function(_0x4e2eff,_0x5c8aee){var _0xb9ff9f={},_0x260310={},_0x5141e6={'count':0x0,'rows':[]};var _0x481454=_[_0xd81b('0x2e')](db[_0xd81b('0x2f')][_0xd81b('0x30')],function(_0x289f54){return{'name':_0x289f54[_0xd81b('0x31')],'type':_0x289f54[_0xd81b('0x32')]['key']};});_0x260310[_0xd81b('0x33')]=_[_0xd81b('0x34')](_['map'](_0x481454,'name'),[_0xd81b('0x35')]);_0x260310[_0xd81b('0x36')]=_['keys'](_0x4e2eff['query']);_0x260310['filters']=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],_0x260310[_0xd81b('0x36')]);_0xb9ff9f[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x4e2eff['query'][_0xd81b('0x39')]));_0xb9ff9f['attributes']=_0xb9ff9f[_0xd81b('0x38')][_0xd81b('0x3a')]?_0xb9ff9f[_0xd81b('0x38')]:_0x260310[_0xd81b('0x33')];if(!_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x3b')](_0xd81b('0x3c'))){_0xb9ff9f[_0xd81b('0x20')]=qs[_0xd81b('0x20')](_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x20')]);_0xb9ff9f[_0xd81b('0x22')]=qs[_0xd81b('0x22')](_0x4e2eff['query']['offset']);}_0xb9ff9f[_0xd81b('0x3d')]=qs[_0xd81b('0x3e')](_0x4e2eff[_0xd81b('0x36')]['sort']);_0xb9ff9f[_0xd81b('0x3f')]=qs[_0xd81b('0x40')](_['pick'](_0x4e2eff[_0xd81b('0x36')],_0x260310[_0xd81b('0x40')]),_0x481454);if(_0x4e2eff['query'][_0xd81b('0x41')]){_0xb9ff9f['where']=_[_0xd81b('0x42')](_0xb9ff9f[_0xd81b('0x3f')],{'$or':_[_0xd81b('0x2e')](_0x481454,function(_0x3f6deb){if(_0x3f6deb['type']!==_0xd81b('0x43')){var _0x3444d4={};_0x3444d4[_0x3f6deb[_0xd81b('0x2c')]]={'$like':'%'+_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x41')]+'%'};return _0x3444d4;}})});}_0xb9ff9f=_[_0xd81b('0x42')]({},_0xb9ff9f,_0x4e2eff[_0xd81b('0x44')]);var _0x532ada={'where':_0xb9ff9f[_0xd81b('0x3f')]};return db[_0xd81b('0x2f')][_0xd81b('0x21')](_0x532ada)['then'](function(_0x3bea7d){_0x5141e6[_0xd81b('0x21')]=_0x3bea7d;if(_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x45')]){_0xb9ff9f[_0xd81b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd81b('0x47')](_0xb9ff9f);})[_0xd81b('0x28')](function(_0x448e24){_0x5141e6[_0xd81b('0x48')]=_0x448e24;return _0x5141e6;})[_0xd81b('0x28')](respondWithFilteredResult(_0x5c8aee,_0xb9ff9f))[_0xd81b('0x49')](handleError(_0x5c8aee,null));};exports[_0xd81b('0x4a')]=function(_0x486f0d,_0x4405a8){var _0x3ba339={'raw':![],'where':{'id':_0x486f0d['params']['id']}},_0x1e3690={};_0x1e3690[_0xd81b('0x33')]=_[_0xd81b('0x4b')](db[_0xd81b('0x2f')][_0xd81b('0x30')]);_0x1e3690[_0xd81b('0x36')]=_[_0xd81b('0x4b')](_0x486f0d[_0xd81b('0x36')]);_0x1e3690[_0xd81b('0x40')]=_['intersection'](_0x1e3690['model'],_0x1e3690[_0xd81b('0x36')]);_0x3ba339[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x1e3690[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x486f0d[_0xd81b('0x36')][_0xd81b('0x39')]));_0x3ba339[_0xd81b('0x38')]=_0x3ba339[_0xd81b('0x38')][_0xd81b('0x3a')]?_0x3ba339[_0xd81b('0x38')]:_0x1e3690[_0xd81b('0x33')];if(_0x486f0d['query'][_0xd81b('0x45')]){_0x3ba339[_0xd81b('0x46')]=[{'all':!![]}];}_0x3ba339=_[_0xd81b('0x42')]({},_0x3ba339,_0x486f0d[_0xd81b('0x44')]);return db[_0xd81b('0x2f')][_0xd81b('0x4c')](_0x3ba339)[_0xd81b('0x28')](handleEntityNotFound(_0x4405a8,null))[_0xd81b('0x28')](respondWithResult(_0x4405a8,null))[_0xd81b('0x49')](handleError(_0x4405a8,null));};exports['create']=function(_0xf401e0,_0x2368dd){return db[_0xd81b('0x2f')][_0xd81b('0x4d')](_0xf401e0['body'],{})[_0xd81b('0x28')](respondWithResult(_0x2368dd,0xc9))[_0xd81b('0x49')](handleError(_0x2368dd,null));};exports[_0xd81b('0x27')]=function(_0xe874b6,_0x2699e6){if(_0xe874b6[_0xd81b('0x4e')]['id']){delete _0xe874b6[_0xd81b('0x4e')]['id'];}delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x4f')];delete _0xe874b6['body']['createdAt'];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x50')];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x51')];return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0xe874b6[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2699e6,null))['then'](saveUpdates(_0xe874b6[_0xd81b('0x4e')],null))[_0xd81b('0x28')](respondWithResult(_0x2699e6,null))[_0xd81b('0x49')](handleError(_0x2699e6,null));};exports[_0xd81b('0x53')]=function(_0x4651d3,_0x59b13b){return db[_0xd81b('0x2f')][_0xd81b('0x53')]()['then'](respondWithResult(_0x59b13b,null))[_0xd81b('0x49')](handleError(_0x59b13b,null));};exports[_0xd81b('0x54')]=function(_0x100319,_0x3b7ed7,_0x21cd71){var _0xa366c8=require(_0xd81b('0x55'));var _0x22f588=![];var _0x3ed626={};if(_0x100319[_0xd81b('0x36')][_0xd81b('0x32')]&&_0x100319['query'][_0xd81b('0x32')]==='uniqueid'){_0x3ed626[_0xd81b('0x56')]=_0x100319[_0xd81b('0x52')]['id'];}else{_0x3ed626['id']=_0x100319[_0xd81b('0x52')]['id'];}return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':_0x3ed626,'attributes':['id',_0xd81b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7ed7,null))[_0xd81b('0x28')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=path['join'](config[_0xd81b('0x57')],'server/files/screen_recordings',_0xe0c9c6[_0xd81b('0x51')]);var _0x51f066=util[_0xd81b('0x35')](_0xd81b('0x58'),_0x51f5a1);if(fs[_0xd81b('0x59')](_0x51f066)){_0x22f588=!![];return _0xa366c8['decryptFile'](_0x51f066,_0x51f5a1,config[_0xd81b('0x5a')][_0xd81b('0x5b')])['then'](function(){return _0xe0c9c6;});}return _0xe0c9c6;}})[_0xd81b('0x28')](function(_0x108aaf){if(_0x108aaf){var _0x5951ec=path[_0xd81b('0x5c')](config['root'],_0xd81b('0x5d'),_0x108aaf[_0xd81b('0x51')]);if(!fs[_0xd81b('0x59')](_0x5951ec)){throw new db[(_0xd81b('0x5e'))][(_0xd81b('0x5f'))](_0xd81b('0x60'));}if(_0x108aaf[_0xd81b('0x61')]){return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,_0x108aaf[_0xd81b('0x61')]+path[_0xd81b('0x62')](_0x5951ec),function(){if(_0x22f588){fs['unlink'](_0x5951ec);}});}else{return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,function(_0x434434){if(_0x22f588){fs[_0xd81b('0x63')](_0x5951ec);}});}}})[_0xd81b('0x49')](function(_0x1bdf37){if(_0x1bdf37[_0xd81b('0x64')]===_0xd81b('0x60')){_0x3b7ed7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3b7ed7,null);}});};exports[_0xd81b('0x29')]=function(_0x12b0bf,_0x37507e){return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0x12b0bf[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](function(_0x5afecf){if(_[_0xd81b('0x65')](_0x5afecf)){throw new ReferenceError(_0xd81b('0x66'));}return _0x5afecf;})[_0xd81b('0x28')](function(_0x2090e9){var _0x41719b=path[_0xd81b('0x5c')](config[_0xd81b('0x57')],'server/files/screen_recordings',_0x2090e9[_0xd81b('0x51')]);logger[_0xd81b('0x67')](_0xd81b('0x68'),_0x41719b);if(!_[_0xd81b('0x65')](_0x2090e9[_0xd81b('0x51')])&&fs[_0xd81b('0x59')](_0x41719b)){logger[_0xd81b('0x67')](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}_0x41719b=_0x41719b+_0xd81b('0x6c');if(!_[_0xd81b('0x65')](_0x2090e9['value'])&&fs[_0xd81b('0x59')](_0x41719b)){logger['info'](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}return _0x2090e9;})[_0xd81b('0x28')](function(_0xb94a69){if(!_0xb94a69)throw new InternalError();return _0xb94a69[_0xd81b('0x29')]();})[_0xd81b('0x28')](function(){_0x37507e[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();})[_0xd81b('0x49')](handleError(_0x37507e,null));}; \ No newline at end of file +var _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x211d53,_0x2c56be){var _0x3749c3=function(_0xdb7c){while(--_0xdb7c){_0x211d53['push'](_0x211d53['shift']());}};_0x3749c3(++_0x2c56be);}(_0xee14,0x13a));var _0x4ee1=function(_0x4ef8d9,_0x1ed835){_0x4ef8d9=_0x4ef8d9-0x0;var _0x190c02=_0xee14[_0x4ef8d9];return _0x190c02;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index adb92af..19370d4 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 _0x7c89=['request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','../../config/logger','api','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c89,0x135));var _0x97c8=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x7c89[_0x13ea00];return _0x1f7347;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x97c8('0x0'))(_0x97c8('0x1'));var moment=require('moment');var BPromise=require(_0x97c8('0x2'));var rp=require(_0x97c8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97c8('0x4'));var config=require(_0x97c8('0x5'));var attributes=require(_0x97c8('0x6'));module[_0x97c8('0x7')]=function(_0xd2c1f1,_0x55a7e6){return _0xd2c1f1[_0x97c8('0x8')](_0x97c8('0x9'),attributes,{'tableName':_0x97c8('0xa'),'paranoid':![],'indexes':[{'name':_0x97c8('0xb'),'fields':[_0x97c8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ff4=['moment','request-promise','path','rimraf','../../config/environment','exports','define','screen_recordings','interactionid','lodash','../../config/logger','api'];(function(_0x37b229,_0x1ff75f){var _0x3162c4=function(_0x2db4f4){while(--_0x2db4f4){_0x37b229['push'](_0x37b229['shift']());}};_0x3162c4(++_0x1ff75f);}(_0x7ff4,0x1c5));var _0x47ff=function(_0x4ba69d,_0x4319c0){_0x4ba69d=_0x4ba69d-0x0;var _0xe9d279=_0x7ff4[_0x4ba69d];return _0xe9d279;};'use strict';var _=require(_0x47ff('0x0'));var util=require('util');var logger=require(_0x47ff('0x1'))(_0x47ff('0x2'));var moment=require(_0x47ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x47ff('0x4'));var fs=require('fs');var path=require(_0x47ff('0x5'));var rimraf=require(_0x47ff('0x6'));var config=require(_0x47ff('0x7'));var attributes=require('./screenRecording.attributes');module[_0x47ff('0x8')]=function(_0x1662a3,_0xde3a5f){return _0x1662a3[_0x47ff('0x9')]('ScreenRecording',attributes,{'tableName':_0x47ff('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x47ff('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5bc38e1..d0ecaca 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 _0x1910=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b3ee7,_0x4424f5){var _0x1ce8bd=function(_0x5369ff){while(--_0x5369ff){_0x4b3ee7['push'](_0x4b3ee7['shift']());}};_0x1ce8bd(++_0x4424f5);}(_0x1910,0x19b));var _0x0191=function(_0xd4c3d8,_0x1346f4){_0xd4c3d8=_0xd4c3d8-0x0;var _0x28a45c=_0x1910[_0xd4c3d8];return _0x28a45c;};'use strict';var _=require('lodash');var util=require(_0x0191('0x0'));var moment=require(_0x0191('0x1'));var BPromise=require(_0x0191('0x2'));var rs=require(_0x0191('0x3'));var fs=require('fs');var Redis=require(_0x0191('0x4'));var db=require(_0x0191('0x5'))['db'];var utils=require(_0x0191('0x6'));var logger=require(_0x0191('0x7'))('rpc');var config=require(_0x0191('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0191('0x9')][_0x0191('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c25ea,_0x5b8e8b,_0x4f74b5){return new BPromise(function(_0xd168da,_0xc701c){return client[_0x0191('0xb')](_0x5c25ea,_0x4f74b5)[_0x0191('0xc')](function(_0xadd6c8){logger[_0x0191('0xd')](_0x0191('0xe'),_0x5b8e8b,_0x0191('0xf'));logger[_0x0191('0x10')](_0x0191('0x11'),_0x5b8e8b,_0x0191('0xf'),JSON[_0x0191('0x12')](_0xadd6c8));if(_0xadd6c8[_0x0191('0x13')]){if(_0xadd6c8['error'][_0x0191('0x14')]===0x1f4){logger[_0x0191('0x13')](_0x0191('0xe'),_0x5b8e8b,_0xadd6c8[_0x0191('0x13')]['message']);return _0xc701c(_0xadd6c8[_0x0191('0x13')][_0x0191('0x15')]);}logger[_0x0191('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x5b8e8b,_0xadd6c8[_0x0191('0x13')][_0x0191('0x15')]);return _0xd168da(_0xadd6c8[_0x0191('0x13')][_0x0191('0x15')]);}else{logger['info'](_0x0191('0xe'),_0x5b8e8b,'request\x20sent');_0xd168da(_0xadd6c8[_0x0191('0x16')][_0x0191('0x15')]);}})[_0x0191('0x17')](function(_0x506c70){logger[_0x0191('0x13')](_0x0191('0xe'),_0x5b8e8b,_0x506c70);_0xc701c(_0x506c70);});});} \ No newline at end of file +var _0xd1e8=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd1e8,0x74));var _0x8d1e=function(_0x1f27b6,_0x251b0a){_0x1f27b6=_0x1f27b6-0x0;var _0x5a71fb=_0xd1e8[_0x1f27b6];return _0x5a71fb;};'use strict';var _=require('lodash');var util=require(_0x8d1e('0x0'));var moment=require(_0x8d1e('0x1'));var BPromise=require(_0x8d1e('0x2'));var rs=require(_0x8d1e('0x3'));var fs=require('fs');var Redis=require(_0x8d1e('0x4'));var db=require(_0x8d1e('0x5'))['db'];var utils=require(_0x8d1e('0x6'));var logger=require(_0x8d1e('0x7'))('rpc');var config=require(_0x8d1e('0x8'));var jayson=require(_0x8d1e('0x9'));var client=jayson[_0x8d1e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf19e,_0x7478fb,_0x4caff5){return new BPromise(function(_0x4c8a8a,_0x383cbf){return client[_0x8d1e('0xb')](_0x1bf19e,_0x4caff5)[_0x8d1e('0xc')](function(_0x2bbd95){logger[_0x8d1e('0xd')](_0x8d1e('0xe'),_0x7478fb,_0x8d1e('0xf'));logger['debug'](_0x8d1e('0x10'),_0x7478fb,_0x8d1e('0xf'),JSON[_0x8d1e('0x11')](_0x2bbd95));if(_0x2bbd95['error']){if(_0x2bbd95[_0x8d1e('0x12')][_0x8d1e('0x13')]===0x1f4){logger[_0x8d1e('0x12')](_0x8d1e('0xe'),_0x7478fb,_0x2bbd95[_0x8d1e('0x12')]['message']);return _0x383cbf(_0x2bbd95['error']['message']);}logger[_0x8d1e('0x12')](_0x8d1e('0xe'),_0x7478fb,_0x2bbd95[_0x8d1e('0x12')][_0x8d1e('0x14')]);return _0x4c8a8a(_0x2bbd95[_0x8d1e('0x12')][_0x8d1e('0x14')]);}else{logger[_0x8d1e('0xd')](_0x8d1e('0xe'),_0x7478fb,_0x8d1e('0xf'));_0x4c8a8a(_0x2bbd95[_0x8d1e('0x15')]['message']);}})[_0x8d1e('0x16')](function(_0x565971){logger[_0x8d1e('0x12')](_0x8d1e('0xe'),_0x7478fb,_0x565971);_0x383cbf(_0x565971);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index bdcc9dd..eab9739 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 _0xd5d4=['/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','server/files/images/logos/','format','extname','originalname','post','single','file','addLogo','join','root','%s%s','logologin','addLogoLogin','preferred','addPreferred','diskStorage','addFavicon','put','update','exports','path','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','get','/now','show','getLogo','/:id/logo_login'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xd5d4,0xc7));var _0x4d5d=function(_0x2ec13e,_0x2ea526){_0x2ec13e=_0x2ec13e-0x0;var _0xb48415=_0xd5d4[_0x2ec13e];return _0xb48415;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4d5d('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d5d('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x4d5d('0x2'));var config=require(_0x4d5d('0x3'));var controller=require(_0x4d5d('0x4'));router['get']('/',auth[_0x4d5d('0x5')](),controller['index']);router[_0x4d5d('0x6')](_0x4d5d('0x7'),controller['getDate']);router['get']('/:id',controller[_0x4d5d('0x8')]);router[_0x4d5d('0x6')]('/:id/logo',controller[_0x4d5d('0x9')]);router[_0x4d5d('0x6')](_0x4d5d('0xa'),controller['getLogoLogin']);router[_0x4d5d('0x6')](_0x4d5d('0xb'),controller['gdpr']);router[_0x4d5d('0x6')](_0x4d5d('0xc'),controller['getPreferred']);router['get'](_0x4d5d('0xd'),controller[_0x4d5d('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19da6d,_0x1da944,_0x46c308){_0x46c308(null,path['join'](config['root'],_0x4d5d('0xf')));},'filename':function(_0x21223c,_0x2b8e13,_0x1d98cc){_0x1d98cc(null,util[_0x4d5d('0x10')]('%s%s','logo',path[_0x4d5d('0x11')](_0x2b8e13[_0x4d5d('0x12')])));}})});router[_0x4d5d('0x13')]('/:id/logo',upload[_0x4d5d('0x14')](_0x4d5d('0x15')),controller[_0x4d5d('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55d77a,_0x4c815b,_0x1d0a69){_0x1d0a69(null,path[_0x4d5d('0x17')](config[_0x4d5d('0x18')],_0x4d5d('0xf')));},'filename':function(_0x5b3ac8,_0x126bc7,_0x81ccb5){_0x81ccb5(null,util[_0x4d5d('0x10')](_0x4d5d('0x19'),_0x4d5d('0x1a'),path[_0x4d5d('0x11')](_0x126bc7[_0x4d5d('0x12')])));}})});router[_0x4d5d('0x13')](_0x4d5d('0xa'),upload[_0x4d5d('0x14')](_0x4d5d('0x15')),controller[_0x4d5d('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x583a0f,_0x47196d,_0x53e99){_0x53e99(null,path[_0x4d5d('0x17')](config[_0x4d5d('0x18')],'server/files/images/logos/'));},'filename':function(_0x41aaa4,_0x2b0efb,_0x57d483){_0x57d483(null,util['format'](_0x4d5d('0x19'),_0x4d5d('0x1c'),path[_0x4d5d('0x11')](_0x2b0efb['originalname'])));}})});router[_0x4d5d('0x13')](_0x4d5d('0xc'),upload[_0x4d5d('0x14')](_0x4d5d('0x15')),controller[_0x4d5d('0x1d')]);var upload=multer({'storage':multer[_0x4d5d('0x1e')]({'destination':function(_0x183e91,_0xf0c154,_0x2cc5c9){_0x2cc5c9(null,path[_0x4d5d('0x17')](config[_0x4d5d('0x18')],_0x4d5d('0xf')));},'filename':function(_0x1127ae,_0xdfd382,_0x3cccad){_0x3cccad(null,util[_0x4d5d('0x10')](_0x4d5d('0x19'),'favicon',path[_0x4d5d('0x11')](_0xdfd382[_0x4d5d('0x12')])));}})});router['post'](_0x4d5d('0xd'),upload[_0x4d5d('0x14')](_0x4d5d('0x15')),controller[_0x4d5d('0x1f')]);router[_0x4d5d('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x4d5d('0x21')]);module[_0x4d5d('0x22')]=router; \ No newline at end of file +var _0x4488=['../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','root','format','%s%s','logo','extname','post','/:id/logo','single','diskStorage','join','server/files/images/logos/','logologin','originalname','file','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x4488,0x143));var _0x8448=function(_0x3a794d,_0x3896cb){_0x3a794d=_0x3a794d-0x0;var _0x5e46ab=_0x4488[_0x3a794d];return _0x5e46ab;};'use strict';var multer=require(_0x8448('0x0'));var util=require(_0x8448('0x1'));var path=require('path');var timeout=require(_0x8448('0x2'));var express=require(_0x8448('0x3'));var router=express[_0x8448('0x4')]();var fs_extra=require(_0x8448('0x5'));var auth=require(_0x8448('0x6'));var interaction=require(_0x8448('0x7'));var config=require(_0x8448('0x8'));var controller=require(_0x8448('0x9'));router[_0x8448('0xa')]('/',auth[_0x8448('0xb')](),controller[_0x8448('0xc')]);router[_0x8448('0xa')](_0x8448('0xd'),controller['getDate']);router['get'](_0x8448('0xe'),controller[_0x8448('0xf')]);router[_0x8448('0xa')]('/:id/logo',controller[_0x8448('0x10')]);router[_0x8448('0xa')](_0x8448('0x11'),controller[_0x8448('0x12')]);router['get'](_0x8448('0x13'),controller[_0x8448('0x14')]);router[_0x8448('0xa')](_0x8448('0x15'),controller[_0x8448('0x16')]);router[_0x8448('0xa')]('/:id/favicon',controller[_0x8448('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x42eb4c,_0x432f40,_0x15ee6d){_0x15ee6d(null,path['join'](config[_0x8448('0x18')],'server/files/images/logos/'));},'filename':function(_0x481313,_0x1ca3a1,_0x167864){_0x167864(null,util[_0x8448('0x19')](_0x8448('0x1a'),_0x8448('0x1b'),path[_0x8448('0x1c')](_0x1ca3a1['originalname'])));}})});router[_0x8448('0x1d')](_0x8448('0x1e'),upload[_0x8448('0x1f')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x8448('0x20')]({'destination':function(_0x13ce09,_0x1436af,_0x40f9ad){_0x40f9ad(null,path[_0x8448('0x21')](config[_0x8448('0x18')],_0x8448('0x22')));},'filename':function(_0x4eeae6,_0x285ac9,_0x356d4a){_0x356d4a(null,util[_0x8448('0x19')](_0x8448('0x1a'),_0x8448('0x23'),path[_0x8448('0x1c')](_0x285ac9[_0x8448('0x24')])));}})});router[_0x8448('0x1d')](_0x8448('0x11'),upload[_0x8448('0x1f')](_0x8448('0x25')),controller[_0x8448('0x26')]);var upload=multer({'storage':multer[_0x8448('0x20')]({'destination':function(_0x340fb6,_0x2f9d10,_0x2bdbe5){_0x2bdbe5(null,path[_0x8448('0x21')](config[_0x8448('0x18')],_0x8448('0x22')));},'filename':function(_0x3309bb,_0x3f63d9,_0x617d00){_0x617d00(null,util[_0x8448('0x19')](_0x8448('0x1a'),_0x8448('0x27'),path['extname'](_0x3f63d9[_0x8448('0x24')])));}})});router[_0x8448('0x1d')](_0x8448('0x15'),upload[_0x8448('0x1f')](_0x8448('0x25')),controller[_0x8448('0x28')]);var upload=multer({'storage':multer[_0x8448('0x20')]({'destination':function(_0x32e183,_0x1e7f29,_0x1ee260){_0x1ee260(null,path[_0x8448('0x21')](config[_0x8448('0x18')],_0x8448('0x22')));},'filename':function(_0x288b5f,_0x38c671,_0x16dc88){_0x16dc88(null,util[_0x8448('0x19')](_0x8448('0x1a'),_0x8448('0x29'),path[_0x8448('0x1c')](_0x38c671['originalname'])));}})});router[_0x8448('0x1d')](_0x8448('0x2a'),upload['single'](_0x8448('0x25')),controller[_0x8448('0x2b')]);router[_0x8448('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x8448('0x2d')]);module[_0x8448('0x2e')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 43fccc9..4382bf7 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(_0xb0c760,_0x275897){var _0x1a6dca=function(_0x520d03){while(--_0x520d03){_0xb0c760['push'](_0xb0c760['shift']());}};_0x1a6dca(++_0x275897);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'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(_0x3e090d,_0x4e889b){var _0x3372ae=function(_0x45f6b5){while(--_0x45f6b5){_0x3e090d['push'](_0x3e090d['shift']());}};_0x3372ae(++_0x4e889b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 eec208b..1d5463e 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 _0x9ade=['getLicense','default_loginLogo.svg','Sequelize','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','addFavicon','getFavicon','custom','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','request-promise','bluebird','mustache','sox','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','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','show','params','fields','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','ValidationError','download','../../config/license/util','getLogoLogin','server/files/images/logos'];(function(_0x45f4db,_0xfdc476){var _0x53b2fb=function(_0x38f268){while(--_0x38f268){_0x45f4db['push'](_0x45f4db['shift']());}};_0x53b2fb(++_0xfdc476);}(_0x9ade,0x107));var _0xe9ad=function(_0x3e37b3,_0x570305){_0x3e37b3=_0x3e37b3-0x0;var _0x47e724=_0x9ade[_0x3e37b3];return _0x47e724;};'use strict';var emlformat=require(_0xe9ad('0x0'));var rimraf=require(_0xe9ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe9ad('0x2'));var moment=require('moment');var BPromise=require(_0xe9ad('0x3'));var Mustache=require(_0xe9ad('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe9ad('0x5'));var csv=require(_0xe9ad('0x6'));var ejs=require(_0xe9ad('0x7'));var fs=require('fs');var fs_extra=require(_0xe9ad('0x8'));var _=require(_0xe9ad('0x9'));var squel=require(_0xe9ad('0xa'));var crypto=require(_0xe9ad('0xb'));var jsforce=require(_0xe9ad('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe9ad('0x6'));var querystring=require(_0xe9ad('0xd'));var Papa=require(_0xe9ad('0xe'));var Redis=require(_0xe9ad('0xf'));var authService=require(_0xe9ad('0x10'));var qs=require(_0xe9ad('0x11'));var as=require(_0xe9ad('0x12'));var hardwareService=require(_0xe9ad('0x13'));var logger=require(_0xe9ad('0x14'))(_0xe9ad('0x15'));var utils=require(_0xe9ad('0x16'));var config=require(_0xe9ad('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9ad('0x18'))['db'];var jayson=require(_0xe9ad('0x19'));var client=jayson[_0xe9ad('0x1a')][_0xe9ad('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x502749,_0x30246c,_0x1c29d5,_0x2ea149){return new BPromise(function(_0x208416,_0x4a58b1){var _0x2d4e2e=_0x2ea149||client;return _0x2d4e2e['request'](_0x502749,_0x1c29d5)[_0xe9ad('0x1c')](function(_0x4d018f){logger[_0xe9ad('0x1d')](_0xe9ad('0x1e'),_0x30246c,_0xe9ad('0x1f'));logger[_0xe9ad('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x30246c,_0xe9ad('0x1f'),JSON[_0xe9ad('0x21')](_0x4d018f));if(_0x4d018f[_0xe9ad('0x22')]){if(_0x4d018f[_0xe9ad('0x22')][_0xe9ad('0x23')]===0x1f4){logger[_0xe9ad('0x22')]('Setting,\x20%s,\x20%s',_0x30246c,_0x4d018f[_0xe9ad('0x22')][_0xe9ad('0x24')]);return _0x4a58b1(_0x4d018f[_0xe9ad('0x22')][_0xe9ad('0x24')]);}logger[_0xe9ad('0x22')](_0xe9ad('0x1e'),_0x30246c,_0x4d018f[_0xe9ad('0x22')][_0xe9ad('0x24')]);return _0x208416(_0x4d018f[_0xe9ad('0x22')]['message']);}else{logger[_0xe9ad('0x1d')]('Setting,\x20%s,\x20%s',_0x30246c,_0xe9ad('0x1f'));_0x208416(_0x4d018f['result'][_0xe9ad('0x24')]);}})[_0xe9ad('0x25')](function(_0x17b1f5){logger[_0xe9ad('0x22')](_0xe9ad('0x1e'),_0x30246c,_0x17b1f5);_0x4a58b1(_0x17b1f5);});});}function respondWithStatusCode(_0x479856,_0x5b6c24){_0x5b6c24=_0x5b6c24||0xcc;return function(_0x40a6ce){if(_0x40a6ce){return _0x479856[_0xe9ad('0x26')](_0x5b6c24);}return _0x479856[_0xe9ad('0x27')](_0x5b6c24)[_0xe9ad('0x28')]();};}function respondWithResult(_0x331759,_0x3a910f){_0x3a910f=_0x3a910f||0xc8;return function(_0x431c2f){if(_0x431c2f){return _0x331759[_0xe9ad('0x27')](_0x3a910f)['json'](_0x431c2f);}};}function respondWithFilteredResult(_0x305f51,_0x20b6fc){return function(_0x3842a9){if(_0x3842a9){var _0x136858=typeof _0x20b6fc['offset']===_0xe9ad('0x29')&&typeof _0x20b6fc[_0xe9ad('0x2a')]===_0xe9ad('0x29');var _0x353394=_0x3842a9[_0xe9ad('0x2b')];var _0x3d64ff=_0x136858?0x0:_0x20b6fc['offset'];var _0x546486=_0x136858?_0x3842a9[_0xe9ad('0x2b')]:_0x20b6fc[_0xe9ad('0x2c')]+_0x20b6fc[_0xe9ad('0x2a')];var _0x4e707e;if(_0x546486>=_0x353394){_0x546486=_0x353394;_0x4e707e=0xc8;}else{_0x4e707e=0xce;}_0x305f51[_0xe9ad('0x27')](_0x4e707e);return _0x305f51[_0xe9ad('0x2d')](_0xe9ad('0x2e'),_0x3d64ff+'-'+_0x546486+'/'+_0x353394)[_0xe9ad('0x2f')](_0x3842a9);}return null;};}function patchUpdates(_0x3e2ec5){return function(_0x400556){try{jsonpatch['apply'](_0x400556,_0x3e2ec5,!![]);}catch(_0x155a43){return BPromise['reject'](_0x155a43);}return _0x400556[_0xe9ad('0x30')]();};}function saveUpdates(_0x25117c,_0x180a37){return function(_0x2b4525){if(_0x2b4525){return _0x2b4525[_0xe9ad('0x31')](_0x25117c)[_0xe9ad('0x1c')](function(_0x430ad2){return _0x430ad2;});}return null;};}function removeEntity(_0x2e3de9,_0x546529){return function(_0x29ac2d){if(_0x29ac2d){return _0x29ac2d[_0xe9ad('0x32')]()[_0xe9ad('0x1c')](function(){_0x2e3de9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f987,_0x42dffc){return function(_0x230db5){if(!_0x230db5){_0x22f987[_0xe9ad('0x26')](0x194);}return _0x230db5;};}function handleError(_0x30d1a5,_0x1f5715){_0x1f5715=_0x1f5715||0x1f4;return function(_0x514a67){logger[_0xe9ad('0x22')](_0x514a67[_0xe9ad('0x33')]);if(_0x514a67[_0xe9ad('0x34')]){delete _0x514a67['name'];}_0x30d1a5['status'](_0x1f5715)['send'](_0x514a67);};}exports[_0xe9ad('0x35')]=function(_0x3e33fd,_0x510271){var _0x34f41e={},_0x270cb5={},_0x25576e={'count':0x0,'rows':[]};var _0x335a88=_[_0xe9ad('0x36')](db[_0xe9ad('0x37')][_0xe9ad('0x38')],function(_0xa27be1){return{'name':_0xa27be1[_0xe9ad('0x39')],'type':_0xa27be1[_0xe9ad('0x3a')][_0xe9ad('0x3b')]};});_0x270cb5['model']=_[_0xe9ad('0x36')](_0x335a88,_0xe9ad('0x34'));_0x270cb5[_0xe9ad('0x3c')]=_[_0xe9ad('0x3d')](_0x3e33fd[_0xe9ad('0x3c')]);_0x270cb5[_0xe9ad('0x3e')]=_[_0xe9ad('0x3f')](_0x270cb5['model'],_0x270cb5['query']);_0x34f41e[_0xe9ad('0x40')]=_[_0xe9ad('0x3f')](_0x270cb5[_0xe9ad('0x41')],qs['fields'](_0x3e33fd['query']['fields']));_0x34f41e[_0xe9ad('0x40')]=_0x34f41e[_0xe9ad('0x40')][_0xe9ad('0x42')]?_0x34f41e[_0xe9ad('0x40')]:_0x270cb5[_0xe9ad('0x41')];if(!_0x3e33fd['query']['hasOwnProperty'](_0xe9ad('0x43'))){_0x34f41e[_0xe9ad('0x2a')]=qs[_0xe9ad('0x2a')](_0x3e33fd[_0xe9ad('0x3c')][_0xe9ad('0x2a')]);_0x34f41e[_0xe9ad('0x2c')]=qs[_0xe9ad('0x2c')](_0x3e33fd['query']['offset']);}_0x34f41e[_0xe9ad('0x44')]=qs[_0xe9ad('0x45')](_0x3e33fd['query'][_0xe9ad('0x45')]);_0x34f41e['where']=qs['filters'](_[_0xe9ad('0x46')](_0x3e33fd['query'],_0x270cb5[_0xe9ad('0x3e')]),_0x335a88);if(_0x3e33fd[_0xe9ad('0x3c')]['filter']){_0x34f41e[_0xe9ad('0x47')]=_[_0xe9ad('0x48')](_0x34f41e[_0xe9ad('0x47')],{'$or':_[_0xe9ad('0x36')](_0x335a88,function(_0x10c138){if(_0x10c138[_0xe9ad('0x3a')]!==_0xe9ad('0x49')){var _0x5d0c26={};_0x5d0c26[_0x10c138['name']]={'$like':'%'+_0x3e33fd[_0xe9ad('0x3c')][_0xe9ad('0x4a')]+'%'};return _0x5d0c26;}})});}_0x34f41e=_[_0xe9ad('0x48')]({},_0x34f41e,_0x3e33fd['options']);var _0x1bf9f5={'where':_0x34f41e[_0xe9ad('0x47')]};return db[_0xe9ad('0x37')][_0xe9ad('0x2b')](_0x1bf9f5)[_0xe9ad('0x1c')](function(_0x3f6473){_0x25576e[_0xe9ad('0x2b')]=_0x3f6473;if(_0x3e33fd['query'][_0xe9ad('0x4b')]){_0x34f41e['include']=[{'all':!![]}];}return db[_0xe9ad('0x37')]['findAll'](_0x34f41e);})[_0xe9ad('0x1c')](function(_0x45c186){_0x25576e['rows']=_0x45c186;return _0x25576e;})['then'](respondWithFilteredResult(_0x510271,_0x34f41e))[_0xe9ad('0x25')](handleError(_0x510271,null));};exports[_0xe9ad('0x4c')]=function(_0x117ea2,_0x265a94){var _0x1d6785={'raw':![],'where':{'id':_0x117ea2[_0xe9ad('0x4d')]['id']}},_0x2ae79e={};_0x2ae79e[_0xe9ad('0x41')]=_['keys'](db[_0xe9ad('0x37')][_0xe9ad('0x38')]);_0x2ae79e[_0xe9ad('0x3c')]=_[_0xe9ad('0x3d')](_0x117ea2[_0xe9ad('0x3c')]);_0x2ae79e[_0xe9ad('0x3e')]=_[_0xe9ad('0x3f')](_0x2ae79e[_0xe9ad('0x41')],_0x2ae79e[_0xe9ad('0x3c')]);_0x1d6785[_0xe9ad('0x40')]=_['intersection'](_0x2ae79e[_0xe9ad('0x41')],qs[_0xe9ad('0x4e')](_0x117ea2[_0xe9ad('0x3c')][_0xe9ad('0x4e')]));_0x1d6785['attributes']=_0x1d6785['attributes'][_0xe9ad('0x42')]?_0x1d6785[_0xe9ad('0x40')]:_0x2ae79e[_0xe9ad('0x41')];if(_0x117ea2[_0xe9ad('0x3c')]['includeAll']){_0x1d6785['include']=[{'all':!![]}];}_0x1d6785=_[_0xe9ad('0x48')]({},_0x1d6785,_0x117ea2[_0xe9ad('0x4f')]);return db[_0xe9ad('0x37')][_0xe9ad('0x50')](_0x1d6785)[_0xe9ad('0x1c')](handleEntityNotFound(_0x265a94,null))['then'](respondWithResult(_0x265a94,null))['catch'](handleError(_0x265a94,null));};exports[_0xe9ad('0x31')]=function(_0x2942ce,_0x3e6e65){if(_0x2942ce[_0xe9ad('0x51')]['id']){delete _0x2942ce['body']['id'];}return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x2942ce['params']['id']}})['then'](handleEntityNotFound(_0x3e6e65,null))['then'](saveUpdates(_0x2942ce[_0xe9ad('0x51')],null))[_0xe9ad('0x1c')](respondWithResult(_0x3e6e65,null))['catch'](handleError(_0x3e6e65,null));};exports[_0xe9ad('0x52')]=function(_0x55f04c,_0x1a6819,_0xc1a8bb){if(_0x55f04c[_0xe9ad('0x53')]&&_0x55f04c[_0xe9ad('0x53')][_0xe9ad('0x54')]){_0x55f04c[_0xe9ad('0x51')][_0xe9ad('0x55')]=_0x55f04c['file'][_0xe9ad('0x54')];}return db[_0xe9ad('0x37')]['find']({'where':{'id':_0x55f04c['params']['id']}})['then'](handleEntityNotFound(_0x1a6819,null))[_0xe9ad('0x1c')](saveUpdates(_0x55f04c[_0xe9ad('0x51')],null))[_0xe9ad('0x1c')](respondWithResult(_0x1a6819,null))[_0xe9ad('0x25')](handleError(_0x1a6819,null));};exports[_0xe9ad('0x56')]=function(_0x5704b9,_0x441b8d,_0x2a0cea){if(_0x5704b9[_0xe9ad('0x53')]&&_0x5704b9[_0xe9ad('0x53')]['filename']){_0x5704b9[_0xe9ad('0x51')][_0xe9ad('0x57')]=_0x5704b9[_0xe9ad('0x53')][_0xe9ad('0x54')];}return db['Setting'][_0xe9ad('0x50')]({'where':{'id':_0x5704b9[_0xe9ad('0x4d')]['id']}})[_0xe9ad('0x1c')](handleEntityNotFound(_0x441b8d,null))['then'](saveUpdates(_0x5704b9[_0xe9ad('0x51')],null))[_0xe9ad('0x1c')](respondWithResult(_0x441b8d,null))[_0xe9ad('0x25')](handleError(_0x441b8d,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x4fb08c,_0x5c0f13,_0x23b8b2){var _0xc76bb8='server/files/images/logos';var _0x5aea79={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1f6d6e){if(_0x1f6d6e){_0x5aea79=_0x1f6d6e;}return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x4fb08c[_0xe9ad('0x4d')]['id']},'attributes':[_0xe9ad('0x55'),_0xe9ad('0x57'),_0xe9ad('0x58'),_0xe9ad('0x59'),_0xe9ad('0x5a'),_0xe9ad('0x5b'),_0xe9ad('0x5c'),_0xe9ad('0x5d')],'raw':!![]});})[_0xe9ad('0x1c')](handleEntityNotFound(_0x5c0f13,null))[_0xe9ad('0x1c')](function(_0x27bdbe){if(_0x27bdbe){var _0x2f71b6=_0x27bdbe['logo']&&fs[_0xe9ad('0x5e')](path['join'](config[_0xe9ad('0x5f')],_0xc76bb8,_[_0xe9ad('0x60')](_0x27bdbe[_0xe9ad('0x55')])))?path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0xc76bb8,_[_0xe9ad('0x60')](_0x27bdbe[_0xe9ad('0x55')])):path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0xc76bb8,_['toLower'](_0xe9ad('0x62')));var _0x501e36=_0xe9ad('0x63')+_[_0xe9ad('0x64')](_0xe9ad('0x55'));if(_0x27bdbe[_0x501e36]||!_0x5aea79['custom']){_0x2f71b6=path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0xc76bb8,_[_0xe9ad('0x60')](_0xe9ad('0x62')));}if(!fs[_0xe9ad('0x5e')](_0x2f71b6)){throw new db['Sequelize'][(_0xe9ad('0x65'))](_[_0xe9ad('0x64')](_0xe9ad('0x55'))+'\x20not\x20found');}return _0x5c0f13[_0xe9ad('0x66')](_0x2f71b6);}})[_0xe9ad('0x25')](handleError(_0x5c0f13,null));};var utilLicense=require(_0xe9ad('0x67'));exports[_0xe9ad('0x68')]=function(_0x3c0828,_0x5c4f5b,_0x2865fb){var _0x7143b0=_0xe9ad('0x69');var _0x2345ec={'custom':![]};return utilLicense[_0xe9ad('0x6a')]()['then'](function(_0x13cedb){if(_0x13cedb){_0x2345ec=_0x13cedb;}return db['Setting'][_0xe9ad('0x50')]({'where':{'id':_0x3c0828[_0xe9ad('0x4d')]['id']},'attributes':[_0xe9ad('0x55'),_0xe9ad('0x57'),_0xe9ad('0x58'),_0xe9ad('0x59'),'defaultLogo','defaultLoginLogo',_0xe9ad('0x5c'),_0xe9ad('0x5d')],'raw':!![]});})[_0xe9ad('0x1c')](handleEntityNotFound(_0x5c4f5b,null))[_0xe9ad('0x1c')](function(_0x32c478){if(_0x32c478){var _0xa71de9=_0x32c478[_0xe9ad('0x57')]&&fs[_0xe9ad('0x5e')](path[_0xe9ad('0x61')](config['root'],_0x7143b0,_[_0xe9ad('0x60')](_0x32c478[_0xe9ad('0x57')])))?path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x7143b0,_[_0xe9ad('0x60')](_0x32c478[_0xe9ad('0x57')])):path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x7143b0,_['toLower'](_0xe9ad('0x6b')));var _0x3d12f4=_0xe9ad('0x63')+_['upperFirst']('loginLogo');if(_0x32c478[_0x3d12f4]||!_0x2345ec['custom']){_0xa71de9=path[_0xe9ad('0x61')](config['root'],_0x7143b0,_[_0xe9ad('0x60')]('default_loginLogo.svg'));}if(!fs[_0xe9ad('0x5e')](_0xa71de9)){throw new db[(_0xe9ad('0x6c'))]['ValidationError'](_[_0xe9ad('0x64')](_0xe9ad('0x57'))+_0xe9ad('0x6d'));}return _0x5c4f5b['download'](_0xa71de9);}})['catch'](handleError(_0x5c4f5b,null));};exports[_0xe9ad('0x6e')]=function(_0x5cea08,_0x570948){return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x5cea08[_0xe9ad('0x4d')]['id']},'attributes':[_0xe9ad('0x6f')]})[_0xe9ad('0x1c')](respondWithResult(_0x570948,null))[_0xe9ad('0x25')](handleError(_0x570948,null));};exports[_0xe9ad('0x70')]=function(_0x189573,_0x146d2e,_0xca20ae){if(_0x189573[_0xe9ad('0x53')]&&_0x189573[_0xe9ad('0x53')][_0xe9ad('0x54')]){_0x189573[_0xe9ad('0x51')][_0xe9ad('0x58')]=_0x189573[_0xe9ad('0x53')][_0xe9ad('0x54')];}return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x189573['params']['id']}})[_0xe9ad('0x1c')](handleEntityNotFound(_0x146d2e,null))[_0xe9ad('0x1c')](saveUpdates(_0x189573[_0xe9ad('0x51')],null))[_0xe9ad('0x1c')](respondWithResult(_0x146d2e,null))[_0xe9ad('0x25')](handleError(_0x146d2e,null));};var utilLicense=require(_0xe9ad('0x67'));exports[_0xe9ad('0x71')]=function(_0x575519,_0x2be270,_0x427e0b){var _0x1c013a=_0xe9ad('0x69');var _0x1f5232={'custom':![]};return utilLicense[_0xe9ad('0x6a')]()[_0xe9ad('0x1c')](function(_0x19e296){if(_0x19e296){_0x1f5232=_0x19e296;}return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x575519[_0xe9ad('0x4d')]['id']},'attributes':[_0xe9ad('0x55'),_0xe9ad('0x57'),_0xe9ad('0x58'),'favicon','defaultLogo',_0xe9ad('0x5b'),_0xe9ad('0x5c'),_0xe9ad('0x5d')],'raw':!![]});})[_0xe9ad('0x1c')](handleEntityNotFound(_0x2be270,null))[_0xe9ad('0x1c')](function(_0x4fa2cc){if(_0x4fa2cc){var _0x2964c4=_0x4fa2cc[_0xe9ad('0x58')]&&fs['existsSync'](path[_0xe9ad('0x61')](config['root'],_0x1c013a,_[_0xe9ad('0x60')](_0x4fa2cc['preferred'])))?path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x1c013a,_[_0xe9ad('0x60')](_0x4fa2cc[_0xe9ad('0x58')])):path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x1c013a,_[_0xe9ad('0x60')]('default_preferred.png'));var _0x25ca25=_0xe9ad('0x63')+_[_0xe9ad('0x64')](_0xe9ad('0x58'));if(_0x4fa2cc[_0x25ca25]||!_0x1f5232['custom']||!_0x1f5232['preferred']){_0x2964c4=path['join'](config[_0xe9ad('0x5f')],_0x1c013a,_['toLower']('default_preferred.png'));}if(!fs[_0xe9ad('0x5e')](_0x2964c4)){throw new db[(_0xe9ad('0x6c'))][(_0xe9ad('0x65'))](_[_0xe9ad('0x64')](_0xe9ad('0x58'))+_0xe9ad('0x6d'));}return _0x2be270[_0xe9ad('0x66')](_0x2964c4);}})['catch'](handleError(_0x2be270,null));};exports[_0xe9ad('0x72')]=function(_0x371953,_0x13fc69,_0x222946){if(_0x371953[_0xe9ad('0x53')]&&_0x371953[_0xe9ad('0x53')][_0xe9ad('0x54')]){_0x371953[_0xe9ad('0x51')][_0xe9ad('0x59')]=_0x371953[_0xe9ad('0x53')][_0xe9ad('0x54')];}return db[_0xe9ad('0x37')][_0xe9ad('0x50')]({'where':{'id':_0x371953[_0xe9ad('0x4d')]['id']}})[_0xe9ad('0x1c')](handleEntityNotFound(_0x13fc69,null))[_0xe9ad('0x1c')](saveUpdates(_0x371953[_0xe9ad('0x51')],null))[_0xe9ad('0x1c')](respondWithResult(_0x13fc69,null))[_0xe9ad('0x25')](handleError(_0x13fc69,null));};var utilLicense=require(_0xe9ad('0x67'));exports[_0xe9ad('0x73')]=function(_0x263e24,_0x3c112f,_0x3d70ab){var _0x192747=_0xe9ad('0x69');var _0x1ec346={'custom':![]};return utilLicense[_0xe9ad('0x6a')]()[_0xe9ad('0x1c')](function(_0x2c5e23){if(_0x2c5e23){_0x1ec346=_0x2c5e23;}return db['Setting'][_0xe9ad('0x50')]({'where':{'id':_0x263e24[_0xe9ad('0x4d')]['id']},'attributes':[_0xe9ad('0x55'),_0xe9ad('0x57'),_0xe9ad('0x58'),_0xe9ad('0x59'),_0xe9ad('0x5a'),'defaultLoginLogo','defaultPreferred',_0xe9ad('0x5d')],'raw':!![]});})[_0xe9ad('0x1c')](handleEntityNotFound(_0x3c112f,null))['then'](function(_0xdee33d){if(_0xdee33d){var _0x34d631=_0xdee33d[_0xe9ad('0x59')]&&fs[_0xe9ad('0x5e')](path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x192747,_[_0xe9ad('0x60')](_0xdee33d[_0xe9ad('0x59')])))?path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x192747,_[_0xe9ad('0x60')](_0xdee33d[_0xe9ad('0x59')])):path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x192747,_['toLower']('default_favicon.ico'));var _0x17b2c9=_0xe9ad('0x63')+_[_0xe9ad('0x64')](_0xe9ad('0x59'));if(_0xdee33d[_0x17b2c9]||!_0x1ec346[_0xe9ad('0x74')]){_0x34d631=path[_0xe9ad('0x61')](config[_0xe9ad('0x5f')],_0x192747,_['toLower'](_0xe9ad('0x75')));}if(!fs[_0xe9ad('0x5e')](_0x34d631)){throw new db['Sequelize'][(_0xe9ad('0x65'))](_[_0xe9ad('0x64')](_0xe9ad('0x59'))+_0xe9ad('0x6d'));}return _0x3c112f[_0xe9ad('0x66')](_0x34d631);}})[_0xe9ad('0x25')](handleError(_0x3c112f,null));};exports[_0xe9ad('0x76')]=function(_0x2b7efc,_0x1207f2){var _0x4d175e={'offset':moment()[_0xe9ad('0x77')]()};_0x4d175e[_0xe9ad('0x78')]=moment()[_0xe9ad('0x77')](_0x4d175e[_0xe9ad('0x2c')])[_0xe9ad('0x79')](_0xe9ad('0x7a'));return _0x1207f2['status'](0xc8)['send'](_0x4d175e);}; \ No newline at end of file +var _0x6690=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','http','request','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','preferred','defaultLogo','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','favicon','defaultLoginLogo','defaultPreferred','custom','default_loginLogo.svg','securePassword','getPreferred','server/files/images/logos','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS'];(function(_0x201adb,_0x5c0474){var _0x13e1f7=function(_0x517428){while(--_0x517428){_0x201adb['push'](_0x201adb['shift']());}};_0x13e1f7(++_0x5c0474);}(_0x6690,0x7a));var _0x0669=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6690[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0669('0x0'));var zipdir=require(_0x0669('0x1'));var jsonpatch=require(_0x0669('0x2'));var rp=require(_0x0669('0x3'));var moment=require('moment');var BPromise=require(_0x0669('0x4'));var Mustache=require(_0x0669('0x5'));var util=require(_0x0669('0x6'));var path=require(_0x0669('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0669('0x8'));var _=require(_0x0669('0x9'));var squel=require(_0x0669('0xa'));var crypto=require('crypto');var jsforce=require(_0x0669('0xb'));var deskjs=require(_0x0669('0xc'));var toCsv=require(_0x0669('0xd'));var querystring=require('querystring');var Papa=require(_0x0669('0xe'));var Redis=require('ioredis');var authService=require(_0x0669('0xf'));var qs=require(_0x0669('0x10'));var as=require(_0x0669('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0669('0x12'))('api');var utils=require(_0x0669('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0669('0x14'))['db'];var jayson=require(_0x0669('0x15'));var client=jayson['client'][_0x0669('0x16')]({'port':0x232a});function respondWithRpcPromise(_0xbd356f,_0x181ecb,_0xcbc72f,_0x41fd86){return new BPromise(function(_0x323455,_0x382ad1){var _0x24ee8b=_0x41fd86||client;return _0x24ee8b[_0x0669('0x17')](_0xbd356f,_0xcbc72f)['then'](function(_0x1858ed){logger['info'](_0x0669('0x18'),_0x181ecb,_0x0669('0x19'));logger['debug'](_0x0669('0x1a'),_0x181ecb,_0x0669('0x19'),JSON[_0x0669('0x1b')](_0x1858ed));if(_0x1858ed[_0x0669('0x1c')]){if(_0x1858ed['error'][_0x0669('0x1d')]===0x1f4){logger['error'](_0x0669('0x18'),_0x181ecb,_0x1858ed[_0x0669('0x1c')][_0x0669('0x1e')]);return _0x382ad1(_0x1858ed[_0x0669('0x1c')][_0x0669('0x1e')]);}logger['error']('Setting,\x20%s,\x20%s',_0x181ecb,_0x1858ed[_0x0669('0x1c')]['message']);return _0x323455(_0x1858ed[_0x0669('0x1c')][_0x0669('0x1e')]);}else{logger[_0x0669('0x1f')](_0x0669('0x18'),_0x181ecb,_0x0669('0x19'));_0x323455(_0x1858ed['result']['message']);}})[_0x0669('0x20')](function(_0x312e4a){logger[_0x0669('0x1c')](_0x0669('0x18'),_0x181ecb,_0x312e4a);_0x382ad1(_0x312e4a);});});}function respondWithStatusCode(_0x441aa8,_0x44f84e){_0x44f84e=_0x44f84e||0xcc;return function(_0x557d33){if(_0x557d33){return _0x441aa8[_0x0669('0x21')](_0x44f84e);}return _0x441aa8[_0x0669('0x22')](_0x44f84e)['end']();};}function respondWithResult(_0x154791,_0x184cbf){_0x184cbf=_0x184cbf||0xc8;return function(_0xe21283){if(_0xe21283){return _0x154791['status'](_0x184cbf)['json'](_0xe21283);}};}function respondWithFilteredResult(_0x45efe0,_0xa7f8c){return function(_0x2757f7){if(_0x2757f7){var _0x18323b=typeof _0xa7f8c['offset']===_0x0669('0x23')&&typeof _0xa7f8c[_0x0669('0x24')]===_0x0669('0x23');var _0x1c3c5c=_0x2757f7[_0x0669('0x25')];var _0x51b8f6=_0x18323b?0x0:_0xa7f8c[_0x0669('0x26')];var _0x3a2c24=_0x18323b?_0x2757f7[_0x0669('0x25')]:_0xa7f8c[_0x0669('0x26')]+_0xa7f8c['limit'];var _0x3c3a80;if(_0x3a2c24>=_0x1c3c5c){_0x3a2c24=_0x1c3c5c;_0x3c3a80=0xc8;}else{_0x3c3a80=0xce;}_0x45efe0[_0x0669('0x22')](_0x3c3a80);return _0x45efe0[_0x0669('0x27')](_0x0669('0x28'),_0x51b8f6+'-'+_0x3a2c24+'/'+_0x1c3c5c)['json'](_0x2757f7);}return null;};}function patchUpdates(_0x1c4568){return function(_0x570536){try{jsonpatch[_0x0669('0x29')](_0x570536,_0x1c4568,!![]);}catch(_0x33bc39){return BPromise[_0x0669('0x2a')](_0x33bc39);}return _0x570536['save']();};}function saveUpdates(_0x24787b,_0x39f7af){return function(_0x53b5d1){if(_0x53b5d1){return _0x53b5d1[_0x0669('0x2b')](_0x24787b)[_0x0669('0x2c')](function(_0x189dfa){return _0x189dfa;});}return null;};}function removeEntity(_0xbb8757,_0x44b6a0){return function(_0xc9a34){if(_0xc9a34){return _0xc9a34['destroy']()['then'](function(){_0xbb8757[_0x0669('0x22')](0xcc)[_0x0669('0x2d')]();});}};}function handleEntityNotFound(_0x3c41ab,_0x19f1b7){return function(_0x34f27d){if(!_0x34f27d){_0x3c41ab[_0x0669('0x21')](0x194);}return _0x34f27d;};}function handleError(_0x4e99a8,_0x3b7d29){_0x3b7d29=_0x3b7d29||0x1f4;return function(_0x4b6092){logger['error'](_0x4b6092[_0x0669('0x2e')]);if(_0x4b6092['name']){delete _0x4b6092[_0x0669('0x2f')];}_0x4e99a8['status'](_0x3b7d29)[_0x0669('0x30')](_0x4b6092);};}exports[_0x0669('0x31')]=function(_0x3a191f,_0x395666){var _0x10e326={},_0xb29d8b={},_0x4def23={'count':0x0,'rows':[]};var _0x415d95=_['map'](db[_0x0669('0x32')][_0x0669('0x33')],function(_0x3aef4c){return{'name':_0x3aef4c[_0x0669('0x34')],'type':_0x3aef4c[_0x0669('0x35')][_0x0669('0x36')]};});_0xb29d8b[_0x0669('0x37')]=_[_0x0669('0x38')](_0x415d95,_0x0669('0x2f'));_0xb29d8b['query']=_['keys'](_0x3a191f[_0x0669('0x39')]);_0xb29d8b[_0x0669('0x3a')]=_[_0x0669('0x3b')](_0xb29d8b['model'],_0xb29d8b['query']);_0x10e326['attributes']=_[_0x0669('0x3b')](_0xb29d8b[_0x0669('0x37')],qs[_0x0669('0x3c')](_0x3a191f[_0x0669('0x39')][_0x0669('0x3c')]));_0x10e326[_0x0669('0x3d')]=_0x10e326[_0x0669('0x3d')][_0x0669('0x3e')]?_0x10e326[_0x0669('0x3d')]:_0xb29d8b[_0x0669('0x37')];if(!_0x3a191f[_0x0669('0x39')][_0x0669('0x3f')](_0x0669('0x40'))){_0x10e326[_0x0669('0x24')]=qs['limit'](_0x3a191f[_0x0669('0x39')]['limit']);_0x10e326[_0x0669('0x26')]=qs[_0x0669('0x26')](_0x3a191f[_0x0669('0x39')][_0x0669('0x26')]);}_0x10e326[_0x0669('0x41')]=qs[_0x0669('0x42')](_0x3a191f['query']['sort']);_0x10e326['where']=qs[_0x0669('0x3a')](_[_0x0669('0x43')](_0x3a191f[_0x0669('0x39')],_0xb29d8b[_0x0669('0x3a')]),_0x415d95);if(_0x3a191f[_0x0669('0x39')][_0x0669('0x44')]){_0x10e326[_0x0669('0x45')]=_[_0x0669('0x46')](_0x10e326[_0x0669('0x45')],{'$or':_[_0x0669('0x38')](_0x415d95,function(_0x5d3d38){if(_0x5d3d38['type']!==_0x0669('0x47')){var _0x4245bd={};_0x4245bd[_0x5d3d38['name']]={'$like':'%'+_0x3a191f[_0x0669('0x39')][_0x0669('0x44')]+'%'};return _0x4245bd;}})});}_0x10e326=_[_0x0669('0x46')]({},_0x10e326,_0x3a191f[_0x0669('0x48')]);var _0x3fdee5={'where':_0x10e326[_0x0669('0x45')]};return db[_0x0669('0x32')][_0x0669('0x25')](_0x3fdee5)[_0x0669('0x2c')](function(_0x5edbc6){_0x4def23[_0x0669('0x25')]=_0x5edbc6;if(_0x3a191f[_0x0669('0x39')][_0x0669('0x49')]){_0x10e326[_0x0669('0x4a')]=[{'all':!![]}];}return db[_0x0669('0x32')][_0x0669('0x4b')](_0x10e326);})[_0x0669('0x2c')](function(_0xc83189){_0x4def23[_0x0669('0x4c')]=_0xc83189;return _0x4def23;})[_0x0669('0x2c')](respondWithFilteredResult(_0x395666,_0x10e326))[_0x0669('0x20')](handleError(_0x395666,null));};exports[_0x0669('0x4d')]=function(_0x167cb0,_0x2206f0){var _0x398fa9={'raw':![],'where':{'id':_0x167cb0['params']['id']}},_0x214b94={};_0x214b94[_0x0669('0x37')]=_[_0x0669('0x4e')](db[_0x0669('0x32')][_0x0669('0x33')]);_0x214b94[_0x0669('0x39')]=_['keys'](_0x167cb0['query']);_0x214b94[_0x0669('0x3a')]=_['intersection'](_0x214b94['model'],_0x214b94['query']);_0x398fa9[_0x0669('0x3d')]=_[_0x0669('0x3b')](_0x214b94[_0x0669('0x37')],qs[_0x0669('0x3c')](_0x167cb0[_0x0669('0x39')][_0x0669('0x3c')]));_0x398fa9[_0x0669('0x3d')]=_0x398fa9[_0x0669('0x3d')][_0x0669('0x3e')]?_0x398fa9[_0x0669('0x3d')]:_0x214b94[_0x0669('0x37')];if(_0x167cb0[_0x0669('0x39')][_0x0669('0x49')]){_0x398fa9[_0x0669('0x4a')]=[{'all':!![]}];}_0x398fa9=_[_0x0669('0x46')]({},_0x398fa9,_0x167cb0[_0x0669('0x48')]);return db[_0x0669('0x32')][_0x0669('0x4f')](_0x398fa9)[_0x0669('0x2c')](handleEntityNotFound(_0x2206f0,null))['then'](respondWithResult(_0x2206f0,null))['catch'](handleError(_0x2206f0,null));};exports[_0x0669('0x2b')]=function(_0x4a7b65,_0x2e05dc){if(_0x4a7b65[_0x0669('0x50')]['id']){delete _0x4a7b65['body']['id'];}return db[_0x0669('0x32')]['find']({'where':{'id':_0x4a7b65[_0x0669('0x51')]['id']}})[_0x0669('0x2c')](handleEntityNotFound(_0x2e05dc,null))[_0x0669('0x2c')](saveUpdates(_0x4a7b65[_0x0669('0x50')],null))['then'](respondWithResult(_0x2e05dc,null))[_0x0669('0x20')](handleError(_0x2e05dc,null));};exports[_0x0669('0x52')]=function(_0x3f15c0,_0x337e35,_0x325af6){if(_0x3f15c0[_0x0669('0x53')]&&_0x3f15c0[_0x0669('0x53')][_0x0669('0x54')]){_0x3f15c0[_0x0669('0x50')][_0x0669('0x55')]=_0x3f15c0[_0x0669('0x53')][_0x0669('0x54')];}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x3f15c0['params']['id']}})[_0x0669('0x2c')](handleEntityNotFound(_0x337e35,null))[_0x0669('0x2c')](saveUpdates(_0x3f15c0[_0x0669('0x50')],null))[_0x0669('0x2c')](respondWithResult(_0x337e35,null))[_0x0669('0x20')](handleError(_0x337e35,null));};exports[_0x0669('0x56')]=function(_0x402615,_0x40e8cc,_0x34d8ad){if(_0x402615[_0x0669('0x53')]&&_0x402615['file'][_0x0669('0x54')]){_0x402615[_0x0669('0x50')][_0x0669('0x57')]=_0x402615['file'][_0x0669('0x54')];}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x402615['params']['id']}})[_0x0669('0x2c')](handleEntityNotFound(_0x40e8cc,null))['then'](saveUpdates(_0x402615[_0x0669('0x50')],null))['then'](respondWithResult(_0x40e8cc,null))[_0x0669('0x20')](handleError(_0x40e8cc,null));};var utilLicense=require(_0x0669('0x58'));exports[_0x0669('0x59')]=function(_0x5f46b1,_0x4364cc,_0x8a32e8){var _0x654f46='server/files/images/logos';var _0x24db90={'custom':![]};return utilLicense[_0x0669('0x5a')]()[_0x0669('0x2c')](function(_0x26e5f5){if(_0x26e5f5){_0x24db90=_0x26e5f5;}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x5f46b1[_0x0669('0x51')]['id']},'attributes':[_0x0669('0x55'),_0x0669('0x57'),_0x0669('0x5b'),'favicon',_0x0669('0x5c'),'defaultLoginLogo','defaultPreferred',_0x0669('0x5d')],'raw':!![]});})[_0x0669('0x2c')](handleEntityNotFound(_0x4364cc,null))[_0x0669('0x2c')](function(_0x730015){if(_0x730015){var _0xf6a80e=_0x730015[_0x0669('0x55')]&&fs[_0x0669('0x5e')](path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x654f46,_['toLower'](_0x730015[_0x0669('0x55')])))?path[_0x0669('0x5f')](config['root'],_0x654f46,_['toLower'](_0x730015['logo'])):path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x654f46,_[_0x0669('0x61')]('default_logo.svg'));var _0x935953=_0x0669('0x62')+_[_0x0669('0x63')](_0x0669('0x55'));if(_0x730015[_0x935953]||!_0x24db90['custom']){_0xf6a80e=path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x654f46,_[_0x0669('0x61')]('default_logo.svg'));}if(!fs['existsSync'](_0xf6a80e)){throw new db[(_0x0669('0x64'))][(_0x0669('0x65'))](_[_0x0669('0x63')](_0x0669('0x55'))+_0x0669('0x66'));}return _0x4364cc[_0x0669('0x67')](_0xf6a80e);}})[_0x0669('0x20')](handleError(_0x4364cc,null));};var utilLicense=require(_0x0669('0x58'));exports[_0x0669('0x68')]=function(_0x19a807,_0x43de47,_0x41469b){var _0x36d7e4='server/files/images/logos';var _0xf13485={'custom':![]};return utilLicense[_0x0669('0x5a')]()[_0x0669('0x2c')](function(_0x682076){if(_0x682076){_0xf13485=_0x682076;}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x19a807[_0x0669('0x51')]['id']},'attributes':[_0x0669('0x55'),_0x0669('0x57'),_0x0669('0x5b'),_0x0669('0x69'),'defaultLogo',_0x0669('0x6a'),_0x0669('0x6b'),_0x0669('0x5d')],'raw':!![]});})[_0x0669('0x2c')](handleEntityNotFound(_0x43de47,null))[_0x0669('0x2c')](function(_0x192f6c){if(_0x192f6c){var _0x59c5b1=_0x192f6c[_0x0669('0x57')]&&fs[_0x0669('0x5e')](path['join'](config[_0x0669('0x60')],_0x36d7e4,_[_0x0669('0x61')](_0x192f6c['loginLogo'])))?path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x36d7e4,_['toLower'](_0x192f6c['loginLogo'])):path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x36d7e4,_[_0x0669('0x61')]('default_loginLogo.svg'));var _0x3f364e='default'+_['upperFirst'](_0x0669('0x57'));if(_0x192f6c[_0x3f364e]||!_0xf13485[_0x0669('0x6c')]){_0x59c5b1=path['join'](config[_0x0669('0x60')],_0x36d7e4,_[_0x0669('0x61')](_0x0669('0x6d')));}if(!fs[_0x0669('0x5e')](_0x59c5b1)){throw new db[(_0x0669('0x64'))][(_0x0669('0x65'))](_[_0x0669('0x63')](_0x0669('0x57'))+_0x0669('0x66'));}return _0x43de47[_0x0669('0x67')](_0x59c5b1);}})[_0x0669('0x20')](handleError(_0x43de47,null));};exports['gdpr']=function(_0x401c48,_0x20f1f9){return db['Setting'][_0x0669('0x4f')]({'where':{'id':_0x401c48[_0x0669('0x51')]['id']},'attributes':[_0x0669('0x6e')]})[_0x0669('0x2c')](respondWithResult(_0x20f1f9,null))[_0x0669('0x20')](handleError(_0x20f1f9,null));};exports['addPreferred']=function(_0x2292b9,_0x509230,_0x2ad4ab){if(_0x2292b9['file']&&_0x2292b9[_0x0669('0x53')][_0x0669('0x54')]){_0x2292b9['body'][_0x0669('0x5b')]=_0x2292b9[_0x0669('0x53')][_0x0669('0x54')];}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x2292b9[_0x0669('0x51')]['id']}})[_0x0669('0x2c')](handleEntityNotFound(_0x509230,null))[_0x0669('0x2c')](saveUpdates(_0x2292b9[_0x0669('0x50')],null))[_0x0669('0x2c')](respondWithResult(_0x509230,null))[_0x0669('0x20')](handleError(_0x509230,null));};var utilLicense=require('../../config/license/util');exports[_0x0669('0x6f')]=function(_0x71e6f6,_0x289c2b,_0x54e4cb){var _0x10718=_0x0669('0x70');var _0x19efbe={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xafb58d){if(_0xafb58d){_0x19efbe=_0xafb58d;}return db[_0x0669('0x32')][_0x0669('0x4f')]({'where':{'id':_0x71e6f6[_0x0669('0x51')]['id']},'attributes':[_0x0669('0x55'),_0x0669('0x57'),'preferred',_0x0669('0x69'),_0x0669('0x5c'),_0x0669('0x6a'),'defaultPreferred',_0x0669('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x289c2b,null))[_0x0669('0x2c')](function(_0x566e96){if(_0x566e96){var _0x1952b0=_0x566e96[_0x0669('0x5b')]&&fs[_0x0669('0x5e')](path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x10718,_[_0x0669('0x61')](_0x566e96[_0x0669('0x5b')])))?path[_0x0669('0x5f')](config['root'],_0x10718,_[_0x0669('0x61')](_0x566e96[_0x0669('0x5b')])):path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x10718,_[_0x0669('0x61')]('default_preferred.png'));var _0x407470='default'+_[_0x0669('0x63')]('preferred');if(_0x566e96[_0x407470]||!_0x19efbe[_0x0669('0x6c')]||!_0x19efbe[_0x0669('0x5b')]){_0x1952b0=path['join'](config[_0x0669('0x60')],_0x10718,_[_0x0669('0x61')](_0x0669('0x71')));}if(!fs[_0x0669('0x5e')](_0x1952b0)){throw new db[(_0x0669('0x64'))][(_0x0669('0x65'))](_[_0x0669('0x63')]('preferred')+'\x20not\x20found');}return _0x289c2b[_0x0669('0x67')](_0x1952b0);}})[_0x0669('0x20')](handleError(_0x289c2b,null));};exports[_0x0669('0x72')]=function(_0x17d181,_0x224404,_0x4d0e32){if(_0x17d181['file']&&_0x17d181[_0x0669('0x53')][_0x0669('0x54')]){_0x17d181[_0x0669('0x50')]['favicon']=_0x17d181[_0x0669('0x53')]['filename'];}return db['Setting'][_0x0669('0x4f')]({'where':{'id':_0x17d181[_0x0669('0x51')]['id']}})['then'](handleEntityNotFound(_0x224404,null))[_0x0669('0x2c')](saveUpdates(_0x17d181[_0x0669('0x50')],null))[_0x0669('0x2c')](respondWithResult(_0x224404,null))[_0x0669('0x20')](handleError(_0x224404,null));};var utilLicense=require(_0x0669('0x58'));exports[_0x0669('0x73')]=function(_0xcdd208,_0x7a5a19,_0x1c30ed){var _0x663b6e=_0x0669('0x70');var _0x59132b={'custom':![]};return utilLicense[_0x0669('0x5a')]()[_0x0669('0x2c')](function(_0x3cacf2){if(_0x3cacf2){_0x59132b=_0x3cacf2;}return db[_0x0669('0x32')]['find']({'where':{'id':_0xcdd208['params']['id']},'attributes':[_0x0669('0x55'),_0x0669('0x57'),_0x0669('0x5b'),_0x0669('0x69'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x0669('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x7a5a19,null))[_0x0669('0x2c')](function(_0x258999){if(_0x258999){var _0x36f1e5=_0x258999[_0x0669('0x69')]&&fs[_0x0669('0x5e')](path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x663b6e,_['toLower'](_0x258999[_0x0669('0x69')])))?path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x663b6e,_['toLower'](_0x258999['favicon'])):path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x663b6e,_[_0x0669('0x61')](_0x0669('0x74')));var _0x4a4480='default'+_[_0x0669('0x63')](_0x0669('0x69'));if(_0x258999[_0x4a4480]||!_0x59132b[_0x0669('0x6c')]){_0x36f1e5=path[_0x0669('0x5f')](config[_0x0669('0x60')],_0x663b6e,_[_0x0669('0x61')](_0x0669('0x74')));}if(!fs[_0x0669('0x5e')](_0x36f1e5)){throw new db[(_0x0669('0x64'))][(_0x0669('0x65'))](_[_0x0669('0x63')]('favicon')+_0x0669('0x66'));}return _0x7a5a19[_0x0669('0x67')](_0x36f1e5);}})[_0x0669('0x20')](handleError(_0x7a5a19,null));};exports[_0x0669('0x75')]=function(_0x23f540,_0x209b28){var _0x4090df={'offset':moment()[_0x0669('0x76')]()};_0x4090df[_0x0669('0x77')]=moment()['utcOffset'](_0x4090df[_0x0669('0x26')])[_0x0669('0x78')](_0x0669('0x79'));return _0x209b28['status'](0xc8)[_0x0669('0x30')](_0x4090df);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index ecdcf9d..1acaa97 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x1e1f5f,_0x535a02){var _0x46f7d5=function(_0x5c5e5e){while(--_0x5c5e5e){_0x1e1f5f['push'](_0x1e1f5f['shift']());}};_0x46f7d5(++_0x535a02);}(_0xe14b,0x93));var _0xbe14=function(_0x256198,_0x1d03e6){_0x256198=_0x256198-0x0;var _0x285a83=_0xe14b[_0x256198];return _0x285a83;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x317cc5,_0x3b6179){var _0x44fe81=function(_0x3b43b5){while(--_0x3b43b5){_0x317cc5['push'](_0x317cc5['shift']());}};_0x44fe81(++_0x3b6179);}(_0x008c,0x188));var _0xc008=function(_0x4af6a0,_0x522121){_0x4af6a0=_0x4af6a0-0x0;var _0x4c2b23=_0x008c[_0x4af6a0];return _0x4c2b23;};'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')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index aacf378..c0066b0 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 _0xecd0=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Setting','options','raw','where','attributes','include','map','model','ShowSetting'];(function(_0x4edac5,_0x41d853){var _0x572b3b=function(_0x1cc65f){while(--_0x1cc65f){_0x4edac5['push'](_0x4edac5['shift']());}};_0x572b3b(++_0x41d853);}(_0xecd0,0x1ba));var _0x0ecd=function(_0x104993,_0x3f9a6b){_0x104993=_0x104993-0x0;var _0x105a96=_0xecd0[_0x104993];return _0x105a96;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0ecd('0x0'));var fs=require('fs');var Redis=require(_0x0ecd('0x1'));var db=require(_0x0ecd('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0ecd('0x3'));var config=require('../../config/environment');var jayson=require(_0x0ecd('0x4'));var client=jayson[_0x0ecd('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x435fc8,_0x2a8bbd,_0x57ba55){return new BPromise(function(_0x6fe39c,_0xa17366){return client[_0x0ecd('0x6')](_0x435fc8,_0x57ba55)[_0x0ecd('0x7')](function(_0x1eec1e){logger[_0x0ecd('0x8')](_0x0ecd('0x9'),_0x2a8bbd,_0x0ecd('0xa'));logger['debug'](_0x0ecd('0xb'),_0x2a8bbd,_0x0ecd('0xa'),JSON[_0x0ecd('0xc')](_0x1eec1e));if(_0x1eec1e[_0x0ecd('0xd')]){if(_0x1eec1e[_0x0ecd('0xd')][_0x0ecd('0xe')]===0x1f4){logger[_0x0ecd('0xd')]('Setting,\x20%s,\x20%s',_0x2a8bbd,_0x1eec1e[_0x0ecd('0xd')][_0x0ecd('0xf')]);return _0xa17366(_0x1eec1e[_0x0ecd('0xd')]['message']);}logger[_0x0ecd('0xd')](_0x0ecd('0x9'),_0x2a8bbd,_0x1eec1e[_0x0ecd('0xd')]['message']);return _0x6fe39c(_0x1eec1e[_0x0ecd('0xd')][_0x0ecd('0xf')]);}else{logger[_0x0ecd('0x8')]('Setting,\x20%s,\x20%s',_0x2a8bbd,'request\x20sent');_0x6fe39c(_0x1eec1e['result']['message']);}})[_0x0ecd('0x10')](function(_0x24424e){logger[_0x0ecd('0xd')](_0x0ecd('0x9'),_0x2a8bbd,_0x24424e);_0xa17366(_0x24424e);});});}exports['ShowSetting']=function(_0x5da3a6){var _0x4697d0=this;return new Promise(function(_0x18d8ff,_0xf7e9bf){return db[_0x0ecd('0x11')]['find']({'raw':_0x5da3a6[_0x0ecd('0x12')]?_0x5da3a6[_0x0ecd('0x12')][_0x0ecd('0x13')]===undefined?!![]:![]:!![],'where':_0x5da3a6[_0x0ecd('0x12')]?_0x5da3a6['options'][_0x0ecd('0x14')]||null:null,'attributes':_0x5da3a6[_0x0ecd('0x12')]?_0x5da3a6['options'][_0x0ecd('0x15')]||null:null,'include':_0x5da3a6[_0x0ecd('0x12')]?_0x5da3a6[_0x0ecd('0x12')][_0x0ecd('0x16')]?_[_0x0ecd('0x17')](_0x5da3a6[_0x0ecd('0x12')][_0x0ecd('0x16')],function(_0x27f42d){return{'model':db[_0x27f42d[_0x0ecd('0x18')]],'as':_0x27f42d['as'],'attributes':_0x27f42d[_0x0ecd('0x15')],'include':_0x27f42d['include']?_['map'](_0x27f42d[_0x0ecd('0x16')],function(_0x481e5e){return{'model':db[_0x481e5e['model']],'as':_0x481e5e['as'],'attributes':_0x481e5e[_0x0ecd('0x15')],'include':_0x481e5e[_0x0ecd('0x16')]?_[_0x0ecd('0x17')](_0x481e5e[_0x0ecd('0x16')],function(_0x7d07ae){return{'model':db[_0x7d07ae[_0x0ecd('0x18')]],'as':_0x7d07ae['as'],'attributes':_0x7d07ae[_0x0ecd('0x15')]};}):[]};}):[]};}):[]:[]})[_0x0ecd('0x7')](function(_0x808100){logger['info'](_0x0ecd('0x19'),_0x5da3a6);logger['debug'](_0x0ecd('0x19'),_0x5da3a6,JSON[_0x0ecd('0xc')](_0x808100));_0x18d8ff(_0x808100);})[_0x0ecd('0x10')](function(_0x163aff){logger[_0x0ecd('0xd')](_0x0ecd('0x19'),_0x163aff[_0x0ecd('0xf')],_0x5da3a6);_0xf7e9bf(_0x4697d0['error'](0x1f4,_0x163aff[_0x0ecd('0xf')]));});});}; \ No newline at end of file +var _0xabd8=['code','message','result','catch','ShowSetting','options','raw','where','attributes','map','include','model','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59ed8c,_0x497c0f){var _0x2ae760=function(_0x5e0c08){while(--_0x5e0c08){_0x59ed8c['push'](_0x59ed8c['shift']());}};_0x2ae760(++_0x497c0f);}(_0xabd8,0x84));var _0x8abd=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0xabd8[_0x14a0a0];return _0x56b651;};'use strict';var _=require('lodash');var util=require(_0x8abd('0x0'));var moment=require(_0x8abd('0x1'));var BPromise=require('bluebird');var rs=require(_0x8abd('0x2'));var fs=require('fs');var Redis=require(_0x8abd('0x3'));var db=require(_0x8abd('0x4'))['db'];var utils=require(_0x8abd('0x5'));var logger=require(_0x8abd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8abd('0x7'));var client=jayson['client'][_0x8abd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cba1e,_0x139eef,_0xbf7a93){return new BPromise(function(_0x581d00,_0x5f40a2){return client[_0x8abd('0x9')](_0x5cba1e,_0xbf7a93)[_0x8abd('0xa')](function(_0x5d10d3){logger[_0x8abd('0xb')](_0x8abd('0xc'),_0x139eef,_0x8abd('0xd'));logger[_0x8abd('0xe')](_0x8abd('0xf'),_0x139eef,_0x8abd('0xd'),JSON[_0x8abd('0x10')](_0x5d10d3));if(_0x5d10d3[_0x8abd('0x11')]){if(_0x5d10d3[_0x8abd('0x11')][_0x8abd('0x12')]===0x1f4){logger[_0x8abd('0x11')]('Setting,\x20%s,\x20%s',_0x139eef,_0x5d10d3['error'][_0x8abd('0x13')]);return _0x5f40a2(_0x5d10d3[_0x8abd('0x11')][_0x8abd('0x13')]);}logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x139eef,_0x5d10d3['error'][_0x8abd('0x13')]);return _0x581d00(_0x5d10d3['error'][_0x8abd('0x13')]);}else{logger[_0x8abd('0xb')]('Setting,\x20%s,\x20%s',_0x139eef,_0x8abd('0xd'));_0x581d00(_0x5d10d3[_0x8abd('0x14')][_0x8abd('0x13')]);}})[_0x8abd('0x15')](function(_0x3ebb5e){logger[_0x8abd('0x11')](_0x8abd('0xc'),_0x139eef,_0x3ebb5e);_0x5f40a2(_0x3ebb5e);});});}exports[_0x8abd('0x16')]=function(_0x2ec1b8){var _0x311ebe=this;return new Promise(function(_0x20cc40,_0x1c865b){return db['Setting']['find']({'raw':_0x2ec1b8[_0x8abd('0x17')]?_0x2ec1b8[_0x8abd('0x17')][_0x8abd('0x18')]===undefined?!![]:![]:!![],'where':_0x2ec1b8[_0x8abd('0x17')]?_0x2ec1b8[_0x8abd('0x17')][_0x8abd('0x19')]||null:null,'attributes':_0x2ec1b8[_0x8abd('0x17')]?_0x2ec1b8[_0x8abd('0x17')][_0x8abd('0x1a')]||null:null,'include':_0x2ec1b8[_0x8abd('0x17')]?_0x2ec1b8['options']['include']?_[_0x8abd('0x1b')](_0x2ec1b8[_0x8abd('0x17')][_0x8abd('0x1c')],function(_0x3f2629){return{'model':db[_0x3f2629[_0x8abd('0x1d')]],'as':_0x3f2629['as'],'attributes':_0x3f2629[_0x8abd('0x1a')],'include':_0x3f2629[_0x8abd('0x1c')]?_[_0x8abd('0x1b')](_0x3f2629[_0x8abd('0x1c')],function(_0x148a40){return{'model':db[_0x148a40[_0x8abd('0x1d')]],'as':_0x148a40['as'],'attributes':_0x148a40[_0x8abd('0x1a')],'include':_0x148a40[_0x8abd('0x1c')]?_[_0x8abd('0x1b')](_0x148a40[_0x8abd('0x1c')],function(_0x131f2b){return{'model':db[_0x131f2b[_0x8abd('0x1d')]],'as':_0x131f2b['as'],'attributes':_0x131f2b[_0x8abd('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19ead8){logger[_0x8abd('0xb')](_0x8abd('0x16'),_0x2ec1b8);logger[_0x8abd('0xe')](_0x8abd('0x16'),_0x2ec1b8,JSON[_0x8abd('0x10')](_0x19ead8));_0x20cc40(_0x19ead8);})[_0x8abd('0x15')](function(_0x5ea2be){logger[_0x8abd('0x11')]('ShowSetting',_0x5ea2be[_0x8abd('0x13')],_0x2ec1b8);_0x1c865b(_0x311ebe[_0x8abd('0x11')](0x1f4,_0x5ea2be[_0x8abd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 715ab96..c3623fa 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x4e91b6,_0x3b38af){var _0x5caa6a=function(_0x37d47a){while(--_0x37d47a){_0x4e91b6['push'](_0x4e91b6['shift']());}};_0x5caa6a(++_0x3b38af);}(_0xabce,0x103));var _0xeabc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xabce[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x47cc11,_0x14c5be){var _0x251e57=function(_0x5d51d9){while(--_0x5d51d9){_0x47cc11['push'](_0x47cc11['shift']());}};_0x251e57(++_0x14c5be);}(_0x53ec,0x192));var _0xc53e=function(_0x4a759b,_0x28a0b9){_0x4a759b=_0x4a759b-0x0;var _0x1619f2=_0x53ec[_0x4a759b];return _0x1619f2;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index cf136e4..ad4a3a7 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 _0xa3c5=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports','name','STRING','ENUM','twilio','skebby','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','TEXT'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa3c5,0x1b5));var _0x5a3c=function(_0x9ea6f8,_0x2cb4b8){_0x9ea6f8=_0x9ea6f8-0x0;var _0x198153=_0xa3c5[_0x9ea6f8];return _0x198153;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5a3c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5a3c('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x5a3c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x5a3c('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5a3c('0x2')]},'type':{'type':Sequelize[_0x5a3c('0x3')](_0x5a3c('0x4'),_0x5a3c('0x5'),'connectel',_0x5a3c('0x6'),_0x5a3c('0x7'),_0x5a3c('0x8'),'bandwidth',_0x5a3c('0x9'),'infobip',_0x5a3c('0xa'))},'accountSid':{'type':Sequelize[_0x5a3c('0x2')]},'authId':{'type':Sequelize[_0x5a3c('0x2')]},'authToken':{'type':Sequelize[_0x5a3c('0x2')]},'smsMethod':{'type':Sequelize[_0x5a3c('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5a3c('0x2')]},'password':{'type':Sequelize[_0x5a3c('0x2')]},'apiKey':{'type':Sequelize[_0x5a3c('0x2')]},'applicationId':{'type':Sequelize[_0x5a3c('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x5a3c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x5a3c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5a3c('0xc')],'defaultValue':function(){return _0x5a3c('0xd');}},'notificationSound':{'type':Sequelize[_0x5a3c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a3c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a3c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a3c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5a3c('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a3c('0xe')],'comment':_0x5a3c('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3e222a){if(!_0x3e222a)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x5a3c('0x10')](_0x5a3c('0x11'),_0x3e222a);}}}; \ No newline at end of file +var _0x1d8f=['infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','twilio','skebby','connectel','clicksend','clickatell','csc'];(function(_0x2c826b,_0xadaf9e){var _0x22603f=function(_0x5c3782){while(--_0x5c3782){_0x2c826b['push'](_0x2c826b['shift']());}};_0x22603f(++_0xadaf9e);}(_0x1d8f,0x1ed));var _0xf1d8=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1d8f[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xf1d8('0x0'));var rs=require(_0xf1d8('0x1'));module[_0xf1d8('0x2')]={'name':{'type':Sequelize[_0xf1d8('0x3')],'unique':_0xf1d8('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xf1d8('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xf1d8('0x3')]},'type':{'type':Sequelize['ENUM'](_0xf1d8('0x5'),_0xf1d8('0x6'),_0xf1d8('0x7'),_0xf1d8('0x8'),'plivo',_0xf1d8('0x9'),'bandwidth',_0xf1d8('0xa'),_0xf1d8('0xb'),_0xf1d8('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf1d8('0x3')]},'authToken':{'type':Sequelize[_0xf1d8('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xf1d8('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xf1d8('0x3')]},'applicationId':{'type':Sequelize[_0xf1d8('0x3')]},'accountId':{'type':Sequelize[_0xf1d8('0x3')]},'senderString':{'type':Sequelize[_0xf1d8('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xf1d8('0x3')]},'notificationTemplate':{'type':Sequelize[_0xf1d8('0xd')],'defaultValue':function(){return _0xf1d8('0xe');}},'notificationSound':{'type':Sequelize[_0xf1d8('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf1d8('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf1d8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf1d8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf1d8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf1d8('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf1d8('0x10')],'comment':_0xf1d8('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xf1d8('0xf')],'defaultValue':![],'comment':_0xf1d8('0x12'),'set':function(_0x39010f){if(!_0x39010f)this[_0xf1d8('0x13')]('mandatoryDispositionPauseId',null);this[_0xf1d8('0x13')](_0xf1d8('0x14'),_0x39010f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 4ce996d..68a6172 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 _0x3c65=['VIRTUAL','merge','findAll','rows','show','mandatoryDispositionPause','includeAll','options','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','nolimit','order','include','removeDispositions','ids','CannedAnswer','getAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','Body','messageId','MessageSid','skebby','from','connectel','clicksend','message_id','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','Sequelize','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','DESC','omit','Contacts','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','update','error_code','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','addAgents','removeAgents','userSmsAccount:remove','emit','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./smsAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','Pause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','type'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x3c65,0x88));var _0x53c6=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x3c65[_0x102977];return _0x15c466;};'use strict';var emlformat=require(_0x53c6('0x0'));var rimraf=require(_0x53c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x53c6('0x2'));var moment=require(_0x53c6('0x3'));var BPromise=require(_0x53c6('0x4'));var Mustache=require(_0x53c6('0x5'));var util=require(_0x53c6('0x6'));var path=require('path');var sox=require(_0x53c6('0x7'));var csv=require(_0x53c6('0x8'));var ejs=require(_0x53c6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x53c6('0xa'));var squel=require(_0x53c6('0xb'));var crypto=require(_0x53c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x53c6('0xd'));var toCsv=require(_0x53c6('0x8'));var querystring=require(_0x53c6('0xe'));var Papa=require(_0x53c6('0xf'));var Redis=require('ioredis');var authService=require(_0x53c6('0x10'));var qs=require(_0x53c6('0x11'));var as=require(_0x53c6('0x12'));var hardwareService=require(_0x53c6('0x13'));var logger=require(_0x53c6('0x14'))('api');var utils=require(_0x53c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x53c6('0x16'));var db=require(_0x53c6('0x17'))['db'];config['redis']=_[_0x53c6('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53c6('0x19')]));require(_0x53c6('0x1a'))[_0x53c6('0x1b')](socket);var jayson=require(_0x53c6('0x1c'));var client=jayson[_0x53c6('0x1d')][_0x53c6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0xb0c048,_0x1f7514,_0x5dc392,_0x22a8b4){return new BPromise(function(_0x53b8cf,_0x12b690){var _0x360ef3=_0x22a8b4||client;return _0x360ef3[_0x53c6('0x1f')](_0xb0c048,_0x5dc392)[_0x53c6('0x20')](function(_0x22f134){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1f7514,_0x53c6('0x21'));logger['debug'](_0x53c6('0x22'),_0x1f7514,_0x53c6('0x21'),JSON[_0x53c6('0x23')](_0x22f134));if(_0x22f134[_0x53c6('0x24')]){if(_0x22f134[_0x53c6('0x24')][_0x53c6('0x25')]===0x1f4){logger[_0x53c6('0x24')](_0x53c6('0x26'),_0x1f7514,_0x22f134[_0x53c6('0x24')][_0x53c6('0x27')]);return _0x12b690(_0x22f134[_0x53c6('0x24')]['message']);}logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1f7514,_0x22f134[_0x53c6('0x24')][_0x53c6('0x27')]);return _0x53b8cf(_0x22f134[_0x53c6('0x24')][_0x53c6('0x27')]);}else{logger[_0x53c6('0x28')](_0x53c6('0x26'),_0x1f7514,_0x53c6('0x21'));_0x53b8cf(_0x22f134[_0x53c6('0x29')][_0x53c6('0x27')]);}})[_0x53c6('0x2a')](function(_0x9b0652){logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1f7514,_0x9b0652);_0x12b690(_0x9b0652);});});}function respondWithStatusCode(_0x634f96,_0x1655ab){_0x1655ab=_0x1655ab||0xcc;return function(_0x40007c){if(_0x40007c){return _0x634f96[_0x53c6('0x2b')](_0x1655ab);}return _0x634f96['status'](_0x1655ab)['end']();};}function respondWithResult(_0x1747b2,_0x5c383c){_0x5c383c=_0x5c383c||0xc8;return function(_0x10427b){if(_0x10427b){return _0x1747b2[_0x53c6('0x2c')](_0x5c383c)[_0x53c6('0x2d')](_0x10427b);}};}function respondWithFilteredResult(_0x32b90f,_0x714494){return function(_0x56207c){if(_0x56207c){var _0x5ce13e=typeof _0x714494[_0x53c6('0x2e')]==='undefined'&&typeof _0x714494[_0x53c6('0x2f')]==='undefined';var _0x5974dd=_0x56207c[_0x53c6('0x30')];var _0x4b0f30=_0x5ce13e?0x0:_0x714494[_0x53c6('0x2e')];var _0x54ab28=_0x5ce13e?_0x56207c[_0x53c6('0x30')]:_0x714494[_0x53c6('0x2e')]+_0x714494[_0x53c6('0x2f')];var _0x51b802;if(_0x54ab28>=_0x5974dd){_0x54ab28=_0x5974dd;_0x51b802=0xc8;}else{_0x51b802=0xce;}_0x32b90f[_0x53c6('0x2c')](_0x51b802);return _0x32b90f[_0x53c6('0x31')](_0x53c6('0x32'),_0x4b0f30+'-'+_0x54ab28+'/'+_0x5974dd)['json'](_0x56207c);}return null;};}function patchUpdates(_0x41f4cc){return function(_0x224084){try{jsonpatch['apply'](_0x224084,_0x41f4cc,!![]);}catch(_0x16d001){return BPromise[_0x53c6('0x33')](_0x16d001);}return _0x224084[_0x53c6('0x34')]();};}function saveUpdates(_0x3ef2a8,_0xf2ccbe){return function(_0x314889){if(_0x314889){return _0x314889['update'](_0x3ef2a8)['then'](function(_0x293aca){return _0x293aca;});}return null;};}function removeEntity(_0x4ede5b,_0xd6dc92){return function(_0x2e024c){if(_0x2e024c){return _0x2e024c[_0x53c6('0x35')]()[_0x53c6('0x20')](function(){var _0x4c8fb3=_0x2e024c[_0x53c6('0x36')]({'plain':!![]});var _0x45c597=_0x53c6('0x37');return db[_0x53c6('0x38')][_0x53c6('0x35')]({'where':{'type':_0x45c597,'resourceId':_0x4c8fb3['id']}})['then'](function(){return _0x2e024c;});})[_0x53c6('0x20')](function(){_0x4ede5b[_0x53c6('0x2c')](0xcc)[_0x53c6('0x39')]();});}};}function handleEntityNotFound(_0x274323,_0x13cb55){return function(_0x54b7a5){if(!_0x54b7a5){_0x274323[_0x53c6('0x2b')](0x194);}return _0x54b7a5;};}function handleError(_0x26c0d7,_0x2066a9){_0x2066a9=_0x2066a9||0x1f4;return function(_0x39dd27){logger['error'](_0x39dd27[_0x53c6('0x3a')]);if(_0x39dd27[_0x53c6('0x3b')]){delete _0x39dd27[_0x53c6('0x3b')];}_0x26c0d7[_0x53c6('0x2c')](_0x2066a9)['send'](_0x39dd27);};}exports['index']=function(_0x520b3f,_0x5c9e4e){var _0x582c2d={'include':[{'model':db[_0x53c6('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4bf80c={},_0x17ac5e={'count':0x0,'rows':[]};var _0x2387b0=_[_0x53c6('0x3d')](db[_0x53c6('0x3e')][_0x53c6('0x3f')],function(_0x103fdd){return{'name':_0x103fdd['fieldName'],'type':_0x103fdd['type'][_0x53c6('0x40')]};});_0x4bf80c[_0x53c6('0x41')]=_[_0x53c6('0x3d')](_0x2387b0,_0x53c6('0x3b'));_0x4bf80c[_0x53c6('0x42')]=_[_0x53c6('0x43')](_0x520b3f[_0x53c6('0x42')]);_0x4bf80c[_0x53c6('0x44')]=_[_0x53c6('0x45')](_0x4bf80c[_0x53c6('0x41')],_0x4bf80c['query']);_0x582c2d[_0x53c6('0x46')]=_[_0x53c6('0x45')](_0x4bf80c[_0x53c6('0x41')],qs['fields'](_0x520b3f['query'][_0x53c6('0x47')]));_0x582c2d['attributes']=_0x582c2d['attributes'][_0x53c6('0x48')]?_0x582c2d[_0x53c6('0x46')]:_0x4bf80c[_0x53c6('0x41')];if(!_0x520b3f[_0x53c6('0x42')][_0x53c6('0x49')]('nolimit')){_0x582c2d[_0x53c6('0x2f')]=qs['limit'](_0x520b3f['query']['limit']);_0x582c2d[_0x53c6('0x2e')]=qs[_0x53c6('0x2e')](_0x520b3f['query'][_0x53c6('0x2e')]);}_0x582c2d['order']=qs[_0x53c6('0x4a')](_0x520b3f[_0x53c6('0x42')][_0x53c6('0x4a')]);_0x582c2d['where']=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x520b3f[_0x53c6('0x42')],_0x4bf80c[_0x53c6('0x44')]),_0x2387b0);if(_0x520b3f[_0x53c6('0x42')][_0x53c6('0x4c')]){_0x582c2d[_0x53c6('0x4d')]=_['merge'](_0x582c2d['where'],{'$or':_[_0x53c6('0x3d')](_0x2387b0,function(_0x173879){if(_0x173879[_0x53c6('0x4e')]!==_0x53c6('0x4f')){var _0x20a4d9={};_0x20a4d9[_0x173879[_0x53c6('0x3b')]]={'$like':'%'+_0x520b3f[_0x53c6('0x42')][_0x53c6('0x4c')]+'%'};return _0x20a4d9;}})});}_0x582c2d=_[_0x53c6('0x50')]({},_0x582c2d,_0x520b3f['options']);var _0xc47916={'where':_0x582c2d['where']};return db['SmsAccount']['count'](_0xc47916)['then'](function(_0x55b70e){_0x17ac5e['count']=_0x55b70e;if(_0x520b3f['query']['includeAll']){_0x582c2d['include']=[{'all':!![]}];}return db[_0x53c6('0x3e')][_0x53c6('0x51')](_0x582c2d);})[_0x53c6('0x20')](function(_0x2867b3){_0x17ac5e[_0x53c6('0x52')]=_0x2867b3;return _0x17ac5e;})[_0x53c6('0x20')](respondWithFilteredResult(_0x5c9e4e,_0x582c2d))['catch'](handleError(_0x5c9e4e,null));};exports[_0x53c6('0x53')]=function(_0x1e45ff,_0x4b74d3){var _0x5804a0={'raw':![],'where':{'id':_0x1e45ff['params']['id']},'include':[{'model':db[_0x53c6('0x3c')],'as':_0x53c6('0x54')}]},_0x99f4af={};_0x99f4af[_0x53c6('0x41')]=_[_0x53c6('0x43')](db[_0x53c6('0x3e')][_0x53c6('0x3f')]);_0x99f4af[_0x53c6('0x42')]=_[_0x53c6('0x43')](_0x1e45ff[_0x53c6('0x42')]);_0x99f4af['filters']=_[_0x53c6('0x45')](_0x99f4af[_0x53c6('0x41')],_0x99f4af['query']);_0x5804a0['attributes']=_[_0x53c6('0x45')](_0x99f4af['model'],qs[_0x53c6('0x47')](_0x1e45ff[_0x53c6('0x42')][_0x53c6('0x47')]));_0x5804a0['attributes']=_0x5804a0[_0x53c6('0x46')][_0x53c6('0x48')]?_0x5804a0[_0x53c6('0x46')]:_0x99f4af['model'];if(_0x1e45ff[_0x53c6('0x42')][_0x53c6('0x55')]){_0x5804a0['include']=[{'all':!![]}];}_0x5804a0=_[_0x53c6('0x50')]({},_0x5804a0,_0x1e45ff[_0x53c6('0x56')]);return db[_0x53c6('0x3e')]['find'](_0x5804a0)[_0x53c6('0x20')](handleEntityNotFound(_0x4b74d3,null))[_0x53c6('0x20')](respondWithResult(_0x4b74d3,null))[_0x53c6('0x2a')](handleError(_0x4b74d3,null));};exports[_0x53c6('0x57')]=function(_0x296a43,_0x25c0c4){return db[_0x53c6('0x3e')][_0x53c6('0x57')](_0x296a43[_0x53c6('0x58')],{})[_0x53c6('0x20')](function(_0x4d736d){var _0x859c64=_0x296a43[_0x53c6('0x59')][_0x53c6('0x36')]({'plain':!![]});if(!_0x859c64)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x859c64[_0x53c6('0x5a')]===_0x53c6('0x59')){var _0x5abd8f=_0x4d736d[_0x53c6('0x36')]({'plain':!![]});var _0x42d3a6='SmsAccounts';return db[_0x53c6('0x5b')][_0x53c6('0x5c')]({'where':{'name':_0x42d3a6,'userProfileId':_0x859c64[_0x53c6('0x5d')]},'raw':!![]})[_0x53c6('0x20')](function(_0x10665b){if(_0x10665b&&_0x10665b[_0x53c6('0x5e')]===0x0){return db[_0x53c6('0x38')][_0x53c6('0x57')]({'name':_0x5abd8f['name'],'resourceId':_0x5abd8f['id'],'type':_0x10665b[_0x53c6('0x3b')],'sectionId':_0x10665b['id']},{})['then'](function(){return _0x4d736d;});}else{return _0x4d736d;}})[_0x53c6('0x2a')](function(_0xa006a){logger['error'](_0x53c6('0x5f'),_0xa006a);throw _0xa006a;});}return _0x4d736d;})['then'](respondWithResult(_0x25c0c4,0xc9))['catch'](handleError(_0x25c0c4,null));};exports['update']=function(_0x3517f5,_0x382517){if(_0x3517f5['body']['id']){delete _0x3517f5[_0x53c6('0x58')]['id'];}return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0x3517f5['params']['id']},'include':[{'model':db[_0x53c6('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x53c6('0x20')](handleEntityNotFound(_0x382517,null))[_0x53c6('0x20')](saveUpdates(_0x3517f5[_0x53c6('0x58')],null))['then'](respondWithResult(_0x382517,null))[_0x53c6('0x2a')](handleError(_0x382517,null));};exports[_0x53c6('0x35')]=function(_0xff172d,_0x2215c1){return db[_0x53c6('0x3e')]['find']({'where':{'id':_0xff172d[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x2215c1,null))['then'](removeEntity(_0x2215c1,null))[_0x53c6('0x2a')](handleError(_0x2215c1,null));};exports[_0x53c6('0x61')]=function(_0xdd3276,_0x31640d){return db['SmsAccount']['describe']()['then'](respondWithResult(_0x31640d,null))['catch'](handleError(_0x31640d,null));};exports[_0x53c6('0x62')]=function(_0x1a32b0,_0x2a6bf3,_0xabddfa){if(_0x1a32b0[_0x53c6('0x58')]['id']){delete _0x1a32b0['body']['id'];}return db[_0x53c6('0x3e')]['find']({'where':{'id':_0x1a32b0['params']['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x2a6bf3,null))[_0x53c6('0x20')](function(_0x2bda79){if(_0x2bda79){_0x1a32b0[_0x53c6('0x58')][_0x53c6('0x63')]=_0x2bda79['id'];return db['Disposition'][_0x53c6('0x57')](_0x1a32b0['body']);}})[_0x53c6('0x20')](respondWithResult(_0x2a6bf3,null))[_0x53c6('0x2a')](handleError(_0x2a6bf3,null));};exports[_0x53c6('0x64')]=function(_0x1f0ea4,_0x3372a2,_0x4efe70){var _0x40c702={'raw':![],'where':{}};var _0x52e6ce={};var _0x4f0a42={'count':0x0,'rows':[]};return db[_0x53c6('0x3e')][_0x53c6('0x65')]({'where':{'id':_0x1f0ea4[_0x53c6('0x60')]['id']}})['then'](handleEntityNotFound(_0x3372a2,null))['then'](function(_0x2e78a0){if(_0x2e78a0){_0x52e6ce[_0x53c6('0x41')]=_[_0x53c6('0x43')](db[_0x53c6('0x66')]['rawAttributes']);_0x52e6ce[_0x53c6('0x42')]=_[_0x53c6('0x43')](_0x1f0ea4[_0x53c6('0x42')]);_0x52e6ce['filters']=_['intersection'](_0x52e6ce[_0x53c6('0x41')],_0x52e6ce[_0x53c6('0x42')]);_0x40c702[_0x53c6('0x46')]=_['intersection'](_0x52e6ce['model'],qs[_0x53c6('0x47')](_0x1f0ea4[_0x53c6('0x42')][_0x53c6('0x47')]));_0x40c702[_0x53c6('0x46')]=_0x40c702[_0x53c6('0x46')]['length']?_0x40c702[_0x53c6('0x46')]:_0x52e6ce[_0x53c6('0x41')];if(!_0x1f0ea4[_0x53c6('0x42')][_0x53c6('0x49')](_0x53c6('0x67'))){_0x40c702['limit']=qs[_0x53c6('0x2f')](_0x1f0ea4[_0x53c6('0x42')][_0x53c6('0x2f')]);_0x40c702[_0x53c6('0x2e')]=qs[_0x53c6('0x2e')](_0x1f0ea4[_0x53c6('0x42')]['offset']);}_0x40c702[_0x53c6('0x68')]=qs[_0x53c6('0x4a')](_0x1f0ea4[_0x53c6('0x42')][_0x53c6('0x4a')]);_0x40c702['where']=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x1f0ea4[_0x53c6('0x42')],_0x52e6ce[_0x53c6('0x44')]));_0x40c702[_0x53c6('0x4d')][_0x53c6('0x63')]=_0x2e78a0['id'];if(_0x1f0ea4['query']['filter']){_0x40c702[_0x53c6('0x4d')]=_[_0x53c6('0x50')](_0x40c702[_0x53c6('0x4d')],{'$or':_['map'](_0x40c702[_0x53c6('0x46')],function(_0x3be7ec){var _0x8189e4={};_0x8189e4[_0x3be7ec]={'$like':'%'+_0x1f0ea4[_0x53c6('0x42')]['filter']+'%'};return _0x8189e4;})});}_0x40c702=_[_0x53c6('0x50')]({},_0x40c702,_0x1f0ea4[_0x53c6('0x56')]);return db['Disposition'][_0x53c6('0x30')]({'where':_0x40c702[_0x53c6('0x4d')]})['then'](function(_0x556eeb){_0x4f0a42['count']=_0x556eeb;if(_0x1f0ea4[_0x53c6('0x42')][_0x53c6('0x55')]){_0x40c702[_0x53c6('0x69')]=[{'all':!![]}];}return db[_0x53c6('0x66')][_0x53c6('0x51')](_0x40c702);})[_0x53c6('0x20')](function(_0x26a320){_0x4f0a42['rows']=_0x26a320;return _0x4f0a42;});}})[_0x53c6('0x20')](respondWithFilteredResult(_0x3372a2,_0x40c702))['catch'](handleError(_0x3372a2,null));};exports[_0x53c6('0x6a')]=function(_0x388098,_0x5bf010,_0x2b259d){return db['SmsAccount'][_0x53c6('0x5c')]({'where':{'id':_0x388098[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x5bf010,null))['then'](function(_0x27bdc8){if(_0x27bdc8){return _0x27bdc8[_0x53c6('0x6a')](_0x388098[_0x53c6('0x42')][_0x53c6('0x6b')]);}})[_0x53c6('0x20')](respondWithStatusCode(_0x5bf010,null))[_0x53c6('0x2a')](handleError(_0x5bf010,null));};exports['addAnswer']=function(_0xf73d0c,_0x5da6af,_0x11629c){if(_0xf73d0c['body']['id']){delete _0xf73d0c['body']['id'];}return db[_0x53c6('0x3e')]['find']({'where':{'id':_0xf73d0c[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x5da6af,null))[_0x53c6('0x20')](function(_0x12b96a){if(_0x12b96a){_0xf73d0c[_0x53c6('0x58')]['SmsAccountId']=_0x12b96a['id'];return db[_0x53c6('0x6c')][_0x53c6('0x57')](_0xf73d0c[_0x53c6('0x58')]);}})[_0x53c6('0x20')](respondWithResult(_0x5da6af,null))['catch'](handleError(_0x5da6af,null));};exports[_0x53c6('0x6d')]=function(_0x2c12af,_0x158a4a,_0x53cb65){var _0x5a5837={'raw':![],'where':{}};var _0x29aa71={};var _0x1aaaa0={'count':0x0,'rows':[]};return db[_0x53c6('0x3e')][_0x53c6('0x65')]({'where':{'id':_0x2c12af[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x158a4a,null))[_0x53c6('0x20')](function(_0x25417c){if(_0x25417c){_0x29aa71['model']=_['keys'](db[_0x53c6('0x6c')][_0x53c6('0x3f')]);_0x29aa71[_0x53c6('0x42')]=_['keys'](_0x2c12af[_0x53c6('0x42')]);_0x29aa71[_0x53c6('0x44')]=_[_0x53c6('0x45')](_0x29aa71[_0x53c6('0x41')],_0x29aa71[_0x53c6('0x42')]);_0x5a5837[_0x53c6('0x46')]=_[_0x53c6('0x45')](_0x29aa71[_0x53c6('0x41')],qs[_0x53c6('0x47')](_0x2c12af[_0x53c6('0x42')]['fields']));_0x5a5837['attributes']=_0x5a5837[_0x53c6('0x46')][_0x53c6('0x48')]?_0x5a5837[_0x53c6('0x46')]:_0x29aa71[_0x53c6('0x41')];if(!_0x2c12af['query'][_0x53c6('0x49')]('nolimit')){_0x5a5837[_0x53c6('0x2f')]=qs[_0x53c6('0x2f')](_0x2c12af[_0x53c6('0x42')][_0x53c6('0x2f')]);_0x5a5837[_0x53c6('0x2e')]=qs[_0x53c6('0x2e')](_0x2c12af['query']['offset']);}_0x5a5837[_0x53c6('0x68')]=qs[_0x53c6('0x4a')](_0x2c12af[_0x53c6('0x42')][_0x53c6('0x4a')]);_0x5a5837[_0x53c6('0x4d')]=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x2c12af[_0x53c6('0x42')],_0x29aa71[_0x53c6('0x44')]));_0x5a5837[_0x53c6('0x4d')][_0x53c6('0x63')]=_0x25417c['id'];if(_0x2c12af[_0x53c6('0x42')]['filter']){_0x5a5837[_0x53c6('0x4d')]=_[_0x53c6('0x50')](_0x5a5837[_0x53c6('0x4d')],{'$or':_['map'](_0x5a5837[_0x53c6('0x46')],function(_0x3076a7){var _0x3ee029={};_0x3ee029[_0x3076a7]={'$like':'%'+_0x2c12af[_0x53c6('0x42')][_0x53c6('0x4c')]+'%'};return _0x3ee029;})});}_0x5a5837=_[_0x53c6('0x50')]({},_0x5a5837,_0x2c12af[_0x53c6('0x56')]);return db[_0x53c6('0x6c')][_0x53c6('0x30')]({'where':_0x5a5837[_0x53c6('0x4d')]})[_0x53c6('0x20')](function(_0x3e0827){_0x1aaaa0[_0x53c6('0x30')]=_0x3e0827;if(_0x2c12af[_0x53c6('0x42')][_0x53c6('0x55')]){_0x5a5837[_0x53c6('0x69')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5a5837);})[_0x53c6('0x20')](function(_0x459c6d){_0x1aaaa0[_0x53c6('0x52')]=_0x459c6d;return _0x1aaaa0;});}})[_0x53c6('0x20')](respondWithFilteredResult(_0x158a4a,_0x5a5837))['catch'](handleError(_0x158a4a,null));};exports['removeAnswers']=function(_0x584822,_0x20d1f6,_0x107179){return db[_0x53c6('0x3e')]['find']({'where':{'id':_0x584822[_0x53c6('0x60')]['id']}})['then'](handleEntityNotFound(_0x20d1f6,null))[_0x53c6('0x20')](function(_0x59da07){if(_0x59da07){return _0x59da07['removeAnswers'](_0x584822[_0x53c6('0x42')][_0x53c6('0x6b')]);}})[_0x53c6('0x20')](respondWithStatusCode(_0x20d1f6,null))[_0x53c6('0x2a')](handleError(_0x20d1f6,null));};exports[_0x53c6('0x6e')]=function(_0x56dc86,_0x42d0ab,_0x49546a){var _0xea7551={'channel':'sms'};var _0x4e1440=[];var _0x1035c0=[];var _0x32fe27={};return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0x56dc86[_0x53c6('0x60')]['id']},'include':[{'model':db[_0x53c6('0x6f')],'as':_0x53c6('0x70')}]})[_0x53c6('0x20')](handleEntityNotFound(_0x42d0ab,null))['then'](function(_0x1fe2e2){_0xea7551[_0x53c6('0x71')]=_0x1fe2e2;_0xea7551[_0x53c6('0x72')]=_[_0x53c6('0x73')](_0x1fe2e2[_0x53c6('0x70')],[_0x53c6('0x74')],['asc']);if(_0xea7551['account']['Applications']){delete _0xea7551[_0x53c6('0x71')][_0x53c6('0x70')];}return db['CmContact'][_0x53c6('0x61')]();})['then'](function(_0x36100d){if(!_0x36100d){throw new db['Sequelize']['ValidationError'](_0x53c6('0x75'));}_0x4e1440=_[_0x53c6('0x76')](_['keys'](_0x36100d),[_0x53c6('0x77'),_0x53c6('0x78')]);_0x1035c0=_[_0x53c6('0x76')](_[_0x53c6('0x43')](_0x36100d),[_0x53c6('0x77'),_0x53c6('0x78'),'CompanyId',_0x53c6('0x79')]);_0xea7551[_0x53c6('0x58')]={'mapKey':_0x53c6('0x7a')};if(_0xea7551[_0x53c6('0x71')]['type']){switch(_0xea7551[_0x53c6('0x71')][_0x53c6('0x4e')]){case'twilio':_0xea7551['body']['from']=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x7b')];_0xea7551[_0x53c6('0x58')][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x7c')];_0xea7551[_0x53c6('0x58')][_0x53c6('0x7d')]=_0x56dc86['body'][_0x53c6('0x7e')];break;case _0x53c6('0x7f'):_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]='+'+_0x56dc86['body']['sender'];_0xea7551['body'][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')]['text'];break;case _0x53c6('0x81'):_0xea7551['body'][_0x53c6('0x80')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x80')];_0xea7551[_0x53c6('0x58')]['body']=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x27')];break;case _0x53c6('0x82'):_0xea7551['body'][_0x53c6('0x80')]=_0x56dc86['body']['from'];_0xea7551['body']['body']=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x58')];_0xea7551[_0x53c6('0x58')][_0x53c6('0x7d')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x83')];break;case'plivo':_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x7b')];_0xea7551['body'][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')]['Text'];_0xea7551[_0x53c6('0x58')]['messageId']=_0x56dc86['body']['MessageUUID'];break;case _0x53c6('0x84'):_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]='+'+_0x56dc86['body']['results'][0x0][_0x53c6('0x80')];_0xea7551['body'][_0x53c6('0x58')]=_0x56dc86['body'][_0x53c6('0x85')][0x0]['text'];_0xea7551[_0x53c6('0x58')][_0x53c6('0x7d')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x85')][0x0][_0x53c6('0x7d')];break;case _0x53c6('0x86'):_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x87')];_0xea7551[_0x53c6('0x58')][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x88')]['message'];break;case _0x53c6('0x89'):_0xea7551[_0x53c6('0x58')]['from']=_0x56dc86[_0x53c6('0x58')][_0x53c6('0x8a')];_0xea7551['body'][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')]['text'];_0xea7551[_0x53c6('0x58')][_0x53c6('0x7d')]=_0x56dc86['body'][_0x53c6('0x8b')];break;case _0x53c6('0x8c'):_0xea7551[_0x53c6('0x58')]['messageId']=_0x56dc86[_0x53c6('0x58')][0x0][_0x53c6('0x27')]['id'];_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]=_0x56dc86[_0x53c6('0x58')][0x0][_0x53c6('0x27')][_0x53c6('0x80')];_0xea7551[_0x53c6('0x58')][_0x53c6('0x58')]=_0x56dc86[_0x53c6('0x58')][0x0][_0x53c6('0x27')]['text'];break;case _0x53c6('0x8d'):_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')]=_0x56dc86['body']['from'];_0xea7551[_0x53c6('0x58')]['body']=_0x56dc86['body']['message'];_0xea7551['body'][_0x53c6('0x7d')]=_0x56dc86[_0x53c6('0x58')]['refid'];break;}}if(_0xea7551['body']['id']){delete _0xea7551[_0x53c6('0x58')]['id'];}if(_[_0x53c6('0x8e')](_0xea7551[_0x53c6('0x58')]['from'])){throw new db[(_0x53c6('0x8f'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0xea7551['body'][_0x53c6('0x58')])||_0xea7551['body']['body']===''){throw new db[(_0x53c6('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x53c6('0x8e')](_0xea7551[_0x53c6('0x58')][_0x53c6('0x90')])){throw new db[(_0x53c6('0x8f'))][(_0x53c6('0x91'))](_0x53c6('0x92')+_0x1035c0);}if(!_['includes'](_0x1035c0,_0xea7551[_0x53c6('0x58')][_0x53c6('0x90')])){throw new db['Sequelize']['ValidationError'](_0x53c6('0x93')+_0x1035c0);}_0x32fe27[_0xea7551[_0x53c6('0x58')][_0x53c6('0x90')]]=_0xea7551[_0x53c6('0x58')]['from'];return db['CmList'][_0x53c6('0x5c')]({'where':{'id':_0xea7551[_0x53c6('0x71')]['ListId']},'include':[{'model':db[_0x53c6('0x94')],'as':'Contacts','where':_0x32fe27,'limit':0x1,'order':[['updatedAt',_0x53c6('0x95')]]}]});})[_0x53c6('0x20')](handleEntityNotFound(_0x42d0ab,null))[_0x53c6('0x20')](function(_0xaf91c2){if(_0xaf91c2){_0xea7551['list']=_[_0x53c6('0x96')](_0xaf91c2,[_0x53c6('0x97')]);if(_0xaf91c2[_0x53c6('0x97')][_0x53c6('0x48')]){return _0xaf91c2[_0x53c6('0x97')][0x0];}var _0x58a6bf=_[_0x53c6('0x18')](_0xea7551[_0x53c6('0x58')],{'firstName':_0xea7551['body'][_0x53c6('0x80')],'ListId':_0xaf91c2['id']});_0x58a6bf[_0xea7551[_0x53c6('0x58')][_0x53c6('0x90')]]=_0xea7551['body'][_0x53c6('0x80')];return db['CmContact']['create'](_0x58a6bf,{'fields':_0x4e1440,'raw':!![]});}})['then'](handleEntityNotFound(_0x42d0ab,null))['then'](function(_0x5e01e4){if(_0x5e01e4){_0xea7551['contact']=_0x5e01e4;var _0x80bfb0={'ContactId':_0x5e01e4['id'],'phone':_0xea7551[_0x53c6('0x58')][_0x53c6('0x80')],'SmsAccountId':_0x56dc86[_0x53c6('0x60')]['id']};var _0x1e8f6a={'ContactId':_0x5e01e4['id'],'SmsAccountId':_0x56dc86[_0x53c6('0x60')]['id'],'closed':![]};return db[_0x53c6('0x98')][_0x53c6('0x5c')]({'where':_0x1e8f6a})[_0x53c6('0x20')](function(_0x924da8){if(_0x924da8){return[_0x924da8,![]];}return db[_0x53c6('0x98')][_0x53c6('0x57')](_0x80bfb0)[_0x53c6('0x20')](function(_0x3cc7e9){return[_0x3cc7e9,!![]];});});}})['spread'](function(_0x504f2e,_0x4bd039){_0xea7551[_0x53c6('0x99')]=_0x504f2e[_0x53c6('0x36')]({'plain':!![]});_0xea7551[_0x53c6('0x99')][_0x53c6('0x9a')]=![];if(_0x4bd039){if(_0xea7551[_0x53c6('0x71')][_0x53c6('0x9b')]){_0xea7551[_0x53c6('0x72')][_0x53c6('0x9c')]({'id':0x0,'priority':_0xea7551[_0x53c6('0x72')]['length']+0x1,'app':_0x53c6('0x9d'),'appdata':_0x53c6('0x9e'),'interval':'*,*,*,*'});}_0xea7551[_0x53c6('0x99')][_0x53c6('0x9a')]=!![];}return db[_0x53c6('0x9f')][_0x53c6('0x57')]({'phone':_0xea7551['body']['from'],'messageId':_0xea7551[_0x53c6('0x58')][_0x53c6('0x7d')],'body':_0xea7551['body']['body'],'SmsAccountId':_0x56dc86[_0x53c6('0x60')]['id'],'SmsInteractionId':_0x504f2e['id'],'direction':'in','ContactId':_0x504f2e[_0x53c6('0xa0')],'AttachmentId':_0xea7551[_0x53c6('0x58')][_0x53c6('0xa1')]});})['then'](function(_0x35e6b9){_0xea7551[_0x53c6('0x27')]=_0x35e6b9;if(_0xea7551[_0x53c6('0x99')][_0x53c6('0xa2')]){return db[_0x53c6('0xa3')]['find']({'attributes':['id','name'],'where':{'id':_0xea7551['interaction'][_0x53c6('0xa2')]}})[_0x53c6('0x20')](function(_0x265350){if(_0x265350){_0xea7551[_0x53c6('0x72')][_0x53c6('0xa4')]({'id':0x0,'priority':0x0,'app':_0x53c6('0xa5'),'appdata':_0x265350[_0x53c6('0x3b')]+','+(_0xea7551[_0x53c6('0x71')][_0x53c6('0xa6')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x53c6('0xa7'),'startRouting',_0xea7551);});}return respondWithRpcPromise(_0x53c6('0xa7'),_0x53c6('0xa8'),_0xea7551);})[_0x53c6('0x20')](function(_0x48cfb7){if(_0x48cfb7){var _0x29b419=0xc8;var _0x570c59=_0x53c6('0xa9');logger[_0x53c6('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x570c59,_0x29b419,_0x53c6('0xaa'));logger[_0x53c6('0xab')](_0x53c6('0xac'),_0x570c59,_0x29b419,_0x53c6('0xaa'),JSON[_0x53c6('0x23')](_0x48cfb7));if(_0xea7551[_0x53c6('0x71')]['type']===_0x53c6('0xad')){return _0x42d0ab[_0x53c6('0x2c')](_0x29b419)[_0x53c6('0x31')]('Content-Type',_0x53c6('0xae'))['send'](_0x53c6('0xaf'));}else{return _0x42d0ab['status'](_0x29b419)['json'](_0x48cfb7);}}})[_0x53c6('0x2a')](handleError(_0x42d0ab,null));};exports[_0x53c6('0xb0')]=function(_0x14ce50,_0x152207){var _0x31d150=_0x14ce50[_0x53c6('0x60')]['id'];var _0x26c458=_0x14ce50['body'];var _0x2870a8=0xc8;var _0x18048d=null;return db[_0x53c6('0xb1')]['transaction']({'isolationLevel':db[_0x53c6('0xb1')]['Transaction'][_0x53c6('0xb2')][_0x53c6('0xb3')]},function(_0x33cf0c){return db['SmsAccount'][_0x53c6('0x65')]({'where':{'id':_0x31d150},'transaction':_0x33cf0c})[_0x53c6('0x20')](function(_0x241447){if(_0x241447){return db[_0x53c6('0x6f')][_0x53c6('0x35')]({'where':{'SmsAccountId':_0x31d150},'transaction':_0x33cf0c})[_0x53c6('0x20')](function(){var _0x2ddd85=_[_0x53c6('0x3d')](_0x26c458,function(_0x5253de){_0x5253de[_0x53c6('0x63')]=_0x31d150;return _0x5253de;});return db['SmsApplication'][_0x53c6('0xb4')](_0x2ddd85,{'transaction':_0x33cf0c});});}else{_0x2870a8=0x194;_0x18048d=[];}});})[_0x53c6('0x20')](function(){if(_0x2870a8!==0x194){return db['SmsApplication'][_0x53c6('0xb5')]({'where':{'SmsAccountId':_0x31d150},'order':_0x53c6('0x74')})[_0x53c6('0x20')](function(_0x336272){_0x18048d=_0x336272;});}})['catch'](function(_0x1ec49d){_0x2870a8=0x1f4;logger[_0x53c6('0x24')](_0x1ec49d[_0x53c6('0x3a')]);if(_0x1ec49d['name']){delete _0x1ec49d['name'];}_0x18048d=_0x1ec49d;})['finally'](function(){if(_0x18048d===null){_0x152207['sendStatus'](_0x2870a8);}else{if(_0x2870a8===0x1f4){_0x152207['status'](_0x2870a8)['send'](_0x18048d);}else{_0x152207['status'](_0x2870a8)[_0x53c6('0x2d')](_0x18048d);}}});};exports[_0x53c6('0xb6')]=function(_0x17fbbe,_0x1b591c,_0x4d3796){var _0x4fb3e3={};var _0x322e85={};var _0x277af9;var _0xbe59ab;return db[_0x53c6('0x3e')][_0x53c6('0x65')]({'where':{'id':_0x17fbbe['params']['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x1b591c,null))[_0x53c6('0x20')](function(_0x52ee8b){if(_0x52ee8b){_0x277af9=_0x52ee8b;_0x322e85[_0x53c6('0x41')]=_[_0x53c6('0x43')](db[_0x53c6('0x6f')][_0x53c6('0x3f')]);_0x322e85[_0x53c6('0x42')]=_['keys'](_0x17fbbe['query']);_0x322e85['filters']=_[_0x53c6('0x45')](_0x322e85[_0x53c6('0x41')],_0x322e85['query']);_0x4fb3e3['attributes']=_[_0x53c6('0x45')](_0x322e85[_0x53c6('0x41')],qs[_0x53c6('0x47')](_0x17fbbe[_0x53c6('0x42')][_0x53c6('0x47')]));_0x4fb3e3['attributes']=_0x4fb3e3['attributes'][_0x53c6('0x48')]?_0x4fb3e3[_0x53c6('0x46')]:_0x322e85[_0x53c6('0x41')];_0x4fb3e3['order']=qs[_0x53c6('0x4a')](_0x17fbbe[_0x53c6('0x42')][_0x53c6('0x4a')]);_0x4fb3e3[_0x53c6('0x4d')]=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x17fbbe[_0x53c6('0x42')],_0x322e85['filters']));if(_0x17fbbe[_0x53c6('0x42')]['filter']){_0x4fb3e3[_0x53c6('0x4d')]=_[_0x53c6('0x50')](_0x4fb3e3[_0x53c6('0x4d')],{'$or':_[_0x53c6('0x3d')](_0x4fb3e3['attributes'],function(_0x58ef52){var _0x1c27f2={};_0x1c27f2[_0x58ef52]={'$like':'%'+_0x17fbbe[_0x53c6('0x42')]['filter']+'%'};return _0x1c27f2;})});}_0x4fb3e3=_['merge']({},_0x4fb3e3,_0x17fbbe[_0x53c6('0x56')]);return _0x277af9[_0x53c6('0xb6')](_0x4fb3e3);}})[_0x53c6('0x20')](function(_0x3b2ce0){if(_0x3b2ce0){_0xbe59ab=_0x3b2ce0[_0x53c6('0x48')];if(!_0x17fbbe[_0x53c6('0x42')][_0x53c6('0x49')]('nolimit')){_0x4fb3e3['limit']=qs[_0x53c6('0x2f')](_0x17fbbe[_0x53c6('0x42')][_0x53c6('0x2f')]);_0x4fb3e3[_0x53c6('0x2e')]=qs[_0x53c6('0x2e')](_0x17fbbe[_0x53c6('0x42')][_0x53c6('0x2e')]);}return _0x277af9[_0x53c6('0xb6')](_0x4fb3e3);}})['then'](function(_0x4e0b74){if(_0x4e0b74){return _0x4e0b74?{'count':_0xbe59ab,'rows':_0x4e0b74}:null;}})[_0x53c6('0x20')](respondWithResult(_0x1b591c,null))[_0x53c6('0x2a')](handleError(_0x1b591c,null));};exports[_0x53c6('0xb7')]=function(_0x16376c,_0x178ac8,_0x1988d6){var _0x1191de={'raw':![],'where':{}};var _0x558439={};var _0x32ce2b={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x16376c[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x178ac8,null))[_0x53c6('0x20')](function(_0x51f1a2){if(_0x51f1a2){_0x558439[_0x53c6('0x41')]=_[_0x53c6('0x43')](db[_0x53c6('0x98')][_0x53c6('0x3f')]);_0x558439[_0x53c6('0x42')]=_['keys'](_0x16376c[_0x53c6('0x42')]);_0x558439[_0x53c6('0x44')]=_[_0x53c6('0x45')](_0x558439[_0x53c6('0x41')],_0x558439['query']);_0x1191de['attributes']=_[_0x53c6('0x45')](_0x558439[_0x53c6('0x41')],qs['fields'](_0x16376c['query']['fields']));_0x1191de['attributes']=_0x1191de[_0x53c6('0x46')][_0x53c6('0x48')]?_0x1191de[_0x53c6('0x46')]:_0x558439[_0x53c6('0x41')];if(!_0x16376c[_0x53c6('0x42')][_0x53c6('0x49')](_0x53c6('0x67'))){_0x1191de['limit']=qs[_0x53c6('0x2f')](_0x16376c[_0x53c6('0x42')][_0x53c6('0x2f')]);_0x1191de[_0x53c6('0x2e')]=qs['offset'](_0x16376c[_0x53c6('0x42')][_0x53c6('0x2e')]);}_0x1191de[_0x53c6('0x68')]=qs[_0x53c6('0x4a')](_0x16376c[_0x53c6('0x42')][_0x53c6('0x4a')]);_0x1191de[_0x53c6('0x4d')]=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x16376c[_0x53c6('0x42')],_0x558439['filters']));_0x1191de['where'][_0x53c6('0x63')]=_0x51f1a2['id'];if(_0x16376c[_0x53c6('0x42')]['filter']){_0x1191de[_0x53c6('0x4d')]=_[_0x53c6('0x50')](_0x1191de[_0x53c6('0x4d')],{'$or':_['map'](_0x1191de[_0x53c6('0x46')],function(_0x177e69){var _0x11d012={};_0x11d012[_0x177e69]={'$like':'%'+_0x16376c['query']['filter']+'%'};return _0x11d012;})});}_0x1191de=_[_0x53c6('0x50')]({},_0x1191de,_0x16376c[_0x53c6('0x56')]);return db[_0x53c6('0x98')][_0x53c6('0x30')]({'where':_0x1191de[_0x53c6('0x4d')]})[_0x53c6('0x20')](function(_0x52e1f0){_0x32ce2b[_0x53c6('0x30')]=_0x52e1f0;if(_0x16376c[_0x53c6('0x42')][_0x53c6('0x55')]){_0x1191de[_0x53c6('0x69')]=[{'model':db[_0x53c6('0x94')],'as':_0x53c6('0xb8'),'required':![]},{'model':db[_0x53c6('0xa3')],'as':_0x53c6('0xb9'),'attributes':[_0x53c6('0x3b'),_0x53c6('0xba'),_0x53c6('0xbb')],'required':![]},{'model':db['Tag'],'as':_0x53c6('0xbc'),'attributes':['id',_0x53c6('0x3b'),'color'],'where':_0x16376c[_0x53c6('0x42')]['tag']?{'id':_0x16376c[_0x53c6('0x42')][_0x53c6('0xbd')]}:undefined,'required':_0x16376c[_0x53c6('0x42')]['tag']?!![]:![]}];}return db[_0x53c6('0x98')][_0x53c6('0x51')](_0x1191de);})[_0x53c6('0x20')](function(_0xc853bb){_0x32ce2b[_0x53c6('0x52')]=_0xc853bb;return _0x32ce2b;});}})[_0x53c6('0x20')](respondWithFilteredResult(_0x178ac8,_0x1191de))[_0x53c6('0x2a')](handleError(_0x178ac8,null));};exports['send']=function(_0x245995,_0x1fe62f,_0x5ac8a4){var _0x18dd3b,_0xd0774b,_0x5312f6;if(_['isNil'](_0x245995[_0x53c6('0x58')][_0x53c6('0x58')])||_0x245995[_0x53c6('0x58')]['body']===''){throw new db[(_0x53c6('0x8f'))][(_0x53c6('0x91'))](_0x53c6('0xbe'));}if(_[_0x53c6('0x8e')](_0x245995[_0x53c6('0x58')]['to'])){throw new db['Sequelize'][(_0x53c6('0x91'))](_0x53c6('0xbf'));}_0x18dd3b=_0x245995['body']['to'];return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0x245995[_0x53c6('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x53c6('0xc0'),'include':[{'model':db[_0x53c6('0x94')],'as':_0x53c6('0x97'),'where':{'mobile':_0x18dd3b},'limit':0x1,'order':[[_0x53c6('0x78'),_0x53c6('0x95')]]}]}]})[_0x53c6('0x20')](handleEntityNotFound(_0x1fe62f,null))[_0x53c6('0x20')](function(_0x2d94d8){if(_0x2d94d8&&_0x2d94d8['List']){_0xd0774b=_0x2d94d8[_0x53c6('0x36')]({'plain':!![]});if(_0xd0774b[_0x53c6('0xc0')]&&_0xd0774b[_0x53c6('0xc0')][_0x53c6('0x97')][_0x53c6('0x48')]){return _0xd0774b[_0x53c6('0xc0')][_0x53c6('0x97')][0x0];}return db[_0x53c6('0x94')][_0x53c6('0x57')](_[_0x53c6('0x18')](_0x245995[_0x53c6('0x58')],{'firstName':_0x18dd3b,'mobile':_0x18dd3b,'phone':_0x18dd3b,'ListId':_0xd0774b[_0x53c6('0x79')]}));}})[_0x53c6('0x20')](handleEntityNotFound(_0x1fe62f,null))['then'](function(_0xe29c11){if(_0xe29c11){_0x5312f6=_0xe29c11;return db[_0x53c6('0x98')]['find']({'where':{'ContactId':_0x5312f6['id'],'closed':![],'SmsAccountId':_0xd0774b['id']}})['then'](function(_0x43eb48){if(_0x43eb48){return[_0x43eb48,![]];}return db['SmsInteraction']['create']({'UserId':_0x245995[_0x53c6('0x59')]['id'],'ContactId':_0x5312f6['id'],'SmsAccountId':_0xd0774b['id'],'phone':_0x18dd3b,'firstMsgDirection':_0x53c6('0xc1'),'Messages':[_[_0x53c6('0x50')](_0x245995[_0x53c6('0x58')],{'read':![],'body':_0x245995[_0x53c6('0x58')][_0x53c6('0x58')],'phone':_0x18dd3b,'SmsAccountId':_0xd0774b['id'],'UserId':_0x245995[_0x53c6('0x59')]['id'],'ContactId':_0x5312f6['id']})]},{'include':[{'model':db[_0x53c6('0x9f')],'as':_0x53c6('0xc2')}]})[_0x53c6('0x20')](function(_0x2ebd04){return[_0x2ebd04,!![]];});});}})[_0x53c6('0xc3')](function(_0x3bf508,_0x4c3d20){if(_0x4c3d20){return _0x3bf508;}return db[_0x53c6('0x9f')][_0x53c6('0x57')](_['merge'](_0x245995[_0x53c6('0x58')],{'read':![],'body':_0x245995[_0x53c6('0x58')][_0x53c6('0x58')],'phone':_0x18dd3b,'SmsAccountId':_0xd0774b['id'],'SmsInteractionId':_0x3bf508['id'],'UserId':_0x245995[_0x53c6('0x59')]['id'],'ContactId':_0x5312f6['id']}))[_0x53c6('0x20')](function(_0x524e44){_0x3bf508[_0x53c6('0xc4')]['Messages']=[];_0x3bf508[_0x53c6('0xc4')][_0x53c6('0xc2')][_0x53c6('0x9c')](_0x524e44['dataValues']);return _0x3bf508;});})['then'](respondWithResult(_0x1fe62f,null))[_0x53c6('0x2a')](handleError(_0x1fe62f,null));};exports[_0x53c6('0x2c')]=function(_0xed8f5e,_0x2d2126,_0x513a41){if(_0xed8f5e[_0x53c6('0x58')]['id']){delete _0xed8f5e['body']['id'];}var _0x5c4320,_0x4ff6bf,_0x412e01;return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0xed8f5e[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x2d2126,null))[_0x53c6('0x20')](function(_0x9e2ace){if(_0x9e2ace){_0x412e01=_0x9e2ace;logger[_0x53c6('0xab')](_0x53c6('0x22'),_0x53c6('0x2c'),_0x53c6('0xc5'),_0x9e2ace['type'],util[_0x53c6('0xc6')](_0xed8f5e['body'],{'showHidden':![],'depth':null}));switch(_0x9e2ace['type']){case'skebby':if(_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xc7')]&&_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x2c')]){_0x4ff6bf=_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x2c')];return db['SmsMessage']['find']({'where':{'messageId':_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xc7')]}});}break;case _0x53c6('0x81'):if(_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xc8')]&&_0xed8f5e['body']['statusInt']){_0x4ff6bf=_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xc9')];return db[_0x53c6('0x9f')][_0x53c6('0x5c')]({'where':{'messageId':_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xc8')]}});}break;case _0x53c6('0x82'):if(_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x83')]&&_0xed8f5e['body']['status_code']){_0x4ff6bf=_0xed8f5e['body'][_0x53c6('0xca')];return db['SmsMessage'][_0x53c6('0x5c')]({'where':{'messageId':_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x83')]}});}break;case _0x53c6('0x84'):var _0x2a2551=_0xed8f5e[_0x53c6('0x58')]['results'][0x0];if(_0x2a2551[_0x53c6('0x7d')]&&_0x2a2551[_0x53c6('0x2c')][_0x53c6('0xcb')]===_0x53c6('0xcc')){_0x4ff6bf=_0x2a2551[_0x53c6('0x2c')][_0x53c6('0xcb')];return db[_0x53c6('0x9f')][_0x53c6('0x5c')]({'where':{'messageId':_0x2a2551['messageId']}});}break;case _0x53c6('0x89'):if(_0xed8f5e['body'][_0x53c6('0x7d')]&&_0xed8f5e['body'][_0x53c6('0x2c')]){_0x4ff6bf=_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x2c')];return db[_0x53c6('0x9f')][_0x53c6('0x5c')]({'where':{'messageId':_0xed8f5e['body']['messageId']}});}break;case _0x53c6('0x8c'):if(_0xed8f5e[_0x53c6('0x58')][0x0][_0x53c6('0x27')]['id']){_0x4ff6bf=_0xed8f5e[_0x53c6('0x58')][0x0][_0x53c6('0x4e')];return db[_0x53c6('0x9f')][_0x53c6('0x5c')]({'where':{'messageId':_0xed8f5e[_0x53c6('0x58')][0x0][_0x53c6('0x27')]['id']}});}break;case _0x53c6('0x8d'):if(_0xed8f5e[_0x53c6('0x58')]['redif']&&_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x2c')]){_0x4ff6bf=_0xed8f5e['body'][_0x53c6('0x2c')];return db['SmsMessage']['find']({'where':{'messageId':_0xed8f5e[_0x53c6('0x58')]['redif']}});}break;}}})[_0x53c6('0x20')](handleEntityNotFound(_0x2d2126,null))['then'](function(_0x39f49a){if(_0x39f49a){_0x5c4320=_0x39f49a;switch(_0x412e01[_0x53c6('0x4e')]){case _0x53c6('0x7f'):if(_0x4ff6bf==='DELIVERED'){return _0x5c4320[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')](_0x53c6('0x22'),'status',_0x53c6('0x7f'),util[_0x53c6('0xc6')](_0xed8f5e[_0x53c6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x53c6('0x81'):if(_0x4ff6bf==='1'){return _0x5c4320[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c6('0x2c'),_0x53c6('0x7f'),util[_0x53c6('0xc6')](_0xed8f5e['body'],{'showHidden':![],'depth':null}));}break;case _0x53c6('0x82'):if(!_0xed8f5e[_0x53c6('0x58')][_0x53c6('0xce')]&&_0x4ff6bf>=0xc8&&_0x4ff6bf<=0xce){return _0x5c4320[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c6('0x2c'),_0x53c6('0x82'),util[_0x53c6('0xc6')](_0xed8f5e[_0x53c6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x53c6('0x84'):var _0x1748a0=_0xed8f5e[_0x53c6('0x58')][_0x53c6('0x85')][0x0];if(_0x1748a0[_0x53c6('0x2c')]['groupName']==='DELIVERED'){return _0x5c4320['update']({'read':!![]});}else{logger['error'](_0x53c6('0x22'),_0x53c6('0x2c'),'infobip',util['inspect'](_0xed8f5e['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4ff6bf==_0x53c6('0xcf')||_0x4ff6bf=='RECEIVED_BY_RECIPIENT'){return _0x5c4320['update']({'read':!![]});}else{logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c6('0x2c'),_0x53c6('0x89'),util['inspect'](_0xed8f5e[_0x53c6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x53c6('0x8c'):if(_0x4ff6bf==_0x53c6('0xd0')){return _0x5c4320[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')](_0x53c6('0x22'),_0x53c6('0x2c'),_0x53c6('0x8c'),util[_0x53c6('0xc6')](_0xed8f5e[_0x53c6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x53c6('0x8d'):if(_0x4ff6bf==='DELIVRD'||_0x4ff6bf===_0x53c6('0xd1')){return _0x5c4320[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c6('0x2c'),'intelepeer',util[_0x53c6('0xc6')](_0xed8f5e[_0x53c6('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x5c4320;}})[_0x53c6('0x20')](respondWithResult(_0x2d2126,null))[_0x53c6('0x2a')](handleError(_0x2d2126,null));};exports['statusGet']=function(_0x21d33e,_0x3fe949,_0x1129a3){var _0x500d5e,_0x384db9,_0x392c31;return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0x21d33e['params']['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x3fe949,null))[_0x53c6('0x20')](function(_0xd16253){if(_0xd16253){_0x392c31=_0xd16253;logger[_0x53c6('0xab')](_0x53c6('0x22'),_0x53c6('0x2c'),_0x53c6('0xc5'),_0xd16253[_0x53c6('0x4e')],util[_0x53c6('0xc6')](_0x21d33e['query'],{'showHidden':![],'depth':null}));switch(_0xd16253['type']){case _0x53c6('0x86'):if(_0x21d33e[_0x53c6('0x42')]['message-id']&&_0x21d33e['query']['state']){_0x384db9=_0x21d33e[_0x53c6('0x42')]['state'];return db[_0x53c6('0x9f')]['find']({'where':{'messageId':_0x21d33e[_0x53c6('0x42')]['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x3fe949,null))['then'](function(_0x1d9dd0){if(_0x1d9dd0){_0x500d5e=_0x1d9dd0;switch(_0x392c31[_0x53c6('0x4e')]){case'csc':if(_0x384db9==='2'||_0x384db9==='6'){return _0x500d5e[_0x53c6('0xcd')]({'read':!![]});}else{logger[_0x53c6('0x24')](_0x53c6('0x22'),'status',_0x53c6('0x86'),util[_0x53c6('0xc6')](_0x21d33e['query'],{'showHidden':![],'depth':null}));};break;}return _0x500d5e;}})[_0x53c6('0x20')](respondWithResult(_0x3fe949,null))['catch'](handleError(_0x3fe949,null));};exports[_0x53c6('0xd2')]=function(_0x188d58,_0x5e1689,_0x527a0c){return db['SmsAccount'][_0x53c6('0x5c')]({'where':{'id':_0x188d58['params']['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x5e1689,null))['then'](function(_0x5b6b8b){if(_0x5b6b8b){return _0x5b6b8b[_0x53c6('0xd2')](_0x188d58[_0x53c6('0x58')][_0x53c6('0x6b')],_[_0x53c6('0x96')](_0x188d58[_0x53c6('0x58')],[_0x53c6('0x6b'),'id'])||{})[_0x53c6('0xc3')](function(_0xf7656f){for(var _0x41c88f=0x0;_0x41c88f<_0x188d58[_0x53c6('0x58')][_0x53c6('0x6b')][_0x53c6('0x48')];_0x41c88f+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x188d58['body'][_0x53c6('0x6b')][_0x41c88f]),'SmsAccountId':Number(_0x188d58['params']['id'])});}return _0xf7656f;});}})[_0x53c6('0x20')](respondWithResult(_0x5e1689,null))[_0x53c6('0x2a')](handleError(_0x5e1689,null));};exports[_0x53c6('0xd3')]=function(_0x2ce675,_0x6fb1ce,_0x3b1771){return db[_0x53c6('0x3e')][_0x53c6('0x5c')]({'where':{'id':_0x2ce675[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x6fb1ce,null))[_0x53c6('0x20')](function(_0x4aa265){if(_0x4aa265){return _0x4aa265[_0x53c6('0xd3')](_0x2ce675[_0x53c6('0x42')][_0x53c6('0x6b')])[_0x53c6('0x20')](function(){if(_['isArray'](_0x2ce675[_0x53c6('0x42')][_0x53c6('0x6b')])){for(var _0x179d46=0x0;_0x179d46<_0x2ce675[_0x53c6('0x42')]['ids'][_0x53c6('0x48')];_0x179d46+=0x1){socket['emit'](_0x53c6('0xd4'),{'UserId':Number(_0x2ce675[_0x53c6('0x42')]['ids'][_0x179d46]),'SmsAccountId':Number(_0x2ce675[_0x53c6('0x60')]['id'])});}}else{socket[_0x53c6('0xd5')](_0x53c6('0xd4'),{'UserId':Number(_0x2ce675[_0x53c6('0x42')][_0x53c6('0x6b')]),'SmsAccountId':Number(_0x2ce675[_0x53c6('0x60')]['id'])});}});}})[_0x53c6('0x20')](respondWithStatusCode(_0x6fb1ce,null))['catch'](handleError(_0x6fb1ce,null));};exports[_0x53c6('0xd6')]=function(_0x38ae81,_0x545411,_0x2d0578){var _0x3a052d={};var _0x18cf18={};var _0x361d17;var _0x5c03c1;return db['SmsAccount'][_0x53c6('0x65')]({'where':{'id':_0x38ae81[_0x53c6('0x60')]['id']}})[_0x53c6('0x20')](handleEntityNotFound(_0x545411,null))[_0x53c6('0x20')](function(_0x2d744e){if(_0x2d744e){_0x361d17=_0x2d744e;_0x18cf18[_0x53c6('0x41')]=_[_0x53c6('0x43')](db[_0x53c6('0xa3')]['rawAttributes']);_0x18cf18['query']=_['keys'](_0x38ae81[_0x53c6('0x42')]);_0x18cf18[_0x53c6('0x44')]=_[_0x53c6('0x45')](_0x18cf18[_0x53c6('0x41')],_0x18cf18['query']);_0x3a052d['attributes']=_[_0x53c6('0x45')](_0x18cf18[_0x53c6('0x41')],qs['fields'](_0x38ae81[_0x53c6('0x42')]['fields']));_0x3a052d[_0x53c6('0x46')]=_0x3a052d[_0x53c6('0x46')]['length']?_0x3a052d['attributes']:_0x18cf18[_0x53c6('0x41')];_0x3a052d['order']=qs[_0x53c6('0x4a')](_0x38ae81[_0x53c6('0x42')]['sort']);_0x3a052d['where']=qs[_0x53c6('0x44')](_[_0x53c6('0x4b')](_0x38ae81['query'],_0x18cf18[_0x53c6('0x44')]));if(_0x38ae81[_0x53c6('0x42')][_0x53c6('0x4c')]){_0x3a052d[_0x53c6('0x4d')]=_['merge'](_0x3a052d[_0x53c6('0x4d')],{'$or':_[_0x53c6('0x3d')](_0x3a052d[_0x53c6('0x46')],function(_0x5bc90b){var _0x2b649d={};_0x2b649d[_0x5bc90b]={'$like':'%'+_0x38ae81[_0x53c6('0x42')][_0x53c6('0x4c')]+'%'};return _0x2b649d;})});}_0x3a052d=_[_0x53c6('0x50')]({},_0x3a052d,_0x38ae81[_0x53c6('0x56')]);return _0x361d17[_0x53c6('0xd6')](_0x3a052d);}})['then'](function(_0x42b814){if(_0x42b814){_0x5c03c1=_0x42b814[_0x53c6('0x48')];if(!_0x38ae81[_0x53c6('0x42')][_0x53c6('0x49')](_0x53c6('0x67'))){_0x3a052d[_0x53c6('0x2f')]=qs[_0x53c6('0x2f')](_0x38ae81[_0x53c6('0x42')][_0x53c6('0x2f')]);_0x3a052d['offset']=qs['offset'](_0x38ae81[_0x53c6('0x42')][_0x53c6('0x2e')]);}return _0x361d17['getAgents'](_0x3a052d);}})[_0x53c6('0x20')](function(_0x44ab05){if(_0x44ab05){return _0x44ab05?{'count':_0x5c03c1,'rows':_0x44ab05}:null;}})['then'](respondWithResult(_0x545411,null))['catch'](handleError(_0x545411,null));}; \ No newline at end of file +var _0x38fb=['infobip','groupName','DELIVERED','bandwidth','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','csc','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','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','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','sort','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','notify','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','sender','text','message_id','plivo','Text','results','originatingAddress','segmentedMessage','clickatell','intelepeer','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','findAndCountAll','stack','finally','getApplications','rawAttributes','Contact','Owner','internal','Tag','tag','to\x20is\x20mandatory','List','user','out','dataValues','Messages','push','skebby','skebby_dispatch_id','connectel','requestid','statusInt','clicksend','status_code'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0x38fb,0xf5));var _0xb38f=function(_0x4bbe00,_0x1d2f14){_0x4bbe00=_0x4bbe00-0x0;var _0x3999d2=_0x38fb[_0x4bbe00];return _0x3999d2;};'use strict';var emlformat=require(_0xb38f('0x0'));var rimraf=require(_0xb38f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb38f('0x2'));var moment=require(_0xb38f('0x3'));var BPromise=require(_0xb38f('0x4'));var Mustache=require(_0xb38f('0x5'));var util=require('util');var path=require(_0xb38f('0x6'));var sox=require(_0xb38f('0x7'));var csv=require(_0xb38f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb38f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb38f('0xa'));var jsforce=require(_0xb38f('0xb'));var deskjs=require(_0xb38f('0xc'));var toCsv=require(_0xb38f('0x8'));var querystring=require('querystring');var Papa=require(_0xb38f('0xd'));var Redis=require(_0xb38f('0xe'));var authService=require(_0xb38f('0xf'));var qs=require(_0xb38f('0x10'));var as=require(_0xb38f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb38f('0x12'))(_0xb38f('0x13'));var utils=require(_0xb38f('0x14'));var config=require(_0xb38f('0x15'));var licenseUtil=require(_0xb38f('0x16'));var db=require(_0xb38f('0x17'))['db'];config[_0xb38f('0x18')]=_[_0xb38f('0x19')](config[_0xb38f('0x18')],{'host':_0xb38f('0x1a'),'port':0x18eb});var socket=require(_0xb38f('0x1b'))(new Redis(config['redis']));require(_0xb38f('0x1c'))[_0xb38f('0x1d')](socket);var jayson=require(_0xb38f('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2dde73,_0x2352fc,_0x242c02,_0x55315b){return new BPromise(function(_0x1e2e5d,_0x359dc0){var _0x5e22a0=_0x55315b||client;return _0x5e22a0[_0xb38f('0x1f')](_0x2dde73,_0x242c02)[_0xb38f('0x20')](function(_0x54ae05){logger[_0xb38f('0x21')](_0xb38f('0x22'),_0x2352fc,'request\x20sent');logger[_0xb38f('0x23')](_0xb38f('0x24'),_0x2352fc,'request\x20sent',JSON[_0xb38f('0x25')](_0x54ae05));if(_0x54ae05[_0xb38f('0x26')]){if(_0x54ae05[_0xb38f('0x26')][_0xb38f('0x27')]===0x1f4){logger[_0xb38f('0x26')](_0xb38f('0x22'),_0x2352fc,_0x54ae05[_0xb38f('0x26')][_0xb38f('0x28')]);return _0x359dc0(_0x54ae05[_0xb38f('0x26')]['message']);}logger[_0xb38f('0x26')](_0xb38f('0x22'),_0x2352fc,_0x54ae05['error'][_0xb38f('0x28')]);return _0x1e2e5d(_0x54ae05['error'][_0xb38f('0x28')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x2352fc,_0xb38f('0x29'));_0x1e2e5d(_0x54ae05['result'][_0xb38f('0x28')]);}})[_0xb38f('0x2a')](function(_0x4b1e4a){logger[_0xb38f('0x26')](_0xb38f('0x22'),_0x2352fc,_0x4b1e4a);_0x359dc0(_0x4b1e4a);});});}function respondWithStatusCode(_0x58fb62,_0x143ca0){_0x143ca0=_0x143ca0||0xcc;return function(_0x41947b){if(_0x41947b){return _0x58fb62[_0xb38f('0x2b')](_0x143ca0);}return _0x58fb62[_0xb38f('0x2c')](_0x143ca0)[_0xb38f('0x2d')]();};}function respondWithResult(_0x2627a4,_0x8b8098){_0x8b8098=_0x8b8098||0xc8;return function(_0x1871c8){if(_0x1871c8){return _0x2627a4['status'](_0x8b8098)['json'](_0x1871c8);}};}function respondWithFilteredResult(_0x44268d,_0x1410e9){return function(_0x23789a){if(_0x23789a){var _0x5b13ed=typeof _0x1410e9['offset']===_0xb38f('0x2e')&&typeof _0x1410e9['limit']===_0xb38f('0x2e');var _0x3b03cb=_0x23789a[_0xb38f('0x2f')];var _0x4cec8b=_0x5b13ed?0x0:_0x1410e9[_0xb38f('0x30')];var _0x976633=_0x5b13ed?_0x23789a['count']:_0x1410e9[_0xb38f('0x30')]+_0x1410e9[_0xb38f('0x31')];var _0x205d38;if(_0x976633>=_0x3b03cb){_0x976633=_0x3b03cb;_0x205d38=0xc8;}else{_0x205d38=0xce;}_0x44268d['status'](_0x205d38);return _0x44268d[_0xb38f('0x32')]('Content-Range',_0x4cec8b+'-'+_0x976633+'/'+_0x3b03cb)[_0xb38f('0x33')](_0x23789a);}return null;};}function patchUpdates(_0x2b930b){return function(_0x548bca){try{jsonpatch[_0xb38f('0x34')](_0x548bca,_0x2b930b,!![]);}catch(_0x44adf5){return BPromise[_0xb38f('0x35')](_0x44adf5);}return _0x548bca['save']();};}function saveUpdates(_0x1bd80d,_0x29a34c){return function(_0x2df253){if(_0x2df253){return _0x2df253[_0xb38f('0x36')](_0x1bd80d)['then'](function(_0x3c0798){return _0x3c0798;});}return null;};}function removeEntity(_0x4f6e1e,_0xe96d2){return function(_0x12006b){if(_0x12006b){return _0x12006b[_0xb38f('0x37')]()[_0xb38f('0x20')](function(){var _0x37f236=_0x12006b[_0xb38f('0x38')]({'plain':!![]});var _0x47bab1=_0xb38f('0x39');return db[_0xb38f('0x3a')][_0xb38f('0x37')]({'where':{'type':_0x47bab1,'resourceId':_0x37f236['id']}})['then'](function(){return _0x12006b;});})[_0xb38f('0x20')](function(){_0x4f6e1e[_0xb38f('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa885cf,_0x150765){return function(_0x114e52){if(!_0x114e52){_0xa885cf[_0xb38f('0x2b')](0x194);}return _0x114e52;};}function handleError(_0x2640cf,_0x431174){_0x431174=_0x431174||0x1f4;return function(_0x578353){logger[_0xb38f('0x26')](_0x578353['stack']);if(_0x578353[_0xb38f('0x3b')]){delete _0x578353['name'];}_0x2640cf['status'](_0x431174)[_0xb38f('0x3c')](_0x578353);};}exports['index']=function(_0x740faa,_0x1d54e7){var _0x8eedac={'include':[{'model':db[_0xb38f('0x3d')],'as':_0xb38f('0x3e')}]},_0x41233d={},_0x330e1e={'count':0x0,'rows':[]};var _0x49ea02=_['map'](db['SmsAccount']['rawAttributes'],function(_0x5757c8){return{'name':_0x5757c8['fieldName'],'type':_0x5757c8[_0xb38f('0x3f')]['key']};});_0x41233d[_0xb38f('0x40')]=_[_0xb38f('0x41')](_0x49ea02,_0xb38f('0x3b'));_0x41233d[_0xb38f('0x42')]=_[_0xb38f('0x43')](_0x740faa[_0xb38f('0x42')]);_0x41233d[_0xb38f('0x44')]=_[_0xb38f('0x45')](_0x41233d[_0xb38f('0x40')],_0x41233d['query']);_0x8eedac['attributes']=_[_0xb38f('0x45')](_0x41233d[_0xb38f('0x40')],qs['fields'](_0x740faa[_0xb38f('0x42')][_0xb38f('0x46')]));_0x8eedac[_0xb38f('0x47')]=_0x8eedac[_0xb38f('0x47')][_0xb38f('0x48')]?_0x8eedac[_0xb38f('0x47')]:_0x41233d['model'];if(!_0x740faa[_0xb38f('0x42')]['hasOwnProperty'](_0xb38f('0x49'))){_0x8eedac['limit']=qs['limit'](_0x740faa[_0xb38f('0x42')]['limit']);_0x8eedac[_0xb38f('0x30')]=qs[_0xb38f('0x30')](_0x740faa['query'][_0xb38f('0x30')]);}_0x8eedac[_0xb38f('0x4a')]=qs['sort'](_0x740faa[_0xb38f('0x42')]['sort']);_0x8eedac[_0xb38f('0x4b')]=qs[_0xb38f('0x44')](_[_0xb38f('0x4c')](_0x740faa[_0xb38f('0x42')],_0x41233d['filters']),_0x49ea02);if(_0x740faa['query'][_0xb38f('0x4d')]){_0x8eedac[_0xb38f('0x4b')]=_[_0xb38f('0x4e')](_0x8eedac[_0xb38f('0x4b')],{'$or':_[_0xb38f('0x41')](_0x49ea02,function(_0x2d23be){if(_0x2d23be['type']!==_0xb38f('0x4f')){var _0x11f0dd={};_0x11f0dd[_0x2d23be[_0xb38f('0x3b')]]={'$like':'%'+_0x740faa[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x11f0dd;}})});}_0x8eedac=_[_0xb38f('0x4e')]({},_0x8eedac,_0x740faa[_0xb38f('0x50')]);var _0x1ef920={'where':_0x8eedac[_0xb38f('0x4b')]};return db[_0xb38f('0x51')]['count'](_0x1ef920)[_0xb38f('0x20')](function(_0x484826){_0x330e1e['count']=_0x484826;if(_0x740faa[_0xb38f('0x42')][_0xb38f('0x52')]){_0x8eedac['include']=[{'all':!![]}];}return db[_0xb38f('0x51')]['findAll'](_0x8eedac);})[_0xb38f('0x20')](function(_0x58ae90){_0x330e1e[_0xb38f('0x53')]=_0x58ae90;return _0x330e1e;})['then'](respondWithFilteredResult(_0x1d54e7,_0x8eedac))['catch'](handleError(_0x1d54e7,null));};exports[_0xb38f('0x54')]=function(_0x13399a,_0x31717d){var _0x489da3={'raw':![],'where':{'id':_0x13399a[_0xb38f('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4b0dcf={};_0x4b0dcf['model']=_[_0xb38f('0x43')](db[_0xb38f('0x51')]['rawAttributes']);_0x4b0dcf[_0xb38f('0x42')]=_['keys'](_0x13399a[_0xb38f('0x42')]);_0x4b0dcf[_0xb38f('0x44')]=_[_0xb38f('0x45')](_0x4b0dcf[_0xb38f('0x40')],_0x4b0dcf[_0xb38f('0x42')]);_0x489da3[_0xb38f('0x47')]=_[_0xb38f('0x45')](_0x4b0dcf[_0xb38f('0x40')],qs[_0xb38f('0x46')](_0x13399a[_0xb38f('0x42')][_0xb38f('0x46')]));_0x489da3[_0xb38f('0x47')]=_0x489da3[_0xb38f('0x47')][_0xb38f('0x48')]?_0x489da3[_0xb38f('0x47')]:_0x4b0dcf[_0xb38f('0x40')];if(_0x13399a[_0xb38f('0x42')][_0xb38f('0x52')]){_0x489da3['include']=[{'all':!![]}];}_0x489da3=_[_0xb38f('0x4e')]({},_0x489da3,_0x13399a[_0xb38f('0x50')]);return db[_0xb38f('0x51')][_0xb38f('0x56')](_0x489da3)[_0xb38f('0x20')](handleEntityNotFound(_0x31717d,null))[_0xb38f('0x20')](respondWithResult(_0x31717d,null))['catch'](handleError(_0x31717d,null));};exports[_0xb38f('0x57')]=function(_0xbe56b4,_0x38b285){return db[_0xb38f('0x51')][_0xb38f('0x57')](_0xbe56b4[_0xb38f('0x58')],{})[_0xb38f('0x20')](function(_0x3e8c82){var _0x35e83a=_0xbe56b4['user'][_0xb38f('0x38')]({'plain':!![]});if(!_0x35e83a)throw new Error(_0xb38f('0x59'));if(_0x35e83a[_0xb38f('0x5a')]==='user'){var _0x51a771=_0x3e8c82[_0xb38f('0x38')]({'plain':!![]});var _0x5bdab4='SmsAccounts';return db[_0xb38f('0x5b')]['find']({'where':{'name':_0x5bdab4,'userProfileId':_0x35e83a[_0xb38f('0x5c')]},'raw':!![]})['then'](function(_0xfefd1b){if(_0xfefd1b&&_0xfefd1b[_0xb38f('0x5d')]===0x0){return db['UserProfileResource'][_0xb38f('0x57')]({'name':_0x51a771[_0xb38f('0x3b')],'resourceId':_0x51a771['id'],'type':_0xfefd1b[_0xb38f('0x3b')],'sectionId':_0xfefd1b['id']},{})[_0xb38f('0x20')](function(){return _0x3e8c82;});}else{return _0x3e8c82;}})[_0xb38f('0x2a')](function(_0x425f74){logger[_0xb38f('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x425f74);throw _0x425f74;});}return _0x3e8c82;})[_0xb38f('0x20')](respondWithResult(_0x38b285,0xc9))[_0xb38f('0x2a')](handleError(_0x38b285,null));};exports['update']=function(_0x20bac0,_0x1320f1){if(_0x20bac0[_0xb38f('0x58')]['id']){delete _0x20bac0['body']['id'];}return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0x20bac0[_0xb38f('0x55')]['id']},'include':[{'model':db[_0xb38f('0x3d')],'as':_0xb38f('0x3e')}]})[_0xb38f('0x20')](handleEntityNotFound(_0x1320f1,null))[_0xb38f('0x20')](saveUpdates(_0x20bac0[_0xb38f('0x58')],null))['then'](respondWithResult(_0x1320f1,null))['catch'](handleError(_0x1320f1,null));};exports[_0xb38f('0x37')]=function(_0x536e5a,_0x888b91){return db['SmsAccount'][_0xb38f('0x56')]({'where':{'id':_0x536e5a[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x888b91,null))[_0xb38f('0x20')](removeEntity(_0x888b91,null))[_0xb38f('0x2a')](handleError(_0x888b91,null));};exports['describe']=function(_0x30dc8d,_0x4a4e61){return db['SmsAccount'][_0xb38f('0x5e')]()['then'](respondWithResult(_0x4a4e61,null))[_0xb38f('0x2a')](handleError(_0x4a4e61,null));};exports[_0xb38f('0x5f')]=function(_0x14e497,_0xc87761,_0x5d3a93){if(_0x14e497['body']['id']){delete _0x14e497['body']['id'];}return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0x14e497['params']['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0xc87761,null))[_0xb38f('0x20')](function(_0x52bf51){if(_0x52bf51){_0x14e497[_0xb38f('0x58')][_0xb38f('0x60')]=_0x52bf51['id'];return db[_0xb38f('0x61')][_0xb38f('0x57')](_0x14e497[_0xb38f('0x58')]);}})[_0xb38f('0x20')](respondWithResult(_0xc87761,null))['catch'](handleError(_0xc87761,null));};exports[_0xb38f('0x62')]=function(_0x51bec6,_0x42feaa,_0x5d599a){var _0x57c271={'raw':![],'where':{}};var _0xd7d2e2={};var _0x7edb9f={'count':0x0,'rows':[]};return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0x51bec6[_0xb38f('0x55')]['id']}})['then'](handleEntityNotFound(_0x42feaa,null))['then'](function(_0x22680a){if(_0x22680a){_0xd7d2e2[_0xb38f('0x40')]=_[_0xb38f('0x43')](db[_0xb38f('0x61')]['rawAttributes']);_0xd7d2e2['query']=_['keys'](_0x51bec6[_0xb38f('0x42')]);_0xd7d2e2['filters']=_[_0xb38f('0x45')](_0xd7d2e2[_0xb38f('0x40')],_0xd7d2e2[_0xb38f('0x42')]);_0x57c271['attributes']=_[_0xb38f('0x45')](_0xd7d2e2[_0xb38f('0x40')],qs[_0xb38f('0x46')](_0x51bec6[_0xb38f('0x42')][_0xb38f('0x46')]));_0x57c271[_0xb38f('0x47')]=_0x57c271['attributes']['length']?_0x57c271['attributes']:_0xd7d2e2['model'];if(!_0x51bec6[_0xb38f('0x42')]['hasOwnProperty']('nolimit')){_0x57c271['limit']=qs[_0xb38f('0x31')](_0x51bec6[_0xb38f('0x42')]['limit']);_0x57c271['offset']=qs[_0xb38f('0x30')](_0x51bec6['query'][_0xb38f('0x30')]);}_0x57c271['order']=qs[_0xb38f('0x64')](_0x51bec6[_0xb38f('0x42')][_0xb38f('0x64')]);_0x57c271[_0xb38f('0x4b')]=qs[_0xb38f('0x44')](_[_0xb38f('0x4c')](_0x51bec6['query'],_0xd7d2e2[_0xb38f('0x44')]));_0x57c271[_0xb38f('0x4b')][_0xb38f('0x60')]=_0x22680a['id'];if(_0x51bec6['query'][_0xb38f('0x4d')]){_0x57c271[_0xb38f('0x4b')]=_[_0xb38f('0x4e')](_0x57c271[_0xb38f('0x4b')],{'$or':_[_0xb38f('0x41')](_0x57c271[_0xb38f('0x47')],function(_0x3d93d6){var _0x53266b={};_0x53266b[_0x3d93d6]={'$like':'%'+_0x51bec6[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x53266b;})});}_0x57c271=_['merge']({},_0x57c271,_0x51bec6[_0xb38f('0x50')]);return db[_0xb38f('0x61')]['count']({'where':_0x57c271[_0xb38f('0x4b')]})[_0xb38f('0x20')](function(_0x140b85){_0x7edb9f[_0xb38f('0x2f')]=_0x140b85;if(_0x51bec6[_0xb38f('0x42')][_0xb38f('0x52')]){_0x57c271[_0xb38f('0x65')]=[{'all':!![]}];}return db[_0xb38f('0x61')][_0xb38f('0x66')](_0x57c271);})[_0xb38f('0x20')](function(_0x5112f1){_0x7edb9f['rows']=_0x5112f1;return _0x7edb9f;});}})[_0xb38f('0x20')](respondWithFilteredResult(_0x42feaa,_0x57c271))[_0xb38f('0x2a')](handleError(_0x42feaa,null));};exports[_0xb38f('0x67')]=function(_0x3b58e8,_0x53422a,_0x555af1){return db['SmsAccount'][_0xb38f('0x56')]({'where':{'id':_0x3b58e8[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x53422a,null))[_0xb38f('0x20')](function(_0x5708ff){if(_0x5708ff){return _0x5708ff['removeDispositions'](_0x3b58e8[_0xb38f('0x42')][_0xb38f('0x68')]);}})[_0xb38f('0x20')](respondWithStatusCode(_0x53422a,null))[_0xb38f('0x2a')](handleError(_0x53422a,null));};exports[_0xb38f('0x69')]=function(_0x4ece54,_0x1be1ee,_0x3abb58){if(_0x4ece54[_0xb38f('0x58')]['id']){delete _0x4ece54[_0xb38f('0x58')]['id'];}return db['SmsAccount'][_0xb38f('0x56')]({'where':{'id':_0x4ece54['params']['id']}})['then'](handleEntityNotFound(_0x1be1ee,null))[_0xb38f('0x20')](function(_0x20fd1d){if(_0x20fd1d){_0x4ece54[_0xb38f('0x58')][_0xb38f('0x60')]=_0x20fd1d['id'];return db[_0xb38f('0x6a')][_0xb38f('0x57')](_0x4ece54[_0xb38f('0x58')]);}})[_0xb38f('0x20')](respondWithResult(_0x1be1ee,null))[_0xb38f('0x2a')](handleError(_0x1be1ee,null));};exports[_0xb38f('0x6b')]=function(_0x467d52,_0x374804,_0x38b635){var _0x5332ea={'raw':![],'where':{}};var _0x705861={};var _0x571c0e={'count':0x0,'rows':[]};return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0x467d52['params']['id']}})['then'](handleEntityNotFound(_0x374804,null))[_0xb38f('0x20')](function(_0x797b78){if(_0x797b78){_0x705861[_0xb38f('0x40')]=_[_0xb38f('0x43')](db['CannedAnswer']['rawAttributes']);_0x705861['query']=_['keys'](_0x467d52[_0xb38f('0x42')]);_0x705861[_0xb38f('0x44')]=_['intersection'](_0x705861[_0xb38f('0x40')],_0x705861['query']);_0x5332ea['attributes']=_[_0xb38f('0x45')](_0x705861[_0xb38f('0x40')],qs['fields'](_0x467d52[_0xb38f('0x42')]['fields']));_0x5332ea['attributes']=_0x5332ea[_0xb38f('0x47')][_0xb38f('0x48')]?_0x5332ea[_0xb38f('0x47')]:_0x705861[_0xb38f('0x40')];if(!_0x467d52[_0xb38f('0x42')][_0xb38f('0x6c')](_0xb38f('0x49'))){_0x5332ea['limit']=qs[_0xb38f('0x31')](_0x467d52['query']['limit']);_0x5332ea[_0xb38f('0x30')]=qs['offset'](_0x467d52[_0xb38f('0x42')]['offset']);}_0x5332ea[_0xb38f('0x4a')]=qs['sort'](_0x467d52[_0xb38f('0x42')][_0xb38f('0x64')]);_0x5332ea[_0xb38f('0x4b')]=qs[_0xb38f('0x44')](_[_0xb38f('0x4c')](_0x467d52[_0xb38f('0x42')],_0x705861[_0xb38f('0x44')]));_0x5332ea[_0xb38f('0x4b')][_0xb38f('0x60')]=_0x797b78['id'];if(_0x467d52[_0xb38f('0x42')][_0xb38f('0x4d')]){_0x5332ea[_0xb38f('0x4b')]=_[_0xb38f('0x4e')](_0x5332ea['where'],{'$or':_[_0xb38f('0x41')](_0x5332ea[_0xb38f('0x47')],function(_0x4608d7){var _0x4c1364={};_0x4c1364[_0x4608d7]={'$like':'%'+_0x467d52[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x4c1364;})});}_0x5332ea=_[_0xb38f('0x4e')]({},_0x5332ea,_0x467d52[_0xb38f('0x50')]);return db['CannedAnswer'][_0xb38f('0x2f')]({'where':_0x5332ea[_0xb38f('0x4b')]})['then'](function(_0x1123ed){_0x571c0e[_0xb38f('0x2f')]=_0x1123ed;if(_0x467d52[_0xb38f('0x42')]['includeAll']){_0x5332ea[_0xb38f('0x65')]=[{'all':!![]}];}return db[_0xb38f('0x6a')][_0xb38f('0x66')](_0x5332ea);})[_0xb38f('0x20')](function(_0xfc1b11){_0x571c0e['rows']=_0xfc1b11;return _0x571c0e;});}})[_0xb38f('0x20')](respondWithFilteredResult(_0x374804,_0x5332ea))['catch'](handleError(_0x374804,null));};exports[_0xb38f('0x6d')]=function(_0x5a62b0,_0x5c5385,_0x124a19){return db[_0xb38f('0x51')]['find']({'where':{'id':_0x5a62b0[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x5c5385,null))[_0xb38f('0x20')](function(_0x318ea2){if(_0x318ea2){return _0x318ea2[_0xb38f('0x6d')](_0x5a62b0['query'][_0xb38f('0x68')]);}})['then'](respondWithStatusCode(_0x5c5385,null))[_0xb38f('0x2a')](handleError(_0x5c5385,null));};exports[_0xb38f('0x6e')]=function(_0xbd6eef,_0x137827,_0x4a28eb){var _0x5bea4d={'channel':_0xb38f('0x6f')};var _0x21c616=[];var _0x29143b=[];var _0x31a562={};return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0xbd6eef[_0xb38f('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xb38f('0x70')}]})[_0xb38f('0x20')](handleEntityNotFound(_0x137827,null))[_0xb38f('0x20')](function(_0x3a7d98){_0x5bea4d[_0xb38f('0x71')]=_0x3a7d98;_0x5bea4d[_0xb38f('0x72')]=_[_0xb38f('0x73')](_0x3a7d98['Applications'],[_0xb38f('0x74')],[_0xb38f('0x75')]);if(_0x5bea4d[_0xb38f('0x71')][_0xb38f('0x70')]){delete _0x5bea4d[_0xb38f('0x71')]['Applications'];}return db[_0xb38f('0x76')][_0xb38f('0x5e')]();})[_0xb38f('0x20')](function(_0x146481){if(!_0x146481){throw new db[(_0xb38f('0x77'))]['ValidationError'](_0xb38f('0x78'));}_0x21c616=_[_0xb38f('0x79')](_['keys'](_0x146481),[_0xb38f('0x7a'),_0xb38f('0x7b')]);_0x29143b=_[_0xb38f('0x79')](_[_0xb38f('0x43')](_0x146481),[_0xb38f('0x7a'),'updatedAt',_0xb38f('0x7c'),_0xb38f('0x7d')]);_0x5bea4d[_0xb38f('0x58')]={'mapKey':_0xb38f('0x7e')};if(_0x5bea4d[_0xb38f('0x71')][_0xb38f('0x3f')]){switch(_0x5bea4d[_0xb38f('0x71')]['type']){case _0xb38f('0x7f'):_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x81')];_0x5bea4d['body'][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x82')];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x83')]=_0xbd6eef[_0xb38f('0x58')]['MessageSid'];break;case'skebby':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]='+'+_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x84')];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x85')];break;case'connectel':_0x5bea4d[_0xb38f('0x58')]['from']=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x80')];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x28')];break;case'clicksend':_0x5bea4d['body']['from']=_0xbd6eef[_0xb38f('0x58')]['from'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')]['body'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x83')]=_0xbd6eef['body'][_0xb38f('0x86')];break;case _0xb38f('0x87'):_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]=_0xbd6eef[_0xb38f('0x58')]['From'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef['body'][_0xb38f('0x88')];_0x5bea4d[_0xb38f('0x58')]['messageId']=_0xbd6eef[_0xb38f('0x58')]['MessageUUID'];break;case'infobip':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]='+'+_0xbd6eef[_0xb38f('0x58')]['results'][0x0][_0xb38f('0x80')];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x89')][0x0][_0xb38f('0x85')];_0x5bea4d['body'][_0xb38f('0x83')]=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x89')][0x0][_0xb38f('0x83')];break;case'csc':_0x5bea4d['body'][_0xb38f('0x80')]=_0xbd6eef['body'][_0xb38f('0x8a')];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef['body'][_0xb38f('0x8b')][_0xb38f('0x28')];break;case _0xb38f('0x8c'):_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]=_0xbd6eef[_0xb38f('0x58')]['fromNumber'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef['body'][_0xb38f('0x85')];_0x5bea4d[_0xb38f('0x58')]['messageId']=_0xbd6eef[_0xb38f('0x58')]['replyMessageId'];break;case'bandwidth':_0x5bea4d['body'][_0xb38f('0x83')]=_0xbd6eef['body'][0x0][_0xb38f('0x28')]['id'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]=_0xbd6eef[_0xb38f('0x58')][0x0]['message']['from'];_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')]=_0xbd6eef[_0xb38f('0x58')][0x0][_0xb38f('0x28')][_0xb38f('0x85')];break;case _0xb38f('0x8d'):_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')]=_0xbd6eef['body']['from'];_0x5bea4d[_0xb38f('0x58')]['body']=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x28')];_0x5bea4d[_0xb38f('0x58')]['messageId']=_0xbd6eef[_0xb38f('0x58')][_0xb38f('0x8e')];break;}}if(_0x5bea4d[_0xb38f('0x58')]['id']){delete _0x5bea4d[_0xb38f('0x58')]['id'];}if(_[_0xb38f('0x8f')](_0x5bea4d[_0xb38f('0x58')]['from'])){throw new db[(_0xb38f('0x77'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb38f('0x8f')](_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x58')])||_0x5bea4d[_0xb38f('0x58')]['body']===''){throw new db[(_0xb38f('0x77'))][(_0xb38f('0x90'))](_0xb38f('0x91'));}if(_[_0xb38f('0x8f')](_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x92')])){throw new db[(_0xb38f('0x77'))][(_0xb38f('0x90'))](_0xb38f('0x93')+_0x29143b);}if(!_[_0xb38f('0x94')](_0x29143b,_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x92')])){throw new db[(_0xb38f('0x77'))][(_0xb38f('0x90'))](_0xb38f('0x95')+_0x29143b);}_0x31a562[_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x92')]]=_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')];return db[_0xb38f('0x96')][_0xb38f('0x56')]({'where':{'id':_0x5bea4d[_0xb38f('0x71')]['ListId']},'include':[{'model':db[_0xb38f('0x76')],'as':'Contacts','where':_0x31a562,'limit':0x1,'order':[[_0xb38f('0x7b'),_0xb38f('0x97')]]}]});})[_0xb38f('0x20')](handleEntityNotFound(_0x137827,null))[_0xb38f('0x20')](function(_0x52ad1b){if(_0x52ad1b){_0x5bea4d[_0xb38f('0x98')]=_['omit'](_0x52ad1b,[_0xb38f('0x99')]);if(_0x52ad1b['Contacts']['length']){return _0x52ad1b[_0xb38f('0x99')][0x0];}var _0x4520d4=_[_0xb38f('0x19')](_0x5bea4d[_0xb38f('0x58')],{'firstName':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')],'ListId':_0x52ad1b['id']});_0x4520d4[_0x5bea4d['body'][_0xb38f('0x92')]]=_0x5bea4d['body']['from'];return db[_0xb38f('0x76')]['create'](_0x4520d4,{'fields':_0x21c616,'raw':!![]});}})[_0xb38f('0x20')](handleEntityNotFound(_0x137827,null))[_0xb38f('0x20')](function(_0x3b353f){if(_0x3b353f){_0x5bea4d[_0xb38f('0x9a')]=_0x3b353f;var _0x307fa1={'ContactId':_0x3b353f['id'],'phone':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x80')],'SmsAccountId':_0xbd6eef[_0xb38f('0x55')]['id']};var _0x1aceb4={'ContactId':_0x3b353f['id'],'SmsAccountId':_0xbd6eef['params']['id'],'closed':![]};return db[_0xb38f('0x9b')][_0xb38f('0x56')]({'where':_0x1aceb4})[_0xb38f('0x20')](function(_0x331732){if(_0x331732){return[_0x331732,![]];}return db[_0xb38f('0x9b')][_0xb38f('0x57')](_0x307fa1)['then'](function(_0xab5074){return[_0xab5074,!![]];});});}})[_0xb38f('0x9c')](function(_0x116723,_0x158b89){_0x5bea4d[_0xb38f('0x9d')]=_0x116723['get']({'plain':!![]});_0x5bea4d[_0xb38f('0x9d')][_0xb38f('0x9e')]=![];if(_0x158b89){if(_0x5bea4d[_0xb38f('0x71')][_0xb38f('0x9f')]){_0x5bea4d[_0xb38f('0x72')]['push']({'id':0x0,'priority':_0x5bea4d[_0xb38f('0x72')]['length']+0x1,'app':'close','appdata':_0xb38f('0xa0'),'interval':_0xb38f('0xa1')});}_0x5bea4d[_0xb38f('0x9d')][_0xb38f('0x9e')]=!![];}return db[_0xb38f('0xa2')][_0xb38f('0x57')]({'phone':_0x5bea4d[_0xb38f('0x58')]['from'],'messageId':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0x83')],'body':_0x5bea4d[_0xb38f('0x58')]['body'],'SmsAccountId':_0xbd6eef[_0xb38f('0x55')]['id'],'SmsInteractionId':_0x116723['id'],'direction':'in','ContactId':_0x116723[_0xb38f('0xa3')],'AttachmentId':_0x5bea4d[_0xb38f('0x58')][_0xb38f('0xa4')]});})[_0xb38f('0x20')](function(_0x327f6a){_0x5bea4d['message']=_0x327f6a;if(_0x5bea4d[_0xb38f('0x9d')][_0xb38f('0xa5')]){return db[_0xb38f('0xa6')][_0xb38f('0x56')]({'attributes':['id',_0xb38f('0x3b')],'where':{'id':_0x5bea4d[_0xb38f('0x9d')][_0xb38f('0xa5')]}})['then'](function(_0x24a0e5){if(_0x24a0e5){_0x5bea4d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb38f('0xa7'),'appdata':_0x24a0e5[_0xb38f('0x3b')]+','+(_0x5bea4d[_0xb38f('0x71')][_0xb38f('0xa8')]||0xa),'interval':_0xb38f('0xa1')});}return respondWithRpcPromise(_0xb38f('0xa9'),_0xb38f('0xaa'),_0x5bea4d);});}return respondWithRpcPromise('Start','startRouting',_0x5bea4d);})['then'](function(_0x2d3b88){if(_0x2d3b88){var _0x4428ca=0xc8;var _0x4dbff8='receiveMessage';logger['info'](_0xb38f('0x24'),_0x4dbff8,_0x4428ca,_0xb38f('0xab'));logger[_0xb38f('0x23')](_0xb38f('0xac'),_0x4dbff8,_0x4428ca,_0xb38f('0xab'),JSON[_0xb38f('0x25')](_0x2d3b88));if(_0x5bea4d[_0xb38f('0x71')]['type']===_0xb38f('0x7f')){return _0x137827[_0xb38f('0x2c')](_0x4428ca)['set'](_0xb38f('0xad'),_0xb38f('0xae'))[_0xb38f('0x3c')](_0xb38f('0xaf'));}else{return _0x137827[_0xb38f('0x2c')](_0x4428ca)[_0xb38f('0x33')](_0x2d3b88);}}})['catch'](handleError(_0x137827,null));};exports[_0xb38f('0xb0')]=function(_0x24a002,_0x2615dc){var _0xf9d15a=_0x24a002[_0xb38f('0x55')]['id'];var _0x4226fd=_0x24a002[_0xb38f('0x58')];var _0x2af071=0xc8;var _0x1a0533=null;return db[_0xb38f('0xb1')]['transaction']({'isolationLevel':db['sequelize'][_0xb38f('0xb2')][_0xb38f('0xb3')]['READ_COMMITTED']},function(_0x1359e2){return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0xf9d15a},'transaction':_0x1359e2})[_0xb38f('0x20')](function(_0x1dfe16){if(_0x1dfe16){return db['SmsApplication'][_0xb38f('0x37')]({'where':{'SmsAccountId':_0xf9d15a},'transaction':_0x1359e2})['then'](function(){var _0x1c9a26=_[_0xb38f('0x41')](_0x4226fd,function(_0x3bd567){_0x3bd567[_0xb38f('0x60')]=_0xf9d15a;return _0x3bd567;});return db[_0xb38f('0xb4')]['bulkCreate'](_0x1c9a26,{'transaction':_0x1359e2});});}else{_0x2af071=0x194;_0x1a0533=[];}});})[_0xb38f('0x20')](function(){if(_0x2af071!==0x194){return db['SmsApplication'][_0xb38f('0xb5')]({'where':{'SmsAccountId':_0xf9d15a},'order':'priority'})[_0xb38f('0x20')](function(_0x1e6cb9){_0x1a0533=_0x1e6cb9;});}})[_0xb38f('0x2a')](function(_0x489d74){_0x2af071=0x1f4;logger[_0xb38f('0x26')](_0x489d74[_0xb38f('0xb6')]);if(_0x489d74[_0xb38f('0x3b')]){delete _0x489d74[_0xb38f('0x3b')];}_0x1a0533=_0x489d74;})[_0xb38f('0xb7')](function(){if(_0x1a0533===null){_0x2615dc[_0xb38f('0x2b')](_0x2af071);}else{if(_0x2af071===0x1f4){_0x2615dc[_0xb38f('0x2c')](_0x2af071)['send'](_0x1a0533);}else{_0x2615dc[_0xb38f('0x2c')](_0x2af071)['json'](_0x1a0533);}}});};exports[_0xb38f('0xb8')]=function(_0x377600,_0x3f091e,_0x3ba81a){var _0x3a9fae={};var _0x2cff4a={};var _0x2e12c6;var _0x1d4848;return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0x377600[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x3f091e,null))['then'](function(_0x1d77b6){if(_0x1d77b6){_0x2e12c6=_0x1d77b6;_0x2cff4a[_0xb38f('0x40')]=_[_0xb38f('0x43')](db['SmsApplication'][_0xb38f('0xb9')]);_0x2cff4a[_0xb38f('0x42')]=_[_0xb38f('0x43')](_0x377600[_0xb38f('0x42')]);_0x2cff4a[_0xb38f('0x44')]=_[_0xb38f('0x45')](_0x2cff4a[_0xb38f('0x40')],_0x2cff4a[_0xb38f('0x42')]);_0x3a9fae[_0xb38f('0x47')]=_[_0xb38f('0x45')](_0x2cff4a[_0xb38f('0x40')],qs['fields'](_0x377600[_0xb38f('0x42')]['fields']));_0x3a9fae[_0xb38f('0x47')]=_0x3a9fae[_0xb38f('0x47')][_0xb38f('0x48')]?_0x3a9fae['attributes']:_0x2cff4a[_0xb38f('0x40')];_0x3a9fae[_0xb38f('0x4a')]=qs['sort'](_0x377600[_0xb38f('0x42')]['sort']);_0x3a9fae['where']=qs[_0xb38f('0x44')](_[_0xb38f('0x4c')](_0x377600[_0xb38f('0x42')],_0x2cff4a['filters']));if(_0x377600[_0xb38f('0x42')][_0xb38f('0x4d')]){_0x3a9fae[_0xb38f('0x4b')]=_['merge'](_0x3a9fae[_0xb38f('0x4b')],{'$or':_['map'](_0x3a9fae[_0xb38f('0x47')],function(_0x4ad8b3){var _0x214fa0={};_0x214fa0[_0x4ad8b3]={'$like':'%'+_0x377600[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x214fa0;})});}_0x3a9fae=_[_0xb38f('0x4e')]({},_0x3a9fae,_0x377600['options']);return _0x2e12c6['getApplications'](_0x3a9fae);}})[_0xb38f('0x20')](function(_0x5c597a){if(_0x5c597a){_0x1d4848=_0x5c597a[_0xb38f('0x48')];if(!_0x377600['query'][_0xb38f('0x6c')]('nolimit')){_0x3a9fae[_0xb38f('0x31')]=qs['limit'](_0x377600[_0xb38f('0x42')]['limit']);_0x3a9fae[_0xb38f('0x30')]=qs['offset'](_0x377600[_0xb38f('0x42')][_0xb38f('0x30')]);}return _0x2e12c6['getApplications'](_0x3a9fae);}})[_0xb38f('0x20')](function(_0xa4cd78){if(_0xa4cd78){return _0xa4cd78?{'count':_0x1d4848,'rows':_0xa4cd78}:null;}})[_0xb38f('0x20')](respondWithResult(_0x3f091e,null))[_0xb38f('0x2a')](handleError(_0x3f091e,null));};exports['getInteractions']=function(_0x3bf5a1,_0x54e902,_0xe93f0c){var _0x3ee5b4={'raw':![],'where':{}};var _0x198c86={};var _0xf696cb={'count':0x0,'rows':[]};return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0x3bf5a1[_0xb38f('0x55')]['id']}})['then'](handleEntityNotFound(_0x54e902,null))['then'](function(_0x3db2b7){if(_0x3db2b7){_0x198c86[_0xb38f('0x40')]=_[_0xb38f('0x43')](db[_0xb38f('0x9b')][_0xb38f('0xb9')]);_0x198c86['query']=_[_0xb38f('0x43')](_0x3bf5a1[_0xb38f('0x42')]);_0x198c86[_0xb38f('0x44')]=_[_0xb38f('0x45')](_0x198c86['model'],_0x198c86[_0xb38f('0x42')]);_0x3ee5b4[_0xb38f('0x47')]=_[_0xb38f('0x45')](_0x198c86[_0xb38f('0x40')],qs[_0xb38f('0x46')](_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x46')]));_0x3ee5b4[_0xb38f('0x47')]=_0x3ee5b4['attributes'][_0xb38f('0x48')]?_0x3ee5b4['attributes']:_0x198c86['model'];if(!_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x6c')](_0xb38f('0x49'))){_0x3ee5b4[_0xb38f('0x31')]=qs[_0xb38f('0x31')](_0x3bf5a1['query'][_0xb38f('0x31')]);_0x3ee5b4[_0xb38f('0x30')]=qs[_0xb38f('0x30')](_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x30')]);}_0x3ee5b4[_0xb38f('0x4a')]=qs['sort'](_0x3bf5a1[_0xb38f('0x42')]['sort']);_0x3ee5b4[_0xb38f('0x4b')]=qs[_0xb38f('0x44')](_[_0xb38f('0x4c')](_0x3bf5a1[_0xb38f('0x42')],_0x198c86[_0xb38f('0x44')]));_0x3ee5b4['where']['SmsAccountId']=_0x3db2b7['id'];if(_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x4d')]){_0x3ee5b4[_0xb38f('0x4b')]=_['merge'](_0x3ee5b4['where'],{'$or':_[_0xb38f('0x41')](_0x3ee5b4[_0xb38f('0x47')],function(_0x49e09f){var _0x483761={};_0x483761[_0x49e09f]={'$like':'%'+_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x483761;})});}_0x3ee5b4=_[_0xb38f('0x4e')]({},_0x3ee5b4,_0x3bf5a1['options']);return db['SmsInteraction']['count']({'where':_0x3ee5b4[_0xb38f('0x4b')]})['then'](function(_0x565f2){_0xf696cb[_0xb38f('0x2f')]=_0x565f2;if(_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0x52')]){_0x3ee5b4[_0xb38f('0x65')]=[{'model':db['CmContact'],'as':_0xb38f('0xba'),'required':![]},{'model':db['User'],'as':_0xb38f('0xbb'),'attributes':['name','fullname',_0xb38f('0xbc')],'required':![]},{'model':db[_0xb38f('0xbd')],'as':'Tags','attributes':['id','name','color'],'where':_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0xbe')]?{'id':_0x3bf5a1[_0xb38f('0x42')]['tag']}:undefined,'required':_0x3bf5a1[_0xb38f('0x42')][_0xb38f('0xbe')]?!![]:![]}];}return db[_0xb38f('0x9b')][_0xb38f('0x66')](_0x3ee5b4);})[_0xb38f('0x20')](function(_0x16d91d){_0xf696cb[_0xb38f('0x53')]=_0x16d91d;return _0xf696cb;});}})[_0xb38f('0x20')](respondWithFilteredResult(_0x54e902,_0x3ee5b4))[_0xb38f('0x2a')](handleError(_0x54e902,null));};exports[_0xb38f('0x3c')]=function(_0x108ef6,_0x1ba6da,_0x160dc5){var _0x2ddcca,_0x1b4ddb,_0x69dfca;if(_[_0xb38f('0x8f')](_0x108ef6['body'][_0xb38f('0x58')])||_0x108ef6['body'][_0xb38f('0x58')]===''){throw new db[(_0xb38f('0x77'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb38f('0x8f')](_0x108ef6[_0xb38f('0x58')]['to'])){throw new db[(_0xb38f('0x77'))][(_0xb38f('0x90'))](_0xb38f('0xbf'));}_0x2ddcca=_0x108ef6[_0xb38f('0x58')]['to'];return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0x108ef6[_0xb38f('0x55')]['id']},'include':[{'model':db[_0xb38f('0x96')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb38f('0x99'),'where':{'mobile':_0x2ddcca},'limit':0x1,'order':[[_0xb38f('0x7b'),_0xb38f('0x97')]]}]}]})[_0xb38f('0x20')](handleEntityNotFound(_0x1ba6da,null))['then'](function(_0x22969e){if(_0x22969e&&_0x22969e[_0xb38f('0xc0')]){_0x1b4ddb=_0x22969e[_0xb38f('0x38')]({'plain':!![]});if(_0x1b4ddb[_0xb38f('0xc0')]&&_0x1b4ddb[_0xb38f('0xc0')][_0xb38f('0x99')][_0xb38f('0x48')]){return _0x1b4ddb[_0xb38f('0xc0')][_0xb38f('0x99')][0x0];}return db[_0xb38f('0x76')]['create'](_[_0xb38f('0x19')](_0x108ef6[_0xb38f('0x58')],{'firstName':_0x2ddcca,'mobile':_0x2ddcca,'phone':_0x2ddcca,'ListId':_0x1b4ddb['ListId']}));}})[_0xb38f('0x20')](handleEntityNotFound(_0x1ba6da,null))[_0xb38f('0x20')](function(_0x3daf56){if(_0x3daf56){_0x69dfca=_0x3daf56;return db[_0xb38f('0x9b')][_0xb38f('0x56')]({'where':{'ContactId':_0x69dfca['id'],'closed':![],'SmsAccountId':_0x1b4ddb['id']}})[_0xb38f('0x20')](function(_0x386c1b){if(_0x386c1b){return[_0x386c1b,![]];}return db[_0xb38f('0x9b')][_0xb38f('0x57')]({'UserId':_0x108ef6[_0xb38f('0xc1')]['id'],'ContactId':_0x69dfca['id'],'SmsAccountId':_0x1b4ddb['id'],'phone':_0x2ddcca,'firstMsgDirection':_0xb38f('0xc2'),'Messages':[_['merge'](_0x108ef6['body'],{'read':![],'body':_0x108ef6[_0xb38f('0x58')]['body'],'phone':_0x2ddcca,'SmsAccountId':_0x1b4ddb['id'],'UserId':_0x108ef6['user']['id'],'ContactId':_0x69dfca['id']})]},{'include':[{'model':db[_0xb38f('0xa2')],'as':'Messages'}]})['then'](function(_0x423b49){return[_0x423b49,!![]];});});}})[_0xb38f('0x9c')](function(_0x4b2b5f,_0x2628ab){if(_0x2628ab){return _0x4b2b5f;}return db['SmsMessage'][_0xb38f('0x57')](_[_0xb38f('0x4e')](_0x108ef6[_0xb38f('0x58')],{'read':![],'body':_0x108ef6[_0xb38f('0x58')]['body'],'phone':_0x2ddcca,'SmsAccountId':_0x1b4ddb['id'],'SmsInteractionId':_0x4b2b5f['id'],'UserId':_0x108ef6[_0xb38f('0xc1')]['id'],'ContactId':_0x69dfca['id']}))[_0xb38f('0x20')](function(_0x52dd65){_0x4b2b5f[_0xb38f('0xc3')][_0xb38f('0xc4')]=[];_0x4b2b5f['dataValues']['Messages'][_0xb38f('0xc5')](_0x52dd65[_0xb38f('0xc3')]);return _0x4b2b5f;});})[_0xb38f('0x20')](respondWithResult(_0x1ba6da,null))['catch'](handleError(_0x1ba6da,null));};exports[_0xb38f('0x2c')]=function(_0x3ffa48,_0x58da8b,_0x308ead){if(_0x3ffa48['body']['id']){delete _0x3ffa48['body']['id'];}var _0x576f7d,_0x3854db,_0x1288af;return db[_0xb38f('0x51')]['find']({'where':{'id':_0x3ffa48[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x58da8b,null))['then'](function(_0x2d15dd){if(_0x2d15dd){_0x1288af=_0x2d15dd;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb38f('0x2c'),'received\x20delivery\x20report\x20from',_0x2d15dd[_0xb38f('0x3f')],util['inspect'](_0x3ffa48['body'],{'showHidden':![],'depth':null}));switch(_0x2d15dd[_0xb38f('0x3f')]){case _0xb38f('0xc6'):if(_0x3ffa48[_0xb38f('0x58')][_0xb38f('0xc7')]&&_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x2c')]){_0x3854db=_0x3ffa48['body'][_0xb38f('0x2c')];return db['SmsMessage'][_0xb38f('0x56')]({'where':{'messageId':_0x3ffa48[_0xb38f('0x58')][_0xb38f('0xc7')]}});}break;case _0xb38f('0xc8'):if(_0x3ffa48[_0xb38f('0x58')][_0xb38f('0xc9')]&&_0x3ffa48[_0xb38f('0x58')][_0xb38f('0xca')]){_0x3854db=_0x3ffa48['body'][_0xb38f('0xca')];return db[_0xb38f('0xa2')][_0xb38f('0x56')]({'where':{'messageId':_0x3ffa48[_0xb38f('0x58')]['requestid']}});}break;case _0xb38f('0xcb'):if(_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x86')]&&_0x3ffa48[_0xb38f('0x58')][_0xb38f('0xcc')]){_0x3854db=_0x3ffa48[_0xb38f('0x58')]['status_code'];return db[_0xb38f('0xa2')][_0xb38f('0x56')]({'where':{'messageId':_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x86')]}});}break;case _0xb38f('0xcd'):var _0x346deb=_0x3ffa48['body'][_0xb38f('0x89')][0x0];if(_0x346deb['messageId']&&_0x346deb[_0xb38f('0x2c')][_0xb38f('0xce')]===_0xb38f('0xcf')){_0x3854db=_0x346deb[_0xb38f('0x2c')][_0xb38f('0xce')];return db[_0xb38f('0xa2')]['find']({'where':{'messageId':_0x346deb['messageId']}});}break;case'clickatell':if(_0x3ffa48[_0xb38f('0x58')]['messageId']&&_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x2c')]){_0x3854db=_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x2c')];return db[_0xb38f('0xa2')][_0xb38f('0x56')]({'where':{'messageId':_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x83')]}});}break;case _0xb38f('0xd0'):if(_0x3ffa48[_0xb38f('0x58')][0x0][_0xb38f('0x28')]['id']){_0x3854db=_0x3ffa48[_0xb38f('0x58')][0x0][_0xb38f('0x3f')];return db[_0xb38f('0xa2')]['find']({'where':{'messageId':_0x3ffa48[_0xb38f('0x58')][0x0][_0xb38f('0x28')]['id']}});}break;case _0xb38f('0x8d'):if(_0x3ffa48['body'][_0xb38f('0xd1')]&&_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x2c')]){_0x3854db=_0x3ffa48[_0xb38f('0x58')][_0xb38f('0x2c')];return db[_0xb38f('0xa2')]['find']({'where':{'messageId':_0x3ffa48['body'][_0xb38f('0xd1')]}});}break;}}})[_0xb38f('0x20')](handleEntityNotFound(_0x58da8b,null))[_0xb38f('0x20')](function(_0x337510){if(_0x337510){_0x576f7d=_0x337510;switch(_0x1288af[_0xb38f('0x3f')]){case _0xb38f('0xc6'):if(_0x3854db===_0xb38f('0xcf')){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger[_0xb38f('0x26')](_0xb38f('0x24'),'status','skebby',util[_0xb38f('0xd2')](_0x3ffa48['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3854db==='1'){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger[_0xb38f('0x26')](_0xb38f('0x24'),'status',_0xb38f('0xc6'),util['inspect'](_0x3ffa48[_0xb38f('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3ffa48['body'][_0xb38f('0xd3')]&&_0x3854db>=0xc8&&_0x3854db<=0xce){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger['error'](_0xb38f('0x24'),_0xb38f('0x2c'),'clicksend',util[_0xb38f('0xd2')](_0x3ffa48[_0xb38f('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb38f('0xcd'):var _0x561b26=_0x3ffa48['body'][_0xb38f('0x89')][0x0];if(_0x561b26['status']['groupName']===_0xb38f('0xcf')){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger[_0xb38f('0x26')](_0xb38f('0x24'),_0xb38f('0x2c'),_0xb38f('0xcd'),util[_0xb38f('0xd2')](_0x3ffa48[_0xb38f('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb38f('0x8c'):if(_0x3854db=='DELIVERED_TO_GATEWAY'||_0x3854db==_0xb38f('0xd4')){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger[_0xb38f('0x26')](_0xb38f('0x24'),_0xb38f('0x2c'),_0xb38f('0x8c'),util[_0xb38f('0xd2')](_0x3ffa48[_0xb38f('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb38f('0xd0'):if(_0x3854db=='message-delivered'){return _0x576f7d[_0xb38f('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb38f('0x2c'),_0xb38f('0xd0'),util[_0xb38f('0xd2')](_0x3ffa48['body'],{'showHidden':![],'depth':null}));}break;case _0xb38f('0x8d'):if(_0x3854db===_0xb38f('0xd5')||_0x3854db===_0xb38f('0xd6')){return _0x576f7d['update']({'read':!![]});}else{logger['error'](_0xb38f('0x24'),_0xb38f('0x2c'),_0xb38f('0x8d'),util[_0xb38f('0xd2')](_0x3ffa48[_0xb38f('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x576f7d;}})[_0xb38f('0x20')](respondWithResult(_0x58da8b,null))[_0xb38f('0x2a')](handleError(_0x58da8b,null));};exports['statusGet']=function(_0x441a4b,_0x639cc4,_0x32149a){var _0xb43751,_0x11b5e6,_0x422e96;return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0x441a4b[_0xb38f('0x55')]['id']}})['then'](handleEntityNotFound(_0x639cc4,null))[_0xb38f('0x20')](function(_0x323035){if(_0x323035){_0x422e96=_0x323035;logger[_0xb38f('0x23')](_0xb38f('0x24'),_0xb38f('0x2c'),_0xb38f('0xd7'),_0x323035[_0xb38f('0x3f')],util[_0xb38f('0xd2')](_0x441a4b[_0xb38f('0x42')],{'showHidden':![],'depth':null}));switch(_0x323035[_0xb38f('0x3f')]){case'csc':if(_0x441a4b[_0xb38f('0x42')][_0xb38f('0xd8')]&&_0x441a4b['query'][_0xb38f('0xd9')]){_0x11b5e6=_0x441a4b['query'][_0xb38f('0xd9')];return db[_0xb38f('0xa2')][_0xb38f('0x56')]({'where':{'messageId':_0x441a4b['query'][_0xb38f('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x639cc4,null))['then'](function(_0xae53e9){if(_0xae53e9){_0xb43751=_0xae53e9;switch(_0x422e96[_0xb38f('0x3f')]){case _0xb38f('0xda'):if(_0x11b5e6==='2'||_0x11b5e6==='6'){return _0xb43751[_0xb38f('0x36')]({'read':!![]});}else{logger[_0xb38f('0x26')](_0xb38f('0x24'),_0xb38f('0x2c'),_0xb38f('0xda'),util[_0xb38f('0xd2')](_0x441a4b['query'],{'showHidden':![],'depth':null}));};break;}return _0xb43751;}})[_0xb38f('0x20')](respondWithResult(_0x639cc4,null))[_0xb38f('0x2a')](handleError(_0x639cc4,null));};exports[_0xb38f('0xdb')]=function(_0x56860b,_0x353981,_0x2b96cb){return db[_0xb38f('0x51')][_0xb38f('0x56')]({'where':{'id':_0x56860b[_0xb38f('0x55')]['id']}})['then'](handleEntityNotFound(_0x353981,null))[_0xb38f('0x20')](function(_0x1c907a){if(_0x1c907a){return _0x1c907a['addAgents'](_0x56860b['body'][_0xb38f('0x68')],_['omit'](_0x56860b[_0xb38f('0x58')],['ids','id'])||{})[_0xb38f('0x9c')](function(_0x414b2b){for(var _0x4e22db=0x0;_0x4e22db<_0x56860b[_0xb38f('0x58')][_0xb38f('0x68')][_0xb38f('0x48')];_0x4e22db+=0x1){socket[_0xb38f('0xdc')]('userSmsAccount:save',{'UserId':Number(_0x56860b[_0xb38f('0x58')][_0xb38f('0x68')][_0x4e22db]),'SmsAccountId':Number(_0x56860b[_0xb38f('0x55')]['id'])});}return _0x414b2b;});}})[_0xb38f('0x20')](respondWithResult(_0x353981,null))['catch'](handleError(_0x353981,null));};exports[_0xb38f('0xdd')]=function(_0x1c0718,_0x12869d,_0x317b2c){return db['SmsAccount'][_0xb38f('0x56')]({'where':{'id':_0x1c0718['params']['id']}})['then'](handleEntityNotFound(_0x12869d,null))[_0xb38f('0x20')](function(_0x4a0f42){if(_0x4a0f42){return _0x4a0f42['removeAgents'](_0x1c0718[_0xb38f('0x42')][_0xb38f('0x68')])[_0xb38f('0x20')](function(){if(_[_0xb38f('0xde')](_0x1c0718[_0xb38f('0x42')][_0xb38f('0x68')])){for(var _0x1e0c7f=0x0;_0x1e0c7f<_0x1c0718[_0xb38f('0x42')][_0xb38f('0x68')][_0xb38f('0x48')];_0x1e0c7f+=0x1){socket[_0xb38f('0xdc')](_0xb38f('0xdf'),{'UserId':Number(_0x1c0718[_0xb38f('0x42')]['ids'][_0x1e0c7f]),'SmsAccountId':Number(_0x1c0718[_0xb38f('0x55')]['id'])});}}else{socket['emit'](_0xb38f('0xdf'),{'UserId':Number(_0x1c0718['query'][_0xb38f('0x68')]),'SmsAccountId':Number(_0x1c0718[_0xb38f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x12869d,null))[_0xb38f('0x2a')](handleError(_0x12869d,null));};exports[_0xb38f('0xe0')]=function(_0x3f8525,_0x21fa1d,_0x13f4bf){var _0x8d91c2={};var _0x47f1e4={};var _0x5320f1;var _0x36cf33;return db[_0xb38f('0x51')][_0xb38f('0x63')]({'where':{'id':_0x3f8525[_0xb38f('0x55')]['id']}})[_0xb38f('0x20')](handleEntityNotFound(_0x21fa1d,null))[_0xb38f('0x20')](function(_0x52242e){if(_0x52242e){_0x5320f1=_0x52242e;_0x47f1e4[_0xb38f('0x40')]=_[_0xb38f('0x43')](db['User'][_0xb38f('0xb9')]);_0x47f1e4['query']=_['keys'](_0x3f8525['query']);_0x47f1e4[_0xb38f('0x44')]=_[_0xb38f('0x45')](_0x47f1e4['model'],_0x47f1e4[_0xb38f('0x42')]);_0x8d91c2[_0xb38f('0x47')]=_['intersection'](_0x47f1e4[_0xb38f('0x40')],qs[_0xb38f('0x46')](_0x3f8525[_0xb38f('0x42')]['fields']));_0x8d91c2[_0xb38f('0x47')]=_0x8d91c2[_0xb38f('0x47')][_0xb38f('0x48')]?_0x8d91c2[_0xb38f('0x47')]:_0x47f1e4['model'];_0x8d91c2[_0xb38f('0x4a')]=qs[_0xb38f('0x64')](_0x3f8525[_0xb38f('0x42')][_0xb38f('0x64')]);_0x8d91c2['where']=qs['filters'](_[_0xb38f('0x4c')](_0x3f8525['query'],_0x47f1e4['filters']));if(_0x3f8525[_0xb38f('0x42')][_0xb38f('0x4d')]){_0x8d91c2[_0xb38f('0x4b')]=_['merge'](_0x8d91c2['where'],{'$or':_[_0xb38f('0x41')](_0x8d91c2[_0xb38f('0x47')],function(_0x4e34a0){var _0x344fa0={};_0x344fa0[_0x4e34a0]={'$like':'%'+_0x3f8525[_0xb38f('0x42')][_0xb38f('0x4d')]+'%'};return _0x344fa0;})});}_0x8d91c2=_[_0xb38f('0x4e')]({},_0x8d91c2,_0x3f8525[_0xb38f('0x50')]);return _0x5320f1[_0xb38f('0xe0')](_0x8d91c2);}})[_0xb38f('0x20')](function(_0x26be11){if(_0x26be11){_0x36cf33=_0x26be11[_0xb38f('0x48')];if(!_0x3f8525[_0xb38f('0x42')]['hasOwnProperty'](_0xb38f('0x49'))){_0x8d91c2[_0xb38f('0x31')]=qs['limit'](_0x3f8525[_0xb38f('0x42')]['limit']);_0x8d91c2[_0xb38f('0x30')]=qs[_0xb38f('0x30')](_0x3f8525['query']['offset']);}return _0x5320f1[_0xb38f('0xe0')](_0x8d91c2);}})['then'](function(_0x223d84){if(_0x223d84){return _0x223d84?{'count':_0x36cf33,'rows':_0x223d84}:null;}})['then'](respondWithResult(_0x21fa1d,null))[_0xb38f('0x2a')](handleError(_0x21fa1d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 323d4b5..36fbd77 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 _0xd861=['emit','hook','../../mysqldb','setMaxListeners','save','remove'];(function(_0x2be70d,_0x1a8d5d){var _0x902636=function(_0x4efb74){while(--_0x4efb74){_0x2be70d['push'](_0x2be70d['shift']());}};_0x902636(++_0x1a8d5d);}(_0xd861,0x1c4));var _0x1d86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd861[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x1d86('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1d86('0x1')](0x0);var events={'afterCreate':_0x1d86('0x2'),'afterUpdate':'update','afterDestroy':_0x1d86('0x3')};function emitEvent(_0xd42d5c){return function(_0x4a485f,_0x3191b1,_0x243eb9){SmsAccountEvents['emit'](_0xd42d5c+':'+_0x4a485f['id'],_0x4a485f);SmsAccountEvents[_0x1d86('0x4')](_0xd42d5c,_0x4a485f);_0x243eb9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x1d86('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x6328=['../../mysqldb','SmsAccount','setMaxListeners','remove','emit','events'];(function(_0x31db46,_0x3f11c3){var _0x47f4ff=function(_0x2794ae){while(--_0x2794ae){_0x31db46['push'](_0x31db46['shift']());}};_0x47f4ff(++_0x3f11c3);}(_0x6328,0x197));var _0x8632=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0x6328[_0x1305e3];return _0x1068e9;};'use strict';var EventEmitter=require(_0x8632('0x0'));var SmsAccount=require(_0x8632('0x1'))['db'][_0x8632('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8632('0x4')};function emitEvent(_0x393733){return function(_0x1c063b,_0x5cb7ed,_0x1412a5){SmsAccountEvents[_0x8632('0x5')](_0x393733+':'+_0x1c063b['id'],_0x1c063b);SmsAccountEvents['emit'](_0x393733,_0x1c063b);_0x1412a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0c88f47..9633235 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 _0x5b17=['api','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','sms_accounts','util','../../config/logger'];(function(_0x2051c2,_0x2ba395){var _0x15a43f=function(_0x2c9c95){while(--_0x2c9c95){_0x2051c2['push'](_0x2051c2['shift']());}};_0x15a43f(++_0x2ba395);}(_0x5b17,0x174));var _0x75b1=function(_0x23c3ea,_0x587d81){_0x23c3ea=_0x23c3ea-0x0;var _0x2eca1c=_0x5b17[_0x23c3ea];return _0x2eca1c;};'use strict';var _=require('lodash');var util=require(_0x75b1('0x0'));var logger=require(_0x75b1('0x1'))(_0x75b1('0x2'));var moment=require(_0x75b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x75b1('0x4'));var fs=require('fs');var path=require(_0x75b1('0x5'));var rimraf=require(_0x75b1('0x6'));var config=require(_0x75b1('0x7'));var attributes=require(_0x75b1('0x8'));module[_0x75b1('0x9')]=function(_0x3dc170,_0x337180){return _0x3dc170['define']('SmsAccount',attributes,{'tableName':_0x75b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9874=['rimraf','./smsAccount.attributes','define','sms_accounts','util','../../config/logger','moment','request-promise','path'];(function(_0x396e8c,_0x40b46f){var _0x1415c2=function(_0x4e93ee){while(--_0x4e93ee){_0x396e8c['push'](_0x396e8c['shift']());}};_0x1415c2(++_0x40b46f);}(_0x9874,0x1a2));var _0x4987=function(_0x390392,_0x25e8b7){_0x390392=_0x390392-0x0;var _0xe96e47=_0x9874[_0x390392];return _0xe96e47;};'use strict';var _=require('lodash');var util=require(_0x4987('0x0'));var logger=require(_0x4987('0x1'))('api');var moment=require(_0x4987('0x2'));var BPromise=require('bluebird');var rp=require(_0x4987('0x3'));var fs=require('fs');var path=require(_0x4987('0x4'));var rimraf=require(_0x4987('0x5'));var config=require('../../config/environment');var attributes=require(_0x4987('0x6'));module['exports']=function(_0x27255b,_0x26041b){return _0x27255b[_0x4987('0x7')]('SmsAccount',attributes,{'tableName':_0x4987('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index f755e7c..b321850 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 _0x89d9=['model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','options','where','attributes','include','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89d9,0x64));var _0x989d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x89d9[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x989d('0x0'));var util=require(_0x989d('0x1'));var moment=require(_0x989d('0x2'));var BPromise=require('bluebird');var rs=require(_0x989d('0x3'));var fs=require('fs');var Redis=require(_0x989d('0x4'));var db=require(_0x989d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x989d('0x6'))('rpc');var config=require(_0x989d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x989d('0x8')][_0x989d('0x9')]({'port':0x232a});config[_0x989d('0xa')]=_[_0x989d('0xb')](config[_0x989d('0xa')],{'host':_0x989d('0xc'),'port':0x18eb});var socket=require(_0x989d('0xd'))(new Redis(config[_0x989d('0xa')]));require('./smsAccount.socket')[_0x989d('0xe')](socket);function respondWithRpcPromise(_0x5a8969,_0x2c2052,_0x5aa39f){return new BPromise(function(_0x58455c,_0x24b247){return client[_0x989d('0xf')](_0x5a8969,_0x5aa39f)[_0x989d('0x10')](function(_0x577244){logger[_0x989d('0x11')]('SmsAccount,\x20%s,\x20%s',_0x2c2052,_0x989d('0x12'));logger[_0x989d('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2c2052,_0x989d('0x12'),JSON[_0x989d('0x14')](_0x577244));if(_0x577244[_0x989d('0x15')]){if(_0x577244[_0x989d('0x15')]['code']===0x1f4){logger[_0x989d('0x15')](_0x989d('0x16'),_0x2c2052,_0x577244[_0x989d('0x15')]['message']);return _0x24b247(_0x577244['error'][_0x989d('0x17')]);}logger[_0x989d('0x15')](_0x989d('0x16'),_0x2c2052,_0x577244[_0x989d('0x15')]['message']);return _0x58455c(_0x577244[_0x989d('0x15')][_0x989d('0x17')]);}else{logger['info'](_0x989d('0x16'),_0x2c2052,'request\x20sent');_0x58455c(_0x577244['result'][_0x989d('0x17')]);}})[_0x989d('0x18')](function(_0x2586aa){logger[_0x989d('0x15')](_0x989d('0x16'),_0x2c2052,_0x2586aa);_0x24b247(_0x2586aa);});});}exports[_0x989d('0x19')]=function(_0x7130ec){var _0x256310=this;return new Promise(function(_0x420f31,_0x4a2c31){return db[_0x989d('0x1a')]['find']({'raw':_0x7130ec['options']?_0x7130ec[_0x989d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x7130ec[_0x989d('0x1b')]?_0x7130ec[_0x989d('0x1b')][_0x989d('0x1c')]||null:null,'attributes':_0x7130ec[_0x989d('0x1b')]?_0x7130ec[_0x989d('0x1b')][_0x989d('0x1d')]||null:null,'include':_0x7130ec[_0x989d('0x1b')]?_0x7130ec[_0x989d('0x1b')][_0x989d('0x1e')]?_[_0x989d('0x1f')](_0x7130ec[_0x989d('0x1b')]['include'],function(_0x1817b5){return{'model':db[_0x1817b5[_0x989d('0x20')]],'as':_0x1817b5['as'],'attributes':_0x1817b5['attributes'],'include':_0x1817b5[_0x989d('0x1e')]?_[_0x989d('0x1f')](_0x1817b5[_0x989d('0x1e')],function(_0x2d5c76){return{'model':db[_0x2d5c76[_0x989d('0x20')]],'as':_0x2d5c76['as'],'attributes':_0x2d5c76[_0x989d('0x1d')],'include':_0x2d5c76[_0x989d('0x1e')]?_[_0x989d('0x1f')](_0x2d5c76[_0x989d('0x1e')],function(_0x5a446d){return{'model':db[_0x5a446d[_0x989d('0x20')]],'as':_0x5a446d['as'],'attributes':_0x5a446d['attributes']};}):[]};}):[]};}):[]:[]})[_0x989d('0x10')](function(_0x27dcef){logger[_0x989d('0x11')](_0x989d('0x19'),_0x7130ec);logger[_0x989d('0x13')](_0x989d('0x19'),_0x7130ec,JSON[_0x989d('0x14')](_0x27dcef));_0x420f31(_0x27dcef);})['catch'](function(_0x447e7b){logger[_0x989d('0x15')]('ShowSmsAccount',_0x447e7b[_0x989d('0x17')],_0x7130ec);_0x4a2c31(_0x256310[_0x989d('0x15')](0x1f4,_0x447e7b['message']));});});}; \ No newline at end of file +var _0xe8fa=['SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','include','map','model','attributes','then','debug','stringify','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','info'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0xe8fa,0x1f4));var _0xae8f=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xe8fa[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae8f('0x0'));var BPromise=require(_0xae8f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae8f('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xae8f('0x3'));var config=require(_0xae8f('0x4'));var jayson=require(_0xae8f('0x5'));var client=jayson['client'][_0xae8f('0x6')]({'port':0x232a});config['redis']=_[_0xae8f('0x7')](config[_0xae8f('0x8')],{'host':_0xae8f('0x9'),'port':0x18eb});var socket=require(_0xae8f('0xa'))(new Redis(config[_0xae8f('0x8')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x430db7,_0x685890,_0x515e23){return new BPromise(function(_0x5af412,_0x5d90c1){return client['request'](_0x430db7,_0x515e23)['then'](function(_0x4760f1){logger[_0xae8f('0xb')](_0xae8f('0xc'),_0x685890,_0xae8f('0xd'));logger['debug'](_0xae8f('0xe'),_0x685890,'request\x20sent',JSON['stringify'](_0x4760f1));if(_0x4760f1['error']){if(_0x4760f1['error'][_0xae8f('0xf')]===0x1f4){logger[_0xae8f('0x10')](_0xae8f('0xc'),_0x685890,_0x4760f1['error'][_0xae8f('0x11')]);return _0x5d90c1(_0x4760f1[_0xae8f('0x10')][_0xae8f('0x11')]);}logger['error'](_0xae8f('0xc'),_0x685890,_0x4760f1[_0xae8f('0x10')][_0xae8f('0x11')]);return _0x5af412(_0x4760f1[_0xae8f('0x10')][_0xae8f('0x11')]);}else{logger[_0xae8f('0xb')](_0xae8f('0xc'),_0x685890,_0xae8f('0xd'));_0x5af412(_0x4760f1[_0xae8f('0x12')][_0xae8f('0x11')]);}})[_0xae8f('0x13')](function(_0x319d10){logger[_0xae8f('0x10')](_0xae8f('0xc'),_0x685890,_0x319d10);_0x5d90c1(_0x319d10);});});}exports[_0xae8f('0x14')]=function(_0x412e3a){var _0x5055d6=this;return new Promise(function(_0x51e2e9,_0x376355){return db[_0xae8f('0x15')][_0xae8f('0x16')]({'raw':_0x412e3a[_0xae8f('0x17')]?_0x412e3a[_0xae8f('0x17')][_0xae8f('0x18')]===undefined?!![]:![]:!![],'where':_0x412e3a[_0xae8f('0x17')]?_0x412e3a[_0xae8f('0x17')]['where']||null:null,'attributes':_0x412e3a[_0xae8f('0x17')]?_0x412e3a[_0xae8f('0x17')]['attributes']||null:null,'include':_0x412e3a[_0xae8f('0x17')]?_0x412e3a[_0xae8f('0x17')][_0xae8f('0x19')]?_[_0xae8f('0x1a')](_0x412e3a[_0xae8f('0x17')]['include'],function(_0x44d8ed){return{'model':db[_0x44d8ed[_0xae8f('0x1b')]],'as':_0x44d8ed['as'],'attributes':_0x44d8ed[_0xae8f('0x1c')],'include':_0x44d8ed[_0xae8f('0x19')]?_[_0xae8f('0x1a')](_0x44d8ed[_0xae8f('0x19')],function(_0x41baa9){return{'model':db[_0x41baa9[_0xae8f('0x1b')]],'as':_0x41baa9['as'],'attributes':_0x41baa9['attributes'],'include':_0x41baa9['include']?_[_0xae8f('0x1a')](_0x41baa9[_0xae8f('0x19')],function(_0x4ee25a){return{'model':db[_0x4ee25a['model']],'as':_0x4ee25a['as'],'attributes':_0x4ee25a['attributes']};}):[]};}):[]};}):[]:[]})[_0xae8f('0x1d')](function(_0xf16a03){logger[_0xae8f('0xb')](_0xae8f('0x14'),_0x412e3a);logger[_0xae8f('0x1e')](_0xae8f('0x14'),_0x412e3a,JSON[_0xae8f('0x1f')](_0xf16a03));_0x51e2e9(_0xf16a03);})[_0xae8f('0x13')](function(_0x54b6c5){logger[_0xae8f('0x10')](_0xae8f('0x14'),_0x54b6c5[_0xae8f('0x11')],_0x412e3a);_0x376355(_0x5055d6[_0xae8f('0x10')](0x1f4,_0x54b6c5[_0xae8f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bd08b6e..703cdf2 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 d1c7571..7c2d7a2 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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x581df7,_0x45a97b){var _0x23f532=function(_0x20ce60){while(--_0x20ce60){_0x581df7['push'](_0x581df7['shift']());}};_0x23f532(++_0x45a97b);}(_0x55ca,0x126));var _0xa55c=function(_0x37e9c1,_0x20ff2a){_0x37e9c1=_0x37e9c1-0x0;var _0x3b12bd=_0x55ca[_0x37e9c1];return _0x3b12bd;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x25b444,_0x20da5e){var _0x425f88=function(_0xe4183e){while(--_0xe4183e){_0x25b444['push'](_0x25b444['shift']());}};_0x425f88(++_0x20da5e);}(_0x3e74,0x175));var _0x43e7=function(_0x3f25c7,_0x54dc29){_0x3f25c7=_0x3f25c7-0x0;var _0x5b90ee=_0x3e74[_0x3f25c7];return _0x5b90ee;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b1acfe9..e0d8409 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 _0xdb51=['INTEGER','STRING','noop','sequelize'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0xdb51,0x6b));var _0x1db5=function(_0xa4a9ef,_0x38a8c4){_0xa4a9ef=_0xa4a9ef-0x0;var _0x3c636a=_0xdb51[_0xa4a9ef];return _0x3c636a;};'use strict';var Sequelize=require(_0x1db5('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1db5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1db5('0x2')],'allowNull':![],'defaultValue':_0x1db5('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1db5('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x72a6=['*,*,*,*','exports','noop','TEXT','STRING'];(function(_0x1e93fa,_0x210f48){var _0xd4e1e6=function(_0x3149da){while(--_0x3149da){_0x1e93fa['push'](_0x1e93fa['shift']());}};_0xd4e1e6(++_0x210f48);}(_0x72a6,0x9c));var _0x672a=function(_0x5b652e,_0x4d565f){_0x5b652e=_0x5b652e-0x0;var _0x327110=_0x72a6[_0x5b652e];return _0x327110;};'use strict';var Sequelize=require('sequelize');module[_0x672a('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x672a('0x1')},'appdata':{'type':Sequelize[_0x672a('0x2')]()},'description':{'type':Sequelize[_0x672a('0x3')]},'interval':{'type':Sequelize[_0x672a('0x3')],'defaultValue':_0x672a('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index aae8ec3..91925dc 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 _0x07af=['eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','SmsApplication','includeAll','include','findAll','catch','params','keys','create','body','find'];(function(_0x5ddef9,_0x5984cb){var _0x344fb2=function(_0xa06a86){while(--_0xa06a86){_0x5ddef9['push'](_0x5ddef9['shift']());}};_0x344fb2(++_0x5984cb);}(_0x07af,0xd5));var _0xf07a=function(_0x2bc14d,_0x26f23e){_0x2bc14d=_0x2bc14d-0x0;var _0x54caa4=_0x07af[_0x2bc14d];return _0x54caa4;};'use strict';var emlformat=require(_0xf07a('0x0'));var rimraf=require(_0xf07a('0x1'));var zipdir=require(_0xf07a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf07a('0x3'));var moment=require('moment');var BPromise=require(_0xf07a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf07a('0x5'));var sox=require(_0xf07a('0x6'));var csv=require(_0xf07a('0x7'));var ejs=require(_0xf07a('0x8'));var fs=require('fs');var fs_extra=require(_0xf07a('0x9'));var _=require(_0xf07a('0xa'));var squel=require(_0xf07a('0xb'));var crypto=require(_0xf07a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf07a('0x7'));var querystring=require(_0xf07a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf07a('0xe'));var qs=require(_0xf07a('0xf'));var as=require(_0xf07a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf07a('0x11'))(_0xf07a('0x12'));var utils=require(_0xf07a('0x13'));var config=require(_0xf07a('0x14'));var licenseUtil=require(_0xf07a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40e048,_0x48a5cf){_0x48a5cf=_0x48a5cf||0xcc;return function(_0x41a772){if(_0x41a772){return _0x40e048[_0xf07a('0x16')](_0x48a5cf);}return _0x40e048[_0xf07a('0x17')](_0x48a5cf)['end']();};}function respondWithResult(_0x57867c,_0xfd9e38){_0xfd9e38=_0xfd9e38||0xc8;return function(_0x447c5e){if(_0x447c5e){return _0x57867c[_0xf07a('0x17')](_0xfd9e38)[_0xf07a('0x18')](_0x447c5e);}};}function respondWithFilteredResult(_0x1de4b0,_0x3e8534){return function(_0xcefa3c){if(_0xcefa3c){var _0x2a20f6=typeof _0x3e8534[_0xf07a('0x19')]==='undefined'&&typeof _0x3e8534[_0xf07a('0x1a')]===_0xf07a('0x1b');var _0x2c167b=_0xcefa3c[_0xf07a('0x1c')];var _0x355202=_0x2a20f6?0x0:_0x3e8534[_0xf07a('0x19')];var _0x58a2c8=_0x2a20f6?_0xcefa3c[_0xf07a('0x1c')]:_0x3e8534[_0xf07a('0x19')]+_0x3e8534[_0xf07a('0x1a')];var _0x216629;if(_0x58a2c8>=_0x2c167b){_0x58a2c8=_0x2c167b;_0x216629=0xc8;}else{_0x216629=0xce;}_0x1de4b0[_0xf07a('0x17')](_0x216629);return _0x1de4b0[_0xf07a('0x1d')](_0xf07a('0x1e'),_0x355202+'-'+_0x58a2c8+'/'+_0x2c167b)[_0xf07a('0x18')](_0xcefa3c);}return null;};}function patchUpdates(_0x3e97f3){return function(_0x4417c5){try{jsonpatch[_0xf07a('0x1f')](_0x4417c5,_0x3e97f3,!![]);}catch(_0x556f65){return BPromise[_0xf07a('0x20')](_0x556f65);}return _0x4417c5[_0xf07a('0x21')]();};}function saveUpdates(_0x3d2ead,_0x286005){return function(_0x316afc){if(_0x316afc){return _0x316afc[_0xf07a('0x22')](_0x3d2ead)['then'](function(_0x221238){return _0x221238;});}return null;};}function removeEntity(_0x29a9bb,_0x3aad29){return function(_0x20be61){if(_0x20be61){return _0x20be61[_0xf07a('0x23')]()[_0xf07a('0x24')](function(){_0x29a9bb[_0xf07a('0x17')](0xcc)[_0xf07a('0x25')]();});}};}function handleEntityNotFound(_0x49a1aa,_0x5efeb3){return function(_0x162545){if(!_0x162545){_0x49a1aa[_0xf07a('0x16')](0x194);}return _0x162545;};}function handleError(_0x33cc21,_0x44f5d9){_0x44f5d9=_0x44f5d9||0x1f4;return function(_0x494f78){logger[_0xf07a('0x26')](_0x494f78[_0xf07a('0x27')]);if(_0x494f78[_0xf07a('0x28')]){delete _0x494f78[_0xf07a('0x28')];}_0x33cc21[_0xf07a('0x17')](_0x44f5d9)[_0xf07a('0x29')](_0x494f78);};}exports[_0xf07a('0x2a')]=function(_0x2c2273,_0xcd6e52){var _0x10c8d6={},_0x5ca02c={},_0x7013b3={'count':0x0,'rows':[]};var _0x578a78=_['map'](db['SmsApplication']['rawAttributes'],function(_0x9bdb32){return{'name':_0x9bdb32[_0xf07a('0x2b')],'type':_0x9bdb32[_0xf07a('0x2c')]['key']};});_0x5ca02c[_0xf07a('0x2d')]=_[_0xf07a('0x2e')](_0x578a78,_0xf07a('0x28'));_0x5ca02c['query']=_['keys'](_0x2c2273[_0xf07a('0x2f')]);_0x5ca02c[_0xf07a('0x30')]=_[_0xf07a('0x31')](_0x5ca02c[_0xf07a('0x2d')],_0x5ca02c['query']);_0x10c8d6[_0xf07a('0x32')]=_[_0xf07a('0x31')](_0x5ca02c[_0xf07a('0x2d')],qs[_0xf07a('0x33')](_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x33')]));_0x10c8d6[_0xf07a('0x32')]=_0x10c8d6[_0xf07a('0x32')][_0xf07a('0x34')]?_0x10c8d6[_0xf07a('0x32')]:_0x5ca02c[_0xf07a('0x2d')];if(!_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x35')]('nolimit')){_0x10c8d6[_0xf07a('0x1a')]=qs[_0xf07a('0x1a')](_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x1a')]);_0x10c8d6[_0xf07a('0x19')]=qs[_0xf07a('0x19')](_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x19')]);}_0x10c8d6[_0xf07a('0x36')]=qs[_0xf07a('0x37')](_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x37')]);_0x10c8d6[_0xf07a('0x38')]=qs[_0xf07a('0x30')](_[_0xf07a('0x39')](_0x2c2273[_0xf07a('0x2f')],_0x5ca02c[_0xf07a('0x30')]),_0x578a78);if(_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x3a')]){_0x10c8d6[_0xf07a('0x38')]=_[_0xf07a('0x3b')](_0x10c8d6[_0xf07a('0x38')],{'$or':_['map'](_0x578a78,function(_0xa1757e){if(_0xa1757e['type']!=='VIRTUAL'){var _0x1e6ef9={};_0x1e6ef9[_0xa1757e[_0xf07a('0x28')]]={'$like':'%'+_0x2c2273[_0xf07a('0x2f')]['filter']+'%'};return _0x1e6ef9;}})});}_0x10c8d6=_[_0xf07a('0x3b')]({},_0x10c8d6,_0x2c2273[_0xf07a('0x3c')]);var _0x67c9d6={'where':_0x10c8d6[_0xf07a('0x38')]};return db[_0xf07a('0x3d')][_0xf07a('0x1c')](_0x67c9d6)['then'](function(_0x13ca59){_0x7013b3['count']=_0x13ca59;if(_0x2c2273[_0xf07a('0x2f')][_0xf07a('0x3e')]){_0x10c8d6[_0xf07a('0x3f')]=[{'all':!![]}];}return db[_0xf07a('0x3d')][_0xf07a('0x40')](_0x10c8d6);})[_0xf07a('0x24')](function(_0x7d33d4){_0x7013b3['rows']=_0x7d33d4;return _0x7013b3;})[_0xf07a('0x24')](respondWithFilteredResult(_0xcd6e52,_0x10c8d6))[_0xf07a('0x41')](handleError(_0xcd6e52,null));};exports['show']=function(_0x2810d3,_0x37c55e){var _0x448937={'raw':!![],'where':{'id':_0x2810d3[_0xf07a('0x42')]['id']}},_0x39fe39={};_0x39fe39[_0xf07a('0x2d')]=_[_0xf07a('0x43')](db['SmsApplication']['rawAttributes']);_0x39fe39[_0xf07a('0x2f')]=_[_0xf07a('0x43')](_0x2810d3[_0xf07a('0x2f')]);_0x39fe39[_0xf07a('0x30')]=_[_0xf07a('0x31')](_0x39fe39[_0xf07a('0x2d')],_0x39fe39[_0xf07a('0x2f')]);_0x448937[_0xf07a('0x32')]=_[_0xf07a('0x31')](_0x39fe39['model'],qs[_0xf07a('0x33')](_0x2810d3[_0xf07a('0x2f')]['fields']));_0x448937[_0xf07a('0x32')]=_0x448937[_0xf07a('0x32')]['length']?_0x448937[_0xf07a('0x32')]:_0x39fe39[_0xf07a('0x2d')];if(_0x2810d3['query'][_0xf07a('0x3e')]){_0x448937[_0xf07a('0x3f')]=[{'all':!![]}];}_0x448937=_[_0xf07a('0x3b')]({},_0x448937,_0x2810d3[_0xf07a('0x3c')]);return db['SmsApplication']['find'](_0x448937)[_0xf07a('0x24')](handleEntityNotFound(_0x37c55e,null))[_0xf07a('0x24')](respondWithResult(_0x37c55e,null))['catch'](handleError(_0x37c55e,null));};exports[_0xf07a('0x44')]=function(_0x1a3340,_0x4398f9){return db[_0xf07a('0x3d')][_0xf07a('0x44')](_0x1a3340[_0xf07a('0x45')],{})[_0xf07a('0x24')](respondWithResult(_0x4398f9,0xc9))[_0xf07a('0x41')](handleError(_0x4398f9,null));};exports[_0xf07a('0x22')]=function(_0x3a4bf0,_0x14cbe4){if(_0x3a4bf0[_0xf07a('0x45')]['id']){delete _0x3a4bf0[_0xf07a('0x45')]['id'];}return db['SmsApplication'][_0xf07a('0x46')]({'where':{'id':_0x3a4bf0[_0xf07a('0x42')]['id']}})[_0xf07a('0x24')](handleEntityNotFound(_0x14cbe4,null))['then'](saveUpdates(_0x3a4bf0['body'],null))[_0xf07a('0x24')](respondWithResult(_0x14cbe4,null))[_0xf07a('0x41')](handleError(_0x14cbe4,null));};exports['destroy']=function(_0x2687c2,_0x5853aa){return db[_0xf07a('0x3d')][_0xf07a('0x46')]({'where':{'id':_0x2687c2['params']['id']}})['then'](handleEntityNotFound(_0x5853aa,null))[_0xf07a('0x24')](removeEntity(_0x5853aa,null))['catch'](handleError(_0x5853aa,null));}; \ No newline at end of file +var _0x513a=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','apply','reject','save','update','destroy','then','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','findAll','catch','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse'];(function(_0x418b76,_0x2f38c9){var _0xc65645=function(_0x19d658){while(--_0x19d658){_0x418b76['push'](_0x418b76['shift']());}};_0xc65645(++_0x2f38c9);}(_0x513a,0x1da));var _0xa513=function(_0x916690,_0x55c8db){_0x916690=_0x916690-0x0;var _0x278f95=_0x513a[_0x916690];return _0x278f95;};'use strict';var emlformat=require(_0xa513('0x0'));var rimraf=require(_0xa513('0x1'));var zipdir=require(_0xa513('0x2'));var jsonpatch=require(_0xa513('0x3'));var rp=require(_0xa513('0x4'));var moment=require(_0xa513('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa513('0x6'));var util=require(_0xa513('0x7'));var path=require(_0xa513('0x8'));var sox=require(_0xa513('0x9'));var csv=require(_0xa513('0xa'));var ejs=require(_0xa513('0xb'));var fs=require('fs');var fs_extra=require(_0xa513('0xc'));var _=require(_0xa513('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa513('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa513('0xa'));var querystring=require('querystring');var Papa=require(_0xa513('0xf'));var Redis=require('ioredis');var authService=require(_0xa513('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa513('0x11'));var hardwareService=require(_0xa513('0x12'));var logger=require(_0xa513('0x13'))(_0xa513('0x14'));var utils=require(_0xa513('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa513('0x16'));var db=require(_0xa513('0x17'))['db'];function respondWithStatusCode(_0x25334c,_0x128793){_0x128793=_0x128793||0xcc;return function(_0x3dba5b){if(_0x3dba5b){return _0x25334c['sendStatus'](_0x128793);}return _0x25334c['status'](_0x128793)[_0xa513('0x18')]();};}function respondWithResult(_0x205970,_0x36b381){_0x36b381=_0x36b381||0xc8;return function(_0x1bc494){if(_0x1bc494){return _0x205970['status'](_0x36b381)[_0xa513('0x19')](_0x1bc494);}};}function respondWithFilteredResult(_0xb0e7e7,_0x402219){return function(_0x2f78dd){if(_0x2f78dd){var _0x3d6028=typeof _0x402219[_0xa513('0x1a')]===_0xa513('0x1b')&&typeof _0x402219[_0xa513('0x1c')]==='undefined';var _0x3f6ac5=_0x2f78dd['count'];var _0x37ed97=_0x3d6028?0x0:_0x402219[_0xa513('0x1a')];var _0x38b3cb=_0x3d6028?_0x2f78dd[_0xa513('0x1d')]:_0x402219[_0xa513('0x1a')]+_0x402219['limit'];var _0xd573f5;if(_0x38b3cb>=_0x3f6ac5){_0x38b3cb=_0x3f6ac5;_0xd573f5=0xc8;}else{_0xd573f5=0xce;}_0xb0e7e7[_0xa513('0x1e')](_0xd573f5);return _0xb0e7e7['set']('Content-Range',_0x37ed97+'-'+_0x38b3cb+'/'+_0x3f6ac5)['json'](_0x2f78dd);}return null;};}function patchUpdates(_0x34ba0e){return function(_0x57cc05){try{jsonpatch[_0xa513('0x1f')](_0x57cc05,_0x34ba0e,!![]);}catch(_0x57c13b){return BPromise[_0xa513('0x20')](_0x57c13b);}return _0x57cc05[_0xa513('0x21')]();};}function saveUpdates(_0x33fa28,_0x3f20c0){return function(_0x52de81){if(_0x52de81){return _0x52de81[_0xa513('0x22')](_0x33fa28)['then'](function(_0x1f5fe1){return _0x1f5fe1;});}return null;};}function removeEntity(_0x4561c3,_0x47ea0b){return function(_0x5dde7d){if(_0x5dde7d){return _0x5dde7d[_0xa513('0x23')]()[_0xa513('0x24')](function(){_0x4561c3[_0xa513('0x1e')](0xcc)[_0xa513('0x18')]();});}};}function handleEntityNotFound(_0x5edcd4,_0x29ee98){return function(_0x1e30ee){if(!_0x1e30ee){_0x5edcd4['sendStatus'](0x194);}return _0x1e30ee;};}function handleError(_0x1e868f,_0x2d9401){_0x2d9401=_0x2d9401||0x1f4;return function(_0x40380a){logger['error'](_0x40380a[_0xa513('0x25')]);if(_0x40380a[_0xa513('0x26')]){delete _0x40380a['name'];}_0x1e868f['status'](_0x2d9401)[_0xa513('0x27')](_0x40380a);};}exports[_0xa513('0x28')]=function(_0x16c6f0,_0xfbc341){var _0x6f61b={},_0x5733b5={},_0x12a445={'count':0x0,'rows':[]};var _0x1ff70e=_[_0xa513('0x29')](db[_0xa513('0x2a')][_0xa513('0x2b')],function(_0x201344){return{'name':_0x201344[_0xa513('0x2c')],'type':_0x201344['type'][_0xa513('0x2d')]};});_0x5733b5['model']=_[_0xa513('0x29')](_0x1ff70e,_0xa513('0x26'));_0x5733b5[_0xa513('0x2e')]=_['keys'](_0x16c6f0[_0xa513('0x2e')]);_0x5733b5[_0xa513('0x2f')]=_[_0xa513('0x30')](_0x5733b5['model'],_0x5733b5[_0xa513('0x2e')]);_0x6f61b[_0xa513('0x31')]=_[_0xa513('0x30')](_0x5733b5[_0xa513('0x32')],qs[_0xa513('0x33')](_0x16c6f0['query']['fields']));_0x6f61b['attributes']=_0x6f61b[_0xa513('0x31')][_0xa513('0x34')]?_0x6f61b['attributes']:_0x5733b5[_0xa513('0x32')];if(!_0x16c6f0[_0xa513('0x2e')][_0xa513('0x35')](_0xa513('0x36'))){_0x6f61b[_0xa513('0x1c')]=qs[_0xa513('0x1c')](_0x16c6f0[_0xa513('0x2e')][_0xa513('0x1c')]);_0x6f61b[_0xa513('0x1a')]=qs[_0xa513('0x1a')](_0x16c6f0[_0xa513('0x2e')][_0xa513('0x1a')]);}_0x6f61b['order']=qs[_0xa513('0x37')](_0x16c6f0[_0xa513('0x2e')]['sort']);_0x6f61b[_0xa513('0x38')]=qs[_0xa513('0x2f')](_['pick'](_0x16c6f0['query'],_0x5733b5[_0xa513('0x2f')]),_0x1ff70e);if(_0x16c6f0[_0xa513('0x2e')][_0xa513('0x39')]){_0x6f61b[_0xa513('0x38')]=_[_0xa513('0x3a')](_0x6f61b[_0xa513('0x38')],{'$or':_[_0xa513('0x29')](_0x1ff70e,function(_0x197c9f){if(_0x197c9f[_0xa513('0x3b')]!==_0xa513('0x3c')){var _0x867751={};_0x867751[_0x197c9f[_0xa513('0x26')]]={'$like':'%'+_0x16c6f0[_0xa513('0x2e')]['filter']+'%'};return _0x867751;}})});}_0x6f61b=_[_0xa513('0x3a')]({},_0x6f61b,_0x16c6f0[_0xa513('0x3d')]);var _0x53ed5c={'where':_0x6f61b['where']};return db['SmsApplication'][_0xa513('0x1d')](_0x53ed5c)[_0xa513('0x24')](function(_0x429ccf){_0x12a445[_0xa513('0x1d')]=_0x429ccf;if(_0x16c6f0[_0xa513('0x2e')]['includeAll']){_0x6f61b['include']=[{'all':!![]}];}return db[_0xa513('0x2a')][_0xa513('0x3e')](_0x6f61b);})['then'](function(_0x40d1b0){_0x12a445['rows']=_0x40d1b0;return _0x12a445;})[_0xa513('0x24')](respondWithFilteredResult(_0xfbc341,_0x6f61b))[_0xa513('0x3f')](handleError(_0xfbc341,null));};exports['show']=function(_0x435e9a,_0x28346c){var _0x2e7389={'raw':!![],'where':{'id':_0x435e9a[_0xa513('0x40')]['id']}},_0x434554={};_0x434554['model']=_[_0xa513('0x41')](db['SmsApplication'][_0xa513('0x2b')]);_0x434554[_0xa513('0x2e')]=_['keys'](_0x435e9a[_0xa513('0x2e')]);_0x434554[_0xa513('0x2f')]=_['intersection'](_0x434554[_0xa513('0x32')],_0x434554[_0xa513('0x2e')]);_0x2e7389[_0xa513('0x31')]=_['intersection'](_0x434554[_0xa513('0x32')],qs['fields'](_0x435e9a['query'][_0xa513('0x33')]));_0x2e7389['attributes']=_0x2e7389[_0xa513('0x31')]['length']?_0x2e7389[_0xa513('0x31')]:_0x434554[_0xa513('0x32')];if(_0x435e9a[_0xa513('0x2e')]['includeAll']){_0x2e7389[_0xa513('0x42')]=[{'all':!![]}];}_0x2e7389=_[_0xa513('0x3a')]({},_0x2e7389,_0x435e9a[_0xa513('0x3d')]);return db[_0xa513('0x2a')]['find'](_0x2e7389)[_0xa513('0x24')](handleEntityNotFound(_0x28346c,null))[_0xa513('0x24')](respondWithResult(_0x28346c,null))[_0xa513('0x3f')](handleError(_0x28346c,null));};exports['create']=function(_0x46434b,_0x9c4d6d){return db[_0xa513('0x2a')][_0xa513('0x43')](_0x46434b['body'],{})['then'](respondWithResult(_0x9c4d6d,0xc9))[_0xa513('0x3f')](handleError(_0x9c4d6d,null));};exports[_0xa513('0x22')]=function(_0x24878f,_0x851975){if(_0x24878f[_0xa513('0x44')]['id']){delete _0x24878f['body']['id'];}return db['SmsApplication'][_0xa513('0x45')]({'where':{'id':_0x24878f['params']['id']}})[_0xa513('0x24')](handleEntityNotFound(_0x851975,null))['then'](saveUpdates(_0x24878f['body'],null))[_0xa513('0x24')](respondWithResult(_0x851975,null))[_0xa513('0x3f')](handleError(_0x851975,null));};exports[_0xa513('0x23')]=function(_0x580162,_0x39b2de){return db[_0xa513('0x2a')]['find']({'where':{'id':_0x580162[_0xa513('0x40')]['id']}})[_0xa513('0x24')](handleEntityNotFound(_0x39b2de,null))['then'](removeEntity(_0x39b2de,null))[_0xa513('0x3f')](handleError(_0x39b2de,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 59454e7..4bda9ee 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 _0x1f00=['exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x1f00,0x1bf));var _0x01f0=function(_0x16d991,_0x3f07cc){_0x16d991=_0x16d991-0x0;var _0x4f41c3=_0x1f00[_0x16d991];return _0x4f41c3;};'use strict';var _=require(_0x01f0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x01f0('0x1'));var moment=require('moment');var BPromise=require(_0x01f0('0x2'));var rp=require(_0x01f0('0x3'));var fs=require('fs');var path=require(_0x01f0('0x4'));var rimraf=require(_0x01f0('0x5'));var config=require(_0x01f0('0x6'));var attributes=require(_0x01f0('0x7'));module[_0x01f0('0x8')]=function(_0x460ee6,_0x2e8ded){return _0x460ee6['define'](_0x01f0('0x9'),attributes,{'tableName':_0x01f0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01f0('0xb'),'collate':_0x01f0('0xc')});}; \ No newline at end of file +var _0xb92e=['../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xc0213d,_0x4a3b1d){var _0x1a93c4=function(_0xc683f3){while(--_0xc683f3){_0xc0213d['push'](_0xc0213d['shift']());}};_0x1a93c4(++_0x4a3b1d);}(_0xb92e,0x72));var _0xeb92=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0xb92e[_0x284609];return _0x55116b;};'use strict';var _=require(_0xeb92('0x0'));var util=require('util');var logger=require(_0xeb92('0x1'))(_0xeb92('0x2'));var moment=require(_0xeb92('0x3'));var BPromise=require(_0xeb92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb92('0x5'));var config=require(_0xeb92('0x6'));var attributes=require(_0xeb92('0x7'));module['exports']=function(_0x53dcb0,_0x16e6ae){return _0x53dcb0['define'](_0xeb92('0x8'),attributes,{'tableName':_0xeb92('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb92('0xa'),'collate':_0xeb92('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 7110bbc..fdc37d9 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 _0xc00b=['error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d6a2e,_0x4899d1){var _0x10d015=function(_0x3eba62){while(--_0x3eba62){_0x4d6a2e['push'](_0x4d6a2e['shift']());}};_0x10d015(++_0x4899d1);}(_0xc00b,0x1e5));var _0xbc00=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0xc00b[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc00('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc00('0x2'))['db'];var utils=require(_0xbc00('0x3'));var logger=require(_0xbc00('0x4'))(_0xbc00('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc00('0x6'));var client=jayson['client'][_0xbc00('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5362c6,_0x378982,_0x3a4edb){return new BPromise(function(_0x284270,_0x221909){return client[_0xbc00('0x8')](_0x5362c6,_0x3a4edb)[_0xbc00('0x9')](function(_0x51a669){logger[_0xbc00('0xa')]('SmsApplication,\x20%s,\x20%s',_0x378982,_0xbc00('0xb'));logger[_0xbc00('0xc')](_0xbc00('0xd'),_0x378982,'request\x20sent',JSON[_0xbc00('0xe')](_0x51a669));if(_0x51a669['error']){if(_0x51a669[_0xbc00('0xf')]['code']===0x1f4){logger[_0xbc00('0xf')](_0xbc00('0x10'),_0x378982,_0x51a669[_0xbc00('0xf')]['message']);return _0x221909(_0x51a669[_0xbc00('0xf')][_0xbc00('0x11')]);}logger[_0xbc00('0xf')]('SmsApplication,\x20%s,\x20%s',_0x378982,_0x51a669[_0xbc00('0xf')][_0xbc00('0x11')]);return _0x284270(_0x51a669['error'][_0xbc00('0x11')]);}else{logger[_0xbc00('0xa')](_0xbc00('0x10'),_0x378982,_0xbc00('0xb'));_0x284270(_0x51a669[_0xbc00('0x12')][_0xbc00('0x11')]);}})[_0xbc00('0x13')](function(_0x544764){logger['error']('SmsApplication,\x20%s,\x20%s',_0x378982,_0x544764);_0x221909(_0x544764);});});} \ No newline at end of file +var _0x731b=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x731b,0xf7));var _0xb731=function(_0x57230f,_0x2a1e1a){_0x57230f=_0x57230f-0x0;var _0x48aca2=_0x731b[_0x57230f];return _0x48aca2;};'use strict';var _=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var moment=require('moment');var BPromise=require(_0xb731('0x2'));var rs=require(_0xb731('0x3'));var fs=require('fs');var Redis=require(_0xb731('0x4'));var db=require(_0xb731('0x5'))['db'];var utils=require(_0xb731('0x6'));var logger=require(_0xb731('0x7'))('rpc');var config=require(_0xb731('0x8'));var jayson=require(_0xb731('0x9'));var client=jayson[_0xb731('0xa')][_0xb731('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c59b,_0x2b475d,_0x173768){return new BPromise(function(_0x58b83c,_0x2ab04b){return client[_0xb731('0xc')](_0x12c59b,_0x173768)[_0xb731('0xd')](function(_0x26488c){logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,_0xb731('0x10'));logger[_0xb731('0x11')](_0xb731('0x12'),_0x2b475d,_0xb731('0x10'),JSON[_0xb731('0x13')](_0x26488c));if(_0x26488c[_0xb731('0x14')]){if(_0x26488c[_0xb731('0x14')][_0xb731('0x15')]===0x1f4){logger[_0xb731('0x14')]('SmsApplication,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x2ab04b(_0x26488c[_0xb731('0x14')][_0xb731('0x16')]);}logger[_0xb731('0x14')]('SmsApplication,\x20%s,\x20%s',_0x2b475d,_0x26488c[_0xb731('0x14')]['message']);return _0x58b83c(_0x26488c['error']['message']);}else{logger[_0xb731('0xe')](_0xb731('0xf'),_0x2b475d,'request\x20sent');_0x58b83c(_0x26488c[_0xb731('0x17')][_0xb731('0x16')]);}})['catch'](function(_0x30da75){logger[_0xb731('0x14')](_0xb731('0xf'),_0x2b475d,_0x30da75);_0x2ab04b(_0x30da75);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 8399e10..c28d017 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 _0x93e9=['update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x5c2d67,_0x4a050f){var _0x591b9f=function(_0xb8f9e3){while(--_0xb8f9e3){_0x5c2d67['push'](_0x5c2d67['shift']());}};_0x591b9f(++_0x4a050f);}(_0x93e9,0xcc));var _0x993e=function(_0x406318,_0x1eff12){_0x406318=_0x406318-0x0;var _0x56e1bc=_0x93e9[_0x406318];return _0x56e1bc;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getMessages']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x993e('0x11')]('/',auth['isAuthenticated'](),controller[_0x993e('0x12')]);router['post']('/:id/messages',auth[_0x993e('0xa')](),controller[_0x993e('0x13')]);router[_0x993e('0x11')](_0x993e('0x14'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x17')),controller[_0x993e('0x18')]);router[_0x993e('0x19')](_0x993e('0xd'),auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1a')),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')]('/:id',auth[_0x993e('0xa')](),interaction[_0x993e('0x15')](_0x993e('0x16'),_0x993e('0x1d')),controller[_0x993e('0x1e')]);router[_0x993e('0x1c')]('/:id/tags',auth[_0x993e('0xa')](),controller[_0x993e('0x1f')]);module[_0x993e('0x20')]=router; \ No newline at end of file +var _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x496dae,_0x3fa7ce){var _0x50a6f7=function(_0x1bb67f){while(--_0x1bb67f){_0x496dae['push'](_0x496dae['shift']());}};_0x50a6f7(++_0x3fa7ce);}(_0x6cb4,0xff));var _0x46cb=function(_0x5c3f30,_0x45cfc4){_0x5c3f30=_0x5c3f30-0x0;var _0x30c8c1=_0x6cb4[_0x5c3f30];return _0x30c8c1;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8086622..1b784d0 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 _0x42b0=['moment','BOOLEAN','STRING','DATE','ENUM','out','sequelize'];(function(_0x48db93,_0x42c34b){var _0x2907bd=function(_0x2a4da2){while(--_0x2a4da2){_0x48db93['push'](_0x48db93['shift']());}};_0x2907bd(++_0x42c34b);}(_0x42b0,0xbc));var _0x042b=function(_0x1f404a,_0x5088b2){_0x1f404a=_0x1f404a-0x0;var _0x2cdcd5=_0x42b0[_0x1f404a];return _0x2cdcd5;};'use strict';var Sequelize=require(_0x042b('0x0'));var moment=require(_0x042b('0x1'));module['exports']={'closed':{'type':Sequelize[_0x042b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x042b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x042b('0x3')]},'phone':{'type':Sequelize[_0x042b('0x3')]},'read1stAt':{'type':Sequelize[_0x042b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x042b('0x5')]('in',_0x042b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x042b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x042b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6753=['out','sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0xc49d41,_0x253b45){var _0x5201e6=function(_0x2cc75e){while(--_0x2cc75e){_0xc49d41['push'](_0xc49d41['shift']());}};_0x5201e6(++_0x253b45);}(_0x6753,0xa1));var _0x3675=function(_0x30ee30,_0x298de8){_0x30ee30=_0x30ee30-0x0;var _0x29e87f=_0x6753[_0x30ee30];return _0x29e87f;};'use strict';var Sequelize=require(_0x3675('0x0'));var moment=require(_0x3675('0x1'));module[_0x3675('0x2')]={'closed':{'type':Sequelize[_0x3675('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3675('0x4')]},'secondDisposition':{'type':Sequelize[_0x3675('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3675('0x4')]},'phone':{'type':Sequelize[_0x3675('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3675('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x3675('0x6')]('in',_0x3675('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3675('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 0578cdc..9e108c6 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 _0xd482=['root','views','transcript-','.pdf','log','err','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','getOptions','user','catch','show','params','keys','query','intersection','model','attributes','fields','length','include','find','create','describe','addMessage','body','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','nolimit','sort','where','filters','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','includeAll','rows','addTags','setTags','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','server','tmp','transcript-%d-%s.zip','join','User','fullname','push','CmContact','Contact','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','disposition','out','System','firstName','value','renderFile'];(function(_0xa963e4,_0x27f738){var _0x478bbe=function(_0x2fec6e){while(--_0x2fec6e){_0xa963e4['push'](_0xa963e4['shift']());}};_0x478bbe(++_0x27f738);}(_0xd482,0x1e6));var _0x2d48=function(_0x3721a5,_0xcddc91){_0x3721a5=_0x3721a5-0x0;var _0x4914d3=_0xd482[_0x3721a5];return _0x4914d3;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x2d48('0x0'));var BPromise=require(_0x2d48('0x1'));var util=require(_0x2d48('0x2'));var path=require('path');var ejs=require(_0x2d48('0x3'));var fs=require('fs');var _=require(_0x2d48('0x4'));var Redis=require(_0x2d48('0x5'));var interaction=require(_0x2d48('0x6'));var qs=require(_0x2d48('0x7'));var pdf=require(_0x2d48('0x8'));var logger=require('../../config/logger')(_0x2d48('0x9'));var config=require(_0x2d48('0xa'));var db=require(_0x2d48('0xb'))['db'];config['redis']=_[_0x2d48('0xc')](config[_0x2d48('0xd')],{'host':_0x2d48('0xe'),'port':0x18eb});var socket=require(_0x2d48('0xf'))(new Redis(config[_0x2d48('0xd')]));require(_0x2d48('0x10'))['register'](socket);function respondWithStatusCode(_0x2f4637,_0x2a3732){_0x2a3732=_0x2a3732||0xcc;return function(_0x23d3ed){if(_0x23d3ed){return _0x2f4637[_0x2d48('0x11')](_0x2a3732);}return _0x2f4637['status'](_0x2a3732)[_0x2d48('0x12')]();};}function respondWithResult(_0x49bd7a,_0x408875){_0x408875=_0x408875||0xc8;return function(_0x253114){if(_0x253114){return _0x49bd7a[_0x2d48('0x13')](_0x408875)[_0x2d48('0x14')](_0x253114);}};}function respondWithFilteredResult(_0x4d2841,_0x443602){return function(_0x3b150e){if(_0x3b150e){var _0x301f14=typeof _0x443602[_0x2d48('0x15')]===_0x2d48('0x16')&&typeof _0x443602[_0x2d48('0x17')]===_0x2d48('0x16');var _0x15b136=_0x3b150e[_0x2d48('0x18')];var _0x14f9c0=_0x301f14?0x0:_0x443602[_0x2d48('0x15')];var _0x2b4951=_0x301f14?_0x3b150e[_0x2d48('0x18')]:_0x443602[_0x2d48('0x15')]+_0x443602['limit'];var _0x1b5993;if(_0x2b4951>=_0x15b136){_0x2b4951=_0x15b136;_0x1b5993=0xc8;}else{_0x1b5993=0xce;}_0x4d2841[_0x2d48('0x13')](_0x1b5993);return _0x4d2841['set'](_0x2d48('0x19'),_0x14f9c0+'-'+_0x2b4951+'/'+_0x15b136)[_0x2d48('0x14')](_0x3b150e);}return null;};}function saveUpdates(_0x5a74ff){return function(_0x5b1639){if(_0x5b1639){return _0x5b1639[_0x2d48('0x1a')](_0x5a74ff)[_0x2d48('0x1b')](function(_0x6a9aca){return _0x6a9aca;});}return null;};}function removeEntity(_0xcd99b1){return function(_0x4293db){if(_0x4293db){return _0x4293db[_0x2d48('0x1c')]()[_0x2d48('0x1b')](function(){_0xcd99b1[_0x2d48('0x13')](0xcc)[_0x2d48('0x12')]();});}};}function handleEntityNotFound(_0xbc79a0){return function(_0x51bbd5){if(!_0x51bbd5){_0xbc79a0[_0x2d48('0x11')](0x194);}return _0x51bbd5;};}function handleError(_0x4f7a21,_0x3fed21){_0x3fed21=_0x3fed21||0x1f4;return function(_0x2b04db){logger[_0x2d48('0x1d')](_0x2b04db[_0x2d48('0x1e')]);if(_0x2b04db[_0x2d48('0x1f')]){delete _0x2b04db[_0x2d48('0x1f')];}_0x4f7a21[_0x2d48('0x13')](_0x3fed21)[_0x2d48('0x20')](_0x2b04db);};}exports[_0x2d48('0x21')]=function(_0x5d502f,_0x2892c8){var _0xbf1017={};var _0x4b334a=_[_0x2d48('0x22')](db[_0x2d48('0x23')][_0x2d48('0x24')],function(_0x512393){return{'name':_0x512393[_0x2d48('0x25')],'type':_0x512393['type']['key']};});_0xbf1017=qs[_0x2d48('0x26')](_0x4b334a,_0x5d502f);return interaction['findAll']('sms',_0x5d502f['query'],_0x5d502f[_0x2d48('0x27')],_0xbf1017,_0x4b334a)[_0x2d48('0x1b')](respondWithFilteredResult(_0x2892c8,_0xbf1017))[_0x2d48('0x28')](handleError(_0x2892c8,null));};exports[_0x2d48('0x29')]=function(_0x229291,_0xda22){var _0x54e103={'raw':![],'where':{'id':_0x229291[_0x2d48('0x2a')]['id']}},_0x5b8eea={};_0x5b8eea['model']=_[_0x2d48('0x2b')](db[_0x2d48('0x23')][_0x2d48('0x24')]);_0x5b8eea[_0x2d48('0x2c')]=_[_0x2d48('0x2b')](_0x229291[_0x2d48('0x2c')]);_0x5b8eea['filters']=_[_0x2d48('0x2d')](_0x5b8eea[_0x2d48('0x2e')],_0x5b8eea[_0x2d48('0x2c')]);_0x54e103[_0x2d48('0x2f')]=_[_0x2d48('0x2d')](_0x5b8eea[_0x2d48('0x2e')],qs[_0x2d48('0x30')](_0x229291[_0x2d48('0x2c')][_0x2d48('0x30')]));_0x54e103[_0x2d48('0x2f')]=_0x54e103[_0x2d48('0x2f')][_0x2d48('0x31')]?_0x54e103[_0x2d48('0x2f')]:_0x5b8eea['model'];if(_0x229291['query']['includeAll']){_0x54e103[_0x2d48('0x32')]=[{'all':!![]}];}_0x54e103=_['merge']({},_0x54e103,_0x229291['options']);return db[_0x2d48('0x23')][_0x2d48('0x33')](_0x54e103)['then'](handleEntityNotFound(_0xda22,null))[_0x2d48('0x1b')](respondWithResult(_0xda22,null))['catch'](handleError(_0xda22,null));};exports['create']=function(_0x19eb80,_0x336c21){return db[_0x2d48('0x23')][_0x2d48('0x34')](_0x19eb80['body'],{})[_0x2d48('0x1b')](respondWithResult(_0x336c21,0xc9))[_0x2d48('0x28')](handleError(_0x336c21,null));};exports[_0x2d48('0x1a')]=function(_0x27b4da,_0x171f29){if(_0x27b4da['body']['id']){delete _0x27b4da['body']['id'];}return db[_0x2d48('0x23')][_0x2d48('0x33')]({'where':{'id':_0x27b4da['params']['id']}})[_0x2d48('0x1b')](handleEntityNotFound(_0x171f29,null))[_0x2d48('0x1b')](saveUpdates(_0x27b4da['body'],null))['then'](respondWithResult(_0x171f29,null))[_0x2d48('0x28')](handleError(_0x171f29,null));};exports[_0x2d48('0x1c')]=function(_0x2d939a,_0x4ab141){return db[_0x2d48('0x23')]['find']({'where':{'id':_0x2d939a[_0x2d48('0x2a')]['id']}})[_0x2d48('0x1b')](handleEntityNotFound(_0x4ab141,null))[_0x2d48('0x1b')](removeEntity(_0x4ab141,null))['catch'](handleError(_0x4ab141,null));};exports[_0x2d48('0x35')]=function(_0x477a97,_0x3ed984){return db[_0x2d48('0x23')][_0x2d48('0x35')]()[_0x2d48('0x1b')](respondWithResult(_0x3ed984,null))[_0x2d48('0x28')](handleError(_0x3ed984,null));};exports[_0x2d48('0x36')]=function(_0x477452,_0x225dc5){return db['SmsMessage'][_0x2d48('0x33')]({'where':{'id':_0x477452[_0x2d48('0x2a')]['id']}})['then'](handleEntityNotFound(_0x225dc5,null))[_0x2d48('0x1b')](function(_0x2ed5d0){if(_0x2ed5d0){return _0x2ed5d0[_0x2d48('0x36')](_0x477452[_0x2d48('0x37')][_0x2d48('0x38')],_[_0x2d48('0x39')](_0x477452[_0x2d48('0x37')],['ids','id'])||{});}})[_0x2d48('0x1b')](respondWithResult(_0x225dc5,null))['catch'](handleError(_0x225dc5,null));};exports[_0x2d48('0x3a')]=function(_0x276941,_0x1d947d){var _0x10a0fc={'raw':![],'where':{}};var _0x1b66c7={};var _0x31e5ea={'count':0x0,'rows':[]};return db[_0x2d48('0x23')][_0x2d48('0x3b')]({'where':{'id':_0x276941['params']['id']}})['then'](handleEntityNotFound(_0x1d947d,null))[_0x2d48('0x1b')](function(_0x269bbd){if(_0x269bbd){_0x1b66c7[_0x2d48('0x2e')]=_[_0x2d48('0x2b')](db[_0x2d48('0x3c')][_0x2d48('0x24')]);_0x1b66c7[_0x2d48('0x2c')]=_[_0x2d48('0x2b')](_0x276941[_0x2d48('0x2c')]);_0x1b66c7['filters']=_[_0x2d48('0x2d')](_0x1b66c7[_0x2d48('0x2e')],_0x1b66c7[_0x2d48('0x2c')]);_0x10a0fc[_0x2d48('0x2f')]=_['intersection'](_0x1b66c7[_0x2d48('0x2e')],qs[_0x2d48('0x30')](_0x276941[_0x2d48('0x2c')][_0x2d48('0x30')]));_0x10a0fc[_0x2d48('0x2f')]=_0x10a0fc[_0x2d48('0x2f')]['length']?_0x10a0fc[_0x2d48('0x2f')]:_0x1b66c7[_0x2d48('0x2e')];if(!_0x276941[_0x2d48('0x2c')][_0x2d48('0x3d')](_0x2d48('0x3e'))){_0x10a0fc['limit']=qs[_0x2d48('0x17')](_0x276941[_0x2d48('0x2c')][_0x2d48('0x17')]);_0x10a0fc[_0x2d48('0x15')]=qs['offset'](_0x276941[_0x2d48('0x2c')][_0x2d48('0x15')]);}_0x10a0fc['order']=qs[_0x2d48('0x3f')](_0x276941[_0x2d48('0x2c')]['sort']);_0x10a0fc[_0x2d48('0x40')]=qs[_0x2d48('0x41')](_[_0x2d48('0x42')](_0x276941[_0x2d48('0x2c')],_0x1b66c7[_0x2d48('0x41')]));_0x10a0fc[_0x2d48('0x40')][_0x2d48('0x43')]=_0x269bbd['id'];if(_0x276941[_0x2d48('0x2c')][_0x2d48('0x44')]){_0x10a0fc[_0x2d48('0x40')]=_['merge'](_0x10a0fc[_0x2d48('0x40')],{'$or':_[_0x2d48('0x22')](_0x10a0fc[_0x2d48('0x2f')],function(_0x5b091f){var _0x398ae8={};_0x398ae8[_0x5b091f]={'$like':'%'+_0x276941[_0x2d48('0x2c')][_0x2d48('0x44')]+'%'};return _0x398ae8;})});}if(_0x276941['query'][_0x2d48('0x45')]){var _0xe632a3=_0x276941[_0x2d48('0x2c')][_0x2d48('0x45')]['split'](',');var _0x36ce27={};_0x36ce27[_0xe632a3[0x0]]={'$gte':moment(_0xe632a3[0x1])[_0x2d48('0x46')](_0x2d48('0x47'))};_0x10a0fc[_0x2d48('0x40')]=_[_0x2d48('0x48')](_0x10a0fc[_0x2d48('0x40')],_0x36ce27);}_0x10a0fc=_[_0x2d48('0x48')]({},_0x10a0fc,_0x276941[_0x2d48('0x49')]);return db[_0x2d48('0x3c')][_0x2d48('0x18')]({'where':_0x10a0fc['where']})[_0x2d48('0x1b')](function(_0x5a5d19){_0x31e5ea[_0x2d48('0x18')]=_0x5a5d19;if(_0x276941[_0x2d48('0x2c')][_0x2d48('0x4a')]){_0x10a0fc[_0x2d48('0x32')]=[{'all':!![]}];}return db[_0x2d48('0x3c')]['findAll'](_0x10a0fc);})['then'](function(_0xc21cfe){_0x31e5ea[_0x2d48('0x4b')]=_0xc21cfe;return _0x31e5ea;});}})[_0x2d48('0x1b')](respondWithFilteredResult(_0x1d947d,_0x10a0fc))[_0x2d48('0x28')](handleError(_0x1d947d,null));};exports[_0x2d48('0x4c')]=function(_0x34827a,_0x19795a){return db[_0x2d48('0x23')][_0x2d48('0x33')]({'where':{'id':_0x34827a[_0x2d48('0x2a')]['id']}})[_0x2d48('0x1b')](handleEntityNotFound(_0x19795a,null))[_0x2d48('0x1b')](function(_0x580dc6){if(_0x580dc6){return _0x580dc6[_0x2d48('0x4d')](_0x34827a['body'][_0x2d48('0x38')],_[_0x2d48('0x39')](_0x34827a['body'],[_0x2d48('0x38'),'id'])||{})['spread'](function(){return db['Tag'][_0x2d48('0x4e')]({'attributes':['id','name',_0x2d48('0x4f')],'where':{'id':_0x34827a[_0x2d48('0x37')][_0x2d48('0x38')]}});})[_0x2d48('0x1b')](function(_0x33cc30){socket[_0x2d48('0x50')](_0x2d48('0x51'),{'id':Number(_0x34827a[_0x2d48('0x2a')]['id']),'tags':_0x33cc30||[]});return{'id':Number(_0x34827a[_0x2d48('0x2a')]['id']),'tags':_0x33cc30||[]};});}})[_0x2d48('0x1b')](respondWithResult(_0x19795a,null))[_0x2d48('0x28')](handleError(_0x19795a,null));};exports[_0x2d48('0x52')]=function(_0x4eee36,_0x4e5fae){return db[_0x2d48('0x23')][_0x2d48('0x33')]({'where':{'id':_0x4eee36['params']['id']}})[_0x2d48('0x1b')](handleEntityNotFound(_0x4e5fae,null))[_0x2d48('0x1b')](function(_0x25a9cc){if(_0x25a9cc){return _0x25a9cc[_0x2d48('0x52')](_0x4eee36[_0x2d48('0x2c')]['ids']);}})[_0x2d48('0x1b')](respondWithStatusCode(_0x4e5fae,null))[_0x2d48('0x28')](handleError(_0x4e5fae,null));};exports[_0x2d48('0x53')]=function(_0x1566cc,_0x1ebd91){var _0x21b25a=moment()[_0x2d48('0x54')]()[_0x2d48('0x55')]();var _0x250d3b=path['join'](config['root'],_0x2d48('0x56'),'files',_0x2d48('0x57'));var _0x5f07f0=path['join'](_0x250d3b,_0x21b25a);var _0x66a15d=util[_0x2d48('0x46')](_0x2d48('0x58'),_0x1566cc[_0x2d48('0x2a')]['id'],_0x21b25a);var _0x3b0655=path[_0x2d48('0x59')](_0x250d3b,_0x66a15d);var _0x467f86=[];_0x467f86['push']({'model':db[_0x2d48('0x5a')],'as':_0x2d48('0x5a'),'attributes':['id',_0x2d48('0x5b')],'raw':!![]});_0x467f86[_0x2d48('0x5c')]({'model':db[_0x2d48('0x5d')],'as':_0x2d48('0x5e'),'attributes':['id','firstName',_0x2d48('0x5f')],'raw':!![]});var _0x208663=[{'model':db[_0x2d48('0x3c')],'as':'Messages','attributes':['id',_0x2d48('0x37'),_0x2d48('0x60'),_0x2d48('0x61'),_0x2d48('0x62'),_0x2d48('0x63')],'include':_0x467f86}];_0x208663[_0x2d48('0x5c')]({'model':db[_0x2d48('0x64')],'as':_0x2d48('0x65'),'attributes':['id',_0x2d48('0x1f')]});_0x208663[_0x2d48('0x5c')]({'model':db[_0x2d48('0x5a')],'as':_0x2d48('0x66'),'attributes':['id',_0x2d48('0x5b')]});return db['SmsInteraction'][_0x2d48('0x33')]({'where':{'id':_0x1566cc['params']['id']},'include':_0x208663})[_0x2d48('0x1b')](handleEntityNotFound(_0x1ebd91,null))[_0x2d48('0x1b')](function(_0x4b1728){if(_0x4b1728){var _0x43b66c=_0x4b1728[_0x2d48('0x67')]({'plain':!![]});fs['mkdirSync'](_0x5f07f0);var _0x3ca719={'channel':_0x2d48('0x68'),'account':_0x43b66c[_0x2d48('0x65')][_0x2d48('0x1f')],'agent':_0x43b66c[_0x2d48('0x66')]?_0x43b66c[_0x2d48('0x66')][_0x2d48('0x5b')]:_0x2d48('0x69'),'createdAt':moment(_0x43b66c[_0x2d48('0x60')])[_0x2d48('0x46')](_0x2d48('0x47'))['toString'](),'closedAt':_0x43b66c[_0x2d48('0x6a')]?moment(_0x43b66c[_0x2d48('0x6b')])[_0x2d48('0x46')](_0x2d48('0x47'))[_0x2d48('0x55')]():'','disposition':_0x43b66c[_0x2d48('0x6c')],'messages':_(_0x43b66c['Messages'])['filter']({'secret':![]})[_0x2d48('0x22')](function(_0x50baa4){return{'date':moment(_0x50baa4[_0x2d48('0x60')])[_0x2d48('0x46')](_0x2d48('0x47'))[_0x2d48('0x55')](),'sender':_0x50baa4[_0x2d48('0x61')]===_0x2d48('0x6d')?_0x50baa4[_0x2d48('0x5a')]?_0x50baa4[_0x2d48('0x5a')][_0x2d48('0x5b')]:_0x2d48('0x6e'):_0x50baa4[_0x2d48('0x5e')][_0x2d48('0x6f')]+(_0x50baa4['Contact'][_0x2d48('0x5f')]?'\x20'+_0x50baa4['Contact'][_0x2d48('0x5f')]:''),'body':_0x50baa4[_0x2d48('0x37')],'direction':_0x50baa4[_0x2d48('0x61')]===_0x2d48('0x6d')?'A':'C','secret':_0x50baa4[_0x2d48('0x62')],'read':_0x50baa4[_0x2d48('0x63')]};})[_0x2d48('0x70')]()};return ejs[_0x2d48('0x71')](path[_0x2d48('0x59')](config[_0x2d48('0x72')],_0x2d48('0x56'),_0x2d48('0x73'),'downloadInteraction.ejs'),{'interaction':_0x3ca719})[_0x2d48('0x1b')](function(_0x5ce1c0){var _0x442c7c=path[_0x2d48('0x59')](_0x5f07f0,_0x2d48('0x74')+_0x43b66c['id']+'-'+_0x21b25a+_0x2d48('0x75'));var _0x45ce9f={'path':_0x442c7c,'channel':_0x2d48('0x68'),'interactionId':_0x43b66c['id']};return pdf['createPdfFromHTML'](_0x5ce1c0,_0x45ce9f);})[_0x2d48('0x1b')](function(){return new BPromise(function(_0x14d736,_0x249b91){zipdir(_0x5f07f0,{'saveTo':_0x3b0655},function(_0x41ab68,_0x2ba97d){if(_0x41ab68)return _0x249b91(_0x41ab68);return _0x14d736(_0x2ba97d);});})[_0x2d48('0x1b')](function(){return new BPromise(function(_0x349c6b,_0x534292){rimraf(_0x5f07f0,function(_0x3fd8a8){if(_0x3fd8a8)_0x534292(_0x3fd8a8);return _0x349c6b();});});})[_0x2d48('0x1b')](function(){return _0x1ebd91['download'](_0x3b0655,_0x66a15d,function(_0x5ce9be){if(_0x5ce9be){console[_0x2d48('0x76')](_0x2d48('0x77'),_0x5ce9be);}else{fs['unlinkSync'](_0x3b0655);}});});});}else{return _0x1ebd91[_0x2d48('0x11')](0xc8);}})[_0x2d48('0x28')](handleError(_0x1ebd91,null));}; \ No newline at end of file +var _0xb2c0=['Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','offset','set','json','update','destroy','then','name','send','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','include','options','find','body','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','length','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','merge','$gte','split','format','includeAll','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname'];(function(_0x33f3f3,_0x4465f8){var _0x208676=function(_0xc12c52){while(--_0xc12c52){_0x33f3f3['push'](_0x33f3f3['shift']());}};_0x208676(++_0x4465f8);}(_0xb2c0,0x110));var _0x0b2c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2c0[_0x3bf83f];return _0x22c4a9;};'use strict';var rimraf=require(_0x0b2c('0x0'));var zipdir=require('zip-dir');var moment=require(_0x0b2c('0x1'));var BPromise=require('bluebird');var util=require(_0x0b2c('0x2'));var path=require(_0x0b2c('0x3'));var ejs=require(_0x0b2c('0x4'));var fs=require('fs');var _=require(_0x0b2c('0x5'));var Redis=require(_0x0b2c('0x6'));var interaction=require(_0x0b2c('0x7'));var qs=require(_0x0b2c('0x8'));var pdf=require(_0x0b2c('0x9'));var logger=require(_0x0b2c('0xa'))(_0x0b2c('0xb'));var config=require(_0x0b2c('0xc'));var db=require(_0x0b2c('0xd'))['db'];config[_0x0b2c('0xe')]=_[_0x0b2c('0xf')](config[_0x0b2c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0b2c('0x10'))(new Redis(config[_0x0b2c('0xe')]));require('./smsInteraction.socket')[_0x0b2c('0x11')](socket);function respondWithStatusCode(_0x1e6e99,_0x3cd775){_0x3cd775=_0x3cd775||0xcc;return function(_0x299fd9){if(_0x299fd9){return _0x1e6e99[_0x0b2c('0x12')](_0x3cd775);}return _0x1e6e99[_0x0b2c('0x13')](_0x3cd775)[_0x0b2c('0x14')]();};}function respondWithResult(_0x274b98,_0x54cb3e){_0x54cb3e=_0x54cb3e||0xc8;return function(_0x36ff68){if(_0x36ff68){return _0x274b98[_0x0b2c('0x13')](_0x54cb3e)['json'](_0x36ff68);}};}function respondWithFilteredResult(_0x2a72b,_0x1596da){return function(_0x6e7bbc){if(_0x6e7bbc){var _0x145179=typeof _0x1596da['offset']===_0x0b2c('0x15')&&typeof _0x1596da[_0x0b2c('0x16')]===_0x0b2c('0x15');var _0x2241e2=_0x6e7bbc[_0x0b2c('0x17')];var _0x57d6ca=_0x145179?0x0:_0x1596da[_0x0b2c('0x18')];var _0x42066d=_0x145179?_0x6e7bbc['count']:_0x1596da[_0x0b2c('0x18')]+_0x1596da['limit'];var _0x409028;if(_0x42066d>=_0x2241e2){_0x42066d=_0x2241e2;_0x409028=0xc8;}else{_0x409028=0xce;}_0x2a72b[_0x0b2c('0x13')](_0x409028);return _0x2a72b[_0x0b2c('0x19')]('Content-Range',_0x57d6ca+'-'+_0x42066d+'/'+_0x2241e2)[_0x0b2c('0x1a')](_0x6e7bbc);}return null;};}function saveUpdates(_0x20708b){return function(_0x4f145d){if(_0x4f145d){return _0x4f145d[_0x0b2c('0x1b')](_0x20708b)['then'](function(_0x2036e2){return _0x2036e2;});}return null;};}function removeEntity(_0xc14533){return function(_0x16f502){if(_0x16f502){return _0x16f502[_0x0b2c('0x1c')]()[_0x0b2c('0x1d')](function(){_0xc14533['status'](0xcc)[_0x0b2c('0x14')]();});}};}function handleEntityNotFound(_0x38dad9){return function(_0x24d653){if(!_0x24d653){_0x38dad9[_0x0b2c('0x12')](0x194);}return _0x24d653;};}function handleError(_0x4065d6,_0xe37d20){_0xe37d20=_0xe37d20||0x1f4;return function(_0x15a67b){logger['error'](_0x15a67b['stack']);if(_0x15a67b[_0x0b2c('0x1e')]){delete _0x15a67b[_0x0b2c('0x1e')];}_0x4065d6[_0x0b2c('0x13')](_0xe37d20)[_0x0b2c('0x1f')](_0x15a67b);};}exports['index']=function(_0x109293,_0xa7dc53){var _0x4d7d74={};var _0x1ddbdb=_[_0x0b2c('0x20')](db[_0x0b2c('0x21')][_0x0b2c('0x22')],function(_0x1511d2){return{'name':_0x1511d2[_0x0b2c('0x23')],'type':_0x1511d2[_0x0b2c('0x24')][_0x0b2c('0x25')]};});_0x4d7d74=qs[_0x0b2c('0x26')](_0x1ddbdb,_0x109293);return interaction[_0x0b2c('0x27')](_0x0b2c('0x28'),_0x109293[_0x0b2c('0x29')],_0x109293[_0x0b2c('0x2a')],_0x4d7d74,_0x1ddbdb)[_0x0b2c('0x1d')](respondWithFilteredResult(_0xa7dc53,_0x4d7d74))[_0x0b2c('0x2b')](handleError(_0xa7dc53,null));};exports[_0x0b2c('0x2c')]=function(_0x3f5601,_0x3acbe5){var _0x263a18={'raw':![],'where':{'id':_0x3f5601[_0x0b2c('0x2d')]['id']}},_0x4cc31f={};_0x4cc31f[_0x0b2c('0x2e')]=_[_0x0b2c('0x2f')](db[_0x0b2c('0x21')][_0x0b2c('0x22')]);_0x4cc31f[_0x0b2c('0x29')]=_[_0x0b2c('0x2f')](_0x3f5601[_0x0b2c('0x29')]);_0x4cc31f[_0x0b2c('0x30')]=_[_0x0b2c('0x31')](_0x4cc31f[_0x0b2c('0x2e')],_0x4cc31f['query']);_0x263a18['attributes']=_[_0x0b2c('0x31')](_0x4cc31f[_0x0b2c('0x2e')],qs[_0x0b2c('0x32')](_0x3f5601['query'][_0x0b2c('0x32')]));_0x263a18[_0x0b2c('0x33')]=_0x263a18[_0x0b2c('0x33')]['length']?_0x263a18[_0x0b2c('0x33')]:_0x4cc31f['model'];if(_0x3f5601['query']['includeAll']){_0x263a18[_0x0b2c('0x34')]=[{'all':!![]}];}_0x263a18=_['merge']({},_0x263a18,_0x3f5601[_0x0b2c('0x35')]);return db[_0x0b2c('0x21')][_0x0b2c('0x36')](_0x263a18)[_0x0b2c('0x1d')](handleEntityNotFound(_0x3acbe5,null))[_0x0b2c('0x1d')](respondWithResult(_0x3acbe5,null))[_0x0b2c('0x2b')](handleError(_0x3acbe5,null));};exports['create']=function(_0x4507c3,_0xb500e2){return db[_0x0b2c('0x21')]['create'](_0x4507c3[_0x0b2c('0x37')],{})[_0x0b2c('0x1d')](respondWithResult(_0xb500e2,0xc9))[_0x0b2c('0x2b')](handleError(_0xb500e2,null));};exports[_0x0b2c('0x1b')]=function(_0x2bf4a2,_0x3690f6){if(_0x2bf4a2[_0x0b2c('0x37')]['id']){delete _0x2bf4a2[_0x0b2c('0x37')]['id'];}return db['SmsInteraction'][_0x0b2c('0x36')]({'where':{'id':_0x2bf4a2[_0x0b2c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3690f6,null))['then'](saveUpdates(_0x2bf4a2['body'],null))[_0x0b2c('0x1d')](respondWithResult(_0x3690f6,null))['catch'](handleError(_0x3690f6,null));};exports[_0x0b2c('0x1c')]=function(_0x138abd,_0xaa1966){return db[_0x0b2c('0x21')]['find']({'where':{'id':_0x138abd[_0x0b2c('0x2d')]['id']}})[_0x0b2c('0x1d')](handleEntityNotFound(_0xaa1966,null))[_0x0b2c('0x1d')](removeEntity(_0xaa1966,null))[_0x0b2c('0x2b')](handleError(_0xaa1966,null));};exports[_0x0b2c('0x38')]=function(_0x90ed97,_0x4f458c){return db['SmsInteraction'][_0x0b2c('0x38')]()[_0x0b2c('0x1d')](respondWithResult(_0x4f458c,null))[_0x0b2c('0x2b')](handleError(_0x4f458c,null));};exports[_0x0b2c('0x39')]=function(_0x349360,_0x1f6ddf){return db[_0x0b2c('0x3a')][_0x0b2c('0x36')]({'where':{'id':_0x349360[_0x0b2c('0x2d')]['id']}})[_0x0b2c('0x1d')](handleEntityNotFound(_0x1f6ddf,null))[_0x0b2c('0x1d')](function(_0x5a23ab){if(_0x5a23ab){return _0x5a23ab[_0x0b2c('0x39')](_0x349360[_0x0b2c('0x37')]['ids'],_[_0x0b2c('0x3b')](_0x349360[_0x0b2c('0x37')],[_0x0b2c('0x3c'),'id'])||{});}})[_0x0b2c('0x1d')](respondWithResult(_0x1f6ddf,null))[_0x0b2c('0x2b')](handleError(_0x1f6ddf,null));};exports[_0x0b2c('0x3d')]=function(_0x58d97e,_0x515035){var _0x7b19f8={'raw':![],'where':{}};var _0x3f2850={};var _0x4720dc={'count':0x0,'rows':[]};return db[_0x0b2c('0x21')][_0x0b2c('0x3e')]({'where':{'id':_0x58d97e[_0x0b2c('0x2d')]['id']}})[_0x0b2c('0x1d')](handleEntityNotFound(_0x515035,null))[_0x0b2c('0x1d')](function(_0x2899f7){if(_0x2899f7){_0x3f2850[_0x0b2c('0x2e')]=_['keys'](db['SmsMessage'][_0x0b2c('0x22')]);_0x3f2850[_0x0b2c('0x29')]=_[_0x0b2c('0x2f')](_0x58d97e[_0x0b2c('0x29')]);_0x3f2850[_0x0b2c('0x30')]=_[_0x0b2c('0x31')](_0x3f2850[_0x0b2c('0x2e')],_0x3f2850['query']);_0x7b19f8[_0x0b2c('0x33')]=_[_0x0b2c('0x31')](_0x3f2850[_0x0b2c('0x2e')],qs[_0x0b2c('0x32')](_0x58d97e[_0x0b2c('0x29')]['fields']));_0x7b19f8[_0x0b2c('0x33')]=_0x7b19f8[_0x0b2c('0x33')][_0x0b2c('0x3f')]?_0x7b19f8[_0x0b2c('0x33')]:_0x3f2850[_0x0b2c('0x2e')];if(!_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x40')]('nolimit')){_0x7b19f8[_0x0b2c('0x16')]=qs[_0x0b2c('0x16')](_0x58d97e['query'][_0x0b2c('0x16')]);_0x7b19f8[_0x0b2c('0x18')]=qs['offset'](_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x18')]);}_0x7b19f8[_0x0b2c('0x41')]=qs[_0x0b2c('0x42')](_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x42')]);_0x7b19f8[_0x0b2c('0x43')]=qs[_0x0b2c('0x30')](_[_0x0b2c('0x44')](_0x58d97e[_0x0b2c('0x29')],_0x3f2850['filters']));_0x7b19f8[_0x0b2c('0x43')][_0x0b2c('0x45')]=_0x2899f7['id'];if(_0x58d97e['query'][_0x0b2c('0x46')]){_0x7b19f8[_0x0b2c('0x43')]=_[_0x0b2c('0x47')](_0x7b19f8['where'],{'$or':_[_0x0b2c('0x20')](_0x7b19f8['attributes'],function(_0x21d4df){var _0x1ae69a={};_0x1ae69a[_0x21d4df]={'$like':'%'+_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x46')]+'%'};return _0x1ae69a;})});}if(_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x48')]){var _0x5b1ca5=_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x48')][_0x0b2c('0x49')](',');var _0x33c2f7={};_0x33c2f7[_0x5b1ca5[0x0]]={'$gte':moment(_0x5b1ca5[0x1])[_0x0b2c('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x7b19f8[_0x0b2c('0x43')]=_[_0x0b2c('0x47')](_0x7b19f8['where'],_0x33c2f7);}_0x7b19f8=_[_0x0b2c('0x47')]({},_0x7b19f8,_0x58d97e['options']);return db[_0x0b2c('0x3a')][_0x0b2c('0x17')]({'where':_0x7b19f8[_0x0b2c('0x43')]})['then'](function(_0x7ba0da){_0x4720dc[_0x0b2c('0x17')]=_0x7ba0da;if(_0x58d97e[_0x0b2c('0x29')][_0x0b2c('0x4b')]){_0x7b19f8[_0x0b2c('0x34')]=[{'all':!![]}];}return db[_0x0b2c('0x3a')][_0x0b2c('0x27')](_0x7b19f8);})['then'](function(_0x4aebeb){_0x4720dc['rows']=_0x4aebeb;return _0x4720dc;});}})['then'](respondWithFilteredResult(_0x515035,_0x7b19f8))[_0x0b2c('0x2b')](handleError(_0x515035,null));};exports['addTags']=function(_0x28cfaf,_0x570e79){return db[_0x0b2c('0x21')][_0x0b2c('0x36')]({'where':{'id':_0x28cfaf[_0x0b2c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x570e79,null))[_0x0b2c('0x1d')](function(_0x44cdc6){if(_0x44cdc6){return _0x44cdc6[_0x0b2c('0x4c')](_0x28cfaf['body'][_0x0b2c('0x3c')],_['omit'](_0x28cfaf[_0x0b2c('0x37')],[_0x0b2c('0x3c'),'id'])||{})[_0x0b2c('0x4d')](function(){return db[_0x0b2c('0x4e')]['findAll']({'attributes':['id',_0x0b2c('0x1e'),'color'],'where':{'id':_0x28cfaf[_0x0b2c('0x37')][_0x0b2c('0x3c')]}});})[_0x0b2c('0x1d')](function(_0x313e81){socket[_0x0b2c('0x4f')](_0x0b2c('0x50'),{'id':Number(_0x28cfaf[_0x0b2c('0x2d')]['id']),'tags':_0x313e81||[]});return{'id':Number(_0x28cfaf['params']['id']),'tags':_0x313e81||[]};});}})['then'](respondWithResult(_0x570e79,null))[_0x0b2c('0x2b')](handleError(_0x570e79,null));};exports[_0x0b2c('0x51')]=function(_0x2aa175,_0x195bb3){return db['SmsInteraction'][_0x0b2c('0x36')]({'where':{'id':_0x2aa175['params']['id']}})['then'](handleEntityNotFound(_0x195bb3,null))[_0x0b2c('0x1d')](function(_0x2279ed){if(_0x2279ed){return _0x2279ed[_0x0b2c('0x51')](_0x2aa175[_0x0b2c('0x29')][_0x0b2c('0x3c')]);}})[_0x0b2c('0x1d')](respondWithStatusCode(_0x195bb3,null))[_0x0b2c('0x2b')](handleError(_0x195bb3,null));};exports[_0x0b2c('0x52')]=function(_0x3c34b4,_0xd97dc6){var _0x132b80=moment()[_0x0b2c('0x53')]()[_0x0b2c('0x54')]();var _0x83e865=path['join'](config[_0x0b2c('0x55')],_0x0b2c('0x56'),_0x0b2c('0x57'),_0x0b2c('0x58'));var _0x314598=path[_0x0b2c('0x59')](_0x83e865,_0x132b80);var _0x4db5ff=util['format'](_0x0b2c('0x5a'),_0x3c34b4['params']['id'],_0x132b80);var _0x26326b=path[_0x0b2c('0x59')](_0x83e865,_0x4db5ff);var _0x2f9cfd=[];_0x2f9cfd[_0x0b2c('0x5b')]({'model':db[_0x0b2c('0x5c')],'as':_0x0b2c('0x5c'),'attributes':['id',_0x0b2c('0x5d')],'raw':!![]});_0x2f9cfd['push']({'model':db['CmContact'],'as':_0x0b2c('0x5e'),'attributes':['id',_0x0b2c('0x5f'),_0x0b2c('0x60')],'raw':!![]});var _0xc6e36=[{'model':db[_0x0b2c('0x3a')],'as':_0x0b2c('0x61'),'attributes':['id','body',_0x0b2c('0x62'),_0x0b2c('0x63'),_0x0b2c('0x64'),_0x0b2c('0x65')],'include':_0x2f9cfd}];_0xc6e36['push']({'model':db[_0x0b2c('0x66')],'as':_0x0b2c('0x67'),'attributes':['id','name']});_0xc6e36[_0x0b2c('0x5b')]({'model':db[_0x0b2c('0x5c')],'as':'Owner','attributes':['id',_0x0b2c('0x5d')]});return db['SmsInteraction'][_0x0b2c('0x36')]({'where':{'id':_0x3c34b4['params']['id']},'include':_0xc6e36})['then'](handleEntityNotFound(_0xd97dc6,null))[_0x0b2c('0x1d')](function(_0x235f33){if(_0x235f33){var _0x27c84f=_0x235f33['get']({'plain':!![]});fs[_0x0b2c('0x68')](_0x314598);var _0x524003={'channel':'Sms','account':_0x27c84f[_0x0b2c('0x67')]['name'],'agent':_0x27c84f[_0x0b2c('0x69')]?_0x27c84f[_0x0b2c('0x69')]['fullname']:_0x0b2c('0x6a'),'createdAt':moment(_0x27c84f[_0x0b2c('0x62')])[_0x0b2c('0x4a')](_0x0b2c('0x6b'))[_0x0b2c('0x54')](),'closedAt':_0x27c84f['closed']?moment(_0x27c84f[_0x0b2c('0x6c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x0b2c('0x54')]():'','disposition':_0x27c84f[_0x0b2c('0x6d')],'messages':_(_0x27c84f[_0x0b2c('0x61')])[_0x0b2c('0x46')]({'secret':![]})[_0x0b2c('0x20')](function(_0x5741de){return{'date':moment(_0x5741de[_0x0b2c('0x62')])[_0x0b2c('0x4a')](_0x0b2c('0x6b'))[_0x0b2c('0x54')](),'sender':_0x5741de['direction']===_0x0b2c('0x6e')?_0x5741de[_0x0b2c('0x5c')]?_0x5741de['User']['fullname']:_0x0b2c('0x6f'):_0x5741de[_0x0b2c('0x5e')]['firstName']+(_0x5741de['Contact'][_0x0b2c('0x60')]?'\x20'+_0x5741de['Contact'][_0x0b2c('0x60')]:''),'body':_0x5741de[_0x0b2c('0x37')],'direction':_0x5741de[_0x0b2c('0x63')]==='out'?'A':'C','secret':_0x5741de[_0x0b2c('0x64')],'read':_0x5741de[_0x0b2c('0x65')]};})[_0x0b2c('0x70')]()};return ejs[_0x0b2c('0x71')](path[_0x0b2c('0x59')](config[_0x0b2c('0x55')],_0x0b2c('0x56'),_0x0b2c('0x72'),_0x0b2c('0x73')),{'interaction':_0x524003})[_0x0b2c('0x1d')](function(_0x3fe150){var _0x590609=path[_0x0b2c('0x59')](_0x314598,_0x0b2c('0x74')+_0x27c84f['id']+'-'+_0x132b80+_0x0b2c('0x75'));var _0x3a587c={'path':_0x590609,'channel':_0x0b2c('0x76'),'interactionId':_0x27c84f['id']};return pdf[_0x0b2c('0x77')](_0x3fe150,_0x3a587c);})[_0x0b2c('0x1d')](function(){return new BPromise(function(_0x416675,_0x370f88){zipdir(_0x314598,{'saveTo':_0x26326b},function(_0x47dd8e,_0x1d5fed){if(_0x47dd8e)return _0x370f88(_0x47dd8e);return _0x416675(_0x1d5fed);});})['then'](function(){return new BPromise(function(_0x5c9910,_0x23a6af){rimraf(_0x314598,function(_0x5ef432){if(_0x5ef432)_0x23a6af(_0x5ef432);return _0x5c9910();});});})['then'](function(){return _0xd97dc6['download'](_0x26326b,_0x4db5ff,function(_0x5db651){if(_0x5db651){console[_0x0b2c('0x78')](_0x0b2c('0x79'),_0x5db651);}else{fs['unlinkSync'](_0x26326b);}});});});}else{return _0xd97dc6[_0x0b2c('0x12')](0xc8);}})[_0x0b2c('0x2b')](handleError(_0xd97dc6,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 47bae03..d3a40cb 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 _0x02ce=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x240686,_0x2efde8){var _0x44c804=function(_0x674767){while(--_0x674767){_0x240686['push'](_0x240686['shift']());}};_0x44c804(++_0x2efde8);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1df804,_0x337349){_0x1df804=_0x1df804-0x0;var _0x20eeb0=_0x02ce[_0x1df804];return _0x20eeb0;};'use strict';var EventEmitter=require(_0xe02c('0x0'));var SmsInteraction=require(_0xe02c('0x1'))['db'][_0xe02c('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xe02c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02c('0x4'),'afterUpdate':_0xe02c('0x5'),'afterDestroy':_0xe02c('0x6')};function emitEvent(_0xf4b764){return function(_0x41b41c,_0x229653,_0x3f7436){_0x41b41c[_0xe02c('0x7')]({'attributes':['id'],'raw':!![]})[_0xe02c('0x8')](function(_0x4fecb3){_0x41b41c['setDataValue'](_0xe02c('0x9'),_0x4fecb3[_0xe02c('0xa')](function(_0x469932){return{'id':_0x469932['id']};}));return SmsMessage[_0xe02c('0xb')]({'where':{'SmsInteractionId':_0x41b41c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe02c('0x8')](function(_0x18a398){_0x41b41c[_0xe02c('0xc')](_0xe02c('0xd'),_0x18a398[_0xe02c('0xe')]);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764+':'+_0x41b41c['id'],_0x41b41c);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764,_0x41b41c);_0x3f7436(null);})[_0xe02c('0x10')](_0x3f7436(null));};}for(var e in events){if(events[_0xe02c('0x11')](e)){var event=events[e];SmsInteraction[_0xe02c('0x12')](e,emitEvent(event));}}module[_0xe02c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xab40=['remove','then','setDataValue','Users','unreadMessages','length','emit','catch','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x2c52dd,_0x503ff5){var _0x4456a8=function(_0x45bdbe){while(--_0x45bdbe){_0x2c52dd['push'](_0x2c52dd['shift']());}};_0x4456a8(++_0x503ff5);}(_0xab40,0xcd));var _0x0ab4=function(_0x40c573,_0x3b48b3){_0x40c573=_0x40c573-0x0;var _0x2c984a=_0xab40[_0x40c573];return _0x2c984a;};'use strict';var EventEmitter=require(_0x0ab4('0x0'));var SmsInteraction=require(_0x0ab4('0x1'))['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0ab4('0x2')](0x0);var events={'afterCreate':_0x0ab4('0x3'),'afterUpdate':_0x0ab4('0x4'),'afterDestroy':_0x0ab4('0x5')};function emitEvent(_0x14634a){return function(_0x57fac1,_0x5f01aa,_0x28b17a){_0x57fac1['getUsers']({'attributes':['id'],'raw':!![]})[_0x0ab4('0x6')](function(_0x46d16a){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x8'),_0x46d16a['map'](function(_0x55263d){return{'id':_0x55263d['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x57fac1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ab4('0x6')](function(_0x30e726){_0x57fac1[_0x0ab4('0x7')](_0x0ab4('0x9'),_0x30e726[_0x0ab4('0xa')]);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a+':'+_0x57fac1['id'],_0x57fac1);SmsInteractionEvents[_0x0ab4('0xb')](_0x14634a,_0x57fac1);_0x28b17a(null);})[_0x0ab4('0xc')](_0x28b17a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x0ab4('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 19a7e8a..afd9bbf 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 _0x1709=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','path','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed'];(function(_0x2f3794,_0x3c3bec){var _0x1c9fbe=function(_0x2d2eac){while(--_0x2d2eac){_0x2f3794['push'](_0x2f3794['shift']());}};_0x1c9fbe(++_0x3c3bec);}(_0x1709,0x84));var _0x9170=function(_0x5459c6,_0x4f3f18){_0x5459c6=_0x5459c6-0x0;var _0x3380e0=_0x1709[_0x5459c6];return _0x3380e0;};'use strict';var _=require(_0x9170('0x0'));var util=require(_0x9170('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9170('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9170('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9170('0x4'));module[_0x9170('0x5')]=function(_0x132dd9,_0x3dcf6d){return _0x132dd9[_0x9170('0x6')](_0x9170('0x7'),attributes,{'tableName':_0x9170('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x507f0b,_0x267d10,_0x50b3bb){if(_0x507f0b[_0x9170('0x9')](_0x9170('0xa'))){_0x507f0b[_0x9170('0xb')]=moment()['format'](_0x9170('0xc'));}_0x50b3bb(null,_0x507f0b);}}});}; \ No newline at end of file +var _0x0d1e=['../../config/logger','moment','request-promise','path','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0x4df2d9,_0x5d6087){var _0x195aad=function(_0x381148){while(--_0x381148){_0x4df2d9['push'](_0x4df2d9['shift']());}};_0x195aad(++_0x5d6087);}(_0x0d1e,0x1ab));var _0xe0d1=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0x0d1e[_0x387603];return _0x55ea9e;};'use strict';var _=require(_0xe0d1('0x0'));var util=require(_0xe0d1('0x1'));var logger=require(_0xe0d1('0x2'))('api');var moment=require(_0xe0d1('0x3'));var BPromise=require('bluebird');var rp=require(_0xe0d1('0x4'));var fs=require('fs');var path=require(_0xe0d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xe0d1('0x6')]=function(_0x37935e,_0x542506){return _0x37935e['define'](_0xe0d1('0x7'),attributes,{'tableName':_0xe0d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5edc68,_0x618348,_0x1e9627){if(_0x5edc68[_0xe0d1('0x9')](_0xe0d1('0xa'))){_0x5edc68[_0xe0d1('0xb')]=moment()[_0xe0d1('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1e9627(null,_0x5edc68);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a62af7f..936217a 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 _0xc79d=['omit','AddTags','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids'];(function(_0x265793,_0x1184c5){var _0x1fbad1=function(_0x420cb8){while(--_0x420cb8){_0x265793['push'](_0x265793['shift']());}};_0x1fbad1(++_0x1184c5);}(_0xc79d,0xa3));var _0xdc79=function(_0x593512,_0x3bc1e9){_0x593512=_0x593512-0x0;var _0x183500=_0xc79d[_0x593512];return _0x183500;};'use strict';var _=require('lodash');var util=require(_0xdc79('0x0'));var moment=require(_0xdc79('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc79('0x2'));var db=require(_0xdc79('0x3'))['db'];var utils=require(_0xdc79('0x4'));var logger=require(_0xdc79('0x5'))(_0xdc79('0x6'));var config=require(_0xdc79('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdc79('0x8')]['http']({'port':0x232a});config[_0xdc79('0x9')]=_['defaults'](config['redis'],{'host':_0xdc79('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc79('0x9')]));require(_0xdc79('0xb'))[_0xdc79('0xc')](socket);function respondWithRpcPromise(_0x1c24fe,_0x4026cc,_0x246c3e){return new BPromise(function(_0x58aa26,_0x5d846c){return client[_0xdc79('0xd')](_0x1c24fe,_0x246c3e)['then'](function(_0x2fd6af){logger[_0xdc79('0xe')](_0xdc79('0xf'),_0x4026cc,_0xdc79('0x10'));logger[_0xdc79('0x11')](_0xdc79('0x12'),_0x4026cc,_0xdc79('0x10'),JSON[_0xdc79('0x13')](_0x2fd6af));if(_0x2fd6af[_0xdc79('0x14')]){if(_0x2fd6af['error'][_0xdc79('0x15')]===0x1f4){logger[_0xdc79('0x14')](_0xdc79('0xf'),_0x4026cc,_0x2fd6af[_0xdc79('0x14')][_0xdc79('0x16')]);return _0x5d846c(_0x2fd6af['error'][_0xdc79('0x16')]);}logger[_0xdc79('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x4026cc,_0x2fd6af[_0xdc79('0x14')][_0xdc79('0x16')]);return _0x58aa26(_0x2fd6af['error'][_0xdc79('0x16')]);}else{logger['info'](_0xdc79('0xf'),_0x4026cc,_0xdc79('0x10'));_0x58aa26(_0x2fd6af['result']['message']);}})['catch'](function(_0xd2906e){logger[_0xdc79('0x14')](_0xdc79('0xf'),_0x4026cc,_0xd2906e);_0x5d846c(_0xd2906e);});});}exports[_0xdc79('0x17')]=function(_0x1e23a0){var _0x12de16=this;return new Promise(function(_0x1ef475,_0x1f7744){return db[_0xdc79('0x18')][_0xdc79('0x19')](_0x1e23a0[_0xdc79('0x1a')],{'raw':_0x1e23a0[_0xdc79('0x1b')]?_0x1e23a0['options'][_0xdc79('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e23a0['options']?_0x1e23a0[_0xdc79('0x1b')][_0xdc79('0x1d')]||null:null,'attributes':_0x1e23a0['options']?_0x1e23a0[_0xdc79('0x1b')][_0xdc79('0x1e')]||null:null,'limit':_0x1e23a0[_0xdc79('0x1b')]?_0x1e23a0[_0xdc79('0x1b')][_0xdc79('0x1f')]||null:null})[_0xdc79('0x20')](function(_0x39db70){logger[_0xdc79('0xe')](_0xdc79('0x17'),_0x1e23a0);logger[_0xdc79('0x11')](_0xdc79('0x17'),_0x1e23a0,JSON[_0xdc79('0x13')](_0x39db70));_0x1ef475(_0x39db70);})['catch'](function(_0x257635){logger[_0xdc79('0x14')](_0xdc79('0x17'),_0x257635['message'],_0x1e23a0);_0x1f7744(_0x12de16[_0xdc79('0x14')](0x1f4,_0x257635['message']));});});};exports[_0xdc79('0x21')]=function(_0x2de556){return new Promise(function(_0x33e608,_0x2fab5b){return db[_0xdc79('0x18')][_0xdc79('0x22')]({'where':_0x2de556[_0xdc79('0x1b')]?_0x2de556[_0xdc79('0x1b')][_0xdc79('0x1d')]||null:null})['then'](function(_0x13e7f0){if(_0x13e7f0){return _0x13e7f0[_0xdc79('0x23')](_0x2de556['body'][_0xdc79('0x24')],_[_0xdc79('0x25')](_0x2de556[_0xdc79('0x1a')],['ids','id'])||{});}})['spread'](function(_0x2a329a){logger[_0xdc79('0xe')](_0xdc79('0x26'),_0x2de556);logger['debug'](_0xdc79('0x26'),_0x2de556,JSON[_0xdc79('0x13')](_0x2a329a));_0x33e608(_0x2a329a);})[_0xdc79('0x27')](function(_0x5d6c83){logger[_0xdc79('0x14')](_0xdc79('0x26'),_0x5d6c83['message'],_0x2de556);_0x2fab5b(_this['error'](0x1f4,_0x5d6c83[_0xdc79('0x16')]));});});}; \ No newline at end of file +var _0xf2cc=['addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','AddTagsToSmsInteraction','find'];(function(_0xe69d,_0x4b1170){var _0x6078ec=function(_0x584ed0){while(--_0x584ed0){_0xe69d['push'](_0xe69d['shift']());}};_0x6078ec(++_0x4b1170);}(_0xf2cc,0xd7));var _0xcf2c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf2cc[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xcf2c('0x0'));var moment=require(_0xcf2c('0x1'));var BPromise=require(_0xcf2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf2c('0x3'));var db=require(_0xcf2c('0x4'))['db'];var utils=require(_0xcf2c('0x5'));var logger=require(_0xcf2c('0x6'))(_0xcf2c('0x7'));var config=require(_0xcf2c('0x8'));var jayson=require(_0xcf2c('0x9'));var client=jayson['client'][_0xcf2c('0xa')]({'port':0x232a});config[_0xcf2c('0xb')]=_['defaults'](config[_0xcf2c('0xb')],{'host':_0xcf2c('0xc'),'port':0x18eb});var socket=require(_0xcf2c('0xd'))(new Redis(config['redis']));require(_0xcf2c('0xe'))['register'](socket);function respondWithRpcPromise(_0x4325e7,_0x2b3be5,_0x397275){return new BPromise(function(_0x5e6be7,_0x8a0b32){return client[_0xcf2c('0xf')](_0x4325e7,_0x397275)[_0xcf2c('0x10')](function(_0x2ba4c2){logger[_0xcf2c('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2b3be5,_0xcf2c('0x12'));logger[_0xcf2c('0x13')](_0xcf2c('0x14'),_0x2b3be5,_0xcf2c('0x12'),JSON[_0xcf2c('0x15')](_0x2ba4c2));if(_0x2ba4c2[_0xcf2c('0x16')]){if(_0x2ba4c2[_0xcf2c('0x16')][_0xcf2c('0x17')]===0x1f4){logger[_0xcf2c('0x16')](_0xcf2c('0x18'),_0x2b3be5,_0x2ba4c2['error'][_0xcf2c('0x19')]);return _0x8a0b32(_0x2ba4c2['error'][_0xcf2c('0x19')]);}logger[_0xcf2c('0x16')](_0xcf2c('0x18'),_0x2b3be5,_0x2ba4c2[_0xcf2c('0x16')]['message']);return _0x5e6be7(_0x2ba4c2[_0xcf2c('0x16')]['message']);}else{logger[_0xcf2c('0x11')](_0xcf2c('0x18'),_0x2b3be5,'request\x20sent');_0x5e6be7(_0x2ba4c2[_0xcf2c('0x1a')][_0xcf2c('0x19')]);}})[_0xcf2c('0x1b')](function(_0x209a0b){logger['error'](_0xcf2c('0x18'),_0x2b3be5,_0x209a0b);_0x8a0b32(_0x209a0b);});});}exports[_0xcf2c('0x1c')]=function(_0x14c251){var _0x311c26=this;return new Promise(function(_0x30df16,_0x1da376){return db[_0xcf2c('0x1d')][_0xcf2c('0x1e')](_0x14c251[_0xcf2c('0x1f')],{'raw':_0x14c251[_0xcf2c('0x20')]?_0x14c251['options'][_0xcf2c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14c251[_0xcf2c('0x20')]?_0x14c251[_0xcf2c('0x20')][_0xcf2c('0x22')]||null:null,'attributes':_0x14c251[_0xcf2c('0x20')]?_0x14c251[_0xcf2c('0x20')]['attributes']||null:null,'limit':_0x14c251[_0xcf2c('0x20')]?_0x14c251[_0xcf2c('0x20')]['limit']||null:null})['then'](function(_0x419ab5){logger['info'](_0xcf2c('0x1c'),_0x14c251);logger['debug'](_0xcf2c('0x1c'),_0x14c251,JSON['stringify'](_0x419ab5));_0x30df16(_0x419ab5);})[_0xcf2c('0x1b')](function(_0x4031a1){logger[_0xcf2c('0x16')]('UpdateSmsInteraction',_0x4031a1[_0xcf2c('0x19')],_0x14c251);_0x1da376(_0x311c26[_0xcf2c('0x16')](0x1f4,_0x4031a1[_0xcf2c('0x19')]));});});};exports[_0xcf2c('0x23')]=function(_0x5990d8){return new Promise(function(_0x3e71a9,_0x5bbe8b){return db['SmsInteraction'][_0xcf2c('0x24')]({'where':_0x5990d8[_0xcf2c('0x20')]?_0x5990d8[_0xcf2c('0x20')][_0xcf2c('0x22')]||null:null})[_0xcf2c('0x10')](function(_0x3162a8){if(_0x3162a8){return _0x3162a8[_0xcf2c('0x25')](_0x5990d8[_0xcf2c('0x1f')][_0xcf2c('0x26')],_[_0xcf2c('0x27')](_0x5990d8[_0xcf2c('0x1f')],['ids','id'])||{});}})[_0xcf2c('0x28')](function(_0x43b8ba){logger['info']('AddTags',_0x5990d8);logger['debug'](_0xcf2c('0x29'),_0x5990d8,JSON['stringify'](_0x43b8ba));_0x3e71a9(_0x43b8ba);})[_0xcf2c('0x1b')](function(_0x2fcdbc){logger['error'](_0xcf2c('0x29'),_0x2fcdbc[_0xcf2c('0x19')],_0x5990d8);_0x5bbe8b(_this['error'](0x1f4,_0x2fcdbc[_0xcf2c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index c87262e..f377007 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 _0x089c=['save','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x5a5a98,_0x74f555){var _0x7d43ef=function(_0x36116a){while(--_0x36116a){_0x5a5a98['push'](_0x5a5a98['shift']());}};_0x7d43ef(++_0x74f555);}(_0x089c,0xff));var _0xc089=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x089c[_0xda464c];return _0x19e222;};'use strict';var SmsInteractionEvents=require(_0xc089('0x0'));var events=[_0xc089('0x1'),'remove',_0xc089('0x2')];function createListener(_0x50fa87,_0x48c40c){return function(_0x4f77d8){_0x48c40c[_0xc089('0x3')](_0x50fa87,_0x4f77d8);};}function removeListener(_0x3f1d38,_0xc3aa9a){return function(){SmsInteractionEvents[_0xc089('0x4')](_0x3f1d38,_0xc3aa9a);};}exports[_0xc089('0x5')]=function(_0x50a833){for(var _0x25c391=0x0,_0x15d938=events[_0xc089('0x6')];_0x25c391<_0x15d938;_0x25c391++){var _0x122a56=events[_0x25c391];var _0x1b7247=createListener(_0xc089('0x7')+_0x122a56,_0x50a833);SmsInteractionEvents['on'](_0x122a56,_0x1b7247);}}; \ No newline at end of file +var _0xd9e0=['removeListener','register','length','smsInteraction:','./smsInteraction.events','remove','update','emit'];(function(_0x249577,_0x5577da){var _0x11f27b=function(_0x1c6d74){while(--_0x1c6d74){_0x249577['push'](_0x249577['shift']());}};_0x11f27b(++_0x5577da);}(_0xd9e0,0x1e4));var _0x0d9e=function(_0x5b0a11,_0x95e182){_0x5b0a11=_0x5b0a11-0x0;var _0x658208=_0xd9e0[_0x5b0a11];return _0x658208;};'use strict';var SmsInteractionEvents=require(_0x0d9e('0x0'));var events=['save',_0x0d9e('0x1'),_0x0d9e('0x2')];function createListener(_0x317366,_0x56398c){return function(_0xda2c5e){_0x56398c[_0x0d9e('0x3')](_0x317366,_0xda2c5e);};}function removeListener(_0x248c4b,_0x1a495f){return function(){SmsInteractionEvents[_0x0d9e('0x4')](_0x248c4b,_0x1a495f);};}exports[_0x0d9e('0x5')]=function(_0x4b00f2){for(var _0x5b9a1d=0x0,_0x3bcfda=events[_0x0d9e('0x6')];_0x5b9a1d<_0x3bcfda;_0x5b9a1d++){var _0x10804d=events[_0x5b9a1d];var _0x5dc9bd=createListener(_0x0d9e('0x7')+_0x10804d,_0x4b00f2);SmsInteractionEvents['on'](_0x10804d,_0x5dc9bd);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index e3da745..91e2e9c 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 _0x33d0=['path','Router','fs-extra','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer'];(function(_0x3dd81a,_0x5484c7){var _0x549571=function(_0x2ac948){while(--_0x2ac948){_0x3dd81a['push'](_0x3dd81a['shift']());}};_0x549571(++_0x5484c7);}(_0x33d0,0x99));var _0x033d=function(_0x398ec1,_0x1d63d8){_0x398ec1=_0x398ec1-0x0;var _0xcd9efa=_0x33d0[_0x398ec1];return _0xcd9efa;};'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('0xc')]('/',auth[_0x033d('0x8')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x033d('0xd')]);router[_0x033d('0xc')](_0x033d('0xe'),controller['status']);router[_0x033d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x033d('0xf')](_0x033d('0x10'),auth[_0x033d('0x8')](),controller[_0x033d('0x11')]);router['put'](_0x033d('0x12'),auth[_0x033d('0x8')](),controller[_0x033d('0x13')]);router[_0x033d('0x14')](_0x033d('0xa'),auth[_0x033d('0x8')](),controller[_0x033d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x42cf=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','tracked','sms','create','/:id/status','status','/:id','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x42cf,0x123));var _0xf42c=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x42cf[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0xf42c('0x0'));var util=require(_0xf42c('0x1'));var path=require('path');var timeout=require(_0xf42c('0x2'));var express=require(_0xf42c('0x3'));var router=express['Router']();var fs_extra=require(_0xf42c('0x4'));var auth=require(_0xf42c('0x5'));var interaction=require(_0xf42c('0x6'));var config=require(_0xf42c('0x7'));var controller=require('./smsMessage.controller');router[_0xf42c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf42c('0x9')]);router[_0xf42c('0x8')](_0xf42c('0xa'),auth[_0xf42c('0xb')](),controller['describe']);router[_0xf42c('0x8')]('/:id',auth[_0xf42c('0xb')](),controller[_0xf42c('0xc')]);router[_0xf42c('0xd')]('/',auth[_0xf42c('0xb')](),interaction[_0xf42c('0xe')](_0xf42c('0xf'),'smsmessage:create'),controller[_0xf42c('0x10')]);router[_0xf42c('0xd')](_0xf42c('0x11'),controller[_0xf42c('0x12')]);router['put'](_0xf42c('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xf42c('0x14')]('/:id/accept',auth[_0xf42c('0xb')](),controller[_0xf42c('0x15')]);router[_0xf42c('0x14')](_0xf42c('0x16'),auth['isAuthenticated'](),controller[_0xf42c('0x17')]);router[_0xf42c('0x18')]('/:id',auth[_0xf42c('0xb')](),controller[_0xf42c('0x19')]);module[_0xf42c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 36ae0fe..a0de4de 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 _0x3620=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x497ffc,_0x1d2290){var _0x584e1f=function(_0x556330){while(--_0x556330){_0x497ffc['push'](_0x497ffc['shift']());}};_0x584e1f(++_0x1d2290);}(_0x3620,0xcf));var _0x0362=function(_0xbd4b0f,_0x589522){_0xbd4b0f=_0xbd4b0f-0x0;var _0x2e6acf=_0x3620[_0xbd4b0f];return _0x2e6acf;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x0362('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x0362('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0362('0x2')]('in',_0x0362('0x3')),'defaultValue':_0x0362('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0362('0x4')]},'readAt':{'type':Sequelize[_0x0362('0x5')]},'secret':{'type':Sequelize[_0x0362('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0362('0x4')]},'providerResponse':{'type':Sequelize[_0x0362('0x6')]}}; \ No newline at end of file +var _0xed5f=['medium','ENUM','out','STRING','DATE','BOOLEAN','exports','TEXT'];(function(_0x44a4d3,_0x2ec0d4){var _0x61f685=function(_0x5ad4b3){while(--_0x5ad4b3){_0x44a4d3['push'](_0x44a4d3['shift']());}};_0x61f685(++_0x2ec0d4);}(_0xed5f,0x1e6));var _0xfed5=function(_0x1ecacb,_0x562449){_0x1ecacb=_0x1ecacb-0x0;var _0x297ba7=_0xed5f[_0x1ecacb];return _0x297ba7;};'use strict';var Sequelize=require('sequelize');module[_0xfed5('0x0')]={'body':{'type':Sequelize[_0xfed5('0x1')](_0xfed5('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfed5('0x3')]('in',_0xfed5('0x4')),'defaultValue':_0xfed5('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfed5('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xfed5('0x6')]},'secret':{'type':Sequelize[_0xfed5('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfed5('0x5')]},'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 67ed7a8..cced124 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 _0xe651=['client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsMessage','includeAll','include','findAll','rows','params','rawAttributes','fields','create','body','find','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','interaction','get','role','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise'];(function(_0x327841,_0x40ade0){var _0x18a99f=function(_0x1ae7de){while(--_0x1ae7de){_0x327841['push'](_0x327841['shift']());}};_0x18a99f(++_0x40ade0);}(_0xe651,0x1a5));var _0x1e65=function(_0x461930,_0x329a2a){_0x461930=_0x461930-0x0;var _0x382394=_0xe651[_0x461930];return _0x382394;};'use strict';var emlformat=require(_0x1e65('0x0'));var rimraf=require(_0x1e65('0x1'));var zipdir=require(_0x1e65('0x2'));var jsonpatch=require(_0x1e65('0x3'));var rp=require(_0x1e65('0x4'));var moment=require(_0x1e65('0x5'));var BPromise=require(_0x1e65('0x6'));var Mustache=require('mustache');var util=require(_0x1e65('0x7'));var path=require(_0x1e65('0x8'));var sox=require(_0x1e65('0x9'));var csv=require(_0x1e65('0xa'));var ejs=require(_0x1e65('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1e65('0xc'));var crypto=require('crypto');var jsforce=require(_0x1e65('0xd'));var deskjs=require(_0x1e65('0xe'));var toCsv=require(_0x1e65('0xa'));var querystring=require(_0x1e65('0xf'));var Papa=require(_0x1e65('0x10'));var Redis=require(_0x1e65('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1e65('0x12'));var as=require(_0x1e65('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e65('0x14'))(_0x1e65('0x15'));var utils=require(_0x1e65('0x16'));var config=require(_0x1e65('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1e65('0x18'))['db'];config[_0x1e65('0x19')]=_['defaults'](config[_0x1e65('0x19')],{'host':_0x1e65('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x1e65('0x1b')](socket);var jayson=require(_0x1e65('0x1c'));var client=jayson[_0x1e65('0x1d')][_0x1e65('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1e65('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x13472d,_0x3c0f80,_0x3360d1,_0x3cf3f5){return new BPromise(function(_0x3acde6,_0x441e79){var _0x381b93=_0x3cf3f5||client;return _0x381b93[_0x1e65('0x1f')](_0x13472d,_0x3360d1)['then'](function(_0x413d48){logger[_0x1e65('0x20')](_0x1e65('0x21'),_0x3c0f80,_0x1e65('0x22'));logger[_0x1e65('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3c0f80,_0x1e65('0x22'),JSON['stringify'](_0x413d48));if(_0x413d48[_0x1e65('0x24')]){if(_0x413d48[_0x1e65('0x24')]['code']===0x1f4){logger[_0x1e65('0x24')](_0x1e65('0x21'),_0x3c0f80,_0x413d48['error'][_0x1e65('0x25')]);return _0x441e79(_0x413d48[_0x1e65('0x24')]['message']);}logger[_0x1e65('0x24')](_0x1e65('0x21'),_0x3c0f80,_0x413d48[_0x1e65('0x24')][_0x1e65('0x25')]);return _0x3acde6(_0x413d48[_0x1e65('0x24')][_0x1e65('0x25')]);}else{logger[_0x1e65('0x20')]('SmsMessage,\x20%s,\x20%s',_0x3c0f80,'request\x20sent');_0x3acde6(_0x413d48[_0x1e65('0x26')]['message']);}})[_0x1e65('0x27')](function(_0x116b0f){logger[_0x1e65('0x24')]('SmsMessage,\x20%s,\x20%s',_0x3c0f80,_0x116b0f);_0x441e79(_0x116b0f);});});}function respondWithStatusCode(_0x3c2a8d,_0x2db73c){_0x2db73c=_0x2db73c||0xcc;return function(_0x2db213){if(_0x2db213){return _0x3c2a8d['sendStatus'](_0x2db73c);}return _0x3c2a8d['status'](_0x2db73c)['end']();};}function respondWithResult(_0x15d172,_0x38193a){_0x38193a=_0x38193a||0xc8;return function(_0x263704){if(_0x263704){return _0x15d172['status'](_0x38193a)[_0x1e65('0x28')](_0x263704);}};}function respondWithFilteredResult(_0x43a9e2,_0x2a248a){return function(_0x386bd5){if(_0x386bd5){var _0x1960c5=typeof _0x2a248a[_0x1e65('0x29')]===_0x1e65('0x2a')&&typeof _0x2a248a[_0x1e65('0x2b')]===_0x1e65('0x2a');var _0x19dcae=_0x386bd5[_0x1e65('0x2c')];var _0xe0e23e=_0x1960c5?0x0:_0x2a248a['offset'];var _0x1b4e4e=_0x1960c5?_0x386bd5[_0x1e65('0x2c')]:_0x2a248a[_0x1e65('0x29')]+_0x2a248a[_0x1e65('0x2b')];var _0x59aef5;if(_0x1b4e4e>=_0x19dcae){_0x1b4e4e=_0x19dcae;_0x59aef5=0xc8;}else{_0x59aef5=0xce;}_0x43a9e2[_0x1e65('0x2d')](_0x59aef5);return _0x43a9e2['set'](_0x1e65('0x2e'),_0xe0e23e+'-'+_0x1b4e4e+'/'+_0x19dcae)[_0x1e65('0x28')](_0x386bd5);}return null;};}function patchUpdates(_0xc84483){return function(_0x12f51f){try{jsonpatch[_0x1e65('0x2f')](_0x12f51f,_0xc84483,!![]);}catch(_0x1a7fdf){return BPromise[_0x1e65('0x30')](_0x1a7fdf);}return _0x12f51f[_0x1e65('0x31')]();};}function saveUpdates(_0x52dbf0,_0x1fb128){return function(_0x1ff5a0){if(_0x1ff5a0){return _0x1ff5a0[_0x1e65('0x32')](_0x52dbf0)['then'](function(_0x3b4f1b){return _0x3b4f1b;});}return null;};}function removeEntity(_0x4337ab,_0x3c433c){return function(_0x82f43b){if(_0x82f43b){return _0x82f43b[_0x1e65('0x33')]()[_0x1e65('0x34')](function(){_0x4337ab['status'](0xcc)[_0x1e65('0x35')]();});}};}function handleEntityNotFound(_0x20d2c7,_0x474fc){return function(_0x5779d0){if(!_0x5779d0){_0x20d2c7[_0x1e65('0x36')](0x194);}return _0x5779d0;};}function handleError(_0x651e3d,_0xb25d24){_0xb25d24=_0xb25d24||0x1f4;return function(_0x56481a){logger[_0x1e65('0x24')](_0x56481a[_0x1e65('0x37')]);if(_0x56481a[_0x1e65('0x38')]){delete _0x56481a[_0x1e65('0x38')];}_0x651e3d[_0x1e65('0x2d')](_0xb25d24)['send'](_0x56481a);};}exports[_0x1e65('0x39')]=function(_0x52d846,_0x1917a6){var _0x3b4f43={},_0x5171a8={},_0x22ed13={'count':0x0,'rows':[]};var _0x3d7547=_[_0x1e65('0x3a')](db['SmsMessage']['rawAttributes'],function(_0x1a4765){return{'name':_0x1a4765[_0x1e65('0x3b')],'type':_0x1a4765['type'][_0x1e65('0x3c')]};});_0x5171a8[_0x1e65('0x3d')]=_[_0x1e65('0x3a')](_0x3d7547,_0x1e65('0x38'));_0x5171a8[_0x1e65('0x3e')]=_[_0x1e65('0x3f')](_0x52d846[_0x1e65('0x3e')]);_0x5171a8[_0x1e65('0x40')]=_[_0x1e65('0x41')](_0x5171a8[_0x1e65('0x3d')],_0x5171a8[_0x1e65('0x3e')]);_0x3b4f43[_0x1e65('0x42')]=_['intersection'](_0x5171a8[_0x1e65('0x3d')],qs['fields'](_0x52d846[_0x1e65('0x3e')]['fields']));_0x3b4f43[_0x1e65('0x42')]=_0x3b4f43[_0x1e65('0x42')][_0x1e65('0x43')]?_0x3b4f43['attributes']:_0x5171a8[_0x1e65('0x3d')];if(!_0x52d846[_0x1e65('0x3e')][_0x1e65('0x44')]('nolimit')){_0x3b4f43[_0x1e65('0x2b')]=qs['limit'](_0x52d846[_0x1e65('0x3e')][_0x1e65('0x2b')]);_0x3b4f43[_0x1e65('0x29')]=qs['offset'](_0x52d846[_0x1e65('0x3e')][_0x1e65('0x29')]);}_0x3b4f43['order']=qs[_0x1e65('0x45')](_0x52d846['query']['sort']);_0x3b4f43[_0x1e65('0x46')]=qs[_0x1e65('0x40')](_[_0x1e65('0x47')](_0x52d846[_0x1e65('0x3e')],_0x5171a8[_0x1e65('0x40')]),_0x3d7547);if(_0x52d846[_0x1e65('0x3e')][_0x1e65('0x48')]){_0x3b4f43[_0x1e65('0x46')]=_[_0x1e65('0x49')](_0x3b4f43[_0x1e65('0x46')],{'$or':_[_0x1e65('0x3a')](_0x3d7547,function(_0x423198){if(_0x423198[_0x1e65('0x4a')]!==_0x1e65('0x4b')){var _0x5041ae={};_0x5041ae[_0x423198[_0x1e65('0x38')]]={'$like':'%'+_0x52d846[_0x1e65('0x3e')]['filter']+'%'};return _0x5041ae;}})});}_0x3b4f43=_['merge']({},_0x3b4f43,_0x52d846[_0x1e65('0x4c')]);var _0x23b8a8={'where':_0x3b4f43[_0x1e65('0x46')]};return db[_0x1e65('0x4d')][_0x1e65('0x2c')](_0x23b8a8)[_0x1e65('0x34')](function(_0x3c5026){_0x22ed13[_0x1e65('0x2c')]=_0x3c5026;if(_0x52d846[_0x1e65('0x3e')][_0x1e65('0x4e')]){_0x3b4f43[_0x1e65('0x4f')]=[{'all':!![]}];}return db[_0x1e65('0x4d')][_0x1e65('0x50')](_0x3b4f43);})[_0x1e65('0x34')](function(_0x3d92bb){_0x22ed13[_0x1e65('0x51')]=_0x3d92bb;return _0x22ed13;})['then'](respondWithFilteredResult(_0x1917a6,_0x3b4f43))[_0x1e65('0x27')](handleError(_0x1917a6,null));};exports['show']=function(_0x11a74c,_0x10eecc){var _0x54f395={'raw':!![],'where':{'id':_0x11a74c[_0x1e65('0x52')]['id']}},_0x51e046={};_0x51e046['model']=_[_0x1e65('0x3f')](db[_0x1e65('0x4d')][_0x1e65('0x53')]);_0x51e046['query']=_['keys'](_0x11a74c[_0x1e65('0x3e')]);_0x51e046[_0x1e65('0x40')]=_[_0x1e65('0x41')](_0x51e046[_0x1e65('0x3d')],_0x51e046[_0x1e65('0x3e')]);_0x54f395[_0x1e65('0x42')]=_[_0x1e65('0x41')](_0x51e046[_0x1e65('0x3d')],qs[_0x1e65('0x54')](_0x11a74c[_0x1e65('0x3e')]['fields']));_0x54f395['attributes']=_0x54f395[_0x1e65('0x42')][_0x1e65('0x43')]?_0x54f395[_0x1e65('0x42')]:_0x51e046['model'];if(_0x11a74c['query']['includeAll']){_0x54f395['include']=[{'all':!![]}];}_0x54f395=_[_0x1e65('0x49')]({},_0x54f395,_0x11a74c[_0x1e65('0x4c')]);return db[_0x1e65('0x4d')]['find'](_0x54f395)[_0x1e65('0x34')](handleEntityNotFound(_0x10eecc,null))[_0x1e65('0x34')](respondWithResult(_0x10eecc,null))[_0x1e65('0x27')](handleError(_0x10eecc,null));};exports['create']=function(_0x317c20,_0x4c70b8){return db[_0x1e65('0x4d')][_0x1e65('0x55')](_0x317c20['body'],{})[_0x1e65('0x34')](respondWithResult(_0x4c70b8,0xc9))['catch'](handleError(_0x4c70b8,null));};exports[_0x1e65('0x32')]=function(_0x3c492c,_0x4ef5ce){if(_0x3c492c['body']['id']){delete _0x3c492c['body']['id'];}return db[_0x1e65('0x4d')]['find']({'where':{'id':_0x3c492c['params']['id']}})['then'](handleEntityNotFound(_0x4ef5ce,null))[_0x1e65('0x34')](saveUpdates(_0x3c492c[_0x1e65('0x56')],null))['then'](respondWithResult(_0x4ef5ce,null))[_0x1e65('0x27')](handleError(_0x4ef5ce,null));};exports[_0x1e65('0x33')]=function(_0x41d4f9,_0x129b30){return db[_0x1e65('0x4d')][_0x1e65('0x57')]({'where':{'id':_0x41d4f9[_0x1e65('0x52')]['id']}})[_0x1e65('0x34')](handleEntityNotFound(_0x129b30,null))[_0x1e65('0x34')](removeEntity(_0x129b30,null))['catch'](handleError(_0x129b30,null));};exports['describe']=function(_0xa41e7c,_0x56ad80){return db[_0x1e65('0x4d')][_0x1e65('0x58')]()[_0x1e65('0x34')](respondWithResult(_0x56ad80,null))[_0x1e65('0x27')](handleError(_0x56ad80,null));};var interaction_log=require(_0x1e65('0x14'))(_0x1e65('0x59'));exports[_0x1e65('0x5a')]=function(_0xa0069b,_0x204957,_0x3ab46a){var _0x101730={'agent':{},'channel':'sms'};if(_0xa0069b[_0x1e65('0x56')]['id']){delete _0xa0069b[_0x1e65('0x56')]['id'];}_0xa0069b['body'][_0x1e65('0x5b')]=!![];_0xa0069b[_0x1e65('0x56')][_0x1e65('0x5c')]=moment()[_0x1e65('0x5d')](_0x1e65('0x5e'));_0xa0069b[_0x1e65('0x56')][_0x1e65('0x5f')]=_0xa0069b['body']['UserId']||_0xa0069b[_0x1e65('0x60')]['id'];_0x101730[_0x1e65('0x61')]['id']=_0xa0069b[_0x1e65('0x56')][_0x1e65('0x5f')];return db[_0x1e65('0x4d')][_0x1e65('0x57')]({'where':{'id':_0xa0069b['params']['id'],'UserId':null}})[_0x1e65('0x34')](handleEntityNotFound(_0x204957,null))[_0x1e65('0x34')](saveUpdates(_0xa0069b[_0x1e65('0x56')],null))['then'](function(_0x4c228e){if(_0x4c228e){_0x101730[_0x1e65('0x25')]=_0x4c228e['get']({'plain':!![]});return db[_0x1e65('0x62')][_0x1e65('0x57')]({'where':{'id':_0x4c228e[_0x1e65('0x63')]}});}return null;})[_0x1e65('0x34')](handleEntityNotFound(_0x204957,null))[_0x1e65('0x34')](function(_0x370f40){if(_0x370f40){return _0x370f40[_0x1e65('0x32')]({'UserId':_0xa0069b[_0x1e65('0x56')]['UserId'],'read1stAt':_[_0x1e65('0x64')](_0x370f40['read1stAt'])?moment()[_0x1e65('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1e65('0x34')](function(_0x78dbef){if(_0x78dbef){_0x101730[_0x1e65('0x65')]=_0x78dbef[_0x1e65('0x66')]({'plain':!![]});interaction_log[_0x1e65('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa0069b[_0x1e65('0x60')]['id'],_0xa0069b[_0x1e65('0x60')][_0x1e65('0x38')],_0xa0069b['user'][_0x1e65('0x67')],_0x101730['interaction']['id'],_0xa0069b[_0x1e65('0x56')]?JSON[_0x1e65('0x68')](_0xa0069b[_0x1e65('0x56')]):_0x1e65('0x69'));return respondWithRpcPromise(_0x1e65('0x6a'),'acceptMessage',_0x101730);}return null;})[_0x1e65('0x34')](function(_0x21b01e){var _0x23d3b0=_0x1e65('0x6b')+_0x21b01e['message']['ContactId'];return db[_0x1e65('0x6c')][_0x1e65('0x3e')](_0x23d3b0,{'type':db[_0x1e65('0x6d')][_0x1e65('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x24b312){return _0x24b312;});})[_0x1e65('0x34')](function(_0x58d6f9){if(_0x58d6f9){_0x101730[_0x1e65('0x25')][_0x1e65('0x6f')]=_0x58d6f9[0x0];if(!_0xa0069b['body'][_0x1e65('0x5f')])return;return db[_0x1e65('0x70')][_0x1e65('0x57')]({'where':{'id':_0xa0069b[_0x1e65('0x56')]['UserId'],'role':'agent'},'attributes':['id','name',_0x1e65('0x71'),_0x1e65('0x72'),_0x1e65('0x73')],'raw':!![]});}return null;})[_0x1e65('0x34')](function(_0x4f5d56){if(!_0x4f5d56)return null;_0x101730[_0x1e65('0x25')]['agent']=_0x4f5d56;return _0x101730;})[_0x1e65('0x34')](function(_0x1b36e6){if(_0x1b36e6){if(_0xa0069b[_0x1e65('0x56')][_0x1e65('0x74')]){_0x101730[_0x1e65('0x25')][_0x1e65('0x75')]=util[_0x1e65('0x5d')](_0x1e65('0x76'),_0xa0069b[_0x1e65('0x60')][_0x1e65('0x38')]);_0x101730[_0x1e65('0x25')][_0x1e65('0x77')]=_0x101730[_0x1e65('0x77')];_0x101730[_0x1e65('0x25')][_0x1e65('0x78')]=_0x101730[_0x1e65('0x77')];_0x101730[_0x1e65('0x25')][_0x1e65('0x79')]=_0x1e65('0x5a');return respondWithRpcPromise(_0x1e65('0x7a'),_0x1e65('0x7a'),{'event':_0x1e65('0x7b'),'message':_0x101730[_0x1e65('0x25')]},client9002)[_0x1e65('0x34')](function(){return _0x101730;});}return _0x101730;}return null;})['then'](respondWithResult(_0x204957,null))[_0x1e65('0x27')](handleError(_0x204957,null));};var interaction_log=require(_0x1e65('0x14'))(_0x1e65('0x59'));exports[_0x1e65('0x30')]=function(_0x58aef8,_0x1efcda,_0x35417a){var _0x3cd777={'agent':{},'channel':_0x1e65('0x7c')};if(_0x58aef8[_0x1e65('0x56')]['id']){delete _0x58aef8[_0x1e65('0x56')]['id'];}_0x58aef8['body'][_0x1e65('0x5f')]=_0x58aef8[_0x1e65('0x56')][_0x1e65('0x5f')]||_0x58aef8[_0x1e65('0x60')]['id'];_0x3cd777[_0x1e65('0x61')]['id']=_0x58aef8[_0x1e65('0x56')][_0x1e65('0x5f')];return db[_0x1e65('0x4d')][_0x1e65('0x57')]({'where':{'id':_0x58aef8[_0x1e65('0x52')]['id'],'UserId':null}})[_0x1e65('0x34')](handleEntityNotFound(_0x1efcda,null))[_0x1e65('0x34')](function(_0x213d18){if(_0x213d18){_0x3cd777['message']=_0x213d18[_0x1e65('0x66')]({'plain':!![]});return db[_0x1e65('0x62')][_0x1e65('0x57')]({'where':{'id':_0x213d18[_0x1e65('0x63')]}});}return null;})[_0x1e65('0x34')](handleEntityNotFound(_0x1efcda,null))[_0x1e65('0x34')](function(_0xa6a42f){if(_0xa6a42f){_0x3cd777['interaction']=_0xa6a42f[_0x1e65('0x66')]({'plain':!![]});interaction_log[_0x1e65('0x20')](_0x1e65('0x7d'),_0x58aef8[_0x1e65('0x60')]['id'],_0x58aef8[_0x1e65('0x60')][_0x1e65('0x38')],_0x58aef8['user'][_0x1e65('0x67')],_0x3cd777['interaction']['id'],_0x58aef8[_0x1e65('0x56')]?JSON[_0x1e65('0x68')](_0x58aef8[_0x1e65('0x56')]):'null');return respondWithRpcPromise(_0x1e65('0x7e'),_0x1e65('0x7f'),_0x3cd777);}return null;})[_0x1e65('0x34')](function(_0x418c34){var _0x5d5dd9=_0x1e65('0x6b')+_0x418c34[_0x1e65('0x25')][_0x1e65('0x80')];return db[_0x1e65('0x6c')][_0x1e65('0x3e')](_0x5d5dd9,{'type':db[_0x1e65('0x6d')][_0x1e65('0x6e')][_0x1e65('0x81')],'raw':!![]})[_0x1e65('0x34')](function(_0x2f8258){return _0x2f8258;});})[_0x1e65('0x34')](function(_0x3e61c3){if(_0x3e61c3){_0x3cd777[_0x1e65('0x25')][_0x1e65('0x6f')]=_0x3e61c3[0x0];if(!_0x58aef8['body'][_0x1e65('0x5f')])return;return db[_0x1e65('0x70')][_0x1e65('0x57')]({'where':{'id':_0x58aef8[_0x1e65('0x56')][_0x1e65('0x5f')],'role':_0x1e65('0x61')},'attributes':['id',_0x1e65('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0x39c18b){if(!_0x39c18b)return null;_0x3cd777[_0x1e65('0x25')][_0x1e65('0x61')]=_0x39c18b;return _0x3cd777;})[_0x1e65('0x34')](function(_0x32f37e){if(_0x32f37e){_0x32f37e[_0x1e65('0x25')][_0x1e65('0x75')]=util[_0x1e65('0x5d')](_0x1e65('0x76'),_0x58aef8['user'][_0x1e65('0x38')]);_0x32f37e[_0x1e65('0x25')]['channel']=_0x3cd777[_0x1e65('0x77')];_0x32f37e['message'][_0x1e65('0x78')]=_0x3cd777[_0x1e65('0x77')];_0x32f37e['message']['event']=_0x1e65('0x30');respondWithRpcPromise(_0x1e65('0x7a'),'EventManager',{'event':_0x1e65('0x82'),'message':_0x32f37e['message']},client9002);return _0x3cd777;}return null;})[_0x1e65('0x34')](respondWithResult(_0x1efcda,null))[_0x1e65('0x27')](handleError(_0x1efcda,null));};exports['status']=function(_0x12886d,_0x5a8ab9,_0x41fd81){if(_0x12886d['body']['id']){delete _0x12886d[_0x1e65('0x56')]['id'];}var _0x59b601;return db['SmsMessage'][_0x1e65('0x57')]({'where':{'id':_0x12886d[_0x1e65('0x52')]['id']}})[_0x1e65('0x34')](handleEntityNotFound(_0x5a8ab9,null))[_0x1e65('0x34')](function(_0x247f95){if(_0x247f95){_0x59b601=_0x247f95;return db[_0x1e65('0x83')][_0x1e65('0x57')]({'where':{'id':_0x247f95[_0x1e65('0x84')]}});}})['then'](handleEntityNotFound(_0x5a8ab9,null))[_0x1e65('0x34')](function(_0x5543fd){if(_0x5543fd){logger[_0x1e65('0x23')](_0x1e65('0x85'),_0x1e65('0x2d'),_0x1e65('0x86'),_0x5543fd[_0x1e65('0x4a')],util[_0x1e65('0x87')](_0x12886d['body'],{'showHidden':![],'depth':null}));switch(_0x5543fd['type']){case'twilio':if(_0x12886d['body'][_0x1e65('0x88')]&&_0x12886d['body'][_0x1e65('0x88')]===_0x59b601[_0x1e65('0x89')]){return _0x59b601['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1e65('0x2d'),_0x1e65('0x8a'),util[_0x1e65('0x87')](_0x12886d[_0x1e65('0x56')],{'showHidden':![],'depth':null}));}break;case _0x1e65('0x8b'):if(_0x12886d[_0x1e65('0x56')][_0x1e65('0x8c')]&&_0x12886d[_0x1e65('0x56')][_0x1e65('0x8c')]===_0x59b601[_0x1e65('0x89')]&&_[_0x1e65('0x8d')]([_0x1e65('0x8e'),_0x1e65('0x8f')],_0x12886d[_0x1e65('0x56')]['Status'])>=0x0){return _0x59b601['update']({'read':!![]});}else{logger['error'](_0x1e65('0x90'),_0x1e65('0x2d'),_0x1e65('0x91'),util[_0x1e65('0x87')](_0x12886d[_0x1e65('0x56')],{'showHidden':![],'depth':null}));}break;case _0x1e65('0x92'):var _0x42c474=_0x12886d[_0x1e65('0x56')][_0x1e65('0x93')][0x0];if(_0x42c474[_0x1e65('0x2d')][_0x1e65('0x94')]===_0x1e65('0x95')){return _0x59b601[_0x1e65('0x32')]({'read':!![]});}else{logger[_0x1e65('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1e65('0x2d'),_0x1e65('0x92'),util[_0x1e65('0x87')](_0x12886d[_0x1e65('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x59b601;}})[_0x1e65('0x34')](respondWithResult(_0x5a8ab9,null))[_0x1e65('0x27')](handleError(_0x5a8ab9,null));}; \ No newline at end of file +var _0x3914=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','isNil','read1stAt','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','acceptmessage','reject','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','contact','motionChannel','event','EventManager','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','groupName','infobip','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes'];(function(_0x1f81bc,_0x163f68){var _0x6f1ad4=function(_0x569ed9){while(--_0x569ed9){_0x1f81bc['push'](_0x1f81bc['shift']());}};_0x6f1ad4(++_0x163f68);}(_0x3914,0xeb));var _0x4391=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x3914[_0x349367];return _0x14179b;};'use strict';var emlformat=require(_0x4391('0x0'));var rimraf=require(_0x4391('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4391('0x2'));var rp=require(_0x4391('0x3'));var moment=require('moment');var BPromise=require(_0x4391('0x4'));var Mustache=require(_0x4391('0x5'));var util=require(_0x4391('0x6'));var path=require('path');var sox=require(_0x4391('0x7'));var csv=require(_0x4391('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4391('0x9'));var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var Redis=require(_0x4391('0xe'));var authService=require(_0x4391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4391('0x10'));var hardwareService=require(_0x4391('0x11'));var logger=require(_0x4391('0x12'))(_0x4391('0x13'));var utils=require('../../config/utils');var config=require(_0x4391('0x14'));var licenseUtil=require(_0x4391('0x15'));var db=require(_0x4391('0x16'))['db'];config[_0x4391('0x17')]=_[_0x4391('0x18')](config[_0x4391('0x17')],{'host':_0x4391('0x19'),'port':0x18eb});var socket=require(_0x4391('0x1a'))(new Redis(config['redis']));require(_0x4391('0x1b'))[_0x4391('0x1c')](socket);var jayson=require(_0x4391('0x1d'));var client=jayson[_0x4391('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x4391('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x343203,_0x3a1b80,_0x3e4585,_0x1c2038){return new BPromise(function(_0x2a79a4,_0x15e884){var _0x2b5117=_0x1c2038||client;return _0x2b5117[_0x4391('0x1f')](_0x343203,_0x3e4585)['then'](function(_0x4cfa6b){logger[_0x4391('0x20')]('SmsMessage,\x20%s,\x20%s',_0x3a1b80,_0x4391('0x21'));logger[_0x4391('0x22')](_0x4391('0x23'),_0x3a1b80,_0x4391('0x21'),JSON[_0x4391('0x24')](_0x4cfa6b));if(_0x4cfa6b['error']){if(_0x4cfa6b['error'][_0x4391('0x25')]===0x1f4){logger[_0x4391('0x26')](_0x4391('0x27'),_0x3a1b80,_0x4cfa6b['error'][_0x4391('0x28')]);return _0x15e884(_0x4cfa6b[_0x4391('0x26')][_0x4391('0x28')]);}logger[_0x4391('0x26')]('SmsMessage,\x20%s,\x20%s',_0x3a1b80,_0x4cfa6b[_0x4391('0x26')][_0x4391('0x28')]);return _0x2a79a4(_0x4cfa6b[_0x4391('0x26')][_0x4391('0x28')]);}else{logger[_0x4391('0x20')](_0x4391('0x27'),_0x3a1b80,'request\x20sent');_0x2a79a4(_0x4cfa6b[_0x4391('0x29')][_0x4391('0x28')]);}})[_0x4391('0x2a')](function(_0x333ca6){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3a1b80,_0x333ca6);_0x15e884(_0x333ca6);});});}function respondWithStatusCode(_0x11c859,_0x3aa79f){_0x3aa79f=_0x3aa79f||0xcc;return function(_0x3f2554){if(_0x3f2554){return _0x11c859[_0x4391('0x2b')](_0x3aa79f);}return _0x11c859[_0x4391('0x2c')](_0x3aa79f)['end']();};}function respondWithResult(_0x49860f,_0x4ee253){_0x4ee253=_0x4ee253||0xc8;return function(_0x5a03ee){if(_0x5a03ee){return _0x49860f[_0x4391('0x2c')](_0x4ee253)[_0x4391('0x2d')](_0x5a03ee);}};}function respondWithFilteredResult(_0x471d43,_0x2f7b18){return function(_0x49aa36){if(_0x49aa36){var _0x34059f=typeof _0x2f7b18[_0x4391('0x2e')]===_0x4391('0x2f')&&typeof _0x2f7b18[_0x4391('0x30')]===_0x4391('0x2f');var _0x47b39a=_0x49aa36[_0x4391('0x31')];var _0x3edb24=_0x34059f?0x0:_0x2f7b18[_0x4391('0x2e')];var _0x2b5a06=_0x34059f?_0x49aa36[_0x4391('0x31')]:_0x2f7b18[_0x4391('0x2e')]+_0x2f7b18[_0x4391('0x30')];var _0x1b4f0d;if(_0x2b5a06>=_0x47b39a){_0x2b5a06=_0x47b39a;_0x1b4f0d=0xc8;}else{_0x1b4f0d=0xce;}_0x471d43[_0x4391('0x2c')](_0x1b4f0d);return _0x471d43[_0x4391('0x32')](_0x4391('0x33'),_0x3edb24+'-'+_0x2b5a06+'/'+_0x47b39a)['json'](_0x49aa36);}return null;};}function patchUpdates(_0x46db4c){return function(_0x50bd4c){try{jsonpatch[_0x4391('0x34')](_0x50bd4c,_0x46db4c,!![]);}catch(_0x586940){return BPromise['reject'](_0x586940);}return _0x50bd4c[_0x4391('0x35')]();};}function saveUpdates(_0xf8313b,_0x55eb39){return function(_0x433887){if(_0x433887){return _0x433887[_0x4391('0x36')](_0xf8313b)[_0x4391('0x37')](function(_0x205b8e){return _0x205b8e;});}return null;};}function removeEntity(_0x4afd6c,_0x181a61){return function(_0x48b82f){if(_0x48b82f){return _0x48b82f[_0x4391('0x38')]()['then'](function(){_0x4afd6c[_0x4391('0x2c')](0xcc)[_0x4391('0x39')]();});}};}function handleEntityNotFound(_0x12cea0,_0x3224dc){return function(_0x321aed){if(!_0x321aed){_0x12cea0[_0x4391('0x2b')](0x194);}return _0x321aed;};}function handleError(_0x44f1e2,_0x4235b3){_0x4235b3=_0x4235b3||0x1f4;return function(_0x420fdf){logger[_0x4391('0x26')](_0x420fdf[_0x4391('0x3a')]);if(_0x420fdf[_0x4391('0x3b')]){delete _0x420fdf[_0x4391('0x3b')];}_0x44f1e2[_0x4391('0x2c')](_0x4235b3)[_0x4391('0x3c')](_0x420fdf);};}exports[_0x4391('0x3d')]=function(_0x7f513a,_0x3cac53){var _0x4c2828={},_0x56a914={},_0x7a2723={'count':0x0,'rows':[]};var _0x3c0740=_[_0x4391('0x3e')](db[_0x4391('0x3f')][_0x4391('0x40')],function(_0x1c716c){return{'name':_0x1c716c[_0x4391('0x41')],'type':_0x1c716c[_0x4391('0x42')]['key']};});_0x56a914[_0x4391('0x43')]=_['map'](_0x3c0740,'name');_0x56a914['query']=_['keys'](_0x7f513a[_0x4391('0x44')]);_0x56a914[_0x4391('0x45')]=_[_0x4391('0x46')](_0x56a914[_0x4391('0x43')],_0x56a914['query']);_0x4c2828['attributes']=_[_0x4391('0x46')](_0x56a914['model'],qs[_0x4391('0x47')](_0x7f513a[_0x4391('0x44')][_0x4391('0x47')]));_0x4c2828[_0x4391('0x48')]=_0x4c2828[_0x4391('0x48')][_0x4391('0x49')]?_0x4c2828['attributes']:_0x56a914[_0x4391('0x43')];if(!_0x7f513a[_0x4391('0x44')][_0x4391('0x4a')](_0x4391('0x4b'))){_0x4c2828[_0x4391('0x30')]=qs[_0x4391('0x30')](_0x7f513a[_0x4391('0x44')]['limit']);_0x4c2828[_0x4391('0x2e')]=qs[_0x4391('0x2e')](_0x7f513a[_0x4391('0x44')][_0x4391('0x2e')]);}_0x4c2828[_0x4391('0x4c')]=qs[_0x4391('0x4d')](_0x7f513a[_0x4391('0x44')]['sort']);_0x4c2828[_0x4391('0x4e')]=qs['filters'](_[_0x4391('0x4f')](_0x7f513a[_0x4391('0x44')],_0x56a914[_0x4391('0x45')]),_0x3c0740);if(_0x7f513a[_0x4391('0x44')][_0x4391('0x50')]){_0x4c2828[_0x4391('0x4e')]=_[_0x4391('0x51')](_0x4c2828[_0x4391('0x4e')],{'$or':_[_0x4391('0x3e')](_0x3c0740,function(_0x20859b){if(_0x20859b[_0x4391('0x42')]!==_0x4391('0x52')){var _0x125bd7={};_0x125bd7[_0x20859b['name']]={'$like':'%'+_0x7f513a['query'][_0x4391('0x50')]+'%'};return _0x125bd7;}})});}_0x4c2828=_[_0x4391('0x51')]({},_0x4c2828,_0x7f513a[_0x4391('0x53')]);var _0x3ea728={'where':_0x4c2828[_0x4391('0x4e')]};return db[_0x4391('0x3f')]['count'](_0x3ea728)[_0x4391('0x37')](function(_0x5a47f2){_0x7a2723[_0x4391('0x31')]=_0x5a47f2;if(_0x7f513a['query'][_0x4391('0x54')]){_0x4c2828[_0x4391('0x55')]=[{'all':!![]}];}return db[_0x4391('0x3f')][_0x4391('0x56')](_0x4c2828);})[_0x4391('0x37')](function(_0x3bdeb4){_0x7a2723['rows']=_0x3bdeb4;return _0x7a2723;})[_0x4391('0x37')](respondWithFilteredResult(_0x3cac53,_0x4c2828))[_0x4391('0x2a')](handleError(_0x3cac53,null));};exports[_0x4391('0x57')]=function(_0xf2c6e0,_0x29470e){var _0x118d10={'raw':!![],'where':{'id':_0xf2c6e0[_0x4391('0x58')]['id']}},_0x308b42={};_0x308b42[_0x4391('0x43')]=_[_0x4391('0x59')](db[_0x4391('0x3f')][_0x4391('0x40')]);_0x308b42[_0x4391('0x44')]=_['keys'](_0xf2c6e0[_0x4391('0x44')]);_0x308b42[_0x4391('0x45')]=_[_0x4391('0x46')](_0x308b42['model'],_0x308b42[_0x4391('0x44')]);_0x118d10[_0x4391('0x48')]=_[_0x4391('0x46')](_0x308b42['model'],qs[_0x4391('0x47')](_0xf2c6e0[_0x4391('0x44')]['fields']));_0x118d10[_0x4391('0x48')]=_0x118d10[_0x4391('0x48')][_0x4391('0x49')]?_0x118d10[_0x4391('0x48')]:_0x308b42[_0x4391('0x43')];if(_0xf2c6e0[_0x4391('0x44')][_0x4391('0x54')]){_0x118d10['include']=[{'all':!![]}];}_0x118d10=_[_0x4391('0x51')]({},_0x118d10,_0xf2c6e0[_0x4391('0x53')]);return db[_0x4391('0x3f')][_0x4391('0x5a')](_0x118d10)[_0x4391('0x37')](handleEntityNotFound(_0x29470e,null))['then'](respondWithResult(_0x29470e,null))[_0x4391('0x2a')](handleError(_0x29470e,null));};exports[_0x4391('0x5b')]=function(_0x3edb09,_0x37d701){return db[_0x4391('0x3f')][_0x4391('0x5b')](_0x3edb09['body'],{})[_0x4391('0x37')](respondWithResult(_0x37d701,0xc9))['catch'](handleError(_0x37d701,null));};exports[_0x4391('0x36')]=function(_0x8c206e,_0x51d168){if(_0x8c206e[_0x4391('0x5c')]['id']){delete _0x8c206e[_0x4391('0x5c')]['id'];}return db[_0x4391('0x3f')][_0x4391('0x5a')]({'where':{'id':_0x8c206e[_0x4391('0x58')]['id']}})[_0x4391('0x37')](handleEntityNotFound(_0x51d168,null))[_0x4391('0x37')](saveUpdates(_0x8c206e[_0x4391('0x5c')],null))['then'](respondWithResult(_0x51d168,null))[_0x4391('0x2a')](handleError(_0x51d168,null));};exports[_0x4391('0x38')]=function(_0x258642,_0x2c9025){return db[_0x4391('0x3f')][_0x4391('0x5a')]({'where':{'id':_0x258642[_0x4391('0x58')]['id']}})['then'](handleEntityNotFound(_0x2c9025,null))[_0x4391('0x37')](removeEntity(_0x2c9025,null))[_0x4391('0x2a')](handleError(_0x2c9025,null));};exports[_0x4391('0x5d')]=function(_0x2df7bf,_0x349125){return db[_0x4391('0x3f')]['describe']()[_0x4391('0x37')](respondWithResult(_0x349125,null))[_0x4391('0x2a')](handleError(_0x349125,null));};var interaction_log=require(_0x4391('0x12'))(_0x4391('0x5e'));exports[_0x4391('0x5f')]=function(_0x1fa57e,_0x2cf09b,_0x5801c2){var _0x3f9b7b={'agent':{},'channel':_0x4391('0x60')};if(_0x1fa57e[_0x4391('0x5c')]['id']){delete _0x1fa57e[_0x4391('0x5c')]['id'];}_0x1fa57e[_0x4391('0x5c')][_0x4391('0x61')]=!![];_0x1fa57e[_0x4391('0x5c')][_0x4391('0x62')]=moment()[_0x4391('0x63')](_0x4391('0x64'));_0x1fa57e[_0x4391('0x5c')][_0x4391('0x65')]=_0x1fa57e[_0x4391('0x5c')][_0x4391('0x65')]||_0x1fa57e[_0x4391('0x66')]['id'];_0x3f9b7b['agent']['id']=_0x1fa57e[_0x4391('0x5c')][_0x4391('0x65')];return db[_0x4391('0x3f')][_0x4391('0x5a')]({'where':{'id':_0x1fa57e['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2cf09b,null))[_0x4391('0x37')](saveUpdates(_0x1fa57e[_0x4391('0x5c')],null))[_0x4391('0x37')](function(_0x203de3){if(_0x203de3){_0x3f9b7b['message']=_0x203de3[_0x4391('0x67')]({'plain':!![]});return db[_0x4391('0x68')][_0x4391('0x5a')]({'where':{'id':_0x203de3['SmsInteractionId']}});}return null;})[_0x4391('0x37')](handleEntityNotFound(_0x2cf09b,null))[_0x4391('0x37')](function(_0x10bdcf){if(_0x10bdcf){return _0x10bdcf[_0x4391('0x36')]({'UserId':_0x1fa57e['body'][_0x4391('0x65')],'read1stAt':_[_0x4391('0x69')](_0x10bdcf[_0x4391('0x6a')])?moment()[_0x4391('0x63')](_0x4391('0x64')):undefined});}return null;})[_0x4391('0x37')](function(_0x5cd104){if(_0x5cd104){_0x3f9b7b[_0x4391('0x6b')]=_0x5cd104[_0x4391('0x67')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1fa57e['user']['id'],_0x1fa57e[_0x4391('0x66')][_0x4391('0x3b')],_0x1fa57e[_0x4391('0x66')][_0x4391('0x6c')],_0x3f9b7b['interaction']['id'],_0x1fa57e[_0x4391('0x5c')]?JSON['stringify'](_0x1fa57e[_0x4391('0x5c')]):'null');return respondWithRpcPromise(_0x4391('0x6d'),_0x4391('0x6e'),_0x3f9b7b);}return null;})[_0x4391('0x37')](function(_0x264751){var _0x1fbf81=_0x4391('0x6f')+_0x264751[_0x4391('0x28')][_0x4391('0x70')];return db['sequelize'][_0x4391('0x44')](_0x1fbf81,{'type':db[_0x4391('0x71')][_0x4391('0x72')][_0x4391('0x73')],'raw':!![]})['then'](function(_0x4b19be){return _0x4b19be;});})[_0x4391('0x37')](function(_0x453a86){if(_0x453a86){_0x3f9b7b[_0x4391('0x28')]['contact']=_0x453a86[0x0];if(!_0x1fa57e[_0x4391('0x5c')][_0x4391('0x65')])return;return db[_0x4391('0x74')][_0x4391('0x5a')]({'where':{'id':_0x1fa57e[_0x4391('0x5c')][_0x4391('0x65')],'role':_0x4391('0x75')},'attributes':['id',_0x4391('0x3b'),_0x4391('0x76'),_0x4391('0x77'),_0x4391('0x78')],'raw':!![]});}return null;})['then'](function(_0x662359){if(!_0x662359)return null;_0x3f9b7b[_0x4391('0x28')][_0x4391('0x75')]=_0x662359;return _0x3f9b7b;})[_0x4391('0x37')](function(_0x1e34e5){if(_0x1e34e5){if(_0x1fa57e[_0x4391('0x5c')][_0x4391('0x79')]){_0x3f9b7b[_0x4391('0x28')][_0x4391('0x7a')]=util[_0x4391('0x63')](_0x4391('0x7b'),_0x1fa57e['user']['name']);_0x3f9b7b[_0x4391('0x28')][_0x4391('0x7c')]=_0x3f9b7b[_0x4391('0x7c')];_0x3f9b7b[_0x4391('0x28')]['motionChannel']=_0x3f9b7b[_0x4391('0x7c')];_0x3f9b7b[_0x4391('0x28')]['event']=_0x4391('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x4391('0x7d'),'message':_0x3f9b7b[_0x4391('0x28')]},client9002)[_0x4391('0x37')](function(){return _0x3f9b7b;});}return _0x3f9b7b;}return null;})[_0x4391('0x37')](respondWithResult(_0x2cf09b,null))[_0x4391('0x2a')](handleError(_0x2cf09b,null));};var interaction_log=require(_0x4391('0x12'))('sms-interactions');exports[_0x4391('0x7e')]=function(_0x11cd7a,_0x41c28f,_0x2abade){var _0x1eca50={'agent':{},'channel':_0x4391('0x60')};if(_0x11cd7a[_0x4391('0x5c')]['id']){delete _0x11cd7a[_0x4391('0x5c')]['id'];}_0x11cd7a[_0x4391('0x5c')][_0x4391('0x65')]=_0x11cd7a[_0x4391('0x5c')][_0x4391('0x65')]||_0x11cd7a[_0x4391('0x66')]['id'];_0x1eca50[_0x4391('0x75')]['id']=_0x11cd7a[_0x4391('0x5c')][_0x4391('0x65')];return db[_0x4391('0x3f')][_0x4391('0x5a')]({'where':{'id':_0x11cd7a[_0x4391('0x58')]['id'],'UserId':null}})[_0x4391('0x37')](handleEntityNotFound(_0x41c28f,null))['then'](function(_0x3f2fc8){if(_0x3f2fc8){_0x1eca50['message']=_0x3f2fc8[_0x4391('0x67')]({'plain':!![]});return db[_0x4391('0x68')][_0x4391('0x5a')]({'where':{'id':_0x3f2fc8[_0x4391('0x7f')]}});}return null;})[_0x4391('0x37')](handleEntityNotFound(_0x41c28f,null))[_0x4391('0x37')](function(_0x4d9404){if(_0x4d9404){_0x1eca50[_0x4391('0x6b')]=_0x4d9404[_0x4391('0x67')]({'plain':!![]});interaction_log[_0x4391('0x20')](_0x4391('0x80'),_0x11cd7a['user']['id'],_0x11cd7a[_0x4391('0x66')][_0x4391('0x3b')],_0x11cd7a[_0x4391('0x66')][_0x4391('0x6c')],_0x1eca50[_0x4391('0x6b')]['id'],_0x11cd7a[_0x4391('0x5c')]?JSON[_0x4391('0x24')](_0x11cd7a[_0x4391('0x5c')]):_0x4391('0x81'));return respondWithRpcPromise(_0x4391('0x82'),_0x4391('0x83'),_0x1eca50);}return null;})['then'](function(_0x5a0f79){var _0x3eed4c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a0f79[_0x4391('0x28')][_0x4391('0x70')];return db[_0x4391('0x84')]['query'](_0x3eed4c,{'type':db[_0x4391('0x71')][_0x4391('0x72')][_0x4391('0x73')],'raw':!![]})[_0x4391('0x37')](function(_0xffcefa){return _0xffcefa;});})[_0x4391('0x37')](function(_0x563d9d){if(_0x563d9d){_0x1eca50[_0x4391('0x28')][_0x4391('0x85')]=_0x563d9d[0x0];if(!_0x11cd7a[_0x4391('0x5c')][_0x4391('0x65')])return;return db[_0x4391('0x74')]['find']({'where':{'id':_0x11cd7a[_0x4391('0x5c')]['UserId'],'role':'agent'},'attributes':['id','name',_0x4391('0x76'),_0x4391('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x396574){if(!_0x396574)return null;_0x1eca50[_0x4391('0x28')][_0x4391('0x75')]=_0x396574;return _0x1eca50;})[_0x4391('0x37')](function(_0x12b0fc){if(_0x12b0fc){_0x12b0fc[_0x4391('0x28')]['interface']=util['format'](_0x4391('0x7b'),_0x11cd7a[_0x4391('0x66')][_0x4391('0x3b')]);_0x12b0fc[_0x4391('0x28')][_0x4391('0x7c')]=_0x1eca50[_0x4391('0x7c')];_0x12b0fc[_0x4391('0x28')][_0x4391('0x86')]=_0x1eca50['channel'];_0x12b0fc[_0x4391('0x28')][_0x4391('0x87')]=_0x4391('0x7e');respondWithRpcPromise(_0x4391('0x88'),_0x4391('0x88'),{'event':'rejectmessage','message':_0x12b0fc['message']},client9002);return _0x1eca50;}return null;})[_0x4391('0x37')](respondWithResult(_0x41c28f,null))[_0x4391('0x2a')](handleError(_0x41c28f,null));};exports['status']=function(_0x42ddd4,_0x486dd2,_0x41d7a0){if(_0x42ddd4[_0x4391('0x5c')]['id']){delete _0x42ddd4[_0x4391('0x5c')]['id'];}var _0x4dc403;return db[_0x4391('0x3f')][_0x4391('0x5a')]({'where':{'id':_0x42ddd4[_0x4391('0x58')]['id']}})[_0x4391('0x37')](handleEntityNotFound(_0x486dd2,null))[_0x4391('0x37')](function(_0x19b16a){if(_0x19b16a){_0x4dc403=_0x19b16a;return db[_0x4391('0x89')][_0x4391('0x5a')]({'where':{'id':_0x19b16a[_0x4391('0x8a')]}});}})[_0x4391('0x37')](handleEntityNotFound(_0x486dd2,null))[_0x4391('0x37')](function(_0x5aa2bb){if(_0x5aa2bb){logger[_0x4391('0x22')](_0x4391('0x23'),_0x4391('0x2c'),'received\x20delivery\x20report\x20from',_0x5aa2bb[_0x4391('0x42')],util['inspect'](_0x42ddd4[_0x4391('0x5c')],{'showHidden':![],'depth':null}));switch(_0x5aa2bb['type']){case _0x4391('0x8b'):if(_0x42ddd4['body'][_0x4391('0x8c')]&&_0x42ddd4[_0x4391('0x5c')]['MessageSid']===_0x4dc403[_0x4391('0x8d')]){return _0x4dc403[_0x4391('0x36')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4391('0x2c'),_0x4391('0x8b'),util[_0x4391('0x8e')](_0x42ddd4[_0x4391('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x4391('0x8f'):if(_0x42ddd4[_0x4391('0x5c')][_0x4391('0x90')]&&_0x42ddd4['body'][_0x4391('0x90')]===_0x4dc403[_0x4391('0x8d')]&&_[_0x4391('0x91')]([_0x4391('0x92'),_0x4391('0x93')],_0x42ddd4[_0x4391('0x5c')][_0x4391('0x94')])>=0x0){return _0x4dc403[_0x4391('0x36')]({'read':!![]});}else{logger[_0x4391('0x26')](_0x4391('0x95'),_0x4391('0x2c'),_0x4391('0x96'),util['inspect'](_0x42ddd4['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4e20d8=_0x42ddd4[_0x4391('0x5c')][_0x4391('0x97')][0x0];if(_0x4e20d8[_0x4391('0x2c')][_0x4391('0x98')]==='DELIVERED'){return _0x4dc403[_0x4391('0x36')]({'read':!![]});}else{logger[_0x4391('0x26')](_0x4391('0x95'),_0x4391('0x2c'),_0x4391('0x99'),util[_0x4391('0x8e')](_0x42ddd4[_0x4391('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x4dc403;}})['then'](respondWithResult(_0x486dd2,null))[_0x4391('0x2a')](handleError(_0x486dd2,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index c70c68a..e59b51a 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 _0x5753=['hasOwnProperty','exports','events','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x201bda,_0x180641){var _0x4074cd=function(_0x3c2dff){while(--_0x3c2dff){_0x201bda['push'](_0x201bda['shift']());}};_0x4074cd(++_0x180641);}(_0x5753,0xfe));var _0x3575=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5753[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x3575('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x3575('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3575('0x2')](0x0);var events={'afterCreate':_0x3575('0x3'),'afterUpdate':_0x3575('0x4'),'afterDestroy':_0x3575('0x5')};function emitEvent(_0x49ee55){return function(_0xd73360,_0x2482aa,_0x2f080c){SmsMessageEvents[_0x3575('0x6')](_0x49ee55+':'+_0xd73360['id'],_0xd73360);SmsMessageEvents[_0x3575('0x6')](_0x49ee55,_0xd73360);_0x2f080c(null);};}for(var e in events){if(events[_0x3575('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x3575('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xcbfa=['exports','../../mysqldb','SmsMessage','setMaxListeners','remove','emit'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xcbfa,0x1b1));var _0xacbf=function(_0x19eddf,_0x3b50cf){_0x19eddf=_0x19eddf-0x0;var _0x1c10f6=_0xcbfa[_0x19eddf];return _0x1c10f6;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xacbf('0x0'))['db'][_0xacbf('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xacbf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xacbf('0x3')};function emitEvent(_0x18df72){return function(_0x263902,_0x5b7f90,_0x4ed21c){SmsMessageEvents['emit'](_0x18df72+':'+_0x263902['id'],_0x263902);SmsMessageEvents[_0xacbf('0x4')](_0x18df72,_0x263902);_0x4ed21c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xacbf('0x5')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0099bd9..924bb8a 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 _0xab94=['SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','/status?token=','token','sid','update','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','plivo','authId','remote','format','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','crypto','text','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','applicationId','bandwidth','intelepeer','apiKey','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','Token\x20not\x20received','finally','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','UserId','isNil','SmsInteraction','findOne','then','error'];(function(_0x53ad14,_0x454a90){var _0x3d4ac4=function(_0x5c47ef){while(--_0x5c47ef){_0x53ad14['push'](_0x53ad14['shift']());}};_0x3d4ac4(++_0x454a90);}(_0xab94,0x14d));var _0x4ab9=function(_0x21d83c,_0x2b9c10){_0x21d83c=_0x21d83c-0x0;var _0x2d7c76=_0xab94[_0x21d83c];return _0x2d7c76;};'use strict';var _=require(_0x4ab9('0x0'));var util=require(_0x4ab9('0x1'));var logger=require(_0x4ab9('0x2'))('api');var moment=require(_0x4ab9('0x3'));var BPromise=require(_0x4ab9('0x4'));var rp=require(_0x4ab9('0x5'));var fs=require('fs');var path=require(_0x4ab9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ab9('0x7'));module[_0x4ab9('0x8')]=function(_0xe940c6,_0x122a31){return _0xe940c6[_0x4ab9('0x9')](_0x4ab9('0xa'),attributes,{'tableName':_0x4ab9('0xb'),'paranoid':![],'indexes':[{'name':_0x4ab9('0xc'),'fields':['messageId']},{'name':_0x4ab9('0xd'),'fields':[_0x4ab9('0xe')],'type':_0x4ab9('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x82c95e,_0x197fdd,_0x95996f){var _0x2b44d0=_0xe940c6[_0x4ab9('0x10')];var _0x1248c7=_0x82c95e[_0x4ab9('0x11')]({'plain':!![]});if(_0x1248c7['direction'][_0x4ab9('0x12')]()==='in'||_0x1248c7[_0x4ab9('0x13')][_0x4ab9('0x12')]()===_0x4ab9('0x14')&&!_0x1248c7['secret']&&!_['isNil'](_0x1248c7[_0x4ab9('0x15')])&&!_[_0x4ab9('0x16')](_0x1248c7['SmsInteractionId'])){_0x2b44d0[_0x4ab9('0x17')][_0x4ab9('0x18')]({'where':{'id':_0x1248c7['SmsInteractionId']}})[_0x4ab9('0x19')](function(_0x5a8395){if(_0x5a8395){_0x5a8395['update']({'lastMsgAt':_0x1248c7['createdAt'],'lastMsgDirection':_0x1248c7[_0x4ab9('0x13')][_0x4ab9('0x12')]()});}})['catch'](function(_0x5421bd){console[_0x4ab9('0x1a')](_0x5421bd);});}if(_0x1248c7[_0x4ab9('0x13')]===_0x4ab9('0x14')&&!_0x1248c7['secret']){var _0x40aed4;_0x2b44d0[_0x4ab9('0x1b')][_0x4ab9('0x1c')]({'where':{'id':_0x1248c7[_0x4ab9('0x1d')]},'raw':!![]})[_0x4ab9('0x19')](function(_0x268a03){_0x40aed4=_0x268a03;if(_0x40aed4&&_0x40aed4['type']){switch(_0x40aed4['type']){case _0x4ab9('0x1e'):var _0x2a5d06=require(_0x4ab9('0x1e'));if(_0x40aed4[_0x4ab9('0x1f')]&&_0x40aed4[_0x4ab9('0x20')]&&_0x40aed4['phone']){var _0x54cbe4=new _0x2a5d06(_0x40aed4[_0x4ab9('0x1f')],_0x40aed4['authToken']);_0x54cbe4['messages']['create']({'body':_0x1248c7[_0x4ab9('0xe')],'to':_0x1248c7[_0x4ab9('0x21')],'from':_0x40aed4[_0x4ab9('0x21')],'statusCallback':_0x40aed4['remote']+'/api/sms/messages/'+_0x1248c7['id']+_0x4ab9('0x22')+_0x40aed4[_0x4ab9('0x23')]})[_0x4ab9('0x19')](function(_0x23e906){if(_0x23e906[_0x4ab9('0x24')]){return _0x82c95e[_0x4ab9('0x25')]({'messageId':_0x23e906[_0x4ab9('0x24')]});}})[_0x4ab9('0x26')](function(_0x49cd84){logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),_0x4ab9('0x1e'),util[_0x4ab9('0x28')](_0x49cd84,{'showHidden':![],'depth':null}));});}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x1e'),_0x4ab9('0x2a'));}break;case _0x4ab9('0x2b'):var _0x547626=_0x4ab9('0x2c');if(_0x40aed4[_0x4ab9('0x2d')]&&_0x40aed4[_0x4ab9('0x2e')]){var _0x1dacb3={'recipient':[_0x1248c7['phone']],'message':_0x1248c7[_0x4ab9('0xe')],'message_type':_0x40aed4['smsMethod']};if(_0x40aed4[_0x4ab9('0x2f')]&&_0x40aed4[_0x4ab9('0x2f')]!=='SI'){_0x1dacb3[_0x4ab9('0x30')]=_0x40aed4['phone'];}var _0x3c9818={'url':_0x547626+_0x4ab9('0x31')+_0x40aed4[_0x4ab9('0x2d')]+_0x4ab9('0x32')+_0x40aed4[_0x4ab9('0x2e')],'method':_0x4ab9('0x33')};rp(_0x3c9818)[_0x4ab9('0x19')](function(_0x1eedcb){var _0x276a12=_0x1eedcb[_0x4ab9('0x34')](';');var _0x3a23d8={'user_key':_0x276a12[0x0],'session_key':_0x276a12[0x1]};_0x3c9818={'url':_0x547626+_0x4ab9('0x35'),'method':_0x4ab9('0x36'),'headers':{'user_key':_0x3a23d8[_0x4ab9('0x37')],'Session_key':_0x3a23d8[_0x4ab9('0x38')]},'json':!![],'body':_0x1dacb3};return rp(_0x3c9818);})[_0x4ab9('0x19')](function(_0x39f414){if(_0x39f414[_0x4ab9('0x39')]>=0x1){var _0x5bdc76={'messageId':_0x39f414['internal_order_id']};if(_0x40aed4[_0x4ab9('0x2f')]!=='GP'||!_0x40aed4['deliveryReport']){_0x5bdc76['read']=!![];}return _0x82c95e[_0x4ab9('0x25')](_0x5bdc76);}else{return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x2b'),util[_0x4ab9('0x28')](_0x39f414,{'showHidden':![],'depth':null}));}})[_0x4ab9('0x26')](function(_0xc30c09){return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x2b'),util[_0x4ab9('0x28')](_0xc30c09,{'showHidden':![],'depth':null}));});}else{logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),'skebby',_0x4ab9('0x3a'));}break;case _0x4ab9('0x3b'):if(_0x40aed4[_0x4ab9('0x20')]){var _0x1abb96={'recipient':_0x1248c7[_0x4ab9('0x21')],'message':_0x1248c7[_0x4ab9('0xe')],'sender':_0x40aed4[_0x4ab9('0x3c')]||_0x40aed4['phone'],'authorization':_0x40aed4[_0x4ab9('0x20')]};var _0x197fdd={'method':_0x4ab9('0x36'),'uri':_0x4ab9('0x3d'),'body':_0x1abb96,'json':!![]};rp(_0x197fdd)[_0x4ab9('0x19')](function(_0x39b503){var _0x1d7f79={'messageId':_0x39b503[_0x4ab9('0x3e')]};if(!_0x40aed4['deliveryReport']){_0x1d7f79[_0x4ab9('0x3f')]=!![];}return _0x82c95e['update'](_0x1d7f79);})[_0x4ab9('0x26')](function(_0x53b5cb){logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),_0x4ab9('0x3b'),util[_0x4ab9('0x28')](_0x53b5cb,{'showHidden':![],'depth':null}));});}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x3b'),_0x4ab9('0x40'));}break;case _0x4ab9('0x41'):if(_0x40aed4[_0x4ab9('0x2d')]&&_0x40aed4[_0x4ab9('0x2e')]){var _0x1abb96={'messages':[{'source':_0x4ab9('0x42'),'to':_0x1248c7['phone'],'body':_0x1248c7[_0x4ab9('0xe')],'from':_0x40aed4[_0x4ab9('0x3c')]||_0x40aed4['phone']}]};var _0x5d5033=util['format'](_0x4ab9('0x43'),_0x40aed4[_0x4ab9('0x2d')],_0x40aed4[_0x4ab9('0x2e')]);var _0x197fdd={'method':_0x4ab9('0x36'),'uri':_0x4ab9('0x44'),'body':_0x1abb96,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5d5033)[_0x4ab9('0x45')](_0x4ab9('0x46')))},'json':!![]};rp(_0x197fdd)[_0x4ab9('0x19')](function(_0xc438e4){if(_0xc438e4[_0x4ab9('0x47')]>=0xc8&&_0xc438e4['http_code']<=0xce){if(_0xc438e4['data']&&_0xc438e4[_0x4ab9('0x48')][_0x4ab9('0x49')]>0x0){var _0x267248=_[_0x4ab9('0x4a')](_0xc438e4[_0x4ab9('0x48')]['messages']);var _0x4817a={'messageId':_0x267248[_0x4ab9('0x4b')]};if(!_0x40aed4[_0x4ab9('0x4c')]){_0x4817a['read']=!![];}return _0x82c95e['update'](_0x4817a);}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),'clickSend',util[_0x4ab9('0x28')](_0xc438e4,{'showHidden':![],'depth':null}));}}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x4d'),util[_0x4ab9('0x28')](_0xc438e4,{'showHidden':![],'depth':null}));}})[_0x4ab9('0x26')](function(_0x42aa98){logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),_0x4ab9('0x4d'),util[_0x4ab9('0x28')](_0x42aa98,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),'clickSend',_0x4ab9('0x3a'));}break;case _0x4ab9('0x4e'):if(_0x40aed4[_0x4ab9('0x4f')]&&_0x40aed4[_0x4ab9('0x20')]){var _0x1abb96={'dst':_0x1248c7[_0x4ab9('0x21')],'text':_0x1248c7['body'],'src':_0x40aed4[_0x4ab9('0x3c')]||_0x40aed4[_0x4ab9('0x21')],'url':_0x40aed4[_0x4ab9('0x50')]+'/api/sms/messages/'+_0x1248c7['id']+'/status?token='+_0x40aed4[_0x4ab9('0x23')]};var _0x5d5033=util[_0x4ab9('0x51')](_0x4ab9('0x43'),_0x40aed4['authId'],_0x40aed4['authToken']);var _0x197fdd={'method':_0x4ab9('0x36'),'uri':util[_0x4ab9('0x51')](_0x4ab9('0x52'),_0x40aed4[_0x4ab9('0x4f')]),'body':_0x1abb96,'headers':{'Authorization':util[_0x4ab9('0x51')]('Basic\x20%s',new Buffer(_0x5d5033)[_0x4ab9('0x45')](_0x4ab9('0x46')))},'json':!![]};rp(_0x197fdd)[_0x4ab9('0x19')](function(_0x205397){var _0xfe3ca0={'messageId':_0x205397[_0x4ab9('0x53')][0x0]};return _0x82c95e[_0x4ab9('0x25')](_0xfe3ca0);})[_0x4ab9('0x26')](function(_0x4b0007){logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),'afterCreate',_0x4ab9('0x4e'),util[_0x4ab9('0x28')](_0x4b0007,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x4e'),_0x4ab9('0x54'));}break;case _0x4ab9('0x55'):if(_0x40aed4[_0x4ab9('0x2d')]&&_0x40aed4[_0x4ab9('0x2e')]){if(_0x40aed4[_0x4ab9('0x56')]){var _0x35f35c={'method':_0x4ab9('0x36'),'uri':_0x40aed4[_0x4ab9('0x56')]+_0x4ab9('0x57'),'body':{'username':_0x40aed4['username'],'password':_0x40aed4['password']},'json':!![]};return rp(_0x35f35c)['then'](function(_0x16c167){var _0x154014={'method':_0x4ab9('0x36'),'uri':_0x40aed4[_0x4ab9('0x56')]+_0x4ab9('0x58'),'body':{'messages':[{'from':_0x40aed4[_0x4ab9('0x21')],'destinations':[{'to':_0x1248c7[_0x4ab9('0x21')]}],'text':_0x1248c7['body'],'notifyUrl':_0x40aed4[_0x4ab9('0x50')]+'/api/sms/messages/'+_0x1248c7['id']+_0x4ab9('0x22')+_0x40aed4[_0x4ab9('0x23')],'notifyContentType':_0x4ab9('0x59'),'callbackData':_0x40aed4['phone']+';'+_0x1248c7[_0x4ab9('0xe')]}]},'headers':{'Authorization':_0x4ab9('0x5a')+_0x16c167[_0x4ab9('0x23')]},'json':!![]};return rp(_0x154014)['then'](function(_0x4c0e9e){if(_0x4c0e9e['messages']){var _0x516e99={'messageId':_0x4c0e9e[_0x4ab9('0x5b')][0x0][_0x4ab9('0xc')]};if(!_0x40aed4[_0x4ab9('0x4c')]){_0x516e99['read']=!![];}return _0x82c95e[_0x4ab9('0x25')](_0x516e99);}else{return logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x55'),util[_0x4ab9('0x28')](_0x4c0e9e,{'showHidden':![],'depth':null}));}});})[_0x4ab9('0x26')](function(_0x1ce707){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),'infobip',util['inspect'](_0x1ce707,{'showHidden':![],'depth':null}));});}else{logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),_0x4ab9('0x55'),_0x4ab9('0x5c'));}}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),'afterCreate',_0x4ab9('0x55'),_0x4ab9('0x3a'));}break;case _0x4ab9('0x5d'):var _0x3e6ef5=require(_0x4ab9('0x5e'));if(_0x40aed4['apiKey']){var _0x201b9a={};_0x201b9a['login']=_0x40aed4[_0x4ab9('0x2d')];_0x201b9a[_0x4ab9('0x21')]=_0x1248c7[_0x4ab9('0x21')];_0x201b9a[_0x4ab9('0x30')]=_0x40aed4[_0x4ab9('0x21')];_0x201b9a[_0x4ab9('0x5f')]=_0x1248c7[_0x4ab9('0xe')];_0x201b9a['timestamp']=+new Date();var _0x548a79='';var _0x4f2b2c='';var _0x2c511d=Object[_0x4ab9('0x60')](_0x201b9a);_0x2c511d['sort']();for(var _0x24263a=0x0;_0x24263a<_0x2c511d[_0x4ab9('0x61')];_0x24263a++){if(_0x548a79!=''){_0x548a79+='&';}_0x548a79+=_0x2c511d[_0x24263a]+'='+encodeURIComponent(_0x201b9a[_0x2c511d[_0x24263a]]);_0x4f2b2c+=_0x201b9a[_0x2c511d[_0x24263a]];}_0x4f2b2c+=_0x40aed4['apiKey'];_0x4f2b2c=_0x3e6ef5[_0x4ab9('0x62')](_0x4ab9('0x63'))[_0x4ab9('0x25')](_0x4f2b2c)[_0x4ab9('0x64')](_0x4ab9('0x65'));if(_0x548a79!==''){_0x548a79+='&';}_0x548a79+=_0x4ab9('0x66')+_0x4f2b2c;var _0x3c9818={'method':_0x4ab9('0x33'),'uri':_0x40aed4['baseUrl']+_0x4ab9('0x67')+_0x548a79,'json':!![]};return rp(_0x3c9818)[_0x4ab9('0x19')](function(_0x4d6c20){var _0x20144e=Object[_0x4ab9('0x60')](_0x4d6c20);if(_0x4d6c20[_0x20144e[0x0]]['error']&&parseInt(_0x4d6c20[_0x20144e[0x0]]['error'])===0x0){var _0x15c7ec={'messageId':_0x4d6c20[_0x20144e[0x0]]['id_sms']};if(!_0x40aed4['deliveryReport']){_0x15c7ec['read']=!![];}return _0x82c95e[_0x4ab9('0x25')](_0x15c7ec);}else{return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),'afterCreate',_0x4ab9('0x5d'),util['inspect'](_0x4d6c20[_0x4ab9('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4ab9('0x26')](function(_0x461a59){return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),'csc',util[_0x4ab9('0x28')](_0x461a59,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x5d'),'Missing\x20parameters:\x20apiKey');}break;case _0x4ab9('0x68'):if(_0x40aed4['apiKey']){var _0x31581c={'method':_0x4ab9('0x36'),'uri':_0x4ab9('0x69'),'headers':{'Authorization':_0x40aed4['apiKey']},'body':{'content':_0x1248c7[_0x4ab9('0xe')],'to':[_0x1248c7[_0x4ab9('0x21')]],'from':_0x40aed4['phone'],'binary':![],'clientMessageId':_0x4ab9('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x31581c)[_0x4ab9('0x19')](function(_0x4dd1ec){if(!_0x4dd1ec[_0x4ab9('0x1a')]){var _0x5b4eeb={'messageId':_0x4dd1ec['messages'][0x0]['apiMessageId']};if(!_0x40aed4[_0x4ab9('0x4c')]){_0x5b4eeb[_0x4ab9('0x3f')]=!![];}return _0x82c95e[_0x4ab9('0x25')](_0x5b4eeb);}else{return logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x68'),util['inspect'](_0x4dd1ec[_0x4ab9('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4ab9('0x26')](function(_0x9ba2f4){return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),'clickatell',util[_0x4ab9('0x28')](_0x9ba2f4,{'showHidden':![],'depth':null}));});}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),'clickatell',_0x4ab9('0x6b'));}break;case'bandwidth':if(_0x40aed4['username']&&_0x40aed4[_0x4ab9('0x2e')]){var _0x5d5033=util[_0x4ab9('0x51')](_0x4ab9('0x43'),_0x40aed4[_0x4ab9('0x2d')],_0x40aed4['password']);var _0x197fdd={'method':_0x4ab9('0x36'),'uri':_0x4ab9('0x6c')+_0x40aed4['accountId']+'/messages','body':{'to':[_0x1248c7[_0x4ab9('0x21')]],'text':_0x1248c7['body'],'from':_0x40aed4['phone'],'applicationId':_0x40aed4[_0x4ab9('0x6d')]},'headers':{'Authorization':util[_0x4ab9('0x51')]('Basic\x20%s',new Buffer(_0x5d5033)[_0x4ab9('0x45')]('base64'))},'json':!![]};rp(_0x197fdd)['then'](function(_0x39a095){if(_0x39a095['id']){var _0x17b645={'messageId':_0x39a095['id']};return _0x82c95e[_0x4ab9('0x25')](_0x17b645);}else{logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),'afterCreate',_0x4ab9('0x6e'),util[_0x4ab9('0x28')](_0x39a095,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2df2d0){logger['error'](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x6e'),util['inspect'](_0x2df2d0,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4ab9('0x6e'),_0x4ab9('0x3a'));}break;case _0x4ab9('0x6f'):if(_0x40aed4[_0x4ab9('0x70')]){var _0xad1fc6={};var _0x3c9818={'method':'POST','uri':_0x4ab9('0x71'),'headers':{'Authorization':_0x4ab9('0x72')+_0x40aed4[_0x4ab9('0x70')],'Content-Type':_0x4ab9('0x59')},'body':{'from':_0x40aed4['phone'],'to':_0x1248c7[_0x4ab9('0x21')],'text':_0x1248c7[_0x4ab9('0xe')]},'json':!![]};return rp(_0x3c9818)[_0x4ab9('0x19')](function(_0x8452b5){if(_0x8452b5[_0x4ab9('0x73')]==0xca){_0xad1fc6[_0x4ab9('0x74')]=_0x8452b5;var _0x5ca8af={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x4ab9('0x72')+_0x40aed4[_0x4ab9('0x70')],'Content-Type':'application/json'},'body':{'refid':_0xad1fc6['message'][_0x4ab9('0x75')]},'json':!![]};return rp(_0x5ca8af)[_0x4ab9('0x19')](function(_0x3f3eba){_0xad1fc6['status']=_0x3f3eba;var _0xa6246a={'messageId':_0xad1fc6[_0x4ab9('0x74')]['refid'],'read':!![]};return _0x82c95e[_0x4ab9('0x25')](_0xa6246a);});}else{return logger[_0x4ab9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ab9('0x27'),'intelepeer',util['inspect'](_0x8452b5,{'showHidden':![],'depth':null}));}})['catch'](function(_0x130a76){return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),_0x4ab9('0x27'),_0x4ab9('0x6f'),util[_0x4ab9('0x28')](_0x130a76,{'showHidden':![],'depth':null}));});}else{return logger[_0x4ab9('0x1a')](_0x4ab9('0x29'),'afterCreate','intelepeer',_0x4ab9('0x76'));}break;}}})[_0x4ab9('0x77')](function(){_0x95996f();});}else{_0x95996f();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfb43=['accountSid','authToken','phone','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','error','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','split','sms','POST','user_key','session_key','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','base64','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','timestamp','keys','sort','createHash','hex','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','status','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','find','SmsAccountId','type','twilio'];(function(_0x528a68,_0x23e0ad){var _0x3b81cf=function(_0x29a11d){while(--_0x29a11d){_0x528a68['push'](_0x528a68['shift']());}};_0x3b81cf(++_0x23e0ad);}(_0xfb43,0x145));var _0x3fb4=function(_0x5d6157,_0x1a5557){_0x5d6157=_0x5d6157-0x0;var _0x179133=_0xfb43[_0x5d6157];return _0x179133;};'use strict';var _=require(_0x3fb4('0x0'));var util=require(_0x3fb4('0x1'));var logger=require(_0x3fb4('0x2'))(_0x3fb4('0x3'));var moment=require(_0x3fb4('0x4'));var BPromise=require(_0x3fb4('0x5'));var rp=require(_0x3fb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3fb4('0x7'));var config=require(_0x3fb4('0x8'));var attributes=require(_0x3fb4('0x9'));module[_0x3fb4('0xa')]=function(_0x215d4f,_0x2a83b0){return _0x215d4f[_0x3fb4('0xb')](_0x3fb4('0xc'),attributes,{'tableName':_0x3fb4('0xd'),'paranoid':![],'indexes':[{'name':_0x3fb4('0xe'),'fields':[_0x3fb4('0xe')]},{'name':_0x3fb4('0xf'),'fields':[_0x3fb4('0x10')],'type':_0x3fb4('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28af77,_0x11937f,_0x2da929){var _0x81b06a=_0x215d4f['models'];var _0x1e4dcd=_0x28af77[_0x3fb4('0x12')]({'plain':!![]});if(_0x1e4dcd[_0x3fb4('0x13')]['toLowerCase']()==='in'||_0x1e4dcd[_0x3fb4('0x13')][_0x3fb4('0x14')]()===_0x3fb4('0x15')&&!_0x1e4dcd[_0x3fb4('0x16')]&&!_[_0x3fb4('0x17')](_0x1e4dcd[_0x3fb4('0x18')])&&!_['isNil'](_0x1e4dcd['SmsInteractionId'])){_0x81b06a[_0x3fb4('0x19')][_0x3fb4('0x1a')]({'where':{'id':_0x1e4dcd[_0x3fb4('0x1b')]}})[_0x3fb4('0x1c')](function(_0x506de0){if(_0x506de0){_0x506de0[_0x3fb4('0x1d')]({'lastMsgAt':_0x1e4dcd['createdAt'],'lastMsgDirection':_0x1e4dcd[_0x3fb4('0x13')][_0x3fb4('0x14')]()});}})[_0x3fb4('0x1e')](function(_0x30c266){console['error'](_0x30c266);});}if(_0x1e4dcd['direction']===_0x3fb4('0x15')&&!_0x1e4dcd['secret']){var _0x12e4e4;_0x81b06a['SmsAccount'][_0x3fb4('0x1f')]({'where':{'id':_0x1e4dcd[_0x3fb4('0x20')]},'raw':!![]})[_0x3fb4('0x1c')](function(_0x173fcd){_0x12e4e4=_0x173fcd;if(_0x12e4e4&&_0x12e4e4['type']){switch(_0x12e4e4[_0x3fb4('0x21')]){case _0x3fb4('0x22'):var _0x2235ab=require(_0x3fb4('0x22'));if(_0x12e4e4[_0x3fb4('0x23')]&&_0x12e4e4[_0x3fb4('0x24')]&&_0x12e4e4[_0x3fb4('0x25')]){var _0x479f7b=new _0x2235ab(_0x12e4e4['accountSid'],_0x12e4e4[_0x3fb4('0x24')]);_0x479f7b['messages'][_0x3fb4('0x26')]({'body':_0x1e4dcd[_0x3fb4('0x10')],'to':_0x1e4dcd[_0x3fb4('0x25')],'from':_0x12e4e4[_0x3fb4('0x25')],'statusCallback':_0x12e4e4[_0x3fb4('0x27')]+_0x3fb4('0x28')+_0x1e4dcd['id']+'/status?token='+_0x12e4e4[_0x3fb4('0x29')]})[_0x3fb4('0x1c')](function(_0x37d8f4){if(_0x37d8f4[_0x3fb4('0x2a')]){return _0x28af77[_0x3fb4('0x1d')]({'messageId':_0x37d8f4[_0x3fb4('0x2a')]});}})['catch'](function(_0x33d53f){logger['error'](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x22'),util[_0x3fb4('0x2c')](_0x33d53f,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x22'),_0x3fb4('0x2f'));}break;case _0x3fb4('0x30'):var _0x1b7144=_0x3fb4('0x31');if(_0x12e4e4[_0x3fb4('0x32')]&&_0x12e4e4['password']){var _0x171ed5={'recipient':[_0x1e4dcd[_0x3fb4('0x25')]],'message':_0x1e4dcd[_0x3fb4('0x10')],'message_type':_0x12e4e4[_0x3fb4('0x33')]};if(_0x12e4e4['smsMethod']&&_0x12e4e4[_0x3fb4('0x33')]!=='SI'){_0x171ed5[_0x3fb4('0x34')]=_0x12e4e4[_0x3fb4('0x25')];}var _0x38a6ed={'url':_0x1b7144+_0x3fb4('0x35')+_0x12e4e4[_0x3fb4('0x32')]+_0x3fb4('0x36')+_0x12e4e4[_0x3fb4('0x37')],'method':'GET'};rp(_0x38a6ed)[_0x3fb4('0x1c')](function(_0x563125){var _0x50ffad=_0x563125[_0x3fb4('0x38')](';');var _0x1531be={'user_key':_0x50ffad[0x0],'session_key':_0x50ffad[0x1]};_0x38a6ed={'url':_0x1b7144+_0x3fb4('0x39'),'method':_0x3fb4('0x3a'),'headers':{'user_key':_0x1531be[_0x3fb4('0x3b')],'Session_key':_0x1531be[_0x3fb4('0x3c')]},'json':!![],'body':_0x171ed5};return rp(_0x38a6ed);})['then'](function(_0x394e65){if(_0x394e65['total_sent']>=0x1){var _0x96dffd={'messageId':_0x394e65['internal_order_id']};if(_0x12e4e4[_0x3fb4('0x33')]!=='GP'||!_0x12e4e4[_0x3fb4('0x3d')]){_0x96dffd[_0x3fb4('0x3e')]=!![];}return _0x28af77[_0x3fb4('0x1d')](_0x96dffd);}else{return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),'afterCreate','skebby',util[_0x3fb4('0x2c')](_0x394e65,{'showHidden':![],'depth':null}));}})[_0x3fb4('0x1e')](function(_0x58fdaf){return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x30'),util['inspect'](_0x58fdaf,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x30'),_0x3fb4('0x3f'));}break;case _0x3fb4('0x40'):if(_0x12e4e4['authToken']){var _0x1c60ec={'recipient':_0x1e4dcd[_0x3fb4('0x25')],'message':_0x1e4dcd[_0x3fb4('0x10')],'sender':_0x12e4e4[_0x3fb4('0x41')]||_0x12e4e4[_0x3fb4('0x25')],'authorization':_0x12e4e4[_0x3fb4('0x24')]};var _0x11937f={'method':'POST','uri':_0x3fb4('0x42'),'body':_0x1c60ec,'json':!![]};rp(_0x11937f)[_0x3fb4('0x1c')](function(_0x5d25f8){var _0x34b564={'messageId':_0x5d25f8['requestid']};if(!_0x12e4e4[_0x3fb4('0x3d')]){_0x34b564[_0x3fb4('0x3e')]=!![];}return _0x28af77[_0x3fb4('0x1d')](_0x34b564);})['catch'](function(_0x3b1822){logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),'connectel',util[_0x3fb4('0x2c')](_0x3b1822,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fb4('0x2b'),_0x3fb4('0x2e'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x12e4e4[_0x3fb4('0x32')]&&_0x12e4e4[_0x3fb4('0x37')]){var _0x1c60ec={'messages':[{'source':_0x3fb4('0x43'),'to':_0x1e4dcd[_0x3fb4('0x25')],'body':_0x1e4dcd[_0x3fb4('0x10')],'from':_0x12e4e4[_0x3fb4('0x41')]||_0x12e4e4['phone']}]};var _0x51abbb=util[_0x3fb4('0x44')](_0x3fb4('0x45'),_0x12e4e4[_0x3fb4('0x32')],_0x12e4e4[_0x3fb4('0x37')]);var _0x11937f={'method':_0x3fb4('0x3a'),'uri':_0x3fb4('0x46'),'body':_0x1c60ec,'headers':{'Authorization':util[_0x3fb4('0x44')](_0x3fb4('0x47'),new Buffer(_0x51abbb)[_0x3fb4('0x48')]('base64'))},'json':!![]};rp(_0x11937f)[_0x3fb4('0x1c')](function(_0x24c243){if(_0x24c243[_0x3fb4('0x49')]>=0xc8&&_0x24c243['http_code']<=0xce){if(_0x24c243[_0x3fb4('0x4a')]&&_0x24c243[_0x3fb4('0x4a')][_0x3fb4('0x4b')]>0x0){var _0x1924d3=_[_0x3fb4('0x4c')](_0x24c243['data'][_0x3fb4('0x4d')]);var _0x1a211e={'messageId':_0x1924d3[_0x3fb4('0x4e')]};if(!_0x12e4e4['deliveryReport']){_0x1a211e[_0x3fb4('0x3e')]=!![];}return _0x28af77[_0x3fb4('0x1d')](_0x1a211e);}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x4f'),util[_0x3fb4('0x2c')](_0x24c243,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fb4('0x2e'),_0x3fb4('0x4f'),util[_0x3fb4('0x2c')](_0x24c243,{'showHidden':![],'depth':null}));}})[_0x3fb4('0x1e')](function(_0xe0e30e){logger[_0x3fb4('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0xe0e30e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x4f'),_0x3fb4('0x3f'));}break;case _0x3fb4('0x50'):if(_0x12e4e4[_0x3fb4('0x51')]&&_0x12e4e4[_0x3fb4('0x24')]){var _0x1c60ec={'dst':_0x1e4dcd[_0x3fb4('0x25')],'text':_0x1e4dcd['body'],'src':_0x12e4e4[_0x3fb4('0x41')]||_0x12e4e4[_0x3fb4('0x25')],'url':_0x12e4e4[_0x3fb4('0x27')]+_0x3fb4('0x28')+_0x1e4dcd['id']+_0x3fb4('0x52')+_0x12e4e4['token']};var _0x51abbb=util[_0x3fb4('0x44')](_0x3fb4('0x45'),_0x12e4e4[_0x3fb4('0x51')],_0x12e4e4[_0x3fb4('0x24')]);var _0x11937f={'method':_0x3fb4('0x3a'),'uri':util[_0x3fb4('0x44')](_0x3fb4('0x53'),_0x12e4e4[_0x3fb4('0x51')]),'body':_0x1c60ec,'headers':{'Authorization':util[_0x3fb4('0x44')](_0x3fb4('0x47'),new Buffer(_0x51abbb)['toString'](_0x3fb4('0x54')))},'json':!![]};rp(_0x11937f)['then'](function(_0xa0ff8b){var _0x34d275={'messageId':_0xa0ff8b['message_uuid'][0x0]};return _0x28af77[_0x3fb4('0x1d')](_0x34d275);})['catch'](function(_0x16f1f1){logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x50'),util[_0x3fb4('0x2c')](_0x16f1f1,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x3fb4('0x55'):if(_0x12e4e4[_0x3fb4('0x32')]&&_0x12e4e4['password']){if(_0x12e4e4[_0x3fb4('0x56')]){var _0x13cfa9={'method':_0x3fb4('0x3a'),'uri':_0x12e4e4['baseUrl']+_0x3fb4('0x57'),'body':{'username':_0x12e4e4[_0x3fb4('0x32')],'password':_0x12e4e4[_0x3fb4('0x37')]},'json':!![]};return rp(_0x13cfa9)[_0x3fb4('0x1c')](function(_0x31467e){var _0x4d29f2={'method':'POST','uri':_0x12e4e4[_0x3fb4('0x56')]+_0x3fb4('0x58'),'body':{'messages':[{'from':_0x12e4e4[_0x3fb4('0x25')],'destinations':[{'to':_0x1e4dcd[_0x3fb4('0x25')]}],'text':_0x1e4dcd[_0x3fb4('0x10')],'notifyUrl':_0x12e4e4[_0x3fb4('0x27')]+_0x3fb4('0x28')+_0x1e4dcd['id']+_0x3fb4('0x52')+_0x12e4e4['token'],'notifyContentType':_0x3fb4('0x59'),'callbackData':_0x12e4e4[_0x3fb4('0x25')]+';'+_0x1e4dcd['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x31467e['token']},'json':!![]};return rp(_0x4d29f2)[_0x3fb4('0x1c')](function(_0x3e6324){if(_0x3e6324[_0x3fb4('0x4d')]){var _0x10d670={'messageId':_0x3e6324[_0x3fb4('0x4d')][0x0][_0x3fb4('0xe')]};if(!_0x12e4e4['deliveryReport']){_0x10d670[_0x3fb4('0x3e')]=!![];}return _0x28af77['update'](_0x10d670);}else{return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x55'),util[_0x3fb4('0x2c')](_0x3e6324,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x28e026){return logger['error'](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x55'),util[_0x3fb4('0x2c')](_0x28e026,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x55'),_0x3fb4('0x5a'));}}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3fb4('0x5b'):var _0x2d3bf3=require(_0x3fb4('0x5c'));if(_0x12e4e4[_0x3fb4('0x5d')]){var _0x5aeca8={};_0x5aeca8['login']=_0x12e4e4[_0x3fb4('0x32')];_0x5aeca8['phone']=_0x1e4dcd[_0x3fb4('0x25')];_0x5aeca8[_0x3fb4('0x34')]=_0x12e4e4[_0x3fb4('0x25')];_0x5aeca8['text']=_0x1e4dcd[_0x3fb4('0x10')];_0x5aeca8[_0x3fb4('0x5e')]=+new Date();var _0x3ba7a6='';var _0x3da4cc='';var _0x2f5f94=Object[_0x3fb4('0x5f')](_0x5aeca8);_0x2f5f94[_0x3fb4('0x60')]();for(var _0x460e63=0x0;_0x460e63<_0x2f5f94['length'];_0x460e63++){if(_0x3ba7a6!=''){_0x3ba7a6+='&';}_0x3ba7a6+=_0x2f5f94[_0x460e63]+'='+encodeURIComponent(_0x5aeca8[_0x2f5f94[_0x460e63]]);_0x3da4cc+=_0x5aeca8[_0x2f5f94[_0x460e63]];}_0x3da4cc+=_0x12e4e4['apiKey'];_0x3da4cc=_0x2d3bf3[_0x3fb4('0x61')]('md5')[_0x3fb4('0x1d')](_0x3da4cc)['digest'](_0x3fb4('0x62'));if(_0x3ba7a6!==''){_0x3ba7a6+='&';}_0x3ba7a6+='signature='+_0x3da4cc;var _0x38a6ed={'method':_0x3fb4('0x63'),'uri':_0x12e4e4[_0x3fb4('0x56')]+_0x3fb4('0x64')+_0x3ba7a6,'json':!![]};return rp(_0x38a6ed)[_0x3fb4('0x1c')](function(_0x524748){var _0x59e4f9=Object[_0x3fb4('0x5f')](_0x524748);if(_0x524748[_0x59e4f9[0x0]][_0x3fb4('0x2d')]&&parseInt(_0x524748[_0x59e4f9[0x0]][_0x3fb4('0x2d')])===0x0){var _0x28936b={'messageId':_0x524748[_0x59e4f9[0x0]][_0x3fb4('0x65')]};if(!_0x12e4e4[_0x3fb4('0x3d')]){_0x28936b[_0x3fb4('0x3e')]=!![];}return _0x28af77[_0x3fb4('0x1d')](_0x28936b);}else{return logger['error'](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x5b'),util[_0x3fb4('0x2c')](_0x524748[_0x3fb4('0x2d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x742067){return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x5b'),util[_0x3fb4('0x2c')](_0x742067,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x5b'),_0x3fb4('0x66'));}break;case _0x3fb4('0x67'):if(_0x12e4e4[_0x3fb4('0x5d')]){var _0x1e3d43={'method':'POST','uri':_0x3fb4('0x68'),'headers':{'Authorization':_0x12e4e4[_0x3fb4('0x5d')]},'body':{'content':_0x1e4dcd[_0x3fb4('0x10')],'to':[_0x1e4dcd[_0x3fb4('0x25')]],'from':_0x12e4e4[_0x3fb4('0x25')],'binary':![],'clientMessageId':_0x3fb4('0x69'),'charset':_0x3fb4('0x6a')},'json':!![]};rp(_0x1e3d43)[_0x3fb4('0x1c')](function(_0x479d84){if(!_0x479d84[_0x3fb4('0x2d')]){var _0xe04692={'messageId':_0x479d84['messages'][0x0][_0x3fb4('0x6b')]};if(!_0x12e4e4[_0x3fb4('0x3d')]){_0xe04692[_0x3fb4('0x3e')]=!![];}return _0x28af77['update'](_0xe04692);}else{return logger['error'](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x67'),util[_0x3fb4('0x2c')](_0x479d84[_0x3fb4('0x2d')],{'showHidden':![],'depth':null}));}})[_0x3fb4('0x1e')](function(_0x47d7a3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fb4('0x2e'),_0x3fb4('0x67'),util['inspect'](_0x47d7a3,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),'clickatell',_0x3fb4('0x66'));}break;case'bandwidth':if(_0x12e4e4[_0x3fb4('0x32')]&&_0x12e4e4['password']){var _0x51abbb=util[_0x3fb4('0x44')](_0x3fb4('0x45'),_0x12e4e4[_0x3fb4('0x32')],_0x12e4e4[_0x3fb4('0x37')]);var _0x11937f={'method':_0x3fb4('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x12e4e4[_0x3fb4('0x6c')]+_0x3fb4('0x6d'),'body':{'to':[_0x1e4dcd['phone']],'text':_0x1e4dcd['body'],'from':_0x12e4e4[_0x3fb4('0x25')],'applicationId':_0x12e4e4[_0x3fb4('0x6e')]},'headers':{'Authorization':util[_0x3fb4('0x44')]('Basic\x20%s',new Buffer(_0x51abbb)[_0x3fb4('0x48')](_0x3fb4('0x54')))},'json':!![]};rp(_0x11937f)['then'](function(_0x3e59b0){if(_0x3e59b0['id']){var _0x4afc70={'messageId':_0x3e59b0['id']};return _0x28af77[_0x3fb4('0x1d')](_0x4afc70);}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x6f'),util['inspect'](_0x3e59b0,{'showHidden':![],'depth':null}));}})[_0x3fb4('0x1e')](function(_0x1199c9){logger['error'](_0x3fb4('0x2b'),'afterCreate',_0x3fb4('0x6f'),util[_0x3fb4('0x2c')](_0x1199c9,{'showHidden':![],'depth':null}));});}else{logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x6f'),_0x3fb4('0x3f'));}break;case _0x3fb4('0x70'):if(_0x12e4e4['apiKey']){var _0x1dd4c3={};var _0x38a6ed={'method':_0x3fb4('0x3a'),'uri':_0x3fb4('0x71'),'headers':{'Authorization':_0x3fb4('0x72')+_0x12e4e4[_0x3fb4('0x5d')],'Content-Type':'application/json'},'body':{'from':_0x12e4e4['phone'],'to':_0x1e4dcd['phone'],'text':_0x1e4dcd['body']},'json':!![]};return rp(_0x38a6ed)[_0x3fb4('0x1c')](function(_0x59ab59){if(_0x59ab59['code']==0xca){_0x1dd4c3[_0x3fb4('0x73')]=_0x59ab59;var _0x224410={'method':_0x3fb4('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3fb4('0x72')+_0x12e4e4['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x1dd4c3[_0x3fb4('0x73')][_0x3fb4('0x74')]},'json':!![]};return rp(_0x224410)[_0x3fb4('0x1c')](function(_0x22bfd5){_0x1dd4c3[_0x3fb4('0x75')]=_0x22bfd5;var _0x187c51={'messageId':_0x1dd4c3[_0x3fb4('0x73')][_0x3fb4('0x74')],'read':!![]};return _0x28af77[_0x3fb4('0x1d')](_0x187c51);});}else{return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x70'),util[_0x3fb4('0x2c')](_0x59ab59,{'showHidden':![],'depth':null}));}})[_0x3fb4('0x1e')](function(_0x4f7bef){return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x70'),util['inspect'](_0x4f7bef,{'showHidden':![],'depth':null}));});}else{return logger[_0x3fb4('0x2d')](_0x3fb4('0x2b'),_0x3fb4('0x2e'),_0x3fb4('0x70'),'Token\x20not\x20received');}break;}}})[_0x3fb4('0x76')](function(){_0x2da929();});}else{_0x2da929();}}},'charset':'utf8mb4','collate':_0x3fb4('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9878450..e10eac8 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 _0x7377=['error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7377,0x12b));var _0x7737=function(_0x50c12f,_0x28e72b){_0x50c12f=_0x50c12f-0x0;var _0x544cb6=_0x7377[_0x50c12f];return _0x544cb6;};'use strict';var _=require(_0x7737('0x0'));var util=require(_0x7737('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7737('0x2'));var fs=require('fs');var Redis=require(_0x7737('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7737('0x4'));var logger=require(_0x7737('0x5'))(_0x7737('0x6'));var config=require('../../config/environment');var jayson=require(_0x7737('0x7'));var client=jayson['client'][_0x7737('0x8')]({'port':0x232a});config[_0x7737('0x9')]=_['defaults'](config[_0x7737('0x9')],{'host':_0x7737('0xa'),'port':0x18eb});var socket=require(_0x7737('0xb'))(new Redis(config[_0x7737('0x9')]));require(_0x7737('0xc'))['register'](socket);function respondWithRpcPromise(_0x40ae4e,_0x34b776,_0x113cf9){return new BPromise(function(_0x9bff4f,_0x5ead79){return client[_0x7737('0xd')](_0x40ae4e,_0x113cf9)[_0x7737('0xe')](function(_0x3a51df){logger['info'](_0x7737('0xf'),_0x34b776,_0x7737('0x10'));logger[_0x7737('0x11')](_0x7737('0x12'),_0x34b776,_0x7737('0x10'),JSON[_0x7737('0x13')](_0x3a51df));if(_0x3a51df[_0x7737('0x14')]){if(_0x3a51df['error'][_0x7737('0x15')]===0x1f4){logger['error'](_0x7737('0xf'),_0x34b776,_0x3a51df[_0x7737('0x14')][_0x7737('0x16')]);return _0x5ead79(_0x3a51df[_0x7737('0x14')][_0x7737('0x16')]);}logger[_0x7737('0x14')](_0x7737('0xf'),_0x34b776,_0x3a51df[_0x7737('0x14')][_0x7737('0x16')]);return _0x9bff4f(_0x3a51df[_0x7737('0x14')][_0x7737('0x16')]);}else{logger['info'](_0x7737('0xf'),_0x34b776,_0x7737('0x10'));_0x9bff4f(_0x3a51df[_0x7737('0x17')][_0x7737('0x16')]);}})['catch'](function(_0x14839e){logger[_0x7737('0x14')](_0x7737('0xf'),_0x34b776,_0x14839e);_0x5ead79(_0x14839e);});});}exports[_0x7737('0x18')]=function(_0x18fa96){var _0x210646=this;return new Promise(function(_0x1bf8af,_0x524cea){return db[_0x7737('0x19')][_0x7737('0x1a')](_0x18fa96[_0x7737('0x1b')],{'raw':_0x18fa96['options']?_0x18fa96[_0x7737('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d80e9){logger['info'](_0x7737('0x18'),_0x18fa96);logger[_0x7737('0x11')](_0x7737('0x18'),_0x18fa96,JSON[_0x7737('0x13')](_0x4d80e9));_0x1bf8af(_0x4d80e9);})['catch'](function(_0x369b00){logger[_0x7737('0x14')]('CreateSmsMessage',_0x369b00[_0x7737('0x16')],_0x18fa96);_0x524cea(_0x210646['error'](0x1f4,_0x369b00[_0x7737('0x16')]));});});}; \ No newline at end of file +var _0x7ccd=['message','result','catch','CreateSmsMessage','create','body','options','raw','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7ccd,0x101));var _0xd7cc=function(_0x53d32c,_0x4c5c10){_0x53d32c=_0x53d32c-0x0;var _0x1d5311=_0x7ccd[_0x53d32c];return _0x1d5311;};'use strict';var _=require('lodash');var util=require(_0xd7cc('0x0'));var moment=require('moment');var BPromise=require(_0xd7cc('0x1'));var rs=require(_0xd7cc('0x2'));var fs=require('fs');var Redis=require(_0xd7cc('0x3'));var db=require(_0xd7cc('0x4'))['db'];var utils=require(_0xd7cc('0x5'));var logger=require(_0xd7cc('0x6'))('rpc');var config=require(_0xd7cc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7cc('0x8')]({'port':0x232a});config[_0xd7cc('0x9')]=_[_0xd7cc('0xa')](config['redis'],{'host':_0xd7cc('0xb'),'port':0x18eb});var socket=require(_0xd7cc('0xc'))(new Redis(config['redis']));require(_0xd7cc('0xd'))[_0xd7cc('0xe')](socket);function respondWithRpcPromise(_0x528237,_0x409a5,_0x51f563){return new BPromise(function(_0x1c95a2,_0x350fb9){return client['request'](_0x528237,_0x51f563)[_0xd7cc('0xf')](function(_0x276aec){logger[_0xd7cc('0x10')]('SmsMessage,\x20%s,\x20%s',_0x409a5,_0xd7cc('0x11'));logger['debug'](_0xd7cc('0x12'),_0x409a5,_0xd7cc('0x11'),JSON[_0xd7cc('0x13')](_0x276aec));if(_0x276aec['error']){if(_0x276aec[_0xd7cc('0x14')]['code']===0x1f4){logger[_0xd7cc('0x14')](_0xd7cc('0x15'),_0x409a5,_0x276aec[_0xd7cc('0x14')][_0xd7cc('0x16')]);return _0x350fb9(_0x276aec[_0xd7cc('0x14')]['message']);}logger[_0xd7cc('0x14')](_0xd7cc('0x15'),_0x409a5,_0x276aec['error'][_0xd7cc('0x16')]);return _0x1c95a2(_0x276aec['error'][_0xd7cc('0x16')]);}else{logger['info'](_0xd7cc('0x15'),_0x409a5,'request\x20sent');_0x1c95a2(_0x276aec[_0xd7cc('0x17')][_0xd7cc('0x16')]);}})[_0xd7cc('0x18')](function(_0x22afab){logger[_0xd7cc('0x14')](_0xd7cc('0x15'),_0x409a5,_0x22afab);_0x350fb9(_0x22afab);});});}exports[_0xd7cc('0x19')]=function(_0x32d8fe){var _0x52ff97=this;return new Promise(function(_0xbe2781,_0x552207){return db['SmsMessage'][_0xd7cc('0x1a')](_0x32d8fe[_0xd7cc('0x1b')],{'raw':_0x32d8fe[_0xd7cc('0x1c')]?_0x32d8fe[_0xd7cc('0x1c')][_0xd7cc('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x420b05){logger[_0xd7cc('0x10')]('CreateSmsMessage',_0x32d8fe);logger[_0xd7cc('0x1e')](_0xd7cc('0x19'),_0x32d8fe,JSON[_0xd7cc('0x13')](_0x420b05));_0xbe2781(_0x420b05);})[_0xd7cc('0x18')](function(_0x11501d){logger[_0xd7cc('0x14')]('CreateSmsMessage',_0x11501d[_0xd7cc('0x16')],_0x32d8fe);_0x552207(_0x52ff97[_0xd7cc('0x14')](0x1f4,_0x11501d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b1575f2..d985393 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 _0x896f=['length','smsMessage:','save','remove','update','emit','removeListener'];(function(_0x7e4e90,_0x4b2115){var _0xcecb5b=function(_0x883e92){while(--_0x883e92){_0x7e4e90['push'](_0x7e4e90['shift']());}};_0xcecb5b(++_0x4b2115);}(_0x896f,0x1b4));var _0xf896=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x896f[_0x2f6f50];return _0x2cf365;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xf896('0x0'),_0xf896('0x1'),_0xf896('0x2')];function createListener(_0x25f660,_0x21e3ec){return function(_0x450677){_0x21e3ec[_0xf896('0x3')](_0x25f660,_0x450677);};}function removeListener(_0x16627a,_0x5d0071){return function(){SmsMessageEvents[_0xf896('0x4')](_0x16627a,_0x5d0071);};}exports['register']=function(_0x1d38b9){for(var _0x22c619=0x0,_0x29eefc=events[_0xf896('0x5')];_0x22c619<_0x29eefc;_0x22c619++){var _0x5ce695=events[_0x22c619];var _0x4262f5=createListener(_0xf896('0x6')+_0x5ce695,_0x1d38b9);SmsMessageEvents['on'](_0x5ce695,_0x4262f5);}}; \ No newline at end of file +var _0x904c=['register','length','smsMessage:','save','remove','update','emit','removeListener'];(function(_0x405a55,_0x1c0b7c){var _0x5259cf=function(_0x29bf6d){while(--_0x29bf6d){_0x405a55['push'](_0x405a55['shift']());}};_0x5259cf(++_0x1c0b7c);}(_0x904c,0x15b));var _0xc904=function(_0x290208,_0x5ba234){_0x290208=_0x290208-0x0;var _0x3d7aec=_0x904c[_0x290208];return _0x3d7aec;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xc904('0x0'),_0xc904('0x1'),_0xc904('0x2')];function createListener(_0x223228,_0x47768d){return function(_0x2cb58a){_0x47768d[_0xc904('0x3')](_0x223228,_0x2cb58a);};}function removeListener(_0x203dbd,_0x389276){return function(){SmsMessageEvents[_0xc904('0x4')](_0x203dbd,_0x389276);};}exports[_0xc904('0x5')]=function(_0x4be63d){for(var _0xd7ef93=0x0,_0x14390a=events[_0xc904('0x6')];_0xd7ef93<_0x14390a;_0xd7ef93++){var _0x111ac5=events[_0xd7ef93];var _0x570f9e=createListener(_0xc904('0x7')+_0x111ac5,_0x4be63d);SmsMessageEvents['on'](_0x111ac5,_0x570f9e);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6e4877a..863881d 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 _0xa545=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','destroy','delete','/:id/teams','exports'];(function(_0x481557,_0x3333cc){var _0x102fbf=function(_0x5ae51b){while(--_0x5ae51b){_0x481557['push'](_0x481557['shift']());}};_0x102fbf(++_0x3333cc);}(_0xa545,0x14a));var _0x5a54=function(_0x5382db,_0xb7e59b){_0x5382db=_0x5382db-0x0;var _0x2f4b39=_0xa545[_0x5382db];return _0x2f4b39;};'use strict';var multer=require('multer');var util=require(_0x5a54('0x0'));var path=require('path');var timeout=require(_0x5a54('0x1'));var express=require(_0x5a54('0x2'));var router=express[_0x5a54('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a54('0x4'));var interaction=require(_0x5a54('0x5'));var config=require(_0x5a54('0x6'));var controller=require(_0x5a54('0x7'));router[_0x5a54('0x8')]('/',auth[_0x5a54('0x9')](),controller[_0x5a54('0xa')]);router[_0x5a54('0x8')](_0x5a54('0xb'),auth['isAuthenticated'](),controller[_0x5a54('0xc')]);router[_0x5a54('0x8')](_0x5a54('0xd'),auth[_0x5a54('0x9')](),controller[_0x5a54('0xe')]);router['get'](_0x5a54('0xf'),auth[_0x5a54('0x9')](),controller[_0x5a54('0x10')]);router[_0x5a54('0x8')]('/:id/teams',auth[_0x5a54('0x9')](),controller[_0x5a54('0x11')]);router['get'](_0x5a54('0x12'),auth[_0x5a54('0x9')](),controller[_0x5a54('0x13')]);router['post']('/',auth[_0x5a54('0x9')](),controller[_0x5a54('0x14')]);router[_0x5a54('0x15')]('/:id/teams',auth[_0x5a54('0x9')](),controller[_0x5a54('0x16')]);router[_0x5a54('0x15')](_0x5a54('0x12'),auth[_0x5a54('0x9')](),controller[_0x5a54('0x17')]);router[_0x5a54('0x18')](_0x5a54('0xd'),auth[_0x5a54('0x9')](),controller[_0x5a54('0x19')]);router['delete'](_0x5a54('0xd'),auth[_0x5a54('0x9')](),controller[_0x5a54('0x1a')]);router[_0x5a54('0x1b')](_0x5a54('0x1c'),auth[_0x5a54('0x9')](),controller['removeTeams']);router['delete'](_0x5a54('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5a54('0x1d')]=router; \ No newline at end of file +var _0x8234=['post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents'];(function(_0x4425ed,_0x3f129e){var _0x13005e=function(_0x5d75a0){while(--_0x5d75a0){_0x4425ed['push'](_0x4425ed['shift']());}};_0x13005e(++_0x3f129e);}(_0x8234,0x1ac));var _0x4823=function(_0x493696,_0x1c1d41){_0x493696=_0x493696-0x0;var _0x3c4e2a=_0x8234[_0x493696];return _0x3c4e2a;};'use strict';var multer=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var path=require('path');var timeout=require(_0x4823('0x2'));var express=require(_0x4823('0x3'));var router=express[_0x4823('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4823('0x5'));var interaction=require(_0x4823('0x6'));var config=require(_0x4823('0x7'));var controller=require(_0x4823('0x8'));router[_0x4823('0x9')]('/',auth[_0x4823('0xa')](),controller[_0x4823('0xb')]);router[_0x4823('0x9')](_0x4823('0xc'),auth[_0x4823('0xa')](),controller[_0x4823('0xd')]);router[_0x4823('0x9')](_0x4823('0xe'),auth[_0x4823('0xa')](),controller[_0x4823('0xf')]);router[_0x4823('0x9')](_0x4823('0x10'),auth[_0x4823('0xa')](),controller[_0x4823('0x11')]);router[_0x4823('0x9')]('/:id/teams',auth[_0x4823('0xa')](),controller['getTeams']);router[_0x4823('0x9')](_0x4823('0x12'),auth[_0x4823('0xa')](),controller[_0x4823('0x13')]);router[_0x4823('0x14')]('/',auth['isAuthenticated'](),controller[_0x4823('0x15')]);router[_0x4823('0x14')](_0x4823('0x16'),auth[_0x4823('0xa')](),controller[_0x4823('0x17')]);router['post'](_0x4823('0x12'),auth['isAuthenticated'](),controller[_0x4823('0x18')]);router[_0x4823('0x19')](_0x4823('0xe'),auth[_0x4823('0xa')](),controller[_0x4823('0x1a')]);router[_0x4823('0x1b')](_0x4823('0xe'),auth[_0x4823('0xa')](),controller[_0x4823('0x1c')]);router[_0x4823('0x1b')](_0x4823('0x16'),auth['isAuthenticated'](),controller[_0x4823('0x1d')]);router[_0x4823('0x1b')](_0x4823('0x12'),auth[_0x4823('0xa')](),controller[_0x4823('0x1e')]);module[_0x4823('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index c431e99..04f57d3 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 _0x7012=['roundrobin','sequelize','STRING','ENUM','rrmemory'];(function(_0x8e68a5,_0x2f1360){var _0x3bce80=function(_0x3fe316){while(--_0x3fe316){_0x8e68a5['push'](_0x8e68a5['shift']());}};_0x3bce80(++_0x2f1360);}(_0x7012,0xdd));var _0x2701=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x7012[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require(_0x2701('0x0'));module['exports']={'name':{'type':Sequelize[_0x2701('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2701('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2701('0x2')](_0x2701('0x3'),'beepall',_0x2701('0x4'))}}; \ No newline at end of file +var _0x9947=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x9947,0xe0));var _0x7994=function(_0x1159f5,_0x4335a0){_0x1159f5=_0x1159f5-0x0;var _0x1ccf27=_0x9947[_0x1159f5];return _0x1ccf27;};'use strict';var Sequelize=require(_0x7994('0x0'));module['exports']={'name':{'type':Sequelize[_0x7994('0x1')],'unique':_0x7994('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7994('0x1')]},'timeout':{'type':Sequelize[_0x7994('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7994('0x4')](_0x7994('0x5'),_0x7994('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c14b8d0..c893939 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 _0xda72=['emit','removeTeams','ids','User','select','field','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','stack','name','send','index','map','SmsQueue','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMembers','UserSmsQueue','pick','SmsQueueId','findAndCountAll','UserId','createdAt','rows','format','%s/%s','SIP','smsPause','updatedAt','getTeams','findOne','Team','addTeams','Agents','sequelize','transaction','findOrCreate','forEach'];(function(_0x47894b,_0x57fc57){var _0x4c69a7=function(_0x58cc3d){while(--_0x58cc3d){_0x47894b['push'](_0x47894b['shift']());}};_0x4c69a7(++_0x57fc57);}(_0xda72,0x135));var _0x2da7=function(_0x34be7e,_0x17c9ba){_0x34be7e=_0x34be7e-0x0;var _0x36482c=_0xda72[_0x34be7e];return _0x36482c;};'use strict';var emlformat=require(_0x2da7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2da7('0x1'));var jsonpatch=require(_0x2da7('0x2'));var rp=require(_0x2da7('0x3'));var moment=require(_0x2da7('0x4'));var BPromise=require(_0x2da7('0x5'));var Mustache=require('mustache');var util=require(_0x2da7('0x6'));var path=require(_0x2da7('0x7'));var sox=require(_0x2da7('0x8'));var csv=require('to-csv');var ejs=require(_0x2da7('0x9'));var fs=require('fs');var fs_extra=require(_0x2da7('0xa'));var _=require(_0x2da7('0xb'));var squel=require(_0x2da7('0xc'));var crypto=require('crypto');var jsforce=require(_0x2da7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2da7('0xe'));var querystring=require(_0x2da7('0xf'));var Papa=require(_0x2da7('0x10'));var Redis=require(_0x2da7('0x11'));var authService=require(_0x2da7('0x12'));var qs=require(_0x2da7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2da7('0x14'));var logger=require('../../config/logger')(_0x2da7('0x15'));var utils=require(_0x2da7('0x16'));var config=require(_0x2da7('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2da7('0x18'))['db'];config['redis']=_['defaults'](config[_0x2da7('0x19')],{'host':_0x2da7('0x1a'),'port':0x18eb});var socket=require(_0x2da7('0x1b'))(new Redis(config[_0x2da7('0x19')]));require(_0x2da7('0x1c'))[_0x2da7('0x1d')](socket);function respondWithStatusCode(_0x26530a,_0x13a8bd){_0x13a8bd=_0x13a8bd||0xcc;return function(_0xe22217){if(_0xe22217){return _0x26530a[_0x2da7('0x1e')](_0x13a8bd);}return _0x26530a['status'](_0x13a8bd)[_0x2da7('0x1f')]();};}function respondWithResult(_0x4d39ee,_0x326c41){_0x326c41=_0x326c41||0xc8;return function(_0x2be5fa){if(_0x2be5fa){return _0x4d39ee[_0x2da7('0x20')](_0x326c41)[_0x2da7('0x21')](_0x2be5fa);}};}function respondWithFilteredResult(_0x4c7800,_0x7e9e42){return function(_0x3ca519){if(_0x3ca519){var _0x34fdbc=typeof _0x7e9e42[_0x2da7('0x22')]==='undefined'&&typeof _0x7e9e42[_0x2da7('0x23')]===_0x2da7('0x24');var _0x2fb801=_0x3ca519[_0x2da7('0x25')];var _0x4167b4=_0x34fdbc?0x0:_0x7e9e42[_0x2da7('0x22')];var _0x7ccc4b=_0x34fdbc?_0x3ca519[_0x2da7('0x25')]:_0x7e9e42[_0x2da7('0x22')]+_0x7e9e42[_0x2da7('0x23')];var _0x5abe38;if(_0x7ccc4b>=_0x2fb801){_0x7ccc4b=_0x2fb801;_0x5abe38=0xc8;}else{_0x5abe38=0xce;}_0x4c7800[_0x2da7('0x20')](_0x5abe38);return _0x4c7800[_0x2da7('0x26')]('Content-Range',_0x4167b4+'-'+_0x7ccc4b+'/'+_0x2fb801)[_0x2da7('0x21')](_0x3ca519);}return null;};}function patchUpdates(_0x315b6b){return function(_0x32e7f6){try{jsonpatch[_0x2da7('0x27')](_0x32e7f6,_0x315b6b,!![]);}catch(_0x5203ab){return BPromise[_0x2da7('0x28')](_0x5203ab);}return _0x32e7f6[_0x2da7('0x29')]();};}function saveUpdates(_0x1668a2,_0x57df82){return function(_0x148568){if(_0x148568){return _0x148568[_0x2da7('0x2a')](_0x1668a2)['then'](function(_0xfacd07){return _0xfacd07;});}return null;};}function removeEntity(_0x41f146,_0x583ce8){return function(_0x45568d){if(_0x45568d){return _0x45568d['destroy']()[_0x2da7('0x2b')](function(){var _0x1062c1=_0x45568d[_0x2da7('0x2c')]({'plain':!![]});var _0x40cea9=_0x2da7('0x2d');return db[_0x2da7('0x2e')]['destroy']({'where':{'type':_0x40cea9,'resourceId':_0x1062c1['id']}})[_0x2da7('0x2b')](function(){return _0x45568d;});})['then'](function(){_0x41f146[_0x2da7('0x20')](0xcc)[_0x2da7('0x1f')]();});}};}function handleEntityNotFound(_0x8ac33a,_0x166046){return function(_0x798b4a){if(!_0x798b4a){_0x8ac33a[_0x2da7('0x1e')](0x194);}return _0x798b4a;};}function handleError(_0x307282,_0x4339ce){_0x4339ce=_0x4339ce||0x1f4;return function(_0xf4dd0f){logger['error'](_0xf4dd0f[_0x2da7('0x2f')]);if(_0xf4dd0f[_0x2da7('0x30')]){delete _0xf4dd0f[_0x2da7('0x30')];}_0x307282[_0x2da7('0x20')](_0x4339ce)[_0x2da7('0x31')](_0xf4dd0f);};}exports[_0x2da7('0x32')]=function(_0x45b237,_0x1d0ee1){var _0x399fa3={},_0x2bda6c={},_0x559399={'count':0x0,'rows':[]};var _0x36ec3d=_[_0x2da7('0x33')](db[_0x2da7('0x34')]['rawAttributes'],function(_0x37198e){return{'name':_0x37198e[_0x2da7('0x35')],'type':_0x37198e[_0x2da7('0x36')]['key']};});_0x2bda6c[_0x2da7('0x37')]=_['map'](_0x36ec3d,_0x2da7('0x30'));_0x2bda6c['query']=_[_0x2da7('0x38')](_0x45b237[_0x2da7('0x39')]);_0x2bda6c['filters']=_[_0x2da7('0x3a')](_0x2bda6c[_0x2da7('0x37')],_0x2bda6c[_0x2da7('0x39')]);_0x399fa3['attributes']=_['intersection'](_0x2bda6c[_0x2da7('0x37')],qs[_0x2da7('0x3b')](_0x45b237[_0x2da7('0x39')][_0x2da7('0x3b')]));_0x399fa3['attributes']=_0x399fa3[_0x2da7('0x3c')][_0x2da7('0x3d')]?_0x399fa3[_0x2da7('0x3c')]:_0x2bda6c[_0x2da7('0x37')];if(!_0x45b237[_0x2da7('0x39')][_0x2da7('0x3e')](_0x2da7('0x3f'))){_0x399fa3['limit']=qs['limit'](_0x45b237[_0x2da7('0x39')]['limit']);_0x399fa3[_0x2da7('0x22')]=qs[_0x2da7('0x22')](_0x45b237[_0x2da7('0x39')][_0x2da7('0x22')]);}_0x399fa3[_0x2da7('0x40')]=qs['sort'](_0x45b237[_0x2da7('0x39')][_0x2da7('0x41')]);_0x399fa3[_0x2da7('0x42')]=qs['filters'](_['pick'](_0x45b237[_0x2da7('0x39')],_0x2bda6c[_0x2da7('0x43')]),_0x36ec3d);if(_0x45b237['query']['filter']){_0x399fa3[_0x2da7('0x42')]=_[_0x2da7('0x44')](_0x399fa3[_0x2da7('0x42')],{'$or':_['map'](_0x36ec3d,function(_0x5d328d){if(_0x5d328d[_0x2da7('0x36')]!==_0x2da7('0x45')){var _0x3b4f47={};_0x3b4f47[_0x5d328d[_0x2da7('0x30')]]={'$like':'%'+_0x45b237[_0x2da7('0x39')][_0x2da7('0x46')]+'%'};return _0x3b4f47;}})});}_0x399fa3=_[_0x2da7('0x44')]({},_0x399fa3,_0x45b237[_0x2da7('0x47')]);var _0x50376e={'where':_0x399fa3[_0x2da7('0x42')]};return db['SmsQueue']['count'](_0x50376e)['then'](function(_0x209169){_0x559399[_0x2da7('0x25')]=_0x209169;if(_0x45b237[_0x2da7('0x39')][_0x2da7('0x48')]){_0x399fa3['include']=[{'all':!![]}];}return db[_0x2da7('0x34')][_0x2da7('0x49')](_0x399fa3);})['then'](function(_0x3e83a9){_0x559399['rows']=_0x3e83a9;return _0x559399;})['then'](respondWithFilteredResult(_0x1d0ee1,_0x399fa3))[_0x2da7('0x4a')](handleError(_0x1d0ee1,null));};exports[_0x2da7('0x4b')]=function(_0x13eb58,_0x335e58){var _0x32bca7={'raw':!![],'where':{'id':_0x13eb58[_0x2da7('0x4c')]['id']}},_0x33e26c={};_0x33e26c[_0x2da7('0x37')]=_['keys'](db['SmsQueue'][_0x2da7('0x4d')]);_0x33e26c['query']=_['keys'](_0x13eb58['query']);_0x33e26c['filters']=_['intersection'](_0x33e26c[_0x2da7('0x37')],_0x33e26c[_0x2da7('0x39')]);_0x32bca7[_0x2da7('0x3c')]=_[_0x2da7('0x3a')](_0x33e26c[_0x2da7('0x37')],qs['fields'](_0x13eb58[_0x2da7('0x39')]['fields']));_0x32bca7[_0x2da7('0x3c')]=_0x32bca7[_0x2da7('0x3c')]['length']?_0x32bca7[_0x2da7('0x3c')]:_0x33e26c[_0x2da7('0x37')];if(_0x13eb58[_0x2da7('0x39')][_0x2da7('0x48')]){_0x32bca7[_0x2da7('0x4e')]=[{'all':!![]}];}_0x32bca7=_['merge']({},_0x32bca7,_0x13eb58['options']);return db[_0x2da7('0x34')][_0x2da7('0x4f')](_0x32bca7)['then'](handleEntityNotFound(_0x335e58,null))[_0x2da7('0x2b')](respondWithResult(_0x335e58,null))[_0x2da7('0x4a')](handleError(_0x335e58,null));};exports[_0x2da7('0x50')]=function(_0x495436,_0x45b04f){return db[_0x2da7('0x34')]['create'](_0x495436[_0x2da7('0x51')],{})[_0x2da7('0x2b')](function(_0x52a6b8){var _0x22cf08=_0x495436['user']['get']({'plain':!![]});if(!_0x22cf08)throw new Error(_0x2da7('0x52'));if(_0x22cf08['role']===_0x2da7('0x53')){var _0x47810f=_0x52a6b8[_0x2da7('0x2c')]({'plain':!![]});var _0x4340a3=_0x2da7('0x2d');return db['UserProfileSection'][_0x2da7('0x4f')]({'where':{'name':_0x4340a3,'userProfileId':_0x22cf08[_0x2da7('0x54')]},'raw':!![]})[_0x2da7('0x2b')](function(_0x532a99){if(_0x532a99&&_0x532a99[_0x2da7('0x55')]===0x0){return db[_0x2da7('0x2e')][_0x2da7('0x50')]({'name':_0x47810f[_0x2da7('0x30')],'resourceId':_0x47810f['id'],'type':_0x532a99[_0x2da7('0x30')],'sectionId':_0x532a99['id']},{})[_0x2da7('0x2b')](function(){return _0x52a6b8;});}else{return _0x52a6b8;}})[_0x2da7('0x4a')](function(_0x53df74){logger[_0x2da7('0x56')](_0x2da7('0x57'),_0x53df74);throw _0x53df74;});}return _0x52a6b8;})[_0x2da7('0x2b')](respondWithResult(_0x45b04f,0xc9))[_0x2da7('0x4a')](handleError(_0x45b04f,null));};exports['update']=function(_0x478a03,_0x59bc83){if(_0x478a03[_0x2da7('0x51')]['id']){delete _0x478a03['body']['id'];}return db[_0x2da7('0x34')][_0x2da7('0x4f')]({'where':{'id':_0x478a03['params']['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x59bc83,null))[_0x2da7('0x2b')](saveUpdates(_0x478a03[_0x2da7('0x51')],null))[_0x2da7('0x2b')](respondWithResult(_0x59bc83,null))[_0x2da7('0x4a')](handleError(_0x59bc83,null));};exports[_0x2da7('0x58')]=function(_0x44bab1,_0x3b8384){return db['SmsQueue'][_0x2da7('0x4f')]({'where':{'id':_0x44bab1[_0x2da7('0x4c')]['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x3b8384,null))[_0x2da7('0x2b')](removeEntity(_0x3b8384,null))[_0x2da7('0x4a')](handleError(_0x3b8384,null));};exports['describe']=function(_0x20b3e5,_0x5eb0c0){return db['SmsQueue']['describe']()[_0x2da7('0x2b')](respondWithResult(_0x5eb0c0,null))[_0x2da7('0x4a')](handleError(_0x5eb0c0,null));};exports[_0x2da7('0x59')]=function(_0x37bbe9,_0x513916,_0x4214c8){var _0x48ba07={'raw':!![],'where':{}},_0x380cf4={},_0x386d63;return db[_0x2da7('0x34')]['findOne']({'where':{'id':_0x37bbe9['params']['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x513916,null))[_0x2da7('0x2b')](function(_0x339d35){if(_0x339d35){_0x386d63=_0x339d35['get']({'plain':!![]});_0x380cf4[_0x2da7('0x37')]=_[_0x2da7('0x38')](db[_0x2da7('0x5a')][_0x2da7('0x4d')]);_0x380cf4[_0x2da7('0x39')]=_[_0x2da7('0x38')](_0x37bbe9[_0x2da7('0x39')]);_0x380cf4[_0x2da7('0x43')]=_['intersection'](_0x380cf4['model'],_0x380cf4[_0x2da7('0x39')]);_0x48ba07[_0x2da7('0x3c')]=_[_0x2da7('0x3a')](_0x380cf4[_0x2da7('0x37')],qs[_0x2da7('0x3b')](_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x3b')]));_0x48ba07['attributes']=_0x48ba07[_0x2da7('0x3c')]['length']?_0x48ba07[_0x2da7('0x3c')]:_0x380cf4['model'];if(!_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x3e')](_0x2da7('0x3f'))){_0x48ba07['limit']=qs[_0x2da7('0x23')](_0x37bbe9['query'][_0x2da7('0x23')]);_0x48ba07[_0x2da7('0x22')]=qs[_0x2da7('0x22')](_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x22')]);}_0x48ba07[_0x2da7('0x40')]=qs[_0x2da7('0x41')](_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x41')]);_0x48ba07['where']=qs[_0x2da7('0x43')](_[_0x2da7('0x5b')](_0x37bbe9[_0x2da7('0x39')],_0x380cf4['filters']));_0x48ba07[_0x2da7('0x42')][_0x2da7('0x5c')]=_0x339d35['id'];if(_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x46')]){_0x48ba07[_0x2da7('0x42')]=_['merge'](_0x48ba07[_0x2da7('0x42')],{'$or':_[_0x2da7('0x33')](_0x48ba07['attributes'],function(_0x45ed9c){var _0xbdc5c9={};_0xbdc5c9[_0x45ed9c]={'$like':'%'+_0x37bbe9[_0x2da7('0x39')][_0x2da7('0x46')]+'%'};return _0xbdc5c9;})});}_0x48ba07=_[_0x2da7('0x44')]({},_0x48ba07,_0x37bbe9['options']);return db[_0x2da7('0x5a')]['findAll'](_0x48ba07);}})[_0x2da7('0x2b')](function(_0x25a0bb){if(_0x25a0bb){return db['User'][_0x2da7('0x5d')]({'where':{'id':_[_0x2da7('0x33')](_0x25a0bb,_0x2da7('0x5e')),'role':'agent'},'attributes':['id',_0x2da7('0x30'),'smsPause','updatedAt',_0x2da7('0x5f')]});}})[_0x2da7('0x2b')](function(_0x2a49c4){if(_0x2a49c4){return{'count':_0x2a49c4[_0x2da7('0x25')],'rows':_[_0x2da7('0x33')](_0x2a49c4[_0x2da7('0x60')],function(_0x4f334c){return{'membername':_0x4f334c[_0x2da7('0x30')],'UserId':_0x4f334c['id'],'queue_name':_0x386d63[_0x2da7('0x30')],'SmsQueueId':_0x386d63['id'],'interface':util[_0x2da7('0x61')](_0x2da7('0x62'),_0x2da7('0x63'),_0x4f334c[_0x2da7('0x30')]),'penalty':0x0,'paused':_0x4f334c[_0x2da7('0x64')],'createdAt':_0x4f334c[_0x2da7('0x5f')],'updatedAt':_0x4f334c[_0x2da7('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2da7('0x2b')](respondWithFilteredResult(_0x513916,_0x48ba07))['catch'](handleError(_0x513916,null));};exports[_0x2da7('0x66')]=function(_0x109898,_0x26043d,_0x5d3976){var _0x2ef0dd={};var _0x3e2714={};var _0x5032a5;var _0x15ebe8;return db[_0x2da7('0x34')][_0x2da7('0x67')]({'where':{'id':_0x109898['params']['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x26043d,null))[_0x2da7('0x2b')](function(_0x17c769){if(_0x17c769){_0x5032a5=_0x17c769;_0x3e2714['model']=_[_0x2da7('0x38')](db[_0x2da7('0x68')][_0x2da7('0x4d')]);_0x3e2714['query']=_[_0x2da7('0x38')](_0x109898[_0x2da7('0x39')]);_0x3e2714[_0x2da7('0x43')]=_[_0x2da7('0x3a')](_0x3e2714[_0x2da7('0x37')],_0x3e2714[_0x2da7('0x39')]);_0x2ef0dd[_0x2da7('0x3c')]=_[_0x2da7('0x3a')](_0x3e2714[_0x2da7('0x37')],qs['fields'](_0x109898[_0x2da7('0x39')][_0x2da7('0x3b')]));_0x2ef0dd['attributes']=_0x2ef0dd['attributes'][_0x2da7('0x3d')]?_0x2ef0dd[_0x2da7('0x3c')]:_0x3e2714[_0x2da7('0x37')];_0x2ef0dd[_0x2da7('0x40')]=qs['sort'](_0x109898[_0x2da7('0x39')][_0x2da7('0x41')]);_0x2ef0dd[_0x2da7('0x42')]=qs[_0x2da7('0x43')](_[_0x2da7('0x5b')](_0x109898['query'],_0x3e2714[_0x2da7('0x43')]));if(_0x109898['query'][_0x2da7('0x46')]){_0x2ef0dd[_0x2da7('0x42')]=_[_0x2da7('0x44')](_0x2ef0dd[_0x2da7('0x42')],{'$or':_[_0x2da7('0x33')](_0x2ef0dd[_0x2da7('0x3c')],function(_0x4538b0){var _0x355e88={};_0x355e88[_0x4538b0]={'$like':'%'+_0x109898['query'][_0x2da7('0x46')]+'%'};return _0x355e88;})});}_0x2ef0dd=_[_0x2da7('0x44')]({},_0x2ef0dd,_0x109898[_0x2da7('0x47')]);return _0x5032a5[_0x2da7('0x66')](_0x2ef0dd);}})[_0x2da7('0x2b')](function(_0x433841){if(_0x433841){_0x15ebe8=_0x433841[_0x2da7('0x3d')];if(!_0x109898[_0x2da7('0x39')][_0x2da7('0x3e')](_0x2da7('0x3f'))){_0x2ef0dd[_0x2da7('0x23')]=qs[_0x2da7('0x23')](_0x109898[_0x2da7('0x39')][_0x2da7('0x23')]);_0x2ef0dd[_0x2da7('0x22')]=qs[_0x2da7('0x22')](_0x109898['query'][_0x2da7('0x22')]);}return _0x5032a5[_0x2da7('0x66')](_0x2ef0dd);}})[_0x2da7('0x2b')](function(_0x2f6fb6){if(_0x2f6fb6){return _0x2f6fb6?{'count':_0x15ebe8,'rows':_0x2f6fb6}:null;}})[_0x2da7('0x2b')](respondWithResult(_0x26043d,null))[_0x2da7('0x4a')](handleError(_0x26043d,null));};exports[_0x2da7('0x69')]=function(_0x3d0d09,_0x10cace,_0x2c31e4){var _0x2b0538=_0x3d0d09[_0x2da7('0x51')]['ids'];return db[_0x2da7('0x68')][_0x2da7('0x49')]({'where':{'id':_0x2b0538},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2da7('0x6a'),'attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})[_0x2da7('0x2b')](function(_0x5288e1){if(_0x5288e1){var _0x38f412=_['flatMap'](_0x5288e1,function(_0x54f3ae){var _0xdc4fe2=_0x54f3ae[_0x2da7('0x2c')]({'plain':!![]});return _0xdc4fe2[_0x2da7('0x6a')];});return db[_0x2da7('0x34')][_0x2da7('0x4f')]({'where':{'id':_0x3d0d09['params']['id']}})[_0x2da7('0x2b')](function(_0x301762){return db[_0x2da7('0x6b')][_0x2da7('0x6c')](function(_0x301137){return _0x301762[_0x2da7('0x69')](_0x2b0538,{'transaction':_0x301137})[_0x2da7('0x2b')](function(){return BPromise['each'](_0x38f412,function(_0x468b85){return db[_0x2da7('0x5a')][_0x2da7('0x6d')]({'where':{'UserId':_0x468b85['id'],'SmsQueueId':_0x3d0d09[_0x2da7('0x4c')]['id']},'transaction':_0x301137});});})[_0x2da7('0x2b')](function(){_0x38f412[_0x2da7('0x6e')](function(_0x58dd7e){socket[_0x2da7('0x6f')]('userSmsQueue:save',{'UserId':_0x58dd7e['id'],'SmsQueueId':_0x301762['id']});});});});});}})[_0x2da7('0x2b')](respondWithStatusCode(_0x10cace,null))['catch'](handleError(_0x10cace,null));};exports[_0x2da7('0x70')]=function(_0x3da901,_0x421c1c,_0x241d8f){return db[_0x2da7('0x68')][_0x2da7('0x49')]({'where':{'id':_0x3da901[_0x2da7('0x39')][_0x2da7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x2da7('0x72')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x421c1c,null))['then'](function(_0x9ba865){var _0x152a50=_[_0x2da7('0x33')](_0x9ba865,'id');var _0x3b713a=[];var _0xdc9735=[];var _0x3752cd=squel[_0x2da7('0x73')]();_0x3752cd[_0x2da7('0x74')]('tq.TeamId')[_0x2da7('0x75')](_0x2da7('0x76'),'tq')['join']('user_has_teams','ut',_0x2da7('0x77'))['where'](_0x2da7('0x78'),_0x3da901[_0x2da7('0x4c')]['id']);for(var _0x233f94=0x0;_0x233f94<_0x9ba865[_0x2da7('0x3d')];_0x233f94+=0x1){let _0x5b388a=_0x9ba865[_0x233f94];for(var _0xbb0e3e=0x0;_0xbb0e3e<_0x5b388a[_0x2da7('0x6a')]['length'];_0xbb0e3e+=0x1){let _0x4d2314=_0x5b388a['Agents'][_0xbb0e3e];var _0x43b642=_0x3752cd[_0x2da7('0x79')]();_0x43b642[_0x2da7('0x42')](_0x2da7('0x7a'),_0x4d2314['id']);_0xdc9735['push'](db[_0x2da7('0x6b')]['query'](_0x43b642[_0x2da7('0x7b')](),{'type':db[_0x2da7('0x6b')][_0x2da7('0x7c')][_0x2da7('0x7d')]})[_0x2da7('0x2b')](function(_0x3a1e69){if(_0x3a1e69['length']===0x1){return _0x4d2314['id'];}else{var _0x29c381=_[_0x2da7('0x7e')](_[_0x2da7('0x33')](_0x3a1e69,'TeamId'),function(_0x4dafa9){return _[_0x2da7('0x7f')](_0x152a50,_0x4dafa9);});if(_0x29c381){return _0x4d2314['id'];}}}));}}return BPromise[_0x2da7('0x80')](_0xdc9735)[_0x2da7('0x2b')](function(_0x34424c){_0x3b713a=_(_0x3b713a)[_0x2da7('0x81')](_0x34424c)[_0x2da7('0x82')]()[_0x2da7('0x83')]();return db['SmsQueue']['find']({'where':{'id':_0x3da901[_0x2da7('0x4c')]['id']}})[_0x2da7('0x2b')](function(_0x2862ab){return db[_0x2da7('0x6b')]['transaction'](function(_0x4ed7b2){return _0x2862ab['removeTeams'](_0x3da901[_0x2da7('0x39')]['ids'],{'transaction':_0x4ed7b2})[_0x2da7('0x2b')](function(){if(!_[_0x2da7('0x84')](_0x3b713a)){return _0x2862ab['removeAgents'](_0x3b713a,{'transaction':_0x4ed7b2});}})['then'](function(){_0x3b713a[_0x2da7('0x6e')](function(_0x34a885){socket[_0x2da7('0x6f')](_0x2da7('0x85'),{'UserId':_0x34a885,'SmsQueueId':_0x2862ab['id']});});});});});});})[_0x2da7('0x2b')](respondWithStatusCode(_0x421c1c,null))[_0x2da7('0x4a')](handleError(_0x421c1c,null));};exports[_0x2da7('0x86')]=function(_0x345302,_0x406163,_0xbadd1b){return db[_0x2da7('0x34')][_0x2da7('0x4f')]({'where':{'id':_0x345302[_0x2da7('0x4c')]['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x406163,null))[_0x2da7('0x2b')](function(_0x591424){if(_0x591424){return _0x591424['addAgents'](_0x345302[_0x2da7('0x51')]['ids'],_[_0x2da7('0x87')](_0x345302[_0x2da7('0x51')],['ids','id'])||{})[_0x2da7('0x88')](function(_0xe5e003){for(var _0x34ef6f=0x0;_0x34ef6f<_0x345302['body'][_0x2da7('0x71')][_0x2da7('0x3d')];_0x34ef6f+=0x1){socket[_0x2da7('0x6f')](_0x2da7('0x89'),{'UserId':Number(_0x345302['body'][_0x2da7('0x71')][_0x34ef6f]),'SmsQueueId':Number(_0x345302['params']['id'])});}return _0xe5e003;});}})[_0x2da7('0x2b')](respondWithResult(_0x406163,null))[_0x2da7('0x4a')](handleError(_0x406163,null));};exports[_0x2da7('0x8a')]=function(_0x5cb0a9,_0x552ed9,_0x5eda6f){return db[_0x2da7('0x34')]['find']({'where':{'id':_0x5cb0a9[_0x2da7('0x4c')]['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x552ed9,null))['then'](function(_0x174287){if(_0x174287){return _0x174287[_0x2da7('0x8a')](_0x5cb0a9[_0x2da7('0x39')]['ids'])[_0x2da7('0x2b')](function(){if(_['isArray'](_0x5cb0a9[_0x2da7('0x39')]['ids'])){for(var _0x43e35f=0x0;_0x43e35f<_0x5cb0a9['query'][_0x2da7('0x71')][_0x2da7('0x3d')];_0x43e35f+=0x1){socket[_0x2da7('0x6f')](_0x2da7('0x85'),{'UserId':Number(_0x5cb0a9[_0x2da7('0x39')]['ids'][_0x43e35f]),'SmsQueueId':Number(_0x5cb0a9[_0x2da7('0x4c')]['id'])});}}else{socket['emit'](_0x2da7('0x85'),{'UserId':Number(_0x5cb0a9[_0x2da7('0x39')][_0x2da7('0x71')]),'SmsQueueId':Number(_0x5cb0a9['params']['id'])});}});}})[_0x2da7('0x2b')](respondWithStatusCode(_0x552ed9,null))[_0x2da7('0x4a')](handleError(_0x552ed9,null));};exports[_0x2da7('0x8b')]=function(_0x476ad2,_0x46babd,_0x35f89c){var _0x1d15a5={};var _0x5a7969={};var _0x583bb4;var _0x1496e1;return db[_0x2da7('0x34')][_0x2da7('0x67')]({'where':{'id':_0x476ad2[_0x2da7('0x4c')]['id']}})[_0x2da7('0x2b')](handleEntityNotFound(_0x46babd,null))[_0x2da7('0x2b')](function(_0xc3bc02){if(_0xc3bc02){_0x583bb4=_0xc3bc02;_0x5a7969[_0x2da7('0x37')]=_[_0x2da7('0x38')](db[_0x2da7('0x72')][_0x2da7('0x4d')]);_0x5a7969[_0x2da7('0x39')]=_[_0x2da7('0x38')](_0x476ad2['query']);_0x5a7969['filters']=_[_0x2da7('0x3a')](_0x5a7969[_0x2da7('0x37')],_0x5a7969['query']);_0x1d15a5[_0x2da7('0x3c')]=_[_0x2da7('0x3a')](_0x5a7969['model'],qs[_0x2da7('0x3b')](_0x476ad2[_0x2da7('0x39')]['fields']));_0x1d15a5[_0x2da7('0x3c')]=_0x1d15a5[_0x2da7('0x3c')]['length']?_0x1d15a5['attributes']:_0x5a7969[_0x2da7('0x37')];_0x1d15a5['order']=qs[_0x2da7('0x41')](_0x476ad2[_0x2da7('0x39')][_0x2da7('0x41')]);_0x1d15a5['where']=qs['filters'](_['pick'](_0x476ad2[_0x2da7('0x39')],_0x5a7969['filters']));if(_0x476ad2[_0x2da7('0x39')]['filter']){_0x1d15a5[_0x2da7('0x42')]=_[_0x2da7('0x44')](_0x1d15a5[_0x2da7('0x42')],{'$or':_[_0x2da7('0x33')](_0x1d15a5[_0x2da7('0x3c')],function(_0x1b6006){var _0x1e9b1e={};_0x1e9b1e[_0x1b6006]={'$like':'%'+_0x476ad2[_0x2da7('0x39')]['filter']+'%'};return _0x1e9b1e;})});}_0x1d15a5=_[_0x2da7('0x44')]({},_0x1d15a5,_0x476ad2['options']);return _0x583bb4[_0x2da7('0x8b')](_0x1d15a5);}})[_0x2da7('0x2b')](function(_0x16aace){if(_0x16aace){_0x1496e1=_0x16aace['length'];if(!_0x476ad2[_0x2da7('0x39')][_0x2da7('0x3e')](_0x2da7('0x3f'))){_0x1d15a5['limit']=qs[_0x2da7('0x23')](_0x476ad2[_0x2da7('0x39')]['limit']);_0x1d15a5[_0x2da7('0x22')]=qs[_0x2da7('0x22')](_0x476ad2['query'][_0x2da7('0x22')]);}return _0x583bb4[_0x2da7('0x8b')](_0x1d15a5);}})[_0x2da7('0x2b')](function(_0x469384){if(_0x469384){return _0x469384?{'count':_0x1496e1,'rows':_0x469384}:null;}})[_0x2da7('0x2b')](respondWithResult(_0x46babd,null))[_0x2da7('0x4a')](handleError(_0x46babd,null));}; \ No newline at end of file +var _0x58b8=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','smsPause','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','value','transaction','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','SmsQueue','rawAttributes','fieldName','type'];(function(_0x1635cb,_0x161733){var _0x5d12b8=function(_0x103418){while(--_0x103418){_0x1635cb['push'](_0x1635cb['shift']());}};_0x5d12b8(++_0x161733);}(_0x58b8,0x1eb));var _0x858b=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0x58b8[_0x134448];return _0x2d52a1;};'use strict';var emlformat=require(_0x858b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x858b('0x1'));var jsonpatch=require(_0x858b('0x2'));var rp=require(_0x858b('0x3'));var moment=require('moment');var BPromise=require(_0x858b('0x4'));var Mustache=require(_0x858b('0x5'));var util=require('util');var path=require(_0x858b('0x6'));var sox=require(_0x858b('0x7'));var csv=require(_0x858b('0x8'));var ejs=require(_0x858b('0x9'));var fs=require('fs');var fs_extra=require(_0x858b('0xa'));var _=require(_0x858b('0xb'));var squel=require('squel');var crypto=require(_0x858b('0xc'));var jsforce=require(_0x858b('0xd'));var deskjs=require(_0x858b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x858b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x858b('0x10'));var as=require(_0x858b('0x11'));var hardwareService=require(_0x858b('0x12'));var logger=require('../../config/logger')(_0x858b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x858b('0x14')]=_['defaults'](config[_0x858b('0x14')],{'host':_0x858b('0x15'),'port':0x18eb});var socket=require(_0x858b('0x16'))(new Redis(config[_0x858b('0x14')]));require('./smsQueue.socket')[_0x858b('0x17')](socket);function respondWithStatusCode(_0x451afc,_0x3d7efd){_0x3d7efd=_0x3d7efd||0xcc;return function(_0x1cf7c9){if(_0x1cf7c9){return _0x451afc[_0x858b('0x18')](_0x3d7efd);}return _0x451afc[_0x858b('0x19')](_0x3d7efd)['end']();};}function respondWithResult(_0x509d14,_0x1d0612){_0x1d0612=_0x1d0612||0xc8;return function(_0x342bee){if(_0x342bee){return _0x509d14[_0x858b('0x19')](_0x1d0612)[_0x858b('0x1a')](_0x342bee);}};}function respondWithFilteredResult(_0x2848f3,_0x4b98d6){return function(_0x5015c6){if(_0x5015c6){var _0x5689f0=typeof _0x4b98d6['offset']==='undefined'&&typeof _0x4b98d6['limit']===_0x858b('0x1b');var _0x3db2ee=_0x5015c6[_0x858b('0x1c')];var _0x11e173=_0x5689f0?0x0:_0x4b98d6[_0x858b('0x1d')];var _0x19d0ea=_0x5689f0?_0x5015c6[_0x858b('0x1c')]:_0x4b98d6[_0x858b('0x1d')]+_0x4b98d6[_0x858b('0x1e')];var _0x54814d;if(_0x19d0ea>=_0x3db2ee){_0x19d0ea=_0x3db2ee;_0x54814d=0xc8;}else{_0x54814d=0xce;}_0x2848f3['status'](_0x54814d);return _0x2848f3[_0x858b('0x1f')](_0x858b('0x20'),_0x11e173+'-'+_0x19d0ea+'/'+_0x3db2ee)[_0x858b('0x1a')](_0x5015c6);}return null;};}function patchUpdates(_0x5dbec1){return function(_0x3abca2){try{jsonpatch[_0x858b('0x21')](_0x3abca2,_0x5dbec1,!![]);}catch(_0x324af0){return BPromise['reject'](_0x324af0);}return _0x3abca2[_0x858b('0x22')]();};}function saveUpdates(_0x436a10,_0x1c432b){return function(_0x234c89){if(_0x234c89){return _0x234c89[_0x858b('0x23')](_0x436a10)[_0x858b('0x24')](function(_0x1e24ec){return _0x1e24ec;});}return null;};}function removeEntity(_0x4b57b2,_0xf780a){return function(_0x52dc92){if(_0x52dc92){return _0x52dc92[_0x858b('0x25')]()[_0x858b('0x24')](function(){var _0x4c9695=_0x52dc92[_0x858b('0x26')]({'plain':!![]});var _0x3fc57f='SmsQueues';return db[_0x858b('0x27')][_0x858b('0x25')]({'where':{'type':_0x3fc57f,'resourceId':_0x4c9695['id']}})[_0x858b('0x24')](function(){return _0x52dc92;});})[_0x858b('0x24')](function(){_0x4b57b2[_0x858b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x495e8c,_0x333847){return function(_0x59ba4f){if(!_0x59ba4f){_0x495e8c[_0x858b('0x18')](0x194);}return _0x59ba4f;};}function handleError(_0x23c595,_0x48c0e0){_0x48c0e0=_0x48c0e0||0x1f4;return function(_0x5a783c){logger[_0x858b('0x28')](_0x5a783c[_0x858b('0x29')]);if(_0x5a783c[_0x858b('0x2a')]){delete _0x5a783c[_0x858b('0x2a')];}_0x23c595[_0x858b('0x19')](_0x48c0e0)[_0x858b('0x2b')](_0x5a783c);};}exports['index']=function(_0x3fa3a7,_0x4f63e1){var _0x2948b3={},_0x3bc86a={},_0x1504b0={'count':0x0,'rows':[]};var _0x45d594=_[_0x858b('0x2c')](db[_0x858b('0x2d')][_0x858b('0x2e')],function(_0x357851){return{'name':_0x357851[_0x858b('0x2f')],'type':_0x357851[_0x858b('0x30')][_0x858b('0x31')]};});_0x3bc86a[_0x858b('0x32')]=_['map'](_0x45d594,'name');_0x3bc86a[_0x858b('0x33')]=_[_0x858b('0x34')](_0x3fa3a7[_0x858b('0x33')]);_0x3bc86a[_0x858b('0x35')]=_[_0x858b('0x36')](_0x3bc86a[_0x858b('0x32')],_0x3bc86a[_0x858b('0x33')]);_0x2948b3[_0x858b('0x37')]=_[_0x858b('0x36')](_0x3bc86a[_0x858b('0x32')],qs[_0x858b('0x38')](_0x3fa3a7[_0x858b('0x33')][_0x858b('0x38')]));_0x2948b3[_0x858b('0x37')]=_0x2948b3['attributes'][_0x858b('0x39')]?_0x2948b3['attributes']:_0x3bc86a[_0x858b('0x32')];if(!_0x3fa3a7['query'][_0x858b('0x3a')](_0x858b('0x3b'))){_0x2948b3[_0x858b('0x1e')]=qs['limit'](_0x3fa3a7[_0x858b('0x33')][_0x858b('0x1e')]);_0x2948b3[_0x858b('0x1d')]=qs[_0x858b('0x1d')](_0x3fa3a7['query'][_0x858b('0x1d')]);}_0x2948b3[_0x858b('0x3c')]=qs[_0x858b('0x3d')](_0x3fa3a7[_0x858b('0x33')][_0x858b('0x3d')]);_0x2948b3[_0x858b('0x3e')]=qs[_0x858b('0x35')](_['pick'](_0x3fa3a7[_0x858b('0x33')],_0x3bc86a[_0x858b('0x35')]),_0x45d594);if(_0x3fa3a7['query'][_0x858b('0x3f')]){_0x2948b3[_0x858b('0x3e')]=_[_0x858b('0x40')](_0x2948b3['where'],{'$or':_['map'](_0x45d594,function(_0x430750){if(_0x430750['type']!==_0x858b('0x41')){var _0x228e30={};_0x228e30[_0x430750[_0x858b('0x2a')]]={'$like':'%'+_0x3fa3a7[_0x858b('0x33')]['filter']+'%'};return _0x228e30;}})});}_0x2948b3=_[_0x858b('0x40')]({},_0x2948b3,_0x3fa3a7[_0x858b('0x42')]);var _0x1b7467={'where':_0x2948b3[_0x858b('0x3e')]};return db[_0x858b('0x2d')][_0x858b('0x1c')](_0x1b7467)['then'](function(_0x452fcc){_0x1504b0['count']=_0x452fcc;if(_0x3fa3a7[_0x858b('0x33')][_0x858b('0x43')]){_0x2948b3[_0x858b('0x44')]=[{'all':!![]}];}return db[_0x858b('0x2d')][_0x858b('0x45')](_0x2948b3);})[_0x858b('0x24')](function(_0x50a356){_0x1504b0[_0x858b('0x46')]=_0x50a356;return _0x1504b0;})[_0x858b('0x24')](respondWithFilteredResult(_0x4f63e1,_0x2948b3))[_0x858b('0x47')](handleError(_0x4f63e1,null));};exports['show']=function(_0x29e3ac,_0x37c9e4){var _0x3d8a80={'raw':!![],'where':{'id':_0x29e3ac[_0x858b('0x48')]['id']}},_0x330faf={};_0x330faf[_0x858b('0x32')]=_['keys'](db[_0x858b('0x2d')]['rawAttributes']);_0x330faf[_0x858b('0x33')]=_[_0x858b('0x34')](_0x29e3ac['query']);_0x330faf[_0x858b('0x35')]=_['intersection'](_0x330faf[_0x858b('0x32')],_0x330faf['query']);_0x3d8a80[_0x858b('0x37')]=_[_0x858b('0x36')](_0x330faf['model'],qs[_0x858b('0x38')](_0x29e3ac[_0x858b('0x33')][_0x858b('0x38')]));_0x3d8a80[_0x858b('0x37')]=_0x3d8a80[_0x858b('0x37')][_0x858b('0x39')]?_0x3d8a80['attributes']:_0x330faf[_0x858b('0x32')];if(_0x29e3ac[_0x858b('0x33')][_0x858b('0x43')]){_0x3d8a80['include']=[{'all':!![]}];}_0x3d8a80=_[_0x858b('0x40')]({},_0x3d8a80,_0x29e3ac[_0x858b('0x42')]);return db[_0x858b('0x2d')][_0x858b('0x49')](_0x3d8a80)[_0x858b('0x24')](handleEntityNotFound(_0x37c9e4,null))[_0x858b('0x24')](respondWithResult(_0x37c9e4,null))['catch'](handleError(_0x37c9e4,null));};exports[_0x858b('0x4a')]=function(_0x542548,_0x4e1d6b){return db['SmsQueue']['create'](_0x542548[_0x858b('0x4b')],{})[_0x858b('0x24')](function(_0x462128){var _0x15424c=_0x542548[_0x858b('0x4c')]['get']({'plain':!![]});if(!_0x15424c)throw new Error(_0x858b('0x4d'));if(_0x15424c['role']==='user'){var _0x3e108e=_0x462128[_0x858b('0x26')]({'plain':!![]});var _0xca1b7a=_0x858b('0x4e');return db[_0x858b('0x4f')]['find']({'where':{'name':_0xca1b7a,'userProfileId':_0x15424c['userProfileId']},'raw':!![]})[_0x858b('0x24')](function(_0x19cd8f){if(_0x19cd8f&&_0x19cd8f[_0x858b('0x50')]===0x0){return db[_0x858b('0x27')][_0x858b('0x4a')]({'name':_0x3e108e['name'],'resourceId':_0x3e108e['id'],'type':_0x19cd8f[_0x858b('0x2a')],'sectionId':_0x19cd8f['id']},{})[_0x858b('0x24')](function(){return _0x462128;});}else{return _0x462128;}})[_0x858b('0x47')](function(_0x53de0f){logger[_0x858b('0x28')](_0x858b('0x51'),_0x53de0f);throw _0x53de0f;});}return _0x462128;})[_0x858b('0x24')](respondWithResult(_0x4e1d6b,0xc9))[_0x858b('0x47')](handleError(_0x4e1d6b,null));};exports['update']=function(_0x5c04d5,_0x1a299c){if(_0x5c04d5[_0x858b('0x4b')]['id']){delete _0x5c04d5[_0x858b('0x4b')]['id'];}return db[_0x858b('0x2d')]['find']({'where':{'id':_0x5c04d5[_0x858b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a299c,null))[_0x858b('0x24')](saveUpdates(_0x5c04d5[_0x858b('0x4b')],null))[_0x858b('0x24')](respondWithResult(_0x1a299c,null))['catch'](handleError(_0x1a299c,null));};exports[_0x858b('0x25')]=function(_0x344a12,_0x5e973e){return db['SmsQueue'][_0x858b('0x49')]({'where':{'id':_0x344a12[_0x858b('0x48')]['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x5e973e,null))[_0x858b('0x24')](removeEntity(_0x5e973e,null))['catch'](handleError(_0x5e973e,null));};exports['describe']=function(_0x1bdbc7,_0x4496c8){return db[_0x858b('0x2d')][_0x858b('0x52')]()[_0x858b('0x24')](respondWithResult(_0x4496c8,null))[_0x858b('0x47')](handleError(_0x4496c8,null));};exports[_0x858b('0x53')]=function(_0xb3df8a,_0x403917,_0x4f4ee9){var _0x32de8f={'raw':!![],'where':{}},_0xc610fd={},_0x21e64f;return db[_0x858b('0x2d')][_0x858b('0x54')]({'where':{'id':_0xb3df8a[_0x858b('0x48')]['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x403917,null))[_0x858b('0x24')](function(_0x30f865){if(_0x30f865){_0x21e64f=_0x30f865[_0x858b('0x26')]({'plain':!![]});_0xc610fd[_0x858b('0x32')]=_['keys'](db[_0x858b('0x55')][_0x858b('0x2e')]);_0xc610fd[_0x858b('0x33')]=_[_0x858b('0x34')](_0xb3df8a[_0x858b('0x33')]);_0xc610fd[_0x858b('0x35')]=_['intersection'](_0xc610fd[_0x858b('0x32')],_0xc610fd[_0x858b('0x33')]);_0x32de8f[_0x858b('0x37')]=_['intersection'](_0xc610fd[_0x858b('0x32')],qs[_0x858b('0x38')](_0xb3df8a[_0x858b('0x33')][_0x858b('0x38')]));_0x32de8f[_0x858b('0x37')]=_0x32de8f[_0x858b('0x37')][_0x858b('0x39')]?_0x32de8f['attributes']:_0xc610fd['model'];if(!_0xb3df8a[_0x858b('0x33')][_0x858b('0x3a')](_0x858b('0x3b'))){_0x32de8f[_0x858b('0x1e')]=qs[_0x858b('0x1e')](_0xb3df8a[_0x858b('0x33')][_0x858b('0x1e')]);_0x32de8f['offset']=qs[_0x858b('0x1d')](_0xb3df8a[_0x858b('0x33')][_0x858b('0x1d')]);}_0x32de8f[_0x858b('0x3c')]=qs[_0x858b('0x3d')](_0xb3df8a[_0x858b('0x33')][_0x858b('0x3d')]);_0x32de8f['where']=qs[_0x858b('0x35')](_[_0x858b('0x56')](_0xb3df8a[_0x858b('0x33')],_0xc610fd[_0x858b('0x35')]));_0x32de8f[_0x858b('0x3e')][_0x858b('0x57')]=_0x30f865['id'];if(_0xb3df8a[_0x858b('0x33')][_0x858b('0x3f')]){_0x32de8f[_0x858b('0x3e')]=_[_0x858b('0x40')](_0x32de8f[_0x858b('0x3e')],{'$or':_['map'](_0x32de8f['attributes'],function(_0x3b93ac){var _0x43b51b={};_0x43b51b[_0x3b93ac]={'$like':'%'+_0xb3df8a[_0x858b('0x33')][_0x858b('0x3f')]+'%'};return _0x43b51b;})});}_0x32de8f=_[_0x858b('0x40')]({},_0x32de8f,_0xb3df8a[_0x858b('0x42')]);return db['UserSmsQueue'][_0x858b('0x45')](_0x32de8f);}})[_0x858b('0x24')](function(_0x3a2231){if(_0x3a2231){return db[_0x858b('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0x3a2231,_0x858b('0x59')),'role':_0x858b('0x5a')},'attributes':['id','name','smsPause',_0x858b('0x5b'),_0x858b('0x5c')]});}})['then'](function(_0x395d73){if(_0x395d73){return{'count':_0x395d73[_0x858b('0x1c')],'rows':_[_0x858b('0x2c')](_0x395d73['rows'],function(_0x131fa8){return{'membername':_0x131fa8['name'],'UserId':_0x131fa8['id'],'queue_name':_0x21e64f[_0x858b('0x2a')],'SmsQueueId':_0x21e64f['id'],'interface':util[_0x858b('0x5d')](_0x858b('0x5e'),_0x858b('0x5f'),_0x131fa8[_0x858b('0x2a')]),'penalty':0x0,'paused':_0x131fa8[_0x858b('0x60')],'createdAt':_0x131fa8['createdAt'],'updatedAt':_0x131fa8[_0x858b('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x858b('0x24')](respondWithFilteredResult(_0x403917,_0x32de8f))['catch'](handleError(_0x403917,null));};exports[_0x858b('0x61')]=function(_0x3a679b,_0x3f4b89,_0x150a2d){var _0x45003e={};var _0x4e296c={};var _0xf2881b;var _0xb2958a;return db[_0x858b('0x2d')]['findOne']({'where':{'id':_0x3a679b[_0x858b('0x48')]['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x3f4b89,null))['then'](function(_0x505378){if(_0x505378){_0xf2881b=_0x505378;_0x4e296c[_0x858b('0x32')]=_[_0x858b('0x34')](db['Team'][_0x858b('0x2e')]);_0x4e296c[_0x858b('0x33')]=_[_0x858b('0x34')](_0x3a679b[_0x858b('0x33')]);_0x4e296c[_0x858b('0x35')]=_[_0x858b('0x36')](_0x4e296c[_0x858b('0x32')],_0x4e296c[_0x858b('0x33')]);_0x45003e[_0x858b('0x37')]=_[_0x858b('0x36')](_0x4e296c['model'],qs[_0x858b('0x38')](_0x3a679b[_0x858b('0x33')][_0x858b('0x38')]));_0x45003e[_0x858b('0x37')]=_0x45003e['attributes'][_0x858b('0x39')]?_0x45003e[_0x858b('0x37')]:_0x4e296c[_0x858b('0x32')];_0x45003e[_0x858b('0x3c')]=qs['sort'](_0x3a679b[_0x858b('0x33')]['sort']);_0x45003e[_0x858b('0x3e')]=qs[_0x858b('0x35')](_[_0x858b('0x56')](_0x3a679b[_0x858b('0x33')],_0x4e296c[_0x858b('0x35')]));if(_0x3a679b[_0x858b('0x33')][_0x858b('0x3f')]){_0x45003e['where']=_['merge'](_0x45003e['where'],{'$or':_[_0x858b('0x2c')](_0x45003e[_0x858b('0x37')],function(_0x58b7ae){var _0x15c27c={};_0x15c27c[_0x58b7ae]={'$like':'%'+_0x3a679b['query'][_0x858b('0x3f')]+'%'};return _0x15c27c;})});}_0x45003e=_[_0x858b('0x40')]({},_0x45003e,_0x3a679b[_0x858b('0x42')]);return _0xf2881b[_0x858b('0x61')](_0x45003e);}})[_0x858b('0x24')](function(_0x3e9544){if(_0x3e9544){_0xb2958a=_0x3e9544['length'];if(!_0x3a679b[_0x858b('0x33')][_0x858b('0x3a')]('nolimit')){_0x45003e[_0x858b('0x1e')]=qs[_0x858b('0x1e')](_0x3a679b['query'][_0x858b('0x1e')]);_0x45003e[_0x858b('0x1d')]=qs['offset'](_0x3a679b[_0x858b('0x33')]['offset']);}return _0xf2881b[_0x858b('0x61')](_0x45003e);}})[_0x858b('0x24')](function(_0x288f93){if(_0x288f93){return _0x288f93?{'count':_0xb2958a,'rows':_0x288f93}:null;}})[_0x858b('0x24')](respondWithResult(_0x3f4b89,null))[_0x858b('0x47')](handleError(_0x3f4b89,null));};exports[_0x858b('0x62')]=function(_0x3907d8,_0x349616,_0x34456c){var _0x4015e0=_0x3907d8['body'][_0x858b('0x63')];return db[_0x858b('0x64')][_0x858b('0x45')]({'where':{'id':_0x4015e0},'attributes':['id'],'include':[{'model':db[_0x858b('0x58')],'as':_0x858b('0x65'),'attributes':['id','name',_0x858b('0x66'),_0x858b('0x67'),_0x858b('0x68')],'raw':!![]}]})[_0x858b('0x24')](function(_0x3556c2){if(_0x3556c2){var _0x133b9b=_[_0x858b('0x69')](_0x3556c2,function(_0x24af63){var _0x5d30df=_0x24af63['get']({'plain':!![]});return _0x5d30df[_0x858b('0x65')];});return db['SmsQueue'][_0x858b('0x49')]({'where':{'id':_0x3907d8['params']['id']}})[_0x858b('0x24')](function(_0x26a4dd){return db[_0x858b('0x6a')]['transaction'](function(_0x344078){return _0x26a4dd[_0x858b('0x62')](_0x4015e0,{'transaction':_0x344078})[_0x858b('0x24')](function(){return BPromise[_0x858b('0x6b')](_0x133b9b,function(_0x2fdee0){return db['UserSmsQueue'][_0x858b('0x6c')]({'where':{'UserId':_0x2fdee0['id'],'SmsQueueId':_0x3907d8[_0x858b('0x48')]['id']},'transaction':_0x344078});});})[_0x858b('0x24')](function(){_0x133b9b[_0x858b('0x6d')](function(_0x4f84f3){socket[_0x858b('0x6e')](_0x858b('0x6f'),{'UserId':_0x4f84f3['id'],'SmsQueueId':_0x26a4dd['id']});});});});});}})['then'](respondWithStatusCode(_0x349616,null))['catch'](handleError(_0x349616,null));};exports[_0x858b('0x70')]=function(_0x4dbbaf,_0x263389,_0x612470){return db[_0x858b('0x64')][_0x858b('0x45')]({'where':{'id':_0x4dbbaf[_0x858b('0x33')][_0x858b('0x63')]},'attributes':['id'],'include':[{'model':db[_0x858b('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x858b('0x24')](handleEntityNotFound(_0x263389,null))['then'](function(_0xd5d19a){var _0xe6ddbc=_[_0x858b('0x2c')](_0xd5d19a,'id');var _0x44003c=[];var _0x4502b4=[];var _0x1bcf23=squel[_0x858b('0x71')]();_0x1bcf23['field'](_0x858b('0x72'))[_0x858b('0x73')](_0x858b('0x74'),'tq')['join'](_0x858b('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x858b('0x3e')](_0x858b('0x76'),_0x4dbbaf[_0x858b('0x48')]['id']);for(var _0x5f0949=0x0;_0x5f0949<_0xd5d19a['length'];_0x5f0949+=0x1){let _0x4e194e=_0xd5d19a[_0x5f0949];for(var _0x1102d1=0x0;_0x1102d1<_0x4e194e[_0x858b('0x65')][_0x858b('0x39')];_0x1102d1+=0x1){let _0x31a6c2=_0x4e194e[_0x858b('0x65')][_0x1102d1];var _0x268616=_0x1bcf23[_0x858b('0x77')]();_0x268616[_0x858b('0x3e')](_0x858b('0x78'),_0x31a6c2['id']);_0x4502b4[_0x858b('0x79')](db[_0x858b('0x6a')]['query'](_0x268616['toString'](),{'type':db[_0x858b('0x6a')][_0x858b('0x7a')]['SELECT']})[_0x858b('0x24')](function(_0x16aa3f){if(_0x16aa3f[_0x858b('0x39')]===0x1){return _0x31a6c2['id'];}else{var _0x5c18f7=_[_0x858b('0x7b')](_[_0x858b('0x2c')](_0x16aa3f,_0x858b('0x7c')),function(_0x11c2ff){return _[_0x858b('0x7d')](_0xe6ddbc,_0x11c2ff);});if(_0x5c18f7){return _0x31a6c2['id'];}}}));}}return BPromise[_0x858b('0x7e')](_0x4502b4)['then'](function(_0xe20963){_0x44003c=_(_0x44003c)[_0x858b('0x7f')](_0xe20963)['compact']()[_0x858b('0x80')]();return db[_0x858b('0x2d')][_0x858b('0x49')]({'where':{'id':_0x4dbbaf[_0x858b('0x48')]['id']}})[_0x858b('0x24')](function(_0x13f64a){return db['sequelize'][_0x858b('0x81')](function(_0x5b6f5b){return _0x13f64a[_0x858b('0x70')](_0x4dbbaf['query'][_0x858b('0x63')],{'transaction':_0x5b6f5b})['then'](function(){if(!_['isEmpty'](_0x44003c)){return _0x13f64a[_0x858b('0x82')](_0x44003c,{'transaction':_0x5b6f5b});}})['then'](function(){_0x44003c[_0x858b('0x6d')](function(_0x428cb0){socket[_0x858b('0x6e')](_0x858b('0x83'),{'UserId':_0x428cb0,'SmsQueueId':_0x13f64a['id']});});});});});});})[_0x858b('0x24')](respondWithStatusCode(_0x263389,null))[_0x858b('0x47')](handleError(_0x263389,null));};exports[_0x858b('0x84')]=function(_0x211aec,_0x10b108,_0x2adea5){return db['SmsQueue'][_0x858b('0x49')]({'where':{'id':_0x211aec['params']['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x10b108,null))[_0x858b('0x24')](function(_0x261fd){if(_0x261fd){return _0x261fd['addAgents'](_0x211aec['body']['ids'],_['omit'](_0x211aec[_0x858b('0x4b')],[_0x858b('0x63'),'id'])||{})[_0x858b('0x85')](function(_0x42aae6){for(var _0x9358f=0x0;_0x9358f<_0x211aec['body']['ids']['length'];_0x9358f+=0x1){socket[_0x858b('0x6e')](_0x858b('0x6f'),{'UserId':Number(_0x211aec[_0x858b('0x4b')][_0x858b('0x63')][_0x9358f]),'SmsQueueId':Number(_0x211aec[_0x858b('0x48')]['id'])});}return _0x42aae6;});}})['then'](respondWithResult(_0x10b108,null))['catch'](handleError(_0x10b108,null));};exports['removeAgents']=function(_0x4e9fdb,_0x5449eb,_0xe2a5c7){return db[_0x858b('0x2d')][_0x858b('0x49')]({'where':{'id':_0x4e9fdb[_0x858b('0x48')]['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x5449eb,null))['then'](function(_0x647d59){if(_0x647d59){return _0x647d59[_0x858b('0x82')](_0x4e9fdb['query'][_0x858b('0x63')])[_0x858b('0x24')](function(){if(_['isArray'](_0x4e9fdb[_0x858b('0x33')][_0x858b('0x63')])){for(var _0x57ae2f=0x0;_0x57ae2f<_0x4e9fdb[_0x858b('0x33')][_0x858b('0x63')][_0x858b('0x39')];_0x57ae2f+=0x1){socket[_0x858b('0x6e')](_0x858b('0x83'),{'UserId':Number(_0x4e9fdb[_0x858b('0x33')][_0x858b('0x63')][_0x57ae2f]),'SmsQueueId':Number(_0x4e9fdb[_0x858b('0x48')]['id'])});}}else{socket['emit'](_0x858b('0x83'),{'UserId':Number(_0x4e9fdb[_0x858b('0x33')][_0x858b('0x63')]),'SmsQueueId':Number(_0x4e9fdb[_0x858b('0x48')]['id'])});}});}})[_0x858b('0x24')](respondWithStatusCode(_0x5449eb,null))[_0x858b('0x47')](handleError(_0x5449eb,null));};exports[_0x858b('0x86')]=function(_0x13cafa,_0x335e10,_0x24078a){var _0x23d89b={};var _0x25e5dc={};var _0x57db20;var _0x44b5c5;return db[_0x858b('0x2d')]['findOne']({'where':{'id':_0x13cafa[_0x858b('0x48')]['id']}})[_0x858b('0x24')](handleEntityNotFound(_0x335e10,null))['then'](function(_0x24c9c2){if(_0x24c9c2){_0x57db20=_0x24c9c2;_0x25e5dc[_0x858b('0x32')]=_[_0x858b('0x34')](db[_0x858b('0x58')][_0x858b('0x2e')]);_0x25e5dc[_0x858b('0x33')]=_[_0x858b('0x34')](_0x13cafa[_0x858b('0x33')]);_0x25e5dc[_0x858b('0x35')]=_['intersection'](_0x25e5dc[_0x858b('0x32')],_0x25e5dc[_0x858b('0x33')]);_0x23d89b[_0x858b('0x37')]=_[_0x858b('0x36')](_0x25e5dc[_0x858b('0x32')],qs['fields'](_0x13cafa[_0x858b('0x33')][_0x858b('0x38')]));_0x23d89b[_0x858b('0x37')]=_0x23d89b[_0x858b('0x37')][_0x858b('0x39')]?_0x23d89b[_0x858b('0x37')]:_0x25e5dc[_0x858b('0x32')];_0x23d89b[_0x858b('0x3c')]=qs['sort'](_0x13cafa['query']['sort']);_0x23d89b['where']=qs[_0x858b('0x35')](_[_0x858b('0x56')](_0x13cafa[_0x858b('0x33')],_0x25e5dc[_0x858b('0x35')]));if(_0x13cafa[_0x858b('0x33')][_0x858b('0x3f')]){_0x23d89b[_0x858b('0x3e')]=_['merge'](_0x23d89b[_0x858b('0x3e')],{'$or':_[_0x858b('0x2c')](_0x23d89b[_0x858b('0x37')],function(_0x321510){var _0x4256ba={};_0x4256ba[_0x321510]={'$like':'%'+_0x13cafa[_0x858b('0x33')][_0x858b('0x3f')]+'%'};return _0x4256ba;})});}_0x23d89b=_[_0x858b('0x40')]({},_0x23d89b,_0x13cafa[_0x858b('0x42')]);return _0x57db20[_0x858b('0x86')](_0x23d89b);}})[_0x858b('0x24')](function(_0x26a11e){if(_0x26a11e){_0x44b5c5=_0x26a11e[_0x858b('0x39')];if(!_0x13cafa[_0x858b('0x33')][_0x858b('0x3a')](_0x858b('0x3b'))){_0x23d89b['limit']=qs[_0x858b('0x1e')](_0x13cafa['query'][_0x858b('0x1e')]);_0x23d89b[_0x858b('0x1d')]=qs[_0x858b('0x1d')](_0x13cafa[_0x858b('0x33')][_0x858b('0x1d')]);}return _0x57db20[_0x858b('0x86')](_0x23d89b);}})[_0x858b('0x24')](function(_0x37cc9a){if(_0x37cc9a){return _0x37cc9a?{'count':_0x44b5c5,'rows':_0x37cc9a}:null;}})[_0x858b('0x24')](respondWithResult(_0x335e10,null))['catch'](handleError(_0x335e10,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4f6ac13..28a2d4f 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 _0xc607=['remove','emit','exports','events','../../mysqldb','SmsQueue','update'];(function(_0x5841ee,_0x9ebb10){var _0x326344=function(_0x5ddb2c){while(--_0x5ddb2c){_0x5841ee['push'](_0x5841ee['shift']());}};_0x326344(++_0x9ebb10);}(_0xc607,0x192));var _0x7c60=function(_0x18fa30,_0x55a097){_0x18fa30=_0x18fa30-0x0;var _0x170ea4=_0xc607[_0x18fa30];return _0x170ea4;};'use strict';var EventEmitter=require(_0x7c60('0x0'));var SmsQueue=require(_0x7c60('0x1'))['db'][_0x7c60('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7c60('0x3'),'afterDestroy':_0x7c60('0x4')};function emitEvent(_0x17c5c0){return function(_0x13f3b4,_0x247d6a,_0x74774b){SmsQueueEvents[_0x7c60('0x5')](_0x17c5c0+':'+_0x13f3b4['id'],_0x13f3b4);SmsQueueEvents[_0x7c60('0x5')](_0x17c5c0,_0x13f3b4);_0x74774b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x7c60('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xc9e5=['events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2e8802,_0x59ad8c){var _0x4617aa=function(_0x4380b4){while(--_0x4380b4){_0x2e8802['push'](_0x2e8802['shift']());}};_0x4617aa(++_0x59ad8c);}(_0xc9e5,0xc6));var _0x5c9e=function(_0x4a4d4b,_0x1011de){_0x4a4d4b=_0x4a4d4b-0x0;var _0x64d754=_0xc9e5[_0x4a4d4b];return _0x64d754;};'use strict';var EventEmitter=require(_0x5c9e('0x0'));var SmsQueue=require(_0x5c9e('0x1'))['db'][_0x5c9e('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5c9e('0x3')](0x0);var events={'afterCreate':_0x5c9e('0x4'),'afterUpdate':_0x5c9e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c300d){return function(_0x3b890b,_0x4839a1,_0x43768e){SmsQueueEvents[_0x5c9e('0x6')](_0x1c300d+':'+_0x3b890b['id'],_0x3b890b);SmsQueueEvents[_0x5c9e('0x6')](_0x1c300d,_0x3b890b);_0x43768e(null);};}for(var e in events){if(events[_0x5c9e('0x7')](e)){var event=events[e];SmsQueue[_0x5c9e('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 2e31a41..1923ac3 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 _0x2b9b=['request-promise','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','moment','bluebird'];(function(_0x7785d0,_0x2076f5){var _0x1a167e=function(_0x4439d3){while(--_0x4439d3){_0x7785d0['push'](_0x7785d0['shift']());}};_0x1a167e(++_0x2076f5);}(_0x2b9b,0x1b4));var _0xb2b9=function(_0x25b0c9,_0x598bcf){_0x25b0c9=_0x25b0c9-0x0;var _0x43885f=_0x2b9b[_0x25b0c9];return _0x43885f;};'use strict';var _=require(_0xb2b9('0x0'));var util=require(_0xb2b9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb2b9('0x2'));var BPromise=require(_0xb2b9('0x3'));var rp=require(_0xb2b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb2b9('0x5'));module[_0xb2b9('0x6')]=function(_0x1bdafd,_0x37effd){return _0x1bdafd[_0xb2b9('0x7')](_0xb2b9('0x8'),attributes,{'tableName':_0xb2b9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54bf=['../../config/environment','define','SmsQueue','sms_queues','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x11f778,_0x41cae5){var _0x3f3284=function(_0x4c0c4f){while(--_0x4c0c4f){_0x11f778['push'](_0x11f778['shift']());}};_0x3f3284(++_0x41cae5);}(_0x54bf,0xc2));var _0xf54b=function(_0x205a8c,_0x2e367b){_0x205a8c=_0x205a8c-0x0;var _0x4250d5=_0x54bf[_0x205a8c];return _0x4250d5;};'use strict';var _=require(_0xf54b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf54b('0x1'));var moment=require('moment');var BPromise=require(_0xf54b('0x2'));var rp=require(_0xf54b('0x3'));var fs=require('fs');var path=require(_0xf54b('0x4'));var rimraf=require(_0xf54b('0x5'));var config=require(_0xf54b('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x1870bc,_0x436e3a){return _0x1870bc[_0xf54b('0x7')](_0xf54b('0x8'),attributes,{'tableName':_0xf54b('0x9'),'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 9ec6f96..affa652 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 _0x4b60=['SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','include','model','map','attributes','ShowSmsQueue','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','request\x20sent','debug'];(function(_0x22c755,_0x133055){var _0x1c0411=function(_0x58858b){while(--_0x58858b){_0x22c755['push'](_0x22c755['shift']());}};_0x1c0411(++_0x133055);}(_0x4b60,0xaa));var _0x04b6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4b60[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x04b6('0x0'));var util=require(_0x04b6('0x1'));var moment=require('moment');var BPromise=require(_0x04b6('0x2'));var rs=require(_0x04b6('0x3'));var fs=require('fs');var Redis=require(_0x04b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x04b6('0x5'));var logger=require(_0x04b6('0x6'))(_0x04b6('0x7'));var config=require(_0x04b6('0x8'));var jayson=require(_0x04b6('0x9'));var client=jayson[_0x04b6('0xa')][_0x04b6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x04b6('0xc'),'port':0x18eb});var socket=require(_0x04b6('0xd'))(new Redis(config['redis']));require(_0x04b6('0xe'))['register'](socket);function respondWithRpcPromise(_0x1eea99,_0x3f5788,_0x2ec544){return new BPromise(function(_0x560186,_0x160218){return client[_0x04b6('0xf')](_0x1eea99,_0x2ec544)[_0x04b6('0x10')](function(_0x17c635){logger[_0x04b6('0x11')]('SmsQueue,\x20%s,\x20%s',_0x3f5788,_0x04b6('0x12'));logger[_0x04b6('0x13')](_0x04b6('0x14'),_0x3f5788,'request\x20sent',JSON[_0x04b6('0x15')](_0x17c635));if(_0x17c635[_0x04b6('0x16')]){if(_0x17c635[_0x04b6('0x16')]['code']===0x1f4){logger[_0x04b6('0x16')](_0x04b6('0x17'),_0x3f5788,_0x17c635[_0x04b6('0x16')][_0x04b6('0x18')]);return _0x160218(_0x17c635[_0x04b6('0x16')]['message']);}logger['error'](_0x04b6('0x17'),_0x3f5788,_0x17c635[_0x04b6('0x16')][_0x04b6('0x18')]);return _0x560186(_0x17c635[_0x04b6('0x16')]['message']);}else{logger[_0x04b6('0x11')](_0x04b6('0x17'),_0x3f5788,'request\x20sent');_0x560186(_0x17c635['result'][_0x04b6('0x18')]);}})[_0x04b6('0x19')](function(_0x125d6c){logger[_0x04b6('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3f5788,_0x125d6c);_0x160218(_0x125d6c);});});}exports[_0x04b6('0x1a')]=function(_0x2a7e27){var _0x562c8a=this;return new Promise(function(_0x171880,_0x239c58){return db[_0x04b6('0x1b')][_0x04b6('0x1c')]({'raw':_0x2a7e27[_0x04b6('0x1d')]?_0x2a7e27[_0x04b6('0x1d')][_0x04b6('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a7e27['options']?_0x2a7e27[_0x04b6('0x1d')]['where']||null:null,'attributes':_0x2a7e27[_0x04b6('0x1d')]?_0x2a7e27[_0x04b6('0x1d')]['attributes']||null:null,'limit':_0x2a7e27[_0x04b6('0x1d')]?_0x2a7e27[_0x04b6('0x1d')]['limit']||null:null,'include':_0x2a7e27[_0x04b6('0x1d')]?_0x2a7e27[_0x04b6('0x1d')][_0x04b6('0x1f')]?_['map'](_0x2a7e27[_0x04b6('0x1d')][_0x04b6('0x1f')],function(_0x4a76b5){return{'model':db[_0x4a76b5[_0x04b6('0x20')]],'as':_0x4a76b5['as'],'attributes':_0x4a76b5['attributes'],'include':_0x4a76b5['include']?_[_0x04b6('0x21')](_0x4a76b5[_0x04b6('0x1f')],function(_0x3d14ef){return{'model':db[_0x3d14ef[_0x04b6('0x20')]],'as':_0x3d14ef['as'],'attributes':_0x3d14ef[_0x04b6('0x22')],'include':_0x3d14ef[_0x04b6('0x1f')]?_['map'](_0x3d14ef[_0x04b6('0x1f')],function(_0x342d80){return{'model':db[_0x342d80[_0x04b6('0x20')]],'as':_0x342d80['as'],'attributes':_0x342d80[_0x04b6('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xabe9f5){logger[_0x04b6('0x11')](_0x04b6('0x1a'),_0x2a7e27);logger[_0x04b6('0x13')](_0x04b6('0x1a'),_0x2a7e27,JSON[_0x04b6('0x15')](_0xabe9f5));_0x171880(_0xabe9f5);})['catch'](function(_0x47c3f7){logger[_0x04b6('0x16')]('GetSmsQueue',_0x47c3f7[_0x04b6('0x18')],_0x2a7e27);_0x239c58(_0x562c8a[_0x04b6('0x16')](0x1f4,_0x47c3f7['message']));});});};exports[_0x04b6('0x23')]=function(_0x3dc8ae){var _0x3e5080=this;return new Promise(function(_0x57556f,_0x1056f7){return db['SmsQueue'][_0x04b6('0x24')]({'raw':_0x3dc8ae[_0x04b6('0x1d')]?_0x3dc8ae[_0x04b6('0x1d')][_0x04b6('0x1e')]===undefined?!![]:![]:!![],'where':_0x3dc8ae['options']?_0x3dc8ae['options'][_0x04b6('0x25')]||null:null,'attributes':_0x3dc8ae[_0x04b6('0x1d')]?_0x3dc8ae[_0x04b6('0x1d')][_0x04b6('0x22')]||null:null,'include':_0x3dc8ae[_0x04b6('0x1d')]?_0x3dc8ae[_0x04b6('0x1d')][_0x04b6('0x1f')]?_[_0x04b6('0x21')](_0x3dc8ae[_0x04b6('0x1d')][_0x04b6('0x1f')],function(_0x1b2220){return{'model':db[_0x1b2220[_0x04b6('0x20')]],'as':_0x1b2220['as'],'attributes':_0x1b2220[_0x04b6('0x22')],'include':_0x1b2220[_0x04b6('0x1f')]?_[_0x04b6('0x21')](_0x1b2220[_0x04b6('0x1f')],function(_0x279f97){return{'model':db[_0x279f97['model']],'as':_0x279f97['as'],'attributes':_0x279f97['attributes'],'include':_0x279f97[_0x04b6('0x1f')]?_['map'](_0x279f97['include'],function(_0x2ee012){return{'model':db[_0x2ee012['model']],'as':_0x2ee012['as'],'attributes':_0x2ee012[_0x04b6('0x22')]};}):[]};}):[]};}):[]:[]})[_0x04b6('0x10')](function(_0x49c211){logger[_0x04b6('0x11')](_0x04b6('0x23'),_0x3dc8ae);logger[_0x04b6('0x13')](_0x04b6('0x23'),_0x3dc8ae,JSON[_0x04b6('0x15')](_0x49c211));_0x57556f(_0x49c211);})[_0x04b6('0x19')](function(_0x434795){logger['error'](_0x04b6('0x23'),_0x434795[_0x04b6('0x18')],_0x3dc8ae);_0x1056f7(_0x3e5080[_0x04b6('0x16')](0x1f4,_0x434795[_0x04b6('0x18')]));});});}; \ No newline at end of file +var _0xad4a=['localhost','socket.io-emitter','./smsQueue.socket','register','request','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','findAll','options','raw','where','attributes','limit','map','include','model','GetSmsQueue','stringify','ShowSmsQueue','SmsQueue','find','then','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad4a,0x9f));var _0xaad4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xad4a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaad4('0x0'));var util=require('util');var moment=require(_0xaad4('0x1'));var BPromise=require('bluebird');var rs=require(_0xaad4('0x2'));var fs=require('fs');var Redis=require(_0xaad4('0x3'));var db=require(_0xaad4('0x4'))['db'];var utils=require(_0xaad4('0x5'));var logger=require(_0xaad4('0x6'))(_0xaad4('0x7'));var config=require('../../config/environment');var jayson=require(_0xaad4('0x8'));var client=jayson[_0xaad4('0x9')][_0xaad4('0xa')]({'port':0x232a});config[_0xaad4('0xb')]=_[_0xaad4('0xc')](config[_0xaad4('0xb')],{'host':_0xaad4('0xd'),'port':0x18eb});var socket=require(_0xaad4('0xe'))(new Redis(config[_0xaad4('0xb')]));require(_0xaad4('0xf'))[_0xaad4('0x10')](socket);function respondWithRpcPromise(_0x2ac21e,_0x39fee0,_0x46e73e){return new BPromise(function(_0x3b6af5,_0x51d811){return client[_0xaad4('0x11')](_0x2ac21e,_0x46e73e)['then'](function(_0x5c882b){logger[_0xaad4('0x12')]('SmsQueue,\x20%s,\x20%s',_0x39fee0,'request\x20sent');logger[_0xaad4('0x13')](_0xaad4('0x14'),_0x39fee0,'request\x20sent',JSON['stringify'](_0x5c882b));if(_0x5c882b['error']){if(_0x5c882b[_0xaad4('0x15')][_0xaad4('0x16')]===0x1f4){logger[_0xaad4('0x15')](_0xaad4('0x17'),_0x39fee0,_0x5c882b[_0xaad4('0x15')][_0xaad4('0x18')]);return _0x51d811(_0x5c882b['error'][_0xaad4('0x18')]);}logger['error'](_0xaad4('0x17'),_0x39fee0,_0x5c882b[_0xaad4('0x15')][_0xaad4('0x18')]);return _0x3b6af5(_0x5c882b[_0xaad4('0x15')][_0xaad4('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x39fee0,_0xaad4('0x19'));_0x3b6af5(_0x5c882b[_0xaad4('0x1a')]['message']);}})['catch'](function(_0xf7d94e){logger[_0xaad4('0x15')]('SmsQueue,\x20%s,\x20%s',_0x39fee0,_0xf7d94e);_0x51d811(_0xf7d94e);});});}exports['GetSmsQueue']=function(_0x3ede86){var _0x180fc2=this;return new Promise(function(_0x119dda,_0x77fbb){return db['SmsQueue'][_0xaad4('0x1b')]({'raw':_0x3ede86[_0xaad4('0x1c')]?_0x3ede86['options'][_0xaad4('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ede86['options']?_0x3ede86['options'][_0xaad4('0x1e')]||null:null,'attributes':_0x3ede86[_0xaad4('0x1c')]?_0x3ede86[_0xaad4('0x1c')][_0xaad4('0x1f')]||null:null,'limit':_0x3ede86['options']?_0x3ede86[_0xaad4('0x1c')][_0xaad4('0x20')]||null:null,'include':_0x3ede86[_0xaad4('0x1c')]?_0x3ede86[_0xaad4('0x1c')]['include']?_[_0xaad4('0x21')](_0x3ede86[_0xaad4('0x1c')][_0xaad4('0x22')],function(_0x2df26b){return{'model':db[_0x2df26b[_0xaad4('0x23')]],'as':_0x2df26b['as'],'attributes':_0x2df26b['attributes'],'include':_0x2df26b[_0xaad4('0x22')]?_[_0xaad4('0x21')](_0x2df26b[_0xaad4('0x22')],function(_0x14614f){return{'model':db[_0x14614f['model']],'as':_0x14614f['as'],'attributes':_0x14614f[_0xaad4('0x1f')],'include':_0x14614f[_0xaad4('0x22')]?_['map'](_0x14614f[_0xaad4('0x22')],function(_0x1479e8){return{'model':db[_0x1479e8[_0xaad4('0x23')]],'as':_0x1479e8['as'],'attributes':_0x1479e8[_0xaad4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34af77){logger[_0xaad4('0x12')](_0xaad4('0x24'),_0x3ede86);logger[_0xaad4('0x13')](_0xaad4('0x24'),_0x3ede86,JSON[_0xaad4('0x25')](_0x34af77));_0x119dda(_0x34af77);})['catch'](function(_0x4bdc96){logger[_0xaad4('0x15')]('GetSmsQueue',_0x4bdc96[_0xaad4('0x18')],_0x3ede86);_0x77fbb(_0x180fc2[_0xaad4('0x15')](0x1f4,_0x4bdc96['message']));});});};exports[_0xaad4('0x26')]=function(_0x5b6971){var _0x49d6cb=this;return new Promise(function(_0xac921d,_0x1eb2a8){return db[_0xaad4('0x27')][_0xaad4('0x28')]({'raw':_0x5b6971[_0xaad4('0x1c')]?_0x5b6971[_0xaad4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5b6971['options']?_0x5b6971[_0xaad4('0x1c')][_0xaad4('0x1e')]||null:null,'attributes':_0x5b6971[_0xaad4('0x1c')]?_0x5b6971[_0xaad4('0x1c')][_0xaad4('0x1f')]||null:null,'include':_0x5b6971[_0xaad4('0x1c')]?_0x5b6971[_0xaad4('0x1c')][_0xaad4('0x22')]?_[_0xaad4('0x21')](_0x5b6971['options']['include'],function(_0x561cb5){return{'model':db[_0x561cb5[_0xaad4('0x23')]],'as':_0x561cb5['as'],'attributes':_0x561cb5[_0xaad4('0x1f')],'include':_0x561cb5['include']?_['map'](_0x561cb5[_0xaad4('0x22')],function(_0x192c34){return{'model':db[_0x192c34[_0xaad4('0x23')]],'as':_0x192c34['as'],'attributes':_0x192c34['attributes'],'include':_0x192c34[_0xaad4('0x22')]?_[_0xaad4('0x21')](_0x192c34[_0xaad4('0x22')],function(_0xfbef2a){return{'model':db[_0xfbef2a[_0xaad4('0x23')]],'as':_0xfbef2a['as'],'attributes':_0xfbef2a[_0xaad4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaad4('0x29')](function(_0x256f37){logger[_0xaad4('0x12')](_0xaad4('0x26'),_0x5b6971);logger['debug'](_0xaad4('0x26'),_0x5b6971,JSON['stringify'](_0x256f37));_0xac921d(_0x256f37);})[_0xaad4('0x2a')](function(_0x1b9588){logger[_0xaad4('0x15')](_0xaad4('0x26'),_0x1b9588[_0xaad4('0x18')],_0x5b6971);_0x1eb2a8(_0x49d6cb[_0xaad4('0x15')](0x1f4,_0x1b9588[_0xaad4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index ebbd79e..3b82c94 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 _0x385b=['removeListener','smsQueue:','save','remove','update'];(function(_0x5434b9,_0xade01c){var _0x4adbce=function(_0xe0b012){while(--_0xe0b012){_0x5434b9['push'](_0x5434b9['shift']());}};_0x4adbce(++_0xade01c);}(_0x385b,0x89));var _0xb385=function(_0x53468a,_0x286986){_0x53468a=_0x53468a-0x0;var _0x205efd=_0x385b[_0x53468a];return _0x205efd;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xb385('0x0'),_0xb385('0x1'),_0xb385('0x2')];function createListener(_0xbc3093,_0x290850){return function(_0x402e2a){_0x290850['emit'](_0xbc3093,_0x402e2a);};}function removeListener(_0x5509df,_0x588a64){return function(){SmsQueueEvents[_0xb385('0x3')](_0x5509df,_0x588a64);};}exports['register']=function(_0x865ff8){for(var _0x41ae46=0x0,_0x331622=events['length'];_0x41ae46<_0x331622;_0x41ae46++){var _0x597970=events[_0x41ae46];var _0x3192b0=createListener(_0xb385('0x4')+_0x597970,_0x865ff8);SmsQueueEvents['on'](_0x597970,_0x3192b0);}}; \ No newline at end of file +var _0x632d=['removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x632d,0x174));var _0xd632=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x632d[_0x9cd4c3];return _0x4c9025;};'use strict';var SmsQueueEvents=require(_0xd632('0x0'));var events=[_0xd632('0x1'),_0xd632('0x2'),_0xd632('0x3')];function createListener(_0x304d32,_0x1a11a2){return function(_0x49f3d5){_0x1a11a2['emit'](_0x304d32,_0x49f3d5);};}function removeListener(_0x14718b,_0x26031c){return function(){SmsQueueEvents[_0xd632('0x4')](_0x14718b,_0x26031c);};}exports[_0xd632('0x5')]=function(_0x4dbc45){for(var _0xf8beae=0x0,_0xc2a4d0=events[_0xd632('0x6')];_0xf8beae<_0xc2a4d0;_0xf8beae++){var _0x3c1e3b=events[_0xf8beae];var _0x539e42=createListener(_0xd632('0x7')+_0x3c1e3b,_0x4dbc45);SmsQueueEvents['on'](_0x3c1e3b,_0x539e42);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 896378b..fb87a76 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 _0x1269=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x8d53c9,_0x5c06ef){var _0x42902b=function(_0x2ac5a8){while(--_0x2ac5a8){_0x8d53c9['push'](_0x8d53c9['shift']());}};_0x42902b(++_0x5c06ef);}(_0x1269,0x8b));var _0x9126=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0x1269[_0x2b2c53];return _0x311ec2;};'use strict';var multer=require(_0x9126('0x0'));var util=require(_0x9126('0x1'));var path=require('path');var timeout=require(_0x9126('0x2'));var express=require('express');var router=express[_0x9126('0x3')]();var fs_extra=require(_0x9126('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9126('0x5'));var config=require('../../config/environment');var controller=require(_0x9126('0x6'));router[_0x9126('0x7')]('/',auth[_0x9126('0x8')](),controller[_0x9126('0x9')]);router[_0x9126('0x7')](_0x9126('0xa'),auth[_0x9126('0x8')](),controller[_0x9126('0xb')]);router[_0x9126('0x7')](_0x9126('0xc'),auth[_0x9126('0x8')](),controller[_0x9126('0xd')]);router['post']('/',auth[_0x9126('0x8')](),controller[_0x9126('0xe')]);router[_0x9126('0xf')](_0x9126('0xc'),auth[_0x9126('0x8')](),controller[_0x9126('0x10')]);router[_0x9126('0x11')](_0x9126('0xc'),auth[_0x9126('0x8')](),controller[_0x9126('0x12')]);module[_0x9126('0x13')]=router; \ No newline at end of file +var _0xb4b1=['index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x30ddee,_0x112b31){var _0xd48145=function(_0x4f2253){while(--_0x4f2253){_0x30ddee['push'](_0x30ddee['shift']());}};_0xd48145(++_0x112b31);}(_0xb4b1,0x1d3));var _0x1b4b=function(_0x60f9f,_0x39b2fd){_0x60f9f=_0x60f9f-0x0;var _0x1b1a97=_0xb4b1[_0x60f9f];return _0x1b1a97;};'use strict';var multer=require(_0x1b4b('0x0'));var util=require(_0x1b4b('0x1'));var path=require(_0x1b4b('0x2'));var timeout=require('connect-timeout');var express=require(_0x1b4b('0x3'));var router=express[_0x1b4b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1b4b('0x5'));router[_0x1b4b('0x6')]('/',auth[_0x1b4b('0x7')](),controller[_0x1b4b('0x8')]);router[_0x1b4b('0x6')](_0x1b4b('0x9'),auth[_0x1b4b('0x7')](),controller[_0x1b4b('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1b4b('0xb')]('/',auth[_0x1b4b('0x7')](),controller[_0x1b4b('0xc')]);router[_0x1b4b('0xd')](_0x1b4b('0xe'),auth['isAuthenticated'](),controller[_0x1b4b('0xf')]);router[_0x1b4b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1b4b('0x11')]);module[_0x1b4b('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 7e3fd12..ec49da3 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 _0x14d9=['exports','STRING','DATE','moment'];(function(_0x555b58,_0x1f0bde){var _0x651cd4=function(_0x59dbad){while(--_0x59dbad){_0x555b58['push'](_0x555b58['shift']());}};_0x651cd4(++_0x1f0bde);}(_0x14d9,0x193));var _0x914d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d9[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x914d('0x0'));var Sequelize=require('sequelize');module[_0x914d('0x1')]={'uniqueid':{'type':Sequelize[_0x914d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x914d('0x2')]},'joinAt':{'type':Sequelize[_0x914d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x914d('0x3')]},'reason':{'type':Sequelize[_0x914d('0x2')]}}; \ No newline at end of file +var _0x31c2=['moment','sequelize','STRING','DATE'];(function(_0x468964,_0x3373eb){var _0x516fad=function(_0x32b669){while(--_0x32b669){_0x468964['push'](_0x468964['shift']());}};_0x516fad(++_0x3373eb);}(_0x31c2,0x70));var _0x231c=function(_0x241960,_0x1cebc7){_0x241960=_0x241960-0x0;var _0x2afd11=_0x31c2[_0x241960];return _0x2afd11;};'use strict';var moment=require(_0x231c('0x0'));var Sequelize=require(_0x231c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x231c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x231c('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x231c('0x3')]},'acceptAt':{'type':Sequelize[_0x231c('0x3')]},'exitAt':{'type':Sequelize[_0x231c('0x3')]},'reason':{'type':Sequelize[_0x231c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2585b44..51b2828 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 _0x699f=['eml-format','rimraf','zip-dir','bluebird','mustache','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/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','type','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x699f,0xdb));var _0xf699=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x699f[_0x47568e];return _0x33815b;};'use strict';var emlformat=require(_0xf699('0x0'));var rimraf=require(_0xf699('0x1'));var zipdir=require(_0xf699('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf699('0x3'));var Mustache=require(_0xf699('0x4'));var util=require('util');var path=require(_0xf699('0x5'));var sox=require(_0xf699('0x6'));var csv=require('to-csv');var ejs=require(_0xf699('0x7'));var fs=require('fs');var fs_extra=require(_0xf699('0x8'));var _=require('lodash');var squel=require(_0xf699('0x9'));var crypto=require(_0xf699('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf699('0xb'));var toCsv=require(_0xf699('0xc'));var querystring=require(_0xf699('0xd'));var Papa=require(_0xf699('0xe'));var Redis=require(_0xf699('0xf'));var authService=require(_0xf699('0x10'));var qs=require(_0xf699('0x11'));var as=require(_0xf699('0x12'));var hardwareService=require(_0xf699('0x13'));var logger=require('../../config/logger')(_0xf699('0x14'));var utils=require(_0xf699('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf699('0x16'));var db=require(_0xf699('0x17'))['db'];function respondWithStatusCode(_0x11f522,_0x481e7e){_0x481e7e=_0x481e7e||0xcc;return function(_0x24dc06){if(_0x24dc06){return _0x11f522['sendStatus'](_0x481e7e);}return _0x11f522[_0xf699('0x18')](_0x481e7e)[_0xf699('0x19')]();};}function respondWithResult(_0x141c74,_0x2a4d18){_0x2a4d18=_0x2a4d18||0xc8;return function(_0x12ba15){if(_0x12ba15){return _0x141c74[_0xf699('0x18')](_0x2a4d18)[_0xf699('0x1a')](_0x12ba15);}};}function respondWithFilteredResult(_0x3938fb,_0x108f0c){return function(_0x5cfb8f){if(_0x5cfb8f){var _0x349cde=typeof _0x108f0c['offset']===_0xf699('0x1b')&&typeof _0x108f0c[_0xf699('0x1c')]===_0xf699('0x1b');var _0x35d2c4=_0x5cfb8f[_0xf699('0x1d')];var _0x964f1e=_0x349cde?0x0:_0x108f0c[_0xf699('0x1e')];var _0x5c2277=_0x349cde?_0x5cfb8f[_0xf699('0x1d')]:_0x108f0c[_0xf699('0x1e')]+_0x108f0c[_0xf699('0x1c')];var _0x22e282;if(_0x5c2277>=_0x35d2c4){_0x5c2277=_0x35d2c4;_0x22e282=0xc8;}else{_0x22e282=0xce;}_0x3938fb['status'](_0x22e282);return _0x3938fb[_0xf699('0x1f')](_0xf699('0x20'),_0x964f1e+'-'+_0x5c2277+'/'+_0x35d2c4)['json'](_0x5cfb8f);}return null;};}function patchUpdates(_0x43b793){return function(_0x3181ee){try{jsonpatch[_0xf699('0x21')](_0x3181ee,_0x43b793,!![]);}catch(_0x3f2344){return BPromise['reject'](_0x3f2344);}return _0x3181ee[_0xf699('0x22')]();};}function saveUpdates(_0x59e6f5,_0x2c125c){return function(_0x48d35f){if(_0x48d35f){return _0x48d35f[_0xf699('0x23')](_0x59e6f5)[_0xf699('0x24')](function(_0x3c4c49){return _0x3c4c49;});}return null;};}function removeEntity(_0x526f9d,_0x3a9a6a){return function(_0x378c8c){if(_0x378c8c){return _0x378c8c[_0xf699('0x25')]()[_0xf699('0x24')](function(){_0x526f9d[_0xf699('0x18')](0xcc)[_0xf699('0x19')]();});}};}function handleEntityNotFound(_0x14297f,_0x2afd6d){return function(_0x187a5d){if(!_0x187a5d){_0x14297f[_0xf699('0x26')](0x194);}return _0x187a5d;};}function handleError(_0x427a7f,_0x5cab8f){_0x5cab8f=_0x5cab8f||0x1f4;return function(_0x1383bc){logger[_0xf699('0x27')](_0x1383bc[_0xf699('0x28')]);if(_0x1383bc[_0xf699('0x29')]){delete _0x1383bc['name'];}_0x427a7f['status'](_0x5cab8f)[_0xf699('0x2a')](_0x1383bc);};}exports[_0xf699('0x2b')]=function(_0x5313c7,_0x51957d){var _0x56b48b={},_0x4090bc={},_0x3040fd={'count':0x0,'rows':[]};var _0x48e3cf=_[_0xf699('0x2c')](db[_0xf699('0x2d')][_0xf699('0x2e')],function(_0x2df2ca){return{'name':_0x2df2ca[_0xf699('0x2f')],'type':_0x2df2ca['type']['key']};});_0x4090bc[_0xf699('0x30')]=_[_0xf699('0x2c')](_0x48e3cf,_0xf699('0x29'));_0x4090bc['query']=_[_0xf699('0x31')](_0x5313c7[_0xf699('0x32')]);_0x4090bc['filters']=_[_0xf699('0x33')](_0x4090bc[_0xf699('0x30')],_0x4090bc['query']);_0x56b48b[_0xf699('0x34')]=_[_0xf699('0x33')](_0x4090bc[_0xf699('0x30')],qs[_0xf699('0x35')](_0x5313c7['query'][_0xf699('0x35')]));_0x56b48b['attributes']=_0x56b48b[_0xf699('0x34')]['length']?_0x56b48b['attributes']:_0x4090bc['model'];if(!_0x5313c7[_0xf699('0x32')][_0xf699('0x36')](_0xf699('0x37'))){_0x56b48b[_0xf699('0x1c')]=qs[_0xf699('0x1c')](_0x5313c7[_0xf699('0x32')]['limit']);_0x56b48b[_0xf699('0x1e')]=qs['offset'](_0x5313c7[_0xf699('0x32')]['offset']);}_0x56b48b[_0xf699('0x38')]=qs['sort'](_0x5313c7[_0xf699('0x32')]['sort']);_0x56b48b['where']=qs['filters'](_[_0xf699('0x39')](_0x5313c7[_0xf699('0x32')],_0x4090bc['filters']),_0x48e3cf);if(_0x5313c7['query'][_0xf699('0x3a')]){_0x56b48b['where']=_['merge'](_0x56b48b[_0xf699('0x3b')],{'$or':_[_0xf699('0x2c')](_0x48e3cf,function(_0x1a9320){if(_0x1a9320[_0xf699('0x3c')]!=='VIRTUAL'){var _0x594f28={};_0x594f28[_0x1a9320[_0xf699('0x29')]]={'$like':'%'+_0x5313c7['query']['filter']+'%'};return _0x594f28;}})});}_0x56b48b=_[_0xf699('0x3d')]({},_0x56b48b,_0x5313c7[_0xf699('0x3e')]);var _0x552cf7={'where':_0x56b48b['where']};return db[_0xf699('0x2d')]['count'](_0x552cf7)[_0xf699('0x24')](function(_0x444de4){_0x3040fd['count']=_0x444de4;if(_0x5313c7[_0xf699('0x32')][_0xf699('0x3f')]){_0x56b48b[_0xf699('0x40')]=[{'all':!![]}];}return db[_0xf699('0x2d')][_0xf699('0x41')](_0x56b48b);})[_0xf699('0x24')](function(_0x1338ef){_0x3040fd[_0xf699('0x42')]=_0x1338ef;return _0x3040fd;})[_0xf699('0x24')](respondWithFilteredResult(_0x51957d,_0x56b48b))[_0xf699('0x43')](handleError(_0x51957d,null));};exports['show']=function(_0x20e652,_0x44ec8e){var _0x3640a1={'raw':!![],'where':{'id':_0x20e652[_0xf699('0x44')]['id']}},_0x2dcf58={};_0x2dcf58[_0xf699('0x30')]=_[_0xf699('0x31')](db[_0xf699('0x2d')][_0xf699('0x2e')]);_0x2dcf58['query']=_['keys'](_0x20e652[_0xf699('0x32')]);_0x2dcf58['filters']=_[_0xf699('0x33')](_0x2dcf58[_0xf699('0x30')],_0x2dcf58[_0xf699('0x32')]);_0x3640a1['attributes']=_[_0xf699('0x33')](_0x2dcf58[_0xf699('0x30')],qs[_0xf699('0x35')](_0x20e652['query'][_0xf699('0x35')]));_0x3640a1[_0xf699('0x34')]=_0x3640a1[_0xf699('0x34')][_0xf699('0x45')]?_0x3640a1[_0xf699('0x34')]:_0x2dcf58[_0xf699('0x30')];if(_0x20e652[_0xf699('0x32')][_0xf699('0x3f')]){_0x3640a1['include']=[{'all':!![]}];}_0x3640a1=_[_0xf699('0x3d')]({},_0x3640a1,_0x20e652[_0xf699('0x3e')]);return db[_0xf699('0x2d')][_0xf699('0x46')](_0x3640a1)[_0xf699('0x24')](handleEntityNotFound(_0x44ec8e,null))[_0xf699('0x24')](respondWithResult(_0x44ec8e,null))[_0xf699('0x43')](handleError(_0x44ec8e,null));};exports[_0xf699('0x47')]=function(_0x5bd484,_0x12b6a4){return db[_0xf699('0x2d')]['create'](_0x5bd484['body'],{})[_0xf699('0x24')](respondWithResult(_0x12b6a4,0xc9))['catch'](handleError(_0x12b6a4,null));};exports['update']=function(_0x27aa35,_0x31da7c){if(_0x27aa35[_0xf699('0x48')]['id']){delete _0x27aa35[_0xf699('0x48')]['id'];}return db[_0xf699('0x2d')][_0xf699('0x46')]({'where':{'id':_0x27aa35[_0xf699('0x44')]['id']}})['then'](handleEntityNotFound(_0x31da7c,null))[_0xf699('0x24')](saveUpdates(_0x27aa35[_0xf699('0x48')],null))[_0xf699('0x24')](respondWithResult(_0x31da7c,null))[_0xf699('0x43')](handleError(_0x31da7c,null));};exports[_0xf699('0x25')]=function(_0x3f4aad,_0x581e49){return db[_0xf699('0x2d')][_0xf699('0x46')]({'where':{'id':_0x3f4aad[_0xf699('0x44')]['id']}})[_0xf699('0x24')](handleEntityNotFound(_0x581e49,null))[_0xf699('0x24')](removeEntity(_0x581e49,null))[_0xf699('0x43')](handleError(_0x581e49,null));};exports['describe']=function(_0x60f112,_0x1b0747){return db[_0xf699('0x2d')]['describe']()[_0xf699('0x24')](respondWithResult(_0x1b0747,null))['catch'](handleError(_0x1b0747,null));}; \ No newline at end of file +var _0x4d4d=['error','stack','name','index','SmsQueueReport','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','sendStatus'];(function(_0x4e696e,_0x1b98c0){var _0x4fbc29=function(_0x52010f){while(--_0x52010f){_0x4e696e['push'](_0x4e696e['shift']());}};_0x4fbc29(++_0x1b98c0);}(_0x4d4d,0x6a));var _0xd4d4=function(_0x3855bb,_0x4376c6){_0x3855bb=_0x3855bb-0x0;var _0x211cc2=_0x4d4d[_0x3855bb];return _0x211cc2;};'use strict';var emlformat=require(_0xd4d4('0x0'));var rimraf=require(_0xd4d4('0x1'));var zipdir=require(_0xd4d4('0x2'));var jsonpatch=require(_0xd4d4('0x3'));var rp=require('request-promise');var moment=require(_0xd4d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd4d4('0x5'));var util=require(_0xd4d4('0x6'));var path=require(_0xd4d4('0x7'));var sox=require(_0xd4d4('0x8'));var csv=require('to-csv');var ejs=require(_0xd4d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd4d4('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4d4('0xb'));var jsforce=require(_0xd4d4('0xc'));var deskjs=require(_0xd4d4('0xd'));var toCsv=require(_0xd4d4('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd4d4('0xf'));var authService=require(_0xd4d4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4d4('0x11'));var logger=require(_0xd4d4('0x12'))(_0xd4d4('0x13'));var utils=require('../../config/utils');var config=require(_0xd4d4('0x14'));var licenseUtil=require(_0xd4d4('0x15'));var db=require(_0xd4d4('0x16'))['db'];function respondWithStatusCode(_0x53e0ad,_0x5a4f6e){_0x5a4f6e=_0x5a4f6e||0xcc;return function(_0x460272){if(_0x460272){return _0x53e0ad['sendStatus'](_0x5a4f6e);}return _0x53e0ad[_0xd4d4('0x17')](_0x5a4f6e)[_0xd4d4('0x18')]();};}function respondWithResult(_0x15486a,_0x9a76ca){_0x9a76ca=_0x9a76ca||0xc8;return function(_0x41aec1){if(_0x41aec1){return _0x15486a[_0xd4d4('0x17')](_0x9a76ca)[_0xd4d4('0x19')](_0x41aec1);}};}function respondWithFilteredResult(_0x3d9ae7,_0x3f702f){return function(_0x14a007){if(_0x14a007){var _0x219be5=typeof _0x3f702f[_0xd4d4('0x1a')]===_0xd4d4('0x1b')&&typeof _0x3f702f[_0xd4d4('0x1c')]===_0xd4d4('0x1b');var _0x5fc30b=_0x14a007[_0xd4d4('0x1d')];var _0x32b61a=_0x219be5?0x0:_0x3f702f[_0xd4d4('0x1a')];var _0x57b8d9=_0x219be5?_0x14a007[_0xd4d4('0x1d')]:_0x3f702f[_0xd4d4('0x1a')]+_0x3f702f[_0xd4d4('0x1c')];var _0xe44478;if(_0x57b8d9>=_0x5fc30b){_0x57b8d9=_0x5fc30b;_0xe44478=0xc8;}else{_0xe44478=0xce;}_0x3d9ae7[_0xd4d4('0x17')](_0xe44478);return _0x3d9ae7['set'](_0xd4d4('0x1e'),_0x32b61a+'-'+_0x57b8d9+'/'+_0x5fc30b)[_0xd4d4('0x19')](_0x14a007);}return null;};}function patchUpdates(_0x18ebf7){return function(_0x18bc4d){try{jsonpatch[_0xd4d4('0x1f')](_0x18bc4d,_0x18ebf7,!![]);}catch(_0x349a5c){return BPromise[_0xd4d4('0x20')](_0x349a5c);}return _0x18bc4d['save']();};}function saveUpdates(_0x1d6b5a,_0x3717da){return function(_0x55ab17){if(_0x55ab17){return _0x55ab17[_0xd4d4('0x21')](_0x1d6b5a)['then'](function(_0x231b6d){return _0x231b6d;});}return null;};}function removeEntity(_0x2d3ff7,_0x44ad21){return function(_0x295d66){if(_0x295d66){return _0x295d66[_0xd4d4('0x22')]()['then'](function(){_0x2d3ff7['status'](0xcc)[_0xd4d4('0x18')]();});}};}function handleEntityNotFound(_0x54c9fb,_0x4e5195){return function(_0x2dac94){if(!_0x2dac94){_0x54c9fb[_0xd4d4('0x23')](0x194);}return _0x2dac94;};}function handleError(_0x15ac55,_0x187bbb){_0x187bbb=_0x187bbb||0x1f4;return function(_0x44e802){logger[_0xd4d4('0x24')](_0x44e802[_0xd4d4('0x25')]);if(_0x44e802[_0xd4d4('0x26')]){delete _0x44e802[_0xd4d4('0x26')];}_0x15ac55['status'](_0x187bbb)['send'](_0x44e802);};}exports[_0xd4d4('0x27')]=function(_0x3738fa,_0x1b089e){var _0x5ae7f8={},_0x3bfa3d={},_0x17211b={'count':0x0,'rows':[]};var _0x4088f=_['map'](db[_0xd4d4('0x28')]['rawAttributes'],function(_0x325add){return{'name':_0x325add[_0xd4d4('0x29')],'type':_0x325add['type']['key']};});_0x3bfa3d[_0xd4d4('0x2a')]=_[_0xd4d4('0x2b')](_0x4088f,_0xd4d4('0x26'));_0x3bfa3d[_0xd4d4('0x2c')]=_[_0xd4d4('0x2d')](_0x3738fa[_0xd4d4('0x2c')]);_0x3bfa3d[_0xd4d4('0x2e')]=_[_0xd4d4('0x2f')](_0x3bfa3d[_0xd4d4('0x2a')],_0x3bfa3d[_0xd4d4('0x2c')]);_0x5ae7f8[_0xd4d4('0x30')]=_[_0xd4d4('0x2f')](_0x3bfa3d['model'],qs[_0xd4d4('0x31')](_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x31')]));_0x5ae7f8['attributes']=_0x5ae7f8['attributes'][_0xd4d4('0x32')]?_0x5ae7f8[_0xd4d4('0x30')]:_0x3bfa3d['model'];if(!_0x3738fa['query'][_0xd4d4('0x33')](_0xd4d4('0x34'))){_0x5ae7f8[_0xd4d4('0x1c')]=qs[_0xd4d4('0x1c')](_0x3738fa['query'][_0xd4d4('0x1c')]);_0x5ae7f8[_0xd4d4('0x1a')]=qs['offset'](_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x1a')]);}_0x5ae7f8[_0xd4d4('0x35')]=qs[_0xd4d4('0x36')](_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x36')]);_0x5ae7f8['where']=qs[_0xd4d4('0x2e')](_['pick'](_0x3738fa[_0xd4d4('0x2c')],_0x3bfa3d['filters']),_0x4088f);if(_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x37')]){_0x5ae7f8[_0xd4d4('0x38')]=_[_0xd4d4('0x39')](_0x5ae7f8['where'],{'$or':_['map'](_0x4088f,function(_0x383e88){if(_0x383e88['type']!==_0xd4d4('0x3a')){var _0x344b79={};_0x344b79[_0x383e88[_0xd4d4('0x26')]]={'$like':'%'+_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x37')]+'%'};return _0x344b79;}})});}_0x5ae7f8=_[_0xd4d4('0x39')]({},_0x5ae7f8,_0x3738fa[_0xd4d4('0x3b')]);var _0x5607bd={'where':_0x5ae7f8[_0xd4d4('0x38')]};return db[_0xd4d4('0x28')]['count'](_0x5607bd)[_0xd4d4('0x3c')](function(_0x3b3ec0){_0x17211b[_0xd4d4('0x1d')]=_0x3b3ec0;if(_0x3738fa[_0xd4d4('0x2c')][_0xd4d4('0x3d')]){_0x5ae7f8['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0xd4d4('0x3e')](_0x5ae7f8);})[_0xd4d4('0x3c')](function(_0x24c88c){_0x17211b[_0xd4d4('0x3f')]=_0x24c88c;return _0x17211b;})[_0xd4d4('0x3c')](respondWithFilteredResult(_0x1b089e,_0x5ae7f8))[_0xd4d4('0x40')](handleError(_0x1b089e,null));};exports[_0xd4d4('0x41')]=function(_0x4ed22a,_0x1756f6){var _0xfaa9a5={'raw':!![],'where':{'id':_0x4ed22a[_0xd4d4('0x42')]['id']}},_0x5486d3={};_0x5486d3[_0xd4d4('0x2a')]=_[_0xd4d4('0x2d')](db[_0xd4d4('0x28')]['rawAttributes']);_0x5486d3[_0xd4d4('0x2c')]=_[_0xd4d4('0x2d')](_0x4ed22a[_0xd4d4('0x2c')]);_0x5486d3[_0xd4d4('0x2e')]=_[_0xd4d4('0x2f')](_0x5486d3['model'],_0x5486d3['query']);_0xfaa9a5[_0xd4d4('0x30')]=_[_0xd4d4('0x2f')](_0x5486d3['model'],qs['fields'](_0x4ed22a['query'][_0xd4d4('0x31')]));_0xfaa9a5[_0xd4d4('0x30')]=_0xfaa9a5[_0xd4d4('0x30')][_0xd4d4('0x32')]?_0xfaa9a5['attributes']:_0x5486d3['model'];if(_0x4ed22a[_0xd4d4('0x2c')][_0xd4d4('0x3d')]){_0xfaa9a5['include']=[{'all':!![]}];}_0xfaa9a5=_[_0xd4d4('0x39')]({},_0xfaa9a5,_0x4ed22a['options']);return db[_0xd4d4('0x28')][_0xd4d4('0x43')](_0xfaa9a5)['then'](handleEntityNotFound(_0x1756f6,null))[_0xd4d4('0x3c')](respondWithResult(_0x1756f6,null))[_0xd4d4('0x40')](handleError(_0x1756f6,null));};exports[_0xd4d4('0x44')]=function(_0x152b79,_0x1d05ba){return db[_0xd4d4('0x28')][_0xd4d4('0x44')](_0x152b79[_0xd4d4('0x45')],{})[_0xd4d4('0x3c')](respondWithResult(_0x1d05ba,0xc9))[_0xd4d4('0x40')](handleError(_0x1d05ba,null));};exports[_0xd4d4('0x21')]=function(_0x337e1f,_0x1c6bee){if(_0x337e1f[_0xd4d4('0x45')]['id']){delete _0x337e1f[_0xd4d4('0x45')]['id'];}return db[_0xd4d4('0x28')]['find']({'where':{'id':_0x337e1f['params']['id']}})[_0xd4d4('0x3c')](handleEntityNotFound(_0x1c6bee,null))[_0xd4d4('0x3c')](saveUpdates(_0x337e1f[_0xd4d4('0x45')],null))[_0xd4d4('0x3c')](respondWithResult(_0x1c6bee,null))[_0xd4d4('0x40')](handleError(_0x1c6bee,null));};exports[_0xd4d4('0x22')]=function(_0x39d9d8,_0x5da461){return db[_0xd4d4('0x28')][_0xd4d4('0x43')]({'where':{'id':_0x39d9d8[_0xd4d4('0x42')]['id']}})[_0xd4d4('0x3c')](handleEntityNotFound(_0x5da461,null))['then'](removeEntity(_0x5da461,null))['catch'](handleError(_0x5da461,null));};exports[_0xd4d4('0x46')]=function(_0x275122,_0x4a7351){return db[_0xd4d4('0x28')][_0xd4d4('0x46')]()['then'](respondWithResult(_0x4a7351,null))[_0xd4d4('0x40')](handleError(_0x4a7351,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 2043f8f..caf20b6 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 _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x3e52bb,_0x42aad8){var _0x5b91ae=function(_0x36846a){while(--_0x36846a){_0x3e52bb['push'](_0x3e52bb['shift']());}};_0x5b91ae(++_0x42aad8);}(_0x70e0,0x17b));var _0x070e=function(_0x35cb24,_0x25ecb1){_0x35cb24=_0x35cb24-0x0;var _0x3702c4=_0x70e0[_0x35cb24];return _0x3702c4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b312413..28c57d6 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 _0x2453=['body','options','UpdateSmsQueueReport','SmsQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','create'];(function(_0x55fb18,_0x22ca43){var _0x4c7217=function(_0x3bac21){while(--_0x3bac21){_0x55fb18['push'](_0x55fb18['shift']());}};_0x4c7217(++_0x22ca43);}(_0x2453,0x167));var _0x3245=function(_0x202e4d,_0x4684f9){_0x202e4d=_0x202e4d-0x0;var _0x1d113c=_0x2453[_0x202e4d];return _0x1d113c;};'use strict';var _=require(_0x3245('0x0'));var util=require(_0x3245('0x1'));var moment=require(_0x3245('0x2'));var BPromise=require(_0x3245('0x3'));var rs=require(_0x3245('0x4'));var fs=require('fs');var Redis=require(_0x3245('0x5'));var db=require(_0x3245('0x6'))['db'];var utils=require(_0x3245('0x7'));var logger=require(_0x3245('0x8'))(_0x3245('0x9'));var config=require(_0x3245('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3245('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d3af7,_0x3dfcd2,_0x17e7b2){return new BPromise(function(_0x189054,_0x5e6273){return client[_0x3245('0xc')](_0x4d3af7,_0x17e7b2)[_0x3245('0xd')](function(_0x1316eb){logger['info'](_0x3245('0xe'),_0x3dfcd2,_0x3245('0xf'));logger[_0x3245('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x3dfcd2,'request\x20sent',JSON[_0x3245('0x11')](_0x1316eb));if(_0x1316eb[_0x3245('0x12')]){if(_0x1316eb[_0x3245('0x12')][_0x3245('0x13')]===0x1f4){logger['error'](_0x3245('0xe'),_0x3dfcd2,_0x1316eb['error'][_0x3245('0x14')]);return _0x5e6273(_0x1316eb[_0x3245('0x12')][_0x3245('0x14')]);}logger[_0x3245('0x12')](_0x3245('0xe'),_0x3dfcd2,_0x1316eb[_0x3245('0x12')][_0x3245('0x14')]);return _0x189054(_0x1316eb[_0x3245('0x12')][_0x3245('0x14')]);}else{logger[_0x3245('0x15')](_0x3245('0xe'),_0x3dfcd2,_0x3245('0xf'));_0x189054(_0x1316eb[_0x3245('0x16')]['message']);}})[_0x3245('0x17')](function(_0x4929d1){logger['error'](_0x3245('0xe'),_0x3dfcd2,_0x4929d1);_0x5e6273(_0x4929d1);});});}exports[_0x3245('0x18')]=function(_0x59c491){var _0x2f2b10=this;return new Promise(function(_0x24f3f8,_0x4f1d64){return db['SmsQueueReport'][_0x3245('0x19')](_0x59c491[_0x3245('0x1a')],{'raw':_0x59c491[_0x3245('0x1b')]?_0x59c491[_0x3245('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3245('0xd')](function(_0x57be78){logger[_0x3245('0x15')](_0x3245('0x18'),_0x59c491);logger['debug'](_0x3245('0x18'),_0x59c491,JSON[_0x3245('0x11')](_0x57be78));_0x24f3f8(_0x57be78);})['catch'](function(_0x47c690){logger[_0x3245('0x12')](_0x3245('0x18'),_0x47c690['message'],_0x59c491);_0x4f1d64(_0x2f2b10[_0x3245('0x12')](0x1f4,_0x47c690['message']));});});};exports[_0x3245('0x1c')]=function(_0x5ce877){var _0x396e83=this;return new Promise(function(_0x3a8e07,_0x1d3cbd){return db[_0x3245('0x1d')][_0x3245('0x1e')](_0x5ce877[_0x3245('0x1a')],{'raw':_0x5ce877[_0x3245('0x1b')]?_0x5ce877[_0x3245('0x1b')][_0x3245('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ce877['options']?_0x5ce877['options'][_0x3245('0x20')]||null:null,'attributes':_0x5ce877[_0x3245('0x1b')]?_0x5ce877[_0x3245('0x1b')][_0x3245('0x21')]||null:null,'limit':_0x5ce877[_0x3245('0x1b')]?_0x5ce877[_0x3245('0x1b')][_0x3245('0x22')]||null:null})[_0x3245('0xd')](function(_0x2ce8a2){logger[_0x3245('0x15')]('UpdateSmsQueueReport',_0x5ce877);logger[_0x3245('0x10')]('UpdateSmsQueueReport',_0x5ce877,JSON[_0x3245('0x11')](_0x2ce8a2));_0x3a8e07(_0x2ce8a2);})[_0x3245('0x17')](function(_0x9341b4){logger[_0x3245('0x12')](_0x3245('0x1c'),_0x9341b4[_0x3245('0x14')],_0x5ce877);_0x1d3cbd(_0x396e83[_0x3245('0x12')](0x1f4,_0x9341b4['message']));});});}; \ No newline at end of file +var _0x778c=['moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util'];(function(_0x4adf20,_0x41cc23){var _0x5e2b5b=function(_0x44414e){while(--_0x44414e){_0x4adf20['push'](_0x4adf20['shift']());}};_0x5e2b5b(++_0x41cc23);}(_0x778c,0x1b8));var _0xc778=function(_0x5dc2fa,_0x56279d){_0x5dc2fa=_0x5dc2fa-0x0;var _0x16eaf9=_0x778c[_0x5dc2fa];return _0x16eaf9;};'use strict';var _=require(_0xc778('0x0'));var util=require(_0xc778('0x1'));var moment=require(_0xc778('0x2'));var BPromise=require('bluebird');var rs=require(_0xc778('0x3'));var fs=require('fs');var Redis=require(_0xc778('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc778('0x5'))(_0xc778('0x6'));var config=require('../../config/environment');var jayson=require(_0xc778('0x7'));var client=jayson[_0xc778('0x8')][_0xc778('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ed33,_0x2be366,_0x2f9bce){return new BPromise(function(_0x19a1b0,_0x1b154d){return client[_0xc778('0xa')](_0x27ed33,_0x2f9bce)[_0xc778('0xb')](function(_0x4255c4){logger[_0xc778('0xc')](_0xc778('0xd'),_0x2be366,'request\x20sent');logger['debug'](_0xc778('0xe'),_0x2be366,_0xc778('0xf'),JSON[_0xc778('0x10')](_0x4255c4));if(_0x4255c4['error']){if(_0x4255c4[_0xc778('0x11')][_0xc778('0x12')]===0x1f4){logger[_0xc778('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x2be366,_0x4255c4[_0xc778('0x11')][_0xc778('0x13')]);return _0x1b154d(_0x4255c4[_0xc778('0x11')][_0xc778('0x13')]);}logger[_0xc778('0x11')](_0xc778('0xd'),_0x2be366,_0x4255c4[_0xc778('0x11')][_0xc778('0x13')]);return _0x19a1b0(_0x4255c4['error'][_0xc778('0x13')]);}else{logger['info'](_0xc778('0xd'),_0x2be366,_0xc778('0xf'));_0x19a1b0(_0x4255c4[_0xc778('0x14')]['message']);}})[_0xc778('0x15')](function(_0x4651aa){logger[_0xc778('0x11')](_0xc778('0xd'),_0x2be366,_0x4651aa);_0x1b154d(_0x4651aa);});});}exports[_0xc778('0x16')]=function(_0x2647b7){var _0x58ab6e=this;return new Promise(function(_0x35cbfb,_0x2418e9){return db[_0xc778('0x17')][_0xc778('0x18')](_0x2647b7[_0xc778('0x19')],{'raw':_0x2647b7[_0xc778('0x1a')]?_0x2647b7[_0xc778('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc778('0xb')](function(_0x39b2d6){logger[_0xc778('0xc')]('CreateSmsQueueReport',_0x2647b7);logger[_0xc778('0x1b')](_0xc778('0x16'),_0x2647b7,JSON[_0xc778('0x10')](_0x39b2d6));_0x35cbfb(_0x39b2d6);})['catch'](function(_0x10a849){logger[_0xc778('0x11')](_0xc778('0x16'),_0x10a849[_0xc778('0x13')],_0x2647b7);_0x2418e9(_0x58ab6e[_0xc778('0x11')](0x1f4,_0x10a849[_0xc778('0x13')]));});});};exports[_0xc778('0x1c')]=function(_0x1cf9ef){var _0x1601e1=this;return new Promise(function(_0x493e2d,_0x26bebc){return db[_0xc778('0x17')][_0xc778('0x1d')](_0x1cf9ef[_0xc778('0x19')],{'raw':_0x1cf9ef['options']?_0x1cf9ef[_0xc778('0x1a')][_0xc778('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cf9ef[_0xc778('0x1a')]?_0x1cf9ef[_0xc778('0x1a')][_0xc778('0x1f')]||null:null,'attributes':_0x1cf9ef['options']?_0x1cf9ef[_0xc778('0x1a')][_0xc778('0x20')]||null:null,'limit':_0x1cf9ef[_0xc778('0x1a')]?_0x1cf9ef[_0xc778('0x1a')][_0xc778('0x21')]||null:null})['then'](function(_0x22ac76){logger['info'](_0xc778('0x1c'),_0x1cf9ef);logger[_0xc778('0x1b')](_0xc778('0x1c'),_0x1cf9ef,JSON['stringify'](_0x22ac76));_0x493e2d(_0x22ac76);})[_0xc778('0x15')](function(_0x2fd897){logger[_0xc778('0x11')](_0xc778('0x1c'),_0x2fd897[_0xc778('0x13')],_0x1cf9ef);_0x26bebc(_0x1601e1['error'](0x1f4,_0x2fd897['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3969222..164f6e5 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 _0xe0c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x33a3a1,_0x325366){var _0x1c1b70=function(_0x5c3e95){while(--_0x5c3e95){_0x33a3a1['push'](_0x33a3a1['shift']());}};_0x1c1b70(++_0x325366);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xb')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')]('/',auth[_0x3e0c('0xd')](),controller['create']);router['put'](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x72b1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0xbaff2e,_0x12dd53){var _0x10eeac=function(_0x37e3d0){while(--_0x37e3d0){_0xbaff2e['push'](_0xbaff2e['shift']());}};_0x10eeac(++_0x12dd53);}(_0x72b1,0x16e));var _0x172b=function(_0xa60f4c,_0x3d15d6){_0xa60f4c=_0xa60f4c-0x0;var _0x31b129=_0x72b1[_0xa60f4c];return _0x31b129;};'use strict';var multer=require(_0x172b('0x0'));var util=require('util');var path=require(_0x172b('0x1'));var timeout=require(_0x172b('0x2'));var express=require(_0x172b('0x3'));var router=express[_0x172b('0x4')]();var fs_extra=require(_0x172b('0x5'));var auth=require(_0x172b('0x6'));var interaction=require(_0x172b('0x7'));var config=require('../../config/environment');var controller=require(_0x172b('0x8'));router[_0x172b('0x9')]('/',auth[_0x172b('0xa')](),controller[_0x172b('0xb')]);router['get'](_0x172b('0xc'),auth['isAuthenticated'](),controller[_0x172b('0xd')]);router['get'](_0x172b('0xe'),auth[_0x172b('0xa')](),controller[_0x172b('0xf')]);router[_0x172b('0x10')]('/',auth['isAuthenticated'](),controller[_0x172b('0x11')]);router[_0x172b('0x12')](_0x172b('0xe'),auth[_0x172b('0xa')](),controller[_0x172b('0x13')]);router[_0x172b('0x14')](_0x172b('0xe'),auth['isAuthenticated'](),controller[_0x172b('0x15')]);module[_0x172b('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index f054dd2..2bf5ff9 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x9bde,0xe1));var _0xe9bd=function(_0xc98702,_0x40a9f4){_0xc98702=_0xc98702-0x0;var _0x33ff9d=_0x9bde[_0xc98702];return _0x33ff9d;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x45535d,_0x2960c6){var _0x186e5a=function(_0x8596d5){while(--_0x8596d5){_0x45535d['push'](_0x45535d['shift']());}};_0x186e5a(++_0x2960c6);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0x4b84[_0x1196b0];return _0x111c52;};'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 2f263df..fce14c5 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 _0xeb43=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','reject','then','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','update','describe','eml-format','rimraf','zip-dir'];(function(_0xfebc2a,_0x34f46c){var _0xb999a1=function(_0x29a134){while(--_0x29a134){_0xfebc2a['push'](_0xfebc2a['shift']());}};_0xb999a1(++_0x34f46c);}(_0xeb43,0x1b3));var _0x3eb4=function(_0x5814ca,_0x3b6713){_0x5814ca=_0x5814ca-0x0;var _0xeb1833=_0xeb43[_0x5814ca];return _0xeb1833;};'use strict';var emlformat=require(_0x3eb4('0x0'));var rimraf=require(_0x3eb4('0x1'));var zipdir=require(_0x3eb4('0x2'));var jsonpatch=require(_0x3eb4('0x3'));var rp=require(_0x3eb4('0x4'));var moment=require(_0x3eb4('0x5'));var BPromise=require(_0x3eb4('0x6'));var Mustache=require(_0x3eb4('0x7'));var util=require(_0x3eb4('0x8'));var path=require(_0x3eb4('0x9'));var sox=require('sox');var csv=require(_0x3eb4('0xa'));var ejs=require(_0x3eb4('0xb'));var fs=require('fs');var fs_extra=require(_0x3eb4('0xc'));var _=require(_0x3eb4('0xd'));var squel=require(_0x3eb4('0xe'));var crypto=require(_0x3eb4('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3eb4('0xa'));var querystring=require(_0x3eb4('0x10'));var Papa=require(_0x3eb4('0x11'));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(_0x3eb4('0x12'));var logger=require(_0x3eb4('0x13'))(_0x3eb4('0x14'));var utils=require(_0x3eb4('0x15'));var config=require(_0x3eb4('0x16'));var licenseUtil=require(_0x3eb4('0x17'));var db=require(_0x3eb4('0x18'))['db'];function respondWithStatusCode(_0x1066ec,_0x529159){_0x529159=_0x529159||0xcc;return function(_0x5ba520){if(_0x5ba520){return _0x1066ec[_0x3eb4('0x19')](_0x529159);}return _0x1066ec['status'](_0x529159)[_0x3eb4('0x1a')]();};}function respondWithResult(_0x498a62,_0x3197b5){_0x3197b5=_0x3197b5||0xc8;return function(_0x331960){if(_0x331960){return _0x498a62[_0x3eb4('0x1b')](_0x3197b5)[_0x3eb4('0x1c')](_0x331960);}};}function respondWithFilteredResult(_0x2971d8,_0x54dd14){return function(_0x2bbbc4){if(_0x2bbbc4){var _0x50e53c=typeof _0x54dd14['offset']===_0x3eb4('0x1d')&&typeof _0x54dd14[_0x3eb4('0x1e')]===_0x3eb4('0x1d');var _0x32f1dd=_0x2bbbc4[_0x3eb4('0x1f')];var _0x3e90ce=_0x50e53c?0x0:_0x54dd14['offset'];var _0x2e91d2=_0x50e53c?_0x2bbbc4[_0x3eb4('0x1f')]:_0x54dd14['offset']+_0x54dd14[_0x3eb4('0x1e')];var _0x22e2d0;if(_0x2e91d2>=_0x32f1dd){_0x2e91d2=_0x32f1dd;_0x22e2d0=0xc8;}else{_0x22e2d0=0xce;}_0x2971d8[_0x3eb4('0x1b')](_0x22e2d0);return _0x2971d8[_0x3eb4('0x20')](_0x3eb4('0x21'),_0x3e90ce+'-'+_0x2e91d2+'/'+_0x32f1dd)[_0x3eb4('0x1c')](_0x2bbbc4);}return null;};}function patchUpdates(_0x234b6c){return function(_0x30a4c2){try{jsonpatch['apply'](_0x30a4c2,_0x234b6c,!![]);}catch(_0x23cc0f){return BPromise[_0x3eb4('0x22')](_0x23cc0f);}return _0x30a4c2['save']();};}function saveUpdates(_0x3bc153,_0x3e892f){return function(_0x51ac5b){if(_0x51ac5b){return _0x51ac5b['update'](_0x3bc153)['then'](function(_0x1644d6){return _0x1644d6;});}return null;};}function removeEntity(_0x254608,_0x4f883e){return function(_0x3bedf7){if(_0x3bedf7){return _0x3bedf7['destroy']()[_0x3eb4('0x23')](function(){_0x254608['status'](0xcc)[_0x3eb4('0x1a')]();});}};}function handleEntityNotFound(_0x5126e5,_0x2e2441){return function(_0x17696b){if(!_0x17696b){_0x5126e5[_0x3eb4('0x19')](0x194);}return _0x17696b;};}function handleError(_0xf5bc78,_0x118c4b){_0x118c4b=_0x118c4b||0x1f4;return function(_0x898c43){logger['error'](_0x898c43[_0x3eb4('0x24')]);if(_0x898c43[_0x3eb4('0x25')]){delete _0x898c43[_0x3eb4('0x25')];}_0xf5bc78['status'](_0x118c4b)['send'](_0x898c43);};}exports['index']=function(_0x2a29f6,_0x4826ab){var _0x520b34={},_0x465d10={},_0x253852={'count':0x0,'rows':[]};var _0x13af07=_[_0x3eb4('0x26')](db[_0x3eb4('0x27')][_0x3eb4('0x28')],function(_0x50ba31){return{'name':_0x50ba31[_0x3eb4('0x29')],'type':_0x50ba31[_0x3eb4('0x2a')][_0x3eb4('0x2b')]};});_0x465d10[_0x3eb4('0x2c')]=_[_0x3eb4('0x26')](_0x13af07,_0x3eb4('0x25'));_0x465d10['query']=_[_0x3eb4('0x2d')](_0x2a29f6[_0x3eb4('0x2e')]);_0x465d10[_0x3eb4('0x2f')]=_[_0x3eb4('0x30')](_0x465d10[_0x3eb4('0x2c')],_0x465d10[_0x3eb4('0x2e')]);_0x520b34[_0x3eb4('0x31')]=_[_0x3eb4('0x30')](_0x465d10[_0x3eb4('0x2c')],qs['fields'](_0x2a29f6[_0x3eb4('0x2e')]['fields']));_0x520b34[_0x3eb4('0x31')]=_0x520b34['attributes'][_0x3eb4('0x32')]?_0x520b34['attributes']:_0x465d10['model'];if(!_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x33')]('nolimit')){_0x520b34['limit']=qs[_0x3eb4('0x1e')](_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x1e')]);_0x520b34[_0x3eb4('0x34')]=qs[_0x3eb4('0x34')](_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x34')]);}_0x520b34[_0x3eb4('0x35')]=qs[_0x3eb4('0x36')](_0x2a29f6[_0x3eb4('0x2e')]['sort']);_0x520b34['where']=qs[_0x3eb4('0x2f')](_[_0x3eb4('0x37')](_0x2a29f6[_0x3eb4('0x2e')],_0x465d10['filters']),_0x13af07);if(_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x38')]){_0x520b34[_0x3eb4('0x39')]=_[_0x3eb4('0x3a')](_0x520b34[_0x3eb4('0x39')],{'$or':_[_0x3eb4('0x26')](_0x13af07,function(_0x16cc0d){if(_0x16cc0d[_0x3eb4('0x2a')]!==_0x3eb4('0x3b')){var _0x1f86df={};_0x1f86df[_0x16cc0d[_0x3eb4('0x25')]]={'$like':'%'+_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x38')]+'%'};return _0x1f86df;}})});}_0x520b34=_['merge']({},_0x520b34,_0x2a29f6['options']);var _0x451fde={'where':_0x520b34[_0x3eb4('0x39')]};return db['SmsTransferReport']['count'](_0x451fde)[_0x3eb4('0x23')](function(_0x17c012){_0x253852[_0x3eb4('0x1f')]=_0x17c012;if(_0x2a29f6[_0x3eb4('0x2e')][_0x3eb4('0x3c')]){_0x520b34['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x3eb4('0x3d')](_0x520b34);})['then'](function(_0x119796){_0x253852[_0x3eb4('0x3e')]=_0x119796;return _0x253852;})['then'](respondWithFilteredResult(_0x4826ab,_0x520b34))[_0x3eb4('0x3f')](handleError(_0x4826ab,null));};exports[_0x3eb4('0x40')]=function(_0x25258c,_0x390c83){var _0x372cd8={'raw':!![],'where':{'id':_0x25258c[_0x3eb4('0x41')]['id']}},_0x5d3e80={};_0x5d3e80[_0x3eb4('0x2c')]=_[_0x3eb4('0x2d')](db['SmsTransferReport'][_0x3eb4('0x28')]);_0x5d3e80[_0x3eb4('0x2e')]=_[_0x3eb4('0x2d')](_0x25258c['query']);_0x5d3e80[_0x3eb4('0x2f')]=_['intersection'](_0x5d3e80[_0x3eb4('0x2c')],_0x5d3e80[_0x3eb4('0x2e')]);_0x372cd8[_0x3eb4('0x31')]=_[_0x3eb4('0x30')](_0x5d3e80[_0x3eb4('0x2c')],qs[_0x3eb4('0x42')](_0x25258c[_0x3eb4('0x2e')]['fields']));_0x372cd8[_0x3eb4('0x31')]=_0x372cd8[_0x3eb4('0x31')][_0x3eb4('0x32')]?_0x372cd8[_0x3eb4('0x31')]:_0x5d3e80[_0x3eb4('0x2c')];if(_0x25258c[_0x3eb4('0x2e')][_0x3eb4('0x3c')]){_0x372cd8[_0x3eb4('0x43')]=[{'all':!![]}];}_0x372cd8=_['merge']({},_0x372cd8,_0x25258c['options']);return db[_0x3eb4('0x27')][_0x3eb4('0x44')](_0x372cd8)['then'](handleEntityNotFound(_0x390c83,null))[_0x3eb4('0x23')](respondWithResult(_0x390c83,null))['catch'](handleError(_0x390c83,null));};exports[_0x3eb4('0x45')]=function(_0x297dff,_0xb3a265){return db[_0x3eb4('0x27')][_0x3eb4('0x45')](_0x297dff[_0x3eb4('0x46')],{})['then'](respondWithResult(_0xb3a265,0xc9))[_0x3eb4('0x3f')](handleError(_0xb3a265,null));};exports[_0x3eb4('0x47')]=function(_0x22c9f7,_0x13815d){if(_0x22c9f7[_0x3eb4('0x46')]['id']){delete _0x22c9f7['body']['id'];}return db['SmsTransferReport'][_0x3eb4('0x44')]({'where':{'id':_0x22c9f7['params']['id']}})['then'](handleEntityNotFound(_0x13815d,null))['then'](saveUpdates(_0x22c9f7[_0x3eb4('0x46')],null))[_0x3eb4('0x23')](respondWithResult(_0x13815d,null))[_0x3eb4('0x3f')](handleError(_0x13815d,null));};exports['destroy']=function(_0x1f5254,_0x1326ab){return db[_0x3eb4('0x27')][_0x3eb4('0x44')]({'where':{'id':_0x1f5254[_0x3eb4('0x41')]['id']}})['then'](handleEntityNotFound(_0x1326ab,null))[_0x3eb4('0x23')](removeEntity(_0x1326ab,null))[_0x3eb4('0x3f')](handleError(_0x1326ab,null));};exports[_0x3eb4('0x48')]=function(_0x20728e,_0x140a02){return db['SmsTransferReport']['describe']()[_0x3eb4('0x23')](respondWithResult(_0x140a02,null))['catch'](handleError(_0x140a02,null));}; \ No newline at end of file +var _0xa12a=['order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','SmsTransferReport','rows','catch','show','length','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','limit'];(function(_0x8aadb9,_0x14baa9){var _0x3bbefa=function(_0x405d7e){while(--_0x405d7e){_0x8aadb9['push'](_0x8aadb9['shift']());}};_0x3bbefa(++_0x14baa9);}(_0xa12a,0x187));var _0xaa12=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa12a[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa12('0x0'));var zipdir=require(_0xaa12('0x1'));var jsonpatch=require(_0xaa12('0x2'));var rp=require('request-promise');var moment=require(_0xaa12('0x3'));var BPromise=require(_0xaa12('0x4'));var Mustache=require(_0xaa12('0x5'));var util=require(_0xaa12('0x6'));var path=require(_0xaa12('0x7'));var sox=require(_0xaa12('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa12('0x9'));var _=require(_0xaa12('0xa'));var squel=require('squel');var crypto=require(_0xaa12('0xb'));var jsforce=require(_0xaa12('0xc'));var deskjs=require(_0xaa12('0xd'));var toCsv=require(_0xaa12('0xe'));var querystring=require(_0xaa12('0xf'));var Papa=require(_0xaa12('0x10'));var Redis=require(_0xaa12('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa12('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa12('0x13'));var utils=require(_0xaa12('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xaa12('0x15'));var db=require(_0xaa12('0x16'))['db'];function respondWithStatusCode(_0x4c998f,_0x39cb21){_0x39cb21=_0x39cb21||0xcc;return function(_0x1b6e31){if(_0x1b6e31){return _0x4c998f[_0xaa12('0x17')](_0x39cb21);}return _0x4c998f[_0xaa12('0x18')](_0x39cb21)[_0xaa12('0x19')]();};}function respondWithResult(_0x52a4de,_0x391b64){_0x391b64=_0x391b64||0xc8;return function(_0x6ff55){if(_0x6ff55){return _0x52a4de[_0xaa12('0x18')](_0x391b64)['json'](_0x6ff55);}};}function respondWithFilteredResult(_0x28126e,_0x5456c3){return function(_0x2444ee){if(_0x2444ee){var _0x3311bf=typeof _0x5456c3[_0xaa12('0x1a')]===_0xaa12('0x1b')&&typeof _0x5456c3['limit']===_0xaa12('0x1b');var _0x43962d=_0x2444ee[_0xaa12('0x1c')];var _0x390902=_0x3311bf?0x0:_0x5456c3[_0xaa12('0x1a')];var _0xd48da9=_0x3311bf?_0x2444ee[_0xaa12('0x1c')]:_0x5456c3[_0xaa12('0x1a')]+_0x5456c3['limit'];var _0x1bdb73;if(_0xd48da9>=_0x43962d){_0xd48da9=_0x43962d;_0x1bdb73=0xc8;}else{_0x1bdb73=0xce;}_0x28126e[_0xaa12('0x18')](_0x1bdb73);return _0x28126e[_0xaa12('0x1d')](_0xaa12('0x1e'),_0x390902+'-'+_0xd48da9+'/'+_0x43962d)[_0xaa12('0x1f')](_0x2444ee);}return null;};}function patchUpdates(_0x5944e7){return function(_0x15ea4d){try{jsonpatch[_0xaa12('0x20')](_0x15ea4d,_0x5944e7,!![]);}catch(_0x308a60){return BPromise[_0xaa12('0x21')](_0x308a60);}return _0x15ea4d[_0xaa12('0x22')]();};}function saveUpdates(_0x5302c9,_0x2d01a8){return function(_0x3b9a67){if(_0x3b9a67){return _0x3b9a67[_0xaa12('0x23')](_0x5302c9)[_0xaa12('0x24')](function(_0x1066df){return _0x1066df;});}return null;};}function removeEntity(_0x4d6825,_0x118408){return function(_0x1a6dd1){if(_0x1a6dd1){return _0x1a6dd1[_0xaa12('0x25')]()[_0xaa12('0x24')](function(){_0x4d6825[_0xaa12('0x18')](0xcc)[_0xaa12('0x19')]();});}};}function handleEntityNotFound(_0x5382f0,_0x501513){return function(_0x12c9c7){if(!_0x12c9c7){_0x5382f0[_0xaa12('0x17')](0x194);}return _0x12c9c7;};}function handleError(_0x23a1e6,_0x3692d9){_0x3692d9=_0x3692d9||0x1f4;return function(_0x25d69b){logger['error'](_0x25d69b[_0xaa12('0x26')]);if(_0x25d69b[_0xaa12('0x27')]){delete _0x25d69b[_0xaa12('0x27')];}_0x23a1e6[_0xaa12('0x18')](_0x3692d9)['send'](_0x25d69b);};}exports[_0xaa12('0x28')]=function(_0x1fb8d6,_0x8d8e76){var _0xf6874f={},_0x422cfa={},_0x43bee2={'count':0x0,'rows':[]};var _0x2c524c=_['map'](db['SmsTransferReport'][_0xaa12('0x29')],function(_0xb0f670){return{'name':_0xb0f670[_0xaa12('0x2a')],'type':_0xb0f670[_0xaa12('0x2b')][_0xaa12('0x2c')]};});_0x422cfa['model']=_['map'](_0x2c524c,_0xaa12('0x27'));_0x422cfa[_0xaa12('0x2d')]=_[_0xaa12('0x2e')](_0x1fb8d6['query']);_0x422cfa['filters']=_[_0xaa12('0x2f')](_0x422cfa[_0xaa12('0x30')],_0x422cfa[_0xaa12('0x2d')]);_0xf6874f[_0xaa12('0x31')]=_[_0xaa12('0x2f')](_0x422cfa[_0xaa12('0x30')],qs[_0xaa12('0x32')](_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x32')]));_0xf6874f[_0xaa12('0x31')]=_0xf6874f[_0xaa12('0x31')]['length']?_0xf6874f[_0xaa12('0x31')]:_0x422cfa[_0xaa12('0x30')];if(!_0x1fb8d6['query']['hasOwnProperty'](_0xaa12('0x33'))){_0xf6874f[_0xaa12('0x34')]=qs[_0xaa12('0x34')](_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x34')]);_0xf6874f[_0xaa12('0x1a')]=qs[_0xaa12('0x1a')](_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x1a')]);}_0xf6874f[_0xaa12('0x35')]=qs[_0xaa12('0x36')](_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x36')]);_0xf6874f[_0xaa12('0x37')]=qs[_0xaa12('0x38')](_[_0xaa12('0x39')](_0x1fb8d6['query'],_0x422cfa[_0xaa12('0x38')]),_0x2c524c);if(_0x1fb8d6['query'][_0xaa12('0x3a')]){_0xf6874f['where']=_[_0xaa12('0x3b')](_0xf6874f[_0xaa12('0x37')],{'$or':_[_0xaa12('0x3c')](_0x2c524c,function(_0x14b7db){if(_0x14b7db[_0xaa12('0x2b')]!=='VIRTUAL'){var _0x40c03d={};_0x40c03d[_0x14b7db[_0xaa12('0x27')]]={'$like':'%'+_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x3a')]+'%'};return _0x40c03d;}})});}_0xf6874f=_[_0xaa12('0x3b')]({},_0xf6874f,_0x1fb8d6[_0xaa12('0x3d')]);var _0x174d16={'where':_0xf6874f[_0xaa12('0x37')]};return db['SmsTransferReport'][_0xaa12('0x1c')](_0x174d16)[_0xaa12('0x24')](function(_0x1e708c){_0x43bee2['count']=_0x1e708c;if(_0x1fb8d6[_0xaa12('0x2d')][_0xaa12('0x3e')]){_0xf6874f[_0xaa12('0x3f')]=[{'all':!![]}];}return db[_0xaa12('0x40')]['findAll'](_0xf6874f);})[_0xaa12('0x24')](function(_0x55680f){_0x43bee2[_0xaa12('0x41')]=_0x55680f;return _0x43bee2;})[_0xaa12('0x24')](respondWithFilteredResult(_0x8d8e76,_0xf6874f))[_0xaa12('0x42')](handleError(_0x8d8e76,null));};exports[_0xaa12('0x43')]=function(_0x11df1c,_0x53fb45){var _0x375b0f={'raw':!![],'where':{'id':_0x11df1c['params']['id']}},_0x4b77a1={};_0x4b77a1[_0xaa12('0x30')]=_[_0xaa12('0x2e')](db[_0xaa12('0x40')][_0xaa12('0x29')]);_0x4b77a1[_0xaa12('0x2d')]=_[_0xaa12('0x2e')](_0x11df1c['query']);_0x4b77a1[_0xaa12('0x38')]=_[_0xaa12('0x2f')](_0x4b77a1[_0xaa12('0x30')],_0x4b77a1[_0xaa12('0x2d')]);_0x375b0f[_0xaa12('0x31')]=_[_0xaa12('0x2f')](_0x4b77a1[_0xaa12('0x30')],qs[_0xaa12('0x32')](_0x11df1c['query']['fields']));_0x375b0f[_0xaa12('0x31')]=_0x375b0f[_0xaa12('0x31')][_0xaa12('0x44')]?_0x375b0f[_0xaa12('0x31')]:_0x4b77a1[_0xaa12('0x30')];if(_0x11df1c[_0xaa12('0x2d')][_0xaa12('0x3e')]){_0x375b0f[_0xaa12('0x3f')]=[{'all':!![]}];}_0x375b0f=_[_0xaa12('0x3b')]({},_0x375b0f,_0x11df1c[_0xaa12('0x3d')]);return db[_0xaa12('0x40')]['find'](_0x375b0f)[_0xaa12('0x24')](handleEntityNotFound(_0x53fb45,null))[_0xaa12('0x24')](respondWithResult(_0x53fb45,null))['catch'](handleError(_0x53fb45,null));};exports[_0xaa12('0x45')]=function(_0x509989,_0x100bf5){return db[_0xaa12('0x40')][_0xaa12('0x45')](_0x509989['body'],{})[_0xaa12('0x24')](respondWithResult(_0x100bf5,0xc9))['catch'](handleError(_0x100bf5,null));};exports['update']=function(_0x3a83e8,_0x3eb9f7){if(_0x3a83e8[_0xaa12('0x46')]['id']){delete _0x3a83e8[_0xaa12('0x46')]['id'];}return db[_0xaa12('0x40')][_0xaa12('0x47')]({'where':{'id':_0x3a83e8[_0xaa12('0x48')]['id']}})['then'](handleEntityNotFound(_0x3eb9f7,null))[_0xaa12('0x24')](saveUpdates(_0x3a83e8[_0xaa12('0x46')],null))[_0xaa12('0x24')](respondWithResult(_0x3eb9f7,null))[_0xaa12('0x42')](handleError(_0x3eb9f7,null));};exports[_0xaa12('0x25')]=function(_0x1a588d,_0x30300e){return db[_0xaa12('0x40')][_0xaa12('0x47')]({'where':{'id':_0x1a588d[_0xaa12('0x48')]['id']}})[_0xaa12('0x24')](handleEntityNotFound(_0x30300e,null))[_0xaa12('0x24')](removeEntity(_0x30300e,null))[_0xaa12('0x42')](handleError(_0x30300e,null));};exports['describe']=function(_0x45b4e7,_0x19a7ed){return db['SmsTransferReport'][_0xaa12('0x49')]()['then'](respondWithResult(_0x19a7ed,null))[_0xaa12('0x42')](handleError(_0x19a7ed,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a02fdea..a44e74e 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 _0xa179=['moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x59249c,_0x278139){var _0x4b3321=function(_0x306d98){while(--_0x306d98){_0x59249c['push'](_0x59249c['shift']());}};_0x4b3321(++_0x278139);}(_0xa179,0x191));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var logger=require(_0x9a17('0x2'))(_0x9a17('0x3'));var moment=require(_0x9a17('0x4'));var BPromise=require(_0x9a17('0x5'));var rp=require(_0x9a17('0x6'));var fs=require('fs');var path=require(_0x9a17('0x7'));var rimraf=require(_0x9a17('0x8'));var config=require('../../config/environment');var attributes=require(_0x9a17('0x9'));module[_0x9a17('0xa')]=function(_0x6c3df0,_0x217339){return _0x6c3df0[_0x9a17('0xb')](_0x9a17('0xc'),attributes,{'tableName':_0x9a17('0xd'),'paranoid':![],'indexes':[{'name':_0x9a17('0xe'),'fields':[_0x9a17('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc770=['define','report_sms_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x261a4e,_0x210aef){var _0x3c564e=function(_0x3f05d4){while(--_0x3f05d4){_0x261a4e['push'](_0x261a4e['shift']());}};_0x3c564e(++_0x210aef);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('SmsTransferReport',attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0c77('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 689f0ed..7c3fe6e 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 _0xc23a=['jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../config/logger','../../config/environment'];(function(_0x36206d,_0xfb581d){var _0x38affe=function(_0x184c86){while(--_0x184c86){_0x36206d['push'](_0x36206d['shift']());}};_0x38affe(++_0xfb581d);}(_0xc23a,0xd2));var _0xac23=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0xc23a[_0xf0ec6e];return _0x8bbc27;};'use strict';var _=require('lodash');var util=require(_0xac23('0x0'));var moment=require(_0xac23('0x1'));var BPromise=require(_0xac23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac23('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac23('0x4'))('rpc');var config=require(_0xac23('0x5'));var jayson=require(_0xac23('0x6'));var client=jayson[_0xac23('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47b021,_0x44b7d2,_0x3b6647){return new BPromise(function(_0x20342c,_0x5b2705){return client[_0xac23('0x8')](_0x47b021,_0x3b6647)[_0xac23('0x9')](function(_0x3f5fa6){logger[_0xac23('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,'request\x20sent');logger['debug'](_0xac23('0xb'),_0x44b7d2,_0xac23('0xc'),JSON['stringify'](_0x3f5fa6));if(_0x3f5fa6[_0xac23('0xd')]){if(_0x3f5fa6[_0xac23('0xd')][_0xac23('0xe')]===0x1f4){logger[_0xac23('0xd')](_0xac23('0xf'),_0x44b7d2,_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);return _0x5b2705(_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);}logger[_0xac23('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,_0x3f5fa6[_0xac23('0xd')][_0xac23('0x10')]);return _0x20342c(_0x3f5fa6['error']['message']);}else{logger[_0xac23('0xa')](_0xac23('0xf'),_0x44b7d2,_0xac23('0xc'));_0x20342c(_0x3f5fa6['result'][_0xac23('0x10')]);}})[_0xac23('0x11')](function(_0xaf49de){logger[_0xac23('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x44b7d2,_0xaf49de);_0x5b2705(_0xaf49de);});});} \ No newline at end of file +var _0xdf70=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0xf3728d,_0x5ebea1){var _0x5c4c13=function(_0x8d4155){while(--_0x8d4155){_0xf3728d['push'](_0xf3728d['shift']());}};_0x5c4c13(++_0x5ebea1);}(_0xdf70,0x86));var _0x0df7=function(_0x3175f8,_0x27812c){_0x3175f8=_0x3175f8-0x0;var _0x40e76c=_0xdf70[_0x3175f8];return _0x40e76c;};'use strict';var _=require(_0x0df7('0x0'));var util=require(_0x0df7('0x1'));var moment=require(_0x0df7('0x2'));var BPromise=require('bluebird');var rs=require(_0x0df7('0x3'));var fs=require('fs');var Redis=require(_0x0df7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0df7('0x5'));var logger=require('../../config/logger')(_0x0df7('0x6'));var config=require(_0x0df7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0df7('0x8')][_0x0df7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42090d,_0x5c1a5b,_0x1f1680){return new BPromise(function(_0x392337,_0x44c4fb){return client[_0x0df7('0xa')](_0x42090d,_0x1f1680)[_0x0df7('0xb')](function(_0x411e73){logger['info'](_0x0df7('0xc'),_0x5c1a5b,_0x0df7('0xd'));logger[_0x0df7('0xe')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5c1a5b,_0x0df7('0xd'),JSON[_0x0df7('0xf')](_0x411e73));if(_0x411e73[_0x0df7('0x10')]){if(_0x411e73['error'][_0x0df7('0x11')]===0x1f4){logger[_0x0df7('0x10')](_0x0df7('0xc'),_0x5c1a5b,_0x411e73['error'][_0x0df7('0x12')]);return _0x44c4fb(_0x411e73['error']['message']);}logger[_0x0df7('0x10')](_0x0df7('0xc'),_0x5c1a5b,_0x411e73[_0x0df7('0x10')][_0x0df7('0x12')]);return _0x392337(_0x411e73['error'][_0x0df7('0x12')]);}else{logger[_0x0df7('0x13')](_0x0df7('0xc'),_0x5c1a5b,_0x0df7('0xd'));_0x392337(_0x411e73[_0x0df7('0x14')]['message']);}})[_0x0df7('0x15')](function(_0x4161d1){logger['error'](_0x0df7('0xc'),_0x5c1a5b,_0x4161d1);_0x44c4fb(_0x4161d1);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9bf9f0f..df886b5 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 _0xd252=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','file','create','put','delete','multer'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xd252,0xb3));var _0x2d25=function(_0x134b6e,_0x21b5ca){_0x134b6e=_0x134b6e-0x0;var _0x2229a9=_0xd252[_0x134b6e];return _0x2229a9;};'use strict';var multer=require(_0x2d25('0x0'));var util=require(_0x2d25('0x1'));var path=require(_0x2d25('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d25('0x3'));var router=express[_0x2d25('0x4')]();var fs_extra=require(_0x2d25('0x5'));var auth=require(_0x2d25('0x6'));var interaction=require(_0x2d25('0x7'));var config=require(_0x2d25('0x8'));var controller=require(_0x2d25('0x9'));router[_0x2d25('0xa')]('/',auth[_0x2d25('0xb')](),controller[_0x2d25('0xc')]);router['get'](_0x2d25('0xd'),auth[_0x2d25('0xb')](),controller[_0x2d25('0xe')]);router[_0x2d25('0xa')](_0x2d25('0xf'),auth[_0x2d25('0xb')](),controller[_0x2d25('0x10')]);var upload=multer({'storage':multer[_0x2d25('0x11')]({'destination':function(_0x25ac27,_0x2ced1a,_0x3c76e7){_0x3c76e7(null,path[_0x2d25('0x12')](config[_0x2d25('0x13')],'server/files/sounds/original/'));},'filename':function(_0x390ac0,_0xfc3766,_0x53a611){_0xfc3766[_0x2d25('0x14')]=_0xfc3766['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53a611(null,util[_0x2d25('0x15')](_0x2d25('0x16'),path[_0x2d25('0x17')](_0xfc3766[_0x2d25('0x14')],path[_0x2d25('0x18')](_0xfc3766['originalname'])),Date[_0x2d25('0x19')](),path[_0x2d25('0x18')](_0xfc3766[_0x2d25('0x14')])));}})});router['post']('/',upload['single'](_0x2d25('0x1a')),controller[_0x2d25('0x1b')]);router[_0x2d25('0x1c')](_0x2d25('0xd'),auth[_0x2d25('0xb')](),controller['update']);router[_0x2d25('0x1d')](_0x2d25('0xd'),auth[_0x2d25('0xb')](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x0f0f=['download','join','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','single','file','create','put','/:id','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','index','isAuthenticated'];(function(_0xa8bbbf,_0x5c4321){var _0x17d8f5=function(_0x359e39){while(--_0x359e39){_0xa8bbbf['push'](_0xa8bbbf['shift']());}};_0x17d8f5(++_0x5c4321);}(_0x0f0f,0xff));var _0xf0f0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f0f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf0f0('0x0'));var util=require(_0xf0f0('0x1'));var path=require(_0xf0f0('0x2'));var timeout=require(_0xf0f0('0x3'));var express=require(_0xf0f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf0f0('0x5'));var config=require(_0xf0f0('0x6'));var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf0f0('0x7')]);router['get']('/:id',auth[_0xf0f0('0x8')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf0f0('0x9')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19099f,_0x2cb471,_0x268a01){_0x268a01(null,path[_0xf0f0('0xa')](config['root'],_0xf0f0('0xb')));},'filename':function(_0x55a9ce,_0x24894c,_0x13ea48){_0x24894c[_0xf0f0('0xc')]=_0x24894c[_0xf0f0('0xc')][_0xf0f0('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x13ea48(null,util['format'](_0xf0f0('0xe'),path[_0xf0f0('0xf')](_0x24894c[_0xf0f0('0xc')],path[_0xf0f0('0x10')](_0x24894c[_0xf0f0('0xc')])),Date['now'](),path['extname'](_0x24894c[_0xf0f0('0xc')])));}})});router['post']('/',upload[_0xf0f0('0x11')](_0xf0f0('0x12')),controller[_0xf0f0('0x13')]);router[_0xf0f0('0x14')](_0xf0f0('0x15'),auth[_0xf0f0('0x8')](),controller['update']);router['delete'](_0xf0f0('0x15'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 54a8fba..fb046e9 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 _0xc098=['FLOAT','BIGINT','sequelize','exports','STRING','name','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc098,0x183));var _0x8c09=function(_0x38fc4e,_0x435455){_0x38fc4e=_0x38fc4e-0x0;var _0x284359=_0xc098[_0x38fc4e];return _0x284359;};'use strict';var Sequelize=require(_0x8c09('0x0'));module[_0x8c09('0x1')]={'name':{'type':Sequelize[_0x8c09('0x2')],'unique':_0x8c09('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x8c09('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x8c09('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x8c09('0x4')]},'converted_format':{'type':Sequelize[_0x8c09('0x2')]},'converted_duration':{'type':Sequelize[_0x8c09('0x5')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x8c09('0x4')]},'converted_bitRate':{'type':Sequelize[_0x8c09('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xde7d=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x3698bf,_0x3870cd){var _0x7c16d4=function(_0x1e4e49){while(--_0x1e4e49){_0x3698bf['push'](_0x3698bf['shift']());}};_0x7c16d4(++_0x3870cd);}(_0xde7d,0x10c));var _0xdde7=function(_0x2af615,_0x5b4e50){_0x2af615=_0x2af615-0x0;var _0x30b568=_0xde7d[_0x2af615];return _0x30b568;};'use strict';var Sequelize=require(_0xdde7('0x0'));module[_0xdde7('0x1')]={'name':{'type':Sequelize[_0xdde7('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xdde7('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xdde7('0x2')]},'original_duration':{'type':Sequelize[_0xdde7('0x3')]},'original_sampleCount':{'type':Sequelize[_0xdde7('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xdde7('0x4')]},'original_sampleRate':{'type':Sequelize[_0xdde7('0x5')]},'converted_format':{'type':Sequelize[_0xdde7('0x2')]},'converted_duration':{'type':Sequelize[_0xdde7('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xdde7('0x4')]},'converted_channelCount':{'type':Sequelize[_0xdde7('0x5')]},'converted_bitRate':{'type':Sequelize[_0xdde7('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xdde7('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e1ff3c7..e34bb30 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 _0x6a74=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','apply','reject','save','then','get','Sounds','UserProfileResource','destroy','end','error','stack','name','send','index','map','Sound','fieldName','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','findAll','rows','rawAttributes','include','find','download','params','converted_format','existsSync','root','save_name','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','catch','create','basename','originalname','extname','file','filename','substring','wav','join','server/files/sounds/converted','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','pick','body','description','delete','server/files/sounds/original','original_format','eml-format'];(function(_0x24c970,_0x1199ef){var _0x48f700=function(_0x5d22fe){while(--_0x5d22fe){_0x24c970['push'](_0x24c970['shift']());}};_0x48f700(++_0x1199ef);}(_0x6a74,0xfd));var _0x46a7=function(_0x8b2a7f,_0x5987a7){_0x8b2a7f=_0x8b2a7f-0x0;var _0x2116e4=_0x6a74[_0x8b2a7f];return _0x2116e4;};'use strict';var emlformat=require(_0x46a7('0x0'));var rimraf=require(_0x46a7('0x1'));var zipdir=require(_0x46a7('0x2'));var jsonpatch=require(_0x46a7('0x3'));var rp=require(_0x46a7('0x4'));var moment=require(_0x46a7('0x5'));var BPromise=require(_0x46a7('0x6'));var Mustache=require(_0x46a7('0x7'));var util=require(_0x46a7('0x8'));var path=require(_0x46a7('0x9'));var sox=require('sox');var csv=require(_0x46a7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46a7('0xb'));var squel=require(_0x46a7('0xc'));var crypto=require(_0x46a7('0xd'));var jsforce=require(_0x46a7('0xe'));var deskjs=require(_0x46a7('0xf'));var toCsv=require(_0x46a7('0xa'));var querystring=require(_0x46a7('0x10'));var Papa=require('papaparse');var Redis=require(_0x46a7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x46a7('0x12'));var as=require(_0x46a7('0x13'));var hardwareService=require(_0x46a7('0x14'));var logger=require('../../config/logger')(_0x46a7('0x15'));var utils=require('../../config/utils');var config=require(_0x46a7('0x16'));var licenseUtil=require(_0x46a7('0x17'));var db=require(_0x46a7('0x18'))['db'];function respondWithStatusCode(_0x2c9363,_0x12e087){_0x12e087=_0x12e087||0xcc;return function(_0x2a14e7){if(_0x2a14e7){return _0x2c9363[_0x46a7('0x19')](_0x12e087);}return _0x2c9363[_0x46a7('0x1a')](_0x12e087)['end']();};}function respondWithResult(_0x367381,_0x5f553f){_0x5f553f=_0x5f553f||0xc8;return function(_0x44d7c7){if(_0x44d7c7){return _0x367381[_0x46a7('0x1a')](_0x5f553f)['json'](_0x44d7c7);}};}function respondWithFilteredResult(_0x19f187,_0x1a7a72){return function(_0x369768){if(_0x369768){var _0x20d9f0=typeof _0x1a7a72[_0x46a7('0x1b')]==='undefined'&&typeof _0x1a7a72[_0x46a7('0x1c')]===_0x46a7('0x1d');var _0x1e8eca=_0x369768[_0x46a7('0x1e')];var _0x290873=_0x20d9f0?0x0:_0x1a7a72[_0x46a7('0x1b')];var _0x1b6880=_0x20d9f0?_0x369768[_0x46a7('0x1e')]:_0x1a7a72[_0x46a7('0x1b')]+_0x1a7a72[_0x46a7('0x1c')];var _0x4c2982;if(_0x1b6880>=_0x1e8eca){_0x1b6880=_0x1e8eca;_0x4c2982=0xc8;}else{_0x4c2982=0xce;}_0x19f187[_0x46a7('0x1a')](_0x4c2982);return _0x19f187[_0x46a7('0x1f')]('Content-Range',_0x290873+'-'+_0x1b6880+'/'+_0x1e8eca)['json'](_0x369768);}return null;};}function patchUpdates(_0x58e6d3){return function(_0x1e24c6){try{jsonpatch[_0x46a7('0x20')](_0x1e24c6,_0x58e6d3,!![]);}catch(_0x3778e2){return BPromise[_0x46a7('0x21')](_0x3778e2);}return _0x1e24c6[_0x46a7('0x22')]();};}function saveUpdates(_0x5eef91,_0x18a7fd){return function(_0x269661){if(_0x269661){return _0x269661['update'](_0x5eef91)[_0x46a7('0x23')](function(_0x5553e4){return _0x5553e4;});}return null;};}function removeEntity(_0x205cfa,_0x484bd9){return function(_0xfeba6c){if(_0xfeba6c){return _0xfeba6c['destroy']()['then'](function(){var _0x3e94b4=_0xfeba6c[_0x46a7('0x24')]({'plain':!![]});var _0x1392f0=_0x46a7('0x25');return db[_0x46a7('0x26')][_0x46a7('0x27')]({'where':{'type':_0x1392f0,'resourceId':_0x3e94b4['id']}})[_0x46a7('0x23')](function(){return _0xfeba6c;});})[_0x46a7('0x23')](function(){_0x205cfa[_0x46a7('0x1a')](0xcc)[_0x46a7('0x28')]();});}};}function handleEntityNotFound(_0x58d7d6,_0xfc840e){return function(_0x7e3082){if(!_0x7e3082){_0x58d7d6[_0x46a7('0x19')](0x194);}return _0x7e3082;};}function handleError(_0x7d3aec,_0x54f609){_0x54f609=_0x54f609||0x1f4;return function(_0x3507cc){logger[_0x46a7('0x29')](_0x3507cc[_0x46a7('0x2a')]);if(_0x3507cc[_0x46a7('0x2b')]){delete _0x3507cc[_0x46a7('0x2b')];}_0x7d3aec[_0x46a7('0x1a')](_0x54f609)[_0x46a7('0x2c')](_0x3507cc);};}exports[_0x46a7('0x2d')]=function(_0x393ef0,_0xe7046e){var _0x5ad839={},_0x417d91={},_0x18d04f={'count':0x0,'rows':[]};var _0x5bb90e=_[_0x46a7('0x2e')](db[_0x46a7('0x2f')]['rawAttributes'],function(_0x285900){return{'name':_0x285900[_0x46a7('0x30')],'type':_0x285900['type']['key']};});_0x417d91[_0x46a7('0x31')]=_[_0x46a7('0x2e')](_0x5bb90e,'name');_0x417d91['query']=_[_0x46a7('0x32')](_0x393ef0['query']);_0x417d91[_0x46a7('0x33')]=_[_0x46a7('0x34')](_0x417d91[_0x46a7('0x31')],_0x417d91[_0x46a7('0x35')]);_0x5ad839[_0x46a7('0x36')]=_[_0x46a7('0x34')](_0x417d91[_0x46a7('0x31')],qs[_0x46a7('0x37')](_0x393ef0[_0x46a7('0x35')]['fields']));_0x5ad839[_0x46a7('0x36')]=_0x5ad839[_0x46a7('0x36')][_0x46a7('0x38')]?_0x5ad839[_0x46a7('0x36')]:_0x417d91[_0x46a7('0x31')];if(!_0x393ef0['query'][_0x46a7('0x39')](_0x46a7('0x3a'))){_0x5ad839[_0x46a7('0x1c')]=qs[_0x46a7('0x1c')](_0x393ef0[_0x46a7('0x35')][_0x46a7('0x1c')]);_0x5ad839['offset']=qs[_0x46a7('0x1b')](_0x393ef0[_0x46a7('0x35')][_0x46a7('0x1b')]);}_0x5ad839[_0x46a7('0x3b')]=qs[_0x46a7('0x3c')](_0x393ef0[_0x46a7('0x35')][_0x46a7('0x3c')]);_0x5ad839[_0x46a7('0x3d')]=qs[_0x46a7('0x33')](_['pick'](_0x393ef0[_0x46a7('0x35')],_0x417d91[_0x46a7('0x33')]),_0x5bb90e);if(_0x393ef0['query']['filter']){_0x5ad839[_0x46a7('0x3d')]=_[_0x46a7('0x3e')](_0x5ad839[_0x46a7('0x3d')],{'$or':_['map'](_0x5bb90e,function(_0x1efeef){if(_0x1efeef[_0x46a7('0x3f')]!==_0x46a7('0x40')){var _0x4caa70={};_0x4caa70[_0x1efeef['name']]={'$like':'%'+_0x393ef0[_0x46a7('0x35')][_0x46a7('0x41')]+'%'};return _0x4caa70;}})});}_0x5ad839=_[_0x46a7('0x3e')]({},_0x5ad839,_0x393ef0[_0x46a7('0x42')]);var _0x346cbd={'where':_0x5ad839['where']};return db['Sound'][_0x46a7('0x1e')](_0x346cbd)['then'](function(_0x1712fd){_0x18d04f[_0x46a7('0x1e')]=_0x1712fd;if(_0x393ef0[_0x46a7('0x35')]['includeAll']){_0x5ad839['include']=[{'all':!![]}];}return db[_0x46a7('0x2f')][_0x46a7('0x43')](_0x5ad839);})[_0x46a7('0x23')](function(_0x5c835a){_0x18d04f[_0x46a7('0x44')]=_0x5c835a;return _0x18d04f;})[_0x46a7('0x23')](respondWithFilteredResult(_0xe7046e,_0x5ad839))['catch'](handleError(_0xe7046e,null));};exports['show']=function(_0x5f2e0c,_0x5e7548){var _0x4a9909={'raw':!![],'where':{'id':_0x5f2e0c['params']['id']}},_0x4a7e00={};_0x4a7e00[_0x46a7('0x31')]=_['keys'](db[_0x46a7('0x2f')][_0x46a7('0x45')]);_0x4a7e00[_0x46a7('0x35')]=_[_0x46a7('0x32')](_0x5f2e0c['query']);_0x4a7e00[_0x46a7('0x33')]=_[_0x46a7('0x34')](_0x4a7e00[_0x46a7('0x31')],_0x4a7e00[_0x46a7('0x35')]);_0x4a9909[_0x46a7('0x36')]=_['intersection'](_0x4a7e00['model'],qs[_0x46a7('0x37')](_0x5f2e0c[_0x46a7('0x35')][_0x46a7('0x37')]));_0x4a9909[_0x46a7('0x36')]=_0x4a9909[_0x46a7('0x36')][_0x46a7('0x38')]?_0x4a9909[_0x46a7('0x36')]:_0x4a7e00[_0x46a7('0x31')];if(_0x5f2e0c[_0x46a7('0x35')]['includeAll']){_0x4a9909[_0x46a7('0x46')]=[{'all':!![]}];}_0x4a9909=_[_0x46a7('0x3e')]({},_0x4a9909,_0x5f2e0c[_0x46a7('0x42')]);return db[_0x46a7('0x2f')][_0x46a7('0x47')](_0x4a9909)[_0x46a7('0x23')](handleEntityNotFound(_0x5e7548,null))[_0x46a7('0x23')](respondWithResult(_0x5e7548,null))['catch'](handleError(_0x5e7548,null));};exports[_0x46a7('0x48')]=function(_0x460c40,_0x552260,_0x9d2a10){return db[_0x46a7('0x2f')]['find']({'where':{'id':_0x460c40[_0x46a7('0x49')]['id']},'attributes':[_0x46a7('0x2b'),'save_name',_0x46a7('0x4a')],'raw':!![]})[_0x46a7('0x23')](handleEntityNotFound(_0x552260,null))[_0x46a7('0x23')](function(_0x2e0a4f){if(_0x2e0a4f){if(!fs[_0x46a7('0x4b')](path['join'](config[_0x46a7('0x4c')],'server/files/sounds/converted',_0x2e0a4f[_0x46a7('0x4d')]+'.'+_0x2e0a4f['converted_format']))){throw new db[(_0x46a7('0x4e'))][(_0x46a7('0x4f'))](_0x46a7('0x50'));}return _0x552260[_0x46a7('0x48')](path['join'](config[_0x46a7('0x4c')],'server/files/sounds/converted',util['format'](_0x46a7('0x51'),_0x2e0a4f[_0x46a7('0x4d')],_0x2e0a4f['converted_format'])),util['format'](_0x46a7('0x51'),_0x2e0a4f[_0x46a7('0x2b')],_0x2e0a4f[_0x46a7('0x4a')]));}return null;})[_0x46a7('0x52')](handleError(_0x552260,null));};exports[_0x46a7('0x53')]=function(_0x51c825,_0x14d95d,_0x5f26ad){var _0x3a1332={'name':path[_0x46a7('0x54')](_0x51c825['file'][_0x46a7('0x55')],path[_0x46a7('0x56')](_0x51c825[_0x46a7('0x57')]['originalname'])),'save_name':path['basename'](_0x51c825[_0x46a7('0x57')]['filename'],path[_0x46a7('0x56')](_0x51c825[_0x46a7('0x57')][_0x46a7('0x58')])),'original_format':path[_0x46a7('0x56')](_0x51c825['file'][_0x46a7('0x55')])[_0x46a7('0x59')](0x1),'converted_format':_0x46a7('0x5a')};var _0x4f74d=path[_0x46a7('0x5b')](config[_0x46a7('0x4c')],'server/files/sounds/original',_0x51c825['file'][_0x46a7('0x58')]);var _0x4fcda2=path[_0x46a7('0x5b')](config['root'],_0x46a7('0x5c'),util[_0x46a7('0x5d')](_0x46a7('0x51'),path[_0x46a7('0x54')](_0x51c825[_0x46a7('0x57')][_0x46a7('0x58')],path['extname'](_0x51c825[_0x46a7('0x57')][_0x46a7('0x58')])),_0x3a1332[_0x46a7('0x4a')]));logger[_0x46a7('0x5e')](_0x46a7('0x5f'),_0x4f74d);logger[_0x46a7('0x5e')](_0x46a7('0x60'),_0x4fcda2);try{fs[_0x46a7('0x61')](_0x4f74d,parseInt(_0x46a7('0x62'),0x8));var _0xeca9d9=sox[_0x46a7('0x63')](_0x4f74d,_0x4fcda2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xeca9d9['on']('error',function(_0x34c4f6){fs[_0x46a7('0x64')](_0x4f74d);_0x14d95d[_0x46a7('0x1a')](0x1f4)[_0x46a7('0x2c')](_0x34c4f6);});_0xeca9d9['on'](_0x46a7('0x65'),function(_0x484953){_0x3a1332[_0x46a7('0x66')]=isNaN(_0x484953['duration'])?null:_0x484953[_0x46a7('0x67')]*0x3e8;_0x3a1332[_0x46a7('0x68')]=isNaN(_0x484953[_0x46a7('0x69')])?null:_0x484953['sampleCount'];_0x3a1332['original_channelCount']=isNaN(_0x484953[_0x46a7('0x6a')])?null:_0x484953[_0x46a7('0x6a')];_0x3a1332['original_bitRate']=isNaN(_0x484953['bitRate'])?null:_0x484953[_0x46a7('0x6b')];_0x3a1332[_0x46a7('0x6c')]=isNaN(_0x484953[_0x46a7('0x6d')])?null:_0x484953['sampleRate'];});_0xeca9d9['on'](_0x46a7('0x6e'),function(_0x34ef7b){_0x3a1332['converted_duration']=isNaN(_0x34ef7b['duration'])?null:_0x34ef7b[_0x46a7('0x67')]*0x3e8;_0x3a1332[_0x46a7('0x6f')]=isNaN(_0x34ef7b[_0x46a7('0x69')])?null:_0x34ef7b[_0x46a7('0x69')];_0x3a1332[_0x46a7('0x70')]=isNaN(_0x34ef7b[_0x46a7('0x6a')])?null:_0x34ef7b[_0x46a7('0x6a')];_0x3a1332['converted_bitRate']=isNaN(_0x34ef7b[_0x46a7('0x6b')])?null:_0x34ef7b['bitRate'];_0x3a1332[_0x46a7('0x71')]=isNaN(_0x34ef7b[_0x46a7('0x6d')])?null:_0x34ef7b[_0x46a7('0x6d')];});_0xeca9d9['on'](_0x46a7('0x28'),function(){fs[_0x46a7('0x61')](_0x4fcda2,parseInt(_0x46a7('0x62'),0x8));return db[_0x46a7('0x2f')][_0x46a7('0x53')](_0x3a1332)[_0x46a7('0x23')](function(_0x38eb1e){var _0x51b5b8={'role':_0x51c825['body'][_0x46a7('0x72')],'userProfileId':_0x51c825['body'][_0x46a7('0x73')]};if(!_0x51b5b8)throw new Error(_0x46a7('0x74'));if(_0x51b5b8['role']===_0x46a7('0x75')){var _0x2a5d71=_0x38eb1e[_0x46a7('0x24')]({'plain':!![]});return db[_0x46a7('0x76')]['find']({'where':{'name':_0x46a7('0x25'),'userProfileId':_0x51b5b8[_0x46a7('0x73')]},'raw':!![]})['then'](function(_0x4526ca){if(_0x4526ca&&_0x4526ca[_0x46a7('0x77')]===0x0){return db[_0x46a7('0x26')][_0x46a7('0x53')]({'name':_0x2a5d71[_0x46a7('0x2b')],'resourceId':_0x2a5d71['id'],'type':_0x4526ca[_0x46a7('0x2b')],'sectionId':_0x4526ca['id']},{})[_0x46a7('0x23')](function(){return _0x38eb1e;});}else{return _0x38eb1e;}})[_0x46a7('0x52')](function(_0x48bfd4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48bfd4);throw _0x48bfd4;});}return _0x38eb1e;})[_0x46a7('0x23')](respondWithResult(_0x14d95d,null))['catch'](handleError(_0x14d95d,null));});_0xeca9d9[_0x46a7('0x78')]();}catch(_0x4cada1){_0x14d95d['status'](0x1f4)[_0x46a7('0x2c')](_0x4cada1);}};exports['update']=function(_0x3693f2,_0x3167ca,_0x1ef068){return db[_0x46a7('0x2f')][_0x46a7('0x47')]({'where':{'id':_0x3693f2[_0x46a7('0x49')]['id']}})[_0x46a7('0x23')](handleEntityNotFound(_0x3167ca,null))['then'](saveUpdates(_[_0x46a7('0x79')](_0x3693f2[_0x46a7('0x7a')],[_0x46a7('0x2b'),_0x46a7('0x7b')]),null))[_0x46a7('0x23')](respondWithResult(_0x3167ca,null))[_0x46a7('0x52')](handleError(_0x3167ca,null));};exports[_0x46a7('0x7c')]=function(_0x32d9b0,_0x2ba16b,_0x2b5eb5){return db['Sound'][_0x46a7('0x47')]({'where':{'id':_0x32d9b0[_0x46a7('0x49')]['id']}})[_0x46a7('0x23')](function(_0x586589){if(_0x586589){return _0x586589[_0x46a7('0x27')]();}})['then'](function(_0x3fc9fc){var _0x3ab021=path[_0x46a7('0x5b')](config[_0x46a7('0x4c')],_0x46a7('0x7d'),util[_0x46a7('0x5d')](_0x46a7('0x51'),_0x3fc9fc['save_name'],_0x3fc9fc[_0x46a7('0x7e')]));var _0x339016=path[_0x46a7('0x5b')](config[_0x46a7('0x4c')],_0x46a7('0x5c'),util[_0x46a7('0x5d')](_0x46a7('0x51'),_0x3fc9fc[_0x46a7('0x4d')],_0x3fc9fc['converted_format']));fs[_0x46a7('0x64')](_0x3ab021);fs[_0x46a7('0x64')](_0x339016);return _0x3fc9fc;})[_0x46a7('0x23')](function(_0x419019){if(_0x419019){return _0x2ba16b['status'](0xcc)['end']();}})[_0x46a7('0x23')](handleEntityNotFound(_0x2ba16b,null))['catch'](handleError(_0x2ba16b,null));}; \ No newline at end of file +var _0x29db=['original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','start','params','description','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Sound','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','show','fields','length','include','find','catch','download','converted_format','existsSync','join','root','save_name','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate'];(function(_0xdba444,_0x3e319e){var _0x55967d=function(_0x52bcc3){while(--_0x52bcc3){_0xdba444['push'](_0xdba444['shift']());}};_0x55967d(++_0x3e319e);}(_0x29db,0x17c));var _0xb29d=function(_0x56d472,_0x1d3b03){_0x56d472=_0x56d472-0x0;var _0x29817e=_0x29db[_0x56d472];return _0x29817e;};'use strict';var emlformat=require(_0xb29d('0x0'));var rimraf=require(_0xb29d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb29d('0x2'));var moment=require(_0xb29d('0x3'));var BPromise=require(_0xb29d('0x4'));var Mustache=require('mustache');var util=require(_0xb29d('0x5'));var path=require('path');var sox=require(_0xb29d('0x6'));var csv=require(_0xb29d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb29d('0x8'));var squel=require(_0xb29d('0x9'));var crypto=require(_0xb29d('0xa'));var jsforce=require(_0xb29d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb29d('0x7'));var querystring=require('querystring');var Papa=require(_0xb29d('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb29d('0xd'));var as=require(_0xb29d('0xe'));var hardwareService=require(_0xb29d('0xf'));var logger=require(_0xb29d('0x10'))(_0xb29d('0x11'));var utils=require('../../config/utils');var config=require(_0xb29d('0x12'));var licenseUtil=require(_0xb29d('0x13'));var db=require(_0xb29d('0x14'))['db'];function respondWithStatusCode(_0x1cf0a1,_0x72eea0){_0x72eea0=_0x72eea0||0xcc;return function(_0x1cb03b){if(_0x1cb03b){return _0x1cf0a1['sendStatus'](_0x72eea0);}return _0x1cf0a1[_0xb29d('0x15')](_0x72eea0)[_0xb29d('0x16')]();};}function respondWithResult(_0x704da5,_0x133f46){_0x133f46=_0x133f46||0xc8;return function(_0x56c0ae){if(_0x56c0ae){return _0x704da5[_0xb29d('0x15')](_0x133f46)[_0xb29d('0x17')](_0x56c0ae);}};}function respondWithFilteredResult(_0x6cbbb7,_0xe6923b){return function(_0x346d83){if(_0x346d83){var _0x1ad1f7=typeof _0xe6923b[_0xb29d('0x18')]===_0xb29d('0x19')&&typeof _0xe6923b['limit']===_0xb29d('0x19');var _0x3d0549=_0x346d83['count'];var _0x144f3b=_0x1ad1f7?0x0:_0xe6923b[_0xb29d('0x18')];var _0x16ef21=_0x1ad1f7?_0x346d83[_0xb29d('0x1a')]:_0xe6923b[_0xb29d('0x18')]+_0xe6923b[_0xb29d('0x1b')];var _0x40f0b2;if(_0x16ef21>=_0x3d0549){_0x16ef21=_0x3d0549;_0x40f0b2=0xc8;}else{_0x40f0b2=0xce;}_0x6cbbb7[_0xb29d('0x15')](_0x40f0b2);return _0x6cbbb7[_0xb29d('0x1c')](_0xb29d('0x1d'),_0x144f3b+'-'+_0x16ef21+'/'+_0x3d0549)['json'](_0x346d83);}return null;};}function patchUpdates(_0x18ebd6){return function(_0x5d0fa1){try{jsonpatch[_0xb29d('0x1e')](_0x5d0fa1,_0x18ebd6,!![]);}catch(_0x23d125){return BPromise['reject'](_0x23d125);}return _0x5d0fa1[_0xb29d('0x1f')]();};}function saveUpdates(_0x3e0619,_0x485af8){return function(_0x2bc933){if(_0x2bc933){return _0x2bc933[_0xb29d('0x20')](_0x3e0619)['then'](function(_0x3500ef){return _0x3500ef;});}return null;};}function removeEntity(_0x11ef55,_0x50d486){return function(_0x7aead6){if(_0x7aead6){return _0x7aead6['destroy']()[_0xb29d('0x21')](function(){var _0x55c277=_0x7aead6[_0xb29d('0x22')]({'plain':!![]});var _0xa329f9='Sounds';return db[_0xb29d('0x23')][_0xb29d('0x24')]({'where':{'type':_0xa329f9,'resourceId':_0x55c277['id']}})[_0xb29d('0x21')](function(){return _0x7aead6;});})[_0xb29d('0x21')](function(){_0x11ef55[_0xb29d('0x15')](0xcc)[_0xb29d('0x16')]();});}};}function handleEntityNotFound(_0x2c0774,_0x5ec427){return function(_0x38eda7){if(!_0x38eda7){_0x2c0774[_0xb29d('0x25')](0x194);}return _0x38eda7;};}function handleError(_0x30e605,_0x4c5fa4){_0x4c5fa4=_0x4c5fa4||0x1f4;return function(_0x5795f7){logger[_0xb29d('0x26')](_0x5795f7[_0xb29d('0x27')]);if(_0x5795f7['name']){delete _0x5795f7[_0xb29d('0x28')];}_0x30e605['status'](_0x4c5fa4)['send'](_0x5795f7);};}exports[_0xb29d('0x29')]=function(_0x301899,_0x17f802){var _0x3a83fe={},_0x279e4e={},_0x4d9db1={'count':0x0,'rows':[]};var _0x74e06e=_[_0xb29d('0x2a')](db[_0xb29d('0x2b')][_0xb29d('0x2c')],function(_0x1572c2){return{'name':_0x1572c2['fieldName'],'type':_0x1572c2[_0xb29d('0x2d')][_0xb29d('0x2e')]};});_0x279e4e[_0xb29d('0x2f')]=_[_0xb29d('0x2a')](_0x74e06e,_0xb29d('0x28'));_0x279e4e[_0xb29d('0x30')]=_[_0xb29d('0x31')](_0x301899[_0xb29d('0x30')]);_0x279e4e[_0xb29d('0x32')]=_[_0xb29d('0x33')](_0x279e4e[_0xb29d('0x2f')],_0x279e4e[_0xb29d('0x30')]);_0x3a83fe[_0xb29d('0x34')]=_[_0xb29d('0x33')](_0x279e4e['model'],qs['fields'](_0x301899[_0xb29d('0x30')]['fields']));_0x3a83fe[_0xb29d('0x34')]=_0x3a83fe['attributes']['length']?_0x3a83fe[_0xb29d('0x34')]:_0x279e4e[_0xb29d('0x2f')];if(!_0x301899[_0xb29d('0x30')][_0xb29d('0x35')](_0xb29d('0x36'))){_0x3a83fe[_0xb29d('0x1b')]=qs[_0xb29d('0x1b')](_0x301899['query']['limit']);_0x3a83fe[_0xb29d('0x18')]=qs[_0xb29d('0x18')](_0x301899[_0xb29d('0x30')]['offset']);}_0x3a83fe[_0xb29d('0x37')]=qs[_0xb29d('0x38')](_0x301899[_0xb29d('0x30')]['sort']);_0x3a83fe[_0xb29d('0x39')]=qs[_0xb29d('0x32')](_[_0xb29d('0x3a')](_0x301899['query'],_0x279e4e[_0xb29d('0x32')]),_0x74e06e);if(_0x301899['query'][_0xb29d('0x3b')]){_0x3a83fe[_0xb29d('0x39')]=_[_0xb29d('0x3c')](_0x3a83fe[_0xb29d('0x39')],{'$or':_[_0xb29d('0x2a')](_0x74e06e,function(_0x21a508){if(_0x21a508['type']!==_0xb29d('0x3d')){var _0x4fa9a7={};_0x4fa9a7[_0x21a508[_0xb29d('0x28')]]={'$like':'%'+_0x301899['query'][_0xb29d('0x3b')]+'%'};return _0x4fa9a7;}})});}_0x3a83fe=_[_0xb29d('0x3c')]({},_0x3a83fe,_0x301899[_0xb29d('0x3e')]);var _0x8a5131={'where':_0x3a83fe[_0xb29d('0x39')]};return db[_0xb29d('0x2b')][_0xb29d('0x1a')](_0x8a5131)[_0xb29d('0x21')](function(_0x44834d){_0x4d9db1[_0xb29d('0x1a')]=_0x44834d;if(_0x301899[_0xb29d('0x30')]['includeAll']){_0x3a83fe['include']=[{'all':!![]}];}return db[_0xb29d('0x2b')]['findAll'](_0x3a83fe);})[_0xb29d('0x21')](function(_0x43323f){_0x4d9db1['rows']=_0x43323f;return _0x4d9db1;})[_0xb29d('0x21')](respondWithFilteredResult(_0x17f802,_0x3a83fe))['catch'](handleError(_0x17f802,null));};exports[_0xb29d('0x3f')]=function(_0x15da1c,_0x1ae4dd){var _0x257838={'raw':!![],'where':{'id':_0x15da1c['params']['id']}},_0x238037={};_0x238037[_0xb29d('0x2f')]=_[_0xb29d('0x31')](db[_0xb29d('0x2b')][_0xb29d('0x2c')]);_0x238037[_0xb29d('0x30')]=_['keys'](_0x15da1c['query']);_0x238037[_0xb29d('0x32')]=_[_0xb29d('0x33')](_0x238037[_0xb29d('0x2f')],_0x238037[_0xb29d('0x30')]);_0x257838[_0xb29d('0x34')]=_[_0xb29d('0x33')](_0x238037[_0xb29d('0x2f')],qs['fields'](_0x15da1c[_0xb29d('0x30')][_0xb29d('0x40')]));_0x257838[_0xb29d('0x34')]=_0x257838[_0xb29d('0x34')][_0xb29d('0x41')]?_0x257838[_0xb29d('0x34')]:_0x238037[_0xb29d('0x2f')];if(_0x15da1c['query']['includeAll']){_0x257838[_0xb29d('0x42')]=[{'all':!![]}];}_0x257838=_[_0xb29d('0x3c')]({},_0x257838,_0x15da1c[_0xb29d('0x3e')]);return db[_0xb29d('0x2b')][_0xb29d('0x43')](_0x257838)[_0xb29d('0x21')](handleEntityNotFound(_0x1ae4dd,null))[_0xb29d('0x21')](respondWithResult(_0x1ae4dd,null))[_0xb29d('0x44')](handleError(_0x1ae4dd,null));};exports[_0xb29d('0x45')]=function(_0x34640c,_0x5afd06,_0x14ec1b){return db['Sound'][_0xb29d('0x43')]({'where':{'id':_0x34640c['params']['id']},'attributes':[_0xb29d('0x28'),'save_name',_0xb29d('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x5afd06,null))[_0xb29d('0x21')](function(_0x5333b8){if(_0x5333b8){if(!fs[_0xb29d('0x47')](path[_0xb29d('0x48')](config[_0xb29d('0x49')],'server/files/sounds/converted',_0x5333b8[_0xb29d('0x4a')]+'.'+_0x5333b8[_0xb29d('0x46')]))){throw new db[(_0xb29d('0x4b'))][(_0xb29d('0x4c'))](_0xb29d('0x4d'));}return _0x5afd06[_0xb29d('0x45')](path[_0xb29d('0x48')](config['root'],_0xb29d('0x4e'),util[_0xb29d('0x4f')](_0xb29d('0x50'),_0x5333b8['save_name'],_0x5333b8['converted_format'])),util[_0xb29d('0x4f')]('%s.%s',_0x5333b8['name'],_0x5333b8[_0xb29d('0x46')]));}return null;})['catch'](handleError(_0x5afd06,null));};exports[_0xb29d('0x51')]=function(_0x35b852,_0x1bf67f,_0x3b9d58){var _0x4828f6={'name':path[_0xb29d('0x52')](_0x35b852['file'][_0xb29d('0x53')],path[_0xb29d('0x54')](_0x35b852[_0xb29d('0x55')][_0xb29d('0x53')])),'save_name':path[_0xb29d('0x52')](_0x35b852['file'][_0xb29d('0x56')],path['extname'](_0x35b852[_0xb29d('0x55')][_0xb29d('0x56')])),'original_format':path[_0xb29d('0x54')](_0x35b852[_0xb29d('0x55')][_0xb29d('0x53')])[_0xb29d('0x57')](0x1),'converted_format':_0xb29d('0x58')};var _0x1f900a=path['join'](config[_0xb29d('0x49')],_0xb29d('0x59'),_0x35b852[_0xb29d('0x55')][_0xb29d('0x56')]);var _0x1647ad=path['join'](config[_0xb29d('0x49')],_0xb29d('0x4e'),util[_0xb29d('0x4f')](_0xb29d('0x50'),path[_0xb29d('0x52')](_0x35b852[_0xb29d('0x55')][_0xb29d('0x56')],path[_0xb29d('0x54')](_0x35b852[_0xb29d('0x55')][_0xb29d('0x56')])),_0x4828f6[_0xb29d('0x46')]));logger[_0xb29d('0x5a')](_0xb29d('0x5b'),_0x1f900a);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1647ad);try{fs[_0xb29d('0x5c')](_0x1f900a,parseInt(_0xb29d('0x5d'),0x8));var _0x4b6637=sox[_0xb29d('0x5e')](_0x1f900a,_0x1647ad,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b6637['on'](_0xb29d('0x26'),function(_0x1bad33){fs['unlinkSync'](_0x1f900a);_0x1bf67f[_0xb29d('0x15')](0x1f4)[_0xb29d('0x5f')](_0x1bad33);});_0x4b6637['on'](_0xb29d('0x60'),function(_0x2f7897){_0x4828f6[_0xb29d('0x61')]=isNaN(_0x2f7897[_0xb29d('0x62')])?null:_0x2f7897['duration']*0x3e8;_0x4828f6[_0xb29d('0x63')]=isNaN(_0x2f7897[_0xb29d('0x64')])?null:_0x2f7897[_0xb29d('0x64')];_0x4828f6[_0xb29d('0x65')]=isNaN(_0x2f7897['channelCount'])?null:_0x2f7897[_0xb29d('0x66')];_0x4828f6['original_bitRate']=isNaN(_0x2f7897[_0xb29d('0x67')])?null:_0x2f7897[_0xb29d('0x67')];_0x4828f6[_0xb29d('0x68')]=isNaN(_0x2f7897['sampleRate'])?null:_0x2f7897[_0xb29d('0x69')];});_0x4b6637['on'](_0xb29d('0x6a'),function(_0x451c19){_0x4828f6['converted_duration']=isNaN(_0x451c19[_0xb29d('0x62')])?null:_0x451c19[_0xb29d('0x62')]*0x3e8;_0x4828f6[_0xb29d('0x6b')]=isNaN(_0x451c19[_0xb29d('0x64')])?null:_0x451c19[_0xb29d('0x64')];_0x4828f6[_0xb29d('0x6c')]=isNaN(_0x451c19[_0xb29d('0x66')])?null:_0x451c19[_0xb29d('0x66')];_0x4828f6[_0xb29d('0x6d')]=isNaN(_0x451c19[_0xb29d('0x67')])?null:_0x451c19[_0xb29d('0x67')];_0x4828f6['converted_sampleRate']=isNaN(_0x451c19[_0xb29d('0x69')])?null:_0x451c19[_0xb29d('0x69')];});_0x4b6637['on']('end',function(){fs[_0xb29d('0x5c')](_0x1647ad,parseInt(_0xb29d('0x5d'),0x8));return db[_0xb29d('0x2b')][_0xb29d('0x51')](_0x4828f6)[_0xb29d('0x21')](function(_0x34dc7f){var _0x2fcf02={'role':_0x35b852['body'][_0xb29d('0x6e')],'userProfileId':_0x35b852[_0xb29d('0x6f')][_0xb29d('0x70')]};if(!_0x2fcf02)throw new Error(_0xb29d('0x71'));if(_0x2fcf02['role']===_0xb29d('0x72')){var _0x4e1e4b=_0x34dc7f[_0xb29d('0x22')]({'plain':!![]});return db[_0xb29d('0x73')][_0xb29d('0x43')]({'where':{'name':_0xb29d('0x74'),'userProfileId':_0x2fcf02[_0xb29d('0x70')]},'raw':!![]})[_0xb29d('0x21')](function(_0x4db5e0){if(_0x4db5e0&&_0x4db5e0['autoAssociation']===0x0){return db[_0xb29d('0x23')]['create']({'name':_0x4e1e4b['name'],'resourceId':_0x4e1e4b['id'],'type':_0x4db5e0[_0xb29d('0x28')],'sectionId':_0x4db5e0['id']},{})['then'](function(){return _0x34dc7f;});}else{return _0x34dc7f;}})[_0xb29d('0x44')](function(_0x3f0077){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f0077);throw _0x3f0077;});}return _0x34dc7f;})[_0xb29d('0x21')](respondWithResult(_0x1bf67f,null))[_0xb29d('0x44')](handleError(_0x1bf67f,null));});_0x4b6637[_0xb29d('0x75')]();}catch(_0x54fbaf){_0x1bf67f[_0xb29d('0x15')](0x1f4)[_0xb29d('0x5f')](_0x54fbaf);}};exports[_0xb29d('0x20')]=function(_0x986bbb,_0xcbb52d,_0xb3cf60){return db['Sound'][_0xb29d('0x43')]({'where':{'id':_0x986bbb[_0xb29d('0x76')]['id']}})['then'](handleEntityNotFound(_0xcbb52d,null))['then'](saveUpdates(_[_0xb29d('0x3a')](_0x986bbb['body'],[_0xb29d('0x28'),_0xb29d('0x77')]),null))[_0xb29d('0x21')](respondWithResult(_0xcbb52d,null))[_0xb29d('0x44')](handleError(_0xcbb52d,null));};exports['delete']=function(_0x2d02a1,_0x215f3a,_0x4352fb){return db['Sound'][_0xb29d('0x43')]({'where':{'id':_0x2d02a1[_0xb29d('0x76')]['id']}})[_0xb29d('0x21')](function(_0x2865f5){if(_0x2865f5){return _0x2865f5[_0xb29d('0x24')]();}})['then'](function(_0x3c7e1f){var _0x5425bc=path[_0xb29d('0x48')](config[_0xb29d('0x49')],_0xb29d('0x59'),util[_0xb29d('0x4f')]('%s.%s',_0x3c7e1f['save_name'],_0x3c7e1f['original_format']));var _0x155173=path[_0xb29d('0x48')](config['root'],_0xb29d('0x4e'),util[_0xb29d('0x4f')](_0xb29d('0x50'),_0x3c7e1f[_0xb29d('0x4a')],_0x3c7e1f[_0xb29d('0x46')]));fs[_0xb29d('0x78')](_0x5425bc);fs[_0xb29d('0x78')](_0x155173);return _0x3c7e1f;})[_0xb29d('0x21')](function(_0x3c5b4f){if(_0x3c5b4f){return _0x215f3a[_0xb29d('0x15')](0xcc)[_0xb29d('0x16')]();}})[_0xb29d('0x21')](handleEntityNotFound(_0x215f3a,null))[_0xb29d('0x44')](handleError(_0x215f3a,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 40bffc3..e45f821 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 _0xbf69=['bluebird','path','rimraf','../../config/environment','./sound.attributes','tools_sounds','util'];(function(_0x355bb7,_0x46613b){var _0x92a867=function(_0x444a56){while(--_0x444a56){_0x355bb7['push'](_0x355bb7['shift']());}};_0x92a867(++_0x46613b);}(_0xbf69,0xa0));var _0x9bf6=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xbf69[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require(_0x9bf6('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9bf6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bf6('0x2'));var rimraf=require(_0x9bf6('0x3'));var config=require(_0x9bf6('0x4'));var attributes=require(_0x9bf6('0x5'));module['exports']=function(_0x34fd44,_0x388ea0){return _0x34fd44['define']('Sound',attributes,{'tableName':_0x9bf6('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9226=['exports','define','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes'];(function(_0x1f2205,_0x45ea06){var _0x21c232=function(_0x506add){while(--_0x506add){_0x1f2205['push'](_0x1f2205['shift']());}};_0x21c232(++_0x45ea06);}(_0x9226,0x1e4));var _0x6922=function(_0x21daf5,_0x2b34fb){_0x21daf5=_0x21daf5-0x0;var _0x7cdfad=_0x9226[_0x21daf5];return _0x7cdfad;};'use strict';var _=require(_0x6922('0x0'));var util=require(_0x6922('0x1'));var logger=require(_0x6922('0x2'))(_0x6922('0x3'));var moment=require(_0x6922('0x4'));var BPromise=require(_0x6922('0x5'));var rp=require(_0x6922('0x6'));var fs=require('fs');var path=require(_0x6922('0x7'));var rimraf=require('rimraf');var config=require(_0x6922('0x8'));var attributes=require(_0x6922('0x9'));module[_0x6922('0xa')]=function(_0x25a7cf,_0x5459b6){return _0x25a7cf[_0x6922('0xb')]('Sound',attributes,{'tableName':_0x6922('0xc'),'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 0dc6797..835d487 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 _0x20c1=['lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','raw','options','where','map','include','model','attributes','then'];(function(_0x97aafe,_0x1269a8){var _0x21225c=function(_0x3bc2e6){while(--_0x3bc2e6){_0x97aafe['push'](_0x97aafe['shift']());}};_0x21225c(++_0x1269a8);}(_0x20c1,0x10e));var _0x120c=function(_0x54b281,_0x48a469){_0x54b281=_0x54b281-0x0;var _0xe2b133=_0x20c1[_0x54b281];return _0xe2b133;};'use strict';var _=require(_0x120c('0x0'));var util=require('util');var moment=require(_0x120c('0x1'));var BPromise=require('bluebird');var rs=require(_0x120c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x120c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x120c('0x4'))(_0x120c('0x5'));var config=require(_0x120c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x120c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x382aa8,_0x344738,_0x24eae6){return new BPromise(function(_0x5b2099,_0xd14986){return client[_0x120c('0x8')](_0x382aa8,_0x24eae6)['then'](function(_0x290981){logger[_0x120c('0x9')](_0x120c('0xa'),_0x344738,_0x120c('0xb'));logger[_0x120c('0xc')](_0x120c('0xd'),_0x344738,_0x120c('0xb'),JSON[_0x120c('0xe')](_0x290981));if(_0x290981[_0x120c('0xf')]){if(_0x290981[_0x120c('0xf')][_0x120c('0x10')]===0x1f4){logger[_0x120c('0xf')]('Sound,\x20%s,\x20%s',_0x344738,_0x290981[_0x120c('0xf')][_0x120c('0x11')]);return _0xd14986(_0x290981['error'][_0x120c('0x11')]);}logger[_0x120c('0xf')](_0x120c('0xa'),_0x344738,_0x290981[_0x120c('0xf')][_0x120c('0x11')]);return _0x5b2099(_0x290981[_0x120c('0xf')]['message']);}else{logger[_0x120c('0x9')]('Sound,\x20%s,\x20%s',_0x344738,'request\x20sent');_0x5b2099(_0x290981[_0x120c('0x12')][_0x120c('0x11')]);}})[_0x120c('0x13')](function(_0x25735f){logger[_0x120c('0xf')]('Sound,\x20%s,\x20%s',_0x344738,_0x25735f);_0xd14986(_0x25735f);});});}exports[_0x120c('0x14')]=function(_0x16b0ba){var _0x260e20=this;return new Promise(function(_0x3167c1,_0x2c5da0){return db[_0x120c('0x15')]['find']({'raw':_0x16b0ba['options']?_0x16b0ba['options'][_0x120c('0x16')]===undefined?!![]:![]:!![],'where':_0x16b0ba[_0x120c('0x17')]?_0x16b0ba[_0x120c('0x17')][_0x120c('0x18')]||null:null,'attributes':_0x16b0ba[_0x120c('0x17')]?_0x16b0ba[_0x120c('0x17')]['attributes']||null:null,'include':_0x16b0ba[_0x120c('0x17')]?_0x16b0ba['options']['include']?_[_0x120c('0x19')](_0x16b0ba[_0x120c('0x17')][_0x120c('0x1a')],function(_0x1f1cf7){return{'model':db[_0x1f1cf7[_0x120c('0x1b')]],'as':_0x1f1cf7['as'],'attributes':_0x1f1cf7['attributes'],'include':_0x1f1cf7[_0x120c('0x1a')]?_['map'](_0x1f1cf7[_0x120c('0x1a')],function(_0x525154){return{'model':db[_0x525154['model']],'as':_0x525154['as'],'attributes':_0x525154[_0x120c('0x1c')],'include':_0x525154[_0x120c('0x1a')]?_[_0x120c('0x19')](_0x525154[_0x120c('0x1a')],function(_0x384b03){return{'model':db[_0x384b03[_0x120c('0x1b')]],'as':_0x384b03['as'],'attributes':_0x384b03[_0x120c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x120c('0x1d')](function(_0x3d6110){logger[_0x120c('0x9')]('ShowSound',_0x16b0ba);logger['debug']('ShowSound',_0x16b0ba,JSON[_0x120c('0xe')](_0x3d6110));_0x3167c1(_0x3d6110);})['catch'](function(_0xdacd02){logger['error'](_0x120c('0x14'),_0xdacd02[_0x120c('0x11')],_0x16b0ba);_0x2c5da0(_0x260e20[_0x120c('0xf')](0x1f4,_0xdacd02[_0x120c('0x11')]));});});}; \ No newline at end of file +var _0xc27c=['find','options','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xc27c,0x1e9));var _0xcc27=function(_0x193572,_0x1e36f4){_0x193572=_0x193572-0x0;var _0x31f0b0=_0xc27c[_0x193572];return _0x31f0b0;};'use strict';var _=require(_0xcc27('0x0'));var util=require(_0xcc27('0x1'));var moment=require(_0xcc27('0x2'));var BPromise=require(_0xcc27('0x3'));var rs=require(_0xcc27('0x4'));var fs=require('fs');var Redis=require(_0xcc27('0x5'));var db=require(_0xcc27('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc27('0x7'));var config=require(_0xcc27('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcc27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c6fe5,_0x5cbc17,_0x2b469c){return new BPromise(function(_0x4bc5b6,_0x7faf52){return client[_0xcc27('0xa')](_0x1c6fe5,_0x2b469c)['then'](function(_0x372d07){logger[_0xcc27('0xb')](_0xcc27('0xc'),_0x5cbc17,_0xcc27('0xd'));logger['debug'](_0xcc27('0xe'),_0x5cbc17,_0xcc27('0xd'),JSON[_0xcc27('0xf')](_0x372d07));if(_0x372d07[_0xcc27('0x10')]){if(_0x372d07[_0xcc27('0x10')][_0xcc27('0x11')]===0x1f4){logger[_0xcc27('0x10')](_0xcc27('0xc'),_0x5cbc17,_0x372d07['error']['message']);return _0x7faf52(_0x372d07[_0xcc27('0x10')][_0xcc27('0x12')]);}logger[_0xcc27('0x10')]('Sound,\x20%s,\x20%s',_0x5cbc17,_0x372d07['error'][_0xcc27('0x12')]);return _0x4bc5b6(_0x372d07[_0xcc27('0x10')][_0xcc27('0x12')]);}else{logger[_0xcc27('0xb')](_0xcc27('0xc'),_0x5cbc17,'request\x20sent');_0x4bc5b6(_0x372d07[_0xcc27('0x13')]['message']);}})[_0xcc27('0x14')](function(_0x19cc22){logger[_0xcc27('0x10')](_0xcc27('0xc'),_0x5cbc17,_0x19cc22);_0x7faf52(_0x19cc22);});});}exports[_0xcc27('0x15')]=function(_0x24d72d){var _0x296046=this;return new Promise(function(_0x499d93,_0x12336d){return db[_0xcc27('0x16')][_0xcc27('0x17')]({'raw':_0x24d72d[_0xcc27('0x18')]?_0x24d72d[_0xcc27('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24d72d[_0xcc27('0x18')]?_0x24d72d['options'][_0xcc27('0x19')]||null:null,'attributes':_0x24d72d['options']?_0x24d72d[_0xcc27('0x18')][_0xcc27('0x1a')]||null:null,'include':_0x24d72d[_0xcc27('0x18')]?_0x24d72d['options'][_0xcc27('0x1b')]?_[_0xcc27('0x1c')](_0x24d72d['options']['include'],function(_0x3fb240){return{'model':db[_0x3fb240[_0xcc27('0x1d')]],'as':_0x3fb240['as'],'attributes':_0x3fb240[_0xcc27('0x1a')],'include':_0x3fb240[_0xcc27('0x1b')]?_[_0xcc27('0x1c')](_0x3fb240[_0xcc27('0x1b')],function(_0x206e34){return{'model':db[_0x206e34['model']],'as':_0x206e34['as'],'attributes':_0x206e34[_0xcc27('0x1a')],'include':_0x206e34[_0xcc27('0x1b')]?_[_0xcc27('0x1c')](_0x206e34[_0xcc27('0x1b')],function(_0x373fde){return{'model':db[_0x373fde[_0xcc27('0x1d')]],'as':_0x373fde['as'],'attributes':_0x373fde[_0xcc27('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcc27('0x1e')](function(_0x15e28b){logger[_0xcc27('0xb')]('ShowSound',_0x24d72d);logger[_0xcc27('0x1f')](_0xcc27('0x15'),_0x24d72d,JSON[_0xcc27('0xf')](_0x15e28b));_0x499d93(_0x15e28b);})[_0xcc27('0x14')](function(_0x4c3111){logger[_0xcc27('0x10')](_0xcc27('0x15'),_0x4c3111['message'],_0x24d72d);_0x12336d(_0x296046['error'](0x1f4,_0x4c3111[_0xcc27('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 01e987a..8a2a97a 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x3edcd6,_0xa464c2){var _0xc64623=function(_0x3056c6){while(--_0x3056c6){_0x3edcd6['push'](_0x3edcd6['shift']());}};_0xc64623(++_0xa464c2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x5615c4,_0x127d58){var _0x524690=function(_0x4cbf4){while(--_0x4cbf4){_0x5615c4['push'](_0x5615c4['shift']());}};_0x524690(++_0x127d58);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4239bd,_0x1f310b){_0x4239bd=_0x4239bd-0x0;var _0x21f061=_0x5eb8[_0x4239bd];return _0x21f061;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6684679..71115c6 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 _0xce03=['TEXT','medium','ENUM','out','STRING','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xce03,0x132));var _0x3ce0=function(_0x4512c2,_0x3f52ad){_0x4512c2=_0x4512c2-0x0;var _0x6822db=_0xce03[_0x4512c2];return _0x6822db;};'use strict';var Sequelize=require(_0x3ce0('0x0'));module[_0x3ce0('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3ce0('0x2')](_0x3ce0('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x3ce0('0x4')]('in','out'),'defaultValue':_0x3ce0('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3ce0('0x6')]},'providerResponse':{'type':Sequelize[_0x3ce0('0x2')]}}; \ No newline at end of file +var _0xf701=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x3c073f,_0x201853){var _0x136bce=function(_0x103d0b){while(--_0x103d0b){_0x3c073f['push'](_0x3c073f['shift']());}};_0x136bce(++_0x201853);}(_0xf701,0xff));var _0x1f70=function(_0x2ef34c,_0x3bd258){_0x2ef34c=_0x2ef34c-0x0;var _0xd01d83=_0xf701[_0x2ef34c];return _0xd01d83;};'use strict';var Sequelize=require(_0x1f70('0x0'));module[_0x1f70('0x1')]={'uniqueid':{'type':Sequelize[_0x1f70('0x2')]},'body':{'type':Sequelize[_0x1f70('0x3')](_0x1f70('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x1f70('0x5')]('in',_0x1f70('0x6')),'defaultValue':_0x1f70('0x6'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1f70('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 6baf8ca..876cb71 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 _0xcf3d=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','reject','update','destroy','then','end','stack','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','findAll','rows','catch','params','keys','options','find','create','body'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x15b601,_0x174629){_0x15b601=_0x15b601-0x0;var _0x542991=_0xcf3d[_0x15b601];return _0x542991;};'use strict';var emlformat=require(_0xdcf3('0x0'));var rimraf=require(_0xdcf3('0x1'));var zipdir=require(_0xdcf3('0x2'));var jsonpatch=require(_0xdcf3('0x3'));var rp=require('request-promise');var moment=require(_0xdcf3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdcf3('0x5'));var util=require(_0xdcf3('0x6'));var path=require(_0xdcf3('0x7'));var sox=require(_0xdcf3('0x8'));var csv=require(_0xdcf3('0x9'));var ejs=require(_0xdcf3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcf3('0xb'));var squel=require('squel');var crypto=require(_0xdcf3('0xc'));var jsforce=require(_0xdcf3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdcf3('0xe'));var Redis=require(_0xdcf3('0xf'));var authService=require(_0xdcf3('0x10'));var qs=require(_0xdcf3('0x11'));var as=require(_0xdcf3('0x12'));var hardwareService=require(_0xdcf3('0x13'));var logger=require(_0xdcf3('0x14'))(_0xdcf3('0x15'));var utils=require(_0xdcf3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdcf3('0x17'));var db=require(_0xdcf3('0x18'))['db'];function respondWithStatusCode(_0x4b1623,_0x40ddf7){_0x40ddf7=_0x40ddf7||0xcc;return function(_0x2e1fff){if(_0x2e1fff){return _0x4b1623[_0xdcf3('0x19')](_0x40ddf7);}return _0x4b1623[_0xdcf3('0x1a')](_0x40ddf7)['end']();};}function respondWithResult(_0x2d0bc2,_0x4b003f){_0x4b003f=_0x4b003f||0xc8;return function(_0x4d5417){if(_0x4d5417){return _0x2d0bc2[_0xdcf3('0x1a')](_0x4b003f)['json'](_0x4d5417);}};}function respondWithFilteredResult(_0x1b34b4,_0x2ebc69){return function(_0x1af727){if(_0x1af727){var _0x2c5436=typeof _0x2ebc69['offset']===_0xdcf3('0x1b')&&typeof _0x2ebc69[_0xdcf3('0x1c')]==='undefined';var _0xc64c2a=_0x1af727[_0xdcf3('0x1d')];var _0x441142=_0x2c5436?0x0:_0x2ebc69[_0xdcf3('0x1e')];var _0x1c1df7=_0x2c5436?_0x1af727[_0xdcf3('0x1d')]:_0x2ebc69[_0xdcf3('0x1e')]+_0x2ebc69[_0xdcf3('0x1c')];var _0x27a958;if(_0x1c1df7>=_0xc64c2a){_0x1c1df7=_0xc64c2a;_0x27a958=0xc8;}else{_0x27a958=0xce;}_0x1b34b4[_0xdcf3('0x1a')](_0x27a958);return _0x1b34b4[_0xdcf3('0x1f')]('Content-Range',_0x441142+'-'+_0x1c1df7+'/'+_0xc64c2a)['json'](_0x1af727);}return null;};}function patchUpdates(_0x3a4512){return function(_0x427890){try{jsonpatch['apply'](_0x427890,_0x3a4512,!![]);}catch(_0x4e3e41){return BPromise[_0xdcf3('0x20')](_0x4e3e41);}return _0x427890['save']();};}function saveUpdates(_0x5622de,_0x71009c){return function(_0x273591){if(_0x273591){return _0x273591[_0xdcf3('0x21')](_0x5622de)['then'](function(_0x40b9f1){return _0x40b9f1;});}return null;};}function removeEntity(_0x4d340a,_0x2cc3ce){return function(_0x524ab0){if(_0x524ab0){return _0x524ab0[_0xdcf3('0x22')]()[_0xdcf3('0x23')](function(){_0x4d340a[_0xdcf3('0x1a')](0xcc)[_0xdcf3('0x24')]();});}};}function handleEntityNotFound(_0x5b6fc3,_0x16ea83){return function(_0x5c8557){if(!_0x5c8557){_0x5b6fc3[_0xdcf3('0x19')](0x194);}return _0x5c8557;};}function handleError(_0x3fbd96,_0x7df45){_0x7df45=_0x7df45||0x1f4;return function(_0x4c7412){logger['error'](_0x4c7412[_0xdcf3('0x25')]);if(_0x4c7412['name']){delete _0x4c7412['name'];}_0x3fbd96['status'](_0x7df45)['send'](_0x4c7412);};}exports[_0xdcf3('0x26')]=function(_0x4cd417,_0x3165a5){var _0x56964c={},_0x3b34a5={},_0x4cc17a={'count':0x0,'rows':[]};var _0x23a893=_[_0xdcf3('0x27')](db[_0xdcf3('0x28')][_0xdcf3('0x29')],function(_0x18a560){return{'name':_0x18a560[_0xdcf3('0x2a')],'type':_0x18a560[_0xdcf3('0x2b')][_0xdcf3('0x2c')]};});_0x3b34a5[_0xdcf3('0x2d')]=_[_0xdcf3('0x27')](_0x23a893,_0xdcf3('0x2e'));_0x3b34a5[_0xdcf3('0x2f')]=_['keys'](_0x4cd417[_0xdcf3('0x2f')]);_0x3b34a5[_0xdcf3('0x30')]=_[_0xdcf3('0x31')](_0x3b34a5[_0xdcf3('0x2d')],_0x3b34a5[_0xdcf3('0x2f')]);_0x56964c[_0xdcf3('0x32')]=_[_0xdcf3('0x31')](_0x3b34a5[_0xdcf3('0x2d')],qs[_0xdcf3('0x33')](_0x4cd417['query'][_0xdcf3('0x33')]));_0x56964c['attributes']=_0x56964c[_0xdcf3('0x32')][_0xdcf3('0x34')]?_0x56964c[_0xdcf3('0x32')]:_0x3b34a5[_0xdcf3('0x2d')];if(!_0x4cd417[_0xdcf3('0x2f')][_0xdcf3('0x35')]('nolimit')){_0x56964c[_0xdcf3('0x1c')]=qs[_0xdcf3('0x1c')](_0x4cd417['query'][_0xdcf3('0x1c')]);_0x56964c[_0xdcf3('0x1e')]=qs['offset'](_0x4cd417[_0xdcf3('0x2f')][_0xdcf3('0x1e')]);}_0x56964c[_0xdcf3('0x36')]=qs[_0xdcf3('0x37')](_0x4cd417['query'][_0xdcf3('0x37')]);_0x56964c[_0xdcf3('0x38')]=qs['filters'](_['pick'](_0x4cd417['query'],_0x3b34a5[_0xdcf3('0x30')]),_0x23a893);if(_0x4cd417[_0xdcf3('0x2f')][_0xdcf3('0x39')]){_0x56964c[_0xdcf3('0x38')]=_[_0xdcf3('0x3a')](_0x56964c[_0xdcf3('0x38')],{'$or':_[_0xdcf3('0x27')](_0x23a893,function(_0x321978){if(_0x321978[_0xdcf3('0x2b')]!=='VIRTUAL'){var _0x48d9bb={};_0x48d9bb[_0x321978[_0xdcf3('0x2e')]]={'$like':'%'+_0x4cd417['query'][_0xdcf3('0x39')]+'%'};return _0x48d9bb;}})});}_0x56964c=_[_0xdcf3('0x3a')]({},_0x56964c,_0x4cd417['options']);var _0x5ba362={'where':_0x56964c[_0xdcf3('0x38')]};return db['SquareMessage']['count'](_0x5ba362)[_0xdcf3('0x23')](function(_0x5b472c){_0x4cc17a[_0xdcf3('0x1d')]=_0x5b472c;if(_0x4cd417[_0xdcf3('0x2f')][_0xdcf3('0x3b')]){_0x56964c['include']=[{'all':!![]}];}return db[_0xdcf3('0x28')][_0xdcf3('0x3c')](_0x56964c);})[_0xdcf3('0x23')](function(_0x169848){_0x4cc17a[_0xdcf3('0x3d')]=_0x169848;return _0x4cc17a;})[_0xdcf3('0x23')](respondWithFilteredResult(_0x3165a5,_0x56964c))[_0xdcf3('0x3e')](handleError(_0x3165a5,null));};exports['show']=function(_0x3a32c6,_0x2e2ba0){var _0x649485={'raw':!![],'where':{'id':_0x3a32c6[_0xdcf3('0x3f')]['id']}},_0x499c8e={};_0x499c8e[_0xdcf3('0x2d')]=_['keys'](db[_0xdcf3('0x28')][_0xdcf3('0x29')]);_0x499c8e['query']=_[_0xdcf3('0x40')](_0x3a32c6[_0xdcf3('0x2f')]);_0x499c8e[_0xdcf3('0x30')]=_[_0xdcf3('0x31')](_0x499c8e['model'],_0x499c8e[_0xdcf3('0x2f')]);_0x649485['attributes']=_[_0xdcf3('0x31')](_0x499c8e[_0xdcf3('0x2d')],qs[_0xdcf3('0x33')](_0x3a32c6[_0xdcf3('0x2f')][_0xdcf3('0x33')]));_0x649485[_0xdcf3('0x32')]=_0x649485[_0xdcf3('0x32')][_0xdcf3('0x34')]?_0x649485['attributes']:_0x499c8e[_0xdcf3('0x2d')];if(_0x3a32c6[_0xdcf3('0x2f')][_0xdcf3('0x3b')]){_0x649485['include']=[{'all':!![]}];}_0x649485=_['merge']({},_0x649485,_0x3a32c6[_0xdcf3('0x41')]);return db[_0xdcf3('0x28')][_0xdcf3('0x42')](_0x649485)[_0xdcf3('0x23')](handleEntityNotFound(_0x2e2ba0,null))[_0xdcf3('0x23')](respondWithResult(_0x2e2ba0,null))['catch'](handleError(_0x2e2ba0,null));};exports[_0xdcf3('0x43')]=function(_0x51f4d4,_0x4ded3f){return db[_0xdcf3('0x28')][_0xdcf3('0x43')](_0x51f4d4[_0xdcf3('0x44')],{})[_0xdcf3('0x23')](respondWithResult(_0x4ded3f,0xc9))[_0xdcf3('0x3e')](handleError(_0x4ded3f,null));};exports[_0xdcf3('0x21')]=function(_0x48abd5,_0x1ebf31){if(_0x48abd5[_0xdcf3('0x44')]['id']){delete _0x48abd5[_0xdcf3('0x44')]['id'];}return db[_0xdcf3('0x28')]['find']({'where':{'id':_0x48abd5[_0xdcf3('0x3f')]['id']}})[_0xdcf3('0x23')](handleEntityNotFound(_0x1ebf31,null))[_0xdcf3('0x23')](saveUpdates(_0x48abd5[_0xdcf3('0x44')],null))[_0xdcf3('0x23')](respondWithResult(_0x1ebf31,null))[_0xdcf3('0x3e')](handleError(_0x1ebf31,null));};exports[_0xdcf3('0x22')]=function(_0x20cdbc,_0x7dded8){return db['SquareMessage']['find']({'where':{'id':_0x20cdbc[_0xdcf3('0x3f')]['id']}})[_0xdcf3('0x23')](handleEntityNotFound(_0x7dded8,null))[_0xdcf3('0x23')](removeEntity(_0x7dded8,null))['catch'](handleError(_0x7dded8,null));}; \ No newline at end of file +var _0x7708=['destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','key','model','keys','intersection','query','attributes','fields','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','eml-format','rimraf','fast-json-patch','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','save','update','then'];(function(_0xb2dd3f,_0x32fb7c){var _0x142cbc=function(_0x2ae596){while(--_0x2ae596){_0xb2dd3f['push'](_0xb2dd3f['shift']());}};_0x142cbc(++_0x32fb7c);}(_0x7708,0x188));var _0x8770=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x7708[_0x50cfc3];return _0x5c11ef;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];function respondWithStatusCode(_0x51efbc,_0xb52d60){_0xb52d60=_0xb52d60||0xcc;return function(_0x455a65){if(_0x455a65){return _0x51efbc[_0x8770('0x16')](_0xb52d60);}return _0x51efbc[_0x8770('0x17')](_0xb52d60)[_0x8770('0x18')]();};}function respondWithResult(_0x12a06f,_0x1ce41d){_0x1ce41d=_0x1ce41d||0xc8;return function(_0x12439f){if(_0x12439f){return _0x12a06f['status'](_0x1ce41d)[_0x8770('0x19')](_0x12439f);}};}function respondWithFilteredResult(_0x106a20,_0x5dd4e7){return function(_0x2f7918){if(_0x2f7918){var _0x52254f=typeof _0x5dd4e7[_0x8770('0x1a')]==='undefined'&&typeof _0x5dd4e7['limit']==='undefined';var _0x155e83=_0x2f7918[_0x8770('0x1b')];var _0x17b634=_0x52254f?0x0:_0x5dd4e7[_0x8770('0x1a')];var _0x4b0691=_0x52254f?_0x2f7918['count']:_0x5dd4e7[_0x8770('0x1a')]+_0x5dd4e7[_0x8770('0x1c')];var _0x26cbcd;if(_0x4b0691>=_0x155e83){_0x4b0691=_0x155e83;_0x26cbcd=0xc8;}else{_0x26cbcd=0xce;}_0x106a20[_0x8770('0x17')](_0x26cbcd);return _0x106a20[_0x8770('0x1d')]('Content-Range',_0x17b634+'-'+_0x4b0691+'/'+_0x155e83)[_0x8770('0x19')](_0x2f7918);}return null;};}function patchUpdates(_0x1234dd){return function(_0x384b1e){try{jsonpatch[_0x8770('0x1e')](_0x384b1e,_0x1234dd,!![]);}catch(_0x582048){return BPromise['reject'](_0x582048);}return _0x384b1e[_0x8770('0x1f')]();};}function saveUpdates(_0x348e2f,_0x443716){return function(_0x2918a7){if(_0x2918a7){return _0x2918a7[_0x8770('0x20')](_0x348e2f)[_0x8770('0x21')](function(_0x5819dc){return _0x5819dc;});}return null;};}function removeEntity(_0x468fc0,_0x23ad66){return function(_0x4274dd){if(_0x4274dd){return _0x4274dd[_0x8770('0x22')]()['then'](function(){_0x468fc0[_0x8770('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7b4755,_0x453804){return function(_0x473d31){if(!_0x473d31){_0x7b4755[_0x8770('0x16')](0x194);}return _0x473d31;};}function handleError(_0x1538b2,_0x2cd084){_0x2cd084=_0x2cd084||0x1f4;return function(_0x293f53){logger[_0x8770('0x23')](_0x293f53[_0x8770('0x24')]);if(_0x293f53[_0x8770('0x25')]){delete _0x293f53['name'];}_0x1538b2[_0x8770('0x17')](_0x2cd084)[_0x8770('0x26')](_0x293f53);};}exports[_0x8770('0x27')]=function(_0x5c7bd,_0x246128){var _0x200a82={},_0x5ae7b8={},_0x4b284b={'count':0x0,'rows':[]};var _0x37974d=_[_0x8770('0x28')](db[_0x8770('0x29')][_0x8770('0x2a')],function(_0x23f4b0){return{'name':_0x23f4b0['fieldName'],'type':_0x23f4b0['type'][_0x8770('0x2b')]};});_0x5ae7b8[_0x8770('0x2c')]=_[_0x8770('0x28')](_0x37974d,_0x8770('0x25'));_0x5ae7b8['query']=_[_0x8770('0x2d')](_0x5c7bd['query']);_0x5ae7b8['filters']=_[_0x8770('0x2e')](_0x5ae7b8['model'],_0x5ae7b8[_0x8770('0x2f')]);_0x200a82[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x5ae7b8[_0x8770('0x2c')],qs[_0x8770('0x31')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x31')]));_0x200a82[_0x8770('0x30')]=_0x200a82[_0x8770('0x30')]['length']?_0x200a82[_0x8770('0x30')]:_0x5ae7b8[_0x8770('0x2c')];if(!_0x5c7bd[_0x8770('0x2f')]['hasOwnProperty']('nolimit')){_0x200a82[_0x8770('0x1c')]=qs[_0x8770('0x1c')](_0x5c7bd[_0x8770('0x2f')]['limit']);_0x200a82[_0x8770('0x1a')]=qs['offset'](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x1a')]);}_0x200a82[_0x8770('0x32')]=qs[_0x8770('0x33')](_0x5c7bd[_0x8770('0x2f')][_0x8770('0x33')]);_0x200a82[_0x8770('0x34')]=qs[_0x8770('0x35')](_[_0x8770('0x36')](_0x5c7bd[_0x8770('0x2f')],_0x5ae7b8['filters']),_0x37974d);if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x37')]){_0x200a82[_0x8770('0x34')]=_['merge'](_0x200a82[_0x8770('0x34')],{'$or':_[_0x8770('0x28')](_0x37974d,function(_0x27f91c){if(_0x27f91c[_0x8770('0x38')]!==_0x8770('0x39')){var _0x3a50db={};_0x3a50db[_0x27f91c['name']]={'$like':'%'+_0x5c7bd[_0x8770('0x2f')]['filter']+'%'};return _0x3a50db;}})});}_0x200a82=_[_0x8770('0x3a')]({},_0x200a82,_0x5c7bd['options']);var _0x41134a={'where':_0x200a82[_0x8770('0x34')]};return db[_0x8770('0x29')]['count'](_0x41134a)[_0x8770('0x21')](function(_0x3f35ac){_0x4b284b[_0x8770('0x1b')]=_0x3f35ac;if(_0x5c7bd[_0x8770('0x2f')][_0x8770('0x3b')]){_0x200a82[_0x8770('0x3c')]=[{'all':!![]}];}return db['SquareMessage'][_0x8770('0x3d')](_0x200a82);})['then'](function(_0x4bcfc7){_0x4b284b[_0x8770('0x3e')]=_0x4bcfc7;return _0x4b284b;})[_0x8770('0x21')](respondWithFilteredResult(_0x246128,_0x200a82))[_0x8770('0x3f')](handleError(_0x246128,null));};exports[_0x8770('0x40')]=function(_0x3a51b5,_0x4b4477){var _0x35b182={'raw':!![],'where':{'id':_0x3a51b5['params']['id']}},_0x26ae1b={};_0x26ae1b[_0x8770('0x2c')]=_['keys'](db[_0x8770('0x29')][_0x8770('0x2a')]);_0x26ae1b[_0x8770('0x2f')]=_[_0x8770('0x2d')](_0x3a51b5[_0x8770('0x2f')]);_0x26ae1b[_0x8770('0x35')]=_[_0x8770('0x2e')](_0x26ae1b[_0x8770('0x2c')],_0x26ae1b[_0x8770('0x2f')]);_0x35b182[_0x8770('0x30')]=_[_0x8770('0x2e')](_0x26ae1b['model'],qs[_0x8770('0x31')](_0x3a51b5[_0x8770('0x2f')][_0x8770('0x31')]));_0x35b182[_0x8770('0x30')]=_0x35b182[_0x8770('0x30')][_0x8770('0x41')]?_0x35b182['attributes']:_0x26ae1b[_0x8770('0x2c')];if(_0x3a51b5[_0x8770('0x2f')][_0x8770('0x3b')]){_0x35b182[_0x8770('0x3c')]=[{'all':!![]}];}_0x35b182=_[_0x8770('0x3a')]({},_0x35b182,_0x3a51b5[_0x8770('0x42')]);return db[_0x8770('0x29')][_0x8770('0x43')](_0x35b182)['then'](handleEntityNotFound(_0x4b4477,null))[_0x8770('0x21')](respondWithResult(_0x4b4477,null))[_0x8770('0x3f')](handleError(_0x4b4477,null));};exports[_0x8770('0x44')]=function(_0xaeaf3b,_0x454496){return db['SquareMessage']['create'](_0xaeaf3b[_0x8770('0x45')],{})['then'](respondWithResult(_0x454496,0xc9))[_0x8770('0x3f')](handleError(_0x454496,null));};exports['update']=function(_0x4f9e0b,_0x3805d8){if(_0x4f9e0b[_0x8770('0x45')]['id']){delete _0x4f9e0b[_0x8770('0x45')]['id'];}return db[_0x8770('0x29')]['find']({'where':{'id':_0x4f9e0b[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x3805d8,null))['then'](saveUpdates(_0x4f9e0b['body'],null))[_0x8770('0x21')](respondWithResult(_0x3805d8,null))[_0x8770('0x3f')](handleError(_0x3805d8,null));};exports[_0x8770('0x22')]=function(_0x4f5cb8,_0x1584dc){return db['SquareMessage'][_0x8770('0x43')]({'where':{'id':_0x4f5cb8[_0x8770('0x46')]['id']}})[_0x8770('0x21')](handleEntityNotFound(_0x1584dc,null))['then'](removeEntity(_0x1584dc,null))[_0x8770('0x3f')](handleError(_0x1584dc,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 6a8f6e8..1995de7 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 _0xc1fa=['square_messages','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0x20823f,_0x394ac5){var _0x239c4b=function(_0x5af436){while(--_0x5af436){_0x20823f['push'](_0x20823f['shift']());}};_0x239c4b(++_0x394ac5);}(_0xc1fa,0xc1));var _0xac1f=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xc1fa[_0x5cb97e];return _0x1714b4;};'use strict';var _=require(_0xac1f('0x0'));var util=require('util');var logger=require(_0xac1f('0x1'))(_0xac1f('0x2'));var moment=require(_0xac1f('0x3'));var BPromise=require(_0xac1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xac1f('0x5'));var rimraf=require(_0xac1f('0x6'));var config=require(_0xac1f('0x7'));var attributes=require(_0xac1f('0x8'));module[_0xac1f('0x9')]=function(_0x351efd,_0x218012){return _0x351efd['define'](_0xac1f('0xa'),attributes,{'tableName':_0xac1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x042f=['util','../../config/logger','api','bluebird','path','../../config/environment','SquareMessage'];(function(_0x564e9f,_0x225a15){var _0x3a9f3e=function(_0x1bbe48){while(--_0x1bbe48){_0x564e9f['push'](_0x564e9f['shift']());}};_0x3a9f3e(++_0x225a15);}(_0x042f,0x8c));var _0xf042=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x042f[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0xf042('0x0'));var logger=require(_0xf042('0x1'))(_0xf042('0x2'));var moment=require('moment');var BPromise=require(_0xf042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf042('0x4'));var rimraf=require('rimraf');var config=require(_0xf042('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1f282b,_0x83173b){return _0x1f282b['define'](_0xf042('0x6'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 1f8742a..b289e76 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 _0x054e=['http','then','info','debug','error','code','SquareMessage,\x20%s,\x20%s','message','request\x20sent','result','SquareMessage','body','options','CreateSquareMessage','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x1bfa04,_0x14891d){var _0x277539=function(_0x4f842d){while(--_0x4f842d){_0x1bfa04['push'](_0x1bfa04['shift']());}};_0x277539(++_0x14891d);}(_0x054e,0x123));var _0xe054=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x054e[_0x460150];return _0x340677;};'use strict';var _=require('lodash');var util=require(_0xe054('0x0'));var moment=require('moment');var BPromise=require(_0xe054('0x1'));var rs=require(_0xe054('0x2'));var fs=require('fs');var Redis=require(_0xe054('0x3'));var db=require(_0xe054('0x4'))['db'];var utils=require(_0xe054('0x5'));var logger=require(_0xe054('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe054('0x7'));var client=jayson[_0xe054('0x8')][_0xe054('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x366564,_0x169e00,_0x266315){return new BPromise(function(_0x22672e,_0x120096){return client['request'](_0x366564,_0x266315)[_0xe054('0xa')](function(_0x302b7d){logger[_0xe054('0xb')]('SquareMessage,\x20%s,\x20%s',_0x169e00,'request\x20sent');logger[_0xe054('0xc')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x169e00,'request\x20sent',JSON['stringify'](_0x302b7d));if(_0x302b7d[_0xe054('0xd')]){if(_0x302b7d[_0xe054('0xd')][_0xe054('0xe')]===0x1f4){logger[_0xe054('0xd')](_0xe054('0xf'),_0x169e00,_0x302b7d[_0xe054('0xd')][_0xe054('0x10')]);return _0x120096(_0x302b7d[_0xe054('0xd')]['message']);}logger['error'](_0xe054('0xf'),_0x169e00,_0x302b7d[_0xe054('0xd')][_0xe054('0x10')]);return _0x22672e(_0x302b7d[_0xe054('0xd')][_0xe054('0x10')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x169e00,_0xe054('0x11'));_0x22672e(_0x302b7d[_0xe054('0x12')][_0xe054('0x10')]);}})['catch'](function(_0x149727){logger['error'](_0xe054('0xf'),_0x169e00,_0x149727);_0x120096(_0x149727);});});}exports['CreateSquareMessage']=function(_0x42d014){var _0x36ab84=this;return new Promise(function(_0x41b543,_0x554d86){return db[_0xe054('0x13')]['create'](_0x42d014[_0xe054('0x14')],{'raw':_0x42d014[_0xe054('0x15')]?_0x42d014[_0xe054('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x40f432){logger[_0xe054('0xb')](_0xe054('0x16'),_0x42d014);logger[_0xe054('0xc')](_0xe054('0x16'),_0x42d014,JSON[_0xe054('0x17')](_0x40f432));_0x41b543(_0x40f432);})[_0xe054('0x18')](function(_0x2d797d){logger[_0xe054('0xd')](_0xe054('0x16'),_0x2d797d['message'],_0x42d014);_0x554d86(_0x36ab84[_0xe054('0xd')](0x1f4,_0x2d797d[_0xe054('0x10')]));});});}; \ No newline at end of file +var _0xebcd=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash'];(function(_0x1fa97e,_0x5560e3){var _0x26522b=function(_0x21a2ed){while(--_0x21a2ed){_0x1fa97e['push'](_0x1fa97e['shift']());}};_0x26522b(++_0x5560e3);}(_0xebcd,0x1c1));var _0xdebc=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0xebcd[_0x1196bd];return _0x26014f;};'use strict';var _=require(_0xdebc('0x0'));var util=require(_0xdebc('0x1'));var moment=require(_0xdebc('0x2'));var BPromise=require('bluebird');var rs=require(_0xdebc('0x3'));var fs=require('fs');var Redis=require(_0xdebc('0x4'));var db=require(_0xdebc('0x5'))['db'];var utils=require(_0xdebc('0x6'));var logger=require(_0xdebc('0x7'))(_0xdebc('0x8'));var config=require('../../config/environment');var jayson=require(_0xdebc('0x9'));var client=jayson[_0xdebc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b53b0,_0x370b3a,_0x454b5d){return new BPromise(function(_0x473d40,_0x91f1c7){return client[_0xdebc('0xb')](_0x4b53b0,_0x454b5d)[_0xdebc('0xc')](function(_0x4f24b4){logger[_0xdebc('0xd')](_0xdebc('0xe'),_0x370b3a,_0xdebc('0xf'));logger[_0xdebc('0x10')](_0xdebc('0x11'),_0x370b3a,'request\x20sent',JSON[_0xdebc('0x12')](_0x4f24b4));if(_0x4f24b4[_0xdebc('0x13')]){if(_0x4f24b4[_0xdebc('0x13')][_0xdebc('0x14')]===0x1f4){logger[_0xdebc('0x13')](_0xdebc('0xe'),_0x370b3a,_0x4f24b4[_0xdebc('0x13')]['message']);return _0x91f1c7(_0x4f24b4[_0xdebc('0x13')][_0xdebc('0x15')]);}logger[_0xdebc('0x13')](_0xdebc('0xe'),_0x370b3a,_0x4f24b4['error']['message']);return _0x473d40(_0x4f24b4['error'][_0xdebc('0x15')]);}else{logger[_0xdebc('0xd')]('SquareMessage,\x20%s,\x20%s',_0x370b3a,_0xdebc('0xf'));_0x473d40(_0x4f24b4[_0xdebc('0x16')]['message']);}})[_0xdebc('0x17')](function(_0x258441){logger[_0xdebc('0x13')]('SquareMessage,\x20%s,\x20%s',_0x370b3a,_0x258441);_0x91f1c7(_0x258441);});});}exports[_0xdebc('0x18')]=function(_0x599d4f){var _0x6102cb=this;return new Promise(function(_0x48d8e8,_0x4eac4e){return db[_0xdebc('0x19')][_0xdebc('0x1a')](_0x599d4f[_0xdebc('0x1b')],{'raw':_0x599d4f[_0xdebc('0x1c')]?_0x599d4f['options'][_0xdebc('0x1d')]===undefined?!![]:![]:!![]})[_0xdebc('0xc')](function(_0x5073fd){logger[_0xdebc('0xd')](_0xdebc('0x18'),_0x599d4f);logger['debug']('CreateSquareMessage',_0x599d4f,JSON[_0xdebc('0x12')](_0x5073fd));_0x48d8e8(_0x5073fd);})[_0xdebc('0x17')](function(_0x9e981c){logger['error'](_0xdebc('0x18'),_0x9e981c[_0xdebc('0x15')],_0x599d4f);_0x4eac4e(_0x6102cb['error'](0x1f4,_0x9e981c[_0xdebc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 74e144e..ba95aec 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 _0x73dd=['/:id','show','test','post','create','update','destroy','exports','util','path','fs-extra','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x73dd,0x178));var _0xd73d=function(_0x236307,_0x6ab302){_0x236307=_0x236307-0x0;var _0x10b9b6=_0x73dd[_0x236307];return _0x10b9b6;};'use strict';var multer=require('multer');var util=require(_0xd73d('0x0'));var path=require(_0xd73d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd73d('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd73d('0x3'));var controller=require(_0xd73d('0x4'));router[_0xd73d('0x5')]('/',auth[_0xd73d('0x6')](),controller[_0xd73d('0x7')]);router[_0xd73d('0x5')](_0xd73d('0x8'),auth['isAuthenticated'](),controller[_0xd73d('0x9')]);router[_0xd73d('0x5')]('/:id/test',auth[_0xd73d('0x6')](),timeout('15s'),controller[_0xd73d('0xa')]);router[_0xd73d('0xb')]('/',auth[_0xd73d('0x6')](),controller[_0xd73d('0xc')]);router['put'](_0xd73d('0x8'),auth[_0xd73d('0x6')](),controller[_0xd73d('0xd')]);router['delete'](_0xd73d('0x8'),auth[_0xd73d('0x6')](),controller[_0xd73d('0xe')]);module[_0xd73d('0xf')]=router; \ No newline at end of file +var _0x29c2=['test','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s'];(function(_0xb6b285,_0x596e01){var _0x11393c=function(_0x506469){while(--_0x506469){_0xb6b285['push'](_0xb6b285['shift']());}};_0x11393c(++_0x596e01);}(_0x29c2,0xb8));var _0x229c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x29c2[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x229c('0x0'));var util=require('util');var path=require(_0x229c('0x1'));var timeout=require(_0x229c('0x2'));var express=require(_0x229c('0x3'));var router=express[_0x229c('0x4')]();var fs_extra=require(_0x229c('0x5'));var auth=require(_0x229c('0x6'));var interaction=require(_0x229c('0x7'));var config=require(_0x229c('0x8'));var controller=require('./squareOdbc.controller');router[_0x229c('0x9')]('/',auth[_0x229c('0xa')](),controller[_0x229c('0xb')]);router[_0x229c('0x9')](_0x229c('0xc'),auth[_0x229c('0xa')](),controller[_0x229c('0xd')]);router[_0x229c('0x9')](_0x229c('0xe'),auth[_0x229c('0xa')](),timeout(_0x229c('0xf')),controller[_0x229c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x229c('0xa')](),controller[_0x229c('0x11')]);router[_0x229c('0x12')](_0x229c('0xc'),auth['isAuthenticated'](),controller[_0x229c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 969aa28..e1faad3 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 _0x526f=['sequelize','exports','name','STRING'];(function(_0x3bd012,_0x532da7){var _0x3cbb1b=function(_0x326382){while(--_0x326382){_0x3bd012['push'](_0x3bd012['shift']());}};_0x3cbb1b(++_0x532da7);}(_0x526f,0xc0));var _0xf526=function(_0x1720af,_0x1986d6){_0x1720af=_0x1720af-0x0;var _0x31c7de=_0x526f[_0x1720af];return _0x31c7de;};'use strict';var Sequelize=require(_0xf526('0x0'));module[_0xf526('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf526('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf526('0x3')]},'description':{'type':Sequelize[_0xf526('0x3')]}}; \ No newline at end of file +var _0xe14a=['STRING','sequelize','exports'];(function(_0x4cb8be,_0x50265c){var _0x1a8243=function(_0x1666a1){while(--_0x1666a1){_0x4cb8be['push'](_0x4cb8be['shift']());}};_0x1a8243(++_0x50265c);}(_0xe14a,0x178));var _0xae14=function(_0x3eb6d3,_0x224cb8){_0x3eb6d3=_0x3eb6d3-0x0;var _0xa7f69=_0xe14a[_0x3eb6d3];return _0xa7f69;};'use strict';var Sequelize=require(_0xae14('0x0'));module[_0xae14('0x1')]={'name':{'type':Sequelize[_0xae14('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xae14('0x2')]},'description':{'type':Sequelize[_0xae14('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index bb333fc..ef0e64b 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 _0x1d06=['request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','send','index','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','show','params','keys','filters','find','create','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','test','dsn','odbc','openSync','eml-format','zip-dir','fast-json-patch'];(function(_0x3aeb49,_0x1920ee){var _0x2f5e81=function(_0x2dfa6b){while(--_0x2dfa6b){_0x3aeb49['push'](_0x3aeb49['shift']());}};_0x2f5e81(++_0x1920ee);}(_0x1d06,0x105));var _0x61d0=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1d06[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x61d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x61d0('0x1'));var jsonpatch=require(_0x61d0('0x2'));var rp=require(_0x61d0('0x3'));var moment=require(_0x61d0('0x4'));var BPromise=require(_0x61d0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x61d0('0x6'));var sox=require(_0x61d0('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61d0('0x8'));var _=require(_0x61d0('0x9'));var squel=require(_0x61d0('0xa'));var crypto=require(_0x61d0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x61d0('0xc'));var toCsv=require(_0x61d0('0xd'));var querystring=require(_0x61d0('0xe'));var Papa=require(_0x61d0('0xf'));var Redis=require(_0x61d0('0x10'));var authService=require(_0x61d0('0x11'));var qs=require(_0x61d0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61d0('0x13'));var logger=require('../../config/logger')(_0x61d0('0x14'));var utils=require('../../config/utils');var config=require(_0x61d0('0x15'));var licenseUtil=require(_0x61d0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x244960,_0xee654c){_0xee654c=_0xee654c||0xcc;return function(_0x52a619){if(_0x52a619){return _0x244960[_0x61d0('0x17')](_0xee654c);}return _0x244960[_0x61d0('0x18')](_0xee654c)[_0x61d0('0x19')]();};}function respondWithResult(_0x10972f,_0x17a5bf){_0x17a5bf=_0x17a5bf||0xc8;return function(_0x252dfd){if(_0x252dfd){return _0x10972f['status'](_0x17a5bf)[_0x61d0('0x1a')](_0x252dfd);}};}function respondWithFilteredResult(_0x1a5ff7,_0x1cb775){return function(_0x5b377c){if(_0x5b377c){var _0x27d086=typeof _0x1cb775['offset']===_0x61d0('0x1b')&&typeof _0x1cb775[_0x61d0('0x1c')]===_0x61d0('0x1b');var _0x5dc2e7=_0x5b377c[_0x61d0('0x1d')];var _0x553c31=_0x27d086?0x0:_0x1cb775['offset'];var _0x353222=_0x27d086?_0x5b377c['count']:_0x1cb775[_0x61d0('0x1e')]+_0x1cb775[_0x61d0('0x1c')];var _0x86554c;if(_0x353222>=_0x5dc2e7){_0x353222=_0x5dc2e7;_0x86554c=0xc8;}else{_0x86554c=0xce;}_0x1a5ff7[_0x61d0('0x18')](_0x86554c);return _0x1a5ff7['set']('Content-Range',_0x553c31+'-'+_0x353222+'/'+_0x5dc2e7)['json'](_0x5b377c);}return null;};}function patchUpdates(_0x2732ef){return function(_0x241824){try{jsonpatch[_0x61d0('0x1f')](_0x241824,_0x2732ef,!![]);}catch(_0x1260cf){return BPromise[_0x61d0('0x20')](_0x1260cf);}return _0x241824[_0x61d0('0x21')]();};}function saveUpdates(_0x128e66,_0x4c950a){return function(_0x4ea662){if(_0x4ea662){return _0x4ea662[_0x61d0('0x22')](_0x128e66)[_0x61d0('0x23')](function(_0x2e9832){return _0x2e9832;});}return null;};}function removeEntity(_0x4d85c5,_0xd04840){return function(_0x1be90c){if(_0x1be90c){return _0x1be90c[_0x61d0('0x24')]()[_0x61d0('0x23')](function(){var _0x901871=_0x1be90c[_0x61d0('0x25')]({'plain':!![]});var _0x24e260=_0x61d0('0x26');return db[_0x61d0('0x27')]['destroy']({'where':{'type':_0x24e260,'resourceId':_0x901871['id']}})[_0x61d0('0x23')](function(){return _0x1be90c;});})[_0x61d0('0x23')](function(){_0x4d85c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x359a80,_0x590175){return function(_0x4f476a){if(!_0x4f476a){_0x359a80[_0x61d0('0x17')](0x194);}return _0x4f476a;};}function handleError(_0x54c6a8,_0x38db26){_0x38db26=_0x38db26||0x1f4;return function(_0x3e444d){logger[_0x61d0('0x28')](_0x3e444d[_0x61d0('0x29')]);if(_0x3e444d['name']){delete _0x3e444d['name'];}_0x54c6a8[_0x61d0('0x18')](_0x38db26)[_0x61d0('0x2a')](_0x3e444d);};}exports[_0x61d0('0x2b')]=function(_0x3dffda,_0x1cf637){var _0x1bd75f={},_0x15fb89={},_0x4532cb={'count':0x0,'rows':[]};var _0x1c6742=_['map'](db[_0x61d0('0x2c')][_0x61d0('0x2d')],function(_0x348081){return{'name':_0x348081[_0x61d0('0x2e')],'type':_0x348081[_0x61d0('0x2f')][_0x61d0('0x30')]};});_0x15fb89[_0x61d0('0x31')]=_[_0x61d0('0x32')](_0x1c6742,'name');_0x15fb89[_0x61d0('0x33')]=_['keys'](_0x3dffda[_0x61d0('0x33')]);_0x15fb89['filters']=_[_0x61d0('0x34')](_0x15fb89[_0x61d0('0x31')],_0x15fb89[_0x61d0('0x33')]);_0x1bd75f[_0x61d0('0x35')]=_[_0x61d0('0x34')](_0x15fb89[_0x61d0('0x31')],qs[_0x61d0('0x36')](_0x3dffda[_0x61d0('0x33')][_0x61d0('0x36')]));_0x1bd75f[_0x61d0('0x35')]=_0x1bd75f[_0x61d0('0x35')][_0x61d0('0x37')]?_0x1bd75f['attributes']:_0x15fb89[_0x61d0('0x31')];if(!_0x3dffda['query'][_0x61d0('0x38')](_0x61d0('0x39'))){_0x1bd75f[_0x61d0('0x1c')]=qs[_0x61d0('0x1c')](_0x3dffda[_0x61d0('0x33')]['limit']);_0x1bd75f[_0x61d0('0x1e')]=qs[_0x61d0('0x1e')](_0x3dffda['query'][_0x61d0('0x1e')]);}_0x1bd75f[_0x61d0('0x3a')]=qs[_0x61d0('0x3b')](_0x3dffda['query'][_0x61d0('0x3b')]);_0x1bd75f[_0x61d0('0x3c')]=qs['filters'](_[_0x61d0('0x3d')](_0x3dffda[_0x61d0('0x33')],_0x15fb89['filters']),_0x1c6742);if(_0x3dffda[_0x61d0('0x33')]['filter']){_0x1bd75f[_0x61d0('0x3c')]=_[_0x61d0('0x3e')](_0x1bd75f['where'],{'$or':_['map'](_0x1c6742,function(_0x291fd5){if(_0x291fd5[_0x61d0('0x2f')]!==_0x61d0('0x3f')){var _0x2931e4={};_0x2931e4[_0x291fd5[_0x61d0('0x40')]]={'$like':'%'+_0x3dffda['query'][_0x61d0('0x41')]+'%'};return _0x2931e4;}})});}_0x1bd75f=_[_0x61d0('0x3e')]({},_0x1bd75f,_0x3dffda[_0x61d0('0x42')]);var _0x2a7237={'where':_0x1bd75f[_0x61d0('0x3c')]};return db[_0x61d0('0x2c')][_0x61d0('0x1d')](_0x2a7237)['then'](function(_0x287b45){_0x4532cb['count']=_0x287b45;if(_0x3dffda[_0x61d0('0x33')][_0x61d0('0x43')]){_0x1bd75f[_0x61d0('0x44')]=[{'all':!![]}];}return db[_0x61d0('0x2c')][_0x61d0('0x45')](_0x1bd75f);})['then'](function(_0x2995d0){_0x4532cb[_0x61d0('0x46')]=_0x2995d0;return _0x4532cb;})[_0x61d0('0x23')](respondWithFilteredResult(_0x1cf637,_0x1bd75f))['catch'](handleError(_0x1cf637,null));};exports[_0x61d0('0x47')]=function(_0x1f5b8c,_0x38c2db){var _0x22ab9c={'raw':!![],'where':{'id':_0x1f5b8c[_0x61d0('0x48')]['id']}},_0x933a0f={};_0x933a0f[_0x61d0('0x31')]=_[_0x61d0('0x49')](db[_0x61d0('0x2c')]['rawAttributes']);_0x933a0f['query']=_[_0x61d0('0x49')](_0x1f5b8c[_0x61d0('0x33')]);_0x933a0f[_0x61d0('0x4a')]=_['intersection'](_0x933a0f[_0x61d0('0x31')],_0x933a0f[_0x61d0('0x33')]);_0x22ab9c[_0x61d0('0x35')]=_[_0x61d0('0x34')](_0x933a0f[_0x61d0('0x31')],qs[_0x61d0('0x36')](_0x1f5b8c[_0x61d0('0x33')][_0x61d0('0x36')]));_0x22ab9c['attributes']=_0x22ab9c[_0x61d0('0x35')]['length']?_0x22ab9c[_0x61d0('0x35')]:_0x933a0f[_0x61d0('0x31')];if(_0x1f5b8c[_0x61d0('0x33')][_0x61d0('0x43')]){_0x22ab9c[_0x61d0('0x44')]=[{'all':!![]}];}_0x22ab9c=_['merge']({},_0x22ab9c,_0x1f5b8c[_0x61d0('0x42')]);return db[_0x61d0('0x2c')][_0x61d0('0x4b')](_0x22ab9c)['then'](handleEntityNotFound(_0x38c2db,null))[_0x61d0('0x23')](respondWithResult(_0x38c2db,null))['catch'](handleError(_0x38c2db,null));};exports['create']=function(_0x579529,_0x51f77c){return db['SquareOdbc'][_0x61d0('0x4c')](_0x579529['body'],{})['then'](function(_0x7fb276){var _0x3c63fc=_0x579529['user'][_0x61d0('0x25')]({'plain':!![]});if(!_0x3c63fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c63fc[_0x61d0('0x4d')]===_0x61d0('0x4e')){var _0x40b5a5=_0x7fb276['get']({'plain':!![]});var _0x41f904=_0x61d0('0x26');return db[_0x61d0('0x4f')][_0x61d0('0x4b')]({'where':{'name':_0x41f904,'userProfileId':_0x3c63fc[_0x61d0('0x50')]},'raw':!![]})[_0x61d0('0x23')](function(_0x211355){if(_0x211355&&_0x211355['autoAssociation']===0x0){return db[_0x61d0('0x27')][_0x61d0('0x4c')]({'name':_0x40b5a5[_0x61d0('0x40')],'resourceId':_0x40b5a5['id'],'type':_0x211355['name'],'sectionId':_0x211355['id']},{})[_0x61d0('0x23')](function(){return _0x7fb276;});}else{return _0x7fb276;}})['catch'](function(_0x1247e3){logger[_0x61d0('0x28')](_0x61d0('0x51'),_0x1247e3);throw _0x1247e3;});}return _0x7fb276;})['then'](respondWithResult(_0x51f77c,0xc9))[_0x61d0('0x52')](handleError(_0x51f77c,null));};exports[_0x61d0('0x22')]=function(_0x4a3ee4,_0x491286){if(_0x4a3ee4['body']['id']){delete _0x4a3ee4[_0x61d0('0x53')]['id'];}return db[_0x61d0('0x2c')][_0x61d0('0x4b')]({'where':{'id':_0x4a3ee4[_0x61d0('0x48')]['id']}})[_0x61d0('0x23')](handleEntityNotFound(_0x491286,null))['then'](saveUpdates(_0x4a3ee4[_0x61d0('0x53')],null))['then'](respondWithResult(_0x491286,null))[_0x61d0('0x52')](handleError(_0x491286,null));};exports[_0x61d0('0x24')]=function(_0xb78997,_0x4233f8){return db['SquareOdbc'][_0x61d0('0x4b')]({'where':{'id':_0xb78997['params']['id']}})[_0x61d0('0x23')](handleEntityNotFound(_0x4233f8,null))[_0x61d0('0x23')](removeEntity(_0x4233f8,null))[_0x61d0('0x52')](handleError(_0x4233f8,null));};exports[_0x61d0('0x54')]=function(_0x511207,_0xecce4b,_0x4b397b){var _0x20fa83;return db[_0x61d0('0x2c')][_0x61d0('0x4b')]({'where':{'id':_0x511207[_0x61d0('0x48')]['id']},'attributes':['id',_0x61d0('0x55')]})[_0x61d0('0x23')](handleEntityNotFound(_0xecce4b,null))[_0x61d0('0x23')](function(_0x9f867c){if(_0x9f867c){var _0x3c3a12=require(_0x61d0('0x56'))();_0x3c3a12[_0x61d0('0x57')](_0x9f867c[_0x61d0('0x55')]);_0x3c3a12['closeSync']();return _0x9f867c;}})[_0x61d0('0x23')](respondWithResult(_0xecce4b,null))[_0x61d0('0x52')](handleError(_0xecce4b,null));}; \ No newline at end of file +var _0x9695=['../../mysqldb','status','json','undefined','count','offset','limit','save','update','destroy','get','ODBC','UserProfileResource','then','end','sendStatus','error','name','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','params','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1244d6,_0x27221e){var _0x4ca051=function(_0x197b5b){while(--_0x197b5b){_0x1244d6['push'](_0x1244d6['shift']());}};_0x4ca051(++_0x27221e);}(_0x9695,0x141));var _0x5969=function(_0x57f561,_0x290aa5){_0x57f561=_0x57f561-0x0;var _0x4c76dd=_0x9695[_0x57f561];return _0x4c76dd;};'use strict';var emlformat=require(_0x5969('0x0'));var rimraf=require(_0x5969('0x1'));var zipdir=require(_0x5969('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5969('0x3'));var moment=require(_0x5969('0x4'));var BPromise=require(_0x5969('0x5'));var Mustache=require(_0x5969('0x6'));var util=require(_0x5969('0x7'));var path=require(_0x5969('0x8'));var sox=require(_0x5969('0x9'));var csv=require(_0x5969('0xa'));var ejs=require(_0x5969('0xb'));var fs=require('fs');var fs_extra=require(_0x5969('0xc'));var _=require(_0x5969('0xd'));var squel=require(_0x5969('0xe'));var crypto=require(_0x5969('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5969('0x10'));var toCsv=require(_0x5969('0xa'));var querystring=require(_0x5969('0x11'));var Papa=require(_0x5969('0x12'));var Redis=require('ioredis');var authService=require(_0x5969('0x13'));var qs=require(_0x5969('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5969('0x15'));var logger=require(_0x5969('0x16'))(_0x5969('0x17'));var utils=require(_0x5969('0x18'));var config=require(_0x5969('0x19'));var licenseUtil=require(_0x5969('0x1a'));var db=require(_0x5969('0x1b'))['db'];function respondWithStatusCode(_0x2f93e5,_0x1ab567){_0x1ab567=_0x1ab567||0xcc;return function(_0x2c2e89){if(_0x2c2e89){return _0x2f93e5['sendStatus'](_0x1ab567);}return _0x2f93e5[_0x5969('0x1c')](_0x1ab567)['end']();};}function respondWithResult(_0x22bc8f,_0x109e1e){_0x109e1e=_0x109e1e||0xc8;return function(_0x375276){if(_0x375276){return _0x22bc8f[_0x5969('0x1c')](_0x109e1e)[_0x5969('0x1d')](_0x375276);}};}function respondWithFilteredResult(_0x30a518,_0x4a42d4){return function(_0x2cded1){if(_0x2cded1){var _0x475982=typeof _0x4a42d4['offset']==='undefined'&&typeof _0x4a42d4['limit']===_0x5969('0x1e');var _0x687e6f=_0x2cded1[_0x5969('0x1f')];var _0x3e870c=_0x475982?0x0:_0x4a42d4[_0x5969('0x20')];var _0x1eb42c=_0x475982?_0x2cded1[_0x5969('0x1f')]:_0x4a42d4[_0x5969('0x20')]+_0x4a42d4[_0x5969('0x21')];var _0x1fdc0c;if(_0x1eb42c>=_0x687e6f){_0x1eb42c=_0x687e6f;_0x1fdc0c=0xc8;}else{_0x1fdc0c=0xce;}_0x30a518[_0x5969('0x1c')](_0x1fdc0c);return _0x30a518['set']('Content-Range',_0x3e870c+'-'+_0x1eb42c+'/'+_0x687e6f)[_0x5969('0x1d')](_0x2cded1);}return null;};}function patchUpdates(_0x464f67){return function(_0x19805f){try{jsonpatch['apply'](_0x19805f,_0x464f67,!![]);}catch(_0x289e5e){return BPromise['reject'](_0x289e5e);}return _0x19805f[_0x5969('0x22')]();};}function saveUpdates(_0xd9ac57,_0x1bf5fc){return function(_0x3875a8){if(_0x3875a8){return _0x3875a8[_0x5969('0x23')](_0xd9ac57)['then'](function(_0x45efcc){return _0x45efcc;});}return null;};}function removeEntity(_0x5cf6e1,_0x4ba5f3){return function(_0x28a38d){if(_0x28a38d){return _0x28a38d[_0x5969('0x24')]()['then'](function(){var _0x221984=_0x28a38d[_0x5969('0x25')]({'plain':!![]});var _0x326cd3=_0x5969('0x26');return db[_0x5969('0x27')]['destroy']({'where':{'type':_0x326cd3,'resourceId':_0x221984['id']}})[_0x5969('0x28')](function(){return _0x28a38d;});})[_0x5969('0x28')](function(){_0x5cf6e1[_0x5969('0x1c')](0xcc)[_0x5969('0x29')]();});}};}function handleEntityNotFound(_0x16c430,_0x40279b){return function(_0x4e830d){if(!_0x4e830d){_0x16c430[_0x5969('0x2a')](0x194);}return _0x4e830d;};}function handleError(_0x255f76,_0x4dc3d1){_0x4dc3d1=_0x4dc3d1||0x1f4;return function(_0xaecc66){logger[_0x5969('0x2b')](_0xaecc66['stack']);if(_0xaecc66[_0x5969('0x2c')]){delete _0xaecc66[_0x5969('0x2c')];}_0x255f76[_0x5969('0x1c')](_0x4dc3d1)['send'](_0xaecc66);};}exports['index']=function(_0x2a71cd,_0x751810){var _0x38706e={},_0x2e6cdd={},_0x1acc4e={'count':0x0,'rows':[]};var _0x2c6db9=_[_0x5969('0x2d')](db[_0x5969('0x2e')]['rawAttributes'],function(_0x424a70){return{'name':_0x424a70[_0x5969('0x2f')],'type':_0x424a70[_0x5969('0x30')]['key']};});_0x2e6cdd[_0x5969('0x31')]=_[_0x5969('0x2d')](_0x2c6db9,_0x5969('0x2c'));_0x2e6cdd[_0x5969('0x32')]=_[_0x5969('0x33')](_0x2a71cd[_0x5969('0x32')]);_0x2e6cdd[_0x5969('0x34')]=_[_0x5969('0x35')](_0x2e6cdd[_0x5969('0x31')],_0x2e6cdd[_0x5969('0x32')]);_0x38706e[_0x5969('0x36')]=_[_0x5969('0x35')](_0x2e6cdd['model'],qs['fields'](_0x2a71cd[_0x5969('0x32')][_0x5969('0x37')]));_0x38706e[_0x5969('0x36')]=_0x38706e[_0x5969('0x36')][_0x5969('0x38')]?_0x38706e[_0x5969('0x36')]:_0x2e6cdd[_0x5969('0x31')];if(!_0x2a71cd[_0x5969('0x32')][_0x5969('0x39')](_0x5969('0x3a'))){_0x38706e[_0x5969('0x21')]=qs[_0x5969('0x21')](_0x2a71cd[_0x5969('0x32')][_0x5969('0x21')]);_0x38706e[_0x5969('0x20')]=qs[_0x5969('0x20')](_0x2a71cd[_0x5969('0x32')][_0x5969('0x20')]);}_0x38706e['order']=qs[_0x5969('0x3b')](_0x2a71cd[_0x5969('0x32')][_0x5969('0x3b')]);_0x38706e[_0x5969('0x3c')]=qs['filters'](_[_0x5969('0x3d')](_0x2a71cd['query'],_0x2e6cdd['filters']),_0x2c6db9);if(_0x2a71cd[_0x5969('0x32')]['filter']){_0x38706e[_0x5969('0x3c')]=_[_0x5969('0x3e')](_0x38706e[_0x5969('0x3c')],{'$or':_[_0x5969('0x2d')](_0x2c6db9,function(_0x37f36c){if(_0x37f36c[_0x5969('0x30')]!==_0x5969('0x3f')){var _0x3b016a={};_0x3b016a[_0x37f36c[_0x5969('0x2c')]]={'$like':'%'+_0x2a71cd[_0x5969('0x32')]['filter']+'%'};return _0x3b016a;}})});}_0x38706e=_['merge']({},_0x38706e,_0x2a71cd[_0x5969('0x40')]);var _0xbbc504={'where':_0x38706e[_0x5969('0x3c')]};return db[_0x5969('0x2e')][_0x5969('0x1f')](_0xbbc504)['then'](function(_0x14c203){_0x1acc4e['count']=_0x14c203;if(_0x2a71cd[_0x5969('0x32')][_0x5969('0x41')]){_0x38706e[_0x5969('0x42')]=[{'all':!![]}];}return db[_0x5969('0x2e')][_0x5969('0x43')](_0x38706e);})[_0x5969('0x28')](function(_0x2e24fd){_0x1acc4e[_0x5969('0x44')]=_0x2e24fd;return _0x1acc4e;})[_0x5969('0x28')](respondWithFilteredResult(_0x751810,_0x38706e))[_0x5969('0x45')](handleError(_0x751810,null));};exports['show']=function(_0x19c1df,_0x2ad80c){var _0x4fffca={'raw':!![],'where':{'id':_0x19c1df['params']['id']}},_0x50e79b={};_0x50e79b[_0x5969('0x31')]=_[_0x5969('0x33')](db[_0x5969('0x2e')][_0x5969('0x46')]);_0x50e79b[_0x5969('0x32')]=_[_0x5969('0x33')](_0x19c1df[_0x5969('0x32')]);_0x50e79b[_0x5969('0x34')]=_[_0x5969('0x35')](_0x50e79b[_0x5969('0x31')],_0x50e79b['query']);_0x4fffca[_0x5969('0x36')]=_[_0x5969('0x35')](_0x50e79b[_0x5969('0x31')],qs[_0x5969('0x37')](_0x19c1df[_0x5969('0x32')]['fields']));_0x4fffca[_0x5969('0x36')]=_0x4fffca['attributes'][_0x5969('0x38')]?_0x4fffca[_0x5969('0x36')]:_0x50e79b[_0x5969('0x31')];if(_0x19c1df[_0x5969('0x32')][_0x5969('0x41')]){_0x4fffca[_0x5969('0x42')]=[{'all':!![]}];}_0x4fffca=_[_0x5969('0x3e')]({},_0x4fffca,_0x19c1df['options']);return db[_0x5969('0x2e')][_0x5969('0x47')](_0x4fffca)[_0x5969('0x28')](handleEntityNotFound(_0x2ad80c,null))[_0x5969('0x28')](respondWithResult(_0x2ad80c,null))[_0x5969('0x45')](handleError(_0x2ad80c,null));};exports[_0x5969('0x48')]=function(_0x3722c4,_0x170a9e){return db[_0x5969('0x2e')][_0x5969('0x48')](_0x3722c4['body'],{})[_0x5969('0x28')](function(_0x4ff192){var _0x362878=_0x3722c4[_0x5969('0x49')][_0x5969('0x25')]({'plain':!![]});if(!_0x362878)throw new Error(_0x5969('0x4a'));if(_0x362878[_0x5969('0x4b')]===_0x5969('0x49')){var _0x11171f=_0x4ff192['get']({'plain':!![]});var _0x453ad4=_0x5969('0x26');return db[_0x5969('0x4c')][_0x5969('0x47')]({'where':{'name':_0x453ad4,'userProfileId':_0x362878[_0x5969('0x4d')]},'raw':!![]})[_0x5969('0x28')](function(_0x3a8563){if(_0x3a8563&&_0x3a8563[_0x5969('0x4e')]===0x0){return db[_0x5969('0x27')][_0x5969('0x48')]({'name':_0x11171f[_0x5969('0x2c')],'resourceId':_0x11171f['id'],'type':_0x3a8563[_0x5969('0x2c')],'sectionId':_0x3a8563['id']},{})[_0x5969('0x28')](function(){return _0x4ff192;});}else{return _0x4ff192;}})['catch'](function(_0x2721af){logger[_0x5969('0x2b')](_0x5969('0x4f'),_0x2721af);throw _0x2721af;});}return _0x4ff192;})[_0x5969('0x28')](respondWithResult(_0x170a9e,0xc9))['catch'](handleError(_0x170a9e,null));};exports[_0x5969('0x23')]=function(_0x25ca2f,_0x1a4948){if(_0x25ca2f[_0x5969('0x50')]['id']){delete _0x25ca2f[_0x5969('0x50')]['id'];}return db[_0x5969('0x2e')][_0x5969('0x47')]({'where':{'id':_0x25ca2f['params']['id']}})[_0x5969('0x28')](handleEntityNotFound(_0x1a4948,null))[_0x5969('0x28')](saveUpdates(_0x25ca2f[_0x5969('0x50')],null))[_0x5969('0x28')](respondWithResult(_0x1a4948,null))[_0x5969('0x45')](handleError(_0x1a4948,null));};exports['destroy']=function(_0xa0d473,_0x3f3445){return db[_0x5969('0x2e')][_0x5969('0x47')]({'where':{'id':_0xa0d473['params']['id']}})['then'](handleEntityNotFound(_0x3f3445,null))[_0x5969('0x28')](removeEntity(_0x3f3445,null))[_0x5969('0x45')](handleError(_0x3f3445,null));};exports[_0x5969('0x51')]=function(_0x22c750,_0x4e2bf3,_0x3f6b1a){var _0x25ef3d;return db['SquareOdbc'][_0x5969('0x47')]({'where':{'id':_0x22c750[_0x5969('0x52')]['id']},'attributes':['id',_0x5969('0x53')]})[_0x5969('0x28')](handleEntityNotFound(_0x4e2bf3,null))['then'](function(_0xc78e8c){if(_0xc78e8c){var _0x316573=require(_0x5969('0x54'))();_0x316573[_0x5969('0x55')](_0xc78e8c[_0x5969('0x53')]);_0x316573[_0x5969('0x56')]();return _0xc78e8c;}})[_0x5969('0x28')](respondWithResult(_0x4e2bf3,null))[_0x5969('0x45')](handleError(_0x4e2bf3,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 5d8cef5..889e15d 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 _0xc076=['exports','define','SquareOdbc','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareOdbc.attributes'];(function(_0x203959,_0x237b3f){var _0x3e5b55=function(_0x1581db){while(--_0x1581db){_0x203959['push'](_0x203959['shift']());}};_0x3e5b55(++_0x237b3f);}(_0xc076,0xf5));var _0x6c07=function(_0x51b8dd,_0x15f50b){_0x51b8dd=_0x51b8dd-0x0;var _0x1906c9=_0xc076[_0x51b8dd];return _0x1906c9;};'use strict';var _=require('lodash');var util=require(_0x6c07('0x0'));var logger=require(_0x6c07('0x1'))(_0x6c07('0x2'));var moment=require(_0x6c07('0x3'));var BPromise=require(_0x6c07('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c07('0x5'));var rimraf=require('rimraf');var config=require(_0x6c07('0x6'));var attributes=require(_0x6c07('0x7'));module[_0x6c07('0x8')]=function(_0x4cb3db,_0x33739f){return _0x4cb3db[_0x6c07('0x9')](_0x6c07('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84cd=['exports','define','SquareOdbc','square_odbc','lodash','util','moment','bluebird','path','rimraf','./squareOdbc.attributes'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x84cd,0x17a));var _0xd84c=function(_0x2e8a51,_0xee4c85){_0x2e8a51=_0x2e8a51-0x0;var _0x264469=_0x84cd[_0x2e8a51];return _0x264469;};'use strict';var _=require(_0xd84c('0x0'));var util=require(_0xd84c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd84c('0x2'));var BPromise=require(_0xd84c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd84c('0x4'));var rimraf=require(_0xd84c('0x5'));var config=require('../../config/environment');var attributes=require(_0xd84c('0x6'));module[_0xd84c('0x7')]=function(_0x4d1b19,_0x40ae60){return _0x4d1b19[_0xd84c('0x8')](_0xd84c('0x9'),attributes,{'tableName':_0xd84c('0xa'),'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 786fe9d..de89c78 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 _0x7f88=['map','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','SquareOdbc','find','options','where','include','model','attributes'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x7f88,0xf1));var _0x87f8=function(_0xa2b93c,_0x6c94df){_0xa2b93c=_0xa2b93c-0x0;var _0x1cfeed=_0x7f88[_0xa2b93c];return _0x1cfeed;};'use strict';var _=require('lodash');var util=require(_0x87f8('0x0'));var moment=require(_0x87f8('0x1'));var BPromise=require(_0x87f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x87f8('0x4'));var logger=require(_0x87f8('0x5'))(_0x87f8('0x6'));var config=require(_0x87f8('0x7'));var jayson=require(_0x87f8('0x8'));var client=jayson['client'][_0x87f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40dda8,_0x2ea153,_0x5ad0a2){return new BPromise(function(_0x38f1d8,_0x3ad4e9){return client[_0x87f8('0xa')](_0x40dda8,_0x5ad0a2)[_0x87f8('0xb')](function(_0x1ac7b4){logger[_0x87f8('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x2ea153,'request\x20sent');logger[_0x87f8('0xd')](_0x87f8('0xe'),_0x2ea153,_0x87f8('0xf'),JSON[_0x87f8('0x10')](_0x1ac7b4));if(_0x1ac7b4[_0x87f8('0x11')]){if(_0x1ac7b4[_0x87f8('0x11')]['code']===0x1f4){logger[_0x87f8('0x11')](_0x87f8('0x12'),_0x2ea153,_0x1ac7b4['error']['message']);return _0x3ad4e9(_0x1ac7b4['error'][_0x87f8('0x13')]);}logger['error'](_0x87f8('0x12'),_0x2ea153,_0x1ac7b4[_0x87f8('0x11')][_0x87f8('0x13')]);return _0x38f1d8(_0x1ac7b4[_0x87f8('0x11')][_0x87f8('0x13')]);}else{logger['info'](_0x87f8('0x12'),_0x2ea153,_0x87f8('0xf'));_0x38f1d8(_0x1ac7b4['result']['message']);}})[_0x87f8('0x14')](function(_0x3afdd6){logger[_0x87f8('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x2ea153,_0x3afdd6);_0x3ad4e9(_0x3afdd6);});});}exports[_0x87f8('0x15')]=function(_0x3cf518){var _0x358bd4=this;return new Promise(function(_0x3c8041,_0x1a990b){return db[_0x87f8('0x16')][_0x87f8('0x17')]({'raw':_0x3cf518[_0x87f8('0x18')]?_0x3cf518[_0x87f8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3cf518[_0x87f8('0x18')]?_0x3cf518[_0x87f8('0x18')][_0x87f8('0x19')]||null:null,'attributes':_0x3cf518[_0x87f8('0x18')]?_0x3cf518[_0x87f8('0x18')]['attributes']||null:null,'include':_0x3cf518['options']?_0x3cf518['options']['include']?_['map'](_0x3cf518[_0x87f8('0x18')][_0x87f8('0x1a')],function(_0x237dea){return{'model':db[_0x237dea[_0x87f8('0x1b')]],'as':_0x237dea['as'],'attributes':_0x237dea[_0x87f8('0x1c')],'include':_0x237dea['include']?_['map'](_0x237dea['include'],function(_0x57746f){return{'model':db[_0x57746f[_0x87f8('0x1b')]],'as':_0x57746f['as'],'attributes':_0x57746f[_0x87f8('0x1c')],'include':_0x57746f['include']?_[_0x87f8('0x1d')](_0x57746f[_0x87f8('0x1a')],function(_0xdbf70f){return{'model':db[_0xdbf70f['model']],'as':_0xdbf70f['as'],'attributes':_0xdbf70f['attributes']};}):[]};}):[]};}):[]:[]})[_0x87f8('0xb')](function(_0x23ad04){logger[_0x87f8('0xc')](_0x87f8('0x15'),_0x3cf518);logger[_0x87f8('0xd')](_0x87f8('0x15'),_0x3cf518,JSON['stringify'](_0x23ad04));_0x3c8041(_0x23ad04);})[_0x87f8('0x14')](function(_0x2823a7){logger[_0x87f8('0x11')](_0x87f8('0x15'),_0x2823a7[_0x87f8('0x13')],_0x3cf518);_0x1a990b(_0x358bd4[_0x87f8('0x11')](0x1f4,_0x2823a7[_0x87f8('0x13')]));});});}; \ No newline at end of file +var _0x0144=['../../config/logger','rpc','../../config/environment','client','http','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','catch','SquareOdbc','find','options','raw','attributes','include','map','model','then','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x0144,0x1e9));var _0x4014=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x0144[_0xffa198];return _0x1e4b50;};'use strict';var _=require(_0x4014('0x0'));var util=require(_0x4014('0x1'));var moment=require(_0x4014('0x2'));var BPromise=require(_0x4014('0x3'));var rs=require(_0x4014('0x4'));var fs=require('fs');var Redis=require(_0x4014('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4014('0x6'));var logger=require(_0x4014('0x7'))(_0x4014('0x8'));var config=require(_0x4014('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4014('0xa')][_0x4014('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf4017,_0x3e1e69,_0x3f8daa){return new BPromise(function(_0x15013f,_0x3eba52){return client['request'](_0xcf4017,_0x3f8daa)['then'](function(_0x1540cb){logger[_0x4014('0xc')](_0x4014('0xd'),_0x3e1e69,_0x4014('0xe'));logger[_0x4014('0xf')](_0x4014('0x10'),_0x3e1e69,_0x4014('0xe'),JSON['stringify'](_0x1540cb));if(_0x1540cb[_0x4014('0x11')]){if(_0x1540cb['error']['code']===0x1f4){logger['error'](_0x4014('0xd'),_0x3e1e69,_0x1540cb['error'][_0x4014('0x12')]);return _0x3eba52(_0x1540cb[_0x4014('0x11')][_0x4014('0x12')]);}logger[_0x4014('0x11')](_0x4014('0xd'),_0x3e1e69,_0x1540cb['error']['message']);return _0x15013f(_0x1540cb[_0x4014('0x11')][_0x4014('0x12')]);}else{logger[_0x4014('0xc')](_0x4014('0xd'),_0x3e1e69,_0x4014('0xe'));_0x15013f(_0x1540cb[_0x4014('0x13')][_0x4014('0x12')]);}})[_0x4014('0x14')](function(_0x34336d){logger[_0x4014('0x11')](_0x4014('0xd'),_0x3e1e69,_0x34336d);_0x3eba52(_0x34336d);});});}exports['ShowSquareOdbc']=function(_0x4afedc){var _0x12012c=this;return new Promise(function(_0x316102,_0x47d458){return db[_0x4014('0x15')][_0x4014('0x16')]({'raw':_0x4afedc[_0x4014('0x17')]?_0x4afedc[_0x4014('0x17')][_0x4014('0x18')]===undefined?!![]:![]:!![],'where':_0x4afedc[_0x4014('0x17')]?_0x4afedc[_0x4014('0x17')]['where']||null:null,'attributes':_0x4afedc[_0x4014('0x17')]?_0x4afedc['options'][_0x4014('0x19')]||null:null,'include':_0x4afedc[_0x4014('0x17')]?_0x4afedc[_0x4014('0x17')][_0x4014('0x1a')]?_[_0x4014('0x1b')](_0x4afedc[_0x4014('0x17')][_0x4014('0x1a')],function(_0x2245f7){return{'model':db[_0x2245f7['model']],'as':_0x2245f7['as'],'attributes':_0x2245f7[_0x4014('0x19')],'include':_0x2245f7[_0x4014('0x1a')]?_[_0x4014('0x1b')](_0x2245f7[_0x4014('0x1a')],function(_0xbd8b6e){return{'model':db[_0xbd8b6e[_0x4014('0x1c')]],'as':_0xbd8b6e['as'],'attributes':_0xbd8b6e[_0x4014('0x19')],'include':_0xbd8b6e[_0x4014('0x1a')]?_['map'](_0xbd8b6e[_0x4014('0x1a')],function(_0x2fbbe5){return{'model':db[_0x2fbbe5[_0x4014('0x1c')]],'as':_0x2fbbe5['as'],'attributes':_0x2fbbe5[_0x4014('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4014('0x1d')](function(_0x5552bb){logger[_0x4014('0xc')](_0x4014('0x1e'),_0x4afedc);logger[_0x4014('0xf')](_0x4014('0x1e'),_0x4afedc,JSON['stringify'](_0x5552bb));_0x316102(_0x5552bb);})[_0x4014('0x14')](function(_0x1d8b81){logger[_0x4014('0x11')](_0x4014('0x1e'),_0x1d8b81[_0x4014('0x12')],_0x4afedc);_0x47d458(_0x12012c[_0x4014('0x11')](0x1f4,_0x1d8b81[_0x4014('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 82ef6f3..e125ea7 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 _0x9853=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x3a340f,_0x18653e){var _0x14ca55=function(_0x2e2fd6){while(--_0x2e2fd6){_0x3a340f['push'](_0x3a340f['shift']());}};_0x14ca55(++_0x18653e);}(_0x9853,0x120));var _0x3985=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0x9853[_0x50fda9];return _0x36b92b;};'use strict';var multer=require(_0x3985('0x0'));var util=require(_0x3985('0x1'));var path=require(_0x3985('0x2'));var timeout=require(_0x3985('0x3'));var express=require(_0x3985('0x4'));var router=express[_0x3985('0x5')]();var fs_extra=require(_0x3985('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3985('0x7'));var config=require(_0x3985('0x8'));var controller=require('./squareProject.controller');router[_0x3985('0x9')]('/',auth[_0x3985('0xa')](),controller['index']);router['get']('/:id',auth[_0x3985('0xa')](),controller[_0x3985('0xb')]);router['post']('/',auth[_0x3985('0xa')](),controller['create']);router[_0x3985('0xc')](_0x3985('0xd'),auth['isAuthenticated'](),controller[_0x3985('0xe')]);router[_0x3985('0xf')](_0x3985('0xd'),auth[_0x3985('0xa')](),controller[_0x3985('0x10')]);module[_0x3985('0x11')]=router; \ No newline at end of file +var _0x1e7b=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x1e7b,0x166));var _0xb1e7=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0x1e7b[_0x47d6dc];return _0x1a1c93;};'use strict';var multer=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var path=require(_0xb1e7('0x2'));var timeout=require(_0xb1e7('0x3'));var express=require(_0xb1e7('0x4'));var router=express['Router']();var fs_extra=require(_0xb1e7('0x5'));var auth=require(_0xb1e7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb1e7('0x7'));var controller=require(_0xb1e7('0x8'));router[_0xb1e7('0x9')]('/',auth[_0xb1e7('0xa')](),controller[_0xb1e7('0xb')]);router[_0xb1e7('0x9')]('/:id',auth[_0xb1e7('0xa')](),controller[_0xb1e7('0xc')]);router[_0xb1e7('0xd')]('/',auth['isAuthenticated'](),controller[_0xb1e7('0xe')]);router[_0xb1e7('0xf')](_0xb1e7('0x10'),auth['isAuthenticated'](),controller[_0xb1e7('0x11')]);router['delete'](_0xb1e7('0x10'),auth[_0xb1e7('0xa')](),controller[_0xb1e7('0x12')]);module[_0xb1e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3638c76..1d600f8 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 _0x5ce3=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','BLOB'];(function(_0x20802b,_0x523829){var _0x45679a=function(_0x1b1f8e){while(--_0x1b1f8e){_0x20802b['push'](_0x20802b['shift']());}};_0x45679a(++_0x523829);}(_0x5ce3,0x80));var _0x35ce=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x5ce3[_0x25701b];return _0x3a8a2c;};'use strict';var Sequelize=require(_0x35ce('0x0'));module[_0x35ce('0x1')]={'name':{'type':Sequelize[_0x35ce('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x35ce('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x35ce('0x3')](_0x35ce('0x4')),'get':function(){if(this[_0x35ce('0x5')](_0x35ce('0x6'))){return this[_0x35ce('0x5')](_0x35ce('0x6'))[_0x35ce('0x7')](_0x35ce('0x8'));}}},'production':{'type':Sequelize[_0x35ce('0x3')](_0x35ce('0x4')),'get':function(){if(this['getDataValue'](_0x35ce('0x9'))){return this['getDataValue'](_0x35ce('0x9'))[_0x35ce('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x35ce('0xa')]},'publishedAt':{'type':Sequelize[_0x35ce('0xa')]}}; \ No newline at end of file +var _0x5007=['utf8','DATE','sequelize','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','production'];(function(_0x20c0fe,_0x484781){var _0x6a6228=function(_0x39f7ef){while(--_0x39f7ef){_0x20c0fe['push'](_0x20c0fe['shift']());}};_0x6a6228(++_0x484781);}(_0x5007,0xfe));var _0x7500=function(_0xdffe97,_0x177c47){_0xdffe97=_0xdffe97-0x0;var _0x4f60f3=_0x5007[_0xdffe97];return _0x4f60f3;};'use strict';var Sequelize=require(_0x7500('0x0'));module['exports']={'name':{'type':Sequelize[_0x7500('0x1')],'unique':_0x7500('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7500('0x1')]},'notes':{'type':Sequelize[_0x7500('0x3')]},'preproduction':{'type':Sequelize[_0x7500('0x4')](_0x7500('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x7500('0x6')](_0x7500('0x7'))[_0x7500('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x7500('0x5')),'get':function(){if(this[_0x7500('0x6')](_0x7500('0x9'))){return this[_0x7500('0x6')](_0x7500('0x9'))['toString'](_0x7500('0xa'));}}},'savedAt':{'type':Sequelize[_0x7500('0xb')]},'publishedAt':{'type':Sequelize[_0x7500('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index ebf0f45..7ac27dc 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 _0x3072=['where','pick','filters','filter','VIRTUAL','merge','SquareProject','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','agi','stringify','end','error','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x3072,0x9f));var _0x2307=function(_0x41bb9e,_0x360d92){_0x41bb9e=_0x41bb9e-0x0;var _0x4840a2=_0x3072[_0x41bb9e];return _0x4840a2;};'use strict';var _=require('lodash');var Redis=require(_0x2307('0x0'));var qs=require(_0x2307('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x2307('0x2'));var db=require(_0x2307('0x3'))['db'];config[_0x2307('0x4')]=_['defaults'](config[_0x2307('0x4')],{'host':_0x2307('0x5'),'port':0x18eb});var socket=require(_0x2307('0x6'))(new Redis(config['redis']));require(_0x2307('0x7'))[_0x2307('0x8')](socket);function respondWithResult(_0x50488d,_0x1ae9c8){_0x1ae9c8=_0x1ae9c8||0xc8;return function(_0x3213d7){if(_0x3213d7){return _0x50488d[_0x2307('0x9')](_0x1ae9c8)[_0x2307('0xa')](_0x3213d7);}};}function respondWithFilteredResult(_0x2a7c39,_0xa2aaee){return function(_0x454d20){if(_0x454d20){var _0x39585d=typeof _0xa2aaee[_0x2307('0xb')]===_0x2307('0xc')&&typeof _0xa2aaee[_0x2307('0xd')]==='undefined';var _0x115ee1=_0x454d20[_0x2307('0xe')];var _0x31c97f=_0x39585d?0x0:_0xa2aaee[_0x2307('0xb')];var _0x29f0da=_0x39585d?_0x454d20['count']:_0xa2aaee[_0x2307('0xb')]+_0xa2aaee['limit'];var _0xd39138;if(_0x29f0da>=_0x115ee1){_0x29f0da=_0x115ee1;_0xd39138=0xc8;}else{_0xd39138=0xce;}_0x2a7c39[_0x2307('0x9')](_0xd39138);return _0x2a7c39[_0x2307('0xf')](_0x2307('0x10'),_0x31c97f+'-'+_0x29f0da+'/'+_0x115ee1)['json'](_0x454d20);}return null;};}function saveUpdates(_0x864fab){return function(_0x3244e5){if(_0x3244e5){return _0x3244e5[_0x2307('0x11')](_0x864fab)['then'](function(_0x1c98ca){return _0x1c98ca;});}return null;};}function removeEntity(_0x449705){return function(_0x3dcca0){if(_0x3dcca0){return _0x3dcca0[_0x2307('0x12')]()[_0x2307('0x13')](function(){var _0x3c0cdd=_0x3dcca0[_0x2307('0x14')]({'plain':!![]});var _0x3709c9=_0x2307('0x15');return db[_0x2307('0x16')][_0x2307('0x12')]({'where':{'type':_0x3709c9,'resourceId':_0x3c0cdd['id']}})[_0x2307('0x13')](function(){return _0x3dcca0;});})[_0x2307('0x13')](function(){var _0x20863c=new Redis(config[_0x2307('0x4')]);_0x20863c['publish'](_0x2307('0x17'),JSON[_0x2307('0x18')]({'id':_0x3dcca0['id'],'deleted':!![]}));})[_0x2307('0x13')](function(){_0x449705['status'](0xcc)[_0x2307('0x19')]();});}};}function handleEntityNotFound(_0x399b75){return function(_0x364d3b){if(!_0x364d3b){_0x399b75['sendStatus'](0x194);}return _0x364d3b;};}function handleError(_0x39fc19,_0xbe64c2){_0xbe64c2=_0xbe64c2||0x1f4;return function(_0x39343c){logger[_0x2307('0x1a')](_0x39343c[_0x2307('0x1b')]);if(_0x39343c[_0x2307('0x1c')]){delete _0x39343c[_0x2307('0x1c')];}_0x39fc19[_0x2307('0x9')](_0xbe64c2)['send'](_0x39343c);};}exports[_0x2307('0x1d')]=function(_0x3fcaa2,_0x541208){var _0x21ce7a={},_0xe1f3a5={},_0x41baad={'count':0x0,'rows':[]};var _0x19b8b5=_['map'](db['SquareProject']['rawAttributes'],function(_0x218644){return{'name':_0x218644[_0x2307('0x1e')],'type':_0x218644[_0x2307('0x1f')][_0x2307('0x20')]};});_0xe1f3a5[_0x2307('0x21')]=_[_0x2307('0x22')](_0x19b8b5,_0x2307('0x1c'));_0xe1f3a5[_0x2307('0x23')]=_[_0x2307('0x24')](_0x3fcaa2[_0x2307('0x23')]);_0xe1f3a5['filters']=_[_0x2307('0x25')](_0xe1f3a5[_0x2307('0x21')],_0xe1f3a5[_0x2307('0x23')]);_0x21ce7a[_0x2307('0x26')]=_[_0x2307('0x25')](_0xe1f3a5['model'],qs[_0x2307('0x27')](_0x3fcaa2[_0x2307('0x23')][_0x2307('0x27')]));_0x21ce7a[_0x2307('0x26')]=_0x21ce7a[_0x2307('0x26')][_0x2307('0x28')]?_0x21ce7a[_0x2307('0x26')]:_0xe1f3a5[_0x2307('0x21')];if(!_0x3fcaa2[_0x2307('0x23')][_0x2307('0x29')](_0x2307('0x2a'))){_0x21ce7a[_0x2307('0xd')]=qs['limit'](_0x3fcaa2[_0x2307('0x23')]['limit']);_0x21ce7a[_0x2307('0xb')]=qs['offset'](_0x3fcaa2[_0x2307('0x23')][_0x2307('0xb')]);}_0x21ce7a[_0x2307('0x2b')]=qs[_0x2307('0x2c')](_0x3fcaa2[_0x2307('0x23')]['sort']);_0x21ce7a[_0x2307('0x2d')]=qs['filters'](_[_0x2307('0x2e')](_0x3fcaa2[_0x2307('0x23')],_0xe1f3a5[_0x2307('0x2f')]),_0x19b8b5);if(_0x3fcaa2['query'][_0x2307('0x30')]){_0x21ce7a[_0x2307('0x2d')]=_['merge'](_0x21ce7a[_0x2307('0x2d')],{'$or':_[_0x2307('0x22')](_0x19b8b5,function(_0xccc3fc){if(_0xccc3fc['type']!==_0x2307('0x31')){var _0x11fc83={};_0x11fc83[_0xccc3fc[_0x2307('0x1c')]]={'$like':'%'+_0x3fcaa2[_0x2307('0x23')]['filter']+'%'};return _0x11fc83;}})});}_0x21ce7a=_[_0x2307('0x32')]({},_0x21ce7a,_0x3fcaa2['options']);var _0x10819f={'where':_0x21ce7a[_0x2307('0x2d')]};return db[_0x2307('0x33')][_0x2307('0xe')](_0x10819f)['then'](function(_0x4fb60a){_0x41baad[_0x2307('0xe')]=_0x4fb60a;if(_0x3fcaa2[_0x2307('0x23')][_0x2307('0x34')]){_0x21ce7a[_0x2307('0x35')]=[{'all':!![]}];}return db['SquareProject'][_0x2307('0x36')](_0x21ce7a);})[_0x2307('0x13')](function(_0x445dcf){_0x41baad['rows']=_0x445dcf;return _0x41baad;})['then'](respondWithFilteredResult(_0x541208,_0x21ce7a))[_0x2307('0x37')](handleError(_0x541208,null));};exports[_0x2307('0x38')]=function(_0x23cb26,_0x1d7fc6){var _0x134f34={'raw':![],'where':{'id':_0x23cb26[_0x2307('0x39')]['id']}},_0x3f00bb={};_0x3f00bb['model']=_[_0x2307('0x24')](db[_0x2307('0x33')][_0x2307('0x3a')]);_0x3f00bb[_0x2307('0x23')]=_[_0x2307('0x24')](_0x23cb26['query']);_0x3f00bb[_0x2307('0x2f')]=_[_0x2307('0x25')](_0x3f00bb[_0x2307('0x21')],_0x3f00bb[_0x2307('0x23')]);_0x134f34[_0x2307('0x26')]=_[_0x2307('0x25')](_0x3f00bb[_0x2307('0x21')],qs[_0x2307('0x27')](_0x23cb26[_0x2307('0x23')][_0x2307('0x27')]));_0x134f34[_0x2307('0x26')]=_0x134f34[_0x2307('0x26')][_0x2307('0x28')]?_0x134f34[_0x2307('0x26')]:_0x3f00bb['model'];if(_0x23cb26[_0x2307('0x23')][_0x2307('0x34')]){_0x134f34['include']=[{'all':!![]}];}_0x134f34=_[_0x2307('0x32')]({},_0x134f34,_0x23cb26['options']);return db[_0x2307('0x33')][_0x2307('0x3b')](_0x134f34)[_0x2307('0x13')](handleEntityNotFound(_0x1d7fc6,null))[_0x2307('0x13')](respondWithResult(_0x1d7fc6,null))['catch'](handleError(_0x1d7fc6,null));};exports['create']=function(_0x4215f2,_0x1c6dd7){return db['SquareProject']['create'](_0x4215f2[_0x2307('0x3c')],{})['then'](function(_0x2b5c03){var _0x2222a9=_0x4215f2[_0x2307('0x3d')][_0x2307('0x14')]({'plain':!![]});if(!_0x2222a9)throw new Error(_0x2307('0x3e'));if(_0x2222a9[_0x2307('0x3f')]===_0x2307('0x3d')){var _0x290f1f=_0x2b5c03['get']({'plain':!![]});var _0x15804f=_0x2307('0x15');return db[_0x2307('0x40')]['find']({'where':{'name':_0x15804f,'userProfileId':_0x2222a9['userProfileId']},'raw':!![]})['then'](function(_0x5544b4){if(_0x5544b4&&_0x5544b4['autoAssociation']===0x0){return db['UserProfileResource'][_0x2307('0x41')]({'name':_0x290f1f['name'],'resourceId':_0x290f1f['id'],'type':_0x5544b4[_0x2307('0x1c')],'sectionId':_0x5544b4['id']},{})[_0x2307('0x13')](function(){return _0x2b5c03;});}else{return _0x2b5c03;}})[_0x2307('0x37')](function(_0x5d2202){logger[_0x2307('0x1a')](_0x2307('0x42'),_0x5d2202);throw _0x5d2202;});}return _0x2b5c03;})[_0x2307('0x13')](respondWithResult(_0x1c6dd7,0xc9))['catch'](handleError(_0x1c6dd7,null));};exports[_0x2307('0x11')]=function(_0x6691c6,_0x4bf820){if(_0x6691c6[_0x2307('0x3c')]['id']){delete _0x6691c6[_0x2307('0x3c')]['id'];}return db['SquareProject'][_0x2307('0x3b')]({'where':{'id':_0x6691c6[_0x2307('0x39')]['id']}})['then'](handleEntityNotFound(_0x4bf820,null))[_0x2307('0x13')](saveUpdates(_0x6691c6[_0x2307('0x3c')],null))[_0x2307('0x13')](function(_0x34a9f3){if(!_0x34a9f3)return;var _0x45ee19=_0x34a9f3[_0x2307('0x14')]({'plain':!![]});return _0x45ee19;})[_0x2307('0x13')](function(_0x37b182){var _0xc69f0e=new Redis(config['redis']);_0xc69f0e[_0x2307('0x43')](_0x2307('0x17'),JSON[_0x2307('0x18')](_[_0x2307('0x2e')](_0x37b182,['id',_0x2307('0x1c'),'production'])));return _0x37b182;})[_0x2307('0x13')](respondWithResult(_0x4bf820,null))['catch'](handleError(_0x4bf820,null));};exports['destroy']=function(_0x45108f,_0x5a04d3){return db['SquareProject'][_0x2307('0x3b')]({'where':{'id':_0x45108f[_0x2307('0x39')]['id']}})[_0x2307('0x13')](handleEntityNotFound(_0x5a04d3,null))['then'](removeEntity(_0x5a04d3,null))[_0x2307('0x37')](handleError(_0x5a04d3,null));}; \ No newline at end of file +var _0x0c0b=['destroy','publish','agi','stringify','sendStatus','error','stack','name','send','map','SquareProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','keys','rawAttributes','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','production','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','json','offset','limit','undefined','count','status','set','Content-Range','update','then','get','SquareProjects','UserProfileResource'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x0c0b,0x73));var _0xb0c0=function(_0x4bee2f,_0x3cace5){_0x4bee2f=_0x4bee2f-0x0;var _0x1cea96=_0x0c0b[_0x4bee2f];return _0x1cea96;};'use strict';var _=require(_0xb0c0('0x0'));var Redis=require('ioredis');var qs=require(_0xb0c0('0x1'));var logger=require('../../config/logger')(_0xb0c0('0x2'));var config=require(_0xb0c0('0x3'));var db=require(_0xb0c0('0x4'))['db'];config[_0xb0c0('0x5')]=_[_0xb0c0('0x6')](config[_0xb0c0('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xb0c0('0x7'))(new Redis(config[_0xb0c0('0x5')]));require(_0xb0c0('0x8'))[_0xb0c0('0x9')](socket);function respondWithResult(_0x4cb9e7,_0xb241a4){_0xb241a4=_0xb241a4||0xc8;return function(_0x749b42){if(_0x749b42){return _0x4cb9e7['status'](_0xb241a4)[_0xb0c0('0xa')](_0x749b42);}};}function respondWithFilteredResult(_0xd3ac06,_0x27b126){return function(_0x103dd1){if(_0x103dd1){var _0x2db426=typeof _0x27b126[_0xb0c0('0xb')]==='undefined'&&typeof _0x27b126[_0xb0c0('0xc')]===_0xb0c0('0xd');var _0x2663a4=_0x103dd1[_0xb0c0('0xe')];var _0x4c4112=_0x2db426?0x0:_0x27b126['offset'];var _0x33cf82=_0x2db426?_0x103dd1[_0xb0c0('0xe')]:_0x27b126[_0xb0c0('0xb')]+_0x27b126[_0xb0c0('0xc')];var _0x28dea5;if(_0x33cf82>=_0x2663a4){_0x33cf82=_0x2663a4;_0x28dea5=0xc8;}else{_0x28dea5=0xce;}_0xd3ac06[_0xb0c0('0xf')](_0x28dea5);return _0xd3ac06[_0xb0c0('0x10')](_0xb0c0('0x11'),_0x4c4112+'-'+_0x33cf82+'/'+_0x2663a4)[_0xb0c0('0xa')](_0x103dd1);}return null;};}function saveUpdates(_0x1455a8){return function(_0x3048ed){if(_0x3048ed){return _0x3048ed[_0xb0c0('0x12')](_0x1455a8)[_0xb0c0('0x13')](function(_0x498b28){return _0x498b28;});}return null;};}function removeEntity(_0x3e58fa){return function(_0x11aeb8){if(_0x11aeb8){return _0x11aeb8['destroy']()[_0xb0c0('0x13')](function(){var _0x620336=_0x11aeb8[_0xb0c0('0x14')]({'plain':!![]});var _0x533930=_0xb0c0('0x15');return db[_0xb0c0('0x16')][_0xb0c0('0x17')]({'where':{'type':_0x533930,'resourceId':_0x620336['id']}})[_0xb0c0('0x13')](function(){return _0x11aeb8;});})[_0xb0c0('0x13')](function(){var _0x1acb8e=new Redis(config['redis']);_0x1acb8e[_0xb0c0('0x18')](_0xb0c0('0x19'),JSON[_0xb0c0('0x1a')]({'id':_0x11aeb8['id'],'deleted':!![]}));})[_0xb0c0('0x13')](function(){_0x3e58fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b355){return function(_0x185db8){if(!_0x185db8){_0x23b355[_0xb0c0('0x1b')](0x194);}return _0x185db8;};}function handleError(_0x334a95,_0xd9d9dd){_0xd9d9dd=_0xd9d9dd||0x1f4;return function(_0xed1aac){logger[_0xb0c0('0x1c')](_0xed1aac[_0xb0c0('0x1d')]);if(_0xed1aac[_0xb0c0('0x1e')]){delete _0xed1aac[_0xb0c0('0x1e')];}_0x334a95[_0xb0c0('0xf')](_0xd9d9dd)[_0xb0c0('0x1f')](_0xed1aac);};}exports['index']=function(_0x498bfe,_0x71c22c){var _0x533fa5={},_0x3e731f={},_0x2c65ad={'count':0x0,'rows':[]};var _0x4d2654=_[_0xb0c0('0x20')](db[_0xb0c0('0x21')]['rawAttributes'],function(_0x37381d){return{'name':_0x37381d[_0xb0c0('0x22')],'type':_0x37381d[_0xb0c0('0x23')][_0xb0c0('0x24')]};});_0x3e731f[_0xb0c0('0x25')]=_[_0xb0c0('0x20')](_0x4d2654,'name');_0x3e731f[_0xb0c0('0x26')]=_['keys'](_0x498bfe[_0xb0c0('0x26')]);_0x3e731f[_0xb0c0('0x27')]=_[_0xb0c0('0x28')](_0x3e731f[_0xb0c0('0x25')],_0x3e731f[_0xb0c0('0x26')]);_0x533fa5[_0xb0c0('0x29')]=_['intersection'](_0x3e731f[_0xb0c0('0x25')],qs[_0xb0c0('0x2a')](_0x498bfe['query'][_0xb0c0('0x2a')]));_0x533fa5['attributes']=_0x533fa5[_0xb0c0('0x29')][_0xb0c0('0x2b')]?_0x533fa5[_0xb0c0('0x29')]:_0x3e731f[_0xb0c0('0x25')];if(!_0x498bfe[_0xb0c0('0x26')][_0xb0c0('0x2c')](_0xb0c0('0x2d'))){_0x533fa5[_0xb0c0('0xc')]=qs[_0xb0c0('0xc')](_0x498bfe[_0xb0c0('0x26')][_0xb0c0('0xc')]);_0x533fa5[_0xb0c0('0xb')]=qs[_0xb0c0('0xb')](_0x498bfe[_0xb0c0('0x26')][_0xb0c0('0xb')]);}_0x533fa5['order']=qs[_0xb0c0('0x2e')](_0x498bfe[_0xb0c0('0x26')][_0xb0c0('0x2e')]);_0x533fa5[_0xb0c0('0x2f')]=qs[_0xb0c0('0x27')](_[_0xb0c0('0x30')](_0x498bfe[_0xb0c0('0x26')],_0x3e731f[_0xb0c0('0x27')]),_0x4d2654);if(_0x498bfe[_0xb0c0('0x26')]['filter']){_0x533fa5[_0xb0c0('0x2f')]=_[_0xb0c0('0x31')](_0x533fa5[_0xb0c0('0x2f')],{'$or':_[_0xb0c0('0x20')](_0x4d2654,function(_0x551a51){if(_0x551a51[_0xb0c0('0x23')]!==_0xb0c0('0x32')){var _0x43ac01={};_0x43ac01[_0x551a51[_0xb0c0('0x1e')]]={'$like':'%'+_0x498bfe['query'][_0xb0c0('0x33')]+'%'};return _0x43ac01;}})});}_0x533fa5=_[_0xb0c0('0x31')]({},_0x533fa5,_0x498bfe['options']);var _0x218e11={'where':_0x533fa5[_0xb0c0('0x2f')]};return db['SquareProject']['count'](_0x218e11)[_0xb0c0('0x13')](function(_0x40bc7a){_0x2c65ad[_0xb0c0('0xe')]=_0x40bc7a;if(_0x498bfe[_0xb0c0('0x26')][_0xb0c0('0x34')]){_0x533fa5[_0xb0c0('0x35')]=[{'all':!![]}];}return db[_0xb0c0('0x21')][_0xb0c0('0x36')](_0x533fa5);})['then'](function(_0x48a033){_0x2c65ad[_0xb0c0('0x37')]=_0x48a033;return _0x2c65ad;})[_0xb0c0('0x13')](respondWithFilteredResult(_0x71c22c,_0x533fa5))['catch'](handleError(_0x71c22c,null));};exports['show']=function(_0x4fa6d3,_0x4d900c){var _0x5883ba={'raw':![],'where':{'id':_0x4fa6d3[_0xb0c0('0x38')]['id']}},_0x26bd85={};_0x26bd85[_0xb0c0('0x25')]=_[_0xb0c0('0x39')](db['SquareProject'][_0xb0c0('0x3a')]);_0x26bd85[_0xb0c0('0x26')]=_[_0xb0c0('0x39')](_0x4fa6d3[_0xb0c0('0x26')]);_0x26bd85['filters']=_['intersection'](_0x26bd85['model'],_0x26bd85['query']);_0x5883ba[_0xb0c0('0x29')]=_['intersection'](_0x26bd85[_0xb0c0('0x25')],qs['fields'](_0x4fa6d3[_0xb0c0('0x26')]['fields']));_0x5883ba['attributes']=_0x5883ba[_0xb0c0('0x29')][_0xb0c0('0x2b')]?_0x5883ba[_0xb0c0('0x29')]:_0x26bd85[_0xb0c0('0x25')];if(_0x4fa6d3[_0xb0c0('0x26')][_0xb0c0('0x34')]){_0x5883ba['include']=[{'all':!![]}];}_0x5883ba=_[_0xb0c0('0x31')]({},_0x5883ba,_0x4fa6d3['options']);return db['SquareProject'][_0xb0c0('0x3b')](_0x5883ba)['then'](handleEntityNotFound(_0x4d900c,null))[_0xb0c0('0x13')](respondWithResult(_0x4d900c,null))['catch'](handleError(_0x4d900c,null));};exports['create']=function(_0x1121e7,_0x4d052f){return db['SquareProject']['create'](_0x1121e7[_0xb0c0('0x3c')],{})[_0xb0c0('0x13')](function(_0x12cc84){var _0x1e9680=_0x1121e7[_0xb0c0('0x3d')][_0xb0c0('0x14')]({'plain':!![]});if(!_0x1e9680)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e9680[_0xb0c0('0x3e')]===_0xb0c0('0x3d')){var _0x1e663e=_0x12cc84['get']({'plain':!![]});var _0x2f5f10=_0xb0c0('0x15');return db[_0xb0c0('0x3f')][_0xb0c0('0x3b')]({'where':{'name':_0x2f5f10,'userProfileId':_0x1e9680[_0xb0c0('0x40')]},'raw':!![]})[_0xb0c0('0x13')](function(_0x3fbab1){if(_0x3fbab1&&_0x3fbab1[_0xb0c0('0x41')]===0x0){return db[_0xb0c0('0x16')]['create']({'name':_0x1e663e[_0xb0c0('0x1e')],'resourceId':_0x1e663e['id'],'type':_0x3fbab1[_0xb0c0('0x1e')],'sectionId':_0x3fbab1['id']},{})[_0xb0c0('0x13')](function(){return _0x12cc84;});}else{return _0x12cc84;}})[_0xb0c0('0x42')](function(_0x290445){logger[_0xb0c0('0x1c')](_0xb0c0('0x43'),_0x290445);throw _0x290445;});}return _0x12cc84;})[_0xb0c0('0x13')](respondWithResult(_0x4d052f,0xc9))[_0xb0c0('0x42')](handleError(_0x4d052f,null));};exports[_0xb0c0('0x12')]=function(_0x2baa70,_0x3922d3){if(_0x2baa70[_0xb0c0('0x3c')]['id']){delete _0x2baa70[_0xb0c0('0x3c')]['id'];}return db['SquareProject'][_0xb0c0('0x3b')]({'where':{'id':_0x2baa70[_0xb0c0('0x38')]['id']}})['then'](handleEntityNotFound(_0x3922d3,null))[_0xb0c0('0x13')](saveUpdates(_0x2baa70[_0xb0c0('0x3c')],null))[_0xb0c0('0x13')](function(_0x42b553){if(!_0x42b553)return;var _0xdc0ebc=_0x42b553[_0xb0c0('0x14')]({'plain':!![]});return _0xdc0ebc;})[_0xb0c0('0x13')](function(_0x119927){var _0x19dd51=new Redis(config[_0xb0c0('0x5')]);_0x19dd51['publish'](_0xb0c0('0x19'),JSON[_0xb0c0('0x1a')](_['pick'](_0x119927,['id','name',_0xb0c0('0x44')])));return _0x119927;})['then'](respondWithResult(_0x3922d3,null))[_0xb0c0('0x42')](handleError(_0x3922d3,null));};exports['destroy']=function(_0xdd3ab,_0x5867a5){return db[_0xb0c0('0x21')][_0xb0c0('0x3b')]({'where':{'id':_0xdd3ab['params']['id']}})[_0xb0c0('0x13')](handleEntityNotFound(_0x5867a5,null))['then'](removeEntity(_0x5867a5,null))[_0xb0c0('0x42')](handleError(_0x5867a5,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f511dc6..3c78e93 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 _0x9f00=['remove','hasOwnProperty','exports','SquareProject','setMaxListeners','save','update'];(function(_0x258d86,_0x2ac3f3){var _0x46ff28=function(_0x3ce486){while(--_0x3ce486){_0x258d86['push'](_0x258d86['shift']());}};_0x46ff28(++_0x2ac3f3);}(_0x9f00,0x1d1));var _0x09f0=function(_0x470252,_0x457603){_0x470252=_0x470252-0x0;var _0xeec8b4=_0x9f00[_0x470252];return _0xeec8b4;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x09f0('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x09f0('0x1')](0x0);var events={'afterCreate':_0x09f0('0x2'),'afterUpdate':_0x09f0('0x3'),'afterDestroy':_0x09f0('0x4')};function emitEvent(_0x445fcc){return function(_0x580dd1,_0x4549db,_0x1ea6b5){SquareProjectEvents['emit'](_0x445fcc+':'+_0x580dd1['id'],_0x580dd1);SquareProjectEvents['emit'](_0x445fcc,_0x580dd1);_0x1ea6b5(null);};}for(var e in events){if(events[_0x09f0('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x09f0('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x9aa3=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2a6d32,_0x40c317){var _0x356d08=function(_0x29b1f7){while(--_0x29b1f7){_0x2a6d32['push'](_0x2a6d32['shift']());}};_0x356d08(++_0x40c317);}(_0x9aa3,0x156));var _0x39aa=function(_0x2d8e89,_0x1074aa){_0x2d8e89=_0x2d8e89-0x0;var _0x1fb3c2=_0x9aa3[_0x2d8e89];return _0x1fb3c2;};'use strict';var EventEmitter=require(_0x39aa('0x0'));var SquareProject=require(_0x39aa('0x1'))['db'][_0x39aa('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x39aa('0x3')](0x0);var events={'afterCreate':_0x39aa('0x4'),'afterUpdate':_0x39aa('0x5'),'afterDestroy':_0x39aa('0x6')};function emitEvent(_0x3a43e4){return function(_0x3bdbff,_0x2eed43,_0x1a217c){SquareProjectEvents[_0x39aa('0x7')](_0x3a43e4+':'+_0x3bdbff['id'],_0x3bdbff);SquareProjectEvents[_0x39aa('0x7')](_0x3a43e4,_0x3bdbff);_0x1a217c(null);};}for(var e in events){if(events[_0x39aa('0x8')](e)){var event=events[e];SquareProject[_0x39aa('0x9')](e,emitEvent(event));}}module[_0x39aa('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 81a3f1a..d9cf32e 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 _0x03b9=['changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x03b9,0xd1));var _0x903b=function(_0x20218c,_0x2adb72){_0x20218c=_0x20218c-0x0;var _0xdfb388=_0x03b9[_0x20218c];return _0xdfb388;};'use strict';var _=require('lodash');var util=require(_0x903b('0x0'));var logger=require(_0x903b('0x1'))(_0x903b('0x2'));var moment=require(_0x903b('0x3'));var BPromise=require(_0x903b('0x4'));var rp=require(_0x903b('0x5'));var fs=require('fs');var path=require(_0x903b('0x6'));var rimraf=require('rimraf');var config=require(_0x903b('0x7'));var attributes=require(_0x903b('0x8'));module['exports']=function(_0x15db40,_0x1d425a){return _0x15db40[_0x903b('0x9')](_0x903b('0xa'),attributes,{'tableName':_0x903b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d10c9,_0x588eed,_0xf02239){if(_0x3d10c9[_0x903b('0xc')](_0x903b('0xd'))){_0x3d10c9[_0x903b('0xe')]=moment()['format'](_0x903b('0xf'));}if(_0x3d10c9[_0x903b('0xc')]('production')){_0x3d10c9[_0x903b('0x10')]=moment()['format'](_0x903b('0xf'));}_0xf02239(null,_0x3d10c9);}}});}; \ No newline at end of file +var _0x4f9b=['request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','changed','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird'];(function(_0x5ae726,_0x573b36){var _0x43d022=function(_0x5d6949){while(--_0x5d6949){_0x5ae726['push'](_0x5ae726['shift']());}};_0x43d022(++_0x573b36);}(_0x4f9b,0x9e));var _0xb4f9=function(_0x53692f,_0x433fb7){_0x53692f=_0x53692f-0x0;var _0x3da192=_0x4f9b[_0x53692f];return _0x3da192;};'use strict';var _=require(_0xb4f9('0x0'));var util=require('util');var logger=require(_0xb4f9('0x1'))(_0xb4f9('0x2'));var moment=require('moment');var BPromise=require(_0xb4f9('0x3'));var rp=require(_0xb4f9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4f9('0x5'));var attributes=require(_0xb4f9('0x6'));module[_0xb4f9('0x7')]=function(_0x3afc91,_0x25eb8a){return _0x3afc91[_0xb4f9('0x8')](_0xb4f9('0x9'),attributes,{'tableName':_0xb4f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x379cef,_0x2b088a,_0x5472b9){if(_0x379cef['changed'](_0xb4f9('0xb'))){_0x379cef[_0xb4f9('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x379cef[_0xb4f9('0xd')](_0xb4f9('0xe'))){_0x379cef[_0xb4f9('0xf')]=moment()[_0xb4f9('0x10')](_0xb4f9('0x11'));}_0x5472b9(null,_0x379cef);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index e5581f5..b595c55 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 _0x7305=['register','findAll','options','where','attributes','limit','include','map','model','then','info','debug','GetSquareProjects','stringify','catch','error','message','ShowSquareProject','SquareProject','find','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7305,0xd8));var _0x5730=function(_0x231b93,_0x5cd93f){_0x231b93=_0x231b93-0x0;var _0x34c6b7=_0x7305[_0x231b93];return _0x34c6b7;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0x5730('0x0'))['db'];var logger=require(_0x5730('0x1'))(_0x5730('0x2'));var config=require('../../config/environment');config[_0x5730('0x3')]=_[_0x5730('0x4')](config['redis'],{'host':_0x5730('0x5'),'port':0x18eb});var socket=require(_0x5730('0x6'))(new Redis(config[_0x5730('0x3')]));require(_0x5730('0x7'))[_0x5730('0x8')](socket);exports['GetSquareProjects']=function(_0x1be59b){var _0x49ea99=this;return new Promise(function(_0x566396,_0x287ed8){return db['SquareProject'][_0x5730('0x9')]({'raw':_0x1be59b[_0x5730('0xa')]?_0x1be59b[_0x5730('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x1be59b[_0x5730('0xa')]?_0x1be59b['options'][_0x5730('0xb')]||null:null,'attributes':_0x1be59b[_0x5730('0xa')]?_0x1be59b[_0x5730('0xa')][_0x5730('0xc')]||null:null,'limit':_0x1be59b['options']?_0x1be59b['options'][_0x5730('0xd')]||null:null,'include':_0x1be59b[_0x5730('0xa')]?_0x1be59b[_0x5730('0xa')][_0x5730('0xe')]?_[_0x5730('0xf')](_0x1be59b[_0x5730('0xa')]['include'],function(_0xacc91b){return{'model':db[_0xacc91b[_0x5730('0x10')]],'as':_0xacc91b['as'],'attributes':_0xacc91b[_0x5730('0xc')],'include':_0xacc91b[_0x5730('0xe')]?_[_0x5730('0xf')](_0xacc91b[_0x5730('0xe')],function(_0x183a9b){return{'model':db[_0x183a9b['model']],'as':_0x183a9b['as'],'attributes':_0x183a9b['attributes'],'include':_0x183a9b[_0x5730('0xe')]?_[_0x5730('0xf')](_0x183a9b[_0x5730('0xe')],function(_0x234ff8){return{'model':db[_0x234ff8['model']],'as':_0x234ff8['as'],'attributes':_0x234ff8[_0x5730('0xc')]};}):[]};}):[]};}):[]:[]})[_0x5730('0x11')](function(_0x255356){logger[_0x5730('0x12')]('GetSquareProjects',_0x1be59b);logger[_0x5730('0x13')](_0x5730('0x14'),_0x1be59b,JSON[_0x5730('0x15')](_0x255356));_0x566396(_0x255356);})[_0x5730('0x16')](function(_0x4adf1f){logger[_0x5730('0x17')](_0x5730('0x14'),_0x4adf1f['message'],_0x1be59b);_0x287ed8(_0x49ea99[_0x5730('0x17')](0x1f4,_0x4adf1f[_0x5730('0x18')]));});});};exports[_0x5730('0x19')]=function(_0x5f97ec){var _0x109299=this;return new Promise(function(_0xf46b10,_0x37f500){return db[_0x5730('0x1a')][_0x5730('0x1b')]({'raw':_0x5f97ec[_0x5730('0xa')]?_0x5f97ec[_0x5730('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x5f97ec[_0x5730('0xa')]?_0x5f97ec[_0x5730('0xa')][_0x5730('0xb')]||null:null,'attributes':_0x5f97ec[_0x5730('0xa')]?_0x5f97ec[_0x5730('0xa')][_0x5730('0xc')]||null:null,'include':_0x5f97ec[_0x5730('0xa')]?_0x5f97ec['options'][_0x5730('0xe')]?_['map'](_0x5f97ec[_0x5730('0xa')][_0x5730('0xe')],function(_0x3f0d71){return{'model':db[_0x3f0d71[_0x5730('0x10')]],'as':_0x3f0d71['as'],'attributes':_0x3f0d71[_0x5730('0xc')],'include':_0x3f0d71[_0x5730('0xe')]?_[_0x5730('0xf')](_0x3f0d71[_0x5730('0xe')],function(_0x228840){return{'model':db[_0x228840['model']],'as':_0x228840['as'],'attributes':_0x228840[_0x5730('0xc')],'include':_0x228840['include']?_['map'](_0x228840['include'],function(_0x26b27e){return{'model':db[_0x26b27e['model']],'as':_0x26b27e['as'],'attributes':_0x26b27e[_0x5730('0xc')]};}):[]};}):[]};}):[]:[]})[_0x5730('0x11')](function(_0x1c8bc1){logger[_0x5730('0x12')](_0x5730('0x19'),_0x5f97ec);logger[_0x5730('0x13')](_0x5730('0x19'),_0x5f97ec,JSON[_0x5730('0x15')](_0x1c8bc1));_0xf46b10(_0x1c8bc1);})[_0x5730('0x16')](function(_0x21d1a0){logger[_0x5730('0x17')](_0x5730('0x19'),_0x21d1a0[_0x5730('0x18')],_0x5f97ec);_0x37f500(_0x109299[_0x5730('0x17')](0x1f4,_0x21d1a0[_0x5730('0x18')]));});});}; \ No newline at end of file +var _0x185f=['model','then','info','debug','stringify','catch','error','message','ShowSquareProject','find','lodash','../../mysqldb','../../config/logger','rpc','redis','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','where','attributes','map','include'];(function(_0x498b22,_0x131b18){var _0x327881=function(_0x4ad7b8){while(--_0x4ad7b8){_0x498b22['push'](_0x498b22['shift']());}};_0x327881(++_0x131b18);}(_0x185f,0x1de));var _0xf185=function(_0x3d1b88,_0x308670){_0x3d1b88=_0x3d1b88-0x0;var _0x302e17=_0x185f[_0x3d1b88];return _0x302e17;};'use strict';var _=require(_0xf185('0x0'));var Redis=require('ioredis');var db=require(_0xf185('0x1'))['db'];var logger=require(_0xf185('0x2'))(_0xf185('0x3'));var config=require('../../config/environment');config[_0xf185('0x4')]=_['defaults'](config[_0xf185('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xf185('0x5'))(new Redis(config[_0xf185('0x4')]));require(_0xf185('0x6'))[_0xf185('0x7')](socket);exports[_0xf185('0x8')]=function(_0x4c241c){var _0x1e94c4=this;return new Promise(function(_0x29f396,_0x4a853d){return db[_0xf185('0x9')][_0xf185('0xa')]({'raw':_0x4c241c[_0xf185('0xb')]?_0x4c241c[_0xf185('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x4c241c[_0xf185('0xb')]?_0x4c241c[_0xf185('0xb')][_0xf185('0xc')]||null:null,'attributes':_0x4c241c[_0xf185('0xb')]?_0x4c241c[_0xf185('0xb')][_0xf185('0xd')]||null:null,'limit':_0x4c241c[_0xf185('0xb')]?_0x4c241c[_0xf185('0xb')]['limit']||null:null,'include':_0x4c241c['options']?_0x4c241c['options']['include']?_[_0xf185('0xe')](_0x4c241c[_0xf185('0xb')][_0xf185('0xf')],function(_0x17a3a3){return{'model':db[_0x17a3a3[_0xf185('0x10')]],'as':_0x17a3a3['as'],'attributes':_0x17a3a3[_0xf185('0xd')],'include':_0x17a3a3[_0xf185('0xf')]?_[_0xf185('0xe')](_0x17a3a3[_0xf185('0xf')],function(_0x5a7858){return{'model':db[_0x5a7858['model']],'as':_0x5a7858['as'],'attributes':_0x5a7858[_0xf185('0xd')],'include':_0x5a7858[_0xf185('0xf')]?_[_0xf185('0xe')](_0x5a7858['include'],function(_0x40d8fb){return{'model':db[_0x40d8fb[_0xf185('0x10')]],'as':_0x40d8fb['as'],'attributes':_0x40d8fb[_0xf185('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf185('0x11')](function(_0x75af96){logger[_0xf185('0x12')]('GetSquareProjects',_0x4c241c);logger[_0xf185('0x13')](_0xf185('0x8'),_0x4c241c,JSON[_0xf185('0x14')](_0x75af96));_0x29f396(_0x75af96);})[_0xf185('0x15')](function(_0x4fc6f2){logger[_0xf185('0x16')](_0xf185('0x8'),_0x4fc6f2['message'],_0x4c241c);_0x4a853d(_0x1e94c4[_0xf185('0x16')](0x1f4,_0x4fc6f2[_0xf185('0x17')]));});});};exports[_0xf185('0x18')]=function(_0xa6337a){var _0x1c0f15=this;return new Promise(function(_0x4a2d7f,_0x3f2029){return db[_0xf185('0x9')][_0xf185('0x19')]({'raw':_0xa6337a[_0xf185('0xb')]?_0xa6337a['options']['raw']===undefined?!![]:![]:!![],'where':_0xa6337a[_0xf185('0xb')]?_0xa6337a[_0xf185('0xb')][_0xf185('0xc')]||null:null,'attributes':_0xa6337a[_0xf185('0xb')]?_0xa6337a[_0xf185('0xb')][_0xf185('0xd')]||null:null,'include':_0xa6337a[_0xf185('0xb')]?_0xa6337a[_0xf185('0xb')]['include']?_[_0xf185('0xe')](_0xa6337a[_0xf185('0xb')][_0xf185('0xf')],function(_0x392b41){return{'model':db[_0x392b41[_0xf185('0x10')]],'as':_0x392b41['as'],'attributes':_0x392b41[_0xf185('0xd')],'include':_0x392b41['include']?_[_0xf185('0xe')](_0x392b41['include'],function(_0x19b044){return{'model':db[_0x19b044[_0xf185('0x10')]],'as':_0x19b044['as'],'attributes':_0x19b044[_0xf185('0xd')],'include':_0x19b044[_0xf185('0xf')]?_[_0xf185('0xe')](_0x19b044[_0xf185('0xf')],function(_0x20a3f4){return{'model':db[_0x20a3f4[_0xf185('0x10')]],'as':_0x20a3f4['as'],'attributes':_0x20a3f4[_0xf185('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf185('0x11')](function(_0x105622){logger[_0xf185('0x12')](_0xf185('0x18'),_0xa6337a);logger['debug']('ShowSquareProject',_0xa6337a,JSON[_0xf185('0x14')](_0x105622));_0x4a2d7f(_0x105622);})[_0xf185('0x15')](function(_0x3de2a8){logger[_0xf185('0x16')](_0xf185('0x18'),_0x3de2a8[_0xf185('0x17')],_0xa6337a);_0x3f2029(_0x1c0f15['error'](0x1f4,_0x3de2a8[_0xf185('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5099927..9a00961 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 _0x5822=['squareProject:','save','remove','emit','register'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0x5822,0x173));var _0x2582=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x5822[_0xb833b1];return _0x1ab87a;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x2582('0x0'),_0x2582('0x1'),'update'];function createListener(_0x51be31,_0x35e00d){return function(_0xc42bba){_0x35e00d[_0x2582('0x2')](_0x51be31,_0xc42bba);};}function removeListener(_0x3f6674,_0xd7f9df){return function(){SquareProjectEvents['removeListener'](_0x3f6674,_0xd7f9df);};}exports[_0x2582('0x3')]=function(_0x3734df){for(var _0x432a80=0x0,_0x3b5671=events['length'];_0x432a80<_0x3b5671;_0x432a80++){var _0x4c19f1=events[_0x432a80];var _0x32e837=createListener(_0x2582('0x4')+_0x4c19f1,_0x3734df);SquareProjectEvents['on'](_0x4c19f1,_0x32e837);}}; \ No newline at end of file +var _0x8f31=['remove','emit','register','length','squareProject:','./squareProject.events'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x8f31,0x1a9));var _0x18f3=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0x8f31[_0x2b2c53];return _0x311ec2;};'use strict';var SquareProjectEvents=require(_0x18f3('0x0'));var events=['save',_0x18f3('0x1'),'update'];function createListener(_0x266d17,_0x49b205){return function(_0x300798){_0x49b205[_0x18f3('0x2')](_0x266d17,_0x300798);};}function removeListener(_0xc9c176,_0x3689bf){return function(){SquareProjectEvents['removeListener'](_0xc9c176,_0x3689bf);};}exports[_0x18f3('0x3')]=function(_0xc58c98){for(var _0x5220f7=0x0,_0x53536b=events[_0x18f3('0x4')];_0x5220f7<_0x53536b;_0x5220f7++){var _0x6398bd=events[_0x5220f7];var _0x397e30=createListener(_0x18f3('0x5')+_0x6398bd,_0xc58c98);SquareProjectEvents['on'](_0x6398bd,_0x397e30);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f9a7946..a2c2c97 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x0295,0x1f0));var _0x5029=function(_0x188832,_0x49101d){_0x188832=_0x188832-0x0;var _0x2b990f=_0x0295[_0x188832];return _0x2b990f;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5029('0x7')]('/:id/download',auth[_0x5029('0x8')](),controller['download']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +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(_0x2876ef,_0x67a700){var _0x3bce04=function(_0xe41a04){while(--_0xe41a04){_0x2876ef['push'](_0x2876ef['shift']());}};_0x3bce04(++_0x67a700);}(_0x1261,0x144));var _0x1126=function(_0x2d582c,_0x424a15){_0x2d582c=_0x2d582c-0x0;var _0x37e92a=_0x1261[_0x2d582c];return _0x37e92a;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c287cd5..967b9dd 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 _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x701320,_0x1c07ae){var _0x53e92d=function(_0x2205b6){while(--_0x2205b6){_0x701320['push'](_0x701320['shift']());}};_0x53e92d(++_0x1c07ae);}(_0x7c09,0x102));var _0x97c0=function(_0x807410,_0x23ffc9){_0x807410=_0x807410-0x0;var _0x522bdf=_0x7c09[_0x807410];return _0x522bdf;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}}; \ No newline at end of file +var _0x81bd=['STRING','VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports'];(function(_0x30ef26,_0x2e16ba){var _0x310412=function(_0x12437e){while(--_0x12437e){_0x30ef26['push'](_0x30ef26['shift']());}};_0x310412(++_0x2e16ba);}(_0x81bd,0x7c));var _0xd81b=function(_0x4684af,_0x34880f){_0x4684af=_0x4684af-0x0;var _0x3bb413=_0x81bd[_0x4684af];return _0x3bb413;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'uniqueid':{'type':Sequelize[_0xd81b('0x2')]},'callerid':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize[_0xd81b('0x2')]},'context':{'type':Sequelize[_0xd81b('0x2')]},'extension':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd81b('0x2')]},'dnid':{'type':Sequelize[_0xd81b('0x2')]},'projectName':{'type':Sequelize[_0xd81b('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xd81b('0x2')]},'savePath':{'type':Sequelize[_0xd81b('0x2')]},'format':{'type':Sequelize[_0xd81b('0x3')],'get':function(){var _0x562084='';var _0x5e14e8=this[_0xd81b('0x4')]('savePath');if(_0x5e14e8){_0x562084=_0x5e14e8[_0xd81b('0x5')](_0x5e14e8[_0xd81b('0x6')]('.'));}return _0x562084;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index a73c578..a5bfb48 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 _0xcde0=['zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','error','name','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','catch','create','body','find','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','download','SquareRecording\x20not\x20found','send','Not\x20found','isNil','cancellazione\x20fisica\x20documento\x20%s','info','unlinkSync','.cypher','eml-format','rimraf'];(function(_0x1b5358,_0x27aecc){var _0x241519=function(_0x36163e){while(--_0x36163e){_0x1b5358['push'](_0x1b5358['shift']());}};_0x241519(++_0x27aecc);}(_0xcde0,0x10f));var _0x0cde=function(_0x1633ea,_0x33f811){_0x1633ea=_0x1633ea-0x0;var _0x3f07c1=_0xcde0[_0x1633ea];return _0x3f07c1;};'use strict';var emlformat=require(_0x0cde('0x0'));var rimraf=require(_0x0cde('0x1'));var zipdir=require(_0x0cde('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0cde('0x3'));var BPromise=require(_0x0cde('0x4'));var Mustache=require(_0x0cde('0x5'));var util=require(_0x0cde('0x6'));var path=require(_0x0cde('0x7'));var sox=require(_0x0cde('0x8'));var csv=require('to-csv');var ejs=require(_0x0cde('0x9'));var fs=require('fs');var fs_extra=require(_0x0cde('0xa'));var _=require(_0x0cde('0xb'));var squel=require('squel');var crypto=require(_0x0cde('0xc'));var jsforce=require(_0x0cde('0xd'));var deskjs=require(_0x0cde('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0cde('0xf'));var Redis=require(_0x0cde('0x10'));var authService=require(_0x0cde('0x11'));var qs=require(_0x0cde('0x12'));var as=require(_0x0cde('0x13'));var hardwareService=require(_0x0cde('0x14'));var logger=require('../../config/logger')(_0x0cde('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0cde('0x16'))['db'];function respondWithStatusCode(_0x4cdd04,_0xb7c81a){_0xb7c81a=_0xb7c81a||0xcc;return function(_0x2f4b60){if(_0x2f4b60){return _0x4cdd04[_0x0cde('0x17')](_0xb7c81a);}return _0x4cdd04[_0x0cde('0x18')](_0xb7c81a)[_0x0cde('0x19')]();};}function respondWithResult(_0x4ac604,_0x1920fa){_0x1920fa=_0x1920fa||0xc8;return function(_0x4c2341){if(_0x4c2341){return _0x4ac604['status'](_0x1920fa)['json'](_0x4c2341);}};}function respondWithFilteredResult(_0x267e20,_0x3a4954){return function(_0x6f9986){if(_0x6f9986){var _0x21ae1=typeof _0x3a4954[_0x0cde('0x1a')]==='undefined'&&typeof _0x3a4954[_0x0cde('0x1b')]===_0x0cde('0x1c');var _0x4fe324=_0x6f9986[_0x0cde('0x1d')];var _0x3960d2=_0x21ae1?0x0:_0x3a4954[_0x0cde('0x1a')];var _0xe678d1=_0x21ae1?_0x6f9986[_0x0cde('0x1d')]:_0x3a4954[_0x0cde('0x1a')]+_0x3a4954[_0x0cde('0x1b')];var _0x5c1051;if(_0xe678d1>=_0x4fe324){_0xe678d1=_0x4fe324;_0x5c1051=0xc8;}else{_0x5c1051=0xce;}_0x267e20[_0x0cde('0x18')](_0x5c1051);return _0x267e20[_0x0cde('0x1e')]('Content-Range',_0x3960d2+'-'+_0xe678d1+'/'+_0x4fe324)[_0x0cde('0x1f')](_0x6f9986);}return null;};}function patchUpdates(_0x3fcaa2){return function(_0x1d613e){try{jsonpatch[_0x0cde('0x20')](_0x1d613e,_0x3fcaa2,!![]);}catch(_0x52954c){return BPromise[_0x0cde('0x21')](_0x52954c);}return _0x1d613e['save']();};}function saveUpdates(_0x163332,_0x29d24d){return function(_0x1a69d4){if(_0x1a69d4){return _0x1a69d4[_0x0cde('0x22')](_0x163332)[_0x0cde('0x23')](function(_0x257b81){return _0x257b81;});}return null;};}function removeEntity(_0x4d3acb,_0x13cd1d){return function(_0x532996){if(_0x532996){return _0x532996[_0x0cde('0x24')]()[_0x0cde('0x23')](function(){_0x4d3acb[_0x0cde('0x18')](0xcc)[_0x0cde('0x19')]();});}};}function handleEntityNotFound(_0x866509,_0xfbbe44){return function(_0x335a3c){if(!_0x335a3c){_0x866509[_0x0cde('0x17')](0x194);}return _0x335a3c;};}function handleError(_0x5af1f1,_0x5374a3){_0x5374a3=_0x5374a3||0x1f4;return function(_0x828593){logger[_0x0cde('0x25')](_0x828593['stack']);if(_0x828593[_0x0cde('0x26')]){delete _0x828593[_0x0cde('0x26')];}_0x5af1f1[_0x0cde('0x18')](_0x5374a3)['send'](_0x828593);};}exports['index']=function(_0x225ad8,_0x377416){var _0x57304f={},_0x2caca1={},_0x56c33d={'count':0x0,'rows':[]};var _0x16a74c=_[_0x0cde('0x27')](db[_0x0cde('0x28')][_0x0cde('0x29')],function(_0x199f64){return{'name':_0x199f64[_0x0cde('0x2a')],'type':_0x199f64[_0x0cde('0x2b')][_0x0cde('0x2c')]};});_0x2caca1[_0x0cde('0x2d')]=_['map'](_0x16a74c,_0x0cde('0x26'));_0x2caca1[_0x0cde('0x2e')]=_[_0x0cde('0x2f')](_0x225ad8[_0x0cde('0x2e')]);_0x2caca1[_0x0cde('0x30')]=_[_0x0cde('0x31')](_0x2caca1[_0x0cde('0x2d')],_0x2caca1[_0x0cde('0x2e')]);_0x57304f[_0x0cde('0x32')]=_[_0x0cde('0x31')](_0x2caca1[_0x0cde('0x2d')],qs[_0x0cde('0x33')](_0x225ad8['query']['fields']));_0x57304f[_0x0cde('0x32')]=_0x57304f[_0x0cde('0x32')][_0x0cde('0x34')]?_0x57304f[_0x0cde('0x32')]:_0x2caca1[_0x0cde('0x2d')];if(!_0x225ad8[_0x0cde('0x2e')][_0x0cde('0x35')]('nolimit')){_0x57304f[_0x0cde('0x1b')]=qs[_0x0cde('0x1b')](_0x225ad8['query'][_0x0cde('0x1b')]);_0x57304f['offset']=qs['offset'](_0x225ad8['query'][_0x0cde('0x1a')]);}_0x57304f[_0x0cde('0x36')]=qs[_0x0cde('0x37')](_0x225ad8[_0x0cde('0x2e')][_0x0cde('0x37')]);_0x57304f['where']=qs[_0x0cde('0x30')](_[_0x0cde('0x38')](_0x225ad8[_0x0cde('0x2e')],_0x2caca1['filters']),_0x16a74c);if(_0x225ad8[_0x0cde('0x2e')][_0x0cde('0x39')]){_0x57304f[_0x0cde('0x3a')]=_[_0x0cde('0x3b')](_0x57304f[_0x0cde('0x3a')],{'$or':_[_0x0cde('0x27')](_0x16a74c,function(_0x1e9f82){if(_0x1e9f82['type']!==_0x0cde('0x3c')){var _0x18eda8={};_0x18eda8[_0x1e9f82['name']]={'$like':'%'+_0x225ad8['query'][_0x0cde('0x39')]+'%'};return _0x18eda8;}})});}_0x57304f=_[_0x0cde('0x3b')]({},_0x57304f,_0x225ad8[_0x0cde('0x3d')]);var _0x2ba5a1={'where':_0x57304f[_0x0cde('0x3a')]};return db[_0x0cde('0x28')][_0x0cde('0x1d')](_0x2ba5a1)[_0x0cde('0x23')](function(_0x42793c){_0x56c33d['count']=_0x42793c;if(_0x225ad8[_0x0cde('0x2e')][_0x0cde('0x3e')]){_0x57304f[_0x0cde('0x3f')]=[{'all':!![]}];}return db[_0x0cde('0x28')]['findAll'](_0x57304f);})[_0x0cde('0x23')](function(_0x51bcff){_0x56c33d[_0x0cde('0x40')]=_0x51bcff;return _0x56c33d;})['then'](respondWithFilteredResult(_0x377416,_0x57304f))['catch'](handleError(_0x377416,null));};exports[_0x0cde('0x41')]=function(_0x5a5855,_0x1bdf59){var _0x31c813={'raw':!![],'where':{'id':_0x5a5855[_0x0cde('0x42')]['id']}},_0x3181dd={};_0x3181dd['model']=_[_0x0cde('0x2f')](db[_0x0cde('0x28')]['rawAttributes']);_0x3181dd[_0x0cde('0x2e')]=_[_0x0cde('0x2f')](_0x5a5855[_0x0cde('0x2e')]);_0x3181dd[_0x0cde('0x30')]=_['intersection'](_0x3181dd[_0x0cde('0x2d')],_0x3181dd[_0x0cde('0x2e')]);_0x31c813[_0x0cde('0x32')]=_[_0x0cde('0x31')](_0x3181dd['model'],qs[_0x0cde('0x33')](_0x5a5855[_0x0cde('0x2e')][_0x0cde('0x33')]));_0x31c813['attributes']=_0x31c813['attributes']['length']?_0x31c813[_0x0cde('0x32')]:_0x3181dd[_0x0cde('0x2d')];if(_0x5a5855[_0x0cde('0x2e')]['includeAll']){_0x31c813[_0x0cde('0x3f')]=[{'all':!![]}];}_0x31c813=_['merge']({},_0x31c813,_0x5a5855[_0x0cde('0x3d')]);return db[_0x0cde('0x28')]['find'](_0x31c813)['then'](handleEntityNotFound(_0x1bdf59,null))[_0x0cde('0x23')](respondWithResult(_0x1bdf59,null))[_0x0cde('0x43')](handleError(_0x1bdf59,null));};exports['create']=function(_0x5e04ad,_0x6e124e){return db[_0x0cde('0x28')][_0x0cde('0x44')](_0x5e04ad['body'],{})[_0x0cde('0x23')](respondWithResult(_0x6e124e,0xc9))[_0x0cde('0x43')](handleError(_0x6e124e,null));};exports[_0x0cde('0x22')]=function(_0x4538d7,_0x5eb1f6){if(_0x4538d7[_0x0cde('0x45')]['id']){delete _0x4538d7[_0x0cde('0x45')]['id'];}return db['SquareRecording'][_0x0cde('0x46')]({'where':{'id':_0x4538d7[_0x0cde('0x42')]['id']}})[_0x0cde('0x23')](handleEntityNotFound(_0x5eb1f6,null))['then'](saveUpdates(_0x4538d7['body'],null))[_0x0cde('0x23')](respondWithResult(_0x5eb1f6,null))['catch'](handleError(_0x5eb1f6,null));};exports['download']=function(_0x534dfe,_0x5aa49c,_0x771abb){var _0x28d741=require(_0x0cde('0x47'));var _0xa2ef97=![];var _0x36e54e={};if(_0x534dfe[_0x0cde('0x2e')][_0x0cde('0x2b')]&&_0x534dfe[_0x0cde('0x2e')][_0x0cde('0x2b')]==='uniqueid'){_0x36e54e[_0x0cde('0x48')]=_0x534dfe[_0x0cde('0x42')]['id'];}else{_0x36e54e['id']=_0x534dfe['params']['id'];}return db[_0x0cde('0x28')][_0x0cde('0x46')]({'where':_0x36e54e,'attributes':['id','savePath',_0x0cde('0x49')],'raw':!![]})[_0x0cde('0x23')](handleEntityNotFound(_0x5aa49c,null))[_0x0cde('0x23')](function(_0x1555b2){if(_0x1555b2){var _0x2bff1b=_0x1555b2[_0x0cde('0x4a')];var _0x6e5e6e=util[_0x0cde('0x4b')](_0x0cde('0x4c'),_0x2bff1b);if(fs[_0x0cde('0x4d')](_0x6e5e6e)){_0xa2ef97=!![];return _0x28d741[_0x0cde('0x4e')](_0x6e5e6e,_0x2bff1b,config['secrets'][_0x0cde('0x4f')])[_0x0cde('0x23')](function(){return _0x1555b2;});}return _0x1555b2;}})['then'](function(_0x4b35e3){if(_0x4b35e3){var _0x60fc94=_0x4b35e3[_0x0cde('0x4a')];if(!fs[_0x0cde('0x4d')](_0x60fc94)){throw new db[(_0x0cde('0x50'))][(_0x0cde('0x51'))]('SquareRecording\x20not\x20found');}if(_0x4b35e3[_0x0cde('0x49')]){return _0x5aa49c['download'](_0x60fc94,_0x4b35e3[_0x0cde('0x49')]+path['extname'](_0x60fc94),function(){if(_0xa2ef97){fs['unlink'](_0x60fc94);}});}else{return _0x5aa49c[_0x0cde('0x52')](_0x60fc94,function(_0x3ca063){if(_0xa2ef97){fs['unlink'](_0x60fc94);}});}}})[_0x0cde('0x43')](function(_0x2f6b43){if(_0x2f6b43['message']===_0x0cde('0x53')){_0x5aa49c[_0x0cde('0x18')](0x194)[_0x0cde('0x54')](_0x0cde('0x55'));}else{return handleError(_0x5aa49c,null);}});};exports[_0x0cde('0x24')]=function(_0x61874f,_0x4acb92){return db[_0x0cde('0x28')][_0x0cde('0x46')]({'where':{'id':_0x61874f[_0x0cde('0x42')]['id']}})[_0x0cde('0x23')](function(_0x4afbeb){if(_[_0x0cde('0x56')](_0x4afbeb)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4afbeb;})['then'](function(_0x5e0e73){var _0x51f6b6=_0x5e0e73[_0x0cde('0x4a')];logger['info'](_0x0cde('0x57'),_0x51f6b6);if(!_[_0x0cde('0x56')](_0x5e0e73[_0x0cde('0x4a')])&&fs[_0x0cde('0x4d')](_0x51f6b6)){logger[_0x0cde('0x58')]('File:\x20\x22'+_0x51f6b6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0cde('0x59')](_0x51f6b6);}_0x51f6b6=_0x51f6b6+_0x0cde('0x5a');if(!_[_0x0cde('0x56')](_0x5e0e73[_0x0cde('0x4a')])&&fs[_0x0cde('0x4d')](_0x51f6b6)){logger[_0x0cde('0x58')]('File:\x20\x22'+_0x51f6b6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0cde('0x59')](_0x51f6b6);}return _0x5e0e73;})['then'](function(_0x27752d){if(!_0x27752d)throw new InternalError();return _0x27752d[_0x0cde('0x24')]();})[_0x0cde('0x23')](function(){_0x4acb92['status'](0xcc)[_0x0cde('0x19')]();})[_0x0cde('0x43')](handleError(_0x4acb92,null));}; \ No newline at end of file +var _0xb4a4=['length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','find','create','catch','update','body','download','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','SquareRecording','fieldName','type','model','query','filters','intersection','attributes','fields'];(function(_0x36b7e5,_0x4e0910){var _0x495fb7=function(_0x183656){while(--_0x183656){_0x36b7e5['push'](_0x36b7e5['shift']());}};_0x495fb7(++_0x4e0910);}(_0xb4a4,0xec));var _0x4b4a=function(_0x4abc14,_0x88acf7){_0x4abc14=_0x4abc14-0x0;var _0x1d0ad2=_0xb4a4[_0x4abc14];return _0x1d0ad2;};'use strict';var emlformat=require(_0x4b4a('0x0'));var rimraf=require(_0x4b4a('0x1'));var zipdir=require(_0x4b4a('0x2'));var jsonpatch=require(_0x4b4a('0x3'));var rp=require(_0x4b4a('0x4'));var moment=require('moment');var BPromise=require(_0x4b4a('0x5'));var Mustache=require(_0x4b4a('0x6'));var util=require(_0x4b4a('0x7'));var path=require(_0x4b4a('0x8'));var sox=require('sox');var csv=require(_0x4b4a('0x9'));var ejs=require(_0x4b4a('0xa'));var fs=require('fs');var fs_extra=require(_0x4b4a('0xb'));var _=require(_0x4b4a('0xc'));var squel=require('squel');var crypto=require(_0x4b4a('0xd'));var jsforce=require(_0x4b4a('0xe'));var deskjs=require(_0x4b4a('0xf'));var toCsv=require(_0x4b4a('0x9'));var querystring=require(_0x4b4a('0x10'));var Papa=require('papaparse');var Redis=require(_0x4b4a('0x11'));var authService=require(_0x4b4a('0x12'));var qs=require(_0x4b4a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b4a('0x14'));var logger=require(_0x4b4a('0x15'))('api');var utils=require(_0x4b4a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4b4a('0x17'));var db=require(_0x4b4a('0x18'))['db'];function respondWithStatusCode(_0x10cefc,_0x1354af){_0x1354af=_0x1354af||0xcc;return function(_0x370f7){if(_0x370f7){return _0x10cefc[_0x4b4a('0x19')](_0x1354af);}return _0x10cefc[_0x4b4a('0x1a')](_0x1354af)[_0x4b4a('0x1b')]();};}function respondWithResult(_0x4b2840,_0x243125){_0x243125=_0x243125||0xc8;return function(_0x172921){if(_0x172921){return _0x4b2840[_0x4b4a('0x1a')](_0x243125)[_0x4b4a('0x1c')](_0x172921);}};}function respondWithFilteredResult(_0x30165e,_0x193032){return function(_0x24157e){if(_0x24157e){var _0xc5d31=typeof _0x193032[_0x4b4a('0x1d')]==='undefined'&&typeof _0x193032['limit']==='undefined';var _0x2e94fa=_0x24157e[_0x4b4a('0x1e')];var _0x703622=_0xc5d31?0x0:_0x193032[_0x4b4a('0x1d')];var _0x1f3e32=_0xc5d31?_0x24157e[_0x4b4a('0x1e')]:_0x193032[_0x4b4a('0x1d')]+_0x193032['limit'];var _0x56eb38;if(_0x1f3e32>=_0x2e94fa){_0x1f3e32=_0x2e94fa;_0x56eb38=0xc8;}else{_0x56eb38=0xce;}_0x30165e['status'](_0x56eb38);return _0x30165e[_0x4b4a('0x1f')](_0x4b4a('0x20'),_0x703622+'-'+_0x1f3e32+'/'+_0x2e94fa)[_0x4b4a('0x1c')](_0x24157e);}return null;};}function patchUpdates(_0x3a0374){return function(_0x597116){try{jsonpatch[_0x4b4a('0x21')](_0x597116,_0x3a0374,!![]);}catch(_0x3392b3){return BPromise[_0x4b4a('0x22')](_0x3392b3);}return _0x597116[_0x4b4a('0x23')]();};}function saveUpdates(_0x4a6054,_0x3d8de9){return function(_0x4dfc5a){if(_0x4dfc5a){return _0x4dfc5a['update'](_0x4a6054)[_0x4b4a('0x24')](function(_0x1d223a){return _0x1d223a;});}return null;};}function removeEntity(_0x3aba26,_0x45544b){return function(_0x22b2a8){if(_0x22b2a8){return _0x22b2a8[_0x4b4a('0x25')]()[_0x4b4a('0x24')](function(){_0x3aba26['status'](0xcc)[_0x4b4a('0x1b')]();});}};}function handleEntityNotFound(_0x2a117e,_0x206d9b){return function(_0x444caf){if(!_0x444caf){_0x2a117e[_0x4b4a('0x19')](0x194);}return _0x444caf;};}function handleError(_0x3ef04d,_0x416388){_0x416388=_0x416388||0x1f4;return function(_0x13fe21){logger[_0x4b4a('0x26')](_0x13fe21['stack']);if(_0x13fe21[_0x4b4a('0x27')]){delete _0x13fe21[_0x4b4a('0x27')];}_0x3ef04d[_0x4b4a('0x1a')](_0x416388)[_0x4b4a('0x28')](_0x13fe21);};}exports[_0x4b4a('0x29')]=function(_0x38cf8d,_0x59d326){var _0x3484fb={},_0x1c248c={},_0xa09a4d={'count':0x0,'rows':[]};var _0x3eb277=_[_0x4b4a('0x2a')](db[_0x4b4a('0x2b')]['rawAttributes'],function(_0x25c657){return{'name':_0x25c657[_0x4b4a('0x2c')],'type':_0x25c657[_0x4b4a('0x2d')]['key']};});_0x1c248c[_0x4b4a('0x2e')]=_[_0x4b4a('0x2a')](_0x3eb277,_0x4b4a('0x27'));_0x1c248c[_0x4b4a('0x2f')]=_['keys'](_0x38cf8d[_0x4b4a('0x2f')]);_0x1c248c[_0x4b4a('0x30')]=_[_0x4b4a('0x31')](_0x1c248c[_0x4b4a('0x2e')],_0x1c248c['query']);_0x3484fb[_0x4b4a('0x32')]=_['intersection'](_0x1c248c[_0x4b4a('0x2e')],qs[_0x4b4a('0x33')](_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x33')]));_0x3484fb[_0x4b4a('0x32')]=_0x3484fb[_0x4b4a('0x32')][_0x4b4a('0x34')]?_0x3484fb['attributes']:_0x1c248c[_0x4b4a('0x2e')];if(!_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x35')](_0x4b4a('0x36'))){_0x3484fb[_0x4b4a('0x37')]=qs[_0x4b4a('0x37')](_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x37')]);_0x3484fb[_0x4b4a('0x1d')]=qs[_0x4b4a('0x1d')](_0x38cf8d[_0x4b4a('0x2f')]['offset']);}_0x3484fb['order']=qs['sort'](_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x38')]);_0x3484fb[_0x4b4a('0x39')]=qs['filters'](_[_0x4b4a('0x3a')](_0x38cf8d[_0x4b4a('0x2f')],_0x1c248c[_0x4b4a('0x30')]),_0x3eb277);if(_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x3b')]){_0x3484fb[_0x4b4a('0x39')]=_[_0x4b4a('0x3c')](_0x3484fb[_0x4b4a('0x39')],{'$or':_['map'](_0x3eb277,function(_0xcd16e6){if(_0xcd16e6[_0x4b4a('0x2d')]!==_0x4b4a('0x3d')){var _0x5baf85={};_0x5baf85[_0xcd16e6[_0x4b4a('0x27')]]={'$like':'%'+_0x38cf8d['query'][_0x4b4a('0x3b')]+'%'};return _0x5baf85;}})});}_0x3484fb=_[_0x4b4a('0x3c')]({},_0x3484fb,_0x38cf8d[_0x4b4a('0x3e')]);var _0x505849={'where':_0x3484fb[_0x4b4a('0x39')]};return db[_0x4b4a('0x2b')][_0x4b4a('0x1e')](_0x505849)[_0x4b4a('0x24')](function(_0x60ce12){_0xa09a4d[_0x4b4a('0x1e')]=_0x60ce12;if(_0x38cf8d[_0x4b4a('0x2f')][_0x4b4a('0x3f')]){_0x3484fb[_0x4b4a('0x40')]=[{'all':!![]}];}return db[_0x4b4a('0x2b')][_0x4b4a('0x41')](_0x3484fb);})[_0x4b4a('0x24')](function(_0x2d2f21){_0xa09a4d['rows']=_0x2d2f21;return _0xa09a4d;})['then'](respondWithFilteredResult(_0x59d326,_0x3484fb))['catch'](handleError(_0x59d326,null));};exports[_0x4b4a('0x42')]=function(_0x508b22,_0x327ba0){var _0x52c5c7={'raw':!![],'where':{'id':_0x508b22[_0x4b4a('0x43')]['id']}},_0x953950={};_0x953950['model']=_['keys'](db[_0x4b4a('0x2b')]['rawAttributes']);_0x953950[_0x4b4a('0x2f')]=_[_0x4b4a('0x44')](_0x508b22[_0x4b4a('0x2f')]);_0x953950[_0x4b4a('0x30')]=_[_0x4b4a('0x31')](_0x953950[_0x4b4a('0x2e')],_0x953950[_0x4b4a('0x2f')]);_0x52c5c7[_0x4b4a('0x32')]=_[_0x4b4a('0x31')](_0x953950['model'],qs[_0x4b4a('0x33')](_0x508b22[_0x4b4a('0x2f')][_0x4b4a('0x33')]));_0x52c5c7[_0x4b4a('0x32')]=_0x52c5c7[_0x4b4a('0x32')]['length']?_0x52c5c7[_0x4b4a('0x32')]:_0x953950['model'];if(_0x508b22['query']['includeAll']){_0x52c5c7[_0x4b4a('0x40')]=[{'all':!![]}];}_0x52c5c7=_['merge']({},_0x52c5c7,_0x508b22['options']);return db[_0x4b4a('0x2b')][_0x4b4a('0x45')](_0x52c5c7)['then'](handleEntityNotFound(_0x327ba0,null))[_0x4b4a('0x24')](respondWithResult(_0x327ba0,null))['catch'](handleError(_0x327ba0,null));};exports[_0x4b4a('0x46')]=function(_0x373d32,_0x5b654e){return db[_0x4b4a('0x2b')][_0x4b4a('0x46')](_0x373d32['body'],{})[_0x4b4a('0x24')](respondWithResult(_0x5b654e,0xc9))[_0x4b4a('0x47')](handleError(_0x5b654e,null));};exports[_0x4b4a('0x48')]=function(_0x4584b0,_0x4d4dc6){if(_0x4584b0[_0x4b4a('0x49')]['id']){delete _0x4584b0['body']['id'];}return db[_0x4b4a('0x2b')][_0x4b4a('0x45')]({'where':{'id':_0x4584b0[_0x4b4a('0x43')]['id']}})[_0x4b4a('0x24')](handleEntityNotFound(_0x4d4dc6,null))[_0x4b4a('0x24')](saveUpdates(_0x4584b0[_0x4b4a('0x49')],null))[_0x4b4a('0x24')](respondWithResult(_0x4d4dc6,null))['catch'](handleError(_0x4d4dc6,null));};exports[_0x4b4a('0x4a')]=function(_0x22278d,_0x150aa3,_0x475498){var _0x25c9c3=require('../../components/encryptor');var _0x4a4690=![];var _0x26ec17={};if(_0x22278d[_0x4b4a('0x2f')][_0x4b4a('0x2d')]&&_0x22278d[_0x4b4a('0x2f')][_0x4b4a('0x2d')]===_0x4b4a('0x4b')){_0x26ec17[_0x4b4a('0x4b')]=_0x22278d['params']['id'];}else{_0x26ec17['id']=_0x22278d[_0x4b4a('0x43')]['id'];}return db[_0x4b4a('0x2b')][_0x4b4a('0x45')]({'where':_0x26ec17,'attributes':['id',_0x4b4a('0x4c'),'filename'],'raw':!![]})[_0x4b4a('0x24')](handleEntityNotFound(_0x150aa3,null))[_0x4b4a('0x24')](function(_0x5b3569){if(_0x5b3569){var _0x4d67f0=_0x5b3569[_0x4b4a('0x4c')];var _0x338390=util[_0x4b4a('0x4d')](_0x4b4a('0x4e'),_0x4d67f0);if(fs[_0x4b4a('0x4f')](_0x338390)){_0x4a4690=!![];return _0x25c9c3[_0x4b4a('0x50')](_0x338390,_0x4d67f0,config[_0x4b4a('0x51')][_0x4b4a('0x52')])['then'](function(){return _0x5b3569;});}return _0x5b3569;}})[_0x4b4a('0x24')](function(_0x5b866a){if(_0x5b866a){var _0x4a9420=_0x5b866a['savePath'];if(!fs[_0x4b4a('0x4f')](_0x4a9420)){throw new db['Sequelize']['ValidationError'](_0x4b4a('0x53'));}if(_0x5b866a[_0x4b4a('0x54')]){return _0x150aa3[_0x4b4a('0x4a')](_0x4a9420,_0x5b866a['filename']+path[_0x4b4a('0x55')](_0x4a9420),function(){if(_0x4a4690){fs[_0x4b4a('0x56')](_0x4a9420);}});}else{return _0x150aa3[_0x4b4a('0x4a')](_0x4a9420,function(_0x2409b7){if(_0x4a4690){fs[_0x4b4a('0x56')](_0x4a9420);}});}}})[_0x4b4a('0x47')](function(_0x13a2d7){if(_0x13a2d7[_0x4b4a('0x57')]==='SquareRecording\x20not\x20found'){_0x150aa3[_0x4b4a('0x1a')](0x194)[_0x4b4a('0x28')](_0x4b4a('0x58'));}else{return handleError(_0x150aa3,null);}});};exports[_0x4b4a('0x25')]=function(_0x339a83,_0x37e1f4){return db[_0x4b4a('0x2b')][_0x4b4a('0x45')]({'where':{'id':_0x339a83[_0x4b4a('0x43')]['id']}})[_0x4b4a('0x24')](function(_0x2f0869){if(_['isNil'](_0x2f0869)){throw new ReferenceError(_0x4b4a('0x59'));}return _0x2f0869;})[_0x4b4a('0x24')](function(_0x11f350){var _0x2a8b47=_0x11f350['savePath'];logger[_0x4b4a('0x5a')]('cancellazione\x20fisica\x20documento\x20%s',_0x2a8b47);if(!_['isNil'](_0x11f350[_0x4b4a('0x4c')])&&fs[_0x4b4a('0x4f')](_0x2a8b47)){logger[_0x4b4a('0x5a')](_0x4b4a('0x5b')+_0x2a8b47+_0x4b4a('0x5c'));fs[_0x4b4a('0x5d')](_0x2a8b47);}_0x2a8b47=_0x2a8b47+_0x4b4a('0x5e');if(!_[_0x4b4a('0x5f')](_0x11f350[_0x4b4a('0x4c')])&&fs[_0x4b4a('0x4f')](_0x2a8b47)){logger[_0x4b4a('0x5a')]('File:\x20\x22'+_0x2a8b47+_0x4b4a('0x5c'));fs['unlinkSync'](_0x2a8b47);}return _0x11f350;})['then'](function(_0x2b1414){if(!_0x2b1414)throw new InternalError();return _0x2b1414['destroy']();})[_0x4b4a('0x24')](function(){_0x37e1f4[_0x4b4a('0x1a')](0xcc)[_0x4b4a('0x1b')]();})[_0x4b4a('0x47')](handleError(_0x37e1f4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 594e669..580cd30 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 _0xb5f3=['exports','define','SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./squareRecording.attributes'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xb5f3,0x137));var _0x3b5f=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xb5f3[_0x32d457];return _0x338386;};'use strict';var _=require(_0x3b5f('0x0'));var util=require(_0x3b5f('0x1'));var logger=require(_0x3b5f('0x2'))('api');var moment=require(_0x3b5f('0x3'));var BPromise=require(_0x3b5f('0x4'));var rp=require(_0x3b5f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b5f('0x6'));var attributes=require(_0x3b5f('0x7'));module[_0x3b5f('0x8')]=function(_0x42d102,_0x55c7b4){return _0x42d102[_0x3b5f('0x9')](_0x3b5f('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9505=['request-promise','path','./squareRecording.attributes','exports','square_recordings','lodash','util','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9505,0x1e5));var _0x5950=function(_0x272b22,_0x421728){_0x272b22=_0x272b22-0x0;var _0x1b7b09=_0x9505[_0x272b22];return _0x1b7b09;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var logger=require('../../config/logger')(_0x5950('0x2'));var moment=require(_0x5950('0x3'));var BPromise=require(_0x5950('0x4'));var rp=require(_0x5950('0x5'));var fs=require('fs');var path=require(_0x5950('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5950('0x7'));module[_0x5950('0x8')]=function(_0x3ac153,_0x3a5973){return _0x3ac153['define']('SquareRecording',attributes,{'tableName':_0x5950('0x9'),'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 f68212f..b88aa7a 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 _0x5b11=['rpc','../../config/environment','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareRecording,\x20%s,\x20%s','message','catch','create','body','options','CreateSquareRecording','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x162efc,_0x9244b7){var _0x12ca3d=function(_0x57ce4a){while(--_0x57ce4a){_0x162efc['push'](_0x162efc['shift']());}};_0x12ca3d(++_0x9244b7);}(_0x5b11,0x1bb));var _0x15b1=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5b11[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x15b1('0x0'));var util=require(_0x15b1('0x1'));var moment=require('moment');var BPromise=require(_0x15b1('0x2'));var rs=require(_0x15b1('0x3'));var fs=require('fs');var Redis=require(_0x15b1('0x4'));var db=require(_0x15b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15b1('0x6'))(_0x15b1('0x7'));var config=require(_0x15b1('0x8'));var jayson=require(_0x15b1('0x9'));var client=jayson[_0x15b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d71dc,_0x39e50d,_0x345aa1){return new BPromise(function(_0x3251bb,_0x18dca3){return client['request'](_0x1d71dc,_0x345aa1)[_0x15b1('0xb')](function(_0x33d3cd){logger[_0x15b1('0xc')]('SquareRecording,\x20%s,\x20%s',_0x39e50d,'request\x20sent');logger['debug'](_0x15b1('0xd'),_0x39e50d,_0x15b1('0xe'),JSON[_0x15b1('0xf')](_0x33d3cd));if(_0x33d3cd['error']){if(_0x33d3cd[_0x15b1('0x10')]['code']===0x1f4){logger[_0x15b1('0x10')](_0x15b1('0x11'),_0x39e50d,_0x33d3cd[_0x15b1('0x10')]['message']);return _0x18dca3(_0x33d3cd[_0x15b1('0x10')][_0x15b1('0x12')]);}logger[_0x15b1('0x10')](_0x15b1('0x11'),_0x39e50d,_0x33d3cd[_0x15b1('0x10')][_0x15b1('0x12')]);return _0x3251bb(_0x33d3cd[_0x15b1('0x10')][_0x15b1('0x12')]);}else{logger[_0x15b1('0xc')](_0x15b1('0x11'),_0x39e50d,_0x15b1('0xe'));_0x3251bb(_0x33d3cd['result'][_0x15b1('0x12')]);}})[_0x15b1('0x13')](function(_0x559359){logger['error'](_0x15b1('0x11'),_0x39e50d,_0x559359);_0x18dca3(_0x559359);});});}exports['CreateSquareRecording']=function(_0x51880f){var _0x16f7cf=this;return new Promise(function(_0x7773db,_0x395053){return db['SquareRecording'][_0x15b1('0x14')](_0x51880f[_0x15b1('0x15')],{'raw':_0x51880f[_0x15b1('0x16')]?_0x51880f['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x27fd14){logger[_0x15b1('0xc')](_0x15b1('0x17'),_0x51880f);logger[_0x15b1('0x18')]('CreateSquareRecording',_0x51880f,JSON[_0x15b1('0xf')](_0x27fd14));_0x7773db(_0x27fd14);})['catch'](function(_0x3d7891){logger[_0x15b1('0x10')](_0x15b1('0x17'),_0x3d7891[_0x15b1('0x12')],_0x51880f);_0x395053(_0x16f7cf[_0x15b1('0x10')](0x1f4,_0x3d7891['message']));});});}; \ No newline at end of file +var _0xb735=['then','CreateSquareRecording','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','SquareRecording','create','body','options','raw'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb735,0x152));var _0x5b73=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xb735[_0x46428c];return _0x16a677;};'use strict';var _=require('lodash');var util=require(_0x5b73('0x0'));var moment=require(_0x5b73('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b73('0x2'));var fs=require('fs');var Redis=require(_0x5b73('0x3'));var db=require(_0x5b73('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b73('0x5'))(_0x5b73('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b73('0x7'));var client=jayson[_0x5b73('0x8')][_0x5b73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45071e,_0x13887e,_0x48ca64){return new BPromise(function(_0x41ae6f,_0x469a29){return client[_0x5b73('0xa')](_0x45071e,_0x48ca64)['then'](function(_0x51c8a8){logger['info'](_0x5b73('0xb'),_0x13887e,'request\x20sent');logger[_0x5b73('0xc')](_0x5b73('0xd'),_0x13887e,_0x5b73('0xe'),JSON[_0x5b73('0xf')](_0x51c8a8));if(_0x51c8a8[_0x5b73('0x10')]){if(_0x51c8a8[_0x5b73('0x10')][_0x5b73('0x11')]===0x1f4){logger[_0x5b73('0x10')](_0x5b73('0xb'),_0x13887e,_0x51c8a8[_0x5b73('0x10')][_0x5b73('0x12')]);return _0x469a29(_0x51c8a8[_0x5b73('0x10')][_0x5b73('0x12')]);}logger[_0x5b73('0x10')](_0x5b73('0xb'),_0x13887e,_0x51c8a8[_0x5b73('0x10')][_0x5b73('0x12')]);return _0x41ae6f(_0x51c8a8[_0x5b73('0x10')]['message']);}else{logger[_0x5b73('0x13')](_0x5b73('0xb'),_0x13887e,'request\x20sent');_0x41ae6f(_0x51c8a8['result'][_0x5b73('0x12')]);}})[_0x5b73('0x14')](function(_0x35bb44){logger[_0x5b73('0x10')]('SquareRecording,\x20%s,\x20%s',_0x13887e,_0x35bb44);_0x469a29(_0x35bb44);});});}exports['CreateSquareRecording']=function(_0x2596f4){var _0x2f1451=this;return new Promise(function(_0x2e9981,_0x474c23){return db[_0x5b73('0x15')][_0x5b73('0x16')](_0x2596f4[_0x5b73('0x17')],{'raw':_0x2596f4['options']?_0x2596f4[_0x5b73('0x18')][_0x5b73('0x19')]===undefined?!![]:![]:!![]})[_0x5b73('0x1a')](function(_0x34b7b2){logger[_0x5b73('0x13')](_0x5b73('0x1b'),_0x2596f4);logger['debug'](_0x5b73('0x1b'),_0x2596f4,JSON[_0x5b73('0xf')](_0x34b7b2));_0x2e9981(_0x34b7b2);})[_0x5b73('0x14')](function(_0x995787){logger[_0x5b73('0x10')]('CreateSquareRecording',_0x995787['message'],_0x2596f4);_0x474c23(_0x2f1451[_0x5b73('0x10')](0x1f4,_0x995787[_0x5b73('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 12748c2..b993dd4 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x34b225,_0x5f0125){var _0x471f43=function(_0x2250a9){while(--_0x2250a9){_0x34b225['push'](_0x34b225['shift']());}};_0x471f43(++_0x5f0125);}(_0xe706,0xa3));var _0x6e70=function(_0x132787,_0x49aebb){_0x132787=_0x132787-0x0;var _0x281428=_0xe706[_0x132787];return _0x281428;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b4cf9,_0xed22d){var _0x33041c=function(_0x18c45d){while(--_0x18c45d){_0x2b4cf9['push'](_0x2b4cf9['shift']());}};_0x33041c(++_0xed22d);}(_0xb10b,0x12a));var _0xbb10=function(_0x101383,_0x5bd543){_0x101383=_0x101383-0x0;var _0x46cfe9=_0xb10b[_0x101383];return _0x46cfe9;};'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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index d9705f6..9110568 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 _0x4c4a=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2e68db,_0x275d04){var _0x12df4c=function(_0x1b6701){while(--_0x1b6701){_0x2e68db['push'](_0x2e68db['shift']());}};_0x12df4c(++_0x275d04);}(_0x4c4a,0x1c6));var _0xa4c4=function(_0x57f6a3,_0x233306){_0x57f6a3=_0x57f6a3-0x0;var _0x571cdf=_0x4c4a[_0x57f6a3];return _0x571cdf;};'use strict';var Sequelize=require(_0xa4c4('0x0'));module[_0xa4c4('0x1')]={'network':{'type':Sequelize[_0xa4c4('0x2')]},'network_script':{'type':Sequelize[_0xa4c4('0x2')]},'request':{'type':Sequelize[_0xa4c4('0x2')]},'channel':{'type':Sequelize[_0xa4c4('0x2')]},'language':{'type':Sequelize[_0xa4c4('0x2')]},'type':{'type':Sequelize[_0xa4c4('0x2')]},'uniqueid':{'type':Sequelize[_0xa4c4('0x2')]},'version':{'type':Sequelize[_0xa4c4('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa4c4('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xa4c4('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xa4c4('0x2')]},'rdnis':{'type':Sequelize[_0xa4c4('0x2')]},'context':{'type':Sequelize[_0xa4c4('0x2')]},'extension':{'type':Sequelize[_0xa4c4('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa4c4('0x2')]},'accountcode':{'type':Sequelize[_0xa4c4('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xa4c4('0x2')]},'joinAt':{'type':Sequelize[_0xa4c4('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa4c4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xfef9=['exports','STRING','DATE','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfef9,0x9f));var _0x9fef=function(_0x121350,_0x361f4d){_0x121350=_0x121350-0x0;var _0x2e21c7=_0xfef9[_0x121350];return _0x2e21c7;};'use strict';var Sequelize=require(_0x9fef('0x0'));module[_0x9fef('0x1')]={'network':{'type':Sequelize[_0x9fef('0x2')]},'network_script':{'type':Sequelize[_0x9fef('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9fef('0x2')]},'language':{'type':Sequelize[_0x9fef('0x2')]},'type':{'type':Sequelize[_0x9fef('0x2')]},'uniqueid':{'type':Sequelize[_0x9fef('0x2')]},'version':{'type':Sequelize[_0x9fef('0x2')]},'callerid':{'type':Sequelize[_0x9fef('0x2')]},'calleridname':{'type':Sequelize[_0x9fef('0x2')]},'callingpres':{'type':Sequelize[_0x9fef('0x2')]},'callingani2':{'type':Sequelize[_0x9fef('0x2')]},'callington':{'type':Sequelize[_0x9fef('0x2')]},'callingtns':{'type':Sequelize[_0x9fef('0x2')]},'dnid':{'type':Sequelize[_0x9fef('0x2')]},'rdnis':{'type':Sequelize[_0x9fef('0x2')]},'context':{'type':Sequelize[_0x9fef('0x2')]},'extension':{'type':Sequelize[_0x9fef('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x9fef('0x2')]},'accountcode':{'type':Sequelize[_0x9fef('0x2')]},'threadid':{'type':Sequelize[_0x9fef('0x2')]},'project_name':{'type':Sequelize[_0x9fef('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9fef('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 807e21c..4abbd0a 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 _0xc9fb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','offset','count','set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','index','SquareReport','rawAttributes','type','key','model','map','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc9fb,0x1ac));var _0xbc9f=function(_0xcca33c,_0x35cbf3){_0xcca33c=_0xcca33c-0x0;var _0x31cf8a=_0xc9fb[_0xcca33c];return _0x31cf8a;};'use strict';var emlformat=require(_0xbc9f('0x0'));var rimraf=require(_0xbc9f('0x1'));var zipdir=require(_0xbc9f('0x2'));var jsonpatch=require(_0xbc9f('0x3'));var rp=require(_0xbc9f('0x4'));var moment=require(_0xbc9f('0x5'));var BPromise=require(_0xbc9f('0x6'));var Mustache=require(_0xbc9f('0x7'));var util=require('util');var path=require(_0xbc9f('0x8'));var sox=require(_0xbc9f('0x9'));var csv=require(_0xbc9f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc9f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbc9f('0xc'));var deskjs=require(_0xbc9f('0xd'));var toCsv=require(_0xbc9f('0xa'));var querystring=require(_0xbc9f('0xe'));var Papa=require(_0xbc9f('0xf'));var Redis=require(_0xbc9f('0x10'));var authService=require(_0xbc9f('0x11'));var qs=require(_0xbc9f('0x12'));var as=require(_0xbc9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc9f('0x14'))(_0xbc9f('0x15'));var utils=require('../../config/utils');var config=require(_0xbc9f('0x16'));var licenseUtil=require(_0xbc9f('0x17'));var db=require(_0xbc9f('0x18'))['db'];function respondWithStatusCode(_0x562c07,_0x449e74){_0x449e74=_0x449e74||0xcc;return function(_0x193d18){if(_0x193d18){return _0x562c07['sendStatus'](_0x449e74);}return _0x562c07[_0xbc9f('0x19')](_0x449e74)[_0xbc9f('0x1a')]();};}function respondWithResult(_0xd1e3,_0xe57931){_0xe57931=_0xe57931||0xc8;return function(_0x207d49){if(_0x207d49){return _0xd1e3[_0xbc9f('0x19')](_0xe57931)[_0xbc9f('0x1b')](_0x207d49);}};}function respondWithFilteredResult(_0x31f1c7,_0x4f175b){return function(_0x933756){if(_0x933756){var _0x41684c=typeof _0x4f175b['offset']==='undefined'&&typeof _0x4f175b[_0xbc9f('0x1c')]==='undefined';var _0x1a718d=_0x933756['count'];var _0x26706f=_0x41684c?0x0:_0x4f175b[_0xbc9f('0x1d')];var _0x37299b=_0x41684c?_0x933756[_0xbc9f('0x1e')]:_0x4f175b['offset']+_0x4f175b[_0xbc9f('0x1c')];var _0x527243;if(_0x37299b>=_0x1a718d){_0x37299b=_0x1a718d;_0x527243=0xc8;}else{_0x527243=0xce;}_0x31f1c7['status'](_0x527243);return _0x31f1c7[_0xbc9f('0x1f')](_0xbc9f('0x20'),_0x26706f+'-'+_0x37299b+'/'+_0x1a718d)[_0xbc9f('0x1b')](_0x933756);}return null;};}function patchUpdates(_0x91c2a4){return function(_0x336a79){try{jsonpatch[_0xbc9f('0x21')](_0x336a79,_0x91c2a4,!![]);}catch(_0x2fd4b9){return BPromise[_0xbc9f('0x22')](_0x2fd4b9);}return _0x336a79['save']();};}function saveUpdates(_0x23fd86,_0x12c6c){return function(_0xcd0881){if(_0xcd0881){return _0xcd0881['update'](_0x23fd86)[_0xbc9f('0x23')](function(_0xfeb54a){return _0xfeb54a;});}return null;};}function removeEntity(_0x5d9bc5,_0x118678){return function(_0x145b2b){if(_0x145b2b){return _0x145b2b[_0xbc9f('0x24')]()['then'](function(){_0x5d9bc5[_0xbc9f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x573702,_0x279eb6){return function(_0x43b0ba){if(!_0x43b0ba){_0x573702[_0xbc9f('0x25')](0x194);}return _0x43b0ba;};}function handleError(_0x50e922,_0x308022){_0x308022=_0x308022||0x1f4;return function(_0x40beb7){logger[_0xbc9f('0x26')](_0x40beb7[_0xbc9f('0x27')]);if(_0x40beb7['name']){delete _0x40beb7['name'];}_0x50e922[_0xbc9f('0x19')](_0x308022)['send'](_0x40beb7);};}exports[_0xbc9f('0x28')]=function(_0x153096,_0x4cbf10){var _0x4a0b7d={},_0x5c2e15={},_0x37143e={'count':0x0,'rows':[]};var _0x443429=_['map'](db[_0xbc9f('0x29')][_0xbc9f('0x2a')],function(_0x782299){return{'name':_0x782299['fieldName'],'type':_0x782299[_0xbc9f('0x2b')][_0xbc9f('0x2c')]};});_0x5c2e15[_0xbc9f('0x2d')]=_[_0xbc9f('0x2e')](_0x443429,'name');_0x5c2e15['query']=_['keys'](_0x153096['query']);_0x5c2e15[_0xbc9f('0x2f')]=_[_0xbc9f('0x30')](_0x5c2e15['model'],_0x5c2e15['query']);_0x4a0b7d[_0xbc9f('0x31')]=_[_0xbc9f('0x30')](_0x5c2e15[_0xbc9f('0x2d')],qs['fields'](_0x153096['query'][_0xbc9f('0x32')]));_0x4a0b7d[_0xbc9f('0x31')]=_0x4a0b7d[_0xbc9f('0x31')][_0xbc9f('0x33')]?_0x4a0b7d[_0xbc9f('0x31')]:_0x5c2e15[_0xbc9f('0x2d')];if(!_0x153096[_0xbc9f('0x34')][_0xbc9f('0x35')](_0xbc9f('0x36'))){_0x4a0b7d[_0xbc9f('0x1c')]=qs[_0xbc9f('0x1c')](_0x153096[_0xbc9f('0x34')][_0xbc9f('0x1c')]);_0x4a0b7d[_0xbc9f('0x1d')]=qs[_0xbc9f('0x1d')](_0x153096[_0xbc9f('0x34')][_0xbc9f('0x1d')]);}_0x4a0b7d[_0xbc9f('0x37')]=qs[_0xbc9f('0x38')](_0x153096['query']['sort']);_0x4a0b7d['where']=qs['filters'](_[_0xbc9f('0x39')](_0x153096[_0xbc9f('0x34')],_0x5c2e15[_0xbc9f('0x2f')]),_0x443429);if(_0x153096[_0xbc9f('0x34')][_0xbc9f('0x3a')]){_0x4a0b7d[_0xbc9f('0x3b')]=_[_0xbc9f('0x3c')](_0x4a0b7d['where'],{'$or':_[_0xbc9f('0x2e')](_0x443429,function(_0x5be8cb){if(_0x5be8cb[_0xbc9f('0x2b')]!=='VIRTUAL'){var _0x1e18c7={};_0x1e18c7[_0x5be8cb[_0xbc9f('0x3d')]]={'$like':'%'+_0x153096[_0xbc9f('0x34')][_0xbc9f('0x3a')]+'%'};return _0x1e18c7;}})});}_0x4a0b7d=_[_0xbc9f('0x3c')]({},_0x4a0b7d,_0x153096['options']);var _0x5360bd={'where':_0x4a0b7d['where']};return db[_0xbc9f('0x29')]['count'](_0x5360bd)[_0xbc9f('0x23')](function(_0x5230d3){_0x37143e[_0xbc9f('0x1e')]=_0x5230d3;if(_0x153096[_0xbc9f('0x34')][_0xbc9f('0x3e')]){_0x4a0b7d[_0xbc9f('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0xbc9f('0x40')](_0x4a0b7d);})[_0xbc9f('0x23')](function(_0x5de635){_0x37143e[_0xbc9f('0x41')]=_0x5de635;return _0x37143e;})[_0xbc9f('0x23')](respondWithFilteredResult(_0x4cbf10,_0x4a0b7d))[_0xbc9f('0x42')](handleError(_0x4cbf10,null));};exports[_0xbc9f('0x43')]=function(_0x5ee01e,_0x2e92f3){var _0x52e8ca={'raw':!![],'where':{'id':_0x5ee01e[_0xbc9f('0x44')]['id']}},_0x197bf2={};_0x197bf2[_0xbc9f('0x2d')]=_[_0xbc9f('0x45')](db[_0xbc9f('0x29')]['rawAttributes']);_0x197bf2['query']=_['keys'](_0x5ee01e[_0xbc9f('0x34')]);_0x197bf2[_0xbc9f('0x2f')]=_[_0xbc9f('0x30')](_0x197bf2[_0xbc9f('0x2d')],_0x197bf2['query']);_0x52e8ca['attributes']=_[_0xbc9f('0x30')](_0x197bf2[_0xbc9f('0x2d')],qs[_0xbc9f('0x32')](_0x5ee01e[_0xbc9f('0x34')][_0xbc9f('0x32')]));_0x52e8ca[_0xbc9f('0x31')]=_0x52e8ca[_0xbc9f('0x31')][_0xbc9f('0x33')]?_0x52e8ca[_0xbc9f('0x31')]:_0x197bf2[_0xbc9f('0x2d')];if(_0x5ee01e[_0xbc9f('0x34')][_0xbc9f('0x3e')]){_0x52e8ca[_0xbc9f('0x3f')]=[{'all':!![]}];}_0x52e8ca=_[_0xbc9f('0x3c')]({},_0x52e8ca,_0x5ee01e['options']);return db[_0xbc9f('0x29')][_0xbc9f('0x46')](_0x52e8ca)['then'](handleEntityNotFound(_0x2e92f3,null))[_0xbc9f('0x23')](respondWithResult(_0x2e92f3,null))[_0xbc9f('0x42')](handleError(_0x2e92f3,null));};exports[_0xbc9f('0x47')]=function(_0x289ae7,_0x447780){return db[_0xbc9f('0x29')][_0xbc9f('0x47')](_0x289ae7[_0xbc9f('0x48')],{})[_0xbc9f('0x23')](respondWithResult(_0x447780,0xc9))['catch'](handleError(_0x447780,null));};exports['update']=function(_0x30207d,_0x468013){if(_0x30207d['body']['id']){delete _0x30207d[_0xbc9f('0x48')]['id'];}return db[_0xbc9f('0x29')][_0xbc9f('0x46')]({'where':{'id':_0x30207d[_0xbc9f('0x44')]['id']}})['then'](handleEntityNotFound(_0x468013,null))[_0xbc9f('0x23')](saveUpdates(_0x30207d[_0xbc9f('0x48')],null))[_0xbc9f('0x23')](respondWithResult(_0x468013,null))[_0xbc9f('0x42')](handleError(_0x468013,null));};exports[_0xbc9f('0x24')]=function(_0x2b70c9,_0x219a7b){return db[_0xbc9f('0x29')][_0xbc9f('0x46')]({'where':{'id':_0x2b70c9['params']['id']}})[_0xbc9f('0x23')](handleEntityNotFound(_0x219a7b,null))[_0xbc9f('0x23')](removeEntity(_0x219a7b,null))[_0xbc9f('0x42')](handleError(_0x219a7b,null));};exports[_0xbc9f('0x49')]=function(_0x3ac438,_0x1bf2e8){return db[_0xbc9f('0x29')][_0xbc9f('0x49')]()[_0xbc9f('0x23')](respondWithResult(_0x1bf2e8,null))[_0xbc9f('0x42')](handleError(_0x1bf2e8,null));}; \ No newline at end of file +var _0xef36=['rows','params','length','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x3e8426,_0x49a842){var _0x874e2e=function(_0x3b3699){while(--_0x3b3699){_0x3e8426['push'](_0x3e8426['shift']());}};_0x874e2e(++_0x49a842);}(_0xef36,0x134));var _0x6ef3=function(_0x45cab8,_0x1e77f1){_0x45cab8=_0x45cab8-0x0;var _0x2252c5=_0xef36[_0x45cab8];return _0x2252c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ef3('0x0'));var zipdir=require(_0x6ef3('0x1'));var jsonpatch=require(_0x6ef3('0x2'));var rp=require(_0x6ef3('0x3'));var moment=require(_0x6ef3('0x4'));var BPromise=require(_0x6ef3('0x5'));var Mustache=require('mustache');var util=require(_0x6ef3('0x6'));var path=require('path');var sox=require(_0x6ef3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ef3('0x8'));var _=require(_0x6ef3('0x9'));var squel=require(_0x6ef3('0xa'));var crypto=require(_0x6ef3('0xb'));var jsforce=require(_0x6ef3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ef3('0xd'));var querystring=require(_0x6ef3('0xe'));var Papa=require(_0x6ef3('0xf'));var Redis=require('ioredis');var authService=require(_0x6ef3('0x10'));var qs=require(_0x6ef3('0x11'));var as=require(_0x6ef3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef3('0x13'))(_0x6ef3('0x14'));var utils=require(_0x6ef3('0x15'));var config=require(_0x6ef3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ef3('0x17'))['db'];function respondWithStatusCode(_0x1cd6e6,_0x332b60){_0x332b60=_0x332b60||0xcc;return function(_0x56ce39){if(_0x56ce39){return _0x1cd6e6[_0x6ef3('0x18')](_0x332b60);}return _0x1cd6e6[_0x6ef3('0x19')](_0x332b60)[_0x6ef3('0x1a')]();};}function respondWithResult(_0xe5b390,_0x490372){_0x490372=_0x490372||0xc8;return function(_0x3316c2){if(_0x3316c2){return _0xe5b390[_0x6ef3('0x19')](_0x490372)['json'](_0x3316c2);}};}function respondWithFilteredResult(_0x161189,_0x5457ae){return function(_0x19453d){if(_0x19453d){var _0x55e10d=typeof _0x5457ae[_0x6ef3('0x1b')]===_0x6ef3('0x1c')&&typeof _0x5457ae['limit']==='undefined';var _0x23ab78=_0x19453d[_0x6ef3('0x1d')];var _0x36c99c=_0x55e10d?0x0:_0x5457ae[_0x6ef3('0x1b')];var _0x49e0c9=_0x55e10d?_0x19453d[_0x6ef3('0x1d')]:_0x5457ae[_0x6ef3('0x1b')]+_0x5457ae[_0x6ef3('0x1e')];var _0x2d50d2;if(_0x49e0c9>=_0x23ab78){_0x49e0c9=_0x23ab78;_0x2d50d2=0xc8;}else{_0x2d50d2=0xce;}_0x161189['status'](_0x2d50d2);return _0x161189[_0x6ef3('0x1f')](_0x6ef3('0x20'),_0x36c99c+'-'+_0x49e0c9+'/'+_0x23ab78)[_0x6ef3('0x21')](_0x19453d);}return null;};}function patchUpdates(_0x1f3d2b){return function(_0x1f51ee){try{jsonpatch['apply'](_0x1f51ee,_0x1f3d2b,!![]);}catch(_0x5ad0c4){return BPromise[_0x6ef3('0x22')](_0x5ad0c4);}return _0x1f51ee[_0x6ef3('0x23')]();};}function saveUpdates(_0x2c97e7,_0x17af19){return function(_0x226a20){if(_0x226a20){return _0x226a20[_0x6ef3('0x24')](_0x2c97e7)['then'](function(_0x59abd8){return _0x59abd8;});}return null;};}function removeEntity(_0x646a5d,_0x5139ff){return function(_0x4fea8b){if(_0x4fea8b){return _0x4fea8b['destroy']()[_0x6ef3('0x25')](function(){_0x646a5d[_0x6ef3('0x19')](0xcc)[_0x6ef3('0x1a')]();});}};}function handleEntityNotFound(_0x1c4afc,_0x43beb6){return function(_0x2b8fc8){if(!_0x2b8fc8){_0x1c4afc[_0x6ef3('0x18')](0x194);}return _0x2b8fc8;};}function handleError(_0x1db330,_0x1d46b4){_0x1d46b4=_0x1d46b4||0x1f4;return function(_0x4cbb9c){logger[_0x6ef3('0x26')](_0x4cbb9c[_0x6ef3('0x27')]);if(_0x4cbb9c[_0x6ef3('0x28')]){delete _0x4cbb9c[_0x6ef3('0x28')];}_0x1db330[_0x6ef3('0x19')](_0x1d46b4)[_0x6ef3('0x29')](_0x4cbb9c);};}exports[_0x6ef3('0x2a')]=function(_0x5d87ab,_0x5b0002){var _0x5c1a25={},_0x433d90={},_0x26d5ca={'count':0x0,'rows':[]};var _0x43ef20=_[_0x6ef3('0x2b')](db[_0x6ef3('0x2c')][_0x6ef3('0x2d')],function(_0xabf60b){return{'name':_0xabf60b[_0x6ef3('0x2e')],'type':_0xabf60b[_0x6ef3('0x2f')][_0x6ef3('0x30')]};});_0x433d90[_0x6ef3('0x31')]=_[_0x6ef3('0x2b')](_0x43ef20,_0x6ef3('0x28'));_0x433d90['query']=_[_0x6ef3('0x32')](_0x5d87ab['query']);_0x433d90[_0x6ef3('0x33')]=_['intersection'](_0x433d90['model'],_0x433d90[_0x6ef3('0x34')]);_0x5c1a25[_0x6ef3('0x35')]=_[_0x6ef3('0x36')](_0x433d90[_0x6ef3('0x31')],qs[_0x6ef3('0x37')](_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x37')]));_0x5c1a25['attributes']=_0x5c1a25[_0x6ef3('0x35')]['length']?_0x5c1a25[_0x6ef3('0x35')]:_0x433d90[_0x6ef3('0x31')];if(!_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x38')]('nolimit')){_0x5c1a25['limit']=qs[_0x6ef3('0x1e')](_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x1e')]);_0x5c1a25[_0x6ef3('0x1b')]=qs[_0x6ef3('0x1b')](_0x5d87ab['query'][_0x6ef3('0x1b')]);}_0x5c1a25[_0x6ef3('0x39')]=qs[_0x6ef3('0x3a')](_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x3a')]);_0x5c1a25[_0x6ef3('0x3b')]=qs[_0x6ef3('0x33')](_[_0x6ef3('0x3c')](_0x5d87ab[_0x6ef3('0x34')],_0x433d90[_0x6ef3('0x33')]),_0x43ef20);if(_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x3d')]){_0x5c1a25[_0x6ef3('0x3b')]=_['merge'](_0x5c1a25[_0x6ef3('0x3b')],{'$or':_['map'](_0x43ef20,function(_0x5132ca){if(_0x5132ca['type']!==_0x6ef3('0x3e')){var _0x49d0e3={};_0x49d0e3[_0x5132ca[_0x6ef3('0x28')]]={'$like':'%'+_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x3d')]+'%'};return _0x49d0e3;}})});}_0x5c1a25=_[_0x6ef3('0x3f')]({},_0x5c1a25,_0x5d87ab[_0x6ef3('0x40')]);var _0x4eac86={'where':_0x5c1a25[_0x6ef3('0x3b')]};return db['SquareReport'][_0x6ef3('0x1d')](_0x4eac86)[_0x6ef3('0x25')](function(_0x2554d5){_0x26d5ca[_0x6ef3('0x1d')]=_0x2554d5;if(_0x5d87ab[_0x6ef3('0x34')][_0x6ef3('0x41')]){_0x5c1a25[_0x6ef3('0x42')]=[{'all':!![]}];}return db[_0x6ef3('0x2c')]['findAll'](_0x5c1a25);})['then'](function(_0x582d97){_0x26d5ca[_0x6ef3('0x43')]=_0x582d97;return _0x26d5ca;})[_0x6ef3('0x25')](respondWithFilteredResult(_0x5b0002,_0x5c1a25))['catch'](handleError(_0x5b0002,null));};exports['show']=function(_0x31333a,_0x418840){var _0x10a751={'raw':!![],'where':{'id':_0x31333a[_0x6ef3('0x44')]['id']}},_0x244be6={};_0x244be6['model']=_['keys'](db['SquareReport'][_0x6ef3('0x2d')]);_0x244be6[_0x6ef3('0x34')]=_['keys'](_0x31333a['query']);_0x244be6[_0x6ef3('0x33')]=_[_0x6ef3('0x36')](_0x244be6[_0x6ef3('0x31')],_0x244be6[_0x6ef3('0x34')]);_0x10a751[_0x6ef3('0x35')]=_[_0x6ef3('0x36')](_0x244be6[_0x6ef3('0x31')],qs[_0x6ef3('0x37')](_0x31333a[_0x6ef3('0x34')]['fields']));_0x10a751[_0x6ef3('0x35')]=_0x10a751['attributes'][_0x6ef3('0x45')]?_0x10a751[_0x6ef3('0x35')]:_0x244be6['model'];if(_0x31333a[_0x6ef3('0x34')][_0x6ef3('0x41')]){_0x10a751['include']=[{'all':!![]}];}_0x10a751=_[_0x6ef3('0x3f')]({},_0x10a751,_0x31333a[_0x6ef3('0x40')]);return db[_0x6ef3('0x2c')][_0x6ef3('0x46')](_0x10a751)[_0x6ef3('0x25')](handleEntityNotFound(_0x418840,null))['then'](respondWithResult(_0x418840,null))[_0x6ef3('0x47')](handleError(_0x418840,null));};exports[_0x6ef3('0x48')]=function(_0x22fe52,_0x2a3637){return db['SquareReport'][_0x6ef3('0x48')](_0x22fe52[_0x6ef3('0x49')],{})['then'](respondWithResult(_0x2a3637,0xc9))[_0x6ef3('0x47')](handleError(_0x2a3637,null));};exports[_0x6ef3('0x24')]=function(_0x47777b,_0x147d94){if(_0x47777b[_0x6ef3('0x49')]['id']){delete _0x47777b[_0x6ef3('0x49')]['id'];}return db[_0x6ef3('0x2c')]['find']({'where':{'id':_0x47777b[_0x6ef3('0x44')]['id']}})[_0x6ef3('0x25')](handleEntityNotFound(_0x147d94,null))[_0x6ef3('0x25')](saveUpdates(_0x47777b[_0x6ef3('0x49')],null))['then'](respondWithResult(_0x147d94,null))[_0x6ef3('0x47')](handleError(_0x147d94,null));};exports['destroy']=function(_0x3c4d86,_0x149785){return db[_0x6ef3('0x2c')][_0x6ef3('0x46')]({'where':{'id':_0x3c4d86[_0x6ef3('0x44')]['id']}})[_0x6ef3('0x25')](handleEntityNotFound(_0x149785,null))['then'](removeEntity(_0x149785,null))[_0x6ef3('0x47')](handleError(_0x149785,null));};exports[_0x6ef3('0x4a')]=function(_0x2b553c,_0x18ccd4){return db[_0x6ef3('0x2c')]['describe']()[_0x6ef3('0x25')](respondWithResult(_0x18ccd4,null))[_0x6ef3('0x47')](handleError(_0x18ccd4,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index fde9c43..b2845f9 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 _0xc1de=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReport.attributes','define'];(function(_0x4a23f7,_0x503cbc){var _0x285847=function(_0x1ca9fd){while(--_0x1ca9fd){_0x4a23f7['push'](_0x4a23f7['shift']());}};_0x285847(++_0x503cbc);}(_0xc1de,0xaa));var _0xec1d=function(_0x7de1f6,_0x55d02f){_0x7de1f6=_0x7de1f6-0x0;var _0x21e950=_0xc1de[_0x7de1f6];return _0x21e950;};'use strict';var _=require('lodash');var util=require(_0xec1d('0x0'));var logger=require(_0xec1d('0x1'))(_0xec1d('0x2'));var moment=require(_0xec1d('0x3'));var BPromise=require(_0xec1d('0x4'));var rp=require(_0xec1d('0x5'));var fs=require('fs');var path=require(_0xec1d('0x6'));var rimraf=require('rimraf');var config=require(_0xec1d('0x7'));var attributes=require(_0xec1d('0x8'));module['exports']=function(_0x51521d,_0xb4d156){return _0x51521d[_0xec1d('0x9')](_0xec1d('0xa'),attributes,{'tableName':_0xec1d('0xb'),'paranoid':![],'indexes':[{'name':_0xec1d('0xc'),'fields':[_0xec1d('0xd'),'project_name']},{'name':_0xec1d('0xe'),'fields':[_0xec1d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa439=['leaveAt','../../config/logger','api','request-promise','path','rimraf','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x266b26,_0x5722b2){var _0x3e0c64=function(_0x324639){while(--_0x324639){_0x266b26['push'](_0x266b26['shift']());}};_0x3e0c64(++_0x5722b2);}(_0xa439,0x12c));var _0x9a43=function(_0x19b194,_0x553344){_0x19b194=_0x19b194-0x0;var _0x137542=_0xa439[_0x19b194];return _0x137542;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a43('0x0'))(_0x9a43('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a43('0x2'));var fs=require('fs');var path=require(_0x9a43('0x3'));var rimraf=require(_0x9a43('0x4'));var config=require('../../config/environment');var attributes=require(_0x9a43('0x5'));module[_0x9a43('0x6')]=function(_0x737030,_0x40dc3e){return _0x737030['define'](_0x9a43('0x7'),attributes,{'tableName':_0x9a43('0x8'),'paranoid':![],'indexes':[{'name':_0x9a43('0x9'),'fields':[_0x9a43('0xa'),_0x9a43('0xb')]},{'name':_0x9a43('0xc'),'fields':[_0x9a43('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 16e3613..2b0c48a 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 _0x9457=['request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','raw','debug','catch','UpdateSquareReport','where','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x29f48d,_0x433334){var _0x173358=function(_0x1ad9ec){while(--_0x1ad9ec){_0x29f48d['push'](_0x29f48d['shift']());}};_0x173358(++_0x433334);}(_0x9457,0xef));var _0x7945=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9457[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7945('0x0'));var moment=require('moment');var BPromise=require(_0x7945('0x1'));var rs=require(_0x7945('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7945('0x3'))['db'];var utils=require(_0x7945('0x4'));var logger=require('../../config/logger')(_0x7945('0x5'));var config=require(_0x7945('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7945('0x7')][_0x7945('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43ee6e,_0xe42823,_0x12a3ac){return new BPromise(function(_0x3a71a3,_0x1ad365){return client[_0x7945('0x9')](_0x43ee6e,_0x12a3ac)[_0x7945('0xa')](function(_0x46ff36){logger[_0x7945('0xb')](_0x7945('0xc'),_0xe42823,_0x7945('0xd'));logger['debug'](_0x7945('0xe'),_0xe42823,_0x7945('0xd'),JSON[_0x7945('0xf')](_0x46ff36));if(_0x46ff36[_0x7945('0x10')]){if(_0x46ff36[_0x7945('0x10')][_0x7945('0x11')]===0x1f4){logger[_0x7945('0x10')](_0x7945('0xc'),_0xe42823,_0x46ff36[_0x7945('0x10')]['message']);return _0x1ad365(_0x46ff36[_0x7945('0x10')]['message']);}logger['error'](_0x7945('0xc'),_0xe42823,_0x46ff36[_0x7945('0x10')][_0x7945('0x12')]);return _0x3a71a3(_0x46ff36[_0x7945('0x10')][_0x7945('0x12')]);}else{logger[_0x7945('0xb')](_0x7945('0xc'),_0xe42823,_0x7945('0xd'));_0x3a71a3(_0x46ff36[_0x7945('0x13')][_0x7945('0x12')]);}})['catch'](function(_0x559504){logger[_0x7945('0x10')](_0x7945('0xc'),_0xe42823,_0x559504);_0x1ad365(_0x559504);});});}exports[_0x7945('0x14')]=function(_0x18935e){var _0x40a009=this;return new Promise(function(_0x35c685,_0x6f7b5b){return db[_0x7945('0x15')][_0x7945('0x16')](_0x18935e[_0x7945('0x17')],{'raw':_0x18935e[_0x7945('0x18')]?_0x18935e[_0x7945('0x18')][_0x7945('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3e6a74){logger[_0x7945('0xb')](_0x7945('0x14'),_0x18935e);logger[_0x7945('0x1a')](_0x7945('0x14'),_0x18935e,JSON[_0x7945('0xf')](_0x3e6a74));_0x35c685(_0x3e6a74);})[_0x7945('0x1b')](function(_0xbe2d9a){logger[_0x7945('0x10')]('CreateSquareReport',_0xbe2d9a[_0x7945('0x12')],_0x18935e);_0x6f7b5b(_0x40a009[_0x7945('0x10')](0x1f4,_0xbe2d9a[_0x7945('0x12')]));});});};exports[_0x7945('0x1c')]=function(_0x2dc4e4){var _0x37e3cf=this;return new Promise(function(_0x1be40c,_0x2a6fca){return db[_0x7945('0x15')]['update'](_0x2dc4e4[_0x7945('0x17')],{'raw':_0x2dc4e4[_0x7945('0x18')]?_0x2dc4e4['options'][_0x7945('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dc4e4[_0x7945('0x18')]?_0x2dc4e4[_0x7945('0x18')][_0x7945('0x1d')]||null:null,'attributes':_0x2dc4e4[_0x7945('0x18')]?_0x2dc4e4['options']['attributes']||null:null,'limit':_0x2dc4e4[_0x7945('0x18')]?_0x2dc4e4[_0x7945('0x18')][_0x7945('0x1e')]||null:null})[_0x7945('0xa')](function(_0x352a57){logger[_0x7945('0xb')](_0x7945('0x1c'),_0x2dc4e4);logger[_0x7945('0x1a')](_0x7945('0x1c'),_0x2dc4e4,JSON[_0x7945('0xf')](_0x352a57));_0x1be40c(_0x352a57);})[_0x7945('0x1b')](function(_0x233d02){logger['error'](_0x7945('0x1c'),_0x233d02[_0x7945('0x12')],_0x2dc4e4);_0x2a6fca(_0x37e3cf['error'](0x1f4,_0x233d02[_0x7945('0x12')]));});});}; \ No newline at end of file +var _0x43d1=['SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareReport'];(function(_0x57969d,_0x1c1dce){var _0x59958e=function(_0x4d3c7f){while(--_0x4d3c7f){_0x57969d['push'](_0x57969d['shift']());}};_0x59958e(++_0x1c1dce);}(_0x43d1,0xe2));var _0x143d=function(_0x1333bb,_0x5385fa){_0x1333bb=_0x1333bb-0x0;var _0x4f7219=_0x43d1[_0x1333bb];return _0x4f7219;};'use strict';var _=require(_0x143d('0x0'));var util=require(_0x143d('0x1'));var moment=require(_0x143d('0x2'));var BPromise=require(_0x143d('0x3'));var rs=require(_0x143d('0x4'));var fs=require('fs');var Redis=require(_0x143d('0x5'));var db=require(_0x143d('0x6'))['db'];var utils=require(_0x143d('0x7'));var logger=require('../../config/logger')(_0x143d('0x8'));var config=require(_0x143d('0x9'));var jayson=require(_0x143d('0xa'));var client=jayson[_0x143d('0xb')][_0x143d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11e74f,_0xebcc76,_0x2be470){return new BPromise(function(_0x4110ed,_0x2b8dca){return client[_0x143d('0xd')](_0x11e74f,_0x2be470)[_0x143d('0xe')](function(_0x51702e){logger['info'](_0x143d('0xf'),_0xebcc76,_0x143d('0x10'));logger[_0x143d('0x11')](_0x143d('0x12'),_0xebcc76,_0x143d('0x10'),JSON[_0x143d('0x13')](_0x51702e));if(_0x51702e['error']){if(_0x51702e[_0x143d('0x14')][_0x143d('0x15')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0xebcc76,_0x51702e[_0x143d('0x14')][_0x143d('0x16')]);return _0x2b8dca(_0x51702e[_0x143d('0x14')][_0x143d('0x16')]);}logger['error'](_0x143d('0xf'),_0xebcc76,_0x51702e['error']['message']);return _0x4110ed(_0x51702e[_0x143d('0x14')]['message']);}else{logger[_0x143d('0x17')](_0x143d('0xf'),_0xebcc76,'request\x20sent');_0x4110ed(_0x51702e[_0x143d('0x18')][_0x143d('0x16')]);}})['catch'](function(_0x1f6995){logger[_0x143d('0x14')](_0x143d('0xf'),_0xebcc76,_0x1f6995);_0x2b8dca(_0x1f6995);});});}exports[_0x143d('0x19')]=function(_0x51aca6){var _0x2d165c=this;return new Promise(function(_0x14fd03,_0x2fbd11){return db[_0x143d('0x1a')][_0x143d('0x1b')](_0x51aca6[_0x143d('0x1c')],{'raw':_0x51aca6['options']?_0x51aca6[_0x143d('0x1d')][_0x143d('0x1e')]===undefined?!![]:![]:!![]})[_0x143d('0xe')](function(_0x481f61){logger[_0x143d('0x17')](_0x143d('0x19'),_0x51aca6);logger['debug'](_0x143d('0x19'),_0x51aca6,JSON[_0x143d('0x13')](_0x481f61));_0x14fd03(_0x481f61);})[_0x143d('0x1f')](function(_0x16a5c6){logger[_0x143d('0x14')]('CreateSquareReport',_0x16a5c6[_0x143d('0x16')],_0x51aca6);_0x2fbd11(_0x2d165c['error'](0x1f4,_0x16a5c6[_0x143d('0x16')]));});});};exports[_0x143d('0x20')]=function(_0x120fed){var _0x11be52=this;return new Promise(function(_0x533afb,_0x1a2b90){return db[_0x143d('0x1a')][_0x143d('0x21')](_0x120fed[_0x143d('0x1c')],{'raw':_0x120fed['options']?_0x120fed[_0x143d('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120fed[_0x143d('0x1d')]?_0x120fed[_0x143d('0x1d')][_0x143d('0x22')]||null:null,'attributes':_0x120fed['options']?_0x120fed[_0x143d('0x1d')][_0x143d('0x23')]||null:null,'limit':_0x120fed[_0x143d('0x1d')]?_0x120fed[_0x143d('0x1d')]['limit']||null:null})[_0x143d('0xe')](function(_0xfbadce){logger['info'](_0x143d('0x20'),_0x120fed);logger[_0x143d('0x11')](_0x143d('0x20'),_0x120fed,JSON[_0x143d('0x13')](_0xfbadce));_0x533afb(_0xfbadce);})[_0x143d('0x1f')](function(_0x315d96){logger[_0x143d('0x14')](_0x143d('0x20'),_0x315d96['message'],_0x120fed);_0x1a2b90(_0x11be52[_0x143d('0x14')](0x1f4,_0x315d96[_0x143d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7076618..b620ddc 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 _0xc1aa=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x414f45,_0x1ee7d3){var _0x3bc907=function(_0x2e22de){while(--_0x2e22de){_0x414f45['push'](_0x414f45['shift']());}};_0x3bc907(++_0x1ee7d3);}(_0xc1aa,0x111));var _0xac1a=function(_0x3126d6,_0x2dd984){_0x3126d6=_0x3126d6-0x0;var _0x22a899=_0xc1aa[_0x3126d6];return _0x22a899;};'use strict';var multer=require(_0xac1a('0x0'));var util=require(_0xac1a('0x1'));var path=require('path');var timeout=require(_0xac1a('0x2'));var express=require(_0xac1a('0x3'));var router=express[_0xac1a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xac1a('0x5'));var interaction=require(_0xac1a('0x6'));var config=require('../../config/environment');var controller=require(_0xac1a('0x7'));router['get']('/',auth[_0xac1a('0x8')](),controller[_0xac1a('0x9')]);router[_0xac1a('0xa')](_0xac1a('0xb'),auth[_0xac1a('0x8')](),controller[_0xac1a('0xc')]);router['get']('/:id',auth[_0xac1a('0x8')](),controller[_0xac1a('0xd')]);router[_0xac1a('0xe')]('/',auth[_0xac1a('0x8')](),controller[_0xac1a('0xf')]);router[_0xac1a('0x10')](_0xac1a('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xac1a('0x12')](_0xac1a('0x11'),auth['isAuthenticated'](),controller[_0xac1a('0x13')]);module[_0xac1a('0x14')]=router; \ No newline at end of file +var _0x4ab6=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy'];(function(_0x3435a5,_0x287079){var _0x4a98a0=function(_0x4eb34c){while(--_0x4eb34c){_0x3435a5['push'](_0x3435a5['shift']());}};_0x4a98a0(++_0x287079);}(_0x4ab6,0x7f));var _0x64ab=function(_0x3a2a33,_0x29372a){_0x3a2a33=_0x3a2a33-0x0;var _0x10d6d2=_0x4ab6[_0x3a2a33];return _0x10d6d2;};'use strict';var multer=require(_0x64ab('0x0'));var util=require(_0x64ab('0x1'));var path=require(_0x64ab('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x64ab('0x3')]();var fs_extra=require(_0x64ab('0x4'));var auth=require(_0x64ab('0x5'));var interaction=require(_0x64ab('0x6'));var config=require('../../config/environment');var controller=require(_0x64ab('0x7'));router[_0x64ab('0x8')]('/',auth[_0x64ab('0x9')](),controller[_0x64ab('0xa')]);router[_0x64ab('0x8')](_0x64ab('0xb'),auth[_0x64ab('0x9')](),controller[_0x64ab('0xc')]);router[_0x64ab('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x64ab('0xd')]);router[_0x64ab('0xe')]('/',auth[_0x64ab('0x9')](),controller[_0x64ab('0xf')]);router[_0x64ab('0x10')](_0x64ab('0x11'),auth[_0x64ab('0x9')](),controller[_0x64ab('0x12')]);router['delete']('/:id',auth[_0x64ab('0x9')](),controller[_0x64ab('0x13')]);module[_0x64ab('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 71eab15..e7bc9ab 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 _0xbfa5=['STRING','exports'];(function(_0x512b21,_0x321ed0){var _0x17adf5=function(_0x1f9ad1){while(--_0x1f9ad1){_0x512b21['push'](_0x512b21['shift']());}};_0x17adf5(++_0x321ed0);}(_0xbfa5,0x155));var _0x5bfa=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xbfa5[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require('sequelize');module[_0x5bfa('0x0')]={'uniqueid':{'type':Sequelize[_0x5bfa('0x1')]},'node':{'type':Sequelize[_0x5bfa('0x1')]},'application':{'type':Sequelize[_0x5bfa('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5bfa('0x1')]}}; \ No newline at end of file +var _0x398d=['STRING','TEXT','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x398d,0xb6));var _0xd398=function(_0x12f77e,_0x4442f2){_0x12f77e=_0x12f77e-0x0;var _0x4568c0=_0x398d[_0x12f77e];return _0x4568c0;};'use strict';var Sequelize=require('sequelize');module[_0xd398('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xd398('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xd398('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd398('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 42713eb..a4ed68d 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 _0x7c69=['params','rawAttributes','options','find','create','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','count','limit','set','json','apply','save','then','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch'];(function(_0x2ad6e0,_0x13bf28){var _0x33f4f3=function(_0x23d377){while(--_0x23d377){_0x2ad6e0['push'](_0x2ad6e0['shift']());}};_0x33f4f3(++_0x13bf28);}(_0x7c69,0x1c5));var _0x97c6=function(_0x95a28c,_0x4ba797){_0x95a28c=_0x95a28c-0x0;var _0x1f7c7b=_0x7c69[_0x95a28c];return _0x1f7c7b;};'use strict';var emlformat=require(_0x97c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97c6('0x1'));var jsonpatch=require(_0x97c6('0x2'));var rp=require('request-promise');var moment=require(_0x97c6('0x3'));var BPromise=require(_0x97c6('0x4'));var Mustache=require(_0x97c6('0x5'));var util=require('util');var path=require(_0x97c6('0x6'));var sox=require(_0x97c6('0x7'));var csv=require(_0x97c6('0x8'));var ejs=require(_0x97c6('0x9'));var fs=require('fs');var fs_extra=require(_0x97c6('0xa'));var _=require(_0x97c6('0xb'));var squel=require(_0x97c6('0xc'));var crypto=require(_0x97c6('0xd'));var jsforce=require(_0x97c6('0xe'));var deskjs=require(_0x97c6('0xf'));var toCsv=require(_0x97c6('0x8'));var querystring=require(_0x97c6('0x10'));var Papa=require(_0x97c6('0x11'));var Redis=require(_0x97c6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x97c6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c6('0x14'));var logger=require(_0x97c6('0x15'))(_0x97c6('0x16'));var utils=require('../../config/utils');var config=require(_0x97c6('0x17'));var licenseUtil=require(_0x97c6('0x18'));var db=require(_0x97c6('0x19'))['db'];function respondWithStatusCode(_0x14d00b,_0x7a28d0){_0x7a28d0=_0x7a28d0||0xcc;return function(_0x2a785f){if(_0x2a785f){return _0x14d00b[_0x97c6('0x1a')](_0x7a28d0);}return _0x14d00b['status'](_0x7a28d0)[_0x97c6('0x1b')]();};}function respondWithResult(_0x1a1f05,_0x3723b){_0x3723b=_0x3723b||0xc8;return function(_0x438bcf){if(_0x438bcf){return _0x1a1f05[_0x97c6('0x1c')](_0x3723b)['json'](_0x438bcf);}};}function respondWithFilteredResult(_0xb8fdcc,_0x133582){return function(_0x2d4735){if(_0x2d4735){var _0xbdaff7=typeof _0x133582[_0x97c6('0x1d')]==='undefined'&&typeof _0x133582['limit']==='undefined';var _0x4319a1=_0x2d4735[_0x97c6('0x1e')];var _0x31e488=_0xbdaff7?0x0:_0x133582[_0x97c6('0x1d')];var _0x5bc509=_0xbdaff7?_0x2d4735['count']:_0x133582['offset']+_0x133582[_0x97c6('0x1f')];var _0x1db212;if(_0x5bc509>=_0x4319a1){_0x5bc509=_0x4319a1;_0x1db212=0xc8;}else{_0x1db212=0xce;}_0xb8fdcc[_0x97c6('0x1c')](_0x1db212);return _0xb8fdcc[_0x97c6('0x20')]('Content-Range',_0x31e488+'-'+_0x5bc509+'/'+_0x4319a1)[_0x97c6('0x21')](_0x2d4735);}return null;};}function patchUpdates(_0x1fe1ad){return function(_0x4ffb2c){try{jsonpatch[_0x97c6('0x22')](_0x4ffb2c,_0x1fe1ad,!![]);}catch(_0x31ff6a){return BPromise['reject'](_0x31ff6a);}return _0x4ffb2c[_0x97c6('0x23')]();};}function saveUpdates(_0x708141,_0x3b4cb4){return function(_0x5e771b){if(_0x5e771b){return _0x5e771b['update'](_0x708141)['then'](function(_0x296fdb){return _0x296fdb;});}return null;};}function removeEntity(_0x35f35b,_0x36cee1){return function(_0x3b4271){if(_0x3b4271){return _0x3b4271['destroy']()[_0x97c6('0x24')](function(){_0x35f35b[_0x97c6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac7a9,_0x43fc69){return function(_0x2c3c1a){if(!_0x2c3c1a){_0x2ac7a9[_0x97c6('0x1a')](0x194);}return _0x2c3c1a;};}function handleError(_0x15a2cf,_0x52e252){_0x52e252=_0x52e252||0x1f4;return function(_0x31a29c){logger['error'](_0x31a29c[_0x97c6('0x25')]);if(_0x31a29c[_0x97c6('0x26')]){delete _0x31a29c[_0x97c6('0x26')];}_0x15a2cf[_0x97c6('0x1c')](_0x52e252)[_0x97c6('0x27')](_0x31a29c);};}exports[_0x97c6('0x28')]=function(_0x39a7b3,_0x2af420){var _0x2d5b34={},_0x50f534={},_0x48827d={'count':0x0,'rows':[]};var _0x920a7c=_[_0x97c6('0x29')](db[_0x97c6('0x2a')]['rawAttributes'],function(_0x3fbce1){return{'name':_0x3fbce1[_0x97c6('0x2b')],'type':_0x3fbce1[_0x97c6('0x2c')][_0x97c6('0x2d')]};});_0x50f534[_0x97c6('0x2e')]=_[_0x97c6('0x29')](_0x920a7c,_0x97c6('0x26'));_0x50f534[_0x97c6('0x2f')]=_[_0x97c6('0x30')](_0x39a7b3[_0x97c6('0x2f')]);_0x50f534[_0x97c6('0x31')]=_[_0x97c6('0x32')](_0x50f534[_0x97c6('0x2e')],_0x50f534['query']);_0x2d5b34['attributes']=_['intersection'](_0x50f534['model'],qs['fields'](_0x39a7b3['query'][_0x97c6('0x33')]));_0x2d5b34[_0x97c6('0x34')]=_0x2d5b34['attributes'][_0x97c6('0x35')]?_0x2d5b34[_0x97c6('0x34')]:_0x50f534[_0x97c6('0x2e')];if(!_0x39a7b3['query']['hasOwnProperty'](_0x97c6('0x36'))){_0x2d5b34[_0x97c6('0x1f')]=qs['limit'](_0x39a7b3[_0x97c6('0x2f')][_0x97c6('0x1f')]);_0x2d5b34['offset']=qs[_0x97c6('0x1d')](_0x39a7b3[_0x97c6('0x2f')]['offset']);}_0x2d5b34[_0x97c6('0x37')]=qs[_0x97c6('0x38')](_0x39a7b3[_0x97c6('0x2f')][_0x97c6('0x38')]);_0x2d5b34[_0x97c6('0x39')]=qs[_0x97c6('0x31')](_[_0x97c6('0x3a')](_0x39a7b3[_0x97c6('0x2f')],_0x50f534[_0x97c6('0x31')]),_0x920a7c);if(_0x39a7b3['query'][_0x97c6('0x3b')]){_0x2d5b34[_0x97c6('0x39')]=_['merge'](_0x2d5b34[_0x97c6('0x39')],{'$or':_['map'](_0x920a7c,function(_0x1bb21c){if(_0x1bb21c[_0x97c6('0x2c')]!==_0x97c6('0x3c')){var _0x4c588b={};_0x4c588b[_0x1bb21c[_0x97c6('0x26')]]={'$like':'%'+_0x39a7b3[_0x97c6('0x2f')][_0x97c6('0x3b')]+'%'};return _0x4c588b;}})});}_0x2d5b34=_[_0x97c6('0x3d')]({},_0x2d5b34,_0x39a7b3['options']);var _0x5bfad3={'where':_0x2d5b34['where']};return db[_0x97c6('0x2a')][_0x97c6('0x1e')](_0x5bfad3)[_0x97c6('0x24')](function(_0x2ff128){_0x48827d[_0x97c6('0x1e')]=_0x2ff128;if(_0x39a7b3[_0x97c6('0x2f')][_0x97c6('0x3e')]){_0x2d5b34['include']=[{'all':!![]}];}return db[_0x97c6('0x2a')]['findAll'](_0x2d5b34);})['then'](function(_0x54d9fc){_0x48827d[_0x97c6('0x3f')]=_0x54d9fc;return _0x48827d;})[_0x97c6('0x24')](respondWithFilteredResult(_0x2af420,_0x2d5b34))[_0x97c6('0x40')](handleError(_0x2af420,null));};exports['show']=function(_0x38a81a,_0x3793af){var _0x164915={'raw':!![],'where':{'id':_0x38a81a[_0x97c6('0x41')]['id']}},_0xc51835={};_0xc51835[_0x97c6('0x2e')]=_[_0x97c6('0x30')](db[_0x97c6('0x2a')][_0x97c6('0x42')]);_0xc51835[_0x97c6('0x2f')]=_['keys'](_0x38a81a['query']);_0xc51835[_0x97c6('0x31')]=_['intersection'](_0xc51835[_0x97c6('0x2e')],_0xc51835[_0x97c6('0x2f')]);_0x164915['attributes']=_['intersection'](_0xc51835[_0x97c6('0x2e')],qs[_0x97c6('0x33')](_0x38a81a[_0x97c6('0x2f')][_0x97c6('0x33')]));_0x164915['attributes']=_0x164915[_0x97c6('0x34')]['length']?_0x164915[_0x97c6('0x34')]:_0xc51835[_0x97c6('0x2e')];if(_0x38a81a[_0x97c6('0x2f')][_0x97c6('0x3e')]){_0x164915['include']=[{'all':!![]}];}_0x164915=_[_0x97c6('0x3d')]({},_0x164915,_0x38a81a[_0x97c6('0x43')]);return db[_0x97c6('0x2a')][_0x97c6('0x44')](_0x164915)[_0x97c6('0x24')](handleEntityNotFound(_0x3793af,null))[_0x97c6('0x24')](respondWithResult(_0x3793af,null))[_0x97c6('0x40')](handleError(_0x3793af,null));};exports['create']=function(_0x24af84,_0x3db6ac){return db[_0x97c6('0x2a')][_0x97c6('0x45')](_0x24af84['body'],{})[_0x97c6('0x24')](respondWithResult(_0x3db6ac,0xc9))[_0x97c6('0x40')](handleError(_0x3db6ac,null));};exports[_0x97c6('0x46')]=function(_0x1fa34e,_0x3451d0){if(_0x1fa34e[_0x97c6('0x47')]['id']){delete _0x1fa34e[_0x97c6('0x47')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x1fa34e[_0x97c6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3451d0,null))[_0x97c6('0x24')](saveUpdates(_0x1fa34e[_0x97c6('0x47')],null))[_0x97c6('0x24')](respondWithResult(_0x3451d0,null))[_0x97c6('0x40')](handleError(_0x3451d0,null));};exports[_0x97c6('0x48')]=function(_0x11d422,_0x3b425c){return db[_0x97c6('0x2a')][_0x97c6('0x44')]({'where':{'id':_0x11d422['params']['id']}})[_0x97c6('0x24')](handleEntityNotFound(_0x3b425c,null))[_0x97c6('0x24')](removeEntity(_0x3b425c,null))[_0x97c6('0x40')](handleError(_0x3b425c,null));};exports[_0x97c6('0x49')]=function(_0x134455,_0x5e94a6){return db[_0x97c6('0x2a')]['describe']()[_0x97c6('0x24')](respondWithResult(_0x5e94a6,null))['catch'](handleError(_0x5e94a6,null));}; \ No newline at end of file +var _0x5619=['apply','save','then','destroy','error','stack','name','send','map','SquareDetailsReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0x5619,0x102));var _0x9561=function(_0x1494d1,_0x3f21fb){_0x1494d1=_0x1494d1-0x0;var _0x2cc475=_0x5619[_0x1494d1];return _0x2cc475;};'use strict';var emlformat=require(_0x9561('0x0'));var rimraf=require(_0x9561('0x1'));var zipdir=require(_0x9561('0x2'));var jsonpatch=require(_0x9561('0x3'));var rp=require(_0x9561('0x4'));var moment=require(_0x9561('0x5'));var BPromise=require(_0x9561('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9561('0x7'));var sox=require(_0x9561('0x8'));var csv=require(_0x9561('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9561('0xa'));var squel=require('squel');var crypto=require(_0x9561('0xb'));var jsforce=require(_0x9561('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9561('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9561('0xd'));var authService=require(_0x9561('0xe'));var qs=require(_0x9561('0xf'));var as=require(_0x9561('0x10'));var hardwareService=require(_0x9561('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x9561('0x12'));var config=require(_0x9561('0x13'));var licenseUtil=require(_0x9561('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2923a1,_0x2bcfae){_0x2bcfae=_0x2bcfae||0xcc;return function(_0x408fa5){if(_0x408fa5){return _0x2923a1[_0x9561('0x15')](_0x2bcfae);}return _0x2923a1[_0x9561('0x16')](_0x2bcfae)[_0x9561('0x17')]();};}function respondWithResult(_0x39cf17,_0x26edb5){_0x26edb5=_0x26edb5||0xc8;return function(_0x248e9c){if(_0x248e9c){return _0x39cf17[_0x9561('0x16')](_0x26edb5)[_0x9561('0x18')](_0x248e9c);}};}function respondWithFilteredResult(_0x1166b0,_0x5e6973){return function(_0x328c89){if(_0x328c89){var _0x58ae23=typeof _0x5e6973[_0x9561('0x19')]===_0x9561('0x1a')&&typeof _0x5e6973['limit']===_0x9561('0x1a');var _0x513607=_0x328c89[_0x9561('0x1b')];var _0x258746=_0x58ae23?0x0:_0x5e6973[_0x9561('0x19')];var _0x4c47c5=_0x58ae23?_0x328c89[_0x9561('0x1b')]:_0x5e6973[_0x9561('0x19')]+_0x5e6973['limit'];var _0x29b28f;if(_0x4c47c5>=_0x513607){_0x4c47c5=_0x513607;_0x29b28f=0xc8;}else{_0x29b28f=0xce;}_0x1166b0[_0x9561('0x16')](_0x29b28f);return _0x1166b0[_0x9561('0x1c')](_0x9561('0x1d'),_0x258746+'-'+_0x4c47c5+'/'+_0x513607)[_0x9561('0x18')](_0x328c89);}return null;};}function patchUpdates(_0x1b7228){return function(_0x2f73f7){try{jsonpatch[_0x9561('0x1e')](_0x2f73f7,_0x1b7228,!![]);}catch(_0xe5332f){return BPromise['reject'](_0xe5332f);}return _0x2f73f7[_0x9561('0x1f')]();};}function saveUpdates(_0x145540,_0x45156b){return function(_0x3329e2){if(_0x3329e2){return _0x3329e2['update'](_0x145540)[_0x9561('0x20')](function(_0xd4064a){return _0xd4064a;});}return null;};}function removeEntity(_0x2aad1b,_0x1081ad){return function(_0x1ae046){if(_0x1ae046){return _0x1ae046[_0x9561('0x21')]()[_0x9561('0x20')](function(){_0x2aad1b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d9d57,_0x198889){return function(_0x1b8fb4){if(!_0x1b8fb4){_0x5d9d57[_0x9561('0x15')](0x194);}return _0x1b8fb4;};}function handleError(_0x1d45f6,_0x5578cf){_0x5578cf=_0x5578cf||0x1f4;return function(_0x288bfc){logger[_0x9561('0x22')](_0x288bfc[_0x9561('0x23')]);if(_0x288bfc[_0x9561('0x24')]){delete _0x288bfc['name'];}_0x1d45f6[_0x9561('0x16')](_0x5578cf)[_0x9561('0x25')](_0x288bfc);};}exports['index']=function(_0x4405cc,_0x2e14f8){var _0x56192a={},_0x1262f8={},_0x958fc2={'count':0x0,'rows':[]};var _0x24084c=_[_0x9561('0x26')](db[_0x9561('0x27')][_0x9561('0x28')],function(_0x453b4b){return{'name':_0x453b4b['fieldName'],'type':_0x453b4b[_0x9561('0x29')][_0x9561('0x2a')]};});_0x1262f8['model']=_[_0x9561('0x26')](_0x24084c,_0x9561('0x24'));_0x1262f8[_0x9561('0x2b')]=_[_0x9561('0x2c')](_0x4405cc['query']);_0x1262f8[_0x9561('0x2d')]=_[_0x9561('0x2e')](_0x1262f8[_0x9561('0x2f')],_0x1262f8[_0x9561('0x2b')]);_0x56192a[_0x9561('0x30')]=_[_0x9561('0x2e')](_0x1262f8[_0x9561('0x2f')],qs[_0x9561('0x31')](_0x4405cc['query'][_0x9561('0x31')]));_0x56192a['attributes']=_0x56192a[_0x9561('0x30')][_0x9561('0x32')]?_0x56192a[_0x9561('0x30')]:_0x1262f8[_0x9561('0x2f')];if(!_0x4405cc[_0x9561('0x2b')]['hasOwnProperty'](_0x9561('0x33'))){_0x56192a[_0x9561('0x34')]=qs['limit'](_0x4405cc[_0x9561('0x2b')][_0x9561('0x34')]);_0x56192a[_0x9561('0x19')]=qs[_0x9561('0x19')](_0x4405cc['query'][_0x9561('0x19')]);}_0x56192a[_0x9561('0x35')]=qs[_0x9561('0x36')](_0x4405cc[_0x9561('0x2b')][_0x9561('0x36')]);_0x56192a[_0x9561('0x37')]=qs[_0x9561('0x2d')](_['pick'](_0x4405cc[_0x9561('0x2b')],_0x1262f8[_0x9561('0x2d')]),_0x24084c);if(_0x4405cc[_0x9561('0x2b')][_0x9561('0x38')]){_0x56192a[_0x9561('0x37')]=_['merge'](_0x56192a[_0x9561('0x37')],{'$or':_[_0x9561('0x26')](_0x24084c,function(_0x45748d){if(_0x45748d[_0x9561('0x29')]!==_0x9561('0x39')){var _0x29403b={};_0x29403b[_0x45748d[_0x9561('0x24')]]={'$like':'%'+_0x4405cc[_0x9561('0x2b')][_0x9561('0x38')]+'%'};return _0x29403b;}})});}_0x56192a=_[_0x9561('0x3a')]({},_0x56192a,_0x4405cc[_0x9561('0x3b')]);var _0x4d156b={'where':_0x56192a[_0x9561('0x37')]};return db[_0x9561('0x27')][_0x9561('0x1b')](_0x4d156b)[_0x9561('0x20')](function(_0xd4c22){_0x958fc2['count']=_0xd4c22;if(_0x4405cc[_0x9561('0x2b')]['includeAll']){_0x56192a[_0x9561('0x3c')]=[{'all':!![]}];}return db[_0x9561('0x27')][_0x9561('0x3d')](_0x56192a);})[_0x9561('0x20')](function(_0xfee3b3){_0x958fc2[_0x9561('0x3e')]=_0xfee3b3;return _0x958fc2;})[_0x9561('0x20')](respondWithFilteredResult(_0x2e14f8,_0x56192a))[_0x9561('0x3f')](handleError(_0x2e14f8,null));};exports[_0x9561('0x40')]=function(_0x1b8338,_0xbb1e9e){var _0x268183={'raw':!![],'where':{'id':_0x1b8338[_0x9561('0x41')]['id']}},_0x2d95ea={};_0x2d95ea[_0x9561('0x2f')]=_['keys'](db[_0x9561('0x27')][_0x9561('0x28')]);_0x2d95ea[_0x9561('0x2b')]=_[_0x9561('0x2c')](_0x1b8338[_0x9561('0x2b')]);_0x2d95ea[_0x9561('0x2d')]=_[_0x9561('0x2e')](_0x2d95ea['model'],_0x2d95ea['query']);_0x268183[_0x9561('0x30')]=_['intersection'](_0x2d95ea[_0x9561('0x2f')],qs[_0x9561('0x31')](_0x1b8338['query'][_0x9561('0x31')]));_0x268183[_0x9561('0x30')]=_0x268183[_0x9561('0x30')][_0x9561('0x32')]?_0x268183[_0x9561('0x30')]:_0x2d95ea[_0x9561('0x2f')];if(_0x1b8338[_0x9561('0x2b')][_0x9561('0x42')]){_0x268183[_0x9561('0x3c')]=[{'all':!![]}];}_0x268183=_['merge']({},_0x268183,_0x1b8338[_0x9561('0x3b')]);return db[_0x9561('0x27')][_0x9561('0x43')](_0x268183)[_0x9561('0x20')](handleEntityNotFound(_0xbb1e9e,null))[_0x9561('0x20')](respondWithResult(_0xbb1e9e,null))[_0x9561('0x3f')](handleError(_0xbb1e9e,null));};exports[_0x9561('0x44')]=function(_0x46d5d3,_0x334805){return db[_0x9561('0x27')][_0x9561('0x44')](_0x46d5d3['body'],{})[_0x9561('0x20')](respondWithResult(_0x334805,0xc9))[_0x9561('0x3f')](handleError(_0x334805,null));};exports[_0x9561('0x45')]=function(_0x40ab5f,_0x154e77){if(_0x40ab5f['body']['id']){delete _0x40ab5f[_0x9561('0x46')]['id'];}return db[_0x9561('0x27')][_0x9561('0x43')]({'where':{'id':_0x40ab5f['params']['id']}})[_0x9561('0x20')](handleEntityNotFound(_0x154e77,null))['then'](saveUpdates(_0x40ab5f[_0x9561('0x46')],null))[_0x9561('0x20')](respondWithResult(_0x154e77,null))[_0x9561('0x3f')](handleError(_0x154e77,null));};exports[_0x9561('0x21')]=function(_0x230c9e,_0x29cdc3){return db[_0x9561('0x27')][_0x9561('0x43')]({'where':{'id':_0x230c9e[_0x9561('0x41')]['id']}})[_0x9561('0x20')](handleEntityNotFound(_0x29cdc3,null))[_0x9561('0x20')](removeEntity(_0x29cdc3,null))['catch'](handleError(_0x29cdc3,null));};exports[_0x9561('0x47')]=function(_0x17545f,_0x2657ae){return db['SquareDetailsReport'][_0x9561('0x47')]()['then'](respondWithResult(_0x2657ae,null))[_0x9561('0x3f')](handleError(_0x2657ae,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 6c8ae03..f66184d 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 _0x861a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','lodash','util'];(function(_0x46ea07,_0x481a6c){var _0x1d7ecf=function(_0x4e2cf2){while(--_0x4e2cf2){_0x46ea07['push'](_0x46ea07['shift']());}};_0x1d7ecf(++_0x481a6c);}(_0x861a,0xda));var _0xa861=function(_0x2ea176,_0x2eb2e9){_0x2ea176=_0x2ea176-0x0;var _0x5ee67c=_0x861a[_0x2ea176];return _0x5ee67c;};'use strict';var _=require(_0xa861('0x0'));var util=require(_0xa861('0x1'));var logger=require(_0xa861('0x2'))(_0xa861('0x3'));var moment=require(_0xa861('0x4'));var BPromise=require(_0xa861('0x5'));var rp=require(_0xa861('0x6'));var fs=require('fs');var path=require(_0xa861('0x7'));var rimraf=require(_0xa861('0x8'));var config=require('../../config/environment');var attributes=require(_0xa861('0x9'));module['exports']=function(_0x7c51ad,_0xd44d0e){return _0x7c51ad['define']('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa311=['SquareDetailsReport','report_square_details','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x543bc7,_0x25d943){var _0x2654e6=function(_0x58df3f){while(--_0x58df3f){_0x543bc7['push'](_0x543bc7['shift']());}};_0x2654e6(++_0x25d943);}(_0xa311,0x1a6));var _0x1a31=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xa311[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0x1a31('0x0'));var util=require('util');var logger=require(_0x1a31('0x1'))('api');var moment=require(_0x1a31('0x2'));var BPromise=require(_0x1a31('0x3'));var rp=require(_0x1a31('0x4'));var fs=require('fs');var path=require(_0x1a31('0x5'));var rimraf=require(_0x1a31('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x1a31('0x7')]=function(_0x43e575,_0x4f5450){return _0x43e575['define'](_0x1a31('0x8'),attributes,{'tableName':_0x1a31('0x9'),'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 e366dd1..f95a4b1 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 _0x693f=['code','message','info','SquareDetailsReport,\x20%s,\x20%s','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','request\x20sent','stringify','error'];(function(_0x38abf8,_0x3a5e9d){var _0x3828cc=function(_0x261db3){while(--_0x261db3){_0x38abf8['push'](_0x38abf8['shift']());}};_0x3828cc(++_0x3a5e9d);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require(_0xf693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf693('0x4'));var db=require(_0xf693('0x5'))['db'];var utils=require(_0xf693('0x6'));var logger=require(_0xf693('0x7'))(_0xf693('0x8'));var config=require(_0xf693('0x9'));var jayson=require(_0xf693('0xa'));var client=jayson['client'][_0xf693('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33305c,_0x5b91c5,_0x22f362){return new BPromise(function(_0x594505,_0x38e78a){return client['request'](_0x33305c,_0x22f362)[_0xf693('0xc')](function(_0x17075d){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,'request\x20sent');logger[_0xf693('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x5b91c5,_0xf693('0xe'),JSON[_0xf693('0xf')](_0x17075d));if(_0x17075d[_0xf693('0x10')]){if(_0x17075d[_0xf693('0x10')][_0xf693('0x11')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);return _0x38e78a(_0x17075d['error'][_0xf693('0x12')]);}logger[_0xf693('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x5b91c5,_0x17075d['error'][_0xf693('0x12')]);return _0x594505(_0x17075d[_0xf693('0x10')][_0xf693('0x12')]);}else{logger[_0xf693('0x13')](_0xf693('0x14'),_0x5b91c5,'request\x20sent');_0x594505(_0x17075d[_0xf693('0x15')][_0xf693('0x12')]);}})[_0xf693('0x16')](function(_0x2a5e1b){logger[_0xf693('0x10')](_0xf693('0x14'),_0x5b91c5,_0x2a5e1b);_0x38e78a(_0x2a5e1b);});});}exports['CreateSquareDetailsReport']=function(_0x5e02e0){var _0x4a5964=this;return new Promise(function(_0x2474d4,_0xf4d20e){return db[_0xf693('0x17')][_0xf693('0x18')](_0x5e02e0[_0xf693('0x19')],{'raw':_0x5e02e0['options']?_0x5e02e0[_0xf693('0x1a')][_0xf693('0x1b')]===undefined?!![]:![]:!![]})[_0xf693('0xc')](function(_0x31b887){logger[_0xf693('0x13')](_0xf693('0x1c'),_0x5e02e0);logger[_0xf693('0xd')](_0xf693('0x1c'),_0x5e02e0,JSON['stringify'](_0x31b887));_0x2474d4(_0x31b887);})[_0xf693('0x16')](function(_0x1188c6){logger[_0xf693('0x10')](_0xf693('0x1c'),_0x1188c6[_0xf693('0x12')],_0x5e02e0);_0xf4d20e(_0x4a5964[_0xf693('0x10')](0x1f4,_0x1188c6[_0xf693('0x12')]));});});}; \ No newline at end of file +var _0x6017=['http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x6017,0xae));var _0x7601=function(_0x44a801,_0x5a8595){_0x44a801=_0x44a801-0x0;var _0x3772e1=_0x6017[_0x44a801];return _0x3772e1;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var moment=require(_0x7601('0x2'));var BPromise=require('bluebird');var rs=require(_0x7601('0x3'));var fs=require('fs');var Redis=require(_0x7601('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7601('0x5'));var logger=require('../../config/logger')(_0x7601('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7601('0x7')][_0x7601('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcb5ed9,_0x34a36d,_0x2bc643){return new BPromise(function(_0xe6e524,_0x4ff3e4){return client[_0x7601('0x9')](_0xcb5ed9,_0x2bc643)[_0x7601('0xa')](function(_0xd3a338){logger['info'](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));logger[_0x7601('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x34a36d,_0x7601('0xc'),JSON[_0x7601('0xe')](_0xd3a338));if(_0xd3a338[_0x7601('0xf')]){if(_0xd3a338[_0x7601('0xf')][_0x7601('0x10')]===0x1f4){logger[_0x7601('0xf')](_0x7601('0xb'),_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0x4ff3e4(_0xd3a338[_0x7601('0xf')]['message']);}logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0xe6e524(_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);}else{logger[_0x7601('0x12')](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));_0xe6e524(_0xd3a338[_0x7601('0x13')][_0x7601('0x11')]);}})['catch'](function(_0xa0e556){logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xa0e556);_0x4ff3e4(_0xa0e556);});});}exports[_0x7601('0x14')]=function(_0x5c3fb7){var _0x5f530e=this;return new Promise(function(_0x22520e,_0x403e38){return db[_0x7601('0x15')][_0x7601('0x16')](_0x5c3fb7[_0x7601('0x17')],{'raw':_0x5c3fb7[_0x7601('0x18')]?_0x5c3fb7[_0x7601('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7601('0xa')](function(_0x1d58c0){logger['info'](_0x7601('0x14'),_0x5c3fb7);logger[_0x7601('0xd')](_0x7601('0x14'),_0x5c3fb7,JSON[_0x7601('0xe')](_0x1d58c0));_0x22520e(_0x1d58c0);})[_0x7601('0x19')](function(_0x12f3f6){logger['error'](_0x7601('0x14'),_0x12f3f6[_0x7601('0x11')],_0x5c3fb7);_0x403e38(_0x5f530e[_0x7601('0xf')](0x1f4,_0x12f3f6[_0x7601('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index faf70d9..fbe837c 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 _0x4301=['/process/:pid/kill','exports','express','./system.controller','isAuthenticated','get'];(function(_0x4e9de1,_0x189225){var _0x59fe48=function(_0x346f4a){while(--_0x346f4a){_0x4e9de1['push'](_0x4e9de1['shift']());}};_0x59fe48(++_0x189225);}(_0x4301,0x68));var _0x1430=function(_0x218296,_0x31976b){_0x218296=_0x218296-0x0;var _0x2c147c=_0x4301[_0x218296];return _0x2c147c;};'use strict';var express=require(_0x1430('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1430('0x1'));router['get']('/',auth[_0x1430('0x2')](),controller['index']);router[_0x1430('0x3')](_0x1430('0x4'),auth[_0x1430('0x2')](),controller['killProcess']);module[_0x1430('0x5')]=router; \ No newline at end of file +var _0x76d3=['killProcess','exports','express','./system.controller','isAuthenticated','index','get','/process/:pid/kill'];(function(_0xe88157,_0x965589){var _0xa9cf33=function(_0x222d32){while(--_0x222d32){_0xe88157['push'](_0xe88157['shift']());}};_0xa9cf33(++_0x965589);}(_0x76d3,0x1aa));var _0x376d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x76d3[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x376d('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x376d('0x1'));router['get']('/',auth[_0x376d('0x2')](),controller[_0x376d('0x3')]);router[_0x376d('0x4')](_0x376d('0x5'),auth[_0x376d('0x2')](),controller[_0x376d('0x6')]);module[_0x376d('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 4a2a683..ec8fb78 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 _0x7aa1=['../../config/logger','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','SIGINT','systeminformation','child_process'];(function(_0x16e2e6,_0x17f35f){var _0x34cea1=function(_0x31b6e5){while(--_0x31b6e5){_0x16e2e6['push'](_0x16e2e6['shift']());}};_0x34cea1(++_0x17f35f);}(_0x7aa1,0x184));var _0x17aa=function(_0x1bbbd9,_0x3e598a){_0x1bbbd9=_0x1bbbd9-0x0;var _0x54952e=_0x7aa1[_0x1bbbd9];return _0x54952e;};'use strict';var info=require(_0x17aa('0x0'));var exec=require(_0x17aa('0x1'))['exec'];var logger=require(_0x17aa('0x2'))('api');var util=require(_0x17aa('0x3'));var BPromise=require(_0x17aa('0x4'));var _=require(_0x17aa('0x5'));function handleError(_0x4125aa,_0x343f21,_0x4cf5dc){_0x343f21=_0x343f21||0x1f4;return function(_0x184da8){logger['error'](_0x17aa('0x6'),_0x4cf5dc,_0x343f21,util[_0x17aa('0x7')](_0x184da8,{'showHidden':![],'depth':null}));delete _0x184da8[_0x17aa('0x8')];_0x4125aa[_0x17aa('0x9')](_0x343f21)['send'](_0x184da8);};}exports[_0x17aa('0xa')]=function(_0x18af4a,_0x22785d){return info[_0x17aa('0xb')]()[_0x17aa('0xc')](function(_0x1cffc4){return _0x22785d[_0x17aa('0x9')](0xc8)[_0x17aa('0xd')](_0x1cffc4);})[_0x17aa('0xe')](function(_0x43bfbf){return _0x22785d['status'](0x1f4)[_0x17aa('0xd')](_0x43bfbf);});};exports[_0x17aa('0xf')]=function(_0x69eded,_0x35467f){var _0x2ab818=[_0x17aa('0x10')];return new BPromise(function(_0x5d76cb,_0x1e185a){return exec(util[_0x17aa('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x69eded['params']['pid']),function(_0x5834ef,_0x12d02c,_0x11e4e8){if(_0x5834ef){return _0x1e185a(_0x5834ef);}return _0x5d76cb(_0x12d02c);});})[_0x17aa('0xc')](function(_0x4c241c){var _0x539758=![];var _0x353029=_0x4c241c[_0x17aa('0x12')](/\n/);for(var _0x17e7f9=0x0,_0x36bc2d=_0x2ab818[_0x17aa('0x13')];_0x17e7f9<_0x36bc2d,_0x539758===![];_0x17e7f9+=0x1){if(_0x4c241c[_0x17aa('0x14')](_0x2ab818[_0x17e7f9])>=0x0){_0x539758=!![];}}if(!_0x539758){throw new Error(util['format'](_0x17aa('0x15'),_0x69eded[_0x17aa('0x16')][_0x17aa('0x17')]));}process[_0x17aa('0x18')](_0x69eded['params'][_0x17aa('0x17')],_0x17aa('0x19'));return _0x35467f[_0x17aa('0x9')](0xc8)[_0x17aa('0xd')]({'message':util[_0x17aa('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x69eded[_0x17aa('0x16')]['pid'])});})['catch'](handleError(_0x35467f,null,'killProcess'));}; \ No newline at end of file +var _0x62f8=['SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill'];(function(_0x2cfb27,_0x4dccfd){var _0x56be44=function(_0x2940e9){while(--_0x2940e9){_0x2cfb27['push'](_0x2cfb27['shift']());}};_0x56be44(++_0x4dccfd);}(_0x62f8,0x99));var _0x862f=function(_0x225152,_0x403f3a){_0x225152=_0x225152-0x0;var _0x2c9a30=_0x62f8[_0x225152];return _0x2c9a30;};'use strict';var info=require(_0x862f('0x0'));var exec=require(_0x862f('0x1'))['exec'];var logger=require(_0x862f('0x2'))(_0x862f('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x862f('0x4'));function handleError(_0x368e2e,_0x3ed62c,_0x4dac75){_0x3ed62c=_0x3ed62c||0x1f4;return function(_0x538cb2){logger['error'](_0x862f('0x5'),_0x4dac75,_0x3ed62c,util[_0x862f('0x6')](_0x538cb2,{'showHidden':![],'depth':null}));delete _0x538cb2[_0x862f('0x7')];_0x368e2e[_0x862f('0x8')](_0x3ed62c)['send'](_0x538cb2);};}exports[_0x862f('0x9')]=function(_0x4ca5b5,_0x3e60a6){return info['getAllData']()[_0x862f('0xa')](function(_0x206a4a){return _0x3e60a6['status'](0xc8)['json'](_0x206a4a);})[_0x862f('0xb')](function(_0x58ac46){return _0x3e60a6[_0x862f('0x8')](0x1f4)['json'](_0x58ac46);});};exports[_0x862f('0xc')]=function(_0x3ac4df,_0xa8258d){var _0x579a5c=[_0x862f('0xd')];return new BPromise(function(_0x28a7c1,_0x10794a){return exec(util[_0x862f('0xe')](_0x862f('0xf'),_0x3ac4df[_0x862f('0x10')][_0x862f('0x11')]),function(_0x4c9632,_0x4a04ba,_0x30b167){if(_0x4c9632){return _0x10794a(_0x4c9632);}return _0x28a7c1(_0x4a04ba);});})[_0x862f('0xa')](function(_0x3ce171){var _0x2fe72d=![];var _0x23a252=_0x3ce171[_0x862f('0x12')](/\n/);for(var _0x261b7a=0x0,_0x388bea=_0x579a5c[_0x862f('0x13')];_0x261b7a<_0x388bea,_0x2fe72d===![];_0x261b7a+=0x1){if(_0x3ce171[_0x862f('0x14')](_0x579a5c[_0x261b7a])>=0x0){_0x2fe72d=!![];}}if(!_0x2fe72d){throw new Error(util[_0x862f('0xe')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x3ac4df[_0x862f('0x10')][_0x862f('0x11')]));}process[_0x862f('0x15')](_0x3ac4df[_0x862f('0x10')][_0x862f('0x11')],_0x862f('0x16'));return _0xa8258d['status'](0xc8)[_0x862f('0x17')]({'message':util[_0x862f('0xe')](_0x862f('0x18'),_0x3ac4df[_0x862f('0x10')][_0x862f('0x11')])});})[_0x862f('0xb')](handleError(_0xa8258d,null,_0x862f('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 780190b..25af659 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 _0xb8a0=['connect-timeout','Router','./tag.controller','get','isAuthenticated','/:id','show','create','update','util','path'];(function(_0x8ae2ec,_0x217b67){var _0x21b154=function(_0x2a5992){while(--_0x2a5992){_0x8ae2ec['push'](_0x8ae2ec['shift']());}};_0x21b154(++_0x217b67);}(_0xb8a0,0x111));var _0x0b8a=function(_0x5a6fc8,_0x31162d){_0x5a6fc8=_0x5a6fc8-0x0;var _0x1b001b=_0xb8a0[_0x5a6fc8];return _0x1b001b;};'use strict';var multer=require('multer');var util=require(_0x0b8a('0x0'));var path=require(_0x0b8a('0x1'));var timeout=require(_0x0b8a('0x2'));var express=require('express');var router=express[_0x0b8a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0b8a('0x4'));router[_0x0b8a('0x5')]('/',auth[_0x0b8a('0x6')](),controller['index']);router[_0x0b8a('0x5')](_0x0b8a('0x7'),auth[_0x0b8a('0x6')](),controller[_0x0b8a('0x8')]);router['post']('/',auth[_0x0b8a('0x6')](),controller[_0x0b8a('0x9')]);router['put'](_0x0b8a('0x7'),auth[_0x0b8a('0x6')](),controller[_0x0b8a('0xa')]);router['delete'](_0x0b8a('0x7'),auth[_0x0b8a('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x15da=['post','create','put','/:id','update','delete','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show'];(function(_0x28bede,_0x25dc5f){var _0x124dab=function(_0x977ade){while(--_0x977ade){_0x28bede['push'](_0x28bede['shift']());}};_0x124dab(++_0x25dc5f);}(_0x15da,0x98));var _0xa15d=function(_0x54e333,_0x4ba478){_0x54e333=_0x54e333-0x0;var _0x47279e=_0x15da[_0x54e333];return _0x47279e;};'use strict';var multer=require('multer');var util=require(_0xa15d('0x0'));var path=require(_0xa15d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa15d('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa15d('0x3'));var config=require(_0xa15d('0x4'));var controller=require(_0xa15d('0x5'));router[_0xa15d('0x6')]('/',auth[_0xa15d('0x7')](),controller[_0xa15d('0x8')]);router[_0xa15d('0x6')]('/:id',auth[_0xa15d('0x7')](),controller[_0xa15d('0x9')]);router[_0xa15d('0xa')]('/',auth[_0xa15d('0x7')](),controller[_0xa15d('0xb')]);router[_0xa15d('0xc')](_0xa15d('0xd'),auth[_0xa15d('0x7')](),controller[_0xa15d('0xe')]);router[_0xa15d('0xf')]('/:id',auth[_0xa15d('0x7')](),controller[_0xa15d('0x10')]);module[_0xa15d('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 4c2495b..9988540 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 _0xbfcc=['#0091EA','sequelize','name','STRING'];(function(_0x55d47b,_0x746ef4){var _0x7aa983=function(_0x4a2888){while(--_0x4a2888){_0x55d47b['push'](_0x55d47b['shift']());}};_0x7aa983(++_0x746ef4);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xbfcc[_0xd2d54];return _0x78b113;};'use strict';var Sequelize=require(_0xcbfc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcbfc('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xcbfc('0x2')],'defaultValue':_0xcbfc('0x3')},'description':{'type':Sequelize[_0xcbfc('0x2')]}}; \ No newline at end of file +var _0x594d=['STRING','#0091EA','sequelize','name'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x594d,0x92));var _0xd594=function(_0x1c04e6,_0x3946de){_0x1c04e6=_0x1c04e6-0x0;var _0x57d820=_0x594d[_0x1c04e6];return _0x57d820;};'use strict';var Sequelize=require(_0xd594('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd594('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd594('0x2')],'defaultValue':_0xd594('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 704ffb9..85b5487 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 _0x984b=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','get','Tags','UserProfileResource','error','name','send','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x54655b,_0x2dcd1d){var _0x44e2d7=function(_0x7bd9d){while(--_0x7bd9d){_0x54655b['push'](_0x54655b['shift']());}};_0x44e2d7(++_0x2dcd1d);}(_0x984b,0xee));var _0xb984=function(_0xcd2a90,_0x2dd38b){_0xcd2a90=_0xcd2a90-0x0;var _0x5a4f64=_0x984b[_0xcd2a90];return _0x5a4f64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb984('0x0'));var rp=require(_0xb984('0x1'));var moment=require(_0xb984('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb984('0x3'));var path=require(_0xb984('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb984('0x5'));var fs=require('fs');var fs_extra=require(_0xb984('0x6'));var _=require('lodash');var squel=require(_0xb984('0x7'));var crypto=require(_0xb984('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb984('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb984('0xa'));var Papa=require(_0xb984('0xb'));var Redis=require(_0xb984('0xc'));var authService=require(_0xb984('0xd'));var qs=require(_0xb984('0xe'));var as=require(_0xb984('0xf'));var hardwareService=require(_0xb984('0x10'));var logger=require(_0xb984('0x11'))(_0xb984('0x12'));var utils=require(_0xb984('0x13'));var config=require(_0xb984('0x14'));var licenseUtil=require(_0xb984('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b922b,_0x4b9c75){_0x4b9c75=_0x4b9c75||0xcc;return function(_0x61432f){if(_0x61432f){return _0x1b922b[_0xb984('0x16')](_0x4b9c75);}return _0x1b922b['status'](_0x4b9c75)[_0xb984('0x17')]();};}function respondWithResult(_0x2e7986,_0x564d24){_0x564d24=_0x564d24||0xc8;return function(_0x203dba){if(_0x203dba){return _0x2e7986[_0xb984('0x18')](_0x564d24)['json'](_0x203dba);}};}function respondWithFilteredResult(_0xede12d,_0x4073cb){return function(_0x57365c){if(_0x57365c){var _0x6fae41=typeof _0x4073cb['offset']===_0xb984('0x19')&&typeof _0x4073cb[_0xb984('0x1a')]===_0xb984('0x19');var _0x3f7cff=_0x57365c['count'];var _0x396c36=_0x6fae41?0x0:_0x4073cb[_0xb984('0x1b')];var _0x3a5c96=_0x6fae41?_0x57365c[_0xb984('0x1c')]:_0x4073cb[_0xb984('0x1b')]+_0x4073cb[_0xb984('0x1a')];var _0x5c2e25;if(_0x3a5c96>=_0x3f7cff){_0x3a5c96=_0x3f7cff;_0x5c2e25=0xc8;}else{_0x5c2e25=0xce;}_0xede12d[_0xb984('0x18')](_0x5c2e25);return _0xede12d[_0xb984('0x1d')](_0xb984('0x1e'),_0x396c36+'-'+_0x3a5c96+'/'+_0x3f7cff)[_0xb984('0x1f')](_0x57365c);}return null;};}function patchUpdates(_0x32831b){return function(_0xcf9365){try{jsonpatch['apply'](_0xcf9365,_0x32831b,!![]);}catch(_0x39d16f){return BPromise[_0xb984('0x20')](_0x39d16f);}return _0xcf9365['save']();};}function saveUpdates(_0x44b570,_0x97af5c){return function(_0x14734a){if(_0x14734a){return _0x14734a[_0xb984('0x21')](_0x44b570)[_0xb984('0x22')](function(_0x286033){return _0x286033;});}return null;};}function removeEntity(_0x41510a,_0x52c581){return function(_0x391a1e){if(_0x391a1e){return _0x391a1e[_0xb984('0x23')]()[_0xb984('0x22')](function(){var _0x5d4d38=_0x391a1e[_0xb984('0x24')]({'plain':!![]});var _0x2e806e=_0xb984('0x25');return db[_0xb984('0x26')][_0xb984('0x23')]({'where':{'type':_0x2e806e,'resourceId':_0x5d4d38['id']}})[_0xb984('0x22')](function(){return _0x391a1e;});})[_0xb984('0x22')](function(){_0x41510a[_0xb984('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249d47,_0x469af6){return function(_0x3e254b){if(!_0x3e254b){_0x249d47[_0xb984('0x16')](0x194);}return _0x3e254b;};}function handleError(_0x4fb896,_0xa44895){_0xa44895=_0xa44895||0x1f4;return function(_0x67e4d3){logger[_0xb984('0x27')](_0x67e4d3['stack']);if(_0x67e4d3[_0xb984('0x28')]){delete _0x67e4d3[_0xb984('0x28')];}_0x4fb896[_0xb984('0x18')](_0xa44895)[_0xb984('0x29')](_0x67e4d3);};}exports['index']=function(_0x5b8da1,_0x4dcf73){var _0x10b9ac={},_0x23ecf6={},_0x58a98c={'count':0x0,'rows':[]};var _0x320bef=_[_0xb984('0x2a')](db[_0xb984('0x2b')][_0xb984('0x2c')],function(_0x518bef){return{'name':_0x518bef['fieldName'],'type':_0x518bef[_0xb984('0x2d')][_0xb984('0x2e')]};});_0x23ecf6[_0xb984('0x2f')]=_[_0xb984('0x2a')](_0x320bef,'name');_0x23ecf6[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5b8da1[_0xb984('0x30')]);_0x23ecf6[_0xb984('0x32')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],_0x23ecf6['query']);_0x10b9ac[_0xb984('0x34')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],qs[_0xb984('0x35')](_0x5b8da1[_0xb984('0x30')][_0xb984('0x35')]));_0x10b9ac['attributes']=_0x10b9ac[_0xb984('0x34')][_0xb984('0x36')]?_0x10b9ac['attributes']:_0x23ecf6['model'];if(!_0x5b8da1[_0xb984('0x30')]['hasOwnProperty'](_0xb984('0x37'))){_0x10b9ac[_0xb984('0x1a')]=qs['limit'](_0x5b8da1[_0xb984('0x30')]['limit']);_0x10b9ac[_0xb984('0x1b')]=qs['offset'](_0x5b8da1[_0xb984('0x30')]['offset']);}_0x10b9ac['order']=qs[_0xb984('0x38')](_0x5b8da1[_0xb984('0x30')]['sort']);_0x10b9ac[_0xb984('0x39')]=qs[_0xb984('0x32')](_['pick'](_0x5b8da1[_0xb984('0x30')],_0x23ecf6[_0xb984('0x32')]),_0x320bef);if(_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]){_0x10b9ac['where']=_[_0xb984('0x3b')](_0x10b9ac[_0xb984('0x39')],{'$or':_[_0xb984('0x2a')](_0x320bef,function(_0x474fbd){if(_0x474fbd[_0xb984('0x2d')]!==_0xb984('0x3c')){var _0xc257ee={};_0xc257ee[_0x474fbd[_0xb984('0x28')]]={'$like':'%'+_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]+'%'};return _0xc257ee;}})});}_0x10b9ac=_['merge']({},_0x10b9ac,_0x5b8da1[_0xb984('0x3d')]);var _0xd10521={'where':_0x10b9ac[_0xb984('0x39')]};return db[_0xb984('0x2b')][_0xb984('0x1c')](_0xd10521)[_0xb984('0x22')](function(_0x1e8323){_0x58a98c[_0xb984('0x1c')]=_0x1e8323;if(_0x5b8da1['query']['includeAll']){_0x10b9ac[_0xb984('0x3e')]=[{'all':!![]}];}return db['Tag'][_0xb984('0x3f')](_0x10b9ac);})[_0xb984('0x22')](function(_0x216df6){_0x58a98c[_0xb984('0x40')]=_0x216df6;return _0x58a98c;})['then'](respondWithFilteredResult(_0x4dcf73,_0x10b9ac))[_0xb984('0x41')](handleError(_0x4dcf73,null));};exports[_0xb984('0x42')]=function(_0x5d5e85,_0x21a5bb){var _0xb61add={'raw':!![],'where':{'id':_0x5d5e85[_0xb984('0x43')]['id']}},_0x38a025={};_0x38a025[_0xb984('0x2f')]=_[_0xb984('0x31')](db[_0xb984('0x2b')]['rawAttributes']);_0x38a025[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5d5e85['query']);_0x38a025['filters']=_[_0xb984('0x33')](_0x38a025[_0xb984('0x2f')],_0x38a025[_0xb984('0x30')]);_0xb61add[_0xb984('0x34')]=_[_0xb984('0x33')](_0x38a025['model'],qs[_0xb984('0x35')](_0x5d5e85[_0xb984('0x30')][_0xb984('0x35')]));_0xb61add[_0xb984('0x34')]=_0xb61add[_0xb984('0x34')][_0xb984('0x36')]?_0xb61add[_0xb984('0x34')]:_0x38a025[_0xb984('0x2f')];if(_0x5d5e85[_0xb984('0x30')][_0xb984('0x44')]){_0xb61add['include']=[{'all':!![]}];}_0xb61add=_[_0xb984('0x3b')]({},_0xb61add,_0x5d5e85[_0xb984('0x3d')]);return db['Tag'][_0xb984('0x45')](_0xb61add)[_0xb984('0x22')](handleEntityNotFound(_0x21a5bb,null))[_0xb984('0x22')](respondWithResult(_0x21a5bb,null))[_0xb984('0x41')](handleError(_0x21a5bb,null));};exports[_0xb984('0x46')]=function(_0x49dde7,_0x10f813){return db[_0xb984('0x2b')][_0xb984('0x46')](_0x49dde7[_0xb984('0x47')],{})['then'](function(_0x2753e3){var _0x303280=_0x49dde7[_0xb984('0x48')][_0xb984('0x24')]({'plain':!![]});if(!_0x303280)throw new Error(_0xb984('0x49'));if(_0x303280[_0xb984('0x4a')]===_0xb984('0x48')){var _0x445f90=_0x2753e3[_0xb984('0x24')]({'plain':!![]});var _0x5c3d82=_0xb984('0x25');return db[_0xb984('0x4b')][_0xb984('0x45')]({'where':{'name':_0x5c3d82,'userProfileId':_0x303280['userProfileId']},'raw':!![]})[_0xb984('0x22')](function(_0x42a9f8){if(_0x42a9f8&&_0x42a9f8['autoAssociation']===0x0){return db[_0xb984('0x26')]['create']({'name':_0x445f90[_0xb984('0x28')],'resourceId':_0x445f90['id'],'type':_0x42a9f8[_0xb984('0x28')],'sectionId':_0x42a9f8['id']},{})['then'](function(){return _0x2753e3;});}else{return _0x2753e3;}})[_0xb984('0x41')](function(_0x38b1cb){logger[_0xb984('0x27')](_0xb984('0x4c'),_0x38b1cb);throw _0x38b1cb;});}return _0x2753e3;})[_0xb984('0x22')](respondWithResult(_0x10f813,0xc9))[_0xb984('0x41')](handleError(_0x10f813,null));};exports['update']=function(_0x1774a3,_0x5d06f8){if(_0x1774a3[_0xb984('0x47')]['id']){delete _0x1774a3[_0xb984('0x47')]['id'];}return db[_0xb984('0x2b')]['find']({'where':{'id':_0x1774a3['params']['id']}})[_0xb984('0x22')](handleEntityNotFound(_0x5d06f8,null))[_0xb984('0x22')](saveUpdates(_0x1774a3['body'],null))['then'](respondWithResult(_0x5d06f8,null))[_0xb984('0x41')](handleError(_0x5d06f8,null));};exports[_0xb984('0x23')]=function(_0x38cca4,_0x3daaa0){return db[_0xb984('0x2b')][_0xb984('0x45')]({'where':{'id':_0x38cca4['params']['id']}})['then'](handleEntityNotFound(_0x3daaa0,null))[_0xb984('0x22')](removeEntity(_0x3daaa0,null))[_0xb984('0x41')](handleError(_0x3daaa0,null));}; \ No newline at end of file +var _0xf120=['apply','reject','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','map','Tag','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','Content-Range'];(function(_0x572499,_0x37619d){var _0x5466e3=function(_0x1c78a7){while(--_0x1c78a7){_0x572499['push'](_0x572499['shift']());}};_0x5466e3(++_0x37619d);}(_0xf120,0x179));var _0x0f12=function(_0xf1c43a,_0x35b9af){_0xf1c43a=_0xf1c43a-0x0;var _0x1d422d=_0xf120[_0xf1c43a];return _0x1d422d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f12('0x0'));var zipdir=require(_0x0f12('0x1'));var jsonpatch=require(_0x0f12('0x2'));var rp=require('request-promise');var moment=require(_0x0f12('0x3'));var BPromise=require(_0x0f12('0x4'));var Mustache=require(_0x0f12('0x5'));var util=require('util');var path=require(_0x0f12('0x6'));var sox=require(_0x0f12('0x7'));var csv=require(_0x0f12('0x8'));var ejs=require(_0x0f12('0x9'));var fs=require('fs');var fs_extra=require(_0x0f12('0xa'));var _=require(_0x0f12('0xb'));var squel=require(_0x0f12('0xc'));var crypto=require(_0x0f12('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0f12('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f12('0xf'));var Papa=require(_0x0f12('0x10'));var Redis=require(_0x0f12('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f12('0x12'));var hardwareService=require(_0x0f12('0x13'));var logger=require(_0x0f12('0x14'))(_0x0f12('0x15'));var utils=require(_0x0f12('0x16'));var config=require(_0x0f12('0x17'));var licenseUtil=require(_0x0f12('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf75042,_0x11a236){_0x11a236=_0x11a236||0xcc;return function(_0xb80905){if(_0xb80905){return _0xf75042[_0x0f12('0x19')](_0x11a236);}return _0xf75042[_0x0f12('0x1a')](_0x11a236)[_0x0f12('0x1b')]();};}function respondWithResult(_0x35ef6f,_0x7f1ae7){_0x7f1ae7=_0x7f1ae7||0xc8;return function(_0x215a7a){if(_0x215a7a){return _0x35ef6f[_0x0f12('0x1a')](_0x7f1ae7)[_0x0f12('0x1c')](_0x215a7a);}};}function respondWithFilteredResult(_0x3f2716,_0xe61624){return function(_0x27addc){if(_0x27addc){var _0xeccb7c=typeof _0xe61624['offset']===_0x0f12('0x1d')&&typeof _0xe61624['limit']===_0x0f12('0x1d');var _0x3a7041=_0x27addc[_0x0f12('0x1e')];var _0x12eb6c=_0xeccb7c?0x0:_0xe61624[_0x0f12('0x1f')];var _0xa2168f=_0xeccb7c?_0x27addc['count']:_0xe61624[_0x0f12('0x1f')]+_0xe61624['limit'];var _0x18d689;if(_0xa2168f>=_0x3a7041){_0xa2168f=_0x3a7041;_0x18d689=0xc8;}else{_0x18d689=0xce;}_0x3f2716['status'](_0x18d689);return _0x3f2716['set'](_0x0f12('0x20'),_0x12eb6c+'-'+_0xa2168f+'/'+_0x3a7041)[_0x0f12('0x1c')](_0x27addc);}return null;};}function patchUpdates(_0x46e682){return function(_0x5e4af9){try{jsonpatch[_0x0f12('0x21')](_0x5e4af9,_0x46e682,!![]);}catch(_0x4bfc5d){return BPromise[_0x0f12('0x22')](_0x4bfc5d);}return _0x5e4af9['save']();};}function saveUpdates(_0x9f283b,_0x379851){return function(_0x4f06bd){if(_0x4f06bd){return _0x4f06bd[_0x0f12('0x23')](_0x9f283b)[_0x0f12('0x24')](function(_0x3a28ae){return _0x3a28ae;});}return null;};}function removeEntity(_0x3821dd,_0x44f3b1){return function(_0x59d65b){if(_0x59d65b){return _0x59d65b[_0x0f12('0x25')]()['then'](function(){var _0x4c3a28=_0x59d65b['get']({'plain':!![]});var _0xee18d0=_0x0f12('0x26');return db[_0x0f12('0x27')][_0x0f12('0x25')]({'where':{'type':_0xee18d0,'resourceId':_0x4c3a28['id']}})['then'](function(){return _0x59d65b;});})[_0x0f12('0x24')](function(){_0x3821dd[_0x0f12('0x1a')](0xcc)[_0x0f12('0x1b')]();});}};}function handleEntityNotFound(_0x5ca297,_0x13baa0){return function(_0x2fdde4){if(!_0x2fdde4){_0x5ca297[_0x0f12('0x19')](0x194);}return _0x2fdde4;};}function handleError(_0x5cb12b,_0xeee65){_0xeee65=_0xeee65||0x1f4;return function(_0x25a5dc){logger[_0x0f12('0x28')](_0x25a5dc[_0x0f12('0x29')]);if(_0x25a5dc[_0x0f12('0x2a')]){delete _0x25a5dc['name'];}_0x5cb12b['status'](_0xeee65)[_0x0f12('0x2b')](_0x25a5dc);};}exports['index']=function(_0x3516f8,_0x3c6ce5){var _0x453f9e={},_0x52fc14={},_0x12a575={'count':0x0,'rows':[]};var _0x45a39a=_[_0x0f12('0x2c')](db[_0x0f12('0x2d')][_0x0f12('0x2e')],function(_0x25d56e){return{'name':_0x25d56e['fieldName'],'type':_0x25d56e[_0x0f12('0x2f')][_0x0f12('0x30')]};});_0x52fc14[_0x0f12('0x31')]=_['map'](_0x45a39a,_0x0f12('0x2a'));_0x52fc14[_0x0f12('0x32')]=_[_0x0f12('0x33')](_0x3516f8[_0x0f12('0x32')]);_0x52fc14['filters']=_[_0x0f12('0x34')](_0x52fc14[_0x0f12('0x31')],_0x52fc14[_0x0f12('0x32')]);_0x453f9e[_0x0f12('0x35')]=_[_0x0f12('0x34')](_0x52fc14[_0x0f12('0x31')],qs[_0x0f12('0x36')](_0x3516f8['query'][_0x0f12('0x36')]));_0x453f9e[_0x0f12('0x35')]=_0x453f9e['attributes'][_0x0f12('0x37')]?_0x453f9e[_0x0f12('0x35')]:_0x52fc14['model'];if(!_0x3516f8[_0x0f12('0x32')][_0x0f12('0x38')]('nolimit')){_0x453f9e[_0x0f12('0x39')]=qs['limit'](_0x3516f8[_0x0f12('0x32')][_0x0f12('0x39')]);_0x453f9e[_0x0f12('0x1f')]=qs[_0x0f12('0x1f')](_0x3516f8[_0x0f12('0x32')][_0x0f12('0x1f')]);}_0x453f9e[_0x0f12('0x3a')]=qs[_0x0f12('0x3b')](_0x3516f8[_0x0f12('0x32')][_0x0f12('0x3b')]);_0x453f9e['where']=qs[_0x0f12('0x3c')](_[_0x0f12('0x3d')](_0x3516f8[_0x0f12('0x32')],_0x52fc14['filters']),_0x45a39a);if(_0x3516f8['query']['filter']){_0x453f9e[_0x0f12('0x3e')]=_[_0x0f12('0x3f')](_0x453f9e['where'],{'$or':_['map'](_0x45a39a,function(_0x21be62){if(_0x21be62[_0x0f12('0x2f')]!==_0x0f12('0x40')){var _0x51b8c8={};_0x51b8c8[_0x21be62[_0x0f12('0x2a')]]={'$like':'%'+_0x3516f8[_0x0f12('0x32')]['filter']+'%'};return _0x51b8c8;}})});}_0x453f9e=_[_0x0f12('0x3f')]({},_0x453f9e,_0x3516f8[_0x0f12('0x41')]);var _0x226be0={'where':_0x453f9e[_0x0f12('0x3e')]};return db[_0x0f12('0x2d')][_0x0f12('0x1e')](_0x226be0)[_0x0f12('0x24')](function(_0x4d9e11){_0x12a575[_0x0f12('0x1e')]=_0x4d9e11;if(_0x3516f8['query'][_0x0f12('0x42')]){_0x453f9e[_0x0f12('0x43')]=[{'all':!![]}];}return db['Tag'][_0x0f12('0x44')](_0x453f9e);})[_0x0f12('0x24')](function(_0x249dd4){_0x12a575['rows']=_0x249dd4;return _0x12a575;})['then'](respondWithFilteredResult(_0x3c6ce5,_0x453f9e))[_0x0f12('0x45')](handleError(_0x3c6ce5,null));};exports[_0x0f12('0x46')]=function(_0x106f93,_0x1637cb){var _0x5061bf={'raw':!![],'where':{'id':_0x106f93[_0x0f12('0x47')]['id']}},_0xbe1aca={};_0xbe1aca[_0x0f12('0x31')]=_[_0x0f12('0x33')](db['Tag'][_0x0f12('0x2e')]);_0xbe1aca[_0x0f12('0x32')]=_['keys'](_0x106f93['query']);_0xbe1aca[_0x0f12('0x3c')]=_[_0x0f12('0x34')](_0xbe1aca[_0x0f12('0x31')],_0xbe1aca['query']);_0x5061bf['attributes']=_[_0x0f12('0x34')](_0xbe1aca[_0x0f12('0x31')],qs['fields'](_0x106f93[_0x0f12('0x32')]['fields']));_0x5061bf[_0x0f12('0x35')]=_0x5061bf[_0x0f12('0x35')]['length']?_0x5061bf['attributes']:_0xbe1aca[_0x0f12('0x31')];if(_0x106f93[_0x0f12('0x32')][_0x0f12('0x42')]){_0x5061bf[_0x0f12('0x43')]=[{'all':!![]}];}_0x5061bf=_[_0x0f12('0x3f')]({},_0x5061bf,_0x106f93[_0x0f12('0x41')]);return db[_0x0f12('0x2d')][_0x0f12('0x48')](_0x5061bf)['then'](handleEntityNotFound(_0x1637cb,null))[_0x0f12('0x24')](respondWithResult(_0x1637cb,null))['catch'](handleError(_0x1637cb,null));};exports[_0x0f12('0x49')]=function(_0x52f1c2,_0x4add76){return db[_0x0f12('0x2d')]['create'](_0x52f1c2[_0x0f12('0x4a')],{})[_0x0f12('0x24')](function(_0x4298c8){var _0x284422=_0x52f1c2['user'][_0x0f12('0x4b')]({'plain':!![]});if(!_0x284422)throw new Error(_0x0f12('0x4c'));if(_0x284422[_0x0f12('0x4d')]===_0x0f12('0x4e')){var _0x48acec=_0x4298c8['get']({'plain':!![]});var _0x122a57=_0x0f12('0x26');return db[_0x0f12('0x4f')][_0x0f12('0x48')]({'where':{'name':_0x122a57,'userProfileId':_0x284422[_0x0f12('0x50')]},'raw':!![]})['then'](function(_0x48b7ec){if(_0x48b7ec&&_0x48b7ec['autoAssociation']===0x0){return db[_0x0f12('0x27')][_0x0f12('0x49')]({'name':_0x48acec[_0x0f12('0x2a')],'resourceId':_0x48acec['id'],'type':_0x48b7ec[_0x0f12('0x2a')],'sectionId':_0x48b7ec['id']},{})[_0x0f12('0x24')](function(){return _0x4298c8;});}else{return _0x4298c8;}})[_0x0f12('0x45')](function(_0x104ced){logger[_0x0f12('0x28')](_0x0f12('0x51'),_0x104ced);throw _0x104ced;});}return _0x4298c8;})[_0x0f12('0x24')](respondWithResult(_0x4add76,0xc9))[_0x0f12('0x45')](handleError(_0x4add76,null));};exports['update']=function(_0x1f05f6,_0x3dff95){if(_0x1f05f6[_0x0f12('0x4a')]['id']){delete _0x1f05f6[_0x0f12('0x4a')]['id'];}return db['Tag']['find']({'where':{'id':_0x1f05f6[_0x0f12('0x47')]['id']}})[_0x0f12('0x24')](handleEntityNotFound(_0x3dff95,null))[_0x0f12('0x24')](saveUpdates(_0x1f05f6[_0x0f12('0x4a')],null))[_0x0f12('0x24')](respondWithResult(_0x3dff95,null))[_0x0f12('0x45')](handleError(_0x3dff95,null));};exports[_0x0f12('0x25')]=function(_0x45da7f,_0x5b2bb1){return db[_0x0f12('0x2d')][_0x0f12('0x48')]({'where':{'id':_0x45da7f['params']['id']}})[_0x0f12('0x24')](handleEntityNotFound(_0x5b2bb1,null))[_0x0f12('0x24')](removeEntity(_0x5b2bb1,null))[_0x0f12('0x45')](handleError(_0x5b2bb1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 612bb1a..363b17a 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 _0xfeb3=['exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfeb3,0x19b));var _0x3feb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfeb3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3feb('0x0'));var util=require(_0x3feb('0x1'));var logger=require(_0x3feb('0x2'))(_0x3feb('0x3'));var moment=require(_0x3feb('0x4'));var BPromise=require('bluebird');var rp=require(_0x3feb('0x5'));var fs=require('fs');var path=require(_0x3feb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x3feb('0x7')]=function(_0x5b4838,_0x762e44){return _0x5b4838[_0x3feb('0x8')](_0x3feb('0x9'),attributes,{'tableName':_0x3feb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4564=['./tag.attributes','exports','Tag','tools_tags','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);}(_0x4564,0x86));var _0x4456=function(_0x3edc26,_0x5f2929){_0x3edc26=_0x3edc26-0x0;var _0x4df0b1=_0x4564[_0x3edc26];return _0x4df0b1;};'use strict';var _=require(_0x4456('0x0'));var util=require(_0x4456('0x1'));var logger=require(_0x4456('0x2'))(_0x4456('0x3'));var moment=require(_0x4456('0x4'));var BPromise=require(_0x4456('0x5'));var rp=require(_0x4456('0x6'));var fs=require('fs');var path=require(_0x4456('0x7'));var rimraf=require(_0x4456('0x8'));var config=require('../../config/environment');var attributes=require(_0x4456('0x9'));module[_0x4456('0xa')]=function(_0x5d7319,_0x3ca43a){return _0x5d7319['define'](_0x4456('0xb'),attributes,{'tableName':_0x4456('0xc'),'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 4f22c68..6bfde78 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 _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23fde6,_0x8063f3){var _0x212570=function(_0x7545ee){while(--_0x7545ee){_0x23fde6['push'](_0x23fde6['shift']());}};_0x212570(++_0x8063f3);}(_0x68fc,0xa5));var _0xc68f=function(_0x4123d8,_0xff9e20){_0x4123d8=_0x4123d8-0x0;var _0x5a60d3=_0x68fc[_0x4123d8];return _0x5a60d3;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file +var _0x0c02=['Tag,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3c372b,_0x322351){var _0x3288e9=function(_0x12e58e){while(--_0x12e58e){_0x3c372b['push'](_0x3c372b['shift']());}};_0x3288e9(++_0x322351);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6408,_0x4e1dac,_0x5da127){return new BPromise(function(_0x4db532,_0x1e35e2){return client[_0x20c0('0xc')](_0x5d6408,_0x5da127)[_0x20c0('0xd')](function(_0x41a4af){logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x4e1dac,'request\x20sent',JSON['stringify'](_0x41a4af));if(_0x41a4af[_0x20c0('0x10')]){if(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x11')]===0x1f4){logger[_0x20c0('0x10')]('Tag,\x20%s,\x20%s',_0x4e1dac,_0x41a4af[_0x20c0('0x10')]['message']);return _0x1e35e2(_0x41a4af['error'][_0x20c0('0x12')]);}logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);return _0x4db532(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);}else{logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');_0x4db532(_0x41a4af[_0x20c0('0x13')][_0x20c0('0x12')]);}})[_0x20c0('0x14')](function(_0x46b9e5){logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x46b9e5);_0x1e35e2(_0x46b9e5);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f295698..358b295 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 7eced08..c7a8aa0 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 _0x0713=['STRING','name'];(function(_0x240552,_0x43d97f){var _0x6d4e3b=function(_0x4f2894){while(--_0x4f2894){_0x240552['push'](_0x240552['shift']());}};_0x6d4e3b(++_0x43d97f);}(_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 +var _0x0713=['STRING','name'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_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/team/team.controller.js b/server/api/team/team.controller.js index 168d6c1..469d564 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 _0x8fcd=['through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','isArray','Mail','Openchannel','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Team','includeAll','rows','catch','params','fields','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','userProfileId','autoAssociation','UserProfileResource','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','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','Sequelize','SmsQueueId','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','isValidChannel','channel','Unknown\x20channel','toLowerCase','Queue','options','capitalize','Queues','addQueues','ValidationError','removeQueues','ids','addAgents','Voice','Chat','Sms','Fax','Whatsapp','transaction'];(function(_0x5bf35e,_0x4ccc17){var _0x35b3d7=function(_0xefa9e4){while(--_0xefa9e4){_0x5bf35e['push'](_0x5bf35e['shift']());}};_0x35b3d7(++_0x4ccc17);}(_0x8fcd,0x143));var _0xd8fc=function(_0x54dc48,_0xf3557c){_0x54dc48=_0x54dc48-0x0;var _0x57237b=_0x8fcd[_0x54dc48];return _0x57237b;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd8fc('0x1'));var jsonpatch=require(_0xd8fc('0x2'));var rp=require('request-promise');var moment=require(_0xd8fc('0x3'));var BPromise=require(_0xd8fc('0x4'));var Mustache=require(_0xd8fc('0x5'));var util=require(_0xd8fc('0x6'));var path=require('path');var sox=require(_0xd8fc('0x7'));var csv=require(_0xd8fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8fc('0x9'));var _=require(_0xd8fc('0xa'));var squel=require(_0xd8fc('0xb'));var crypto=require(_0xd8fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd8fc('0xd'));var toCsv=require(_0xd8fc('0x8'));var querystring=require(_0xd8fc('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8fc('0xf'));var authService=require(_0xd8fc('0x10'));var qs=require(_0xd8fc('0x11'));var as=require(_0xd8fc('0x12'));var hardwareService=require(_0xd8fc('0x13'));var logger=require(_0xd8fc('0x14'))('api');var utils=require(_0xd8fc('0x15'));var config=require(_0xd8fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd8fc('0x17')](config[_0xd8fc('0x18')],{'host':_0xd8fc('0x19'),'port':0x18eb});var socket=require(_0xd8fc('0x1a'))(new Redis(config[_0xd8fc('0x18')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x27315e,_0x9e722a){_0x9e722a=_0x9e722a||0xcc;return function(_0x467908){if(_0x467908){return _0x27315e[_0xd8fc('0x1b')](_0x9e722a);}return _0x27315e[_0xd8fc('0x1c')](_0x9e722a)[_0xd8fc('0x1d')]();};}function respondWithResult(_0x202b9d,_0xf9bf46){_0xf9bf46=_0xf9bf46||0xc8;return function(_0x52cc1a){if(_0x52cc1a){return _0x202b9d['status'](_0xf9bf46)[_0xd8fc('0x1e')](_0x52cc1a);}};}function respondWithFilteredResult(_0x4d3fdf,_0x1df3d5){return function(_0x15fac4){if(_0x15fac4){var _0x3844c9=typeof _0x1df3d5['offset']===_0xd8fc('0x1f')&&typeof _0x1df3d5[_0xd8fc('0x20')]===_0xd8fc('0x1f');var _0x305e2f=_0x15fac4['count'];var _0x4d9a3e=_0x3844c9?0x0:_0x1df3d5[_0xd8fc('0x21')];var _0x5430e4=_0x3844c9?_0x15fac4[_0xd8fc('0x22')]:_0x1df3d5[_0xd8fc('0x21')]+_0x1df3d5['limit'];var _0x1e2a35;if(_0x5430e4>=_0x305e2f){_0x5430e4=_0x305e2f;_0x1e2a35=0xc8;}else{_0x1e2a35=0xce;}_0x4d3fdf[_0xd8fc('0x1c')](_0x1e2a35);return _0x4d3fdf[_0xd8fc('0x23')]('Content-Range',_0x4d9a3e+'-'+_0x5430e4+'/'+_0x305e2f)[_0xd8fc('0x1e')](_0x15fac4);}return null;};}function patchUpdates(_0x1c572c){return function(_0x3d36bd){try{jsonpatch[_0xd8fc('0x24')](_0x3d36bd,_0x1c572c,!![]);}catch(_0x2c2164){return BPromise[_0xd8fc('0x25')](_0x2c2164);}return _0x3d36bd[_0xd8fc('0x26')]();};}function saveUpdates(_0x421518,_0x261836){return function(_0x525419){if(_0x525419){return _0x525419[_0xd8fc('0x27')](_0x421518)[_0xd8fc('0x28')](function(_0x3f8a17){return _0x3f8a17;});}return null;};}function handleEntityNotFound(_0x1e6bea,_0x11ae0a){return function(_0x4ef465){if(!_0x4ef465){_0x1e6bea[_0xd8fc('0x1b')](0x194);}return _0x4ef465;};}function handleError(_0x334eda,_0xcca1f0){_0xcca1f0=_0xcca1f0||0x1f4;return function(_0x2f65ee){logger[_0xd8fc('0x29')](_0x2f65ee[_0xd8fc('0x2a')]);if(_0x2f65ee[_0xd8fc('0x2b')]){delete _0x2f65ee[_0xd8fc('0x2b')];}_0x334eda[_0xd8fc('0x1c')](_0xcca1f0)[_0xd8fc('0x2c')](_0x2f65ee);};}exports['index']=function(_0x41dea0,_0x554f15){var _0x1444ab={},_0x45e6bf={},_0x1bad1f={'count':0x0,'rows':[]};var _0x23a6f4=_[_0xd8fc('0x2d')](db['Team'][_0xd8fc('0x2e')],function(_0x2da618){return{'name':_0x2da618[_0xd8fc('0x2f')],'type':_0x2da618[_0xd8fc('0x30')][_0xd8fc('0x31')]};});_0x45e6bf[_0xd8fc('0x32')]=_[_0xd8fc('0x2d')](_0x23a6f4,_0xd8fc('0x2b'));_0x45e6bf['query']=_[_0xd8fc('0x33')](_0x41dea0[_0xd8fc('0x34')]);_0x45e6bf[_0xd8fc('0x35')]=_[_0xd8fc('0x36')](_0x45e6bf[_0xd8fc('0x32')],_0x45e6bf[_0xd8fc('0x34')]);_0x1444ab[_0xd8fc('0x37')]=_['intersection'](_0x45e6bf[_0xd8fc('0x32')],qs['fields'](_0x41dea0['query']['fields']));_0x1444ab[_0xd8fc('0x37')]=_0x1444ab['attributes']['length']?_0x1444ab[_0xd8fc('0x37')]:_0x45e6bf['model'];if(!_0x41dea0[_0xd8fc('0x34')][_0xd8fc('0x38')](_0xd8fc('0x39'))){_0x1444ab['limit']=qs[_0xd8fc('0x20')](_0x41dea0[_0xd8fc('0x34')]['limit']);_0x1444ab[_0xd8fc('0x21')]=qs[_0xd8fc('0x21')](_0x41dea0[_0xd8fc('0x34')][_0xd8fc('0x21')]);}_0x1444ab[_0xd8fc('0x3a')]=qs[_0xd8fc('0x3b')](_0x41dea0['query'][_0xd8fc('0x3b')]);_0x1444ab['where']=qs[_0xd8fc('0x35')](_[_0xd8fc('0x3c')](_0x41dea0[_0xd8fc('0x34')],_0x45e6bf['filters']),_0x23a6f4);if(_0x41dea0[_0xd8fc('0x34')][_0xd8fc('0x3d')]){_0x1444ab[_0xd8fc('0x3e')]=_[_0xd8fc('0x3f')](_0x1444ab[_0xd8fc('0x3e')],{'$or':_[_0xd8fc('0x2d')](_0x23a6f4,function(_0x410306){if(_0x410306[_0xd8fc('0x30')]!==_0xd8fc('0x40')){var _0x542d73={};_0x542d73[_0x410306[_0xd8fc('0x2b')]]={'$like':'%'+_0x41dea0['query'][_0xd8fc('0x3d')]+'%'};return _0x542d73;}})});}_0x1444ab=_[_0xd8fc('0x3f')]({},_0x1444ab,_0x41dea0['options']);var _0x2b54ea={'where':_0x1444ab['where']};return db[_0xd8fc('0x41')]['count'](_0x2b54ea)[_0xd8fc('0x28')](function(_0x278a52){_0x1bad1f[_0xd8fc('0x22')]=_0x278a52;if(_0x41dea0['query'][_0xd8fc('0x42')]){_0x1444ab['include']=[{'all':!![]}];}return db[_0xd8fc('0x41')]['findAll'](_0x1444ab);})[_0xd8fc('0x28')](function(_0x4c6a87){_0x1bad1f[_0xd8fc('0x43')]=_0x4c6a87;return _0x1bad1f;})[_0xd8fc('0x28')](respondWithFilteredResult(_0x554f15,_0x1444ab))[_0xd8fc('0x44')](handleError(_0x554f15,null));};exports['show']=function(_0x4fe69d,_0x12e7f2){var _0x4dc5ed={'raw':![],'where':{'id':_0x4fe69d[_0xd8fc('0x45')]['id']}},_0x1857b7={};_0x1857b7['model']=_[_0xd8fc('0x33')](db[_0xd8fc('0x41')][_0xd8fc('0x2e')]);_0x1857b7[_0xd8fc('0x34')]=_[_0xd8fc('0x33')](_0x4fe69d[_0xd8fc('0x34')]);_0x1857b7[_0xd8fc('0x35')]=_[_0xd8fc('0x36')](_0x1857b7[_0xd8fc('0x32')],_0x1857b7['query']);_0x4dc5ed[_0xd8fc('0x37')]=_['intersection'](_0x1857b7[_0xd8fc('0x32')],qs['fields'](_0x4fe69d[_0xd8fc('0x34')][_0xd8fc('0x46')]));_0x4dc5ed['attributes']=_0x4dc5ed[_0xd8fc('0x37')][_0xd8fc('0x47')]?_0x4dc5ed[_0xd8fc('0x37')]:_0x1857b7['model'];if(_0x4fe69d['query'][_0xd8fc('0x42')]){_0x4dc5ed[_0xd8fc('0x48')]=[{'all':!![]}];}_0x4dc5ed=_['merge']({},_0x4dc5ed,_0x4fe69d['options']);return db[_0xd8fc('0x41')][_0xd8fc('0x49')](_0x4dc5ed)[_0xd8fc('0x28')](handleEntityNotFound(_0x12e7f2,null))[_0xd8fc('0x28')](respondWithResult(_0x12e7f2,null))[_0xd8fc('0x44')](handleError(_0x12e7f2,null));};exports[_0xd8fc('0x4a')]=function(_0x3e8199,_0x2d331f){return db[_0xd8fc('0x41')]['create'](_0x3e8199['body'],{})['then'](function(_0x324258){var _0x44e851=_0x3e8199[_0xd8fc('0x4b')]['get']({'plain':!![]});if(!_0x44e851)throw new Error(_0xd8fc('0x4c'));if(_0x44e851[_0xd8fc('0x4d')]===_0xd8fc('0x4b')){var _0x2f68b3=_0x324258[_0xd8fc('0x4e')]({'plain':!![]});var _0x2567d1=_0xd8fc('0x4f');return db['UserProfileSection'][_0xd8fc('0x49')]({'where':{'name':_0x2567d1,'userProfileId':_0x44e851[_0xd8fc('0x50')]},'raw':!![]})['then'](function(_0x430d75){if(_0x430d75&&_0x430d75[_0xd8fc('0x51')]===0x0){return db[_0xd8fc('0x52')][_0xd8fc('0x4a')]({'name':_0x2f68b3['name'],'resourceId':_0x2f68b3['id'],'type':_0x430d75[_0xd8fc('0x2b')],'sectionId':_0x430d75['id']},{})['then'](function(){return _0x324258;});}else{return _0x324258;}})[_0xd8fc('0x44')](function(_0x32e38a){logger[_0xd8fc('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e38a);throw _0x32e38a;});}return _0x324258;})['then'](respondWithResult(_0x2d331f,0xc9))[_0xd8fc('0x44')](handleError(_0x2d331f,null));};exports[_0xd8fc('0x27')]=function(_0xc7ae38,_0x461a5f){if(_0xc7ae38[_0xd8fc('0x53')]['id']){delete _0xc7ae38[_0xd8fc('0x53')]['id'];}return db[_0xd8fc('0x41')][_0xd8fc('0x49')]({'where':{'id':_0xc7ae38[_0xd8fc('0x45')]['id']}})[_0xd8fc('0x28')](handleEntityNotFound(_0x461a5f,null))[_0xd8fc('0x28')](saveUpdates(_0xc7ae38['body'],null))[_0xd8fc('0x28')](respondWithResult(_0x461a5f,null))['catch'](handleError(_0x461a5f,null));};exports[_0xd8fc('0x54')]=function(_0x234711,_0x4f973d){var _0x5492b5=_0x234711[_0xd8fc('0x45')]['id'];var _0x33b36c=[];return db[_0xd8fc('0x55')]['transaction'](function(_0x25f5fa){var _0x3ead23=_0xd8fc('0x56')+_0x5492b5;return db[_0xd8fc('0x55')][_0xd8fc('0x34')](_0x3ead23,{'type':db['Sequelize'][_0xd8fc('0x57')][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa})[_0xd8fc('0x28')](function(_0x5439f0){_0x33b36c=_['map'](_0x5439f0,function(_0x45f69e){return Number(_0x45f69e[_0xd8fc('0x59')]);});})[_0xd8fc('0x28')](function(){var _0x436a0f=_0xd8fc('0x5a')+_0x5492b5;return db[_0xd8fc('0x55')][_0xd8fc('0x34')](_0x436a0f,{'type':db['Sequelize'][_0xd8fc('0x57')][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x16da6d){var _0x3d9088=_[_0xd8fc('0x2d')](_0x16da6d,function(_0x5cf77f){return Number(_0x5cf77f[_0xd8fc('0x5b')]);});return db[_0xd8fc('0x5c')][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'VoiceQueueId':{'$in':_0x3d9088}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x2a9d00=_0xd8fc('0x5d')+_0x5492b5;return db[_0xd8fc('0x55')][_0xd8fc('0x34')](_0x2a9d00,{'type':db['Sequelize'][_0xd8fc('0x57')][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x4e7cef){var _0x2b8e3a=_[_0xd8fc('0x2d')](_0x4e7cef,function(_0x3792cb){return Number(_0x3792cb['MailQueueId']);});return db[_0xd8fc('0x5e')][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'MailQueueId':{'$in':_0x2b8e3a}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x129f77='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5492b5;return db['sequelize'][_0xd8fc('0x34')](_0x129f77,{'type':db[_0xd8fc('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x38fcdb){var _0x43311d=_[_0xd8fc('0x2d')](_0x38fcdb,function(_0x2694c4){return Number(_0x2694c4[_0xd8fc('0x60')]);});return db['UserSmsQueue'][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'SmsQueueId':{'$in':_0x43311d}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x2ba296='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5492b5;return db['sequelize'][_0xd8fc('0x34')](_0x2ba296,{'type':db[_0xd8fc('0x5f')][_0xd8fc('0x57')][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x195e79){var _0x15f33f=_[_0xd8fc('0x2d')](_0x195e79,function(_0x1e85e2){return Number(_0x1e85e2['ChatQueueId']);});return db['UserChatQueue'][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'ChatQueueId':{'$in':_0x15f33f}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x14c20f='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5492b5;return db[_0xd8fc('0x55')]['query'](_0x14c20f,{'type':db[_0xd8fc('0x5f')][_0xd8fc('0x57')][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})['then'](function(_0x36a821){var _0x24a293=_['map'](_0x36a821,function(_0x13af6e){return Number(_0x13af6e[_0xd8fc('0x61')]);});return db['UserFaxQueue'][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'FaxQueueId':{'$in':_0x24a293}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x22d4f5=_0xd8fc('0x62')+_0x5492b5;return db[_0xd8fc('0x55')]['query'](_0x22d4f5,{'type':db['Sequelize']['QueryTypes'][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x163851){var _0x591ac4=_[_0xd8fc('0x2d')](_0x163851,function(_0x3628ed){return Number(_0x3628ed['OpenchannelQueueId']);});return db[_0xd8fc('0x63')]['destroy']({'where':{'UserId':{'$in':_0x33b36c},'OpenchannelQueueId':{'$in':_0x591ac4}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){var _0x5c45b2=_0xd8fc('0x64')+_0x5492b5;return db[_0xd8fc('0x55')][_0xd8fc('0x34')](_0x5c45b2,{'type':db[_0xd8fc('0x5f')]['QueryTypes'][_0xd8fc('0x58')],'raw':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x446b53){var _0x4cdfb1=_[_0xd8fc('0x2d')](_0x446b53,function(_0x1e3003){return Number(_0x1e3003[_0xd8fc('0x65')]);});return db[_0xd8fc('0x66')][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'WhatsappQueueId':{'$in':_0x4cdfb1}},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){return db[_0xd8fc('0x67')][_0xd8fc('0x49')]({'where':{'TeamId':_0x5492b5}});})[_0xd8fc('0x28')](function(_0xa7df00){if(_0xa7df00===null){return;}return db[_0xd8fc('0x68')][_0xd8fc('0x54')]({'where':{'UserId':{'$in':_0x33b36c},'VoicePrefixId':_0xa7df00[_0xd8fc('0x69')]},'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(){return db[_0xd8fc('0x41')]['destroy']({'where':{'id':_0x5492b5},'cascade':!![],'transaction':_0x25f5fa});})[_0xd8fc('0x28')](function(_0x3de896){if(_0x3de896===0x0){_0x4f973d[_0xd8fc('0x1b')](0x194);}else{return db[_0xd8fc('0x52')][_0xd8fc('0x54')]({'where':{'type':'Teams','resourceId':_0x5492b5},'cascade':!![],'transaction':_0x25f5fa})[_0xd8fc('0x28')](function(){_0x4f973d[_0xd8fc('0x1c')](0xcc)[_0xd8fc('0x1d')]();});}})[_0xd8fc('0x44')](function(_0x1c8eb0){_0x4f973d[_0xd8fc('0x1c')](0x1f4)[_0xd8fc('0x2c')](_0x1c8eb0);});});};exports[_0xd8fc('0x6a')]=function(_0x13237e,_0x5c64ff,_0x5985fc){return db[_0xd8fc('0x41')][_0xd8fc('0x6b')]({'where':{'id':_0x13237e['params']['id']}})[_0xd8fc('0x28')](handleEntityNotFound(_0x5c64ff,null))[_0xd8fc('0x28')](function(_0x20c025){if(!_0x13237e[_0xd8fc('0x34')]['channel']||!utils[_0xd8fc('0x6c')](_0x13237e[_0xd8fc('0x34')][_0xd8fc('0x6d')])){throw new db['Sequelize']['ValidationError'](_0xd8fc('0x6e'));}var _0x36caef={};var _0x2d96f2={};_0x2d96f2[_0xd8fc('0x32')]=_[_0xd8fc('0x33')](db[_['capitalize'](_0x13237e[_0xd8fc('0x34')][_0xd8fc('0x6d')][_0xd8fc('0x6f')]())+_0xd8fc('0x70')][_0xd8fc('0x2e')]);_0x2d96f2[_0xd8fc('0x34')]=_[_0xd8fc('0x33')](_0x13237e[_0xd8fc('0x34')]);_0x2d96f2[_0xd8fc('0x35')]=_[_0xd8fc('0x36')](_0x2d96f2[_0xd8fc('0x32')],_0x2d96f2[_0xd8fc('0x34')]);_0x36caef[_0xd8fc('0x37')]=_[_0xd8fc('0x36')](_0x2d96f2[_0xd8fc('0x32')],qs[_0xd8fc('0x46')](_0x13237e[_0xd8fc('0x34')][_0xd8fc('0x46')]));_0x36caef['attributes']=_0x36caef[_0xd8fc('0x37')]['length']?_0x36caef['attributes']:_0x2d96f2[_0xd8fc('0x32')];_0x36caef[_0xd8fc('0x20')]=qs['limit'](_0x13237e['query'][_0xd8fc('0x20')]);_0x36caef['offset']=qs['offset'](_0x13237e['query'][_0xd8fc('0x21')]);_0x36caef['order']=qs[_0xd8fc('0x3b')](_0x13237e[_0xd8fc('0x34')][_0xd8fc('0x3b')]);_0x36caef[_0xd8fc('0x3e')]=qs[_0xd8fc('0x35')](_[_0xd8fc('0x3c')](_0x13237e[_0xd8fc('0x34')],_0x2d96f2[_0xd8fc('0x35')]));_0x36caef=_['merge']({},_0x36caef,_0x13237e[_0xd8fc('0x71')]);return _0x20c025[_0xd8fc('0x4e')+_[_0xd8fc('0x72')](_0x13237e[_0xd8fc('0x34')][_0xd8fc('0x6d')][_0xd8fc('0x6f')]())+_0xd8fc('0x73')](_0x36caef);})[_0xd8fc('0x28')](respondWithResult(_0x5c64ff,null))['catch'](handleError(_0x5c64ff,null));};exports[_0xd8fc('0x74')]=function(_0x552e82,_0x59086a,_0xfab491){return db[_0xd8fc('0x41')][_0xd8fc('0x6b')]({'where':{'id':_0x552e82['params']['id']}})[_0xd8fc('0x28')](function(_0x1971f2){if(_0x1971f2){if(!_0x552e82[_0xd8fc('0x53')][_0xd8fc('0x6d')]||!utils[_0xd8fc('0x6c')](_0x552e82[_0xd8fc('0x53')]['channel'])){throw new db[(_0xd8fc('0x5f'))][(_0xd8fc('0x75'))](_0xd8fc('0x6e'));}return _0x1971f2['add'+_[_0xd8fc('0x72')](_0x552e82[_0xd8fc('0x53')][_0xd8fc('0x6d')][_0xd8fc('0x6f')]())+_0xd8fc('0x73')](_0x552e82[_0xd8fc('0x53')]['ids']);}return null;})[_0xd8fc('0x28')](handleEntityNotFound(_0x59086a,null))['then'](respondWithStatusCode(_0x59086a,null))['catch'](handleError(_0x59086a,null));};exports[_0xd8fc('0x76')]=function(_0x340f86,_0x35ba9f,_0x3109f5){return db['Team'][_0xd8fc('0x6b')]({'where':{'id':_0x340f86[_0xd8fc('0x45')]['id']}})[_0xd8fc('0x28')](function(_0x52256a){if(_0x52256a){if(!_0x340f86[_0xd8fc('0x34')][_0xd8fc('0x6d')]||!utils[_0xd8fc('0x6c')](_0x340f86[_0xd8fc('0x34')][_0xd8fc('0x6d')])){throw new db[(_0xd8fc('0x5f'))][(_0xd8fc('0x75'))](_0xd8fc('0x6e'));}return _0x52256a['remove'+_[_0xd8fc('0x72')](_0x340f86[_0xd8fc('0x34')][_0xd8fc('0x6d')][_0xd8fc('0x6f')]())+_0xd8fc('0x73')](_0x340f86[_0xd8fc('0x34')][_0xd8fc('0x77')]);}return null;})[_0xd8fc('0x28')](handleEntityNotFound(_0x35ba9f,null))['then'](respondWithStatusCode(_0x35ba9f,null))['catch'](handleError(_0x35ba9f,null));};exports[_0xd8fc('0x78')]=function(_0x106325,_0xc3e3fa){var _0xabe97c=_['isArray'](_0x106325[_0xd8fc('0x53')][_0xd8fc('0x77')])?_0x106325[_0xd8fc('0x53')]['ids']:[_0x106325['body']['ids']];var _0x1c463a=_0x106325[_0xd8fc('0x45')]['id'];return db[_0xd8fc('0x41')][_0xd8fc('0x49')]({'where':{'id':_0x1c463a}})['then'](handleEntityNotFound(_0xc3e3fa,null))['then'](function(_0x2b5fbb){if(_0x2b5fbb){var _0x49a5cc=[_0xd8fc('0x79'),_0xd8fc('0x7a'),'Mail',_0xd8fc('0x7b'),_0xd8fc('0x7c'),'Openchannel',_0xd8fc('0x7d')];return db[_0xd8fc('0x55')][_0xd8fc('0x7e')](function(_0x3ce756){var _0x1f61ab=_[_0xd8fc('0x2d')](_0x49a5cc,function(_0xe3801b){var _0x5c9acb={'attributes':['id',_0xd8fc('0x2b')]};if(_0xe3801b===_0xd8fc('0x79')){_0x5c9acb[_0xd8fc('0x7f')]={'attributes':['penalty']};}return _0x2b5fbb[_0xd8fc('0x4e')+_0xe3801b+'Queues'](_0x5c9acb)[_0xd8fc('0x28')](function(_0x339e50){var _0x408ddf=_[_0xd8fc('0x2d')](_0x339e50,function(_0x485605){var _0x9b3350=_[_0xd8fc('0x2d')](_0xabe97c,function(_0x3bcfbf){var _0x3d95ff={'where':{'UserId':_0x3bcfbf,[_0xe3801b+_0xd8fc('0x80')]:_0x485605['id']},'transaction':_0x3ce756};if(_0xe3801b==='Voice'){_0x3d95ff['defaults']={'penalty':_0x485605[_0xd8fc('0x81')][_0xd8fc('0x82')]};}return db[_0xd8fc('0x83')+_0xe3801b+_0xd8fc('0x70')][_0xd8fc('0x84')](_0x3d95ff)[_0xd8fc('0x28')](function(){socket[_0xd8fc('0x85')]('user'+_0xe3801b+_0xd8fc('0x86'),{'UserId':_0x3bcfbf,[_0xe3801b+_0xd8fc('0x80')]:_0x485605['id']});if(_0xe3801b!=='Voice'){return;}return db[_0xd8fc('0x83')]['findAll']({'where':{'id':_0xabe97c,'online':0x1},'attributes':['id',_0xd8fc('0x2b'),_0xd8fc('0x87'),'voicePause',_0xd8fc('0x88')],'raw':!![]})[_0xd8fc('0x28')](function(_0x44a70f){var _0x3f7315=_[_0xd8fc('0x2d')](_0x44a70f,function(_0x11d8fb){return db[_0xd8fc('0x89')][_0xd8fc('0x8a')]({'membername':_0x11d8fb[_0xd8fc('0x2b')],'UserId':_0x11d8fb['id'],'queue_name':_0x485605[_0xd8fc('0x2b')],'VoiceQueueId':_0x485605['id'],'interface':_[_0xd8fc('0x8b')](_0x11d8fb[_0xd8fc('0x88')])?util[_0xd8fc('0x8c')](_0xd8fc('0x8d'),_0x11d8fb[_0xd8fc('0x2b')]):_0x11d8fb['interface'],'paused':_0x11d8fb[_0xd8fc('0x8e')]||![],'penalty':_0x485605['TeamVoiceQueue'][_0xd8fc('0x82')]},{'transaction':_0x3ce756});});return Promise[_0xd8fc('0x8f')](_0x3f7315);});});});return Promise[_0xd8fc('0x8f')](_0x9b3350);});return Promise[_0xd8fc('0x8f')](_0x408ddf);})[_0xd8fc('0x28')](function(){return db[_0xd8fc('0x67')]['findOne']({'where':{'teamId':_0x1c463a}})[_0xd8fc('0x28')](function(_0x8d82d){if(_0x8d82d){var _0x5b2573=_[_0xd8fc('0x2d')](_0xabe97c,function(_0x188fcd){db[_0xd8fc('0x68')][_0xd8fc('0x8a')]({'UserId':_0x188fcd,'VoicePrefixId':_0x8d82d['VoicePrefixId']});});return Promise[_0xd8fc('0x8f')](_0x5b2573);}});});});return Promise['all'](_0x1f61ab)[_0xd8fc('0x28')](function(){return _0x2b5fbb['addAgents'](_0xabe97c,{'transaction':_0x3ce756})[_0xd8fc('0x90')](function(_0x346f00){return _0x346f00;});});});}})[_0xd8fc('0x28')](respondWithResult(_0xc3e3fa,null))[_0xd8fc('0x44')](handleError(_0xc3e3fa,null));};exports[_0xd8fc('0x91')]=function(_0x3eef54,_0x4e8d8d){var _0x48454b=_[_0xd8fc('0x92')](_0x3eef54[_0xd8fc('0x34')]['ids'])?_0x3eef54[_0xd8fc('0x34')]['ids']:[_0x3eef54[_0xd8fc('0x34')][_0xd8fc('0x77')]];var _0x5ad1b9=_0x3eef54['params']['id'];return db[_0xd8fc('0x41')][_0xd8fc('0x49')]({'where':{'id':_0x5ad1b9}})[_0xd8fc('0x28')](handleEntityNotFound(_0x4e8d8d,null))[_0xd8fc('0x28')](function(_0x3d838b){if(_0x3d838b){var _0x20208a=[_0xd8fc('0x79'),_0xd8fc('0x7a'),_0xd8fc('0x93'),_0xd8fc('0x7b'),_0xd8fc('0x7c'),_0xd8fc('0x94'),_0xd8fc('0x7d')];return db[_0xd8fc('0x55')][_0xd8fc('0x7e')](function(_0x224090){var _0x31406c=_[_0xd8fc('0x2d')](_0x20208a,function(_0x492e0f){var _0x110c80={'attributes':['id',_0xd8fc('0x2b')]};return _0x3d838b['get'+_0x492e0f+_0xd8fc('0x73')](_0x110c80)[_0xd8fc('0x28')](function(_0x730fdd){var _0x47657e=_[_0xd8fc('0x2d')](_0x730fdd,function(_0xed605c){return _0xed605c[_0xd8fc('0x91')](_0x48454b,{'transaction':_0x224090})[_0xd8fc('0x28')](function(){var _0x5b5ce9=_[_0xd8fc('0x2d')](_0x48454b,function(_0x8c8e24){socket[_0xd8fc('0x85')]('user'+_0x492e0f+'Queue:remove',{'UserId':Number(_0x8c8e24),[_0x492e0f+_0xd8fc('0x80')]:_0xed605c['id']});if(_0x492e0f!==_0xd8fc('0x79')){return;}return db['UserVoiceQueueRt'][_0xd8fc('0x54')]({'where':{'VoiceQueueId':_0xed605c['id'],'UserId':_0x8c8e24},'transaction':_0x224090});});return Promise[_0xd8fc('0x8f')](_0x5b5ce9);});});return Promise[_0xd8fc('0x8f')](_0x47657e);});});return Promise[_0xd8fc('0x8f')](_0x31406c)[_0xd8fc('0x28')](function(){return _0x3d838b[_0xd8fc('0x91')](_0x48454b,{'transaction':_0x224090});})[_0xd8fc('0x28')](function(){return db[_0xd8fc('0x67')][_0xd8fc('0x6b')]({'where':{'teamId':_0x5ad1b9}})['then'](function(_0x37fc6f){if(_0x37fc6f){var _0x2c5c55=_[_0xd8fc('0x2d')](_0x48454b,function(_0x155410){db[_0xd8fc('0x68')][_0xd8fc('0x54')]({'where':{'UserId':_0x155410,'VoicePrefixId':_0x37fc6f['VoicePrefixId']}});});return Promise[_0xd8fc('0x8f')](_0x2c5c55);}});});});}})[_0xd8fc('0x28')](respondWithStatusCode(_0x4e8d8d,null))[_0xd8fc('0x44')](handleError(_0x4e8d8d,null));};exports[_0xd8fc('0x95')]=function(_0x5b5179,_0x10957d,_0x6712e5){var _0x2e7bd8={};var _0x815323={};var _0x15866e;var _0x60d325;return db['Team'][_0xd8fc('0x6b')]({'where':{'id':_0x5b5179['params']['id']}})[_0xd8fc('0x28')](handleEntityNotFound(_0x10957d,null))[_0xd8fc('0x28')](function(_0x383373){if(_0x383373){_0x15866e=_0x383373;_0x815323[_0xd8fc('0x32')]=_[_0xd8fc('0x33')](db[_0xd8fc('0x83')][_0xd8fc('0x2e')]);_0x815323[_0xd8fc('0x34')]=_[_0xd8fc('0x33')](_0x5b5179['query']);_0x815323[_0xd8fc('0x35')]=_[_0xd8fc('0x36')](_0x815323[_0xd8fc('0x32')],_0x815323[_0xd8fc('0x34')]);_0x2e7bd8[_0xd8fc('0x37')]=_['intersection'](_0x815323[_0xd8fc('0x32')],qs[_0xd8fc('0x46')](_0x5b5179[_0xd8fc('0x34')][_0xd8fc('0x46')]));_0x2e7bd8[_0xd8fc('0x37')]=_0x2e7bd8[_0xd8fc('0x37')][_0xd8fc('0x47')]?_0x2e7bd8['attributes']:_0x815323[_0xd8fc('0x32')];_0x2e7bd8['order']=qs['sort'](_0x5b5179[_0xd8fc('0x34')][_0xd8fc('0x3b')]);_0x2e7bd8[_0xd8fc('0x3e')]=qs[_0xd8fc('0x35')](_[_0xd8fc('0x3c')](_0x5b5179[_0xd8fc('0x34')],_0x815323[_0xd8fc('0x35')]));if(_0x5b5179[_0xd8fc('0x34')][_0xd8fc('0x3d')]){_0x2e7bd8['where']=_['merge'](_0x2e7bd8[_0xd8fc('0x3e')],{'$or':_[_0xd8fc('0x2d')](_0x2e7bd8['attributes'],function(_0x1b9b9a){var _0x28a822={};_0x28a822[_0x1b9b9a]={'$like':'%'+_0x5b5179[_0xd8fc('0x34')][_0xd8fc('0x3d')]+'%'};return _0x28a822;})});}_0x2e7bd8=_[_0xd8fc('0x3f')]({},_0x2e7bd8,_0x5b5179[_0xd8fc('0x71')]);return _0x15866e[_0xd8fc('0x95')](_0x2e7bd8);}})[_0xd8fc('0x28')](function(_0x5679c7){if(_0x5679c7){_0x60d325=_0x5679c7['length'];if(!_0x5b5179['query']['hasOwnProperty'](_0xd8fc('0x39'))){_0x2e7bd8[_0xd8fc('0x20')]=qs[_0xd8fc('0x20')](_0x5b5179[_0xd8fc('0x34')]['limit']);_0x2e7bd8[_0xd8fc('0x21')]=qs['offset'](_0x5b5179[_0xd8fc('0x34')][_0xd8fc('0x21')]);}return _0x15866e[_0xd8fc('0x95')](_0x2e7bd8);}})['then'](function(_0x5bdd2f){if(_0x5bdd2f){return _0x5bdd2f?{'count':_0x60d325,'rows':_0x5bdd2f}:null;}})[_0xd8fc('0x28')](respondWithResult(_0x10957d,null))['catch'](handleError(_0x10957d,null));}; \ No newline at end of file +var _0x71b0=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','Team','include','findAll','rows','catch','show','params','length','includeAll','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','sort','Queues','addQueues','add','removeQueues','findOne','remove','ids','addAgents','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','QueueId','penalty','User','emit','Queue:save','online','upsert','isNil','interface','format','SIP/%s','voicePause','TeamVoiceQueue','all','VoicePrefixId','removeAgents','isArray','Queue:remove','UserVoiceQueueRt','getAgents','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x71b0,0x96));var _0x071b=function(_0x4cfbd8,_0x407c81){_0x4cfbd8=_0x4cfbd8-0x0;var _0x46820f=_0x71b0[_0x4cfbd8];return _0x46820f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x071b('0x0'));var zipdir=require(_0x071b('0x1'));var jsonpatch=require(_0x071b('0x2'));var rp=require('request-promise');var moment=require(_0x071b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x071b('0x4'));var path=require(_0x071b('0x5'));var sox=require('sox');var csv=require(_0x071b('0x6'));var ejs=require(_0x071b('0x7'));var fs=require('fs');var fs_extra=require(_0x071b('0x8'));var _=require('lodash');var squel=require(_0x071b('0x9'));var crypto=require(_0x071b('0xa'));var jsforce=require(_0x071b('0xb'));var deskjs=require(_0x071b('0xc'));var toCsv=require(_0x071b('0x6'));var querystring=require('querystring');var Papa=require(_0x071b('0xd'));var Redis=require(_0x071b('0xe'));var authService=require(_0x071b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x071b('0x10'));var hardwareService=require(_0x071b('0x11'));var logger=require(_0x071b('0x12'))(_0x071b('0x13'));var utils=require(_0x071b('0x14'));var config=require(_0x071b('0x15'));var licenseUtil=require(_0x071b('0x16'));var db=require(_0x071b('0x17'))['db'];config['redis']=_[_0x071b('0x18')](config[_0x071b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x071b('0x1a'))(new Redis(config[_0x071b('0x19')]));require(_0x071b('0x1b'))['register'](socket);function respondWithStatusCode(_0x279de8,_0x6e706f){_0x6e706f=_0x6e706f||0xcc;return function(_0x19cf97){if(_0x19cf97){return _0x279de8[_0x071b('0x1c')](_0x6e706f);}return _0x279de8['status'](_0x6e706f)['end']();};}function respondWithResult(_0x1d6dcb,_0x2240dc){_0x2240dc=_0x2240dc||0xc8;return function(_0x34e7a5){if(_0x34e7a5){return _0x1d6dcb[_0x071b('0x1d')](_0x2240dc)[_0x071b('0x1e')](_0x34e7a5);}};}function respondWithFilteredResult(_0x31288b,_0x29a78e){return function(_0x2c5e4d){if(_0x2c5e4d){var _0x387363=typeof _0x29a78e[_0x071b('0x1f')]==='undefined'&&typeof _0x29a78e['limit']===_0x071b('0x20');var _0x1be3df=_0x2c5e4d[_0x071b('0x21')];var _0x4a7532=_0x387363?0x0:_0x29a78e[_0x071b('0x1f')];var _0x3cac04=_0x387363?_0x2c5e4d[_0x071b('0x21')]:_0x29a78e['offset']+_0x29a78e[_0x071b('0x22')];var _0x378535;if(_0x3cac04>=_0x1be3df){_0x3cac04=_0x1be3df;_0x378535=0xc8;}else{_0x378535=0xce;}_0x31288b['status'](_0x378535);return _0x31288b[_0x071b('0x23')](_0x071b('0x24'),_0x4a7532+'-'+_0x3cac04+'/'+_0x1be3df)[_0x071b('0x1e')](_0x2c5e4d);}return null;};}function patchUpdates(_0x438072){return function(_0x4076d7){try{jsonpatch[_0x071b('0x25')](_0x4076d7,_0x438072,!![]);}catch(_0x3e247a){return BPromise[_0x071b('0x26')](_0x3e247a);}return _0x4076d7[_0x071b('0x27')]();};}function saveUpdates(_0x157693,_0x47b609){return function(_0x7d0da3){if(_0x7d0da3){return _0x7d0da3[_0x071b('0x28')](_0x157693)[_0x071b('0x29')](function(_0x1018f7){return _0x1018f7;});}return null;};}function handleEntityNotFound(_0x31d76b,_0x2f3a0a){return function(_0x20e69a){if(!_0x20e69a){_0x31d76b[_0x071b('0x1c')](0x194);}return _0x20e69a;};}function handleError(_0x556778,_0x24d920){_0x24d920=_0x24d920||0x1f4;return function(_0x25f9bf){logger['error'](_0x25f9bf[_0x071b('0x2a')]);if(_0x25f9bf[_0x071b('0x2b')]){delete _0x25f9bf[_0x071b('0x2b')];}_0x556778[_0x071b('0x1d')](_0x24d920)[_0x071b('0x2c')](_0x25f9bf);};}exports[_0x071b('0x2d')]=function(_0x189d9f,_0x4c6253){var _0xcd32ae={},_0x50ca48={},_0x25bb2e={'count':0x0,'rows':[]};var _0x3c415b=_[_0x071b('0x2e')](db['Team'][_0x071b('0x2f')],function(_0x232621){return{'name':_0x232621[_0x071b('0x30')],'type':_0x232621[_0x071b('0x31')][_0x071b('0x32')]};});_0x50ca48['model']=_[_0x071b('0x2e')](_0x3c415b,'name');_0x50ca48[_0x071b('0x33')]=_[_0x071b('0x34')](_0x189d9f[_0x071b('0x33')]);_0x50ca48[_0x071b('0x35')]=_[_0x071b('0x36')](_0x50ca48['model'],_0x50ca48[_0x071b('0x33')]);_0xcd32ae['attributes']=_[_0x071b('0x36')](_0x50ca48[_0x071b('0x37')],qs[_0x071b('0x38')](_0x189d9f[_0x071b('0x33')]['fields']));_0xcd32ae[_0x071b('0x39')]=_0xcd32ae['attributes']['length']?_0xcd32ae[_0x071b('0x39')]:_0x50ca48[_0x071b('0x37')];if(!_0x189d9f[_0x071b('0x33')][_0x071b('0x3a')](_0x071b('0x3b'))){_0xcd32ae[_0x071b('0x22')]=qs['limit'](_0x189d9f[_0x071b('0x33')]['limit']);_0xcd32ae[_0x071b('0x1f')]=qs[_0x071b('0x1f')](_0x189d9f[_0x071b('0x33')]['offset']);}_0xcd32ae[_0x071b('0x3c')]=qs['sort'](_0x189d9f['query']['sort']);_0xcd32ae[_0x071b('0x3d')]=qs[_0x071b('0x35')](_[_0x071b('0x3e')](_0x189d9f[_0x071b('0x33')],_0x50ca48['filters']),_0x3c415b);if(_0x189d9f[_0x071b('0x33')][_0x071b('0x3f')]){_0xcd32ae[_0x071b('0x3d')]=_['merge'](_0xcd32ae[_0x071b('0x3d')],{'$or':_[_0x071b('0x2e')](_0x3c415b,function(_0x12774e){if(_0x12774e['type']!==_0x071b('0x40')){var _0xf9b9db={};_0xf9b9db[_0x12774e[_0x071b('0x2b')]]={'$like':'%'+_0x189d9f[_0x071b('0x33')][_0x071b('0x3f')]+'%'};return _0xf9b9db;}})});}_0xcd32ae=_[_0x071b('0x41')]({},_0xcd32ae,_0x189d9f['options']);var _0x4af918={'where':_0xcd32ae[_0x071b('0x3d')]};return db[_0x071b('0x42')][_0x071b('0x21')](_0x4af918)[_0x071b('0x29')](function(_0x21146f){_0x25bb2e[_0x071b('0x21')]=_0x21146f;if(_0x189d9f[_0x071b('0x33')]['includeAll']){_0xcd32ae[_0x071b('0x43')]=[{'all':!![]}];}return db[_0x071b('0x42')][_0x071b('0x44')](_0xcd32ae);})[_0x071b('0x29')](function(_0x17b578){_0x25bb2e[_0x071b('0x45')]=_0x17b578;return _0x25bb2e;})['then'](respondWithFilteredResult(_0x4c6253,_0xcd32ae))[_0x071b('0x46')](handleError(_0x4c6253,null));};exports[_0x071b('0x47')]=function(_0x39f58c,_0x37d2c1){var _0xc3f191={'raw':![],'where':{'id':_0x39f58c[_0x071b('0x48')]['id']}},_0x3af6e5={};_0x3af6e5['model']=_[_0x071b('0x34')](db['Team'][_0x071b('0x2f')]);_0x3af6e5[_0x071b('0x33')]=_[_0x071b('0x34')](_0x39f58c[_0x071b('0x33')]);_0x3af6e5[_0x071b('0x35')]=_['intersection'](_0x3af6e5[_0x071b('0x37')],_0x3af6e5[_0x071b('0x33')]);_0xc3f191['attributes']=_[_0x071b('0x36')](_0x3af6e5[_0x071b('0x37')],qs['fields'](_0x39f58c[_0x071b('0x33')][_0x071b('0x38')]));_0xc3f191[_0x071b('0x39')]=_0xc3f191[_0x071b('0x39')][_0x071b('0x49')]?_0xc3f191[_0x071b('0x39')]:_0x3af6e5[_0x071b('0x37')];if(_0x39f58c[_0x071b('0x33')][_0x071b('0x4a')]){_0xc3f191['include']=[{'all':!![]}];}_0xc3f191=_[_0x071b('0x41')]({},_0xc3f191,_0x39f58c[_0x071b('0x4b')]);return db['Team'][_0x071b('0x4c')](_0xc3f191)['then'](handleEntityNotFound(_0x37d2c1,null))[_0x071b('0x29')](respondWithResult(_0x37d2c1,null))['catch'](handleError(_0x37d2c1,null));};exports['create']=function(_0x45b7a2,_0x3890de){return db['Team']['create'](_0x45b7a2[_0x071b('0x4d')],{})[_0x071b('0x29')](function(_0x604ffa){var _0x2f1d2f=_0x45b7a2[_0x071b('0x4e')][_0x071b('0x4f')]({'plain':!![]});if(!_0x2f1d2f)throw new Error(_0x071b('0x50'));if(_0x2f1d2f[_0x071b('0x51')]==='user'){var _0x2a1b4c=_0x604ffa[_0x071b('0x4f')]({'plain':!![]});var _0x5153b9='Teams';return db[_0x071b('0x52')][_0x071b('0x4c')]({'where':{'name':_0x5153b9,'userProfileId':_0x2f1d2f[_0x071b('0x53')]},'raw':!![]})[_0x071b('0x29')](function(_0x20f3a7){if(_0x20f3a7&&_0x20f3a7[_0x071b('0x54')]===0x0){return db[_0x071b('0x55')][_0x071b('0x56')]({'name':_0x2a1b4c[_0x071b('0x2b')],'resourceId':_0x2a1b4c['id'],'type':_0x20f3a7[_0x071b('0x2b')],'sectionId':_0x20f3a7['id']},{})[_0x071b('0x29')](function(){return _0x604ffa;});}else{return _0x604ffa;}})[_0x071b('0x46')](function(_0x229974){logger[_0x071b('0x57')](_0x071b('0x58'),_0x229974);throw _0x229974;});}return _0x604ffa;})[_0x071b('0x29')](respondWithResult(_0x3890de,0xc9))['catch'](handleError(_0x3890de,null));};exports[_0x071b('0x28')]=function(_0x46ed96,_0x3528be){if(_0x46ed96[_0x071b('0x4d')]['id']){delete _0x46ed96['body']['id'];}return db[_0x071b('0x42')][_0x071b('0x4c')]({'where':{'id':_0x46ed96[_0x071b('0x48')]['id']}})[_0x071b('0x29')](handleEntityNotFound(_0x3528be,null))['then'](saveUpdates(_0x46ed96[_0x071b('0x4d')],null))[_0x071b('0x29')](respondWithResult(_0x3528be,null))['catch'](handleError(_0x3528be,null));};exports[_0x071b('0x59')]=function(_0x82d887,_0x3cbb80){var _0x116169=_0x82d887[_0x071b('0x48')]['id'];var _0x22ceca=[];return db['sequelize'][_0x071b('0x5a')](function(_0x47f3f7){var _0x2ba4a5=_0x071b('0x5b')+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0x2ba4a5,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7})[_0x071b('0x29')](function(_0x46ca1c){_0x22ceca=_['map'](_0x46ca1c,function(_0x504189){return Number(_0x504189[_0x071b('0x60')]);});})[_0x071b('0x29')](function(){var _0x39775d=_0x071b('0x61')+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0x39775d,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})['then'](function(_0x5cab07){var _0x22a2cb=_[_0x071b('0x2e')](_0x5cab07,function(_0x5d01c3){return Number(_0x5d01c3[_0x071b('0x62')]);});return db[_0x071b('0x63')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'VoiceQueueId':{'$in':_0x22a2cb}},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){var _0x12148f='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0x12148f,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x24020f){var _0x4ade4f=_[_0x071b('0x2e')](_0x24020f,function(_0x50af7c){return Number(_0x50af7c[_0x071b('0x64')]);});return db[_0x071b('0x65')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'MailQueueId':{'$in':_0x4ade4f}},'transaction':_0x47f3f7});})['then'](function(){var _0x310318=_0x071b('0x66')+_0x116169;return db['sequelize'][_0x071b('0x33')](_0x310318,{'type':db['Sequelize']['QueryTypes'][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x37d281){var _0x19f494=_[_0x071b('0x2e')](_0x37d281,function(_0x524220){return Number(_0x524220[_0x071b('0x67')]);});return db[_0x071b('0x68')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'SmsQueueId':{'$in':_0x19f494}},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){var _0x7f5927=_0x071b('0x69')+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0x7f5927,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x1d28a9){var _0x8c7441=_[_0x071b('0x2e')](_0x1d28a9,function(_0x11a794){return Number(_0x11a794[_0x071b('0x6a')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x22ceca},'ChatQueueId':{'$in':_0x8c7441}},'transaction':_0x47f3f7});})['then'](function(){var _0xda2c1c=_0x071b('0x6b')+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0xda2c1c,{'type':db['Sequelize']['QueryTypes'][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x161cc5){var _0x1025d5=_['map'](_0x161cc5,function(_0x16cedc){return Number(_0x16cedc[_0x071b('0x6c')]);});return db[_0x071b('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x22ceca},'FaxQueueId':{'$in':_0x1025d5}},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){var _0x143325=_0x071b('0x6e')+_0x116169;return db[_0x071b('0x5c')][_0x071b('0x33')](_0x143325,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')][_0x071b('0x5f')],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0xc507ef){var _0x534c54=_[_0x071b('0x2e')](_0xc507ef,function(_0x5b8485){return Number(_0x5b8485['OpenchannelQueueId']);});return db[_0x071b('0x6f')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'OpenchannelQueueId':{'$in':_0x534c54}},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){var _0x300dc2=_0x071b('0x70')+_0x116169;return db['sequelize'][_0x071b('0x33')](_0x300dc2,{'type':db[_0x071b('0x5d')][_0x071b('0x5e')]['SELECT'],'raw':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x1bd2b3){var _0x1b3f23=_['map'](_0x1bd2b3,function(_0x267ed9){return Number(_0x267ed9[_0x071b('0x71')]);});return db[_0x071b('0x72')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'WhatsappQueueId':{'$in':_0x1b3f23}},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){return db[_0x071b('0x73')][_0x071b('0x4c')]({'where':{'TeamId':_0x116169}});})[_0x071b('0x29')](function(_0x2c03c3){if(_0x2c03c3===null){return;}return db[_0x071b('0x74')][_0x071b('0x59')]({'where':{'UserId':{'$in':_0x22ceca},'VoicePrefixId':_0x2c03c3['VoicePrefixId']},'transaction':_0x47f3f7});})[_0x071b('0x29')](function(){return db[_0x071b('0x42')][_0x071b('0x59')]({'where':{'id':_0x116169},'cascade':!![],'transaction':_0x47f3f7});})[_0x071b('0x29')](function(_0x2cad87){if(_0x2cad87===0x0){_0x3cbb80[_0x071b('0x1c')](0x194);}else{return db[_0x071b('0x55')][_0x071b('0x59')]({'where':{'type':'Teams','resourceId':_0x116169},'cascade':!![],'transaction':_0x47f3f7})[_0x071b('0x29')](function(){_0x3cbb80[_0x071b('0x1d')](0xcc)['end']();});}})['catch'](function(_0x11d956){_0x3cbb80['status'](0x1f4)[_0x071b('0x2c')](_0x11d956);});});};exports[_0x071b('0x75')]=function(_0x20dc35,_0xd102e8,_0x534bcd){return db[_0x071b('0x42')]['findOne']({'where':{'id':_0x20dc35['params']['id']}})[_0x071b('0x29')](handleEntityNotFound(_0xd102e8,null))['then'](function(_0x4445ec){if(!_0x20dc35[_0x071b('0x33')][_0x071b('0x76')]||!utils[_0x071b('0x77')](_0x20dc35[_0x071b('0x33')]['channel'])){throw new db[(_0x071b('0x5d'))][(_0x071b('0x78'))](_0x071b('0x79'));}var _0x475306={};var _0xc4e796={};_0xc4e796[_0x071b('0x37')]=_[_0x071b('0x34')](db[_[_0x071b('0x7a')](_0x20dc35[_0x071b('0x33')][_0x071b('0x76')][_0x071b('0x7b')]())+_0x071b('0x7c')][_0x071b('0x2f')]);_0xc4e796['query']=_['keys'](_0x20dc35[_0x071b('0x33')]);_0xc4e796['filters']=_[_0x071b('0x36')](_0xc4e796['model'],_0xc4e796[_0x071b('0x33')]);_0x475306['attributes']=_[_0x071b('0x36')](_0xc4e796[_0x071b('0x37')],qs['fields'](_0x20dc35['query'][_0x071b('0x38')]));_0x475306[_0x071b('0x39')]=_0x475306['attributes'][_0x071b('0x49')]?_0x475306[_0x071b('0x39')]:_0xc4e796['model'];_0x475306[_0x071b('0x22')]=qs[_0x071b('0x22')](_0x20dc35[_0x071b('0x33')][_0x071b('0x22')]);_0x475306[_0x071b('0x1f')]=qs[_0x071b('0x1f')](_0x20dc35[_0x071b('0x33')][_0x071b('0x1f')]);_0x475306[_0x071b('0x3c')]=qs[_0x071b('0x7d')](_0x20dc35[_0x071b('0x33')][_0x071b('0x7d')]);_0x475306[_0x071b('0x3d')]=qs[_0x071b('0x35')](_[_0x071b('0x3e')](_0x20dc35[_0x071b('0x33')],_0xc4e796[_0x071b('0x35')]));_0x475306=_[_0x071b('0x41')]({},_0x475306,_0x20dc35[_0x071b('0x4b')]);return _0x4445ec[_0x071b('0x4f')+_['capitalize'](_0x20dc35[_0x071b('0x33')][_0x071b('0x76')][_0x071b('0x7b')]())+_0x071b('0x7e')](_0x475306);})[_0x071b('0x29')](respondWithResult(_0xd102e8,null))[_0x071b('0x46')](handleError(_0xd102e8,null));};exports[_0x071b('0x7f')]=function(_0x191267,_0xe911f5,_0x286df8){return db[_0x071b('0x42')]['findOne']({'where':{'id':_0x191267[_0x071b('0x48')]['id']}})[_0x071b('0x29')](function(_0x492fc5){if(_0x492fc5){if(!_0x191267['body']['channel']||!utils[_0x071b('0x77')](_0x191267[_0x071b('0x4d')][_0x071b('0x76')])){throw new db[(_0x071b('0x5d'))][(_0x071b('0x78'))](_0x071b('0x79'));}return _0x492fc5[_0x071b('0x80')+_[_0x071b('0x7a')](_0x191267[_0x071b('0x4d')][_0x071b('0x76')][_0x071b('0x7b')]())+_0x071b('0x7e')](_0x191267[_0x071b('0x4d')]['ids']);}return null;})['then'](handleEntityNotFound(_0xe911f5,null))[_0x071b('0x29')](respondWithStatusCode(_0xe911f5,null))['catch'](handleError(_0xe911f5,null));};exports[_0x071b('0x81')]=function(_0x5140dc,_0x15a6f9,_0x348bcc){return db['Team'][_0x071b('0x82')]({'where':{'id':_0x5140dc[_0x071b('0x48')]['id']}})[_0x071b('0x29')](function(_0x184888){if(_0x184888){if(!_0x5140dc['query']['channel']||!utils[_0x071b('0x77')](_0x5140dc[_0x071b('0x33')][_0x071b('0x76')])){throw new db[(_0x071b('0x5d'))]['ValidationError'](_0x071b('0x79'));}return _0x184888[_0x071b('0x83')+_['capitalize'](_0x5140dc[_0x071b('0x33')][_0x071b('0x76')][_0x071b('0x7b')]())+'Queues'](_0x5140dc['query'][_0x071b('0x84')]);}return null;})[_0x071b('0x29')](handleEntityNotFound(_0x15a6f9,null))[_0x071b('0x29')](respondWithStatusCode(_0x15a6f9,null))[_0x071b('0x46')](handleError(_0x15a6f9,null));};exports[_0x071b('0x85')]=function(_0x51a765,_0x5ee135){var _0x5bac96=_['isArray'](_0x51a765[_0x071b('0x4d')][_0x071b('0x84')])?_0x51a765[_0x071b('0x4d')][_0x071b('0x84')]:[_0x51a765[_0x071b('0x4d')][_0x071b('0x84')]];var _0x51b0f9=_0x51a765[_0x071b('0x48')]['id'];return db[_0x071b('0x42')][_0x071b('0x4c')]({'where':{'id':_0x51b0f9}})['then'](handleEntityNotFound(_0x5ee135,null))['then'](function(_0x2fccd0){if(_0x2fccd0){var _0x25d2a9=['Voice',_0x071b('0x86'),_0x071b('0x87'),_0x071b('0x88'),_0x071b('0x89'),_0x071b('0x8a'),_0x071b('0x8b')];return db[_0x071b('0x5c')]['transaction'](function(_0x330a8f){var _0x4b4942=_[_0x071b('0x2e')](_0x25d2a9,function(_0x245b4a){var _0x222337={'attributes':['id',_0x071b('0x2b')]};if(_0x245b4a===_0x071b('0x8c')){_0x222337['through']={'attributes':['penalty']};}return _0x2fccd0[_0x071b('0x4f')+_0x245b4a+_0x071b('0x7e')](_0x222337)[_0x071b('0x29')](function(_0x441aa6){var _0x46b9a7=_[_0x071b('0x2e')](_0x441aa6,function(_0x27ee20){var _0x23524c=_['map'](_0x5bac96,function(_0x3b7c53){var _0x4f5420={'where':{'UserId':_0x3b7c53,[_0x245b4a+_0x071b('0x8d')]:_0x27ee20['id']},'transaction':_0x330a8f};if(_0x245b4a===_0x071b('0x8c')){_0x4f5420[_0x071b('0x18')]={'penalty':_0x27ee20['TeamVoiceQueue'][_0x071b('0x8e')]};}return db[_0x071b('0x8f')+_0x245b4a+_0x071b('0x7c')]['findOrCreate'](_0x4f5420)[_0x071b('0x29')](function(){socket[_0x071b('0x90')](_0x071b('0x4e')+_0x245b4a+_0x071b('0x91'),{'UserId':_0x3b7c53,[_0x245b4a+'QueueId']:_0x27ee20['id']});if(_0x245b4a!==_0x071b('0x8c')){return;}return db[_0x071b('0x8f')][_0x071b('0x44')]({'where':{'id':_0x5bac96,'online':0x1},'attributes':['id',_0x071b('0x2b'),_0x071b('0x92'),'voicePause','interface'],'raw':!![]})[_0x071b('0x29')](function(_0x337731){var _0x566f8d=_[_0x071b('0x2e')](_0x337731,function(_0x4ef9d6){return db['UserVoiceQueueRt'][_0x071b('0x93')]({'membername':_0x4ef9d6['name'],'UserId':_0x4ef9d6['id'],'queue_name':_0x27ee20[_0x071b('0x2b')],'VoiceQueueId':_0x27ee20['id'],'interface':_[_0x071b('0x94')](_0x4ef9d6[_0x071b('0x95')])?util[_0x071b('0x96')](_0x071b('0x97'),_0x4ef9d6[_0x071b('0x2b')]):_0x4ef9d6['interface'],'paused':_0x4ef9d6[_0x071b('0x98')]||![],'penalty':_0x27ee20[_0x071b('0x99')][_0x071b('0x8e')]},{'transaction':_0x330a8f});});return Promise[_0x071b('0x9a')](_0x566f8d);});});});return Promise[_0x071b('0x9a')](_0x23524c);});return Promise['all'](_0x46b9a7);})['then'](function(){return db[_0x071b('0x73')][_0x071b('0x82')]({'where':{'teamId':_0x51b0f9}})[_0x071b('0x29')](function(_0x25342a){if(_0x25342a){var _0x535305=_[_0x071b('0x2e')](_0x5bac96,function(_0x2fada5){db[_0x071b('0x74')]['upsert']({'UserId':_0x2fada5,'VoicePrefixId':_0x25342a[_0x071b('0x9b')]});});return Promise['all'](_0x535305);}});});});return Promise[_0x071b('0x9a')](_0x4b4942)[_0x071b('0x29')](function(){return _0x2fccd0[_0x071b('0x85')](_0x5bac96,{'transaction':_0x330a8f})['spread'](function(_0x28a5ef){return _0x28a5ef;});});});}})[_0x071b('0x29')](respondWithResult(_0x5ee135,null))[_0x071b('0x46')](handleError(_0x5ee135,null));};exports[_0x071b('0x9c')]=function(_0x370640,_0x4ebbc3){var _0x4a6249=_[_0x071b('0x9d')](_0x370640[_0x071b('0x33')][_0x071b('0x84')])?_0x370640[_0x071b('0x33')][_0x071b('0x84')]:[_0x370640['query']['ids']];var _0x1b8501=_0x370640['params']['id'];return db[_0x071b('0x42')][_0x071b('0x4c')]({'where':{'id':_0x1b8501}})[_0x071b('0x29')](handleEntityNotFound(_0x4ebbc3,null))[_0x071b('0x29')](function(_0x48034d){if(_0x48034d){var _0x2520a0=['Voice',_0x071b('0x86'),_0x071b('0x87'),_0x071b('0x88'),_0x071b('0x89'),_0x071b('0x8a'),_0x071b('0x8b')];return db['sequelize'][_0x071b('0x5a')](function(_0x401430){var _0x105b64=_['map'](_0x2520a0,function(_0x568eea){var _0x121e49={'attributes':['id',_0x071b('0x2b')]};return _0x48034d[_0x071b('0x4f')+_0x568eea+_0x071b('0x7e')](_0x121e49)['then'](function(_0x433c05){var _0x548a5e=_['map'](_0x433c05,function(_0x332776){return _0x332776[_0x071b('0x9c')](_0x4a6249,{'transaction':_0x401430})['then'](function(){var _0x4abe06=_['map'](_0x4a6249,function(_0x26bb9c){socket[_0x071b('0x90')](_0x071b('0x4e')+_0x568eea+_0x071b('0x9e'),{'UserId':Number(_0x26bb9c),[_0x568eea+'QueueId']:_0x332776['id']});if(_0x568eea!==_0x071b('0x8c')){return;}return db[_0x071b('0x9f')][_0x071b('0x59')]({'where':{'VoiceQueueId':_0x332776['id'],'UserId':_0x26bb9c},'transaction':_0x401430});});return Promise['all'](_0x4abe06);});});return Promise['all'](_0x548a5e);});});return Promise[_0x071b('0x9a')](_0x105b64)['then'](function(){return _0x48034d[_0x071b('0x9c')](_0x4a6249,{'transaction':_0x401430});})[_0x071b('0x29')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1b8501}})[_0x071b('0x29')](function(_0x1fdcd7){if(_0x1fdcd7){var _0x1a12d1=_[_0x071b('0x2e')](_0x4a6249,function(_0x513773){db[_0x071b('0x74')][_0x071b('0x59')]({'where':{'UserId':_0x513773,'VoicePrefixId':_0x1fdcd7[_0x071b('0x9b')]}});});return Promise[_0x071b('0x9a')](_0x1a12d1);}});});});}})[_0x071b('0x29')](respondWithStatusCode(_0x4ebbc3,null))[_0x071b('0x46')](handleError(_0x4ebbc3,null));};exports[_0x071b('0xa0')]=function(_0x5e033d,_0x1663a5,_0x6632eb){var _0x3891da={};var _0x3b66b9={};var _0x5d55de;var _0x4a6e02;return db[_0x071b('0x42')][_0x071b('0x82')]({'where':{'id':_0x5e033d[_0x071b('0x48')]['id']}})['then'](handleEntityNotFound(_0x1663a5,null))[_0x071b('0x29')](function(_0xebffc){if(_0xebffc){_0x5d55de=_0xebffc;_0x3b66b9[_0x071b('0x37')]=_[_0x071b('0x34')](db['User'][_0x071b('0x2f')]);_0x3b66b9['query']=_[_0x071b('0x34')](_0x5e033d[_0x071b('0x33')]);_0x3b66b9[_0x071b('0x35')]=_['intersection'](_0x3b66b9['model'],_0x3b66b9[_0x071b('0x33')]);_0x3891da['attributes']=_[_0x071b('0x36')](_0x3b66b9[_0x071b('0x37')],qs[_0x071b('0x38')](_0x5e033d['query']['fields']));_0x3891da[_0x071b('0x39')]=_0x3891da[_0x071b('0x39')][_0x071b('0x49')]?_0x3891da['attributes']:_0x3b66b9[_0x071b('0x37')];_0x3891da[_0x071b('0x3c')]=qs[_0x071b('0x7d')](_0x5e033d[_0x071b('0x33')][_0x071b('0x7d')]);_0x3891da['where']=qs[_0x071b('0x35')](_[_0x071b('0x3e')](_0x5e033d['query'],_0x3b66b9[_0x071b('0x35')]));if(_0x5e033d[_0x071b('0x33')][_0x071b('0x3f')]){_0x3891da['where']=_[_0x071b('0x41')](_0x3891da[_0x071b('0x3d')],{'$or':_[_0x071b('0x2e')](_0x3891da['attributes'],function(_0x58db5b){var _0x4d8e0b={};_0x4d8e0b[_0x58db5b]={'$like':'%'+_0x5e033d['query']['filter']+'%'};return _0x4d8e0b;})});}_0x3891da=_['merge']({},_0x3891da,_0x5e033d[_0x071b('0x4b')]);return _0x5d55de['getAgents'](_0x3891da);}})[_0x071b('0x29')](function(_0x312128){if(_0x312128){_0x4a6e02=_0x312128[_0x071b('0x49')];if(!_0x5e033d['query'][_0x071b('0x3a')](_0x071b('0x3b'))){_0x3891da[_0x071b('0x22')]=qs['limit'](_0x5e033d[_0x071b('0x33')]['limit']);_0x3891da[_0x071b('0x1f')]=qs[_0x071b('0x1f')](_0x5e033d[_0x071b('0x33')][_0x071b('0x1f')]);}return _0x5d55de[_0x071b('0xa0')](_0x3891da);}})[_0x071b('0x29')](function(_0x309376){if(_0x309376){return _0x309376?{'count':_0x4a6e02,'rows':_0x309376}:null;}})['then'](respondWithResult(_0x1663a5,null))['catch'](handleError(_0x1663a5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6d0fd61..f1065c8 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 _0x92e3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x7c457f,_0x15d290){var _0x3a98ad=function(_0xb6ed4e){while(--_0xb6ed4e){_0x7c457f['push'](_0x7c457f['shift']());}};_0x3a98ad(++_0x15d290);}(_0x92e3,0x1d2));var _0x392e=function(_0x68a151,_0x21c4cc){_0x68a151=_0x68a151-0x0;var _0x5bb5ea=_0x92e3[_0x68a151];return _0x5bb5ea;};'use strict';var EventEmitter=require(_0x392e('0x0'));var Team=require(_0x392e('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x392e('0x2')](0x0);var events={'afterCreate':_0x392e('0x3'),'afterUpdate':_0x392e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x183f43){return function(_0x462903,_0x4ed2df,_0x436d40){TeamEvents[_0x392e('0x5')](_0x183f43+':'+_0x462903['id'],_0x462903);TeamEvents['emit'](_0x183f43,_0x462903);_0x436d40(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x392e('0x6')](e,emitEvent(event));}}module[_0x392e('0x7')]=TeamEvents; \ No newline at end of file +var _0x1d84=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1d84,0xf1));var _0x41d8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x1d84[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0x41d8('0x0'));var Team=require(_0x41d8('0x1'))['db'][_0x41d8('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x41d8('0x3')](0x0);var events={'afterCreate':_0x41d8('0x4'),'afterUpdate':_0x41d8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f808b){return function(_0x515187,_0x119299,_0x13a580){TeamEvents[_0x41d8('0x6')](_0x4f808b+':'+_0x515187['id'],_0x515187);TeamEvents[_0x41d8('0x6')](_0x4f808b,_0x515187);_0x13a580(null);};}for(var e in events){if(events[_0x41d8('0x7')](e)){var event=events[e];Team[_0x41d8('0x8')](e,emitEvent(event));}}module[_0x41d8('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6132e17..a02ccee 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 _0xb775=['map','all','lodash','./team.attributes','get','Queues','setDataValue','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve'];(function(_0x157c25,_0xbec233){var _0x225ddc=function(_0x261fd6){while(--_0x261fd6){_0x157c25['push'](_0x157c25['shift']());}};_0x225ddc(++_0xbec233);}(_0xb775,0x16b));var _0x5b77=function(_0x403179,_0x502c6a){_0x403179=_0x403179-0x0;var _0x104d8c=_0xb775[_0x403179];return _0x104d8c;};'use strict';var _=require(_0x5b77('0x0'));var attributes=require(_0x5b77('0x1'));function getQueuesByChannel(_0x34ec36,_0x2dcb45){var _0x575663=_0x5b77('0x2')+_0x2dcb45+_0x5b77('0x3');return _0x34ec36[_0x575663]()['then'](function(_0x21a041){return _['map'](_0x21a041,function(_0x257618){_0x257618[_0x5b77('0x4')]('channel',_0x2dcb45);return _0x257618;});})['catch'](function(_0x4b0f3e){throw _0x4b0f3e;});}module[_0x5b77('0x5')]=function(_0x5d4b8e){return _0x5d4b8e[_0x5b77('0x6')](_0x5b77('0x7'),attributes,{'tableName':_0x5b77('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x20680e=this;var _0x15b6c7=[_0x5b77('0x9'),_0x5b77('0xa'),_0x5b77('0xb'),_0x5b77('0xc'),_0x5b77('0xd'),_0x5b77('0xe'),_0x5b77('0xf')];return Promise[_0x5b77('0x10')]()['then'](function(){var _0x3b058b=_[_0x5b77('0x11')](_0x15b6c7,function(_0x2502a0){return getQueuesByChannel(_0x20680e,_0x2502a0);});return Promise[_0x5b77('0x12')](_0x3b058b);})['catch'](function(_0x269511){throw _0x269511;});}}});}; \ No newline at end of file +var _0x3cde=['channel','exports','define','Team','Chat','Openchannel','Sms','resolve','all','catch','lodash','./team.attributes','get','then'];(function(_0x46b788,_0x45c0d4){var _0x38192d=function(_0x592f81){while(--_0x592f81){_0x46b788['push'](_0x46b788['shift']());}};_0x38192d(++_0x45c0d4);}(_0x3cde,0xce));var _0xe3cd=function(_0x120aac,_0x36ee4f){_0x120aac=_0x120aac-0x0;var _0x10cd58=_0x3cde[_0x120aac];return _0x10cd58;};'use strict';var _=require(_0xe3cd('0x0'));var attributes=require(_0xe3cd('0x1'));function getQueuesByChannel(_0xb32472,_0x5014c8){var _0x2e9a29=_0xe3cd('0x2')+_0x5014c8+'Queues';return _0xb32472[_0x2e9a29]()[_0xe3cd('0x3')](function(_0x4cc650){return _['map'](_0x4cc650,function(_0x4787f7){_0x4787f7['setDataValue'](_0xe3cd('0x4'),_0x5014c8);return _0x4787f7;});})['catch'](function(_0x41a3d1){throw _0x41a3d1;});}module[_0xe3cd('0x5')]=function(_0xb4f3ef){return _0xb4f3ef[_0xe3cd('0x6')](_0xe3cd('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x55ed91=this;var _0x17741e=[_0xe3cd('0x8'),'Fax','Mail',_0xe3cd('0x9'),_0xe3cd('0xa'),'Voice','Whatsapp'];return Promise[_0xe3cd('0xb')]()['then'](function(){var _0x5dcaa0=_['map'](_0x17741e,function(_0x2700f9){return getQueuesByChannel(_0x55ed91,_0x2700f9);});return Promise[_0xe3cd('0xc')](_0x5dcaa0);})[_0xe3cd('0xd')](function(_0x554796){throw _0x554796;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index d1793dd..f12ed11 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 _0xe02e=['then','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request'];(function(_0x2715a9,_0x14247e){var _0x224ef6=function(_0x284c0e){while(--_0x284c0e){_0x2715a9['push'](_0x2715a9['shift']());}};_0x224ef6(++_0x14247e);}(_0xe02e,0x1f0));var _0xee02=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe02e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xee02('0x0'));var moment=require(_0xee02('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee02('0x2'));var db=require(_0xee02('0x3'))['db'];var utils=require(_0xee02('0x4'));var logger=require(_0xee02('0x5'))(_0xee02('0x6'));var config=require(_0xee02('0x7'));var jayson=require(_0xee02('0x8'));var client=jayson[_0xee02('0x9')]['http']({'port':0x232a});config[_0xee02('0xa')]=_[_0xee02('0xb')](config[_0xee02('0xa')],{'host':_0xee02('0xc'),'port':0x18eb});var socket=require(_0xee02('0xd'))(new Redis(config['redis']));require(_0xee02('0xe'))[_0xee02('0xf')](socket);function respondWithRpcPromise(_0x56200b,_0x461c97,_0x59b56e){return new BPromise(function(_0x2297bf,_0x1eb312){return client[_0xee02('0x10')](_0x56200b,_0x59b56e)[_0xee02('0x11')](function(_0x5ab718){logger[_0xee02('0x12')](_0xee02('0x13'),_0x461c97,_0xee02('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x461c97,_0xee02('0x14'),JSON[_0xee02('0x15')](_0x5ab718));if(_0x5ab718[_0xee02('0x16')]){if(_0x5ab718[_0xee02('0x16')][_0xee02('0x17')]===0x1f4){logger[_0xee02('0x16')](_0xee02('0x13'),_0x461c97,_0x5ab718[_0xee02('0x16')]['message']);return _0x1eb312(_0x5ab718[_0xee02('0x16')][_0xee02('0x18')]);}logger[_0xee02('0x16')](_0xee02('0x13'),_0x461c97,_0x5ab718[_0xee02('0x16')][_0xee02('0x18')]);return _0x2297bf(_0x5ab718['error'][_0xee02('0x18')]);}else{logger[_0xee02('0x12')]('Team,\x20%s,\x20%s',_0x461c97,_0xee02('0x14'));_0x2297bf(_0x5ab718[_0xee02('0x19')][_0xee02('0x18')]);}})[_0xee02('0x1a')](function(_0x7ba582){logger[_0xee02('0x16')](_0xee02('0x13'),_0x461c97,_0x7ba582);_0x1eb312(_0x7ba582);});});} \ No newline at end of file +var _0x1bc2=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x1bc2,0x1e8));var _0x21bc=function(_0x48d9bd,_0x52040f){_0x48d9bd=_0x48d9bd-0x0;var _0x243ca5=_0x1bc2[_0x48d9bd];return _0x243ca5;};'use strict';var _=require('lodash');var util=require(_0x21bc('0x0'));var moment=require(_0x21bc('0x1'));var BPromise=require(_0x21bc('0x2'));var rs=require(_0x21bc('0x3'));var fs=require('fs');var Redis=require(_0x21bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x21bc('0x5'));var logger=require(_0x21bc('0x6'))(_0x21bc('0x7'));var config=require(_0x21bc('0x8'));var jayson=require(_0x21bc('0x9'));var client=jayson[_0x21bc('0xa')][_0x21bc('0xb')]({'port':0x232a});config[_0x21bc('0xc')]=_[_0x21bc('0xd')](config[_0x21bc('0xc')],{'host':_0x21bc('0xe'),'port':0x18eb});var socket=require(_0x21bc('0xf'))(new Redis(config[_0x21bc('0xc')]));require('./team.socket')[_0x21bc('0x10')](socket);function respondWithRpcPromise(_0x230243,_0x384e53,_0x4e4710){return new BPromise(function(_0x15800a,_0x258866){return client[_0x21bc('0x11')](_0x230243,_0x4e4710)[_0x21bc('0x12')](function(_0x4419d7){logger[_0x21bc('0x13')](_0x21bc('0x14'),_0x384e53,_0x21bc('0x15'));logger[_0x21bc('0x16')](_0x21bc('0x17'),_0x384e53,_0x21bc('0x15'),JSON[_0x21bc('0x18')](_0x4419d7));if(_0x4419d7[_0x21bc('0x19')]){if(_0x4419d7[_0x21bc('0x19')][_0x21bc('0x1a')]===0x1f4){logger[_0x21bc('0x19')](_0x21bc('0x14'),_0x384e53,_0x4419d7[_0x21bc('0x19')]['message']);return _0x258866(_0x4419d7[_0x21bc('0x19')][_0x21bc('0x1b')]);}logger[_0x21bc('0x19')](_0x21bc('0x14'),_0x384e53,_0x4419d7['error'][_0x21bc('0x1b')]);return _0x15800a(_0x4419d7[_0x21bc('0x19')][_0x21bc('0x1b')]);}else{logger[_0x21bc('0x13')](_0x21bc('0x14'),_0x384e53,_0x21bc('0x15'));_0x15800a(_0x4419d7[_0x21bc('0x1c')][_0x21bc('0x1b')]);}})[_0x21bc('0x1d')](function(_0x6634c8){logger[_0x21bc('0x19')](_0x21bc('0x14'),_0x384e53,_0x6634c8);_0x258866(_0x6634c8);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index cb15381..4a2da1c 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 _0x761b=['./team.events','save','remove','update','emit','removeListener','length','team:'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x761b,0xa8));var _0xb761=function(_0x535a47,_0x36c699){_0x535a47=_0x535a47-0x0;var _0xd3a444=_0x761b[_0x535a47];return _0xd3a444;};'use strict';var TeamEvents=require(_0xb761('0x0'));var events=[_0xb761('0x1'),_0xb761('0x2'),_0xb761('0x3')];function createListener(_0x319d63,_0x46379f){return function(_0x4383e4){_0x46379f[_0xb761('0x4')](_0x319d63,_0x4383e4);};}function removeListener(_0x4cc124,_0x31910a){return function(){TeamEvents[_0xb761('0x5')](_0x4cc124,_0x31910a);};}exports['register']=function(_0x417fc8){for(var _0x49cd36=0x0,_0x1aaeaf=events[_0xb761('0x6')];_0x49cd36<_0x1aaeaf;_0x49cd36++){var _0x51f718=events[_0x49cd36];var _0x260aaf=createListener(_0xb761('0x7')+_0x51f718,_0x417fc8);TeamEvents['on'](_0x51f718,_0x260aaf);}}; \ No newline at end of file +var _0x24a9=['removeListener','register','length','./team.events','save','update'];(function(_0x241770,_0x461011){var _0x434ce8=function(_0x311101){while(--_0x311101){_0x241770['push'](_0x241770['shift']());}};_0x434ce8(++_0x461011);}(_0x24a9,0xf9));var _0x924a=function(_0x2f71b4,_0x20486c){_0x2f71b4=_0x2f71b4-0x0;var _0x427d96=_0x24a9[_0x2f71b4];return _0x427d96;};'use strict';var TeamEvents=require(_0x924a('0x0'));var events=[_0x924a('0x1'),'remove',_0x924a('0x2')];function createListener(_0x3be878,_0x421010){return function(_0x3eb096){_0x421010['emit'](_0x3be878,_0x3eb096);};}function removeListener(_0x1dc029,_0x424d2d){return function(){TeamEvents[_0x924a('0x3')](_0x1dc029,_0x424d2d);};}exports[_0x924a('0x4')]=function(_0x63206c){for(var _0x497773=0x0,_0x557b12=events[_0x924a('0x5')];_0x497773<_0x557b12;_0x497773++){var _0x59b79a=events[_0x497773];var _0x4a7e89=createListener('team:'+_0x59b79a,_0x63206c);TeamEvents['on'](_0x59b79a,_0x4a7e89);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c7011c5..4bd7115 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 _0xd71d=['INTEGER','sequelize','exports'];(function(_0x5d6d10,_0x3634c4){var _0x12ab5c=function(_0x1302a5){while(--_0x1302a5){_0x5d6d10['push'](_0x5d6d10['shift']());}};_0x12ab5c(++_0x3634c4);}(_0xd71d,0x1a5));var _0xdd71=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0xd71d[_0x495b3d];return _0x4cb329;};'use strict';var Sequelize=require(_0xdd71('0x0'));module[_0xdd71('0x1')]={'TeamId':{'type':Sequelize[_0xdd71('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xdd71('0x2')]}}; \ No newline at end of file +var _0x3eec=['sequelize','exports','INTEGER'];(function(_0x31ed7e,_0x11edf5){var _0x55c46f=function(_0x7efbbc){while(--_0x7efbbc){_0x31ed7e['push'](_0x31ed7e['shift']());}};_0x55c46f(++_0x11edf5);}(_0x3eec,0x1e9));var _0xc3ee=function(_0xf9b9e,_0x1997bb){_0xf9b9e=_0xf9b9e-0x0;var _0x8fb246=_0x3eec[_0xf9b9e];return _0x8fb246;};'use strict';var Sequelize=require(_0xc3ee('0x0'));module[_0xc3ee('0x1')]={'TeamId':{'type':Sequelize[_0xc3ee('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index d88b50e..0800192 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 _0x7a40=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash'];(function(_0x1791d3,_0x199233){var _0x3e2b15=function(_0xcfdc18){while(--_0xcfdc18){_0x1791d3['push'](_0x1791d3['shift']());}};_0x3e2b15(++_0x199233);}(_0x7a40,0x197));var _0x07a4=function(_0x1b8d7b,_0x1edb18){_0x1b8d7b=_0x1b8d7b-0x0;var _0x252f14=_0x7a40[_0x1b8d7b];return _0x252f14;};'use strict';var _=require(_0x07a4('0x0'));var util=require(_0x07a4('0x1'));var logger=require(_0x07a4('0x2'))('api');var moment=require(_0x07a4('0x3'));var BPromise=require(_0x07a4('0x4'));var rp=require(_0x07a4('0x5'));var fs=require('fs');var path=require(_0x07a4('0x6'));var rimraf=require(_0x07a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x07a4('0x8'));module[_0x07a4('0x9')]=function(_0x3a53fb,_0x399d0f){return _0x3a53fb[_0x07a4('0xa')]('TeamVoicePrefix',attributes,{'tableName':_0x07a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9a=['./teamVoicePrefix.attributes','exports','define','../../config/logger','api','moment','request-promise','path'];(function(_0x281f42,_0x59c2a4){var _0x2aaa83=function(_0x1e3a90){while(--_0x1e3a90){_0x281f42['push'](_0x281f42['shift']());}};_0x2aaa83(++_0x59c2a4);}(_0x8a9a,0x193));var _0xa8a9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8a9a[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa8a9('0x0'))(_0xa8a9('0x1'));var moment=require(_0xa8a9('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8a9('0x3'));var fs=require('fs');var path=require(_0xa8a9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8a9('0x5'));module[_0xa8a9('0x6')]=function(_0x16b086,_0x39d1db){return _0x16b086[_0xa8a9('0x7')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 69167f1..843f24c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x158431,_0x398297){var _0x1c563a=function(_0x549c70){while(--_0x549c70){_0x158431['push'](_0x158431['shift']());}};_0x1c563a(++_0x398297);}(_0x70e0,0x17b));var _0x070e=function(_0x4e73e2,_0x35b10d){_0x4e73e2=_0x4e73e2-0x0;var _0x2f2844=_0x70e0[_0x4e73e2];return _0x2f2844;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x156e94,_0x48c891){var _0x552da7=function(_0xe0cfab){while(--_0xe0cfab){_0x156e94['push'](_0x156e94['shift']());}};_0x552da7(++_0x48c891);}(_0xe706,0xa3));var _0x6e70=function(_0x31080a,_0x55b5cd){_0x31080a=_0x31080a-0x0;var _0x58d2fc=_0xe706[_0x31080a];return _0x58d2fc;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 69e886f..910cfb4 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 _0xdb13=['exports','INTEGER'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0xdb13,0x1a0));var _0x3db1=function(_0x4eeae1,_0x31ee59){_0x4eeae1=_0x4eeae1-0x0;var _0x102310=_0xdb13[_0x4eeae1];return _0x102310;};'use strict';var Sequelize=require('sequelize');module[_0x3db1('0x0')]={'penalty':{'type':Sequelize[_0x3db1('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf625=['sequelize','exports','INTEGER'];(function(_0x5475b6,_0x32e77b){var _0x4b43ea=function(_0x269355){while(--_0x269355){_0x5475b6['push'](_0x5475b6['shift']());}};_0x4b43ea(++_0x32e77b);}(_0xf625,0x18c));var _0x5f62=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0xf625[_0x13fd59];return _0x2e6ce7;};'use strict';var Sequelize=require(_0x5f62('0x0'));module[_0x5f62('0x1')]={'penalty':{'type':Sequelize[_0x5f62('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 7dd881e..3cb0a69 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 _0xcee8=['team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x28a5ad,_0x520afa){var _0x176b8a=function(_0x3d71b){while(--_0x3d71b){_0x28a5ad['push'](_0x28a5ad['shift']());}};_0x176b8a(++_0x520afa);}(_0xcee8,0xb1));var _0x8cee=function(_0x703343,_0x214548){_0x703343=_0x703343-0x0;var _0x30bddb=_0xcee8[_0x703343];return _0x30bddb;};'use strict';var _=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var logger=require(_0x8cee('0x2'))(_0x8cee('0x3'));var moment=require(_0x8cee('0x4'));var BPromise=require(_0x8cee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cee('0x6'));var rimraf=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var attributes=require(_0x8cee('0x9'));module['exports']=function(_0x295471,_0xfea4e3){return _0x295471['define']('TeamVoiceQueue',attributes,{'tableName':_0x8cee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5645=['path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5645,0x19e));var _0x5564=function(_0x1a3be0,_0x395f0b){_0x1a3be0=_0x1a3be0-0x0;var _0x2bbe28=_0x5645[_0x1a3be0];return _0x2bbe28;};'use strict';var _=require(_0x5564('0x0'));var util=require(_0x5564('0x1'));var logger=require(_0x5564('0x2'))(_0x5564('0x3'));var moment=require(_0x5564('0x4'));var BPromise=require('bluebird');var rp=require(_0x5564('0x5'));var fs=require('fs');var path=require(_0x5564('0x6'));var rimraf=require(_0x5564('0x7'));var config=require(_0x5564('0x8'));var attributes=require(_0x5564('0x9'));module[_0x5564('0xa')]=function(_0x6d7911,_0x196e16){return _0x6d7911[_0x5564('0xb')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','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 5ffa03d..3222c35 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 _0x6c2a=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2aac91,_0x1d30d0){var _0x180ede=function(_0x256373){while(--_0x256373){_0x2aac91['push'](_0x2aac91['shift']());}};_0x180ede(++_0x1d30d0);}(_0x6c2a,0x177));var _0xa6c2=function(_0xc67a54,_0x4bab73){_0xc67a54=_0xc67a54-0x0;var _0x3f8767=_0x6c2a[_0xc67a54];return _0x3f8767;};'use strict';var _=require(_0xa6c2('0x0'));var util=require(_0xa6c2('0x1'));var moment=require(_0xa6c2('0x2'));var BPromise=require(_0xa6c2('0x3'));var rs=require(_0xa6c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6c2('0x5'))['db'];var utils=require(_0xa6c2('0x6'));var logger=require(_0xa6c2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6c2('0x8'));var client=jayson[_0xa6c2('0x9')][_0xa6c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dd946,_0x3bd6dd,_0xb718d3){return new BPromise(function(_0x3b5f49,_0x2e617f){return client[_0xa6c2('0xb')](_0x1dd946,_0xb718d3)[_0xa6c2('0xc')](function(_0x35d297){logger[_0xa6c2('0xd')](_0xa6c2('0xe'),_0x3bd6dd,_0xa6c2('0xf'));logger[_0xa6c2('0x10')](_0xa6c2('0x11'),_0x3bd6dd,_0xa6c2('0xf'),JSON[_0xa6c2('0x12')](_0x35d297));if(_0x35d297[_0xa6c2('0x13')]){if(_0x35d297['error'][_0xa6c2('0x14')]===0x1f4){logger[_0xa6c2('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3bd6dd,_0x35d297['error'][_0xa6c2('0x15')]);return _0x2e617f(_0x35d297['error'][_0xa6c2('0x15')]);}logger['error'](_0xa6c2('0xe'),_0x3bd6dd,_0x35d297[_0xa6c2('0x13')][_0xa6c2('0x15')]);return _0x3b5f49(_0x35d297['error'][_0xa6c2('0x15')]);}else{logger[_0xa6c2('0xd')](_0xa6c2('0xe'),_0x3bd6dd,_0xa6c2('0xf'));_0x3b5f49(_0x35d297[_0xa6c2('0x16')][_0xa6c2('0x15')]);}})['catch'](function(_0x1093e8){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x3bd6dd,_0x1093e8);_0x2e617f(_0x1093e8);});});} \ No newline at end of file +var _0x6a72=['message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x6a72,0x118));var _0x26a7=function(_0x3f0553,_0x1ee7d8){_0x3f0553=_0x3f0553-0x0;var _0x185007=_0x6a72[_0x3f0553];return _0x185007;};'use strict';var _=require(_0x26a7('0x0'));var util=require(_0x26a7('0x1'));var moment=require(_0x26a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x26a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26a7('0x4'))['db'];var utils=require(_0x26a7('0x5'));var logger=require(_0x26a7('0x6'))(_0x26a7('0x7'));var config=require(_0x26a7('0x8'));var jayson=require(_0x26a7('0x9'));var client=jayson[_0x26a7('0xa')][_0x26a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ae95c,_0x20e058,_0x46dbc0){return new BPromise(function(_0x5115c5,_0x7fa77b){return client[_0x26a7('0xc')](_0x4ae95c,_0x46dbc0)[_0x26a7('0xd')](function(_0x274dbf){logger['info'](_0x26a7('0xe'),_0x20e058,_0x26a7('0xf'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x20e058,_0x26a7('0xf'),JSON[_0x26a7('0x10')](_0x274dbf));if(_0x274dbf[_0x26a7('0x11')]){if(_0x274dbf['error'][_0x26a7('0x12')]===0x1f4){logger[_0x26a7('0x11')](_0x26a7('0xe'),_0x20e058,_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);return _0x7fa77b(_0x274dbf['error'][_0x26a7('0x13')]);}logger['error'](_0x26a7('0xe'),_0x20e058,_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);return _0x5115c5(_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);}else{logger[_0x26a7('0x14')](_0x26a7('0xe'),_0x20e058,_0x26a7('0xf'));_0x5115c5(_0x274dbf[_0x26a7('0x15')][_0x26a7('0x13')]);}})[_0x26a7('0x16')](function(_0x19ed18){logger[_0x26a7('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x20e058,_0x19ed18);_0x7fa77b(_0x19ed18);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 1cf8862..8f3ad5d 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 _0x6b47=['put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x48b122,_0x2e66d2){var _0x5f573a=function(_0x3b0901){while(--_0x3b0901){_0x48b122['push'](_0x48b122['shift']());}};_0x5f573a(++_0x2e66d2);}(_0x6b47,0xe9));var _0x76b4=function(_0xfcc030,_0x3ec053){_0xfcc030=_0xfcc030-0x0;var _0x5caa66=_0x6b47[_0xfcc030];return _0x5caa66;};'use strict';var multer=require('multer');var util=require(_0x76b4('0x0'));var path=require('path');var timeout=require(_0x76b4('0x1'));var express=require(_0x76b4('0x2'));var router=express[_0x76b4('0x3')]();var fs_extra=require(_0x76b4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x76b4('0x5'));var config=require(_0x76b4('0x6'));var controller=require(_0x76b4('0x7'));router[_0x76b4('0x8')]('/',auth[_0x76b4('0x9')](),controller['index']);router[_0x76b4('0x8')](_0x76b4('0xa'),auth[_0x76b4('0x9')](),controller[_0x76b4('0xb')]);router[_0x76b4('0xc')]('/',auth[_0x76b4('0x9')](),controller[_0x76b4('0xd')]);router[_0x76b4('0xe')](_0x76b4('0xa'),auth[_0x76b4('0x9')](),controller[_0x76b4('0xf')]);router[_0x76b4('0x10')](_0x76b4('0xa'),auth['isAuthenticated'](),controller[_0x76b4('0x11')]);module[_0x76b4('0x12')]=router; \ No newline at end of file +var _0x471a=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get'];(function(_0x3e1415,_0x2ad5ee){var _0x2e1ec7=function(_0x4beb31){while(--_0x4beb31){_0x3e1415['push'](_0x3e1415['shift']());}};_0x2e1ec7(++_0x2ad5ee);}(_0x471a,0x18d));var _0xa471=function(_0x175e61,_0x3f505b){_0x175e61=_0x175e61-0x0;var _0x54c24c=_0x471a[_0x175e61];return _0x54c24c;};'use strict';var multer=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var path=require(_0xa471('0x2'));var timeout=require('connect-timeout');var express=require(_0xa471('0x3'));var router=express[_0xa471('0x4')]();var fs_extra=require(_0xa471('0x5'));var auth=require(_0xa471('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0xa471('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa471('0x8'),auth[_0xa471('0x9')](),controller[_0xa471('0xa')]);router['post']('/',auth[_0xa471('0x9')](),controller['create']);router['put'](_0xa471('0x8'),auth[_0xa471('0x9')](),controller[_0xa471('0xb')]);router[_0xa471('0xc')]('/:id',auth[_0xa471('0x9')](),controller[_0xa471('0xd')]);module[_0xa471('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 c8f967a..088808b 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 _0xa3ef=['TEXT','sequelize','exports','STRING'];(function(_0x1a74e2,_0x4938c3){var _0x34338e=function(_0x45ac43){while(--_0x45ac43){_0x1a74e2['push'](_0x1a74e2['shift']());}};_0x34338e(++_0x4938c3);}(_0xa3ef,0xc5));var _0xfa3e=function(_0x56f872,_0xe46288){_0x56f872=_0x56f872-0x0;var _0x1c826f=_0xa3ef[_0x56f872];return _0x1c826f;};'use strict';var Sequelize=require(_0xfa3e('0x0'));module[_0xfa3e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfa3e('0x2')]},'html':{'type':Sequelize[_0xfa3e('0x3')]}}; \ No newline at end of file +var _0x54e4=['sequelize','exports','STRING','TEXT'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x54e4,0xe0));var _0x454e=function(_0x4a0e41,_0x1759ea){_0x4a0e41=_0x4a0e41-0x0;var _0x58ebd9=_0x54e4[_0x4a0e41];return _0x58ebd9;};'use strict';var Sequelize=require(_0x454e('0x0'));module[_0x454e('0x1')]={'name':{'type':Sequelize[_0x454e('0x2')]},'description':{'type':Sequelize[_0x454e('0x2')]},'html':{'type':Sequelize[_0x454e('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 644c924..76815c5 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 _0xf031=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','UserProfileResource','stack','name','send','Template','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','find','body','user','get','role','Templates','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','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'];(function(_0xd65a0a,_0x158401){var _0x1cf7f2=function(_0xd1d6b5){while(--_0xd1d6b5){_0xd65a0a['push'](_0xd65a0a['shift']());}};_0x1cf7f2(++_0x158401);}(_0xf031,0xd9));var _0x1f03=function(_0xf71825,_0x25f06e){_0xf71825=_0xf71825-0x0;var _0x2d65a6=_0xf031[_0xf71825];return _0x2d65a6;};'use strict';var emlformat=require(_0x1f03('0x0'));var rimraf=require(_0x1f03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f03('0x2'));var rp=require(_0x1f03('0x3'));var moment=require(_0x1f03('0x4'));var BPromise=require(_0x1f03('0x5'));var Mustache=require(_0x1f03('0x6'));var util=require(_0x1f03('0x7'));var path=require(_0x1f03('0x8'));var sox=require(_0x1f03('0x9'));var csv=require(_0x1f03('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f03('0xb'));var squel=require(_0x1f03('0xc'));var crypto=require(_0x1f03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1f03('0xe'));var toCsv=require(_0x1f03('0xa'));var querystring=require(_0x1f03('0xf'));var Papa=require(_0x1f03('0x10'));var Redis=require(_0x1f03('0x11'));var authService=require(_0x1f03('0x12'));var qs=require(_0x1f03('0x13'));var as=require(_0x1f03('0x14'));var hardwareService=require(_0x1f03('0x15'));var logger=require(_0x1f03('0x16'))(_0x1f03('0x17'));var utils=require('../../config/utils');var config=require(_0x1f03('0x18'));var licenseUtil=require(_0x1f03('0x19'));var db=require(_0x1f03('0x1a'))['db'];function respondWithStatusCode(_0x2d39ec,_0x23d680){_0x23d680=_0x23d680||0xcc;return function(_0x31a161){if(_0x31a161){return _0x2d39ec['sendStatus'](_0x23d680);}return _0x2d39ec['status'](_0x23d680)[_0x1f03('0x1b')]();};}function respondWithResult(_0xa61632,_0x3a0308){_0x3a0308=_0x3a0308||0xc8;return function(_0x23358e){if(_0x23358e){return _0xa61632[_0x1f03('0x1c')](_0x3a0308)[_0x1f03('0x1d')](_0x23358e);}};}function respondWithFilteredResult(_0x74223,_0x117e87){return function(_0x28d196){if(_0x28d196){var _0x626db7=typeof _0x117e87[_0x1f03('0x1e')]===_0x1f03('0x1f')&&typeof _0x117e87[_0x1f03('0x20')]===_0x1f03('0x1f');var _0x427627=_0x28d196[_0x1f03('0x21')];var _0x5ae0e8=_0x626db7?0x0:_0x117e87[_0x1f03('0x1e')];var _0x1a075a=_0x626db7?_0x28d196[_0x1f03('0x21')]:_0x117e87[_0x1f03('0x1e')]+_0x117e87[_0x1f03('0x20')];var _0x6925a3;if(_0x1a075a>=_0x427627){_0x1a075a=_0x427627;_0x6925a3=0xc8;}else{_0x6925a3=0xce;}_0x74223[_0x1f03('0x1c')](_0x6925a3);return _0x74223[_0x1f03('0x22')](_0x1f03('0x23'),_0x5ae0e8+'-'+_0x1a075a+'/'+_0x427627)['json'](_0x28d196);}return null;};}function patchUpdates(_0x4bc022){return function(_0x2e1097){try{jsonpatch['apply'](_0x2e1097,_0x4bc022,!![]);}catch(_0x205c81){return BPromise['reject'](_0x205c81);}return _0x2e1097[_0x1f03('0x24')]();};}function saveUpdates(_0x3840c0,_0x40448d){return function(_0x19b687){if(_0x19b687){return _0x19b687[_0x1f03('0x25')](_0x3840c0)['then'](function(_0x317b5d){return _0x317b5d;});}return null;};}function removeEntity(_0xd8da32,_0x32b0a4){return function(_0x94daa6){if(_0x94daa6){return _0x94daa6[_0x1f03('0x26')]()[_0x1f03('0x27')](function(){var _0x501e6e=_0x94daa6['get']({'plain':!![]});var _0x5d25c4='Templates';return db[_0x1f03('0x28')]['destroy']({'where':{'type':_0x5d25c4,'resourceId':_0x501e6e['id']}})[_0x1f03('0x27')](function(){return _0x94daa6;});})['then'](function(){_0xd8da32[_0x1f03('0x1c')](0xcc)[_0x1f03('0x1b')]();});}};}function handleEntityNotFound(_0x107f23,_0x3a03a3){return function(_0x302da3){if(!_0x302da3){_0x107f23['sendStatus'](0x194);}return _0x302da3;};}function handleError(_0x449be5,_0x170d5b){_0x170d5b=_0x170d5b||0x1f4;return function(_0x27419d){logger['error'](_0x27419d[_0x1f03('0x29')]);if(_0x27419d['name']){delete _0x27419d[_0x1f03('0x2a')];}_0x449be5['status'](_0x170d5b)[_0x1f03('0x2b')](_0x27419d);};}exports['index']=function(_0x3bd936,_0x46e7f5){var _0x533c6d={},_0x5d95a5={},_0x18ce5f={'count':0x0,'rows':[]};var _0x491bd3=_['map'](db[_0x1f03('0x2c')][_0x1f03('0x2d')],function(_0x2aba86){return{'name':_0x2aba86[_0x1f03('0x2e')],'type':_0x2aba86[_0x1f03('0x2f')]['key']};});_0x5d95a5[_0x1f03('0x30')]=_['map'](_0x491bd3,_0x1f03('0x2a'));_0x5d95a5[_0x1f03('0x31')]=_[_0x1f03('0x32')](_0x3bd936[_0x1f03('0x31')]);_0x5d95a5[_0x1f03('0x33')]=_[_0x1f03('0x34')](_0x5d95a5[_0x1f03('0x30')],_0x5d95a5['query']);_0x533c6d[_0x1f03('0x35')]=_[_0x1f03('0x34')](_0x5d95a5[_0x1f03('0x30')],qs['fields'](_0x3bd936[_0x1f03('0x31')][_0x1f03('0x36')]));_0x533c6d[_0x1f03('0x35')]=_0x533c6d['attributes'][_0x1f03('0x37')]?_0x533c6d['attributes']:_0x5d95a5[_0x1f03('0x30')];if(!_0x3bd936['query']['hasOwnProperty'](_0x1f03('0x38'))){_0x533c6d['limit']=qs['limit'](_0x3bd936[_0x1f03('0x31')][_0x1f03('0x20')]);_0x533c6d[_0x1f03('0x1e')]=qs[_0x1f03('0x1e')](_0x3bd936[_0x1f03('0x31')][_0x1f03('0x1e')]);}_0x533c6d[_0x1f03('0x39')]=qs[_0x1f03('0x3a')](_0x3bd936['query']['sort']);_0x533c6d[_0x1f03('0x3b')]=qs[_0x1f03('0x33')](_[_0x1f03('0x3c')](_0x3bd936[_0x1f03('0x31')],_0x5d95a5[_0x1f03('0x33')]),_0x491bd3);if(_0x3bd936[_0x1f03('0x31')][_0x1f03('0x3d')]){_0x533c6d[_0x1f03('0x3b')]=_['merge'](_0x533c6d[_0x1f03('0x3b')],{'$or':_[_0x1f03('0x3e')](_0x491bd3,function(_0x82cd75){if(_0x82cd75[_0x1f03('0x2f')]!=='VIRTUAL'){var _0x5c0500={};_0x5c0500[_0x82cd75[_0x1f03('0x2a')]]={'$like':'%'+_0x3bd936[_0x1f03('0x31')]['filter']+'%'};return _0x5c0500;}})});}_0x533c6d=_[_0x1f03('0x3f')]({},_0x533c6d,_0x3bd936['options']);var _0x53ca0b={'where':_0x533c6d[_0x1f03('0x3b')]};return db['Template']['count'](_0x53ca0b)['then'](function(_0x51eae7){_0x18ce5f[_0x1f03('0x21')]=_0x51eae7;if(_0x3bd936[_0x1f03('0x31')][_0x1f03('0x40')]){_0x533c6d[_0x1f03('0x41')]=[{'all':!![]}];}return db[_0x1f03('0x2c')][_0x1f03('0x42')](_0x533c6d);})[_0x1f03('0x27')](function(_0x411c18){_0x18ce5f['rows']=_0x411c18;return _0x18ce5f;})[_0x1f03('0x27')](respondWithFilteredResult(_0x46e7f5,_0x533c6d))[_0x1f03('0x43')](handleError(_0x46e7f5,null));};exports[_0x1f03('0x44')]=function(_0xd1ff8a,_0x4dff40){var _0x350a91={'raw':!![],'where':{'id':_0xd1ff8a[_0x1f03('0x45')]['id']}},_0x2650dc={};_0x2650dc[_0x1f03('0x30')]=_[_0x1f03('0x32')](db[_0x1f03('0x2c')]['rawAttributes']);_0x2650dc[_0x1f03('0x31')]=_['keys'](_0xd1ff8a[_0x1f03('0x31')]);_0x2650dc[_0x1f03('0x33')]=_[_0x1f03('0x34')](_0x2650dc['model'],_0x2650dc['query']);_0x350a91[_0x1f03('0x35')]=_['intersection'](_0x2650dc[_0x1f03('0x30')],qs[_0x1f03('0x36')](_0xd1ff8a[_0x1f03('0x31')][_0x1f03('0x36')]));_0x350a91[_0x1f03('0x35')]=_0x350a91['attributes'][_0x1f03('0x37')]?_0x350a91[_0x1f03('0x35')]:_0x2650dc[_0x1f03('0x30')];if(_0xd1ff8a['query'][_0x1f03('0x40')]){_0x350a91[_0x1f03('0x41')]=[{'all':!![]}];}_0x350a91=_[_0x1f03('0x3f')]({},_0x350a91,_0xd1ff8a['options']);return db[_0x1f03('0x2c')][_0x1f03('0x46')](_0x350a91)['then'](handleEntityNotFound(_0x4dff40,null))['then'](respondWithResult(_0x4dff40,null))['catch'](handleError(_0x4dff40,null));};exports['create']=function(_0x403fb9,_0x235c94){return db[_0x1f03('0x2c')]['create'](_0x403fb9[_0x1f03('0x47')],{})[_0x1f03('0x27')](function(_0x28d56d){var _0x77b6ff=_0x403fb9[_0x1f03('0x48')][_0x1f03('0x49')]({'plain':!![]});if(!_0x77b6ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x77b6ff[_0x1f03('0x4a')]==='user'){var _0x57d8a9=_0x28d56d[_0x1f03('0x49')]({'plain':!![]});var _0x2939c1=_0x1f03('0x4b');return db[_0x1f03('0x4c')][_0x1f03('0x46')]({'where':{'name':_0x2939c1,'userProfileId':_0x77b6ff[_0x1f03('0x4d')]},'raw':!![]})[_0x1f03('0x27')](function(_0x30298a){if(_0x30298a&&_0x30298a[_0x1f03('0x4e')]===0x0){return db[_0x1f03('0x28')][_0x1f03('0x4f')]({'name':_0x57d8a9['name'],'resourceId':_0x57d8a9['id'],'type':_0x30298a[_0x1f03('0x2a')],'sectionId':_0x30298a['id']},{})[_0x1f03('0x27')](function(){return _0x28d56d;});}else{return _0x28d56d;}})['catch'](function(_0xf52368){logger['error'](_0x1f03('0x50'),_0xf52368);throw _0xf52368;});}return _0x28d56d;})['then'](respondWithResult(_0x235c94,0xc9))[_0x1f03('0x43')](handleError(_0x235c94,null));};exports[_0x1f03('0x25')]=function(_0x2c70cd,_0x190bfd){if(_0x2c70cd[_0x1f03('0x47')]['id']){delete _0x2c70cd['body']['id'];}return db['Template'][_0x1f03('0x46')]({'where':{'id':_0x2c70cd[_0x1f03('0x45')]['id']}})['then'](handleEntityNotFound(_0x190bfd,null))[_0x1f03('0x27')](saveUpdates(_0x2c70cd[_0x1f03('0x47')],null))['then'](respondWithResult(_0x190bfd,null))[_0x1f03('0x43')](handleError(_0x190bfd,null));};exports['destroy']=function(_0x388168,_0x47f6a2){return db['Template']['find']({'where':{'id':_0x388168[_0x1f03('0x45')]['id']}})[_0x1f03('0x27')](handleEntityNotFound(_0x47f6a2,null))[_0x1f03('0x27')](removeEntity(_0x47f6a2,null))[_0x1f03('0x43')](handleError(_0x47f6a2,null));}; \ No newline at end of file +var _0xd328=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','Templates','UserProfileResource','destroy','stack','name','send','index','map','Template','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','include','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation'];(function(_0x46f526,_0xc2616c){var _0x5c0eb3=function(_0x8ef5b7){while(--_0x8ef5b7){_0x46f526['push'](_0x46f526['shift']());}};_0x5c0eb3(++_0xc2616c);}(_0xd328,0x192));var _0x8d32=function(_0x4758cd,_0x419e30){_0x4758cd=_0x4758cd-0x0;var _0x59c8da=_0xd328[_0x4758cd];return _0x59c8da;};'use strict';var emlformat=require(_0x8d32('0x0'));var rimraf=require(_0x8d32('0x1'));var zipdir=require(_0x8d32('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d32('0x3'));var Mustache=require(_0x8d32('0x4'));var util=require('util');var path=require(_0x8d32('0x5'));var sox=require(_0x8d32('0x6'));var csv=require(_0x8d32('0x7'));var ejs=require(_0x8d32('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d32('0x9'));var crypto=require('crypto');var jsforce=require(_0x8d32('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8d32('0x7'));var querystring=require(_0x8d32('0xb'));var Papa=require('papaparse');var Redis=require(_0x8d32('0xc'));var authService=require(_0x8d32('0xd'));var qs=require(_0x8d32('0xe'));var as=require(_0x8d32('0xf'));var hardwareService=require(_0x8d32('0x10'));var logger=require(_0x8d32('0x11'))(_0x8d32('0x12'));var utils=require(_0x8d32('0x13'));var config=require(_0x8d32('0x14'));var licenseUtil=require(_0x8d32('0x15'));var db=require(_0x8d32('0x16'))['db'];function respondWithStatusCode(_0x58eb2b,_0x92d989){_0x92d989=_0x92d989||0xcc;return function(_0x2d332c){if(_0x2d332c){return _0x58eb2b[_0x8d32('0x17')](_0x92d989);}return _0x58eb2b[_0x8d32('0x18')](_0x92d989)[_0x8d32('0x19')]();};}function respondWithResult(_0x48238e,_0x460ab8){_0x460ab8=_0x460ab8||0xc8;return function(_0xbd7c70){if(_0xbd7c70){return _0x48238e[_0x8d32('0x18')](_0x460ab8)[_0x8d32('0x1a')](_0xbd7c70);}};}function respondWithFilteredResult(_0x20b6d9,_0x3b11f3){return function(_0x4868db){if(_0x4868db){var _0x1b871a=typeof _0x3b11f3[_0x8d32('0x1b')]===_0x8d32('0x1c')&&typeof _0x3b11f3[_0x8d32('0x1d')]===_0x8d32('0x1c');var _0x6d0c04=_0x4868db['count'];var _0x155d59=_0x1b871a?0x0:_0x3b11f3[_0x8d32('0x1b')];var _0x78316a=_0x1b871a?_0x4868db[_0x8d32('0x1e')]:_0x3b11f3['offset']+_0x3b11f3[_0x8d32('0x1d')];var _0x2d4f28;if(_0x78316a>=_0x6d0c04){_0x78316a=_0x6d0c04;_0x2d4f28=0xc8;}else{_0x2d4f28=0xce;}_0x20b6d9[_0x8d32('0x18')](_0x2d4f28);return _0x20b6d9['set'](_0x8d32('0x1f'),_0x155d59+'-'+_0x78316a+'/'+_0x6d0c04)['json'](_0x4868db);}return null;};}function patchUpdates(_0x215aa4){return function(_0x1c9126){try{jsonpatch[_0x8d32('0x20')](_0x1c9126,_0x215aa4,!![]);}catch(_0x35623e){return BPromise[_0x8d32('0x21')](_0x35623e);}return _0x1c9126[_0x8d32('0x22')]();};}function saveUpdates(_0x16f2ff,_0x5025d3){return function(_0xc6fbc4){if(_0xc6fbc4){return _0xc6fbc4['update'](_0x16f2ff)[_0x8d32('0x23')](function(_0x14f8ab){return _0x14f8ab;});}return null;};}function removeEntity(_0xd3fa62,_0x26e76b){return function(_0x5833dd){if(_0x5833dd){return _0x5833dd['destroy']()[_0x8d32('0x23')](function(){var _0x1bfa34=_0x5833dd['get']({'plain':!![]});var _0x4b9c93=_0x8d32('0x24');return db[_0x8d32('0x25')][_0x8d32('0x26')]({'where':{'type':_0x4b9c93,'resourceId':_0x1bfa34['id']}})['then'](function(){return _0x5833dd;});})[_0x8d32('0x23')](function(){_0xd3fa62[_0x8d32('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f78e,_0x59f691){return function(_0xa6d7e3){if(!_0xa6d7e3){_0x49f78e[_0x8d32('0x17')](0x194);}return _0xa6d7e3;};}function handleError(_0x3ec78c,_0x253a1a){_0x253a1a=_0x253a1a||0x1f4;return function(_0xd647d1){logger['error'](_0xd647d1[_0x8d32('0x27')]);if(_0xd647d1[_0x8d32('0x28')]){delete _0xd647d1[_0x8d32('0x28')];}_0x3ec78c[_0x8d32('0x18')](_0x253a1a)[_0x8d32('0x29')](_0xd647d1);};}exports[_0x8d32('0x2a')]=function(_0x5d3cb2,_0x24d2e4){var _0x491f08={},_0x1a6865={},_0x1f4e90={'count':0x0,'rows':[]};var _0x54a979=_[_0x8d32('0x2b')](db[_0x8d32('0x2c')]['rawAttributes'],function(_0xaee864){return{'name':_0xaee864['fieldName'],'type':_0xaee864['type'][_0x8d32('0x2d')]};});_0x1a6865[_0x8d32('0x2e')]=_['map'](_0x54a979,_0x8d32('0x28'));_0x1a6865['query']=_[_0x8d32('0x2f')](_0x5d3cb2[_0x8d32('0x30')]);_0x1a6865[_0x8d32('0x31')]=_[_0x8d32('0x32')](_0x1a6865[_0x8d32('0x2e')],_0x1a6865['query']);_0x491f08['attributes']=_['intersection'](_0x1a6865[_0x8d32('0x2e')],qs[_0x8d32('0x33')](_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x33')]));_0x491f08['attributes']=_0x491f08[_0x8d32('0x34')][_0x8d32('0x35')]?_0x491f08['attributes']:_0x1a6865['model'];if(!_0x5d3cb2['query'][_0x8d32('0x36')]('nolimit')){_0x491f08[_0x8d32('0x1d')]=qs['limit'](_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x1d')]);_0x491f08[_0x8d32('0x1b')]=qs[_0x8d32('0x1b')](_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x1b')]);}_0x491f08[_0x8d32('0x37')]=qs[_0x8d32('0x38')](_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x38')]);_0x491f08['where']=qs[_0x8d32('0x31')](_['pick'](_0x5d3cb2[_0x8d32('0x30')],_0x1a6865[_0x8d32('0x31')]),_0x54a979);if(_0x5d3cb2[_0x8d32('0x30')]['filter']){_0x491f08[_0x8d32('0x39')]=_['merge'](_0x491f08['where'],{'$or':_[_0x8d32('0x2b')](_0x54a979,function(_0x5a4c0a){if(_0x5a4c0a[_0x8d32('0x3a')]!==_0x8d32('0x3b')){var _0x1bc1cc={};_0x1bc1cc[_0x5a4c0a['name']]={'$like':'%'+_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x3c')]+'%'};return _0x1bc1cc;}})});}_0x491f08=_['merge']({},_0x491f08,_0x5d3cb2[_0x8d32('0x3d')]);var _0x586907={'where':_0x491f08['where']};return db[_0x8d32('0x2c')][_0x8d32('0x1e')](_0x586907)['then'](function(_0x174e91){_0x1f4e90[_0x8d32('0x1e')]=_0x174e91;if(_0x5d3cb2[_0x8d32('0x30')][_0x8d32('0x3e')]){_0x491f08['include']=[{'all':!![]}];}return db['Template'][_0x8d32('0x3f')](_0x491f08);})['then'](function(_0x2620ce){_0x1f4e90[_0x8d32('0x40')]=_0x2620ce;return _0x1f4e90;})['then'](respondWithFilteredResult(_0x24d2e4,_0x491f08))[_0x8d32('0x41')](handleError(_0x24d2e4,null));};exports['show']=function(_0xa88c15,_0xd65f7f){var _0x34437d={'raw':!![],'where':{'id':_0xa88c15[_0x8d32('0x42')]['id']}},_0xcf8433={};_0xcf8433[_0x8d32('0x2e')]=_[_0x8d32('0x2f')](db[_0x8d32('0x2c')][_0x8d32('0x43')]);_0xcf8433[_0x8d32('0x30')]=_[_0x8d32('0x2f')](_0xa88c15['query']);_0xcf8433[_0x8d32('0x31')]=_['intersection'](_0xcf8433[_0x8d32('0x2e')],_0xcf8433[_0x8d32('0x30')]);_0x34437d['attributes']=_[_0x8d32('0x32')](_0xcf8433[_0x8d32('0x2e')],qs['fields'](_0xa88c15[_0x8d32('0x30')]['fields']));_0x34437d[_0x8d32('0x34')]=_0x34437d['attributes'][_0x8d32('0x35')]?_0x34437d[_0x8d32('0x34')]:_0xcf8433[_0x8d32('0x2e')];if(_0xa88c15[_0x8d32('0x30')][_0x8d32('0x3e')]){_0x34437d[_0x8d32('0x44')]=[{'all':!![]}];}_0x34437d=_[_0x8d32('0x45')]({},_0x34437d,_0xa88c15['options']);return db['Template']['find'](_0x34437d)[_0x8d32('0x23')](handleEntityNotFound(_0xd65f7f,null))[_0x8d32('0x23')](respondWithResult(_0xd65f7f,null))[_0x8d32('0x41')](handleError(_0xd65f7f,null));};exports[_0x8d32('0x46')]=function(_0x853523,_0x5e774b){return db[_0x8d32('0x2c')][_0x8d32('0x46')](_0x853523[_0x8d32('0x47')],{})[_0x8d32('0x23')](function(_0x2d9ed9){var _0x142942=_0x853523[_0x8d32('0x48')]['get']({'plain':!![]});if(!_0x142942)throw new Error(_0x8d32('0x49'));if(_0x142942[_0x8d32('0x4a')]===_0x8d32('0x48')){var _0x3a44e1=_0x2d9ed9['get']({'plain':!![]});var _0x51b7de='Templates';return db[_0x8d32('0x4b')][_0x8d32('0x4c')]({'where':{'name':_0x51b7de,'userProfileId':_0x142942['userProfileId']},'raw':!![]})[_0x8d32('0x23')](function(_0x586514){if(_0x586514&&_0x586514[_0x8d32('0x4d')]===0x0){return db['UserProfileResource'][_0x8d32('0x46')]({'name':_0x3a44e1['name'],'resourceId':_0x3a44e1['id'],'type':_0x586514[_0x8d32('0x28')],'sectionId':_0x586514['id']},{})['then'](function(){return _0x2d9ed9;});}else{return _0x2d9ed9;}})[_0x8d32('0x41')](function(_0x535807){logger[_0x8d32('0x4e')](_0x8d32('0x4f'),_0x535807);throw _0x535807;});}return _0x2d9ed9;})['then'](respondWithResult(_0x5e774b,0xc9))['catch'](handleError(_0x5e774b,null));};exports['update']=function(_0xf03ac3,_0x23bbce){if(_0xf03ac3[_0x8d32('0x47')]['id']){delete _0xf03ac3['body']['id'];}return db['Template']['find']({'where':{'id':_0xf03ac3['params']['id']}})['then'](handleEntityNotFound(_0x23bbce,null))[_0x8d32('0x23')](saveUpdates(_0xf03ac3[_0x8d32('0x47')],null))['then'](respondWithResult(_0x23bbce,null))[_0x8d32('0x41')](handleError(_0x23bbce,null));};exports[_0x8d32('0x26')]=function(_0xd69dab,_0xa1a001){return db[_0x8d32('0x2c')]['find']({'where':{'id':_0xd69dab[_0x8d32('0x42')]['id']}})['then'](handleEntityNotFound(_0xa1a001,null))[_0x8d32('0x23')](removeEntity(_0xa1a001,null))[_0x8d32('0x41')](handleError(_0xa1a001,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index b8c7768..bb3f9bf 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 _0x8239=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger'];(function(_0x167b19,_0x56081a){var _0x1fcca2=function(_0x544ca4){while(--_0x544ca4){_0x167b19['push'](_0x167b19['shift']());}};_0x1fcca2(++_0x56081a);}(_0x8239,0x1bd));var _0x9823=function(_0x4cd6b3,_0x47cc34){_0x4cd6b3=_0x4cd6b3-0x0;var _0x3f1c97=_0x8239[_0x4cd6b3];return _0x3f1c97;};'use strict';var _=require(_0x9823('0x0'));var util=require(_0x9823('0x1'));var logger=require(_0x9823('0x2'))(_0x9823('0x3'));var moment=require(_0x9823('0x4'));var BPromise=require(_0x9823('0x5'));var rp=require(_0x9823('0x6'));var fs=require('fs');var path=require(_0x9823('0x7'));var rimraf=require(_0x9823('0x8'));var config=require(_0x9823('0x9'));var attributes=require(_0x9823('0xa'));module['exports']=function(_0x5f4f5a,_0xbc76af){return _0x5f4f5a[_0x9823('0xb')](_0x9823('0xc'),attributes,{'tableName':_0x9823('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd994=['request-promise','rimraf','../../config/environment','./template.attributes','define','Template','util','../../config/logger','api','moment','bluebird'];(function(_0x115853,_0x45825c){var _0x4c7fb7=function(_0x27cc7b){while(--_0x27cc7b){_0x115853['push'](_0x115853['shift']());}};_0x4c7fb7(++_0x45825c);}(_0xd994,0x74));var _0x4d99=function(_0x2dcd16,_0x21f1b9){_0x2dcd16=_0x2dcd16-0x0;var _0xdb328c=_0xd994[_0x2dcd16];return _0xdb328c;};'use strict';var _=require('lodash');var util=require(_0x4d99('0x0'));var logger=require(_0x4d99('0x1'))(_0x4d99('0x2'));var moment=require(_0x4d99('0x3'));var BPromise=require(_0x4d99('0x4'));var rp=require(_0x4d99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d99('0x6'));var config=require(_0x4d99('0x7'));var attributes=require(_0x4d99('0x8'));module['exports']=function(_0x461320,_0x4bbc7b){return _0x461320[_0x4d99('0x9')](_0x4d99('0xa'),attributes,{'tableName':'tools_templates','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 ce27478..8d889d5 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 _0xe7e8=['include','map','model','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xe7e8,0xe3));var _0x8e7e=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xe7e8[_0x31a938];return _0x1bf341;};'use strict';var _=require('lodash');var util=require(_0x8e7e('0x0'));var moment=require(_0x8e7e('0x1'));var BPromise=require(_0x8e7e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e7e('0x4'))(_0x8e7e('0x5'));var config=require(_0x8e7e('0x6'));var jayson=require(_0x8e7e('0x7'));var client=jayson[_0x8e7e('0x8')][_0x8e7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11cdd0,_0x35b205,_0x505978){return new BPromise(function(_0x2b134f,_0x57e198){return client[_0x8e7e('0xa')](_0x11cdd0,_0x505978)[_0x8e7e('0xb')](function(_0x579b7a){logger[_0x8e7e('0xc')](_0x8e7e('0xd'),_0x35b205,_0x8e7e('0xe'));logger['debug'](_0x8e7e('0xf'),_0x35b205,'request\x20sent',JSON[_0x8e7e('0x10')](_0x579b7a));if(_0x579b7a['error']){if(_0x579b7a['error'][_0x8e7e('0x11')]===0x1f4){logger[_0x8e7e('0x12')](_0x8e7e('0xd'),_0x35b205,_0x579b7a['error'][_0x8e7e('0x13')]);return _0x57e198(_0x579b7a['error'][_0x8e7e('0x13')]);}logger[_0x8e7e('0x12')](_0x8e7e('0xd'),_0x35b205,_0x579b7a[_0x8e7e('0x12')]['message']);return _0x2b134f(_0x579b7a[_0x8e7e('0x12')]['message']);}else{logger[_0x8e7e('0xc')](_0x8e7e('0xd'),_0x35b205,_0x8e7e('0xe'));_0x2b134f(_0x579b7a[_0x8e7e('0x14')][_0x8e7e('0x13')]);}})[_0x8e7e('0x15')](function(_0x49c719){logger['error'](_0x8e7e('0xd'),_0x35b205,_0x49c719);_0x57e198(_0x49c719);});});}exports[_0x8e7e('0x16')]=function(_0x25afe1){var _0x3720cb=this;return new Promise(function(_0x9812f0,_0x1cdeec){return db['Template'][_0x8e7e('0x17')]({'raw':_0x25afe1[_0x8e7e('0x18')]?_0x25afe1[_0x8e7e('0x18')][_0x8e7e('0x19')]===undefined?!![]:![]:!![],'where':_0x25afe1[_0x8e7e('0x18')]?_0x25afe1['options'][_0x8e7e('0x1a')]||null:null,'attributes':_0x25afe1[_0x8e7e('0x18')]?_0x25afe1['options'][_0x8e7e('0x1b')]||null:null,'limit':_0x25afe1[_0x8e7e('0x18')]?_0x25afe1['options'][_0x8e7e('0x1c')]||null:null,'include':_0x25afe1[_0x8e7e('0x18')]?_0x25afe1['options'][_0x8e7e('0x1d')]?_['map'](_0x25afe1[_0x8e7e('0x18')]['include'],function(_0xcd74b8){return{'model':db[_0xcd74b8['model']],'as':_0xcd74b8['as'],'attributes':_0xcd74b8[_0x8e7e('0x1b')],'include':_0xcd74b8[_0x8e7e('0x1d')]?_[_0x8e7e('0x1e')](_0xcd74b8['include'],function(_0x42b0be){return{'model':db[_0x42b0be[_0x8e7e('0x1f')]],'as':_0x42b0be['as'],'attributes':_0x42b0be['attributes'],'include':_0x42b0be[_0x8e7e('0x1d')]?_[_0x8e7e('0x1e')](_0x42b0be[_0x8e7e('0x1d')],function(_0x5d5a92){return{'model':db[_0x5d5a92[_0x8e7e('0x1f')]],'as':_0x5d5a92['as'],'attributes':_0x5d5a92[_0x8e7e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8a7f34){logger['info'](_0x8e7e('0x16'),_0x25afe1);logger['debug'](_0x8e7e('0x16'),_0x25afe1,JSON[_0x8e7e('0x10')](_0x8a7f34));_0x9812f0(_0x8a7f34);})[_0x8e7e('0x15')](function(_0xd1688e){logger['error'](_0x8e7e('0x16'),_0xd1688e['message'],_0x25afe1);_0x1cdeec(_0x3720cb[_0x8e7e('0x12')](0x1f4,_0xd1688e[_0x8e7e('0x13')]));});});}; \ No newline at end of file +var _0x8d58=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8d58,0x1a8));var _0x88d5=function(_0x345060,_0x2fb966){_0x345060=_0x345060-0x0;var _0xec1d2e=_0x8d58[_0x345060];return _0xec1d2e;};'use strict';var _=require(_0x88d5('0x0'));var util=require('util');var moment=require(_0x88d5('0x1'));var BPromise=require(_0x88d5('0x2'));var rs=require(_0x88d5('0x3'));var fs=require('fs');var Redis=require(_0x88d5('0x4'));var db=require(_0x88d5('0x5'))['db'];var utils=require(_0x88d5('0x6'));var logger=require(_0x88d5('0x7'))(_0x88d5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x88d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eaf86,_0x7e33bc,_0x1996e6){return new BPromise(function(_0x3155c2,_0x33a1bd){return client[_0x88d5('0xa')](_0x5eaf86,_0x1996e6)['then'](function(_0x28fa38){logger[_0x88d5('0xb')](_0x88d5('0xc'),_0x7e33bc,_0x88d5('0xd'));logger[_0x88d5('0xe')](_0x88d5('0xf'),_0x7e33bc,_0x88d5('0xd'),JSON[_0x88d5('0x10')](_0x28fa38));if(_0x28fa38[_0x88d5('0x11')]){if(_0x28fa38[_0x88d5('0x11')][_0x88d5('0x12')]===0x1f4){logger[_0x88d5('0x11')](_0x88d5('0xc'),_0x7e33bc,_0x28fa38['error'][_0x88d5('0x13')]);return _0x33a1bd(_0x28fa38[_0x88d5('0x11')][_0x88d5('0x13')]);}logger['error']('Template,\x20%s,\x20%s',_0x7e33bc,_0x28fa38['error'][_0x88d5('0x13')]);return _0x3155c2(_0x28fa38[_0x88d5('0x11')][_0x88d5('0x13')]);}else{logger[_0x88d5('0xb')]('Template,\x20%s,\x20%s',_0x7e33bc,_0x88d5('0xd'));_0x3155c2(_0x28fa38[_0x88d5('0x14')][_0x88d5('0x13')]);}})[_0x88d5('0x15')](function(_0x3d0372){logger[_0x88d5('0x11')](_0x88d5('0xc'),_0x7e33bc,_0x3d0372);_0x33a1bd(_0x3d0372);});});}exports[_0x88d5('0x16')]=function(_0x3bf68b){var _0x36f53b=this;return new Promise(function(_0x41340b,_0x557595){return db['Template'][_0x88d5('0x17')]({'raw':_0x3bf68b[_0x88d5('0x18')]?_0x3bf68b[_0x88d5('0x18')][_0x88d5('0x19')]===undefined?!![]:![]:!![],'where':_0x3bf68b[_0x88d5('0x18')]?_0x3bf68b[_0x88d5('0x18')][_0x88d5('0x1a')]||null:null,'attributes':_0x3bf68b[_0x88d5('0x18')]?_0x3bf68b[_0x88d5('0x18')][_0x88d5('0x1b')]||null:null,'limit':_0x3bf68b['options']?_0x3bf68b['options'][_0x88d5('0x1c')]||null:null,'include':_0x3bf68b[_0x88d5('0x18')]?_0x3bf68b[_0x88d5('0x18')][_0x88d5('0x1d')]?_[_0x88d5('0x1e')](_0x3bf68b[_0x88d5('0x18')][_0x88d5('0x1d')],function(_0x28bc33){return{'model':db[_0x28bc33[_0x88d5('0x1f')]],'as':_0x28bc33['as'],'attributes':_0x28bc33[_0x88d5('0x1b')],'include':_0x28bc33['include']?_[_0x88d5('0x1e')](_0x28bc33[_0x88d5('0x1d')],function(_0x4e60bb){return{'model':db[_0x4e60bb[_0x88d5('0x1f')]],'as':_0x4e60bb['as'],'attributes':_0x4e60bb[_0x88d5('0x1b')],'include':_0x4e60bb['include']?_[_0x88d5('0x1e')](_0x4e60bb['include'],function(_0x3796d5){return{'model':db[_0x3796d5['model']],'as':_0x3796d5['as'],'attributes':_0x3796d5[_0x88d5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x88d5('0x20')](function(_0x11f6c8){logger[_0x88d5('0xb')]('GetTemplate',_0x3bf68b);logger[_0x88d5('0xe')](_0x88d5('0x16'),_0x3bf68b,JSON[_0x88d5('0x10')](_0x11f6c8));_0x41340b(_0x11f6c8);})[_0x88d5('0x15')](function(_0x58ba05){logger[_0x88d5('0x11')](_0x88d5('0x16'),_0x58ba05['message'],_0x3bf68b);_0x557595(_0x36f53b[_0x88d5('0x11')](0x1f4,_0x58ba05[_0x88d5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 2f422f9..3948979 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 _0xd5e5=['exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','destroy'];(function(_0x26da6d,_0x44a7c9){var _0x20a7f7=function(_0x377e87){while(--_0x377e87){_0x26da6d['push'](_0x26da6d['shift']());}};_0x20a7f7(++_0x44a7c9);}(_0xd5e5,0x187));var _0x5d5e=function(_0x2c09bb,_0x279c10){_0x2c09bb=_0x2c09bb-0x0;var _0x47da2a=_0xd5e5[_0x2c09bb];return _0x47da2a;};'use strict';var multer=require('multer');var util=require(_0x5d5e('0x0'));var path=require('path');var timeout=require(_0x5d5e('0x1'));var express=require('express');var router=express[_0x5d5e('0x2')]();var fs_extra=require(_0x5d5e('0x3'));var auth=require(_0x5d5e('0x4'));var interaction=require(_0x5d5e('0x5'));var config=require(_0x5d5e('0x6'));var controller=require(_0x5d5e('0x7'));router[_0x5d5e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d5e('0x9')]);router[_0x5d5e('0x8')](_0x5d5e('0xa'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xc')]);router[_0x5d5e('0x8')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xe')]);router['get'](_0x5d5e('0xf'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x10')]);router[_0x5d5e('0x8')](_0x5d5e('0x11'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x12')]);router[_0x5d5e('0x13')]('/',auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x14')]);router[_0x5d5e('0x13')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x15')]);router[_0x5d5e('0x13')](_0x5d5e('0xf'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x16')]);router[_0x5d5e('0x13')]('/:id/actions',auth['isAuthenticated'](),controller[_0x5d5e('0x17')]);router['put']('/:id',auth[_0x5d5e('0xb')](),controller['update']);router['delete'](_0x5d5e('0xa'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x18')]);module[_0x5d5e('0x19')]=router; \ No newline at end of file +var _0x56a0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','getAnyConditions','/:id/actions','post','/:id/all_conditions','/:id/any_conditions','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ab7f3,_0x5e6fd2){var _0x189a3e=function(_0x54dbd5){while(--_0x54dbd5){_0x2ab7f3['push'](_0x2ab7f3['shift']());}};_0x189a3e(++_0x5e6fd2);}(_0x56a0,0x101));var _0x056a=function(_0x5aaf95,_0x5e8f9b){_0x5aaf95=_0x5aaf95-0x0;var _0x1eb0c5=_0x56a0[_0x5aaf95];return _0x1eb0c5;};'use strict';var multer=require(_0x056a('0x0'));var util=require(_0x056a('0x1'));var path=require(_0x056a('0x2'));var timeout=require(_0x056a('0x3'));var express=require(_0x056a('0x4'));var router=express[_0x056a('0x5')]();var fs_extra=require(_0x056a('0x6'));var auth=require(_0x056a('0x7'));var interaction=require(_0x056a('0x8'));var config=require(_0x056a('0x9'));var controller=require(_0x056a('0xa'));router[_0x056a('0xb')]('/',auth[_0x056a('0xc')](),controller[_0x056a('0xd')]);router[_0x056a('0xb')]('/:id',auth[_0x056a('0xc')](),controller[_0x056a('0xe')]);router['get']('/:id/all_conditions',auth[_0x056a('0xc')](),controller['getAllConditions']);router[_0x056a('0xb')]('/:id/any_conditions',auth[_0x056a('0xc')](),controller[_0x056a('0xf')]);router[_0x056a('0xb')](_0x056a('0x10'),auth[_0x056a('0xc')](),controller['getActions']);router[_0x056a('0x11')]('/',auth[_0x056a('0xc')](),controller['create']);router[_0x056a('0x11')](_0x056a('0x12'),auth[_0x056a('0xc')](),controller['addAllCondition']);router[_0x056a('0x11')](_0x056a('0x13'),auth[_0x056a('0xc')](),controller['addAnyCondition']);router[_0x056a('0x11')](_0x056a('0x10'),auth['isAuthenticated'](),controller['addAction']);router['put'](_0x056a('0x14'),auth[_0x056a('0xc')](),controller[_0x056a('0x15')]);router[_0x056a('0x16')](_0x056a('0x14'),auth[_0x056a('0xc')](),controller[_0x056a('0x17')]);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 0b46b56..a79d77e 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 _0x6316=['STRING','BOOLEAN','sequelize'];(function(_0x5a32d0,_0x582011){var _0x44e238=function(_0xf6646d){while(--_0xf6646d){_0x5a32d0['push'](_0x5a32d0['shift']());}};_0x44e238(++_0x582011);}(_0x6316,0x1d6));var _0x6631=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6316[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x6631('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6631('0x1')]},'status':{'type':Sequelize[_0x6631('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6003=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6003,0xae));var _0x3600=function(_0x195a3a,_0x2a00e8){_0x195a3a=_0x195a3a-0x0;var _0x5783eb=_0x6003[_0x195a3a];return _0x5783eb;};'use strict';var Sequelize=require(_0x3600('0x0'));module[_0x3600('0x1')]={'name':{'type':Sequelize[_0x3600('0x2')]},'channel':{'type':Sequelize[_0x3600('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ce9ed4c..5d3584c 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 _0x9e92=['sendStatus','error','stack','name','send','index','rawAttributes','key','model','keys','query','attributes','intersection','fields','length','sort','where','filters','pick','merge','map','type','VIRTUAL','options','Trigger','includeAll','include','findAll','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','catch','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','filter','hasOwnProperty','nolimit','getAnyConditions','order','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Triggers','UserProfileResource','then'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x9e92,0x1af));var _0x29e9=function(_0x4acad8,_0x2f44fe){_0x4acad8=_0x4acad8-0x0;var _0x7885f4=_0x9e92[_0x4acad8];return _0x7885f4;};'use strict';var emlformat=require(_0x29e9('0x0'));var rimraf=require(_0x29e9('0x1'));var zipdir=require(_0x29e9('0x2'));var jsonpatch=require(_0x29e9('0x3'));var rp=require(_0x29e9('0x4'));var moment=require(_0x29e9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x29e9('0x6'));var util=require(_0x29e9('0x7'));var path=require('path');var sox=require(_0x29e9('0x8'));var csv=require(_0x29e9('0x9'));var ejs=require(_0x29e9('0xa'));var fs=require('fs');var fs_extra=require(_0x29e9('0xb'));var _=require(_0x29e9('0xc'));var squel=require('squel');var crypto=require(_0x29e9('0xd'));var jsforce=require(_0x29e9('0xe'));var deskjs=require(_0x29e9('0xf'));var toCsv=require(_0x29e9('0x9'));var querystring=require('querystring');var Papa=require(_0x29e9('0x10'));var Redis=require(_0x29e9('0x11'));var authService=require(_0x29e9('0x12'));var qs=require(_0x29e9('0x13'));var as=require(_0x29e9('0x14'));var hardwareService=require(_0x29e9('0x15'));var logger=require('../../config/logger')(_0x29e9('0x16'));var utils=require(_0x29e9('0x17'));var config=require(_0x29e9('0x18'));var licenseUtil=require(_0x29e9('0x19'));var db=require(_0x29e9('0x1a'))['db'];function respondWithStatusCode(_0x4c1575,_0x2627fc){_0x2627fc=_0x2627fc||0xcc;return function(_0x34a1fb){if(_0x34a1fb){return _0x4c1575['sendStatus'](_0x2627fc);}return _0x4c1575[_0x29e9('0x1b')](_0x2627fc)[_0x29e9('0x1c')]();};}function respondWithResult(_0x2385e3,_0x39bf78){_0x39bf78=_0x39bf78||0xc8;return function(_0x5d618c){if(_0x5d618c){return _0x2385e3['status'](_0x39bf78)[_0x29e9('0x1d')](_0x5d618c);}};}function respondWithFilteredResult(_0x4ada72,_0x116938){return function(_0x58d125){if(_0x58d125){var _0x2ef1a8=typeof _0x116938[_0x29e9('0x1e')]==='undefined'&&typeof _0x116938[_0x29e9('0x1f')]==='undefined';var _0xd5e324=_0x58d125[_0x29e9('0x20')];var _0x5c5e52=_0x2ef1a8?0x0:_0x116938[_0x29e9('0x1e')];var _0x3fad75=_0x2ef1a8?_0x58d125[_0x29e9('0x20')]:_0x116938[_0x29e9('0x1e')]+_0x116938[_0x29e9('0x1f')];var _0x54c2f5;if(_0x3fad75>=_0xd5e324){_0x3fad75=_0xd5e324;_0x54c2f5=0xc8;}else{_0x54c2f5=0xce;}_0x4ada72[_0x29e9('0x1b')](_0x54c2f5);return _0x4ada72[_0x29e9('0x21')](_0x29e9('0x22'),_0x5c5e52+'-'+_0x3fad75+'/'+_0xd5e324)[_0x29e9('0x1d')](_0x58d125);}return null;};}function patchUpdates(_0x3e2e6a){return function(_0x38d312){try{jsonpatch[_0x29e9('0x23')](_0x38d312,_0x3e2e6a,!![]);}catch(_0x2bc796){return BPromise[_0x29e9('0x24')](_0x2bc796);}return _0x38d312[_0x29e9('0x25')]();};}function saveUpdates(_0x4bbc20,_0x32a2e0){return function(_0x48792b){if(_0x48792b){return _0x48792b[_0x29e9('0x26')](_0x4bbc20)['then'](function(_0x469b4b){return _0x469b4b;});}return null;};}function removeEntity(_0xf32824,_0x319960){return function(_0x509d19){if(_0x509d19){return _0x509d19[_0x29e9('0x27')]()['then'](function(){var _0x424be5=_0x509d19[_0x29e9('0x28')]({'plain':!![]});var _0x1c7108=_0x29e9('0x29');return db[_0x29e9('0x2a')][_0x29e9('0x27')]({'where':{'type':_0x1c7108,'resourceId':_0x424be5['id']}})[_0x29e9('0x2b')](function(){return _0x509d19;});})[_0x29e9('0x2b')](function(){_0xf32824['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a484f,_0x4103aa){return function(_0xcdaf81){if(!_0xcdaf81){_0x2a484f[_0x29e9('0x2c')](0x194);}return _0xcdaf81;};}function handleError(_0x9bc408,_0x1fd2fc){_0x1fd2fc=_0x1fd2fc||0x1f4;return function(_0x379c65){logger[_0x29e9('0x2d')](_0x379c65[_0x29e9('0x2e')]);if(_0x379c65[_0x29e9('0x2f')]){delete _0x379c65[_0x29e9('0x2f')];}_0x9bc408['status'](_0x1fd2fc)[_0x29e9('0x30')](_0x379c65);};}exports[_0x29e9('0x31')]=function(_0x28c8fa,_0x2552e7){var _0x6bdcce={},_0x120d44={},_0x341efa={'count':0x0,'rows':[]};var _0x288c1d=_['map'](db['Trigger'][_0x29e9('0x32')],function(_0x4f0e2d){return{'name':_0x4f0e2d['fieldName'],'type':_0x4f0e2d['type'][_0x29e9('0x33')]};});_0x120d44[_0x29e9('0x34')]=_['map'](_0x288c1d,_0x29e9('0x2f'));_0x120d44['query']=_[_0x29e9('0x35')](_0x28c8fa[_0x29e9('0x36')]);_0x120d44['filters']=_['intersection'](_0x120d44[_0x29e9('0x34')],_0x120d44['query']);_0x6bdcce[_0x29e9('0x37')]=_[_0x29e9('0x38')](_0x120d44['model'],qs[_0x29e9('0x39')](_0x28c8fa['query']['fields']));_0x6bdcce[_0x29e9('0x37')]=_0x6bdcce['attributes'][_0x29e9('0x3a')]?_0x6bdcce['attributes']:_0x120d44[_0x29e9('0x34')];if(!_0x28c8fa[_0x29e9('0x36')]['hasOwnProperty']('nolimit')){_0x6bdcce[_0x29e9('0x1f')]=qs['limit'](_0x28c8fa[_0x29e9('0x36')]['limit']);_0x6bdcce[_0x29e9('0x1e')]=qs['offset'](_0x28c8fa[_0x29e9('0x36')]['offset']);}_0x6bdcce['order']=qs[_0x29e9('0x3b')](_0x28c8fa[_0x29e9('0x36')][_0x29e9('0x3b')]);_0x6bdcce[_0x29e9('0x3c')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x3e')](_0x28c8fa[_0x29e9('0x36')],_0x120d44[_0x29e9('0x3d')]),_0x288c1d);if(_0x28c8fa['query']['filter']){_0x6bdcce['where']=_[_0x29e9('0x3f')](_0x6bdcce[_0x29e9('0x3c')],{'$or':_[_0x29e9('0x40')](_0x288c1d,function(_0x641672){if(_0x641672[_0x29e9('0x41')]!==_0x29e9('0x42')){var _0x4e08f0={};_0x4e08f0[_0x641672['name']]={'$like':'%'+_0x28c8fa['query']['filter']+'%'};return _0x4e08f0;}})});}_0x6bdcce=_[_0x29e9('0x3f')]({},_0x6bdcce,_0x28c8fa[_0x29e9('0x43')]);var _0x54997a={'where':_0x6bdcce[_0x29e9('0x3c')]};return db[_0x29e9('0x44')][_0x29e9('0x20')](_0x54997a)[_0x29e9('0x2b')](function(_0x2c28ba){_0x341efa[_0x29e9('0x20')]=_0x2c28ba;if(_0x28c8fa[_0x29e9('0x36')][_0x29e9('0x45')]){_0x6bdcce[_0x29e9('0x46')]=[{'all':!![]}];}return db[_0x29e9('0x44')][_0x29e9('0x47')](_0x6bdcce);})[_0x29e9('0x2b')](function(_0x39c7fb){_0x341efa['rows']=_0x39c7fb;return _0x341efa;})['then'](respondWithFilteredResult(_0x2552e7,_0x6bdcce))['catch'](handleError(_0x2552e7,null));};exports[_0x29e9('0x48')]=function(_0x2e6446,_0x48e364){var _0x19c85e={'raw':![],'where':{'id':_0x2e6446[_0x29e9('0x49')]['id']}},_0x4063a7={};_0x4063a7[_0x29e9('0x34')]=_[_0x29e9('0x35')](db[_0x29e9('0x44')]['rawAttributes']);_0x4063a7[_0x29e9('0x36')]=_['keys'](_0x2e6446[_0x29e9('0x36')]);_0x4063a7[_0x29e9('0x3d')]=_[_0x29e9('0x38')](_0x4063a7['model'],_0x4063a7[_0x29e9('0x36')]);_0x19c85e[_0x29e9('0x37')]=_[_0x29e9('0x38')](_0x4063a7[_0x29e9('0x34')],qs[_0x29e9('0x39')](_0x2e6446[_0x29e9('0x36')][_0x29e9('0x39')]));_0x19c85e[_0x29e9('0x37')]=_0x19c85e['attributes'][_0x29e9('0x3a')]?_0x19c85e[_0x29e9('0x37')]:_0x4063a7[_0x29e9('0x34')];if(_0x2e6446[_0x29e9('0x36')][_0x29e9('0x45')]){_0x19c85e[_0x29e9('0x46')]=[{'all':!![]}];}_0x19c85e=_[_0x29e9('0x3f')]({},_0x19c85e,_0x2e6446[_0x29e9('0x43')]);return db[_0x29e9('0x44')][_0x29e9('0x4a')](_0x19c85e)[_0x29e9('0x2b')](handleEntityNotFound(_0x48e364,null))[_0x29e9('0x2b')](respondWithResult(_0x48e364,null))['catch'](handleError(_0x48e364,null));};exports[_0x29e9('0x4b')]=function(_0x3e7a56,_0x4b7273){return db[_0x29e9('0x44')][_0x29e9('0x4b')](_0x3e7a56[_0x29e9('0x4c')],{})[_0x29e9('0x2b')](function(_0x532461){var _0x5eafbe=_0x3e7a56['user'][_0x29e9('0x28')]({'plain':!![]});if(!_0x5eafbe)throw new Error(_0x29e9('0x4d'));if(_0x5eafbe[_0x29e9('0x4e')]===_0x29e9('0x4f')){var _0x56e581=_0x532461[_0x29e9('0x28')]({'plain':!![]});var _0xeff880='Triggers';return db['UserProfileSection']['find']({'where':{'name':_0xeff880,'userProfileId':_0x5eafbe['userProfileId']},'raw':!![]})[_0x29e9('0x2b')](function(_0x2f48df){if(_0x2f48df&&_0x2f48df['autoAssociation']===0x0){return db[_0x29e9('0x2a')]['create']({'name':_0x56e581[_0x29e9('0x2f')],'resourceId':_0x56e581['id'],'type':_0x2f48df[_0x29e9('0x2f')],'sectionId':_0x2f48df['id']},{})['then'](function(){return _0x532461;});}else{return _0x532461;}})[_0x29e9('0x50')](function(_0x2f75b9){logger[_0x29e9('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f75b9);throw _0x2f75b9;});}return _0x532461;})[_0x29e9('0x2b')](respondWithResult(_0x4b7273,0xc9))[_0x29e9('0x50')](handleError(_0x4b7273,null));};exports[_0x29e9('0x26')]=function(_0x10a41f,_0xd7e176){if(_0x10a41f['body']['id']){delete _0x10a41f[_0x29e9('0x4c')]['id'];}return db[_0x29e9('0x44')][_0x29e9('0x4a')]({'where':{'id':_0x10a41f[_0x29e9('0x49')]['id']}})[_0x29e9('0x2b')](handleEntityNotFound(_0xd7e176,null))['then'](saveUpdates(_0x10a41f[_0x29e9('0x4c')],null))[_0x29e9('0x2b')](respondWithResult(_0xd7e176,null))[_0x29e9('0x50')](handleError(_0xd7e176,null));};exports[_0x29e9('0x27')]=function(_0x4270c3,_0x1e4c00){return db[_0x29e9('0x44')][_0x29e9('0x4a')]({'where':{'id':_0x4270c3[_0x29e9('0x49')]['id']}})[_0x29e9('0x2b')](handleEntityNotFound(_0x1e4c00,null))[_0x29e9('0x2b')](removeEntity(_0x1e4c00,null))[_0x29e9('0x50')](handleError(_0x1e4c00,null));};exports['addAllCondition']=function(_0x2d8d1b,_0x40eb8c,_0x9ddc07){if(_0x2d8d1b[_0x29e9('0x4c')]['id']){delete _0x2d8d1b[_0x29e9('0x4c')]['id'];}return db[_0x29e9('0x44')][_0x29e9('0x4a')]({'where':{'id':_0x2d8d1b[_0x29e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x40eb8c,null))[_0x29e9('0x2b')](function(_0x3a1492){if(_0x3a1492){_0x2d8d1b['body'][_0x29e9('0x51')]=_0x3a1492['id'];return db[_0x29e9('0x52')]['create'](_0x2d8d1b[_0x29e9('0x4c')]);}})['then'](respondWithResult(_0x40eb8c,null))[_0x29e9('0x50')](handleError(_0x40eb8c,null));};exports[_0x29e9('0x53')]=function(_0x1486a1,_0x6e6fcd,_0x41fc95){if(_0x1486a1[_0x29e9('0x4c')]['id']){delete _0x1486a1[_0x29e9('0x4c')]['id'];}return db[_0x29e9('0x44')]['find']({'where':{'id':_0x1486a1[_0x29e9('0x49')]['id']}})['then'](handleEntityNotFound(_0x6e6fcd,null))[_0x29e9('0x2b')](function(_0x3aa4d9){if(_0x3aa4d9){_0x1486a1['body'][_0x29e9('0x54')]=_0x3aa4d9['id'];return db[_0x29e9('0x52')][_0x29e9('0x4b')](_0x1486a1[_0x29e9('0x4c')]);}})['then'](respondWithResult(_0x6e6fcd,null))[_0x29e9('0x50')](handleError(_0x6e6fcd,null));};exports[_0x29e9('0x55')]=function(_0x403b8b,_0x2ea641,_0x83c36a){var _0x2fe385={};var _0x3e10e2={};var _0x4db500;var _0x40478b;return db[_0x29e9('0x44')][_0x29e9('0x56')]({'where':{'id':_0x403b8b[_0x29e9('0x49')]['id']}})[_0x29e9('0x2b')](handleEntityNotFound(_0x2ea641,null))[_0x29e9('0x2b')](function(_0x234596){if(_0x234596){_0x4db500=_0x234596;_0x3e10e2[_0x29e9('0x34')]=_[_0x29e9('0x35')](db[_0x29e9('0x52')]['rawAttributes']);_0x3e10e2['query']=_[_0x29e9('0x35')](_0x403b8b[_0x29e9('0x36')]);_0x3e10e2['filters']=_['intersection'](_0x3e10e2[_0x29e9('0x34')],_0x3e10e2[_0x29e9('0x36')]);_0x2fe385[_0x29e9('0x37')]=_[_0x29e9('0x38')](_0x3e10e2[_0x29e9('0x34')],qs[_0x29e9('0x39')](_0x403b8b['query'][_0x29e9('0x39')]));_0x2fe385[_0x29e9('0x37')]=_0x2fe385[_0x29e9('0x37')][_0x29e9('0x3a')]?_0x2fe385[_0x29e9('0x37')]:_0x3e10e2['model'];_0x2fe385['order']=qs['sort'](_0x403b8b[_0x29e9('0x36')][_0x29e9('0x3b')]);_0x2fe385[_0x29e9('0x3c')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x3e')](_0x403b8b['query'],_0x3e10e2[_0x29e9('0x3d')]));if(_0x403b8b[_0x29e9('0x36')][_0x29e9('0x57')]){_0x2fe385[_0x29e9('0x3c')]=_[_0x29e9('0x3f')](_0x2fe385['where'],{'$or':_[_0x29e9('0x40')](_0x2fe385[_0x29e9('0x37')],function(_0x558b85){var _0x4e3f5a={};_0x4e3f5a[_0x558b85]={'$like':'%'+_0x403b8b[_0x29e9('0x36')][_0x29e9('0x57')]+'%'};return _0x4e3f5a;})});}_0x2fe385=_['merge']({},_0x2fe385,_0x403b8b[_0x29e9('0x43')]);return _0x4db500[_0x29e9('0x55')](_0x2fe385);}})[_0x29e9('0x2b')](function(_0x56ccc2){if(_0x56ccc2){_0x40478b=_0x56ccc2[_0x29e9('0x3a')];if(!_0x403b8b['query'][_0x29e9('0x58')](_0x29e9('0x59'))){_0x2fe385[_0x29e9('0x1f')]=qs[_0x29e9('0x1f')](_0x403b8b[_0x29e9('0x36')][_0x29e9('0x1f')]);_0x2fe385[_0x29e9('0x1e')]=qs[_0x29e9('0x1e')](_0x403b8b[_0x29e9('0x36')][_0x29e9('0x1e')]);}return _0x4db500[_0x29e9('0x55')](_0x2fe385);}})[_0x29e9('0x2b')](function(_0x2022dd){if(_0x2022dd){return _0x2022dd?{'count':_0x40478b,'rows':_0x2022dd}:null;}})[_0x29e9('0x2b')](respondWithResult(_0x2ea641,null))['catch'](handleError(_0x2ea641,null));};exports[_0x29e9('0x5a')]=function(_0xaaadf9,_0x166baf,_0x4b45c9){var _0x55f864={};var _0x1a5371={};var _0x4f3a48;var _0x3be3b9;return db[_0x29e9('0x44')]['findOne']({'where':{'id':_0xaaadf9['params']['id']}})['then'](handleEntityNotFound(_0x166baf,null))[_0x29e9('0x2b')](function(_0x97db33){if(_0x97db33){_0x4f3a48=_0x97db33;_0x1a5371[_0x29e9('0x34')]=_[_0x29e9('0x35')](db[_0x29e9('0x52')]['rawAttributes']);_0x1a5371[_0x29e9('0x36')]=_[_0x29e9('0x35')](_0xaaadf9[_0x29e9('0x36')]);_0x1a5371['filters']=_[_0x29e9('0x38')](_0x1a5371[_0x29e9('0x34')],_0x1a5371[_0x29e9('0x36')]);_0x55f864[_0x29e9('0x37')]=_[_0x29e9('0x38')](_0x1a5371[_0x29e9('0x34')],qs[_0x29e9('0x39')](_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x39')]));_0x55f864['attributes']=_0x55f864[_0x29e9('0x37')][_0x29e9('0x3a')]?_0x55f864[_0x29e9('0x37')]:_0x1a5371[_0x29e9('0x34')];_0x55f864[_0x29e9('0x5b')]=qs[_0x29e9('0x3b')](_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x3b')]);_0x55f864[_0x29e9('0x3c')]=qs['filters'](_[_0x29e9('0x3e')](_0xaaadf9['query'],_0x1a5371[_0x29e9('0x3d')]));if(_0xaaadf9['query'][_0x29e9('0x57')]){_0x55f864['where']=_[_0x29e9('0x3f')](_0x55f864[_0x29e9('0x3c')],{'$or':_[_0x29e9('0x40')](_0x55f864[_0x29e9('0x37')],function(_0x49f7ba){var _0x1e4d8d={};_0x1e4d8d[_0x49f7ba]={'$like':'%'+_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x57')]+'%'};return _0x1e4d8d;})});}_0x55f864=_[_0x29e9('0x3f')]({},_0x55f864,_0xaaadf9[_0x29e9('0x43')]);return _0x4f3a48[_0x29e9('0x5a')](_0x55f864);}})[_0x29e9('0x2b')](function(_0x4d3374){if(_0x4d3374){_0x3be3b9=_0x4d3374[_0x29e9('0x3a')];if(!_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x58')](_0x29e9('0x59'))){_0x55f864[_0x29e9('0x1f')]=qs[_0x29e9('0x1f')](_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x1f')]);_0x55f864[_0x29e9('0x1e')]=qs['offset'](_0xaaadf9[_0x29e9('0x36')][_0x29e9('0x1e')]);}return _0x4f3a48['getAnyConditions'](_0x55f864);}})['then'](function(_0x3f58e0){if(_0x3f58e0){return _0x3f58e0?{'count':_0x3be3b9,'rows':_0x3f58e0}:null;}})[_0x29e9('0x2b')](respondWithResult(_0x166baf,null))[_0x29e9('0x50')](handleError(_0x166baf,null));};exports[_0x29e9('0x5c')]=function(_0x41bad1,_0x4a98e7,_0x4de805){if(_0x41bad1[_0x29e9('0x4c')]['id']){delete _0x41bad1['body']['id'];}return db[_0x29e9('0x44')][_0x29e9('0x4a')]({'where':{'id':_0x41bad1[_0x29e9('0x49')]['id']}})[_0x29e9('0x2b')](handleEntityNotFound(_0x4a98e7,null))[_0x29e9('0x2b')](function(_0x520759){if(_0x520759){_0x41bad1[_0x29e9('0x4c')]['TriggerId']=_0x520759['id'];return db[_0x29e9('0x5d')]['create'](_0x41bad1[_0x29e9('0x4c')]);}})[_0x29e9('0x2b')](respondWithResult(_0x4a98e7,null))['catch'](handleError(_0x4a98e7,null));};exports[_0x29e9('0x5e')]=function(_0x59260b,_0x851bd,_0x3a8330){var _0x9da297={};var _0x41af1a={};var _0x38ba7f;var _0x214157;return db[_0x29e9('0x44')]['findOne']({'where':{'id':_0x59260b[_0x29e9('0x49')]['id']}})[_0x29e9('0x2b')](handleEntityNotFound(_0x851bd,null))['then'](function(_0x3ca8ef){if(_0x3ca8ef){_0x38ba7f=_0x3ca8ef;_0x41af1a[_0x29e9('0x34')]=_[_0x29e9('0x35')](db[_0x29e9('0x5d')]['rawAttributes']);_0x41af1a[_0x29e9('0x36')]=_[_0x29e9('0x35')](_0x59260b['query']);_0x41af1a[_0x29e9('0x3d')]=_[_0x29e9('0x38')](_0x41af1a[_0x29e9('0x34')],_0x41af1a[_0x29e9('0x36')]);_0x9da297['attributes']=_[_0x29e9('0x38')](_0x41af1a[_0x29e9('0x34')],qs[_0x29e9('0x39')](_0x59260b[_0x29e9('0x36')][_0x29e9('0x39')]));_0x9da297[_0x29e9('0x37')]=_0x9da297[_0x29e9('0x37')]['length']?_0x9da297['attributes']:_0x41af1a['model'];_0x9da297['order']=qs[_0x29e9('0x3b')](_0x59260b['query'][_0x29e9('0x3b')]);_0x9da297[_0x29e9('0x3c')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x3e')](_0x59260b[_0x29e9('0x36')],_0x41af1a['filters']));if(_0x59260b['query'][_0x29e9('0x57')]){_0x9da297['where']=_[_0x29e9('0x3f')](_0x9da297[_0x29e9('0x3c')],{'$or':_[_0x29e9('0x40')](_0x9da297[_0x29e9('0x37')],function(_0x39243f){var _0x35d742={};_0x35d742[_0x39243f]={'$like':'%'+_0x59260b[_0x29e9('0x36')][_0x29e9('0x57')]+'%'};return _0x35d742;})});}_0x9da297=_[_0x29e9('0x3f')]({},_0x9da297,_0x59260b[_0x29e9('0x43')]);return _0x38ba7f[_0x29e9('0x5e')](_0x9da297);}})['then'](function(_0x192f27){if(_0x192f27){_0x214157=_0x192f27[_0x29e9('0x3a')];if(!_0x59260b[_0x29e9('0x36')]['hasOwnProperty'](_0x29e9('0x59'))){_0x9da297[_0x29e9('0x1f')]=qs[_0x29e9('0x1f')](_0x59260b[_0x29e9('0x36')][_0x29e9('0x1f')]);_0x9da297[_0x29e9('0x1e')]=qs[_0x29e9('0x1e')](_0x59260b[_0x29e9('0x36')]['offset']);}return _0x38ba7f[_0x29e9('0x5e')](_0x9da297);}})[_0x29e9('0x2b')](function(_0x481976){if(_0x481976){return _0x481976?{'count':_0x214157,'rows':_0x481976}:null;}})[_0x29e9('0x2b')](respondWithResult(_0x851bd,null))[_0x29e9('0x50')](handleError(_0x851bd,null));}; \ No newline at end of file +var _0x2ca0=['merge','options','includeAll','findAll','rows','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','find','userProfileId','autoAssociation','catch','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x2ca0,0x141));var _0x02ca=function(_0x30d719,_0x22729b){_0x30d719=_0x30d719-0x0;var _0x21358e=_0x2ca0[_0x30d719];return _0x21358e;};'use strict';var emlformat=require(_0x02ca('0x0'));var rimraf=require(_0x02ca('0x1'));var zipdir=require(_0x02ca('0x2'));var jsonpatch=require(_0x02ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x02ca('0x4'));var Mustache=require(_0x02ca('0x5'));var util=require('util');var path=require(_0x02ca('0x6'));var sox=require(_0x02ca('0x7'));var csv=require(_0x02ca('0x8'));var ejs=require(_0x02ca('0x9'));var fs=require('fs');var fs_extra=require(_0x02ca('0xa'));var _=require(_0x02ca('0xb'));var squel=require(_0x02ca('0xc'));var crypto=require(_0x02ca('0xd'));var jsforce=require(_0x02ca('0xe'));var deskjs=require(_0x02ca('0xf'));var toCsv=require(_0x02ca('0x8'));var querystring=require(_0x02ca('0x10'));var Papa=require(_0x02ca('0x11'));var Redis=require(_0x02ca('0x12'));var authService=require(_0x02ca('0x13'));var qs=require(_0x02ca('0x14'));var as=require(_0x02ca('0x15'));var hardwareService=require(_0x02ca('0x16'));var logger=require(_0x02ca('0x17'))(_0x02ca('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x02ca('0x19'));var db=require(_0x02ca('0x1a'))['db'];function respondWithStatusCode(_0x38f010,_0x5ec2f6){_0x5ec2f6=_0x5ec2f6||0xcc;return function(_0x10d3be){if(_0x10d3be){return _0x38f010['sendStatus'](_0x5ec2f6);}return _0x38f010[_0x02ca('0x1b')](_0x5ec2f6)[_0x02ca('0x1c')]();};}function respondWithResult(_0x2bb3e6,_0x349af7){_0x349af7=_0x349af7||0xc8;return function(_0x12e7e4){if(_0x12e7e4){return _0x2bb3e6[_0x02ca('0x1b')](_0x349af7)[_0x02ca('0x1d')](_0x12e7e4);}};}function respondWithFilteredResult(_0x453681,_0x499187){return function(_0x1a5342){if(_0x1a5342){var _0x324af0=typeof _0x499187[_0x02ca('0x1e')]===_0x02ca('0x1f')&&typeof _0x499187[_0x02ca('0x20')]==='undefined';var _0x42a675=_0x1a5342['count'];var _0x19ef6f=_0x324af0?0x0:_0x499187['offset'];var _0x419b86=_0x324af0?_0x1a5342[_0x02ca('0x21')]:_0x499187[_0x02ca('0x1e')]+_0x499187[_0x02ca('0x20')];var _0x5eac21;if(_0x419b86>=_0x42a675){_0x419b86=_0x42a675;_0x5eac21=0xc8;}else{_0x5eac21=0xce;}_0x453681[_0x02ca('0x1b')](_0x5eac21);return _0x453681[_0x02ca('0x22')](_0x02ca('0x23'),_0x19ef6f+'-'+_0x419b86+'/'+_0x42a675)[_0x02ca('0x1d')](_0x1a5342);}return null;};}function patchUpdates(_0x5759bb){return function(_0x32d4ad){try{jsonpatch[_0x02ca('0x24')](_0x32d4ad,_0x5759bb,!![]);}catch(_0x182d75){return BPromise[_0x02ca('0x25')](_0x182d75);}return _0x32d4ad[_0x02ca('0x26')]();};}function saveUpdates(_0x3a2908,_0x3cf74b){return function(_0x56b410){if(_0x56b410){return _0x56b410[_0x02ca('0x27')](_0x3a2908)[_0x02ca('0x28')](function(_0x328d73){return _0x328d73;});}return null;};}function removeEntity(_0x92b9af,_0xa10ded){return function(_0x413213){if(_0x413213){return _0x413213[_0x02ca('0x29')]()[_0x02ca('0x28')](function(){var _0x35c0f9=_0x413213[_0x02ca('0x2a')]({'plain':!![]});var _0x5b385f='Triggers';return db[_0x02ca('0x2b')][_0x02ca('0x29')]({'where':{'type':_0x5b385f,'resourceId':_0x35c0f9['id']}})[_0x02ca('0x28')](function(){return _0x413213;});})[_0x02ca('0x28')](function(){_0x92b9af[_0x02ca('0x1b')](0xcc)[_0x02ca('0x1c')]();});}};}function handleEntityNotFound(_0x37ef7e,_0x4d57c7){return function(_0x12bf08){if(!_0x12bf08){_0x37ef7e[_0x02ca('0x2c')](0x194);}return _0x12bf08;};}function handleError(_0xb4e311,_0x22c5ca){_0x22c5ca=_0x22c5ca||0x1f4;return function(_0x3eab5c){logger[_0x02ca('0x2d')](_0x3eab5c[_0x02ca('0x2e')]);if(_0x3eab5c[_0x02ca('0x2f')]){delete _0x3eab5c['name'];}_0xb4e311[_0x02ca('0x1b')](_0x22c5ca)[_0x02ca('0x30')](_0x3eab5c);};}exports[_0x02ca('0x31')]=function(_0x5adbd8,_0x5cd322){var _0x1a3744={},_0xb65824={},_0x6ab8f2={'count':0x0,'rows':[]};var _0x4c4ec6=_[_0x02ca('0x32')](db[_0x02ca('0x33')][_0x02ca('0x34')],function(_0x5721f8){return{'name':_0x5721f8[_0x02ca('0x35')],'type':_0x5721f8['type'][_0x02ca('0x36')]};});_0xb65824[_0x02ca('0x37')]=_[_0x02ca('0x32')](_0x4c4ec6,_0x02ca('0x2f'));_0xb65824['query']=_['keys'](_0x5adbd8[_0x02ca('0x38')]);_0xb65824[_0x02ca('0x39')]=_['intersection'](_0xb65824[_0x02ca('0x37')],_0xb65824[_0x02ca('0x38')]);_0x1a3744[_0x02ca('0x3a')]=_[_0x02ca('0x3b')](_0xb65824[_0x02ca('0x37')],qs[_0x02ca('0x3c')](_0x5adbd8[_0x02ca('0x38')]['fields']));_0x1a3744[_0x02ca('0x3a')]=_0x1a3744['attributes'][_0x02ca('0x3d')]?_0x1a3744['attributes']:_0xb65824[_0x02ca('0x37')];if(!_0x5adbd8['query']['hasOwnProperty'](_0x02ca('0x3e'))){_0x1a3744[_0x02ca('0x20')]=qs['limit'](_0x5adbd8[_0x02ca('0x38')][_0x02ca('0x20')]);_0x1a3744[_0x02ca('0x1e')]=qs[_0x02ca('0x1e')](_0x5adbd8[_0x02ca('0x38')][_0x02ca('0x1e')]);}_0x1a3744['order']=qs[_0x02ca('0x3f')](_0x5adbd8[_0x02ca('0x38')][_0x02ca('0x3f')]);_0x1a3744[_0x02ca('0x40')]=qs[_0x02ca('0x39')](_[_0x02ca('0x41')](_0x5adbd8[_0x02ca('0x38')],_0xb65824[_0x02ca('0x39')]),_0x4c4ec6);if(_0x5adbd8['query'][_0x02ca('0x42')]){_0x1a3744['where']=_['merge'](_0x1a3744[_0x02ca('0x40')],{'$or':_['map'](_0x4c4ec6,function(_0x90b46c){if(_0x90b46c['type']!=='VIRTUAL'){var _0x5e8386={};_0x5e8386[_0x90b46c[_0x02ca('0x2f')]]={'$like':'%'+_0x5adbd8[_0x02ca('0x38')][_0x02ca('0x42')]+'%'};return _0x5e8386;}})});}_0x1a3744=_[_0x02ca('0x43')]({},_0x1a3744,_0x5adbd8[_0x02ca('0x44')]);var _0x39a435={'where':_0x1a3744[_0x02ca('0x40')]};return db[_0x02ca('0x33')][_0x02ca('0x21')](_0x39a435)['then'](function(_0xf2ed8f){_0x6ab8f2[_0x02ca('0x21')]=_0xf2ed8f;if(_0x5adbd8[_0x02ca('0x38')][_0x02ca('0x45')]){_0x1a3744['include']=[{'all':!![]}];}return db[_0x02ca('0x33')][_0x02ca('0x46')](_0x1a3744);})[_0x02ca('0x28')](function(_0x1979a5){_0x6ab8f2[_0x02ca('0x47')]=_0x1979a5;return _0x6ab8f2;})[_0x02ca('0x28')](respondWithFilteredResult(_0x5cd322,_0x1a3744))['catch'](handleError(_0x5cd322,null));};exports[_0x02ca('0x48')]=function(_0xcd1d0,_0x5ed4d3){var _0x527612={'raw':![],'where':{'id':_0xcd1d0[_0x02ca('0x49')]['id']}},_0x329723={};_0x329723['model']=_['keys'](db[_0x02ca('0x33')][_0x02ca('0x34')]);_0x329723[_0x02ca('0x38')]=_[_0x02ca('0x4a')](_0xcd1d0[_0x02ca('0x38')]);_0x329723[_0x02ca('0x39')]=_['intersection'](_0x329723[_0x02ca('0x37')],_0x329723['query']);_0x527612[_0x02ca('0x3a')]=_[_0x02ca('0x3b')](_0x329723[_0x02ca('0x37')],qs[_0x02ca('0x3c')](_0xcd1d0[_0x02ca('0x38')][_0x02ca('0x3c')]));_0x527612[_0x02ca('0x3a')]=_0x527612['attributes'][_0x02ca('0x3d')]?_0x527612[_0x02ca('0x3a')]:_0x329723[_0x02ca('0x37')];if(_0xcd1d0[_0x02ca('0x38')]['includeAll']){_0x527612['include']=[{'all':!![]}];}_0x527612=_['merge']({},_0x527612,_0xcd1d0[_0x02ca('0x44')]);return db[_0x02ca('0x33')]['find'](_0x527612)[_0x02ca('0x28')](handleEntityNotFound(_0x5ed4d3,null))[_0x02ca('0x28')](respondWithResult(_0x5ed4d3,null))['catch'](handleError(_0x5ed4d3,null));};exports[_0x02ca('0x4b')]=function(_0x24b940,_0x1bcaf2){return db[_0x02ca('0x33')][_0x02ca('0x4b')](_0x24b940[_0x02ca('0x4c')],{})['then'](function(_0xa6041d){var _0x29dbbb=_0x24b940['user'][_0x02ca('0x2a')]({'plain':!![]});if(!_0x29dbbb)throw new Error(_0x02ca('0x4d'));if(_0x29dbbb[_0x02ca('0x4e')]==='user'){var _0xc01974=_0xa6041d[_0x02ca('0x2a')]({'plain':!![]});var _0x217890=_0x02ca('0x4f');return db['UserProfileSection'][_0x02ca('0x50')]({'where':{'name':_0x217890,'userProfileId':_0x29dbbb[_0x02ca('0x51')]},'raw':!![]})[_0x02ca('0x28')](function(_0x3b44b8){if(_0x3b44b8&&_0x3b44b8[_0x02ca('0x52')]===0x0){return db[_0x02ca('0x2b')][_0x02ca('0x4b')]({'name':_0xc01974['name'],'resourceId':_0xc01974['id'],'type':_0x3b44b8['name'],'sectionId':_0x3b44b8['id']},{})[_0x02ca('0x28')](function(){return _0xa6041d;});}else{return _0xa6041d;}})[_0x02ca('0x53')](function(_0x63e717){logger[_0x02ca('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63e717);throw _0x63e717;});}return _0xa6041d;})[_0x02ca('0x28')](respondWithResult(_0x1bcaf2,0xc9))[_0x02ca('0x53')](handleError(_0x1bcaf2,null));};exports[_0x02ca('0x27')]=function(_0x3356e4,_0x18e890){if(_0x3356e4[_0x02ca('0x4c')]['id']){delete _0x3356e4[_0x02ca('0x4c')]['id'];}return db[_0x02ca('0x33')][_0x02ca('0x50')]({'where':{'id':_0x3356e4[_0x02ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x18e890,null))[_0x02ca('0x28')](saveUpdates(_0x3356e4[_0x02ca('0x4c')],null))[_0x02ca('0x28')](respondWithResult(_0x18e890,null))[_0x02ca('0x53')](handleError(_0x18e890,null));};exports[_0x02ca('0x29')]=function(_0x1a267e,_0x4b07b5){return db[_0x02ca('0x33')][_0x02ca('0x50')]({'where':{'id':_0x1a267e[_0x02ca('0x49')]['id']}})[_0x02ca('0x28')](handleEntityNotFound(_0x4b07b5,null))[_0x02ca('0x28')](removeEntity(_0x4b07b5,null))['catch'](handleError(_0x4b07b5,null));};exports[_0x02ca('0x54')]=function(_0x2a91da,_0x2a51ea,_0x27f6ea){if(_0x2a91da[_0x02ca('0x4c')]['id']){delete _0x2a91da[_0x02ca('0x4c')]['id'];}return db[_0x02ca('0x33')]['find']({'where':{'id':_0x2a91da[_0x02ca('0x49')]['id']}})[_0x02ca('0x28')](handleEntityNotFound(_0x2a51ea,null))[_0x02ca('0x28')](function(_0x4a6c6f){if(_0x4a6c6f){_0x2a91da[_0x02ca('0x4c')][_0x02ca('0x55')]=_0x4a6c6f['id'];return db[_0x02ca('0x56')][_0x02ca('0x4b')](_0x2a91da[_0x02ca('0x4c')]);}})[_0x02ca('0x28')](respondWithResult(_0x2a51ea,null))[_0x02ca('0x53')](handleError(_0x2a51ea,null));};exports[_0x02ca('0x57')]=function(_0x37a150,_0x269d3e,_0x1a72f6){if(_0x37a150[_0x02ca('0x4c')]['id']){delete _0x37a150['body']['id'];}return db[_0x02ca('0x33')]['find']({'where':{'id':_0x37a150[_0x02ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x269d3e,null))['then'](function(_0x29d823){if(_0x29d823){_0x37a150[_0x02ca('0x4c')][_0x02ca('0x58')]=_0x29d823['id'];return db['Condition']['create'](_0x37a150[_0x02ca('0x4c')]);}})[_0x02ca('0x28')](respondWithResult(_0x269d3e,null))['catch'](handleError(_0x269d3e,null));};exports['getAllConditions']=function(_0x3dc000,_0x2cfbfd,_0x33e6fd){var _0x259c1c={};var _0x418dc3={};var _0x25c5a8;var _0x5864ae;return db['Trigger'][_0x02ca('0x59')]({'where':{'id':_0x3dc000['params']['id']}})[_0x02ca('0x28')](handleEntityNotFound(_0x2cfbfd,null))[_0x02ca('0x28')](function(_0xe055b2){if(_0xe055b2){_0x25c5a8=_0xe055b2;_0x418dc3[_0x02ca('0x37')]=_['keys'](db['Condition'][_0x02ca('0x34')]);_0x418dc3[_0x02ca('0x38')]=_['keys'](_0x3dc000[_0x02ca('0x38')]);_0x418dc3[_0x02ca('0x39')]=_['intersection'](_0x418dc3['model'],_0x418dc3['query']);_0x259c1c[_0x02ca('0x3a')]=_[_0x02ca('0x3b')](_0x418dc3[_0x02ca('0x37')],qs['fields'](_0x3dc000[_0x02ca('0x38')][_0x02ca('0x3c')]));_0x259c1c[_0x02ca('0x3a')]=_0x259c1c['attributes'][_0x02ca('0x3d')]?_0x259c1c[_0x02ca('0x3a')]:_0x418dc3[_0x02ca('0x37')];_0x259c1c[_0x02ca('0x5a')]=qs['sort'](_0x3dc000['query']['sort']);_0x259c1c[_0x02ca('0x40')]=qs[_0x02ca('0x39')](_[_0x02ca('0x41')](_0x3dc000['query'],_0x418dc3['filters']));if(_0x3dc000[_0x02ca('0x38')]['filter']){_0x259c1c['where']=_[_0x02ca('0x43')](_0x259c1c[_0x02ca('0x40')],{'$or':_['map'](_0x259c1c[_0x02ca('0x3a')],function(_0xf82074){var _0x635622={};_0x635622[_0xf82074]={'$like':'%'+_0x3dc000[_0x02ca('0x38')]['filter']+'%'};return _0x635622;})});}_0x259c1c=_['merge']({},_0x259c1c,_0x3dc000[_0x02ca('0x44')]);return _0x25c5a8[_0x02ca('0x5b')](_0x259c1c);}})['then'](function(_0x114305){if(_0x114305){_0x5864ae=_0x114305['length'];if(!_0x3dc000[_0x02ca('0x38')][_0x02ca('0x5c')](_0x02ca('0x3e'))){_0x259c1c[_0x02ca('0x20')]=qs[_0x02ca('0x20')](_0x3dc000[_0x02ca('0x38')][_0x02ca('0x20')]);_0x259c1c[_0x02ca('0x1e')]=qs['offset'](_0x3dc000['query'][_0x02ca('0x1e')]);}return _0x25c5a8[_0x02ca('0x5b')](_0x259c1c);}})['then'](function(_0x29af27){if(_0x29af27){return _0x29af27?{'count':_0x5864ae,'rows':_0x29af27}:null;}})['then'](respondWithResult(_0x2cfbfd,null))['catch'](handleError(_0x2cfbfd,null));};exports[_0x02ca('0x5d')]=function(_0x555093,_0x5bb3a4,_0x42e824){var _0x2f296b={};var _0x2d2cfa={};var _0x37cb60;var _0x53505d;return db[_0x02ca('0x33')][_0x02ca('0x59')]({'where':{'id':_0x555093['params']['id']}})['then'](handleEntityNotFound(_0x5bb3a4,null))[_0x02ca('0x28')](function(_0x573b29){if(_0x573b29){_0x37cb60=_0x573b29;_0x2d2cfa[_0x02ca('0x37')]=_[_0x02ca('0x4a')](db[_0x02ca('0x56')][_0x02ca('0x34')]);_0x2d2cfa['query']=_['keys'](_0x555093[_0x02ca('0x38')]);_0x2d2cfa['filters']=_[_0x02ca('0x3b')](_0x2d2cfa[_0x02ca('0x37')],_0x2d2cfa[_0x02ca('0x38')]);_0x2f296b[_0x02ca('0x3a')]=_['intersection'](_0x2d2cfa[_0x02ca('0x37')],qs[_0x02ca('0x3c')](_0x555093[_0x02ca('0x38')][_0x02ca('0x3c')]));_0x2f296b[_0x02ca('0x3a')]=_0x2f296b[_0x02ca('0x3a')]['length']?_0x2f296b[_0x02ca('0x3a')]:_0x2d2cfa['model'];_0x2f296b[_0x02ca('0x5a')]=qs[_0x02ca('0x3f')](_0x555093[_0x02ca('0x38')][_0x02ca('0x3f')]);_0x2f296b[_0x02ca('0x40')]=qs[_0x02ca('0x39')](_[_0x02ca('0x41')](_0x555093['query'],_0x2d2cfa[_0x02ca('0x39')]));if(_0x555093[_0x02ca('0x38')][_0x02ca('0x42')]){_0x2f296b[_0x02ca('0x40')]=_[_0x02ca('0x43')](_0x2f296b[_0x02ca('0x40')],{'$or':_[_0x02ca('0x32')](_0x2f296b[_0x02ca('0x3a')],function(_0x25cd9f){var _0x3fee05={};_0x3fee05[_0x25cd9f]={'$like':'%'+_0x555093[_0x02ca('0x38')][_0x02ca('0x42')]+'%'};return _0x3fee05;})});}_0x2f296b=_['merge']({},_0x2f296b,_0x555093['options']);return _0x37cb60[_0x02ca('0x5d')](_0x2f296b);}})[_0x02ca('0x28')](function(_0x85417a){if(_0x85417a){_0x53505d=_0x85417a[_0x02ca('0x3d')];if(!_0x555093['query'][_0x02ca('0x5c')](_0x02ca('0x3e'))){_0x2f296b[_0x02ca('0x20')]=qs['limit'](_0x555093[_0x02ca('0x38')][_0x02ca('0x20')]);_0x2f296b[_0x02ca('0x1e')]=qs[_0x02ca('0x1e')](_0x555093['query']['offset']);}return _0x37cb60[_0x02ca('0x5d')](_0x2f296b);}})[_0x02ca('0x28')](function(_0x5de69b){if(_0x5de69b){return _0x5de69b?{'count':_0x53505d,'rows':_0x5de69b}:null;}})['then'](respondWithResult(_0x5bb3a4,null))['catch'](handleError(_0x5bb3a4,null));};exports['addAction']=function(_0x24c43b,_0x1eec4e,_0x26135b){if(_0x24c43b[_0x02ca('0x4c')]['id']){delete _0x24c43b[_0x02ca('0x4c')]['id'];}return db['Trigger']['find']({'where':{'id':_0x24c43b[_0x02ca('0x49')]['id']}})[_0x02ca('0x28')](handleEntityNotFound(_0x1eec4e,null))[_0x02ca('0x28')](function(_0x288ce7){if(_0x288ce7){_0x24c43b[_0x02ca('0x4c')][_0x02ca('0x5e')]=_0x288ce7['id'];return db[_0x02ca('0x5f')][_0x02ca('0x4b')](_0x24c43b[_0x02ca('0x4c')]);}})['then'](respondWithResult(_0x1eec4e,null))['catch'](handleError(_0x1eec4e,null));};exports[_0x02ca('0x60')]=function(_0x590295,_0x14b077,_0x2bf92b){var _0x30fbc2={};var _0x3f1497={};var _0x5ce885;var _0x500d3c;return db[_0x02ca('0x33')][_0x02ca('0x59')]({'where':{'id':_0x590295[_0x02ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x14b077,null))[_0x02ca('0x28')](function(_0x2e8d0f){if(_0x2e8d0f){_0x5ce885=_0x2e8d0f;_0x3f1497[_0x02ca('0x37')]=_['keys'](db[_0x02ca('0x5f')][_0x02ca('0x34')]);_0x3f1497[_0x02ca('0x38')]=_[_0x02ca('0x4a')](_0x590295[_0x02ca('0x38')]);_0x3f1497[_0x02ca('0x39')]=_['intersection'](_0x3f1497[_0x02ca('0x37')],_0x3f1497[_0x02ca('0x38')]);_0x30fbc2[_0x02ca('0x3a')]=_['intersection'](_0x3f1497['model'],qs[_0x02ca('0x3c')](_0x590295['query'][_0x02ca('0x3c')]));_0x30fbc2[_0x02ca('0x3a')]=_0x30fbc2['attributes']['length']?_0x30fbc2[_0x02ca('0x3a')]:_0x3f1497[_0x02ca('0x37')];_0x30fbc2[_0x02ca('0x5a')]=qs['sort'](_0x590295[_0x02ca('0x38')][_0x02ca('0x3f')]);_0x30fbc2[_0x02ca('0x40')]=qs['filters'](_[_0x02ca('0x41')](_0x590295[_0x02ca('0x38')],_0x3f1497['filters']));if(_0x590295[_0x02ca('0x38')][_0x02ca('0x42')]){_0x30fbc2[_0x02ca('0x40')]=_[_0x02ca('0x43')](_0x30fbc2[_0x02ca('0x40')],{'$or':_[_0x02ca('0x32')](_0x30fbc2['attributes'],function(_0x3e6752){var _0x52670d={};_0x52670d[_0x3e6752]={'$like':'%'+_0x590295['query'][_0x02ca('0x42')]+'%'};return _0x52670d;})});}_0x30fbc2=_['merge']({},_0x30fbc2,_0x590295[_0x02ca('0x44')]);return _0x5ce885['getActions'](_0x30fbc2);}})[_0x02ca('0x28')](function(_0xebaf94){if(_0xebaf94){_0x500d3c=_0xebaf94[_0x02ca('0x3d')];if(!_0x590295[_0x02ca('0x38')]['hasOwnProperty'](_0x02ca('0x3e'))){_0x30fbc2[_0x02ca('0x20')]=qs[_0x02ca('0x20')](_0x590295['query']['limit']);_0x30fbc2[_0x02ca('0x1e')]=qs[_0x02ca('0x1e')](_0x590295[_0x02ca('0x38')][_0x02ca('0x1e')]);}return _0x5ce885[_0x02ca('0x60')](_0x30fbc2);}})[_0x02ca('0x28')](function(_0x1a4f47){if(_0x1a4f47){return _0x1a4f47?{'count':_0x500d3c,'rows':_0x1a4f47}:null;}})['then'](respondWithResult(_0x14b077,null))['catch'](handleError(_0x14b077,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 4414df5..dbbdad6 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 _0xb26e=['moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash'];(function(_0x217bfc,_0x3361f1){var _0x5f4a09=function(_0x28d6e9){while(--_0x28d6e9){_0x217bfc['push'](_0x217bfc['shift']());}};_0x5f4a09(++_0x3361f1);}(_0xb26e,0x11d));var _0xeb26=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xb26e[_0x47408e];return _0x1636bc;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeb26('0x1'));var BPromise=require(_0xeb26('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb26('0x3'));var rimraf=require(_0xeb26('0x4'));var config=require(_0xeb26('0x5'));var attributes=require(_0xeb26('0x6'));module[_0xeb26('0x7')]=function(_0x17f489,_0x2351f9){return _0x17f489[_0xeb26('0x8')](_0xeb26('0x9'),attributes,{'tableName':_0xeb26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe35c=['Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./trigger.attributes','exports','define'];(function(_0x4f95f8,_0xb73784){var _0x123b8e=function(_0x89ad8f){while(--_0x89ad8f){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x123b8e(++_0xb73784);}(_0xe35c,0x146));var _0xce35=function(_0x50dc4e,_0xc4040b){_0x50dc4e=_0x50dc4e-0x0;var _0x429e20=_0xe35c[_0x50dc4e];return _0x429e20;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var logger=require(_0xce35('0x2'))(_0xce35('0x3'));var moment=require(_0xce35('0x4'));var BPromise=require(_0xce35('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce35('0x6'));var config=require('../../config/environment');var attributes=require(_0xce35('0x7'));module[_0xce35('0x8')]=function(_0x3a4bb,_0x47e53c){return _0x3a4bb[_0xce35('0x9')](_0xce35('0xa'),attributes,{'tableName':_0xce35('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index b063a51..5c722cd 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 _0x217a=['model','attributes','include','catch','ShowTrigger','find','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where','map'];(function(_0x3fb520,_0x9d07d5){var _0x42d9f7=function(_0x3faf8f){while(--_0x3faf8f){_0x3fb520['push'](_0x3fb520['shift']());}};_0x42d9f7(++_0x9d07d5);}(_0x217a,0x15d));var _0xa217=function(_0x5adf06,_0x559e16){_0x5adf06=_0x5adf06-0x0;var _0x45f6f7=_0x217a[_0x5adf06];return _0x45f6f7;};'use strict';var _=require('lodash');var util=require(_0xa217('0x0'));var moment=require(_0xa217('0x1'));var BPromise=require(_0xa217('0x2'));var rs=require(_0xa217('0x3'));var fs=require('fs');var Redis=require(_0xa217('0x4'));var db=require(_0xa217('0x5'))['db'];var utils=require(_0xa217('0x6'));var logger=require(_0xa217('0x7'))(_0xa217('0x8'));var config=require(_0xa217('0x9'));var jayson=require(_0xa217('0xa'));var client=jayson[_0xa217('0xb')][_0xa217('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53ffd7,_0x32b40b,_0x3b2516){return new BPromise(function(_0x1d9ea4,_0x4a5eeb){return client[_0xa217('0xd')](_0x53ffd7,_0x3b2516)[_0xa217('0xe')](function(_0xdb1370){logger[_0xa217('0xf')]('Trigger,\x20%s,\x20%s',_0x32b40b,'request\x20sent');logger['debug'](_0xa217('0x10'),_0x32b40b,_0xa217('0x11'),JSON[_0xa217('0x12')](_0xdb1370));if(_0xdb1370[_0xa217('0x13')]){if(_0xdb1370[_0xa217('0x13')][_0xa217('0x14')]===0x1f4){logger[_0xa217('0x13')](_0xa217('0x15'),_0x32b40b,_0xdb1370[_0xa217('0x13')][_0xa217('0x16')]);return _0x4a5eeb(_0xdb1370['error'][_0xa217('0x16')]);}logger[_0xa217('0x13')](_0xa217('0x15'),_0x32b40b,_0xdb1370[_0xa217('0x13')][_0xa217('0x16')]);return _0x1d9ea4(_0xdb1370[_0xa217('0x13')][_0xa217('0x16')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x32b40b,_0xa217('0x11'));_0x1d9ea4(_0xdb1370[_0xa217('0x17')][_0xa217('0x16')]);}})['catch'](function(_0x28760e){logger[_0xa217('0x13')](_0xa217('0x15'),_0x32b40b,_0x28760e);_0x4a5eeb(_0x28760e);});});}exports[_0xa217('0x18')]=function(_0x19888e){var _0x303744=this;return new Promise(function(_0x2dcd3e,_0x2e414f){return db[_0xa217('0x19')][_0xa217('0x1a')]({'raw':_0x19888e[_0xa217('0x1b')]?_0x19888e[_0xa217('0x1b')][_0xa217('0x1c')]===undefined?!![]:![]:!![],'where':_0x19888e[_0xa217('0x1b')]?_0x19888e[_0xa217('0x1b')][_0xa217('0x1d')]||null:null,'attributes':_0x19888e['options']?_0x19888e[_0xa217('0x1b')]['attributes']||null:null,'limit':_0x19888e[_0xa217('0x1b')]?_0x19888e[_0xa217('0x1b')]['limit']||null:null,'include':_0x19888e[_0xa217('0x1b')]?_0x19888e[_0xa217('0x1b')]['include']?_[_0xa217('0x1e')](_0x19888e[_0xa217('0x1b')]['include'],function(_0x38b246){return{'model':db[_0x38b246[_0xa217('0x1f')]],'as':_0x38b246['as'],'attributes':_0x38b246[_0xa217('0x20')],'include':_0x38b246[_0xa217('0x21')]?_['map'](_0x38b246['include'],function(_0x46c7ba){return{'model':db[_0x46c7ba['model']],'as':_0x46c7ba['as'],'attributes':_0x46c7ba[_0xa217('0x20')],'include':_0x46c7ba[_0xa217('0x21')]?_[_0xa217('0x1e')](_0x46c7ba[_0xa217('0x21')],function(_0x31e8e7){return{'model':db[_0x31e8e7['model']],'as':_0x31e8e7['as'],'attributes':_0x31e8e7[_0xa217('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa217('0xe')](function(_0xd8bb3c){logger[_0xa217('0xf')](_0xa217('0x18'),_0x19888e);logger['debug'](_0xa217('0x18'),_0x19888e,JSON[_0xa217('0x12')](_0xd8bb3c));_0x2dcd3e(_0xd8bb3c);})[_0xa217('0x22')](function(_0x47a76b){logger[_0xa217('0x13')](_0xa217('0x18'),_0x47a76b[_0xa217('0x16')],_0x19888e);_0x2e414f(_0x303744['error'](0x1f4,_0x47a76b[_0xa217('0x16')]));});});};exports[_0xa217('0x23')]=function(_0xbf53df){var _0xd6fb0f=this;return new Promise(function(_0x972898,_0x1652de){return db[_0xa217('0x19')][_0xa217('0x24')]({'raw':_0xbf53df[_0xa217('0x1b')]?_0xbf53df[_0xa217('0x1b')][_0xa217('0x1c')]===undefined?!![]:![]:!![],'where':_0xbf53df['options']?_0xbf53df[_0xa217('0x1b')][_0xa217('0x1d')]||null:null,'attributes':_0xbf53df[_0xa217('0x1b')]?_0xbf53df[_0xa217('0x1b')][_0xa217('0x20')]||null:null,'include':_0xbf53df[_0xa217('0x1b')]?_0xbf53df['options'][_0xa217('0x21')]?_[_0xa217('0x1e')](_0xbf53df[_0xa217('0x1b')][_0xa217('0x21')],function(_0x4ea594){return{'model':db[_0x4ea594[_0xa217('0x1f')]],'as':_0x4ea594['as'],'attributes':_0x4ea594[_0xa217('0x20')],'include':_0x4ea594[_0xa217('0x21')]?_[_0xa217('0x1e')](_0x4ea594['include'],function(_0x5ebe22){return{'model':db[_0x5ebe22[_0xa217('0x1f')]],'as':_0x5ebe22['as'],'attributes':_0x5ebe22['attributes'],'include':_0x5ebe22['include']?_[_0xa217('0x1e')](_0x5ebe22[_0xa217('0x21')],function(_0x392b59){return{'model':db[_0x392b59[_0xa217('0x1f')]],'as':_0x392b59['as'],'attributes':_0x392b59['attributes']};}):[]};}):[]};}):[]:[]})[_0xa217('0xe')](function(_0x58505c){logger['info'](_0xa217('0x23'),_0xbf53df);logger[_0xa217('0x25')](_0xa217('0x23'),_0xbf53df,JSON[_0xa217('0x12')](_0x58505c));_0x972898(_0x58505c);})[_0xa217('0x22')](function(_0xab4977){logger[_0xa217('0x13')](_0xa217('0x23'),_0xab4977[_0xa217('0x16')],_0xbf53df);_0x1652de(_0xd6fb0f['error'](0x1f4,_0xab4977[_0xa217('0x16')]));});});}; \ No newline at end of file +var _0x13e6=['client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetTrigger','debug','Trigger','find','ShowTrigger','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3bb873,_0x75582c){var _0x63652e=function(_0x6a446f){while(--_0x6a446f){_0x3bb873['push'](_0x3bb873['shift']());}};_0x63652e(++_0x75582c);}(_0x13e6,0x1b3));var _0x613e=function(_0x1e2b1c,_0x137fd2){_0x1e2b1c=_0x1e2b1c-0x0;var _0x230664=_0x13e6[_0x1e2b1c];return _0x230664;};'use strict';var _=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613e('0x2'));var fs=require('fs');var Redis=require(_0x613e('0x3'));var db=require(_0x613e('0x4'))['db'];var utils=require(_0x613e('0x5'));var logger=require(_0x613e('0x6'))(_0x613e('0x7'));var config=require('../../config/environment');var jayson=require(_0x613e('0x8'));var client=jayson[_0x613e('0x9')][_0x613e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2adb6c,_0x5ac884,_0x16cc2e){return new BPromise(function(_0x3d22b3,_0x9931ae){return client[_0x613e('0xb')](_0x2adb6c,_0x16cc2e)[_0x613e('0xc')](function(_0x542621){logger['info'](_0x613e('0xd'),_0x5ac884,_0x613e('0xe'));logger['debug'](_0x613e('0xf'),_0x5ac884,_0x613e('0xe'),JSON[_0x613e('0x10')](_0x542621));if(_0x542621[_0x613e('0x11')]){if(_0x542621[_0x613e('0x11')][_0x613e('0x12')]===0x1f4){logger[_0x613e('0x11')]('Trigger,\x20%s,\x20%s',_0x5ac884,_0x542621[_0x613e('0x11')][_0x613e('0x13')]);return _0x9931ae(_0x542621[_0x613e('0x11')][_0x613e('0x13')]);}logger[_0x613e('0x11')](_0x613e('0xd'),_0x5ac884,_0x542621[_0x613e('0x11')][_0x613e('0x13')]);return _0x3d22b3(_0x542621[_0x613e('0x11')][_0x613e('0x13')]);}else{logger[_0x613e('0x14')](_0x613e('0xd'),_0x5ac884,_0x613e('0xe'));_0x3d22b3(_0x542621[_0x613e('0x15')][_0x613e('0x13')]);}})[_0x613e('0x16')](function(_0x401b74){logger[_0x613e('0x11')](_0x613e('0xd'),_0x5ac884,_0x401b74);_0x9931ae(_0x401b74);});});}exports['GetTrigger']=function(_0x2b8c6b){var _0x5502c0=this;return new Promise(function(_0x45eaf2,_0x45f79e){return db['Trigger'][_0x613e('0x17')]({'raw':_0x2b8c6b[_0x613e('0x18')]?_0x2b8c6b['options'][_0x613e('0x19')]===undefined?!![]:![]:!![],'where':_0x2b8c6b[_0x613e('0x18')]?_0x2b8c6b['options'][_0x613e('0x1a')]||null:null,'attributes':_0x2b8c6b[_0x613e('0x18')]?_0x2b8c6b['options'][_0x613e('0x1b')]||null:null,'limit':_0x2b8c6b[_0x613e('0x18')]?_0x2b8c6b[_0x613e('0x18')][_0x613e('0x1c')]||null:null,'include':_0x2b8c6b[_0x613e('0x18')]?_0x2b8c6b[_0x613e('0x18')][_0x613e('0x1d')]?_['map'](_0x2b8c6b[_0x613e('0x18')][_0x613e('0x1d')],function(_0x2c74fb){return{'model':db[_0x2c74fb[_0x613e('0x1e')]],'as':_0x2c74fb['as'],'attributes':_0x2c74fb[_0x613e('0x1b')],'include':_0x2c74fb[_0x613e('0x1d')]?_[_0x613e('0x1f')](_0x2c74fb[_0x613e('0x1d')],function(_0x2c0ceb){return{'model':db[_0x2c0ceb[_0x613e('0x1e')]],'as':_0x2c0ceb['as'],'attributes':_0x2c0ceb[_0x613e('0x1b')],'include':_0x2c0ceb['include']?_['map'](_0x2c0ceb['include'],function(_0x6fd80d){return{'model':db[_0x6fd80d[_0x613e('0x1e')]],'as':_0x6fd80d['as'],'attributes':_0x6fd80d[_0x613e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x613e('0xc')](function(_0x3936ab){logger[_0x613e('0x14')](_0x613e('0x20'),_0x2b8c6b);logger[_0x613e('0x21')](_0x613e('0x20'),_0x2b8c6b,JSON[_0x613e('0x10')](_0x3936ab));_0x45eaf2(_0x3936ab);})[_0x613e('0x16')](function(_0x2f48fa){logger[_0x613e('0x11')](_0x613e('0x20'),_0x2f48fa[_0x613e('0x13')],_0x2b8c6b);_0x45f79e(_0x5502c0[_0x613e('0x11')](0x1f4,_0x2f48fa[_0x613e('0x13')]));});});};exports['ShowTrigger']=function(_0x3f3a78){var _0xc1632d=this;return new Promise(function(_0x63bb4d,_0x23d685){return db[_0x613e('0x22')][_0x613e('0x23')]({'raw':_0x3f3a78[_0x613e('0x18')]?_0x3f3a78['options'][_0x613e('0x19')]===undefined?!![]:![]:!![],'where':_0x3f3a78['options']?_0x3f3a78[_0x613e('0x18')]['where']||null:null,'attributes':_0x3f3a78[_0x613e('0x18')]?_0x3f3a78[_0x613e('0x18')][_0x613e('0x1b')]||null:null,'include':_0x3f3a78['options']?_0x3f3a78['options'][_0x613e('0x1d')]?_[_0x613e('0x1f')](_0x3f3a78['options'][_0x613e('0x1d')],function(_0x5c9a92){return{'model':db[_0x5c9a92[_0x613e('0x1e')]],'as':_0x5c9a92['as'],'attributes':_0x5c9a92[_0x613e('0x1b')],'include':_0x5c9a92[_0x613e('0x1d')]?_['map'](_0x5c9a92[_0x613e('0x1d')],function(_0x37baef){return{'model':db[_0x37baef[_0x613e('0x1e')]],'as':_0x37baef['as'],'attributes':_0x37baef[_0x613e('0x1b')],'include':_0x37baef[_0x613e('0x1d')]?_['map'](_0x37baef[_0x613e('0x1d')],function(_0x212d47){return{'model':db[_0x212d47[_0x613e('0x1e')]],'as':_0x212d47['as'],'attributes':_0x212d47[_0x613e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40c321){logger[_0x613e('0x14')](_0x613e('0x24'),_0x3f3a78);logger['debug']('ShowTrigger',_0x3f3a78,JSON['stringify'](_0x40c321));_0x63bb4d(_0x40c321);})[_0x613e('0x16')](function(_0x217113){logger['error'](_0x613e('0x24'),_0x217113[_0x613e('0x13')],_0x3f3a78);_0x23d685(_0xc1632d[_0x613e('0x11')](0x1f4,_0x217113[_0x613e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f7b2166..fb6a2ff 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 _0x18fa=['create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone'];(function(_0x2932df,_0x26b713){var _0x2faf60=function(_0x2c3b68){while(--_0x2c3b68){_0x2932df['push'](_0x2932df['shift']());}};_0x2faf60(++_0x26b713);}(_0x18fa,0xc1));var _0xa18f=function(_0x4d4baa,_0x515e4d){_0x4d4baa=_0x4d4baa-0x0;var _0x5ccf09=_0x18fa[_0x4d4baa];return _0x5ccf09;};'use strict';var multer=require(_0xa18f('0x0'));var util=require(_0xa18f('0x1'));var path=require(_0xa18f('0x2'));var timeout=require(_0xa18f('0x3'));var express=require('express');var router=express[_0xa18f('0x4')]();var fs_extra=require(_0xa18f('0x5'));var auth=require(_0xa18f('0x6'));var interaction=require(_0xa18f('0x7'));var config=require(_0xa18f('0x8'));var controller=require(_0xa18f('0x9'));router[_0xa18f('0xa')]('/',auth[_0xa18f('0xb')](),controller['index']);router[_0xa18f('0xa')](_0xa18f('0xc'),auth[_0xa18f('0xb')](),controller[_0xa18f('0xd')]);router[_0xa18f('0xe')](_0xa18f('0xf'),auth['isAuthenticated'](),controller[_0xa18f('0x10')]);router[_0xa18f('0xe')]('/',auth['isAuthenticated'](),controller[_0xa18f('0x11')]);router[_0xa18f('0x12')](_0xa18f('0xc'),auth[_0xa18f('0xb')](),controller[_0xa18f('0x13')]);router[_0xa18f('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb71b=['get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0xb71b,0x1b9));var _0xbb71=function(_0x25f862,_0x1c1e4e){_0x25f862=_0x25f862-0x0;var _0x1c7b67=_0xb71b[_0x25f862];return _0x1c7b67;};'use strict';var multer=require(_0xbb71('0x0'));var util=require(_0xbb71('0x1'));var path=require(_0xbb71('0x2'));var timeout=require(_0xbb71('0x3'));var express=require('express');var router=express[_0xbb71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb71('0x5'));var interaction=require(_0xbb71('0x6'));var config=require(_0xbb71('0x7'));var controller=require(_0xbb71('0x8'));router[_0xbb71('0x9')]('/',auth[_0xbb71('0xa')](),controller[_0xbb71('0xb')]);router[_0xbb71('0x9')](_0xbb71('0xc'),auth[_0xbb71('0xa')](),controller[_0xbb71('0xd')]);router[_0xbb71('0xe')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0xbb71('0xa')](),controller['create']);router['put'](_0xbb71('0xc'),auth[_0xbb71('0xa')](),controller[_0xbb71('0xf')]);router['delete']('/:id',auth[_0xbb71('0xa')](),controller[_0xbb71('0x10')]);module[_0xbb71('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 5a624bf..42ec64f 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 _0xf44a=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','rfc2833','update','outgoing','yes','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure'];(function(_0x41c661,_0x37ae24){var _0xad7228=function(_0x2e3800){while(--_0x2e3800){_0x41c661['push'](_0x41c661['shift']());}};_0xad7228(++_0x37ae24);}(_0xf44a,0x7e));var _0xaf44=function(_0x91fe43,_0x1b51e4){_0x91fe43=_0x91fe43-0x0;var _0x5d3b51=_0xf44a[_0x91fe43];return _0x5d3b51;};'use strict';var Sequelize=require(_0xaf44('0x0'));module[_0xaf44('0x1')]={'name':{'type':Sequelize[_0xaf44('0x2')],'allowNull':![],'unique':_0xaf44('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xaf44('0x4')]('friend',_0xaf44('0x5'),_0xaf44('0x6')),'allowNull':![],'defaultValue':_0xaf44('0x7')},'context':{'type':Sequelize[_0xaf44('0x2')],'allowNull':![],'defaultValue':_0xaf44('0x8')},'callingpres':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x9'),_0xaf44('0xa'),_0xaf44('0xb'),_0xaf44('0xc'),_0xaf44('0xd'),_0xaf44('0xe'),_0xaf44('0xf'),_0xaf44('0x10'))},'deny':{'type':Sequelize[_0xaf44('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xaf44('0x2')]},'transport':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'udp','set':function(_0x317bcf){this[_0xaf44('0x11')](_0xaf44('0x12'),_0x317bcf?_0x317bcf['join'](','):null);},'get':function(){return this[_0xaf44('0x13')]('transport')?this[_0xaf44('0x13')]('transport')[_0xaf44('0x14')](','):null;},'comment':_0xaf44('0x15')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0xaf44('0x16'),_0xaf44('0x17'),_0xaf44('0x18')),'defaultValue':_0xaf44('0x19')},'directmedia':{'type':Sequelize[_0xaf44('0x4')]('yes','no','nonat',_0xaf44('0x1a'),_0xaf44('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xaf44('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x3a0568){this['setDataValue']('nat',_0x3a0568?_0x3a0568[_0xaf44('0x1d')](','):null);},'get':function(){return this[_0xaf44('0x13')](_0xaf44('0x1e'))?this[_0xaf44('0x13')](_0xaf44('0x1e'))[_0xaf44('0x14')](','):null;},'comment':_0xaf44('0x1f')},'callgroup':{'type':Sequelize[_0xaf44('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xaf44('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xaf44('0x2')],'allowNull':![],'defaultValue':_0xaf44('0x20'),'set':function(_0xf74604){this[_0xaf44('0x11')](_0xaf44('0x21'),_0xf74604?_0xf74604[_0xaf44('0x1d')](';'):_0xaf44('0x20'));},'get':function(){return this['getDataValue'](_0xaf44('0x21'))?this[_0xaf44('0x13')]('allow')['split'](';'):null;},'comment':_0xaf44('0x22')},'autoframing':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'insecure':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'port,invite','set':function(_0x5d5783){this[_0xaf44('0x11')](_0xaf44('0x23'),_0x5d5783?_0x5d5783[_0xaf44('0x1d')](','):null);},'get':function(){return this[_0xaf44('0x13')]('insecure')?this[_0xaf44('0x13')]('insecure')[_0xaf44('0x14')](','):null;},'comment':_0xaf44('0x24')},'trustrpid':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xaf44('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xaf44('0x25'))},'promiscredir':{'type':Sequelize[_0xaf44('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'accountcode':{'type':Sequelize[_0xaf44('0x26')](0xb)},'setvar':{'type':Sequelize[_0xaf44('0x2')]},'callerid':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':_0xaf44('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xaf44('0x1c')},'busylevel':{'type':Sequelize[_0xaf44('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'allowsubscribe':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'allowtransfer':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'ignoresdpversion':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'subscribecontext':{'type':Sequelize[_0xaf44('0x2')]},'template':{'type':Sequelize[_0xaf44('0x2')]},'videosupport':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xaf44('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'mailbox':{'type':Sequelize[_0xaf44('0x2')]},'session_timers':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x28'),_0xaf44('0x29'),_0xaf44('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x2b'),_0xaf44('0x2c')),'defaultValue':_0xaf44('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0xaf44('0x2')]},'regexten':{'type':Sequelize[_0xaf44('0x2')]},'fromdomain':{'type':Sequelize[_0xaf44('0x2')]},'fromuser':{'type':Sequelize[_0xaf44('0x2')]},'port':{'type':Sequelize[_0xaf44('0x26')](0x5)},'qualify':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no'),'defaultValue':_0xaf44('0x1c')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xaf44('0x2')]},'defaultuser':{'type':Sequelize[_0xaf44('0x2')]},'rtptimeout':{'type':Sequelize[_0xaf44('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no',_0xaf44('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xaf44('0x2')]},'callbackextension':{'type':Sequelize[_0xaf44('0x2')]},'timert1':{'type':Sequelize[_0xaf44('0x26')](0xb)},'timerb':{'type':Sequelize[_0xaf44('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0xaf44('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0xaf44('0x2')]},'contactdeny':{'type':Sequelize[_0xaf44('0x2')]},'contactacl':{'type':Sequelize[_0xaf44('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xaf44('0x26')](0xb)},'encryption':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xaf44('0x4')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xaf44('0x1c'),'no')},'icesupport':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'dtlsenable':{'type':Sequelize[_0xaf44('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xaf44('0x2e'),_0xaf44('0x2f'))},'dtlsrekey':{'type':Sequelize[_0xaf44('0x26')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xaf44('0x2')]},'dtlscipher':{'type':Sequelize[_0xaf44('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xaf44('0x2')]},'dtlssetup':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x30'),'passive',_0xaf44('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xaf44('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xaf44('0x2')]},'recordofffeature':{'type':Sequelize[_0xaf44('0x2')]},'call_limit':{'type':Sequelize[_0xaf44('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xaf44('0x4')](_0xaf44('0x1c'),'no')},'subscribemwi':{'type':Sequelize[_0xaf44('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0xaf44('0x2')]},'mohinterpret':{'type':Sequelize[_0xaf44('0x2')]},'mohsuggest':{'type':Sequelize[_0xaf44('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaf44('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xaf44('0x32')},'canreinvite':{'type':Sequelize[_0xaf44('0x4')]('yes','no',_0xaf44('0x33'),'update',_0xaf44('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xaf44('0x2')]},'otherFields':{'type':Sequelize[_0xaf44('0x2')]},'active':{'type':Sequelize[_0xaf44('0x35')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xaf44('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb823=['split','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','user','peer','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing'];(function(_0x161155,_0x440881){var _0x371535=function(_0xca6d9f){while(--_0xca6d9f){_0x161155['push'](_0x161155['shift']());}};_0x371535(++_0x440881);}(_0xb823,0x1a7));var _0x3b82=function(_0x2cba09,_0x23ee85){_0x2cba09=_0x2cba09-0x0;var _0x10d084=_0xb823[_0x2cba09];return _0x10d084;};'use strict';var Sequelize=require(_0x3b82('0x0'));module[_0x3b82('0x1')]={'name':{'type':Sequelize[_0x3b82('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x3b82('0x3'),_0x3b82('0x4')),'allowNull':![],'defaultValue':_0x3b82('0x5')},'context':{'type':Sequelize[_0x3b82('0x2')],'allowNull':![],'defaultValue':_0x3b82('0x6')},'callingpres':{'type':Sequelize[_0x3b82('0x7')]('ALLOWED_NOT_SCREENED',_0x3b82('0x8'),_0x3b82('0x9'),_0x3b82('0xa'),_0x3b82('0xb'),_0x3b82('0xc'),'PROHIB_FAILED_SCREEN',_0x3b82('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x3b82('0x2')]},'secret':{'type':Sequelize[_0x3b82('0x2')]},'md5secret':{'type':Sequelize[_0x3b82('0x2')]},'remotesecret':{'type':Sequelize[_0x3b82('0x2')]},'transport':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':_0x3b82('0xe'),'set':function(_0x342953){this[_0x3b82('0xf')]('transport',_0x342953?_0x342953[_0x3b82('0x10')](','):null);},'get':function(){return this[_0x3b82('0x11')](_0x3b82('0x12'))?this['getDataValue'](_0x3b82('0x12'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x3b82('0x13'),_0x3b82('0x14'),_0x3b82('0x15'),_0x3b82('0x16'),_0x3b82('0x17')),'defaultValue':_0x3b82('0x13')},'directmedia':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no','nonat',_0x3b82('0x19'),_0x3b82('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x3b82('0x2')]},'nat':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x16c87c){this[_0x3b82('0xf')]('nat',_0x16c87c?_0x16c87c[_0x3b82('0x10')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue']('nat')[_0x3b82('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3b82('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x3b82('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x3b82('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x315c79){this[_0x3b82('0xf')](_0x3b82('0x1c'),_0x315c79?_0x315c79[_0x3b82('0x10')](';'):_0x3b82('0x1d'));},'get':function(){return this[_0x3b82('0x11')]('allow')?this['getDataValue']('allow')[_0x3b82('0x1b')](';'):null;},'comment':_0x3b82('0x1e')},'autoframing':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'insecure':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':'port,invite','set':function(_0x13117a){this[_0x3b82('0xf')](_0x3b82('0x1f'),_0x13117a?_0x13117a[_0x3b82('0x10')](','):null);},'get':function(){return this[_0x3b82('0x11')](_0x3b82('0x1f'))?this[_0x3b82('0x11')]('insecure')[_0x3b82('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no',_0x3b82('0x20'))},'promiscredir':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x3b82('0x7')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':_0x3b82('0x21')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3b82('0x18')},'busylevel':{'type':Sequelize[_0x3b82('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x3b82('0x7')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x3b82('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no',_0x3b82('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3b82('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'mailbox':{'type':Sequelize[_0x3b82('0x2')]},'session_timers':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x24'),_0x3b82('0x25'),_0x3b82('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x3b82('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x27'),_0x3b82('0x28')),'defaultValue':_0x3b82('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x3b82('0x2')]},'fromdomain':{'type':Sequelize[_0x3b82('0x2')]},'fromuser':{'type':Sequelize[_0x3b82('0x2')]},'port':{'type':Sequelize[_0x3b82('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3b82('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x3b82('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3b82('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3b82('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no',_0x3b82('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3b82('0x2')]},'callbackextension':{'type':Sequelize[_0x3b82('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x3b82('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3b82('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x3b82('0x2')]},'contactdeny':{'type':Sequelize[_0x3b82('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x3b82('0x2')]},'use_q850_reason':{'type':Sequelize[_0x3b82('0x2')]},'maxforwards':{'type':Sequelize[_0x3b82('0x22')](0xb)},'encryption':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no')},'icesupport':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x3b82('0x18'),'no',_0x3b82('0x2a'),_0x3b82('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x3b82('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x2c'),_0x3b82('0x2d'),_0x3b82('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3b82('0x2')]},'usereqphone':{'type':Sequelize[_0x3b82('0x7')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3b82('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x3b82('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no')},'vmexten':{'type':Sequelize[_0x3b82('0x2')]},'mohinterpret':{'type':Sequelize[_0x3b82('0x2')]},'mohsuggest':{'type':Sequelize[_0x3b82('0x2')]},'parkinglot':{'type':Sequelize[_0x3b82('0x2')]},'description':{'type':Sequelize[_0x3b82('0x2')]},'host':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':_0x3b82('0x2f')},'canreinvite':{'type':Sequelize[_0x3b82('0x7')](_0x3b82('0x18'),'no','nonat','update',_0x3b82('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3b82('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3b82('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3b82('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index a53740d..f55cb59 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 _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x5c1b90,_0x43e602){var _0x1f7ab6=function(_0x31c36e){while(--_0x31c36e){_0x5c1b90['push'](_0x5c1b90['shift']());}};_0x1f7ab6(++_0x43e602);}(_0xa41a,0x6b));var _0xaa41=function(_0x3d8896,_0x46934c){_0x3d8896=_0x3d8896-0x0;var _0x31431f=_0xa41a[_0x3d8896];return _0x31431f;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x20832c,_0x36df6d){var _0x3803c3=function(_0xd721dd){while(--_0xd721dd){_0x20832c['push'](_0x20832c['shift']());}};_0x3803c3(++_0x36df6d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xaf5c36,_0x29167f){_0xaf5c36=_0xaf5c36-0x0;var _0x221327=_0xd6d6[_0xaf5c36];return _0x221327;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 73194f8..b6da1fc 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 _0x218c=['../../config/logger','moment','bluebird','path','./trunk.attributes','define','Trunk','tools_trunks','lodash'];(function(_0x15408c,_0x2a2258){var _0x5a801d=function(_0x29a395){while(--_0x29a395){_0x15408c['push'](_0x15408c['shift']());}};_0x5a801d(++_0x2a2258);}(_0x218c,0x10d));var _0xc218=function(_0x291e0e,_0x792683){_0x291e0e=_0x291e0e-0x0;var _0x3f85f3=_0x218c[_0x291e0e];return _0x3f85f3;};'use strict';var _=require(_0xc218('0x0'));var util=require('util');var logger=require(_0xc218('0x1'))('api');var moment=require(_0xc218('0x2'));var BPromise=require(_0xc218('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc218('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc218('0x5'));module['exports']=function(_0x20aaf5,_0xcb5546){return _0x20aaf5[_0xc218('0x6')](_0xc218('0x7'),attributes,{'tableName':_0xc218('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6ab=['rimraf','./trunk.attributes','define','Trunk','tools_trunks','util','../../config/logger','api','request-promise'];(function(_0x403435,_0xcb4543){var _0x212dc8=function(_0x46bc0c){while(--_0x46bc0c){_0x403435['push'](_0x403435['shift']());}};_0x212dc8(++_0xcb4543);}(_0xe6ab,0x1b5));var _0xbe6a=function(_0x3e8beb,_0x18694e){_0x3e8beb=_0x3e8beb-0x0;var _0x1b2ab9=_0xe6ab[_0x3e8beb];return _0x1b2ab9;};'use strict';var _=require('lodash');var util=require(_0xbe6a('0x0'));var logger=require(_0xbe6a('0x1'))(_0xbe6a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe6a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe6a('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe6a('0x5'));module['exports']=function(_0x1a796d,_0x2b2dca){return _0x1a796d[_0xbe6a('0x6')](_0xbe6a('0x7'),attributes,{'tableName':_0xbe6a('0x8'),'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 0e0d21a..89f8207 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 _0xd656=['Trunk','find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','options','raw','where','attributes','limit','include','map','model','ShowTrunk'];(function(_0x10e621,_0x5c1ac3){var _0x224ef8=function(_0x39da41){while(--_0x39da41){_0x10e621['push'](_0x10e621['shift']());}};_0x224ef8(++_0x5c1ac3);}(_0xd656,0xdb));var _0x6d65=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd656[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x6d65('0x0'));var util=require(_0x6d65('0x1'));var moment=require(_0x6d65('0x2'));var BPromise=require(_0x6d65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d65('0x4'));var db=require(_0x6d65('0x5'))['db'];var utils=require(_0x6d65('0x6'));var logger=require(_0x6d65('0x7'))(_0x6d65('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d65('0x9'));var client=jayson[_0x6d65('0xa')][_0x6d65('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32c98e,_0x8e3136,_0x40abab){return new BPromise(function(_0x16a7b7,_0x31dce0){return client['request'](_0x32c98e,_0x40abab)[_0x6d65('0xc')](function(_0x246cd3){logger[_0x6d65('0xd')](_0x6d65('0xe'),_0x8e3136,_0x6d65('0xf'));logger['debug'](_0x6d65('0x10'),_0x8e3136,_0x6d65('0xf'),JSON[_0x6d65('0x11')](_0x246cd3));if(_0x246cd3[_0x6d65('0x12')]){if(_0x246cd3[_0x6d65('0x12')][_0x6d65('0x13')]===0x1f4){logger[_0x6d65('0x12')]('Trunk,\x20%s,\x20%s',_0x8e3136,_0x246cd3[_0x6d65('0x12')][_0x6d65('0x14')]);return _0x31dce0(_0x246cd3[_0x6d65('0x12')]['message']);}logger[_0x6d65('0x12')]('Trunk,\x20%s,\x20%s',_0x8e3136,_0x246cd3['error'][_0x6d65('0x14')]);return _0x16a7b7(_0x246cd3['error']['message']);}else{logger['info'](_0x6d65('0xe'),_0x8e3136,'request\x20sent');_0x16a7b7(_0x246cd3[_0x6d65('0x15')][_0x6d65('0x14')]);}})[_0x6d65('0x16')](function(_0x1b5fe7){logger[_0x6d65('0x12')](_0x6d65('0xe'),_0x8e3136,_0x1b5fe7);_0x31dce0(_0x1b5fe7);});});}exports[_0x6d65('0x17')]=function(_0x11cbbb){var _0x50af37=this;return new Promise(function(_0x710501,_0xa7d8a0){return db['Trunk']['findAll']({'raw':_0x11cbbb[_0x6d65('0x18')]?_0x11cbbb['options'][_0x6d65('0x19')]===undefined?!![]:![]:!![],'where':_0x11cbbb[_0x6d65('0x18')]?_0x11cbbb['options'][_0x6d65('0x1a')]||null:null,'attributes':_0x11cbbb[_0x6d65('0x18')]?_0x11cbbb[_0x6d65('0x18')][_0x6d65('0x1b')]||null:null,'limit':_0x11cbbb[_0x6d65('0x18')]?_0x11cbbb['options'][_0x6d65('0x1c')]||null:null,'include':_0x11cbbb[_0x6d65('0x18')]?_0x11cbbb[_0x6d65('0x18')][_0x6d65('0x1d')]?_[_0x6d65('0x1e')](_0x11cbbb[_0x6d65('0x18')][_0x6d65('0x1d')],function(_0x36df1b){return{'model':db[_0x36df1b[_0x6d65('0x1f')]],'as':_0x36df1b['as'],'attributes':_0x36df1b[_0x6d65('0x1b')],'include':_0x36df1b[_0x6d65('0x1d')]?_[_0x6d65('0x1e')](_0x36df1b['include'],function(_0x3826e4){return{'model':db[_0x3826e4[_0x6d65('0x1f')]],'as':_0x3826e4['as'],'attributes':_0x3826e4[_0x6d65('0x1b')],'include':_0x3826e4['include']?_[_0x6d65('0x1e')](_0x3826e4['include'],function(_0x4c80d4){return{'model':db[_0x4c80d4[_0x6d65('0x1f')]],'as':_0x4c80d4['as'],'attributes':_0x4c80d4[_0x6d65('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32d2f1){logger[_0x6d65('0xd')]('GetTrunk',_0x11cbbb);logger['debug'](_0x6d65('0x17'),_0x11cbbb,JSON[_0x6d65('0x11')](_0x32d2f1));_0x710501(_0x32d2f1);})['catch'](function(_0xdc17b6){logger[_0x6d65('0x12')](_0x6d65('0x17'),_0xdc17b6[_0x6d65('0x14')],_0x11cbbb);_0xa7d8a0(_0x50af37[_0x6d65('0x12')](0x1f4,_0xdc17b6[_0x6d65('0x14')]));});});};exports[_0x6d65('0x20')]=function(_0x52e6b7){var _0x4c935e=this;return new Promise(function(_0x52e713,_0x52c400){return db[_0x6d65('0x21')][_0x6d65('0x22')]({'raw':_0x52e6b7[_0x6d65('0x18')]?_0x52e6b7['options'][_0x6d65('0x19')]===undefined?!![]:![]:!![],'where':_0x52e6b7[_0x6d65('0x18')]?_0x52e6b7[_0x6d65('0x18')]['where']||null:null,'attributes':_0x52e6b7[_0x6d65('0x18')]?_0x52e6b7['options'][_0x6d65('0x1b')]||null:null,'include':_0x52e6b7[_0x6d65('0x18')]?_0x52e6b7[_0x6d65('0x18')][_0x6d65('0x1d')]?_[_0x6d65('0x1e')](_0x52e6b7[_0x6d65('0x18')][_0x6d65('0x1d')],function(_0x4325c0){return{'model':db[_0x4325c0['model']],'as':_0x4325c0['as'],'attributes':_0x4325c0[_0x6d65('0x1b')],'include':_0x4325c0[_0x6d65('0x1d')]?_[_0x6d65('0x1e')](_0x4325c0[_0x6d65('0x1d')],function(_0x14ed47){return{'model':db[_0x14ed47['model']],'as':_0x14ed47['as'],'attributes':_0x14ed47[_0x6d65('0x1b')],'include':_0x14ed47[_0x6d65('0x1d')]?_[_0x6d65('0x1e')](_0x14ed47[_0x6d65('0x1d')],function(_0x49a6e1){return{'model':db[_0x49a6e1[_0x6d65('0x1f')]],'as':_0x49a6e1['as'],'attributes':_0x49a6e1[_0x6d65('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6d65('0xc')](function(_0x204b94){logger[_0x6d65('0xd')]('ShowTrunk',_0x52e6b7);logger[_0x6d65('0x23')]('ShowTrunk',_0x52e6b7,JSON['stringify'](_0x204b94));_0x52e713(_0x204b94);})[_0x6d65('0x16')](function(_0x3cebda){logger[_0x6d65('0x12')]('ShowTrunk',_0x3cebda[_0x6d65('0x14')],_0x52e6b7);_0x52c400(_0x4c935e[_0x6d65('0x12')](0x1f4,_0x3cebda['message']));});});}; \ No newline at end of file +var _0xf765=['raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrunk','Trunk','findAll','options'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xf765,0xe1));var _0x5f76=function(_0x199e3a,_0x127dda){_0x199e3a=_0x199e3a-0x0;var _0x423bf6=_0xf765[_0x199e3a];return _0x423bf6;};'use strict';var _=require(_0x5f76('0x0'));var util=require(_0x5f76('0x1'));var moment=require(_0x5f76('0x2'));var BPromise=require('bluebird');var rs=require(_0x5f76('0x3'));var fs=require('fs');var Redis=require(_0x5f76('0x4'));var db=require(_0x5f76('0x5'))['db'];var utils=require(_0x5f76('0x6'));var logger=require(_0x5f76('0x7'))(_0x5f76('0x8'));var config=require(_0x5f76('0x9'));var jayson=require(_0x5f76('0xa'));var client=jayson[_0x5f76('0xb')][_0x5f76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ce334,_0x5dd1b6,_0x246459){return new BPromise(function(_0x5b4b00,_0x431c44){return client[_0x5f76('0xd')](_0x4ce334,_0x246459)['then'](function(_0x17c6d1){logger[_0x5f76('0xe')](_0x5f76('0xf'),_0x5dd1b6,_0x5f76('0x10'));logger[_0x5f76('0x11')](_0x5f76('0x12'),_0x5dd1b6,'request\x20sent',JSON['stringify'](_0x17c6d1));if(_0x17c6d1[_0x5f76('0x13')]){if(_0x17c6d1[_0x5f76('0x13')][_0x5f76('0x14')]===0x1f4){logger[_0x5f76('0x13')](_0x5f76('0xf'),_0x5dd1b6,_0x17c6d1[_0x5f76('0x13')][_0x5f76('0x15')]);return _0x431c44(_0x17c6d1['error'][_0x5f76('0x15')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5dd1b6,_0x17c6d1[_0x5f76('0x13')][_0x5f76('0x15')]);return _0x5b4b00(_0x17c6d1[_0x5f76('0x13')][_0x5f76('0x15')]);}else{logger[_0x5f76('0xe')](_0x5f76('0xf'),_0x5dd1b6,_0x5f76('0x10'));_0x5b4b00(_0x17c6d1['result'][_0x5f76('0x15')]);}})[_0x5f76('0x16')](function(_0x387b3b){logger['error'](_0x5f76('0xf'),_0x5dd1b6,_0x387b3b);_0x431c44(_0x387b3b);});});}exports[_0x5f76('0x17')]=function(_0x5a0bd1){var _0x243463=this;return new Promise(function(_0x2d540e,_0x88b2fe){return db[_0x5f76('0x18')][_0x5f76('0x19')]({'raw':_0x5a0bd1[_0x5f76('0x1a')]?_0x5a0bd1[_0x5f76('0x1a')][_0x5f76('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a0bd1['options']?_0x5a0bd1[_0x5f76('0x1a')][_0x5f76('0x1c')]||null:null,'attributes':_0x5a0bd1[_0x5f76('0x1a')]?_0x5a0bd1[_0x5f76('0x1a')][_0x5f76('0x1d')]||null:null,'limit':_0x5a0bd1['options']?_0x5a0bd1['options'][_0x5f76('0x1e')]||null:null,'include':_0x5a0bd1[_0x5f76('0x1a')]?_0x5a0bd1['options'][_0x5f76('0x1f')]?_[_0x5f76('0x20')](_0x5a0bd1[_0x5f76('0x1a')][_0x5f76('0x1f')],function(_0x29327f){return{'model':db[_0x29327f[_0x5f76('0x21')]],'as':_0x29327f['as'],'attributes':_0x29327f[_0x5f76('0x1d')],'include':_0x29327f[_0x5f76('0x1f')]?_['map'](_0x29327f[_0x5f76('0x1f')],function(_0x2be123){return{'model':db[_0x2be123[_0x5f76('0x21')]],'as':_0x2be123['as'],'attributes':_0x2be123['attributes'],'include':_0x2be123[_0x5f76('0x1f')]?_[_0x5f76('0x20')](_0x2be123[_0x5f76('0x1f')],function(_0x2e2ee4){return{'model':db[_0x2e2ee4['model']],'as':_0x2e2ee4['as'],'attributes':_0x2e2ee4[_0x5f76('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c82a){logger[_0x5f76('0xe')](_0x5f76('0x17'),_0x5a0bd1);logger[_0x5f76('0x11')](_0x5f76('0x17'),_0x5a0bd1,JSON['stringify'](_0x43c82a));_0x2d540e(_0x43c82a);})['catch'](function(_0x69387c){logger[_0x5f76('0x13')]('GetTrunk',_0x69387c[_0x5f76('0x15')],_0x5a0bd1);_0x88b2fe(_0x243463[_0x5f76('0x13')](0x1f4,_0x69387c[_0x5f76('0x15')]));});});};exports[_0x5f76('0x22')]=function(_0x5cacfd){var _0x41919d=this;return new Promise(function(_0x3b0ed1,_0x8458d5){return db[_0x5f76('0x18')][_0x5f76('0x23')]({'raw':_0x5cacfd[_0x5f76('0x1a')]?_0x5cacfd['options'][_0x5f76('0x1b')]===undefined?!![]:![]:!![],'where':_0x5cacfd['options']?_0x5cacfd[_0x5f76('0x1a')][_0x5f76('0x1c')]||null:null,'attributes':_0x5cacfd[_0x5f76('0x1a')]?_0x5cacfd[_0x5f76('0x1a')][_0x5f76('0x1d')]||null:null,'include':_0x5cacfd[_0x5f76('0x1a')]?_0x5cacfd[_0x5f76('0x1a')][_0x5f76('0x1f')]?_[_0x5f76('0x20')](_0x5cacfd['options'][_0x5f76('0x1f')],function(_0x39d80c){return{'model':db[_0x39d80c['model']],'as':_0x39d80c['as'],'attributes':_0x39d80c[_0x5f76('0x1d')],'include':_0x39d80c[_0x5f76('0x1f')]?_['map'](_0x39d80c[_0x5f76('0x1f')],function(_0x1ff7bb){return{'model':db[_0x1ff7bb[_0x5f76('0x21')]],'as':_0x1ff7bb['as'],'attributes':_0x1ff7bb['attributes'],'include':_0x1ff7bb[_0x5f76('0x1f')]?_['map'](_0x1ff7bb[_0x5f76('0x1f')],function(_0x422521){return{'model':db[_0x422521[_0x5f76('0x21')]],'as':_0x422521['as'],'attributes':_0x422521[_0x5f76('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x278429){logger[_0x5f76('0xe')]('ShowTrunk',_0x5cacfd);logger['debug'](_0x5f76('0x22'),_0x5cacfd,JSON['stringify'](_0x278429));_0x3b0ed1(_0x278429);})[_0x5f76('0x16')](function(_0x584a91){logger[_0x5f76('0x13')](_0x5f76('0x22'),_0x584a91[_0x5f76('0x15')],_0x5cacfd);_0x8458d5(_0x41919d['error'](0x1f4,_0x584a91[_0x5f76('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 4867059..15eb854 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 _0x6ff0=['../../components/auth/service','put','/:id','isAuthenticated','update','exports','Router'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6ff0,0xae));var _0x06ff=function(_0x4de1a4,_0x3d21d7){_0x4de1a4=_0x4de1a4-0x0;var _0x2be3fb=_0x6ff0[_0x4de1a4];return _0x2be3fb;};'use strict';var express=require('express');var router=express[_0x06ff('0x0')]();var auth=require(_0x06ff('0x1'));var controller=require('./user-setting.controller');router[_0x06ff('0x2')](_0x06ff('0x3'),auth[_0x06ff('0x4')](),controller[_0x06ff('0x5')]);module[_0x06ff('0x6')]=router; \ No newline at end of file +var _0x5421=['/:id','isAuthenticated','update','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0x60c77e,_0x1473f2){var _0x1209a4=function(_0x28ebdc){while(--_0x28ebdc){_0x60c77e['push'](_0x60c77e['shift']());}};_0x1209a4(++_0x1473f2);}(_0x5421,0x133));var _0x1542=function(_0x31ad1e,_0x5fdfb8){_0x31ad1e=_0x31ad1e-0x0;var _0x21215c=_0x5421[_0x31ad1e];return _0x21215c;};'use strict';var express=require(_0x1542('0x0'));var router=express[_0x1542('0x1')]();var auth=require(_0x1542('0x2'));var controller=require(_0x1542('0x3'));router[_0x1542('0x4')](_0x1542('0x5'),auth[_0x1542('0x6')](),controller[_0x1542('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 3780c28..e84df0f 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 _0x8a9a=['UserId','sequelize','error','warning','info','exports','BOOLEAN','TEXT','DATE','INTEGER'];(function(_0x127ec9,_0x1055fe){var _0xdbf116=function(_0x3a344b){while(--_0x3a344b){_0x127ec9['push'](_0x127ec9['shift']());}};_0xdbf116(++_0x1055fe);}(_0x8a9a,0xdd));var _0xa8a9=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8a9a[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0xa8a9('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa8a9('0x1'),_0xa8a9('0x2'),_0xa8a9('0x3'),'debug'];module[_0xa8a9('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xa8a9('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa8a9('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xa8a9('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xa8a9('0x8')],'unique':_0xa8a9('0x9')}}; \ No newline at end of file +var _0xec64=['info','exports','BOOLEAN','TEXT','INTEGER','UserId','error','warning'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xec64,0x1c6));var _0x4ec6=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xec64[_0x462fe4];return _0x82b23a;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x4ec6('0x0'),_0x4ec6('0x1'),_0x4ec6('0x2'),'debug'];module[_0x4ec6('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x4ec6('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x4ec6('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x4ec6('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x4ec6('0x6')],'unique':_0x4ec6('0x7')}}; \ 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 63d76c6..d274c3f 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 _0x6611=['../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','update','then','sendStatus','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','catch','ioredis','../../config/logger','api','../../config/environment'];(function(_0x438853,_0x277d1c){var _0x366d31=function(_0x2fd42e){while(--_0x2fd42e){_0x438853['push'](_0x438853['shift']());}};_0x366d31(++_0x277d1c);}(_0x6611,0xdd));var _0x1661=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6611[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var Redis=require(_0x1661('0x0'));var logger=require(_0x1661('0x1'))(_0x1661('0x2'));var config=require(_0x1661('0x3'));var db=require(_0x1661('0x4'))['db'];var socket=require(_0x1661('0x5'))(new Redis(config[_0x1661('0x6')]));require(_0x1661('0x7'))[_0x1661('0x8')](socket);config[_0x1661('0x6')]=_[_0x1661('0x9')](config[_0x1661('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x516d22,_0x3f32f3){_0x3f32f3=_0x3f32f3||0xc8;return function(_0x3be60f){if(_0x3be60f){return _0x516d22['status'](_0x3f32f3)['json'](_0x3be60f);}};}function saveUpdates(_0x9a6c9b){return function(_0x403afc){if(_0x403afc){return _0x403afc[_0x1661('0xa')](_0x9a6c9b)[_0x1661('0xb')](function(_0x352ca0){return _0x352ca0;});}return null;};}function handleEntityNotFound(_0x478300){return function(_0x11a269){if(!_0x11a269){_0x478300[_0x1661('0xc')](0x194);}return _0x11a269;};}function handleError(_0x4beb37,_0x156822){_0x156822=_0x156822||0x1f4;return function(_0x2197f2){logger['error'](_0x2197f2[_0x1661('0xd')]);if(_0x2197f2['name']){delete _0x2197f2[_0x1661('0xe')];}_0x4beb37[_0x1661('0xf')](_0x156822)[_0x1661('0x10')](_0x2197f2);};}exports[_0x1661('0xa')]=function(_0x3a2de4,_0x11843d){if(_0x3a2de4[_0x1661('0x11')][_0x1661('0x12')]!==_0x1661('0x13'))throw new Error(_0x1661('0x14'));if(isNaN(Number(_0x3a2de4[_0x1661('0x15')]['id'])))throw new Error(_0x1661('0x16'));return db[_0x1661('0x17')]['find']({'where':{'id':_0x3a2de4['params']['id']}})[_0x1661('0xb')](handleEntityNotFound(_0x11843d,null))[_0x1661('0xb')](saveUpdates(_0x3a2de4['body'],null))[_0x1661('0xb')](respondWithResult(_0x11843d,null))[_0x1661('0x18')](handleError(_0x11843d,null));}; \ No newline at end of file +var _0x7a72=['admin','params','UserSetting','find','then','catch','ioredis','../../config/logger','../../config/environment','socket.io-emitter','./user-setting.socket','redis','localhost','json','update','error','stack','name','status','send'];(function(_0x329905,_0x13c144){var _0x3aa42=function(_0x2fac43){while(--_0x2fac43){_0x329905['push'](_0x329905['shift']());}};_0x3aa42(++_0x13c144);}(_0x7a72,0x1be));var _0x27a7=function(_0x5429b3,_0x1d8c46){_0x5429b3=_0x5429b3-0x0;var _0x1322a8=_0x7a72[_0x5429b3];return _0x1322a8;};'use strict';var _=require('lodash');var Redis=require(_0x27a7('0x0'));var logger=require(_0x27a7('0x1'))('api');var config=require(_0x27a7('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0x27a7('0x3'))(new Redis(config['redis']));require(_0x27a7('0x4'))['register'](socket);config[_0x27a7('0x5')]=_['defaults'](config[_0x27a7('0x5')],{'host':_0x27a7('0x6'),'port':0x18eb});function respondWithResult(_0x5d7305,_0x4ede34){_0x4ede34=_0x4ede34||0xc8;return function(_0x1de957){if(_0x1de957){return _0x5d7305['status'](_0x4ede34)[_0x27a7('0x7')](_0x1de957);}};}function saveUpdates(_0x4679aa){return function(_0x218514){if(_0x218514){return _0x218514[_0x27a7('0x8')](_0x4679aa)['then'](function(_0x1ce909){return _0x1ce909;});}return null;};}function handleEntityNotFound(_0x2547cc){return function(_0x3a54bd){if(!_0x3a54bd){_0x2547cc['sendStatus'](0x194);}return _0x3a54bd;};}function handleError(_0x299206,_0x38a600){_0x38a600=_0x38a600||0x1f4;return function(_0x567418){logger[_0x27a7('0x9')](_0x567418[_0x27a7('0xa')]);if(_0x567418['name']){delete _0x567418[_0x27a7('0xb')];}_0x299206[_0x27a7('0xc')](_0x38a600)[_0x27a7('0xd')](_0x567418);};}exports[_0x27a7('0x8')]=function(_0x428e6a,_0x20189e){if(_0x428e6a['user']['role']!==_0x27a7('0xe'))throw new Error('Unauthorized');if(isNaN(Number(_0x428e6a[_0x27a7('0xf')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x27a7('0x10')][_0x27a7('0x11')]({'where':{'id':_0x428e6a[_0x27a7('0xf')]['id']}})[_0x27a7('0x12')](handleEntityNotFound(_0x20189e,null))['then'](saveUpdates(_0x428e6a['body'],null))[_0x27a7('0x12')](respondWithResult(_0x20189e,null))[_0x27a7('0x13')](handleError(_0x20189e,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 e210cf1..2acce82 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 _0xd2e1=['UserSetting','setMaxListeners','emit','exports'];(function(_0x569de8,_0x1dbf83){var _0x3da95b=function(_0x442016){while(--_0x442016){_0x569de8['push'](_0x569de8['shift']());}};_0x3da95b(++_0x1dbf83);}(_0xd2e1,0x1b8));var _0x1d2e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd2e1[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db'][_0x1d2e('0x0')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x1d2e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4622d1){return function(_0x25c3dc,_0x4f9ced,_0x1d473f){UserSettingEvents['emit'](_0x4622d1+':'+_0x25c3dc['id'],_0x25c3dc);UserSettingEvents[_0x1d2e('0x2')](_0x4622d1,_0x25c3dc);_0x1d473f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x1d2e('0x3')]=UserSettingEvents; \ No newline at end of file +var _0xad72=['setMaxListeners','save','emit','hook','exports','../../mysqldb'];(function(_0x2a82ed,_0x1eab9d){var _0x5d299e=function(_0x4a4d96){while(--_0x4a4d96){_0x2a82ed['push'](_0x2a82ed['shift']());}};_0x5d299e(++_0x1eab9d);}(_0xad72,0x113));var _0x2ad7=function(_0x3f8cbe,_0x367bfa){_0x3f8cbe=_0x3f8cbe-0x0;var _0x51324a=_0xad72[_0x3f8cbe];return _0x51324a;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x2ad7('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x2ad7('0x1')](0x0);var events={'afterCreate':_0x2ad7('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x537021){return function(_0x324d4c,_0x4d8b1e,_0x154230){UserSettingEvents[_0x2ad7('0x3')](_0x537021+':'+_0x324d4c['id'],_0x324d4c);UserSettingEvents[_0x2ad7('0x3')](_0x537021,_0x324d4c);_0x154230(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x2ad7('0x4')](e,emitEvent(event));}}module[_0x2ad7('0x5')]=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 ebd83b3..380b236 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 _0xea28=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xea28,0x13a));var _0x8ea2=function(_0x3d693c,_0x3ce609){_0x3d693c=_0x3d693c-0x0;var _0xf6102f=_0xea28[_0x3d693c];return _0xf6102f;};'use strict';var attributes=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]=function(_0x389e8f){return _0x389e8f[_0x8ea2('0x2')](_0x8ea2('0x3'),attributes,{'tableName':_0x8ea2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3309d9){if(!_0x3309d9[_0x8ea2('0x5')])_0x3309d9['clientSideLoggingEnabledSince']=null;else if(_0x3309d9[_0x8ea2('0x6')]===null)_0x3309d9[_0x8ea2('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x0825=['UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0825,0x1e4));var _0x5082=function(_0x503115,_0x73110){_0x503115=_0x503115-0x0;var _0x2cfabf=_0x0825[_0x503115];return _0x2cfabf;};'use strict';var attributes=require(_0x5082('0x0'));module[_0x5082('0x1')]=function(_0x5889f4){return _0x5889f4['define'](_0x5082('0x2'),attributes,{'tableName':_0x5082('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d25c5){if(!_0x5d25c5[_0x5082('0x4')])_0x5d25c5[_0x5082('0x5')]=null;else if(_0x5d25c5[_0x5082('0x5')]===null)_0x5d25c5[_0x5082('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 3cab905..1cbfc9c 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 _0xd456=['remove','emit','user-setting:update','user-setting:update:user-','UserId','register','length','save'];(function(_0x5f0f7a,_0x244c53){var _0x8742e7=function(_0x48ff6e){while(--_0x48ff6e){_0x5f0f7a['push'](_0x5f0f7a['shift']());}};_0x8742e7(++_0x244c53);}(_0xd456,0x107));var _0x6d45=function(_0x1287db,_0x4705e3){_0x1287db=_0x1287db-0x0;var _0x4d84be=_0xd456[_0x1287db];return _0x4d84be;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x6d45('0x0'),_0x6d45('0x1'),'update'];function createListener(_0x1b3ab0,_0x5a858c){return function(_0xebb571){_0x5a858c[_0x6d45('0x2')](_0x1b3ab0,_0xebb571);if(_0x1b3ab0===_0x6d45('0x3')){_0x5a858c[_0x6d45('0x2')](_0x6d45('0x4')+_0xebb571[_0x6d45('0x5')],_0xebb571);}};}exports[_0x6d45('0x6')]=function(_0x686a62){for(var _0x4711a5=0x0,_0x51c3e7=events[_0x6d45('0x7')];_0x4711a5<_0x51c3e7;_0x4711a5++){var _0x5aaab=events[_0x4711a5];var _0x49f30a=createListener('user-setting:'+_0x5aaab,_0x686a62);UserSettingEvents['on'](_0x5aaab,_0x49f30a);}}; \ No newline at end of file +var _0x08a0=['user-setting:update','user-setting:update:user-','user-setting:','./user-setting.events','save','remove','emit'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x08a0,0x106));var _0x008a=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0x08a0[_0x42f270];return _0x57bc5b;};'use strict';var UserSettingEvents=require(_0x008a('0x0'));var events=[_0x008a('0x1'),_0x008a('0x2'),'update'];function createListener(_0x5d7398,_0x327047){return function(_0x2d458e){_0x327047[_0x008a('0x3')](_0x5d7398,_0x2d458e);if(_0x5d7398===_0x008a('0x4')){_0x327047['emit'](_0x008a('0x5')+_0x2d458e['UserId'],_0x2d458e);}};}exports['register']=function(_0x48fd01){for(var _0x10f50f=0x0,_0x1557e4=events['length'];_0x10f50f<_0x1557e4;_0x10f50f++){var _0x200c0f=events[_0x10f50f];var _0x3e3cac=createListener(_0x008a('0x6')+_0x200c0f,_0x48fd01);UserSettingEvents['on'](_0x200c0f,_0x3e3cac);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f48b43e..45ef55e 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 _0xf150=['addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','update','/:id/password','changePassword','/:id/queues','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','describe','/whoami','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','/:id/login','login','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions'];(function(_0x609443,_0x3e4c99){var _0x62cb30=function(_0x3dc499){while(--_0x3dc499){_0x609443['push'](_0x609443['shift']());}};_0x62cb30(++_0x3e4c99);}(_0xf150,0x106));var _0x0f15=function(_0x4b33dc,_0x5031dc){_0x4b33dc=_0x4b33dc-0x0;var _0x104bb9=_0xf150[_0x4b33dc];return _0x104bb9;};'use strict';var multer=require(_0x0f15('0x0'));var util=require(_0x0f15('0x1'));var path=require(_0x0f15('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f15('0x3'));var router=express[_0x0f15('0x4')]();var fs_extra=require(_0x0f15('0x5'));var auth=require(_0x0f15('0x6'));var interaction=require(_0x0f15('0x7'));var config=require(_0x0f15('0x8'));var controller=require(_0x0f15('0x9'));router[_0x0f15('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0f15('0xa')](_0x0f15('0xb'),auth[_0x0f15('0xc')](),controller[_0x0f15('0xd')]);router['get'](_0x0f15('0xe'),auth['isAuthenticated'](),controller[_0x0f15('0xf')]);router[_0x0f15('0xa')]('/presence',auth['isAuthenticated'](),controller[_0x0f15('0x10')]);router[_0x0f15('0xa')](_0x0f15('0x11'),auth['isAuthenticated'](),controller[_0x0f15('0x12')]);router['get']('/:id/avatar',controller[_0x0f15('0x13')]);router[_0x0f15('0xa')](_0x0f15('0x14'),auth[_0x0f15('0xc')](),controller['getOpenTabs']);router[_0x0f15('0xa')](_0x0f15('0x15'),auth[_0x0f15('0xc')](),controller['getContacts']);router[_0x0f15('0xa')]('/:id/queues',auth[_0x0f15('0xc')](),controller[_0x0f15('0x16')]);router['get']('/:id/queues_rt',auth[_0x0f15('0xc')](),controller[_0x0f15('0x17')]);router[_0x0f15('0xa')](_0x0f15('0x18'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x19')]);router[_0x0f15('0xa')]('/:id/recordings',auth[_0x0f15('0xc')](),controller[_0x0f15('0x1a')]);router['get'](_0x0f15('0x1b'),auth['isAuthenticated'](),controller[_0x0f15('0x1c')]);router['get'](_0x0f15('0x1d'),auth[_0x0f15('0xc')](),controller['getChatInteractions']);router[_0x0f15('0xa')](_0x0f15('0x1e'),auth['isAuthenticated'](),controller[_0x0f15('0x1f')]);router['get']('/:id/mail/interactions',auth[_0x0f15('0xc')](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth[_0x0f15('0xc')](),controller[_0x0f15('0x20')]);router[_0x0f15('0xa')](_0x0f15('0x21'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x22')]);router[_0x0f15('0xa')](_0x0f15('0x23'),auth[_0x0f15('0xc')](),controller['getWhatsappInteractions']);router[_0x0f15('0xa')](_0x0f15('0x24'),auth[_0x0f15('0xc')](),controller['getTeams']);router[_0x0f15('0xa')](_0x0f15('0x25'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x26')]);router[_0x0f15('0xa')](_0x0f15('0x27'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x28')]);router[_0x0f15('0xa')](_0x0f15('0x29'),auth[_0x0f15('0xc')](),controller['getVoicePrefixes']);router[_0x0f15('0xa')](_0x0f15('0x2a'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x2b')]);router[_0x0f15('0xa')](_0x0f15('0x2c'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x2d')]);router['get'](_0x0f15('0x2e'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x2f')]);router[_0x0f15('0xa')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x0f15('0xa')](_0x0f15('0x30'),auth['isAuthenticated'](),controller[_0x0f15('0x31')]);router[_0x0f15('0xa')](_0x0f15('0x32'),auth['isAuthenticated'](),controller[_0x0f15('0x33')]);router[_0x0f15('0xa')](_0x0f15('0x34'),auth[_0x0f15('0xc')](),controller['getScheduledCalls']);router['get'](_0x0f15('0x35'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x36')]);router[_0x0f15('0x37')](_0x0f15('0x15'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x38')]);router[_0x0f15('0x37')]('/',auth[_0x0f15('0xc')](),controller[_0x0f15('0x39')]);router[_0x0f15('0x37')](_0x0f15('0x3a'),auth[_0x0f15('0xc')](),controller['bulkCreate']);router[_0x0f15('0x37')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0f15('0x3b')]);var upload=multer({'storage':multer[_0x0f15('0x3c')]({'destination':function(_0x4d4903,_0x44f2e1,_0x52b7fc){_0x52b7fc(null,path['join'](config['root'],_0x0f15('0x3d')));},'filename':function(_0x23ec36,_0x38725d,_0x3b9a55){_0x3b9a55(null,util[_0x0f15('0x3e')](_0x0f15('0x3f'),Date['now'](),_0x38725d[_0x0f15('0x40')]));}})});router[_0x0f15('0x37')](_0x0f15('0x41'),upload[_0x0f15('0x42')](_0x0f15('0x43')),controller['addAvatar']);router[_0x0f15('0x37')](_0x0f15('0x44'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x45')]);router['post']('/:id/logout',auth[_0x0f15('0xc')](),controller[_0x0f15('0x46')]);router[_0x0f15('0x37')]('/:id/pause',auth[_0x0f15('0xc')](),controller[_0x0f15('0x47')]);router[_0x0f15('0x37')](_0x0f15('0x48'),auth['isAuthenticated'](),controller[_0x0f15('0x49')]);router[_0x0f15('0x37')](_0x0f15('0x24'),auth['isAuthenticated'](),controller[_0x0f15('0x4a')]);router[_0x0f15('0x37')](_0x0f15('0x4b'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x4c')]);router[_0x0f15('0x37')](_0x0f15('0x4d'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x4e')]);router[_0x0f15('0x37')]('/:id/fax_interactions',auth[_0x0f15('0xc')](),controller[_0x0f15('0x4f')]);router['post'](_0x0f15('0x50'),auth[_0x0f15('0xc')](),controller['addSmsInteractions']);router['post'](_0x0f15('0x51'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x52')]);router['post']('/:id/whatsapp_interactions',auth[_0x0f15('0xc')](),controller[_0x0f15('0x53')]);router[_0x0f15('0x37')](_0x0f15('0x2a'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x54')]);router[_0x0f15('0x37')]('/:id/mail_accounts',auth[_0x0f15('0xc')](),controller[_0x0f15('0x55')]);router[_0x0f15('0x37')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x0f15('0x56')]);router['post'](_0x0f15('0x57'),auth['isAuthenticated'](),controller[_0x0f15('0x58')]);router[_0x0f15('0x37')](_0x0f15('0x30'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x59')]);router[_0x0f15('0x37')]('/:id/whatsapp_accounts',auth[_0x0f15('0xc')](),controller[_0x0f15('0x5a')]);router[_0x0f15('0x37')]('/:id/api_key',auth['isAuthenticated'](),controller['createApiKey']);router[_0x0f15('0x5b')](_0x0f15('0x11'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x5c')]);router[_0x0f15('0x5b')](_0x0f15('0x5d'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x5e')]);router['delete'](_0x0f15('0x5f'),auth['isAuthenticated'](),controller[_0x0f15('0x60')]);router[_0x0f15('0x61')](_0x0f15('0x24'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x0f15('0x61')](_0x0f15('0x11'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x62')]);router['delete']('/:id/chat_interactions',auth[_0x0f15('0xc')](),controller[_0x0f15('0x63')]);router[_0x0f15('0x61')](_0x0f15('0x4d'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x64')]);router[_0x0f15('0x61')](_0x0f15('0x65'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x66')]);router['delete'](_0x0f15('0x50'),auth['isAuthenticated'](),controller[_0x0f15('0x67')]);router['delete'](_0x0f15('0x51'),auth['isAuthenticated'](),controller[_0x0f15('0x68')]);router[_0x0f15('0x61')](_0x0f15('0x69'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x6a')]);router[_0x0f15('0x61')](_0x0f15('0x2a'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x6b')]);router[_0x0f15('0x61')](_0x0f15('0x2c'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x6c')]);router[_0x0f15('0x61')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x0f15('0x6d')]);router[_0x0f15('0x61')]('/:id/sms_accounts',auth[_0x0f15('0xc')](),controller[_0x0f15('0x6e')]);router[_0x0f15('0x61')](_0x0f15('0x30'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x6f')]);router[_0x0f15('0x61')](_0x0f15('0x32'),auth[_0x0f15('0xc')](),controller[_0x0f15('0x70')]);router[_0x0f15('0x61')]('/:id/api_key',auth[_0x0f15('0xc')](),controller[_0x0f15('0x71')]);module[_0x0f15('0x72')]=router; \ No newline at end of file +var _0xdba6=['addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeApiKey','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','join','root','server/files/images/','format','%s-%s','originalname','single','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts'];(function(_0x17f515,_0x26e47f){var _0x5ea54b=function(_0x32de1b){while(--_0x32de1b){_0x17f515['push'](_0x17f515['shift']());}};_0x5ea54b(++_0x26e47f);}(_0xdba6,0x14d));var _0x6dba=function(_0x1bdc0c,_0x1d890f){_0x1bdc0c=_0x1bdc0c-0x0;var _0x5e57f3=_0xdba6[_0x1bdc0c];return _0x5e57f3;};'use strict';var multer=require(_0x6dba('0x0'));var util=require('util');var path=require(_0x6dba('0x1'));var timeout=require(_0x6dba('0x2'));var express=require(_0x6dba('0x3'));var router=express['Router']();var fs_extra=require(_0x6dba('0x4'));var auth=require(_0x6dba('0x5'));var interaction=require(_0x6dba('0x6'));var config=require('../../config/environment');var controller=require(_0x6dba('0x7'));router[_0x6dba('0x8')]('/',auth[_0x6dba('0x9')](),controller['index']);router[_0x6dba('0x8')]('/describe',auth[_0x6dba('0x9')](),controller[_0x6dba('0xa')]);router[_0x6dba('0x8')](_0x6dba('0xb'),auth[_0x6dba('0x9')](),controller[_0x6dba('0xc')]);router['get'](_0x6dba('0xd'),auth['isAuthenticated'](),controller[_0x6dba('0xe')]);router[_0x6dba('0x8')](_0x6dba('0xf'),auth['isAuthenticated'](),controller[_0x6dba('0x10')]);router[_0x6dba('0x8')](_0x6dba('0x11'),controller[_0x6dba('0x12')]);router[_0x6dba('0x8')](_0x6dba('0x13'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x14')]);router[_0x6dba('0x8')](_0x6dba('0x15'),auth['isAuthenticated'](),controller['getContacts']);router[_0x6dba('0x8')](_0x6dba('0x16'),auth[_0x6dba('0x9')](),controller['getQueues']);router[_0x6dba('0x8')](_0x6dba('0x17'),auth['isAuthenticated'](),controller[_0x6dba('0x18')]);router[_0x6dba('0x8')](_0x6dba('0x19'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x1a')]);router[_0x6dba('0x8')](_0x6dba('0x1b'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x6dba('0x8')](_0x6dba('0x1c'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x1d')]);router[_0x6dba('0x8')](_0x6dba('0x1e'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0x6dba('0x1f'),auth[_0x6dba('0x9')](),controller['getOpenchannelInteractions']);router[_0x6dba('0x8')](_0x6dba('0x20'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x21')]);router[_0x6dba('0x8')]('/:id/sms/interactions',auth[_0x6dba('0x9')](),controller[_0x6dba('0x22')]);router[_0x6dba('0x8')](_0x6dba('0x23'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x24')]);router[_0x6dba('0x8')](_0x6dba('0x25'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x26')]);router['get'](_0x6dba('0x27'),auth['isAuthenticated'](),controller['getTeams']);router[_0x6dba('0x8')](_0x6dba('0x28'),auth['isAuthenticated'](),controller['getLists']);router[_0x6dba('0x8')](_0x6dba('0x29'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x2a')]);router['get'](_0x6dba('0x2b'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x2c')]);router[_0x6dba('0x8')](_0x6dba('0x2d'),auth[_0x6dba('0x9')](),controller['getFaxAccounts']);router[_0x6dba('0x8')]('/:id/mail_accounts',auth[_0x6dba('0x9')](),controller['getMailAccounts']);router[_0x6dba('0x8')]('/:id/openchannel_accounts',auth[_0x6dba('0x9')](),controller[_0x6dba('0x2e')]);router['get'](_0x6dba('0x2f'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x30')]);router[_0x6dba('0x8')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x6dba('0x31')]);router[_0x6dba('0x8')](_0x6dba('0x32'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x33')]);router['get'](_0x6dba('0x34'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x35')]);router['get'](_0x6dba('0x36'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x37')]);router[_0x6dba('0x38')](_0x6dba('0x15'),auth[_0x6dba('0x9')](),controller['addContacts']);router[_0x6dba('0x38')]('/',auth[_0x6dba('0x9')](),controller[_0x6dba('0x39')]);router['post'](_0x6dba('0x3a'),auth[_0x6dba('0x9')](),controller['bulkCreate']);router[_0x6dba('0x38')]('/:id/queues',auth[_0x6dba('0x9')](),controller[_0x6dba('0x3b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c6c11,_0x3a3dd7,_0x190f75){_0x190f75(null,path[_0x6dba('0x3c')](config[_0x6dba('0x3d')],_0x6dba('0x3e')));},'filename':function(_0x22cd1c,_0x45f171,_0x3d5d15){_0x3d5d15(null,util[_0x6dba('0x3f')](_0x6dba('0x40'),Date['now'](),_0x45f171[_0x6dba('0x41')]));}})});router[_0x6dba('0x38')](_0x6dba('0x11'),upload[_0x6dba('0x42')]('file'),controller[_0x6dba('0x43')]);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0x6dba('0x44')]);router[_0x6dba('0x38')]('/:id/logout',auth[_0x6dba('0x9')](),controller[_0x6dba('0x45')]);router[_0x6dba('0x38')](_0x6dba('0x46'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x47')]);router['post'](_0x6dba('0x48'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x49')]);router[_0x6dba('0x38')]('/:id/teams',auth[_0x6dba('0x9')](),controller[_0x6dba('0x4a')]);router[_0x6dba('0x38')]('/:id/chat_interactions',auth[_0x6dba('0x9')](),controller['addChatInteractions']);router[_0x6dba('0x38')](_0x6dba('0x4b'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x4c')]);router['post'](_0x6dba('0x4d'),auth[_0x6dba('0x9')](),controller['addFaxInteractions']);router['post'](_0x6dba('0x4e'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x4f')]);router[_0x6dba('0x38')](_0x6dba('0x50'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x51')]);router[_0x6dba('0x38')](_0x6dba('0x52'),auth['isAuthenticated'](),controller[_0x6dba('0x53')]);router[_0x6dba('0x38')](_0x6dba('0x2d'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x54')]);router[_0x6dba('0x38')](_0x6dba('0x55'),auth[_0x6dba('0x9')](),controller['addMailAccounts']);router[_0x6dba('0x38')](_0x6dba('0x56'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x57')]);router[_0x6dba('0x38')](_0x6dba('0x2f'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x58')]);router[_0x6dba('0x38')](_0x6dba('0x59'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x5a')]);router[_0x6dba('0x38')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x6dba('0x38')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x6dba('0x5b')]);router['put']('/:id',auth[_0x6dba('0x9')](),controller['update']);router[_0x6dba('0x5c')](_0x6dba('0x5d'),auth['isAuthenticated'](),controller[_0x6dba('0x5e')]);router[_0x6dba('0x5f')](_0x6dba('0x16'),auth['isAuthenticated'](),controller['removeQueues']);router[_0x6dba('0x5f')]('/:id/teams',auth[_0x6dba('0x9')](),controller[_0x6dba('0x60')]);router[_0x6dba('0x5f')]('/:id',auth[_0x6dba('0x9')](),controller[_0x6dba('0x61')]);router[_0x6dba('0x5f')](_0x6dba('0x62'),auth['isAuthenticated'](),controller[_0x6dba('0x63')]);router['delete'](_0x6dba('0x4b'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x6dba('0x5f')](_0x6dba('0x4d'),auth[_0x6dba('0x9')](),controller['removeFaxInteractions']);router[_0x6dba('0x5f')](_0x6dba('0x4e'),auth['isAuthenticated'](),controller[_0x6dba('0x64')]);router[_0x6dba('0x5f')](_0x6dba('0x50'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x65')]);router[_0x6dba('0x5f')](_0x6dba('0x52'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x66')]);router['delete'](_0x6dba('0x2d'),auth[_0x6dba('0x9')](),controller['removeFaxAccounts']);router['delete']('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router['delete'](_0x6dba('0x56'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x6dba('0x5f')](_0x6dba('0x2f'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x6dba('0x5f')](_0x6dba('0x59'),auth[_0x6dba('0x9')](),controller['removeChatWebsites']);router[_0x6dba('0x5f')](_0x6dba('0x32'),auth[_0x6dba('0x9')](),controller['removeWhatsappAccounts']);router['delete'](_0x6dba('0x36'),auth[_0x6dba('0x9')](),controller[_0x6dba('0x67')]);module[_0x6dba('0x68')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 1ba92ca..f2e3235 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 _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','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]'];(function(_0x4c152e,_0x59a298){var _0x5d2aa4=function(_0x24aba1){while(--_0x24aba1){_0x4c152e['push'](_0x4c152e['shift']());}};_0x5d2aa4(++_0x59a298);}(_0xedd9,0xfc));var _0x9edd=function(_0x338e09,_0x463951){_0x338e09=_0x338e09-0x0;var _0x5e78f2=_0xedd9[_0x338e09];return _0x5e78f2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'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 4be0009..47c239c 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 _0x0275=['Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','Telephones','userProfileId','compact','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','newPassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','online','isValidChannel','Queues','penalty','QueueId','emit','toLowerCase','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','channel','Unknown\x20channel','remove','capitalize','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','sort','filters','hasOwnProperty','CmList','Tag','Tags','color','tag','nolimit','getQueues','pick','Queue','Unknown\x20role','UserVoiceQueueRt','order','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','forEach','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','isMiddleware','logout','MemberReport','pause','QueuePause','updateAttributes','getChannels','bulkCreate','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','getTeams','Team','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','Voice','voicePause','VoicePrefixId','getDataValue','removeTeams','TeamVoicePrefix','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','phone','CmContact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','queues','isEmpty','teams','inbound','flatten','lower','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','util','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','role','userNotification:recalc:','destroy','get','Users','user','Agents','telephone','filter','ignore','map','value','includes','find','name','stack','send','fieldName','type','key','password','salt','where','User','query','includeAll','include','userSetting','true','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','mail','openchannel','all','params','model','differenceBy','keys','rawAttributes','intersection','fields','UserSetting','merge','options','whatsapp','fax','body','describe','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','min_internal','isNil','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','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','106','108','109','100','111','114','115','create','agent','admin','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','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some'];(function(_0x3ab8db,_0x442eb0){var _0x24d98e=function(_0x49ecb1){while(--_0x49ecb1){_0x3ab8db['push'](_0x3ab8db['shift']());}};_0x24d98e(++_0x442eb0);}(_0x0275,0x108));var _0x5027=function(_0x1819eb,_0x5df8c2){_0x1819eb=_0x1819eb-0x0;var _0x5a74d2=_0x0275[_0x1819eb];return _0x5a74d2;};'use strict';var moment=require('moment');var util=require(_0x5027('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x5027('0x1'));var squel=require(_0x5027('0x2'));var jayson=require(_0x5027('0x3'));var Redis=require('ioredis');var authService=require(_0x5027('0x4'));var qs=require(_0x5027('0x5'));var logger=require(_0x5027('0x6'))(_0x5027('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5027('0x8'));var APIBadRequestError=require(_0x5027('0x9'))[_0x5027('0xa')];var APINotFoundError=require('../../errors/api')[_0x5027('0xb')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x5027('0xc'))['db'];var socket=require(_0x5027('0xd'))(new Redis(config[_0x5027('0xe')]));require(_0x5027('0xf'))[_0x5027('0x10')](socket);config['redis']=_[_0x5027('0x11')](config[_0x5027('0xe')],{'host':_0x5027('0x12'),'port':0x18eb});var amiClient=jayson[_0x5027('0x13')][_0x5027('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x1fdc8a,_0x15e66b,_0x5899e4,_0x4a5c6c){return new Promise(function(_0xd558ad,_0x5de1d9){var _0x48aec0=_0x4a5c6c||amiClient;return _0x48aec0[_0x5027('0x15')](_0x1fdc8a,_0x5899e4)[_0x5027('0x16')](function(_0x525781){logger[_0x5027('0x17')](_0x5027('0x18'),_0x15e66b,_0x5027('0x19'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x15e66b,_0x5027('0x19'),JSON['stringify'](_0x525781));if(_0x525781['error']){if(_0x525781[_0x5027('0x1a')][_0x5027('0x1b')]===0x1f4){logger[_0x5027('0x1a')](_0x5027('0x18'),_0x15e66b,_0x525781[_0x5027('0x1a')][_0x5027('0x1c')]);return _0x5de1d9(_0x525781['error'][_0x5027('0x1c')]);}logger[_0x5027('0x1a')](_0x5027('0x18'),_0x15e66b,_0x525781[_0x5027('0x1a')]['message']);return _0xd558ad(_0x525781[_0x5027('0x1a')][_0x5027('0x1c')]);}else{logger[_0x5027('0x17')](_0x5027('0x18'),_0x15e66b,_0x5027('0x19'));_0xd558ad(_0x525781[_0x5027('0x1d')]['message']);}})[_0x5027('0x1e')](function(_0x487ecb){logger[_0x5027('0x1a')]('User,\x20%s,\x20%s',_0x15e66b,_0x487ecb);_0x5de1d9(_0x487ecb);});});}function respondWithStatusCode(_0x58bd83,_0x18b694){_0x18b694=_0x18b694||0xcc;return function(_0x318624){if(_0x318624){return _0x58bd83[_0x5027('0x1f')](_0x18b694);}return _0x58bd83[_0x5027('0x20')](_0x18b694)[_0x5027('0x21')]();};}function respondWithResult(_0xda51b5,_0x43d44a){_0x43d44a=_0x43d44a||0xc8;return function(_0x110e46){if(_0x110e46){return _0xda51b5[_0x5027('0x20')](_0x43d44a)[_0x5027('0x22')](_0x110e46);}};}function respondWithFilteredResult(_0xb821fc,_0x5515fd){return function(_0x37ae3c){if(_0x37ae3c){var _0x28d30a=typeof _0x5515fd[_0x5027('0x23')]===_0x5027('0x24')&&typeof _0x5515fd[_0x5027('0x25')]===_0x5027('0x24');var _0x31307a=_0x37ae3c[_0x5027('0x26')];var _0x10f99d=_0x28d30a?0x0:_0x5515fd[_0x5027('0x23')];var _0x7dc3ca=_0x28d30a?_0x37ae3c[_0x5027('0x26')]:_0x5515fd[_0x5027('0x23')]+_0x5515fd[_0x5027('0x25')];var _0x452266;if(_0x7dc3ca>=_0x31307a){_0x7dc3ca=_0x31307a;_0x452266=0xc8;}else{_0x452266=0xce;}_0xb821fc['status'](_0x452266);return _0xb821fc[_0x5027('0x27')](_0x5027('0x28'),_0x10f99d+'-'+_0x7dc3ca+'/'+_0x31307a)[_0x5027('0x22')](_0x37ae3c);}return null;};}function saveUpdates(_0x339a60){return function(_0x5dbde1){if(_0x5dbde1){return _0x5dbde1[_0x5027('0x29')](_0x339a60)['then'](function(_0x49528a){if(_0x49528a[_0x5027('0x2a')]==='agent'){socket['emit'](_0x5027('0x2b')+_0x49528a['id'],_0x49528a);}return _0x49528a;});}return null;};}function removeEntity(_0x31eb16){return function(_0x40a2cb){if(_0x40a2cb){return _0x40a2cb[_0x5027('0x2c')]()[_0x5027('0x16')](function(){var _0x3a9d2d=_0x40a2cb[_0x5027('0x2d')]({'plain':!![]});if(_0x3a9d2d[_0x5027('0x2a')]==='admin')return;var _0x37a533=[{'name':_0x5027('0x2e'),'value':_0x5027('0x2f'),'ignore':!![]},{'name':_0x5027('0x30'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x5027('0x31'),'ignore':![]}];var _0x345e03=_(_0x37a533)[_0x5027('0x32')](_0x5027('0x33'))[_0x5027('0x34')](_0x5027('0x35'))[_0x5027('0x35')]();if(_[_0x5027('0x36')](_0x345e03,_0x3a9d2d[_0x5027('0x2a')])){return;}var _0x1d50f3=_[_0x5027('0x37')](_0x37a533,['value',_0x3a9d2d[_0x5027('0x2a')]])[_0x5027('0x38')];return db['UserProfileResource'][_0x5027('0x2c')]({'where':{'type':_0x1d50f3,'resourceId':_0x3a9d2d['id']}})['then'](function(){return _0x40a2cb;});})[_0x5027('0x16')](function(){_0x31eb16[_0x5027('0x20')](0xcc)[_0x5027('0x21')]();});}};}function handleEntityNotFound(_0x16eb2b){return function(_0x43078b){if(!_0x43078b){_0x16eb2b[_0x5027('0x1f')](0x194);}return _0x43078b;};}function handleError(_0x1fb2fd,_0x32927d){_0x32927d=_0x32927d||0x1f4;return function(_0x3eafed){logger['error'](_0x3eafed[_0x5027('0x39')]);if(_0x3eafed[_0x5027('0x38')]){delete _0x3eafed['name'];}_0x1fb2fd['status'](_0x32927d)[_0x5027('0x3a')](_0x3eafed);};}exports['index']=function(_0x5f0dd2,_0x49f327){var _0x202881={},_0x40d1a9={'count':0x0,'rows':[]};var _0x53ad25=_(db['User']['rawAttributes'])['map'](function(_0x16c884){return{'name':_0x16c884[_0x5027('0x3b')],'type':_0x16c884[_0x5027('0x3c')][_0x5027('0x3d')]};})[_0x5027('0x32')](function(_0x47de8e){return!_[_0x5027('0x36')]([_0x5027('0x3e'),_0x5027('0x3f')],_0x47de8e[_0x5027('0x38')]);})['value']();_0x202881=qs['getOptions'](_0x53ad25,_0x5f0dd2);var _0x694e8d={'where':_0x202881[_0x5027('0x40')]};return db[_0x5027('0x41')][_0x5027('0x26')](_0x694e8d)[_0x5027('0x16')](function(_0x2bc943){_0x40d1a9[_0x5027('0x26')]=_0x2bc943;if(_0x5f0dd2[_0x5027('0x42')][_0x5027('0x43')]){_0x202881[_0x5027('0x44')]=[{'all':!![]}];}if(_0x5f0dd2[_0x5027('0x42')][_0x5027('0x45')]===_0x5027('0x46')){_0x202881[_0x5027('0x44')]=[{'model':db['UserSetting'],'as':_0x5027('0x45')}];}if(!_[_0x5027('0x36')](_0x202881[_0x5027('0x47')],'id')){_0x202881[_0x5027('0x47')][_0x5027('0x48')]('id');}return db['User'][_0x5027('0x49')](_0x202881);})[_0x5027('0x16')](function(_0x2d9ff8){_0x40d1a9[_0x5027('0x4a')]=_0x2d9ff8;if(_0x5f0dd2[_0x5027('0x42')][_0x5027('0x4b')]===_0x5027('0x46')){var _0xf5ea1c=[];for(var _0x130f8a=0x0;_0x130f8a<_0x40d1a9[_0x5027('0x4a')][_0x5027('0x4c')];_0x130f8a++){_0xf5ea1c[_0x5027('0x48')](get_open_tabs(_0x5027('0x4d'),_0x40d1a9[_0x5027('0x4a')][_0x130f8a][_0x5027('0x4e')]));_0xf5ea1c[_0x5027('0x48')](get_open_tabs(_0x5027('0x4f'),_0x40d1a9['rows'][_0x130f8a][_0x5027('0x4e')]));_0xf5ea1c[_0x5027('0x48')](get_open_tabs('fax',_0x40d1a9[_0x5027('0x4a')][_0x130f8a][_0x5027('0x4e')]));_0xf5ea1c[_0x5027('0x48')](get_open_tabs(_0x5027('0x50'),_0x40d1a9[_0x5027('0x4a')][_0x130f8a][_0x5027('0x4e')]));_0xf5ea1c[_0x5027('0x48')](get_open_tabs(_0x5027('0x51'),_0x40d1a9[_0x5027('0x4a')][_0x130f8a][_0x5027('0x4e')]));_0xf5ea1c[_0x5027('0x48')](get_open_tabs('whatsapp',_0x40d1a9[_0x5027('0x4a')][_0x130f8a][_0x5027('0x4e')]));}return Promise[_0x5027('0x52')](_0xf5ea1c)[_0x5027('0x16')](function(){return _0x40d1a9;});}else{return _0x40d1a9;}})[_0x5027('0x16')](respondWithFilteredResult(_0x49f327,_0x202881))[_0x5027('0x1e')](handleError(_0x49f327,null));};exports['show']=function(_0x4f3ca0,_0x46ccaf){var _0x15511d={'raw':![],'where':{'id':_0x4f3ca0[_0x5027('0x53')]['id']}},_0x1c6285={};_0x1c6285[_0x5027('0x54')]=_[_0x5027('0x55')](_[_0x5027('0x56')](db['User'][_0x5027('0x57')]),[_0x5027('0x3e'),'salt']);_0x1c6285['query']=_['keys'](_0x4f3ca0['query']);_0x1c6285['filters']=_[_0x5027('0x58')](_0x1c6285[_0x5027('0x54')],_0x1c6285[_0x5027('0x42')]);_0x15511d[_0x5027('0x47')]=_[_0x5027('0x58')](_0x1c6285[_0x5027('0x54')],qs['fields'](_0x4f3ca0[_0x5027('0x42')][_0x5027('0x59')]));_0x15511d[_0x5027('0x47')]=_0x15511d[_0x5027('0x47')][_0x5027('0x4c')]?_0x15511d[_0x5027('0x47')]:_0x1c6285[_0x5027('0x54')];if(_0x4f3ca0['query']['includeAll']){_0x15511d[_0x5027('0x44')]=[{'all':!![]}];}if(_0x4f3ca0[_0x5027('0x42')]['userSetting']===_0x5027('0x46')){_0x15511d[_0x5027('0x44')]=[{'model':db[_0x5027('0x5a')],'as':_0x5027('0x45')}];}_0x15511d=_[_0x5027('0x5b')]({},_0x15511d,_0x4f3ca0[_0x5027('0x5c')]);if(!_[_0x5027('0x36')](_0x15511d[_0x5027('0x47')],'id')){_0x15511d[_0x5027('0x47')][_0x5027('0x48')]('id');}return db[_0x5027('0x41')][_0x5027('0x37')](_0x15511d)[_0x5027('0x16')](handleEntityNotFound(_0x46ccaf,null))[_0x5027('0x16')](function(_0xdc38de){var _0x102279=[];values=_0xdc38de;if(_0x4f3ca0[_0x5027('0x42')][_0x5027('0x4b')]===_0x5027('0x46')){_0x102279[_0x5027('0x48')](get_open_tabs(_0x5027('0x4d'),_0xdc38de[_0x5027('0x4e')]));_0x102279[_0x5027('0x48')](get_open_tabs(_0x5027('0x4f'),_0xdc38de[_0x5027('0x4e')]));_0x102279[_0x5027('0x48')](get_open_tabs('openchannel',_0xdc38de[_0x5027('0x4e')]));_0x102279[_0x5027('0x48')](get_open_tabs(_0x5027('0x5d'),_0xdc38de['dataValues']));_0x102279[_0x5027('0x48')](get_open_tabs(_0x5027('0x5e'),_0xdc38de[_0x5027('0x4e')]));_0x102279['push'](get_open_tabs(_0x5027('0x50'),_0xdc38de[_0x5027('0x4e')]));return Promise[_0x5027('0x52')](_0x102279);}else{return values;}})[_0x5027('0x16')](function(){return values;})[_0x5027('0x16')](respondWithResult(_0x46ccaf,null))[_0x5027('0x1e')](handleError(_0x46ccaf,null));};exports[_0x5027('0x29')]=function(_0x117d40,_0x587490){if(_0x117d40[_0x5027('0x5f')]['id']){delete _0x117d40[_0x5027('0x5f')]['id'];}delete _0x117d40[_0x5027('0x5f')][_0x5027('0x2a')];return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x117d40[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x587490,null))[_0x5027('0x16')](saveUpdates(_0x117d40['body'],null))['then'](respondWithResult(_0x587490,null))['catch'](handleError(_0x587490,null));};exports[_0x5027('0x60')]=function(_0x54279c,_0x513754){return db['User'][_0x5027('0x60')]()[_0x5027('0x16')](respondWithResult(_0x513754,null))[_0x5027('0x1e')](handleError(_0x513754,null));};exports[_0x5027('0x61')]=function(_0x133644,_0x5ad478){return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x133644[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x5ad478,null))[_0x5027('0x16')](function(_0x4d911b){if(_0x4d911b){return _0x4d911b['addContacts'](_0x133644[_0x5027('0x5f')][_0x5027('0x62')],_[_0x5027('0x63')](_0x133644[_0x5027('0x5f')],[_0x5027('0x62'),'id'])||{});}})[_0x5027('0x16')](respondWithResult(_0x5ad478,null))['catch'](handleError(_0x5ad478,null));};function validateUser(_0xbae019){return new Promise(function(_0x14b9c9,_0x4dcd34){if(_0xbae019[_0x5027('0x64')])return _0x14b9c9(_0xbae019);return db['Setting'][_0x5027('0x65')](0x1)[_0x5027('0x16')](function(_0x38d491){if(_0x38d491[_0x5027('0x66')])authService[_0x5027('0x67')](_0xbae019[_0x5027('0x3e')]);db['User'][_0x5027('0x68')]('internal')['then'](function(_0x4128ff){if(_['isNil'](_0x4128ff)){_0xbae019[_0x5027('0x64')]=_0x38d491[_0x5027('0x69')]||0x1;return;}if(_[_0x5027('0x6a')](_0x38d491[_0x5027('0x69')])||_0x38d491[_0x5027('0x69')]===_0x4128ff){_0xbae019[_0x5027('0x64')]=_0x4128ff+0x1;return;}if(_0x38d491[_0x5027('0x69')]>_0x4128ff){_0xbae019[_0x5027('0x64')]=_0x38d491['min_internal'];return;}return db[_0x5027('0x6b')][_0x5027('0x42')](_0x5027('0x6c'),{'type':db[_0x5027('0x6b')][_0x5027('0x6d')][_0x5027('0x6e')]})['then'](function(_0x55a1f5){if(_0x55a1f5&&_0x55a1f5['length']){for(var _0x14b0c5=0x0,_0x18a35e=_0x55a1f5[_0x5027('0x4c')];_0x14b0c5<_0x18a35e&&_[_0x5027('0x6a')](_0xbae019[_0x5027('0x64')]);_0x14b0c5++){if(_0x38d491[_0x5027('0x69')]<=_0x55a1f5[_0x14b0c5]['from']){_0xbae019['internal']=_0x55a1f5[_0x14b0c5][_0x5027('0x6f')];}else if(_0x38d491['min_internal']>_0x55a1f5[_0x14b0c5][_0x5027('0x6f')]&&_0x38d491['min_internal']<=_0x55a1f5[_0x14b0c5]['to']){_0xbae019[_0x5027('0x64')]=_0x38d491[_0x5027('0x69')];}}}if(_[_0x5027('0x6a')](_0xbae019[_0x5027('0x64')])){_0xbae019[_0x5027('0x64')]=_0x4128ff+0x1;}return _0x14b9c9(_0xbae019);});});})[_0x5027('0x1e')](function(_0x2b2af4){_0x4dcd34(_0x2b2af4);});});}function updateUser(_0x4da57b){return new Promise(function(_0x38774e,_0x3c87b8){try{if(_0x4da57b[_0x5027('0x70')]){_0x4da57b[_0x5027('0x71')]=_0x4da57b[_0x5027('0x64')];_0x4da57b[_0x5027('0x72')]={'mailbox':_0x4da57b[_0x5027('0x64')],'password':_0x4da57b[_0x5027('0x3e')],'fullname':_0x4da57b[_0x5027('0x73')],'email':_0x4da57b[_0x5027('0x74')]};}if(_0x4da57b[_0x5027('0x2a')]==='agent'){if(!_0x4da57b[_0x5027('0x75')])_0x4da57b['permissions']=[_0x5027('0x76'),_0x5027('0x77'),_0x5027('0x78'),_0x5027('0x79'),_0x5027('0x7a'),_0x5027('0x7b'),'105',_0x5027('0x7c'),'107',_0x5027('0x7d'),_0x5027('0x7e'),_0x5027('0x7f'),_0x5027('0x80'),_0x5027('0x81'),_0x5027('0x82')];}_0x38774e(_0x4da57b);}catch(_0xb08cf2){_0x3c87b8(_0xb08cf2);}});}exports[_0x5027('0x83')]=function(_0x554c13,_0x11f7bd){if(_0x554c13[_0x5027('0x2f')][_0x5027('0x2a')]===_0x5027('0x84'))throw new Error('Unauthorized');if(_0x554c13[_0x5027('0x5f')][_0x5027('0x2a')]===_0x5027('0x2f')&&_0x554c13[_0x5027('0x2f')][_0x5027('0x2a')]!==_0x5027('0x85')){throw new Error(_0x5027('0x86'));}if(_0x554c13['body'][_0x5027('0x2a')]==='admin'&&_0x554c13[_0x5027('0x2f')]['role']!==_0x5027('0x85')){throw new Error(_0x5027('0x87'));}return licenseUtil[_0x5027('0x88')]([_0x554c13[_0x5027('0x5f')]])[_0x5027('0x16')](function(){return validateUser(_0x554c13[_0x5027('0x5f')]);})[_0x5027('0x16')](function(_0x3a0983){return updateUser(_0x3a0983)[_0x5027('0x16')](function(_0x375b5d){if(_0x375b5d[_0x5027('0x2a')]===_0x5027('0x85')){_0x375b5d[_0x5027('0x89')]=_0x554c13[_0x5027('0x2f')][_0x5027('0x89')];delete _0x375b5d['userProfileId'];}return _0x375b5d;});})['then'](function(_0x9b6261){return db[_0x5027('0x41')]['create'](_0x9b6261,{'include':[{'model':db[_0x5027('0x72')],'as':_0x5027('0x72')}]});})[_0x5027('0x16')](function(_0x51ebd8){if(_0x554c13[_0x5027('0x5f')][_0x5027('0x2a')]===_0x5027('0x2f'))return _0x51ebd8;if(_0x554c13[_0x5027('0x2f')][_0x5027('0x2a')]!=='user')return _0x51ebd8;return db[_0x5027('0x8a')][_0x5027('0x37')]({'where':{'name':_0x51ebd8['role']===_0x5027('0x84')?'Agents':'Telephones','userProfileId':_0x554c13['user']['userProfileId']},'raw':!![]})['then'](function(_0x4899d1){if(!_0x4899d1||_0x4899d1[_0x5027('0x8b')]!=0x0)return _0x51ebd8;return db[_0x5027('0x8c')][_0x5027('0x83')]({'name':_0x51ebd8[_0x5027('0x38')],'resourceId':_0x51ebd8['id'],'type':_0x4899d1[_0x5027('0x38')],'sectionId':_0x4899d1['id']},{})[_0x5027('0x16')](function(){return _0x51ebd8;});})['catch'](function(_0x4813ef){logger[_0x5027('0x1a')](_0x5027('0x8d'),_0x4813ef);throw _0x4813ef;});})[_0x5027('0x16')](respondWithResult(_0x11f7bd,0xc9))[_0x5027('0x1e')](handleError(_0x11f7bd,null));};exports['bulkCreate']=function(_0x126b3b,_0x25ad74){var _0x1dd3d6=_0x126b3b[_0x5027('0x5f')];var _0x4cff7d=[];if(_0x126b3b[_0x5027('0x2f')]['role']===_0x5027('0x84'))throw new Error(_0x5027('0x8e'));if(_[_0x5027('0x8f')](_0x1dd3d6,[_0x5027('0x2a'),'user'])&&_0x126b3b[_0x5027('0x2f')][_0x5027('0x2a')]!==_0x5027('0x85')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x5027('0x8f')](_0x1dd3d6,['role','admin'])&&_0x126b3b[_0x5027('0x2f')][_0x5027('0x2a')]!==_0x5027('0x85')){throw new Error(_0x5027('0x90'));}return licenseUtil[_0x5027('0x88')](_0x1dd3d6)['then'](function(){return validateUser(_0x1dd3d6[0x0]);})['then'](function(){for(var _0x90b63=0x1;_0x90b63<_0x1dd3d6['length'];_0x90b63++){var _0x1c0626=_0x1dd3d6[_0x90b63-0x1]['internal'];if(!_0x1dd3d6[_0x90b63][_0x5027('0x64')])_0x1dd3d6[_0x90b63][_0x5027('0x64')]=_0x1c0626+0x1;_0x4cff7d[_0x5027('0x48')](validateUser(_0x1dd3d6[_0x90b63]));}return Promise[_0x5027('0x52')](_0x4cff7d);})[_0x5027('0x16')](function(){_0x4cff7d=[];for(var _0xbe3422=0x0;_0xbe3422<_0x1dd3d6[_0x5027('0x4c')];_0xbe3422++){_0x4cff7d[_0x5027('0x48')](updateUser(_0x1dd3d6[_0xbe3422]));}return Promise[_0x5027('0x52')](_0x4cff7d);})['then'](function(){_0x4cff7d=_0x1dd3d6[_0x5027('0x34')](function(_0x5cba){return db[_0x5027('0x41')][_0x5027('0x83')](_0x5cba,{'include':[{'model':db[_0x5027('0x72')],'as':_0x5027('0x72')}]})['then'](function(_0xf07a30){_0x5cba['id']=_0xf07a30['id'];return _0x5cba;});});return Promise[_0x5027('0x52')](_0x4cff7d);})[_0x5027('0x16')](function(_0x2a17aa){if(_0x126b3b[_0x5027('0x5f')]['role']===_0x5027('0x2f'))return _0x2a17aa;if(_0x126b3b['user'][_0x5027('0x2a')]!=='user')return _0x2a17aa;var _0x47cf16=_[_0x5027('0x8f')](_0x2a17aa,function(_0x1083e7){return _0x1083e7[_0x5027('0x2a')]===_0x5027('0x84')||_0x1083e7[_0x5027('0x2a')]===_0x5027('0x31');});if(!_0x47cf16)return _0x2a17aa;return db[_0x5027('0x8a')][_0x5027('0x49')]({'where':{'name':{'$or':['Agents',_0x5027('0x91')]},'userProfileId':_0x126b3b[_0x5027('0x2f')][_0x5027('0x92')]},'raw':!![]})[_0x5027('0x16')](function(_0x2e4155){if(_['isEmpty'](_0x2e4155)||!_[_0x5027('0x8f')](_0x2e4155,[_0x5027('0x8b'),0x0]))return _0x2a17aa;_0x4cff7d=[];var _0x48a43e=_(_0x2e4155)[_0x5027('0x34')](function(_0x441acd){if(_0x441acd[_0x5027('0x8b')]===0x1)return;return _0x441acd[_0x5027('0x38')]===_0x5027('0x30')?_0x5027('0x84'):_0x5027('0x31');})[_0x5027('0x93')]()[_0x5027('0x35')]();for(var _0x2a5360=0x0;_0x2a5360<_0x2a17aa[_0x5027('0x4c')];_0x2a5360++){if(!_['includes'](_0x48a43e,_0x2a17aa[_0x2a5360]['role']))return;var _0x2a2124=_0x2a17aa[_0x2a5360][_0x5027('0x2a')]===_0x5027('0x84')?_0x5027('0x30'):'Telephones';_0x4cff7d[_0x5027('0x48')](db[_0x5027('0x8c')][_0x5027('0x83')]({'name':_0x2a17aa[_0x2a5360][_0x5027('0x38')],'resourceId':_0x2a17aa[_0x2a5360]['id'],'type':_0x2a2124,'sectionId':_['find'](_0x2e4155,[_0x5027('0x38'),_0x2a2124])['id']},{}));}return Promise[_0x5027('0x52')](_0x4cff7d);});})['then'](respondWithResult(_0x25ad74,0xc9))[_0x5027('0x1e')](handleError(_0x25ad74,null));};exports['changePassword']=function(_0x6f9591,_0x462a10){if(_0x6f9591[_0x5027('0x5f')]['id']){delete _0x6f9591['body']['id'];}return db[_0x5027('0x41')]['find']({'where':{'id':_0x6f9591['params']['id']}})[_0x5027('0x16')](function(_0x43aafd){if(!_0x43aafd)return null;if(_0x43aafd['id']===_0x6f9591[_0x5027('0x2f')]['id']){if(!_0x6f9591[_0x5027('0x5f')]['oldPassword']||!_0x6f9591['body']['newPassword']){throw new db[(_0x5027('0x94'))][(_0x5027('0x95'))](_0x5027('0x96'));}if(!_0x43aafd[_0x5027('0x97')](_0x6f9591[_0x5027('0x5f')][_0x5027('0x98')])){throw new db[(_0x5027('0x94'))]['ValidationError'](_0x5027('0x99'));}if(_0x6f9591[_0x5027('0x5f')][_0x5027('0x98')]===_0x6f9591[_0x5027('0x5f')]['newPassword']){throw new db['Sequelize'][(_0x5027('0x95'))](_0x5027('0x9a'));}}else if(_0x6f9591['user'][_0x5027('0x2a')]===_0x5027('0x85')){if(!_0x6f9591[_0x5027('0x5f')]['newPassword']){throw new db[(_0x5027('0x94'))][(_0x5027('0x95'))](_0x5027('0x9b'));}}else if(_0x6f9591[_0x5027('0x2f')]['role']==='user'){if(!_0x6f9591['body']['newPassword']){throw new db[(_0x5027('0x94'))][(_0x5027('0x95'))](_0x5027('0x9b'));}if(_0x43aafd[_0x5027('0x2a')]!=='agent'){throw new db['Sequelize'][(_0x5027('0x95'))](_0x5027('0x8e'));}}else{throw new db[(_0x5027('0x94'))]['ValidationError'](_0x5027('0x8e'));}return _0x43aafd;})[_0x5027('0x16')](handleEntityNotFound(_0x462a10,null))['then'](function(_0x3405b0){return db['Setting'][_0x5027('0x9c')]({'attributes':['id',_0x5027('0x66'),'enforcePasswordHistory',_0x5027('0x9d')]})[_0x5027('0x16')](function(_0x36e865){if(_0x36e865['securePassword'])authService[_0x5027('0x67')](_0x6f9591['body'][_0x5027('0x9e')]);if(!_0x36e865[_0x5027('0x9f')]||!_0x3405b0[_0x5027('0xa0')])return _0x3405b0;authService[_0x5027('0xa1')](_0x6f9591[_0x5027('0x5f')][_0x5027('0x9e')],_0x3405b0[_0x5027('0xa0')],_0x36e865[_0x5027('0x9d')]);return _0x3405b0;})['then'](saveUpdates({'password':_0x6f9591[_0x5027('0x5f')]['newPassword'],'passwordResetAt':_0x6f9591[_0x5027('0x2f')]['id']==_0x6f9591[_0x5027('0x53')]['id']?moment():null,'previousPasswords':authService[_0x5027('0xa2')](_0x6f9591[_0x5027('0x5f')][_0x5027('0x9e')],_0x3405b0[_0x5027('0xa0')])},null));})[_0x5027('0x16')](respondWithResult(_0x462a10,null))['catch'](handleError(_0x462a10,null));};exports['addQueues']=function(_0x548157,_0x58979d){var _0x5b67a0=_0x548157[_0x5027('0x5f')]['channel'];return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x548157[_0x5027('0x53')]['id']},'attributes':['id',_0x5027('0x38'),_0x5027('0x2a'),_0x5027('0xa3'),'loginInPause','voicePause','interface']})['then'](handleEntityNotFound(_0x58979d,null))[_0x5027('0x16')](function(_0x3f1c23){if(_0x3f1c23){if(!utils[_0x5027('0xa4')](_0x5b67a0)){throw new db['Sequelize'][(_0x5027('0x95'))]('Unknown\x20channel');}return _0x3f1c23['add'+_['capitalize'](_0x5b67a0['toLowerCase']())+_0x5027('0xa5')](_0x548157[_0x5027('0x5f')]['ids'],{'penalty':_0x548157[_0x5027('0x5f')][_0x5027('0xa6')]||0x0})['spread'](function(_0x43a50d){for(var _0x534ffc=0x0;_0x534ffc<_0x548157['body'][_0x5027('0x62')][_0x5027('0x4c')];_0x534ffc+=0x1){var _0x4c8f08={'UserId':Number(_0x548157[_0x5027('0x53')]['id'])};_0x4c8f08[_['capitalize'](_0x5b67a0['toLowerCase']())+_0x5027('0xa7')]=Number(_0x548157[_0x5027('0x5f')]['ids'][_0x534ffc]);socket[_0x5027('0xa8')](_0x5027('0x2f')+_['capitalize'](_0x5b67a0[_0x5027('0xa9')]())+_0x5027('0xaa'),_0x4c8f08);}return _0x43a50d;})[_0x5027('0x16')](function(){if(_0x5b67a0===_0x5027('0xab')){return db[_0x5027('0xac')]['findAll']({'where':{'id':_0x548157[_0x5027('0x5f')][_0x5027('0x62')]||[]},'raw':!![],'attributes':['id',_0x5027('0x38')]});}})[_0x5027('0x16')](function(_0x1aea24){var _0x375cbf=_0x3f1c23[_0x5027('0x2d')]({'plain':!![]});var _0x5375f0=[];if(_0x5b67a0===_0x5027('0xab')&&_0x375cbf[_0x5027('0x2a')]===_0x5027('0x84')&&_0x375cbf[_0x5027('0xa3')]){for(let _0x25a52d=0x0;_0x25a52d<_0x1aea24[_0x5027('0x4c')];_0x25a52d+=0x1){_0x5375f0[_0x5027('0x48')]({'membername':_0x375cbf[_0x5027('0x38')],'UserId':_0x375cbf['id'],'queue_name':_0x1aea24[_0x25a52d]['name'],'VoiceQueueId':_0x1aea24[_0x25a52d]['id'],'interface':_[_0x5027('0x6a')](_0x375cbf[_0x5027('0xad')])?util[_0x5027('0xae')](_0x5027('0xaf'),_0x375cbf['name']):_0x375cbf[_0x5027('0xad')],'paused':_0x375cbf['voicePause']||![],'penalty':_0x548157[_0x5027('0x5f')]['penalty']||0x0});}return Promise[_0x5027('0x52')](_0x5375f0['map'](function(_0x1f5307){return db['UserVoiceQueueRt']['upsert'](_0x1f5307);}));}return _0x3f1c23;});}})[_0x5027('0x16')](respondWithStatusCode(_0x58979d,null))[_0x5027('0x1e')](handleError(_0x58979d,null));};exports['removeQueues']=function(_0xafe6cb,_0x4f05ec){var _0x36b16c,_0x2896f8;return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0xafe6cb[_0x5027('0x53')]['id']},'attributes':['id','name',_0x5027('0x2a')]})[_0x5027('0x16')](handleEntityNotFound(_0x4f05ec,null))[_0x5027('0x16')](function(_0x4eac83){if(_0x4eac83){_0x36b16c=_0x4eac83;if(!_0xafe6cb[_0x5027('0x42')][_0x5027('0xb0')]||!utils[_0x5027('0xa4')](_0xafe6cb[_0x5027('0x42')][_0x5027('0xb0')])){throw new db['Sequelize'][(_0x5027('0x95'))](_0x5027('0xb1'));}return _0x4eac83[_0x5027('0xb2')+_[_0x5027('0xb3')](_0xafe6cb[_0x5027('0x42')][_0x5027('0xb0')][_0x5027('0xa9')]())+_0x5027('0xa5')](_0xafe6cb[_0x5027('0x42')][_0x5027('0x62')]);}})['then'](function(_0x197b49){if(_[_0x5027('0xb4')](_0xafe6cb[_0x5027('0x42')][_0x5027('0x62')])){for(var _0x26f376=0x0;_0x26f376<_0xafe6cb[_0x5027('0x42')][_0x5027('0x62')]['length'];_0x26f376+=0x1){_0x2896f8={'UserId':Number(_0xafe6cb[_0x5027('0x53')]['id'])};_0x2896f8[_[_0x5027('0xb3')](_0xafe6cb[_0x5027('0x42')][_0x5027('0xb0')][_0x5027('0xa9')]())+_0x5027('0xa7')]=Number(_0xafe6cb['query'][_0x5027('0x62')][_0x26f376]);socket[_0x5027('0xa8')]('user'+_[_0x5027('0xb3')](_0xafe6cb['query'][_0x5027('0xb0')]['toLowerCase']())+_0x5027('0xb5'),_0x2896f8);}}else{_0x2896f8={'UserId':Number(_0xafe6cb[_0x5027('0x53')]['id'])};_0x2896f8[_['capitalize'](_0xafe6cb[_0x5027('0x42')]['channel'][_0x5027('0xa9')]())+'QueueId']=Number(_0xafe6cb[_0x5027('0x42')][_0x5027('0x62')]);socket['emit'](_0x5027('0x2f')+_[_0x5027('0xb3')](_0xafe6cb[_0x5027('0x42')][_0x5027('0xb0')]['toLowerCase']())+_0x5027('0xb5'),_0x2896f8);}return _0x197b49;})[_0x5027('0x16')](function(){if(_0xafe6cb['query'][_0x5027('0xb0')]===_0x5027('0xab')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0xafe6cb[_0x5027('0x53')]['id'],'VoiceQueueId':_0xafe6cb[_0x5027('0x42')][_0x5027('0x62')]},'individualHooks':!![]})['then'](function(){return _0x36b16c;});}return _0x36b16c;})[_0x5027('0x16')](respondWithStatusCode(_0x4f05ec,null))[_0x5027('0x1e')](handleError(_0x4f05ec,null));};exports[_0x5027('0xb6')]=function(_0x57f491,_0x93a65){_0x57f491[_0x5027('0x5f')][_0x5027('0xb7')]=_0x57f491[_0x5027('0xb8')]['filename'];return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x57f491[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x93a65,null))['then'](saveUpdates(_0x57f491[_0x5027('0x5f')],null))[_0x5027('0x16')](respondWithResult(_0x93a65,null))[_0x5027('0x1e')](handleError(_0x93a65,null));};exports[_0x5027('0xb9')]=function(_0x405677,_0x2a3e8f){var _0x3dc953=path[_0x5027('0xba')](config[_0x5027('0xbb')],_0x5027('0xbc'));return db['User']['find']({'where':{'id':_0x405677[_0x5027('0x53')]['id']},'attributes':['id',_0x5027('0xb7')],'raw':!![]})[_0x5027('0x16')](handleEntityNotFound(_0x2a3e8f,null))[_0x5027('0x16')](function(_0x1a8b33){if(_0x1a8b33){if(_[_0x5027('0x6a')](_0x1a8b33[_0x5027('0xb7')])){return _0x2a3e8f[_0x5027('0xbd')](_0x3dc953);}else{if(!fs['existsSync'](path['join'](config['root'],_0x5027('0xbe'),_0x1a8b33[_0x5027('0xb7')]))){return _0x2a3e8f['download'](_0x3dc953);}return _0x2a3e8f[_0x5027('0xbd')](path['join'](config['root'],_0x5027('0xbe'),_0x1a8b33['userpic']));}}})['catch'](handleError(_0x2a3e8f,null));};exports[_0x5027('0xbf')]=function(_0x31c44e,_0x33a3ca){return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x31c44e['params']['id']},'attributes':['id']})[_0x5027('0x16')](handleEntityNotFound(_0x33a3ca,null))[_0x5027('0x16')](function(_0x897337){var _0x2f4d3c=[];values=_0x897337[_0x5027('0x4e')];_0x2f4d3c[_0x5027('0x48')](get_open_tabs('chat',_0x897337[_0x5027('0x4e')]));_0x2f4d3c[_0x5027('0x48')](get_open_tabs(_0x5027('0x4f'),_0x897337[_0x5027('0x4e')]));_0x2f4d3c[_0x5027('0x48')](get_open_tabs(_0x5027('0x51'),_0x897337[_0x5027('0x4e')]));_0x2f4d3c[_0x5027('0x48')](get_open_tabs(_0x5027('0x5d'),_0x897337[_0x5027('0x4e')]));_0x2f4d3c[_0x5027('0x48')](get_open_tabs(_0x5027('0x5e'),_0x897337['dataValues']));_0x2f4d3c['push'](get_open_tabs(_0x5027('0x50'),_0x897337[_0x5027('0x4e')]));return Promise[_0x5027('0x52')](_0x2f4d3c);})['then'](function(_0x3a6f5e){if(_0x3a6f5e){var _0x12e4be=_[_0x5027('0x34')](values[_0x5027('0xc0')],function(_0x1aa103){return{'channel':'CHAT','id':_0x1aa103['id'],'createdAt':_0x1aa103[_0x5027('0xc1')]};});var _0x190be7=_['map'](values[_0x5027('0xc2')],function(_0x29a803){return{'channel':_0x5027('0xc3'),'id':_0x29a803['id'],'createdAt':_0x29a803['createdAt']};});var _0x477cb3=_['map'](values[_0x5027('0xc4')],function(_0x41b3d6){return{'channel':_0x5027('0xc5'),'id':_0x41b3d6['id'],'createdAt':_0x41b3d6[_0x5027('0xc1')]};});var _0x38d898=_[_0x5027('0x34')](values[_0x5027('0xc6')],function(_0x421ed8){return{'channel':_0x5027('0xc7'),'id':_0x421ed8['id'],'createdAt':_0x421ed8[_0x5027('0xc1')]};});var _0x5f047d=_[_0x5027('0x34')](values[_0x5027('0xc8')],function(_0x55d191){return{'channel':_0x5027('0xc9'),'id':_0x55d191['id'],'createdAt':_0x55d191[_0x5027('0xc1')]};});var _0x2b9ac8=_[_0x5027('0x34')](values[_0x5027('0xca')],function(_0xc8bfa7){return{'channel':_0x5027('0xcb'),'id':_0xc8bfa7['id'],'createdAt':_0xc8bfa7['createdAt']};});var _0x114e4c=_[_0x5027('0xcc')](_0x12e4be,_0x190be7,_0x477cb3,_0x38d898,_0x5f047d,_0x2b9ac8);var _0x5853a9={'count':_0x114e4c['length'],'rows':_0x114e4c};return _0x5853a9;}else return null;})[_0x5027('0x16')](respondWithResult(_0x33a3ca,null))[_0x5027('0x1e')](handleError(_0x33a3ca,null));};exports[_0x5027('0xcd')]=function(_0xf4a823,_0x11cc4d){var _0x184aa5={};var _0x38b8cd={};var _0x1464e5;var _0x2a3bae;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0xf4a823[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x11cc4d,null))[_0x5027('0x16')](function(_0x449a32){if(_0x449a32){_0x1464e5=_0x449a32;_0x38b8cd[_0x5027('0x54')]=_[_0x5027('0x56')](db['CmContact'][_0x5027('0x57')]);_0x38b8cd[_0x5027('0x42')]=_['keys'](_0xf4a823['query']);_0x38b8cd['filters']=_[_0x5027('0x58')](_0x38b8cd[_0x5027('0x54')],_0x38b8cd[_0x5027('0x42')]);_0x184aa5[_0x5027('0x47')]=_[_0x5027('0x58')](_0x38b8cd[_0x5027('0x54')],qs['fields'](_0xf4a823[_0x5027('0x42')]['fields']));_0x184aa5[_0x5027('0x47')]=_0x184aa5[_0x5027('0x47')][_0x5027('0x4c')]?_0x184aa5[_0x5027('0x47')]:_0x38b8cd['model'];_0x184aa5['order']=qs[_0x5027('0xce')](_0xf4a823['query'][_0x5027('0xce')]);_0x184aa5[_0x5027('0x40')]=qs['filters'](_['pick'](_0xf4a823['query'],_0x38b8cd[_0x5027('0xcf')]));if(_0xf4a823[_0x5027('0x42')][_0x5027('0x32')]){_0x184aa5[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x184aa5[_0x5027('0x40')],{'$or':_[_0x5027('0x34')](_0x184aa5['attributes'],function(_0x1664f4){var _0xbe7c2a={};_0xbe7c2a[_0x1664f4]={'$like':'%'+_0xf4a823[_0x5027('0x42')]['filter']+'%'};return _0xbe7c2a;})});}_0x184aa5=_[_0x5027('0x5b')]({},_0x184aa5,_0xf4a823[_0x5027('0x5c')]);return _0x1464e5[_0x5027('0xcd')](_0x184aa5);}})[_0x5027('0x16')](function(_0x60b168){if(_0x60b168){_0x2a3bae=_0x60b168['length'];if(_0xf4a823[_0x5027('0x42')][_0x5027('0xd0')](_0x5027('0x43'))){_0x184aa5[_0x5027('0x44')]=[{'model':db[_0x5027('0xd1')],'as':'List','required':![]},{'model':db[_0x5027('0xd2')],'as':_0x5027('0xd3'),'attributes':['id',_0x5027('0x38'),_0x5027('0xd4')],'where':_0xf4a823[_0x5027('0x42')][_0x5027('0xd5')]?{'id':_0xf4a823[_0x5027('0x42')][_0x5027('0xd5')]}:undefined,'required':_0xf4a823['query'][_0x5027('0xd5')]?!![]:![]}];}if(!_0xf4a823[_0x5027('0x42')][_0x5027('0xd0')](_0x5027('0xd6'))){_0x184aa5[_0x5027('0x25')]=qs[_0x5027('0x25')](_0xf4a823[_0x5027('0x42')][_0x5027('0x25')]);_0x184aa5[_0x5027('0x23')]=qs[_0x5027('0x23')](_0xf4a823['query']['offset']);}return _0x1464e5[_0x5027('0xcd')](_0x184aa5);}})['then'](function(_0x4b5ccf){if(_0x4b5ccf){return _0x4b5ccf?{'count':_0x2a3bae,'rows':_0x4b5ccf}:null;}})[_0x5027('0x16')](respondWithResult(_0x11cc4d,null))[_0x5027('0x1e')](handleError(_0x11cc4d,null));};exports[_0x5027('0xd7')]=function(_0x314d12,_0x1d8dfe){var _0x13c2da;var _0x5b5741={};var _0x56b1a2;return db['User'][_0x5027('0x9c')]({'where':{'id':_0x314d12[_0x5027('0x53')]['id']},'attributes':['id',_0x5027('0x38'),_0x5027('0x2a')]})[_0x5027('0x16')](handleEntityNotFound(_0x1d8dfe,null))[_0x5027('0x16')](function(_0x3d3fdf){if(!utils[_0x5027('0xa4')](_0x314d12['query']['channel'])){throw new db[(_0x5027('0x94'))]['ValidationError'](_0x5027('0xb1'));}_0x13c2da=_0x3d3fdf;var _0x2f4a58={};_0x2f4a58[_0x5027('0x54')]=_[_0x5027('0x56')](db[_[_0x5027('0xb3')](_0x314d12['query'][_0x5027('0xb0')])+'Queue'][_0x5027('0x57')]);_0x2f4a58[_0x5027('0x42')]=_[_0x5027('0x56')](_0x314d12[_0x5027('0x42')]);_0x2f4a58['filters']=_['intersection'](_0x2f4a58[_0x5027('0x54')],_0x2f4a58[_0x5027('0x42')]);_0x5b5741['attributes']=_[_0x5027('0x58')](_0x2f4a58['model'],qs[_0x5027('0x59')](_0x314d12['query'][_0x5027('0x59')]));_0x5b5741[_0x5027('0x47')]=_0x5b5741[_0x5027('0x47')][_0x5027('0x4c')]?_0x5b5741[_0x5027('0x47')]:_0x2f4a58[_0x5027('0x54')];_0x5b5741['order']=qs[_0x5027('0xce')](_0x314d12[_0x5027('0x42')][_0x5027('0xce')]);_0x5b5741[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x314d12['query'],_0x2f4a58[_0x5027('0xcf')]));if(_0x314d12['query']['filter']){_0x5b5741[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x5b5741['where'],{'$or':_['map'](_0x5b5741[_0x5027('0x47')],function(_0x3df77b){var _0x4faf9a={};_0x4faf9a[_0x3df77b]={'$like':'%'+_0x314d12['query'][_0x5027('0x32')]+'%'};return _0x4faf9a;})});}_0x5b5741=_['merge']({},_0x5b5741,_0x314d12[_0x5027('0x5c')]);switch(_0x13c2da['role']){case'admin':return db[_['capitalize'](_0x314d12[_0x5027('0x42')][_0x5027('0xb0')])+_0x5027('0xd9')]['findAll'](_0x5b5741);case _0x5027('0x2f'):case'agent':return _0x13c2da['get'+_['capitalize'](_0x314d12['query']['channel'])+_0x5027('0xa5')](_0x5b5741);default:throw new db['Sequelize'][(_0x5027('0x95'))](_0x5027('0xda'));}})[_0x5027('0x16')](function(_0x934677){_0x56b1a2=_0x934677[_0x5027('0x4c')];if(!_0x314d12[_0x5027('0x42')][_0x5027('0xd0')](_0x5027('0xd6'))){_0x5b5741['limit']=qs[_0x5027('0x25')](_0x314d12[_0x5027('0x42')][_0x5027('0x25')]);_0x5b5741[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x314d12['query'][_0x5027('0x23')]);}switch(_0x13c2da[_0x5027('0x2a')]){case _0x5027('0x85'):return db[_[_0x5027('0xb3')](_0x314d12[_0x5027('0x42')][_0x5027('0xb0')])+'Queue'][_0x5027('0x49')](_0x5b5741);case'user':case _0x5027('0x84'):return _0x13c2da[_0x5027('0x2d')+_[_0x5027('0xb3')](_0x314d12[_0x5027('0x42')]['channel'])+_0x5027('0xa5')](_0x5b5741);}})[_0x5027('0x16')](function(_0x2b069a){return{'count':_0x56b1a2,'rows':_0x2b069a};})[_0x5027('0x16')](respondWithResult(_0x1d8dfe,null))['catch'](handleError(_0x1d8dfe,null));};exports['getVoiceQueuesRt']=function(_0x2211bc,_0x2dea77){var _0x5a8372={};var _0x1a7e16={};var _0x463c70;var _0x23973f;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x2211bc[_0x5027('0x53')]['id']}})['then'](handleEntityNotFound(_0x2dea77,null))[_0x5027('0x16')](function(_0x1c6288){if(_0x1c6288){_0x463c70=_0x1c6288;_0x1a7e16[_0x5027('0x54')]=_['keys'](db[_0x5027('0xdb')][_0x5027('0x57')]);_0x1a7e16['query']=_[_0x5027('0x56')](_0x2211bc[_0x5027('0x42')]);_0x1a7e16[_0x5027('0xcf')]=_[_0x5027('0x58')](_0x1a7e16[_0x5027('0x54')],_0x1a7e16[_0x5027('0x42')]);_0x5a8372['attributes']=_['intersection'](_0x1a7e16[_0x5027('0x54')],qs[_0x5027('0x59')](_0x2211bc[_0x5027('0x42')][_0x5027('0x59')]));_0x5a8372[_0x5027('0x47')]=_0x5a8372[_0x5027('0x47')][_0x5027('0x4c')]?_0x5a8372[_0x5027('0x47')]:_0x1a7e16[_0x5027('0x54')];_0x5a8372[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x2211bc['query'][_0x5027('0xce')]);_0x5a8372[_0x5027('0x40')]=qs['filters'](_[_0x5027('0xd8')](_0x2211bc[_0x5027('0x42')],_0x1a7e16[_0x5027('0xcf')]));if(_0x2211bc[_0x5027('0x42')]['filter']){_0x5a8372[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x5a8372[_0x5027('0x40')],{'$or':_['map'](_0x5a8372['attributes'],function(_0x2763bd){var _0x394998={};_0x394998[_0x2763bd]={'$like':'%'+_0x2211bc[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x394998;})});}_0x5a8372=_[_0x5027('0x5b')]({},_0x5a8372,_0x2211bc[_0x5027('0x5c')]);return _0x463c70[_0x5027('0xdd')](_0x5a8372);}})[_0x5027('0x16')](function(_0x1a42d3){if(_0x1a42d3){_0x23973f=_0x1a42d3[_0x5027('0x4c')];if(!_0x2211bc['query']['hasOwnProperty'](_0x5027('0xd6'))){_0x5a8372[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x2211bc[_0x5027('0x42')][_0x5027('0x25')]);_0x5a8372['offset']=qs[_0x5027('0x23')](_0x2211bc[_0x5027('0x42')][_0x5027('0x23')]);}return _0x463c70[_0x5027('0xdd')](_0x5a8372);}})[_0x5027('0x16')](function(_0x542bb9){if(_0x542bb9){return _0x542bb9?{'count':_0x23973f,'rows':_0x542bb9}:null;}})[_0x5027('0x16')](respondWithResult(_0x2dea77,null))[_0x5027('0x1e')](handleError(_0x2dea77,null));};exports[_0x5027('0xde')]=function(_0x11d446,_0x133b7f){var _0x4ced29={};var _0x301de3={};var _0x405f4a;var _0x476e29;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x11d446[_0x5027('0x53')]['id']}})['then'](handleEntityNotFound(_0x133b7f,null))[_0x5027('0x16')](function(_0x268751){if(_0x268751){_0x405f4a=_0x268751;_0x301de3['model']=_['keys'](db[_0x5027('0xdf')][_0x5027('0x57')]);_0x301de3[_0x5027('0x42')]=_[_0x5027('0x56')](_0x11d446[_0x5027('0x42')]);_0x301de3['filters']=_[_0x5027('0x58')](_0x301de3['model'],_0x301de3[_0x5027('0x42')]);_0x4ced29[_0x5027('0x47')]=_[_0x5027('0x58')](_0x301de3[_0x5027('0x54')],qs[_0x5027('0x59')](_0x11d446[_0x5027('0x42')][_0x5027('0x59')]));_0x4ced29[_0x5027('0x47')]=_0x4ced29[_0x5027('0x47')][_0x5027('0x4c')]?_0x4ced29[_0x5027('0x47')]:_0x301de3[_0x5027('0x54')];_0x4ced29['order']=qs[_0x5027('0xce')](_0x11d446[_0x5027('0x42')][_0x5027('0xce')]);_0x4ced29[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x11d446[_0x5027('0x42')],_0x301de3[_0x5027('0xcf')]));if(_0x11d446['query'][_0x5027('0x32')]){_0x4ced29['where']=_[_0x5027('0x5b')](_0x4ced29[_0x5027('0x40')],{'$or':_['map'](_0x4ced29[_0x5027('0x47')],function(_0xee7c55){var _0x42aa90={};_0x42aa90[_0xee7c55]={'$like':'%'+_0x11d446[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x42aa90;})});}_0x4ced29=_[_0x5027('0x5b')]({},_0x4ced29,_0x11d446['options']);return _0x405f4a[_0x5027('0xde')](_0x4ced29);}})[_0x5027('0x16')](function(_0x42312e){if(_0x42312e){_0x476e29=_0x42312e[_0x5027('0x4c')];if(!_0x11d446[_0x5027('0x42')]['hasOwnProperty'](_0x5027('0xd6'))){_0x4ced29[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x11d446[_0x5027('0x42')][_0x5027('0x25')]);_0x4ced29[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x11d446[_0x5027('0x42')][_0x5027('0x23')]);}return _0x405f4a['getGroups'](_0x4ced29);}})[_0x5027('0x16')](function(_0xbe0bd7){if(_0xbe0bd7){return _0xbe0bd7?{'count':_0x476e29,'rows':_0xbe0bd7}:null;}})[_0x5027('0x16')](respondWithResult(_0x133b7f,null))[_0x5027('0x1e')](handleError(_0x133b7f,null));};exports[_0x5027('0xe0')]=function(_0x273fb1,_0x42c7fe){var _0x5cf01f={'raw':!![],'where':{}};var _0x3f91ff={};var _0x24f8e7={'count':0x0,'rows':[]};return db[_0x5027('0x41')]['findOne']({'where':{'id':_0x273fb1[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x42c7fe,null))['then'](function(_0x8089e2){if(_0x8089e2){_0x3f91ff[_0x5027('0x54')]=_[_0x5027('0x56')](db[_0x5027('0xe1')][_0x5027('0x57')]);_0x3f91ff['query']=_['keys'](_0x273fb1['query']);_0x3f91ff['filters']=_[_0x5027('0x58')](_0x3f91ff[_0x5027('0x54')],_0x3f91ff[_0x5027('0x42')]);_0x5cf01f[_0x5027('0x47')]=_[_0x5027('0x58')](_0x3f91ff[_0x5027('0x54')],qs[_0x5027('0x59')](_0x273fb1[_0x5027('0x42')]['fields']));_0x5cf01f['attributes']=_0x5cf01f[_0x5027('0x47')][_0x5027('0x4c')]?_0x5cf01f[_0x5027('0x47')]:_0x3f91ff[_0x5027('0x54')];if(!_0x273fb1['query'][_0x5027('0xd0')]('nolimit')){_0x5cf01f['limit']=qs[_0x5027('0x25')](_0x273fb1['query']['limit']);_0x5cf01f[_0x5027('0x23')]=qs['offset'](_0x273fb1['query']['offset']);}_0x5cf01f['order']=qs['sort'](_0x273fb1[_0x5027('0x42')]['sort']);_0x5cf01f[_0x5027('0x40')]=qs[_0x5027('0xcf')](_['pick'](_0x273fb1[_0x5027('0x42')],_0x3f91ff[_0x5027('0xcf')]));_0x5cf01f['where']['UserId']=_0x8089e2['id'];if(_0x273fb1[_0x5027('0x42')]['filter']){_0x5cf01f[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x5cf01f[_0x5027('0x40')],{'$or':_['map'](_0x5cf01f[_0x5027('0x47')],function(_0x5748d2){var _0x1bf0c2={};_0x1bf0c2[_0x5748d2]={'$like':'%'+_0x273fb1[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x1bf0c2;})});}_0x5cf01f=_[_0x5027('0x5b')]({},_0x5cf01f,_0x273fb1['options']);return db[_0x5027('0xe1')][_0x5027('0x26')]({'where':_0x5cf01f[_0x5027('0x40')]})[_0x5027('0x16')](function(_0x5a057d){_0x24f8e7[_0x5027('0x26')]=_0x5a057d;if(_0x273fb1[_0x5027('0x42')]['includeAll']){_0x5cf01f[_0x5027('0x44')]=[{'all':!![]}];}return db[_0x5027('0xe1')]['findAll'](_0x5cf01f);})[_0x5027('0x16')](function(_0x1b5779){_0x24f8e7[_0x5027('0x4a')]=_0x1b5779;return _0x24f8e7;});}})['then'](respondWithFilteredResult(_0x42c7fe,_0x5cf01f))[_0x5027('0x1e')](handleError(_0x42c7fe,null));};exports[_0x5027('0xe2')]=function(_0x3bdef2,_0x49f719){var _0x523dbf={'raw':!![],'where':{}};var _0xbc011f={};var _0x5e634c={'count':0x0,'rows':[]};return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x3bdef2[_0x5027('0x53')]['id']}})['then'](handleEntityNotFound(_0x49f719,null))[_0x5027('0x16')](function(_0x1ef313){if(_0x1ef313){_0xbc011f['model']=_[_0x5027('0x56')](db['ScreenRecording'][_0x5027('0x57')]);_0xbc011f[_0x5027('0x42')]=_['keys'](_0x3bdef2['query']);_0xbc011f[_0x5027('0xcf')]=_[_0x5027('0x58')](_0xbc011f[_0x5027('0x54')],_0xbc011f[_0x5027('0x42')]);_0x523dbf[_0x5027('0x47')]=_['intersection'](_0xbc011f[_0x5027('0x54')],qs[_0x5027('0x59')](_0x3bdef2[_0x5027('0x42')][_0x5027('0x59')]));_0x523dbf[_0x5027('0x47')]=_0x523dbf['attributes'][_0x5027('0x4c')]?_0x523dbf[_0x5027('0x47')]:_0xbc011f['model'];if(!_0x3bdef2[_0x5027('0x42')][_0x5027('0xd0')]('nolimit')){_0x523dbf[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x3bdef2[_0x5027('0x42')][_0x5027('0x25')]);_0x523dbf[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x3bdef2[_0x5027('0x42')]['offset']);}_0x523dbf[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x3bdef2['query'][_0x5027('0xce')]);_0x523dbf[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x3bdef2['query'],_0xbc011f[_0x5027('0xcf')]));_0x523dbf[_0x5027('0x40')][_0x5027('0xe3')]=_0x1ef313['id'];if(_0x3bdef2[_0x5027('0x42')]['filter']){_0x523dbf[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x523dbf[_0x5027('0x40')],{'$or':_[_0x5027('0x34')](_0x523dbf[_0x5027('0x47')],function(_0x35d849){var _0x4c2844={};_0x4c2844[_0x35d849]={'$like':'%'+_0x3bdef2[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x4c2844;})});}_0x523dbf=_[_0x5027('0x5b')]({},_0x523dbf,_0x3bdef2[_0x5027('0x5c')]);return db[_0x5027('0xe4')][_0x5027('0x26')]({'where':_0x523dbf[_0x5027('0x40')]})[_0x5027('0x16')](function(_0x351388){_0x5e634c['count']=_0x351388;if(_0x3bdef2[_0x5027('0x42')][_0x5027('0x43')]){_0x523dbf[_0x5027('0x44')]=[{'all':!![]}];}return db[_0x5027('0xe4')][_0x5027('0x49')](_0x523dbf);})[_0x5027('0x16')](function(_0x3f7137){_0x5e634c[_0x5027('0x4a')]=_0x3f7137;return _0x5e634c;});}})[_0x5027('0x16')](respondWithFilteredResult(_0x49f719,_0x523dbf))['catch'](handleError(_0x49f719,null));};exports[_0x5027('0xe5')]=function(_0x18a3da,_0x2dbd76){var _0x3b698d={};var _0x27cfa0={};var _0x565ed7;var _0x54e924;return db['User'][_0x5027('0x9c')]({'where':{'id':_0x18a3da[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x2dbd76,null))['then'](function(_0x4f3ed0){if(_0x4f3ed0){_0x565ed7=_0x4f3ed0;_0x27cfa0[_0x5027('0x54')]=_[_0x5027('0x56')](db['ChatInteraction']['rawAttributes']);_0x27cfa0[_0x5027('0x42')]=_[_0x5027('0x56')](_0x18a3da['query']);_0x27cfa0[_0x5027('0xcf')]=_[_0x5027('0x58')](_0x27cfa0[_0x5027('0x54')],_0x27cfa0['query']);_0x3b698d[_0x5027('0x47')]=_[_0x5027('0x58')](_0x27cfa0[_0x5027('0x54')],qs['fields'](_0x18a3da[_0x5027('0x42')]['fields']));_0x3b698d[_0x5027('0x47')]=_0x3b698d[_0x5027('0x47')][_0x5027('0x4c')]?_0x3b698d[_0x5027('0x47')]:_0x27cfa0[_0x5027('0x54')];_0x3b698d[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x18a3da[_0x5027('0x42')][_0x5027('0xce')]);_0x3b698d[_0x5027('0x40')]=qs['filters'](_['pick'](_0x18a3da[_0x5027('0x42')],_0x27cfa0[_0x5027('0xcf')]));if(_0x18a3da[_0x5027('0x42')][_0x5027('0x32')]){_0x3b698d[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x3b698d[_0x5027('0x40')],{'$or':_[_0x5027('0x34')](_0x3b698d['attributes'],function(_0x27b382){var _0x63d19c={};_0x63d19c[_0x27b382]={'$like':'%'+_0x18a3da[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x63d19c;})});}_0x3b698d=_['merge']({},_0x3b698d,_0x18a3da[_0x5027('0x5c')]);return _0x565ed7[_0x5027('0xe5')](_0x3b698d);}})['then'](function(_0x5bf77e){if(_0x5bf77e){_0x54e924=_0x5bf77e['length'];if(!_0x18a3da[_0x5027('0x42')][_0x5027('0xd0')]('nolimit')){_0x3b698d[_0x5027('0x25')]=qs['limit'](_0x18a3da[_0x5027('0x42')][_0x5027('0x25')]);_0x3b698d[_0x5027('0x23')]=qs['offset'](_0x18a3da[_0x5027('0x42')][_0x5027('0x23')]);}return _0x565ed7[_0x5027('0xe5')](_0x3b698d);}})[_0x5027('0x16')](function(_0x2fdcb5){if(_0x2fdcb5){return _0x2fdcb5?{'count':_0x54e924,'rows':_0x2fdcb5}:null;}})[_0x5027('0x16')](respondWithResult(_0x2dbd76,null))[_0x5027('0x1e')](handleError(_0x2dbd76,null));};exports[_0x5027('0xe6')]=function(_0x2882b0,_0x53cbd8){var _0x3c7846={};var _0x3f3af4={};var _0x10c248;var _0x22084c;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x2882b0[_0x5027('0x53')]['id']}})['then'](handleEntityNotFound(_0x53cbd8,null))[_0x5027('0x16')](function(_0xf846b4){if(_0xf846b4){_0x10c248=_0xf846b4;_0x3f3af4['model']=_['keys'](db[_0x5027('0xe7')]['rawAttributes']);_0x3f3af4['query']=_[_0x5027('0x56')](_0x2882b0[_0x5027('0x42')]);_0x3f3af4[_0x5027('0xcf')]=_[_0x5027('0x58')](_0x3f3af4[_0x5027('0x54')],_0x3f3af4[_0x5027('0x42')]);_0x3c7846['attributes']=_[_0x5027('0x58')](_0x3f3af4[_0x5027('0x54')],qs[_0x5027('0x59')](_0x2882b0[_0x5027('0x42')][_0x5027('0x59')]));_0x3c7846['attributes']=_0x3c7846[_0x5027('0x47')][_0x5027('0x4c')]?_0x3c7846[_0x5027('0x47')]:_0x3f3af4[_0x5027('0x54')];_0x3c7846[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x2882b0[_0x5027('0x42')]['sort']);_0x3c7846[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x2882b0['query'],_0x3f3af4[_0x5027('0xcf')]));if(_0x2882b0['query'][_0x5027('0x32')]){_0x3c7846[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x3c7846['where'],{'$or':_['map'](_0x3c7846[_0x5027('0x47')],function(_0x3aa8ee){var _0x29f235={};_0x29f235[_0x3aa8ee]={'$like':'%'+_0x2882b0[_0x5027('0x42')]['filter']+'%'};return _0x29f235;})});}_0x3c7846=_[_0x5027('0x5b')]({},_0x3c7846,_0x2882b0[_0x5027('0x5c')]);return _0x10c248[_0x5027('0xe6')](_0x3c7846);}})['then'](function(_0x3e7969){if(_0x3e7969){_0x22084c=_0x3e7969[_0x5027('0x4c')];if(!_0x2882b0[_0x5027('0x42')]['hasOwnProperty'](_0x5027('0xd6'))){_0x3c7846['limit']=qs[_0x5027('0x25')](_0x2882b0[_0x5027('0x42')][_0x5027('0x25')]);_0x3c7846[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x2882b0['query'][_0x5027('0x23')]);}return _0x10c248[_0x5027('0xe6')](_0x3c7846);}})[_0x5027('0x16')](function(_0x4d2388){if(_0x4d2388){return _0x4d2388?{'count':_0x22084c,'rows':_0x4d2388}:null;}})[_0x5027('0x16')](respondWithResult(_0x53cbd8,null))[_0x5027('0x1e')](handleError(_0x53cbd8,null));};exports[_0x5027('0xe8')]=function(_0x323c5e,_0x5b5407){var _0x4d13da={'raw':!![],'where':{}};var _0x1e706c={};var _0x5206c1={'count':0x0,'rows':[]};return db[_0x5027('0x41')]['findOne']({'where':{'id':_0x323c5e[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x5b5407,null))['then'](function(_0x5c42f1){if(_0x5c42f1){_0x1e706c[_0x5027('0x54')]=_['keys'](db[_0x5027('0xe9')][_0x5027('0x57')]);_0x1e706c[_0x5027('0x42')]=_['keys'](_0x323c5e[_0x5027('0x42')]);_0x1e706c['filters']=_[_0x5027('0x58')](_0x1e706c[_0x5027('0x54')],_0x1e706c['query']);_0x4d13da[_0x5027('0x47')]=_[_0x5027('0x58')](_0x1e706c['model'],qs[_0x5027('0x59')](_0x323c5e[_0x5027('0x42')][_0x5027('0x59')]));_0x4d13da[_0x5027('0x47')]=_0x4d13da[_0x5027('0x47')][_0x5027('0x4c')]?_0x4d13da[_0x5027('0x47')]:_0x1e706c[_0x5027('0x54')];if(!_0x323c5e[_0x5027('0x42')][_0x5027('0xd0')](_0x5027('0xd6'))){_0x4d13da[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x323c5e['query'][_0x5027('0x25')]);_0x4d13da[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x323c5e['query']['offset']);}_0x4d13da['order']=qs[_0x5027('0xce')](_0x323c5e[_0x5027('0x42')][_0x5027('0xce')]);_0x4d13da['where']=qs[_0x5027('0xcf')](_['pick'](_0x323c5e[_0x5027('0x42')],_0x1e706c[_0x5027('0xcf')]));_0x4d13da[_0x5027('0x40')][_0x5027('0xe3')]=_0x5c42f1['id'];if(_0x323c5e[_0x5027('0x42')][_0x5027('0x32')]){_0x4d13da[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x4d13da[_0x5027('0x40')],{'$or':_[_0x5027('0x34')](_0x4d13da[_0x5027('0x47')],function(_0xe12796){var _0x11683d={};_0x11683d[_0xe12796]={'$like':'%'+_0x323c5e[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x11683d;})});}_0x4d13da=_[_0x5027('0x5b')]({},_0x4d13da,_0x323c5e[_0x5027('0x5c')]);return db[_0x5027('0xe9')][_0x5027('0x26')]({'where':_0x4d13da[_0x5027('0x40')]})[_0x5027('0x16')](function(_0x173c52){_0x5206c1['count']=_0x173c52;if(_0x323c5e['query'][_0x5027('0x43')]){_0x4d13da[_0x5027('0x44')]=[{'all':!![]}];}return db[_0x5027('0xe9')][_0x5027('0x49')](_0x4d13da);})[_0x5027('0x16')](function(_0x151530){_0x5206c1[_0x5027('0x4a')]=_0x151530;return _0x5206c1;});}})['then'](respondWithFilteredResult(_0x5b5407,_0x4d13da))[_0x5027('0x1e')](handleError(_0x5b5407,null));};exports[_0x5027('0xea')]=function(_0x56b03e,_0xcacf72){var _0x3a366a={};var _0x4cd733={};var _0x5a5502;var _0x54731d;return db['User']['findOne']({'where':{'id':_0x56b03e[_0x5027('0x53')]['id']}})[_0x5027('0x16')](handleEntityNotFound(_0xcacf72,null))[_0x5027('0x16')](function(_0x26ebba){if(_0x26ebba){_0x5a5502=_0x26ebba;_0x4cd733['model']=_[_0x5027('0x56')](db['SmsInteraction'][_0x5027('0x57')]);_0x4cd733[_0x5027('0x42')]=_[_0x5027('0x56')](_0x56b03e[_0x5027('0x42')]);_0x4cd733[_0x5027('0xcf')]=_[_0x5027('0x58')](_0x4cd733[_0x5027('0x54')],_0x4cd733[_0x5027('0x42')]);_0x3a366a[_0x5027('0x47')]=_['intersection'](_0x4cd733[_0x5027('0x54')],qs[_0x5027('0x59')](_0x56b03e[_0x5027('0x42')]['fields']));_0x3a366a[_0x5027('0x47')]=_0x3a366a['attributes'][_0x5027('0x4c')]?_0x3a366a['attributes']:_0x4cd733[_0x5027('0x54')];_0x3a366a[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x56b03e[_0x5027('0x42')][_0x5027('0xce')]);_0x3a366a[_0x5027('0x40')]=qs[_0x5027('0xcf')](_['pick'](_0x56b03e[_0x5027('0x42')],_0x4cd733['filters']));if(_0x56b03e[_0x5027('0x42')]['filter']){_0x3a366a['where']=_['merge'](_0x3a366a['where'],{'$or':_['map'](_0x3a366a[_0x5027('0x47')],function(_0x3bb0ad){var _0x1b2770={};_0x1b2770[_0x3bb0ad]={'$like':'%'+_0x56b03e[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x1b2770;})});}_0x3a366a=_['merge']({},_0x3a366a,_0x56b03e['options']);return _0x5a5502['getSmsInteractions'](_0x3a366a);}})[_0x5027('0x16')](function(_0x408cd3){if(_0x408cd3){_0x54731d=_0x408cd3[_0x5027('0x4c')];if(!_0x56b03e['query'][_0x5027('0xd0')](_0x5027('0xd6'))){_0x3a366a['limit']=qs[_0x5027('0x25')](_0x56b03e[_0x5027('0x42')][_0x5027('0x25')]);_0x3a366a[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x56b03e['query'][_0x5027('0x23')]);}return _0x5a5502[_0x5027('0xea')](_0x3a366a);}})['then'](function(_0x58256f){if(_0x58256f){return _0x58256f?{'count':_0x54731d,'rows':_0x58256f}:null;}})['then'](respondWithResult(_0xcacf72,null))[_0x5027('0x1e')](handleError(_0xcacf72,null));};exports[_0x5027('0xeb')]=function(_0x59bdec,_0x3456b2){var _0xb93ab4={};var _0x29b967={};var _0x1c3aa3;var _0x7b03b;return db['User'][_0x5027('0x9c')]({'where':{'id':_0x59bdec['params']['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x3456b2,null))['then'](function(_0x385f1b){if(_0x385f1b){_0x1c3aa3=_0x385f1b;_0x29b967[_0x5027('0x54')]=_[_0x5027('0x56')](db['FaxInteraction']['rawAttributes']);_0x29b967[_0x5027('0x42')]=_[_0x5027('0x56')](_0x59bdec['query']);_0x29b967[_0x5027('0xcf')]=_['intersection'](_0x29b967[_0x5027('0x54')],_0x29b967[_0x5027('0x42')]);_0xb93ab4[_0x5027('0x47')]=_[_0x5027('0x58')](_0x29b967[_0x5027('0x54')],qs['fields'](_0x59bdec[_0x5027('0x42')][_0x5027('0x59')]));_0xb93ab4[_0x5027('0x47')]=_0xb93ab4[_0x5027('0x47')][_0x5027('0x4c')]?_0xb93ab4[_0x5027('0x47')]:_0x29b967[_0x5027('0x54')];_0xb93ab4[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x59bdec[_0x5027('0x42')]['sort']);_0xb93ab4['where']=qs[_0x5027('0xcf')](_['pick'](_0x59bdec[_0x5027('0x42')],_0x29b967[_0x5027('0xcf')]));if(_0x59bdec['query'][_0x5027('0x32')]){_0xb93ab4[_0x5027('0x40')]=_[_0x5027('0x5b')](_0xb93ab4[_0x5027('0x40')],{'$or':_['map'](_0xb93ab4['attributes'],function(_0x4e015c){var _0x1743f8={};_0x1743f8[_0x4e015c]={'$like':'%'+_0x59bdec[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x1743f8;})});}_0xb93ab4=_[_0x5027('0x5b')]({},_0xb93ab4,_0x59bdec[_0x5027('0x5c')]);return _0x1c3aa3[_0x5027('0xeb')](_0xb93ab4);}})[_0x5027('0x16')](function(_0x1c6176){if(_0x1c6176){_0x7b03b=_0x1c6176['length'];if(!_0x59bdec[_0x5027('0x42')][_0x5027('0xd0')]('nolimit')){_0xb93ab4[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x59bdec[_0x5027('0x42')][_0x5027('0x25')]);_0xb93ab4[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x59bdec[_0x5027('0x42')]['offset']);}return _0x1c3aa3[_0x5027('0xeb')](_0xb93ab4);}})[_0x5027('0x16')](function(_0x1effb0){if(_0x1effb0){return _0x1effb0?{'count':_0x7b03b,'rows':_0x1effb0}:null;}})[_0x5027('0x16')](respondWithResult(_0x3456b2,null))[_0x5027('0x1e')](handleError(_0x3456b2,null));};exports[_0x5027('0xec')]=function(_0x4bddd0,_0x4d25b4){var _0x21d1c5={};var _0x4b7a97={};var _0x15320c;var _0x3bc43f;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x4bddd0['params']['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x4d25b4,null))[_0x5027('0x16')](function(_0x91ad4b){if(_0x91ad4b){_0x15320c=_0x91ad4b;_0x4b7a97[_0x5027('0x54')]=_['keys'](db['WhatsappInteraction'][_0x5027('0x57')]);_0x4b7a97[_0x5027('0x42')]=_['keys'](_0x4bddd0['query']);_0x4b7a97[_0x5027('0xcf')]=_[_0x5027('0x58')](_0x4b7a97[_0x5027('0x54')],_0x4b7a97[_0x5027('0x42')]);_0x21d1c5[_0x5027('0x47')]=_[_0x5027('0x58')](_0x4b7a97[_0x5027('0x54')],qs[_0x5027('0x59')](_0x4bddd0[_0x5027('0x42')]['fields']));_0x21d1c5['attributes']=_0x21d1c5[_0x5027('0x47')][_0x5027('0x4c')]?_0x21d1c5['attributes']:_0x4b7a97['model'];_0x21d1c5['order']=qs[_0x5027('0xce')](_0x4bddd0[_0x5027('0x42')][_0x5027('0xce')]);_0x21d1c5[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x4bddd0[_0x5027('0x42')],_0x4b7a97[_0x5027('0xcf')]));if(_0x4bddd0['query'][_0x5027('0x32')]){_0x21d1c5[_0x5027('0x40')]=_[_0x5027('0x5b')](_0x21d1c5[_0x5027('0x40')],{'$or':_[_0x5027('0x34')](_0x21d1c5[_0x5027('0x47')],function(_0x10692a){var _0x31d766={};_0x31d766[_0x10692a]={'$like':'%'+_0x4bddd0[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0x31d766;})});}_0x21d1c5=_[_0x5027('0x5b')]({},_0x21d1c5,_0x4bddd0[_0x5027('0x5c')]);return _0x15320c[_0x5027('0xec')](_0x21d1c5);}})[_0x5027('0x16')](function(_0x18fff2){if(_0x18fff2){_0x3bc43f=_0x18fff2['length'];if(!_0x4bddd0['query'][_0x5027('0xd0')](_0x5027('0xd6'))){_0x21d1c5[_0x5027('0x25')]=qs['limit'](_0x4bddd0[_0x5027('0x42')][_0x5027('0x25')]);_0x21d1c5[_0x5027('0x23')]=qs['offset'](_0x4bddd0[_0x5027('0x42')][_0x5027('0x23')]);}return _0x15320c[_0x5027('0xec')](_0x21d1c5);}})[_0x5027('0x16')](function(_0x2461f2){if(_0x2461f2){return _0x2461f2?{'count':_0x3bc43f,'rows':_0x2461f2}:null;}})['then'](respondWithResult(_0x4d25b4,null))['catch'](handleError(_0x4d25b4,null));};exports[_0x5027('0xed')]=function(_0x42ee5c,_0x5e354f,_0x377f15){var _0x8c6fd9;var _0x24e25d;var _0x1b0e01;var _0x25f002=!_['isNil'](_0x42ee5c[_0x5027('0x53')]['id'])?_0x42ee5c['params']['id']:!_[_0x5027('0x6a')](_0x42ee5c[_0x5027('0x2f')]['id'])?_0x42ee5c[_0x5027('0x2f')]['id']:null;return db[_0x5027('0x41')]['find']({'where':{'id':_0x25f002,'role':{'$or':[_0x5027('0x85'),_0x5027('0x2f'),'agent']}},'attributes':['id','name','phone','mobile',_0x5027('0x2a'),'internal','loginInPause']})[_0x5027('0x16')](function(_0x392638){if(_0x392638){if(_0x392638[_0x5027('0x2a')]===_0x5027('0x84')){_0x8c6fd9=_0x392638;if(_0x42ee5c[_0x5027('0x5f')][_0x5027('0xad')]){_0x1b0e01=util[_0x5027('0xae')](_0x5027('0xee'),_0x8c6fd9[_0x42ee5c['body'][_0x5027('0xad')]]);}else if(_0x42ee5c[_0x5027('0x5f')][_0x5027('0xef')]){_0x1b0e01=util[_0x5027('0xae')](_0x5027('0xaf'),_0x42ee5c[_0x5027('0x5f')][_0x5027('0xef')]);}else{_0x1b0e01=util[_0x5027('0xae')]('SIP/%s',_0x8c6fd9[_0x5027('0x38')]);}socket['to'](util[_0x5027('0xae')](_0x5027('0xf0'),_0x8c6fd9[_0x5027('0x38')]))[_0x5027('0xa8')](_0x5027('0xf1'),{'user':{'id':_0x8c6fd9['id'],'name':_0x8c6fd9[_0x5027('0x38')]},'ip':_0x42ee5c['headers'][_0x5027('0xf2')]||_0x42ee5c['connection'][_0x5027('0xf3')]||_0x42ee5c[_0x5027('0xf4')][_0x5027('0xf3')]||_0x42ee5c[_0x5027('0xf5')][_0x5027('0xf4')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x5027('0x2c')]({'where':{'membername':_0x8c6fd9[_0x5027('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0x5027('0x94'))]['ValidationError'](_0x5027('0xf6'));}})[_0x5027('0x16')](function(){if(_0x8c6fd9){return _0x8c6fd9[_0x5027('0xf7')]({'raw':!![]});}})[_0x5027('0x16')](function(_0x14e7e5){if(_0x8c6fd9){if(_0x14e7e5){_0x24e25d=_0x14e7e5;if(_0x24e25d['length']){var _0x5471ee=_0x24e25d['map'](function(_0x5e309c){var _0x5f2c99={'membername':_0x8c6fd9[_0x5027('0x38')],'UserId':_0x8c6fd9['id'],'queue_name':_0x5e309c[_0x5027('0x38')],'VoiceQueueId':_0x5e309c['id'],'interface':_0x1b0e01,'paused':_0x8c6fd9[_0x5027('0xf8')]||![],'penalty':_0x5e309c['UserVoiceQueue.penalty']||0x0};return db[_0x5027('0xdb')]['upsert'](_0x5f2c99);});return Promise[_0x5027('0x52')](_0x5471ee);}}}})['then'](function(){if(_0x8c6fd9){return db['MemberReport']['findAll']({'where':{'membername':_0x8c6fd9['name'],'exitAt':null}});}})[_0x5027('0x16')](function(_0x460819){if(_0x8c6fd9){var _0x2d01a5=[];_0x460819[_0x5027('0xf9')](function(_0x9974a0){_0x2d01a5[_0x5027('0x48')](_0x9974a0['update']({'exitAt':moment()[_0x5027('0xae')](_0x5027('0xfa'))}));});return Promise['all'](_0x2d01a5);}})[_0x5027('0x16')](function(){if(_0x8c6fd9){var _0x289907=[];var _0x46083f=[];var _0x127073=utils['getChannels']();var _0x1263dc={'membername':_0x8c6fd9[_0x5027('0x38')],'interface':_0x1b0e01,'enterAt':moment()[_0x5027('0xae')](_0x5027('0xfa')),'role':_0x8c6fd9[_0x5027('0x2a')],'internal':_0x8c6fd9[_0x5027('0x64')]};_0x127073[_0x5027('0xf9')](function(_0x3396b3){_0x289907[_0x5027('0x48')](_[_0x5027('0x5b')]({'channel':_0x3396b3,'type':'LOGIN','data1':_0x42ee5c[_0x5027('0x5f')][_0x5027('0xfb')],'data2':_0x1b0e01},_0x1263dc));if(_0x8c6fd9[_0x5027('0xf8')]){_0x46083f[_0x5027('0x48')](_[_0x5027('0x5b')]({'channel':_0x3396b3,'type':_0x5027('0xfc'),'data1':'LOGININPAUSE'},_0x1263dc));}});return db['MemberReport']['bulkCreate'](_0x289907[_0x5027('0xcc')](_0x46083f),{'individualHooks':!![]});}})[_0x5027('0x16')](function(){if(_0x8c6fd9){return _0x8c6fd9[_0x5027('0x29')]({'online':!![],'lastLoginAt':moment()[_0x5027('0xae')](_0x5027('0xfa')),'voicePause':_0x8c6fd9[_0x5027('0xf8')]||![],'mailPause':_0x8c6fd9[_0x5027('0xf8')]||![],'chatPause':_0x8c6fd9[_0x5027('0xf8')]||![],'faxPause':_0x8c6fd9[_0x5027('0xf8')]||![],'smsPause':_0x8c6fd9[_0x5027('0xf8')]||![],'openchannelPause':_0x8c6fd9[_0x5027('0xf8')]||![],'whatsappPause':_0x8c6fd9[_0x5027('0xf8')]||![],'pauseType':_0x8c6fd9[_0x5027('0xf8')]?_0x5027('0xfd'):null,'interface':_0x1b0e01,'lastPauseAt':moment()[_0x5027('0xae')](_0x5027('0xfa'))});}})[_0x5027('0x16')](function(_0x3178b3){if(_0x42ee5c[_0x5027('0xfe')]){return _0x377f15();}else{return Promise['resolve'](_0x3178b3)['then'](respondWithResult(_0x5e354f,null));}})[_0x5027('0x1e')](handleError(_0x5e354f,null));};exports[_0x5027('0xff')]=function(_0x8f20f6,_0x40003e){var _0x2215ab;return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x8f20f6[_0x5027('0x53')]['id'],'role':'agent'},'attributes':['id',_0x5027('0x38'),_0x5027('0x2a')]})[_0x5027('0x16')](handleEntityNotFound(_0x40003e,null))[_0x5027('0x16')](function(_0x5579af){if(_0x5579af){_0x2215ab=_0x5579af;return db[_0x5027('0xdb')][_0x5027('0x2c')]({'where':{'membername':_0x2215ab['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x5027('0x100')][_0x5027('0x49')]({'where':{'membername':_0x2215ab['name'],'exitAt':null}});})[_0x5027('0x16')](function(_0x1ab4ce){var _0x5e8e05=[];_0x1ab4ce[_0x5027('0xf9')](function(_0xf717ee){_0x5e8e05[_0x5027('0x48')](_0xf717ee[_0x5027('0x29')]({'exitAt':moment()[_0x5027('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5027('0x52')](_0x5e8e05);})[_0x5027('0x16')](function(){return _0x2215ab['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5027('0x16')](respondWithResult(_0x40003e,null))[_0x5027('0x1e')](handleError(_0x40003e,null));};exports[_0x5027('0x101')]=function(_0x46f262,_0x4ee4eb){var _0x51413c;return db[_0x5027('0xdb')][_0x5027('0x29')]({'paused':0x1},{'where':{'UserId':_0x46f262['params']['id']},'individualHooks':!![]})[_0x5027('0x16')](function(){return db[_0x5027('0x41')][_0x5027('0x37')]({'where':{'id':_0x46f262[_0x5027('0x53')]['id'],'role':'agent'},'attributes':['id','name',_0x5027('0x2a'),_0x5027('0x64'),_0x5027('0xad'),_0x5027('0xa3')]});})[_0x5027('0x16')](handleEntityNotFound(_0x4ee4eb,null))[_0x5027('0x16')](function(_0x84d5ab){if(_0x84d5ab){_0x51413c=_0x84d5ab;return respondWithRpcPromise(_0x5027('0x102'),_0x5027('0x101'),{'id':_0x51413c['id'],'name':_0x51413c[_0x5027('0x38')],'pause':!![]});}})[_0x5027('0x16')](function(){if(_0x51413c){return db['MemberReport']['findAll']({'where':{'membername':_0x51413c[_0x5027('0x38')],'type':_0x5027('0xfc'),'exitAt':null}});}})[_0x5027('0x16')](function(_0x4b340e){if(_0x4b340e[_0x5027('0x4c')]){var _0x146ccc=moment()['format'](_0x5027('0xfa'));for(var _0x20c01f=0x0,_0xc7c8ac=_0x4b340e['length'];_0x20c01f<_0xc7c8ac;_0x20c01f++){_0x4b340e[_0x20c01f][_0x5027('0x103')]({'exitAt':_0x146ccc});}}})[_0x5027('0x16')](function(){var _0x308631=[];var _0x404b90=utils[_0x5027('0x104')]();_0x404b90[_0x5027('0xf9')](function(_0x403a1f){_0x308631[_0x5027('0x48')]({'channel':_0x403a1f,'membername':_0x51413c[_0x5027('0x38')],'interface':_[_0x5027('0x6a')](_0x51413c['interface'])?util[_0x5027('0xae')](_0x5027('0xaf'),_0x51413c[_0x5027('0x38')]):_0x51413c[_0x5027('0xad')],'type':_0x5027('0xfc'),'enterAt':moment()[_0x5027('0xae')](_0x5027('0xfa')),'data1':_0x46f262[_0x5027('0x5f')][_0x5027('0x3c')]||'DEFAULT\x20PAUSE','role':_0x51413c['role'],'internal':_0x51413c[_0x5027('0x64')]});});return db['MemberReport'][_0x5027('0x105')](_0x308631,{'individualHooks':!![]});})['then'](function(){return _0x51413c[_0x5027('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x46f262[_0x5027('0x5f')][_0x5027('0x3c')]||_0x5027('0x106'),'lastPauseAt':moment()[_0x5027('0xae')](_0x5027('0xfa'))});})['then'](respondWithResult(_0x4ee4eb,null))[_0x5027('0x1e')](handleError(_0x4ee4eb,null));};exports[_0x5027('0x107')]=function(_0x381468,_0x4e7ea5){if(_0x381468[_0x5027('0x5f')][_0x5027('0xb0')]&&!utils[_0x5027('0xa4')](_0x381468[_0x5027('0x5f')][_0x5027('0xb0')])){throw new APIBadRequestError(util[_0x5027('0xae')](_0x5027('0x108'),_0x381468[_0x5027('0x5f')][_0x5027('0xb0')]));}return db['User'][_0x5027('0x37')]({'where':{'id':_0x381468[_0x5027('0x53')]['id']},'attributes':['id',_0x5027('0x38'),_0x5027('0x2a'),_0x5027('0x64'),_0x5027('0xad'),_0x5027('0xa3'),'voicePause',_0x5027('0x109'),_0x5027('0x10a'),_0x5027('0x10b'),_0x5027('0x10c'),_0x5027('0x10d'),_0x5027('0x10e'),_0x5027('0x10f'),'lastPauseAt']})[_0x5027('0x16')](function(_0x5a691a){if(!_0x5a691a){throw new APINotFoundError(util[_0x5027('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0x381468['params']['id']));}return _0x5a691a[_0x5027('0x107')](_0x381468[_0x5027('0x5f')][_0x5027('0xb0')]);})[_0x5027('0x16')](respondWithResult(_0x4e7ea5,null))[_0x5027('0x1e')](APIHandleError(_0x4e7ea5));};exports[_0x5027('0x110')]=function(_0x389625,_0xf40fb2){var _0x181adc={};var _0xf81a4c={};var _0x46dd1b;var _0x4762a4;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x389625[_0x5027('0x53')]['id']}})['then'](handleEntityNotFound(_0xf40fb2,null))[_0x5027('0x16')](function(_0x19f17a){if(_0x19f17a){_0x46dd1b=_0x19f17a;_0xf81a4c[_0x5027('0x54')]=_[_0x5027('0x56')](db[_0x5027('0x111')][_0x5027('0x57')]);_0xf81a4c['query']=_['keys'](_0x389625[_0x5027('0x42')]);_0xf81a4c[_0x5027('0xcf')]=_[_0x5027('0x58')](_0xf81a4c['model'],_0xf81a4c[_0x5027('0x42')]);_0x181adc['attributes']=_[_0x5027('0x58')](_0xf81a4c[_0x5027('0x54')],qs['fields'](_0x389625[_0x5027('0x42')][_0x5027('0x59')]));_0x181adc[_0x5027('0x47')]=_0x181adc[_0x5027('0x47')]['length']?_0x181adc['attributes']:_0xf81a4c[_0x5027('0x54')];_0x181adc['order']=qs[_0x5027('0xce')](_0x389625[_0x5027('0x42')][_0x5027('0xce')]);_0x181adc[_0x5027('0x40')]=qs[_0x5027('0xcf')](_['pick'](_0x389625[_0x5027('0x42')],_0xf81a4c['filters']));if(_0x389625[_0x5027('0x42')]['filter']){_0x181adc['where']=_[_0x5027('0x5b')](_0x181adc[_0x5027('0x40')],{'$or':_['map'](_0x181adc[_0x5027('0x47')],function(_0x1a9274){var _0x2e79f4={};_0x2e79f4[_0x1a9274]={'$like':'%'+_0x389625['query'][_0x5027('0x32')]+'%'};return _0x2e79f4;})});}_0x181adc=_[_0x5027('0x5b')]({},_0x181adc,_0x389625[_0x5027('0x5c')]);return _0x46dd1b[_0x5027('0x110')](_0x181adc);}})['then'](function(_0x1cab77){if(_0x1cab77){_0x4762a4=_0x1cab77[_0x5027('0x4c')];if(!_0x389625['query'][_0x5027('0xd0')](_0x5027('0xd6'))){_0x181adc[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x389625[_0x5027('0x42')]['limit']);_0x181adc[_0x5027('0x23')]=qs[_0x5027('0x23')](_0x389625[_0x5027('0x42')][_0x5027('0x23')]);}return _0x46dd1b[_0x5027('0x110')](_0x181adc);}})[_0x5027('0x16')](function(_0x116c38){if(_0x116c38){return _0x116c38?{'count':_0x4762a4,'rows':_0x116c38}:null;}})[_0x5027('0x16')](respondWithResult(_0xf40fb2,null))[_0x5027('0x1e')](handleError(_0xf40fb2,null));};exports['addTeams']=function(_0x1a16d6,_0x150a0c){var _0x4385fd=_0x1a16d6[_0x5027('0x53')]['id'];var _0x1e1ea3=_0x1a16d6[_0x5027('0x5f')]?_0x1a16d6[_0x5027('0x5f')][_0x5027('0x62')]:null;var _0x3b6e71=[];return Promise[_0x5027('0x112')]()[_0x5027('0x16')](function(){if(!_0x1e1ea3)throw new APIBadRequestError(_0x5027('0x113'));})[_0x5027('0x16')](function(){return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x4385fd}});})[_0x5027('0x16')](function(_0x5048e8){if(!_0x5048e8)throw new APINotFoundError(util[_0x5027('0xae')](_0x5027('0x114'),_0x1a16d6[_0x5027('0x53')]['id']));return db[_0x5027('0x6b')][_0x5027('0x115')](function(_0x2f8fec){return _0x5048e8['addTeams'](_0x1e1ea3,{'transaction':_0x2f8fec})[_0x5027('0x16')](function(){return db[_0x5027('0x111')][_0x5027('0x49')]({'where':{'id':{'$in':_0x1e1ea3}}});})['then'](function(_0x20f650){var _0x1b8d89=_[_0x5027('0x34')](_0x20f650,function(_0x32c225){return _0x32c225[_0x5027('0x116')]();});return Promise['all'](_0x1b8d89);})[_0x5027('0x16')](function(_0x208266){_0x3b6e71=_[_0x5027('0x117')](_0x208266);var _0x1f0758=_['map'](_0x3b6e71,function(_0xa9e563){return _0xa9e563['addAgent'](_0x5048e8['id'],{'transaction':_0x2f8fec});});return Promise[_0x5027('0x52')](_0x1f0758);})['then'](function(){if(!_0x5048e8[_0x5027('0xa3')])return;var _0x2f4243=_[_0x5027('0x32')](_0x3b6e71,function(_0x47658f){return _0x47658f['getDataValue']('channel')===_0x5027('0x118');});var _0x953715=_['map'](_0x2f4243,function(_0x53240a){return db[_0x5027('0xdb')]['upsert']({'membername':_0x5048e8[_0x5027('0x38')],'UserId':_0x5048e8['id'],'queue_name':_0x53240a['name'],'VoiceQueueId':_0x53240a['id'],'interface':_[_0x5027('0x6a')](_0x5048e8[_0x5027('0xad')])?util[_0x5027('0xae')](_0x5027('0xaf'),_0x5048e8[_0x5027('0x38')]):_0x5048e8[_0x5027('0xad')],'paused':_0x5048e8[_0x5027('0x119')]||![],'penalty':_0x5048e8['penalty']},{'transaction':_0x2f8fec});});return Promise[_0x5027('0x52')](_0x953715);})['then'](function(){return db['TeamVoicePrefix'][_0x5027('0x49')]({'where':{'teamId':{'$in':_0x1e1ea3}}});})[_0x5027('0x16')](function(_0x3a819f){var _0x1f7572=_['map'](_0x3a819f,function(_0xfbbd47){return db['UserVoicePrefix'][_0x5027('0x83')]({'UserId':_0x5048e8['id'],'VoicePrefixId':_0xfbbd47[_0x5027('0x11a')]},{'transaction':_0x2f8fec});});return Promise[_0x5027('0x52')](_0x1f7572);});});})[_0x5027('0x16')](function(){for(var _0x4cf3ec=0x0;_0x4cf3ec<_0x3b6e71['length'];_0x4cf3ec++){var _0xc259ab=_0x3b6e71[_0x4cf3ec][_0x5027('0x11b')](_0x5027('0xb0'));var _0x265950=_0xc259ab+_0x5027('0xa7');socket[_0x5027('0xa8')]('user'+_0xc259ab+_0x5027('0xaa'),{'UserId':_0x4385fd,['queueField']:_0x3b6e71[_0x4cf3ec]['id']});}})['then'](respondWithStatusCode(_0x150a0c,null))[_0x5027('0x1e')](APIHandleError(_0x150a0c));};exports[_0x5027('0x11c')]=function(_0x4f0f6a,_0x31fd14){var _0x293dfc=_0x4f0f6a[_0x5027('0x53')]['id'];var _0x1c9b1f=null;if(_0x4f0f6a[_0x5027('0x42')][_0x5027('0x62')]){_0x1c9b1f=_[_0x5027('0xb4')](_0x4f0f6a[_0x5027('0x42')][_0x5027('0x62')])?_0x4f0f6a['query'][_0x5027('0x62')]:[_0x4f0f6a['query'][_0x5027('0x62')]];}var _0x2f8f16=[];return Promise['resolve']()[_0x5027('0x16')](function(){if(!_0x1c9b1f)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0x5027('0x41')]['findOne']({'where':{'id':_0x293dfc}});})[_0x5027('0x16')](function(_0x48b5f3){if(!_0x48b5f3)throw new APINotFoundError(util[_0x5027('0xae')](_0x5027('0x114'),_0x4f0f6a[_0x5027('0x53')]['id']));return db['sequelize'][_0x5027('0x115')](function(_0x3e755c){return _0x48b5f3[_0x5027('0x11c')](_0x1c9b1f,{'transaction':_0x3e755c})[_0x5027('0x16')](function(){return db[_0x5027('0x111')][_0x5027('0x49')]({'where':{'id':{'$in':_0x1c9b1f}}});})[_0x5027('0x16')](function(_0x37fcc1){var _0x4a263d=_[_0x5027('0x34')](_0x37fcc1,function(_0x20693b){return _0x20693b[_0x5027('0x116')]();});return Promise[_0x5027('0x52')](_0x4a263d);})[_0x5027('0x16')](function(_0x18d32e){_0x2f8f16=_[_0x5027('0x117')](_0x18d32e);var _0x43876b=_[_0x5027('0x34')](_0x2f8f16,function(_0xcc38fd){return _0xcc38fd['removeAgent'](_0x48b5f3['id'],{'transaction':_0x3e755c});});return Promise[_0x5027('0x52')](_0x43876b);})[_0x5027('0x16')](function(){if(!_0x48b5f3[_0x5027('0xa3')])return;var _0x299c0b=_['filter'](_0x2f8f16,function(_0x397a19){return _0x397a19[_0x5027('0x11b')](_0x5027('0xb0'))===_0x5027('0x118');});var _0x1b672f=_[_0x5027('0x34')](_0x299c0b,function(_0x20cf1a){return db[_0x5027('0xdb')][_0x5027('0x2c')]({'where':{'VoiceQueueId':_0x20cf1a['id'],'UserId':_0x48b5f3['id']},'transaction':_0x3e755c});});return Promise['all'](_0x1b672f);})[_0x5027('0x16')](function(){return db[_0x5027('0x11d')][_0x5027('0x49')]({'where':{'teamId':{'$in':_0x1c9b1f}}});})[_0x5027('0x16')](function(_0xe17616){var _0xd8b0a2=_[_0x5027('0x34')](_0xe17616,function(_0x2e2c44){return db[_0x5027('0x11e')][_0x5027('0x2c')]({'where':{'UserId':_0x48b5f3['id'],'VoicePrefixId':_0x2e2c44[_0x5027('0x11a')]}},{'transaction':_0x3e755c});});return Promise[_0x5027('0x52')](_0xd8b0a2);});});})[_0x5027('0x16')](function(){for(var _0x2f0ce1=0x0;_0x2f0ce1<_0x2f8f16[_0x5027('0x4c')];_0x2f0ce1++){var _0x3c2cea=_0x2f8f16[_0x2f0ce1][_0x5027('0x11b')]('channel');var _0x4e136d=_0x3c2cea+_0x5027('0xa7');socket[_0x5027('0xa8')](_0x5027('0x2f')+_0x3c2cea+'Queue:remove',{'UserId':_0x293dfc,['queueField']:_0x2f8f16[_0x2f0ce1]['id']});}})[_0x5027('0x16')](respondWithStatusCode(_0x31fd14,null))['catch'](APIHandleError(_0x31fd14));};exports[_0x5027('0x11f')]=function(_0x887db1,_0x2c1558){var _0x5d85fb={};var _0x6cea27={};var _0x15febf;var _0x573526;return db[_0x5027('0x41')][_0x5027('0x9c')]({'where':{'id':_0x887db1['params']['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x2c1558,null))['then'](function(_0x4693d9){if(_0x4693d9){_0x15febf=_0x4693d9;_0x6cea27[_0x5027('0x54')]=_['keys'](db['CmList'][_0x5027('0x57')]);_0x6cea27[_0x5027('0x42')]=_[_0x5027('0x56')](_0x887db1[_0x5027('0x42')]);_0x6cea27['filters']=_['intersection'](_0x6cea27[_0x5027('0x54')],_0x6cea27[_0x5027('0x42')]);_0x5d85fb[_0x5027('0x47')]=_['intersection'](_0x6cea27['model'],qs[_0x5027('0x59')](_0x887db1[_0x5027('0x42')][_0x5027('0x59')]));_0x5d85fb[_0x5027('0x47')]=_0x5d85fb[_0x5027('0x47')]['length']?_0x5d85fb[_0x5027('0x47')]:_0x6cea27[_0x5027('0x54')];_0x5d85fb['order']=qs[_0x5027('0xce')](_0x887db1[_0x5027('0x42')][_0x5027('0xce')]);_0x5d85fb['where']=qs['filters'](_['pick'](_0x887db1['query'],_0x6cea27['filters']));if(_0x887db1[_0x5027('0x42')][_0x5027('0x32')]){_0x5d85fb[_0x5027('0x40')]=_['merge'](_0x5d85fb[_0x5027('0x40')],{'$or':_['map'](_0x5d85fb[_0x5027('0x47')],function(_0x13cb3b){var _0xd9dd84={};_0xd9dd84[_0x13cb3b]={'$like':'%'+_0x887db1[_0x5027('0x42')][_0x5027('0x32')]+'%'};return _0xd9dd84;})});}_0x5d85fb=_[_0x5027('0x5b')]({},_0x5d85fb,_0x887db1['options']);return _0x15febf[_0x5027('0x11f')](_0x5d85fb);}})['then'](function(_0x4f6eb9){if(_0x4f6eb9){_0x573526=_0x4f6eb9[_0x5027('0x4c')];if(!_0x887db1[_0x5027('0x42')][_0x5027('0xd0')]('nolimit')){_0x5d85fb[_0x5027('0x25')]=qs[_0x5027('0x25')](_0x887db1[_0x5027('0x42')][_0x5027('0x25')]);_0x5d85fb['offset']=qs['offset'](_0x887db1[_0x5027('0x42')][_0x5027('0x23')]);}return _0x15febf[_0x5027('0x11f')](_0x5d85fb);}})['then'](function(_0x4303a4){if(_0x4303a4){return _0x4303a4?{'count':_0x573526,'rows':_0x4303a4}:null;}})[_0x5027('0x16')](respondWithResult(_0x2c1558,null))[_0x5027('0x1e')](handleError(_0x2c1558,null));};exports[_0x5027('0x120')]=function(_0x2e5850,_0x193f13){var _0xbe8e5d={};var _0x26738b={};var _0x411c5a;return db[_0x5027('0x41')]['findOne']({'where':{'id':_0x2e5850['params']['id']}})[_0x5027('0x16')](handleEntityNotFound(_0x193f13,null))[_0x5027('0x16')](function(_0x4a2d62){if(_0x4a2d62){_0x411c5a=_0x4a2d62;_0x26738b[_0x5027('0x54')]=_[_0x5027('0x56')](db[_0x5027('0x41')][_0x5027('0x57')]);_0x26738b[_0x5027('0x42')]=_['keys'](_0x2e5850[_0x5027('0x42')]);_0x26738b[_0x5027('0xcf')]=_['intersection'](_0x26738b[_0x5027('0x54')],_0x26738b[_0x5027('0x42')]);_0xbe8e5d['attributes']=_[_0x5027('0x58')](_0x26738b[_0x5027('0x54')],qs['fields'](_0x2e5850[_0x5027('0x42')][_0x5027('0x59')]));_0xbe8e5d[_0x5027('0x47')]=_0xbe8e5d['attributes'][_0x5027('0x4c')]?_0xbe8e5d[_0x5027('0x47')]:_0x26738b[_0x5027('0x54')];_0xbe8e5d[_0x5027('0xdc')]=qs[_0x5027('0xce')](_0x2e5850[_0x5027('0x42')][_0x5027('0xce')]);_0xbe8e5d[_0x5027('0x40')]=qs[_0x5027('0xcf')](_[_0x5027('0xd8')](_0x2e5850[_0x5027('0x42')],_0x26738b['filters']));if(_0x2e5850[_0x5027('0x42')][_0x5027('0x32')]){_0xbe8e5d[_0x5027('0x40')]=_[_0x5027('0x5b')](_0xbe8e5d[_0x5027('0x40')],{'$or':_['map'](_0xbe8e5d[_0x5027('0x47')],function(_0x32b58d){var _0x40edfa={};_0x40edfa[_0x32b58d]={'$like':'%'+_0x2e5850[_0x5027('0x42')]['filter']+'%'};return _0x40edfa;})});}_0xbe8e5d[_0x5027('0x54')]=db[_0x5027('0x41')];_0xbe8e5d['as']='Agents';_0xbe8e5d=_[_0x5027('0x5b')]({},_0xbe8e5d,_0x2e5850[_0x5027('0x5c')]);return _0x411c5a['getVoiceQueues']({'include':[_0xbe8e5d]});}})[_0x5027('0x16')](function(_0x155622){if(_0x155622){var _0x470e19={},_0x17aca1=[];for(var _0x3ed126=0x0;_0x3ed126<_0x155622[_0x5027('0x4c')];_0x3ed126+=0x1){for(var _0x24bf91=0x0,_0x21334a;_0x24bf91<_0x155622[_0x3ed126][_0x5027('0x30')]['length'];_0x24bf91+=0x1){_0x21334a=_0x155622[_0x3ed126][_0x5027('0x30')][_0x24bf91][_0x5027('0x2d')]({'plain':!![]});_0x470e19[_0x21334a['id']]=_0x21334a;}}_0x470e19=_[_0x5027('0x121')](_0x470e19);for(var _0xaa00eb=qs['offset'](_0x2e5850['query'][_0x5027('0x23')]);_0xaa00eb<_0x470e19[_0x5027('0x4c')]&&_0x17aca1[_0x5027('0x4c')]=_0x1d046c){_0x4dd3ab=_0x1d046c;_0x3c8ff0=0xc8;}else{_0x3c8ff0=0xce;}_0x24d6a5['status'](_0x3c8ff0);return _0x24d6a5[_0x67b6('0x28')](_0x67b6('0x29'),_0x1d80ab+'-'+_0x4dd3ab+'/'+_0x1d046c)[_0x67b6('0x23')](_0x29d604);}return null;};}function saveUpdates(_0x17bd35){return function(_0x135b9c){if(_0x135b9c){return _0x135b9c[_0x67b6('0x2a')](_0x17bd35)[_0x67b6('0x17')](function(_0x30ca75){if(_0x30ca75[_0x67b6('0x2b')]==='agent'){socket[_0x67b6('0x2c')](_0x67b6('0x2d')+_0x30ca75['id'],_0x30ca75);}return _0x30ca75;});}return null;};}function removeEntity(_0x542fd8){return function(_0x283fa6){if(_0x283fa6){return _0x283fa6[_0x67b6('0x2e')]()[_0x67b6('0x17')](function(){var _0x2b58e8=_0x283fa6[_0x67b6('0x2f')]({'plain':!![]});if(_0x2b58e8[_0x67b6('0x2b')]===_0x67b6('0x30'))return;var _0x411d90=[{'name':_0x67b6('0x31'),'value':_0x67b6('0x32'),'ignore':!![]},{'name':_0x67b6('0x33'),'value':_0x67b6('0x34'),'ignore':![]},{'name':_0x67b6('0x35'),'value':_0x67b6('0x36'),'ignore':![]}];var _0x25f71a=_(_0x411d90)['filter'](_0x67b6('0x37'))[_0x67b6('0x38')](_0x67b6('0x39'))[_0x67b6('0x39')]();if(_[_0x67b6('0x3a')](_0x25f71a,_0x2b58e8[_0x67b6('0x2b')])){return;}var _0x29b943=_[_0x67b6('0x3b')](_0x411d90,[_0x67b6('0x39'),_0x2b58e8['role']])[_0x67b6('0x3c')];return db[_0x67b6('0x3d')][_0x67b6('0x2e')]({'where':{'type':_0x29b943,'resourceId':_0x2b58e8['id']}})[_0x67b6('0x17')](function(){return _0x283fa6;});})[_0x67b6('0x17')](function(){_0x542fd8[_0x67b6('0x21')](0xcc)[_0x67b6('0x22')]();});}};}function handleEntityNotFound(_0x59daa5){return function(_0x5790e3){if(!_0x5790e3){_0x59daa5['sendStatus'](0x194);}return _0x5790e3;};}function handleError(_0x5a8378,_0x9a9983){_0x9a9983=_0x9a9983||0x1f4;return function(_0x1537cb){logger[_0x67b6('0x1c')](_0x1537cb['stack']);if(_0x1537cb[_0x67b6('0x3c')]){delete _0x1537cb[_0x67b6('0x3c')];}_0x5a8378[_0x67b6('0x21')](_0x9a9983)['send'](_0x1537cb);};}exports[_0x67b6('0x3e')]=function(_0x690464,_0x1fa2f1){var _0x39dda6={},_0x3a3c8e={'count':0x0,'rows':[]};var _0xc9aa8f=_(db[_0x67b6('0x3f')][_0x67b6('0x40')])[_0x67b6('0x38')](function(_0x9d0270){return{'name':_0x9d0270[_0x67b6('0x41')],'type':_0x9d0270[_0x67b6('0x42')]['key']};})[_0x67b6('0x43')](function(_0x2577ca){return!_['includes'](['password',_0x67b6('0x44')],_0x2577ca[_0x67b6('0x3c')]);})[_0x67b6('0x39')]();_0x39dda6=qs[_0x67b6('0x45')](_0xc9aa8f,_0x690464);var _0x1ae55c={'where':_0x39dda6['where']};return db[_0x67b6('0x3f')][_0x67b6('0x27')](_0x1ae55c)[_0x67b6('0x17')](function(_0xbd5ca1){_0x3a3c8e[_0x67b6('0x27')]=_0xbd5ca1;if(_0x690464[_0x67b6('0x46')][_0x67b6('0x47')]){_0x39dda6[_0x67b6('0x48')]=[{'all':!![]}];}if(_0x690464[_0x67b6('0x46')][_0x67b6('0x49')]==='true'){_0x39dda6['include']=[{'model':db[_0x67b6('0x4a')],'as':_0x67b6('0x49')}];}if(!_[_0x67b6('0x3a')](_0x39dda6[_0x67b6('0x4b')],'id')){_0x39dda6[_0x67b6('0x4b')][_0x67b6('0x4c')]('id');}return db['User'][_0x67b6('0x4d')](_0x39dda6);})[_0x67b6('0x17')](function(_0x40dca8){_0x3a3c8e[_0x67b6('0x4e')]=_0x40dca8;if(_0x690464['query']['openTabs']===_0x67b6('0x4f')){var _0x4f47f1=[];for(var _0x9795cf=0x0;_0x9795cf<_0x3a3c8e['rows'][_0x67b6('0x50')];_0x9795cf++){_0x4f47f1[_0x67b6('0x4c')](get_open_tabs('chat',_0x3a3c8e[_0x67b6('0x4e')][_0x9795cf][_0x67b6('0x51')]));_0x4f47f1['push'](get_open_tabs(_0x67b6('0x52'),_0x3a3c8e[_0x67b6('0x4e')][_0x9795cf]['dataValues']));_0x4f47f1[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x53'),_0x3a3c8e[_0x67b6('0x4e')][_0x9795cf][_0x67b6('0x51')]));_0x4f47f1[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x54'),_0x3a3c8e[_0x67b6('0x4e')][_0x9795cf][_0x67b6('0x51')]));_0x4f47f1[_0x67b6('0x4c')](get_open_tabs('openchannel',_0x3a3c8e[_0x67b6('0x4e')][_0x9795cf][_0x67b6('0x51')]));_0x4f47f1['push'](get_open_tabs(_0x67b6('0x55'),_0x3a3c8e['rows'][_0x9795cf][_0x67b6('0x51')]));}return Promise[_0x67b6('0x56')](_0x4f47f1)['then'](function(){return _0x3a3c8e;});}else{return _0x3a3c8e;}})['then'](respondWithFilteredResult(_0x1fa2f1,_0x39dda6))[_0x67b6('0x1f')](handleError(_0x1fa2f1,null));};exports[_0x67b6('0x57')]=function(_0x4970ad,_0x2f5284){var _0x4dfc9c={'raw':![],'where':{'id':_0x4970ad[_0x67b6('0x58')]['id']}},_0x5e1bdd={};_0x5e1bdd[_0x67b6('0x59')]=_['differenceBy'](_['keys'](db[_0x67b6('0x3f')][_0x67b6('0x40')]),[_0x67b6('0x5a'),_0x67b6('0x44')]);_0x5e1bdd['query']=_[_0x67b6('0x5b')](_0x4970ad[_0x67b6('0x46')]);_0x5e1bdd['filters']=_[_0x67b6('0x5c')](_0x5e1bdd[_0x67b6('0x59')],_0x5e1bdd['query']);_0x4dfc9c[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x5e1bdd['model'],qs[_0x67b6('0x5d')](_0x4970ad[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x4dfc9c[_0x67b6('0x4b')]=_0x4dfc9c[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x4dfc9c[_0x67b6('0x4b')]:_0x5e1bdd[_0x67b6('0x59')];if(_0x4970ad[_0x67b6('0x46')][_0x67b6('0x47')]){_0x4dfc9c['include']=[{'all':!![]}];}if(_0x4970ad[_0x67b6('0x46')][_0x67b6('0x49')]===_0x67b6('0x4f')){_0x4dfc9c[_0x67b6('0x48')]=[{'model':db[_0x67b6('0x4a')],'as':_0x67b6('0x49')}];}_0x4dfc9c=_['merge']({},_0x4dfc9c,_0x4970ad[_0x67b6('0x5e')]);if(!_[_0x67b6('0x3a')](_0x4dfc9c['attributes'],'id')){_0x4dfc9c[_0x67b6('0x4b')]['push']('id');}return db[_0x67b6('0x3f')][_0x67b6('0x3b')](_0x4dfc9c)[_0x67b6('0x17')](handleEntityNotFound(_0x2f5284,null))[_0x67b6('0x17')](function(_0x49545d){var _0x28be42=[];values=_0x49545d;if(_0x4970ad[_0x67b6('0x46')]['openTabs']==='true'){_0x28be42['push'](get_open_tabs('chat',_0x49545d[_0x67b6('0x51')]));_0x28be42['push'](get_open_tabs(_0x67b6('0x52'),_0x49545d['dataValues']));_0x28be42[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x5f'),_0x49545d[_0x67b6('0x51')]));_0x28be42[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x55'),_0x49545d[_0x67b6('0x51')]));_0x28be42[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x53'),_0x49545d[_0x67b6('0x51')]));_0x28be42[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x54'),_0x49545d['dataValues']));return Promise[_0x67b6('0x56')](_0x28be42);}else{return values;}})[_0x67b6('0x17')](function(){return values;})[_0x67b6('0x17')](respondWithResult(_0x2f5284,null))[_0x67b6('0x1f')](handleError(_0x2f5284,null));};exports[_0x67b6('0x2a')]=function(_0x425b24,_0x35c00a){if(_0x425b24[_0x67b6('0x60')]['id']){delete _0x425b24[_0x67b6('0x60')]['id'];}delete _0x425b24[_0x67b6('0x60')][_0x67b6('0x2b')];return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x425b24[_0x67b6('0x58')]['id']}})['then'](handleEntityNotFound(_0x35c00a,null))[_0x67b6('0x17')](saveUpdates(_0x425b24[_0x67b6('0x60')],null))[_0x67b6('0x17')](respondWithResult(_0x35c00a,null))[_0x67b6('0x1f')](handleError(_0x35c00a,null));};exports[_0x67b6('0x61')]=function(_0x3d5555,_0x3e671b){return db[_0x67b6('0x3f')]['describe']()[_0x67b6('0x17')](respondWithResult(_0x3e671b,null))[_0x67b6('0x1f')](handleError(_0x3e671b,null));};exports[_0x67b6('0x62')]=function(_0x2a0551,_0x4a0b7e){return db['User'][_0x67b6('0x3b')]({'where':{'id':_0x2a0551['params']['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x4a0b7e,null))[_0x67b6('0x17')](function(_0x36100e){if(_0x36100e){return _0x36100e['addContacts'](_0x2a0551['body'][_0x67b6('0x63')],_['omit'](_0x2a0551[_0x67b6('0x60')],[_0x67b6('0x63'),'id'])||{});}})['then'](respondWithResult(_0x4a0b7e,null))[_0x67b6('0x1f')](handleError(_0x4a0b7e,null));};function validateUser(_0xc92353){return new Promise(function(_0x15183b,_0x1dd47a){if(_0xc92353[_0x67b6('0x64')])return _0x15183b(_0xc92353);return db[_0x67b6('0x65')][_0x67b6('0x66')](0x1)[_0x67b6('0x17')](function(_0x4f2c5a){if(_0x4f2c5a['securePassword'])authService[_0x67b6('0x67')](_0xc92353['password']);db[_0x67b6('0x3f')][_0x67b6('0x68')](_0x67b6('0x64'))[_0x67b6('0x17')](function(_0x35f3bc){if(_[_0x67b6('0x69')](_0x35f3bc)){_0xc92353[_0x67b6('0x64')]=_0x4f2c5a[_0x67b6('0x6a')]||0x1;return;}if(_['isNil'](_0x4f2c5a[_0x67b6('0x6a')])||_0x4f2c5a[_0x67b6('0x6a')]===_0x35f3bc){_0xc92353[_0x67b6('0x64')]=_0x35f3bc+0x1;return;}if(_0x4f2c5a[_0x67b6('0x6a')]>_0x35f3bc){_0xc92353[_0x67b6('0x64')]=_0x4f2c5a[_0x67b6('0x6a')];return;}return db[_0x67b6('0x6b')][_0x67b6('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[_0x67b6('0x6b')]['QueryTypes'][_0x67b6('0x6c')]})[_0x67b6('0x17')](function(_0x246f70){if(_0x246f70&&_0x246f70['length']){for(var _0x194b9e=0x0,_0x50804a=_0x246f70[_0x67b6('0x50')];_0x194b9e<_0x50804a&&_[_0x67b6('0x69')](_0xc92353[_0x67b6('0x64')]);_0x194b9e++){if(_0x4f2c5a['min_internal']<=_0x246f70[_0x194b9e]['from']){_0xc92353[_0x67b6('0x64')]=_0x246f70[_0x194b9e]['from'];}else if(_0x4f2c5a[_0x67b6('0x6a')]>_0x246f70[_0x194b9e][_0x67b6('0x6d')]&&_0x4f2c5a[_0x67b6('0x6a')]<=_0x246f70[_0x194b9e]['to']){_0xc92353[_0x67b6('0x64')]=_0x4f2c5a[_0x67b6('0x6a')];}}}if(_[_0x67b6('0x69')](_0xc92353[_0x67b6('0x64')])){_0xc92353['internal']=_0x35f3bc+0x1;}return _0x15183b(_0xc92353);});});})[_0x67b6('0x1f')](function(_0x5ade5d){_0x1dd47a(_0x5ade5d);});});}function updateUser(_0x3ffe80){return new Promise(function(_0x258b2c,_0x5de49a){try{if(_0x3ffe80['voicemail']){_0x3ffe80[_0x67b6('0x6e')]=_0x3ffe80['internal'];_0x3ffe80['VoiceMail']={'mailbox':_0x3ffe80[_0x67b6('0x64')],'password':_0x3ffe80[_0x67b6('0x5a')],'fullname':_0x3ffe80[_0x67b6('0x6f')],'email':_0x3ffe80[_0x67b6('0x70')]};}if(_0x3ffe80['role']==='agent'){if(!_0x3ffe80['permissions'])_0x3ffe80[_0x67b6('0x71')]=[_0x67b6('0x72'),_0x67b6('0x73'),_0x67b6('0x74'),'113',_0x67b6('0x75'),_0x67b6('0x76'),'105',_0x67b6('0x77'),_0x67b6('0x78'),_0x67b6('0x79'),'109','100','111',_0x67b6('0x7a'),_0x67b6('0x7b')];}_0x258b2c(_0x3ffe80);}catch(_0x42ceba){_0x5de49a(_0x42ceba);}});}exports[_0x67b6('0x7c')]=function(_0x353409,_0x22fdcd){if(_0x353409[_0x67b6('0x32')][_0x67b6('0x2b')]===_0x67b6('0x34'))throw new Error(_0x67b6('0x7d'));if(_0x353409['body'][_0x67b6('0x2b')]===_0x67b6('0x32')&&_0x353409[_0x67b6('0x32')][_0x67b6('0x2b')]!==_0x67b6('0x30')){throw new Error(_0x67b6('0x7e'));}if(_0x353409[_0x67b6('0x60')][_0x67b6('0x2b')]===_0x67b6('0x30')&&_0x353409[_0x67b6('0x32')][_0x67b6('0x2b')]!==_0x67b6('0x30')){throw new Error(_0x67b6('0x7f'));}return licenseUtil[_0x67b6('0x80')]([_0x353409['body']])[_0x67b6('0x17')](function(){return validateUser(_0x353409['body']);})[_0x67b6('0x17')](function(_0x33d5f3){return updateUser(_0x33d5f3)[_0x67b6('0x17')](function(_0x1a2785){if(_0x1a2785[_0x67b6('0x2b')]===_0x67b6('0x30')){_0x1a2785[_0x67b6('0x81')]=_0x353409[_0x67b6('0x32')][_0x67b6('0x81')];delete _0x1a2785[_0x67b6('0x82')];}return _0x1a2785;});})[_0x67b6('0x17')](function(_0x3d33d7){return db[_0x67b6('0x3f')]['create'](_0x3d33d7,{'include':[{'model':db[_0x67b6('0x83')],'as':_0x67b6('0x83')}]});})['then'](function(_0xaf8558){if(_0x353409[_0x67b6('0x60')][_0x67b6('0x2b')]==='user')return _0xaf8558;if(_0x353409['user'][_0x67b6('0x2b')]!==_0x67b6('0x32'))return _0xaf8558;return db['UserProfileSection'][_0x67b6('0x3b')]({'where':{'name':_0xaf8558[_0x67b6('0x2b')]===_0x67b6('0x34')?_0x67b6('0x33'):_0x67b6('0x35'),'userProfileId':_0x353409['user']['userProfileId']},'raw':!![]})[_0x67b6('0x17')](function(_0x3ca010){if(!_0x3ca010||_0x3ca010['autoAssociation']!=0x0)return _0xaf8558;return db[_0x67b6('0x3d')][_0x67b6('0x7c')]({'name':_0xaf8558['name'],'resourceId':_0xaf8558['id'],'type':_0x3ca010[_0x67b6('0x3c')],'sectionId':_0x3ca010['id']},{})[_0x67b6('0x17')](function(){return _0xaf8558;});})[_0x67b6('0x1f')](function(_0x1f31b2){logger['error'](_0x67b6('0x84'),_0x1f31b2);throw _0x1f31b2;});})['then'](respondWithResult(_0x22fdcd,0xc9))[_0x67b6('0x1f')](handleError(_0x22fdcd,null));};exports['bulkCreate']=function(_0x30489a,_0x259193){var _0x45f53e=_0x30489a[_0x67b6('0x60')];var _0x540a48=[];if(_0x30489a[_0x67b6('0x32')][_0x67b6('0x2b')]===_0x67b6('0x34'))throw new Error(_0x67b6('0x7d'));if(_[_0x67b6('0x85')](_0x45f53e,['role','user'])&&_0x30489a[_0x67b6('0x32')][_0x67b6('0x2b')]!==_0x67b6('0x30')){throw new Error(_0x67b6('0x7e'));}if(_[_0x67b6('0x85')](_0x45f53e,[_0x67b6('0x2b'),_0x67b6('0x30')])&&_0x30489a[_0x67b6('0x32')]['role']!==_0x67b6('0x30')){throw new Error(_0x67b6('0x86'));}return licenseUtil[_0x67b6('0x80')](_0x45f53e)[_0x67b6('0x17')](function(){return validateUser(_0x45f53e[0x0]);})[_0x67b6('0x17')](function(){for(var _0x3ec9be=0x1;_0x3ec9be<_0x45f53e[_0x67b6('0x50')];_0x3ec9be++){var _0x5be895=_0x45f53e[_0x3ec9be-0x1][_0x67b6('0x64')];if(!_0x45f53e[_0x3ec9be][_0x67b6('0x64')])_0x45f53e[_0x3ec9be][_0x67b6('0x64')]=_0x5be895+0x1;_0x540a48[_0x67b6('0x4c')](validateUser(_0x45f53e[_0x3ec9be]));}return Promise['all'](_0x540a48);})[_0x67b6('0x17')](function(){_0x540a48=[];for(var _0xcc1faf=0x0;_0xcc1faf<_0x45f53e['length'];_0xcc1faf++){_0x540a48['push'](updateUser(_0x45f53e[_0xcc1faf]));}return Promise['all'](_0x540a48);})[_0x67b6('0x17')](function(){_0x540a48=_0x45f53e['map'](function(_0x10496c){return db['User'][_0x67b6('0x7c')](_0x10496c,{'include':[{'model':db[_0x67b6('0x83')],'as':_0x67b6('0x83')}]})[_0x67b6('0x17')](function(_0x982e80){_0x10496c['id']=_0x982e80['id'];return _0x10496c;});});return Promise[_0x67b6('0x56')](_0x540a48);})[_0x67b6('0x17')](function(_0x1f3eda){if(_0x30489a[_0x67b6('0x60')]['role']===_0x67b6('0x32'))return _0x1f3eda;if(_0x30489a[_0x67b6('0x32')][_0x67b6('0x2b')]!==_0x67b6('0x32'))return _0x1f3eda;var _0x2dcf3a=_['some'](_0x1f3eda,function(_0xab75b2){return _0xab75b2['role']===_0x67b6('0x34')||_0xab75b2[_0x67b6('0x2b')]===_0x67b6('0x36');});if(!_0x2dcf3a)return _0x1f3eda;return db[_0x67b6('0x87')]['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x30489a[_0x67b6('0x32')][_0x67b6('0x82')]},'raw':!![]})[_0x67b6('0x17')](function(_0x45c91d){if(_[_0x67b6('0x88')](_0x45c91d)||!_[_0x67b6('0x85')](_0x45c91d,[_0x67b6('0x89'),0x0]))return _0x1f3eda;_0x540a48=[];var _0x405e43=_(_0x45c91d)[_0x67b6('0x38')](function(_0x5dc776){if(_0x5dc776[_0x67b6('0x89')]===0x1)return;return _0x5dc776[_0x67b6('0x3c')]===_0x67b6('0x33')?'agent':_0x67b6('0x36');})[_0x67b6('0x8a')]()[_0x67b6('0x39')]();for(var _0x5e97ce=0x0;_0x5e97ce<_0x1f3eda[_0x67b6('0x50')];_0x5e97ce++){if(!_[_0x67b6('0x3a')](_0x405e43,_0x1f3eda[_0x5e97ce][_0x67b6('0x2b')]))return;var _0x218271=_0x1f3eda[_0x5e97ce][_0x67b6('0x2b')]==='agent'?_0x67b6('0x33'):_0x67b6('0x35');_0x540a48[_0x67b6('0x4c')](db[_0x67b6('0x3d')][_0x67b6('0x7c')]({'name':_0x1f3eda[_0x5e97ce][_0x67b6('0x3c')],'resourceId':_0x1f3eda[_0x5e97ce]['id'],'type':_0x218271,'sectionId':_[_0x67b6('0x3b')](_0x45c91d,['name',_0x218271])['id']},{}));}return Promise[_0x67b6('0x56')](_0x540a48);});})[_0x67b6('0x17')](respondWithResult(_0x259193,0xc9))['catch'](handleError(_0x259193,null));};exports[_0x67b6('0x8b')]=function(_0x1acd9e,_0x2adc5c){if(_0x1acd9e[_0x67b6('0x60')]['id']){delete _0x1acd9e[_0x67b6('0x60')]['id'];}return db['User'][_0x67b6('0x3b')]({'where':{'id':_0x1acd9e['params']['id']}})['then'](function(_0x451f43){if(!_0x451f43)return null;if(_0x451f43['id']===_0x1acd9e['user']['id']){if(!_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x8c')]||!_0x1acd9e['body']['newPassword']){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x8f'));}if(!_0x451f43['authenticate'](_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x8c')])){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x90'));}if(_0x1acd9e['body'][_0x67b6('0x8c')]===_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x91')]){throw new db[(_0x67b6('0x8d'))]['ValidationError'](_0x67b6('0x92'));}}else if(_0x1acd9e['user']['role']===_0x67b6('0x30')){if(!_0x1acd9e[_0x67b6('0x60')]['newPassword']){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x93'));}}else if(_0x1acd9e['user'][_0x67b6('0x2b')]==='user'){if(!_0x1acd9e['body'][_0x67b6('0x91')]){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x93'));}if(_0x451f43[_0x67b6('0x2b')]!==_0x67b6('0x34')){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x7d'));}}else{throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))](_0x67b6('0x7d'));}return _0x451f43;})[_0x67b6('0x17')](handleEntityNotFound(_0x2adc5c,null))[_0x67b6('0x17')](function(_0xaa391b){return db['Setting'][_0x67b6('0x94')]({'attributes':['id',_0x67b6('0x95'),_0x67b6('0x96'),'passwordHistoryLimit']})['then'](function(_0x1dcd10){if(_0x1dcd10[_0x67b6('0x95')])authService['validatePasswordPattern'](_0x1acd9e['body'][_0x67b6('0x91')]);if(!_0x1dcd10['enforcePasswordHistory']||!_0xaa391b[_0x67b6('0x97')])return _0xaa391b;authService[_0x67b6('0x98')](_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x91')],_0xaa391b[_0x67b6('0x97')],_0x1dcd10[_0x67b6('0x99')]);return _0xaa391b;})[_0x67b6('0x17')](saveUpdates({'password':_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x91')],'passwordResetAt':_0x1acd9e[_0x67b6('0x32')]['id']==_0x1acd9e[_0x67b6('0x58')]['id']?moment():null,'previousPasswords':authService[_0x67b6('0x9a')](_0x1acd9e[_0x67b6('0x60')][_0x67b6('0x91')],_0xaa391b['previousPasswords'])},null));})[_0x67b6('0x17')](respondWithResult(_0x2adc5c,null))['catch'](handleError(_0x2adc5c,null));};exports[_0x67b6('0x9b')]=function(_0x5ccfd2,_0x158be4){var _0x1b3712=_0x5ccfd2[_0x67b6('0x60')][_0x67b6('0x9c')];return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x5ccfd2[_0x67b6('0x58')]['id']},'attributes':['id','name',_0x67b6('0x2b'),_0x67b6('0x9d'),_0x67b6('0x9e'),_0x67b6('0x9f'),_0x67b6('0xa0')]})[_0x67b6('0x17')](handleEntityNotFound(_0x158be4,null))[_0x67b6('0x17')](function(_0x496aba){if(_0x496aba){if(!utils[_0x67b6('0xa1')](_0x1b3712)){throw new db[(_0x67b6('0x8d'))]['ValidationError'](_0x67b6('0xa2'));}return _0x496aba[_0x67b6('0xa3')+_[_0x67b6('0xa4')](_0x1b3712[_0x67b6('0xa5')]())+_0x67b6('0xa6')](_0x5ccfd2['body'][_0x67b6('0x63')],{'penalty':_0x5ccfd2[_0x67b6('0x60')][_0x67b6('0xa7')]||0x0})[_0x67b6('0xa8')](function(_0x182112){for(var _0x115df1=0x0;_0x115df1<_0x5ccfd2[_0x67b6('0x60')][_0x67b6('0x63')][_0x67b6('0x50')];_0x115df1+=0x1){var _0x1d9ef6={'UserId':Number(_0x5ccfd2['params']['id'])};_0x1d9ef6[_[_0x67b6('0xa4')](_0x1b3712[_0x67b6('0xa5')]())+_0x67b6('0xa9')]=Number(_0x5ccfd2[_0x67b6('0x60')][_0x67b6('0x63')][_0x115df1]);socket['emit'](_0x67b6('0x32')+_[_0x67b6('0xa4')](_0x1b3712[_0x67b6('0xa5')]())+_0x67b6('0xaa'),_0x1d9ef6);}return _0x182112;})[_0x67b6('0x17')](function(){if(_0x1b3712===_0x67b6('0xab')){return db[_0x67b6('0xac')][_0x67b6('0x4d')]({'where':{'id':_0x5ccfd2['body'][_0x67b6('0x63')]||[]},'raw':!![],'attributes':['id',_0x67b6('0x3c')]});}})['then'](function(_0x3d02e7){var _0x3905df=_0x496aba['get']({'plain':!![]});var _0x54ad4a=[];if(_0x1b3712===_0x67b6('0xab')&&_0x3905df[_0x67b6('0x2b')]===_0x67b6('0x34')&&_0x3905df[_0x67b6('0x9d')]){for(let _0x5eccb3=0x0;_0x5eccb3<_0x3d02e7[_0x67b6('0x50')];_0x5eccb3+=0x1){_0x54ad4a[_0x67b6('0x4c')]({'membername':_0x3905df[_0x67b6('0x3c')],'UserId':_0x3905df['id'],'queue_name':_0x3d02e7[_0x5eccb3][_0x67b6('0x3c')],'VoiceQueueId':_0x3d02e7[_0x5eccb3]['id'],'interface':_[_0x67b6('0x69')](_0x3905df[_0x67b6('0xa0')])?util['format'](_0x67b6('0xad'),_0x3905df[_0x67b6('0x3c')]):_0x3905df[_0x67b6('0xa0')],'paused':_0x3905df[_0x67b6('0x9f')]||![],'penalty':_0x5ccfd2[_0x67b6('0x60')][_0x67b6('0xa7')]||0x0});}return Promise[_0x67b6('0x56')](_0x54ad4a['map'](function(_0x314648){return db[_0x67b6('0xae')][_0x67b6('0xaf')](_0x314648);}));}return _0x496aba;});}})[_0x67b6('0x17')](respondWithStatusCode(_0x158be4,null))[_0x67b6('0x1f')](handleError(_0x158be4,null));};exports['removeQueues']=function(_0x244b4b,_0xf110e3){var _0xf1b166,_0x534aca;return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x244b4b[_0x67b6('0x58')]['id']},'attributes':['id',_0x67b6('0x3c'),'role']})[_0x67b6('0x17')](handleEntityNotFound(_0xf110e3,null))[_0x67b6('0x17')](function(_0x46fe23){if(_0x46fe23){_0xf1b166=_0x46fe23;if(!_0x244b4b['query']['channel']||!utils[_0x67b6('0xa1')](_0x244b4b[_0x67b6('0x46')]['channel'])){throw new db[(_0x67b6('0x8d'))][(_0x67b6('0x8e'))]('Unknown\x20channel');}return _0x46fe23['remove'+_[_0x67b6('0xa4')](_0x244b4b[_0x67b6('0x46')][_0x67b6('0x9c')][_0x67b6('0xa5')]())+'Queues'](_0x244b4b[_0x67b6('0x46')][_0x67b6('0x63')]);}})[_0x67b6('0x17')](function(_0x1b9263){if(_['isArray'](_0x244b4b[_0x67b6('0x46')][_0x67b6('0x63')])){for(var _0x2a1eab=0x0;_0x2a1eab<_0x244b4b['query'][_0x67b6('0x63')][_0x67b6('0x50')];_0x2a1eab+=0x1){_0x534aca={'UserId':Number(_0x244b4b[_0x67b6('0x58')]['id'])};_0x534aca[_[_0x67b6('0xa4')](_0x244b4b[_0x67b6('0x46')]['channel'][_0x67b6('0xa5')]())+_0x67b6('0xa9')]=Number(_0x244b4b[_0x67b6('0x46')]['ids'][_0x2a1eab]);socket[_0x67b6('0x2c')](_0x67b6('0x32')+_[_0x67b6('0xa4')](_0x244b4b['query']['channel'][_0x67b6('0xa5')]())+_0x67b6('0xb0'),_0x534aca);}}else{_0x534aca={'UserId':Number(_0x244b4b[_0x67b6('0x58')]['id'])};_0x534aca[_[_0x67b6('0xa4')](_0x244b4b[_0x67b6('0x46')][_0x67b6('0x9c')][_0x67b6('0xa5')]())+_0x67b6('0xa9')]=Number(_0x244b4b['query'][_0x67b6('0x63')]);socket[_0x67b6('0x2c')]('user'+_[_0x67b6('0xa4')](_0x244b4b[_0x67b6('0x46')][_0x67b6('0x9c')][_0x67b6('0xa5')]())+_0x67b6('0xb0'),_0x534aca);}return _0x1b9263;})[_0x67b6('0x17')](function(){if(_0x244b4b[_0x67b6('0x46')]['channel']==='voice'){return db[_0x67b6('0xae')][_0x67b6('0x2e')]({'where':{'UserId':_0x244b4b[_0x67b6('0x58')]['id'],'VoiceQueueId':_0x244b4b[_0x67b6('0x46')][_0x67b6('0x63')]},'individualHooks':!![]})[_0x67b6('0x17')](function(){return _0xf1b166;});}return _0xf1b166;})[_0x67b6('0x17')](respondWithStatusCode(_0xf110e3,null))[_0x67b6('0x1f')](handleError(_0xf110e3,null));};exports[_0x67b6('0xb1')]=function(_0x2103ce,_0x27c55d){_0x2103ce['body']['userpic']=_0x2103ce[_0x67b6('0xb2')][_0x67b6('0xb3')];return db['User'][_0x67b6('0x3b')]({'where':{'id':_0x2103ce[_0x67b6('0x58')]['id']}})['then'](handleEntityNotFound(_0x27c55d,null))[_0x67b6('0x17')](saveUpdates(_0x2103ce['body'],null))[_0x67b6('0x17')](respondWithResult(_0x27c55d,null))[_0x67b6('0x1f')](handleError(_0x27c55d,null));};exports['getAvatar']=function(_0x4173fe,_0x2ea798){var _0x20f034=path[_0x67b6('0xb4')](config[_0x67b6('0xb5')],'server/files/images/logos/default_profile.png');return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x4173fe['params']['id']},'attributes':['id',_0x67b6('0xb6')],'raw':!![]})['then'](handleEntityNotFound(_0x2ea798,null))[_0x67b6('0x17')](function(_0x24731c){if(_0x24731c){if(_[_0x67b6('0x69')](_0x24731c[_0x67b6('0xb6')])){return _0x2ea798[_0x67b6('0xb7')](_0x20f034);}else{if(!fs[_0x67b6('0xb8')](path[_0x67b6('0xb4')](config['root'],'server/files/images/',_0x24731c['userpic']))){return _0x2ea798['download'](_0x20f034);}return _0x2ea798[_0x67b6('0xb7')](path[_0x67b6('0xb4')](config[_0x67b6('0xb5')],'server/files/images/',_0x24731c[_0x67b6('0xb6')]));}}})['catch'](handleError(_0x2ea798,null));};exports[_0x67b6('0xb9')]=function(_0x5381cc,_0x879688){return db['User'][_0x67b6('0x3b')]({'where':{'id':_0x5381cc[_0x67b6('0x58')]['id']},'attributes':['id']})[_0x67b6('0x17')](handleEntityNotFound(_0x879688,null))[_0x67b6('0x17')](function(_0x5b3c78){var _0x2576b6=[];values=_0x5b3c78[_0x67b6('0x51')];_0x2576b6[_0x67b6('0x4c')](get_open_tabs('chat',_0x5b3c78['dataValues']));_0x2576b6[_0x67b6('0x4c')](get_open_tabs('sms',_0x5b3c78['dataValues']));_0x2576b6[_0x67b6('0x4c')](get_open_tabs('openchannel',_0x5b3c78[_0x67b6('0x51')]));_0x2576b6['push'](get_open_tabs(_0x67b6('0x55'),_0x5b3c78[_0x67b6('0x51')]));_0x2576b6[_0x67b6('0x4c')](get_open_tabs(_0x67b6('0x53'),_0x5b3c78['dataValues']));_0x2576b6['push'](get_open_tabs('mail',_0x5b3c78[_0x67b6('0x51')]));return Promise[_0x67b6('0x56')](_0x2576b6);})[_0x67b6('0x17')](function(_0x265ea9){if(_0x265ea9){var _0xfbd60=_[_0x67b6('0x38')](values[_0x67b6('0xba')],function(_0x290d71){return{'channel':'CHAT','id':_0x290d71['id'],'createdAt':_0x290d71[_0x67b6('0xbb')]};});var _0x1e5280=_[_0x67b6('0x38')](values[_0x67b6('0xbc')],function(_0x36558d){return{'channel':'FAX','id':_0x36558d['id'],'createdAt':_0x36558d['createdAt']};});var _0x36bfe5=_[_0x67b6('0x38')](values[_0x67b6('0xbd')],function(_0x3e974f){return{'channel':_0x67b6('0xbe'),'id':_0x3e974f['id'],'createdAt':_0x3e974f[_0x67b6('0xbb')]};});var _0x1c2b91=_[_0x67b6('0x38')](values[_0x67b6('0xbf')],function(_0x318472){return{'channel':_0x67b6('0xc0'),'id':_0x318472['id'],'createdAt':_0x318472[_0x67b6('0xbb')]};});var _0x5bf99c=_[_0x67b6('0x38')](values[_0x67b6('0xc1')],function(_0x5a1a82){return{'channel':'SMS','id':_0x5a1a82['id'],'createdAt':_0x5a1a82[_0x67b6('0xbb')]};});var _0x5d76ec=_[_0x67b6('0x38')](values[_0x67b6('0xc2')],function(_0x1e0cba){return{'channel':_0x67b6('0xc3'),'id':_0x1e0cba['id'],'createdAt':_0x1e0cba[_0x67b6('0xbb')]};});var _0x45ad96=_[_0x67b6('0xc4')](_0xfbd60,_0x1e5280,_0x36bfe5,_0x1c2b91,_0x5bf99c,_0x5d76ec);var _0x1d7ecb={'count':_0x45ad96[_0x67b6('0x50')],'rows':_0x45ad96};return _0x1d7ecb;}else return null;})[_0x67b6('0x17')](respondWithResult(_0x879688,null))[_0x67b6('0x1f')](handleError(_0x879688,null));};exports['getContacts']=function(_0x1b9dac,_0x317c5e){var _0x4c646e={};var _0x47348c={};var _0x3d60f3;var _0x54d9b4;return db[_0x67b6('0x3f')]['findOne']({'where':{'id':_0x1b9dac[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x317c5e,null))[_0x67b6('0x17')](function(_0x1a26d3){if(_0x1a26d3){_0x3d60f3=_0x1a26d3;_0x47348c[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db['CmContact'][_0x67b6('0x40')]);_0x47348c[_0x67b6('0x46')]=_[_0x67b6('0x5b')](_0x1b9dac[_0x67b6('0x46')]);_0x47348c[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x47348c[_0x67b6('0x59')],_0x47348c['query']);_0x4c646e[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x47348c[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x1b9dac[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x4c646e[_0x67b6('0x4b')]=_0x4c646e[_0x67b6('0x4b')]['length']?_0x4c646e[_0x67b6('0x4b')]:_0x47348c[_0x67b6('0x59')];_0x4c646e[_0x67b6('0xc6')]=qs['sort'](_0x1b9dac[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x4c646e[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x1b9dac['query'],_0x47348c[_0x67b6('0xc5')]));if(_0x1b9dac['query'][_0x67b6('0x43')]){_0x4c646e[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x4c646e['where'],{'$or':_['map'](_0x4c646e[_0x67b6('0x4b')],function(_0x55e74b){var _0x3ad5b9={};_0x3ad5b9[_0x55e74b]={'$like':'%'+_0x1b9dac[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x3ad5b9;})});}_0x4c646e=_[_0x67b6('0xca')]({},_0x4c646e,_0x1b9dac[_0x67b6('0x5e')]);return _0x3d60f3[_0x67b6('0xcb')](_0x4c646e);}})[_0x67b6('0x17')](function(_0x5b4003){if(_0x5b4003){_0x54d9b4=_0x5b4003['length'];if(_0x1b9dac['query'][_0x67b6('0xcc')](_0x67b6('0x47'))){_0x4c646e[_0x67b6('0x48')]=[{'model':db[_0x67b6('0xcd')],'as':_0x67b6('0xce'),'required':![]},{'model':db['Tag'],'as':_0x67b6('0xcf'),'attributes':['id',_0x67b6('0x3c'),'color'],'where':_0x1b9dac[_0x67b6('0x46')][_0x67b6('0xd0')]?{'id':_0x1b9dac[_0x67b6('0x46')][_0x67b6('0xd0')]}:undefined,'required':_0x1b9dac['query'][_0x67b6('0xd0')]?!![]:![]}];}if(!_0x1b9dac[_0x67b6('0x46')]['hasOwnProperty'](_0x67b6('0xd1'))){_0x4c646e['limit']=qs[_0x67b6('0x25')](_0x1b9dac[_0x67b6('0x46')][_0x67b6('0x25')]);_0x4c646e[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x1b9dac[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x3d60f3[_0x67b6('0xcb')](_0x4c646e);}})[_0x67b6('0x17')](function(_0x3bd5d7){if(_0x3bd5d7){return _0x3bd5d7?{'count':_0x54d9b4,'rows':_0x3bd5d7}:null;}})[_0x67b6('0x17')](respondWithResult(_0x317c5e,null))[_0x67b6('0x1f')](handleError(_0x317c5e,null));};exports[_0x67b6('0xd2')]=function(_0x59f29a,_0x453c34){var _0x119a83;var _0x55e8d3={};var _0x19d5b6;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x59f29a[_0x67b6('0x58')]['id']},'attributes':['id','name',_0x67b6('0x2b')]})[_0x67b6('0x17')](handleEntityNotFound(_0x453c34,null))[_0x67b6('0x17')](function(_0x3cabbe){if(!utils[_0x67b6('0xa1')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x67b6('0xa2'));}_0x119a83=_0x3cabbe;var _0x480af9={};_0x480af9[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_[_0x67b6('0xa4')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x9c')])+_0x67b6('0xd3')][_0x67b6('0x40')]);_0x480af9[_0x67b6('0x46')]=_['keys'](_0x59f29a[_0x67b6('0x46')]);_0x480af9[_0x67b6('0xc5')]=_['intersection'](_0x480af9[_0x67b6('0x59')],_0x480af9[_0x67b6('0x46')]);_0x55e8d3[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x480af9[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x59f29a['query']['fields']));_0x55e8d3[_0x67b6('0x4b')]=_0x55e8d3[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x55e8d3[_0x67b6('0x4b')]:_0x480af9[_0x67b6('0x59')];_0x55e8d3[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x55e8d3[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_['pick'](_0x59f29a[_0x67b6('0x46')],_0x480af9[_0x67b6('0xc5')]));if(_0x59f29a[_0x67b6('0x46')][_0x67b6('0x43')]){_0x55e8d3[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x55e8d3[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x55e8d3[_0x67b6('0x4b')],function(_0x3e66c5){var _0xb8e4b={};_0xb8e4b[_0x3e66c5]={'$like':'%'+_0x59f29a['query']['filter']+'%'};return _0xb8e4b;})});}_0x55e8d3=_[_0x67b6('0xca')]({},_0x55e8d3,_0x59f29a[_0x67b6('0x5e')]);switch(_0x119a83[_0x67b6('0x2b')]){case'admin':return db[_[_0x67b6('0xa4')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x9c')])+_0x67b6('0xd3')][_0x67b6('0x4d')](_0x55e8d3);case _0x67b6('0x32'):case _0x67b6('0x34'):return _0x119a83['get'+_[_0x67b6('0xa4')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x9c')])+_0x67b6('0xa6')](_0x55e8d3);default:throw new db[(_0x67b6('0x8d'))]['ValidationError'](_0x67b6('0xd4'));}})['then'](function(_0x4ed191){_0x19d5b6=_0x4ed191['length'];if(!_0x59f29a[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x55e8d3[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x25')]);_0x55e8d3[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x24')]);}switch(_0x119a83[_0x67b6('0x2b')]){case _0x67b6('0x30'):return db[_[_0x67b6('0xa4')](_0x59f29a[_0x67b6('0x46')][_0x67b6('0x9c')])+_0x67b6('0xd3')][_0x67b6('0x4d')](_0x55e8d3);case _0x67b6('0x32'):case'agent':return _0x119a83[_0x67b6('0x2f')+_['capitalize'](_0x59f29a['query']['channel'])+_0x67b6('0xa6')](_0x55e8d3);}})['then'](function(_0x6899c5){return{'count':_0x19d5b6,'rows':_0x6899c5};})['then'](respondWithResult(_0x453c34,null))['catch'](handleError(_0x453c34,null));};exports[_0x67b6('0xd5')]=function(_0xe503bc,_0x316684){var _0xf21215={};var _0x3c3242={};var _0x575151;var _0x3c32d6;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0xe503bc[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x316684,null))[_0x67b6('0x17')](function(_0x7f3ff5){if(_0x7f3ff5){_0x575151=_0x7f3ff5;_0x3c3242[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0xae')]['rawAttributes']);_0x3c3242[_0x67b6('0x46')]=_[_0x67b6('0x5b')](_0xe503bc[_0x67b6('0x46')]);_0x3c3242['filters']=_[_0x67b6('0x5c')](_0x3c3242[_0x67b6('0x59')],_0x3c3242[_0x67b6('0x46')]);_0xf21215[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x3c3242[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0xe503bc[_0x67b6('0x46')][_0x67b6('0x5d')]));_0xf21215['attributes']=_0xf21215[_0x67b6('0x4b')][_0x67b6('0x50')]?_0xf21215[_0x67b6('0x4b')]:_0x3c3242['model'];_0xf21215[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0xe503bc[_0x67b6('0x46')][_0x67b6('0xc7')]);_0xf21215[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0xe503bc[_0x67b6('0x46')],_0x3c3242[_0x67b6('0xc5')]));if(_0xe503bc[_0x67b6('0x46')][_0x67b6('0x43')]){_0xf21215[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0xf21215[_0x67b6('0xc8')],{'$or':_['map'](_0xf21215[_0x67b6('0x4b')],function(_0x3d4173){var _0x3a3d76={};_0x3a3d76[_0x3d4173]={'$like':'%'+_0xe503bc[_0x67b6('0x46')]['filter']+'%'};return _0x3a3d76;})});}_0xf21215=_[_0x67b6('0xca')]({},_0xf21215,_0xe503bc[_0x67b6('0x5e')]);return _0x575151[_0x67b6('0xd5')](_0xf21215);}})[_0x67b6('0x17')](function(_0x5dace6){if(_0x5dace6){_0x3c32d6=_0x5dace6['length'];if(!_0xe503bc[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0xf21215[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0xe503bc[_0x67b6('0x46')][_0x67b6('0x25')]);_0xf21215[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0xe503bc[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x575151[_0x67b6('0xd5')](_0xf21215);}})['then'](function(_0x2abba6){if(_0x2abba6){return _0x2abba6?{'count':_0x3c32d6,'rows':_0x2abba6}:null;}})[_0x67b6('0x17')](respondWithResult(_0x316684,null))[_0x67b6('0x1f')](handleError(_0x316684,null));};exports[_0x67b6('0xd6')]=function(_0x57d042,_0x1f722c){var _0xd58bcf={};var _0x2da13d={};var _0x2ba0ba;var _0x40b664;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x57d042[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x1f722c,null))['then'](function(_0x38ac93){if(_0x38ac93){_0x2ba0ba=_0x38ac93;_0x2da13d[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0xd7')]['rawAttributes']);_0x2da13d['query']=_[_0x67b6('0x5b')](_0x57d042[_0x67b6('0x46')]);_0x2da13d[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x2da13d[_0x67b6('0x59')],_0x2da13d[_0x67b6('0x46')]);_0xd58bcf[_0x67b6('0x4b')]=_['intersection'](_0x2da13d['model'],qs[_0x67b6('0x5d')](_0x57d042['query'][_0x67b6('0x5d')]));_0xd58bcf[_0x67b6('0x4b')]=_0xd58bcf['attributes'][_0x67b6('0x50')]?_0xd58bcf[_0x67b6('0x4b')]:_0x2da13d[_0x67b6('0x59')];_0xd58bcf[_0x67b6('0xc6')]=qs['sort'](_0x57d042[_0x67b6('0x46')]['sort']);_0xd58bcf[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x57d042['query'],_0x2da13d[_0x67b6('0xc5')]));if(_0x57d042[_0x67b6('0x46')]['filter']){_0xd58bcf[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0xd58bcf['where'],{'$or':_[_0x67b6('0x38')](_0xd58bcf[_0x67b6('0x4b')],function(_0x465d60){var _0x979bea={};_0x979bea[_0x465d60]={'$like':'%'+_0x57d042[_0x67b6('0x46')]['filter']+'%'};return _0x979bea;})});}_0xd58bcf=_[_0x67b6('0xca')]({},_0xd58bcf,_0x57d042['options']);return _0x2ba0ba[_0x67b6('0xd6')](_0xd58bcf);}})[_0x67b6('0x17')](function(_0x29d07f){if(_0x29d07f){_0x40b664=_0x29d07f[_0x67b6('0x50')];if(!_0x57d042[_0x67b6('0x46')]['hasOwnProperty'](_0x67b6('0xd1'))){_0xd58bcf[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x57d042[_0x67b6('0x46')][_0x67b6('0x25')]);_0xd58bcf[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x57d042[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x2ba0ba[_0x67b6('0xd6')](_0xd58bcf);}})[_0x67b6('0x17')](function(_0x25225c){if(_0x25225c){return _0x25225c?{'count':_0x40b664,'rows':_0x25225c}:null;}})[_0x67b6('0x17')](respondWithResult(_0x1f722c,null))[_0x67b6('0x1f')](handleError(_0x1f722c,null));};exports[_0x67b6('0xd8')]=function(_0xe05c85,_0xb1797d){var _0x262d11={'raw':!![],'where':{}};var _0x20e6af={};var _0xf02622={'count':0x0,'rows':[]};return db['User'][_0x67b6('0x94')]({'where':{'id':_0xe05c85['params']['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0xb1797d,null))[_0x67b6('0x17')](function(_0x250c28){if(_0x250c28){_0x20e6af[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0xd9')][_0x67b6('0x40')]);_0x20e6af[_0x67b6('0x46')]=_[_0x67b6('0x5b')](_0xe05c85[_0x67b6('0x46')]);_0x20e6af['filters']=_[_0x67b6('0x5c')](_0x20e6af[_0x67b6('0x59')],_0x20e6af[_0x67b6('0x46')]);_0x262d11[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x20e6af['model'],qs[_0x67b6('0x5d')](_0xe05c85[_0x67b6('0x46')]['fields']));_0x262d11[_0x67b6('0x4b')]=_0x262d11[_0x67b6('0x4b')]['length']?_0x262d11['attributes']:_0x20e6af[_0x67b6('0x59')];if(!_0xe05c85[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x262d11[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0xe05c85[_0x67b6('0x46')][_0x67b6('0x25')]);_0x262d11[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0xe05c85[_0x67b6('0x46')]['offset']);}_0x262d11[_0x67b6('0xc6')]=qs['sort'](_0xe05c85['query'][_0x67b6('0xc7')]);_0x262d11[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0xe05c85[_0x67b6('0x46')],_0x20e6af[_0x67b6('0xc5')]));_0x262d11[_0x67b6('0xc8')][_0x67b6('0xda')]=_0x250c28['id'];if(_0xe05c85['query']['filter']){_0x262d11[_0x67b6('0xc8')]=_['merge'](_0x262d11['where'],{'$or':_[_0x67b6('0x38')](_0x262d11['attributes'],function(_0x47a69b){var _0x4adb1d={};_0x4adb1d[_0x47a69b]={'$like':'%'+_0xe05c85[_0x67b6('0x46')]['filter']+'%'};return _0x4adb1d;})});}_0x262d11=_[_0x67b6('0xca')]({},_0x262d11,_0xe05c85[_0x67b6('0x5e')]);return db['VoiceRecording'][_0x67b6('0x27')]({'where':_0x262d11[_0x67b6('0xc8')]})[_0x67b6('0x17')](function(_0x5abe9){_0xf02622[_0x67b6('0x27')]=_0x5abe9;if(_0xe05c85[_0x67b6('0x46')][_0x67b6('0x47')]){_0x262d11[_0x67b6('0x48')]=[{'all':!![]}];}return db[_0x67b6('0xd9')][_0x67b6('0x4d')](_0x262d11);})[_0x67b6('0x17')](function(_0x536eef){_0xf02622[_0x67b6('0x4e')]=_0x536eef;return _0xf02622;});}})[_0x67b6('0x17')](respondWithFilteredResult(_0xb1797d,_0x262d11))['catch'](handleError(_0xb1797d,null));};exports[_0x67b6('0xdb')]=function(_0x45c237,_0x128930){var _0x553da7={'raw':!![],'where':{}};var _0x23a271={};var _0x51f042={'count':0x0,'rows':[]};return db['User'][_0x67b6('0x94')]({'where':{'id':_0x45c237[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x128930,null))[_0x67b6('0x17')](function(_0x2d2117){if(_0x2d2117){_0x23a271['model']=_[_0x67b6('0x5b')](db['ScreenRecording'][_0x67b6('0x40')]);_0x23a271[_0x67b6('0x46')]=_['keys'](_0x45c237[_0x67b6('0x46')]);_0x23a271[_0x67b6('0xc5')]=_['intersection'](_0x23a271[_0x67b6('0x59')],_0x23a271['query']);_0x553da7[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x23a271[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x45c237['query'][_0x67b6('0x5d')]));_0x553da7['attributes']=_0x553da7[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x553da7[_0x67b6('0x4b')]:_0x23a271['model'];if(!_0x45c237[_0x67b6('0x46')][_0x67b6('0xcc')]('nolimit')){_0x553da7['limit']=qs['limit'](_0x45c237[_0x67b6('0x46')][_0x67b6('0x25')]);_0x553da7[_0x67b6('0x24')]=qs['offset'](_0x45c237[_0x67b6('0x46')][_0x67b6('0x24')]);}_0x553da7[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x45c237['query'][_0x67b6('0xc7')]);_0x553da7[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x45c237[_0x67b6('0x46')],_0x23a271[_0x67b6('0xc5')]));_0x553da7[_0x67b6('0xc8')][_0x67b6('0xda')]=_0x2d2117['id'];if(_0x45c237['query'][_0x67b6('0x43')]){_0x553da7[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x553da7[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x553da7[_0x67b6('0x4b')],function(_0x11691e){var _0x1a43c0={};_0x1a43c0[_0x11691e]={'$like':'%'+_0x45c237[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x1a43c0;})});}_0x553da7=_[_0x67b6('0xca')]({},_0x553da7,_0x45c237['options']);return db['ScreenRecording']['count']({'where':_0x553da7[_0x67b6('0xc8')]})[_0x67b6('0x17')](function(_0x49b2d){_0x51f042[_0x67b6('0x27')]=_0x49b2d;if(_0x45c237[_0x67b6('0x46')][_0x67b6('0x47')]){_0x553da7[_0x67b6('0x48')]=[{'all':!![]}];}return db[_0x67b6('0xdc')][_0x67b6('0x4d')](_0x553da7);})['then'](function(_0x5e77cc){_0x51f042[_0x67b6('0x4e')]=_0x5e77cc;return _0x51f042;});}})[_0x67b6('0x17')](respondWithFilteredResult(_0x128930,_0x553da7))['catch'](handleError(_0x128930,null));};exports[_0x67b6('0xdd')]=function(_0x37869a,_0x287fe5){var _0x1156bc={};var _0x50b186={};var _0x5e3c88;var _0x4e7f93;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x37869a[_0x67b6('0x58')]['id']}})['then'](handleEntityNotFound(_0x287fe5,null))[_0x67b6('0x17')](function(_0x43144f){if(_0x43144f){_0x5e3c88=_0x43144f;_0x50b186[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db['ChatInteraction'][_0x67b6('0x40')]);_0x50b186['query']=_[_0x67b6('0x5b')](_0x37869a[_0x67b6('0x46')]);_0x50b186[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x50b186[_0x67b6('0x59')],_0x50b186[_0x67b6('0x46')]);_0x1156bc[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x50b186[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x37869a[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x1156bc[_0x67b6('0x4b')]=_0x1156bc['attributes'][_0x67b6('0x50')]?_0x1156bc['attributes']:_0x50b186[_0x67b6('0x59')];_0x1156bc[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x37869a[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x1156bc[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x37869a[_0x67b6('0x46')],_0x50b186[_0x67b6('0xc5')]));if(_0x37869a[_0x67b6('0x46')]['filter']){_0x1156bc['where']=_[_0x67b6('0xca')](_0x1156bc[_0x67b6('0xc8')],{'$or':_['map'](_0x1156bc['attributes'],function(_0x803c95){var _0x19e88f={};_0x19e88f[_0x803c95]={'$like':'%'+_0x37869a[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x19e88f;})});}_0x1156bc=_[_0x67b6('0xca')]({},_0x1156bc,_0x37869a[_0x67b6('0x5e')]);return _0x5e3c88[_0x67b6('0xdd')](_0x1156bc);}})[_0x67b6('0x17')](function(_0x518fe7){if(_0x518fe7){_0x4e7f93=_0x518fe7[_0x67b6('0x50')];if(!_0x37869a['query'][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x1156bc['limit']=qs[_0x67b6('0x25')](_0x37869a['query'][_0x67b6('0x25')]);_0x1156bc['offset']=qs[_0x67b6('0x24')](_0x37869a[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x5e3c88[_0x67b6('0xdd')](_0x1156bc);}})[_0x67b6('0x17')](function(_0x43d7f1){if(_0x43d7f1){return _0x43d7f1?{'count':_0x4e7f93,'rows':_0x43d7f1}:null;}})[_0x67b6('0x17')](respondWithResult(_0x287fe5,null))[_0x67b6('0x1f')](handleError(_0x287fe5,null));};exports[_0x67b6('0xde')]=function(_0x213f64,_0x11aede){var _0x2924f3={};var _0x34228e={};var _0x5cada2;var _0x581c31;return db['User'][_0x67b6('0x94')]({'where':{'id':_0x213f64[_0x67b6('0x58')]['id']}})['then'](handleEntityNotFound(_0x11aede,null))[_0x67b6('0x17')](function(_0x2d7aa4){if(_0x2d7aa4){_0x5cada2=_0x2d7aa4;_0x34228e[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0xdf')][_0x67b6('0x40')]);_0x34228e[_0x67b6('0x46')]=_['keys'](_0x213f64[_0x67b6('0x46')]);_0x34228e[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x34228e['model'],_0x34228e[_0x67b6('0x46')]);_0x2924f3[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x34228e[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x213f64[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x2924f3[_0x67b6('0x4b')]=_0x2924f3[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x2924f3[_0x67b6('0x4b')]:_0x34228e[_0x67b6('0x59')];_0x2924f3[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x213f64['query']['sort']);_0x2924f3['where']=qs[_0x67b6('0xc5')](_['pick'](_0x213f64['query'],_0x34228e['filters']));if(_0x213f64[_0x67b6('0x46')][_0x67b6('0x43')]){_0x2924f3[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x2924f3[_0x67b6('0xc8')],{'$or':_['map'](_0x2924f3[_0x67b6('0x4b')],function(_0xa7736f){var _0x3fe52c={};_0x3fe52c[_0xa7736f]={'$like':'%'+_0x213f64[_0x67b6('0x46')]['filter']+'%'};return _0x3fe52c;})});}_0x2924f3=_[_0x67b6('0xca')]({},_0x2924f3,_0x213f64[_0x67b6('0x5e')]);return _0x5cada2[_0x67b6('0xde')](_0x2924f3);}})[_0x67b6('0x17')](function(_0x5a8056){if(_0x5a8056){_0x581c31=_0x5a8056[_0x67b6('0x50')];if(!_0x213f64['query']['hasOwnProperty'](_0x67b6('0xd1'))){_0x2924f3[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x213f64[_0x67b6('0x46')][_0x67b6('0x25')]);_0x2924f3['offset']=qs[_0x67b6('0x24')](_0x213f64['query']['offset']);}return _0x5cada2[_0x67b6('0xde')](_0x2924f3);}})[_0x67b6('0x17')](function(_0x9f2185){if(_0x9f2185){return _0x9f2185?{'count':_0x581c31,'rows':_0x9f2185}:null;}})['then'](respondWithResult(_0x11aede,null))[_0x67b6('0x1f')](handleError(_0x11aede,null));};exports['getMailInteractions']=function(_0x37975a,_0xbc4773){var _0x4d6d35={'raw':!![],'where':{}};var _0xefd11b={};var _0x37b9f9={'count':0x0,'rows':[]};return db['User'][_0x67b6('0x94')]({'where':{'id':_0x37975a[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0xbc4773,null))[_0x67b6('0x17')](function(_0xf0ed22){if(_0xf0ed22){_0xefd11b[_0x67b6('0x59')]=_['keys'](db[_0x67b6('0xe0')]['rawAttributes']);_0xefd11b[_0x67b6('0x46')]=_['keys'](_0x37975a[_0x67b6('0x46')]);_0xefd11b[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0xefd11b[_0x67b6('0x59')],_0xefd11b['query']);_0x4d6d35[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0xefd11b[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x37975a[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x4d6d35['attributes']=_0x4d6d35['attributes'][_0x67b6('0x50')]?_0x4d6d35[_0x67b6('0x4b')]:_0xefd11b[_0x67b6('0x59')];if(!_0x37975a[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x4d6d35[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x37975a[_0x67b6('0x46')][_0x67b6('0x25')]);_0x4d6d35[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x37975a['query'][_0x67b6('0x24')]);}_0x4d6d35['order']=qs[_0x67b6('0xc7')](_0x37975a[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x4d6d35['where']=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x37975a[_0x67b6('0x46')],_0xefd11b[_0x67b6('0xc5')]));_0x4d6d35[_0x67b6('0xc8')][_0x67b6('0xda')]=_0xf0ed22['id'];if(_0x37975a[_0x67b6('0x46')][_0x67b6('0x43')]){_0x4d6d35['where']=_[_0x67b6('0xca')](_0x4d6d35[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x4d6d35[_0x67b6('0x4b')],function(_0x4565f5){var _0x56b07b={};_0x56b07b[_0x4565f5]={'$like':'%'+_0x37975a[_0x67b6('0x46')]['filter']+'%'};return _0x56b07b;})});}_0x4d6d35=_[_0x67b6('0xca')]({},_0x4d6d35,_0x37975a[_0x67b6('0x5e')]);return db['MailInteraction'][_0x67b6('0x27')]({'where':_0x4d6d35[_0x67b6('0xc8')]})['then'](function(_0x21b8ac){_0x37b9f9[_0x67b6('0x27')]=_0x21b8ac;if(_0x37975a['query']['includeAll']){_0x4d6d35[_0x67b6('0x48')]=[{'all':!![]}];}return db['MailInteraction'][_0x67b6('0x4d')](_0x4d6d35);})['then'](function(_0x22faa7){_0x37b9f9[_0x67b6('0x4e')]=_0x22faa7;return _0x37b9f9;});}})['then'](respondWithFilteredResult(_0xbc4773,_0x4d6d35))[_0x67b6('0x1f')](handleError(_0xbc4773,null));};exports[_0x67b6('0xe1')]=function(_0x462a55,_0x14d8fa){var _0x328346={};var _0x29f8eb={};var _0x1bdfc8;var _0x3ff483;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x462a55[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x14d8fa,null))[_0x67b6('0x17')](function(_0x42c4de){if(_0x42c4de){_0x1bdfc8=_0x42c4de;_0x29f8eb['model']=_[_0x67b6('0x5b')](db[_0x67b6('0xe2')][_0x67b6('0x40')]);_0x29f8eb['query']=_[_0x67b6('0x5b')](_0x462a55[_0x67b6('0x46')]);_0x29f8eb[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x29f8eb['model'],_0x29f8eb['query']);_0x328346['attributes']=_[_0x67b6('0x5c')](_0x29f8eb[_0x67b6('0x59')],qs['fields'](_0x462a55['query'][_0x67b6('0x5d')]));_0x328346[_0x67b6('0x4b')]=_0x328346[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x328346[_0x67b6('0x4b')]:_0x29f8eb[_0x67b6('0x59')];_0x328346['order']=qs[_0x67b6('0xc7')](_0x462a55[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x328346[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_['pick'](_0x462a55[_0x67b6('0x46')],_0x29f8eb['filters']));if(_0x462a55['query'][_0x67b6('0x43')]){_0x328346['where']=_[_0x67b6('0xca')](_0x328346[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x328346['attributes'],function(_0x2bca3f){var _0x2ce79f={};_0x2ce79f[_0x2bca3f]={'$like':'%'+_0x462a55[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x2ce79f;})});}_0x328346=_[_0x67b6('0xca')]({},_0x328346,_0x462a55[_0x67b6('0x5e')]);return _0x1bdfc8['getSmsInteractions'](_0x328346);}})[_0x67b6('0x17')](function(_0x17a910){if(_0x17a910){_0x3ff483=_0x17a910[_0x67b6('0x50')];if(!_0x462a55['query'][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x328346[_0x67b6('0x25')]=qs['limit'](_0x462a55[_0x67b6('0x46')][_0x67b6('0x25')]);_0x328346[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x462a55[_0x67b6('0x46')]['offset']);}return _0x1bdfc8[_0x67b6('0xe1')](_0x328346);}})[_0x67b6('0x17')](function(_0x4c4167){if(_0x4c4167){return _0x4c4167?{'count':_0x3ff483,'rows':_0x4c4167}:null;}})[_0x67b6('0x17')](respondWithResult(_0x14d8fa,null))[_0x67b6('0x1f')](handleError(_0x14d8fa,null));};exports['getFaxInteractions']=function(_0x6bc73b,_0x1451f4){var _0x4f91a7={};var _0x1d3810={};var _0x142790;var _0x22b074;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x6bc73b[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x1451f4,null))[_0x67b6('0x17')](function(_0x3be5ae){if(_0x3be5ae){_0x142790=_0x3be5ae;_0x1d3810[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0xe3')]['rawAttributes']);_0x1d3810['query']=_['keys'](_0x6bc73b[_0x67b6('0x46')]);_0x1d3810['filters']=_[_0x67b6('0x5c')](_0x1d3810[_0x67b6('0x59')],_0x1d3810[_0x67b6('0x46')]);_0x4f91a7['attributes']=_[_0x67b6('0x5c')](_0x1d3810[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x6bc73b[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x4f91a7['attributes']=_0x4f91a7[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x4f91a7[_0x67b6('0x4b')]:_0x1d3810['model'];_0x4f91a7[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x6bc73b['query'][_0x67b6('0xc7')]);_0x4f91a7[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x6bc73b['query'],_0x1d3810[_0x67b6('0xc5')]));if(_0x6bc73b[_0x67b6('0x46')][_0x67b6('0x43')]){_0x4f91a7[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x4f91a7[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x4f91a7[_0x67b6('0x4b')],function(_0x24f7a0){var _0x43b2e7={};_0x43b2e7[_0x24f7a0]={'$like':'%'+_0x6bc73b[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x43b2e7;})});}_0x4f91a7=_[_0x67b6('0xca')]({},_0x4f91a7,_0x6bc73b[_0x67b6('0x5e')]);return _0x142790[_0x67b6('0xe4')](_0x4f91a7);}})[_0x67b6('0x17')](function(_0x2e8ba8){if(_0x2e8ba8){_0x22b074=_0x2e8ba8['length'];if(!_0x6bc73b['query'][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x4f91a7[_0x67b6('0x25')]=qs['limit'](_0x6bc73b[_0x67b6('0x46')]['limit']);_0x4f91a7[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x6bc73b['query'][_0x67b6('0x24')]);}return _0x142790[_0x67b6('0xe4')](_0x4f91a7);}})[_0x67b6('0x17')](function(_0x4a9a18){if(_0x4a9a18){return _0x4a9a18?{'count':_0x22b074,'rows':_0x4a9a18}:null;}})[_0x67b6('0x17')](respondWithResult(_0x1451f4,null))[_0x67b6('0x1f')](handleError(_0x1451f4,null));};exports['getWhatsappInteractions']=function(_0x36335c,_0x5baf53){var _0x45b13b={};var _0x5e6530={};var _0x554c91;var _0x37ad6b;return db[_0x67b6('0x3f')]['findOne']({'where':{'id':_0x36335c['params']['id']}})['then'](handleEntityNotFound(_0x5baf53,null))[_0x67b6('0x17')](function(_0xb48b02){if(_0xb48b02){_0x554c91=_0xb48b02;_0x5e6530[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db['WhatsappInteraction'][_0x67b6('0x40')]);_0x5e6530[_0x67b6('0x46')]=_[_0x67b6('0x5b')](_0x36335c[_0x67b6('0x46')]);_0x5e6530[_0x67b6('0xc5')]=_['intersection'](_0x5e6530[_0x67b6('0x59')],_0x5e6530['query']);_0x45b13b[_0x67b6('0x4b')]=_['intersection'](_0x5e6530[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x36335c[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x45b13b[_0x67b6('0x4b')]=_0x45b13b[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x45b13b[_0x67b6('0x4b')]:_0x5e6530[_0x67b6('0x59')];_0x45b13b['order']=qs[_0x67b6('0xc7')](_0x36335c['query'][_0x67b6('0xc7')]);_0x45b13b[_0x67b6('0xc8')]=qs['filters'](_['pick'](_0x36335c[_0x67b6('0x46')],_0x5e6530['filters']));if(_0x36335c[_0x67b6('0x46')][_0x67b6('0x43')]){_0x45b13b[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x45b13b[_0x67b6('0xc8')],{'$or':_['map'](_0x45b13b['attributes'],function(_0x5a29fb){var _0x32bd72={};_0x32bd72[_0x5a29fb]={'$like':'%'+_0x36335c[_0x67b6('0x46')]['filter']+'%'};return _0x32bd72;})});}_0x45b13b=_[_0x67b6('0xca')]({},_0x45b13b,_0x36335c['options']);return _0x554c91['getWhatsappInteractions'](_0x45b13b);}})[_0x67b6('0x17')](function(_0x38b225){if(_0x38b225){_0x37ad6b=_0x38b225[_0x67b6('0x50')];if(!_0x36335c['query']['hasOwnProperty']('nolimit')){_0x45b13b['limit']=qs['limit'](_0x36335c['query']['limit']);_0x45b13b[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x36335c[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x554c91[_0x67b6('0xe5')](_0x45b13b);}})[_0x67b6('0x17')](function(_0x1ef197){if(_0x1ef197){return _0x1ef197?{'count':_0x37ad6b,'rows':_0x1ef197}:null;}})[_0x67b6('0x17')](respondWithResult(_0x5baf53,null))[_0x67b6('0x1f')](handleError(_0x5baf53,null));};exports[_0x67b6('0xe6')]=function(_0x1112c8,_0x3d7273,_0x48c151){var _0x1ad39f;var _0x319cd7;var _0xf5d2d2;var _0x2f2638=!_[_0x67b6('0x69')](_0x1112c8[_0x67b6('0x58')]['id'])?_0x1112c8[_0x67b6('0x58')]['id']:!_[_0x67b6('0x69')](_0x1112c8[_0x67b6('0x32')]['id'])?_0x1112c8['user']['id']:null;return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x2f2638,'role':{'$or':['admin',_0x67b6('0x32'),_0x67b6('0x34')]}},'attributes':['id','name','phone',_0x67b6('0xe7'),'role',_0x67b6('0x64'),_0x67b6('0x9e')]})[_0x67b6('0x17')](function(_0x4eba6b){if(_0x4eba6b){if(_0x4eba6b[_0x67b6('0x2b')]===_0x67b6('0x34')){_0x1ad39f=_0x4eba6b;if(_0x1112c8['body'][_0x67b6('0xa0')]){_0xf5d2d2=util['format'](_0x67b6('0xe8'),_0x1ad39f[_0x1112c8[_0x67b6('0x60')][_0x67b6('0xa0')]]);}else if(_0x1112c8[_0x67b6('0x60')][_0x67b6('0xe9')]){_0xf5d2d2=util[_0x67b6('0xea')](_0x67b6('0xad'),_0x1112c8[_0x67b6('0x60')]['intrf']);}else{_0xf5d2d2=util[_0x67b6('0xea')](_0x67b6('0xad'),_0x1ad39f[_0x67b6('0x3c')]);}socket['to'](util['format']('user:%s',_0x1ad39f['name']))[_0x67b6('0x2c')](_0x67b6('0xeb'),{'user':{'id':_0x1ad39f['id'],'name':_0x1ad39f[_0x67b6('0x3c')]},'ip':_0x1112c8['headers'][_0x67b6('0xec')]||_0x1112c8[_0x67b6('0xed')][_0x67b6('0xee')]||_0x1112c8['socket'][_0x67b6('0xee')]||_0x1112c8[_0x67b6('0xed')][_0x67b6('0xef')][_0x67b6('0xee')]});return db['UserVoiceQueueRt'][_0x67b6('0x2e')]({'where':{'membername':_0x1ad39f[_0x67b6('0x3c')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x67b6('0x8e'))](_0x67b6('0xf0'));}})[_0x67b6('0x17')](function(){if(_0x1ad39f){return _0x1ad39f['getVoiceQueues']({'raw':!![]});}})[_0x67b6('0x17')](function(_0x5b8845){if(_0x1ad39f){if(_0x5b8845){_0x319cd7=_0x5b8845;if(_0x319cd7[_0x67b6('0x50')]){var _0x41b085=_0x319cd7[_0x67b6('0x38')](function(_0x5054be){var _0x1a7778={'membername':_0x1ad39f['name'],'UserId':_0x1ad39f['id'],'queue_name':_0x5054be[_0x67b6('0x3c')],'VoiceQueueId':_0x5054be['id'],'interface':_0xf5d2d2,'paused':_0x1ad39f[_0x67b6('0x9e')]||![],'penalty':_0x5054be['UserVoiceQueue.penalty']||0x0};return db[_0x67b6('0xae')][_0x67b6('0xaf')](_0x1a7778);});return Promise[_0x67b6('0x56')](_0x41b085);}}}})[_0x67b6('0x17')](function(){if(_0x1ad39f){return db[_0x67b6('0xf1')]['findAll']({'where':{'membername':_0x1ad39f[_0x67b6('0x3c')],'exitAt':null}});}})['then'](function(_0x2215bf){if(_0x1ad39f){var _0x327d80=[];_0x2215bf[_0x67b6('0xf2')](function(_0x903377){_0x327d80['push'](_0x903377[_0x67b6('0x2a')]({'exitAt':moment()[_0x67b6('0xea')](_0x67b6('0xf3'))}));});return Promise[_0x67b6('0x56')](_0x327d80);}})[_0x67b6('0x17')](function(){if(_0x1ad39f){var _0x4924c7=[];var _0x5603d8=[];var _0x5c8598=utils[_0x67b6('0xf4')]();var _0x3fe436={'membername':_0x1ad39f['name'],'interface':_0xf5d2d2,'enterAt':moment()[_0x67b6('0xea')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1ad39f[_0x67b6('0x2b')],'internal':_0x1ad39f[_0x67b6('0x64')]};_0x5c8598[_0x67b6('0xf2')](function(_0x71ebd){_0x4924c7[_0x67b6('0x4c')](_['merge']({'channel':_0x71ebd,'type':_0x67b6('0xf5'),'data1':_0x1112c8[_0x67b6('0x60')][_0x67b6('0xf6')],'data2':_0xf5d2d2},_0x3fe436));if(_0x1ad39f['loginInPause']){_0x5603d8[_0x67b6('0x4c')](_[_0x67b6('0xca')]({'channel':_0x71ebd,'type':'PAUSE','data1':_0x67b6('0xf7')},_0x3fe436));}});return db[_0x67b6('0xf1')][_0x67b6('0xf8')](_0x4924c7[_0x67b6('0xc4')](_0x5603d8),{'individualHooks':!![]});}})[_0x67b6('0x17')](function(){if(_0x1ad39f){return _0x1ad39f[_0x67b6('0x2a')]({'online':!![],'lastLoginAt':moment()[_0x67b6('0xea')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1ad39f[_0x67b6('0x9e')]||![],'mailPause':_0x1ad39f[_0x67b6('0x9e')]||![],'chatPause':_0x1ad39f[_0x67b6('0x9e')]||![],'faxPause':_0x1ad39f[_0x67b6('0x9e')]||![],'smsPause':_0x1ad39f[_0x67b6('0x9e')]||![],'openchannelPause':_0x1ad39f['loginInPause']||![],'whatsappPause':_0x1ad39f['loginInPause']||![],'pauseType':_0x1ad39f[_0x67b6('0x9e')]?_0x67b6('0xf7'):null,'interface':_0xf5d2d2,'lastPauseAt':moment()['format'](_0x67b6('0xf3'))});}})[_0x67b6('0x17')](function(_0x70778b){if(_0x1112c8[_0x67b6('0xf9')]){return _0x48c151();}else{return Promise['resolve'](_0x70778b)[_0x67b6('0x17')](respondWithResult(_0x3d7273,null));}})[_0x67b6('0x1f')](handleError(_0x3d7273,null));};exports[_0x67b6('0xfa')]=function(_0x585e29,_0x97f0d1){var _0x50df8a;return db['User'][_0x67b6('0x3b')]({'where':{'id':_0x585e29[_0x67b6('0x58')]['id'],'role':_0x67b6('0x34')},'attributes':['id',_0x67b6('0x3c'),_0x67b6('0x2b')]})['then'](handleEntityNotFound(_0x97f0d1,null))['then'](function(_0x7ccc82){if(_0x7ccc82){_0x50df8a=_0x7ccc82;return db[_0x67b6('0xae')][_0x67b6('0x2e')]({'where':{'membername':_0x50df8a[_0x67b6('0x3c')]},'individualHooks':!![]});}})[_0x67b6('0x17')](function(){return db[_0x67b6('0xf1')][_0x67b6('0x4d')]({'where':{'membername':_0x50df8a[_0x67b6('0x3c')],'exitAt':null}});})['then'](function(_0x453161){var _0x1242c5=[];_0x453161[_0x67b6('0xf2')](function(_0x10c291){_0x1242c5[_0x67b6('0x4c')](_0x10c291[_0x67b6('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x67b6('0x56')](_0x1242c5);})['then'](function(){return _0x50df8a[_0x67b6('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x67b6('0x17')](respondWithResult(_0x97f0d1,null))[_0x67b6('0x1f')](handleError(_0x97f0d1,null));};exports[_0x67b6('0xfb')]=function(_0x33ade9,_0x3bb86b){var _0x4228a6;return db[_0x67b6('0xae')][_0x67b6('0x2a')]({'paused':0x1},{'where':{'UserId':_0x33ade9[_0x67b6('0x58')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x67b6('0x3f')]['find']({'where':{'id':_0x33ade9[_0x67b6('0x58')]['id'],'role':_0x67b6('0x34')},'attributes':['id',_0x67b6('0x3c'),_0x67b6('0x2b'),_0x67b6('0x64'),_0x67b6('0xa0'),'online']});})[_0x67b6('0x17')](handleEntityNotFound(_0x3bb86b,null))[_0x67b6('0x17')](function(_0x4f056f){if(_0x4f056f){_0x4228a6=_0x4f056f;return respondWithRpcPromise(_0x67b6('0xfc'),_0x67b6('0xfb'),{'id':_0x4228a6['id'],'name':_0x4228a6['name'],'pause':!![]});}})[_0x67b6('0x17')](function(){if(_0x4228a6){return db[_0x67b6('0xf1')]['findAll']({'where':{'membername':_0x4228a6[_0x67b6('0x3c')],'type':_0x67b6('0xfd'),'exitAt':null}});}})['then'](function(_0x3dedca){if(_0x3dedca[_0x67b6('0x50')]){var _0x3f0fb3=moment()[_0x67b6('0xea')](_0x67b6('0xf3'));for(var _0x52e5a8=0x0,_0x4be08a=_0x3dedca[_0x67b6('0x50')];_0x52e5a8<_0x4be08a;_0x52e5a8++){_0x3dedca[_0x52e5a8][_0x67b6('0xfe')]({'exitAt':_0x3f0fb3});}}})[_0x67b6('0x17')](function(){var _0x3cc2f6=[];var _0x5603c1=utils['getChannels']();_0x5603c1[_0x67b6('0xf2')](function(_0x50a757){_0x3cc2f6[_0x67b6('0x4c')]({'channel':_0x50a757,'membername':_0x4228a6[_0x67b6('0x3c')],'interface':_[_0x67b6('0x69')](_0x4228a6[_0x67b6('0xa0')])?util[_0x67b6('0xea')](_0x67b6('0xad'),_0x4228a6['name']):_0x4228a6['interface'],'type':_0x67b6('0xfd'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x33ade9['body'][_0x67b6('0x42')]||'DEFAULT\x20PAUSE','role':_0x4228a6[_0x67b6('0x2b')],'internal':_0x4228a6[_0x67b6('0x64')]});});return db[_0x67b6('0xf1')][_0x67b6('0xf8')](_0x3cc2f6,{'individualHooks':!![]});})[_0x67b6('0x17')](function(){return _0x4228a6[_0x67b6('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x33ade9[_0x67b6('0x60')]['type']||_0x67b6('0xff'),'lastPauseAt':moment()[_0x67b6('0xea')](_0x67b6('0xf3'))});})['then'](respondWithResult(_0x3bb86b,null))[_0x67b6('0x1f')](handleError(_0x3bb86b,null));};exports[_0x67b6('0x100')]=function(_0x39613d,_0x47e360){if(_0x39613d[_0x67b6('0x60')][_0x67b6('0x9c')]&&!utils[_0x67b6('0xa1')](_0x39613d[_0x67b6('0x60')][_0x67b6('0x9c')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x39613d['body'][_0x67b6('0x9c')]));}return db[_0x67b6('0x3f')][_0x67b6('0x3b')]({'where':{'id':_0x39613d[_0x67b6('0x58')]['id']},'attributes':['id',_0x67b6('0x3c'),'role',_0x67b6('0x64'),_0x67b6('0xa0'),_0x67b6('0x9d'),_0x67b6('0x9f'),_0x67b6('0x101'),'chatPause',_0x67b6('0x102'),_0x67b6('0x103'),_0x67b6('0x104'),_0x67b6('0x105'),_0x67b6('0x106'),_0x67b6('0x107')]})['then'](function(_0xa4717b){if(!_0xa4717b){throw new APINotFoundError(util[_0x67b6('0xea')](_0x67b6('0x108'),_0x39613d['params']['id']));}return _0xa4717b['unpause'](_0x39613d[_0x67b6('0x60')]['channel']);})[_0x67b6('0x17')](respondWithResult(_0x47e360,null))[_0x67b6('0x1f')](APIHandleError(_0x47e360));};exports[_0x67b6('0x109')]=function(_0x3f79db,_0x1c7e92){var _0x3467b0={};var _0x23371d={};var _0x287b16;var _0x3c235b;return db['User'][_0x67b6('0x94')]({'where':{'id':_0x3f79db[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x1c7e92,null))[_0x67b6('0x17')](function(_0x53972b){if(_0x53972b){_0x287b16=_0x53972b;_0x23371d[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0x10a')][_0x67b6('0x40')]);_0x23371d[_0x67b6('0x46')]=_['keys'](_0x3f79db[_0x67b6('0x46')]);_0x23371d['filters']=_['intersection'](_0x23371d[_0x67b6('0x59')],_0x23371d[_0x67b6('0x46')]);_0x3467b0['attributes']=_[_0x67b6('0x5c')](_0x23371d[_0x67b6('0x59')],qs['fields'](_0x3f79db['query']['fields']));_0x3467b0[_0x67b6('0x4b')]=_0x3467b0['attributes'][_0x67b6('0x50')]?_0x3467b0[_0x67b6('0x4b')]:_0x23371d[_0x67b6('0x59')];_0x3467b0['order']=qs[_0x67b6('0xc7')](_0x3f79db[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x3467b0[_0x67b6('0xc8')]=qs[_0x67b6('0xc5')](_[_0x67b6('0xc9')](_0x3f79db['query'],_0x23371d[_0x67b6('0xc5')]));if(_0x3f79db['query'][_0x67b6('0x43')]){_0x3467b0['where']=_['merge'](_0x3467b0[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x3467b0['attributes'],function(_0x1f8817){var _0x50a3b3={};_0x50a3b3[_0x1f8817]={'$like':'%'+_0x3f79db[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x50a3b3;})});}_0x3467b0=_['merge']({},_0x3467b0,_0x3f79db[_0x67b6('0x5e')]);return _0x287b16[_0x67b6('0x109')](_0x3467b0);}})[_0x67b6('0x17')](function(_0x64cf3d){if(_0x64cf3d){_0x3c235b=_0x64cf3d['length'];if(!_0x3f79db[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x3467b0[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x3f79db['query'][_0x67b6('0x25')]);_0x3467b0[_0x67b6('0x24')]=qs[_0x67b6('0x24')](_0x3f79db[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x287b16[_0x67b6('0x109')](_0x3467b0);}})[_0x67b6('0x17')](function(_0x4c727b){if(_0x4c727b){return _0x4c727b?{'count':_0x3c235b,'rows':_0x4c727b}:null;}})[_0x67b6('0x17')](respondWithResult(_0x1c7e92,null))[_0x67b6('0x1f')](handleError(_0x1c7e92,null));};exports['addTeams']=function(_0x92a781,_0x4a759d){var _0x55cc0d=_0x92a781['params']['id'];var _0x52bf30=_0x92a781[_0x67b6('0x60')]?_0x92a781[_0x67b6('0x60')]['ids']:null;var _0x4cb21b=[];return Promise[_0x67b6('0x10b')]()[_0x67b6('0x17')](function(){if(!_0x52bf30)throw new APIBadRequestError(_0x67b6('0x10c'));})[_0x67b6('0x17')](function(){return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x55cc0d}});})[_0x67b6('0x17')](function(_0x3a3757){if(!_0x3a3757)throw new APINotFoundError(util[_0x67b6('0xea')](_0x67b6('0x108'),_0x92a781[_0x67b6('0x58')]['id']));return db[_0x67b6('0x6b')][_0x67b6('0x10d')](function(_0x15af11){return _0x3a3757[_0x67b6('0x10e')](_0x52bf30,{'transaction':_0x15af11})['then'](function(){return db[_0x67b6('0x10a')][_0x67b6('0x4d')]({'where':{'id':{'$in':_0x52bf30}}});})['then'](function(_0x5f2814){var _0x23ea0a=_[_0x67b6('0x38')](_0x5f2814,function(_0x7e6ea6){return _0x7e6ea6[_0x67b6('0x10f')]();});return Promise[_0x67b6('0x56')](_0x23ea0a);})[_0x67b6('0x17')](function(_0x12287d){_0x4cb21b=_['flattenDeep'](_0x12287d);var _0x4397ca=_[_0x67b6('0x38')](_0x4cb21b,function(_0x17400d){return _0x17400d[_0x67b6('0x110')](_0x3a3757['id'],{'transaction':_0x15af11});});return Promise['all'](_0x4397ca);})[_0x67b6('0x17')](function(){if(!_0x3a3757['online'])return;var _0x31f807=_[_0x67b6('0x43')](_0x4cb21b,function(_0x3e9081){return _0x3e9081[_0x67b6('0x111')]('channel')===_0x67b6('0x112');});var _0x5a7658=_['map'](_0x31f807,function(_0x42c30f){return db[_0x67b6('0xae')][_0x67b6('0xaf')]({'membername':_0x3a3757[_0x67b6('0x3c')],'UserId':_0x3a3757['id'],'queue_name':_0x42c30f[_0x67b6('0x3c')],'VoiceQueueId':_0x42c30f['id'],'interface':_['isNil'](_0x3a3757[_0x67b6('0xa0')])?util['format']('SIP/%s',_0x3a3757['name']):_0x3a3757[_0x67b6('0xa0')],'paused':_0x3a3757[_0x67b6('0x9f')]||![],'penalty':_0x3a3757['penalty']},{'transaction':_0x15af11});});return Promise[_0x67b6('0x56')](_0x5a7658);})[_0x67b6('0x17')](function(){return db[_0x67b6('0x113')][_0x67b6('0x4d')]({'where':{'teamId':{'$in':_0x52bf30}}});})['then'](function(_0x3337aa){var _0x10cba7=_['map'](_0x3337aa,function(_0x27718f){return db[_0x67b6('0x114')]['create']({'UserId':_0x3a3757['id'],'VoicePrefixId':_0x27718f[_0x67b6('0x115')]},{'transaction':_0x15af11});});return Promise[_0x67b6('0x56')](_0x10cba7);});});})[_0x67b6('0x17')](function(){for(var _0x32d209=0x0;_0x32d209<_0x4cb21b[_0x67b6('0x50')];_0x32d209++){var _0x2c4122=_0x4cb21b[_0x32d209][_0x67b6('0x111')](_0x67b6('0x9c'));var _0x151539=_0x2c4122+_0x67b6('0xa9');socket['emit'](_0x67b6('0x32')+_0x2c4122+_0x67b6('0xaa'),{'UserId':_0x55cc0d,['queueField']:_0x4cb21b[_0x32d209]['id']});}})[_0x67b6('0x17')](respondWithStatusCode(_0x4a759d,null))['catch'](APIHandleError(_0x4a759d));};exports[_0x67b6('0x116')]=function(_0x33904e,_0x2fe80a){var _0x286988=_0x33904e[_0x67b6('0x58')]['id'];var _0x26149c=null;if(_0x33904e[_0x67b6('0x46')][_0x67b6('0x63')]){_0x26149c=_[_0x67b6('0x117')](_0x33904e[_0x67b6('0x46')][_0x67b6('0x63')])?_0x33904e['query'][_0x67b6('0x63')]:[_0x33904e['query'][_0x67b6('0x63')]];}var _0x338880=[];return Promise[_0x67b6('0x10b')]()[_0x67b6('0x17')](function(){if(!_0x26149c)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x67b6('0x17')](function(){return db[_0x67b6('0x3f')]['findOne']({'where':{'id':_0x286988}});})['then'](function(_0x1fb32f){if(!_0x1fb32f)throw new APINotFoundError(util['format'](_0x67b6('0x108'),_0x33904e[_0x67b6('0x58')]['id']));return db[_0x67b6('0x6b')][_0x67b6('0x10d')](function(_0x49b4b0){return _0x1fb32f[_0x67b6('0x116')](_0x26149c,{'transaction':_0x49b4b0})[_0x67b6('0x17')](function(){return db[_0x67b6('0x10a')][_0x67b6('0x4d')]({'where':{'id':{'$in':_0x26149c}}});})[_0x67b6('0x17')](function(_0x28ba5b){var _0x19b610=_['map'](_0x28ba5b,function(_0x3253c0){return _0x3253c0['getAssociatedQueues']();});return Promise['all'](_0x19b610);})[_0x67b6('0x17')](function(_0x528d37){_0x338880=_[_0x67b6('0x118')](_0x528d37);var _0x2010d3=_['map'](_0x338880,function(_0x58e2e0){return _0x58e2e0['removeAgent'](_0x1fb32f['id'],{'transaction':_0x49b4b0});});return Promise['all'](_0x2010d3);})[_0x67b6('0x17')](function(){if(!_0x1fb32f[_0x67b6('0x9d')])return;var _0x20bd7e=_[_0x67b6('0x43')](_0x338880,function(_0x2235ed){return _0x2235ed[_0x67b6('0x111')](_0x67b6('0x9c'))===_0x67b6('0x112');});var _0x2218c3=_[_0x67b6('0x38')](_0x20bd7e,function(_0x303d00){return db[_0x67b6('0xae')][_0x67b6('0x2e')]({'where':{'VoiceQueueId':_0x303d00['id'],'UserId':_0x1fb32f['id']},'transaction':_0x49b4b0});});return Promise[_0x67b6('0x56')](_0x2218c3);})['then'](function(){return db[_0x67b6('0x113')][_0x67b6('0x4d')]({'where':{'teamId':{'$in':_0x26149c}}});})[_0x67b6('0x17')](function(_0x3adb30){var _0x513470=_['map'](_0x3adb30,function(_0x30cc4b){return db[_0x67b6('0x114')][_0x67b6('0x2e')]({'where':{'UserId':_0x1fb32f['id'],'VoicePrefixId':_0x30cc4b[_0x67b6('0x115')]}},{'transaction':_0x49b4b0});});return Promise['all'](_0x513470);});});})[_0x67b6('0x17')](function(){for(var _0x1fb571=0x0;_0x1fb571<_0x338880[_0x67b6('0x50')];_0x1fb571++){var _0xe18e4a=_0x338880[_0x1fb571]['getDataValue'](_0x67b6('0x9c'));var _0x59aad=_0xe18e4a+'QueueId';socket[_0x67b6('0x2c')]('user'+_0xe18e4a+_0x67b6('0xb0'),{'UserId':_0x286988,['queueField']:_0x338880[_0x1fb571]['id']});}})[_0x67b6('0x17')](respondWithStatusCode(_0x2fe80a,null))[_0x67b6('0x1f')](APIHandleError(_0x2fe80a));};exports[_0x67b6('0x119')]=function(_0x5850b5,_0x3bc92c){var _0x5c19a2={};var _0x1f8e3f={};var _0x3808d8;var _0x49b7df;return db[_0x67b6('0x3f')]['findOne']({'where':{'id':_0x5850b5['params']['id']}})['then'](handleEntityNotFound(_0x3bc92c,null))[_0x67b6('0x17')](function(_0x21b155){if(_0x21b155){_0x3808d8=_0x21b155;_0x1f8e3f[_0x67b6('0x59')]=_['keys'](db['CmList']['rawAttributes']);_0x1f8e3f['query']=_[_0x67b6('0x5b')](_0x5850b5[_0x67b6('0x46')]);_0x1f8e3f['filters']=_[_0x67b6('0x5c')](_0x1f8e3f['model'],_0x1f8e3f[_0x67b6('0x46')]);_0x5c19a2[_0x67b6('0x4b')]=_[_0x67b6('0x5c')](_0x1f8e3f[_0x67b6('0x59')],qs['fields'](_0x5850b5[_0x67b6('0x46')][_0x67b6('0x5d')]));_0x5c19a2['attributes']=_0x5c19a2[_0x67b6('0x4b')]['length']?_0x5c19a2[_0x67b6('0x4b')]:_0x1f8e3f[_0x67b6('0x59')];_0x5c19a2['order']=qs[_0x67b6('0xc7')](_0x5850b5[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x5c19a2[_0x67b6('0xc8')]=qs['filters'](_[_0x67b6('0xc9')](_0x5850b5[_0x67b6('0x46')],_0x1f8e3f[_0x67b6('0xc5')]));if(_0x5850b5[_0x67b6('0x46')][_0x67b6('0x43')]){_0x5c19a2[_0x67b6('0xc8')]=_['merge'](_0x5c19a2[_0x67b6('0xc8')],{'$or':_['map'](_0x5c19a2['attributes'],function(_0x51ea5a){var _0x23191b={};_0x23191b[_0x51ea5a]={'$like':'%'+_0x5850b5[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x23191b;})});}_0x5c19a2=_['merge']({},_0x5c19a2,_0x5850b5[_0x67b6('0x5e')]);return _0x3808d8['getLists'](_0x5c19a2);}})['then'](function(_0x5ae415){if(_0x5ae415){_0x49b7df=_0x5ae415[_0x67b6('0x50')];if(!_0x5850b5[_0x67b6('0x46')][_0x67b6('0xcc')](_0x67b6('0xd1'))){_0x5c19a2[_0x67b6('0x25')]=qs[_0x67b6('0x25')](_0x5850b5[_0x67b6('0x46')]['limit']);_0x5c19a2['offset']=qs[_0x67b6('0x24')](_0x5850b5[_0x67b6('0x46')][_0x67b6('0x24')]);}return _0x3808d8[_0x67b6('0x119')](_0x5c19a2);}})[_0x67b6('0x17')](function(_0xd3ae24){if(_0xd3ae24){return _0xd3ae24?{'count':_0x49b7df,'rows':_0xd3ae24}:null;}})[_0x67b6('0x17')](respondWithResult(_0x3bc92c,null))[_0x67b6('0x1f')](handleError(_0x3bc92c,null));};exports[_0x67b6('0x11a')]=function(_0x310be1,_0x568964){var _0x3d979e={};var _0x3ff5c1={};var _0x521914;return db[_0x67b6('0x3f')][_0x67b6('0x94')]({'where':{'id':_0x310be1[_0x67b6('0x58')]['id']}})[_0x67b6('0x17')](handleEntityNotFound(_0x568964,null))[_0x67b6('0x17')](function(_0x5cf6cd){if(_0x5cf6cd){_0x521914=_0x5cf6cd;_0x3ff5c1[_0x67b6('0x59')]=_[_0x67b6('0x5b')](db[_0x67b6('0x3f')]['rawAttributes']);_0x3ff5c1[_0x67b6('0x46')]=_[_0x67b6('0x5b')](_0x310be1[_0x67b6('0x46')]);_0x3ff5c1[_0x67b6('0xc5')]=_[_0x67b6('0x5c')](_0x3ff5c1[_0x67b6('0x59')],_0x3ff5c1[_0x67b6('0x46')]);_0x3d979e['attributes']=_['intersection'](_0x3ff5c1[_0x67b6('0x59')],qs[_0x67b6('0x5d')](_0x310be1['query'][_0x67b6('0x5d')]));_0x3d979e[_0x67b6('0x4b')]=_0x3d979e[_0x67b6('0x4b')][_0x67b6('0x50')]?_0x3d979e[_0x67b6('0x4b')]:_0x3ff5c1[_0x67b6('0x59')];_0x3d979e[_0x67b6('0xc6')]=qs[_0x67b6('0xc7')](_0x310be1[_0x67b6('0x46')][_0x67b6('0xc7')]);_0x3d979e['where']=qs['filters'](_['pick'](_0x310be1['query'],_0x3ff5c1[_0x67b6('0xc5')]));if(_0x310be1[_0x67b6('0x46')][_0x67b6('0x43')]){_0x3d979e[_0x67b6('0xc8')]=_[_0x67b6('0xca')](_0x3d979e[_0x67b6('0xc8')],{'$or':_[_0x67b6('0x38')](_0x3d979e[_0x67b6('0x4b')],function(_0x3dad58){var _0x2570f5={};_0x2570f5[_0x3dad58]={'$like':'%'+_0x310be1[_0x67b6('0x46')][_0x67b6('0x43')]+'%'};return _0x2570f5;})});}_0x3d979e[_0x67b6('0x59')]=db[_0x67b6('0x3f')];_0x3d979e['as']=_0x67b6('0x33');_0x3d979e=_[_0x67b6('0xca')]({},_0x3d979e,_0x310be1[_0x67b6('0x5e')]);return _0x521914['getVoiceQueues']({'include':[_0x3d979e]});}})['then'](function(_0x40feb8){if(_0x40feb8){var _0x49d95c={},_0x2a13dc=[];for(var _0x436385=0x0;_0x436385<_0x40feb8['length'];_0x436385+=0x1){for(var _0x162a3b=0x0,_0x593f38;_0x162a3b<_0x40feb8[_0x436385][_0x67b6('0x33')][_0x67b6('0x50')];_0x162a3b+=0x1){_0x593f38=_0x40feb8[_0x436385][_0x67b6('0x33')][_0x162a3b][_0x67b6('0x2f')]({'plain':!![]});_0x49d95c[_0x593f38['id']]=_0x593f38;}}_0x49d95c=_['values'](_0x49d95c);for(var _0x4e9c06=qs[_0x67b6('0x24')](_0x310be1[_0x67b6('0x46')][_0x67b6('0x24')]);_0x4e9c06<_0x49d95c[_0x67b6('0x50')]&&_0x2a13dc['length']=_0x4d4e0f['agents']){throw new Error(_0x0130('0x4c'));}})[_0x0130('0x11')](function(){if(_0x230981){return db[_0x0130('0x1f')][_0x0130('0x42')]({'where':{'membername':_0x230981[_0x0130('0x1c')]},'individualHooks':!![]});}})[_0x0130('0x11')](function(){if(_0x230981){return _0x230981['getVoiceQueues']({'raw':!![]});}})[_0x0130('0x11')](function(_0x182f69){if(_0x230981){if(_0x182f69){var _0x578470=[];_0x2b0730=_0x182f69;if(_0x2b0730['length']){for(var _0x414e99=0x0;_0x414e99<_0x2b0730['length'];_0x414e99++){_0x578470[_0x0130('0x2a')](db['UserVoiceQueueRt'][_0x0130('0x4d')]({'membername':_0x230981['name'],'UserId':_0x230981['id'],'queue_name':_0x2b0730[_0x414e99][_0x0130('0x1c')],'VoiceQueueId':_0x2b0730[_0x414e99]['id'],'interface':_0x3a8c4e,'paused':_0x230981[_0x0130('0x46')]||![],'penalty':_0x2b0730[_0x414e99][_0x0130('0x4e')]||0x0}));}return BPromise['all'](_0x578470);}}}})[_0x0130('0x11')](function(){if(_0x230981){return db['MemberReport']['findAll']({'where':{'membername':_0x230981[_0x0130('0x1c')],'exitAt':null}});}})[_0x0130('0x11')](function(_0x338822){if(_0x230981){if(_0x338822&&_0x338822[_0x0130('0x24')]){var _0x1785ab=[];_0x338822[_0x0130('0x29')](function(_0x3d8744){_0x1785ab[_0x0130('0x2a')](_0x3d8744[_0x0130('0x20')]({'exitAt':moment()[_0x0130('0x25')](_0x0130('0x26'))}));});return BPromise[_0x0130('0x4f')](_0x1785ab);}}})[_0x0130('0x11')](function(){if(_0x230981){var _0x92053b=[];var _0x45273d=[];var _0x2d6d1d=utils[_0x0130('0x28')]();var _0x1b247a={'membername':_0x230981[_0x0130('0x1c')],'interface':_0x3a8c4e,'enterAt':moment()[_0x0130('0x25')](_0x0130('0x26')),'role':_0x230981[_0x0130('0x1d')],'internal':_0x230981[_0x0130('0x1e')]};_0x2d6d1d[_0x0130('0x29')](function(_0x3fd183){_0x92053b[_0x0130('0x2a')](_[_0x0130('0x50')]({'channel':_0x3fd183,'type':_0x0130('0x51'),'data1':_0x0130('0x52'),'data2':_0x3a8c4e},_0x1b247a));if(_0x230981[_0x0130('0x46')]){_0x45273d[_0x0130('0x2a')](_[_0x0130('0x50')]({'channel':_0x3fd183,'type':'PAUSE','data1':'LOGININPAUSE'},_0x1b247a));}});return db[_0x0130('0x21')][_0x0130('0x31')](_0x92053b['concat'](_0x45273d),{'individualHooks':!![]});}})[_0x0130('0x11')](function(){if(_0x230981){return _0x230981[_0x0130('0x20')]({'online':!![],'lastLoginAt':moment()[_0x0130('0x25')](_0x0130('0x26')),'voicePause':_0x230981[_0x0130('0x46')]||![],'mailPause':_0x230981['loginInPause']||![],'chatPause':_0x230981[_0x0130('0x46')]||![],'faxPause':_0x230981[_0x0130('0x46')]||![],'smsPause':_0x230981[_0x0130('0x46')]||![],'openchannelPause':_0x230981[_0x0130('0x46')]||![],'pauseType':_0x230981[_0x0130('0x46')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3a8c4e});}})[_0x0130('0x11')](function(_0x357d6f){_0x598be8(_0x357d6f);})[_0x0130('0x19')](function(_0x1aacb7){_0x3b2d14(_0x2d27f3[_0x0130('0x14')](0x1f4,_0x1aacb7[_0x0130('0x13')]));});});}; \ No newline at end of file +var _0xd3c7=['GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowUser','find','PauseUser','name','role','interface','format','User\x20with\x20id\x20%s\x20not\x20found','update','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','isNil','body','internal','uniqueid','bulkCreate','type','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','pauseType','lastPauseAt','params','unpause','system','LogoutUser','UserVoiceQueueRt','destroy','MemberReport','forEach','all','LoginUser','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost','./user.socket','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd3c7,0x1b4));var _0x7d3c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd3c7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x7d3c('0x0'));var util=require(_0x7d3c('0x1'));var moment=require(_0x7d3c('0x2'));var BPromise=require(_0x7d3c('0x3'));var Redis=require(_0x7d3c('0x4'));var db=require(_0x7d3c('0x5'))['db'];var utils=require(_0x7d3c('0x6'));var logger=require(_0x7d3c('0x7'))(_0x7d3c('0x8'));var config=require(_0x7d3c('0x9'));config[_0x7d3c('0xa')]=_['defaults'](config['redis'],{'host':_0x7d3c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d3c('0xa')]));require(_0x7d3c('0xc'))[_0x7d3c('0xd')](socket);exports[_0x7d3c('0xe')]=function(_0x3ef708){var _0x27b1b6=this;return new Promise(function(_0x1f352e,_0x5cebc3){return db[_0x7d3c('0xf')][_0x7d3c('0x10')]({'raw':_0x3ef708['options']?_0x3ef708[_0x7d3c('0x11')][_0x7d3c('0x12')]===undefined?!![]:![]:!![],'where':_0x3ef708[_0x7d3c('0x11')]?_0x3ef708[_0x7d3c('0x11')][_0x7d3c('0x13')]||null:null,'attributes':_0x3ef708[_0x7d3c('0x11')]?_0x3ef708[_0x7d3c('0x11')][_0x7d3c('0x14')]||null:null,'limit':_0x3ef708[_0x7d3c('0x11')]?_0x3ef708['options'][_0x7d3c('0x15')]||null:null,'include':_0x3ef708[_0x7d3c('0x11')]?_0x3ef708['options'][_0x7d3c('0x16')]?_[_0x7d3c('0x17')](_0x3ef708[_0x7d3c('0x11')][_0x7d3c('0x16')],function(_0xb38094){return{'model':db[_0xb38094[_0x7d3c('0x18')]],'as':_0xb38094['as'],'attributes':_0xb38094[_0x7d3c('0x14')],'include':_0xb38094[_0x7d3c('0x16')]?_['map'](_0xb38094['include'],function(_0x156016){return{'model':db[_0x156016[_0x7d3c('0x18')]],'as':_0x156016['as'],'attributes':_0x156016[_0x7d3c('0x14')],'include':_0x156016[_0x7d3c('0x16')]?_[_0x7d3c('0x17')](_0x156016[_0x7d3c('0x16')],function(_0x3842fb){return{'model':db[_0x3842fb[_0x7d3c('0x18')]],'as':_0x3842fb['as'],'attributes':_0x3842fb[_0x7d3c('0x14')]};}):[]};}):[]};}):[]:[]})[_0x7d3c('0x19')](function(_0x16fad1){logger[_0x7d3c('0x1a')](_0x7d3c('0xe'),_0x3ef708);logger[_0x7d3c('0x1b')](_0x7d3c('0xe'),_0x3ef708,JSON[_0x7d3c('0x1c')](_0x16fad1));_0x1f352e(_0x16fad1);})[_0x7d3c('0x1d')](function(_0x5b1e2f){logger['error'](_0x7d3c('0xe'),_0x5b1e2f['message'],_0x3ef708);_0x5cebc3(_0x27b1b6[_0x7d3c('0x1e')](0x1f4,_0x5b1e2f[_0x7d3c('0x1f')]));});});};exports[_0x7d3c('0x20')]=function(_0x2b4b0a){var _0x57a22b=this;return new Promise(function(_0x52382d,_0x1d65e9){return db['User'][_0x7d3c('0x21')]({'raw':_0x2b4b0a[_0x7d3c('0x11')]?_0x2b4b0a[_0x7d3c('0x11')][_0x7d3c('0x12')]===undefined?!![]:![]:!![],'where':_0x2b4b0a[_0x7d3c('0x11')]?_0x2b4b0a[_0x7d3c('0x11')][_0x7d3c('0x13')]||null:null,'attributes':_0x2b4b0a[_0x7d3c('0x11')]?_0x2b4b0a[_0x7d3c('0x11')]['attributes']||null:null,'include':_0x2b4b0a[_0x7d3c('0x11')]?_0x2b4b0a[_0x7d3c('0x11')]['include']?_[_0x7d3c('0x17')](_0x2b4b0a[_0x7d3c('0x11')]['include'],function(_0x235974){return{'model':db[_0x235974[_0x7d3c('0x18')]],'as':_0x235974['as'],'attributes':_0x235974[_0x7d3c('0x14')],'include':_0x235974[_0x7d3c('0x16')]?_['map'](_0x235974[_0x7d3c('0x16')],function(_0x5ec2a1){return{'model':db[_0x5ec2a1[_0x7d3c('0x18')]],'as':_0x5ec2a1['as'],'attributes':_0x5ec2a1[_0x7d3c('0x14')],'include':_0x5ec2a1[_0x7d3c('0x16')]?_[_0x7d3c('0x17')](_0x5ec2a1[_0x7d3c('0x16')],function(_0x5bd3a3){return{'model':db[_0x5bd3a3[_0x7d3c('0x18')]],'as':_0x5bd3a3['as'],'attributes':_0x5bd3a3[_0x7d3c('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x115129){logger[_0x7d3c('0x1a')](_0x7d3c('0x20'),_0x2b4b0a);logger[_0x7d3c('0x1b')]('ShowUser',_0x2b4b0a,JSON[_0x7d3c('0x1c')](_0x115129));_0x52382d(_0x115129);})['catch'](function(_0x12e8ce){logger[_0x7d3c('0x1e')](_0x7d3c('0x20'),_0x12e8ce[_0x7d3c('0x1f')],_0x2b4b0a);_0x1d65e9(_0x57a22b[_0x7d3c('0x1e')](0x1f4,_0x12e8ce['message']));});});};exports[_0x7d3c('0x22')]=function(_0x110546){var _0x36d3ea;return db[_0x7d3c('0xf')]['find']({'where':_0x110546[_0x7d3c('0x11')][_0x7d3c('0x13')]||{},'attributes':['id',_0x7d3c('0x23'),_0x7d3c('0x24'),'internal',_0x7d3c('0x25')]})[_0x7d3c('0x19')](function(_0x4124ea){if(!_0x4124ea){throw new Error(util[_0x7d3c('0x26')](_0x7d3c('0x27'),_0x110546['params']['id']));}_0x36d3ea=_0x4124ea;return db['UserVoiceQueueRt'][_0x7d3c('0x28')]({'paused':0x1},{'where':{'UserId':_0x36d3ea['id']},'individualHooks':!![]});})[_0x7d3c('0x19')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x36d3ea[_0x7d3c('0x23')],'type':_0x7d3c('0x29'),'exitAt':null}});})[_0x7d3c('0x19')](function(_0x4fef4a){if(_0x4fef4a&&_0x4fef4a[_0x7d3c('0x2a')]){var _0x531ed4=moment()[_0x7d3c('0x26')](_0x7d3c('0x2b'));for(var _0x5a17cf=0x0,_0x538df8=_0x4fef4a[_0x7d3c('0x2a')];_0x5a17cf<_0x538df8;_0x5a17cf++){_0x4fef4a[_0x5a17cf]['updateAttributes']({'exitAt':_0x531ed4});}}})['then'](function(){var _0x158a92=[];var _0x3196e0=utils[_0x7d3c('0x2c')]();_0x3196e0['forEach'](function(_0x1bf4cc){_0x158a92[_0x7d3c('0x2d')]({'channel':_0x1bf4cc,'membername':_0x36d3ea['name'],'interface':_[_0x7d3c('0x2e')](_0x36d3ea[_0x7d3c('0x25')])?util[_0x7d3c('0x26')]('SIP/%s',_0x36d3ea[_0x7d3c('0x23')]):_0x36d3ea[_0x7d3c('0x25')],'type':_0x7d3c('0x29'),'enterAt':moment()[_0x7d3c('0x26')](_0x7d3c('0x2b')),'data1':_0x110546[_0x7d3c('0x2f')]['type']||'DEFAULT\x20PAUSE','role':_0x36d3ea['role'],'internal':_0x36d3ea[_0x7d3c('0x30')],'uniqueid':_0x110546[_0x7d3c('0x2f')][_0x7d3c('0x31')]||null});});return db['MemberReport'][_0x7d3c('0x32')](_0x158a92,{'individualHooks':!![]});})[_0x7d3c('0x19')](function(){return _0x36d3ea[_0x7d3c('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x110546[_0x7d3c('0x2f')][_0x7d3c('0x33')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7d3c('0x26')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7d3c('0x1d')](function(_0xa03327){throw _0xa03327;});};exports[_0x7d3c('0x34')]=function(_0x2d833e){return Promise[_0x7d3c('0x35')]()[_0x7d3c('0x19')](function(){if(_0x2d833e[_0x7d3c('0x2f')][_0x7d3c('0x36')]&&!utils[_0x7d3c('0x37')](_0x2d833e[_0x7d3c('0x2f')][_0x7d3c('0x36')])){throw new Error(util[_0x7d3c('0x26')](_0x7d3c('0x38'),_0x2d833e[_0x7d3c('0x2f')]['channel']));}return db[_0x7d3c('0xf')][_0x7d3c('0x39')]({'where':_0x2d833e['options'][_0x7d3c('0x13')]||{},'attributes':['id',_0x7d3c('0x23'),_0x7d3c('0x24'),_0x7d3c('0x30'),_0x7d3c('0x25'),_0x7d3c('0x3a'),_0x7d3c('0x3b'),_0x7d3c('0x3c'),'chatPause','faxPause','openchannelPause','smsPause','whatsappPause',_0x7d3c('0x3d'),_0x7d3c('0x3e')]});})[_0x7d3c('0x19')](function(_0x11f32e){if(!_0x11f32e){throw new Error(util[_0x7d3c('0x26')](_0x7d3c('0x27'),_0x2d833e[_0x7d3c('0x3f')]['id']));}return _0x11f32e[_0x7d3c('0x40')](_0x2d833e[_0x7d3c('0x2f')][_0x7d3c('0x36')],_0x7d3c('0x41'));})[_0x7d3c('0x1d')](function(_0x4691af){throw _0x4691af;});};exports[_0x7d3c('0x42')]=function(_0x41610b){var _0x3c7664=this;return new Promise(function(_0x3ad026,_0x41b64d){var _0x589319;return db[_0x7d3c('0xf')][_0x7d3c('0x39')]({'where':_0x41610b[_0x7d3c('0x11')][_0x7d3c('0x13')]||{},'attributes':['id',_0x7d3c('0x23')]})['then'](function(_0x287218){if(_0x287218){_0x589319=_0x287218;return db[_0x7d3c('0x43')][_0x7d3c('0x44')]({'where':{'membername':_0x589319[_0x7d3c('0x23')]},'individualHooks':!![]});}})['then'](function(){if(_0x589319){return db[_0x7d3c('0x45')]['findAll']({'where':{'membername':_0x589319['name'],'exitAt':null}});}})[_0x7d3c('0x19')](function(_0x543e9a){if(_0x589319){if(_0x543e9a&&_0x543e9a['length']){var _0x2f2285=[];_0x543e9a[_0x7d3c('0x46')](function(_0x50a2b9){_0x2f2285[_0x7d3c('0x2d')](_0x50a2b9[_0x7d3c('0x28')]({'exitAt':moment()[_0x7d3c('0x26')](_0x7d3c('0x2b'))}));});return BPromise[_0x7d3c('0x47')](_0x2f2285);}}})[_0x7d3c('0x19')](function(){if(_0x589319){return _0x589319[_0x7d3c('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2b2e9a){_0x3ad026(_0x2b2e9a);})[_0x7d3c('0x1d')](function(_0xb160b3){_0x41b64d(_0x3c7664[_0x7d3c('0x1e')](0x1f4,_0xb160b3[_0x7d3c('0x1f')]));});});};exports[_0x7d3c('0x48')]=function(_0x35757b){var _0x490bce=this;return new Promise(function(_0x334bfb,_0x2ee653){var _0x5e56b8;var _0x2fe425;var _0x159675;var _0x27db93;return db[_0x7d3c('0xf')][_0x7d3c('0x39')]({'where':_0x35757b[_0x7d3c('0x11')][_0x7d3c('0x13')]||{},'attributes':['id','name',_0x7d3c('0x24'),_0x7d3c('0x49'),_0x7d3c('0x4a'),_0x7d3c('0x30'),_0x7d3c('0x4b'),_0x7d3c('0x25')]})[_0x7d3c('0x19')](function(_0x1eaeab){if(_0x1eaeab){_0x5e56b8=_0x1eaeab;_0x27db93=_0x35757b[_0x7d3c('0x2f')]['interface']?_0x35757b[_0x7d3c('0x2f')][_0x7d3c('0x25')]:util[_0x7d3c('0x26')](_0x7d3c('0x4c'),_0x5e56b8['name']);return db[_0x7d3c('0xf')][_0x7d3c('0x4d')]({'where':{'role':_0x7d3c('0x4e'),'online':!![],'id':{'$ne':_0x5e56b8['id']}}});}})[_0x7d3c('0x19')](function(_0x15f7db){if(_0x15f7db){_0x159675=_0x15f7db;return require(_0x7d3c('0x4f'))[_0x7d3c('0x50')]();}})[_0x7d3c('0x19')](function(_0x271ec6){if(_0x271ec6&&_0x271ec6[_0x7d3c('0x51')]&&_0x159675>=_0x271ec6[_0x7d3c('0x51')]){throw new Error(_0x7d3c('0x52'));}})[_0x7d3c('0x19')](function(){if(_0x5e56b8){return db[_0x7d3c('0x43')]['destroy']({'where':{'membername':_0x5e56b8[_0x7d3c('0x23')]},'individualHooks':!![]});}})[_0x7d3c('0x19')](function(){if(_0x5e56b8){return _0x5e56b8[_0x7d3c('0x53')]({'raw':!![]});}})[_0x7d3c('0x19')](function(_0x11a550){if(_0x5e56b8){if(_0x11a550){var _0x41126c=[];_0x2fe425=_0x11a550;if(_0x2fe425[_0x7d3c('0x2a')]){for(var _0x207e69=0x0;_0x207e69<_0x2fe425['length'];_0x207e69++){_0x41126c[_0x7d3c('0x2d')](db['UserVoiceQueueRt'][_0x7d3c('0x54')]({'membername':_0x5e56b8['name'],'UserId':_0x5e56b8['id'],'queue_name':_0x2fe425[_0x207e69][_0x7d3c('0x23')],'VoiceQueueId':_0x2fe425[_0x207e69]['id'],'interface':_0x27db93,'paused':_0x5e56b8[_0x7d3c('0x4b')]||![],'penalty':_0x2fe425[_0x207e69]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x41126c);}}}})['then'](function(){if(_0x5e56b8){return db['MemberReport'][_0x7d3c('0x10')]({'where':{'membername':_0x5e56b8[_0x7d3c('0x23')],'exitAt':null}});}})[_0x7d3c('0x19')](function(_0x24b97c){if(_0x5e56b8){if(_0x24b97c&&_0x24b97c[_0x7d3c('0x2a')]){var _0x2bda7c=[];_0x24b97c[_0x7d3c('0x46')](function(_0xc31aa0){_0x2bda7c['push'](_0xc31aa0[_0x7d3c('0x28')]({'exitAt':moment()[_0x7d3c('0x26')](_0x7d3c('0x2b'))}));});return BPromise[_0x7d3c('0x47')](_0x2bda7c);}}})[_0x7d3c('0x19')](function(){if(_0x5e56b8){var _0x1a7cc2=[];var _0x3d4ed2=[];var _0x59a9a1=utils[_0x7d3c('0x2c')]();var _0x28b994={'membername':_0x5e56b8[_0x7d3c('0x23')],'interface':_0x27db93,'enterAt':moment()[_0x7d3c('0x26')](_0x7d3c('0x2b')),'role':_0x5e56b8[_0x7d3c('0x24')],'internal':_0x5e56b8[_0x7d3c('0x30')]};_0x59a9a1['forEach'](function(_0xc044df){_0x1a7cc2['push'](_[_0x7d3c('0x55')]({'channel':_0xc044df,'type':_0x7d3c('0x56'),'data1':_0x7d3c('0x57'),'data2':_0x27db93},_0x28b994));if(_0x5e56b8[_0x7d3c('0x4b')]){_0x3d4ed2['push'](_[_0x7d3c('0x55')]({'channel':_0xc044df,'type':_0x7d3c('0x29'),'data1':_0x7d3c('0x58')},_0x28b994));}});return db[_0x7d3c('0x45')][_0x7d3c('0x32')](_0x1a7cc2[_0x7d3c('0x59')](_0x3d4ed2),{'individualHooks':!![]});}})[_0x7d3c('0x19')](function(){if(_0x5e56b8){return _0x5e56b8['update']({'online':!![],'lastLoginAt':moment()['format'](_0x7d3c('0x2b')),'voicePause':_0x5e56b8[_0x7d3c('0x4b')]||![],'mailPause':_0x5e56b8[_0x7d3c('0x4b')]||![],'chatPause':_0x5e56b8['loginInPause']||![],'faxPause':_0x5e56b8[_0x7d3c('0x4b')]||![],'smsPause':_0x5e56b8['loginInPause']||![],'openchannelPause':_0x5e56b8['loginInPause']||![],'pauseType':_0x5e56b8[_0x7d3c('0x4b')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x7d3c('0x26')](_0x7d3c('0x2b')),'interface':_0x27db93});}})[_0x7d3c('0x19')](function(_0x39102f){_0x334bfb(_0x39102f);})[_0x7d3c('0x1d')](function(_0x59f96e){_0x2ee653(_0x490bce[_0x7d3c('0x1e')](0x1f4,_0x59f96e[_0x7d3c('0x1f')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 003b3a4..f0775a6 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 _0xfa8c=['removeListener','register','length','user:','./user.events','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa8c,0x19c));var _0xcfa8=function(_0x596122,_0x593f71){_0x596122=_0x596122-0x0;var _0x5d0909=_0xfa8c[_0x596122];return _0x5d0909;};'use strict';var UserEvents=require(_0xcfa8('0x0'));var events=['save',_0xcfa8('0x1'),_0xcfa8('0x2')];function createListener(_0x8973e1,_0x44face){return function(_0x3a4ef1){_0x44face[_0xcfa8('0x3')](_0x8973e1,_0x3a4ef1);};}function removeListener(_0x23cfcb,_0x1666d3){return function(){UserEvents[_0xcfa8('0x4')](_0x23cfcb,_0x1666d3);};}exports[_0xcfa8('0x5')]=function(_0x14d74a){for(var _0x44c728=0x0,_0x25834c=events[_0xcfa8('0x6')];_0x44c728<_0x25834c;_0x44c728++){var _0x147859=events[_0x44c728];var _0x3d1f52=createListener(_0xcfa8('0x7')+_0x147859,_0x14d74a);UserEvents['on'](_0x147859,_0x3d1f52);}}; \ No newline at end of file +var _0x5113=['./user.events','save','remove','update','emit','removeListener','register','length','user:'];(function(_0xe50100,_0x998ce3){var _0x191c48=function(_0x5a1484){while(--_0x5a1484){_0xe50100['push'](_0xe50100['shift']());}};_0x191c48(++_0x998ce3);}(_0x5113,0x105));var _0x3511=function(_0x2a05bf,_0x55e3a4){_0x2a05bf=_0x2a05bf-0x0;var _0x38a62e=_0x5113[_0x2a05bf];return _0x38a62e;};'use strict';var UserEvents=require(_0x3511('0x0'));var events=[_0x3511('0x1'),_0x3511('0x2'),_0x3511('0x3')];function createListener(_0x4390f0,_0x3e39c7){return function(_0x39d92b){_0x3e39c7[_0x3511('0x4')](_0x4390f0,_0x39d92b);};}function removeListener(_0x4543a0,_0x1de300){return function(){UserEvents[_0x3511('0x5')](_0x4543a0,_0x1de300);};}exports[_0x3511('0x6')]=function(_0x14012f){for(var _0x1f442b=0x0,_0x301c59=events[_0x3511('0x7')];_0x1f442b<_0x301c59;_0x1f442b++){var _0x64a120=events[_0x1f442b];var _0x3ddb85=createListener(_0x3511('0x8')+_0x64a120,_0x14012f);UserEvents['on'](_0x64a120,_0x3ddb85);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 7e874b6..9e2692a 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x551455,_0x571544){var _0x1b4d69=function(_0x50d37b){while(--_0x50d37b){_0x551455['push'](_0x551455['shift']());}};_0x1b4d69(++_0x571544);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xcb91[_0x576266];return _0x18234f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x564c3f,_0x563c13){var _0xdeb099=function(_0x3a4b97){while(--_0x3a4b97){_0x564c3f['push'](_0x564c3f['shift']());}};_0xdeb099(++_0x563c13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index fed6058..30ba291 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 _0x1be4=['sequelize','exports','INTEGER'];(function(_0x3b9766,_0x71c19f){var _0x289d45=function(_0x51122b){while(--_0x51122b){_0x3b9766['push'](_0x3b9766['shift']());}};_0x289d45(++_0x71c19f);}(_0x1be4,0x198));var _0x41be=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x1be4[_0x251e8c];return _0x1e0c1d;};'use strict';var Sequelize=require(_0x41be('0x0'));module[_0x41be('0x1')]={'penalty':{'type':Sequelize[_0x41be('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb8f1=['exports','sequelize'];(function(_0x515c82,_0x4d6af6){var _0x2f774d=function(_0x10dcf0){while(--_0x10dcf0){_0x515c82['push'](_0x515c82['shift']());}};_0x2f774d(++_0x4d6af6);}(_0xb8f1,0x15f));var _0x1b8f=function(_0x1f7bea,_0x411dd6){_0x1f7bea=_0x1f7bea-0x0;var _0xdb9a17=_0xb8f1[_0x1f7bea];return _0xdb9a17;};'use strict';var Sequelize=require(_0x1b8f('0x0'));module[_0x1b8f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 3bde632..b2756d1 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 _0x887c=['./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x887c,0xb8));var _0xc887=function(_0x188c88,_0x210793){_0x188c88=_0x188c88-0x0;var _0x4e4c38=_0x887c[_0x188c88];return _0x4e4c38;};'use strict';var _=require(_0xc887('0x0'));var util=require('util');var logger=require(_0xc887('0x1'))(_0xc887('0x2'));var moment=require('moment');var BPromise=require(_0xc887('0x3'));var rp=require(_0xc887('0x4'));var fs=require('fs');var path=require(_0xc887('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc887('0x6'));module[_0xc887('0x7')]=function(_0x582bda,_0x39403a){return _0x582bda[_0xc887('0x8')]('UserChatQueue',attributes,{'tableName':_0xc887('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e86=['request-promise','path','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird'];(function(_0x1764f5,_0x4a119f){var _0x1ac765=function(_0x143dbb){while(--_0x143dbb){_0x1764f5['push'](_0x1764f5['shift']());}};_0x1ac765(++_0x4a119f);}(_0x4e86,0x15b));var _0x64e8=function(_0x58682e,_0x48176d){_0x58682e=_0x58682e-0x0;var _0x533e59=_0x4e86[_0x58682e];return _0x533e59;};'use strict';var _=require(_0x64e8('0x0'));var util=require(_0x64e8('0x1'));var logger=require('../../config/logger')(_0x64e8('0x2'));var moment=require(_0x64e8('0x3'));var BPromise=require(_0x64e8('0x4'));var rp=require(_0x64e8('0x5'));var fs=require('fs');var path=require(_0x64e8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64e8('0x7'));module['exports']=function(_0x372e4d,_0x3e590a){return _0x372e4d[_0x64e8('0x8')](_0x64e8('0x9'),attributes,{'tableName':_0x64e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 1e530f7..88c5ce3 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 _0x77d7=['message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2c9e9d,_0xa5faf7){var _0x2f8cfa=function(_0x469ede){while(--_0x469ede){_0x2c9e9d['push'](_0x2c9e9d['shift']());}};_0x2f8cfa(++_0xa5faf7);}(_0x77d7,0xca));var _0x777d=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x77d7[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x777d('0x0'));var util=require('util');var moment=require(_0x777d('0x1'));var BPromise=require('bluebird');var rs=require(_0x777d('0x2'));var fs=require('fs');var Redis=require(_0x777d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x777d('0x4'));var logger=require(_0x777d('0x5'))(_0x777d('0x6'));var config=require(_0x777d('0x7'));var jayson=require(_0x777d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31e021,_0x28df61,_0x17621d){return new BPromise(function(_0x3dd158,_0x352d57){return client[_0x777d('0x9')](_0x31e021,_0x17621d)[_0x777d('0xa')](function(_0x174d41){logger['info'](_0x777d('0xb'),_0x28df61,_0x777d('0xc'));logger[_0x777d('0xd')](_0x777d('0xe'),_0x28df61,_0x777d('0xc'),JSON[_0x777d('0xf')](_0x174d41));if(_0x174d41[_0x777d('0x10')]){if(_0x174d41[_0x777d('0x10')][_0x777d('0x11')]===0x1f4){logger[_0x777d('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x28df61,_0x174d41['error'][_0x777d('0x12')]);return _0x352d57(_0x174d41['error']['message']);}logger[_0x777d('0x10')](_0x777d('0xb'),_0x28df61,_0x174d41[_0x777d('0x10')][_0x777d('0x12')]);return _0x3dd158(_0x174d41[_0x777d('0x10')]['message']);}else{logger[_0x777d('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x28df61,_0x777d('0xc'));_0x3dd158(_0x174d41[_0x777d('0x14')][_0x777d('0x12')]);}})[_0x777d('0x15')](function(_0x4406bd){logger[_0x777d('0x10')](_0x777d('0xb'),_0x28df61,_0x4406bd);_0x352d57(_0x4406bd);});});} \ No newline at end of file +var _0xe83e=['stringify','error','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe83e,0x1bb));var _0xee83=function(_0x124e1e,_0x2752eb){_0x124e1e=_0x124e1e-0x0;var _0x11f146=_0xe83e[_0x124e1e];return _0x11f146;};'use strict';var _=require(_0xee83('0x0'));var util=require(_0xee83('0x1'));var moment=require(_0xee83('0x2'));var BPromise=require(_0xee83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee83('0x4'))['db'];var utils=require(_0xee83('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xee83('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xee83('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4457fe,_0x19c982,_0xecc2f6){return new BPromise(function(_0x1cc11f,_0x3e5284){return client[_0xee83('0x8')](_0x4457fe,_0xecc2f6)[_0xee83('0x9')](function(_0x593221){logger[_0xee83('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x19c982,_0xee83('0xb'));logger['debug'](_0xee83('0xc'),_0x19c982,_0xee83('0xb'),JSON[_0xee83('0xd')](_0x593221));if(_0x593221[_0xee83('0xe')]){if(_0x593221['error']['code']===0x1f4){logger[_0xee83('0xe')](_0xee83('0xf'),_0x19c982,_0x593221[_0xee83('0xe')][_0xee83('0x10')]);return _0x3e5284(_0x593221[_0xee83('0xe')]['message']);}logger[_0xee83('0xe')](_0xee83('0xf'),_0x19c982,_0x593221['error'][_0xee83('0x10')]);return _0x1cc11f(_0x593221['error'][_0xee83('0x10')]);}else{logger[_0xee83('0xa')](_0xee83('0xf'),_0x19c982,_0xee83('0xb'));_0x1cc11f(_0x593221[_0xee83('0x11')]['message']);}})[_0xee83('0x12')](function(_0xd911e2){logger[_0xee83('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x19c982,_0xd911e2);_0x3e5284(_0xd911e2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 4db5365..26ed12f 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xf3223a,_0x4f8397){var _0x28f07a=function(_0x2003c3){while(--_0x2003c3){_0xf3223a['push'](_0xf3223a['shift']());}};_0x28f07a(++_0x4f8397);}(_0x70e0,0x17b));var _0x070e=function(_0x5c7174,_0x187d72){_0x5c7174=_0x5c7174-0x0;var _0x16fbd6=_0x70e0[_0x5c7174];return _0x16fbd6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4615e3,_0x180d64){var _0x5c256b=function(_0x972847){while(--_0x972847){_0x4615e3['push'](_0x4615e3['shift']());}};_0x5c256b(++_0x180d64);}(_0x70e0,0x17b));var _0x070e=function(_0x4cdc1e,_0x58b9aa){_0x4cdc1e=_0x4cdc1e-0x0;var _0x148572=_0x70e0[_0x4cdc1e];return _0x148572;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 1f6ffe2..e0fd6cb 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 _0x8a35=['exports','INTEGER','STRING','sequelize'];(function(_0x56c1e7,_0x541442){var _0x4234c7=function(_0x5311b6){while(--_0x5311b6){_0x56c1e7['push'](_0x56c1e7['shift']());}};_0x4234c7(++_0x541442);}(_0x8a35,0x14b));var _0x58a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8a35[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x58a3('0x0'));module[_0x58a3('0x1')]={'penalty':{'type':Sequelize[_0x58a3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x58a3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x58a3('0x3')]}}; \ No newline at end of file +var _0xc216=['INTEGER','STRING','sequelize','exports'];(function(_0x40303d,_0x540882){var _0x5d72bd=function(_0x8ec349){while(--_0x8ec349){_0x40303d['push'](_0x40303d['shift']());}};_0x5d72bd(++_0x540882);}(_0xc216,0x1c6));var _0x6c21=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xc216[_0xb833b1];return _0x1ab87a;};'use strict';var Sequelize=require(_0x6c21('0x0'));module[_0x6c21('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6c21('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6c21('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8e268c7..35d623c 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 _0x14e3=['user_has_fax_queues','lodash','util','api','moment','request-promise','../../config/environment','exports','UserFaxQueue'];(function(_0x50026f,_0x5c2b57){var _0x1fd7f6=function(_0x48dc6d){while(--_0x48dc6d){_0x50026f['push'](_0x50026f['shift']());}};_0x1fd7f6(++_0x5c2b57);}(_0x14e3,0x184));var _0x314e=function(_0x1a6f8f,_0x4c8dc0){_0x1a6f8f=_0x1a6f8f-0x0;var _0x975649=_0x14e3[_0x1a6f8f];return _0x975649;};'use strict';var _=require(_0x314e('0x0'));var util=require(_0x314e('0x1'));var logger=require('../../config/logger')(_0x314e('0x2'));var moment=require(_0x314e('0x3'));var BPromise=require('bluebird');var rp=require(_0x314e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x314e('0x5'));var attributes=require('./userFaxQueue.attributes');module[_0x314e('0x6')]=function(_0x270f68,_0x3438bb){return _0x270f68['define'](_0x314e('0x7'),attributes,{'tableName':_0x314e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb5=['moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xddb5,0x168));var _0x5ddb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xddb5[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5ddb('0x0'));var util=require(_0x5ddb('0x1'));var logger=require(_0x5ddb('0x2'))('api');var moment=require(_0x5ddb('0x3'));var BPromise=require(_0x5ddb('0x4'));var rp=require(_0x5ddb('0x5'));var fs=require('fs');var path=require(_0x5ddb('0x6'));var rimraf=require('rimraf');var config=require(_0x5ddb('0x7'));var attributes=require(_0x5ddb('0x8'));module['exports']=function(_0x51dff7,_0x2ac6a9){return _0x51dff7['define'](_0x5ddb('0x9'),attributes,{'tableName':_0x5ddb('0xa'),'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 3554145..489bbcb 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 _0xd742=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd742,0xdc));var _0x2d74=function(_0x3f1b5b,_0x3d444f){_0x3f1b5b=_0x3f1b5b-0x0;var _0xaa5f31=_0xd742[_0x3f1b5b];return _0xaa5f31;};'use strict';var _=require(_0x2d74('0x0'));var util=require(_0x2d74('0x1'));var moment=require(_0x2d74('0x2'));var BPromise=require(_0x2d74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d74('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d74('0x5'));var logger=require(_0x2d74('0x6'))(_0x2d74('0x7'));var config=require(_0x2d74('0x8'));var jayson=require(_0x2d74('0x9'));var client=jayson[_0x2d74('0xa')][_0x2d74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b2689,_0x30ccc3,_0x7a119b){return new BPromise(function(_0x5a3885,_0x35887d){return client[_0x2d74('0xc')](_0x1b2689,_0x7a119b)[_0x2d74('0xd')](function(_0x3fce98){logger[_0x2d74('0xe')](_0x2d74('0xf'),_0x30ccc3,_0x2d74('0x10'));logger[_0x2d74('0x11')](_0x2d74('0x12'),_0x30ccc3,_0x2d74('0x10'),JSON[_0x2d74('0x13')](_0x3fce98));if(_0x3fce98['error']){if(_0x3fce98[_0x2d74('0x14')][_0x2d74('0x15')]===0x1f4){logger['error'](_0x2d74('0xf'),_0x30ccc3,_0x3fce98[_0x2d74('0x14')]['message']);return _0x35887d(_0x3fce98[_0x2d74('0x14')][_0x2d74('0x16')]);}logger[_0x2d74('0x14')](_0x2d74('0xf'),_0x30ccc3,_0x3fce98[_0x2d74('0x14')][_0x2d74('0x16')]);return _0x5a3885(_0x3fce98[_0x2d74('0x14')][_0x2d74('0x16')]);}else{logger['info'](_0x2d74('0xf'),_0x30ccc3,_0x2d74('0x10'));_0x5a3885(_0x3fce98[_0x2d74('0x17')][_0x2d74('0x16')]);}})[_0x2d74('0x18')](function(_0x39e202){logger['error'](_0x2d74('0xf'),_0x30ccc3,_0x39e202);_0x35887d(_0x39e202);});});} \ No newline at end of file +var _0x4a2a=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x254a5f,_0x5b5887){var _0x27998c=function(_0x1067b9){while(--_0x1067b9){_0x254a5f['push'](_0x254a5f['shift']());}};_0x27998c(++_0x5b5887);}(_0x4a2a,0x113));var _0xa4a2=function(_0x19f7aa,_0x1e0138){_0x19f7aa=_0x19f7aa-0x0;var _0x19f635=_0x4a2a[_0x19f7aa];return _0x19f635;};'use strict';var _=require(_0xa4a2('0x0'));var util=require(_0xa4a2('0x1'));var moment=require(_0xa4a2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4a2('0x4'))['db'];var utils=require(_0xa4a2('0x5'));var logger=require('../../config/logger')(_0xa4a2('0x6'));var config=require(_0xa4a2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa4a2('0x8')][_0xa4a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9048b1,_0x5a29f1,_0x54452c){return new BPromise(function(_0x1cb40a,_0x15b5d2){return client['request'](_0x9048b1,_0x54452c)[_0xa4a2('0xa')](function(_0x37ed46){logger[_0xa4a2('0xb')](_0xa4a2('0xc'),_0x5a29f1,_0xa4a2('0xd'));logger[_0xa4a2('0xe')](_0xa4a2('0xf'),_0x5a29f1,'request\x20sent',JSON[_0xa4a2('0x10')](_0x37ed46));if(_0x37ed46[_0xa4a2('0x11')]){if(_0x37ed46[_0xa4a2('0x11')][_0xa4a2('0x12')]===0x1f4){logger[_0xa4a2('0x11')](_0xa4a2('0xc'),_0x5a29f1,_0x37ed46['error'][_0xa4a2('0x13')]);return _0x15b5d2(_0x37ed46[_0xa4a2('0x11')][_0xa4a2('0x13')]);}logger[_0xa4a2('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x5a29f1,_0x37ed46[_0xa4a2('0x11')][_0xa4a2('0x13')]);return _0x1cb40a(_0x37ed46[_0xa4a2('0x11')][_0xa4a2('0x13')]);}else{logger['info'](_0xa4a2('0xc'),_0x5a29f1,_0xa4a2('0xd'));_0x1cb40a(_0x37ed46['result']['message']);}})[_0xa4a2('0x14')](function(_0xf312b9){logger[_0xa4a2('0x11')](_0xa4a2('0xc'),_0x5a29f1,_0xf312b9);_0x15b5d2(_0xf312b9);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 6a790c3..f5393ed 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4214c5,_0x484996){var _0x468a73=function(_0x5bd2ac){while(--_0x5bd2ac){_0x4214c5['push'](_0x4214c5['shift']());}};_0x468a73(++_0x484996);}(_0xedd9,0xfc));var _0x9edd=function(_0x307374,_0x52f551){_0x307374=_0x307374-0x0;var _0x31c272=_0xedd9[_0x307374];return _0x31c272;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 024fde6..81e15ca 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 _0x285f=['INTEGER','sequelize','exports'];(function(_0xeb65c,_0x5036c3){var _0x2afc4b=function(_0x6665ca){while(--_0x6665ca){_0xeb65c['push'](_0xeb65c['shift']());}};_0x2afc4b(++_0x5036c3);}(_0x285f,0x18d));var _0xf285=function(_0x38319f,_0x2f62ab){_0x38319f=_0x38319f-0x0;var _0xe082e=_0x285f[_0x38319f];return _0xe082e;};'use strict';var Sequelize=require(_0xf285('0x0'));module[_0xf285('0x1')]={'penalty':{'type':Sequelize[_0xf285('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0971=['INTEGER','sequelize','exports'];(function(_0x53aba4,_0x559c7d){var _0x538e6a=function(_0x459c3b){while(--_0x459c3b){_0x53aba4['push'](_0x53aba4['shift']());}};_0x538e6a(++_0x559c7d);}(_0x0971,0xee));var _0x1097=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x0971[_0x4b03c9];return _0x161ba2;};'use strict';var Sequelize=require(_0x1097('0x0'));module[_0x1097('0x1')]={'penalty':{'type':Sequelize[_0x1097('0x2')],'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 9af2e21..c8d7c04 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 _0x1a50=['exports','define','UserMailQueue','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./userMailQueue.attributes'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x1a50,0x125));var _0x01a5=function(_0x12c32c,_0x13af3b){_0x12c32c=_0x12c32c-0x0;var _0x39b809=_0x1a50[_0x12c32c];return _0x39b809;};'use strict';var _=require('lodash');var util=require(_0x01a5('0x0'));var logger=require(_0x01a5('0x1'))(_0x01a5('0x2'));var moment=require('moment');var BPromise=require(_0x01a5('0x3'));var rp=require(_0x01a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01a5('0x5'));var attributes=require(_0x01a5('0x6'));module[_0x01a5('0x7')]=function(_0x5f3ebf,_0x35c4f4){return _0x5f3ebf[_0x01a5('0x8')](_0x01a5('0x9'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7088=['api','moment','bluebird','path','rimraf','../../config/environment','exports','UserMailQueue','user_has_mail_queues','lodash','../../config/logger'];(function(_0x33eed5,_0x20c5f6){var _0x2c27da=function(_0x144512){while(--_0x144512){_0x33eed5['push'](_0x33eed5['shift']());}};_0x2c27da(++_0x20c5f6);}(_0x7088,0x1c1));var _0x8708=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7088[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x8708('0x0'));var util=require('util');var logger=require(_0x8708('0x1'))(_0x8708('0x2'));var moment=require(_0x8708('0x3'));var BPromise=require(_0x8708('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8708('0x5'));var rimraf=require(_0x8708('0x6'));var config=require(_0x8708('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x8708('0x8')]=function(_0x9d09d1,_0x599de8){return _0x9d09d1['define'](_0x8708('0x9'),attributes,{'tableName':_0x8708('0xa'),'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 b41c13c..6e38e34 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x13bf1f,_0x2d146b){var _0x5007e7=function(_0x2f3065){while(--_0x2f3065){_0x13bf1f['push'](_0x13bf1f['shift']());}};_0x5007e7(++_0x2d146b);}(_0x55ca,0x126));var _0xa55c=function(_0x3e2040,_0x660381){_0x3e2040=_0x3e2040-0x0;var _0x38e3ec=_0x55ca[_0x3e2040];return _0x38e3ec;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x37bd5a,_0x27a0c5){var _0x23edbb=function(_0x485a55){while(--_0x485a55){_0x37bd5a['push'](_0x37bd5a['shift']());}};_0x23edbb(++_0x27a0c5);}(_0xe14b,0x93));var _0xbe14=function(_0x208a7b,_0xec21c1){_0x208a7b=_0x208a7b-0x0;var _0x1fc74c=_0xe14b[_0x208a7b];return _0x1fc74c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index f530e23..b0f4067 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 _0x7495=['./userNotification.controller','post','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x502cc8,_0x4fd1f9){var _0x44c83e=function(_0x383e85){while(--_0x383e85){_0x502cc8['push'](_0x502cc8['shift']());}};_0x44c83e(++_0x4fd1f9);}(_0x7495,0x17e));var _0x5749=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x7495[_0x178856];return _0x3c7fe7;};'use strict';var multer=require(_0x5749('0x0'));var util=require(_0x5749('0x1'));var path=require(_0x5749('0x2'));var timeout=require(_0x5749('0x3'));var express=require(_0x5749('0x4'));var router=express[_0x5749('0x5')]();var fs_extra=require(_0x5749('0x6'));var auth=require(_0x5749('0x7'));var interaction=require(_0x5749('0x8'));var config=require(_0x5749('0x9'));var controller=require(_0x5749('0xa'));router[_0x5749('0xb')]('/',auth['isAuthenticated'](),controller[_0x5749('0xc')]);module[_0x5749('0xd')]=router; \ No newline at end of file +var _0x92ad=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0x527dbb,_0xfd0a5e){var _0x2306f7=function(_0x277224){while(--_0x277224){_0x527dbb['push'](_0x527dbb['shift']());}};_0x2306f7(++_0xfd0a5e);}(_0x92ad,0x139));var _0xd92a=function(_0x37b279,_0x3ba2aa){_0x37b279=_0x37b279-0x0;var _0x537f36=_0x92ad[_0x37b279];return _0x537f36;};'use strict';var multer=require(_0xd92a('0x0'));var util=require(_0xd92a('0x1'));var path=require(_0xd92a('0x2'));var timeout=require(_0xd92a('0x3'));var express=require(_0xd92a('0x4'));var router=express[_0xd92a('0x5')]();var fs_extra=require(_0xd92a('0x6'));var auth=require(_0xd92a('0x7'));var interaction=require(_0xd92a('0x8'));var config=require(_0xd92a('0x9'));var controller=require(_0xd92a('0xa'));router[_0xd92a('0xb')]('/',auth[_0xd92a('0xc')](),controller[_0xd92a('0xd')]);module[_0xd92a('0xe')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 5ce6fd3..40e80dc 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 _0xd12e=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x231399,_0x3784a2){var _0x233a05=function(_0x1da096){while(--_0x1da096){_0x231399['push'](_0x231399['shift']());}};_0x233a05(++_0x3784a2);}(_0xd12e,0x132));var _0xed12=function(_0x48571f,_0x4c86f4){_0x48571f=_0x48571f-0x0;var _0x495a93=_0xd12e[_0x48571f];return _0x495a93;};'use strict';var Sequelize=require(_0xed12('0x0'));module[_0xed12('0x1')]={'body':{'type':Sequelize[_0xed12('0x2')]},'senderName':{'type':Sequelize[_0xed12('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xed12('0x3')]},'beep':{'type':Sequelize[_0xed12('0x4')]}}; \ No newline at end of file +var _0xde30=['STRING','BOOLEAN','sequelize'];(function(_0x1ee49e,_0x395898){var _0x279788=function(_0x3851eb){while(--_0x3851eb){_0x1ee49e['push'](_0x1ee49e['shift']());}};_0x279788(++_0x395898);}(_0xde30,0xa7));var _0x0de3=function(_0x135196,_0x13d329){_0x135196=_0x135196-0x0;var _0x21a193=_0xde30[_0x135196];return _0x21a193;};'use strict';var Sequelize=require(_0x0de3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x0de3('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x0de3('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 8868b0f..6e53a90 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 _0xa4bd=['redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','toLowerCase','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','join','UserNotification','create','forEach','recipient','emit','userNotification:send','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model','union','ids','includes','queue','replace','push','all','flatten','findOne','getAgents','map','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2d2201,_0x3cfe3d){var _0x12e6cd=function(_0x5e4cf6){while(--_0x5e4cf6){_0x2d2201['push'](_0x2d2201['shift']());}};_0x12e6cd(++_0x3cfe3d);}(_0xa4bd,0x1df));var _0xda4b=function(_0x2a43d7,_0x4c05d0){_0x2a43d7=_0x2a43d7-0x0;var _0x2bb20f=_0xa4bd[_0x2a43d7];return _0x2bb20f;};'use strict';var emlformat=require(_0xda4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda4b('0x1'));var jsonpatch=require(_0xda4b('0x2'));var rp=require(_0xda4b('0x3'));var moment=require(_0xda4b('0x4'));var BPromise=require(_0xda4b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xda4b('0x6'));var csv=require(_0xda4b('0x7'));var ejs=require(_0xda4b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda4b('0x9'));var squel=require('squel');var crypto=require(_0xda4b('0xa'));var jsforce=require(_0xda4b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xda4b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda4b('0xc'));var authService=require(_0xda4b('0xd'));var qs=require(_0xda4b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4b('0xf'));var logger=require(_0xda4b('0x10'))(_0xda4b('0x11'));var utils=require(_0xda4b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xda4b('0x13'));var db=require(_0xda4b('0x14'))['db'];config[_0xda4b('0x15')]=_[_0xda4b('0x16')](config[_0xda4b('0x15')],{'host':_0xda4b('0x17'),'port':0x18eb});var socket=require(_0xda4b('0x18'))(new Redis(config[_0xda4b('0x15')]));require(_0xda4b('0x19'))['register'](socket);function respondWithStatusCode(_0x34c6ea,_0x1a22a2){_0x1a22a2=_0x1a22a2||0xcc;return function(_0xc1bd50){if(_0xc1bd50){return _0x34c6ea[_0xda4b('0x1a')](_0x1a22a2);}return _0x34c6ea[_0xda4b('0x1b')](_0x1a22a2)[_0xda4b('0x1c')]();};}function respondWithResult(_0x1f2578,_0x50147d){_0x50147d=_0x50147d||0xc8;return function(_0x148a75){if(_0x148a75){return _0x1f2578['status'](_0x50147d)[_0xda4b('0x1d')](_0x148a75);}};}function respondWithFilteredResult(_0x494a2d,_0x23d92d){return function(_0x4ca83f){if(_0x4ca83f){var _0x42da1c=typeof _0x23d92d['offset']===_0xda4b('0x1e')&&typeof _0x23d92d[_0xda4b('0x1f')]===_0xda4b('0x1e');var _0x631cb2=_0x4ca83f[_0xda4b('0x20')];var _0x176b5=_0x42da1c?0x0:_0x23d92d[_0xda4b('0x21')];var _0xfed404=_0x42da1c?_0x4ca83f['count']:_0x23d92d[_0xda4b('0x21')]+_0x23d92d[_0xda4b('0x1f')];var _0x3db4f5;if(_0xfed404>=_0x631cb2){_0xfed404=_0x631cb2;_0x3db4f5=0xc8;}else{_0x3db4f5=0xce;}_0x494a2d[_0xda4b('0x1b')](_0x3db4f5);return _0x494a2d[_0xda4b('0x22')](_0xda4b('0x23'),_0x176b5+'-'+_0xfed404+'/'+_0x631cb2)['json'](_0x4ca83f);}return null;};}function patchUpdates(_0x26644a){return function(_0x52b454){try{jsonpatch[_0xda4b('0x24')](_0x52b454,_0x26644a,!![]);}catch(_0x4da5d0){return BPromise[_0xda4b('0x25')](_0x4da5d0);}return _0x52b454[_0xda4b('0x26')]();};}function saveUpdates(_0x52b658,_0xecd8c3){return function(_0x1701dc){if(_0x1701dc){return _0x1701dc['update'](_0x52b658)[_0xda4b('0x27')](function(_0x482a1a){return _0x482a1a;});}return null;};}function removeEntity(_0x199012,_0x56cdc1){return function(_0x31e92e){if(_0x31e92e){return _0x31e92e[_0xda4b('0x28')]()[_0xda4b('0x27')](function(){_0x199012[_0xda4b('0x1b')](0xcc)[_0xda4b('0x1c')]();});}};}function handleEntityNotFound(_0x17567f,_0x28ba98){return function(_0x38cd73){if(!_0x38cd73){_0x17567f[_0xda4b('0x1a')](0x194);}return _0x38cd73;};}function handleError(_0x562d81,_0x5e03de){_0x5e03de=_0x5e03de||0x1f4;return function(_0x38a917){logger['error'](_0x38a917[_0xda4b('0x29')]);if(_0x38a917[_0xda4b('0x2a')]){delete _0x38a917[_0xda4b('0x2a')];}_0x562d81['status'](_0x5e03de)[_0xda4b('0x2b')](_0x38a917);};}exports[_0xda4b('0x2c')]=function(_0x53b9f3,_0x6ebfb5,_0x2321b7){if(!_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')](_0xda4b('0x2f'))&&!_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')](_0xda4b('0x30'))){throw new db[(_0xda4b('0x31'))]['ValidationError'](_0xda4b('0x32'));}else{if(_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')](_0xda4b('0x30'))&&!_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')]('view')){throw new db[(_0xda4b('0x31'))][(_0xda4b('0x33'))](_0xda4b('0x34'));}if(!_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')](_0xda4b('0x35'))){throw new db['Sequelize'][(_0xda4b('0x33'))](_0xda4b('0x36'));}else{try{var _0x2d4a11=JSON[_0xda4b('0x37')](_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x35')]);}catch(_0xa7ed2d){logger[_0xda4b('0x38')](_0xa7ed2d);throw new db[(_0xda4b('0x31'))][(_0xda4b('0x33'))](_0xda4b('0x39'));}var _0x433fac=['chatqueue',_0xda4b('0x3a'),_0xda4b('0x3b'),_0xda4b('0x3c'),_0xda4b('0x3d'),_0xda4b('0x3e'),_0xda4b('0x3f'),'team',_0xda4b('0x40')];if(_[_0xda4b('0x41')](_0x2d4a11,function(_0x46a110){return!_['includes'](_0x433fac,_0x46a110['model'][_0xda4b('0x42')]());})){throw new db[(_0xda4b('0x31'))][(_0xda4b('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x54d6b0={};_0x54d6b0[_0xda4b('0x43')]=_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x2e')](_0xda4b('0x43'))?_0x53b9f3['body'][_0xda4b('0x43')]:_0x53b9f3[_0xda4b('0x40')][_0xda4b('0x44')];_0x54d6b0['recipientsDescription']=_[_0xda4b('0x45')](_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x46')])?null:_0x53b9f3[_0xda4b('0x2d')]['recipientsDescription'];_0x54d6b0[_0xda4b('0x47')]=_0x53b9f3[_0xda4b('0x2d')][_0xda4b('0x47')]||![];_0x54d6b0[_0xda4b('0x48')]=_0x53b9f3['user']['id'];return getContent(_0x53b9f3['body'])[_0xda4b('0x27')](function(_0x5ed012){_0x54d6b0[_0xda4b('0x2d')]=_0x5ed012;return getRecipients(_0x2d4a11);})['then'](function(_0x422c06){_0x54d6b0[_0xda4b('0x49')]=_['sortBy'](_0x422c06)[_0xda4b('0x4a')](',');return db['sequelize']['transaction'](function(_0x3f75ec){return db[_0xda4b('0x4b')][_0xda4b('0x4c')](_0x54d6b0,{'raw':!![],'transaction':_0x3f75ec})['then'](function(_0xcf15a8){var _0x50e502={'sender':_0x54d6b0['senderName'],'description':_0x54d6b0['recipientsDescription'],'content':_0x54d6b0[_0xda4b('0x2d')],'beep':_0x54d6b0['beep']};_0x422c06[_0xda4b('0x4d')](function(_0x56c395){_0x50e502[_0xda4b('0x4e')]=_0x56c395;socket[_0xda4b('0x4f')](_0xda4b('0x50'),_0x50e502);});return _0xcf15a8;});});})[_0xda4b('0x27')](respondWithResult(_0x6ebfb5,0xc9))['catch'](handleError(_0x6ebfb5,null));};function getContent(_0x2d71f3){return new BPromise(function(_0x1f17f5,_0x26b9bb){if(_0x2d71f3[_0xda4b('0x2f')]){_0x1f17f5(_0x2d71f3[_0xda4b('0x2f')]);return;}return db[_0xda4b('0x51')]['findOne']({'attributes':[_0xda4b('0x52')],'where':{'id':_0x2d71f3[_0xda4b('0x30')]},'raw':!![]})['then'](function(_0x56ea35){if(!_0x56ea35)throw new db[(_0xda4b('0x31'))][(_0xda4b('0x33'))](_0xda4b('0x53'));var _0x3eecf6=Mustache[_0xda4b('0x54')](_0x56ea35[_0xda4b('0x52')],_0x2d71f3[_0xda4b('0x55')]);_0x1f17f5(_0x3eecf6);})['catch'](function(_0x33db99){_0x26b9bb(_0x33db99);});});}function getRecipients(_0x537229){return new BPromise(function(_0x82a034,_0x242e50){var _0x53ea7b=[];var _0x54c573=[];_0x537229[_0xda4b('0x4d')](function(_0x4b4942){var _0x28baa6=_[_0xda4b('0x56')](_0x4b4942[_0xda4b('0x57')][_0xda4b('0x42')]());if(_0x28baa6==='User'){_0x53ea7b=_[_0xda4b('0x58')](_0x53ea7b,_0x4b4942[_0xda4b('0x59')]);}else{if(_[_0xda4b('0x5a')](_0x28baa6,_0xda4b('0x5b')))_0x28baa6=_0x28baa6[_0xda4b('0x5c')](_0xda4b('0x5b'),'Queue');_0x4b4942['ids'][_0xda4b('0x4d')](function(_0x10df6c){_0x54c573[_0xda4b('0x5d')](getAgents(_0x28baa6,_0x10df6c));});}});return BPromise[_0xda4b('0x5e')](_0x54c573)[_0xda4b('0x27')](function(_0x4b1efc){_0x53ea7b=_['union'](_0x53ea7b,_[_0xda4b('0x5f')](_0x4b1efc));_0x82a034(_0x53ea7b);})['catch'](function(_0x73f6c0){_0x242e50(_0x73f6c0);});});}function getAgents(_0x3b6bf6,_0x5cffa4){return new BPromise(function(_0x1ecd6b,_0x32be07){return db[_0x3b6bf6][_0xda4b('0x60')]({'where':{'id':_0x5cffa4}})['then'](function(_0x2aa07d){return _0x2aa07d[_0xda4b('0x61')]({'attributes':['id'],'raw':!![]})[_0xda4b('0x27')](function(_0x36e88f){var _0x2c22e6=_[_0xda4b('0x62')](_0x36e88f,'id');_0x1ecd6b(_0x2c22e6);});})[_0xda4b('0x63')](function(_0x3c41bc){_0x32be07(_0x3c41bc);});});} \ No newline at end of file +var _0x86f3=['json','undefined','count','offset','limit','set','Content-Range','save','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','includes','queue','replace','Queue','push','all','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end'];(function(_0x331a65,_0x567144){var _0x4171ff=function(_0x406b62){while(--_0x406b62){_0x331a65['push'](_0x331a65['shift']());}};_0x4171ff(++_0x567144);}(_0x86f3,0x16c));var _0x386f=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x86f3[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require(_0x386f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x386f('0x1'));var jsonpatch=require(_0x386f('0x2'));var rp=require(_0x386f('0x3'));var moment=require('moment');var BPromise=require(_0x386f('0x4'));var Mustache=require(_0x386f('0x5'));var util=require(_0x386f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x386f('0x7'));var fs=require('fs');var fs_extra=require(_0x386f('0x8'));var _=require(_0x386f('0x9'));var squel=require(_0x386f('0xa'));var crypto=require(_0x386f('0xb'));var jsforce=require(_0x386f('0xc'));var deskjs=require(_0x386f('0xd'));var toCsv=require(_0x386f('0xe'));var querystring=require(_0x386f('0xf'));var Papa=require(_0x386f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x386f('0x11'));var hardwareService=require(_0x386f('0x12'));var logger=require(_0x386f('0x13'))(_0x386f('0x14'));var utils=require('../../config/utils');var config=require(_0x386f('0x15'));var licenseUtil=require(_0x386f('0x16'));var db=require(_0x386f('0x17'))['db'];config[_0x386f('0x18')]=_[_0x386f('0x19')](config[_0x386f('0x18')],{'host':_0x386f('0x1a'),'port':0x18eb});var socket=require(_0x386f('0x1b'))(new Redis(config[_0x386f('0x18')]));require(_0x386f('0x1c'))['register'](socket);function respondWithStatusCode(_0x4add34,_0x2d0d76){_0x2d0d76=_0x2d0d76||0xcc;return function(_0x3e1518){if(_0x3e1518){return _0x4add34[_0x386f('0x1d')](_0x2d0d76);}return _0x4add34[_0x386f('0x1e')](_0x2d0d76)[_0x386f('0x1f')]();};}function respondWithResult(_0x1e1cd4,_0x8d6037){_0x8d6037=_0x8d6037||0xc8;return function(_0x33b6a9){if(_0x33b6a9){return _0x1e1cd4[_0x386f('0x1e')](_0x8d6037)[_0x386f('0x20')](_0x33b6a9);}};}function respondWithFilteredResult(_0x1ebc94,_0x454b95){return function(_0x169225){if(_0x169225){var _0x56a6b3=typeof _0x454b95['offset']===_0x386f('0x21')&&typeof _0x454b95['limit']==='undefined';var _0x13a490=_0x169225[_0x386f('0x22')];var _0x25105a=_0x56a6b3?0x0:_0x454b95[_0x386f('0x23')];var _0x1f53e4=_0x56a6b3?_0x169225['count']:_0x454b95[_0x386f('0x23')]+_0x454b95[_0x386f('0x24')];var _0x10542d;if(_0x1f53e4>=_0x13a490){_0x1f53e4=_0x13a490;_0x10542d=0xc8;}else{_0x10542d=0xce;}_0x1ebc94[_0x386f('0x1e')](_0x10542d);return _0x1ebc94[_0x386f('0x25')](_0x386f('0x26'),_0x25105a+'-'+_0x1f53e4+'/'+_0x13a490)[_0x386f('0x20')](_0x169225);}return null;};}function patchUpdates(_0x3579e0){return function(_0x17415c){try{jsonpatch['apply'](_0x17415c,_0x3579e0,!![]);}catch(_0x5be997){return BPromise['reject'](_0x5be997);}return _0x17415c[_0x386f('0x27')]();};}function saveUpdates(_0x1a436d,_0x1f5d66){return function(_0x1c5b61){if(_0x1c5b61){return _0x1c5b61['update'](_0x1a436d)[_0x386f('0x28')](function(_0x18288f){return _0x18288f;});}return null;};}function removeEntity(_0x594263,_0x305cb8){return function(_0x124b05){if(_0x124b05){return _0x124b05['destroy']()[_0x386f('0x28')](function(){_0x594263[_0x386f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a7fa,_0x22b437){return function(_0x34ce13){if(!_0x34ce13){_0x16a7fa[_0x386f('0x1d')](0x194);}return _0x34ce13;};}function handleError(_0x4252c5,_0x29803c){_0x29803c=_0x29803c||0x1f4;return function(_0x41372f){logger[_0x386f('0x29')](_0x41372f[_0x386f('0x2a')]);if(_0x41372f['name']){delete _0x41372f[_0x386f('0x2b')];}_0x4252c5['status'](_0x29803c)[_0x386f('0x2c')](_0x41372f);};}exports[_0x386f('0x2d')]=function(_0x4b2a88,_0xee5409,_0x4ec35a){if(!_0x4b2a88[_0x386f('0x2e')][_0x386f('0x2f')](_0x386f('0x30'))&&!_0x4b2a88[_0x386f('0x2e')][_0x386f('0x2f')](_0x386f('0x31'))){throw new db['Sequelize'][(_0x386f('0x32'))](_0x386f('0x33'));}else{if(_0x4b2a88[_0x386f('0x2e')][_0x386f('0x2f')](_0x386f('0x31'))&&!_0x4b2a88[_0x386f('0x2e')][_0x386f('0x2f')](_0x386f('0x34'))){throw new db[(_0x386f('0x35'))][(_0x386f('0x32'))](_0x386f('0x36'));}if(!_0x4b2a88[_0x386f('0x2e')]['hasOwnProperty']('recipients')){throw new db['Sequelize'][(_0x386f('0x32'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4de9f0=JSON['parse'](_0x4b2a88[_0x386f('0x2e')][_0x386f('0x37')]);}catch(_0x714215){logger[_0x386f('0x29')](_0x714215);throw new db[(_0x386f('0x35'))][(_0x386f('0x32'))](_0x386f('0x38'));}var _0x27bc5d=[_0x386f('0x39'),_0x386f('0x3a'),_0x386f('0x3b'),_0x386f('0x3c'),_0x386f('0x3d'),'voicequeue',_0x386f('0x3e'),'team',_0x386f('0x3f')];if(_[_0x386f('0x40')](_0x4de9f0,function(_0x338219){return!_['includes'](_0x27bc5d,_0x338219[_0x386f('0x41')][_0x386f('0x42')]());})){throw new db[(_0x386f('0x35'))][(_0x386f('0x32'))](_0x386f('0x43'));}}}var _0x5be8be={};_0x5be8be['senderName']=_0x4b2a88[_0x386f('0x2e')][_0x386f('0x2f')](_0x386f('0x44'))?_0x4b2a88['body'][_0x386f('0x44')]:_0x4b2a88[_0x386f('0x3f')]['fullname'];_0x5be8be[_0x386f('0x45')]=_[_0x386f('0x46')](_0x4b2a88[_0x386f('0x2e')][_0x386f('0x45')])?null:_0x4b2a88['body'][_0x386f('0x45')];_0x5be8be['beep']=_0x4b2a88[_0x386f('0x2e')][_0x386f('0x47')]||![];_0x5be8be['SenderId']=_0x4b2a88[_0x386f('0x3f')]['id'];return getContent(_0x4b2a88['body'])[_0x386f('0x28')](function(_0x3deeeb){_0x5be8be['body']=_0x3deeeb;return getRecipients(_0x4de9f0);})[_0x386f('0x28')](function(_0x36c911){_0x5be8be[_0x386f('0x48')]=_[_0x386f('0x49')](_0x36c911)[_0x386f('0x4a')](',');return db[_0x386f('0x4b')][_0x386f('0x4c')](function(_0x4e1851){return db[_0x386f('0x4d')][_0x386f('0x4e')](_0x5be8be,{'raw':!![],'transaction':_0x4e1851})[_0x386f('0x28')](function(_0x3de76e){var _0x1997b1={'sender':_0x5be8be[_0x386f('0x44')],'description':_0x5be8be['recipientsDescription'],'content':_0x5be8be[_0x386f('0x2e')],'beep':_0x5be8be[_0x386f('0x47')]};_0x36c911[_0x386f('0x4f')](function(_0xcc78fb){_0x1997b1['recipient']=_0xcc78fb;socket[_0x386f('0x50')](_0x386f('0x51'),_0x1997b1);});return _0x3de76e;});});})[_0x386f('0x28')](respondWithResult(_0xee5409,0xc9))[_0x386f('0x52')](handleError(_0xee5409,null));};function getContent(_0x396781){return new BPromise(function(_0x2c99f1,_0x504669){if(_0x396781[_0x386f('0x30')]){_0x2c99f1(_0x396781[_0x386f('0x30')]);return;}return db[_0x386f('0x53')][_0x386f('0x54')]({'attributes':[_0x386f('0x55')],'where':{'id':_0x396781[_0x386f('0x31')]},'raw':!![]})[_0x386f('0x28')](function(_0x2a6108){if(!_0x2a6108)throw new db['Sequelize']['ValidationError'](_0x386f('0x56'));var _0x382654=Mustache['render'](_0x2a6108[_0x386f('0x55')],_0x396781[_0x386f('0x34')]);_0x2c99f1(_0x382654);})[_0x386f('0x52')](function(_0x4b3e99){_0x504669(_0x4b3e99);});});}function getRecipients(_0x5cdd04){return new BPromise(function(_0x56ba74,_0x1a85e8){var _0x4a3d61=[];var _0x988a7=[];_0x5cdd04[_0x386f('0x4f')](function(_0x55fa6b){var _0x49a1ea=_[_0x386f('0x57')](_0x55fa6b[_0x386f('0x41')][_0x386f('0x42')]());if(_0x49a1ea===_0x386f('0x58')){_0x4a3d61=_[_0x386f('0x59')](_0x4a3d61,_0x55fa6b[_0x386f('0x5a')]);}else{if(_[_0x386f('0x5b')](_0x49a1ea,_0x386f('0x5c')))_0x49a1ea=_0x49a1ea[_0x386f('0x5d')](_0x386f('0x5c'),_0x386f('0x5e'));_0x55fa6b[_0x386f('0x5a')][_0x386f('0x4f')](function(_0x33a6a8){_0x988a7[_0x386f('0x5f')](getAgents(_0x49a1ea,_0x33a6a8));});}});return BPromise[_0x386f('0x60')](_0x988a7)['then'](function(_0x3bc49f){_0x4a3d61=_[_0x386f('0x59')](_0x4a3d61,_['flatten'](_0x3bc49f));_0x56ba74(_0x4a3d61);})[_0x386f('0x52')](function(_0x922990){_0x1a85e8(_0x922990);});});}function getAgents(_0x321835,_0x404793){return new BPromise(function(_0x50afe7,_0x4d6e45){return db[_0x321835]['findOne']({'where':{'id':_0x404793}})[_0x386f('0x28')](function(_0x52ab91){return _0x52ab91[_0x386f('0x61')]({'attributes':['id'],'raw':!![]})[_0x386f('0x28')](function(_0x27226d){var _0x25b729=_[_0x386f('0x62')](_0x27226d,'id');_0x50afe7(_0x25b729);});})[_0x386f('0x52')](function(_0x28e48b){_0x4d6e45(_0x28e48b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index ac68868..7938c27 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 _0xba9e=['exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x45d6cb,_0x349309){var _0x4120bf=function(_0x3aaab6){while(--_0x3aaab6){_0x45d6cb['push'](_0x45d6cb['shift']());}};_0x4120bf(++_0x349309);}(_0xba9e,0x6f));var _0xeba9=function(_0x559922,_0x4d95c2){_0x559922=_0x559922-0x0;var _0x40e044=_0xba9e[_0x559922];return _0x40e044;};'use strict';var EventEmitter=require(_0xeba9('0x0'));var UserNotification=require(_0xeba9('0x1'))['db'][_0xeba9('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xeba9('0x3')](0x0);var events={'afterCreate':_0xeba9('0x4'),'afterUpdate':_0xeba9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25fef5){return function(_0x407478,_0x2f7fb1,_0x2a9399){UserNotificationEvents[_0xeba9('0x6')](_0x25fef5+':'+_0x407478['id'],_0x407478);UserNotificationEvents['emit'](_0x25fef5,_0x407478);_0x2a9399(null);};}for(var e in events){if(events[_0xeba9('0x7')](e)){var event=events[e];UserNotification[_0xeba9('0x8')](e,emitEvent(event));}}module[_0xeba9('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xc901=['emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc901,0x175));var _0x1c90=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc901[_0x59ee6f];return _0x4c0979;};'use strict';var EventEmitter=require(_0x1c90('0x0'));var UserNotification=require(_0x1c90('0x1'))['db'][_0x1c90('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1c90('0x3')](0x0);var events={'afterCreate':_0x1c90('0x4'),'afterUpdate':_0x1c90('0x5'),'afterDestroy':_0x1c90('0x6')};function emitEvent(_0x6b0215){return function(_0x162ba2,_0x4abb4d,_0x2252a3){UserNotificationEvents['emit'](_0x6b0215+':'+_0x162ba2['id'],_0x162ba2);UserNotificationEvents[_0x1c90('0x7')](_0x6b0215,_0x162ba2);_0x2252a3(null);};}for(var e in events){if(events[_0x1c90('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x1c90('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index c2809c3..f241ef8 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 _0x1e00=['request-promise','rimraf','../../config/environment','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','moment'];(function(_0x44714c,_0x2ac454){var _0x57d4d5=function(_0x5aca44){while(--_0x5aca44){_0x44714c['push'](_0x44714c['shift']());}};_0x57d4d5(++_0x2ac454);}(_0x1e00,0xa9));var _0x01e0=function(_0x118547,_0x180993){_0x118547=_0x118547-0x0;var _0x94afb=_0x1e00[_0x118547];return _0x94afb;};'use strict';var _=require(_0x01e0('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x01e0('0x1'));var BPromise=require('bluebird');var rp=require(_0x01e0('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01e0('0x3'));var config=require(_0x01e0('0x4'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x2340e9,_0x3ac7d6){return _0x2340e9['define'](_0x01e0('0x5'),attributes,{'tableName':_0x01e0('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01e0('0x7'),'collate':_0x01e0('0x8')});}; \ No newline at end of file +var _0x40fb=['request-promise','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x3e550e,_0x51b57b){var _0x569b0f=function(_0x46c1ae){while(--_0x46c1ae){_0x3e550e['push'](_0x3e550e['shift']());}};_0x569b0f(++_0x51b57b);}(_0x40fb,0xb1));var _0xb40f=function(_0x2ab5d7,_0x1243d9){_0x2ab5d7=_0x2ab5d7-0x0;var _0x516388=_0x40fb[_0x2ab5d7];return _0x516388;};'use strict';var _=require(_0xb40f('0x0'));var util=require(_0xb40f('0x1'));var logger=require('../../config/logger')(_0xb40f('0x2'));var moment=require(_0xb40f('0x3'));var BPromise=require(_0xb40f('0x4'));var rp=require(_0xb40f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb40f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb40f('0x7'));module[_0xb40f('0x8')]=function(_0x12c365,_0x26dfe4){return _0x12c365[_0xb40f('0x9')](_0xb40f('0xa'),attributes,{'tableName':_0xb40f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb40f('0xc'),'collate':_0xb40f('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 800c22c..1f81b2c 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 _0x2c54=['code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a3a4c,_0x50e07b){var _0x8054c0=function(_0x504e18){while(--_0x504e18){_0x1a3a4c['push'](_0x1a3a4c['shift']());}};_0x8054c0(++_0x50e07b);}(_0x2c54,0x16b));var _0x42c5=function(_0x1664cb,_0x57a951){_0x1664cb=_0x1664cb-0x0;var _0x4edd61=_0x2c54[_0x1664cb];return _0x4edd61;};'use strict';var _=require('lodash');var util=require(_0x42c5('0x0'));var moment=require('moment');var BPromise=require(_0x42c5('0x1'));var rs=require(_0x42c5('0x2'));var fs=require('fs');var Redis=require(_0x42c5('0x3'));var db=require(_0x42c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c5('0x5'))(_0x42c5('0x6'));var config=require(_0x42c5('0x7'));var jayson=require(_0x42c5('0x8'));var client=jayson[_0x42c5('0x9')][_0x42c5('0xa')]({'port':0x232a});config[_0x42c5('0xb')]=_[_0x42c5('0xc')](config[_0x42c5('0xb')],{'host':_0x42c5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42c5('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x54f164,_0x39b641,_0x22e225){return new BPromise(function(_0x4dc8e2,_0x18552b){return client[_0x42c5('0xe')](_0x54f164,_0x22e225)['then'](function(_0x22d547){logger[_0x42c5('0xf')](_0x42c5('0x10'),_0x39b641,_0x42c5('0x11'));logger['debug'](_0x42c5('0x12'),_0x39b641,_0x42c5('0x11'),JSON[_0x42c5('0x13')](_0x22d547));if(_0x22d547[_0x42c5('0x14')]){if(_0x22d547['error'][_0x42c5('0x15')]===0x1f4){logger['error'](_0x42c5('0x10'),_0x39b641,_0x22d547[_0x42c5('0x14')][_0x42c5('0x16')]);return _0x18552b(_0x22d547[_0x42c5('0x14')][_0x42c5('0x16')]);}logger['error'](_0x42c5('0x10'),_0x39b641,_0x22d547['error'][_0x42c5('0x16')]);return _0x4dc8e2(_0x22d547[_0x42c5('0x14')][_0x42c5('0x16')]);}else{logger[_0x42c5('0xf')]('UserNotification,\x20%s,\x20%s',_0x39b641,_0x42c5('0x11'));_0x4dc8e2(_0x22d547['result'][_0x42c5('0x16')]);}})[_0x42c5('0x17')](function(_0x57be15){logger[_0x42c5('0x14')](_0x42c5('0x10'),_0x39b641,_0x57be15);_0x18552b(_0x57be15);});});} \ No newline at end of file +var _0x314f=['localhost','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x45416a,_0x50d3ec){var _0x5c24f3=function(_0x902ad4){while(--_0x902ad4){_0x45416a['push'](_0x45416a['shift']());}};_0x5c24f3(++_0x50d3ec);}(_0x314f,0x1bd));var _0xf314=function(_0x216a92,_0x961558){_0x216a92=_0x216a92-0x0;var _0x2dc6e8=_0x314f[_0x216a92];return _0x2dc6e8;};'use strict';var _=require(_0xf314('0x0'));var util=require('util');var moment=require(_0xf314('0x1'));var BPromise=require(_0xf314('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf314('0x3'))['db'];var utils=require(_0xf314('0x4'));var logger=require('../../config/logger')(_0xf314('0x5'));var config=require(_0xf314('0x6'));var jayson=require(_0xf314('0x7'));var client=jayson[_0xf314('0x8')][_0xf314('0x9')]({'port':0x232a});config[_0xf314('0xa')]=_['defaults'](config[_0xf314('0xa')],{'host':_0xf314('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf314('0xa')]));require('./userNotification.socket')[_0xf314('0xc')](socket);function respondWithRpcPromise(_0x47e1e1,_0x699df6,_0x18fa06){return new BPromise(function(_0x262e51,_0x256541){return client[_0xf314('0xd')](_0x47e1e1,_0x18fa06)[_0xf314('0xe')](function(_0x536c37){logger[_0xf314('0xf')](_0xf314('0x10'),_0x699df6,_0xf314('0x11'));logger['debug'](_0xf314('0x12'),_0x699df6,'request\x20sent',JSON[_0xf314('0x13')](_0x536c37));if(_0x536c37[_0xf314('0x14')]){if(_0x536c37[_0xf314('0x14')][_0xf314('0x15')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x699df6,_0x536c37[_0xf314('0x14')][_0xf314('0x16')]);return _0x256541(_0x536c37[_0xf314('0x14')][_0xf314('0x16')]);}logger[_0xf314('0x14')]('UserNotification,\x20%s,\x20%s',_0x699df6,_0x536c37[_0xf314('0x14')][_0xf314('0x16')]);return _0x262e51(_0x536c37[_0xf314('0x14')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x699df6,_0xf314('0x11'));_0x262e51(_0x536c37['result'][_0xf314('0x16')]);}})[_0xf314('0x17')](function(_0x10fff7){logger[_0xf314('0x14')](_0xf314('0x10'),_0x699df6,_0x10fff7);_0x256541(_0x10fff7);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 9a4a311..3dc80e3 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 _0x60e6=['update','userNotification:','./userNotification.events','save','remove'];(function(_0x447455,_0x206d8c){var _0x305cf3=function(_0x3738a2){while(--_0x3738a2){_0x447455['push'](_0x447455['shift']());}};_0x305cf3(++_0x206d8c);}(_0x60e6,0xac));var _0x660e=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x60e6[_0x1bc013];return _0x55df36;};'use strict';var UserNotificationEvents=require(_0x660e('0x0'));var events=[_0x660e('0x1'),_0x660e('0x2'),_0x660e('0x3')];function createListener(_0x5959f9,_0x106f1f){return function(_0x8eef07){_0x106f1f['emit'](_0x5959f9,_0x8eef07);};}function removeListener(_0x301bde,_0x51fd40){return function(){UserNotificationEvents['removeListener'](_0x301bde,_0x51fd40);};}exports['register']=function(_0x4c9b51){for(var _0x4ff76f=0x0,_0x3f8c86=events['length'];_0x4ff76f<_0x3f8c86;_0x4ff76f++){var _0x28a300=events[_0x4ff76f];var _0x21434b=createListener(_0x660e('0x4')+_0x28a300,_0x4c9b51);UserNotificationEvents['on'](_0x28a300,_0x21434b);}}; \ No newline at end of file +var _0x0c02=['./userNotification.events','update','removeListener','register','length'];(function(_0x2982ae,_0x3917cd){var _0x3aafbc=function(_0x50b4ee){while(--_0x50b4ee){_0x2982ae['push'](_0x2982ae['shift']());}};_0x3aafbc(++_0x3917cd);}(_0x0c02,0x131));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var UserNotificationEvents=require(_0x20c0('0x0'));var events=['save','remove',_0x20c0('0x1')];function createListener(_0x11eb2a,_0x4c4627){return function(_0x18ee8f){_0x4c4627['emit'](_0x11eb2a,_0x18ee8f);};}function removeListener(_0x592a5c,_0x420afb){return function(){UserNotificationEvents[_0x20c0('0x2')](_0x592a5c,_0x420afb);};}exports[_0x20c0('0x3')]=function(_0x17b9e9){for(var _0x34f790=0x0,_0x1193b8=events[_0x20c0('0x4')];_0x34f790<_0x1193b8;_0x34f790++){var _0x4601c8=events[_0x34f790];var _0x5004cb=createListener('userNotification:'+_0x4601c8,_0x17b9e9);UserNotificationEvents['on'](_0x4601c8,_0x5004cb);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 13f64ac..64ff9e4 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2bc2a2,_0x51e95f){var _0x20de67=function(_0x27f2d2){while(--_0x27f2d2){_0x2bc2a2['push'](_0x2bc2a2['shift']());}};_0x20de67(++_0x51e95f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5002d2,_0x485fc6){var _0x4c6ae5=function(_0x194e73){while(--_0x194e73){_0x5002d2['push'](_0x5002d2['shift']());}};_0x4c6ae5(++_0x485fc6);}(_0xedd9,0xfc));var _0x9edd=function(_0x62c639,_0xf77af){_0x62c639=_0x62c639-0x0;var _0xcf1251=_0xedd9[_0x62c639];return _0xcf1251;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index dd6efb3..1fbd83e 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 _0x9ac8=['INTEGER','sequelize','exports'];(function(_0x3ecb01,_0x2a127f){var _0x2dcef4=function(_0x284910){while(--_0x284910){_0x3ecb01['push'](_0x3ecb01['shift']());}};_0x2dcef4(++_0x2a127f);}(_0x9ac8,0x184));var _0x89ac=function(_0x507acf,_0x3ad8fb){_0x507acf=_0x507acf-0x0;var _0x43baad=_0x9ac8[_0x507acf];return _0x43baad;};'use strict';var Sequelize=require(_0x89ac('0x0'));module[_0x89ac('0x1')]={'penalty':{'type':Sequelize[_0x89ac('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf3ad=['exports','INTEGER','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf3ad,0x1ee));var _0xdf3a=function(_0x169b39,_0x15f8b7){_0x169b39=_0x169b39-0x0;var _0x35d112=_0xf3ad[_0x169b39];return _0x35d112;};'use strict';var Sequelize=require(_0xdf3a('0x0'));module[_0xdf3a('0x1')]={'penalty':{'type':Sequelize[_0xdf3a('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 ed973f6..12536f2 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 _0x7f3d=['user_has_openchannel_queues','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x53287e,_0x4f4c6d){var _0x3e4467=function(_0xc0812){while(--_0xc0812){_0x53287e['push'](_0x53287e['shift']());}};_0x3e4467(++_0x4f4c6d);}(_0x7f3d,0x14b));var _0xd7f3=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x7f3d[_0x2cfb48];return _0xc4594f;};'use strict';var _=require(_0xd7f3('0x0'));var util=require('util');var logger=require(_0xd7f3('0x1'))(_0xd7f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd7f3('0x3'));var fs=require('fs');var path=require(_0xd7f3('0x4'));var rimraf=require(_0xd7f3('0x5'));var config=require(_0xd7f3('0x6'));var attributes=require(_0xd7f3('0x7'));module[_0xd7f3('0x8')]=function(_0x2b2606,_0x46c81e){return _0x2b2606['define'](_0xd7f3('0x9'),attributes,{'tableName':_0xd7f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','lodash','util','api'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0ec6,0x9d));var _0x60ec=function(_0xd30482,_0x28e270){_0xd30482=_0xd30482-0x0;var _0x2243a7=_0x0ec6[_0xd30482];return _0x2243a7;};'use strict';var _=require(_0x60ec('0x0'));var util=require(_0x60ec('0x1'));var logger=require('../../config/logger')(_0x60ec('0x2'));var moment=require(_0x60ec('0x3'));var BPromise=require(_0x60ec('0x4'));var rp=require(_0x60ec('0x5'));var fs=require('fs');var path=require(_0x60ec('0x6'));var rimraf=require(_0x60ec('0x7'));var config=require(_0x60ec('0x8'));var attributes=require(_0x60ec('0x9'));module['exports']=function(_0x276281,_0x4bfea4){return _0x276281['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 9aca711..a3f7dcb 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 _0x652a=['error','code','message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x652a,0xc2));var _0xa652=function(_0x5ff364,_0x5243d4){_0x5ff364=_0x5ff364-0x0;var _0x29e72e=_0x652a[_0x5ff364];return _0x29e72e;};'use strict';var _=require(_0xa652('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa652('0x1'));var rs=require(_0xa652('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa652('0x3'));var logger=require(_0xa652('0x4'))(_0xa652('0x5'));var config=require('../../config/environment');var jayson=require(_0xa652('0x6'));var client=jayson[_0xa652('0x7')][_0xa652('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a89b6,_0x1f97b8,_0x1b92a6){return new BPromise(function(_0x1ebfb1,_0x474d1d){return client[_0xa652('0x9')](_0x5a89b6,_0x1b92a6)[_0xa652('0xa')](function(_0x19dc97){logger[_0xa652('0xb')](_0xa652('0xc'),_0x1f97b8,'request\x20sent');logger['debug'](_0xa652('0xd'),_0x1f97b8,_0xa652('0xe'),JSON[_0xa652('0xf')](_0x19dc97));if(_0x19dc97[_0xa652('0x10')]){if(_0x19dc97['error'][_0xa652('0x11')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f97b8,_0x19dc97[_0xa652('0x10')][_0xa652('0x12')]);return _0x474d1d(_0x19dc97['error']['message']);}logger[_0xa652('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f97b8,_0x19dc97[_0xa652('0x10')]['message']);return _0x1ebfb1(_0x19dc97['error'][_0xa652('0x12')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f97b8,_0xa652('0xe'));_0x1ebfb1(_0x19dc97[_0xa652('0x13')][_0xa652('0x12')]);}})[_0xa652('0x14')](function(_0x496158){logger[_0xa652('0x10')](_0xa652('0xc'),_0x1f97b8,_0x496158);_0x474d1d(_0x496158);});});} \ No newline at end of file +var _0x974c=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0x974c,0x136));var _0xc974=function(_0x3d8433,_0x2be148){_0x3d8433=_0x3d8433-0x0;var _0x4a928e=_0x974c[_0x3d8433];return _0x4a928e;};'use strict';var _=require(_0xc974('0x0'));var util=require(_0xc974('0x1'));var moment=require('moment');var BPromise=require(_0xc974('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc974('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc974('0x4'));var logger=require('../../config/logger')(_0xc974('0x5'));var config=require(_0xc974('0x6'));var jayson=require(_0xc974('0x7'));var client=jayson[_0xc974('0x8')][_0xc974('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e63dd,_0x9c50d6,_0x556774){return new BPromise(function(_0x56b10b,_0x4ba826){return client['request'](_0x3e63dd,_0x556774)[_0xc974('0xa')](function(_0x5796e9){logger[_0xc974('0xb')](_0xc974('0xc'),_0x9c50d6,'request\x20sent');logger[_0xc974('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x9c50d6,'request\x20sent',JSON[_0xc974('0xe')](_0x5796e9));if(_0x5796e9[_0xc974('0xf')]){if(_0x5796e9[_0xc974('0xf')]['code']===0x1f4){logger[_0xc974('0xf')](_0xc974('0xc'),_0x9c50d6,_0x5796e9[_0xc974('0xf')][_0xc974('0x10')]);return _0x4ba826(_0x5796e9['error']['message']);}logger[_0xc974('0xf')](_0xc974('0xc'),_0x9c50d6,_0x5796e9[_0xc974('0xf')]['message']);return _0x56b10b(_0x5796e9[_0xc974('0xf')][_0xc974('0x10')]);}else{logger[_0xc974('0xb')](_0xc974('0xc'),_0x9c50d6,_0xc974('0x11'));_0x56b10b(_0x5796e9[_0xc974('0x12')]['message']);}})[_0xc974('0x13')](function(_0x2f3432){logger[_0xc974('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x9c50d6,_0x2f3432);_0x4ba826(_0x2f3432);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 3be9737..1a830de 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 _0x2e29=['removeResources','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sections','post','create','/:id/clone','clone','addSections','put','update','delete','destroy','/:id/resources'];(function(_0x257544,_0x524c55){var _0x589d7d=function(_0x120396){while(--_0x120396){_0x257544['push'](_0x257544['shift']());}};_0x589d7d(++_0x524c55);}(_0x2e29,0xda));var _0x92e2=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x2e29[_0x39096d];return _0x13da4f;};'use strict';var multer=require('multer');var util=require(_0x92e2('0x0'));var path=require(_0x92e2('0x1'));var timeout=require(_0x92e2('0x2'));var express=require(_0x92e2('0x3'));var router=express['Router']();var fs_extra=require(_0x92e2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x92e2('0x5'));var config=require(_0x92e2('0x6'));var controller=require('./userProfile.controller');router[_0x92e2('0x7')]('/',auth[_0x92e2('0x8')](),controller['index']);router[_0x92e2('0x7')]('/describe',auth[_0x92e2('0x8')](),controller['describe']);router[_0x92e2('0x7')](_0x92e2('0x9'),auth['isAuthenticated'](),controller[_0x92e2('0xa')]);router[_0x92e2('0x7')](_0x92e2('0xb'),auth['isAuthenticated'](),controller['getSections']);router[_0x92e2('0x7')]('/:id/resources',auth[_0x92e2('0x8')](),controller['getResources']);router[_0x92e2('0xc')]('/',auth[_0x92e2('0x8')](),controller[_0x92e2('0xd')]);router[_0x92e2('0xc')](_0x92e2('0xe'),auth[_0x92e2('0x8')](),controller[_0x92e2('0xf')]);router['post'](_0x92e2('0xb'),auth[_0x92e2('0x8')](),controller[_0x92e2('0x10')]);router['post']('/:id/resources',auth[_0x92e2('0x8')](),controller['addResources']);router[_0x92e2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x92e2('0x12')]);router[_0x92e2('0x13')](_0x92e2('0x9'),auth[_0x92e2('0x8')](),controller[_0x92e2('0x14')]);router['delete'](_0x92e2('0xb'),auth[_0x92e2('0x8')](),controller['removeSections']);router['delete'](_0x92e2('0x15'),auth[_0x92e2('0x8')](),controller[_0x92e2('0x16')]);module[_0x92e2('0x17')]=router; \ No newline at end of file +var _0xaab2=['/:id/sections','/:id/resources','getResources','post','/:id/clone','clone','addResources','put','update','delete','removeSections','removeResources','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show'];(function(_0x395718,_0x20322d){var _0x3028b8=function(_0x416f5c){while(--_0x416f5c){_0x395718['push'](_0x395718['shift']());}};_0x3028b8(++_0x20322d);}(_0xaab2,0xca));var _0x2aab=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xaab2[_0x411add];return _0x238242;};'use strict';var multer=require('multer');var util=require(_0x2aab('0x0'));var path=require(_0x2aab('0x1'));var timeout=require(_0x2aab('0x2'));var express=require('express');var router=express[_0x2aab('0x3')]();var fs_extra=require(_0x2aab('0x4'));var auth=require(_0x2aab('0x5'));var interaction=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var controller=require('./userProfile.controller');router[_0x2aab('0x8')]('/',auth['isAuthenticated'](),controller[_0x2aab('0x9')]);router[_0x2aab('0x8')](_0x2aab('0xa'),auth[_0x2aab('0xb')](),controller['describe']);router[_0x2aab('0x8')](_0x2aab('0xc'),auth[_0x2aab('0xb')](),controller[_0x2aab('0xd')]);router[_0x2aab('0x8')](_0x2aab('0xe'),auth['isAuthenticated'](),controller['getSections']);router[_0x2aab('0x8')](_0x2aab('0xf'),auth['isAuthenticated'](),controller[_0x2aab('0x10')]);router[_0x2aab('0x11')]('/',auth[_0x2aab('0xb')](),controller['create']);router[_0x2aab('0x11')](_0x2aab('0x12'),auth[_0x2aab('0xb')](),controller[_0x2aab('0x13')]);router[_0x2aab('0x11')](_0x2aab('0xe'),auth['isAuthenticated'](),controller['addSections']);router[_0x2aab('0x11')]('/:id/resources',auth['isAuthenticated'](),controller[_0x2aab('0x14')]);router[_0x2aab('0x15')](_0x2aab('0xc'),auth[_0x2aab('0xb')](),controller[_0x2aab('0x16')]);router[_0x2aab('0x17')](_0x2aab('0xc'),auth[_0x2aab('0xb')](),controller['destroy']);router[_0x2aab('0x17')](_0x2aab('0xe'),auth[_0x2aab('0xb')](),controller[_0x2aab('0x18')]);router[_0x2aab('0x17')](_0x2aab('0xf'),auth[_0x2aab('0xb')](),controller[_0x2aab('0x19')]);module[_0x2aab('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 8b0bc6c..e586c66 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 _0xbb86=['name','setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','STRING'];(function(_0x36930d,_0x5adae5){var _0x34e91f=function(_0x1a6e87){while(--_0x1a6e87){_0x36930d['push'](_0x36930d['shift']());}};_0x34e91f(++_0x5adae5);}(_0xbb86,0x13f));var _0x6bb8=function(_0x244706,_0x225097){_0x244706=_0x244706-0x0;var _0x286e3e=_0xbb86[_0x244706];return _0x286e3e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6bb8('0x0')],'allowNull':![],'unique':_0x6bb8('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4cd9d6){this[_0x6bb8('0x2')]('crudPermissions',_0x4cd9d6?_0x4cd9d6[_0x6bb8('0x3')](''):[]);},'get':function(){return this[_0x6bb8('0x4')](_0x6bb8('0x5'))?this[_0x6bb8('0x4')](_0x6bb8('0x5'))[_0x6bb8('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6bb8('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6bb8('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8ddf=['getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8ddf,0x8b));var _0xf8dd=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x8ddf[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require('sequelize');module[_0xf8dd('0x0')]={'name':{'type':Sequelize[_0xf8dd('0x1')],'allowNull':![],'unique':_0xf8dd('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xb7eddd){this[_0xf8dd('0x3')](_0xf8dd('0x4'),_0xb7eddd?_0xb7eddd['join'](''):[]);},'get':function(){return this[_0xf8dd('0x5')](_0xf8dd('0x4'))?this[_0xf8dd('0x5')]('crudPermissions')[_0xf8dd('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf8dd('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1ae92d6..32d598a 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 _0x1245=['concat','push','findOne','Dashboard','resourceId','forEach','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','then','destroy','error','stack','name','send','index','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','show','params','create','body','catch','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','map','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','update','addSections','each','removeSections','ids','getSections','isEmpty','subsections','includes','enabled'];(function(_0x25efc3,_0x555aae){var _0x4d3891=function(_0x149c0a){while(--_0x149c0a){_0x25efc3['push'](_0x25efc3['shift']());}};_0x4d3891(++_0x555aae);}(_0x1245,0x1cc));var _0x5124=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1245[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5124('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5124('0x1'));var moment=require(_0x5124('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5124('0x3'));var util=require(_0x5124('0x4'));var path=require(_0x5124('0x5'));var sox=require(_0x5124('0x6'));var csv=require('to-csv');var ejs=require(_0x5124('0x7'));var fs=require('fs');var fs_extra=require(_0x5124('0x8'));var _=require(_0x5124('0x9'));var squel=require(_0x5124('0xa'));var crypto=require(_0x5124('0xb'));var jsforce=require(_0x5124('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5124('0xd'));var querystring=require(_0x5124('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5124('0xf'));var as=require(_0x5124('0x10'));var hardwareService=require(_0x5124('0x11'));var logger=require('../../config/logger')(_0x5124('0x12'));var utils=require(_0x5124('0x13'));var config=require(_0x5124('0x14'));var licenseUtil=require(_0x5124('0x15'));var db=require(_0x5124('0x16'))['db'];config[_0x5124('0x17')]=_[_0x5124('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5124('0x19'))[_0x5124('0x1a')](socket);function respondWithStatusCode(_0xb42e83,_0xa6b437){_0xa6b437=_0xa6b437||0xcc;return function(_0x544cb4){if(_0x544cb4){return _0xb42e83[_0x5124('0x1b')](_0xa6b437);}return _0xb42e83[_0x5124('0x1c')](_0xa6b437)[_0x5124('0x1d')]();};}function respondWithResult(_0x2418ac,_0x327e5b){_0x327e5b=_0x327e5b||0xc8;return function(_0x211e24){if(_0x211e24){return _0x2418ac[_0x5124('0x1c')](_0x327e5b)[_0x5124('0x1e')](_0x211e24);}};}function respondWithFilteredResult(_0x2f9352,_0x2b84cc){return function(_0x4243b8){if(_0x4243b8){var _0x14515f=typeof _0x2b84cc['offset']==='undefined'&&typeof _0x2b84cc['limit']===_0x5124('0x1f');var _0x48436b=_0x4243b8[_0x5124('0x20')];var _0xdcaf45=_0x14515f?0x0:_0x2b84cc[_0x5124('0x21')];var _0x38ad52=_0x14515f?_0x4243b8[_0x5124('0x20')]:_0x2b84cc[_0x5124('0x21')]+_0x2b84cc[_0x5124('0x22')];var _0x191417;if(_0x38ad52>=_0x48436b){_0x38ad52=_0x48436b;_0x191417=0xc8;}else{_0x191417=0xce;}_0x2f9352[_0x5124('0x1c')](_0x191417);return _0x2f9352[_0x5124('0x23')]('Content-Range',_0xdcaf45+'-'+_0x38ad52+'/'+_0x48436b)[_0x5124('0x1e')](_0x4243b8);}return null;};}function patchUpdates(_0x781dba){return function(_0xe1ebe7){try{jsonpatch['apply'](_0xe1ebe7,_0x781dba,!![]);}catch(_0x2d8903){return BPromise['reject'](_0x2d8903);}return _0xe1ebe7['save']();};}function saveUpdates(_0x126162,_0xf9c13){return function(_0x3ee081){if(_0x3ee081){return _0x3ee081['update'](_0x126162)[_0x5124('0x24')](function(_0x474a26){return _0x474a26;});}return null;};}function removeEntity(_0xc0a860,_0x531faf){return function(_0x5b2296){if(_0x5b2296){return _0x5b2296[_0x5124('0x25')]()[_0x5124('0x24')](function(){_0xc0a860[_0x5124('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x335a1b,_0x478270){return function(_0x9dbc90){if(!_0x9dbc90){_0x335a1b[_0x5124('0x1b')](0x194);}return _0x9dbc90;};}function handleError(_0x35518e,_0x190d02){_0x190d02=_0x190d02||0x1f4;return function(_0x5ccc0b){logger[_0x5124('0x26')](_0x5ccc0b[_0x5124('0x27')]);if(_0x5ccc0b[_0x5124('0x28')]){delete _0x5ccc0b[_0x5124('0x28')];}_0x35518e[_0x5124('0x1c')](_0x190d02)[_0x5124('0x29')](_0x5ccc0b);};}exports[_0x5124('0x2a')]=function(_0x33c3a9,_0x178d25){var _0x58ad57={},_0x4271ee={},_0x2418ff={'count':0x0,'rows':[]};var _0x17ed17=_['map'](db['UserProfile'][_0x5124('0x2b')],function(_0x254244){return{'name':_0x254244['fieldName'],'type':_0x254244['type'][_0x5124('0x2c')]};});_0x4271ee[_0x5124('0x2d')]=_['map'](_0x17ed17,'name');_0x4271ee[_0x5124('0x2e')]=_[_0x5124('0x2f')](_0x33c3a9[_0x5124('0x2e')]);_0x4271ee['filters']=_[_0x5124('0x30')](_0x4271ee[_0x5124('0x2d')],_0x4271ee['query']);_0x58ad57['attributes']=_[_0x5124('0x30')](_0x4271ee['model'],qs[_0x5124('0x31')](_0x33c3a9[_0x5124('0x2e')][_0x5124('0x31')]));_0x58ad57[_0x5124('0x32')]=_0x58ad57[_0x5124('0x32')][_0x5124('0x33')]?_0x58ad57[_0x5124('0x32')]:_0x4271ee[_0x5124('0x2d')];if(!_0x33c3a9[_0x5124('0x2e')][_0x5124('0x34')](_0x5124('0x35'))){_0x58ad57['limit']=qs[_0x5124('0x22')](_0x33c3a9[_0x5124('0x2e')][_0x5124('0x22')]);_0x58ad57[_0x5124('0x21')]=qs[_0x5124('0x21')](_0x33c3a9[_0x5124('0x2e')][_0x5124('0x21')]);}_0x58ad57[_0x5124('0x36')]=qs[_0x5124('0x37')](_0x33c3a9['query']['sort']);_0x58ad57[_0x5124('0x38')]=qs['filters'](_[_0x5124('0x39')](_0x33c3a9['query'],_0x4271ee[_0x5124('0x3a')]),_0x17ed17);if(_0x33c3a9[_0x5124('0x2e')][_0x5124('0x3b')]){_0x58ad57[_0x5124('0x38')]=_[_0x5124('0x3c')](_0x58ad57[_0x5124('0x38')],{'$or':_['map'](_0x17ed17,function(_0x18a4e5){if(_0x18a4e5[_0x5124('0x3d')]!==_0x5124('0x3e')){var _0x369f1a={};_0x369f1a[_0x18a4e5[_0x5124('0x28')]]={'$like':'%'+_0x33c3a9[_0x5124('0x2e')]['filter']+'%'};return _0x369f1a;}})});}_0x58ad57=_[_0x5124('0x3c')]({},_0x58ad57,_0x33c3a9[_0x5124('0x3f')]);var _0x24d8dd={'where':_0x58ad57[_0x5124('0x38')]};return db[_0x5124('0x40')][_0x5124('0x20')](_0x24d8dd)['then'](function(_0x347244){_0x2418ff[_0x5124('0x20')]=_0x347244;if(_0x33c3a9[_0x5124('0x2e')][_0x5124('0x41')]){_0x58ad57[_0x5124('0x42')]=[{'all':!![]}];}return db[_0x5124('0x40')][_0x5124('0x43')](_0x58ad57);})[_0x5124('0x24')](function(_0x505548){_0x2418ff[_0x5124('0x44')]=_0x505548;return _0x2418ff;})[_0x5124('0x24')](respondWithFilteredResult(_0x178d25,_0x58ad57))['catch'](handleError(_0x178d25,null));};exports[_0x5124('0x45')]=function(_0x3bfb19,_0x5b851a){var _0x248346={'raw':![],'where':{'id':_0x3bfb19[_0x5124('0x46')]['id']}},_0x125c84={};_0x125c84[_0x5124('0x2d')]=_[_0x5124('0x2f')](db[_0x5124('0x40')]['rawAttributes']);_0x125c84['query']=_['keys'](_0x3bfb19[_0x5124('0x2e')]);_0x125c84[_0x5124('0x3a')]=_[_0x5124('0x30')](_0x125c84[_0x5124('0x2d')],_0x125c84[_0x5124('0x2e')]);_0x248346[_0x5124('0x32')]=_['intersection'](_0x125c84[_0x5124('0x2d')],qs[_0x5124('0x31')](_0x3bfb19[_0x5124('0x2e')][_0x5124('0x31')]));_0x248346[_0x5124('0x32')]=_0x248346[_0x5124('0x32')][_0x5124('0x33')]?_0x248346['attributes']:_0x125c84[_0x5124('0x2d')];if(_0x3bfb19[_0x5124('0x2e')][_0x5124('0x41')]){_0x248346[_0x5124('0x42')]=[{'all':!![]}];}_0x248346=_['merge']({},_0x248346,_0x3bfb19[_0x5124('0x3f')]);return db['UserProfile']['find'](_0x248346)['then'](handleEntityNotFound(_0x5b851a,null))[_0x5124('0x24')](respondWithResult(_0x5b851a,null))['catch'](handleError(_0x5b851a,null));};exports[_0x5124('0x47')]=function(_0x2aa157,_0x5a7d36){return db[_0x5124('0x40')][_0x5124('0x47')](_0x2aa157[_0x5124('0x48')],{})['then'](respondWithResult(_0x5a7d36,0xc9))[_0x5124('0x49')](handleError(_0x5a7d36,null));};exports[_0x5124('0x4a')]=function(_0x4b7c91,_0x403ebb){var _0x2821fb={'where':{'id':_0x4b7c91[_0x5124('0x46')]['id']}},_0x1a67b7={};_0x1a67b7[_0x5124('0x2d')]=_[_0x5124('0x2f')](db[_0x5124('0x40')][_0x5124('0x2b')]);_0x2821fb[_0x5124('0x32')]=_[_0x5124('0x30')](_0x1a67b7[_0x5124('0x2d')],qs[_0x5124('0x31')](_0x4b7c91[_0x5124('0x2e')][_0x5124('0x31')]));_0x2821fb['attributes']=_0x2821fb[_0x5124('0x32')][_0x5124('0x33')]?_0x2821fb[_0x5124('0x32')]:_0x1a67b7[_0x5124('0x2d')];if(_0x4b7c91['query'][_0x5124('0x41')]){_0x2821fb[_0x5124('0x42')]=[{'all':!![]}];}_0x2821fb=_[_0x5124('0x3c')]({},_0x2821fb,_0x4b7c91[_0x5124('0x3f')]);return db[_0x5124('0x40')][_0x5124('0x4b')](_0x2821fb)[_0x5124('0x24')](handleEntityNotFound(_0x403ebb,null))[_0x5124('0x24')](function(_0x12a6de){if(_0x12a6de){var _0x52db1a=_0x12a6de[_0x5124('0x4c')]({'plain':!![]});_0x52db1a=qs[_0x5124('0x4d')](_0x52db1a,['id',_0x5124('0x4e'),_0x5124('0x4f'),_0x5124('0x50')]);_0x4b7c91[_0x5124('0x48')]=_['omit'](_0x4b7c91[_0x5124('0x48')],['id',_0x5124('0x4e'),_0x5124('0x4f')]);return db[_0x5124('0x51')][_0x5124('0x52')](function(_0x1c8bd8){return db[_0x5124('0x40')][_0x5124('0x47')](_['merge'](_0x52db1a,_0x4b7c91[_0x5124('0x48')]),{'include':_0x4b7c91[_0x5124('0x2e')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x1c8bd8})[_0x5124('0x24')](function(_0x29abe3){var _0x33e27c=_0x29abe3[_0x5124('0x4c')]({'plain':!![]});return db['UserProfileSection'][_0x5124('0x43')]({'where':{'userProfileId':_0x4b7c91['params']['id']},'raw':!![]})[_0x5124('0x24')](function(_0x117352){if(_0x117352){return BPromise['each'](_0x117352,function(_0x5c8d90){return new BPromise(function(_0x2e48ea,_0x1f614b){if(_0x5c8d90[_0x5124('0x53')]===null||_0x5c8d90['autoAssociation']===0x1)_0x2e48ea(null);return db['UserProfileResource'][_0x5124('0x43')]({'where':{'sectionId':_0x5c8d90['id']},'raw':!![]})['then'](function(_0x4863ad){var _0x4536bf=_[_0x5124('0x54')](_0x4863ad,function(_0x18ecac){return qs[_0x5124('0x4d')](_0x18ecac,['id',_0x5124('0x4e'),'updatedAt',_0x5124('0x55')]);});_0x2e48ea(_0x4536bf);})[_0x5124('0x49')](function(_0x13467d){_0x1f614b(_0x13467d);});})['then'](function(_0x279049){var _0xcd286=qs[_0x5124('0x4d')](_0x5c8d90,['id',_0x5124('0x4e'),_0x5124('0x4f')]);_0xcd286[_0x5124('0x56')]=_0x33e27c['id'];if(_0x279049)_0xcd286[_0x5124('0x57')]=_0x279049;return _0xcd286;})[_0x5124('0x24')](function(_0xfd2b4b){return db[_0x5124('0x58')][_0x5124('0x47')](_0xfd2b4b,{'include':[{'model':db[_0x5124('0x59')],'as':_0x5124('0x57')}],'raw':!![],'transaction':_0x1c8bd8});});})['then'](function(){return _0x33e27c;});}});});});}})[_0x5124('0x24')](respondWithResult(_0x403ebb,0xc9))[_0x5124('0x49')](handleError(_0x403ebb,null));};exports[_0x5124('0x5a')]=function(_0x26e217,_0x3cfaa7){if(_0x26e217[_0x5124('0x48')]['id']){delete _0x26e217[_0x5124('0x48')]['id'];}return db[_0x5124('0x40')][_0x5124('0x4b')]({'where':{'id':_0x26e217[_0x5124('0x46')]['id']}})[_0x5124('0x24')](handleEntityNotFound(_0x3cfaa7,null))[_0x5124('0x24')](saveUpdates(_0x26e217[_0x5124('0x48')],null))[_0x5124('0x24')](respondWithResult(_0x3cfaa7,null))['catch'](handleError(_0x3cfaa7,null));};exports['destroy']=function(_0x2f065d,_0x22f349){return db[_0x5124('0x40')][_0x5124('0x4b')]({'where':{'id':_0x2f065d[_0x5124('0x46')]['id']}})[_0x5124('0x24')](handleEntityNotFound(_0x22f349,null))[_0x5124('0x24')](removeEntity(_0x22f349,null))['catch'](handleError(_0x22f349,null));};exports['describe']=function(_0x516511,_0x5a0138){return db[_0x5124('0x40')]['describe']()['then'](respondWithResult(_0x5a0138,null))['catch'](handleError(_0x5a0138,null));};exports[_0x5124('0x5b')]=function(_0x49baea,_0x1c091b){var _0x57ac00=_0x49baea['body'];return db[_0x5124('0x40')][_0x5124('0x4b')]({'where':{'id':_0x49baea['params']['id']}})[_0x5124('0x24')](handleEntityNotFound(_0x1c091b,null))[_0x5124('0x24')](function(_0x3b04a9){if(_0x3b04a9){return db[_0x5124('0x51')][_0x5124('0x52')](function(_0x3d7dd3){return db['UserProfileSection'][_0x5124('0x25')]({'where':{'userProfileId':_0x49baea[_0x5124('0x46')]['id'],'sectionId':_['map'](_0x57ac00,function(_0x411366){return _0x411366[_0x5124('0x55')];})},'transaction':_0x3d7dd3})[_0x5124('0x24')](function(){var _0x372344=_[_0x5124('0x54')](_0x57ac00,function(_0x333c66){_0x333c66[_0x5124('0x56')]=_0x49baea[_0x5124('0x46')]['id'];return _0x333c66;});var _0x36a76c=[];return BPromise[_0x5124('0x5c')](_0x372344,function(_0x3458e4){return db['UserProfileSection'][_0x5124('0x47')](_0x3458e4,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x3d7dd3})['then'](function(_0x53be5e){_0x36a76c['push'](_0x53be5e[_0x5124('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x36a76c;});});});}})[_0x5124('0x24')](function(_0x5b5fa8){return _0x5b5fa8;})[_0x5124('0x24')](respondWithResult(_0x1c091b,null))[_0x5124('0x49')](handleError(_0x1c091b,null));};exports[_0x5124('0x5d')]=function(_0x542fa7,_0x475161){var _0x4bfb30;return db['UserProfile'][_0x5124('0x4b')]({'where':{'id':_0x542fa7[_0x5124('0x46')]['id']},'attributes':['id',_0x5124('0x28')]})['then'](handleEntityNotFound(_0x475161,null))[_0x5124('0x24')](function(_0x5ee9b3){if(_0x5ee9b3){_0x4bfb30=_0x5ee9b3;return db[_0x5124('0x58')][_0x5124('0x25')]({'where':{'userProfileId':_0x542fa7[_0x5124('0x46')]['id'],'sectionId':_0x542fa7[_0x5124('0x2e')][_0x5124('0x5e')]}});}})[_0x5124('0x24')](function(){return _0x4bfb30;})[_0x5124('0x24')](respondWithStatusCode(_0x475161,null))[_0x5124('0x49')](handleError(_0x475161,null));};exports[_0x5124('0x5f')]=function(_0x777fbd,_0x25afa4){var _0x276e0a=[];var _0x4b0a04=[];return db[_0x5124('0x58')]['findAll']({'where':{'userProfileId':_0x777fbd['params']['id']},'raw':!![]})[_0x5124('0x24')](function(_0x5789ad){_0x276e0a=_[_0x5124('0x3b')](_0x5789ad,function(_0x89bd44){return _0x89bd44['enabled']===0x1||_['includes']([0x3eb,0x709],_0x89bd44[_0x5124('0x55')]);});if(!_[_0x5124('0x60')](_0x276e0a)){return _[_0x5124('0x54')](_0x276e0a,function(_0x460d88){return _0x460d88['sectionId'];});}else{return;}})[_0x5124('0x24')](function(_0x13da73){if(_0x13da73)_0x4b0a04=_0x13da73;if(_['includes'](_0x4b0a04,0x64)){var _0x341542=_[_0x5124('0x4b')](_0x276e0a,{'sectionId':0x64});return hasDefaultDashboard(_0x341542)[_0x5124('0x24')](function(_0x118f45){return _[_0x5124('0x54')](_0x276e0a,function(_0x54dc5){if(_0x54dc5[_0x5124('0x55')]===0x64){_0x54dc5[_0x5124('0x61')]=_0x118f45;}return _0x54dc5;});});}else{return;}})['then'](function(_0x8af952){if(_0x8af952)_0x276e0a=_0x8af952;if(_[_0x5124('0x62')](_0x4b0a04,0x3eb)){var _0x2dca17=_[_0x5124('0x4b')](_0x276e0a,{'sectionId':0x3eb});return getCustomDashboards(_0x2dca17)['then'](function(_0x16a1fe){return _[_0x5124('0x54')](_0x276e0a,function(_0x34f8e5){if(_0x2dca17[_0x5124('0x63')]){if(_0x34f8e5[_0x5124('0x55')]===0x3eb){_0x34f8e5[_0x5124('0x61')]=_0x16a1fe;}}else{if(_0x34f8e5[_0x5124('0x55')]===0x64){if(!_0x34f8e5['subsections']){_0x34f8e5[_0x5124('0x61')]=[];}_0x34f8e5[_0x5124('0x61')]=_0x34f8e5[_0x5124('0x61')][_0x5124('0x64')](_0x16a1fe);}}return _0x34f8e5;});});}else{return;}})['then'](function(_0x30cec6){if(_0x30cec6)_0x276e0a=_0x30cec6;if(_[_0x5124('0x62')](_0x4b0a04,0x709)){var _0x290ea9=_['find'](_0x276e0a,{'sectionId':0x709});return getPlugins(_0x290ea9)['then'](function(_0x264e9c){if(_0x290ea9[_0x5124('0x63')]){return _['map'](_0x276e0a,function(_0x38e780){if(_0x38e780[_0x5124('0x55')]===0x709){_0x38e780[_0x5124('0x61')]=_0x264e9c;}return _0x38e780;});}else{var _0x3bbe4c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x264e9c};var _0x47aa86=_[_0x5124('0x54')](_0x276e0a);_0x47aa86[_0x5124('0x65')](_0x3bbe4c);return _0x47aa86;}});}else{return;}})[_0x5124('0x24')](function(_0x5050af){if(_0x5050af)_0x276e0a=_0x5050af;return _['filter'](_0x276e0a,['enabled',0x1]);})[_0x5124('0x24')](respondWithResult(_0x25afa4,null))['catch'](handleError(_0x25afa4,null));};function hasDefaultDashboard(_0x38af89){var _0x394476=[0x65];return new BPromise(function(_0x34a839,_0x54df3b){try{if(_0x38af89['autoAssociation']){_0x34a839(_0x394476);}else{return db[_0x5124('0x59')][_0x5124('0x66')]({'where':{'sectionId':_0x38af89['id']},'raw':!![]})[_0x5124('0x24')](function(_0x5f5dc2){_0x5f5dc2?_0x34a839(_0x394476):_0x34a839();});}}catch(_0x39ff92){_0x54df3b(_0x39ff92);}});}function getCustomDashboards(_0x4cd1e3){var _0x2fe3ab=[];return new BPromise(function(_0xa6a2cd,_0x1f5b82){try{if(_0x4cd1e3[_0x5124('0x53')]){return db[_0x5124('0x67')]['findAll']({'raw':!![]})[_0x5124('0x24')](function(_0x400d32){_0x400d32['forEach'](function(_0x4ccd4c){_0x2fe3ab['push'](_0x4ccd4c['id']+0x1869f);});_0xa6a2cd(_0x2fe3ab);});}else{return db[_0x5124('0x59')]['findAll']({'where':{'sectionId':_0x4cd1e3['id']},'raw':!![]})[_0x5124('0x24')](function(_0x1f156d){_0x1f156d['forEach'](function(_0x20cc24){_0x2fe3ab[_0x5124('0x65')](_0x20cc24[_0x5124('0x68')]+0x1869f);});_0xa6a2cd(_0x2fe3ab);});}}catch(_0x4cb0c0){_0x1f5b82(_0x4cb0c0);}});}function getPlugins(_0x16ee4a){var _0x1e6dbe=[];return new BPromise(function(_0xae48e5,_0x456532){try{if(_0x16ee4a['autoAssociation']){return db['Plugin'][_0x5124('0x43')]({'raw':!![]})[_0x5124('0x24')](function(_0x5df032){_0x5df032[_0x5124('0x69')](function(_0x34edf5){_0x1e6dbe[_0x5124('0x65')](_0x34edf5['id']+0x15b38);});_0xae48e5(_0x1e6dbe);});}else{return db[_0x5124('0x59')][_0x5124('0x43')]({'where':{'sectionId':_0x16ee4a['id']},'raw':!![]})['then'](function(_0x18aac9){_0x18aac9[_0x5124('0x69')](function(_0x30f2bb){_0x1e6dbe['push'](_0x30f2bb[_0x5124('0x68')]+0x15b38);});_0xae48e5(_0x1e6dbe);});}}catch(_0x55fd57){_0x456532(_0x55fd57);}});}exports[_0x5124('0x6a')]=function(_0x2857ab,_0x40c1be){return db[_0x5124('0x40')][_0x5124('0x4b')]({'where':{'id':_0x2857ab[_0x5124('0x46')]['id']}})[_0x5124('0x24')](handleEntityNotFound(_0x40c1be,null))['then'](function(_0x2f5ca9){if(_0x2f5ca9){return db[_0x5124('0x51')][_0x5124('0x52')](function(_0x2536c6){return db[_0x5124('0x58')][_0x5124('0x43')]({'where':{'userProfileId':_0x2857ab[_0x5124('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x5124('0x24')](function(_0x5866c6){if(_0x5866c6){return db['UserProfileSection'][_0x5124('0x25')]({'where':{'userProfileId':_0x2857ab['params']['id'],'id':_[_0x5124('0x54')](_0x5866c6,function(_0x2d6da6){return _0x2d6da6['id'];})},'transaction':_0x2536c6});}})[_0x5124('0x24')](function(_0x512df5){var _0x40dee8=_[_0x5124('0x54')](_0x2857ab['body'],function(_0x418af3){_0x418af3['userProfileId']=_0x2857ab[_0x5124('0x46')]['id'];return _0x418af3;});return db[_0x5124('0x58')][_0x5124('0x6b')](_0x40dee8,{'raw':!![],'transaction':_0x2536c6});})[_0x5124('0x24')](function(_0x424148){var _0x596851=_['filter'](_[_0x5124('0x54')](_0x424148,function(_0x4ca06d){return _0x4ca06d[_0x5124('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x596851){return db[_0x5124('0x58')][_0x5124('0x43')]({'where':{'userProfileId':_0x2857ab['params']['id'],'sectionId':_[_0x5124('0x54')](_0x596851,function(_0x303c20){return _0x303c20[_0x5124('0x55')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x2eb7d4){var _0x27fd79=_[_0x5124('0x54')](_0x2857ab[_0x5124('0x48')],function(_0x33ee1e){_0x33ee1e['userProfileId']=_0x2857ab[_0x5124('0x46')]['id'];return _0x33ee1e;});return db['UserProfileResource'][_0x5124('0x6b')](_0x27fd79,{'raw':!![],'transaction':_0x2536c6});});}})[_0x5124('0x49')](handleError(_0x40c1be,null));});}})[_0x5124('0x24')](function(_0x326ad4){var _0x14aa83=_[_0x5124('0x54')](_0x326ad4,function(_0x480202){return _0x480202[_0x5124('0x4c')]({'plain':!![]});});})['then'](respondWithResult(_0x40c1be,null))[_0x5124('0x49')](handleError(_0x40c1be,null));};exports['removeResources']=function(_0x18cfa8,_0x27c851,_0x67c40b){return db['UserProfile']['find']({'where':{'id':_0x18cfa8[_0x5124('0x46')]['id']}})[_0x5124('0x24')](handleEntityNotFound(_0x27c851,null))[_0x5124('0x24')](function(_0x4d57ed){if(_0x4d57ed){return _0x4d57ed['removeResources'](_0x18cfa8[_0x5124('0x2e')][_0x5124('0x5e')]);}})[_0x5124('0x24')](respondWithStatusCode(_0x27c851,null))[_0x5124('0x49')](handleError(_0x27c851,null));};exports[_0x5124('0x6c')]=function(_0x3b4251,_0x3844d8){var _0x2ee16d={};if(!_0x3b4251[_0x5124('0x2e')][_0x5124('0x6d')])throw new Error(_0x5124('0x6e'));if(!_0x3b4251[_0x5124('0x2e')][_0x5124('0x34')](_0x5124('0x35'))){_0x2ee16d[_0x5124('0x22')]=qs[_0x5124('0x22')](_0x3b4251['query'][_0x5124('0x22')]);_0x2ee16d[_0x5124('0x21')]=qs[_0x5124('0x21')](_0x3b4251[_0x5124('0x2e')]['offset']);}return db[_0x5124('0x40')][_0x5124('0x4b')]({'where':{'id':_0x3b4251[_0x5124('0x46')]['id']}})['then'](function(_0x2e70ef){if(!_0x2e70ef)throw new Error(_0x5124('0x6f')+_0x3b4251[_0x5124('0x46')]['id']);return db[_0x5124('0x40')][_0x5124('0x6c')](_0x3b4251);})['then'](respondWithFilteredResult(_0x3844d8,_0x2ee16d))['catch'](handleError(_0x3844d8,null));}; \ No newline at end of file +var _0xb1be=['bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','localhost','socket.io-emitter','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','map','UserProfile','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','keys','rawAttributes','includeAll','catch','create','body','clone','params','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','Plugin','addResources'];(function(_0x49668e,_0x2192db){var _0x1ca211=function(_0x369808){while(--_0x369808){_0x49668e['push'](_0x49668e['shift']());}};_0x1ca211(++_0x2192db);}(_0xb1be,0x1c9));var _0xeb1b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1be[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xeb1b('0x0'));var rimraf=require(_0xeb1b('0x1'));var zipdir=require(_0xeb1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb1b('0x3'));var moment=require(_0xeb1b('0x4'));var BPromise=require(_0xeb1b('0x5'));var Mustache=require(_0xeb1b('0x6'));var util=require(_0xeb1b('0x7'));var path=require(_0xeb1b('0x8'));var sox=require(_0xeb1b('0x9'));var csv=require('to-csv');var ejs=require(_0xeb1b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb1b('0xb'));var crypto=require(_0xeb1b('0xc'));var jsforce=require(_0xeb1b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb1b('0xe'));var Redis=require(_0xeb1b('0xf'));var authService=require(_0xeb1b('0x10'));var qs=require(_0xeb1b('0x11'));var as=require(_0xeb1b('0x12'));var hardwareService=require(_0xeb1b('0x13'));var logger=require(_0xeb1b('0x14'))('api');var utils=require(_0xeb1b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xeb1b('0x16')]=_['defaults'](config[_0xeb1b('0x16')],{'host':_0xeb1b('0x17'),'port':0x18eb});var socket=require(_0xeb1b('0x18'))(new Redis(config[_0xeb1b('0x16')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x57c526,_0x661032){_0x661032=_0x661032||0xcc;return function(_0x4f2fe4){if(_0x4f2fe4){return _0x57c526['sendStatus'](_0x661032);}return _0x57c526[_0xeb1b('0x19')](_0x661032)[_0xeb1b('0x1a')]();};}function respondWithResult(_0x12d8a8,_0x1117ac){_0x1117ac=_0x1117ac||0xc8;return function(_0x33ac7c){if(_0x33ac7c){return _0x12d8a8[_0xeb1b('0x19')](_0x1117ac)[_0xeb1b('0x1b')](_0x33ac7c);}};}function respondWithFilteredResult(_0x23fdfd,_0xbd75ae){return function(_0x74c52e){if(_0x74c52e){var _0x1db772=typeof _0xbd75ae['offset']===_0xeb1b('0x1c')&&typeof _0xbd75ae[_0xeb1b('0x1d')]==='undefined';var _0x2ad1b5=_0x74c52e['count'];var _0x2fafca=_0x1db772?0x0:_0xbd75ae[_0xeb1b('0x1e')];var _0x3163e1=_0x1db772?_0x74c52e[_0xeb1b('0x1f')]:_0xbd75ae[_0xeb1b('0x1e')]+_0xbd75ae['limit'];var _0x2cf674;if(_0x3163e1>=_0x2ad1b5){_0x3163e1=_0x2ad1b5;_0x2cf674=0xc8;}else{_0x2cf674=0xce;}_0x23fdfd[_0xeb1b('0x19')](_0x2cf674);return _0x23fdfd['set'](_0xeb1b('0x20'),_0x2fafca+'-'+_0x3163e1+'/'+_0x2ad1b5)[_0xeb1b('0x1b')](_0x74c52e);}return null;};}function patchUpdates(_0x50d5a8){return function(_0x2db8f4){try{jsonpatch[_0xeb1b('0x21')](_0x2db8f4,_0x50d5a8,!![]);}catch(_0x1bce2b){return BPromise[_0xeb1b('0x22')](_0x1bce2b);}return _0x2db8f4['save']();};}function saveUpdates(_0x3079f2,_0x1122bb){return function(_0x5f3824){if(_0x5f3824){return _0x5f3824[_0xeb1b('0x23')](_0x3079f2)['then'](function(_0x4cfecf){return _0x4cfecf;});}return null;};}function removeEntity(_0x2a7bdb,_0x23e0a2){return function(_0x13445d){if(_0x13445d){return _0x13445d[_0xeb1b('0x24')]()[_0xeb1b('0x25')](function(){_0x2a7bdb[_0xeb1b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a52a1,_0x55b841){return function(_0x1ee751){if(!_0x1ee751){_0x3a52a1[_0xeb1b('0x26')](0x194);}return _0x1ee751;};}function handleError(_0x3c0dc3,_0x1f9381){_0x1f9381=_0x1f9381||0x1f4;return function(_0x13da15){logger[_0xeb1b('0x27')](_0x13da15[_0xeb1b('0x28')]);if(_0x13da15[_0xeb1b('0x29')]){delete _0x13da15[_0xeb1b('0x29')];}_0x3c0dc3[_0xeb1b('0x19')](_0x1f9381)[_0xeb1b('0x2a')](_0x13da15);};}exports['index']=function(_0x1da5f4,_0x12eb73){var _0x3a584d={},_0x2273ae={},_0x1a6135={'count':0x0,'rows':[]};var _0x89c420=_[_0xeb1b('0x2b')](db[_0xeb1b('0x2c')]['rawAttributes'],function(_0x1c0551){return{'name':_0x1c0551[_0xeb1b('0x2d')],'type':_0x1c0551[_0xeb1b('0x2e')]['key']};});_0x2273ae[_0xeb1b('0x2f')]=_[_0xeb1b('0x2b')](_0x89c420,_0xeb1b('0x29'));_0x2273ae[_0xeb1b('0x30')]=_['keys'](_0x1da5f4[_0xeb1b('0x30')]);_0x2273ae['filters']=_[_0xeb1b('0x31')](_0x2273ae[_0xeb1b('0x2f')],_0x2273ae[_0xeb1b('0x30')]);_0x3a584d[_0xeb1b('0x32')]=_[_0xeb1b('0x31')](_0x2273ae[_0xeb1b('0x2f')],qs['fields'](_0x1da5f4[_0xeb1b('0x30')][_0xeb1b('0x33')]));_0x3a584d['attributes']=_0x3a584d[_0xeb1b('0x32')][_0xeb1b('0x34')]?_0x3a584d['attributes']:_0x2273ae[_0xeb1b('0x2f')];if(!_0x1da5f4[_0xeb1b('0x30')][_0xeb1b('0x35')](_0xeb1b('0x36'))){_0x3a584d[_0xeb1b('0x1d')]=qs[_0xeb1b('0x1d')](_0x1da5f4[_0xeb1b('0x30')][_0xeb1b('0x1d')]);_0x3a584d['offset']=qs['offset'](_0x1da5f4[_0xeb1b('0x30')]['offset']);}_0x3a584d[_0xeb1b('0x37')]=qs[_0xeb1b('0x38')](_0x1da5f4['query'][_0xeb1b('0x38')]);_0x3a584d[_0xeb1b('0x39')]=qs[_0xeb1b('0x3a')](_[_0xeb1b('0x3b')](_0x1da5f4[_0xeb1b('0x30')],_0x2273ae[_0xeb1b('0x3a')]),_0x89c420);if(_0x1da5f4[_0xeb1b('0x30')][_0xeb1b('0x3c')]){_0x3a584d['where']=_[_0xeb1b('0x3d')](_0x3a584d[_0xeb1b('0x39')],{'$or':_[_0xeb1b('0x2b')](_0x89c420,function(_0x157a13){if(_0x157a13[_0xeb1b('0x2e')]!==_0xeb1b('0x3e')){var _0x2c49bc={};_0x2c49bc[_0x157a13[_0xeb1b('0x29')]]={'$like':'%'+_0x1da5f4['query'][_0xeb1b('0x3c')]+'%'};return _0x2c49bc;}})});}_0x3a584d=_['merge']({},_0x3a584d,_0x1da5f4[_0xeb1b('0x3f')]);var _0x30b8c8={'where':_0x3a584d['where']};return db[_0xeb1b('0x2c')]['count'](_0x30b8c8)['then'](function(_0x1a4dad){_0x1a6135[_0xeb1b('0x1f')]=_0x1a4dad;if(_0x1da5f4[_0xeb1b('0x30')]['includeAll']){_0x3a584d[_0xeb1b('0x40')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x3a584d);})['then'](function(_0x5a55e2){_0x1a6135[_0xeb1b('0x41')]=_0x5a55e2;return _0x1a6135;})[_0xeb1b('0x25')](respondWithFilteredResult(_0x12eb73,_0x3a584d))['catch'](handleError(_0x12eb73,null));};exports[_0xeb1b('0x42')]=function(_0xbe6809,_0x241ea8){var _0x386977={'raw':![],'where':{'id':_0xbe6809['params']['id']}},_0x41c514={};_0x41c514[_0xeb1b('0x2f')]=_[_0xeb1b('0x43')](db['UserProfile'][_0xeb1b('0x44')]);_0x41c514['query']=_['keys'](_0xbe6809[_0xeb1b('0x30')]);_0x41c514['filters']=_[_0xeb1b('0x31')](_0x41c514[_0xeb1b('0x2f')],_0x41c514[_0xeb1b('0x30')]);_0x386977[_0xeb1b('0x32')]=_[_0xeb1b('0x31')](_0x41c514[_0xeb1b('0x2f')],qs[_0xeb1b('0x33')](_0xbe6809[_0xeb1b('0x30')][_0xeb1b('0x33')]));_0x386977[_0xeb1b('0x32')]=_0x386977[_0xeb1b('0x32')][_0xeb1b('0x34')]?_0x386977['attributes']:_0x41c514[_0xeb1b('0x2f')];if(_0xbe6809[_0xeb1b('0x30')][_0xeb1b('0x45')]){_0x386977[_0xeb1b('0x40')]=[{'all':!![]}];}_0x386977=_[_0xeb1b('0x3d')]({},_0x386977,_0xbe6809['options']);return db[_0xeb1b('0x2c')]['find'](_0x386977)[_0xeb1b('0x25')](handleEntityNotFound(_0x241ea8,null))[_0xeb1b('0x25')](respondWithResult(_0x241ea8,null))[_0xeb1b('0x46')](handleError(_0x241ea8,null));};exports[_0xeb1b('0x47')]=function(_0x3546bf,_0x5a7c52){return db[_0xeb1b('0x2c')][_0xeb1b('0x47')](_0x3546bf[_0xeb1b('0x48')],{})[_0xeb1b('0x25')](respondWithResult(_0x5a7c52,0xc9))['catch'](handleError(_0x5a7c52,null));};exports[_0xeb1b('0x49')]=function(_0x51d79f,_0x4a00d1){var _0x32e787={'where':{'id':_0x51d79f[_0xeb1b('0x4a')]['id']}},_0x7f7ab4={};_0x7f7ab4[_0xeb1b('0x2f')]=_[_0xeb1b('0x43')](db['UserProfile']['rawAttributes']);_0x32e787[_0xeb1b('0x32')]=_[_0xeb1b('0x31')](_0x7f7ab4['model'],qs[_0xeb1b('0x33')](_0x51d79f['query'][_0xeb1b('0x33')]));_0x32e787['attributes']=_0x32e787[_0xeb1b('0x32')][_0xeb1b('0x34')]?_0x32e787['attributes']:_0x7f7ab4[_0xeb1b('0x2f')];if(_0x51d79f[_0xeb1b('0x30')][_0xeb1b('0x45')]){_0x32e787[_0xeb1b('0x40')]=[{'all':!![]}];}_0x32e787=_['merge']({},_0x32e787,_0x51d79f[_0xeb1b('0x3f')]);return db[_0xeb1b('0x2c')][_0xeb1b('0x4b')](_0x32e787)[_0xeb1b('0x25')](handleEntityNotFound(_0x4a00d1,null))['then'](function(_0x938c00){if(_0x938c00){var _0x1002ed=_0x938c00[_0xeb1b('0x4c')]({'plain':!![]});_0x1002ed=qs[_0xeb1b('0x4d')](_0x1002ed,['id',_0xeb1b('0x4e'),_0xeb1b('0x4f'),_0xeb1b('0x50')]);_0x51d79f[_0xeb1b('0x48')]=_[_0xeb1b('0x4d')](_0x51d79f[_0xeb1b('0x48')],['id',_0xeb1b('0x4e'),_0xeb1b('0x4f')]);return db[_0xeb1b('0x51')][_0xeb1b('0x52')](function(_0x1fca39){return db[_0xeb1b('0x2c')][_0xeb1b('0x47')](_[_0xeb1b('0x3d')](_0x1002ed,_0x51d79f[_0xeb1b('0x48')]),{'include':_0x51d79f['query'][_0xeb1b('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x1fca39})[_0xeb1b('0x25')](function(_0x365c11){var _0x237c4b=_0x365c11[_0xeb1b('0x4c')]({'plain':!![]});return db[_0xeb1b('0x53')][_0xeb1b('0x54')]({'where':{'userProfileId':_0x51d79f['params']['id']},'raw':!![]})[_0xeb1b('0x25')](function(_0xce8074){if(_0xce8074){return BPromise[_0xeb1b('0x55')](_0xce8074,function(_0x106f33){return new BPromise(function(_0x10aac0,_0x5cd6d5){if(_0x106f33[_0xeb1b('0x56')]===null||_0x106f33['autoAssociation']===0x1)_0x10aac0(null);return db['UserProfileResource'][_0xeb1b('0x54')]({'where':{'sectionId':_0x106f33['id']},'raw':!![]})[_0xeb1b('0x25')](function(_0x480fc9){var _0x102237=_[_0xeb1b('0x2b')](_0x480fc9,function(_0x1a654d){return qs[_0xeb1b('0x4d')](_0x1a654d,['id','createdAt','updatedAt',_0xeb1b('0x57')]);});_0x10aac0(_0x102237);})['catch'](function(_0x51fd0b){_0x5cd6d5(_0x51fd0b);});})[_0xeb1b('0x25')](function(_0x2e254e){var _0x9aa539=qs['omit'](_0x106f33,['id',_0xeb1b('0x4e'),_0xeb1b('0x4f')]);_0x9aa539[_0xeb1b('0x58')]=_0x237c4b['id'];if(_0x2e254e)_0x9aa539[_0xeb1b('0x59')]=_0x2e254e;return _0x9aa539;})[_0xeb1b('0x25')](function(_0x5dcdfe){return db['UserProfileSection'][_0xeb1b('0x47')](_0x5dcdfe,{'include':[{'model':db[_0xeb1b('0x5a')],'as':_0xeb1b('0x59')}],'raw':!![],'transaction':_0x1fca39});});})[_0xeb1b('0x25')](function(){return _0x237c4b;});}});});});}})[_0xeb1b('0x25')](respondWithResult(_0x4a00d1,0xc9))[_0xeb1b('0x46')](handleError(_0x4a00d1,null));};exports[_0xeb1b('0x23')]=function(_0x31954d,_0x23d548){if(_0x31954d[_0xeb1b('0x48')]['id']){delete _0x31954d[_0xeb1b('0x48')]['id'];}return db[_0xeb1b('0x2c')][_0xeb1b('0x4b')]({'where':{'id':_0x31954d[_0xeb1b('0x4a')]['id']}})[_0xeb1b('0x25')](handleEntityNotFound(_0x23d548,null))[_0xeb1b('0x25')](saveUpdates(_0x31954d[_0xeb1b('0x48')],null))[_0xeb1b('0x25')](respondWithResult(_0x23d548,null))[_0xeb1b('0x46')](handleError(_0x23d548,null));};exports[_0xeb1b('0x24')]=function(_0x1167a9,_0x3f71bd){return db['UserProfile'][_0xeb1b('0x4b')]({'where':{'id':_0x1167a9[_0xeb1b('0x4a')]['id']}})[_0xeb1b('0x25')](handleEntityNotFound(_0x3f71bd,null))[_0xeb1b('0x25')](removeEntity(_0x3f71bd,null))['catch'](handleError(_0x3f71bd,null));};exports[_0xeb1b('0x5b')]=function(_0x3df1b0,_0x1147f1){return db['UserProfile'][_0xeb1b('0x5b')]()['then'](respondWithResult(_0x1147f1,null))[_0xeb1b('0x46')](handleError(_0x1147f1,null));};exports[_0xeb1b('0x5c')]=function(_0x49b507,_0x567288){var _0xd80a1d=_0x49b507[_0xeb1b('0x48')];return db['UserProfile'][_0xeb1b('0x4b')]({'where':{'id':_0x49b507[_0xeb1b('0x4a')]['id']}})[_0xeb1b('0x25')](handleEntityNotFound(_0x567288,null))[_0xeb1b('0x25')](function(_0x27a723){if(_0x27a723){return db[_0xeb1b('0x51')][_0xeb1b('0x52')](function(_0x5e28d0){return db['UserProfileSection'][_0xeb1b('0x24')]({'where':{'userProfileId':_0x49b507[_0xeb1b('0x4a')]['id'],'sectionId':_[_0xeb1b('0x2b')](_0xd80a1d,function(_0x5af4d7){return _0x5af4d7['sectionId'];})},'transaction':_0x5e28d0})['then'](function(){var _0x6b8e81=_[_0xeb1b('0x2b')](_0xd80a1d,function(_0x13459c){_0x13459c[_0xeb1b('0x58')]=_0x49b507[_0xeb1b('0x4a')]['id'];return _0x13459c;});var _0x5365bf=[];return BPromise['each'](_0x6b8e81,function(_0x29a528){return db[_0xeb1b('0x53')][_0xeb1b('0x47')](_0x29a528,{'include':[{'model':db['UserProfileResource'],'as':_0xeb1b('0x59')}],'raw':!![],'transaction':_0x5e28d0})['then'](function(_0x13cf25){_0x5365bf[_0xeb1b('0x5d')](_0x13cf25[_0xeb1b('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x5365bf;});});});}})['then'](function(_0x5262fa){return _0x5262fa;})[_0xeb1b('0x25')](respondWithResult(_0x567288,null))['catch'](handleError(_0x567288,null));};exports[_0xeb1b('0x5e')]=function(_0x354700,_0x3efd0b){var _0x3308b6;return db['UserProfile']['find']({'where':{'id':_0x354700[_0xeb1b('0x4a')]['id']},'attributes':['id','name']})[_0xeb1b('0x25')](handleEntityNotFound(_0x3efd0b,null))[_0xeb1b('0x25')](function(_0x95ed9c){if(_0x95ed9c){_0x3308b6=_0x95ed9c;return db[_0xeb1b('0x53')]['destroy']({'where':{'userProfileId':_0x354700[_0xeb1b('0x4a')]['id'],'sectionId':_0x354700[_0xeb1b('0x30')][_0xeb1b('0x5f')]}});}})[_0xeb1b('0x25')](function(){return _0x3308b6;})['then'](respondWithStatusCode(_0x3efd0b,null))[_0xeb1b('0x46')](handleError(_0x3efd0b,null));};exports[_0xeb1b('0x60')]=function(_0x37a093,_0x430143){var _0x529a9e=[];var _0x3ac8a4=[];return db[_0xeb1b('0x53')]['findAll']({'where':{'userProfileId':_0x37a093[_0xeb1b('0x4a')]['id']},'raw':!![]})[_0xeb1b('0x25')](function(_0x381fdf){_0x529a9e=_[_0xeb1b('0x3c')](_0x381fdf,function(_0x20d432){return _0x20d432[_0xeb1b('0x61')]===0x1||_[_0xeb1b('0x62')]([0x3eb,0x709],_0x20d432['sectionId']);});if(!_[_0xeb1b('0x63')](_0x529a9e)){return _[_0xeb1b('0x2b')](_0x529a9e,function(_0x43069b){return _0x43069b[_0xeb1b('0x57')];});}else{return;}})['then'](function(_0x24a797){if(_0x24a797)_0x3ac8a4=_0x24a797;if(_[_0xeb1b('0x62')](_0x3ac8a4,0x64)){var _0xb63cd2=_[_0xeb1b('0x4b')](_0x529a9e,{'sectionId':0x64});return hasDefaultDashboard(_0xb63cd2)[_0xeb1b('0x25')](function(_0x38b777){return _[_0xeb1b('0x2b')](_0x529a9e,function(_0x3d19a2){if(_0x3d19a2[_0xeb1b('0x57')]===0x64){_0x3d19a2[_0xeb1b('0x64')]=_0x38b777;}return _0x3d19a2;});});}else{return;}})[_0xeb1b('0x25')](function(_0x22292a){if(_0x22292a)_0x529a9e=_0x22292a;if(_[_0xeb1b('0x62')](_0x3ac8a4,0x3eb)){var _0x3461d1=_[_0xeb1b('0x4b')](_0x529a9e,{'sectionId':0x3eb});return getCustomDashboards(_0x3461d1)[_0xeb1b('0x25')](function(_0x21952e){return _[_0xeb1b('0x2b')](_0x529a9e,function(_0x5f3bb8){if(_0x3461d1[_0xeb1b('0x61')]){if(_0x5f3bb8[_0xeb1b('0x57')]===0x3eb){_0x5f3bb8[_0xeb1b('0x64')]=_0x21952e;}}else{if(_0x5f3bb8[_0xeb1b('0x57')]===0x64){if(!_0x5f3bb8[_0xeb1b('0x64')]){_0x5f3bb8[_0xeb1b('0x64')]=[];}_0x5f3bb8['subsections']=_0x5f3bb8[_0xeb1b('0x64')][_0xeb1b('0x65')](_0x21952e);}}return _0x5f3bb8;});});}else{return;}})['then'](function(_0x55e636){if(_0x55e636)_0x529a9e=_0x55e636;if(_[_0xeb1b('0x62')](_0x3ac8a4,0x709)){var _0x5217af=_[_0xeb1b('0x4b')](_0x529a9e,{'sectionId':0x709});return getPlugins(_0x5217af)['then'](function(_0x22bbf0){if(_0x5217af['enabled']){return _[_0xeb1b('0x2b')](_0x529a9e,function(_0x40214a){if(_0x40214a[_0xeb1b('0x57')]===0x709){_0x40214a[_0xeb1b('0x64')]=_0x22bbf0;}return _0x40214a;});}else{var _0x4c6321={'sectionId':0x76c,'enabled':0x1,'subsections':_0x22bbf0};var _0x1d7e01=_[_0xeb1b('0x2b')](_0x529a9e);_0x1d7e01['push'](_0x4c6321);return _0x1d7e01;}});}else{return;}})['then'](function(_0x3b50f8){if(_0x3b50f8)_0x529a9e=_0x3b50f8;return _[_0xeb1b('0x3c')](_0x529a9e,[_0xeb1b('0x61'),0x1]);})['then'](respondWithResult(_0x430143,null))[_0xeb1b('0x46')](handleError(_0x430143,null));};function hasDefaultDashboard(_0x45e19c){var _0x5beaaa=[0x65];return new BPromise(function(_0x27d1f3,_0x4104e2){try{if(_0x45e19c[_0xeb1b('0x56')]){_0x27d1f3(_0x5beaaa);}else{return db[_0xeb1b('0x5a')][_0xeb1b('0x66')]({'where':{'sectionId':_0x45e19c['id']},'raw':!![]})['then'](function(_0x3e57bf){_0x3e57bf?_0x27d1f3(_0x5beaaa):_0x27d1f3();});}}catch(_0x17c773){_0x4104e2(_0x17c773);}});}function getCustomDashboards(_0x57b459){var _0x3af01d=[];return new BPromise(function(_0x5c88df,_0x39825c){try{if(_0x57b459[_0xeb1b('0x56')]){return db[_0xeb1b('0x67')][_0xeb1b('0x54')]({'raw':!![]})[_0xeb1b('0x25')](function(_0x327cde){_0x327cde[_0xeb1b('0x68')](function(_0x4ce3f3){_0x3af01d[_0xeb1b('0x5d')](_0x4ce3f3['id']+0x1869f);});_0x5c88df(_0x3af01d);});}else{return db['UserProfileResource'][_0xeb1b('0x54')]({'where':{'sectionId':_0x57b459['id']},'raw':!![]})[_0xeb1b('0x25')](function(_0x37b5ce){_0x37b5ce[_0xeb1b('0x68')](function(_0x366413){_0x3af01d[_0xeb1b('0x5d')](_0x366413[_0xeb1b('0x69')]+0x1869f);});_0x5c88df(_0x3af01d);});}}catch(_0x6c375){_0x39825c(_0x6c375);}});}function getPlugins(_0x339bdd){var _0x1f3303=[];return new BPromise(function(_0x97855f,_0x59eeae){try{if(_0x339bdd[_0xeb1b('0x56')]){return db[_0xeb1b('0x6a')][_0xeb1b('0x54')]({'raw':!![]})[_0xeb1b('0x25')](function(_0x53f6c9){_0x53f6c9[_0xeb1b('0x68')](function(_0x5c6012){_0x1f3303[_0xeb1b('0x5d')](_0x5c6012['id']+0x15b38);});_0x97855f(_0x1f3303);});}else{return db['UserProfileResource'][_0xeb1b('0x54')]({'where':{'sectionId':_0x339bdd['id']},'raw':!![]})[_0xeb1b('0x25')](function(_0x2d5e4f){_0x2d5e4f[_0xeb1b('0x68')](function(_0x4d2ca8){_0x1f3303['push'](_0x4d2ca8[_0xeb1b('0x69')]+0x15b38);});_0x97855f(_0x1f3303);});}}catch(_0x2907c8){_0x59eeae(_0x2907c8);}});}exports[_0xeb1b('0x6b')]=function(_0x4f0f08,_0x68d533){return db[_0xeb1b('0x2c')][_0xeb1b('0x4b')]({'where':{'id':_0x4f0f08[_0xeb1b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x68d533,null))[_0xeb1b('0x25')](function(_0x3cadb2){if(_0x3cadb2){return db[_0xeb1b('0x51')][_0xeb1b('0x52')](function(_0x1097f2){return db[_0xeb1b('0x53')][_0xeb1b('0x54')]({'where':{'userProfileId':_0x4f0f08[_0xeb1b('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xeb1b('0x25')](function(_0x1c77a7){if(_0x1c77a7){return db['UserProfileSection'][_0xeb1b('0x24')]({'where':{'userProfileId':_0x4f0f08[_0xeb1b('0x4a')]['id'],'id':_[_0xeb1b('0x2b')](_0x1c77a7,function(_0x411b04){return _0x411b04['id'];})},'transaction':_0x1097f2});}})[_0xeb1b('0x25')](function(_0x2636d2){var _0x59ae0e=_['map'](_0x4f0f08[_0xeb1b('0x48')],function(_0x289f95){_0x289f95[_0xeb1b('0x58')]=_0x4f0f08[_0xeb1b('0x4a')]['id'];return _0x289f95;});return db['UserProfileSection'][_0xeb1b('0x6c')](_0x59ae0e,{'raw':!![],'transaction':_0x1097f2});})[_0xeb1b('0x25')](function(_0x348eef){var _0x55370e=_[_0xeb1b('0x3c')](_[_0xeb1b('0x2b')](_0x348eef,function(_0x3b4d0e){return _0x3b4d0e['get']({'plain':!![]});}),{'includeAll':![]});if(_0x55370e){return db[_0xeb1b('0x53')][_0xeb1b('0x54')]({'where':{'userProfileId':_0x4f0f08[_0xeb1b('0x4a')]['id'],'sectionId':_[_0xeb1b('0x2b')](_0x55370e,function(_0x361cfb){return _0x361cfb['sectionId'];})},'attributes':['id',_0xeb1b('0x57')],'raw':!![]})[_0xeb1b('0x25')](function(_0x2eba8c){var _0x22e143=_[_0xeb1b('0x2b')](_0x4f0f08[_0xeb1b('0x48')],function(_0x2a6c19){_0x2a6c19[_0xeb1b('0x58')]=_0x4f0f08[_0xeb1b('0x4a')]['id'];return _0x2a6c19;});return db[_0xeb1b('0x5a')][_0xeb1b('0x6c')](_0x22e143,{'raw':!![],'transaction':_0x1097f2});});}})[_0xeb1b('0x46')](handleError(_0x68d533,null));});}})['then'](function(_0x475f03){var _0x44de3d=_[_0xeb1b('0x2b')](_0x475f03,function(_0x2a3ec1){return _0x2a3ec1[_0xeb1b('0x4c')]({'plain':!![]});});})['then'](respondWithResult(_0x68d533,null))[_0xeb1b('0x46')](handleError(_0x68d533,null));};exports['removeResources']=function(_0x474fdc,_0x3219f6,_0x384038){return db[_0xeb1b('0x2c')][_0xeb1b('0x4b')]({'where':{'id':_0x474fdc[_0xeb1b('0x4a')]['id']}})[_0xeb1b('0x25')](handleEntityNotFound(_0x3219f6,null))[_0xeb1b('0x25')](function(_0x1dcb14){if(_0x1dcb14){return _0x1dcb14[_0xeb1b('0x6d')](_0x474fdc[_0xeb1b('0x30')][_0xeb1b('0x5f')]);}})[_0xeb1b('0x25')](respondWithStatusCode(_0x3219f6,null))[_0xeb1b('0x46')](handleError(_0x3219f6,null));};exports[_0xeb1b('0x6e')]=function(_0xc51b58,_0x26f376){var _0x282910={};if(!_0xc51b58[_0xeb1b('0x30')][_0xeb1b('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0xc51b58[_0xeb1b('0x30')][_0xeb1b('0x35')](_0xeb1b('0x36'))){_0x282910['limit']=qs[_0xeb1b('0x1d')](_0xc51b58[_0xeb1b('0x30')][_0xeb1b('0x1d')]);_0x282910[_0xeb1b('0x1e')]=qs[_0xeb1b('0x1e')](_0xc51b58[_0xeb1b('0x30')][_0xeb1b('0x1e')]);}return db[_0xeb1b('0x2c')][_0xeb1b('0x4b')]({'where':{'id':_0xc51b58['params']['id']}})['then'](function(_0x20403d){if(!_0x20403d)throw new Error(_0xeb1b('0x70')+_0xc51b58[_0xeb1b('0x4a')]['id']);return db[_0xeb1b('0x2c')][_0xeb1b('0x6e')](_0xc51b58);})['then'](respondWithFilteredResult(_0x26f376,_0x282910))[_0xeb1b('0x46')](handleError(_0x26f376,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index fc5910d..734441d 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 _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x2040dd,_0x156a63){var _0x27688f=function(_0xb90c80){while(--_0xb90c80){_0x2040dd['push'](_0x2040dd['shift']());}};_0x27688f(++_0x156a63);}(_0x2ef3,0xba));var _0x32ef=function(_0x3279ee,_0x173d3b){_0x3279ee=_0x3279ee-0x0;var _0x4dcd29=_0x2ef3[_0x3279ee];return _0x4dcd29;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var UserProfile=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){UserProfileEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);UserProfileEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x3837=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0x3837,0x1d1));var _0x7383=function(_0x266add,_0x50e6a8){_0x266add=_0x266add-0x0;var _0x3d531b=_0x3837[_0x266add];return _0x3d531b;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7383('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7383('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7383('0x2'),'afterDestroy':_0x7383('0x3')};function emitEvent(_0x49878d){return function(_0x227ab2,_0xf57468,_0x53485d){UserProfileEvents['emit'](_0x49878d+':'+_0x227ab2['id'],_0x227ab2);UserProfileEvents[_0x7383('0x4')](_0x49878d,_0x227ab2);_0x53485d(null);};}for(var e in events){if(events[_0x7383('0x5')](e)){var event=events[e];UserProfile[_0x7383('0x6')](e,emitEvent(event));}}module[_0x7383('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index f87038b..d2c3413 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 _0xb7fa=['musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','scheduler','sounds','Sound','tags','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','length','push','params','ignore','find','autoAssociation','all','keys','attributes','hasOwnProperty','nolimit','limit','offset','order','filters','pick','merge','key','VIRTUAL','foreignKey','forEach','isEmpty','options','include','DefaultReports','custom','CustomReports','count','rows','intersection','ids','customSorting','extraQueryConditions','includeAll','CmContact','Tag','color','ThroughTags','tag','true','chat','dataValues','sms','fax','mail','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','catch','model','then','map','UserProfileResource','AnalyticExtractedReport','type','associatedResources','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','name','projectName','projects','JscriptyProject','contacts','parentSections','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound'];(function(_0x3858cf,_0xb76175){var _0x31300c=function(_0x47f875){while(--_0x47f875){_0x3858cf['push'](_0x3858cf['shift']());}};_0x31300c(++_0xb76175);}(_0xb7fa,0x7f));var _0xab7f=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xb7fa[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0xab7f('0x0'));var attributes=require(_0xab7f('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xab7f('0x2'));module[_0xab7f('0x3')]=function(_0x154b1c){var _0x8800a3=_0x154b1c[_0xab7f('0x4')];function _0x4f8573(_0x12ecca,_0x4ec797){return new Promise(function(_0x19ab4a,_0x11fde7){if(!_0x4ec797)return _0x19ab4a(null);var _0x21457b=_0x4ec797[_0xab7f('0x5')]?{[_0x4ec797[_0xab7f('0x5')][_0xab7f('0x6')]]:_0x4ec797[_0xab7f('0x5')][_0xab7f('0x7')]}:undefined;return _0x8800a3[_0x12ecca][_0xab7f('0x8')]({'where':_0x21457b,'raw':!![]})['then'](function(_0x441d57){_0x4ec797['associatedResources']=_['map'](_0x441d57,'id');_0x19ab4a(_0x4ec797);})[_0xab7f('0x9')](function(_0x326c2f){_0x11fde7(_0x326c2f);});});}function _0x2514cf(_0xbcb469,_0x414e47){return new Promise(function(_0x5f49f2,_0x46e18c){var _0x2b74b5=_0xbcb469['filter']?{[_0xbcb469[_0xab7f('0x5')][_0xab7f('0x6')]]:_0xbcb469[_0xab7f('0x5')][_0xab7f('0x7')]}:undefined;return _0x8800a3[_0xbcb469[_0xab7f('0xa')]][_0xab7f('0x8')]({'where':_0x2b74b5,'raw':!![]})[_0xab7f('0xb')](function(_0x1f96eb){_0x414e47['associatedResources']=_[_0xab7f('0xc')](_0x1f96eb,function(_0x34a0d3){return _0x34a0d3['name'];});_0x5f49f2(_0x414e47);})[_0xab7f('0x9')](function(_0x2596aa){_0x46e18c(_0x2596aa);});});}function _0x526b32(_0x62fbf0,_0x22107b,_0x18014f){if(!_0x22107b)return Promise['resolve'](null);return new Promise(function(_0x306a97,_0x2b9acf){return _0x8800a3[_0xab7f('0xd')][_0xab7f('0x8')]({'where':{'sectionId':_0x22107b['id']},'raw':!![]})[_0xab7f('0xb')](function(_0x4adfc2){if(_0x62fbf0[_0xab7f('0x6')]&&_0x62fbf0[_0xab7f('0x6')]!=='id'){_0x22107b['associatedResources']=_[_0xab7f('0xc')](_0x4adfc2,function(_0x26b0d3){return _0x26b0d3[_0x62fbf0[_0xab7f('0x6')]];});}else{if(_0x18014f===_0xab7f('0xe')){_0x22107b['associatedResources']=_[_0xab7f('0xc')](_0x4adfc2,function(_0x52f41f){return{'id':_0x52f41f['resourceId'],'type':_0x52f41f[_0xab7f('0xf')]};});}else{_0x22107b[_0xab7f('0x10')]=_[_0xab7f('0xc')](_0x4adfc2,function(_0x3a423b){return _0x3a423b['resourceId'];});}}_0x306a97(_0x22107b);})['catch'](function(_0x1c5e4d){_0x2b9acf(_0x1c5e4d);});});}function _0x1bc3d2(_0x3bb729,_0x3d185b){var _0x2e0065={'parentSections':[]};switch(_0x3bb729[_0xab7f('0x11')]()){case _0xab7f('0x12'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x14');break;case _0xab7f('0x15'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x16');break;case _0xab7f('0x17'):_0x2e0065[_0xab7f('0x13')]='SquareRecording';_0x2e0065['parentSections']=[{'name':'SquareProjects','field':_0xab7f('0x18'),'foreignKey':_0xab7f('0x19')}];break;case _0xab7f('0x1a'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x1b');break;case _0xab7f('0x1c'):_0x2e0065[_0xab7f('0x13')]='CmContact';_0x2e0065[_0xab7f('0x1d')]=[{'name':_0xab7f('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0xab7f('0x1f'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x20');break;case _0xab7f('0x21'):_0x2e0065['childModel']=_0xab7f('0x22');break;case _0xab7f('0x23'):_0x2e0065['childModel']=_0xab7f('0x24');break;case'chatqueues':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x25');break;case'chatwebsites':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x26');break;case _0xab7f('0x27'):_0x2e0065['childModel']=_0xab7f('0x28');break;case _0xab7f('0x29'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x2a');break;case _0xab7f('0x2b'):case _0xab7f('0x2c'):case _0xab7f('0x2d'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x2e');break;case'contexts':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x2f');break;case _0xab7f('0x30'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x31');break;case _0xab7f('0x32'):_0x2e0065['childModel']=_0xab7f('0x33');_0x2e0065[_0xab7f('0x1d')]=[{'name':_0xab7f('0x34'),'field':_0xab7f('0x18'),'foreignKey':_0xab7f('0x35'),'model':_0xab7f('0x36'),'filter':{'field':_0xab7f('0x37'),'value':[_0xab7f('0x38')]}},{'name':_0xab7f('0x39'),'field':'name','foreignKey':_0xab7f('0x35'),'model':_0xab7f('0x36'),'filter':{'field':'role','value':['telephone']}},{'name':_0xab7f('0x3a'),'field':_0xab7f('0x18'),'foreignKey':_0xab7f('0x3b'),'model':'VoiceQueue','filter':{'field':_0xab7f('0xf'),'value':['inbound']}},{'name':_0xab7f('0x3c'),'field':_0xab7f('0x18'),'foreignKey':'queue','model':_0xab7f('0x3d'),'filter':{'field':_0xab7f('0xf'),'value':[_0xab7f('0x3e')]}}];break;case _0xab7f('0x3f'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x40');break;case _0xab7f('0x41'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x42');break;case _0xab7f('0x43'):_0x2e0065[_0xab7f('0x13')]='VoicePrefix';break;case'ivrcampaigns':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x44');break;case'mailqueues':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x45');break;case _0xab7f('0x46'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x47');break;case _0xab7f('0x48'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x49');break;case _0xab7f('0x4a'):_0x2e0065['childModel']=_0xab7f('0x4b');break;case _0xab7f('0x4c'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x4d');break;case'smsqueues':_0x2e0065['childModel']='SmsQueue';break;case _0xab7f('0x4e'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x4f');break;case _0xab7f('0x50'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x51');break;case _0xab7f('0x52'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x53');break;case _0xab7f('0x54'):_0x2e0065[_0xab7f('0x13')]='Team';break;case _0xab7f('0x55'):case _0xab7f('0x56'):_0x2e0065['childModel']=_0xab7f('0x3d');if(_0x3d185b){_0x2e0065[_0xab7f('0x1d')]=[{'name':_0xab7f('0x3a')},{'name':'QueueCampaigns'}];}break;case _0xab7f('0x57'):case _0xab7f('0x58'):case'telephones':_0x2e0065[_0xab7f('0x13')]='User';if(_0x3d185b){_0x2e0065[_0xab7f('0x1d')]=[{'name':'Users','filter':{'field':_0xab7f('0x37'),'value':[_0xab7f('0x59'),_0xab7f('0x5a')]},'ignore':!![]},{'name':_0xab7f('0x34')},{'name':_0xab7f('0x39')}];}break;case _0xab7f('0x5b'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x5c');break;case _0xab7f('0x5d'):_0x2e0065[_0xab7f('0x13')]='SalesforceAccount';break;case _0xab7f('0x5e'):_0x2e0065[_0xab7f('0x13')]='FreshdeskAccount';break;case _0xab7f('0x5f'):_0x2e0065[_0xab7f('0x13')]='SugarcrmAccount';break;case _0xab7f('0x60'):_0x2e0065['childModel']=_0xab7f('0x61');break;case _0xab7f('0x62'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x63');break;case _0xab7f('0x64'):_0x2e0065['childModel']=_0xab7f('0x36');break;case _0xab7f('0x65'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x66');break;case _0xab7f('0x67'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x68');break;case _0xab7f('0x69'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x6a');break;case'intervals':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x6b');break;case _0xab7f('0x6c'):_0x2e0065['childModel']='Pause';break;case _0xab7f('0x6d'):_0x2e0065[_0xab7f('0x13')]='Schedule';break;case _0xab7f('0x6e'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x6f');break;case _0xab7f('0x70'):_0x2e0065['childModel']='Tag';break;case'templates':_0x2e0065[_0xab7f('0x13')]='Template';break;case'triggers':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x71');break;case _0xab7f('0x72'):_0x2e0065['childModel']=_0xab7f('0x73');break;case _0xab7f('0x74'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x75');break;case _0xab7f('0x76'):_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x77');break;case'extractedreports':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0xe');_0x2e0065[_0xab7f('0x1d')]=[{'name':_0xab7f('0x78'),'field':'id','foreignKey':_0xab7f('0x79')}];break;case'metrics':_0x2e0065[_0xab7f('0x13')]=_0xab7f('0x7a');break;}return _0x2e0065;}function _0x1a5778(_0xade7d7,_0xb16d00){var _0x44069e=_0xade7d7['charAt'](0x0)[_0xab7f('0x7b')]()+_0xade7d7[_0xab7f('0x7c')](0x1);var _0x8dea7f={'type':_0x8800a3[_0xab7f('0x7d')][_0xab7f('0x7e')][_0xab7f('0x7f')],'raw':!![]};return new Promise(function(_0x5a5de8,_0x57043a){var _0x455080=squel['select']()['field'](_0xab7f('0x80')+_0x44069e+_0xab7f('0x81'),'id')[_0xab7f('0x6')](_0xab7f('0x82'))['from'](_0xab7f('0x83')+_0xade7d7+_0xab7f('0x84'),'ui')[_0xab7f('0x85')](_0xab7f('0x86'),_0xb16d00['id']);return _0x8800a3[_0xab7f('0x87')][_0xab7f('0x88')](_0x455080[_0xab7f('0x89')](),_0x8dea7f)[_0xab7f('0xb')](function(_0x28fa0c){_0xb16d00[_0x44069e+_0xab7f('0x8a')]=_0x28fa0c;_0x5a5de8(_0x28fa0c);})[_0xab7f('0x9')](function(_0x142dd2){_0x57043a(_0x142dd2);});});}return _0x154b1c[_0xab7f('0x8b')](_0xab7f('0x8c'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x41b50){var _0x5784fd={'raw':_0x41b50['query']['raw'],'where':{}};var _0xaa3bd0={};var _0x29f1a6={'count':0x0,'rows':[]};var _0xd431ed=_0x41b50[_0xab7f('0x88')][_0xab7f('0x8d')];var _0x5e4f82=_0x41b50[_0xab7f('0x88')][_0xab7f('0x8e')]||![];var _0x294822=_0x1bc3d2(_0xd431ed,_0x5e4f82);if(!_0x294822[_0xab7f('0x13')])throw new Error(_0xab7f('0x8f')+_0xd431ed+'\x27');var _0x1b3e99=[{'name':_0xd431ed}];if(!_['isEmpty'](_0x294822[_0xab7f('0x1d')]))_0x1b3e99=_0x294822[_0xab7f('0x1d')];var _0x500e1e=[];for(var _0x44180c=0x0;_0x44180c<_0x1b3e99[_0xab7f('0x90')];_0x44180c++){_0x500e1e[_0xab7f('0x91')](_0x8800a3['UserProfileSection']['find']({'where':{'userProfileId':_0x41b50[_0xab7f('0x92')]['id'],'name':_0x1b3e99[_0x44180c][_0xab7f('0x18')]},'raw':!![]}));}return Promise['all'](_0x500e1e)['then'](function(_0x15f334){var _0x5c75e4=_[_0xab7f('0x5')](_0x15f334,function(_0x3e4fa3){return _0x3e4fa3?_0x3e4fa3:undefined;});var _0x40c3ab=_[_0xab7f('0x5')](_0x1b3e99,[_0xab7f('0x93'),!![]]);var _0x5176b8=_['isEmpty'](_0x5c75e4)&&_['isEmpty'](_0x40c3ab)?null:_['union'](_0x40c3ab,_0x5c75e4);if(!_0x5176b8)return null;var _0x144046=[];for(var _0x276ae7=0x0;_0x276ae7<_0x5176b8[_0xab7f('0x90')];_0x276ae7++){var _0x369107=_[_0xab7f('0x94')](_0x1b3e99,function(_0x23c49d){return _0x5176b8[_0x276ae7]?_0x23c49d[_0xab7f('0x18')]===_0x5176b8[_0x276ae7][_0xab7f('0x18')]:null;});if(_0x369107){if(_0x5176b8[_0x276ae7][_0xab7f('0x93')]){_0x144046[_0xab7f('0x91')](_0x4f8573(_0x294822[_0xab7f('0x13')],_0x5176b8[_0x276ae7]));}else{if(!_0x5176b8[_0x276ae7][_0xab7f('0x95')]){_0x144046[_0xab7f('0x91')](_0x526b32(_0x369107,_0x5176b8[_0x276ae7],_0x294822[_0xab7f('0x13')]));}else{if(_0x369107[_0xab7f('0xa')]){_0x144046[_0xab7f('0x91')](_0x2514cf(_0x369107,_0x5176b8[_0x276ae7]));}}}}}return Promise[_0xab7f('0x96')](_0x144046);})[_0xab7f('0xb')](function(_0x36d394){var _0x31f18b=_0x36d394;var _0x243ce7=null;if(_0x31f18b){_0x243ce7=_0x31f18b[_0xab7f('0x90')]===0x1?_0x31f18b[0x0]:null;}if(!_0x243ce7&&!_0x31f18b)return _0x29f1a6;var _0x2bef3a=_0x8800a3[_0x294822[_0xab7f('0x13')]]['rawAttributes'];_0xaa3bd0[_0xab7f('0xa')]=_[_0xab7f('0x97')](_0x2bef3a);_0xaa3bd0['query']=_[_0xab7f('0x97')](_0x41b50[_0xab7f('0x88')]);_0xaa3bd0['filters']=_['intersection'](_0xaa3bd0[_0xab7f('0xa')],_0xaa3bd0[_0xab7f('0x88')]);_0x5784fd['attributes']=_['intersection'](_0xaa3bd0[_0xab7f('0xa')],qs['fields'](_0x41b50['query']['fields']));_0x5784fd['attributes']=_0x5784fd[_0xab7f('0x98')][_0xab7f('0x90')]?_0x5784fd[_0xab7f('0x98')]:_0xaa3bd0[_0xab7f('0xa')];if(!_0x41b50[_0xab7f('0x88')][_0xab7f('0x99')](_0xab7f('0x9a'))){_0x5784fd[_0xab7f('0x9b')]=qs['limit'](_0x41b50['query'][_0xab7f('0x9b')]);_0x5784fd['offset']=qs[_0xab7f('0x9c')](_0x41b50['query'][_0xab7f('0x9c')]);}_0x5784fd[_0xab7f('0x9d')]=qs['sort'](_0x41b50[_0xab7f('0x88')]['sort']);_0x5784fd[_0xab7f('0x85')]=qs[_0xab7f('0x9e')](_[_0xab7f('0x9f')](_0x41b50[_0xab7f('0x88')],_0xaa3bd0[_0xab7f('0x9e')]));if(_0x41b50[_0xab7f('0x88')][_0xab7f('0x5')]){_0x5784fd[_0xab7f('0x85')]=_[_0xab7f('0xa0')](_0x5784fd[_0xab7f('0x85')],{'$or':_[_0xab7f('0xc')](_0x2bef3a,function(_0x4bae1e){if(_0x4bae1e[_0xab7f('0xf')][_0xab7f('0xa1')]!==_0xab7f('0xa2')){var _0x55efa2={};_0x55efa2[_0x4bae1e[_0xab7f('0x6')]]={'$like':'%'+_0x41b50[_0xab7f('0x88')]['filter']+'%'};return _0x55efa2;}})});}var _0x296d9b=[];var _0x261135=null;var _0x4339f5={};if(_0x243ce7){_0x261135=_[_0xab7f('0x94')](_0x1b3e99,[_0xab7f('0x18'),_0x243ce7['name']]);if(_0x261135[_0xab7f('0x6')]){_0x4339f5={};if(_0x294822[_0xab7f('0x13')]===_0xab7f('0xe')){_0x4339f5[_0x261135['foreignKey']]=_[_0xab7f('0xc')](_0x243ce7[_0xab7f('0x10')],'id');}else{_0x4339f5[_0x261135[_0xab7f('0xa3')]]=_0x243ce7[_0xab7f('0x10')];}_0x296d9b[_0xab7f('0x91')](_0x4339f5);}else{_0x5784fd['where']['id']=_0x243ce7[_0xab7f('0x10')];}}else{for(var _0x4ead65=0x0;_0x4ead65<_0x31f18b['length'];_0x4ead65++){_0x261135=_[_0xab7f('0x94')](_0x1b3e99,[_0xab7f('0x18'),_0x31f18b[_0x4ead65][_0xab7f('0x18')]]);if(_0x261135[_0xab7f('0x6')]){_0x4339f5={};_0x4339f5[_0x261135[_0xab7f('0xa3')]]=_0x31f18b[_0x4ead65][_0xab7f('0x10')];_0x296d9b[_0xab7f('0x91')](_0x4339f5);}else{if(!_0x5784fd[_0xab7f('0x85')]['id'])_0x5784fd['where']['id']=[];_0x31f18b[_0x4ead65]['associatedResources'][_0xab7f('0xa4')](function(_0x26e7a8){_0x5784fd['where']['id'][_0xab7f('0x91')](_0x26e7a8);});}}}if(!_[_0xab7f('0xa5')](_0x296d9b)){_0x5784fd[_0xab7f('0x85')]=_[_0xab7f('0xa0')](_0x5784fd[_0xab7f('0x85')],{'$and':{'$or':_0x296d9b}});}_0x5784fd=_[_0xab7f('0xa0')]({},_0x5784fd,_0x41b50[_0xab7f('0xa6')]);if(_0x243ce7&&!_0x243ce7[_0xab7f('0x95')]&&_0x294822[_0xab7f('0x13')]===_0xab7f('0xe')){if(_0x41b50[_0xab7f('0x88')]['includeAll']){_0x5784fd[_0xab7f('0xa7')]=[{'all':!![]}];}return _0x8800a3[_0x294822[_0xab7f('0x13')]]['findAll'](_0x5784fd)[_0xab7f('0xb')](function(_0x29e104){var _0x32b328=[];_0x29e104['forEach'](function(_0x57c038){var _0x4ea779;switch(_0x57c038['reportType']){case'default':_0x4ea779=_['find'](_0x243ce7[_0xab7f('0x10')],function(_0x165a32){return _0x165a32['id']===_0x57c038[_0xab7f('0x79')]&&_0x165a32[_0xab7f('0xf')]===_0xab7f('0xa8');});break;case _0xab7f('0xa9'):_0x4ea779=_[_0xab7f('0x94')](_0x243ce7[_0xab7f('0x10')],function(_0x32fdba){return _0x32fdba['id']===_0x57c038[_0xab7f('0x79')]&&_0x32fdba[_0xab7f('0xf')]===_0xab7f('0xaa');});break;}if(_0x4ea779)_0x32b328[_0xab7f('0x91')](_0x57c038);});_0x29f1a6[_0xab7f('0xab')]=_0x32b328[_0xab7f('0x90')];_0x29f1a6[_0xab7f('0xac')]=_0x32b328;return _0x29f1a6;});}else{if(!_[_0xab7f('0xa5')](_0x41b50[_0xab7f('0x88')]['ids'])){_0x5784fd[_0xab7f('0x85')]['id']=_0x5784fd['where']['id']?_[_0xab7f('0xad')](_0x5784fd['where']['id'],_0x41b50['query'][_0xab7f('0xae')]):_0x41b50['query'][_0xab7f('0xae')];if(_0x41b50['query']['customSorting']){_0x5784fd[_0xab7f('0x9d')]=_0x41b50[_0xab7f('0x88')][_0xab7f('0xaf')];}}if(_0x41b50[_0xab7f('0x88')][_0xab7f('0xb0')]){_0x5784fd[_0xab7f('0x85')]=_['merge'](_0x5784fd[_0xab7f('0x85')],{'$and':_0x41b50[_0xab7f('0x88')][_0xab7f('0xb0')]});}return _0x8800a3[_0x294822[_0xab7f('0x13')]][_0xab7f('0xab')]({'where':_0x5784fd[_0xab7f('0x85')]})[_0xab7f('0xb')](function(_0x534765){_0x29f1a6[_0xab7f('0xab')]=_0x534765;if(_0x41b50['query'][_0xab7f('0xb1')]){if(_0x294822['childModel']===_0xab7f('0xb2')){_0x5784fd[_0xab7f('0xa7')]=[{'model':_0x8800a3[_0xab7f('0xb3')],'as':'Tags','attributes':['id','name',_0xab7f('0xb4')],'required':_0x41b50[_0xab7f('0x88')]['tag']?!![]:![]},{'model':_0x8800a3['Tag'],'as':_0xab7f('0xb5'),'attributes':['id',_0xab7f('0x18'),_0xab7f('0xb4')],'through':_0x41b50['query'][_0xab7f('0xb6')]?{'attributes':[],'where':{'TagId':_0x41b50[_0xab7f('0x88')][_0xab7f('0xb6')]||undefined}}:{},'required':_0x41b50[_0xab7f('0x88')][_0xab7f('0xb6')]?!![]:![]}];}else{_0x5784fd[_0xab7f('0xa7')]=[{'all':!![]}];}}return _0x8800a3[_0x294822[_0xab7f('0x13')]][_0xab7f('0x8')](_0x5784fd);})[_0xab7f('0xb')](function(_0xb8f6d4){_0x29f1a6['rows']=_0xb8f6d4;if(_0xd431ed===_0xab7f('0x34')&&_0x41b50[_0xab7f('0x88')]['openTabs']===_0xab7f('0xb7')){var _0x3fe1b4=[];for(var _0x2b22fe=0x0;_0x2b22fe<_0x29f1a6[_0xab7f('0xac')][_0xab7f('0x90')];_0x2b22fe++){_0x3fe1b4['push'](_0x1a5778(_0xab7f('0xb8'),_0x29f1a6[_0xab7f('0xac')][_0x2b22fe][_0xab7f('0xb9')]));_0x3fe1b4[_0xab7f('0x91')](_0x1a5778(_0xab7f('0xba'),_0x29f1a6[_0xab7f('0xac')][_0x2b22fe][_0xab7f('0xb9')]));_0x3fe1b4[_0xab7f('0x91')](_0x1a5778(_0xab7f('0xbb'),_0x29f1a6['rows'][_0x2b22fe][_0xab7f('0xb9')]));_0x3fe1b4[_0xab7f('0x91')](_0x1a5778(_0xab7f('0xbc'),_0x29f1a6['rows'][_0x2b22fe][_0xab7f('0xb9')]));_0x3fe1b4['push'](_0x1a5778('openchannel',_0x29f1a6[_0xab7f('0xac')][_0x2b22fe][_0xab7f('0xb9')]));_0x3fe1b4[_0xab7f('0x91')](_0x1a5778(_0xab7f('0xbd'),_0x29f1a6[_0xab7f('0xac')][_0x2b22fe]['dataValues']));}return Promise['all'](_0x3fe1b4)[_0xab7f('0xb')](function(){return _0x29f1a6;});}return _0x29f1a6;});}});}}});}; \ No newline at end of file +var _0x3932=['_interactions','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','all','ignore','union','push','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','reportType','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','include','Tags','color','tag','ThroughTags','openTabs','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','findAll','then','associatedResources','map','catch','value','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','odbc','childModel','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','teams','voicequeues','queuecampaigns','agents','Users','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','triggers','Trunk','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','InteractionId','ui.createdAt','from','user_has_'];(function(_0x42fb5f,_0x4ee895){var _0x2f3128=function(_0x342f6f){while(--_0x342f6f){_0x42fb5f['push'](_0x42fb5f['shift']());}};_0x2f3128(++_0x4ee895);}(_0x3932,0xf9));var _0x2393=function(_0x4f1179,_0x500455){_0x4f1179=_0x4f1179-0x0;var _0x27b7f8=_0x3932[_0x4f1179];return _0x27b7f8;};'use strict';var _=require(_0x2393('0x0'));var attributes=require(_0x2393('0x1'));var qs=require(_0x2393('0x2'));var squel=require(_0x2393('0x3'));module['exports']=function(_0x17350d){var _0x1691d3=_0x17350d[_0x2393('0x4')];function _0x175639(_0x4e73b0,_0x54bf06){return new Promise(function(_0x5b90a9,_0xf6f665){if(!_0x54bf06)return _0x5b90a9(null);var _0x3f2c53=_0x54bf06[_0x2393('0x5')]?{[_0x54bf06['filter'][_0x2393('0x6')]]:_0x54bf06[_0x2393('0x5')]['value']}:undefined;return _0x1691d3[_0x4e73b0][_0x2393('0x7')]({'where':_0x3f2c53,'raw':!![]})[_0x2393('0x8')](function(_0x21ff17){_0x54bf06[_0x2393('0x9')]=_[_0x2393('0xa')](_0x21ff17,'id');_0x5b90a9(_0x54bf06);})[_0x2393('0xb')](function(_0x2ccbb4){_0xf6f665(_0x2ccbb4);});});}function _0x425e92(_0x531bf6,_0x4fe041){return new Promise(function(_0x58e7f5,_0x190cd1){var _0x3d877=_0x531bf6[_0x2393('0x5')]?{[_0x531bf6[_0x2393('0x5')][_0x2393('0x6')]]:_0x531bf6['filter'][_0x2393('0xc')]}:undefined;return _0x1691d3[_0x531bf6[_0x2393('0xd')]][_0x2393('0x7')]({'where':_0x3d877,'raw':!![]})[_0x2393('0x8')](function(_0x145dd2){_0x4fe041[_0x2393('0x9')]=_[_0x2393('0xa')](_0x145dd2,function(_0x39df59){return _0x39df59[_0x2393('0xe')];});_0x58e7f5(_0x4fe041);})[_0x2393('0xb')](function(_0x4ad9cc){_0x190cd1(_0x4ad9cc);});});}function _0x52a0ff(_0x3feb9d,_0x3a22b5,_0x10137b){if(!_0x3a22b5)return Promise[_0x2393('0xf')](null);return new Promise(function(_0x274c8a,_0x528855){return _0x1691d3[_0x2393('0x10')][_0x2393('0x7')]({'where':{'sectionId':_0x3a22b5['id']},'raw':!![]})[_0x2393('0x8')](function(_0x2cb28c){if(_0x3feb9d['field']&&_0x3feb9d['field']!=='id'){_0x3a22b5[_0x2393('0x9')]=_[_0x2393('0xa')](_0x2cb28c,function(_0x57ed3d){return _0x57ed3d[_0x3feb9d['field']];});}else{if(_0x10137b===_0x2393('0x11')){_0x3a22b5['associatedResources']=_[_0x2393('0xa')](_0x2cb28c,function(_0x54e279){return{'id':_0x54e279[_0x2393('0x12')],'type':_0x54e279[_0x2393('0x13')]};});}else{_0x3a22b5['associatedResources']=_[_0x2393('0xa')](_0x2cb28c,function(_0x20cc5f){return _0x20cc5f['resourceId'];});}}_0x274c8a(_0x3a22b5);})['catch'](function(_0x5e102a){_0x528855(_0x5e102a);});});}function _0xf62e5a(_0x52689f,_0x661e56){var _0xe9833a={'parentSections':[]};switch(_0x52689f[_0x2393('0x14')]()){case _0x2393('0x15'):_0xe9833a['childModel']='SquareProject';break;case _0x2393('0x16'):_0xe9833a[_0x2393('0x17')]='SquareOdbc';break;case'squarerecordings':_0xe9833a['childModel']=_0x2393('0x18');_0xe9833a[_0x2393('0x19')]=[{'name':_0x2393('0x1a'),'field':_0x2393('0xe'),'foreignKey':_0x2393('0x1b')}];break;case _0x2393('0x1c'):_0xe9833a['childModel']='JscriptyProject';break;case _0x2393('0x1d'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x1e');_0xe9833a['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x2393('0x1f')}];break;case _0x2393('0x20'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x21');break;case _0x2393('0x22'):_0xe9833a['childModel']=_0x2393('0x23');break;case'globalcustomfields':_0xe9833a['childModel']=_0x2393('0x24');break;case _0x2393('0x25'):_0xe9833a[_0x2393('0x17')]='ChatQueue';break;case _0x2393('0x26'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x27');break;case _0x2393('0x28'):_0xe9833a['childModel']=_0x2393('0x29');break;case _0x2393('0x2a'):_0xe9833a[_0x2393('0x17')]='FaxAccount';break;case _0x2393('0x2b'):case _0x2393('0x2c'):case _0x2393('0x2d'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x2e');break;case _0x2393('0x2f'):_0xe9833a['childModel']=_0x2393('0x30');break;case _0x2393('0x31'):_0xe9833a['childModel']=_0x2393('0x32');break;case _0x2393('0x33'):_0xe9833a[_0x2393('0x17')]='VoiceRecording';_0xe9833a[_0x2393('0x19')]=[{'name':_0x2393('0x34'),'field':_0x2393('0xe'),'foreignKey':_0x2393('0x35'),'model':_0x2393('0x36'),'filter':{'field':_0x2393('0x37'),'value':['agent']}},{'name':'Telephones','field':_0x2393('0xe'),'foreignKey':_0x2393('0x35'),'model':_0x2393('0x36'),'filter':{'field':_0x2393('0x37'),'value':[_0x2393('0x38')]}},{'name':_0x2393('0x39'),'field':'name','foreignKey':_0x2393('0x3a'),'model':_0x2393('0x3b'),'filter':{'field':_0x2393('0x13'),'value':['inbound']}},{'name':_0x2393('0x3c'),'field':_0x2393('0xe'),'foreignKey':_0x2393('0x3a'),'model':_0x2393('0x3b'),'filter':{'field':_0x2393('0x13'),'value':[_0x2393('0x3d')]}}];break;case _0x2393('0x3e'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x3f');break;case _0x2393('0x40'):_0xe9833a[_0x2393('0x17')]='VoiceChanSpy';break;case _0x2393('0x41'):_0xe9833a['childModel']=_0x2393('0x42');break;case'ivrcampaigns':_0xe9833a[_0x2393('0x17')]=_0x2393('0x43');break;case _0x2393('0x44'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x45');break;case _0x2393('0x46'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x47');break;case _0x2393('0x48'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x49');break;case'openchannelqueues':_0xe9833a[_0x2393('0x17')]=_0x2393('0x4a');break;case _0x2393('0x4b'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x4c');break;case _0x2393('0x4d'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x4e');break;case'smsaccounts':_0xe9833a[_0x2393('0x17')]=_0x2393('0x4f');break;case _0x2393('0x50'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x51');break;case'whatsappaccounts':_0xe9833a[_0x2393('0x17')]='WhatsappAccount';break;case _0x2393('0x52'):_0xe9833a[_0x2393('0x17')]='Team';break;case _0x2393('0x53'):case _0x2393('0x54'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x3b');if(_0x661e56){_0xe9833a['parentSections']=[{'name':'VoiceQueues'},{'name':_0x2393('0x3c')}];}break;case'users':case _0x2393('0x55'):case'telephones':_0xe9833a['childModel']=_0x2393('0x36');if(_0x661e56){_0xe9833a[_0x2393('0x19')]=[{'name':_0x2393('0x56'),'filter':{'field':'role','value':[_0x2393('0x57'),_0x2393('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case'zendeskaccounts':_0xe9833a[_0x2393('0x17')]=_0x2393('0x59');break;case _0x2393('0x5a'):_0xe9833a['childModel']=_0x2393('0x5b');break;case'freshdeskaccounts':_0xe9833a['childModel']=_0x2393('0x5c');break;case'sugarcrmaccounts':_0xe9833a[_0x2393('0x17')]=_0x2393('0x5d');break;case _0x2393('0x5e'):_0xe9833a[_0x2393('0x17')]='DeskAccount';break;case _0x2393('0x5f'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x60');break;case _0x2393('0x61'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x36');break;case'cannedanswers':_0xe9833a['childModel']=_0x2393('0x62');break;case'dispositions':_0xe9833a[_0x2393('0x17')]=_0x2393('0x63');break;case _0x2393('0x64'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x65');break;case _0x2393('0x66'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x67');break;case _0x2393('0x68'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x69');break;case _0x2393('0x6a'):_0xe9833a[_0x2393('0x17')]='Schedule';break;case _0x2393('0x6b'):_0xe9833a['childModel']=_0x2393('0x6c');break;case'tags':_0xe9833a[_0x2393('0x17')]=_0x2393('0x6d');break;case _0x2393('0x6e'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x6f');break;case _0x2393('0x70'):_0xe9833a[_0x2393('0x17')]='Trigger';break;case'trunks':_0xe9833a[_0x2393('0x17')]=_0x2393('0x71');break;case'variables':_0xe9833a[_0x2393('0x17')]='Variable';break;case _0x2393('0x72'):_0xe9833a[_0x2393('0x17')]=_0x2393('0x73');break;case'extractedreports':_0xe9833a[_0x2393('0x17')]='AnalyticExtractedReport';_0xe9833a[_0x2393('0x19')]=[{'name':_0x2393('0x74'),'field':'id','foreignKey':_0x2393('0x75')}];break;case _0x2393('0x76'):_0xe9833a['childModel']=_0x2393('0x77');break;}return _0xe9833a;}function _0x427d84(_0x1831d2,_0x58fed6){var _0x2a285c=_0x1831d2[_0x2393('0x78')](0x0)[_0x2393('0x79')]()+_0x1831d2[_0x2393('0x7a')](0x1);var _0x338a22={'type':_0x1691d3['Sequelize'][_0x2393('0x7b')][_0x2393('0x7c')],'raw':!![]};return new Promise(function(_0x34bf3a,_0x27a352){var _0x356751=squel['select']()[_0x2393('0x6')]('ui.'+_0x2a285c+_0x2393('0x7d'),'id')[_0x2393('0x6')](_0x2393('0x7e'))[_0x2393('0x7f')](_0x2393('0x80')+_0x1831d2+_0x2393('0x81'),'ui')['where'](_0x2393('0x82'),_0x58fed6['id']);return _0x1691d3[_0x2393('0x83')][_0x2393('0x84')](_0x356751['toString'](),_0x338a22)[_0x2393('0x8')](function(_0x146822){_0x58fed6[_0x2a285c+_0x2393('0x85')]=_0x146822;_0x34bf3a(_0x146822);})[_0x2393('0xb')](function(_0x35e314){_0x27a352(_0x35e314);});});}return _0x17350d[_0x2393('0x86')](_0x2393('0x87'),attributes,{'tableName':_0x2393('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1f8089){var _0x4c4df6={'raw':_0x1f8089[_0x2393('0x84')]['raw'],'where':{}};var _0x493500={};var _0x4391a7={'count':0x0,'rows':[]};var _0x1cea03=_0x1f8089[_0x2393('0x84')][_0x2393('0x89')];var _0x513b40=_0x1f8089[_0x2393('0x84')]['mergeResources']||![];var _0x3d4c06=_0xf62e5a(_0x1cea03,_0x513b40);if(!_0x3d4c06[_0x2393('0x17')])throw new Error(_0x2393('0x8a')+_0x1cea03+'\x27');var _0x19ec50=[{'name':_0x1cea03}];if(!_[_0x2393('0x8b')](_0x3d4c06[_0x2393('0x19')]))_0x19ec50=_0x3d4c06[_0x2393('0x19')];var _0x566062=[];for(var _0x9d9692=0x0;_0x9d9692<_0x19ec50[_0x2393('0x8c')];_0x9d9692++){_0x566062['push'](_0x1691d3[_0x2393('0x8d')][_0x2393('0x8e')]({'where':{'userProfileId':_0x1f8089['params']['id'],'name':_0x19ec50[_0x9d9692][_0x2393('0xe')]},'raw':!![]}));}return Promise[_0x2393('0x8f')](_0x566062)[_0x2393('0x8')](function(_0x349f3b){var _0x30d7e2=_[_0x2393('0x5')](_0x349f3b,function(_0x3318fb){return _0x3318fb?_0x3318fb:undefined;});var _0x3b110e=_[_0x2393('0x5')](_0x19ec50,[_0x2393('0x90'),!![]]);var _0x4d4b3d=_[_0x2393('0x8b')](_0x30d7e2)&&_[_0x2393('0x8b')](_0x3b110e)?null:_[_0x2393('0x91')](_0x3b110e,_0x30d7e2);if(!_0x4d4b3d)return null;var _0x3b2778=[];for(var _0x3ddfcc=0x0;_0x3ddfcc<_0x4d4b3d[_0x2393('0x8c')];_0x3ddfcc++){var _0x21c14c=_['find'](_0x19ec50,function(_0xe64aca){return _0x4d4b3d[_0x3ddfcc]?_0xe64aca['name']===_0x4d4b3d[_0x3ddfcc][_0x2393('0xe')]:null;});if(_0x21c14c){if(_0x4d4b3d[_0x3ddfcc][_0x2393('0x90')]){_0x3b2778[_0x2393('0x92')](_0x175639(_0x3d4c06[_0x2393('0x17')],_0x4d4b3d[_0x3ddfcc]));}else{if(!_0x4d4b3d[_0x3ddfcc][_0x2393('0x93')]){_0x3b2778[_0x2393('0x92')](_0x52a0ff(_0x21c14c,_0x4d4b3d[_0x3ddfcc],_0x3d4c06[_0x2393('0x17')]));}else{if(_0x21c14c[_0x2393('0xd')]){_0x3b2778[_0x2393('0x92')](_0x425e92(_0x21c14c,_0x4d4b3d[_0x3ddfcc]));}}}}}return Promise[_0x2393('0x8f')](_0x3b2778);})[_0x2393('0x8')](function(_0x566278){var _0x434c1e=_0x566278;var _0x1629d3=null;if(_0x434c1e){_0x1629d3=_0x434c1e[_0x2393('0x8c')]===0x1?_0x434c1e[0x0]:null;}if(!_0x1629d3&&!_0x434c1e)return _0x4391a7;var _0x4013c0=_0x1691d3[_0x3d4c06[_0x2393('0x17')]][_0x2393('0x94')];_0x493500[_0x2393('0xd')]=_['keys'](_0x4013c0);_0x493500['query']=_[_0x2393('0x95')](_0x1f8089[_0x2393('0x84')]);_0x493500[_0x2393('0x96')]=_[_0x2393('0x97')](_0x493500['model'],_0x493500[_0x2393('0x84')]);_0x4c4df6[_0x2393('0x98')]=_[_0x2393('0x97')](_0x493500[_0x2393('0xd')],qs[_0x2393('0x99')](_0x1f8089[_0x2393('0x84')][_0x2393('0x99')]));_0x4c4df6[_0x2393('0x98')]=_0x4c4df6[_0x2393('0x98')][_0x2393('0x8c')]?_0x4c4df6['attributes']:_0x493500[_0x2393('0xd')];if(!_0x1f8089[_0x2393('0x84')]['hasOwnProperty'](_0x2393('0x9a'))){_0x4c4df6[_0x2393('0x9b')]=qs['limit'](_0x1f8089[_0x2393('0x84')][_0x2393('0x9b')]);_0x4c4df6['offset']=qs[_0x2393('0x9c')](_0x1f8089[_0x2393('0x84')][_0x2393('0x9c')]);}_0x4c4df6[_0x2393('0x9d')]=qs[_0x2393('0x9e')](_0x1f8089[_0x2393('0x84')][_0x2393('0x9e')]);_0x4c4df6[_0x2393('0x9f')]=qs[_0x2393('0x96')](_[_0x2393('0xa0')](_0x1f8089['query'],_0x493500['filters']));if(_0x1f8089[_0x2393('0x84')][_0x2393('0x5')]){_0x4c4df6[_0x2393('0x9f')]=_['merge'](_0x4c4df6[_0x2393('0x9f')],{'$or':_[_0x2393('0xa')](_0x4013c0,function(_0x35d92b){if(_0x35d92b[_0x2393('0x13')][_0x2393('0xa1')]!==_0x2393('0xa2')){var _0x4ebefa={};_0x4ebefa[_0x35d92b['field']]={'$like':'%'+_0x1f8089['query']['filter']+'%'};return _0x4ebefa;}})});}var _0x212549=[];var _0x3f26e9=null;var _0x25493b={};if(_0x1629d3){_0x3f26e9=_[_0x2393('0x8e')](_0x19ec50,['name',_0x1629d3['name']]);if(_0x3f26e9[_0x2393('0x6')]){_0x25493b={};if(_0x3d4c06[_0x2393('0x17')]===_0x2393('0x11')){_0x25493b[_0x3f26e9['foreignKey']]=_[_0x2393('0xa')](_0x1629d3[_0x2393('0x9')],'id');}else{_0x25493b[_0x3f26e9[_0x2393('0xa3')]]=_0x1629d3[_0x2393('0x9')];}_0x212549['push'](_0x25493b);}else{_0x4c4df6[_0x2393('0x9f')]['id']=_0x1629d3[_0x2393('0x9')];}}else{for(var _0x128321=0x0;_0x128321<_0x434c1e[_0x2393('0x8c')];_0x128321++){_0x3f26e9=_[_0x2393('0x8e')](_0x19ec50,[_0x2393('0xe'),_0x434c1e[_0x128321][_0x2393('0xe')]]);if(_0x3f26e9[_0x2393('0x6')]){_0x25493b={};_0x25493b[_0x3f26e9[_0x2393('0xa3')]]=_0x434c1e[_0x128321]['associatedResources'];_0x212549[_0x2393('0x92')](_0x25493b);}else{if(!_0x4c4df6['where']['id'])_0x4c4df6[_0x2393('0x9f')]['id']=[];_0x434c1e[_0x128321][_0x2393('0x9')][_0x2393('0xa4')](function(_0x586633){_0x4c4df6[_0x2393('0x9f')]['id'][_0x2393('0x92')](_0x586633);});}}}if(!_[_0x2393('0x8b')](_0x212549)){_0x4c4df6[_0x2393('0x9f')]=_['merge'](_0x4c4df6[_0x2393('0x9f')],{'$and':{'$or':_0x212549}});}_0x4c4df6=_[_0x2393('0xa5')]({},_0x4c4df6,_0x1f8089[_0x2393('0xa6')]);if(_0x1629d3&&!_0x1629d3[_0x2393('0x93')]&&_0x3d4c06[_0x2393('0x17')]===_0x2393('0x11')){if(_0x1f8089[_0x2393('0x84')][_0x2393('0xa7')]){_0x4c4df6['include']=[{'all':!![]}];}return _0x1691d3[_0x3d4c06[_0x2393('0x17')]][_0x2393('0x7')](_0x4c4df6)[_0x2393('0x8')](function(_0x49485e){var _0x4865b7=[];_0x49485e[_0x2393('0xa4')](function(_0x367a2e){var _0x3f59b3;switch(_0x367a2e[_0x2393('0xa8')]){case'default':_0x3f59b3=_[_0x2393('0x8e')](_0x1629d3['associatedResources'],function(_0x4e408a){return _0x4e408a['id']===_0x367a2e['reportId']&&_0x4e408a['type']===_0x2393('0xa9');});break;case _0x2393('0xaa'):_0x3f59b3=_['find'](_0x1629d3['associatedResources'],function(_0x3ef236){return _0x3ef236['id']===_0x367a2e[_0x2393('0x75')]&&_0x3ef236[_0x2393('0x13')]==='CustomReports';});break;}if(_0x3f59b3)_0x4865b7[_0x2393('0x92')](_0x367a2e);});_0x4391a7['count']=_0x4865b7[_0x2393('0x8c')];_0x4391a7[_0x2393('0xab')]=_0x4865b7;return _0x4391a7;});}else{if(!_['isEmpty'](_0x1f8089[_0x2393('0x84')][_0x2393('0xac')])){_0x4c4df6[_0x2393('0x9f')]['id']=_0x4c4df6['where']['id']?_[_0x2393('0x97')](_0x4c4df6[_0x2393('0x9f')]['id'],_0x1f8089[_0x2393('0x84')]['ids']):_0x1f8089[_0x2393('0x84')][_0x2393('0xac')];if(_0x1f8089[_0x2393('0x84')][_0x2393('0xad')]){_0x4c4df6[_0x2393('0x9d')]=_0x1f8089[_0x2393('0x84')][_0x2393('0xad')];}}if(_0x1f8089[_0x2393('0x84')][_0x2393('0xae')]){_0x4c4df6[_0x2393('0x9f')]=_['merge'](_0x4c4df6[_0x2393('0x9f')],{'$and':_0x1f8089[_0x2393('0x84')][_0x2393('0xae')]});}return _0x1691d3[_0x3d4c06[_0x2393('0x17')]][_0x2393('0xaf')]({'where':_0x4c4df6[_0x2393('0x9f')]})[_0x2393('0x8')](function(_0x576ef1){_0x4391a7[_0x2393('0xaf')]=_0x576ef1;if(_0x1f8089[_0x2393('0x84')]['includeAll']){if(_0x3d4c06[_0x2393('0x17')]===_0x2393('0x1e')){_0x4c4df6[_0x2393('0xb0')]=[{'model':_0x1691d3[_0x2393('0x6d')],'as':_0x2393('0xb1'),'attributes':['id','name',_0x2393('0xb2')],'required':_0x1f8089[_0x2393('0x84')][_0x2393('0xb3')]?!![]:![]},{'model':_0x1691d3[_0x2393('0x6d')],'as':_0x2393('0xb4'),'attributes':['id',_0x2393('0xe'),_0x2393('0xb2')],'through':_0x1f8089[_0x2393('0x84')][_0x2393('0xb3')]?{'attributes':[],'where':{'TagId':_0x1f8089[_0x2393('0x84')][_0x2393('0xb3')]||undefined}}:{},'required':_0x1f8089[_0x2393('0x84')][_0x2393('0xb3')]?!![]:![]}];}else{_0x4c4df6[_0x2393('0xb0')]=[{'all':!![]}];}}return _0x1691d3[_0x3d4c06[_0x2393('0x17')]][_0x2393('0x7')](_0x4c4df6);})[_0x2393('0x8')](function(_0x1d39b4){_0x4391a7[_0x2393('0xab')]=_0x1d39b4;if(_0x1cea03===_0x2393('0x34')&&_0x1f8089[_0x2393('0x84')][_0x2393('0xb5')]==='true'){var _0x2a9d2e=[];for(var _0x3c03c4=0x0;_0x3c03c4<_0x4391a7['rows'][_0x2393('0x8c')];_0x3c03c4++){_0x2a9d2e['push'](_0x427d84(_0x2393('0xb6'),_0x4391a7[_0x2393('0xab')][_0x3c03c4][_0x2393('0xb7')]));_0x2a9d2e[_0x2393('0x92')](_0x427d84(_0x2393('0xb8'),_0x4391a7[_0x2393('0xab')][_0x3c03c4][_0x2393('0xb7')]));_0x2a9d2e[_0x2393('0x92')](_0x427d84(_0x2393('0xb9'),_0x4391a7[_0x2393('0xab')][_0x3c03c4]['dataValues']));_0x2a9d2e['push'](_0x427d84(_0x2393('0xba'),_0x4391a7[_0x2393('0xab')][_0x3c03c4][_0x2393('0xb7')]));_0x2a9d2e[_0x2393('0x92')](_0x427d84(_0x2393('0xbb'),_0x4391a7['rows'][_0x3c03c4][_0x2393('0xb7')]));_0x2a9d2e[_0x2393('0x92')](_0x427d84(_0x2393('0xbc'),_0x4391a7[_0x2393('0xab')][_0x3c03c4][_0x2393('0xb7')]));}return Promise[_0x2393('0x8f')](_0x2a9d2e)['then'](function(){return _0x4391a7;});}return _0x4391a7;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 16c83a9..e1f48b0 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 _0x4317=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x503be0,_0x254ab5){var _0x2300f6=function(_0x17c3c4){while(--_0x17c3c4){_0x503be0['push'](_0x503be0['shift']());}};_0x2300f6(++_0x254ab5);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x7431('0x0'));var moment=require(_0x7431('0x1'));var BPromise=require(_0x7431('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7431('0x3'));var db=require(_0x7431('0x4'))['db'];var utils=require(_0x7431('0x5'));var logger=require(_0x7431('0x6'))(_0x7431('0x7'));var config=require(_0x7431('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7431('0x9')]({'port':0x232a});config[_0x7431('0xa')]=_[_0x7431('0xb')](config[_0x7431('0xa')],{'host':_0x7431('0xc'),'port':0x18eb});var socket=require(_0x7431('0xd'))(new Redis(config[_0x7431('0xa')]));require(_0x7431('0xe'))[_0x7431('0xf')](socket);function respondWithRpcPromise(_0xcf3ea4,_0x9a8b79,_0x13bf7b){return new BPromise(function(_0x11303d,_0x2adf0c){return client[_0x7431('0x10')](_0xcf3ea4,_0x13bf7b)[_0x7431('0x11')](function(_0xb01fee){logger[_0x7431('0x12')](_0x7431('0x13'),_0x9a8b79,_0x7431('0x14'));logger[_0x7431('0x15')](_0x7431('0x16'),_0x9a8b79,_0x7431('0x14'),JSON[_0x7431('0x17')](_0xb01fee));if(_0xb01fee['error']){if(_0xb01fee[_0x7431('0x18')][_0x7431('0x19')]===0x1f4){logger[_0x7431('0x18')]('UserProfile,\x20%s,\x20%s',_0x9a8b79,_0xb01fee[_0x7431('0x18')][_0x7431('0x1a')]);return _0x2adf0c(_0xb01fee[_0x7431('0x18')]['message']);}logger[_0x7431('0x18')]('UserProfile,\x20%s,\x20%s',_0x9a8b79,_0xb01fee['error']['message']);return _0x11303d(_0xb01fee[_0x7431('0x18')][_0x7431('0x1a')]);}else{logger[_0x7431('0x12')](_0x7431('0x13'),_0x9a8b79,'request\x20sent');_0x11303d(_0xb01fee['result'][_0x7431('0x1a')]);}})[_0x7431('0x1b')](function(_0x37bf74){logger[_0x7431('0x18')](_0x7431('0x13'),_0x9a8b79,_0x37bf74);_0x2adf0c(_0x37bf74);});});} \ No newline at end of file +var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util'];(function(_0x26f2bd,_0x3bde60){var _0x559fea=function(_0x407128){while(--_0x407128){_0x26f2bd['push'](_0x26f2bd['shift']());}};_0x559fea(++_0x3bde60);}(_0x4910,0x1d9));var _0x0491=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4910[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});config[_0x0491('0xc')]=_['defaults'](config[_0x0491('0xc')],{'host':_0x0491('0xd'),'port':0x18eb});var socket=require(_0x0491('0xe'))(new Redis(config[_0x0491('0xc')]));require(_0x0491('0xf'))['register'](socket);function respondWithRpcPromise(_0x1a4359,_0x51bd65,_0x39bafa){return new BPromise(function(_0x1b57a1,_0x3ff9c6){return client[_0x0491('0x10')](_0x1a4359,_0x39bafa)[_0x0491('0x11')](function(_0x12ab48){logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));logger[_0x0491('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x51bd65,_0x0491('0x14'),JSON['stringify'](_0x12ab48));if(_0x12ab48[_0x0491('0x16')]){if(_0x12ab48['error']['code']===0x1f4){logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x3ff9c6(_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);}logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x1b57a1(_0x12ab48['error'][_0x0491('0x17')]);}else{logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));_0x1b57a1(_0x12ab48[_0x0491('0x18')][_0x0491('0x17')]);}})['catch'](function(_0x1a924b){logger[_0x0491('0x16')]('UserProfile,\x20%s,\x20%s',_0x51bd65,_0x1a924b);_0x3ff9c6(_0x1a924b);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 28a8646..38f71e5 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 _0xd983=['./userProfile.events','save','remove','update','emit','register','length'];(function(_0x485f52,_0x7a120c){var _0xfccf21=function(_0x1ffeaf){while(--_0x1ffeaf){_0x485f52['push'](_0x485f52['shift']());}};_0xfccf21(++_0x7a120c);}(_0xd983,0xbd));var _0x3d98=function(_0x41ff8f,_0x4a54e8){_0x41ff8f=_0x41ff8f-0x0;var _0x134e8d=_0xd983[_0x41ff8f];return _0x134e8d;};'use strict';var UserProfileEvents=require(_0x3d98('0x0'));var events=[_0x3d98('0x1'),_0x3d98('0x2'),_0x3d98('0x3')];function createListener(_0x3cac2e,_0x51ed79){return function(_0x31fd9d){_0x51ed79[_0x3d98('0x4')](_0x3cac2e,_0x31fd9d);};}function removeListener(_0x11ca43,_0x2a47fa){return function(){UserProfileEvents['removeListener'](_0x11ca43,_0x2a47fa);};}exports[_0x3d98('0x5')]=function(_0x4f7809){for(var _0x541ee9=0x0,_0x38112c=events[_0x3d98('0x6')];_0x541ee9<_0x38112c;_0x541ee9++){var _0x541fd7=events[_0x541ee9];var _0x4baf61=createListener('userProfile:'+_0x541fd7,_0x4f7809);UserProfileEvents['on'](_0x541fd7,_0x4baf61);}}; \ No newline at end of file +var _0x3728=['userProfile:','./userProfile.events','save','remove','emit','removeListener','length'];(function(_0x21ec55,_0x538170){var _0xa3aace=function(_0x1d1a9c){while(--_0x1d1a9c){_0x21ec55['push'](_0x21ec55['shift']());}};_0xa3aace(++_0x538170);}(_0x3728,0xb7));var _0x8372=function(_0x5454d1,_0x545bcc){_0x5454d1=_0x5454d1-0x0;var _0x46200f=_0x3728[_0x5454d1];return _0x46200f;};'use strict';var UserProfileEvents=require(_0x8372('0x0'));var events=[_0x8372('0x1'),_0x8372('0x2'),'update'];function createListener(_0x2cb683,_0x833589){return function(_0x2108c9){_0x833589[_0x8372('0x3')](_0x2cb683,_0x2108c9);};}function removeListener(_0x3d096a,_0x4a525f){return function(){UserProfileEvents[_0x8372('0x4')](_0x3d096a,_0x4a525f);};}exports['register']=function(_0x11ea9e){for(var _0x5b2117=0x0,_0x4d97df=events[_0x8372('0x5')];_0x5b2117<_0x4d97df;_0x5b2117++){var _0xdf6e3d=events[_0x5b2117];var _0x5dbe93=createListener(_0x8372('0x6')+_0xdf6e3d,_0x11ea9e);UserProfileEvents['on'](_0xdf6e3d,_0x5dbe93);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 7c1a98b..63de96d 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 _0x32b8=['delete','util','connect-timeout','express','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','show','post','create','/:id','update'];(function(_0x2de15d,_0x28e8d7){var _0x1c39c4=function(_0xf58515){while(--_0xf58515){_0x2de15d['push'](_0x2de15d['shift']());}};_0x1c39c4(++_0x28e8d7);}(_0x32b8,0x1f0));var _0x832b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x32b8[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0x832b('0x0'));var path=require('path');var timeout=require(_0x832b('0x1'));var express=require(_0x832b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x832b('0x3'));var config=require('../../config/environment');var controller=require(_0x832b('0x4'));router[_0x832b('0x5')]('/',auth[_0x832b('0x6')](),controller['index']);router[_0x832b('0x5')](_0x832b('0x7'),auth[_0x832b('0x6')](),controller[_0x832b('0x8')]);router[_0x832b('0x5')]('/:id',auth[_0x832b('0x6')](),controller[_0x832b('0x9')]);router[_0x832b('0xa')]('/',auth['isAuthenticated'](),controller[_0x832b('0xb')]);router['put'](_0x832b('0xc'),auth[_0x832b('0x6')](),controller[_0x832b('0xd')]);router[_0x832b('0xe')](_0x832b('0xc'),auth[_0x832b('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbd9b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5eb6e9,_0x5a90c9){var _0xf2f26=function(_0x5beafb){while(--_0x5beafb){_0x5eb6e9['push'](_0x5eb6e9['shift']());}};_0xf2f26(++_0x5a90c9);}(_0xbd9b,0x10f));var _0xbbd9=function(_0x3a678e,_0x4d297c){_0x3a678e=_0x3a678e-0x0;var _0x2e62e7=_0xbd9b[_0x3a678e];return _0x2e62e7;};'use strict';var multer=require(_0xbbd9('0x0'));var util=require(_0xbbd9('0x1'));var path=require(_0xbbd9('0x2'));var timeout=require(_0xbbd9('0x3'));var express=require(_0xbbd9('0x4'));var router=express[_0xbbd9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbbd9('0x6'));var config=require(_0xbbd9('0x7'));var controller=require(_0xbbd9('0x8'));router[_0xbbd9('0x9')]('/',auth['isAuthenticated'](),controller[_0xbbd9('0xa')]);router['get'](_0xbbd9('0xb'),auth[_0xbbd9('0xc')](),controller['describe']);router['get']('/:id',auth[_0xbbd9('0xc')](),controller[_0xbbd9('0xd')]);router['post']('/',auth[_0xbbd9('0xc')](),controller[_0xbbd9('0xe')]);router[_0xbbd9('0xf')](_0xbbd9('0x10'),auth[_0xbbd9('0xc')](),controller[_0xbbd9('0x11')]);router[_0xbbd9('0x12')](_0xbbd9('0x10'),auth[_0xbbd9('0xc')](),controller[_0xbbd9('0x13')]);module[_0xbbd9('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 9a97377..2cc5054 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 _0x923c=['INTEGER','sequelize','exports','STRING'];(function(_0x104540,_0x555ac1){var _0x3c53cf=function(_0x41180a){while(--_0x41180a){_0x104540['push'](_0x104540['shift']());}};_0x3c53cf(++_0x555ac1);}(_0x923c,0x1e9));var _0xc923=function(_0x2cb6b9,_0x175b9a){_0x2cb6b9=_0x2cb6b9-0x0;var _0xbbcba1=_0x923c[_0x2cb6b9];return _0xbbcba1;};'use strict';var Sequelize=require(_0xc923('0x0'));module[_0xc923('0x1')]={'name':{'type':Sequelize[_0xc923('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc923('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc923('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6928=['INTEGER','STRING','sequelize','exports'];(function(_0x5bd757,_0x3fad85){var _0x1f7d87=function(_0x247785){while(--_0x247785){_0x5bd757['push'](_0x5bd757['shift']());}};_0x1f7d87(++_0x3fad85);}(_0x6928,0x1e6));var _0x8692=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6928[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x8692('0x0'));module[_0x8692('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8692('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8692('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4d1ee82..5993d60 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 _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x367e7e,_0x564aa4){var _0x90036e=function(_0x45ec9e){while(--_0x45ec9e){_0x367e7e['push'](_0x367e7e['shift']());}};_0x90036e(++_0x564aa4);}(_0xb016,0x159));var _0x6b01=function(_0x4d2eb5,_0x46531e){_0x4d2eb5=_0x4d2eb5-0x0;var _0x5958f0=_0xb016[_0x4d2eb5];return _0x5958f0;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));}; \ No newline at end of file +var _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x6343,0x168));var _0x3634=function(_0x1095af,_0x42fdd7){_0x1095af=_0x1095af-0x0;var _0x56b385=_0x6343[_0x1095af];return _0x56b385;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 09db7f5..7044f8b 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 _0x6f7c=['define','resourceId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x37eff2,_0x5c1639){var _0x3c9e7f=function(_0x17c6c6){while(--_0x17c6c6){_0x37eff2['push'](_0x37eff2['shift']());}};_0x3c9e7f(++_0x5c1639);}(_0x6f7c,0x64));var _0xc6f7=function(_0xddafcc,_0x5e601f){_0xddafcc=_0xddafcc-0x0;var _0x511cb1=_0x6f7c[_0xddafcc];return _0x511cb1;};'use strict';var _=require(_0xc6f7('0x0'));var util=require(_0xc6f7('0x1'));var logger=require(_0xc6f7('0x2'))(_0xc6f7('0x3'));var moment=require(_0xc6f7('0x4'));var BPromise=require(_0xc6f7('0x5'));var rp=require(_0xc6f7('0x6'));var fs=require('fs');var path=require(_0xc6f7('0x7'));var rimraf=require(_0xc6f7('0x8'));var config=require(_0xc6f7('0x9'));var attributes=require(_0xc6f7('0xa'));module[_0xc6f7('0xb')]=function(_0x477ca9,_0x4593dd){return _0x477ca9[_0xc6f7('0xc')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc6f7('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e4e=['sectionId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4e4e,0x97));var _0xe4e4=function(_0x4a3bc8,_0x2c8864){_0x4a3bc8=_0x4a3bc8-0x0;var _0x20f722=_0x4e4e[_0x4a3bc8];return _0x20f722;};'use strict';var _=require(_0xe4e4('0x0'));var util=require(_0xe4e4('0x1'));var logger=require(_0xe4e4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe4e4('0x3'));var rp=require(_0xe4e4('0x4'));var fs=require('fs');var path=require(_0xe4e4('0x5'));var rimraf=require(_0xe4e4('0x6'));var config=require(_0xe4e4('0x7'));var attributes=require(_0xe4e4('0x8'));module[_0xe4e4('0x9')]=function(_0x3536a6,_0x3057b4){return _0x3536a6[_0xe4e4('0xa')](_0xe4e4('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xe4e4('0xc'),'fields':[_0xe4e4('0xd'),_0xe4e4('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 0707ce0..3e95d81 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 _0x7ae6=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x7ae6,0x94));var _0x67ae=function(_0x4d9e21,_0x55793d){_0x4d9e21=_0x4d9e21-0x0;var _0x1c58e7=_0x7ae6[_0x4d9e21];return _0x1c58e7;};'use strict';var _=require('lodash');var util=require(_0x67ae('0x0'));var moment=require('moment');var BPromise=require(_0x67ae('0x1'));var rs=require(_0x67ae('0x2'));var fs=require('fs');var Redis=require(_0x67ae('0x3'));var db=require(_0x67ae('0x4'))['db'];var utils=require(_0x67ae('0x5'));var logger=require(_0x67ae('0x6'))('rpc');var config=require(_0x67ae('0x7'));var jayson=require(_0x67ae('0x8'));var client=jayson[_0x67ae('0x9')][_0x67ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33bc99,_0x51f7f2,_0x456ca9){return new BPromise(function(_0x460304,_0x2591a1){return client[_0x67ae('0xb')](_0x33bc99,_0x456ca9)[_0x67ae('0xc')](function(_0x11c49a){logger[_0x67ae('0xd')](_0x67ae('0xe'),_0x51f7f2,_0x67ae('0xf'));logger[_0x67ae('0x10')](_0x67ae('0x11'),_0x51f7f2,_0x67ae('0xf'),JSON[_0x67ae('0x12')](_0x11c49a));if(_0x11c49a[_0x67ae('0x13')]){if(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x14')]===0x1f4){logger[_0x67ae('0x13')](_0x67ae('0xe'),_0x51f7f2,_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);return _0x2591a1(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);}logger[_0x67ae('0x13')](_0x67ae('0xe'),_0x51f7f2,_0x11c49a['error'][_0x67ae('0x15')]);return _0x460304(_0x11c49a[_0x67ae('0x13')][_0x67ae('0x15')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x51f7f2,_0x67ae('0xf'));_0x460304(_0x11c49a['result']['message']);}})[_0x67ae('0x16')](function(_0x2c47f9){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x51f7f2,_0x2c47f9);_0x2591a1(_0x2c47f9);});});} \ No newline at end of file +var _0x8b77=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result'];(function(_0x40fd1f,_0x431799){var _0x4bdd79=function(_0x8076bc){while(--_0x8076bc){_0x40fd1f['push'](_0x40fd1f['shift']());}};_0x4bdd79(++_0x431799);}(_0x8b77,0x9a));var _0x78b7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8b77[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x78b7('0x0'));var moment=require(_0x78b7('0x1'));var BPromise=require(_0x78b7('0x2'));var rs=require(_0x78b7('0x3'));var fs=require('fs');var Redis=require(_0x78b7('0x4'));var db=require(_0x78b7('0x5'))['db'];var utils=require(_0x78b7('0x6'));var logger=require(_0x78b7('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78b7('0x8'));var client=jayson['client'][_0x78b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a4189,_0x49816c,_0x4ab53f){return new BPromise(function(_0x1a5a9f,_0xe1303e){return client[_0x78b7('0xa')](_0x5a4189,_0x4ab53f)[_0x78b7('0xb')](function(_0x545ed5){logger[_0x78b7('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x49816c,'request\x20sent');logger[_0x78b7('0xd')](_0x78b7('0xe'),_0x49816c,_0x78b7('0xf'),JSON[_0x78b7('0x10')](_0x545ed5));if(_0x545ed5[_0x78b7('0x11')]){if(_0x545ed5['error'][_0x78b7('0x12')]===0x1f4){logger[_0x78b7('0x11')](_0x78b7('0x13'),_0x49816c,_0x545ed5['error']['message']);return _0xe1303e(_0x545ed5[_0x78b7('0x11')][_0x78b7('0x14')]);}logger[_0x78b7('0x11')](_0x78b7('0x13'),_0x49816c,_0x545ed5[_0x78b7('0x11')][_0x78b7('0x14')]);return _0x1a5a9f(_0x545ed5[_0x78b7('0x11')][_0x78b7('0x14')]);}else{logger[_0x78b7('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x49816c,_0x78b7('0xf'));_0x1a5a9f(_0x545ed5[_0x78b7('0x15')][_0x78b7('0x14')]);}})['catch'](function(_0x58eada){logger[_0x78b7('0x11')](_0x78b7('0x13'),_0x49816c,_0x58eada);_0xe1303e(_0x58eada);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 891bbed..1eb249e 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 _0xd496=['../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd496,0xcd));var _0x6d49=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xd496[_0x38ced4];return _0x547c07;};'use strict';var multer=require(_0x6d49('0x0'));var util=require(_0x6d49('0x1'));var path=require(_0x6d49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6d49('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d49('0x4'));var controller=require(_0x6d49('0x5'));router['get']('/',auth[_0x6d49('0x6')](),controller[_0x6d49('0x7')]);router[_0x6d49('0x8')](_0x6d49('0x9'),auth[_0x6d49('0x6')](),controller['describe']);router['get'](_0x6d49('0xa'),auth[_0x6d49('0x6')](),controller[_0x6d49('0xb')]);router[_0x6d49('0xc')]('/',auth[_0x6d49('0x6')](),controller[_0x6d49('0xd')]);router[_0x6d49('0xe')]('/:id',auth[_0x6d49('0x6')](),controller[_0x6d49('0xf')]);router[_0x6d49('0x10')](_0x6d49('0xa'),auth['isAuthenticated'](),controller[_0x6d49('0x11')]);module[_0x6d49('0x12')]=router; \ No newline at end of file +var _0x8319=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8319,0x14a));var _0x9831=function(_0x385fb1,_0x3e2d5f){_0x385fb1=_0x385fb1-0x0;var _0x55c323=_0x8319[_0x385fb1];return _0x55c323;};'use strict';var multer=require(_0x9831('0x0'));var util=require(_0x9831('0x1'));var path=require(_0x9831('0x2'));var timeout=require(_0x9831('0x3'));var express=require('express');var router=express[_0x9831('0x4')]();var fs_extra=require(_0x9831('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9831('0x6'));var config=require(_0x9831('0x7'));var controller=require('./userProfileSection.controller');router[_0x9831('0x8')]('/',auth[_0x9831('0x9')](),controller[_0x9831('0xa')]);router[_0x9831('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9831('0x8')](_0x9831('0xb'),auth[_0x9831('0x9')](),controller[_0x9831('0xc')]);router[_0x9831('0xd')]('/',auth[_0x9831('0x9')](),controller[_0x9831('0xe')]);router[_0x9831('0xf')]('/:id',auth[_0x9831('0x9')](),controller[_0x9831('0x10')]);router[_0x9831('0x11')](_0x9831('0xb'),auth['isAuthenticated'](),controller[_0x9831('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 99fb272..b9bb1f7 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 _0xd914=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0xd7e379,_0x25d5a9){var _0x502489=function(_0x2bdff8){while(--_0x2bdff8){_0xd7e379['push'](_0xd7e379['shift']());}};_0x502489(++_0x25d5a9);}(_0xd914,0x17f));var _0x4d91=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0xd914[_0x50cfc3];return _0x5c11ef;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4d91('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4d91('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4d91('0x2')],'set':function(_0x2db8c5){this['setDataValue'](_0x4d91('0x5'),_0x2db8c5?_0x2db8c5['join'](''):[]);},'get':function(){return this[_0x4d91('0x6')](_0x4d91('0x5'))?this[_0x4d91('0x6')](_0x4d91('0x5'))[_0x4d91('0x7')](''):[];}}}; \ No newline at end of file +var _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0972,0x64));var _0x2097=function(_0x115fbe,_0x43d2a6){_0x115fbe=_0x115fbe-0x0;var _0x30477e=_0x0972[_0x115fbe];return _0x30477e;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7466e7e..e65d600 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 _0x1bd7=['to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','then','error','stack','name','UserProfileSection','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','create','body','find','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x1584b9,_0x400684){var _0x12dc05=function(_0x369e04){while(--_0x369e04){_0x1584b9['push'](_0x1584b9['shift']());}};_0x12dc05(++_0x400684);}(_0x1bd7,0x11f));var _0x71bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x71bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x71bd('0x1'));var jsonpatch=require(_0x71bd('0x2'));var rp=require('request-promise');var moment=require(_0x71bd('0x3'));var BPromise=require(_0x71bd('0x4'));var Mustache=require(_0x71bd('0x5'));var util=require(_0x71bd('0x6'));var path=require(_0x71bd('0x7'));var sox=require(_0x71bd('0x8'));var csv=require(_0x71bd('0x9'));var ejs=require(_0x71bd('0xa'));var fs=require('fs');var fs_extra=require(_0x71bd('0xb'));var _=require('lodash');var squel=require(_0x71bd('0xc'));var crypto=require(_0x71bd('0xd'));var jsforce=require(_0x71bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x71bd('0x9'));var querystring=require(_0x71bd('0xf'));var Papa=require(_0x71bd('0x10'));var Redis=require('ioredis');var authService=require(_0x71bd('0x11'));var qs=require(_0x71bd('0x12'));var as=require(_0x71bd('0x13'));var hardwareService=require(_0x71bd('0x14'));var logger=require('../../config/logger')(_0x71bd('0x15'));var utils=require(_0x71bd('0x16'));var config=require(_0x71bd('0x17'));var licenseUtil=require(_0x71bd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57339b,_0x458941){_0x458941=_0x458941||0xcc;return function(_0x4711c9){if(_0x4711c9){return _0x57339b[_0x71bd('0x19')](_0x458941);}return _0x57339b['status'](_0x458941)['end']();};}function respondWithResult(_0x4db196,_0xfda2fd){_0xfda2fd=_0xfda2fd||0xc8;return function(_0x4e9df5){if(_0x4e9df5){return _0x4db196[_0x71bd('0x1a')](_0xfda2fd)[_0x71bd('0x1b')](_0x4e9df5);}};}function respondWithFilteredResult(_0x550820,_0x56c25a){return function(_0x5c1b14){if(_0x5c1b14){var _0x10558d=typeof _0x56c25a['offset']===_0x71bd('0x1c')&&typeof _0x56c25a[_0x71bd('0x1d')]===_0x71bd('0x1c');var _0x4308fe=_0x5c1b14[_0x71bd('0x1e')];var _0x17cacf=_0x10558d?0x0:_0x56c25a['offset'];var _0x9bd43d=_0x10558d?_0x5c1b14['count']:_0x56c25a[_0x71bd('0x1f')]+_0x56c25a[_0x71bd('0x1d')];var _0x224c46;if(_0x9bd43d>=_0x4308fe){_0x9bd43d=_0x4308fe;_0x224c46=0xc8;}else{_0x224c46=0xce;}_0x550820['status'](_0x224c46);return _0x550820[_0x71bd('0x20')]('Content-Range',_0x17cacf+'-'+_0x9bd43d+'/'+_0x4308fe)[_0x71bd('0x1b')](_0x5c1b14);}return null;};}function patchUpdates(_0x3c9513){return function(_0x5f5a6c){try{jsonpatch[_0x71bd('0x21')](_0x5f5a6c,_0x3c9513,!![]);}catch(_0x53b646){return BPromise['reject'](_0x53b646);}return _0x5f5a6c[_0x71bd('0x22')]();};}function saveUpdates(_0x33ad46,_0x45dd3d){return function(_0x5ee053){if(_0x5ee053){return _0x5ee053[_0x71bd('0x23')](_0x33ad46)['then'](function(_0x5f4905){return _0x5f4905;});}return null;};}function removeEntity(_0xa8318f,_0x3380b0){return function(_0x197fed){if(_0x197fed){return _0x197fed['destroy']()[_0x71bd('0x24')](function(){_0xa8318f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ce49d,_0x52609){return function(_0x4f15ea){if(!_0x4f15ea){_0x4ce49d[_0x71bd('0x19')](0x194);}return _0x4f15ea;};}function handleError(_0x586723,_0x373e22){_0x373e22=_0x373e22||0x1f4;return function(_0x1c6c73){logger[_0x71bd('0x25')](_0x1c6c73[_0x71bd('0x26')]);if(_0x1c6c73[_0x71bd('0x27')]){delete _0x1c6c73[_0x71bd('0x27')];}_0x586723[_0x71bd('0x1a')](_0x373e22)['send'](_0x1c6c73);};}exports['index']=function(_0x5e5d6e,_0x65722c){var _0x73b5a6={},_0x53b669={},_0xe21917={'count':0x0,'rows':[]};var _0x8a0224=_['map'](db[_0x71bd('0x28')]['rawAttributes'],function(_0x5d98db){return{'name':_0x5d98db[_0x71bd('0x29')],'type':_0x5d98db[_0x71bd('0x2a')][_0x71bd('0x2b')]};});_0x53b669[_0x71bd('0x2c')]=_[_0x71bd('0x2d')](_0x8a0224,'name');_0x53b669[_0x71bd('0x2e')]=_[_0x71bd('0x2f')](_0x5e5d6e[_0x71bd('0x2e')]);_0x53b669[_0x71bd('0x30')]=_['intersection'](_0x53b669[_0x71bd('0x2c')],_0x53b669[_0x71bd('0x2e')]);_0x73b5a6[_0x71bd('0x31')]=_[_0x71bd('0x32')](_0x53b669['model'],qs[_0x71bd('0x33')](_0x5e5d6e['query'][_0x71bd('0x33')]));_0x73b5a6[_0x71bd('0x31')]=_0x73b5a6[_0x71bd('0x31')][_0x71bd('0x34')]?_0x73b5a6['attributes']:_0x53b669[_0x71bd('0x2c')];if(!_0x5e5d6e[_0x71bd('0x2e')][_0x71bd('0x35')](_0x71bd('0x36'))){_0x73b5a6[_0x71bd('0x1d')]=qs[_0x71bd('0x1d')](_0x5e5d6e[_0x71bd('0x2e')][_0x71bd('0x1d')]);_0x73b5a6[_0x71bd('0x1f')]=qs[_0x71bd('0x1f')](_0x5e5d6e[_0x71bd('0x2e')]['offset']);}_0x73b5a6[_0x71bd('0x37')]=qs[_0x71bd('0x38')](_0x5e5d6e[_0x71bd('0x2e')]['sort']);_0x73b5a6[_0x71bd('0x39')]=qs[_0x71bd('0x30')](_[_0x71bd('0x3a')](_0x5e5d6e[_0x71bd('0x2e')],_0x53b669[_0x71bd('0x30')]),_0x8a0224);if(_0x5e5d6e[_0x71bd('0x2e')][_0x71bd('0x3b')]){_0x73b5a6[_0x71bd('0x39')]=_[_0x71bd('0x3c')](_0x73b5a6[_0x71bd('0x39')],{'$or':_[_0x71bd('0x2d')](_0x8a0224,function(_0x520665){if(_0x520665[_0x71bd('0x2a')]!==_0x71bd('0x3d')){var _0x25f58={};_0x25f58[_0x520665['name']]={'$like':'%'+_0x5e5d6e[_0x71bd('0x2e')][_0x71bd('0x3b')]+'%'};return _0x25f58;}})});}_0x73b5a6=_['merge']({},_0x73b5a6,_0x5e5d6e['options']);var _0x482963={'where':_0x73b5a6[_0x71bd('0x39')]};return db[_0x71bd('0x28')][_0x71bd('0x1e')](_0x482963)[_0x71bd('0x24')](function(_0x560d8d){_0xe21917[_0x71bd('0x1e')]=_0x560d8d;if(_0x5e5d6e[_0x71bd('0x2e')][_0x71bd('0x3e')]){_0x73b5a6['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x71bd('0x3f')](_0x73b5a6);})[_0x71bd('0x24')](function(_0x1c1c24){_0xe21917[_0x71bd('0x40')]=_0x1c1c24;return _0xe21917;})[_0x71bd('0x24')](respondWithFilteredResult(_0x65722c,_0x73b5a6))[_0x71bd('0x41')](handleError(_0x65722c,null));};exports[_0x71bd('0x42')]=function(_0x370a76,_0x2a5c99){var _0x376db4={'raw':![],'where':{'id':_0x370a76[_0x71bd('0x43')]['id']}},_0x15b13a={};_0x15b13a[_0x71bd('0x2c')]=_[_0x71bd('0x2f')](db['UserProfileSection']['rawAttributes']);_0x15b13a[_0x71bd('0x2e')]=_[_0x71bd('0x2f')](_0x370a76['query']);_0x15b13a[_0x71bd('0x30')]=_[_0x71bd('0x32')](_0x15b13a[_0x71bd('0x2c')],_0x15b13a[_0x71bd('0x2e')]);_0x376db4[_0x71bd('0x31')]=_[_0x71bd('0x32')](_0x15b13a[_0x71bd('0x2c')],qs[_0x71bd('0x33')](_0x370a76[_0x71bd('0x2e')][_0x71bd('0x33')]));_0x376db4['attributes']=_0x376db4[_0x71bd('0x31')][_0x71bd('0x34')]?_0x376db4[_0x71bd('0x31')]:_0x15b13a['model'];if(_0x370a76[_0x71bd('0x2e')][_0x71bd('0x3e')]){_0x376db4['include']=[{'all':!![]}];}_0x376db4=_[_0x71bd('0x3c')]({},_0x376db4,_0x370a76[_0x71bd('0x44')]);return db[_0x71bd('0x28')]['find'](_0x376db4)['then'](handleEntityNotFound(_0x2a5c99,null))['then'](respondWithResult(_0x2a5c99,null))[_0x71bd('0x41')](handleError(_0x2a5c99,null));};exports[_0x71bd('0x45')]=function(_0x373fc1,_0x5d1eb9){return db[_0x71bd('0x28')][_0x71bd('0x45')](_0x373fc1[_0x71bd('0x46')],{})['then'](respondWithResult(_0x5d1eb9,0xc9))[_0x71bd('0x41')](handleError(_0x5d1eb9,null));};exports[_0x71bd('0x23')]=function(_0x268627,_0x1838b9){if(_0x268627['body']['id']){delete _0x268627[_0x71bd('0x46')]['id'];}return db['UserProfileSection'][_0x71bd('0x47')]({'where':{'id':_0x268627[_0x71bd('0x43')]['id']}})[_0x71bd('0x24')](handleEntityNotFound(_0x1838b9,null))[_0x71bd('0x24')](saveUpdates(_0x268627[_0x71bd('0x46')],null))[_0x71bd('0x24')](respondWithResult(_0x1838b9,null))[_0x71bd('0x41')](handleError(_0x1838b9,null));};exports[_0x71bd('0x48')]=function(_0x529024,_0x18329c){return db[_0x71bd('0x28')]['find']({'where':{'id':_0x529024['params']['id']}})[_0x71bd('0x24')](handleEntityNotFound(_0x18329c,null))['then'](removeEntity(_0x18329c,null))['catch'](handleError(_0x18329c,null));};exports[_0x71bd('0x49')]=function(_0x4d3c45,_0x493bef){return db[_0x71bd('0x28')]['describe']()[_0x71bd('0x24')](respondWithResult(_0x493bef,null))['catch'](handleError(_0x493bef,null));}; \ No newline at end of file +var _0xdef3=['status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xdef3,0x75));var _0x3def=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0xdef3[_0x424501];return _0xb719af;};'use strict';var emlformat=require(_0x3def('0x0'));var rimraf=require(_0x3def('0x1'));var zipdir=require(_0x3def('0x2'));var jsonpatch=require(_0x3def('0x3'));var rp=require(_0x3def('0x4'));var moment=require('moment');var BPromise=require(_0x3def('0x5'));var Mustache=require(_0x3def('0x6'));var util=require(_0x3def('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3def('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3def('0x9'));var squel=require(_0x3def('0xa'));var crypto=require('crypto');var jsforce=require(_0x3def('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3def('0x8'));var querystring=require(_0x3def('0xc'));var Papa=require(_0x3def('0xd'));var Redis=require(_0x3def('0xe'));var authService=require(_0x3def('0xf'));var qs=require(_0x3def('0x10'));var as=require(_0x3def('0x11'));var hardwareService=require(_0x3def('0x12'));var logger=require(_0x3def('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3def('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3def('0x15'))['db'];function respondWithStatusCode(_0x511afc,_0x39d18c){_0x39d18c=_0x39d18c||0xcc;return function(_0x17d5b9){if(_0x17d5b9){return _0x511afc[_0x3def('0x16')](_0x39d18c);}return _0x511afc[_0x3def('0x17')](_0x39d18c)[_0x3def('0x18')]();};}function respondWithResult(_0x31c07d,_0x51c076){_0x51c076=_0x51c076||0xc8;return function(_0x11c55f){if(_0x11c55f){return _0x31c07d[_0x3def('0x17')](_0x51c076)[_0x3def('0x19')](_0x11c55f);}};}function respondWithFilteredResult(_0x54dc5b,_0x187bb9){return function(_0x5d225c){if(_0x5d225c){var _0xc1a579=typeof _0x187bb9['offset']===_0x3def('0x1a')&&typeof _0x187bb9[_0x3def('0x1b')]===_0x3def('0x1a');var _0xfa527c=_0x5d225c[_0x3def('0x1c')];var _0x3c41e9=_0xc1a579?0x0:_0x187bb9[_0x3def('0x1d')];var _0x2c79b3=_0xc1a579?_0x5d225c[_0x3def('0x1c')]:_0x187bb9[_0x3def('0x1d')]+_0x187bb9[_0x3def('0x1b')];var _0x3386e4;if(_0x2c79b3>=_0xfa527c){_0x2c79b3=_0xfa527c;_0x3386e4=0xc8;}else{_0x3386e4=0xce;}_0x54dc5b[_0x3def('0x17')](_0x3386e4);return _0x54dc5b['set'](_0x3def('0x1e'),_0x3c41e9+'-'+_0x2c79b3+'/'+_0xfa527c)['json'](_0x5d225c);}return null;};}function patchUpdates(_0x425b07){return function(_0x3e5b15){try{jsonpatch[_0x3def('0x1f')](_0x3e5b15,_0x425b07,!![]);}catch(_0x3e6513){return BPromise[_0x3def('0x20')](_0x3e6513);}return _0x3e5b15['save']();};}function saveUpdates(_0x281912,_0xe2040f){return function(_0x2c589d){if(_0x2c589d){return _0x2c589d['update'](_0x281912)[_0x3def('0x21')](function(_0x5abfdd){return _0x5abfdd;});}return null;};}function removeEntity(_0x3bc61e,_0x16357d){return function(_0xa0e353){if(_0xa0e353){return _0xa0e353[_0x3def('0x22')]()['then'](function(){_0x3bc61e[_0x3def('0x17')](0xcc)[_0x3def('0x18')]();});}};}function handleEntityNotFound(_0xba7416,_0x4fabf3){return function(_0x23b6a5){if(!_0x23b6a5){_0xba7416['sendStatus'](0x194);}return _0x23b6a5;};}function handleError(_0xaf18f5,_0x357809){_0x357809=_0x357809||0x1f4;return function(_0x40ffc8){logger[_0x3def('0x23')](_0x40ffc8[_0x3def('0x24')]);if(_0x40ffc8['name']){delete _0x40ffc8[_0x3def('0x25')];}_0xaf18f5[_0x3def('0x17')](_0x357809)[_0x3def('0x26')](_0x40ffc8);};}exports[_0x3def('0x27')]=function(_0x5035a8,_0x77d0e1){var _0x148d42={},_0x1f1830={},_0x421519={'count':0x0,'rows':[]};var _0x1c6e87=_['map'](db[_0x3def('0x28')][_0x3def('0x29')],function(_0x27be9d){return{'name':_0x27be9d['fieldName'],'type':_0x27be9d['type'][_0x3def('0x2a')]};});_0x1f1830[_0x3def('0x2b')]=_[_0x3def('0x2c')](_0x1c6e87,_0x3def('0x25'));_0x1f1830['query']=_[_0x3def('0x2d')](_0x5035a8[_0x3def('0x2e')]);_0x1f1830['filters']=_[_0x3def('0x2f')](_0x1f1830['model'],_0x1f1830['query']);_0x148d42['attributes']=_[_0x3def('0x2f')](_0x1f1830[_0x3def('0x2b')],qs[_0x3def('0x30')](_0x5035a8[_0x3def('0x2e')][_0x3def('0x30')]));_0x148d42[_0x3def('0x31')]=_0x148d42[_0x3def('0x31')][_0x3def('0x32')]?_0x148d42[_0x3def('0x31')]:_0x1f1830[_0x3def('0x2b')];if(!_0x5035a8[_0x3def('0x2e')][_0x3def('0x33')](_0x3def('0x34'))){_0x148d42[_0x3def('0x1b')]=qs['limit'](_0x5035a8['query'][_0x3def('0x1b')]);_0x148d42[_0x3def('0x1d')]=qs['offset'](_0x5035a8[_0x3def('0x2e')][_0x3def('0x1d')]);}_0x148d42[_0x3def('0x35')]=qs[_0x3def('0x36')](_0x5035a8[_0x3def('0x2e')][_0x3def('0x36')]);_0x148d42[_0x3def('0x37')]=qs['filters'](_['pick'](_0x5035a8[_0x3def('0x2e')],_0x1f1830['filters']),_0x1c6e87);if(_0x5035a8[_0x3def('0x2e')][_0x3def('0x38')]){_0x148d42[_0x3def('0x37')]=_[_0x3def('0x39')](_0x148d42['where'],{'$or':_['map'](_0x1c6e87,function(_0x25fca0){if(_0x25fca0['type']!=='VIRTUAL'){var _0x16d673={};_0x16d673[_0x25fca0[_0x3def('0x25')]]={'$like':'%'+_0x5035a8[_0x3def('0x2e')]['filter']+'%'};return _0x16d673;}})});}_0x148d42=_['merge']({},_0x148d42,_0x5035a8[_0x3def('0x3a')]);var _0x54c343={'where':_0x148d42[_0x3def('0x37')]};return db['UserProfileSection']['count'](_0x54c343)['then'](function(_0x37c628){_0x421519[_0x3def('0x1c')]=_0x37c628;if(_0x5035a8[_0x3def('0x2e')][_0x3def('0x3b')]){_0x148d42[_0x3def('0x3c')]=[{'all':!![]}];}return db[_0x3def('0x28')][_0x3def('0x3d')](_0x148d42);})[_0x3def('0x21')](function(_0x2c4611){_0x421519[_0x3def('0x3e')]=_0x2c4611;return _0x421519;})[_0x3def('0x21')](respondWithFilteredResult(_0x77d0e1,_0x148d42))['catch'](handleError(_0x77d0e1,null));};exports['show']=function(_0x53684d,_0x1f0424){var _0x58d69b={'raw':![],'where':{'id':_0x53684d[_0x3def('0x3f')]['id']}},_0xad29b6={};_0xad29b6['model']=_[_0x3def('0x2d')](db[_0x3def('0x28')]['rawAttributes']);_0xad29b6[_0x3def('0x2e')]=_[_0x3def('0x2d')](_0x53684d[_0x3def('0x2e')]);_0xad29b6['filters']=_[_0x3def('0x2f')](_0xad29b6[_0x3def('0x2b')],_0xad29b6['query']);_0x58d69b[_0x3def('0x31')]=_[_0x3def('0x2f')](_0xad29b6[_0x3def('0x2b')],qs[_0x3def('0x30')](_0x53684d[_0x3def('0x2e')][_0x3def('0x30')]));_0x58d69b['attributes']=_0x58d69b[_0x3def('0x31')]['length']?_0x58d69b[_0x3def('0x31')]:_0xad29b6[_0x3def('0x2b')];if(_0x53684d[_0x3def('0x2e')]['includeAll']){_0x58d69b[_0x3def('0x3c')]=[{'all':!![]}];}_0x58d69b=_[_0x3def('0x39')]({},_0x58d69b,_0x53684d[_0x3def('0x3a')]);return db[_0x3def('0x28')][_0x3def('0x40')](_0x58d69b)[_0x3def('0x21')](handleEntityNotFound(_0x1f0424,null))['then'](respondWithResult(_0x1f0424,null))[_0x3def('0x41')](handleError(_0x1f0424,null));};exports[_0x3def('0x42')]=function(_0x29000b,_0x435e17){return db['UserProfileSection'][_0x3def('0x42')](_0x29000b[_0x3def('0x43')],{})[_0x3def('0x21')](respondWithResult(_0x435e17,0xc9))[_0x3def('0x41')](handleError(_0x435e17,null));};exports[_0x3def('0x44')]=function(_0xff0a31,_0x142067){if(_0xff0a31[_0x3def('0x43')]['id']){delete _0xff0a31[_0x3def('0x43')]['id'];}return db[_0x3def('0x28')]['find']({'where':{'id':_0xff0a31[_0x3def('0x3f')]['id']}})[_0x3def('0x21')](handleEntityNotFound(_0x142067,null))[_0x3def('0x21')](saveUpdates(_0xff0a31[_0x3def('0x43')],null))[_0x3def('0x21')](respondWithResult(_0x142067,null))[_0x3def('0x41')](handleError(_0x142067,null));};exports[_0x3def('0x22')]=function(_0x4aede3,_0x15c30b){return db[_0x3def('0x28')][_0x3def('0x40')]({'where':{'id':_0x4aede3[_0x3def('0x3f')]['id']}})[_0x3def('0x21')](handleEntityNotFound(_0x15c30b,null))['then'](removeEntity(_0x15c30b,null))['catch'](handleError(_0x15c30b,null));};exports[_0x3def('0x45')]=function(_0x43922c,_0x3c17fe){return db[_0x3def('0x28')][_0x3def('0x45')]()[_0x3def('0x21')](respondWithResult(_0x3c17fe,null))[_0x3def('0x41')](handleError(_0x3c17fe,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cb41114..9e24e9a 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 _0xf161=['bluebird','request-promise','rimraf','../../config/environment','exports','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','api'];(function(_0xc77de0,_0x56ffa1){var _0x351219=function(_0x3cf1b8){while(--_0x3cf1b8){_0xc77de0['push'](_0xc77de0['shift']());}};_0x351219(++_0x56ffa1);}(_0xf161,0xa2));var _0x1f16=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xf161[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0x1f16('0x0'));var util=require(_0x1f16('0x1'));var logger=require('../../config/logger')(_0x1f16('0x2'));var moment=require('moment');var BPromise=require(_0x1f16('0x3'));var rp=require(_0x1f16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f16('0x5'));var config=require(_0x1f16('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x1f16('0x7')]=function(_0x4ffc93,_0x232f9a){return _0x4ffc93['define'](_0x1f16('0x8'),attributes,{'tableName':_0x1f16('0x9'),'paranoid':![],'indexes':[{'name':_0x1f16('0xa'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x89ca=['define','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userProfileSection.attributes'];(function(_0x32603b,_0x2837f0){var _0x289b39=function(_0x44456f){while(--_0x44456f){_0x32603b['push'](_0x32603b['shift']());}};_0x289b39(++_0x2837f0);}(_0x89ca,0xe1));var _0xa89c=function(_0x2b9a68,_0x4ca98e){_0x2b9a68=_0x2b9a68-0x0;var _0x19bbe9=_0x89ca[_0x2b9a68];return _0x19bbe9;};'use strict';var _=require(_0xa89c('0x0'));var util=require(_0xa89c('0x1'));var logger=require(_0xa89c('0x2'))(_0xa89c('0x3'));var moment=require(_0xa89c('0x4'));var BPromise=require('bluebird');var rp=require(_0xa89c('0x5'));var fs=require('fs');var path=require(_0xa89c('0x6'));var rimraf=require('rimraf');var config=require(_0xa89c('0x7'));var attributes=require(_0xa89c('0x8'));module['exports']=function(_0x3d0352,_0x485611){return _0x3d0352[_0xa89c('0x9')]('UserProfileSection',attributes,{'tableName':_0xa89c('0xa'),'paranoid':![],'indexes':[{'name':_0xa89c('0xb'),'fields':['sectionId',_0xa89c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 58955b2..ca8c751 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 _0x403d=['lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x26913d,_0x306f60){var _0x242cec=function(_0x30e185){while(--_0x30e185){_0x26913d['push'](_0x26913d['shift']());}};_0x242cec(++_0x306f60);}(_0x403d,0x111));var _0xd403=function(_0x487524,_0x292ba6){_0x487524=_0x487524-0x0;var _0x3f3543=_0x403d[_0x487524];return _0x3f3543;};'use strict';var _=require(_0xd403('0x0'));var util=require(_0xd403('0x1'));var moment=require('moment');var BPromise=require(_0xd403('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd403('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd403('0x4'));var config=require(_0xd403('0x5'));var jayson=require(_0xd403('0x6'));var client=jayson[_0xd403('0x7')][_0xd403('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26110b,_0x4095bb,_0x109ea7){return new BPromise(function(_0x3f8190,_0x572675){return client[_0xd403('0x9')](_0x26110b,_0x109ea7)[_0xd403('0xa')](function(_0x3d1fe5){logger[_0xd403('0xb')](_0xd403('0xc'),_0x4095bb,_0xd403('0xd'));logger[_0xd403('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4095bb,'request\x20sent',JSON[_0xd403('0xf')](_0x3d1fe5));if(_0x3d1fe5[_0xd403('0x10')]){if(_0x3d1fe5[_0xd403('0x10')][_0xd403('0x11')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4095bb,_0x3d1fe5[_0xd403('0x10')][_0xd403('0x12')]);return _0x572675(_0x3d1fe5[_0xd403('0x10')][_0xd403('0x12')]);}logger[_0xd403('0x10')](_0xd403('0xc'),_0x4095bb,_0x3d1fe5[_0xd403('0x10')][_0xd403('0x12')]);return _0x3f8190(_0x3d1fe5[_0xd403('0x10')]['message']);}else{logger[_0xd403('0xb')](_0xd403('0xc'),_0x4095bb,'request\x20sent');_0x3f8190(_0x3d1fe5[_0xd403('0x13')]['message']);}})[_0xd403('0x14')](function(_0x1d1abd){logger[_0xd403('0x10')](_0xd403('0xc'),_0x4095bb,_0x1d1abd);_0x572675(_0x1d1abd);});});} \ No newline at end of file +var _0xd3d7=['../../config/utils','rpc','jayson/promise','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1efc61,_0x358794){var _0x4205f7=function(_0x4e2002){while(--_0x4e2002){_0x1efc61['push'](_0x1efc61['shift']());}};_0x4205f7(++_0x358794);}(_0xd3d7,0x143));var _0x7d3d=function(_0x2c1fa4,_0x28e431){_0x2c1fa4=_0x2c1fa4-0x0;var _0x48daed=_0xd3d7[_0x2c1fa4];return _0x48daed;};'use strict';var _=require(_0x7d3d('0x0'));var util=require(_0x7d3d('0x1'));var moment=require(_0x7d3d('0x2'));var BPromise=require(_0x7d3d('0x3'));var rs=require(_0x7d3d('0x4'));var fs=require('fs');var Redis=require(_0x7d3d('0x5'));var db=require(_0x7d3d('0x6'))['db'];var utils=require(_0x7d3d('0x7'));var logger=require('../../config/logger')(_0x7d3d('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d3d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x449b15,_0xa8d29a,_0x23d110){return new BPromise(function(_0x8b8867,_0x377fb9){return client[_0x7d3d('0xa')](_0x449b15,_0x23d110)[_0x7d3d('0xb')](function(_0xa98368){logger[_0x7d3d('0xc')](_0x7d3d('0xd'),_0xa8d29a,_0x7d3d('0xe'));logger[_0x7d3d('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xa8d29a,'request\x20sent',JSON[_0x7d3d('0x10')](_0xa98368));if(_0xa98368[_0x7d3d('0x11')]){if(_0xa98368[_0x7d3d('0x11')][_0x7d3d('0x12')]===0x1f4){logger[_0x7d3d('0x11')](_0x7d3d('0xd'),_0xa8d29a,_0xa98368[_0x7d3d('0x11')]['message']);return _0x377fb9(_0xa98368[_0x7d3d('0x11')][_0x7d3d('0x13')]);}logger[_0x7d3d('0x11')]('UserProfileSection,\x20%s,\x20%s',_0xa8d29a,_0xa98368[_0x7d3d('0x11')][_0x7d3d('0x13')]);return _0x8b8867(_0xa98368[_0x7d3d('0x11')][_0x7d3d('0x13')]);}else{logger[_0x7d3d('0xc')]('UserProfileSection,\x20%s,\x20%s',_0xa8d29a,_0x7d3d('0xe'));_0x8b8867(_0xa98368[_0x7d3d('0x14')]['message']);}})[_0x7d3d('0x15')](function(_0x373d3e){logger['error'](_0x7d3d('0xd'),_0xa8d29a,_0x373d3e);_0x377fb9(_0x373d3e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d1d5b4d..45dfc70 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2ca892,_0x11af43){var _0x3d3f77=function(_0xe39e57){while(--_0xe39e57){_0x2ca892['push'](_0x2ca892['shift']());}};_0x3d3f77(++_0x11af43);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2d52cc,_0x27d161){var _0x57ae07=function(_0x1a9590){while(--_0x1a9590){_0x2d52cc['push'](_0x2d52cc['shift']());}};_0x57ae07(++_0x27d161);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31dde9,_0x12e816){_0x31dde9=_0x31dde9-0x0;var _0x1fbf2d=_0xcb91[_0x31dde9];return _0x1fbf2d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ee6ba51..da6dfb2 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 _0xacea=['INTEGER','sequelize','exports'];(function(_0x2edf51,_0x593da9){var _0x570bde=function(_0x1ae76f){while(--_0x1ae76f){_0x2edf51['push'](_0x2edf51['shift']());}};_0x570bde(++_0x593da9);}(_0xacea,0x1d2));var _0xaace=function(_0x479723,_0x1b6d50){_0x479723=_0x479723-0x0;var _0x3d1e76=_0xacea[_0x479723];return _0x3d1e76;};'use strict';var Sequelize=require(_0xaace('0x0'));module[_0xaace('0x1')]={'penalty':{'type':Sequelize[_0xaace('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa5c0=['exports','INTEGER','sequelize'];(function(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0xa5c0,0xbf));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a5c('0x0'));module[_0x0a5c('0x1')]={'penalty':{'type':Sequelize[_0x0a5c('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 698e1ce..74bcae6 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 _0x90b1=['define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x8d3a24,_0x32201a){var _0x3977ae=function(_0x895da2){while(--_0x895da2){_0x8d3a24['push'](_0x8d3a24['shift']());}};_0x3977ae(++_0x32201a);}(_0x90b1,0x1bb));var _0x190b=function(_0x1837da,_0x5e3681){_0x1837da=_0x1837da-0x0;var _0x3b0ba2=_0x90b1[_0x1837da];return _0x3b0ba2;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc359=['user_has_sms_queues','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x14be9e,_0x44e984){var _0x11fd99=function(_0x26cd70){while(--_0x26cd70){_0x14be9e['push'](_0x14be9e['shift']());}};_0x11fd99(++_0x44e984);}(_0xc359,0x1d9));var _0x9c35=function(_0x381a28,_0x4eb359){_0x381a28=_0x381a28-0x0;var _0x5e572d=_0xc359[_0x381a28];return _0x5e572d;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var logger=require('../../config/logger')(_0x9c35('0x1'));var moment=require(_0x9c35('0x2'));var BPromise=require(_0x9c35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c35('0x4'));var rimraf=require('rimraf');var config=require(_0x9c35('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0x9c35('0x6')]=function(_0x5b3ada,_0x490409){return _0x5b3ada['define']('UserSmsQueue',attributes,{'tableName':_0x9c35('0x7'),'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 003d79d..7d8fb72 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 _0xdc9c=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3c414c,_0x399dbb){var _0x4f3062=function(_0x1b71cc){while(--_0x1b71cc){_0x3c414c['push'](_0x3c414c['shift']());}};_0x4f3062(++_0x399dbb);}(_0xdc9c,0x114));var _0xcdc9=function(_0x54970d,_0x4d1401){_0x54970d=_0x54970d-0x0;var _0x1abe8f=_0xdc9c[_0x54970d];return _0x1abe8f;};'use strict';var _=require(_0xcdc9('0x0'));var util=require('util');var moment=require(_0xcdc9('0x1'));var BPromise=require(_0xcdc9('0x2'));var rs=require(_0xcdc9('0x3'));var fs=require('fs');var Redis=require(_0xcdc9('0x4'));var db=require(_0xcdc9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdc9('0x6'))(_0xcdc9('0x7'));var config=require(_0xcdc9('0x8'));var jayson=require(_0xcdc9('0x9'));var client=jayson[_0xcdc9('0xa')][_0xcdc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c4cc7,_0x543e69,_0x13d385){return new BPromise(function(_0x2be415,_0x1a4817){return client[_0xcdc9('0xc')](_0x3c4cc7,_0x13d385)[_0xcdc9('0xd')](function(_0x48dc2c){logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x543e69,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x543e69,_0xcdc9('0x10'),JSON[_0xcdc9('0x11')](_0x48dc2c));if(_0x48dc2c[_0xcdc9('0x12')]){if(_0x48dc2c['error'][_0xcdc9('0x13')]===0x1f4){logger[_0xcdc9('0x12')](_0xcdc9('0xf'),_0x543e69,_0x48dc2c[_0xcdc9('0x12')]['message']);return _0x1a4817(_0x48dc2c['error'][_0xcdc9('0x14')]);}logger[_0xcdc9('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x543e69,_0x48dc2c[_0xcdc9('0x12')][_0xcdc9('0x14')]);return _0x2be415(_0x48dc2c[_0xcdc9('0x12')][_0xcdc9('0x14')]);}else{logger[_0xcdc9('0xe')](_0xcdc9('0xf'),_0x543e69,_0xcdc9('0x10'));_0x2be415(_0x48dc2c[_0xcdc9('0x15')][_0xcdc9('0x14')]);}})[_0xcdc9('0x16')](function(_0x427639){logger[_0xcdc9('0x12')](_0xcdc9('0xf'),_0x543e69,_0x427639);_0x1a4817(_0x427639);});});} \ No newline at end of file +var _0xc71a=['error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc71a,0x148));var _0xac71=function(_0xd5b794,_0x5a52a1){_0xd5b794=_0xd5b794-0x0;var _0x4ccb5f=_0xc71a[_0xd5b794];return _0x4ccb5f;};'use strict';var _=require(_0xac71('0x0'));var util=require('util');var moment=require(_0xac71('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac71('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xac71('0x3'))(_0xac71('0x4'));var config=require(_0xac71('0x5'));var jayson=require(_0xac71('0x6'));var client=jayson[_0xac71('0x7')][_0xac71('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x785558,_0x1f6970,_0x4cd06f){return new BPromise(function(_0x53f75f,_0xbe4a4b){return client['request'](_0x785558,_0x4cd06f)[_0xac71('0x9')](function(_0x27fcd4){logger[_0xac71('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x1f6970,_0xac71('0xb'));logger[_0xac71('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1f6970,_0xac71('0xb'),JSON[_0xac71('0xd')](_0x27fcd4));if(_0x27fcd4[_0xac71('0xe')]){if(_0x27fcd4['error'][_0xac71('0xf')]===0x1f4){logger['error'](_0xac71('0x10'),_0x1f6970,_0x27fcd4[_0xac71('0xe')]['message']);return _0xbe4a4b(_0x27fcd4[_0xac71('0xe')]['message']);}logger['error'](_0xac71('0x10'),_0x1f6970,_0x27fcd4[_0xac71('0xe')][_0xac71('0x11')]);return _0x53f75f(_0x27fcd4['error'][_0xac71('0x11')]);}else{logger[_0xac71('0xa')](_0xac71('0x10'),_0x1f6970,_0xac71('0xb'));_0x53f75f(_0x27fcd4[_0xac71('0x12')][_0xac71('0x11')]);}})['catch'](function(_0x339e87){logger[_0xac71('0xe')](_0xac71('0x10'),_0x1f6970,_0x339e87);_0xbe4a4b(_0x339e87);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ed6da42..b7bd605 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 _0xa304=['exports','INTEGER','sequelize'];(function(_0x574d53,_0x11971c){var _0x23c94e=function(_0x23c12c){while(--_0x23c12c){_0x574d53['push'](_0x574d53['shift']());}};_0x23c94e(++_0x11971c);}(_0xa304,0x113));var _0x4a30=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0xa304[_0x4629ed];return _0x52ca04;};'use strict';var Sequelize=require(_0x4a30('0x0'));module[_0x4a30('0x1')]={'UserId':{'type':Sequelize[_0x4a30('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4a30('0x2')]}}; \ No newline at end of file +var _0xa876=['INTEGER','exports'];(function(_0x39d269,_0x5c2a37){var _0x1cf9e7=function(_0x1d77ab){while(--_0x1d77ab){_0x39d269['push'](_0x39d269['shift']());}};_0x1cf9e7(++_0x5c2a37);}(_0xa876,0x13d));var _0x6a87=function(_0x3a1a51,_0x14c470){_0x3a1a51=_0x3a1a51-0x0;var _0xa43104=_0xa876[_0x3a1a51];return _0xa43104;};'use strict';var Sequelize=require('sequelize');module[_0x6a87('0x0')]={'UserId':{'type':Sequelize[_0x6a87('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x6a87('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e74a222..fa62240 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(_0x260a52,_0x282428){var _0x400724=function(_0x3c86a9){while(--_0x3c86a9){_0x260a52['push'](_0x260a52['shift']());}};_0x400724(++_0x282428);}(_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(_0xdb5f22,_0x1805e2){var _0x2d36c6=function(_0x399110){while(--_0x399110){_0xdb5f22['push'](_0xdb5f22['shift']());}};_0x2d36c6(++_0x1805e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 c614e30..0726baa 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x14a79a,_0x281ce9){var _0x55d55b=function(_0x1cd245){while(--_0x1cd245){_0x14a79a['push'](_0x14a79a['shift']());}};_0x55d55b(++_0x281ce9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3a4541,_0x22c9d8){var _0x4b9448=function(_0x533e29){while(--_0x533e29){_0x3a4541['push'](_0x3a4541['shift']());}};_0x4b9448(++_0x22c9d8);}(_0x70e0,0x17b));var _0x070e=function(_0x41836d,_0x3881c7){_0x41836d=_0x41836d-0x0;var _0x1674f3=_0x70e0[_0x41836d];return _0x1674f3;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 3220a54..5768977 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 _0x0699=['INTEGER','sequelize','exports'];(function(_0x2c9b5e,_0x4dc264){var _0x218887=function(_0x5e86e8){while(--_0x5e86e8){_0x2c9b5e['push'](_0x2c9b5e['shift']());}};_0x218887(++_0x4dc264);}(_0x0699,0x181));var _0x9069=function(_0x40bd07,_0x1cc48f){_0x40bd07=_0x40bd07-0x0;var _0x34562b=_0x0699[_0x40bd07];return _0x34562b;};'use strict';var Sequelize=require(_0x9069('0x0'));module[_0x9069('0x1')]={'penalty':{'type':Sequelize[_0x9069('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa506=['INTEGER','exports'];(function(_0x4539ee,_0x5757ab){var _0x2a6f5f=function(_0x4d64fa){while(--_0x4d64fa){_0x4539ee['push'](_0x4539ee['shift']());}};_0x2a6f5f(++_0x5757ab);}(_0xa506,0x181));var _0x6a50=function(_0x210a98,_0x10cd6f){_0x210a98=_0x210a98-0x0;var _0x5c0b10=_0xa506[_0x210a98];return _0x5c0b10;};'use strict';var Sequelize=require('sequelize');module[_0x6a50('0x0')]={'penalty':{'type':Sequelize[_0x6a50('0x1')],'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 984149c..fce7c16 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 _0x326a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x489df9,_0x5d63b8){var _0x1f2679=function(_0x4de304){while(--_0x4de304){_0x489df9['push'](_0x489df9['shift']());}};_0x1f2679(++_0x5d63b8);}(_0x326a,0x131));var _0xa326=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x326a[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var logger=require(_0xa326('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa326('0x3'));var rp=require(_0xa326('0x4'));var fs=require('fs');var path=require(_0xa326('0x5'));var rimraf=require(_0xa326('0x6'));var config=require(_0xa326('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0xa326('0x8')]=function(_0x4590ae,_0x2a1425){return _0x4590ae['define'](_0xa326('0x9'),attributes,{'tableName':_0xa326('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd18=['./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0xcd18,0xff));var _0x8cd1=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xcd18[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0x8cd1('0x0'));var util=require(_0x8cd1('0x1'));var logger=require(_0x8cd1('0x2'))(_0x8cd1('0x3'));var moment=require(_0x8cd1('0x4'));var BPromise=require('bluebird');var rp=require(_0x8cd1('0x5'));var fs=require('fs');var path=require(_0x8cd1('0x6'));var rimraf=require(_0x8cd1('0x7'));var config=require(_0x8cd1('0x8'));var attributes=require(_0x8cd1('0x9'));module[_0x8cd1('0xa')]=function(_0x2653c1,_0x471c11){return _0x2653c1['define']('UserVoiceQueue',attributes,{'tableName':_0x8cd1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 38454e5..75870c3 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 _0xf83d=['jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x159fec,_0xa2a8c){var _0x5ea21a=function(_0x409153){while(--_0x409153){_0x159fec['push'](_0x159fec['shift']());}};_0x5ea21a(++_0xa2a8c);}(_0xf83d,0x162));var _0xdf83=function(_0x49dbb6,_0xa76da7){_0x49dbb6=_0x49dbb6-0x0;var _0x435e02=_0xf83d[_0x49dbb6];return _0x435e02;};'use strict';var _=require('lodash');var util=require(_0xdf83('0x0'));var moment=require(_0xdf83('0x1'));var BPromise=require('bluebird');var rs=require(_0xdf83('0x2'));var fs=require('fs');var Redis=require(_0xdf83('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf83('0x4'));var logger=require('../../config/logger')(_0xdf83('0x5'));var config=require(_0xdf83('0x6'));var jayson=require(_0xdf83('0x7'));var client=jayson[_0xdf83('0x8')][_0xdf83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34e4da,_0x38b999,_0x224290){return new BPromise(function(_0x35ba64,_0x17b910){return client['request'](_0x34e4da,_0x224290)[_0xdf83('0xa')](function(_0x45c163){logger['info'](_0xdf83('0xb'),_0x38b999,_0xdf83('0xc'));logger[_0xdf83('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x38b999,_0xdf83('0xc'),JSON[_0xdf83('0xe')](_0x45c163));if(_0x45c163[_0xdf83('0xf')]){if(_0x45c163['error']['code']===0x1f4){logger[_0xdf83('0xf')](_0xdf83('0xb'),_0x38b999,_0x45c163[_0xdf83('0xf')][_0xdf83('0x10')]);return _0x17b910(_0x45c163[_0xdf83('0xf')][_0xdf83('0x10')]);}logger[_0xdf83('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x38b999,_0x45c163[_0xdf83('0xf')]['message']);return _0x35ba64(_0x45c163[_0xdf83('0xf')][_0xdf83('0x10')]);}else{logger['info'](_0xdf83('0xb'),_0x38b999,'request\x20sent');_0x35ba64(_0x45c163[_0xdf83('0x11')][_0xdf83('0x10')]);}})[_0xdf83('0x12')](function(_0xb7272b){logger[_0xdf83('0xf')](_0xdf83('0xb'),_0x38b999,_0xb7272b);_0x17b910(_0xb7272b);});});} \ No newline at end of file +var _0xf048=['jayson/promise','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xf048,0x8a));var _0x8f04=function(_0x568d79,_0x344656){_0x568d79=_0x568d79-0x0;var _0x5613ea=_0xf048[_0x568d79];return _0x5613ea;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8f04('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f04('0x1'));var db=require(_0x8f04('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f04('0x3'))(_0x8f04('0x4'));var config=require(_0x8f04('0x5'));var jayson=require(_0x8f04('0x6'));var client=jayson['client'][_0x8f04('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2be49b,_0xcae4a7,_0xd009c0){return new BPromise(function(_0x535ea6,_0x10475b){return client['request'](_0x2be49b,_0xd009c0)[_0x8f04('0x8')](function(_0x4881ba){logger[_0x8f04('0x9')](_0x8f04('0xa'),_0xcae4a7,_0x8f04('0xb'));logger[_0x8f04('0xc')](_0x8f04('0xd'),_0xcae4a7,_0x8f04('0xb'),JSON[_0x8f04('0xe')](_0x4881ba));if(_0x4881ba[_0x8f04('0xf')]){if(_0x4881ba[_0x8f04('0xf')]['code']===0x1f4){logger[_0x8f04('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0xcae4a7,_0x4881ba[_0x8f04('0xf')][_0x8f04('0x10')]);return _0x10475b(_0x4881ba['error'][_0x8f04('0x10')]);}logger[_0x8f04('0xf')](_0x8f04('0xa'),_0xcae4a7,_0x4881ba[_0x8f04('0xf')][_0x8f04('0x10')]);return _0x535ea6(_0x4881ba[_0x8f04('0xf')][_0x8f04('0x10')]);}else{logger['info'](_0x8f04('0xa'),_0xcae4a7,_0x8f04('0xb'));_0x535ea6(_0x4881ba[_0x8f04('0x11')][_0x8f04('0x10')]);}})['catch'](function(_0x4aae7d){logger[_0x8f04('0xf')](_0x8f04('0xa'),_0xcae4a7,_0x4aae7d);_0x10475b(_0x4aae7d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 04d07b1..16de3a2 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x48f62a,_0x1b3782){var _0x4ebe15=function(_0x7f7728){while(--_0x7f7728){_0x48f62a['push'](_0x48f62a['shift']());}};_0x4ebe15(++_0x1b3782);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xa599e2,_0x3046be){var _0x122f49=function(_0x4f3d6d){while(--_0x4f3d6d){_0xa599e2['push'](_0xa599e2['shift']());}};_0x122f49(++_0x3046be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 7bca581..2631381 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 _0x179d=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x179d,0xce));var _0xd179=function(_0x51f740,_0x5040e7){_0x51f740=_0x51f740-0x0;var _0x1442c7=_0x179d[_0x51f740];return _0x1442c7;};'use strict';var Sequelize=require(_0xd179('0x0'));module[_0xd179('0x1')]={'uniqueid':{'type':Sequelize[_0xd179('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd179('0x3')},'membername':{'type':Sequelize[_0xd179('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xd179('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd179('0x4')],'allowNull':![],'unique':_0xd179('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xd179('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xd179('0x4')],'allowNull':![],'unique':_0xd179('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xd179('0x2')](0xb),'defaultValue':0x0,'comment':_0xd179('0x3')},'paused':{'type':Sequelize[_0xd179('0x2')](0xb),'defaultValue':0x0,'comment':_0xd179('0x3')}}; \ No newline at end of file +var _0x4fda=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fda,0x9a));var _0xa4fd=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x4fda[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0xa4fd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa4fd('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa4fd('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa4fd('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa4fd('0x3')],'allowNull':![],'unique':_0xa4fd('0x4'),'comment':_0xa4fd('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xa4fd('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xa4fd('0x1')](0xb),'defaultValue':0x0,'comment':_0xa4fd('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa4fd('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index d88d02e..cfd69b1 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 _0x9d19=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xe29886,_0x16714d){var _0x4b8bf4=function(_0x36f075){while(--_0x36f075){_0xe29886['push'](_0xe29886['shift']());}};_0x4b8bf4(++_0x16714d);}(_0x9d19,0xfa));var _0x99d1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x9d19[_0x4baae2];return _0x1a2285;};'use strict';var EventEmitter=require(_0x99d1('0x0'));var UserVoiceQueueRt=require(_0x99d1('0x1'))['db'][_0x99d1('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x99d1('0x3')](0x0);var events={'afterCreate':_0x99d1('0x4'),'afterUpdate':_0x99d1('0x5'),'afterDestroy':_0x99d1('0x6')};function emitEvent(_0x3ba592){return function(_0x14828f,_0x1b094a,_0x4324c3){UserVoiceQueueRtEvents['emit'](_0x3ba592+':'+_0x14828f['id'],_0x14828f);UserVoiceQueueRtEvents[_0x99d1('0x7')](_0x3ba592,_0x14828f);_0x4324c3(null);};}for(var e in events){if(events[_0x99d1('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x99d1('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x45d0=['emit','hasOwnProperty','exports','events','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x80d516,_0x469cca){var _0x1ea80e=function(_0x141af8){while(--_0x141af8){_0x80d516['push'](_0x80d516['shift']());}};_0x1ea80e(++_0x469cca);}(_0x45d0,0x81));var _0x045d=function(_0x4180c0,_0x5c70e5){_0x4180c0=_0x4180c0-0x0;var _0x547bf7=_0x45d0[_0x4180c0];return _0x547bf7;};'use strict';var EventEmitter=require(_0x045d('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x045d('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x045d('0x2')](0x0);var events={'afterCreate':_0x045d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2fdfd7){return function(_0x13ae1c,_0x5ee7aa,_0x27c053){UserVoiceQueueRtEvents['emit'](_0x2fdfd7+':'+_0x13ae1c['id'],_0x13ae1c);UserVoiceQueueRtEvents[_0x045d('0x4')](_0x2fdfd7,_0x13ae1c);_0x27c053(null);};}for(var e in events){if(events[_0x045d('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x045d('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b2639d0..f02364c 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 _0x16af=['rimraf','./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','lodash','api','moment','request-promise','path'];(function(_0x2c959b,_0x268959){var _0xa8b43d=function(_0x4a088a){while(--_0x4a088a){_0x2c959b['push'](_0x2c959b['shift']());}};_0xa8b43d(++_0x268959);}(_0x16af,0xe5));var _0xf16a=function(_0x3af23e,_0x778b08){_0x3af23e=_0x3af23e-0x0;var _0x3d7dd9=_0x16af[_0x3af23e];return _0x3d7dd9;};'use strict';var _=require(_0xf16a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf16a('0x1'));var moment=require(_0xf16a('0x2'));var BPromise=require('bluebird');var rp=require(_0xf16a('0x3'));var fs=require('fs');var path=require(_0xf16a('0x4'));var rimraf=require(_0xf16a('0x5'));var config=require('../../config/environment');var attributes=require(_0xf16a('0x6'));module['exports']=function(_0x43756f,_0x3efc34){return _0x43756f[_0xf16a('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xf16a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18a7=['api','bluebird','request-promise','path','rimraf','exports','define','lodash'];(function(_0x19ea87,_0x38f53f){var _0x4f6bee=function(_0x58e8c0){while(--_0x58e8c0){_0x19ea87['push'](_0x19ea87['shift']());}};_0x4f6bee(++_0x38f53f);}(_0x18a7,0x147));var _0x718a=function(_0x174b34,_0xe54bcd){_0x174b34=_0x174b34-0x0;var _0x384bce=_0x18a7[_0x174b34];return _0x384bce;};'use strict';var _=require(_0x718a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x718a('0x1'));var moment=require('moment');var BPromise=require(_0x718a('0x2'));var rp=require(_0x718a('0x3'));var fs=require('fs');var path=require(_0x718a('0x4'));var rimraf=require(_0x718a('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0x718a('0x6')]=function(_0x3f873c,_0x3d455f){return _0x3f873c[_0x718a('0x7')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','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 ba8bf03..150afd9 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 _0x0803=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','info','result','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','lodash','util','bluebird','randomstring'];(function(_0x407c58,_0x4135a8){var _0x3a733d=function(_0x37e31d){while(--_0x37e31d){_0x407c58['push'](_0x407c58['shift']());}};_0x3a733d(++_0x4135a8);}(_0x0803,0x9c));var _0x3080=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0803[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3080('0x0'));var util=require(_0x3080('0x1'));var moment=require('moment');var BPromise=require(_0x3080('0x2'));var rs=require(_0x3080('0x3'));var fs=require('fs');var Redis=require(_0x3080('0x4'));var db=require(_0x3080('0x5'))['db'];var utils=require(_0x3080('0x6'));var logger=require(_0x3080('0x7'))(_0x3080('0x8'));var config=require(_0x3080('0x9'));var jayson=require(_0x3080('0xa'));var client=jayson[_0x3080('0xb')][_0x3080('0xc')]({'port':0x232a});config['redis']=_[_0x3080('0xd')](config[_0x3080('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3080('0xf'))(new Redis(config['redis']));require(_0x3080('0x10'))[_0x3080('0x11')](socket);function respondWithRpcPromise(_0x32d5b9,_0x32cc79,_0x2d96b3){return new BPromise(function(_0x3529ce,_0xc3ed80){return client[_0x3080('0x12')](_0x32d5b9,_0x2d96b3)[_0x3080('0x13')](function(_0x2fbf89){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x32cc79,_0x3080('0x14'));logger[_0x3080('0x15')](_0x3080('0x16'),_0x32cc79,_0x3080('0x14'),JSON[_0x3080('0x17')](_0x2fbf89));if(_0x2fbf89[_0x3080('0x18')]){if(_0x2fbf89['error'][_0x3080('0x19')]===0x1f4){logger[_0x3080('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x32cc79,_0x2fbf89[_0x3080('0x18')][_0x3080('0x1a')]);return _0xc3ed80(_0x2fbf89[_0x3080('0x18')][_0x3080('0x1a')]);}logger[_0x3080('0x18')](_0x3080('0x1b'),_0x32cc79,_0x2fbf89[_0x3080('0x18')][_0x3080('0x1a')]);return _0x3529ce(_0x2fbf89[_0x3080('0x18')][_0x3080('0x1a')]);}else{logger[_0x3080('0x1c')](_0x3080('0x1b'),_0x32cc79,_0x3080('0x14'));_0x3529ce(_0x2fbf89[_0x3080('0x1d')][_0x3080('0x1a')]);}})[_0x3080('0x1e')](function(_0x178386){logger[_0x3080('0x18')](_0x3080('0x1b'),_0x32cc79,_0x178386);_0xc3ed80(_0x178386);});});}exports['GetVoiceQueueRtPauses']=function(_0x1d1016){var _0x2a8740=this;return new Promise(function(_0x3e64cb,_0x102614){return db[_0x3080('0x1f')][_0x3080('0x20')]({'raw':_0x1d1016['options']?_0x1d1016[_0x3080('0x21')][_0x3080('0x22')]===undefined?!![]:![]:!![],'where':_0x1d1016[_0x3080('0x21')]?_0x1d1016[_0x3080('0x21')]['where']||null:null,'attributes':[[db[_0x3080('0x23')]['fn'](_0x3080('0x24'),db[_0x3080('0x23')]['fn']('IF',db[_0x3080('0x23')][_0x3080('0x25')](_0x3080('0x26')))),'outboundQueuePauses']]})[_0x3080('0x13')](function(_0x2f73a7){logger[_0x3080('0x1c')]('GetVoiceQueueRtPauses',_0x1d1016);logger[_0x3080('0x15')](_0x3080('0x27'),_0x1d1016,JSON[_0x3080('0x17')](_0x2f73a7));_0x3e64cb(_0x2f73a7);})[_0x3080('0x1e')](function(_0xe21a9f){logger[_0x3080('0x18')](_0x3080('0x27'),_0xe21a9f[_0x3080('0x1a')],_0x1d1016);_0x102614(_0x2a8740[_0x3080('0x18')](0x1f4,_0xe21a9f[_0x3080('0x1a')]));});});}; \ No newline at end of file +var _0x15ec=['socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost'];(function(_0x341ebe,_0xdb3686){var _0x4179d0=function(_0x3dcced){while(--_0x3dcced){_0x341ebe['push'](_0x341ebe['shift']());}};_0x4179d0(++_0xdb3686);}(_0x15ec,0xe7));var _0xc15e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x15ec[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc15e('0x0'));var util=require(_0xc15e('0x1'));var moment=require(_0xc15e('0x2'));var BPromise=require(_0xc15e('0x3'));var rs=require(_0xc15e('0x4'));var fs=require('fs');var Redis=require(_0xc15e('0x5'));var db=require(_0xc15e('0x6'))['db'];var utils=require(_0xc15e('0x7'));var logger=require('../../config/logger')(_0xc15e('0x8'));var config=require(_0xc15e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc15e('0xa')]['http']({'port':0x232a});config[_0xc15e('0xb')]=_[_0xc15e('0xc')](config[_0xc15e('0xb')],{'host':_0xc15e('0xd'),'port':0x18eb});var socket=require(_0xc15e('0xe'))(new Redis(config[_0xc15e('0xb')]));require(_0xc15e('0xf'))[_0xc15e('0x10')](socket);function respondWithRpcPromise(_0x1c6cf0,_0xd71f99,_0x3f3d34){return new BPromise(function(_0x390a3c,_0x59202b){return client[_0xc15e('0x11')](_0x1c6cf0,_0x3f3d34)['then'](function(_0x232bfb){logger[_0xc15e('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xd71f99,_0xc15e('0x13'));logger[_0xc15e('0x14')](_0xc15e('0x15'),_0xd71f99,'request\x20sent',JSON[_0xc15e('0x16')](_0x232bfb));if(_0x232bfb[_0xc15e('0x17')]){if(_0x232bfb[_0xc15e('0x17')]['code']===0x1f4){logger[_0xc15e('0x17')](_0xc15e('0x18'),_0xd71f99,_0x232bfb[_0xc15e('0x17')]['message']);return _0x59202b(_0x232bfb[_0xc15e('0x17')][_0xc15e('0x19')]);}logger[_0xc15e('0x17')](_0xc15e('0x18'),_0xd71f99,_0x232bfb[_0xc15e('0x17')][_0xc15e('0x19')]);return _0x390a3c(_0x232bfb[_0xc15e('0x17')][_0xc15e('0x19')]);}else{logger[_0xc15e('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xd71f99,_0xc15e('0x13'));_0x390a3c(_0x232bfb[_0xc15e('0x1a')][_0xc15e('0x19')]);}})[_0xc15e('0x1b')](function(_0x39679c){logger['error'](_0xc15e('0x18'),_0xd71f99,_0x39679c);_0x59202b(_0x39679c);});});}exports['GetVoiceQueueRtPauses']=function(_0x25a10a){var _0xcc41b9=this;return new Promise(function(_0x3cbca2,_0xacb477){return db[_0xc15e('0x1c')][_0xc15e('0x1d')]({'raw':_0x25a10a[_0xc15e('0x1e')]?_0x25a10a[_0xc15e('0x1e')][_0xc15e('0x1f')]===undefined?!![]:![]:!![],'where':_0x25a10a[_0xc15e('0x1e')]?_0x25a10a[_0xc15e('0x1e')]['where']||null:null,'attributes':[[db[_0xc15e('0x20')]['fn'](_0xc15e('0x21'),db[_0xc15e('0x20')]['fn']('IF',db['sequelize']['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})['then'](function(_0x40ec7a){logger[_0xc15e('0x12')](_0xc15e('0x22'),_0x25a10a);logger[_0xc15e('0x14')]('GetVoiceQueueRtPauses',_0x25a10a,JSON[_0xc15e('0x16')](_0x40ec7a));_0x3cbca2(_0x40ec7a);})[_0xc15e('0x1b')](function(_0x12dedc){logger[_0xc15e('0x17')](_0xc15e('0x22'),_0x12dedc[_0xc15e('0x19')],_0x25a10a);_0xacb477(_0xcc41b9[_0xc15e('0x17')](0x1f4,_0x12dedc[_0xc15e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7af7fc8..d1b03fc 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 _0xc73a=['register','length','save','remove','update','emit','removeListener'];(function(_0x58c09e,_0x16ae6f){var _0x47636a=function(_0x241b56){while(--_0x241b56){_0x58c09e['push'](_0x58c09e['shift']());}};_0x47636a(++_0x16ae6f);}(_0xc73a,0x72));var _0xac73=function(_0x5e980f,_0x20acb5){_0x5e980f=_0x5e980f-0x0;var _0x2b366d=_0xc73a[_0x5e980f];return _0x2b366d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xac73('0x0'),_0xac73('0x1'),_0xac73('0x2')];function createListener(_0x4eb4db,_0x5dac0f){return function(_0x32e40e){_0x5dac0f[_0xac73('0x3')](_0x4eb4db,_0x32e40e);};}function removeListener(_0x36d689,_0x53ef2e){return function(){UserVoiceQueueRtEvents[_0xac73('0x4')](_0x36d689,_0x53ef2e);};}exports[_0xac73('0x5')]=function(_0x23fa68){for(var _0x57992a=0x0,_0x9eb408=events[_0xac73('0x6')];_0x57992a<_0x9eb408;_0x57992a++){var _0x1cc38a=events[_0x57992a];var _0x22638a=createListener('userVoiceQueueRt:'+_0x1cc38a,_0x23fa68);UserVoiceQueueRtEvents['on'](_0x1cc38a,_0x22638a);}}; \ No newline at end of file +var _0xedf2=['save','remove','update','userVoiceQueueRt:'];(function(_0x8f75c4,_0x5dac6f){var _0x37c2d4=function(_0x3cdb8f){while(--_0x3cdb8f){_0x8f75c4['push'](_0x8f75c4['shift']());}};_0x37c2d4(++_0x5dac6f);}(_0xedf2,0x1ac));var _0x2edf=function(_0x4bcb21,_0x48db18){_0x4bcb21=_0x4bcb21-0x0;var _0x75825=_0xedf2[_0x4bcb21];return _0x75825;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x2edf('0x0'),_0x2edf('0x1'),_0x2edf('0x2')];function createListener(_0x4b454e,_0xce87f7){return function(_0x1ad605){_0xce87f7['emit'](_0x4b454e,_0x1ad605);};}function removeListener(_0x43611a,_0x2c1515){return function(){UserVoiceQueueRtEvents['removeListener'](_0x43611a,_0x2c1515);};}exports['register']=function(_0x3cfc52){for(var _0x3601aa=0x0,_0x5af8d9=events['length'];_0x3601aa<_0x5af8d9;_0x3601aa++){var _0x2b7b21=events[_0x3601aa];var _0x498c41=createListener(_0x2edf('0x3')+_0x2b7b21,_0x3cfc52);UserVoiceQueueRtEvents['on'](_0x2b7b21,_0x498c41);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d9d7a9a..fc2d1f6 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(_0x429257,_0x4379bd){var _0x51c104=function(_0x1f1af2){while(--_0x1f1af2){_0x429257['push'](_0x429257['shift']());}};_0x51c104(++_0x4379bd);}(_0x70e0,0x17b));var _0x070e=function(_0x112000,_0x4d2bc0){_0x112000=_0x112000-0x0;var _0x2a64b4=_0x70e0[_0x112000];return _0x2a64b4;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1cee55,_0xe75188){var _0x4f640a=function(_0x550c43){while(--_0x550c43){_0x1cee55['push'](_0x1cee55['shift']());}};_0x4f640a(++_0xe75188);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f038e17..9e645ba 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 _0x0a9e=['sequelize','exports','INTEGER'];(function(_0x1c1680,_0x498198){var _0x937fc9=function(_0xacc79d){while(--_0xacc79d){_0x1c1680['push'](_0x1c1680['shift']());}};_0x937fc9(++_0x498198);}(_0x0a9e,0x1c5));var _0xe0a9=function(_0x2c5c40,_0x3a3487){_0x2c5c40=_0x2c5c40-0x0;var _0x5394c7=_0x0a9e[_0x2c5c40];return _0x5394c7;};'use strict';var Sequelize=require(_0xe0a9('0x0'));module[_0xe0a9('0x1')]={'penalty':{'type':Sequelize[_0xe0a9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa0d3=['sequelize','INTEGER'];(function(_0x1be03d,_0x46cccf){var _0x45aeda=function(_0x5d9a0a){while(--_0x5d9a0a){_0x1be03d['push'](_0x1be03d['shift']());}};_0x45aeda(++_0x46cccf);}(_0xa0d3,0x1a2));var _0x3a0d=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xa0d3[_0x39e84d];return _0x1991bc;};'use strict';var Sequelize=require(_0x3a0d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3a0d('0x1')],'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 c971c2d..52eadc1 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 _0x69ed=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x3a1058,_0x255329){var _0x2509c5=function(_0x5a06fe){while(--_0x5a06fe){_0x3a1058['push'](_0x3a1058['shift']());}};_0x2509c5(++_0x255329);}(_0x69ed,0x138));var _0xd69e=function(_0x3c4d76,_0x2d422e){_0x3c4d76=_0x3c4d76-0x0;var _0x30fd44=_0x69ed[_0x3c4d76];return _0x30fd44;};'use strict';var _=require(_0xd69e('0x0'));var util=require(_0xd69e('0x1'));var logger=require(_0xd69e('0x2'))(_0xd69e('0x3'));var moment=require(_0xd69e('0x4'));var BPromise=require('bluebird');var rp=require(_0xd69e('0x5'));var fs=require('fs');var path=require(_0xd69e('0x6'));var rimraf=require(_0xd69e('0x7'));var config=require('../../config/environment');var attributes=require(_0xd69e('0x8'));module[_0xd69e('0x9')]=function(_0x4f1ab7,_0x2c04a6){return _0x4f1ab7[_0xd69e('0xa')](_0xd69e('0xb'),attributes,{'tableName':_0xd69e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4e3=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x31b6a3,_0x2b372d){var _0x4f7cb2=function(_0x3bb86a){while(--_0x3bb86a){_0x31b6a3['push'](_0x31b6a3['shift']());}};_0x4f7cb2(++_0x2b372d);}(_0xd4e3,0x138));var _0x3d4e=function(_0x441315,_0x55af18){_0x441315=_0x441315-0x0;var _0x3f360c=_0xd4e3[_0x441315];return _0x3f360c;};'use strict';var _=require('lodash');var util=require(_0x3d4e('0x0'));var logger=require('../../config/logger')(_0x3d4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3d4e('0x2'));var fs=require('fs');var path=require(_0x3d4e('0x3'));var rimraf=require(_0x3d4e('0x4'));var config=require(_0x3d4e('0x5'));var attributes=require(_0x3d4e('0x6'));module[_0x3d4e('0x7')]=function(_0x2af4dd,_0x2ea112){return _0x2af4dd['define'](_0x3d4e('0x8'),attributes,{'tableName':_0x3d4e('0x9'),'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 e220e96..7cb5eca 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 _0x8c2f=['../../config/utils','rpc','../../config/environment','client','http','then','request\x20sent','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','ioredis'];(function(_0x296e27,_0x3410f5){var _0x1fc4c4=function(_0x22cce2){while(--_0x22cce2){_0x296e27['push'](_0x296e27['shift']());}};_0x1fc4c4(++_0x3410f5);}(_0x8c2f,0x176));var _0xf8c2=function(_0x56968c,_0x1e4877){_0x56968c=_0x56968c-0x0;var _0x3e3524=_0x8c2f[_0x56968c];return _0x3e3524;};'use strict';var _=require(_0xf8c2('0x0'));var util=require(_0xf8c2('0x1'));var moment=require('moment');var BPromise=require(_0xf8c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8c2('0x4'));var logger=require('../../config/logger')(_0xf8c2('0x5'));var config=require(_0xf8c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf8c2('0x7')][_0xf8c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11f282,_0xf2558c,_0x2bb02a){return new BPromise(function(_0x298f84,_0x3cc474){return client['request'](_0x11f282,_0x2bb02a)[_0xf8c2('0x9')](function(_0x3dd50c){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0xf2558c,_0xf8c2('0xa'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0xf2558c,_0xf8c2('0xa'),JSON[_0xf8c2('0xb')](_0x3dd50c));if(_0x3dd50c[_0xf8c2('0xc')]){if(_0x3dd50c[_0xf8c2('0xc')][_0xf8c2('0xd')]===0x1f4){logger[_0xf8c2('0xc')](_0xf8c2('0xe'),_0xf2558c,_0x3dd50c[_0xf8c2('0xc')][_0xf8c2('0xf')]);return _0x3cc474(_0x3dd50c[_0xf8c2('0xc')][_0xf8c2('0xf')]);}logger[_0xf8c2('0xc')](_0xf8c2('0xe'),_0xf2558c,_0x3dd50c['error'][_0xf8c2('0xf')]);return _0x298f84(_0x3dd50c['error']['message']);}else{logger[_0xf8c2('0x10')](_0xf8c2('0xe'),_0xf2558c,_0xf8c2('0xa'));_0x298f84(_0x3dd50c['result'][_0xf8c2('0xf')]);}})[_0xf8c2('0x11')](function(_0x4f7179){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0xf2558c,_0x4f7179);_0x3cc474(_0x4f7179);});});} \ No newline at end of file +var _0x517a=['randomstring','ioredis','../../config/logger','rpc','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1640c1,_0x4d6e1c){var _0x436883=function(_0x4ae471){while(--_0x4ae471){_0x1640c1['push'](_0x1640c1['shift']());}};_0x436883(++_0x4d6e1c);}(_0x517a,0xd4));var _0xa517=function(_0x21ef1d,_0xbfa6e){_0x21ef1d=_0x21ef1d-0x0;var _0x2dcdf0=_0x517a[_0x21ef1d];return _0x2dcdf0;};'use strict';var _=require(_0xa517('0x0'));var util=require(_0xa517('0x1'));var moment=require(_0xa517('0x2'));var BPromise=require(_0xa517('0x3'));var rs=require(_0xa517('0x4'));var fs=require('fs');var Redis=require(_0xa517('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa517('0x6'))(_0xa517('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc738aa,_0x562e62,_0x425cdf){return new BPromise(function(_0x274178,_0x49e852){return client[_0xa517('0x8')](_0xc738aa,_0x425cdf)[_0xa517('0x9')](function(_0x2356fc){logger[_0xa517('0xa')](_0xa517('0xb'),_0x562e62,'request\x20sent');logger[_0xa517('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x562e62,_0xa517('0xd'),JSON['stringify'](_0x2356fc));if(_0x2356fc[_0xa517('0xe')]){if(_0x2356fc[_0xa517('0xe')][_0xa517('0xf')]===0x1f4){logger['error'](_0xa517('0xb'),_0x562e62,_0x2356fc[_0xa517('0xe')][_0xa517('0x10')]);return _0x49e852(_0x2356fc['error'][_0xa517('0x10')]);}logger[_0xa517('0xe')](_0xa517('0xb'),_0x562e62,_0x2356fc[_0xa517('0xe')]['message']);return _0x274178(_0x2356fc[_0xa517('0xe')]['message']);}else{logger[_0xa517('0xa')](_0xa517('0xb'),_0x562e62,_0xa517('0xd'));_0x274178(_0x2356fc[_0xa517('0x11')][_0xa517('0x10')]);}})['catch'](function(_0x146fca){logger[_0xa517('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x562e62,_0x146fca);_0x49e852(_0x146fca);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index bceda08..c78fba4 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 _0xa3e6=['../../components/interaction/service','./variable.controller','get','isAuthenticated','index','show','create','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x5669b6,_0x511dd8){var _0xb7af51=function(_0x4632a3){while(--_0x4632a3){_0x5669b6['push'](_0x5669b6['shift']());}};_0xb7af51(++_0x511dd8);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x410734,_0x1d6bc5){_0x410734=_0x410734-0x0;var _0x5ab7cd=_0xa3e6[_0x410734];return _0x5ab7cd;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var fs_extra=require(_0x6a3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6a3e('0x5'));var config=require('../../config/environment');var controller=require(_0x6a3e('0x6'));router[_0x6a3e('0x7')]('/',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0x9')]);router[_0x6a3e('0x7')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6a3e('0xb')]);router['put']('/:id',auth[_0x6a3e('0x8')](),controller['update']);router[_0x6a3e('0xc')]('/:id',auth[_0x6a3e('0x8')](),controller[_0x6a3e('0xd')]);module[_0x6a3e('0xe')]=router; \ No newline at end of file +var _0xdeb3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','create','put','update','delete','multer','util','path'];(function(_0x113a94,_0x2aa6b1){var _0x1f6441=function(_0x4a016a){while(--_0x4a016a){_0x113a94['push'](_0x113a94['shift']());}};_0x1f6441(++_0x2aa6b1);}(_0xdeb3,0xeb));var _0x3deb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xdeb3[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3deb('0x0'));var util=require(_0x3deb('0x1'));var path=require(_0x3deb('0x2'));var timeout=require(_0x3deb('0x3'));var express=require(_0x3deb('0x4'));var router=express[_0x3deb('0x5')]();var fs_extra=require(_0x3deb('0x6'));var auth=require(_0x3deb('0x7'));var interaction=require(_0x3deb('0x8'));var config=require('../../config/environment');var controller=require('./variable.controller');router['get']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xa')]);router[_0x3deb('0xb')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller['show']);router['post']('/',auth[_0x3deb('0x9')](),controller[_0x3deb('0xd')]);router[_0x3deb('0xe')](_0x3deb('0xc'),auth[_0x3deb('0x9')](),controller[_0x3deb('0xf')]);router[_0x3deb('0x10')](_0x3deb('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 4244b5e..15055dd 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 _0xfaba=['STRING','name','sequelize','exports'];(function(_0x40cd8b,_0x2fac2e){var _0x49b33b=function(_0x4b8516){while(--_0x4b8516){_0x40cd8b['push'](_0x40cd8b['shift']());}};_0x49b33b(++_0x2fac2e);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xafab('0x0'));module[_0xafab('0x1')]={'name':{'type':Sequelize[_0xafab('0x2')],'unique':_0xafab('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe389=['STRING','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe389,0x1b9));var _0x9e38=function(_0x278726,_0x1e452a){_0x278726=_0x278726-0x0;var _0x33e756=_0xe389[_0x278726];return _0x33e756;};'use strict';var Sequelize=require(_0x9e38('0x0'));module[_0x9e38('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9e38('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9e38('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index e783296..e61c978 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 _0xd622=['userProfileId','error','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','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','offset','limit','undefined','count','set','json','reject','save','update','destroy','get','Variables','UserProfileResource','then','name','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Variable','includeAll','include','rows','catch','show','params','rawAttributes','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x425811,_0x12fc69){var _0x47d6a9=function(_0x51f166){while(--_0x51f166){_0x425811['push'](_0x425811['shift']());}};_0x47d6a9(++_0x12fc69);}(_0xd622,0x197));var _0x2d62=function(_0x3d5b6b,_0x489f1b){_0x3d5b6b=_0x3d5b6b-0x0;var _0x163824=_0xd622[_0x3d5b6b];return _0x163824;};'use strict';var emlformat=require(_0x2d62('0x0'));var rimraf=require(_0x2d62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d62('0x2'));var rp=require(_0x2d62('0x3'));var moment=require(_0x2d62('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d62('0x5'));var util=require(_0x2d62('0x6'));var path=require(_0x2d62('0x7'));var sox=require(_0x2d62('0x8'));var csv=require(_0x2d62('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d62('0xa'));var _=require(_0x2d62('0xb'));var squel=require(_0x2d62('0xc'));var crypto=require(_0x2d62('0xd'));var jsforce=require(_0x2d62('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d62('0x9'));var querystring=require(_0x2d62('0xf'));var Papa=require(_0x2d62('0x10'));var Redis=require('ioredis');var authService=require(_0x2d62('0x11'));var qs=require(_0x2d62('0x12'));var as=require(_0x2d62('0x13'));var hardwareService=require(_0x2d62('0x14'));var logger=require(_0x2d62('0x15'))(_0x2d62('0x16'));var utils=require(_0x2d62('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d62('0x18'));var db=require(_0x2d62('0x19'))['db'];function respondWithStatusCode(_0x2bafc0,_0x1364df){_0x1364df=_0x1364df||0xcc;return function(_0x13fcfd){if(_0x13fcfd){return _0x2bafc0[_0x2d62('0x1a')](_0x1364df);}return _0x2bafc0[_0x2d62('0x1b')](_0x1364df)[_0x2d62('0x1c')]();};}function respondWithResult(_0x31d86e,_0x1ec4c8){_0x1ec4c8=_0x1ec4c8||0xc8;return function(_0x1ed9b2){if(_0x1ed9b2){return _0x31d86e[_0x2d62('0x1b')](_0x1ec4c8)['json'](_0x1ed9b2);}};}function respondWithFilteredResult(_0x29f7aa,_0x5536df){return function(_0x328458){if(_0x328458){var _0x3406ad=typeof _0x5536df[_0x2d62('0x1d')]==='undefined'&&typeof _0x5536df[_0x2d62('0x1e')]===_0x2d62('0x1f');var _0x278381=_0x328458[_0x2d62('0x20')];var _0x2e586b=_0x3406ad?0x0:_0x5536df[_0x2d62('0x1d')];var _0x148462=_0x3406ad?_0x328458[_0x2d62('0x20')]:_0x5536df[_0x2d62('0x1d')]+_0x5536df[_0x2d62('0x1e')];var _0x52efa2;if(_0x148462>=_0x278381){_0x148462=_0x278381;_0x52efa2=0xc8;}else{_0x52efa2=0xce;}_0x29f7aa[_0x2d62('0x1b')](_0x52efa2);return _0x29f7aa[_0x2d62('0x21')]('Content-Range',_0x2e586b+'-'+_0x148462+'/'+_0x278381)[_0x2d62('0x22')](_0x328458);}return null;};}function patchUpdates(_0x569193){return function(_0x54c0e5){try{jsonpatch['apply'](_0x54c0e5,_0x569193,!![]);}catch(_0x8ca39c){return BPromise[_0x2d62('0x23')](_0x8ca39c);}return _0x54c0e5[_0x2d62('0x24')]();};}function saveUpdates(_0x50a7f5,_0x42cf1){return function(_0xc9d3d6){if(_0xc9d3d6){return _0xc9d3d6[_0x2d62('0x25')](_0x50a7f5)['then'](function(_0x3fed5f){return _0x3fed5f;});}return null;};}function removeEntity(_0x2ad102,_0x1eb4fc){return function(_0x254426){if(_0x254426){return _0x254426[_0x2d62('0x26')]()['then'](function(){var _0x5b2a4f=_0x254426[_0x2d62('0x27')]({'plain':!![]});var _0x2211ce=_0x2d62('0x28');return db[_0x2d62('0x29')][_0x2d62('0x26')]({'where':{'type':_0x2211ce,'resourceId':_0x5b2a4f['id']}})[_0x2d62('0x2a')](function(){return _0x254426;});})[_0x2d62('0x2a')](function(){_0x2ad102['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4609ee,_0x1c028b){return function(_0x40de6c){if(!_0x40de6c){_0x4609ee[_0x2d62('0x1a')](0x194);}return _0x40de6c;};}function handleError(_0x2c760e,_0x2d94cb){_0x2d94cb=_0x2d94cb||0x1f4;return function(_0x5df304){logger['error'](_0x5df304['stack']);if(_0x5df304[_0x2d62('0x2b')]){delete _0x5df304[_0x2d62('0x2b')];}_0x2c760e[_0x2d62('0x1b')](_0x2d94cb)['send'](_0x5df304);};}exports['index']=function(_0x4c88d6,_0x3cc77d){var _0xc37571={},_0x48be38={},_0x34aa9a={'count':0x0,'rows':[]};var _0x1631b1=_['map'](db['Variable']['rawAttributes'],function(_0x5d5463){return{'name':_0x5d5463[_0x2d62('0x2c')],'type':_0x5d5463[_0x2d62('0x2d')][_0x2d62('0x2e')]};});_0x48be38[_0x2d62('0x2f')]=_[_0x2d62('0x30')](_0x1631b1,_0x2d62('0x2b'));_0x48be38[_0x2d62('0x31')]=_[_0x2d62('0x32')](_0x4c88d6[_0x2d62('0x31')]);_0x48be38['filters']=_['intersection'](_0x48be38[_0x2d62('0x2f')],_0x48be38[_0x2d62('0x31')]);_0xc37571[_0x2d62('0x33')]=_[_0x2d62('0x34')](_0x48be38[_0x2d62('0x2f')],qs[_0x2d62('0x35')](_0x4c88d6[_0x2d62('0x31')]['fields']));_0xc37571[_0x2d62('0x33')]=_0xc37571[_0x2d62('0x33')][_0x2d62('0x36')]?_0xc37571[_0x2d62('0x33')]:_0x48be38[_0x2d62('0x2f')];if(!_0x4c88d6['query'][_0x2d62('0x37')](_0x2d62('0x38'))){_0xc37571[_0x2d62('0x1e')]=qs['limit'](_0x4c88d6['query'][_0x2d62('0x1e')]);_0xc37571[_0x2d62('0x1d')]=qs[_0x2d62('0x1d')](_0x4c88d6[_0x2d62('0x31')][_0x2d62('0x1d')]);}_0xc37571[_0x2d62('0x39')]=qs[_0x2d62('0x3a')](_0x4c88d6[_0x2d62('0x31')][_0x2d62('0x3a')]);_0xc37571[_0x2d62('0x3b')]=qs['filters'](_['pick'](_0x4c88d6[_0x2d62('0x31')],_0x48be38['filters']),_0x1631b1);if(_0x4c88d6['query'][_0x2d62('0x3c')]){_0xc37571[_0x2d62('0x3b')]=_[_0x2d62('0x3d')](_0xc37571[_0x2d62('0x3b')],{'$or':_[_0x2d62('0x30')](_0x1631b1,function(_0x1f93e6){if(_0x1f93e6['type']!==_0x2d62('0x3e')){var _0x35d81d={};_0x35d81d[_0x1f93e6[_0x2d62('0x2b')]]={'$like':'%'+_0x4c88d6[_0x2d62('0x31')][_0x2d62('0x3c')]+'%'};return _0x35d81d;}})});}_0xc37571=_[_0x2d62('0x3d')]({},_0xc37571,_0x4c88d6[_0x2d62('0x3f')]);var _0x4c6382={'where':_0xc37571['where']};return db[_0x2d62('0x40')]['count'](_0x4c6382)[_0x2d62('0x2a')](function(_0x23035d){_0x34aa9a['count']=_0x23035d;if(_0x4c88d6['query'][_0x2d62('0x41')]){_0xc37571[_0x2d62('0x42')]=[{'all':!![]}];}return db[_0x2d62('0x40')]['findAll'](_0xc37571);})[_0x2d62('0x2a')](function(_0x5092a5){_0x34aa9a[_0x2d62('0x43')]=_0x5092a5;return _0x34aa9a;})[_0x2d62('0x2a')](respondWithFilteredResult(_0x3cc77d,_0xc37571))[_0x2d62('0x44')](handleError(_0x3cc77d,null));};exports[_0x2d62('0x45')]=function(_0x239ae2,_0xabd8a4){var _0x4284c5={'raw':!![],'where':{'id':_0x239ae2[_0x2d62('0x46')]['id']}},_0x317ad5={};_0x317ad5['model']=_[_0x2d62('0x32')](db[_0x2d62('0x40')][_0x2d62('0x47')]);_0x317ad5[_0x2d62('0x31')]=_[_0x2d62('0x32')](_0x239ae2['query']);_0x317ad5[_0x2d62('0x48')]=_[_0x2d62('0x34')](_0x317ad5['model'],_0x317ad5[_0x2d62('0x31')]);_0x4284c5[_0x2d62('0x33')]=_[_0x2d62('0x34')](_0x317ad5['model'],qs[_0x2d62('0x35')](_0x239ae2[_0x2d62('0x31')]['fields']));_0x4284c5[_0x2d62('0x33')]=_0x4284c5['attributes'][_0x2d62('0x36')]?_0x4284c5[_0x2d62('0x33')]:_0x317ad5['model'];if(_0x239ae2[_0x2d62('0x31')][_0x2d62('0x41')]){_0x4284c5[_0x2d62('0x42')]=[{'all':!![]}];}_0x4284c5=_[_0x2d62('0x3d')]({},_0x4284c5,_0x239ae2['options']);return db['Variable'][_0x2d62('0x49')](_0x4284c5)[_0x2d62('0x2a')](handleEntityNotFound(_0xabd8a4,null))['then'](respondWithResult(_0xabd8a4,null))[_0x2d62('0x44')](handleError(_0xabd8a4,null));};exports[_0x2d62('0x4a')]=function(_0x4f3fb4,_0x2fec3e){return db[_0x2d62('0x40')]['create'](_0x4f3fb4[_0x2d62('0x4b')],{})['then'](function(_0x4bac63){var _0x6112bc=_0x4f3fb4[_0x2d62('0x4c')][_0x2d62('0x27')]({'plain':!![]});if(!_0x6112bc)throw new Error(_0x2d62('0x4d'));if(_0x6112bc[_0x2d62('0x4e')]===_0x2d62('0x4c')){var _0x1092c3=_0x4bac63['get']({'plain':!![]});var _0x5de42f=_0x2d62('0x28');return db['UserProfileSection'][_0x2d62('0x49')]({'where':{'name':_0x5de42f,'userProfileId':_0x6112bc[_0x2d62('0x4f')]},'raw':!![]})[_0x2d62('0x2a')](function(_0x483b95){if(_0x483b95&&_0x483b95['autoAssociation']===0x0){return db['UserProfileResource'][_0x2d62('0x4a')]({'name':_0x1092c3[_0x2d62('0x2b')],'resourceId':_0x1092c3['id'],'type':_0x483b95[_0x2d62('0x2b')],'sectionId':_0x483b95['id']},{})[_0x2d62('0x2a')](function(){return _0x4bac63;});}else{return _0x4bac63;}})[_0x2d62('0x44')](function(_0x1e0fb5){logger[_0x2d62('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e0fb5);throw _0x1e0fb5;});}return _0x4bac63;})[_0x2d62('0x2a')](respondWithResult(_0x2fec3e,0xc9))[_0x2d62('0x44')](handleError(_0x2fec3e,null));};exports[_0x2d62('0x25')]=function(_0x40f1d1,_0x436ea9){if(_0x40f1d1[_0x2d62('0x4b')]['id']){delete _0x40f1d1[_0x2d62('0x4b')]['id'];}return db[_0x2d62('0x40')]['find']({'where':{'id':_0x40f1d1['params']['id']}})[_0x2d62('0x2a')](handleEntityNotFound(_0x436ea9,null))[_0x2d62('0x2a')](saveUpdates(_0x40f1d1[_0x2d62('0x4b')],null))[_0x2d62('0x2a')](respondWithResult(_0x436ea9,null))[_0x2d62('0x44')](handleError(_0x436ea9,null));};exports['destroy']=function(_0x482c0f,_0x2b3817){return db[_0x2d62('0x40')][_0x2d62('0x49')]({'where':{'id':_0x482c0f[_0x2d62('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b3817,null))['then'](removeEntity(_0x2b3817,null))[_0x2d62('0x44')](handleError(_0x2b3817,null));}; \ No newline at end of file +var _0x1d28=['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','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','Variable','includeAll','include','catch','show','params','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x47b2b0,_0x293376){var _0x378284=function(_0x4bc1e8){while(--_0x4bc1e8){_0x47b2b0['push'](_0x47b2b0['shift']());}};_0x378284(++_0x293376);}(_0x1d28,0x1b6));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x81d2('0x0'));var rimraf=require(_0x81d2('0x1'));var zipdir=require(_0x81d2('0x2'));var jsonpatch=require(_0x81d2('0x3'));var rp=require(_0x81d2('0x4'));var moment=require(_0x81d2('0x5'));var BPromise=require(_0x81d2('0x6'));var Mustache=require(_0x81d2('0x7'));var util=require(_0x81d2('0x8'));var path=require(_0x81d2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x81d2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81d2('0xb'));var squel=require(_0x81d2('0xc'));var crypto=require(_0x81d2('0xd'));var jsforce=require(_0x81d2('0xe'));var deskjs=require(_0x81d2('0xf'));var toCsv=require(_0x81d2('0x10'));var querystring=require(_0x81d2('0x11'));var Papa=require(_0x81d2('0x12'));var Redis=require(_0x81d2('0x13'));var authService=require(_0x81d2('0x14'));var qs=require(_0x81d2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x81d2('0x16'))(_0x81d2('0x17'));var utils=require(_0x81d2('0x18'));var config=require(_0x81d2('0x19'));var licenseUtil=require(_0x81d2('0x1a'));var db=require(_0x81d2('0x1b'))['db'];function respondWithStatusCode(_0xe0ee7d,_0x4cdc2c){_0x4cdc2c=_0x4cdc2c||0xcc;return function(_0x14038a){if(_0x14038a){return _0xe0ee7d['sendStatus'](_0x4cdc2c);}return _0xe0ee7d[_0x81d2('0x1c')](_0x4cdc2c)[_0x81d2('0x1d')]();};}function respondWithResult(_0x417aa0,_0x38f431){_0x38f431=_0x38f431||0xc8;return function(_0x2db519){if(_0x2db519){return _0x417aa0['status'](_0x38f431)['json'](_0x2db519);}};}function respondWithFilteredResult(_0x1c0342,_0x4c2030){return function(_0x4f4698){if(_0x4f4698){var _0x1381a2=typeof _0x4c2030[_0x81d2('0x1e')]===_0x81d2('0x1f')&&typeof _0x4c2030['limit']===_0x81d2('0x1f');var _0x2904ed=_0x4f4698[_0x81d2('0x20')];var _0x3d9cd4=_0x1381a2?0x0:_0x4c2030[_0x81d2('0x1e')];var _0x4a1f0f=_0x1381a2?_0x4f4698['count']:_0x4c2030[_0x81d2('0x1e')]+_0x4c2030['limit'];var _0x1d91b6;if(_0x4a1f0f>=_0x2904ed){_0x4a1f0f=_0x2904ed;_0x1d91b6=0xc8;}else{_0x1d91b6=0xce;}_0x1c0342['status'](_0x1d91b6);return _0x1c0342[_0x81d2('0x21')](_0x81d2('0x22'),_0x3d9cd4+'-'+_0x4a1f0f+'/'+_0x2904ed)[_0x81d2('0x23')](_0x4f4698);}return null;};}function patchUpdates(_0x1e3257){return function(_0x5de68a){try{jsonpatch[_0x81d2('0x24')](_0x5de68a,_0x1e3257,!![]);}catch(_0x2d9c53){return BPromise[_0x81d2('0x25')](_0x2d9c53);}return _0x5de68a[_0x81d2('0x26')]();};}function saveUpdates(_0x1c596d,_0x17ddcd){return function(_0x4e94a2){if(_0x4e94a2){return _0x4e94a2[_0x81d2('0x27')](_0x1c596d)[_0x81d2('0x28')](function(_0xc1ac9b){return _0xc1ac9b;});}return null;};}function removeEntity(_0x24cc60,_0x58c805){return function(_0x3f13db){if(_0x3f13db){return _0x3f13db['destroy']()['then'](function(){var _0x550b4c=_0x3f13db[_0x81d2('0x29')]({'plain':!![]});var _0x402bad=_0x81d2('0x2a');return db[_0x81d2('0x2b')][_0x81d2('0x2c')]({'where':{'type':_0x402bad,'resourceId':_0x550b4c['id']}})[_0x81d2('0x28')](function(){return _0x3f13db;});})[_0x81d2('0x28')](function(){_0x24cc60[_0x81d2('0x1c')](0xcc)[_0x81d2('0x1d')]();});}};}function handleEntityNotFound(_0x4934b5,_0xc19515){return function(_0x2db7f6){if(!_0x2db7f6){_0x4934b5['sendStatus'](0x194);}return _0x2db7f6;};}function handleError(_0x1db1df,_0x4233df){_0x4233df=_0x4233df||0x1f4;return function(_0x525c14){logger[_0x81d2('0x2d')](_0x525c14[_0x81d2('0x2e')]);if(_0x525c14[_0x81d2('0x2f')]){delete _0x525c14[_0x81d2('0x2f')];}_0x1db1df['status'](_0x4233df)[_0x81d2('0x30')](_0x525c14);};}exports[_0x81d2('0x31')]=function(_0x1c904f,_0x4b92c1){var _0xc0999e={},_0x5652f5={},_0x3bdc35={'count':0x0,'rows':[]};var _0x1cfec6=_[_0x81d2('0x32')](db['Variable'][_0x81d2('0x33')],function(_0x27968b){return{'name':_0x27968b[_0x81d2('0x34')],'type':_0x27968b[_0x81d2('0x35')][_0x81d2('0x36')]};});_0x5652f5[_0x81d2('0x37')]=_[_0x81d2('0x32')](_0x1cfec6,_0x81d2('0x2f'));_0x5652f5[_0x81d2('0x38')]=_[_0x81d2('0x39')](_0x1c904f[_0x81d2('0x38')]);_0x5652f5[_0x81d2('0x3a')]=_[_0x81d2('0x3b')](_0x5652f5[_0x81d2('0x37')],_0x5652f5[_0x81d2('0x38')]);_0xc0999e['attributes']=_[_0x81d2('0x3b')](_0x5652f5['model'],qs[_0x81d2('0x3c')](_0x1c904f['query'][_0x81d2('0x3c')]));_0xc0999e[_0x81d2('0x3d')]=_0xc0999e[_0x81d2('0x3d')][_0x81d2('0x3e')]?_0xc0999e[_0x81d2('0x3d')]:_0x5652f5['model'];if(!_0x1c904f[_0x81d2('0x38')][_0x81d2('0x3f')](_0x81d2('0x40'))){_0xc0999e[_0x81d2('0x41')]=qs[_0x81d2('0x41')](_0x1c904f[_0x81d2('0x38')][_0x81d2('0x41')]);_0xc0999e[_0x81d2('0x1e')]=qs[_0x81d2('0x1e')](_0x1c904f[_0x81d2('0x38')][_0x81d2('0x1e')]);}_0xc0999e[_0x81d2('0x42')]=qs[_0x81d2('0x43')](_0x1c904f[_0x81d2('0x38')]['sort']);_0xc0999e[_0x81d2('0x44')]=qs[_0x81d2('0x3a')](_[_0x81d2('0x45')](_0x1c904f[_0x81d2('0x38')],_0x5652f5[_0x81d2('0x3a')]),_0x1cfec6);if(_0x1c904f[_0x81d2('0x38')][_0x81d2('0x46')]){_0xc0999e[_0x81d2('0x44')]=_['merge'](_0xc0999e['where'],{'$or':_['map'](_0x1cfec6,function(_0x4da1b2){if(_0x4da1b2[_0x81d2('0x35')]!=='VIRTUAL'){var _0x4c26ad={};_0x4c26ad[_0x4da1b2['name']]={'$like':'%'+_0x1c904f[_0x81d2('0x38')][_0x81d2('0x46')]+'%'};return _0x4c26ad;}})});}_0xc0999e=_['merge']({},_0xc0999e,_0x1c904f['options']);var _0x2e0e1e={'where':_0xc0999e[_0x81d2('0x44')]};return db[_0x81d2('0x47')]['count'](_0x2e0e1e)['then'](function(_0x1beb8f){_0x3bdc35['count']=_0x1beb8f;if(_0x1c904f[_0x81d2('0x38')][_0x81d2('0x48')]){_0xc0999e[_0x81d2('0x49')]=[{'all':!![]}];}return db['Variable']['findAll'](_0xc0999e);})[_0x81d2('0x28')](function(_0x1b2e22){_0x3bdc35['rows']=_0x1b2e22;return _0x3bdc35;})[_0x81d2('0x28')](respondWithFilteredResult(_0x4b92c1,_0xc0999e))[_0x81d2('0x4a')](handleError(_0x4b92c1,null));};exports[_0x81d2('0x4b')]=function(_0x49d24f,_0x3b61dc){var _0x224d9f={'raw':!![],'where':{'id':_0x49d24f[_0x81d2('0x4c')]['id']}},_0x1ed2e4={};_0x1ed2e4[_0x81d2('0x37')]=_['keys'](db[_0x81d2('0x47')][_0x81d2('0x33')]);_0x1ed2e4[_0x81d2('0x38')]=_[_0x81d2('0x39')](_0x49d24f[_0x81d2('0x38')]);_0x1ed2e4[_0x81d2('0x3a')]=_[_0x81d2('0x3b')](_0x1ed2e4[_0x81d2('0x37')],_0x1ed2e4[_0x81d2('0x38')]);_0x224d9f['attributes']=_[_0x81d2('0x3b')](_0x1ed2e4[_0x81d2('0x37')],qs[_0x81d2('0x3c')](_0x49d24f[_0x81d2('0x38')][_0x81d2('0x3c')]));_0x224d9f[_0x81d2('0x3d')]=_0x224d9f[_0x81d2('0x3d')][_0x81d2('0x3e')]?_0x224d9f[_0x81d2('0x3d')]:_0x1ed2e4[_0x81d2('0x37')];if(_0x49d24f[_0x81d2('0x38')][_0x81d2('0x48')]){_0x224d9f[_0x81d2('0x49')]=[{'all':!![]}];}_0x224d9f=_[_0x81d2('0x4d')]({},_0x224d9f,_0x49d24f[_0x81d2('0x4e')]);return db['Variable'][_0x81d2('0x4f')](_0x224d9f)['then'](handleEntityNotFound(_0x3b61dc,null))['then'](respondWithResult(_0x3b61dc,null))[_0x81d2('0x4a')](handleError(_0x3b61dc,null));};exports['create']=function(_0x4c2587,_0xfaed4){return db[_0x81d2('0x47')][_0x81d2('0x50')](_0x4c2587[_0x81d2('0x51')],{})[_0x81d2('0x28')](function(_0x46cc94){var _0x188e71=_0x4c2587[_0x81d2('0x52')][_0x81d2('0x29')]({'plain':!![]});if(!_0x188e71)throw new Error(_0x81d2('0x53'));if(_0x188e71['role']===_0x81d2('0x52')){var _0x162f8b=_0x46cc94['get']({'plain':!![]});var _0x17eb1f=_0x81d2('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x17eb1f,'userProfileId':_0x188e71[_0x81d2('0x54')]},'raw':!![]})['then'](function(_0x50e944){if(_0x50e944&&_0x50e944[_0x81d2('0x55')]===0x0){return db[_0x81d2('0x2b')][_0x81d2('0x50')]({'name':_0x162f8b[_0x81d2('0x2f')],'resourceId':_0x162f8b['id'],'type':_0x50e944[_0x81d2('0x2f')],'sectionId':_0x50e944['id']},{})[_0x81d2('0x28')](function(){return _0x46cc94;});}else{return _0x46cc94;}})[_0x81d2('0x4a')](function(_0x265187){logger[_0x81d2('0x2d')](_0x81d2('0x56'),_0x265187);throw _0x265187;});}return _0x46cc94;})[_0x81d2('0x28')](respondWithResult(_0xfaed4,0xc9))[_0x81d2('0x4a')](handleError(_0xfaed4,null));};exports[_0x81d2('0x27')]=function(_0x3f8fa5,_0x20fb36){if(_0x3f8fa5[_0x81d2('0x51')]['id']){delete _0x3f8fa5[_0x81d2('0x51')]['id'];}return db[_0x81d2('0x47')][_0x81d2('0x4f')]({'where':{'id':_0x3f8fa5[_0x81d2('0x4c')]['id']}})[_0x81d2('0x28')](handleEntityNotFound(_0x20fb36,null))[_0x81d2('0x28')](saveUpdates(_0x3f8fa5[_0x81d2('0x51')],null))[_0x81d2('0x28')](respondWithResult(_0x20fb36,null))['catch'](handleError(_0x20fb36,null));};exports[_0x81d2('0x2c')]=function(_0x32b8b1,_0x485279){return db[_0x81d2('0x47')][_0x81d2('0x4f')]({'where':{'id':_0x32b8b1[_0x81d2('0x4c')]['id']}})[_0x81d2('0x28')](handleEntityNotFound(_0x485279,null))[_0x81d2('0x28')](removeEntity(_0x485279,null))['catch'](handleError(_0x485279,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6c23784..427241f 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 _0x4979=['Variable','tools_variables','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports'];(function(_0x3fd2d5,_0x11a61b){var _0x14f7da=function(_0x3bf89b){while(--_0x3bf89b){_0x3fd2d5['push'](_0x3fd2d5['shift']());}};_0x14f7da(++_0x11a61b);}(_0x4979,0x142));var _0x9497=function(_0x503e4e,_0x5e9fba){_0x503e4e=_0x503e4e-0x0;var _0x30e5fd=_0x4979[_0x503e4e];return _0x30e5fd;};'use strict';var _=require(_0x9497('0x0'));var util=require(_0x9497('0x1'));var logger=require(_0x9497('0x2'))(_0x9497('0x3'));var moment=require(_0x9497('0x4'));var BPromise=require('bluebird');var rp=require(_0x9497('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9497('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x9497('0x7')]=function(_0x462684,_0x30d462){return _0x462684['define'](_0x9497('0x8'),attributes,{'tableName':_0x9497('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1baf=['Variable','../../config/logger','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x1baf,0xc9));var _0xf1ba=function(_0x1a09a2,_0x25cbbc){_0x1a09a2=_0x1a09a2-0x0;var _0x2f6545=_0x1baf[_0x1a09a2];return _0x2f6545;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf1ba('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1ba('0x1'));var fs=require('fs');var path=require(_0xf1ba('0x2'));var rimraf=require(_0xf1ba('0x3'));var config=require(_0xf1ba('0x4'));var attributes=require(_0xf1ba('0x5'));module[_0xf1ba('0x6')]=function(_0x10e1e7,_0x4d5c91){return _0x10e1e7['define'](_0xf1ba('0x7'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index a9c13e6..d3ada63 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 _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x397e57,_0xcfd1bd){var _0xd60a69=function(_0x286a9d){while(--_0x286a9d){_0x397e57['push'](_0x397e57['shift']());}};_0xd60a69(++_0xcfd1bd);}(_0xabce,0x103));var _0xeabc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xabce[_0x543084];return _0x306a57;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x596de3,_0xf801c0){var _0xbf541f=function(_0x3b7460){while(--_0x3b7460){_0x596de3['push'](_0x596de3['shift']());}};_0xbf541f(++_0xf801c0);}(_0xe14b,0x93));var _0xbe14=function(_0x2aa813,_0x19e996){_0x2aa813=_0x2aa813-0x0;var _0x504002=_0xe14b[_0x2aa813];return _0x504002;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index fc78bbe..b519d7d 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 _0x4fdf=['index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fdf,0x1bd));var _0xf4fd=function(_0x117807,_0x26badd){_0x117807=_0x117807-0x0;var _0x332257=_0x4fdf[_0x117807];return _0x332257;};'use strict';var express=require(_0xf4fd('0x0'));var router=express[_0xf4fd('0x1')]();var auth=require(_0xf4fd('0x2'));var controller=require(_0xf4fd('0x3'));router[_0xf4fd('0x4')]('/',controller[_0xf4fd('0x5')]);router[_0xf4fd('0x4')](_0xf4fd('0x6'),auth[_0xf4fd('0x7')](),auth[_0xf4fd('0x8')](),controller[_0xf4fd('0x9')]);router['get'](_0xf4fd('0xa'),auth[_0xf4fd('0x7')](),auth[_0xf4fd('0x8')](),controller[_0xf4fd('0xb')]);router[_0xf4fd('0x4')](_0xf4fd('0xc'),auth[_0xf4fd('0x7')](),auth[_0xf4fd('0x8')](),controller[_0xf4fd('0xd')]);router[_0xf4fd('0x4')](_0xf4fd('0xe'),auth[_0xf4fd('0x7')](),controller[_0xf4fd('0xf')]);router[_0xf4fd('0x4')](_0xf4fd('0x10'),controller[_0xf4fd('0x11')]);module['exports']=router; \ No newline at end of file +var _0x25fc=['exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull'];(function(_0x46888b,_0x2d6165){var _0x52bf28=function(_0x24405f){while(--_0x24405f){_0x46888b['push'](_0x46888b['shift']());}};_0x52bf28(++_0x2d6165);}(_0x25fc,0xef));var _0xc25f=function(_0x1c33f3,_0x19f232){_0x1c33f3=_0x1c33f3-0x0;var _0x257478=_0x25fc[_0x1c33f3];return _0x257478;};'use strict';var express=require(_0xc25f('0x0'));var router=express['Router']();var auth=require(_0xc25f('0x1'));var controller=require(_0xc25f('0x2'));router[_0xc25f('0x3')]('/',controller[_0xc25f('0x4')]);router[_0xc25f('0x3')](_0xc25f('0x5'),auth[_0xc25f('0x6')](),auth[_0xc25f('0x7')](),controller[_0xc25f('0x8')]);router[_0xc25f('0x3')](_0xc25f('0x9'),auth[_0xc25f('0x6')](),auth[_0xc25f('0x7')](),controller[_0xc25f('0xa')]);router[_0xc25f('0x3')](_0xc25f('0xb'),auth[_0xc25f('0x6')](),auth['canUpdate'](),controller[_0xc25f('0xc')]);router['get']('/restart',auth[_0xc25f('0x6')](),controller['restart']);router['get']('/migrations',controller['migrations']);module[_0xc25f('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 15e56ec..243983d 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 _0x78a7=['umzug','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','exports','query','latest','2.0.0','status','json','fetch','origin','error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','replace','.js','push','length','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.','server','then','UniqueConstraintError'];(function(_0xb73a22,_0x2959f9){var _0x222a47=function(_0x295933){while(--_0x295933){_0xb73a22['push'](_0xb73a22['shift']());}};_0x222a47(++_0x2959f9);}(_0x78a7,0x11a));var _0x778a=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0x78a7[_0x1af8d3];return _0x3a50c5;};'use strict';var Umzug=require(_0x778a('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x778a('0x1'));var pkginfo=require('pkginfo')(module,_0x778a('0x2'));var compareVersions=require(_0x778a('0x3'));var exec=require(_0x778a('0x4'))[_0x778a('0x5')];var db=require(_0x778a('0x6'))['db'];var config=require(_0x778a('0x7'));var pm2=require(_0x778a('0x8'));var logger=require('../../config/logger')(_0x778a('0x9'));var git=require(_0x778a('0xa'))(config[_0x778a('0xb')]);exports['index']=function(_0x1ec501,_0x308a52){var _0x1546cc={'current':module[_0x778a('0xc')][_0x778a('0x2')],'phonebar':0x2};if(_0x1ec501['query']&&_0x1ec501[_0x778a('0xd')]['latest']){return git['fetch']()['tags'](function(_0x12c10d,_0x4fa4a4){_0x1546cc['latest']=(_0x12c10d?module[_0x778a('0xc')][_0x778a('0x2')]:_0x4fa4a4[_0x778a('0xe')])||_0x778a('0xf');return _0x308a52[_0x778a('0x10')](0xc8)[_0x778a('0x11')](_0x1546cc);});}else{return _0x308a52[_0x778a('0x10')](0xc8)[_0x778a('0x11')](_0x1546cc);}};exports[_0x778a('0x12')]=function(_0xd3e74d,_0x35f2e2){return git[_0x778a('0x12')]([_0x778a('0x13'),'master'],function(_0x38352e){if(_0x38352e){logger[_0x778a('0x14')](_0x38352e);return _0x35f2e2[_0x778a('0x10')](0x1f4)[_0x778a('0x11')](_0x38352e);}logger[_0x778a('0x15')]('git\x20fetch');return _0x35f2e2[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':_0x778a('0x16')});});};exports[_0x778a('0x17')]=function(_0x3bcc76,_0x2004d5){return git[_0x778a('0x17')](['--hard',_0x778a('0x18')],function(_0x4b0c56){if(_0x4b0c56){logger[_0x778a('0x14')](_0x4b0c56);return _0x2004d5['status'](0x1f4)[_0x778a('0x11')](_0x4b0c56);}logger[_0x778a('0x15')](_0x778a('0x19'));return _0x2004d5[_0x778a('0x10')](0xc8)['json']({'output':_0x778a('0x1a')});});};exports[_0x778a('0x1b')]=function(_0x276cc3,_0x4a5a79){exec('npm\x20install\x20--production',function(_0x24bbb3,_0x385a2c,_0x212eb4){logger[_0x778a('0x15')](_0x385a2c);logger[_0x778a('0x15')](_0x212eb4);if(_0x24bbb3){logger[_0x778a('0x14')](_0x24bbb3);return _0x4a5a79[_0x778a('0x10')](0x1f4)['json'](_0x24bbb3);}return _0x4a5a79[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':_0x385a2c});});};exports[_0x778a('0x1c')]=function(_0x29e5a3,_0x2bb587){return pm2[_0x778a('0x1c')](_0x778a('0x1d'))['then'](function(_0x3fac85){logger[_0x778a('0x15')](_0x778a('0x1e'),_0x3fac85);return _0x2bb587[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':_0x778a('0x1f')});})[_0x778a('0x20')](function(_0x288514){logger[_0x778a('0x14')](_0x288514);return _0x2bb587[_0x778a('0x10')](0x1f4)['json'](_0x288514);});};exports[_0x778a('0x21')]=function(_0x518973,_0x27d9f9){var _0x469300=fs['readdirSync'](path[_0x778a('0x22')](config[_0x778a('0xb')],'server',_0x778a('0x21')));var _0x1e87c4=[];for(var _0x587ecc=0x0;_0x587ecc<_0x469300['length'];_0x587ecc++){var _0x4bff3c=_0x469300[_0x587ecc][_0x778a('0x23')](_0x778a('0x24'),'');if(compareVersions(module[_0x778a('0xc')]['version'],_0x4bff3c)===-0x1){_0x1e87c4[_0x778a('0x25')](_0x4bff3c);}}if(_0x1e87c4[_0x778a('0x26')]){var _0x1aff93=_0x1e87c4['sort'](compareVersions);var _0x4a97bf=new Umzug({'storage':_0x778a('0x27'),'storageOptions':{'model':db['Migration'],'modelName':_0x778a('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x778a('0x27')][_0x778a('0x29')](),db[_0x778a('0x27')][_0x778a('0x2a')],function(){throw new Error(_0x778a('0x2b'));}],'path':path[_0x778a('0x22')](config[_0x778a('0xb')],_0x778a('0x2c'),_0x778a('0x21')),'pattern':/\.js$/}});_0x4a97bf['up']({'migrations':_['map'](_0x1aff93,function(_0x252649){return _0x252649+'.js';})})[_0x778a('0x2d')](function(){return _0x27d9f9[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x778a('0xc')][_0x778a('0x2')]+'\x20to\x20'+_['last'](_0x1aff93),'migrations':_[_0x778a('0x22')](_0x1aff93)});})[_0x778a('0x20')](function(_0x553e5d){if(_0x553e5d instanceof db[_0x778a('0x27')][_0x778a('0x2e')]){return _0x27d9f9[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x27d9f9[_0x778a('0x10')](0x1f4)['json'](_0x553e5d);}});}else{return _0x27d9f9[_0x778a('0x10')](0xc8)[_0x778a('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xa8d1=['../../config/logger','update','simple-git','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2'];(function(_0x11d6a7,_0xb9bc04){var _0x2fe61b=function(_0x365ff3){while(--_0x365ff3){_0x11d6a7['push'](_0x11d6a7['shift']());}};_0x2fe61b(++_0xb9bc04);}(_0xa8d1,0x17f));var _0x1a8d=function(_0x9d53fb,_0x4b898b){_0x9d53fb=_0x9d53fb-0x0;var _0x12f955=_0xa8d1[_0x9d53fb];return _0x12f955;};'use strict';var Umzug=require(_0x1a8d('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1a8d('0x1'));var pkginfo=require(_0x1a8d('0x2'))(module,_0x1a8d('0x3'));var compareVersions=require(_0x1a8d('0x4'));var exec=require(_0x1a8d('0x5'))[_0x1a8d('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x1a8d('0x7'));var pm2=require(_0x1a8d('0x8'));var logger=require(_0x1a8d('0x9'))(_0x1a8d('0xa'));var git=require(_0x1a8d('0xb'))(config['root']);exports['index']=function(_0x557f80,_0x5e1ab0){var _0x234aee={'current':module[_0x1a8d('0xc')]['version'],'phonebar':0x2};if(_0x557f80['query']&&_0x557f80[_0x1a8d('0xd')][_0x1a8d('0xe')]){return git[_0x1a8d('0xf')]()[_0x1a8d('0x10')](function(_0x2765ab,_0x76bcfe){_0x234aee['latest']=(_0x2765ab?module[_0x1a8d('0xc')][_0x1a8d('0x3')]:_0x76bcfe[_0x1a8d('0xe')])||_0x1a8d('0x11');return _0x5e1ab0[_0x1a8d('0x12')](0xc8)[_0x1a8d('0x13')](_0x234aee);});}else{return _0x5e1ab0[_0x1a8d('0x12')](0xc8)[_0x1a8d('0x13')](_0x234aee);}};exports[_0x1a8d('0xf')]=function(_0x36a866,_0x5efb8b){return git[_0x1a8d('0xf')](['origin',_0x1a8d('0x14')],function(_0x3daa0){if(_0x3daa0){logger[_0x1a8d('0x15')](_0x3daa0);return _0x5efb8b[_0x1a8d('0x12')](0x1f4)['json'](_0x3daa0);}logger['info'](_0x1a8d('0x16'));return _0x5efb8b[_0x1a8d('0x12')](0xc8)[_0x1a8d('0x13')]({'output':_0x1a8d('0x17')});});};exports[_0x1a8d('0x18')]=function(_0x4ab85f,_0x5d17ca){return git['reset']([_0x1a8d('0x19'),_0x1a8d('0x1a')],function(_0x59a7db){if(_0x59a7db){logger[_0x1a8d('0x15')](_0x59a7db);return _0x5d17ca[_0x1a8d('0x12')](0x1f4)[_0x1a8d('0x13')](_0x59a7db);}logger[_0x1a8d('0x1b')](_0x1a8d('0x1c'));return _0x5d17ca[_0x1a8d('0x12')](0xc8)[_0x1a8d('0x13')]({'output':_0x1a8d('0x1d')});});};exports[_0x1a8d('0x1e')]=function(_0x275f52,_0x240a60){exec(_0x1a8d('0x1f'),function(_0x20eca3,_0xe12dbf,_0x49cdc7){logger[_0x1a8d('0x1b')](_0xe12dbf);logger[_0x1a8d('0x1b')](_0x49cdc7);if(_0x20eca3){logger[_0x1a8d('0x15')](_0x20eca3);return _0x240a60[_0x1a8d('0x12')](0x1f4)['json'](_0x20eca3);}return _0x240a60[_0x1a8d('0x12')](0xc8)[_0x1a8d('0x13')]({'output':_0xe12dbf});});};exports[_0x1a8d('0x20')]=function(_0xb0ca99,_0x214c85){return pm2[_0x1a8d('0x20')](_0x1a8d('0x21'))[_0x1a8d('0x22')](function(_0x32cfec){logger[_0x1a8d('0x1b')](_0x1a8d('0x23'),_0x32cfec);return _0x214c85[_0x1a8d('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x1a8d('0x24')](function(_0x2d49ba){logger[_0x1a8d('0x15')](_0x2d49ba);return _0x214c85[_0x1a8d('0x12')](0x1f4)[_0x1a8d('0x13')](_0x2d49ba);});};exports[_0x1a8d('0x25')]=function(_0x54a69e,_0x582145){var _0x377632=fs[_0x1a8d('0x26')](path[_0x1a8d('0x27')](config[_0x1a8d('0x28')],_0x1a8d('0x29'),_0x1a8d('0x25')));var _0x135f48=[];for(var _0xc88672=0x0;_0xc88672<_0x377632[_0x1a8d('0x2a')];_0xc88672++){var _0x52108e=_0x377632[_0xc88672][_0x1a8d('0x2b')](_0x1a8d('0x2c'),'');if(compareVersions(module['exports'][_0x1a8d('0x3')],_0x52108e)===-0x1){_0x135f48[_0x1a8d('0x2d')](_0x52108e);}}if(_0x135f48['length']){var _0xc462aa=_0x135f48[_0x1a8d('0x2e')](compareVersions);var _0x70474=new Umzug({'storage':_0x1a8d('0x2f'),'storageOptions':{'model':db[_0x1a8d('0x30')],'modelName':_0x1a8d('0x30'),'columnName':_0x1a8d('0x3')},'migrations':{'params':[db[_0x1a8d('0x2f')][_0x1a8d('0x31')](),db[_0x1a8d('0x2f')][_0x1a8d('0x32')],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['join'](config['root'],_0x1a8d('0x29'),_0x1a8d('0x25')),'pattern':/\.js$/}});_0x70474['up']({'migrations':_[_0x1a8d('0x33')](_0xc462aa,function(_0x9900aa){return _0x9900aa+_0x1a8d('0x2c');})})['then'](function(){return _0x582145[_0x1a8d('0x12')](0xc8)['json']({'output':_0x1a8d('0x34')+module[_0x1a8d('0xc')][_0x1a8d('0x3')]+_0x1a8d('0x35')+_['last'](_0xc462aa),'migrations':_[_0x1a8d('0x27')](_0xc462aa)});})[_0x1a8d('0x24')](function(_0x592025){if(_0x592025 instanceof db[_0x1a8d('0x2f')][_0x1a8d('0x36')]){return _0x582145['status'](0xc8)[_0x1a8d('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x582145[_0x1a8d('0x12')](0x1f4)[_0x1a8d('0x13')](_0x592025);}});}else{return _0x582145['status'](0xc8)['json']({'output':_0x1a8d('0x37')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 24956a8..9c18b18 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 _0xcd6e=['multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports'];(function(_0x2a87e9,_0x25c03e){var _0x5de0e6=function(_0x15e7e7){while(--_0x15e7e7){_0x2a87e9['push'](_0x2a87e9['shift']());}};_0x5de0e6(++_0x25c03e);}(_0xcd6e,0x11d));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xecd6('0x0'));var util=require(_0xecd6('0x1'));var path=require('path');var timeout=require(_0xecd6('0x2'));var express=require('express');var router=express[_0xecd6('0x3')]();var fs_extra=require(_0xecd6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xecd6('0x5'));var config=require(_0xecd6('0x6'));var controller=require(_0xecd6('0x7'));router[_0xecd6('0x8')]('/',auth[_0xecd6('0x9')](),controller[_0xecd6('0xa')]);router[_0xecd6('0x8')](_0xecd6('0xb'),auth[_0xecd6('0x9')](),controller[_0xecd6('0xc')]);router[_0xecd6('0x8')](_0xecd6('0xd'),auth[_0xecd6('0x9')](),controller['show']);router[_0xecd6('0xe')]('/',auth[_0xecd6('0x9')](),controller[_0xecd6('0xf')]);router[_0xecd6('0x10')](_0xecd6('0xd'),auth[_0xecd6('0x9')](),controller['update']);router[_0xecd6('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xecd6('0x12')]=router; \ No newline at end of file +var _0x5f0d=['isAuthenticated','describe','create','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x4761de,_0x3ce271){var _0x354e5e=function(_0x13ab64){while(--_0x13ab64){_0x4761de['push'](_0x4761de['shift']());}};_0x354e5e(++_0x3ce271);}(_0x5f0d,0xb1));var _0xd5f0=function(_0x55ce7d,_0x532063){_0x55ce7d=_0x55ce7d-0x0;var _0x23762d=_0x5f0d[_0x55ce7d];return _0x23762d;};'use strict';var multer=require(_0xd5f0('0x0'));var util=require('util');var path=require(_0xd5f0('0x1'));var timeout=require(_0xd5f0('0x2'));var express=require('express');var router=express[_0xd5f0('0x3')]();var fs_extra=require(_0xd5f0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5f0('0x5'));var config=require(_0xd5f0('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xd5f0('0x7')]('/',auth['isAuthenticated'](),controller[_0xd5f0('0x8')]);router[_0xd5f0('0x7')](_0xd5f0('0x9'),auth[_0xd5f0('0xa')](),controller[_0xd5f0('0xb')]);router[_0xd5f0('0x7')]('/:id',auth[_0xd5f0('0xa')](),controller['show']);router['post']('/',auth[_0xd5f0('0xa')](),controller[_0xd5f0('0xc')]);router['put'](_0xd5f0('0xd'),auth[_0xd5f0('0xa')](),controller[_0xd5f0('0xe')]);router[_0xd5f0('0xf')](_0xd5f0('0xd'),auth[_0xd5f0('0xa')](),controller[_0xd5f0('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 293e37c..eb1de4f 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 _0xad9f=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x33f02b,_0x23808d){var _0x1ac0bd=function(_0xfaddfa){while(--_0xfaddfa){_0x33f02b['push'](_0x33f02b['shift']());}};_0x1ac0bd(++_0x23808d);}(_0xad9f,0x1be));var _0xfad9=function(_0x412ff3,_0x5a0782){_0x412ff3=_0x412ff3-0x0;var _0x47e2b7=_0xad9f[_0x412ff3];return _0x47e2b7;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'type':{'type':Sequelize[_0xfad9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfad9('0x2')]},'calleridname':{'type':Sequelize[_0xfad9('0x2')]},'queue':{'type':Sequelize[_0xfad9('0x2')]},'interface':{'type':Sequelize[_0xfad9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xfad9('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xfad9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfad9('0x3')]},'agentdumpAt':{'type':Sequelize[_0xfad9('0x3')]},'holdtime':{'type':Sequelize[_0xfad9('0x4')]},'agentcomplete':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xfad9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfad9('0x4')]},'reason':{'type':Sequelize[_0xfad9('0x2')]},'lastevent':{'type':Sequelize[_0xfad9('0x2')]},'channel':{'type':Sequelize[_0xfad9('0x2')]},'channelstate':{'type':Sequelize[_0xfad9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfad9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfad9('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfad9('0x2')]},'accountcode':{'type':Sequelize[_0xfad9('0x2')]},'context':{'type':Sequelize[_0xfad9('0x2')]},'exten':{'type':Sequelize[_0xfad9('0x2')]},'priority':{'type':Sequelize[_0xfad9('0x2')]},'destchannel':{'type':Sequelize[_0xfad9('0x2')]},'destchannelstate':{'type':Sequelize[_0xfad9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xfad9('0x2')]},'destcalleridnum':{'type':Sequelize[_0xfad9('0x2')]},'destcalleridname':{'type':Sequelize[_0xfad9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfad9('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfad9('0x2')]},'destaccountcode':{'type':Sequelize[_0xfad9('0x2')]},'destcontext':{'type':Sequelize[_0xfad9('0x2')]},'destexten':{'type':Sequelize[_0xfad9('0x2')]},'destpriority':{'type':Sequelize[_0xfad9('0x2')]},'destuniqueid':{'type':Sequelize[_0xfad9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xfad9('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfad9('0x2')],'comment':_0xfad9('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xfad9('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe1e3=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x3fecaa,_0x1d041e){var _0x32e944=function(_0x557c85){while(--_0x557c85){_0x3fecaa['push'](_0x3fecaa['shift']());}};_0x32e944(++_0x1d041e);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0xa2283e,_0x4ab1ac){_0xa2283e=_0xa2283e-0x0;var _0x9bff84=_0xe1e3[_0xa2283e];return _0x9bff84;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e1e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3e1e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3e1e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3e1e('0x5')]},'agentacw':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3e1e('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3e1e('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3e1e('0x2')]},'connectedlinename':{'type':Sequelize[_0x3e1e('0x2')]},'language':{'type':Sequelize[_0x3e1e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3e1e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x3e1e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x3e1e('0x2')]},'destlanguage':{'type':Sequelize[_0x3e1e('0x2')]},'destaccountcode':{'type':Sequelize[_0x3e1e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e1e('0x2')]},'destuniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x3e1e('0x2')]},'transfer':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3e1e('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'agententerreason':{'type':Sequelize[_0x3e1e('0x5')],'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 3680e6c..28f3e88 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(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 5082dfc..24439ad 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 _0x1159=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0x438d45,_0x10cbb0){var _0x583fa0=function(_0xc8c012){while(--_0xc8c012){_0x438d45['push'](_0x438d45['shift']());}};_0x583fa0(++_0x10cbb0);}(_0x1159,0xf3));var _0x9115=function(_0x5e1401,_0xaf142d){_0x5e1401=_0x5e1401-0x0;var _0x54e7a6=_0x1159[_0x5e1401];return _0x54e7a6;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9115('0xc'),_0x9115('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44e8=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x35f363,_0x50f60d){var _0x3f4b10=function(_0x39b7ba){while(--_0x39b7ba){_0x35f363['push'](_0x35f363['shift']());}};_0x3f4b10(++_0x50f60d);}(_0x44e8,0xd7));var _0x844e=function(_0x36c309,_0x137344){_0x36c309=_0x36c309-0x0;var _0x26fc18=_0x44e8[_0x36c309];return _0x26fc18;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x844e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 68968c2..b5b9ead 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 _0x40aa=['../../config/environment','http','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceAgentReport','create','options','then','VoiceAgentReport','update','body','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x326717,_0x587131){var _0x13c8e6=function(_0x9f0c68){while(--_0x9f0c68){_0x326717['push'](_0x326717['shift']());}};_0x13c8e6(++_0x587131);}(_0x40aa,0x125));var _0xa40a=function(_0x5e9b8a,_0x15fc70){_0x5e9b8a=_0x5e9b8a-0x0;var _0xffd6d6=_0x40aa[_0x5e9b8a];return _0xffd6d6;};'use strict';var _=require(_0xa40a('0x0'));var util=require(_0xa40a('0x1'));var moment=require('moment');var BPromise=require(_0xa40a('0x2'));var rs=require(_0xa40a('0x3'));var fs=require('fs');var Redis=require(_0xa40a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa40a('0x5'));var logger=require('../../config/logger')(_0xa40a('0x6'));var config=require(_0xa40a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa40a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x137f26,_0x52bae6,_0x979b05){return new BPromise(function(_0xba55fb,_0x206898){return client['request'](_0x137f26,_0x979b05)['then'](function(_0x568fac){logger[_0xa40a('0x9')](_0xa40a('0xa'),_0x52bae6,_0xa40a('0xb'));logger[_0xa40a('0xc')](_0xa40a('0xd'),_0x52bae6,'request\x20sent',JSON[_0xa40a('0xe')](_0x568fac));if(_0x568fac[_0xa40a('0xf')]){if(_0x568fac[_0xa40a('0xf')][_0xa40a('0x10')]===0x1f4){logger['error'](_0xa40a('0xa'),_0x52bae6,_0x568fac[_0xa40a('0xf')][_0xa40a('0x11')]);return _0x206898(_0x568fac[_0xa40a('0xf')][_0xa40a('0x11')]);}logger['error'](_0xa40a('0xa'),_0x52bae6,_0x568fac[_0xa40a('0xf')][_0xa40a('0x11')]);return _0xba55fb(_0x568fac[_0xa40a('0xf')]['message']);}else{logger[_0xa40a('0x9')](_0xa40a('0xa'),_0x52bae6,'request\x20sent');_0xba55fb(_0x568fac['result'][_0xa40a('0x11')]);}})[_0xa40a('0x12')](function(_0x13a94d){logger[_0xa40a('0xf')](_0xa40a('0xa'),_0x52bae6,_0x13a94d);_0x206898(_0x13a94d);});});}exports[_0xa40a('0x13')]=function(_0x47e445){var _0x13f181=this;return new Promise(function(_0xfef87a,_0x438877){return db['VoiceAgentReport'][_0xa40a('0x14')](_0x47e445['body'],{'raw':_0x47e445[_0xa40a('0x15')]?_0x47e445['options']['raw']===undefined?!![]:![]:!![]})[_0xa40a('0x16')](function(_0x4373d3){logger[_0xa40a('0x9')](_0xa40a('0x13'),_0x47e445);logger['debug']('CreateVoiceAgentReport',_0x47e445,JSON[_0xa40a('0xe')](_0x4373d3));_0xfef87a(_0x4373d3);})['catch'](function(_0x4d5c6e){logger[_0xa40a('0xf')](_0xa40a('0x13'),_0x4d5c6e['message'],_0x47e445);_0x438877(_0x13f181[_0xa40a('0xf')](0x1f4,_0x4d5c6e[_0xa40a('0x11')]));});});};exports['UpdateVoiceAgentReport']=function(_0x41b436){var _0x1fc0cb=this;return new Promise(function(_0x1042fa,_0x3a5b81){return db[_0xa40a('0x17')][_0xa40a('0x18')](_0x41b436[_0xa40a('0x19')],{'raw':_0x41b436[_0xa40a('0x15')]?_0x41b436[_0xa40a('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41b436[_0xa40a('0x15')]?_0x41b436['options'][_0xa40a('0x1a')]||null:null,'attributes':_0x41b436[_0xa40a('0x15')]?_0x41b436[_0xa40a('0x15')][_0xa40a('0x1b')]||null:null,'limit':_0x41b436[_0xa40a('0x15')]?_0x41b436[_0xa40a('0x15')][_0xa40a('0x1c')]||null:null})[_0xa40a('0x16')](function(_0x4730b2){logger[_0xa40a('0x9')](_0xa40a('0x1d'),_0x41b436);logger['debug']('UpdateVoiceAgentReport',_0x41b436,JSON[_0xa40a('0xe')](_0x4730b2));_0x1042fa(_0x4730b2);})['catch'](function(_0x549fcb){logger['error'](_0xa40a('0x1d'),_0x549fcb[_0xa40a('0x11')],_0x41b436);_0x3a5b81(_0x1fc0cb[_0xa40a('0xf')](0x1f4,_0x549fcb[_0xa40a('0x11')]));});});}; \ No newline at end of file +var _0xae9f=['VoiceAgentReport','create','options','raw','debug','UpdateVoiceAgentReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateVoiceAgentReport'];(function(_0x511717,_0x1d6fcc){var _0x529fa7=function(_0xd0ec09){while(--_0xd0ec09){_0x511717['push'](_0x511717['shift']());}};_0x529fa7(++_0x1d6fcc);}(_0xae9f,0x122));var _0xfae9=function(_0x56eaec,_0x70da79){_0x56eaec=_0x56eaec-0x0;var _0x3047c5=_0xae9f[_0x56eaec];return _0x3047c5;};'use strict';var _=require(_0xfae9('0x0'));var util=require(_0xfae9('0x1'));var moment=require(_0xfae9('0x2'));var BPromise=require(_0xfae9('0x3'));var rs=require(_0xfae9('0x4'));var fs=require('fs');var Redis=require(_0xfae9('0x5'));var db=require(_0xfae9('0x6'))['db'];var utils=require(_0xfae9('0x7'));var logger=require('../../config/logger')(_0xfae9('0x8'));var config=require(_0xfae9('0x9'));var jayson=require(_0xfae9('0xa'));var client=jayson[_0xfae9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c65ac,_0x5b31a4,_0x5a840b){return new BPromise(function(_0x49ddbc,_0x126d12){return client[_0xfae9('0xc')](_0x3c65ac,_0x5a840b)[_0xfae9('0xd')](function(_0x2ec959){logger[_0xfae9('0xe')](_0xfae9('0xf'),_0x5b31a4,'request\x20sent');logger['debug'](_0xfae9('0x10'),_0x5b31a4,'request\x20sent',JSON[_0xfae9('0x11')](_0x2ec959));if(_0x2ec959[_0xfae9('0x12')]){if(_0x2ec959[_0xfae9('0x12')][_0xfae9('0x13')]===0x1f4){logger[_0xfae9('0x12')](_0xfae9('0xf'),_0x5b31a4,_0x2ec959[_0xfae9('0x12')][_0xfae9('0x14')]);return _0x126d12(_0x2ec959[_0xfae9('0x12')]['message']);}logger[_0xfae9('0x12')](_0xfae9('0xf'),_0x5b31a4,_0x2ec959[_0xfae9('0x12')][_0xfae9('0x14')]);return _0x49ddbc(_0x2ec959[_0xfae9('0x12')][_0xfae9('0x14')]);}else{logger[_0xfae9('0xe')](_0xfae9('0xf'),_0x5b31a4,_0xfae9('0x15'));_0x49ddbc(_0x2ec959[_0xfae9('0x16')][_0xfae9('0x14')]);}})[_0xfae9('0x17')](function(_0x50cbbc){logger[_0xfae9('0x12')](_0xfae9('0xf'),_0x5b31a4,_0x50cbbc);_0x126d12(_0x50cbbc);});});}exports[_0xfae9('0x18')]=function(_0x10997c){var _0x5f5cee=this;return new Promise(function(_0x4bde7b,_0x1bca04){return db[_0xfae9('0x19')][_0xfae9('0x1a')](_0x10997c['body'],{'raw':_0x10997c[_0xfae9('0x1b')]?_0x10997c[_0xfae9('0x1b')][_0xfae9('0x1c')]===undefined?!![]:![]:!![]})[_0xfae9('0xd')](function(_0x4bb78e){logger[_0xfae9('0xe')](_0xfae9('0x18'),_0x10997c);logger[_0xfae9('0x1d')](_0xfae9('0x18'),_0x10997c,JSON['stringify'](_0x4bb78e));_0x4bde7b(_0x4bb78e);})['catch'](function(_0x227983){logger[_0xfae9('0x12')]('CreateVoiceAgentReport',_0x227983[_0xfae9('0x14')],_0x10997c);_0x1bca04(_0x5f5cee['error'](0x1f4,_0x227983[_0xfae9('0x14')]));});});};exports[_0xfae9('0x1e')]=function(_0x3a2dd9){var _0x853d1a=this;return new Promise(function(_0x237b75,_0x42b11c){return db[_0xfae9('0x19')][_0xfae9('0x1f')](_0x3a2dd9[_0xfae9('0x20')],{'raw':_0x3a2dd9[_0xfae9('0x1b')]?_0x3a2dd9[_0xfae9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a2dd9[_0xfae9('0x1b')]?_0x3a2dd9[_0xfae9('0x1b')][_0xfae9('0x21')]||null:null,'attributes':_0x3a2dd9[_0xfae9('0x1b')]?_0x3a2dd9[_0xfae9('0x1b')]['attributes']||null:null,'limit':_0x3a2dd9[_0xfae9('0x1b')]?_0x3a2dd9[_0xfae9('0x1b')][_0xfae9('0x22')]||null:null})[_0xfae9('0xd')](function(_0x44517d){logger[_0xfae9('0xe')](_0xfae9('0x1e'),_0x3a2dd9);logger[_0xfae9('0x1d')](_0xfae9('0x1e'),_0x3a2dd9,JSON['stringify'](_0x44517d));_0x237b75(_0x44517d);})[_0xfae9('0x17')](function(_0x34a9d8){logger[_0xfae9('0x12')](_0xfae9('0x1e'),_0x34a9d8[_0xfae9('0x14')],_0x3a2dd9);_0x42b11c(_0x853d1a[_0xfae9('0x12')](0x1f4,_0x34a9d8[_0xfae9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 58ac4b9..1e38e00 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 _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe'];(function(_0x383a62,_0x487acb){var _0x203bfa=function(_0x4fa299){while(--_0x4fa299){_0x383a62['push'](_0x383a62['shift']());}};_0x203bfa(++_0x487acb);}(_0x1b20,0x66));var _0x01b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b20[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router; \ No newline at end of file +var _0x5fd1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0xf0b45,_0x338ffb){var _0x571039=function(_0x294b9b){while(--_0x294b9b){_0xf0b45['push'](_0xf0b45['shift']());}};_0x571039(++_0x338ffb);}(_0x5fd1,0x155));var _0x15fd=function(_0x34be3c,_0xf5b2f2){_0x34be3c=_0x34be3c-0x0;var _0x52d57f=_0x5fd1[_0x34be3c];return _0x52d57f;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./voiceCallReport.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0x7')](_0x15fd('0xc'),auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router['post']('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xc'),auth[_0x15fd('0x8')](),controller[_0x15fd('0x11')]);module[_0x15fd('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index ca638df..5649a35 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 _0xd7a5=['sequelize','STRING','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x5a22cb,_0x293851){var _0x439ecc=function(_0x5eb0c2){while(--_0x5eb0c2){_0x5a22cb['push'](_0x5a22cb['shift']());}};_0x439ecc(++_0x293851);}(_0xd7a5,0x1ad));var _0x5d7a=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xd7a5[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0x5d7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d7a('0x1')]},'type':{'type':Sequelize[_0x5d7a('0x2')]('inbound',_0x5d7a('0x3'),_0x5d7a('0x4'),_0x5d7a('0x5'),_0x5d7a('0x6'),_0x5d7a('0x7'))},'tag':{'type':Sequelize[_0x5d7a('0x1')]},'accountcode':{'type':Sequelize[_0x5d7a('0x1')]},'source':{'type':Sequelize[_0x5d7a('0x1')]},'destination':{'type':Sequelize[_0x5d7a('0x1')]},'destinationcontext':{'type':Sequelize[_0x5d7a('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5d7a('0x1')]},'destinationchannel':{'type':Sequelize[_0x5d7a('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5d7a('0x8')]},'starttime':{'type':Sequelize[_0x5d7a('0x9')]},'systemanswertime':{'type':Sequelize[_0x5d7a('0x9')]},'answertime':{'type':Sequelize[_0x5d7a('0x9')]},'endtime':{'type':Sequelize[_0x5d7a('0x9')]},'duration':{'type':Sequelize[_0x5d7a('0xa')]},'billableseconds':{'type':Sequelize[_0x5d7a('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5d7a('0x1')]},'amaflags':{'type':Sequelize[_0x5d7a('0x1')]},'userfield':{'type':Sequelize[_0x5d7a('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x5d7a('0x1')]},'note':{'type':Sequelize[_0x5d7a('0x1')]},'prefix':{'type':Sequelize[_0x5d7a('0x1')]},'routeid':{'type':Sequelize[_0x5d7a('0xa')]},'sipcallid':{'type':Sequelize[_0x5d7a('0x1')]}}; \ No newline at end of file +var _0x79b5=['outbound','inbound-fax','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal'];(function(_0x13d75b,_0x50f782){var _0x5723c7=function(_0x564471){while(--_0x564471){_0x13d75b['push'](_0x13d75b['shift']());}};_0x5723c7(++_0x50f782);}(_0x79b5,0x1bd));var _0x579b=function(_0x1e7563,_0x2ad814){_0x1e7563=_0x1e7563-0x0;var _0x974cae=_0x79b5[_0x1e7563];return _0x974cae;};'use strict';var Sequelize=require(_0x579b('0x0'));module[_0x579b('0x1')]={'uniqueid':{'type':Sequelize[_0x579b('0x2')]},'type':{'type':Sequelize[_0x579b('0x3')]('inbound',_0x579b('0x4'),_0x579b('0x5'),_0x579b('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x579b('0x2')]},'accountcode':{'type':Sequelize[_0x579b('0x2')]},'source':{'type':Sequelize[_0x579b('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x579b('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x579b('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x579b('0x7')]},'systemanswertime':{'type':Sequelize[_0x579b('0x7')]},'answertime':{'type':Sequelize[_0x579b('0x7')]},'endtime':{'type':Sequelize[_0x579b('0x7')]},'duration':{'type':Sequelize[_0x579b('0x8')]},'billableseconds':{'type':Sequelize[_0x579b('0x8')]},'mohtime':{'type':Sequelize[_0x579b('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x579b('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x579b('0x2')]},'userDisposition':{'type':Sequelize[_0x579b('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x579b('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x579b('0x2')]},'note':{'type':Sequelize[_0x579b('0x2')]},'prefix':{'type':Sequelize[_0x579b('0x2')]},'routeid':{'type':Sequelize[_0x579b('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index a96cb2c..cda2ee4 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xadb5,0xad));var _0x5adb=function(_0x329d74,_0x176a1c){_0x329d74=_0x329d74-0x0;var _0x2ebfe4=_0xadb5[_0x329d74];return _0x2ebfe4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _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(_0x575b72,_0x1a7eb1){var _0x561c57=function(_0x10e401){while(--_0x10e401){_0x575b72['push'](_0x575b72['shift']());}};_0x561c57(++_0x1a7eb1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x391def,_0x4b6469){_0x391def=_0x391def-0x0;var _0x2eb0d6=_0x5f2f[_0x391def];return _0x2eb0d6;};'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 7f207c8..56e8afd 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 _0x39c5=['define','report_call','uniqueid','request-promise','path','./voiceCallReport.attributes','exports'];(function(_0x3b448a,_0x54a302){var _0x4f7baf=function(_0x5def8e){while(--_0x5def8e){_0x3b448a['push'](_0x3b448a['shift']());}};_0x4f7baf(++_0x54a302);}(_0x39c5,0x114));var _0x539c=function(_0x2b32dc,_0x25a7d0){_0x2b32dc=_0x2b32dc-0x0;var _0x744d5f=_0x39c5[_0x2b32dc];return _0x744d5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x539c('0x0'));var fs=require('fs');var path=require(_0x539c('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x539c('0x2'));module[_0x539c('0x3')]=function(_0x9942b6,_0x3847eb){return _0x9942b6[_0x539c('0x4')]('VoiceCallReport',attributes,{'tableName':_0x539c('0x5'),'paranoid':![],'indexes':[{'fields':[_0x539c('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb223=['path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','moment','bluebird','request-promise'];(function(_0x342acf,_0x40770c){var _0xb95007=function(_0x4531bb){while(--_0x4531bb){_0x342acf['push'](_0x342acf['shift']());}};_0xb95007(++_0x40770c);}(_0xb223,0x194));var _0x3b22=function(_0x71c20a,_0x57fa92){_0x71c20a=_0x71c20a-0x0;var _0x5f09cd=_0xb223[_0x71c20a];return _0x5f09cd;};'use strict';var _=require('lodash');var util=require(_0x3b22('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3b22('0x1'));var BPromise=require(_0x3b22('0x2'));var rp=require(_0x3b22('0x3'));var fs=require('fs');var path=require(_0x3b22('0x4'));var rimraf=require(_0x3b22('0x5'));var config=require('../../config/environment');var attributes=require(_0x3b22('0x6'));module[_0x3b22('0x7')]=function(_0x4d91a8,_0x2d826a){return _0x4d91a8[_0x3b22('0x8')](_0x3b22('0x9'),attributes,{'tableName':_0x3b22('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3b22('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index fde2660..28ca529 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 _0xf386=['include','model','map','then','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit'];(function(_0x396e6c,_0x553366){var _0x5a3717=function(_0x46b2dc){while(--_0x46b2dc){_0x396e6c['push'](_0x396e6c['shift']());}};_0x5a3717(++_0x553366);}(_0xf386,0x9e));var _0x6f38=function(_0x284991,_0x145c4b){_0x284991=_0x284991-0x0;var _0x4e7825=_0xf386[_0x284991];return _0x4e7825;};'use strict';var _=require(_0x6f38('0x0'));var util=require(_0x6f38('0x1'));var moment=require(_0x6f38('0x2'));var BPromise=require(_0x6f38('0x3'));var rs=require(_0x6f38('0x4'));var fs=require('fs');var Redis=require(_0x6f38('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f38('0x6'))('rpc');var config=require(_0x6f38('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f38('0x8')][_0x6f38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ba733,_0x1a7c5a,_0x3816f8){return new BPromise(function(_0x48d4aa,_0x14c093){return client[_0x6f38('0xa')](_0x3ba733,_0x3816f8)['then'](function(_0x23c404){logger[_0x6f38('0xb')](_0x6f38('0xc'),_0x1a7c5a,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1a7c5a,_0x6f38('0xd'),JSON[_0x6f38('0xe')](_0x23c404));if(_0x23c404[_0x6f38('0xf')]){if(_0x23c404['error'][_0x6f38('0x10')]===0x1f4){logger['error'](_0x6f38('0xc'),_0x1a7c5a,_0x23c404[_0x6f38('0xf')][_0x6f38('0x11')]);return _0x14c093(_0x23c404[_0x6f38('0xf')][_0x6f38('0x11')]);}logger[_0x6f38('0xf')](_0x6f38('0xc'),_0x1a7c5a,_0x23c404[_0x6f38('0xf')][_0x6f38('0x11')]);return _0x48d4aa(_0x23c404[_0x6f38('0xf')][_0x6f38('0x11')]);}else{logger[_0x6f38('0xb')](_0x6f38('0xc'),_0x1a7c5a,_0x6f38('0xd'));_0x48d4aa(_0x23c404[_0x6f38('0x12')][_0x6f38('0x11')]);}})[_0x6f38('0x13')](function(_0x461ab5){logger['error'](_0x6f38('0xc'),_0x1a7c5a,_0x461ab5);_0x14c093(_0x461ab5);});});}exports[_0x6f38('0x14')]=function(_0x317aea){var _0x400ed6=this;return new Promise(function(_0x326a94,_0x1f5c77){return db[_0x6f38('0x15')][_0x6f38('0x16')]({'raw':_0x317aea['options']?_0x317aea[_0x6f38('0x17')][_0x6f38('0x18')]===undefined?!![]:![]:!![],'where':_0x317aea['options']?_0x317aea['options']['where']||null:null,'attributes':_0x317aea['options']?_0x317aea[_0x6f38('0x17')][_0x6f38('0x19')]||null:null,'limit':_0x317aea['options']?_0x317aea[_0x6f38('0x17')][_0x6f38('0x1a')]||null:null,'include':_0x317aea[_0x6f38('0x17')]?_0x317aea[_0x6f38('0x17')][_0x6f38('0x1b')]?_['map'](_0x317aea[_0x6f38('0x17')][_0x6f38('0x1b')],function(_0x322fb3){return{'model':db[_0x322fb3[_0x6f38('0x1c')]],'as':_0x322fb3['as'],'attributes':_0x322fb3[_0x6f38('0x19')],'include':_0x322fb3[_0x6f38('0x1b')]?_[_0x6f38('0x1d')](_0x322fb3[_0x6f38('0x1b')],function(_0x5e9fac){return{'model':db[_0x5e9fac[_0x6f38('0x1c')]],'as':_0x5e9fac['as'],'attributes':_0x5e9fac[_0x6f38('0x19')],'include':_0x5e9fac[_0x6f38('0x1b')]?_[_0x6f38('0x1d')](_0x5e9fac[_0x6f38('0x1b')],function(_0x8bd2e1){return{'model':db[_0x8bd2e1[_0x6f38('0x1c')]],'as':_0x8bd2e1['as'],'attributes':_0x8bd2e1[_0x6f38('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6f38('0x1e')](function(_0x196707){logger[_0x6f38('0xb')](_0x6f38('0x14'),_0x317aea);logger[_0x6f38('0x1f')](_0x6f38('0x14'),_0x317aea,JSON[_0x6f38('0xe')](_0x196707));_0x326a94(_0x196707);})[_0x6f38('0x13')](function(_0x296e71){logger[_0x6f38('0xf')](_0x6f38('0x14'),_0x296e71[_0x6f38('0x11')],_0x317aea);_0x1f5c77(_0x400ed6[_0x6f38('0xf')](0x1f4,_0x296e71[_0x6f38('0x11')]));});});};exports[_0x6f38('0x20')]=function(_0x554ba0){var _0x25bb60=this;return new Promise(function(_0x5f0295,_0xe54161){return db[_0x6f38('0x15')][_0x6f38('0x21')](_0x554ba0[_0x6f38('0x22')],{'raw':_0x554ba0['options']?_0x554ba0['options']['raw']===undefined?!![]:![]:!![]})[_0x6f38('0x1e')](function(_0x324fe0){logger[_0x6f38('0xb')](_0x6f38('0x20'),_0x554ba0);logger['debug']('CreateVoiceCallReport',_0x554ba0,JSON['stringify'](_0x324fe0));_0x5f0295(_0x324fe0);})[_0x6f38('0x13')](function(_0x2edfa1){logger['error'](_0x6f38('0x20'),_0x2edfa1['message'],_0x554ba0);_0xe54161(_0x25bb60[_0x6f38('0xf')](0x1f4,_0x2edfa1[_0x6f38('0x11')]));});});};exports[_0x6f38('0x23')]=function(_0x22bf4b){var _0x39f01d=this;return new Promise(function(_0x4e8bde,_0x5e127a){return db[_0x6f38('0x15')][_0x6f38('0x24')](_0x22bf4b[_0x6f38('0x22')],{'raw':_0x22bf4b[_0x6f38('0x17')]?_0x22bf4b['options'][_0x6f38('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22bf4b[_0x6f38('0x17')]?_0x22bf4b[_0x6f38('0x17')]['where']||null:null,'attributes':_0x22bf4b[_0x6f38('0x17')]?_0x22bf4b[_0x6f38('0x17')][_0x6f38('0x19')]||null:null,'limit':_0x22bf4b[_0x6f38('0x17')]?_0x22bf4b[_0x6f38('0x17')][_0x6f38('0x1a')]||null:null})[_0x6f38('0x1e')](function(_0x211e8f){logger[_0x6f38('0xb')](_0x6f38('0x23'),_0x22bf4b);logger[_0x6f38('0x1f')]('UpdateVoiceCallReport',_0x22bf4b,JSON[_0x6f38('0xe')](_0x211e8f));_0x4e8bde(_0x211e8f);})[_0x6f38('0x13')](function(_0x4f55aa){logger[_0x6f38('0xf')](_0x6f38('0x23'),_0x4f55aa[_0x6f38('0x11')],_0x22bf4b);_0x5e127a(_0x39f01d[_0x6f38('0xf')](0x1f4,_0x4f55aa[_0x6f38('0x11')]));});});}; \ No newline at end of file +var _0xb147=['CreateVoiceCallReport','UpdateVoiceCallReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport','findAll','options','raw','attributes','include','map','model','debug','catch','VoiceCallReport','create'];(function(_0x1d77c8,_0x474bcf){var _0x3efd70=function(_0x116fa5){while(--_0x116fa5){_0x1d77c8['push'](_0x1d77c8['shift']());}};_0x3efd70(++_0x474bcf);}(_0xb147,0x1c2));var _0x7b14=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0xb147[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require(_0x7b14('0x0'));var util=require(_0x7b14('0x1'));var moment=require(_0x7b14('0x2'));var BPromise=require(_0x7b14('0x3'));var rs=require(_0x7b14('0x4'));var fs=require('fs');var Redis=require(_0x7b14('0x5'));var db=require(_0x7b14('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7b14('0x7'));var config=require(_0x7b14('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bad64,_0xa20cd6,_0x5e4cae){return new BPromise(function(_0x1937de,_0x4aafdf){return client[_0x7b14('0x9')](_0x2bad64,_0x5e4cae)[_0x7b14('0xa')](function(_0x21e05d){logger[_0x7b14('0xb')](_0x7b14('0xc'),_0xa20cd6,_0x7b14('0xd'));logger['debug'](_0x7b14('0xe'),_0xa20cd6,_0x7b14('0xd'),JSON[_0x7b14('0xf')](_0x21e05d));if(_0x21e05d[_0x7b14('0x10')]){if(_0x21e05d[_0x7b14('0x10')]['code']===0x1f4){logger[_0x7b14('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0xa20cd6,_0x21e05d[_0x7b14('0x10')][_0x7b14('0x11')]);return _0x4aafdf(_0x21e05d['error'][_0x7b14('0x11')]);}logger[_0x7b14('0x10')](_0x7b14('0xc'),_0xa20cd6,_0x21e05d[_0x7b14('0x10')][_0x7b14('0x11')]);return _0x1937de(_0x21e05d[_0x7b14('0x10')]['message']);}else{logger[_0x7b14('0xb')](_0x7b14('0xc'),_0xa20cd6,'request\x20sent');_0x1937de(_0x21e05d[_0x7b14('0x12')][_0x7b14('0x11')]);}})['catch'](function(_0x587fc4){logger['error'](_0x7b14('0xc'),_0xa20cd6,_0x587fc4);_0x4aafdf(_0x587fc4);});});}exports[_0x7b14('0x13')]=function(_0x2e76fe){var _0x232d25=this;return new Promise(function(_0x500264,_0x365426){return db['VoiceCallReport'][_0x7b14('0x14')]({'raw':_0x2e76fe['options']?_0x2e76fe[_0x7b14('0x15')][_0x7b14('0x16')]===undefined?!![]:![]:!![],'where':_0x2e76fe[_0x7b14('0x15')]?_0x2e76fe[_0x7b14('0x15')]['where']||null:null,'attributes':_0x2e76fe[_0x7b14('0x15')]?_0x2e76fe[_0x7b14('0x15')][_0x7b14('0x17')]||null:null,'limit':_0x2e76fe['options']?_0x2e76fe[_0x7b14('0x15')]['limit']||null:null,'include':_0x2e76fe[_0x7b14('0x15')]?_0x2e76fe[_0x7b14('0x15')][_0x7b14('0x18')]?_[_0x7b14('0x19')](_0x2e76fe[_0x7b14('0x15')][_0x7b14('0x18')],function(_0x4a8283){return{'model':db[_0x4a8283['model']],'as':_0x4a8283['as'],'attributes':_0x4a8283[_0x7b14('0x17')],'include':_0x4a8283[_0x7b14('0x18')]?_[_0x7b14('0x19')](_0x4a8283[_0x7b14('0x18')],function(_0x16c53c){return{'model':db[_0x16c53c[_0x7b14('0x1a')]],'as':_0x16c53c['as'],'attributes':_0x16c53c[_0x7b14('0x17')],'include':_0x16c53c[_0x7b14('0x18')]?_[_0x7b14('0x19')](_0x16c53c[_0x7b14('0x18')],function(_0x5ccd36){return{'model':db[_0x5ccd36[_0x7b14('0x1a')]],'as':_0x5ccd36['as'],'attributes':_0x5ccd36[_0x7b14('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7b14('0xa')](function(_0x26133b){logger[_0x7b14('0xb')](_0x7b14('0x13'),_0x2e76fe);logger[_0x7b14('0x1b')](_0x7b14('0x13'),_0x2e76fe,JSON[_0x7b14('0xf')](_0x26133b));_0x500264(_0x26133b);})[_0x7b14('0x1c')](function(_0x2364f1){logger[_0x7b14('0x10')](_0x7b14('0x13'),_0x2364f1[_0x7b14('0x11')],_0x2e76fe);_0x365426(_0x232d25[_0x7b14('0x10')](0x1f4,_0x2364f1[_0x7b14('0x11')]));});});};exports['CreateVoiceCallReport']=function(_0x29e343){var _0x1bc8b8=this;return new Promise(function(_0x202898,_0x568583){return db[_0x7b14('0x1d')][_0x7b14('0x1e')](_0x29e343['body'],{'raw':_0x29e343[_0x7b14('0x15')]?_0x29e343[_0x7b14('0x15')][_0x7b14('0x16')]===undefined?!![]:![]:!![]})[_0x7b14('0xa')](function(_0x31111c){logger[_0x7b14('0xb')](_0x7b14('0x1f'),_0x29e343);logger['debug'](_0x7b14('0x1f'),_0x29e343,JSON[_0x7b14('0xf')](_0x31111c));_0x202898(_0x31111c);})[_0x7b14('0x1c')](function(_0x1b6799){logger[_0x7b14('0x10')](_0x7b14('0x1f'),_0x1b6799['message'],_0x29e343);_0x568583(_0x1bc8b8[_0x7b14('0x10')](0x1f4,_0x1b6799[_0x7b14('0x11')]));});});};exports[_0x7b14('0x20')]=function(_0x34ae9f){var _0x4c8fab=this;return new Promise(function(_0x23a141,_0x5b24dc){return db[_0x7b14('0x1d')][_0x7b14('0x21')](_0x34ae9f[_0x7b14('0x22')],{'raw':_0x34ae9f[_0x7b14('0x15')]?_0x34ae9f['options'][_0x7b14('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34ae9f[_0x7b14('0x15')]?_0x34ae9f['options'][_0x7b14('0x23')]||null:null,'attributes':_0x34ae9f[_0x7b14('0x15')]?_0x34ae9f[_0x7b14('0x15')][_0x7b14('0x17')]||null:null,'limit':_0x34ae9f[_0x7b14('0x15')]?_0x34ae9f[_0x7b14('0x15')][_0x7b14('0x24')]||null:null})[_0x7b14('0xa')](function(_0x20f52a){logger['info'](_0x7b14('0x20'),_0x34ae9f);logger[_0x7b14('0x1b')](_0x7b14('0x20'),_0x34ae9f,JSON[_0x7b14('0xf')](_0x20f52a));_0x23a141(_0x20f52a);})[_0x7b14('0x1c')](function(_0x4f939e){logger[_0x7b14('0x10')](_0x7b14('0x20'),_0x4f939e[_0x7b14('0x11')],_0x34ae9f);_0x5b24dc(_0x4c8fab[_0x7b14('0x10')](0x1f4,_0x4f939e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 269b110..ec2c268 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 _0xc394=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','show','create','put','/:id','delete','destroy','multer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc394,0xc5));var _0x4c39=function(_0x2136bc,_0x36363b){_0x2136bc=_0x2136bc-0x0;var _0x3a50de=_0xc394[_0x2136bc];return _0x3a50de;};'use strict';var multer=require(_0x4c39('0x0'));var util=require(_0x4c39('0x1'));var path=require(_0x4c39('0x2'));var timeout=require(_0x4c39('0x3'));var express=require(_0x4c39('0x4'));var router=express[_0x4c39('0x5')]();var fs_extra=require(_0x4c39('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4c39('0x7'));var config=require(_0x4c39('0x8'));var controller=require(_0x4c39('0x9'));router['get']('/',auth[_0x4c39('0xa')](),controller['index']);router[_0x4c39('0xb')]('/:id',auth[_0x4c39('0xa')](),controller[_0x4c39('0xc')]);router['post']('/',auth[_0x4c39('0xa')](),controller[_0x4c39('0xd')]);router[_0x4c39('0xe')](_0x4c39('0xf'),auth[_0x4c39('0xa')](),controller['update']);router[_0x4c39('0x10')](_0x4c39('0xf'),auth['isAuthenticated'](),controller[_0x4c39('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1ada=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','show','post','isAuthenticated','create','update','destroy','exports','multer','util','path','express'];(function(_0x50667a,_0x86eb28){var _0x4987e5=function(_0x4482b1){while(--_0x4482b1){_0x50667a['push'](_0x50667a['shift']());}};_0x4987e5(++_0x86eb28);}(_0x1ada,0x1ea));var _0xa1ad=function(_0x14d53c,_0x3040f6){_0x14d53c=_0x14d53c-0x0;var _0x5522f2=_0x1ada[_0x14d53c];return _0x5522f2;};'use strict';var multer=require(_0xa1ad('0x0'));var util=require(_0xa1ad('0x1'));var path=require(_0xa1ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xa1ad('0x3'));var router=express[_0xa1ad('0x4')]();var fs_extra=require(_0xa1ad('0x5'));var auth=require(_0xa1ad('0x6'));var interaction=require(_0xa1ad('0x7'));var config=require(_0xa1ad('0x8'));var controller=require(_0xa1ad('0x9'));router[_0xa1ad('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa1ad('0xa')](_0xa1ad('0xb'),auth['isAuthenticated'](),controller[_0xa1ad('0xc')]);router[_0xa1ad('0xd')]('/',auth[_0xa1ad('0xe')](),controller[_0xa1ad('0xf')]);router['put']('/:id',auth[_0xa1ad('0xe')](),controller[_0xa1ad('0x10')]);router['delete'](_0xa1ad('0xb'),auth[_0xa1ad('0xe')](),controller[_0xa1ad('0x11')]);module[_0xa1ad('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 04bdfa2..b0a01bb 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 _0x6eb2=['join','getDataValue','split','sequelize','exports','STRING','name','options'];(function(_0x11ed52,_0xe2c31f){var _0xeee5ea=function(_0x4ea7af){while(--_0x4ea7af){_0x11ed52['push'](_0x11ed52['shift']());}};_0xeee5ea(++_0xe2c31f);}(_0x6eb2,0x19b));var _0x26eb=function(_0x58b6c7,_0x3bf35e){_0x58b6c7=_0x58b6c7-0x0;var _0x5f50d0=_0x6eb2[_0x58b6c7];return _0x5f50d0;};'use strict';var Sequelize=require(_0x26eb('0x0'));module[_0x26eb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x26eb('0x2')],'unique':_0x26eb('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x26eb('0x2')],'set':function(_0x4d0a46){this['setDataValue'](_0x26eb('0x4'),_0x4d0a46?_0x4d0a46[_0x26eb('0x5')](''):[]);},'get':function(){return this[_0x26eb('0x6')](_0x26eb('0x4'))?this[_0x26eb('0x6')](_0x26eb('0x4'))[_0x26eb('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x26eb('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x26eb('0x2')]},'description':{'type':Sequelize[_0x26eb('0x2')]}}; \ No newline at end of file +var _0x664f=['STRING','name','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x664f,0x139));var _0xf664=function(_0x5279cb,_0x1601be){_0x5279cb=_0x5279cb-0x0;var _0x55785a=_0x664f[_0x5279cb];return _0x55785a;};'use strict';var Sequelize=require(_0xf664('0x0'));module[_0xf664('0x1')]={'name':{'type':Sequelize[_0xf664('0x2')]},'prefix':{'type':Sequelize[_0xf664('0x2')],'unique':_0xf664('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xf664('0x2')],'set':function(_0x42c971){this['setDataValue'](_0xf664('0x4'),_0x42c971?_0x42c971[_0xf664('0x5')](''):[]);},'get':function(){return this[_0xf664('0x6')](_0xf664('0x4'))?this[_0xf664('0x6')](_0xf664('0x4'))[_0xf664('0x7')](''):[];}},'auth':{'type':Sequelize[_0xf664('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xf664('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf664('0x2')]},'description':{'type':Sequelize[_0xf664('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d28e647..6df975e 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 _0x8128=['filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','ChanSpies','then','status','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x71fbb7,_0x7c2055){var _0x192185=function(_0xeef1bd){while(--_0xeef1bd){_0x71fbb7['push'](_0x71fbb7['shift']());}};_0x192185(++_0x7c2055);}(_0x8128,0x1b1));var _0x8812=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8128[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x8812('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8812('0x1'));var rp=require(_0x8812('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8812('0x3'));var util=require(_0x8812('0x4'));var path=require(_0x8812('0x5'));var sox=require('sox');var csv=require(_0x8812('0x6'));var ejs=require(_0x8812('0x7'));var fs=require('fs');var fs_extra=require(_0x8812('0x8'));var _=require(_0x8812('0x9'));var squel=require('squel');var crypto=require(_0x8812('0xa'));var jsforce=require(_0x8812('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8812('0xc'));var Redis=require(_0x8812('0xd'));var authService=require(_0x8812('0xe'));var qs=require(_0x8812('0xf'));var as=require(_0x8812('0x10'));var hardwareService=require(_0x8812('0x11'));var logger=require(_0x8812('0x12'))(_0x8812('0x13'));var utils=require(_0x8812('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8812('0x15'));var db=require(_0x8812('0x16'))['db'];function respondWithStatusCode(_0x405af2,_0xc68540){_0xc68540=_0xc68540||0xcc;return function(_0x30ab14){if(_0x30ab14){return _0x405af2[_0x8812('0x17')](_0xc68540);}return _0x405af2['status'](_0xc68540)[_0x8812('0x18')]();};}function respondWithResult(_0x43bb44,_0x589fd9){_0x589fd9=_0x589fd9||0xc8;return function(_0x557c5c){if(_0x557c5c){return _0x43bb44['status'](_0x589fd9)[_0x8812('0x19')](_0x557c5c);}};}function respondWithFilteredResult(_0x11f760,_0x554ddb){return function(_0x50f04c){if(_0x50f04c){var _0x554cfa=typeof _0x554ddb['offset']==='undefined'&&typeof _0x554ddb[_0x8812('0x1a')]==='undefined';var _0x15acbe=_0x50f04c['count'];var _0x447f9b=_0x554cfa?0x0:_0x554ddb[_0x8812('0x1b')];var _0x4ae563=_0x554cfa?_0x50f04c[_0x8812('0x1c')]:_0x554ddb[_0x8812('0x1b')]+_0x554ddb[_0x8812('0x1a')];var _0x5096fc;if(_0x4ae563>=_0x15acbe){_0x4ae563=_0x15acbe;_0x5096fc=0xc8;}else{_0x5096fc=0xce;}_0x11f760['status'](_0x5096fc);return _0x11f760[_0x8812('0x1d')](_0x8812('0x1e'),_0x447f9b+'-'+_0x4ae563+'/'+_0x15acbe)[_0x8812('0x19')](_0x50f04c);}return null;};}function patchUpdates(_0x38a2df){return function(_0x423ba1){try{jsonpatch[_0x8812('0x1f')](_0x423ba1,_0x38a2df,!![]);}catch(_0x4be5e9){return BPromise[_0x8812('0x20')](_0x4be5e9);}return _0x423ba1[_0x8812('0x21')]();};}function saveUpdates(_0xa20398,_0x5e2280){return function(_0x22e8bc){if(_0x22e8bc){return _0x22e8bc[_0x8812('0x22')](_0xa20398)['then'](function(_0x392778){return _0x392778;});}return null;};}function removeEntity(_0x545ec7,_0x29572a){return function(_0x16e486){if(_0x16e486){return _0x16e486[_0x8812('0x23')]()['then'](function(){var _0x22fb2d=_0x16e486[_0x8812('0x24')]({'plain':!![]});var _0x115215=_0x8812('0x25');return db['UserProfileResource'][_0x8812('0x23')]({'where':{'type':_0x115215,'resourceId':_0x22fb2d['id']}})[_0x8812('0x26')](function(){return _0x16e486;});})[_0x8812('0x26')](function(){_0x545ec7[_0x8812('0x27')](0xcc)[_0x8812('0x18')]();});}};}function handleEntityNotFound(_0xd33f4b,_0x46f113){return function(_0x117a24){if(!_0x117a24){_0xd33f4b[_0x8812('0x17')](0x194);}return _0x117a24;};}function handleError(_0xdea554,_0x5f150d){_0x5f150d=_0x5f150d||0x1f4;return function(_0x501d4a){logger['error'](_0x501d4a['stack']);if(_0x501d4a[_0x8812('0x28')]){delete _0x501d4a[_0x8812('0x28')];}_0xdea554[_0x8812('0x27')](_0x5f150d)[_0x8812('0x29')](_0x501d4a);};}exports[_0x8812('0x2a')]=function(_0x54bec0,_0x2914f6){var _0xef8778={},_0x2ca077={},_0x288092={'count':0x0,'rows':[]};var _0x502d48=_[_0x8812('0x2b')](db[_0x8812('0x2c')][_0x8812('0x2d')],function(_0x381fbf){return{'name':_0x381fbf[_0x8812('0x2e')],'type':_0x381fbf[_0x8812('0x2f')][_0x8812('0x30')]};});_0x2ca077['model']=_[_0x8812('0x2b')](_0x502d48,_0x8812('0x28'));_0x2ca077[_0x8812('0x31')]=_[_0x8812('0x32')](_0x54bec0['query']);_0x2ca077['filters']=_['intersection'](_0x2ca077[_0x8812('0x33')],_0x2ca077[_0x8812('0x31')]);_0xef8778[_0x8812('0x34')]=_['intersection'](_0x2ca077['model'],qs['fields'](_0x54bec0[_0x8812('0x31')][_0x8812('0x35')]));_0xef8778['attributes']=_0xef8778[_0x8812('0x34')][_0x8812('0x36')]?_0xef8778[_0x8812('0x34')]:_0x2ca077[_0x8812('0x33')];if(!_0x54bec0['query'][_0x8812('0x37')](_0x8812('0x38'))){_0xef8778['limit']=qs['limit'](_0x54bec0[_0x8812('0x31')][_0x8812('0x1a')]);_0xef8778['offset']=qs['offset'](_0x54bec0[_0x8812('0x31')][_0x8812('0x1b')]);}_0xef8778['order']=qs[_0x8812('0x39')](_0x54bec0['query']['sort']);_0xef8778[_0x8812('0x3a')]=qs[_0x8812('0x3b')](_[_0x8812('0x3c')](_0x54bec0['query'],_0x2ca077[_0x8812('0x3b')]),_0x502d48);if(_0x54bec0[_0x8812('0x31')][_0x8812('0x3d')]){_0xef8778['where']=_['merge'](_0xef8778[_0x8812('0x3a')],{'$or':_[_0x8812('0x2b')](_0x502d48,function(_0x19f40e){if(_0x19f40e[_0x8812('0x2f')]!=='VIRTUAL'){var _0x3adca6={};_0x3adca6[_0x19f40e[_0x8812('0x28')]]={'$like':'%'+_0x54bec0[_0x8812('0x31')][_0x8812('0x3d')]+'%'};return _0x3adca6;}})});}_0xef8778=_[_0x8812('0x3e')]({},_0xef8778,_0x54bec0[_0x8812('0x3f')]);var _0x19eb04={'where':_0xef8778[_0x8812('0x3a')]};return db['VoiceChanSpy']['count'](_0x19eb04)[_0x8812('0x26')](function(_0x4dc2b4){_0x288092[_0x8812('0x1c')]=_0x4dc2b4;if(_0x54bec0[_0x8812('0x31')][_0x8812('0x40')]){_0xef8778[_0x8812('0x41')]=[{'all':!![]}];}return db[_0x8812('0x2c')][_0x8812('0x42')](_0xef8778);})['then'](function(_0x3e7bc0){_0x288092['rows']=_0x3e7bc0;return _0x288092;})[_0x8812('0x26')](respondWithFilteredResult(_0x2914f6,_0xef8778))[_0x8812('0x43')](handleError(_0x2914f6,null));};exports[_0x8812('0x44')]=function(_0xdca303,_0x1dc070){var _0x2dc717={'raw':![],'where':{'id':_0xdca303[_0x8812('0x45')]['id']}},_0x3917bb={};_0x3917bb[_0x8812('0x33')]=_[_0x8812('0x32')](db[_0x8812('0x2c')][_0x8812('0x2d')]);_0x3917bb[_0x8812('0x31')]=_['keys'](_0xdca303[_0x8812('0x31')]);_0x3917bb['filters']=_['intersection'](_0x3917bb[_0x8812('0x33')],_0x3917bb[_0x8812('0x31')]);_0x2dc717[_0x8812('0x34')]=_[_0x8812('0x46')](_0x3917bb['model'],qs['fields'](_0xdca303[_0x8812('0x31')][_0x8812('0x35')]));_0x2dc717['attributes']=_0x2dc717[_0x8812('0x34')]['length']?_0x2dc717['attributes']:_0x3917bb['model'];if(_0xdca303[_0x8812('0x31')][_0x8812('0x40')]){_0x2dc717[_0x8812('0x41')]=[{'all':!![]}];}_0x2dc717=_['merge']({},_0x2dc717,_0xdca303[_0x8812('0x3f')]);return db['VoiceChanSpy'][_0x8812('0x47')](_0x2dc717)[_0x8812('0x26')](handleEntityNotFound(_0x1dc070,null))['then'](respondWithResult(_0x1dc070,null))[_0x8812('0x43')](handleError(_0x1dc070,null));};exports[_0x8812('0x48')]=function(_0x2baeda,_0x572304){return db[_0x8812('0x2c')][_0x8812('0x48')](_0x2baeda[_0x8812('0x49')],{})['then'](function(_0x360c0c){var _0x53f712=_0x2baeda[_0x8812('0x4a')][_0x8812('0x24')]({'plain':!![]});if(!_0x53f712)throw new Error(_0x8812('0x4b'));if(_0x53f712[_0x8812('0x4c')]===_0x8812('0x4a')){var _0x4bed02=_0x360c0c[_0x8812('0x24')]({'plain':!![]});var _0x3aae37=_0x8812('0x25');return db[_0x8812('0x4d')]['find']({'where':{'name':_0x3aae37,'userProfileId':_0x53f712[_0x8812('0x4e')]},'raw':!![]})[_0x8812('0x26')](function(_0x34f710){if(_0x34f710&&_0x34f710[_0x8812('0x4f')]===0x0){return db[_0x8812('0x50')]['create']({'name':_0x4bed02[_0x8812('0x28')],'resourceId':_0x4bed02['id'],'type':_0x34f710[_0x8812('0x28')],'sectionId':_0x34f710['id']},{})[_0x8812('0x26')](function(){return _0x360c0c;});}else{return _0x360c0c;}})[_0x8812('0x43')](function(_0x364a0){logger['error'](_0x8812('0x51'),_0x364a0);throw _0x364a0;});}return _0x360c0c;})[_0x8812('0x26')](respondWithResult(_0x572304,0xc9))[_0x8812('0x43')](handleError(_0x572304,null));};exports[_0x8812('0x22')]=function(_0x4f904c,_0x4e0324){if(_0x4f904c[_0x8812('0x49')]['id']){delete _0x4f904c[_0x8812('0x49')]['id'];}return db['VoiceChanSpy'][_0x8812('0x47')]({'where':{'id':_0x4f904c[_0x8812('0x45')]['id']}})[_0x8812('0x26')](handleEntityNotFound(_0x4e0324,null))[_0x8812('0x26')](saveUpdates(_0x4f904c[_0x8812('0x49')],null))[_0x8812('0x26')](respondWithResult(_0x4e0324,null))[_0x8812('0x43')](handleError(_0x4e0324,null));};exports[_0x8812('0x23')]=function(_0x3106e1,_0x4ca570){return db[_0x8812('0x2c')][_0x8812('0x47')]({'where':{'id':_0x3106e1['params']['id']}})[_0x8812('0x26')](handleEntityNotFound(_0x4ca570,null))[_0x8812('0x26')](removeEntity(_0x4ca570,null))['catch'](handleError(_0x4ca570,null));}; \ No newline at end of file +var _0x24cd=['undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','fast-json-patch','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x45fe0c,_0x4a0487){var _0x3d2d84=function(_0x469f63){while(--_0x469f63){_0x45fe0c['push'](_0x45fe0c['shift']());}};_0x3d2d84(++_0x4a0487);}(_0x24cd,0x83));var _0xd24c=function(_0x4f481d,_0x53d186){_0x4f481d=_0x4f481d-0x0;var _0x42ec70=_0x24cd[_0x4f481d];return _0x42ec70;};'use strict';var emlformat=require(_0xd24c('0x0'));var rimraf=require(_0xd24c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd24c('0x2'));var rp=require('request-promise');var moment=require(_0xd24c('0x3'));var BPromise=require(_0xd24c('0x4'));var Mustache=require(_0xd24c('0x5'));var util=require('util');var path=require(_0xd24c('0x6'));var sox=require(_0xd24c('0x7'));var csv=require('to-csv');var ejs=require(_0xd24c('0x8'));var fs=require('fs');var fs_extra=require(_0xd24c('0x9'));var _=require(_0xd24c('0xa'));var squel=require(_0xd24c('0xb'));var crypto=require(_0xd24c('0xc'));var jsforce=require(_0xd24c('0xd'));var deskjs=require(_0xd24c('0xe'));var toCsv=require(_0xd24c('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd24c('0x10'));var authService=require(_0xd24c('0x11'));var qs=require(_0xd24c('0x12'));var as=require(_0xd24c('0x13'));var hardwareService=require(_0xd24c('0x14'));var logger=require(_0xd24c('0x15'))(_0xd24c('0x16'));var utils=require(_0xd24c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd24c('0x18'));var db=require(_0xd24c('0x19'))['db'];function respondWithStatusCode(_0x55de4d,_0x3296ea){_0x3296ea=_0x3296ea||0xcc;return function(_0x3bed2){if(_0x3bed2){return _0x55de4d[_0xd24c('0x1a')](_0x3296ea);}return _0x55de4d[_0xd24c('0x1b')](_0x3296ea)[_0xd24c('0x1c')]();};}function respondWithResult(_0x6a81d9,_0x2c29c6){_0x2c29c6=_0x2c29c6||0xc8;return function(_0x20b624){if(_0x20b624){return _0x6a81d9['status'](_0x2c29c6)[_0xd24c('0x1d')](_0x20b624);}};}function respondWithFilteredResult(_0xe096c,_0x528489){return function(_0x34aa92){if(_0x34aa92){var _0x3aa193=typeof _0x528489[_0xd24c('0x1e')]===_0xd24c('0x1f')&&typeof _0x528489['limit']==='undefined';var _0xc87bb7=_0x34aa92[_0xd24c('0x20')];var _0x170d59=_0x3aa193?0x0:_0x528489['offset'];var _0x9f2d2d=_0x3aa193?_0x34aa92[_0xd24c('0x20')]:_0x528489[_0xd24c('0x1e')]+_0x528489[_0xd24c('0x21')];var _0x478a0f;if(_0x9f2d2d>=_0xc87bb7){_0x9f2d2d=_0xc87bb7;_0x478a0f=0xc8;}else{_0x478a0f=0xce;}_0xe096c[_0xd24c('0x1b')](_0x478a0f);return _0xe096c['set'](_0xd24c('0x22'),_0x170d59+'-'+_0x9f2d2d+'/'+_0xc87bb7)[_0xd24c('0x1d')](_0x34aa92);}return null;};}function patchUpdates(_0x1b3a2f){return function(_0x38c380){try{jsonpatch[_0xd24c('0x23')](_0x38c380,_0x1b3a2f,!![]);}catch(_0x4964e5){return BPromise[_0xd24c('0x24')](_0x4964e5);}return _0x38c380[_0xd24c('0x25')]();};}function saveUpdates(_0x17375b,_0x206ce7){return function(_0x48fffd){if(_0x48fffd){return _0x48fffd[_0xd24c('0x26')](_0x17375b)[_0xd24c('0x27')](function(_0x2549d0){return _0x2549d0;});}return null;};}function removeEntity(_0x5c862f,_0x44471f){return function(_0x2c3328){if(_0x2c3328){return _0x2c3328[_0xd24c('0x28')]()['then'](function(){var _0x4539e7=_0x2c3328[_0xd24c('0x29')]({'plain':!![]});var _0x848e0e=_0xd24c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x848e0e,'resourceId':_0x4539e7['id']}})[_0xd24c('0x27')](function(){return _0x2c3328;});})['then'](function(){_0x5c862f[_0xd24c('0x1b')](0xcc)[_0xd24c('0x1c')]();});}};}function handleEntityNotFound(_0x325fcc,_0x4c0d99){return function(_0x4cb1b3){if(!_0x4cb1b3){_0x325fcc[_0xd24c('0x1a')](0x194);}return _0x4cb1b3;};}function handleError(_0x14d44a,_0x1a18b7){_0x1a18b7=_0x1a18b7||0x1f4;return function(_0x160f03){logger[_0xd24c('0x2b')](_0x160f03[_0xd24c('0x2c')]);if(_0x160f03[_0xd24c('0x2d')]){delete _0x160f03[_0xd24c('0x2d')];}_0x14d44a[_0xd24c('0x1b')](_0x1a18b7)[_0xd24c('0x2e')](_0x160f03);};}exports[_0xd24c('0x2f')]=function(_0x59cbb6,_0x4e128b){var _0x305e90={},_0x445bc6={},_0x1dc70b={'count':0x0,'rows':[]};var _0x56260c=_['map'](db[_0xd24c('0x30')][_0xd24c('0x31')],function(_0x34a64c){return{'name':_0x34a64c[_0xd24c('0x32')],'type':_0x34a64c['type'][_0xd24c('0x33')]};});_0x445bc6[_0xd24c('0x34')]=_[_0xd24c('0x35')](_0x56260c,_0xd24c('0x2d'));_0x445bc6[_0xd24c('0x36')]=_[_0xd24c('0x37')](_0x59cbb6[_0xd24c('0x36')]);_0x445bc6[_0xd24c('0x38')]=_[_0xd24c('0x39')](_0x445bc6['model'],_0x445bc6[_0xd24c('0x36')]);_0x305e90['attributes']=_['intersection'](_0x445bc6[_0xd24c('0x34')],qs[_0xd24c('0x3a')](_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x3a')]));_0x305e90[_0xd24c('0x3b')]=_0x305e90[_0xd24c('0x3b')][_0xd24c('0x3c')]?_0x305e90['attributes']:_0x445bc6[_0xd24c('0x34')];if(!_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x3d')](_0xd24c('0x3e'))){_0x305e90[_0xd24c('0x21')]=qs[_0xd24c('0x21')](_0x59cbb6['query'][_0xd24c('0x21')]);_0x305e90[_0xd24c('0x1e')]=qs['offset'](_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x1e')]);}_0x305e90['order']=qs[_0xd24c('0x3f')](_0x59cbb6[_0xd24c('0x36')]['sort']);_0x305e90[_0xd24c('0x40')]=qs[_0xd24c('0x38')](_[_0xd24c('0x41')](_0x59cbb6[_0xd24c('0x36')],_0x445bc6['filters']),_0x56260c);if(_0x59cbb6[_0xd24c('0x36')]['filter']){_0x305e90[_0xd24c('0x40')]=_['merge'](_0x305e90['where'],{'$or':_['map'](_0x56260c,function(_0x4160fb){if(_0x4160fb['type']!=='VIRTUAL'){var _0x66f45={};_0x66f45[_0x4160fb[_0xd24c('0x2d')]]={'$like':'%'+_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x42')]+'%'};return _0x66f45;}})});}_0x305e90=_['merge']({},_0x305e90,_0x59cbb6[_0xd24c('0x43')]);var _0x54a924={'where':_0x305e90[_0xd24c('0x40')]};return db[_0xd24c('0x30')][_0xd24c('0x20')](_0x54a924)[_0xd24c('0x27')](function(_0x27eefa){_0x1dc70b[_0xd24c('0x20')]=_0x27eefa;if(_0x59cbb6[_0xd24c('0x36')][_0xd24c('0x44')]){_0x305e90[_0xd24c('0x45')]=[{'all':!![]}];}return db[_0xd24c('0x30')]['findAll'](_0x305e90);})[_0xd24c('0x27')](function(_0x742082){_0x1dc70b['rows']=_0x742082;return _0x1dc70b;})[_0xd24c('0x27')](respondWithFilteredResult(_0x4e128b,_0x305e90))[_0xd24c('0x46')](handleError(_0x4e128b,null));};exports['show']=function(_0x2f2981,_0x5d91fe){var _0x39cd94={'raw':![],'where':{'id':_0x2f2981[_0xd24c('0x47')]['id']}},_0x2d46b8={};_0x2d46b8[_0xd24c('0x34')]=_[_0xd24c('0x37')](db['VoiceChanSpy'][_0xd24c('0x31')]);_0x2d46b8['query']=_[_0xd24c('0x37')](_0x2f2981['query']);_0x2d46b8[_0xd24c('0x38')]=_[_0xd24c('0x39')](_0x2d46b8['model'],_0x2d46b8[_0xd24c('0x36')]);_0x39cd94[_0xd24c('0x3b')]=_['intersection'](_0x2d46b8[_0xd24c('0x34')],qs['fields'](_0x2f2981['query']['fields']));_0x39cd94[_0xd24c('0x3b')]=_0x39cd94[_0xd24c('0x3b')]['length']?_0x39cd94['attributes']:_0x2d46b8[_0xd24c('0x34')];if(_0x2f2981[_0xd24c('0x36')][_0xd24c('0x44')]){_0x39cd94[_0xd24c('0x45')]=[{'all':!![]}];}_0x39cd94=_['merge']({},_0x39cd94,_0x2f2981[_0xd24c('0x43')]);return db[_0xd24c('0x30')]['find'](_0x39cd94)[_0xd24c('0x27')](handleEntityNotFound(_0x5d91fe,null))[_0xd24c('0x27')](respondWithResult(_0x5d91fe,null))[_0xd24c('0x46')](handleError(_0x5d91fe,null));};exports['create']=function(_0x3039aa,_0x4b10c6){return db[_0xd24c('0x30')][_0xd24c('0x48')](_0x3039aa[_0xd24c('0x49')],{})[_0xd24c('0x27')](function(_0x47d5ce){var _0x14684c=_0x3039aa[_0xd24c('0x4a')][_0xd24c('0x29')]({'plain':!![]});if(!_0x14684c)throw new Error(_0xd24c('0x4b'));if(_0x14684c[_0xd24c('0x4c')]===_0xd24c('0x4a')){var _0x3ce7d0=_0x47d5ce[_0xd24c('0x29')]({'plain':!![]});var _0x47067c=_0xd24c('0x2a');return db[_0xd24c('0x4d')]['find']({'where':{'name':_0x47067c,'userProfileId':_0x14684c[_0xd24c('0x4e')]},'raw':!![]})[_0xd24c('0x27')](function(_0x48f011){if(_0x48f011&&_0x48f011['autoAssociation']===0x0){return db['UserProfileResource'][_0xd24c('0x48')]({'name':_0x3ce7d0[_0xd24c('0x2d')],'resourceId':_0x3ce7d0['id'],'type':_0x48f011[_0xd24c('0x2d')],'sectionId':_0x48f011['id']},{})[_0xd24c('0x27')](function(){return _0x47d5ce;});}else{return _0x47d5ce;}})[_0xd24c('0x46')](function(_0x2ea05a){logger[_0xd24c('0x2b')](_0xd24c('0x4f'),_0x2ea05a);throw _0x2ea05a;});}return _0x47d5ce;})[_0xd24c('0x27')](respondWithResult(_0x4b10c6,0xc9))[_0xd24c('0x46')](handleError(_0x4b10c6,null));};exports[_0xd24c('0x26')]=function(_0x4fbb0b,_0x3a8e76){if(_0x4fbb0b[_0xd24c('0x49')]['id']){delete _0x4fbb0b['body']['id'];}return db[_0xd24c('0x30')][_0xd24c('0x50')]({'where':{'id':_0x4fbb0b[_0xd24c('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a8e76,null))['then'](saveUpdates(_0x4fbb0b[_0xd24c('0x49')],null))[_0xd24c('0x27')](respondWithResult(_0x3a8e76,null))[_0xd24c('0x46')](handleError(_0x3a8e76,null));};exports[_0xd24c('0x28')]=function(_0x148685,_0x3dee09){return db[_0xd24c('0x30')][_0xd24c('0x50')]({'where':{'id':_0x148685['params']['id']}})[_0xd24c('0x27')](handleEntityNotFound(_0x3dee09,null))['then'](removeEntity(_0x3dee09,null))['catch'](handleError(_0x3dee09,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 66c41d7..2d6a9f1 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 _0x12df=['findAll','agent','catch','exports','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','SIP/%s,%s','name','options','join','length','concat','internal','User'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x12df,0xbf));var _0xf12d=function(_0x329a3b,_0x26a267){_0x329a3b=_0x329a3b-0x0;var _0x42117d=_0x12df[_0x329a3b];return _0x42117d;};'use strict';var _=require(_0xf12d('0x0'));var util=require(_0xf12d('0x1'));var BPromise=require('bluebird');var attributes=require(_0xf12d('0x2'));var getUserApplications=function(_0x1d72d6,_0xb5816d,_0x583f8f){var _0x4e78d3=0x1;var _0xc02729=[];var _0x36792c={'context':_0xb5816d[_0xf12d('0x3')]||_0xf12d('0x4'),'exten':util[_0xf12d('0x5')](_0xf12d('0x6'),_0x1d72d6['prefix'],_0x583f8f),'type':'system','isApp':![],'ChanSpyId':_0x1d72d6['id'],'UserId':_0xb5816d['id']};_0xc02729[_0xf12d('0x7')](_[_0xf12d('0x8')]({'app':_0xf12d('0x9'),'appdata':util[_0xf12d('0x5')](_0xf12d('0xa'),_0xf12d('0xb')),'priority':_0x4e78d3++},_0x36792c));if(_0x1d72d6[_0xf12d('0xc')]){_0xc02729[_0xf12d('0x7')](_[_0xf12d('0x8')]({'app':_0xf12d('0xd'),'appdata':util[_0xf12d('0x5')]('${UNIQUEID}.%s,a',_0x1d72d6[_0xf12d('0xe')]),'priority':_0x4e78d3++},_0x36792c));}if(_0x1d72d6[_0xf12d('0xf')]){_0xc02729['push'](_['merge']({'app':_0xf12d('0x10'),'appdata':_0x1d72d6['password'],'priority':_0x4e78d3++},_0x36792c));}_0xc02729[_0xf12d('0x7')](_[_0xf12d('0x8')]({'app':'ChanSpy','appdata':util[_0xf12d('0x5')](_0xf12d('0x11'),_0xb5816d[_0xf12d('0x12')],_0x1d72d6[_0xf12d('0x13')]?_0x1d72d6[_0xf12d('0x13')][_0xf12d('0x14')](''):''),'priority':_0x4e78d3++},_0x36792c));if(_0x1d72d6[_0xf12d('0xc')]){_0xc02729['push'](_[_0xf12d('0x8')]({'app':'StopMixMonitor','priority':_0x4e78d3++},_0x36792c));}return _0xc02729;};var getChanSpyApplications=function(_0x7e6364,_0x285c33){var _0x494525=[];for(var _0x782ba4=0x0,_0x4dd1df=0x1;_0x782ba4<_0x285c33[_0xf12d('0x15')];_0x782ba4++,_0x4dd1df=0x1){_0x494525=_0x494525[_0xf12d('0x16')](getUserApplications(_0x7e6364,_0x285c33[_0x782ba4],_0x285c33[_0x782ba4][_0xf12d('0x17')]));if(_0x285c33[_0x782ba4]['internal']!=_0x285c33[_0x782ba4][_0xf12d('0x12')]){_0x494525=_0x494525[_0xf12d('0x16')](getUserApplications(_0x7e6364,_0x285c33[_0x782ba4],_0x285c33[_0x782ba4]['name']));}}return _0x494525;};var getChanSpyPromise=function(_0x4f2dad,_0x5d4217){return new BPromise(function(_0x138221,_0x1d4e2f){return _0x4f2dad[_0xf12d('0x18')][_0xf12d('0x19')]({'attributes':['id','name',_0xf12d('0x17')],'where':{'role':_0xf12d('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x51beea){if(_0x51beea){return _0x138221(getChanSpyApplications(_0x5d4217,_0x51beea));}return _0x138221([]);})[_0xf12d('0x1b')](function(_0x471a74){_0x1d4e2f(_0x471a74);});});};module[_0xf12d('0x1c')]=function(_0x4695f5,_0xc7c6cb){var _0x2361a5=_0x4695f5['models'];return _0x4695f5[_0xf12d('0x1d')](_0xf12d('0x1e'),attributes,{'tableName':_0xf12d('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x6b9a68,_0x19571b,_0x4f7bc8){return getChanSpyPromise(_0x2361a5,_0x6b9a68)[_0xf12d('0x20')](function(_0x1fd9e6){if(_0x1fd9e6&&_0x1fd9e6[_0xf12d('0x15')]){return _0x2361a5[_0xf12d('0x21')][_0xf12d('0x22')](_0x1fd9e6);}})['then'](function(){_0x4f7bc8();})[_0xf12d('0x1b')](function(_0x331862){_0x4f7bc8(_0x331862);});},'afterUpdate':function(_0x3bc44a,_0xd73a9c,_0x5f3af1){return _0x2361a5['VoiceExtension'][_0xf12d('0x23')]({'where':{'ChanSpyId':_0x3bc44a['id']}})[_0xf12d('0x20')](function(){return getChanSpyPromise(_0x2361a5,_0x3bc44a);})[_0xf12d('0x20')](function(_0x1a91e6){if(_0x1a91e6&&_0x1a91e6[_0xf12d('0x15')]){return _0x2361a5['VoiceExtension'][_0xf12d('0x22')](_0x1a91e6);}})['then'](function(){_0x5f3af1();})[_0xf12d('0x1b')](function(_0x19b01c){_0x5f3af1(_0x19b01c);});},'afterDestroy':function(_0x1935a0,_0x50efe7,_0x4606b7){return _0x2361a5[_0xf12d('0x21')]['destroy']({'where':{'ChanSpyId':_0x1935a0['id']}})[_0xf12d('0x20')](function(){_0x4606b7();})[_0xf12d('0x1b')](function(_0x22069c){_0x4606b7(_0x22069c);});}}});}; \ No newline at end of file +var _0x963f=['name','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','util','context','from-sip','%s%s','prefix','merge','format','push','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','record','length','concat','internal'];(function(_0xcdbfbe,_0x46e396){var _0xf21616=function(_0x50aade){while(--_0x50aade){_0xcdbfbe['push'](_0xcdbfbe['shift']());}};_0xf21616(++_0x46e396);}(_0x963f,0x135));var _0xf963=function(_0x27d6ff,_0x1f507c){_0x27d6ff=_0x27d6ff-0x0;var _0x9239aa=_0x963f[_0x27d6ff];return _0x9239aa;};'use strict';var _=require('lodash');var util=require(_0xf963('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x1fad9,_0x1b8d88,_0x10bf62){var _0x587353=0x1;var _0x5aead0=[];var _0x121d98={'context':_0x1b8d88[_0xf963('0x1')]||_0xf963('0x2'),'exten':util['format'](_0xf963('0x3'),_0x1fad9[_0xf963('0x4')],_0x10bf62),'type':'system','isApp':![],'ChanSpyId':_0x1fad9['id'],'UserId':_0x1b8d88['id']};_0x5aead0['push'](_[_0xf963('0x5')]({'app':'Set','appdata':util[_0xf963('0x6')]('CDR(type)=%s','chanspy'),'priority':_0x587353++},_0x121d98));if(_0x1fad9['record']){_0x5aead0[_0xf963('0x7')](_[_0xf963('0x5')]({'app':'MixMonitor','appdata':util[_0xf963('0x6')](_0xf963('0x8'),_0x1fad9[_0xf963('0x9')]),'priority':_0x587353++},_0x121d98));}if(_0x1fad9[_0xf963('0xa')]){_0x5aead0[_0xf963('0x7')](_[_0xf963('0x5')]({'app':_0xf963('0xb'),'appdata':_0x1fad9[_0xf963('0xc')],'priority':_0x587353++},_0x121d98));}_0x5aead0[_0xf963('0x7')](_['merge']({'app':_0xf963('0xd'),'appdata':util[_0xf963('0x6')](_0xf963('0xe'),_0x1b8d88['name'],_0x1fad9[_0xf963('0xf')]?_0x1fad9[_0xf963('0xf')][_0xf963('0x10')](''):''),'priority':_0x587353++},_0x121d98));if(_0x1fad9[_0xf963('0x11')]){_0x5aead0['push'](_[_0xf963('0x5')]({'app':'StopMixMonitor','priority':_0x587353++},_0x121d98));}return _0x5aead0;};var getChanSpyApplications=function(_0x4e0a45,_0x5bad63){var _0x1dc4c7=[];for(var _0x20ac54=0x0,_0x48a17d=0x1;_0x20ac54<_0x5bad63[_0xf963('0x12')];_0x20ac54++,_0x48a17d=0x1){_0x1dc4c7=_0x1dc4c7[_0xf963('0x13')](getUserApplications(_0x4e0a45,_0x5bad63[_0x20ac54],_0x5bad63[_0x20ac54][_0xf963('0x14')]));if(_0x5bad63[_0x20ac54][_0xf963('0x14')]!=_0x5bad63[_0x20ac54][_0xf963('0x15')]){_0x1dc4c7=_0x1dc4c7[_0xf963('0x13')](getUserApplications(_0x4e0a45,_0x5bad63[_0x20ac54],_0x5bad63[_0x20ac54]['name']));}}return _0x1dc4c7;};var getChanSpyPromise=function(_0x2f5db8,_0xba39){return new BPromise(function(_0x36515,_0x4ddfcd){return _0x2f5db8['User'][_0xf963('0x16')]({'attributes':['id',_0xf963('0x15'),_0xf963('0x14')],'where':{'role':_0xf963('0x17'),'chanspy':!![]},'raw':!![]})['then'](function(_0xc5ea2f){if(_0xc5ea2f){return _0x36515(getChanSpyApplications(_0xba39,_0xc5ea2f));}return _0x36515([]);})[_0xf963('0x18')](function(_0x1f0f96){_0x4ddfcd(_0x1f0f96);});});};module['exports']=function(_0x222fca,_0x1faf35){var _0x55d21b=_0x222fca[_0xf963('0x19')];return _0x222fca[_0xf963('0x1a')](_0xf963('0x1b'),attributes,{'tableName':_0xf963('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2588c6,_0x382085,_0x43af75){return getChanSpyPromise(_0x55d21b,_0x2588c6)[_0xf963('0x1d')](function(_0x2e3254){if(_0x2e3254&&_0x2e3254[_0xf963('0x12')]){return _0x55d21b[_0xf963('0x1e')][_0xf963('0x1f')](_0x2e3254);}})[_0xf963('0x1d')](function(){_0x43af75();})[_0xf963('0x18')](function(_0x3188c2){_0x43af75(_0x3188c2);});},'afterUpdate':function(_0x7f26dd,_0x48a7a6,_0x5873fb){return _0x55d21b[_0xf963('0x1e')]['destroy']({'where':{'ChanSpyId':_0x7f26dd['id']}})[_0xf963('0x1d')](function(){return getChanSpyPromise(_0x55d21b,_0x7f26dd);})['then'](function(_0xf9523d){if(_0xf9523d&&_0xf9523d[_0xf963('0x12')]){return _0x55d21b[_0xf963('0x1e')]['bulkCreate'](_0xf9523d);}})['then'](function(){_0x5873fb();})[_0xf963('0x18')](function(_0x274d24){_0x5873fb(_0x274d24);});},'afterDestroy':function(_0x5e26f1,_0x596a0f,_0xb7418){return _0x55d21b[_0xf963('0x1e')][_0xf963('0x20')]({'where':{'ChanSpyId':_0x5e26f1['id']}})[_0xf963('0x1d')](function(){_0xb7418();})[_0xf963('0x18')](function(_0x438301){_0xb7418(_0x438301);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 95e7ef8..bdd5768 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 _0x4e81=['VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x907a79,_0x4192cc){var _0xf2fc52=function(_0x32ace8){while(--_0x32ace8){_0x907a79['push'](_0x907a79['shift']());}};_0xf2fc52(++_0x4192cc);}(_0x4e81,0x1bc));var _0x14e8=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x4e81[_0x231b2e];return _0x3feb2a;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});} \ No newline at end of file +var _0xe600=['rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb90c8f,_0x491fba){var _0x116156=function(_0x520819){while(--_0x520819){_0xb90c8f['push'](_0xb90c8f['shift']());}};_0x116156(++_0x491fba);}(_0xe600,0x159));var _0x0e60=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe600[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x0e60('0x0'));var moment=require('moment');var BPromise=require(_0x0e60('0x1'));var rs=require(_0x0e60('0x2'));var fs=require('fs');var Redis=require(_0x0e60('0x3'));var db=require(_0x0e60('0x4'))['db'];var utils=require(_0x0e60('0x5'));var logger=require(_0x0e60('0x6'))(_0x0e60('0x7'));var config=require(_0x0e60('0x8'));var jayson=require(_0x0e60('0x9'));var client=jayson[_0x0e60('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7563,_0x497a61,_0x6727dd){return new BPromise(function(_0x30eaed,_0x5ba123){return client[_0x0e60('0xb')](_0x1d7563,_0x6727dd)[_0x0e60('0xc')](function(_0x238537){logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));logger['debug'](_0x0e60('0x10'),_0x497a61,_0x0e60('0xf'),JSON[_0x0e60('0x11')](_0x238537));if(_0x238537[_0x0e60('0x12')]){if(_0x238537[_0x0e60('0x12')][_0x0e60('0x13')]===0x1f4){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537['error'][_0x0e60('0x14')]);return _0x5ba123(_0x238537[_0x0e60('0x12')][_0x0e60('0x14')]);}logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0x238537[_0x0e60('0x12')]['message']);return _0x30eaed(_0x238537[_0x0e60('0x12')]['message']);}else{logger[_0x0e60('0xd')](_0x0e60('0xe'),_0x497a61,_0x0e60('0xf'));_0x30eaed(_0x238537['result'][_0x0e60('0x14')]);}})[_0x0e60('0x15')](function(_0xdb7760){logger[_0x0e60('0x12')](_0x0e60('0xe'),_0x497a61,_0xdb7760);_0x5ba123(_0xdb7760);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e346902..fda7048 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 _0x263f=['update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x263f,0x1f4));var _0xf263=function(_0x21f3c3,_0x42e32c){_0x21f3c3=_0x21f3c3-0x0;var _0x15957=_0x263f[_0x21f3c3];return _0x15957;};'use strict';var multer=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var path=require('path');var timeout=require(_0xf263('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf263('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf263('0x4'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router[_0xf263('0x5')]('/',auth[_0xf263('0x6')](),controller['index']);router[_0xf263('0x5')](_0xf263('0x7'),auth[_0xf263('0x6')](),controller[_0xf263('0x8')]);router[_0xf263('0x9')]('/',auth[_0xf263('0x6')](),controller[_0xf263('0xa')]);router[_0xf263('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xf263('0xc')]);router[_0xf263('0xd')](_0xf263('0x7'),auth['isAuthenticated'](),controller[_0xf263('0xe')]);module[_0xf263('0xf')]=router; \ No newline at end of file +var _0x0f48=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x36d9bd,_0x4beab7){var _0x305da7=function(_0x19fddd){while(--_0x19fddd){_0x36d9bd['push'](_0x36d9bd['shift']());}};_0x305da7(++_0x4beab7);}(_0x0f48,0x107));var _0x80f4=function(_0x3c6252,_0x2c317d){_0x3c6252=_0x3c6252-0x0;var _0x20a188=_0x0f48[_0x3c6252];return _0x20a188;};'use strict';var multer=require(_0x80f4('0x0'));var util=require(_0x80f4('0x1'));var path=require('path');var timeout=require(_0x80f4('0x2'));var express=require(_0x80f4('0x3'));var router=express[_0x80f4('0x4')]();var fs_extra=require(_0x80f4('0x5'));var auth=require(_0x80f4('0x6'));var interaction=require(_0x80f4('0x7'));var config=require(_0x80f4('0x8'));var controller=require(_0x80f4('0x9'));router[_0x80f4('0xa')]('/',auth[_0x80f4('0xb')](),controller[_0x80f4('0xc')]);router['get'](_0x80f4('0xd'),auth[_0x80f4('0xb')](),controller['show']);router[_0x80f4('0xe')]('/',auth[_0x80f4('0xb')](),controller[_0x80f4('0xf')]);router['put'](_0x80f4('0xd'),auth[_0x80f4('0xb')](),controller['update']);router[_0x80f4('0x10')](_0x80f4('0xd'),auth[_0x80f4('0xb')](),controller[_0x80f4('0x11')]);module[_0x80f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 44e5b85..95a61c6 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 _0xa67c=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0xa67c,0x179));var _0xca67=function(_0x1076d3,_0x3103b7){_0x1076d3=_0x1076d3-0x0;var _0x5c7a59=_0xa67c[_0x1076d3];return _0x5c7a59;};'use strict';var Sequelize=require(_0xca67('0x0'));module[_0xca67('0x1')]={'name':{'type':Sequelize[_0xca67('0x2')],'unique':_0xca67('0x3')},'description':{'type':Sequelize[_0xca67('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xca67('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x591a=['exports','STRING','BOOLEAN','sequelize'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0x591a,0x163));var _0xa591=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0x591a[_0xe84805];return _0x398efd;};'use strict';var Sequelize=require(_0xa591('0x0'));module[_0xa591('0x1')]={'name':{'type':Sequelize[_0xa591('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xa591('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa591('0x3')],'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 400387b..983594f 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 _0x8572=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','end','offset','limit','count','status','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','intersection','includeAll','find','create','body','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user'];(function(_0x3f37c8,_0x2de1ad){var _0x1c3bc2=function(_0x45caf0){while(--_0x45caf0){_0x3f37c8['push'](_0x3f37c8['shift']());}};_0x1c3bc2(++_0x2de1ad);}(_0x8572,0x142));var _0x2857=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x8572[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0x2857('0x0'));var rimraf=require(_0x2857('0x1'));var zipdir=require(_0x2857('0x2'));var jsonpatch=require(_0x2857('0x3'));var rp=require('request-promise');var moment=require(_0x2857('0x4'));var BPromise=require(_0x2857('0x5'));var Mustache=require(_0x2857('0x6'));var util=require(_0x2857('0x7'));var path=require(_0x2857('0x8'));var sox=require(_0x2857('0x9'));var csv=require(_0x2857('0xa'));var ejs=require(_0x2857('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2857('0xc'));var squel=require(_0x2857('0xd'));var crypto=require(_0x2857('0xe'));var jsforce=require(_0x2857('0xf'));var deskjs=require(_0x2857('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2857('0x11'));var Papa=require(_0x2857('0x12'));var Redis=require('ioredis');var authService=require(_0x2857('0x13'));var qs=require(_0x2857('0x14'));var as=require(_0x2857('0x15'));var hardwareService=require(_0x2857('0x16'));var logger=require(_0x2857('0x17'))(_0x2857('0x18'));var utils=require(_0x2857('0x19'));var config=require(_0x2857('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2857('0x1b'))['db'];var jayson=require(_0x2857('0x1c'));var client=jayson['client'][_0x2857('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5adead,_0x185492,_0x2ad110,_0x4d164a){return new BPromise(function(_0x569b79,_0x4a578f){var _0x520809=_0x4d164a||client;return _0x520809['request'](_0x5adead,_0x2ad110)[_0x2857('0x1e')](function(_0x392748){logger[_0x2857('0x1f')](_0x2857('0x20'),_0x185492,'request\x20sent');logger[_0x2857('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x185492,'request\x20sent',JSON[_0x2857('0x22')](_0x392748));if(_0x392748['error']){if(_0x392748[_0x2857('0x23')]['code']===0x1f4){logger[_0x2857('0x23')](_0x2857('0x20'),_0x185492,_0x392748['error'][_0x2857('0x24')]);return _0x4a578f(_0x392748[_0x2857('0x23')][_0x2857('0x24')]);}logger[_0x2857('0x23')](_0x2857('0x20'),_0x185492,_0x392748[_0x2857('0x23')][_0x2857('0x24')]);return _0x569b79(_0x392748['error'][_0x2857('0x24')]);}else{logger[_0x2857('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x185492,_0x2857('0x25'));_0x569b79(_0x392748[_0x2857('0x26')][_0x2857('0x24')]);}})[_0x2857('0x27')](function(_0x173a7d){logger[_0x2857('0x23')](_0x2857('0x20'),_0x185492,_0x173a7d);_0x4a578f(_0x173a7d);});});}function respondWithStatusCode(_0x16faee,_0x5a9f34){_0x5a9f34=_0x5a9f34||0xcc;return function(_0x478ebf){if(_0x478ebf){return _0x16faee[_0x2857('0x28')](_0x5a9f34);}return _0x16faee['status'](_0x5a9f34)[_0x2857('0x29')]();};}function respondWithResult(_0xc76e0,_0x50a539){_0x50a539=_0x50a539||0xc8;return function(_0x43a924){if(_0x43a924){return _0xc76e0['status'](_0x50a539)['json'](_0x43a924);}};}function respondWithFilteredResult(_0x598fd5,_0x2f97cc){return function(_0x3496c5){if(_0x3496c5){var _0x4476e5=typeof _0x2f97cc[_0x2857('0x2a')]==='undefined'&&typeof _0x2f97cc[_0x2857('0x2b')]==='undefined';var _0xc37226=_0x3496c5[_0x2857('0x2c')];var _0xb548ef=_0x4476e5?0x0:_0x2f97cc[_0x2857('0x2a')];var _0x5033d5=_0x4476e5?_0x3496c5['count']:_0x2f97cc['offset']+_0x2f97cc[_0x2857('0x2b')];var _0x3c60c3;if(_0x5033d5>=_0xc37226){_0x5033d5=_0xc37226;_0x3c60c3=0xc8;}else{_0x3c60c3=0xce;}_0x598fd5[_0x2857('0x2d')](_0x3c60c3);return _0x598fd5[_0x2857('0x2e')]('Content-Range',_0xb548ef+'-'+_0x5033d5+'/'+_0xc37226)['json'](_0x3496c5);}return null;};}function patchUpdates(_0x11ec2b){return function(_0x425d5e){try{jsonpatch[_0x2857('0x2f')](_0x425d5e,_0x11ec2b,!![]);}catch(_0x3bbb2b){return BPromise[_0x2857('0x30')](_0x3bbb2b);}return _0x425d5e[_0x2857('0x31')]();};}function saveUpdates(_0x334baa,_0x2cb66e){return function(_0x2e035b){if(_0x2e035b){return _0x2e035b[_0x2857('0x32')](_0x334baa)[_0x2857('0x1e')](function(_0x4abc0c){return _0x4abc0c;});}return null;};}function removeEntity(_0x5f5c5a,_0x23eb0e){return function(_0x1c84e9){if(_0x1c84e9){return _0x1c84e9[_0x2857('0x33')]()[_0x2857('0x1e')](function(){var _0x2ef982=_0x1c84e9[_0x2857('0x34')]({'plain':!![]});var _0x23e441=_0x2857('0x35');return db[_0x2857('0x36')][_0x2857('0x33')]({'where':{'type':_0x23e441,'resourceId':_0x2ef982['id']}})[_0x2857('0x1e')](function(){return _0x1c84e9;});})[_0x2857('0x1e')](function(){_0x5f5c5a[_0x2857('0x2d')](0xcc)[_0x2857('0x29')]();});}};}function handleEntityNotFound(_0x371d47,_0x56335c){return function(_0x3962f4){if(!_0x3962f4){_0x371d47[_0x2857('0x28')](0x194);}return _0x3962f4;};}function handleError(_0x4434ed,_0x460bc3){_0x460bc3=_0x460bc3||0x1f4;return function(_0x1488ab){logger['error'](_0x1488ab[_0x2857('0x37')]);if(_0x1488ab['name']){delete _0x1488ab[_0x2857('0x38')];}_0x4434ed['status'](_0x460bc3)['send'](_0x1488ab);};}exports['index']=function(_0x3766e6,_0x3c338f){var _0x306668={},_0xc6f8f2={},_0x5d0732={'count':0x0,'rows':[]};var _0x5cce4c=_[_0x2857('0x39')](db[_0x2857('0x3a')][_0x2857('0x3b')],function(_0x27b34a){return{'name':_0x27b34a[_0x2857('0x3c')],'type':_0x27b34a[_0x2857('0x3d')][_0x2857('0x3e')]};});_0xc6f8f2['model']=_['map'](_0x5cce4c,_0x2857('0x38'));_0xc6f8f2[_0x2857('0x3f')]=_[_0x2857('0x40')](_0x3766e6[_0x2857('0x3f')]);_0xc6f8f2[_0x2857('0x41')]=_['intersection'](_0xc6f8f2[_0x2857('0x42')],_0xc6f8f2['query']);_0x306668['attributes']=_['intersection'](_0xc6f8f2['model'],qs[_0x2857('0x43')](_0x3766e6['query'][_0x2857('0x43')]));_0x306668[_0x2857('0x44')]=_0x306668['attributes'][_0x2857('0x45')]?_0x306668[_0x2857('0x44')]:_0xc6f8f2[_0x2857('0x42')];if(!_0x3766e6[_0x2857('0x3f')][_0x2857('0x46')](_0x2857('0x47'))){_0x306668[_0x2857('0x2b')]=qs[_0x2857('0x2b')](_0x3766e6[_0x2857('0x3f')][_0x2857('0x2b')]);_0x306668['offset']=qs[_0x2857('0x2a')](_0x3766e6[_0x2857('0x3f')][_0x2857('0x2a')]);}_0x306668[_0x2857('0x48')]=qs[_0x2857('0x49')](_0x3766e6[_0x2857('0x3f')][_0x2857('0x49')]);_0x306668[_0x2857('0x4a')]=qs[_0x2857('0x41')](_[_0x2857('0x4b')](_0x3766e6[_0x2857('0x3f')],_0xc6f8f2['filters']),_0x5cce4c);if(_0x3766e6[_0x2857('0x3f')][_0x2857('0x4c')]){_0x306668['where']=_['merge'](_0x306668[_0x2857('0x4a')],{'$or':_['map'](_0x5cce4c,function(_0x29c0e6){if(_0x29c0e6['type']!==_0x2857('0x4d')){var _0x3e7b8d={};_0x3e7b8d[_0x29c0e6[_0x2857('0x38')]]={'$like':'%'+_0x3766e6[_0x2857('0x3f')]['filter']+'%'};return _0x3e7b8d;}})});}_0x306668=_[_0x2857('0x4e')]({},_0x306668,_0x3766e6[_0x2857('0x4f')]);var _0x4d19f3={'where':_0x306668[_0x2857('0x4a')]};return db['VoiceContext'][_0x2857('0x2c')](_0x4d19f3)[_0x2857('0x1e')](function(_0x4115ad){_0x5d0732[_0x2857('0x2c')]=_0x4115ad;if(_0x3766e6['query']['includeAll']){_0x306668[_0x2857('0x50')]=[{'all':!![]}];}return db[_0x2857('0x3a')][_0x2857('0x51')](_0x306668);})[_0x2857('0x1e')](function(_0x8175a0){_0x5d0732['rows']=_0x8175a0;return _0x5d0732;})['then'](respondWithFilteredResult(_0x3c338f,_0x306668))[_0x2857('0x27')](handleError(_0x3c338f,null));};exports[_0x2857('0x52')]=function(_0x5c7e81,_0x5dabd6){var _0x3dfb7a={'raw':![],'where':{'id':_0x5c7e81[_0x2857('0x53')]['id']}},_0x2dc0f8={};_0x2dc0f8[_0x2857('0x42')]=_[_0x2857('0x40')](db[_0x2857('0x3a')][_0x2857('0x3b')]);_0x2dc0f8[_0x2857('0x3f')]=_[_0x2857('0x40')](_0x5c7e81[_0x2857('0x3f')]);_0x2dc0f8[_0x2857('0x41')]=_[_0x2857('0x54')](_0x2dc0f8[_0x2857('0x42')],_0x2dc0f8[_0x2857('0x3f')]);_0x3dfb7a[_0x2857('0x44')]=_[_0x2857('0x54')](_0x2dc0f8[_0x2857('0x42')],qs['fields'](_0x5c7e81[_0x2857('0x3f')][_0x2857('0x43')]));_0x3dfb7a[_0x2857('0x44')]=_0x3dfb7a[_0x2857('0x44')][_0x2857('0x45')]?_0x3dfb7a[_0x2857('0x44')]:_0x2dc0f8['model'];if(_0x5c7e81[_0x2857('0x3f')][_0x2857('0x55')]){_0x3dfb7a[_0x2857('0x50')]=[{'all':!![]}];}_0x3dfb7a=_[_0x2857('0x4e')]({},_0x3dfb7a,_0x5c7e81[_0x2857('0x4f')]);return db[_0x2857('0x3a')][_0x2857('0x56')](_0x3dfb7a)[_0x2857('0x1e')](handleEntityNotFound(_0x5dabd6,null))[_0x2857('0x1e')](respondWithResult(_0x5dabd6,null))[_0x2857('0x27')](handleError(_0x5dabd6,null));};exports[_0x2857('0x57')]=function(_0x3393a9,_0x54b6d9,_0x4df36e){var _0x16d192;return db[_0x2857('0x3a')]['create'](_0x3393a9[_0x2857('0x58')],{'raw':!![]})[_0x2857('0x1e')](function(_0x45b94a){_0x16d192=_0x45b94a;return db[_0x2857('0x3a')]['findAll']({'raw':!![]});})[_0x2857('0x1e')](function(_0x195cc0){var _0x3b6d75=fs['readFileSync'](path[_0x2857('0x59')](config[_0x2857('0x5a')],'server/files/templates/context.ejs'),_0x2857('0x5b'));var _0x109145=ejs[_0x2857('0x5c')](_0x3b6d75,{'contexts':_0x195cc0||[]});fs[_0x2857('0x5d')](_0x2857('0x5e'),_0x109145);})[_0x2857('0x1e')](function(){return respondWithRpcPromise(_0x2857('0x5f'),'create',{'module':_0x2857('0x60')});})[_0x2857('0x1e')](function(){var _0x4676b6=_0x3393a9[_0x2857('0x61')]['get']({'plain':!![]});if(!_0x4676b6)throw new Error(_0x2857('0x62'));if(_0x4676b6['role']===_0x2857('0x61')){var _0x35c567=_0x16d192['get']({'plain':!![]});return db[_0x2857('0x63')]['find']({'where':{'name':'Contexts','userProfileId':_0x4676b6[_0x2857('0x64')]},'raw':!![]})[_0x2857('0x1e')](function(_0x38d873){if(_0x38d873&&_0x38d873[_0x2857('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x35c567[_0x2857('0x38')],'resourceId':_0x35c567['id'],'type':_0x38d873[_0x2857('0x38')],'sectionId':_0x38d873['id']},{})[_0x2857('0x1e')](function(){return _0x16d192;});}else{return _0x16d192;}})['catch'](function(_0x290af5){logger[_0x2857('0x23')](_0x2857('0x66'),_0x290af5);throw _0x290af5;});}return _0x16d192;})[_0x2857('0x1e')](respondWithResult(_0x54b6d9,0xc9))[_0x2857('0x27')](handleError(_0x54b6d9,null));};exports[_0x2857('0x32')]=function(_0x4235d9,_0x31b858,_0x279f14){var _0x43b927;return db[_0x2857('0x3a')][_0x2857('0x56')]({'where':{'id':_0x4235d9[_0x2857('0x53')]['id']}})[_0x2857('0x1e')](handleEntityNotFound(_0x31b858,null))[_0x2857('0x1e')](saveUpdates(_0x4235d9[_0x2857('0x58')],null))[_0x2857('0x1e')](function(_0x2ca12c){if(_0x2ca12c){_0x43b927=_0x2ca12c;return db['VoiceContext'][_0x2857('0x51')]({'raw':!![]});}})[_0x2857('0x1e')](function(_0x19c2e0){var _0x23b94b=fs[_0x2857('0x67')](path[_0x2857('0x59')](config[_0x2857('0x5a')],_0x2857('0x68')),_0x2857('0x5b'));var _0x324028=ejs['render'](_0x23b94b,{'contexts':_0x19c2e0||[]});fs[_0x2857('0x5d')](_0x2857('0x5e'),_0x324028);})['then'](function(){return respondWithRpcPromise('Reload',_0x2857('0x32'),{'module':_0x2857('0x60')});})[_0x2857('0x1e')](function(){return _0x43b927;})[_0x2857('0x1e')](respondWithResult(_0x31b858,null))[_0x2857('0x27')](handleError(_0x31b858,null));};exports[_0x2857('0x33')]=function(_0x5dd80e,_0x312efc,_0x4153fe){var _0x224b5f;return db['VoiceContext'][_0x2857('0x56')]({'where':{'id':_0x5dd80e['params']['id']}})[_0x2857('0x1e')](handleEntityNotFound(_0x312efc,null))[_0x2857('0x1e')](removeEntity(_0x312efc,null))['then'](function(){return db[_0x2857('0x3a')][_0x2857('0x51')]({'raw':!![]});})[_0x2857('0x1e')](function(_0x194a79){var _0x3cd7da=fs[_0x2857('0x67')](path[_0x2857('0x59')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x33c099=ejs[_0x2857('0x5c')](_0x3cd7da,{'contexts':_0x194a79});fs[_0x2857('0x5d')](_0x2857('0x5e'),_0x33c099);return respondWithRpcPromise(_0x2857('0x5f'),'destroy',{'module':_0x2857('0x60')});})[_0x2857('0x27')](handleError(_0x312efc,null));}; \ No newline at end of file +var _0xe740=['../../config/license/util','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','save','then','get','Contexts','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','show','params','find','body','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','server/files/templates/context.ejs','utf8','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x56e709,_0x2abd2d){var _0x5b7df9=function(_0x31d276){while(--_0x31d276){_0x56e709['push'](_0x56e709['shift']());}};_0x5b7df9(++_0x2abd2d);}(_0xe740,0xb9));var _0x0e74=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0xe740[_0x4ab3fb];return _0x34fe1e;};'use strict';var emlformat=require(_0x0e74('0x0'));var rimraf=require(_0x0e74('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e74('0x2'));var rp=require('request-promise');var moment=require(_0x0e74('0x3'));var BPromise=require(_0x0e74('0x4'));var Mustache=require(_0x0e74('0x5'));var util=require(_0x0e74('0x6'));var path=require(_0x0e74('0x7'));var sox=require(_0x0e74('0x8'));var csv=require(_0x0e74('0x9'));var ejs=require(_0x0e74('0xa'));var fs=require('fs');var fs_extra=require(_0x0e74('0xb'));var _=require(_0x0e74('0xc'));var squel=require(_0x0e74('0xd'));var crypto=require(_0x0e74('0xe'));var jsforce=require(_0x0e74('0xf'));var deskjs=require(_0x0e74('0x10'));var toCsv=require(_0x0e74('0x9'));var querystring=require(_0x0e74('0x11'));var Papa=require(_0x0e74('0x12'));var Redis=require('ioredis');var authService=require(_0x0e74('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0e74('0x14'));var hardwareService=require(_0x0e74('0x15'));var logger=require(_0x0e74('0x16'))(_0x0e74('0x17'));var utils=require(_0x0e74('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0e74('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0e74('0x1a'));var client=jayson[_0x0e74('0x1b')][_0x0e74('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xa3f7c7,_0x29182c,_0x37bff0,_0x497af8){return new BPromise(function(_0x60c0a7,_0x555a2a){var _0x415b4b=_0x497af8||client;return _0x415b4b['request'](_0xa3f7c7,_0x37bff0)['then'](function(_0x179bbe){logger[_0x0e74('0x1d')](_0x0e74('0x1e'),_0x29182c,'request\x20sent');logger['debug'](_0x0e74('0x1f'),_0x29182c,_0x0e74('0x20'),JSON[_0x0e74('0x21')](_0x179bbe));if(_0x179bbe[_0x0e74('0x22')]){if(_0x179bbe[_0x0e74('0x22')][_0x0e74('0x23')]===0x1f4){logger[_0x0e74('0x22')]('VoiceContext,\x20%s,\x20%s',_0x29182c,_0x179bbe[_0x0e74('0x22')]['message']);return _0x555a2a(_0x179bbe[_0x0e74('0x22')][_0x0e74('0x24')]);}logger[_0x0e74('0x22')](_0x0e74('0x1e'),_0x29182c,_0x179bbe[_0x0e74('0x22')][_0x0e74('0x24')]);return _0x60c0a7(_0x179bbe['error'][_0x0e74('0x24')]);}else{logger[_0x0e74('0x1d')](_0x0e74('0x1e'),_0x29182c,'request\x20sent');_0x60c0a7(_0x179bbe[_0x0e74('0x25')][_0x0e74('0x24')]);}})[_0x0e74('0x26')](function(_0x2c082c){logger['error']('VoiceContext,\x20%s,\x20%s',_0x29182c,_0x2c082c);_0x555a2a(_0x2c082c);});});}function respondWithStatusCode(_0x9df950,_0x3966a3){_0x3966a3=_0x3966a3||0xcc;return function(_0x4e2660){if(_0x4e2660){return _0x9df950['sendStatus'](_0x3966a3);}return _0x9df950[_0x0e74('0x27')](_0x3966a3)[_0x0e74('0x28')]();};}function respondWithResult(_0x44cfaf,_0x4c0b67){_0x4c0b67=_0x4c0b67||0xc8;return function(_0xc8fa20){if(_0xc8fa20){return _0x44cfaf[_0x0e74('0x27')](_0x4c0b67)[_0x0e74('0x29')](_0xc8fa20);}};}function respondWithFilteredResult(_0x4a68a7,_0x2b198b){return function(_0x1eddfe){if(_0x1eddfe){var _0x243000=typeof _0x2b198b[_0x0e74('0x2a')]==='undefined'&&typeof _0x2b198b[_0x0e74('0x2b')]==='undefined';var _0x4cbeb1=_0x1eddfe[_0x0e74('0x2c')];var _0x543eb7=_0x243000?0x0:_0x2b198b[_0x0e74('0x2a')];var _0xce1c11=_0x243000?_0x1eddfe[_0x0e74('0x2c')]:_0x2b198b[_0x0e74('0x2a')]+_0x2b198b[_0x0e74('0x2b')];var _0x53df9f;if(_0xce1c11>=_0x4cbeb1){_0xce1c11=_0x4cbeb1;_0x53df9f=0xc8;}else{_0x53df9f=0xce;}_0x4a68a7[_0x0e74('0x27')](_0x53df9f);return _0x4a68a7[_0x0e74('0x2d')](_0x0e74('0x2e'),_0x543eb7+'-'+_0xce1c11+'/'+_0x4cbeb1)[_0x0e74('0x29')](_0x1eddfe);}return null;};}function patchUpdates(_0x53cb47){return function(_0x25f8de){try{jsonpatch['apply'](_0x25f8de,_0x53cb47,!![]);}catch(_0x3f9133){return BPromise['reject'](_0x3f9133);}return _0x25f8de[_0x0e74('0x2f')]();};}function saveUpdates(_0x283073,_0x27b2f1){return function(_0x4eeb39){if(_0x4eeb39){return _0x4eeb39['update'](_0x283073)[_0x0e74('0x30')](function(_0x75016b){return _0x75016b;});}return null;};}function removeEntity(_0x54ff94,_0x22efe5){return function(_0x156456){if(_0x156456){return _0x156456['destroy']()[_0x0e74('0x30')](function(){var _0x4e4a55=_0x156456[_0x0e74('0x31')]({'plain':!![]});var _0x41e588=_0x0e74('0x32');return db['UserProfileResource']['destroy']({'where':{'type':_0x41e588,'resourceId':_0x4e4a55['id']}})[_0x0e74('0x30')](function(){return _0x156456;});})['then'](function(){_0x54ff94['status'](0xcc)[_0x0e74('0x28')]();});}};}function handleEntityNotFound(_0x2af393,_0x5a64bc){return function(_0x1b8dd5){if(!_0x1b8dd5){_0x2af393[_0x0e74('0x33')](0x194);}return _0x1b8dd5;};}function handleError(_0x29dac9,_0x33ac4e){_0x33ac4e=_0x33ac4e||0x1f4;return function(_0xa75ca3){logger[_0x0e74('0x22')](_0xa75ca3[_0x0e74('0x34')]);if(_0xa75ca3[_0x0e74('0x35')]){delete _0xa75ca3[_0x0e74('0x35')];}_0x29dac9[_0x0e74('0x27')](_0x33ac4e)['send'](_0xa75ca3);};}exports[_0x0e74('0x36')]=function(_0x3fcb3e,_0x3d0bc8){var _0x2c095a={},_0x454430={},_0x4e6e9f={'count':0x0,'rows':[]};var _0x26900a=_[_0x0e74('0x37')](db['VoiceContext'][_0x0e74('0x38')],function(_0x2494c2){return{'name':_0x2494c2[_0x0e74('0x39')],'type':_0x2494c2[_0x0e74('0x3a')][_0x0e74('0x3b')]};});_0x454430[_0x0e74('0x3c')]=_[_0x0e74('0x37')](_0x26900a,_0x0e74('0x35'));_0x454430['query']=_[_0x0e74('0x3d')](_0x3fcb3e[_0x0e74('0x3e')]);_0x454430['filters']=_[_0x0e74('0x3f')](_0x454430[_0x0e74('0x3c')],_0x454430[_0x0e74('0x3e')]);_0x2c095a['attributes']=_['intersection'](_0x454430['model'],qs[_0x0e74('0x40')](_0x3fcb3e['query']['fields']));_0x2c095a[_0x0e74('0x41')]=_0x2c095a[_0x0e74('0x41')][_0x0e74('0x42')]?_0x2c095a[_0x0e74('0x41')]:_0x454430[_0x0e74('0x3c')];if(!_0x3fcb3e[_0x0e74('0x3e')][_0x0e74('0x43')](_0x0e74('0x44'))){_0x2c095a[_0x0e74('0x2b')]=qs[_0x0e74('0x2b')](_0x3fcb3e[_0x0e74('0x3e')][_0x0e74('0x2b')]);_0x2c095a[_0x0e74('0x2a')]=qs[_0x0e74('0x2a')](_0x3fcb3e['query']['offset']);}_0x2c095a[_0x0e74('0x45')]=qs[_0x0e74('0x46')](_0x3fcb3e[_0x0e74('0x3e')][_0x0e74('0x46')]);_0x2c095a[_0x0e74('0x47')]=qs[_0x0e74('0x48')](_[_0x0e74('0x49')](_0x3fcb3e[_0x0e74('0x3e')],_0x454430[_0x0e74('0x48')]),_0x26900a);if(_0x3fcb3e[_0x0e74('0x3e')][_0x0e74('0x4a')]){_0x2c095a[_0x0e74('0x47')]=_[_0x0e74('0x4b')](_0x2c095a[_0x0e74('0x47')],{'$or':_[_0x0e74('0x37')](_0x26900a,function(_0x34381c){if(_0x34381c['type']!==_0x0e74('0x4c')){var _0x3bb108={};_0x3bb108[_0x34381c[_0x0e74('0x35')]]={'$like':'%'+_0x3fcb3e[_0x0e74('0x3e')]['filter']+'%'};return _0x3bb108;}})});}_0x2c095a=_['merge']({},_0x2c095a,_0x3fcb3e[_0x0e74('0x4d')]);var _0x22a03a={'where':_0x2c095a[_0x0e74('0x47')]};return db[_0x0e74('0x4e')]['count'](_0x22a03a)[_0x0e74('0x30')](function(_0x473648){_0x4e6e9f[_0x0e74('0x2c')]=_0x473648;if(_0x3fcb3e[_0x0e74('0x3e')][_0x0e74('0x4f')]){_0x2c095a[_0x0e74('0x50')]=[{'all':!![]}];}return db[_0x0e74('0x4e')][_0x0e74('0x51')](_0x2c095a);})['then'](function(_0x132c19){_0x4e6e9f['rows']=_0x132c19;return _0x4e6e9f;})[_0x0e74('0x30')](respondWithFilteredResult(_0x3d0bc8,_0x2c095a))[_0x0e74('0x26')](handleError(_0x3d0bc8,null));};exports[_0x0e74('0x52')]=function(_0x410e91,_0x378a51){var _0x536d2b={'raw':![],'where':{'id':_0x410e91[_0x0e74('0x53')]['id']}},_0x596fa3={};_0x596fa3[_0x0e74('0x3c')]=_['keys'](db['VoiceContext'][_0x0e74('0x38')]);_0x596fa3[_0x0e74('0x3e')]=_[_0x0e74('0x3d')](_0x410e91[_0x0e74('0x3e')]);_0x596fa3[_0x0e74('0x48')]=_['intersection'](_0x596fa3['model'],_0x596fa3[_0x0e74('0x3e')]);_0x536d2b[_0x0e74('0x41')]=_[_0x0e74('0x3f')](_0x596fa3[_0x0e74('0x3c')],qs['fields'](_0x410e91['query'][_0x0e74('0x40')]));_0x536d2b['attributes']=_0x536d2b[_0x0e74('0x41')]['length']?_0x536d2b[_0x0e74('0x41')]:_0x596fa3[_0x0e74('0x3c')];if(_0x410e91[_0x0e74('0x3e')][_0x0e74('0x4f')]){_0x536d2b[_0x0e74('0x50')]=[{'all':!![]}];}_0x536d2b=_[_0x0e74('0x4b')]({},_0x536d2b,_0x410e91[_0x0e74('0x4d')]);return db['VoiceContext'][_0x0e74('0x54')](_0x536d2b)['then'](handleEntityNotFound(_0x378a51,null))[_0x0e74('0x30')](respondWithResult(_0x378a51,null))[_0x0e74('0x26')](handleError(_0x378a51,null));};exports['create']=function(_0x1b780f,_0x18ea1e,_0x40b22b){var _0x10cf02;return db['VoiceContext']['create'](_0x1b780f[_0x0e74('0x55')],{'raw':!![]})[_0x0e74('0x30')](function(_0x5b07dd){_0x10cf02=_0x5b07dd;return db[_0x0e74('0x4e')]['findAll']({'raw':!![]});})[_0x0e74('0x30')](function(_0x2a6103){var _0x457459=fs['readFileSync'](path[_0x0e74('0x56')](config[_0x0e74('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x4bc182=ejs[_0x0e74('0x58')](_0x457459,{'contexts':_0x2a6103||[]});fs[_0x0e74('0x59')](_0x0e74('0x5a'),_0x4bc182);})[_0x0e74('0x30')](function(){return respondWithRpcPromise(_0x0e74('0x5b'),_0x0e74('0x5c'),{'module':_0x0e74('0x5d')});})[_0x0e74('0x30')](function(){var _0x53af87=_0x1b780f['user'][_0x0e74('0x31')]({'plain':!![]});if(!_0x53af87)throw new Error(_0x0e74('0x5e'));if(_0x53af87[_0x0e74('0x5f')]===_0x0e74('0x60')){var _0x174f65=_0x10cf02[_0x0e74('0x31')]({'plain':!![]});return db[_0x0e74('0x61')][_0x0e74('0x54')]({'where':{'name':'Contexts','userProfileId':_0x53af87[_0x0e74('0x62')]},'raw':!![]})[_0x0e74('0x30')](function(_0xf3bcd){if(_0xf3bcd&&_0xf3bcd[_0x0e74('0x63')]===0x0){return db['UserProfileResource'][_0x0e74('0x5c')]({'name':_0x174f65[_0x0e74('0x35')],'resourceId':_0x174f65['id'],'type':_0xf3bcd[_0x0e74('0x35')],'sectionId':_0xf3bcd['id']},{})[_0x0e74('0x30')](function(){return _0x10cf02;});}else{return _0x10cf02;}})['catch'](function(_0x1848fe){logger[_0x0e74('0x22')](_0x0e74('0x64'),_0x1848fe);throw _0x1848fe;});}return _0x10cf02;})['then'](respondWithResult(_0x18ea1e,0xc9))[_0x0e74('0x26')](handleError(_0x18ea1e,null));};exports[_0x0e74('0x65')]=function(_0x5f1962,_0x2be737,_0x1a5fb7){var _0x230d2b;return db['VoiceContext'][_0x0e74('0x54')]({'where':{'id':_0x5f1962[_0x0e74('0x53')]['id']}})[_0x0e74('0x30')](handleEntityNotFound(_0x2be737,null))[_0x0e74('0x30')](saveUpdates(_0x5f1962[_0x0e74('0x55')],null))[_0x0e74('0x30')](function(_0x2d31cc){if(_0x2d31cc){_0x230d2b=_0x2d31cc;return db[_0x0e74('0x4e')][_0x0e74('0x51')]({'raw':!![]});}})[_0x0e74('0x30')](function(_0x5dd9ec){var _0xd2f220=fs['readFileSync'](path['join'](config[_0x0e74('0x57')],_0x0e74('0x66')),_0x0e74('0x67'));var _0x102322=ejs[_0x0e74('0x58')](_0xd2f220,{'contexts':_0x5dd9ec||[]});fs[_0x0e74('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x102322);})[_0x0e74('0x30')](function(){return respondWithRpcPromise(_0x0e74('0x5b'),_0x0e74('0x65'),{'module':'chan_sip.so'});})['then'](function(){return _0x230d2b;})[_0x0e74('0x30')](respondWithResult(_0x2be737,null))[_0x0e74('0x26')](handleError(_0x2be737,null));};exports['destroy']=function(_0x3bc3ce,_0x57e559,_0x186392){var _0x9f03a8;return db[_0x0e74('0x4e')][_0x0e74('0x54')]({'where':{'id':_0x3bc3ce['params']['id']}})[_0x0e74('0x30')](handleEntityNotFound(_0x57e559,null))[_0x0e74('0x30')](removeEntity(_0x57e559,null))[_0x0e74('0x30')](function(){return db[_0x0e74('0x4e')][_0x0e74('0x51')]({'raw':!![]});})[_0x0e74('0x30')](function(_0x41ff68){var _0x352b42=fs['readFileSync'](path['join'](config[_0x0e74('0x57')],_0x0e74('0x66')),_0x0e74('0x67'));var _0x2fbd27=ejs[_0x0e74('0x58')](_0x352b42,{'contexts':_0x41ff68});fs['writeFileSync'](_0x0e74('0x5a'),_0x2fbd27);return respondWithRpcPromise('Reload',_0x0e74('0x68'),{'module':_0x0e74('0x5d')});})[_0x0e74('0x26')](handleError(_0x57e559,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1f44faa..642c623 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 _0xa440=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','VoiceContext','voice_contexts'];(function(_0x1fc02d,_0x29427b){var _0xc72c71=function(_0x39bf22){while(--_0x39bf22){_0x1fc02d['push'](_0x1fc02d['shift']());}};_0xc72c71(++_0x29427b);}(_0xa440,0x6e));var _0x0a44=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0xa440[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0x0a44('0x0'));var util=require(_0x0a44('0x1'));var logger=require('../../config/logger')(_0x0a44('0x2'));var moment=require(_0x0a44('0x3'));var BPromise=require(_0x0a44('0x4'));var rp=require(_0x0a44('0x5'));var fs=require('fs');var path=require(_0x0a44('0x6'));var rimraf=require(_0x0a44('0x7'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x0a44('0x8')]=function(_0x2698a7,_0x16a1de){return _0x2698a7['define'](_0x0a44('0x9'),attributes,{'tableName':_0x0a44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ece=['lodash','util','../../config/logger','api','bluebird','path','rimraf','./voiceContext.attributes','define','voice_contexts'];(function(_0x2a1a1f,_0x2f32e2){var _0x291648=function(_0x20a395){while(--_0x20a395){_0x2a1a1f['push'](_0x2a1a1f['shift']());}};_0x291648(++_0x2f32e2);}(_0x3ece,0x10e));var _0xe3ec=function(_0x2ba95b,_0x1fedb3){_0x2ba95b=_0x2ba95b-0x0;var _0x5eda82=_0x3ece[_0x2ba95b];return _0x5eda82;};'use strict';var _=require(_0xe3ec('0x0'));var util=require(_0xe3ec('0x1'));var logger=require(_0xe3ec('0x2'))(_0xe3ec('0x3'));var moment=require('moment');var BPromise=require(_0xe3ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3ec('0x5'));var rimraf=require(_0xe3ec('0x6'));var config=require('../../config/environment');var attributes=require(_0xe3ec('0x7'));module['exports']=function(_0x2f22e9,_0x38610a){return _0x2f22e9[_0xe3ec('0x8')]('VoiceContext',attributes,{'tableName':_0xe3ec('0x9'),'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 5f6599e..df260f0 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 _0x4e64=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x235983,_0x3e6e7c){var _0x21f20d=function(_0x532bd0){while(--_0x532bd0){_0x235983['push'](_0x235983['shift']());}};_0x21f20d(++_0x3e6e7c);}(_0x4e64,0x165));var _0x44e6=function(_0x16db18,_0x43fd3f){_0x16db18=_0x16db18-0x0;var _0x48cc3a=_0x4e64[_0x16db18];return _0x48cc3a;};'use strict';var _=require(_0x44e6('0x0'));var util=require('util');var moment=require(_0x44e6('0x1'));var BPromise=require(_0x44e6('0x2'));var rs=require(_0x44e6('0x3'));var fs=require('fs');var Redis=require(_0x44e6('0x4'));var db=require(_0x44e6('0x5'))['db'];var utils=require(_0x44e6('0x6'));var logger=require(_0x44e6('0x7'))('rpc');var config=require(_0x44e6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f956a,_0x5c6460,_0x3e489f){return new BPromise(function(_0x4ff58e,_0x27669c){return client[_0x44e6('0xa')](_0x2f956a,_0x3e489f)[_0x44e6('0xb')](function(_0x1a9d61){logger[_0x44e6('0xc')](_0x44e6('0xd'),_0x5c6460,_0x44e6('0xe'));logger[_0x44e6('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5c6460,_0x44e6('0xe'),JSON[_0x44e6('0x10')](_0x1a9d61));if(_0x1a9d61[_0x44e6('0x11')]){if(_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x12')]===0x1f4){logger['error'](_0x44e6('0xd'),_0x5c6460,_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);return _0x27669c(_0x1a9d61[_0x44e6('0x11')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5c6460,_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);return _0x4ff58e(_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);}else{logger['info'](_0x44e6('0xd'),_0x5c6460,_0x44e6('0xe'));_0x4ff58e(_0x1a9d61[_0x44e6('0x14')][_0x44e6('0x13')]);}})[_0x44e6('0x15')](function(_0xed1d89){logger[_0x44e6('0x11')](_0x44e6('0xd'),_0x5c6460,_0xed1d89);_0x27669c(_0xed1d89);});});} \ No newline at end of file +var _0x09b0=['moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x3441ab,_0x23d988){var _0x1280a9=function(_0x572fdf){while(--_0x572fdf){_0x3441ab['push'](_0x3441ab['shift']());}};_0x1280a9(++_0x23d988);}(_0x09b0,0x1f3));var _0x009b=function(_0x539a7a,_0x47331a){_0x539a7a=_0x539a7a-0x0;var _0x49475e=_0x09b0[_0x539a7a];return _0x49475e;};'use strict';var _=require(_0x009b('0x0'));var util=require('util');var moment=require(_0x009b('0x1'));var BPromise=require('bluebird');var rs=require(_0x009b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x009b('0x3'));var logger=require(_0x009b('0x4'))(_0x009b('0x5'));var config=require('../../config/environment');var jayson=require(_0x009b('0x6'));var client=jayson[_0x009b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a9ed6,_0x2dd1ca,_0x476ef9){return new BPromise(function(_0x2cb43c,_0x1fd0da){return client[_0x009b('0x8')](_0x3a9ed6,_0x476ef9)[_0x009b('0x9')](function(_0x21c1cc){logger[_0x009b('0xa')](_0x009b('0xb'),_0x2dd1ca,_0x009b('0xc'));logger[_0x009b('0xd')](_0x009b('0xe'),_0x2dd1ca,_0x009b('0xc'),JSON[_0x009b('0xf')](_0x21c1cc));if(_0x21c1cc['error']){if(_0x21c1cc[_0x009b('0x10')][_0x009b('0x11')]===0x1f4){logger[_0x009b('0x10')](_0x009b('0xb'),_0x2dd1ca,_0x21c1cc['error']['message']);return _0x1fd0da(_0x21c1cc[_0x009b('0x10')][_0x009b('0x12')]);}logger[_0x009b('0x10')](_0x009b('0xb'),_0x2dd1ca,_0x21c1cc[_0x009b('0x10')][_0x009b('0x12')]);return _0x2cb43c(_0x21c1cc['error']['message']);}else{logger[_0x009b('0xa')](_0x009b('0xb'),_0x2dd1ca,'request\x20sent');_0x2cb43c(_0x21c1cc['result']['message']);}})[_0x009b('0x13')](function(_0xa8060b){logger[_0x009b('0x10')](_0x009b('0xb'),_0x2dd1ca,_0xa8060b);_0x1fd0da(_0xa8060b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 0409a6b..bdaca39 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 _0x8f1f=['post','create','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x2f935a,_0x271a26){var _0x5c67f7=function(_0x42de2b){while(--_0x42de2b){_0x2f935a['push'](_0x2f935a['shift']());}};_0x5c67f7(++_0x271a26);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x494452,_0x5b9635){_0x494452=_0x494452-0x0;var _0x456e08=_0x8f1f[_0x494452];return _0x456e08;};'use strict';var multer=require(_0xf8f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf8f1('0x1'));var express=require(_0xf8f1('0x2'));var router=express[_0xf8f1('0x3')]();var fs_extra=require(_0xf8f1('0x4'));var auth=require(_0xf8f1('0x5'));var interaction=require(_0xf8f1('0x6'));var config=require(_0xf8f1('0x7'));var controller=require(_0xf8f1('0x8'));router['get']('/',auth[_0xf8f1('0x9')](),controller[_0xf8f1('0xa')]);router[_0xf8f1('0xb')](_0xf8f1('0xc'),auth[_0xf8f1('0x9')](),controller['describe']);router[_0xf8f1('0xb')](_0xf8f1('0xd'),auth[_0xf8f1('0x9')](),controller[_0xf8f1('0xe')]);router[_0xf8f1('0xf')]('/',auth[_0xf8f1('0x9')](),controller[_0xf8f1('0x10')]);router['put'](_0xf8f1('0xd'),auth[_0xf8f1('0x9')](),controller[_0xf8f1('0x11')]);router[_0xf8f1('0x12')](_0xf8f1('0xd'),auth[_0xf8f1('0x9')](),controller['destroy']);module[_0xf8f1('0x13')]=router; \ No newline at end of file +var _0x1109=['index','/:id','post','put','update','delete','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated'];(function(_0xd05c08,_0x183b12){var _0x47e550=function(_0x2d4a53){while(--_0x2d4a53){_0xd05c08['push'](_0xd05c08['shift']());}};_0x47e550(++_0x183b12);}(_0x1109,0x17d));var _0x9110=function(_0x1a1460,_0x539531){_0x1a1460=_0x1a1460-0x0;var _0x33ab03=_0x1109[_0x1a1460];return _0x33ab03;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9110('0x0'));var timeout=require('connect-timeout');var express=require(_0x9110('0x1'));var router=express['Router']();var fs_extra=require(_0x9110('0x2'));var auth=require(_0x9110('0x3'));var interaction=require(_0x9110('0x4'));var config=require(_0x9110('0x5'));var controller=require(_0x9110('0x6'));router[_0x9110('0x7')]('/',auth[_0x9110('0x8')](),controller[_0x9110('0x9')]);router[_0x9110('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9110('0x7')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['show']);router[_0x9110('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9110('0xc')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller[_0x9110('0xd')]);router[_0x9110('0xe')](_0x9110('0xa'),auth[_0x9110('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index a27dadc..3eaa031 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 _0xedd9=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x55add2,_0xb0bc42){var _0x3b2322=function(_0x2ca281){while(--_0x2ca281){_0x55add2['push'](_0x55add2['shift']());}};_0x3b2322(++_0xb0bc42);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0xedd9[_0x4d093a];return _0x5d7227;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'privilege':{'type':Sequelize[_0x9edd('0x1')]},'channel':{'type':Sequelize[_0x9edd('0x1')]},'channelstate':{'type':Sequelize[_0x9edd('0x2')]},'channelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'calleridnum':{'type':Sequelize[_0x9edd('0x1')]},'calleridname':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9edd('0x1')]},'accountcode':{'type':Sequelize[_0x9edd('0x1')]},'context':{'type':Sequelize[_0x9edd('0x1')]},'exten':{'type':Sequelize[_0x9edd('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9edd('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9edd('0x1')]},'destchannelstate':{'type':Sequelize[_0x9edd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9edd('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x9edd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x9edd('0x1')]},'destaccountcode':{'type':Sequelize[_0x9edd('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9edd('0x1')]},'destpriority':{'type':Sequelize[_0x9edd('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9edd('0x1')]},'dialstring':{'type':Sequelize[_0x9edd('0x1')]},'dialstatus':{'type':Sequelize[_0x9edd('0x1')]},'starttime':{'type':Sequelize[_0x9edd('0x3')]},'answertime':{'type':Sequelize[_0x9edd('0x3')]},'endtime':{'type':Sequelize[_0x9edd('0x3')]},'lastevent':{'type':Sequelize[_0x9edd('0x1')],'comment':_0x9edd('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x9edd('0x2')]},'holdtime':{'type':Sequelize[_0x9edd('0x2')]},'billableseconds':{'type':Sequelize[_0x9edd('0x2')]}}; \ No newline at end of file +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x23ae5d,_0x300baf){var _0x38864a=function(_0x153d60){while(--_0x153d60){_0x23ae5d['push'](_0x23ae5d['shift']());}};_0x38864a(++_0x300baf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x00bb[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index f45efd4..dd3f5d4 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 _0x01b7=['fs-extra','lodash','squel','crypto','jsforce','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01b7,0x163));var _0x701b=function(_0x4af7e7,_0x512806){_0x4af7e7=_0x4af7e7-0x0;var _0x3a43ab=_0x01b7[_0x4af7e7];return _0x3a43ab;};'use strict';var emlformat=require(_0x701b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x701b('0x1'));var jsonpatch=require(_0x701b('0x2'));var rp=require(_0x701b('0x3'));var moment=require('moment');var BPromise=require(_0x701b('0x4'));var Mustache=require(_0x701b('0x5'));var util=require(_0x701b('0x6'));var path=require(_0x701b('0x7'));var sox=require('sox');var csv=require(_0x701b('0x8'));var ejs=require(_0x701b('0x9'));var fs=require('fs');var fs_extra=require(_0x701b('0xa'));var _=require(_0x701b('0xb'));var squel=require(_0x701b('0xc'));var crypto=require(_0x701b('0xd'));var jsforce=require(_0x701b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x701b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x701b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x701b('0x10'));var logger=require('../../config/logger')(_0x701b('0x11'));var utils=require(_0x701b('0x12'));var config=require(_0x701b('0x13'));var licenseUtil=require(_0x701b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4fbc,_0x4a32f0){_0x4a32f0=_0x4a32f0||0xcc;return function(_0x257c15){if(_0x257c15){return _0x5f4fbc[_0x701b('0x15')](_0x4a32f0);}return _0x5f4fbc[_0x701b('0x16')](_0x4a32f0)[_0x701b('0x17')]();};}function respondWithResult(_0x16a976,_0x3c3627){_0x3c3627=_0x3c3627||0xc8;return function(_0x4e50e6){if(_0x4e50e6){return _0x16a976[_0x701b('0x16')](_0x3c3627)[_0x701b('0x18')](_0x4e50e6);}};}function respondWithFilteredResult(_0x2ce3ff,_0x2dba70){return function(_0x20c840){if(_0x20c840){var _0x2571ab=typeof _0x2dba70[_0x701b('0x19')]===_0x701b('0x1a')&&typeof _0x2dba70['limit']===_0x701b('0x1a');var _0x19d101=_0x20c840[_0x701b('0x1b')];var _0xd5311b=_0x2571ab?0x0:_0x2dba70[_0x701b('0x19')];var _0x173bfc=_0x2571ab?_0x20c840['count']:_0x2dba70['offset']+_0x2dba70[_0x701b('0x1c')];var _0x58dc71;if(_0x173bfc>=_0x19d101){_0x173bfc=_0x19d101;_0x58dc71=0xc8;}else{_0x58dc71=0xce;}_0x2ce3ff['status'](_0x58dc71);return _0x2ce3ff[_0x701b('0x1d')](_0x701b('0x1e'),_0xd5311b+'-'+_0x173bfc+'/'+_0x19d101)[_0x701b('0x18')](_0x20c840);}return null;};}function patchUpdates(_0x9e88ec){return function(_0x340efd){try{jsonpatch[_0x701b('0x1f')](_0x340efd,_0x9e88ec,!![]);}catch(_0x1c891a){return BPromise[_0x701b('0x20')](_0x1c891a);}return _0x340efd[_0x701b('0x21')]();};}function saveUpdates(_0x28f452,_0x130664){return function(_0x50b92c){if(_0x50b92c){return _0x50b92c[_0x701b('0x22')](_0x28f452)[_0x701b('0x23')](function(_0x206984){return _0x206984;});}return null;};}function removeEntity(_0x36d103,_0x3709e3){return function(_0x166cf8){if(_0x166cf8){return _0x166cf8[_0x701b('0x24')]()[_0x701b('0x23')](function(){_0x36d103[_0x701b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc1f6,_0x39cef1){return function(_0x572c6a){if(!_0x572c6a){_0x4fc1f6[_0x701b('0x15')](0x194);}return _0x572c6a;};}function handleError(_0x14f81d,_0x407ce3){_0x407ce3=_0x407ce3||0x1f4;return function(_0x5886d9){logger[_0x701b('0x25')](_0x5886d9['stack']);if(_0x5886d9[_0x701b('0x26')]){delete _0x5886d9[_0x701b('0x26')];}_0x14f81d[_0x701b('0x16')](_0x407ce3)[_0x701b('0x27')](_0x5886d9);};}exports[_0x701b('0x28')]=function(_0x5b1e27,_0x460c3c){var _0x5273b3={},_0x17426d={},_0x4ab949={'count':0x0,'rows':[]};var _0xa22c13=_['map'](db[_0x701b('0x29')][_0x701b('0x2a')],function(_0x4b88d6){return{'name':_0x4b88d6[_0x701b('0x2b')],'type':_0x4b88d6['type'][_0x701b('0x2c')]};});_0x17426d[_0x701b('0x2d')]=_['map'](_0xa22c13,_0x701b('0x26'));_0x17426d[_0x701b('0x2e')]=_[_0x701b('0x2f')](_0x5b1e27[_0x701b('0x2e')]);_0x17426d[_0x701b('0x30')]=_[_0x701b('0x31')](_0x17426d[_0x701b('0x2d')],_0x17426d[_0x701b('0x2e')]);_0x5273b3[_0x701b('0x32')]=_['intersection'](_0x17426d[_0x701b('0x2d')],qs[_0x701b('0x33')](_0x5b1e27['query'][_0x701b('0x33')]));_0x5273b3[_0x701b('0x32')]=_0x5273b3[_0x701b('0x32')]['length']?_0x5273b3[_0x701b('0x32')]:_0x17426d[_0x701b('0x2d')];if(!_0x5b1e27[_0x701b('0x2e')][_0x701b('0x34')](_0x701b('0x35'))){_0x5273b3[_0x701b('0x1c')]=qs['limit'](_0x5b1e27[_0x701b('0x2e')]['limit']);_0x5273b3[_0x701b('0x19')]=qs[_0x701b('0x19')](_0x5b1e27['query'][_0x701b('0x19')]);}_0x5273b3[_0x701b('0x36')]=qs[_0x701b('0x37')](_0x5b1e27[_0x701b('0x2e')][_0x701b('0x37')]);_0x5273b3[_0x701b('0x38')]=qs[_0x701b('0x30')](_[_0x701b('0x39')](_0x5b1e27['query'],_0x17426d[_0x701b('0x30')]),_0xa22c13);if(_0x5b1e27[_0x701b('0x2e')][_0x701b('0x3a')]){_0x5273b3[_0x701b('0x38')]=_[_0x701b('0x3b')](_0x5273b3[_0x701b('0x38')],{'$or':_[_0x701b('0x3c')](_0xa22c13,function(_0x514a01){if(_0x514a01['type']!==_0x701b('0x3d')){var _0x21233f={};_0x21233f[_0x514a01[_0x701b('0x26')]]={'$like':'%'+_0x5b1e27[_0x701b('0x2e')][_0x701b('0x3a')]+'%'};return _0x21233f;}})});}_0x5273b3=_[_0x701b('0x3b')]({},_0x5273b3,_0x5b1e27[_0x701b('0x3e')]);var _0x495073={'where':_0x5273b3[_0x701b('0x38')]};return db[_0x701b('0x29')][_0x701b('0x1b')](_0x495073)[_0x701b('0x23')](function(_0x376f52){_0x4ab949[_0x701b('0x1b')]=_0x376f52;if(_0x5b1e27[_0x701b('0x2e')][_0x701b('0x3f')]){_0x5273b3['include']=[{'all':!![]}];}return db[_0x701b('0x29')][_0x701b('0x40')](_0x5273b3);})[_0x701b('0x23')](function(_0xe170b9){_0x4ab949[_0x701b('0x41')]=_0xe170b9;return _0x4ab949;})[_0x701b('0x23')](respondWithFilteredResult(_0x460c3c,_0x5273b3))[_0x701b('0x42')](handleError(_0x460c3c,null));};exports[_0x701b('0x43')]=function(_0x30ab2f,_0x260d8e){var _0xf9406={'raw':!![],'where':{'id':_0x30ab2f[_0x701b('0x44')]['id']}},_0x2f9c0a={};_0x2f9c0a[_0x701b('0x2d')]=_[_0x701b('0x2f')](db[_0x701b('0x29')][_0x701b('0x2a')]);_0x2f9c0a[_0x701b('0x2e')]=_[_0x701b('0x2f')](_0x30ab2f[_0x701b('0x2e')]);_0x2f9c0a[_0x701b('0x30')]=_[_0x701b('0x31')](_0x2f9c0a['model'],_0x2f9c0a[_0x701b('0x2e')]);_0xf9406[_0x701b('0x32')]=_['intersection'](_0x2f9c0a['model'],qs[_0x701b('0x33')](_0x30ab2f['query']['fields']));_0xf9406[_0x701b('0x32')]=_0xf9406[_0x701b('0x32')]['length']?_0xf9406[_0x701b('0x32')]:_0x2f9c0a[_0x701b('0x2d')];if(_0x30ab2f[_0x701b('0x2e')]['includeAll']){_0xf9406['include']=[{'all':!![]}];}_0xf9406=_[_0x701b('0x3b')]({},_0xf9406,_0x30ab2f['options']);return db[_0x701b('0x29')]['find'](_0xf9406)['then'](handleEntityNotFound(_0x260d8e,null))[_0x701b('0x23')](respondWithResult(_0x260d8e,null))[_0x701b('0x42')](handleError(_0x260d8e,null));};exports[_0x701b('0x45')]=function(_0x4c4f29,_0x177cfe){return db['VoiceDialReport'][_0x701b('0x45')](_0x4c4f29[_0x701b('0x46')],{})['then'](respondWithResult(_0x177cfe,0xc9))[_0x701b('0x42')](handleError(_0x177cfe,null));};exports[_0x701b('0x22')]=function(_0xdafd1e,_0xfcabf8){if(_0xdafd1e['body']['id']){delete _0xdafd1e['body']['id'];}return db['VoiceDialReport'][_0x701b('0x47')]({'where':{'id':_0xdafd1e[_0x701b('0x44')]['id']}})['then'](handleEntityNotFound(_0xfcabf8,null))[_0x701b('0x23')](saveUpdates(_0xdafd1e[_0x701b('0x46')],null))[_0x701b('0x23')](respondWithResult(_0xfcabf8,null))[_0x701b('0x42')](handleError(_0xfcabf8,null));};exports[_0x701b('0x24')]=function(_0x560eb0,_0x4f73eb){return db[_0x701b('0x29')]['find']({'where':{'id':_0x560eb0[_0x701b('0x44')]['id']}})[_0x701b('0x23')](handleEntityNotFound(_0x4f73eb,null))['then'](removeEntity(_0x4f73eb,null))[_0x701b('0x42')](handleError(_0x4f73eb,null));};exports[_0x701b('0x48')]=function(_0x562a42,_0x4648b9){return db[_0x701b('0x29')][_0x701b('0x48')]()[_0x701b('0x23')](respondWithResult(_0x4648b9,null))[_0x701b('0x42')](handleError(_0x4648b9,null));}; \ No newline at end of file +var _0x1f8a=['params','find','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','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','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','sendStatus','error','stack','name','index','VoiceDialReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','then','includeAll','include','catch','create','body','update'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0x1f8a,0x170));var _0xa1f8=function(_0xa98ef,_0x177fd5){_0xa98ef=_0xa98ef-0x0;var _0x4bd10f=_0x1f8a[_0xa98ef];return _0x4bd10f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa1f8('0x0'));var jsonpatch=require(_0xa1f8('0x1'));var rp=require(_0xa1f8('0x2'));var moment=require(_0xa1f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1f8('0x4'));var util=require(_0xa1f8('0x5'));var path=require(_0xa1f8('0x6'));var sox=require('sox');var csv=require(_0xa1f8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1f8('0x8'));var _=require(_0xa1f8('0x9'));var squel=require('squel');var crypto=require(_0xa1f8('0xa'));var jsforce=require(_0xa1f8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1f8('0x7'));var querystring=require(_0xa1f8('0xc'));var Papa=require(_0xa1f8('0xd'));var Redis=require(_0xa1f8('0xe'));var authService=require(_0xa1f8('0xf'));var qs=require(_0xa1f8('0x10'));var as=require(_0xa1f8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1f8('0x12'))(_0xa1f8('0x13'));var utils=require(_0xa1f8('0x14'));var config=require(_0xa1f8('0x15'));var licenseUtil=require(_0xa1f8('0x16'));var db=require(_0xa1f8('0x17'))['db'];function respondWithStatusCode(_0x8eab97,_0x4d1a21){_0x4d1a21=_0x4d1a21||0xcc;return function(_0x34843c){if(_0x34843c){return _0x8eab97['sendStatus'](_0x4d1a21);}return _0x8eab97[_0xa1f8('0x18')](_0x4d1a21)[_0xa1f8('0x19')]();};}function respondWithResult(_0x32f83c,_0x304633){_0x304633=_0x304633||0xc8;return function(_0x34c9c8){if(_0x34c9c8){return _0x32f83c[_0xa1f8('0x18')](_0x304633)[_0xa1f8('0x1a')](_0x34c9c8);}};}function respondWithFilteredResult(_0x59960f,_0x5f2be0){return function(_0x22ed16){if(_0x22ed16){var _0x47da6d=typeof _0x5f2be0[_0xa1f8('0x1b')]==='undefined'&&typeof _0x5f2be0[_0xa1f8('0x1c')]===_0xa1f8('0x1d');var _0x471075=_0x22ed16['count'];var _0x23b652=_0x47da6d?0x0:_0x5f2be0[_0xa1f8('0x1b')];var _0x4b12ae=_0x47da6d?_0x22ed16[_0xa1f8('0x1e')]:_0x5f2be0[_0xa1f8('0x1b')]+_0x5f2be0['limit'];var _0x3c5cbb;if(_0x4b12ae>=_0x471075){_0x4b12ae=_0x471075;_0x3c5cbb=0xc8;}else{_0x3c5cbb=0xce;}_0x59960f[_0xa1f8('0x18')](_0x3c5cbb);return _0x59960f[_0xa1f8('0x1f')](_0xa1f8('0x20'),_0x23b652+'-'+_0x4b12ae+'/'+_0x471075)['json'](_0x22ed16);}return null;};}function patchUpdates(_0x1ba72e){return function(_0x16014c){try{jsonpatch[_0xa1f8('0x21')](_0x16014c,_0x1ba72e,!![]);}catch(_0xe5b296){return BPromise[_0xa1f8('0x22')](_0xe5b296);}return _0x16014c[_0xa1f8('0x23')]();};}function saveUpdates(_0x4399fa,_0x208f64){return function(_0x3ff370){if(_0x3ff370){return _0x3ff370['update'](_0x4399fa)['then'](function(_0x11e099){return _0x11e099;});}return null;};}function removeEntity(_0x47b27c,_0x2667f9){return function(_0x40e8d0){if(_0x40e8d0){return _0x40e8d0[_0xa1f8('0x24')]()['then'](function(){_0x47b27c['status'](0xcc)[_0xa1f8('0x19')]();});}};}function handleEntityNotFound(_0xbec18c,_0x54dbe7){return function(_0x521f4d){if(!_0x521f4d){_0xbec18c[_0xa1f8('0x25')](0x194);}return _0x521f4d;};}function handleError(_0x5d9d86,_0x2ba9ee){_0x2ba9ee=_0x2ba9ee||0x1f4;return function(_0x4f14d9){logger[_0xa1f8('0x26')](_0x4f14d9[_0xa1f8('0x27')]);if(_0x4f14d9[_0xa1f8('0x28')]){delete _0x4f14d9['name'];}_0x5d9d86['status'](_0x2ba9ee)['send'](_0x4f14d9);};}exports[_0xa1f8('0x29')]=function(_0x283862,_0x2dc9b7){var _0x4f0c8c={},_0x6f20d={},_0x2fe6e8={'count':0x0,'rows':[]};var _0xa0d681=_['map'](db[_0xa1f8('0x2a')][_0xa1f8('0x2b')],function(_0x18568c){return{'name':_0x18568c['fieldName'],'type':_0x18568c[_0xa1f8('0x2c')][_0xa1f8('0x2d')]};});_0x6f20d[_0xa1f8('0x2e')]=_[_0xa1f8('0x2f')](_0xa0d681,_0xa1f8('0x28'));_0x6f20d['query']=_[_0xa1f8('0x30')](_0x283862[_0xa1f8('0x31')]);_0x6f20d[_0xa1f8('0x32')]=_[_0xa1f8('0x33')](_0x6f20d[_0xa1f8('0x2e')],_0x6f20d[_0xa1f8('0x31')]);_0x4f0c8c['attributes']=_[_0xa1f8('0x33')](_0x6f20d['model'],qs['fields'](_0x283862[_0xa1f8('0x31')][_0xa1f8('0x34')]));_0x4f0c8c[_0xa1f8('0x35')]=_0x4f0c8c[_0xa1f8('0x35')][_0xa1f8('0x36')]?_0x4f0c8c[_0xa1f8('0x35')]:_0x6f20d['model'];if(!_0x283862[_0xa1f8('0x31')][_0xa1f8('0x37')](_0xa1f8('0x38'))){_0x4f0c8c['limit']=qs[_0xa1f8('0x1c')](_0x283862['query'][_0xa1f8('0x1c')]);_0x4f0c8c[_0xa1f8('0x1b')]=qs['offset'](_0x283862[_0xa1f8('0x31')][_0xa1f8('0x1b')]);}_0x4f0c8c[_0xa1f8('0x39')]=qs[_0xa1f8('0x3a')](_0x283862[_0xa1f8('0x31')][_0xa1f8('0x3a')]);_0x4f0c8c[_0xa1f8('0x3b')]=qs[_0xa1f8('0x32')](_['pick'](_0x283862[_0xa1f8('0x31')],_0x6f20d[_0xa1f8('0x32')]),_0xa0d681);if(_0x283862[_0xa1f8('0x31')]['filter']){_0x4f0c8c[_0xa1f8('0x3b')]=_['merge'](_0x4f0c8c[_0xa1f8('0x3b')],{'$or':_['map'](_0xa0d681,function(_0x16605d){if(_0x16605d[_0xa1f8('0x2c')]!=='VIRTUAL'){var _0x1baa1d={};_0x1baa1d[_0x16605d[_0xa1f8('0x28')]]={'$like':'%'+_0x283862['query'][_0xa1f8('0x3c')]+'%'};return _0x1baa1d;}})});}_0x4f0c8c=_[_0xa1f8('0x3d')]({},_0x4f0c8c,_0x283862[_0xa1f8('0x3e')]);var _0x32c54e={'where':_0x4f0c8c[_0xa1f8('0x3b')]};return db[_0xa1f8('0x2a')][_0xa1f8('0x1e')](_0x32c54e)[_0xa1f8('0x3f')](function(_0x183eb1){_0x2fe6e8[_0xa1f8('0x1e')]=_0x183eb1;if(_0x283862[_0xa1f8('0x31')][_0xa1f8('0x40')]){_0x4f0c8c[_0xa1f8('0x41')]=[{'all':!![]}];}return db[_0xa1f8('0x2a')]['findAll'](_0x4f0c8c);})[_0xa1f8('0x3f')](function(_0x3c7173){_0x2fe6e8['rows']=_0x3c7173;return _0x2fe6e8;})[_0xa1f8('0x3f')](respondWithFilteredResult(_0x2dc9b7,_0x4f0c8c))[_0xa1f8('0x42')](handleError(_0x2dc9b7,null));};exports['show']=function(_0x4e1ca9,_0x5bf4f8){var _0x5ace24={'raw':!![],'where':{'id':_0x4e1ca9['params']['id']}},_0x1c942b={};_0x1c942b[_0xa1f8('0x2e')]=_[_0xa1f8('0x30')](db[_0xa1f8('0x2a')][_0xa1f8('0x2b')]);_0x1c942b[_0xa1f8('0x31')]=_['keys'](_0x4e1ca9[_0xa1f8('0x31')]);_0x1c942b['filters']=_[_0xa1f8('0x33')](_0x1c942b[_0xa1f8('0x2e')],_0x1c942b[_0xa1f8('0x31')]);_0x5ace24[_0xa1f8('0x35')]=_['intersection'](_0x1c942b[_0xa1f8('0x2e')],qs[_0xa1f8('0x34')](_0x4e1ca9[_0xa1f8('0x31')]['fields']));_0x5ace24['attributes']=_0x5ace24['attributes'][_0xa1f8('0x36')]?_0x5ace24[_0xa1f8('0x35')]:_0x1c942b[_0xa1f8('0x2e')];if(_0x4e1ca9[_0xa1f8('0x31')][_0xa1f8('0x40')]){_0x5ace24[_0xa1f8('0x41')]=[{'all':!![]}];}_0x5ace24=_['merge']({},_0x5ace24,_0x4e1ca9['options']);return db[_0xa1f8('0x2a')]['find'](_0x5ace24)[_0xa1f8('0x3f')](handleEntityNotFound(_0x5bf4f8,null))[_0xa1f8('0x3f')](respondWithResult(_0x5bf4f8,null))[_0xa1f8('0x42')](handleError(_0x5bf4f8,null));};exports[_0xa1f8('0x43')]=function(_0x171ccf,_0x41934b){return db['VoiceDialReport'][_0xa1f8('0x43')](_0x171ccf[_0xa1f8('0x44')],{})['then'](respondWithResult(_0x41934b,0xc9))[_0xa1f8('0x42')](handleError(_0x41934b,null));};exports[_0xa1f8('0x45')]=function(_0x1e1505,_0x39bc8a){if(_0x1e1505[_0xa1f8('0x44')]['id']){delete _0x1e1505[_0xa1f8('0x44')]['id'];}return db[_0xa1f8('0x2a')]['find']({'where':{'id':_0x1e1505[_0xa1f8('0x46')]['id']}})['then'](handleEntityNotFound(_0x39bc8a,null))[_0xa1f8('0x3f')](saveUpdates(_0x1e1505['body'],null))[_0xa1f8('0x3f')](respondWithResult(_0x39bc8a,null))[_0xa1f8('0x42')](handleError(_0x39bc8a,null));};exports[_0xa1f8('0x24')]=function(_0x42725c,_0x28771c){return db['VoiceDialReport'][_0xa1f8('0x47')]({'where':{'id':_0x42725c[_0xa1f8('0x46')]['id']}})[_0xa1f8('0x3f')](handleEntityNotFound(_0x28771c,null))[_0xa1f8('0x3f')](removeEntity(_0x28771c,null))[_0xa1f8('0x42')](handleError(_0x28771c,null));};exports[_0xa1f8('0x48')]=function(_0x50776b,_0x303b62){return db[_0xa1f8('0x2a')][_0xa1f8('0x48')]()[_0xa1f8('0x3f')](respondWithResult(_0x303b62,null))[_0xa1f8('0x42')](handleError(_0x303b62,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c297bf5..3891164 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 _0x59ec=['path','rimraf','./voiceDialReport.attributes','exports','define','report_dial','lodash','../../config/logger','api','moment','request-promise'];(function(_0x1e2ff0,_0x2f3e3b){var _0x3324d7=function(_0x43ff4c){while(--_0x43ff4c){_0x1e2ff0['push'](_0x1e2ff0['shift']());}};_0x3324d7(++_0x2f3e3b);}(_0x59ec,0x192));var _0xc59e=function(_0x3120ee,_0x6c2ba6){_0x3120ee=_0x3120ee-0x0;var _0x106f19=_0x59ec[_0x3120ee];return _0x106f19;};'use strict';var _=require(_0xc59e('0x0'));var util=require('util');var logger=require(_0xc59e('0x1'))(_0xc59e('0x2'));var moment=require(_0xc59e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc59e('0x4'));var fs=require('fs');var path=require(_0xc59e('0x5'));var rimraf=require(_0xc59e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc59e('0x7'));module[_0xc59e('0x8')]=function(_0x2de680,_0x20b570){return _0x2de680[_0xc59e('0x9')]('VoiceDialReport',attributes,{'tableName':_0xc59e('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd765=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xd765,0xdf));var _0x5d76=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xd765[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var logger=require(_0x5d76('0x2'))(_0x5d76('0x3'));var moment=require(_0x5d76('0x4'));var BPromise=require(_0x5d76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d76('0x6'));var rimraf=require('rimraf');var config=require(_0x5d76('0x7'));var attributes=require(_0x5d76('0x8'));module['exports']=function(_0x280536,_0x175058){return _0x280536[_0x5d76('0x9')](_0x5d76('0xa'),attributes,{'tableName':_0x5d76('0xb'),'paranoid':![],'indexes':[{'fields':[_0x5d76('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 e48b1b2..e893a93 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 _0x878e=['VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceDialReport','body','options','VoiceDialReport','update','raw','where','attributes','limit','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0xaaae09,_0x18b2f7){var _0xadbd0d=function(_0x2cf6a9){while(--_0x2cf6a9){_0xaaae09['push'](_0xaaae09['shift']());}};_0xadbd0d(++_0x18b2f7);}(_0x878e,0x1b6));var _0xe878=function(_0x4c16aa,_0x20af4b){_0x4c16aa=_0x4c16aa-0x0;var _0x475649=_0x878e[_0x4c16aa];return _0x475649;};'use strict';var _=require(_0xe878('0x0'));var util=require(_0xe878('0x1'));var moment=require('moment');var BPromise=require(_0xe878('0x2'));var rs=require(_0xe878('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe878('0x4'))(_0xe878('0x5'));var config=require(_0xe878('0x6'));var jayson=require(_0xe878('0x7'));var client=jayson['client'][_0xe878('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b9a06,_0x58a82,_0x18d971){return new BPromise(function(_0x3a2df6,_0x193fb3){return client[_0xe878('0x9')](_0x5b9a06,_0x18d971)[_0xe878('0xa')](function(_0x2a9daf){logger[_0xe878('0xb')](_0xe878('0xc'),_0x58a82,_0xe878('0xd'));logger[_0xe878('0xe')](_0xe878('0xf'),_0x58a82,_0xe878('0xd'),JSON[_0xe878('0x10')](_0x2a9daf));if(_0x2a9daf['error']){if(_0x2a9daf[_0xe878('0x11')]['code']===0x1f4){logger['error'](_0xe878('0xc'),_0x58a82,_0x2a9daf[_0xe878('0x11')]['message']);return _0x193fb3(_0x2a9daf[_0xe878('0x11')][_0xe878('0x12')]);}logger[_0xe878('0x11')](_0xe878('0xc'),_0x58a82,_0x2a9daf[_0xe878('0x11')][_0xe878('0x12')]);return _0x3a2df6(_0x2a9daf['error'][_0xe878('0x12')]);}else{logger[_0xe878('0xb')](_0xe878('0xc'),_0x58a82,_0xe878('0xd'));_0x3a2df6(_0x2a9daf['result'][_0xe878('0x12')]);}})[_0xe878('0x13')](function(_0x420a71){logger[_0xe878('0x11')](_0xe878('0xc'),_0x58a82,_0x420a71);_0x193fb3(_0x420a71);});});}exports[_0xe878('0x14')]=function(_0x41899f){var _0x280ccd=this;return new Promise(function(_0x4ed8a3,_0x331a79){return db['VoiceDialReport']['create'](_0x41899f[_0xe878('0x15')],{'raw':_0x41899f[_0xe878('0x16')]?_0x41899f[_0xe878('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xe878('0xa')](function(_0x406510){logger[_0xe878('0xb')]('CreateVoiceDialReport',_0x41899f);logger[_0xe878('0xe')](_0xe878('0x14'),_0x41899f,JSON[_0xe878('0x10')](_0x406510));_0x4ed8a3(_0x406510);})['catch'](function(_0x2fce49){logger[_0xe878('0x11')]('CreateVoiceDialReport',_0x2fce49['message'],_0x41899f);_0x331a79(_0x280ccd[_0xe878('0x11')](0x1f4,_0x2fce49['message']));});});};exports['UpdateVoiceDialReport']=function(_0x54a5a8){var _0x5035af=this;return new Promise(function(_0x5dfd15,_0xb1520b){return db[_0xe878('0x17')][_0xe878('0x18')](_0x54a5a8[_0xe878('0x15')],{'raw':_0x54a5a8[_0xe878('0x16')]?_0x54a5a8['options'][_0xe878('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a5a8[_0xe878('0x16')]?_0x54a5a8[_0xe878('0x16')][_0xe878('0x1a')]||null:null,'attributes':_0x54a5a8[_0xe878('0x16')]?_0x54a5a8[_0xe878('0x16')][_0xe878('0x1b')]||null:null,'limit':_0x54a5a8['options']?_0x54a5a8['options'][_0xe878('0x1c')]||null:null})[_0xe878('0xa')](function(_0x1e373f){logger[_0xe878('0xb')](_0xe878('0x1d'),_0x54a5a8);logger['debug'](_0xe878('0x1d'),_0x54a5a8,JSON['stringify'](_0x1e373f));_0x5dfd15(_0x1e373f);})[_0xe878('0x13')](function(_0x19ac46){logger['error'](_0xe878('0x1d'),_0x19ac46[_0xe878('0x12')],_0x54a5a8);_0xb1520b(_0x5035af[_0xe878('0x11')](0x1f4,_0x19ac46[_0xe878('0x12')]));});});}; \ No newline at end of file +var _0xba1d=['../../config/logger','client','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','stringify','UpdateVoiceDialReport','where','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xba1d,0x1e9));var _0xdba1=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xba1d[_0xc0d9bc];return _0x32ff73;};'use strict';var _=require('lodash');var util=require(_0xdba1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdba1('0x1'));var fs=require('fs');var Redis=require(_0xdba1('0x2'));var db=require(_0xdba1('0x3'))['db'];var utils=require(_0xdba1('0x4'));var logger=require(_0xdba1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdba1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e8372,_0x279999,_0xc8fedd){return new BPromise(function(_0x3b2ed0,_0x3b8be2){return client['request'](_0x2e8372,_0xc8fedd)[_0xdba1('0x7')](function(_0x2a78af){logger['info'](_0xdba1('0x8'),_0x279999,_0xdba1('0x9'));logger[_0xdba1('0xa')](_0xdba1('0xb'),_0x279999,_0xdba1('0x9'),JSON['stringify'](_0x2a78af));if(_0x2a78af[_0xdba1('0xc')]){if(_0x2a78af[_0xdba1('0xc')][_0xdba1('0xd')]===0x1f4){logger['error'](_0xdba1('0x8'),_0x279999,_0x2a78af[_0xdba1('0xc')][_0xdba1('0xe')]);return _0x3b8be2(_0x2a78af[_0xdba1('0xc')][_0xdba1('0xe')]);}logger[_0xdba1('0xc')](_0xdba1('0x8'),_0x279999,_0x2a78af[_0xdba1('0xc')][_0xdba1('0xe')]);return _0x3b2ed0(_0x2a78af[_0xdba1('0xc')][_0xdba1('0xe')]);}else{logger[_0xdba1('0xf')](_0xdba1('0x8'),_0x279999,_0xdba1('0x9'));_0x3b2ed0(_0x2a78af[_0xdba1('0x10')][_0xdba1('0xe')]);}})[_0xdba1('0x11')](function(_0x40ab67){logger[_0xdba1('0xc')](_0xdba1('0x8'),_0x279999,_0x40ab67);_0x3b8be2(_0x40ab67);});});}exports[_0xdba1('0x12')]=function(_0x598bea){var _0x410cf8=this;return new Promise(function(_0xe8ad68,_0x1111e0){return db[_0xdba1('0x13')]['create'](_0x598bea[_0xdba1('0x14')],{'raw':_0x598bea[_0xdba1('0x15')]?_0x598bea['options'][_0xdba1('0x16')]===undefined?!![]:![]:!![]})[_0xdba1('0x7')](function(_0x11f8ae){logger['info'](_0xdba1('0x12'),_0x598bea);logger[_0xdba1('0xa')](_0xdba1('0x12'),_0x598bea,JSON[_0xdba1('0x17')](_0x11f8ae));_0xe8ad68(_0x11f8ae);})['catch'](function(_0x6baf0c){logger[_0xdba1('0xc')]('CreateVoiceDialReport',_0x6baf0c[_0xdba1('0xe')],_0x598bea);_0x1111e0(_0x410cf8[_0xdba1('0xc')](0x1f4,_0x6baf0c[_0xdba1('0xe')]));});});};exports[_0xdba1('0x18')]=function(_0x35ef6b){var _0x40f416=this;return new Promise(function(_0x34392f,_0x273d4d){return db[_0xdba1('0x13')]['update'](_0x35ef6b[_0xdba1('0x14')],{'raw':_0x35ef6b[_0xdba1('0x15')]?_0x35ef6b[_0xdba1('0x15')][_0xdba1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35ef6b[_0xdba1('0x15')]?_0x35ef6b[_0xdba1('0x15')][_0xdba1('0x19')]||null:null,'attributes':_0x35ef6b[_0xdba1('0x15')]?_0x35ef6b['options']['attributes']||null:null,'limit':_0x35ef6b['options']?_0x35ef6b[_0xdba1('0x15')]['limit']||null:null})[_0xdba1('0x7')](function(_0x26ec9a){logger['info']('UpdateVoiceDialReport',_0x35ef6b);logger[_0xdba1('0xa')](_0xdba1('0x18'),_0x35ef6b,JSON[_0xdba1('0x17')](_0x26ec9a));_0x34392f(_0x26ec9a);})[_0xdba1('0x11')](function(_0x537692){logger[_0xdba1('0xc')](_0xdba1('0x18'),_0x537692[_0xdba1('0xe')],_0x35ef6b);_0x273d4d(_0x40f416[_0xdba1('0xc')](0x1f4,_0x537692[_0xdba1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a18a84a..cb5e42b 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 _0x8d3d=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','delete','multer'];(function(_0x4acefe,_0xa7d40e){var _0x17bf5f=function(_0x10a8a7){while(--_0x10a8a7){_0x4acefe['push'](_0x4acefe['shift']());}};_0x17bf5f(++_0xa7d40e);}(_0x8d3d,0x153));var _0xd8d3=function(_0x29c991,_0x571145){_0x29c991=_0x29c991-0x0;var _0x4eac15=_0x8d3d[_0x29c991];return _0x4eac15;};'use strict';var multer=require(_0xd8d3('0x0'));var util=require(_0xd8d3('0x1'));var path=require(_0xd8d3('0x2'));var timeout=require(_0xd8d3('0x3'));var express=require('express');var router=express[_0xd8d3('0x4')]();var fs_extra=require(_0xd8d3('0x5'));var auth=require(_0xd8d3('0x6'));var interaction=require(_0xd8d3('0x7'));var config=require(_0xd8d3('0x8'));var controller=require(_0xd8d3('0x9'));router[_0xd8d3('0xa')]('/',auth[_0xd8d3('0xb')](),controller['index']);router[_0xd8d3('0xa')](_0xd8d3('0xc'),auth[_0xd8d3('0xb')](),controller[_0xd8d3('0xd')]);router[_0xd8d3('0xe')]('/',auth['isAuthenticated'](),controller[_0xd8d3('0xf')]);router[_0xd8d3('0xe')](_0xd8d3('0x10'),auth[_0xd8d3('0xb')](),controller[_0xd8d3('0x11')]);router[_0xd8d3('0x12')](_0xd8d3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd8d3('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaec2=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','addApplications','update','delete','exports'];(function(_0x4edb35,_0x13c117){var _0x5ac9ef=function(_0x5a0e62){while(--_0x5a0e62){_0x4edb35['push'](_0x4edb35['shift']());}};_0x5ac9ef(++_0x13c117);}(_0xaec2,0xf7));var _0x2aec=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0xaec2[_0x3d18af];return _0x2ef919;};'use strict';var multer=require(_0x2aec('0x0'));var util=require(_0x2aec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2aec('0x2'));var router=express[_0x2aec('0x3')]();var fs_extra=require(_0x2aec('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2aec('0x5'));var config=require(_0x2aec('0x6'));var controller=require(_0x2aec('0x7'));router[_0x2aec('0x8')]('/',auth[_0x2aec('0x9')](),controller[_0x2aec('0xa')]);router['get'](_0x2aec('0xb'),auth[_0x2aec('0x9')](),controller[_0x2aec('0xc')]);router[_0x2aec('0xd')]('/',auth['isAuthenticated'](),controller[_0x2aec('0xe')]);router[_0x2aec('0xd')]('/:id/applications',auth['isAuthenticated'](),controller[_0x2aec('0xf')]);router['put'](_0x2aec('0xb'),auth['isAuthenticated'](),controller[_0x2aec('0x10')]);router[_0x2aec('0x11')](_0x2aec('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2aec('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a2c2544..083705c 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 _0x8037=['STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','sequelize','exports'];(function(_0x3c58b6,_0x35a6ae){var _0x5e4de0=function(_0xaae435){while(--_0xaae435){_0x3c58b6['push'](_0x3c58b6['shift']());}};_0x5e4de0(++_0x35a6ae);}(_0x8037,0x12a));var _0x7803=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8037[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7803('0x0'));module[_0x7803('0x1')]={'context':{'type':Sequelize[_0x7803('0x2')],'allowNull':![],'unique':_0x7803('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7803('0x2')],'allowNull':![],'unique':_0x7803('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7803('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x7803('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7803('0x4')](_0x7803('0x5'),_0x7803('0x6'),_0x7803('0x7'),_0x7803('0x8'),_0x7803('0x9'),_0x7803('0xa'),_0x7803('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x7803('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x7803('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x7803('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7803('0xc')]},'recordingFormat':{'type':Sequelize[_0x7803('0x2')],'defaultValue':_0x7803('0xe')},'answer':{'type':Sequelize[_0x7803('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3b2dda){return this['getDataValue']('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x1b56=['outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','STRING','compositeIndex','NoOp','internal'];(function(_0x5bde72,_0xad1a0b){var _0x5f6eb8=function(_0x59a81b){while(--_0x59a81b){_0x5bde72['push'](_0x5bde72['shift']());}};_0x5f6eb8(++_0xad1a0b);}(_0x1b56,0x140));var _0x61b5=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x1b56[_0x57cb4f];return _0x29bb45;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x61b5('0x0')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x61b5('0x1')},'priority':{'type':Sequelize[_0x61b5('0x0')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x61b5('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x61b5('0x0')],'allowNull':![],'defaultValue':_0x61b5('0x2')},'appdata':{'type':Sequelize[_0x61b5('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound','outbound',_0x61b5('0x3'),'inbound-fax',_0x61b5('0x4'),'system',_0x61b5('0x5')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x61b5('0x0')],'allowNull':![],'defaultValue':_0x61b5('0x6')},'IntervalId':{'type':Sequelize[_0x61b5('0x7')]},'isApp':{'type':Sequelize[_0x61b5('0x8')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x61b5('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x61b5('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0x61b5('0x8')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x61b5('0x7')]},'recordingFormat':{'type':Sequelize[_0x61b5('0x0')],'defaultValue':_0x61b5('0x9')},'answer':{'type':Sequelize[_0x61b5('0x8')],'defaultValue':!![]},'name':{'type':Sequelize[_0x61b5('0xa')],'get':function(_0x316108){return this[_0x61b5('0xb')]('exten');}},'alias':{'type':Sequelize[_0x61b5('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 9817f21..a406d05 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 _0x307c=['catch','show','params','keys','length','includeAll','find','create','exten','body','user','role','userProfileId','autoAssociation','update','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','createRouting','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','destroy','then','get','InboundRoutes','inbound','outbound','internal','filter','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows'];(function(_0x30917d,_0x362452){var _0x589c75=function(_0x336355){while(--_0x336355){_0x30917d['push'](_0x30917d['shift']());}};_0x589c75(++_0x362452);}(_0x307c,0xc9));var _0xc307=function(_0x25782d,_0x24bd6e){_0x25782d=_0x25782d-0x0;var _0x587bcf=_0x307c[_0x25782d];return _0x587bcf;};'use strict';var _=require(_0xc307('0x0'));var Redis=require(_0xc307('0x1'));var qs=require(_0xc307('0x2'));var logger=require(_0xc307('0x3'))(_0xc307('0x4'));var config=require(_0xc307('0x5'));var db=require('../../mysqldb')['db'];config[_0xc307('0x6')]=_[_0xc307('0x7')](config[_0xc307('0x6')],{'host':_0xc307('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc307('0x6')]));require(_0xc307('0x9'))[_0xc307('0xa')](socket);function respondWithStatusCode(_0x4da663,_0x1bf696){_0x1bf696=_0x1bf696||0xcc;return function(_0x10073a){if(_0x10073a){return _0x4da663[_0xc307('0xb')](_0x1bf696);}return _0x4da663['status'](_0x1bf696)[_0xc307('0xc')]();};}function respondWithResult(_0x515a7c,_0x52de1f){_0x52de1f=_0x52de1f||0xc8;return function(_0x172b84){if(_0x172b84){return _0x515a7c[_0xc307('0xd')](_0x52de1f)[_0xc307('0xe')](_0x172b84);}};}function respondWithFilteredResult(_0x46bc56,_0x213dfb){return function(_0x418c41){if(_0x418c41){var _0x328a26=typeof _0x213dfb[_0xc307('0xf')]===_0xc307('0x10')&&typeof _0x213dfb[_0xc307('0x11')]===_0xc307('0x10');var _0x1a7d42=_0x418c41[_0xc307('0x12')];var _0x1ccdf1=_0x328a26?0x0:_0x213dfb[_0xc307('0xf')];var _0x501397=_0x328a26?_0x418c41[_0xc307('0x12')]:_0x213dfb[_0xc307('0xf')]+_0x213dfb['limit'];var _0x13ba8a;if(_0x501397>=_0x1a7d42){_0x501397=_0x1a7d42;_0x13ba8a=0xc8;}else{_0x13ba8a=0xce;}_0x46bc56[_0xc307('0xd')](_0x13ba8a);return _0x46bc56['set'](_0xc307('0x13'),_0x1ccdf1+'-'+_0x501397+'/'+_0x1a7d42)[_0xc307('0xe')](_0x418c41);}return null;};}function removeEntity(_0x5eacb7){return function(_0x422d41){if(_0x422d41){return _0x422d41[_0xc307('0x14')]()[_0xc307('0x15')](function(){var _0x5a8fb8=_0x422d41[_0xc307('0x16')]({'plain':!![]});var _0x1b3151=[{'name':_0xc307('0x17'),'value':_0xc307('0x18'),'ignore':![]},{'name':'OutboundRoutes','value':_0xc307('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0xc307('0x1a'),'ignore':![]}];var _0x39fe6f=_(_0x1b3151)[_0xc307('0x1b')]('ignore')[_0xc307('0x1c')](_0xc307('0x1d'))[_0xc307('0x1d')]();if(_[_0xc307('0x1e')](_0x39fe6f,_0x5a8fb8[_0xc307('0x1f')])){return;}var _0x59b194=_['find'](_0x1b3151,[_0xc307('0x1d'),_0x5a8fb8[_0xc307('0x1f')]])[_0xc307('0x20')];return db[_0xc307('0x21')][_0xc307('0x14')]({'where':{'type':_0x59b194,'resourceId':_0x5a8fb8['id']}})[_0xc307('0x15')](function(){return _0x422d41;});})['then'](function(){_0x5eacb7[_0xc307('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217502){return function(_0x1c34bf){if(!_0x1c34bf){_0x217502['sendStatus'](0x194);}return _0x1c34bf;};}function handleError(_0x4e9475,_0x410561){_0x410561=_0x410561||0x1f4;return function(_0x40a6c1){logger[_0xc307('0x22')](_0x40a6c1['stack']);if(_0x40a6c1[_0xc307('0x20')]){delete _0x40a6c1[_0xc307('0x20')];}_0x4e9475[_0xc307('0xd')](_0x410561)[_0xc307('0x23')](_0x40a6c1);};}exports[_0xc307('0x24')]=function(_0x24e1b3,_0x32ed65){var _0x2ff59a={},_0x1e808d={},_0x42e75b={'count':0x0,'rows':[]};var _0xe82bc2=_[_0xc307('0x1c')](db[_0xc307('0x25')][_0xc307('0x26')],function(_0x5b5903){return{'name':_0x5b5903[_0xc307('0x27')],'type':_0x5b5903[_0xc307('0x1f')]['key']};});_0x1e808d[_0xc307('0x28')]=_[_0xc307('0x1c')](_0xe82bc2,_0xc307('0x20'));_0x1e808d['query']=_['keys'](_0x24e1b3[_0xc307('0x29')]);_0x1e808d[_0xc307('0x2a')]=_[_0xc307('0x2b')](_0x1e808d[_0xc307('0x28')],_0x1e808d[_0xc307('0x29')]);_0x2ff59a[_0xc307('0x2c')]=_[_0xc307('0x2b')](_0x1e808d['model'],qs[_0xc307('0x2d')](_0x24e1b3[_0xc307('0x29')]['fields']));_0x2ff59a[_0xc307('0x2c')]=_0x2ff59a[_0xc307('0x2c')]['length']?_0x2ff59a[_0xc307('0x2c')]:_0x1e808d[_0xc307('0x28')];if(!_0x24e1b3[_0xc307('0x29')][_0xc307('0x2e')](_0xc307('0x2f'))){_0x2ff59a['limit']=qs[_0xc307('0x11')](_0x24e1b3[_0xc307('0x29')][_0xc307('0x11')]);_0x2ff59a[_0xc307('0xf')]=qs['offset'](_0x24e1b3['query'][_0xc307('0xf')]);}_0x2ff59a['order']=qs[_0xc307('0x30')](_0x24e1b3[_0xc307('0x29')][_0xc307('0x30')]);_0x2ff59a[_0xc307('0x31')]=qs[_0xc307('0x2a')](_[_0xc307('0x32')](_0x24e1b3[_0xc307('0x29')],_0x1e808d[_0xc307('0x2a')]),_0xe82bc2);if(_0x24e1b3['query'][_0xc307('0x1b')]){_0x2ff59a[_0xc307('0x31')]=_[_0xc307('0x33')](_0x2ff59a['where'],{'$or':_[_0xc307('0x1c')](_0xe82bc2,function(_0x5b9ec6){if(_0x5b9ec6[_0xc307('0x1f')]!==_0xc307('0x34')){var _0x50db72={};_0x50db72[_0x5b9ec6['name']]={'$like':'%'+_0x24e1b3[_0xc307('0x29')]['filter']+'%'};return _0x50db72;}})});}_0x2ff59a=_[_0xc307('0x33')]({},_0x2ff59a,_0x24e1b3[_0xc307('0x35')]);var _0x57fb33={'where':_0x2ff59a['where']};return db[_0xc307('0x25')]['count'](_0x57fb33)[_0xc307('0x15')](function(_0x58dcec){_0x42e75b['count']=_0x58dcec;if(_0x24e1b3[_0xc307('0x29')]['includeAll']){_0x2ff59a[_0xc307('0x36')]=[{'all':!![]}];}return db[_0xc307('0x25')][_0xc307('0x37')](_0x2ff59a);})[_0xc307('0x15')](function(_0x75b3d1){_0x42e75b[_0xc307('0x38')]=_0x75b3d1;return _0x42e75b;})['then'](respondWithFilteredResult(_0x32ed65,_0x2ff59a))[_0xc307('0x39')](handleError(_0x32ed65,null));};exports[_0xc307('0x3a')]=function(_0x12b4fe,_0x13f6cb){var _0x483aa2={'raw':![],'where':{'id':_0x12b4fe[_0xc307('0x3b')]['id']}},_0x1a1a02={};_0x1a1a02[_0xc307('0x28')]=_[_0xc307('0x3c')](db['VoiceExtension']['rawAttributes']);_0x1a1a02[_0xc307('0x29')]=_[_0xc307('0x3c')](_0x12b4fe[_0xc307('0x29')]);_0x1a1a02[_0xc307('0x2a')]=_[_0xc307('0x2b')](_0x1a1a02[_0xc307('0x28')],_0x1a1a02[_0xc307('0x29')]);_0x483aa2[_0xc307('0x2c')]=_[_0xc307('0x2b')](_0x1a1a02[_0xc307('0x28')],qs[_0xc307('0x2d')](_0x12b4fe[_0xc307('0x29')][_0xc307('0x2d')]));_0x483aa2[_0xc307('0x2c')]=_0x483aa2[_0xc307('0x2c')][_0xc307('0x3d')]?_0x483aa2['attributes']:_0x1a1a02['model'];if(_0x12b4fe[_0xc307('0x29')][_0xc307('0x3e')]){_0x483aa2['include']=[{'all':!![]}];}_0x483aa2=_[_0xc307('0x33')]({},_0x483aa2,_0x12b4fe[_0xc307('0x35')]);return db[_0xc307('0x25')][_0xc307('0x3f')](_0x483aa2)[_0xc307('0x15')](handleEntityNotFound(_0x13f6cb,null))[_0xc307('0x15')](respondWithResult(_0x13f6cb,null))['catch'](handleError(_0x13f6cb,null));};exports[_0xc307('0x14')]=function(_0x19a14a,_0x317b3d){return db[_0xc307('0x25')]['find']({'where':{'id':_0x19a14a['params']['id']}})[_0xc307('0x15')](handleEntityNotFound(_0x317b3d,null))[_0xc307('0x15')](removeEntity(_0x317b3d,null))[_0xc307('0x39')](handleError(_0x317b3d,null));};exports[_0xc307('0x40')]=function(_0x2d4fa5,_0x449287){if(_0x2d4fa5['body'][_0xc307('0x1f')]===_0xc307('0x19')&&!_['startsWith'](_0x2d4fa5['body']['exten'],'_')){_0x2d4fa5['body'][_0xc307('0x41')]='_'['concat'](_0x2d4fa5['body'][_0xc307('0x41')]);}return db[_0xc307('0x25')][_0xc307('0x40')](_0x2d4fa5[_0xc307('0x42')],{'raw':![]})[_0xc307('0x15')](function(_0x4628b3){var _0x507c91=_0x2d4fa5[_0xc307('0x43')]['get']({'plain':!![]});if(!_0x507c91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x507c91[_0xc307('0x44')]===_0xc307('0x43')){var _0x2f4841=_0x4628b3[_0xc307('0x16')]({'plain':!![]});var _0x193ae5=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':_0xc307('0x19')},{'name':'InternalRoutes','value':_0xc307('0x1a')}];var _0x1f4bf8=_[_0xc307('0x3f')](_0x193ae5,[_0xc307('0x1d'),_0x2f4841['type']])['name'];return db['UserProfileSection'][_0xc307('0x3f')]({'where':{'name':_0x1f4bf8,'userProfileId':_0x507c91[_0xc307('0x45')]},'raw':!![]})[_0xc307('0x15')](function(_0x49de64){if(_0x49de64&&_0x49de64[_0xc307('0x46')]===0x0){return db[_0xc307('0x21')][_0xc307('0x40')]({'name':_0x2f4841['name'],'resourceId':_0x2f4841['id'],'type':_0x49de64['name'],'sectionId':_0x49de64['id']},{})[_0xc307('0x15')](function(){return _0x4628b3;});}else{return _0x4628b3;}})['catch'](function(_0x2f3756){logger[_0xc307('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f3756);throw _0x2f3756;});}return _0x4628b3;})[_0xc307('0x15')](respondWithResult(_0x449287,0xc9))['catch'](handleError(_0x449287,null));};exports['update']=function(_0x4a5e6c,_0x321db5){if(_0x4a5e6c[_0xc307('0x42')]['id']){delete _0x4a5e6c[_0xc307('0x42')]['id'];}return db['VoiceExtension'][_0xc307('0x3f')]({'where':{'id':_0x4a5e6c[_0xc307('0x3b')]['id']}})[_0xc307('0x15')](handleEntityNotFound(_0x321db5,null))[_0xc307('0x15')](function(_0x56429e){if(_0x56429e){return db[_0xc307('0x25')][_0xc307('0x47')](_['pick'](_0x4a5e6c[_0xc307('0x42')],['exten','context','description',_0xc307('0x48'),_0xc307('0x49'),_0xc307('0x4a'),_0xc307('0x4b')]),{'where':{'context':_0x56429e[_0xc307('0x4c')],'exten':_0x56429e[_0xc307('0x41')]},'individualHooks':!![]})['then'](function(_0x165bb9){return _0x165bb9;});}return null;})[_0xc307('0x15')](respondWithStatusCode(_0x321db5,null))[_0xc307('0x39')](handleError(_0x321db5,null));};exports[_0xc307('0x4d')]=function(_0x268a7f,_0x1fef66){var _0x556899=_0x268a7f['params']['id'];var _0x19dc24=_0x268a7f[_0xc307('0x42')];var _0x43b9db=0xc8;var _0x5de250=null;return db['sequelize'][_0xc307('0x4e')]({'isolationLevel':db[_0xc307('0x4f')][_0xc307('0x50')][_0xc307('0x51')][_0xc307('0x52')]},function(_0x1254af){return db[_0xc307('0x25')]['findOne']({'where':{'id':_0x556899},'transaction':_0x1254af})[_0xc307('0x15')](function(_0x35e5be){if(_0x35e5be){return db['VoiceExtension'][_0xc307('0x14')]({'where':{'VoiceExtensionId':_0x556899},'transaction':_0x1254af})[_0xc307('0x15')](function(){var _0x27cdf3=_['map'](_0x19dc24,function(_0x45284c){_0x45284c[_0xc307('0x53')]=_0x556899;_0x45284c['isApp']=!![];return _0x45284c;});return _0x35e5be[_0xc307('0x54')](_0x27cdf3);})[_0xc307('0x15')](function(_0x4e6aca){return db[_0xc307('0x25')]['bulkCreate'](_0x4e6aca,{'transaction':_0x1254af});});}else{_0x43b9db=0x194;_0x5de250=[];}});})['then'](function(){if(_0x43b9db!==0x194){return db[_0xc307('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x556899},'order':'cast(priority\x20as\x20unsigned)'})[_0xc307('0x15')](function(_0x218e0f){_0x5de250=_0x218e0f;});}})[_0xc307('0x39')](function(_0x5a134b){_0x43b9db=0x1f4;logger[_0xc307('0x22')](_0x5a134b['stack']);if(_0x5a134b[_0xc307('0x20')]){delete _0x5a134b[_0xc307('0x20')];}_0x5de250=_0x5a134b;})[_0xc307('0x55')](function(){if(_0x5de250===null){_0x1fef66[_0xc307('0xb')](_0x43b9db);}else{if(_0x43b9db===0x1f4){_0x1fef66[_0xc307('0xd')](_0x43b9db)['send'](_0x5de250);}else{_0x1fef66['status'](_0x43b9db)[_0xc307('0xe')](_0x5de250);}}});}; \ No newline at end of file +var _0x37f1=['index','VoiceExtension','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','rawAttributes','include','body','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','find','name','UserProfileResource','stack','send'];(function(_0x3e54da,_0x385972){var _0x1fb8d5=function(_0x101444){while(--_0x101444){_0x3e54da['push'](_0x3e54da['shift']());}};_0x1fb8d5(++_0x385972);}(_0x37f1,0x1b4));var _0x137f=function(_0x3b3ab9,_0x3545a4){_0x3b3ab9=_0x3b3ab9-0x0;var _0x2678d1=_0x37f1[_0x3b3ab9];return _0x2678d1;};'use strict';var _=require('lodash');var Redis=require(_0x137f('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x137f('0x1'))(_0x137f('0x2'));var config=require(_0x137f('0x3'));var db=require(_0x137f('0x4'))['db'];config[_0x137f('0x5')]=_[_0x137f('0x6')](config['redis'],{'host':_0x137f('0x7'),'port':0x18eb});var socket=require(_0x137f('0x8'))(new Redis(config[_0x137f('0x5')]));require(_0x137f('0x9'))[_0x137f('0xa')](socket);function respondWithStatusCode(_0x5064e0,_0x3c95f8){_0x3c95f8=_0x3c95f8||0xcc;return function(_0x49bffd){if(_0x49bffd){return _0x5064e0[_0x137f('0xb')](_0x3c95f8);}return _0x5064e0[_0x137f('0xc')](_0x3c95f8)[_0x137f('0xd')]();};}function respondWithResult(_0xd49341,_0x13d4a7){_0x13d4a7=_0x13d4a7||0xc8;return function(_0x292084){if(_0x292084){return _0xd49341[_0x137f('0xc')](_0x13d4a7)[_0x137f('0xe')](_0x292084);}};}function respondWithFilteredResult(_0x4e63ea,_0x457cd8){return function(_0x511e39){if(_0x511e39){var _0x433803=typeof _0x457cd8[_0x137f('0xf')]===_0x137f('0x10')&&typeof _0x457cd8[_0x137f('0x11')]==='undefined';var _0x44f844=_0x511e39['count'];var _0xbefdf7=_0x433803?0x0:_0x457cd8[_0x137f('0xf')];var _0x2c320b=_0x433803?_0x511e39[_0x137f('0x12')]:_0x457cd8[_0x137f('0xf')]+_0x457cd8[_0x137f('0x11')];var _0x50c0cc;if(_0x2c320b>=_0x44f844){_0x2c320b=_0x44f844;_0x50c0cc=0xc8;}else{_0x50c0cc=0xce;}_0x4e63ea[_0x137f('0xc')](_0x50c0cc);return _0x4e63ea[_0x137f('0x13')](_0x137f('0x14'),_0xbefdf7+'-'+_0x2c320b+'/'+_0x44f844)[_0x137f('0xe')](_0x511e39);}return null;};}function removeEntity(_0x4c32c2){return function(_0x33b130){if(_0x33b130){return _0x33b130[_0x137f('0x15')]()[_0x137f('0x16')](function(){var _0x53933d=_0x33b130[_0x137f('0x17')]({'plain':!![]});var _0x15fed3=[{'name':_0x137f('0x18'),'value':_0x137f('0x19'),'ignore':![]},{'name':_0x137f('0x1a'),'value':_0x137f('0x1b'),'ignore':![]},{'name':_0x137f('0x1c'),'value':_0x137f('0x1d'),'ignore':![]}];var _0x3d7f97=_(_0x15fed3)['filter'](_0x137f('0x1e'))[_0x137f('0x1f')]('value')[_0x137f('0x20')]();if(_[_0x137f('0x21')](_0x3d7f97,_0x53933d['type'])){return;}var _0x396640=_[_0x137f('0x22')](_0x15fed3,[_0x137f('0x20'),_0x53933d['type']])[_0x137f('0x23')];return db[_0x137f('0x24')][_0x137f('0x15')]({'where':{'type':_0x396640,'resourceId':_0x53933d['id']}})['then'](function(){return _0x33b130;});})[_0x137f('0x16')](function(){_0x4c32c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28dc09){return function(_0x16ed9b){if(!_0x16ed9b){_0x28dc09[_0x137f('0xb')](0x194);}return _0x16ed9b;};}function handleError(_0x14d53b,_0x34608e){_0x34608e=_0x34608e||0x1f4;return function(_0x237f8b){logger['error'](_0x237f8b[_0x137f('0x25')]);if(_0x237f8b[_0x137f('0x23')]){delete _0x237f8b[_0x137f('0x23')];}_0x14d53b[_0x137f('0xc')](_0x34608e)[_0x137f('0x26')](_0x237f8b);};}exports[_0x137f('0x27')]=function(_0x149f8c,_0x1a985e){var _0x491303={},_0x3bc9b5={},_0x4cb6dd={'count':0x0,'rows':[]};var _0x57fcc6=_[_0x137f('0x1f')](db[_0x137f('0x28')]['rawAttributes'],function(_0x150987){return{'name':_0x150987[_0x137f('0x29')],'type':_0x150987[_0x137f('0x2a')]['key']};});_0x3bc9b5[_0x137f('0x2b')]=_[_0x137f('0x1f')](_0x57fcc6,_0x137f('0x23'));_0x3bc9b5[_0x137f('0x2c')]=_[_0x137f('0x2d')](_0x149f8c['query']);_0x3bc9b5[_0x137f('0x2e')]=_[_0x137f('0x2f')](_0x3bc9b5[_0x137f('0x2b')],_0x3bc9b5[_0x137f('0x2c')]);_0x491303[_0x137f('0x30')]=_[_0x137f('0x2f')](_0x3bc9b5[_0x137f('0x2b')],qs[_0x137f('0x31')](_0x149f8c[_0x137f('0x2c')]['fields']));_0x491303[_0x137f('0x30')]=_0x491303[_0x137f('0x30')][_0x137f('0x32')]?_0x491303[_0x137f('0x30')]:_0x3bc9b5[_0x137f('0x2b')];if(!_0x149f8c[_0x137f('0x2c')][_0x137f('0x33')](_0x137f('0x34'))){_0x491303[_0x137f('0x11')]=qs['limit'](_0x149f8c['query'][_0x137f('0x11')]);_0x491303[_0x137f('0xf')]=qs[_0x137f('0xf')](_0x149f8c[_0x137f('0x2c')][_0x137f('0xf')]);}_0x491303[_0x137f('0x35')]=qs[_0x137f('0x36')](_0x149f8c[_0x137f('0x2c')][_0x137f('0x36')]);_0x491303[_0x137f('0x37')]=qs[_0x137f('0x2e')](_[_0x137f('0x38')](_0x149f8c[_0x137f('0x2c')],_0x3bc9b5[_0x137f('0x2e')]),_0x57fcc6);if(_0x149f8c[_0x137f('0x2c')][_0x137f('0x39')]){_0x491303[_0x137f('0x37')]=_['merge'](_0x491303[_0x137f('0x37')],{'$or':_['map'](_0x57fcc6,function(_0x4844a0){if(_0x4844a0['type']!==_0x137f('0x3a')){var _0x52d0e8={};_0x52d0e8[_0x4844a0[_0x137f('0x23')]]={'$like':'%'+_0x149f8c['query'][_0x137f('0x39')]+'%'};return _0x52d0e8;}})});}_0x491303=_[_0x137f('0x3b')]({},_0x491303,_0x149f8c[_0x137f('0x3c')]);var _0x144d79={'where':_0x491303[_0x137f('0x37')]};return db['VoiceExtension']['count'](_0x144d79)[_0x137f('0x16')](function(_0x706213){_0x4cb6dd['count']=_0x706213;if(_0x149f8c[_0x137f('0x2c')][_0x137f('0x3d')]){_0x491303['include']=[{'all':!![]}];}return db[_0x137f('0x28')][_0x137f('0x3e')](_0x491303);})[_0x137f('0x16')](function(_0x58367e){_0x4cb6dd['rows']=_0x58367e;return _0x4cb6dd;})[_0x137f('0x16')](respondWithFilteredResult(_0x1a985e,_0x491303))[_0x137f('0x3f')](handleError(_0x1a985e,null));};exports[_0x137f('0x40')]=function(_0xacb48e,_0x1bc139){var _0x4bf2c2={'raw':![],'where':{'id':_0xacb48e[_0x137f('0x41')]['id']}},_0x49f1ff={};_0x49f1ff[_0x137f('0x2b')]=_[_0x137f('0x2d')](db[_0x137f('0x28')][_0x137f('0x42')]);_0x49f1ff[_0x137f('0x2c')]=_[_0x137f('0x2d')](_0xacb48e['query']);_0x49f1ff['filters']=_[_0x137f('0x2f')](_0x49f1ff[_0x137f('0x2b')],_0x49f1ff[_0x137f('0x2c')]);_0x4bf2c2['attributes']=_[_0x137f('0x2f')](_0x49f1ff[_0x137f('0x2b')],qs[_0x137f('0x31')](_0xacb48e[_0x137f('0x2c')][_0x137f('0x31')]));_0x4bf2c2[_0x137f('0x30')]=_0x4bf2c2[_0x137f('0x30')][_0x137f('0x32')]?_0x4bf2c2['attributes']:_0x49f1ff[_0x137f('0x2b')];if(_0xacb48e['query'][_0x137f('0x3d')]){_0x4bf2c2[_0x137f('0x43')]=[{'all':!![]}];}_0x4bf2c2=_[_0x137f('0x3b')]({},_0x4bf2c2,_0xacb48e['options']);return db[_0x137f('0x28')][_0x137f('0x22')](_0x4bf2c2)[_0x137f('0x16')](handleEntityNotFound(_0x1bc139,null))[_0x137f('0x16')](respondWithResult(_0x1bc139,null))['catch'](handleError(_0x1bc139,null));};exports[_0x137f('0x15')]=function(_0x5616ba,_0x88ab0b){return db['VoiceExtension'][_0x137f('0x22')]({'where':{'id':_0x5616ba['params']['id']}})[_0x137f('0x16')](handleEntityNotFound(_0x88ab0b,null))[_0x137f('0x16')](removeEntity(_0x88ab0b,null))['catch'](handleError(_0x88ab0b,null));};exports['create']=function(_0x517cf0,_0x29ee24){if(_0x517cf0[_0x137f('0x44')]['type']==='outbound'&&!_['startsWith'](_0x517cf0[_0x137f('0x44')]['exten'],'_')){_0x517cf0[_0x137f('0x44')][_0x137f('0x45')]='_'['concat'](_0x517cf0[_0x137f('0x44')][_0x137f('0x45')]);}return db[_0x137f('0x28')][_0x137f('0x46')](_0x517cf0['body'],{'raw':![]})['then'](function(_0xd82a80){var _0x38613c=_0x517cf0[_0x137f('0x47')]['get']({'plain':!![]});if(!_0x38613c)throw new Error(_0x137f('0x48'));if(_0x38613c[_0x137f('0x49')]===_0x137f('0x47')){var _0x50bb20=_0xd82a80[_0x137f('0x17')]({'plain':!![]});var _0xdb726a=[{'name':_0x137f('0x18'),'value':_0x137f('0x19')},{'name':_0x137f('0x1a'),'value':_0x137f('0x1b')},{'name':'InternalRoutes','value':'internal'}];var _0x46acfb=_['find'](_0xdb726a,[_0x137f('0x20'),_0x50bb20['type']])[_0x137f('0x23')];return db[_0x137f('0x4a')][_0x137f('0x22')]({'where':{'name':_0x46acfb,'userProfileId':_0x38613c[_0x137f('0x4b')]},'raw':!![]})[_0x137f('0x16')](function(_0x4147de){if(_0x4147de&&_0x4147de[_0x137f('0x4c')]===0x0){return db['UserProfileResource'][_0x137f('0x46')]({'name':_0x50bb20[_0x137f('0x23')],'resourceId':_0x50bb20['id'],'type':_0x4147de[_0x137f('0x23')],'sectionId':_0x4147de['id']},{})[_0x137f('0x16')](function(){return _0xd82a80;});}else{return _0xd82a80;}})['catch'](function(_0x317d6d){logger[_0x137f('0x4d')](_0x137f('0x4e'),_0x317d6d);throw _0x317d6d;});}return _0xd82a80;})[_0x137f('0x16')](respondWithResult(_0x29ee24,0xc9))[_0x137f('0x3f')](handleError(_0x29ee24,null));};exports[_0x137f('0x4f')]=function(_0x2d6f86,_0x3df1c2){if(_0x2d6f86['body']['id']){delete _0x2d6f86[_0x137f('0x44')]['id'];}return db[_0x137f('0x28')][_0x137f('0x22')]({'where':{'id':_0x2d6f86['params']['id']}})[_0x137f('0x16')](handleEntityNotFound(_0x3df1c2,null))[_0x137f('0x16')](function(_0x5ad8f6){if(_0x5ad8f6){return db[_0x137f('0x28')][_0x137f('0x4f')](_['pick'](_0x2d6f86[_0x137f('0x44')],[_0x137f('0x45'),_0x137f('0x50'),'description',_0x137f('0x51'),_0x137f('0x52'),'mandatoryDisposition',_0x137f('0x53')]),{'where':{'context':_0x5ad8f6[_0x137f('0x50')],'exten':_0x5ad8f6['exten']},'individualHooks':!![]})['then'](function(_0x1c1a00){return _0x1c1a00;});}return null;})[_0x137f('0x16')](respondWithStatusCode(_0x3df1c2,null))['catch'](handleError(_0x3df1c2,null));};exports['addApplications']=function(_0x53c4f2,_0x2f8b22){var _0x2957eb=_0x53c4f2['params']['id'];var _0x37995c=_0x53c4f2[_0x137f('0x44')];var _0x15b59f=0xc8;var _0x367543=null;return db[_0x137f('0x54')]['transaction']({'isolationLevel':db[_0x137f('0x54')][_0x137f('0x55')][_0x137f('0x56')][_0x137f('0x57')]},function(_0x34f17a){return db[_0x137f('0x28')][_0x137f('0x58')]({'where':{'id':_0x2957eb},'transaction':_0x34f17a})[_0x137f('0x16')](function(_0x1e7be5){if(_0x1e7be5){return db[_0x137f('0x28')][_0x137f('0x15')]({'where':{'VoiceExtensionId':_0x2957eb},'transaction':_0x34f17a})[_0x137f('0x16')](function(){var _0x3de4fa=_[_0x137f('0x1f')](_0x37995c,function(_0x2b2fad){_0x2b2fad[_0x137f('0x59')]=_0x2957eb;_0x2b2fad[_0x137f('0x5a')]=!![];return _0x2b2fad;});return _0x1e7be5[_0x137f('0x5b')](_0x3de4fa);})[_0x137f('0x16')](function(_0xcfe9f7){return db[_0x137f('0x28')][_0x137f('0x5c')](_0xcfe9f7,{'transaction':_0x34f17a});});}else{_0x15b59f=0x194;_0x367543=[];}});})['then'](function(){if(_0x15b59f!==0x194){return db[_0x137f('0x28')][_0x137f('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2957eb},'order':'cast(priority\x20as\x20unsigned)'})[_0x137f('0x16')](function(_0x4fe490){_0x367543=_0x4fe490;});}})['catch'](function(_0x711cb8){_0x15b59f=0x1f4;logger[_0x137f('0x4d')](_0x711cb8[_0x137f('0x25')]);if(_0x711cb8[_0x137f('0x23')]){delete _0x711cb8['name'];}_0x367543=_0x711cb8;})[_0x137f('0x5e')](function(){if(_0x367543===null){_0x2f8b22[_0x137f('0xb')](_0x15b59f);}else{if(_0x15b59f===0x1f4){_0x2f8b22[_0x137f('0xc')](_0x15b59f)[_0x137f('0x26')](_0x367543);}else{_0x2f8b22['status'](_0x15b59f)[_0x137f('0xe')](_0x367543);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 468bb6a..26afbf3 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 _0x421d=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','emit','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x421d,0x18f));var _0xd421=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x421d[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0xd421('0x0'));var VoiceExtension=require(_0xd421('0x1'))['db'][_0xd421('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd421('0x3')](0x0);var events={'afterCreate':_0xd421('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3df055){return function(_0x17b5ef,_0x5c6096,_0xaeccb2){VoiceExtensionEvents[_0xd421('0x5')](_0x3df055+':'+_0x17b5ef['id'],_0x17b5ef);VoiceExtensionEvents['emit'](_0x3df055,_0x17b5ef);_0xaeccb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xd421('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x31a6=['events','../../mysqldb','VoiceExtension','save','remove','emit','hook'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x31a6,0xf5));var _0x631a=function(_0x95d649,_0x532a0a){_0x95d649=_0x95d649-0x0;var _0x367875=_0x31a6[_0x95d649];return _0x367875;};'use strict';var EventEmitter=require(_0x631a('0x0'));var VoiceExtension=require(_0x631a('0x1'))['db'][_0x631a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x631a('0x3'),'afterUpdate':'update','afterDestroy':_0x631a('0x4')};function emitEvent(_0x350715){return function(_0x1f0087,_0x741689,_0x10b9ef){VoiceExtensionEvents[_0x631a('0x5')](_0x350715+':'+_0x1f0087['id'],_0x1f0087);VoiceExtensionEvents['emit'](_0x350715,_0x1f0087);_0x10b9ef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x631a('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 8ae8096..160d560 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 _0xfc17=['cutdigits','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','split','length','name','param','prefix','phone','SIP','join','options','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','playback','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','NoOp','No\x20alias\x20set'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfc17,0x1b4));var _0x7fc1=function(_0xfb3c97,_0xb06691){_0xfb3c97=_0xfb3c97-0x0;var _0x1c23d0=_0xfc17[_0xfb3c97];return _0x1c23d0;};'use strict';var _=require(_0x7fc1('0x0'));var attributes=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]=function(_0x3de7bf){var _0x524e76=_0x3de7bf[_0x7fc1('0x3')];function _0x3bbf44(_0x2b9b74){var _0x1f6079=0x2;var _0x44101d=[{'type':_0x2b9b74[_0x7fc1('0x4')],'app':'Set','appdata':_0x7fc1('0x5')+_0x2b9b74[_0x7fc1('0x4')],'context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74[_0x7fc1('0x7')],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']},{'type':_0x2b9b74[_0x7fc1('0x4')],'app':_0x2b9b74[_0x7fc1('0x8')]?_0x7fc1('0x9'):'NoOp','appdata':_0x2b9b74[_0x7fc1('0x8')]?_0x7fc1('0xa')+_0x2b9b74[_0x7fc1('0x8')]:'No\x20alias\x20set','context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74['exten'],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']}];if(_0x2b9b74['type']===_0x7fc1('0xb')){_0x44101d[_0x7fc1('0xc')]({'type':_0x7fc1('0xb'),'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0xd')+_0x2b9b74['id'],'context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74[_0x7fc1('0x7')],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']});}_0x44101d[_0x7fc1('0xc')]({'type':_0x2b9b74[_0x7fc1('0x4')],'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0xe'),'context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74['exten'],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']},{'type':_0x2b9b74['type'],'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0xf'),'context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74[_0x7fc1('0x7')],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']},{'type':_0x2b9b74[_0x7fc1('0x4')],'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x10'),'context':_0x2b9b74[_0x7fc1('0x6')],'exten':_0x2b9b74[_0x7fc1('0x7')],'priority':_0x1f6079++,'VoiceExtensionId':_0x2b9b74['id']});return _0x44101d;}function _0x442176(_0x5e634a){var _0x419170=0x2;var _0x5e89b1=[{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':'CDR(type)=outbound','context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':'outbound','app':_0x5e634a[_0x7fc1('0x8')]?_0x7fc1('0x9'):_0x7fc1('0x12'),'appdata':_0x5e634a[_0x7fc1('0x8')]?_0x7fc1('0xa')+_0x5e634a[_0x7fc1('0x8')]:_0x7fc1('0x13'),'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':'Set','appdata':'CDR(destination)='+(_0x5e634a[_0x7fc1('0x14')]?'${EXTEN:'+_0x5e634a[_0x7fc1('0x14')]+'}':_0x7fc1('0x15')),'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':'outbound','app':_0x7fc1('0x9'),'appdata':_0x7fc1('0xd')+_0x5e634a['id'],'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a['exten'],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x419170+0x2)+'):Goto('+(_0x419170+0x1)+')','context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':_0x5e634a['cutdigits']?_0x7fc1('0x17')+_0x5e634a[_0x7fc1('0x14')]+'}':_0x7fc1('0x18'),'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a['exten'],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':'Set','appdata':_0x7fc1('0xe'),'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a['exten'],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':'outbound','app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x10'),'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x19')+_0x5e634a['id'],'context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']}];if(_0x5e634a[_0x7fc1('0x1a')](_0x7fc1('0x1b'))&&_0x5e634a[_0x7fc1('0x1b')]!==_0x7fc1('0x1c')){_0x5e89b1[_0x7fc1('0xc')]({'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']},{'type':_0x7fc1('0x11'),'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x1d')+_0x5e634a[_0x7fc1('0x1b')]||'wav','context':_0x5e634a[_0x7fc1('0x6')],'exten':_0x5e634a[_0x7fc1('0x7')],'priority':_0x419170++,'VoiceExtensionId':_0x5e634a['id']});}return _0x5e89b1;}function _0x4f36c8(_0x295268,_0x2b1788){var _0x1e3a6f=[{'name':_0x7fc1('0x1e'),'param':0x0},{'name':_0x7fc1('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0xa74afb={};var _0x289ba2=_0x2b1788[_0x7fc1('0x20')](',');var _0x3aa2b2=[];for(var _0x12ac96=0x0;_0x12ac96<_0x1e3a6f[_0x7fc1('0x21')];_0x12ac96++){switch(_0x1e3a6f[_0x12ac96][_0x7fc1('0x22')]){case _0x7fc1('0x1e'):_0xa74afb['trunk']=_0x289ba2[_0x1e3a6f[_0x12ac96][_0x7fc1('0x23')]][_0x7fc1('0x20')]('/')[0x1];_0xa74afb['phone']=_0x289ba2[_0x1e3a6f[_0x12ac96][_0x7fc1('0x23')]][_0x7fc1('0x20')]('/')[0x2];_0xa74afb[_0x7fc1('0x24')]=_0xa74afb['phone']?_0xa74afb['phone'][_0x7fc1('0x20')]('$')[0x0]:undefined;_0xa74afb[_0x7fc1('0x25')]=_0x295268[_0x7fc1('0x14')]?(_0xa74afb['prefix']||'')+'${EXTEN:'+_0x295268['cutdigits']+'}':(_0xa74afb[_0x7fc1('0x24')]||'')+_0x7fc1('0x15');_0x3aa2b2[_0x1e3a6f[_0x12ac96][_0x7fc1('0x23')]]=[_0x7fc1('0x26'),_0xa74afb['trunk'],_0xa74afb['phone']][_0x7fc1('0x27')]('/');break;case _0x7fc1('0x28'):_0xa74afb[_0x7fc1('0x28')]=_0x289ba2[_0x1e3a6f[_0x12ac96]['param']];if(_0x295268['recordingFormat']!=='none'){if(_0xa74afb['options']['indexOf'](_0x7fc1('0x29'))<0x0){_0xa74afb['options']+=_0x7fc1('0x29');}}else{_0xa74afb[_0x7fc1('0x28')]=_0xa74afb['options'][_0x7fc1('0x2a')](_0x7fc1('0x29'),'');}_0x3aa2b2[_0x1e3a6f[_0x12ac96][_0x7fc1('0x23')]]=_0xa74afb[_0x7fc1('0x28')];break;default:_0x3aa2b2[_0x1e3a6f[_0x12ac96]['param']]=_0x289ba2[_0x1e3a6f[_0x12ac96][_0x7fc1('0x23')]];}}return _0x3aa2b2['join'](',');}function _0xf8603c(_0x173ba7,_0x7fcb7e,_0x17f48c){return new Promise(function(_0x51453f,_0x38684c){var _0x1aa362=[];if(_['isEmpty'](_0x7fcb7e))return _0x51453f(_0x1aa362);_0x524e76[_0x7fc1('0x2b')][_0x7fc1('0x2c')]({'attributes':['id','interval',_0x7fc1('0x2d')],'raw':!![]})[_0x7fc1('0x2e')](function(_0x5ead7a){for(var _0xcbf5e4=0x0,_0x1242ee=0x0;_0xcbf5e4<_0x7fcb7e[_0x7fc1('0x21')];_0xcbf5e4++,_0x1242ee=0x0){var _0x538ce5=_0x7fcb7e[_0xcbf5e4];var _0x3ae3b5=[];var _0x750284=[];delete _0x538ce5['id'];if(_0x538ce5[_0x7fc1('0x2f')]!==_0x7fc1('0x30')){_0x538ce5['intervals']=[_0x538ce5['interval']];}else{_0x538ce5[_0x7fc1('0x31')]=_0x538ce5[_0x7fc1('0x2d')]?_[_0x7fc1('0x32')](_[_0x7fc1('0x33')](_0x5ead7a,{'IntervalId':_0x538ce5[_0x7fc1('0x2d')]}),_0x7fc1('0x2f')):[];}_0x538ce5[_0x7fc1('0x6')]=_0x173ba7[_0x7fc1('0x6')];_0x538ce5[_0x7fc1('0x7')]=_0x173ba7['exten'];if(_0x538ce5['type'])_0x538ce5['type']=_0x538ce5[_0x7fc1('0x4')][_0x7fc1('0x34')]();if(_0x173ba7[_0x7fc1('0x4')]===_0x7fc1('0x11')){if(_0x538ce5['hasOwnProperty'](_0x7fc1('0x35'))&&_0x538ce5[_0x7fc1('0x35')]&&_0x538ce5[_0x7fc1('0x35')]!=='--'){_0x3ae3b5[_0x7fc1('0xc')]({'type':_0x538ce5['type'][_0x7fc1('0x34')](),'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x36')+_0x538ce5[_0x7fc1('0x35')],'context':_0x173ba7[_0x7fc1('0x6')],'exten':_0x173ba7[_0x7fc1('0x7')],'priority':_0x538ce5[_0x7fc1('0x31')]['length']+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});}_0x3ae3b5[_0x7fc1('0xc')]({'type':_0x538ce5['type'][_0x7fc1('0x34')](),'app':'ExecIf','appdata':_0x7fc1('0x37')+(_0x538ce5[_0x7fc1('0x38')]?'Set(CALLERID(all)='+_0x538ce5[_0x7fc1('0x38')]+')':_0x7fc1('0x39')),'context':_0x173ba7['context'],'exten':_0x173ba7[_0x7fc1('0x7')],'priority':_0x538ce5[_0x7fc1('0x31')][_0x7fc1('0x21')]+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});}else{if(_0x538ce5[_0x7fc1('0x1a')]('answer')){if(['queue',_0x7fc1('0x3a')]['includes'](_0x538ce5[_0x7fc1('0x3b')][_0x7fc1('0x34')]())&&_0x538ce5[_0x7fc1('0x3c')]!==_0x7fc1('0x3d')){if(_0x538ce5[_0x7fc1('0x3e')]){_0x3ae3b5[_0x7fc1('0xc')]({'type':_0x538ce5[_0x7fc1('0x4')][_0x7fc1('0x34')](),'app':_0x7fc1('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x173ba7['context'],'exten':_0x173ba7[_0x7fc1('0x7')],'priority':_0x538ce5['intervals'][_0x7fc1('0x21')]+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});_0x3ae3b5['push']({'type':_0x538ce5[_0x7fc1('0x4')][_0x7fc1('0x34')](),'app':_0x7fc1('0x9'),'appdata':_0x7fc1('0x3f'),'context':_0x173ba7[_0x7fc1('0x6')],'exten':_0x173ba7[_0x7fc1('0x7')],'priority':_0x538ce5[_0x7fc1('0x31')][_0x7fc1('0x21')]+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});}else{_0x3ae3b5['push']({'type':_0x538ce5[_0x7fc1('0x4')]['toLowerCase'](),'app':_0x7fc1('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x173ba7[_0x7fc1('0x6')],'exten':_0x173ba7['exten'],'priority':_0x538ce5[_0x7fc1('0x31')][_0x7fc1('0x21')]+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});_0x3ae3b5[_0x7fc1('0xc')]({'type':_0x538ce5[_0x7fc1('0x4')]['toLowerCase'](),'app':_0x7fc1('0x9'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x173ba7[_0x7fc1('0x6')],'exten':_0x173ba7[_0x7fc1('0x7')],'priority':_0x538ce5[_0x7fc1('0x31')][_0x7fc1('0x21')]+_0x17f48c+_0x1242ee++,'VoiceExtensionId':_0x173ba7['id']});}}}}for(var _0x18cdea=0x0;_0x18cdea<_0x538ce5[_0x7fc1('0x31')]['length'];_0x18cdea++){var _0x4e9b22=_0x17f48c+_0x538ce5['intervals'][_0x7fc1('0x21')];var _0x30bc86=_0x18cdea===_0x538ce5[_0x7fc1('0x31')][_0x7fc1('0x21')]-0x1?_0x17f48c+_0x3ae3b5[_0x7fc1('0x21')]+_0x750284[_0x7fc1('0x21')]+0x2:_0x17f48c+_0x18cdea+0x1;_0x3ae3b5[_0x7fc1('0x40')](_0x18cdea,0x0,{'type':_0x173ba7[_0x7fc1('0x4')],'app':_0x7fc1('0x41'),'appdata':_0x538ce5['intervals'][_0x18cdea]+'?'+_0x173ba7[_0x7fc1('0x6')]+_0x7fc1('0x42')+_0x4e9b22+':'+_0x173ba7[_0x7fc1('0x6')]+_0x7fc1('0x42')+_0x30bc86,'exten':_0x173ba7[_0x7fc1('0x7')],'context':_0x173ba7['context'],'priority':_0x17f48c+_0x18cdea,'VoiceExtensionId':_0x173ba7['id']});}if(_0x538ce5['appType']===_0x7fc1('0x43'))_0x538ce5[_0x7fc1('0x44')]=_0x4f36c8(_0x173ba7,_0x538ce5[_0x7fc1('0x44')]);_0x538ce5[_0x7fc1('0x45')]=_0x3ae3b5[_0x7fc1('0x21')]?_[_0x7fc1('0x46')](_0x3ae3b5)['priority']+0x1:_0x17f48c;_0x1aa362=_[_0x7fc1('0x47')](_0x1aa362,_0x3ae3b5,[_0x538ce5],_0x750284);_0x17f48c=_[_0x7fc1('0x46')](_0x1aa362)[_0x7fc1('0x45')]+0x1;}return _0x51453f(_0x1aa362);})[_0x7fc1('0x48')](function(_0x3d070f){_0x38684c(_0x3d070f);});});}return _0x3de7bf[_0x7fc1('0x49')](_0x7fc1('0x4a'),attributes,{'tableName':_0x7fc1('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4a82cf){var _0x3cea9a=this['get']({'plain':!![]});var _0x95e960=_0x3cea9a[_0x7fc1('0x4')]===_0x7fc1('0x11')?_0x442176(_0x3cea9a):_0x3bbf44(_0x3cea9a);return _0xf8603c(_0x3cea9a,_0x4a82cf,_[_0x7fc1('0x46')](_0x95e960)[_0x7fc1('0x45')]+0x1)['then'](function(_0x19acde){var _0x33d54b=_[_0x7fc1('0x47')](_0x95e960,_0x19acde);_0x33d54b['push']({'type':_0x3cea9a[_0x7fc1('0x4')],'app':'Hangup','exten':_0x3cea9a[_0x7fc1('0x7')],'context':_0x3cea9a[_0x7fc1('0x6')],'priority':_['last'](_0x33d54b)[_0x7fc1('0x45')]+0x1,'VoiceExtensionId':_0x3cea9a['id']});return _0x33d54b;});}}});}; \ No newline at end of file +var _0x0c42=['No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','CDR(prefix)=noprefix','outboundrouteid=','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','length','name','split','phone','param','prefix','SIP','join','none','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','lodash','./voiceExtension.attributes','exports','type','Set','exten','alias','NoOp','CDR(routeAlias)='];(function(_0x1c75de,_0x52c9b3){var _0x20a5e6=function(_0x5cbec1){while(--_0x5cbec1){_0x1c75de['push'](_0x1c75de['shift']());}};_0x20a5e6(++_0x52c9b3);}(_0x0c42,0x191));var _0x20c4=function(_0x4cceda,_0x4039c0){_0x4cceda=_0x4cceda-0x0;var _0x27dcaa=_0x0c42[_0x4cceda];return _0x27dcaa;};'use strict';var _=require(_0x20c4('0x0'));var attributes=require(_0x20c4('0x1'));module[_0x20c4('0x2')]=function(_0x46af92){var _0xe6959=_0x46af92['models'];function _0x5d686d(_0x3a3e5b){var _0x1296a8=0x2;var _0x24bfc1=[{'type':_0x3a3e5b[_0x20c4('0x3')],'app':_0x20c4('0x4'),'appdata':'CDR(type)='+_0x3a3e5b[_0x20c4('0x3')],'context':_0x3a3e5b['context'],'exten':_0x3a3e5b[_0x20c4('0x5')],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']},{'type':_0x3a3e5b['type'],'app':_0x3a3e5b[_0x20c4('0x6')]?_0x20c4('0x4'):_0x20c4('0x7'),'appdata':_0x3a3e5b['alias']?_0x20c4('0x8')+_0x3a3e5b[_0x20c4('0x6')]:_0x20c4('0x9'),'context':_0x3a3e5b[_0x20c4('0xa')],'exten':_0x3a3e5b[_0x20c4('0x5')],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']}];if(_0x3a3e5b[_0x20c4('0x3')]===_0x20c4('0xb')){_0x24bfc1[_0x20c4('0xc')]({'type':_0x20c4('0xb'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0xd')+_0x3a3e5b['id'],'context':_0x3a3e5b[_0x20c4('0xa')],'exten':_0x3a3e5b[_0x20c4('0x5')],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']});}_0x24bfc1['push']({'type':_0x3a3e5b[_0x20c4('0x3')],'app':'Set','appdata':_0x20c4('0xe'),'context':_0x3a3e5b[_0x20c4('0xa')],'exten':_0x3a3e5b['exten'],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']},{'type':_0x3a3e5b[_0x20c4('0x3')],'app':'Set','appdata':_0x20c4('0xf'),'context':_0x3a3e5b[_0x20c4('0xa')],'exten':_0x3a3e5b[_0x20c4('0x5')],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']},{'type':_0x3a3e5b['type'],'app':_0x20c4('0x4'),'appdata':_0x20c4('0x10'),'context':_0x3a3e5b[_0x20c4('0xa')],'exten':_0x3a3e5b[_0x20c4('0x5')],'priority':_0x1296a8++,'VoiceExtensionId':_0x3a3e5b['id']});return _0x24bfc1;}function _0x6385ad(_0x57d1a3){var _0x2f79a0=0x2;var _0x3fd9b7=[{'type':_0x20c4('0x11'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x12'),'context':_0x57d1a3['context'],'exten':_0x57d1a3['exten'],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x57d1a3['alias']?_0x20c4('0x4'):_0x20c4('0x7'),'appdata':_0x57d1a3[_0x20c4('0x6')]?_0x20c4('0x8')+_0x57d1a3[_0x20c4('0x6')]:_0x20c4('0x9'),'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x13')+(_0x57d1a3[_0x20c4('0x14')]?_0x20c4('0x15')+_0x57d1a3[_0x20c4('0x14')]+'}':_0x20c4('0x16')),'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0xd')+_0x57d1a3['id'],'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x20c4('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2f79a0+0x2)+'):Goto('+(_0x2f79a0+0x1)+')','context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':'outbound','app':_0x20c4('0x4'),'appdata':_0x57d1a3[_0x20c4('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x57d1a3[_0x20c4('0x14')]+'}':_0x20c4('0x18'),'context':_0x57d1a3['context'],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':'outbound','app':_0x20c4('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0xf'),'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3['exten'],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':'outbound','app':_0x20c4('0x4'),'appdata':_0x20c4('0x10'),'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':'Set','appdata':_0x20c4('0x19')+_0x57d1a3['id'],'context':_0x57d1a3['context'],'exten':_0x57d1a3[_0x20c4('0x5')],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']}];if(_0x57d1a3['hasOwnProperty']('recordingFormat')&&_0x57d1a3['recordingFormat']!=='none'){_0x3fd9b7[_0x20c4('0xc')]({'type':'outbound','app':_0x20c4('0x4'),'appdata':_0x20c4('0x1a'),'context':_0x57d1a3[_0x20c4('0xa')],'exten':_0x57d1a3['exten'],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']},{'type':_0x20c4('0x11'),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x1b')+_0x57d1a3[_0x20c4('0x1c')]||_0x20c4('0x1d'),'context':_0x57d1a3['context'],'exten':_0x57d1a3['exten'],'priority':_0x2f79a0++,'VoiceExtensionId':_0x57d1a3['id']});}return _0x3fd9b7;}function _0x578b05(_0x5d9b04,_0x19882f){var _0x26e7d4=[{'name':_0x20c4('0x1e'),'param':0x0},{'name':_0x20c4('0x1f'),'param':0x1},{'name':_0x20c4('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x29c250={};var _0x552bea=_0x19882f['split'](',');var _0x49cdb8=[];for(var _0x25aca3=0x0;_0x25aca3<_0x26e7d4[_0x20c4('0x21')];_0x25aca3++){switch(_0x26e7d4[_0x25aca3][_0x20c4('0x22')]){case _0x20c4('0x1e'):_0x29c250[_0x20c4('0x1e')]=_0x552bea[_0x26e7d4[_0x25aca3]['param']][_0x20c4('0x23')]('/')[0x1];_0x29c250[_0x20c4('0x24')]=_0x552bea[_0x26e7d4[_0x25aca3][_0x20c4('0x25')]][_0x20c4('0x23')]('/')[0x2];_0x29c250[_0x20c4('0x26')]=_0x29c250[_0x20c4('0x24')]?_0x29c250[_0x20c4('0x24')][_0x20c4('0x23')]('$')[0x0]:undefined;_0x29c250[_0x20c4('0x24')]=_0x5d9b04[_0x20c4('0x14')]?(_0x29c250[_0x20c4('0x26')]||'')+'${EXTEN:'+_0x5d9b04[_0x20c4('0x14')]+'}':(_0x29c250['prefix']||'')+_0x20c4('0x16');_0x49cdb8[_0x26e7d4[_0x25aca3][_0x20c4('0x25')]]=[_0x20c4('0x27'),_0x29c250[_0x20c4('0x1e')],_0x29c250[_0x20c4('0x24')]][_0x20c4('0x28')]('/');break;case _0x20c4('0x20'):_0x29c250[_0x20c4('0x20')]=_0x552bea[_0x26e7d4[_0x25aca3][_0x20c4('0x25')]];if(_0x5d9b04['recordingFormat']!==_0x20c4('0x29')){if(_0x29c250[_0x20c4('0x20')]['indexOf'](_0x20c4('0x2a'))<0x0){_0x29c250['options']+=_0x20c4('0x2a');}}else{_0x29c250['options']=_0x29c250[_0x20c4('0x20')]['replace'](_0x20c4('0x2a'),'');}_0x49cdb8[_0x26e7d4[_0x25aca3][_0x20c4('0x25')]]=_0x29c250[_0x20c4('0x20')];break;default:_0x49cdb8[_0x26e7d4[_0x25aca3]['param']]=_0x552bea[_0x26e7d4[_0x25aca3]['param']];}}return _0x49cdb8['join'](',');}function _0x1de291(_0x1cb31a,_0xbc1700,_0xe03cbd){return new Promise(function(_0x252e9f,_0xdb39bc){var _0x332beb=[];if(_[_0x20c4('0x2b')](_0xbc1700))return _0x252e9f(_0x332beb);_0xe6959[_0x20c4('0x2c')][_0x20c4('0x2d')]({'attributes':['id',_0x20c4('0x2e'),_0x20c4('0x2f')],'raw':!![]})[_0x20c4('0x30')](function(_0x4e9fc7){for(var _0x402c83=0x0,_0x40f314=0x0;_0x402c83<_0xbc1700['length'];_0x402c83++,_0x40f314=0x0){var _0x3c5a56=_0xbc1700[_0x402c83];var _0x44ca82=[];var _0x38605a=[];delete _0x3c5a56['id'];if(_0x3c5a56[_0x20c4('0x2e')]!==_0x20c4('0x31')){_0x3c5a56[_0x20c4('0x32')]=[_0x3c5a56['interval']];}else{_0x3c5a56[_0x20c4('0x32')]=_0x3c5a56[_0x20c4('0x2f')]?_[_0x20c4('0x33')](_[_0x20c4('0x34')](_0x4e9fc7,{'IntervalId':_0x3c5a56[_0x20c4('0x2f')]}),_0x20c4('0x2e')):[];}_0x3c5a56[_0x20c4('0xa')]=_0x1cb31a[_0x20c4('0xa')];_0x3c5a56[_0x20c4('0x5')]=_0x1cb31a['exten'];if(_0x3c5a56[_0x20c4('0x3')])_0x3c5a56[_0x20c4('0x3')]=_0x3c5a56[_0x20c4('0x3')][_0x20c4('0x35')]();if(_0x1cb31a[_0x20c4('0x3')]==='outbound'){if(_0x3c5a56[_0x20c4('0x36')]('tag')&&_0x3c5a56[_0x20c4('0x37')]&&_0x3c5a56[_0x20c4('0x37')]!=='--'){_0x44ca82[_0x20c4('0xc')]({'type':_0x3c5a56['type'][_0x20c4('0x35')](),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x38')+_0x3c5a56[_0x20c4('0x37')],'context':_0x1cb31a[_0x20c4('0xa')],'exten':_0x1cb31a[_0x20c4('0x5')],'priority':_0x3c5a56['intervals'][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});}_0x44ca82[_0x20c4('0xc')]({'type':_0x3c5a56[_0x20c4('0x3')]['toLowerCase'](),'app':_0x20c4('0x17'),'appdata':_0x20c4('0x39')+(_0x3c5a56[_0x20c4('0x3a')]?_0x20c4('0x3b')+_0x3c5a56['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x1cb31a[_0x20c4('0xa')],'exten':_0x1cb31a[_0x20c4('0x5')],'priority':_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});}else{if(_0x3c5a56['hasOwnProperty'](_0x20c4('0x3c'))){if([_0x20c4('0x3d'),_0x20c4('0x3e')][_0x20c4('0x3f')](_0x3c5a56[_0x20c4('0x40')][_0x20c4('0x35')]())&&_0x3c5a56[_0x20c4('0x41')]!=='custom'){if(_0x3c5a56['answer']){_0x44ca82[_0x20c4('0xc')]({'type':_0x3c5a56[_0x20c4('0x3')][_0x20c4('0x35')](),'app':'ExecIf','appdata':_0x20c4('0x42'),'context':_0x1cb31a[_0x20c4('0xa')],'exten':_0x1cb31a['exten'],'priority':_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});_0x44ca82['push']({'type':_0x3c5a56[_0x20c4('0x3')][_0x20c4('0x35')](),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x43'),'context':_0x1cb31a['context'],'exten':_0x1cb31a[_0x20c4('0x5')],'priority':_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});}else{_0x44ca82[_0x20c4('0xc')]({'type':_0x3c5a56['type'][_0x20c4('0x35')](),'app':_0x20c4('0x17'),'appdata':_0x20c4('0x44'),'context':_0x1cb31a['context'],'exten':_0x1cb31a[_0x20c4('0x5')],'priority':_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});_0x44ca82['push']({'type':_0x3c5a56[_0x20c4('0x3')]['toLowerCase'](),'app':_0x20c4('0x4'),'appdata':_0x20c4('0x45'),'context':_0x1cb31a[_0x20c4('0xa')],'exten':_0x1cb31a[_0x20c4('0x5')],'priority':_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]+_0xe03cbd+_0x40f314++,'VoiceExtensionId':_0x1cb31a['id']});}}}}for(var _0x464fa5=0x0;_0x464fa5<_0x3c5a56['intervals'][_0x20c4('0x21')];_0x464fa5++){var _0x51d204=_0xe03cbd+_0x3c5a56['intervals'][_0x20c4('0x21')];var _0x5b56ff=_0x464fa5===_0x3c5a56[_0x20c4('0x32')][_0x20c4('0x21')]-0x1?_0xe03cbd+_0x44ca82[_0x20c4('0x21')]+_0x38605a[_0x20c4('0x21')]+0x2:_0xe03cbd+_0x464fa5+0x1;_0x44ca82[_0x20c4('0x46')](_0x464fa5,0x0,{'type':_0x1cb31a[_0x20c4('0x3')],'app':_0x20c4('0x47'),'appdata':_0x3c5a56[_0x20c4('0x32')][_0x464fa5]+'?'+_0x1cb31a[_0x20c4('0xa')]+',${EXTEN},'+_0x51d204+':'+_0x1cb31a[_0x20c4('0xa')]+_0x20c4('0x48')+_0x5b56ff,'exten':_0x1cb31a[_0x20c4('0x5')],'context':_0x1cb31a[_0x20c4('0xa')],'priority':_0xe03cbd+_0x464fa5,'VoiceExtensionId':_0x1cb31a['id']});}if(_0x3c5a56[_0x20c4('0x41')]===_0x20c4('0x49'))_0x3c5a56['appdata']=_0x578b05(_0x1cb31a,_0x3c5a56[_0x20c4('0x4a')]);_0x3c5a56[_0x20c4('0x4b')]=_0x44ca82[_0x20c4('0x21')]?_[_0x20c4('0x4c')](_0x44ca82)[_0x20c4('0x4b')]+0x1:_0xe03cbd;_0x332beb=_[_0x20c4('0x4d')](_0x332beb,_0x44ca82,[_0x3c5a56],_0x38605a);_0xe03cbd=_['last'](_0x332beb)[_0x20c4('0x4b')]+0x1;}return _0x252e9f(_0x332beb);})[_0x20c4('0x4e')](function(_0x414df9){_0xdb39bc(_0x414df9);});});}return _0x46af92[_0x20c4('0x4f')](_0x20c4('0x50'),attributes,{'tableName':_0x20c4('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x438b8f){var _0x3c47bf=this['get']({'plain':!![]});var _0x105265=_0x3c47bf['type']===_0x20c4('0x11')?_0x6385ad(_0x3c47bf):_0x5d686d(_0x3c47bf);return _0x1de291(_0x3c47bf,_0x438b8f,_[_0x20c4('0x4c')](_0x105265)[_0x20c4('0x4b')]+0x1)[_0x20c4('0x30')](function(_0xed4086){var _0x4eb6a6=_[_0x20c4('0x4d')](_0x105265,_0xed4086);_0x4eb6a6['push']({'type':_0x3c47bf['type'],'app':'Hangup','exten':_0x3c47bf[_0x20c4('0x5')],'context':_0x3c47bf[_0x20c4('0xa')],'priority':_[_0x20c4('0x4c')](_0x4eb6a6)['priority']+0x1,'VoiceExtensionId':_0x3c47bf['id']});return _0x4eb6a6;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 358b523..e7d2a26 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 _0xc9b0=['findAll','options','raw','where','attributes','include','map','model','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','GetVoiceExtension','VoiceExtension'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0xc9b0,0x143));var _0x0c9b=function(_0x236c63,_0x12ff67){_0x236c63=_0x236c63-0x0;var _0x583e91=_0xc9b0[_0x236c63];return _0x583e91;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});config[_0x0c9b('0xc')]=_[_0x0c9b('0xd')](config[_0x0c9b('0xc')],{'host':_0x0c9b('0xe'),'port':0x18eb});var socket=require(_0x0c9b('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x1108b4,_0x16bde2,_0x1b6d84){return new BPromise(function(_0x3e271f,_0x1a8ee2){return client[_0x0c9b('0x10')](_0x1108b4,_0x1b6d84)['then'](function(_0x156cc7){logger[_0x0c9b('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x16bde2,_0x0c9b('0x12'));logger['debug'](_0x0c9b('0x13'),_0x16bde2,_0x0c9b('0x12'),JSON[_0x0c9b('0x14')](_0x156cc7));if(_0x156cc7[_0x0c9b('0x15')]){if(_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x16')]===0x1f4){logger[_0x0c9b('0x15')](_0x0c9b('0x17'),_0x16bde2,_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x18')]);return _0x1a8ee2(_0x156cc7['error']['message']);}logger['error'](_0x0c9b('0x17'),_0x16bde2,_0x156cc7[_0x0c9b('0x15')]['message']);return _0x3e271f(_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x18')]);}else{logger[_0x0c9b('0x11')](_0x0c9b('0x17'),_0x16bde2,_0x0c9b('0x12'));_0x3e271f(_0x156cc7[_0x0c9b('0x19')][_0x0c9b('0x18')]);}})['catch'](function(_0x5502d5){logger[_0x0c9b('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x16bde2,_0x5502d5);_0x1a8ee2(_0x5502d5);});});}exports[_0x0c9b('0x1a')]=function(_0x2cb320){var _0x1b8e61=this;return new Promise(function(_0xb5ce29,_0x1bf9f1){return db[_0x0c9b('0x1b')][_0x0c9b('0x1c')]({'raw':_0x2cb320[_0x0c9b('0x1d')]?_0x2cb320[_0x0c9b('0x1d')][_0x0c9b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cb320['options']?_0x2cb320[_0x0c9b('0x1d')][_0x0c9b('0x1f')]||null:null,'attributes':_0x2cb320[_0x0c9b('0x1d')]?_0x2cb320['options'][_0x0c9b('0x20')]||null:null,'limit':_0x2cb320[_0x0c9b('0x1d')]?_0x2cb320[_0x0c9b('0x1d')]['limit']||null:null,'include':_0x2cb320[_0x0c9b('0x1d')]?_0x2cb320['options'][_0x0c9b('0x21')]?_[_0x0c9b('0x22')](_0x2cb320[_0x0c9b('0x1d')][_0x0c9b('0x21')],function(_0xd0733f){return{'model':db[_0xd0733f[_0x0c9b('0x23')]],'as':_0xd0733f['as'],'attributes':_0xd0733f[_0x0c9b('0x20')],'include':_0xd0733f[_0x0c9b('0x21')]?_[_0x0c9b('0x22')](_0xd0733f[_0x0c9b('0x21')],function(_0x4367df){return{'model':db[_0x4367df['model']],'as':_0x4367df['as'],'attributes':_0x4367df['attributes'],'include':_0x4367df[_0x0c9b('0x21')]?_[_0x0c9b('0x22')](_0x4367df[_0x0c9b('0x21')],function(_0x2c9f63){return{'model':db[_0x2c9f63['model']],'as':_0x2c9f63['as'],'attributes':_0x2c9f63[_0x0c9b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0c9b('0x24')](function(_0x54f75e){logger[_0x0c9b('0x11')](_0x0c9b('0x1a'),_0x2cb320);logger[_0x0c9b('0x25')](_0x0c9b('0x1a'),_0x2cb320,JSON[_0x0c9b('0x14')](_0x54f75e));_0xb5ce29(_0x54f75e);})[_0x0c9b('0x26')](function(_0x523fad){logger[_0x0c9b('0x15')](_0x0c9b('0x1a'),_0x523fad['message'],_0x2cb320);_0x1bf9f1(_0x1b8e61[_0x0c9b('0x15')](0x1f4,_0x523fad[_0x0c9b('0x18')]));});});}; \ No newline at end of file +var _0xd819=['map','include','model','then','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit'];(function(_0x2081aa,_0x31d653){var _0x36485d=function(_0x4381f5){while(--_0x4381f5){_0x2081aa['push'](_0x2081aa['shift']());}};_0x36485d(++_0x31d653);}(_0xd819,0x181));var _0x9d81=function(_0x2b5d39,_0x55a5f2){_0x2b5d39=_0x2b5d39-0x0;var _0x3917c4=_0xd819[_0x2b5d39];return _0x3917c4;};'use strict';var _=require('lodash');var util=require(_0x9d81('0x0'));var moment=require(_0x9d81('0x1'));var BPromise=require(_0x9d81('0x2'));var rs=require(_0x9d81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d81('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d81('0x5'))('rpc');var config=require(_0x9d81('0x6'));var jayson=require(_0x9d81('0x7'));var client=jayson[_0x9d81('0x8')]['http']({'port':0x232a});config[_0x9d81('0x9')]=_[_0x9d81('0xa')](config[_0x9d81('0x9')],{'host':_0x9d81('0xb'),'port':0x18eb});var socket=require(_0x9d81('0xc'))(new Redis(config[_0x9d81('0x9')]));require(_0x9d81('0xd'))[_0x9d81('0xe')](socket);function respondWithRpcPromise(_0x25a4c0,_0x3932e7,_0x17a3a3){return new BPromise(function(_0x44bba4,_0x404b15){return client[_0x9d81('0xf')](_0x25a4c0,_0x17a3a3)['then'](function(_0x139d28){logger[_0x9d81('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x3932e7,_0x9d81('0x11'));logger[_0x9d81('0x12')](_0x9d81('0x13'),_0x3932e7,_0x9d81('0x11'),JSON['stringify'](_0x139d28));if(_0x139d28[_0x9d81('0x14')]){if(_0x139d28['error'][_0x9d81('0x15')]===0x1f4){logger['error'](_0x9d81('0x16'),_0x3932e7,_0x139d28[_0x9d81('0x14')]['message']);return _0x404b15(_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);}logger[_0x9d81('0x14')](_0x9d81('0x16'),_0x3932e7,_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);return _0x44bba4(_0x139d28[_0x9d81('0x14')][_0x9d81('0x17')]);}else{logger['info'](_0x9d81('0x16'),_0x3932e7,_0x9d81('0x11'));_0x44bba4(_0x139d28[_0x9d81('0x18')][_0x9d81('0x17')]);}})[_0x9d81('0x19')](function(_0x49e4c9){logger['error'](_0x9d81('0x16'),_0x3932e7,_0x49e4c9);_0x404b15(_0x49e4c9);});});}exports[_0x9d81('0x1a')]=function(_0x3104ad){var _0x40960c=this;return new Promise(function(_0x409720,_0x175d4f){return db[_0x9d81('0x1b')][_0x9d81('0x1c')]({'raw':_0x3104ad[_0x9d81('0x1d')]?_0x3104ad[_0x9d81('0x1d')][_0x9d81('0x1e')]===undefined?!![]:![]:!![],'where':_0x3104ad[_0x9d81('0x1d')]?_0x3104ad[_0x9d81('0x1d')]['where']||null:null,'attributes':_0x3104ad[_0x9d81('0x1d')]?_0x3104ad[_0x9d81('0x1d')][_0x9d81('0x1f')]||null:null,'limit':_0x3104ad[_0x9d81('0x1d')]?_0x3104ad[_0x9d81('0x1d')][_0x9d81('0x20')]||null:null,'include':_0x3104ad[_0x9d81('0x1d')]?_0x3104ad[_0x9d81('0x1d')]['include']?_[_0x9d81('0x21')](_0x3104ad[_0x9d81('0x1d')][_0x9d81('0x22')],function(_0x220535){return{'model':db[_0x220535['model']],'as':_0x220535['as'],'attributes':_0x220535[_0x9d81('0x1f')],'include':_0x220535['include']?_[_0x9d81('0x21')](_0x220535['include'],function(_0x3835b5){return{'model':db[_0x3835b5['model']],'as':_0x3835b5['as'],'attributes':_0x3835b5[_0x9d81('0x1f')],'include':_0x3835b5[_0x9d81('0x22')]?_[_0x9d81('0x21')](_0x3835b5[_0x9d81('0x22')],function(_0xb82d79){return{'model':db[_0xb82d79[_0x9d81('0x23')]],'as':_0xb82d79['as'],'attributes':_0xb82d79[_0x9d81('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9d81('0x24')](function(_0x1861d9){logger[_0x9d81('0x10')](_0x9d81('0x1a'),_0x3104ad);logger[_0x9d81('0x12')](_0x9d81('0x1a'),_0x3104ad,JSON[_0x9d81('0x25')](_0x1861d9));_0x409720(_0x1861d9);})[_0x9d81('0x19')](function(_0xe0cf0d){logger['error']('GetVoiceExtension',_0xe0cf0d[_0x9d81('0x17')],_0x3104ad);_0x175d4f(_0x40960c[_0x9d81('0x14')](0x1f4,_0xe0cf0d[_0x9d81('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e2db222..fb1c69d 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x47841b,_0x36c970){var _0xb87205=function(_0x29c5a1){while(--_0x29c5a1){_0x47841b['push'](_0x47841b['shift']());}};_0xb87205(++_0x36c970);}(_0x5fab,0x177));var _0xb5fa=function(_0x2113d8,_0x5a3232){_0x2113d8=_0x2113d8-0x0;var _0x1c8538=_0x5fab[_0x2113d8];return _0x1c8538;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x24cb8c,_0x423901){var _0x2b9b59=function(_0x21ded5){while(--_0x21ded5){_0x24cb8c['push'](_0x24cb8c['shift']());}};_0x2b9b59(++_0x423901);}(_0xe14b,0x93));var _0xbe14=function(_0x541928,_0x4a7ceb){_0x541928=_0x541928-0x0;var _0x4eaa35=_0xe14b[_0x541928];return _0x4eaa35;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 966b753..61913bf 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x33fa71,_0xd4911f){var _0x4eca32=function(_0x46a7d0){while(--_0x46a7d0){_0x33fa71['push'](_0x33fa71['shift']());}};_0x4eca32(++_0xd4911f);}(_0x7a54,0x106));var _0x47a5=function(_0x4e144f,_0x10f673){_0x4e144f=_0x4e144f-0x0;var _0x3383a7=_0x7a54[_0x4e144f];return _0x3383a7;};'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/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0xacf4=['index','/:id','isAuthenticated','show','post','create','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get'];(function(_0x4977d6,_0xcb82b0){var _0x544d35=function(_0x1dc2dc){while(--_0x1dc2dc){_0x4977d6['push'](_0x4977d6['shift']());}};_0x544d35(++_0xcb82b0);}(_0xacf4,0xe7));var _0x4acf=function(_0xcd0ede,_0xd16617){_0xcd0ede=_0xcd0ede-0x0;var _0x421a1=_0xacf4[_0xcd0ede];return _0x421a1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4acf('0x0'));var timeout=require(_0x4acf('0x1'));var express=require(_0x4acf('0x2'));var router=express[_0x4acf('0x3')]();var fs_extra=require(_0x4acf('0x4'));var auth=require(_0x4acf('0x5'));var interaction=require(_0x4acf('0x6'));var config=require('../../config/environment');var controller=require(_0x4acf('0x7'));router[_0x4acf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4acf('0x9')]);router[_0x4acf('0x8')](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller[_0x4acf('0xc')]);router['get']('/:id/messages',auth[_0x4acf('0xb')](),controller['getMessages']);router[_0x4acf('0xd')]('/',auth[_0x4acf('0xb')](),controller[_0x4acf('0xe')]);router['put'](_0x4acf('0xa'),auth[_0x4acf('0xb')](),controller['update']);router['delete'](_0x4acf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x4acf('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 21efb85..5625ad6 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 _0xef95=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x4456ba,_0x51f8b3){var _0x2b837b=function(_0x622537){while(--_0x622537){_0x4456ba['push'](_0x4456ba['shift']());}};_0x2b837b(++_0x51f8b3);}(_0xef95,0xc4));var _0x5ef9=function(_0x484f5a,_0x519900){_0x484f5a=_0x484f5a-0x0;var _0x41ae46=_0xef95[_0x484f5a];return _0x41ae46;};'use strict';var Sequelize=require(_0x5ef9('0x0'));module[_0x5ef9('0x1')]={'customer_id':{'type':Sequelize[_0x5ef9('0x2')]},'context':{'type':Sequelize[_0x5ef9('0x2')],'defaultValue':_0x5ef9('0x3'),'unique':_0x5ef9('0x4')},'mailbox':{'type':Sequelize[_0x5ef9('0x2')],'defaultValue':'','allowNull':![],'unique':_0x5ef9('0x4')},'password':{'type':Sequelize[_0x5ef9('0x2')]},'fullname':{'type':Sequelize[_0x5ef9('0x2')]},'email':{'type':Sequelize[_0x5ef9('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4bb0ec){this[_0x5ef9('0x5')](_0x5ef9('0x6'),typeof _0x4bb0ec===_0x5ef9('0x7')&&_0x4bb0ec[_0x5ef9('0x8')]()?_0x4bb0ec['trim']():null);}},'pager':{'type':Sequelize[_0x5ef9('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5ef9('0x9')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5ef9('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':_0x5ef9('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x5ef9('0x2')]},'review':{'type':Sequelize[_0x5ef9('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5ef9('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5ef9('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':_0x5ef9('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5ef9('0xb')](_0x5ef9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x5ef9('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x5ef9('0x2')]},'emailbody':{'type':Sequelize[_0x5ef9('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5ef9('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5ef9('0xe')],'get':function(){return this[_0x5ef9('0xf')](_0x5ef9('0x10'))+_0x5ef9('0x11')+this[_0x5ef9('0xf')](_0x5ef9('0x12'));}}}; \ No newline at end of file +var _0xff99=['string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x3dfcba,_0x3b0971){var _0x22f973=function(_0x1bf9b8){while(--_0x1bf9b8){_0x3dfcba['push'](_0x3dfcba['shift']());}};_0x22f973(++_0x3b0971);}(_0xff99,0x6c));var _0x9ff9=function(_0x5073e1,_0x45be5d){_0x5073e1=_0x5073e1-0x0;var _0x4f7218=_0xff99[_0x5073e1];return _0x4f7218;};'use strict';var Sequelize=require(_0x9ff9('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x9ff9('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x9ff9('0x2'),'unique':_0x9ff9('0x3')},'mailbox':{'type':Sequelize[_0x9ff9('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x9ff9('0x1')]},'fullname':{'type':Sequelize[_0x9ff9('0x1')]},'email':{'type':Sequelize[_0x9ff9('0x1')],'validate':{'isEmail':!![]},'set':function(_0x130e62){this[_0x9ff9('0x4')](_0x9ff9('0x5'),typeof _0x130e62===_0x9ff9('0x6')&&_0x130e62[_0x9ff9('0x7')]()?_0x130e62[_0x9ff9('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x9ff9('0x1')],'defaultValue':_0x9ff9('0x8')},'attach':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':_0x9ff9('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':_0x9ff9('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9ff9('0x1')]},'callback':{'type':Sequelize[_0x9ff9('0x1')]},'review':{'type':Sequelize[_0x9ff9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9ff9('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9ff9('0x9')]('yes','no'),'defaultValue':_0x9ff9('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9ff9('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9ff9('0x9')](_0x9ff9('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x9ff9('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x9ff9('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x9ff9('0x1')]},'maxsecs':{'type':Sequelize[_0x9ff9('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9ff9('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9ff9('0xe')],'get':function(){return this['getDataValue'](_0x9ff9('0xf'))+_0x9ff9('0x10')+this[_0x9ff9('0x11')](_0x9ff9('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f97d9ee..13c38e6 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 _0x0102=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Voicemails','destroy','then','sendStatus','stack','name','send','index','VoiceMail'];(function(_0x349acc,_0x1a9ab3){var _0x468c01=function(_0xfadbea){while(--_0xfadbea){_0x349acc['push'](_0x349acc['shift']());}};_0x468c01(++_0x1a9ab3);}(_0x0102,0x186));var _0x2010=function(_0x720e34,_0x43a5b6){_0x720e34=_0x720e34-0x0;var _0x55e9d6=_0x0102[_0x720e34];return _0x55e9d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){var _0xdb57be=_0x277dcc[_0x2010('0x23')]({'plain':!![]});var _0x52b4fe=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x25')]({'where':{'type':_0x52b4fe,'resourceId':_0xdb57be['id']}})[_0x2010('0x26')](function(){return _0x277dcc;});})[_0x2010('0x26')](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x2f63bb,_0x981b65){return function(_0x3eb4dc){if(!_0x3eb4dc){_0x2f63bb[_0x2010('0x27')](0x194);}return _0x3eb4dc;};}function handleError(_0x103460,_0x122ee3){_0x122ee3=_0x122ee3||0x1f4;return function(_0x2ebdbb){logger['error'](_0x2ebdbb[_0x2010('0x28')]);if(_0x2ebdbb['name']){delete _0x2ebdbb[_0x2010('0x29')];}_0x103460[_0x2010('0x19')](_0x122ee3)[_0x2010('0x2a')](_0x2ebdbb);};}exports[_0x2010('0x2b')]=function(_0x564a64,_0x554f66){var _0x136d5f={},_0x48d9f2={},_0x2839f2={'count':0x0,'rows':[]};var _0x1d5d7a=_['map'](db[_0x2010('0x2c')][_0x2010('0x2d')],function(_0x2b1ff7){return{'name':_0x2b1ff7[_0x2010('0x2e')],'type':_0x2b1ff7[_0x2010('0x2f')]['key']};});_0x48d9f2[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1d5d7a,_0x2010('0x29'));_0x48d9f2['query']=_['keys'](_0x564a64[_0x2010('0x32')]);_0x48d9f2[_0x2010('0x33')]=_[_0x2010('0x34')](_0x48d9f2['model'],_0x48d9f2['query']);_0x136d5f[_0x2010('0x35')]=_[_0x2010('0x34')](_0x48d9f2[_0x2010('0x30')],qs[_0x2010('0x36')](_0x564a64[_0x2010('0x32')]['fields']));_0x136d5f['attributes']=_0x136d5f['attributes'][_0x2010('0x37')]?_0x136d5f[_0x2010('0x35')]:_0x48d9f2[_0x2010('0x30')];if(!_0x564a64['query'][_0x2010('0x38')](_0x2010('0x39'))){_0x136d5f[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x564a64['query'][_0x2010('0x1d')]);_0x136d5f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x564a64['query'][_0x2010('0x1b')]);}_0x136d5f['order']=qs[_0x2010('0x3a')](_0x564a64[_0x2010('0x32')][_0x2010('0x3a')]);_0x136d5f[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x564a64['query'],_0x48d9f2[_0x2010('0x33')]),_0x1d5d7a);if(_0x564a64['query'][_0x2010('0x3d')]){_0x136d5f[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x136d5f[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x1d5d7a,function(_0x1f053c){if(_0x1f053c[_0x2010('0x2f')]!==_0x2010('0x3f')){var _0x2fcaef={};_0x2fcaef[_0x1f053c[_0x2010('0x29')]]={'$like':'%'+_0x564a64[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x2fcaef;}})});}_0x136d5f=_[_0x2010('0x3e')]({},_0x136d5f,_0x564a64[_0x2010('0x40')]);var _0x4b6251={'where':_0x136d5f['where']};return db[_0x2010('0x2c')][_0x2010('0x1e')](_0x4b6251)[_0x2010('0x26')](function(_0x35d631){_0x2839f2[_0x2010('0x1e')]=_0x35d631;if(_0x564a64[_0x2010('0x32')][_0x2010('0x41')]){_0x136d5f['include']=[{'all':!![]}];}return db[_0x2010('0x2c')]['findAll'](_0x136d5f);})[_0x2010('0x26')](function(_0x3ff496){_0x2839f2[_0x2010('0x42')]=_0x3ff496;return _0x2839f2;})[_0x2010('0x26')](respondWithFilteredResult(_0x554f66,_0x136d5f))[_0x2010('0x43')](handleError(_0x554f66,null));};exports['show']=function(_0x364338,_0x71eb35){var _0x3dd83c={'raw':!![],'where':{'id':_0x364338['params']['id']}},_0x41b3b5={};_0x41b3b5[_0x2010('0x30')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x41b3b5[_0x2010('0x32')]=_[_0x2010('0x44')](_0x364338[_0x2010('0x32')]);_0x41b3b5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],_0x41b3b5['query']);_0x3dd83c[_0x2010('0x35')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],qs['fields'](_0x364338['query'][_0x2010('0x36')]));_0x3dd83c['attributes']=_0x3dd83c[_0x2010('0x35')][_0x2010('0x37')]?_0x3dd83c[_0x2010('0x35')]:_0x41b3b5[_0x2010('0x30')];if(_0x364338['query'][_0x2010('0x41')]){_0x3dd83c[_0x2010('0x45')]=[{'all':!![]}];}_0x3dd83c=_[_0x2010('0x3e')]({},_0x3dd83c,_0x364338[_0x2010('0x40')]);return db[_0x2010('0x2c')][_0x2010('0x46')](_0x3dd83c)['then'](handleEntityNotFound(_0x71eb35,null))[_0x2010('0x26')](respondWithResult(_0x71eb35,null))[_0x2010('0x43')](handleError(_0x71eb35,null));};exports[_0x2010('0x47')]=function(_0x4dc0cf,_0x30e5d0){return db[_0x2010('0x2c')]['create'](_0x4dc0cf[_0x2010('0x48')],{})[_0x2010('0x26')](function(_0x110791){var _0x242274=_0x4dc0cf[_0x2010('0x49')][_0x2010('0x23')]({'plain':!![]});if(!_0x242274)throw new Error(_0x2010('0x4a'));if(_0x242274[_0x2010('0x4b')]==='user'){var _0x5258b9=_0x110791[_0x2010('0x23')]({'plain':!![]});var _0xe1721f='Voicemails';return db[_0x2010('0x4c')][_0x2010('0x46')]({'where':{'name':_0xe1721f,'userProfileId':_0x242274[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x26')](function(_0x1f1a59){if(_0x1f1a59&&_0x1f1a59['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x47')]({'name':_0x5258b9[_0x2010('0x29')],'resourceId':_0x5258b9['id'],'type':_0x1f1a59[_0x2010('0x29')],'sectionId':_0x1f1a59['id']},{})[_0x2010('0x26')](function(){return _0x110791;});}else{return _0x110791;}})[_0x2010('0x43')](function(_0x2d8164){logger[_0x2010('0x4e')](_0x2010('0x4f'),_0x2d8164);throw _0x2d8164;});}return _0x110791;})[_0x2010('0x26')](respondWithResult(_0x30e5d0,0xc9))[_0x2010('0x43')](handleError(_0x30e5d0,null));};exports[_0x2010('0x50')]=function(_0x5313b5,_0x24421a){if(_0x5313b5[_0x2010('0x48')]['id']){delete _0x5313b5['body']['id'];}return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x5313b5[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x24421a,null))[_0x2010('0x26')](saveUpdates(_0x5313b5[_0x2010('0x48')],null))[_0x2010('0x26')](respondWithResult(_0x24421a,null))[_0x2010('0x43')](handleError(_0x24421a,null));};exports[_0x2010('0x25')]=function(_0x2dbc2c,_0x1c0b2d){return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x2dbc2c[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x1c0b2d,null))[_0x2010('0x26')](removeEntity(_0x1c0b2d,null))[_0x2010('0x43')](handleError(_0x1c0b2d,null));};exports[_0x2010('0x52')]=function(_0x2d7765,_0x6f8565,_0x21ee87){return db[_0x2010('0x2c')][_0x2010('0x53')]({'where':{'id':_0x2d7765['params']['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x6f8565,null))['then'](function(_0x5253d5){var _0x1225d7;var _0x13f33d={},_0x4fb5d5={};_0x4fb5d5[_0x2010('0x30')]=_[_0x2010('0x44')](db[_0x2010('0x54')][_0x2010('0x2d')]);_0x4fb5d5['query']=_[_0x2010('0x44')](_0x2d7765[_0x2010('0x32')]);_0x4fb5d5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x4fb5d5['model'],_0x4fb5d5[_0x2010('0x32')]);_0x13f33d['attributes']=_[_0x2010('0x34')](_0x4fb5d5[_0x2010('0x30')],qs[_0x2010('0x36')](_0x2d7765[_0x2010('0x32')]['fields']));_0x13f33d['attributes']=_0x13f33d[_0x2010('0x35')][_0x2010('0x37')]?_0x13f33d['attributes']:_0x4fb5d5['model'];if(!_0x2d7765[_0x2010('0x32')][_0x2010('0x38')](_0x2010('0x39'))){_0x13f33d[_0x2010('0x1d')]=qs['limit'](_0x2d7765[_0x2010('0x32')]['limit']);_0x13f33d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2d7765[_0x2010('0x32')][_0x2010('0x1b')]);}_0x13f33d['order']=qs[_0x2010('0x3a')](_0x2d7765[_0x2010('0x32')]['sort']);_0x13f33d[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x2d7765[_0x2010('0x32')],_0x4fb5d5[_0x2010('0x33')]));if(_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]){_0x13f33d[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x13f33d[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x13f33d[_0x2010('0x35')],function(_0x4ebdca){var _0x3ca7b3={};_0x3ca7b3[_0x4ebdca]={'$like':'%'+_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x3ca7b3;})});}_0x13f33d['where']=_['merge'](_0x13f33d[_0x2010('0x3b')],{'mailboxuser':_0x5253d5[_0x2010('0x55')]});_0x13f33d=_[_0x2010('0x3e')]({},_0x13f33d,_0x2d7765[_0x2010('0x40')]);return db[_0x2010('0x54')][_0x2010('0x56')](_0x13f33d)['then'](respondWithFilteredResult(_0x6f8565,_0x13f33d));})[_0x2010('0x43')](handleError(_0x6f8565,null));}; \ No newline at end of file +var _0xe605=['count','set','Content-Range','apply','save','update','then','destroy','Voicemails','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceMail','findAll','rows','show','params','intersection','find','catch','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x28b4cd,_0x573ff1){var _0x4229cc=function(_0x2ba663){while(--_0x2ba663){_0x28b4cd['push'](_0x28b4cd['shift']());}};_0x4229cc(++_0x573ff1);}(_0xe605,0x92));var _0x5e60=function(_0x3468ff,_0x20c595){_0x3468ff=_0x3468ff-0x0;var _0x5ad8d7=_0xe605[_0x3468ff];return _0x5ad8d7;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){var _0x19f37b=_0x5d2c03['get']({'plain':!![]});var _0x45cb62=_0x5e60('0x28');return db[_0x5e60('0x29')][_0x5e60('0x27')]({'where':{'type':_0x45cb62,'resourceId':_0x19f37b['id']}})['then'](function(){return _0x5d2c03;});})[_0x5e60('0x26')](function(){_0x2a499e['status'](0xcc)[_0x5e60('0x1b')]();});}};}function handleEntityNotFound(_0x221322,_0x4ba727){return function(_0x46691f){if(!_0x46691f){_0x221322[_0x5e60('0x19')](0x194);}return _0x46691f;};}function handleError(_0x5b1b46,_0x1ee931){_0x1ee931=_0x1ee931||0x1f4;return function(_0xac9c7a){logger['error'](_0xac9c7a['stack']);if(_0xac9c7a['name']){delete _0xac9c7a[_0x5e60('0x2a')];}_0x5b1b46[_0x5e60('0x1a')](_0x1ee931)[_0x5e60('0x2b')](_0xac9c7a);};}exports[_0x5e60('0x2c')]=function(_0x3ccfee,_0x558197){var _0x168ce6={},_0x405461={},_0x4d4b55={'count':0x0,'rows':[]};var _0x11fc87=_['map'](db['VoiceMail'][_0x5e60('0x2d')],function(_0x3c4340){return{'name':_0x3c4340[_0x5e60('0x2e')],'type':_0x3c4340[_0x5e60('0x2f')][_0x5e60('0x30')]};});_0x405461[_0x5e60('0x31')]=_[_0x5e60('0x32')](_0x11fc87,_0x5e60('0x2a'));_0x405461[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x3ccfee['query']);_0x405461[_0x5e60('0x35')]=_['intersection'](_0x405461['model'],_0x405461[_0x5e60('0x33')]);_0x168ce6[_0x5e60('0x36')]=_['intersection'](_0x405461[_0x5e60('0x31')],qs['fields'](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x37')]));_0x168ce6[_0x5e60('0x36')]=_0x168ce6[_0x5e60('0x36')][_0x5e60('0x38')]?_0x168ce6[_0x5e60('0x36')]:_0x405461[_0x5e60('0x31')];if(!_0x3ccfee[_0x5e60('0x33')]['hasOwnProperty'](_0x5e60('0x39'))){_0x168ce6[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x168ce6[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x3ccfee['query'][_0x5e60('0x1d')]);}_0x168ce6[_0x5e60('0x3a')]=qs['sort'](_0x3ccfee['query'][_0x5e60('0x3b')]);_0x168ce6[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x3ccfee[_0x5e60('0x33')],_0x405461['filters']),_0x11fc87);if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x168ce6[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x168ce6[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x32')](_0x11fc87,function(_0x2b635a){if(_0x2b635a['type']!==_0x5e60('0x40')){var _0x1f95b2={};_0x1f95b2[_0x2b635a['name']]={'$like':'%'+_0x3ccfee['query']['filter']+'%'};return _0x1f95b2;}})});}_0x168ce6=_[_0x5e60('0x3f')]({},_0x168ce6,_0x3ccfee[_0x5e60('0x41')]);var _0x2c6d5b={'where':_0x168ce6[_0x5e60('0x3c')]};return db['VoiceMail'][_0x5e60('0x20')](_0x2c6d5b)[_0x5e60('0x26')](function(_0x4b6192){_0x4d4b55['count']=_0x4b6192;if(_0x3ccfee[_0x5e60('0x33')][_0x5e60('0x42')]){_0x168ce6[_0x5e60('0x43')]=[{'all':!![]}];}return db[_0x5e60('0x44')][_0x5e60('0x45')](_0x168ce6);})[_0x5e60('0x26')](function(_0x2522d2){_0x4d4b55[_0x5e60('0x46')]=_0x2522d2;return _0x4d4b55;})[_0x5e60('0x26')](respondWithFilteredResult(_0x558197,_0x168ce6))['catch'](handleError(_0x558197,null));};exports[_0x5e60('0x47')]=function(_0x2bb154,_0x59a2eb){var _0x1b1567={'raw':!![],'where':{'id':_0x2bb154[_0x5e60('0x48')]['id']}},_0x4aac07={};_0x4aac07[_0x5e60('0x31')]=_[_0x5e60('0x34')](db['VoiceMail'][_0x5e60('0x2d')]);_0x4aac07[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x2bb154[_0x5e60('0x33')]);_0x4aac07['filters']=_['intersection'](_0x4aac07['model'],_0x4aac07[_0x5e60('0x33')]);_0x1b1567[_0x5e60('0x36')]=_[_0x5e60('0x49')](_0x4aac07[_0x5e60('0x31')],qs[_0x5e60('0x37')](_0x2bb154[_0x5e60('0x33')]['fields']));_0x1b1567[_0x5e60('0x36')]=_0x1b1567[_0x5e60('0x36')][_0x5e60('0x38')]?_0x1b1567[_0x5e60('0x36')]:_0x4aac07[_0x5e60('0x31')];if(_0x2bb154[_0x5e60('0x33')][_0x5e60('0x42')]){_0x1b1567['include']=[{'all':!![]}];}_0x1b1567=_[_0x5e60('0x3f')]({},_0x1b1567,_0x2bb154[_0x5e60('0x41')]);return db[_0x5e60('0x44')][_0x5e60('0x4a')](_0x1b1567)[_0x5e60('0x26')](handleEntityNotFound(_0x59a2eb,null))[_0x5e60('0x26')](respondWithResult(_0x59a2eb,null))[_0x5e60('0x4b')](handleError(_0x59a2eb,null));};exports[_0x5e60('0x4c')]=function(_0x1518bd,_0x350d6d){return db[_0x5e60('0x44')][_0x5e60('0x4c')](_0x1518bd[_0x5e60('0x4d')],{})[_0x5e60('0x26')](function(_0x1aa381){var _0x176ef3=_0x1518bd[_0x5e60('0x4e')][_0x5e60('0x4f')]({'plain':!![]});if(!_0x176ef3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176ef3['role']===_0x5e60('0x4e')){var _0x4d3588=_0x1aa381[_0x5e60('0x4f')]({'plain':!![]});var _0x1d247e=_0x5e60('0x28');return db[_0x5e60('0x50')][_0x5e60('0x4a')]({'where':{'name':_0x1d247e,'userProfileId':_0x176ef3[_0x5e60('0x51')]},'raw':!![]})['then'](function(_0x48bea6){if(_0x48bea6&&_0x48bea6[_0x5e60('0x52')]===0x0){return db[_0x5e60('0x29')][_0x5e60('0x4c')]({'name':_0x4d3588['name'],'resourceId':_0x4d3588['id'],'type':_0x48bea6['name'],'sectionId':_0x48bea6['id']},{})[_0x5e60('0x26')](function(){return _0x1aa381;});}else{return _0x1aa381;}})[_0x5e60('0x4b')](function(_0x179cc6){logger['error'](_0x5e60('0x53'),_0x179cc6);throw _0x179cc6;});}return _0x1aa381;})[_0x5e60('0x26')](respondWithResult(_0x350d6d,0xc9))[_0x5e60('0x4b')](handleError(_0x350d6d,null));};exports[_0x5e60('0x25')]=function(_0x17d002,_0x148204){if(_0x17d002['body']['id']){delete _0x17d002[_0x5e60('0x4d')]['id'];}return db[_0x5e60('0x44')]['find']({'where':{'id':_0x17d002[_0x5e60('0x48')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x148204,null))[_0x5e60('0x26')](saveUpdates(_0x17d002['body'],null))[_0x5e60('0x26')](respondWithResult(_0x148204,null))[_0x5e60('0x4b')](handleError(_0x148204,null));};exports['destroy']=function(_0x26e129,_0x367208){return db[_0x5e60('0x44')][_0x5e60('0x4a')]({'where':{'id':_0x26e129['params']['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x367208,null))[_0x5e60('0x26')](removeEntity(_0x367208,null))['catch'](handleError(_0x367208,null));};exports[_0x5e60('0x54')]=function(_0x4cb322,_0x8d00b9,_0x5220fc){return db[_0x5e60('0x44')][_0x5e60('0x55')]({'where':{'id':_0x4cb322['params']['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x8d00b9,null))['then'](function(_0x1a2094){var _0x566fc7;var _0x157787={},_0x5b4daa={};_0x5b4daa[_0x5e60('0x31')]=_[_0x5e60('0x34')](db[_0x5e60('0x56')][_0x5e60('0x2d')]);_0x5b4daa[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x4cb322[_0x5e60('0x33')]);_0x5b4daa['filters']=_[_0x5e60('0x49')](_0x5b4daa[_0x5e60('0x31')],_0x5b4daa[_0x5e60('0x33')]);_0x157787[_0x5e60('0x36')]=_[_0x5e60('0x49')](_0x5b4daa[_0x5e60('0x31')],qs['fields'](_0x4cb322['query']['fields']));_0x157787[_0x5e60('0x36')]=_0x157787[_0x5e60('0x36')]['length']?_0x157787[_0x5e60('0x36')]:_0x5b4daa[_0x5e60('0x31')];if(!_0x4cb322['query'][_0x5e60('0x57')](_0x5e60('0x39'))){_0x157787[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x1e')]);_0x157787[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x1d')]);}_0x157787[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3b')]);_0x157787[_0x5e60('0x3c')]=qs[_0x5e60('0x35')](_[_0x5e60('0x3d')](_0x4cb322['query'],_0x5b4daa[_0x5e60('0x35')]));if(_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3e')]){_0x157787['where']=_[_0x5e60('0x3f')](_0x157787[_0x5e60('0x3c')],{'$or':_['map'](_0x157787[_0x5e60('0x36')],function(_0x6f4d2f){var _0x5bbaaf={};_0x5bbaaf[_0x6f4d2f]={'$like':'%'+_0x4cb322[_0x5e60('0x33')][_0x5e60('0x3e')]+'%'};return _0x5bbaaf;})});}_0x157787[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x157787[_0x5e60('0x3c')],{'mailboxuser':_0x1a2094[_0x5e60('0x58')]});_0x157787=_[_0x5e60('0x3f')]({},_0x157787,_0x4cb322[_0x5e60('0x41')]);return db[_0x5e60('0x56')]['findAndCountAll'](_0x157787)[_0x5e60('0x26')](respondWithFilteredResult(_0x8d00b9,_0x157787));})[_0x5e60('0x4b')](handleError(_0x8d00b9,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ec2a507..5dc3297 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 _0x77ff=['bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','moment'];(function(_0x555286,_0x121221){var _0x1bad4d=function(_0x1a3bf1){while(--_0x1a3bf1){_0x555286['push'](_0x555286['shift']());}};_0x1bad4d(++_0x121221);}(_0x77ff,0x1cd));var _0xf77f=function(_0x3f7ffe,_0x4874db){_0x3f7ffe=_0x3f7ffe-0x0;var _0x1230a0=_0x77ff[_0x3f7ffe];return _0x1230a0;};'use strict';var _=require(_0xf77f('0x0'));var util=require(_0xf77f('0x1'));var logger=require(_0xf77f('0x2'))('api');var moment=require(_0xf77f('0x3'));var BPromise=require(_0xf77f('0x4'));var rp=require(_0xf77f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf77f('0x6'));var config=require(_0xf77f('0x7'));var attributes=require(_0xf77f('0x8'));module[_0xf77f('0x9')]=function(_0x1fa669,_0x3cba97){return _0x1fa669[_0xf77f('0xa')](_0xf77f('0xb'),attributes,{'tableName':_0xf77f('0xc'),'paranoid':![],'indexes':[{'name':_0xf77f('0xd'),'fields':['mailbox',_0xf77f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x25ad=['context','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x25ad,0xd3));var _0xd25a=function(_0x52eceb,_0x400bb4){_0x52eceb=_0x52eceb-0x0;var _0x415694=_0x25ad[_0x52eceb];return _0x415694;};'use strict';var _=require(_0xd25a('0x0'));var util=require(_0xd25a('0x1'));var logger=require(_0xd25a('0x2'))(_0xd25a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd25a('0x4'));var fs=require('fs');var path=require(_0xd25a('0x5'));var rimraf=require(_0xd25a('0x6'));var config=require(_0xd25a('0x7'));var attributes=require(_0xd25a('0x8'));module[_0xd25a('0x9')]=function(_0x463034,_0x52dba8){return _0x463034[_0xd25a('0xa')](_0xd25a('0xb'),attributes,{'tableName':_0xd25a('0xc'),'paranoid':![],'indexes':[{'name':_0xd25a('0xd'),'fields':['mailbox',_0xd25a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c5b3202..2dcca9a 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 _0xa211=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../mysqldb'];(function(_0x4298ed,_0x38e24c){var _0x206ec4=function(_0x5909d0){while(--_0x5909d0){_0x4298ed['push'](_0x4298ed['shift']());}};_0x206ec4(++_0x38e24c);}(_0xa211,0x130));var _0x1a21=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa211[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x1a21('0x0'));var moment=require(_0x1a21('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a21('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a21('0x3'))['db'];var utils=require(_0x1a21('0x4'));var logger=require(_0x1a21('0x5'))(_0x1a21('0x6'));var config=require(_0x1a21('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1a21('0x8')][_0x1a21('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3669ad,_0x3f6537,_0x13ca42){return new BPromise(function(_0x2c6250,_0x113e48){return client[_0x1a21('0xa')](_0x3669ad,_0x13ca42)[_0x1a21('0xb')](function(_0x32cc87){logger[_0x1a21('0xc')](_0x1a21('0xd'),_0x3f6537,_0x1a21('0xe'));logger[_0x1a21('0xf')](_0x1a21('0x10'),_0x3f6537,_0x1a21('0xe'),JSON['stringify'](_0x32cc87));if(_0x32cc87[_0x1a21('0x11')]){if(_0x32cc87[_0x1a21('0x11')][_0x1a21('0x12')]===0x1f4){logger['error'](_0x1a21('0xd'),_0x3f6537,_0x32cc87[_0x1a21('0x11')][_0x1a21('0x13')]);return _0x113e48(_0x32cc87[_0x1a21('0x11')][_0x1a21('0x13')]);}logger['error'](_0x1a21('0xd'),_0x3f6537,_0x32cc87['error'][_0x1a21('0x13')]);return _0x2c6250(_0x32cc87[_0x1a21('0x11')][_0x1a21('0x13')]);}else{logger['info'](_0x1a21('0xd'),_0x3f6537,_0x1a21('0xe'));_0x2c6250(_0x32cc87[_0x1a21('0x14')][_0x1a21('0x13')]);}})[_0x1a21('0x15')](function(_0x5b3130){logger[_0x1a21('0x11')](_0x1a21('0xd'),_0x3f6537,_0x5b3130);_0x113e48(_0x5b3130);});});} \ No newline at end of file +var _0x8b50=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8b50,0x131));var _0x08b5=function(_0x3447bd,_0x34f6d3){_0x3447bd=_0x3447bd-0x0;var _0x2290bb=_0x8b50[_0x3447bd];return _0x2290bb;};'use strict';var _=require('lodash');var util=require(_0x08b5('0x0'));var moment=require(_0x08b5('0x1'));var BPromise=require(_0x08b5('0x2'));var rs=require(_0x08b5('0x3'));var fs=require('fs');var Redis=require(_0x08b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x08b5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x08b5('0x6'));var jayson=require(_0x08b5('0x7'));var client=jayson[_0x08b5('0x8')][_0x08b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3757c5,_0x4461f7,_0x58afb0){return new BPromise(function(_0x2e7bde,_0x4caf8d){return client[_0x08b5('0xa')](_0x3757c5,_0x58afb0)[_0x08b5('0xb')](function(_0x44d72a){logger['info'](_0x08b5('0xc'),_0x4461f7,_0x08b5('0xd'));logger[_0x08b5('0xe')](_0x08b5('0xf'),_0x4461f7,_0x08b5('0xd'),JSON[_0x08b5('0x10')](_0x44d72a));if(_0x44d72a[_0x08b5('0x11')]){if(_0x44d72a['error']['code']===0x1f4){logger[_0x08b5('0x11')](_0x08b5('0xc'),_0x4461f7,_0x44d72a['error']['message']);return _0x4caf8d(_0x44d72a[_0x08b5('0x11')][_0x08b5('0x12')]);}logger[_0x08b5('0x11')](_0x08b5('0xc'),_0x4461f7,_0x44d72a[_0x08b5('0x11')][_0x08b5('0x12')]);return _0x2e7bde(_0x44d72a[_0x08b5('0x11')][_0x08b5('0x12')]);}else{logger['info'](_0x08b5('0xc'),_0x4461f7,_0x08b5('0xd'));_0x2e7bde(_0x44d72a[_0x08b5('0x13')][_0x08b5('0x12')]);}})['catch'](function(_0x4d7ae4){logger[_0x08b5('0x11')](_0x08b5('0xc'),_0x4461f7,_0x4d7ae4);_0x4caf8d(_0x4d7ae4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index b5f7c35..f1fa365 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 _0x2552=['destroy','exports','multer','connect-timeout','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','post','create','put','update','delete'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2552,0x1ab));var _0x2255=function(_0x4ec382,_0x204f09){_0x4ec382=_0x4ec382-0x0;var _0x5d96ab=_0x2552[_0x4ec382];return _0x5d96ab;};'use strict';var multer=require(_0x2255('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2255('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2255('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2255('0x3'));var controller=require(_0x2255('0x4'));router[_0x2255('0x5')]('/',auth[_0x2255('0x6')](),controller['index']);router[_0x2255('0x5')](_0x2255('0x7'),auth['isAuthenticated'](),controller[_0x2255('0x8')]);router[_0x2255('0x5')](_0x2255('0x9'),auth[_0x2255('0x6')](),controller['download']);router[_0x2255('0xa')]('/',auth[_0x2255('0x6')](),controller[_0x2255('0xb')]);router[_0x2255('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x2255('0xd')]);router[_0x2255('0xe')](_0x2255('0x7'),auth['isAuthenticated'](),controller[_0x2255('0xf')]);module[_0x2255('0x10')]=router; \ No newline at end of file +var _0x0aff=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','/:id/download','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4cf2ac,_0x39d182){var _0xbf5dc1=function(_0xd7e307){while(--_0xd7e307){_0x4cf2ac['push'](_0x4cf2ac['shift']());}};_0xbf5dc1(++_0x39d182);}(_0x0aff,0x1cb));var _0xf0af=function(_0x18546c,_0x4daf94){_0x18546c=_0x18546c-0x0;var _0x46ef43=_0x0aff[_0x18546c];return _0x46ef43;};'use strict';var multer=require(_0xf0af('0x0'));var util=require(_0xf0af('0x1'));var path=require(_0xf0af('0x2'));var timeout=require(_0xf0af('0x3'));var express=require(_0xf0af('0x4'));var router=express[_0xf0af('0x5')]();var fs_extra=require(_0xf0af('0x6'));var auth=require(_0xf0af('0x7'));var interaction=require(_0xf0af('0x8'));var config=require(_0xf0af('0x9'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf0af('0xa')]);router[_0xf0af('0xb')](_0xf0af('0xc'),auth[_0xf0af('0xd')](),controller['show']);router[_0xf0af('0xb')](_0xf0af('0xe'),auth['isAuthenticated'](),controller['download']);router[_0xf0af('0xf')]('/',auth[_0xf0af('0xd')](),controller['create']);router[_0xf0af('0x10')]('/:id',auth[_0xf0af('0xd')](),controller[_0xf0af('0x11')]);router[_0xf0af('0x12')](_0xf0af('0xc'),auth[_0xf0af('0xd')](),controller[_0xf0af('0x13')]);module[_0xf0af('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 87bad05..5b37312 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 _0xb35e=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb35e,0x131));var _0xeb35=function(_0x46e8a9,_0x1bd946){_0x46e8a9=_0x46e8a9-0x0;var _0x48a221=_0xb35e[_0x46e8a9];return _0x48a221;};'use strict';var Sequelize=require(_0xeb35('0x0'));module[_0xeb35('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1be2c1){return this[_0xeb35('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xeb35('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xeb35('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xeb35('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xeb35('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xeb35('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xeb35('0x5')](_0xeb35('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xeb35('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xeb35('0x7'),'defaultValue':Sequelize[_0xeb35('0x8')](_0xeb35('0x9'))}}; \ No newline at end of file +var _0x29e7=['getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL'];(function(_0x2986d5,_0x37db4a){var _0x14dff2=function(_0x1e08e2){while(--_0x1e08e2){_0x2986d5['push'](_0x2986d5['shift']());}};_0x14dff2(++_0x37db4a);}(_0x29e7,0x16f));var _0x729e=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0x29e7[_0x475bf1];return _0x4095d1;};'use strict';var Sequelize=require(_0x729e('0x0'));module[_0x729e('0x1')]={'name':{'type':Sequelize[_0x729e('0x2')],'get':function(_0xe3f68a){return this[_0x729e('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x729e('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x729e('0x6')](_0x729e('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x729e('0x5')],'defaultValue':''},'stamp':{'type':_0x729e('0x8'),'defaultValue':Sequelize[_0x729e('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 28511fc..1f1cdf4 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 _0xc125=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','VoiceMailMessage','count','includeAll','include','rows','catch','show','params','create','body','find','msg_id','recording','Sequelize','ValidationError','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','differenceBy','keys'];(function(_0x449385,_0x4543e1){var _0x234dd4=function(_0x4993cd){while(--_0x4993cd){_0x449385['push'](_0x449385['shift']());}};_0x234dd4(++_0x4543e1);}(_0xc125,0x15d));var _0x5c12=function(_0x300e38,_0x16b554){_0x300e38=_0x300e38-0x0;var _0x28ff3c=_0xc125[_0x300e38];return _0x28ff3c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c12('0x0'));var zipdir=require(_0x5c12('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c12('0x2'));var moment=require(_0x5c12('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c12('0x4'));var path=require(_0x5c12('0x5'));var sox=require(_0x5c12('0x6'));var csv=require(_0x5c12('0x7'));var ejs=require(_0x5c12('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c12('0x9'));var squel=require(_0x5c12('0xa'));var crypto=require(_0x5c12('0xb'));var jsforce=require(_0x5c12('0xc'));var deskjs=require(_0x5c12('0xd'));var toCsv=require(_0x5c12('0x7'));var querystring=require(_0x5c12('0xe'));var Papa=require(_0x5c12('0xf'));var Redis=require(_0x5c12('0x10'));var authService=require(_0x5c12('0x11'));var qs=require(_0x5c12('0x12'));var as=require(_0x5c12('0x13'));var hardwareService=require(_0x5c12('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5c12('0x15'))['db'];function respondWithStatusCode(_0x183e18,_0xc08ff8){_0xc08ff8=_0xc08ff8||0xcc;return function(_0x2ee79c){if(_0x2ee79c){return _0x183e18[_0x5c12('0x16')](_0xc08ff8);}return _0x183e18['status'](_0xc08ff8)['end']();};}function respondWithResult(_0x593d2d,_0x8dc4d2){_0x8dc4d2=_0x8dc4d2||0xc8;return function(_0x2c3b3d){if(_0x2c3b3d){return _0x593d2d['status'](_0x8dc4d2)[_0x5c12('0x17')](_0x2c3b3d);}};}function respondWithFilteredResult(_0x4f28b9,_0xc099b7){return function(_0x45c6a2){if(_0x45c6a2){var _0x1a3a81=typeof _0xc099b7[_0x5c12('0x18')]===_0x5c12('0x19')&&typeof _0xc099b7[_0x5c12('0x1a')]===_0x5c12('0x19');var _0x711474=_0x45c6a2['count'];var _0x12b57f=_0x1a3a81?0x0:_0xc099b7['offset'];var _0x14be02=_0x1a3a81?_0x45c6a2['count']:_0xc099b7[_0x5c12('0x18')]+_0xc099b7[_0x5c12('0x1a')];var _0x18ffd2;if(_0x14be02>=_0x711474){_0x14be02=_0x711474;_0x18ffd2=0xc8;}else{_0x18ffd2=0xce;}_0x4f28b9[_0x5c12('0x1b')](_0x18ffd2);return _0x4f28b9[_0x5c12('0x1c')](_0x5c12('0x1d'),_0x12b57f+'-'+_0x14be02+'/'+_0x711474)[_0x5c12('0x17')](_0x45c6a2);}return null;};}function patchUpdates(_0x413c21){return function(_0x23dbb8){try{jsonpatch[_0x5c12('0x1e')](_0x23dbb8,_0x413c21,!![]);}catch(_0x58f146){return BPromise[_0x5c12('0x1f')](_0x58f146);}return _0x23dbb8[_0x5c12('0x20')]();};}function saveUpdates(_0x3e7dcc,_0x5aa22d){return function(_0x36b414){if(_0x36b414){return _0x36b414[_0x5c12('0x21')](_0x3e7dcc)[_0x5c12('0x22')](function(_0x41ea3f){return _0x41ea3f;});}return null;};}function removeEntity(_0x2c3947,_0x5d2c66){return function(_0x34c802){if(_0x34c802){return _0x34c802[_0x5c12('0x23')]()['then'](function(){_0x2c3947[_0x5c12('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1632f8,_0x645226){return function(_0x186056){if(!_0x186056){_0x1632f8[_0x5c12('0x16')](0x194);}return _0x186056;};}function handleError(_0x32d983,_0x1ef83c){_0x1ef83c=_0x1ef83c||0x1f4;return function(_0x2f9f49){logger['error'](_0x2f9f49[_0x5c12('0x24')]);if(_0x2f9f49[_0x5c12('0x25')]){delete _0x2f9f49['name'];}_0x32d983[_0x5c12('0x1b')](_0x1ef83c)[_0x5c12('0x26')](_0x2f9f49);};}exports[_0x5c12('0x27')]=function(_0x5a5592,_0x280a52){var _0x23e1ff={},_0xd6451b={},_0x3f22e0={'count':0x0,'rows':[]};var _0x18c4d9=_[_0x5c12('0x28')](db['VoiceMailMessage'][_0x5c12('0x29')],function(_0x547733){return{'name':_0x547733[_0x5c12('0x2a')],'type':_0x547733[_0x5c12('0x2b')]['key']};});_0xd6451b['model']=_[_0x5c12('0x2c')](_[_0x5c12('0x28')](_0x18c4d9,'name'),[_0x5c12('0x25')]);_0xd6451b['query']=_[_0x5c12('0x2d')](_0x5a5592[_0x5c12('0x2e')]);_0xd6451b[_0x5c12('0x2f')]=_[_0x5c12('0x30')](_0xd6451b[_0x5c12('0x31')],_0xd6451b[_0x5c12('0x2e')]);_0x23e1ff[_0x5c12('0x32')]=_[_0x5c12('0x30')](_0xd6451b['model'],qs[_0x5c12('0x33')](_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x33')]));_0x23e1ff[_0x5c12('0x32')]=_0x23e1ff['attributes'][_0x5c12('0x34')]?_0x23e1ff[_0x5c12('0x32')]:_0xd6451b[_0x5c12('0x31')];if(!_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x35')](_0x5c12('0x36'))){_0x23e1ff[_0x5c12('0x1a')]=qs[_0x5c12('0x1a')](_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x1a')]);_0x23e1ff[_0x5c12('0x18')]=qs[_0x5c12('0x18')](_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x18')]);}_0x23e1ff['order']=qs[_0x5c12('0x37')](_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x37')]);_0x23e1ff[_0x5c12('0x38')]=qs[_0x5c12('0x2f')](_['pick'](_0x5a5592[_0x5c12('0x2e')],_0xd6451b[_0x5c12('0x2f')]),_0x18c4d9);if(_0x5a5592['query']['filter']){_0x23e1ff[_0x5c12('0x38')]=_[_0x5c12('0x39')](_0x23e1ff[_0x5c12('0x38')],{'$or':_[_0x5c12('0x28')](_0x18c4d9,function(_0x882046){if(_0x882046[_0x5c12('0x2b')]!==_0x5c12('0x3a')){var _0x11b08e={};_0x11b08e[_0x882046[_0x5c12('0x25')]]={'$like':'%'+_0x5a5592[_0x5c12('0x2e')]['filter']+'%'};return _0x11b08e;}})});}_0x23e1ff=_[_0x5c12('0x39')]({},_0x23e1ff,_0x5a5592[_0x5c12('0x3b')]);var _0x59598e={'where':_0x23e1ff[_0x5c12('0x38')]};return db[_0x5c12('0x3c')]['count'](_0x59598e)[_0x5c12('0x22')](function(_0x17b735){_0x3f22e0[_0x5c12('0x3d')]=_0x17b735;if(_0x5a5592[_0x5c12('0x2e')][_0x5c12('0x3e')]){_0x23e1ff[_0x5c12('0x3f')]=[{'all':!![]}];}return db[_0x5c12('0x3c')]['findAll'](_0x23e1ff);})[_0x5c12('0x22')](function(_0x1665f8){_0x3f22e0[_0x5c12('0x40')]=_0x1665f8;return _0x3f22e0;})[_0x5c12('0x22')](respondWithFilteredResult(_0x280a52,_0x23e1ff))[_0x5c12('0x41')](handleError(_0x280a52,null));};exports[_0x5c12('0x42')]=function(_0x32d0b9,_0x1edc09){var _0x21103f={'raw':!![],'where':{'id':_0x32d0b9[_0x5c12('0x43')]['id']}},_0x22a09c={};_0x22a09c[_0x5c12('0x31')]=_['keys'](db[_0x5c12('0x3c')][_0x5c12('0x29')]);_0x22a09c[_0x5c12('0x2e')]=_[_0x5c12('0x2d')](_0x32d0b9[_0x5c12('0x2e')]);_0x22a09c[_0x5c12('0x2f')]=_['intersection'](_0x22a09c[_0x5c12('0x31')],_0x22a09c['query']);_0x21103f[_0x5c12('0x32')]=_[_0x5c12('0x30')](_0x22a09c[_0x5c12('0x31')],qs[_0x5c12('0x33')](_0x32d0b9[_0x5c12('0x2e')][_0x5c12('0x33')]));_0x21103f[_0x5c12('0x32')]=_0x21103f[_0x5c12('0x32')]['length']?_0x21103f[_0x5c12('0x32')]:_0x22a09c[_0x5c12('0x31')];if(_0x32d0b9[_0x5c12('0x2e')][_0x5c12('0x3e')]){_0x21103f[_0x5c12('0x3f')]=[{'all':!![]}];}_0x21103f=_[_0x5c12('0x39')]({},_0x21103f,_0x32d0b9[_0x5c12('0x3b')]);return db['VoiceMailMessage']['find'](_0x21103f)[_0x5c12('0x22')](handleEntityNotFound(_0x1edc09,null))['then'](respondWithResult(_0x1edc09,null))[_0x5c12('0x41')](handleError(_0x1edc09,null));};exports[_0x5c12('0x44')]=function(_0x505a74,_0x57d2f7){return db[_0x5c12('0x3c')]['create'](_0x505a74[_0x5c12('0x45')],{})[_0x5c12('0x22')](respondWithResult(_0x57d2f7,0xc9))['catch'](handleError(_0x57d2f7,null));};exports[_0x5c12('0x21')]=function(_0x12b901,_0x4cc5bc){if(_0x12b901['body']['id']){delete _0x12b901[_0x5c12('0x45')]['id'];}return db[_0x5c12('0x3c')][_0x5c12('0x46')]({'where':{'id':_0x12b901[_0x5c12('0x43')]['id']}})[_0x5c12('0x22')](handleEntityNotFound(_0x4cc5bc,null))[_0x5c12('0x22')](saveUpdates(_0x12b901[_0x5c12('0x45')],null))[_0x5c12('0x22')](respondWithResult(_0x4cc5bc,null))[_0x5c12('0x41')](handleError(_0x4cc5bc,null));};exports[_0x5c12('0x23')]=function(_0x49792b,_0x1d12ba){return db['VoiceMailMessage'][_0x5c12('0x46')]({'where':{'id':_0x49792b[_0x5c12('0x43')]['id']}})[_0x5c12('0x22')](handleEntityNotFound(_0x1d12ba,null))['then'](removeEntity(_0x1d12ba,null))[_0x5c12('0x41')](handleError(_0x1d12ba,null));};exports['download']=function(_0x2b492e,_0x4f1fa0,_0x479b24){return db['VoiceMailMessage'][_0x5c12('0x46')]({'where':{'id':_0x2b492e[_0x5c12('0x43')]['id']},'attributes':['id','recording',_0x5c12('0x47')]})[_0x5c12('0x22')](handleEntityNotFound(_0x4f1fa0,null))[_0x5c12('0x22')](function(_0x5b8ecb){if(_0x5b8ecb){if(!_0x5b8ecb[_0x5c12('0x48')]){throw new db[(_0x5c12('0x49'))][(_0x5c12('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0x36a99c={'Content-Type':_0x5c12('0x4b'),'Content-Disposition':'attachment'};if(_0x5b8ecb['msg_id']){_0x36a99c[_0x5c12('0x4c')]=_0x5c12('0x4d')+_0x5b8ecb[_0x5c12('0x47')]+_0x5c12('0x4e');}_0x4f1fa0[_0x5c12('0x1c')](_0x36a99c);return _0x4f1fa0[_0x5c12('0x26')](new Buffer(_0x5b8ecb[_0x5c12('0x48')]));}})[_0x5c12('0x41')](handleError(_0x4f1fa0,null));}; \ No newline at end of file +var _0x4c44=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','save','then','destroy','end','error','stack','send','index','VoiceMailMessage','rawAttributes','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','order','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','catch','update','body','download','msg_id','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','request-promise','moment'];(function(_0x382cd4,_0x5d3c15){var _0x4fe7b5=function(_0x44edff){while(--_0x44edff){_0x382cd4['push'](_0x382cd4['shift']());}};_0x4fe7b5(++_0x5d3c15);}(_0x4c44,0x9a));var _0x44c4=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x4c44[_0x1b4002];return _0x1716f3;};'use strict';var emlformat=require(_0x44c4('0x0'));var rimraf=require(_0x44c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44c4('0x2'));var moment=require(_0x44c4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x44c4('0x4'));var util=require(_0x44c4('0x5'));var path=require(_0x44c4('0x6'));var sox=require(_0x44c4('0x7'));var csv=require(_0x44c4('0x8'));var ejs=require(_0x44c4('0x9'));var fs=require('fs');var fs_extra=require(_0x44c4('0xa'));var _=require(_0x44c4('0xb'));var squel=require(_0x44c4('0xc'));var crypto=require(_0x44c4('0xd'));var jsforce=require(_0x44c4('0xe'));var deskjs=require(_0x44c4('0xf'));var toCsv=require(_0x44c4('0x8'));var querystring=require(_0x44c4('0x10'));var Papa=require(_0x44c4('0x11'));var Redis=require('ioredis');var authService=require(_0x44c4('0x12'));var qs=require(_0x44c4('0x13'));var as=require(_0x44c4('0x14'));var hardwareService=require(_0x44c4('0x15'));var logger=require('../../config/logger')(_0x44c4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x44c4('0x17'))['db'];function respondWithStatusCode(_0x2611af,_0x573a8e){_0x573a8e=_0x573a8e||0xcc;return function(_0x2205a6){if(_0x2205a6){return _0x2611af[_0x44c4('0x18')](_0x573a8e);}return _0x2611af[_0x44c4('0x19')](_0x573a8e)['end']();};}function respondWithResult(_0x5d2a75,_0x1d220b){_0x1d220b=_0x1d220b||0xc8;return function(_0x55b11d){if(_0x55b11d){return _0x5d2a75[_0x44c4('0x19')](_0x1d220b)['json'](_0x55b11d);}};}function respondWithFilteredResult(_0x3ae544,_0x5a2070){return function(_0x421816){if(_0x421816){var _0x2dd70c=typeof _0x5a2070[_0x44c4('0x1a')]==='undefined'&&typeof _0x5a2070[_0x44c4('0x1b')]==='undefined';var _0x1ce8ba=_0x421816['count'];var _0x190dc8=_0x2dd70c?0x0:_0x5a2070['offset'];var _0x135dfb=_0x2dd70c?_0x421816['count']:_0x5a2070[_0x44c4('0x1a')]+_0x5a2070['limit'];var _0x4462b1;if(_0x135dfb>=_0x1ce8ba){_0x135dfb=_0x1ce8ba;_0x4462b1=0xc8;}else{_0x4462b1=0xce;}_0x3ae544[_0x44c4('0x19')](_0x4462b1);return _0x3ae544[_0x44c4('0x1c')](_0x44c4('0x1d'),_0x190dc8+'-'+_0x135dfb+'/'+_0x1ce8ba)[_0x44c4('0x1e')](_0x421816);}return null;};}function patchUpdates(_0x268f9f){return function(_0x55d563){try{jsonpatch[_0x44c4('0x1f')](_0x55d563,_0x268f9f,!![]);}catch(_0x3b3884){return BPromise['reject'](_0x3b3884);}return _0x55d563[_0x44c4('0x20')]();};}function saveUpdates(_0xfcb62,_0x39b61e){return function(_0x4ddc10){if(_0x4ddc10){return _0x4ddc10['update'](_0xfcb62)[_0x44c4('0x21')](function(_0x578ab8){return _0x578ab8;});}return null;};}function removeEntity(_0x5e1115,_0x275760){return function(_0x12de24){if(_0x12de24){return _0x12de24[_0x44c4('0x22')]()['then'](function(){_0x5e1115[_0x44c4('0x19')](0xcc)[_0x44c4('0x23')]();});}};}function handleEntityNotFound(_0x351c3f,_0x30ee7c){return function(_0x4eb35c){if(!_0x4eb35c){_0x351c3f[_0x44c4('0x18')](0x194);}return _0x4eb35c;};}function handleError(_0x45b977,_0x5de146){_0x5de146=_0x5de146||0x1f4;return function(_0x4b430c){logger[_0x44c4('0x24')](_0x4b430c[_0x44c4('0x25')]);if(_0x4b430c['name']){delete _0x4b430c['name'];}_0x45b977['status'](_0x5de146)[_0x44c4('0x26')](_0x4b430c);};}exports[_0x44c4('0x27')]=function(_0x3d5bd0,_0x5be564){var _0x31dff8={},_0x4bfca8={},_0x2d0796={'count':0x0,'rows':[]};var _0x3df61f=_['map'](db[_0x44c4('0x28')][_0x44c4('0x29')],function(_0x18337e){return{'name':_0x18337e['fieldName'],'type':_0x18337e[_0x44c4('0x2a')][_0x44c4('0x2b')]};});_0x4bfca8[_0x44c4('0x2c')]=_['differenceBy'](_[_0x44c4('0x2d')](_0x3df61f,'name'),[_0x44c4('0x2e')]);_0x4bfca8[_0x44c4('0x2f')]=_[_0x44c4('0x30')](_0x3d5bd0[_0x44c4('0x2f')]);_0x4bfca8[_0x44c4('0x31')]=_['intersection'](_0x4bfca8[_0x44c4('0x2c')],_0x4bfca8[_0x44c4('0x2f')]);_0x31dff8[_0x44c4('0x32')]=_[_0x44c4('0x33')](_0x4bfca8[_0x44c4('0x2c')],qs['fields'](_0x3d5bd0[_0x44c4('0x2f')][_0x44c4('0x34')]));_0x31dff8['attributes']=_0x31dff8[_0x44c4('0x32')][_0x44c4('0x35')]?_0x31dff8[_0x44c4('0x32')]:_0x4bfca8['model'];if(!_0x3d5bd0[_0x44c4('0x2f')]['hasOwnProperty']('nolimit')){_0x31dff8[_0x44c4('0x1b')]=qs[_0x44c4('0x1b')](_0x3d5bd0[_0x44c4('0x2f')][_0x44c4('0x1b')]);_0x31dff8['offset']=qs[_0x44c4('0x1a')](_0x3d5bd0[_0x44c4('0x2f')]['offset']);}_0x31dff8[_0x44c4('0x36')]=qs['sort'](_0x3d5bd0[_0x44c4('0x2f')]['sort']);_0x31dff8[_0x44c4('0x37')]=qs['filters'](_[_0x44c4('0x38')](_0x3d5bd0[_0x44c4('0x2f')],_0x4bfca8[_0x44c4('0x31')]),_0x3df61f);if(_0x3d5bd0[_0x44c4('0x2f')]['filter']){_0x31dff8[_0x44c4('0x37')]=_[_0x44c4('0x39')](_0x31dff8[_0x44c4('0x37')],{'$or':_[_0x44c4('0x2d')](_0x3df61f,function(_0x589d51){if(_0x589d51[_0x44c4('0x2a')]!==_0x44c4('0x3a')){var _0x19ac95={};_0x19ac95[_0x589d51[_0x44c4('0x2e')]]={'$like':'%'+_0x3d5bd0[_0x44c4('0x2f')]['filter']+'%'};return _0x19ac95;}})});}_0x31dff8=_['merge']({},_0x31dff8,_0x3d5bd0[_0x44c4('0x3b')]);var _0x3fbeb8={'where':_0x31dff8['where']};return db[_0x44c4('0x28')]['count'](_0x3fbeb8)[_0x44c4('0x21')](function(_0x586402){_0x2d0796['count']=_0x586402;if(_0x3d5bd0[_0x44c4('0x2f')][_0x44c4('0x3c')]){_0x31dff8[_0x44c4('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x44c4('0x3e')](_0x31dff8);})[_0x44c4('0x21')](function(_0x25a0a2){_0x2d0796['rows']=_0x25a0a2;return _0x2d0796;})[_0x44c4('0x21')](respondWithFilteredResult(_0x5be564,_0x31dff8))['catch'](handleError(_0x5be564,null));};exports[_0x44c4('0x3f')]=function(_0x58cd3d,_0x85d20d){var _0x589a41={'raw':!![],'where':{'id':_0x58cd3d[_0x44c4('0x40')]['id']}},_0x4e1941={};_0x4e1941[_0x44c4('0x2c')]=_[_0x44c4('0x30')](db[_0x44c4('0x28')][_0x44c4('0x29')]);_0x4e1941[_0x44c4('0x2f')]=_['keys'](_0x58cd3d[_0x44c4('0x2f')]);_0x4e1941['filters']=_[_0x44c4('0x33')](_0x4e1941[_0x44c4('0x2c')],_0x4e1941[_0x44c4('0x2f')]);_0x589a41[_0x44c4('0x32')]=_[_0x44c4('0x33')](_0x4e1941[_0x44c4('0x2c')],qs[_0x44c4('0x34')](_0x58cd3d['query']['fields']));_0x589a41[_0x44c4('0x32')]=_0x589a41['attributes'][_0x44c4('0x35')]?_0x589a41[_0x44c4('0x32')]:_0x4e1941[_0x44c4('0x2c')];if(_0x58cd3d[_0x44c4('0x2f')][_0x44c4('0x3c')]){_0x589a41['include']=[{'all':!![]}];}_0x589a41=_['merge']({},_0x589a41,_0x58cd3d['options']);return db[_0x44c4('0x28')][_0x44c4('0x41')](_0x589a41)[_0x44c4('0x21')](handleEntityNotFound(_0x85d20d,null))[_0x44c4('0x21')](respondWithResult(_0x85d20d,null))['catch'](handleError(_0x85d20d,null));};exports[_0x44c4('0x42')]=function(_0x103bc3,_0x38ed76){return db[_0x44c4('0x28')][_0x44c4('0x42')](_0x103bc3['body'],{})[_0x44c4('0x21')](respondWithResult(_0x38ed76,0xc9))[_0x44c4('0x43')](handleError(_0x38ed76,null));};exports[_0x44c4('0x44')]=function(_0x468dcb,_0x51fa34){if(_0x468dcb[_0x44c4('0x45')]['id']){delete _0x468dcb[_0x44c4('0x45')]['id'];}return db[_0x44c4('0x28')][_0x44c4('0x41')]({'where':{'id':_0x468dcb[_0x44c4('0x40')]['id']}})[_0x44c4('0x21')](handleEntityNotFound(_0x51fa34,null))[_0x44c4('0x21')](saveUpdates(_0x468dcb['body'],null))[_0x44c4('0x21')](respondWithResult(_0x51fa34,null))[_0x44c4('0x43')](handleError(_0x51fa34,null));};exports['destroy']=function(_0xac4158,_0xb383ed){return db[_0x44c4('0x28')][_0x44c4('0x41')]({'where':{'id':_0xac4158['params']['id']}})['then'](handleEntityNotFound(_0xb383ed,null))[_0x44c4('0x21')](removeEntity(_0xb383ed,null))[_0x44c4('0x43')](handleError(_0xb383ed,null));};exports[_0x44c4('0x46')]=function(_0x438982,_0x5ad5ec,_0x3f5ec3){return db[_0x44c4('0x28')][_0x44c4('0x41')]({'where':{'id':_0x438982[_0x44c4('0x40')]['id']},'attributes':['id','recording',_0x44c4('0x47')]})[_0x44c4('0x21')](handleEntityNotFound(_0x5ad5ec,null))[_0x44c4('0x21')](function(_0x3d838a){if(_0x3d838a){if(!_0x3d838a[_0x44c4('0x48')]){throw new db[(_0x44c4('0x49'))]['ValidationError'](_0x44c4('0x4a'));}var _0x2facd0={'Content-Type':_0x44c4('0x4b'),'Content-Disposition':'attachment'};if(_0x3d838a[_0x44c4('0x47')]){_0x2facd0[_0x44c4('0x4c')]=_0x44c4('0x4d')+_0x3d838a[_0x44c4('0x47')]+_0x44c4('0x4e');}_0x5ad5ec[_0x44c4('0x1c')](_0x2facd0);return _0x5ad5ec['send'](new Buffer(_0x3d838a[_0x44c4('0x48')]));}})[_0x44c4('0x43')](handleError(_0x5ad5ec,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f7ffe97..f27a7ce 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 _0xa09e=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash'];(function(_0x574e54,_0x2c5784){var _0x581fc5=function(_0x281c81){while(--_0x281c81){_0x574e54['push'](_0x574e54['shift']());}};_0x581fc5(++_0x2c5784);}(_0xa09e,0x113));var _0xea09=function(_0x467e9e,_0x4a6888){_0x467e9e=_0x467e9e-0x0;var _0x10376a=_0xa09e[_0x467e9e];return _0x10376a;};'use strict';var _=require(_0xea09('0x0'));var util=require(_0xea09('0x1'));var logger=require(_0xea09('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea09('0x3'));var fs=require('fs');var path=require(_0xea09('0x4'));var rimraf=require(_0xea09('0x5'));var config=require(_0xea09('0x6'));var attributes=require(_0xea09('0x7'));module[_0xea09('0x8')]=function(_0x1c3f05,_0x4652d2){return _0x1c3f05[_0xea09('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xea09('0xa'),'paranoid':![],'indexes':[{'name':_0xea09('0xb'),'fields':[_0xea09('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x99c9=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x22b108,_0x462562){var _0x4ce9a9=function(_0x501dbe){while(--_0x501dbe){_0x22b108['push'](_0x22b108['shift']());}};_0x4ce9a9(++_0x462562);}(_0x99c9,0xe2));var _0x999c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x99c9[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require(_0x999c('0x7'));var rimraf=require(_0x999c('0x8'));var config=require(_0x999c('0x9'));var attributes=require(_0x999c('0xa'));module[_0x999c('0xb')]=function(_0x1e67f7,_0x5d7b42){return _0x1e67f7[_0x999c('0xc')](_0x999c('0xd'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x999c('0xe'),'fields':[_0x999c('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 263438b..4a6ae8f 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 _0x7c00=['../../config/utils','rpc','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x293b3d,_0x14f112){var _0x385438=function(_0x5cc69f){while(--_0x5cc69f){_0x293b3d['push'](_0x293b3d['shift']());}};_0x385438(++_0x14f112);}(_0x7c00,0x9d));var _0x07c0=function(_0x542ea5,_0x405542){_0x542ea5=_0x542ea5-0x0;var _0x4dc38c=_0x7c00[_0x542ea5];return _0x4dc38c;};'use strict';var _=require(_0x07c0('0x0'));var util=require(_0x07c0('0x1'));var moment=require(_0x07c0('0x2'));var BPromise=require(_0x07c0('0x3'));var rs=require(_0x07c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x07c0('0x5'));var logger=require('../../config/logger')(_0x07c0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x07c0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x58507c,_0x41a5d1,_0x395e90){return new BPromise(function(_0x5987b3,_0x24eb5a){return client[_0x07c0('0x8')](_0x58507c,_0x395e90)[_0x07c0('0x9')](function(_0x8fdd3b){logger[_0x07c0('0xa')](_0x07c0('0xb'),_0x41a5d1,_0x07c0('0xc'));logger['debug'](_0x07c0('0xd'),_0x41a5d1,_0x07c0('0xc'),JSON['stringify'](_0x8fdd3b));if(_0x8fdd3b[_0x07c0('0xe')]){if(_0x8fdd3b[_0x07c0('0xe')][_0x07c0('0xf')]===0x1f4){logger[_0x07c0('0xe')](_0x07c0('0xb'),_0x41a5d1,_0x8fdd3b[_0x07c0('0xe')][_0x07c0('0x10')]);return _0x24eb5a(_0x8fdd3b['error'][_0x07c0('0x10')]);}logger[_0x07c0('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x41a5d1,_0x8fdd3b[_0x07c0('0xe')]['message']);return _0x5987b3(_0x8fdd3b[_0x07c0('0xe')][_0x07c0('0x10')]);}else{logger[_0x07c0('0xa')](_0x07c0('0xb'),_0x41a5d1,_0x07c0('0xc'));_0x5987b3(_0x8fdd3b[_0x07c0('0x11')][_0x07c0('0x10')]);}})['catch'](function(_0x49a2f6){logger[_0x07c0('0xe')](_0x07c0('0xb'),_0x41a5d1,_0x49a2f6);_0x24eb5a(_0x49a2f6);});});} \ No newline at end of file +var _0x7d6c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x28e7ad,_0x304787){var _0x111aeb=function(_0x1df52b){while(--_0x1df52b){_0x28e7ad['push'](_0x28e7ad['shift']());}};_0x111aeb(++_0x304787);}(_0x7d6c,0x10d));var _0xc7d6=function(_0x4830b3,_0x499059){_0x4830b3=_0x4830b3-0x0;var _0x58ec71=_0x7d6c[_0x4830b3];return _0x58ec71;};'use strict';var _=require(_0xc7d6('0x0'));var util=require(_0xc7d6('0x1'));var moment=require(_0xc7d6('0x2'));var BPromise=require(_0xc7d6('0x3'));var rs=require(_0xc7d6('0x4'));var fs=require('fs');var Redis=require(_0xc7d6('0x5'));var db=require(_0xc7d6('0x6'))['db'];var utils=require(_0xc7d6('0x7'));var logger=require(_0xc7d6('0x8'))(_0xc7d6('0x9'));var config=require(_0xc7d6('0xa'));var jayson=require(_0xc7d6('0xb'));var client=jayson[_0xc7d6('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x139512,_0x5d2e95,_0x3c4ca7){return new BPromise(function(_0xd3bd6f,_0x198f81){return client['request'](_0x139512,_0x3c4ca7)['then'](function(_0x57f560){logger['info'](_0xc7d6('0xd'),_0x5d2e95,'request\x20sent');logger[_0xc7d6('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5d2e95,_0xc7d6('0xf'),JSON[_0xc7d6('0x10')](_0x57f560));if(_0x57f560[_0xc7d6('0x11')]){if(_0x57f560[_0xc7d6('0x11')][_0xc7d6('0x12')]===0x1f4){logger[_0xc7d6('0x11')](_0xc7d6('0xd'),_0x5d2e95,_0x57f560['error'][_0xc7d6('0x13')]);return _0x198f81(_0x57f560[_0xc7d6('0x11')][_0xc7d6('0x13')]);}logger[_0xc7d6('0x11')](_0xc7d6('0xd'),_0x5d2e95,_0x57f560['error'][_0xc7d6('0x13')]);return _0xd3bd6f(_0x57f560[_0xc7d6('0x11')][_0xc7d6('0x13')]);}else{logger[_0xc7d6('0x14')](_0xc7d6('0xd'),_0x5d2e95,_0xc7d6('0xf'));_0xd3bd6f(_0x57f560[_0xc7d6('0x15')][_0xc7d6('0x13')]);}})[_0xc7d6('0x16')](function(_0x417fea){logger['error'](_0xc7d6('0xd'),_0x5d2e95,_0x417fea);_0x198f81(_0x417fea);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6225783..bc711fe 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 _0x2c58=['/:id','show','get','isAuthenticated','getSounds','post','create','/:id/sounds','addSound','put','update','delete','/:id/sounds/:id2','removeSound','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','index'];(function(_0x10bb87,_0x3d04e3){var _0x4e663f=function(_0x55ec0f){while(--_0x55ec0f){_0x10bb87['push'](_0x10bb87['shift']());}};_0x4e663f(++_0x3d04e3);}(_0x2c58,0xf5));var _0x82c5=function(_0xd1cb11,_0x3a421e){_0xd1cb11=_0xd1cb11-0x0;var _0x519e1d=_0x2c58[_0xd1cb11];return _0x519e1d;};'use strict';var multer=require(_0x82c5('0x0'));var util=require(_0x82c5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x82c5('0x2'));var router=express[_0x82c5('0x3')]();var fs_extra=require(_0x82c5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82c5('0x5'));var config=require('../../config/environment');var controller=require(_0x82c5('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x82c5('0x7')]);router['get'](_0x82c5('0x8'),auth['isAuthenticated'](),controller[_0x82c5('0x9')]);router[_0x82c5('0xa')]('/:id/sounds',auth[_0x82c5('0xb')](),controller[_0x82c5('0xc')]);router[_0x82c5('0xd')]('/',auth[_0x82c5('0xb')](),controller[_0x82c5('0xe')]);router[_0x82c5('0xd')](_0x82c5('0xf'),auth[_0x82c5('0xb')](),controller[_0x82c5('0x10')]);router[_0x82c5('0x11')](_0x82c5('0x8'),auth['isAuthenticated'](),controller[_0x82c5('0x12')]);router[_0x82c5('0x13')](_0x82c5('0x8'),auth[_0x82c5('0xb')](),controller['destroy']);router[_0x82c5('0x13')](_0x82c5('0x14'),auth[_0x82c5('0xb')](),controller[_0x82c5('0x15')]);module[_0x82c5('0x16')]=router; \ No newline at end of file +var _0x00a4=['delete','destroy','/:id/sounds/:id2','removeSound','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','show','/:id/sounds','isAuthenticated','getSounds','post','update'];(function(_0x58e008,_0x5f4471){var _0xa386b1=function(_0x1f69fd){while(--_0x1f69fd){_0x58e008['push'](_0x58e008['shift']());}};_0xa386b1(++_0x5f4471);}(_0x00a4,0x17a));var _0x400a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x00a4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x400a('0x0'));var path=require(_0x400a('0x1'));var timeout=require(_0x400a('0x2'));var express=require('express');var router=express[_0x400a('0x3')]();var fs_extra=require(_0x400a('0x4'));var auth=require(_0x400a('0x5'));var interaction=require(_0x400a('0x6'));var config=require(_0x400a('0x7'));var controller=require(_0x400a('0x8'));router[_0x400a('0x9')]('/',auth['isAuthenticated'](),controller[_0x400a('0xa')]);router[_0x400a('0x9')](_0x400a('0xb'),auth['isAuthenticated'](),controller[_0x400a('0xc')]);router[_0x400a('0x9')](_0x400a('0xd'),auth[_0x400a('0xe')](),controller[_0x400a('0xf')]);router[_0x400a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x400a('0x10')](_0x400a('0xd'),auth[_0x400a('0xe')](),controller['addSound']);router['put'](_0x400a('0xb'),auth[_0x400a('0xe')](),controller[_0x400a('0x11')]);router[_0x400a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x400a('0x13')]);router['delete'](_0x400a('0x14'),auth[_0x400a('0xe')](),controller[_0x400a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 0e02091..c48701f 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 _0x7845=['TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3'];(function(_0x21ff3a,_0x41e335){var _0x53ce14=function(_0x5cb2b6){while(--_0x5cb2b6){_0x21ff3a['push'](_0x21ff3a['shift']());}};_0x53ce14(++_0x41e335);}(_0x7845,0x1e3));var _0x5784=function(_0x4e5bb4,_0x7521ad){_0x4e5bb4=_0x4e5bb4-0x0;var _0x1f3bd5=_0x7845[_0x4e5bb4];return _0x1f3bd5;};'use strict';var Sequelize=require(_0x5784('0x0'));module[_0x5784('0x1')]={'name':{'type':Sequelize[_0x5784('0x2')],'allowNull':![],'unique':_0x5784('0x3')},'mode':{'type':Sequelize[_0x5784('0x4')](_0x5784('0x5'),_0x5784('0x6'),_0x5784('0x7'),_0x5784('0x8'),_0x5784('0x9'),_0x5784('0xa')),'allowNull':!![],'defaultValue':_0x5784('0x6')},'directory':{'type':Sequelize[_0x5784('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x5784('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5784('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x5784('0x2')],'allowNull':!![]},'stamp':{'type':_0x5784('0xb')},'defaultEntry':{'type':Sequelize[_0x5784('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa679=['mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','ENUM','custom','files'];(function(_0x245c4f,_0x34b70f){var _0x3157a1=function(_0x18bfc7){while(--_0x18bfc7){_0x245c4f['push'](_0x245c4f['shift']());}};_0x3157a1(++_0x34b70f);}(_0xa679,0x8a));var _0x9a67=function(_0x4123cd,_0x511de7){_0x4123cd=_0x4123cd-0x0;var _0x5369da=_0xa679[_0x4123cd];return _0x5369da;};'use strict';var Sequelize=require(_0x9a67('0x0'));module[_0x9a67('0x1')]={'name':{'type':Sequelize[_0x9a67('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x9a67('0x3')](_0x9a67('0x4'),_0x9a67('0x5'),_0x9a67('0x6'),_0x9a67('0x7'),'quietmp3',_0x9a67('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x9a67('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x9a67('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9a67('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9a67('0x2')],'allowNull':!![],'defaultValue':_0x9a67('0x9')},'format':{'type':Sequelize[_0x9a67('0x2')],'allowNull':!![]},'stamp':{'type':_0x9a67('0xa')},'defaultEntry':{'type':Sequelize[_0x9a67('0xb')],'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 9f2e7c7..8c48bd9 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 _0x340c=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','UserProfileResource','end','error','stack','name','index','VoiceMusicOnHold','rawAttributes','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','catch','show','keys','length','find','body','create','sequelize','transaction','files','join','root','server/files/moh','mode','mkdirSync','directory','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readdirSync','Sequelize','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','removeSound','id2','Sound','unlinkSync','getSounds','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x340c,0xc2));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc340('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc340('0x1'));var jsonpatch=require(_0xc340('0x2'));var rp=require('request-promise');var moment=require(_0xc340('0x3'));var BPromise=require(_0xc340('0x4'));var Mustache=require(_0xc340('0x5'));var util=require(_0xc340('0x6'));var path=require(_0xc340('0x7'));var sox=require(_0xc340('0x8'));var csv=require(_0xc340('0x9'));var ejs=require(_0xc340('0xa'));var fs=require('fs');var fs_extra=require(_0xc340('0xb'));var _=require(_0xc340('0xc'));var squel=require(_0xc340('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc340('0xe'));var toCsv=require(_0xc340('0x9'));var querystring=require(_0xc340('0xf'));var Papa=require(_0xc340('0x10'));var Redis=require(_0xc340('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc340('0x12'));var hardwareService=require(_0xc340('0x13'));var logger=require(_0xc340('0x14'))(_0xc340('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc340('0x16'));var db=require(_0xc340('0x17'))['db'];function respondWithStatusCode(_0x305a93,_0x5581c3){_0x5581c3=_0x5581c3||0xcc;return function(_0x333a48){if(_0x333a48){return _0x305a93[_0xc340('0x18')](_0x5581c3);}return _0x305a93[_0xc340('0x19')](_0x5581c3)['end']();};}function respondWithResult(_0x46469c,_0xfce112){_0xfce112=_0xfce112||0xc8;return function(_0x2b6773){if(_0x2b6773){return _0x46469c['status'](_0xfce112)[_0xc340('0x1a')](_0x2b6773);}};}function respondWithFilteredResult(_0x5af2a1,_0x150f8c){return function(_0x8a4877){if(_0x8a4877){var _0x508a0b=typeof _0x150f8c[_0xc340('0x1b')]===_0xc340('0x1c')&&typeof _0x150f8c[_0xc340('0x1d')]===_0xc340('0x1c');var _0x30bcfb=_0x8a4877['count'];var _0x3f870d=_0x508a0b?0x0:_0x150f8c[_0xc340('0x1b')];var _0x52c900=_0x508a0b?_0x8a4877[_0xc340('0x1e')]:_0x150f8c[_0xc340('0x1b')]+_0x150f8c[_0xc340('0x1d')];var _0x35959c;if(_0x52c900>=_0x30bcfb){_0x52c900=_0x30bcfb;_0x35959c=0xc8;}else{_0x35959c=0xce;}_0x5af2a1[_0xc340('0x19')](_0x35959c);return _0x5af2a1[_0xc340('0x1f')](_0xc340('0x20'),_0x3f870d+'-'+_0x52c900+'/'+_0x30bcfb)[_0xc340('0x1a')](_0x8a4877);}return null;};}function patchUpdates(_0x347fc6){return function(_0x4c18c0){try{jsonpatch[_0xc340('0x21')](_0x4c18c0,_0x347fc6,!![]);}catch(_0x13303b){return BPromise[_0xc340('0x22')](_0x13303b);}return _0x4c18c0['save']();};}function saveUpdates(_0x554e1a,_0x375623){return function(_0x38626b){if(_0x38626b){return _0x38626b[_0xc340('0x23')](_0x554e1a)[_0xc340('0x24')](function(_0x209367){return _0x209367;});}return null;};}function removeEntity(_0x481673,_0x4fe2a3){return function(_0x4613a8){if(_0x4613a8){return _0x4613a8[_0xc340('0x25')]()[_0xc340('0x24')](function(){var _0x43c6e6=_0x4613a8['get']({'plain':!![]});var _0x51d8fb='MusicOnHolds';return db[_0xc340('0x26')][_0xc340('0x25')]({'where':{'type':_0x51d8fb,'resourceId':_0x43c6e6['id']}})['then'](function(){return _0x4613a8;});})[_0xc340('0x24')](function(){_0x481673[_0xc340('0x19')](0xcc)[_0xc340('0x27')]();});}};}function handleEntityNotFound(_0x4531d9,_0x504a43){return function(_0x1ebc91){if(!_0x1ebc91){_0x4531d9[_0xc340('0x18')](0x194);}return _0x1ebc91;};}function handleError(_0x13afe3,_0x2c395e){_0x2c395e=_0x2c395e||0x1f4;return function(_0x4787a9){logger[_0xc340('0x28')](_0x4787a9[_0xc340('0x29')]);if(_0x4787a9[_0xc340('0x2a')]){delete _0x4787a9['name'];}_0x13afe3[_0xc340('0x19')](_0x2c395e)['send'](_0x4787a9);};}exports[_0xc340('0x2b')]=function(_0x281350,_0x5bed98){var _0x43e942={},_0x27ef3a={},_0x544863={'count':0x0,'rows':[]};var _0x319b47=_['map'](db[_0xc340('0x2c')][_0xc340('0x2d')],function(_0x28aefd){return{'name':_0x28aefd['fieldName'],'type':_0x28aefd['type'][_0xc340('0x2e')]};});_0x27ef3a['model']=_[_0xc340('0x2f')](_0x319b47,_0xc340('0x2a'));_0x27ef3a[_0xc340('0x30')]=_['keys'](_0x281350['query']);_0x27ef3a[_0xc340('0x31')]=_[_0xc340('0x32')](_0x27ef3a[_0xc340('0x33')],_0x27ef3a['query']);_0x43e942['attributes']=_[_0xc340('0x32')](_0x27ef3a['model'],qs[_0xc340('0x34')](_0x281350[_0xc340('0x30')][_0xc340('0x34')]));_0x43e942[_0xc340('0x35')]=_0x43e942[_0xc340('0x35')]['length']?_0x43e942[_0xc340('0x35')]:_0x27ef3a[_0xc340('0x33')];if(!_0x281350[_0xc340('0x30')][_0xc340('0x36')]('nolimit')){_0x43e942[_0xc340('0x1d')]=qs[_0xc340('0x1d')](_0x281350[_0xc340('0x30')][_0xc340('0x1d')]);_0x43e942['offset']=qs[_0xc340('0x1b')](_0x281350[_0xc340('0x30')][_0xc340('0x1b')]);}_0x43e942[_0xc340('0x37')]=qs[_0xc340('0x38')](_0x281350['query'][_0xc340('0x38')]);delete _0x281350[_0xc340('0x30')][_0xc340('0x38')];_0x43e942['where']=qs['filters'](_[_0xc340('0x39')](_0x281350[_0xc340('0x30')],_0x27ef3a[_0xc340('0x31')]),_0x319b47);if(_0x281350[_0xc340('0x30')][_0xc340('0x3a')]){_0x43e942[_0xc340('0x3b')]=_['merge'](_0x43e942[_0xc340('0x3b')],{'$or':_[_0xc340('0x2f')](_0x319b47,function(_0x130c43){if(_0x130c43['type']!==_0xc340('0x3c')){var _0x430b3c={};_0x430b3c[_0x130c43[_0xc340('0x2a')]]={'$like':'%'+_0x281350[_0xc340('0x30')]['filter']+'%'};return _0x430b3c;}})});}_0x43e942=_[_0xc340('0x3d')]({},_0x43e942,_0x281350[_0xc340('0x3e')]);var _0x6447c5={'where':_0x43e942[_0xc340('0x3b')]};return db[_0xc340('0x2c')][_0xc340('0x1e')](_0x6447c5)[_0xc340('0x24')](function(_0x333f){_0x544863[_0xc340('0x1e')]=_0x333f;if(_0x281350['query'][_0xc340('0x3f')]){_0x43e942[_0xc340('0x40')]=[{'all':!![]}];}return db[_0xc340('0x2c')]['findAll'](_0x43e942);})[_0xc340('0x24')](function(_0x30d702){_0x544863['rows']=_0x30d702;return _0x544863;})[_0xc340('0x24')](respondWithFilteredResult(_0x5bed98,_0x43e942))[_0xc340('0x41')](handleError(_0x5bed98,null));};exports[_0xc340('0x42')]=function(_0x5009c2,_0x17ecef){var _0x19d520={'raw':![],'where':{'id':_0x5009c2['params']['id']}},_0x1d11fe={};_0x1d11fe[_0xc340('0x33')]=_[_0xc340('0x43')](db['VoiceMusicOnHold']['rawAttributes']);_0x1d11fe[_0xc340('0x30')]=_[_0xc340('0x43')](_0x5009c2[_0xc340('0x30')]);_0x1d11fe[_0xc340('0x31')]=_[_0xc340('0x32')](_0x1d11fe[_0xc340('0x33')],_0x1d11fe[_0xc340('0x30')]);_0x19d520[_0xc340('0x35')]=_[_0xc340('0x32')](_0x1d11fe[_0xc340('0x33')],qs['fields'](_0x5009c2['query'][_0xc340('0x34')]));_0x19d520[_0xc340('0x35')]=_0x19d520['attributes'][_0xc340('0x44')]?_0x19d520[_0xc340('0x35')]:_0x1d11fe[_0xc340('0x33')];if(_0x5009c2['query'][_0xc340('0x3f')]){_0x19d520[_0xc340('0x40')]=[{'all':!![]}];}_0x19d520=_['merge']({},_0x19d520,_0x5009c2['options']);return db[_0xc340('0x2c')][_0xc340('0x45')](_0x19d520)[_0xc340('0x24')](handleEntityNotFound(_0x17ecef,null))[_0xc340('0x24')](respondWithResult(_0x17ecef,null))['catch'](handleError(_0x17ecef,null));};exports[_0xc340('0x23')]=function(_0x3d3818,_0x5b8332){if(_0x3d3818[_0xc340('0x46')]['id']){delete _0x3d3818['body']['id'];}return db[_0xc340('0x2c')][_0xc340('0x45')]({'where':{'id':_0x3d3818['params']['id']}})[_0xc340('0x24')](handleEntityNotFound(_0x5b8332,null))[_0xc340('0x24')](saveUpdates(_0x3d3818[_0xc340('0x46')],null))[_0xc340('0x24')](respondWithResult(_0x5b8332,null))[_0xc340('0x41')](handleError(_0x5b8332,null));};exports[_0xc340('0x47')]=function(_0x4fae9e,_0x9d5450,_0x1eeb36){return db[_0xc340('0x48')][_0xc340('0x49')](function(_0x2748d0){if(_0x4fae9e[_0xc340('0x46')]['mode']===_0xc340('0x4a')){_0x4fae9e[_0xc340('0x46')]['directory']=path[_0xc340('0x4b')](config[_0xc340('0x4c')],_0xc340('0x4d'),_0x4fae9e[_0xc340('0x46')][_0xc340('0x2a')]);}return db[_0xc340('0x2c')][_0xc340('0x47')](_0x4fae9e[_0xc340('0x46')],{'transaction':_0x2748d0})[_0xc340('0x24')](function(_0x1a2d2d){if(_0x4fae9e[_0xc340('0x46')][_0xc340('0x4e')]===_0xc340('0x4a')){fs[_0xc340('0x4f')](_0x1a2d2d[_0xc340('0x50')],parseInt(_0xc340('0x51'),0x8));}var _0x180089=_0x4fae9e['user'][_0xc340('0x52')]({'plain':!![]});if(!_0x180089)throw new Error(_0xc340('0x53'));if(_0x180089[_0xc340('0x54')]==='user'){var _0x5e9852=_0x1a2d2d[_0xc340('0x52')]({'plain':!![]});return db[_0xc340('0x55')][_0xc340('0x45')]({'where':{'name':_0xc340('0x56'),'userProfileId':_0x180089[_0xc340('0x57')]},'raw':!![]})[_0xc340('0x24')](function(_0x18bcda){if(_0x18bcda&&_0x18bcda[_0xc340('0x58')]===0x0){return db[_0xc340('0x26')][_0xc340('0x47')]({'name':_0x5e9852[_0xc340('0x2a')],'resourceId':_0x5e9852['id'],'type':_0x18bcda[_0xc340('0x2a')],'sectionId':_0x18bcda['id']},{})[_0xc340('0x24')](function(){return _0x1a2d2d;});}else{return _0x1a2d2d;}})[_0xc340('0x41')](function(_0x257f96){logger[_0xc340('0x28')](_0xc340('0x59'),_0x257f96);});}return _0x1a2d2d;});})['then'](respondWithResult(_0x9d5450,0xc9))[_0xc340('0x41')](handleError(_0x9d5450,null));};exports[_0xc340('0x25')]=function(_0x46180d,_0x3b4c7e,_0x51c764){var _0x2ae3b6;return db['VoiceMusicOnHold'][_0xc340('0x45')]({'where':{'id':_0x46180d[_0xc340('0x5a')]['id']}})[_0xc340('0x24')](function(_0x2e2f5d){if(_0x2e2f5d){return db[_0xc340('0x48')][_0xc340('0x49')](function(_0x2cfbcc){return _0x2e2f5d[_0xc340('0x25')]({'transaction':_0x2cfbcc,'raw':!![]})[_0xc340('0x24')](function(_0x50805a){if(_0x50805a[_0xc340('0x50')]){fs[_0xc340('0x5b')](_0x50805a[_0xc340('0x50')])['forEach'](function(_0x24c16f){fs['unlinkSync'](path['join'](_0x50805a[_0xc340('0x50')],_0x24c16f));});fs['rmdirSync'](_0x50805a[_0xc340('0x50')]);}return _0x50805a;});})[_0xc340('0x41')](function(_0x2af166){throw new db[(_0xc340('0x5c'))][(_0xc340('0x5d'))](_0x2af166[_0xc340('0x5e')]);});}})[_0xc340('0x24')](handleEntityNotFound(_0x3b4c7e,null))[_0xc340('0x24')](removeEntity(_0x3b4c7e,null))['catch'](handleError(_0x3b4c7e,null));};exports[_0xc340('0x5f')]=function(_0x2d71ce,_0x4dc684,_0x11fceb){return db[_0xc340('0x48')][_0xc340('0x49')](function(_0x2cbad5){var _0x3ad240;return db['VoiceMusicOnHold'][_0xc340('0x45')]({'where':{'id':_0x2d71ce['params']['id']}})['then'](function(_0x5ded74){if(_0x5ded74){_0x3ad240=_0x5ded74;return _0x5ded74['addSound'](_0x2d71ce[_0xc340('0x46')]['id'],{'transaction':_0x2cbad5});}})[_0xc340('0x24')](function(_0x59a5f4){if(_0x59a5f4){return db['Sound'][_0xc340('0x60')]({'where':{'id':_0x2d71ce[_0xc340('0x46')]['id']},'attributes':['id',_0xc340('0x2a'),_0xc340('0x61'),_0xc340('0x62'),_0xc340('0x63')],'raw':!![]});}})['then'](function(_0x592dd7){if(_0x592dd7){var _0x34697b=path['join'](config['root'],_0xc340('0x64'),util[_0xc340('0x65')](_0xc340('0x66'),path[_0xc340('0x67')](_0x592dd7['save_name'],path[_0xc340('0x68')](_0x592dd7[_0xc340('0x61')])),_0x592dd7['converted_format']));var _0x1d1542=path[_0xc340('0x4b')](config[_0xc340('0x4c')],'server/files/moh',_0x3ad240[_0xc340('0x2a')],util[_0xc340('0x65')]('%s.%s',_0x592dd7[_0xc340('0x2a')],_0x592dd7[_0xc340('0x62')]));fs['symlinkSync'](_0x34697b,_0x1d1542);return _0x592dd7;}})['catch'](function(_0x3318bf){throw new db[(_0xc340('0x5c'))]['ValidationError'](_0x3318bf[_0xc340('0x5e')]);});})['then'](handleEntityNotFound(_0x4dc684,null))[_0xc340('0x24')](respondWithResult(_0x4dc684,0xc9))[_0xc340('0x41')](handleError(_0x4dc684,null));};exports[_0xc340('0x69')]=function(_0x10dcb1,_0xa89af1,_0x394f68){return db[_0xc340('0x48')][_0xc340('0x49')](function(_0xf32806){var _0x574c6e;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x10dcb1[_0xc340('0x5a')]['id']}})[_0xc340('0x24')](handleEntityNotFound(_0xa89af1,null))['then'](function(_0x195c88){if(_0x195c88){_0x574c6e=_0x195c88;return _0x195c88[_0xc340('0x69')](_0x10dcb1['params'][_0xc340('0x6a')]);}})[_0xc340('0x24')](function(_0x1397d5){if(_0x1397d5){return db[_0xc340('0x6b')][_0xc340('0x60')]({'where':{'id':_0x10dcb1[_0xc340('0x5a')][_0xc340('0x6a')]},'attributes':['id','name',_0xc340('0x61'),_0xc340('0x62'),_0xc340('0x63')],'raw':!![]});}})[_0xc340('0x24')](function(_0x5df925){if(_0x5df925){fs[_0xc340('0x6c')](path['join'](_0x574c6e['directory'],util['format'](_0xc340('0x66'),_0x5df925['name'],_0x5df925['converted_format'])));return _0x5df925;}})[_0xc340('0x41')](function(_0x1a71bd){throw new db['Sequelize'][(_0xc340('0x5d'))](_0x1a71bd[_0xc340('0x5e')]);});})[_0xc340('0x24')](handleEntityNotFound(_0xa89af1,null))[_0xc340('0x24')](respondWithStatusCode(_0xa89af1,0xcc))[_0xc340('0x41')](handleError(_0xa89af1,null));};exports[_0xc340('0x6d')]=function(_0x30286a,_0x1a3921,_0x1a2448){var _0x4a0801={};var _0x1bcaf3={};var _0x2d8d12;var _0xae417c;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x30286a['params']['id']}})['then'](handleEntityNotFound(_0x1a3921,null))['then'](function(_0x283828){if(_0x283828){_0x2d8d12=_0x283828;_0x1bcaf3[_0xc340('0x33')]=_[_0xc340('0x43')](db['Sound'][_0xc340('0x2d')]);_0x1bcaf3[_0xc340('0x30')]=_[_0xc340('0x43')](_0x30286a[_0xc340('0x30')]);_0x1bcaf3['filters']=_[_0xc340('0x32')](_0x1bcaf3[_0xc340('0x33')],_0x1bcaf3[_0xc340('0x30')]);_0x4a0801['attributes']=_[_0xc340('0x32')](_0x1bcaf3[_0xc340('0x33')],qs[_0xc340('0x34')](_0x30286a[_0xc340('0x30')][_0xc340('0x34')]));_0x4a0801['attributes']=_0x4a0801[_0xc340('0x35')]['length']?_0x4a0801[_0xc340('0x35')]:_0x1bcaf3[_0xc340('0x33')];_0x4a0801[_0xc340('0x37')]=qs[_0xc340('0x38')](_0x30286a[_0xc340('0x30')][_0xc340('0x38')]);_0x4a0801[_0xc340('0x3b')]=qs['filters'](_[_0xc340('0x39')](_0x30286a[_0xc340('0x30')],_0x1bcaf3[_0xc340('0x31')]));if(_0x30286a[_0xc340('0x30')]['filter']){_0x4a0801['where']=_[_0xc340('0x3d')](_0x4a0801['where'],{'$or':_['map'](_0x4a0801['attributes'],function(_0x3a81f7){var _0x170957={};_0x170957[_0x3a81f7]={'$like':'%'+_0x30286a[_0xc340('0x30')][_0xc340('0x3a')]+'%'};return _0x170957;})});}_0x4a0801=_[_0xc340('0x3d')]({},_0x4a0801,_0x30286a['options']);return _0x2d8d12['getSounds'](_0x4a0801);}})[_0xc340('0x24')](function(_0x4a526c){if(_0x4a526c){_0xae417c=_0x4a526c[_0xc340('0x44')];if(!_0x30286a[_0xc340('0x30')]['hasOwnProperty'](_0xc340('0x6e'))){_0x4a0801[_0xc340('0x1d')]=qs['limit'](_0x30286a[_0xc340('0x30')][_0xc340('0x1d')]);_0x4a0801[_0xc340('0x1b')]=qs[_0xc340('0x1b')](_0x30286a[_0xc340('0x30')][_0xc340('0x1b')]);}return _0x2d8d12[_0xc340('0x6d')](_0x4a0801);}})[_0xc340('0x24')](function(_0x682a0b){if(_0x682a0b){return _0x682a0b?{'count':_0xae417c,'rows':_0x682a0b}:null;}})[_0xc340('0x24')](respondWithResult(_0x1a3921,null))[_0xc340('0x41')](handleError(_0x1a3921,null));}; \ No newline at end of file +var _0x5572=['then','get','MusicOnHolds','UserProfileResource','name','send','map','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','catch','find','params','create','sequelize','transaction','body','mode','files','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','sort','nolimit','getSounds','eml-format','rimraf','zip-dir','bluebird','path','sox','fs-extra','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','reject','update','destroy'];(function(_0x2f5e86,_0x358bcd){var _0x44f1e6=function(_0x15c37c){while(--_0x15c37c){_0x2f5e86['push'](_0x2f5e86['shift']());}};_0x44f1e6(++_0x358bcd);}(_0x5572,0x195));var _0x2557=function(_0xa93b42,_0x2fe981){_0xa93b42=_0xa93b42-0x0;var _0x1befd5=_0x5572[_0xa93b42];return _0x1befd5;};'use strict';var emlformat=require(_0x2557('0x0'));var rimraf=require(_0x2557('0x1'));var zipdir=require(_0x2557('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2557('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2557('0x4'));var sox=require(_0x2557('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2557('0x6'));var _=require('lodash');var squel=require(_0x2557('0x7'));var crypto=require(_0x2557('0x8'));var jsforce=require(_0x2557('0x9'));var deskjs=require(_0x2557('0xa'));var toCsv=require(_0x2557('0xb'));var querystring=require('querystring');var Papa=require(_0x2557('0xc'));var Redis=require(_0x2557('0xd'));var authService=require(_0x2557('0xe'));var qs=require(_0x2557('0xf'));var as=require(_0x2557('0x10'));var hardwareService=require(_0x2557('0x11'));var logger=require(_0x2557('0x12'))(_0x2557('0x13'));var utils=require(_0x2557('0x14'));var config=require(_0x2557('0x15'));var licenseUtil=require(_0x2557('0x16'));var db=require(_0x2557('0x17'))['db'];function respondWithStatusCode(_0x40651e,_0x2ef0f1){_0x2ef0f1=_0x2ef0f1||0xcc;return function(_0x3f99fe){if(_0x3f99fe){return _0x40651e[_0x2557('0x18')](_0x2ef0f1);}return _0x40651e[_0x2557('0x19')](_0x2ef0f1)[_0x2557('0x1a')]();};}function respondWithResult(_0x378206,_0x1c17ee){_0x1c17ee=_0x1c17ee||0xc8;return function(_0x52c0bf){if(_0x52c0bf){return _0x378206['status'](_0x1c17ee)['json'](_0x52c0bf);}};}function respondWithFilteredResult(_0x23ae55,_0x44324f){return function(_0x3b0ad9){if(_0x3b0ad9){var _0x4c24c3=typeof _0x44324f['offset']===_0x2557('0x1b')&&typeof _0x44324f[_0x2557('0x1c')]==='undefined';var _0x33943a=_0x3b0ad9[_0x2557('0x1d')];var _0x3abdc7=_0x4c24c3?0x0:_0x44324f[_0x2557('0x1e')];var _0x40e1ab=_0x4c24c3?_0x3b0ad9[_0x2557('0x1d')]:_0x44324f[_0x2557('0x1e')]+_0x44324f[_0x2557('0x1c')];var _0x42fdfe;if(_0x40e1ab>=_0x33943a){_0x40e1ab=_0x33943a;_0x42fdfe=0xc8;}else{_0x42fdfe=0xce;}_0x23ae55[_0x2557('0x19')](_0x42fdfe);return _0x23ae55[_0x2557('0x1f')]('Content-Range',_0x3abdc7+'-'+_0x40e1ab+'/'+_0x33943a)['json'](_0x3b0ad9);}return null;};}function patchUpdates(_0x4522db){return function(_0x5e9287){try{jsonpatch['apply'](_0x5e9287,_0x4522db,!![]);}catch(_0x1a19ce){return BPromise[_0x2557('0x20')](_0x1a19ce);}return _0x5e9287['save']();};}function saveUpdates(_0x56f346,_0x1d11b3){return function(_0x14f129){if(_0x14f129){return _0x14f129[_0x2557('0x21')](_0x56f346)['then'](function(_0x20c5f5){return _0x20c5f5;});}return null;};}function removeEntity(_0x260a21,_0x304f4f){return function(_0x5440d0){if(_0x5440d0){return _0x5440d0[_0x2557('0x22')]()[_0x2557('0x23')](function(){var _0x4d85c4=_0x5440d0[_0x2557('0x24')]({'plain':!![]});var _0x5d4cc2=_0x2557('0x25');return db[_0x2557('0x26')][_0x2557('0x22')]({'where':{'type':_0x5d4cc2,'resourceId':_0x4d85c4['id']}})[_0x2557('0x23')](function(){return _0x5440d0;});})[_0x2557('0x23')](function(){_0x260a21[_0x2557('0x19')](0xcc)[_0x2557('0x1a')]();});}};}function handleEntityNotFound(_0x3ca017,_0x66756c){return function(_0x4d5969){if(!_0x4d5969){_0x3ca017['sendStatus'](0x194);}return _0x4d5969;};}function handleError(_0x4f9485,_0x3271f1){_0x3271f1=_0x3271f1||0x1f4;return function(_0x523684){logger['error'](_0x523684['stack']);if(_0x523684['name']){delete _0x523684[_0x2557('0x27')];}_0x4f9485[_0x2557('0x19')](_0x3271f1)[_0x2557('0x28')](_0x523684);};}exports['index']=function(_0x5a6e32,_0x5f39a7){var _0x377d3d={},_0x4c5bd7={},_0x7d5827={'count':0x0,'rows':[]};var _0x1cba6e=_[_0x2557('0x29')](db['VoiceMusicOnHold'][_0x2557('0x2a')],function(_0x382455){return{'name':_0x382455[_0x2557('0x2b')],'type':_0x382455[_0x2557('0x2c')][_0x2557('0x2d')]};});_0x4c5bd7['model']=_[_0x2557('0x29')](_0x1cba6e,_0x2557('0x27'));_0x4c5bd7[_0x2557('0x2e')]=_[_0x2557('0x2f')](_0x5a6e32[_0x2557('0x2e')]);_0x4c5bd7['filters']=_['intersection'](_0x4c5bd7[_0x2557('0x30')],_0x4c5bd7[_0x2557('0x2e')]);_0x377d3d['attributes']=_[_0x2557('0x31')](_0x4c5bd7[_0x2557('0x30')],qs[_0x2557('0x32')](_0x5a6e32[_0x2557('0x2e')]['fields']));_0x377d3d[_0x2557('0x33')]=_0x377d3d[_0x2557('0x33')][_0x2557('0x34')]?_0x377d3d[_0x2557('0x33')]:_0x4c5bd7[_0x2557('0x30')];if(!_0x5a6e32[_0x2557('0x2e')][_0x2557('0x35')]('nolimit')){_0x377d3d[_0x2557('0x1c')]=qs[_0x2557('0x1c')](_0x5a6e32[_0x2557('0x2e')][_0x2557('0x1c')]);_0x377d3d['offset']=qs[_0x2557('0x1e')](_0x5a6e32[_0x2557('0x2e')][_0x2557('0x1e')]);}_0x377d3d[_0x2557('0x36')]=qs['sort'](_0x5a6e32[_0x2557('0x2e')]['sort']);delete _0x5a6e32[_0x2557('0x2e')]['sort'];_0x377d3d[_0x2557('0x37')]=qs[_0x2557('0x38')](_[_0x2557('0x39')](_0x5a6e32['query'],_0x4c5bd7[_0x2557('0x38')]),_0x1cba6e);if(_0x5a6e32[_0x2557('0x2e')][_0x2557('0x3a')]){_0x377d3d[_0x2557('0x37')]=_[_0x2557('0x3b')](_0x377d3d['where'],{'$or':_[_0x2557('0x29')](_0x1cba6e,function(_0x10b9d5){if(_0x10b9d5[_0x2557('0x2c')]!==_0x2557('0x3c')){var _0x25d98e={};_0x25d98e[_0x10b9d5['name']]={'$like':'%'+_0x5a6e32[_0x2557('0x2e')][_0x2557('0x3a')]+'%'};return _0x25d98e;}})});}_0x377d3d=_['merge']({},_0x377d3d,_0x5a6e32[_0x2557('0x3d')]);var _0x3fd17b={'where':_0x377d3d[_0x2557('0x37')]};return db['VoiceMusicOnHold']['count'](_0x3fd17b)[_0x2557('0x23')](function(_0x49944f){_0x7d5827[_0x2557('0x1d')]=_0x49944f;if(_0x5a6e32[_0x2557('0x2e')][_0x2557('0x3e')]){_0x377d3d[_0x2557('0x3f')]=[{'all':!![]}];}return db[_0x2557('0x40')][_0x2557('0x41')](_0x377d3d);})['then'](function(_0x53c645){_0x7d5827['rows']=_0x53c645;return _0x7d5827;})[_0x2557('0x23')](respondWithFilteredResult(_0x5f39a7,_0x377d3d))[_0x2557('0x42')](handleError(_0x5f39a7,null));};exports['show']=function(_0x7f2e11,_0x33da00){var _0x3695d4={'raw':![],'where':{'id':_0x7f2e11['params']['id']}},_0x21ee77={};_0x21ee77[_0x2557('0x30')]=_['keys'](db[_0x2557('0x40')]['rawAttributes']);_0x21ee77[_0x2557('0x2e')]=_['keys'](_0x7f2e11[_0x2557('0x2e')]);_0x21ee77[_0x2557('0x38')]=_[_0x2557('0x31')](_0x21ee77[_0x2557('0x30')],_0x21ee77['query']);_0x3695d4[_0x2557('0x33')]=_['intersection'](_0x21ee77['model'],qs['fields'](_0x7f2e11['query'][_0x2557('0x32')]));_0x3695d4[_0x2557('0x33')]=_0x3695d4[_0x2557('0x33')]['length']?_0x3695d4['attributes']:_0x21ee77[_0x2557('0x30')];if(_0x7f2e11[_0x2557('0x2e')][_0x2557('0x3e')]){_0x3695d4[_0x2557('0x3f')]=[{'all':!![]}];}_0x3695d4=_[_0x2557('0x3b')]({},_0x3695d4,_0x7f2e11[_0x2557('0x3d')]);return db['VoiceMusicOnHold'][_0x2557('0x43')](_0x3695d4)['then'](handleEntityNotFound(_0x33da00,null))[_0x2557('0x23')](respondWithResult(_0x33da00,null))['catch'](handleError(_0x33da00,null));};exports[_0x2557('0x21')]=function(_0x5cd5d7,_0x36005a){if(_0x5cd5d7['body']['id']){delete _0x5cd5d7['body']['id'];}return db[_0x2557('0x40')]['find']({'where':{'id':_0x5cd5d7[_0x2557('0x44')]['id']}})[_0x2557('0x23')](handleEntityNotFound(_0x36005a,null))[_0x2557('0x23')](saveUpdates(_0x5cd5d7['body'],null))['then'](respondWithResult(_0x36005a,null))[_0x2557('0x42')](handleError(_0x36005a,null));};exports[_0x2557('0x45')]=function(_0x44903f,_0x8b26d3,_0x15ceb5){return db[_0x2557('0x46')][_0x2557('0x47')](function(_0x167703){if(_0x44903f[_0x2557('0x48')][_0x2557('0x49')]===_0x2557('0x4a')){_0x44903f[_0x2557('0x48')][_0x2557('0x4b')]=path[_0x2557('0x4c')](config[_0x2557('0x4d')],'server/files/moh',_0x44903f[_0x2557('0x48')][_0x2557('0x27')]);}return db['VoiceMusicOnHold'][_0x2557('0x45')](_0x44903f[_0x2557('0x48')],{'transaction':_0x167703})[_0x2557('0x23')](function(_0x2a4286){if(_0x44903f[_0x2557('0x48')][_0x2557('0x49')]===_0x2557('0x4a')){fs[_0x2557('0x4e')](_0x2a4286[_0x2557('0x4b')],parseInt(_0x2557('0x4f'),0x8));}var _0x1b402f=_0x44903f[_0x2557('0x50')]['get']({'plain':!![]});if(!_0x1b402f)throw new Error(_0x2557('0x51'));if(_0x1b402f[_0x2557('0x52')]===_0x2557('0x50')){var _0x505a0c=_0x2a4286['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x2557('0x25'),'userProfileId':_0x1b402f[_0x2557('0x53')]},'raw':!![]})['then'](function(_0x1c101a){if(_0x1c101a&&_0x1c101a[_0x2557('0x54')]===0x0){return db[_0x2557('0x26')][_0x2557('0x45')]({'name':_0x505a0c['name'],'resourceId':_0x505a0c['id'],'type':_0x1c101a[_0x2557('0x27')],'sectionId':_0x1c101a['id']},{})['then'](function(){return _0x2a4286;});}else{return _0x2a4286;}})['catch'](function(_0x39ae80){logger[_0x2557('0x55')](_0x2557('0x56'),_0x39ae80);});}return _0x2a4286;});})[_0x2557('0x23')](respondWithResult(_0x8b26d3,0xc9))['catch'](handleError(_0x8b26d3,null));};exports[_0x2557('0x22')]=function(_0x242592,_0x274705,_0x332cbc){var _0x164a53;return db[_0x2557('0x40')][_0x2557('0x43')]({'where':{'id':_0x242592['params']['id']}})[_0x2557('0x23')](function(_0x29c688){if(_0x29c688){return db[_0x2557('0x46')]['transaction'](function(_0x354fa2){return _0x29c688[_0x2557('0x22')]({'transaction':_0x354fa2,'raw':!![]})[_0x2557('0x23')](function(_0x5b8998){if(_0x5b8998['directory']){fs[_0x2557('0x57')](_0x5b8998[_0x2557('0x4b')])[_0x2557('0x58')](function(_0xe5688c){fs[_0x2557('0x59')](path[_0x2557('0x4c')](_0x5b8998[_0x2557('0x4b')],_0xe5688c));});fs['rmdirSync'](_0x5b8998[_0x2557('0x4b')]);}return _0x5b8998;});})['catch'](function(_0x2b59ff){throw new db[(_0x2557('0x5a'))][(_0x2557('0x5b'))](_0x2b59ff[_0x2557('0x5c')]);});}})['then'](handleEntityNotFound(_0x274705,null))['then'](removeEntity(_0x274705,null))[_0x2557('0x42')](handleError(_0x274705,null));};exports['addSound']=function(_0x67ad85,_0x412bac,_0x4e00c4){return db['sequelize'][_0x2557('0x47')](function(_0x4333e2){var _0x4330c9;return db[_0x2557('0x40')]['find']({'where':{'id':_0x67ad85[_0x2557('0x44')]['id']}})[_0x2557('0x23')](function(_0x24d7ca){if(_0x24d7ca){_0x4330c9=_0x24d7ca;return _0x24d7ca[_0x2557('0x5d')](_0x67ad85[_0x2557('0x48')]['id'],{'transaction':_0x4333e2});}})[_0x2557('0x23')](function(_0x5bf60){if(_0x5bf60){return db[_0x2557('0x5e')][_0x2557('0x5f')]({'where':{'id':_0x67ad85[_0x2557('0x48')]['id']},'attributes':['id','name',_0x2557('0x60'),_0x2557('0x61'),_0x2557('0x62')],'raw':!![]});}})['then'](function(_0x4b6379){if(_0x4b6379){var _0x414997=path[_0x2557('0x4c')](config[_0x2557('0x4d')],_0x2557('0x63'),util[_0x2557('0x64')](_0x2557('0x65'),path[_0x2557('0x66')](_0x4b6379[_0x2557('0x60')],path[_0x2557('0x67')](_0x4b6379[_0x2557('0x60')])),_0x4b6379['converted_format']));var _0x197bf6=path[_0x2557('0x4c')](config[_0x2557('0x4d')],_0x2557('0x68'),_0x4330c9[_0x2557('0x27')],util[_0x2557('0x64')](_0x2557('0x65'),_0x4b6379['name'],_0x4b6379['converted_format']));fs[_0x2557('0x69')](_0x414997,_0x197bf6);return _0x4b6379;}})['catch'](function(_0x41405c){throw new db[(_0x2557('0x5a'))][(_0x2557('0x5b'))](_0x41405c[_0x2557('0x5c')]);});})[_0x2557('0x23')](handleEntityNotFound(_0x412bac,null))[_0x2557('0x23')](respondWithResult(_0x412bac,0xc9))[_0x2557('0x42')](handleError(_0x412bac,null));};exports['removeSound']=function(_0x562a9b,_0x34562e,_0x1aec34){return db[_0x2557('0x46')][_0x2557('0x47')](function(_0x180239){var _0x99f48b;return db[_0x2557('0x40')]['findOne']({'where':{'id':_0x562a9b[_0x2557('0x44')]['id']}})[_0x2557('0x23')](handleEntityNotFound(_0x34562e,null))['then'](function(_0x155222){if(_0x155222){_0x99f48b=_0x155222;return _0x155222[_0x2557('0x6a')](_0x562a9b[_0x2557('0x44')]['id2']);}})[_0x2557('0x23')](function(_0x2c9613){if(_0x2c9613){return db[_0x2557('0x5e')][_0x2557('0x5f')]({'where':{'id':_0x562a9b['params']['id2']},'attributes':['id',_0x2557('0x27'),_0x2557('0x60'),_0x2557('0x61'),_0x2557('0x62')],'raw':!![]});}})[_0x2557('0x23')](function(_0x4909d9){if(_0x4909d9){fs[_0x2557('0x59')](path['join'](_0x99f48b[_0x2557('0x4b')],util['format']('%s.%s',_0x4909d9[_0x2557('0x27')],_0x4909d9['converted_format'])));return _0x4909d9;}})['catch'](function(_0x1c0ecb){throw new db[(_0x2557('0x5a'))][(_0x2557('0x5b'))](_0x1c0ecb['message']);});})['then'](handleEntityNotFound(_0x34562e,null))[_0x2557('0x23')](respondWithStatusCode(_0x34562e,0xcc))[_0x2557('0x42')](handleError(_0x34562e,null));};exports['getSounds']=function(_0x2a3347,_0x414473,_0x1435c8){var _0x5aefb0={};var _0x42c9cb={};var _0x1ea017;var _0x1f319f;return db[_0x2557('0x40')]['findOne']({'where':{'id':_0x2a3347[_0x2557('0x44')]['id']}})[_0x2557('0x23')](handleEntityNotFound(_0x414473,null))[_0x2557('0x23')](function(_0x3d370d){if(_0x3d370d){_0x1ea017=_0x3d370d;_0x42c9cb[_0x2557('0x30')]=_['keys'](db[_0x2557('0x5e')][_0x2557('0x2a')]);_0x42c9cb[_0x2557('0x2e')]=_['keys'](_0x2a3347[_0x2557('0x2e')]);_0x42c9cb[_0x2557('0x38')]=_[_0x2557('0x31')](_0x42c9cb[_0x2557('0x30')],_0x42c9cb[_0x2557('0x2e')]);_0x5aefb0[_0x2557('0x33')]=_[_0x2557('0x31')](_0x42c9cb[_0x2557('0x30')],qs[_0x2557('0x32')](_0x2a3347[_0x2557('0x2e')][_0x2557('0x32')]));_0x5aefb0[_0x2557('0x33')]=_0x5aefb0[_0x2557('0x33')][_0x2557('0x34')]?_0x5aefb0[_0x2557('0x33')]:_0x42c9cb[_0x2557('0x30')];_0x5aefb0[_0x2557('0x36')]=qs[_0x2557('0x6b')](_0x2a3347[_0x2557('0x2e')]['sort']);_0x5aefb0[_0x2557('0x37')]=qs[_0x2557('0x38')](_[_0x2557('0x39')](_0x2a3347[_0x2557('0x2e')],_0x42c9cb['filters']));if(_0x2a3347[_0x2557('0x2e')][_0x2557('0x3a')]){_0x5aefb0[_0x2557('0x37')]=_[_0x2557('0x3b')](_0x5aefb0['where'],{'$or':_[_0x2557('0x29')](_0x5aefb0[_0x2557('0x33')],function(_0x48a952){var _0xa719d9={};_0xa719d9[_0x48a952]={'$like':'%'+_0x2a3347[_0x2557('0x2e')][_0x2557('0x3a')]+'%'};return _0xa719d9;})});}_0x5aefb0=_['merge']({},_0x5aefb0,_0x2a3347[_0x2557('0x3d')]);return _0x1ea017['getSounds'](_0x5aefb0);}})[_0x2557('0x23')](function(_0x267586){if(_0x267586){_0x1f319f=_0x267586[_0x2557('0x34')];if(!_0x2a3347[_0x2557('0x2e')]['hasOwnProperty'](_0x2557('0x6c'))){_0x5aefb0[_0x2557('0x1c')]=qs[_0x2557('0x1c')](_0x2a3347[_0x2557('0x2e')]['limit']);_0x5aefb0[_0x2557('0x1e')]=qs[_0x2557('0x1e')](_0x2a3347['query'][_0x2557('0x1e')]);}return _0x1ea017[_0x2557('0x6d')](_0x5aefb0);}})['then'](function(_0x3feebb){if(_0x3feebb){return _0x3feebb?{'count':_0x1f319f,'rows':_0x3feebb}:null;}})[_0x2557('0x23')](respondWithResult(_0x414473,null))[_0x2557('0x42')](handleError(_0x414473,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 2b50843..4df94f8 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 _0xb9c7=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb9c7,0x140));var _0x7b9c=function(_0x3e8a37,_0x37ffbe){_0x3e8a37=_0x3e8a37-0x0;var _0x4de8f1=_0xb9c7[_0x3e8a37];return _0x4de8f1;};'use strict';var _=require(_0x7b9c('0x0'));var util=require('util');var logger=require(_0x7b9c('0x1'))(_0x7b9c('0x2'));var moment=require(_0x7b9c('0x3'));var BPromise=require(_0x7b9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b9c('0x5'));var rimraf=require(_0x7b9c('0x6'));var config=require(_0x7b9c('0x7'));var attributes=require(_0x7b9c('0x8'));module[_0x7b9c('0x9')]=function(_0x255613,_0x323bf5){return _0x255613[_0x7b9c('0xa')](_0x7b9c('0xb'),attributes,{'tableName':_0x7b9c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6170=['voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x6170,0x1d5));var _0x0617=function(_0x56cc34,_0x26905e){_0x56cc34=_0x56cc34-0x0;var _0x449981=_0x6170[_0x56cc34];return _0x449981;};'use strict';var _=require(_0x0617('0x0'));var util=require('util');var logger=require(_0x0617('0x1'))(_0x0617('0x2'));var moment=require(_0x0617('0x3'));var BPromise=require(_0x0617('0x4'));var rp=require(_0x0617('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0617('0x6'));var config=require(_0x0617('0x7'));var attributes=require(_0x0617('0x8'));module[_0x0617('0x9')]=function(_0x43c2bb,_0x2f0638){return _0x43c2bb[_0x0617('0xa')](_0x0617('0xb'),attributes,{'tableName':_0x0617('0xc'),'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 d8bb833..f04c320 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(_0xc132e4,_0x1bd4ed){var _0x1e9186=function(_0x280a15){while(--_0x280a15){_0xc132e4['push'](_0xc132e4['shift']());}};_0x1e9186(++_0x1bd4ed);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e0000,_0x4e491a){_0x4e0000=_0x4e0000-0x0;var _0x52c3f1=_0xedd9[_0x4e0000];return _0x52c3f1;};'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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x288742,_0x655a1b){var _0x243f16=function(_0x132e58){while(--_0x132e58){_0x288742['push'](_0x288742['shift']());}};_0x243f16(++_0x655a1b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0xcb91[_0x3cec8c];return _0x38032e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 5479bd8..d0ed16b 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 _0xe5d5=['index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','post','/:id/teams','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x3ea595,_0x443025){var _0x5d30ff=function(_0x1f560e){while(--_0x1f560e){_0x3ea595['push'](_0x3ea595['shift']());}};_0x5d30ff(++_0x443025);}(_0xe5d5,0x156));var _0x5e5d=function(_0x340ff6,_0x525d55){_0x340ff6=_0x340ff6-0x0;var _0x313a4e=_0xe5d5[_0x340ff6];return _0x313a4e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e5d('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e5d('0x1'));var router=express['Router']();var fs_extra=require(_0x5e5d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5d('0x3'));var config=require(_0x5e5d('0x4'));var controller=require(_0x5e5d('0x5'));router[_0x5e5d('0x6')]('/',auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x8')]);router[_0x5e5d('0x6')](_0x5e5d('0x9'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xa')]);router[_0x5e5d('0x6')](_0x5e5d('0xb'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xc')]);router['get'](_0x5e5d('0xd'),auth['isAuthenticated'](),controller[_0x5e5d('0xe')]);router[_0x5e5d('0x6')]('/:id/teams',auth[_0x5e5d('0x7')](),controller[_0x5e5d('0xf')]);router[_0x5e5d('0x10')]('/',auth[_0x5e5d('0x7')](),controller['create']);router['post'](_0x5e5d('0xd'),auth[_0x5e5d('0x7')](),controller['addAgents']);router[_0x5e5d('0x10')](_0x5e5d('0x11'),auth['isAuthenticated'](),controller[_0x5e5d('0x12')]);router[_0x5e5d('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x5e5d('0x14')](_0x5e5d('0xb'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x15')]);router['delete'](_0x5e5d('0xd'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x16')]);router[_0x5e5d('0x14')](_0x5e5d('0x11'),auth[_0x5e5d('0x7')](),controller[_0x5e5d('0x17')]);module[_0x5e5d('0x18')]=router; \ No newline at end of file +var _0x385b=['isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','put','delete','removeAgents','removeTeams','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x597412,_0x5bc195){var _0xfc3cef=function(_0x1c8a6e){while(--_0x1c8a6e){_0x597412['push'](_0x597412['shift']());}};_0xfc3cef(++_0x5bc195);}(_0x385b,0x1a7));var _0xb385=function(_0xb80ee3,_0x4d9bc3){_0xb80ee3=_0xb80ee3-0x0;var _0x34720a=_0x385b[_0xb80ee3];return _0x34720a;};'use strict';var multer=require('multer');var util=require(_0xb385('0x0'));var path=require('path');var timeout=require(_0xb385('0x1'));var express=require(_0xb385('0x2'));var router=express[_0xb385('0x3')]();var fs_extra=require(_0xb385('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb385('0x5'));var config=require(_0xb385('0x6'));var controller=require(_0xb385('0x7'));router[_0xb385('0x8')]('/',auth[_0xb385('0x9')](),controller[_0xb385('0xa')]);router[_0xb385('0x8')](_0xb385('0xb'),auth['isAuthenticated'](),controller[_0xb385('0xc')]);router[_0xb385('0x8')](_0xb385('0xd'),auth[_0xb385('0x9')](),controller['show']);router[_0xb385('0x8')](_0xb385('0xe'),auth['isAuthenticated'](),controller[_0xb385('0xf')]);router[_0xb385('0x8')](_0xb385('0x10'),auth[_0xb385('0x9')](),controller[_0xb385('0x11')]);router[_0xb385('0x12')]('/',auth['isAuthenticated'](),controller[_0xb385('0x13')]);router['post']('/:id/users',auth[_0xb385('0x9')](),controller['addAgents']);router[_0xb385('0x12')](_0xb385('0x10'),auth[_0xb385('0x9')](),controller['addTeams']);router[_0xb385('0x14')](_0xb385('0xd'),auth[_0xb385('0x9')](),controller['update']);router[_0xb385('0x15')](_0xb385('0xd'),auth[_0xb385('0x9')](),controller['destroy']);router[_0xb385('0x15')](_0xb385('0xe'),auth[_0xb385('0x9')](),controller[_0xb385('0x16')]);router[_0xb385('0x15')](_0xb385('0x10'),auth[_0xb385('0x9')](),controller[_0xb385('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 85df999..6788ee2 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 _0xbcb2=['VIRTUAL','system-','STRING','INTEGER','sequelize','exports','name'];(function(_0xa58f19,_0x401b31){var _0x272c68=function(_0x4af47d){while(--_0x4af47d){_0xa58f19['push'](_0xa58f19['shift']());}};_0x272c68(++_0x401b31);}(_0xbcb2,0x17e));var _0x2bcb=function(_0x53774d,_0x4b1229){_0x53774d=_0x53774d-0x0;var _0x20ef70=_0xbcb2[_0x53774d];return _0x20ef70;};'use strict';var Sequelize=require(_0x2bcb('0x0'));module[_0x2bcb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2bcb('0x2')},'prefix':{'type':Sequelize[_0x2bcb('0x3')],'get':function(_0x4ed1d2){return _0x2bcb('0x4')+this['getDataValue'](_0x2bcb('0x2'))+'-';}},'description':{'type':Sequelize[_0x2bcb('0x5')]},'callerIdAll':{'type':Sequelize[_0x2bcb('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x2bcb('0x6')]}}; \ No newline at end of file +var _0x119c=['INTEGER','exports','STRING','system-','getDataValue'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x119c,0x15a));var _0xc119=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x119c[_0x2932cf];return _0x1711dd;};'use strict';var Sequelize=require('sequelize');module[_0xc119('0x0')]={'name':{'type':Sequelize[_0xc119('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2d9ed9){return _0xc119('0x2')+this[_0xc119('0x3')]('name')+'-';}},'description':{'type':Sequelize[_0xc119('0x1')]},'callerIdAll':{'type':Sequelize[_0xc119('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xc119('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6460862..a30b592 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 _0xb62e=['all','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','system-','transaction','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','addTeams','Agents','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','SELECT','every','TeamId','includes'];(function(_0x51318c,_0x839354){var _0x52d589=function(_0x3997f9){while(--_0x3997f9){_0x51318c['push'](_0x51318c['shift']());}};_0x52d589(++_0x839354);}(_0xb62e,0x1de));var _0xeb62=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb62e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xeb62('0x0'));var rimraf=require(_0xeb62('0x1'));var zipdir=require(_0xeb62('0x2'));var jsonpatch=require(_0xeb62('0x3'));var rp=require('request-promise');var moment=require(_0xeb62('0x4'));var BPromise=require(_0xeb62('0x5'));var Mustache=require(_0xeb62('0x6'));var util=require(_0xeb62('0x7'));var path=require(_0xeb62('0x8'));var sox=require(_0xeb62('0x9'));var csv=require('to-csv');var ejs=require(_0xeb62('0xa'));var fs=require('fs');var fs_extra=require(_0xeb62('0xb'));var _=require(_0xeb62('0xc'));var squel=require('squel');var crypto=require(_0xeb62('0xd'));var jsforce=require(_0xeb62('0xe'));var deskjs=require(_0xeb62('0xf'));var toCsv=require(_0xeb62('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xeb62('0x11'));var authService=require(_0xeb62('0x12'));var qs=require(_0xeb62('0x13'));var as=require(_0xeb62('0x14'));var hardwareService=require(_0xeb62('0x15'));var logger=require(_0xeb62('0x16'))(_0xeb62('0x17'));var utils=require(_0xeb62('0x18'));var config=require(_0xeb62('0x19'));var licenseUtil=require(_0xeb62('0x1a'));var db=require('../../mysqldb')['db'];config[_0xeb62('0x1b')]=_[_0xeb62('0x1c')](config[_0xeb62('0x1b')],{'host':_0xeb62('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb62('0x1b')]));require(_0xeb62('0x1e'))[_0xeb62('0x1f')](socket);function respondWithStatusCode(_0x4da178,_0x26c3fd){_0x26c3fd=_0x26c3fd||0xcc;return function(_0x195837){if(_0x195837){return _0x4da178[_0xeb62('0x20')](_0x26c3fd);}return _0x4da178['status'](_0x26c3fd)[_0xeb62('0x21')]();};}function respondWithResult(_0x15b3e8,_0x184106){_0x184106=_0x184106||0xc8;return function(_0x353e2c){if(_0x353e2c){return _0x15b3e8[_0xeb62('0x22')](_0x184106)[_0xeb62('0x23')](_0x353e2c);}};}function respondWithFilteredResult(_0x1fb460,_0x1324d7){return function(_0x39b138){if(_0x39b138){var _0x27fd84=typeof _0x1324d7[_0xeb62('0x24')]===_0xeb62('0x25')&&typeof _0x1324d7[_0xeb62('0x26')]==='undefined';var _0x38c5e4=_0x39b138[_0xeb62('0x27')];var _0x332396=_0x27fd84?0x0:_0x1324d7[_0xeb62('0x24')];var _0x425817=_0x27fd84?_0x39b138[_0xeb62('0x27')]:_0x1324d7[_0xeb62('0x24')]+_0x1324d7['limit'];var _0x599d0b;if(_0x425817>=_0x38c5e4){_0x425817=_0x38c5e4;_0x599d0b=0xc8;}else{_0x599d0b=0xce;}_0x1fb460[_0xeb62('0x22')](_0x599d0b);return _0x1fb460[_0xeb62('0x28')](_0xeb62('0x29'),_0x332396+'-'+_0x425817+'/'+_0x38c5e4)[_0xeb62('0x23')](_0x39b138);}return null;};}function patchUpdates(_0x122b15){return function(_0x4cafcf){try{jsonpatch['apply'](_0x4cafcf,_0x122b15,!![]);}catch(_0x4664ce){return BPromise[_0xeb62('0x2a')](_0x4664ce);}return _0x4cafcf[_0xeb62('0x2b')]();};}function saveUpdates(_0x395b70,_0x55a169){return function(_0x4e92f5){if(_0x4e92f5){return _0x4e92f5[_0xeb62('0x2c')](_0x395b70)['then'](function(_0x448327){return _0x448327;});}return null;};}function removeEntity(_0x4b0f46,_0xfe3e16){return function(_0x516a72){if(_0x516a72){return _0x516a72[_0xeb62('0x2d')]()[_0xeb62('0x2e')](function(){var _0x46d1bb=_0x516a72['get']({'plain':!![]});var _0x3ef784=_0xeb62('0x2f');return db[_0xeb62('0x30')][_0xeb62('0x2d')]({'where':{'type':_0x3ef784,'resourceId':_0x46d1bb['id']}})[_0xeb62('0x2e')](function(){return _0x516a72;});})[_0xeb62('0x2e')](function(){_0x4b0f46['status'](0xcc)[_0xeb62('0x21')]();});}};}function handleEntityNotFound(_0x1616ee,_0x57169a){return function(_0x157474){if(!_0x157474){_0x1616ee[_0xeb62('0x20')](0x194);}return _0x157474;};}function handleError(_0x2c967c,_0x2c308c){_0x2c308c=_0x2c308c||0x1f4;return function(_0x235448){logger['error'](_0x235448['stack']);if(_0x235448[_0xeb62('0x31')]){delete _0x235448[_0xeb62('0x31')];}_0x2c967c[_0xeb62('0x22')](_0x2c308c)[_0xeb62('0x32')](_0x235448);};}exports[_0xeb62('0x33')]=function(_0x2ad3ec,_0x1ae51e){var _0x4be25d={},_0x411062={},_0x47a94b={'count':0x0,'rows':[]};var _0x555db1=_[_0xeb62('0x34')](db[_0xeb62('0x35')]['rawAttributes'],function(_0x1ade38){return{'name':_0x1ade38['fieldName'],'type':_0x1ade38[_0xeb62('0x36')][_0xeb62('0x37')]};});_0x411062['model']=_[_0xeb62('0x34')](_0x555db1,_0xeb62('0x31'));_0x411062['query']=_[_0xeb62('0x38')](_0x2ad3ec[_0xeb62('0x39')]);_0x411062[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x411062['model'],_0x411062[_0xeb62('0x39')]);_0x4be25d[_0xeb62('0x3c')]=_['intersection'](_0x411062['model'],qs[_0xeb62('0x3d')](_0x2ad3ec[_0xeb62('0x39')]['fields']));_0x4be25d[_0xeb62('0x3c')]=_0x4be25d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x4be25d[_0xeb62('0x3c')]:_0x411062[_0xeb62('0x3f')];if(!_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x40')]('nolimit')){_0x4be25d['limit']=qs[_0xeb62('0x26')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x26')]);_0x4be25d[_0xeb62('0x24')]=qs['offset'](_0x2ad3ec[_0xeb62('0x39')]['offset']);}_0x4be25d[_0xeb62('0x41')]=qs[_0xeb62('0x42')](_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x42')]);_0x4be25d[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x2ad3ec[_0xeb62('0x39')],_0x411062['filters']),_0x555db1);if(_0x2ad3ec[_0xeb62('0x39')][_0xeb62('0x45')]){_0x4be25d[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0x4be25d['where'],{'$or':_['map'](_0x555db1,function(_0x46a560){if(_0x46a560[_0xeb62('0x36')]!=='VIRTUAL'){var _0x1f7036={};_0x1f7036[_0x46a560[_0xeb62('0x31')]]={'$like':'%'+_0x2ad3ec['query'][_0xeb62('0x45')]+'%'};return _0x1f7036;}})});}_0x4be25d=_['merge']({},_0x4be25d,_0x2ad3ec[_0xeb62('0x47')]);var _0x47b815={'where':_0x4be25d[_0xeb62('0x43')]};return db['VoicePrefix'][_0xeb62('0x27')](_0x47b815)[_0xeb62('0x2e')](function(_0x317f50){_0x47a94b['count']=_0x317f50;if(_0x2ad3ec['query'][_0xeb62('0x48')]){_0x4be25d[_0xeb62('0x49')]=[{'all':!![]}];}return db[_0xeb62('0x35')][_0xeb62('0x4a')](_0x4be25d);})[_0xeb62('0x2e')](function(_0x4afd5e){_0x47a94b[_0xeb62('0x4b')]=_0x4afd5e;return _0x47a94b;})['then'](respondWithFilteredResult(_0x1ae51e,_0x4be25d))[_0xeb62('0x4c')](handleError(_0x1ae51e,null));};exports['show']=function(_0xeeced2,_0x4d2f80){var _0x26c77d={'raw':![],'where':{'id':_0xeeced2[_0xeb62('0x4d')]['id']}},_0x4dbcac={};_0x4dbcac[_0xeb62('0x3f')]=_[_0xeb62('0x38')](db[_0xeb62('0x35')][_0xeb62('0x4e')]);_0x4dbcac[_0xeb62('0x39')]=_['keys'](_0xeeced2[_0xeb62('0x39')]);_0x4dbcac[_0xeb62('0x3a')]=_['intersection'](_0x4dbcac['model'],_0x4dbcac['query']);_0x26c77d['attributes']=_[_0xeb62('0x3b')](_0x4dbcac[_0xeb62('0x3f')],qs['fields'](_0xeeced2[_0xeb62('0x39')][_0xeb62('0x3d')]));_0x26c77d[_0xeb62('0x3c')]=_0x26c77d[_0xeb62('0x3c')][_0xeb62('0x3e')]?_0x26c77d['attributes']:_0x4dbcac[_0xeb62('0x3f')];if(_0xeeced2['query'][_0xeb62('0x48')]){_0x26c77d[_0xeb62('0x49')]=[{'all':!![]}];}_0x26c77d=_[_0xeb62('0x46')]({},_0x26c77d,_0xeeced2[_0xeb62('0x47')]);return db[_0xeb62('0x35')][_0xeb62('0x4f')](_0x26c77d)[_0xeb62('0x2e')](handleEntityNotFound(_0x4d2f80,null))[_0xeb62('0x2e')](respondWithResult(_0x4d2f80,null))[_0xeb62('0x4c')](handleError(_0x4d2f80,null));};exports[_0xeb62('0x2d')]=function(_0xe13846,_0x13e102){return db['VoicePrefix'][_0xeb62('0x4f')]({'where':{'id':_0xe13846['params']['id']}})['then'](handleEntityNotFound(_0x13e102,null))[_0xeb62('0x2e')](removeEntity(_0x13e102,null))[_0xeb62('0x4c')](handleError(_0x13e102,null));};exports['describe']=function(_0x373505,_0x462760){return db['VoicePrefix'][_0xeb62('0x50')]()[_0xeb62('0x2e')](respondWithResult(_0x462760,null))[_0xeb62('0x4c')](handleError(_0x462760,null));};exports[_0xeb62('0x51')]=function(_0xe71e83,_0x1e6238){var _0x351027;return db[_0xeb62('0x52')]['transaction'](function(_0x3e2be9){return db['VoicePrefix'][_0xeb62('0x51')](_0xe71e83[_0xeb62('0x53')],{'transaction':_0x3e2be9})[_0xeb62('0x2e')](function(_0x289af0){_0x351027=_0x289af0[_0xeb62('0x54')]({'plain':!![]});return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x351027[_0xeb62('0x56')]},'raw':!![]})['then'](function(_0x4d31a1){return createVoicePrefixExtensions(_0x351027,_0x4d31a1,_0x3e2be9);});});})['then'](function(){var _0x5033eb=_0xe71e83[_0xeb62('0x57')]['get']({'plain':!![]});if(!_0x5033eb)throw new Error(_0xeb62('0x58'));if(_0x5033eb['role']===_0xeb62('0x57')){var _0x342768=_0x351027;return db[_0xeb62('0x59')]['find']({'where':{'name':_0xeb62('0x2f'),'userProfileId':_0x5033eb[_0xeb62('0x5a')]},'raw':!![]})['then'](function(_0x35982a){if(_0x35982a&&_0x35982a[_0xeb62('0x5b')]===0x0){return db[_0xeb62('0x30')][_0xeb62('0x51')]({'name':_0x342768['name'],'resourceId':_0x342768['id'],'type':_0x35982a[_0xeb62('0x31')],'sectionId':_0x35982a['id']},{})[_0xeb62('0x2e')](function(){return _0x351027;});}else{return _0x351027;}})['catch'](function(_0x2eba52){logger[_0xeb62('0x5c')](_0xeb62('0x5d'),_0x2eba52);throw _0x2eba52;});}return _0x351027;})[_0xeb62('0x2e')](respondWithResult(_0x1e6238,null))[_0xeb62('0x4c')](handleError(_0x1e6238,null));};function Extension(_0x46da69,_0x3e55bf,_0x1b354d,_0x222d0c){this[_0xeb62('0x5e')]=_0xeb62('0x5f');this[_0xeb62('0x60')]=_0x46da69;this[_0xeb62('0x61')]=_0x1b354d;this[_0xeb62('0x36')]=_0xeb62('0x62');this[_0xeb62('0x63')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3e55bf;this['appdata']=_0x222d0c;}function createVoicePrefixExtensions(_0x5b28ec,_0x279b83,_0x5f363d){return new BPromise(function(_0x10cc40,_0x136d81){var _0x5b8c4=new Extension(formatPrefixName(_0x5b28ec[_0xeb62('0x64')]),0x1,_0xeb62('0x65'),_0xeb62('0x66'));_0x5b8c4[_0xeb62('0x67')]=_0x5b28ec['id'];return db[_0xeb62('0x55')][_0xeb62('0x51')](_0x5b8c4,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x52dfbd){var _0x113302=_0x52dfbd[_0xeb62('0x54')]({'plain':!![]});var _0x42e992=_[_0xeb62('0x34')](addVoicePrefixExtensions(_0x5b28ec,_0x279b83),function(_0x4aba1f){_0x4aba1f[_0xeb62('0x56')]=_0x113302['id'];_0x4aba1f[_0xeb62('0x67')]=_0x5b28ec['id'];return _0x4aba1f;});return db[_0xeb62('0x55')][_0xeb62('0x68')](_0x42e992,{'transaction':_0x5f363d})[_0xeb62('0x2e')](function(_0x1679a7){if(!_0x1679a7){return _0x136d81(_0xeb62('0x69'));}else{return _0x10cc40(_0x1679a7);}})[_0xeb62('0x4c')](function(_0x2e1fb8){return _0x136d81(_0x2e1fb8);});});;});};function addVoicePrefixExtensions(_0x2b788e,_0x1d8675){var _0x510275=[];var _0x110224=formatPrefixName(_0x2b788e[_0xeb62('0x64')]);_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x2,_0xeb62('0x6b'),_0xeb62('0x6c')+_0x2b788e[_0xeb62('0x31')]));if(_0x2b788e[_0xeb62('0x6d')]){_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x6b'),_0xeb62('0x6e')+_0x2b788e['callerIdAll']));}else{_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x3,_0xeb62('0x65'),_0xeb62('0x6f')));}_0x510275[_0xeb62('0x6a')](new Extension(_0x110224,0x4,'goto',_0x1d8675[_0xeb62('0x5e')]+','+_0xeb62('0x70')+(0x8+_0x2b788e[_0xeb62('0x31')][_0xeb62('0x3e')])+'}'+','+0x1));return _0x510275;}function formatPrefixName(_0xc81d4c){var _0x32642f='_';for(var _0x48488c=0x0;_0x48488c<_0xc81d4c[_0xeb62('0x3e')];_0x48488c++){if(_0xc81d4c[_0xeb62('0x71')](_0x48488c)=='-'){_0x32642f+=_0xc81d4c[_0xeb62('0x71')](_0x48488c);}else{_0x32642f+='['+_0xc81d4c[_0xeb62('0x71')](_0x48488c)+']';}}_0x32642f+='.';return _0x32642f;}exports[_0xeb62('0x2c')]=function(_0x28d0ff,_0x2e4502,_0x313d33){var _0x233715=_0x28d0ff[_0xeb62('0x53')];_0x233715[_0xeb62('0x64')]=_0xeb62('0x72')+_0x233715[_0xeb62('0x31')]+'-';return db[_0xeb62('0x52')][_0xeb62('0x73')](function(_0x2bbbff){return db['VoicePrefix'][_0xeb62('0x2c')](_0x233715,{'where':{'id':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x2d')]({'where':{'VoicePrefixId':_0x233715['id']},'transaction':_0x2bbbff})['then'](function(){return db[_0xeb62('0x55')][_0xeb62('0x4f')]({'where':{'id':_0x233715[_0xeb62('0x56')]},'raw':!![]})[_0xeb62('0x2e')](function(_0x206e77){return createVoicePrefixExtensions(_0x233715,_0x206e77,_0x2bbbff);});});});})[_0xeb62('0x2e')](function(){return db[_0xeb62('0x35')][_0xeb62('0x74')](_0x233715['id']);})[_0xeb62('0x2e')](respondWithResult(_0x2e4502,null))[_0xeb62('0x4c')](handleError(_0x2e4502,null));};exports[_0xeb62('0x75')]=function(_0x146174,_0x910940,_0x4c6b69){return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146174['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x910940,null))['then'](function(_0x32679a){if(_0x32679a){return _0x32679a[_0xeb62('0x75')](_0x146174[_0xeb62('0x53')][_0xeb62('0x76')],_[_0xeb62('0x77')](_0x146174[_0xeb62('0x53')],['ids','id'])||{})[_0xeb62('0x78')](function(_0x4fc07f){for(var _0x42ee4d=0x0;_0x42ee4d<_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x42ee4d+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':Number(_0x146174[_0xeb62('0x53')][_0xeb62('0x76')][_0x42ee4d]),'VoicePrefixId':Number(_0x146174[_0xeb62('0x4d')]['id'])});}return _0x4fc07f;});}})['then'](respondWithResult(_0x910940,null))[_0xeb62('0x4c')](handleError(_0x910940,null));};exports[_0xeb62('0x7a')]=function(_0x8a8ef3,_0x7ca547,_0x16c28d){return db[_0xeb62('0x35')]['find']({'where':{'id':_0x8a8ef3['params']['id']}})['then'](handleEntityNotFound(_0x7ca547,null))['then'](function(_0x5bf6f6){if(_0x5bf6f6){return _0x5bf6f6[_0xeb62('0x7a')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])[_0xeb62('0x2e')](function(){if(_[_0xeb62('0x7b')](_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')])){for(var _0x1c01ae=0x0;_0x1c01ae<_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0xeb62('0x3e')];_0x1c01ae+=0x1){socket[_0xeb62('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')][_0x1c01ae]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}}else{socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':Number(_0x8a8ef3[_0xeb62('0x39')][_0xeb62('0x76')]),'VoicePrefixId':Number(_0x8a8ef3[_0xeb62('0x4d')]['id'])});}});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x7ca547,null))[_0xeb62('0x4c')](handleError(_0x7ca547,null));};exports[_0xeb62('0x7d')]=function(_0x17beef,_0x45b2a3,_0x42c384){var _0xfff29b={};var _0x1cbfab={};var _0x29648f;var _0x2f5f2f;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x17beef['params']['id']}})[_0xeb62('0x2e')](handleEntityNotFound(_0x45b2a3,null))[_0xeb62('0x2e')](function(_0x48dcf6){if(_0x48dcf6){_0x29648f=_0x48dcf6;_0x1cbfab[_0xeb62('0x3f')]=_['keys'](db['User'][_0xeb62('0x4e')]);_0x1cbfab[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x17beef[_0xeb62('0x39')]);_0x1cbfab['filters']=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],_0x1cbfab['query']);_0xfff29b[_0xeb62('0x3c')]=_[_0xeb62('0x3b')](_0x1cbfab[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x17beef[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xfff29b[_0xeb62('0x3c')]=_0xfff29b[_0xeb62('0x3c')]['length']?_0xfff29b[_0xeb62('0x3c')]:_0x1cbfab[_0xeb62('0x3f')];_0xfff29b['order']=qs[_0xeb62('0x42')](_0x17beef['query']['sort']);_0xfff29b[_0xeb62('0x43')]=qs[_0xeb62('0x3a')](_[_0xeb62('0x44')](_0x17beef[_0xeb62('0x39')],_0x1cbfab[_0xeb62('0x3a')]));if(_0x17beef['query'][_0xeb62('0x45')]){_0xfff29b[_0xeb62('0x43')]=_[_0xeb62('0x46')](_0xfff29b[_0xeb62('0x43')],{'$or':_[_0xeb62('0x34')](_0xfff29b[_0xeb62('0x3c')],function(_0x401ad1){var _0x50170b={};_0x50170b[_0x401ad1]={'$like':'%'+_0x17beef['query']['filter']+'%'};return _0x50170b;})});}_0xfff29b=_[_0xeb62('0x46')]({},_0xfff29b,_0x17beef[_0xeb62('0x47')]);return _0x29648f[_0xeb62('0x7d')](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x599418){if(_0x599418){_0x2f5f2f=_0x599418[_0xeb62('0x3e')];if(!_0x17beef['query']['hasOwnProperty'](_0xeb62('0x7f'))){_0xfff29b[_0xeb62('0x26')]=qs['limit'](_0x17beef[_0xeb62('0x39')]['limit']);_0xfff29b[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x17beef[_0xeb62('0x39')]['offset']);}return _0x29648f['getAgents'](_0xfff29b);}})[_0xeb62('0x2e')](function(_0x276e06){if(_0x276e06){return _0x276e06?{'count':_0x2f5f2f,'rows':_0x276e06}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x45b2a3,null))['catch'](handleError(_0x45b2a3,null));};exports[_0xeb62('0x80')]=function(_0x162993,_0x3f5c93,_0x3b15ec){var _0xca3f0e={};var _0x2e4d99={};var _0x518655;var _0x4cd599;return db['VoicePrefix'][_0xeb62('0x7e')]({'where':{'id':_0x162993['params']['id']}})['then'](handleEntityNotFound(_0x3f5c93,null))[_0xeb62('0x2e')](function(_0x49d2c7){if(_0x49d2c7){_0x518655=_0x49d2c7;_0x2e4d99['model']=_['keys'](db[_0xeb62('0x81')]['rawAttributes']);_0x2e4d99[_0xeb62('0x39')]=_[_0xeb62('0x38')](_0x162993[_0xeb62('0x39')]);_0x2e4d99[_0xeb62('0x3a')]=_[_0xeb62('0x3b')](_0x2e4d99[_0xeb62('0x3f')],_0x2e4d99[_0xeb62('0x39')]);_0xca3f0e['attributes']=_['intersection'](_0x2e4d99[_0xeb62('0x3f')],qs[_0xeb62('0x3d')](_0x162993[_0xeb62('0x39')][_0xeb62('0x3d')]));_0xca3f0e[_0xeb62('0x3c')]=_0xca3f0e['attributes'][_0xeb62('0x3e')]?_0xca3f0e[_0xeb62('0x3c')]:_0x2e4d99[_0xeb62('0x3f')];_0xca3f0e['order']=qs[_0xeb62('0x42')](_0x162993['query'][_0xeb62('0x42')]);_0xca3f0e[_0xeb62('0x43')]=qs['filters'](_['pick'](_0x162993[_0xeb62('0x39')],_0x2e4d99[_0xeb62('0x3a')]));if(_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]){_0xca3f0e['where']=_[_0xeb62('0x46')](_0xca3f0e[_0xeb62('0x43')],{'$or':_['map'](_0xca3f0e['attributes'],function(_0x12adf6){var _0x1b9569={};_0x1b9569[_0x12adf6]={'$like':'%'+_0x162993[_0xeb62('0x39')][_0xeb62('0x45')]+'%'};return _0x1b9569;})});}_0xca3f0e=_[_0xeb62('0x46')]({},_0xca3f0e,_0x162993[_0xeb62('0x47')]);return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})[_0xeb62('0x2e')](function(_0x144bc8){if(_0x144bc8){_0x4cd599=_0x144bc8[_0xeb62('0x3e')];if(!_0x162993[_0xeb62('0x39')][_0xeb62('0x40')](_0xeb62('0x7f'))){_0xca3f0e[_0xeb62('0x26')]=qs[_0xeb62('0x26')](_0x162993[_0xeb62('0x39')]['limit']);_0xca3f0e[_0xeb62('0x24')]=qs[_0xeb62('0x24')](_0x162993[_0xeb62('0x39')][_0xeb62('0x24')]);}return _0x518655[_0xeb62('0x80')](_0xca3f0e);}})['then'](function(_0x54984f){if(_0x54984f){return _0x54984f?{'count':_0x4cd599,'rows':_0x54984f}:null;}})[_0xeb62('0x2e')](respondWithResult(_0x3f5c93,null))[_0xeb62('0x4c')](handleError(_0x3f5c93,null));};exports[_0xeb62('0x82')]=function(_0x3d957d,_0x5af4d7,_0x3a0b12){var _0x5f2c1e=_0x3d957d[_0xeb62('0x53')][_0xeb62('0x76')];var _0x3409db;return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x5f2c1e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb62('0x83'),'attributes':['id',_0xeb62('0x31'),'online',_0xeb62('0x84'),'interface'],'raw':!![]}]})[_0xeb62('0x2e')](function(_0x43107d){if(_0x43107d){_0x3409db=_0x43107d;var _0x2e503b=_[_0xeb62('0x85')](_0x43107d,function(_0x45a197){var _0x3394e6=_0x45a197['get']({'plain':!![]});return _0x3394e6['Agents'];});return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x3d957d[_0xeb62('0x4d')]['id']}})[_0xeb62('0x2e')](function(_0x582217){return db['sequelize'][_0xeb62('0x73')](function(_0x527de3){return _0x582217[_0xeb62('0x82')](_0x5f2c1e,{'transaction':_0x527de3})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x3409db,function(_0x5e43f0){return db[_0xeb62('0x87')][_0xeb62('0x88')]({'TeamId':_0x5e43f0['id'],'VoicePrefixId':_0x3d957d[_0xeb62('0x4d')]['id']},{'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){return BPromise[_0xeb62('0x86')](_0x2e503b,function(_0x10731b){return db[_0xeb62('0x89')][_0xeb62('0x8a')]({'where':{'UserId':_0x10731b['id'],'VoicePrefixId':_0x3d957d['params']['id']},'transaction':_0x527de3});});})[_0xeb62('0x2e')](function(){_0x2e503b[_0xeb62('0x8b')](function(_0x35d372){socket[_0xeb62('0x79')]('userVoicePrefix:save',{'UserId':_0x35d372['id'],'VoicePrefixId':_0x582217['id']});});});});});}})[_0xeb62('0x2e')](respondWithStatusCode(_0x5af4d7,null))[_0xeb62('0x4c')](handleError(_0x5af4d7,null));};exports[_0xeb62('0x8c')]=function(_0x146c7e,_0x24c285,_0x59bb00){return db[_0xeb62('0x81')][_0xeb62('0x4a')]({'where':{'id':_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')]},'attributes':['id'],'include':[{'model':db[_0xeb62('0x8d')],'as':_0xeb62('0x83'),'attributes':['id'],'raw':!![]}]})[_0xeb62('0x2e')](handleEntityNotFound(_0x24c285,null))[_0xeb62('0x2e')](function(_0x30625f){var _0x94d0c9=_['map'](_0x30625f,'id');var _0x3ae667=[];var _0x3338ba=[];var _0x50cf9b=squel['select']();_0x50cf9b[_0xeb62('0x8e')](_0xeb62('0x8f'))[_0xeb62('0x90')](_0xeb62('0x91'),'tq')[_0xeb62('0x92')](_0xeb62('0x93'),'ut',_0xeb62('0x94'))[_0xeb62('0x43')](_0xeb62('0x95'),_0x146c7e['params']['id']);for(var _0x535e7a=0x0;_0x535e7a<_0x30625f[_0xeb62('0x3e')];_0x535e7a+=0x1){let _0x43daef=_0x30625f[_0x535e7a];for(var _0x58ffb2=0x0;_0x58ffb2<_0x43daef['Agents'][_0xeb62('0x3e')];_0x58ffb2+=0x1){let _0x341bd8=_0x43daef[_0xeb62('0x83')][_0x58ffb2];var _0x55ef9d=_0x50cf9b['clone']();_0x55ef9d[_0xeb62('0x43')]('ut.UserId\x20=\x20?',_0x341bd8['id']);_0x3338ba[_0xeb62('0x6a')](db[_0xeb62('0x52')][_0xeb62('0x39')](_0x55ef9d['toString'](),{'type':db['sequelize']['QueryTypes'][_0xeb62('0x96')]})[_0xeb62('0x2e')](function(_0x3517db){if(_0x3517db[_0xeb62('0x3e')]===0x1){return _0x341bd8['id'];}else{var _0x5bd3b6=_[_0xeb62('0x97')](_[_0xeb62('0x34')](_0x3517db,_0xeb62('0x98')),function(_0x22eb23){return _[_0xeb62('0x99')](_0x94d0c9,_0x22eb23);});if(_0x5bd3b6){return _0x341bd8['id'];}}}));}}return BPromise[_0xeb62('0x9a')](_0x3338ba)[_0xeb62('0x2e')](function(_0x394573){_0x3ae667=_(_0x3ae667)['union'](_0x394573)[_0xeb62('0x9b')]()[_0xeb62('0x9c')]();return db[_0xeb62('0x35')][_0xeb62('0x4f')]({'where':{'id':_0x146c7e['params']['id']}})[_0xeb62('0x2e')](function(_0x1f84f0){return db['sequelize'][_0xeb62('0x73')](function(_0x26b456){return _0x1f84f0[_0xeb62('0x8c')](_0x146c7e[_0xeb62('0x39')][_0xeb62('0x76')],{'transaction':_0x26b456})[_0xeb62('0x2e')](function(){if(!_[_0xeb62('0x9d')](_0x3ae667)){return _0x1f84f0['removeAgents'](_0x3ae667,{'transaction':_0x26b456});}})[_0xeb62('0x2e')](function(){_0x3ae667['forEach'](function(_0x3578a9){socket[_0xeb62('0x79')](_0xeb62('0x7c'),{'UserId':_0x3578a9,'VoicePrefixId':_0x1f84f0['id']});});});});});});})['then'](respondWithStatusCode(_0x24c285,null))['catch'](handleError(_0x24c285,null));}; \ No newline at end of file +var _0x2032=['sequelize','body','VoiceExtension','user','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','charAt','system-','transaction','findById','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','sort','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','userVoicePrefix:save','removeTeams','User','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','create'];(function(_0x2c4580,_0x3c180d){var _0x352062=function(_0x392ba3){while(--_0x392ba3){_0x2c4580['push'](_0x2c4580['shift']());}};_0x352062(++_0x3c180d);}(_0x2032,0xd9));var _0x2203=function(_0x53a192,_0x205ee7){_0x53a192=_0x53a192-0x0;var _0x4f64e1=_0x2032[_0x53a192];return _0x4f64e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x21a3af,_0x472265){_0x472265=_0x472265||0xcc;return function(_0x1c1ead){if(_0x1c1ead){return _0x21a3af[_0x2203('0x19')](_0x472265);}return _0x21a3af[_0x2203('0x1a')](_0x472265)[_0x2203('0x1b')]();};}function respondWithResult(_0x2c36e6,_0x2c085c){_0x2c085c=_0x2c085c||0xc8;return function(_0xdf9d0b){if(_0xdf9d0b){return _0x2c36e6[_0x2203('0x1a')](_0x2c085c)['json'](_0xdf9d0b);}};}function respondWithFilteredResult(_0x280eda,_0x2ee127){return function(_0x4893ff){if(_0x4893ff){var _0x3f9ef6=typeof _0x2ee127[_0x2203('0x1c')]==='undefined'&&typeof _0x2ee127[_0x2203('0x1d')]==='undefined';var _0x2904ba=_0x4893ff[_0x2203('0x1e')];var _0x3c8c34=_0x3f9ef6?0x0:_0x2ee127[_0x2203('0x1c')];var _0x15cb1a=_0x3f9ef6?_0x4893ff[_0x2203('0x1e')]:_0x2ee127['offset']+_0x2ee127[_0x2203('0x1d')];var _0x50822b;if(_0x15cb1a>=_0x2904ba){_0x15cb1a=_0x2904ba;_0x50822b=0xc8;}else{_0x50822b=0xce;}_0x280eda['status'](_0x50822b);return _0x280eda[_0x2203('0x1f')]('Content-Range',_0x3c8c34+'-'+_0x15cb1a+'/'+_0x2904ba)[_0x2203('0x20')](_0x4893ff);}return null;};}function patchUpdates(_0x5bfe61){return function(_0x5d4c4e){try{jsonpatch[_0x2203('0x21')](_0x5d4c4e,_0x5bfe61,!![]);}catch(_0x5e29cd){return BPromise['reject'](_0x5e29cd);}return _0x5d4c4e[_0x2203('0x22')]();};}function saveUpdates(_0x2718f5,_0x21f930){return function(_0xfd0970){if(_0xfd0970){return _0xfd0970[_0x2203('0x23')](_0x2718f5)[_0x2203('0x24')](function(_0x49c12){return _0x49c12;});}return null;};}function removeEntity(_0x250349,_0x576378){return function(_0x143f41){if(_0x143f41){return _0x143f41[_0x2203('0x25')]()[_0x2203('0x24')](function(){var _0x5f11bf=_0x143f41[_0x2203('0x26')]({'plain':!![]});var _0x1cec17='VoicePrefixes';return db[_0x2203('0x27')][_0x2203('0x25')]({'where':{'type':_0x1cec17,'resourceId':_0x5f11bf['id']}})[_0x2203('0x24')](function(){return _0x143f41;});})[_0x2203('0x24')](function(){_0x250349[_0x2203('0x1a')](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x9c53f,_0x5a95c1){return function(_0x34b8ba){if(!_0x34b8ba){_0x9c53f[_0x2203('0x19')](0x194);}return _0x34b8ba;};}function handleError(_0x406ce9,_0x74f035){_0x74f035=_0x74f035||0x1f4;return function(_0x52a426){logger[_0x2203('0x28')](_0x52a426[_0x2203('0x29')]);if(_0x52a426[_0x2203('0x2a')]){delete _0x52a426[_0x2203('0x2a')];}_0x406ce9['status'](_0x74f035)[_0x2203('0x2b')](_0x52a426);};}exports[_0x2203('0x2c')]=function(_0x5e6560,_0x5c0157){var _0x1d5f74={},_0x52fafc={},_0x58b44d={'count':0x0,'rows':[]};var _0x125dfc=_[_0x2203('0x2d')](db[_0x2203('0x2e')][_0x2203('0x2f')],function(_0xf2801d){return{'name':_0xf2801d['fieldName'],'type':_0xf2801d[_0x2203('0x30')][_0x2203('0x31')]};});_0x52fafc['model']=_[_0x2203('0x2d')](_0x125dfc,_0x2203('0x2a'));_0x52fafc[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5e6560[_0x2203('0x32')]);_0x52fafc[_0x2203('0x34')]=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],_0x52fafc[_0x2203('0x32')]);_0x1d5f74['attributes']=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],qs['fields'](_0x5e6560['query'][_0x2203('0x37')]));_0x1d5f74['attributes']=_0x1d5f74[_0x2203('0x38')][_0x2203('0x39')]?_0x1d5f74[_0x2203('0x38')]:_0x52fafc['model'];if(!_0x5e6560['query'][_0x2203('0x3a')]('nolimit')){_0x1d5f74[_0x2203('0x1d')]=qs['limit'](_0x5e6560[_0x2203('0x32')]['limit']);_0x1d5f74[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x5e6560[_0x2203('0x32')][_0x2203('0x1c')]);}_0x1d5f74[_0x2203('0x3b')]=qs['sort'](_0x5e6560['query']['sort']);_0x1d5f74[_0x2203('0x3c')]=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x5e6560[_0x2203('0x32')],_0x52fafc[_0x2203('0x34')]),_0x125dfc);if(_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]){_0x1d5f74['where']=_[_0x2203('0x3f')](_0x1d5f74[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x125dfc,function(_0x26be74){if(_0x26be74['type']!=='VIRTUAL'){var _0x3ddfe0={};_0x3ddfe0[_0x26be74['name']]={'$like':'%'+_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3ddfe0;}})});}_0x1d5f74=_[_0x2203('0x3f')]({},_0x1d5f74,_0x5e6560['options']);var _0x5bba52={'where':_0x1d5f74[_0x2203('0x3c')]};return db[_0x2203('0x2e')][_0x2203('0x1e')](_0x5bba52)[_0x2203('0x24')](function(_0x372709){_0x58b44d[_0x2203('0x1e')]=_0x372709;if(_0x5e6560['query'][_0x2203('0x40')]){_0x1d5f74[_0x2203('0x41')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x42')](_0x1d5f74);})[_0x2203('0x24')](function(_0x36b99f){_0x58b44d[_0x2203('0x43')]=_0x36b99f;return _0x58b44d;})[_0x2203('0x24')](respondWithFilteredResult(_0x5c0157,_0x1d5f74))[_0x2203('0x44')](handleError(_0x5c0157,null));};exports[_0x2203('0x45')]=function(_0x595281,_0x2e2ca5){var _0x24e773={'raw':![],'where':{'id':_0x595281[_0x2203('0x46')]['id']}},_0x4aab80={};_0x4aab80['model']=_['keys'](db[_0x2203('0x2e')]['rawAttributes']);_0x4aab80[_0x2203('0x32')]=_[_0x2203('0x33')](_0x595281[_0x2203('0x32')]);_0x4aab80[_0x2203('0x34')]=_['intersection'](_0x4aab80[_0x2203('0x36')],_0x4aab80[_0x2203('0x32')]);_0x24e773['attributes']=_[_0x2203('0x35')](_0x4aab80[_0x2203('0x36')],qs[_0x2203('0x37')](_0x595281[_0x2203('0x32')]['fields']));_0x24e773['attributes']=_0x24e773[_0x2203('0x38')]['length']?_0x24e773['attributes']:_0x4aab80[_0x2203('0x36')];if(_0x595281[_0x2203('0x32')][_0x2203('0x40')]){_0x24e773['include']=[{'all':!![]}];}_0x24e773=_['merge']({},_0x24e773,_0x595281[_0x2203('0x47')]);return db[_0x2203('0x2e')][_0x2203('0x48')](_0x24e773)[_0x2203('0x24')](handleEntityNotFound(_0x2e2ca5,null))[_0x2203('0x24')](respondWithResult(_0x2e2ca5,null))[_0x2203('0x44')](handleError(_0x2e2ca5,null));};exports['destroy']=function(_0x747dce,_0x557659){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x747dce[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x557659,null))['then'](removeEntity(_0x557659,null))['catch'](handleError(_0x557659,null));};exports[_0x2203('0x49')]=function(_0x1f772d,_0x126aad){return db[_0x2203('0x2e')]['describe']()['then'](respondWithResult(_0x126aad,null))['catch'](handleError(_0x126aad,null));};exports[_0x2203('0x4a')]=function(_0x1c2734,_0x57b891){var _0x7f61df;return db[_0x2203('0x4b')]['transaction'](function(_0x32b1db){return db[_0x2203('0x2e')][_0x2203('0x4a')](_0x1c2734[_0x2203('0x4c')],{'transaction':_0x32b1db})['then'](function(_0x120db1){_0x7f61df=_0x120db1['get']({'plain':!![]});return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x7f61df['VoiceExtensionId']},'raw':!![]})[_0x2203('0x24')](function(_0x8d089e){return createVoicePrefixExtensions(_0x7f61df,_0x8d089e,_0x32b1db);});});})[_0x2203('0x24')](function(){var _0x378132=_0x1c2734[_0x2203('0x4e')][_0x2203('0x26')]({'plain':!![]});if(!_0x378132)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378132['role']===_0x2203('0x4e')){var _0x524356=_0x7f61df;return db['UserProfileSection'][_0x2203('0x48')]({'where':{'name':_0x2203('0x4f'),'userProfileId':_0x378132[_0x2203('0x50')]},'raw':!![]})['then'](function(_0x213c24){if(_0x213c24&&_0x213c24['autoAssociation']===0x0){return db['UserProfileResource'][_0x2203('0x4a')]({'name':_0x524356['name'],'resourceId':_0x524356['id'],'type':_0x213c24['name'],'sectionId':_0x213c24['id']},{})['then'](function(){return _0x7f61df;});}else{return _0x7f61df;}})[_0x2203('0x44')](function(_0x31256b){logger[_0x2203('0x28')](_0x2203('0x51'),_0x31256b);throw _0x31256b;});}return _0x7f61df;})[_0x2203('0x24')](respondWithResult(_0x57b891,null))[_0x2203('0x44')](handleError(_0x57b891,null));};function Extension(_0x2baea2,_0x91f70c,_0x36b5fb,_0x216641){this[_0x2203('0x52')]=_0x2203('0x53');this['exten']=_0x2baea2;this['app']=_0x36b5fb;this[_0x2203('0x30')]=_0x2203('0x54');this[_0x2203('0x55')]=_0x2203('0x56');this[_0x2203('0x57')]=_0x91f70c;this[_0x2203('0x58')]=_0x216641;}function createVoicePrefixExtensions(_0x4f8b8e,_0x5486f9,_0xb49120){return new BPromise(function(_0x34358e,_0x21ee59){var _0x1e6d21=new Extension(formatPrefixName(_0x4f8b8e[_0x2203('0x59')]),0x1,_0x2203('0x5a'),_0x2203('0x5b'));_0x1e6d21[_0x2203('0x5c')]=_0x4f8b8e['id'];return db[_0x2203('0x4d')][_0x2203('0x4a')](_0x1e6d21,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x48bed1){var _0x1ea97a=_0x48bed1[_0x2203('0x26')]({'plain':!![]});var _0x3ce9f5=_[_0x2203('0x2d')](addVoicePrefixExtensions(_0x4f8b8e,_0x5486f9),function(_0x41a938){_0x41a938[_0x2203('0x5d')]=_0x1ea97a['id'];_0x41a938[_0x2203('0x5c')]=_0x4f8b8e['id'];return _0x41a938;});return db[_0x2203('0x4d')][_0x2203('0x5e')](_0x3ce9f5,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x49e795){if(!_0x49e795){return _0x21ee59(_0x2203('0x5f'));}else{return _0x34358e(_0x49e795);}})[_0x2203('0x44')](function(_0x24179a){return _0x21ee59(_0x24179a);});});;});};function addVoicePrefixExtensions(_0xc193b7,_0x34e820){var _0x1e44c=[];var _0x1068bc=formatPrefixName(_0xc193b7[_0x2203('0x59')]);_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x2,'Set',_0x2203('0x61')+_0xc193b7[_0x2203('0x2a')]));if(_0xc193b7[_0x2203('0x62')]){_0x1e44c['push'](new Extension(_0x1068bc,0x3,_0x2203('0x63'),_0x2203('0x64')+_0xc193b7[_0x2203('0x62')]));}else{_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x3,_0x2203('0x5a'),'No\x20callerid\x20available'));}_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x4,_0x2203('0x65'),_0x34e820[_0x2203('0x52')]+','+'${EXTEN:'+(0x8+_0xc193b7['name']['length'])+'}'+','+0x1));return _0x1e44c;}function formatPrefixName(_0x485e5b){var _0x595814='_';for(var _0x418d48=0x0;_0x418d48<_0x485e5b[_0x2203('0x39')];_0x418d48++){if(_0x485e5b[_0x2203('0x66')](_0x418d48)=='-'){_0x595814+=_0x485e5b[_0x2203('0x66')](_0x418d48);}else{_0x595814+='['+_0x485e5b[_0x2203('0x66')](_0x418d48)+']';}}_0x595814+='.';return _0x595814;}exports[_0x2203('0x23')]=function(_0x3f7926,_0x44bea0,_0x56dcbe){var _0x500860=_0x3f7926[_0x2203('0x4c')];_0x500860[_0x2203('0x59')]=_0x2203('0x67')+_0x500860[_0x2203('0x2a')]+'-';return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x45cc3a){return db[_0x2203('0x2e')][_0x2203('0x23')](_0x500860,{'where':{'id':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x25')]({'where':{'VoicePrefixId':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x500860[_0x2203('0x5d')]},'raw':!![]})[_0x2203('0x24')](function(_0x173ac1){return createVoicePrefixExtensions(_0x500860,_0x173ac1,_0x45cc3a);});});});})[_0x2203('0x24')](function(){return db['VoicePrefix'][_0x2203('0x69')](_0x500860['id']);})['then'](respondWithResult(_0x44bea0,null))[_0x2203('0x44')](handleError(_0x44bea0,null));};exports['addAgents']=function(_0x5ba500,_0xf71e7e,_0x269649){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x5ba500[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0xf71e7e,null))[_0x2203('0x24')](function(_0x4e9a01){if(_0x4e9a01){return _0x4e9a01['addAgents'](_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')],_[_0x2203('0x6b')](_0x5ba500['body'],['ids','id'])||{})['spread'](function(_0xdff006){for(var _0x2d26ba=0x0;_0x2d26ba<_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')]['length'];_0x2d26ba+=0x1){socket[_0x2203('0x6c')]('userVoicePrefix:save',{'UserId':Number(_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')][_0x2d26ba]),'VoicePrefixId':Number(_0x5ba500[_0x2203('0x46')]['id'])});}return _0xdff006;});}})[_0x2203('0x24')](respondWithResult(_0xf71e7e,null))[_0x2203('0x44')](handleError(_0xf71e7e,null));};exports['removeAgents']=function(_0x4592fa,_0x247f26,_0x18663f){return db['VoicePrefix'][_0x2203('0x48')]({'where':{'id':_0x4592fa[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x247f26,null))[_0x2203('0x24')](function(_0x1c65f9){if(_0x1c65f9){return _0x1c65f9[_0x2203('0x6d')](_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')])[_0x2203('0x24')](function(){if(_[_0x2203('0x6e')](_0x4592fa[_0x2203('0x32')]['ids'])){for(var _0x1adfa6=0x0;_0x1adfa6<_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x2203('0x39')];_0x1adfa6+=0x1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x1adfa6]),'VoicePrefixId':Number(_0x4592fa[_0x2203('0x46')]['id'])});}}else{socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')]['ids']),'VoicePrefixId':Number(_0x4592fa['params']['id'])});}});}})[_0x2203('0x24')](respondWithStatusCode(_0x247f26,null))[_0x2203('0x44')](handleError(_0x247f26,null));};exports[_0x2203('0x70')]=function(_0xb6863b,_0x42dce6,_0x4fd029){var _0x16e518={};var _0x3cb792={};var _0x4e539b;var _0x511689;return db['VoicePrefix']['findOne']({'where':{'id':_0xb6863b['params']['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x42dce6,null))[_0x2203('0x24')](function(_0x437095){if(_0x437095){_0x4e539b=_0x437095;_0x3cb792['model']=_['keys'](db['User'][_0x2203('0x2f')]);_0x3cb792[_0x2203('0x32')]=_[_0x2203('0x33')](_0xb6863b[_0x2203('0x32')]);_0x3cb792[_0x2203('0x34')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],_0x3cb792['query']);_0x16e518[_0x2203('0x38')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],qs[_0x2203('0x37')](_0xb6863b[_0x2203('0x32')][_0x2203('0x37')]));_0x16e518[_0x2203('0x38')]=_0x16e518['attributes'][_0x2203('0x39')]?_0x16e518['attributes']:_0x3cb792['model'];_0x16e518[_0x2203('0x3b')]=qs['sort'](_0xb6863b[_0x2203('0x32')][_0x2203('0x71')]);_0x16e518['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0xb6863b[_0x2203('0x32')],_0x3cb792[_0x2203('0x34')]));if(_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]){_0x16e518['where']=_[_0x2203('0x3f')](_0x16e518[_0x2203('0x3c')],{'$or':_['map'](_0x16e518['attributes'],function(_0x377176){var _0x3fe71b={};_0x3fe71b[_0x377176]={'$like':'%'+_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3fe71b;})});}_0x16e518=_[_0x2203('0x3f')]({},_0x16e518,_0xb6863b[_0x2203('0x47')]);return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x4749df){if(_0x4749df){_0x511689=_0x4749df[_0x2203('0x39')];if(!_0xb6863b[_0x2203('0x32')][_0x2203('0x3a')](_0x2203('0x72'))){_0x16e518[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0xb6863b[_0x2203('0x32')]['limit']);_0x16e518['offset']=qs[_0x2203('0x1c')](_0xb6863b[_0x2203('0x32')]['offset']);}return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x5b5e95){if(_0x5b5e95){return _0x5b5e95?{'count':_0x511689,'rows':_0x5b5e95}:null;}})[_0x2203('0x24')](respondWithResult(_0x42dce6,null))[_0x2203('0x44')](handleError(_0x42dce6,null));};exports['getTeams']=function(_0x21f357,_0x10c65a,_0x541639){var _0x318f3f={};var _0x1c4b57={};var _0x3cfe3f;var _0x1596f7;return db['VoicePrefix']['findOne']({'where':{'id':_0x21f357[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x10c65a,null))[_0x2203('0x24')](function(_0x4ff77f){if(_0x4ff77f){_0x3cfe3f=_0x4ff77f;_0x1c4b57['model']=_[_0x2203('0x33')](db[_0x2203('0x73')][_0x2203('0x2f')]);_0x1c4b57['query']=_['keys'](_0x21f357[_0x2203('0x32')]);_0x1c4b57[_0x2203('0x34')]=_['intersection'](_0x1c4b57[_0x2203('0x36')],_0x1c4b57[_0x2203('0x32')]);_0x318f3f['attributes']=_[_0x2203('0x35')](_0x1c4b57['model'],qs[_0x2203('0x37')](_0x21f357['query']['fields']));_0x318f3f['attributes']=_0x318f3f[_0x2203('0x38')][_0x2203('0x39')]?_0x318f3f['attributes']:_0x1c4b57[_0x2203('0x36')];_0x318f3f[_0x2203('0x3b')]=qs[_0x2203('0x71')](_0x21f357['query'][_0x2203('0x71')]);_0x318f3f['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x21f357['query'],_0x1c4b57[_0x2203('0x34')]));if(_0x21f357[_0x2203('0x32')]['filter']){_0x318f3f[_0x2203('0x3c')]=_[_0x2203('0x3f')](_0x318f3f[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x318f3f[_0x2203('0x38')],function(_0x5d73a7){var _0x2ba7d3={};_0x2ba7d3[_0x5d73a7]={'$like':'%'+_0x21f357[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x2ba7d3;})});}_0x318f3f=_[_0x2203('0x3f')]({},_0x318f3f,_0x21f357[_0x2203('0x47')]);return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})['then'](function(_0x29b41b){if(_0x29b41b){_0x1596f7=_0x29b41b[_0x2203('0x39')];if(!_0x21f357['query'][_0x2203('0x3a')]('nolimit')){_0x318f3f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x21f357[_0x2203('0x32')]['limit']);_0x318f3f[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x21f357[_0x2203('0x32')][_0x2203('0x1c')]);}return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})[_0x2203('0x24')](function(_0x1ccf09){if(_0x1ccf09){return _0x1ccf09?{'count':_0x1596f7,'rows':_0x1ccf09}:null;}})['then'](respondWithResult(_0x10c65a,null))['catch'](handleError(_0x10c65a,null));};exports[_0x2203('0x75')]=function(_0x41eb4c,_0x25996c,_0x4e1f55){var _0x2188d4=_0x41eb4c[_0x2203('0x4c')][_0x2203('0x6a')];var _0x500604;return db[_0x2203('0x73')][_0x2203('0x42')]({'where':{'id':_0x2188d4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2203('0x76'),'attributes':['id','name',_0x2203('0x77'),_0x2203('0x78'),'interface'],'raw':!![]}]})[_0x2203('0x24')](function(_0x9586e1){if(_0x9586e1){_0x500604=_0x9586e1;var _0x266d7e=_[_0x2203('0x79')](_0x9586e1,function(_0x34a160){var _0x36ab7f=_0x34a160[_0x2203('0x26')]({'plain':!![]});return _0x36ab7f[_0x2203('0x76')];});return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x41eb4c[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x4e7ba1){return db[_0x2203('0x4b')]['transaction'](function(_0x114e07){return _0x4e7ba1[_0x2203('0x75')](_0x2188d4,{'transaction':_0x114e07})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x500604,function(_0x145a72){return db[_0x2203('0x7b')][_0x2203('0x7c')]({'TeamId':_0x145a72['id'],'VoicePrefixId':_0x41eb4c[_0x2203('0x46')]['id']},{'transaction':_0x114e07});});})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x266d7e,function(_0x62843c){return db['UserVoicePrefix'][_0x2203('0x7d')]({'where':{'UserId':_0x62843c['id'],'VoicePrefixId':_0x41eb4c['params']['id']},'transaction':_0x114e07});});})[_0x2203('0x24')](function(){_0x266d7e[_0x2203('0x7e')](function(_0x6b8ea4){socket['emit'](_0x2203('0x7f'),{'UserId':_0x6b8ea4['id'],'VoicePrefixId':_0x4e7ba1['id']});});});});});}})[_0x2203('0x24')](respondWithStatusCode(_0x25996c,null))[_0x2203('0x44')](handleError(_0x25996c,null));};exports[_0x2203('0x80')]=function(_0x4316ae,_0x5c1138,_0x389f7f){return db['Team'][_0x2203('0x42')]({'where':{'id':_0x4316ae[_0x2203('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2203('0x81')],'as':_0x2203('0x76'),'attributes':['id'],'raw':!![]}]})[_0x2203('0x24')](handleEntityNotFound(_0x5c1138,null))[_0x2203('0x24')](function(_0x56c2cb){var _0x12179d=_['map'](_0x56c2cb,'id');var _0x55e083=[];var _0x4055eb=[];var _0x95b45a=squel[_0x2203('0x82')]();_0x95b45a[_0x2203('0x83')](_0x2203('0x84'))[_0x2203('0x85')](_0x2203('0x86'),'tq')['join'](_0x2203('0x87'),'ut',_0x2203('0x88'))[_0x2203('0x3c')]('VoicePrefixId\x20=\x20?',_0x4316ae['params']['id']);for(var _0x4d6ece=0x0;_0x4d6ece<_0x56c2cb[_0x2203('0x39')];_0x4d6ece+=0x1){let _0x46b5e6=_0x56c2cb[_0x4d6ece];for(var _0x3dba31=0x0;_0x3dba31<_0x46b5e6[_0x2203('0x76')]['length'];_0x3dba31+=0x1){let _0x238e6f=_0x46b5e6[_0x2203('0x76')][_0x3dba31];var _0x46146e=_0x95b45a[_0x2203('0x89')]();_0x46146e['where']('ut.UserId\x20=\x20?',_0x238e6f['id']);_0x4055eb[_0x2203('0x60')](db[_0x2203('0x4b')][_0x2203('0x32')](_0x46146e['toString'](),{'type':db[_0x2203('0x4b')][_0x2203('0x8a')][_0x2203('0x8b')]})[_0x2203('0x24')](function(_0x263130){if(_0x263130[_0x2203('0x39')]===0x1){return _0x238e6f['id'];}else{var _0xbee79c=_['every'](_[_0x2203('0x2d')](_0x263130,_0x2203('0x8c')),function(_0x131332){return _[_0x2203('0x8d')](_0x12179d,_0x131332);});if(_0xbee79c){return _0x238e6f['id'];}}}));}}return BPromise[_0x2203('0x8e')](_0x4055eb)[_0x2203('0x24')](function(_0x2d9004){_0x55e083=_(_0x55e083)[_0x2203('0x8f')](_0x2d9004)[_0x2203('0x90')]()['value']();return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x4316ae[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x547eb9){return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x1022ef){return _0x547eb9[_0x2203('0x80')](_0x4316ae[_0x2203('0x32')][_0x2203('0x6a')],{'transaction':_0x1022ef})[_0x2203('0x24')](function(){if(!_[_0x2203('0x91')](_0x55e083)){return _0x547eb9[_0x2203('0x6d')](_0x55e083,{'transaction':_0x1022ef});}})['then'](function(){_0x55e083['forEach'](function(_0x225ea1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':_0x225ea1,'VoicePrefixId':_0x547eb9['id']});});});});});});})[_0x2203('0x24')](respondWithStatusCode(_0x5c1138,null))['catch'](handleError(_0x5c1138,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0311fcd..f3d6c5e 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 _0x6234=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x57d73b,_0x15ac08){var _0x3c296b=function(_0x38e561){while(--_0x38e561){_0x57d73b['push'](_0x57d73b['shift']());}};_0x3c296b(++_0x15ac08);}(_0x6234,0x10f));var _0x4623=function(_0x16067d,_0x2a78c2){_0x16067d=_0x16067d-0x0;var _0x291483=_0x6234[_0x16067d];return _0x291483;};'use strict';var EventEmitter=require(_0x4623('0x0'));var VoicePrefix=require(_0x4623('0x1'))['db'][_0x4623('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4623('0x3')](0x0);var events={'afterCreate':_0x4623('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x41e83e){return function(_0x5c4115,_0x178afb,_0x587e8b){VoicePrefixEvents[_0x4623('0x5')](_0x41e83e+':'+_0x5c4115['id'],_0x5c4115);VoicePrefixEvents['emit'](_0x41e83e,_0x5c4115);_0x587e8b(null);};}for(var e in events){if(events[_0x4623('0x6')](e)){var event=events[e];VoicePrefix[_0x4623('0x7')](e,emitEvent(event));}}module[_0x4623('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x8797=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','../../mysqldb','VoicePrefix'];(function(_0x5cf81a,_0x3bf6f6){var _0x18afeb=function(_0x2b6491){while(--_0x2b6491){_0x5cf81a['push'](_0x5cf81a['shift']());}};_0x18afeb(++_0x3bf6f6);}(_0x8797,0x1a6));var _0x7879=function(_0x26d2a1,_0x351a41){_0x26d2a1=_0x26d2a1-0x0;var _0x3d28f8=_0x8797[_0x26d2a1];return _0x3d28f8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x7879('0x0'))['db'][_0x7879('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7879('0x2')](0x0);var events={'afterCreate':_0x7879('0x3'),'afterUpdate':'update','afterDestroy':_0x7879('0x4')};function emitEvent(_0x1129e5){return function(_0x245423,_0x3937bf,_0xce0a79){VoicePrefixEvents[_0x7879('0x5')](_0x1129e5+':'+_0x245423['id'],_0x245423);VoicePrefixEvents[_0x7879('0x5')](_0x1129e5,_0x245423);_0xce0a79(null);};}for(var e in events){if(events[_0x7879('0x6')](e)){var event=events[e];VoicePrefix[_0x7879('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 0587fbb..dc3d0ec 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 _0x2119=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','voice_prefixes'];(function(_0x5e4ce1,_0x226ce9){var _0x4ef150=function(_0x4c7f7d){while(--_0x4c7f7d){_0x5e4ce1['push'](_0x5e4ce1['shift']());}};_0x4ef150(++_0x226ce9);}(_0x2119,0xa8));var _0x9211=function(_0x139cf3,_0x135e44){_0x139cf3=_0x139cf3-0x0;var _0x4322a7=_0x2119[_0x139cf3];return _0x4322a7;};'use strict';var _=require(_0x9211('0x0'));var util=require(_0x9211('0x1'));var logger=require(_0x9211('0x2'))(_0x9211('0x3'));var moment=require(_0x9211('0x4'));var BPromise=require('bluebird');var rp=require(_0x9211('0x5'));var fs=require('fs');var path=require(_0x9211('0x6'));var rimraf=require(_0x9211('0x7'));var config=require(_0x9211('0x8'));var attributes=require(_0x9211('0x9'));module[_0x9211('0xa')]=function(_0x537ceb,_0x3ee36c){return _0x537ceb['define']('VoicePrefix',attributes,{'tableName':_0x9211('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87a0=['lodash','api','moment','path','rimraf','../../config/environment','exports','define','VoicePrefix'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x87a0,0xea));var _0x087a=function(_0x2f2690,_0x38fb94){_0x2f2690=_0x2f2690-0x0;var _0x7eefc6=_0x87a0[_0x2f2690];return _0x7eefc6;};'use strict';var _=require(_0x087a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x087a('0x1'));var moment=require(_0x087a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x087a('0x3'));var rimraf=require(_0x087a('0x4'));var config=require(_0x087a('0x5'));var attributes=require('./voicePrefix.attributes');module[_0x087a('0x6')]=function(_0xfc3123,_0x153ab4){return _0xfc3123[_0x087a('0x7')](_0x087a('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 2f7cfeb..fa34cc4 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 _0x46cb=['../../config/environment','jayson/promise','client','redis','localhost','./voicePrefix.socket','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d1309,_0x295fb5){var _0x51881b=function(_0x1783ef){while(--_0x1783ef){_0x1d1309['push'](_0x1d1309['shift']());}};_0x51881b(++_0x295fb5);}(_0x46cb,0x84));var _0xb46c=function(_0x315861,_0x735b4){_0x315861=_0x315861-0x0;var _0x3e2b76=_0x46cb[_0x315861];return _0x3e2b76;};'use strict';var _=require(_0xb46c('0x0'));var util=require(_0xb46c('0x1'));var moment=require(_0xb46c('0x2'));var BPromise=require(_0xb46c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb46c('0x4'));var db=require(_0xb46c('0x5'))['db'];var utils=require(_0xb46c('0x6'));var logger=require(_0xb46c('0x7'))('rpc');var config=require(_0xb46c('0x8'));var jayson=require(_0xb46c('0x9'));var client=jayson[_0xb46c('0xa')]['http']({'port':0x232a});config[_0xb46c('0xb')]=_['defaults'](config[_0xb46c('0xb')],{'host':_0xb46c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb46c('0xd'))[_0xb46c('0xe')](socket);function respondWithRpcPromise(_0x79bc47,_0x4715eb,_0x41da61){return new BPromise(function(_0x645386,_0x567d9e){return client[_0xb46c('0xf')](_0x79bc47,_0x41da61)[_0xb46c('0x10')](function(_0x3ff3ee){logger[_0xb46c('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x4715eb,_0xb46c('0x12'));logger[_0xb46c('0x13')](_0xb46c('0x14'),_0x4715eb,'request\x20sent',JSON[_0xb46c('0x15')](_0x3ff3ee));if(_0x3ff3ee[_0xb46c('0x16')]){if(_0x3ff3ee['error'][_0xb46c('0x17')]===0x1f4){logger[_0xb46c('0x16')](_0xb46c('0x18'),_0x4715eb,_0x3ff3ee[_0xb46c('0x16')][_0xb46c('0x19')]);return _0x567d9e(_0x3ff3ee[_0xb46c('0x16')][_0xb46c('0x19')]);}logger['error'](_0xb46c('0x18'),_0x4715eb,_0x3ff3ee[_0xb46c('0x16')][_0xb46c('0x19')]);return _0x645386(_0x3ff3ee[_0xb46c('0x16')][_0xb46c('0x19')]);}else{logger[_0xb46c('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x4715eb,'request\x20sent');_0x645386(_0x3ff3ee[_0xb46c('0x1a')]['message']);}})[_0xb46c('0x1b')](function(_0x2d0eac){logger[_0xb46c('0x16')](_0xb46c('0x18'),_0x4715eb,_0x2d0eac);_0x567d9e(_0x2d0eac);});});} \ No newline at end of file +var _0x0570=['debug','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x54b3c2,_0x50dda1){var _0x1c7b41=function(_0x3cd864){while(--_0x3cd864){_0x54b3c2['push'](_0x54b3c2['shift']());}};_0x1c7b41(++_0x50dda1);}(_0x0570,0x172));var _0x0057=function(_0x33367b,_0x227a61){_0x33367b=_0x33367b-0x0;var _0x2d8d26=_0x0570[_0x33367b];return _0x2d8d26;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});config['redis']=_[_0x0057('0xa')](config['redis'],{'host':_0x0057('0xb'),'port':0x18eb});var socket=require(_0x0057('0xc'))(new Redis(config[_0x0057('0xd')]));require(_0x0057('0xe'))[_0x0057('0xf')](socket);function respondWithRpcPromise(_0x54f384,_0x3dd577,_0x2fd05d){return new BPromise(function(_0xb56a5c,_0x5d493f){return client[_0x0057('0x10')](_0x54f384,_0x2fd05d)[_0x0057('0x11')](function(_0x48805a){logger['info'](_0x0057('0x12'),_0x3dd577,_0x0057('0x13'));logger[_0x0057('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3dd577,_0x0057('0x13'),JSON[_0x0057('0x15')](_0x48805a));if(_0x48805a[_0x0057('0x16')]){if(_0x48805a[_0x0057('0x16')]['code']===0x1f4){logger[_0x0057('0x16')](_0x0057('0x12'),_0x3dd577,_0x48805a['error'][_0x0057('0x17')]);return _0x5d493f(_0x48805a[_0x0057('0x16')]['message']);}logger[_0x0057('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x3dd577,_0x48805a[_0x0057('0x16')]['message']);return _0xb56a5c(_0x48805a[_0x0057('0x16')][_0x0057('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x3dd577,_0x0057('0x13'));_0xb56a5c(_0x48805a[_0x0057('0x18')]['message']);}})[_0x0057('0x19')](function(_0x5b5a4b){logger[_0x0057('0x16')](_0x0057('0x12'),_0x3dd577,_0x5b5a4b);_0x5d493f(_0x5b5a4b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f3da33c..f3cd014 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 _0xc560=['./voicePrefix.events','remove','emit','removeListener','length'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xc560,0x82));var _0x0c56=function(_0x142961,_0x4407b6){_0x142961=_0x142961-0x0;var _0x3080fe=_0xc560[_0x142961];return _0x3080fe;};'use strict';var VoicePrefixEvents=require(_0x0c56('0x0'));var events=['save',_0x0c56('0x1'),'update'];function createListener(_0x2c4115,_0x5b4dfe){return function(_0x5c33dd){_0x5b4dfe[_0x0c56('0x2')](_0x2c4115,_0x5c33dd);};}function removeListener(_0x39dbc7,_0x37c584){return function(){VoicePrefixEvents[_0x0c56('0x3')](_0x39dbc7,_0x37c584);};}exports['register']=function(_0x2b5654){for(var _0x2bc0a0=0x0,_0x35b4ee=events[_0x0c56('0x4')];_0x2bc0a0<_0x35b4ee;_0x2bc0a0++){var _0x501a0b=events[_0x2bc0a0];var _0x429ad1=createListener('voicePrefix:'+_0x501a0b,_0x2b5654);VoicePrefixEvents['on'](_0x501a0b,_0x429ad1);}}; \ No newline at end of file +var _0x3dd5=['removeListener','length','voicePrefix:','./voicePrefix.events','remove','update','emit'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x3dd5,0x73));var _0x53dd=function(_0x1100ff,_0x2dce61){_0x1100ff=_0x1100ff-0x0;var _0x368202=_0x3dd5[_0x1100ff];return _0x368202;};'use strict';var VoicePrefixEvents=require(_0x53dd('0x0'));var events=['save',_0x53dd('0x1'),_0x53dd('0x2')];function createListener(_0x45d521,_0x3b6401){return function(_0xfa7c49){_0x3b6401[_0x53dd('0x3')](_0x45d521,_0xfa7c49);};}function removeListener(_0x2ac886,_0x378841){return function(){VoicePrefixEvents[_0x53dd('0x4')](_0x2ac886,_0x378841);};}exports['register']=function(_0x3c8f9e){for(var _0x26c218=0x0,_0x37e012=events[_0x53dd('0x5')];_0x26c218<_0x37e012;_0x26c218++){var _0x4d3132=events[_0x26c218];var _0x561ded=createListener(_0x53dd('0x6')+_0x4d3132,_0x3c8f9e);VoicePrefixEvents['on'](_0x4d3132,_0x561ded);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0f248f4..920ceaa 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(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xb10b,0x12a));var _0xbb10=function(_0x16af01,_0x9c623c){_0x16af01=_0x16af01-0x0;var _0x4d4b9a=_0xb10b[_0x16af01];return _0x4d4b9a;};'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(_0x801846,_0x33b830){var _0x456a96=function(_0x4920b3){while(--_0x4920b3){_0x801846['push'](_0x801846['shift']());}};_0x456a96(++_0x33b830);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 8fab4a7..3a87d22 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 _0xc4bf=['BOOLEAN','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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\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','sequelize','exports','STRING','name','inbound','outbound','ENUM','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','dialMethod','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','periodic_announce','join','getDataValue','split','joinempty','leavewhenempty','acw','wrapuptime'];(function(_0x10af36,_0x153be3){var _0x426c39=function(_0x16dee7){while(--_0x16dee7){_0x10af36['push'](_0x10af36['shift']());}};_0x426c39(++_0x153be3);}(_0xc4bf,0xde));var _0xfc4b=function(_0x5d44d7,_0x1dcff5){_0x5d44d7=_0x5d44d7-0x0;var _0x4ac265=_0xc4bf[_0x5d44d7];return _0x4ac265;};'use strict';var Sequelize=require(_0xfc4b('0x0'));module[_0xfc4b('0x1')]={'name':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':![],'unique':_0xfc4b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xfc4b('0x4'),_0xfc4b('0x5')),'allowNull':![],'defaultValue':_0xfc4b('0x4')},'musiconhold':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xfc4b('0x6')]('rr',_0xfc4b('0x7'),_0xfc4b('0x8'),'fewestcalls','random',_0xfc4b('0x9'),_0xfc4b('0xa'),_0xfc4b('0xb'),_0xfc4b('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x32ce34){this[_0xfc4b('0xd')](_0xfc4b('0xe'),_0x32ce34?_0x32ce34:_0xfc4b('0x9'));},'get':function(){var _0x23bdf1=this['getDataValue'](_0xfc4b('0xf'));var _0x5009d5=this['getDataValue'](_0xfc4b('0x10'));var _0x47d569=this['getDataValue'](_0xfc4b('0xe'));if(_0x23bdf1===_0xfc4b('0x5')){if(_0x5009d5===_0xfc4b('0x11')){return null;}if(_0x5009d5===_0xfc4b('0x12')&&![_0xfc4b('0x9'),_0xfc4b('0x13')]['includes'](_0x47d569)){this[_0xfc4b('0xd')](_0xfc4b('0xe'),'rrmemory');}}return _0x47d569;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xfc4b('0x14')](0xb)},'timeout':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xfc4b('0x2')]},'weight':{'type':Sequelize[_0xfc4b('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xfc4b('0x6')]('yes','no'),'defaultValue':_0xfc4b('0x15')},'autopause':{'type':Sequelize[_0xfc4b('0x6')]('yes','no',_0xfc4b('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xfc4b('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xfc4b('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no',_0xfc4b('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xfc4b('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xfc4b('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xfc4b('0x2')]},'queue_youarenext':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xfc4b('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xfc4b('0x2')]},'queue_quantity1':{'type':Sequelize[_0xfc4b('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xfc4b('0x2')]},'queue_less_than':{'type':Sequelize[_0xfc4b('0x2')]},'periodic_announce':{'type':Sequelize[_0xfc4b('0x18')],'set':function(_0x37b597){this[_0xfc4b('0xd')](_0xfc4b('0x19'),_0x37b597?_0x37b597[_0xfc4b('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0xfc4b('0x19'))?this[_0xfc4b('0x1b')]('periodic_announce')[_0xfc4b('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':_0xfc4b('0x15'),'set':function(_0x5ad7dd){this['setDataValue']('joinempty',_0x5ad7dd?_0x5ad7dd['join'](','):undefined);},'get':function(){return this[_0xfc4b('0x1b')](_0xfc4b('0x1d'))?this[_0xfc4b('0x1b')](_0xfc4b('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':'no','set':function(_0xef1f19){this[_0xfc4b('0xd')](_0xfc4b('0x1e'),_0xef1f19?_0xef1f19['join'](','):undefined);},'get':function(){return this[_0xfc4b('0x1b')](_0xfc4b('0x1e'))?this[_0xfc4b('0x1b')](_0xfc4b('0x1e'))[_0xfc4b('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xfc4b('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xfc4b('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xfc4b('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x5a7fa3){this[_0xfc4b('0xd')](_0xfc4b('0x1f'),_0x5a7fa3);if(_0x5a7fa3){if(this['getDataValue'](_0xfc4b('0x20'))<0x2){this[_0xfc4b('0xd')](_0xfc4b('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':0x0,'comment':_0xfc4b('0x22')},'dialMethod':{'type':Sequelize[_0xfc4b('0x6')](_0xfc4b('0x11'),'progressive','power',_0xfc4b('0x23'),'booked'),'defaultValue':_0xfc4b('0x24'),'comment':_0xfc4b('0x25')},'dialLimitChannel':{'type':Sequelize[_0xfc4b('0x14')](0x4)[_0xfc4b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfc4b('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xfc4b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfc4b('0x28')},'dialPowerLevel':{'type':Sequelize[_0xfc4b('0x29')](0x2)[_0xfc4b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xfc4b('0x2a')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xfc4b('0x2b'),_0xfc4b('0x2c')),'defaultValue':_0xfc4b('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xfc4b('0x29')](0x2)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xfc4b('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xfc4b('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfc4b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfc4b('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xfc4b('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x2f')},'dialQueueOptions':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':_0xfc4b('0x30'),'comment':_0xfc4b('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x32')},'dialQueueProject':{'type':Sequelize[_0xfc4b('0x2')],'comment':_0xfc4b('0x33')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc4b('0x35')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'comment':_0xfc4b('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc4b('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfc4b('0x39')},'dialTimezone':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':_0xfc4b('0x3a')},'dialPrefix':{'type':Sequelize[_0xfc4b('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xfc4b('0x3b'),_0xfc4b('0x3c'),_0xfc4b('0x3d')),'defaultValue':_0xfc4b('0x3b')},'dialAMDActive':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':0x0,'comment':_0xfc4b('0x3e')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfc4b('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfc4b('0x3f')},'dialAMDGreeting':{'type':Sequelize[_0xfc4b('0x14')](0x9)[_0xfc4b('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfc4b('0x40')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfc4b('0x14')](0x9)[_0xfc4b('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfc4b('0x41')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xfc4b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfc4b('0x42')},'dialAMDMinWordLength':{'type':Sequelize[_0xfc4b('0x14')](0x9)[_0xfc4b('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfc4b('0x43')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfc4b('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfc4b('0x44')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfc4b('0x14')](0x9)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfc4b('0x45')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfc4b('0x46')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfc4b('0x14')](0x9)[_0xfc4b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfc4b('0x47')},'dialRecallMeTimeout':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xfc4b('0x48')},'dialRecallInQueue':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':0x0,'comment':_0xfc4b('0x49')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfc4b('0x6')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xfc4b('0x2')],'comment':_0xfc4b('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc4b('0x4a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xfc4b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfc4b('0x4b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfc4b('0x14')](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc4b('0x4c')},'dialDropMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x4d')},'dialDropRetryFrequency':{'type':Sequelize[_0xfc4b('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x4e')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc4b('0x4f')},'dialMachineMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x50')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfc4b('0x51')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfc4b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfc4b('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc4b('0x14')],'allowNull':!![],'comment':_0xfc4b('0x53')},'mandatoryDisposition':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':![],'comment':_0xfc4b('0x54'),'set':function(_0x19af61){if(!_0x19af61)this[_0xfc4b('0xd')]('mandatoryDispositionPauseId',null);this[_0xfc4b('0xd')]('mandatoryDisposition',_0x19af61);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xfc4b('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xfc4b('0x14')](0x3)[_0xfc4b('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xfc4b('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xfc4b('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0xb13f=['rrordered','setDataValue','type','getDataValue','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','ENUM','all','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom'];(function(_0x557079,_0x4adad5){var _0x39d8fa=function(_0x4e04c8){while(--_0x4e04c8){_0x557079['push'](_0x557079['shift']());}};_0x39d8fa(++_0x4adad5);}(_0xb13f,0x131));var _0xfb13=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0xb13f[_0x1d3fdc];return _0x128bb0;};'use strict';var Sequelize=require(_0xfb13('0x0'));module[_0xfb13('0x1')]={'name':{'type':Sequelize[_0xfb13('0x2')],'allowNull':![],'unique':_0xfb13('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xfb13('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xfb13('0x5'),_0xfb13('0x6'),_0xfb13('0x7'),'random',_0xfb13('0x8'),_0xfb13('0x9'),_0xfb13('0xa'),_0xfb13('0xb')),'allowNull':![],'defaultValue':_0xfb13('0x5'),'set':function(_0x1c6c9c){this[_0xfb13('0xc')]('strategy',_0x1c6c9c?_0x1c6c9c:_0xfb13('0x8'));},'get':function(){var _0x3f1e24=this['getDataValue'](_0xfb13('0xd'));var _0x1c2523=this[_0xfb13('0xe')](_0xfb13('0xf'));var _0x2c9e5d=this[_0xfb13('0xe')](_0xfb13('0x10'));if(_0x3f1e24===_0xfb13('0x4')){if(_0x1c2523===_0xfb13('0x11')){return null;}if(_0x1c2523===_0xfb13('0x12')&&![_0xfb13('0x8'),_0xfb13('0x13')]['includes'](_0x2c9e5d)){this['setDataValue'](_0xfb13('0x10'),_0xfb13('0x8'));}}return _0x2c9e5d;}},'servicelevel':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xfb13('0x14')](0xb)},'timeout':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xfb13('0x2')]},'weight':{'type':Sequelize[_0xfb13('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xfb13('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no',_0xfb13('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xfb13('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xfb13('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xfb13('0x16')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xfb13('0x15'),'no'),'defaultValue':_0xfb13('0x15')},'announce_holdtime':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xfb13('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xfb13('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xfb13('0x2')]},'queue_quantity2':{'type':Sequelize[_0xfb13('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xfb13('0x2')]},'queue_less_than':{'type':Sequelize[_0xfb13('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x18ab30){this['setDataValue'](_0xfb13('0x18'),_0x18ab30?_0x18ab30[_0xfb13('0x19')](','):[]);},'get':function(){return this[_0xfb13('0xe')](_0xfb13('0x18'))?this['getDataValue'](_0xfb13('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':'yes','set':function(_0x452aa8){this[_0xfb13('0xc')](_0xfb13('0x1a'),_0x452aa8?_0x452aa8[_0xfb13('0x19')](','):undefined);},'get':function(){return this[_0xfb13('0xe')](_0xfb13('0x1a'))?this[_0xfb13('0xe')](_0xfb13('0x1a'))[_0xfb13('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':'no','set':function(_0x3e8583){this['setDataValue'](_0xfb13('0x1c'),_0x3e8583?_0x3e8583[_0xfb13('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xfb13('0x1c'))?this[_0xfb13('0xe')](_0xfb13('0x1c'))[_0xfb13('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xfb13('0x16')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfb13('0x2')]},'acw':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':0x0,'set':function(_0x389388){this[_0xfb13('0xc')](_0xfb13('0x1e'),_0x389388);if(_0x389388){if(this[_0xfb13('0xe')](_0xfb13('0x1f'))<0x2){this['setDataValue'](_0xfb13('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xfb13('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':0x0,'comment':_0xfb13('0x20')},'dialMethod':{'type':Sequelize[_0xfb13('0x16')](_0xfb13('0x11'),'progressive',_0xfb13('0x21'),_0xfb13('0x22'),'booked'),'defaultValue':_0xfb13('0x23'),'comment':_0xfb13('0x24')},'dialLimitChannel':{'type':Sequelize[_0xfb13('0x14')](0x4)[_0xfb13('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfb13('0x26')},'dialLimitQueue':{'type':Sequelize[_0xfb13('0x14')](0x4)[_0xfb13('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xfb13('0x27')},'dialPowerLevel':{'type':Sequelize[_0xfb13('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xfb13('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xfb13('0x2a'),_0xfb13('0x2b')),'defaultValue':_0xfb13('0x2b'),'comment':_0xfb13('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xfb13('0x28')](0x2)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xfb13('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xfb13('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfb13('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xfb13('0x30'),'comment':_0xfb13('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x32')},'dialQueueProject':{'type':Sequelize[_0xfb13('0x2')],'comment':_0xfb13('0x33')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb13('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xfb13('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb13('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfb13('0x39')},'dialTimezone':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfb13('0x2')],'defaultValue':_0xfb13('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never','onlyIfOpen'),'defaultValue':_0xfb13('0x3b')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfb13('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xfb13('0x14')](0x9)[_0xfb13('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfb13('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfb13('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xfb13('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb13('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xfb13('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfb13('0x14')](0x9)[_0xfb13('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfb13('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfb13('0x14')](0x9)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfb13('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfb13('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfb13('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfb13('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xfb13('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xfb13('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xfb13('0x44'),'ASC'),'defaultValue':_0xfb13('0x44')},'dialQueueProject2':{'type':Sequelize[_0xfb13('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfb13('0x45')},'dialCutDigit':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb13('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xfb13('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfb13('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfb13('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfb13('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfb13('0x14')](0x5)[_0xfb13('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xfb13('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':![],'comment':_0xfb13('0x4c'),'set':function(_0x9a465){if(!_0x9a465)this[_0xfb13('0xc')](_0xfb13('0x4d'),null);this['setDataValue'](_0xfb13('0x4e'),_0x9a465);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xfb13('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xfb13('0x14')](0x3)[_0xfb13('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xfb13('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xfb13('0x1d')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 3409e20..4eff747 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 _0xf494=['select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','online','format','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','VoiceQueues','inbound','filter','ignore','value','includes','find','type','UserProfileResource','destroy','end','error','stack','name','send','map','VoiceQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','QueueCampaigns','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','SIP/%s','emit','userVoiceQueue:save','ids'];(function(_0x3d3817,_0x5d0b91){var _0x4f23ce=function(_0x174457){while(--_0x174457){_0x3d3817['push'](_0x3d3817['shift']());}};_0x4f23ce(++_0x5d0b91);}(_0xf494,0x1c6));var _0x4f49=function(_0x1f0da2,_0xd6fd36){_0x1f0da2=_0x1f0da2-0x0;var _0x1dab45=_0xf494[_0x1f0da2];return _0x1dab45;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];config[_0x4f49('0x19')]=_['defaults'](config[_0x4f49('0x19')],{'host':_0x4f49('0x1a'),'port':0x18eb});var socket=require(_0x4f49('0x1b'))(new Redis(config[_0x4f49('0x19')]));require(_0x4f49('0x1c'))[_0x4f49('0x1d')](socket);function respondWithStatusCode(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xcc;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1e')](_0x5c373e);}return _0xfdb477[_0x4f49('0x1f')](_0x5c373e)['end']();};}function respondWithResult(_0x5bdfaf,_0x2f0a0d){_0x2f0a0d=_0x2f0a0d||0xc8;return function(_0x2ecaaa){if(_0x2ecaaa){return _0x5bdfaf[_0x4f49('0x1f')](_0x2f0a0d)['json'](_0x2ecaaa);}};}function respondWithFilteredResult(_0x1dccfd,_0x399be7){return function(_0x4e85df){if(_0x4e85df){var _0x49cdaf=typeof _0x399be7['offset']==='undefined'&&typeof _0x399be7['limit']===_0x4f49('0x20');var _0x1834f4=_0x4e85df[_0x4f49('0x21')];var _0x407042=_0x49cdaf?0x0:_0x399be7['offset'];var _0x416893=_0x49cdaf?_0x4e85df[_0x4f49('0x21')]:_0x399be7[_0x4f49('0x22')]+_0x399be7[_0x4f49('0x23')];var _0xea82f8;if(_0x416893>=_0x1834f4){_0x416893=_0x1834f4;_0xea82f8=0xc8;}else{_0xea82f8=0xce;}_0x1dccfd['status'](_0xea82f8);return _0x1dccfd[_0x4f49('0x24')](_0x4f49('0x25'),_0x407042+'-'+_0x416893+'/'+_0x1834f4)[_0x4f49('0x26')](_0x4e85df);}return null;};}function patchUpdates(_0x53b57d){return function(_0x40755e){try{jsonpatch[_0x4f49('0x27')](_0x40755e,_0x53b57d,!![]);}catch(_0x32ca7b){return BPromise[_0x4f49('0x28')](_0x32ca7b);}return _0x40755e[_0x4f49('0x29')]();};}function saveUpdates(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x2a')](_0x36187b)[_0x4f49('0x2b')](function(_0x4fedbb){return _0x4fedbb;});}return null;};}function removeEntity(_0x408552,_0x2c1519){return function(_0x35f8e0){if(_0x35f8e0){return _0x35f8e0['destroy']()[_0x4f49('0x2b')](function(){var _0x2eed1c=_0x35f8e0[_0x4f49('0x2c')]({'plain':!![]});var _0x148153=[{'name':_0x4f49('0x2d'),'value':_0x4f49('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x239f44=_(_0x148153)[_0x4f49('0x2f')](_0x4f49('0x30'))['map'](_0x4f49('0x31'))[_0x4f49('0x31')]();if(_[_0x4f49('0x32')](_0x239f44,_0x2eed1c['type'])){return;}var _0x4dd55a=_[_0x4f49('0x33')](_0x148153,[_0x4f49('0x31'),_0x2eed1c[_0x4f49('0x34')]])['name'];return db[_0x4f49('0x35')][_0x4f49('0x36')]({'where':{'type':_0x4dd55a,'resourceId':_0x2eed1c['id']}})[_0x4f49('0x2b')](function(){return _0x35f8e0;});})[_0x4f49('0x2b')](function(){_0x408552[_0x4f49('0x1f')](0xcc)[_0x4f49('0x37')]();});}};}function handleEntityNotFound(_0x32c066,_0x45ae19){return function(_0x1f38d3){if(!_0x1f38d3){_0x32c066[_0x4f49('0x1e')](0x194);}return _0x1f38d3;};}function handleError(_0x2291d4,_0xf65ac6){_0xf65ac6=_0xf65ac6||0x1f4;return function(_0x29ff83){logger[_0x4f49('0x38')](_0x29ff83[_0x4f49('0x39')]);if(_0x29ff83[_0x4f49('0x3a')]){delete _0x29ff83[_0x4f49('0x3a')];}_0x2291d4[_0x4f49('0x1f')](_0xf65ac6)[_0x4f49('0x3b')](_0x29ff83);};}exports['index']=function(_0x45d0d2,_0x46b7ba){var _0x24f568={},_0x1cb3cc={},_0x1c3af8={'count':0x0,'rows':[]};var _0x15e82b=_[_0x4f49('0x3c')](db[_0x4f49('0x3d')][_0x4f49('0x3e')],function(_0x338db8){return{'name':_0x338db8[_0x4f49('0x3f')],'type':_0x338db8[_0x4f49('0x34')][_0x4f49('0x40')]};});_0x1cb3cc['model']=_[_0x4f49('0x3c')](_0x15e82b,_0x4f49('0x3a'));_0x1cb3cc[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x45d0d2[_0x4f49('0x41')]);_0x1cb3cc[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x1cb3cc[_0x4f49('0x45')],_0x1cb3cc[_0x4f49('0x41')]);_0x24f568[_0x4f49('0x46')]=_[_0x4f49('0x44')](_0x1cb3cc[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x45d0d2[_0x4f49('0x41')]['fields']));_0x24f568[_0x4f49('0x46')]=_0x24f568[_0x4f49('0x46')]['length']?_0x24f568[_0x4f49('0x46')]:_0x1cb3cc[_0x4f49('0x45')];if(!_0x45d0d2['query'][_0x4f49('0x48')](_0x4f49('0x49'))){_0x24f568[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x45d0d2[_0x4f49('0x41')][_0x4f49('0x23')]);_0x24f568[_0x4f49('0x22')]=qs['offset'](_0x45d0d2['query']['offset']);}_0x24f568[_0x4f49('0x4a')]=qs[_0x4f49('0x4b')](_0x45d0d2[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x24f568[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x45d0d2[_0x4f49('0x41')],_0x1cb3cc[_0x4f49('0x43')]),_0x15e82b);if(_0x45d0d2['query']['filter']){_0x24f568[_0x4f49('0x4c')]=_[_0x4f49('0x4e')](_0x24f568[_0x4f49('0x4c')],{'$or':_['map'](_0x15e82b,function(_0x2d6b56){if(_0x2d6b56['type']!=='VIRTUAL'){var _0x146d55={};_0x146d55[_0x2d6b56[_0x4f49('0x3a')]]={'$like':'%'+_0x45d0d2[_0x4f49('0x41')]['filter']+'%'};return _0x146d55;}})});}_0x24f568=_[_0x4f49('0x4e')]({},_0x24f568,_0x45d0d2[_0x4f49('0x4f')]);var _0x5e9f60={'where':_0x24f568[_0x4f49('0x4c')]};return db['VoiceQueue'][_0x4f49('0x21')](_0x5e9f60)[_0x4f49('0x2b')](function(_0x133f39){_0x1c3af8['count']=_0x133f39;if(_0x45d0d2[_0x4f49('0x41')][_0x4f49('0x50')]){_0x24f568[_0x4f49('0x51')]=[{'all':!![]}];}return db[_0x4f49('0x3d')][_0x4f49('0x52')](_0x24f568);})[_0x4f49('0x2b')](function(_0xe66867){_0x1c3af8[_0x4f49('0x53')]=_0xe66867;return _0x1c3af8;})[_0x4f49('0x2b')](respondWithFilteredResult(_0x46b7ba,_0x24f568))[_0x4f49('0x54')](handleError(_0x46b7ba,null));};exports['show']=function(_0x26c222,_0x44bf1d){var _0x59997c={'raw':![],'where':{'id':_0x26c222['params']['id']}},_0x1b4a8e={};_0x1b4a8e[_0x4f49('0x45')]=_[_0x4f49('0x42')](db[_0x4f49('0x3d')][_0x4f49('0x3e')]);_0x1b4a8e['query']=_[_0x4f49('0x42')](_0x26c222[_0x4f49('0x41')]);_0x1b4a8e[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x1b4a8e[_0x4f49('0x45')],_0x1b4a8e[_0x4f49('0x41')]);_0x59997c[_0x4f49('0x46')]=_[_0x4f49('0x44')](_0x1b4a8e[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x26c222[_0x4f49('0x41')][_0x4f49('0x47')]));_0x59997c[_0x4f49('0x46')]=_0x59997c[_0x4f49('0x46')][_0x4f49('0x55')]?_0x59997c[_0x4f49('0x46')]:_0x1b4a8e['model'];if(_0x26c222['query'][_0x4f49('0x50')]){_0x59997c[_0x4f49('0x51')]=[{'all':!![]}];}_0x59997c=_[_0x4f49('0x4e')]({},_0x59997c,_0x26c222[_0x4f49('0x4f')]);return db[_0x4f49('0x3d')][_0x4f49('0x33')](_0x59997c)[_0x4f49('0x2b')](handleEntityNotFound(_0x44bf1d,null))['then'](respondWithResult(_0x44bf1d,null))[_0x4f49('0x54')](handleError(_0x44bf1d,null));};exports['create']=function(_0x468978,_0x55d849){return db[_0x4f49('0x3d')][_0x4f49('0x56')](_0x468978['body'],{})[_0x4f49('0x2b')](function(_0x5e75f5){var _0x52d18c=_0x468978[_0x4f49('0x57')][_0x4f49('0x2c')]({'plain':!![]});if(!_0x52d18c)throw new Error(_0x4f49('0x58'));if(_0x52d18c[_0x4f49('0x59')]==='user'){var _0x599c51=_0x5e75f5[_0x4f49('0x2c')]({'plain':!![]});var _0x291a45=[{'name':'VoiceQueues','value':_0x4f49('0x2e')},{'name':'QueueCampaigns','value':'outbound'}];var _0xf90696=_['find'](_0x291a45,[_0x4f49('0x31'),_0x599c51['type']])[_0x4f49('0x3a')];return db[_0x4f49('0x5a')][_0x4f49('0x33')]({'where':{'name':_0xf90696,'userProfileId':_0x52d18c[_0x4f49('0x5b')]},'raw':!![]})[_0x4f49('0x2b')](function(_0x66e23d){if(_0x66e23d&&_0x66e23d[_0x4f49('0x5c')]===0x0){return db[_0x4f49('0x35')]['create']({'name':_0x599c51[_0x4f49('0x3a')],'resourceId':_0x599c51['id'],'type':_0x66e23d['name'],'sectionId':_0x66e23d['id']},{})[_0x4f49('0x2b')](function(){return _0x5e75f5;});}else{return _0x5e75f5;}})[_0x4f49('0x54')](function(_0xc4fc6b){logger[_0x4f49('0x38')](_0x4f49('0x5d'),_0xc4fc6b);throw _0xc4fc6b;});}return _0x5e75f5;})[_0x4f49('0x2b')](respondWithResult(_0x55d849,0xc9))['catch'](handleError(_0x55d849,null));};exports[_0x4f49('0x5e')]=function(_0xd3689c,_0x5e3568){var _0x5d2b3c={'where':{'id':_0xd3689c[_0x4f49('0x5f')]['id']}},_0x121c04={};_0x121c04[_0x4f49('0x45')]=_[_0x4f49('0x42')](db[_0x4f49('0x3d')]['rawAttributes']);_0x5d2b3c[_0x4f49('0x46')]=_['intersection'](_0x121c04[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0xd3689c[_0x4f49('0x41')]['fields']));_0x5d2b3c[_0x4f49('0x46')]=_0x5d2b3c[_0x4f49('0x46')][_0x4f49('0x55')]?_0x5d2b3c[_0x4f49('0x46')]:_0x121c04['model'];if(_0xd3689c[_0x4f49('0x41')][_0x4f49('0x50')]){_0x5d2b3c['include']=[{'all':!![]}];}_0x5d2b3c=_[_0x4f49('0x4e')]({},_0x5d2b3c,_0xd3689c[_0x4f49('0x4f')]);return db[_0x4f49('0x3d')][_0x4f49('0x33')](_0x5d2b3c)[_0x4f49('0x2b')](handleEntityNotFound(_0x5e3568,null))[_0x4f49('0x2b')](function(_0x45ef98){if(_0x45ef98){var _0x30fc21=_0x45ef98['get']({'plain':!![]});_0x30fc21=qs[_0x4f49('0x60')](_0x30fc21,['id',_0x4f49('0x61'),_0x4f49('0x62')]);_0xd3689c[_0x4f49('0x63')]=_[_0x4f49('0x60')](_0xd3689c[_0x4f49('0x63')],['id',_0x4f49('0x61'),'updatedAt']);return db[_0x4f49('0x3d')]['create'](_[_0x4f49('0x4e')](_0x30fc21,_0xd3689c[_0x4f49('0x63')]),{'include':_0xd3689c[_0x4f49('0x41')][_0x4f49('0x50')]?[{'all':!![]}]:undefined})[_0x4f49('0x2b')](function(_0x3f2f3f){var _0x61a565=_0xd3689c[_0x4f49('0x57')][_0x4f49('0x2c')]({'plain':!![]});if(!_0x61a565)throw new Error(_0x4f49('0x58'));if(_0x61a565['role']===_0x4f49('0x57')){var _0x141554=_0x3f2f3f[_0x4f49('0x2c')]({'plain':!![]});var _0x2cdaa4=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x4f49('0x64'),'value':'outbound'}];var _0x30defd=_[_0x4f49('0x33')](_0x2cdaa4,[_0x4f49('0x31'),_0x141554[_0x4f49('0x34')]])[_0x4f49('0x3a')];return db[_0x4f49('0x5a')][_0x4f49('0x33')]({'where':{'name':_0x30defd,'userProfileId':_0x61a565[_0x4f49('0x5b')]},'raw':!![]})[_0x4f49('0x2b')](function(_0x3e9b47){if(_0x3e9b47&&_0x3e9b47[_0x4f49('0x5c')]===0x0){return db[_0x4f49('0x35')][_0x4f49('0x56')]({'name':_0x141554[_0x4f49('0x3a')],'resourceId':_0x141554['id'],'type':_0x3e9b47[_0x4f49('0x3a')],'sectionId':_0x3e9b47['id']},{})[_0x4f49('0x2b')](function(){return _0x3f2f3f;});}else{return _0x3f2f3f;}})[_0x4f49('0x54')](function(_0x753863){logger[_0x4f49('0x38')](_0x4f49('0x5d'),_0x753863);throw _0x753863;});}return _0x3f2f3f;});}})[_0x4f49('0x2b')](respondWithResult(_0x5e3568,0xc9))[_0x4f49('0x54')](handleError(_0x5e3568,null));};exports[_0x4f49('0x2a')]=function(_0x4683f8,_0x2d0990){if(_0x4683f8['body']['id']){delete _0x4683f8[_0x4f49('0x63')]['id'];}return db['VoiceQueue'][_0x4f49('0x33')]({'where':{'id':_0x4683f8[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x2d0990,null))[_0x4f49('0x2b')](saveUpdates(_0x4683f8[_0x4f49('0x63')],null))[_0x4f49('0x2b')](respondWithResult(_0x2d0990,null))[_0x4f49('0x54')](handleError(_0x2d0990,null));};exports[_0x4f49('0x36')]=function(_0x3ee01a,_0x541ac6){return db['VoiceQueue'][_0x4f49('0x33')]({'where':{'id':_0x3ee01a['params']['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x541ac6,null))[_0x4f49('0x2b')](removeEntity(_0x541ac6,null))[_0x4f49('0x54')](handleError(_0x541ac6,null));};exports[_0x4f49('0x65')]=function(_0x1fc88a,_0x5a8b1c,_0x4e0d42){var _0x285a1a={'raw':![],'where':{}};var _0x9931b3={};var _0x4bdd1b={'count':0x0,'rows':[]};return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x1fc88a['params']['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x5a8b1c,null))['then'](function(_0x121972){if(_0x121972){_0x9931b3[_0x4f49('0x45')]=_['keys'](db[_0x4f49('0x67')][_0x4f49('0x3e')]);_0x9931b3[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x1fc88a[_0x4f49('0x41')]);_0x9931b3[_0x4f49('0x43')]=_['intersection'](_0x9931b3[_0x4f49('0x45')],_0x9931b3['query']);_0x285a1a[_0x4f49('0x46')]=_['intersection'](_0x9931b3[_0x4f49('0x45')],qs['fields'](_0x1fc88a[_0x4f49('0x41')][_0x4f49('0x47')]));_0x285a1a[_0x4f49('0x46')]=_0x285a1a[_0x4f49('0x46')]['length']?_0x285a1a[_0x4f49('0x46')]:_0x9931b3['model'];if(!_0x1fc88a[_0x4f49('0x41')]['hasOwnProperty'](_0x4f49('0x49'))){_0x285a1a['limit']=qs['limit'](_0x1fc88a[_0x4f49('0x41')][_0x4f49('0x23')]);_0x285a1a[_0x4f49('0x22')]=qs['offset'](_0x1fc88a[_0x4f49('0x41')][_0x4f49('0x22')]);}_0x285a1a['order']=qs['sort'](_0x1fc88a['query'][_0x4f49('0x4b')]);_0x285a1a[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x1fc88a[_0x4f49('0x41')],_0x9931b3['filters']));_0x285a1a[_0x4f49('0x4c')][_0x4f49('0x68')]=_0x121972['id'];if(_0x1fc88a[_0x4f49('0x41')]['filter']){_0x285a1a[_0x4f49('0x4c')]=_[_0x4f49('0x4e')](_0x285a1a[_0x4f49('0x4c')],{'$or':_[_0x4f49('0x3c')](_0x285a1a['attributes'],function(_0x249799){var _0xd8f5e2={};_0xd8f5e2[_0x249799]={'$like':'%'+_0x1fc88a[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0xd8f5e2;})});}_0x285a1a=_[_0x4f49('0x4e')]({},_0x285a1a,_0x1fc88a['options']);return db[_0x4f49('0x67')][_0x4f49('0x21')]({'where':_0x285a1a['where']})[_0x4f49('0x2b')](function(_0x52899d){_0x4bdd1b[_0x4f49('0x21')]=_0x52899d;if(_0x1fc88a['query'][_0x4f49('0x50')]){_0x285a1a[_0x4f49('0x51')]=[{'all':!![]}];}return db[_0x4f49('0x67')][_0x4f49('0x52')](_0x285a1a);})[_0x4f49('0x2b')](function(_0x538943){_0x4bdd1b[_0x4f49('0x53')]=_0x538943;return _0x4bdd1b;});}})[_0x4f49('0x2b')](respondWithFilteredResult(_0x5a8b1c,_0x285a1a))[_0x4f49('0x54')](handleError(_0x5a8b1c,null));};exports[_0x4f49('0x69')]=function(_0x4b7c61,_0xf37d6a,_0x499643){var _0x39d8d3={'raw':!![],'where':{}};var _0x59a5e9={};var _0x3066ee={'count':0x0,'rows':[]};return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x4b7c61[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0xf37d6a,null))[_0x4f49('0x2b')](function(_0x323a3a){if(_0x323a3a){_0x59a5e9[_0x4f49('0x45')]=_[_0x4f49('0x42')](db[_0x4f49('0x6a')]['rawAttributes']);_0x59a5e9[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x4b7c61[_0x4f49('0x41')]);_0x59a5e9[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x59a5e9[_0x4f49('0x45')],_0x59a5e9['query']);_0x39d8d3[_0x4f49('0x46')]=_[_0x4f49('0x44')](_0x59a5e9[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x4b7c61['query'][_0x4f49('0x47')]));_0x39d8d3['attributes']=_0x39d8d3[_0x4f49('0x46')][_0x4f49('0x55')]?_0x39d8d3[_0x4f49('0x46')]:_0x59a5e9[_0x4f49('0x45')];if(!_0x4b7c61['query'][_0x4f49('0x48')](_0x4f49('0x49'))){_0x39d8d3[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x4b7c61[_0x4f49('0x41')][_0x4f49('0x23')]);_0x39d8d3[_0x4f49('0x22')]=qs[_0x4f49('0x22')](_0x4b7c61[_0x4f49('0x41')][_0x4f49('0x22')]);}_0x39d8d3[_0x4f49('0x4a')]=qs[_0x4f49('0x4b')](_0x4b7c61[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x39d8d3[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x4b7c61[_0x4f49('0x41')],_0x59a5e9['filters']));_0x39d8d3[_0x4f49('0x4c')][_0x4f49('0x68')]=_0x323a3a['id'];if(_0x4b7c61[_0x4f49('0x41')][_0x4f49('0x2f')]){_0x39d8d3['where']=_[_0x4f49('0x4e')](_0x39d8d3[_0x4f49('0x4c')],{'$or':_['map'](_0x39d8d3[_0x4f49('0x46')],function(_0x57c86c){var _0xf6bc4c={};_0xf6bc4c[_0x57c86c]={'$like':'%'+_0x4b7c61[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0xf6bc4c;})});}_0x39d8d3=_[_0x4f49('0x4e')]({},_0x39d8d3,_0x4b7c61[_0x4f49('0x4f')]);return db[_0x4f49('0x6a')][_0x4f49('0x21')]({'where':_0x39d8d3[_0x4f49('0x4c')]})[_0x4f49('0x2b')](function(_0x322284){_0x3066ee['count']=_0x322284;if(_0x4b7c61['query'][_0x4f49('0x50')]){_0x39d8d3['include']=[{'all':!![]}];}return db[_0x4f49('0x6a')][_0x4f49('0x52')](_0x39d8d3);})['then'](function(_0x49dc5d){_0x3066ee[_0x4f49('0x53')]=_0x49dc5d;return _0x3066ee;});}})['then'](respondWithFilteredResult(_0xf37d6a,_0x39d8d3))[_0x4f49('0x54')](handleError(_0xf37d6a,null));};exports[_0x4f49('0x6b')]=function(_0x194274,_0x502cd9,_0xcdae95){var _0x5e3cd2={'raw':!![],'where':{}};var _0x17140e={};var _0x392f27={'count':0x0,'rows':[]};return db[_0x4f49('0x3d')]['findOne']({'where':{'id':_0x194274[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x502cd9,null))[_0x4f49('0x2b')](function(_0x4a1ef3){if(_0x4a1ef3){_0x17140e['model']=_[_0x4f49('0x42')](db['CmHopperFinal'][_0x4f49('0x3e')]);_0x17140e[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x194274['query']);_0x17140e[_0x4f49('0x43')]=_['intersection'](_0x17140e[_0x4f49('0x45')],_0x17140e[_0x4f49('0x41')]);_0x5e3cd2[_0x4f49('0x46')]=_['intersection'](_0x17140e[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x194274[_0x4f49('0x41')][_0x4f49('0x47')]));_0x5e3cd2[_0x4f49('0x46')]=_0x5e3cd2[_0x4f49('0x46')]['length']?_0x5e3cd2['attributes']:_0x17140e[_0x4f49('0x45')];if(!_0x194274[_0x4f49('0x41')][_0x4f49('0x48')](_0x4f49('0x49'))){_0x5e3cd2[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x194274[_0x4f49('0x41')][_0x4f49('0x23')]);_0x5e3cd2[_0x4f49('0x22')]=qs['offset'](_0x194274[_0x4f49('0x41')][_0x4f49('0x22')]);}_0x5e3cd2[_0x4f49('0x4a')]=qs['sort'](_0x194274[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x5e3cd2[_0x4f49('0x4c')]=qs['filters'](_[_0x4f49('0x4d')](_0x194274[_0x4f49('0x41')],_0x17140e[_0x4f49('0x43')]));_0x5e3cd2['where'][_0x4f49('0x68')]=_0x4a1ef3['id'];if(_0x194274[_0x4f49('0x41')][_0x4f49('0x2f')]){_0x5e3cd2['where']=_[_0x4f49('0x4e')](_0x5e3cd2[_0x4f49('0x4c')],{'$or':_[_0x4f49('0x3c')](_0x5e3cd2[_0x4f49('0x46')],function(_0x2ad13b){var _0x1b8ffc={};_0x1b8ffc[_0x2ad13b]={'$like':'%'+_0x194274['query']['filter']+'%'};return _0x1b8ffc;})});}_0x5e3cd2=_['merge']({},_0x5e3cd2,_0x194274[_0x4f49('0x4f')]);return db[_0x4f49('0x6c')]['count']({'where':_0x5e3cd2[_0x4f49('0x4c')]})[_0x4f49('0x2b')](function(_0x3f0f41){_0x392f27['count']=_0x3f0f41;if(_0x194274['query'][_0x4f49('0x50')]){_0x5e3cd2['include']=[{'all':!![]}];}return db[_0x4f49('0x6c')][_0x4f49('0x52')](_0x5e3cd2);})[_0x4f49('0x2b')](function(_0x2e3645){_0x392f27[_0x4f49('0x53')]=_0x2e3645;return _0x392f27;});}})['then'](respondWithFilteredResult(_0x502cd9,_0x5e3cd2))[_0x4f49('0x54')](handleError(_0x502cd9,null));};exports[_0x4f49('0x6d')]=function(_0x45c938,_0x9b23f6,_0x4a4d75){var _0x93e85d={'raw':!![],'where':{}};var _0x406d53={};var _0x5821a3={'count':0x0,'rows':[]};return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x45c938[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x9b23f6,null))[_0x4f49('0x2b')](function(_0x40991b){if(_0x40991b){_0x406d53['model']=_['keys'](db[_0x4f49('0x6e')][_0x4f49('0x3e')]);_0x406d53[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x45c938[_0x4f49('0x41')]);_0x406d53['filters']=_[_0x4f49('0x44')](_0x406d53['model'],_0x406d53[_0x4f49('0x41')]);_0x93e85d['attributes']=_['intersection'](_0x406d53[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x45c938[_0x4f49('0x41')][_0x4f49('0x47')]));_0x93e85d[_0x4f49('0x46')]=_0x93e85d[_0x4f49('0x46')][_0x4f49('0x55')]?_0x93e85d['attributes']:_0x406d53[_0x4f49('0x45')];if(!_0x45c938[_0x4f49('0x41')][_0x4f49('0x48')]('nolimit')){_0x93e85d[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x45c938[_0x4f49('0x41')]['limit']);_0x93e85d[_0x4f49('0x22')]=qs[_0x4f49('0x22')](_0x45c938[_0x4f49('0x41')][_0x4f49('0x22')]);}_0x93e85d[_0x4f49('0x4a')]=qs[_0x4f49('0x4b')](_0x45c938['query'][_0x4f49('0x4b')]);_0x93e85d[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x45c938[_0x4f49('0x41')],_0x406d53[_0x4f49('0x43')]));_0x93e85d[_0x4f49('0x4c')][_0x4f49('0x68')]=_0x40991b['id'];if(_0x45c938['query']['filter']){_0x93e85d[_0x4f49('0x4c')]=_[_0x4f49('0x4e')](_0x93e85d[_0x4f49('0x4c')],{'$or':_[_0x4f49('0x3c')](_0x93e85d[_0x4f49('0x46')],function(_0x29dbab){var _0x5f459b={};_0x5f459b[_0x29dbab]={'$like':'%'+_0x45c938[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0x5f459b;})});}_0x93e85d=_['merge']({},_0x93e85d,_0x45c938[_0x4f49('0x4f')]);return db[_0x4f49('0x6e')][_0x4f49('0x21')]({'where':_0x93e85d['where']})['then'](function(_0x1e2335){_0x5821a3[_0x4f49('0x21')]=_0x1e2335;if(_0x45c938[_0x4f49('0x41')]['includeAll']){_0x93e85d[_0x4f49('0x51')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4f49('0x52')](_0x93e85d);})['then'](function(_0x21eb75){_0x5821a3[_0x4f49('0x53')]=_0x21eb75;return _0x5821a3;});}})['then'](respondWithFilteredResult(_0x9b23f6,_0x93e85d))[_0x4f49('0x54')](handleError(_0x9b23f6,null));};exports[_0x4f49('0x6f')]=function(_0x513bc9,_0x937ce1,_0x47567c){var _0x5f1538={};var _0x2adeec={};var _0x3244a2;var _0x3de485;return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x513bc9[_0x4f49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x937ce1,null))[_0x4f49('0x2b')](function(_0x165289){if(_0x165289){_0x3244a2=_0x165289;_0x2adeec[_0x4f49('0x45')]=_['keys'](db[_0x4f49('0x70')][_0x4f49('0x3e')]);_0x2adeec[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x513bc9[_0x4f49('0x41')]);_0x2adeec[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x2adeec['model'],_0x2adeec[_0x4f49('0x41')]);_0x5f1538['attributes']=_['intersection'](_0x2adeec[_0x4f49('0x45')],qs['fields'](_0x513bc9[_0x4f49('0x41')][_0x4f49('0x47')]));_0x5f1538[_0x4f49('0x46')]=_0x5f1538[_0x4f49('0x46')][_0x4f49('0x55')]?_0x5f1538[_0x4f49('0x46')]:_0x2adeec['model'];_0x5f1538[_0x4f49('0x4a')]=qs[_0x4f49('0x4b')](_0x513bc9[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x5f1538[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x513bc9['query'],_0x2adeec[_0x4f49('0x43')]));if(_0x513bc9[_0x4f49('0x41')][_0x4f49('0x2f')]){_0x5f1538[_0x4f49('0x4c')]=_[_0x4f49('0x4e')](_0x5f1538[_0x4f49('0x4c')],{'$or':_[_0x4f49('0x3c')](_0x5f1538[_0x4f49('0x46')],function(_0x2c4a96){var _0x35c5f6={};_0x35c5f6[_0x2c4a96]={'$like':'%'+_0x513bc9[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0x35c5f6;})});}_0x5f1538=_['merge']({},_0x5f1538,_0x513bc9[_0x4f49('0x4f')]);return _0x3244a2[_0x4f49('0x6f')](_0x5f1538);}})['then'](function(_0x141f9a){if(_0x141f9a){_0x3de485=_0x141f9a[_0x4f49('0x55')];if(!_0x513bc9[_0x4f49('0x41')][_0x4f49('0x48')](_0x4f49('0x49'))){_0x5f1538[_0x4f49('0x23')]=qs['limit'](_0x513bc9['query']['limit']);_0x5f1538['offset']=qs[_0x4f49('0x22')](_0x513bc9['query'][_0x4f49('0x22')]);}return _0x3244a2[_0x4f49('0x6f')](_0x5f1538);}})[_0x4f49('0x2b')](function(_0x3215e3){if(_0x3215e3){return _0x3215e3?{'count':_0x3de485,'rows':_0x3215e3}:null;}})[_0x4f49('0x2b')](respondWithResult(_0x937ce1,null))[_0x4f49('0x54')](handleError(_0x937ce1,null));};exports['addTeams']=function(_0x29c17d,_0x528a0d,_0x21009f){var _0x10dc90=_0x29c17d['body']['teams'];var _0x576612=_['map'](_0x10dc90,'id');return db[_0x4f49('0x70')][_0x4f49('0x52')]({'where':{'id':_0x576612},'attributes':['id'],'include':[{'model':db[_0x4f49('0x71')],'as':_0x4f49('0x72'),'attributes':['id',_0x4f49('0x3a'),'online',_0x4f49('0x73'),_0x4f49('0x74')],'raw':!![]}]})[_0x4f49('0x2b')](function(_0x17d7f8){if(_0x17d7f8){var _0x35666e=_[_0x4f49('0x75')](_0x17d7f8,function(_0x2e7a84){var _0x8fcb7d=_0x2e7a84[_0x4f49('0x2c')]({'plain':!![]});_0x8fcb7d[_0x4f49('0x72')][_0x4f49('0x76')](function(_0x258900){_0x258900[_0x4f49('0x77')]=_[_0x4f49('0x33')](_0x10dc90,{'id':_0x8fcb7d['id']})[_0x4f49('0x77')];});return _0x8fcb7d[_0x4f49('0x72')];});return db['VoiceQueue'][_0x4f49('0x33')]({'where':{'id':_0x29c17d[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](function(_0x191422){return db[_0x4f49('0x78')][_0x4f49('0x79')](function(_0x3589ea){return _0x191422[_0x4f49('0x7a')](_0x576612,{'transaction':_0x3589ea})[_0x4f49('0x2b')](function(){return BPromise[_0x4f49('0x7b')](_0x10dc90,function(_0x266dfa){return db[_0x4f49('0x7c')][_0x4f49('0x7d')]({'TeamId':_0x266dfa['id'],'VoiceQueueId':_0x29c17d[_0x4f49('0x5f')]['id'],'penalty':_0x266dfa[_0x4f49('0x77')]},{'transaction':_0x3589ea});});})[_0x4f49('0x2b')](function(){return BPromise[_0x4f49('0x7b')](_0x35666e,function(_0x2d2566){return db[_0x4f49('0x7e')][_0x4f49('0x7f')]({'where':{'UserId':_0x2d2566['id'],'VoiceQueueId':_0x29c17d['params']['id']},'defaults':{'penalty':_0x2d2566[_0x4f49('0x77')]},'transaction':_0x3589ea});});})[_0x4f49('0x2b')](function(){return BPromise['each'](_[_0x4f49('0x2f')](_0x35666e,{'online':!![]}),function(_0x34719b){return db[_0x4f49('0x80')][_0x4f49('0x7d')]({'membername':_0x34719b[_0x4f49('0x3a')],'UserId':_0x34719b['id'],'queue_name':_0x191422[_0x4f49('0x3a')],'VoiceQueueId':_0x191422['id'],'interface':_[_0x4f49('0x81')](_0x34719b[_0x4f49('0x74')])?util['format'](_0x4f49('0x82'),_0x34719b['name']):_0x34719b[_0x4f49('0x74')],'paused':_0x34719b[_0x4f49('0x73')]||![],'penalty':_0x34719b['penalty']},{'transaction':_0x3589ea});});})['then'](function(){_0x35666e[_0x4f49('0x76')](function(_0x2c0dd5){socket[_0x4f49('0x83')](_0x4f49('0x84'),{'UserId':_0x2c0dd5['id'],'VoiceQueueId':_0x191422['id']});});});});});}})[_0x4f49('0x2b')](respondWithStatusCode(_0x528a0d,null))['catch'](handleError(_0x528a0d,null));};exports['removeTeams']=function(_0x455535,_0x28a6c3,_0x121a8e){return db[_0x4f49('0x70')][_0x4f49('0x52')]({'where':{'id':_0x455535[_0x4f49('0x41')][_0x4f49('0x85')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4f49('0x2b')](handleEntityNotFound(_0x28a6c3,null))[_0x4f49('0x2b')](function(_0x3d4846){var _0x1ac43b=_[_0x4f49('0x3c')](_0x3d4846,'id');var _0x5d6899=[];var _0x1e3e79=[];var _0x210637=squel[_0x4f49('0x86')]();_0x210637[_0x4f49('0x87')](_0x4f49('0x88'))[_0x4f49('0x89')](_0x4f49('0x8a'),'tq')[_0x4f49('0x8b')](_0x4f49('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4f49('0x4c')]('VoiceQueueId\x20=\x20?',_0x455535['params']['id']);for(var _0x4811ab=0x0;_0x4811ab<_0x3d4846['length'];_0x4811ab+=0x1){let _0x4e1bff=_0x3d4846[_0x4811ab];for(var _0x505f60=0x0;_0x505f60<_0x4e1bff[_0x4f49('0x72')][_0x4f49('0x55')];_0x505f60+=0x1){let _0x329d4b=_0x4e1bff['Agents'][_0x505f60];var _0x4d2e41=_0x210637[_0x4f49('0x5e')]();_0x4d2e41['where'](_0x4f49('0x8d'),_0x329d4b['id']);_0x1e3e79[_0x4f49('0x8e')](db[_0x4f49('0x78')]['query'](_0x4d2e41[_0x4f49('0x8f')](),{'type':db[_0x4f49('0x78')][_0x4f49('0x90')][_0x4f49('0x91')]})[_0x4f49('0x2b')](function(_0x339928){if(_0x339928[_0x4f49('0x55')]===0x1){return _0x329d4b['id'];}else{var _0x17eb43=_[_0x4f49('0x92')](_[_0x4f49('0x3c')](_0x339928,_0x4f49('0x93')),function(_0x20d696){return _['includes'](_0x1ac43b,_0x20d696);});if(_0x17eb43){return _0x329d4b['id'];}}}));}}return BPromise[_0x4f49('0x94')](_0x1e3e79)[_0x4f49('0x2b')](function(_0x5330fc){_0x5d6899=_(_0x5d6899)['union'](_0x5330fc)[_0x4f49('0x95')]()[_0x4f49('0x31')]();return db[_0x4f49('0x3d')][_0x4f49('0x33')]({'where':{'id':_0x455535[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](function(_0x41eb1f){return db[_0x4f49('0x78')][_0x4f49('0x79')](function(_0x53de39){return _0x41eb1f['removeTeams'](_0x455535[_0x4f49('0x41')][_0x4f49('0x85')],{'transaction':_0x53de39})[_0x4f49('0x2b')](function(){if(!_[_0x4f49('0x96')](_0x5d6899)){return _0x41eb1f['removeAgents'](_0x5d6899,{'transaction':_0x53de39})[_0x4f49('0x2b')](function(){return db['UserVoiceQueueRt'][_0x4f49('0x36')]({'where':{'VoiceQueueId':_0x455535['params']['id'],'UserId':_0x5d6899},'transaction':_0x53de39});});}})[_0x4f49('0x2b')](function(){_0x5d6899['forEach'](function(_0x29bdf3){socket[_0x4f49('0x83')](_0x4f49('0x97'),{'UserId':_0x29bdf3,'VoiceQueueId':_0x41eb1f['id']});});});});});});})[_0x4f49('0x2b')](respondWithStatusCode(_0x28a6c3,null))[_0x4f49('0x54')](handleError(_0x28a6c3,null));};exports['addAgents']=function(_0x24a109,_0x3c378b,_0x541ca5){var _0x50b15f,_0x1fb8cc;return db[_0x4f49('0x3d')][_0x4f49('0x33')]({'where':{'id':_0x24a109[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x3c378b,null))[_0x4f49('0x2b')](function(_0x1fc581){if(_0x1fc581){_0x1fb8cc=_0x1fc581;return _0x1fc581[_0x4f49('0x98')](_0x24a109['body'][_0x4f49('0x85')],_[_0x4f49('0x60')](_0x24a109['body'],['ids','id'])||{})[_0x4f49('0x99')](function(_0x4d42bc){for(var _0x57e532=0x0;_0x57e532<_0x24a109[_0x4f49('0x63')][_0x4f49('0x85')][_0x4f49('0x55')];_0x57e532+=0x1){socket[_0x4f49('0x83')](_0x4f49('0x84'),{'UserId':Number(_0x24a109[_0x4f49('0x63')][_0x4f49('0x85')][_0x57e532]),'VoiceQueueId':Number(_0x24a109[_0x4f49('0x5f')]['id'])});}return _0x4d42bc;});}})['then'](function(_0x3e9be3){_0x50b15f=_0x3e9be3||[];if(_0x1fb8cc){return db['User'][_0x4f49('0x52')]({'where':{'id':_0x24a109['body']['ids']},'attributes':['id','name',_0x4f49('0x9a'),'voicePause',_0x4f49('0x74')],'raw':!![]});}})['then'](function(_0x5273f8){if(!_['isEmpty'](_0x5273f8)){var _0x399133=[];for(var _0x5e7c68=0x0;_0x5e7c68<_0x5273f8[_0x4f49('0x55')];_0x5e7c68++){if(_0x5273f8[_0x5e7c68][_0x4f49('0x9a')]){_0x399133[_0x4f49('0x8e')](db['UserVoiceQueueRt'][_0x4f49('0x7d')]({'membername':_0x5273f8[_0x5e7c68]['name'],'UserId':_0x5273f8[_0x5e7c68]['id'],'queue_name':_0x1fb8cc[_0x4f49('0x3a')],'VoiceQueueId':_0x1fb8cc['id'],'interface':_['isNil'](_0x5273f8[_0x5e7c68][_0x4f49('0x74')])?util[_0x4f49('0x9b')](_0x4f49('0x82'),_0x5273f8[_0x5e7c68][_0x4f49('0x3a')]):_0x5273f8[_0x5e7c68][_0x4f49('0x74')],'paused':_0x5273f8[_0x5e7c68][_0x4f49('0x73')]||![],'penalty':_0x24a109[_0x4f49('0x63')][_0x4f49('0x77')]||0x0}));}}return BPromise[_0x4f49('0x94')](_0x399133);}})['then'](function(){return _0x50b15f;})[_0x4f49('0x2b')](respondWithResult(_0x3c378b,null))[_0x4f49('0x54')](handleError(_0x3c378b,null));};exports['removeAgents']=function(_0x4c788d,_0x2ec08b,_0x182851){return db[_0x4f49('0x3d')][_0x4f49('0x33')]({'where':{'id':_0x4c788d['params']['id']}})['then'](handleEntityNotFound(_0x2ec08b,null))['then'](function(_0x507c32){if(_0x507c32){return _0x507c32[_0x4f49('0x9c')](_0x4c788d[_0x4f49('0x41')]['ids'])[_0x4f49('0x2b')](function(){if(_[_0x4f49('0x9d')](_0x4c788d[_0x4f49('0x41')][_0x4f49('0x85')])){for(var _0x49b694=0x0;_0x49b694<_0x4c788d[_0x4f49('0x41')][_0x4f49('0x85')][_0x4f49('0x55')];_0x49b694+=0x1){socket['emit'](_0x4f49('0x97'),{'UserId':Number(_0x4c788d['query']['ids'][_0x49b694]),'VoiceQueueId':Number(_0x4c788d[_0x4f49('0x5f')]['id'])});}}else{socket[_0x4f49('0x83')](_0x4f49('0x97'),{'UserId':Number(_0x4c788d[_0x4f49('0x41')][_0x4f49('0x85')]),'VoiceQueueId':Number(_0x4c788d[_0x4f49('0x5f')]['id'])});}});}})[_0x4f49('0x2b')](function(_0xc77c28){return db['UserVoiceQueueRt'][_0x4f49('0x36')]({'where':{'VoiceQueueId':_0x4c788d[_0x4f49('0x5f')]['id'],'UserId':_0x4c788d[_0x4f49('0x41')][_0x4f49('0x85')]}})[_0x4f49('0x2b')](function(){return _0xc77c28;});})['then'](respondWithStatusCode(_0x2ec08b,null))[_0x4f49('0x54')](handleError(_0x2ec08b,null));};exports[_0x4f49('0x9e')]=function(_0x262e48,_0x2c72f7,_0x2a35e4){var _0xd8e45e={};var _0x9a949b={};var _0x9391db;var _0x55652e;return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x262e48[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x2c72f7,null))[_0x4f49('0x2b')](function(_0x202f13){if(_0x202f13){_0x9391db=_0x202f13;_0x9a949b[_0x4f49('0x45')]=_['keys'](db['User']['rawAttributes']);_0x9a949b[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x262e48['query']);_0x9a949b[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x9a949b[_0x4f49('0x45')],_0x9a949b['query']);_0xd8e45e['attributes']=_[_0x4f49('0x44')](_0x9a949b['model'],qs['fields'](_0x262e48[_0x4f49('0x41')][_0x4f49('0x47')]));_0xd8e45e['attributes']=_0xd8e45e[_0x4f49('0x46')][_0x4f49('0x55')]?_0xd8e45e[_0x4f49('0x46')]:_0x9a949b[_0x4f49('0x45')];_0xd8e45e['order']=qs[_0x4f49('0x4b')](_0x262e48[_0x4f49('0x41')]['sort']);_0xd8e45e[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_['pick'](_0x262e48[_0x4f49('0x41')],_0x9a949b[_0x4f49('0x43')]));if(_0x262e48[_0x4f49('0x41')][_0x4f49('0x2f')]){_0xd8e45e['where']=_[_0x4f49('0x4e')](_0xd8e45e['where'],{'$or':_[_0x4f49('0x3c')](_0xd8e45e[_0x4f49('0x46')],function(_0x59f33d){var _0x1b6d6e={};_0x1b6d6e[_0x59f33d]={'$like':'%'+_0x262e48[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0x1b6d6e;})});}_0xd8e45e=_[_0x4f49('0x4e')]({},_0xd8e45e,_0x262e48[_0x4f49('0x4f')]);return _0x9391db[_0x4f49('0x9e')](_0xd8e45e);}})[_0x4f49('0x2b')](function(_0x5b0d96){if(_0x5b0d96){_0x55652e=_0x5b0d96[_0x4f49('0x55')];if(!_0x262e48[_0x4f49('0x41')][_0x4f49('0x48')](_0x4f49('0x49'))){_0xd8e45e[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x262e48[_0x4f49('0x41')]['limit']);_0xd8e45e[_0x4f49('0x22')]=qs[_0x4f49('0x22')](_0x262e48[_0x4f49('0x41')][_0x4f49('0x22')]);}return _0x9391db['getAgents'](_0xd8e45e);}})[_0x4f49('0x2b')](function(_0x34a410){if(_0x34a410){return _0x34a410?{'count':_0x55652e,'rows':_0x34a410}:null;}})['then'](respondWithResult(_0x2c72f7,null))[_0x4f49('0x54')](handleError(_0x2c72f7,null));};exports[_0x4f49('0x9f')]=function(_0x51b65d,_0x1fd454,_0x51bbc1){var _0x110d4f={};var _0x59321e={};var _0xa43b94;var _0x155d43;return db[_0x4f49('0x3d')]['findOne']({'where':{'id':_0x51b65d[_0x4f49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1fd454,null))[_0x4f49('0x2b')](function(_0x53acc9){if(_0x53acc9){_0xa43b94=_0x53acc9;_0x59321e[_0x4f49('0x45')]=_[_0x4f49('0x42')](db['UserVoiceQueueRt'][_0x4f49('0x3e')]);_0x59321e[_0x4f49('0x41')]=_['keys'](_0x51b65d['query']);_0x59321e[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x59321e[_0x4f49('0x45')],_0x59321e[_0x4f49('0x41')]);_0x110d4f['attributes']=_[_0x4f49('0x44')](_0x59321e[_0x4f49('0x45')],qs['fields'](_0x51b65d[_0x4f49('0x41')][_0x4f49('0x47')]));_0x110d4f[_0x4f49('0x46')]=_0x110d4f[_0x4f49('0x46')][_0x4f49('0x55')]?_0x110d4f[_0x4f49('0x46')]:_0x59321e['model'];_0x110d4f[_0x4f49('0x4a')]=qs['sort'](_0x51b65d[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x110d4f[_0x4f49('0x4c')]=qs['filters'](_[_0x4f49('0x4d')](_0x51b65d[_0x4f49('0x41')],_0x59321e['filters']));if(_0x51b65d[_0x4f49('0x41')][_0x4f49('0x2f')]){_0x110d4f[_0x4f49('0x4c')]=_['merge'](_0x110d4f['where'],{'$or':_[_0x4f49('0x3c')](_0x110d4f[_0x4f49('0x46')],function(_0x5393fe){var _0x2f69c1={};_0x2f69c1[_0x5393fe]={'$like':'%'+_0x51b65d[_0x4f49('0x41')][_0x4f49('0x2f')]+'%'};return _0x2f69c1;})});}_0x110d4f=_[_0x4f49('0x4e')]({},_0x110d4f,_0x51b65d[_0x4f49('0x4f')]);return _0xa43b94[_0x4f49('0x9f')](_0x110d4f);}})['then'](function(_0x53085c){if(_0x53085c){_0x155d43=_0x53085c[_0x4f49('0x55')];if(!_0x51b65d['query'][_0x4f49('0x48')](_0x4f49('0x49'))){_0x110d4f['limit']=qs[_0x4f49('0x23')](_0x51b65d[_0x4f49('0x41')]['limit']);_0x110d4f[_0x4f49('0x22')]=qs[_0x4f49('0x22')](_0x51b65d[_0x4f49('0x41')][_0x4f49('0x22')]);}return _0xa43b94['getMembers'](_0x110d4f);}})['then'](function(_0x33b318){return _0x33b318?{'count':_0x155d43,'rows':_0x33b318}:null;})['then'](respondWithResult(_0x1fd454,null))[_0x4f49('0x54')](handleError(_0x1fd454,null));};exports[_0x4f49('0xa0')]=function(_0x5c0d18,_0x38bc04,_0xf9de4c){var _0x34cd2f={};var _0x2eb2e6={};var _0x129967;var _0x1c3f48;return db[_0x4f49('0x3d')]['findOne']({'where':{'id':_0x5c0d18['params']['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x38bc04,null))[_0x4f49('0x2b')](function(_0x294066){if(_0x294066){_0x129967=_0x294066;_0x2eb2e6[_0x4f49('0x45')]=_[_0x4f49('0x42')](db['CmList']['rawAttributes']);_0x2eb2e6[_0x4f49('0x41')]=_[_0x4f49('0x42')](_0x5c0d18[_0x4f49('0x41')]);_0x2eb2e6['filters']=_[_0x4f49('0x44')](_0x2eb2e6[_0x4f49('0x45')],_0x2eb2e6[_0x4f49('0x41')]);_0x34cd2f['attributes']=_[_0x4f49('0x44')](_0x2eb2e6[_0x4f49('0x45')],qs[_0x4f49('0x47')](_0x5c0d18[_0x4f49('0x41')][_0x4f49('0x47')]));_0x34cd2f[_0x4f49('0x46')]=_0x34cd2f['attributes'][_0x4f49('0x55')]?_0x34cd2f[_0x4f49('0x46')]:_0x2eb2e6[_0x4f49('0x45')];_0x34cd2f['order']=qs[_0x4f49('0x4b')](_0x5c0d18[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x34cd2f[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x5c0d18[_0x4f49('0x41')],_0x2eb2e6[_0x4f49('0x43')]));if(_0x5c0d18['query']['filter']){_0x34cd2f[_0x4f49('0x4c')]=_[_0x4f49('0x4e')](_0x34cd2f[_0x4f49('0x4c')],{'$or':_[_0x4f49('0x3c')](_0x34cd2f[_0x4f49('0x46')],function(_0x2a452b){var _0x1befc5={};_0x1befc5[_0x2a452b]={'$like':'%'+_0x5c0d18[_0x4f49('0x41')]['filter']+'%'};return _0x1befc5;})});}_0x34cd2f=_['merge']({},_0x34cd2f,_0x5c0d18[_0x4f49('0x4f')]);return _0x129967[_0x4f49('0xa0')](_0x34cd2f);}})['then'](function(_0x180155){if(_0x180155){_0x1c3f48=_0x180155[_0x4f49('0x55')];if(!_0x5c0d18[_0x4f49('0x41')][_0x4f49('0x48')]('nolimit')){_0x34cd2f[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x5c0d18['query']['limit']);_0x34cd2f[_0x4f49('0x22')]=qs[_0x4f49('0x22')](_0x5c0d18[_0x4f49('0x41')][_0x4f49('0x22')]);}return _0x129967[_0x4f49('0xa0')](_0x34cd2f);}})[_0x4f49('0x2b')](function(_0x5ba9e1){if(_0x5ba9e1){return _0x5ba9e1?{'count':_0x1c3f48,'rows':_0x5ba9e1}:null;}})[_0x4f49('0x2b')](respondWithResult(_0x38bc04,null))[_0x4f49('0x54')](handleError(_0x38bc04,null));};exports[_0x4f49('0xa1')]=function(_0x3cd4f4,_0x466c17,_0x13595f){var _0x355706=moment()[_0x4f49('0x9b')]('YYYY-MM-DD\x20HH:mm:ss');var _0xe83291,_0x5531ab;return db[_0x4f49('0x3d')]['find']({'where':{'id':_0x3cd4f4['params']['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x466c17,null))[_0x4f49('0x2b')](function(_0x2f9aac){if(_0x2f9aac){_0x5531ab=_0x2f9aac;return _0x2f9aac['addLists'](_0x3cd4f4[_0x4f49('0x63')][_0x4f49('0x85')],_['omit'](_0x3cd4f4['body'],[_0x4f49('0x85'),'id'])||{});}return null;})['spread'](function(_0x31806f){var _0x52ab86;_0xe83291=_0x31806f||[];var _0x301708=[];if(_0x31806f){for(var _0x2e5a53=0x0;_0x2e5a53<_0x31806f[_0x4f49('0x55')];_0x2e5a53+=0x1){var _0x1535b2=_0x31806f[_0x2e5a53]['get']({'plain':!![]});_0x5531ab['dialCheckDuplicateType']=_0x3cd4f4[_0x4f49('0x63')][_0x4f49('0xa2')]?_0x3cd4f4[_0x4f49('0x63')][_0x4f49('0xa2')]:_0x5531ab[_0x4f49('0xa2')];switch(_0x5531ab[_0x4f49('0xa2')]){case _0x4f49('0xa3'):_0x52ab86=squel[_0x4f49('0xa4')]()[_0x4f49('0xa5')](_0x4f49('0xa6'))[_0x4f49('0xa7')]([_0x4f49('0xa8'),'scheduledAt',_0x4f49('0xa9'),_0x4f49('0xaa'),_0x4f49('0x68'),_0x4f49('0x61'),'updatedAt'],squel[_0x4f49('0x86')]()[_0x4f49('0x87')](_0x4f49('0xa8'),_0x4f49('0xa8'))[_0x4f49('0x87')]('\x27'+_0x355706+'\x27',_0x4f49('0xab'))['field']('id',_0x4f49('0xa9'))[_0x4f49('0x87')](_0x1535b2[_0x4f49('0xac')]['toString'](),_0x4f49('0xaa'))['field'](_0x3cd4f4[_0x4f49('0x5f')]['id']['toString'](),_0x4f49('0x68'))['field']('\x27'+_0x355706+'\x27',_0x4f49('0x61'))[_0x4f49('0x87')]('\x27'+_0x355706+'\x27','updatedAt')[_0x4f49('0x89')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x4f49('0x4c')]('ListId\x20=\x20?',_0x1535b2[_0x4f49('0xac')][_0x4f49('0x8f')]())[_0x4f49('0x4c')](_0x4f49('0xad'))[_0x4f49('0x4c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4f49('0x86')]()[_0x4f49('0x87')]('COALESCE(calleridnum,\x27\x27)')[_0x4f49('0x89')](_0x4f49('0xae'))[_0x4f49('0x4c')](_0x4f49('0xaf'),_0x3cd4f4['params']['id'][_0x4f49('0x8f')]()))[_0x4f49('0x4c')](_0x4f49('0xb0'),squel['select']()[_0x4f49('0x87')](_0x4f49('0xb1'))[_0x4f49('0x89')](_0x4f49('0xa6'))[_0x4f49('0x4c')](_0x4f49('0xaf'),_0x3cd4f4[_0x4f49('0x5f')]['id']['toString']())))[_0x4f49('0x8f')]();break;case _0x4f49('0xb2'):_0x52ab86=squel['insert']()[_0x4f49('0xa5')](_0x4f49('0xa6'))[_0x4f49('0xa7')]([_0x4f49('0xa8'),_0x4f49('0xab'),_0x4f49('0xa9'),'ListId','VoiceQueueId',_0x4f49('0x61'),_0x4f49('0x62')],squel[_0x4f49('0x86')]()[_0x4f49('0x87')]('phone',_0x4f49('0xa8'))[_0x4f49('0x87')]('\x27'+_0x355706+'\x27','scheduledAt')[_0x4f49('0x87')]('id','ContactId')['field'](_0x1535b2['CmListId']['toString'](),'ListId')[_0x4f49('0x87')](_0x3cd4f4[_0x4f49('0x5f')]['id'][_0x4f49('0x8f')](),'VoiceQueueId')[_0x4f49('0x87')]('\x27'+_0x355706+'\x27',_0x4f49('0x61'))[_0x4f49('0x87')]('\x27'+_0x355706+'\x27',_0x4f49('0x62'))['from'](_0x4f49('0xb3'))['where'](_0x4f49('0xb4'))[_0x4f49('0x4c')](_0x4f49('0xb5'),_0x1535b2[_0x4f49('0xac')][_0x4f49('0x8f')]())[_0x4f49('0x4c')](_0x4f49('0xad'))[_0x4f49('0x4c')](_0x4f49('0xb0'),squel[_0x4f49('0x86')]()[_0x4f49('0x87')](_0x4f49('0xb1'))[_0x4f49('0x89')](_0x4f49('0xa6'))['where'](_0x4f49('0xaf'),_0x3cd4f4[_0x4f49('0x5f')]['id']['toString']())))['toString']();break;default:_0x52ab86=squel[_0x4f49('0xa4')]()[_0x4f49('0xa5')](_0x4f49('0xa6'))['fromQuery']([_0x4f49('0xa8'),_0x4f49('0xab'),_0x4f49('0xa9'),_0x4f49('0xaa'),_0x4f49('0x68'),_0x4f49('0x61'),_0x4f49('0x62')],squel['select']()[_0x4f49('0x87')](_0x4f49('0xa8'),_0x4f49('0xa8'))['field']('\x27'+_0x355706+'\x27',_0x4f49('0xab'))[_0x4f49('0x87')]('id',_0x4f49('0xa9'))[_0x4f49('0x87')](_0x1535b2['CmListId'][_0x4f49('0x8f')](),_0x4f49('0xaa'))[_0x4f49('0x87')](_0x3cd4f4[_0x4f49('0x5f')]['id']['toString'](),'VoiceQueueId')[_0x4f49('0x87')]('\x27'+_0x355706+'\x27',_0x4f49('0x61'))['field']('\x27'+_0x355706+'\x27',_0x4f49('0x62'))[_0x4f49('0x89')]('cm_contacts')[_0x4f49('0x4c')](_0x4f49('0xb4'))[_0x4f49('0x4c')](_0x4f49('0xb5'),_0x1535b2[_0x4f49('0xac')][_0x4f49('0x8f')]())[_0x4f49('0x4c')](_0x4f49('0xad')))[_0x4f49('0x8f')]();}_0x301708['push'](db[_0x4f49('0x78')][_0x4f49('0x41')](_0x52ab86));}return BPromise['all'](_0x301708);}})['then'](function(){var _0x50f9fb=[];var _0x58e59f=squel[_0x4f49('0xa4')]()['into'](_0x4f49('0xb6'))['fromQuery'](['CmHopperId','phone',_0x4f49('0xb7'),'createdAt',_0x4f49('0x62')],squel[_0x4f49('0x86')]()[_0x4f49('0x87')](_0x4f49('0xb8'))[_0x4f49('0x87')](_0x4f49('0xb9'))[_0x4f49('0x87')](_0x4f49('0xba'))[_0x4f49('0x87')]('\x27'+_0x355706+'\x27',_0x4f49('0x61'))['field']('\x27'+_0x355706+'\x27',_0x4f49('0x62'))[_0x4f49('0x89')](_0x4f49('0xbb'),'ci')[_0x4f49('0x8b')](_0x4f49('0xa6'),'h',_0x4f49('0xbc'))['where'](_0x4f49('0xbd'),_0x355706)[_0x4f49('0x4c')](_0x4f49('0xbe'),_0x4f49('0xbf')))[_0x4f49('0x8f')]();_0x50f9fb[_0x4f49('0x8e')](db['sequelize']['query'](_0x58e59f));return BPromise[_0x4f49('0x94')](_0x50f9fb);})['then'](function(){return _0xe83291;})[_0x4f49('0x2b')](respondWithResult(_0x466c17,null))[_0x4f49('0x54')](handleError(_0x466c17,null));};exports[_0x4f49('0xc0')]=function(_0x129a4e,_0x7662a8,_0xff744e){return db['VoiceQueue'][_0x4f49('0x33')]({'where':{'id':_0x129a4e[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x7662a8,null))[_0x4f49('0x2b')](function(_0x412fb7){if(_0x412fb7){return _0x412fb7[_0x4f49('0xc0')](_0x129a4e[_0x4f49('0x41')][_0x4f49('0x85')]);}})[_0x4f49('0x2b')](function(_0x1a958f){if(_0x1a958f){return db['CmHopper'][_0x4f49('0x36')]({'where':{'ListId':_0x129a4e[_0x4f49('0x41')][_0x4f49('0x85')],'VoiceQueueId':_0x129a4e[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](function(){return _0x1a958f;});}})[_0x4f49('0x2b')](respondWithStatusCode(_0x7662a8,null))[_0x4f49('0x54')](handleError(_0x7662a8,null));};exports[_0x4f49('0xc1')]=function(_0x506f63,_0x185d17,_0x45b047){var _0x5e9226={};var _0x4433dd={};var _0x326af9;var _0x23e8ed;return db[_0x4f49('0x3d')][_0x4f49('0x66')]({'where':{'id':_0x506f63[_0x4f49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x185d17,null))[_0x4f49('0x2b')](function(_0x10938f){if(_0x10938f){_0x326af9=_0x10938f;_0x4433dd[_0x4f49('0x45')]=_[_0x4f49('0x42')](db['CmList'][_0x4f49('0x3e')]);_0x4433dd['query']=_[_0x4f49('0x42')](_0x506f63[_0x4f49('0x41')]);_0x4433dd[_0x4f49('0x43')]=_[_0x4f49('0x44')](_0x4433dd[_0x4f49('0x45')],_0x4433dd[_0x4f49('0x41')]);_0x5e9226[_0x4f49('0x46')]=_[_0x4f49('0x44')](_0x4433dd['model'],qs[_0x4f49('0x47')](_0x506f63[_0x4f49('0x41')][_0x4f49('0x47')]));_0x5e9226[_0x4f49('0x46')]=_0x5e9226['attributes']['length']?_0x5e9226[_0x4f49('0x46')]:_0x4433dd[_0x4f49('0x45')];_0x5e9226[_0x4f49('0x4a')]=qs['sort'](_0x506f63[_0x4f49('0x41')][_0x4f49('0x4b')]);_0x5e9226[_0x4f49('0x4c')]=qs[_0x4f49('0x43')](_[_0x4f49('0x4d')](_0x506f63[_0x4f49('0x41')],_0x4433dd[_0x4f49('0x43')]));if(_0x506f63[_0x4f49('0x41')][_0x4f49('0x2f')]){_0x5e9226['where']=_['merge'](_0x5e9226['where'],{'$or':_['map'](_0x5e9226[_0x4f49('0x46')],function(_0x211f9b){var _0x487c37={};_0x487c37[_0x211f9b]={'$like':'%'+_0x506f63['query']['filter']+'%'};return _0x487c37;})});}_0x5e9226=_[_0x4f49('0x4e')]({},_0x5e9226,_0x506f63[_0x4f49('0x4f')]);return _0x326af9[_0x4f49('0xc1')](_0x5e9226);}})[_0x4f49('0x2b')](function(_0x13eeaa){if(_0x13eeaa){_0x23e8ed=_0x13eeaa[_0x4f49('0x55')];if(!_0x506f63['query'][_0x4f49('0x48')](_0x4f49('0x49'))){_0x5e9226[_0x4f49('0x23')]=qs[_0x4f49('0x23')](_0x506f63['query'][_0x4f49('0x23')]);_0x5e9226['offset']=qs[_0x4f49('0x22')](_0x506f63[_0x4f49('0x41')]['offset']);}return _0x326af9['getBlackLists'](_0x5e9226);}})['then'](function(_0x4adab1){if(_0x4adab1){return _0x4adab1?{'count':_0x23e8ed,'rows':_0x4adab1}:null;}})[_0x4f49('0x2b')](respondWithResult(_0x185d17,null))[_0x4f49('0x54')](handleError(_0x185d17,null));};exports[_0x4f49('0xc2')]=function(_0x4f7254,_0x1f319d,_0x5a2a1c){var _0x49ab7e,_0x364c0e;return db[_0x4f49('0x3d')]['find']({'where':{'id':_0x4f7254['params']['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x1f319d,null))[_0x4f49('0x2b')](function(_0x166635){if(_0x166635){_0x364c0e=_0x166635;return _0x166635['addBlackLists'](_0x4f7254[_0x4f49('0x63')][_0x4f49('0x85')],_[_0x4f49('0x60')](_0x4f7254[_0x4f49('0x63')],[_0x4f49('0x85'),'id'])||{});}return null;})[_0x4f49('0x99')](function(_0x32a96e){var _0x2c52b2;_0x49ab7e=_0x32a96e||[];var _0x5f1417=[];if(_0x32a96e){for(var _0x5791b6=0x0;_0x5791b6<_0x32a96e[_0x4f49('0x55')];_0x5791b6+=0x1){var _0x3529d6=_0x32a96e[_0x5791b6][_0x4f49('0x2c')]({'plain':!![]});_0x2c52b2=squel[_0x4f49('0xa4')]()[_0x4f49('0xa5')]('cm_hopper_black')['fromQuery']([_0x4f49('0xa8'),_0x4f49('0xa9'),_0x4f49('0xaa'),_0x4f49('0x68'),'createdAt',_0x4f49('0x62')],squel[_0x4f49('0x86')]()[_0x4f49('0x87')](_0x4f49('0xa8'),'phone')[_0x4f49('0x87')]('id',_0x4f49('0xa9'))['field'](_0x3529d6['CmListId'][_0x4f49('0x8f')](),_0x4f49('0xaa'))[_0x4f49('0x87')](_0x4f7254['params']['id'][_0x4f49('0x8f')](),_0x4f49('0x68'))[_0x4f49('0x87')]('NOW()',_0x4f49('0x61'))[_0x4f49('0x87')]('NOW()','updatedAt')['from'](_0x4f49('0xb3'))['where'](_0x4f49('0xb4'))[_0x4f49('0x4c')]('ListId\x20=\x20?',_0x3529d6[_0x4f49('0xac')][_0x4f49('0x8f')]())[_0x4f49('0x4c')](_0x4f49('0xad')))[_0x4f49('0x8f')]();_0x5f1417[_0x4f49('0x8e')](db['sequelize'][_0x4f49('0x41')](_0x2c52b2));}return BPromise[_0x4f49('0x94')](_0x5f1417);}})['then'](function(){return _0x49ab7e;})[_0x4f49('0x2b')](respondWithResult(_0x1f319d,null))[_0x4f49('0x54')](handleError(_0x1f319d,null));};exports[_0x4f49('0xc3')]=function(_0xfd9181,_0x3efdf6,_0x55e09d){return db[_0x4f49('0x3d')][_0x4f49('0x33')]({'where':{'id':_0xfd9181[_0x4f49('0x5f')]['id']}})[_0x4f49('0x2b')](handleEntityNotFound(_0x3efdf6,null))['then'](function(_0x383521){if(_0x383521){return _0x383521[_0x4f49('0xc3')](_0xfd9181[_0x4f49('0x41')][_0x4f49('0x85')]);}})[_0x4f49('0x2b')](function(_0x17e055){if(_0x17e055){return db[_0x4f49('0x6e')]['destroy']({'where':{'ListId':_0xfd9181[_0x4f49('0x41')]['ids'],'VoiceQueueId':_0xfd9181[_0x4f49('0x5f')]['id']}})['then'](function(){return _0x17e055;});}})['then'](respondWithStatusCode(_0x3efdf6,null))[_0x4f49('0x54')](handleError(_0x3efdf6,null));}; \ No newline at end of file +var _0x202a=['addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','path','sox','fs-extra','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','VoiceQueue','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','catch','create','body','get','user','VoiceQueues','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','VoiceQueueId','CmHopperBlack','getTeams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','addTeams','each','TeamVoiceQueue','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','spread','online','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','createdAt','select','CmListId','ListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','ContactId','fromQuery','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists'];(function(_0x3cb1ef,_0x2fc330){var _0x356656=function(_0x4ea372){while(--_0x4ea372){_0x3cb1ef['push'](_0x3cb1ef['shift']());}};_0x356656(++_0x2fc330);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa202('0x0'));var zipdir=require(_0xa202('0x1'));var jsonpatch=require(_0xa202('0x2'));var rp=require('request-promise');var moment=require(_0xa202('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa202('0x4'));var sox=require(_0xa202('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa202('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa202('0x7'));var deskjs=require(_0xa202('0x8'));var toCsv=require(_0xa202('0x9'));var querystring=require(_0xa202('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa202('0xb'));var qs=require(_0xa202('0xc'));var as=require(_0xa202('0xd'));var hardwareService=require(_0xa202('0xe'));var logger=require('../../config/logger')(_0xa202('0xf'));var utils=require('../../config/utils');var config=require(_0xa202('0x10'));var licenseUtil=require(_0xa202('0x11'));var db=require(_0xa202('0x12'))['db'];config['redis']=_[_0xa202('0x13')](config[_0xa202('0x14')],{'host':_0xa202('0x15'),'port':0x18eb});var socket=require(_0xa202('0x16'))(new Redis(config[_0xa202('0x14')]));require(_0xa202('0x17'))['register'](socket);function respondWithStatusCode(_0x13510c,_0x3b3ec9){_0x3b3ec9=_0x3b3ec9||0xcc;return function(_0x3880ad){if(_0x3880ad){return _0x13510c[_0xa202('0x18')](_0x3b3ec9);}return _0x13510c[_0xa202('0x19')](_0x3b3ec9)['end']();};}function respondWithResult(_0x331df8,_0x30b18b){_0x30b18b=_0x30b18b||0xc8;return function(_0x1221a2){if(_0x1221a2){return _0x331df8[_0xa202('0x19')](_0x30b18b)[_0xa202('0x1a')](_0x1221a2);}};}function respondWithFilteredResult(_0x214a08,_0x5d348c){return function(_0x44a1b6){if(_0x44a1b6){var _0x53ff78=typeof _0x5d348c[_0xa202('0x1b')]==='undefined'&&typeof _0x5d348c[_0xa202('0x1c')]===_0xa202('0x1d');var _0x130c45=_0x44a1b6[_0xa202('0x1e')];var _0x391e82=_0x53ff78?0x0:_0x5d348c['offset'];var _0x1da0e2=_0x53ff78?_0x44a1b6[_0xa202('0x1e')]:_0x5d348c[_0xa202('0x1b')]+_0x5d348c[_0xa202('0x1c')];var _0x188195;if(_0x1da0e2>=_0x130c45){_0x1da0e2=_0x130c45;_0x188195=0xc8;}else{_0x188195=0xce;}_0x214a08['status'](_0x188195);return _0x214a08[_0xa202('0x1f')](_0xa202('0x20'),_0x391e82+'-'+_0x1da0e2+'/'+_0x130c45)[_0xa202('0x1a')](_0x44a1b6);}return null;};}function patchUpdates(_0x44801a){return function(_0x5845f5){try{jsonpatch[_0xa202('0x21')](_0x5845f5,_0x44801a,!![]);}catch(_0x192d3c){return BPromise['reject'](_0x192d3c);}return _0x5845f5['save']();};}function saveUpdates(_0x7991c7,_0x2f5714){return function(_0x47ceb1){if(_0x47ceb1){return _0x47ceb1[_0xa202('0x22')](_0x7991c7)['then'](function(_0x5373b6){return _0x5373b6;});}return null;};}function removeEntity(_0x72fe3e,_0x268ee9){return function(_0x397553){if(_0x397553){return _0x397553[_0xa202('0x23')]()[_0xa202('0x24')](function(){var _0x1d6704=_0x397553['get']({'plain':!![]});var _0x571571=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0xa202('0x25'),'value':_0xa202('0x26'),'ignore':![]}];var _0x3db218=_(_0x571571)['filter'](_0xa202('0x27'))[_0xa202('0x28')](_0xa202('0x29'))[_0xa202('0x29')]();if(_[_0xa202('0x2a')](_0x3db218,_0x1d6704[_0xa202('0x2b')])){return;}var _0x41b09b=_[_0xa202('0x2c')](_0x571571,[_0xa202('0x29'),_0x1d6704[_0xa202('0x2b')]])[_0xa202('0x2d')];return db[_0xa202('0x2e')][_0xa202('0x23')]({'where':{'type':_0x41b09b,'resourceId':_0x1d6704['id']}})[_0xa202('0x24')](function(){return _0x397553;});})[_0xa202('0x24')](function(){_0x72fe3e[_0xa202('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x418ff0,_0x15eb0e){return function(_0x35ec2b){if(!_0x35ec2b){_0x418ff0[_0xa202('0x18')](0x194);}return _0x35ec2b;};}function handleError(_0x374590,_0x348544){_0x348544=_0x348544||0x1f4;return function(_0x4e7b0d){logger[_0xa202('0x2f')](_0x4e7b0d[_0xa202('0x30')]);if(_0x4e7b0d['name']){delete _0x4e7b0d[_0xa202('0x2d')];}_0x374590[_0xa202('0x19')](_0x348544)['send'](_0x4e7b0d);};}exports['index']=function(_0x59193d,_0x272cff){var _0x3d84a9={},_0x353014={},_0x18d13d={'count':0x0,'rows':[]};var _0x2c158c=_['map'](db[_0xa202('0x31')]['rawAttributes'],function(_0x2cb87a){return{'name':_0x2cb87a[_0xa202('0x32')],'type':_0x2cb87a[_0xa202('0x2b')]['key']};});_0x353014[_0xa202('0x33')]=_['map'](_0x2c158c,'name');_0x353014[_0xa202('0x34')]=_[_0xa202('0x35')](_0x59193d['query']);_0x353014[_0xa202('0x36')]=_['intersection'](_0x353014['model'],_0x353014[_0xa202('0x34')]);_0x3d84a9[_0xa202('0x37')]=_['intersection'](_0x353014[_0xa202('0x33')],qs[_0xa202('0x38')](_0x59193d[_0xa202('0x34')]['fields']));_0x3d84a9[_0xa202('0x37')]=_0x3d84a9[_0xa202('0x37')][_0xa202('0x39')]?_0x3d84a9[_0xa202('0x37')]:_0x353014[_0xa202('0x33')];if(!_0x59193d[_0xa202('0x34')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x3d84a9[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x59193d[_0xa202('0x34')][_0xa202('0x1c')]);_0x3d84a9['offset']=qs['offset'](_0x59193d[_0xa202('0x34')][_0xa202('0x1b')]);}_0x3d84a9[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x59193d[_0xa202('0x34')][_0xa202('0x3d')]);_0x3d84a9[_0xa202('0x3e')]=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x59193d[_0xa202('0x34')],_0x353014['filters']),_0x2c158c);if(_0x59193d[_0xa202('0x34')][_0xa202('0x40')]){_0x3d84a9['where']=_['merge'](_0x3d84a9['where'],{'$or':_[_0xa202('0x28')](_0x2c158c,function(_0x3dfeb5){if(_0x3dfeb5[_0xa202('0x2b')]!==_0xa202('0x41')){var _0x5035e2={};_0x5035e2[_0x3dfeb5[_0xa202('0x2d')]]={'$like':'%'+_0x59193d[_0xa202('0x34')][_0xa202('0x40')]+'%'};return _0x5035e2;}})});}_0x3d84a9=_[_0xa202('0x42')]({},_0x3d84a9,_0x59193d['options']);var _0x169a02={'where':_0x3d84a9[_0xa202('0x3e')]};return db[_0xa202('0x31')]['count'](_0x169a02)[_0xa202('0x24')](function(_0xaf38be){_0x18d13d[_0xa202('0x1e')]=_0xaf38be;if(_0x59193d[_0xa202('0x34')][_0xa202('0x43')]){_0x3d84a9[_0xa202('0x44')]=[{'all':!![]}];}return db[_0xa202('0x31')][_0xa202('0x45')](_0x3d84a9);})[_0xa202('0x24')](function(_0x1c7cd0){_0x18d13d[_0xa202('0x46')]=_0x1c7cd0;return _0x18d13d;})[_0xa202('0x24')](respondWithFilteredResult(_0x272cff,_0x3d84a9))['catch'](handleError(_0x272cff,null));};exports[_0xa202('0x47')]=function(_0x1dca0c,_0x2608a2){var _0x26c959={'raw':![],'where':{'id':_0x1dca0c[_0xa202('0x48')]['id']}},_0x40ba81={};_0x40ba81[_0xa202('0x33')]=_[_0xa202('0x35')](db['VoiceQueue'][_0xa202('0x49')]);_0x40ba81[_0xa202('0x34')]=_[_0xa202('0x35')](_0x1dca0c['query']);_0x40ba81[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x40ba81[_0xa202('0x33')],_0x40ba81['query']);_0x26c959[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x40ba81[_0xa202('0x33')],qs[_0xa202('0x38')](_0x1dca0c[_0xa202('0x34')][_0xa202('0x38')]));_0x26c959[_0xa202('0x37')]=_0x26c959[_0xa202('0x37')][_0xa202('0x39')]?_0x26c959[_0xa202('0x37')]:_0x40ba81[_0xa202('0x33')];if(_0x1dca0c['query'][_0xa202('0x43')]){_0x26c959[_0xa202('0x44')]=[{'all':!![]}];}_0x26c959=_[_0xa202('0x42')]({},_0x26c959,_0x1dca0c['options']);return db['VoiceQueue'][_0xa202('0x2c')](_0x26c959)[_0xa202('0x24')](handleEntityNotFound(_0x2608a2,null))['then'](respondWithResult(_0x2608a2,null))[_0xa202('0x4b')](handleError(_0x2608a2,null));};exports[_0xa202('0x4c')]=function(_0x52d64d,_0x218108){return db[_0xa202('0x31')][_0xa202('0x4c')](_0x52d64d[_0xa202('0x4d')],{})['then'](function(_0x205bf2){var _0x5de652=_0x52d64d['user'][_0xa202('0x4e')]({'plain':!![]});if(!_0x5de652)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5de652['role']===_0xa202('0x4f')){var _0x51953a=_0x205bf2['get']({'plain':!![]});var _0x172ec1=[{'name':_0xa202('0x50'),'value':_0xa202('0x51')},{'name':_0xa202('0x25'),'value':_0xa202('0x26')}];var _0x1e2b8=_[_0xa202('0x2c')](_0x172ec1,['value',_0x51953a[_0xa202('0x2b')]])[_0xa202('0x2d')];return db[_0xa202('0x52')][_0xa202('0x2c')]({'where':{'name':_0x1e2b8,'userProfileId':_0x5de652[_0xa202('0x53')]},'raw':!![]})[_0xa202('0x24')](function(_0xaea834){if(_0xaea834&&_0xaea834['autoAssociation']===0x0){return db[_0xa202('0x2e')][_0xa202('0x4c')]({'name':_0x51953a[_0xa202('0x2d')],'resourceId':_0x51953a['id'],'type':_0xaea834['name'],'sectionId':_0xaea834['id']},{})['then'](function(){return _0x205bf2;});}else{return _0x205bf2;}})['catch'](function(_0x43d1a5){logger[_0xa202('0x2f')](_0xa202('0x54'),_0x43d1a5);throw _0x43d1a5;});}return _0x205bf2;})[_0xa202('0x24')](respondWithResult(_0x218108,0xc9))[_0xa202('0x4b')](handleError(_0x218108,null));};exports[_0xa202('0x55')]=function(_0x3b1efe,_0x1f3677){var _0x42bb2f={'where':{'id':_0x3b1efe[_0xa202('0x48')]['id']}},_0x590ebe={};_0x590ebe['model']=_[_0xa202('0x35')](db[_0xa202('0x31')][_0xa202('0x49')]);_0x42bb2f[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x590ebe['model'],qs[_0xa202('0x38')](_0x3b1efe[_0xa202('0x34')]['fields']));_0x42bb2f[_0xa202('0x37')]=_0x42bb2f['attributes'][_0xa202('0x39')]?_0x42bb2f['attributes']:_0x590ebe['model'];if(_0x3b1efe[_0xa202('0x34')][_0xa202('0x43')]){_0x42bb2f[_0xa202('0x44')]=[{'all':!![]}];}_0x42bb2f=_[_0xa202('0x42')]({},_0x42bb2f,_0x3b1efe[_0xa202('0x56')]);return db['VoiceQueue']['find'](_0x42bb2f)['then'](handleEntityNotFound(_0x1f3677,null))[_0xa202('0x24')](function(_0x3a30b8){if(_0x3a30b8){var _0x22ea2e=_0x3a30b8[_0xa202('0x4e')]({'plain':!![]});_0x22ea2e=qs[_0xa202('0x57')](_0x22ea2e,['id','createdAt','updatedAt']);_0x3b1efe['body']=_[_0xa202('0x57')](_0x3b1efe[_0xa202('0x4d')],['id','createdAt',_0xa202('0x58')]);return db[_0xa202('0x31')]['create'](_['merge'](_0x22ea2e,_0x3b1efe[_0xa202('0x4d')]),{'include':_0x3b1efe['query'][_0xa202('0x43')]?[{'all':!![]}]:undefined})[_0xa202('0x24')](function(_0x72a8ca){var _0x4bf8f4=_0x3b1efe[_0xa202('0x4f')][_0xa202('0x4e')]({'plain':!![]});if(!_0x4bf8f4)throw new Error(_0xa202('0x59'));if(_0x4bf8f4['role']===_0xa202('0x4f')){var _0x392d76=_0x72a8ca[_0xa202('0x4e')]({'plain':!![]});var _0x1f7304=[{'name':'VoiceQueues','value':_0xa202('0x51')},{'name':_0xa202('0x25'),'value':'outbound'}];var _0x2d6cc0=_[_0xa202('0x2c')](_0x1f7304,['value',_0x392d76['type']])[_0xa202('0x2d')];return db[_0xa202('0x52')]['find']({'where':{'name':_0x2d6cc0,'userProfileId':_0x4bf8f4['userProfileId']},'raw':!![]})['then'](function(_0xf726e6){if(_0xf726e6&&_0xf726e6['autoAssociation']===0x0){return db[_0xa202('0x2e')][_0xa202('0x4c')]({'name':_0x392d76[_0xa202('0x2d')],'resourceId':_0x392d76['id'],'type':_0xf726e6[_0xa202('0x2d')],'sectionId':_0xf726e6['id']},{})[_0xa202('0x24')](function(){return _0x72a8ca;});}else{return _0x72a8ca;}})[_0xa202('0x4b')](function(_0x3c731c){logger[_0xa202('0x2f')](_0xa202('0x54'),_0x3c731c);throw _0x3c731c;});}return _0x72a8ca;});}})[_0xa202('0x24')](respondWithResult(_0x1f3677,0xc9))[_0xa202('0x4b')](handleError(_0x1f3677,null));};exports[_0xa202('0x22')]=function(_0x2d588b,_0x16dc6a){if(_0x2d588b[_0xa202('0x4d')]['id']){delete _0x2d588b[_0xa202('0x4d')]['id'];}return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x2d588b['params']['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x16dc6a,null))[_0xa202('0x24')](saveUpdates(_0x2d588b[_0xa202('0x4d')],null))['then'](respondWithResult(_0x16dc6a,null))['catch'](handleError(_0x16dc6a,null));};exports[_0xa202('0x23')]=function(_0x28ea4c,_0x210ff2){return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x28ea4c[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x210ff2,null))[_0xa202('0x24')](removeEntity(_0x210ff2,null))[_0xa202('0x4b')](handleError(_0x210ff2,null));};exports[_0xa202('0x5a')]=function(_0x12b81e,_0x2c9936,_0x874371){var _0x268914={'raw':![],'where':{}};var _0x573bd8={};var _0x1ff0db={'count':0x0,'rows':[]};return db[_0xa202('0x31')]['findOne']({'where':{'id':_0x12b81e[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x2c9936,null))['then'](function(_0x4afce1){if(_0x4afce1){_0x573bd8[_0xa202('0x33')]=_[_0xa202('0x35')](db['CmHopper'][_0xa202('0x49')]);_0x573bd8[_0xa202('0x34')]=_['keys'](_0x12b81e['query']);_0x573bd8[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x573bd8['model'],_0x573bd8[_0xa202('0x34')]);_0x268914['attributes']=_[_0xa202('0x4a')](_0x573bd8['model'],qs['fields'](_0x12b81e['query'][_0xa202('0x38')]));_0x268914[_0xa202('0x37')]=_0x268914[_0xa202('0x37')]['length']?_0x268914[_0xa202('0x37')]:_0x573bd8[_0xa202('0x33')];if(!_0x12b81e[_0xa202('0x34')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x268914[_0xa202('0x1c')]=qs['limit'](_0x12b81e[_0xa202('0x34')][_0xa202('0x1c')]);_0x268914[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x12b81e[_0xa202('0x34')][_0xa202('0x1b')]);}_0x268914[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x12b81e['query']['sort']);_0x268914[_0xa202('0x3e')]=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x12b81e['query'],_0x573bd8[_0xa202('0x36')]));_0x268914[_0xa202('0x3e')]['VoiceQueueId']=_0x4afce1['id'];if(_0x12b81e[_0xa202('0x34')][_0xa202('0x40')]){_0x268914[_0xa202('0x3e')]=_['merge'](_0x268914[_0xa202('0x3e')],{'$or':_['map'](_0x268914['attributes'],function(_0x163dc7){var _0x5d4a2b={};_0x5d4a2b[_0x163dc7]={'$like':'%'+_0x12b81e[_0xa202('0x34')][_0xa202('0x40')]+'%'};return _0x5d4a2b;})});}_0x268914=_[_0xa202('0x42')]({},_0x268914,_0x12b81e['options']);return db[_0xa202('0x5b')]['count']({'where':_0x268914['where']})[_0xa202('0x24')](function(_0x3f8607){_0x1ff0db['count']=_0x3f8607;if(_0x12b81e[_0xa202('0x34')][_0xa202('0x43')]){_0x268914[_0xa202('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xa202('0x45')](_0x268914);})[_0xa202('0x24')](function(_0x46b74d){_0x1ff0db[_0xa202('0x46')]=_0x46b74d;return _0x1ff0db;});}})[_0xa202('0x24')](respondWithFilteredResult(_0x2c9936,_0x268914))[_0xa202('0x4b')](handleError(_0x2c9936,null));};exports[_0xa202('0x5c')]=function(_0x446cdb,_0x5b1a30,_0x14a5db){var _0x57a47a={'raw':!![],'where':{}};var _0x5e9b75={};var _0x3c13c9={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x446cdb['params']['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x5b1a30,null))[_0xa202('0x24')](function(_0x406805){if(_0x406805){_0x5e9b75['model']=_[_0xa202('0x35')](db[_0xa202('0x5d')]['rawAttributes']);_0x5e9b75[_0xa202('0x34')]=_[_0xa202('0x35')](_0x446cdb['query']);_0x5e9b75[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x5e9b75['model'],_0x5e9b75['query']);_0x57a47a[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x5e9b75[_0xa202('0x33')],qs['fields'](_0x446cdb[_0xa202('0x34')][_0xa202('0x38')]));_0x57a47a['attributes']=_0x57a47a[_0xa202('0x37')][_0xa202('0x39')]?_0x57a47a[_0xa202('0x37')]:_0x5e9b75[_0xa202('0x33')];if(!_0x446cdb[_0xa202('0x34')][_0xa202('0x3a')]('nolimit')){_0x57a47a['limit']=qs[_0xa202('0x1c')](_0x446cdb[_0xa202('0x34')]['limit']);_0x57a47a['offset']=qs[_0xa202('0x1b')](_0x446cdb[_0xa202('0x34')][_0xa202('0x1b')]);}_0x57a47a[_0xa202('0x3c')]=qs['sort'](_0x446cdb[_0xa202('0x34')][_0xa202('0x3d')]);_0x57a47a[_0xa202('0x3e')]=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x446cdb[_0xa202('0x34')],_0x5e9b75[_0xa202('0x36')]));_0x57a47a[_0xa202('0x3e')]['VoiceQueueId']=_0x406805['id'];if(_0x446cdb['query'][_0xa202('0x40')]){_0x57a47a[_0xa202('0x3e')]=_['merge'](_0x57a47a['where'],{'$or':_['map'](_0x57a47a['attributes'],function(_0x312b7b){var _0x4fa0b3={};_0x4fa0b3[_0x312b7b]={'$like':'%'+_0x446cdb['query']['filter']+'%'};return _0x4fa0b3;})});}_0x57a47a=_[_0xa202('0x42')]({},_0x57a47a,_0x446cdb['options']);return db[_0xa202('0x5d')][_0xa202('0x1e')]({'where':_0x57a47a[_0xa202('0x3e')]})[_0xa202('0x24')](function(_0x2e4c31){_0x3c13c9[_0xa202('0x1e')]=_0x2e4c31;if(_0x446cdb[_0xa202('0x34')][_0xa202('0x43')]){_0x57a47a['include']=[{'all':!![]}];}return db[_0xa202('0x5d')][_0xa202('0x45')](_0x57a47a);})[_0xa202('0x24')](function(_0x2acf4b){_0x3c13c9[_0xa202('0x46')]=_0x2acf4b;return _0x3c13c9;});}})[_0xa202('0x24')](respondWithFilteredResult(_0x5b1a30,_0x57a47a))[_0xa202('0x4b')](handleError(_0x5b1a30,null));};exports[_0xa202('0x5e')]=function(_0x34e925,_0x30e8e2,_0x50eede){var _0x138203={'raw':!![],'where':{}};var _0x66b533={};var _0x3b7beb={'count':0x0,'rows':[]};return db[_0xa202('0x31')][_0xa202('0x5f')]({'where':{'id':_0x34e925[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x30e8e2,null))[_0xa202('0x24')](function(_0x14a022){if(_0x14a022){_0x66b533['model']=_[_0xa202('0x35')](db[_0xa202('0x60')]['rawAttributes']);_0x66b533['query']=_[_0xa202('0x35')](_0x34e925[_0xa202('0x34')]);_0x66b533[_0xa202('0x36')]=_['intersection'](_0x66b533['model'],_0x66b533[_0xa202('0x34')]);_0x138203[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x66b533[_0xa202('0x33')],qs['fields'](_0x34e925[_0xa202('0x34')][_0xa202('0x38')]));_0x138203[_0xa202('0x37')]=_0x138203[_0xa202('0x37')][_0xa202('0x39')]?_0x138203[_0xa202('0x37')]:_0x66b533[_0xa202('0x33')];if(!_0x34e925['query'][_0xa202('0x3a')](_0xa202('0x3b'))){_0x138203[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x34e925[_0xa202('0x34')][_0xa202('0x1c')]);_0x138203['offset']=qs[_0xa202('0x1b')](_0x34e925[_0xa202('0x34')][_0xa202('0x1b')]);}_0x138203[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x34e925['query'][_0xa202('0x3d')]);_0x138203[_0xa202('0x3e')]=qs[_0xa202('0x36')](_['pick'](_0x34e925[_0xa202('0x34')],_0x66b533['filters']));_0x138203['where']['VoiceQueueId']=_0x14a022['id'];if(_0x34e925[_0xa202('0x34')][_0xa202('0x40')]){_0x138203[_0xa202('0x3e')]=_[_0xa202('0x42')](_0x138203[_0xa202('0x3e')],{'$or':_[_0xa202('0x28')](_0x138203[_0xa202('0x37')],function(_0x49d70a){var _0x550e12={};_0x550e12[_0x49d70a]={'$like':'%'+_0x34e925[_0xa202('0x34')][_0xa202('0x40')]+'%'};return _0x550e12;})});}_0x138203=_[_0xa202('0x42')]({},_0x138203,_0x34e925[_0xa202('0x56')]);return db['CmHopperFinal'][_0xa202('0x1e')]({'where':_0x138203[_0xa202('0x3e')]})[_0xa202('0x24')](function(_0xca75e3){_0x3b7beb[_0xa202('0x1e')]=_0xca75e3;if(_0x34e925[_0xa202('0x34')][_0xa202('0x43')]){_0x138203['include']=[{'all':!![]}];}return db[_0xa202('0x60')][_0xa202('0x45')](_0x138203);})['then'](function(_0x2e202e){_0x3b7beb[_0xa202('0x46')]=_0x2e202e;return _0x3b7beb;});}})[_0xa202('0x24')](respondWithFilteredResult(_0x30e8e2,_0x138203))['catch'](handleError(_0x30e8e2,null));};exports[_0xa202('0x61')]=function(_0x17d530,_0x3fb37e,_0x4e368e){var _0x3221db={'raw':!![],'where':{}};var _0x1baf64={};var _0xe6afe9={'count':0x0,'rows':[]};return db[_0xa202('0x31')]['findOne']({'where':{'id':_0x17d530[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x3fb37e,null))[_0xa202('0x24')](function(_0x375558){if(_0x375558){_0x1baf64['model']=_['keys'](db['CmHopperBlack'][_0xa202('0x49')]);_0x1baf64[_0xa202('0x34')]=_[_0xa202('0x35')](_0x17d530[_0xa202('0x34')]);_0x1baf64[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x1baf64['model'],_0x1baf64[_0xa202('0x34')]);_0x3221db['attributes']=_[_0xa202('0x4a')](_0x1baf64[_0xa202('0x33')],qs['fields'](_0x17d530['query'][_0xa202('0x38')]));_0x3221db['attributes']=_0x3221db[_0xa202('0x37')]['length']?_0x3221db[_0xa202('0x37')]:_0x1baf64[_0xa202('0x33')];if(!_0x17d530['query'][_0xa202('0x3a')](_0xa202('0x3b'))){_0x3221db[_0xa202('0x1c')]=qs['limit'](_0x17d530[_0xa202('0x34')]['limit']);_0x3221db[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x17d530['query'][_0xa202('0x1b')]);}_0x3221db['order']=qs[_0xa202('0x3d')](_0x17d530[_0xa202('0x34')][_0xa202('0x3d')]);_0x3221db[_0xa202('0x3e')]=qs['filters'](_[_0xa202('0x3f')](_0x17d530['query'],_0x1baf64[_0xa202('0x36')]));_0x3221db[_0xa202('0x3e')][_0xa202('0x62')]=_0x375558['id'];if(_0x17d530[_0xa202('0x34')]['filter']){_0x3221db[_0xa202('0x3e')]=_[_0xa202('0x42')](_0x3221db[_0xa202('0x3e')],{'$or':_[_0xa202('0x28')](_0x3221db[_0xa202('0x37')],function(_0x1541ef){var _0x2dd649={};_0x2dd649[_0x1541ef]={'$like':'%'+_0x17d530['query'][_0xa202('0x40')]+'%'};return _0x2dd649;})});}_0x3221db=_['merge']({},_0x3221db,_0x17d530[_0xa202('0x56')]);return db[_0xa202('0x63')][_0xa202('0x1e')]({'where':_0x3221db[_0xa202('0x3e')]})[_0xa202('0x24')](function(_0x4990fd){_0xe6afe9[_0xa202('0x1e')]=_0x4990fd;if(_0x17d530[_0xa202('0x34')][_0xa202('0x43')]){_0x3221db[_0xa202('0x44')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x3221db);})[_0xa202('0x24')](function(_0x2bb5d9){_0xe6afe9[_0xa202('0x46')]=_0x2bb5d9;return _0xe6afe9;});}})[_0xa202('0x24')](respondWithFilteredResult(_0x3fb37e,_0x3221db))[_0xa202('0x4b')](handleError(_0x3fb37e,null));};exports[_0xa202('0x64')]=function(_0x160f24,_0x2e9e65,_0x3f2cc3){var _0x2d210d={};var _0x4f4b29={};var _0x12c9aa;var _0x540751;return db['VoiceQueue'][_0xa202('0x5f')]({'where':{'id':_0x160f24[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x2e9e65,null))['then'](function(_0x57f400){if(_0x57f400){_0x12c9aa=_0x57f400;_0x4f4b29['model']=_[_0xa202('0x35')](db[_0xa202('0x65')][_0xa202('0x49')]);_0x4f4b29[_0xa202('0x34')]=_[_0xa202('0x35')](_0x160f24[_0xa202('0x34')]);_0x4f4b29[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x4f4b29[_0xa202('0x33')],_0x4f4b29[_0xa202('0x34')]);_0x2d210d[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x4f4b29[_0xa202('0x33')],qs[_0xa202('0x38')](_0x160f24[_0xa202('0x34')][_0xa202('0x38')]));_0x2d210d['attributes']=_0x2d210d[_0xa202('0x37')][_0xa202('0x39')]?_0x2d210d[_0xa202('0x37')]:_0x4f4b29['model'];_0x2d210d[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x160f24[_0xa202('0x34')]['sort']);_0x2d210d[_0xa202('0x3e')]=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x160f24[_0xa202('0x34')],_0x4f4b29['filters']));if(_0x160f24[_0xa202('0x34')][_0xa202('0x40')]){_0x2d210d['where']=_[_0xa202('0x42')](_0x2d210d[_0xa202('0x3e')],{'$or':_[_0xa202('0x28')](_0x2d210d[_0xa202('0x37')],function(_0x2b4b8e){var _0x29d4ac={};_0x29d4ac[_0x2b4b8e]={'$like':'%'+_0x160f24[_0xa202('0x34')][_0xa202('0x40')]+'%'};return _0x29d4ac;})});}_0x2d210d=_[_0xa202('0x42')]({},_0x2d210d,_0x160f24[_0xa202('0x56')]);return _0x12c9aa['getTeams'](_0x2d210d);}})[_0xa202('0x24')](function(_0x4e1d37){if(_0x4e1d37){_0x540751=_0x4e1d37[_0xa202('0x39')];if(!_0x160f24[_0xa202('0x34')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x2d210d[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x160f24[_0xa202('0x34')][_0xa202('0x1c')]);_0x2d210d[_0xa202('0x1b')]=qs['offset'](_0x160f24[_0xa202('0x34')]['offset']);}return _0x12c9aa[_0xa202('0x64')](_0x2d210d);}})[_0xa202('0x24')](function(_0x101ca4){if(_0x101ca4){return _0x101ca4?{'count':_0x540751,'rows':_0x101ca4}:null;}})[_0xa202('0x24')](respondWithResult(_0x2e9e65,null))[_0xa202('0x4b')](handleError(_0x2e9e65,null));};exports['addTeams']=function(_0x18e727,_0x5a6bcd,_0x4816a3){var _0x5b5ae1=_0x18e727['body']['teams'];var _0x32964e=_[_0xa202('0x28')](_0x5b5ae1,'id');return db[_0xa202('0x65')]['findAll']({'where':{'id':_0x32964e},'attributes':['id'],'include':[{'model':db[_0xa202('0x66')],'as':_0xa202('0x67'),'attributes':['id',_0xa202('0x2d'),'online',_0xa202('0x68'),_0xa202('0x69')],'raw':!![]}]})['then'](function(_0x44a6bd){if(_0x44a6bd){var _0x164006=_[_0xa202('0x6a')](_0x44a6bd,function(_0xad51){var _0x3ab106=_0xad51['get']({'plain':!![]});_0x3ab106['Agents'][_0xa202('0x6b')](function(_0x1a42a8){_0x1a42a8[_0xa202('0x6c')]=_[_0xa202('0x2c')](_0x5b5ae1,{'id':_0x3ab106['id']})[_0xa202('0x6c')];});return _0x3ab106[_0xa202('0x67')];});return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x18e727[_0xa202('0x48')]['id']}})['then'](function(_0x59dcb6){return db['sequelize']['transaction'](function(_0x1303ed){return _0x59dcb6[_0xa202('0x6d')](_0x32964e,{'transaction':_0x1303ed})[_0xa202('0x24')](function(){return BPromise[_0xa202('0x6e')](_0x5b5ae1,function(_0x149bd0){return db[_0xa202('0x6f')]['upsert']({'TeamId':_0x149bd0['id'],'VoiceQueueId':_0x18e727['params']['id'],'penalty':_0x149bd0['penalty']},{'transaction':_0x1303ed});});})[_0xa202('0x24')](function(){return BPromise['each'](_0x164006,function(_0x84ef1c){return db[_0xa202('0x70')]['findOrCreate']({'where':{'UserId':_0x84ef1c['id'],'VoiceQueueId':_0x18e727['params']['id']},'defaults':{'penalty':_0x84ef1c[_0xa202('0x6c')]},'transaction':_0x1303ed});});})['then'](function(){return BPromise[_0xa202('0x6e')](_[_0xa202('0x40')](_0x164006,{'online':!![]}),function(_0x2d6ddb){return db[_0xa202('0x71')][_0xa202('0x72')]({'membername':_0x2d6ddb[_0xa202('0x2d')],'UserId':_0x2d6ddb['id'],'queue_name':_0x59dcb6[_0xa202('0x2d')],'VoiceQueueId':_0x59dcb6['id'],'interface':_[_0xa202('0x73')](_0x2d6ddb[_0xa202('0x69')])?util[_0xa202('0x74')](_0xa202('0x75'),_0x2d6ddb[_0xa202('0x2d')]):_0x2d6ddb[_0xa202('0x69')],'paused':_0x2d6ddb[_0xa202('0x68')]||![],'penalty':_0x2d6ddb[_0xa202('0x6c')]},{'transaction':_0x1303ed});});})['then'](function(){_0x164006[_0xa202('0x6b')](function(_0x3067f8){socket[_0xa202('0x76')](_0xa202('0x77'),{'UserId':_0x3067f8['id'],'VoiceQueueId':_0x59dcb6['id']});});});});});}})[_0xa202('0x24')](respondWithStatusCode(_0x5a6bcd,null))['catch'](handleError(_0x5a6bcd,null));};exports['removeTeams']=function(_0x356064,_0x2a7854,_0x2c045a){return db[_0xa202('0x65')][_0xa202('0x45')]({'where':{'id':_0x356064[_0xa202('0x34')][_0xa202('0x78')]},'attributes':['id'],'include':[{'model':db[_0xa202('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa202('0x24')](handleEntityNotFound(_0x2a7854,null))[_0xa202('0x24')](function(_0x236cc1){var _0x4718dd=_[_0xa202('0x28')](_0x236cc1,'id');var _0x725d6=[];var _0x5985f5=[];var _0x4c25ed=squel['select']();_0x4c25ed[_0xa202('0x79')](_0xa202('0x7a'))[_0xa202('0x7b')](_0xa202('0x7c'),'tq')[_0xa202('0x7d')](_0xa202('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa202('0x7f'),_0x356064['params']['id']);for(var _0x1377b2=0x0;_0x1377b2<_0x236cc1[_0xa202('0x39')];_0x1377b2+=0x1){let _0x300f69=_0x236cc1[_0x1377b2];for(var _0x1c818e=0x0;_0x1c818e<_0x300f69[_0xa202('0x67')][_0xa202('0x39')];_0x1c818e+=0x1){let _0x2026b2=_0x300f69[_0xa202('0x67')][_0x1c818e];var _0x30793d=_0x4c25ed[_0xa202('0x55')]();_0x30793d['where']('ut.UserId\x20=\x20?',_0x2026b2['id']);_0x5985f5[_0xa202('0x80')](db['sequelize'][_0xa202('0x34')](_0x30793d['toString'](),{'type':db[_0xa202('0x81')][_0xa202('0x82')][_0xa202('0x83')]})['then'](function(_0x2dfa73){if(_0x2dfa73[_0xa202('0x39')]===0x1){return _0x2026b2['id'];}else{var _0x402d29=_[_0xa202('0x84')](_[_0xa202('0x28')](_0x2dfa73,_0xa202('0x85')),function(_0x67467){return _[_0xa202('0x2a')](_0x4718dd,_0x67467);});if(_0x402d29){return _0x2026b2['id'];}}}));}}return BPromise[_0xa202('0x86')](_0x5985f5)[_0xa202('0x24')](function(_0x2c8dfd){_0x725d6=_(_0x725d6)[_0xa202('0x87')](_0x2c8dfd)['compact']()[_0xa202('0x29')]();return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x356064[_0xa202('0x48')]['id']}})[_0xa202('0x24')](function(_0x3e9ae9){return db['sequelize'][_0xa202('0x88')](function(_0x3d3d18){return _0x3e9ae9['removeTeams'](_0x356064['query'][_0xa202('0x78')],{'transaction':_0x3d3d18})[_0xa202('0x24')](function(){if(!_[_0xa202('0x89')](_0x725d6)){return _0x3e9ae9['removeAgents'](_0x725d6,{'transaction':_0x3d3d18})[_0xa202('0x24')](function(){return db[_0xa202('0x71')]['destroy']({'where':{'VoiceQueueId':_0x356064[_0xa202('0x48')]['id'],'UserId':_0x725d6},'transaction':_0x3d3d18});});}})[_0xa202('0x24')](function(){_0x725d6['forEach'](function(_0x180982){socket[_0xa202('0x76')](_0xa202('0x8a'),{'UserId':_0x180982,'VoiceQueueId':_0x3e9ae9['id']});});});});});});})[_0xa202('0x24')](respondWithStatusCode(_0x2a7854,null))[_0xa202('0x4b')](handleError(_0x2a7854,null));};exports[_0xa202('0x8b')]=function(_0x272f88,_0x5e2bed,_0x1d8550){var _0x468fa6,_0x4c8623;return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x272f88[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x5e2bed,null))[_0xa202('0x24')](function(_0x2eab60){if(_0x2eab60){_0x4c8623=_0x2eab60;return _0x2eab60[_0xa202('0x8b')](_0x272f88[_0xa202('0x4d')][_0xa202('0x78')],_[_0xa202('0x57')](_0x272f88['body'],[_0xa202('0x78'),'id'])||{})[_0xa202('0x8c')](function(_0x4875ef){for(var _0x5559b6=0x0;_0x5559b6<_0x272f88['body'][_0xa202('0x78')][_0xa202('0x39')];_0x5559b6+=0x1){socket[_0xa202('0x76')](_0xa202('0x77'),{'UserId':Number(_0x272f88[_0xa202('0x4d')][_0xa202('0x78')][_0x5559b6]),'VoiceQueueId':Number(_0x272f88[_0xa202('0x48')]['id'])});}return _0x4875ef;});}})[_0xa202('0x24')](function(_0x1e8ba5){_0x468fa6=_0x1e8ba5||[];if(_0x4c8623){return db[_0xa202('0x66')][_0xa202('0x45')]({'where':{'id':_0x272f88[_0xa202('0x4d')]['ids']},'attributes':['id',_0xa202('0x2d'),_0xa202('0x8d'),_0xa202('0x68'),_0xa202('0x69')],'raw':!![]});}})[_0xa202('0x24')](function(_0x4a95b4){if(!_[_0xa202('0x89')](_0x4a95b4)){var _0x37b8a0=[];for(var _0xf54860=0x0;_0xf54860<_0x4a95b4[_0xa202('0x39')];_0xf54860++){if(_0x4a95b4[_0xf54860]['online']){_0x37b8a0[_0xa202('0x80')](db[_0xa202('0x71')][_0xa202('0x72')]({'membername':_0x4a95b4[_0xf54860]['name'],'UserId':_0x4a95b4[_0xf54860]['id'],'queue_name':_0x4c8623[_0xa202('0x2d')],'VoiceQueueId':_0x4c8623['id'],'interface':_[_0xa202('0x73')](_0x4a95b4[_0xf54860][_0xa202('0x69')])?util[_0xa202('0x74')]('SIP/%s',_0x4a95b4[_0xf54860][_0xa202('0x2d')]):_0x4a95b4[_0xf54860][_0xa202('0x69')],'paused':_0x4a95b4[_0xf54860][_0xa202('0x68')]||![],'penalty':_0x272f88[_0xa202('0x4d')][_0xa202('0x6c')]||0x0}));}}return BPromise[_0xa202('0x86')](_0x37b8a0);}})[_0xa202('0x24')](function(){return _0x468fa6;})['then'](respondWithResult(_0x5e2bed,null))['catch'](handleError(_0x5e2bed,null));};exports['removeAgents']=function(_0x5cdd35,_0xd9fb01,_0x313c5b){return db[_0xa202('0x31')]['find']({'where':{'id':_0x5cdd35['params']['id']}})[_0xa202('0x24')](handleEntityNotFound(_0xd9fb01,null))['then'](function(_0x28c3e4){if(_0x28c3e4){return _0x28c3e4[_0xa202('0x8e')](_0x5cdd35[_0xa202('0x34')][_0xa202('0x78')])[_0xa202('0x24')](function(){if(_[_0xa202('0x8f')](_0x5cdd35[_0xa202('0x34')]['ids'])){for(var _0x50b428=0x0;_0x50b428<_0x5cdd35[_0xa202('0x34')][_0xa202('0x78')][_0xa202('0x39')];_0x50b428+=0x1){socket[_0xa202('0x76')](_0xa202('0x8a'),{'UserId':Number(_0x5cdd35['query'][_0xa202('0x78')][_0x50b428]),'VoiceQueueId':Number(_0x5cdd35[_0xa202('0x48')]['id'])});}}else{socket['emit'](_0xa202('0x8a'),{'UserId':Number(_0x5cdd35['query'][_0xa202('0x78')]),'VoiceQueueId':Number(_0x5cdd35['params']['id'])});}});}})[_0xa202('0x24')](function(_0x57a870){return db[_0xa202('0x71')]['destroy']({'where':{'VoiceQueueId':_0x5cdd35[_0xa202('0x48')]['id'],'UserId':_0x5cdd35['query'][_0xa202('0x78')]}})[_0xa202('0x24')](function(){return _0x57a870;});})[_0xa202('0x24')](respondWithStatusCode(_0xd9fb01,null))['catch'](handleError(_0xd9fb01,null));};exports[_0xa202('0x90')]=function(_0x43ae59,_0xa3334e,_0x5d7885){var _0x21948e={};var _0x5d8d05={};var _0x1ca174;var _0x673333;return db['VoiceQueue'][_0xa202('0x5f')]({'where':{'id':_0x43ae59[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0xa3334e,null))['then'](function(_0x424842){if(_0x424842){_0x1ca174=_0x424842;_0x5d8d05[_0xa202('0x33')]=_['keys'](db[_0xa202('0x66')][_0xa202('0x49')]);_0x5d8d05[_0xa202('0x34')]=_[_0xa202('0x35')](_0x43ae59[_0xa202('0x34')]);_0x5d8d05[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x5d8d05[_0xa202('0x33')],_0x5d8d05[_0xa202('0x34')]);_0x21948e[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x5d8d05[_0xa202('0x33')],qs[_0xa202('0x38')](_0x43ae59['query'][_0xa202('0x38')]));_0x21948e[_0xa202('0x37')]=_0x21948e[_0xa202('0x37')][_0xa202('0x39')]?_0x21948e[_0xa202('0x37')]:_0x5d8d05[_0xa202('0x33')];_0x21948e[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x43ae59[_0xa202('0x34')][_0xa202('0x3d')]);_0x21948e['where']=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x43ae59[_0xa202('0x34')],_0x5d8d05['filters']));if(_0x43ae59[_0xa202('0x34')][_0xa202('0x40')]){_0x21948e[_0xa202('0x3e')]=_[_0xa202('0x42')](_0x21948e[_0xa202('0x3e')],{'$or':_[_0xa202('0x28')](_0x21948e[_0xa202('0x37')],function(_0x32327f){var _0x3f8e12={};_0x3f8e12[_0x32327f]={'$like':'%'+_0x43ae59['query']['filter']+'%'};return _0x3f8e12;})});}_0x21948e=_[_0xa202('0x42')]({},_0x21948e,_0x43ae59[_0xa202('0x56')]);return _0x1ca174['getAgents'](_0x21948e);}})[_0xa202('0x24')](function(_0x185b19){if(_0x185b19){_0x673333=_0x185b19[_0xa202('0x39')];if(!_0x43ae59[_0xa202('0x34')]['hasOwnProperty'](_0xa202('0x3b'))){_0x21948e['limit']=qs[_0xa202('0x1c')](_0x43ae59[_0xa202('0x34')][_0xa202('0x1c')]);_0x21948e[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x43ae59[_0xa202('0x34')][_0xa202('0x1b')]);}return _0x1ca174[_0xa202('0x90')](_0x21948e);}})[_0xa202('0x24')](function(_0x537ed3){if(_0x537ed3){return _0x537ed3?{'count':_0x673333,'rows':_0x537ed3}:null;}})[_0xa202('0x24')](respondWithResult(_0xa3334e,null))['catch'](handleError(_0xa3334e,null));};exports[_0xa202('0x91')]=function(_0x3ea975,_0x1ddb33,_0x1dee3b){var _0x497e78={};var _0x34cf1e={};var _0x223d52;var _0x3b9d14;return db[_0xa202('0x31')][_0xa202('0x5f')]({'where':{'id':_0x3ea975[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x1ddb33,null))[_0xa202('0x24')](function(_0x32781c){if(_0x32781c){_0x223d52=_0x32781c;_0x34cf1e[_0xa202('0x33')]=_[_0xa202('0x35')](db[_0xa202('0x71')][_0xa202('0x49')]);_0x34cf1e[_0xa202('0x34')]=_[_0xa202('0x35')](_0x3ea975[_0xa202('0x34')]);_0x34cf1e[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x34cf1e[_0xa202('0x33')],_0x34cf1e[_0xa202('0x34')]);_0x497e78[_0xa202('0x37')]=_['intersection'](_0x34cf1e['model'],qs[_0xa202('0x38')](_0x3ea975[_0xa202('0x34')][_0xa202('0x38')]));_0x497e78[_0xa202('0x37')]=_0x497e78['attributes'][_0xa202('0x39')]?_0x497e78[_0xa202('0x37')]:_0x34cf1e[_0xa202('0x33')];_0x497e78[_0xa202('0x3c')]=qs['sort'](_0x3ea975['query'][_0xa202('0x3d')]);_0x497e78[_0xa202('0x3e')]=qs['filters'](_[_0xa202('0x3f')](_0x3ea975['query'],_0x34cf1e[_0xa202('0x36')]));if(_0x3ea975[_0xa202('0x34')][_0xa202('0x40')]){_0x497e78[_0xa202('0x3e')]=_[_0xa202('0x42')](_0x497e78[_0xa202('0x3e')],{'$or':_['map'](_0x497e78[_0xa202('0x37')],function(_0x2982ab){var _0x531e48={};_0x531e48[_0x2982ab]={'$like':'%'+_0x3ea975[_0xa202('0x34')][_0xa202('0x40')]+'%'};return _0x531e48;})});}_0x497e78=_[_0xa202('0x42')]({},_0x497e78,_0x3ea975[_0xa202('0x56')]);return _0x223d52['getMembers'](_0x497e78);}})[_0xa202('0x24')](function(_0x4abfdc){if(_0x4abfdc){_0x3b9d14=_0x4abfdc[_0xa202('0x39')];if(!_0x3ea975[_0xa202('0x34')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x497e78[_0xa202('0x1c')]=qs['limit'](_0x3ea975[_0xa202('0x34')]['limit']);_0x497e78[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x3ea975[_0xa202('0x34')][_0xa202('0x1b')]);}return _0x223d52[_0xa202('0x91')](_0x497e78);}})[_0xa202('0x24')](function(_0x15a69c){return _0x15a69c?{'count':_0x3b9d14,'rows':_0x15a69c}:null;})[_0xa202('0x24')](respondWithResult(_0x1ddb33,null))['catch'](handleError(_0x1ddb33,null));};exports['getLists']=function(_0x5d9295,_0x377db2,_0x3d98c6){var _0x756410={};var _0x123cd2={};var _0x1f39d7;var _0x53b77d;return db[_0xa202('0x31')][_0xa202('0x5f')]({'where':{'id':_0x5d9295[_0xa202('0x48')]['id']}})['then'](handleEntityNotFound(_0x377db2,null))[_0xa202('0x24')](function(_0xd0286){if(_0xd0286){_0x1f39d7=_0xd0286;_0x123cd2[_0xa202('0x33')]=_[_0xa202('0x35')](db[_0xa202('0x92')]['rawAttributes']);_0x123cd2[_0xa202('0x34')]=_[_0xa202('0x35')](_0x5d9295[_0xa202('0x34')]);_0x123cd2['filters']=_['intersection'](_0x123cd2['model'],_0x123cd2[_0xa202('0x34')]);_0x756410[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x123cd2['model'],qs['fields'](_0x5d9295[_0xa202('0x34')]['fields']));_0x756410[_0xa202('0x37')]=_0x756410[_0xa202('0x37')][_0xa202('0x39')]?_0x756410[_0xa202('0x37')]:_0x123cd2['model'];_0x756410[_0xa202('0x3c')]=qs[_0xa202('0x3d')](_0x5d9295['query']['sort']);_0x756410[_0xa202('0x3e')]=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x5d9295[_0xa202('0x34')],_0x123cd2['filters']));if(_0x5d9295[_0xa202('0x34')]['filter']){_0x756410['where']=_[_0xa202('0x42')](_0x756410[_0xa202('0x3e')],{'$or':_[_0xa202('0x28')](_0x756410[_0xa202('0x37')],function(_0x5a6b30){var _0x41ab94={};_0x41ab94[_0x5a6b30]={'$like':'%'+_0x5d9295[_0xa202('0x34')]['filter']+'%'};return _0x41ab94;})});}_0x756410=_[_0xa202('0x42')]({},_0x756410,_0x5d9295['options']);return _0x1f39d7[_0xa202('0x93')](_0x756410);}})[_0xa202('0x24')](function(_0xf81e3a){if(_0xf81e3a){_0x53b77d=_0xf81e3a[_0xa202('0x39')];if(!_0x5d9295[_0xa202('0x34')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x756410[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x5d9295[_0xa202('0x34')][_0xa202('0x1c')]);_0x756410[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x5d9295[_0xa202('0x34')][_0xa202('0x1b')]);}return _0x1f39d7[_0xa202('0x93')](_0x756410);}})[_0xa202('0x24')](function(_0x4bbebc){if(_0x4bbebc){return _0x4bbebc?{'count':_0x53b77d,'rows':_0x4bbebc}:null;}})[_0xa202('0x24')](respondWithResult(_0x377db2,null))[_0xa202('0x4b')](handleError(_0x377db2,null));};exports[_0xa202('0x94')]=function(_0x3d9e07,_0x58fb36,_0xf08e62){var _0x125849=moment()[_0xa202('0x74')](_0xa202('0x95'));var _0xb6d500,_0x3eaabe;return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x3d9e07[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x58fb36,null))['then'](function(_0x3243ad){if(_0x3243ad){_0x3eaabe=_0x3243ad;return _0x3243ad['addLists'](_0x3d9e07['body']['ids'],_[_0xa202('0x57')](_0x3d9e07[_0xa202('0x4d')],['ids','id'])||{});}return null;})[_0xa202('0x8c')](function(_0x4d3a62){var _0xff1ced;_0xb6d500=_0x4d3a62||[];var _0x1ac3b0=[];if(_0x4d3a62){for(var _0x22bb3b=0x0;_0x22bb3b<_0x4d3a62[_0xa202('0x39')];_0x22bb3b+=0x1){var _0x4a403d=_0x4d3a62[_0x22bb3b][_0xa202('0x4e')]({'plain':!![]});_0x3eaabe[_0xa202('0x96')]=_0x3d9e07[_0xa202('0x4d')]['dialCheckDuplicateType']?_0x3d9e07['body']['dialCheckDuplicateType']:_0x3eaabe[_0xa202('0x96')];switch(_0x3eaabe['dialCheckDuplicateType']){case _0xa202('0x97'):_0xff1ced=squel[_0xa202('0x98')]()[_0xa202('0x99')]('cm_hopper')['fromQuery']([_0xa202('0x9a'),_0xa202('0x9b'),'ContactId','ListId',_0xa202('0x62'),_0xa202('0x9c'),_0xa202('0x58')],squel[_0xa202('0x9d')]()[_0xa202('0x79')](_0xa202('0x9a'),'phone')['field']('\x27'+_0x125849+'\x27',_0xa202('0x9b'))['field']('id','ContactId')[_0xa202('0x79')](_0x4a403d[_0xa202('0x9e')]['toString'](),_0xa202('0x9f'))['field'](_0x3d9e07[_0xa202('0x48')]['id'][_0xa202('0xa0')](),_0xa202('0x62'))[_0xa202('0x79')]('\x27'+_0x125849+'\x27',_0xa202('0x9c'))['field']('\x27'+_0x125849+'\x27',_0xa202('0x58'))[_0xa202('0x7b')](_0xa202('0xa1'))[_0xa202('0x3e')](_0xa202('0xa2'))['where'](_0xa202('0xa3'),_0x4a403d[_0xa202('0x9e')][_0xa202('0xa0')]())[_0xa202('0x3e')](_0xa202('0xa4'))[_0xa202('0x3e')](_0xa202('0xa5'),squel[_0xa202('0x9d')]()['field'](_0xa202('0xa6'))['from'](_0xa202('0xa7'))[_0xa202('0x3e')](_0xa202('0x7f'),_0x3d9e07[_0xa202('0x48')]['id'][_0xa202('0xa0')]()))[_0xa202('0x3e')](_0xa202('0xa5'),squel[_0xa202('0x9d')]()[_0xa202('0x79')](_0xa202('0xa8'))['from']('cm_hopper')[_0xa202('0x3e')]('VoiceQueueId\x20=\x20?',_0x3d9e07[_0xa202('0x48')]['id'][_0xa202('0xa0')]())))['toString']();break;case _0xa202('0xa9'):_0xff1ced=squel[_0xa202('0x98')]()[_0xa202('0x99')](_0xa202('0xaa'))['fromQuery'](['phone',_0xa202('0x9b'),_0xa202('0xab'),_0xa202('0x9f'),_0xa202('0x62'),_0xa202('0x9c'),_0xa202('0x58')],squel['select']()[_0xa202('0x79')](_0xa202('0x9a'),_0xa202('0x9a'))[_0xa202('0x79')]('\x27'+_0x125849+'\x27',_0xa202('0x9b'))[_0xa202('0x79')]('id',_0xa202('0xab'))[_0xa202('0x79')](_0x4a403d[_0xa202('0x9e')][_0xa202('0xa0')](),_0xa202('0x9f'))['field'](_0x3d9e07['params']['id'][_0xa202('0xa0')](),'VoiceQueueId')[_0xa202('0x79')]('\x27'+_0x125849+'\x27',_0xa202('0x9c'))['field']('\x27'+_0x125849+'\x27','updatedAt')[_0xa202('0x7b')]('cm_contacts')[_0xa202('0x3e')](_0xa202('0xa2'))[_0xa202('0x3e')]('ListId\x20=\x20?',_0x4a403d[_0xa202('0x9e')][_0xa202('0xa0')]())[_0xa202('0x3e')](_0xa202('0xa4'))[_0xa202('0x3e')](_0xa202('0xa5'),squel['select']()[_0xa202('0x79')]('COALESCE(phone,\x27\x27)')[_0xa202('0x7b')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x3d9e07[_0xa202('0x48')]['id'][_0xa202('0xa0')]())))['toString']();break;default:_0xff1ced=squel[_0xa202('0x98')]()['into'](_0xa202('0xaa'))[_0xa202('0xac')](['phone',_0xa202('0x9b'),_0xa202('0xab'),_0xa202('0x9f'),_0xa202('0x62'),'createdAt',_0xa202('0x58')],squel[_0xa202('0x9d')]()[_0xa202('0x79')]('phone',_0xa202('0x9a'))[_0xa202('0x79')]('\x27'+_0x125849+'\x27','scheduledAt')['field']('id',_0xa202('0xab'))['field'](_0x4a403d[_0xa202('0x9e')][_0xa202('0xa0')](),_0xa202('0x9f'))[_0xa202('0x79')](_0x3d9e07['params']['id'][_0xa202('0xa0')](),_0xa202('0x62'))[_0xa202('0x79')]('\x27'+_0x125849+'\x27','createdAt')[_0xa202('0x79')]('\x27'+_0x125849+'\x27',_0xa202('0x58'))['from']('cm_contacts')[_0xa202('0x3e')](_0xa202('0xa2'))[_0xa202('0x3e')](_0xa202('0xa3'),_0x4a403d['CmListId'][_0xa202('0xa0')]())['where'](_0xa202('0xa4')))['toString']();}_0x1ac3b0[_0xa202('0x80')](db[_0xa202('0x81')]['query'](_0xff1ced));}return BPromise[_0xa202('0x86')](_0x1ac3b0);}})[_0xa202('0x24')](function(){var _0x46ea78=[];var _0x28cf63=squel[_0xa202('0x98')]()[_0xa202('0x99')](_0xa202('0xad'))['fromQuery']([_0xa202('0xae'),_0xa202('0x9a'),'OrderBy','createdAt','updatedAt'],squel[_0xa202('0x9d')]()['field'](_0xa202('0xaf'))[_0xa202('0x79')](_0xa202('0xb0'))['field'](_0xa202('0xb1'))['field']('\x27'+_0x125849+'\x27',_0xa202('0x9c'))[_0xa202('0x79')]('\x27'+_0x125849+'\x27',_0xa202('0x58'))[_0xa202('0x7b')](_0xa202('0xb2'),'ci')[_0xa202('0x7d')](_0xa202('0xaa'),'h',_0xa202('0xb3'))[_0xa202('0x3e')]('h.scheduledat=?',_0x125849)[_0xa202('0x3e')](_0xa202('0xb4'),_0xa202('0xb5')))['toString']();_0x46ea78[_0xa202('0x80')](db[_0xa202('0x81')][_0xa202('0x34')](_0x28cf63));return BPromise[_0xa202('0x86')](_0x46ea78);})['then'](function(){return _0xb6d500;})['then'](respondWithResult(_0x58fb36,null))[_0xa202('0x4b')](handleError(_0x58fb36,null));};exports[_0xa202('0xb6')]=function(_0x550df2,_0x248e45,_0x3354dd){return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x550df2['params']['id']}})['then'](handleEntityNotFound(_0x248e45,null))[_0xa202('0x24')](function(_0x741343){if(_0x741343){return _0x741343[_0xa202('0xb6')](_0x550df2['query'][_0xa202('0x78')]);}})[_0xa202('0x24')](function(_0x254ad9){if(_0x254ad9){return db[_0xa202('0x5b')][_0xa202('0x23')]({'where':{'ListId':_0x550df2[_0xa202('0x34')][_0xa202('0x78')],'VoiceQueueId':_0x550df2['params']['id']}})[_0xa202('0x24')](function(){return _0x254ad9;});}})['then'](respondWithStatusCode(_0x248e45,null))['catch'](handleError(_0x248e45,null));};exports[_0xa202('0xb7')]=function(_0x183df4,_0x29b1ce,_0x4b151d){var _0x1d0bc9={};var _0x37934d={};var _0x519179;var _0x406aed;return db[_0xa202('0x31')]['findOne']({'where':{'id':_0x183df4[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x29b1ce,null))['then'](function(_0x142aab){if(_0x142aab){_0x519179=_0x142aab;_0x37934d[_0xa202('0x33')]=_[_0xa202('0x35')](db['CmList'][_0xa202('0x49')]);_0x37934d['query']=_[_0xa202('0x35')](_0x183df4[_0xa202('0x34')]);_0x37934d[_0xa202('0x36')]=_[_0xa202('0x4a')](_0x37934d[_0xa202('0x33')],_0x37934d[_0xa202('0x34')]);_0x1d0bc9[_0xa202('0x37')]=_[_0xa202('0x4a')](_0x37934d[_0xa202('0x33')],qs[_0xa202('0x38')](_0x183df4['query'][_0xa202('0x38')]));_0x1d0bc9['attributes']=_0x1d0bc9[_0xa202('0x37')][_0xa202('0x39')]?_0x1d0bc9[_0xa202('0x37')]:_0x37934d[_0xa202('0x33')];_0x1d0bc9[_0xa202('0x3c')]=qs['sort'](_0x183df4[_0xa202('0x34')][_0xa202('0x3d')]);_0x1d0bc9['where']=qs[_0xa202('0x36')](_[_0xa202('0x3f')](_0x183df4['query'],_0x37934d[_0xa202('0x36')]));if(_0x183df4[_0xa202('0x34')][_0xa202('0x40')]){_0x1d0bc9[_0xa202('0x3e')]=_[_0xa202('0x42')](_0x1d0bc9['where'],{'$or':_[_0xa202('0x28')](_0x1d0bc9[_0xa202('0x37')],function(_0x4b13be){var _0x5be091={};_0x5be091[_0x4b13be]={'$like':'%'+_0x183df4['query'][_0xa202('0x40')]+'%'};return _0x5be091;})});}_0x1d0bc9=_[_0xa202('0x42')]({},_0x1d0bc9,_0x183df4['options']);return _0x519179['getBlackLists'](_0x1d0bc9);}})[_0xa202('0x24')](function(_0x1f601b){if(_0x1f601b){_0x406aed=_0x1f601b[_0xa202('0x39')];if(!_0x183df4['query'][_0xa202('0x3a')](_0xa202('0x3b'))){_0x1d0bc9[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x183df4['query'][_0xa202('0x1c')]);_0x1d0bc9['offset']=qs[_0xa202('0x1b')](_0x183df4[_0xa202('0x34')][_0xa202('0x1b')]);}return _0x519179[_0xa202('0xb7')](_0x1d0bc9);}})['then'](function(_0x57e7c3){if(_0x57e7c3){return _0x57e7c3?{'count':_0x406aed,'rows':_0x57e7c3}:null;}})[_0xa202('0x24')](respondWithResult(_0x29b1ce,null))[_0xa202('0x4b')](handleError(_0x29b1ce,null));};exports[_0xa202('0xb8')]=function(_0x12a6a2,_0x1a50d9,_0x59aa6e){var _0x5a7816,_0x1450a3;return db['VoiceQueue'][_0xa202('0x2c')]({'where':{'id':_0x12a6a2[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x1a50d9,null))[_0xa202('0x24')](function(_0x2cc6a){if(_0x2cc6a){_0x1450a3=_0x2cc6a;return _0x2cc6a[_0xa202('0xb8')](_0x12a6a2[_0xa202('0x4d')][_0xa202('0x78')],_[_0xa202('0x57')](_0x12a6a2[_0xa202('0x4d')],[_0xa202('0x78'),'id'])||{});}return null;})['spread'](function(_0x2b8202){var _0x3148ef;_0x5a7816=_0x2b8202||[];var _0x653cdf=[];if(_0x2b8202){for(var _0x3930db=0x0;_0x3930db<_0x2b8202[_0xa202('0x39')];_0x3930db+=0x1){var _0x41b827=_0x2b8202[_0x3930db]['get']({'plain':!![]});_0x3148ef=squel['insert']()[_0xa202('0x99')](_0xa202('0xb9'))['fromQuery']([_0xa202('0x9a'),_0xa202('0xab'),_0xa202('0x9f'),'VoiceQueueId',_0xa202('0x9c'),_0xa202('0x58')],squel[_0xa202('0x9d')]()[_0xa202('0x79')](_0xa202('0x9a'),_0xa202('0x9a'))['field']('id',_0xa202('0xab'))['field'](_0x41b827['CmListId'][_0xa202('0xa0')](),'ListId')[_0xa202('0x79')](_0x12a6a2['params']['id']['toString'](),_0xa202('0x62'))[_0xa202('0x79')](_0xa202('0xba'),_0xa202('0x9c'))[_0xa202('0x79')](_0xa202('0xba'),'updatedAt')[_0xa202('0x7b')]('cm_contacts')['where'](_0xa202('0xa2'))[_0xa202('0x3e')](_0xa202('0xa3'),_0x41b827[_0xa202('0x9e')][_0xa202('0xa0')]())[_0xa202('0x3e')](_0xa202('0xa4')))['toString']();_0x653cdf[_0xa202('0x80')](db['sequelize'][_0xa202('0x34')](_0x3148ef));}return BPromise[_0xa202('0x86')](_0x653cdf);}})[_0xa202('0x24')](function(){return _0x5a7816;})[_0xa202('0x24')](respondWithResult(_0x1a50d9,null))[_0xa202('0x4b')](handleError(_0x1a50d9,null));};exports[_0xa202('0xbb')]=function(_0x4e1f0f,_0x2ac59f,_0x47add5){return db[_0xa202('0x31')][_0xa202('0x2c')]({'where':{'id':_0x4e1f0f[_0xa202('0x48')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x2ac59f,null))['then'](function(_0x26eed6){if(_0x26eed6){return _0x26eed6[_0xa202('0xbb')](_0x4e1f0f['query'][_0xa202('0x78')]);}})[_0xa202('0x24')](function(_0x7989ea){if(_0x7989ea){return db[_0xa202('0x63')]['destroy']({'where':{'ListId':_0x4e1f0f[_0xa202('0x34')][_0xa202('0x78')],'VoiceQueueId':_0x4e1f0f[_0xa202('0x48')]['id']}})[_0xa202('0x24')](function(){return _0x7989ea;});}})[_0xa202('0x24')](respondWithStatusCode(_0x2ac59f,null))[_0xa202('0x4b')](handleError(_0x2ac59f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 259c436..26395eb 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 _0x7121=['setMaxListeners','update','remove','emit','hook','events','../../mysqldb','VoiceQueue'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7121,0x85));var _0x1712=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7121[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x1712('0x0'));var VoiceQueue=require(_0x1712('0x1'))['db'][_0x1712('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1712('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1712('0x4'),'afterDestroy':_0x1712('0x5')};function emitEvent(_0x1e54e9){return function(_0x3f2e3e,_0x3e84fd,_0x56ec5e){VoiceQueueEvents[_0x1712('0x6')](_0x1e54e9+':'+_0x3f2e3e['id'],_0x3f2e3e);VoiceQueueEvents[_0x1712('0x6')](_0x1e54e9,_0x3f2e3e);_0x56ec5e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1712('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x64df=['events','../../mysqldb','VoiceQueue','setMaxListeners','emit','hasOwnProperty'];(function(_0x15766e,_0x2c0464){var _0x562cf9=function(_0x34c671){while(--_0x34c671){_0x15766e['push'](_0x15766e['shift']());}};_0x562cf9(++_0x2c0464);}(_0x64df,0x1bc));var _0xf64d=function(_0x656222,_0x158bdc){_0x656222=_0x656222-0x0;var _0x20790b=_0x64df[_0x656222];return _0x20790b;};'use strict';var EventEmitter=require(_0xf64d('0x0'));var VoiceQueue=require(_0xf64d('0x1'))['db'][_0xf64d('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf64d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5278ce){return function(_0x3b4ddc,_0x11ce3b,_0x416499){VoiceQueueEvents[_0xf64d('0x4')](_0x5278ce+':'+_0x3b4ddc['id'],_0x3b4ddc);VoiceQueueEvents['emit'](_0x5278ce,_0x3b4ddc);_0x416499(null);};}for(var e in events){if(events[_0xf64d('0x5')](e)){var event=events[e];VoiceQueue['hook'](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 e2b97ec..5b86b1a 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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x55201c,_0x3308b7){var _0x34949b=function(_0x5ce877){while(--_0x5ce877){_0x55201c['push'](_0x55201c['shift']());}};_0x34949b(++_0x3308b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x349b5c,_0x55e5fa){var _0x3efcac=function(_0x27832d){while(--_0x27832d){_0x349b5c['push'](_0x349b5c['shift']());}};_0x3efcac(++_0x55e5fa);}(_0x3e74,0x175));var _0x43e7=function(_0x2aaca4,_0x3dc18d){_0x2aaca4=_0x2aaca4-0x0;var _0x38ce78=_0x3e74[_0x2aaca4];return _0x38ce78;};'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/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index ef04966..face514 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 _0x63ae=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x63ae,0x18c));var _0xe63a=function(_0x1e71fb,_0x51b4a4){_0x1e71fb=_0x1e71fb-0x0;var _0x3b7a75=_0x63ae[_0x1e71fb];return _0x3b7a75;};'use strict';var _=require(_0xe63a('0x0'));var util=require(_0xe63a('0x1'));var moment=require(_0xe63a('0x2'));var BPromise=require(_0xe63a('0x3'));var rs=require(_0xe63a('0x4'));var fs=require('fs');var Redis=require(_0xe63a('0x5'));var db=require(_0xe63a('0x6'))['db'];var utils=require(_0xe63a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe63a('0x8'));var jayson=require(_0xe63a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xe63a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe63a('0xb'))(new Redis(config[_0xe63a('0xa')]));require(_0xe63a('0xc'))[_0xe63a('0xd')](socket);function respondWithRpcPromise(_0x2e28f8,_0x513cc6,_0x1a4681){return new BPromise(function(_0x5089e2,_0x4dd285){return client[_0xe63a('0xe')](_0x2e28f8,_0x1a4681)[_0xe63a('0xf')](function(_0x12368c){logger[_0xe63a('0x10')](_0xe63a('0x11'),_0x513cc6,_0xe63a('0x12'));logger[_0xe63a('0x13')](_0xe63a('0x14'),_0x513cc6,_0xe63a('0x12'),JSON['stringify'](_0x12368c));if(_0x12368c[_0xe63a('0x15')]){if(_0x12368c['error'][_0xe63a('0x16')]===0x1f4){logger[_0xe63a('0x15')](_0xe63a('0x11'),_0x513cc6,_0x12368c[_0xe63a('0x15')][_0xe63a('0x17')]);return _0x4dd285(_0x12368c[_0xe63a('0x15')][_0xe63a('0x17')]);}logger[_0xe63a('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x513cc6,_0x12368c[_0xe63a('0x15')][_0xe63a('0x17')]);return _0x5089e2(_0x12368c[_0xe63a('0x15')]['message']);}else{logger[_0xe63a('0x10')](_0xe63a('0x11'),_0x513cc6,_0xe63a('0x12'));_0x5089e2(_0x12368c[_0xe63a('0x18')][_0xe63a('0x17')]);}})['catch'](function(_0x4925b1){logger['error'](_0xe63a('0x11'),_0x513cc6,_0x4925b1);_0x4dd285(_0x4925b1);});});}exports[_0xe63a('0x19')]=function(_0x5b33a9){var _0x638eb7=this;return new Promise(function(_0x40117d,_0x871255){return db[_0xe63a('0x1a')][_0xe63a('0x1b')]({'raw':_0x5b33a9[_0xe63a('0x1c')]?_0x5b33a9[_0xe63a('0x1c')][_0xe63a('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b33a9['options']?_0x5b33a9['options'][_0xe63a('0x1e')]||null:null,'attributes':_0x5b33a9[_0xe63a('0x1c')]?_0x5b33a9[_0xe63a('0x1c')][_0xe63a('0x1f')]||null:null,'limit':_0x5b33a9[_0xe63a('0x1c')]?_0x5b33a9[_0xe63a('0x1c')][_0xe63a('0x20')]||null:null,'include':_0x5b33a9[_0xe63a('0x1c')]?_0x5b33a9[_0xe63a('0x1c')][_0xe63a('0x21')]?_[_0xe63a('0x22')](_0x5b33a9[_0xe63a('0x1c')][_0xe63a('0x21')],function(_0x4792b7){return{'model':db[_0x4792b7['model']],'as':_0x4792b7['as'],'attributes':_0x4792b7[_0xe63a('0x1f')],'include':_0x4792b7['include']?_[_0xe63a('0x22')](_0x4792b7['include'],function(_0x4f0469){return{'model':db[_0x4f0469[_0xe63a('0x23')]],'as':_0x4f0469['as'],'attributes':_0x4f0469[_0xe63a('0x1f')],'include':_0x4f0469['include']?_[_0xe63a('0x22')](_0x4f0469[_0xe63a('0x21')],function(_0x596dc1){return{'model':db[_0x596dc1[_0xe63a('0x23')]],'as':_0x596dc1['as'],'attributes':_0x596dc1[_0xe63a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe63a('0xf')](function(_0x9b2877){logger['info'](_0xe63a('0x19'),_0x5b33a9);logger[_0xe63a('0x13')](_0xe63a('0x19'),_0x5b33a9,JSON[_0xe63a('0x24')](_0x9b2877));_0x40117d(_0x9b2877);})[_0xe63a('0x25')](function(_0x115691){logger[_0xe63a('0x15')](_0xe63a('0x19'),_0x115691[_0xe63a('0x17')],_0x5b33a9);_0x871255(_0x638eb7[_0xe63a('0x15')](0x1f4,_0x115691[_0xe63a('0x17')]));});});};exports[_0xe63a('0x26')]=function(_0x1fae4c){var _0x107b1a=this;return new Promise(function(_0x753760,_0x5db472){return db[_0xe63a('0x1a')][_0xe63a('0x27')]({'raw':_0x1fae4c[_0xe63a('0x1c')]?_0x1fae4c[_0xe63a('0x1c')][_0xe63a('0x1d')]===undefined?!![]:![]:!![],'where':_0x1fae4c[_0xe63a('0x1c')]?_0x1fae4c['options'][_0xe63a('0x1e')]||null:null,'attributes':_0x1fae4c[_0xe63a('0x1c')]?_0x1fae4c['options']['attributes']||null:null,'include':_0x1fae4c['options']?_0x1fae4c[_0xe63a('0x1c')][_0xe63a('0x21')]?_['map'](_0x1fae4c[_0xe63a('0x1c')][_0xe63a('0x21')],function(_0x3b4115){return{'model':db[_0x3b4115['model']],'as':_0x3b4115['as'],'attributes':_0x3b4115['attributes'],'include':_0x3b4115[_0xe63a('0x21')]?_[_0xe63a('0x22')](_0x3b4115[_0xe63a('0x21')],function(_0x1aaf55){return{'model':db[_0x1aaf55[_0xe63a('0x23')]],'as':_0x1aaf55['as'],'attributes':_0x1aaf55[_0xe63a('0x1f')],'include':_0x1aaf55['include']?_[_0xe63a('0x22')](_0x1aaf55[_0xe63a('0x21')],function(_0x30b497){return{'model':db[_0x30b497[_0xe63a('0x23')]],'as':_0x30b497['as'],'attributes':_0x30b497[_0xe63a('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x447c9b){logger[_0xe63a('0x10')]('ShowVoiceQueue',_0x1fae4c);logger[_0xe63a('0x13')]('ShowVoiceQueue',_0x1fae4c,JSON['stringify'](_0x447c9b));_0x753760(_0x447c9b);})[_0xe63a('0x25')](function(_0x5b7a47){logger[_0xe63a('0x15')](_0xe63a('0x26'),_0x5b7a47['message'],_0x1fae4c);_0x5db472(_0x107b1a[_0xe63a('0x15')](0x1f4,_0x5b7a47[_0xe63a('0x17')]));});});}; \ No newline at end of file +var _0xdf80=['socket.io-emitter','register','then','info','VoiceQueue,\x20%s,\x20%s','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceQueue','VoiceQueue','options','where','limit','map','include','attributes','model','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x5a1b51,_0x5b869b){var _0x1eb59e=function(_0x56274a){while(--_0x56274a){_0x5a1b51['push'](_0x5a1b51['shift']());}};_0x1eb59e(++_0x5b869b);}(_0xdf80,0x1ec));var _0x0df8=function(_0x3e9fdb,_0x40622){_0x3e9fdb=_0x3e9fdb-0x0;var _0xf847c4=_0xdf80[_0x3e9fdb];return _0xf847c4;};'use strict';var _=require(_0x0df8('0x0'));var util=require(_0x0df8('0x1'));var moment=require(_0x0df8('0x2'));var BPromise=require(_0x0df8('0x3'));var rs=require(_0x0df8('0x4'));var fs=require('fs');var Redis=require(_0x0df8('0x5'));var db=require(_0x0df8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0df8('0x7'))(_0x0df8('0x8'));var config=require(_0x0df8('0x9'));var jayson=require(_0x0df8('0xa'));var client=jayson[_0x0df8('0xb')]['http']({'port':0x232a});config[_0x0df8('0xc')]=_[_0x0df8('0xd')](config[_0x0df8('0xc')],{'host':_0x0df8('0xe'),'port':0x18eb});var socket=require(_0x0df8('0xf'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0df8('0x10')](socket);function respondWithRpcPromise(_0x188530,_0x2a5f66,_0x26c54d){return new BPromise(function(_0x103db8,_0x422de5){return client['request'](_0x188530,_0x26c54d)[_0x0df8('0x11')](function(_0xb70f94){logger[_0x0df8('0x12')](_0x0df8('0x13'),_0x2a5f66,'request\x20sent');logger['debug'](_0x0df8('0x14'),_0x2a5f66,'request\x20sent',JSON[_0x0df8('0x15')](_0xb70f94));if(_0xb70f94['error']){if(_0xb70f94[_0x0df8('0x16')]['code']===0x1f4){logger['error'](_0x0df8('0x13'),_0x2a5f66,_0xb70f94['error'][_0x0df8('0x17')]);return _0x422de5(_0xb70f94[_0x0df8('0x16')][_0x0df8('0x17')]);}logger[_0x0df8('0x16')](_0x0df8('0x13'),_0x2a5f66,_0xb70f94[_0x0df8('0x16')][_0x0df8('0x17')]);return _0x103db8(_0xb70f94[_0x0df8('0x16')][_0x0df8('0x17')]);}else{logger[_0x0df8('0x12')](_0x0df8('0x13'),_0x2a5f66,_0x0df8('0x18'));_0x103db8(_0xb70f94[_0x0df8('0x19')][_0x0df8('0x17')]);}})[_0x0df8('0x1a')](function(_0x136ee6){logger[_0x0df8('0x16')](_0x0df8('0x13'),_0x2a5f66,_0x136ee6);_0x422de5(_0x136ee6);});});}exports[_0x0df8('0x1b')]=function(_0x4f9b51){var _0x51b393=this;return new Promise(function(_0x44f234,_0x113137){return db[_0x0df8('0x1c')]['findAll']({'raw':_0x4f9b51[_0x0df8('0x1d')]?_0x4f9b51[_0x0df8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4f9b51[_0x0df8('0x1d')]?_0x4f9b51[_0x0df8('0x1d')][_0x0df8('0x1e')]||null:null,'attributes':_0x4f9b51[_0x0df8('0x1d')]?_0x4f9b51[_0x0df8('0x1d')]['attributes']||null:null,'limit':_0x4f9b51[_0x0df8('0x1d')]?_0x4f9b51['options'][_0x0df8('0x1f')]||null:null,'include':_0x4f9b51[_0x0df8('0x1d')]?_0x4f9b51[_0x0df8('0x1d')]['include']?_[_0x0df8('0x20')](_0x4f9b51[_0x0df8('0x1d')][_0x0df8('0x21')],function(_0x361db1){return{'model':db[_0x361db1['model']],'as':_0x361db1['as'],'attributes':_0x361db1[_0x0df8('0x22')],'include':_0x361db1['include']?_[_0x0df8('0x20')](_0x361db1[_0x0df8('0x21')],function(_0x154545){return{'model':db[_0x154545[_0x0df8('0x23')]],'as':_0x154545['as'],'attributes':_0x154545['attributes'],'include':_0x154545[_0x0df8('0x21')]?_[_0x0df8('0x20')](_0x154545['include'],function(_0x33b7af){return{'model':db[_0x33b7af[_0x0df8('0x23')]],'as':_0x33b7af['as'],'attributes':_0x33b7af[_0x0df8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0df8('0x11')](function(_0x2f019d){logger['info']('GetVoiceQueue',_0x4f9b51);logger[_0x0df8('0x24')](_0x0df8('0x1b'),_0x4f9b51,JSON[_0x0df8('0x15')](_0x2f019d));_0x44f234(_0x2f019d);})[_0x0df8('0x1a')](function(_0x21fd7c){logger['error'](_0x0df8('0x1b'),_0x21fd7c[_0x0df8('0x17')],_0x4f9b51);_0x113137(_0x51b393[_0x0df8('0x16')](0x1f4,_0x21fd7c[_0x0df8('0x17')]));});});};exports[_0x0df8('0x25')]=function(_0x25015b){var _0x5aac19=this;return new Promise(function(_0x5ebe6c,_0x38c111){return db[_0x0df8('0x1c')][_0x0df8('0x26')]({'raw':_0x25015b[_0x0df8('0x1d')]?_0x25015b['options']['raw']===undefined?!![]:![]:!![],'where':_0x25015b['options']?_0x25015b[_0x0df8('0x1d')][_0x0df8('0x1e')]||null:null,'attributes':_0x25015b[_0x0df8('0x1d')]?_0x25015b[_0x0df8('0x1d')][_0x0df8('0x22')]||null:null,'include':_0x25015b['options']?_0x25015b[_0x0df8('0x1d')][_0x0df8('0x21')]?_[_0x0df8('0x20')](_0x25015b[_0x0df8('0x1d')]['include'],function(_0x3821a7){return{'model':db[_0x3821a7[_0x0df8('0x23')]],'as':_0x3821a7['as'],'attributes':_0x3821a7[_0x0df8('0x22')],'include':_0x3821a7[_0x0df8('0x21')]?_['map'](_0x3821a7['include'],function(_0x3ade4a){return{'model':db[_0x3ade4a[_0x0df8('0x23')]],'as':_0x3ade4a['as'],'attributes':_0x3ade4a[_0x0df8('0x22')],'include':_0x3ade4a['include']?_[_0x0df8('0x20')](_0x3ade4a[_0x0df8('0x21')],function(_0xa89488){return{'model':db[_0xa89488['model']],'as':_0xa89488['as'],'attributes':_0xa89488[_0x0df8('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0df8('0x11')](function(_0x27fe8b){logger[_0x0df8('0x12')](_0x0df8('0x25'),_0x25015b);logger['debug'](_0x0df8('0x25'),_0x25015b,JSON[_0x0df8('0x15')](_0x27fe8b));_0x5ebe6c(_0x27fe8b);})[_0x0df8('0x1a')](function(_0x1dd9de){logger[_0x0df8('0x16')](_0x0df8('0x25'),_0x1dd9de['message'],_0x25015b);_0x38c111(_0x5aac19[_0x0df8('0x16')](0x1f4,_0x1dd9de[_0x0df8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 736d946..f6a5e3c 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 _0x7c0b=['remove','emit','removeListener','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x2bab20,_0x1d7472){var _0xda5eda=function(_0x37ba9){while(--_0x37ba9){_0x2bab20['push'](_0x2bab20['shift']());}};_0xda5eda(++_0x1d7472);}(_0x7c0b,0x19b));var _0xb7c0=function(_0x1ca1ad,_0x30cda1){_0x1ca1ad=_0x1ca1ad-0x0;var _0x329903=_0x7c0b[_0x1ca1ad];return _0x329903;};'use strict';var VoiceQueueEvents=require(_0xb7c0('0x0'));var events=[_0xb7c0('0x1'),_0xb7c0('0x2'),'update'];function createListener(_0x5c31e9,_0xf706b4){return function(_0x3b39de){_0xf706b4[_0xb7c0('0x3')](_0x5c31e9,_0x3b39de);};}function removeListener(_0xbc4cac,_0x3959d6){return function(){VoiceQueueEvents[_0xb7c0('0x4')](_0xbc4cac,_0x3959d6);};}exports['register']=function(_0xe076b6){for(var _0x127aa0=0x0,_0x3802ea=events[_0xb7c0('0x5')];_0x127aa0<_0x3802ea;_0x127aa0++){var _0x22f06e=events[_0x127aa0];var _0x5a683c=createListener(_0xb7c0('0x6')+_0x22f06e,_0xe076b6);VoiceQueueEvents['on'](_0x22f06e,_0x5a683c);}}; \ No newline at end of file +var _0x1df8=['emit','removeListener','voiceQueue:','./voiceQueue.events','save','remove','update'];(function(_0x273ebd,_0x1fd1ab){var _0x430974=function(_0x4929ff){while(--_0x4929ff){_0x273ebd['push'](_0x273ebd['shift']());}};_0x430974(++_0x1fd1ab);}(_0x1df8,0x184));var _0x81df=function(_0x743b0b,_0x4f30bb){_0x743b0b=_0x743b0b-0x0;var _0x1a52d2=_0x1df8[_0x743b0b];return _0x1a52d2;};'use strict';var VoiceQueueEvents=require(_0x81df('0x0'));var events=[_0x81df('0x1'),_0x81df('0x2'),_0x81df('0x3')];function createListener(_0x162255,_0x484723){return function(_0x32bf7f){_0x484723[_0x81df('0x4')](_0x162255,_0x32bf7f);};}function removeListener(_0x5b0753,_0x4b2101){return function(){VoiceQueueEvents[_0x81df('0x5')](_0x5b0753,_0x4b2101);};}exports['register']=function(_0x2222b8){for(var _0x43bad7=0x0,_0x44aaa0=events['length'];_0x43bad7<_0x44aaa0;_0x43bad7++){var _0x6339a1=events[_0x43bad7];var _0xb5086=createListener(_0x81df('0x6')+_0x6339a1,_0x2222b8);VoiceQueueEvents['on'](_0x6339a1,_0xb5086);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1861f73..053bbeb 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 _0x030d=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/index','/:id','post','put','update','delete'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x030d,0x1c9));var _0xd030=function(_0x48b3fb,_0x4b07bf){_0x48b3fb=_0x48b3fb-0x0;var _0x458604=_0x030d[_0x48b3fb];return _0x458604;};'use strict';var multer=require(_0xd030('0x0'));var util=require(_0xd030('0x1'));var path=require(_0xd030('0x2'));var timeout=require(_0xd030('0x3'));var express=require('express');var router=express[_0xd030('0x4')]();var fs_extra=require(_0xd030('0x5'));var auth=require(_0xd030('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xd030('0x7')]('/',auth[_0xd030('0x8')](),controller[_0xd030('0x9')]);router[_0xd030('0x7')](_0xd030('0xa'),auth[_0xd030('0x8')](),controller[_0xd030('0xb')]);router[_0xd030('0x7')](_0xd030('0xc'),auth[_0xd030('0x8')](),controller['getVoiceQueuesReport']);router[_0xd030('0x7')](_0xd030('0xd'),auth[_0xd030('0x8')](),controller['show']);router[_0xd030('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd030('0xf')](_0xd030('0xd'),auth[_0xd030('0x8')](),controller[_0xd030('0x10')]);router[_0xd030('0x11')](_0xd030('0xd'),auth[_0xd030('0x8')](),controller[_0xd030('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb411=['get','isAuthenticated','index','/describe','describe','/index','/:id','show','post','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3a90ff,_0x4b480f){var _0x21531c=function(_0xea98ae){while(--_0xea98ae){_0x3a90ff['push'](_0x3a90ff['shift']());}};_0x21531c(++_0x4b480f);}(_0xb411,0x12b));var _0x1b41=function(_0x3cd3ca,_0x27920a){_0x3cd3ca=_0x3cd3ca-0x0;var _0x4e9890=_0xb411[_0x3cd3ca];return _0x4e9890;};'use strict';var multer=require('multer');var util=require(_0x1b41('0x0'));var path=require(_0x1b41('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b41('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1b41('0x3'));var config=require(_0x1b41('0x4'));var controller=require('./voiceQueueReport.controller');router[_0x1b41('0x5')]('/',auth[_0x1b41('0x6')](),controller[_0x1b41('0x7')]);router[_0x1b41('0x5')](_0x1b41('0x8'),auth[_0x1b41('0x6')](),controller[_0x1b41('0x9')]);router[_0x1b41('0x5')](_0x1b41('0xa'),auth[_0x1b41('0x6')](),controller['getVoiceQueuesReport']);router['get'](_0x1b41('0xb'),auth[_0x1b41('0x6')](),controller[_0x1b41('0xc')]);router[_0x1b41('0xd')]('/',auth[_0x1b41('0x6')](),controller['create']);router[_0x1b41('0xe')]('/:id',auth[_0x1b41('0x6')](),controller[_0x1b41('0xf')]);router[_0x1b41('0x10')](_0x1b41('0xb'),auth['isAuthenticated'](),controller[_0x1b41('0x11')]);module[_0x1b41('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ea8fbaf..5e4e31b 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 _0xf9a3=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x33615e,_0x3c97b0){var _0x5888dd=function(_0x40634a){while(--_0x40634a){_0x33615e['push'](_0x33615e['shift']());}};_0x5888dd(++_0x3c97b0);}(_0xf9a3,0xc4));var _0x3f9a=function(_0x55a7ca,_0x5049f4){_0x55a7ca=_0x55a7ca-0x0;var _0x5cde80=_0xf9a3[_0x55a7ca];return _0x5cde80;};'use strict';var Sequelize=require(_0x3f9a('0x0'));var moment=require(_0x3f9a('0x1'));module[_0x3f9a('0x2')]={'type':{'type':Sequelize[_0x3f9a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3f9a('0x3')]},'queue':{'type':Sequelize[_0x3f9a('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x3f9a('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x3f9a('0x4')],'set':function(_0xe892e2){var _0x559612=moment(_0xe892e2);var _0x2dcf51=moment(this[_0x3f9a('0x5')](_0x3f9a('0x6')))[_0x3f9a('0x7')](_0x3f9a('0x8'));var _0x3a9aa9=_0x559612[_0x3f9a('0x9')](_0x2dcf51,_0x3f9a('0xa'));this[_0x3f9a('0xb')]('queuecallerleaveAt',_0xe892e2);this[_0x3f9a('0xb')](_0x3f9a('0xc'),_0x3a9aa9||null);}},'position':{'type':Sequelize[_0x3f9a('0xd')]},'count':{'type':Sequelize[_0x3f9a('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3f9a('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3f9a('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3f9a('0x4')]},'queuecallerexit':{'type':Sequelize[_0x3f9a('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3f9a('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x3f9a('0x3')],'comment':_0x3f9a('0xf')},'originalposition':{'type':Sequelize[_0x3f9a('0xd')]},'channel':{'type':Sequelize[_0x3f9a('0x3')]},'connectedlinenum':{'type':Sequelize[_0x3f9a('0x3')]},'connectedlinename':{'type':Sequelize[_0x3f9a('0x3')]},'accountcode':{'type':Sequelize[_0x3f9a('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3f9a('0x3')]},'priority':{'type':Sequelize[_0x3f9a('0x3')]},'holdtime':{'type':Sequelize[_0x3f9a('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3f9a('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3f9a('0x3')],'comment':_0x3f9a('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3f9a('0x3')]},'secondDisposition':{'type':Sequelize[_0x3f9a('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f9a('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x3f9a('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x3f9a('0x3')]}}; \ No newline at end of file +var _0xe60c=['INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xe60c,0x170));var _0xce60=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xe60c[_0x1d9163];return _0xb42197;};'use strict';var Sequelize=require(_0xce60('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xce60('0x1')]},'uniqueid':{'type':Sequelize[_0xce60('0x1')]},'calleridnum':{'type':Sequelize[_0xce60('0x1')]},'calleridname':{'type':Sequelize[_0xce60('0x1')]},'queue':{'type':Sequelize[_0xce60('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xce60('0x2')],'set':function(_0x5d5ced){var _0x3dbbcc=moment(_0x5d5ced);var _0x48796b=moment(this[_0xce60('0x3')]('queuecallerjoinAt'))['format'](_0xce60('0x4'));var _0x553637=_0x3dbbcc[_0xce60('0x5')](_0x48796b,_0xce60('0x6'));this['setDataValue'](_0xce60('0x7'),_0x5d5ced);this[_0xce60('0x8')](_0xce60('0x9'),_0x553637||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xce60('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xce60('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xce60('0x2')]},'queuecallerexit':{'type':Sequelize[_0xce60('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xce60('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xce60('0x1')],'comment':_0xce60('0xc')},'originalposition':{'type':Sequelize[_0xce60('0xa')]},'channel':{'type':Sequelize[_0xce60('0x1')]},'connectedlinenum':{'type':Sequelize[_0xce60('0x1')]},'connectedlinename':{'type':Sequelize[_0xce60('0x1')]},'accountcode':{'type':Sequelize[_0xce60('0x1')]},'context':{'type':Sequelize[_0xce60('0x1')]},'exten':{'type':Sequelize[_0xce60('0x1')]},'priority':{'type':Sequelize[_0xce60('0x1')]},'holdtime':{'type':Sequelize[_0xce60('0xa')]},'mohtime':{'type':Sequelize[_0xce60('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xce60('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xce60('0x1')]},'transfer':{'type':Sequelize[_0xce60('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xce60('0x1')],'comment':_0xce60('0xd')},'transferexten':{'type':Sequelize[_0xce60('0x1')]},'transferuniqueid':{'type':Sequelize[_0xce60('0x1')]},'disposition':{'type':Sequelize[_0xce60('0x1')]},'secondDisposition':{'type':Sequelize[_0xce60('0x1')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0xce60('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 1e3a9d7..837fb0a 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 _0x824a=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','error','stack','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','update','describe','getVoiceQueuesReport','filter','findAll','eml-format','rimraf'];(function(_0x3d8203,_0x15511e){var _0x85940=function(_0x572ebf){while(--_0x572ebf){_0x3d8203['push'](_0x3d8203['shift']());}};_0x85940(++_0x15511e);}(_0x824a,0xaa));var _0xa824=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x824a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa824('0x0'));var rimraf=require(_0xa824('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa824('0x2'));var rp=require(_0xa824('0x3'));var moment=require(_0xa824('0x4'));var BPromise=require(_0xa824('0x5'));var Mustache=require(_0xa824('0x6'));var util=require('util');var path=require(_0xa824('0x7'));var sox=require(_0xa824('0x8'));var csv=require(_0xa824('0x9'));var ejs=require(_0xa824('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa824('0xb'));var squel=require(_0xa824('0xc'));var crypto=require(_0xa824('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa824('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa824('0xf'));var Papa=require(_0xa824('0x10'));var Redis=require(_0xa824('0x11'));var authService=require(_0xa824('0x12'));var qs=require(_0xa824('0x13'));var as=require(_0xa824('0x14'));var hardwareService=require(_0xa824('0x15'));var logger=require(_0xa824('0x16'))('api');var utils=require(_0xa824('0x17'));var config=require(_0xa824('0x18'));var licenseUtil=require(_0xa824('0x19'));var db=require(_0xa824('0x1a'))['db'];config['redis']=_['defaults'](config[_0xa824('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa824('0x1c'))(new Redis(config[_0xa824('0x1b')]));require(_0xa824('0x1d'))[_0xa824('0x1e')](socket);function respondWithStatusCode(_0x44fe84,_0x55c29e){_0x55c29e=_0x55c29e||0xcc;return function(_0x2348b5){if(_0x2348b5){return _0x44fe84[_0xa824('0x1f')](_0x55c29e);}return _0x44fe84['status'](_0x55c29e)[_0xa824('0x20')]();};}function respondWithResult(_0x4dd881,_0x387769){_0x387769=_0x387769||0xc8;return function(_0x1802fa){if(_0x1802fa){return _0x4dd881[_0xa824('0x21')](_0x387769)[_0xa824('0x22')](_0x1802fa);}};}function respondWithFilteredResult(_0x3b6b6c,_0x39ace4){return function(_0x3db3f0){if(_0x3db3f0){var _0x1d0659=typeof _0x39ace4[_0xa824('0x23')]===_0xa824('0x24')&&typeof _0x39ace4['limit']==='undefined';var _0x166394=_0x3db3f0[_0xa824('0x25')];var _0x48ade7=_0x1d0659?0x0:_0x39ace4[_0xa824('0x23')];var _0x3d807f=_0x1d0659?_0x3db3f0['count']:_0x39ace4[_0xa824('0x23')]+_0x39ace4[_0xa824('0x26')];var _0x1eaf3b;if(_0x3d807f>=_0x166394){_0x3d807f=_0x166394;_0x1eaf3b=0xc8;}else{_0x1eaf3b=0xce;}_0x3b6b6c[_0xa824('0x21')](_0x1eaf3b);return _0x3b6b6c['set'](_0xa824('0x27'),_0x48ade7+'-'+_0x3d807f+'/'+_0x166394)[_0xa824('0x22')](_0x3db3f0);}return null;};}function patchUpdates(_0x2919fb){return function(_0x1576cf){try{jsonpatch[_0xa824('0x28')](_0x1576cf,_0x2919fb,!![]);}catch(_0x22e093){return BPromise['reject'](_0x22e093);}return _0x1576cf[_0xa824('0x29')]();};}function saveUpdates(_0x3c6d94,_0x5683ef){return function(_0x197487){if(_0x197487){return _0x197487['update'](_0x3c6d94)[_0xa824('0x2a')](function(_0xcf0773){return _0xcf0773;});}return null;};}function removeEntity(_0x1c22ed,_0x2cac7e){return function(_0x15f1fb){if(_0x15f1fb){return _0x15f1fb[_0xa824('0x2b')]()[_0xa824('0x2a')](function(){_0x1c22ed[_0xa824('0x21')](0xcc)[_0xa824('0x20')]();});}};}function handleEntityNotFound(_0x3408d6,_0x4a610c){return function(_0x5b7ac6){if(!_0x5b7ac6){_0x3408d6['sendStatus'](0x194);}return _0x5b7ac6;};}function handleError(_0x230489,_0x842324){_0x842324=_0x842324||0x1f4;return function(_0x4b423c){logger[_0xa824('0x2c')](_0x4b423c[_0xa824('0x2d')]);if(_0x4b423c['name']){delete _0x4b423c['name'];}_0x230489[_0xa824('0x21')](_0x842324)[_0xa824('0x2e')](_0x4b423c);};}exports[_0xa824('0x2f')]=function(_0x26b876,_0x2d2875){var _0xda469a={},_0x5ccbbc={},_0x11b4ec={'count':0x0,'rows':[]};var _0x301426=_['map'](db[_0xa824('0x30')][_0xa824('0x31')],function(_0x5e818e){return{'name':_0x5e818e[_0xa824('0x32')],'type':_0x5e818e[_0xa824('0x33')][_0xa824('0x34')]};});_0x5ccbbc[_0xa824('0x35')]=_[_0xa824('0x36')](_0x301426,_0xa824('0x37'));_0x5ccbbc[_0xa824('0x38')]=_[_0xa824('0x39')](_0x26b876[_0xa824('0x38')]);_0x5ccbbc[_0xa824('0x3a')]=_[_0xa824('0x3b')](_0x5ccbbc[_0xa824('0x35')],_0x5ccbbc[_0xa824('0x38')]);_0xda469a[_0xa824('0x3c')]=_['intersection'](_0x5ccbbc['model'],qs[_0xa824('0x3d')](_0x26b876['query'][_0xa824('0x3d')]));_0xda469a[_0xa824('0x3c')]=_0xda469a['attributes'][_0xa824('0x3e')]?_0xda469a[_0xa824('0x3c')]:_0x5ccbbc['model'];if(!_0x26b876[_0xa824('0x38')][_0xa824('0x3f')](_0xa824('0x40'))){_0xda469a[_0xa824('0x26')]=qs['limit'](_0x26b876[_0xa824('0x38')][_0xa824('0x26')]);_0xda469a['offset']=qs[_0xa824('0x23')](_0x26b876[_0xa824('0x38')][_0xa824('0x23')]);}_0xda469a[_0xa824('0x41')]=qs[_0xa824('0x42')](_0x26b876[_0xa824('0x38')]['sort']);_0xda469a['where']=qs[_0xa824('0x3a')](_[_0xa824('0x43')](_0x26b876[_0xa824('0x38')],_0x5ccbbc[_0xa824('0x3a')]),_0x301426);if(_0x26b876[_0xa824('0x38')]['filter']){_0xda469a['where']=_['merge'](_0xda469a[_0xa824('0x44')],{'$or':_[_0xa824('0x36')](_0x301426,function(_0xe38f12){if(_0xe38f12['type']!==_0xa824('0x45')){var _0x9aadf5={};_0x9aadf5[_0xe38f12['name']]={'$like':'%'+_0x26b876['query']['filter']+'%'};return _0x9aadf5;}})});}_0xda469a=_[_0xa824('0x46')]({},_0xda469a,_0x26b876[_0xa824('0x47')]);var _0x369dcb={'where':_0xda469a['where']};return db[_0xa824('0x30')][_0xa824('0x25')](_0x369dcb)[_0xa824('0x2a')](function(_0x316da7){_0x11b4ec['count']=_0x316da7;if(_0x26b876[_0xa824('0x38')][_0xa824('0x48')]){_0xda469a[_0xa824('0x49')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0xda469a);})[_0xa824('0x2a')](function(_0xa70d10){_0x11b4ec[_0xa824('0x4a')]=_0xa70d10;return _0x11b4ec;})['then'](respondWithFilteredResult(_0x2d2875,_0xda469a))[_0xa824('0x4b')](handleError(_0x2d2875,null));};exports[_0xa824('0x4c')]=function(_0x2d167d,_0x176697){var _0x1bd0aa={'raw':![],'where':{'id':_0x2d167d[_0xa824('0x4d')]['id']}},_0x210920={};_0x210920[_0xa824('0x35')]=_[_0xa824('0x39')](db['VoiceQueueReport']['rawAttributes']);_0x210920['query']=_['keys'](_0x2d167d['query']);_0x210920[_0xa824('0x3a')]=_[_0xa824('0x3b')](_0x210920[_0xa824('0x35')],_0x210920[_0xa824('0x38')]);_0x1bd0aa[_0xa824('0x3c')]=_[_0xa824('0x3b')](_0x210920[_0xa824('0x35')],qs[_0xa824('0x3d')](_0x2d167d[_0xa824('0x38')][_0xa824('0x3d')]));_0x1bd0aa[_0xa824('0x3c')]=_0x1bd0aa[_0xa824('0x3c')]['length']?_0x1bd0aa[_0xa824('0x3c')]:_0x210920['model'];if(_0x2d167d[_0xa824('0x38')][_0xa824('0x48')]){_0x1bd0aa[_0xa824('0x49')]=[{'all':!![]}];}_0x1bd0aa=_[_0xa824('0x46')]({},_0x1bd0aa,_0x2d167d[_0xa824('0x47')]);return db[_0xa824('0x30')][_0xa824('0x4e')](_0x1bd0aa)[_0xa824('0x2a')](handleEntityNotFound(_0x176697,null))[_0xa824('0x2a')](respondWithResult(_0x176697,null))[_0xa824('0x4b')](handleError(_0x176697,null));};exports[_0xa824('0x4f')]=function(_0x47a40e,_0x535204){return db['VoiceQueueReport'][_0xa824('0x4f')](_0x47a40e[_0xa824('0x50')],{})['then'](respondWithResult(_0x535204,0xc9))[_0xa824('0x4b')](handleError(_0x535204,null));};exports[_0xa824('0x51')]=function(_0x3e4fa8,_0x2c3b54){if(_0x3e4fa8[_0xa824('0x50')]['id']){delete _0x3e4fa8[_0xa824('0x50')]['id'];}return db[_0xa824('0x30')][_0xa824('0x4e')]({'where':{'id':_0x3e4fa8['params']['id']}})[_0xa824('0x2a')](handleEntityNotFound(_0x2c3b54,null))[_0xa824('0x2a')](saveUpdates(_0x3e4fa8[_0xa824('0x50')],null))['then'](respondWithResult(_0x2c3b54,null))[_0xa824('0x4b')](handleError(_0x2c3b54,null));};exports[_0xa824('0x2b')]=function(_0x4f73fc,_0x361b4c){return db[_0xa824('0x30')][_0xa824('0x4e')]({'where':{'id':_0x4f73fc[_0xa824('0x4d')]['id']}})[_0xa824('0x2a')](handleEntityNotFound(_0x361b4c,null))['then'](removeEntity(_0x361b4c,null))[_0xa824('0x4b')](handleError(_0x361b4c,null));};exports['describe']=function(_0x23653f,_0x56fb21){return db[_0xa824('0x30')][_0xa824('0x52')]()[_0xa824('0x2a')](respondWithResult(_0x56fb21,null))[_0xa824('0x4b')](handleError(_0x56fb21,null));};exports[_0xa824('0x53')]=function(_0x4eced3,_0x2cff96){var _0x4eb950={},_0x204d69={},_0x35f8aa={'count':0x0,'rows':[]};_0x204d69[_0xa824('0x35')]=_[_0xa824('0x39')](db['VoiceQueueReport']['rawAttributes']);_0x204d69[_0xa824('0x38')]=_[_0xa824('0x39')](_0x4eced3['query']);_0x204d69[_0xa824('0x3a')]=_[_0xa824('0x3b')](_0x204d69[_0xa824('0x35')],_0x204d69[_0xa824('0x38')]);_0x4eb950['attributes']=_[_0xa824('0x3b')](_0x204d69[_0xa824('0x35')],qs[_0xa824('0x3d')](_0x4eced3[_0xa824('0x38')][_0xa824('0x3d')]));_0x4eb950[_0xa824('0x3c')]=_0x4eb950[_0xa824('0x3c')][_0xa824('0x3e')]?_0x4eb950[_0xa824('0x3c')]:_0x204d69[_0xa824('0x35')];if(!_0x4eced3[_0xa824('0x38')][_0xa824('0x3f')](_0xa824('0x40'))){_0x4eb950[_0xa824('0x26')]=qs[_0xa824('0x26')](_0x4eced3[_0xa824('0x38')][_0xa824('0x26')]);_0x4eb950[_0xa824('0x23')]=qs[_0xa824('0x23')](_0x4eced3['query'][_0xa824('0x23')]);}_0x4eb950[_0xa824('0x41')]=qs[_0xa824('0x42')](_0x4eced3['query'][_0xa824('0x42')]);_0x4eb950[_0xa824('0x44')]=qs[_0xa824('0x3a')](_['pick'](_0x4eced3[_0xa824('0x38')],_0x204d69[_0xa824('0x3a')]));if(_0x4eced3[_0xa824('0x38')][_0xa824('0x54')]){_0x4eb950[_0xa824('0x44')]=_['merge'](_0x4eb950[_0xa824('0x44')],{'$or':_['map'](_0x4eb950[_0xa824('0x3c')],function(_0x24b0e4){var _0xb6c7d3={};_0xb6c7d3[_0x24b0e4]={'$like':'%'+_0x4eced3[_0xa824('0x38')]['filter']+'%'};return _0xb6c7d3;})});}_0x4eb950=_['merge']({},_0x4eb950,_0x4eced3[_0xa824('0x47')]);var _0x174eee={'where':_0x4eb950[_0xa824('0x44')]};return db[_0xa824('0x30')]['count'](_0x174eee)[_0xa824('0x2a')](function(_0x4b5f86){_0x35f8aa['count']=_0x4b5f86;if(_0x4eced3[_0xa824('0x38')]['includeAll']){_0x4eb950[_0xa824('0x49')]=[{'all':!![]}];}return db[_0xa824('0x30')][_0xa824('0x55')](_0x4eb950);})[_0xa824('0x2a')](function(_0x49f979){_0x35f8aa[_0xa824('0x4a')]=_0x49f979;return _0x35f8aa;})[_0xa824('0x2a')](respondWithFilteredResult(_0x2cff96,_0x4eb950,_0xa824('0x53')))[_0xa824('0x4b')](handleError(_0x2cff96,null,_0xa824('0x53')));}; \ No newline at end of file +var _0x6dac=['../../mysqldb','redis','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','index','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','rows','catch','show','params','model','keys','find','create','body','describe','pick','map','findAll','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x6dac,0xe1));var _0xc6da=function(_0x1249db,_0xe5b1b5){_0x1249db=_0x1249db-0x0;var _0x4a68b6=_0x6dac[_0x1249db];return _0x4a68b6;};'use strict';var emlformat=require(_0xc6da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6da('0x1'));var jsonpatch=require(_0xc6da('0x2'));var rp=require('request-promise');var moment=require(_0xc6da('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc6da('0x4'));var util=require(_0xc6da('0x5'));var path=require(_0xc6da('0x6'));var sox=require('sox');var csv=require(_0xc6da('0x7'));var ejs=require(_0xc6da('0x8'));var fs=require('fs');var fs_extra=require(_0xc6da('0x9'));var _=require(_0xc6da('0xa'));var squel=require(_0xc6da('0xb'));var crypto=require(_0xc6da('0xc'));var jsforce=require(_0xc6da('0xd'));var deskjs=require(_0xc6da('0xe'));var toCsv=require(_0xc6da('0x7'));var querystring=require(_0xc6da('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc6da('0x10'));var qs=require(_0xc6da('0x11'));var as=require(_0xc6da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6da('0x13'))(_0xc6da('0x14'));var utils=require(_0xc6da('0x15'));var config=require(_0xc6da('0x16'));var licenseUtil=require(_0xc6da('0x17'));var db=require(_0xc6da('0x18'))['db'];config[_0xc6da('0x19')]=_['defaults'](config[_0xc6da('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6da('0x1a'))(new Redis(config[_0xc6da('0x19')]));require(_0xc6da('0x1b'))[_0xc6da('0x1c')](socket);function respondWithStatusCode(_0x2c650e,_0x49bd81){_0x49bd81=_0x49bd81||0xcc;return function(_0x427039){if(_0x427039){return _0x2c650e[_0xc6da('0x1d')](_0x49bd81);}return _0x2c650e[_0xc6da('0x1e')](_0x49bd81)[_0xc6da('0x1f')]();};}function respondWithResult(_0x1135f8,_0xf06397){_0xf06397=_0xf06397||0xc8;return function(_0x436946){if(_0x436946){return _0x1135f8['status'](_0xf06397)['json'](_0x436946);}};}function respondWithFilteredResult(_0x42d370,_0x24b17d){return function(_0x5dd0ed){if(_0x5dd0ed){var _0x516c5d=typeof _0x24b17d[_0xc6da('0x20')]===_0xc6da('0x21')&&typeof _0x24b17d[_0xc6da('0x22')]==='undefined';var _0x5ed355=_0x5dd0ed['count'];var _0x85a566=_0x516c5d?0x0:_0x24b17d['offset'];var _0x4664c0=_0x516c5d?_0x5dd0ed[_0xc6da('0x23')]:_0x24b17d['offset']+_0x24b17d[_0xc6da('0x22')];var _0x3162f0;if(_0x4664c0>=_0x5ed355){_0x4664c0=_0x5ed355;_0x3162f0=0xc8;}else{_0x3162f0=0xce;}_0x42d370['status'](_0x3162f0);return _0x42d370[_0xc6da('0x24')](_0xc6da('0x25'),_0x85a566+'-'+_0x4664c0+'/'+_0x5ed355)[_0xc6da('0x26')](_0x5dd0ed);}return null;};}function patchUpdates(_0x401a98){return function(_0x445e2e){try{jsonpatch[_0xc6da('0x27')](_0x445e2e,_0x401a98,!![]);}catch(_0x11c7a6){return BPromise[_0xc6da('0x28')](_0x11c7a6);}return _0x445e2e[_0xc6da('0x29')]();};}function saveUpdates(_0x34f923,_0x576f50){return function(_0x47da4a){if(_0x47da4a){return _0x47da4a[_0xc6da('0x2a')](_0x34f923)[_0xc6da('0x2b')](function(_0x2c8941){return _0x2c8941;});}return null;};}function removeEntity(_0x20b361,_0x118fc6){return function(_0x223954){if(_0x223954){return _0x223954[_0xc6da('0x2c')]()['then'](function(){_0x20b361[_0xc6da('0x1e')](0xcc)[_0xc6da('0x1f')]();});}};}function handleEntityNotFound(_0x10d1ae,_0x17b34c){return function(_0x538252){if(!_0x538252){_0x10d1ae[_0xc6da('0x1d')](0x194);}return _0x538252;};}function handleError(_0x1127e3,_0x43becd){_0x43becd=_0x43becd||0x1f4;return function(_0x2b407d){logger['error'](_0x2b407d['stack']);if(_0x2b407d[_0xc6da('0x2d')]){delete _0x2b407d[_0xc6da('0x2d')];}_0x1127e3[_0xc6da('0x1e')](_0x43becd)['send'](_0x2b407d);};}exports[_0xc6da('0x2e')]=function(_0x1b44aa,_0x3a8c74){var _0x440525={},_0x480db3={},_0x3dddd7={'count':0x0,'rows':[]};var _0xf18298=_['map'](db['VoiceQueueReport'][_0xc6da('0x2f')],function(_0x45eb8b){return{'name':_0x45eb8b[_0xc6da('0x30')],'type':_0x45eb8b[_0xc6da('0x31')][_0xc6da('0x32')]};});_0x480db3['model']=_['map'](_0xf18298,_0xc6da('0x2d'));_0x480db3[_0xc6da('0x33')]=_['keys'](_0x1b44aa[_0xc6da('0x33')]);_0x480db3[_0xc6da('0x34')]=_[_0xc6da('0x35')](_0x480db3['model'],_0x480db3[_0xc6da('0x33')]);_0x440525[_0xc6da('0x36')]=_[_0xc6da('0x35')](_0x480db3['model'],qs[_0xc6da('0x37')](_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x37')]));_0x440525[_0xc6da('0x36')]=_0x440525[_0xc6da('0x36')][_0xc6da('0x38')]?_0x440525[_0xc6da('0x36')]:_0x480db3['model'];if(!_0x1b44aa['query'][_0xc6da('0x39')](_0xc6da('0x3a'))){_0x440525[_0xc6da('0x22')]=qs[_0xc6da('0x22')](_0x1b44aa[_0xc6da('0x33')]['limit']);_0x440525[_0xc6da('0x20')]=qs[_0xc6da('0x20')](_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x20')]);}_0x440525[_0xc6da('0x3b')]=qs[_0xc6da('0x3c')](_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x3c')]);_0x440525[_0xc6da('0x3d')]=qs['filters'](_['pick'](_0x1b44aa[_0xc6da('0x33')],_0x480db3[_0xc6da('0x34')]),_0xf18298);if(_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x3e')]){_0x440525[_0xc6da('0x3d')]=_[_0xc6da('0x3f')](_0x440525[_0xc6da('0x3d')],{'$or':_['map'](_0xf18298,function(_0x392965){if(_0x392965['type']!==_0xc6da('0x40')){var _0xadf903={};_0xadf903[_0x392965[_0xc6da('0x2d')]]={'$like':'%'+_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x3e')]+'%'};return _0xadf903;}})});}_0x440525=_[_0xc6da('0x3f')]({},_0x440525,_0x1b44aa[_0xc6da('0x41')]);var _0x3577a8={'where':_0x440525[_0xc6da('0x3d')]};return db[_0xc6da('0x42')][_0xc6da('0x23')](_0x3577a8)[_0xc6da('0x2b')](function(_0x12bef4){_0x3dddd7[_0xc6da('0x23')]=_0x12bef4;if(_0x1b44aa[_0xc6da('0x33')][_0xc6da('0x43')]){_0x440525[_0xc6da('0x44')]=[{'all':!![]}];}return db[_0xc6da('0x42')]['findAll'](_0x440525);})[_0xc6da('0x2b')](function(_0xdabed4){_0x3dddd7[_0xc6da('0x45')]=_0xdabed4;return _0x3dddd7;})[_0xc6da('0x2b')](respondWithFilteredResult(_0x3a8c74,_0x440525))[_0xc6da('0x46')](handleError(_0x3a8c74,null));};exports[_0xc6da('0x47')]=function(_0x431449,_0x3e7b36){var _0x37e1a6={'raw':![],'where':{'id':_0x431449[_0xc6da('0x48')]['id']}},_0x40602d={};_0x40602d[_0xc6da('0x49')]=_[_0xc6da('0x4a')](db[_0xc6da('0x42')][_0xc6da('0x2f')]);_0x40602d[_0xc6da('0x33')]=_[_0xc6da('0x4a')](_0x431449['query']);_0x40602d['filters']=_[_0xc6da('0x35')](_0x40602d[_0xc6da('0x49')],_0x40602d[_0xc6da('0x33')]);_0x37e1a6[_0xc6da('0x36')]=_[_0xc6da('0x35')](_0x40602d[_0xc6da('0x49')],qs['fields'](_0x431449[_0xc6da('0x33')][_0xc6da('0x37')]));_0x37e1a6['attributes']=_0x37e1a6[_0xc6da('0x36')][_0xc6da('0x38')]?_0x37e1a6['attributes']:_0x40602d[_0xc6da('0x49')];if(_0x431449['query'][_0xc6da('0x43')]){_0x37e1a6[_0xc6da('0x44')]=[{'all':!![]}];}_0x37e1a6=_[_0xc6da('0x3f')]({},_0x37e1a6,_0x431449[_0xc6da('0x41')]);return db['VoiceQueueReport'][_0xc6da('0x4b')](_0x37e1a6)[_0xc6da('0x2b')](handleEntityNotFound(_0x3e7b36,null))['then'](respondWithResult(_0x3e7b36,null))[_0xc6da('0x46')](handleError(_0x3e7b36,null));};exports[_0xc6da('0x4c')]=function(_0xc33ec5,_0x38bd6e){return db[_0xc6da('0x42')]['create'](_0xc33ec5['body'],{})[_0xc6da('0x2b')](respondWithResult(_0x38bd6e,0xc9))[_0xc6da('0x46')](handleError(_0x38bd6e,null));};exports[_0xc6da('0x2a')]=function(_0x56a52d,_0x3733f5){if(_0x56a52d[_0xc6da('0x4d')]['id']){delete _0x56a52d[_0xc6da('0x4d')]['id'];}return db[_0xc6da('0x42')][_0xc6da('0x4b')]({'where':{'id':_0x56a52d[_0xc6da('0x48')]['id']}})[_0xc6da('0x2b')](handleEntityNotFound(_0x3733f5,null))[_0xc6da('0x2b')](saveUpdates(_0x56a52d[_0xc6da('0x4d')],null))['then'](respondWithResult(_0x3733f5,null))[_0xc6da('0x46')](handleError(_0x3733f5,null));};exports[_0xc6da('0x2c')]=function(_0xd8dd40,_0x1816c4){return db[_0xc6da('0x42')]['find']({'where':{'id':_0xd8dd40[_0xc6da('0x48')]['id']}})[_0xc6da('0x2b')](handleEntityNotFound(_0x1816c4,null))[_0xc6da('0x2b')](removeEntity(_0x1816c4,null))[_0xc6da('0x46')](handleError(_0x1816c4,null));};exports[_0xc6da('0x4e')]=function(_0x23913a,_0xfb4013){return db['VoiceQueueReport'][_0xc6da('0x4e')]()[_0xc6da('0x2b')](respondWithResult(_0xfb4013,null))[_0xc6da('0x46')](handleError(_0xfb4013,null));};exports['getVoiceQueuesReport']=function(_0x3fecac,_0x396320){var _0x35689d={},_0x306995={},_0x2043d5={'count':0x0,'rows':[]};_0x306995[_0xc6da('0x49')]=_[_0xc6da('0x4a')](db[_0xc6da('0x42')][_0xc6da('0x2f')]);_0x306995[_0xc6da('0x33')]=_['keys'](_0x3fecac[_0xc6da('0x33')]);_0x306995[_0xc6da('0x34')]=_[_0xc6da('0x35')](_0x306995['model'],_0x306995[_0xc6da('0x33')]);_0x35689d[_0xc6da('0x36')]=_[_0xc6da('0x35')](_0x306995[_0xc6da('0x49')],qs['fields'](_0x3fecac[_0xc6da('0x33')][_0xc6da('0x37')]));_0x35689d[_0xc6da('0x36')]=_0x35689d[_0xc6da('0x36')][_0xc6da('0x38')]?_0x35689d[_0xc6da('0x36')]:_0x306995[_0xc6da('0x49')];if(!_0x3fecac[_0xc6da('0x33')][_0xc6da('0x39')](_0xc6da('0x3a'))){_0x35689d[_0xc6da('0x22')]=qs[_0xc6da('0x22')](_0x3fecac[_0xc6da('0x33')][_0xc6da('0x22')]);_0x35689d['offset']=qs[_0xc6da('0x20')](_0x3fecac['query'][_0xc6da('0x20')]);}_0x35689d[_0xc6da('0x3b')]=qs['sort'](_0x3fecac[_0xc6da('0x33')][_0xc6da('0x3c')]);_0x35689d[_0xc6da('0x3d')]=qs[_0xc6da('0x34')](_[_0xc6da('0x4f')](_0x3fecac['query'],_0x306995[_0xc6da('0x34')]));if(_0x3fecac[_0xc6da('0x33')]['filter']){_0x35689d[_0xc6da('0x3d')]=_[_0xc6da('0x3f')](_0x35689d['where'],{'$or':_[_0xc6da('0x50')](_0x35689d[_0xc6da('0x36')],function(_0x187018){var _0x4f827e={};_0x4f827e[_0x187018]={'$like':'%'+_0x3fecac[_0xc6da('0x33')][_0xc6da('0x3e')]+'%'};return _0x4f827e;})});}_0x35689d=_[_0xc6da('0x3f')]({},_0x35689d,_0x3fecac[_0xc6da('0x41')]);var _0x369047={'where':_0x35689d[_0xc6da('0x3d')]};return db[_0xc6da('0x42')][_0xc6da('0x23')](_0x369047)[_0xc6da('0x2b')](function(_0x248c65){_0x2043d5['count']=_0x248c65;if(_0x3fecac[_0xc6da('0x33')][_0xc6da('0x43')]){_0x35689d['include']=[{'all':!![]}];}return db[_0xc6da('0x42')][_0xc6da('0x51')](_0x35689d);})[_0xc6da('0x2b')](function(_0x1d41ab){_0x2043d5[_0xc6da('0x45')]=_0x1d41ab;return _0x2043d5;})['then'](respondWithFilteredResult(_0x396320,_0x35689d,_0xc6da('0x52')))[_0xc6da('0x46')](handleError(_0x396320,null,_0xc6da('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d7e37c1..fd626ae 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 _0x286d=['events','../../mysqldb','VoiceQueueReport','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x286d,0xb4));var _0xd286=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x286d[_0x46aff0];return _0x9d78cf;};'use strict';var EventEmitter=require(_0xd286('0x0'));var VoiceQueueReport=require(_0xd286('0x1'))['db'][_0xd286('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd286('0x3'),'afterUpdate':'update','afterDestroy':_0xd286('0x4')};function emitEvent(_0x68d1f){return function(_0x2eb3cf,_0x16c064,_0x287f14){VoiceQueueReportEvents[_0xd286('0x5')](_0x68d1f+':'+_0x2eb3cf['id'],_0x2eb3cf);VoiceQueueReportEvents[_0xd286('0x5')](_0x68d1f,_0x2eb3cf);_0x287f14(null);};}for(var e in events){if(events[_0xd286('0x6')](e)){var event=events[e];VoiceQueueReport[_0xd286('0x7')](e,emitEvent(event));}}module[_0xd286('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x723e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save'];(function(_0x4bbccd,_0x45b258){var _0x29aa10=function(_0x5863c4){while(--_0x5863c4){_0x4bbccd['push'](_0x4bbccd['shift']());}};_0x29aa10(++_0x45b258);}(_0x723e,0xb9));var _0xe723=function(_0x4e848,_0xdc4e75){_0x4e848=_0x4e848-0x0;var _0x1eba5e=_0x723e[_0x4e848];return _0x1eba5e;};'use strict';var EventEmitter=require(_0xe723('0x0'));var VoiceQueueReport=require(_0xe723('0x1'))['db'][_0xe723('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe723('0x3'),'afterUpdate':'update','afterDestroy':_0xe723('0x4')};function emitEvent(_0x11b8fd){return function(_0x378041,_0x1341b4,_0x1ed36d){VoiceQueueReportEvents[_0xe723('0x5')](_0x11b8fd+':'+_0x378041['id'],_0x378041);VoiceQueueReportEvents[_0xe723('0x5')](_0x11b8fd,_0x378041);_0x1ed36d(null);};}for(var e in events){if(events[_0xe723('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe723('0x7')](e,emitEvent(event));}}module[_0xe723('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 72945be..024896e 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 _0x554d=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment'];(function(_0x1bc798,_0x2ab7c9){var _0x3308ca=function(_0x12f3da){while(--_0x12f3da){_0x1bc798['push'](_0x1bc798['shift']());}};_0x3308ca(++_0x2ab7c9);}(_0x554d,0xb3));var _0xd554=function(_0x584e52,_0x5443dc){_0x584e52=_0x584e52-0x0;var _0x5cf710=_0x554d[_0x584e52];return _0x5cf710;};'use strict';var _=require('lodash');var util=require(_0xd554('0x0'));var logger=require('../../config/logger')(_0xd554('0x1'));var moment=require(_0xd554('0x2'));var BPromise=require(_0xd554('0x3'));var rp=require(_0xd554('0x4'));var fs=require('fs');var path=require(_0xd554('0x5'));var rimraf=require(_0xd554('0x6'));var config=require(_0xd554('0x7'));var attributes=require(_0xd554('0x8'));module[_0xd554('0x9')]=function(_0x5979fb,_0x3f0810){return _0x5979fb['define'](_0xd554('0xa'),attributes,{'tableName':_0xd554('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd554('0xc')]},{'fields':[_0xd554('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8269=['calleridnum','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','uniqueid'];(function(_0x21f9fc,_0x33b8f2){var _0x1b5af9=function(_0x506f67){while(--_0x506f67){_0x21f9fc['push'](_0x21f9fc['shift']());}};_0x1b5af9(++_0x33b8f2);}(_0x8269,0xbc));var _0x9826=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8269[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x9826('0x0'));var util=require('util');var logger=require(_0x9826('0x1'))(_0x9826('0x2'));var moment=require(_0x9826('0x3'));var BPromise=require(_0x9826('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9826('0x5'));var rimraf=require(_0x9826('0x6'));var config=require(_0x9826('0x7'));var attributes=require(_0x9826('0x8'));module['exports']=function(_0xda46bd,_0x44fd1b){return _0xda46bd['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x9826('0x9')]},{'fields':[_0x9826('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 2009dc4..5b9d39c 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 _0xd60d=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','create','update','body','UpdateVoiceQueueReport'];(function(_0x1b0f2c,_0x34c8c4){var _0x129367=function(_0x54a5b1){while(--_0x54a5b1){_0x1b0f2c['push'](_0x1b0f2c['shift']());}};_0x129367(++_0x34c8c4);}(_0xd60d,0xa9));var _0xdd60=function(_0x517745,_0x35a2d6){_0x517745=_0x517745-0x0;var _0x8bcdbf=_0xd60d[_0x517745];return _0x8bcdbf;};'use strict';var _=require(_0xdd60('0x0'));var util=require(_0xdd60('0x1'));var moment=require('moment');var BPromise=require(_0xdd60('0x2'));var rs=require(_0xdd60('0x3'));var fs=require('fs');var Redis=require(_0xdd60('0x4'));var db=require(_0xdd60('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd60('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xdd60('0x7')](config[_0xdd60('0x8')],{'host':_0xdd60('0x9'),'port':0x18eb});var socket=require(_0xdd60('0xa'))(new Redis(config[_0xdd60('0x8')]));require(_0xdd60('0xb'))[_0xdd60('0xc')](socket);function respondWithRpcPromise(_0x2d5ad0,_0x45196,_0x384287){return new BPromise(function(_0x34bb12,_0x2ada1e){return client[_0xdd60('0xd')](_0x2d5ad0,_0x384287)[_0xdd60('0xe')](function(_0x385ee4){logger[_0xdd60('0xf')](_0xdd60('0x10'),_0x45196,_0xdd60('0x11'));logger[_0xdd60('0x12')](_0xdd60('0x13'),_0x45196,_0xdd60('0x11'),JSON['stringify'](_0x385ee4));if(_0x385ee4[_0xdd60('0x14')]){if(_0x385ee4[_0xdd60('0x14')][_0xdd60('0x15')]===0x1f4){logger[_0xdd60('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x45196,_0x385ee4[_0xdd60('0x14')]['message']);return _0x2ada1e(_0x385ee4[_0xdd60('0x14')][_0xdd60('0x16')]);}logger[_0xdd60('0x14')](_0xdd60('0x10'),_0x45196,_0x385ee4[_0xdd60('0x14')][_0xdd60('0x16')]);return _0x34bb12(_0x385ee4[_0xdd60('0x14')][_0xdd60('0x16')]);}else{logger[_0xdd60('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x45196,'request\x20sent');_0x34bb12(_0x385ee4[_0xdd60('0x17')]['message']);}})['catch'](function(_0x3a73b3){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x45196,_0x3a73b3);_0x2ada1e(_0x3a73b3);});});}exports[_0xdd60('0x18')]=function(_0x42d00e){var _0x3d4062=this;return new Promise(function(_0x28f3cf,_0x381d4b){return db[_0xdd60('0x19')][_0xdd60('0x1a')]({'raw':_0x42d00e[_0xdd60('0x1b')]?_0x42d00e[_0xdd60('0x1b')][_0xdd60('0x1c')]===undefined?!![]:![]:!![],'where':_0x42d00e['options']?_0x42d00e[_0xdd60('0x1b')][_0xdd60('0x1d')]||null:null,'attributes':_0x42d00e['options']?_0x42d00e['options'][_0xdd60('0x1e')]||null:null,'limit':_0x42d00e[_0xdd60('0x1b')]?_0x42d00e[_0xdd60('0x1b')][_0xdd60('0x1f')]||null:null,'include':_0x42d00e[_0xdd60('0x1b')]?_0x42d00e[_0xdd60('0x1b')][_0xdd60('0x20')]?_['map'](_0x42d00e[_0xdd60('0x1b')][_0xdd60('0x20')],function(_0x26b585){return{'model':db[_0x26b585['model']],'as':_0x26b585['as'],'attributes':_0x26b585[_0xdd60('0x1e')],'include':_0x26b585[_0xdd60('0x20')]?_['map'](_0x26b585[_0xdd60('0x20')],function(_0x5691c8){return{'model':db[_0x5691c8[_0xdd60('0x21')]],'as':_0x5691c8['as'],'attributes':_0x5691c8['attributes'],'include':_0x5691c8[_0xdd60('0x20')]?_[_0xdd60('0x22')](_0x5691c8[_0xdd60('0x20')],function(_0x5ef94d){return{'model':db[_0x5ef94d['model']],'as':_0x5ef94d['as'],'attributes':_0x5ef94d[_0xdd60('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ea352){logger[_0xdd60('0xf')](_0xdd60('0x18'),_0x42d00e);logger[_0xdd60('0x12')](_0xdd60('0x18'),_0x42d00e,JSON['stringify'](_0x3ea352));_0x28f3cf(_0x3ea352);})[_0xdd60('0x23')](function(_0x10f42a){logger['error'](_0xdd60('0x18'),_0x10f42a[_0xdd60('0x16')],_0x42d00e);_0x381d4b(_0x3d4062[_0xdd60('0x14')](0x1f4,_0x10f42a[_0xdd60('0x16')]));});});};exports[_0xdd60('0x24')]=function(_0x1546a9){var _0x177e4a=this;return new Promise(function(_0x566a95,_0x49bd83){return db[_0xdd60('0x19')][_0xdd60('0x25')](_0x1546a9['body'],{'raw':_0x1546a9[_0xdd60('0x1b')]?_0x1546a9['options']['raw']===undefined?!![]:![]:!![]})[_0xdd60('0xe')](function(_0x2ba9a5){logger[_0xdd60('0xf')](_0xdd60('0x24'),_0x1546a9);logger[_0xdd60('0x12')](_0xdd60('0x24'),_0x1546a9,JSON['stringify'](_0x2ba9a5));_0x566a95(_0x2ba9a5);})[_0xdd60('0x23')](function(_0x554180){logger[_0xdd60('0x14')](_0xdd60('0x24'),_0x554180['message'],_0x1546a9);_0x49bd83(_0x177e4a[_0xdd60('0x14')](0x1f4,_0x554180[_0xdd60('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x33e9d3){var _0x597222=this;return new Promise(function(_0x26668a,_0x2f0761){return db[_0xdd60('0x19')][_0xdd60('0x26')](_0x33e9d3[_0xdd60('0x27')],{'raw':_0x33e9d3[_0xdd60('0x1b')]?_0x33e9d3[_0xdd60('0x1b')][_0xdd60('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33e9d3['options']?_0x33e9d3[_0xdd60('0x1b')][_0xdd60('0x1d')]||null:null,'attributes':_0x33e9d3[_0xdd60('0x1b')]?_0x33e9d3[_0xdd60('0x1b')][_0xdd60('0x1e')]||null:null,'limit':_0x33e9d3[_0xdd60('0x1b')]?_0x33e9d3['options'][_0xdd60('0x1f')]||null:null})[_0xdd60('0xe')](function(_0x3394f2){logger[_0xdd60('0xf')]('UpdateVoiceQueueReport',_0x33e9d3);logger[_0xdd60('0x12')](_0xdd60('0x28'),_0x33e9d3,JSON[_0xdd60('0x29')](_0x3394f2));_0x26668a(_0x3394f2);})['catch'](function(_0x4410b2){logger[_0xdd60('0x14')]('UpdateVoiceQueueReport',_0x4410b2['message'],_0x33e9d3);_0x2f0761(_0x597222[_0xdd60('0x14')](0x1f4,_0x4410b2['message']));});});}; \ No newline at end of file +var _0x0464=['CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','VoiceQueueReport','create','body'];(function(_0x21de23,_0x39837b){var _0xae92d4=function(_0x184c06){while(--_0x184c06){_0x21de23['push'](_0x21de23['shift']());}};_0xae92d4(++_0x39837b);}(_0x0464,0x106));var _0x4046=function(_0x53a06e,_0x1dd83d){_0x53a06e=_0x53a06e-0x0;var _0x29b535=_0x0464[_0x53a06e];return _0x29b535;};'use strict';var _=require(_0x4046('0x0'));var util=require(_0x4046('0x1'));var moment=require(_0x4046('0x2'));var BPromise=require(_0x4046('0x3'));var rs=require(_0x4046('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4046('0x5'))['db'];var utils=require(_0x4046('0x6'));var logger=require(_0x4046('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4046('0x8'));var client=jayson[_0x4046('0x9')]['http']({'port':0x232a});config[_0x4046('0xa')]=_[_0x4046('0xb')](config['redis'],{'host':_0x4046('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4046('0xa')]));require(_0x4046('0xd'))[_0x4046('0xe')](socket);function respondWithRpcPromise(_0x4bb2e9,_0x837418,_0x44c5e4){return new BPromise(function(_0x116764,_0xd6304e){return client['request'](_0x4bb2e9,_0x44c5e4)[_0x4046('0xf')](function(_0x56a398){logger[_0x4046('0x10')](_0x4046('0x11'),_0x837418,_0x4046('0x12'));logger[_0x4046('0x13')](_0x4046('0x14'),_0x837418,_0x4046('0x12'),JSON[_0x4046('0x15')](_0x56a398));if(_0x56a398[_0x4046('0x16')]){if(_0x56a398[_0x4046('0x16')][_0x4046('0x17')]===0x1f4){logger[_0x4046('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x837418,_0x56a398[_0x4046('0x16')][_0x4046('0x18')]);return _0xd6304e(_0x56a398[_0x4046('0x16')][_0x4046('0x18')]);}logger[_0x4046('0x16')](_0x4046('0x11'),_0x837418,_0x56a398[_0x4046('0x16')][_0x4046('0x18')]);return _0x116764(_0x56a398[_0x4046('0x16')][_0x4046('0x18')]);}else{logger[_0x4046('0x10')](_0x4046('0x11'),_0x837418,_0x4046('0x12'));_0x116764(_0x56a398[_0x4046('0x19')][_0x4046('0x18')]);}})[_0x4046('0x1a')](function(_0x380fef){logger['error'](_0x4046('0x11'),_0x837418,_0x380fef);_0xd6304e(_0x380fef);});});}exports[_0x4046('0x1b')]=function(_0x401be8){var _0xe10eab=this;return new Promise(function(_0xa74ee5,_0x29cb6d){return db['VoiceQueueReport'][_0x4046('0x1c')]({'raw':_0x401be8[_0x4046('0x1d')]?_0x401be8[_0x4046('0x1d')][_0x4046('0x1e')]===undefined?!![]:![]:!![],'where':_0x401be8[_0x4046('0x1d')]?_0x401be8[_0x4046('0x1d')][_0x4046('0x1f')]||null:null,'attributes':_0x401be8[_0x4046('0x1d')]?_0x401be8[_0x4046('0x1d')][_0x4046('0x20')]||null:null,'limit':_0x401be8['options']?_0x401be8['options']['limit']||null:null,'include':_0x401be8['options']?_0x401be8[_0x4046('0x1d')][_0x4046('0x21')]?_['map'](_0x401be8[_0x4046('0x1d')][_0x4046('0x21')],function(_0x378776){return{'model':db[_0x378776['model']],'as':_0x378776['as'],'attributes':_0x378776['attributes'],'include':_0x378776[_0x4046('0x21')]?_[_0x4046('0x22')](_0x378776['include'],function(_0x4e7dce){return{'model':db[_0x4e7dce['model']],'as':_0x4e7dce['as'],'attributes':_0x4e7dce[_0x4046('0x20')],'include':_0x4e7dce[_0x4046('0x21')]?_[_0x4046('0x22')](_0x4e7dce['include'],function(_0x2f1cef){return{'model':db[_0x2f1cef[_0x4046('0x23')]],'as':_0x2f1cef['as'],'attributes':_0x2f1cef[_0x4046('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4046('0xf')](function(_0xcc8b51){logger['info'](_0x4046('0x1b'),_0x401be8);logger[_0x4046('0x13')]('GetVoiceQueueReport',_0x401be8,JSON[_0x4046('0x15')](_0xcc8b51));_0xa74ee5(_0xcc8b51);})[_0x4046('0x1a')](function(_0x3b45ee){logger[_0x4046('0x16')](_0x4046('0x1b'),_0x3b45ee['message'],_0x401be8);_0x29cb6d(_0xe10eab['error'](0x1f4,_0x3b45ee[_0x4046('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x4cf144){var _0xee9a10=this;return new Promise(function(_0xb77018,_0x1d707d){return db[_0x4046('0x24')][_0x4046('0x25')](_0x4cf144[_0x4046('0x26')],{'raw':_0x4cf144[_0x4046('0x1d')]?_0x4cf144[_0x4046('0x1d')][_0x4046('0x1e')]===undefined?!![]:![]:!![]})[_0x4046('0xf')](function(_0x346d7f){logger[_0x4046('0x10')](_0x4046('0x27'),_0x4cf144);logger[_0x4046('0x13')](_0x4046('0x27'),_0x4cf144,JSON[_0x4046('0x15')](_0x346d7f));_0xb77018(_0x346d7f);})[_0x4046('0x1a')](function(_0xfbcad7){logger[_0x4046('0x16')](_0x4046('0x27'),_0xfbcad7['message'],_0x4cf144);_0x1d707d(_0xee9a10[_0x4046('0x16')](0x1f4,_0xfbcad7[_0x4046('0x18')]));});});};exports[_0x4046('0x28')]=function(_0x33fdbd){var _0x49637f=this;return new Promise(function(_0x13dfb0,_0x44210c){return db[_0x4046('0x24')][_0x4046('0x29')](_0x33fdbd[_0x4046('0x26')],{'raw':_0x33fdbd[_0x4046('0x1d')]?_0x33fdbd[_0x4046('0x1d')][_0x4046('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33fdbd[_0x4046('0x1d')]?_0x33fdbd[_0x4046('0x1d')][_0x4046('0x1f')]||null:null,'attributes':_0x33fdbd['options']?_0x33fdbd['options'][_0x4046('0x20')]||null:null,'limit':_0x33fdbd[_0x4046('0x1d')]?_0x33fdbd[_0x4046('0x1d')][_0x4046('0x2a')]||null:null})[_0x4046('0xf')](function(_0x4c56c8){logger[_0x4046('0x10')](_0x4046('0x28'),_0x33fdbd);logger[_0x4046('0x13')]('UpdateVoiceQueueReport',_0x33fdbd,JSON['stringify'](_0x4c56c8));_0x13dfb0(_0x4c56c8);})[_0x4046('0x1a')](function(_0x934219){logger[_0x4046('0x16')](_0x4046('0x28'),_0x934219[_0x4046('0x18')],_0x33fdbd);_0x44210c(_0x49637f[_0x4046('0x16')](0x1f4,_0x934219[_0x4046('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5383a95..4a79b2a 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 _0x4c7b=['register','length','./voiceQueueReport.events','remove','emit','removeListener'];(function(_0x266195,_0x410f94){var _0x4e73ed=function(_0x53210c){while(--_0x53210c){_0x266195['push'](_0x266195['shift']());}};_0x4e73ed(++_0x410f94);}(_0x4c7b,0x128));var _0xb4c7=function(_0x7a4a3e,_0x3a1b11){_0x7a4a3e=_0x7a4a3e-0x0;var _0x47e961=_0x4c7b[_0x7a4a3e];return _0x47e961;};'use strict';var VoiceQueueReportEvents=require(_0xb4c7('0x0'));var events=['save',_0xb4c7('0x1'),'update'];function createListener(_0x10a056,_0x1b4345){return function(_0x536f4d){_0x1b4345[_0xb4c7('0x2')](_0x10a056,_0x536f4d);};}function removeListener(_0x47912f,_0x319e4d){return function(){VoiceQueueReportEvents[_0xb4c7('0x3')](_0x47912f,_0x319e4d);};}exports[_0xb4c7('0x4')]=function(_0x898b7){for(var _0x26689a=0x0,_0x264d14=events[_0xb4c7('0x5')];_0x26689a<_0x264d14;_0x26689a++){var _0x562388=events[_0x26689a];var _0x5822a8=createListener('voiceQueueReport:'+_0x562388,_0x898b7);VoiceQueueReportEvents['on'](_0x562388,_0x5822a8);}}; \ No newline at end of file +var _0x4262=['voiceQueueReport:','./voiceQueueReport.events','save','remove','removeListener','register','length'];(function(_0x48e047,_0x35c0c2){var _0x51f1ec=function(_0x4eaf15){while(--_0x4eaf15){_0x48e047['push'](_0x48e047['shift']());}};_0x51f1ec(++_0x35c0c2);}(_0x4262,0x15f));var _0x2426=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4262[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueReportEvents=require(_0x2426('0x0'));var events=[_0x2426('0x1'),_0x2426('0x2'),'update'];function createListener(_0x30c544,_0x5b6c14){return function(_0x251ee7){_0x5b6c14['emit'](_0x30c544,_0x251ee7);};}function removeListener(_0x4b6f7c,_0x19be9b){return function(){VoiceQueueReportEvents[_0x2426('0x3')](_0x4b6f7c,_0x19be9b);};}exports[_0x2426('0x4')]=function(_0x127500){for(var _0x4a6553=0x0,_0x12f6f0=events[_0x2426('0x5')];_0x4a6553<_0x12f6f0;_0x4a6553++){var _0x2ba584=events[_0x4a6553];var _0x2bffc1=createListener(_0x2426('0x6')+_0x2ba584,_0x127500);VoiceQueueReportEvents['on'](_0x2ba584,_0x2bffc1);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index dd82bf4..6095b5f 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 _0xcf66=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','destroy'];(function(_0x1a422a,_0x3468fd){var _0x4dcab4=function(_0x24b700){while(--_0x24b700){_0x1a422a['push'](_0x1a422a['shift']());}};_0x4dcab4(++_0x3468fd);}(_0xcf66,0x110));var _0x6cf6=function(_0x4e1d39,_0x4286bb){_0x4e1d39=_0x4e1d39-0x0;var _0x5920eb=_0xcf66[_0x4e1d39];return _0x5920eb;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require('util');var path=require(_0x6cf6('0x1'));var timeout=require(_0x6cf6('0x2'));var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var fs_extra=require(_0x6cf6('0x5'));var auth=require(_0x6cf6('0x6'));var interaction=require(_0x6cf6('0x7'));var config=require(_0x6cf6('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x6cf6('0x9')](),controller[_0x6cf6('0xa')]);router[_0x6cf6('0xb')](_0x6cf6('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6cf6('0xd')]);router[_0x6cf6('0xe')](_0x6cf6('0xc'),auth[_0x6cf6('0x9')](),controller[_0x6cf6('0xf')]);router['delete'](_0x6cf6('0xc'),auth['isAuthenticated'](),controller[_0x6cf6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5e87=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','express','Router','fs-extra'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x5e87,0x8c));var _0x75e8=function(_0x278574,_0x8bcbd5){_0x278574=_0x278574-0x0;var _0x3a6c8=_0x5e87[_0x278574];return _0x3a6c8;};'use strict';var multer=require(_0x75e8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75e8('0x1'));var router=express[_0x75e8('0x2')]();var fs_extra=require(_0x75e8('0x3'));var auth=require(_0x75e8('0x4'));var interaction=require(_0x75e8('0x5'));var config=require(_0x75e8('0x6'));var controller=require(_0x75e8('0x7'));router['get']('/',auth[_0x75e8('0x8')](),controller[_0x75e8('0x9')]);router['get'](_0x75e8('0xa'),auth[_0x75e8('0x8')](),controller['show']);router[_0x75e8('0xb')]('/',auth['isAuthenticated'](),controller[_0x75e8('0xc')]);router[_0x75e8('0xd')](_0x75e8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x75e8('0xa'),auth[_0x75e8('0x8')](),controller[_0x75e8('0xe')]);module[_0x75e8('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 4a7c1bd..e8e767a 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 _0x4327=['literal','STRING','DATE'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x4327,0x142));var _0x7432=function(_0x46cb21,_0x482f03){_0x46cb21=_0x46cb21-0x0;var _0x6dc6dc=_0x4327[_0x46cb21];return _0x6dc6dc;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x7432('0x0')]},'callid':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7432('0x0')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7432('0x1')],'allowNull':![],'defaultValue':Sequelize[_0x7432('0x2')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x44f4=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment'];(function(_0x312cc2,_0x214ca1){var _0x30a4fa=function(_0x2c039d){while(--_0x2c039d){_0x312cc2['push'](_0x312cc2['shift']());}};_0x30a4fa(++_0x214ca1);}(_0x44f4,0x199));var _0x444f=function(_0x47af6a,_0xcd6041){_0x47af6a=_0x47af6a-0x0;var _0x4b0aba=_0x44f4[_0x47af6a];return _0x4b0aba;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x444f('0x0'));module['exports']={'time':{'type':Sequelize[_0x444f('0x1')]},'callid':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x444f('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x444f('0x2')],'allowNull':![],'defaultValue':Sequelize[_0x444f('0x3')](_0x444f('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3ad1258..6b00296 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 _0xb55a=['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','reject','then','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','includeAll','find','catch','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0xb55a,0x85));var _0xab55=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb55a[_0x556bb1];return _0x45455f;};'use strict';var emlformat=require(_0xab55('0x0'));var rimraf=require(_0xab55('0x1'));var zipdir=require(_0xab55('0x2'));var jsonpatch=require(_0xab55('0x3'));var rp=require(_0xab55('0x4'));var moment=require(_0xab55('0x5'));var BPromise=require(_0xab55('0x6'));var Mustache=require('mustache');var util=require(_0xab55('0x7'));var path=require(_0xab55('0x8'));var sox=require(_0xab55('0x9'));var csv=require(_0xab55('0xa'));var ejs=require(_0xab55('0xb'));var fs=require('fs');var fs_extra=require(_0xab55('0xc'));var _=require('lodash');var squel=require(_0xab55('0xd'));var crypto=require(_0xab55('0xe'));var jsforce=require(_0xab55('0xf'));var deskjs=require(_0xab55('0x10'));var toCsv=require(_0xab55('0xa'));var querystring=require(_0xab55('0x11'));var Papa=require(_0xab55('0x12'));var Redis=require(_0xab55('0x13'));var authService=require(_0xab55('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xab55('0x15'));var hardwareService=require(_0xab55('0x16'));var logger=require(_0xab55('0x17'))('api');var utils=require(_0xab55('0x18'));var config=require(_0xab55('0x19'));var licenseUtil=require(_0xab55('0x1a'));var db=require(_0xab55('0x1b'))['db'];function respondWithStatusCode(_0x27117c,_0x37a918){_0x37a918=_0x37a918||0xcc;return function(_0x304bc4){if(_0x304bc4){return _0x27117c[_0xab55('0x1c')](_0x37a918);}return _0x27117c[_0xab55('0x1d')](_0x37a918)[_0xab55('0x1e')]();};}function respondWithResult(_0x304c50,_0x3d7719){_0x3d7719=_0x3d7719||0xc8;return function(_0x5c11ed){if(_0x5c11ed){return _0x304c50[_0xab55('0x1d')](_0x3d7719)[_0xab55('0x1f')](_0x5c11ed);}};}function respondWithFilteredResult(_0x2d90cf,_0x3b2b7d){return function(_0x49f533){if(_0x49f533){var _0x4a7124=typeof _0x3b2b7d[_0xab55('0x20')]===_0xab55('0x21')&&typeof _0x3b2b7d[_0xab55('0x22')]===_0xab55('0x21');var _0x397a8a=_0x49f533['count'];var _0x53d59a=_0x4a7124?0x0:_0x3b2b7d[_0xab55('0x20')];var _0x3edb17=_0x4a7124?_0x49f533[_0xab55('0x23')]:_0x3b2b7d[_0xab55('0x20')]+_0x3b2b7d['limit'];var _0x4c7380;if(_0x3edb17>=_0x397a8a){_0x3edb17=_0x397a8a;_0x4c7380=0xc8;}else{_0x4c7380=0xce;}_0x2d90cf[_0xab55('0x1d')](_0x4c7380);return _0x2d90cf['set']('Content-Range',_0x53d59a+'-'+_0x3edb17+'/'+_0x397a8a)[_0xab55('0x1f')](_0x49f533);}return null;};}function patchUpdates(_0x278154){return function(_0x3020e8){try{jsonpatch['apply'](_0x3020e8,_0x278154,!![]);}catch(_0x5bb895){return BPromise[_0xab55('0x24')](_0x5bb895);}return _0x3020e8['save']();};}function saveUpdates(_0x2d075f,_0x1d472e){return function(_0xdf6c40){if(_0xdf6c40){return _0xdf6c40['update'](_0x2d075f)[_0xab55('0x25')](function(_0x524733){return _0x524733;});}return null;};}function removeEntity(_0x2c2d2e,_0x2b49df){return function(_0x508bd3){if(_0x508bd3){return _0x508bd3['destroy']()[_0xab55('0x25')](function(){_0x2c2d2e[_0xab55('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a92c1,_0x372289){return function(_0x55a788){if(!_0x55a788){_0x1a92c1[_0xab55('0x1c')](0x194);}return _0x55a788;};}function handleError(_0xa1cd56,_0x49abaa){_0x49abaa=_0x49abaa||0x1f4;return function(_0x2fd618){logger[_0xab55('0x26')](_0x2fd618['stack']);if(_0x2fd618[_0xab55('0x27')]){delete _0x2fd618[_0xab55('0x27')];}_0xa1cd56[_0xab55('0x1d')](_0x49abaa)[_0xab55('0x28')](_0x2fd618);};}exports['index']=function(_0x3dc059,_0x4b2dbb){var _0x5284b8={},_0xd16bb3={},_0x30ae17={'count':0x0,'rows':[]};var _0x11958a=_[_0xab55('0x29')](db[_0xab55('0x2a')][_0xab55('0x2b')],function(_0x4f1722){return{'name':_0x4f1722[_0xab55('0x2c')],'type':_0x4f1722['type'][_0xab55('0x2d')]};});_0xd16bb3['model']=_[_0xab55('0x29')](_0x11958a,_0xab55('0x27'));_0xd16bb3['query']=_[_0xab55('0x2e')](_0x3dc059[_0xab55('0x2f')]);_0xd16bb3[_0xab55('0x30')]=_[_0xab55('0x31')](_0xd16bb3[_0xab55('0x32')],_0xd16bb3[_0xab55('0x2f')]);_0x5284b8[_0xab55('0x33')]=_[_0xab55('0x31')](_0xd16bb3['model'],qs[_0xab55('0x34')](_0x3dc059[_0xab55('0x2f')][_0xab55('0x34')]));_0x5284b8[_0xab55('0x33')]=_0x5284b8['attributes'][_0xab55('0x35')]?_0x5284b8[_0xab55('0x33')]:_0xd16bb3['model'];if(!_0x3dc059[_0xab55('0x2f')][_0xab55('0x36')](_0xab55('0x37'))){_0x5284b8[_0xab55('0x22')]=qs[_0xab55('0x22')](_0x3dc059[_0xab55('0x2f')][_0xab55('0x22')]);_0x5284b8[_0xab55('0x20')]=qs[_0xab55('0x20')](_0x3dc059['query'][_0xab55('0x20')]);}_0x5284b8[_0xab55('0x38')]=qs[_0xab55('0x39')](_0x3dc059[_0xab55('0x2f')][_0xab55('0x39')]);_0x5284b8[_0xab55('0x3a')]=qs[_0xab55('0x30')](_['pick'](_0x3dc059['query'],_0xd16bb3['filters']),_0x11958a);if(_0x3dc059['query'][_0xab55('0x3b')]){_0x5284b8[_0xab55('0x3a')]=_[_0xab55('0x3c')](_0x5284b8[_0xab55('0x3a')],{'$or':_[_0xab55('0x29')](_0x11958a,function(_0x251a70){if(_0x251a70[_0xab55('0x3d')]!==_0xab55('0x3e')){var _0x535aa7={};_0x535aa7[_0x251a70['name']]={'$like':'%'+_0x3dc059[_0xab55('0x2f')][_0xab55('0x3b')]+'%'};return _0x535aa7;}})});}_0x5284b8=_['merge']({},_0x5284b8,_0x3dc059[_0xab55('0x3f')]);var _0x5749f7={'where':_0x5284b8[_0xab55('0x3a')]};return db['VoiceQueuesLog'][_0xab55('0x23')](_0x5749f7)[_0xab55('0x25')](function(_0x316ce3){_0x30ae17['count']=_0x316ce3;if(_0x3dc059[_0xab55('0x2f')]['includeAll']){_0x5284b8[_0xab55('0x40')]=[{'all':!![]}];}return db[_0xab55('0x2a')][_0xab55('0x41')](_0x5284b8);})['then'](function(_0x2982cc){_0x30ae17[_0xab55('0x42')]=_0x2982cc;return _0x30ae17;})[_0xab55('0x25')](respondWithFilteredResult(_0x4b2dbb,_0x5284b8))['catch'](handleError(_0x4b2dbb,null));};exports['show']=function(_0x5ea0b6,_0x37bb){var _0x2836cf={'raw':!![],'where':{'id':_0x5ea0b6['params']['id']}},_0x230214={};_0x230214[_0xab55('0x32')]=_[_0xab55('0x2e')](db[_0xab55('0x2a')]['rawAttributes']);_0x230214[_0xab55('0x2f')]=_['keys'](_0x5ea0b6[_0xab55('0x2f')]);_0x230214[_0xab55('0x30')]=_[_0xab55('0x31')](_0x230214['model'],_0x230214[_0xab55('0x2f')]);_0x2836cf[_0xab55('0x33')]=_[_0xab55('0x31')](_0x230214[_0xab55('0x32')],qs[_0xab55('0x34')](_0x5ea0b6[_0xab55('0x2f')][_0xab55('0x34')]));_0x2836cf[_0xab55('0x33')]=_0x2836cf[_0xab55('0x33')][_0xab55('0x35')]?_0x2836cf[_0xab55('0x33')]:_0x230214[_0xab55('0x32')];if(_0x5ea0b6[_0xab55('0x2f')][_0xab55('0x43')]){_0x2836cf[_0xab55('0x40')]=[{'all':!![]}];}_0x2836cf=_[_0xab55('0x3c')]({},_0x2836cf,_0x5ea0b6['options']);return db['VoiceQueuesLog'][_0xab55('0x44')](_0x2836cf)['then'](handleEntityNotFound(_0x37bb,null))[_0xab55('0x25')](respondWithResult(_0x37bb,null))[_0xab55('0x45')](handleError(_0x37bb,null));};exports[_0xab55('0x46')]=function(_0x596f1c,_0x47fe1d){return db[_0xab55('0x2a')][_0xab55('0x46')](_0x596f1c[_0xab55('0x47')],{})[_0xab55('0x25')](respondWithResult(_0x47fe1d,0xc9))[_0xab55('0x45')](handleError(_0x47fe1d,null));};exports['update']=function(_0x386201,_0x3ad9b6){if(_0x386201[_0xab55('0x47')]['id']){delete _0x386201[_0xab55('0x47')]['id'];}return db['VoiceQueuesLog'][_0xab55('0x44')]({'where':{'id':_0x386201['params']['id']}})['then'](handleEntityNotFound(_0x3ad9b6,null))[_0xab55('0x25')](saveUpdates(_0x386201[_0xab55('0x47')],null))[_0xab55('0x25')](respondWithResult(_0x3ad9b6,null))[_0xab55('0x45')](handleError(_0x3ad9b6,null));};exports[_0xab55('0x48')]=function(_0x13e182,_0x44f251){return db['VoiceQueuesLog'][_0xab55('0x44')]({'where':{'id':_0x13e182[_0xab55('0x49')]['id']}})[_0xab55('0x25')](handleEntityNotFound(_0x44f251,null))[_0xab55('0x25')](removeEntity(_0x44f251,null))['catch'](handleError(_0x44f251,null));}; \ No newline at end of file +var _0x2029=['jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','VoiceQueuesLog','includeAll','include','findAll','rows','show','params','intersection','length','options','create','body','catch','eml-format','rimraf','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x2029,0x84));var _0x9202=function(_0xc5aea0,_0x226ce0){_0xc5aea0=_0xc5aea0-0x0;var _0x4c9c04=_0x2029[_0xc5aea0];return _0x4c9c04;};'use strict';var emlformat=require(_0x9202('0x0'));var rimraf=require(_0x9202('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9202('0x2'));var moment=require(_0x9202('0x3'));var BPromise=require(_0x9202('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9202('0x5'));var sox=require(_0x9202('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9202('0x7'));var _=require(_0x9202('0x8'));var squel=require(_0x9202('0x9'));var crypto=require('crypto');var jsforce=require(_0x9202('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9202('0xb'));var querystring=require(_0x9202('0xc'));var Papa=require(_0x9202('0xd'));var Redis=require('ioredis');var authService=require(_0x9202('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9202('0xf'));var hardwareService=require(_0x9202('0x10'));var logger=require('../../config/logger')(_0x9202('0x11'));var utils=require(_0x9202('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9202('0x13'))['db'];function respondWithStatusCode(_0x339291,_0x18c869){_0x18c869=_0x18c869||0xcc;return function(_0x25dc67){if(_0x25dc67){return _0x339291['sendStatus'](_0x18c869);}return _0x339291[_0x9202('0x14')](_0x18c869)['end']();};}function respondWithResult(_0x4009fd,_0x32750a){_0x32750a=_0x32750a||0xc8;return function(_0x1394b1){if(_0x1394b1){return _0x4009fd[_0x9202('0x14')](_0x32750a)['json'](_0x1394b1);}};}function respondWithFilteredResult(_0x2b0bb5,_0x3e5a42){return function(_0x22fb47){if(_0x22fb47){var _0x4bbc7a=typeof _0x3e5a42[_0x9202('0x15')]==='undefined'&&typeof _0x3e5a42[_0x9202('0x16')]===_0x9202('0x17');var _0x1fa92d=_0x22fb47[_0x9202('0x18')];var _0x3aeb21=_0x4bbc7a?0x0:_0x3e5a42['offset'];var _0x3e44eb=_0x4bbc7a?_0x22fb47[_0x9202('0x18')]:_0x3e5a42[_0x9202('0x15')]+_0x3e5a42['limit'];var _0x1f01d7;if(_0x3e44eb>=_0x1fa92d){_0x3e44eb=_0x1fa92d;_0x1f01d7=0xc8;}else{_0x1f01d7=0xce;}_0x2b0bb5[_0x9202('0x14')](_0x1f01d7);return _0x2b0bb5[_0x9202('0x19')](_0x9202('0x1a'),_0x3aeb21+'-'+_0x3e44eb+'/'+_0x1fa92d)['json'](_0x22fb47);}return null;};}function patchUpdates(_0x5dfbd3){return function(_0x4554c2){try{jsonpatch[_0x9202('0x1b')](_0x4554c2,_0x5dfbd3,!![]);}catch(_0x2cc666){return BPromise[_0x9202('0x1c')](_0x2cc666);}return _0x4554c2[_0x9202('0x1d')]();};}function saveUpdates(_0x3b76bf,_0x4a0e0c){return function(_0x2b36a8){if(_0x2b36a8){return _0x2b36a8[_0x9202('0x1e')](_0x3b76bf)['then'](function(_0x4d0b66){return _0x4d0b66;});}return null;};}function removeEntity(_0x1aae50,_0x566272){return function(_0x277a1a){if(_0x277a1a){return _0x277a1a[_0x9202('0x1f')]()[_0x9202('0x20')](function(){_0x1aae50[_0x9202('0x14')](0xcc)[_0x9202('0x21')]();});}};}function handleEntityNotFound(_0x526319,_0x35d232){return function(_0x5cdd78){if(!_0x5cdd78){_0x526319[_0x9202('0x22')](0x194);}return _0x5cdd78;};}function handleError(_0x552e45,_0x1aeb60){_0x1aeb60=_0x1aeb60||0x1f4;return function(_0x17329f){logger[_0x9202('0x23')](_0x17329f[_0x9202('0x24')]);if(_0x17329f[_0x9202('0x25')]){delete _0x17329f[_0x9202('0x25')];}_0x552e45[_0x9202('0x14')](_0x1aeb60)[_0x9202('0x26')](_0x17329f);};}exports[_0x9202('0x27')]=function(_0x25fbd8,_0x261a65){var _0x53887e={},_0x47ce38={},_0x18cf98={'count':0x0,'rows':[]};var _0x2ade71=_['map'](db['VoiceQueuesLog'][_0x9202('0x28')],function(_0x22bbcd){return{'name':_0x22bbcd[_0x9202('0x29')],'type':_0x22bbcd[_0x9202('0x2a')][_0x9202('0x2b')]};});_0x47ce38[_0x9202('0x2c')]=_[_0x9202('0x2d')](_0x2ade71,_0x9202('0x25'));_0x47ce38[_0x9202('0x2e')]=_[_0x9202('0x2f')](_0x25fbd8[_0x9202('0x2e')]);_0x47ce38['filters']=_['intersection'](_0x47ce38[_0x9202('0x2c')],_0x47ce38[_0x9202('0x2e')]);_0x53887e[_0x9202('0x30')]=_['intersection'](_0x47ce38[_0x9202('0x2c')],qs[_0x9202('0x31')](_0x25fbd8[_0x9202('0x2e')][_0x9202('0x31')]));_0x53887e[_0x9202('0x30')]=_0x53887e['attributes']['length']?_0x53887e[_0x9202('0x30')]:_0x47ce38[_0x9202('0x2c')];if(!_0x25fbd8[_0x9202('0x2e')][_0x9202('0x32')](_0x9202('0x33'))){_0x53887e[_0x9202('0x16')]=qs[_0x9202('0x16')](_0x25fbd8[_0x9202('0x2e')][_0x9202('0x16')]);_0x53887e[_0x9202('0x15')]=qs[_0x9202('0x15')](_0x25fbd8[_0x9202('0x2e')][_0x9202('0x15')]);}_0x53887e['order']=qs['sort'](_0x25fbd8[_0x9202('0x2e')][_0x9202('0x34')]);_0x53887e[_0x9202('0x35')]=qs[_0x9202('0x36')](_['pick'](_0x25fbd8['query'],_0x47ce38[_0x9202('0x36')]),_0x2ade71);if(_0x25fbd8['query']['filter']){_0x53887e[_0x9202('0x35')]=_[_0x9202('0x37')](_0x53887e[_0x9202('0x35')],{'$or':_[_0x9202('0x2d')](_0x2ade71,function(_0x3eaa63){if(_0x3eaa63[_0x9202('0x2a')]!==_0x9202('0x38')){var _0x1a1196={};_0x1a1196[_0x3eaa63[_0x9202('0x25')]]={'$like':'%'+_0x25fbd8[_0x9202('0x2e')][_0x9202('0x39')]+'%'};return _0x1a1196;}})});}_0x53887e=_['merge']({},_0x53887e,_0x25fbd8['options']);var _0x2bc1e8={'where':_0x53887e[_0x9202('0x35')]};return db[_0x9202('0x3a')][_0x9202('0x18')](_0x2bc1e8)[_0x9202('0x20')](function(_0x50c063){_0x18cf98[_0x9202('0x18')]=_0x50c063;if(_0x25fbd8[_0x9202('0x2e')][_0x9202('0x3b')]){_0x53887e[_0x9202('0x3c')]=[{'all':!![]}];}return db[_0x9202('0x3a')][_0x9202('0x3d')](_0x53887e);})['then'](function(_0x174120){_0x18cf98[_0x9202('0x3e')]=_0x174120;return _0x18cf98;})['then'](respondWithFilteredResult(_0x261a65,_0x53887e))['catch'](handleError(_0x261a65,null));};exports[_0x9202('0x3f')]=function(_0x42aab6,_0x90788){var _0x37e123={'raw':!![],'where':{'id':_0x42aab6[_0x9202('0x40')]['id']}},_0x448fe9={};_0x448fe9[_0x9202('0x2c')]=_[_0x9202('0x2f')](db[_0x9202('0x3a')][_0x9202('0x28')]);_0x448fe9[_0x9202('0x2e')]=_[_0x9202('0x2f')](_0x42aab6['query']);_0x448fe9[_0x9202('0x36')]=_['intersection'](_0x448fe9['model'],_0x448fe9[_0x9202('0x2e')]);_0x37e123['attributes']=_[_0x9202('0x41')](_0x448fe9['model'],qs[_0x9202('0x31')](_0x42aab6['query'][_0x9202('0x31')]));_0x37e123[_0x9202('0x30')]=_0x37e123[_0x9202('0x30')][_0x9202('0x42')]?_0x37e123[_0x9202('0x30')]:_0x448fe9[_0x9202('0x2c')];if(_0x42aab6[_0x9202('0x2e')][_0x9202('0x3b')]){_0x37e123['include']=[{'all':!![]}];}_0x37e123=_[_0x9202('0x37')]({},_0x37e123,_0x42aab6[_0x9202('0x43')]);return db['VoiceQueuesLog']['find'](_0x37e123)[_0x9202('0x20')](handleEntityNotFound(_0x90788,null))[_0x9202('0x20')](respondWithResult(_0x90788,null))['catch'](handleError(_0x90788,null));};exports[_0x9202('0x44')]=function(_0x287f5e,_0x11cf7f){return db[_0x9202('0x3a')][_0x9202('0x44')](_0x287f5e[_0x9202('0x45')],{})[_0x9202('0x20')](respondWithResult(_0x11cf7f,0xc9))[_0x9202('0x46')](handleError(_0x11cf7f,null));};exports[_0x9202('0x1e')]=function(_0x289905,_0x29f3dc){if(_0x289905[_0x9202('0x45')]['id']){delete _0x289905[_0x9202('0x45')]['id'];}return db[_0x9202('0x3a')]['find']({'where':{'id':_0x289905[_0x9202('0x40')]['id']}})[_0x9202('0x20')](handleEntityNotFound(_0x29f3dc,null))[_0x9202('0x20')](saveUpdates(_0x289905['body'],null))[_0x9202('0x20')](respondWithResult(_0x29f3dc,null))[_0x9202('0x46')](handleError(_0x29f3dc,null));};exports[_0x9202('0x1f')]=function(_0x3dbf4f,_0xae170d){return db[_0x9202('0x3a')]['find']({'where':{'id':_0x3dbf4f[_0x9202('0x40')]['id']}})[_0x9202('0x20')](handleEntityNotFound(_0xae170d,null))['then'](removeEntity(_0xae170d,null))[_0x9202('0x46')](handleError(_0xae170d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index bc267b9..53db1dc 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 _0x527c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm','lodash'];(function(_0x5b3087,_0x91c425){var _0x2aae2d=function(_0x4b6012){while(--_0x4b6012){_0x5b3087['push'](_0x5b3087['shift']());}};_0x2aae2d(++_0x91c425);}(_0x527c,0x194));var _0xc527=function(_0x3f3026,_0x35d62a){_0x3f3026=_0x3f3026-0x0;var _0x4e87bf=_0x527c[_0x3f3026];return _0x4e87bf;};'use strict';var _=require(_0xc527('0x0'));var util=require('util');var logger=require(_0xc527('0x1'))(_0xc527('0x2'));var moment=require(_0xc527('0x3'));var BPromise=require(_0xc527('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc527('0x5'));var rimraf=require(_0xc527('0x6'));var config=require(_0xc527('0x7'));var attributes=require(_0xc527('0x8'));module[_0xc527('0x9')]=function(_0x3becea,_0xbae80){return _0x3becea[_0xc527('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0xc527('0xb'),'paranoid':![],'indexes':[{'name':_0xc527('0xc'),'fields':[_0xc527('0xd'),_0xc527('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3445=['event_dtm','dtm','lodash','util','moment','bluebird','path','rimraf','../../config/environment','define','VoiceQueuesLog','voice_queues_log'];(function(_0x7025b0,_0x9533f1){var _0x6e444c=function(_0x258fe9){while(--_0x258fe9){_0x7025b0['push'](_0x7025b0['shift']());}};_0x6e444c(++_0x9533f1);}(_0x3445,0x13a));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5344('0x4'));var rimraf=require(_0x5344('0x5'));var config=require(_0x5344('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x27eda8,_0x228eb6){return _0x27eda8[_0x5344('0x7')](_0x5344('0x8'),attributes,{'tableName':_0x5344('0x9'),'paranoid':![],'indexes':[{'name':_0x5344('0xa'),'fields':['event',_0x5344('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 8cce0ea..60025e9 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 _0x3098=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x43a3af,_0x390f28){var _0x7f7472=function(_0x3e99cf){while(--_0x3e99cf){_0x43a3af['push'](_0x43a3af['shift']());}};_0x7f7472(++_0x390f28);}(_0x3098,0x86));var _0x8309=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x3098[_0x4ba380];return _0x4b111b;};'use strict';var _=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var moment=require(_0x8309('0x2'));var BPromise=require(_0x8309('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8309('0x4'));var db=require(_0x8309('0x5'))['db'];var utils=require(_0x8309('0x6'));var logger=require(_0x8309('0x7'))(_0x8309('0x8'));var config=require(_0x8309('0x9'));var jayson=require(_0x8309('0xa'));var client=jayson[_0x8309('0xb')][_0x8309('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e9ac6,_0x5142f1,_0x35ca92){return new BPromise(function(_0x5c2cd1,_0x421fa5){return client[_0x8309('0xd')](_0x1e9ac6,_0x35ca92)['then'](function(_0x554405){logger[_0x8309('0xe')](_0x8309('0xf'),_0x5142f1,_0x8309('0x10'));logger[_0x8309('0x11')](_0x8309('0x12'),_0x5142f1,'request\x20sent',JSON[_0x8309('0x13')](_0x554405));if(_0x554405[_0x8309('0x14')]){if(_0x554405[_0x8309('0x14')][_0x8309('0x15')]===0x1f4){logger[_0x8309('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5142f1,_0x554405[_0x8309('0x14')]['message']);return _0x421fa5(_0x554405[_0x8309('0x14')]['message']);}logger[_0x8309('0x14')](_0x8309('0xf'),_0x5142f1,_0x554405[_0x8309('0x14')][_0x8309('0x16')]);return _0x5c2cd1(_0x554405[_0x8309('0x14')][_0x8309('0x16')]);}else{logger[_0x8309('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5142f1,'request\x20sent');_0x5c2cd1(_0x554405[_0x8309('0x17')][_0x8309('0x16')]);}})[_0x8309('0x18')](function(_0x33742f){logger[_0x8309('0x14')](_0x8309('0xf'),_0x5142f1,_0x33742f);_0x421fa5(_0x33742f);});});} \ No newline at end of file +var _0xabc4=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x2265c7,_0x2731db){var _0x296b78=function(_0x4af313){while(--_0x4af313){_0x2265c7['push'](_0x2265c7['shift']());}};_0x296b78(++_0x2731db);}(_0xabc4,0x160));var _0x4abc=function(_0x19a490,_0x4627d9){_0x19a490=_0x19a490-0x0;var _0x52081c=_0xabc4[_0x19a490];return _0x52081c;};'use strict';var _=require('lodash');var util=require(_0x4abc('0x0'));var moment=require(_0x4abc('0x1'));var BPromise=require(_0x4abc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4abc('0x3'));var db=require(_0x4abc('0x4'))['db'];var utils=require(_0x4abc('0x5'));var logger=require(_0x4abc('0x6'))(_0x4abc('0x7'));var config=require(_0x4abc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4abc('0x9')][_0x4abc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c346e,_0x59febf,_0xd100b4){return new BPromise(function(_0x59910a,_0x578bdb){return client[_0x4abc('0xb')](_0x3c346e,_0xd100b4)[_0x4abc('0xc')](function(_0x48a00a){logger[_0x4abc('0xd')](_0x4abc('0xe'),_0x59febf,_0x4abc('0xf'));logger[_0x4abc('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x59febf,'request\x20sent',JSON[_0x4abc('0x11')](_0x48a00a));if(_0x48a00a[_0x4abc('0x12')]){if(_0x48a00a['error'][_0x4abc('0x13')]===0x1f4){logger[_0x4abc('0x12')](_0x4abc('0xe'),_0x59febf,_0x48a00a[_0x4abc('0x12')][_0x4abc('0x14')]);return _0x578bdb(_0x48a00a[_0x4abc('0x12')][_0x4abc('0x14')]);}logger[_0x4abc('0x12')](_0x4abc('0xe'),_0x59febf,_0x48a00a[_0x4abc('0x12')][_0x4abc('0x14')]);return _0x59910a(_0x48a00a[_0x4abc('0x12')][_0x4abc('0x14')]);}else{logger[_0x4abc('0xd')](_0x4abc('0xe'),_0x59febf,_0x4abc('0xf'));_0x59910a(_0x48a00a['result'][_0x4abc('0x14')]);}})[_0x4abc('0x15')](function(_0x171f72){logger[_0x4abc('0x12')](_0x4abc('0xe'),_0x59febf,_0x171f72);_0x578bdb(_0x171f72);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 3c14bdc..155b76b 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 _0x234b=['update','delete','/:id','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x234b,0x1cf));var _0xb234=function(_0x384410,_0x437176){_0x384410=_0x384410-0x0;var _0x5b6b73=_0x234b[_0x384410];return _0x5b6b73;};'use strict';var multer=require(_0xb234('0x0'));var util=require(_0xb234('0x1'));var path=require('path');var timeout=require(_0xb234('0x2'));var express=require(_0xb234('0x3'));var router=express['Router']();var fs_extra=require(_0xb234('0x4'));var auth=require(_0xb234('0x5'));var interaction=require(_0xb234('0x6'));var config=require(_0xb234('0x7'));var controller=require(_0xb234('0x8'));router[_0xb234('0x9')]('/',auth[_0xb234('0xa')](),controller[_0xb234('0xb')]);router[_0xb234('0x9')](_0xb234('0xc'),auth[_0xb234('0xa')](),controller[_0xb234('0xd')]);router[_0xb234('0x9')]('/:id',auth[_0xb234('0xa')](),controller[_0xb234('0xe')]);router['get'](_0xb234('0xf'),auth[_0xb234('0xa')](),controller['download']);router[_0xb234('0x9')](_0xb234('0x10'),controller[_0xb234('0x11')]);router[_0xb234('0x9')](_0xb234('0x12'),auth[_0xb234('0xa')](),controller['downloadTranscribe']);router[_0xb234('0x13')]('/',auth[_0xb234('0xa')](),controller[_0xb234('0x14')]);router[_0xb234('0x13')](_0xb234('0x12'),auth[_0xb234('0xa')](),controller[_0xb234('0x15')]);router[_0xb234('0x16')]('/:id',auth[_0xb234('0xa')](),controller[_0xb234('0x17')]);router[_0xb234('0x18')](_0xb234('0x19'),auth[_0xb234('0xa')](),controller['destroy']);module[_0xb234('0x1a')]=router; \ No newline at end of file +var _0x31f9=['/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x4a2388,_0x4243db){var _0xd35f34=function(_0x1ebb82){while(--_0x1ebb82){_0x4a2388['push'](_0x4a2388['shift']());}};_0xd35f34(++_0x4243db);}(_0x31f9,0xb3));var _0x931f=function(_0x5eca50,_0x1c3d9f){_0x5eca50=_0x5eca50-0x0;var _0x1f2c02=_0x31f9[_0x5eca50];return _0x1f2c02;};'use strict';var multer=require(_0x931f('0x0'));var util=require(_0x931f('0x1'));var path=require(_0x931f('0x2'));var timeout=require('connect-timeout');var express=require(_0x931f('0x3'));var router=express[_0x931f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x931f('0x5'));var interaction=require(_0x931f('0x6'));var config=require('../../config/environment');var controller=require(_0x931f('0x7'));router[_0x931f('0x8')]('/',auth[_0x931f('0x9')](),controller[_0x931f('0xa')]);router[_0x931f('0x8')]('/describe',auth[_0x931f('0x9')](),controller[_0x931f('0xb')]);router[_0x931f('0x8')](_0x931f('0xc'),auth[_0x931f('0x9')](),controller['show']);router[_0x931f('0x8')](_0x931f('0xd'),auth[_0x931f('0x9')](),controller[_0x931f('0xe')]);router[_0x931f('0x8')](_0x931f('0xf'),controller[_0x931f('0x10')]);router[_0x931f('0x8')](_0x931f('0x11'),auth['isAuthenticated'](),controller[_0x931f('0x12')]);router[_0x931f('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x931f('0x13')]('/:id/transcribe',auth[_0x931f('0x9')](),controller[_0x931f('0x14')]);router['put'](_0x931f('0xc'),auth[_0x931f('0x9')](),controller[_0x931f('0x15')]);router[_0x931f('0x16')](_0x931f('0xc'),auth[_0x931f('0x9')](),controller[_0x931f('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c381ff4..47c3791 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 0f6e6f9..7be4be3 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 _0xefc4=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','key','model','differenceBy','format','query','keys','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','VoiceRecording','include','rows','catch','show','rawAttributes','intersection','includeAll','create','body','update','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','token','push','$and','params','recording','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra'];(function(_0x25e094,_0x48c02b){var _0x5ac306=function(_0x3cb7c3){while(--_0x3cb7c3){_0x25e094['push'](_0x25e094['shift']());}};_0x5ac306(++_0x48c02b);}(_0xefc4,0x1c3));var _0x4efc=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xefc4[_0x1d80be];return _0xf9a4f3;};'use strict';var emlformat=require(_0x4efc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4efc('0x1'));var rp=require(_0x4efc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4efc('0x3'));var util=require(_0x4efc('0x4'));var path=require(_0x4efc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4efc('0x6'));var fs=require('fs');var fs_extra=require(_0x4efc('0x7'));var _=require(_0x4efc('0x8'));var squel=require(_0x4efc('0x9'));var crypto=require(_0x4efc('0xa'));var jsforce=require(_0x4efc('0xb'));var deskjs=require(_0x4efc('0xc'));var toCsv=require(_0x4efc('0xd'));var querystring=require(_0x4efc('0xe'));var Papa=require(_0x4efc('0xf'));var AWS=require(_0x4efc('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0x4efc('0x11'));var authService=require(_0x4efc('0x12'));var qs=require(_0x4efc('0x13'));var as=require(_0x4efc('0x14'));var hardwareService=require(_0x4efc('0x15'));var logger=require(_0x4efc('0x16'))(_0x4efc('0x17'));var utils=require(_0x4efc('0x18'));var config=require(_0x4efc('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4efc('0x1a'))['db'];function respondWithStatusCode(_0x4461e9,_0x4a3fb3){_0x4a3fb3=_0x4a3fb3||0xcc;return function(_0x583bb9){if(_0x583bb9){return _0x4461e9[_0x4efc('0x1b')](_0x4a3fb3);}return _0x4461e9['status'](_0x4a3fb3)[_0x4efc('0x1c')]();};}function respondWithResult(_0x56f502,_0x4c0bf4){_0x4c0bf4=_0x4c0bf4||0xc8;return function(_0xff7fff){if(_0xff7fff){return _0x56f502[_0x4efc('0x1d')](_0x4c0bf4)[_0x4efc('0x1e')](_0xff7fff);}};}function respondWithFilteredResult(_0xb215ae,_0x52a66a){return function(_0x2304a7){if(_0x2304a7){var _0x51391e=typeof _0x52a66a[_0x4efc('0x1f')]==='undefined'&&typeof _0x52a66a[_0x4efc('0x20')]===_0x4efc('0x21');var _0x68f886=_0x2304a7[_0x4efc('0x22')];var _0x137049=_0x51391e?0x0:_0x52a66a[_0x4efc('0x1f')];var _0x276e0e=_0x51391e?_0x2304a7[_0x4efc('0x22')]:_0x52a66a['offset']+_0x52a66a['limit'];var _0x400829;if(_0x276e0e>=_0x68f886){_0x276e0e=_0x68f886;_0x400829=0xc8;}else{_0x400829=0xce;}_0xb215ae[_0x4efc('0x1d')](_0x400829);return _0xb215ae[_0x4efc('0x23')](_0x4efc('0x24'),_0x137049+'-'+_0x276e0e+'/'+_0x68f886)[_0x4efc('0x1e')](_0x2304a7);}return null;};}function patchUpdates(_0xe73eb9){return function(_0x497436){try{jsonpatch['apply'](_0x497436,_0xe73eb9,!![]);}catch(_0x2d3c28){return BPromise[_0x4efc('0x25')](_0x2d3c28);}return _0x497436[_0x4efc('0x26')]();};}function saveUpdates(_0x12559a,_0x20bd9a){return function(_0x5ed390){if(_0x5ed390){return _0x5ed390['update'](_0x12559a)[_0x4efc('0x27')](function(_0x2fac24){return _0x2fac24;});}return null;};}function removeEntity(_0x3b1d70,_0x16b275){return function(_0x2bda48){if(_0x2bda48){return _0x2bda48[_0x4efc('0x28')]()['then'](function(){_0x3b1d70['status'](0xcc)[_0x4efc('0x1c')]();});}};}function handleEntityNotFound(_0x5659e7,_0x4c5576){return function(_0xd4cf2){if(!_0xd4cf2){_0x5659e7[_0x4efc('0x1b')](0x194);}return _0xd4cf2;};}function handleError(_0x2ae8ea,_0x9d5d78){_0x9d5d78=_0x9d5d78||0x1f4;return function(_0x29725e){logger[_0x4efc('0x29')](_0x29725e[_0x4efc('0x2a')]);if(_0x29725e[_0x4efc('0x2b')]){delete _0x29725e[_0x4efc('0x2b')];}_0x2ae8ea['status'](_0x9d5d78)[_0x4efc('0x2c')](_0x29725e);};}exports[_0x4efc('0x2d')]=function(_0x13f385,_0x1b2a53){var _0x1cf3d7={},_0xabb6ab={},_0x264312={'count':0x0,'rows':[]};var _0xe6207c=_[_0x4efc('0x2e')](db['VoiceRecording']['rawAttributes'],function(_0x35eb9a){return{'name':_0x35eb9a[_0x4efc('0x2f')],'type':_0x35eb9a['type'][_0x4efc('0x30')]};});_0xabb6ab[_0x4efc('0x31')]=_[_0x4efc('0x32')](_[_0x4efc('0x2e')](_0xe6207c,'name'),[_0x4efc('0x33')]);_0xabb6ab[_0x4efc('0x34')]=_[_0x4efc('0x35')](_0x13f385[_0x4efc('0x34')]);_0xabb6ab['filters']=_['intersection'](_0xabb6ab[_0x4efc('0x31')],_0xabb6ab[_0x4efc('0x34')]);_0x1cf3d7[_0x4efc('0x36')]=_['intersection'](_0xabb6ab[_0x4efc('0x31')],qs[_0x4efc('0x37')](_0x13f385['query'][_0x4efc('0x37')]));_0x1cf3d7['attributes']=_0x1cf3d7[_0x4efc('0x36')][_0x4efc('0x38')]?_0x1cf3d7[_0x4efc('0x36')]:_0xabb6ab[_0x4efc('0x31')];if(!_0x13f385[_0x4efc('0x34')]['hasOwnProperty'](_0x4efc('0x39'))){_0x1cf3d7['limit']=qs[_0x4efc('0x20')](_0x13f385[_0x4efc('0x34')][_0x4efc('0x20')]);_0x1cf3d7[_0x4efc('0x1f')]=qs[_0x4efc('0x1f')](_0x13f385[_0x4efc('0x34')][_0x4efc('0x1f')]);}_0x1cf3d7[_0x4efc('0x3a')]=qs[_0x4efc('0x3b')](_0x13f385[_0x4efc('0x34')]['sort']);_0x1cf3d7[_0x4efc('0x3c')]=qs[_0x4efc('0x3d')](_[_0x4efc('0x3e')](_0x13f385[_0x4efc('0x34')],_0xabb6ab[_0x4efc('0x3d')]),_0xe6207c);if(_0x13f385[_0x4efc('0x34')][_0x4efc('0x3f')]){_0x1cf3d7[_0x4efc('0x3c')]=_[_0x4efc('0x40')](_0x1cf3d7[_0x4efc('0x3c')],{'$or':_[_0x4efc('0x2e')](_0xe6207c,function(_0x22b876){if(_0x22b876[_0x4efc('0x41')]!==_0x4efc('0x42')){var _0xc15d93={};_0xc15d93[_0x22b876[_0x4efc('0x2b')]]={'$like':'%'+_0x13f385[_0x4efc('0x34')]['filter']+'%'};return _0xc15d93;}})});}_0x1cf3d7=_[_0x4efc('0x40')]({},_0x1cf3d7,_0x13f385[_0x4efc('0x43')]);var _0x1330eb={'where':_0x1cf3d7[_0x4efc('0x3c')]};return db[_0x4efc('0x44')][_0x4efc('0x22')](_0x1330eb)[_0x4efc('0x27')](function(_0x35a9cb){_0x264312[_0x4efc('0x22')]=_0x35a9cb;if(_0x13f385[_0x4efc('0x34')]['includeAll']){_0x1cf3d7[_0x4efc('0x45')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x1cf3d7);})[_0x4efc('0x27')](function(_0x386b6d){_0x264312[_0x4efc('0x46')]=_0x386b6d;return _0x264312;})[_0x4efc('0x27')](respondWithFilteredResult(_0x1b2a53,_0x1cf3d7))[_0x4efc('0x47')](handleError(_0x1b2a53,null));};exports[_0x4efc('0x48')]=function(_0xe3888a,_0x298b3){var _0x353a1d={'raw':![],'where':{'id':_0xe3888a['params']['id']}},_0x4e15f3={};_0x4e15f3[_0x4efc('0x31')]=_[_0x4efc('0x35')](db['VoiceRecording'][_0x4efc('0x49')]);_0x4e15f3['query']=_[_0x4efc('0x35')](_0xe3888a['query']);_0x4e15f3[_0x4efc('0x3d')]=_[_0x4efc('0x4a')](_0x4e15f3['model'],_0x4e15f3['query']);_0x353a1d[_0x4efc('0x36')]=_[_0x4efc('0x4a')](_0x4e15f3[_0x4efc('0x31')],qs['fields'](_0xe3888a[_0x4efc('0x34')][_0x4efc('0x37')]));_0x353a1d[_0x4efc('0x36')]=_0x353a1d[_0x4efc('0x36')][_0x4efc('0x38')]?_0x353a1d['attributes']:_0x4e15f3[_0x4efc('0x31')];if(_0xe3888a[_0x4efc('0x34')][_0x4efc('0x4b')]){_0x353a1d[_0x4efc('0x45')]=[{'all':!![]}];}_0x353a1d=_[_0x4efc('0x40')]({},_0x353a1d,_0xe3888a['options']);return db[_0x4efc('0x44')]['find'](_0x353a1d)[_0x4efc('0x27')](handleEntityNotFound(_0x298b3,null))[_0x4efc('0x27')](respondWithResult(_0x298b3,null))[_0x4efc('0x47')](handleError(_0x298b3,null));};exports[_0x4efc('0x4c')]=function(_0x32fd06,_0x53ed4a){return db[_0x4efc('0x44')][_0x4efc('0x4c')](_0x32fd06[_0x4efc('0x4d')],{})['then'](respondWithResult(_0x53ed4a,0xc9))['catch'](handleError(_0x53ed4a,null));};exports[_0x4efc('0x4e')]=function(_0x3a14d8,_0xa67997){if(_0x3a14d8[_0x4efc('0x4d')]['id']){delete _0x3a14d8[_0x4efc('0x4d')]['id'];}return db[_0x4efc('0x44')][_0x4efc('0x4f')]({'where':{'id':_0x3a14d8['params']['id']}})[_0x4efc('0x27')](handleEntityNotFound(_0xa67997,null))[_0x4efc('0x27')](saveUpdates(_0x3a14d8['body'],null))[_0x4efc('0x27')](respondWithResult(_0xa67997,null))['catch'](handleError(_0xa67997,null));};exports[_0x4efc('0x50')]=function(_0x39cfb6,_0x37a43f){return db[_0x4efc('0x44')][_0x4efc('0x50')]()[_0x4efc('0x27')](respondWithResult(_0x37a43f,null))[_0x4efc('0x47')](handleError(_0x37a43f,null));};exports[_0x4efc('0x51')]=function(_0x517c6d,_0x2f838f,_0x17efd9){var _0x28033d=require(_0x4efc('0x52'));var _0x41f6a4=![];var _0x3e12ec={};if(_0x517c6d[_0x4efc('0x34')][_0x4efc('0x41')]&&_0x517c6d[_0x4efc('0x34')][_0x4efc('0x41')]===_0x4efc('0x53')){_0x3e12ec[_0x4efc('0x53')]=_0x517c6d['params']['id'];}else{_0x3e12ec['id']=_0x517c6d['params']['id'];}return db[_0x4efc('0x44')][_0x4efc('0x4f')]({'where':_0x3e12ec,'attributes':['id','value'],'raw':!![]})[_0x4efc('0x27')](handleEntityNotFound(_0x2f838f,null))['then'](function(_0x42412b){if(_0x42412b){var _0x10208c=_0x42412b[_0x4efc('0x54')];var _0x3d5fb8=util[_0x4efc('0x33')](_0x4efc('0x55'),_0x10208c);if(fs['existsSync'](_0x3d5fb8)){_0x41f6a4=!![];return _0x28033d[_0x4efc('0x56')](_0x3d5fb8,_0x10208c,config['secrets']['recording'])[_0x4efc('0x27')](function(){return _0x42412b;});}return _0x42412b;}})[_0x4efc('0x27')](function(_0x3eeb7f){if(_0x3eeb7f){var _0x1ccb5e=_0x3eeb7f[_0x4efc('0x54')];if(!fs[_0x4efc('0x57')](_0x1ccb5e)){throw new db[(_0x4efc('0x58'))][(_0x4efc('0x59'))](_0x4efc('0x5a'));}if(_0x3eeb7f[_0x4efc('0x5b')]){return _0x2f838f[_0x4efc('0x51')](_0x1ccb5e,_0x3eeb7f[_0x4efc('0x5b')]+path[_0x4efc('0x5c')](_0x1ccb5e),function(){if(_0x41f6a4){fs[_0x4efc('0x5d')](_0x1ccb5e);}});}else{return _0x2f838f['download'](_0x1ccb5e,function(_0x2bfeb){if(_0x41f6a4){fs[_0x4efc('0x5d')](_0x1ccb5e);}});}}})[_0x4efc('0x47')](function(_0x406c3a){if(_0x406c3a['message']===_0x4efc('0x5a')){_0x2f838f['status'](0x194)['send'](_0x4efc('0x5e'));}else{return handleError(_0x2f838f,null);}});};exports[_0x4efc('0x5f')]=function(_0x1c8bc4,_0x2bf7d4,_0x264c88){var _0x5bf840=require(_0x4efc('0x52'));var _0xef54a9=![];var _0x3052cd={'$and':[db[_0x4efc('0x60')][_0x4efc('0x3c')](db[_0x4efc('0x60')]['fn']('MD5',db[_0x4efc('0x60')]['col']('uniqueid')),_0x1c8bc4[_0x4efc('0x34')][_0x4efc('0x61')])]};if(_0x1c8bc4[_0x4efc('0x34')][_0x4efc('0x41')]&&_0x1c8bc4[_0x4efc('0x34')][_0x4efc('0x41')]==='uniqueid'){_0x3052cd['$and'][_0x4efc('0x62')]({'uniqueid':_0x1c8bc4['params']['id']});}else{_0x3052cd[_0x4efc('0x63')][_0x4efc('0x62')]({'id':_0x1c8bc4[_0x4efc('0x64')]['id']});}return db['VoiceRecording'][_0x4efc('0x4f')]({'where':_0x3052cd,'attributes':['id',_0x4efc('0x54')],'raw':!![]})[_0x4efc('0x27')](handleEntityNotFound(_0x2bf7d4,null))[_0x4efc('0x27')](function(_0x5a28bf){if(_0x5a28bf){var _0x21caee=util[_0x4efc('0x33')](_0x4efc('0x55'),_0x5a28bf[_0x4efc('0x54')]);if(fs[_0x4efc('0x57')](_0x21caee)){_0xef54a9=!![];return _0x5bf840[_0x4efc('0x56')](_0x21caee,_0x5a28bf[_0x4efc('0x54')],config['secrets'][_0x4efc('0x65')])[_0x4efc('0x27')](function(){return _0x5a28bf;});}return _0x5a28bf;}})[_0x4efc('0x27')](function(_0x5cb7ae){if(_0x5cb7ae){if(!fs[_0x4efc('0x57')](_0x5cb7ae[_0x4efc('0x54')])){throw new db[(_0x4efc('0x58'))][(_0x4efc('0x59'))](_0x4efc('0x5a'));}if(_0x5cb7ae[_0x4efc('0x5b')]){return _0x2bf7d4['download'](_0x5cb7ae[_0x4efc('0x54')],_0x5cb7ae[_0x4efc('0x5b')]+path[_0x4efc('0x5c')](_0x5cb7ae[_0x4efc('0x54')]),function(){if(_0xef54a9){fs['unlink'](_0x5cb7ae[_0x4efc('0x54')]);}});}else{return _0x2bf7d4['download'](_0x5cb7ae[_0x4efc('0x54')],function(_0x2a63ac){if(_0xef54a9){fs[_0x4efc('0x5d')](_0x5cb7ae[_0x4efc('0x54')]);}});}}})[_0x4efc('0x47')](handleError(_0x2bf7d4,null));};exports['destroy']=function(_0x1edf0e,_0x5975a7){return db[_0x4efc('0x44')][_0x4efc('0x4f')]({'where':{'id':_0x1edf0e[_0x4efc('0x64')]['id']}})[_0x4efc('0x27')](function(_0x122252){if(_[_0x4efc('0x66')](_0x122252)){throw new ReferenceError(_0x4efc('0x67'));}return _0x122252;})[_0x4efc('0x27')](function(_0x14ce98){var _0x5849a7=_0x14ce98[_0x4efc('0x54')];logger['info'](_0x4efc('0x68'),_0x5849a7);if(!_[_0x4efc('0x66')](_0x14ce98[_0x4efc('0x54')])&&fs[_0x4efc('0x57')](_0x5849a7)){logger[_0x4efc('0x69')]('File:\x20\x22'+_0x5849a7+_0x4efc('0x6a'));fs[_0x4efc('0x6b')](_0x5849a7);}_0x5849a7=_0x5849a7+_0x4efc('0x6c');if(!_['isNil'](_0x14ce98[_0x4efc('0x54')])&&fs[_0x4efc('0x57')](_0x5849a7)){logger['info']('File:\x20\x22'+_0x5849a7+_0x4efc('0x6a'));fs[_0x4efc('0x6b')](_0x5849a7);}return _0x14ce98;})[_0x4efc('0x27')](function(_0x2aca7c){if(!_0x2aca7c)throw new InternalError();return _0x2aca7c[_0x4efc('0x28')]();})[_0x4efc('0x27')](function(){_0x5975a7[_0x4efc('0x1d')](0xcc)[_0x4efc('0x1c')]();})['catch'](handleError(_0x5975a7,null));};function getBucketslist(_0x3cb457,_0x64b57b,_0x3fcfba){return new Promise(function(_0x52e75a,_0x7d83bd){var _0xf07759=new AWS['S3']({'accessKeyId':_0x64b57b,'secretAccessKey':_0x3cb457,'region':_0x3fcfba});_0xf07759[_0x4efc('0x6d')]({},function(_0x2c8878,_0x916665){if(_0x2c8878){return _0x7d83bd(_0x2c8878);}else{return _0x52e75a(_0x916665);}});});}function createBucket(_0x48ea83,_0x24b760,_0x5769bb,_0xc6a5e7){return new Promise(function(_0x4baeff,_0x487e69){var _0x4e53c9=new AWS['S3']({'accessKeyId':_0x24b760,'secretAccessKey':_0x48ea83,'region':_0x5769bb});_0x4e53c9[_0x4efc('0x6e')]({'Bucket':_0xc6a5e7},function(_0x502acb,_0x327e34){if(_0x502acb){return _0x487e69(_0x502acb);}else{return _0x4baeff(_0x327e34);}});});}function uploadFile(_0x16bb44,_0x417783,_0x49cb10,_0x30f982,_0x4d9519,_0x3cfb3c){return new Promise(function(_0x38d855,_0x4509c9){var _0xe026f0=new AWS['S3']({'accessKeyId':_0x417783,'secretAccessKey':_0x16bb44,'region':_0x49cb10});_0xe026f0[_0x4efc('0x6f')]({'Bucket':_0x30f982,'Key':_0x4d9519,'Body':_0x3cfb3c},function(_0x15b200,_0x48edc4){if(_0x15b200){return _0x4509c9(_0x15b200);}else{return _0x38d855(_0x48edc4);}});});}function startTranscribe(_0x3aae19,_0x1b9664,_0x4a76a8,_0x331410,_0x2c8378,_0x48b12f){return new Promise(function(_0x6ef91e,_0x23d028){var _0x2d78a2=new AWS[(_0x4efc('0x70'))]({'accessKeyId':_0x1b9664,'secretAccessKey':_0x3aae19,'region':_0x4a76a8});_0x2d78a2[_0x4efc('0x71')]({'TranscriptionJobName':_0x331410,'LanguageCode':_0x2c8378,'Media':{'MediaFileUri':_0x48b12f}},function(_0x296baa,_0x6b039b){if(_0x296baa){return _0x23d028(_0x296baa);}else{return _0x6ef91e(_0x6b039b);}});});}function transcribe(_0x14019d,_0x5bd07f,_0x5a8fed,_0x450da3,_0x370bd7,_0x26dcba,_0x36cc8d){return new Promise(function(_0x45f293,_0x1f9993){var _0x208a94={};logger['info'](util[_0x4efc('0x33')](_0x4efc('0x72'),_0x14019d,_0x370bd7));return uploadFile(_0x5bd07f,_0x5a8fed,_0x450da3,_0x370bd7,path[_0x4efc('0x73')](_0x26dcba),fs['readFileSync'](_0x26dcba))['then'](function(_0x5879e3){logger[_0x4efc('0x69')](util[_0x4efc('0x33')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x14019d,_0x370bd7,_0x5879e3['Location']));_0x208a94[_0x4efc('0x74')]=_0x5879e3[_0x4efc('0x75')];_0x208a94[_0x4efc('0x76')]=_0x5879e3[_0x4efc('0x77')];logger[_0x4efc('0x69')](util[_0x4efc('0x33')](_0x4efc('0x78'),_0x14019d));return startTranscribe(_0x5bd07f,_0x5a8fed,_0x450da3,uuidv4(),_0x36cc8d,_0x5879e3[_0x4efc('0x77')]);})[_0x4efc('0x27')](function(_0x1ba4b5){logger['info'](util[_0x4efc('0x33')](_0x4efc('0x79'),_0x14019d,_0x1ba4b5[_0x4efc('0x7a')][_0x4efc('0x7b')]));_0x208a94['transcribeName']=_0x1ba4b5[_0x4efc('0x7a')][_0x4efc('0x7b')];_0x208a94[_0x4efc('0x7c')]=_0x1ba4b5['TranscriptionJob'][_0x4efc('0x7d')];return _0x45f293(_0x208a94);})['catch'](function(_0x48f380){return _0x1f9993(_0x48f380);});});}exports[_0x4efc('0x7e')]=function(_0x569777,_0x2061a3,_0x27a530){var _0x446fc1;var _0x3ca968;var _0x4c589a;var _0x5a8cf6=require(_0x4efc('0x52'));return db[_0x4efc('0x44')][_0x4efc('0x7f')]({'where':{'id':_0x569777[_0x4efc('0x64')]['id']}})[_0x4efc('0x27')](function(_0x1a04e9){if(_0x1a04e9){var _0x4b7bc8=util[_0x4efc('0x33')]('%s.cypher',_0x1a04e9[_0x4efc('0x54')]);if(fs[_0x4efc('0x57')](_0x4b7bc8)){cypher=!![];return _0x5a8cf6[_0x4efc('0x56')](_0x4b7bc8,_0x1a04e9[_0x4efc('0x54')],config['secrets'][_0x4efc('0x65')])[_0x4efc('0x27')](function(){return _0x1a04e9;});}return _0x1a04e9;}})[_0x4efc('0x27')](function(_0x18eb61){if(!_0x18eb61){throw new db[(_0x4efc('0x58'))][(_0x4efc('0x59'))](_0x4efc('0x80'));}_0x3ca968=_0x18eb61;return db[_0x4efc('0x81')][_0x4efc('0x7f')]({'where':{'id':0x1}});})[_0x4efc('0x27')](handleEntityNotFound(_0x2061a3,null))[_0x4efc('0x27')](function(_0x2e749d){if(_0x2e749d){_0x446fc1=_0x2e749d;if(!_0x446fc1[_0x4efc('0x82')]||!_0x446fc1['transcribeAccountId']||!_0x446fc1[_0x4efc('0x83')]||!_0x446fc1['language']||!_0x446fc1[_0x4efc('0x74')]){throw new db['Sequelize']['ValidationError'](_0x4efc('0x84'));}if(_0x569777[_0x4efc('0x4d')][_0x4efc('0x85')]&&(!_0x446fc1[_0x4efc('0x86')]||!_0x446fc1['sentimentAccountId']||!_0x446fc1['sentimentRegion']||!_0x446fc1[_0x4efc('0x87')]||!_0x446fc1[_0x4efc('0x74')])){throw new db['Sequelize'][(_0x4efc('0x59'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x4efc('0x88')][_0x4efc('0x7f')]({'where':{'id':_0x446fc1['transcribeAccountId']}});}})[_0x4efc('0x27')](function(_0x50ab25){if(!_0x50ab25){throw new db['Sequelize'][(_0x4efc('0x59'))](_0x4efc('0x89'));}if(!_0x50ab25['data1']||!_0x50ab25[_0x4efc('0x8a')]){throw new db[(_0x4efc('0x58'))][(_0x4efc('0x59'))](_0x4efc('0x8b'));}_0x4c589a=_0x50ab25;return getBucketslist(_0x4c589a[_0x4efc('0x8c')],_0x4c589a[_0x4efc('0x8a')],_0x446fc1[_0x4efc('0x83')]);})[_0x4efc('0x27')](function(_0x3c7ca0){if(_0x3c7ca0&&_0x3c7ca0['Buckets']){var _0x57a914=_[_0x4efc('0x4f')](_0x3c7ca0[_0x4efc('0x8d')],function(_0x30415f){return _0x30415f[_0x4efc('0x8e')]===_0x446fc1[_0x4efc('0x74')];});if(!_0x57a914){logger['info'](util['format'](_0x4efc('0x8f'),_0x569777[_0x4efc('0x64')]['id'],_0x446fc1[_0x4efc('0x74')]));return createBucket(_0x4c589a[_0x4efc('0x8c')],_0x4c589a['data2'],_0x446fc1[_0x4efc('0x83')],_0x446fc1[_0x4efc('0x74')]);}logger[_0x4efc('0x69')](util[_0x4efc('0x33')](_0x4efc('0x90'),_0x569777['params']['id'],_0x446fc1[_0x4efc('0x74')]));return;}})['then'](function(_0x45259b){if(_0x3ca968[_0x4efc('0x7c')]===_0x4efc('0x91')){return transcribe(_0x569777[_0x4efc('0x64')]['id'],_0x4c589a[_0x4efc('0x8c')],_0x4c589a[_0x4efc('0x8a')],_0x446fc1[_0x4efc('0x83')],_0x446fc1[_0x4efc('0x74')],_0x3ca968['value'],_0x446fc1[_0x4efc('0x87')]);}else{logger[_0x4efc('0x69')](util[_0x4efc('0x33')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x569777[_0x4efc('0x64')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x806f79){if(_0x806f79){_0x806f79['tempSentiment']=_0x569777['body'][_0x4efc('0x85')];return _0x3ca968[_0x4efc('0x92')](_0x806f79);}})[_0x4efc('0x27')](respondWithResult(_0x2061a3,null))[_0x4efc('0x47')](handleError(_0x2061a3,null));};function writeFile(_0x1dac26,_0x501f18){return new Promise(function(_0x3256ca,_0x3a8e6c){fs[_0x4efc('0x93')](_0x501f18,_0x1dac26,function(_0x1caf6b,_0x95bde3){if(_0x1caf6b){return _0x3a8e6c(_0x1caf6b);}else{return _0x3256ca(_0x95bde3);}});});}exports['downloadTranscribe']=function(_0x1a1112,_0x12b785,_0x4aeaac){return db['VoiceRecording'][_0x4efc('0x7f')]({'where':{'id':_0x1a1112['params']['id']}})[_0x4efc('0x27')](handleEntityNotFound(_0x12b785))[_0x4efc('0x27')](function(_0x4ddeb7){if(_0x4ddeb7&&_0x4ddeb7[_0x4efc('0x94')]){var _0x1bb1fc=_0x4ddeb7['fileText'];var _0x2d947f=config[_0x4efc('0x95')]+_0x4efc('0x96')+_0x4ddeb7['id']+_0x4efc('0x97');if(fs[_0x4efc('0x57')](_0x2d947f)){return _0x2d947f;}return writeFile(_0x1bb1fc,_0x2d947f)['then'](function(){return _0x2d947f;});}else{throw new db[(_0x4efc('0x58'))][(_0x4efc('0x59'))](_0x4efc('0x98'));}})['then'](function(_0x540e7c){return _0x12b785[_0x4efc('0x51')](_0x540e7c);})['catch'](handleError(_0x12b785));}; \ No newline at end of file +var _0x6534=['Not\x20found','downloads','../../components/encryptor','sequelize','col','token','$and','push','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','updateAttributes','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','aws-sdk','uuid/v4','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','reject','save','update','then','destroy','stack','name','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','describe','download','uniqueid','find','%s.cypher','existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send'];(function(_0x2ffd1f,_0x4d8b3e){var _0x565c5d=function(_0x348fe9){while(--_0x348fe9){_0x2ffd1f['push'](_0x2ffd1f['shift']());}};_0x565c5d(++_0x4d8b3e);}(_0x6534,0x161));var _0x4653=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6534[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4653('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4653('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4653('0x2'));var moment=require(_0x4653('0x3'));var BPromise=require(_0x4653('0x4'));var Mustache=require(_0x4653('0x5'));var util=require(_0x4653('0x6'));var path=require('path');var sox=require(_0x4653('0x7'));var csv=require(_0x4653('0x8'));var ejs=require(_0x4653('0x9'));var fs=require('fs');var fs_extra=require(_0x4653('0xa'));var _=require('lodash');var squel=require(_0x4653('0xb'));var crypto=require(_0x4653('0xc'));var jsforce=require(_0x4653('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4653('0x8'));var querystring=require(_0x4653('0xe'));var Papa=require('papaparse');var AWS=require(_0x4653('0xf'));var uuidv4=require(_0x4653('0x10'));var Redis=require(_0x4653('0x11'));var authService=require(_0x4653('0x12'));var qs=require(_0x4653('0x13'));var as=require(_0x4653('0x14'));var hardwareService=require(_0x4653('0x15'));var logger=require(_0x4653('0x16'))(_0x4653('0x17'));var utils=require(_0x4653('0x18'));var config=require(_0x4653('0x19'));var licenseUtil=require(_0x4653('0x1a'));var db=require(_0x4653('0x1b'))['db'];function respondWithStatusCode(_0x2d24a2,_0x595c57){_0x595c57=_0x595c57||0xcc;return function(_0x263523){if(_0x263523){return _0x2d24a2[_0x4653('0x1c')](_0x595c57);}return _0x2d24a2[_0x4653('0x1d')](_0x595c57)[_0x4653('0x1e')]();};}function respondWithResult(_0x20d7cd,_0x3382a4){_0x3382a4=_0x3382a4||0xc8;return function(_0x490e3d){if(_0x490e3d){return _0x20d7cd['status'](_0x3382a4)[_0x4653('0x1f')](_0x490e3d);}};}function respondWithFilteredResult(_0x33f924,_0x20a4ac){return function(_0x12d656){if(_0x12d656){var _0x44c8c7=typeof _0x20a4ac[_0x4653('0x20')]===_0x4653('0x21')&&typeof _0x20a4ac[_0x4653('0x22')]===_0x4653('0x21');var _0x41186d=_0x12d656[_0x4653('0x23')];var _0x1b8c34=_0x44c8c7?0x0:_0x20a4ac[_0x4653('0x20')];var _0x4a5686=_0x44c8c7?_0x12d656['count']:_0x20a4ac['offset']+_0x20a4ac[_0x4653('0x22')];var _0x3597ff;if(_0x4a5686>=_0x41186d){_0x4a5686=_0x41186d;_0x3597ff=0xc8;}else{_0x3597ff=0xce;}_0x33f924[_0x4653('0x1d')](_0x3597ff);return _0x33f924[_0x4653('0x24')](_0x4653('0x25'),_0x1b8c34+'-'+_0x4a5686+'/'+_0x41186d)[_0x4653('0x1f')](_0x12d656);}return null;};}function patchUpdates(_0x3a1d14){return function(_0x5d5ec9){try{jsonpatch['apply'](_0x5d5ec9,_0x3a1d14,!![]);}catch(_0x309f32){return BPromise[_0x4653('0x26')](_0x309f32);}return _0x5d5ec9[_0x4653('0x27')]();};}function saveUpdates(_0x1641fb,_0x35aa43){return function(_0x5c9539){if(_0x5c9539){return _0x5c9539[_0x4653('0x28')](_0x1641fb)[_0x4653('0x29')](function(_0x37f53f){return _0x37f53f;});}return null;};}function removeEntity(_0x2a0ad7,_0x1ed579){return function(_0x2148fd){if(_0x2148fd){return _0x2148fd[_0x4653('0x2a')]()[_0x4653('0x29')](function(){_0x2a0ad7[_0x4653('0x1d')](0xcc)[_0x4653('0x1e')]();});}};}function handleEntityNotFound(_0x1a52e7,_0x3065d3){return function(_0x287464){if(!_0x287464){_0x1a52e7[_0x4653('0x1c')](0x194);}return _0x287464;};}function handleError(_0x121c94,_0x2b670a){_0x2b670a=_0x2b670a||0x1f4;return function(_0xa335d5){logger['error'](_0xa335d5[_0x4653('0x2b')]);if(_0xa335d5[_0x4653('0x2c')]){delete _0xa335d5['name'];}_0x121c94[_0x4653('0x1d')](_0x2b670a)['send'](_0xa335d5);};}exports[_0x4653('0x2d')]=function(_0xaad5f3,_0x444758){var _0x2baeee={},_0xc3199b={},_0x2469a3={'count':0x0,'rows':[]};var _0x295f45=_[_0x4653('0x2e')](db[_0x4653('0x2f')][_0x4653('0x30')],function(_0x2c5735){return{'name':_0x2c5735['fieldName'],'type':_0x2c5735[_0x4653('0x31')][_0x4653('0x32')]};});_0xc3199b[_0x4653('0x33')]=_[_0x4653('0x34')](_[_0x4653('0x2e')](_0x295f45,'name'),[_0x4653('0x35')]);_0xc3199b['query']=_['keys'](_0xaad5f3[_0x4653('0x36')]);_0xc3199b[_0x4653('0x37')]=_[_0x4653('0x38')](_0xc3199b[_0x4653('0x33')],_0xc3199b[_0x4653('0x36')]);_0x2baeee[_0x4653('0x39')]=_['intersection'](_0xc3199b[_0x4653('0x33')],qs[_0x4653('0x3a')](_0xaad5f3['query'][_0x4653('0x3a')]));_0x2baeee[_0x4653('0x39')]=_0x2baeee[_0x4653('0x39')]['length']?_0x2baeee[_0x4653('0x39')]:_0xc3199b[_0x4653('0x33')];if(!_0xaad5f3['query']['hasOwnProperty']('nolimit')){_0x2baeee[_0x4653('0x22')]=qs[_0x4653('0x22')](_0xaad5f3['query'][_0x4653('0x22')]);_0x2baeee['offset']=qs[_0x4653('0x20')](_0xaad5f3[_0x4653('0x36')]['offset']);}_0x2baeee[_0x4653('0x3b')]=qs[_0x4653('0x3c')](_0xaad5f3[_0x4653('0x36')]['sort']);_0x2baeee[_0x4653('0x3d')]=qs[_0x4653('0x37')](_[_0x4653('0x3e')](_0xaad5f3[_0x4653('0x36')],_0xc3199b[_0x4653('0x37')]),_0x295f45);if(_0xaad5f3[_0x4653('0x36')][_0x4653('0x3f')]){_0x2baeee[_0x4653('0x3d')]=_[_0x4653('0x40')](_0x2baeee[_0x4653('0x3d')],{'$or':_[_0x4653('0x2e')](_0x295f45,function(_0x19da44){if(_0x19da44[_0x4653('0x31')]!==_0x4653('0x41')){var _0x12e4d7={};_0x12e4d7[_0x19da44[_0x4653('0x2c')]]={'$like':'%'+_0xaad5f3[_0x4653('0x36')][_0x4653('0x3f')]+'%'};return _0x12e4d7;}})});}_0x2baeee=_[_0x4653('0x40')]({},_0x2baeee,_0xaad5f3[_0x4653('0x42')]);var _0x55c9f9={'where':_0x2baeee[_0x4653('0x3d')]};return db[_0x4653('0x2f')][_0x4653('0x23')](_0x55c9f9)['then'](function(_0x1f8b68){_0x2469a3[_0x4653('0x23')]=_0x1f8b68;if(_0xaad5f3[_0x4653('0x36')][_0x4653('0x43')]){_0x2baeee[_0x4653('0x44')]=[{'all':!![]}];}return db[_0x4653('0x2f')]['findAll'](_0x2baeee);})[_0x4653('0x29')](function(_0x465f2f){_0x2469a3[_0x4653('0x45')]=_0x465f2f;return _0x2469a3;})[_0x4653('0x29')](respondWithFilteredResult(_0x444758,_0x2baeee))[_0x4653('0x46')](handleError(_0x444758,null));};exports[_0x4653('0x47')]=function(_0x5303d7,_0x17a58d){var _0x534648={'raw':![],'where':{'id':_0x5303d7[_0x4653('0x48')]['id']}},_0x35051c={};_0x35051c[_0x4653('0x33')]=_[_0x4653('0x49')](db[_0x4653('0x2f')]['rawAttributes']);_0x35051c[_0x4653('0x36')]=_[_0x4653('0x49')](_0x5303d7[_0x4653('0x36')]);_0x35051c[_0x4653('0x37')]=_['intersection'](_0x35051c[_0x4653('0x33')],_0x35051c[_0x4653('0x36')]);_0x534648['attributes']=_[_0x4653('0x38')](_0x35051c[_0x4653('0x33')],qs[_0x4653('0x3a')](_0x5303d7[_0x4653('0x36')][_0x4653('0x3a')]));_0x534648[_0x4653('0x39')]=_0x534648[_0x4653('0x39')]['length']?_0x534648[_0x4653('0x39')]:_0x35051c[_0x4653('0x33')];if(_0x5303d7[_0x4653('0x36')][_0x4653('0x43')]){_0x534648[_0x4653('0x44')]=[{'all':!![]}];}_0x534648=_['merge']({},_0x534648,_0x5303d7[_0x4653('0x42')]);return db[_0x4653('0x2f')]['find'](_0x534648)[_0x4653('0x29')](handleEntityNotFound(_0x17a58d,null))[_0x4653('0x29')](respondWithResult(_0x17a58d,null))[_0x4653('0x46')](handleError(_0x17a58d,null));};exports[_0x4653('0x4a')]=function(_0x3f5d5e,_0x175576){return db[_0x4653('0x2f')][_0x4653('0x4a')](_0x3f5d5e[_0x4653('0x4b')],{})[_0x4653('0x29')](respondWithResult(_0x175576,0xc9))['catch'](handleError(_0x175576,null));};exports['update']=function(_0x1f6c48,_0x4538b1){if(_0x1f6c48[_0x4653('0x4b')]['id']){delete _0x1f6c48[_0x4653('0x4b')]['id'];}return db[_0x4653('0x2f')]['find']({'where':{'id':_0x1f6c48[_0x4653('0x48')]['id']}})['then'](handleEntityNotFound(_0x4538b1,null))['then'](saveUpdates(_0x1f6c48['body'],null))[_0x4653('0x29')](respondWithResult(_0x4538b1,null))[_0x4653('0x46')](handleError(_0x4538b1,null));};exports[_0x4653('0x4c')]=function(_0x3ab685,_0x163759){return db[_0x4653('0x2f')][_0x4653('0x4c')]()[_0x4653('0x29')](respondWithResult(_0x163759,null))['catch'](handleError(_0x163759,null));};exports[_0x4653('0x4d')]=function(_0x171c3e,_0x7857d3,_0x801062){var _0x5196bb=require('../../components/encryptor');var _0x499c8f=![];var _0x1a1a22={};if(_0x171c3e['query'][_0x4653('0x31')]&&_0x171c3e[_0x4653('0x36')][_0x4653('0x31')]===_0x4653('0x4e')){_0x1a1a22[_0x4653('0x4e')]=_0x171c3e[_0x4653('0x48')]['id'];}else{_0x1a1a22['id']=_0x171c3e[_0x4653('0x48')]['id'];}return db['VoiceRecording'][_0x4653('0x4f')]({'where':_0x1a1a22,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x7857d3,null))['then'](function(_0x4fd8e4){if(_0x4fd8e4){var _0x533184=_0x4fd8e4['value'];var _0x22da89=util[_0x4653('0x35')](_0x4653('0x50'),_0x533184);if(fs[_0x4653('0x51')](_0x22da89)){_0x499c8f=!![];return _0x5196bb[_0x4653('0x52')](_0x22da89,_0x533184,config[_0x4653('0x53')][_0x4653('0x54')])[_0x4653('0x29')](function(){return _0x4fd8e4;});}return _0x4fd8e4;}})[_0x4653('0x29')](function(_0x4bc55a){if(_0x4bc55a){var _0x22b6f4=_0x4bc55a[_0x4653('0x55')];if(!fs[_0x4653('0x51')](_0x22b6f4)){throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x58'));}if(_0x4bc55a[_0x4653('0x59')]){return _0x7857d3[_0x4653('0x4d')](_0x22b6f4,_0x4bc55a[_0x4653('0x59')]+path[_0x4653('0x5a')](_0x22b6f4),function(){if(_0x499c8f){fs[_0x4653('0x5b')](_0x22b6f4);}});}else{return _0x7857d3[_0x4653('0x4d')](_0x22b6f4,function(_0xdfb123){if(_0x499c8f){fs['unlink'](_0x22b6f4);}});}}})[_0x4653('0x46')](function(_0x5b88f6){if(_0x5b88f6[_0x4653('0x5c')]==='VoiceRecording\x20not\x20found'){_0x7857d3[_0x4653('0x1d')](0x194)[_0x4653('0x5d')](_0x4653('0x5e'));}else{return handleError(_0x7857d3,null);}});};exports[_0x4653('0x5f')]=function(_0x3c1a65,_0x2f88fb,_0x154d09){var _0xb09b7a=require(_0x4653('0x60'));var _0x5477ce=![];var _0x4d7268={'$and':[db[_0x4653('0x61')]['where'](db['sequelize']['fn']('MD5',db[_0x4653('0x61')][_0x4653('0x62')]('uniqueid')),_0x3c1a65[_0x4653('0x36')][_0x4653('0x63')])]};if(_0x3c1a65[_0x4653('0x36')][_0x4653('0x31')]&&_0x3c1a65['query']['type']===_0x4653('0x4e')){_0x4d7268[_0x4653('0x64')]['push']({'uniqueid':_0x3c1a65[_0x4653('0x48')]['id']});}else{_0x4d7268[_0x4653('0x64')][_0x4653('0x65')]({'id':_0x3c1a65[_0x4653('0x48')]['id']});}return db['VoiceRecording'][_0x4653('0x4f')]({'where':_0x4d7268,'attributes':['id',_0x4653('0x55')],'raw':!![]})[_0x4653('0x29')](handleEntityNotFound(_0x2f88fb,null))[_0x4653('0x29')](function(_0x49b37b){if(_0x49b37b){var _0x3cac72=util[_0x4653('0x35')](_0x4653('0x50'),_0x49b37b[_0x4653('0x55')]);if(fs[_0x4653('0x51')](_0x3cac72)){_0x5477ce=!![];return _0xb09b7a[_0x4653('0x52')](_0x3cac72,_0x49b37b[_0x4653('0x55')],config[_0x4653('0x53')]['recording'])[_0x4653('0x29')](function(){return _0x49b37b;});}return _0x49b37b;}})[_0x4653('0x29')](function(_0x5038bb){if(_0x5038bb){if(!fs['existsSync'](_0x5038bb[_0x4653('0x55')])){throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x58'));}if(_0x5038bb[_0x4653('0x59')]){return _0x2f88fb[_0x4653('0x4d')](_0x5038bb[_0x4653('0x55')],_0x5038bb[_0x4653('0x59')]+path[_0x4653('0x5a')](_0x5038bb[_0x4653('0x55')]),function(){if(_0x5477ce){fs[_0x4653('0x5b')](_0x5038bb[_0x4653('0x55')]);}});}else{return _0x2f88fb[_0x4653('0x4d')](_0x5038bb[_0x4653('0x55')],function(_0x57bf94){if(_0x5477ce){fs[_0x4653('0x5b')](_0x5038bb[_0x4653('0x55')]);}});}}})[_0x4653('0x46')](handleError(_0x2f88fb,null));};exports[_0x4653('0x2a')]=function(_0x162785,_0x1bac34){return db[_0x4653('0x2f')][_0x4653('0x4f')]({'where':{'id':_0x162785['params']['id']}})[_0x4653('0x29')](function(_0x4bff92){if(_[_0x4653('0x66')](_0x4bff92)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4bff92;})[_0x4653('0x29')](function(_0x4d9be4){var _0x5319c3=_0x4d9be4[_0x4653('0x55')];logger[_0x4653('0x67')](_0x4653('0x68'),_0x5319c3);if(!_['isNil'](_0x4d9be4[_0x4653('0x55')])&&fs[_0x4653('0x51')](_0x5319c3)){logger['info']('File:\x20\x22'+_0x5319c3+_0x4653('0x69'));fs['unlinkSync'](_0x5319c3);}_0x5319c3=_0x5319c3+_0x4653('0x6a');if(!_[_0x4653('0x66')](_0x4d9be4[_0x4653('0x55')])&&fs[_0x4653('0x51')](_0x5319c3)){logger[_0x4653('0x67')](_0x4653('0x6b')+_0x5319c3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4653('0x6c')](_0x5319c3);}return _0x4d9be4;})[_0x4653('0x29')](function(_0x406c87){if(!_0x406c87)throw new InternalError();return _0x406c87[_0x4653('0x2a')]();})[_0x4653('0x29')](function(){_0x1bac34[_0x4653('0x1d')](0xcc)[_0x4653('0x1e')]();})['catch'](handleError(_0x1bac34,null));};function getBucketslist(_0x3e7497,_0x8fb229,_0x4f06a5){return new Promise(function(_0xa26ae4,_0x460a85){var _0x15014d=new AWS['S3']({'accessKeyId':_0x8fb229,'secretAccessKey':_0x3e7497,'region':_0x4f06a5});_0x15014d['listBuckets']({},function(_0x40a474,_0x120c31){if(_0x40a474){return _0x460a85(_0x40a474);}else{return _0xa26ae4(_0x120c31);}});});}function createBucket(_0x204d42,_0x2d3dcc,_0x33dbcf,_0x58f73b){return new Promise(function(_0x2c0159,_0x30bc49){var _0x543511=new AWS['S3']({'accessKeyId':_0x2d3dcc,'secretAccessKey':_0x204d42,'region':_0x33dbcf});_0x543511['createBucket']({'Bucket':_0x58f73b},function(_0x51ff6a,_0x17101a){if(_0x51ff6a){return _0x30bc49(_0x51ff6a);}else{return _0x2c0159(_0x17101a);}});});}function uploadFile(_0x1f23a0,_0x44d10a,_0x2194fc,_0x5381ae,_0x3f6869,_0x5d504b){return new Promise(function(_0x3ab649,_0x279f17){var _0x30070d=new AWS['S3']({'accessKeyId':_0x44d10a,'secretAccessKey':_0x1f23a0,'region':_0x2194fc});_0x30070d['upload']({'Bucket':_0x5381ae,'Key':_0x3f6869,'Body':_0x5d504b},function(_0x54171a,_0x102e1e){if(_0x54171a){return _0x279f17(_0x54171a);}else{return _0x3ab649(_0x102e1e);}});});}function startTranscribe(_0x13ab5d,_0x16d6aa,_0x1fc3c3,_0x3cc7cf,_0x2f927a,_0x55fc91){return new Promise(function(_0x3e328a,_0xad4abe){var _0x4ad8e7=new AWS[(_0x4653('0x6d'))]({'accessKeyId':_0x16d6aa,'secretAccessKey':_0x13ab5d,'region':_0x1fc3c3});_0x4ad8e7[_0x4653('0x6e')]({'TranscriptionJobName':_0x3cc7cf,'LanguageCode':_0x2f927a,'Media':{'MediaFileUri':_0x55fc91}},function(_0x4a74a7,_0x218c2d){if(_0x4a74a7){return _0xad4abe(_0x4a74a7);}else{return _0x3e328a(_0x218c2d);}});});}function transcribe(_0x297dbf,_0x3d40e8,_0x3e5dc3,_0x2245cd,_0x3c0534,_0x4c375e,_0x38ff29){return new Promise(function(_0x498a2a,_0x2c7cc3){var _0x5ec56d={};logger['info'](util[_0x4653('0x35')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x297dbf,_0x3c0534));return uploadFile(_0x3d40e8,_0x3e5dc3,_0x2245cd,_0x3c0534,path[_0x4653('0x6f')](_0x4c375e),fs[_0x4653('0x70')](_0x4c375e))['then'](function(_0x560b5d){logger[_0x4653('0x67')](util[_0x4653('0x35')](_0x4653('0x71'),_0x297dbf,_0x3c0534,_0x560b5d[_0x4653('0x72')]));_0x5ec56d['bucket']=_0x560b5d[_0x4653('0x73')];_0x5ec56d['location']=_0x560b5d[_0x4653('0x72')];logger[_0x4653('0x67')](util[_0x4653('0x35')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x297dbf));return startTranscribe(_0x3d40e8,_0x3e5dc3,_0x2245cd,uuidv4(),_0x38ff29,_0x560b5d[_0x4653('0x72')]);})[_0x4653('0x29')](function(_0x268135){logger[_0x4653('0x67')](util[_0x4653('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x297dbf,_0x268135['TranscriptionJob'][_0x4653('0x74')]));_0x5ec56d[_0x4653('0x75')]=_0x268135['TranscriptionJob'][_0x4653('0x74')];_0x5ec56d['transcribeStatus']=_0x268135[_0x4653('0x76')][_0x4653('0x77')];return _0x498a2a(_0x5ec56d);})[_0x4653('0x46')](function(_0x66c919){return _0x2c7cc3(_0x66c919);});});}exports['runTranscribe']=function(_0x261bf5,_0x3c74a9,_0x426eca){var _0x1c872f;var _0x310c67;var _0x1d667f;var _0x188a9d=require(_0x4653('0x60'));return db[_0x4653('0x2f')][_0x4653('0x78')]({'where':{'id':_0x261bf5['params']['id']}})[_0x4653('0x29')](function(_0x21cb1c){if(_0x21cb1c){var _0x209e46=util[_0x4653('0x35')](_0x4653('0x50'),_0x21cb1c[_0x4653('0x55')]);if(fs[_0x4653('0x51')](_0x209e46)){cypher=!![];return _0x188a9d['decryptFile'](_0x209e46,_0x21cb1c[_0x4653('0x55')],config[_0x4653('0x53')][_0x4653('0x54')])[_0x4653('0x29')](function(){return _0x21cb1c;});}return _0x21cb1c;}})['then'](function(_0x27d9ae){if(!_0x27d9ae){throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x79'));}_0x310c67=_0x27d9ae;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x4653('0x29')](handleEntityNotFound(_0x3c74a9,null))['then'](function(_0x3345f4){if(_0x3345f4){_0x1c872f=_0x3345f4;if(!_0x1c872f[_0x4653('0x7a')]||!_0x1c872f[_0x4653('0x7b')]||!_0x1c872f[_0x4653('0x7c')]||!_0x1c872f[_0x4653('0x7d')]||!_0x1c872f[_0x4653('0x7e')]){throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x7f'));}if(_0x261bf5[_0x4653('0x4b')]['runSentiment']&&(!_0x1c872f[_0x4653('0x80')]||!_0x1c872f[_0x4653('0x81')]||!_0x1c872f[_0x4653('0x82')]||!_0x1c872f[_0x4653('0x7d')]||!_0x1c872f['bucket'])){throw new db['Sequelize'][(_0x4653('0x57'))](_0x4653('0x83'));}return db[_0x4653('0x84')][_0x4653('0x78')]({'where':{'id':_0x1c872f[_0x4653('0x7b')]}});}})[_0x4653('0x29')](function(_0xe4e6fc){if(!_0xe4e6fc){throw new db[(_0x4653('0x56'))]['ValidationError'](_0x4653('0x85'));}if(!_0xe4e6fc[_0x4653('0x86')]||!_0xe4e6fc[_0x4653('0x87')]){throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x88'));}_0x1d667f=_0xe4e6fc;return getBucketslist(_0x1d667f['data1'],_0x1d667f[_0x4653('0x87')],_0x1c872f['transcribeRegion']);})[_0x4653('0x29')](function(_0x4989a7){if(_0x4989a7&&_0x4989a7[_0x4653('0x89')]){var _0x59a008=_[_0x4653('0x4f')](_0x4989a7[_0x4653('0x89')],function(_0x563e11){return _0x563e11[_0x4653('0x8a')]===_0x1c872f[_0x4653('0x7e')];});if(!_0x59a008){logger[_0x4653('0x67')](util[_0x4653('0x35')](_0x4653('0x8b'),_0x261bf5[_0x4653('0x48')]['id'],_0x1c872f[_0x4653('0x7e')]));return createBucket(_0x1d667f[_0x4653('0x86')],_0x1d667f[_0x4653('0x87')],_0x1c872f[_0x4653('0x7c')],_0x1c872f[_0x4653('0x7e')]);}logger[_0x4653('0x67')](util['format'](_0x4653('0x8c'),_0x261bf5[_0x4653('0x48')]['id'],_0x1c872f[_0x4653('0x7e')]));return;}})['then'](function(_0x3f8af1){if(_0x310c67['transcribeStatus']===_0x4653('0x8d')){return transcribe(_0x261bf5[_0x4653('0x48')]['id'],_0x1d667f[_0x4653('0x86')],_0x1d667f['data2'],_0x1c872f[_0x4653('0x7c')],_0x1c872f[_0x4653('0x7e')],_0x310c67[_0x4653('0x55')],_0x1c872f[_0x4653('0x7d')]);}else{logger[_0x4653('0x67')](util[_0x4653('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x261bf5[_0x4653('0x48')]['id']));return{'transcribeStatus':_0x4653('0x8e')};}})[_0x4653('0x29')](function(_0x1216fd){if(_0x1216fd){_0x1216fd['tempSentiment']=_0x261bf5['body']['runSentiment'];return _0x310c67[_0x4653('0x8f')](_0x1216fd);}})[_0x4653('0x29')](respondWithResult(_0x3c74a9,null))['catch'](handleError(_0x3c74a9,null));};function writeFile(_0x1f9c1e,_0x57b6c1){return new Promise(function(_0x19039b,_0x36603e){fs['writeFile'](_0x57b6c1,_0x1f9c1e,function(_0x379c99,_0x1ea167){if(_0x379c99){return _0x36603e(_0x379c99);}else{return _0x19039b(_0x1ea167);}});});}exports[_0x4653('0x90')]=function(_0x1a04d0,_0x1dd023,_0x3e1663){return db[_0x4653('0x2f')][_0x4653('0x78')]({'where':{'id':_0x1a04d0[_0x4653('0x48')]['id']}})[_0x4653('0x29')](handleEntityNotFound(_0x1dd023))['then'](function(_0x447e4b){if(_0x447e4b&&_0x447e4b[_0x4653('0x91')]){var _0x48d051=_0x447e4b['fileText'];var _0x49e1a0=config[_0x4653('0x92')]+'/server/files/transcribes/transcribe_'+_0x447e4b['id']+_0x4653('0x93');if(fs[_0x4653('0x51')](_0x49e1a0)){return _0x49e1a0;}return writeFile(_0x48d051,_0x49e1a0)[_0x4653('0x29')](function(){return _0x49e1a0;});}else{throw new db[(_0x4653('0x56'))][(_0x4653('0x57'))](_0x4653('0x94'));}})[_0x4653('0x29')](function(_0x53bccd){return _0x1dd023[_0x4653('0x4d')](_0x53bccd);})[_0x4653('0x46')](handleError(_0x1dd023));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index bd445d1..898b404 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 _0x84e1=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x189b6d,_0x2079ed){var _0xbd9db7=function(_0x5503f1){while(--_0x5503f1){_0x189b6d['push'](_0x189b6d['shift']());}};_0xbd9db7(++_0x2079ed);}(_0x84e1,0x1dc));var _0x184e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x84e1[_0x42cae2];return _0x5f256f;};'use strict';var attributes=require(_0x184e('0x0'));module[_0x184e('0x1')]=function(_0x1cb42b,_0x1e7e1f){return _0x1cb42b[_0x184e('0x2')](_0x184e('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x184e('0x4'),'fields':[_0x184e('0x4')]},{'name':_0x184e('0x5'),'fields':[_0x184e('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fed=['define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x20260a,_0x5c0adc){var _0x45f463=function(_0x10a6db){while(--_0x10a6db){_0x20260a['push'](_0x20260a['shift']());}};_0x45f463(++_0x5c0adc);}(_0x8fed,0xf5));var _0xd8fe=function(_0x311f04,_0x372366){_0x311f04=_0x311f04-0x0;var _0x264b6e=_0x8fed[_0x311f04];return _0x264b6e;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x12d94e,_0x3cd4e3){return _0x12d94e[_0xd8fe('0x0')](_0xd8fe('0x1'),attributes,{'tableName':_0xd8fe('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd8fe('0x3')]},{'name':_0xd8fe('0x4'),'fields':[_0xd8fe('0x4')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index bd58d0b..7701a02 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 _0x7096=['raw','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','findOne','create','existsSync','format','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options'];(function(_0x50f290,_0x4a5895){var _0x1743b3=function(_0x447b90){while(--_0x447b90){_0x50f290['push'](_0x50f290['shift']());}};_0x1743b3(++_0x4a5895);}(_0x7096,0x10c));var _0x6709=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7096[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['update'](_0x235a54[_0x6709('0x18')],{'raw':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x235a54['options']?_0x235a54[_0x6709('0x19')][_0x6709('0x1b')]||null:null,'attributes':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1c')]||null:null,'limit':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1d')]||null:null})[_0x6709('0xb')](function(_0x1c5153){logger[_0x6709('0xc')](_0x6709('0x16'),_0x235a54);logger['debug'](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x1c5153));_0x9c1fd8(_0x1c5153);})[_0x6709('0x15')](function(_0x5c7982){logger[_0x6709('0x11')](_0x6709('0x16'),_0x5c7982[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e[_0x6709('0x11')](0x1f4,_0x5c7982['message']));});});};exports[_0x6709('0x1e')]=function(_0x3076fe){var _0x50f7d6=this;return new Promise(function(_0x585073,_0x39f6a9){var _0x5dbb87=require(_0x6709('0x1f'));var _0x2499a2;return db['Setting'][_0x6709('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x6709('0xb')](function(_0x3cd555){_0x2499a2=_0x3cd555;return db['VoiceRecording'][_0x6709('0x21')](_0x3076fe['body']);})[_0x6709('0xb')](function(_0x388aee){if(_0x2499a2['callRecordingEncryption']&&fs[_0x6709('0x22')](_0x388aee['value'])){var _0x138318=util[_0x6709('0x23')]('%s.cypher',_0x388aee['value']);return _0x5dbb87[_0x6709('0x24')](_0x388aee[_0x6709('0x25')],_0x138318,config[_0x6709('0x26')][_0x6709('0x27')])[_0x6709('0xb')](function(){fs[_0x6709('0x28')](_0x388aee[_0x6709('0x25')]);logger[_0x6709('0xc')](_0x6709('0x29'));return _0x388aee;});}return _0x388aee;})['then'](function(_0x3d9501){logger[_0x6709('0xc')](_0x6709('0x1e'),_0x3076fe);logger[_0x6709('0xf')]('CreateVoiceRecording',_0x3076fe,JSON[_0x6709('0x10')](_0x3d9501));_0x585073(_0x3d9501);})[_0x6709('0x15')](function(_0x124e01){logger[_0x6709('0x11')]('CreateVoiceRecording',_0x124e01[_0x6709('0x13')],_0x3076fe);_0x39f6a9(_0x50f7d6[_0x6709('0x11')](0x1f4,_0x124e01['message']));});});}; \ No newline at end of file +var _0xffd6=['catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','CreateVoiceRecording','../../components/encryptor','Setting','VoiceRecording','create','callRecordingEncryption','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x47efbc,_0x1fca00){var _0x5e1e11=function(_0x45bfa6){while(--_0x45bfa6){_0x47efbc['push'](_0x47efbc['shift']());}};_0x5e1e11(++_0x1fca00);}(_0xffd6,0x97));var _0x6ffd=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0xffd6[_0x3f6565];return _0x4abd23;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}exports[_0x6ffd('0x16')]=function(_0x889a4b){var _0x545576=this;return new Promise(function(_0x11a609,_0x56c541){return db['VoiceRecording'][_0x6ffd('0x17')](_0x889a4b[_0x6ffd('0x18')],{'raw':_0x889a4b['options']?_0x889a4b[_0x6ffd('0x19')][_0x6ffd('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x889a4b['options']?_0x889a4b['options'][_0x6ffd('0x1b')]||null:null,'attributes':_0x889a4b[_0x6ffd('0x19')]?_0x889a4b['options'][_0x6ffd('0x1c')]||null:null,'limit':_0x889a4b[_0x6ffd('0x19')]?_0x889a4b[_0x6ffd('0x19')]['limit']||null:null})[_0x6ffd('0xa')](function(_0x2efeb5){logger['info'](_0x6ffd('0x16'),_0x889a4b);logger[_0x6ffd('0xd')]('UpdateVoiceRecording',_0x889a4b,JSON[_0x6ffd('0xf')](_0x2efeb5));_0x11a609(_0x2efeb5);})[_0x6ffd('0x15')](function(_0xb504e5){logger['error'](_0x6ffd('0x16'),_0xb504e5[_0x6ffd('0x12')],_0x889a4b);_0x56c541(_0x545576[_0x6ffd('0x10')](0x1f4,_0xb504e5['message']));});});};exports[_0x6ffd('0x1d')]=function(_0x5a55e2){var _0x41ab4a=this;return new Promise(function(_0x43269c,_0x56c6de){var _0x520258=require(_0x6ffd('0x1e'));var _0x2a0391;return db[_0x6ffd('0x1f')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x6ffd('0xa')](function(_0x48feb4){_0x2a0391=_0x48feb4;return db[_0x6ffd('0x20')][_0x6ffd('0x21')](_0x5a55e2['body']);})[_0x6ffd('0xa')](function(_0xc790b2){if(_0x2a0391[_0x6ffd('0x22')]&&fs[_0x6ffd('0x23')](_0xc790b2[_0x6ffd('0x24')])){var _0x31c609=util[_0x6ffd('0x25')](_0x6ffd('0x26'),_0xc790b2[_0x6ffd('0x24')]);return _0x520258[_0x6ffd('0x27')](_0xc790b2[_0x6ffd('0x24')],_0x31c609,config[_0x6ffd('0x28')][_0x6ffd('0x29')])['then'](function(){fs['unlink'](_0xc790b2['value']);logger[_0x6ffd('0x13')](_0x6ffd('0x2a'));return _0xc790b2;});}return _0xc790b2;})[_0x6ffd('0xa')](function(_0x528a3f){logger[_0x6ffd('0x13')](_0x6ffd('0x1d'),_0x5a55e2);logger[_0x6ffd('0xd')](_0x6ffd('0x1d'),_0x5a55e2,JSON[_0x6ffd('0xf')](_0x528a3f));_0x43269c(_0x528a3f);})[_0x6ffd('0x15')](function(_0x26394c){logger[_0x6ffd('0x10')](_0x6ffd('0x1d'),_0x26394c['message'],_0x5a55e2);_0x56c6de(_0x41ab4a[_0x6ffd('0x10')](0x1f4,_0x26394c[_0x6ffd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index eb0e06b..0a53213 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 _0xa71d=['../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40437d,_0x540920){var _0x4fa333=function(_0x1d6161){while(--_0x1d6161){_0x40437d['push'](_0x40437d['shift']());}};_0x4fa333(++_0x540920);}(_0xa71d,0x1f1));var _0xda71=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xa71d[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0xda71('0x0'));var util=require(_0xda71('0x1'));var path=require(_0xda71('0x2'));var timeout=require(_0xda71('0x3'));var express=require(_0xda71('0x4'));var router=express[_0xda71('0x5')]();var fs_extra=require(_0xda71('0x6'));var auth=require(_0xda71('0x7'));var interaction=require(_0xda71('0x8'));var config=require(_0xda71('0x9'));var controller=require(_0xda71('0xa'));router[_0xda71('0xb')]('/',auth[_0xda71('0xc')](),controller['index']);router[_0xda71('0xb')](_0xda71('0xd'),auth[_0xda71('0xc')](),controller[_0xda71('0xe')]);router[_0xda71('0xb')](_0xda71('0xf'),auth[_0xda71('0xc')](),controller[_0xda71('0x10')]);router[_0xda71('0x11')]('/',auth[_0xda71('0xc')](),controller[_0xda71('0x12')]);router[_0xda71('0x13')](_0xda71('0xf'),auth[_0xda71('0xc')](),controller[_0xda71('0x14')]);router[_0xda71('0x15')](_0xda71('0xf'),auth[_0xda71('0xc')](),controller['destroy']);module[_0xda71('0x16')]=router; \ No newline at end of file +var _0x6586=['index','/describe','describe','/:id','show','create','put','update','destroy','multer','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x6586,0x129));var _0x6658=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x6586[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x6658('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6658('0x1'));var router=express[_0x6658('0x2')]();var fs_extra=require(_0x6658('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6658('0x4'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x6658('0x5')]('/',auth[_0x6658('0x6')](),controller[_0x6658('0x7')]);router['get'](_0x6658('0x8'),auth[_0x6658('0x6')](),controller[_0x6658('0x9')]);router['get'](_0x6658('0xa'),auth[_0x6658('0x6')](),controller[_0x6658('0xb')]);router['post']('/',auth[_0x6658('0x6')](),controller[_0x6658('0xc')]);router[_0x6658('0xd')](_0x6658('0xa'),auth[_0x6658('0x6')](),controller[_0x6658('0xe')]);router['delete'](_0x6658('0xa'),auth[_0x6658('0x6')](),controller[_0x6658('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 49a4994..713e636 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 _0xd7d0=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x5921e4,_0x1b7bd2){var _0x4100c5=function(_0xf966f7){while(--_0xf966f7){_0x5921e4['push'](_0x5921e4['shift']());}};_0x4100c5(++_0x1b7bd2);}(_0xd7d0,0x11e));var _0x0d7d=function(_0xb314a6,_0x3e9b41){_0xb314a6=_0xb314a6-0x0;var _0x1a5c11=_0xd7d0[_0xb314a6];return _0x1a5c11;};'use strict';var Sequelize=require(_0x0d7d('0x0'));var moment=require(_0x0d7d('0x1'));module[_0x0d7d('0x2')]={'type':{'type':Sequelize[_0x0d7d('0x3')](_0x0d7d('0x4'),_0x0d7d('0x5'))},'result':{'type':Sequelize[_0x0d7d('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x0d7d('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x0d7d('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x0d7d('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x0d7d('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x0d7d('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x0d7d('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x0d7d('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x0d7d('0x6')]},'transfereecontext':{'type':Sequelize[_0x0d7d('0x6')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x0d7d('0x3')](_0x0d7d('0x7'),'No')},'context':{'type':Sequelize[_0x0d7d('0x6')]},'extension':{'type':Sequelize[_0x0d7d('0x6')]}}; \ No newline at end of file +var _0x41e4=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x1b1e12,_0x3605ff){var _0x1043f2=function(_0x1b84b6){while(--_0x1b84b6){_0x1b1e12['push'](_0x1b1e12['shift']());}};_0x1043f2(++_0x3605ff);}(_0x41e4,0xa6));var _0x441e=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x41e4[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x441e('0x0'));var moment=require(_0x441e('0x1'));module[_0x441e('0x2')]={'type':{'type':Sequelize[_0x441e('0x3')](_0x441e('0x4'),_0x441e('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x441e('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x441e('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x441e('0x6')]},'transfererexten':{'type':Sequelize[_0x441e('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x441e('0x6')]},'transfereechannel':{'type':Sequelize[_0x441e('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x441e('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x441e('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x441e('0x6')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x441e('0x6')]},'transfereecontext':{'type':Sequelize[_0x441e('0x6')]},'transfereeexten':{'type':Sequelize[_0x441e('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x441e('0x3')](_0x441e('0x7'),'No')},'context':{'type':Sequelize[_0x441e('0x6')]},'extension':{'type':Sequelize[_0x441e('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index f76f433..2e2cac2 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 _0xaad3=['end','status','json','offset','limit','undefined','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceTransferReport','count','includeAll','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaad3,0x1b0));var _0x3aad=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xaad3[_0x59befa];return _0x1dd63d;};'use strict';var emlformat=require(_0x3aad('0x0'));var rimraf=require(_0x3aad('0x1'));var zipdir=require(_0x3aad('0x2'));var jsonpatch=require(_0x3aad('0x3'));var rp=require(_0x3aad('0x4'));var moment=require(_0x3aad('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3aad('0x6'));var path=require('path');var sox=require(_0x3aad('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3aad('0x8'));var _=require(_0x3aad('0x9'));var squel=require(_0x3aad('0xa'));var crypto=require(_0x3aad('0xb'));var jsforce=require(_0x3aad('0xc'));var deskjs=require(_0x3aad('0xd'));var toCsv=require(_0x3aad('0xe'));var querystring=require(_0x3aad('0xf'));var Papa=require(_0x3aad('0x10'));var Redis=require(_0x3aad('0x11'));var authService=require(_0x3aad('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3aad('0x13'));var logger=require(_0x3aad('0x14'))(_0x3aad('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3aad('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe2a6bb,_0x58dfbe){_0x58dfbe=_0x58dfbe||0xcc;return function(_0x56f2fd){if(_0x56f2fd){return _0xe2a6bb[_0x3aad('0x17')](_0x58dfbe);}return _0xe2a6bb['status'](_0x58dfbe)[_0x3aad('0x18')]();};}function respondWithResult(_0x5ee6b0,_0x529e26){_0x529e26=_0x529e26||0xc8;return function(_0x55ae60){if(_0x55ae60){return _0x5ee6b0[_0x3aad('0x19')](_0x529e26)[_0x3aad('0x1a')](_0x55ae60);}};}function respondWithFilteredResult(_0x36c1ea,_0x4ffcc5){return function(_0x5db4c2){if(_0x5db4c2){var _0x3fc377=typeof _0x4ffcc5[_0x3aad('0x1b')]==='undefined'&&typeof _0x4ffcc5[_0x3aad('0x1c')]===_0x3aad('0x1d');var _0x58f5f9=_0x5db4c2['count'];var _0x12bbd3=_0x3fc377?0x0:_0x4ffcc5['offset'];var _0x46e7a8=_0x3fc377?_0x5db4c2['count']:_0x4ffcc5[_0x3aad('0x1b')]+_0x4ffcc5[_0x3aad('0x1c')];var _0x5247a3;if(_0x46e7a8>=_0x58f5f9){_0x46e7a8=_0x58f5f9;_0x5247a3=0xc8;}else{_0x5247a3=0xce;}_0x36c1ea[_0x3aad('0x19')](_0x5247a3);return _0x36c1ea['set'](_0x3aad('0x1e'),_0x12bbd3+'-'+_0x46e7a8+'/'+_0x58f5f9)[_0x3aad('0x1a')](_0x5db4c2);}return null;};}function patchUpdates(_0x389886){return function(_0xcb898c){try{jsonpatch[_0x3aad('0x1f')](_0xcb898c,_0x389886,!![]);}catch(_0x51600e){return BPromise[_0x3aad('0x20')](_0x51600e);}return _0xcb898c[_0x3aad('0x21')]();};}function saveUpdates(_0x13aaf1,_0x2f6e1d){return function(_0x44f987){if(_0x44f987){return _0x44f987[_0x3aad('0x22')](_0x13aaf1)['then'](function(_0x161a50){return _0x161a50;});}return null;};}function removeEntity(_0x206178,_0x5d81d5){return function(_0x34aae6){if(_0x34aae6){return _0x34aae6[_0x3aad('0x23')]()[_0x3aad('0x24')](function(){_0x206178[_0x3aad('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb81fd9,_0x1c1839){return function(_0x277c37){if(!_0x277c37){_0xb81fd9['sendStatus'](0x194);}return _0x277c37;};}function handleError(_0x125a7b,_0x35127c){_0x35127c=_0x35127c||0x1f4;return function(_0x1743e8){logger[_0x3aad('0x25')](_0x1743e8[_0x3aad('0x26')]);if(_0x1743e8[_0x3aad('0x27')]){delete _0x1743e8[_0x3aad('0x27')];}_0x125a7b[_0x3aad('0x19')](_0x35127c)[_0x3aad('0x28')](_0x1743e8);};}exports['index']=function(_0x576f8a,_0x3dec66){var _0x29a04b={},_0x588bdd={},_0x187e2a={'count':0x0,'rows':[]};var _0xab0219=_['map'](db['VoiceTransferReport'][_0x3aad('0x29')],function(_0x4840f2){return{'name':_0x4840f2[_0x3aad('0x2a')],'type':_0x4840f2[_0x3aad('0x2b')][_0x3aad('0x2c')]};});_0x588bdd[_0x3aad('0x2d')]=_[_0x3aad('0x2e')](_0xab0219,'name');_0x588bdd['query']=_[_0x3aad('0x2f')](_0x576f8a[_0x3aad('0x30')]);_0x588bdd[_0x3aad('0x31')]=_[_0x3aad('0x32')](_0x588bdd[_0x3aad('0x2d')],_0x588bdd[_0x3aad('0x30')]);_0x29a04b[_0x3aad('0x33')]=_[_0x3aad('0x32')](_0x588bdd[_0x3aad('0x2d')],qs[_0x3aad('0x34')](_0x576f8a[_0x3aad('0x30')][_0x3aad('0x34')]));_0x29a04b[_0x3aad('0x33')]=_0x29a04b[_0x3aad('0x33')]['length']?_0x29a04b[_0x3aad('0x33')]:_0x588bdd['model'];if(!_0x576f8a[_0x3aad('0x30')][_0x3aad('0x35')](_0x3aad('0x36'))){_0x29a04b[_0x3aad('0x1c')]=qs['limit'](_0x576f8a[_0x3aad('0x30')]['limit']);_0x29a04b[_0x3aad('0x1b')]=qs[_0x3aad('0x1b')](_0x576f8a[_0x3aad('0x30')][_0x3aad('0x1b')]);}_0x29a04b[_0x3aad('0x37')]=qs[_0x3aad('0x38')](_0x576f8a[_0x3aad('0x30')][_0x3aad('0x38')]);_0x29a04b[_0x3aad('0x39')]=qs[_0x3aad('0x31')](_[_0x3aad('0x3a')](_0x576f8a[_0x3aad('0x30')],_0x588bdd[_0x3aad('0x31')]),_0xab0219);if(_0x576f8a[_0x3aad('0x30')][_0x3aad('0x3b')]){_0x29a04b[_0x3aad('0x39')]=_['merge'](_0x29a04b['where'],{'$or':_[_0x3aad('0x2e')](_0xab0219,function(_0x21a4e0){if(_0x21a4e0[_0x3aad('0x2b')]!==_0x3aad('0x3c')){var _0x59c9fa={};_0x59c9fa[_0x21a4e0['name']]={'$like':'%'+_0x576f8a[_0x3aad('0x30')][_0x3aad('0x3b')]+'%'};return _0x59c9fa;}})});}_0x29a04b=_[_0x3aad('0x3d')]({},_0x29a04b,_0x576f8a[_0x3aad('0x3e')]);var _0x4f929c={'where':_0x29a04b[_0x3aad('0x39')]};return db[_0x3aad('0x3f')][_0x3aad('0x40')](_0x4f929c)[_0x3aad('0x24')](function(_0x1e2c68){_0x187e2a[_0x3aad('0x40')]=_0x1e2c68;if(_0x576f8a['query'][_0x3aad('0x41')]){_0x29a04b[_0x3aad('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x3aad('0x43')](_0x29a04b);})['then'](function(_0x133eed){_0x187e2a['rows']=_0x133eed;return _0x187e2a;})[_0x3aad('0x24')](respondWithFilteredResult(_0x3dec66,_0x29a04b))[_0x3aad('0x44')](handleError(_0x3dec66,null));};exports[_0x3aad('0x45')]=function(_0x43fb35,_0x57e4bf){var _0x465fa1={'raw':!![],'where':{'id':_0x43fb35[_0x3aad('0x46')]['id']}},_0x47bff9={};_0x47bff9['model']=_[_0x3aad('0x2f')](db[_0x3aad('0x3f')][_0x3aad('0x29')]);_0x47bff9[_0x3aad('0x30')]=_[_0x3aad('0x2f')](_0x43fb35[_0x3aad('0x30')]);_0x47bff9[_0x3aad('0x31')]=_[_0x3aad('0x32')](_0x47bff9[_0x3aad('0x2d')],_0x47bff9['query']);_0x465fa1[_0x3aad('0x33')]=_[_0x3aad('0x32')](_0x47bff9['model'],qs['fields'](_0x43fb35[_0x3aad('0x30')]['fields']));_0x465fa1[_0x3aad('0x33')]=_0x465fa1[_0x3aad('0x33')][_0x3aad('0x47')]?_0x465fa1['attributes']:_0x47bff9[_0x3aad('0x2d')];if(_0x43fb35[_0x3aad('0x30')]['includeAll']){_0x465fa1['include']=[{'all':!![]}];}_0x465fa1=_['merge']({},_0x465fa1,_0x43fb35[_0x3aad('0x3e')]);return db[_0x3aad('0x3f')][_0x3aad('0x48')](_0x465fa1)[_0x3aad('0x24')](handleEntityNotFound(_0x57e4bf,null))[_0x3aad('0x24')](respondWithResult(_0x57e4bf,null))[_0x3aad('0x44')](handleError(_0x57e4bf,null));};exports[_0x3aad('0x49')]=function(_0x578c65,_0x434b48){return db['VoiceTransferReport'][_0x3aad('0x49')](_0x578c65['body'],{})['then'](respondWithResult(_0x434b48,0xc9))[_0x3aad('0x44')](handleError(_0x434b48,null));};exports[_0x3aad('0x22')]=function(_0x2e2e23,_0x4ff843){if(_0x2e2e23[_0x3aad('0x4a')]['id']){delete _0x2e2e23[_0x3aad('0x4a')]['id'];}return db[_0x3aad('0x3f')][_0x3aad('0x48')]({'where':{'id':_0x2e2e23[_0x3aad('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ff843,null))[_0x3aad('0x24')](saveUpdates(_0x2e2e23[_0x3aad('0x4a')],null))['then'](respondWithResult(_0x4ff843,null))[_0x3aad('0x44')](handleError(_0x4ff843,null));};exports[_0x3aad('0x23')]=function(_0x301008,_0x4505a3){return db[_0x3aad('0x3f')][_0x3aad('0x48')]({'where':{'id':_0x301008[_0x3aad('0x46')]['id']}})['then'](handleEntityNotFound(_0x4505a3,null))[_0x3aad('0x24')](removeEntity(_0x4505a3,null))[_0x3aad('0x44')](handleError(_0x4505a3,null));};exports[_0x3aad('0x4b')]=function(_0x51e8a5,_0x6fa6e4){return db[_0x3aad('0x3f')]['describe']()[_0x3aad('0x24')](respondWithResult(_0x6fa6e4,null))[_0x3aad('0x44')](handleError(_0x6fa6e4,null));}; \ No newline at end of file +var _0x6c75=['reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','fields','options','find','create','body','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','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','limit','count','Content-Range','json','apply'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x6c75,0xbd));var _0x56c7=function(_0xa82c60,_0x3f05bf){_0xa82c60=_0xa82c60-0x0;var _0x291fef=_0x6c75[_0xa82c60];return _0x291fef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x56c7('0x0'));var rp=require(_0x56c7('0x1'));var moment=require('moment');var BPromise=require(_0x56c7('0x2'));var Mustache=require(_0x56c7('0x3'));var util=require(_0x56c7('0x4'));var path=require(_0x56c7('0x5'));var sox=require('sox');var csv=require(_0x56c7('0x6'));var ejs=require(_0x56c7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56c7('0x8'));var squel=require(_0x56c7('0x9'));var crypto=require(_0x56c7('0xa'));var jsforce=require(_0x56c7('0xb'));var deskjs=require(_0x56c7('0xc'));var toCsv=require(_0x56c7('0x6'));var querystring=require(_0x56c7('0xd'));var Papa=require('papaparse');var Redis=require(_0x56c7('0xe'));var authService=require(_0x56c7('0xf'));var qs=require(_0x56c7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56c7('0x11'));var logger=require(_0x56c7('0x12'))(_0x56c7('0x13'));var utils=require(_0x56c7('0x14'));var config=require(_0x56c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x56c7('0x16'))['db'];function respondWithStatusCode(_0x5245f5,_0xa653f8){_0xa653f8=_0xa653f8||0xcc;return function(_0x1dd514){if(_0x1dd514){return _0x5245f5[_0x56c7('0x17')](_0xa653f8);}return _0x5245f5[_0x56c7('0x18')](_0xa653f8)[_0x56c7('0x19')]();};}function respondWithResult(_0x2e7f3e,_0x87e7e5){_0x87e7e5=_0x87e7e5||0xc8;return function(_0x6b78e1){if(_0x6b78e1){return _0x2e7f3e[_0x56c7('0x18')](_0x87e7e5)['json'](_0x6b78e1);}};}function respondWithFilteredResult(_0x23f4cd,_0x290fca){return function(_0x5a4ce7){if(_0x5a4ce7){var _0x552831=typeof _0x290fca[_0x56c7('0x1a')]===_0x56c7('0x1b')&&typeof _0x290fca[_0x56c7('0x1c')]==='undefined';var _0x145642=_0x5a4ce7[_0x56c7('0x1d')];var _0x46b19e=_0x552831?0x0:_0x290fca[_0x56c7('0x1a')];var _0x254b57=_0x552831?_0x5a4ce7[_0x56c7('0x1d')]:_0x290fca[_0x56c7('0x1a')]+_0x290fca[_0x56c7('0x1c')];var _0x467c42;if(_0x254b57>=_0x145642){_0x254b57=_0x145642;_0x467c42=0xc8;}else{_0x467c42=0xce;}_0x23f4cd['status'](_0x467c42);return _0x23f4cd['set'](_0x56c7('0x1e'),_0x46b19e+'-'+_0x254b57+'/'+_0x145642)[_0x56c7('0x1f')](_0x5a4ce7);}return null;};}function patchUpdates(_0x2b19bd){return function(_0x2c43fc){try{jsonpatch[_0x56c7('0x20')](_0x2c43fc,_0x2b19bd,!![]);}catch(_0xe3ede1){return BPromise[_0x56c7('0x21')](_0xe3ede1);}return _0x2c43fc[_0x56c7('0x22')]();};}function saveUpdates(_0x58d779,_0x17ec14){return function(_0x39da1e){if(_0x39da1e){return _0x39da1e[_0x56c7('0x23')](_0x58d779)[_0x56c7('0x24')](function(_0x3c24c1){return _0x3c24c1;});}return null;};}function removeEntity(_0x1863e5,_0x1358ba){return function(_0x5b6106){if(_0x5b6106){return _0x5b6106[_0x56c7('0x25')]()[_0x56c7('0x24')](function(){_0x1863e5[_0x56c7('0x18')](0xcc)[_0x56c7('0x19')]();});}};}function handleEntityNotFound(_0x1abff3,_0x45f5c1){return function(_0x508ca0){if(!_0x508ca0){_0x1abff3[_0x56c7('0x17')](0x194);}return _0x508ca0;};}function handleError(_0x303722,_0x3c712a){_0x3c712a=_0x3c712a||0x1f4;return function(_0x3410ca){logger[_0x56c7('0x26')](_0x3410ca[_0x56c7('0x27')]);if(_0x3410ca[_0x56c7('0x28')]){delete _0x3410ca[_0x56c7('0x28')];}_0x303722['status'](_0x3c712a)[_0x56c7('0x29')](_0x3410ca);};}exports[_0x56c7('0x2a')]=function(_0x3faf9e,_0x41233d){var _0x5872c6={},_0x2d83b5={},_0x437ab2={'count':0x0,'rows':[]};var _0x5394ad=_[_0x56c7('0x2b')](db[_0x56c7('0x2c')]['rawAttributes'],function(_0x7cfc29){return{'name':_0x7cfc29[_0x56c7('0x2d')],'type':_0x7cfc29[_0x56c7('0x2e')][_0x56c7('0x2f')]};});_0x2d83b5[_0x56c7('0x30')]=_['map'](_0x5394ad,'name');_0x2d83b5[_0x56c7('0x31')]=_[_0x56c7('0x32')](_0x3faf9e[_0x56c7('0x31')]);_0x2d83b5[_0x56c7('0x33')]=_[_0x56c7('0x34')](_0x2d83b5[_0x56c7('0x30')],_0x2d83b5[_0x56c7('0x31')]);_0x5872c6[_0x56c7('0x35')]=_['intersection'](_0x2d83b5['model'],qs['fields'](_0x3faf9e[_0x56c7('0x31')]['fields']));_0x5872c6[_0x56c7('0x35')]=_0x5872c6[_0x56c7('0x35')][_0x56c7('0x36')]?_0x5872c6[_0x56c7('0x35')]:_0x2d83b5[_0x56c7('0x30')];if(!_0x3faf9e[_0x56c7('0x31')]['hasOwnProperty']('nolimit')){_0x5872c6[_0x56c7('0x1c')]=qs[_0x56c7('0x1c')](_0x3faf9e['query'][_0x56c7('0x1c')]);_0x5872c6[_0x56c7('0x1a')]=qs['offset'](_0x3faf9e[_0x56c7('0x31')][_0x56c7('0x1a')]);}_0x5872c6[_0x56c7('0x37')]=qs['sort'](_0x3faf9e[_0x56c7('0x31')][_0x56c7('0x38')]);_0x5872c6[_0x56c7('0x39')]=qs['filters'](_[_0x56c7('0x3a')](_0x3faf9e['query'],_0x2d83b5['filters']),_0x5394ad);if(_0x3faf9e[_0x56c7('0x31')][_0x56c7('0x3b')]){_0x5872c6[_0x56c7('0x39')]=_[_0x56c7('0x3c')](_0x5872c6['where'],{'$or':_[_0x56c7('0x2b')](_0x5394ad,function(_0x2232e7){if(_0x2232e7[_0x56c7('0x2e')]!==_0x56c7('0x3d')){var _0x4c4054={};_0x4c4054[_0x2232e7[_0x56c7('0x28')]]={'$like':'%'+_0x3faf9e[_0x56c7('0x31')]['filter']+'%'};return _0x4c4054;}})});}_0x5872c6=_['merge']({},_0x5872c6,_0x3faf9e['options']);var _0x6cf8={'where':_0x5872c6[_0x56c7('0x39')]};return db[_0x56c7('0x2c')][_0x56c7('0x1d')](_0x6cf8)[_0x56c7('0x24')](function(_0x1a71c4){_0x437ab2['count']=_0x1a71c4;if(_0x3faf9e[_0x56c7('0x31')][_0x56c7('0x3e')]){_0x5872c6[_0x56c7('0x3f')]=[{'all':!![]}];}return db[_0x56c7('0x2c')][_0x56c7('0x40')](_0x5872c6);})[_0x56c7('0x24')](function(_0x41104b){_0x437ab2[_0x56c7('0x41')]=_0x41104b;return _0x437ab2;})[_0x56c7('0x24')](respondWithFilteredResult(_0x41233d,_0x5872c6))[_0x56c7('0x42')](handleError(_0x41233d,null));};exports['show']=function(_0x3b7cc8,_0xaeb545){var _0xd9d529={'raw':!![],'where':{'id':_0x3b7cc8[_0x56c7('0x43')]['id']}},_0x5e4194={};_0x5e4194[_0x56c7('0x30')]=_[_0x56c7('0x32')](db['VoiceTransferReport']['rawAttributes']);_0x5e4194['query']=_['keys'](_0x3b7cc8[_0x56c7('0x31')]);_0x5e4194[_0x56c7('0x33')]=_['intersection'](_0x5e4194['model'],_0x5e4194[_0x56c7('0x31')]);_0xd9d529[_0x56c7('0x35')]=_[_0x56c7('0x34')](_0x5e4194[_0x56c7('0x30')],qs[_0x56c7('0x44')](_0x3b7cc8[_0x56c7('0x31')][_0x56c7('0x44')]));_0xd9d529['attributes']=_0xd9d529[_0x56c7('0x35')][_0x56c7('0x36')]?_0xd9d529[_0x56c7('0x35')]:_0x5e4194[_0x56c7('0x30')];if(_0x3b7cc8[_0x56c7('0x31')]['includeAll']){_0xd9d529['include']=[{'all':!![]}];}_0xd9d529=_[_0x56c7('0x3c')]({},_0xd9d529,_0x3b7cc8[_0x56c7('0x45')]);return db[_0x56c7('0x2c')][_0x56c7('0x46')](_0xd9d529)[_0x56c7('0x24')](handleEntityNotFound(_0xaeb545,null))['then'](respondWithResult(_0xaeb545,null))[_0x56c7('0x42')](handleError(_0xaeb545,null));};exports[_0x56c7('0x47')]=function(_0x3f39b6,_0x25b7f6){return db['VoiceTransferReport'][_0x56c7('0x47')](_0x3f39b6[_0x56c7('0x48')],{})['then'](respondWithResult(_0x25b7f6,0xc9))[_0x56c7('0x42')](handleError(_0x25b7f6,null));};exports[_0x56c7('0x23')]=function(_0x3f098f,_0x232d32){if(_0x3f098f[_0x56c7('0x48')]['id']){delete _0x3f098f[_0x56c7('0x48')]['id'];}return db[_0x56c7('0x2c')][_0x56c7('0x46')]({'where':{'id':_0x3f098f['params']['id']}})[_0x56c7('0x24')](handleEntityNotFound(_0x232d32,null))[_0x56c7('0x24')](saveUpdates(_0x3f098f[_0x56c7('0x48')],null))[_0x56c7('0x24')](respondWithResult(_0x232d32,null))[_0x56c7('0x42')](handleError(_0x232d32,null));};exports[_0x56c7('0x25')]=function(_0x47064d,_0x9c050b){return db['VoiceTransferReport'][_0x56c7('0x46')]({'where':{'id':_0x47064d[_0x56c7('0x43')]['id']}})[_0x56c7('0x24')](handleEntityNotFound(_0x9c050b,null))[_0x56c7('0x24')](removeEntity(_0x9c050b,null))[_0x56c7('0x42')](handleError(_0x9c050b,null));};exports[_0x56c7('0x49')]=function(_0x4cd81c,_0x123a91){return db[_0x56c7('0x2c')]['describe']()['then'](respondWithResult(_0x123a91,null))[_0x56c7('0x42')](handleError(_0x123a91,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a155ef3..73bd857 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 _0x0cab=['util','../../config/logger','api','request-promise','path','rimraf','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x0cab,0x16a));var _0xb0ca=function(_0x291d5c,_0x384244){_0x291d5c=_0x291d5c-0x0;var _0x9a75ff=_0x0cab[_0x291d5c];return _0x9a75ff;};'use strict';var _=require(_0xb0ca('0x0'));var util=require(_0xb0ca('0x1'));var logger=require(_0xb0ca('0x2'))(_0xb0ca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb0ca('0x4'));var fs=require('fs');var path=require(_0xb0ca('0x5'));var rimraf=require(_0xb0ca('0x6'));var config=require('../../config/environment');var attributes=require(_0xb0ca('0x7'));module[_0xb0ca('0x8')]=function(_0x4f94e2,_0x378497){return _0x4f94e2[_0xb0ca('0x9')](_0xb0ca('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5990=['report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','VoiceTransferReport'];(function(_0x517b18,_0x495b58){var _0x400ed3=function(_0x3ce1be){while(--_0x3ce1be){_0x517b18['push'](_0x517b18['shift']());}};_0x400ed3(++_0x495b58);}(_0x5990,0xdd));var _0x0599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5990[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0599('0x0'));var util=require('util');var logger=require(_0x0599('0x1'))(_0x0599('0x2'));var moment=require(_0x0599('0x3'));var BPromise=require(_0x0599('0x4'));var rp=require(_0x0599('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0599('0x6'));var config=require(_0x0599('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x4606be,_0x2e76ab){return _0x4606be[_0x0599('0x8')](_0x0599('0x9'),attributes,{'tableName':_0x0599('0xa'),'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 c5adb4e..f25274a 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 _0xf990=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','options','raw','then'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0xf990,0x1a0));var _0x0f99=function(_0x5cdf74,_0xca9d5c){_0x5cdf74=_0x5cdf74-0x0;var _0x450cc2=_0xf990[_0x5cdf74];return _0x450cc2;};'use strict';var _=require(_0x0f99('0x0'));var util=require('util');var moment=require(_0x0f99('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f99('0x2'));var fs=require('fs');var Redis=require(_0x0f99('0x3'));var db=require(_0x0f99('0x4'))['db'];var utils=require(_0x0f99('0x5'));var logger=require(_0x0f99('0x6'))(_0x0f99('0x7'));var config=require(_0x0f99('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c92a5,_0x3551d2,_0x49d83c){return new BPromise(function(_0x31a4b8,_0x5a94fc){return client[_0x0f99('0xa')](_0x4c92a5,_0x49d83c)['then'](function(_0x4336ab){logger[_0x0f99('0xb')](_0x0f99('0xc'),_0x3551d2,_0x0f99('0xd'));logger[_0x0f99('0xe')](_0x0f99('0xf'),_0x3551d2,'request\x20sent',JSON[_0x0f99('0x10')](_0x4336ab));if(_0x4336ab[_0x0f99('0x11')]){if(_0x4336ab[_0x0f99('0x11')][_0x0f99('0x12')]===0x1f4){logger[_0x0f99('0x11')](_0x0f99('0xc'),_0x3551d2,_0x4336ab[_0x0f99('0x11')][_0x0f99('0x13')]);return _0x5a94fc(_0x4336ab['error'][_0x0f99('0x13')]);}logger['error'](_0x0f99('0xc'),_0x3551d2,_0x4336ab[_0x0f99('0x11')]['message']);return _0x31a4b8(_0x4336ab[_0x0f99('0x11')][_0x0f99('0x13')]);}else{logger[_0x0f99('0xb')](_0x0f99('0xc'),_0x3551d2,_0x0f99('0xd'));_0x31a4b8(_0x4336ab['result'][_0x0f99('0x13')]);}})[_0x0f99('0x14')](function(_0x329a34){logger[_0x0f99('0x11')](_0x0f99('0xc'),_0x3551d2,_0x329a34);_0x5a94fc(_0x329a34);});});}exports[_0x0f99('0x15')]=function(_0x43ba9b){var _0x98884e=this;return new Promise(function(_0x347357,_0x5e5682){return db[_0x0f99('0x16')]['create'](_0x43ba9b['body'],{'raw':_0x43ba9b[_0x0f99('0x17')]?_0x43ba9b[_0x0f99('0x17')][_0x0f99('0x18')]===undefined?!![]:![]:!![]})[_0x0f99('0x19')](function(_0x4d90da){logger[_0x0f99('0xb')](_0x0f99('0x15'),_0x43ba9b);logger['debug']('CreateVoiceTransferReport',_0x43ba9b,JSON['stringify'](_0x4d90da));_0x347357(_0x4d90da);})[_0x0f99('0x14')](function(_0x4b5a2a){logger[_0x0f99('0x11')]('CreateVoiceTransferReport',_0x4b5a2a['message'],_0x43ba9b);_0x5e5682(_0x98884e[_0x0f99('0x11')](0x1f4,_0x4b5a2a['message']));});});}; \ No newline at end of file +var _0xd836=['request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceTransferReport,\x20%s,\x20%s','info','catch','body','options','then','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x1f2eaa,_0x2814ef){var _0x2c69e3=function(_0x2f4eef){while(--_0x2f4eef){_0x1f2eaa['push'](_0x1f2eaa['shift']());}};_0x2c69e3(++_0x2814ef);}(_0xd836,0xc3));var _0x6d83=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd836[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x6d83('0x0'));var util=require(_0x6d83('0x1'));var moment=require(_0x6d83('0x2'));var BPromise=require(_0x6d83('0x3'));var rs=require(_0x6d83('0x4'));var fs=require('fs');var Redis=require(_0x6d83('0x5'));var db=require(_0x6d83('0x6'))['db'];var utils=require(_0x6d83('0x7'));var logger=require(_0x6d83('0x8'))('rpc');var config=require(_0x6d83('0x9'));var jayson=require(_0x6d83('0xa'));var client=jayson['client'][_0x6d83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a6df0,_0x149fa8,_0x18d918){return new BPromise(function(_0x4ab1e5,_0x13e6da){return client[_0x6d83('0xc')](_0x1a6df0,_0x18d918)['then'](function(_0x2f655f){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x149fa8,_0x6d83('0xd'));logger[_0x6d83('0xe')](_0x6d83('0xf'),_0x149fa8,_0x6d83('0xd'),JSON[_0x6d83('0x10')](_0x2f655f));if(_0x2f655f['error']){if(_0x2f655f[_0x6d83('0x11')]['code']===0x1f4){logger[_0x6d83('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x149fa8,_0x2f655f['error'][_0x6d83('0x12')]);return _0x13e6da(_0x2f655f[_0x6d83('0x11')][_0x6d83('0x12')]);}logger[_0x6d83('0x11')](_0x6d83('0x13'),_0x149fa8,_0x2f655f[_0x6d83('0x11')][_0x6d83('0x12')]);return _0x4ab1e5(_0x2f655f[_0x6d83('0x11')][_0x6d83('0x12')]);}else{logger[_0x6d83('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x149fa8,_0x6d83('0xd'));_0x4ab1e5(_0x2f655f['result']['message']);}})[_0x6d83('0x15')](function(_0x638a61){logger[_0x6d83('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x149fa8,_0x638a61);_0x13e6da(_0x638a61);});});}exports['CreateVoiceTransferReport']=function(_0x5cb739){var _0x3eb5b3=this;return new Promise(function(_0x5c2fe4,_0x88144e){return db['VoiceTransferReport']['create'](_0x5cb739[_0x6d83('0x16')],{'raw':_0x5cb739[_0x6d83('0x17')]?_0x5cb739[_0x6d83('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6d83('0x18')](function(_0x483420){logger[_0x6d83('0x14')](_0x6d83('0x19'),_0x5cb739);logger[_0x6d83('0xe')](_0x6d83('0x19'),_0x5cb739,JSON['stringify'](_0x483420));_0x5c2fe4(_0x483420);})[_0x6d83('0x15')](function(_0x5f17f8){logger['error']('CreateVoiceTransferReport',_0x5f17f8[_0x6d83('0x12')],_0x5cb739);_0x88144e(_0x3eb5b3[_0x6d83('0x11')](0x1f4,_0x5f17f8['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 6510ebc..d235cff 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 _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0xf3cd[_0x25248b];return _0x509939;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file +var _0x750a=['Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/unhold','unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x750a,0x140));var _0xa750=function(_0x1b0ce2,_0x125c91){_0x1b0ce2=_0x1b0ce2-0x0;var _0x1056fa=_0x750a[_0x1b0ce2];return _0x1056fa;};'use strict';var express=require('express');var router=express[_0xa750('0x0')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0xa750('0x1')](_0xa750('0x2'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x5')]);router[_0xa750('0x1')](_0xa750('0x6'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x7')]);router[_0xa750('0x1')](_0xa750('0x8'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xa750('0x1')]('/hold',auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller['hold']);router[_0xa750('0x1')](_0xa750('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xa750('0xa')]);router['post'](_0xa750('0xb'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller[_0xa750('0xc')]);router[_0xa750('0x1')](_0xa750('0xd'),auth['isAuthenticated'](),auth[_0xa750('0x4')](),controller[_0xa750('0xe')]);module[_0xa750('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index af5c77a..af6af09 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 _0x55e0=['NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup\x20fired:','userId','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send'];(function(_0x53c89d,_0x582b08){var _0x309480=function(_0x40bcfb){while(--_0x40bcfb){_0x53c89d['push'](_0x53c89d['shift']());}};_0x309480(++_0x582b08);}(_0x55e0,0xdc));var _0x055e=function(_0x4a869e,_0x84c67f){_0x4a869e=_0x4a869e-0x0;var _0xd2851f=_0x55e0[_0x4a869e];return _0xd2851f;};'use strict';var path=require(_0x055e('0x0'));var fs=require('fs');var _=require(_0x055e('0x1'));var db=require(_0x055e('0x2'))['db'];var config=require(_0x055e('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x055e('0x4'));var amiClient=jayson[_0x055e('0x5')][_0x055e('0x6')]({'port':0x232a});var logger=require(_0x055e('0x7'))(_0x055e('0x8'));var Redis=require(_0x055e('0x9'));config['redis']=_['defaults'](config[_0x055e('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x055e('0xb'))(new Redis(config[_0x055e('0xa')]));var Schema=require(_0x055e('0xc'));var originateValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'callNumber':{'type':'string','required':[!![],_0x055e('0xf')]},'callerId':{'type':_0x055e('0x10')},'callbackUrl':{'type':_0x055e('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x055e('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x11')]},'transferNumber':{'type':_0x055e('0x10'),'required':[!![],_0x055e('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]},'sessionId':{'type':_0x055e('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x055e('0xd'),'required':[!![],_0x055e('0xe')]}});function emit(_0x111cdb,_0x599533,_0x3f2d0e){logger[_0x055e('0x13')](_0x111cdb,_0x599533,JSON[_0x055e('0x14')](_0x3f2d0e));io['to'](_0x111cdb)[_0x055e('0x15')](_0x599533,_0x3f2d0e);}function handleError(_0x2cc84e){return function(_0x4c85dd){console[_0x055e('0x16')](_0x055e('0x17'),_0x4c85dd,_0x4c85dd instanceof RangeError);logger[_0x055e('0x18')](_0x4c85dd[_0x055e('0x19')]);if(_0x4c85dd instanceof RangeError){if(_0x4c85dd['name']){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x194)['send'](_0x4c85dd);}else{if(_0x4c85dd[_0x055e('0x1a')]){delete _0x4c85dd[_0x055e('0x1a')];}_0x2cc84e[_0x055e('0x1b')](0x1f4)[_0x055e('0x1c')](_0x4c85dd);}};}function checkError(){return function(_0x4280cf){if(!_0x4280cf){throw new RangeError(_0x055e('0x1d'));}return _0x4280cf;};}function respondWithRpcPromise(_0x53b766,_0x31c355){return new BPromise(function(_0x2f0346,_0x211594){var _0x5930ff=amiClient;return _0x5930ff[_0x055e('0x1e')](_0x53b766,_0x31c355)[_0x055e('0x1f')](function(_0x32c64e){if(_0x32c64e[_0x055e('0x18')]){if(_0x32c64e['error'][_0x055e('0x20')]===0x1f4){return _0x211594(_0x32c64e['error'][_0x055e('0x21')]);}return _0x2f0346(_0x32c64e[_0x055e('0x18')][_0x055e('0x21')]);}else{_0x2f0346(_0x32c64e[_0x055e('0x22')]);}})[_0x055e('0x23')](function(_0x4c653c){_0x211594(_0x4c653c);});});}function getAgent(_0x58caf9){return db[_0x055e('0x24')][_0x055e('0x25')]({'where':{'id':_0x58caf9,'role':_0x055e('0x26')}})['then'](checkError());}function getAgentCheckSession(_0x408e38,_0x29078a){return new BPromise(function(_0x42f2df,_0x2ef064){var _0x59539d=respondWithRpcPromise(_0x055e('0x27'));var _0x5958ef=getAgent(_0x408e38);Promise[_0x055e('0x28')]([_0x59539d,_0x5958ef])[_0x055e('0x1f')](function(_0x23a506){var _0x7822db=_0x23a506[0x0];var _0x1610f1=_0x23a506[0x1];var _0x5c0e76=_[_0x055e('0x29')](_0x7822db[_0x055e('0x2a')],function(_0x293062){return _0x293062[_0x055e('0x2b')]==_0x1610f1['id']&&_0x293062[_0x055e('0x2c')]==_0x29078a;});if(_0x5c0e76[_0x055e('0x2d')]==0x1){_0x42f2df(_0x1610f1);}else{_0x2ef064(new RangeError(_0x055e('0x2e')+_0x29078a+_0x055e('0x2f')));}});});}exports['originate']=function(_0x26d1c2,_0x43ec84){logger['info'](_0x055e('0x30'),_0x26d1c2[_0x055e('0x31')]);var _0x524344=originateValidation[_0x055e('0xc')](_0x26d1c2[_0x055e('0x31')]);if(_0x524344[_0x055e('0x2d')]>0x0){return _0x43ec84['status'](0x190)['json'](_0x524344);}var _0x25d19d=_0x26d1c2['body']['userId'];var _0x55a1ee=_0x26d1c2[_0x055e('0x31')][_0x055e('0x32')];var _0x35c6cf=_0x26d1c2[_0x055e('0x31')][_0x055e('0x33')];var _0x16a4fa=_0x26d1c2[_0x055e('0x31')][_0x055e('0x34')];return getAgent(_0x25d19d)[_0x055e('0x1f')](function(_0x2f60fa){logger[_0x055e('0x13')](_0x055e('0x35'),_0x2f60fa['name']);emit(util['format'](_0x055e('0x36'),_0x2f60fa[_0x055e('0x1a')]),_0x055e('0x37'),{'callNumber':_0x55a1ee,'callerId':_0x35c6cf,'callbackUrl':_0x16a4fa});return _0x43ec84[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x39')});})[_0x055e('0x23')](handleError(_0x43ec84));};exports['hangup']=function(_0x18b88e,_0x265fed){logger[_0x055e('0x13')](_0x055e('0x3a'),_0x18b88e[_0x055e('0x31')]);var _0x585b8a=hangupValidation[_0x055e('0xc')](_0x18b88e[_0x055e('0x31')]);if(_0x585b8a['length']>0x0){return _0x265fed[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x585b8a);}var _0x4a97ab=_0x18b88e[_0x055e('0x31')][_0x055e('0x3b')];var _0x4e424b=_0x18b88e[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x4a97ab)['then'](function(_0x1012a4){logger[_0x055e('0x13')](_0x055e('0x35'),_0x1012a4['name']);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x1012a4['name']),_0x055e('0x3d'),{'sessionId':_0x4e424b});return _0x265fed[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':'hangup\x20executed!'});})[_0x055e('0x23')](handleError(_0x265fed));};exports[_0x055e('0x3e')]=function(_0x176a2d,_0x4fa534){logger['info'](_0x055e('0x3f'),_0x176a2d[_0x055e('0x31')]);var _0x4ff19e=answerValidation[_0x055e('0xc')](_0x176a2d['body']);if(_0x4ff19e[_0x055e('0x2d')]>0x0){return _0x4fa534['status'](0x190)[_0x055e('0x38')](_0x4ff19e);}var _0x31c57a=_0x176a2d[_0x055e('0x31')]['userId'];var _0x57483c=_0x176a2d[_0x055e('0x31')][_0x055e('0x2c')];return getAgent(_0x31c57a)[_0x055e('0x1f')](function(_0x445d74){logger['info']('entityFound:',_0x445d74[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x445d74[_0x055e('0x1a')]),_0x055e('0x40'),{'sessionId':_0x57483c});return _0x4fa534[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x41')});})[_0x055e('0x23')](handleError(_0x4fa534));};exports['hold']=function(_0x297edd,_0x118a0e){logger['info'](_0x055e('0x42'),_0x297edd[_0x055e('0x31')]);var _0x341c46=holdValidation[_0x055e('0xc')](_0x297edd[_0x055e('0x31')]);if(_0x341c46[_0x055e('0x2d')]>0x0){return _0x118a0e[_0x055e('0x1b')](0x190)['json'](_0x341c46);}var _0x35b2c6=_0x297edd['body'][_0x055e('0x3b')];var _0xed7611=_0x297edd[_0x055e('0x31')]['sessionId'];return getAgent(_0x35b2c6)['then'](function(_0x45845e){logger[_0x055e('0x13')](_0x055e('0x35'),_0x45845e[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x45845e[_0x055e('0x1a')]),_0x055e('0x43'),{'sessionId':_0xed7611});return _0x118a0e[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x44')});})[_0x055e('0x23')](handleError(_0x118a0e));};exports[_0x055e('0x45')]=function(_0x17695b,_0x335415){logger['info'](_0x055e('0x46'),_0x17695b[_0x055e('0x31')]);var _0x3e7fa6=unholdValidation['validate'](_0x17695b[_0x055e('0x31')]);if(_0x3e7fa6['length']>0x0){return _0x335415[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3e7fa6);}var _0x49129a=_0x17695b[_0x055e('0x31')][_0x055e('0x3b')];var _0x3e6329=_0x17695b['body']['sessionId'];return getAgent(_0x49129a)[_0x055e('0x1f')](function(_0x413778){logger[_0x055e('0x13')](_0x055e('0x35'),_0x413778[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x413778[_0x055e('0x1a')]),_0x055e('0x47'),{'sessionId':_0x3e6329});return _0x335415[_0x055e('0x1b')](0xc8)['json']({'error':![],'message':_0x055e('0x48')});})[_0x055e('0x23')](handleError(_0x335415));};exports[_0x055e('0x49')]=function(_0x200b53,_0x57a9e4){logger[_0x055e('0x13')](_0x055e('0x4a'),_0x57a9e4[_0x055e('0x31')]);var _0x3eb1a1=callsValidation['validate'](_0x200b53['body']);if(_0x3eb1a1[_0x055e('0x2d')]>0x0){return _0x57a9e4[_0x055e('0x1b')](0x190)[_0x055e('0x38')](_0x3eb1a1);}var _0x2fbb1c=_0x200b53[_0x055e('0x31')][_0x055e('0x3b')];var _0x3876d0=respondWithRpcPromise(_0x055e('0x27'));var _0x56db9c=getAgent(_0x2fbb1c);return Promise['all']([_0x3876d0,_0x56db9c])[_0x055e('0x1f')](function(_0x33592d){var _0x5240d5=_0x33592d[0x0];var _0x143e8c=_0x33592d[0x1];var _0x16dd1e=_[_0x055e('0x29')](_0x5240d5[_0x055e('0x2a')],function(_0x50aa1f){return _0x50aa1f[_0x055e('0x2b')]==_0x143e8c['id'];});return _0x57a9e4[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'count':_0x16dd1e[_0x055e('0x2d')],'rows':_0x16dd1e});})[_0x055e('0x23')](handleError(_0x57a9e4));};exports[_0x055e('0x4b')]=function(_0x2075db,_0x31935b){logger['info'](_0x055e('0x4c'),_0x2075db[_0x055e('0x31')]);var _0x5bd8f0=conferenceValidation[_0x055e('0xc')](_0x2075db[_0x055e('0x31')]);if(_0x5bd8f0[_0x055e('0x2d')]>0x0){return _0x31935b[_0x055e('0x1b')](0x190)['json'](_0x5bd8f0);}var _0x8b7e45=_0x2075db[_0x055e('0x31')][_0x055e('0x3b')];return getAgent(_0x8b7e45)['then'](function(_0x329d46){logger[_0x055e('0x13')](_0x055e('0x35'),_0x329d46[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')]('user:%s',_0x329d46[_0x055e('0x1a')]),_0x055e('0x4d'));return _0x31935b[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x4e')});})['catch'](handleError(_0x31935b));};exports[_0x055e('0x4f')]=function(_0x34c805,_0x107b88){logger['info'](_0x055e('0x50'),_0x34c805[_0x055e('0x31')]);var _0x3ecc65=transferValidation[_0x055e('0xc')](_0x34c805[_0x055e('0x31')]);if(_0x3ecc65['length']>0x0){return _0x107b88[_0x055e('0x1b')](0x190)['json'](_0x3ecc65);}var _0x24ac0c=_0x34c805[_0x055e('0x31')]['userId'];var _0x3137bb=_0x34c805[_0x055e('0x31')][_0x055e('0x2c')];var _0x2bdf06=_0x34c805['body']['transferNumber'];return getAgent(_0x24ac0c)[_0x055e('0x1f')](function(_0x5e4f42){logger[_0x055e('0x13')](_0x055e('0x35'),_0x5e4f42[_0x055e('0x1a')]);emit(util[_0x055e('0x3c')](_0x055e('0x36'),_0x5e4f42[_0x055e('0x1a')]),_0x055e('0x51'),{'sessionId':_0x3137bb,'transferNumber':_0x2bdf06});return _0x107b88[_0x055e('0x1b')](0xc8)[_0x055e('0x38')]({'error':![],'message':_0x055e('0x52')});})['catch'](handleError(_0x107b88));}; \ No newline at end of file +var _0xfe57=['VoiceChannels','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','number','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','catch','User','findOne','agent','filter','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','entityFound:','format','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls'];(function(_0x4de6e0,_0x4a093d){var _0x5f101e=function(_0x165325){while(--_0x165325){_0x4de6e0['push'](_0x4de6e0['shift']());}};_0x5f101e(++_0x4a093d);}(_0xfe57,0x195));var _0x7fe5=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0xfe57[_0x175e89];return _0x2ed996;};'use strict';var path=require(_0x7fe5('0x0'));var fs=require('fs');var _=require(_0x7fe5('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x7fe5('0x2'));var BPromise=require(_0x7fe5('0x3'));var jayson=require(_0x7fe5('0x4'));var amiClient=jayson[_0x7fe5('0x5')][_0x7fe5('0x6')]({'port':0x232a});var logger=require(_0x7fe5('0x7'))(_0x7fe5('0x8'));var Redis=require(_0x7fe5('0x9'));config[_0x7fe5('0xa')]=_[_0x7fe5('0xb')](config[_0x7fe5('0xa')],{'host':_0x7fe5('0xc'),'port':0x18eb});var io=require(_0x7fe5('0xd'))(new Redis(config['redis']));var Schema=require(_0x7fe5('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7fe5('0xf')]},'callNumber':{'type':_0x7fe5('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x7fe5('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0x7fe5('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7fe5('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7fe5('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7fe5('0x11'),'required':[!![],_0x7fe5('0xf')]},'sessionId':{'type':_0x7fe5('0x10'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x7fe5('0x10'),'required':[!![],_0x7fe5('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7fe5('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7fe5('0x11'),'required':[!![],_0x7fe5('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7fe5('0x11'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x7fe5('0x11'),'required':[!![],_0x7fe5('0xf')]}});function emit(_0xbdf0a4,_0x4989a,_0x3f699b){logger[_0x7fe5('0x13')](_0xbdf0a4,_0x4989a,JSON['stringify'](_0x3f699b));io['to'](_0xbdf0a4)[_0x7fe5('0x14')](_0x4989a,_0x3f699b);}function handleError(_0x3c7dd3){return function(_0x340d5e){console[_0x7fe5('0x15')](_0x7fe5('0x16'),_0x340d5e,_0x340d5e instanceof RangeError);logger[_0x7fe5('0x17')](_0x340d5e[_0x7fe5('0x18')]);if(_0x340d5e instanceof RangeError){if(_0x340d5e[_0x7fe5('0x19')]){delete _0x340d5e[_0x7fe5('0x19')];}_0x3c7dd3[_0x7fe5('0x1a')](0x194)['send'](_0x340d5e);}else{if(_0x340d5e['name']){delete _0x340d5e[_0x7fe5('0x19')];}_0x3c7dd3[_0x7fe5('0x1a')](0x1f4)[_0x7fe5('0x1b')](_0x340d5e);}};}function checkError(){return function(_0x327301){if(!_0x327301){throw new RangeError(_0x7fe5('0x1c'));}return _0x327301;};}function respondWithRpcPromise(_0x39c3ba,_0x24efbb){return new BPromise(function(_0xdd9df7,_0x1b271c){var _0x28a7fd=amiClient;return _0x28a7fd[_0x7fe5('0x1d')](_0x39c3ba,_0x24efbb)[_0x7fe5('0x1e')](function(_0x54ee98){if(_0x54ee98[_0x7fe5('0x17')]){if(_0x54ee98[_0x7fe5('0x17')][_0x7fe5('0x1f')]===0x1f4){return _0x1b271c(_0x54ee98['error'][_0x7fe5('0x20')]);}return _0xdd9df7(_0x54ee98['error'][_0x7fe5('0x20')]);}else{_0xdd9df7(_0x54ee98['result']);}})[_0x7fe5('0x21')](function(_0x190355){_0x1b271c(_0x190355);});});}function getAgent(_0x134876){return db[_0x7fe5('0x22')][_0x7fe5('0x23')]({'where':{'id':_0x134876,'role':_0x7fe5('0x24')}})['then'](checkError());}function getAgentCheckSession(_0x5f2d25,_0x417a56){return new BPromise(function(_0x450759,_0x27b66d){var _0x13c96b=respondWithRpcPromise('VoiceChannels');var _0x46f816=getAgent(_0x5f2d25);Promise['all']([_0x13c96b,_0x46f816])[_0x7fe5('0x1e')](function(_0x1420de){var _0x204bc8=_0x1420de[0x0];var _0x28a689=_0x1420de[0x1];var _0x1f8572=_[_0x7fe5('0x25')](_0x204bc8['rows'],function(_0xe521c6){return _0xe521c6[_0x7fe5('0x26')]==_0x28a689['id']&&_0xe521c6['sessionId']==_0x417a56;});if(_0x1f8572[_0x7fe5('0x27')]==0x1){_0x450759(_0x28a689);}else{_0x27b66d(new RangeError(_0x7fe5('0x28')+_0x417a56+_0x7fe5('0x29')));}});});}exports[_0x7fe5('0x2a')]=function(_0x465e46,_0x53ef16){logger['info'](_0x7fe5('0x2b'),_0x465e46[_0x7fe5('0x2c')]);var _0x3dbb62=originateValidation[_0x7fe5('0xe')](_0x465e46['body']);if(_0x3dbb62[_0x7fe5('0x27')]>0x0){return _0x53ef16[_0x7fe5('0x1a')](0x190)[_0x7fe5('0x2d')](_0x3dbb62);}var _0x4227b7=_0x465e46[_0x7fe5('0x2c')][_0x7fe5('0x2e')];var _0x4ecbba=_0x465e46[_0x7fe5('0x2c')][_0x7fe5('0x2f')];var _0x2c8225=_0x465e46[_0x7fe5('0x2c')]['callerId'];var _0x5617c2=_0x465e46[_0x7fe5('0x2c')]['callbackUrl'];return getAgent(_0x4227b7)[_0x7fe5('0x1e')](function(_0x513680){logger[_0x7fe5('0x13')]('entityFound:',_0x513680['name']);emit(util['format']('user:%s',_0x513680[_0x7fe5('0x19')]),_0x7fe5('0x30'),{'callNumber':_0x4ecbba,'callerId':_0x2c8225,'callbackUrl':_0x5617c2});return _0x53ef16['status'](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':_0x7fe5('0x31')});})['catch'](handleError(_0x53ef16));};exports[_0x7fe5('0x32')]=function(_0x4a641d,_0x4aeed2){logger[_0x7fe5('0x13')](_0x7fe5('0x33'),_0x4a641d[_0x7fe5('0x2c')]);var _0x2ff773=hangupValidation[_0x7fe5('0xe')](_0x4a641d['body']);if(_0x2ff773[_0x7fe5('0x27')]>0x0){return _0x4aeed2[_0x7fe5('0x1a')](0x190)['json'](_0x2ff773);}var _0x1fa05a=_0x4a641d[_0x7fe5('0x2c')][_0x7fe5('0x2e')];var _0xf75042=_0x4a641d[_0x7fe5('0x2c')][_0x7fe5('0x34')];return getAgent(_0x1fa05a)[_0x7fe5('0x1e')](function(_0x50cfa5){logger['info'](_0x7fe5('0x35'),_0x50cfa5['name']);emit(util[_0x7fe5('0x36')](_0x7fe5('0x37'),_0x50cfa5['name']),_0x7fe5('0x38'),{'sessionId':_0xf75042});return _0x4aeed2[_0x7fe5('0x1a')](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':_0x7fe5('0x39')});})[_0x7fe5('0x21')](handleError(_0x4aeed2));};exports[_0x7fe5('0x3a')]=function(_0x1cd6d3,_0x4ee6cc){logger['info'](_0x7fe5('0x3b'),_0x1cd6d3['body']);var _0xad0b05=answerValidation[_0x7fe5('0xe')](_0x1cd6d3[_0x7fe5('0x2c')]);if(_0xad0b05[_0x7fe5('0x27')]>0x0){return _0x4ee6cc['status'](0x190)[_0x7fe5('0x2d')](_0xad0b05);}var _0x5439bc=_0x1cd6d3['body'][_0x7fe5('0x2e')];var _0x585f27=_0x1cd6d3['body'][_0x7fe5('0x34')];return getAgent(_0x5439bc)[_0x7fe5('0x1e')](function(_0x46826f){logger[_0x7fe5('0x13')](_0x7fe5('0x35'),_0x46826f['name']);emit(util[_0x7fe5('0x36')](_0x7fe5('0x37'),_0x46826f['name']),_0x7fe5('0x3c'),{'sessionId':_0x585f27});return _0x4ee6cc[_0x7fe5('0x1a')](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':_0x7fe5('0x3d')});})['catch'](handleError(_0x4ee6cc));};exports[_0x7fe5('0x3e')]=function(_0x13225e,_0x7355ac){logger['info'](_0x7fe5('0x3f'),_0x13225e[_0x7fe5('0x2c')]);var _0x3efc98=holdValidation['validate'](_0x13225e[_0x7fe5('0x2c')]);if(_0x3efc98[_0x7fe5('0x27')]>0x0){return _0x7355ac[_0x7fe5('0x1a')](0x190)['json'](_0x3efc98);}var _0x19c4a6=_0x13225e[_0x7fe5('0x2c')][_0x7fe5('0x2e')];var _0x4610b6=_0x13225e[_0x7fe5('0x2c')][_0x7fe5('0x34')];return getAgent(_0x19c4a6)[_0x7fe5('0x1e')](function(_0x447b57){logger[_0x7fe5('0x13')](_0x7fe5('0x35'),_0x447b57[_0x7fe5('0x19')]);emit(util['format']('user:%s',_0x447b57['name']),'webbar:hold',{'sessionId':_0x4610b6});return _0x7355ac[_0x7fe5('0x1a')](0xc8)['json']({'error':![],'message':_0x7fe5('0x40')});})[_0x7fe5('0x21')](handleError(_0x7355ac));};exports[_0x7fe5('0x41')]=function(_0x1d9ca8,_0x362f33){logger['info'](_0x7fe5('0x42'),_0x1d9ca8[_0x7fe5('0x2c')]);var _0x1bd234=unholdValidation[_0x7fe5('0xe')](_0x1d9ca8[_0x7fe5('0x2c')]);if(_0x1bd234[_0x7fe5('0x27')]>0x0){return _0x362f33[_0x7fe5('0x1a')](0x190)[_0x7fe5('0x2d')](_0x1bd234);}var _0x2df3b0=_0x1d9ca8[_0x7fe5('0x2c')]['userId'];var _0x1c16d4=_0x1d9ca8[_0x7fe5('0x2c')][_0x7fe5('0x34')];return getAgent(_0x2df3b0)[_0x7fe5('0x1e')](function(_0x18b041){logger[_0x7fe5('0x13')]('entityFound:',_0x18b041[_0x7fe5('0x19')]);emit(util[_0x7fe5('0x36')](_0x7fe5('0x37'),_0x18b041[_0x7fe5('0x19')]),_0x7fe5('0x43'),{'sessionId':_0x1c16d4});return _0x362f33[_0x7fe5('0x1a')](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0x7fe5('0x21')](handleError(_0x362f33));};exports[_0x7fe5('0x44')]=function(_0x11d474,_0x637c0a){logger[_0x7fe5('0x13')]('calls\x20fired:',_0x637c0a[_0x7fe5('0x2c')]);var _0x34a430=callsValidation[_0x7fe5('0xe')](_0x11d474[_0x7fe5('0x2c')]);if(_0x34a430['length']>0x0){return _0x637c0a[_0x7fe5('0x1a')](0x190)[_0x7fe5('0x2d')](_0x34a430);}var _0x13b865=_0x11d474[_0x7fe5('0x2c')][_0x7fe5('0x2e')];var _0x25e583=respondWithRpcPromise(_0x7fe5('0x45'));var _0x26607a=getAgent(_0x13b865);return Promise[_0x7fe5('0x46')]([_0x25e583,_0x26607a])[_0x7fe5('0x1e')](function(_0xe5b5cf){var _0x59bd7c=_0xe5b5cf[0x0];var _0x44015c=_0xe5b5cf[0x1];var _0x1ce47c=_[_0x7fe5('0x25')](_0x59bd7c['rows'],function(_0x53e554){return _0x53e554[_0x7fe5('0x26')]==_0x44015c['id'];});return _0x637c0a['status'](0xc8)[_0x7fe5('0x2d')]({'count':_0x1ce47c[_0x7fe5('0x27')],'rows':_0x1ce47c});})['catch'](handleError(_0x637c0a));};exports[_0x7fe5('0x47')]=function(_0x47c811,_0x1fd083){logger[_0x7fe5('0x13')](_0x7fe5('0x48'),_0x47c811[_0x7fe5('0x2c')]);var _0x42d7b3=conferenceValidation[_0x7fe5('0xe')](_0x47c811['body']);if(_0x42d7b3['length']>0x0){return _0x1fd083[_0x7fe5('0x1a')](0x190)[_0x7fe5('0x2d')](_0x42d7b3);}var _0x42f66a=_0x47c811[_0x7fe5('0x2c')][_0x7fe5('0x2e')];return getAgent(_0x42f66a)['then'](function(_0x1eb46e){logger[_0x7fe5('0x13')](_0x7fe5('0x35'),_0x1eb46e[_0x7fe5('0x19')]);emit(util[_0x7fe5('0x36')]('user:%s',_0x1eb46e[_0x7fe5('0x19')]),_0x7fe5('0x49'));return _0x1fd083[_0x7fe5('0x1a')](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':_0x7fe5('0x4a')});})[_0x7fe5('0x21')](handleError(_0x1fd083));};exports[_0x7fe5('0x4b')]=function(_0x512252,_0x343057){logger[_0x7fe5('0x13')](_0x7fe5('0x4c'),_0x512252[_0x7fe5('0x2c')]);var _0x87af50=transferValidation[_0x7fe5('0xe')](_0x512252[_0x7fe5('0x2c')]);if(_0x87af50['length']>0x0){return _0x343057['status'](0x190)[_0x7fe5('0x2d')](_0x87af50);}var _0x4c3ee6=_0x512252[_0x7fe5('0x2c')]['userId'];var _0x3bb81b=_0x512252[_0x7fe5('0x2c')][_0x7fe5('0x34')];var _0x31eb57=_0x512252[_0x7fe5('0x2c')][_0x7fe5('0x4d')];return getAgent(_0x4c3ee6)[_0x7fe5('0x1e')](function(_0x411c3c){logger['info'](_0x7fe5('0x35'),_0x411c3c['name']);emit(util[_0x7fe5('0x36')](_0x7fe5('0x37'),_0x411c3c[_0x7fe5('0x19')]),'webbar:transfer',{'sessionId':_0x3bb81b,'transferNumber':_0x31eb57});return _0x343057[_0x7fe5('0x1a')](0xc8)[_0x7fe5('0x2d')]({'error':![],'message':_0x7fe5('0x4e')});})[_0x7fe5('0x21')](handleError(_0x343057));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f3e6f3e..87a9252 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 _0x0295=['addDisposition','/:id/canned_answers','addAnswer','/:id/users','addAgents','/:id/applications','addApplications','/:id/notify','notify','put','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','getDispositions','getAnswers','getAgents','post','create','/:id/dispositions'];(function(_0xebb999,_0x10a551){var _0x1882ea=function(_0x564642){while(--_0x564642){_0xebb999['push'](_0xebb999['shift']());}};_0x1882ea(++_0x10a551);}(_0x0295,0x1f0));var _0x5029=function(_0x32986,_0x4489c8){_0x32986=_0x32986-0x0;var _0x355ebb=_0x0295[_0x32986];return _0x355ebb;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0x7')]('/:id/dispositions',auth[_0x5029('0x8')](),controller[_0x5029('0xa')]);router[_0x5029('0x7')]('/:id/canned_answers',auth[_0x5029('0x8')](),controller[_0x5029('0xb')]);router[_0x5029('0x7')]('/:id/users',auth[_0x5029('0x8')](),controller[_0x5029('0xc')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x5029('0xd')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0xe')]);router[_0x5029('0xd')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x10')]);router[_0x5029('0xd')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x12')]);router[_0x5029('0xd')](_0x5029('0x13'),auth[_0x5029('0x8')](),controller[_0x5029('0x14')]);router['post'](_0x5029('0x15'),auth[_0x5029('0x8')](),controller[_0x5029('0x16')]);router[_0x5029('0xd')](_0x5029('0x17'),controller[_0x5029('0x18')]);router[_0x5029('0xd')]('/:id/send',auth[_0x5029('0x8')](),controller['send']);router[_0x5029('0x19')](_0x5029('0x1a'),auth[_0x5029('0x8')](),controller[_0x5029('0x1b')]);router['delete']('/:id',auth[_0x5029('0x8')](),controller['destroy']);router[_0x5029('0x1c')](_0x5029('0xf'),auth[_0x5029('0x8')](),controller[_0x5029('0x1d')]);router[_0x5029('0x1c')](_0x5029('0x11'),auth[_0x5029('0x8')](),controller[_0x5029('0x1e')]);router[_0x5029('0x1c')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x5029('0x1f')]=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','/:id/dispositions','getDispositions','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAgents','addApplications','notify','send','put','update','delete','destroy','removeAnswers','exports'];(function(_0x5381c5,_0x365d95){var _0x3c5257=function(_0x8f17e5){while(--_0x8f17e5){_0x5381c5['push'](_0x5381c5['shift']());}};_0x3c5257(++_0x365d95);}(_0x5f66,0x1a0));var _0x65f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f66[_0x20a584];return _0x4b41a8;};'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('./whatsappAccount.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['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/canned_answers',auth[_0x65f6('0x8')](),controller['getAnswers']);router['get'](_0x65f6('0xe'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);router['get'](_0x65f6('0x10'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);router[_0x65f6('0x12')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0x13')]);router[_0x65f6('0x12')](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x14')]);router['post'](_0x65f6('0x15'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x65f6('0x12')](_0x65f6('0xe'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x16')]);router[_0x65f6('0x12')](_0x65f6('0x10'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x17')]);router['post']('/:id/notify',controller[_0x65f6('0x18')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x65f6('0x19')]);router[_0x65f6('0x1a')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0x1b')]);router[_0x65f6('0x1c')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1d')]);router['delete'](_0x65f6('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x65f6('0x1c')](_0x65f6('0x15'),auth['isAuthenticated'](),controller[_0x65f6('0x1e')]);router[_0x65f6('0x1c')](_0x65f6('0xe'),auth[_0x65f6('0x8')](),controller['removeAgents']);module[_0x65f6('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 62691df..62ec023 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 _0x8eed=['STRING','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name'];(function(_0x19705e,_0x459dfc){var _0x241dd7=function(_0x3b2333){while(--_0x3b2333){_0x19705e['push'](_0x19705e['shift']());}};_0x241dd7(++_0x459dfc);}(_0x8eed,0x10b));var _0xd8ee=function(_0xb7b39c,_0x41e5d7){_0xb7b39c=_0xb7b39c-0x0;var _0x31e8a5=_0x8eed[_0xb7b39c];return _0x31e8a5;};'use strict';var Sequelize=require(_0xd8ee('0x0'));var rs=require('randomstring');module[_0xd8ee('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd8ee('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd8ee('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd8ee('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd8ee('0x4')]();}},'phone':{'type':Sequelize[_0xd8ee('0x3')]},'type':{'type':Sequelize[_0xd8ee('0x5')]('twilio',_0xd8ee('0x6'))},'accountSid':{'type':Sequelize[_0xd8ee('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd8ee('0x7')],'defaultValue':function(){return _0xd8ee('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd8ee('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd8ee('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd8ee('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd8ee('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd8ee('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8ee('0xa')],'comment':_0xd8ee('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1ba161){if(!_0x1ba161){this[_0xd8ee('0xc')](_0xd8ee('0xd'),null);}this['setDataValue'](_0xd8ee('0xe'),_0x1ba161);}},'description':{'type':Sequelize[_0xd8ee('0x3')]}}; \ No newline at end of file +var _0x452a=['twilio','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM'];(function(_0x31df6f,_0x380e73){var _0x31e353=function(_0x3a434b){while(--_0x3a434b){_0x31df6f['push'](_0x31df6f['shift']());}};_0x31e353(++_0x380e73);}(_0x452a,0x104));var _0xa452=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x452a[_0x8cb2f9];return _0x164887;};'use strict';var Sequelize=require(_0xa452('0x0'));var rs=require(_0xa452('0x1'));module[_0xa452('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xa452('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa452('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa452('0x3')],'defaultValue':function(){return rs[_0xa452('0x4')]();}},'phone':{'type':Sequelize[_0xa452('0x3')]},'type':{'type':Sequelize[_0xa452('0x5')](_0xa452('0x6'),_0xa452('0x7'))},'accountSid':{'type':Sequelize[_0xa452('0x3')]},'baseUrl':{'type':Sequelize[_0xa452('0x3')]},'authToken':{'type':Sequelize[_0xa452('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa452('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa452('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xa452('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa452('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa452('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa452('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa452('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa452('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa452('0xb'),'set':function(_0x815c03){if(!_0x815c03){this['setDataValue'](_0xa452('0xc'),null);}this['setDataValue'](_0xa452('0xd'),_0x815c03);}},'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 379c797..06200c1 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 _0xd628=['WhatsappAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','pick','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','MessageSid','notifications','messageId','message_id','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','omit','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','ContactId','AttachmentId','UserId','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','DESC','List','Messages','dataValues','eml-format','rimraf','request-promise','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0xd628,0x14a));var _0x8d62=function(_0xdc2833,_0x4b4055){_0xdc2833=_0xdc2833-0x0;var _0x409a30=_0xd628[_0xdc2833];return _0x409a30;};'use strict';var emlformat=require(_0x8d62('0x0'));var rimraf=require(_0x8d62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8d62('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8d62('0x3'));var util=require(_0x8d62('0x4'));var path=require(_0x8d62('0x5'));var sox=require('sox');var csv=require(_0x8d62('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d62('0x7'));var crypto=require('crypto');var jsforce=require(_0x8d62('0x8'));var deskjs=require(_0x8d62('0x9'));var toCsv=require(_0x8d62('0x6'));var querystring=require(_0x8d62('0xa'));var Papa=require(_0x8d62('0xb'));var Redis=require('ioredis');var authService=require(_0x8d62('0xc'));var qs=require(_0x8d62('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d62('0xe'));var logger=require('../../config/logger')(_0x8d62('0xf'));var utils=require(_0x8d62('0x10'));var config=require(_0x8d62('0x11'));var licenseUtil=require(_0x8d62('0x12'));var db=require(_0x8d62('0x13'))['db'];config['redis']=_[_0x8d62('0x14')](config[_0x8d62('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d62('0x16'))(new Redis(config[_0x8d62('0x15')]));require(_0x8d62('0x17'))['register'](socket);var jayson=require(_0x8d62('0x18'));var client=jayson[_0x8d62('0x19')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc9a5a9,_0x4efa44,_0x1535d7,_0x28a1e3){return new BPromise(function(_0x1826f8,_0x52b440){var _0x374a56=_0x28a1e3||client;return _0x374a56['request'](_0xc9a5a9,_0x1535d7)[_0x8d62('0x1a')](function(_0x464fa1){logger[_0x8d62('0x1b')]('WhatsappAccount,\x20%s,\x20%s',_0x4efa44,_0x8d62('0x1c'));logger[_0x8d62('0x1d')](_0x8d62('0x1e'),_0x4efa44,'request\x20sent',JSON['stringify'](_0x464fa1));if(_0x464fa1[_0x8d62('0x1f')]){if(_0x464fa1[_0x8d62('0x1f')][_0x8d62('0x20')]===0x1f4){logger[_0x8d62('0x1f')](_0x8d62('0x21'),_0x4efa44,_0x464fa1[_0x8d62('0x1f')][_0x8d62('0x22')]);return _0x52b440(_0x464fa1['error'][_0x8d62('0x22')]);}logger[_0x8d62('0x1f')](_0x8d62('0x21'),_0x4efa44,_0x464fa1[_0x8d62('0x1f')]['message']);return _0x1826f8(_0x464fa1[_0x8d62('0x1f')]['message']);}else{logger[_0x8d62('0x1b')](_0x8d62('0x21'),_0x4efa44,_0x8d62('0x1c'));_0x1826f8(_0x464fa1[_0x8d62('0x23')][_0x8d62('0x22')]);}})[_0x8d62('0x24')](function(_0x9d4539){logger['error'](_0x8d62('0x21'),_0x4efa44,_0x9d4539);_0x52b440(_0x9d4539);});});}function respondWithStatusCode(_0x227356,_0x2bed8b){_0x2bed8b=_0x2bed8b||0xcc;return function(_0x48475e){if(_0x48475e){return _0x227356[_0x8d62('0x25')](_0x2bed8b);}return _0x227356[_0x8d62('0x26')](_0x2bed8b)[_0x8d62('0x27')]();};}function respondWithResult(_0xbe140b,_0x46a3a2){_0x46a3a2=_0x46a3a2||0xc8;return function(_0x205b4b){if(_0x205b4b){return _0xbe140b[_0x8d62('0x26')](_0x46a3a2)[_0x8d62('0x28')](_0x205b4b);}};}function respondWithFilteredResult(_0x467c3a,_0x4ca7e3){return function(_0x2e1901){if(_0x2e1901){var _0x276609=typeof _0x4ca7e3[_0x8d62('0x29')]===_0x8d62('0x2a')&&typeof _0x4ca7e3[_0x8d62('0x2b')]===_0x8d62('0x2a');var _0x477071=_0x2e1901['count'];var _0x45509f=_0x276609?0x0:_0x4ca7e3[_0x8d62('0x29')];var _0x1cdbee=_0x276609?_0x2e1901[_0x8d62('0x2c')]:_0x4ca7e3[_0x8d62('0x29')]+_0x4ca7e3[_0x8d62('0x2b')];var _0x4ff229;if(_0x1cdbee>=_0x477071){_0x1cdbee=_0x477071;_0x4ff229=0xc8;}else{_0x4ff229=0xce;}_0x467c3a[_0x8d62('0x26')](_0x4ff229);return _0x467c3a['set'](_0x8d62('0x2d'),_0x45509f+'-'+_0x1cdbee+'/'+_0x477071)[_0x8d62('0x28')](_0x2e1901);}return null;};}function patchUpdates(_0x24017d){return function(_0x4e6008){try{jsonpatch[_0x8d62('0x2e')](_0x4e6008,_0x24017d,!![]);}catch(_0x29a8d2){return BPromise[_0x8d62('0x2f')](_0x29a8d2);}return _0x4e6008[_0x8d62('0x30')]();};}function saveUpdates(_0x2c17bd,_0x27540c){return function(_0x3abb07){if(_0x3abb07){return _0x3abb07[_0x8d62('0x31')](_0x2c17bd)[_0x8d62('0x1a')](function(_0x5b4711){return _0x5b4711;});}return null;};}function removeEntity(_0x13dbe1,_0x51a2b8){return function(_0x1017b2){if(_0x1017b2){return _0x1017b2[_0x8d62('0x32')]()['then'](function(){var _0x523e16=_0x1017b2[_0x8d62('0x33')]({'plain':!![]});var _0x537bba='WhatsappAccounts';return db[_0x8d62('0x34')][_0x8d62('0x32')]({'where':{'type':_0x537bba,'resourceId':_0x523e16['id']}})[_0x8d62('0x1a')](function(){return _0x1017b2;});})[_0x8d62('0x1a')](function(){_0x13dbe1[_0x8d62('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e290a,_0x52596c){return function(_0x1998ce){if(!_0x1998ce){_0x3e290a[_0x8d62('0x25')](0x194);}return _0x1998ce;};}function handleError(_0x3f3cd7,_0x331041){_0x331041=_0x331041||0x1f4;return function(_0x5c20ea){logger[_0x8d62('0x1f')](_0x5c20ea[_0x8d62('0x35')]);if(_0x5c20ea['name']){delete _0x5c20ea[_0x8d62('0x36')];}_0x3f3cd7[_0x8d62('0x26')](_0x331041)[_0x8d62('0x37')](_0x5c20ea);};}exports[_0x8d62('0x38')]=function(_0x4cbc05,_0x111d36){var _0xd4522={'include':[{'model':db[_0x8d62('0x39')],'as':_0x8d62('0x3a')}]},_0x39eee0={},_0x83eb0a={'count':0x0,'rows':[]};var _0x2f976d=_[_0x8d62('0x3b')](db[_0x8d62('0x3c')][_0x8d62('0x3d')],function(_0x190be9){return{'name':_0x190be9[_0x8d62('0x3e')],'type':_0x190be9[_0x8d62('0x3f')]['key']};});_0x39eee0[_0x8d62('0x40')]=_[_0x8d62('0x3b')](_0x2f976d,_0x8d62('0x36'));_0x39eee0['query']=_[_0x8d62('0x41')](_0x4cbc05['query']);_0x39eee0[_0x8d62('0x42')]=_[_0x8d62('0x43')](_0x39eee0[_0x8d62('0x40')],_0x39eee0['query']);_0xd4522[_0x8d62('0x44')]=_['intersection'](_0x39eee0['model'],qs[_0x8d62('0x45')](_0x4cbc05['query'][_0x8d62('0x45')]));_0xd4522[_0x8d62('0x44')]=_0xd4522[_0x8d62('0x44')][_0x8d62('0x46')]?_0xd4522[_0x8d62('0x44')]:_0x39eee0['model'];if(!_0x4cbc05[_0x8d62('0x47')][_0x8d62('0x48')](_0x8d62('0x49'))){_0xd4522[_0x8d62('0x2b')]=qs['limit'](_0x4cbc05[_0x8d62('0x47')][_0x8d62('0x2b')]);_0xd4522[_0x8d62('0x29')]=qs['offset'](_0x4cbc05['query'][_0x8d62('0x29')]);}_0xd4522['order']=qs['sort'](_0x4cbc05['query'][_0x8d62('0x4a')]);_0xd4522['where']=qs[_0x8d62('0x42')](_['pick'](_0x4cbc05[_0x8d62('0x47')],_0x39eee0[_0x8d62('0x42')]),_0x2f976d);if(_0x4cbc05[_0x8d62('0x47')][_0x8d62('0x4b')]){_0xd4522[_0x8d62('0x4c')]=_[_0x8d62('0x4d')](_0xd4522[_0x8d62('0x4c')],{'$or':_[_0x8d62('0x3b')](_0x2f976d,function(_0x453842){if(_0x453842[_0x8d62('0x3f')]!=='VIRTUAL'){var _0x53545e={};_0x53545e[_0x453842['name']]={'$like':'%'+_0x4cbc05[_0x8d62('0x47')][_0x8d62('0x4b')]+'%'};return _0x53545e;}})});}_0xd4522=_['merge']({},_0xd4522,_0x4cbc05[_0x8d62('0x4e')]);var _0x304fec={'where':_0xd4522[_0x8d62('0x4c')]};return db[_0x8d62('0x3c')][_0x8d62('0x2c')](_0x304fec)[_0x8d62('0x1a')](function(_0x1d6bca){_0x83eb0a['count']=_0x1d6bca;if(_0x4cbc05[_0x8d62('0x47')][_0x8d62('0x4f')]){_0xd4522[_0x8d62('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x8d62('0x51')](_0xd4522);})[_0x8d62('0x1a')](function(_0x12beb5){_0x83eb0a[_0x8d62('0x52')]=_0x12beb5;return _0x83eb0a;})[_0x8d62('0x1a')](respondWithFilteredResult(_0x111d36,_0xd4522))[_0x8d62('0x24')](handleError(_0x111d36,null));};exports[_0x8d62('0x53')]=function(_0x4a1cce,_0x403284){var _0x302aaa={'raw':![],'where':{'id':_0x4a1cce[_0x8d62('0x54')]['id']},'include':[{'model':db[_0x8d62('0x39')],'as':'mandatoryDispositionPause'}]},_0x2ee4e9={};_0x2ee4e9[_0x8d62('0x40')]=_[_0x8d62('0x41')](db[_0x8d62('0x3c')]['rawAttributes']);_0x2ee4e9['query']=_[_0x8d62('0x41')](_0x4a1cce[_0x8d62('0x47')]);_0x2ee4e9[_0x8d62('0x42')]=_[_0x8d62('0x43')](_0x2ee4e9[_0x8d62('0x40')],_0x2ee4e9[_0x8d62('0x47')]);_0x302aaa['attributes']=_[_0x8d62('0x43')](_0x2ee4e9[_0x8d62('0x40')],qs['fields'](_0x4a1cce[_0x8d62('0x47')][_0x8d62('0x45')]));_0x302aaa[_0x8d62('0x44')]=_0x302aaa[_0x8d62('0x44')][_0x8d62('0x46')]?_0x302aaa[_0x8d62('0x44')]:_0x2ee4e9[_0x8d62('0x40')];if(_0x4a1cce[_0x8d62('0x47')][_0x8d62('0x4f')]){_0x302aaa[_0x8d62('0x50')]=[{'all':!![]}];}_0x302aaa=_['merge']({},_0x302aaa,_0x4a1cce[_0x8d62('0x4e')]);return db[_0x8d62('0x3c')][_0x8d62('0x55')](_0x302aaa)['then'](handleEntityNotFound(_0x403284,null))[_0x8d62('0x1a')](respondWithResult(_0x403284,null))['catch'](handleError(_0x403284,null));};exports[_0x8d62('0x56')]=function(_0x496b41,_0x5aea4a){return db['WhatsappAccount'][_0x8d62('0x56')](_0x496b41[_0x8d62('0x57')],{})[_0x8d62('0x1a')](function(_0x100802){var _0x3446c5=_0x496b41[_0x8d62('0x58')][_0x8d62('0x33')]({'plain':!![]});if(!_0x3446c5)throw new Error(_0x8d62('0x59'));if(_0x3446c5[_0x8d62('0x5a')]==='user'){var _0x390adf=_0x100802[_0x8d62('0x33')]({'plain':!![]});var _0x102b4f=_0x8d62('0x5b');return db[_0x8d62('0x5c')][_0x8d62('0x55')]({'where':{'name':_0x102b4f,'userProfileId':_0x3446c5['userProfileId']},'raw':!![]})['then'](function(_0x1dddc3){if(_0x1dddc3&&_0x1dddc3[_0x8d62('0x5d')]===0x0){return db[_0x8d62('0x34')][_0x8d62('0x56')]({'name':_0x390adf[_0x8d62('0x36')],'resourceId':_0x390adf['id'],'type':_0x1dddc3[_0x8d62('0x36')],'sectionId':_0x1dddc3['id']},{})[_0x8d62('0x1a')](function(){return _0x100802;});}else{return _0x100802;}})[_0x8d62('0x24')](function(_0x1f780f){logger[_0x8d62('0x1f')](_0x8d62('0x5e'),_0x1f780f);throw _0x1f780f;});}return _0x100802;})['then'](respondWithResult(_0x5aea4a,0xc9))[_0x8d62('0x24')](handleError(_0x5aea4a,null));};exports[_0x8d62('0x31')]=function(_0x1c73a1,_0x4398e7){if(_0x1c73a1[_0x8d62('0x57')]['id']){delete _0x1c73a1[_0x8d62('0x57')]['id'];}return db['WhatsappAccount'][_0x8d62('0x55')]({'where':{'id':_0x1c73a1[_0x8d62('0x54')]['id']},'include':[{'model':db[_0x8d62('0x39')],'as':_0x8d62('0x3a')}]})[_0x8d62('0x1a')](handleEntityNotFound(_0x4398e7,null))[_0x8d62('0x1a')](saveUpdates(_0x1c73a1['body'],null))[_0x8d62('0x1a')](respondWithResult(_0x4398e7,null))[_0x8d62('0x24')](handleError(_0x4398e7,null));};exports[_0x8d62('0x32')]=function(_0x4b78b3,_0x231765){return db[_0x8d62('0x3c')][_0x8d62('0x55')]({'where':{'id':_0x4b78b3[_0x8d62('0x54')]['id']}})['then'](handleEntityNotFound(_0x231765,null))[_0x8d62('0x1a')](removeEntity(_0x231765,null))[_0x8d62('0x24')](handleError(_0x231765,null));};exports[_0x8d62('0x5f')]=function(_0x365393,_0x557246){return db[_0x8d62('0x3c')]['describe']()[_0x8d62('0x1a')](respondWithResult(_0x557246,null))[_0x8d62('0x24')](handleError(_0x557246,null));};exports[_0x8d62('0x60')]=function(_0x15c979,_0x4bc596,_0xd4d751){if(_0x15c979[_0x8d62('0x57')]['id']){delete _0x15c979[_0x8d62('0x57')]['id'];}return db['WhatsappAccount'][_0x8d62('0x55')]({'where':{'id':_0x15c979[_0x8d62('0x54')]['id']}})['then'](handleEntityNotFound(_0x4bc596,null))[_0x8d62('0x1a')](function(_0x12782b){if(_0x12782b){_0x15c979['body'][_0x8d62('0x61')]=_0x12782b['id'];return db['Disposition'][_0x8d62('0x56')](_0x15c979[_0x8d62('0x57')]);}})[_0x8d62('0x1a')](respondWithResult(_0x4bc596,null))['catch'](handleError(_0x4bc596,null));};exports[_0x8d62('0x62')]=function(_0x57854d,_0x4b1856,_0x100a91){var _0x359380={'raw':![],'where':{}};var _0xdd28d4={};var _0x3764bc={'count':0x0,'rows':[]};return db[_0x8d62('0x3c')][_0x8d62('0x63')]({'where':{'id':_0x57854d[_0x8d62('0x54')]['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x4b1856,null))[_0x8d62('0x1a')](function(_0x242b80){if(_0x242b80){_0xdd28d4[_0x8d62('0x40')]=_[_0x8d62('0x41')](db['Disposition'][_0x8d62('0x3d')]);_0xdd28d4['query']=_[_0x8d62('0x41')](_0x57854d['query']);_0xdd28d4[_0x8d62('0x42')]=_[_0x8d62('0x43')](_0xdd28d4[_0x8d62('0x40')],_0xdd28d4['query']);_0x359380[_0x8d62('0x44')]=_[_0x8d62('0x43')](_0xdd28d4[_0x8d62('0x40')],qs[_0x8d62('0x45')](_0x57854d[_0x8d62('0x47')]['fields']));_0x359380[_0x8d62('0x44')]=_0x359380[_0x8d62('0x44')][_0x8d62('0x46')]?_0x359380[_0x8d62('0x44')]:_0xdd28d4[_0x8d62('0x40')];if(!_0x57854d[_0x8d62('0x47')][_0x8d62('0x48')](_0x8d62('0x49'))){_0x359380[_0x8d62('0x2b')]=qs[_0x8d62('0x2b')](_0x57854d['query'][_0x8d62('0x2b')]);_0x359380[_0x8d62('0x29')]=qs[_0x8d62('0x29')](_0x57854d['query']['offset']);}_0x359380['order']=qs[_0x8d62('0x4a')](_0x57854d[_0x8d62('0x47')][_0x8d62('0x4a')]);_0x359380[_0x8d62('0x4c')]=qs['filters'](_[_0x8d62('0x64')](_0x57854d[_0x8d62('0x47')],_0xdd28d4[_0x8d62('0x42')]));_0x359380[_0x8d62('0x4c')][_0x8d62('0x61')]=_0x242b80['id'];if(_0x57854d[_0x8d62('0x47')][_0x8d62('0x4b')]){_0x359380[_0x8d62('0x4c')]=_[_0x8d62('0x4d')](_0x359380['where'],{'$or':_[_0x8d62('0x3b')](_0x359380[_0x8d62('0x44')],function(_0x34c518){var _0x59d728={};_0x59d728[_0x34c518]={'$like':'%'+_0x57854d[_0x8d62('0x47')][_0x8d62('0x4b')]+'%'};return _0x59d728;})});}_0x359380=_[_0x8d62('0x4d')]({},_0x359380,_0x57854d['options']);return db[_0x8d62('0x65')][_0x8d62('0x2c')]({'where':_0x359380[_0x8d62('0x4c')]})[_0x8d62('0x1a')](function(_0x5c62d9){_0x3764bc[_0x8d62('0x2c')]=_0x5c62d9;if(_0x57854d['query'][_0x8d62('0x4f')]){_0x359380['include']=[{'all':!![]}];}return db[_0x8d62('0x65')][_0x8d62('0x51')](_0x359380);})['then'](function(_0x20fa4e){_0x3764bc[_0x8d62('0x52')]=_0x20fa4e;return _0x3764bc;});}})[_0x8d62('0x1a')](respondWithFilteredResult(_0x4b1856,_0x359380))[_0x8d62('0x24')](handleError(_0x4b1856,null));};exports['removeDispositions']=function(_0x2f5a06,_0x7e9f6,_0x2b08c8){return db['WhatsappAccount'][_0x8d62('0x55')]({'where':{'id':_0x2f5a06['params']['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x7e9f6,null))[_0x8d62('0x1a')](function(_0x29b200){if(_0x29b200){return _0x29b200[_0x8d62('0x66')](_0x2f5a06[_0x8d62('0x47')][_0x8d62('0x67')]);}})[_0x8d62('0x1a')](respondWithStatusCode(_0x7e9f6,null))['catch'](handleError(_0x7e9f6,null));};exports[_0x8d62('0x68')]=function(_0x2d303a,_0x305f55,_0x33303a){if(_0x2d303a[_0x8d62('0x57')]['id']){delete _0x2d303a['body']['id'];}return db[_0x8d62('0x3c')][_0x8d62('0x55')]({'where':{'id':_0x2d303a[_0x8d62('0x54')]['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x305f55,null))[_0x8d62('0x1a')](function(_0x4d5e38){if(_0x4d5e38){_0x2d303a[_0x8d62('0x57')][_0x8d62('0x61')]=_0x4d5e38['id'];return db[_0x8d62('0x69')][_0x8d62('0x56')](_0x2d303a[_0x8d62('0x57')]);}})[_0x8d62('0x1a')](respondWithResult(_0x305f55,null))[_0x8d62('0x24')](handleError(_0x305f55,null));};exports[_0x8d62('0x6a')]=function(_0x35b3f0,_0x47a7b7,_0x43cc24){var _0x43cf2d={'raw':![],'where':{}};var _0xc20597={};var _0x44fee5={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x35b3f0['params']['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x47a7b7,null))['then'](function(_0x304f23){if(_0x304f23){_0xc20597['model']=_['keys'](db[_0x8d62('0x69')][_0x8d62('0x3d')]);_0xc20597[_0x8d62('0x47')]=_[_0x8d62('0x41')](_0x35b3f0[_0x8d62('0x47')]);_0xc20597[_0x8d62('0x42')]=_[_0x8d62('0x43')](_0xc20597[_0x8d62('0x40')],_0xc20597['query']);_0x43cf2d[_0x8d62('0x44')]=_[_0x8d62('0x43')](_0xc20597[_0x8d62('0x40')],qs[_0x8d62('0x45')](_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x45')]));_0x43cf2d[_0x8d62('0x44')]=_0x43cf2d['attributes']['length']?_0x43cf2d[_0x8d62('0x44')]:_0xc20597[_0x8d62('0x40')];if(!_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x48')](_0x8d62('0x49'))){_0x43cf2d[_0x8d62('0x2b')]=qs[_0x8d62('0x2b')](_0x35b3f0[_0x8d62('0x47')]['limit']);_0x43cf2d['offset']=qs[_0x8d62('0x29')](_0x35b3f0[_0x8d62('0x47')]['offset']);}_0x43cf2d[_0x8d62('0x6b')]=qs[_0x8d62('0x4a')](_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x4a')]);_0x43cf2d['where']=qs['filters'](_[_0x8d62('0x64')](_0x35b3f0[_0x8d62('0x47')],_0xc20597['filters']));_0x43cf2d[_0x8d62('0x4c')][_0x8d62('0x61')]=_0x304f23['id'];if(_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x4b')]){_0x43cf2d[_0x8d62('0x4c')]=_['merge'](_0x43cf2d[_0x8d62('0x4c')],{'$or':_[_0x8d62('0x3b')](_0x43cf2d[_0x8d62('0x44')],function(_0x3485ea){var _0x27d872={};_0x27d872[_0x3485ea]={'$like':'%'+_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x4b')]+'%'};return _0x27d872;})});}_0x43cf2d=_[_0x8d62('0x4d')]({},_0x43cf2d,_0x35b3f0['options']);return db[_0x8d62('0x69')][_0x8d62('0x2c')]({'where':_0x43cf2d['where']})['then'](function(_0x558e52){_0x44fee5[_0x8d62('0x2c')]=_0x558e52;if(_0x35b3f0[_0x8d62('0x47')][_0x8d62('0x4f')]){_0x43cf2d[_0x8d62('0x50')]=[{'all':!![]}];}return db[_0x8d62('0x69')][_0x8d62('0x51')](_0x43cf2d);})['then'](function(_0x27bb96){_0x44fee5['rows']=_0x27bb96;return _0x44fee5;});}})[_0x8d62('0x1a')](respondWithFilteredResult(_0x47a7b7,_0x43cf2d))['catch'](handleError(_0x47a7b7,null));};exports['removeAnswers']=function(_0x590d8c,_0x53ec54,_0x1bba3e){return db[_0x8d62('0x3c')]['find']({'where':{'id':_0x590d8c[_0x8d62('0x54')]['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x53ec54,null))[_0x8d62('0x1a')](function(_0x190d28){if(_0x190d28){return _0x190d28[_0x8d62('0x6c')](_0x590d8c['query']['ids']);}})[_0x8d62('0x1a')](respondWithStatusCode(_0x53ec54,null))['catch'](handleError(_0x53ec54,null));};exports[_0x8d62('0x6d')]=function(_0x3d4fcd,_0x5b9d73,_0xb1c06f){return db[_0x8d62('0x3c')][_0x8d62('0x55')]({'where':{'id':_0x3d4fcd[_0x8d62('0x54')]['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x5b9d73,null))[_0x8d62('0x1a')](function(_0x163968){if(_0x163968){return _0x163968['addAgents'](_0x3d4fcd['body']['ids'],_['omit'](_0x3d4fcd['body'],['ids','id'])||{})[_0x8d62('0x6e')](function(_0x2ced8d){for(var _0x204d87=0x0;_0x204d87<_0x3d4fcd[_0x8d62('0x57')][_0x8d62('0x67')][_0x8d62('0x46')];_0x204d87+=0x1){socket[_0x8d62('0x6f')](_0x8d62('0x70'),{'UserId':Number(_0x3d4fcd[_0x8d62('0x57')][_0x8d62('0x67')][_0x204d87]),'WhatsappAccountId':Number(_0x3d4fcd['params']['id'])});}return _0x2ced8d;});}})[_0x8d62('0x1a')](respondWithResult(_0x5b9d73,null))[_0x8d62('0x24')](handleError(_0x5b9d73,null));};exports['removeAgents']=function(_0x26b268,_0x1e22bb,_0x247354){return db[_0x8d62('0x3c')][_0x8d62('0x55')]({'where':{'id':_0x26b268[_0x8d62('0x54')]['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x1e22bb,null))[_0x8d62('0x1a')](function(_0xddbfd9){if(_0xddbfd9){return _0xddbfd9[_0x8d62('0x71')](_0x26b268[_0x8d62('0x47')]['ids'])[_0x8d62('0x1a')](function(){if(_[_0x8d62('0x72')](_0x26b268[_0x8d62('0x47')][_0x8d62('0x67')])){for(var _0x4c8efa=0x0;_0x4c8efa<_0x26b268['query'][_0x8d62('0x67')]['length'];_0x4c8efa+=0x1){socket[_0x8d62('0x6f')]('userWhatsappAccount:remove',{'UserId':Number(_0x26b268[_0x8d62('0x47')]['ids'][_0x4c8efa]),'WhatsappAccountId':Number(_0x26b268[_0x8d62('0x54')]['id'])});}}else{socket[_0x8d62('0x6f')](_0x8d62('0x73'),{'UserId':Number(_0x26b268[_0x8d62('0x47')][_0x8d62('0x67')]),'WhatsappAccountId':Number(_0x26b268['params']['id'])});}});}})[_0x8d62('0x1a')](respondWithStatusCode(_0x1e22bb,null))[_0x8d62('0x24')](handleError(_0x1e22bb,null));};exports[_0x8d62('0x74')]=function(_0x159393,_0x30e401,_0x3cd3c1){var _0x3eba25={};var _0x1cdd9b={};var _0x390caa;var _0x20518e;return db[_0x8d62('0x3c')][_0x8d62('0x63')]({'where':{'id':_0x159393['params']['id']}})[_0x8d62('0x1a')](handleEntityNotFound(_0x30e401,null))[_0x8d62('0x1a')](function(_0x433887){if(_0x433887){_0x390caa=_0x433887;_0x1cdd9b[_0x8d62('0x40')]=_[_0x8d62('0x41')](db[_0x8d62('0x75')][_0x8d62('0x3d')]);_0x1cdd9b[_0x8d62('0x47')]=_[_0x8d62('0x41')](_0x159393[_0x8d62('0x47')]);_0x1cdd9b['filters']=_['intersection'](_0x1cdd9b[_0x8d62('0x40')],_0x1cdd9b[_0x8d62('0x47')]);_0x3eba25[_0x8d62('0x44')]=_[_0x8d62('0x43')](_0x1cdd9b[_0x8d62('0x40')],qs[_0x8d62('0x45')](_0x159393[_0x8d62('0x47')][_0x8d62('0x45')]));_0x3eba25[_0x8d62('0x44')]=_0x3eba25['attributes']['length']?_0x3eba25[_0x8d62('0x44')]:_0x1cdd9b['model'];_0x3eba25[_0x8d62('0x6b')]=qs[_0x8d62('0x4a')](_0x159393[_0x8d62('0x47')]['sort']);_0x3eba25[_0x8d62('0x4c')]=qs[_0x8d62('0x42')](_[_0x8d62('0x64')](_0x159393[_0x8d62('0x47')],_0x1cdd9b[_0x8d62('0x42')]));if(_0x159393[_0x8d62('0x47')][_0x8d62('0x4b')]){_0x3eba25[_0x8d62('0x4c')]=_[_0x8d62('0x4d')](_0x3eba25[_0x8d62('0x4c')],{'$or':_[_0x8d62('0x3b')](_0x3eba25['attributes'],function(_0x4c2c05){var _0x3e82c9={};_0x3e82c9[_0x4c2c05]={'$like':'%'+_0x159393[_0x8d62('0x47')][_0x8d62('0x4b')]+'%'};return _0x3e82c9;})});}_0x3eba25=_['merge']({},_0x3eba25,_0x159393['options']);return _0x390caa[_0x8d62('0x74')](_0x3eba25);}})['then'](function(_0x5456e7){if(_0x5456e7){_0x20518e=_0x5456e7[_0x8d62('0x46')];if(!_0x159393[_0x8d62('0x47')][_0x8d62('0x48')]('nolimit')){_0x3eba25[_0x8d62('0x2b')]=qs[_0x8d62('0x2b')](_0x159393[_0x8d62('0x47')]['limit']);_0x3eba25['offset']=qs[_0x8d62('0x29')](_0x159393[_0x8d62('0x47')][_0x8d62('0x29')]);}return _0x390caa['getAgents'](_0x3eba25);}})['then'](function(_0x1b2199){if(_0x1b2199){return _0x1b2199?{'count':_0x20518e,'rows':_0x1b2199}:null;}})['then'](respondWithResult(_0x30e401,null))[_0x8d62('0x24')](handleError(_0x30e401,null));};exports[_0x8d62('0x76')]=function(_0x2182b3,_0x571b55){var _0x5d165c=_0x2182b3[_0x8d62('0x54')]['id'];var _0x5760e4=_0x2182b3[_0x8d62('0x57')];var _0x1beabb=0xc8;var _0x50696d=null;return db[_0x8d62('0x77')]['transaction']({'isolationLevel':db[_0x8d62('0x77')][_0x8d62('0x78')][_0x8d62('0x79')][_0x8d62('0x7a')]},function(_0x2ca713){return db['WhatsappAccount']['findOne']({'where':{'id':_0x5d165c},'transaction':_0x2ca713})[_0x8d62('0x1a')](function(_0x4e25fc){if(_0x4e25fc){return db[_0x8d62('0x7b')][_0x8d62('0x32')]({'where':{'WhatsappAccountId':_0x5d165c},'transaction':_0x2ca713})[_0x8d62('0x1a')](function(){var _0x52acad=_[_0x8d62('0x3b')](_0x5760e4,function(_0xcecd18){_0xcecd18[_0x8d62('0x61')]=_0x5d165c;return _0xcecd18;});return db[_0x8d62('0x7b')][_0x8d62('0x7c')](_0x52acad,{'transaction':_0x2ca713});});}else{_0x1beabb=0x194;_0x50696d=[];}});})[_0x8d62('0x1a')](function(){if(_0x1beabb!==0x194){return db[_0x8d62('0x7b')][_0x8d62('0x7d')]({'where':{'WhatsappAccountId':_0x5d165c},'order':_0x8d62('0x7e')})['then'](function(_0x1ece47){_0x50696d=_0x1ece47;});}})['catch'](function(_0x5f1cbb){_0x1beabb=0x1f4;logger[_0x8d62('0x1f')](_0x5f1cbb[_0x8d62('0x35')]);if(_0x5f1cbb[_0x8d62('0x36')]){delete _0x5f1cbb[_0x8d62('0x36')];}_0x50696d=_0x5f1cbb;})['finally'](function(){if(_0x50696d===null){_0x571b55[_0x8d62('0x25')](_0x1beabb);}else{if(_0x1beabb===0x1f4){_0x571b55[_0x8d62('0x26')](_0x1beabb)[_0x8d62('0x37')](_0x50696d);}else{_0x571b55['status'](_0x1beabb)[_0x8d62('0x28')](_0x50696d);}}});};exports[_0x8d62('0x7f')]=function(_0x2ea85,_0x1b23c3,_0x5946fd){var _0x5c1ab0={};var _0x231a7c={};var _0x46082c;var _0x354fa0;return db[_0x8d62('0x3c')][_0x8d62('0x63')]({'where':{'id':_0x2ea85[_0x8d62('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b23c3,null))[_0x8d62('0x1a')](function(_0x26df36){if(_0x26df36){_0x46082c=_0x26df36;_0x231a7c[_0x8d62('0x40')]=_['keys'](db[_0x8d62('0x7b')][_0x8d62('0x3d')]);_0x231a7c['query']=_[_0x8d62('0x41')](_0x2ea85['query']);_0x231a7c[_0x8d62('0x42')]=_['intersection'](_0x231a7c[_0x8d62('0x40')],_0x231a7c[_0x8d62('0x47')]);_0x5c1ab0['attributes']=_[_0x8d62('0x43')](_0x231a7c[_0x8d62('0x40')],qs[_0x8d62('0x45')](_0x2ea85['query']['fields']));_0x5c1ab0['attributes']=_0x5c1ab0[_0x8d62('0x44')][_0x8d62('0x46')]?_0x5c1ab0[_0x8d62('0x44')]:_0x231a7c[_0x8d62('0x40')];_0x5c1ab0['order']=qs[_0x8d62('0x4a')](_0x2ea85['query'][_0x8d62('0x4a')]);_0x5c1ab0[_0x8d62('0x4c')]=qs['filters'](_[_0x8d62('0x64')](_0x2ea85[_0x8d62('0x47')],_0x231a7c[_0x8d62('0x42')]));if(_0x2ea85[_0x8d62('0x47')][_0x8d62('0x4b')]){_0x5c1ab0[_0x8d62('0x4c')]=_[_0x8d62('0x4d')](_0x5c1ab0[_0x8d62('0x4c')],{'$or':_[_0x8d62('0x3b')](_0x5c1ab0[_0x8d62('0x44')],function(_0x5a8d7d){var _0x3a6e04={};_0x3a6e04[_0x5a8d7d]={'$like':'%'+_0x2ea85[_0x8d62('0x47')][_0x8d62('0x4b')]+'%'};return _0x3a6e04;})});}_0x5c1ab0=_['merge']({},_0x5c1ab0,_0x2ea85[_0x8d62('0x4e')]);return _0x46082c[_0x8d62('0x7f')](_0x5c1ab0);}})[_0x8d62('0x1a')](function(_0x4aa29d){if(_0x4aa29d){_0x354fa0=_0x4aa29d[_0x8d62('0x46')];if(!_0x2ea85['query']['hasOwnProperty'](_0x8d62('0x49'))){_0x5c1ab0[_0x8d62('0x2b')]=qs['limit'](_0x2ea85[_0x8d62('0x47')][_0x8d62('0x2b')]);_0x5c1ab0[_0x8d62('0x29')]=qs[_0x8d62('0x29')](_0x2ea85[_0x8d62('0x47')][_0x8d62('0x29')]);}return _0x46082c[_0x8d62('0x7f')](_0x5c1ab0);}})[_0x8d62('0x1a')](function(_0x576c55){if(_0x576c55){return _0x576c55?{'count':_0x354fa0,'rows':_0x576c55}:null;}})[_0x8d62('0x1a')](respondWithResult(_0x1b23c3,null))[_0x8d62('0x24')](handleError(_0x1b23c3,null));};exports[_0x8d62('0x80')]=function(_0xb6432a,_0x3fc10c,_0x1cc05d){var _0x221ed8={'channel':'whatsapp'};var _0x3255d8=[];var _0x2708e2=[];var _0x13e499={};return db[_0x8d62('0x3c')][_0x8d62('0x55')]({'where':{'id':_0xb6432a[_0x8d62('0x54')]['id']},'include':[{'model':db[_0x8d62('0x7b')],'as':_0x8d62('0x81')}]})[_0x8d62('0x1a')](handleEntityNotFound(_0x3fc10c,null))[_0x8d62('0x1a')](function(_0x513251){_0x221ed8[_0x8d62('0x82')]=_0x513251;if(_0x221ed8[_0x8d62('0x82')]&&_0x221ed8[_0x8d62('0x82')]['type']===_0x8d62('0x83')&&_0xb6432a[_0x8d62('0x57')][_0x8d62('0x84')]){if(_0xb6432a[_0x8d62('0x57')][_0x8d62('0x84')][_0x8d62('0x46')]===0x0)return;if(_0xb6432a['body']['statuses'][0x0][_0x8d62('0x85')]!==_0x8d62('0x86'))return;return db[_0x8d62('0x87')][_0x8d62('0x31')]({'read':!![],'readAt':_0xb6432a[_0x8d62('0x57')][_0x8d62('0x84')][0x0]['timestamp']},{'where':{'messageId':_0xb6432a[_0x8d62('0x57')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x8d62('0x1a')](function(_0xfbfb0a){return _0x3fc10c[_0x8d62('0x26')](0xc8)[_0x8d62('0x28')](_0xfbfb0a);});}_0x221ed8[_0x8d62('0x88')]=_[_0x8d62('0x89')](_0x513251[_0x8d62('0x81')],['priority'],[_0x8d62('0x8a')]);if(_0x221ed8[_0x8d62('0x82')][_0x8d62('0x81')]){delete _0x221ed8[_0x8d62('0x82')][_0x8d62('0x81')];}return db[_0x8d62('0x8b')]['describe']()[_0x8d62('0x1a')](function(_0x36b468){if(!_0x36b468){throw new db[(_0x8d62('0x8c'))][(_0x8d62('0x8d'))](_0x8d62('0x8e'));}_0x3255d8=_['difference'](_[_0x8d62('0x41')](_0x36b468),[_0x8d62('0x8f'),'updatedAt']);_0x2708e2=_['difference'](_[_0x8d62('0x41')](_0x36b468),[_0x8d62('0x8f'),_0x8d62('0x90'),_0x8d62('0x91'),_0x8d62('0x92')]);_0x221ed8['body']={'mapKey':_0x8d62('0x93')};if(_0x221ed8['account']&&_0x221ed8['account'][_0x8d62('0x3f')]===_0x8d62('0x94')){_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')]=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x96')][_0x8d62('0x97')]('whatsapp:','');_0x221ed8['body']['body']=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x98')];_0x221ed8[_0x8d62('0x57')]['messageId']=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x99')];}if(_0x221ed8[_0x8d62('0x82')]&&_0x221ed8[_0x8d62('0x82')][_0x8d62('0x3f')]==='sinch'){_0x221ed8['body'][_0x8d62('0x95')]=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x9a')][0x0][_0x8d62('0x95')];_0x221ed8[_0x8d62('0x57')][_0x8d62('0x57')]=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x9a')][0x0][_0x8d62('0x22')]['body'];_0x221ed8[_0x8d62('0x57')][_0x8d62('0x9b')]=_0xb6432a[_0x8d62('0x57')][_0x8d62('0x9a')][0x0][_0x8d62('0x9c')];}if(_0x221ed8['body']['id']){delete _0x221ed8[_0x8d62('0x57')]['id'];}if(_[_0x8d62('0x9d')](_0x221ed8[_0x8d62('0x57')]['from'])){throw new db[(_0x8d62('0x8c'))][(_0x8d62('0x8d'))](_0x8d62('0x9e'));}if(_[_0x8d62('0x9d')](_0x221ed8[_0x8d62('0x57')][_0x8d62('0x57')])||_0x221ed8[_0x8d62('0x57')][_0x8d62('0x57')]===''){throw new db[(_0x8d62('0x8c'))][(_0x8d62('0x8d'))](_0x8d62('0x9f'));}if(_[_0x8d62('0x9d')](_0x221ed8[_0x8d62('0x57')][_0x8d62('0xa0')])){throw new db[(_0x8d62('0x8c'))]['ValidationError'](_0x8d62('0xa1')+_0x2708e2);}if(!_[_0x8d62('0xa2')](_0x2708e2,_0x221ed8[_0x8d62('0x57')][_0x8d62('0xa0')])){throw new db[(_0x8d62('0x8c'))][(_0x8d62('0x8d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2708e2);}_0x13e499[_0x221ed8[_0x8d62('0x57')][_0x8d62('0xa0')]]=_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')];return db[_0x8d62('0xa3')]['find']({'where':{'id':_0x221ed8[_0x8d62('0x82')][_0x8d62('0x92')]},'include':[{'model':db[_0x8d62('0x8b')],'as':_0x8d62('0xa4'),'where':_0x13e499,'limit':0x1,'order':[[_0x8d62('0x90'),'DESC']]}]});})['then'](handleEntityNotFound(_0x3fc10c,null))[_0x8d62('0x1a')](function(_0x45f7bd){if(_0x45f7bd){_0x221ed8[_0x8d62('0xa5')]=_[_0x8d62('0xa6')](_0x45f7bd,[_0x8d62('0xa4')]);if(_0x45f7bd[_0x8d62('0xa4')]['length']){return _0x45f7bd[_0x8d62('0xa4')][0x0];}var _0x1fff35=_[_0x8d62('0x14')](_0x221ed8[_0x8d62('0x57')],{'firstName':_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')],'ListId':_0x45f7bd['id']});_0x1fff35[_0x221ed8[_0x8d62('0x57')][_0x8d62('0xa0')]]=_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')];return db[_0x8d62('0x8b')][_0x8d62('0x56')](_0x1fff35,{'fields':_0x3255d8,'raw':!![]});}})[_0x8d62('0x1a')](handleEntityNotFound(_0x3fc10c,null))['then'](function(_0x3b9145){if(_0x3b9145){_0x221ed8[_0x8d62('0xa7')]=_0x3b9145;var _0x3e34cf={'ContactId':_0x3b9145['id'],'phone':_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')],'WhatsappAccountId':_0xb6432a[_0x8d62('0x54')]['id']};var _0x18d077={'ContactId':_0x3b9145['id'],'WhatsappAccountId':_0xb6432a[_0x8d62('0x54')]['id'],'closed':![]};return db[_0x8d62('0xa8')]['find']({'where':_0x18d077})['then'](function(_0x2cbd99){if(_0x2cbd99){return[_0x2cbd99,![]];}return db['WhatsappInteraction'][_0x8d62('0x56')](_0x3e34cf)[_0x8d62('0x1a')](function(_0x25781c){return[_0x25781c,!![]];});});}})['spread'](function(_0x2f4c00,_0x3d8b0f){_0x221ed8[_0x8d62('0xa9')]=_0x2f4c00[_0x8d62('0x33')]({'plain':!![]});_0x221ed8[_0x8d62('0xa9')][_0x8d62('0xaa')]=![];if(_0x3d8b0f){if(_0x221ed8[_0x8d62('0x82')][_0x8d62('0xab')]){_0x221ed8[_0x8d62('0x88')][_0x8d62('0xac')]({'id':0x0,'priority':_0x221ed8[_0x8d62('0x88')][_0x8d62('0x46')]+0x1,'app':_0x8d62('0xad'),'appdata':_0x8d62('0xae'),'interval':'*,*,*,*'});}_0x221ed8[_0x8d62('0xa9')][_0x8d62('0xaa')]=!![];}return db['WhatsappMessage'][_0x8d62('0x56')]({'phone':_0x221ed8[_0x8d62('0x57')][_0x8d62('0x95')],'messageId':_0x221ed8[_0x8d62('0x57')][_0x8d62('0x9b')],'body':_0x221ed8[_0x8d62('0x57')][_0x8d62('0x57')],'WhatsappAccountId':_0xb6432a[_0x8d62('0x54')]['id'],'WhatsappInteractionId':_0x2f4c00['id'],'direction':'in','ContactId':_0x2f4c00[_0x8d62('0xaf')],'AttachmentId':_0x221ed8[_0x8d62('0x57')][_0x8d62('0xb0')]});})['then'](function(_0x554d01){_0x221ed8[_0x8d62('0x22')]=_0x554d01;if(_0x221ed8[_0x8d62('0xa9')][_0x8d62('0xb1')]){return db['User'][_0x8d62('0x55')]({'attributes':['id','name'],'where':{'id':_0x221ed8[_0x8d62('0xa9')][_0x8d62('0xb1')]}})[_0x8d62('0x1a')](function(_0x5f09f1){if(_0x5f09f1){_0x221ed8[_0x8d62('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f09f1[_0x8d62('0x36')]+','+(_0x221ed8[_0x8d62('0x82')][_0x8d62('0xb2')]||0xa),'interval':_0x8d62('0xb3')});}return respondWithRpcPromise(_0x8d62('0xb4'),_0x8d62('0xb5'),_0x221ed8);});}return respondWithRpcPromise('Start',_0x8d62('0xb5'),_0x221ed8);})[_0x8d62('0x1a')](function(_0xbcfb0a){if(_0xbcfb0a){var _0x5a1e18=0xc8;var _0x565877=_0x8d62('0xb6');logger[_0x8d62('0x1b')](_0x8d62('0x1e'),_0x565877,_0x5a1e18,_0x8d62('0xb7'));logger[_0x8d62('0x1d')](_0x8d62('0xb8'),_0x565877,_0x5a1e18,_0x8d62('0xb7'),JSON[_0x8d62('0xb9')](_0xbcfb0a));if(_0x221ed8[_0x8d62('0x82')][_0x8d62('0x3f')]===_0x8d62('0x94')){return _0x3fc10c[_0x8d62('0x26')](_0x5a1e18)[_0x8d62('0xba')](_0x8d62('0xbb'),_0x8d62('0xbc'))[_0x8d62('0x37')](_0x8d62('0xbd'));}else{return _0x3fc10c[_0x8d62('0x26')](_0x5a1e18)[_0x8d62('0x28')](_0xbcfb0a);}}});})['catch'](handleError(_0x3fc10c,null));};exports[_0x8d62('0x37')]=function(_0x4df240,_0x419b6c,_0x4bd2ce){var _0x4b2161,_0x146357,_0x1678f6;if(_[_0x8d62('0x9d')](_0x4df240['body'][_0x8d62('0x57')])||_0x4df240[_0x8d62('0x57')][_0x8d62('0x57')]===''){throw new db[(_0x8d62('0x8c'))]['ValidationError'](_0x8d62('0x9f'));}if(_[_0x8d62('0x9d')](_0x4df240['body']['to'])){throw new db[(_0x8d62('0x8c'))]['ValidationError'](_0x8d62('0xbe'));}_0x4b2161=_0x4df240[_0x8d62('0x57')]['to'];return db['WhatsappAccount'][_0x8d62('0x55')]({'where':{'id':_0x4df240['params']['id']},'include':[{'model':db[_0x8d62('0xa3')],'as':'List','include':[{'model':db[_0x8d62('0x8b')],'as':_0x8d62('0xa4'),'where':{'mobile':_0x4b2161},'limit':0x1,'order':[[_0x8d62('0x90'),_0x8d62('0xbf')]]}]}]})['then'](handleEntityNotFound(_0x419b6c,null))[_0x8d62('0x1a')](function(_0x24caaf){if(_0x24caaf&&_0x24caaf[_0x8d62('0xc0')]){_0x146357=_0x24caaf['get']({'plain':!![]});if(_0x146357['List']&&_0x146357['List'][_0x8d62('0xa4')]['length']){return _0x146357[_0x8d62('0xc0')][_0x8d62('0xa4')][0x0];}return db['CmContact'][_0x8d62('0x56')](_[_0x8d62('0x14')](_0x4df240[_0x8d62('0x57')],{'firstName':_0x4b2161,'mobile':_0x4b2161,'phone':_0x4b2161,'ListId':_0x146357[_0x8d62('0x92')]}));}})[_0x8d62('0x1a')](handleEntityNotFound(_0x419b6c,null))['then'](function(_0x5e9053){if(_0x5e9053){_0x1678f6=_0x5e9053;return db[_0x8d62('0xa8')][_0x8d62('0x55')]({'where':{'ContactId':_0x1678f6['id'],'closed':![],'WhatsappAccountId':_0x146357['id']}})['then'](function(_0x5299bf){if(_0x5299bf){return[_0x5299bf,![]];}return db[_0x8d62('0xa8')][_0x8d62('0x56')]({'UserId':_0x4df240[_0x8d62('0x58')]['id'],'ContactId':_0x1678f6['id'],'WhatsappAccountId':_0x146357['id'],'phone':_0x4b2161,'firstMsgDirection':'out','Messages':[_['merge'](_0x4df240[_0x8d62('0x57')],{'read':![],'body':_0x4df240[_0x8d62('0x57')][_0x8d62('0x57')],'phone':_0x4b2161,'WhatsappAccountId':_0x146357['id'],'UserId':_0x4df240[_0x8d62('0x58')]['id'],'ContactId':_0x1678f6['id']})]},{'include':[{'model':db[_0x8d62('0x87')],'as':_0x8d62('0xc1')}]})[_0x8d62('0x1a')](function(_0x5a1bef){return[_0x5a1bef,!![]];});});}})[_0x8d62('0x6e')](function(_0x545c79,_0x3dff44){if(_0x3dff44){return _0x545c79;}return db[_0x8d62('0x87')][_0x8d62('0x56')](_['merge'](_0x4df240[_0x8d62('0x57')],{'read':![],'body':_0x4df240['body'][_0x8d62('0x57')],'phone':_0x4b2161,'WhatsappAccountId':_0x146357['id'],'WhatsappInteractionId':_0x545c79['id'],'UserId':_0x4df240[_0x8d62('0x58')]['id'],'ContactId':_0x1678f6['id']}))[_0x8d62('0x1a')](function(_0x357f03){_0x545c79[_0x8d62('0xc2')]['Messages']=[];_0x545c79[_0x8d62('0xc2')][_0x8d62('0xc1')][_0x8d62('0xac')](_0x357f03['dataValues']);return _0x545c79;});})[_0x8d62('0x1a')](respondWithResult(_0x419b6c,null))['catch'](handleError(_0x419b6c,null));}; \ No newline at end of file +var _0xdb25=['apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','WhatsappAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','user','role','WhatsappAccounts','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','json','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','timestamp','applications','priority','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','notifications','message_id','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','push','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x5d6d50,_0x3d17a8){var _0x404622=function(_0x32dd13){while(--_0x32dd13){_0x5d6d50['push'](_0x5d6d50['shift']());}};_0x404622(++_0x3d17a8);}(_0xdb25,0x159));var _0x5db2=function(_0x2d71a7,_0x183540){_0x2d71a7=_0x2d71a7-0x0;var _0xe3badf=_0xdb25[_0x2d71a7];return _0xe3badf;};'use strict';var emlformat=require(_0x5db2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5db2('0x1'));var jsonpatch=require(_0x5db2('0x2'));var rp=require(_0x5db2('0x3'));var moment=require(_0x5db2('0x4'));var BPromise=require(_0x5db2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5db2('0x6'));var sox=require(_0x5db2('0x7'));var csv=require('to-csv');var ejs=require(_0x5db2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5db2('0x9'));var squel=require(_0x5db2('0xa'));var crypto=require(_0x5db2('0xb'));var jsforce=require(_0x5db2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5db2('0xd'));var querystring=require(_0x5db2('0xe'));var Papa=require(_0x5db2('0xf'));var Redis=require('ioredis');var authService=require(_0x5db2('0x10'));var qs=require(_0x5db2('0x11'));var as=require(_0x5db2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5db2('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5db2('0x14'));var db=require(_0x5db2('0x15'))['db'];config['redis']=_[_0x5db2('0x16')](config[_0x5db2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5db2('0x18'))(new Redis(config[_0x5db2('0x17')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0x5db2('0x19'));var client=jayson['client'][_0x5db2('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x4d09d7,_0x4fe2fa,_0x263fc9,_0x36a1d2){return new BPromise(function(_0xd41785,_0x5813f9){var _0x19ef18=_0x36a1d2||client;return _0x19ef18[_0x5db2('0x1b')](_0x4d09d7,_0x263fc9)['then'](function(_0x373e99){logger['info'](_0x5db2('0x1c'),_0x4fe2fa,_0x5db2('0x1d'));logger[_0x5db2('0x1e')](_0x5db2('0x1f'),_0x4fe2fa,'request\x20sent',JSON[_0x5db2('0x20')](_0x373e99));if(_0x373e99[_0x5db2('0x21')]){if(_0x373e99[_0x5db2('0x21')][_0x5db2('0x22')]===0x1f4){logger['error'](_0x5db2('0x1c'),_0x4fe2fa,_0x373e99[_0x5db2('0x21')][_0x5db2('0x23')]);return _0x5813f9(_0x373e99[_0x5db2('0x21')][_0x5db2('0x23')]);}logger[_0x5db2('0x21')](_0x5db2('0x1c'),_0x4fe2fa,_0x373e99[_0x5db2('0x21')][_0x5db2('0x23')]);return _0xd41785(_0x373e99[_0x5db2('0x21')]['message']);}else{logger['info'](_0x5db2('0x1c'),_0x4fe2fa,_0x5db2('0x1d'));_0xd41785(_0x373e99['result'][_0x5db2('0x23')]);}})['catch'](function(_0x5a5379){logger[_0x5db2('0x21')](_0x5db2('0x1c'),_0x4fe2fa,_0x5a5379);_0x5813f9(_0x5a5379);});});}function respondWithStatusCode(_0x375a32,_0x1191ed){_0x1191ed=_0x1191ed||0xcc;return function(_0x3159a8){if(_0x3159a8){return _0x375a32[_0x5db2('0x24')](_0x1191ed);}return _0x375a32[_0x5db2('0x25')](_0x1191ed)[_0x5db2('0x26')]();};}function respondWithResult(_0x51fa29,_0x50a4ae){_0x50a4ae=_0x50a4ae||0xc8;return function(_0x1b8b52){if(_0x1b8b52){return _0x51fa29[_0x5db2('0x25')](_0x50a4ae)['json'](_0x1b8b52);}};}function respondWithFilteredResult(_0x7c6eee,_0x5f1625){return function(_0x1bb85f){if(_0x1bb85f){var _0x39e60c=typeof _0x5f1625[_0x5db2('0x27')]===_0x5db2('0x28')&&typeof _0x5f1625[_0x5db2('0x29')]==='undefined';var _0x349745=_0x1bb85f[_0x5db2('0x2a')];var _0x44cf36=_0x39e60c?0x0:_0x5f1625[_0x5db2('0x27')];var _0xe85b3e=_0x39e60c?_0x1bb85f['count']:_0x5f1625[_0x5db2('0x27')]+_0x5f1625[_0x5db2('0x29')];var _0x378483;if(_0xe85b3e>=_0x349745){_0xe85b3e=_0x349745;_0x378483=0xc8;}else{_0x378483=0xce;}_0x7c6eee['status'](_0x378483);return _0x7c6eee[_0x5db2('0x2b')](_0x5db2('0x2c'),_0x44cf36+'-'+_0xe85b3e+'/'+_0x349745)['json'](_0x1bb85f);}return null;};}function patchUpdates(_0x451b5b){return function(_0x3cb2af){try{jsonpatch[_0x5db2('0x2d')](_0x3cb2af,_0x451b5b,!![]);}catch(_0x2be3f){return BPromise[_0x5db2('0x2e')](_0x2be3f);}return _0x3cb2af[_0x5db2('0x2f')]();};}function saveUpdates(_0x383a0d,_0x55367e){return function(_0x54f6e5){if(_0x54f6e5){return _0x54f6e5[_0x5db2('0x30')](_0x383a0d)[_0x5db2('0x31')](function(_0x4bba7d){return _0x4bba7d;});}return null;};}function removeEntity(_0x16137e,_0x1f574f){return function(_0x2dfff9){if(_0x2dfff9){return _0x2dfff9[_0x5db2('0x32')]()[_0x5db2('0x31')](function(){var _0x4d9cf9=_0x2dfff9[_0x5db2('0x33')]({'plain':!![]});var _0x32f32b='WhatsappAccounts';return db[_0x5db2('0x34')][_0x5db2('0x32')]({'where':{'type':_0x32f32b,'resourceId':_0x4d9cf9['id']}})[_0x5db2('0x31')](function(){return _0x2dfff9;});})[_0x5db2('0x31')](function(){_0x16137e['status'](0xcc)[_0x5db2('0x26')]();});}};}function handleEntityNotFound(_0x3e3c7a,_0xb16c5a){return function(_0x320f03){if(!_0x320f03){_0x3e3c7a[_0x5db2('0x24')](0x194);}return _0x320f03;};}function handleError(_0x31c1e6,_0x393752){_0x393752=_0x393752||0x1f4;return function(_0x1ebe54){logger[_0x5db2('0x21')](_0x1ebe54[_0x5db2('0x35')]);if(_0x1ebe54['name']){delete _0x1ebe54[_0x5db2('0x36')];}_0x31c1e6[_0x5db2('0x25')](_0x393752)[_0x5db2('0x37')](_0x1ebe54);};}exports['index']=function(_0x2f1c32,_0xe431ed){var _0x5537cc={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3fa5c4={},_0x595add={'count':0x0,'rows':[]};var _0x2f5932=_[_0x5db2('0x38')](db[_0x5db2('0x39')]['rawAttributes'],function(_0x502c72){return{'name':_0x502c72[_0x5db2('0x3a')],'type':_0x502c72[_0x5db2('0x3b')][_0x5db2('0x3c')]};});_0x3fa5c4[_0x5db2('0x3d')]=_[_0x5db2('0x38')](_0x2f5932,'name');_0x3fa5c4['query']=_[_0x5db2('0x3e')](_0x2f1c32[_0x5db2('0x3f')]);_0x3fa5c4[_0x5db2('0x40')]=_[_0x5db2('0x41')](_0x3fa5c4[_0x5db2('0x3d')],_0x3fa5c4['query']);_0x5537cc[_0x5db2('0x42')]=_['intersection'](_0x3fa5c4[_0x5db2('0x3d')],qs[_0x5db2('0x43')](_0x2f1c32['query'][_0x5db2('0x43')]));_0x5537cc[_0x5db2('0x42')]=_0x5537cc[_0x5db2('0x42')][_0x5db2('0x44')]?_0x5537cc['attributes']:_0x3fa5c4[_0x5db2('0x3d')];if(!_0x2f1c32[_0x5db2('0x3f')][_0x5db2('0x45')](_0x5db2('0x46'))){_0x5537cc[_0x5db2('0x29')]=qs[_0x5db2('0x29')](_0x2f1c32[_0x5db2('0x3f')][_0x5db2('0x29')]);_0x5537cc['offset']=qs[_0x5db2('0x27')](_0x2f1c32[_0x5db2('0x3f')][_0x5db2('0x27')]);}_0x5537cc[_0x5db2('0x47')]=qs[_0x5db2('0x48')](_0x2f1c32[_0x5db2('0x3f')][_0x5db2('0x48')]);_0x5537cc['where']=qs[_0x5db2('0x40')](_[_0x5db2('0x49')](_0x2f1c32[_0x5db2('0x3f')],_0x3fa5c4[_0x5db2('0x40')]),_0x2f5932);if(_0x2f1c32['query']['filter']){_0x5537cc[_0x5db2('0x4a')]=_[_0x5db2('0x4b')](_0x5537cc[_0x5db2('0x4a')],{'$or':_['map'](_0x2f5932,function(_0x29a787){if(_0x29a787['type']!==_0x5db2('0x4c')){var _0x21d7a3={};_0x21d7a3[_0x29a787['name']]={'$like':'%'+_0x2f1c32['query'][_0x5db2('0x4d')]+'%'};return _0x21d7a3;}})});}_0x5537cc=_['merge']({},_0x5537cc,_0x2f1c32[_0x5db2('0x4e')]);var _0x18db25={'where':_0x5537cc[_0x5db2('0x4a')]};return db['WhatsappAccount']['count'](_0x18db25)['then'](function(_0x1fd768){_0x595add[_0x5db2('0x2a')]=_0x1fd768;if(_0x2f1c32[_0x5db2('0x3f')][_0x5db2('0x4f')]){_0x5537cc[_0x5db2('0x50')]=[{'all':!![]}];}return db[_0x5db2('0x39')]['findAll'](_0x5537cc);})[_0x5db2('0x31')](function(_0xe61b70){_0x595add[_0x5db2('0x51')]=_0xe61b70;return _0x595add;})[_0x5db2('0x31')](respondWithFilteredResult(_0xe431ed,_0x5537cc))['catch'](handleError(_0xe431ed,null));};exports[_0x5db2('0x52')]=function(_0x38874e,_0x468373){var _0x5bc69b={'raw':![],'where':{'id':_0x38874e[_0x5db2('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x5db2('0x54')}]},_0x3ec9fe={};_0x3ec9fe['model']=_[_0x5db2('0x3e')](db[_0x5db2('0x39')][_0x5db2('0x55')]);_0x3ec9fe['query']=_[_0x5db2('0x3e')](_0x38874e[_0x5db2('0x3f')]);_0x3ec9fe[_0x5db2('0x40')]=_[_0x5db2('0x41')](_0x3ec9fe[_0x5db2('0x3d')],_0x3ec9fe['query']);_0x5bc69b['attributes']=_[_0x5db2('0x41')](_0x3ec9fe[_0x5db2('0x3d')],qs[_0x5db2('0x43')](_0x38874e[_0x5db2('0x3f')][_0x5db2('0x43')]));_0x5bc69b[_0x5db2('0x42')]=_0x5bc69b['attributes'][_0x5db2('0x44')]?_0x5bc69b[_0x5db2('0x42')]:_0x3ec9fe[_0x5db2('0x3d')];if(_0x38874e[_0x5db2('0x3f')]['includeAll']){_0x5bc69b[_0x5db2('0x50')]=[{'all':!![]}];}_0x5bc69b=_[_0x5db2('0x4b')]({},_0x5bc69b,_0x38874e['options']);return db[_0x5db2('0x39')][_0x5db2('0x56')](_0x5bc69b)['then'](handleEntityNotFound(_0x468373,null))['then'](respondWithResult(_0x468373,null))['catch'](handleError(_0x468373,null));};exports['create']=function(_0xfe25e8,_0xdd4229){return db[_0x5db2('0x39')][_0x5db2('0x57')](_0xfe25e8['body'],{})['then'](function(_0x469b73){var _0x2d156b=_0xfe25e8[_0x5db2('0x58')][_0x5db2('0x33')]({'plain':!![]});if(!_0x2d156b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d156b[_0x5db2('0x59')]===_0x5db2('0x58')){var _0x1e1a01=_0x469b73[_0x5db2('0x33')]({'plain':!![]});var _0x5a16e4=_0x5db2('0x5a');return db[_0x5db2('0x5b')][_0x5db2('0x56')]({'where':{'name':_0x5a16e4,'userProfileId':_0x2d156b[_0x5db2('0x5c')]},'raw':!![]})['then'](function(_0x5cc6f0){if(_0x5cc6f0&&_0x5cc6f0['autoAssociation']===0x0){return db[_0x5db2('0x34')][_0x5db2('0x57')]({'name':_0x1e1a01[_0x5db2('0x36')],'resourceId':_0x1e1a01['id'],'type':_0x5cc6f0[_0x5db2('0x36')],'sectionId':_0x5cc6f0['id']},{})[_0x5db2('0x31')](function(){return _0x469b73;});}else{return _0x469b73;}})[_0x5db2('0x5d')](function(_0x382111){logger[_0x5db2('0x21')](_0x5db2('0x5e'),_0x382111);throw _0x382111;});}return _0x469b73;})[_0x5db2('0x31')](respondWithResult(_0xdd4229,0xc9))[_0x5db2('0x5d')](handleError(_0xdd4229,null));};exports[_0x5db2('0x30')]=function(_0x1e208c,_0x56b6fb){if(_0x1e208c[_0x5db2('0x5f')]['id']){delete _0x1e208c['body']['id'];}return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x1e208c['params']['id']},'include':[{'model':db[_0x5db2('0x60')],'as':_0x5db2('0x54')}]})['then'](handleEntityNotFound(_0x56b6fb,null))[_0x5db2('0x31')](saveUpdates(_0x1e208c[_0x5db2('0x5f')],null))[_0x5db2('0x31')](respondWithResult(_0x56b6fb,null))[_0x5db2('0x5d')](handleError(_0x56b6fb,null));};exports[_0x5db2('0x32')]=function(_0x32e3e4,_0x3d0293){return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x32e3e4[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x3d0293,null))[_0x5db2('0x31')](removeEntity(_0x3d0293,null))[_0x5db2('0x5d')](handleError(_0x3d0293,null));};exports['describe']=function(_0x4364a2,_0x42608e){return db[_0x5db2('0x39')]['describe']()['then'](respondWithResult(_0x42608e,null))[_0x5db2('0x5d')](handleError(_0x42608e,null));};exports[_0x5db2('0x61')]=function(_0x30b95d,_0x296e71,_0x3bc331){if(_0x30b95d[_0x5db2('0x5f')]['id']){delete _0x30b95d['body']['id'];}return db[_0x5db2('0x39')]['find']({'where':{'id':_0x30b95d[_0x5db2('0x53')]['id']}})['then'](handleEntityNotFound(_0x296e71,null))[_0x5db2('0x31')](function(_0x40471a){if(_0x40471a){_0x30b95d[_0x5db2('0x5f')][_0x5db2('0x62')]=_0x40471a['id'];return db[_0x5db2('0x63')]['create'](_0x30b95d[_0x5db2('0x5f')]);}})[_0x5db2('0x31')](respondWithResult(_0x296e71,null))[_0x5db2('0x5d')](handleError(_0x296e71,null));};exports[_0x5db2('0x64')]=function(_0x1cfe7e,_0x1e318e,_0x3bb218){var _0xe920bd={'raw':![],'where':{}};var _0x40147e={};var _0x15ed15={'count':0x0,'rows':[]};return db[_0x5db2('0x39')][_0x5db2('0x65')]({'where':{'id':_0x1cfe7e[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x1e318e,null))[_0x5db2('0x31')](function(_0xdfdf54){if(_0xdfdf54){_0x40147e[_0x5db2('0x3d')]=_['keys'](db[_0x5db2('0x63')][_0x5db2('0x55')]);_0x40147e[_0x5db2('0x3f')]=_[_0x5db2('0x3e')](_0x1cfe7e['query']);_0x40147e['filters']=_[_0x5db2('0x41')](_0x40147e[_0x5db2('0x3d')],_0x40147e[_0x5db2('0x3f')]);_0xe920bd[_0x5db2('0x42')]=_[_0x5db2('0x41')](_0x40147e[_0x5db2('0x3d')],qs[_0x5db2('0x43')](_0x1cfe7e[_0x5db2('0x3f')][_0x5db2('0x43')]));_0xe920bd['attributes']=_0xe920bd[_0x5db2('0x42')][_0x5db2('0x44')]?_0xe920bd[_0x5db2('0x42')]:_0x40147e[_0x5db2('0x3d')];if(!_0x1cfe7e[_0x5db2('0x3f')][_0x5db2('0x45')]('nolimit')){_0xe920bd[_0x5db2('0x29')]=qs[_0x5db2('0x29')](_0x1cfe7e[_0x5db2('0x3f')][_0x5db2('0x29')]);_0xe920bd[_0x5db2('0x27')]=qs['offset'](_0x1cfe7e['query']['offset']);}_0xe920bd[_0x5db2('0x47')]=qs[_0x5db2('0x48')](_0x1cfe7e[_0x5db2('0x3f')][_0x5db2('0x48')]);_0xe920bd[_0x5db2('0x4a')]=qs[_0x5db2('0x40')](_[_0x5db2('0x49')](_0x1cfe7e[_0x5db2('0x3f')],_0x40147e[_0x5db2('0x40')]));_0xe920bd['where'][_0x5db2('0x62')]=_0xdfdf54['id'];if(_0x1cfe7e[_0x5db2('0x3f')]['filter']){_0xe920bd[_0x5db2('0x4a')]=_[_0x5db2('0x4b')](_0xe920bd[_0x5db2('0x4a')],{'$or':_[_0x5db2('0x38')](_0xe920bd['attributes'],function(_0x545c2e){var _0x1fefea={};_0x1fefea[_0x545c2e]={'$like':'%'+_0x1cfe7e['query'][_0x5db2('0x4d')]+'%'};return _0x1fefea;})});}_0xe920bd=_[_0x5db2('0x4b')]({},_0xe920bd,_0x1cfe7e[_0x5db2('0x4e')]);return db[_0x5db2('0x63')][_0x5db2('0x2a')]({'where':_0xe920bd[_0x5db2('0x4a')]})[_0x5db2('0x31')](function(_0x2387bc){_0x15ed15[_0x5db2('0x2a')]=_0x2387bc;if(_0x1cfe7e[_0x5db2('0x3f')][_0x5db2('0x4f')]){_0xe920bd[_0x5db2('0x50')]=[{'all':!![]}];}return db[_0x5db2('0x63')][_0x5db2('0x66')](_0xe920bd);})['then'](function(_0x4b74a7){_0x15ed15[_0x5db2('0x51')]=_0x4b74a7;return _0x15ed15;});}})['then'](respondWithFilteredResult(_0x1e318e,_0xe920bd))[_0x5db2('0x5d')](handleError(_0x1e318e,null));};exports['removeDispositions']=function(_0x39135b,_0x3f77bb,_0xf46516){return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x39135b[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x3f77bb,null))[_0x5db2('0x31')](function(_0x3cbde6){if(_0x3cbde6){return _0x3cbde6[_0x5db2('0x67')](_0x39135b[_0x5db2('0x3f')]['ids']);}})[_0x5db2('0x31')](respondWithStatusCode(_0x3f77bb,null))['catch'](handleError(_0x3f77bb,null));};exports[_0x5db2('0x68')]=function(_0x82f9b5,_0x417253,_0x3f2236){if(_0x82f9b5[_0x5db2('0x5f')]['id']){delete _0x82f9b5['body']['id'];}return db[_0x5db2('0x39')]['find']({'where':{'id':_0x82f9b5[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x417253,null))['then'](function(_0x16f5a7){if(_0x16f5a7){_0x82f9b5[_0x5db2('0x5f')][_0x5db2('0x62')]=_0x16f5a7['id'];return db[_0x5db2('0x69')]['create'](_0x82f9b5[_0x5db2('0x5f')]);}})['then'](respondWithResult(_0x417253,null))[_0x5db2('0x5d')](handleError(_0x417253,null));};exports[_0x5db2('0x6a')]=function(_0x472dfd,_0x4194ad,_0x44353b){var _0x4ebaa0={'raw':![],'where':{}};var _0x29d1cf={};var _0xc54732={'count':0x0,'rows':[]};return db[_0x5db2('0x39')][_0x5db2('0x65')]({'where':{'id':_0x472dfd[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x4194ad,null))[_0x5db2('0x31')](function(_0x559318){if(_0x559318){_0x29d1cf[_0x5db2('0x3d')]=_[_0x5db2('0x3e')](db[_0x5db2('0x69')][_0x5db2('0x55')]);_0x29d1cf['query']=_[_0x5db2('0x3e')](_0x472dfd['query']);_0x29d1cf[_0x5db2('0x40')]=_['intersection'](_0x29d1cf[_0x5db2('0x3d')],_0x29d1cf['query']);_0x4ebaa0[_0x5db2('0x42')]=_[_0x5db2('0x41')](_0x29d1cf['model'],qs['fields'](_0x472dfd['query'][_0x5db2('0x43')]));_0x4ebaa0[_0x5db2('0x42')]=_0x4ebaa0[_0x5db2('0x42')][_0x5db2('0x44')]?_0x4ebaa0['attributes']:_0x29d1cf[_0x5db2('0x3d')];if(!_0x472dfd['query'][_0x5db2('0x45')](_0x5db2('0x46'))){_0x4ebaa0[_0x5db2('0x29')]=qs[_0x5db2('0x29')](_0x472dfd[_0x5db2('0x3f')][_0x5db2('0x29')]);_0x4ebaa0[_0x5db2('0x27')]=qs[_0x5db2('0x27')](_0x472dfd[_0x5db2('0x3f')][_0x5db2('0x27')]);}_0x4ebaa0[_0x5db2('0x47')]=qs[_0x5db2('0x48')](_0x472dfd[_0x5db2('0x3f')]['sort']);_0x4ebaa0[_0x5db2('0x4a')]=qs[_0x5db2('0x40')](_[_0x5db2('0x49')](_0x472dfd[_0x5db2('0x3f')],_0x29d1cf['filters']));_0x4ebaa0[_0x5db2('0x4a')][_0x5db2('0x62')]=_0x559318['id'];if(_0x472dfd[_0x5db2('0x3f')][_0x5db2('0x4d')]){_0x4ebaa0[_0x5db2('0x4a')]=_['merge'](_0x4ebaa0[_0x5db2('0x4a')],{'$or':_[_0x5db2('0x38')](_0x4ebaa0[_0x5db2('0x42')],function(_0x3460ac){var _0x4536df={};_0x4536df[_0x3460ac]={'$like':'%'+_0x472dfd[_0x5db2('0x3f')]['filter']+'%'};return _0x4536df;})});}_0x4ebaa0=_[_0x5db2('0x4b')]({},_0x4ebaa0,_0x472dfd[_0x5db2('0x4e')]);return db[_0x5db2('0x69')][_0x5db2('0x2a')]({'where':_0x4ebaa0[_0x5db2('0x4a')]})[_0x5db2('0x31')](function(_0x294e26){_0xc54732[_0x5db2('0x2a')]=_0x294e26;if(_0x472dfd[_0x5db2('0x3f')][_0x5db2('0x4f')]){_0x4ebaa0['include']=[{'all':!![]}];}return db[_0x5db2('0x69')]['findAll'](_0x4ebaa0);})[_0x5db2('0x31')](function(_0x10b8a0){_0xc54732['rows']=_0x10b8a0;return _0xc54732;});}})[_0x5db2('0x31')](respondWithFilteredResult(_0x4194ad,_0x4ebaa0))['catch'](handleError(_0x4194ad,null));};exports[_0x5db2('0x6b')]=function(_0x40147f,_0x12d180,_0x32c01c){return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x40147f[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x12d180,null))[_0x5db2('0x31')](function(_0x583755){if(_0x583755){return _0x583755[_0x5db2('0x6b')](_0x40147f[_0x5db2('0x3f')][_0x5db2('0x6c')]);}})[_0x5db2('0x31')](respondWithStatusCode(_0x12d180,null))['catch'](handleError(_0x12d180,null));};exports[_0x5db2('0x6d')]=function(_0x7d2f35,_0x1c975b,_0x325a68){return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x7d2f35[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x1c975b,null))[_0x5db2('0x31')](function(_0x4c1c8b){if(_0x4c1c8b){return _0x4c1c8b[_0x5db2('0x6d')](_0x7d2f35[_0x5db2('0x5f')][_0x5db2('0x6c')],_[_0x5db2('0x6e')](_0x7d2f35[_0x5db2('0x5f')],['ids','id'])||{})[_0x5db2('0x6f')](function(_0x279b97){for(var _0x23b416=0x0;_0x23b416<_0x7d2f35[_0x5db2('0x5f')]['ids'][_0x5db2('0x44')];_0x23b416+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x7d2f35[_0x5db2('0x5f')][_0x5db2('0x6c')][_0x23b416]),'WhatsappAccountId':Number(_0x7d2f35[_0x5db2('0x53')]['id'])});}return _0x279b97;});}})[_0x5db2('0x31')](respondWithResult(_0x1c975b,null))[_0x5db2('0x5d')](handleError(_0x1c975b,null));};exports[_0x5db2('0x70')]=function(_0x1121d8,_0x1c3f96,_0x186ca2){return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x1121d8[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x1c3f96,null))[_0x5db2('0x31')](function(_0x2a8b4f){if(_0x2a8b4f){return _0x2a8b4f[_0x5db2('0x70')](_0x1121d8[_0x5db2('0x3f')]['ids'])['then'](function(){if(_[_0x5db2('0x71')](_0x1121d8[_0x5db2('0x3f')][_0x5db2('0x6c')])){for(var _0x46b23e=0x0;_0x46b23e<_0x1121d8['query'][_0x5db2('0x6c')][_0x5db2('0x44')];_0x46b23e+=0x1){socket[_0x5db2('0x72')](_0x5db2('0x73'),{'UserId':Number(_0x1121d8[_0x5db2('0x3f')][_0x5db2('0x6c')][_0x46b23e]),'WhatsappAccountId':Number(_0x1121d8[_0x5db2('0x53')]['id'])});}}else{socket[_0x5db2('0x72')](_0x5db2('0x73'),{'UserId':Number(_0x1121d8[_0x5db2('0x3f')][_0x5db2('0x6c')]),'WhatsappAccountId':Number(_0x1121d8[_0x5db2('0x53')]['id'])});}});}})[_0x5db2('0x31')](respondWithStatusCode(_0x1c3f96,null))[_0x5db2('0x5d')](handleError(_0x1c3f96,null));};exports[_0x5db2('0x74')]=function(_0x180b08,_0x1995ac,_0x244b4e){var _0x5644bd={};var _0x18f733={};var _0x3f62f4;var _0x4cb065;return db[_0x5db2('0x39')][_0x5db2('0x65')]({'where':{'id':_0x180b08[_0x5db2('0x53')]['id']}})[_0x5db2('0x31')](handleEntityNotFound(_0x1995ac,null))[_0x5db2('0x31')](function(_0x4e5757){if(_0x4e5757){_0x3f62f4=_0x4e5757;_0x18f733['model']=_['keys'](db['User'][_0x5db2('0x55')]);_0x18f733[_0x5db2('0x3f')]=_[_0x5db2('0x3e')](_0x180b08['query']);_0x18f733[_0x5db2('0x40')]=_[_0x5db2('0x41')](_0x18f733['model'],_0x18f733[_0x5db2('0x3f')]);_0x5644bd[_0x5db2('0x42')]=_[_0x5db2('0x41')](_0x18f733[_0x5db2('0x3d')],qs[_0x5db2('0x43')](_0x180b08['query'][_0x5db2('0x43')]));_0x5644bd[_0x5db2('0x42')]=_0x5644bd[_0x5db2('0x42')][_0x5db2('0x44')]?_0x5644bd[_0x5db2('0x42')]:_0x18f733['model'];_0x5644bd[_0x5db2('0x47')]=qs[_0x5db2('0x48')](_0x180b08[_0x5db2('0x3f')]['sort']);_0x5644bd[_0x5db2('0x4a')]=qs[_0x5db2('0x40')](_[_0x5db2('0x49')](_0x180b08['query'],_0x18f733[_0x5db2('0x40')]));if(_0x180b08[_0x5db2('0x3f')][_0x5db2('0x4d')]){_0x5644bd[_0x5db2('0x4a')]=_[_0x5db2('0x4b')](_0x5644bd[_0x5db2('0x4a')],{'$or':_['map'](_0x5644bd['attributes'],function(_0x3f303b){var _0x1412ba={};_0x1412ba[_0x3f303b]={'$like':'%'+_0x180b08[_0x5db2('0x3f')][_0x5db2('0x4d')]+'%'};return _0x1412ba;})});}_0x5644bd=_[_0x5db2('0x4b')]({},_0x5644bd,_0x180b08['options']);return _0x3f62f4[_0x5db2('0x74')](_0x5644bd);}})[_0x5db2('0x31')](function(_0x104f0e){if(_0x104f0e){_0x4cb065=_0x104f0e[_0x5db2('0x44')];if(!_0x180b08[_0x5db2('0x3f')][_0x5db2('0x45')](_0x5db2('0x46'))){_0x5644bd[_0x5db2('0x29')]=qs['limit'](_0x180b08['query']['limit']);_0x5644bd[_0x5db2('0x27')]=qs['offset'](_0x180b08[_0x5db2('0x3f')][_0x5db2('0x27')]);}return _0x3f62f4[_0x5db2('0x74')](_0x5644bd);}})[_0x5db2('0x31')](function(_0x4f5ce6){if(_0x4f5ce6){return _0x4f5ce6?{'count':_0x4cb065,'rows':_0x4f5ce6}:null;}})[_0x5db2('0x31')](respondWithResult(_0x1995ac,null))[_0x5db2('0x5d')](handleError(_0x1995ac,null));};exports[_0x5db2('0x75')]=function(_0x39d99a,_0x33d07){var _0x57950e=_0x39d99a[_0x5db2('0x53')]['id'];var _0x3d3b83=_0x39d99a[_0x5db2('0x5f')];var _0x31a396=0xc8;var _0x37f917=null;return db['sequelize'][_0x5db2('0x76')]({'isolationLevel':db[_0x5db2('0x77')][_0x5db2('0x78')][_0x5db2('0x79')][_0x5db2('0x7a')]},function(_0x471ce9){return db['WhatsappAccount'][_0x5db2('0x65')]({'where':{'id':_0x57950e},'transaction':_0x471ce9})[_0x5db2('0x31')](function(_0x2576fa){if(_0x2576fa){return db[_0x5db2('0x7b')]['destroy']({'where':{'WhatsappAccountId':_0x57950e},'transaction':_0x471ce9})[_0x5db2('0x31')](function(){var _0x549ebf=_['map'](_0x3d3b83,function(_0x2995bf){_0x2995bf[_0x5db2('0x62')]=_0x57950e;return _0x2995bf;});return db[_0x5db2('0x7b')][_0x5db2('0x7c')](_0x549ebf,{'transaction':_0x471ce9});});}else{_0x31a396=0x194;_0x37f917=[];}});})['then'](function(){if(_0x31a396!==0x194){return db[_0x5db2('0x7b')][_0x5db2('0x7d')]({'where':{'WhatsappAccountId':_0x57950e},'order':'priority'})[_0x5db2('0x31')](function(_0x91acab){_0x37f917=_0x91acab;});}})[_0x5db2('0x5d')](function(_0xd18b){_0x31a396=0x1f4;logger[_0x5db2('0x21')](_0xd18b[_0x5db2('0x35')]);if(_0xd18b[_0x5db2('0x36')]){delete _0xd18b[_0x5db2('0x36')];}_0x37f917=_0xd18b;})[_0x5db2('0x7e')](function(){if(_0x37f917===null){_0x33d07[_0x5db2('0x24')](_0x31a396);}else{if(_0x31a396===0x1f4){_0x33d07[_0x5db2('0x25')](_0x31a396)[_0x5db2('0x37')](_0x37f917);}else{_0x33d07[_0x5db2('0x25')](_0x31a396)[_0x5db2('0x7f')](_0x37f917);}}});};exports[_0x5db2('0x80')]=function(_0x2bc7ab,_0x39bb77,_0x29994e){var _0x240468={};var _0x1d92ec={};var _0xe18f41;var _0x2775ab;return db[_0x5db2('0x39')]['findOne']({'where':{'id':_0x2bc7ab[_0x5db2('0x53')]['id']}})['then'](handleEntityNotFound(_0x39bb77,null))[_0x5db2('0x31')](function(_0x299c6c){if(_0x299c6c){_0xe18f41=_0x299c6c;_0x1d92ec['model']=_[_0x5db2('0x3e')](db[_0x5db2('0x7b')][_0x5db2('0x55')]);_0x1d92ec[_0x5db2('0x3f')]=_[_0x5db2('0x3e')](_0x2bc7ab[_0x5db2('0x3f')]);_0x1d92ec[_0x5db2('0x40')]=_['intersection'](_0x1d92ec[_0x5db2('0x3d')],_0x1d92ec[_0x5db2('0x3f')]);_0x240468[_0x5db2('0x42')]=_[_0x5db2('0x41')](_0x1d92ec[_0x5db2('0x3d')],qs[_0x5db2('0x43')](_0x2bc7ab[_0x5db2('0x3f')]['fields']));_0x240468[_0x5db2('0x42')]=_0x240468[_0x5db2('0x42')][_0x5db2('0x44')]?_0x240468[_0x5db2('0x42')]:_0x1d92ec[_0x5db2('0x3d')];_0x240468[_0x5db2('0x47')]=qs[_0x5db2('0x48')](_0x2bc7ab[_0x5db2('0x3f')][_0x5db2('0x48')]);_0x240468[_0x5db2('0x4a')]=qs['filters'](_[_0x5db2('0x49')](_0x2bc7ab[_0x5db2('0x3f')],_0x1d92ec[_0x5db2('0x40')]));if(_0x2bc7ab[_0x5db2('0x3f')][_0x5db2('0x4d')]){_0x240468['where']=_['merge'](_0x240468[_0x5db2('0x4a')],{'$or':_[_0x5db2('0x38')](_0x240468[_0x5db2('0x42')],function(_0x55d967){var _0xec7b69={};_0xec7b69[_0x55d967]={'$like':'%'+_0x2bc7ab[_0x5db2('0x3f')]['filter']+'%'};return _0xec7b69;})});}_0x240468=_[_0x5db2('0x4b')]({},_0x240468,_0x2bc7ab['options']);return _0xe18f41[_0x5db2('0x80')](_0x240468);}})['then'](function(_0xb30978){if(_0xb30978){_0x2775ab=_0xb30978[_0x5db2('0x44')];if(!_0x2bc7ab[_0x5db2('0x3f')][_0x5db2('0x45')](_0x5db2('0x46'))){_0x240468['limit']=qs[_0x5db2('0x29')](_0x2bc7ab[_0x5db2('0x3f')]['limit']);_0x240468['offset']=qs['offset'](_0x2bc7ab['query']['offset']);}return _0xe18f41[_0x5db2('0x80')](_0x240468);}})[_0x5db2('0x31')](function(_0xff5d7a){if(_0xff5d7a){return _0xff5d7a?{'count':_0x2775ab,'rows':_0xff5d7a}:null;}})[_0x5db2('0x31')](respondWithResult(_0x39bb77,null))['catch'](handleError(_0x39bb77,null));};exports[_0x5db2('0x81')]=function(_0x109835,_0x1612c9,_0x26314f){var _0x2b3403={'channel':_0x5db2('0x82')};var _0x161ee1=[];var _0x4794f3=[];var _0x443cb3={};return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x109835[_0x5db2('0x53')]['id']},'include':[{'model':db[_0x5db2('0x7b')],'as':_0x5db2('0x83')}]})[_0x5db2('0x31')](handleEntityNotFound(_0x1612c9,null))[_0x5db2('0x31')](function(_0x404f19){_0x2b3403[_0x5db2('0x84')]=_0x404f19;if(_0x2b3403[_0x5db2('0x84')]&&_0x2b3403['account']['type']===_0x5db2('0x85')&&_0x109835[_0x5db2('0x5f')][_0x5db2('0x86')]){if(_0x109835[_0x5db2('0x5f')][_0x5db2('0x86')][_0x5db2('0x44')]===0x0)return;if(_0x109835[_0x5db2('0x5f')][_0x5db2('0x86')][0x0]['state']!==_0x5db2('0x87'))return;return db['WhatsappMessage'][_0x5db2('0x30')]({'read':!![],'readAt':_0x109835[_0x5db2('0x5f')]['statuses'][0x0][_0x5db2('0x88')]},{'where':{'messageId':_0x109835[_0x5db2('0x5f')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x5db2('0x31')](function(_0x307047){return _0x1612c9[_0x5db2('0x25')](0xc8)[_0x5db2('0x7f')](_0x307047);});}_0x2b3403[_0x5db2('0x89')]=_['orderBy'](_0x404f19['Applications'],[_0x5db2('0x8a')],[_0x5db2('0x8b')]);if(_0x2b3403['account']['Applications']){delete _0x2b3403[_0x5db2('0x84')][_0x5db2('0x83')];}return db[_0x5db2('0x8c')][_0x5db2('0x8d')]()[_0x5db2('0x31')](function(_0x357096){if(!_0x357096){throw new db[(_0x5db2('0x8e'))]['ValidationError'](_0x5db2('0x8f'));}_0x161ee1=_[_0x5db2('0x90')](_[_0x5db2('0x3e')](_0x357096),[_0x5db2('0x91'),_0x5db2('0x92')]);_0x4794f3=_[_0x5db2('0x90')](_[_0x5db2('0x3e')](_0x357096),[_0x5db2('0x91'),_0x5db2('0x92'),_0x5db2('0x93'),_0x5db2('0x94')]);_0x2b3403[_0x5db2('0x5f')]={'mapKey':_0x5db2('0x95')};if(_0x2b3403[_0x5db2('0x84')]&&_0x2b3403['account']['type']===_0x5db2('0x96')){_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x97')]=_0x109835[_0x5db2('0x5f')][_0x5db2('0x98')][_0x5db2('0x99')](_0x5db2('0x9a'),'');_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x5f')]=_0x109835[_0x5db2('0x5f')]['Body'];_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x9b')]=_0x109835['body'][_0x5db2('0x9c')];}if(_0x2b3403[_0x5db2('0x84')]&&_0x2b3403['account'][_0x5db2('0x3b')]==='sinch'){_0x2b3403['body']['from']=_0x109835[_0x5db2('0x5f')][_0x5db2('0x9d')][0x0][_0x5db2('0x97')];_0x2b3403[_0x5db2('0x5f')]['body']=_0x109835['body']['notifications'][0x0]['message']['body'];_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x9b')]=_0x109835[_0x5db2('0x5f')][_0x5db2('0x9d')][0x0][_0x5db2('0x9e')];}if(_0x2b3403[_0x5db2('0x5f')]['id']){delete _0x2b3403['body']['id'];}if(_[_0x5db2('0x9f')](_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x97')])){throw new db[(_0x5db2('0x8e'))]['ValidationError'](_0x5db2('0xa0'));}if(_[_0x5db2('0x9f')](_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x5f')])||_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x5f')]===''){throw new db[(_0x5db2('0x8e'))][(_0x5db2('0xa1'))](_0x5db2('0xa2'));}if(_[_0x5db2('0x9f')](_0x2b3403[_0x5db2('0x5f')][_0x5db2('0xa3')])){throw new db[(_0x5db2('0x8e'))][(_0x5db2('0xa1'))](_0x5db2('0xa4')+_0x4794f3);}if(!_[_0x5db2('0xa5')](_0x4794f3,_0x2b3403[_0x5db2('0x5f')][_0x5db2('0xa3')])){throw new db[(_0x5db2('0x8e'))][(_0x5db2('0xa1'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4794f3);}_0x443cb3[_0x2b3403[_0x5db2('0x5f')][_0x5db2('0xa3')]]=_0x2b3403['body'][_0x5db2('0x97')];return db[_0x5db2('0xa6')][_0x5db2('0x56')]({'where':{'id':_0x2b3403[_0x5db2('0x84')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x5db2('0xa7'),'where':_0x443cb3,'limit':0x1,'order':[[_0x5db2('0x92'),'DESC']]}]});})[_0x5db2('0x31')](handleEntityNotFound(_0x1612c9,null))[_0x5db2('0x31')](function(_0x2eb235){if(_0x2eb235){_0x2b3403[_0x5db2('0xa8')]=_[_0x5db2('0x6e')](_0x2eb235,['Contacts']);if(_0x2eb235[_0x5db2('0xa7')]['length']){return _0x2eb235['Contacts'][0x0];}var _0x190871=_['defaults'](_0x2b3403[_0x5db2('0x5f')],{'firstName':_0x2b3403[_0x5db2('0x5f')]['from'],'ListId':_0x2eb235['id']});_0x190871[_0x2b3403[_0x5db2('0x5f')][_0x5db2('0xa3')]]=_0x2b3403[_0x5db2('0x5f')][_0x5db2('0x97')];return db[_0x5db2('0x8c')]['create'](_0x190871,{'fields':_0x161ee1,'raw':!![]});}})[_0x5db2('0x31')](handleEntityNotFound(_0x1612c9,null))[_0x5db2('0x31')](function(_0x95309c){if(_0x95309c){_0x2b3403[_0x5db2('0xa9')]=_0x95309c;var _0x49b051={'ContactId':_0x95309c['id'],'phone':_0x2b3403['body']['from'],'WhatsappAccountId':_0x109835[_0x5db2('0x53')]['id']};var _0x17a2e5={'ContactId':_0x95309c['id'],'WhatsappAccountId':_0x109835['params']['id'],'closed':![]};return db[_0x5db2('0xaa')]['find']({'where':_0x17a2e5})[_0x5db2('0x31')](function(_0x52a8e2){if(_0x52a8e2){return[_0x52a8e2,![]];}return db[_0x5db2('0xaa')][_0x5db2('0x57')](_0x49b051)[_0x5db2('0x31')](function(_0xa30d70){return[_0xa30d70,!![]];});});}})[_0x5db2('0x6f')](function(_0x5351fb,_0x1069c9){_0x2b3403[_0x5db2('0xab')]=_0x5351fb['get']({'plain':!![]});_0x2b3403[_0x5db2('0xab')][_0x5db2('0xac')]=![];if(_0x1069c9){if(_0x2b3403[_0x5db2('0x84')]['autoclose']){_0x2b3403[_0x5db2('0x89')][_0x5db2('0xad')]({'id':0x0,'priority':_0x2b3403[_0x5db2('0x89')][_0x5db2('0x44')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x5db2('0xae')});}_0x2b3403[_0x5db2('0xab')][_0x5db2('0xac')]=!![];}return db[_0x5db2('0xaf')][_0x5db2('0x57')]({'phone':_0x2b3403['body'][_0x5db2('0x97')],'messageId':_0x2b3403[_0x5db2('0x5f')]['messageId'],'body':_0x2b3403['body']['body'],'WhatsappAccountId':_0x109835[_0x5db2('0x53')]['id'],'WhatsappInteractionId':_0x5351fb['id'],'direction':'in','ContactId':_0x5351fb[_0x5db2('0xb0')],'AttachmentId':_0x2b3403[_0x5db2('0x5f')][_0x5db2('0xb1')]});})[_0x5db2('0x31')](function(_0x2435cc){_0x2b3403[_0x5db2('0x23')]=_0x2435cc;if(_0x2b3403['interaction'][_0x5db2('0xb2')]){return db[_0x5db2('0xb3')][_0x5db2('0x56')]({'attributes':['id','name'],'where':{'id':_0x2b3403[_0x5db2('0xab')][_0x5db2('0xb2')]}})[_0x5db2('0x31')](function(_0x2605cb){if(_0x2605cb){_0x2b3403[_0x5db2('0x89')][_0x5db2('0xb4')]({'id':0x0,'priority':0x0,'app':_0x5db2('0xb5'),'appdata':_0x2605cb[_0x5db2('0x36')]+','+(_0x2b3403[_0x5db2('0x84')][_0x5db2('0xb6')]||0xa),'interval':_0x5db2('0xae')});}return respondWithRpcPromise(_0x5db2('0xb7'),_0x5db2('0xb8'),_0x2b3403);});}return respondWithRpcPromise(_0x5db2('0xb7'),_0x5db2('0xb8'),_0x2b3403);})[_0x5db2('0x31')](function(_0x1bfe95){if(_0x1bfe95){var _0x51672f=0xc8;var _0x507d8a=_0x5db2('0xb9');logger[_0x5db2('0xba')](_0x5db2('0x1f'),_0x507d8a,_0x51672f,_0x5db2('0xbb'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x507d8a,_0x51672f,_0x5db2('0xbb'),JSON[_0x5db2('0x20')](_0x1bfe95));if(_0x2b3403['account'][_0x5db2('0x3b')]===_0x5db2('0x96')){return _0x1612c9[_0x5db2('0x25')](_0x51672f)['set']('Content-Type',_0x5db2('0xbc'))[_0x5db2('0x37')](_0x5db2('0xbd'));}else{return _0x1612c9[_0x5db2('0x25')](_0x51672f)[_0x5db2('0x7f')](_0x1bfe95);}}});})[_0x5db2('0x5d')](handleError(_0x1612c9,null));};exports[_0x5db2('0x37')]=function(_0x36227c,_0x16d637,_0xb7c29b){var _0x10f15a,_0x1a0043,_0x3088c9;if(_[_0x5db2('0x9f')](_0x36227c[_0x5db2('0x5f')][_0x5db2('0x5f')])||_0x36227c['body']['body']===''){throw new db[(_0x5db2('0x8e'))][(_0x5db2('0xa1'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5db2('0x9f')](_0x36227c[_0x5db2('0x5f')]['to'])){throw new db[(_0x5db2('0x8e'))][(_0x5db2('0xa1'))](_0x5db2('0xbe'));}_0x10f15a=_0x36227c[_0x5db2('0x5f')]['to'];return db[_0x5db2('0x39')][_0x5db2('0x56')]({'where':{'id':_0x36227c[_0x5db2('0x53')]['id']},'include':[{'model':db[_0x5db2('0xa6')],'as':'List','include':[{'model':db[_0x5db2('0x8c')],'as':_0x5db2('0xa7'),'where':{'mobile':_0x10f15a},'limit':0x1,'order':[[_0x5db2('0x92'),'DESC']]}]}]})[_0x5db2('0x31')](handleEntityNotFound(_0x16d637,null))['then'](function(_0x379254){if(_0x379254&&_0x379254['List']){_0x1a0043=_0x379254[_0x5db2('0x33')]({'plain':!![]});if(_0x1a0043[_0x5db2('0xbf')]&&_0x1a0043['List']['Contacts']['length']){return _0x1a0043[_0x5db2('0xbf')]['Contacts'][0x0];}return db[_0x5db2('0x8c')][_0x5db2('0x57')](_[_0x5db2('0x16')](_0x36227c['body'],{'firstName':_0x10f15a,'mobile':_0x10f15a,'phone':_0x10f15a,'ListId':_0x1a0043[_0x5db2('0x94')]}));}})['then'](handleEntityNotFound(_0x16d637,null))['then'](function(_0x1ceb7a){if(_0x1ceb7a){_0x3088c9=_0x1ceb7a;return db[_0x5db2('0xaa')]['find']({'where':{'ContactId':_0x3088c9['id'],'closed':![],'WhatsappAccountId':_0x1a0043['id']}})[_0x5db2('0x31')](function(_0x4b6e4){if(_0x4b6e4){return[_0x4b6e4,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x36227c[_0x5db2('0x58')]['id'],'ContactId':_0x3088c9['id'],'WhatsappAccountId':_0x1a0043['id'],'phone':_0x10f15a,'firstMsgDirection':_0x5db2('0xc0'),'Messages':[_[_0x5db2('0x4b')](_0x36227c[_0x5db2('0x5f')],{'read':![],'body':_0x36227c[_0x5db2('0x5f')][_0x5db2('0x5f')],'phone':_0x10f15a,'WhatsappAccountId':_0x1a0043['id'],'UserId':_0x36227c[_0x5db2('0x58')]['id'],'ContactId':_0x3088c9['id']})]},{'include':[{'model':db[_0x5db2('0xaf')],'as':_0x5db2('0xc1')}]})['then'](function(_0x15025a){return[_0x15025a,!![]];});});}})['spread'](function(_0x2a8ad2,_0x360502){if(_0x360502){return _0x2a8ad2;}return db[_0x5db2('0xaf')][_0x5db2('0x57')](_[_0x5db2('0x4b')](_0x36227c['body'],{'read':![],'body':_0x36227c[_0x5db2('0x5f')][_0x5db2('0x5f')],'phone':_0x10f15a,'WhatsappAccountId':_0x1a0043['id'],'WhatsappInteractionId':_0x2a8ad2['id'],'UserId':_0x36227c[_0x5db2('0x58')]['id'],'ContactId':_0x3088c9['id']}))[_0x5db2('0x31')](function(_0x465e60){_0x2a8ad2[_0x5db2('0xc2')][_0x5db2('0xc1')]=[];_0x2a8ad2['dataValues'][_0x5db2('0xc1')][_0x5db2('0xad')](_0x465e60[_0x5db2('0xc2')]);return _0x2a8ad2;});})[_0x5db2('0x31')](respondWithResult(_0x16d637,null))['catch'](handleError(_0x16d637,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 17694fb..fefd41a 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 _0x7cbb=['emit','hook','save','remove'];(function(_0x27d8dc,_0x8398d){var _0x3c824c=function(_0x4ec008){while(--_0x4ec008){_0x27d8dc['push'](_0x27d8dc['shift']());}};_0x3c824c(++_0x8398d);}(_0x7cbb,0x7a));var _0xb7cb=function(_0x467e6c,_0x476048){_0x467e6c=_0x467e6c-0x0;var _0x4a6c03=_0x7cbb[_0x467e6c];return _0x4a6c03;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb7cb('0x0'),'afterUpdate':'update','afterDestroy':_0xb7cb('0x1')};function emitEvent(_0x226b69){return function(_0x1bb0cd,_0x438043,_0x1301ef){WhatsappAccountEvents[_0xb7cb('0x2')](_0x226b69+':'+_0x1bb0cd['id'],_0x1bb0cd);WhatsappAccountEvents['emit'](_0x226b69,_0x1bb0cd);_0x1301ef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xb7cb('0x3')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x7b08=['remove','emit','hook','exports','events','WhatsappAccount','setMaxListeners','save','update'];(function(_0x10e9e7,_0xffa3a2){var _0x2a1547=function(_0x4e8497){while(--_0x4e8497){_0x10e9e7['push'](_0x10e9e7['shift']());}};_0x2a1547(++_0xffa3a2);}(_0x7b08,0x136));var _0x87b0=function(_0xaf6fed,_0x240d6d){_0xaf6fed=_0xaf6fed-0x0;var _0x18bbf9=_0x7b08[_0xaf6fed];return _0x18bbf9;};'use strict';var EventEmitter=require(_0x87b0('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x87b0('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x87b0('0x2')](0x0);var events={'afterCreate':_0x87b0('0x3'),'afterUpdate':_0x87b0('0x4'),'afterDestroy':_0x87b0('0x5')};function emitEvent(_0x3afe90){return function(_0x438f25,_0x2be14a,_0xaa50a8){WhatsappAccountEvents[_0x87b0('0x6')](_0x3afe90+':'+_0x438f25['id'],_0x438f25);WhatsappAccountEvents['emit'](_0x3afe90,_0x438f25);_0xaa50a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x87b0('0x7')](e,emitEvent(event));}}module[_0x87b0('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index df0cb3f..9109092 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 _0xc575=['./whatsappAccount.attributes','define','WhatsappAccount','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2ce6d5,_0x446729){var _0x44aca8=function(_0x36233b){while(--_0x36233b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x44aca8(++_0x446729);}(_0xc575,0x1b0));var _0x5c57=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0xc575[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require(_0x5c57('0x0'));var util=require(_0x5c57('0x1'));var logger=require(_0x5c57('0x2'))(_0x5c57('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5c57('0x4'));var fs=require('fs');var path=require(_0x5c57('0x5'));var rimraf=require(_0x5c57('0x6'));var config=require(_0x5c57('0x7'));var attributes=require(_0x5c57('0x8'));module['exports']=function(_0x2d3294,_0x25daca){return _0x2d3294[_0x5c57('0x9')](_0x5c57('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e64=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x45598f,_0x1649ec){var _0x517e2b=function(_0xd0990e){while(--_0xd0990e){_0x45598f['push'](_0x45598f['shift']());}};_0x517e2b(++_0x1649ec);}(_0x6e64,0x98));var _0x46e6=function(_0x34868d,_0x521d7a){_0x34868d=_0x34868d-0x0;var _0x30e1df=_0x6e64[_0x34868d];return _0x30e1df;};'use strict';var _=require(_0x46e6('0x0'));var util=require(_0x46e6('0x1'));var logger=require('../../config/logger')(_0x46e6('0x2'));var moment=require(_0x46e6('0x3'));var BPromise=require(_0x46e6('0x4'));var rp=require(_0x46e6('0x5'));var fs=require('fs');var path=require(_0x46e6('0x6'));var rimraf=require(_0x46e6('0x7'));var config=require(_0x46e6('0x8'));var attributes=require(_0x46e6('0x9'));module[_0x46e6('0xa')]=function(_0x559807,_0x313031){return _0x559807[_0x46e6('0xb')](_0x46e6('0xc'),attributes,{'tableName':_0x46e6('0xd'),'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 ec0ef57..805498a 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 _0x578f=['ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x578f,0x176));var _0xf578=function(_0xdc5df0,_0x234ae1){_0xdc5df0=_0xdc5df0-0x0;var _0x11edbb=_0x578f[_0xdc5df0];return _0x11edbb;};'use strict';var _=require(_0xf578('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf578('0x1'));var rs=require(_0xf578('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf578('0x3'))['db'];var utils=require(_0xf578('0x4'));var logger=require(_0xf578('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf578('0x6'));var client=jayson['client'][_0xf578('0x7')]({'port':0x232a});config[_0xf578('0x8')]=_['defaults'](config['redis'],{'host':_0xf578('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf578('0x8')]));require(_0xf578('0xa'))['register'](socket);function respondWithRpcPromise(_0x3e81d7,_0x370ce3,_0x2b7227){return new BPromise(function(_0x238038,_0x5d2201){return client[_0xf578('0xb')](_0x3e81d7,_0x2b7227)[_0xf578('0xc')](function(_0x5049b4){logger[_0xf578('0xd')](_0xf578('0xe'),_0x370ce3,'request\x20sent');logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x370ce3,_0xf578('0xf'),JSON[_0xf578('0x10')](_0x5049b4));if(_0x5049b4[_0xf578('0x11')]){if(_0x5049b4[_0xf578('0x11')][_0xf578('0x12')]===0x1f4){logger[_0xf578('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x370ce3,_0x5049b4['error'][_0xf578('0x13')]);return _0x5d2201(_0x5049b4[_0xf578('0x11')][_0xf578('0x13')]);}logger[_0xf578('0x11')](_0xf578('0xe'),_0x370ce3,_0x5049b4[_0xf578('0x11')][_0xf578('0x13')]);return _0x238038(_0x5049b4[_0xf578('0x11')][_0xf578('0x13')]);}else{logger[_0xf578('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x370ce3,_0xf578('0xf'));_0x238038(_0x5049b4[_0xf578('0x14')][_0xf578('0x13')]);}})[_0xf578('0x15')](function(_0x1b3f14){logger[_0xf578('0x11')](_0xf578('0xe'),_0x370ce3,_0x1b3f14);_0x5d2201(_0x1b3f14);});});}exports[_0xf578('0x16')]=function(_0x4114b0){var _0x41d712=this;return new Promise(function(_0x14cc25,_0x101de9){return db[_0xf578('0x17')][_0xf578('0x18')]({'raw':_0x4114b0[_0xf578('0x19')]?_0x4114b0[_0xf578('0x19')][_0xf578('0x1a')]===undefined?!![]:![]:!![],'where':_0x4114b0[_0xf578('0x19')]?_0x4114b0[_0xf578('0x19')][_0xf578('0x1b')]||null:null,'attributes':_0x4114b0['options']?_0x4114b0[_0xf578('0x19')][_0xf578('0x1c')]||null:null,'include':_0x4114b0[_0xf578('0x19')]?_0x4114b0['options'][_0xf578('0x1d')]?_[_0xf578('0x1e')](_0x4114b0[_0xf578('0x19')][_0xf578('0x1d')],function(_0x5648d6){return{'model':db[_0x5648d6[_0xf578('0x1f')]],'as':_0x5648d6['as'],'attributes':_0x5648d6[_0xf578('0x1c')],'include':_0x5648d6[_0xf578('0x1d')]?_['map'](_0x5648d6[_0xf578('0x1d')],function(_0x5d11d2){return{'model':db[_0x5d11d2[_0xf578('0x1f')]],'as':_0x5d11d2['as'],'attributes':_0x5d11d2[_0xf578('0x1c')],'include':_0x5d11d2[_0xf578('0x1d')]?_['map'](_0x5d11d2[_0xf578('0x1d')],function(_0x4cf9a4){return{'model':db[_0x4cf9a4[_0xf578('0x1f')]],'as':_0x4cf9a4['as'],'attributes':_0x4cf9a4[_0xf578('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf578('0xc')](function(_0x253aee){logger[_0xf578('0xd')](_0xf578('0x16'),_0x4114b0);logger[_0xf578('0x20')](_0xf578('0x16'),_0x4114b0,JSON['stringify'](_0x253aee));_0x14cc25(_0x253aee);})[_0xf578('0x15')](function(_0x5235de){logger['error']('ShowWhatsappAccount',_0x5235de[_0xf578('0x13')],_0x4114b0);_0x101de9(_0x41d712[_0xf578('0x11')](0x1f4,_0x5235de['message']));});});}; \ No newline at end of file +var _0xd35b=['include','map','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes'];(function(_0xb47e42,_0x172fbb){var _0xcf673a=function(_0x4fb7e6){while(--_0x4fb7e6){_0xb47e42['push'](_0xb47e42['shift']());}};_0xcf673a(++_0x172fbb);}(_0xd35b,0x8f));var _0xbd35=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xd35b[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xbd35('0x0'));var util=require(_0xbd35('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd35('0x2'));var fs=require('fs');var Redis=require(_0xbd35('0x3'));var db=require(_0xbd35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd35('0x5'))(_0xbd35('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd35('0x7'));var client=jayson[_0xbd35('0x8')][_0xbd35('0x9')]({'port':0x232a});config[_0xbd35('0xa')]=_['defaults'](config['redis'],{'host':_0xbd35('0xb'),'port':0x18eb});var socket=require(_0xbd35('0xc'))(new Redis(config[_0xbd35('0xa')]));require(_0xbd35('0xd'))[_0xbd35('0xe')](socket);function respondWithRpcPromise(_0xbaaea1,_0x4878bf,_0x2fe33d){return new BPromise(function(_0x465f3d,_0x5f1638){return client['request'](_0xbaaea1,_0x2fe33d)[_0xbd35('0xf')](function(_0x11bd0b){logger[_0xbd35('0x10')](_0xbd35('0x11'),_0x4878bf,'request\x20sent');logger[_0xbd35('0x12')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4878bf,_0xbd35('0x13'),JSON[_0xbd35('0x14')](_0x11bd0b));if(_0x11bd0b['error']){if(_0x11bd0b[_0xbd35('0x15')][_0xbd35('0x16')]===0x1f4){logger['error'](_0xbd35('0x11'),_0x4878bf,_0x11bd0b[_0xbd35('0x15')]['message']);return _0x5f1638(_0x11bd0b['error']['message']);}logger[_0xbd35('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x4878bf,_0x11bd0b[_0xbd35('0x15')]['message']);return _0x465f3d(_0x11bd0b[_0xbd35('0x15')][_0xbd35('0x17')]);}else{logger[_0xbd35('0x10')](_0xbd35('0x11'),_0x4878bf,'request\x20sent');_0x465f3d(_0x11bd0b[_0xbd35('0x18')]['message']);}})[_0xbd35('0x19')](function(_0x21a8ca){logger[_0xbd35('0x15')](_0xbd35('0x11'),_0x4878bf,_0x21a8ca);_0x5f1638(_0x21a8ca);});});}exports[_0xbd35('0x1a')]=function(_0x51fcdc){var _0x7a34ff=this;return new Promise(function(_0x1e9894,_0x1f6810){return db[_0xbd35('0x1b')]['find']({'raw':_0x51fcdc[_0xbd35('0x1c')]?_0x51fcdc[_0xbd35('0x1c')][_0xbd35('0x1d')]===undefined?!![]:![]:!![],'where':_0x51fcdc[_0xbd35('0x1c')]?_0x51fcdc[_0xbd35('0x1c')][_0xbd35('0x1e')]||null:null,'attributes':_0x51fcdc['options']?_0x51fcdc[_0xbd35('0x1c')][_0xbd35('0x1f')]||null:null,'include':_0x51fcdc['options']?_0x51fcdc['options'][_0xbd35('0x20')]?_[_0xbd35('0x21')](_0x51fcdc[_0xbd35('0x1c')][_0xbd35('0x20')],function(_0x4d038c){return{'model':db[_0x4d038c[_0xbd35('0x22')]],'as':_0x4d038c['as'],'attributes':_0x4d038c[_0xbd35('0x1f')],'include':_0x4d038c[_0xbd35('0x20')]?_[_0xbd35('0x21')](_0x4d038c[_0xbd35('0x20')],function(_0x1d358e){return{'model':db[_0x1d358e[_0xbd35('0x22')]],'as':_0x1d358e['as'],'attributes':_0x1d358e[_0xbd35('0x1f')],'include':_0x1d358e[_0xbd35('0x20')]?_[_0xbd35('0x21')](_0x1d358e['include'],function(_0x3e7f11){return{'model':db[_0x3e7f11[_0xbd35('0x22')]],'as':_0x3e7f11['as'],'attributes':_0x3e7f11['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd35('0xf')](function(_0x45e4e9){logger['info']('ShowWhatsappAccount',_0x51fcdc);logger[_0xbd35('0x12')](_0xbd35('0x1a'),_0x51fcdc,JSON[_0xbd35('0x14')](_0x45e4e9));_0x1e9894(_0x45e4e9);})[_0xbd35('0x19')](function(_0x45a08f){logger[_0xbd35('0x15')](_0xbd35('0x1a'),_0x45a08f[_0xbd35('0x17')],_0x51fcdc);_0x1f6810(_0x7a34ff['error'](0x1f4,_0x45a08f[_0xbd35('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 93fb572..6a1151e 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 _0x20db=['length','whatsappAccount:','save','remove','update','emit','removeListener','register'];(function(_0xe48a5f,_0xe82edb){var _0x5ea658=function(_0x508efe){while(--_0x508efe){_0xe48a5f['push'](_0xe48a5f['shift']());}};_0x5ea658(++_0xe82edb);}(_0x20db,0x7a));var _0xb20d=function(_0x582598,_0x311dc5){_0x582598=_0x582598-0x0;var _0x1de137=_0x20db[_0x582598];return _0x1de137;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xb20d('0x0'),_0xb20d('0x1'),_0xb20d('0x2')];function createListener(_0x30ffc2,_0x516bf6){return function(_0x52ff42){_0x516bf6[_0xb20d('0x3')](_0x30ffc2,_0x52ff42);};}function removeListener(_0x8863dc,_0x972201){return function(){WhatsappAccountEvents[_0xb20d('0x4')](_0x8863dc,_0x972201);};}exports[_0xb20d('0x5')]=function(_0x1e2c29){for(var _0x545954=0x0,_0x13af0b=events[_0xb20d('0x6')];_0x545954<_0x13af0b;_0x545954++){var _0x4fe5e1=events[_0x545954];var _0x2cb569=createListener(_0xb20d('0x7')+_0x4fe5e1,_0x1e2c29);WhatsappAccountEvents['on'](_0x4fe5e1,_0x2cb569);}}; \ No newline at end of file +var _0x4002=['remove','update','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x2f5bc2,_0x507a96){var _0x3e0794=function(_0x1e8a0a){while(--_0x1e8a0a){_0x2f5bc2['push'](_0x2f5bc2['shift']());}};_0x3e0794(++_0x507a96);}(_0x4002,0x19d));var _0x2400=function(_0x37aa49,_0x3dc581){_0x37aa49=_0x37aa49-0x0;var _0x314833=_0x4002[_0x37aa49];return _0x314833;};'use strict';var WhatsappAccountEvents=require(_0x2400('0x0'));var events=[_0x2400('0x1'),_0x2400('0x2'),_0x2400('0x3')];function createListener(_0xefd005,_0x19fff1){return function(_0x32b348){_0x19fff1['emit'](_0xefd005,_0x32b348);};}function removeListener(_0x5e086a,_0x276023){return function(){WhatsappAccountEvents['removeListener'](_0x5e086a,_0x276023);};}exports['register']=function(_0x78834){for(var _0x1a1d99=0x0,_0x9e8f1b=events['length'];_0x1a1d99<_0x9e8f1b;_0x1a1d99++){var _0x5158c9=events[_0x1a1d99];var _0x5528c0=createListener(_0x2400('0x4')+_0x5158c9,_0x78834);WhatsappAccountEvents['on'](_0x5158c9,_0x5528c0);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ae9cd66..1e90274 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 _0x342c=['express','fs-extra','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer','util'];(function(_0x472ad6,_0x5af854){var _0x49665b=function(_0x2efe96){while(--_0x2efe96){_0x472ad6['push'](_0x472ad6['shift']());}};_0x49665b(++_0x5af854);}(_0x342c,0x108));var _0xc342=function(_0x372df5,_0x5c18c6){_0x372df5=_0x372df5-0x0;var _0x3aafb1=_0x342c[_0x372df5];return _0x3aafb1;};'use strict';var multer=require(_0xc342('0x0'));var util=require(_0xc342('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc342('0x2'));var router=express['Router']();var fs_extra=require(_0xc342('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc342('0x4'));router[_0xc342('0x5')]('/',auth[_0xc342('0x6')](),controller[_0xc342('0x7')]);router[_0xc342('0x5')](_0xc342('0x8'),auth[_0xc342('0x6')](),controller['show']);router[_0xc342('0x9')]('/',auth[_0xc342('0x6')](),controller[_0xc342('0xa')]);router[_0xc342('0xb')](_0xc342('0x8'),auth[_0xc342('0x6')](),controller['update']);router['delete'](_0xc342('0x8'),auth[_0xc342('0x6')](),controller[_0xc342('0xc')]);module[_0xc342('0xd')]=router; \ No newline at end of file +var _0xd1f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x386e88,_0x26ac2e){var _0x2b3208=function(_0x42b498){while(--_0x42b498){_0x386e88['push'](_0x386e88['shift']());}};_0x2b3208(++_0x26ac2e);}(_0xd1f5,0x12b));var _0x5d1f=function(_0x529bab,_0x29314f){_0x529bab=_0x529bab-0x0;var _0xb2dc0e=_0xd1f5[_0x529bab];return _0xb2dc0e;};'use strict';var multer=require('multer');var util=require(_0x5d1f('0x0'));var path=require(_0x5d1f('0x1'));var timeout=require(_0x5d1f('0x2'));var express=require(_0x5d1f('0x3'));var router=express[_0x5d1f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5d1f('0x5'));var interaction=require(_0x5d1f('0x6'));var config=require(_0x5d1f('0x7'));var controller=require('./whatsappApplication.controller');router[_0x5d1f('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d1f('0x9')]);router['get']('/:id',auth[_0x5d1f('0xa')](),controller[_0x5d1f('0xb')]);router[_0x5d1f('0xc')]('/',auth[_0x5d1f('0xa')](),controller[_0x5d1f('0xd')]);router[_0x5d1f('0xe')](_0x5d1f('0xf'),auth[_0x5d1f('0xa')](),controller[_0x5d1f('0x10')]);router[_0x5d1f('0x11')](_0x5d1f('0xf'),auth[_0x5d1f('0xa')](),controller[_0x5d1f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 62c74a3..61087f1 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 _0xf637=['STRING','noop','sequelize','exports','INTEGER'];(function(_0x26a396,_0x167fc0){var _0x5cb800=function(_0x502f1b){while(--_0x502f1b){_0x26a396['push'](_0x26a396['shift']());}};_0x5cb800(++_0x167fc0);}(_0xf637,0x179));var _0x7f63=function(_0x3340b6,_0x6e5537){_0x3340b6=_0x3340b6-0x0;var _0x23f973=_0xf637[_0x3340b6];return _0x23f973;};'use strict';var Sequelize=require(_0x7f63('0x0'));module[_0x7f63('0x1')]={'priority':{'type':Sequelize[_0x7f63('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7f63('0x3')],'allowNull':![],'defaultValue':_0x7f63('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7f63('0x3')]},'interval':{'type':Sequelize[_0x7f63('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1388=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x245f78,_0xa3d26a){var _0x2eeb95=function(_0x3e8a4b){while(--_0x3e8a4b){_0x245f78['push'](_0x245f78['shift']());}};_0x2eeb95(++_0xa3d26a);}(_0x1388,0xf2));var _0x8138=function(_0x1c66d8,_0x16d85d){_0x1c66d8=_0x1c66d8-0x0;var _0xf1cc0a=_0x1388[_0x1c66d8];return _0xf1cc0a;};'use strict';var Sequelize=require(_0x8138('0x0'));module[_0x8138('0x1')]={'priority':{'type':Sequelize[_0x8138('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8138('0x3')],'allowNull':![],'defaultValue':_0x8138('0x4')},'appdata':{'type':Sequelize[_0x8138('0x5')]()},'description':{'type':Sequelize[_0x8138('0x3')]},'interval':{'type':Sequelize[_0x8138('0x3')],'defaultValue':_0x8138('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 036a948..fe0be14 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 _0x5360=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/logger','api'];(function(_0x40f658,_0x570a83){var _0x5ea1d7=function(_0x25cd06){while(--_0x25cd06){_0x40f658['push'](_0x40f658['shift']());}};_0x5ea1d7(++_0x570a83);}(_0x5360,0x157));var _0x0536=function(_0x372c5d,_0x6721ff){_0x372c5d=_0x372c5d-0x0;var _0x52994c=_0x5360[_0x372c5d];return _0x52994c;};'use strict';var emlformat=require(_0x0536('0x0'));var rimraf=require(_0x0536('0x1'));var zipdir=require(_0x0536('0x2'));var jsonpatch=require(_0x0536('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0536('0x4'));var Mustache=require('mustache');var util=require(_0x0536('0x5'));var path=require(_0x0536('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0536('0x7'));var _=require(_0x0536('0x8'));var squel=require(_0x0536('0x9'));var crypto=require(_0x0536('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0536('0xb'));var toCsv=require(_0x0536('0xc'));var querystring=require(_0x0536('0xd'));var Papa=require('papaparse');var Redis=require(_0x0536('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0536('0xf'))(_0x0536('0x10'));var utils=require(_0x0536('0x11'));var config=require(_0x0536('0x12'));var licenseUtil=require(_0x0536('0x13'));var db=require(_0x0536('0x14'))['db'];function respondWithStatusCode(_0x69f430,_0x3bacec){_0x3bacec=_0x3bacec||0xcc;return function(_0x46da69){if(_0x46da69){return _0x69f430[_0x0536('0x15')](_0x3bacec);}return _0x69f430[_0x0536('0x16')](_0x3bacec)[_0x0536('0x17')]();};}function respondWithResult(_0x355189,_0x543134){_0x543134=_0x543134||0xc8;return function(_0x29123b){if(_0x29123b){return _0x355189[_0x0536('0x16')](_0x543134)[_0x0536('0x18')](_0x29123b);}};}function respondWithFilteredResult(_0x4720c2,_0x4723a3){return function(_0x58dddc){if(_0x58dddc){var _0x3d6b68=typeof _0x4723a3[_0x0536('0x19')]===_0x0536('0x1a')&&typeof _0x4723a3[_0x0536('0x1b')]==='undefined';var _0x4e4076=_0x58dddc[_0x0536('0x1c')];var _0x25fb28=_0x3d6b68?0x0:_0x4723a3[_0x0536('0x19')];var _0x5c676c=_0x3d6b68?_0x58dddc['count']:_0x4723a3[_0x0536('0x19')]+_0x4723a3[_0x0536('0x1b')];var _0x506de2;if(_0x5c676c>=_0x4e4076){_0x5c676c=_0x4e4076;_0x506de2=0xc8;}else{_0x506de2=0xce;}_0x4720c2[_0x0536('0x16')](_0x506de2);return _0x4720c2[_0x0536('0x1d')](_0x0536('0x1e'),_0x25fb28+'-'+_0x5c676c+'/'+_0x4e4076)[_0x0536('0x18')](_0x58dddc);}return null;};}function patchUpdates(_0x3e1d66){return function(_0x52bcd8){try{jsonpatch[_0x0536('0x1f')](_0x52bcd8,_0x3e1d66,!![]);}catch(_0x51ba52){return BPromise['reject'](_0x51ba52);}return _0x52bcd8[_0x0536('0x20')]();};}function saveUpdates(_0x15e3f2,_0x21c094){return function(_0x2f5ebd){if(_0x2f5ebd){return _0x2f5ebd[_0x0536('0x21')](_0x15e3f2)[_0x0536('0x22')](function(_0x272008){return _0x272008;});}return null;};}function removeEntity(_0x4bfec1,_0x475b87){return function(_0x3e3542){if(_0x3e3542){return _0x3e3542['destroy']()[_0x0536('0x22')](function(){_0x4bfec1[_0x0536('0x16')](0xcc)[_0x0536('0x17')]();});}};}function handleEntityNotFound(_0x4e3287,_0x32a0d6){return function(_0x290701){if(!_0x290701){_0x4e3287[_0x0536('0x15')](0x194);}return _0x290701;};}function handleError(_0x597693,_0x122cc5){_0x122cc5=_0x122cc5||0x1f4;return function(_0x334b46){logger[_0x0536('0x23')](_0x334b46[_0x0536('0x24')]);if(_0x334b46[_0x0536('0x25')]){delete _0x334b46[_0x0536('0x25')];}_0x597693[_0x0536('0x16')](_0x122cc5)[_0x0536('0x26')](_0x334b46);};}exports[_0x0536('0x27')]=function(_0x2e3ab1,_0x5f4b92){var _0x2ab6dd={},_0x36d4d7={},_0x4d8c31={'count':0x0,'rows':[]};var _0x3be6c1=_[_0x0536('0x28')](db[_0x0536('0x29')][_0x0536('0x2a')],function(_0x52f8d9){return{'name':_0x52f8d9[_0x0536('0x2b')],'type':_0x52f8d9['type']['key']};});_0x36d4d7[_0x0536('0x2c')]=_[_0x0536('0x28')](_0x3be6c1,_0x0536('0x25'));_0x36d4d7[_0x0536('0x2d')]=_[_0x0536('0x2e')](_0x2e3ab1[_0x0536('0x2d')]);_0x36d4d7['filters']=_[_0x0536('0x2f')](_0x36d4d7[_0x0536('0x2c')],_0x36d4d7['query']);_0x2ab6dd[_0x0536('0x30')]=_['intersection'](_0x36d4d7[_0x0536('0x2c')],qs[_0x0536('0x31')](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x31')]));_0x2ab6dd[_0x0536('0x30')]=_0x2ab6dd[_0x0536('0x30')]['length']?_0x2ab6dd[_0x0536('0x30')]:_0x36d4d7['model'];if(!_0x2e3ab1['query'][_0x0536('0x32')](_0x0536('0x33'))){_0x2ab6dd[_0x0536('0x1b')]=qs['limit'](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x1b')]);_0x2ab6dd[_0x0536('0x19')]=qs[_0x0536('0x19')](_0x2e3ab1[_0x0536('0x2d')]['offset']);}_0x2ab6dd[_0x0536('0x34')]=qs[_0x0536('0x35')](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x35')]);_0x2ab6dd[_0x0536('0x36')]=qs['filters'](_[_0x0536('0x37')](_0x2e3ab1['query'],_0x36d4d7[_0x0536('0x38')]),_0x3be6c1);if(_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x39')]){_0x2ab6dd['where']=_[_0x0536('0x3a')](_0x2ab6dd[_0x0536('0x36')],{'$or':_[_0x0536('0x28')](_0x3be6c1,function(_0x2e2aee){if(_0x2e2aee['type']!==_0x0536('0x3b')){var _0x2d6b27={};_0x2d6b27[_0x2e2aee['name']]={'$like':'%'+_0x2e3ab1[_0x0536('0x2d')]['filter']+'%'};return _0x2d6b27;}})});}_0x2ab6dd=_['merge']({},_0x2ab6dd,_0x2e3ab1[_0x0536('0x3c')]);var _0x17fad0={'where':_0x2ab6dd[_0x0536('0x36')]};return db['WhatsappApplication']['count'](_0x17fad0)['then'](function(_0x46a1b5){_0x4d8c31[_0x0536('0x1c')]=_0x46a1b5;if(_0x2e3ab1['query'][_0x0536('0x3d')]){_0x2ab6dd[_0x0536('0x3e')]=[{'all':!![]}];}return db[_0x0536('0x29')][_0x0536('0x3f')](_0x2ab6dd);})['then'](function(_0x23aae3){_0x4d8c31[_0x0536('0x40')]=_0x23aae3;return _0x4d8c31;})[_0x0536('0x22')](respondWithFilteredResult(_0x5f4b92,_0x2ab6dd))[_0x0536('0x41')](handleError(_0x5f4b92,null));};exports[_0x0536('0x42')]=function(_0x267e82,_0x413e20){var _0x2560c0={'raw':!![],'where':{'id':_0x267e82[_0x0536('0x43')]['id']}},_0x5e4580={};_0x5e4580[_0x0536('0x2c')]=_[_0x0536('0x2e')](db['WhatsappApplication'][_0x0536('0x2a')]);_0x5e4580[_0x0536('0x2d')]=_[_0x0536('0x2e')](_0x267e82[_0x0536('0x2d')]);_0x5e4580[_0x0536('0x38')]=_['intersection'](_0x5e4580[_0x0536('0x2c')],_0x5e4580[_0x0536('0x2d')]);_0x2560c0['attributes']=_[_0x0536('0x2f')](_0x5e4580[_0x0536('0x2c')],qs[_0x0536('0x31')](_0x267e82[_0x0536('0x2d')][_0x0536('0x31')]));_0x2560c0[_0x0536('0x30')]=_0x2560c0[_0x0536('0x30')]['length']?_0x2560c0['attributes']:_0x5e4580[_0x0536('0x2c')];if(_0x267e82[_0x0536('0x2d')][_0x0536('0x3d')]){_0x2560c0[_0x0536('0x3e')]=[{'all':!![]}];}_0x2560c0=_[_0x0536('0x3a')]({},_0x2560c0,_0x267e82[_0x0536('0x3c')]);return db[_0x0536('0x29')][_0x0536('0x44')](_0x2560c0)['then'](handleEntityNotFound(_0x413e20,null))[_0x0536('0x22')](respondWithResult(_0x413e20,null))[_0x0536('0x41')](handleError(_0x413e20,null));};exports['create']=function(_0x1c455d,_0x5674ed){return db[_0x0536('0x29')][_0x0536('0x45')](_0x1c455d['body'],{})['then'](respondWithResult(_0x5674ed,0xc9))[_0x0536('0x41')](handleError(_0x5674ed,null));};exports[_0x0536('0x21')]=function(_0xebf186,_0x3e25ef){if(_0xebf186[_0x0536('0x46')]['id']){delete _0xebf186[_0x0536('0x46')]['id'];}return db[_0x0536('0x29')][_0x0536('0x44')]({'where':{'id':_0xebf186[_0x0536('0x43')]['id']}})[_0x0536('0x22')](handleEntityNotFound(_0x3e25ef,null))[_0x0536('0x22')](saveUpdates(_0xebf186[_0x0536('0x46')],null))[_0x0536('0x22')](respondWithResult(_0x3e25ef,null))['catch'](handleError(_0x3e25ef,null));};exports[_0x0536('0x47')]=function(_0x16ece5,_0x21cd8d){return db['WhatsappApplication'][_0x0536('0x44')]({'where':{'id':_0x16ece5[_0x0536('0x43')]['id']}})[_0x0536('0x22')](handleEntityNotFound(_0x21cd8d,null))[_0x0536('0x22')](removeEntity(_0x21cd8d,null))[_0x0536('0x41')](handleError(_0x21cd8d,null));}; \ No newline at end of file +var _0xf55c=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','destroy','then','name','index','map','WhatsappApplication','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','options','find','body','eml-format','zip-dir','fast-json-patch'];(function(_0x133946,_0x54db1d){var _0x693c7c=function(_0x3a41f9){while(--_0x3a41f9){_0x133946['push'](_0x133946['shift']());}};_0x693c7c(++_0x54db1d);}(_0xf55c,0x1e7));var _0xcf55=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xf55c[_0x12d033];return _0x3b4e80;};'use strict';var emlformat=require(_0xcf55('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf55('0x1'));var jsonpatch=require(_0xcf55('0x2'));var rp=require(_0xcf55('0x3'));var moment=require(_0xcf55('0x4'));var BPromise=require(_0xcf55('0x5'));var Mustache=require(_0xcf55('0x6'));var util=require(_0xcf55('0x7'));var path=require('path');var sox=require(_0xcf55('0x8'));var csv=require(_0xcf55('0x9'));var ejs=require(_0xcf55('0xa'));var fs=require('fs');var fs_extra=require(_0xcf55('0xb'));var _=require('lodash');var squel=require(_0xcf55('0xc'));var crypto=require(_0xcf55('0xd'));var jsforce=require(_0xcf55('0xe'));var deskjs=require(_0xcf55('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf55('0x10'));var Papa=require(_0xcf55('0x11'));var Redis=require(_0xcf55('0x12'));var authService=require(_0xcf55('0x13'));var qs=require(_0xcf55('0x14'));var as=require(_0xcf55('0x15'));var hardwareService=require(_0xcf55('0x16'));var logger=require('../../config/logger')(_0xcf55('0x17'));var utils=require(_0xcf55('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcf55('0x19'))['db'];function respondWithStatusCode(_0x7cf19f,_0x742392){_0x742392=_0x742392||0xcc;return function(_0x46fa7a){if(_0x46fa7a){return _0x7cf19f[_0xcf55('0x1a')](_0x742392);}return _0x7cf19f[_0xcf55('0x1b')](_0x742392)[_0xcf55('0x1c')]();};}function respondWithResult(_0x32f03f,_0x111e5e){_0x111e5e=_0x111e5e||0xc8;return function(_0x40d4fe){if(_0x40d4fe){return _0x32f03f[_0xcf55('0x1b')](_0x111e5e)[_0xcf55('0x1d')](_0x40d4fe);}};}function respondWithFilteredResult(_0x547a5a,_0x410f47){return function(_0xfba091){if(_0xfba091){var _0x26c004=typeof _0x410f47[_0xcf55('0x1e')]===_0xcf55('0x1f')&&typeof _0x410f47['limit']===_0xcf55('0x1f');var _0x4a7a55=_0xfba091[_0xcf55('0x20')];var _0xeed93=_0x26c004?0x0:_0x410f47[_0xcf55('0x1e')];var _0x52195b=_0x26c004?_0xfba091[_0xcf55('0x20')]:_0x410f47['offset']+_0x410f47[_0xcf55('0x21')];var _0x1511ba;if(_0x52195b>=_0x4a7a55){_0x52195b=_0x4a7a55;_0x1511ba=0xc8;}else{_0x1511ba=0xce;}_0x547a5a[_0xcf55('0x1b')](_0x1511ba);return _0x547a5a['set']('Content-Range',_0xeed93+'-'+_0x52195b+'/'+_0x4a7a55)['json'](_0xfba091);}return null;};}function patchUpdates(_0x4562af){return function(_0x9cd5d5){try{jsonpatch[_0xcf55('0x22')](_0x9cd5d5,_0x4562af,!![]);}catch(_0x5df9e9){return BPromise[_0xcf55('0x23')](_0x5df9e9);}return _0x9cd5d5[_0xcf55('0x24')]();};}function saveUpdates(_0x5630ff,_0x4ad708){return function(_0x1283cc){if(_0x1283cc){return _0x1283cc[_0xcf55('0x25')](_0x5630ff)['then'](function(_0x1891d1){return _0x1891d1;});}return null;};}function removeEntity(_0x6dbf56,_0x1bb5cf){return function(_0x3c0723){if(_0x3c0723){return _0x3c0723[_0xcf55('0x26')]()[_0xcf55('0x27')](function(){_0x6dbf56[_0xcf55('0x1b')](0xcc)[_0xcf55('0x1c')]();});}};}function handleEntityNotFound(_0x524828,_0x37e734){return function(_0x51df33){if(!_0x51df33){_0x524828[_0xcf55('0x1a')](0x194);}return _0x51df33;};}function handleError(_0x1ecc93,_0x3c08f7){_0x3c08f7=_0x3c08f7||0x1f4;return function(_0x51471f){logger['error'](_0x51471f['stack']);if(_0x51471f[_0xcf55('0x28')]){delete _0x51471f[_0xcf55('0x28')];}_0x1ecc93['status'](_0x3c08f7)['send'](_0x51471f);};}exports[_0xcf55('0x29')]=function(_0x4a81cc,_0xeddf9){var _0x4128c0={},_0x1f9ed9={},_0xb98b74={'count':0x0,'rows':[]};var _0x2540c7=_[_0xcf55('0x2a')](db[_0xcf55('0x2b')]['rawAttributes'],function(_0x163f5f){return{'name':_0x163f5f['fieldName'],'type':_0x163f5f[_0xcf55('0x2c')][_0xcf55('0x2d')]};});_0x1f9ed9[_0xcf55('0x2e')]=_['map'](_0x2540c7,_0xcf55('0x28'));_0x1f9ed9[_0xcf55('0x2f')]=_[_0xcf55('0x30')](_0x4a81cc[_0xcf55('0x2f')]);_0x1f9ed9['filters']=_[_0xcf55('0x31')](_0x1f9ed9['model'],_0x1f9ed9['query']);_0x4128c0['attributes']=_[_0xcf55('0x31')](_0x1f9ed9['model'],qs['fields'](_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x32')]));_0x4128c0['attributes']=_0x4128c0[_0xcf55('0x33')][_0xcf55('0x34')]?_0x4128c0['attributes']:_0x1f9ed9['model'];if(!_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x35')](_0xcf55('0x36'))){_0x4128c0[_0xcf55('0x21')]=qs['limit'](_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x21')]);_0x4128c0[_0xcf55('0x1e')]=qs[_0xcf55('0x1e')](_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x1e')]);}_0x4128c0['order']=qs[_0xcf55('0x37')](_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x37')]);_0x4128c0[_0xcf55('0x38')]=qs['filters'](_[_0xcf55('0x39')](_0x4a81cc[_0xcf55('0x2f')],_0x1f9ed9['filters']),_0x2540c7);if(_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x3a')]){_0x4128c0[_0xcf55('0x38')]=_[_0xcf55('0x3b')](_0x4128c0[_0xcf55('0x38')],{'$or':_[_0xcf55('0x2a')](_0x2540c7,function(_0x1ce402){if(_0x1ce402[_0xcf55('0x2c')]!==_0xcf55('0x3c')){var _0x44df88={};_0x44df88[_0x1ce402['name']]={'$like':'%'+_0x4a81cc[_0xcf55('0x2f')][_0xcf55('0x3a')]+'%'};return _0x44df88;}})});}_0x4128c0=_[_0xcf55('0x3b')]({},_0x4128c0,_0x4a81cc['options']);var _0x47d7da={'where':_0x4128c0[_0xcf55('0x38')]};return db[_0xcf55('0x2b')][_0xcf55('0x20')](_0x47d7da)['then'](function(_0x113949){_0xb98b74['count']=_0x113949;if(_0x4a81cc['query'][_0xcf55('0x3d')]){_0x4128c0[_0xcf55('0x3e')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xcf55('0x3f')](_0x4128c0);})[_0xcf55('0x27')](function(_0x5349e7){_0xb98b74['rows']=_0x5349e7;return _0xb98b74;})[_0xcf55('0x27')](respondWithFilteredResult(_0xeddf9,_0x4128c0))[_0xcf55('0x40')](handleError(_0xeddf9,null));};exports['show']=function(_0x43ac3d,_0x38f079){var _0x18a918={'raw':!![],'where':{'id':_0x43ac3d[_0xcf55('0x41')]['id']}},_0x386c57={};_0x386c57['model']=_[_0xcf55('0x30')](db['WhatsappApplication'][_0xcf55('0x42')]);_0x386c57[_0xcf55('0x2f')]=_[_0xcf55('0x30')](_0x43ac3d[_0xcf55('0x2f')]);_0x386c57['filters']=_['intersection'](_0x386c57[_0xcf55('0x2e')],_0x386c57[_0xcf55('0x2f')]);_0x18a918[_0xcf55('0x33')]=_[_0xcf55('0x31')](_0x386c57['model'],qs[_0xcf55('0x32')](_0x43ac3d['query']['fields']));_0x18a918[_0xcf55('0x33')]=_0x18a918[_0xcf55('0x33')][_0xcf55('0x34')]?_0x18a918[_0xcf55('0x33')]:_0x386c57[_0xcf55('0x2e')];if(_0x43ac3d[_0xcf55('0x2f')][_0xcf55('0x3d')]){_0x18a918['include']=[{'all':!![]}];}_0x18a918=_['merge']({},_0x18a918,_0x43ac3d[_0xcf55('0x43')]);return db[_0xcf55('0x2b')][_0xcf55('0x44')](_0x18a918)[_0xcf55('0x27')](handleEntityNotFound(_0x38f079,null))[_0xcf55('0x27')](respondWithResult(_0x38f079,null))[_0xcf55('0x40')](handleError(_0x38f079,null));};exports['create']=function(_0xebc7c2,_0x41d4a5){return db[_0xcf55('0x2b')]['create'](_0xebc7c2[_0xcf55('0x45')],{})[_0xcf55('0x27')](respondWithResult(_0x41d4a5,0xc9))['catch'](handleError(_0x41d4a5,null));};exports['update']=function(_0x9859f,_0x6db4b5){if(_0x9859f[_0xcf55('0x45')]['id']){delete _0x9859f[_0xcf55('0x45')]['id'];}return db[_0xcf55('0x2b')]['find']({'where':{'id':_0x9859f[_0xcf55('0x41')]['id']}})[_0xcf55('0x27')](handleEntityNotFound(_0x6db4b5,null))[_0xcf55('0x27')](saveUpdates(_0x9859f[_0xcf55('0x45')],null))[_0xcf55('0x27')](respondWithResult(_0x6db4b5,null))['catch'](handleError(_0x6db4b5,null));};exports[_0xcf55('0x26')]=function(_0x5a5d6d,_0x50072f){return db[_0xcf55('0x2b')][_0xcf55('0x44')]({'where':{'id':_0x5a5d6d[_0xcf55('0x41')]['id']}})[_0xcf55('0x27')](handleEntityNotFound(_0x50072f,null))[_0xcf55('0x27')](removeEntity(_0x50072f,null))['catch'](handleError(_0x50072f,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 4c58399..c4c962a 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 _0x6ff1=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x6ff1,0x10a));var _0x16ff=function(_0x2c59f7,_0x1cf83b){_0x2c59f7=_0x2c59f7-0x0;var _0x19e5be=_0x6ff1[_0x2c59f7];return _0x19e5be;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var logger=require(_0x16ff('0x2'))(_0x16ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x16ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16ff('0x5'));var config=require(_0x16ff('0x6'));var attributes=require(_0x16ff('0x7'));module[_0x16ff('0x8')]=function(_0x5325dd,_0x4f3752){return _0x5325dd['define']('WhatsappApplication',attributes,{'tableName':_0x16ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x16ff('0xa'),'collate':_0x16ff('0xb')});}; \ No newline at end of file +var _0x8a28=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a28,0xfd));var _0x88a2=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x8a28[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var logger=require(_0x88a2('0x2'))(_0x88a2('0x3'));var moment=require(_0x88a2('0x4'));var BPromise=require(_0x88a2('0x5'));var rp=require(_0x88a2('0x6'));var fs=require('fs');var path=require(_0x88a2('0x7'));var rimraf=require('rimraf');var config=require(_0x88a2('0x8'));var attributes=require(_0x88a2('0x9'));module[_0x88a2('0xa')]=function(_0x438e32,_0x29ce92){return _0x438e32['define'](_0x88a2('0xb'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88a2('0xc'),'collate':_0x88a2('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 6a8b1f5..bd25552 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 _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3c54d3,_0x9719e3){var _0xd67c8f=function(_0x4be75d){while(--_0x4be75d){_0x3c54d3['push'](_0x3c54d3['shift']());}};_0xd67c8f(++_0x9719e3);}(_0x84ab,0x12f));var _0xb84a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x84ab[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc496,_0xd445b5,_0x4fac4d){return new BPromise(function(_0x3e9086,_0x8d9dbe){return client['request'](_0x4dc496,_0x4fac4d)[_0xb84a('0xa')](function(_0x525cb7){logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,_0xb84a('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xd445b5,'request\x20sent',JSON[_0xb84a('0xe')](_0x525cb7));if(_0x525cb7[_0xb84a('0xf')]){if(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x10')]===0x1f4){logger[_0xb84a('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x8d9dbe(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x3e9086(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}else{logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,'request\x20sent');_0x3e9086(_0x525cb7[_0xb84a('0x12')][_0xb84a('0x11')]);}})[_0xb84a('0x13')](function(_0x3c0b54){logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x3c0b54);_0x8d9dbe(_0x3c0b54);});});} \ No newline at end of file +var _0x0e85=['bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x357552,_0x280f83){var _0xa10009=function(_0x11f658){while(--_0x11f658){_0x357552['push'](_0x357552['shift']());}};_0xa10009(++_0x280f83);}(_0x0e85,0x7c));var _0x50e8=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x0e85[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var moment=require('moment');var BPromise=require(_0x50e8('0x2'));var rs=require(_0x50e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x50e8('0x4'))('rpc');var config=require(_0x50e8('0x5'));var jayson=require(_0x50e8('0x6'));var client=jayson[_0x50e8('0x7')][_0x50e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b01,_0x3ce904,_0x108edc){return new BPromise(function(_0x42665e,_0x988da0){return client[_0x50e8('0x9')](_0x5e8b01,_0x108edc)[_0x50e8('0xa')](function(_0x5825f5){logger[_0x50e8('0xb')](_0x50e8('0xc'),_0x3ce904,_0x50e8('0xd'));logger[_0x50e8('0xe')](_0x50e8('0xf'),_0x3ce904,_0x50e8('0xd'),JSON[_0x50e8('0x10')](_0x5825f5));if(_0x5825f5[_0x50e8('0x11')]){if(_0x5825f5['error']['code']===0x1f4){logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error']['message']);return _0x988da0(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}logger[_0x50e8('0x11')](_0x50e8('0xc'),_0x3ce904,_0x5825f5['error'][_0x50e8('0x12')]);return _0x42665e(_0x5825f5[_0x50e8('0x11')][_0x50e8('0x12')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x50e8('0xd'));_0x42665e(_0x5825f5[_0x50e8('0x13')][_0x50e8('0x12')]);}})[_0x50e8('0x14')](function(_0x211731){logger[_0x50e8('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x3ce904,_0x211731);_0x988da0(_0x211731);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index d396535..7572d11 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 _0x6657=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe'];(function(_0x4627ef,_0x3a385f){var _0x16ca04=function(_0x29c71f){while(--_0x29c71f){_0x4627ef['push'](_0x4627ef['shift']());}};_0x16ca04(++_0x3a385f);}(_0x6657,0x17f));var _0x7665=function(_0x393f62,_0x4dfe05){_0x393f62=_0x393f62-0x0;var _0xdd72e0=_0x6657[_0x393f62];return _0xdd72e0;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7665('0x5'));var interaction=require(_0x7665('0x6'));var config=require(_0x7665('0x7'));var controller=require(_0x7665('0x8'));router[_0x7665('0x9')]('/',auth[_0x7665('0xa')](),controller[_0x7665('0xb')]);router[_0x7665('0x9')]('/describe',auth[_0x7665('0xa')](),controller[_0x7665('0xc')]);router[_0x7665('0x9')](_0x7665('0xd'),auth[_0x7665('0xa')](),controller[_0x7665('0xe')]);router[_0x7665('0x9')](_0x7665('0xf'),auth['isAuthenticated'](),controller[_0x7665('0x10')]);router[_0x7665('0x9')](_0x7665('0x11'),auth['isAuthenticated'](),controller[_0x7665('0x12')]);router['post']('/',auth[_0x7665('0xa')](),controller[_0x7665('0x13')]);router['post'](_0x7665('0xf'),auth[_0x7665('0xa')](),controller['addMessage']);router[_0x7665('0x14')](_0x7665('0x15'),auth['isAuthenticated'](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x18')),controller[_0x7665('0x19')]);router[_0x7665('0x1a')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x1b')),controller[_0x7665('0x1c')]);router[_0x7665('0x1d')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),'whatsappinteraction:destroy'),controller[_0x7665('0x1e')]);router[_0x7665('0x1d')]('/:id/tags',auth[_0x7665('0xa')](),controller[_0x7665('0x1f')]);module[_0x7665('0x20')]=router; \ No newline at end of file +var _0xb4c7=['post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','create'];(function(_0x284b22,_0x1e0f2c){var _0x261e08=function(_0x167b12){while(--_0x167b12){_0x284b22['push'](_0x284b22['shift']());}};_0x261e08(++_0x1e0f2c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x201bfb,_0x2712a1){_0x201bfb=_0x201bfb-0x0;var _0x298760=_0xb4c7[_0x201bfb];return _0x298760;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0xc')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0xc')](_0x7b4c('0x12'),auth[_0x7b4c('0xa')](),controller['download']);router['post']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x14')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x15')]);router[_0x7b4c('0x14')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x18')),controller[_0x7b4c('0x19')]);router[_0x7b4c('0x1a')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')](_0x7b4c('0x1b'),_0x7b4c('0x1c')),controller['update']);router[_0x7b4c('0x1d')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x1e')),controller[_0x7b4c('0x1f')]);router[_0x7b4c('0x1d')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x20')]);module[_0x7b4c('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index f48f3bb..26f4a8f 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 _0x2d17=['BOOLEAN','DATE','STRING','ENUM','sequelize','moment'];(function(_0xa47f3e,_0x574552){var _0x8fe6cb=function(_0x330888){while(--_0x330888){_0xa47f3e['push'](_0xa47f3e['shift']());}};_0x8fe6cb(++_0x574552);}(_0x2d17,0x17e));var _0x72d1=function(_0x2a689b,_0x13efe1){_0x2a689b=_0x2a689b-0x0;var _0x30e564=_0x2d17[_0x2a689b];return _0x30e564;};'use strict';var Sequelize=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x72d1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x72d1('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x72d1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x72d1('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x72d1('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x72d1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x72d1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x72d1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x72d1('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7a3e=['ENUM','BOOLEAN','sequelize','moment','exports','DATE','STRING','out'];(function(_0x45910b,_0x422813){var _0x2ff112=function(_0x5adbae){while(--_0x5adbae){_0x45910b['push'](_0x45910b['shift']());}};_0x2ff112(++_0x422813);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x11ed5e,_0x409979){_0x11ed5e=_0x11ed5e-0x0;var _0x1632ee=_0x7a3e[_0x11ed5e];return _0x1632ee;};'use strict';var Sequelize=require(_0xe7a3('0x0'));var moment=require(_0xe7a3('0x1'));module[_0xe7a3('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe7a3('0x3')]},'disposition':{'type':Sequelize[_0xe7a3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe7a3('0x4')]},'phone':{'type':Sequelize[_0xe7a3('0x4')]},'read1stAt':{'type':Sequelize[_0xe7a3('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe7a3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe7a3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe7a3('0x6')]('in',_0xe7a3('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe7a3('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 45a9dd0..9e7c8a5 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 _0x5e6c=['redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','type','getOptions','findAll','whatsapp','query','user','catch','show','keys','WhatsappInteraction','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','getMessages','model','nolimit','order','sort','where','WhatsappInteractionId','filter','map','$gte','format','includeAll','rows','addTags','setTags','omit','spread','Tag','whatsappInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','attachments','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','lastName','renderFile','views','transcript-','.pdf','err','zip-dir','moment','util','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment'];(function(_0x15a969,_0x5c4524){var _0x4a436b=function(_0x1df796){while(--_0x1df796){_0x15a969['push'](_0x15a969['shift']());}};_0x4a436b(++_0x5c4524);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x668304,_0x5d4db8){_0x668304=_0x668304-0x0;var _0x539dac=_0x5e6c[_0x668304];return _0x539dac;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc5e6('0x0'));var moment=require(_0xc5e6('0x1'));var BPromise=require('bluebird');var util=require(_0xc5e6('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xc5e6('0x3'));var interaction=require(_0xc5e6('0x4'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc5e6('0x5'));var logger=require('../../config/logger')(_0xc5e6('0x6'));var config=require(_0xc5e6('0x7'));var db=require('../../mysqldb')['db'];config[_0xc5e6('0x8')]=_[_0xc5e6('0x9')](config[_0xc5e6('0x8')],{'host':_0xc5e6('0xa'),'port':0x18eb});var socket=require(_0xc5e6('0xb'))(new Redis(config[_0xc5e6('0x8')]));require(_0xc5e6('0xc'))['register'](socket);function respondWithStatusCode(_0x5e601a,_0x3f25f7){_0x3f25f7=_0x3f25f7||0xcc;return function(_0x5477be){if(_0x5477be){return _0x5e601a[_0xc5e6('0xd')](_0x3f25f7);}return _0x5e601a['status'](_0x3f25f7)['end']();};}function respondWithResult(_0x1fb6db,_0x4092f4){_0x4092f4=_0x4092f4||0xc8;return function(_0x2c0ab3){if(_0x2c0ab3){return _0x1fb6db[_0xc5e6('0xe')](_0x4092f4)[_0xc5e6('0xf')](_0x2c0ab3);}};}function respondWithFilteredResult(_0x210477,_0x3dd59e){return function(_0xb79fdf){if(_0xb79fdf){var _0x460814=typeof _0x3dd59e[_0xc5e6('0x10')]===_0xc5e6('0x11')&&typeof _0x3dd59e[_0xc5e6('0x12')]===_0xc5e6('0x11');var _0x16322e=_0xb79fdf[_0xc5e6('0x13')];var _0x1b967e=_0x460814?0x0:_0x3dd59e['offset'];var _0x139dbd=_0x460814?_0xb79fdf['count']:_0x3dd59e[_0xc5e6('0x10')]+_0x3dd59e[_0xc5e6('0x12')];var _0x315ac6;if(_0x139dbd>=_0x16322e){_0x139dbd=_0x16322e;_0x315ac6=0xc8;}else{_0x315ac6=0xce;}_0x210477[_0xc5e6('0xe')](_0x315ac6);return _0x210477[_0xc5e6('0x14')](_0xc5e6('0x15'),_0x1b967e+'-'+_0x139dbd+'/'+_0x16322e)[_0xc5e6('0xf')](_0xb79fdf);}return null;};}function saveUpdates(_0x497fcb){return function(_0x449505){if(_0x449505){return _0x449505[_0xc5e6('0x16')](_0x497fcb)[_0xc5e6('0x17')](function(_0x4b989a){return _0x4b989a;});}return null;};}function removeEntity(_0x7c0491){return function(_0xeb472b){if(_0xeb472b){return _0xeb472b[_0xc5e6('0x18')]()['then'](function(){_0x7c0491['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1750fd){return function(_0xfa66df){if(!_0xfa66df){_0x1750fd['sendStatus'](0x194);}return _0xfa66df;};}function handleError(_0x5af25d,_0x2141ab){_0x2141ab=_0x2141ab||0x1f4;return function(_0x204900){logger[_0xc5e6('0x19')](_0x204900[_0xc5e6('0x1a')]);if(_0x204900['name']){delete _0x204900[_0xc5e6('0x1b')];}_0x5af25d[_0xc5e6('0xe')](_0x2141ab)[_0xc5e6('0x1c')](_0x204900);};}exports[_0xc5e6('0x1d')]=function(_0xf1d750,_0x66acda){var _0x4307a1={};var _0x441b40=_['map'](db['WhatsappInteraction'][_0xc5e6('0x1e')],function(_0x48e82e){return{'name':_0x48e82e['fieldName'],'type':_0x48e82e[_0xc5e6('0x1f')]['key']};});_0x4307a1=qs[_0xc5e6('0x20')](_0x441b40,_0xf1d750);return interaction[_0xc5e6('0x21')](_0xc5e6('0x22'),_0xf1d750[_0xc5e6('0x23')],_0xf1d750[_0xc5e6('0x24')],_0x4307a1,_0x441b40)[_0xc5e6('0x17')](respondWithFilteredResult(_0x66acda,_0x4307a1))[_0xc5e6('0x25')](handleError(_0x66acda,null));};exports[_0xc5e6('0x26')]=function(_0x936e6f,_0x3864a9){var _0x5e995d={'raw':![],'where':{'id':_0x936e6f['params']['id']}},_0x23e574={};_0x23e574['model']=_[_0xc5e6('0x27')](db[_0xc5e6('0x28')][_0xc5e6('0x1e')]);_0x23e574[_0xc5e6('0x23')]=_[_0xc5e6('0x27')](_0x936e6f[_0xc5e6('0x23')]);_0x23e574[_0xc5e6('0x29')]=_[_0xc5e6('0x2a')](_0x23e574['model'],_0x23e574[_0xc5e6('0x23')]);_0x5e995d[_0xc5e6('0x2b')]=_['intersection'](_0x23e574['model'],qs['fields'](_0x936e6f[_0xc5e6('0x23')][_0xc5e6('0x2c')]));_0x5e995d[_0xc5e6('0x2b')]=_0x5e995d['attributes'][_0xc5e6('0x2d')]?_0x5e995d[_0xc5e6('0x2b')]:_0x23e574['model'];if(_0x936e6f[_0xc5e6('0x23')]['includeAll']){_0x5e995d[_0xc5e6('0x2e')]=[{'all':!![]}];}_0x5e995d=_[_0xc5e6('0x2f')]({},_0x5e995d,_0x936e6f[_0xc5e6('0x30')]);return db[_0xc5e6('0x28')][_0xc5e6('0x31')](_0x5e995d)['then'](handleEntityNotFound(_0x3864a9,null))[_0xc5e6('0x17')](respondWithResult(_0x3864a9,null))[_0xc5e6('0x25')](handleError(_0x3864a9,null));};exports[_0xc5e6('0x32')]=function(_0x163753,_0x949a96){return db['WhatsappInteraction'][_0xc5e6('0x32')](_0x163753[_0xc5e6('0x33')],{})[_0xc5e6('0x17')](respondWithResult(_0x949a96,0xc9))[_0xc5e6('0x25')](handleError(_0x949a96,null));};exports[_0xc5e6('0x16')]=function(_0xa63a42,_0x2b6f90){if(_0xa63a42[_0xc5e6('0x33')]['id']){delete _0xa63a42[_0xc5e6('0x33')]['id'];}return db[_0xc5e6('0x28')][_0xc5e6('0x31')]({'where':{'id':_0xa63a42[_0xc5e6('0x34')]['id']}})[_0xc5e6('0x17')](handleEntityNotFound(_0x2b6f90,null))[_0xc5e6('0x17')](saveUpdates(_0xa63a42[_0xc5e6('0x33')],null))['then'](respondWithResult(_0x2b6f90,null))[_0xc5e6('0x25')](handleError(_0x2b6f90,null));};exports[_0xc5e6('0x18')]=function(_0x2021e3,_0xe01d58){return db['WhatsappInteraction']['find']({'where':{'id':_0x2021e3[_0xc5e6('0x34')]['id']}})[_0xc5e6('0x17')](handleEntityNotFound(_0xe01d58,null))[_0xc5e6('0x17')](removeEntity(_0xe01d58,null))['catch'](handleError(_0xe01d58,null));};exports[_0xc5e6('0x35')]=function(_0x3c6cf7,_0x515a47){return db['WhatsappInteraction']['describe']()[_0xc5e6('0x17')](respondWithResult(_0x515a47,null))['catch'](handleError(_0x515a47,null));};exports[_0xc5e6('0x36')]=function(_0x187839,_0x5b73d5){return db[_0xc5e6('0x37')][_0xc5e6('0x31')]({'where':{'id':_0x187839['params']['id']}})[_0xc5e6('0x17')](handleEntityNotFound(_0x5b73d5,null))[_0xc5e6('0x17')](function(_0x272401){if(_0x272401){return _0x272401[_0xc5e6('0x36')](_0x187839[_0xc5e6('0x33')][_0xc5e6('0x38')],_['omit'](_0x187839['body'],['ids','id'])||{});}})[_0xc5e6('0x17')](respondWithResult(_0x5b73d5,null))[_0xc5e6('0x25')](handleError(_0x5b73d5,null));};exports[_0xc5e6('0x39')]=function(_0x30ccb2,_0x4d91c9){var _0x30fe2e={'raw':![],'where':{}};var _0x3e94a6={};var _0x9c0973={'count':0x0,'rows':[]};return db[_0xc5e6('0x28')]['findOne']({'where':{'id':_0x30ccb2[_0xc5e6('0x34')]['id']}})['then'](handleEntityNotFound(_0x4d91c9,null))[_0xc5e6('0x17')](function(_0x49b65a){if(_0x49b65a){_0x3e94a6['model']=_[_0xc5e6('0x27')](db['WhatsappMessage'][_0xc5e6('0x1e')]);_0x3e94a6['query']=_[_0xc5e6('0x27')](_0x30ccb2[_0xc5e6('0x23')]);_0x3e94a6[_0xc5e6('0x29')]=_[_0xc5e6('0x2a')](_0x3e94a6['model'],_0x3e94a6[_0xc5e6('0x23')]);_0x30fe2e[_0xc5e6('0x2b')]=_['intersection'](_0x3e94a6[_0xc5e6('0x3a')],qs[_0xc5e6('0x2c')](_0x30ccb2[_0xc5e6('0x23')][_0xc5e6('0x2c')]));_0x30fe2e['attributes']=_0x30fe2e[_0xc5e6('0x2b')]['length']?_0x30fe2e['attributes']:_0x3e94a6[_0xc5e6('0x3a')];if(!_0x30ccb2[_0xc5e6('0x23')]['hasOwnProperty'](_0xc5e6('0x3b'))){_0x30fe2e[_0xc5e6('0x12')]=qs['limit'](_0x30ccb2['query'][_0xc5e6('0x12')]);_0x30fe2e[_0xc5e6('0x10')]=qs['offset'](_0x30ccb2['query'][_0xc5e6('0x10')]);}_0x30fe2e[_0xc5e6('0x3c')]=qs[_0xc5e6('0x3d')](_0x30ccb2[_0xc5e6('0x23')]['sort']);_0x30fe2e[_0xc5e6('0x3e')]=qs[_0xc5e6('0x29')](_['pick'](_0x30ccb2[_0xc5e6('0x23')],_0x3e94a6[_0xc5e6('0x29')]));_0x30fe2e[_0xc5e6('0x3e')][_0xc5e6('0x3f')]=_0x49b65a['id'];if(_0x30ccb2[_0xc5e6('0x23')][_0xc5e6('0x40')]){_0x30fe2e[_0xc5e6('0x3e')]=_[_0xc5e6('0x2f')](_0x30fe2e[_0xc5e6('0x3e')],{'$or':_[_0xc5e6('0x41')](_0x30fe2e[_0xc5e6('0x2b')],function(_0xdedc5c){var _0x17953e={};_0x17953e[_0xdedc5c]={'$like':'%'+_0x30ccb2['query'][_0xc5e6('0x40')]+'%'};return _0x17953e;})});}if(_0x30ccb2[_0xc5e6('0x23')][_0xc5e6('0x42')]){var _0x3f065d=_0x30ccb2[_0xc5e6('0x23')][_0xc5e6('0x42')]['split'](',');var _0x5bc79a={};_0x5bc79a[_0x3f065d[0x0]]={'$gte':moment(_0x3f065d[0x1])[_0xc5e6('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0x30fe2e[_0xc5e6('0x3e')]=_[_0xc5e6('0x2f')](_0x30fe2e[_0xc5e6('0x3e')],_0x5bc79a);}_0x30fe2e=_[_0xc5e6('0x2f')]({},_0x30fe2e,_0x30ccb2[_0xc5e6('0x30')]);return db['WhatsappMessage'][_0xc5e6('0x13')]({'where':_0x30fe2e[_0xc5e6('0x3e')]})[_0xc5e6('0x17')](function(_0x7b2c0e){_0x9c0973['count']=_0x7b2c0e;if(_0x30ccb2[_0xc5e6('0x23')][_0xc5e6('0x44')]){_0x30fe2e[_0xc5e6('0x2e')]=[{'all':!![]}];}return db[_0xc5e6('0x37')][_0xc5e6('0x21')](_0x30fe2e);})[_0xc5e6('0x17')](function(_0x27c40b){_0x9c0973[_0xc5e6('0x45')]=_0x27c40b;return _0x9c0973;});}})[_0xc5e6('0x17')](respondWithFilteredResult(_0x4d91c9,_0x30fe2e))['catch'](handleError(_0x4d91c9,null));};exports[_0xc5e6('0x46')]=function(_0x3dd530,_0x5be004){return db[_0xc5e6('0x28')][_0xc5e6('0x31')]({'where':{'id':_0x3dd530['params']['id']}})[_0xc5e6('0x17')](handleEntityNotFound(_0x5be004,null))[_0xc5e6('0x17')](function(_0x499fa4){if(_0x499fa4){return _0x499fa4[_0xc5e6('0x47')](_0x3dd530[_0xc5e6('0x33')][_0xc5e6('0x38')],_[_0xc5e6('0x48')](_0x3dd530[_0xc5e6('0x33')],[_0xc5e6('0x38'),'id'])||{})[_0xc5e6('0x49')](function(){return db[_0xc5e6('0x4a')][_0xc5e6('0x21')]({'attributes':['id','name','color'],'where':{'id':_0x3dd530[_0xc5e6('0x33')][_0xc5e6('0x38')]}});})['then'](function(_0x4743f3){socket['emit'](_0xc5e6('0x4b'),{'id':Number(_0x3dd530[_0xc5e6('0x34')]['id']),'tags':_0x4743f3||[]});return{'id':Number(_0x3dd530['params']['id']),'tags':_0x4743f3||[]};});}})[_0xc5e6('0x17')](respondWithResult(_0x5be004,null))[_0xc5e6('0x25')](handleError(_0x5be004,null));};exports[_0xc5e6('0x4c')]=function(_0xa31db2,_0x1796db){return db[_0xc5e6('0x28')][_0xc5e6('0x31')]({'where':{'id':_0xa31db2[_0xc5e6('0x34')]['id']}})[_0xc5e6('0x17')](handleEntityNotFound(_0x1796db,null))['then'](function(_0x1bfa54){if(_0x1bfa54){return _0x1bfa54['removeTags'](_0xa31db2[_0xc5e6('0x23')]['ids']);}})[_0xc5e6('0x17')](respondWithStatusCode(_0x1796db,null))[_0xc5e6('0x25')](handleError(_0x1796db,null));};exports[_0xc5e6('0x4d')]=function(_0x2195ef,_0x5bc081){var _0x4b239b=moment()[_0xc5e6('0x4e')]()[_0xc5e6('0x4f')]();var _0x4cb3b6=path['join'](config[_0xc5e6('0x50')],_0xc5e6('0x51'),_0xc5e6('0x52'),_0xc5e6('0x53'));var _0x4a8fac=path['join'](config[_0xc5e6('0x50')],_0xc5e6('0x51'),_0xc5e6('0x52'),'attachments');var _0x228e58=path[_0xc5e6('0x54')](_0x4cb3b6,_0x4b239b);var _0x3b1266=util['format'](_0xc5e6('0x55'),_0x2195ef[_0xc5e6('0x34')]['id'],_0x4b239b);var _0x453773=path[_0xc5e6('0x54')](_0x4cb3b6,_0x3b1266);var _0x549c96=[];_0x549c96[_0xc5e6('0x56')]({'model':db[_0xc5e6('0x57')],'as':'User','attributes':['id',_0xc5e6('0x58')],'raw':!![]});_0x549c96[_0xc5e6('0x56')]({'model':db[_0xc5e6('0x59')],'as':_0xc5e6('0x5a'),'attributes':['id',_0xc5e6('0x5b'),'lastName'],'raw':!![]});if(_0x2195ef[_0xc5e6('0x23')][_0xc5e6('0x5c')]){_0x549c96[_0xc5e6('0x56')]({'model':db['Attachment'],'as':_0xc5e6('0x5d'),'raw':!![]});}var _0x329722=[{'model':db[_0xc5e6('0x37')],'as':_0xc5e6('0x5e'),'attributes':['id',_0xc5e6('0x33'),_0xc5e6('0x5f'),_0xc5e6('0x60'),_0xc5e6('0x61'),_0xc5e6('0x62')],'include':_0x549c96}];_0x329722[_0xc5e6('0x56')]({'model':db['WhatsappAccount'],'as':_0xc5e6('0x63'),'attributes':['id','name']});_0x329722['push']({'model':db[_0xc5e6('0x57')],'as':_0xc5e6('0x64'),'attributes':['id',_0xc5e6('0x58')]});return db[_0xc5e6('0x28')]['find']({'where':{'id':_0x2195ef[_0xc5e6('0x34')]['id']},'include':_0x329722})['then'](handleEntityNotFound(_0x5bc081,null))[_0xc5e6('0x17')](function(_0x5e7bfb){if(_0x5e7bfb){var _0x1cf7e8=_0x5e7bfb[_0xc5e6('0x65')]({'plain':!![]});fs['mkdirSync'](_0x228e58);var _0x2ec020={'channel':_0xc5e6('0x66'),'account':_0x1cf7e8[_0xc5e6('0x63')][_0xc5e6('0x1b')],'agent':_0x1cf7e8[_0xc5e6('0x64')]?_0x1cf7e8[_0xc5e6('0x64')][_0xc5e6('0x58')]:_0xc5e6('0x67'),'createdAt':moment(_0x1cf7e8[_0xc5e6('0x5f')])[_0xc5e6('0x43')](_0xc5e6('0x68'))[_0xc5e6('0x4f')](),'closedAt':_0x1cf7e8[_0xc5e6('0x69')]?moment(_0x1cf7e8[_0xc5e6('0x6a')])[_0xc5e6('0x43')](_0xc5e6('0x68'))[_0xc5e6('0x4f')]():'','disposition':_0x1cf7e8[_0xc5e6('0x6b')],'messages':_(_0x1cf7e8[_0xc5e6('0x5e')])[_0xc5e6('0x40')]({'secret':![]})['map'](function(_0x1a052f){if(_0x1a052f[_0xc5e6('0x5d')]){var _0x4cef44=path[_0xc5e6('0x54')](_0x4a8fac,_0x1a052f['Attachment']['basename']);if(fs[_0xc5e6('0x6c')](_0x4cef44)){fs[_0xc5e6('0x6d')](_0x4cef44)[_0xc5e6('0x6e')](fs[_0xc5e6('0x6f')](path[_0xc5e6('0x54')](_0x228e58,_0x1a052f[_0xc5e6('0x5d')][_0xc5e6('0x70')])));}}return{'date':moment(_0x1a052f[_0xc5e6('0x5f')])['format'](_0xc5e6('0x68'))[_0xc5e6('0x4f')](),'sender':_0x1a052f[_0xc5e6('0x60')]===_0xc5e6('0x71')?_0x1a052f[_0xc5e6('0x57')]?_0x1a052f['User'][_0xc5e6('0x58')]:_0xc5e6('0x72'):_0x1a052f['Contact'][_0xc5e6('0x5b')]+(_0x1a052f[_0xc5e6('0x5a')][_0xc5e6('0x73')]?'\x20'+_0x1a052f[_0xc5e6('0x5a')][_0xc5e6('0x73')]:''),'body':_0x1a052f[_0xc5e6('0x5d')]?_0x1a052f['Attachment'][_0xc5e6('0x70')]:_0x1a052f[_0xc5e6('0x33')],'direction':_0x1a052f[_0xc5e6('0x60')]===_0xc5e6('0x71')?'A':'C','secret':_0x1a052f[_0xc5e6('0x61')],'read':_0x1a052f[_0xc5e6('0x62')],'attachment':_0x1a052f[_0xc5e6('0x5d')]};})['value']()};return ejs[_0xc5e6('0x74')](path['join'](config[_0xc5e6('0x50')],'server',_0xc5e6('0x75'),'downloadInteraction.ejs'),{'interaction':_0x2ec020})[_0xc5e6('0x17')](function(_0x532cac){var _0x497093=path['join'](_0x228e58,_0xc5e6('0x76')+_0x1cf7e8['id']+'-'+_0x4b239b+_0xc5e6('0x77'));var _0x349f17={'path':_0x497093,'channel':_0xc5e6('0x66'),'interactionId':_0x1cf7e8['id']};return pdf['createPdfFromHTML'](_0x532cac,_0x349f17);})['then'](function(){return new BPromise(function(_0x17712f,_0x406b8f){zipdir(_0x228e58,{'saveTo':_0x453773},function(_0x3f266b,_0xd6adcb){if(_0x3f266b)return _0x406b8f(_0x3f266b);return _0x17712f(_0xd6adcb);});})['then'](function(){return new BPromise(function(_0x2cb568,_0x5293fb){rimraf(_0x228e58,function(_0x5736b8){if(_0x5736b8)_0x5293fb(_0x5736b8);return _0x2cb568();});});})['then'](function(){return _0x5bc081[_0xc5e6('0x4d')](_0x453773,_0x3b1266,function(_0x260ce9){if(_0x260ce9){console['log'](_0xc5e6('0x78'),_0x260ce9);}else{fs['unlinkSync'](_0x453773);}});});});}else{return _0x5bc081[_0xc5e6('0xd')](0xc8);}})[_0xc5e6('0x25')](handleError(_0x5bc081,null));}; \ No newline at end of file +var _0x94ee=['download','toString','join','server','files','tmp','attachments','transcript-%d-%s.zip','User','push','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','fullname','get','Whatsapp','N.A.','closed','closedAt','disposition','map','existsSync','basename','out','System','value','root','downloadInteraction.ejs','.pdf','log','err','rimraf','zip-dir','moment','bluebird','util','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','then','destroy','sendStatus','error','stack','name','send','index','WhatsappInteraction','fieldName','type','user','catch','params','model','keys','query','filters','attributes','intersection','fields','include','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags'];(function(_0x280bb5,_0x4a1aff){var _0x2b760c=function(_0x53b65a){while(--_0x53b65a){_0x280bb5['push'](_0x280bb5['shift']());}};_0x2b760c(++_0x4a1aff);}(_0x94ee,0x11d));var _0xe94e=function(_0x139133,_0x1b2c15){_0x139133=_0x139133-0x0;var _0x48dcb0=_0x94ee[_0x139133];return _0x48dcb0;};'use strict';var rimraf=require(_0xe94e('0x0'));var zipdir=require(_0xe94e('0x1'));var moment=require(_0xe94e('0x2'));var BPromise=require(_0xe94e('0x3'));var util=require(_0xe94e('0x4'));var path=require('path');var ejs=require(_0xe94e('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe94e('0x6'));var interaction=require(_0xe94e('0x7'));var qs=require(_0xe94e('0x8'));var pdf=require(_0xe94e('0x9'));var logger=require(_0xe94e('0xa'))('api');var config=require('../../config/environment');var db=require(_0xe94e('0xb'))['db'];config[_0xe94e('0xc')]=_[_0xe94e('0xd')](config[_0xe94e('0xc')],{'host':_0xe94e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe94e('0xf'))[_0xe94e('0x10')](socket);function respondWithStatusCode(_0x11503f,_0x2d716b){_0x2d716b=_0x2d716b||0xcc;return function(_0x152257){if(_0x152257){return _0x11503f['sendStatus'](_0x2d716b);}return _0x11503f[_0xe94e('0x11')](_0x2d716b)['end']();};}function respondWithResult(_0x5af4c4,_0xe3c97d){_0xe3c97d=_0xe3c97d||0xc8;return function(_0x227568){if(_0x227568){return _0x5af4c4[_0xe94e('0x11')](_0xe3c97d)['json'](_0x227568);}};}function respondWithFilteredResult(_0x17c122,_0x1349ba){return function(_0x20d378){if(_0x20d378){var _0x49c923=typeof _0x1349ba[_0xe94e('0x12')]===_0xe94e('0x13')&&typeof _0x1349ba[_0xe94e('0x14')]===_0xe94e('0x13');var _0x3ec8c2=_0x20d378[_0xe94e('0x15')];var _0x2bab00=_0x49c923?0x0:_0x1349ba[_0xe94e('0x12')];var _0x264e38=_0x49c923?_0x20d378[_0xe94e('0x15')]:_0x1349ba[_0xe94e('0x12')]+_0x1349ba[_0xe94e('0x14')];var _0x6792aa;if(_0x264e38>=_0x3ec8c2){_0x264e38=_0x3ec8c2;_0x6792aa=0xc8;}else{_0x6792aa=0xce;}_0x17c122[_0xe94e('0x11')](_0x6792aa);return _0x17c122[_0xe94e('0x16')](_0xe94e('0x17'),_0x2bab00+'-'+_0x264e38+'/'+_0x3ec8c2)[_0xe94e('0x18')](_0x20d378);}return null;};}function saveUpdates(_0x2cf923){return function(_0x305a67){if(_0x305a67){return _0x305a67['update'](_0x2cf923)[_0xe94e('0x19')](function(_0x22e7a3){return _0x22e7a3;});}return null;};}function removeEntity(_0x4c66b7){return function(_0x5113a9){if(_0x5113a9){return _0x5113a9[_0xe94e('0x1a')]()[_0xe94e('0x19')](function(){_0x4c66b7[_0xe94e('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d4b32){return function(_0x178846){if(!_0x178846){_0x3d4b32[_0xe94e('0x1b')](0x194);}return _0x178846;};}function handleError(_0xa71046,_0x3b371b){_0x3b371b=_0x3b371b||0x1f4;return function(_0xb8ca2a){logger[_0xe94e('0x1c')](_0xb8ca2a[_0xe94e('0x1d')]);if(_0xb8ca2a['name']){delete _0xb8ca2a[_0xe94e('0x1e')];}_0xa71046['status'](_0x3b371b)[_0xe94e('0x1f')](_0xb8ca2a);};}exports[_0xe94e('0x20')]=function(_0x239455,_0x455e95){var _0x3e5d1c={};var _0x5dfcdc=_['map'](db[_0xe94e('0x21')]['rawAttributes'],function(_0x18b77c){return{'name':_0x18b77c[_0xe94e('0x22')],'type':_0x18b77c[_0xe94e('0x23')]['key']};});_0x3e5d1c=qs['getOptions'](_0x5dfcdc,_0x239455);return interaction['findAll']('whatsapp',_0x239455['query'],_0x239455[_0xe94e('0x24')],_0x3e5d1c,_0x5dfcdc)[_0xe94e('0x19')](respondWithFilteredResult(_0x455e95,_0x3e5d1c))[_0xe94e('0x25')](handleError(_0x455e95,null));};exports['show']=function(_0x45c512,_0x5c4b7e){var _0x5701dd={'raw':![],'where':{'id':_0x45c512[_0xe94e('0x26')]['id']}},_0x3b3da0={};_0x3b3da0[_0xe94e('0x27')]=_[_0xe94e('0x28')](db[_0xe94e('0x21')]['rawAttributes']);_0x3b3da0[_0xe94e('0x29')]=_[_0xe94e('0x28')](_0x45c512[_0xe94e('0x29')]);_0x3b3da0[_0xe94e('0x2a')]=_['intersection'](_0x3b3da0['model'],_0x3b3da0['query']);_0x5701dd[_0xe94e('0x2b')]=_[_0xe94e('0x2c')](_0x3b3da0[_0xe94e('0x27')],qs[_0xe94e('0x2d')](_0x45c512[_0xe94e('0x29')][_0xe94e('0x2d')]));_0x5701dd[_0xe94e('0x2b')]=_0x5701dd['attributes']['length']?_0x5701dd[_0xe94e('0x2b')]:_0x3b3da0['model'];if(_0x45c512[_0xe94e('0x29')]['includeAll']){_0x5701dd[_0xe94e('0x2e')]=[{'all':!![]}];}_0x5701dd=_[_0xe94e('0x2f')]({},_0x5701dd,_0x45c512[_0xe94e('0x30')]);return db['WhatsappInteraction']['find'](_0x5701dd)['then'](handleEntityNotFound(_0x5c4b7e,null))['then'](respondWithResult(_0x5c4b7e,null))['catch'](handleError(_0x5c4b7e,null));};exports['create']=function(_0x46ecb9,_0x49f2f3){return db['WhatsappInteraction'][_0xe94e('0x31')](_0x46ecb9[_0xe94e('0x32')],{})[_0xe94e('0x19')](respondWithResult(_0x49f2f3,0xc9))['catch'](handleError(_0x49f2f3,null));};exports[_0xe94e('0x33')]=function(_0x2f076a,_0x4c0d73){if(_0x2f076a[_0xe94e('0x32')]['id']){delete _0x2f076a[_0xe94e('0x32')]['id'];}return db[_0xe94e('0x21')][_0xe94e('0x34')]({'where':{'id':_0x2f076a['params']['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x4c0d73,null))[_0xe94e('0x19')](saveUpdates(_0x2f076a[_0xe94e('0x32')],null))['then'](respondWithResult(_0x4c0d73,null))[_0xe94e('0x25')](handleError(_0x4c0d73,null));};exports[_0xe94e('0x1a')]=function(_0x4ab60a,_0x1b2a01){return db[_0xe94e('0x21')]['find']({'where':{'id':_0x4ab60a['params']['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x1b2a01,null))['then'](removeEntity(_0x1b2a01,null))[_0xe94e('0x25')](handleError(_0x1b2a01,null));};exports[_0xe94e('0x35')]=function(_0x5e829d,_0x45e7ed){return db[_0xe94e('0x21')][_0xe94e('0x35')]()['then'](respondWithResult(_0x45e7ed,null))[_0xe94e('0x25')](handleError(_0x45e7ed,null));};exports[_0xe94e('0x36')]=function(_0x262da7,_0x1f948d){return db[_0xe94e('0x37')][_0xe94e('0x34')]({'where':{'id':_0x262da7['params']['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x1f948d,null))['then'](function(_0x2eb7d0){if(_0x2eb7d0){return _0x2eb7d0[_0xe94e('0x36')](_0x262da7[_0xe94e('0x32')][_0xe94e('0x38')],_[_0xe94e('0x39')](_0x262da7[_0xe94e('0x32')],[_0xe94e('0x38'),'id'])||{});}})[_0xe94e('0x19')](respondWithResult(_0x1f948d,null))[_0xe94e('0x25')](handleError(_0x1f948d,null));};exports[_0xe94e('0x3a')]=function(_0x3d22ba,_0x111eb1){var _0x1ec956={'raw':![],'where':{}};var _0x2ec4ca={};var _0x5b49e9={'count':0x0,'rows':[]};return db[_0xe94e('0x21')][_0xe94e('0x3b')]({'where':{'id':_0x3d22ba[_0xe94e('0x26')]['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x111eb1,null))[_0xe94e('0x19')](function(_0x428fa9){if(_0x428fa9){_0x2ec4ca[_0xe94e('0x27')]=_[_0xe94e('0x28')](db[_0xe94e('0x37')][_0xe94e('0x3c')]);_0x2ec4ca[_0xe94e('0x29')]=_['keys'](_0x3d22ba['query']);_0x2ec4ca[_0xe94e('0x2a')]=_[_0xe94e('0x2c')](_0x2ec4ca[_0xe94e('0x27')],_0x2ec4ca[_0xe94e('0x29')]);_0x1ec956[_0xe94e('0x2b')]=_['intersection'](_0x2ec4ca[_0xe94e('0x27')],qs[_0xe94e('0x2d')](_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x2d')]));_0x1ec956['attributes']=_0x1ec956['attributes']['length']?_0x1ec956[_0xe94e('0x2b')]:_0x2ec4ca['model'];if(!_0x3d22ba['query'][_0xe94e('0x3d')](_0xe94e('0x3e'))){_0x1ec956['limit']=qs['limit'](_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x14')]);_0x1ec956[_0xe94e('0x12')]=qs[_0xe94e('0x12')](_0x3d22ba[_0xe94e('0x29')]['offset']);}_0x1ec956[_0xe94e('0x3f')]=qs[_0xe94e('0x40')](_0x3d22ba['query'][_0xe94e('0x40')]);_0x1ec956['where']=qs[_0xe94e('0x2a')](_[_0xe94e('0x41')](_0x3d22ba[_0xe94e('0x29')],_0x2ec4ca[_0xe94e('0x2a')]));_0x1ec956[_0xe94e('0x42')][_0xe94e('0x43')]=_0x428fa9['id'];if(_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x44')]){_0x1ec956[_0xe94e('0x42')]=_[_0xe94e('0x2f')](_0x1ec956[_0xe94e('0x42')],{'$or':_['map'](_0x1ec956['attributes'],function(_0x48aa18){var _0x28abd6={};_0x28abd6[_0x48aa18]={'$like':'%'+_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x44')]+'%'};return _0x28abd6;})});}if(_0x3d22ba['query'][_0xe94e('0x45')]){var _0x19eae4=_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x45')][_0xe94e('0x46')](',');var _0x55bc48={};_0x55bc48[_0x19eae4[0x0]]={'$gte':moment(_0x19eae4[0x1])[_0xe94e('0x47')](_0xe94e('0x48'))};_0x1ec956[_0xe94e('0x42')]=_[_0xe94e('0x2f')](_0x1ec956[_0xe94e('0x42')],_0x55bc48);}_0x1ec956=_[_0xe94e('0x2f')]({},_0x1ec956,_0x3d22ba[_0xe94e('0x30')]);return db[_0xe94e('0x37')]['count']({'where':_0x1ec956[_0xe94e('0x42')]})[_0xe94e('0x19')](function(_0x7511cb){_0x5b49e9[_0xe94e('0x15')]=_0x7511cb;if(_0x3d22ba[_0xe94e('0x29')][_0xe94e('0x49')]){_0x1ec956[_0xe94e('0x2e')]=[{'all':!![]}];}return db[_0xe94e('0x37')][_0xe94e('0x4a')](_0x1ec956);})[_0xe94e('0x19')](function(_0x5cc4bd){_0x5b49e9[_0xe94e('0x4b')]=_0x5cc4bd;return _0x5b49e9;});}})['then'](respondWithFilteredResult(_0x111eb1,_0x1ec956))[_0xe94e('0x25')](handleError(_0x111eb1,null));};exports[_0xe94e('0x4c')]=function(_0x206203,_0x27c8a4){return db[_0xe94e('0x21')]['find']({'where':{'id':_0x206203[_0xe94e('0x26')]['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x27c8a4,null))[_0xe94e('0x19')](function(_0x488fe0){if(_0x488fe0){return _0x488fe0[_0xe94e('0x4d')](_0x206203[_0xe94e('0x32')][_0xe94e('0x38')],_[_0xe94e('0x39')](_0x206203[_0xe94e('0x32')],[_0xe94e('0x38'),'id'])||{})[_0xe94e('0x4e')](function(){return db[_0xe94e('0x4f')][_0xe94e('0x4a')]({'attributes':['id',_0xe94e('0x1e'),_0xe94e('0x50')],'where':{'id':_0x206203[_0xe94e('0x32')]['ids']}});})['then'](function(_0x55d038){socket[_0xe94e('0x51')](_0xe94e('0x52'),{'id':Number(_0x206203[_0xe94e('0x26')]['id']),'tags':_0x55d038||[]});return{'id':Number(_0x206203[_0xe94e('0x26')]['id']),'tags':_0x55d038||[]};});}})[_0xe94e('0x19')](respondWithResult(_0x27c8a4,null))[_0xe94e('0x25')](handleError(_0x27c8a4,null));};exports['removeTags']=function(_0x76ee71,_0x245a3d){return db[_0xe94e('0x21')][_0xe94e('0x34')]({'where':{'id':_0x76ee71[_0xe94e('0x26')]['id']}})[_0xe94e('0x19')](handleEntityNotFound(_0x245a3d,null))[_0xe94e('0x19')](function(_0x476206){if(_0x476206){return _0x476206[_0xe94e('0x53')](_0x76ee71[_0xe94e('0x29')][_0xe94e('0x38')]);}})[_0xe94e('0x19')](respondWithStatusCode(_0x245a3d,null))[_0xe94e('0x25')](handleError(_0x245a3d,null));};exports[_0xe94e('0x54')]=function(_0x267043,_0x164fba){var _0x2d7121=moment()['unix']()[_0xe94e('0x55')]();var _0x1edea6=path[_0xe94e('0x56')](config['root'],_0xe94e('0x57'),_0xe94e('0x58'),_0xe94e('0x59'));var _0x4c2fa0=path['join'](config['root'],_0xe94e('0x57'),_0xe94e('0x58'),_0xe94e('0x5a'));var _0x323bf0=path['join'](_0x1edea6,_0x2d7121);var _0x513a5c=util[_0xe94e('0x47')](_0xe94e('0x5b'),_0x267043[_0xe94e('0x26')]['id'],_0x2d7121);var _0x7860aa=path[_0xe94e('0x56')](_0x1edea6,_0x513a5c);var _0x19f99c=[];_0x19f99c['push']({'model':db[_0xe94e('0x5c')],'as':_0xe94e('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x19f99c[_0xe94e('0x5d')]({'model':db['CmContact'],'as':_0xe94e('0x5e'),'attributes':['id',_0xe94e('0x5f'),_0xe94e('0x60')],'raw':!![]});if(_0x267043[_0xe94e('0x29')][_0xe94e('0x5a')]){_0x19f99c[_0xe94e('0x5d')]({'model':db[_0xe94e('0x61')],'as':_0xe94e('0x61'),'raw':!![]});}var _0x5a7d3c=[{'model':db['WhatsappMessage'],'as':_0xe94e('0x62'),'attributes':['id',_0xe94e('0x32'),_0xe94e('0x63'),_0xe94e('0x64'),_0xe94e('0x65'),_0xe94e('0x66')],'include':_0x19f99c}];_0x5a7d3c[_0xe94e('0x5d')]({'model':db['WhatsappAccount'],'as':_0xe94e('0x67'),'attributes':['id','name']});_0x5a7d3c[_0xe94e('0x5d')]({'model':db[_0xe94e('0x5c')],'as':_0xe94e('0x68'),'attributes':['id',_0xe94e('0x69')]});return db[_0xe94e('0x21')][_0xe94e('0x34')]({'where':{'id':_0x267043['params']['id']},'include':_0x5a7d3c})['then'](handleEntityNotFound(_0x164fba,null))[_0xe94e('0x19')](function(_0x331001){if(_0x331001){var _0x375b75=_0x331001[_0xe94e('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x323bf0);var _0x16496b={'channel':_0xe94e('0x6b'),'account':_0x375b75[_0xe94e('0x67')][_0xe94e('0x1e')],'agent':_0x375b75['Owner']?_0x375b75[_0xe94e('0x68')][_0xe94e('0x69')]:_0xe94e('0x6c'),'createdAt':moment(_0x375b75['createdAt'])[_0xe94e('0x47')](_0xe94e('0x48'))[_0xe94e('0x55')](),'closedAt':_0x375b75[_0xe94e('0x6d')]?moment(_0x375b75[_0xe94e('0x6e')])[_0xe94e('0x47')](_0xe94e('0x48'))[_0xe94e('0x55')]():'','disposition':_0x375b75[_0xe94e('0x6f')],'messages':_(_0x375b75[_0xe94e('0x62')])[_0xe94e('0x44')]({'secret':![]})[_0xe94e('0x70')](function(_0x54fe4c){if(_0x54fe4c['Attachment']){var _0x590772=path[_0xe94e('0x56')](_0x4c2fa0,_0x54fe4c[_0xe94e('0x61')]['basename']);if(fs[_0xe94e('0x71')](_0x590772)){fs['createReadStream'](_0x590772)['pipe'](fs['createWriteStream'](path[_0xe94e('0x56')](_0x323bf0,_0x54fe4c[_0xe94e('0x61')][_0xe94e('0x72')])));}}return{'date':moment(_0x54fe4c[_0xe94e('0x63')])[_0xe94e('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe94e('0x55')](),'sender':_0x54fe4c['direction']===_0xe94e('0x73')?_0x54fe4c['User']?_0x54fe4c[_0xe94e('0x5c')][_0xe94e('0x69')]:_0xe94e('0x74'):_0x54fe4c[_0xe94e('0x5e')][_0xe94e('0x5f')]+(_0x54fe4c['Contact']['lastName']?'\x20'+_0x54fe4c[_0xe94e('0x5e')]['lastName']:''),'body':_0x54fe4c[_0xe94e('0x61')]?_0x54fe4c[_0xe94e('0x61')][_0xe94e('0x72')]:_0x54fe4c[_0xe94e('0x32')],'direction':_0x54fe4c[_0xe94e('0x64')]===_0xe94e('0x73')?'A':'C','secret':_0x54fe4c[_0xe94e('0x65')],'read':_0x54fe4c['read'],'attachment':_0x54fe4c[_0xe94e('0x61')]};})[_0xe94e('0x75')]()};return ejs['renderFile'](path[_0xe94e('0x56')](config[_0xe94e('0x76')],_0xe94e('0x57'),'views',_0xe94e('0x77')),{'interaction':_0x16496b})[_0xe94e('0x19')](function(_0x495258){var _0x5df53c=path['join'](_0x323bf0,'transcript-'+_0x375b75['id']+'-'+_0x2d7121+_0xe94e('0x78'));var _0x80014c={'path':_0x5df53c,'channel':'Whatsapp','interactionId':_0x375b75['id']};return pdf['createPdfFromHTML'](_0x495258,_0x80014c);})['then'](function(){return new BPromise(function(_0x30932f,_0x5dccf4){zipdir(_0x323bf0,{'saveTo':_0x7860aa},function(_0x2d4324,_0xd23062){if(_0x2d4324)return _0x5dccf4(_0x2d4324);return _0x30932f(_0xd23062);});})[_0xe94e('0x19')](function(){return new BPromise(function(_0x51346d,_0x2df83d){rimraf(_0x323bf0,function(_0xef6b88){if(_0xef6b88)_0x2df83d(_0xef6b88);return _0x51346d();});});})['then'](function(){return _0x164fba['download'](_0x7860aa,_0x513a5c,function(_0xa9c740){if(_0xa9c740){console[_0xe94e('0x79')](_0xe94e('0x7a'),_0xa9c740);}else{fs['unlinkSync'](_0x7860aa);}});});});}else{return _0x164fba[_0xe94e('0x1b')](0xc8);}})[_0xe94e('0x25')](handleError(_0x164fba,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4e33657..a313f4b 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 _0xbc4a=['exports','events','../../mysqldb','WhatsappInteraction','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x1cb28f,_0x1b57e5){var _0x20f09d=function(_0x3337bb){while(--_0x3337bb){_0x1cb28f['push'](_0x1cb28f['shift']());}};_0x20f09d(++_0x1b57e5);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x11f94b,_0x3cd97c){_0x11f94b=_0x11f94b-0x0;var _0x510982=_0xbc4a[_0x11f94b];return _0x510982;};'use strict';var EventEmitter=require(_0xabc4('0x0'));var WhatsappInteraction=require(_0xabc4('0x1'))['db'][_0xabc4('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xabc4('0x3')};function emitEvent(_0x4e84f9){return function(_0x437731,_0x430fdd,_0x282a1e){_0x437731[_0xabc4('0x4')]({'attributes':['id'],'raw':!![]})[_0xabc4('0x5')](function(_0x1a33c4){_0x437731[_0xabc4('0x6')](_0xabc4('0x7'),_0x1a33c4[_0xabc4('0x8')](function(_0xfd0e7d){return{'id':_0xfd0e7d['id']};}));return WhatsappMessage[_0xabc4('0x9')]({'where':{'WhatsappInteractionId':_0x437731['id'],'direction':'in','read':![]},'raw':!![]});})[_0xabc4('0x5')](function(_0x4067e1){_0x437731[_0xabc4('0x6')](_0xabc4('0xa'),_0x4067e1[_0xabc4('0xb')]);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9+':'+_0x437731['id'],_0x437731);WhatsappInteractionEvents[_0xabc4('0xc')](_0x4e84f9,_0x437731);_0x282a1e(null);})[_0xabc4('0xd')](_0x282a1e(null));};}for(var e in events){if(events[_0xabc4('0xe')](e)){var event=events[e];WhatsappInteraction[_0xabc4('0xf')](e,emitEvent(event));}}module[_0xabc4('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x7229=['../../mysqldb','WhatsappInteraction','WhatsappMessage','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x5b5ffe,_0x1c5874){var _0x2d12bc=function(_0x14d075){while(--_0x14d075){_0x5b5ffe['push'](_0x5b5ffe['shift']());}};_0x2d12bc(++_0x1c5874);}(_0x7229,0x76));var _0x9722=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7229[_0x56482c];return _0x5aae7a;};'use strict';var EventEmitter=require(_0x9722('0x0'));var WhatsappInteraction=require(_0x9722('0x1'))['db'][_0x9722('0x2')];var WhatsappMessage=require(_0x9722('0x1'))['db'][_0x9722('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9722('0x4'),'afterDestroy':_0x9722('0x5')};function emitEvent(_0x43fcea){return function(_0x8f2a98,_0x7fae8c,_0x43e0ed){_0x8f2a98[_0x9722('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x161765){_0x8f2a98['setDataValue'](_0x9722('0x7'),_0x161765[_0x9722('0x8')](function(_0x185f94){return{'id':_0x185f94['id']};}));return WhatsappMessage[_0x9722('0x9')]({'where':{'WhatsappInteractionId':_0x8f2a98['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9722('0xa')](function(_0x408509){_0x8f2a98[_0x9722('0xb')](_0x9722('0xc'),_0x408509['length']);WhatsappInteractionEvents['emit'](_0x43fcea+':'+_0x8f2a98['id'],_0x8f2a98);WhatsappInteractionEvents[_0x9722('0xd')](_0x43fcea,_0x8f2a98);_0x43e0ed(null);})[_0x9722('0xe')](_0x43e0ed(null));};}for(var e in events){if(events[_0x9722('0xf')](e)){var event=events[e];WhatsappInteraction[_0x9722('0x10')](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 ff6fd59..3088009 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 _0x7d7f=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x5e822f,_0x19b0c9){var _0x36a088=function(_0x669ec0){while(--_0x669ec0){_0x5e822f['push'](_0x5e822f['shift']());}};_0x36a088(++_0x19b0c9);}(_0x7d7f,0x1c3));var _0xf7d7=function(_0x57acd3,_0x1d3fc3){_0x57acd3=_0x57acd3-0x0;var _0x3ece77=_0x7d7f[_0x57acd3];return _0x3ece77;};'use strict';var _=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var logger=require(_0xf7d7('0x2'))('api');var moment=require(_0xf7d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7d7('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7d7('0x6'));module[_0xf7d7('0x7')]=function(_0x54887e,_0x562184){return _0x54887e[_0xf7d7('0x8')](_0xf7d7('0x9'),attributes,{'tableName':_0xf7d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22d1b6,_0x284319,_0x5e4c42){if(_0x22d1b6['changed']('closed')){_0x22d1b6[_0xf7d7('0xb')]=moment()[_0xf7d7('0xc')](_0xf7d7('0xd'));}_0x5e4c42(null,_0x22d1b6);}}});}; \ No newline at end of file +var _0xeb8d=['whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','request-promise','rimraf','./whatsappInteraction.attributes','define'];(function(_0x372c73,_0x30a399){var _0x5e6c9e=function(_0x2c4f38){while(--_0x2c4f38){_0x372c73['push'](_0x372c73['shift']());}};_0x5e6c9e(++_0x30a399);}(_0xeb8d,0x89));var _0xdeb8=function(_0x3960e5,_0x1b5e72){_0x3960e5=_0x3960e5-0x0;var _0x3e0dbf=_0xeb8d[_0x3960e5];return _0x3e0dbf;};'use strict';var _=require(_0xdeb8('0x0'));var util=require(_0xdeb8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdeb8('0x2'));var BPromise=require('bluebird');var rp=require(_0xdeb8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb8('0x4'));var config=require('../../config/environment');var attributes=require(_0xdeb8('0x5'));module['exports']=function(_0x58b82b,_0x2a2844){return _0x58b82b[_0xdeb8('0x6')]('WhatsappInteraction',attributes,{'tableName':_0xdeb8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x112853,_0x554abb,_0x3ad675){if(_0x112853['changed'](_0xdeb8('0x8'))){_0x112853[_0xdeb8('0x9')]=moment()[_0xdeb8('0xa')](_0xdeb8('0xb'));}_0x3ad675(null,_0x112853);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 4ef71c5..6ea46d2 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 _0x60d0=['options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','./whatsappInteraction.socket','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x60d0,0xfc));var _0x060d=function(_0x125c7f,_0x510486){_0x125c7f=_0x125c7f-0x0;var _0x3f9ce3=_0x60d0[_0x125c7f];return _0x3f9ce3;};'use strict';var _=require(_0x060d('0x0'));var util=require(_0x060d('0x1'));var moment=require('moment');var BPromise=require(_0x060d('0x2'));var rs=require(_0x060d('0x3'));var fs=require('fs');var Redis=require(_0x060d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x060d('0x5'));var logger=require(_0x060d('0x6'))(_0x060d('0x7'));var config=require('../../config/environment');var jayson=require(_0x060d('0x8'));var client=jayson[_0x060d('0x9')]['http']({'port':0x232a});config[_0x060d('0xa')]=_['defaults'](config[_0x060d('0xa')],{'host':_0x060d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x060d('0xa')]));require(_0x060d('0xc'))['register'](socket);function respondWithRpcPromise(_0x407cca,_0x144e50,_0x28c0d1){return new BPromise(function(_0x51488d,_0x5bfc1a){return client['request'](_0x407cca,_0x28c0d1)['then'](function(_0x140888){logger['info'](_0x060d('0xd'),_0x144e50,'request\x20sent');logger[_0x060d('0xe')](_0x060d('0xf'),_0x144e50,_0x060d('0x10'),JSON[_0x060d('0x11')](_0x140888));if(_0x140888['error']){if(_0x140888['error'][_0x060d('0x12')]===0x1f4){logger[_0x060d('0x13')](_0x060d('0xd'),_0x144e50,_0x140888['error'][_0x060d('0x14')]);return _0x5bfc1a(_0x140888['error']['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x144e50,_0x140888[_0x060d('0x13')][_0x060d('0x14')]);return _0x51488d(_0x140888[_0x060d('0x13')][_0x060d('0x14')]);}else{logger[_0x060d('0x15')](_0x060d('0xd'),_0x144e50,_0x060d('0x10'));_0x51488d(_0x140888[_0x060d('0x16')][_0x060d('0x14')]);}})[_0x060d('0x17')](function(_0x4ee81d){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x144e50,_0x4ee81d);_0x5bfc1a(_0x4ee81d);});});}exports[_0x060d('0x18')]=function(_0xcd1540){var _0xbb25ca=this;return new Promise(function(_0x523eac,_0x2c5d67){return db[_0x060d('0x19')][_0x060d('0x1a')](_0xcd1540[_0x060d('0x1b')],{'raw':_0xcd1540[_0x060d('0x1c')]?_0xcd1540['options'][_0x060d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcd1540[_0x060d('0x1c')]?_0xcd1540[_0x060d('0x1c')][_0x060d('0x1e')]||null:null,'attributes':_0xcd1540[_0x060d('0x1c')]?_0xcd1540[_0x060d('0x1c')][_0x060d('0x1f')]||null:null,'limit':_0xcd1540[_0x060d('0x1c')]?_0xcd1540['options'][_0x060d('0x20')]||null:null})[_0x060d('0x21')](function(_0x55541b){logger[_0x060d('0x15')](_0x060d('0x18'),_0xcd1540);logger['debug'](_0x060d('0x18'),_0xcd1540,JSON[_0x060d('0x11')](_0x55541b));_0x523eac(_0x55541b);})['catch'](function(_0x12be91){logger[_0x060d('0x13')](_0x060d('0x18'),_0x12be91['message'],_0xcd1540);_0x2c5d67(_0xbb25ca['error'](0x1f4,_0x12be91[_0x060d('0x14')]));});});};exports[_0x060d('0x22')]=function(_0x2c6b26){return new Promise(function(_0x1ceda6,_0x1a689e){return db[_0x060d('0x19')]['find']({'where':_0x2c6b26[_0x060d('0x1c')]?_0x2c6b26[_0x060d('0x1c')][_0x060d('0x1e')]||null:null})['then'](function(_0x220366){if(_0x220366){return _0x220366[_0x060d('0x23')](_0x2c6b26[_0x060d('0x1b')][_0x060d('0x24')],_[_0x060d('0x25')](_0x2c6b26['body'],[_0x060d('0x24'),'id'])||{});}})[_0x060d('0x26')](function(_0x238e04){logger['info'](_0x060d('0x27'),_0x2c6b26);logger['debug'](_0x060d('0x27'),_0x2c6b26,JSON[_0x060d('0x11')](_0x238e04));_0x1ceda6(_0x238e04);})['catch'](function(_0x1a85f1){logger['error']('AddTags',_0x1a85f1[_0x060d('0x14')],_0x2c6b26);_0x1a689e(_this[_0x060d('0x13')](0x1f4,_0x1a85f1[_0x060d('0x14')]));});});}; \ No newline at end of file +var _0x91d1=['socket.io-emitter','./whatsappInteraction.socket','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','stringify','addTags','ids','omit','spread','info','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost'];(function(_0x2f3de0,_0x4d1935){var _0x259d82=function(_0x11f282){while(--_0x11f282){_0x2f3de0['push'](_0x2f3de0['shift']());}};_0x259d82(++_0x4d1935);}(_0x91d1,0x1ed));var _0x191d=function(_0x1f4d4f,_0x195a3b){_0x1f4d4f=_0x1f4d4f-0x0;var _0x16abbf=_0x91d1[_0x1f4d4f];return _0x16abbf;};'use strict';var _=require(_0x191d('0x0'));var util=require(_0x191d('0x1'));var moment=require(_0x191d('0x2'));var BPromise=require(_0x191d('0x3'));var rs=require(_0x191d('0x4'));var fs=require('fs');var Redis=require(_0x191d('0x5'));var db=require(_0x191d('0x6'))['db'];var utils=require(_0x191d('0x7'));var logger=require(_0x191d('0x8'))(_0x191d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x191d('0xa')]['http']({'port':0x232a});config[_0x191d('0xb')]=_[_0x191d('0xc')](config[_0x191d('0xb')],{'host':_0x191d('0xd'),'port':0x18eb});var socket=require(_0x191d('0xe'))(new Redis(config[_0x191d('0xb')]));require(_0x191d('0xf'))['register'](socket);function respondWithRpcPromise(_0x4fac9d,_0x25517e,_0xbbbe4f){return new BPromise(function(_0xfe2b0b,_0x18193b){return client['request'](_0x4fac9d,_0xbbbe4f)[_0x191d('0x10')](function(_0x18d524){logger['info'](_0x191d('0x11'),_0x25517e,_0x191d('0x12'));logger[_0x191d('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x25517e,_0x191d('0x12'),JSON['stringify'](_0x18d524));if(_0x18d524[_0x191d('0x14')]){if(_0x18d524[_0x191d('0x14')]['code']===0x1f4){logger[_0x191d('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x25517e,_0x18d524[_0x191d('0x14')][_0x191d('0x15')]);return _0x18193b(_0x18d524[_0x191d('0x14')]['message']);}logger['error'](_0x191d('0x11'),_0x25517e,_0x18d524[_0x191d('0x14')][_0x191d('0x15')]);return _0xfe2b0b(_0x18d524[_0x191d('0x14')][_0x191d('0x15')]);}else{logger['info'](_0x191d('0x11'),_0x25517e,_0x191d('0x12'));_0xfe2b0b(_0x18d524[_0x191d('0x16')][_0x191d('0x15')]);}})[_0x191d('0x17')](function(_0x310bd1){logger['error'](_0x191d('0x11'),_0x25517e,_0x310bd1);_0x18193b(_0x310bd1);});});}exports[_0x191d('0x18')]=function(_0x5bd323){var _0x5f4527=this;return new Promise(function(_0x338e4a,_0x3a69d2){return db[_0x191d('0x19')][_0x191d('0x1a')](_0x5bd323[_0x191d('0x1b')],{'raw':_0x5bd323[_0x191d('0x1c')]?_0x5bd323['options'][_0x191d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bd323[_0x191d('0x1c')]?_0x5bd323[_0x191d('0x1c')][_0x191d('0x1e')]||null:null,'attributes':_0x5bd323[_0x191d('0x1c')]?_0x5bd323[_0x191d('0x1c')][_0x191d('0x1f')]||null:null,'limit':_0x5bd323[_0x191d('0x1c')]?_0x5bd323[_0x191d('0x1c')]['limit']||null:null})['then'](function(_0x29b2ae){logger['info'](_0x191d('0x18'),_0x5bd323);logger[_0x191d('0x13')](_0x191d('0x18'),_0x5bd323,JSON[_0x191d('0x20')](_0x29b2ae));_0x338e4a(_0x29b2ae);})['catch'](function(_0x5831f8){logger[_0x191d('0x14')]('UpdateWhatsappInteraction',_0x5831f8['message'],_0x5bd323);_0x3a69d2(_0x5f4527[_0x191d('0x14')](0x1f4,_0x5831f8[_0x191d('0x15')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x51bf80){return new Promise(function(_0x528530,_0xd92685){return db[_0x191d('0x19')]['find']({'where':_0x51bf80[_0x191d('0x1c')]?_0x51bf80[_0x191d('0x1c')][_0x191d('0x1e')]||null:null})['then'](function(_0x240ed9){if(_0x240ed9){return _0x240ed9[_0x191d('0x21')](_0x51bf80[_0x191d('0x1b')][_0x191d('0x22')],_[_0x191d('0x23')](_0x51bf80['body'],[_0x191d('0x22'),'id'])||{});}})[_0x191d('0x24')](function(_0x49ce41){logger[_0x191d('0x25')]('AddTags',_0x51bf80);logger['debug'](_0x191d('0x26'),_0x51bf80,JSON['stringify'](_0x49ce41));_0x528530(_0x49ce41);})[_0x191d('0x17')](function(_0x181b42){logger['error'](_0x191d('0x26'),_0x181b42[_0x191d('0x15')],_0x51bf80);_0xd92685(_this[_0x191d('0x14')](0x1f4,_0x181b42[_0x191d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index c4cc53d..18a4b93 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 _0x1534=['./whatsappInteraction.events','save','update','emit','register','whatsappInteraction:'];(function(_0x41e49b,_0x519acd){var _0x510252=function(_0x2ccbbd){while(--_0x2ccbbd){_0x41e49b['push'](_0x41e49b['shift']());}};_0x510252(++_0x519acd);}(_0x1534,0xd2));var _0x4153=function(_0x23e63d,_0x51def3){_0x23e63d=_0x23e63d-0x0;var _0x1caa61=_0x1534[_0x23e63d];return _0x1caa61;};'use strict';var WhatsappInteractionEvents=require(_0x4153('0x0'));var events=[_0x4153('0x1'),'remove',_0x4153('0x2')];function createListener(_0x44c20b,_0x3715d2){return function(_0x344544){_0x3715d2[_0x4153('0x3')](_0x44c20b,_0x344544);};}function removeListener(_0x14a109,_0x3f7d99){return function(){WhatsappInteractionEvents['removeListener'](_0x14a109,_0x3f7d99);};}exports[_0x4153('0x4')]=function(_0x59f90c){for(var _0x1d0c2c=0x0,_0x446b36=events['length'];_0x1d0c2c<_0x446b36;_0x1d0c2c++){var _0x1383f2=events[_0x1d0c2c];var _0x5a1b03=createListener(_0x4153('0x5')+_0x1383f2,_0x59f90c);WhatsappInteractionEvents['on'](_0x1383f2,_0x5a1b03);}}; \ No newline at end of file +var _0xc989=['./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc989,0xd8));var _0x9c98=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc989[_0x167cc1];return _0x10bc4b;};'use strict';var WhatsappInteractionEvents=require(_0x9c98('0x0'));var events=[_0x9c98('0x1'),_0x9c98('0x2'),_0x9c98('0x3')];function createListener(_0x50db27,_0x70514b){return function(_0x1fdcd6){_0x70514b[_0x9c98('0x4')](_0x50db27,_0x1fdcd6);};}function removeListener(_0x250dfb,_0x43f5a0){return function(){WhatsappInteractionEvents[_0x9c98('0x5')](_0x250dfb,_0x43f5a0);};}exports[_0x9c98('0x6')]=function(_0x1f4168){for(var _0x5bd669=0x0,_0x1d76cb=events[_0x9c98('0x7')];_0x5bd669<_0x1d76cb;_0x5bd669++){var _0x36ff1f=events[_0x5bd669];var _0x1b2116=createListener(_0x9c98('0x8')+_0x36ff1f,_0x1f4168);WhatsappInteractionEvents['on'](_0x36ff1f,_0x1b2116);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 42b08d5..a6708b6 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 _0x65ca=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsappmessage:create','create','status','put','accept','reject'];(function(_0x2ed92f,_0x54091f){var _0x26ff04=function(_0x5ed317){while(--_0x5ed317){_0x2ed92f['push'](_0x2ed92f['shift']());}};_0x26ff04(++_0x54091f);}(_0x65ca,0x199));var _0xa65c=function(_0x504f4c,_0x1aedf0){_0x504f4c=_0x504f4c-0x0;var _0x3e7570=_0x65ca[_0x504f4c];return _0x3e7570;};'use strict';var multer=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var path=require(_0xa65c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa65c('0x3'));var router=express[_0xa65c('0x4')]();var fs_extra=require(_0xa65c('0x5'));var auth=require(_0xa65c('0x6'));var interaction=require(_0xa65c('0x7'));var config=require('../../config/environment');var controller=require(_0xa65c('0x8'));router[_0xa65c('0x9')]('/',auth[_0xa65c('0xa')](),controller[_0xa65c('0xb')]);router[_0xa65c('0x9')](_0xa65c('0xc'),auth[_0xa65c('0xa')](),controller[_0xa65c('0xd')]);router[_0xa65c('0x9')](_0xa65c('0xe'),auth[_0xa65c('0xa')](),controller['show']);router[_0xa65c('0xf')]('/',auth[_0xa65c('0xa')](),interaction[_0xa65c('0x10')]('whatsapp',_0xa65c('0x11')),controller[_0xa65c('0x12')]);router['post']('/:id/status',controller[_0xa65c('0x13')]);router[_0xa65c('0x14')]('/:id',auth[_0xa65c('0xa')](),controller['update']);router[_0xa65c('0x14')]('/:id/accept',auth[_0xa65c('0xa')](),controller[_0xa65c('0x15')]);router[_0xa65c('0x14')]('/:id/reject',auth[_0xa65c('0xa')](),controller[_0xa65c('0x16')]);router['delete'](_0xa65c('0xe'),auth[_0xa65c('0xa')](),controller['destroy']);module[_0xa65c('0x17')]=router; \ No newline at end of file +var _0x44c9=['reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','whatsappmessage:create','status','put','update','/:id/accept','/:id/reject'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x44c9,0x112));var _0x944c=function(_0x5c41e9,_0x435daf){_0x5c41e9=_0x5c41e9-0x0;var _0x2dcb5c=_0x44c9[_0x5c41e9];return _0x2dcb5c;};'use strict';var multer=require(_0x944c('0x0'));var util=require(_0x944c('0x1'));var path=require(_0x944c('0x2'));var timeout=require('connect-timeout');var express=require(_0x944c('0x3'));var router=express[_0x944c('0x4')]();var fs_extra=require(_0x944c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x944c('0x6'));var config=require(_0x944c('0x7'));var controller=require(_0x944c('0x8'));router[_0x944c('0x9')]('/',auth[_0x944c('0xa')](),controller[_0x944c('0xb')]);router['get'](_0x944c('0xc'),auth['isAuthenticated'](),controller[_0x944c('0xd')]);router[_0x944c('0x9')](_0x944c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x944c('0xf')]('/',auth[_0x944c('0xa')](),interaction[_0x944c('0x10')]('whatsapp',_0x944c('0x11')),controller['create']);router['post']('/:id/status',controller[_0x944c('0x12')]);router[_0x944c('0x13')](_0x944c('0xe'),auth['isAuthenticated'](),controller[_0x944c('0x14')]);router[_0x944c('0x13')](_0x944c('0x15'),auth[_0x944c('0xa')](),controller['accept']);router['put'](_0x944c('0x16'),auth[_0x944c('0xa')](),controller[_0x944c('0x17')]);router[_0x944c('0x18')](_0x944c('0xe'),auth[_0x944c('0xa')](),controller[_0x944c('0x19')]);module[_0x944c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 53b9736..12347f6 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 _0x7a2d=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x4a77d7,_0xa87f48){var _0x33450a=function(_0x15fa21){while(--_0x15fa21){_0x4a77d7['push'](_0x4a77d7['shift']());}};_0x33450a(++_0xa87f48);}(_0x7a2d,0x142));var _0xd7a2=function(_0x316b0b,_0x5063ce){_0x316b0b=_0x316b0b-0x0;var _0x3592d7=_0x7a2d[_0x316b0b];return _0x3592d7;};'use strict';var Sequelize=require(_0xd7a2('0x0'));module[_0xd7a2('0x1')]={'body':{'type':Sequelize[_0xd7a2('0x2')](_0xd7a2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd7a2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd7a2('0x5')]('in',_0xd7a2('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xd7a2('0x7')]},'readAt':{'type':Sequelize[_0xd7a2('0x8')]},'secret':{'type':Sequelize[_0xd7a2('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd7a2('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8bea=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x4127dc,_0x5558fe){var _0x310070=function(_0x190691){while(--_0x190691){_0x4127dc['push'](_0x4127dc['shift']());}};_0x310070(++_0x5558fe);}(_0x8bea,0xfc));var _0xa8be=function(_0x25f94c,_0x43702f){_0x25f94c=_0x25f94c-0x0;var _0x2693f0=_0x8bea[_0x25f94c];return _0x2693f0;};'use strict';var Sequelize=require(_0xa8be('0x0'));module[_0xa8be('0x1')]={'body':{'type':Sequelize[_0xa8be('0x2')](_0xa8be('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa8be('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8be('0x5')]('in','out'),'defaultValue':_0xa8be('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa8be('0x7')](0xbe)},'phone':{'type':Sequelize[_0xa8be('0x7')]},'readAt':{'type':Sequelize[_0xa8be('0x8')]},'secret':{'type':Sequelize[_0xa8be('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa8be('0x7')]},'providerResponse':{'type':Sequelize[_0xa8be('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e8146db..73516a4 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 _0xc611=['status','offset','undefined','limit','count','json','apply','save','update','destroy','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','create','body','params','describe','accept','whatsapp','read','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xc611,0xec));var _0x1c61=function(_0xe8c8f7,_0x20bb07){_0xe8c8f7=_0xe8c8f7-0x0;var _0x38023b=_0xc611[_0xe8c8f7];return _0x38023b;};'use strict';var emlformat=require(_0x1c61('0x0'));var rimraf=require(_0x1c61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c61('0x2'));var rp=require(_0x1c61('0x3'));var moment=require('moment');var BPromise=require(_0x1c61('0x4'));var Mustache=require(_0x1c61('0x5'));var util=require('util');var path=require(_0x1c61('0x6'));var sox=require(_0x1c61('0x7'));var csv=require('to-csv');var ejs=require(_0x1c61('0x8'));var fs=require('fs');var fs_extra=require(_0x1c61('0x9'));var _=require(_0x1c61('0xa'));var squel=require(_0x1c61('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c61('0xc'));var deskjs=require(_0x1c61('0xd'));var toCsv=require(_0x1c61('0xe'));var querystring=require(_0x1c61('0xf'));var Papa=require(_0x1c61('0x10'));var Redis=require(_0x1c61('0x11'));var authService=require(_0x1c61('0x12'));var qs=require(_0x1c61('0x13'));var as=require(_0x1c61('0x14'));var hardwareService=require(_0x1c61('0x15'));var logger=require(_0x1c61('0x16'))(_0x1c61('0x17'));var utils=require(_0x1c61('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1c61('0x19'));var db=require('../../mysqldb')['db'];config[_0x1c61('0x1a')]=_[_0x1c61('0x1b')](config[_0x1c61('0x1a')],{'host':_0x1c61('0x1c'),'port':0x18eb});var socket=require(_0x1c61('0x1d'))(new Redis(config[_0x1c61('0x1a')]));require(_0x1c61('0x1e'))[_0x1c61('0x1f')](socket);var jayson=require(_0x1c61('0x20'));var client=jayson[_0x1c61('0x21')][_0x1c61('0x22')]({'port':0x232c});var client9002=jayson[_0x1c61('0x21')][_0x1c61('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x4a30c0,_0x3777ac,_0x3c5e45,_0x1e1fea){return new BPromise(function(_0x1b42d7,_0x2da2b9){var _0x43586b=_0x1e1fea||client;return _0x43586b[_0x1c61('0x23')](_0x4a30c0,_0x3c5e45)[_0x1c61('0x24')](function(_0x2b9992){logger[_0x1c61('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x3777ac,_0x1c61('0x26'));logger['debug'](_0x1c61('0x27'),_0x3777ac,_0x1c61('0x26'),JSON[_0x1c61('0x28')](_0x2b9992));if(_0x2b9992[_0x1c61('0x29')]){if(_0x2b9992[_0x1c61('0x29')]['code']===0x1f4){logger[_0x1c61('0x29')](_0x1c61('0x2a'),_0x3777ac,_0x2b9992[_0x1c61('0x29')]['message']);return _0x2da2b9(_0x2b9992['error'][_0x1c61('0x2b')]);}logger[_0x1c61('0x29')](_0x1c61('0x2a'),_0x3777ac,_0x2b9992[_0x1c61('0x29')]['message']);return _0x1b42d7(_0x2b9992[_0x1c61('0x29')]['message']);}else{logger[_0x1c61('0x25')](_0x1c61('0x2a'),_0x3777ac,_0x1c61('0x26'));_0x1b42d7(_0x2b9992[_0x1c61('0x2c')]['message']);}})[_0x1c61('0x2d')](function(_0x311013){logger['error'](_0x1c61('0x2a'),_0x3777ac,_0x311013);_0x2da2b9(_0x311013);});});}function respondWithStatusCode(_0x2b64f9,_0x2e29ae){_0x2e29ae=_0x2e29ae||0xcc;return function(_0x7176e1){if(_0x7176e1){return _0x2b64f9[_0x1c61('0x2e')](_0x2e29ae);}return _0x2b64f9['status'](_0x2e29ae)[_0x1c61('0x2f')]();};}function respondWithResult(_0x3c7833,_0x4f5beb){_0x4f5beb=_0x4f5beb||0xc8;return function(_0x407260){if(_0x407260){return _0x3c7833[_0x1c61('0x30')](_0x4f5beb)['json'](_0x407260);}};}function respondWithFilteredResult(_0x1b1ac7,_0x2899d8){return function(_0x243e16){if(_0x243e16){var _0x37756d=typeof _0x2899d8[_0x1c61('0x31')]===_0x1c61('0x32')&&typeof _0x2899d8[_0x1c61('0x33')]===_0x1c61('0x32');var _0x5678e2=_0x243e16[_0x1c61('0x34')];var _0x2d3fcb=_0x37756d?0x0:_0x2899d8['offset'];var _0x3b2632=_0x37756d?_0x243e16[_0x1c61('0x34')]:_0x2899d8[_0x1c61('0x31')]+_0x2899d8[_0x1c61('0x33')];var _0x4a3b41;if(_0x3b2632>=_0x5678e2){_0x3b2632=_0x5678e2;_0x4a3b41=0xc8;}else{_0x4a3b41=0xce;}_0x1b1ac7[_0x1c61('0x30')](_0x4a3b41);return _0x1b1ac7['set']('Content-Range',_0x2d3fcb+'-'+_0x3b2632+'/'+_0x5678e2)[_0x1c61('0x35')](_0x243e16);}return null;};}function patchUpdates(_0x1bad33){return function(_0x1f70f6){try{jsonpatch[_0x1c61('0x36')](_0x1f70f6,_0x1bad33,!![]);}catch(_0x2486e6){return BPromise['reject'](_0x2486e6);}return _0x1f70f6[_0x1c61('0x37')]();};}function saveUpdates(_0x4c34f1,_0x3c3ce4){return function(_0x62c8b3){if(_0x62c8b3){return _0x62c8b3[_0x1c61('0x38')](_0x4c34f1)[_0x1c61('0x24')](function(_0x46ab6d){return _0x46ab6d;});}return null;};}function removeEntity(_0x474e83,_0x1944a8){return function(_0x49d6d9){if(_0x49d6d9){return _0x49d6d9[_0x1c61('0x39')]()[_0x1c61('0x24')](function(){_0x474e83[_0x1c61('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x189c7e,_0x417208){return function(_0x251364){if(!_0x251364){_0x189c7e[_0x1c61('0x2e')](0x194);}return _0x251364;};}function handleError(_0xfcf021,_0x162d06){_0x162d06=_0x162d06||0x1f4;return function(_0x57d7f1){logger[_0x1c61('0x29')](_0x57d7f1['stack']);if(_0x57d7f1[_0x1c61('0x3a')]){delete _0x57d7f1['name'];}_0xfcf021[_0x1c61('0x30')](_0x162d06)[_0x1c61('0x3b')](_0x57d7f1);};}exports[_0x1c61('0x3c')]=function(_0x3e6027,_0x4d841f){var _0x1cad29={},_0x3cff9a={},_0x3475c2={'count':0x0,'rows':[]};var _0xf96a07=_[_0x1c61('0x3d')](db[_0x1c61('0x3e')][_0x1c61('0x3f')],function(_0x42f38f){return{'name':_0x42f38f[_0x1c61('0x40')],'type':_0x42f38f[_0x1c61('0x41')][_0x1c61('0x42')]};});_0x3cff9a[_0x1c61('0x43')]=_[_0x1c61('0x3d')](_0xf96a07,_0x1c61('0x3a'));_0x3cff9a[_0x1c61('0x44')]=_[_0x1c61('0x45')](_0x3e6027['query']);_0x3cff9a[_0x1c61('0x46')]=_[_0x1c61('0x47')](_0x3cff9a['model'],_0x3cff9a[_0x1c61('0x44')]);_0x1cad29['attributes']=_[_0x1c61('0x47')](_0x3cff9a[_0x1c61('0x43')],qs['fields'](_0x3e6027[_0x1c61('0x44')][_0x1c61('0x48')]));_0x1cad29[_0x1c61('0x49')]=_0x1cad29[_0x1c61('0x49')][_0x1c61('0x4a')]?_0x1cad29[_0x1c61('0x49')]:_0x3cff9a['model'];if(!_0x3e6027['query'][_0x1c61('0x4b')](_0x1c61('0x4c'))){_0x1cad29[_0x1c61('0x33')]=qs[_0x1c61('0x33')](_0x3e6027['query'][_0x1c61('0x33')]);_0x1cad29['offset']=qs[_0x1c61('0x31')](_0x3e6027['query'][_0x1c61('0x31')]);}_0x1cad29[_0x1c61('0x4d')]=qs[_0x1c61('0x4e')](_0x3e6027[_0x1c61('0x44')][_0x1c61('0x4e')]);_0x1cad29['where']=qs[_0x1c61('0x46')](_[_0x1c61('0x4f')](_0x3e6027['query'],_0x3cff9a[_0x1c61('0x46')]),_0xf96a07);if(_0x3e6027[_0x1c61('0x44')][_0x1c61('0x50')]){_0x1cad29[_0x1c61('0x51')]=_['merge'](_0x1cad29['where'],{'$or':_['map'](_0xf96a07,function(_0x79e8f2){if(_0x79e8f2['type']!==_0x1c61('0x52')){var _0x4b743e={};_0x4b743e[_0x79e8f2[_0x1c61('0x3a')]]={'$like':'%'+_0x3e6027[_0x1c61('0x44')][_0x1c61('0x50')]+'%'};return _0x4b743e;}})});}_0x1cad29=_[_0x1c61('0x53')]({},_0x1cad29,_0x3e6027[_0x1c61('0x54')]);var _0x5a3499={'where':_0x1cad29[_0x1c61('0x51')]};return db['WhatsappMessage']['count'](_0x5a3499)[_0x1c61('0x24')](function(_0x200c97){_0x3475c2['count']=_0x200c97;if(_0x3e6027['query'][_0x1c61('0x55')]){_0x1cad29[_0x1c61('0x56')]=[{'all':!![]}];}return db[_0x1c61('0x3e')][_0x1c61('0x57')](_0x1cad29);})[_0x1c61('0x24')](function(_0x14f55a){_0x3475c2[_0x1c61('0x58')]=_0x14f55a;return _0x3475c2;})[_0x1c61('0x24')](respondWithFilteredResult(_0x4d841f,_0x1cad29))[_0x1c61('0x2d')](handleError(_0x4d841f,null));};exports[_0x1c61('0x59')]=function(_0x1db3a3,_0x16bfce){var _0x4742df={'raw':!![],'where':{'id':_0x1db3a3['params']['id']}},_0x1e83ea={};_0x1e83ea[_0x1c61('0x43')]=_['keys'](db[_0x1c61('0x3e')][_0x1c61('0x3f')]);_0x1e83ea[_0x1c61('0x44')]=_[_0x1c61('0x45')](_0x1db3a3[_0x1c61('0x44')]);_0x1e83ea[_0x1c61('0x46')]=_['intersection'](_0x1e83ea['model'],_0x1e83ea[_0x1c61('0x44')]);_0x4742df[_0x1c61('0x49')]=_[_0x1c61('0x47')](_0x1e83ea['model'],qs[_0x1c61('0x48')](_0x1db3a3[_0x1c61('0x44')]['fields']));_0x4742df['attributes']=_0x4742df[_0x1c61('0x49')][_0x1c61('0x4a')]?_0x4742df['attributes']:_0x1e83ea[_0x1c61('0x43')];if(_0x1db3a3[_0x1c61('0x44')][_0x1c61('0x55')]){_0x4742df[_0x1c61('0x56')]=[{'all':!![]}];}_0x4742df=_[_0x1c61('0x53')]({},_0x4742df,_0x1db3a3[_0x1c61('0x54')]);return db[_0x1c61('0x3e')][_0x1c61('0x5a')](_0x4742df)[_0x1c61('0x24')](handleEntityNotFound(_0x16bfce,null))[_0x1c61('0x24')](respondWithResult(_0x16bfce,null))[_0x1c61('0x2d')](handleError(_0x16bfce,null));};exports[_0x1c61('0x5b')]=function(_0x3cc6f0,_0xd07c1f){return db[_0x1c61('0x3e')][_0x1c61('0x5b')](_0x3cc6f0[_0x1c61('0x5c')],{})[_0x1c61('0x24')](respondWithResult(_0xd07c1f,0xc9))[_0x1c61('0x2d')](handleError(_0xd07c1f,null));};exports['update']=function(_0x4f9250,_0x45270e){if(_0x4f9250[_0x1c61('0x5c')]['id']){delete _0x4f9250[_0x1c61('0x5c')]['id'];}return db['WhatsappMessage'][_0x1c61('0x5a')]({'where':{'id':_0x4f9250[_0x1c61('0x5d')]['id']}})[_0x1c61('0x24')](handleEntityNotFound(_0x45270e,null))[_0x1c61('0x24')](saveUpdates(_0x4f9250[_0x1c61('0x5c')],null))['then'](respondWithResult(_0x45270e,null))[_0x1c61('0x2d')](handleError(_0x45270e,null));};exports[_0x1c61('0x39')]=function(_0xa14545,_0x5de85f){return db[_0x1c61('0x3e')][_0x1c61('0x5a')]({'where':{'id':_0xa14545[_0x1c61('0x5d')]['id']}})[_0x1c61('0x24')](handleEntityNotFound(_0x5de85f,null))[_0x1c61('0x24')](removeEntity(_0x5de85f,null))[_0x1c61('0x2d')](handleError(_0x5de85f,null));};exports[_0x1c61('0x5e')]=function(_0x3eb3ee,_0x27cb58){return db[_0x1c61('0x3e')]['describe']()[_0x1c61('0x24')](respondWithResult(_0x27cb58,null))[_0x1c61('0x2d')](handleError(_0x27cb58,null));};var interaction_log=require(_0x1c61('0x16'))('whatsapp-interactions');exports[_0x1c61('0x5f')]=function(_0x16c53e,_0xd90b0c,_0x20dedc){var _0xba1664={'agent':{},'channel':_0x1c61('0x60')};if(_0x16c53e[_0x1c61('0x5c')]['id']){delete _0x16c53e[_0x1c61('0x5c')]['id'];}_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x61')]=!![];_0x16c53e[_0x1c61('0x5c')]['readAt']=moment()[_0x1c61('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')]=_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')]||_0x16c53e[_0x1c61('0x64')]['id'];_0xba1664[_0x1c61('0x65')]['id']=_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')];return db['WhatsappMessage'][_0x1c61('0x5a')]({'where':{'id':_0x16c53e[_0x1c61('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd90b0c,null))[_0x1c61('0x24')](saveUpdates(_0x16c53e[_0x1c61('0x5c')],null))[_0x1c61('0x24')](function(_0x449883){if(_0x449883){_0xba1664[_0x1c61('0x2b')]=_0x449883[_0x1c61('0x66')]({'plain':!![]});return db[_0x1c61('0x67')][_0x1c61('0x5a')]({'where':{'id':_0x449883[_0x1c61('0x68')]}});}return null;})[_0x1c61('0x24')](handleEntityNotFound(_0xd90b0c,null))[_0x1c61('0x24')](function(_0x38fd41){if(_0x38fd41){return _0x38fd41[_0x1c61('0x38')]({'UserId':_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')],'read1stAt':_[_0x1c61('0x69')](_0x38fd41['read1stAt'])?moment()[_0x1c61('0x62')](_0x1c61('0x6a')):undefined});}return null;})[_0x1c61('0x24')](function(_0xeb09b9){if(_0xeb09b9){_0xba1664[_0x1c61('0x6b')]=_0xeb09b9[_0x1c61('0x66')]({'plain':!![]});interaction_log[_0x1c61('0x25')](_0x1c61('0x6c'),_0x16c53e['user']['id'],_0x16c53e[_0x1c61('0x64')]['name'],_0x16c53e[_0x1c61('0x64')]['role'],_0xba1664[_0x1c61('0x6b')]['id'],_0x16c53e['body']?JSON[_0x1c61('0x28')](_0x16c53e[_0x1c61('0x5c')]):_0x1c61('0x6d'));return respondWithRpcPromise(_0x1c61('0x6e'),_0x1c61('0x6f'),_0xba1664);}return null;})[_0x1c61('0x24')](function(_0x177bad){var _0x14e95a=_0x1c61('0x70')+_0x177bad[_0x1c61('0x2b')][_0x1c61('0x71')];return db[_0x1c61('0x72')][_0x1c61('0x44')](_0x14e95a,{'type':db['Sequelize'][_0x1c61('0x73')][_0x1c61('0x74')],'raw':!![]})[_0x1c61('0x24')](function(_0x49f731){return _0x49f731;});})['then'](function(_0x18dee8){if(_0x18dee8){_0xba1664[_0x1c61('0x2b')][_0x1c61('0x75')]=_0x18dee8[0x0];if(!_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')])return;return db[_0x1c61('0x76')]['find']({'where':{'id':_0x16c53e[_0x1c61('0x5c')][_0x1c61('0x63')],'role':_0x1c61('0x65')},'attributes':['id',_0x1c61('0x3a'),_0x1c61('0x77'),_0x1c61('0x78'),_0x1c61('0x79')],'raw':!![]});}return null;})['then'](function(_0x417e70){if(!_0x417e70)return null;_0xba1664[_0x1c61('0x2b')][_0x1c61('0x65')]=_0x417e70;return _0xba1664;})[_0x1c61('0x24')](function(_0x5b97db){if(_0x5b97db){if(_0x16c53e[_0x1c61('0x5c')]['manual']){_0xba1664[_0x1c61('0x2b')][_0x1c61('0x7a')]=util[_0x1c61('0x62')](_0x1c61('0x7b'),_0x16c53e['user']['name']);_0xba1664['message'][_0x1c61('0x7c')]=_0xba1664[_0x1c61('0x7c')];_0xba1664['message'][_0x1c61('0x7d')]=_0xba1664[_0x1c61('0x7c')];_0xba1664[_0x1c61('0x2b')][_0x1c61('0x7e')]=_0x1c61('0x5f');return respondWithRpcPromise(_0x1c61('0x7f'),_0x1c61('0x7f'),{'event':'acceptmessage','message':_0xba1664[_0x1c61('0x2b')]},client9002)[_0x1c61('0x24')](function(){return _0xba1664;});}return _0xba1664;}return null;})[_0x1c61('0x24')](respondWithResult(_0xd90b0c,null))[_0x1c61('0x2d')](handleError(_0xd90b0c,null));};var interaction_log=require(_0x1c61('0x16'))('whatsapp-interactions');exports[_0x1c61('0x80')]=function(_0x4eebf3,_0x783acf,_0x4dc3b3){var _0x34b348={'agent':{},'channel':'whatsapp'};if(_0x4eebf3['body']['id']){delete _0x4eebf3[_0x1c61('0x5c')]['id'];}_0x4eebf3[_0x1c61('0x5c')][_0x1c61('0x63')]=_0x4eebf3[_0x1c61('0x5c')][_0x1c61('0x63')]||_0x4eebf3[_0x1c61('0x64')]['id'];_0x34b348['agent']['id']=_0x4eebf3[_0x1c61('0x5c')][_0x1c61('0x63')];return db[_0x1c61('0x3e')][_0x1c61('0x5a')]({'where':{'id':_0x4eebf3['params']['id'],'UserId':null}})[_0x1c61('0x24')](handleEntityNotFound(_0x783acf,null))[_0x1c61('0x24')](function(_0x1e2515){if(_0x1e2515){_0x34b348[_0x1c61('0x2b')]=_0x1e2515[_0x1c61('0x66')]({'plain':!![]});return db[_0x1c61('0x67')]['find']({'where':{'id':_0x1e2515['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x783acf,null))[_0x1c61('0x24')](function(_0x46aa94){if(_0x46aa94){_0x34b348[_0x1c61('0x6b')]=_0x46aa94[_0x1c61('0x66')]({'plain':!![]});interaction_log['info'](_0x1c61('0x81'),_0x4eebf3[_0x1c61('0x64')]['id'],_0x4eebf3['user']['name'],_0x4eebf3[_0x1c61('0x64')]['role'],_0x34b348[_0x1c61('0x6b')]['id'],_0x4eebf3[_0x1c61('0x5c')]?JSON[_0x1c61('0x28')](_0x4eebf3[_0x1c61('0x5c')]):'null');return respondWithRpcPromise(_0x1c61('0x82'),_0x1c61('0x83'),_0x34b348);}return null;})['then'](function(_0x585e6e){var _0x357e26=_0x1c61('0x70')+_0x585e6e[_0x1c61('0x2b')][_0x1c61('0x71')];return db[_0x1c61('0x72')][_0x1c61('0x44')](_0x357e26,{'type':db[_0x1c61('0x84')][_0x1c61('0x73')]['SELECT'],'raw':!![]})[_0x1c61('0x24')](function(_0x57754a){return _0x57754a;});})['then'](function(_0x1f9c8c){if(_0x1f9c8c){_0x34b348['message'][_0x1c61('0x75')]=_0x1f9c8c[0x0];if(!_0x4eebf3[_0x1c61('0x5c')][_0x1c61('0x63')])return;return db['User'][_0x1c61('0x5a')]({'where':{'id':_0x4eebf3[_0x1c61('0x5c')][_0x1c61('0x63')],'role':_0x1c61('0x65')},'attributes':['id',_0x1c61('0x3a'),_0x1c61('0x77'),'email',_0x1c61('0x79')],'raw':!![]});}return null;})[_0x1c61('0x24')](function(_0x5cdca6){if(!_0x5cdca6)return null;_0x34b348[_0x1c61('0x2b')][_0x1c61('0x65')]=_0x5cdca6;return _0x34b348;})[_0x1c61('0x24')](function(_0x24f351){if(_0x24f351){_0x24f351['message'][_0x1c61('0x7a')]=util['format'](_0x1c61('0x7b'),_0x4eebf3[_0x1c61('0x64')][_0x1c61('0x3a')]);_0x24f351[_0x1c61('0x2b')][_0x1c61('0x7c')]=_0x34b348[_0x1c61('0x7c')];_0x24f351['message'][_0x1c61('0x7d')]=_0x34b348[_0x1c61('0x7c')];_0x24f351['message'][_0x1c61('0x7e')]=_0x1c61('0x80');respondWithRpcPromise('EventManager',_0x1c61('0x7f'),{'event':_0x1c61('0x85'),'message':_0x24f351[_0x1c61('0x2b')]},client9002);return _0x34b348;}return null;})[_0x1c61('0x24')](respondWithResult(_0x783acf,null))['catch'](handleError(_0x783acf,null));};exports[_0x1c61('0x30')]=function(_0x1759bc,_0x382e2e,_0x292d09){if(_0x1759bc[_0x1c61('0x5c')]['id']){delete _0x1759bc[_0x1c61('0x5c')]['id'];}var _0x51d689;return db[_0x1c61('0x3e')][_0x1c61('0x5a')]({'where':{'id':_0x1759bc[_0x1c61('0x5d')]['id']}})[_0x1c61('0x24')](handleEntityNotFound(_0x382e2e,null))['then'](function(_0x638f84){if(_0x638f84){_0x51d689=_0x638f84;return db[_0x1c61('0x86')][_0x1c61('0x5a')]({'where':{'id':_0x638f84[_0x1c61('0x87')]}});}})[_0x1c61('0x24')](handleEntityNotFound(_0x382e2e,null))[_0x1c61('0x24')](function(_0x530ebb){if(_0x530ebb){logger[_0x1c61('0x88')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x1c61('0x30'),_0x1c61('0x89'),_0x530ebb[_0x1c61('0x41')],util[_0x1c61('0x8a')](_0x1759bc['body'],{'showHidden':![],'depth':null}));switch(_0x530ebb[_0x1c61('0x41')]){case _0x1c61('0x8b'):if(_0x1759bc[_0x1c61('0x5c')][_0x1c61('0x8c')]&&_0x1759bc[_0x1c61('0x5c')][_0x1c61('0x8c')]===_0x51d689['messageId']&&_0x1759bc[_0x1c61('0x5c')][_0x1c61('0x8d')]&&_0x1759bc[_0x1c61('0x5c')]['MessageStatus']==='read'){return _0x51d689[_0x1c61('0x38')]({'read':!![]});}else{logger[_0x1c61('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1c61('0x30'),_0x1c61('0x8b'),util['inspect'](_0x1759bc[_0x1c61('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x51d689;}})['then'](respondWithResult(_0x382e2e,null))[_0x1c61('0x2d')](handleError(_0x382e2e,null));}; \ No newline at end of file +var _0x1fda=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','destroy','describe','../../config/logger','whatsapp-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','role','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fda,0x173));var _0xa1fd=function(_0x96ccd0,_0x484539){_0x96ccd0=_0x96ccd0-0x0;var _0x7ebf8f=_0x1fda[_0x96ccd0];return _0x7ebf8f;};'use strict';var emlformat=require(_0xa1fd('0x0'));var rimraf=require(_0xa1fd('0x1'));var zipdir=require(_0xa1fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa1fd('0x3'));var BPromise=require(_0xa1fd('0x4'));var Mustache=require(_0xa1fd('0x5'));var util=require(_0xa1fd('0x6'));var path=require('path');var sox=require(_0xa1fd('0x7'));var csv=require('to-csv');var ejs=require(_0xa1fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1fd('0x9'));var squel=require(_0xa1fd('0xa'));var crypto=require(_0xa1fd('0xb'));var jsforce=require(_0xa1fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1fd('0xd'));var querystring=require(_0xa1fd('0xe'));var Papa=require(_0xa1fd('0xf'));var Redis=require(_0xa1fd('0x10'));var authService=require(_0xa1fd('0x11'));var qs=require(_0xa1fd('0x12'));var as=require(_0xa1fd('0x13'));var hardwareService=require(_0xa1fd('0x14'));var logger=require('../../config/logger')(_0xa1fd('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa1fd('0x16'));var db=require(_0xa1fd('0x17'))['db'];config['redis']=_[_0xa1fd('0x18')](config['redis'],{'host':_0xa1fd('0x19'),'port':0x18eb});var socket=require(_0xa1fd('0x1a'))(new Redis(config[_0xa1fd('0x1b')]));require(_0xa1fd('0x1c'))[_0xa1fd('0x1d')](socket);var jayson=require(_0xa1fd('0x1e'));var client=jayson[_0xa1fd('0x1f')][_0xa1fd('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xa1fd('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x12f87d,_0xc77440,_0x5a119e,_0x4bf56f){return new BPromise(function(_0x5e6763,_0x39e574){var _0x56fe4f=_0x4bf56f||client;return _0x56fe4f[_0xa1fd('0x21')](_0x12f87d,_0x5a119e)[_0xa1fd('0x22')](function(_0x39b248){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0xc77440,_0xa1fd('0x23'));logger[_0xa1fd('0x24')](_0xa1fd('0x25'),_0xc77440,_0xa1fd('0x23'),JSON[_0xa1fd('0x26')](_0x39b248));if(_0x39b248[_0xa1fd('0x27')]){if(_0x39b248[_0xa1fd('0x27')][_0xa1fd('0x28')]===0x1f4){logger[_0xa1fd('0x27')](_0xa1fd('0x29'),_0xc77440,_0x39b248[_0xa1fd('0x27')]['message']);return _0x39e574(_0x39b248[_0xa1fd('0x27')][_0xa1fd('0x2a')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xc77440,_0x39b248[_0xa1fd('0x27')][_0xa1fd('0x2a')]);return _0x5e6763(_0x39b248[_0xa1fd('0x27')][_0xa1fd('0x2a')]);}else{logger[_0xa1fd('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0xc77440,'request\x20sent');_0x5e6763(_0x39b248[_0xa1fd('0x2c')]['message']);}})[_0xa1fd('0x2d')](function(_0x52d5dd){logger['error'](_0xa1fd('0x29'),_0xc77440,_0x52d5dd);_0x39e574(_0x52d5dd);});});}function respondWithStatusCode(_0x3ff576,_0x543449){_0x543449=_0x543449||0xcc;return function(_0x53ab69){if(_0x53ab69){return _0x3ff576['sendStatus'](_0x543449);}return _0x3ff576[_0xa1fd('0x2e')](_0x543449)[_0xa1fd('0x2f')]();};}function respondWithResult(_0x4aac4f,_0x554526){_0x554526=_0x554526||0xc8;return function(_0x2246fd){if(_0x2246fd){return _0x4aac4f[_0xa1fd('0x2e')](_0x554526)[_0xa1fd('0x30')](_0x2246fd);}};}function respondWithFilteredResult(_0xe190d1,_0x3e0cb8){return function(_0x32e2d1){if(_0x32e2d1){var _0x42d84a=typeof _0x3e0cb8[_0xa1fd('0x31')]===_0xa1fd('0x32')&&typeof _0x3e0cb8[_0xa1fd('0x33')]===_0xa1fd('0x32');var _0x145a86=_0x32e2d1[_0xa1fd('0x34')];var _0x3f3093=_0x42d84a?0x0:_0x3e0cb8[_0xa1fd('0x31')];var _0x48a71a=_0x42d84a?_0x32e2d1[_0xa1fd('0x34')]:_0x3e0cb8[_0xa1fd('0x31')]+_0x3e0cb8[_0xa1fd('0x33')];var _0x2a4520;if(_0x48a71a>=_0x145a86){_0x48a71a=_0x145a86;_0x2a4520=0xc8;}else{_0x2a4520=0xce;}_0xe190d1[_0xa1fd('0x2e')](_0x2a4520);return _0xe190d1[_0xa1fd('0x35')](_0xa1fd('0x36'),_0x3f3093+'-'+_0x48a71a+'/'+_0x145a86)[_0xa1fd('0x30')](_0x32e2d1);}return null;};}function patchUpdates(_0x1d7d48){return function(_0x31e19a){try{jsonpatch[_0xa1fd('0x37')](_0x31e19a,_0x1d7d48,!![]);}catch(_0x19d909){return BPromise['reject'](_0x19d909);}return _0x31e19a[_0xa1fd('0x38')]();};}function saveUpdates(_0x43c754,_0x1b4f80){return function(_0x1013ff){if(_0x1013ff){return _0x1013ff[_0xa1fd('0x39')](_0x43c754)[_0xa1fd('0x22')](function(_0x77e0a5){return _0x77e0a5;});}return null;};}function removeEntity(_0x22023e,_0x2a1733){return function(_0x44f0f5){if(_0x44f0f5){return _0x44f0f5['destroy']()[_0xa1fd('0x22')](function(){_0x22023e[_0xa1fd('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d59c2,_0x150847){return function(_0x3ffaf4){if(!_0x3ffaf4){_0x4d59c2['sendStatus'](0x194);}return _0x3ffaf4;};}function handleError(_0x135700,_0x30ee57){_0x30ee57=_0x30ee57||0x1f4;return function(_0x25ae94){logger['error'](_0x25ae94['stack']);if(_0x25ae94[_0xa1fd('0x3a')]){delete _0x25ae94[_0xa1fd('0x3a')];}_0x135700[_0xa1fd('0x2e')](_0x30ee57)['send'](_0x25ae94);};}exports[_0xa1fd('0x3b')]=function(_0x2f2d47,_0x1cd985){var _0x507c34={},_0x9cd3d3={},_0x12b8e7={'count':0x0,'rows':[]};var _0x446c05=_[_0xa1fd('0x3c')](db[_0xa1fd('0x3d')][_0xa1fd('0x3e')],function(_0x219a0f){return{'name':_0x219a0f[_0xa1fd('0x3f')],'type':_0x219a0f[_0xa1fd('0x40')]['key']};});_0x9cd3d3[_0xa1fd('0x41')]=_[_0xa1fd('0x3c')](_0x446c05,_0xa1fd('0x3a'));_0x9cd3d3[_0xa1fd('0x42')]=_['keys'](_0x2f2d47[_0xa1fd('0x42')]);_0x9cd3d3[_0xa1fd('0x43')]=_['intersection'](_0x9cd3d3[_0xa1fd('0x41')],_0x9cd3d3[_0xa1fd('0x42')]);_0x507c34[_0xa1fd('0x44')]=_[_0xa1fd('0x45')](_0x9cd3d3['model'],qs[_0xa1fd('0x46')](_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x46')]));_0x507c34['attributes']=_0x507c34['attributes']['length']?_0x507c34[_0xa1fd('0x44')]:_0x9cd3d3[_0xa1fd('0x41')];if(!_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x47')](_0xa1fd('0x48'))){_0x507c34[_0xa1fd('0x33')]=qs[_0xa1fd('0x33')](_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x33')]);_0x507c34[_0xa1fd('0x31')]=qs[_0xa1fd('0x31')](_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x31')]);}_0x507c34[_0xa1fd('0x49')]=qs[_0xa1fd('0x4a')](_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x4a')]);_0x507c34[_0xa1fd('0x4b')]=qs['filters'](_[_0xa1fd('0x4c')](_0x2f2d47[_0xa1fd('0x42')],_0x9cd3d3['filters']),_0x446c05);if(_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x4d')]){_0x507c34['where']=_[_0xa1fd('0x4e')](_0x507c34[_0xa1fd('0x4b')],{'$or':_[_0xa1fd('0x3c')](_0x446c05,function(_0x42b14c){if(_0x42b14c[_0xa1fd('0x40')]!==_0xa1fd('0x4f')){var _0x4f7698={};_0x4f7698[_0x42b14c[_0xa1fd('0x3a')]]={'$like':'%'+_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x4d')]+'%'};return _0x4f7698;}})});}_0x507c34=_['merge']({},_0x507c34,_0x2f2d47[_0xa1fd('0x50')]);var _0x1ec90a={'where':_0x507c34[_0xa1fd('0x4b')]};return db['WhatsappMessage'][_0xa1fd('0x34')](_0x1ec90a)[_0xa1fd('0x22')](function(_0xeeb81e){_0x12b8e7[_0xa1fd('0x34')]=_0xeeb81e;if(_0x2f2d47[_0xa1fd('0x42')][_0xa1fd('0x51')]){_0x507c34[_0xa1fd('0x52')]=[{'all':!![]}];}return db[_0xa1fd('0x3d')][_0xa1fd('0x53')](_0x507c34);})[_0xa1fd('0x22')](function(_0x44af52){_0x12b8e7[_0xa1fd('0x54')]=_0x44af52;return _0x12b8e7;})[_0xa1fd('0x22')](respondWithFilteredResult(_0x1cd985,_0x507c34))['catch'](handleError(_0x1cd985,null));};exports[_0xa1fd('0x55')]=function(_0x474318,_0x2241af){var _0x3947ae={'raw':!![],'where':{'id':_0x474318['params']['id']}},_0x2771da={};_0x2771da['model']=_[_0xa1fd('0x56')](db['WhatsappMessage']['rawAttributes']);_0x2771da[_0xa1fd('0x42')]=_[_0xa1fd('0x56')](_0x474318[_0xa1fd('0x42')]);_0x2771da['filters']=_[_0xa1fd('0x45')](_0x2771da[_0xa1fd('0x41')],_0x2771da[_0xa1fd('0x42')]);_0x3947ae[_0xa1fd('0x44')]=_['intersection'](_0x2771da[_0xa1fd('0x41')],qs[_0xa1fd('0x46')](_0x474318['query'][_0xa1fd('0x46')]));_0x3947ae[_0xa1fd('0x44')]=_0x3947ae[_0xa1fd('0x44')]['length']?_0x3947ae[_0xa1fd('0x44')]:_0x2771da['model'];if(_0x474318[_0xa1fd('0x42')][_0xa1fd('0x51')]){_0x3947ae[_0xa1fd('0x52')]=[{'all':!![]}];}_0x3947ae=_[_0xa1fd('0x4e')]({},_0x3947ae,_0x474318[_0xa1fd('0x50')]);return db['WhatsappMessage'][_0xa1fd('0x57')](_0x3947ae)['then'](handleEntityNotFound(_0x2241af,null))[_0xa1fd('0x22')](respondWithResult(_0x2241af,null))[_0xa1fd('0x2d')](handleError(_0x2241af,null));};exports[_0xa1fd('0x58')]=function(_0x4941e8,_0x43f603){return db[_0xa1fd('0x3d')][_0xa1fd('0x58')](_0x4941e8[_0xa1fd('0x59')],{})[_0xa1fd('0x22')](respondWithResult(_0x43f603,0xc9))[_0xa1fd('0x2d')](handleError(_0x43f603,null));};exports[_0xa1fd('0x39')]=function(_0xfd821c,_0x596c76){if(_0xfd821c[_0xa1fd('0x59')]['id']){delete _0xfd821c[_0xa1fd('0x59')]['id'];}return db[_0xa1fd('0x3d')][_0xa1fd('0x57')]({'where':{'id':_0xfd821c[_0xa1fd('0x5a')]['id']}})[_0xa1fd('0x22')](handleEntityNotFound(_0x596c76,null))['then'](saveUpdates(_0xfd821c[_0xa1fd('0x59')],null))[_0xa1fd('0x22')](respondWithResult(_0x596c76,null))[_0xa1fd('0x2d')](handleError(_0x596c76,null));};exports[_0xa1fd('0x5b')]=function(_0x18cdf1,_0x4ba50c){return db[_0xa1fd('0x3d')][_0xa1fd('0x57')]({'where':{'id':_0x18cdf1[_0xa1fd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ba50c,null))['then'](removeEntity(_0x4ba50c,null))[_0xa1fd('0x2d')](handleError(_0x4ba50c,null));};exports[_0xa1fd('0x5c')]=function(_0x19208b,_0x30146a){return db[_0xa1fd('0x3d')][_0xa1fd('0x5c')]()[_0xa1fd('0x22')](respondWithResult(_0x30146a,null))[_0xa1fd('0x2d')](handleError(_0x30146a,null));};var interaction_log=require(_0xa1fd('0x5d'))(_0xa1fd('0x5e'));exports[_0xa1fd('0x5f')]=function(_0x10866f,_0x505068,_0x30bbc3){var _0x4cb6d6={'agent':{},'channel':'whatsapp'};if(_0x10866f[_0xa1fd('0x59')]['id']){delete _0x10866f[_0xa1fd('0x59')]['id'];}_0x10866f['body']['read']=!![];_0x10866f['body'][_0xa1fd('0x60')]=moment()[_0xa1fd('0x61')](_0xa1fd('0x62'));_0x10866f[_0xa1fd('0x59')][_0xa1fd('0x63')]=_0x10866f[_0xa1fd('0x59')][_0xa1fd('0x63')]||_0x10866f[_0xa1fd('0x64')]['id'];_0x4cb6d6[_0xa1fd('0x65')]['id']=_0x10866f[_0xa1fd('0x59')][_0xa1fd('0x63')];return db[_0xa1fd('0x3d')][_0xa1fd('0x57')]({'where':{'id':_0x10866f[_0xa1fd('0x5a')]['id'],'UserId':null}})[_0xa1fd('0x22')](handleEntityNotFound(_0x505068,null))[_0xa1fd('0x22')](saveUpdates(_0x10866f['body'],null))[_0xa1fd('0x22')](function(_0x359f7c){if(_0x359f7c){_0x4cb6d6[_0xa1fd('0x2a')]=_0x359f7c[_0xa1fd('0x66')]({'plain':!![]});return db[_0xa1fd('0x67')][_0xa1fd('0x57')]({'where':{'id':_0x359f7c[_0xa1fd('0x68')]}});}return null;})[_0xa1fd('0x22')](handleEntityNotFound(_0x505068,null))[_0xa1fd('0x22')](function(_0x5c9563){if(_0x5c9563){return _0x5c9563[_0xa1fd('0x39')]({'UserId':_0x10866f[_0xa1fd('0x59')][_0xa1fd('0x63')],'read1stAt':_['isNil'](_0x5c9563[_0xa1fd('0x69')])?moment()[_0xa1fd('0x61')](_0xa1fd('0x62')):undefined});}return null;})[_0xa1fd('0x22')](function(_0x179d4b){if(_0x179d4b){_0x4cb6d6[_0xa1fd('0x6a')]=_0x179d4b['get']({'plain':!![]});interaction_log[_0xa1fd('0x2b')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10866f[_0xa1fd('0x64')]['id'],_0x10866f[_0xa1fd('0x64')][_0xa1fd('0x3a')],_0x10866f['user'][_0xa1fd('0x6b')],_0x4cb6d6[_0xa1fd('0x6a')]['id'],_0x10866f[_0xa1fd('0x59')]?JSON[_0xa1fd('0x26')](_0x10866f[_0xa1fd('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0xa1fd('0x6c'),_0x4cb6d6);}return null;})['then'](function(_0x11483b){var _0x3d4e3d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11483b[_0xa1fd('0x2a')][_0xa1fd('0x6d')];return db['sequelize']['query'](_0x3d4e3d,{'type':db[_0xa1fd('0x6e')][_0xa1fd('0x6f')][_0xa1fd('0x70')],'raw':!![]})[_0xa1fd('0x22')](function(_0x3b29f1){return _0x3b29f1;});})['then'](function(_0x19c1df){if(_0x19c1df){_0x4cb6d6['message'][_0xa1fd('0x71')]=_0x19c1df[0x0];if(!_0x10866f[_0xa1fd('0x59')][_0xa1fd('0x63')])return;return db[_0xa1fd('0x72')][_0xa1fd('0x57')]({'where':{'id':_0x10866f['body']['UserId'],'role':_0xa1fd('0x65')},'attributes':['id','name',_0xa1fd('0x73'),_0xa1fd('0x74'),_0xa1fd('0x75')],'raw':!![]});}return null;})[_0xa1fd('0x22')](function(_0x33a596){if(!_0x33a596)return null;_0x4cb6d6['message']['agent']=_0x33a596;return _0x4cb6d6;})[_0xa1fd('0x22')](function(_0x671d8c){if(_0x671d8c){if(_0x10866f['body'][_0xa1fd('0x76')]){_0x4cb6d6[_0xa1fd('0x2a')][_0xa1fd('0x77')]=util['format'](_0xa1fd('0x78'),_0x10866f[_0xa1fd('0x64')][_0xa1fd('0x3a')]);_0x4cb6d6[_0xa1fd('0x2a')][_0xa1fd('0x79')]=_0x4cb6d6[_0xa1fd('0x79')];_0x4cb6d6[_0xa1fd('0x2a')]['motionChannel']=_0x4cb6d6[_0xa1fd('0x79')];_0x4cb6d6[_0xa1fd('0x2a')][_0xa1fd('0x7a')]=_0xa1fd('0x5f');return respondWithRpcPromise(_0xa1fd('0x7b'),'EventManager',{'event':'acceptmessage','message':_0x4cb6d6[_0xa1fd('0x2a')]},client9002)[_0xa1fd('0x22')](function(){return _0x4cb6d6;});}return _0x4cb6d6;}return null;})['then'](respondWithResult(_0x505068,null))[_0xa1fd('0x2d')](handleError(_0x505068,null));};var interaction_log=require(_0xa1fd('0x5d'))(_0xa1fd('0x5e'));exports[_0xa1fd('0x7c')]=function(_0x38f4be,_0x530dc3,_0x39c330){var _0x1d7821={'agent':{},'channel':'whatsapp'};if(_0x38f4be[_0xa1fd('0x59')]['id']){delete _0x38f4be[_0xa1fd('0x59')]['id'];}_0x38f4be['body']['UserId']=_0x38f4be[_0xa1fd('0x59')][_0xa1fd('0x63')]||_0x38f4be[_0xa1fd('0x64')]['id'];_0x1d7821[_0xa1fd('0x65')]['id']=_0x38f4be['body'][_0xa1fd('0x63')];return db[_0xa1fd('0x3d')][_0xa1fd('0x57')]({'where':{'id':_0x38f4be['params']['id'],'UserId':null}})[_0xa1fd('0x22')](handleEntityNotFound(_0x530dc3,null))[_0xa1fd('0x22')](function(_0x3d72ea){if(_0x3d72ea){_0x1d7821['message']=_0x3d72ea['get']({'plain':!![]});return db[_0xa1fd('0x67')]['find']({'where':{'id':_0x3d72ea[_0xa1fd('0x68')]}});}return null;})[_0xa1fd('0x22')](handleEntityNotFound(_0x530dc3,null))[_0xa1fd('0x22')](function(_0x115fea){if(_0x115fea){_0x1d7821['interaction']=_0x115fea[_0xa1fd('0x66')]({'plain':!![]});interaction_log[_0xa1fd('0x2b')](_0xa1fd('0x7d'),_0x38f4be[_0xa1fd('0x64')]['id'],_0x38f4be[_0xa1fd('0x64')][_0xa1fd('0x3a')],_0x38f4be['user']['role'],_0x1d7821[_0xa1fd('0x6a')]['id'],_0x38f4be['body']?JSON[_0xa1fd('0x26')](_0x38f4be['body']):_0xa1fd('0x7e'));return respondWithRpcPromise(_0xa1fd('0x7f'),_0xa1fd('0x80'),_0x1d7821);}return null;})[_0xa1fd('0x22')](function(_0x11af98){var _0x51bcdb=_0xa1fd('0x81')+_0x11af98[_0xa1fd('0x2a')]['ContactId'];return db[_0xa1fd('0x82')][_0xa1fd('0x42')](_0x51bcdb,{'type':db['Sequelize'][_0xa1fd('0x6f')]['SELECT'],'raw':!![]})[_0xa1fd('0x22')](function(_0x499769){return _0x499769;});})[_0xa1fd('0x22')](function(_0x251bcd){if(_0x251bcd){_0x1d7821['message'][_0xa1fd('0x71')]=_0x251bcd[0x0];if(!_0x38f4be[_0xa1fd('0x59')][_0xa1fd('0x63')])return;return db['User']['find']({'where':{'id':_0x38f4be[_0xa1fd('0x59')]['UserId'],'role':_0xa1fd('0x65')},'attributes':['id','name',_0xa1fd('0x73'),_0xa1fd('0x74'),'internal'],'raw':!![]});}return null;})[_0xa1fd('0x22')](function(_0x18c47b){if(!_0x18c47b)return null;_0x1d7821[_0xa1fd('0x2a')][_0xa1fd('0x65')]=_0x18c47b;return _0x1d7821;})[_0xa1fd('0x22')](function(_0x1b1c49){if(_0x1b1c49){_0x1b1c49[_0xa1fd('0x2a')]['interface']=util[_0xa1fd('0x61')](_0xa1fd('0x78'),_0x38f4be[_0xa1fd('0x64')][_0xa1fd('0x3a')]);_0x1b1c49['message'][_0xa1fd('0x79')]=_0x1d7821['channel'];_0x1b1c49[_0xa1fd('0x2a')]['motionChannel']=_0x1d7821[_0xa1fd('0x79')];_0x1b1c49['message']['event']=_0xa1fd('0x7c');respondWithRpcPromise(_0xa1fd('0x7b'),_0xa1fd('0x7b'),{'event':'rejectmessage','message':_0x1b1c49[_0xa1fd('0x2a')]},client9002);return _0x1d7821;}return null;})[_0xa1fd('0x22')](respondWithResult(_0x530dc3,null))[_0xa1fd('0x2d')](handleError(_0x530dc3,null));};exports[_0xa1fd('0x2e')]=function(_0x47670d,_0xeb34f6,_0x5ec92c){if(_0x47670d[_0xa1fd('0x59')]['id']){delete _0x47670d['body']['id'];}var _0x2e8ac3;return db[_0xa1fd('0x3d')][_0xa1fd('0x57')]({'where':{'id':_0x47670d['params']['id']}})[_0xa1fd('0x22')](handleEntityNotFound(_0xeb34f6,null))[_0xa1fd('0x22')](function(_0x3e2c7e){if(_0x3e2c7e){_0x2e8ac3=_0x3e2c7e;return db[_0xa1fd('0x83')][_0xa1fd('0x57')]({'where':{'id':_0x3e2c7e[_0xa1fd('0x84')]}});}})[_0xa1fd('0x22')](handleEntityNotFound(_0xeb34f6,null))[_0xa1fd('0x22')](function(_0x744336){if(_0x744336){logger[_0xa1fd('0x24')](_0xa1fd('0x85'),_0xa1fd('0x2e'),_0xa1fd('0x86'),_0x744336['type'],util[_0xa1fd('0x87')](_0x47670d[_0xa1fd('0x59')],{'showHidden':![],'depth':null}));switch(_0x744336['type']){case _0xa1fd('0x88'):if(_0x47670d[_0xa1fd('0x59')]['MessageSid']&&_0x47670d[_0xa1fd('0x59')][_0xa1fd('0x89')]===_0x2e8ac3['messageId']&&_0x47670d[_0xa1fd('0x59')][_0xa1fd('0x8a')]&&_0x47670d['body']['MessageStatus']==='read'){return _0x2e8ac3[_0xa1fd('0x39')]({'read':!![]});}else{logger[_0xa1fd('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xa1fd('0x88'),util[_0xa1fd('0x87')](_0x47670d[_0xa1fd('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x2e8ac3;}})[_0xa1fd('0x22')](respondWithResult(_0xeb34f6,null))[_0xa1fd('0x2d')](handleError(_0xeb34f6,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 2a58bf8..50b4c61 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 _0x1775=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5177('0x2')](0x0);var events={'afterCreate':_0x5177('0x3'),'afterUpdate':_0x5177('0x4'),'afterDestroy':_0x5177('0x5')};function emitEvent(_0x420a5b){return function(_0x2027bf,_0x359401,_0x51275f){WhatsappMessageEvents[_0x5177('0x6')](_0x420a5b+':'+_0x2027bf['id'],_0x2027bf);WhatsappMessageEvents[_0x5177('0x6')](_0x420a5b,_0x2027bf);_0x51275f(null);};}for(var e in events){if(events[_0x5177('0x7')](e)){var event=events[e];WhatsappMessage[_0x5177('0x8')](e,emitEvent(event));}}module[_0x5177('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x74f0=['hasOwnProperty','hook','exports','../../mysqldb','save','update','remove','emit'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x74f0,0xf3));var _0x074f=function(_0x275f4a,_0x2077d4){_0x275f4a=_0x275f4a-0x0;var _0x4b4a21=_0x74f0[_0x275f4a];return _0x4b4a21;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x074f('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x074f('0x1'),'afterUpdate':_0x074f('0x2'),'afterDestroy':_0x074f('0x3')};function emitEvent(_0x3fd9ba){return function(_0x4e4b99,_0x51fbdc,_0x3d8d87){WhatsappMessageEvents[_0x074f('0x4')](_0x3fd9ba+':'+_0x4e4b99['id'],_0x4e4b99);WhatsappMessageEvents[_0x074f('0x4')](_0x3fd9ba,_0x4e4b99);_0x3d8d87(null);};}for(var e in events){if(events[_0x074f('0x5')](e)){var event=events[e];WhatsappMessage[_0x074f('0x6')](e,emitEvent(event));}}module[_0x074f('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index a232500..3712c25 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 _0xe0e7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','body','models','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','catch','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_unicode_ci','util','../../config/logger'];(function(_0x10d123,_0x495566){var _0x38fb0a=function(_0x57dd3f){while(--_0x57dd3f){_0x10d123['push'](_0x10d123['shift']());}};_0x38fb0a(++_0x495566);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xe0e7[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x7e0e('0x0'));var logger=require(_0x7e0e('0x1'))(_0x7e0e('0x2'));var moment=require(_0x7e0e('0x3'));var BPromise=require(_0x7e0e('0x4'));var rp=require(_0x7e0e('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x7e0e('0x6'));var rimraf=require(_0x7e0e('0x7'));var config=require(_0x7e0e('0x8'));var attributes=require(_0x7e0e('0x9'));module['exports']=function(_0x380cb5,_0x7fafd2){return _0x380cb5[_0x7e0e('0xa')]('WhatsappMessage',attributes,{'tableName':_0x7e0e('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7e0e('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x7e0e('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e1bfb,_0x1fd45f,_0x9ae909){var _0x122135=_0x380cb5[_0x7e0e('0xe')];var _0x52c17b=_0x5e1bfb['get']({'plain':!![]});if(_0x52c17b[_0x7e0e('0xf')][_0x7e0e('0x10')]()==='in'||_0x52c17b[_0x7e0e('0xf')]['toLowerCase']()===_0x7e0e('0x11')&&!_0x52c17b[_0x7e0e('0x12')]&&!_['isNil'](_0x52c17b[_0x7e0e('0x13')])){_0x122135[_0x7e0e('0x14')][_0x7e0e('0x15')]({'where':{'id':_0x52c17b[_0x7e0e('0x16')]}})['then'](function(_0x3a0e20){if(_0x3a0e20){_0x3a0e20[_0x7e0e('0x17')]({'lastMsgAt':_0x52c17b[_0x7e0e('0x18')],'lastMsgDirection':_0x52c17b[_0x7e0e('0xf')]['toLowerCase']()});}})['catch'](function(_0x9a6ac8){console[_0x7e0e('0x19')](_0x9a6ac8);});}if(_0x52c17b[_0x7e0e('0xf')]==='out'&&!_0x52c17b['secret']){var _0x22692e;_0x122135[_0x7e0e('0x1a')][_0x7e0e('0x1b')]({'where':{'id':_0x52c17b[_0x7e0e('0x1c')]},'raw':!![]})[_0x7e0e('0x1d')](function(_0x4dfb40){_0x22692e=_0x4dfb40;if(_0x22692e&&_0x22692e[_0x7e0e('0x1e')]){switch(_0x22692e[_0x7e0e('0x1e')]){case _0x7e0e('0x1f'):var _0xdb173f=require(_0x7e0e('0x1f'));if(_0x22692e[_0x7e0e('0x20')]&&_0x22692e[_0x7e0e('0x21')]&&_0x22692e[_0x7e0e('0x22')]){var _0x176da5=new _0xdb173f(_0x22692e[_0x7e0e('0x20')],_0x22692e[_0x7e0e('0x21')]);_0x176da5[_0x7e0e('0x23')][_0x7e0e('0x24')]({'body':_0x52c17b[_0x7e0e('0xd')],'to':_0x7e0e('0x25')+_0x52c17b['phone'],'from':'whatsapp:'+_0x22692e[_0x7e0e('0x22')],'statusCallback':_0x22692e[_0x7e0e('0x26')]+'/api/whatsapp/messages/'+_0x52c17b['id']+_0x7e0e('0x27')+_0x22692e[_0x7e0e('0x28')]})[_0x7e0e('0x1d')](function(_0x4c1798){if(_0x4c1798[_0x7e0e('0x29')]){return _0x5e1bfb[_0x7e0e('0x17')]({'messageId':_0x4c1798['sid']});}})[_0x7e0e('0x2a')](function(_0x43e0ca){logger[_0x7e0e('0x19')](_0x7e0e('0x2b'),_0x7e0e('0x2c'),_0x7e0e('0x1f'),util[_0x7e0e('0x2d')](_0x43e0ca,{'showHidden':![],'depth':null}));});}else{logger[_0x7e0e('0x19')](_0x7e0e('0x2b'),_0x7e0e('0x2c'),_0x7e0e('0x1f'),_0x7e0e('0x2e'));}break;case _0x7e0e('0x2f'):var _0x76ad63=_0x22692e[_0x7e0e('0x20')];var _0x3c7505=_0x22692e[_0x7e0e('0x21')];var _0x8d5338=_0x22692e[_0x7e0e('0x30')]+_0x7e0e('0x31')+_0x76ad63+_0x7e0e('0x32');var _0x3304c2={'to':[_0x52c17b['phone']],'message':{'type':'text','text':_0x52c17b[_0x7e0e('0xd')]}};var _0x3daf0f={'method':_0x7e0e('0x33'),'uri':_0x8d5338,'headers':{'Authorization':_0x7e0e('0x34')+_0x3c7505,'Content-Type':_0x7e0e('0x35')},'body':_0x3304c2,'json':!![]};rp(_0x3daf0f)[_0x7e0e('0x1d')](function(_0x5b3a21){if(_0x5b3a21[_0x7e0e('0x36')][0x0]['message_id']){return _0x5e1bfb[_0x7e0e('0x17')]({'messageId':_0x5b3a21[_0x7e0e('0x36')][0x0][_0x7e0e('0x37')]});}})[_0x7e0e('0x2a')](function(_0x42f448){logger[_0x7e0e('0x38')](_0x7e0e('0x39'),_0x42f448);});break;}}})[_0x7e0e('0x3a')](function(){_0x9ae909();});}else{_0x9ae909();}}},'charset':'utf8mb4','collate':_0x7e0e('0x3b')});}; \ No newline at end of file +var _0xc705=['body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc705,0x114));var _0x5c70=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0xc705[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0x5c70('0x0'));var util=require(_0x5c70('0x1'));var logger=require(_0x5c70('0x2'))(_0x5c70('0x3'));var moment=require(_0x5c70('0x4'));var BPromise=require('bluebird');var rp=require(_0x5c70('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x5c70('0x6'));var rimraf=require(_0x5c70('0x7'));var config=require(_0x5c70('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x5c70('0x9')]=function(_0x1eacec,_0x2647ab){return _0x1eacec[_0x5c70('0xa')]('WhatsappMessage',attributes,{'tableName':_0x5c70('0xb'),'paranoid':![],'indexes':[{'name':_0x5c70('0xc'),'fields':['messageId']},{'name':_0x5c70('0xd'),'fields':[_0x5c70('0xe')],'type':_0x5c70('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x24aeda,_0x444c31,_0x54a758){var _0x19ed81=_0x1eacec[_0x5c70('0x10')];var _0x546069=_0x24aeda['get']({'plain':!![]});if(_0x546069[_0x5c70('0x11')][_0x5c70('0x12')]()==='in'||_0x546069[_0x5c70('0x11')][_0x5c70('0x12')]()===_0x5c70('0x13')&&!_0x546069['secret']&&!_[_0x5c70('0x14')](_0x546069[_0x5c70('0x15')])){_0x19ed81[_0x5c70('0x16')]['findOne']({'where':{'id':_0x546069[_0x5c70('0x17')]}})['then'](function(_0x19838b){if(_0x19838b){_0x19838b['update']({'lastMsgAt':_0x546069[_0x5c70('0x18')],'lastMsgDirection':_0x546069[_0x5c70('0x11')]['toLowerCase']()});}})[_0x5c70('0x19')](function(_0x366aee){console[_0x5c70('0x1a')](_0x366aee);});}if(_0x546069[_0x5c70('0x11')]===_0x5c70('0x13')&&!_0x546069['secret']){var _0x8d973f;_0x19ed81[_0x5c70('0x1b')][_0x5c70('0x1c')]({'where':{'id':_0x546069[_0x5c70('0x1d')]},'raw':!![]})[_0x5c70('0x1e')](function(_0x4c9058){_0x8d973f=_0x4c9058;if(_0x8d973f&&_0x8d973f[_0x5c70('0x1f')]){switch(_0x8d973f[_0x5c70('0x1f')]){case _0x5c70('0x20'):var _0x33999d=require(_0x5c70('0x20'));if(_0x8d973f[_0x5c70('0x21')]&&_0x8d973f[_0x5c70('0x22')]&&_0x8d973f[_0x5c70('0x23')]){var _0x103b13=new _0x33999d(_0x8d973f[_0x5c70('0x21')],_0x8d973f[_0x5c70('0x22')]);_0x103b13[_0x5c70('0x24')][_0x5c70('0x25')]({'body':_0x546069[_0x5c70('0xe')],'to':_0x5c70('0x26')+_0x546069[_0x5c70('0x23')],'from':'whatsapp:'+_0x8d973f[_0x5c70('0x23')],'statusCallback':_0x8d973f[_0x5c70('0x27')]+_0x5c70('0x28')+_0x546069['id']+_0x5c70('0x29')+_0x8d973f[_0x5c70('0x2a')]})['then'](function(_0x50c639){if(_0x50c639['sid']){return _0x24aeda[_0x5c70('0x2b')]({'messageId':_0x50c639['sid']});}})[_0x5c70('0x19')](function(_0x28cda6){logger['error'](_0x5c70('0x2c'),_0x5c70('0x2d'),_0x5c70('0x20'),util['inspect'](_0x28cda6,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5c70('0x2d'),_0x5c70('0x20'),_0x5c70('0x2e'));}break;case _0x5c70('0x2f'):var _0x1af894=_0x8d973f[_0x5c70('0x21')];var _0x4fb666=_0x8d973f[_0x5c70('0x22')];var _0x505e7b=_0x8d973f[_0x5c70('0x30')]+'/whatsapp/v1/'+_0x1af894+_0x5c70('0x31');var _0x379b2c={'to':[_0x546069[_0x5c70('0x23')]],'message':{'type':'text','text':_0x546069[_0x5c70('0xe')]}};var _0x5d4ab8={'method':_0x5c70('0x32'),'uri':_0x505e7b,'headers':{'Authorization':'Bearer\x20'+_0x4fb666,'Content-Type':_0x5c70('0x33')},'body':_0x379b2c,'json':!![]};rp(_0x5d4ab8)[_0x5c70('0x1e')](function(_0x29a2ce){if(_0x29a2ce[_0x5c70('0x34')][0x0]['message_id']){return _0x24aeda[_0x5c70('0x2b')]({'messageId':_0x29a2ce[_0x5c70('0x34')][0x0][_0x5c70('0x35')]});}})['catch'](function(_0x73d930){logger[_0x5c70('0x36')](_0x5c70('0x37'),_0x73d930);});break;}}})[_0x5c70('0x38')](function(){_0x54a758();});}else{_0x54a758();}}},'charset':_0x5c70('0x39'),'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 69d4678..a606668 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 _0x1206=['register','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappMessage','create','body','options','raw','then','lodash','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x49b167,_0x2dc3e0){var _0x48c139=function(_0x559bab){while(--_0x559bab){_0x49b167['push'](_0x49b167['shift']());}};_0x48c139(++_0x2dc3e0);}(_0x1206,0x16d));var _0x6120=function(_0x14e69a,_0x2eac7c){_0x14e69a=_0x14e69a-0x0;var _0x26adb8=_0x1206[_0x14e69a];return _0x26adb8;};'use strict';var _=require(_0x6120('0x0'));var util=require(_0x6120('0x1'));var moment=require(_0x6120('0x2'));var BPromise=require('bluebird');var rs=require(_0x6120('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6120('0x4'));var logger=require('../../config/logger')(_0x6120('0x5'));var config=require('../../config/environment');var jayson=require(_0x6120('0x6'));var client=jayson[_0x6120('0x7')][_0x6120('0x8')]({'port':0x232a});config[_0x6120('0x9')]=_[_0x6120('0xa')](config[_0x6120('0x9')],{'host':_0x6120('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6120('0x9')]));require('./whatsappMessage.socket')[_0x6120('0xc')](socket);function respondWithRpcPromise(_0x4c3627,_0x3b9a73,_0x409627){return new BPromise(function(_0xda87c0,_0x3a5ed4){return client['request'](_0x4c3627,_0x409627)['then'](function(_0x5c1d59){logger[_0x6120('0xd')](_0x6120('0xe'),_0x3b9a73,_0x6120('0xf'));logger[_0x6120('0x10')](_0x6120('0x11'),_0x3b9a73,_0x6120('0xf'),JSON[_0x6120('0x12')](_0x5c1d59));if(_0x5c1d59['error']){if(_0x5c1d59[_0x6120('0x13')][_0x6120('0x14')]===0x1f4){logger[_0x6120('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x3b9a73,_0x5c1d59[_0x6120('0x13')]['message']);return _0x3a5ed4(_0x5c1d59[_0x6120('0x13')][_0x6120('0x15')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3b9a73,_0x5c1d59[_0x6120('0x13')][_0x6120('0x15')]);return _0xda87c0(_0x5c1d59[_0x6120('0x13')][_0x6120('0x15')]);}else{logger[_0x6120('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x3b9a73,_0x6120('0xf'));_0xda87c0(_0x5c1d59[_0x6120('0x16')][_0x6120('0x15')]);}})['catch'](function(_0x5def8c){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x3b9a73,_0x5def8c);_0x3a5ed4(_0x5def8c);});});}exports['CreateWhatsappMessage']=function(_0x587291){var _0x33a246=this;return new Promise(function(_0x15792b,_0x97272c){return db[_0x6120('0x17')][_0x6120('0x18')](_0x587291[_0x6120('0x19')],{'raw':_0x587291['options']?_0x587291[_0x6120('0x1a')][_0x6120('0x1b')]===undefined?!![]:![]:!![]})[_0x6120('0x1c')](function(_0x547b1a){logger['info']('CreateWhatsappMessage',_0x587291);logger[_0x6120('0x10')]('CreateWhatsappMessage',_0x587291,JSON[_0x6120('0x12')](_0x547b1a));_0x15792b(_0x547b1a);})['catch'](function(_0xbf0e13){logger[_0x6120('0x13')]('CreateWhatsappMessage',_0xbf0e13[_0x6120('0x15')],_0x587291);_0x97272c(_0x33a246[_0x6120('0x13')](0x1f4,_0xbf0e13['message']));});});}; \ No newline at end of file +var _0x66b7=['http','defaults','localhost','socket.io-emitter','redis','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappMessage','body','options','raw','CreateWhatsappMessage','lodash','util','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x66b7,0x112));var _0x766b=function(_0x26a4ea,_0xa72fb8){_0x26a4ea=_0x26a4ea-0x0;var _0x1b669e=_0x66b7[_0x26a4ea];return _0x1b669e;};'use strict';var _=require(_0x766b('0x0'));var util=require(_0x766b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x766b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x766b('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x766b('0x4'));var jayson=require(_0x766b('0x5'));var client=jayson['client'][_0x766b('0x6')]({'port':0x232a});config['redis']=_[_0x766b('0x7')](config['redis'],{'host':_0x766b('0x8'),'port':0x18eb});var socket=require(_0x766b('0x9'))(new Redis(config[_0x766b('0xa')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x29911b,_0x472467,_0xded5ca){return new BPromise(function(_0x274465,_0x1ccffd){return client[_0x766b('0xb')](_0x29911b,_0xded5ca)[_0x766b('0xc')](function(_0x34e9b4){logger[_0x766b('0xd')](_0x766b('0xe'),_0x472467,_0x766b('0xf'));logger[_0x766b('0x10')](_0x766b('0x11'),_0x472467,'request\x20sent',JSON[_0x766b('0x12')](_0x34e9b4));if(_0x34e9b4[_0x766b('0x13')]){if(_0x34e9b4[_0x766b('0x13')]['code']===0x1f4){logger[_0x766b('0x13')](_0x766b('0xe'),_0x472467,_0x34e9b4[_0x766b('0x13')][_0x766b('0x14')]);return _0x1ccffd(_0x34e9b4[_0x766b('0x13')][_0x766b('0x14')]);}logger[_0x766b('0x13')](_0x766b('0xe'),_0x472467,_0x34e9b4[_0x766b('0x13')]['message']);return _0x274465(_0x34e9b4['error'][_0x766b('0x14')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x472467,'request\x20sent');_0x274465(_0x34e9b4[_0x766b('0x15')][_0x766b('0x14')]);}})[_0x766b('0x16')](function(_0x20306d){logger[_0x766b('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x472467,_0x20306d);_0x1ccffd(_0x20306d);});});}exports['CreateWhatsappMessage']=function(_0x44bac7){var _0x28fc61=this;return new Promise(function(_0x1acf0b,_0x79ff08){return db[_0x766b('0x17')]['create'](_0x44bac7[_0x766b('0x18')],{'raw':_0x44bac7[_0x766b('0x19')]?_0x44bac7[_0x766b('0x19')][_0x766b('0x1a')]===undefined?!![]:![]:!![]})[_0x766b('0xc')](function(_0x34b129){logger['info'](_0x766b('0x1b'),_0x44bac7);logger[_0x766b('0x10')](_0x766b('0x1b'),_0x44bac7,JSON[_0x766b('0x12')](_0x34b129));_0x1acf0b(_0x34b129);})['catch'](function(_0x460922){logger[_0x766b('0x13')]('CreateWhatsappMessage',_0x460922['message'],_0x44bac7);_0x79ff08(_0x28fc61[_0x766b('0x13')](0x1f4,_0x460922['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 015fd9d..daf76d4 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 _0x5b04=['update','emit','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x58c9cf,_0x2e7798){var _0x1aae82=function(_0x15313a){while(--_0x15313a){_0x58c9cf['push'](_0x58c9cf['shift']());}};_0x1aae82(++_0x2e7798);}(_0x5b04,0x147));var _0x45b0=function(_0x3c3dc6,_0x112a65){_0x3c3dc6=_0x3c3dc6-0x0;var _0x2b5c0b=_0x5b04[_0x3c3dc6];return _0x2b5c0b;};'use strict';var WhatsappMessageEvents=require(_0x45b0('0x0'));var events=[_0x45b0('0x1'),'remove',_0x45b0('0x2')];function createListener(_0x58d004,_0x23f5ff){return function(_0x2ddd97){_0x23f5ff[_0x45b0('0x3')](_0x58d004,_0x2ddd97);};}function removeListener(_0x2c4e22,_0x362546){return function(){WhatsappMessageEvents['removeListener'](_0x2c4e22,_0x362546);};}exports[_0x45b0('0x4')]=function(_0x55cfb2){for(var _0xb0ca1a=0x0,_0x577062=events[_0x45b0('0x5')];_0xb0ca1a<_0x577062;_0xb0ca1a++){var _0x2da58d=events[_0xb0ca1a];var _0x40dc35=createListener(_0x45b0('0x6')+_0x2da58d,_0x55cfb2);WhatsappMessageEvents['on'](_0x2da58d,_0x40dc35);}}; \ No newline at end of file +var _0x9f0f=['emit','register','length','whatsappMessage:','save','update'];(function(_0x4bf448,_0x495276){var _0x2af0f4=function(_0x58339c){while(--_0x58339c){_0x4bf448['push'](_0x4bf448['shift']());}};_0x2af0f4(++_0x495276);}(_0x9f0f,0xf4));var _0xf9f0=function(_0xf854d8,_0x3a9a03){_0xf854d8=_0xf854d8-0x0;var _0x559eb2=_0x9f0f[_0xf854d8];return _0x559eb2;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xf9f0('0x0'),'remove',_0xf9f0('0x1')];function createListener(_0x322a45,_0x50034a){return function(_0x45829b){_0x50034a[_0xf9f0('0x2')](_0x322a45,_0x45829b);};}function removeListener(_0x4155c0,_0x578f75){return function(){WhatsappMessageEvents['removeListener'](_0x4155c0,_0x578f75);};}exports[_0xf9f0('0x3')]=function(_0x20702a){for(var _0x4fc69a=0x0,_0x481161=events[_0xf9f0('0x4')];_0x4fc69a<_0x481161;_0x4fc69a++){var _0x4fe0c0=events[_0x4fc69a];var _0xeef918=createListener(_0xf9f0('0x5')+_0x4fe0c0,_0x20702a);WhatsappMessageEvents['on'](_0x4fe0c0,_0xeef918);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index b7ea800..e79312f 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 _0x1d3a=['index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated'];(function(_0x5b2544,_0x10be79){var _0x289d42=function(_0x2ea52b){while(--_0x2ea52b){_0x5b2544['push'](_0x5b2544['shift']());}};_0x289d42(++_0x10be79);}(_0x1d3a,0xe6));var _0xa1d3=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x1d3a[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0xa1d3('0x0'));var util=require('util');var path=require(_0xa1d3('0x1'));var timeout=require('connect-timeout');var express=require(_0xa1d3('0x2'));var router=express[_0xa1d3('0x3')]();var fs_extra=require(_0xa1d3('0x4'));var auth=require(_0xa1d3('0x5'));var interaction=require(_0xa1d3('0x6'));var config=require(_0xa1d3('0x7'));var controller=require(_0xa1d3('0x8'));router['get']('/',auth[_0xa1d3('0x9')](),controller[_0xa1d3('0xa')]);router[_0xa1d3('0xb')](_0xa1d3('0xc'),auth[_0xa1d3('0x9')](),controller[_0xa1d3('0xd')]);router[_0xa1d3('0xb')](_0xa1d3('0xe'),auth[_0xa1d3('0x9')](),controller[_0xa1d3('0xf')]);router[_0xa1d3('0xb')](_0xa1d3('0x10'),auth[_0xa1d3('0x9')](),controller['getMembers']);router[_0xa1d3('0xb')](_0xa1d3('0x11'),auth[_0xa1d3('0x9')](),controller[_0xa1d3('0x12')]);router[_0xa1d3('0xb')]('/:id/users',auth[_0xa1d3('0x9')](),controller[_0xa1d3('0x13')]);router[_0xa1d3('0x14')]('/',auth[_0xa1d3('0x9')](),controller[_0xa1d3('0x15')]);router[_0xa1d3('0x14')](_0xa1d3('0x11'),auth[_0xa1d3('0x9')](),controller[_0xa1d3('0x16')]);router['post'](_0xa1d3('0x17'),auth[_0xa1d3('0x9')](),controller[_0xa1d3('0x18')]);router[_0xa1d3('0x19')](_0xa1d3('0xe'),auth['isAuthenticated'](),controller[_0xa1d3('0x1a')]);router[_0xa1d3('0x1b')]('/:id',auth[_0xa1d3('0x9')](),controller['destroy']);router['delete'](_0xa1d3('0x11'),auth[_0xa1d3('0x9')](),controller['removeTeams']);router[_0xa1d3('0x1b')](_0xa1d3('0x17'),auth['isAuthenticated'](),controller[_0xa1d3('0x1c')]);module[_0xa1d3('0x1d')]=router; \ No newline at end of file +var _0xe086=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','isAuthenticated','show','getMembers','/:id/teams','getAgents','create','post','/:id/users','addAgents','put','/:id','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x275794,_0x50c188){var _0x2ef73b=function(_0x3ad3a7){while(--_0x3ad3a7){_0x275794['push'](_0x275794['shift']());}};_0x2ef73b(++_0x50c188);}(_0xe086,0x14a));var _0x6e08=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe086[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x6e08('0x0'));var util=require(_0x6e08('0x1'));var path=require(_0x6e08('0x2'));var timeout=require(_0x6e08('0x3'));var express=require(_0x6e08('0x4'));var router=express[_0x6e08('0x5')]();var fs_extra=require(_0x6e08('0x6'));var auth=require(_0x6e08('0x7'));var interaction=require(_0x6e08('0x8'));var config=require(_0x6e08('0x9'));var controller=require(_0x6e08('0xa'));router[_0x6e08('0xb')]('/',auth['isAuthenticated'](),controller[_0x6e08('0xc')]);router[_0x6e08('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6e08('0xb')]('/:id',auth[_0x6e08('0xd')](),controller[_0x6e08('0xe')]);router[_0x6e08('0xb')]('/:id/members',auth[_0x6e08('0xd')](),controller[_0x6e08('0xf')]);router[_0x6e08('0xb')](_0x6e08('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0x6e08('0xb')]('/:id/users',auth[_0x6e08('0xd')](),controller[_0x6e08('0x11')]);router['post']('/',auth[_0x6e08('0xd')](),controller[_0x6e08('0x12')]);router[_0x6e08('0x13')](_0x6e08('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x6e08('0x13')](_0x6e08('0x14'),auth[_0x6e08('0xd')](),controller[_0x6e08('0x15')]);router[_0x6e08('0x16')]('/:id',auth[_0x6e08('0xd')](),controller['update']);router['delete'](_0x6e08('0x17'),auth[_0x6e08('0xd')](),controller['destroy']);router[_0x6e08('0x18')]('/:id/teams',auth[_0x6e08('0xd')](),controller[_0x6e08('0x19')]);router[_0x6e08('0x18')]('/:id/users',auth[_0x6e08('0xd')](),controller[_0x6e08('0x1a')]);module[_0x6e08('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 0d82be1..5fc5806 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 _0xb469=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xb469,0x13b));var _0x9b46=function(_0x17eee3,_0x3410fa){_0x17eee3=_0x17eee3-0x0;var _0x3f1a1e=_0xb469[_0x17eee3];return _0x3f1a1e;};'use strict';var Sequelize=require(_0x9b46('0x0'));module[_0x9b46('0x1')]={'name':{'type':Sequelize[_0x9b46('0x2')],'unique':_0x9b46('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x9b46('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b46('0x5')](_0x9b46('0x6'),'beepall',_0x9b46('0x7'))},'description':{'type':Sequelize[_0x9b46('0x2')]}}; \ No newline at end of file +var _0x24cf=['roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x65a8c,_0x14e97b){var _0x2d8547=function(_0x7fd7ea){while(--_0x7fd7ea){_0x65a8c['push'](_0x65a8c['shift']());}};_0x2d8547(++_0x14e97b);}(_0x24cf,0x1d5));var _0xf24c=function(_0x380e15,_0xf91555){_0x380e15=_0x380e15-0x0;var _0x9f1cc7=_0x24cf[_0x380e15];return _0x9f1cc7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf24c('0x0')],'unique':_0xf24c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf24c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf24c('0x3')](_0xf24c('0x4'),'beepall',_0xf24c('0x5'))},'description':{'type':Sequelize[_0xf24c('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 4867db3..28d4a8b 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 _0xb410=['format','whatsappPause','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','userWhatsappQueue:save','select','tq.TeamId','from','join','clone','push','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','map','WhatsappQueue','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','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','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt'];(function(_0x13def3,_0x369c74){var _0x4a323f=function(_0x18b86f){while(--_0x18b86f){_0x13def3['push'](_0x13def3['shift']());}};_0x4a323f(++_0x369c74);}(_0xb410,0x1ca));var _0x0b41=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb410[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b41('0x0'));var zipdir=require(_0x0b41('0x1'));var jsonpatch=require(_0x0b41('0x2'));var rp=require(_0x0b41('0x3'));var moment=require(_0x0b41('0x4'));var BPromise=require(_0x0b41('0x5'));var Mustache=require(_0x0b41('0x6'));var util=require('util');var path=require(_0x0b41('0x7'));var sox=require(_0x0b41('0x8'));var csv=require(_0x0b41('0x9'));var ejs=require(_0x0b41('0xa'));var fs=require('fs');var fs_extra=require(_0x0b41('0xb'));var _=require(_0x0b41('0xc'));var squel=require(_0x0b41('0xd'));var crypto=require(_0x0b41('0xe'));var jsforce=require(_0x0b41('0xf'));var deskjs=require(_0x0b41('0x10'));var toCsv=require(_0x0b41('0x9'));var querystring=require(_0x0b41('0x11'));var Papa=require(_0x0b41('0x12'));var Redis=require(_0x0b41('0x13'));var authService=require(_0x0b41('0x14'));var qs=require(_0x0b41('0x15'));var as=require(_0x0b41('0x16'));var hardwareService=require(_0x0b41('0x17'));var logger=require(_0x0b41('0x18'))(_0x0b41('0x19'));var utils=require('../../config/utils');var config=require(_0x0b41('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b41('0x1b'))['db'];config[_0x0b41('0x1c')]=_[_0x0b41('0x1d')](config[_0x0b41('0x1c')],{'host':_0x0b41('0x1e'),'port':0x18eb});var socket=require(_0x0b41('0x1f'))(new Redis(config[_0x0b41('0x1c')]));require(_0x0b41('0x20'))['register'](socket);function respondWithStatusCode(_0x3c2c82,_0x408f1b){_0x408f1b=_0x408f1b||0xcc;return function(_0x2b3740){if(_0x2b3740){return _0x3c2c82[_0x0b41('0x21')](_0x408f1b);}return _0x3c2c82[_0x0b41('0x22')](_0x408f1b)[_0x0b41('0x23')]();};}function respondWithResult(_0x31dd2b,_0x497c64){_0x497c64=_0x497c64||0xc8;return function(_0x55682d){if(_0x55682d){return _0x31dd2b['status'](_0x497c64)[_0x0b41('0x24')](_0x55682d);}};}function respondWithFilteredResult(_0x1e60c8,_0xabbfbf){return function(_0x38d429){if(_0x38d429){var _0x1c6a8b=typeof _0xabbfbf[_0x0b41('0x25')]===_0x0b41('0x26')&&typeof _0xabbfbf['limit']===_0x0b41('0x26');var _0x120064=_0x38d429[_0x0b41('0x27')];var _0x573719=_0x1c6a8b?0x0:_0xabbfbf[_0x0b41('0x25')];var _0x5ed5be=_0x1c6a8b?_0x38d429['count']:_0xabbfbf[_0x0b41('0x25')]+_0xabbfbf[_0x0b41('0x28')];var _0xc1a622;if(_0x5ed5be>=_0x120064){_0x5ed5be=_0x120064;_0xc1a622=0xc8;}else{_0xc1a622=0xce;}_0x1e60c8[_0x0b41('0x22')](_0xc1a622);return _0x1e60c8[_0x0b41('0x29')]('Content-Range',_0x573719+'-'+_0x5ed5be+'/'+_0x120064)[_0x0b41('0x24')](_0x38d429);}return null;};}function patchUpdates(_0x541d75){return function(_0x1c6740){try{jsonpatch[_0x0b41('0x2a')](_0x1c6740,_0x541d75,!![]);}catch(_0x2006ed){return BPromise['reject'](_0x2006ed);}return _0x1c6740[_0x0b41('0x2b')]();};}function saveUpdates(_0x934a1,_0x414525){return function(_0x4fc48c){if(_0x4fc48c){return _0x4fc48c[_0x0b41('0x2c')](_0x934a1)[_0x0b41('0x2d')](function(_0x25dbdf){return _0x25dbdf;});}return null;};}function removeEntity(_0x5a7a7d,_0xe0055a){return function(_0xff8e03){if(_0xff8e03){return _0xff8e03[_0x0b41('0x2e')]()[_0x0b41('0x2d')](function(){var _0x4c39c8=_0xff8e03[_0x0b41('0x2f')]({'plain':!![]});var _0x8a217a=_0x0b41('0x30');return db[_0x0b41('0x31')][_0x0b41('0x2e')]({'where':{'type':_0x8a217a,'resourceId':_0x4c39c8['id']}})[_0x0b41('0x2d')](function(){return _0xff8e03;});})[_0x0b41('0x2d')](function(){_0x5a7a7d[_0x0b41('0x22')](0xcc)[_0x0b41('0x23')]();});}};}function handleEntityNotFound(_0xa8eb7,_0x1e020f){return function(_0x50ef5c){if(!_0x50ef5c){_0xa8eb7['sendStatus'](0x194);}return _0x50ef5c;};}function handleError(_0x1382d2,_0x5e36c7){_0x5e36c7=_0x5e36c7||0x1f4;return function(_0xa605a9){logger[_0x0b41('0x32')](_0xa605a9[_0x0b41('0x33')]);if(_0xa605a9[_0x0b41('0x34')]){delete _0xa605a9[_0x0b41('0x34')];}_0x1382d2[_0x0b41('0x22')](_0x5e36c7)['send'](_0xa605a9);};}exports['index']=function(_0x329065,_0x54fe5b){var _0x13cf89={},_0x486515={},_0x131217={'count':0x0,'rows':[]};var _0x5f3729=_[_0x0b41('0x35')](db[_0x0b41('0x36')]['rawAttributes'],function(_0x567640){return{'name':_0x567640[_0x0b41('0x37')],'type':_0x567640[_0x0b41('0x38')]['key']};});_0x486515['model']=_['map'](_0x5f3729,_0x0b41('0x34'));_0x486515[_0x0b41('0x39')]=_[_0x0b41('0x3a')](_0x329065['query']);_0x486515[_0x0b41('0x3b')]=_[_0x0b41('0x3c')](_0x486515[_0x0b41('0x3d')],_0x486515[_0x0b41('0x39')]);_0x13cf89['attributes']=_[_0x0b41('0x3c')](_0x486515[_0x0b41('0x3d')],qs['fields'](_0x329065[_0x0b41('0x39')]['fields']));_0x13cf89[_0x0b41('0x3e')]=_0x13cf89[_0x0b41('0x3e')][_0x0b41('0x3f')]?_0x13cf89[_0x0b41('0x3e')]:_0x486515['model'];if(!_0x329065[_0x0b41('0x39')][_0x0b41('0x40')]('nolimit')){_0x13cf89[_0x0b41('0x28')]=qs[_0x0b41('0x28')](_0x329065[_0x0b41('0x39')]['limit']);_0x13cf89[_0x0b41('0x25')]=qs[_0x0b41('0x25')](_0x329065[_0x0b41('0x39')][_0x0b41('0x25')]);}_0x13cf89[_0x0b41('0x41')]=qs[_0x0b41('0x42')](_0x329065[_0x0b41('0x39')][_0x0b41('0x42')]);_0x13cf89[_0x0b41('0x43')]=qs[_0x0b41('0x3b')](_[_0x0b41('0x44')](_0x329065[_0x0b41('0x39')],_0x486515[_0x0b41('0x3b')]),_0x5f3729);if(_0x329065[_0x0b41('0x39')][_0x0b41('0x45')]){_0x13cf89[_0x0b41('0x43')]=_['merge'](_0x13cf89['where'],{'$or':_[_0x0b41('0x35')](_0x5f3729,function(_0x114c89){if(_0x114c89[_0x0b41('0x38')]!==_0x0b41('0x46')){var _0x2225b4={};_0x2225b4[_0x114c89[_0x0b41('0x34')]]={'$like':'%'+_0x329065[_0x0b41('0x39')][_0x0b41('0x45')]+'%'};return _0x2225b4;}})});}_0x13cf89=_[_0x0b41('0x47')]({},_0x13cf89,_0x329065[_0x0b41('0x48')]);var _0x43caa6={'where':_0x13cf89['where']};return db[_0x0b41('0x36')][_0x0b41('0x27')](_0x43caa6)[_0x0b41('0x2d')](function(_0x34e4b3){_0x131217[_0x0b41('0x27')]=_0x34e4b3;if(_0x329065[_0x0b41('0x39')][_0x0b41('0x49')]){_0x13cf89['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0x0b41('0x4a')](_0x13cf89);})['then'](function(_0x3fc764){_0x131217[_0x0b41('0x4b')]=_0x3fc764;return _0x131217;})[_0x0b41('0x2d')](respondWithFilteredResult(_0x54fe5b,_0x13cf89))[_0x0b41('0x4c')](handleError(_0x54fe5b,null));};exports[_0x0b41('0x4d')]=function(_0x1517bf,_0x2c3e8b){var _0x178f28={'raw':!![],'where':{'id':_0x1517bf[_0x0b41('0x4e')]['id']}},_0x3b53ad={};_0x3b53ad[_0x0b41('0x3d')]=_['keys'](db[_0x0b41('0x36')][_0x0b41('0x4f')]);_0x3b53ad[_0x0b41('0x39')]=_[_0x0b41('0x3a')](_0x1517bf[_0x0b41('0x39')]);_0x3b53ad[_0x0b41('0x3b')]=_['intersection'](_0x3b53ad['model'],_0x3b53ad[_0x0b41('0x39')]);_0x178f28[_0x0b41('0x3e')]=_[_0x0b41('0x3c')](_0x3b53ad['model'],qs[_0x0b41('0x50')](_0x1517bf[_0x0b41('0x39')][_0x0b41('0x50')]));_0x178f28['attributes']=_0x178f28[_0x0b41('0x3e')][_0x0b41('0x3f')]?_0x178f28[_0x0b41('0x3e')]:_0x3b53ad['model'];if(_0x1517bf[_0x0b41('0x39')][_0x0b41('0x49')]){_0x178f28[_0x0b41('0x51')]=[{'all':!![]}];}_0x178f28=_['merge']({},_0x178f28,_0x1517bf['options']);return db[_0x0b41('0x36')][_0x0b41('0x52')](_0x178f28)[_0x0b41('0x2d')](handleEntityNotFound(_0x2c3e8b,null))[_0x0b41('0x2d')](respondWithResult(_0x2c3e8b,null))[_0x0b41('0x4c')](handleError(_0x2c3e8b,null));};exports[_0x0b41('0x53')]=function(_0x28e2dd,_0x3a52ca){return db['WhatsappQueue'][_0x0b41('0x53')](_0x28e2dd[_0x0b41('0x54')],{})[_0x0b41('0x2d')](function(_0x1fbac0){var _0x5eafdf=_0x28e2dd[_0x0b41('0x55')][_0x0b41('0x2f')]({'plain':!![]});if(!_0x5eafdf)throw new Error(_0x0b41('0x56'));if(_0x5eafdf[_0x0b41('0x57')]===_0x0b41('0x55')){var _0x58f5b6=_0x1fbac0[_0x0b41('0x2f')]({'plain':!![]});var _0x261927=_0x0b41('0x30');return db[_0x0b41('0x58')]['find']({'where':{'name':_0x261927,'userProfileId':_0x5eafdf['userProfileId']},'raw':!![]})[_0x0b41('0x2d')](function(_0x4f8fdc){if(_0x4f8fdc&&_0x4f8fdc[_0x0b41('0x59')]===0x0){return db[_0x0b41('0x31')][_0x0b41('0x53')]({'name':_0x58f5b6[_0x0b41('0x34')],'resourceId':_0x58f5b6['id'],'type':_0x4f8fdc[_0x0b41('0x34')],'sectionId':_0x4f8fdc['id']},{})[_0x0b41('0x2d')](function(){return _0x1fbac0;});}else{return _0x1fbac0;}})[_0x0b41('0x4c')](function(_0x4c4c80){logger[_0x0b41('0x32')](_0x0b41('0x5a'),_0x4c4c80);throw _0x4c4c80;});}return _0x1fbac0;})[_0x0b41('0x2d')](respondWithResult(_0x3a52ca,0xc9))[_0x0b41('0x4c')](handleError(_0x3a52ca,null));};exports['update']=function(_0x460346,_0x47ef60){if(_0x460346[_0x0b41('0x54')]['id']){delete _0x460346[_0x0b41('0x54')]['id'];}return db[_0x0b41('0x36')]['find']({'where':{'id':_0x460346['params']['id']}})[_0x0b41('0x2d')](handleEntityNotFound(_0x47ef60,null))[_0x0b41('0x2d')](saveUpdates(_0x460346[_0x0b41('0x54')],null))[_0x0b41('0x2d')](respondWithResult(_0x47ef60,null))[_0x0b41('0x4c')](handleError(_0x47ef60,null));};exports[_0x0b41('0x2e')]=function(_0x7fb8a8,_0x26b8f8){return db[_0x0b41('0x36')]['find']({'where':{'id':_0x7fb8a8[_0x0b41('0x4e')]['id']}})[_0x0b41('0x2d')](handleEntityNotFound(_0x26b8f8,null))[_0x0b41('0x2d')](removeEntity(_0x26b8f8,null))[_0x0b41('0x4c')](handleError(_0x26b8f8,null));};exports[_0x0b41('0x5b')]=function(_0x31cb9b,_0x6d6902){return db[_0x0b41('0x36')][_0x0b41('0x5b')]()[_0x0b41('0x2d')](respondWithResult(_0x6d6902,null))[_0x0b41('0x4c')](handleError(_0x6d6902,null));};exports[_0x0b41('0x5c')]=function(_0x4e5233,_0x22c2dd,_0xb9cf1f){var _0x5f4a47={'raw':!![],'where':{}},_0xb2e32d={},_0x396feb;return db[_0x0b41('0x36')][_0x0b41('0x5d')]({'where':{'id':_0x4e5233['params']['id']}})['then'](handleEntityNotFound(_0x22c2dd,null))['then'](function(_0x380350){if(_0x380350){_0x396feb=_0x380350['get']({'plain':!![]});_0xb2e32d[_0x0b41('0x3d')]=_[_0x0b41('0x3a')](db[_0x0b41('0x5e')]['rawAttributes']);_0xb2e32d[_0x0b41('0x39')]=_[_0x0b41('0x3a')](_0x4e5233[_0x0b41('0x39')]);_0xb2e32d[_0x0b41('0x3b')]=_['intersection'](_0xb2e32d[_0x0b41('0x3d')],_0xb2e32d[_0x0b41('0x39')]);_0x5f4a47[_0x0b41('0x3e')]=_[_0x0b41('0x3c')](_0xb2e32d[_0x0b41('0x3d')],qs[_0x0b41('0x50')](_0x4e5233[_0x0b41('0x39')][_0x0b41('0x50')]));_0x5f4a47[_0x0b41('0x3e')]=_0x5f4a47[_0x0b41('0x3e')]['length']?_0x5f4a47[_0x0b41('0x3e')]:_0xb2e32d[_0x0b41('0x3d')];if(!_0x4e5233[_0x0b41('0x39')][_0x0b41('0x40')](_0x0b41('0x5f'))){_0x5f4a47[_0x0b41('0x28')]=qs[_0x0b41('0x28')](_0x4e5233[_0x0b41('0x39')][_0x0b41('0x28')]);_0x5f4a47[_0x0b41('0x25')]=qs[_0x0b41('0x25')](_0x4e5233[_0x0b41('0x39')][_0x0b41('0x25')]);}_0x5f4a47[_0x0b41('0x41')]=qs[_0x0b41('0x42')](_0x4e5233[_0x0b41('0x39')]['sort']);_0x5f4a47[_0x0b41('0x43')]=qs[_0x0b41('0x3b')](_['pick'](_0x4e5233[_0x0b41('0x39')],_0xb2e32d[_0x0b41('0x3b')]));_0x5f4a47[_0x0b41('0x43')][_0x0b41('0x60')]=_0x380350['id'];if(_0x4e5233[_0x0b41('0x39')]['filter']){_0x5f4a47['where']=_[_0x0b41('0x47')](_0x5f4a47[_0x0b41('0x43')],{'$or':_['map'](_0x5f4a47[_0x0b41('0x3e')],function(_0x1bcfc5){var _0x26c663={};_0x26c663[_0x1bcfc5]={'$like':'%'+_0x4e5233['query'][_0x0b41('0x45')]+'%'};return _0x26c663;})});}_0x5f4a47=_['merge']({},_0x5f4a47,_0x4e5233[_0x0b41('0x48')]);return db[_0x0b41('0x5e')][_0x0b41('0x4a')](_0x5f4a47);}})['then'](function(_0x3b50ab){if(_0x3b50ab){return db[_0x0b41('0x61')][_0x0b41('0x62')]({'where':{'id':_[_0x0b41('0x35')](_0x3b50ab,_0x0b41('0x63')),'role':_0x0b41('0x64')},'attributes':['id','name','whatsappPause',_0x0b41('0x65'),'createdAt']});}})[_0x0b41('0x2d')](function(_0x4b7e28){if(_0x4b7e28){return{'count':_0x4b7e28[_0x0b41('0x27')],'rows':_['map'](_0x4b7e28[_0x0b41('0x4b')],function(_0x328e9e){return{'membername':_0x328e9e['name'],'UserId':_0x328e9e['id'],'queue_name':_0x396feb[_0x0b41('0x34')],'WhatsappQueueId':_0x396feb['id'],'interface':util[_0x0b41('0x66')]('%s/%s','SIP',_0x328e9e[_0x0b41('0x34')]),'penalty':0x0,'paused':_0x328e9e[_0x0b41('0x67')],'createdAt':_0x328e9e[_0x0b41('0x68')],'updatedAt':_0x328e9e[_0x0b41('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0b41('0x2d')](respondWithFilteredResult(_0x22c2dd,_0x5f4a47))[_0x0b41('0x4c')](handleError(_0x22c2dd,null));};exports[_0x0b41('0x69')]=function(_0x5d99f2,_0xcb3707,_0xb86caf){var _0x5742b6={};var _0x20d108={};var _0x316f47;var _0x3e04cf;return db[_0x0b41('0x36')][_0x0b41('0x5d')]({'where':{'id':_0x5d99f2['params']['id']}})[_0x0b41('0x2d')](handleEntityNotFound(_0xcb3707,null))[_0x0b41('0x2d')](function(_0x37a7f5){if(_0x37a7f5){_0x316f47=_0x37a7f5;_0x20d108[_0x0b41('0x3d')]=_[_0x0b41('0x3a')](db[_0x0b41('0x6a')][_0x0b41('0x4f')]);_0x20d108['query']=_[_0x0b41('0x3a')](_0x5d99f2[_0x0b41('0x39')]);_0x20d108[_0x0b41('0x3b')]=_[_0x0b41('0x3c')](_0x20d108['model'],_0x20d108[_0x0b41('0x39')]);_0x5742b6[_0x0b41('0x3e')]=_[_0x0b41('0x3c')](_0x20d108[_0x0b41('0x3d')],qs['fields'](_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x50')]));_0x5742b6['attributes']=_0x5742b6[_0x0b41('0x3e')][_0x0b41('0x3f')]?_0x5742b6[_0x0b41('0x3e')]:_0x20d108[_0x0b41('0x3d')];_0x5742b6[_0x0b41('0x41')]=qs[_0x0b41('0x42')](_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x42')]);_0x5742b6['where']=qs['filters'](_[_0x0b41('0x44')](_0x5d99f2['query'],_0x20d108[_0x0b41('0x3b')]));if(_0x5d99f2['query'][_0x0b41('0x45')]){_0x5742b6['where']=_[_0x0b41('0x47')](_0x5742b6['where'],{'$or':_[_0x0b41('0x35')](_0x5742b6[_0x0b41('0x3e')],function(_0x4a0a42){var _0x2b889e={};_0x2b889e[_0x4a0a42]={'$like':'%'+_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x45')]+'%'};return _0x2b889e;})});}_0x5742b6=_['merge']({},_0x5742b6,_0x5d99f2[_0x0b41('0x48')]);return _0x316f47[_0x0b41('0x69')](_0x5742b6);}})['then'](function(_0x276aae){if(_0x276aae){_0x3e04cf=_0x276aae[_0x0b41('0x3f')];if(!_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x40')]('nolimit')){_0x5742b6['limit']=qs[_0x0b41('0x28')](_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x28')]);_0x5742b6[_0x0b41('0x25')]=qs['offset'](_0x5d99f2[_0x0b41('0x39')][_0x0b41('0x25')]);}return _0x316f47['getTeams'](_0x5742b6);}})[_0x0b41('0x2d')](function(_0x560ce9){if(_0x560ce9){return _0x560ce9?{'count':_0x3e04cf,'rows':_0x560ce9}:null;}})['then'](respondWithResult(_0xcb3707,null))[_0x0b41('0x4c')](handleError(_0xcb3707,null));};exports[_0x0b41('0x6b')]=function(_0x23ff3a,_0x2e87a7,_0x18092d){var _0x54a17c=_0x23ff3a[_0x0b41('0x54')][_0x0b41('0x6c')];return db['Team'][_0x0b41('0x4a')]({'where':{'id':_0x54a17c},'attributes':['id'],'include':[{'model':db[_0x0b41('0x61')],'as':_0x0b41('0x6d'),'attributes':['id',_0x0b41('0x34'),_0x0b41('0x6e'),_0x0b41('0x6f'),_0x0b41('0x70')],'raw':!![]}]})[_0x0b41('0x2d')](function(_0x44273f){if(_0x44273f){var _0x560816=_['flatMap'](_0x44273f,function(_0x3b7f22){var _0x58dbfc=_0x3b7f22[_0x0b41('0x2f')]({'plain':!![]});return _0x58dbfc[_0x0b41('0x6d')];});return db['WhatsappQueue'][_0x0b41('0x52')]({'where':{'id':_0x23ff3a[_0x0b41('0x4e')]['id']}})[_0x0b41('0x2d')](function(_0x4d902c){return db[_0x0b41('0x71')][_0x0b41('0x72')](function(_0x3246ee){return _0x4d902c['addTeams'](_0x54a17c,{'transaction':_0x3246ee})[_0x0b41('0x2d')](function(){return BPromise[_0x0b41('0x73')](_0x560816,function(_0x23a6de){return db['UserWhatsappQueue'][_0x0b41('0x74')]({'where':{'UserId':_0x23a6de['id'],'WhatsappQueueId':_0x23ff3a[_0x0b41('0x4e')]['id']},'transaction':_0x3246ee});});})[_0x0b41('0x2d')](function(){_0x560816['forEach'](function(_0x915a20){socket['emit'](_0x0b41('0x75'),{'UserId':_0x915a20['id'],'WhatsappQueueId':_0x4d902c['id']});});});});});}})[_0x0b41('0x2d')](respondWithStatusCode(_0x2e87a7,null))[_0x0b41('0x4c')](handleError(_0x2e87a7,null));};exports['removeTeams']=function(_0x11d59b,_0x51cc6c,_0x48396d){return db['Team'][_0x0b41('0x4a')]({'where':{'id':_0x11d59b['query'][_0x0b41('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x0b41('0x61')],'as':_0x0b41('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x51cc6c,null))[_0x0b41('0x2d')](function(_0x4e95cf){var _0x4f83f1=_[_0x0b41('0x35')](_0x4e95cf,'id');var _0x3a43a3=[];var _0x47ade4=[];var _0x362bdd=squel[_0x0b41('0x76')]();_0x362bdd['field'](_0x0b41('0x77'))[_0x0b41('0x78')]('team_has_whatsapp_queues','tq')[_0x0b41('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0b41('0x43')]('WhatsappQueueId\x20=\x20?',_0x11d59b['params']['id']);for(var _0x286c14=0x0;_0x286c14<_0x4e95cf[_0x0b41('0x3f')];_0x286c14+=0x1){let _0x543f44=_0x4e95cf[_0x286c14];for(var _0x53d233=0x0;_0x53d233<_0x543f44[_0x0b41('0x6d')][_0x0b41('0x3f')];_0x53d233+=0x1){let _0x123233=_0x543f44[_0x0b41('0x6d')][_0x53d233];var _0x15bd52=_0x362bdd[_0x0b41('0x7a')]();_0x15bd52[_0x0b41('0x43')]('ut.UserId\x20=\x20?',_0x123233['id']);_0x47ade4[_0x0b41('0x7b')](db[_0x0b41('0x71')]['query'](_0x15bd52[_0x0b41('0x7c')](),{'type':db[_0x0b41('0x71')][_0x0b41('0x7d')]['SELECT']})['then'](function(_0x37852a){if(_0x37852a['length']===0x1){return _0x123233['id'];}else{var _0x3e6426=_[_0x0b41('0x7e')](_[_0x0b41('0x35')](_0x37852a,'TeamId'),function(_0x141d95){return _[_0x0b41('0x7f')](_0x4f83f1,_0x141d95);});if(_0x3e6426){return _0x123233['id'];}}}));}}return BPromise[_0x0b41('0x80')](_0x47ade4)[_0x0b41('0x2d')](function(_0x5bbd29){_0x3a43a3=_(_0x3a43a3)[_0x0b41('0x81')](_0x5bbd29)[_0x0b41('0x82')]()['value']();return db[_0x0b41('0x36')][_0x0b41('0x52')]({'where':{'id':_0x11d59b[_0x0b41('0x4e')]['id']}})[_0x0b41('0x2d')](function(_0x47f599){return db[_0x0b41('0x71')][_0x0b41('0x72')](function(_0x3ce37e){return _0x47f599['removeTeams'](_0x11d59b[_0x0b41('0x39')][_0x0b41('0x6c')],{'transaction':_0x3ce37e})[_0x0b41('0x2d')](function(){if(!_[_0x0b41('0x83')](_0x3a43a3)){return _0x47f599[_0x0b41('0x84')](_0x3a43a3,{'transaction':_0x3ce37e});}})[_0x0b41('0x2d')](function(){_0x3a43a3[_0x0b41('0x85')](function(_0x2cdeb9){socket[_0x0b41('0x86')](_0x0b41('0x87'),{'UserId':_0x2cdeb9,'WhatsappQueueId':_0x47f599['id']});});});});});});})['then'](respondWithStatusCode(_0x51cc6c,null))[_0x0b41('0x4c')](handleError(_0x51cc6c,null));};exports[_0x0b41('0x88')]=function(_0x42ff69,_0x5e0a91,_0x57b660){return db[_0x0b41('0x36')][_0x0b41('0x52')]({'where':{'id':_0x42ff69[_0x0b41('0x4e')]['id']}})[_0x0b41('0x2d')](handleEntityNotFound(_0x5e0a91,null))['then'](function(_0x422dec){if(_0x422dec){return _0x422dec['addAgents'](_0x42ff69[_0x0b41('0x54')]['ids'],_[_0x0b41('0x89')](_0x42ff69['body'],[_0x0b41('0x6c'),'id'])||{})['spread'](function(_0x43a419){for(var _0x4ce2b3=0x0;_0x4ce2b3<_0x42ff69['body'][_0x0b41('0x6c')][_0x0b41('0x3f')];_0x4ce2b3+=0x1){socket[_0x0b41('0x86')]('userWhatsappQueue:save',{'UserId':Number(_0x42ff69['body'][_0x0b41('0x6c')][_0x4ce2b3]),'WhatsappQueueId':Number(_0x42ff69[_0x0b41('0x4e')]['id'])});}return _0x43a419;});}})[_0x0b41('0x2d')](respondWithResult(_0x5e0a91,null))['catch'](handleError(_0x5e0a91,null));};exports[_0x0b41('0x84')]=function(_0xa39fa9,_0x548885,_0x5509eb){return db[_0x0b41('0x36')][_0x0b41('0x52')]({'where':{'id':_0xa39fa9['params']['id']}})['then'](handleEntityNotFound(_0x548885,null))[_0x0b41('0x2d')](function(_0x4057f8){if(_0x4057f8){return _0x4057f8['removeAgents'](_0xa39fa9[_0x0b41('0x39')][_0x0b41('0x6c')])[_0x0b41('0x2d')](function(){if(_[_0x0b41('0x8a')](_0xa39fa9['query'][_0x0b41('0x6c')])){for(var _0x3c5a45=0x0;_0x3c5a45<_0xa39fa9[_0x0b41('0x39')][_0x0b41('0x6c')]['length'];_0x3c5a45+=0x1){socket[_0x0b41('0x86')](_0x0b41('0x87'),{'UserId':Number(_0xa39fa9[_0x0b41('0x39')]['ids'][_0x3c5a45]),'WhatsappQueueId':Number(_0xa39fa9[_0x0b41('0x4e')]['id'])});}}else{socket[_0x0b41('0x86')](_0x0b41('0x87'),{'UserId':Number(_0xa39fa9[_0x0b41('0x39')][_0x0b41('0x6c')]),'WhatsappQueueId':Number(_0xa39fa9[_0x0b41('0x4e')]['id'])});}});}})[_0x0b41('0x2d')](respondWithStatusCode(_0x548885,null))[_0x0b41('0x4c')](handleError(_0x548885,null));};exports[_0x0b41('0x8b')]=function(_0x1fc42d,_0x28aff0,_0x31d3b5){var _0x5b1e54={};var _0x3e30d9={};var _0x2bb351;var _0x1e2a22;return db['WhatsappQueue'][_0x0b41('0x5d')]({'where':{'id':_0x1fc42d[_0x0b41('0x4e')]['id']}})[_0x0b41('0x2d')](handleEntityNotFound(_0x28aff0,null))['then'](function(_0x100c27){if(_0x100c27){_0x2bb351=_0x100c27;_0x3e30d9[_0x0b41('0x3d')]=_[_0x0b41('0x3a')](db[_0x0b41('0x61')][_0x0b41('0x4f')]);_0x3e30d9[_0x0b41('0x39')]=_[_0x0b41('0x3a')](_0x1fc42d[_0x0b41('0x39')]);_0x3e30d9[_0x0b41('0x3b')]=_[_0x0b41('0x3c')](_0x3e30d9[_0x0b41('0x3d')],_0x3e30d9['query']);_0x5b1e54[_0x0b41('0x3e')]=_['intersection'](_0x3e30d9[_0x0b41('0x3d')],qs[_0x0b41('0x50')](_0x1fc42d[_0x0b41('0x39')]['fields']));_0x5b1e54['attributes']=_0x5b1e54[_0x0b41('0x3e')]['length']?_0x5b1e54['attributes']:_0x3e30d9[_0x0b41('0x3d')];_0x5b1e54[_0x0b41('0x41')]=qs[_0x0b41('0x42')](_0x1fc42d['query'][_0x0b41('0x42')]);_0x5b1e54[_0x0b41('0x43')]=qs[_0x0b41('0x3b')](_['pick'](_0x1fc42d[_0x0b41('0x39')],_0x3e30d9['filters']));if(_0x1fc42d['query']['filter']){_0x5b1e54[_0x0b41('0x43')]=_[_0x0b41('0x47')](_0x5b1e54[_0x0b41('0x43')],{'$or':_[_0x0b41('0x35')](_0x5b1e54[_0x0b41('0x3e')],function(_0x4e1cfd){var _0x33566e={};_0x33566e[_0x4e1cfd]={'$like':'%'+_0x1fc42d[_0x0b41('0x39')]['filter']+'%'};return _0x33566e;})});}_0x5b1e54=_[_0x0b41('0x47')]({},_0x5b1e54,_0x1fc42d['options']);return _0x2bb351[_0x0b41('0x8b')](_0x5b1e54);}})['then'](function(_0x20ffbb){if(_0x20ffbb){_0x1e2a22=_0x20ffbb[_0x0b41('0x3f')];if(!_0x1fc42d[_0x0b41('0x39')][_0x0b41('0x40')](_0x0b41('0x5f'))){_0x5b1e54[_0x0b41('0x28')]=qs[_0x0b41('0x28')](_0x1fc42d[_0x0b41('0x39')][_0x0b41('0x28')]);_0x5b1e54[_0x0b41('0x25')]=qs[_0x0b41('0x25')](_0x1fc42d[_0x0b41('0x39')][_0x0b41('0x25')]);}return _0x2bb351[_0x0b41('0x8b')](_0x5b1e54);}})['then'](function(_0x1ec938){if(_0x1ec938){return _0x1ec938?{'count':_0x1e2a22,'rows':_0x1ec938}:null;}})[_0x0b41('0x2d')](respondWithResult(_0x28aff0,null))[_0x0b41('0x4c')](handleError(_0x28aff0,null));}; \ No newline at end of file +var _0x4015=['ids','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4015,0xb1));var _0x5401=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x4015[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5401('0x0'));var zipdir=require(_0x5401('0x1'));var jsonpatch=require(_0x5401('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5401('0x3'));var Mustache=require(_0x5401('0x4'));var util=require('util');var path=require('path');var sox=require(_0x5401('0x5'));var csv=require(_0x5401('0x6'));var ejs=require(_0x5401('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5401('0x8'));var crypto=require(_0x5401('0x9'));var jsforce=require(_0x5401('0xa'));var deskjs=require(_0x5401('0xb'));var toCsv=require(_0x5401('0x6'));var querystring=require(_0x5401('0xc'));var Papa=require(_0x5401('0xd'));var Redis=require(_0x5401('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5401('0xf'));var as=require(_0x5401('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5401('0x11'))(_0x5401('0x12'));var utils=require(_0x5401('0x13'));var config=require(_0x5401('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5401('0x15')](config['redis'],{'host':_0x5401('0x16'),'port':0x18eb});var socket=require(_0x5401('0x17'))(new Redis(config[_0x5401('0x18')]));require('./whatsappQueue.socket')[_0x5401('0x19')](socket);function respondWithStatusCode(_0x573072,_0x17e233){_0x17e233=_0x17e233||0xcc;return function(_0x57c4b){if(_0x57c4b){return _0x573072[_0x5401('0x1a')](_0x17e233);}return _0x573072[_0x5401('0x1b')](_0x17e233)[_0x5401('0x1c')]();};}function respondWithResult(_0x2a41c7,_0x57d055){_0x57d055=_0x57d055||0xc8;return function(_0x3b9bc8){if(_0x3b9bc8){return _0x2a41c7['status'](_0x57d055)['json'](_0x3b9bc8);}};}function respondWithFilteredResult(_0x30eb37,_0x3c6f85){return function(_0x399698){if(_0x399698){var _0x1ec1b6=typeof _0x3c6f85[_0x5401('0x1d')]===_0x5401('0x1e')&&typeof _0x3c6f85[_0x5401('0x1f')]==='undefined';var _0x131093=_0x399698[_0x5401('0x20')];var _0x1e2565=_0x1ec1b6?0x0:_0x3c6f85[_0x5401('0x1d')];var _0x5497d3=_0x1ec1b6?_0x399698['count']:_0x3c6f85[_0x5401('0x1d')]+_0x3c6f85[_0x5401('0x1f')];var _0x563cf1;if(_0x5497d3>=_0x131093){_0x5497d3=_0x131093;_0x563cf1=0xc8;}else{_0x563cf1=0xce;}_0x30eb37[_0x5401('0x1b')](_0x563cf1);return _0x30eb37[_0x5401('0x21')](_0x5401('0x22'),_0x1e2565+'-'+_0x5497d3+'/'+_0x131093)[_0x5401('0x23')](_0x399698);}return null;};}function patchUpdates(_0x82f58b){return function(_0x1d53b3){try{jsonpatch[_0x5401('0x24')](_0x1d53b3,_0x82f58b,!![]);}catch(_0x301a3a){return BPromise[_0x5401('0x25')](_0x301a3a);}return _0x1d53b3[_0x5401('0x26')]();};}function saveUpdates(_0x62fbcb,_0x1636eb){return function(_0x3fb1a5){if(_0x3fb1a5){return _0x3fb1a5[_0x5401('0x27')](_0x62fbcb)[_0x5401('0x28')](function(_0x101d2f){return _0x101d2f;});}return null;};}function removeEntity(_0x463724,_0x1d7e68){return function(_0x2886f2){if(_0x2886f2){return _0x2886f2[_0x5401('0x29')]()['then'](function(){var _0xd12444=_0x2886f2['get']({'plain':!![]});var _0x4b135e='WhatsappQueues';return db[_0x5401('0x2a')][_0x5401('0x29')]({'where':{'type':_0x4b135e,'resourceId':_0xd12444['id']}})['then'](function(){return _0x2886f2;});})[_0x5401('0x28')](function(){_0x463724[_0x5401('0x1b')](0xcc)[_0x5401('0x1c')]();});}};}function handleEntityNotFound(_0x26a7f1,_0x84dd37){return function(_0x29f4a5){if(!_0x29f4a5){_0x26a7f1[_0x5401('0x1a')](0x194);}return _0x29f4a5;};}function handleError(_0x1135f9,_0x3147c6){_0x3147c6=_0x3147c6||0x1f4;return function(_0x475e44){logger[_0x5401('0x2b')](_0x475e44[_0x5401('0x2c')]);if(_0x475e44[_0x5401('0x2d')]){delete _0x475e44[_0x5401('0x2d')];}_0x1135f9[_0x5401('0x1b')](_0x3147c6)[_0x5401('0x2e')](_0x475e44);};}exports['index']=function(_0x565486,_0x1f53a0){var _0x4af544={},_0x39af9d={},_0x37d177={'count':0x0,'rows':[]};var _0x30461a=_[_0x5401('0x2f')](db[_0x5401('0x30')][_0x5401('0x31')],function(_0xfe5f54){return{'name':_0xfe5f54[_0x5401('0x32')],'type':_0xfe5f54['type']['key']};});_0x39af9d['model']=_['map'](_0x30461a,_0x5401('0x2d'));_0x39af9d['query']=_[_0x5401('0x33')](_0x565486[_0x5401('0x34')]);_0x39af9d[_0x5401('0x35')]=_[_0x5401('0x36')](_0x39af9d[_0x5401('0x37')],_0x39af9d[_0x5401('0x34')]);_0x4af544[_0x5401('0x38')]=_[_0x5401('0x36')](_0x39af9d[_0x5401('0x37')],qs[_0x5401('0x39')](_0x565486[_0x5401('0x34')][_0x5401('0x39')]));_0x4af544[_0x5401('0x38')]=_0x4af544['attributes']['length']?_0x4af544[_0x5401('0x38')]:_0x39af9d[_0x5401('0x37')];if(!_0x565486['query'][_0x5401('0x3a')]('nolimit')){_0x4af544[_0x5401('0x1f')]=qs[_0x5401('0x1f')](_0x565486[_0x5401('0x34')][_0x5401('0x1f')]);_0x4af544['offset']=qs[_0x5401('0x1d')](_0x565486[_0x5401('0x34')][_0x5401('0x1d')]);}_0x4af544[_0x5401('0x3b')]=qs[_0x5401('0x3c')](_0x565486['query'][_0x5401('0x3c')]);_0x4af544[_0x5401('0x3d')]=qs[_0x5401('0x35')](_[_0x5401('0x3e')](_0x565486[_0x5401('0x34')],_0x39af9d[_0x5401('0x35')]),_0x30461a);if(_0x565486[_0x5401('0x34')][_0x5401('0x3f')]){_0x4af544[_0x5401('0x3d')]=_[_0x5401('0x40')](_0x4af544[_0x5401('0x3d')],{'$or':_['map'](_0x30461a,function(_0x4852db){if(_0x4852db[_0x5401('0x41')]!==_0x5401('0x42')){var _0x273e54={};_0x273e54[_0x4852db[_0x5401('0x2d')]]={'$like':'%'+_0x565486[_0x5401('0x34')][_0x5401('0x3f')]+'%'};return _0x273e54;}})});}_0x4af544=_[_0x5401('0x40')]({},_0x4af544,_0x565486[_0x5401('0x43')]);var _0x3aa9ea={'where':_0x4af544[_0x5401('0x3d')]};return db['WhatsappQueue'][_0x5401('0x20')](_0x3aa9ea)[_0x5401('0x28')](function(_0x3b1d98){_0x37d177['count']=_0x3b1d98;if(_0x565486['query'][_0x5401('0x44')]){_0x4af544['include']=[{'all':!![]}];}return db[_0x5401('0x30')][_0x5401('0x45')](_0x4af544);})['then'](function(_0x2367bf){_0x37d177[_0x5401('0x46')]=_0x2367bf;return _0x37d177;})[_0x5401('0x28')](respondWithFilteredResult(_0x1f53a0,_0x4af544))[_0x5401('0x47')](handleError(_0x1f53a0,null));};exports[_0x5401('0x48')]=function(_0x135f01,_0x1c5c84){var _0x4ec674={'raw':!![],'where':{'id':_0x135f01['params']['id']}},_0xf48c={};_0xf48c[_0x5401('0x37')]=_[_0x5401('0x33')](db[_0x5401('0x30')]['rawAttributes']);_0xf48c[_0x5401('0x34')]=_[_0x5401('0x33')](_0x135f01[_0x5401('0x34')]);_0xf48c[_0x5401('0x35')]=_[_0x5401('0x36')](_0xf48c[_0x5401('0x37')],_0xf48c[_0x5401('0x34')]);_0x4ec674[_0x5401('0x38')]=_['intersection'](_0xf48c['model'],qs[_0x5401('0x39')](_0x135f01['query'][_0x5401('0x39')]));_0x4ec674[_0x5401('0x38')]=_0x4ec674[_0x5401('0x38')][_0x5401('0x49')]?_0x4ec674[_0x5401('0x38')]:_0xf48c[_0x5401('0x37')];if(_0x135f01[_0x5401('0x34')][_0x5401('0x44')]){_0x4ec674[_0x5401('0x4a')]=[{'all':!![]}];}_0x4ec674=_[_0x5401('0x40')]({},_0x4ec674,_0x135f01[_0x5401('0x43')]);return db[_0x5401('0x30')]['find'](_0x4ec674)[_0x5401('0x28')](handleEntityNotFound(_0x1c5c84,null))[_0x5401('0x28')](respondWithResult(_0x1c5c84,null))[_0x5401('0x47')](handleError(_0x1c5c84,null));};exports[_0x5401('0x4b')]=function(_0x5b491f,_0x17c49b){return db[_0x5401('0x30')][_0x5401('0x4b')](_0x5b491f['body'],{})[_0x5401('0x28')](function(_0x5570dc){var _0x250d08=_0x5b491f[_0x5401('0x4c')][_0x5401('0x4d')]({'plain':!![]});if(!_0x250d08)throw new Error(_0x5401('0x4e'));if(_0x250d08[_0x5401('0x4f')]==='user'){var _0x23b9dc=_0x5570dc['get']({'plain':!![]});var _0x1e97d8='WhatsappQueues';return db[_0x5401('0x50')][_0x5401('0x51')]({'where':{'name':_0x1e97d8,'userProfileId':_0x250d08[_0x5401('0x52')]},'raw':!![]})['then'](function(_0x41b4fa){if(_0x41b4fa&&_0x41b4fa['autoAssociation']===0x0){return db[_0x5401('0x2a')][_0x5401('0x4b')]({'name':_0x23b9dc['name'],'resourceId':_0x23b9dc['id'],'type':_0x41b4fa['name'],'sectionId':_0x41b4fa['id']},{})[_0x5401('0x28')](function(){return _0x5570dc;});}else{return _0x5570dc;}})[_0x5401('0x47')](function(_0x907a8c){logger[_0x5401('0x2b')](_0x5401('0x53'),_0x907a8c);throw _0x907a8c;});}return _0x5570dc;})[_0x5401('0x28')](respondWithResult(_0x17c49b,0xc9))['catch'](handleError(_0x17c49b,null));};exports[_0x5401('0x27')]=function(_0x200360,_0x80ae3f){if(_0x200360[_0x5401('0x54')]['id']){delete _0x200360[_0x5401('0x54')]['id'];}return db['WhatsappQueue'][_0x5401('0x51')]({'where':{'id':_0x200360[_0x5401('0x55')]['id']}})['then'](handleEntityNotFound(_0x80ae3f,null))[_0x5401('0x28')](saveUpdates(_0x200360['body'],null))[_0x5401('0x28')](respondWithResult(_0x80ae3f,null))['catch'](handleError(_0x80ae3f,null));};exports[_0x5401('0x29')]=function(_0x380749,_0x112c1c){return db['WhatsappQueue']['find']({'where':{'id':_0x380749[_0x5401('0x55')]['id']}})[_0x5401('0x28')](handleEntityNotFound(_0x112c1c,null))[_0x5401('0x28')](removeEntity(_0x112c1c,null))[_0x5401('0x47')](handleError(_0x112c1c,null));};exports[_0x5401('0x56')]=function(_0x2a2db5,_0x533b48){return db[_0x5401('0x30')]['describe']()['then'](respondWithResult(_0x533b48,null))[_0x5401('0x47')](handleError(_0x533b48,null));};exports[_0x5401('0x57')]=function(_0x1ead14,_0x4e211c,_0x42a0f1){var _0x26b624={'raw':!![],'where':{}},_0x524a92={},_0x2be9aa;return db[_0x5401('0x30')][_0x5401('0x58')]({'where':{'id':_0x1ead14[_0x5401('0x55')]['id']}})[_0x5401('0x28')](handleEntityNotFound(_0x4e211c,null))[_0x5401('0x28')](function(_0x104adc){if(_0x104adc){_0x2be9aa=_0x104adc[_0x5401('0x4d')]({'plain':!![]});_0x524a92['model']=_['keys'](db[_0x5401('0x59')][_0x5401('0x31')]);_0x524a92[_0x5401('0x34')]=_[_0x5401('0x33')](_0x1ead14[_0x5401('0x34')]);_0x524a92[_0x5401('0x35')]=_[_0x5401('0x36')](_0x524a92['model'],_0x524a92[_0x5401('0x34')]);_0x26b624[_0x5401('0x38')]=_[_0x5401('0x36')](_0x524a92['model'],qs[_0x5401('0x39')](_0x1ead14[_0x5401('0x34')]['fields']));_0x26b624[_0x5401('0x38')]=_0x26b624[_0x5401('0x38')][_0x5401('0x49')]?_0x26b624[_0x5401('0x38')]:_0x524a92['model'];if(!_0x1ead14[_0x5401('0x34')][_0x5401('0x3a')](_0x5401('0x5a'))){_0x26b624[_0x5401('0x1f')]=qs[_0x5401('0x1f')](_0x1ead14[_0x5401('0x34')][_0x5401('0x1f')]);_0x26b624[_0x5401('0x1d')]=qs['offset'](_0x1ead14[_0x5401('0x34')]['offset']);}_0x26b624[_0x5401('0x3b')]=qs[_0x5401('0x3c')](_0x1ead14[_0x5401('0x34')][_0x5401('0x3c')]);_0x26b624[_0x5401('0x3d')]=qs[_0x5401('0x35')](_['pick'](_0x1ead14[_0x5401('0x34')],_0x524a92['filters']));_0x26b624[_0x5401('0x3d')][_0x5401('0x5b')]=_0x104adc['id'];if(_0x1ead14['query'][_0x5401('0x3f')]){_0x26b624[_0x5401('0x3d')]=_[_0x5401('0x40')](_0x26b624[_0x5401('0x3d')],{'$or':_[_0x5401('0x2f')](_0x26b624[_0x5401('0x38')],function(_0x31340f){var _0x26c7be={};_0x26c7be[_0x31340f]={'$like':'%'+_0x1ead14['query']['filter']+'%'};return _0x26c7be;})});}_0x26b624=_[_0x5401('0x40')]({},_0x26b624,_0x1ead14[_0x5401('0x43')]);return db['UserWhatsappQueue'][_0x5401('0x45')](_0x26b624);}})[_0x5401('0x28')](function(_0x550a1b){if(_0x550a1b){return db[_0x5401('0x5c')][_0x5401('0x5d')]({'where':{'id':_[_0x5401('0x2f')](_0x550a1b,_0x5401('0x5e')),'role':_0x5401('0x5f')},'attributes':['id','name',_0x5401('0x60'),_0x5401('0x61'),_0x5401('0x62')]});}})[_0x5401('0x28')](function(_0xcb8e62){if(_0xcb8e62){return{'count':_0xcb8e62[_0x5401('0x20')],'rows':_[_0x5401('0x2f')](_0xcb8e62[_0x5401('0x46')],function(_0x5b69b2){return{'membername':_0x5b69b2[_0x5401('0x2d')],'UserId':_0x5b69b2['id'],'queue_name':_0x2be9aa[_0x5401('0x2d')],'WhatsappQueueId':_0x2be9aa['id'],'interface':util[_0x5401('0x63')](_0x5401('0x64'),_0x5401('0x65'),_0x5b69b2[_0x5401('0x2d')]),'penalty':0x0,'paused':_0x5b69b2[_0x5401('0x60')],'createdAt':_0x5b69b2[_0x5401('0x62')],'updatedAt':_0x5b69b2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4e211c,_0x26b624))[_0x5401('0x47')](handleError(_0x4e211c,null));};exports[_0x5401('0x66')]=function(_0x9b392b,_0x380fb7,_0x480e24){var _0x1a4886={};var _0x29254a={};var _0x52b836;var _0x5a00e4;return db[_0x5401('0x30')][_0x5401('0x58')]({'where':{'id':_0x9b392b[_0x5401('0x55')]['id']}})[_0x5401('0x28')](handleEntityNotFound(_0x380fb7,null))['then'](function(_0x2277ba){if(_0x2277ba){_0x52b836=_0x2277ba;_0x29254a['model']=_['keys'](db[_0x5401('0x67')][_0x5401('0x31')]);_0x29254a[_0x5401('0x34')]=_[_0x5401('0x33')](_0x9b392b[_0x5401('0x34')]);_0x29254a[_0x5401('0x35')]=_[_0x5401('0x36')](_0x29254a[_0x5401('0x37')],_0x29254a[_0x5401('0x34')]);_0x1a4886[_0x5401('0x38')]=_[_0x5401('0x36')](_0x29254a[_0x5401('0x37')],qs[_0x5401('0x39')](_0x9b392b['query'][_0x5401('0x39')]));_0x1a4886['attributes']=_0x1a4886[_0x5401('0x38')][_0x5401('0x49')]?_0x1a4886[_0x5401('0x38')]:_0x29254a[_0x5401('0x37')];_0x1a4886[_0x5401('0x3b')]=qs['sort'](_0x9b392b[_0x5401('0x34')][_0x5401('0x3c')]);_0x1a4886[_0x5401('0x3d')]=qs[_0x5401('0x35')](_['pick'](_0x9b392b[_0x5401('0x34')],_0x29254a[_0x5401('0x35')]));if(_0x9b392b[_0x5401('0x34')][_0x5401('0x3f')]){_0x1a4886['where']=_['merge'](_0x1a4886['where'],{'$or':_['map'](_0x1a4886[_0x5401('0x38')],function(_0x56557d){var _0x36668e={};_0x36668e[_0x56557d]={'$like':'%'+_0x9b392b[_0x5401('0x34')][_0x5401('0x3f')]+'%'};return _0x36668e;})});}_0x1a4886=_[_0x5401('0x40')]({},_0x1a4886,_0x9b392b['options']);return _0x52b836[_0x5401('0x66')](_0x1a4886);}})[_0x5401('0x28')](function(_0x2c0759){if(_0x2c0759){_0x5a00e4=_0x2c0759[_0x5401('0x49')];if(!_0x9b392b[_0x5401('0x34')][_0x5401('0x3a')]('nolimit')){_0x1a4886[_0x5401('0x1f')]=qs[_0x5401('0x1f')](_0x9b392b['query'][_0x5401('0x1f')]);_0x1a4886[_0x5401('0x1d')]=qs[_0x5401('0x1d')](_0x9b392b[_0x5401('0x34')][_0x5401('0x1d')]);}return _0x52b836[_0x5401('0x66')](_0x1a4886);}})['then'](function(_0x3dd230){if(_0x3dd230){return _0x3dd230?{'count':_0x5a00e4,'rows':_0x3dd230}:null;}})[_0x5401('0x28')](respondWithResult(_0x380fb7,null))[_0x5401('0x47')](handleError(_0x380fb7,null));};exports[_0x5401('0x68')]=function(_0x544dd0,_0x27e128,_0x59bce4){var _0x13cc86=_0x544dd0['body'][_0x5401('0x69')];return db[_0x5401('0x67')][_0x5401('0x45')]({'where':{'id':_0x13cc86},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5401('0x6a'),'attributes':['id',_0x5401('0x2d'),_0x5401('0x6b'),_0x5401('0x6c'),'interface'],'raw':!![]}]})[_0x5401('0x28')](function(_0x42f95e){if(_0x42f95e){var _0x3fb843=_['flatMap'](_0x42f95e,function(_0x1e98c9){var _0x3e80bb=_0x1e98c9[_0x5401('0x4d')]({'plain':!![]});return _0x3e80bb[_0x5401('0x6a')];});return db[_0x5401('0x30')][_0x5401('0x51')]({'where':{'id':_0x544dd0[_0x5401('0x55')]['id']}})[_0x5401('0x28')](function(_0x228ddf){return db['sequelize'][_0x5401('0x6d')](function(_0x203c31){return _0x228ddf[_0x5401('0x68')](_0x13cc86,{'transaction':_0x203c31})['then'](function(){return BPromise[_0x5401('0x6e')](_0x3fb843,function(_0x3ef747){return db[_0x5401('0x59')][_0x5401('0x6f')]({'where':{'UserId':_0x3ef747['id'],'WhatsappQueueId':_0x544dd0[_0x5401('0x55')]['id']},'transaction':_0x203c31});});})[_0x5401('0x28')](function(){_0x3fb843[_0x5401('0x70')](function(_0x23ca65){socket[_0x5401('0x71')](_0x5401('0x72'),{'UserId':_0x23ca65['id'],'WhatsappQueueId':_0x228ddf['id']});});});});});}})[_0x5401('0x28')](respondWithStatusCode(_0x27e128,null))[_0x5401('0x47')](handleError(_0x27e128,null));};exports[_0x5401('0x73')]=function(_0x4d262a,_0x5026ee,_0x4dc45b){return db[_0x5401('0x67')][_0x5401('0x45')]({'where':{'id':_0x4d262a[_0x5401('0x34')][_0x5401('0x69')]},'attributes':['id'],'include':[{'model':db[_0x5401('0x5c')],'as':_0x5401('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5026ee,null))[_0x5401('0x28')](function(_0x375f24){var _0x13f5ce=_[_0x5401('0x2f')](_0x375f24,'id');var _0x524ebd=[];var _0x58d2a9=[];var _0x39286d=squel[_0x5401('0x74')]();_0x39286d[_0x5401('0x75')](_0x5401('0x76'))['from']('team_has_whatsapp_queues','tq')[_0x5401('0x77')](_0x5401('0x78'),'ut',_0x5401('0x79'))[_0x5401('0x3d')](_0x5401('0x7a'),_0x4d262a[_0x5401('0x55')]['id']);for(var _0x48068c=0x0;_0x48068c<_0x375f24[_0x5401('0x49')];_0x48068c+=0x1){let _0x332f0d=_0x375f24[_0x48068c];for(var _0xea8be=0x0;_0xea8be<_0x332f0d[_0x5401('0x6a')][_0x5401('0x49')];_0xea8be+=0x1){let _0x2b1a32=_0x332f0d['Agents'][_0xea8be];var _0x379cb1=_0x39286d[_0x5401('0x7b')]();_0x379cb1[_0x5401('0x3d')](_0x5401('0x7c'),_0x2b1a32['id']);_0x58d2a9[_0x5401('0x7d')](db[_0x5401('0x7e')]['query'](_0x379cb1['toString'](),{'type':db[_0x5401('0x7e')][_0x5401('0x7f')][_0x5401('0x80')]})[_0x5401('0x28')](function(_0x4422e2){if(_0x4422e2[_0x5401('0x49')]===0x1){return _0x2b1a32['id'];}else{var _0x33d1da=_[_0x5401('0x81')](_[_0x5401('0x2f')](_0x4422e2,'TeamId'),function(_0x41f48e){return _['includes'](_0x13f5ce,_0x41f48e);});if(_0x33d1da){return _0x2b1a32['id'];}}}));}}return BPromise[_0x5401('0x82')](_0x58d2a9)['then'](function(_0x305a3f){_0x524ebd=_(_0x524ebd)[_0x5401('0x83')](_0x305a3f)[_0x5401('0x84')]()['value']();return db[_0x5401('0x30')][_0x5401('0x51')]({'where':{'id':_0x4d262a['params']['id']}})[_0x5401('0x28')](function(_0x1264f0){return db[_0x5401('0x7e')][_0x5401('0x6d')](function(_0x703eaf){return _0x1264f0['removeTeams'](_0x4d262a['query'][_0x5401('0x69')],{'transaction':_0x703eaf})[_0x5401('0x28')](function(){if(!_[_0x5401('0x85')](_0x524ebd)){return _0x1264f0[_0x5401('0x86')](_0x524ebd,{'transaction':_0x703eaf});}})[_0x5401('0x28')](function(){_0x524ebd[_0x5401('0x70')](function(_0x236a28){socket[_0x5401('0x71')](_0x5401('0x87'),{'UserId':_0x236a28,'WhatsappQueueId':_0x1264f0['id']});});});});});});})[_0x5401('0x28')](respondWithStatusCode(_0x5026ee,null))[_0x5401('0x47')](handleError(_0x5026ee,null));};exports[_0x5401('0x88')]=function(_0x4061fa,_0x223db8,_0x50854d){return db[_0x5401('0x30')][_0x5401('0x51')]({'where':{'id':_0x4061fa[_0x5401('0x55')]['id']}})[_0x5401('0x28')](handleEntityNotFound(_0x223db8,null))[_0x5401('0x28')](function(_0x4be4d4){if(_0x4be4d4){return _0x4be4d4[_0x5401('0x88')](_0x4061fa[_0x5401('0x54')][_0x5401('0x69')],_[_0x5401('0x89')](_0x4061fa[_0x5401('0x54')],[_0x5401('0x69'),'id'])||{})[_0x5401('0x8a')](function(_0x176396){for(var _0x243b04=0x0;_0x243b04<_0x4061fa['body'][_0x5401('0x69')]['length'];_0x243b04+=0x1){socket[_0x5401('0x71')](_0x5401('0x72'),{'UserId':Number(_0x4061fa[_0x5401('0x54')]['ids'][_0x243b04]),'WhatsappQueueId':Number(_0x4061fa['params']['id'])});}return _0x176396;});}})['then'](respondWithResult(_0x223db8,null))['catch'](handleError(_0x223db8,null));};exports[_0x5401('0x86')]=function(_0x1f3434,_0x41eab7,_0x1152e1){return db[_0x5401('0x30')]['find']({'where':{'id':_0x1f3434[_0x5401('0x55')]['id']}})['then'](handleEntityNotFound(_0x41eab7,null))[_0x5401('0x28')](function(_0x4ef6ae){if(_0x4ef6ae){return _0x4ef6ae['removeAgents'](_0x1f3434[_0x5401('0x34')][_0x5401('0x69')])[_0x5401('0x28')](function(){if(_[_0x5401('0x8b')](_0x1f3434[_0x5401('0x34')][_0x5401('0x69')])){for(var _0x3a2bab=0x0;_0x3a2bab<_0x1f3434[_0x5401('0x34')][_0x5401('0x69')]['length'];_0x3a2bab+=0x1){socket[_0x5401('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x1f3434[_0x5401('0x34')][_0x5401('0x69')][_0x3a2bab]),'WhatsappQueueId':Number(_0x1f3434[_0x5401('0x55')]['id'])});}}else{socket[_0x5401('0x71')](_0x5401('0x87'),{'UserId':Number(_0x1f3434[_0x5401('0x34')][_0x5401('0x69')]),'WhatsappQueueId':Number(_0x1f3434[_0x5401('0x55')]['id'])});}});}})[_0x5401('0x28')](respondWithStatusCode(_0x41eab7,null))[_0x5401('0x47')](handleError(_0x41eab7,null));};exports[_0x5401('0x8c')]=function(_0x2972e2,_0x1f19d9,_0x19481b){var _0x45f906={};var _0x4fe340={};var _0x29fe5d;var _0x583dfa;return db[_0x5401('0x30')][_0x5401('0x58')]({'where':{'id':_0x2972e2[_0x5401('0x55')]['id']}})[_0x5401('0x28')](handleEntityNotFound(_0x1f19d9,null))['then'](function(_0x2ddec8){if(_0x2ddec8){_0x29fe5d=_0x2ddec8;_0x4fe340[_0x5401('0x37')]=_[_0x5401('0x33')](db['User'][_0x5401('0x31')]);_0x4fe340[_0x5401('0x34')]=_[_0x5401('0x33')](_0x2972e2['query']);_0x4fe340[_0x5401('0x35')]=_[_0x5401('0x36')](_0x4fe340[_0x5401('0x37')],_0x4fe340[_0x5401('0x34')]);_0x45f906[_0x5401('0x38')]=_['intersection'](_0x4fe340[_0x5401('0x37')],qs[_0x5401('0x39')](_0x2972e2[_0x5401('0x34')]['fields']));_0x45f906[_0x5401('0x38')]=_0x45f906[_0x5401('0x38')]['length']?_0x45f906['attributes']:_0x4fe340[_0x5401('0x37')];_0x45f906[_0x5401('0x3b')]=qs[_0x5401('0x3c')](_0x2972e2['query'][_0x5401('0x3c')]);_0x45f906['where']=qs[_0x5401('0x35')](_[_0x5401('0x3e')](_0x2972e2[_0x5401('0x34')],_0x4fe340[_0x5401('0x35')]));if(_0x2972e2[_0x5401('0x34')]['filter']){_0x45f906[_0x5401('0x3d')]=_[_0x5401('0x40')](_0x45f906[_0x5401('0x3d')],{'$or':_[_0x5401('0x2f')](_0x45f906[_0x5401('0x38')],function(_0x28b02e){var _0x346bc5={};_0x346bc5[_0x28b02e]={'$like':'%'+_0x2972e2[_0x5401('0x34')]['filter']+'%'};return _0x346bc5;})});}_0x45f906=_[_0x5401('0x40')]({},_0x45f906,_0x2972e2['options']);return _0x29fe5d['getAgents'](_0x45f906);}})[_0x5401('0x28')](function(_0x4afbf1){if(_0x4afbf1){_0x583dfa=_0x4afbf1['length'];if(!_0x2972e2['query']['hasOwnProperty'](_0x5401('0x5a'))){_0x45f906[_0x5401('0x1f')]=qs[_0x5401('0x1f')](_0x2972e2[_0x5401('0x34')][_0x5401('0x1f')]);_0x45f906[_0x5401('0x1d')]=qs[_0x5401('0x1d')](_0x2972e2[_0x5401('0x34')][_0x5401('0x1d')]);}return _0x29fe5d[_0x5401('0x8c')](_0x45f906);}})['then'](function(_0x31b104){if(_0x31b104){return _0x31b104?{'count':_0x583dfa,'rows':_0x31b104}:null;}})['then'](respondWithResult(_0x1f19d9,null))[_0x5401('0x47')](handleError(_0x1f19d9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index b744a8f..b8a656e 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 _0x5484=['exports','WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x298261,_0x19ed9d){var _0x4737a2=function(_0x166c17){while(--_0x166c17){_0x298261['push'](_0x298261['shift']());}};_0x4737a2(++_0x19ed9d);}(_0x5484,0x199));var _0x4548=function(_0x38b734,_0x282bab){_0x38b734=_0x38b734-0x0;var _0x328117=_0x5484[_0x38b734];return _0x328117;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x4548('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4548('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4548('0x2'),'afterDestroy':_0x4548('0x3')};function emitEvent(_0x453970){return function(_0xa914b9,_0x379f80,_0x36d91b){WhatsappQueueEvents[_0x4548('0x4')](_0x453970+':'+_0xa914b9['id'],_0xa914b9);WhatsappQueueEvents['emit'](_0x453970,_0xa914b9);_0x36d91b(null);};}for(var e in events){if(events[_0x4548('0x5')](e)){var event=events[e];WhatsappQueue[_0x4548('0x6')](e,emitEvent(event));}}module[_0x4548('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa4f7=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue'];(function(_0x109566,_0x4d5510){var _0x4f0c8f=function(_0x773978){while(--_0x773978){_0x109566['push'](_0x109566['shift']());}};_0x4f0c8f(++_0x4d5510);}(_0xa4f7,0xd6));var _0x7a4f=function(_0xa95478,_0xe8470e){_0xa95478=_0xa95478-0x0;var _0x33a045=_0xa4f7[_0xa95478];return _0x33a045;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x7a4f('0x0'))['db'][_0x7a4f('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7a4f('0x2'),'afterUpdate':_0x7a4f('0x3'),'afterDestroy':_0x7a4f('0x4')};function emitEvent(_0x230fd3){return function(_0x20762d,_0x75ba39,_0xfc0aac){WhatsappQueueEvents[_0x7a4f('0x5')](_0x230fd3+':'+_0x20762d['id'],_0x20762d);WhatsappQueueEvents[_0x7a4f('0x5')](_0x230fd3,_0x20762d);_0xfc0aac(null);};}for(var e in events){if(events[_0x7a4f('0x6')](e)){var event=events[e];WhatsappQueue[_0x7a4f('0x7')](e,emitEvent(event));}}module[_0x7a4f('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 70c5031..f4dea00 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 _0xc069=['rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','util','api','bluebird','request-promise','path'];(function(_0xb605ce,_0x10574f){var _0x5059a5=function(_0x361db3){while(--_0x361db3){_0xb605ce['push'](_0xb605ce['shift']());}};_0x5059a5(++_0x10574f);}(_0xc069,0xd7));var _0x9c06=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc069[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x9c06('0x0'));var logger=require('../../config/logger')(_0x9c06('0x1'));var moment=require('moment');var BPromise=require(_0x9c06('0x2'));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['exports']=function(_0x3b34d2,_0x3e26d5){return _0x3b34d2[_0x9c06('0x8')](_0x9c06('0x9'),attributes,{'tableName':_0x9c06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1130=['WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappQueue.attributes','define'];(function(_0x44cb12,_0x22381a){var _0x3f2610=function(_0x4c4d7e){while(--_0x4c4d7e){_0x44cb12['push'](_0x44cb12['shift']());}};_0x3f2610(++_0x22381a);}(_0x1130,0x115));var _0x0113=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x1130[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x0113('0x0'));var logger=require(_0x0113('0x1'))(_0x0113('0x2'));var moment=require(_0x0113('0x3'));var BPromise=require(_0x0113('0x4'));var rp=require(_0x0113('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0113('0x6'));var attributes=require(_0x0113('0x7'));module['exports']=function(_0x15b63d,_0x56ee1a){return _0x15b63d[_0x0113('0x8')](_0x0113('0x9'),attributes,{'tableName':_0x0113('0xa'),'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 54b8759..918579f 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 _0x4b20=['error','code','message','result','catch','GetWhatsappQueue','findAll','options','where','limit','include','model','attributes','map','info','stringify','WhatsappQueue','raw','ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0x4b20,0x10f));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x04b2('0x0'));var util=require(_0x04b2('0x1'));var moment=require(_0x04b2('0x2'));var BPromise=require(_0x04b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04b2('0x4'));var db=require(_0x04b2('0x5'))['db'];var utils=require(_0x04b2('0x6'));var logger=require(_0x04b2('0x7'))(_0x04b2('0x8'));var config=require(_0x04b2('0x9'));var jayson=require(_0x04b2('0xa'));var client=jayson[_0x04b2('0xb')][_0x04b2('0xc')]({'port':0x232a});config[_0x04b2('0xd')]=_[_0x04b2('0xe')](config[_0x04b2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x04b2('0xf'))(new Redis(config[_0x04b2('0xd')]));require('./whatsappQueue.socket')[_0x04b2('0x10')](socket);function respondWithRpcPromise(_0x13adee,_0x2f1385,_0x1ff83a){return new BPromise(function(_0x424417,_0x28b40f){return client[_0x04b2('0x11')](_0x13adee,_0x1ff83a)[_0x04b2('0x12')](function(_0xa997b6){logger['info'](_0x04b2('0x13'),_0x2f1385,_0x04b2('0x14'));logger[_0x04b2('0x15')](_0x04b2('0x16'),_0x2f1385,_0x04b2('0x14'),JSON['stringify'](_0xa997b6));if(_0xa997b6[_0x04b2('0x17')]){if(_0xa997b6[_0x04b2('0x17')][_0x04b2('0x18')]===0x1f4){logger[_0x04b2('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x2f1385,_0xa997b6[_0x04b2('0x17')]['message']);return _0x28b40f(_0xa997b6[_0x04b2('0x17')][_0x04b2('0x19')]);}logger[_0x04b2('0x17')](_0x04b2('0x13'),_0x2f1385,_0xa997b6['error']['message']);return _0x424417(_0xa997b6[_0x04b2('0x17')][_0x04b2('0x19')]);}else{logger['info'](_0x04b2('0x13'),_0x2f1385,_0x04b2('0x14'));_0x424417(_0xa997b6[_0x04b2('0x1a')][_0x04b2('0x19')]);}})[_0x04b2('0x1b')](function(_0x193a99){logger[_0x04b2('0x17')](_0x04b2('0x13'),_0x2f1385,_0x193a99);_0x28b40f(_0x193a99);});});}exports[_0x04b2('0x1c')]=function(_0x422150){var _0x58ec28=this;return new Promise(function(_0x1acd9a,_0x366e13){return db['WhatsappQueue'][_0x04b2('0x1d')]({'raw':_0x422150[_0x04b2('0x1e')]?_0x422150[_0x04b2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x422150[_0x04b2('0x1e')]?_0x422150['options'][_0x04b2('0x1f')]||null:null,'attributes':_0x422150[_0x04b2('0x1e')]?_0x422150[_0x04b2('0x1e')]['attributes']||null:null,'limit':_0x422150[_0x04b2('0x1e')]?_0x422150['options'][_0x04b2('0x20')]||null:null,'include':_0x422150[_0x04b2('0x1e')]?_0x422150[_0x04b2('0x1e')][_0x04b2('0x21')]?_['map'](_0x422150[_0x04b2('0x1e')][_0x04b2('0x21')],function(_0x170a23){return{'model':db[_0x170a23[_0x04b2('0x22')]],'as':_0x170a23['as'],'attributes':_0x170a23[_0x04b2('0x23')],'include':_0x170a23[_0x04b2('0x21')]?_['map'](_0x170a23['include'],function(_0x11086e){return{'model':db[_0x11086e[_0x04b2('0x22')]],'as':_0x11086e['as'],'attributes':_0x11086e['attributes'],'include':_0x11086e['include']?_[_0x04b2('0x24')](_0x11086e[_0x04b2('0x21')],function(_0x14a538){return{'model':db[_0x14a538[_0x04b2('0x22')]],'as':_0x14a538['as'],'attributes':_0x14a538[_0x04b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x04b2('0x12')](function(_0x4f7e46){logger[_0x04b2('0x25')](_0x04b2('0x1c'),_0x422150);logger['debug']('GetWhatsappQueue',_0x422150,JSON[_0x04b2('0x26')](_0x4f7e46));_0x1acd9a(_0x4f7e46);})['catch'](function(_0x1ef085){logger[_0x04b2('0x17')]('GetWhatsappQueue',_0x1ef085[_0x04b2('0x19')],_0x422150);_0x366e13(_0x58ec28[_0x04b2('0x17')](0x1f4,_0x1ef085[_0x04b2('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x3ef489){var _0x5980e7=this;return new Promise(function(_0x31dff0,_0xf97131){return db[_0x04b2('0x27')]['find']({'raw':_0x3ef489['options']?_0x3ef489[_0x04b2('0x1e')][_0x04b2('0x28')]===undefined?!![]:![]:!![],'where':_0x3ef489[_0x04b2('0x1e')]?_0x3ef489[_0x04b2('0x1e')][_0x04b2('0x1f')]||null:null,'attributes':_0x3ef489[_0x04b2('0x1e')]?_0x3ef489[_0x04b2('0x1e')]['attributes']||null:null,'include':_0x3ef489[_0x04b2('0x1e')]?_0x3ef489[_0x04b2('0x1e')][_0x04b2('0x21')]?_[_0x04b2('0x24')](_0x3ef489['options'][_0x04b2('0x21')],function(_0x51f6c4){return{'model':db[_0x51f6c4[_0x04b2('0x22')]],'as':_0x51f6c4['as'],'attributes':_0x51f6c4['attributes'],'include':_0x51f6c4[_0x04b2('0x21')]?_[_0x04b2('0x24')](_0x51f6c4[_0x04b2('0x21')],function(_0x37cf05){return{'model':db[_0x37cf05[_0x04b2('0x22')]],'as':_0x37cf05['as'],'attributes':_0x37cf05[_0x04b2('0x23')],'include':_0x37cf05[_0x04b2('0x21')]?_['map'](_0x37cf05[_0x04b2('0x21')],function(_0x1a25e1){return{'model':db[_0x1a25e1[_0x04b2('0x22')]],'as':_0x1a25e1['as'],'attributes':_0x1a25e1[_0x04b2('0x23')]};}):[]};}):[]};}):[]:[]})[_0x04b2('0x12')](function(_0x4f4c0b){logger[_0x04b2('0x25')](_0x04b2('0x29'),_0x3ef489);logger['debug'](_0x04b2('0x29'),_0x3ef489,JSON[_0x04b2('0x26')](_0x4f4c0b));_0x31dff0(_0x4f4c0b);})['catch'](function(_0x17d263){logger[_0x04b2('0x17')](_0x04b2('0x29'),_0x17d263['message'],_0x3ef489);_0xf97131(_0x5980e7[_0x04b2('0x17')](0x1f4,_0x17d263[_0x04b2('0x19')]));});});}; \ No newline at end of file +var _0x400e=['rpc','client','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','model','include','map','ShowWhatsappQueue','find','stringify','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xaf5f7d,_0x75eeff){var _0x14ea40=function(_0x42ff49){while(--_0x42ff49){_0xaf5f7d['push'](_0xaf5f7d['shift']());}};_0x14ea40(++_0x75eeff);}(_0x400e,0x1f3));var _0xe400=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x400e[_0x65c0bb];return _0x320bd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe400('0x0'));var BPromise=require('bluebird');var rs=require(_0xe400('0x1'));var fs=require('fs');var Redis=require(_0xe400('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe400('0x3'));var logger=require(_0xe400('0x4'))(_0xe400('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe400('0x6')]['http']({'port':0x232a});config[_0xe400('0x7')]=_['defaults'](config['redis'],{'host':_0xe400('0x8'),'port':0x18eb});var socket=require(_0xe400('0x9'))(new Redis(config[_0xe400('0x7')]));require('./whatsappQueue.socket')[_0xe400('0xa')](socket);function respondWithRpcPromise(_0x549310,_0x4afc11,_0x259f10){return new BPromise(function(_0x129b15,_0x244f85){return client[_0xe400('0xb')](_0x549310,_0x259f10)[_0xe400('0xc')](function(_0x45645a){logger[_0xe400('0xd')](_0xe400('0xe'),_0x4afc11,_0xe400('0xf'));logger[_0xe400('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4afc11,_0xe400('0xf'),JSON['stringify'](_0x45645a));if(_0x45645a[_0xe400('0x11')]){if(_0x45645a['error'][_0xe400('0x12')]===0x1f4){logger[_0xe400('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x4afc11,_0x45645a['error']['message']);return _0x244f85(_0x45645a[_0xe400('0x11')]['message']);}logger[_0xe400('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x4afc11,_0x45645a[_0xe400('0x11')]['message']);return _0x129b15(_0x45645a[_0xe400('0x11')][_0xe400('0x13')]);}else{logger[_0xe400('0xd')]('WhatsappQueue,\x20%s,\x20%s',_0x4afc11,_0xe400('0xf'));_0x129b15(_0x45645a[_0xe400('0x14')]['message']);}})[_0xe400('0x15')](function(_0xcbc628){logger[_0xe400('0x11')](_0xe400('0xe'),_0x4afc11,_0xcbc628);_0x244f85(_0xcbc628);});});}exports[_0xe400('0x16')]=function(_0x2e2b0a){var _0x4fa178=this;return new Promise(function(_0x30a259,_0x4eb0ef){return db[_0xe400('0x17')][_0xe400('0x18')]({'raw':_0x2e2b0a[_0xe400('0x19')]?_0x2e2b0a[_0xe400('0x19')][_0xe400('0x1a')]===undefined?!![]:![]:!![],'where':_0x2e2b0a[_0xe400('0x19')]?_0x2e2b0a[_0xe400('0x19')][_0xe400('0x1b')]||null:null,'attributes':_0x2e2b0a[_0xe400('0x19')]?_0x2e2b0a[_0xe400('0x19')][_0xe400('0x1c')]||null:null,'limit':_0x2e2b0a['options']?_0x2e2b0a[_0xe400('0x19')][_0xe400('0x1d')]||null:null,'include':_0x2e2b0a[_0xe400('0x19')]?_0x2e2b0a['options']['include']?_['map'](_0x2e2b0a[_0xe400('0x19')]['include'],function(_0x3c718d){return{'model':db[_0x3c718d[_0xe400('0x1e')]],'as':_0x3c718d['as'],'attributes':_0x3c718d['attributes'],'include':_0x3c718d[_0xe400('0x1f')]?_[_0xe400('0x20')](_0x3c718d[_0xe400('0x1f')],function(_0x2a7cde){return{'model':db[_0x2a7cde['model']],'as':_0x2a7cde['as'],'attributes':_0x2a7cde[_0xe400('0x1c')],'include':_0x2a7cde[_0xe400('0x1f')]?_[_0xe400('0x20')](_0x2a7cde[_0xe400('0x1f')],function(_0x2b1433){return{'model':db[_0x2b1433['model']],'as':_0x2b1433['as'],'attributes':_0x2b1433[_0xe400('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe400('0xc')](function(_0xfc8225){logger['info'](_0xe400('0x16'),_0x2e2b0a);logger[_0xe400('0x10')]('GetWhatsappQueue',_0x2e2b0a,JSON['stringify'](_0xfc8225));_0x30a259(_0xfc8225);})[_0xe400('0x15')](function(_0xbdf6f3){logger[_0xe400('0x11')](_0xe400('0x16'),_0xbdf6f3[_0xe400('0x13')],_0x2e2b0a);_0x4eb0ef(_0x4fa178[_0xe400('0x11')](0x1f4,_0xbdf6f3[_0xe400('0x13')]));});});};exports[_0xe400('0x21')]=function(_0x37d388){var _0x57fd2f=this;return new Promise(function(_0x74c5a9,_0x19bdba){return db['WhatsappQueue'][_0xe400('0x22')]({'raw':_0x37d388['options']?_0x37d388[_0xe400('0x19')][_0xe400('0x1a')]===undefined?!![]:![]:!![],'where':_0x37d388['options']?_0x37d388[_0xe400('0x19')][_0xe400('0x1b')]||null:null,'attributes':_0x37d388[_0xe400('0x19')]?_0x37d388[_0xe400('0x19')][_0xe400('0x1c')]||null:null,'include':_0x37d388['options']?_0x37d388[_0xe400('0x19')]['include']?_[_0xe400('0x20')](_0x37d388[_0xe400('0x19')][_0xe400('0x1f')],function(_0x31d990){return{'model':db[_0x31d990[_0xe400('0x1e')]],'as':_0x31d990['as'],'attributes':_0x31d990[_0xe400('0x1c')],'include':_0x31d990[_0xe400('0x1f')]?_[_0xe400('0x20')](_0x31d990['include'],function(_0x10a2f7){return{'model':db[_0x10a2f7[_0xe400('0x1e')]],'as':_0x10a2f7['as'],'attributes':_0x10a2f7['attributes'],'include':_0x10a2f7[_0xe400('0x1f')]?_[_0xe400('0x20')](_0x10a2f7[_0xe400('0x1f')],function(_0x547244){return{'model':db[_0x547244[_0xe400('0x1e')]],'as':_0x547244['as'],'attributes':_0x547244[_0xe400('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe400('0xc')](function(_0x4c3ec5){logger[_0xe400('0xd')](_0xe400('0x21'),_0x37d388);logger[_0xe400('0x10')](_0xe400('0x21'),_0x37d388,JSON[_0xe400('0x23')](_0x4c3ec5));_0x74c5a9(_0x4c3ec5);})['catch'](function(_0x18ab58){logger['error'](_0xe400('0x21'),_0x18ab58[_0xe400('0x13')],_0x37d388);_0x19bdba(_0x57fd2f[_0xe400('0x11')](0x1f4,_0x18ab58[_0xe400('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 09dc9b5..e8b59f6 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 _0x58c3=['./whatsappQueue.events','remove','update','emit','register','length','whatsappQueue:'];(function(_0x33cc5d,_0x2e92c2){var _0x50cc47=function(_0x43e261){while(--_0x43e261){_0x33cc5d['push'](_0x33cc5d['shift']());}};_0x50cc47(++_0x2e92c2);}(_0x58c3,0xd2));var _0x358c=function(_0x1c17e3,_0x5995b9){_0x1c17e3=_0x1c17e3-0x0;var _0x54a18b=_0x58c3[_0x1c17e3];return _0x54a18b;};'use strict';var WhatsappQueueEvents=require(_0x358c('0x0'));var events=['save',_0x358c('0x1'),_0x358c('0x2')];function createListener(_0x264339,_0x6fbb6d){return function(_0x777424){_0x6fbb6d[_0x358c('0x3')](_0x264339,_0x777424);};}function removeListener(_0x48bca6,_0x555af7){return function(){WhatsappQueueEvents['removeListener'](_0x48bca6,_0x555af7);};}exports[_0x358c('0x4')]=function(_0x15b860){for(var _0x10e346=0x0,_0x1c7d69=events[_0x358c('0x5')];_0x10e346<_0x1c7d69;_0x10e346++){var _0x349e40=events[_0x10e346];var _0x51a656=createListener(_0x358c('0x6')+_0x349e40,_0x15b860);WhatsappQueueEvents['on'](_0x349e40,_0x51a656);}}; \ No newline at end of file +var _0x942d=['length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3a144f,_0x598c90){var _0x5968eb=function(_0x59e182){while(--_0x59e182){_0x3a144f['push'](_0x3a144f['shift']());}};_0x5968eb(++_0x598c90);}(_0x942d,0x1b2));var _0xd942=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x942d[_0x36eaaa];return _0x461349;};'use strict';var WhatsappQueueEvents=require(_0xd942('0x0'));var events=[_0xd942('0x1'),_0xd942('0x2'),_0xd942('0x3')];function createListener(_0x35b658,_0x3c555a){return function(_0x51b10f){_0x3c555a[_0xd942('0x4')](_0x35b658,_0x51b10f);};}function removeListener(_0x38da00,_0x34709b){return function(){WhatsappQueueEvents[_0xd942('0x5')](_0x38da00,_0x34709b);};}exports[_0xd942('0x6')]=function(_0x596110){for(var _0x2c6863=0x0,_0x2eaa1b=events[_0xd942('0x7')];_0x2c6863<_0x2eaa1b;_0x2c6863++){var _0x154466=events[_0x2c6863];var _0x169c56=createListener(_0xd942('0x8')+_0x154466,_0x596110);WhatsappQueueEvents['on'](_0x154466,_0x169c56);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 4e7dae5..c435387 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 _0x8ea0=['multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x29cb9b,_0x247dd1){var _0x544ff3=function(_0x5919b2){while(--_0x5919b2){_0x29cb9b['push'](_0x29cb9b['shift']());}};_0x544ff3(++_0x247dd1);}(_0x8ea0,0x78));var _0x08ea=function(_0x5c3a24,_0x2fecb2){_0x5c3a24=_0x5c3a24-0x0;var _0x55112a=_0x8ea0[_0x5c3a24];return _0x55112a;};'use strict';var multer=require(_0x08ea('0x0'));var util=require(_0x08ea('0x1'));var path=require(_0x08ea('0x2'));var timeout=require(_0x08ea('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x08ea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08ea('0x5'));var config=require(_0x08ea('0x6'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x08ea('0x7')](),controller[_0x08ea('0x8')]);router['get'](_0x08ea('0x9'),auth[_0x08ea('0x7')](),controller[_0x08ea('0xa')]);router[_0x08ea('0xb')](_0x08ea('0xc'),auth[_0x08ea('0x7')](),controller[_0x08ea('0xd')]);router[_0x08ea('0xe')]('/',auth[_0x08ea('0x7')](),controller[_0x08ea('0xf')]);router[_0x08ea('0x10')](_0x08ea('0xc'),auth[_0x08ea('0x7')](),controller['update']);router[_0x08ea('0x11')](_0x08ea('0xc'),auth[_0x08ea('0x7')](),controller[_0x08ea('0x12')]);module[_0x08ea('0x13')]=router; \ No newline at end of file +var _0xd03f=['connect-timeout','express','../../components/interaction/service','./whatsappQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xd03f,0x1d8));var _0xfd03=function(_0x106895,_0xf6b6be){_0x106895=_0x106895-0x0;var _0x3ee675=_0xd03f[_0x106895];return _0x3ee675;};'use strict';var multer=require(_0xfd03('0x0'));var util=require(_0xfd03('0x1'));var path=require(_0xfd03('0x2'));var timeout=require(_0xfd03('0x3'));var express=require(_0xfd03('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd03('0x5'));var config=require('../../config/environment');var controller=require(_0xfd03('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xfd03('0x7')]);router[_0xfd03('0x8')](_0xfd03('0x9'),auth[_0xfd03('0xa')](),controller[_0xfd03('0xb')]);router['get'](_0xfd03('0xc'),auth[_0xfd03('0xa')](),controller[_0xfd03('0xd')]);router['post']('/',auth[_0xfd03('0xa')](),controller['create']);router[_0xfd03('0xe')](_0xfd03('0xc'),auth[_0xfd03('0xa')](),controller[_0xfd03('0xf')]);router[_0xfd03('0x10')]('/:id',auth[_0xfd03('0xa')](),controller[_0xfd03('0x11')]);module[_0xfd03('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d61fbac..b6316eb 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(_0xd6f0f3,_0x5bd224){var _0x30d544=function(_0x4c53c3){while(--_0x4c53c3){_0xd6f0f3['push'](_0xd6f0f3['shift']());}};_0x30d544(++_0x5bd224);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x28d134,_0x2b8ff2){var _0x29de84=function(_0x5ab863){while(--_0x5ab863){_0x28d134['push'](_0x28d134['shift']());}};_0x29de84(++_0x2b8ff2);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 c215e1d..5114d52 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 _0x9348=['save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','WhatsappQueueReport','count','include','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject'];(function(_0xab431f,_0x5e1258){var _0x33c5b7=function(_0x16c058){while(--_0x16c058){_0xab431f['push'](_0xab431f['shift']());}};_0x33c5b7(++_0x5e1258);}(_0x9348,0x10d));var _0x8934=function(_0x4fa779,_0x5b2253){_0x4fa779=_0x4fa779-0x0;var _0x3bf024=_0x9348[_0x4fa779];return _0x3bf024;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['WhatsappQueueReport'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['WhatsappQueueReport'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));};exports['describe']=function(_0xce93cd,_0x2778f9){return db[_0x8934('0x40')][_0x8934('0x4b')]()[_0x8934('0x25')](respondWithResult(_0x2778f9,null))[_0x8934('0x48')](handleError(_0x2778f9,null));}; \ No newline at end of file +var _0x236c=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','WhatsappQueueReport','fieldName','key','query','filters','intersection'];(function(_0x33c631,_0x397cfb){var _0x24203e=function(_0x324d92){while(--_0x324d92){_0x33c631['push'](_0x33c631['shift']());}};_0x24203e(++_0x397cfb);}(_0x236c,0x155));var _0xc236=function(_0x24ffbe,_0x2fe39a){_0x24ffbe=_0x24ffbe-0x0;var _0x398331=_0x236c[_0x24ffbe];return _0x398331;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){_0x21fab8[_0xc236('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308cd6,_0x21d78f){return function(_0x356042){if(!_0x356042){_0x308cd6[_0xc236('0x26')](0x194);}return _0x356042;};}function handleError(_0x561da1,_0x42f248){_0x42f248=_0x42f248||0x1f4;return function(_0x5da4b2){logger['error'](_0x5da4b2[_0xc236('0x27')]);if(_0x5da4b2['name']){delete _0x5da4b2[_0xc236('0x28')];}_0x561da1['status'](_0x42f248)[_0xc236('0x29')](_0x5da4b2);};}exports['index']=function(_0x423842,_0x1d144b){var _0x4f5175={},_0x5a61b5={},_0x265c8d={'count':0x0,'rows':[]};var _0x1fd31d=_[_0xc236('0x2a')](db[_0xc236('0x2b')]['rawAttributes'],function(_0x4e3262){return{'name':_0x4e3262[_0xc236('0x2c')],'type':_0x4e3262['type'][_0xc236('0x2d')]};});_0x5a61b5['model']=_[_0xc236('0x2a')](_0x1fd31d,_0xc236('0x28'));_0x5a61b5['query']=_['keys'](_0x423842[_0xc236('0x2e')]);_0x5a61b5[_0xc236('0x2f')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],_0x5a61b5[_0xc236('0x2e')]);_0x4f5175[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5a61b5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x423842['query']['fields']));_0x4f5175['attributes']=_0x4f5175[_0xc236('0x32')][_0xc236('0x34')]?_0x4f5175[_0xc236('0x32')]:_0x5a61b5[_0xc236('0x31')];if(!_0x423842[_0xc236('0x2e')][_0xc236('0x35')](_0xc236('0x36'))){_0x4f5175['limit']=qs[_0xc236('0x37')](_0x423842[_0xc236('0x2e')][_0xc236('0x37')]);_0x4f5175['offset']=qs[_0xc236('0x1a')](_0x423842[_0xc236('0x2e')][_0xc236('0x1a')]);}_0x4f5175[_0xc236('0x38')]=qs['sort'](_0x423842[_0xc236('0x2e')][_0xc236('0x39')]);_0x4f5175[_0xc236('0x3a')]=qs[_0xc236('0x2f')](_[_0xc236('0x3b')](_0x423842[_0xc236('0x2e')],_0x5a61b5[_0xc236('0x2f')]),_0x1fd31d);if(_0x423842[_0xc236('0x2e')][_0xc236('0x3c')]){_0x4f5175[_0xc236('0x3a')]=_[_0xc236('0x3d')](_0x4f5175[_0xc236('0x3a')],{'$or':_[_0xc236('0x2a')](_0x1fd31d,function(_0x237193){if(_0x237193[_0xc236('0x3e')]!==_0xc236('0x3f')){var _0x46db5a={};_0x46db5a[_0x237193['name']]={'$like':'%'+_0x423842['query']['filter']+'%'};return _0x46db5a;}})});}_0x4f5175=_['merge']({},_0x4f5175,_0x423842[_0xc236('0x40')]);var _0x5c4739={'where':_0x4f5175[_0xc236('0x3a')]};return db[_0xc236('0x2b')][_0xc236('0x1c')](_0x5c4739)[_0xc236('0x24')](function(_0xdf7897){_0x265c8d[_0xc236('0x1c')]=_0xdf7897;if(_0x423842[_0xc236('0x2e')][_0xc236('0x41')]){_0x4f5175[_0xc236('0x42')]=[{'all':!![]}];}return db[_0xc236('0x2b')][_0xc236('0x43')](_0x4f5175);})[_0xc236('0x24')](function(_0x3b2f2f){_0x265c8d[_0xc236('0x44')]=_0x3b2f2f;return _0x265c8d;})[_0xc236('0x24')](respondWithFilteredResult(_0x1d144b,_0x4f5175))['catch'](handleError(_0x1d144b,null));};exports[_0xc236('0x45')]=function(_0x24b851,_0x506ba0){var _0xb90a83={'raw':!![],'where':{'id':_0x24b851[_0xc236('0x46')]['id']}},_0x5b0bc5={};_0x5b0bc5['model']=_[_0xc236('0x47')](db[_0xc236('0x2b')][_0xc236('0x48')]);_0x5b0bc5['query']=_[_0xc236('0x47')](_0x24b851[_0xc236('0x2e')]);_0x5b0bc5[_0xc236('0x2f')]=_['intersection'](_0x5b0bc5[_0xc236('0x31')],_0x5b0bc5[_0xc236('0x2e')]);_0xb90a83[_0xc236('0x32')]=_[_0xc236('0x30')](_0x5b0bc5[_0xc236('0x31')],qs[_0xc236('0x33')](_0x24b851['query'][_0xc236('0x33')]));_0xb90a83['attributes']=_0xb90a83[_0xc236('0x32')][_0xc236('0x34')]?_0xb90a83[_0xc236('0x32')]:_0x5b0bc5[_0xc236('0x31')];if(_0x24b851[_0xc236('0x2e')][_0xc236('0x41')]){_0xb90a83[_0xc236('0x42')]=[{'all':!![]}];}_0xb90a83=_['merge']({},_0xb90a83,_0x24b851[_0xc236('0x40')]);return db['WhatsappQueueReport'][_0xc236('0x49')](_0xb90a83)[_0xc236('0x24')](handleEntityNotFound(_0x506ba0,null))['then'](respondWithResult(_0x506ba0,null))[_0xc236('0x4a')](handleError(_0x506ba0,null));};exports[_0xc236('0x4b')]=function(_0x3c1c5c,_0x161890){return db[_0xc236('0x2b')][_0xc236('0x4b')](_0x3c1c5c[_0xc236('0x4c')],{})['then'](respondWithResult(_0x161890,0xc9))['catch'](handleError(_0x161890,null));};exports[_0xc236('0x23')]=function(_0x2afed2,_0x510f7f){if(_0x2afed2[_0xc236('0x4c')]['id']){delete _0x2afed2[_0xc236('0x4c')]['id'];}return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x2afed2[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x510f7f,null))[_0xc236('0x24')](saveUpdates(_0x2afed2[_0xc236('0x4c')],null))[_0xc236('0x24')](respondWithResult(_0x510f7f,null))['catch'](handleError(_0x510f7f,null));};exports[_0xc236('0x25')]=function(_0x307663,_0x41b7d5){return db[_0xc236('0x2b')][_0xc236('0x49')]({'where':{'id':_0x307663[_0xc236('0x46')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x41b7d5,null))['then'](removeEntity(_0x41b7d5,null))[_0xc236('0x4a')](handleError(_0x41b7d5,null));};exports[_0xc236('0x4d')]=function(_0x17c86b,_0x16ff63){return db['WhatsappQueueReport'][_0xc236('0x4d')]()[_0xc236('0x24')](respondWithResult(_0x16ff63,null))[_0xc236('0x4a')](handleError(_0x16ff63,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c647c40..1d1e20d 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 _0xa859=['path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','util','moment','bluebird','request-promise'];(function(_0x555d05,_0xcd824d){var _0x1df2c6=function(_0x1670f5){while(--_0x1670f5){_0x555d05['push'](_0x555d05['shift']());}};_0x1df2c6(++_0xcd824d);}(_0xa859,0x1a8));var _0x9a85=function(_0x358c64,_0x4e4c9b){_0x358c64=_0x358c64-0x0;var _0x3512bb=_0xa859[_0x358c64];return _0x3512bb;};'use strict';var _=require(_0x9a85('0x0'));var util=require(_0x9a85('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9a85('0x2'));var BPromise=require(_0x9a85('0x3'));var rp=require(_0x9a85('0x4'));var fs=require('fs');var path=require(_0x9a85('0x5'));var rimraf=require(_0x9a85('0x6'));var config=require(_0x9a85('0x7'));var attributes=require(_0x9a85('0x8'));module[_0x9a85('0x9')]=function(_0x3686bb,_0x376068){return _0x3686bb[_0x9a85('0xa')](_0x9a85('0xb'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x9a85('0xc'),'fields':[_0x9a85('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcbf4=['../../config/logger','moment','bluebird','request-promise','path','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x2934ec,_0x19399b){var _0x2b193c=function(_0x12f817){while(--_0x12f817){_0x2934ec['push'](_0x2934ec['shift']());}};_0x2b193c(++_0x19399b);}(_0xcbf4,0xd6));var _0x4cbf=function(_0x3450ef,_0x2d0ad9){_0x3450ef=_0x3450ef-0x0;var _0xe0a63c=_0xcbf4[_0x3450ef];return _0xe0a63c;};'use strict';var _=require(_0x4cbf('0x0'));var util=require(_0x4cbf('0x1'));var logger=require(_0x4cbf('0x2'))('api');var moment=require(_0x4cbf('0x3'));var BPromise=require(_0x4cbf('0x4'));var rp=require(_0x4cbf('0x5'));var fs=require('fs');var path=require(_0x4cbf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4cbf('0x7'));module['exports']=function(_0x1754f6,_0x588c23){return _0x1754f6[_0x4cbf('0x8')](_0x4cbf('0x9'),attributes,{'tableName':_0x4cbf('0xa'),'paranoid':![],'indexes':[{'name':_0x4cbf('0xb'),'fields':[_0x4cbf('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 66863f2..82823f4 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 _0xd835=['CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','catch','update','where','attributes','limit','UpdateWhatsappQueueReport','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','WhatsappQueueReport,\x20%s,\x20%s'];(function(_0x12c141,_0x32b5e2){var _0x475ce4=function(_0x2f679f){while(--_0x2f679f){_0x12c141['push'](_0x12c141['shift']());}};_0x475ce4(++_0x32b5e2);}(_0xd835,0xfb));var _0x5d83=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0xd835[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x5d83('0x0'));var util=require(_0x5d83('0x1'));var moment=require('moment');var BPromise=require(_0x5d83('0x2'));var rs=require(_0x5d83('0x3'));var fs=require('fs');var Redis=require(_0x5d83('0x4'));var db=require(_0x5d83('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d83('0x6'))(_0x5d83('0x7'));var config=require(_0x5d83('0x8'));var jayson=require(_0x5d83('0x9'));var client=jayson[_0x5d83('0xa')][_0x5d83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da518,_0x17969c,_0x5de264){return new BPromise(function(_0x4baeb1,_0x5afe28){return client[_0x5d83('0xc')](_0x5da518,_0x5de264)[_0x5d83('0xd')](function(_0x1cc4d6){logger[_0x5d83('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x17969c,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x17969c,_0x5d83('0xf'),JSON[_0x5d83('0x10')](_0x1cc4d6));if(_0x1cc4d6[_0x5d83('0x11')]){if(_0x1cc4d6['error'][_0x5d83('0x12')]===0x1f4){logger[_0x5d83('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x17969c,_0x1cc4d6[_0x5d83('0x11')]['message']);return _0x5afe28(_0x1cc4d6[_0x5d83('0x11')][_0x5d83('0x13')]);}logger[_0x5d83('0x11')](_0x5d83('0x14'),_0x17969c,_0x1cc4d6[_0x5d83('0x11')][_0x5d83('0x13')]);return _0x4baeb1(_0x1cc4d6[_0x5d83('0x11')][_0x5d83('0x13')]);}else{logger['info'](_0x5d83('0x14'),_0x17969c,_0x5d83('0xf'));_0x4baeb1(_0x1cc4d6['result'][_0x5d83('0x13')]);}})['catch'](function(_0x5178b0){logger[_0x5d83('0x11')](_0x5d83('0x14'),_0x17969c,_0x5178b0);_0x5afe28(_0x5178b0);});});}exports[_0x5d83('0x15')]=function(_0x207fc0){var _0x53093e=this;return new Promise(function(_0x10ac63,_0x49a27a){return db[_0x5d83('0x16')][_0x5d83('0x17')](_0x207fc0[_0x5d83('0x18')],{'raw':_0x207fc0[_0x5d83('0x19')]?_0x207fc0[_0x5d83('0x19')][_0x5d83('0x1a')]===undefined?!![]:![]:!![]})[_0x5d83('0xd')](function(_0x57c98c){logger[_0x5d83('0xe')](_0x5d83('0x15'),_0x207fc0);logger['debug']('CreateWhatsappQueueReport',_0x207fc0,JSON['stringify'](_0x57c98c));_0x10ac63(_0x57c98c);})[_0x5d83('0x1b')](function(_0x41bf64){logger['error'](_0x5d83('0x15'),_0x41bf64[_0x5d83('0x13')],_0x207fc0);_0x49a27a(_0x53093e['error'](0x1f4,_0x41bf64[_0x5d83('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1963e3){var _0x4cb19e=this;return new Promise(function(_0x4dfa95,_0x255692){return db[_0x5d83('0x16')][_0x5d83('0x1c')](_0x1963e3[_0x5d83('0x18')],{'raw':_0x1963e3[_0x5d83('0x19')]?_0x1963e3[_0x5d83('0x19')][_0x5d83('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1963e3[_0x5d83('0x19')]?_0x1963e3[_0x5d83('0x19')][_0x5d83('0x1d')]||null:null,'attributes':_0x1963e3[_0x5d83('0x19')]?_0x1963e3[_0x5d83('0x19')][_0x5d83('0x1e')]||null:null,'limit':_0x1963e3['options']?_0x1963e3['options'][_0x5d83('0x1f')]||null:null})['then'](function(_0x26cf91){logger[_0x5d83('0xe')](_0x5d83('0x20'),_0x1963e3);logger[_0x5d83('0x21')](_0x5d83('0x20'),_0x1963e3,JSON['stringify'](_0x26cf91));_0x4dfa95(_0x26cf91);})[_0x5d83('0x1b')](function(_0x7d4d14){logger[_0x5d83('0x11')](_0x5d83('0x20'),_0x7d4d14[_0x5d83('0x13')],_0x1963e3);_0x255692(_0x4cb19e['error'](0x1f4,_0x7d4d14['message']));});});}; \ No newline at end of file +var _0x42dc=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0x42dc,0x115));var _0xc42d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x42dc[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xc42d('0x0'));var util=require(_0xc42d('0x1'));var moment=require(_0xc42d('0x2'));var BPromise=require(_0xc42d('0x3'));var rs=require(_0xc42d('0x4'));var fs=require('fs');var Redis=require(_0xc42d('0x5'));var db=require(_0xc42d('0x6'))['db'];var utils=require(_0xc42d('0x7'));var logger=require(_0xc42d('0x8'))(_0xc42d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc42d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31dad7,_0x11c0b9,_0x4b9441){return new BPromise(function(_0x7ba4dc,_0x44170d){return client['request'](_0x31dad7,_0x4b9441)['then'](function(_0x381f2b){logger[_0xc42d('0xb')](_0xc42d('0xc'),_0x11c0b9,_0xc42d('0xd'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x11c0b9,'request\x20sent',JSON[_0xc42d('0xe')](_0x381f2b));if(_0x381f2b[_0xc42d('0xf')]){if(_0x381f2b[_0xc42d('0xf')][_0xc42d('0x10')]===0x1f4){logger[_0xc42d('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x11c0b9,_0x381f2b[_0xc42d('0xf')][_0xc42d('0x11')]);return _0x44170d(_0x381f2b['error'][_0xc42d('0x11')]);}logger[_0xc42d('0xf')](_0xc42d('0xc'),_0x11c0b9,_0x381f2b['error']['message']);return _0x7ba4dc(_0x381f2b[_0xc42d('0xf')]['message']);}else{logger[_0xc42d('0xb')](_0xc42d('0xc'),_0x11c0b9,'request\x20sent');_0x7ba4dc(_0x381f2b[_0xc42d('0x12')][_0xc42d('0x11')]);}})[_0xc42d('0x13')](function(_0x168a75){logger['error'](_0xc42d('0xc'),_0x11c0b9,_0x168a75);_0x44170d(_0x168a75);});});}exports[_0xc42d('0x14')]=function(_0x1b24c5){var _0x556c42=this;return new Promise(function(_0xf885b8,_0x164a71){return db[_0xc42d('0x15')][_0xc42d('0x16')](_0x1b24c5[_0xc42d('0x17')],{'raw':_0x1b24c5[_0xc42d('0x18')]?_0x1b24c5[_0xc42d('0x18')][_0xc42d('0x19')]===undefined?!![]:![]:!![]})[_0xc42d('0x1a')](function(_0x225079){logger[_0xc42d('0xb')](_0xc42d('0x14'),_0x1b24c5);logger['debug'](_0xc42d('0x14'),_0x1b24c5,JSON[_0xc42d('0xe')](_0x225079));_0xf885b8(_0x225079);})['catch'](function(_0x570479){logger[_0xc42d('0xf')](_0xc42d('0x14'),_0x570479['message'],_0x1b24c5);_0x164a71(_0x556c42[_0xc42d('0xf')](0x1f4,_0x570479['message']));});});};exports[_0xc42d('0x1b')]=function(_0x1570ea){var _0xce420a=this;return new Promise(function(_0x34128f,_0x386180){return db[_0xc42d('0x15')][_0xc42d('0x1c')](_0x1570ea[_0xc42d('0x17')],{'raw':_0x1570ea[_0xc42d('0x18')]?_0x1570ea['options'][_0xc42d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1570ea[_0xc42d('0x18')]?_0x1570ea[_0xc42d('0x18')][_0xc42d('0x1d')]||null:null,'attributes':_0x1570ea['options']?_0x1570ea['options'][_0xc42d('0x1e')]||null:null,'limit':_0x1570ea[_0xc42d('0x18')]?_0x1570ea[_0xc42d('0x18')][_0xc42d('0x1f')]||null:null})[_0xc42d('0x1a')](function(_0x53c84f){logger[_0xc42d('0xb')](_0xc42d('0x1b'),_0x1570ea);logger['debug'](_0xc42d('0x1b'),_0x1570ea,JSON[_0xc42d('0xe')](_0x53c84f));_0x34128f(_0x53c84f);})[_0xc42d('0x13')](function(_0x35d4){logger[_0xc42d('0xf')](_0xc42d('0x1b'),_0x35d4[_0xc42d('0x11')],_0x1570ea);_0x386180(_0xce420a[_0xc42d('0xf')](0x1f4,_0x35d4['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index b591dd3..12babe3 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 _0x7fc7=['../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7fc7,0xb6));var _0x77fc=function(_0x66a026,_0x58c19c){_0x66a026=_0x66a026-0x0;var _0x2c5e8d=_0x7fc7[_0x66a026];return _0x2c5e8d;};'use strict';var multer=require(_0x77fc('0x0'));var util=require('util');var path=require(_0x77fc('0x1'));var timeout=require(_0x77fc('0x2'));var express=require('express');var router=express[_0x77fc('0x3')]();var fs_extra=require(_0x77fc('0x4'));var auth=require(_0x77fc('0x5'));var interaction=require(_0x77fc('0x6'));var config=require(_0x77fc('0x7'));var controller=require(_0x77fc('0x8'));router[_0x77fc('0x9')]('/',auth[_0x77fc('0xa')](),controller[_0x77fc('0xb')]);router[_0x77fc('0x9')](_0x77fc('0xc'),auth['isAuthenticated'](),controller[_0x77fc('0xd')]);router[_0x77fc('0x9')](_0x77fc('0xe'),auth[_0x77fc('0xa')](),controller['show']);router[_0x77fc('0xf')]('/',auth[_0x77fc('0xa')](),controller[_0x77fc('0x10')]);router[_0x77fc('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x77fc('0x12')](_0x77fc('0xe'),auth[_0x77fc('0xa')](),controller[_0x77fc('0x13')]);module[_0x77fc('0x14')]=router; \ No newline at end of file +var _0xa8f7=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0xa8f7,0x177));var _0x7a8f=function(_0x204e93,_0x2ae432){_0x204e93=_0x204e93-0x0;var _0x15f3a3=_0xa8f7[_0x204e93];return _0x15f3a3;};'use strict';var multer=require('multer');var util=require(_0x7a8f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a8f('0x1'));var router=express[_0x7a8f('0x2')]();var fs_extra=require(_0x7a8f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7a8f('0x4'));var config=require(_0x7a8f('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0x7a8f('0x6')]('/',auth[_0x7a8f('0x7')](),controller[_0x7a8f('0x8')]);router[_0x7a8f('0x6')](_0x7a8f('0x9'),auth[_0x7a8f('0x7')](),controller[_0x7a8f('0xa')]);router[_0x7a8f('0x6')](_0x7a8f('0xb'),auth[_0x7a8f('0x7')](),controller[_0x7a8f('0xc')]);router[_0x7a8f('0xd')]('/',auth[_0x7a8f('0x7')](),controller[_0x7a8f('0xe')]);router[_0x7a8f('0xf')](_0x7a8f('0xb'),auth['isAuthenticated'](),controller[_0x7a8f('0x10')]);router['delete'](_0x7a8f('0xb'),auth['isAuthenticated'](),controller[_0x7a8f('0x11')]);module[_0x7a8f('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4066812..d70a930 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 _0x2032=['agent','queue','exports','STRING','ENUM'];(function(_0x394e1a,_0x9b904e){var _0x2f21c4=function(_0x2f148c){while(--_0x2f148c){_0x394e1a['push'](_0x394e1a['shift']());}};_0x2f21c4(++_0x9b904e);}(_0x2032,0xd9));var _0x2203=function(_0x13f2e1,_0x5b92d4){_0x13f2e1=_0x13f2e1-0x0;var _0x1d809f=_0x2032[_0x13f2e1];return _0x1d809f;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'uniqueid':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2203('0x2')]('account',_0x2203('0x3'),_0x2203('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xb4e2=['sequelize','ENUM','DATE'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x522fd0,_0x5f55da){_0x522fd0=_0x522fd0-0x0;var _0x531c14=_0xb4e2[_0x522fd0];return _0x531c14;};'use strict';var Sequelize=require(_0x2b4e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2b4e('0x1')]('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2b4e('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 04974b8..3617f48 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 _0x6c90=['index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','reject','save','then','stack','name','send'];(function(_0x4fb216,_0x3113a2){var _0x4c43a9=function(_0x19a0a2){while(--_0x19a0a2){_0x4fb216['push'](_0x4fb216['shift']());}};_0x4c43a9(++_0x3113a2);}(_0x6c90,0x1de));var _0x06c9=function(_0x39287a,_0x4d1e0f){_0x39287a=_0x39287a-0x0;var _0xb00df7=_0x6c90[_0x39287a];return _0xb00df7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06c9('0x0'));var zipdir=require(_0x06c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06c9('0x2'));var moment=require(_0x06c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x06c9('0x4'));var util=require(_0x06c9('0x5'));var path=require(_0x06c9('0x6'));var sox=require(_0x06c9('0x7'));var csv=require(_0x06c9('0x8'));var ejs=require(_0x06c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06c9('0xa'));var squel=require(_0x06c9('0xb'));var crypto=require('crypto');var jsforce=require(_0x06c9('0xc'));var deskjs=require(_0x06c9('0xd'));var toCsv=require(_0x06c9('0x8'));var querystring=require(_0x06c9('0xe'));var Papa=require(_0x06c9('0xf'));var Redis=require(_0x06c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x06c9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06c9('0x12'));var logger=require(_0x06c9('0x13'))(_0x06c9('0x14'));var utils=require(_0x06c9('0x15'));var config=require(_0x06c9('0x16'));var licenseUtil=require(_0x06c9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x402913,_0xaa87dc){_0xaa87dc=_0xaa87dc||0xcc;return function(_0x51be73){if(_0x51be73){return _0x402913[_0x06c9('0x18')](_0xaa87dc);}return _0x402913['status'](_0xaa87dc)[_0x06c9('0x19')]();};}function respondWithResult(_0x4886c1,_0x2fc63d){_0x2fc63d=_0x2fc63d||0xc8;return function(_0x5e30d7){if(_0x5e30d7){return _0x4886c1['status'](_0x2fc63d)['json'](_0x5e30d7);}};}function respondWithFilteredResult(_0x43ad74,_0x597457){return function(_0x1b4ab5){if(_0x1b4ab5){var _0x5d92b5=typeof _0x597457[_0x06c9('0x1a')]===_0x06c9('0x1b')&&typeof _0x597457[_0x06c9('0x1c')]===_0x06c9('0x1b');var _0x7a6cd5=_0x1b4ab5[_0x06c9('0x1d')];var _0x1e875a=_0x5d92b5?0x0:_0x597457[_0x06c9('0x1a')];var _0x5dc4b1=_0x5d92b5?_0x1b4ab5[_0x06c9('0x1d')]:_0x597457[_0x06c9('0x1a')]+_0x597457[_0x06c9('0x1c')];var _0x1a4777;if(_0x5dc4b1>=_0x7a6cd5){_0x5dc4b1=_0x7a6cd5;_0x1a4777=0xc8;}else{_0x1a4777=0xce;}_0x43ad74[_0x06c9('0x1e')](_0x1a4777);return _0x43ad74[_0x06c9('0x1f')](_0x06c9('0x20'),_0x1e875a+'-'+_0x5dc4b1+'/'+_0x7a6cd5)[_0x06c9('0x21')](_0x1b4ab5);}return null;};}function patchUpdates(_0x2661fe){return function(_0x14084c){try{jsonpatch['apply'](_0x14084c,_0x2661fe,!![]);}catch(_0x320d26){return BPromise[_0x06c9('0x22')](_0x320d26);}return _0x14084c[_0x06c9('0x23')]();};}function saveUpdates(_0x2f83dd,_0x106aea){return function(_0x39b653){if(_0x39b653){return _0x39b653['update'](_0x2f83dd)[_0x06c9('0x24')](function(_0x3edcec){return _0x3edcec;});}return null;};}function removeEntity(_0x166ded,_0x13a0d3){return function(_0x4ad0c1){if(_0x4ad0c1){return _0x4ad0c1['destroy']()[_0x06c9('0x24')](function(){_0x166ded['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aeb4a,_0x42b73e){return function(_0xdd85d2){if(!_0xdd85d2){_0x5aeb4a['sendStatus'](0x194);}return _0xdd85d2;};}function handleError(_0x5d6792,_0x3efa50){_0x3efa50=_0x3efa50||0x1f4;return function(_0x4d5279){logger['error'](_0x4d5279[_0x06c9('0x25')]);if(_0x4d5279['name']){delete _0x4d5279[_0x06c9('0x26')];}_0x5d6792['status'](_0x3efa50)[_0x06c9('0x27')](_0x4d5279);};}exports[_0x06c9('0x28')]=function(_0x210a6b,_0x20bfe5){var _0x375330={},_0x22aabc={},_0x827da6={'count':0x0,'rows':[]};var _0x203f87=_[_0x06c9('0x29')](db[_0x06c9('0x2a')][_0x06c9('0x2b')],function(_0x4de1a8){return{'name':_0x4de1a8[_0x06c9('0x2c')],'type':_0x4de1a8[_0x06c9('0x2d')][_0x06c9('0x2e')]};});_0x22aabc[_0x06c9('0x2f')]=_[_0x06c9('0x29')](_0x203f87,'name');_0x22aabc[_0x06c9('0x30')]=_['keys'](_0x210a6b[_0x06c9('0x30')]);_0x22aabc[_0x06c9('0x31')]=_[_0x06c9('0x32')](_0x22aabc[_0x06c9('0x2f')],_0x22aabc[_0x06c9('0x30')]);_0x375330[_0x06c9('0x33')]=_[_0x06c9('0x32')](_0x22aabc['model'],qs['fields'](_0x210a6b['query'][_0x06c9('0x34')]));_0x375330[_0x06c9('0x33')]=_0x375330['attributes'][_0x06c9('0x35')]?_0x375330[_0x06c9('0x33')]:_0x22aabc[_0x06c9('0x2f')];if(!_0x210a6b[_0x06c9('0x30')]['hasOwnProperty']('nolimit')){_0x375330[_0x06c9('0x1c')]=qs['limit'](_0x210a6b[_0x06c9('0x30')]['limit']);_0x375330[_0x06c9('0x1a')]=qs['offset'](_0x210a6b['query'][_0x06c9('0x1a')]);}_0x375330[_0x06c9('0x36')]=qs[_0x06c9('0x37')](_0x210a6b['query'][_0x06c9('0x37')]);_0x375330[_0x06c9('0x38')]=qs[_0x06c9('0x31')](_[_0x06c9('0x39')](_0x210a6b[_0x06c9('0x30')],_0x22aabc[_0x06c9('0x31')]),_0x203f87);if(_0x210a6b[_0x06c9('0x30')][_0x06c9('0x3a')]){_0x375330['where']=_['merge'](_0x375330[_0x06c9('0x38')],{'$or':_[_0x06c9('0x29')](_0x203f87,function(_0x59254a){if(_0x59254a[_0x06c9('0x2d')]!==_0x06c9('0x3b')){var _0x3dc4fb={};_0x3dc4fb[_0x59254a[_0x06c9('0x26')]]={'$like':'%'+_0x210a6b[_0x06c9('0x30')]['filter']+'%'};return _0x3dc4fb;}})});}_0x375330=_[_0x06c9('0x3c')]({},_0x375330,_0x210a6b[_0x06c9('0x3d')]);var _0x301816={'where':_0x375330[_0x06c9('0x38')]};return db['WhatsappTransferReport'][_0x06c9('0x1d')](_0x301816)[_0x06c9('0x24')](function(_0x21667e){_0x827da6[_0x06c9('0x1d')]=_0x21667e;if(_0x210a6b[_0x06c9('0x30')][_0x06c9('0x3e')]){_0x375330[_0x06c9('0x3f')]=[{'all':!![]}];}return db[_0x06c9('0x2a')][_0x06c9('0x40')](_0x375330);})['then'](function(_0x4c99ed){_0x827da6['rows']=_0x4c99ed;return _0x827da6;})[_0x06c9('0x24')](respondWithFilteredResult(_0x20bfe5,_0x375330))[_0x06c9('0x41')](handleError(_0x20bfe5,null));};exports[_0x06c9('0x42')]=function(_0x7aaf39,_0x105c8e){var _0x55702a={'raw':!![],'where':{'id':_0x7aaf39[_0x06c9('0x43')]['id']}},_0x401ac6={};_0x401ac6[_0x06c9('0x2f')]=_[_0x06c9('0x44')](db[_0x06c9('0x2a')][_0x06c9('0x2b')]);_0x401ac6[_0x06c9('0x30')]=_['keys'](_0x7aaf39[_0x06c9('0x30')]);_0x401ac6[_0x06c9('0x31')]=_[_0x06c9('0x32')](_0x401ac6['model'],_0x401ac6[_0x06c9('0x30')]);_0x55702a['attributes']=_[_0x06c9('0x32')](_0x401ac6[_0x06c9('0x2f')],qs['fields'](_0x7aaf39['query'][_0x06c9('0x34')]));_0x55702a['attributes']=_0x55702a[_0x06c9('0x33')][_0x06c9('0x35')]?_0x55702a[_0x06c9('0x33')]:_0x401ac6['model'];if(_0x7aaf39[_0x06c9('0x30')][_0x06c9('0x3e')]){_0x55702a[_0x06c9('0x3f')]=[{'all':!![]}];}_0x55702a=_['merge']({},_0x55702a,_0x7aaf39[_0x06c9('0x3d')]);return db[_0x06c9('0x2a')][_0x06c9('0x45')](_0x55702a)[_0x06c9('0x24')](handleEntityNotFound(_0x105c8e,null))[_0x06c9('0x24')](respondWithResult(_0x105c8e,null))[_0x06c9('0x41')](handleError(_0x105c8e,null));};exports[_0x06c9('0x46')]=function(_0x5a30ba,_0x296849){return db[_0x06c9('0x2a')][_0x06c9('0x46')](_0x5a30ba[_0x06c9('0x47')],{})[_0x06c9('0x24')](respondWithResult(_0x296849,0xc9))[_0x06c9('0x41')](handleError(_0x296849,null));};exports[_0x06c9('0x48')]=function(_0x370826,_0x242e9c){if(_0x370826[_0x06c9('0x47')]['id']){delete _0x370826[_0x06c9('0x47')]['id'];}return db[_0x06c9('0x2a')][_0x06c9('0x45')]({'where':{'id':_0x370826[_0x06c9('0x43')]['id']}})[_0x06c9('0x24')](handleEntityNotFound(_0x242e9c,null))[_0x06c9('0x24')](saveUpdates(_0x370826[_0x06c9('0x47')],null))['then'](respondWithResult(_0x242e9c,null))[_0x06c9('0x41')](handleError(_0x242e9c,null));};exports['destroy']=function(_0x1fcf27,_0x458751){return db['WhatsappTransferReport'][_0x06c9('0x45')]({'where':{'id':_0x1fcf27[_0x06c9('0x43')]['id']}})['then'](handleEntityNotFound(_0x458751,null))['then'](removeEntity(_0x458751,null))[_0x06c9('0x41')](handleError(_0x458751,null));};exports[_0x06c9('0x49')]=function(_0x323e79,_0x312e9f){return db[_0x06c9('0x2a')][_0x06c9('0x49')]()['then'](respondWithResult(_0x312e9f,null))[_0x06c9('0x41')](handleError(_0x312e9f,null));}; \ No newline at end of file +var _0x4639=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappTransferReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4639,0x115));var _0x9463=function(_0xc864d,_0x3443f2){_0xc864d=_0xc864d-0x0;var _0x4a1305=_0x4639[_0xc864d];return _0x4a1305;};'use strict';var emlformat=require(_0x9463('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9463('0x1'));var rp=require(_0x9463('0x2'));var moment=require(_0x9463('0x3'));var BPromise=require(_0x9463('0x4'));var Mustache=require(_0x9463('0x5'));var util=require(_0x9463('0x6'));var path=require(_0x9463('0x7'));var sox=require('sox');var csv=require(_0x9463('0x8'));var ejs=require(_0x9463('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9463('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9463('0xb'));var toCsv=require(_0x9463('0x8'));var querystring=require(_0x9463('0xc'));var Papa=require('papaparse');var Redis=require(_0x9463('0xd'));var authService=require(_0x9463('0xe'));var qs=require(_0x9463('0xf'));var as=require(_0x9463('0x10'));var hardwareService=require(_0x9463('0x11'));var logger=require(_0x9463('0x12'))(_0x9463('0x13'));var utils=require(_0x9463('0x14'));var config=require(_0x9463('0x15'));var licenseUtil=require(_0x9463('0x16'));var db=require(_0x9463('0x17'))['db'];function respondWithStatusCode(_0x3b9c65,_0x180cfd){_0x180cfd=_0x180cfd||0xcc;return function(_0x3bb684){if(_0x3bb684){return _0x3b9c65[_0x9463('0x18')](_0x180cfd);}return _0x3b9c65[_0x9463('0x19')](_0x180cfd)[_0x9463('0x1a')]();};}function respondWithResult(_0x24b1ec,_0x14a5e5){_0x14a5e5=_0x14a5e5||0xc8;return function(_0x4a0cd4){if(_0x4a0cd4){return _0x24b1ec[_0x9463('0x19')](_0x14a5e5)['json'](_0x4a0cd4);}};}function respondWithFilteredResult(_0x19259c,_0x281237){return function(_0x1915e5){if(_0x1915e5){var _0x2054a3=typeof _0x281237[_0x9463('0x1b')]==='undefined'&&typeof _0x281237[_0x9463('0x1c')]===_0x9463('0x1d');var _0x98f2bc=_0x1915e5['count'];var _0x549167=_0x2054a3?0x0:_0x281237[_0x9463('0x1b')];var _0x422064=_0x2054a3?_0x1915e5[_0x9463('0x1e')]:_0x281237[_0x9463('0x1b')]+_0x281237[_0x9463('0x1c')];var _0x3a6ac2;if(_0x422064>=_0x98f2bc){_0x422064=_0x98f2bc;_0x3a6ac2=0xc8;}else{_0x3a6ac2=0xce;}_0x19259c[_0x9463('0x19')](_0x3a6ac2);return _0x19259c[_0x9463('0x1f')](_0x9463('0x20'),_0x549167+'-'+_0x422064+'/'+_0x98f2bc)[_0x9463('0x21')](_0x1915e5);}return null;};}function patchUpdates(_0x3d26e4){return function(_0x58d79c){try{jsonpatch[_0x9463('0x22')](_0x58d79c,_0x3d26e4,!![]);}catch(_0x15e1fd){return BPromise[_0x9463('0x23')](_0x15e1fd);}return _0x58d79c[_0x9463('0x24')]();};}function saveUpdates(_0x545c48,_0x24f85a){return function(_0x44e03d){if(_0x44e03d){return _0x44e03d[_0x9463('0x25')](_0x545c48)[_0x9463('0x26')](function(_0x6f0db1){return _0x6f0db1;});}return null;};}function removeEntity(_0x2d7cec,_0x214f7e){return function(_0x3c2a5b){if(_0x3c2a5b){return _0x3c2a5b[_0x9463('0x27')]()[_0x9463('0x26')](function(){_0x2d7cec[_0x9463('0x19')](0xcc)[_0x9463('0x1a')]();});}};}function handleEntityNotFound(_0x447b1a,_0xff7501){return function(_0x62286d){if(!_0x62286d){_0x447b1a[_0x9463('0x18')](0x194);}return _0x62286d;};}function handleError(_0x41716a,_0x12e967){_0x12e967=_0x12e967||0x1f4;return function(_0x505207){logger[_0x9463('0x28')](_0x505207[_0x9463('0x29')]);if(_0x505207[_0x9463('0x2a')]){delete _0x505207[_0x9463('0x2a')];}_0x41716a[_0x9463('0x19')](_0x12e967)['send'](_0x505207);};}exports[_0x9463('0x2b')]=function(_0x508128,_0x22d768){var _0x18723a={},_0x1777f7={},_0xb39a03={'count':0x0,'rows':[]};var _0x196c0b=_[_0x9463('0x2c')](db[_0x9463('0x2d')]['rawAttributes'],function(_0x4effe2){return{'name':_0x4effe2[_0x9463('0x2e')],'type':_0x4effe2[_0x9463('0x2f')][_0x9463('0x30')]};});_0x1777f7['model']=_[_0x9463('0x2c')](_0x196c0b,_0x9463('0x2a'));_0x1777f7[_0x9463('0x31')]=_[_0x9463('0x32')](_0x508128[_0x9463('0x31')]);_0x1777f7[_0x9463('0x33')]=_[_0x9463('0x34')](_0x1777f7[_0x9463('0x35')],_0x1777f7[_0x9463('0x31')]);_0x18723a[_0x9463('0x36')]=_[_0x9463('0x34')](_0x1777f7[_0x9463('0x35')],qs[_0x9463('0x37')](_0x508128[_0x9463('0x31')][_0x9463('0x37')]));_0x18723a[_0x9463('0x36')]=_0x18723a[_0x9463('0x36')][_0x9463('0x38')]?_0x18723a[_0x9463('0x36')]:_0x1777f7[_0x9463('0x35')];if(!_0x508128[_0x9463('0x31')]['hasOwnProperty']('nolimit')){_0x18723a['limit']=qs[_0x9463('0x1c')](_0x508128[_0x9463('0x31')][_0x9463('0x1c')]);_0x18723a[_0x9463('0x1b')]=qs[_0x9463('0x1b')](_0x508128[_0x9463('0x31')][_0x9463('0x1b')]);}_0x18723a[_0x9463('0x39')]=qs[_0x9463('0x3a')](_0x508128[_0x9463('0x31')][_0x9463('0x3a')]);_0x18723a[_0x9463('0x3b')]=qs[_0x9463('0x33')](_['pick'](_0x508128[_0x9463('0x31')],_0x1777f7['filters']),_0x196c0b);if(_0x508128[_0x9463('0x31')]['filter']){_0x18723a[_0x9463('0x3b')]=_[_0x9463('0x3c')](_0x18723a[_0x9463('0x3b')],{'$or':_[_0x9463('0x2c')](_0x196c0b,function(_0x29a3d7){if(_0x29a3d7[_0x9463('0x2f')]!=='VIRTUAL'){var _0xec3803={};_0xec3803[_0x29a3d7[_0x9463('0x2a')]]={'$like':'%'+_0x508128[_0x9463('0x31')][_0x9463('0x3d')]+'%'};return _0xec3803;}})});}_0x18723a=_[_0x9463('0x3c')]({},_0x18723a,_0x508128[_0x9463('0x3e')]);var _0x3698f8={'where':_0x18723a[_0x9463('0x3b')]};return db[_0x9463('0x2d')][_0x9463('0x1e')](_0x3698f8)[_0x9463('0x26')](function(_0x36c792){_0xb39a03[_0x9463('0x1e')]=_0x36c792;if(_0x508128[_0x9463('0x31')][_0x9463('0x3f')]){_0x18723a[_0x9463('0x40')]=[{'all':!![]}];}return db[_0x9463('0x2d')][_0x9463('0x41')](_0x18723a);})['then'](function(_0x4c391b){_0xb39a03[_0x9463('0x42')]=_0x4c391b;return _0xb39a03;})[_0x9463('0x26')](respondWithFilteredResult(_0x22d768,_0x18723a))[_0x9463('0x43')](handleError(_0x22d768,null));};exports[_0x9463('0x44')]=function(_0x557db7,_0x10a307){var _0x529283={'raw':!![],'where':{'id':_0x557db7['params']['id']}},_0x196621={};_0x196621[_0x9463('0x35')]=_[_0x9463('0x32')](db['WhatsappTransferReport'][_0x9463('0x45')]);_0x196621[_0x9463('0x31')]=_['keys'](_0x557db7[_0x9463('0x31')]);_0x196621[_0x9463('0x33')]=_[_0x9463('0x34')](_0x196621[_0x9463('0x35')],_0x196621[_0x9463('0x31')]);_0x529283[_0x9463('0x36')]=_[_0x9463('0x34')](_0x196621[_0x9463('0x35')],qs[_0x9463('0x37')](_0x557db7[_0x9463('0x31')][_0x9463('0x37')]));_0x529283[_0x9463('0x36')]=_0x529283[_0x9463('0x36')]['length']?_0x529283[_0x9463('0x36')]:_0x196621['model'];if(_0x557db7[_0x9463('0x31')][_0x9463('0x3f')]){_0x529283['include']=[{'all':!![]}];}_0x529283=_['merge']({},_0x529283,_0x557db7['options']);return db[_0x9463('0x2d')]['find'](_0x529283)['then'](handleEntityNotFound(_0x10a307,null))[_0x9463('0x26')](respondWithResult(_0x10a307,null))[_0x9463('0x43')](handleError(_0x10a307,null));};exports[_0x9463('0x46')]=function(_0x1fa268,_0x491eb7){return db['WhatsappTransferReport'][_0x9463('0x46')](_0x1fa268[_0x9463('0x47')],{})[_0x9463('0x26')](respondWithResult(_0x491eb7,0xc9))[_0x9463('0x43')](handleError(_0x491eb7,null));};exports[_0x9463('0x25')]=function(_0x2b6277,_0xf6a53e){if(_0x2b6277[_0x9463('0x47')]['id']){delete _0x2b6277[_0x9463('0x47')]['id'];}return db[_0x9463('0x2d')]['find']({'where':{'id':_0x2b6277[_0x9463('0x48')]['id']}})[_0x9463('0x26')](handleEntityNotFound(_0xf6a53e,null))['then'](saveUpdates(_0x2b6277[_0x9463('0x47')],null))[_0x9463('0x26')](respondWithResult(_0xf6a53e,null))[_0x9463('0x43')](handleError(_0xf6a53e,null));};exports['destroy']=function(_0x11becf,_0xaf1dca){return db[_0x9463('0x2d')]['find']({'where':{'id':_0x11becf[_0x9463('0x48')]['id']}})[_0x9463('0x26')](handleEntityNotFound(_0xaf1dca,null))[_0x9463('0x26')](removeEntity(_0xaf1dca,null))[_0x9463('0x43')](handleError(_0xaf1dca,null));};exports['describe']=function(_0x3e7ef9,_0x1f84f3){return db[_0x9463('0x2d')][_0x9463('0x49')]()[_0x9463('0x26')](respondWithResult(_0x1f84f3,null))['catch'](handleError(_0x1f84f3,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ef6fdbe..3b2f5db 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 _0x0de2=['./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13c395,_0x175922){var _0x447d5c=function(_0x13e396){while(--_0x13e396){_0x13c395['push'](_0x13c395['shift']());}};_0x447d5c(++_0x175922);}(_0x0de2,0xee));var _0x20de=function(_0x4c6dd5,_0x3e2003){_0x4c6dd5=_0x4c6dd5-0x0;var _0x17d4d5=_0x0de2[_0x4c6dd5];return _0x17d4d5;};'use strict';var _=require(_0x20de('0x0'));var util=require(_0x20de('0x1'));var logger=require(_0x20de('0x2'))(_0x20de('0x3'));var moment=require(_0x20de('0x4'));var BPromise=require(_0x20de('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20de('0x6'));var rimraf=require(_0x20de('0x7'));var config=require(_0x20de('0x8'));var attributes=require(_0x20de('0x9'));module[_0x20de('0xa')]=function(_0x325be8,_0x2357dd){return _0x325be8[_0x20de('0xb')]('WhatsappTransferReport',attributes,{'tableName':_0x20de('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2e0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x166a5f,_0x29c141){var _0x3a4c78=function(_0x98fb2c){while(--_0x98fb2c){_0x166a5f['push'](_0x166a5f['shift']());}};_0x3a4c78(++_0x29c141);}(_0xd2e0,0x148));var _0x0d2e=function(_0x17c0ee,_0x3846b1){_0x17c0ee=_0x17c0ee-0x0;var _0x1c91ee=_0xd2e0[_0x17c0ee];return _0x1c91ee;};'use strict';var _=require(_0x0d2e('0x0'));var util=require(_0x0d2e('0x1'));var logger=require(_0x0d2e('0x2'))(_0x0d2e('0x3'));var moment=require('moment');var BPromise=require(_0x0d2e('0x4'));var rp=require(_0x0d2e('0x5'));var fs=require('fs');var path=require(_0x0d2e('0x6'));var rimraf=require(_0x0d2e('0x7'));var config=require(_0x0d2e('0x8'));var attributes=require(_0x0d2e('0x9'));module[_0x0d2e('0xa')]=function(_0x3776e4,_0x3ce98d){return _0x3776e4[_0x0d2e('0xb')](_0x0d2e('0xc'),attributes,{'tableName':_0x0d2e('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0d2e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 99d5d40..547e35d 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 _0x9715=['result','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x28eff8,_0x2c6caa){var _0x564f95=function(_0x1251bd){while(--_0x1251bd){_0x28eff8['push'](_0x28eff8['shift']());}};_0x564f95(++_0x2c6caa);}(_0x9715,0x1b9));var _0x5971=function(_0x37655c,_0x1422ed){_0x37655c=_0x37655c-0x0;var _0x817126=_0x9715[_0x37655c];return _0x817126;};'use strict';var _=require(_0x5971('0x0'));var util=require(_0x5971('0x1'));var moment=require(_0x5971('0x2'));var BPromise=require('bluebird');var rs=require(_0x5971('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5971('0x4'));var logger=require(_0x5971('0x5'))(_0x5971('0x6'));var config=require(_0x5971('0x7'));var jayson=require(_0x5971('0x8'));var client=jayson[_0x5971('0x9')][_0x5971('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ec89,_0x255ce6,_0x5495e9){return new BPromise(function(_0x56963b,_0x495160){return client[_0x5971('0xb')](_0x2ec89,_0x5495e9)['then'](function(_0x4dcf42){logger[_0x5971('0xc')](_0x5971('0xd'),_0x255ce6,'request\x20sent');logger[_0x5971('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x255ce6,_0x5971('0xf'),JSON['stringify'](_0x4dcf42));if(_0x4dcf42['error']){if(_0x4dcf42[_0x5971('0x10')][_0x5971('0x11')]===0x1f4){logger[_0x5971('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x255ce6,_0x4dcf42[_0x5971('0x10')][_0x5971('0x12')]);return _0x495160(_0x4dcf42[_0x5971('0x10')][_0x5971('0x12')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x255ce6,_0x4dcf42['error'][_0x5971('0x12')]);return _0x56963b(_0x4dcf42[_0x5971('0x10')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x255ce6,_0x5971('0xf'));_0x56963b(_0x4dcf42[_0x5971('0x13')]['message']);}})['catch'](function(_0x5114bc){logger['error'](_0x5971('0xd'),_0x255ce6,_0x5114bc);_0x495160(_0x5114bc);});});} \ No newline at end of file +var _0x121e=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x12293a,_0x3e11d8){var _0x1500f3=function(_0x108fbd){while(--_0x108fbd){_0x12293a['push'](_0x12293a['shift']());}};_0x1500f3(++_0x3e11d8);}(_0x121e,0x1a5));var _0xe121=function(_0x180f6f,_0x156718){_0x180f6f=_0x180f6f-0x0;var _0x3aa3f2=_0x121e[_0x180f6f];return _0x3aa3f2;};'use strict';var _=require(_0xe121('0x0'));var util=require('util');var moment=require(_0xe121('0x1'));var BPromise=require(_0xe121('0x2'));var rs=require(_0xe121('0x3'));var fs=require('fs');var Redis=require(_0xe121('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe121('0x5'));var logger=require(_0xe121('0x6'))(_0xe121('0x7'));var config=require(_0xe121('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe121('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0f9f,_0x194984,_0x467d57){return new BPromise(function(_0x34009d,_0x407c19){return client['request'](_0x5e0f9f,_0x467d57)[_0xe121('0xa')](function(_0x1d8133){logger[_0xe121('0xb')](_0xe121('0xc'),_0x194984,_0xe121('0xd'));logger[_0xe121('0xe')](_0xe121('0xf'),_0x194984,'request\x20sent',JSON['stringify'](_0x1d8133));if(_0x1d8133[_0xe121('0x10')]){if(_0x1d8133[_0xe121('0x10')]['code']===0x1f4){logger[_0xe121('0x10')](_0xe121('0xc'),_0x194984,_0x1d8133[_0xe121('0x10')][_0xe121('0x11')]);return _0x407c19(_0x1d8133[_0xe121('0x10')][_0xe121('0x11')]);}logger[_0xe121('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x194984,_0x1d8133[_0xe121('0x10')][_0xe121('0x11')]);return _0x34009d(_0x1d8133[_0xe121('0x10')][_0xe121('0x11')]);}else{logger[_0xe121('0xb')](_0xe121('0xc'),_0x194984,_0xe121('0xd'));_0x34009d(_0x1d8133[_0xe121('0x12')][_0xe121('0x11')]);}})[_0xe121('0x13')](function(_0x77d59b){logger[_0xe121('0x10')](_0xe121('0xc'),_0x194984,_0x77d59b);_0x407c19(_0x77d59b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 78c9663..c926f0f 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2263=['app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','default','then','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','App\x20Ready!','catch','log','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/environment','./config/logger'];(function(_0x2a304a,_0x13f72f){var _0x1dcb8c=function(_0x543605){while(--_0x543605){_0x2a304a['push'](_0x2a304a['shift']());}};_0x1dcb8c(++_0x13f72f);}(_0x2263,0x6e));var _0x3226=function(_0x485f53,_0x104081){_0x485f53=_0x485f53-0x0;var _0x480f1e=_0x2263[_0x485f53];return _0x480f1e;};'use strict';var _=require(_0x3226('0x0'));var db=require(_0x3226('0x1'))['db'];var seedDb=require(_0x3226('0x2'));var checkLicense=require(_0x3226('0x3'));var rpc=require(_0x3226('0x4'));var config=require(_0x3226('0x5'));var logger=require(_0x3226('0x6'))(_0x3226('0x7'));var pm2=require('./config/pm2');var pm2Config=require(_0x3226('0x8'));var schedule=require(_0x3226('0x9'));var chat=require(_0x3226('0xa'));var whatsapp=require(_0x3226('0xb'));var transcribe=require(_0x3226('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x3226('0xd')][_0x3226('0xe')]()['then'](function(){if(config['seedDB']){return seedDb[_0x3226('0xf')]();}})[_0x3226('0x10')](function(){return checkLicense['default']();})[_0x3226('0x10')](function(){return rpc[_0x3226('0x11')]();})[_0x3226('0x10')](function(_0x91eee3){logger[_0x3226('0x12')](_0x91eee3);return chat[_0x3226('0x13')]();})[_0x3226('0x10')](function(){return whatsapp['start']();})[_0x3226('0x10')](function(){return schedule[_0x3226('0x13')]();})[_0x3226('0x10')](function(){return transcribe[_0x3226('0x13')]();})['then'](function(){return provider['start']();})['then'](function(_0x48a499){logger['info'](_0x48a499);return pm2[_0x3226('0x13')](pm2Config);})[_0x3226('0x10')](function(_0x114f4b){var _0x1b8552=_0x114f4b['filter'](function(_0x5b5c77){return typeof _0x5b5c77[_0x3226('0x14')]===_0x3226('0x15')&&_0x5b5c77[_0x3226('0x14')]>=0x0;});if(_0x1b8552['length']>0x0){throw new Error(_0x1b8552[_0x3226('0x16')]+_0x3226('0x17')+_[_0x3226('0x18')](_0x1b8552,function(_0x31d4f0){return'\x22'+_0x31d4f0[_0x3226('0x19')][_0x3226('0x1a')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x3226('0x18')](_['filter'](_0x114f4b,{'status':_0x3226('0x1b')}),_0x3226('0x1a'))[_0x3226('0x1c')]());logger[_0x3226('0x12')](_0x3226('0x1d'),_[_0x3226('0x18')](_['filter'](_0x114f4b,function(_0x2b4d38){return _0x2b4d38[_0x3226('0x1e')]!=='online';}),_0x3226('0x1a'))[_0x3226('0x1c')]()||_0x3226('0x1f'));console['log'](_0x3226('0x20'));})[_0x3226('0x21')](function(_0x25f867){console[_0x3226('0x22')](_0x3226('0x23'),_0x25f867);logger[_0x3226('0x24')](_0x3226('0x25'),_0x25f867);process[_0x3226('0x26')](0x1);});}main(); \ No newline at end of file +var _0x7579=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','seedDB','default','then','listen','info','start','filter','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','App\x20Ready!','catch','log','error'];(function(_0x103a4b,_0x3f35f4){var _0x32a502=function(_0x5b7308){while(--_0x5b7308){_0x103a4b['push'](_0x103a4b['shift']());}};_0x32a502(++_0x3f35f4);}(_0x7579,0x1e2));var _0x9757=function(_0x53fb55,_0x3befcf){_0x53fb55=_0x53fb55-0x0;var _0x181a74=_0x7579[_0x53fb55];return _0x181a74;};'use strict';var _=require(_0x9757('0x0'));var db=require(_0x9757('0x1'))['db'];var seedDb=require(_0x9757('0x2'));var checkLicense=require(_0x9757('0x3'));var rpc=require(_0x9757('0x4'));var config=require(_0x9757('0x5'));var logger=require('./config/logger')(_0x9757('0x6'));var pm2=require(_0x9757('0x7'));var pm2Config=require(_0x9757('0x8'));var schedule=require(_0x9757('0x9'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x9757('0xa'));var transcribe=require(_0x9757('0xb'));var provider=require(_0x9757('0xc'));function main(){return db['sequelize'][_0x9757('0xd')]()['then'](function(){if(config[_0x9757('0xe')]){return seedDb[_0x9757('0xf')]();}})[_0x9757('0x10')](function(){return checkLicense['default']();})[_0x9757('0x10')](function(){return rpc[_0x9757('0x11')]();})[_0x9757('0x10')](function(_0xc35036){logger[_0x9757('0x12')](_0xc35036);return chat[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return whatsapp[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return schedule[_0x9757('0x13')]();})[_0x9757('0x10')](function(){return transcribe['start']();})[_0x9757('0x10')](function(){return provider[_0x9757('0x13')]();})[_0x9757('0x10')](function(_0x595a9e){logger[_0x9757('0x12')](_0x595a9e);return pm2[_0x9757('0x13')](pm2Config);})[_0x9757('0x10')](function(_0x14f67c){var _0x224229=_0x14f67c[_0x9757('0x14')](function(_0x105e56){return typeof _0x105e56['exitCode']===_0x9757('0x15')&&_0x105e56['exitCode']>=0x0;});if(_0x224229[_0x9757('0x16')]>0x0){throw new Error(_0x224229[_0x9757('0x16')]+_0x9757('0x17')+_[_0x9757('0x18')](_0x224229,function(_0x3f6be9){return'\x22'+_0x3f6be9[_0x9757('0x19')]['name']+'\x22';}));}logger[_0x9757('0x12')](_0x9757('0x1a'),_[_0x9757('0x18')](_[_0x9757('0x14')](_0x14f67c,{'status':_0x9757('0x1b')}),_0x9757('0x1c'))[_0x9757('0x1d')]());logger['info'](_0x9757('0x1e'),_['map'](_['filter'](_0x14f67c,function(_0x37c889){return _0x37c889[_0x9757('0x1f')]!==_0x9757('0x1b');}),_0x9757('0x1c'))['join']()||'None');console['log'](_0x9757('0x20'));})[_0x9757('0x21')](function(_0x3bec93){console[_0x9757('0x22')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3bec93);logger[_0x9757('0x23')](_0x9757('0x24'),_0x3bec93);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f05c6f8..537c086 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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x008c,0x188));var _0xc008=function(_0x231f6f,_0xf231e0){_0x231f6f=_0x231f6f-0x0;var _0xc621c4=_0x008c[_0x231f6f];return _0xc621c4;};'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 _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','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','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.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x226ac0,_0x4c2837){var _0x204480=function(_0x7caaab){while(--_0x7caaab){_0x226ac0['push'](_0x226ac0['shift']());}};_0x204480(++_0x4c2837);}(_0x55ca,0x126));var _0xa55c=function(_0x1aa049,_0x9ae13c){_0x1aa049=_0x1aa049-0x0;var _0x357f29=_0x55ca[_0x1aa049];return _0x357f29;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 7014053..1a8b728 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(_0x158909,_0x2581c7){var _0x39f4a4=function(_0x3466c1){while(--_0x3466c1){_0x158909['push'](_0x158909['shift']());}};_0x39f4a4(++_0x2581c7);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'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 _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x20ee7b,_0x43aaf7){var _0x494bcc=function(_0x1c53eb){while(--_0x1c53eb){_0x20ee7b['push'](_0x20ee7b['shift']());}};_0x494bcc(++_0x43aaf7);}(_0xb10b,0x12a));var _0xbb10=function(_0x53286a,_0x485c92){_0x53286a=_0x53286a-0x0;var _0x5730ff=_0xb10b[_0x53286a];return _0x5730ff;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 56528f9..22ca8d9 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 _0x3b23=['Sequelize','QueryTypes','SELECT','query','Tags','clone','isEmpty','sequelize','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','sqlOperator','name','dateOfBirth','castTo','DATE','buildExpression','default','text','value','start','Tag','map','tags','clause','user','and','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','agent','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy'];(function(_0x167cd3,_0x3636be){var _0x3e6bf5=function(_0xe91723){while(--_0xe91723){_0x167cd3['push'](_0x167cd3['shift']());}};_0x3e6bf5(++_0x3636be);}(_0x3b23,0x1aa));var _0x33b2=function(_0x250efd,_0x22d8ea){_0x250efd=_0x250efd-0x0;var _0x2b5660=_0x3b23[_0x250efd];return _0x2b5660;};'use strict';var _=require(_0x33b2('0x0'));var squel=require(_0x33b2('0x1'));var as=require(_0x33b2('0x2'));var qs=require('../parsers/qs');var utils=require(_0x33b2('0x3'));var db=require(_0x33b2('0x4'))['db'];function skipContactsQuery(_0x5129dc,_0x338330){var _0x5b411b=![];if(_0x5129dc['role']==='agent'&&!_0x338330[_0x33b2('0x5')]&&!_0x338330[_0x33b2('0x6')]&&_0x338330['autocomplete']!==_0x33b2('0x7')){_0x5b411b=!![];}return _0x5b411b;}function getContactsSubquery(){return squel[_0x33b2('0x8')]()[_0x33b2('0x9')](_0x33b2('0xa'),'c')[_0x33b2('0xb')](_0x33b2('0xc'));}function applyJoinClauses(_0xd15dd6,_0x593461){var _0x43f2c2=_0x593461?'c':_0x33b2('0xd');_0xd15dd6[_0x33b2('0xe')](_0x33b2('0xf'),'uc','uc.CmContactId\x20=\x20'+_0x43f2c2+_0x33b2('0x10'))[_0x33b2('0xe')](_0x33b2('0x11'),'ct',_0x33b2('0x12')+_0x43f2c2+'.id')[_0x33b2('0xe')](_0x33b2('0x13'),'t',_0x33b2('0x14'));return _0xd15dd6;}function addFieldsToQuery(_0x4bd9d2,_0x41b766,_0x277b68,_0x11ca10,_0x355d46){var _0x4154fa=_0x355d46?'c':'subqry';if(!_0x41b766){_0x41b766=['id',_0x33b2('0x15'),_0x33b2('0x16'),_0x33b2('0x17'),_0x33b2('0x18'),_0x33b2('0x19'),_0x33b2('0x1a'),_0x33b2('0x6'),_0x33b2('0x1b'),'createdAt',_0x33b2('0x1c'),_0x33b2('0x1d'),_0x33b2('0x1e')];}else if(!_0x41b766[_0x33b2('0x1f')]('id')){_0x41b766[_0x33b2('0x20')]('id');}var _0x490ac4=_0x277b68&&_0x355d46||!_0x277b68&&!_0x355d46;if(_0x11ca10){_0x490ac4=_0x11ca10&&_0x355d46||!_0x11ca10&&!_0x355d46;}_0x41b766[_0x33b2('0x21')](function(_0xd26a45){if(_0xd26a45===_0x33b2('0x1e')){if(_0x490ac4){_0x4bd9d2[_0x33b2('0x22')](_0x33b2('0x23'),_0xd26a45);}else if(_0x277b68||_0x11ca10){_0x4bd9d2['field'](_0x4154fa+'.'+_0xd26a45);}}else{_0x4bd9d2[_0x33b2('0x22')](_0x4154fa+'.'+_0xd26a45);}});return _0x4bd9d2;}function getSqlClauses(){var _0xb04985={'default':squel[_0x33b2('0x24')](),'fields':squel['expr'](),'filter':squel[_0x33b2('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0xb04985;}function parseTagParameter(_0x369b60){var _0x58a49d=squel['expr']();if(_0x369b60){var _0x3a9648=utils['getSelectedTags'](_0x369b60);_0x3a9648[_0x33b2('0x21')](function(_0xa42a7d){_0x58a49d['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xa42a7d+',%');});}return _0x58a49d;}function parseSearchFilter(_0x2825f9){var _0x11209c=squel[_0x33b2('0x24')]();if(_0x2825f9){var _0x402249=_0x2825f9[_0x33b2('0x25')]('\x5c','\x5c\x5c')[_0x33b2('0x25')](/'/g,'\x27\x27');if(_0x402249[_0x33b2('0x26')]('\x20')[_0x33b2('0x27')]>0x1){_0x11209c['or'](_0x33b2('0x28'),qs[_0x33b2('0x29')](_0x402249),null);}else{if(qs['isNumeric'](_0x402249)){_0x11209c['or'](_0x33b2('0x2a'),_0x402249+'%');_0x11209c['or'](_0x33b2('0x2b'),_0x402249+'%');_0x11209c['or'](_0x33b2('0x2c'),_0x402249+'%');_0x11209c['or'](_0x33b2('0x2d'),_0x402249+'%');}else if(qs[_0x33b2('0x2e')](_0x402249)){_0x11209c['or'](_0x33b2('0x2f'),_0x402249+'%');}else{_0x11209c['or']('c.firstName\x20LIKE\x20?','%'+_0x402249+'%');_0x11209c['or']('c.lastName\x20LIKE\x20?','%'+_0x402249+'%');_0x11209c['or']('c.email\x20LIKE\x20?','%'+_0x402249+'%');}}}return _0x11209c;}function parseAdvancedSearchFilter(_0x2a5098,_0x48e8f3){var _0x2fc802=getSqlClauses();var _0x25591e=as['parseSearch'](_0x2a5098);var _0x22e9bc=_0x25591e[_0x33b2('0x30')];for(var _0x5f008d=0x0;_0x5f008d<_0x25591e['conditions'][_0x33b2('0x27')];_0x5f008d++){var _0xe3e4ca=_0x25591e['conditions'][_0x5f008d];var _0x533cdb='c';var _0x358138=_['find'](_0x48e8f3,[_0x33b2('0x31'),_0xe3e4ca[_0x33b2('0x22')]]);if(_0x358138){if(_0xe3e4ca[_0x33b2('0x22')]===_0x33b2('0x32')||_0x358138['fieldType']==='datetime'){_0xe3e4ca[_0x33b2('0x33')]=_0x33b2('0x34');}var _0x5077ef=as[_0x33b2('0x35')](_0x533cdb,_0x358138['type'],_0xe3e4ca);_0x2fc802[_0x33b2('0x36')][_0x22e9bc](_0x5077ef[_0x33b2('0x37')],_0x5077ef[_0x33b2('0x38')][_0x33b2('0x39')],_0x5077ef[_0x33b2('0x38')]['end']);}else{if(_0xe3e4ca['field']===_0x33b2('0x3a')){var _0x467d18=_0xe3e4ca[_0x33b2('0x38')][_0x33b2('0x26')](',')[_0x33b2('0x3b')](function(_0x32c5f8){return Number(_0x32c5f8);});var _0x3d1998=parseTagParameter(_0x467d18);_0x2fc802[_0x33b2('0x3c')][_0x33b2('0x3d')]['and'](_0x3d1998);_0x2fc802[_0x33b2('0x3c')]['ids']=_0x467d18;}else if(_0xe3e4ca[_0x33b2('0x22')]==='User'){_0x2fc802[_0x33b2('0x3e')]['clause'][_0x33b2('0x3f')]('uc.UserId\x20=\x20?',_0xe3e4ca['value']);_0x2fc802[_0x33b2('0x3e')][_0x33b2('0x40')]=!![];}}}return _0x2fc802;}function parseModelFields(_0x53abc0,_0x6ce823){var _0x2d4200=squel[_0x33b2('0x24')]();var _0xac45ec=_(_0x53abc0)[_0x33b2('0x41')]()['map'](function(_0x4a3416){return _[_0x33b2('0x42')](_0x6ce823,[_0x33b2('0x31'),_0x4a3416])?_0x4a3416:undefined;})[_0x33b2('0x43')]()[_0x33b2('0x38')]();if(_0x53abc0['Contact']){_0xac45ec[_0x33b2('0x20')](_0x33b2('0x44'));}if(_0xac45ec[_0x33b2('0x27')]>0x0){_0xac45ec[_0x33b2('0x21')](function(_0x1e7149){if(_0x1e7149===_0x33b2('0x6')){_0x2d4200[_0x33b2('0x3f')](_0x33b2('0x45'),[]['concat'](_0x53abc0[_0x1e7149]));}else if(_0x1e7149===_0x33b2('0x44')){var _0x15c51c='%'+_0x53abc0[_0x1e7149]+'%';_0x2d4200['and'](_0x33b2('0x46'),_0x15c51c);}else{_0x2d4200[_0x33b2('0x3f')]('c.'+_0x1e7149+_0x33b2('0x47'),_0x53abc0[_0x1e7149]);}});}return _0x2d4200;}function parseQueryParameters(_0x2a4fa1,_0x483f49){var _0x549b0a=getSqlClauses();return Promise[_0x33b2('0x48')]()[_0x33b2('0x49')](function(){return parseModelFields(_0x2a4fa1,_0x483f49);})[_0x33b2('0x49')](function(_0x3aa6a0){_0x549b0a[_0x33b2('0x4a')][_0x33b2('0x3f')](_0x3aa6a0);return parseTagParameter(_0x2a4fa1[_0x33b2('0x4b')]);})['then'](function(_0x3ee4c9){_0x549b0a[_0x33b2('0x3c')]['clause'][_0x33b2('0x3f')](_0x3ee4c9);return parseSearchFilter(_0x2a4fa1[_0x33b2('0x4c')]);})['then'](function(_0x545207){_0x549b0a['filter']=_0x545207;return _0x549b0a;});}function checkListsRestrictions(_0x9d5ea0,_0x191d92,_0x1d0092){var _0x5a3f70=squel[_0x33b2('0x24')]();return Promise['resolve']()[_0x33b2('0x49')](function(){if(_0x191d92['search']&&_0x9d5ea0[_0x33b2('0x4d')]===_0x33b2('0x4e')&&!_0x1d0092){return _0x9d5ea0[_0x33b2('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x3a9b97){if(_0x3a9b97){if(_0x3a9b97[_0x33b2('0x27')]===0x0){_0x5a3f70[_0x33b2('0x3f')](_0x33b2('0x50'));}else{_0x5a3f70['and']('c.ListId\x20IN\x20?',_['map'](_0x3a9b97,'id'));}}})[_0x33b2('0x49')](function(){return _0x5a3f70;});}function buildContactsQuery(_0x1659e8,_0x5a69c3,_0x36ef79,_0xaf7c24,_0x14c0ae,_0x5a70fa){if(_0x5a69c3){_0x5a69c3=_0x36ef79[_0x33b2('0x51')];}_0x1659e8=addFieldsToQuery(_0x1659e8,_0x5a69c3,_0xaf7c24,_0x5a70fa,!![]);var _0x2aa320=squel['select']();_0x2aa320=addFieldsToQuery(_0x2aa320,_0x5a69c3,_0xaf7c24,_0x5a70fa,![]);if(_0xaf7c24||_0x5a70fa){_0x1659e8=applyJoinClauses(_0x1659e8,!![]);_0x1659e8[_0x33b2('0x52')](_0x33b2('0x53'));if(_0x36ef79['limit']){_0x2aa320[_0x33b2('0x54')](_0x36ef79[_0x33b2('0x54')]);}if(_0x36ef79[_0x33b2('0x55')]){_0x2aa320[_0x33b2('0x55')](_0x36ef79['offset']);}}else{_0x2aa320=applyJoinClauses(_0x2aa320,![]);_0x2aa320[_0x33b2('0x52')](_0x33b2('0x56'));if(_0x36ef79[_0x33b2('0x54')]){_0x1659e8[_0x33b2('0x54')](_0x36ef79[_0x33b2('0x54')]);}if(_0x36ef79['offset']){_0x1659e8[_0x33b2('0x55')](_0x36ef79[_0x33b2('0x55')]);}}_0x2aa320[_0x33b2('0x57')](_0x14c0ae);if(_0x36ef79[_0x33b2('0x58')]){_0x36ef79[_0x33b2('0x58')][_0x33b2('0x21')](function(_0x578a1a){_0x1659e8[_0x33b2('0x58')]('c.'+_0x578a1a[0x0],_0x578a1a[0x1]===_0x33b2('0x59')?![]:!![]);_0x2aa320[_0x33b2('0x58')](_0x33b2('0x5a')+_0x578a1a[0x0],_0x578a1a[0x1]===_0x33b2('0x59')?![]:!![]);});}_0x2aa320[_0x33b2('0x9')](_0x1659e8,_0x33b2('0xd'));return _0x2aa320;}function getFilteredContacts(_0x383d8f){var _0x255e4e=[];return db[_0x33b2('0x3a')][_0x33b2('0x5b')]({'attributes':['id','name',_0x33b2('0x5c')],'raw':!![]})[_0x33b2('0x49')](function(_0x4e5678){_0x255e4e=_[_0x33b2('0x5d')](_0x4e5678,'id');var _0x2cfffe={'type':db[_0x33b2('0x5e')][_0x33b2('0x5f')][_0x33b2('0x60')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x33b2('0x61')](_0x383d8f['toString'](),_0x2cfffe);})['then'](function(_0x50e3bc){_0x50e3bc[_0x33b2('0x21')](function(_0x45a56b){if(_0x45a56b[_0x33b2('0x1e')]){_0x45a56b[_0x33b2('0x62')]=[];_0x45a56b[_0x33b2('0x1e')][_0x33b2('0x26')](',')['forEach'](function(_0x31677f){_0x45a56b[_0x33b2('0x62')][_0x33b2('0x20')](_0x255e4e[_0x31677f]);});}delete _0x45a56b[_0x33b2('0x1e')];});return _0x50e3bc;});}function countFilteredContacts(_0x5ca171,_0x13b808){var _0x3ad2cd=_0x5ca171[_0x33b2('0x63')]();_0x3ad2cd[_0x33b2('0x22')]('COUNT(*)');_0x3ad2cd=applyJoinClauses(_0x3ad2cd,!![]);_0x5ca171[_0x33b2('0x52')](_0x33b2('0x53'));var _0x131536=utils['getSelectedTags'](_0x13b808);if(!_[_0x33b2('0x64')](_0x131536)){_0x3ad2cd[_0x33b2('0xb')]('t.id\x20IN\x20?',_0x131536);}var _0x1a9367={'type':db[_0x33b2('0x5e')][_0x33b2('0x5f')]['SELECT'],'raw':!![]};return db[_0x33b2('0x65')][_0x33b2('0x61')](_0x3ad2cd['toString'](),_0x1a9367)[_0x33b2('0x49')](function(_0x3449a3){return _0x3449a3[0x0][_0x33b2('0x66')];});}module[_0x33b2('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xb8b5=['start','value','end','Tag','tags','clause','and','User','user','uc.UserId\x20=\x20?','keys','map','some','name','compact','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','filter','getLists','c.ListId\x20IN\x20?','attributes','c.id','limit','offset','group','subqry.id','having','order','DESC','subqry.','from','findAll','color','keyBy','Sequelize','QueryTypes','sequelize','toString','Tags','clone','COUNT(*)','isEmpty','SELECT','query','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','role','agent','search','ListId','autocomplete','true','select','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','createdAt','updatedAt','deletedAt','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','default'];(function(_0x42b448,_0x112d6f){var _0x5c929c=function(_0x39fd42){while(--_0x39fd42){_0x42b448['push'](_0x42b448['shift']());}};_0x5c929c(++_0x112d6f);}(_0xb8b5,0x16e));var _0x5b8b=function(_0x13a0a7,_0xf7597c){_0x13a0a7=_0x13a0a7-0x0;var _0x16dcff=_0xb8b5[_0x13a0a7];return _0x16dcff;};'use strict';var _=require(_0x5b8b('0x0'));var squel=require(_0x5b8b('0x1'));var as=require(_0x5b8b('0x2'));var qs=require(_0x5b8b('0x3'));var utils=require(_0x5b8b('0x4'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x326d42,_0x16dff3){var _0x1f595d=![];if(_0x326d42[_0x5b8b('0x5')]===_0x5b8b('0x6')&&!_0x16dff3[_0x5b8b('0x7')]&&!_0x16dff3[_0x5b8b('0x8')]&&_0x16dff3[_0x5b8b('0x9')]!==_0x5b8b('0xa')){_0x1f595d=!![];}return _0x1f595d;}function getContactsSubquery(){return squel[_0x5b8b('0xb')]()['from'](_0x5b8b('0xc'),'c')[_0x5b8b('0xd')](_0x5b8b('0xe'));}function applyJoinClauses(_0x58f35c,_0x54d4d1){var _0xc2c33f=_0x54d4d1?'c':_0x5b8b('0xf');_0x58f35c[_0x5b8b('0x10')](_0x5b8b('0x11'),'uc',_0x5b8b('0x12')+_0xc2c33f+'.id')[_0x5b8b('0x10')](_0x5b8b('0x13'),'ct',_0x5b8b('0x14')+_0xc2c33f+_0x5b8b('0x15'))['left_join']('tools_tags','t',_0x5b8b('0x16'));return _0x58f35c;}function addFieldsToQuery(_0xd5daa6,_0x4a1f50,_0x2f6e4e,_0x55dfbd,_0x46167d){var _0x113792=_0x46167d?'c':_0x5b8b('0xf');if(!_0x4a1f50){_0x4a1f50=['id',_0x5b8b('0x17'),'lastName',_0x5b8b('0x18'),_0x5b8b('0x19'),_0x5b8b('0x1a'),'email','ListId','CompanyId',_0x5b8b('0x1b'),_0x5b8b('0x1c'),_0x5b8b('0x1d'),'TagIds'];}else if(!_0x4a1f50['includes']('id')){_0x4a1f50[_0x5b8b('0x1e')]('id');}var _0x142a0c=_0x2f6e4e&&_0x46167d||!_0x2f6e4e&&!_0x46167d;if(_0x55dfbd){_0x142a0c=_0x55dfbd&&_0x46167d||!_0x55dfbd&&!_0x46167d;}_0x4a1f50[_0x5b8b('0x1f')](function(_0x486aba){if(_0x486aba===_0x5b8b('0x20')){if(_0x142a0c){_0xd5daa6[_0x5b8b('0x21')](_0x5b8b('0x22'),_0x486aba);}else if(_0x2f6e4e||_0x55dfbd){_0xd5daa6[_0x5b8b('0x21')](_0x113792+'.'+_0x486aba);}}else{_0xd5daa6[_0x5b8b('0x21')](_0x113792+'.'+_0x486aba);}});return _0xd5daa6;}function getSqlClauses(){var _0x7672fa={'default':squel[_0x5b8b('0x23')](),'fields':squel[_0x5b8b('0x23')](),'filter':squel[_0x5b8b('0x23')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x5b8b('0x23')](),'skip':![]}};return _0x7672fa;}function parseTagParameter(_0x1c6ddb){var _0x3e24b0=squel['expr']();if(_0x1c6ddb){var _0x1fecec=utils[_0x5b8b('0x24')](_0x1c6ddb);_0x1fecec[_0x5b8b('0x1f')](function(_0x21f794){_0x3e24b0['or'](_0x5b8b('0x25'),'%,'+_0x21f794+',%');});}return _0x3e24b0;}function parseSearchFilter(_0x39503b){var _0x2396de=squel[_0x5b8b('0x23')]();if(_0x39503b){var _0x3a1696=_0x39503b[_0x5b8b('0x26')]('\x5c','\x5c\x5c')[_0x5b8b('0x26')](/'/g,'\x27\x27');if(_0x3a1696[_0x5b8b('0x27')]('\x20')[_0x5b8b('0x28')]>0x1){_0x2396de['or'](_0x5b8b('0x29'),qs['getFullTextValue'](_0x3a1696),null);}else{if(qs['isNumeric'](_0x3a1696)){_0x2396de['or'](_0x5b8b('0x2a'),_0x3a1696+'%');_0x2396de['or']('c.phone\x20LIKE\x20?',_0x3a1696+'%');_0x2396de['or']('c.mobile\x20LIKE\x20?',_0x3a1696+'%');_0x2396de['or']('c.fax\x20LIKE\x20?',_0x3a1696+'%');}else if(qs[_0x5b8b('0x2b')](_0x3a1696)){_0x2396de['or'](_0x5b8b('0x2c'),_0x3a1696+'%');}else{_0x2396de['or'](_0x5b8b('0x2d'),'%'+_0x3a1696+'%');_0x2396de['or'](_0x5b8b('0x2e'),'%'+_0x3a1696+'%');_0x2396de['or']('c.email\x20LIKE\x20?','%'+_0x3a1696+'%');}}}return _0x2396de;}function parseAdvancedSearchFilter(_0x2c19de,_0x4ca35e){var _0x19b862=getSqlClauses();var _0x116dd3=as[_0x5b8b('0x2f')](_0x2c19de);var _0x924b6=_0x116dd3[_0x5b8b('0x30')];for(var _0x5c3b3e=0x0;_0x5c3b3e<_0x116dd3[_0x5b8b('0x31')][_0x5b8b('0x28')];_0x5c3b3e++){var _0x244686=_0x116dd3[_0x5b8b('0x31')][_0x5c3b3e];var _0x23192d='c';var _0x385e91=_[_0x5b8b('0x32')](_0x4ca35e,['name',_0x244686[_0x5b8b('0x21')]]);if(_0x385e91){if(_0x244686[_0x5b8b('0x21')]===_0x5b8b('0x33')||_0x385e91[_0x5b8b('0x34')]===_0x5b8b('0x35')){_0x244686[_0x5b8b('0x36')]='DATE';}var _0x3d92c0=as[_0x5b8b('0x37')](_0x23192d,_0x385e91[_0x5b8b('0x38')],_0x244686);_0x19b862[_0x5b8b('0x39')][_0x924b6](_0x3d92c0['text'],_0x3d92c0['value'][_0x5b8b('0x3a')],_0x3d92c0[_0x5b8b('0x3b')][_0x5b8b('0x3c')]);}else{if(_0x244686[_0x5b8b('0x21')]===_0x5b8b('0x3d')){var _0x585cef=_0x244686['value'][_0x5b8b('0x27')](',')['map'](function(_0x8e0a9a){return Number(_0x8e0a9a);});var _0xf2ab20=parseTagParameter(_0x585cef);_0x19b862[_0x5b8b('0x3e')][_0x5b8b('0x3f')][_0x5b8b('0x40')](_0xf2ab20);_0x19b862['tags']['ids']=_0x585cef;}else if(_0x244686[_0x5b8b('0x21')]===_0x5b8b('0x41')){_0x19b862[_0x5b8b('0x42')][_0x5b8b('0x3f')][_0x5b8b('0x40')](_0x5b8b('0x43'),_0x244686[_0x5b8b('0x3b')]);_0x19b862[_0x5b8b('0x42')]['skip']=!![];}}}return _0x19b862;}function parseModelFields(_0x56d641,_0x42bf12){var _0x5ec30a=squel[_0x5b8b('0x23')]();var _0x1004f5=_(_0x56d641)[_0x5b8b('0x44')]()[_0x5b8b('0x45')](function(_0x5c2672){return _[_0x5b8b('0x46')](_0x42bf12,[_0x5b8b('0x47'),_0x5c2672])?_0x5c2672:undefined;})[_0x5b8b('0x48')]()[_0x5b8b('0x3b')]();if(_0x56d641['Contact']){_0x1004f5[_0x5b8b('0x1e')](_0x5b8b('0x49'));}if(_0x1004f5[_0x5b8b('0x28')]>0x0){_0x1004f5['forEach'](function(_0x55c041){if(_0x55c041===_0x5b8b('0x8')){_0x5ec30a[_0x5b8b('0x40')]('c.ListId\x20IN\x20?',[]['concat'](_0x56d641[_0x55c041]));}else if(_0x55c041===_0x5b8b('0x49')){var _0x316044='%'+_0x56d641[_0x55c041]+'%';_0x5ec30a[_0x5b8b('0x40')](_0x5b8b('0x4a'),_0x316044);}else{_0x5ec30a[_0x5b8b('0x40')]('c.'+_0x55c041+_0x5b8b('0x4b'),_0x56d641[_0x55c041]);}});}return _0x5ec30a;}function parseQueryParameters(_0x3a54bb,_0x1405e5){var _0x23291f=getSqlClauses();return Promise[_0x5b8b('0x4c')]()[_0x5b8b('0x4d')](function(){return parseModelFields(_0x3a54bb,_0x1405e5);})['then'](function(_0x4f4fed){_0x23291f[_0x5b8b('0x4e')][_0x5b8b('0x40')](_0x4f4fed);return parseTagParameter(_0x3a54bb['tag']);})['then'](function(_0x1bf1fb){_0x23291f['tags'][_0x5b8b('0x3f')][_0x5b8b('0x40')](_0x1bf1fb);return parseSearchFilter(_0x3a54bb[_0x5b8b('0x4f')]);})[_0x5b8b('0x4d')](function(_0x15cc7a){_0x23291f[_0x5b8b('0x4f')]=_0x15cc7a;return _0x23291f;});}function checkListsRestrictions(_0x39e9dd,_0x22e0ba,_0x1d245e){var _0x46b710=squel[_0x5b8b('0x23')]();return Promise[_0x5b8b('0x4c')]()[_0x5b8b('0x4d')](function(){if(_0x22e0ba[_0x5b8b('0x7')]&&_0x39e9dd[_0x5b8b('0x5')]===_0x5b8b('0x6')&&!_0x1d245e){return _0x39e9dd[_0x5b8b('0x50')]({'attributes':['id'],'raw':!![]});}})[_0x5b8b('0x4d')](function(_0x178780){if(_0x178780){if(_0x178780['length']===0x0){_0x46b710[_0x5b8b('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x46b710[_0x5b8b('0x40')](_0x5b8b('0x51'),_[_0x5b8b('0x45')](_0x178780,'id'));}}})[_0x5b8b('0x4d')](function(){return _0x46b710;});}function buildContactsQuery(_0x45ba5c,_0x227016,_0xedcf0d,_0xe700a4,_0x1068ec,_0x28be38){if(_0x227016){_0x227016=_0xedcf0d[_0x5b8b('0x52')];}_0x45ba5c=addFieldsToQuery(_0x45ba5c,_0x227016,_0xe700a4,_0x28be38,!![]);var _0x5466b3=squel[_0x5b8b('0xb')]();_0x5466b3=addFieldsToQuery(_0x5466b3,_0x227016,_0xe700a4,_0x28be38,![]);if(_0xe700a4||_0x28be38){_0x45ba5c=applyJoinClauses(_0x45ba5c,!![]);_0x45ba5c['group'](_0x5b8b('0x53'));if(_0xedcf0d[_0x5b8b('0x54')]){_0x5466b3[_0x5b8b('0x54')](_0xedcf0d[_0x5b8b('0x54')]);}if(_0xedcf0d[_0x5b8b('0x55')]){_0x5466b3[_0x5b8b('0x55')](_0xedcf0d[_0x5b8b('0x55')]);}}else{_0x5466b3=applyJoinClauses(_0x5466b3,![]);_0x5466b3[_0x5b8b('0x56')](_0x5b8b('0x57'));if(_0xedcf0d['limit']){_0x45ba5c[_0x5b8b('0x54')](_0xedcf0d[_0x5b8b('0x54')]);}if(_0xedcf0d['offset']){_0x45ba5c[_0x5b8b('0x55')](_0xedcf0d[_0x5b8b('0x55')]);}}_0x5466b3[_0x5b8b('0x58')](_0x1068ec);if(_0xedcf0d[_0x5b8b('0x59')]){_0xedcf0d[_0x5b8b('0x59')][_0x5b8b('0x1f')](function(_0x305269){_0x45ba5c[_0x5b8b('0x59')]('c.'+_0x305269[0x0],_0x305269[0x1]===_0x5b8b('0x5a')?![]:!![]);_0x5466b3[_0x5b8b('0x59')](_0x5b8b('0x5b')+_0x305269[0x0],_0x305269[0x1]===_0x5b8b('0x5a')?![]:!![]);});}_0x5466b3[_0x5b8b('0x5c')](_0x45ba5c,_0x5b8b('0xf'));return _0x5466b3;}function getFilteredContacts(_0x256d8b){var _0x4117ec=[];return db['Tag'][_0x5b8b('0x5d')]({'attributes':['id',_0x5b8b('0x47'),_0x5b8b('0x5e')],'raw':!![]})[_0x5b8b('0x4d')](function(_0x3cbf29){_0x4117ec=_[_0x5b8b('0x5f')](_0x3cbf29,'id');var _0x2ab424={'type':db[_0x5b8b('0x60')][_0x5b8b('0x61')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5b8b('0x62')]['query'](_0x256d8b[_0x5b8b('0x63')](),_0x2ab424);})['then'](function(_0x42d5ba){_0x42d5ba[_0x5b8b('0x1f')](function(_0x2e1efd){if(_0x2e1efd[_0x5b8b('0x20')]){_0x2e1efd[_0x5b8b('0x64')]=[];_0x2e1efd['TagIds']['split'](',')[_0x5b8b('0x1f')](function(_0xe92f8f){_0x2e1efd[_0x5b8b('0x64')]['push'](_0x4117ec[_0xe92f8f]);});}delete _0x2e1efd[_0x5b8b('0x20')];});return _0x42d5ba;});}function countFilteredContacts(_0x4e86f7,_0x309006){var _0x16c109=_0x4e86f7[_0x5b8b('0x65')]();_0x16c109[_0x5b8b('0x21')](_0x5b8b('0x66'));_0x16c109=applyJoinClauses(_0x16c109,!![]);_0x4e86f7[_0x5b8b('0x56')](_0x5b8b('0x53'));var _0x2ed200=utils['getSelectedTags'](_0x309006);if(!_[_0x5b8b('0x67')](_0x2ed200)){_0x16c109[_0x5b8b('0xd')]('t.id\x20IN\x20?',_0x2ed200);}var _0x793ec5={'type':db[_0x5b8b('0x60')][_0x5b8b('0x61')][_0x5b8b('0x68')],'raw':!![]};return db[_0x5b8b('0x62')][_0x5b8b('0x69')](_0x16c109[_0x5b8b('0x63')](),_0x793ec5)[_0x5b8b('0x4d')](function(_0x4da999){return _0x4da999[0x0]['COUNT(*)'];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index aca8dbf..b42974e 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 _0xf0ec=['secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','data','binary','write','end','close','unlink','decryptFile','createReadStream','createDecipher','update','secret','createCipher','utf8','base64','decryptString','final','crypto','bluebird','lodash','app'];(function(_0x221d95,_0x7c506e){var _0x35958d=function(_0x24fe60){while(--_0x24fe60){_0x221d95['push'](_0x221d95['shift']());}};_0x35958d(++_0x7c506e);}(_0xf0ec,0x11c));var _0xcf0e=function(_0x5465e6,_0x2a8809){_0x5465e6=_0x5465e6-0x0;var _0x10044e=_0xf0ec[_0x5465e6];return _0x10044e;};'use strict';var crypto=require(_0xcf0e('0x0'));var fs=require('fs');var BPromise=require(_0xcf0e('0x1'));var _=require(_0xcf0e('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xcf0e('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xcf0e('0x4')][_0xcf0e('0x5')],'algorithm':_0xcf0e('0x6')};const fileOptions={'algorithm':_0xcf0e('0x7')};if(config[_0xcf0e('0x8')]&&config[_0xcf0e('0x8')][_0xcf0e('0x9')]){var isSupported=isAlgorithmSupported(config[_0xcf0e('0x8')][_0xcf0e('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0xcf0e('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xcf0e('0xa')](',\x20');logger['error'](config[_0xcf0e('0x8')][_0xcf0e('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x4ae6c5){return AES_SUPPORTED_RX['test'](_0x4ae6c5);}function getSupportedCiphers(){return crypto[_0xcf0e('0xb')]()[_0xcf0e('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x19489e){return getSupportedCiphers()[_0xcf0e('0xd')](_0x19489e)>-0x1;}function combineOptions(_0x179470){var _0x2990aa={};for(var _0x278c7c in fileOptions){if(fileOptions[_0xcf0e('0xe')](_0x278c7c)){_0x2990aa[_0x278c7c]=fileOptions[_0x278c7c];}}if(_0x179470){for(var _0x76ff2c in _0x179470){if(_0x179470[_0xcf0e('0xe')](_0x76ff2c)){_0x2990aa[_0x76ff2c]=_0x179470[_0x76ff2c];}}}return _0x2990aa;}exports[_0xcf0e('0xf')]=function(_0x38a7ef,_0x351389,_0x1d1ba7,_0x522eb0){return new BPromise(function(_0x11cbc6,_0x54ed06){_0x522eb0=combineOptions(_0x522eb0);var _0x309165=new Buffer(_0x1d1ba7);var _0x15b418=fs['createReadStream'](_0x38a7ef);var _0x449281=fs['createWriteStream'](_0x351389);var _0x36f55f=crypto['createCipher'](_0x522eb0[_0xcf0e('0x9')],_0x309165);_0x15b418['on'](_0xcf0e('0x10'),function(_0x1654f1){var _0x4f2491=new Buffer(_0x36f55f['update'](_0x1654f1),_0xcf0e('0x11'));_0x449281[_0xcf0e('0x12')](_0x4f2491);});_0x15b418['on'](_0xcf0e('0x13'),function(){try{var _0x6c1224=new Buffer(_0x36f55f['final'](_0xcf0e('0x11')),_0xcf0e('0x11'));_0x449281['write'](_0x6c1224);_0x449281[_0xcf0e('0x13')]();_0x449281['on'](_0xcf0e('0x14'),function(){return _0x11cbc6(_0x351389);});}catch(_0x281b35){fs[_0xcf0e('0x15')](_0x351389);return _0x54ed06(_0x281b35);}});});};exports[_0xcf0e('0x16')]=function(_0x4c3ae7,_0x5bb400,_0x222ab6,_0x5d1472){return new BPromise(function(_0x175308,_0x5522c7){_0x5d1472=combineOptions(_0x5d1472);var _0x4fa4c1=new Buffer(_0x222ab6);var _0x32b557=fs[_0xcf0e('0x17')](_0x4c3ae7);var _0x3bcb77=fs['createWriteStream'](_0x5bb400);var _0x128118=crypto[_0xcf0e('0x18')](_0x5d1472[_0xcf0e('0x9')],_0x4fa4c1);_0x32b557['on'](_0xcf0e('0x10'),function(_0x69fb63){var _0xe79377=new Buffer(_0x128118[_0xcf0e('0x19')](_0x69fb63),_0xcf0e('0x11'));_0x3bcb77[_0xcf0e('0x12')](_0xe79377);});_0x32b557['on'](_0xcf0e('0x13'),function(){try{var _0x41af69=new Buffer(_0x128118['final'](_0xcf0e('0x11')),_0xcf0e('0x11'));_0x3bcb77[_0xcf0e('0x12')](_0x41af69);_0x3bcb77[_0xcf0e('0x13')]();_0x3bcb77['on'](_0xcf0e('0x14'),function(){return _0x175308(_0x5bb400);});}catch(_0x55a88c){fs[_0xcf0e('0x15')](_0x5bb400);return _0x5522c7(_0x55a88c);}});});};exports['encryptString']=function(_0x2f16a0,_0x21f404,_0x12f752){var _0x3df069=_0x12f752||stringOptions[_0xcf0e('0x9')];var _0x179f65=_0x21f404||stringOptions[_0xcf0e('0x1a')];var _0x140d79=crypto[_0xcf0e('0x1b')](_0x3df069,_0x179f65);var _0x445ea7=_0x140d79['update'](_0x2f16a0,_0xcf0e('0x1c'),'base64');_0x445ea7+=_0x140d79['final'](_0xcf0e('0x1d'));return _0x445ea7;};exports[_0xcf0e('0x1e')]=function(_0x4929a4,_0x1292f2,_0x374986){var _0x215097=_0x374986||stringOptions[_0xcf0e('0x9')];var _0x56e9a2=_0x1292f2||stringOptions[_0xcf0e('0x1a')];var _0x110b67=crypto[_0xcf0e('0x18')](_0x215097,_0x56e9a2);var _0xb22f3d=_0x110b67[_0xcf0e('0x19')](_0x4929a4,_0xcf0e('0x1d'),_0xcf0e('0x1c'));_0xb22f3d+=_0x110b67[_0xcf0e('0x1f')](_0xcf0e('0x1c'));return _0xb22f3d;}; \ No newline at end of file +var _0xbd04=['encryptString','secret','update','utf8','base64','decryptString','final','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createCipher','data','write','end','binary','unlink','decryptFile','createWriteStream','createDecipher'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbd04,0x130));var _0x4bd0=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xbd04[_0xc6be3a];return _0x56a310;};'use strict';var crypto=require(_0x4bd0('0x0'));var fs=require('fs');var BPromise=require(_0x4bd0('0x1'));var _=require(_0x4bd0('0x2'));var config=require(_0x4bd0('0x3'));var logger=require('../../config/logger')(_0x4bd0('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x4bd0('0x5')]['session'],'algorithm':_0x4bd0('0x6')};const fileOptions={'algorithm':_0x4bd0('0x7')};if(config[_0x4bd0('0x8')]&&config[_0x4bd0('0x8')][_0x4bd0('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x4bd0('0x9')]=config[_0x4bd0('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x4bd0('0xa')](config['encrypt']['algorithm'],_0x4bd0('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x300624){return AES_SUPPORTED_RX[_0x4bd0('0xc')](_0x300624);}function getSupportedCiphers(){return crypto[_0x4bd0('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x1decf2){return getSupportedCiphers()[_0x4bd0('0xe')](_0x1decf2)>-0x1;}function combineOptions(_0x5625df){var _0x253c8b={};for(var _0x4b2a89 in fileOptions){if(fileOptions['hasOwnProperty'](_0x4b2a89)){_0x253c8b[_0x4b2a89]=fileOptions[_0x4b2a89];}}if(_0x5625df){for(var _0x595b85 in _0x5625df){if(_0x5625df[_0x4bd0('0xf')](_0x595b85)){_0x253c8b[_0x595b85]=_0x5625df[_0x595b85];}}}return _0x253c8b;}exports[_0x4bd0('0x10')]=function(_0x2160bf,_0x1460ed,_0x31b38a,_0x46c763){return new BPromise(function(_0x243080,_0x5e61f5){_0x46c763=combineOptions(_0x46c763);var _0x527110=new Buffer(_0x31b38a);var _0x530307=fs['createReadStream'](_0x2160bf);var _0x540acb=fs['createWriteStream'](_0x1460ed);var _0x414e09=crypto[_0x4bd0('0x11')](_0x46c763[_0x4bd0('0x9')],_0x527110);_0x530307['on'](_0x4bd0('0x12'),function(_0x337728){var _0x5d34ec=new Buffer(_0x414e09['update'](_0x337728),'binary');_0x540acb[_0x4bd0('0x13')](_0x5d34ec);});_0x530307['on'](_0x4bd0('0x14'),function(){try{var _0x3cec09=new Buffer(_0x414e09['final'](_0x4bd0('0x15')),_0x4bd0('0x15'));_0x540acb[_0x4bd0('0x13')](_0x3cec09);_0x540acb[_0x4bd0('0x14')]();_0x540acb['on']('close',function(){return _0x243080(_0x1460ed);});}catch(_0x309279){fs[_0x4bd0('0x16')](_0x1460ed);return _0x5e61f5(_0x309279);}});});};exports[_0x4bd0('0x17')]=function(_0x123f7e,_0x568973,_0x453e8d,_0x1a7879){return new BPromise(function(_0x126642,_0x365f98){_0x1a7879=combineOptions(_0x1a7879);var _0x60894=new Buffer(_0x453e8d);var _0x10ecdc=fs['createReadStream'](_0x123f7e);var _0x2ccd07=fs[_0x4bd0('0x18')](_0x568973);var _0x493506=crypto[_0x4bd0('0x19')](_0x1a7879[_0x4bd0('0x9')],_0x60894);_0x10ecdc['on'](_0x4bd0('0x12'),function(_0x3e6b0c){var _0x32a523=new Buffer(_0x493506['update'](_0x3e6b0c),'binary');_0x2ccd07[_0x4bd0('0x13')](_0x32a523);});_0x10ecdc['on']('end',function(){try{var _0x2fc5f0=new Buffer(_0x493506['final'](_0x4bd0('0x15')),'binary');_0x2ccd07[_0x4bd0('0x13')](_0x2fc5f0);_0x2ccd07[_0x4bd0('0x14')]();_0x2ccd07['on']('close',function(){return _0x126642(_0x568973);});}catch(_0x32dc89){fs[_0x4bd0('0x16')](_0x568973);return _0x365f98(_0x32dc89);}});});};exports[_0x4bd0('0x1a')]=function(_0x1f96f2,_0x4ed31d,_0x14fc8f){var _0x1bc450=_0x14fc8f||stringOptions['algorithm'];var _0x37d236=_0x4ed31d||stringOptions[_0x4bd0('0x1b')];var _0x121a8e=crypto[_0x4bd0('0x11')](_0x1bc450,_0x37d236);var _0x196663=_0x121a8e[_0x4bd0('0x1c')](_0x1f96f2,_0x4bd0('0x1d'),_0x4bd0('0x1e'));_0x196663+=_0x121a8e['final']('base64');return _0x196663;};exports[_0x4bd0('0x1f')]=function(_0x53fd59,_0x1ddf6a,_0x3e9c32){var _0x5df1a1=_0x3e9c32||stringOptions['algorithm'];var _0x307458=_0x1ddf6a||stringOptions[_0x4bd0('0x1b')];var _0x2bbdac=crypto[_0x4bd0('0x19')](_0x5df1a1,_0x307458);var _0x34c7d3=_0x2bbdac['update'](_0x53fd59,'base64',_0x4bd0('0x1d'));_0x34c7d3+=_0x2bbdac[_0x4bd0('0x20')](_0x4bd0('0x1d'));return _0x34c7d3;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c1f81ad..29b024b 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 _0xbb9f=['exit','path','to-csv','zip-dir','rimraf','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','.csv','existsSync','join','mkdirSync','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally'];(function(_0x1fe707,_0x4f8109){var _0x2309cc=function(_0x5b112d){while(--_0x5b112d){_0x1fe707['push'](_0x1fe707['shift']());}};_0x2309cc(++_0x4f8109);}(_0xbb9f,0x120));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var path=require(_0xfbb9('0x0'));var _=require('lodash');var csv=require(_0xfbb9('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xfbb9('0x2'));var rimraf=require(_0xfbb9('0x3'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xfbb9('0x4'));var EXTRACTED_REPORT_ID=Number(process[_0xfbb9('0x5')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xfbb9('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x579943,_0xf96a30){var _0x5be234={'status':_0x579943};var _0x17900b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf96a30){_0x5be234[_0xfbb9('0x6')]=_0xf96a30;}return db[_0xfbb9('0x7')][_0xfbb9('0x8')](_0x5be234,_0x17900b);}function main(){var _0x2efb7c=0x1388;var _0x500e7d;logger[_0xfbb9('0x9')](util[_0xfbb9('0xa')](_0xfbb9('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xfbb9('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xfbb9('0xd'),_0xfbb9('0xe')]})[_0xfbb9('0xf')](function(_0x5a4e70){if(_0x5a4e70){_0x500e7d=_0x5a4e70;_0x2efb7c=_0x500e7d['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0xfbb9('0x10')][_0xfbb9('0x11')](util[_0xfbb9('0xa')](_0xfbb9('0x12'),QUERY),{'type':dbH[_0xfbb9('0x10')][_0xfbb9('0x13')]['SELECT']});})[_0xfbb9('0xf')](function(_0x41cacb){if(!_0x41cacb[0x0][_0xfbb9('0x14')]){return analyticExtractedReport('Empty');}var _0x5e852d=[];var _0x4002b2=0x0;if(_0x500e7d[_0xfbb9('0xd')]){if(_0x41cacb&&_0x41cacb[_0xfbb9('0x15')]){var _0xddf682=_[_0xfbb9('0x16')](_0x41cacb[0x0][_0xfbb9('0x14')]/_0x2efb7c);var _0x2fed88=Number['isInteger'](_0x41cacb[0x0][_0xfbb9('0x14')]/_0x2efb7c)?_0x41cacb[0x0][_0xfbb9('0x14')]%_0x2efb7c:0x0;_0xddf682['forEach'](function(_0x28237f){if(_0x28237f>0x0){_0x4002b2+=_0x2efb7c;}_0x5e852d[_0xfbb9('0x17')](dbH[_0xfbb9('0x10')][_0xfbb9('0x11')](util['format'](_0xfbb9('0x18'),QUERY,_0x2efb7c,_0x4002b2),{'type':dbH[_0xfbb9('0x10')][_0xfbb9('0x13')]['SELECT']}));});if(_0x2fed88>0x0){_0x4002b2+=_0x2efb7c;_0x5e852d[_0xfbb9('0x17')](dbH['sequelize'][_0xfbb9('0x11')](util[_0xfbb9('0xa')](_0xfbb9('0x18'),QUERY,_0x2fed88,_0x4002b2),{'type':dbH[_0xfbb9('0x10')][_0xfbb9('0x13')][_0xfbb9('0x19')]}));}}}else{_0x5e852d[_0xfbb9('0x17')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xfbb9('0x10')][_0xfbb9('0x13')][_0xfbb9('0x19')]}));}var _0x1fc26d=path['dirname'](PATH);var _0x4e1424=path['basename'](PATH,_0xfbb9('0x1a'));var _0x5ae0ff=_0x500e7d[_0xfbb9('0xd')]&&_0x5e852d[_0xfbb9('0x15')]>0x1;var _0x4296ec=[];if(!fs[_0xfbb9('0x1b')](path[_0xfbb9('0x1c')](_0x1fc26d,_0x4e1424))&&_0x5ae0ff){fs[_0xfbb9('0x1d')](path[_0xfbb9('0x1c')](_0x1fc26d,_0x4e1424));}return BPromise['each'](_0x5e852d,function(_0x50342d){_0x4296ec[_0xfbb9('0x17')](_0x50342d);})['then'](function(){for(var _0x3a5b5f=0x0;_0x3a5b5f<_0x4296ec[_0xfbb9('0x15')];_0x3a5b5f+=0x1){var _0xa15eb0;var _0xd4a3e2=_0x4296ec[_0x3a5b5f];if(_0x5ae0ff){_0xa15eb0=path['join'](_0x1fc26d,_0x4e1424,util['format']('%s%d.%s',_0x4e1424,_0x3a5b5f,_0xfbb9('0x1e')));}else{_0xa15eb0=path[_0xfbb9('0x1c')](_0x1fc26d,util['format'](_0xfbb9('0x1f'),_0x4e1424,_0xfbb9('0x1e')));}fs[_0xfbb9('0x20')](_0xa15eb0,csv(_0xd4a3e2));}})[_0xfbb9('0xf')](function(){if(_0x5ae0ff){return new Promise(function(_0x243622){zipdir(path[_0xfbb9('0x1c')](_0x1fc26d,_0x4e1424),{'saveTo':path[_0xfbb9('0x1c')](_0x1fc26d,util['format'](_0xfbb9('0x1f'),_0x4e1424,_0xfbb9('0x21')))},function(_0x38d5c6,_0x5eb0f8){rimraf(path['join'](_0x1fc26d,_0x4e1424),function(){});_0x243622(_0xfbb9('0x22'));});});}})[_0xfbb9('0xf')](function(){logger['info'](util[_0xfbb9('0xa')](_0xfbb9('0x23'),EXTRACTED_REPORT_ID,_0xfbb9('0x24')));return analyticExtractedReport(_0xfbb9('0x25'),_0x5ae0ff?util[_0xfbb9('0xa')](_0xfbb9('0x1f'),_0x4e1424,_0x5ae0ff?_0xfbb9('0x21'):_0xfbb9('0x1e')):null);});})['catch'](function(_0x1b25d7){logger[_0xfbb9('0x9')](util[_0xfbb9('0xa')](_0xfbb9('0x26'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x1b25d7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xfbb9('0x27')](function(){process[_0xfbb9('0x28')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2620=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.csv','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','csv','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0x2620,0x1e8));var _0x0262=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x2620[_0x31e29a];return _0x32d892;};'use strict';var util=require(_0x0262('0x0'));var path=require('path');var _=require(_0x0262('0x1'));var csv=require(_0x0262('0x2'));var fs=require('fs');var BPromise=require(_0x0262('0x3'));var zipdir=require(_0x0262('0x4'));var rimraf=require('rimraf');var db=require(_0x0262('0x5'))['db'];var dbH=require(_0x0262('0x5'))[_0x0262('0x6')];var logger=require(_0x0262('0x7'))(_0x0262('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0262('0x9')][0x2]);var QUERY=process[_0x0262('0x9')][0x3];var PATH=process[_0x0262('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c4706,_0x35391a){var _0x108876={'status':_0x5c4706};var _0x440028={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35391a){_0x108876[_0x0262('0xa')]=_0x35391a;}return db['AnalyticExtractedReport']['update'](_0x108876,_0x440028);}function main(){var _0x153ba0=0x1388;var _0x4cb253;logger[_0x0262('0xb')](util['format'](_0x0262('0xc'),EXTRACTED_REPORT_ID,_0x0262('0xd')));return db[_0x0262('0xe')][_0x0262('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0262('0x10'),_0x0262('0x11')]})[_0x0262('0x12')](function(_0x1f76bc){if(_0x1f76bc){_0x4cb253=_0x1f76bc;_0x153ba0=_0x4cb253[_0x0262('0x11')]||0x1388;}})['then'](function(){return dbH[_0x0262('0x13')][_0x0262('0x14')](util[_0x0262('0x15')](_0x0262('0x16'),QUERY),{'type':dbH[_0x0262('0x13')]['QueryTypes'][_0x0262('0x17')]});})[_0x0262('0x12')](function(_0x337375){if(!_0x337375[0x0][_0x0262('0x18')]){return analyticExtractedReport('Empty');}var _0x1eccca=[];var _0x4b5e06=0x0;if(_0x4cb253['split']){if(_0x337375&&_0x337375[_0x0262('0x19')]){var _0x29ac23=_[_0x0262('0x1a')](_0x337375[0x0][_0x0262('0x18')]/_0x153ba0);var _0x45ae0a=Number[_0x0262('0x1b')](_0x337375[0x0]['num']/_0x153ba0)?_0x337375[0x0][_0x0262('0x18')]%_0x153ba0:0x0;_0x29ac23[_0x0262('0x1c')](function(_0x57cad3){if(_0x57cad3>0x0){_0x4b5e06+=_0x153ba0;}_0x1eccca[_0x0262('0x1d')](dbH[_0x0262('0x13')]['query'](util[_0x0262('0x15')](_0x0262('0x1e'),QUERY,_0x153ba0,_0x4b5e06),{'type':dbH[_0x0262('0x13')][_0x0262('0x1f')][_0x0262('0x17')]}));});if(_0x45ae0a>0x0){_0x4b5e06+=_0x153ba0;_0x1eccca['push'](dbH['sequelize'][_0x0262('0x14')](util[_0x0262('0x15')](_0x0262('0x1e'),QUERY,_0x45ae0a,_0x4b5e06),{'type':dbH['sequelize']['QueryTypes'][_0x0262('0x17')]}));}}}else{_0x1eccca['push'](dbH[_0x0262('0x13')][_0x0262('0x14')](QUERY,{'type':dbH[_0x0262('0x13')][_0x0262('0x1f')][_0x0262('0x17')]}));}var _0x5a3b5f=path['dirname'](PATH);var _0x27ea98=path['basename'](PATH,_0x0262('0x20'));var _0x1e148f=_0x4cb253['split']&&_0x1eccca[_0x0262('0x19')]>0x1;var _0x26088c=[];if(!fs[_0x0262('0x21')](path[_0x0262('0x22')](_0x5a3b5f,_0x27ea98))&&_0x1e148f){fs[_0x0262('0x23')](path[_0x0262('0x22')](_0x5a3b5f,_0x27ea98));}return BPromise[_0x0262('0x24')](_0x1eccca,function(_0x3e9104){_0x26088c[_0x0262('0x1d')](_0x3e9104);})[_0x0262('0x12')](function(){for(var _0x25f528=0x0;_0x25f528<_0x26088c['length'];_0x25f528+=0x1){var _0xbd6ef1;var _0x29bb2f=_0x26088c[_0x25f528];if(_0x1e148f){_0xbd6ef1=path[_0x0262('0x22')](_0x5a3b5f,_0x27ea98,util['format'](_0x0262('0x25'),_0x27ea98,_0x25f528,'csv'));}else{_0xbd6ef1=path['join'](_0x5a3b5f,util[_0x0262('0x15')](_0x0262('0x26'),_0x27ea98,'csv'));}fs[_0x0262('0x27')](_0xbd6ef1,csv(_0x29bb2f));}})[_0x0262('0x12')](function(){if(_0x1e148f){return new Promise(function(_0x16eec3){zipdir(path[_0x0262('0x22')](_0x5a3b5f,_0x27ea98),{'saveTo':path[_0x0262('0x22')](_0x5a3b5f,util[_0x0262('0x15')](_0x0262('0x26'),_0x27ea98,_0x0262('0x28')))},function(_0x4441e4,_0x20fd3a){rimraf(path[_0x0262('0x22')](_0x5a3b5f,_0x27ea98),function(){});_0x16eec3(_0x0262('0x29'));});});}})['then'](function(){logger[_0x0262('0xb')](util[_0x0262('0x15')](_0x0262('0x2a'),EXTRACTED_REPORT_ID,_0x0262('0xd')));return analyticExtractedReport('Completed',_0x1e148f?util[_0x0262('0x15')](_0x0262('0x26'),_0x27ea98,_0x1e148f?'zip':_0x0262('0x2b')):null);});})[_0x0262('0x2c')](function(_0x4c6e96){logger[_0x0262('0xb')](util[_0x0262('0x15')](_0x0262('0x2d'),EXTRACTED_REPORT_ID,_0x0262('0xd')),util[_0x0262('0x2e')](_0x4c6e96,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0262('0x2f'));})[_0x0262('0x30')](function(){process[_0x0262('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 58abf48..f52e9d1 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 _0x8b05=['length','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','\x20/\x20','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill'];(function(_0x10fd04,_0x17f661){var _0x731522=function(_0x2dea2a){while(--_0x2dea2a){_0x10fd04['push'](_0x10fd04['shift']());}};_0x731522(++_0x17f661);}(_0x8b05,0x9e));var _0x58b0=function(_0x4c6988,_0x35a82c){_0x4c6988=_0x4c6988-0x0;var _0x4b8b73=_0x8b05[_0x4c6988];return _0x4b8b73;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x58b0('0x0'));var path=require(_0x58b0('0x1'));var moment=require(_0x58b0('0x2'));var htmlToPdfmake=require(_0x58b0('0x3'));var PdfPrinter=require(_0x58b0('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x58b0('0x5'));var JSDOM=require(_0x58b0('0x6'))[_0x58b0('0x7')];var window=new JSDOM('')[_0x58b0('0x8')];var BPromise=require(_0x58b0('0x9'));var db=require(_0x58b0('0xa'))['db'];var dbH=require(_0x58b0('0xa'))[_0x58b0('0xb')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x58b0('0xc')][0x3];var PATH=process[_0x58b0('0xc')][0x4];var NAME=process[_0x58b0('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1de706,_0x25e35a){var _0x574851={'status':_0x1de706};var _0x4faec4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25e35a){_0x574851[_0x58b0('0xd')]=_0x25e35a;}return db[_0x58b0('0xe')][_0x58b0('0xf')](_0x574851,_0x4faec4);}function getHeaders(_0x59dc45){return _[_0x58b0('0x10')](_0x59dc45,function(_0x30241f){return{'text':_0x30241f,'style':_0x58b0('0x11')};});}function getRows(_0x6d2322,_0x212160){return _['map'](_0x212160,function(_0x515d03){return _(_0x515d03)[_0x58b0('0x12')](_0x6d2322)['map'](function(_0x420ac3){return _0x420ac3?_[_0x58b0('0x13')](_0x420ac3):'';})[_0x58b0('0x14')]();});}function createTable(_0x388d6e,_0x3cbf15){var _0xa77a28={'widths':_[_0x58b0('0x15')](Array(_0x388d6e[_0x58b0('0x16')]),0x91),'heights':function(_0x1f8e6a){return _0x1f8e6a===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x19417c=getHeaders(_0x388d6e);_0xa77a28[_0x58b0('0x17')]['push'](_0x19417c);var _0x5a87b5=getRows(_0x388d6e,_0x3cbf15);_0xa77a28['body']=_0xa77a28[_0x58b0('0x17')][_0x58b0('0x18')](_0x5a87b5);return _0xa77a28;}function createTables(_0x322c61){var _0x5a4253=[];var _0x12f0aa=_[_0x58b0('0x19')](Object[_0x58b0('0x1a')](_0x322c61[0x0]),0x5);_0x12f0aa[_0x58b0('0x1b')](function(_0x156b25){_0x5a4253[_0x58b0('0x1c')](createTable(_0x156b25,_0x322c61));});return _0x5a4253;}function getPDFDocDefinition(_0x5e2204){var _0x47a6af=util[_0x58b0('0x1d')](_0x58b0('0x1e'),NAME,EXTRACTED_REPORT[_0x58b0('0x1f')],moment(EXTRACTED_REPORT[_0x58b0('0x20')])[_0x58b0('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x58b0('0x21')])['format'](FORMAT));var _0x339d25=[];for(var _0x3b1a82=0x0;_0x3b1a82<_0x5e2204['length'];_0x3b1a82++){var _0x28e671=[];if(_0x3b1a82===0x0){_0x28e671['push']({'text':_0x47a6af,'style':_0x58b0('0x22')});}var _0x3a879e={'table':_0x5e2204[_0x3b1a82]};if(_0x3b1a82>0x0){_0x3a879e['pageBreak']=_0x58b0('0x23');_0x3a879e[_0x58b0('0x24')]=[0x0,0x46,0x0,0x0];}_0x28e671[_0x58b0('0x1c')](_0x3a879e);_0x339d25[_0x58b0('0x1c')](_0x28e671);}return{'pageSize':'A4','pageOrientation':_0x58b0('0x25'),'content':_0x339d25,'footer':function(_0x2bdebb,_0xf812cd){return{'text':_0x2bdebb[_0x58b0('0x13')]()+_0x58b0('0x26')+_0xf812cd,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x58b0('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x360c5b){var _0x36f419=0x1388;var _0x21eef6;if(!_0x360c5b[0x0][_0x58b0('0x28')]){return analyticExtractedReport('Empty');}return db[_0x58b0('0x29')][_0x58b0('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x58b0('0x2b'),_0x58b0('0x2c')]})[_0x58b0('0x2d')](function(_0x81ab31){if(_0x81ab31){_0x21eef6=_0x81ab31;_0x36f419=_0x21eef6['splitSizePdf']||0x3e8;}})[_0x58b0('0x2d')](function(){var _0x3e12cd=[];var _0x66d7e9=0x0;if(_0x21eef6[_0x58b0('0x2b')]){if(_0x360c5b&&_0x360c5b[_0x58b0('0x16')]){var _0x574be9=_[_0x58b0('0x2e')](_0x360c5b[0x0][_0x58b0('0x28')]/_0x36f419);var _0x5705bb=Number[_0x58b0('0x2f')](_0x360c5b[0x0]['num']/_0x36f419)?_0x360c5b[0x0][_0x58b0('0x28')]%_0x36f419:0x0;_0x574be9[_0x58b0('0x1b')](function(_0x597c13){if(_0x597c13>0x0){_0x66d7e9+=_0x36f419;}_0x3e12cd[_0x58b0('0x1c')](dbH[_0x58b0('0x30')][_0x58b0('0x31')](util[_0x58b0('0x1d')](_0x58b0('0x32'),QUERY,_0x36f419,_0x66d7e9),{'type':dbH[_0x58b0('0x30')]['QueryTypes'][_0x58b0('0x33')]}));});if(_0x5705bb>0x0){_0x66d7e9+=_0x36f419;_0x3e12cd[_0x58b0('0x1c')](dbH['sequelize'][_0x58b0('0x31')](util[_0x58b0('0x1d')](_0x58b0('0x32'),QUERY,_0x5705bb,_0x66d7e9),{'type':dbH[_0x58b0('0x30')][_0x58b0('0x34')][_0x58b0('0x33')]}));}}}else{_0x3e12cd[_0x58b0('0x1c')](dbH[_0x58b0('0x30')][_0x58b0('0x31')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x58b0('0x33')]}));}var _0x3eab6e=path[_0x58b0('0x35')](PATH);var _0x62077f=path['basename'](PATH,'.pdf');var _0x274a8b=_0x21eef6['split']&&_0x3e12cd[_0x58b0('0x16')]>0x1;var _0x273fa6=[];if(!fs[_0x58b0('0x36')](path[_0x58b0('0x37')](_0x3eab6e,_0x62077f))&&_0x274a8b){fs[_0x58b0('0x38')](path['join'](_0x3eab6e,_0x62077f));}return BPromise[_0x58b0('0x39')](_0x3e12cd,function(_0x3e5be7){_0x273fa6[_0x58b0('0x1c')](_0x3e5be7);})[_0x58b0('0x2d')](function(){var _0xa83100=[];for(var _0x527ed2=0x0;_0x527ed2<_0x273fa6[_0x58b0('0x16')];_0x527ed2+=0x1){var _0x162562=_0x273fa6[_0x527ed2];var _0x2932ca=createTables(_[_0x58b0('0x3a')](_0x162562));var _0x3278df;var _0x243f70=getPDFDocDefinition(_0x2932ca);var _0x55f318=getPDFPrinter();var _0x3f344d=_0x55f318[_0x58b0('0x3b')](_0x243f70);if(_0x274a8b){_0x3278df=path[_0x58b0('0x37')](_0x3eab6e,_0x62077f,util[_0x58b0('0x1d')](_0x58b0('0x3c'),_0x62077f,_0x527ed2,_0x58b0('0x3d')));}else{_0x3278df=path[_0x58b0('0x37')](_0x3eab6e,util[_0x58b0('0x1d')]('%s.%s',_0x62077f,'pdf'));}_0xa83100[_0x58b0('0x1c')](writePDFDocument(_0x3f344d,_0x3278df));}return Promise['all'](_0xa83100);})[_0x58b0('0x2d')](function(){if(_0x274a8b){return new Promise(function(_0x467bf6){zipdir(path[_0x58b0('0x37')](_0x3eab6e,_0x62077f),{'saveTo':path['join'](_0x3eab6e,util[_0x58b0('0x1d')](_0x58b0('0x3e'),_0x62077f,_0x58b0('0x3f')))},function(){rimraf(path['join'](_0x3eab6e,_0x62077f),function(){});_0x467bf6(_0x58b0('0x40'));});});}})[_0x58b0('0x2d')](function(){if(!_0x274a8b)return;rimraf(path['join'](_0x3eab6e,_0x62077f),function(){});})[_0x58b0('0x2d')](function(){logger[_0x58b0('0x41')](util[_0x58b0('0x1d')](_0x58b0('0x42'),EXTRACTED_REPORT_ID,_0x58b0('0x43')));return analyticExtractedReport('Completed',_0x274a8b?util[_0x58b0('0x1d')](_0x58b0('0x3e'),_0x62077f,_0x274a8b?_0x58b0('0x3f'):_0x58b0('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x58b0('0x41')](util['format'](_0x58b0('0x44'),EXTRACTED_REPORT_ID,_0x58b0('0x43')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x58b0('0x2d')](function(_0x1f64df){EXTRACTED_REPORT=_0x1f64df;return dbH[_0x58b0('0x30')]['query'](util[_0x58b0('0x1d')](_0x58b0('0x45'),QUERY),{'type':dbH[_0x58b0('0x30')]['QueryTypes'][_0x58b0('0x33')]});})[_0x58b0('0x2d')](extractReport)[_0x58b0('0x46')](function(_0xe2e1de){logger[_0x58b0('0x41')](util[_0x58b0('0x1d')](_0x58b0('0x47'),EXTRACTED_REPORT_ID,_0x58b0('0x43')),util['inspect'](_0xe2e1de,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x58b0('0x48'));})[_0x58b0('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1ccb71=new PdfPrinter({'Arial':{'normal':__dirname+_0x58b0('0x4a'),'bold':__dirname+_0x58b0('0x4b'),'italics':__dirname+_0x58b0('0x4c'),'bolditalics':__dirname+_0x58b0('0x4d')}});return _0x1ccb71;}function getPDFDocDefinitionFromHTML(_0x3ea159,_0x454a2a){var _0x5d3583=util[_0x58b0('0x1d')](_0x58b0('0x4e'),_0x454a2a['channel'],_0x454a2a[_0x58b0('0x4f')]);var _0x828cbf=moment()['format'](_0x58b0('0x50'))[_0x58b0('0x13')]();var _0x56b249=htmlToPdfmake(_0x3ea159,{'window':window,'tableAutoSize':!![]});return{'content':[_0x56b249],'defaultStyle':{'font':_0x58b0('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x58b0('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x58b0('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x58b0('0x52')}},'header':function(){return[{'text':_0x58b0('0x53'),'style':'header'}];},'footer':function(_0x377233,_0x3007c7){return[{'text':util[_0x58b0('0x1d')](_0x58b0('0x54'),_0x5d3583,_0x377233,_0x3007c7,_0x828cbf),'style':_0x58b0('0x55')}];}};}function writePDFDocument(_0x23f7cd,_0xdbc8de){return new Promise(function(_0x20d619,_0xb9aea){var _0x3ef9c7=_0x23f7cd['pipe'](fs[_0x58b0('0x56')](_0xdbc8de));_0x3ef9c7['on']('finish',function(){_0x20d619(_0x58b0('0x57'));});_0x3ef9c7['on'](_0x58b0('0x58'),function(_0x494e2e){_0xb9aea(_0x494e2e);});_0x23f7cd[_0x58b0('0x59')]();});}exports['createPdfFromHTML']=function(_0x4333fb,_0x54f64d){var _0x482440=getPDFPrinter();var _0x194c46=getPDFDocDefinitionFromHTML(_0x4333fb,_0x54f64d);var _0xd4b966=_0x482440[_0x58b0('0x3b')](_0x194c46);return writePDFDocument(_0xd4b966,_0x54f64d['path'])[_0x58b0('0x46')](function(_0x4c8d21){throw _0x4c8d21;});}; \ No newline at end of file +var _0xdf63=['keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','pageBreak','before','margin','toString','\x20/\x20','black','Empty','Setting','find','split','splitSizePdf','then','range','num','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','.pdf','join','mkdirSync','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','header','footer','pipe','createWriteStream','finish','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','value','fill','length','auto','body','push','concat','chunk'];(function(_0x5183aa,_0x54277c){var _0x73ac67=function(_0x14759c){while(--_0x14759c){_0x5183aa['push'](_0x5183aa['shift']());}};_0x73ac67(++_0x54277c);}(_0xdf63,0x84));var _0x3df6=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xdf63[_0x5b3950];return _0x41e436;};'use strict';var _=require(_0x3df6('0x0'));var fs=require('fs');var util=require(_0x3df6('0x1'));var path=require(_0x3df6('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x3df6('0x3'));var PdfPrinter=require(_0x3df6('0x4'));var zipdir=require(_0x3df6('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x3df6('0x6'))[_0x3df6('0x7')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x3df6('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x3df6('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3df6('0x9')][0x4];var NAME=process[_0x3df6('0x9')][0x5];var FORMAT=_0x3df6('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5627b6,_0x3bb49){var _0x568470={'status':_0x5627b6};var _0x1d244d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bb49){_0x568470[_0x3df6('0xb')]=_0x3bb49;}return db[_0x3df6('0xc')]['update'](_0x568470,_0x1d244d);}function getHeaders(_0x2426ec){return _[_0x3df6('0xd')](_0x2426ec,function(_0x4b1f5e){return{'text':_0x4b1f5e,'style':'tableHeader'};});}function getRows(_0x2a1f86,_0x2800eb){return _['map'](_0x2800eb,function(_0x4a314f){return _(_0x4a314f)['pick'](_0x2a1f86)[_0x3df6('0xd')](function(_0x5413d9){return _0x5413d9?_['toString'](_0x5413d9):'';})[_0x3df6('0xe')]();});}function createTable(_0x383d05,_0x293ecc){var _0x24052e={'widths':_[_0x3df6('0xf')](Array(_0x383d05[_0x3df6('0x10')]),0x91),'heights':function(_0x4187c8){return _0x4187c8===0x0?_0x3df6('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4a70ae=getHeaders(_0x383d05);_0x24052e[_0x3df6('0x12')][_0x3df6('0x13')](_0x4a70ae);var _0x3237e0=getRows(_0x383d05,_0x293ecc);_0x24052e[_0x3df6('0x12')]=_0x24052e[_0x3df6('0x12')][_0x3df6('0x14')](_0x3237e0);return _0x24052e;}function createTables(_0xe3baf5){var _0x3d06cf=[];var _0x1366b7=_[_0x3df6('0x15')](Object[_0x3df6('0x16')](_0xe3baf5[0x0]),0x5);_0x1366b7[_0x3df6('0x17')](function(_0xdcac68){_0x3d06cf['push'](createTable(_0xdcac68,_0xe3baf5));});return _0x3d06cf;}function getPDFDocDefinition(_0x147a3b){var _0x2983e9=util[_0x3df6('0x18')](_0x3df6('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3df6('0x1a')])[_0x3df6('0x18')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x3df6('0x18')](FORMAT));var _0x13e306=[];for(var _0x5e19f1=0x0;_0x5e19f1<_0x147a3b[_0x3df6('0x10')];_0x5e19f1++){var _0x5813f6=[];if(_0x5e19f1===0x0){_0x5813f6['push']({'text':_0x2983e9,'style':'header'});}var _0x4e5073={'table':_0x147a3b[_0x5e19f1]};if(_0x5e19f1>0x0){_0x4e5073[_0x3df6('0x1b')]=_0x3df6('0x1c');_0x4e5073[_0x3df6('0x1d')]=[0x0,0x46,0x0,0x0];}_0x5813f6[_0x3df6('0x13')](_0x4e5073);_0x13e306[_0x3df6('0x13')](_0x5813f6);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x13e306,'footer':function(_0x1d3c42,_0x50d816){return{'text':_0x1d3c42[_0x3df6('0x1e')]()+_0x3df6('0x1f')+_0x50d816,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3df6('0x20')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1a1e10){var _0x5ad288=0x1388;var _0x4cd77b;if(!_0x1a1e10[0x0]['num']){return analyticExtractedReport(_0x3df6('0x21'));}return db[_0x3df6('0x22')][_0x3df6('0x23')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3df6('0x24'),_0x3df6('0x25')]})[_0x3df6('0x26')](function(_0x2212d5){if(_0x2212d5){_0x4cd77b=_0x2212d5;_0x5ad288=_0x4cd77b['splitSizePdf']||0x3e8;}})[_0x3df6('0x26')](function(){var _0x341b6d=[];var _0xb47c9c=0x0;if(_0x4cd77b[_0x3df6('0x24')]){if(_0x1a1e10&&_0x1a1e10[_0x3df6('0x10')]){var _0x58e152=_[_0x3df6('0x27')](_0x1a1e10[0x0][_0x3df6('0x28')]/_0x5ad288);var _0x199f06=Number['isInteger'](_0x1a1e10[0x0][_0x3df6('0x28')]/_0x5ad288)?_0x1a1e10[0x0][_0x3df6('0x28')]%_0x5ad288:0x0;_0x58e152['forEach'](function(_0x2ca8aa){if(_0x2ca8aa>0x0){_0xb47c9c+=_0x5ad288;}_0x341b6d[_0x3df6('0x13')](dbH[_0x3df6('0x29')]['query'](util[_0x3df6('0x18')](_0x3df6('0x2a'),QUERY,_0x5ad288,_0xb47c9c),{'type':dbH[_0x3df6('0x29')][_0x3df6('0x2b')][_0x3df6('0x2c')]}));});if(_0x199f06>0x0){_0xb47c9c+=_0x5ad288;_0x341b6d['push'](dbH[_0x3df6('0x29')][_0x3df6('0x2d')](util[_0x3df6('0x18')](_0x3df6('0x2a'),QUERY,_0x199f06,_0xb47c9c),{'type':dbH[_0x3df6('0x29')][_0x3df6('0x2b')][_0x3df6('0x2c')]}));}}}else{_0x341b6d['push'](dbH[_0x3df6('0x29')][_0x3df6('0x2d')](QUERY,{'type':dbH[_0x3df6('0x29')][_0x3df6('0x2b')][_0x3df6('0x2c')]}));}var _0x3e5860=path[_0x3df6('0x2e')](PATH);var _0x2a881b=path['basename'](PATH,_0x3df6('0x2f'));var _0x94353e=_0x4cd77b['split']&&_0x341b6d[_0x3df6('0x10')]>0x1;var _0x4560fe=[];if(!fs['existsSync'](path[_0x3df6('0x30')](_0x3e5860,_0x2a881b))&&_0x94353e){fs[_0x3df6('0x31')](path[_0x3df6('0x30')](_0x3e5860,_0x2a881b));}return BPromise['each'](_0x341b6d,function(_0x2defe9){_0x4560fe[_0x3df6('0x13')](_0x2defe9);})[_0x3df6('0x26')](function(){var _0x1b46cd=[];for(var _0x5dd5c1=0x0;_0x5dd5c1<_0x4560fe[_0x3df6('0x10')];_0x5dd5c1+=0x1){var _0x3d519d=_0x4560fe[_0x5dd5c1];var _0x5b2d55=createTables(_['flatten'](_0x3d519d));var _0x546b7d;var _0x4b049b=getPDFDocDefinition(_0x5b2d55);var _0x39acd1=getPDFPrinter();var _0xdc1965=_0x39acd1[_0x3df6('0x32')](_0x4b049b);if(_0x94353e){_0x546b7d=path['join'](_0x3e5860,_0x2a881b,util[_0x3df6('0x18')]('%s%d.%s',_0x2a881b,_0x5dd5c1,_0x3df6('0x33')));}else{_0x546b7d=path[_0x3df6('0x30')](_0x3e5860,util[_0x3df6('0x18')]('%s.%s',_0x2a881b,_0x3df6('0x33')));}_0x1b46cd['push'](writePDFDocument(_0xdc1965,_0x546b7d));}return Promise['all'](_0x1b46cd);})[_0x3df6('0x26')](function(){if(_0x94353e){return new Promise(function(_0x3c22ad){zipdir(path[_0x3df6('0x30')](_0x3e5860,_0x2a881b),{'saveTo':path[_0x3df6('0x30')](_0x3e5860,util[_0x3df6('0x18')](_0x3df6('0x34'),_0x2a881b,_0x3df6('0x35')))},function(){rimraf(path[_0x3df6('0x30')](_0x3e5860,_0x2a881b),function(){});_0x3c22ad(_0x3df6('0x36'));});});}})[_0x3df6('0x26')](function(){if(!_0x94353e)return;rimraf(path[_0x3df6('0x30')](_0x3e5860,_0x2a881b),function(){});})[_0x3df6('0x26')](function(){logger[_0x3df6('0x37')](util['format'](_0x3df6('0x38'),EXTRACTED_REPORT_ID,_0x3df6('0x39')));return analyticExtractedReport(_0x3df6('0x3a'),_0x94353e?util[_0x3df6('0x18')](_0x3df6('0x34'),_0x2a881b,_0x94353e?_0x3df6('0x35'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3df6('0x37')](util[_0x3df6('0x18')](_0x3df6('0x3b'),EXTRACTED_REPORT_ID,_0x3df6('0x39')));return db[_0x3df6('0xc')][_0x3df6('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1ff84a){EXTRACTED_REPORT=_0x1ff84a;return dbH[_0x3df6('0x29')][_0x3df6('0x2d')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3df6('0x29')][_0x3df6('0x2b')]['SELECT']});})[_0x3df6('0x26')](extractReport)['catch'](function(_0x6f7ecb){logger[_0x3df6('0x37')](util['format'](_0x3df6('0x3d'),EXTRACTED_REPORT_ID,_0x3df6('0x39')),util['inspect'](_0x6f7ecb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3df6('0x3e'));})['finally'](function(){process[_0x3df6('0x3f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xb7cbe8=new PdfPrinter({'Arial':{'normal':__dirname+_0x3df6('0x40'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xb7cbe8;}function getPDFDocDefinitionFromHTML(_0x1e3e09,_0xeb453){var _0x592577=util[_0x3df6('0x18')](_0x3df6('0x41'),_0xeb453[_0x3df6('0x42')],_0xeb453['interactionId']);var _0x2997d7=moment()[_0x3df6('0x18')]('YYYY-MM-DD')[_0x3df6('0x1e')]();var _0x1b3e57=htmlToPdfmake(_0x1e3e09,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1b3e57],'defaultStyle':{'font':_0x3df6('0x43')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3df6('0x44'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3df6('0x44'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x3df6('0x45'),'style':_0x3df6('0x46')}];},'footer':function(_0xf82ba4,_0x531b88){return[{'text':util[_0x3df6('0x18')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x592577,_0xf82ba4,_0x531b88,_0x2997d7),'style':_0x3df6('0x47')}];}};}function writePDFDocument(_0x286ea9,_0x32b083){return new Promise(function(_0x314319,_0x4d0889){var _0x4cd7f5=_0x286ea9[_0x3df6('0x48')](fs[_0x3df6('0x49')](_0x32b083));_0x4cd7f5['on'](_0x3df6('0x4a'),function(){_0x314319(_0x3df6('0x4a'));});_0x4cd7f5['on']('error',function(_0x2762ac){_0x4d0889(_0x2762ac);});_0x286ea9['end']();});}exports[_0x3df6('0x4b')]=function(_0x295cca,_0xa8c078){var _0x1b5c0f=getPDFPrinter();var _0x351afc=getPDFDocDefinitionFromHTML(_0x295cca,_0xa8c078);var _0x5a2cec=_0x1b5c0f[_0x3df6('0x32')](_0x351afc);return writePDFDocument(_0x5a2cec,_0xa8c078[_0x3df6('0x2')])[_0x3df6('0x4c')](function(_0x5c71d2){throw _0x5c71d2;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 079a1fe..e9b33d9 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 _0xf534=['existsSync','mkdirSync','xlsx','join','%s.%s','writeFileSync','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','format','XLSX','Setting','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx'];(function(_0x403235,_0x514e29){var _0x429cf8=function(_0xd5cc2){while(--_0xd5cc2){_0x403235['push'](_0x403235['shift']());}};_0x429cf8(++_0x514e29);}(_0xf534,0x9f));var _0x4f53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf534[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x4f53('0x0'));var path=require(_0x4f53('0x1'));var _=require(_0x4f53('0x2'));var fs=require('fs');var json2xls=require(_0x4f53('0x3'));var BPromise=require(_0x4f53('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x4f53('0x5'));var db=require(_0x4f53('0x6'))['db'];var dbH=require('../../mysqldb')[_0x4f53('0x7')];var logger=require(_0x4f53('0x8'))(_0x4f53('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x4f53('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x4f53('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f5daf,_0x34c008){var _0x22763e={'status':_0x4f5daf};var _0xfc7956={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34c008){_0x22763e[_0x4f53('0xb')]=_0x34c008;}return db['AnalyticExtractedReport'][_0x4f53('0xc')](_0x22763e,_0xfc7956);}function main(){var _0x562c47=0x1388;var _0x5f55ef;logger['info'](util[_0x4f53('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4f53('0xe')));return db[_0x4f53('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4f53('0x10')]})[_0x4f53('0x11')](function(_0x340c2a){if(_0x340c2a){_0x5f55ef=_0x340c2a;_0x562c47=_0x5f55ef[_0x4f53('0x10')]||0x1388;}})[_0x4f53('0x11')](function(){return dbH['sequelize'][_0x4f53('0x12')](util[_0x4f53('0xd')](_0x4f53('0x13'),QUERY),{'type':dbH[_0x4f53('0x14')][_0x4f53('0x15')][_0x4f53('0x16')]});})[_0x4f53('0x11')](function(_0x342db4){if(!_0x342db4[0x0][_0x4f53('0x17')]){return analyticExtractedReport(_0x4f53('0x18'));}var _0x471523=[];var _0x2bed41=0x0;if(_0x5f55ef[_0x4f53('0x19')]){if(_0x342db4&&_0x342db4[_0x4f53('0x1a')]){var _0x235edd=_[_0x4f53('0x1b')](_0x342db4[0x0][_0x4f53('0x17')]/_0x562c47);var _0x4ef926=Number[_0x4f53('0x1c')](_0x342db4[0x0][_0x4f53('0x17')]/_0x562c47)?_0x342db4[0x0][_0x4f53('0x17')]%_0x562c47:0x0;_0x235edd['forEach'](function(_0x263f89){if(_0x263f89>0x0){_0x2bed41+=_0x562c47;}_0x471523[_0x4f53('0x1d')](dbH['sequelize'][_0x4f53('0x12')](util[_0x4f53('0xd')](_0x4f53('0x1e'),QUERY,_0x562c47,_0x2bed41),{'type':dbH[_0x4f53('0x14')][_0x4f53('0x15')]['SELECT']}));});if(_0x4ef926>0x0){_0x2bed41+=_0x562c47;_0x471523[_0x4f53('0x1d')](dbH['sequelize']['query'](util[_0x4f53('0xd')](_0x4f53('0x1e'),QUERY,_0x4ef926,_0x2bed41),{'type':dbH[_0x4f53('0x14')][_0x4f53('0x15')][_0x4f53('0x16')]}));}}}else{_0x471523['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x4f53('0x14')][_0x4f53('0x15')][_0x4f53('0x16')]}));}var _0x295564=path[_0x4f53('0x1f')](PATH);var _0x4d4bd4=path['basename'](PATH,_0x4f53('0x20'));var _0x5e1fa5=_0x5f55ef[_0x4f53('0x19')]&&_0x471523[_0x4f53('0x1a')]>0x1;var _0x59c4fe=[];if(!fs[_0x4f53('0x21')](path['join'](_0x295564,_0x4d4bd4))&&_0x5e1fa5){fs[_0x4f53('0x22')](path['join'](_0x295564,_0x4d4bd4));}return BPromise['each'](_0x471523,function(_0x1ee96d){_0x59c4fe[_0x4f53('0x1d')](_0x1ee96d);})[_0x4f53('0x11')](function(){for(var _0x2c9420=0x0;_0x2c9420<_0x59c4fe['length'];_0x2c9420+=0x1){var _0x445abc;var _0x3ea756=_0x59c4fe[_0x2c9420];if(_0x5e1fa5){_0x445abc=path['join'](_0x295564,_0x4d4bd4,util['format']('%s%d.%s',_0x4d4bd4,_0x2c9420,_0x4f53('0x23')));}else{_0x445abc=path[_0x4f53('0x24')](_0x295564,util['format'](_0x4f53('0x25'),_0x4d4bd4,_0x4f53('0x23')));}fs[_0x4f53('0x26')](_0x445abc,json2xls(_0x3ea756),_0x4f53('0x27'));}})[_0x4f53('0x11')](function(){if(_0x5e1fa5){return new Promise(function(_0x5a571b){zipdir(path['join'](_0x295564,_0x4d4bd4),{'saveTo':path['join'](_0x295564,util[_0x4f53('0xd')](_0x4f53('0x25'),_0x4d4bd4,'zip'))},function(_0xefdc5e,_0x33cce4){rimraf(path['join'](_0x295564,_0x4d4bd4),function(){});_0x5a571b(_0x4f53('0x28'));});});}})[_0x4f53('0x11')](function(){logger[_0x4f53('0x29')](util[_0x4f53('0xd')](_0x4f53('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x4f53('0x2b'),_0x5e1fa5?util['format']('%s.%s',_0x4d4bd4,_0x5e1fa5?_0x4f53('0x2c'):'xlsx'):null);});})['catch'](function(_0x3fbc1d){logger[_0x4f53('0x29')](util[_0x4f53('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x4f53('0xe')),util[_0x4f53('0x2d')](_0x3fbc1d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4f53('0x2e'));})['finally'](function(){process[_0x4f53('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb70c=['json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','basename','.xlsx','existsSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash'];(function(_0x26f022,_0x498949){var _0x1e7daf=function(_0x25c15d){while(--_0x25c15d){_0x26f022['push'](_0x26f022['shift']());}};_0x1e7daf(++_0x498949);}(_0xb70c,0x10b));var _0xcb70=function(_0x1d453f,_0x5793a9){_0x1d453f=_0x1d453f-0x0;var _0x50996a=_0xb70c[_0x1d453f];return _0x50996a;};'use strict';var util=require(_0xcb70('0x0'));var path=require(_0xcb70('0x1'));var _=require(_0xcb70('0x2'));var fs=require('fs');var json2xls=require(_0xcb70('0x3'));var BPromise=require(_0xcb70('0x4'));var zipdir=require(_0xcb70('0x5'));var rimraf=require(_0xcb70('0x6'));var db=require(_0xcb70('0x7'))['db'];var dbH=require(_0xcb70('0x7'))['dbH'];var logger=require(_0xcb70('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcb70('0x9')][0x2]);var QUERY=process[_0xcb70('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x479b75,_0x468f77){var _0x49ee24={'status':_0x479b75};var _0x201965={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x468f77){_0x49ee24['savename']=_0x468f77;}return db[_0xcb70('0xa')][_0xcb70('0xb')](_0x49ee24,_0x201965);}function main(){var _0x5f0b8c=0x1388;var _0x3e541c;logger[_0xcb70('0xc')](util[_0xcb70('0xd')](_0xcb70('0xe'),EXTRACTED_REPORT_ID,_0xcb70('0xf')));return db[_0xcb70('0x10')][_0xcb70('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcb70('0x12'),_0xcb70('0x13')]})[_0xcb70('0x14')](function(_0x42d7b2){if(_0x42d7b2){_0x3e541c=_0x42d7b2;_0x5f0b8c=_0x3e541c[_0xcb70('0x13')]||0x1388;}})[_0xcb70('0x14')](function(){return dbH[_0xcb70('0x15')][_0xcb70('0x16')](util[_0xcb70('0xd')](_0xcb70('0x17'),QUERY),{'type':dbH[_0xcb70('0x15')][_0xcb70('0x18')]['SELECT']});})[_0xcb70('0x14')](function(_0x79af3a){if(!_0x79af3a[0x0]['num']){return analyticExtractedReport(_0xcb70('0x19'));}var _0x4d71ab=[];var _0x5561ac=0x0;if(_0x3e541c[_0xcb70('0x12')]){if(_0x79af3a&&_0x79af3a[_0xcb70('0x1a')]){var _0x48cace=_[_0xcb70('0x1b')](_0x79af3a[0x0][_0xcb70('0x1c')]/_0x5f0b8c);var _0x380e1d=Number[_0xcb70('0x1d')](_0x79af3a[0x0][_0xcb70('0x1c')]/_0x5f0b8c)?_0x79af3a[0x0][_0xcb70('0x1c')]%_0x5f0b8c:0x0;_0x48cace[_0xcb70('0x1e')](function(_0x506773){if(_0x506773>0x0){_0x5561ac+=_0x5f0b8c;}_0x4d71ab['push'](dbH[_0xcb70('0x15')][_0xcb70('0x16')](util[_0xcb70('0xd')](_0xcb70('0x1f'),QUERY,_0x5f0b8c,_0x5561ac),{'type':dbH[_0xcb70('0x15')][_0xcb70('0x18')][_0xcb70('0x20')]}));});if(_0x380e1d>0x0){_0x5561ac+=_0x5f0b8c;_0x4d71ab[_0xcb70('0x21')](dbH[_0xcb70('0x15')][_0xcb70('0x16')](util[_0xcb70('0xd')](_0xcb70('0x1f'),QUERY,_0x380e1d,_0x5561ac),{'type':dbH[_0xcb70('0x15')][_0xcb70('0x18')][_0xcb70('0x20')]}));}}}else{_0x4d71ab['push'](dbH['sequelize'][_0xcb70('0x16')](QUERY,{'type':dbH[_0xcb70('0x15')][_0xcb70('0x18')][_0xcb70('0x20')]}));}var _0x61864f=path['dirname'](PATH);var _0x4aaa86=path[_0xcb70('0x22')](PATH,_0xcb70('0x23'));var _0x50bbb3=_0x3e541c[_0xcb70('0x12')]&&_0x4d71ab[_0xcb70('0x1a')]>0x1;var _0x5707e5=[];if(!fs[_0xcb70('0x24')](path[_0xcb70('0x25')](_0x61864f,_0x4aaa86))&&_0x50bbb3){fs['mkdirSync'](path['join'](_0x61864f,_0x4aaa86));}return BPromise[_0xcb70('0x26')](_0x4d71ab,function(_0x61cefc){_0x5707e5[_0xcb70('0x21')](_0x61cefc);})['then'](function(){for(var _0x1e3c10=0x0;_0x1e3c10<_0x5707e5[_0xcb70('0x1a')];_0x1e3c10+=0x1){var _0x1834bb;var _0x5a41a1=_0x5707e5[_0x1e3c10];if(_0x50bbb3){_0x1834bb=path[_0xcb70('0x25')](_0x61864f,_0x4aaa86,util[_0xcb70('0xd')](_0xcb70('0x27'),_0x4aaa86,_0x1e3c10,'xlsx'));}else{_0x1834bb=path[_0xcb70('0x25')](_0x61864f,util[_0xcb70('0xd')](_0xcb70('0x28'),_0x4aaa86,_0xcb70('0x29')));}fs[_0xcb70('0x2a')](_0x1834bb,json2xls(_0x5a41a1),_0xcb70('0x2b'));}})[_0xcb70('0x14')](function(){if(_0x50bbb3){return new Promise(function(_0xd75525){zipdir(path[_0xcb70('0x25')](_0x61864f,_0x4aaa86),{'saveTo':path['join'](_0x61864f,util[_0xcb70('0xd')]('%s.%s',_0x4aaa86,_0xcb70('0x2c')))},function(_0x55f7ce,_0x2e9481){rimraf(path[_0xcb70('0x25')](_0x61864f,_0x4aaa86),function(){});_0xd75525(_0xcb70('0x2d'));});});}})[_0xcb70('0x14')](function(){logger[_0xcb70('0xc')](util[_0xcb70('0xd')](_0xcb70('0x2e'),EXTRACTED_REPORT_ID,_0xcb70('0xf')));return analyticExtractedReport(_0xcb70('0x2f'),_0x50bbb3?util[_0xcb70('0xd')](_0xcb70('0x28'),_0x4aaa86,_0x50bbb3?_0xcb70('0x2c'):_0xcb70('0x29')):null);});})[_0xcb70('0x30')](function(_0x677990){logger[_0xcb70('0xc')](util[_0xcb70('0xd')](_0xcb70('0x31'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xcb70('0x32')](_0x677990,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcb70('0x33'));})[_0xcb70('0x34')](function(){process[_0xcb70('0x35')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 00ef03c..ea9a4f5 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 _0xf0b7=['lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','hasOwnProperty','priority','extensions','find','push','type','Set','format','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','*,*,*,*','interval','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','toLowerCase','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','destroy','bulkCreate','catch','error','rewrite'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0xf0b7,0x8c));var _0x7f0b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf0b7[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7f0b('0x0'));var util=require(_0x7f0b('0x1'));function rewrite(_0x4211a2,_0x337321){var _0x1ba01c=this;return _0x4211a2[_0x7f0b('0x2')][_0x7f0b('0x3')][_0x7f0b('0x4')]({'raw':!![]})[_0x7f0b('0x5')](function(_0x17a0f6){_0x1ba01c[_0x7f0b('0x6')]=_0x17a0f6;return _0x4211a2[_0x7f0b('0x2')][_0x7f0b('0x7')][_0x7f0b('0x4')]({'where':{'IntervalId':_0x337321[_0x7f0b('0x8')]},'raw':!![]});})[_0x7f0b('0x5')](function(_0x30e2da){return _0x4211a2[_0x7f0b('0x2')][_0x7f0b('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x7f0b('0x9')](_[_0x7f0b('0xa')](_0x30e2da,_0x7f0b('0xb')))}},'order':[{'raw':_0x7f0b('0xc')}],'raw':!![]});})[_0x7f0b('0x5')](function(_0x5e060b){var _0xde6ff=_[_0x7f0b('0xd')](_0x5e060b,{'priority':'1'});var _0x3ea95b=_[_0x7f0b('0xd')](_0x5e060b,{'isApp':0x1});var _0x1cfa75=_['groupBy'](_0x3ea95b,_0x7f0b('0xb'));var _0x150256=['queue',_0x7f0b('0xe')];var _0x3d9dbb=[];var _0x59df88=[];for(var _0x256e48 in _0x1cfa75){if(_0x1cfa75[_0x7f0b('0xf')](_0x256e48)){_0x1ba01c[_0x7f0b('0x10')]=0x2;_0x1ba01c[_0x7f0b('0x11')]=[];_0x1ba01c['extension']=_[_0x7f0b('0x12')](_0xde6ff,{'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')]});_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':util[_0x7f0b('0x16')]('CDR(type)=%s',_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')]),'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});if(_0x1cfa75[_0x256e48][0x0]['type']===_0x7f0b('0x19')){_0x1ba01c[_0x7f0b('0x11')]['push']({'type':_0x1cfa75[_0x256e48][0x0]['type'],'app':'Set','appdata':_0x7f0b('0x1a')+_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')],'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});}else if(_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')]===_0x7f0b('0x1b')){if(_0x1ba01c[_0x7f0b('0x1c')]){_0x1ba01c['extensions'][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x1d')+(_0x1ba01c['extension'][_0x7f0b('0x1e')]?_0x7f0b('0x1f')+_0x1ba01c['extension'][_0x7f0b('0x1e')]+'}':_0x7f0b('0x20')),'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});}_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0]['type'],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x1a')+_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')],'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c['priority']++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});var _0x12aa0c=_0x1ba01c['priority']++;_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0]['type'],'app':'ExecIf','appdata':_0x7f0b('0x21')+(_0x12aa0c+0x2)+_0x7f0b('0x22')+(_0x12aa0c+0x1)+')','context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x12aa0c,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});if(_0x1ba01c['extension']){_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':'Set','appdata':_0x1ba01c['extension'][_0x7f0b('0x1e')]?_0x7f0b('0x23')+_0x1ba01c[_0x7f0b('0x1c')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});}_0x1ba01c['extensions'][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':'Set','appdata':_0x7f0b('0x24')+_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')],'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0]['exten'],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});if(_0x1ba01c[_0x7f0b('0x1c')]&&_0x1ba01c[_0x7f0b('0x1c')][_0x7f0b('0xf')](_0x7f0b('0x25'))&&_0x1ba01c[_0x7f0b('0x1c')][_0x7f0b('0x25')]!=='none'){_0x1ba01c['extensions'][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x26'),'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0]['exten'],'priority':_0x1ba01c['priority']++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});_0x1ba01c[_0x7f0b('0x11')]['push']({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x27')+_0x1ba01c[_0x7f0b('0x1c')][_0x7f0b('0x25')]||_0x7f0b('0x28'),'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c['priority']++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});}}_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0]['type'],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x29'),'context':_0x1cfa75[_0x256e48][0x0]['context'],'exten':_0x1cfa75[_0x256e48][0x0]['exten'],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0]['VoiceExtensionId']});_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c[_0x7f0b('0x10')]++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x2a'),'context':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x17')],'exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'priority':_0x1ba01c['priority']++,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});for(var _0x1a1d94=0x0,_0x2b6cd1=0x0;_0x1a1d94<_0x1cfa75[_0x256e48][_0x7f0b('0x2b')];_0x1a1d94+=0x1,_0x2b6cd1=0x0){var _0x5d9c84=_0x1cfa75[_0x256e48][_0x1a1d94];if(_0x5d9c84['type']){_0x5d9c84[_0x7f0b('0x14')]=_0x5d9c84['type']['toLowerCase']();}var _0x53821f=[];var _0x2d1c31=[];delete _0x5d9c84['id'];delete _0x5d9c84[_0x7f0b('0x2c')];delete _0x5d9c84[_0x7f0b('0x2d')];var _0x1ef3c1=_0x5d9c84['interval']!==_0x7f0b('0x2e')?[_0x5d9c84['interval']]:_0x5d9c84[_0x7f0b('0x8')]?_[_0x7f0b('0xa')](_[_0x7f0b('0xd')](_0x1ba01c[_0x7f0b('0x6')],{'IntervalId':_0x5d9c84[_0x7f0b('0x8')]}),_0x7f0b('0x2f')):[];if(_0x5d9c84[_0x7f0b('0xf')](_0x7f0b('0x30'))){if(_0x5d9c84[_0x7f0b('0x30')]&&_0x5d9c84[_0x7f0b('0x30')]!=='--'){_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84['type'],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x31')+_0x5d9c84['tag'],'context':_0x5d9c84['context'],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1['length']+_0x1ba01c[_0x7f0b('0x10')]+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});}}if(_0x5d9c84[_0x7f0b('0x14')]===_0x7f0b('0x1b')&&_0x5d9c84[_0x7f0b('0xf')]('callerID')){if(_0x5d9c84[_0x7f0b('0x32')]){_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84['type'],'app':_0x7f0b('0x33'),'appdata':_0x7f0b('0x34')+_0x5d9c84[_0x7f0b('0x32')]+')','context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84['exten'],'priority':_0x1ef3c1[_0x7f0b('0x2b')]+_0x1ba01c['priority']+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});}else{_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84[_0x7f0b('0x14')],'app':'ExecIf','appdata':_0x7f0b('0x35'),'context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1[_0x7f0b('0x2b')]+_0x1ba01c['priority']+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});}}if(_0x5d9c84[_0x7f0b('0xf')](_0x7f0b('0x36'))){if(_0x150256[_0x7f0b('0x37')](_0x5d9c84[_0x7f0b('0x38')][_0x7f0b('0x39')]())>=0x0&&_0x5d9c84['appType']!=='custom'){if(_0x5d9c84[_0x7f0b('0x36')]){_0x53821f['push']({'type':_0x5d9c84['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1[_0x7f0b('0x2b')]+_0x1ba01c[_0x7f0b('0x10')]+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84[_0x7f0b('0x14')],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x3a'),'context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1[_0x7f0b('0x2b')]+_0x1ba01c[_0x7f0b('0x10')]+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});}else{_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84[_0x7f0b('0x14')],'app':_0x7f0b('0x33'),'appdata':_0x7f0b('0x3b'),'context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1['length']+_0x1ba01c[_0x7f0b('0x10')]+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});_0x53821f[_0x7f0b('0x13')]({'type':_0x5d9c84['type'],'app':_0x7f0b('0x15'),'appdata':_0x7f0b('0x3c'),'context':_0x5d9c84[_0x7f0b('0x17')],'exten':_0x5d9c84[_0x7f0b('0xb')],'priority':_0x1ef3c1[_0x7f0b('0x2b')]+_0x1ba01c['priority']+_0x2b6cd1++,'VoiceExtensionId':_0x5d9c84[_0x7f0b('0x18')]});}}}for(var _0x27b2e2=0x0;_0x27b2e2<_0x1ef3c1['length'];_0x27b2e2+=0x1){var _0x319fd0=_0x1ba01c[_0x7f0b('0x10')]+_0x1ef3c1[_0x7f0b('0x2b')];var _0x2cd120=_0x27b2e2===_0x1ef3c1['length']-0x1?_0x1ba01c[_0x7f0b('0x10')]+_0x53821f[_0x7f0b('0x2b')]+_0x2d1c31[_0x7f0b('0x2b')]+0x2:_0x1ba01c['priority']+_0x27b2e2+0x1;_0x53821f['splice'](_0x27b2e2,0x0,{'type':_0x5d9c84['type'],'app':_0x7f0b('0x3d'),'appdata':_0x1ef3c1[_0x27b2e2]+'?'+_0x5d9c84[_0x7f0b('0x17')]+',${EXTEN},'+_0x319fd0+':'+_0x5d9c84[_0x7f0b('0x17')]+_0x7f0b('0x3e')+_0x2cd120,'exten':_0x5d9c84[_0x7f0b('0xb')],'context':_0x5d9c84[_0x7f0b('0x17')],'priority':_0x1ba01c[_0x7f0b('0x10')]+_0x27b2e2,'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});}_0x5d9c84[_0x7f0b('0x10')]=_0x53821f[_0x7f0b('0x2b')]?_[_0x7f0b('0x3f')](_0x53821f)[_0x7f0b('0x10')]+0x1:_0x1ba01c[_0x7f0b('0x10')];_0x1ba01c[_0x7f0b('0x10')]=(_0x2d1c31[_0x7f0b('0x2b')]?_[_0x7f0b('0x3f')](_0x2d1c31)[_0x7f0b('0x10')]:_0x5d9c84[_0x7f0b('0x10')])+0x1;_0x1ba01c[_0x7f0b('0x11')]=_[_0x7f0b('0x40')](_0x1ba01c['extensions'],_0x53821f,[_0x5d9c84],_0x2d1c31);}_0x1ba01c[_0x7f0b('0x11')][_0x7f0b('0x13')]({'type':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x14')],'app':'Hangup','exten':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0xb')],'context':_0x1cfa75[_0x256e48][0x0]['context'],'priority':_0x1ba01c[_0x7f0b('0x10')],'VoiceExtensionId':_0x1cfa75[_0x256e48][0x0][_0x7f0b('0x18')]});_0x3d9dbb[_0x7f0b('0x13')](_0x1cfa75[_0x256e48][0x0]['VoiceExtensionId']);_0x59df88=_[_0x7f0b('0x40')](_0x59df88,_0x1ba01c['extensions']);}}return _0x4211a2['transaction'](function(_0x8f2274){return _0x4211a2['models'][_0x7f0b('0x7')][_0x7f0b('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x3d9dbb}},'transaction':_0x8f2274})['then'](function(_0x28363a){return _0x4211a2[_0x7f0b('0x2')][_0x7f0b('0x7')][_0x7f0b('0x42')](_['sortBy'](_0x59df88,_0x7f0b('0x10')),{'transaction':_0x8f2274});});});})[_0x7f0b('0x43')](function(_0x949c7d){console[_0x7f0b('0x44')](_0x949c7d);});}exports[_0x7f0b('0x45')]=rewrite; \ No newline at end of file +var _0x25de=['destroy','bulkCreate','catch','error','rewrite','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','type','Set','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','*,*,*,*','interval','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','length','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction'];(function(_0x4e7c09,_0x452405){var _0x5b2f05=function(_0x5d01a8){while(--_0x5d01a8){_0x4e7c09['push'](_0x4e7c09['shift']());}};_0x5b2f05(++_0x452405);}(_0x25de,0xd7));var _0xe25d=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x25de[_0x320b8e];return _0x55a10a;};'use strict';var _=require('lodash');var util=require(_0xe25d('0x0'));function rewrite(_0x20ae04,_0x3d4044){var _0x44504f=this;return _0x20ae04[_0xe25d('0x1')][_0xe25d('0x2')][_0xe25d('0x3')]({'raw':!![]})[_0xe25d('0x4')](function(_0x12c0e3){_0x44504f[_0xe25d('0x5')]=_0x12c0e3;return _0x20ae04[_0xe25d('0x1')]['VoiceExtension'][_0xe25d('0x3')]({'where':{'IntervalId':_0x3d4044[_0xe25d('0x6')]},'raw':!![]});})[_0xe25d('0x4')](function(_0x9f551d){return _0x20ae04[_0xe25d('0x1')][_0xe25d('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xe25d('0x8')](_[_0xe25d('0x9')](_0x9f551d,_0xe25d('0xa')))}},'order':[{'raw':_0xe25d('0xb')}],'raw':!![]});})[_0xe25d('0x4')](function(_0x203114){var _0x5827b6=_[_0xe25d('0xc')](_0x203114,{'priority':'1'});var _0x134138=_['filter'](_0x203114,{'isApp':0x1});var _0x57c571=_[_0xe25d('0xd')](_0x134138,_0xe25d('0xa'));var _0x1b1064=[_0xe25d('0xe'),'playback'];var _0x1f145b=[];var _0x3791fc=[];for(var _0x2f3a67 in _0x57c571){if(_0x57c571[_0xe25d('0xf')](_0x2f3a67)){_0x44504f[_0xe25d('0x10')]=0x2;_0x44504f[_0xe25d('0x11')]=[];_0x44504f[_0xe25d('0x12')]=_[_0xe25d('0x13')](_0x5827b6,{'exten':_0x57c571[_0x2f3a67][0x0]['exten']});_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':util['format']('CDR(type)=%s',_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')]),'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f['priority']++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});if(_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')]===_0xe25d('0x19')){_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0]['type'],'app':_0xe25d('0x16'),'appdata':'CDR(routeid)='+_0x57c571[_0x2f3a67][0x0]['VoiceExtensionId'],'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});}else if(_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')]===_0xe25d('0x1a')){if(_0x44504f[_0xe25d('0x12')]){_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0]['type'],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x1b')+(_0x44504f[_0xe25d('0x12')]['cutdigits']?_0xe25d('0x1c')+_0x44504f[_0xe25d('0x12')][_0xe25d('0x1d')]+'}':'${EXTEN}'),'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0]['exten'],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});}_0x44504f[_0xe25d('0x11')]['push']({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x1e')+_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')],'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0]['exten'],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0]['VoiceExtensionId']});var _0x2ce849=_0x44504f['priority']++;_0x44504f[_0xe25d('0x11')]['push']({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x1f'),'appdata':_0xe25d('0x20')+(_0x2ce849+0x2)+_0xe25d('0x21')+(_0x2ce849+0x1)+')','context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x2ce849,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});if(_0x44504f['extension']){_0x44504f['extensions'][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':'Set','appdata':_0x44504f[_0xe25d('0x12')][_0xe25d('0x1d')]?_0xe25d('0x22')+_0x44504f['extension'][_0xe25d('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0]['exten'],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0]['VoiceExtensionId']});}_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x23')+_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')],'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f['priority']++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});if(_0x44504f['extension']&&_0x44504f[_0xe25d('0x12')]['hasOwnProperty'](_0xe25d('0x24'))&&_0x44504f[_0xe25d('0x12')][_0xe25d('0x24')]!=='none'){_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x25'),'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});_0x44504f[_0xe25d('0x11')][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x26')+_0x44504f[_0xe25d('0x12')]['recordingFormat']||_0xe25d('0x27'),'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0]['exten'],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});}}_0x44504f[_0xe25d('0x11')]['push']({'type':_0x57c571[_0x2f3a67][0x0]['type'],'app':_0xe25d('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});_0x44504f['extensions'][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x28'),'context':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x17')],'exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'priority':_0x44504f[_0xe25d('0x10')]++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});_0x44504f['extensions'][_0xe25d('0x14')]({'type':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x15')],'app':'Set','appdata':_0xe25d('0x29'),'context':_0x57c571[_0x2f3a67][0x0]['context'],'exten':_0x57c571[_0x2f3a67][0x0]['exten'],'priority':_0x44504f['priority']++,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});for(var _0x10a801=0x0,_0x80c077=0x0;_0x10a801<_0x57c571[_0x2f3a67]['length'];_0x10a801+=0x1,_0x80c077=0x0){var _0x50ee66=_0x57c571[_0x2f3a67][_0x10a801];if(_0x50ee66[_0xe25d('0x15')]){_0x50ee66['type']=_0x50ee66['type']['toLowerCase']();}var _0x34bd9f=[];var _0x3a4c2e=[];delete _0x50ee66['id'];delete _0x50ee66[_0xe25d('0x2a')];delete _0x50ee66[_0xe25d('0x2b')];var _0xfc5bcc=_0x50ee66['interval']!==_0xe25d('0x2c')?[_0x50ee66['interval']]:_0x50ee66[_0xe25d('0x6')]?_['map'](_['filter'](_0x44504f[_0xe25d('0x5')],{'IntervalId':_0x50ee66['IntervalId']}),_0xe25d('0x2d')):[];if(_0x50ee66['hasOwnProperty'](_0xe25d('0x2e'))){if(_0x50ee66['tag']&&_0x50ee66[_0xe25d('0x2e')]!=='--'){_0x34bd9f[_0xe25d('0x14')]({'type':_0x50ee66['type'],'app':'Set','appdata':'CDR(tag)='+_0x50ee66[_0xe25d('0x2e')],'context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66['exten'],'priority':_0xfc5bcc['length']+_0x44504f[_0xe25d('0x10')]+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});}}if(_0x50ee66['type']===_0xe25d('0x1a')&&_0x50ee66[_0xe25d('0xf')](_0xe25d('0x2f'))){if(_0x50ee66[_0xe25d('0x2f')]){_0x34bd9f[_0xe25d('0x14')]({'type':_0x50ee66[_0xe25d('0x15')],'app':_0xe25d('0x1f'),'appdata':_0xe25d('0x30')+_0x50ee66['callerID']+')','context':_0x50ee66['context'],'exten':_0x50ee66[_0xe25d('0xa')],'priority':_0xfc5bcc['length']+_0x44504f['priority']+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});}else{_0x34bd9f['push']({'type':_0x50ee66[_0xe25d('0x15')],'app':'ExecIf','appdata':_0xe25d('0x31'),'context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66[_0xe25d('0xa')],'priority':_0xfc5bcc[_0xe25d('0x32')]+_0x44504f[_0xe25d('0x10')]+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});}}if(_0x50ee66[_0xe25d('0xf')](_0xe25d('0x33'))){if(_0x1b1064[_0xe25d('0x34')](_0x50ee66[_0xe25d('0x35')][_0xe25d('0x36')]())>=0x0&&_0x50ee66[_0xe25d('0x37')]!==_0xe25d('0x38')){if(_0x50ee66['answer']){_0x34bd9f[_0xe25d('0x14')]({'type':_0x50ee66['type'],'app':'ExecIf','appdata':_0xe25d('0x39'),'context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66[_0xe25d('0xa')],'priority':_0xfc5bcc[_0xe25d('0x32')]+_0x44504f[_0xe25d('0x10')]+_0x80c077++,'VoiceExtensionId':_0x50ee66['VoiceExtensionId']});_0x34bd9f['push']({'type':_0x50ee66[_0xe25d('0x15')],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x3a'),'context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66[_0xe25d('0xa')],'priority':_0xfc5bcc['length']+_0x44504f['priority']+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});}else{_0x34bd9f[_0xe25d('0x14')]({'type':_0x50ee66[_0xe25d('0x15')],'app':_0xe25d('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66['exten'],'priority':_0xfc5bcc['length']+_0x44504f[_0xe25d('0x10')]+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});_0x34bd9f['push']({'type':_0x50ee66['type'],'app':_0xe25d('0x16'),'appdata':_0xe25d('0x3b'),'context':_0x50ee66[_0xe25d('0x17')],'exten':_0x50ee66[_0xe25d('0xa')],'priority':_0xfc5bcc['length']+_0x44504f[_0xe25d('0x10')]+_0x80c077++,'VoiceExtensionId':_0x50ee66[_0xe25d('0x18')]});}}}for(var _0x531c5d=0x0;_0x531c5d<_0xfc5bcc[_0xe25d('0x32')];_0x531c5d+=0x1){var _0x3c4e0a=_0x44504f[_0xe25d('0x10')]+_0xfc5bcc[_0xe25d('0x32')];var _0x589854=_0x531c5d===_0xfc5bcc[_0xe25d('0x32')]-0x1?_0x44504f[_0xe25d('0x10')]+_0x34bd9f['length']+_0x3a4c2e[_0xe25d('0x32')]+0x2:_0x44504f[_0xe25d('0x10')]+_0x531c5d+0x1;_0x34bd9f[_0xe25d('0x3c')](_0x531c5d,0x0,{'type':_0x50ee66[_0xe25d('0x15')],'app':'GotoIfTime','appdata':_0xfc5bcc[_0x531c5d]+'?'+_0x50ee66['context']+_0xe25d('0x3d')+_0x3c4e0a+':'+_0x50ee66[_0xe25d('0x17')]+_0xe25d('0x3d')+_0x589854,'exten':_0x50ee66[_0xe25d('0xa')],'context':_0x50ee66[_0xe25d('0x17')],'priority':_0x44504f[_0xe25d('0x10')]+_0x531c5d,'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});}_0x50ee66[_0xe25d('0x10')]=_0x34bd9f['length']?_[_0xe25d('0x3e')](_0x34bd9f)[_0xe25d('0x10')]+0x1:_0x44504f[_0xe25d('0x10')];_0x44504f[_0xe25d('0x10')]=(_0x3a4c2e[_0xe25d('0x32')]?_[_0xe25d('0x3e')](_0x3a4c2e)[_0xe25d('0x10')]:_0x50ee66[_0xe25d('0x10')])+0x1;_0x44504f[_0xe25d('0x11')]=_['concat'](_0x44504f[_0xe25d('0x11')],_0x34bd9f,[_0x50ee66],_0x3a4c2e);}_0x44504f[_0xe25d('0x11')]['push']({'type':_0x57c571[_0x2f3a67][0x0]['type'],'app':'Hangup','exten':_0x57c571[_0x2f3a67][0x0][_0xe25d('0xa')],'context':_0x57c571[_0x2f3a67][0x0]['context'],'priority':_0x44504f[_0xe25d('0x10')],'VoiceExtensionId':_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]});_0x1f145b['push'](_0x57c571[_0x2f3a67][0x0][_0xe25d('0x18')]);_0x3791fc=_[_0xe25d('0x3f')](_0x3791fc,_0x44504f[_0xe25d('0x11')]);}}return _0x20ae04[_0xe25d('0x40')](function(_0x9d1c2c){return _0x20ae04['models'][_0xe25d('0x7')][_0xe25d('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x1f145b}},'transaction':_0x9d1c2c})[_0xe25d('0x4')](function(_0x38e65e){return _0x20ae04[_0xe25d('0x1')][_0xe25d('0x7')][_0xe25d('0x42')](_['sortBy'](_0x3791fc,_0xe25d('0x10')),{'transaction':_0x9d1c2c});});});})[_0xe25d('0x43')](function(_0x135206){console[_0xe25d('0x44')](_0x135206);});}exports[_0xe25d('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0d378c1..bda361a 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 _0x2fd3=['find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','\x20=\x20?','into','scheduledAt','cm_contacts','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','VoiceQueue','BlackLists','Campaign','CmList','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','message','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId'];(function(_0x4c39f6,_0xa985ca){var _0x1c0bbe=function(_0x3a2a1f){while(--_0x3a2a1f){_0x4c39f6['push'](_0x4c39f6['shift']());}};_0x1c0bbe(++_0xa985ca);}(_0x2fd3,0x1a0));var _0x32fd=function(_0x1c63d5,_0x2d6023){_0x1c63d5=_0x1c63d5-0x0;var _0x378704=_0x2fd3[_0x1c63d5];return _0x378704;};'use strict';var BPromise=require(_0x32fd('0x0'));var util=require(_0x32fd('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x32fd('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x32fd('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x32fd('0x4'))(_0x32fd('0x5'));config[_0x32fd('0x6')]=_[_0x32fd('0x7')](config[_0x32fd('0x6')],{'host':_0x32fd('0x8'),'port':0x18eb});var socket=require(_0x32fd('0x9'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x32fd('0xa')](socket);try{if(!process[_0x32fd('0xb')][0x2]||process[_0x32fd('0xb')][0x2]===_0x32fd('0xc')||process['argv'][0x2]===_0x32fd('0xd')){throw new Error(_0x32fd('0xe'));}var FILEPATH=process[_0x32fd('0xb')][0x2];if(!process[_0x32fd('0xb')][0x3]||process[_0x32fd('0xb')][0x3]===_0x32fd('0xc')||process[_0x32fd('0xb')][0x3]==='null'||!process[_0x32fd('0xb')][0x4]||process[_0x32fd('0xb')][0x4]===_0x32fd('0xc')||process['argv'][0x4]===_0x32fd('0xd')){throw new Error(_0x32fd('0xf'));}var FIELDS=_[_0x32fd('0x10')](process[_0x32fd('0xb')][0x3]['split'](','),process[_0x32fd('0xb')][0x4][_0x32fd('0x11')](','));if(!process[_0x32fd('0xb')][0x5]||process[_0x32fd('0xb')][0x5]===_0x32fd('0xc')||process[_0x32fd('0xb')][0x5]===_0x32fd('0xd')){throw new Error(_0x32fd('0x12'));}var LISTID=process[_0x32fd('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x32fd('0xb')][0x6]!==_0x32fd('0xc')&&process['argv'][0x6]!=='null'?process[_0x32fd('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x32fd('0xc')&&process[_0x32fd('0xb')][0x7]!==_0x32fd('0xd')?process[_0x32fd('0xb')][0x7]:null;if(!process['argv'][0x8]||process[_0x32fd('0xb')][0x8]==='undefined'||process[_0x32fd('0xb')][0x8]===_0x32fd('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x32fd('0xb')][0x8];}catch(_0x17f31b){logger['error'](_0x17f31b);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(_0x962a2,_0x5b19cc,_0x427670,_0x5bbcf4){var _0x285207={'message':_0x5b19cc};_0x285207[_0x962a2]=!![];if(_0x427670){_0x285207[_0x32fd('0x13')]=_0x427670;}if(_0x5bbcf4){_0x285207[_0x32fd('0x14')]=_0x5bbcf4;}return _0x285207;}function isEmail(_0x1fb67c){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))*$/[_0x32fd('0x15')](_0x1fb67c);}function checkRow(_0x165c17,_0x34a07b,_0x396a2c){return new BPromise(function(_0x139701,_0x561788){if(_[_0x32fd('0x16')](_0x165c17)){return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x32fd('0x18'),null,_0x396a2c));}if(_0x165c17[_0x32fd('0x19')]&&_0x165c17[_0x32fd('0x19')][_0x32fd('0x1a')]){var _0x20bb28=_['map'](_0x165c17['errors'],'message')['join'](';');return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x20bb28,null,_0x396a2c));}var _0x26769e={};for(var _0x4ebe79 in FIELDS){if(FIELDS[_0x32fd('0x1b')](_0x4ebe79)&&FIELDS[_0x4ebe79]){_0x26769e[_0x4ebe79]=_0x165c17[_0x32fd('0x1c')][0x0][FIELDS[_0x4ebe79]]||_0x165c17['data'][0x0]['\ufeff'+FIELDS[_0x4ebe79]];}}if(!_0x26769e['firstName']){return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x32fd('0x1d'),null,_0x396a2c));}if(!_0x26769e[_0x32fd('0x1e')]){return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x32fd('0x1f'),null,_0x396a2c));}if(_0x26769e[_0x32fd('0x20')]){var _0x4fdea3=moment(_0x26769e['birthDate'],_0x32fd('0x21'));if(!_0x4fdea3[_0x32fd('0x22')]()){return _0x561788(handleCheckRowError('error',_0x32fd('0x23'),null,_0x396a2c));}}if(_0x26769e[_0x32fd('0x24')]){if(!isEmail(_0x26769e[_0x32fd('0x24')])){return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x32fd('0x25'),null,_0x396a2c));}}_0x26769e[_0x32fd('0x26')]=LISTID;_0x26769e[_0x32fd('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x32fd('0x1a')]&&_0x34a07b){var _0x3151ac={};for(var _0x42332b=0x0,_0x341905=DUPLICATES[_0x32fd('0x1a')];_0x42332b<_0x341905;_0x42332b+=0x1){_0x3151ac[DUPLICATES[_0x42332b]]=_0x26769e[DUPLICATES[_0x42332b]];}var _0x17ac4c=_[_0x32fd('0x28')](_0x34a07b,_0x3151ac);if(_0x17ac4c){return _0x561788(handleCheckRowError('duplicate',_0x32fd('0x29'),_0x17ac4c,_0x396a2c));}}return db[_0x32fd('0x2a')][_0x32fd('0x2b')](_0x26769e,{'raw':!![],'hooks':![],'fields':_[_0x32fd('0x2c')](_0x26769e)})[_0x32fd('0x2d')](function(_0xd1338a){if(DUPLICATES&&DUPLICATES[_0x32fd('0x1a')]&&_0x34a07b){_0x34a07b[_0x32fd('0x2e')](_[_0x32fd('0x2f')](_0x26769e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xd1338a['id'];return _0x139701();})[_0x32fd('0x30')](function(_0x16edbd){return _0x561788(handleCheckRowError(_0x32fd('0x17'),_0x32fd('0x31')+(_0x16edbd['message']||JSON[_0x32fd('0x32')](_0x16edbd)),null,_0x396a2c));});});}function checkHopper(){function _0x2d61cf(){return function(_0x41affe){logger[_0x32fd('0x17')](_0x32fd('0x33'),_0x32fd('0x34'),util[_0x32fd('0x35')](_0x41affe,{'showHidden':![],'depth':null}));};}var _0x5af040=function(_0x598e24,_0x585b0f){var _0x1e0925=squel[_0x32fd('0x36')]()['into'](_0x32fd('0x37'))[_0x32fd('0x38')]([_0x32fd('0x1e'),'scheduledAt',_0x32fd('0x39'),_0x32fd('0x26'),_0x585b0f,_0x32fd('0x3a'),_0x32fd('0x3b')],squel[_0x32fd('0x3c')]()['field'](_0x32fd('0x1e'),_0x32fd('0x1e'))[_0x32fd('0x3d')]('NOW()','scheduledAt')[_0x32fd('0x3d')]('id','ContactId')[_0x32fd('0x3d')](LISTID[_0x32fd('0x3e')](),_0x32fd('0x26'))['field'](_0x598e24['id'][_0x32fd('0x3e')](),_0x585b0f)[_0x32fd('0x3d')](_0x32fd('0x3f'),'createdAt')[_0x32fd('0x3d')]('NOW()',_0x32fd('0x3b'))[_0x32fd('0x40')]('cm_contacts')[_0x32fd('0x41')](_0x32fd('0x42'))['where'](_0x32fd('0x43'),LISTID[_0x32fd('0x3e')]())[_0x32fd('0x41')]('phone\x20IS\x20NOT\x20NULL')[_0x32fd('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')](_0x32fd('0x1e'))[_0x32fd('0x40')]('cm_hopper')[_0x32fd('0x41')](_0x585b0f+_0x32fd('0x44'),_0x598e24['id'][_0x32fd('0x3e')]())))[_0x32fd('0x3e')]();return _0x1e0925;};var _0x4f650b=function(_0x1cc190,_0x213b23){var _0x473ad1=squel[_0x32fd('0x36')]()[_0x32fd('0x45')](_0x32fd('0x37'))[_0x32fd('0x38')]([_0x32fd('0x1e'),_0x32fd('0x46'),_0x32fd('0x39'),'ListId',_0x213b23,_0x32fd('0x3a'),_0x32fd('0x3b')],squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')](_0x32fd('0x1e'),_0x32fd('0x1e'))[_0x32fd('0x3d')]('NOW()',_0x32fd('0x46'))[_0x32fd('0x3d')]('id','ContactId')['field'](LISTID['toString'](),_0x32fd('0x26'))['field'](_0x1cc190['id'][_0x32fd('0x3e')](),_0x213b23)['field']('NOW()',_0x32fd('0x3a'))[_0x32fd('0x3d')](_0x32fd('0x3f'),_0x32fd('0x3b'))[_0x32fd('0x40')](_0x32fd('0x47'))[_0x32fd('0x41')](_0x32fd('0x42'))[_0x32fd('0x41')](_0x32fd('0x43'),LISTID[_0x32fd('0x3e')]())[_0x32fd('0x41')](_0x32fd('0x48'),squel[_0x32fd('0x49')](hopperContacts))[_0x32fd('0x41')](_0x32fd('0x4a'))[_0x32fd('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')](_0x32fd('0x4b'))['from']('cm_hopper_final')[_0x32fd('0x41')](_0x213b23+_0x32fd('0x44'),_0x1cc190['id']['toString']()))[_0x32fd('0x41')](_0x32fd('0x4c'),squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')](_0x32fd('0x1e'))[_0x32fd('0x40')](_0x32fd('0x37'))['where'](_0x213b23+_0x32fd('0x44'),_0x1cc190['id']['toString']())))[_0x32fd('0x3e')]();return _0x473ad1;};function _0x4f69ee(_0x577406,_0x52fb05){var _0x407091=squel['insert']()['into']('cm_hopper')[_0x32fd('0x38')]([_0x32fd('0x1e'),'scheduledAt',_0x32fd('0x39'),_0x32fd('0x26'),_0x52fb05,_0x32fd('0x3a'),_0x32fd('0x3b')],squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')]('phone',_0x32fd('0x1e'))[_0x32fd('0x3d')](_0x32fd('0x3f'),_0x32fd('0x46'))[_0x32fd('0x3d')]('id',_0x32fd('0x39'))['field'](LISTID['toString'](),'ListId')[_0x32fd('0x3d')](_0x577406['id']['toString'](),_0x52fb05)['field']('NOW()',_0x32fd('0x3a'))[_0x32fd('0x3d')](_0x32fd('0x3f'),_0x32fd('0x3b'))[_0x32fd('0x40')](_0x32fd('0x47'))[_0x32fd('0x41')](_0x32fd('0x42'))[_0x32fd('0x41')](_0x32fd('0x43'),LISTID[_0x32fd('0x3e')]())[_0x32fd('0x41')](_0x32fd('0x48'),squel[_0x32fd('0x49')](hopperContacts))[_0x32fd('0x41')](_0x32fd('0x4a')))[_0x32fd('0x3e')]();return _0x407091;}function _0x324e08(_0x5f5015,_0x1ea782){var _0x330b2e=squel[_0x32fd('0x36')]()[_0x32fd('0x45')](_0x32fd('0x4d'))['fromQuery']([_0x32fd('0x1e'),_0x32fd('0x39'),_0x32fd('0x26'),_0x1ea782,_0x32fd('0x3a'),_0x32fd('0x3b')],squel[_0x32fd('0x3c')]()[_0x32fd('0x3d')]('phone',_0x32fd('0x1e'))[_0x32fd('0x3d')]('id',_0x32fd('0x39'))[_0x32fd('0x3d')](LISTID[_0x32fd('0x3e')](),'ListId')[_0x32fd('0x3d')](_0x5f5015['id'][_0x32fd('0x3e')](),_0x1ea782)[_0x32fd('0x3d')](_0x32fd('0x3f'),_0x32fd('0x3a'))[_0x32fd('0x3d')]('NOW()',_0x32fd('0x3b'))[_0x32fd('0x40')]('cm_contacts')[_0x32fd('0x41')](_0x32fd('0x42'))[_0x32fd('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x32fd('0x48'),squel['str'](hopperContacts))[_0x32fd('0x41')](_0x32fd('0x4a')))[_0x32fd('0x3e')]();return _0x330b2e;}return db['VoiceQueue'][_0x32fd('0x4e')]({'where':{'type':_0x32fd('0x4f')},'attributes':['id',_0x32fd('0x50')],'include':[{'model':db['CmList'],'as':_0x32fd('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x205ba0){var _0x3063d3=[];if(_0x205ba0){var _0x407824;for(var _0x46720a=0x0,_0x32bebd;_0x46720a<_0x205ba0[_0x32fd('0x1a')];_0x46720a+=0x1){_0x32bebd=_0x205ba0[_0x46720a][_0x32fd('0x52')]({'plain':!![]});switch(_0x32bebd[_0x32fd('0x50')]){case _0x32fd('0x53'):_0x3063d3[_0x32fd('0x2e')](db[_0x32fd('0x54')][_0x32fd('0x55')](_0x4f650b(_0x32bebd,'VoiceQueueId'))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));break;case _0x32fd('0x56'):_0x3063d3[_0x32fd('0x2e')](db[_0x32fd('0x54')][_0x32fd('0x55')](_0x5af040(_0x32bebd,_0x32fd('0x57')))[_0x32fd('0x2d')](function(){})['catch'](_0x2d61cf()));break;default:_0x3063d3[_0x32fd('0x2e')](db['sequelize'][_0x32fd('0x55')](_0x4f69ee(_0x32bebd,_0x32fd('0x57')))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));}}}return _0x3063d3;})[_0x32fd('0x58')]()[_0x32fd('0x2d')](function(){return db[_0x32fd('0x59')][_0x32fd('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x32fd('0x5a'),'where':{'id':LISTID}}]})[_0x32fd('0x2d')](function(_0x2049cd){var _0x197646=[];if(_0x2049cd){var _0x3b5a11;for(var _0x189064=0x0,_0x39edf3;_0x189064<_0x2049cd[_0x32fd('0x1a')];_0x189064+=0x1){_0x39edf3=_0x2049cd[_0x189064][_0x32fd('0x52')]({'plain':!![]});_0x197646[_0x32fd('0x2e')](db['sequelize'][_0x32fd('0x55')](_0x324e08(_0x39edf3,_0x32fd('0x57')))[_0x32fd('0x2d')](function(){})['catch'](_0x2d61cf()));}}return _0x197646;})[_0x32fd('0x58')]();})[_0x32fd('0x2d')](function(){return db[_0x32fd('0x5b')][_0x32fd('0x4e')]({'attributes':['id',_0x32fd('0x50')],'include':[{'model':db[_0x32fd('0x5c')],'as':_0x32fd('0x51'),'where':{'id':LISTID}}]})[_0x32fd('0x2d')](function(_0x386030){var _0x524b18=[];if(_0x386030){for(var _0x4e0f1f=0x0,_0x4d687c;_0x4e0f1f<_0x386030[_0x32fd('0x1a')];_0x4e0f1f+=0x1){_0x4d687c=_0x386030[_0x4e0f1f][_0x32fd('0x52')]({'plain':!![]});switch(_0x4d687c['dialCheckDuplicateType']){case _0x32fd('0x53'):_0x524b18[_0x32fd('0x2e')](db[_0x32fd('0x54')]['query'](_0x4f650b(_0x4d687c,_0x32fd('0x5d')))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));break;case _0x32fd('0x56'):_0x524b18[_0x32fd('0x2e')](db[_0x32fd('0x54')][_0x32fd('0x55')](_0x5af040(_0x4d687c,_0x32fd('0x5d')))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));break;default:_0x524b18['push'](db[_0x32fd('0x54')][_0x32fd('0x55')](_0x4f69ee(_0x4d687c,_0x32fd('0x5d')))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));}}}return _0x524b18;})['all']();})[_0x32fd('0x2d')](function(){return db[_0x32fd('0x5b')][_0x32fd('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x32fd('0x5c')],'as':_0x32fd('0x5a'),'where':{'id':LISTID}}]})[_0x32fd('0x2d')](function(_0x4f9569){var _0x44e1bf=[];if(_0x4f9569){for(var _0x5d743d=0x0,_0x249947;_0x5d743d<_0x4f9569[_0x32fd('0x1a')];_0x5d743d+=0x1){_0x249947=_0x4f9569[_0x5d743d][_0x32fd('0x52')]({'plain':!![]});_0x44e1bf[_0x32fd('0x2e')](db['sequelize'][_0x32fd('0x55')](_0x324e08(_0x249947,_0x32fd('0x5d')))[_0x32fd('0x2d')](function(){})[_0x32fd('0x30')](_0x2d61cf()));}}return _0x44e1bf;})['all']();})[_0x32fd('0x30')](function(_0x116569){logger[_0x32fd('0x17')](_0x32fd('0x5e'),_0x32fd('0x5f'),_0x116569[_0x32fd('0x60')]);});}var processPromises=function(_0x241292){return BPromise['all'](promises)[_0x32fd('0x2d')](function(_0x57710f){})[_0x32fd('0x30')](function(_0x4e9b20){logger[_0x32fd('0x17')](_0x32fd('0x61'),JSON[_0x32fd('0x32')](_0x4e9b20));})[_0x32fd('0x62')](function(){socket['emit'](_0x32fd('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x241292){return _0x241292[_0x32fd('0x64')]();}});};var endCsv=function(){return BPromise[_0x32fd('0x65')]()[_0x32fd('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x32fd('0x2d')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x32fd('0x66')](FILEPATH);}catch(_0x1f3f4d){logger['error'](_0x32fd('0x67'),JSON['stringify'](_0x1f3f4d));}finally{process[_0x32fd('0x68')](0x0);}});};process['on'](_0x32fd('0x69'),function(){logger[_0x32fd('0x6a')](_0x32fd('0x6b'));endCsv();});function main(){return BPromise[_0x32fd('0x65')]()[_0x32fd('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x32fd('0x11')](',');return db[_0x32fd('0x2a')][_0x32fd('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x32fd('0x2d')](function(_0x707ff0){var _0x2322eb=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x32fd('0x6c')](_0x2322eb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3922a4,_0x17a39a){total+=0x1;var _0x1c45f4=total;promises['push'](checkRow(_0x3922a4,_0x707ff0,_0x1c45f4)['then'](function(){success+=0x1;})[_0x32fd('0x30')](function(_0x206303){if(_0x206303[_0x32fd('0x17')]){errors+=0x1;delete _0x206303[_0x32fd('0x17')];}else if(_0x206303[_0x32fd('0x6d')]){duplicates+=0x1;delete _0x206303[_0x32fd('0x6d')];}rows[_0x32fd('0x2e')](_0x206303);}));if(total%0xc8===0x0){_0x17a39a[_0x32fd('0x6e')]();return processPromises(_0x17a39a);}},'complete':function(){return processPromises()[_0x32fd('0x2d')](function(){logger[_0x32fd('0x6a')](_0x32fd('0x6f'));endCsv();});},'error':function(_0x132606,_0x46419a){logger[_0x32fd('0x6a')](_0x32fd('0x70'),JSON[_0x32fd('0x32')](_0x132606));endCsv();}});})[_0x32fd('0x30')](function(_0x42248d){logger['error'](_0x32fd('0x71'),JSON[_0x32fd('0x32')](_0x42248d));});}main(); \ No newline at end of file +var _0x98c2=['api','redis','defaults','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','all','always','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger'];(function(_0x1bf89a,_0x2a2949){var _0x198910=function(_0x171142){while(--_0x171142){_0x1bf89a['push'](_0x1bf89a['shift']());}};_0x198910(++_0x2a2949);}(_0x98c2,0xdc));var _0x298c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x98c2[_0xbb091];return _0x467a04;};'use strict';var BPromise=require(_0x298c('0x0'));var util=require('util');var _=require(_0x298c('0x1'));var fs=require('fs');var squel=require(_0x298c('0x2'));var Papa=require(_0x298c('0x3'));var Redis=require(_0x298c('0x4'));var db=require(_0x298c('0x5'))['db'];var config=require(_0x298c('0x6'));var logger=require(_0x298c('0x7'))(_0x298c('0x8'));config[_0x298c('0x9')]=_[_0x298c('0xa')](config[_0x298c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x298c('0xb'))(new Redis(config[_0x298c('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x298c('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x298c('0xd')][0x2]==='undefined'||process[_0x298c('0xd')][0x2]===_0x298c('0xe')){throw new Error(_0x298c('0xf'));}var FILEPATH=process[_0x298c('0xd')][0x2];if(!process[_0x298c('0xd')][0x3]||process[_0x298c('0xd')][0x3]===_0x298c('0x10')||process[_0x298c('0xd')][0x3]==='null'||!process['argv'][0x4]||process[_0x298c('0xd')][0x4]===_0x298c('0x10')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x298c('0x11')](process[_0x298c('0xd')][0x3][_0x298c('0x12')](','),process[_0x298c('0xd')][0x4]['split'](','));if(!process[_0x298c('0xd')][0x5]||process['argv'][0x5]==='undefined'||process['argv'][0x5]===_0x298c('0xe')){throw new Error(_0x298c('0x13'));}var LISTID=process[_0x298c('0xd')][0x5];var COMPANYID=process[_0x298c('0xd')][0x6]&&process[_0x298c('0xd')][0x6]!==_0x298c('0x10')&&process[_0x298c('0xd')][0x6]!==_0x298c('0xe')?process[_0x298c('0xd')][0x6]:null;var DUPLICATES=process[_0x298c('0xd')][0x7]&&process['argv'][0x7]!==_0x298c('0x10')&&process['argv'][0x7]!==_0x298c('0xe')?process[_0x298c('0xd')][0x7]:null;if(!process[_0x298c('0xd')][0x8]||process[_0x298c('0xd')][0x8]===_0x298c('0x10')||process[_0x298c('0xd')][0x8]===_0x298c('0xe')){throw new Error(_0x298c('0x14'));}var SOCKET_TIMESTAMP=process[_0x298c('0xd')][0x8];}catch(_0x22b5c4){logger[_0x298c('0x15')](_0x22b5c4);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(_0x4933c5,_0x3df63b,_0xcaf226,_0x46eb75){var _0x3c8a2d={'message':_0x3df63b};_0x3c8a2d[_0x4933c5]=!![];if(_0xcaf226){_0x3c8a2d['contact']=_0xcaf226;}if(_0x46eb75){_0x3c8a2d[_0x298c('0x16')]=_0x46eb75;}return _0x3c8a2d;}function isEmail(_0x25914d){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))*$/[_0x298c('0x17')](_0x25914d);}function checkRow(_0xb3ccc7,_0x53c7f4,_0x28b36b){return new BPromise(function(_0xaa851c,_0x21127b){if(_['isNil'](_0xb3ccc7)){return _0x21127b(handleCheckRowError('error',_0x298c('0x18'),null,_0x28b36b));}if(_0xb3ccc7[_0x298c('0x19')]&&_0xb3ccc7['errors'][_0x298c('0x1a')]){var _0x389793=_[_0x298c('0x1b')](_0xb3ccc7[_0x298c('0x19')],_0x298c('0x1c'))[_0x298c('0x1d')](';');return _0x21127b(handleCheckRowError(_0x298c('0x15'),_0x389793,null,_0x28b36b));}var _0x226ea8={};for(var _0x4c4360 in FIELDS){if(FIELDS[_0x298c('0x1e')](_0x4c4360)&&FIELDS[_0x4c4360]){_0x226ea8[_0x4c4360]=_0xb3ccc7[_0x298c('0x1f')][0x0][FIELDS[_0x4c4360]]||_0xb3ccc7[_0x298c('0x1f')][0x0]['\ufeff'+FIELDS[_0x4c4360]];}}if(!_0x226ea8['firstName']){return _0x21127b(handleCheckRowError(_0x298c('0x15'),_0x298c('0x20'),null,_0x28b36b));}if(!_0x226ea8[_0x298c('0x21')]){return _0x21127b(handleCheckRowError('error',_0x298c('0x22'),null,_0x28b36b));}if(_0x226ea8[_0x298c('0x23')]){var _0x35537a=moment(_0x226ea8[_0x298c('0x23')],_0x298c('0x24'));if(!_0x35537a[_0x298c('0x25')]()){return _0x21127b(handleCheckRowError('error',_0x298c('0x26'),null,_0x28b36b));}}if(_0x226ea8['email']){if(!isEmail(_0x226ea8[_0x298c('0x27')])){return _0x21127b(handleCheckRowError(_0x298c('0x15'),_0x298c('0x28'),null,_0x28b36b));}}_0x226ea8[_0x298c('0x29')]=LISTID;_0x226ea8[_0x298c('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x298c('0x1a')]&&_0x53c7f4){var _0x2fe800={};for(var _0x5c7df3=0x0,_0x3d6015=DUPLICATES[_0x298c('0x1a')];_0x5c7df3<_0x3d6015;_0x5c7df3+=0x1){_0x2fe800[DUPLICATES[_0x5c7df3]]=_0x226ea8[DUPLICATES[_0x5c7df3]];}var _0x1c04cd=_[_0x298c('0x2b')](_0x53c7f4,_0x2fe800);if(_0x1c04cd){return _0x21127b(handleCheckRowError(_0x298c('0x2c'),_0x298c('0x2d'),_0x1c04cd,_0x28b36b));}}return db[_0x298c('0x2e')][_0x298c('0x2f')](_0x226ea8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x226ea8)})[_0x298c('0x30')](function(_0x53bb68){if(DUPLICATES&&DUPLICATES[_0x298c('0x1a')]&&_0x53c7f4){_0x53c7f4[_0x298c('0x31')](_[_0x298c('0x32')](_0x226ea8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x53bb68['id'];return _0xaa851c();})[_0x298c('0x33')](function(_0x593664){return _0x21127b(handleCheckRowError(_0x298c('0x15'),_0x298c('0x34')+(_0x593664[_0x298c('0x1c')]||JSON[_0x298c('0x35')](_0x593664)),null,_0x28b36b));});});}function checkHopper(){function _0x9222e9(){return function(_0x2a9ecf){logger[_0x298c('0x15')](_0x298c('0x36'),_0x298c('0x37'),util[_0x298c('0x38')](_0x2a9ecf,{'showHidden':![],'depth':null}));};}var _0x6ed99b=function(_0x1a6d9d,_0x3076f5){var _0x3d903c=squel[_0x298c('0x39')]()[_0x298c('0x3a')](_0x298c('0x3b'))[_0x298c('0x3c')](['phone',_0x298c('0x3d'),_0x298c('0x3e'),_0x298c('0x29'),_0x3076f5,'createdAt',_0x298c('0x3f')],squel[_0x298c('0x40')]()[_0x298c('0x41')](_0x298c('0x21'),_0x298c('0x21'))[_0x298c('0x41')](_0x298c('0x42'),_0x298c('0x3d'))[_0x298c('0x41')]('id',_0x298c('0x3e'))['field'](LISTID[_0x298c('0x43')](),'ListId')['field'](_0x1a6d9d['id']['toString'](),_0x3076f5)[_0x298c('0x41')](_0x298c('0x42'),_0x298c('0x44'))[_0x298c('0x41')](_0x298c('0x42'),_0x298c('0x3f'))[_0x298c('0x45')](_0x298c('0x46'))[_0x298c('0x47')](_0x298c('0x48'))[_0x298c('0x47')](_0x298c('0x49'),LISTID['toString']())[_0x298c('0x47')](_0x298c('0x4a'))[_0x298c('0x47')](_0x298c('0x4b'),squel[_0x298c('0x40')]()['field'](_0x298c('0x21'))[_0x298c('0x45')](_0x298c('0x3b'))[_0x298c('0x47')](_0x3076f5+_0x298c('0x4c'),_0x1a6d9d['id'][_0x298c('0x43')]())))['toString']();return _0x3d903c;};var _0xa46fc8=function(_0x5b219b,_0xd9d614){var _0x4af30e=squel[_0x298c('0x39')]()[_0x298c('0x3a')](_0x298c('0x3b'))[_0x298c('0x3c')]([_0x298c('0x21'),'scheduledAt','ContactId','ListId',_0xd9d614,_0x298c('0x44'),_0x298c('0x3f')],squel[_0x298c('0x40')]()['field'](_0x298c('0x21'),_0x298c('0x21'))['field'](_0x298c('0x42'),'scheduledAt')[_0x298c('0x41')]('id',_0x298c('0x3e'))[_0x298c('0x41')](LISTID[_0x298c('0x43')](),_0x298c('0x29'))['field'](_0x5b219b['id']['toString'](),_0xd9d614)[_0x298c('0x41')]('NOW()',_0x298c('0x44'))['field'](_0x298c('0x42'),_0x298c('0x3f'))['from'](_0x298c('0x46'))['where'](_0x298c('0x48'))[_0x298c('0x47')]('ListId\x20=\x20?',LISTID['toString']())[_0x298c('0x47')](_0x298c('0x4d'),squel[_0x298c('0x4e')](hopperContacts))[_0x298c('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0x298c('0x47')](_0x298c('0x4b'),squel[_0x298c('0x40')]()[_0x298c('0x41')](_0x298c('0x4f'))['from'](_0x298c('0x50'))['where'](_0xd9d614+_0x298c('0x4c'),_0x5b219b['id'][_0x298c('0x43')]()))[_0x298c('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x298c('0x40')]()[_0x298c('0x41')](_0x298c('0x21'))[_0x298c('0x45')](_0x298c('0x3b'))[_0x298c('0x47')](_0xd9d614+_0x298c('0x4c'),_0x5b219b['id'][_0x298c('0x43')]())))[_0x298c('0x43')]();return _0x4af30e;};function _0x2a8da1(_0x37f65e,_0x6d1d86){var _0x391b18=squel[_0x298c('0x39')]()[_0x298c('0x3a')](_0x298c('0x3b'))[_0x298c('0x3c')](['phone','scheduledAt',_0x298c('0x3e'),_0x298c('0x29'),_0x6d1d86,_0x298c('0x44'),'updatedAt'],squel[_0x298c('0x40')]()['field']('phone',_0x298c('0x21'))['field']('NOW()',_0x298c('0x3d'))[_0x298c('0x41')]('id','ContactId')[_0x298c('0x41')](LISTID[_0x298c('0x43')](),'ListId')['field'](_0x37f65e['id'][_0x298c('0x43')](),_0x6d1d86)[_0x298c('0x41')](_0x298c('0x42'),_0x298c('0x44'))['field'](_0x298c('0x42'),_0x298c('0x3f'))[_0x298c('0x45')](_0x298c('0x46'))[_0x298c('0x47')](_0x298c('0x48'))[_0x298c('0x47')](_0x298c('0x49'),LISTID['toString']())[_0x298c('0x47')](_0x298c('0x4d'),squel['str'](hopperContacts))[_0x298c('0x47')](_0x298c('0x4a')))[_0x298c('0x43')]();return _0x391b18;}function _0x4395a8(_0x392e3e,_0x219667){var _0x1d3970=squel[_0x298c('0x39')]()[_0x298c('0x3a')](_0x298c('0x51'))[_0x298c('0x3c')]([_0x298c('0x21'),_0x298c('0x3e'),_0x298c('0x29'),_0x219667,_0x298c('0x44'),_0x298c('0x3f')],squel[_0x298c('0x40')]()[_0x298c('0x41')](_0x298c('0x21'),_0x298c('0x21'))[_0x298c('0x41')]('id',_0x298c('0x3e'))[_0x298c('0x41')](LISTID['toString'](),_0x298c('0x29'))['field'](_0x392e3e['id'][_0x298c('0x43')](),_0x219667)[_0x298c('0x41')](_0x298c('0x42'),_0x298c('0x44'))[_0x298c('0x41')](_0x298c('0x42'),'updatedAt')[_0x298c('0x45')](_0x298c('0x46'))[_0x298c('0x47')](_0x298c('0x48'))[_0x298c('0x47')](_0x298c('0x49'),LISTID['toString']())[_0x298c('0x47')](_0x298c('0x4d'),squel[_0x298c('0x4e')](hopperContacts))[_0x298c('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0x298c('0x43')]();return _0x1d3970;}return db[_0x298c('0x52')][_0x298c('0x53')]({'where':{'type':_0x298c('0x54')},'attributes':['id',_0x298c('0x55')],'include':[{'model':db[_0x298c('0x56')],'as':_0x298c('0x57'),'where':{'id':LISTID}}]})[_0x298c('0x30')](function(_0x4a819c){var _0x4f5e16=[];if(_0x4a819c){var _0x53692b;for(var _0x51e42b=0x0,_0x41c052;_0x51e42b<_0x4a819c['length'];_0x51e42b+=0x1){_0x41c052=_0x4a819c[_0x51e42b][_0x298c('0x58')]({'plain':!![]});switch(_0x41c052[_0x298c('0x55')]){case'always':_0x4f5e16['push'](db[_0x298c('0x59')][_0x298c('0x5a')](_0xa46fc8(_0x41c052,_0x298c('0x5b')))['then'](function(){})[_0x298c('0x33')](_0x9222e9()));break;case _0x298c('0x5c'):_0x4f5e16[_0x298c('0x31')](db['sequelize']['query'](_0x6ed99b(_0x41c052,_0x298c('0x5b')))[_0x298c('0x30')](function(){})[_0x298c('0x33')](_0x9222e9()));break;default:_0x4f5e16[_0x298c('0x31')](db[_0x298c('0x59')][_0x298c('0x5a')](_0x2a8da1(_0x41c052,_0x298c('0x5b')))[_0x298c('0x30')](function(){})[_0x298c('0x33')](_0x9222e9()));}}}return _0x4f5e16;})[_0x298c('0x5d')]()[_0x298c('0x30')](function(){return db[_0x298c('0x52')][_0x298c('0x53')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x298c('0x56')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x25db61){var _0x48341c=[];if(_0x25db61){var _0x16267d;for(var _0x259261=0x0,_0x14e2c5;_0x259261<_0x25db61[_0x298c('0x1a')];_0x259261+=0x1){_0x14e2c5=_0x25db61[_0x259261][_0x298c('0x58')]({'plain':!![]});_0x48341c['push'](db[_0x298c('0x59')][_0x298c('0x5a')](_0x4395a8(_0x14e2c5,'VoiceQueueId'))[_0x298c('0x30')](function(){})[_0x298c('0x33')](_0x9222e9()));}}return _0x48341c;})[_0x298c('0x5d')]();})['then'](function(){return db['Campaign'][_0x298c('0x53')]({'attributes':['id',_0x298c('0x55')],'include':[{'model':db[_0x298c('0x56')],'as':_0x298c('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x1dea7e){var _0x14ea0a=[];if(_0x1dea7e){for(var _0x215857=0x0,_0x3c2767;_0x215857<_0x1dea7e[_0x298c('0x1a')];_0x215857+=0x1){_0x3c2767=_0x1dea7e[_0x215857][_0x298c('0x58')]({'plain':!![]});switch(_0x3c2767[_0x298c('0x55')]){case _0x298c('0x5e'):_0x14ea0a['push'](db[_0x298c('0x59')][_0x298c('0x5a')](_0xa46fc8(_0x3c2767,_0x298c('0x5f')))[_0x298c('0x30')](function(){})[_0x298c('0x33')](_0x9222e9()));break;case _0x298c('0x5c'):_0x14ea0a[_0x298c('0x31')](db[_0x298c('0x59')]['query'](_0x6ed99b(_0x3c2767,_0x298c('0x5f')))['then'](function(){})['catch'](_0x9222e9()));break;default:_0x14ea0a[_0x298c('0x31')](db[_0x298c('0x59')][_0x298c('0x5a')](_0x2a8da1(_0x3c2767,_0x298c('0x5f')))['then'](function(){})[_0x298c('0x33')](_0x9222e9()));}}}return _0x14ea0a;})['all']();})[_0x298c('0x30')](function(){return db[_0x298c('0x60')][_0x298c('0x53')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x298c('0x61'),'where':{'id':LISTID}}]})[_0x298c('0x30')](function(_0x9b4a36){var _0x80373d=[];if(_0x9b4a36){for(var _0x1d3c2c=0x0,_0x12d977;_0x1d3c2c<_0x9b4a36[_0x298c('0x1a')];_0x1d3c2c+=0x1){_0x12d977=_0x9b4a36[_0x1d3c2c][_0x298c('0x58')]({'plain':!![]});_0x80373d[_0x298c('0x31')](db[_0x298c('0x59')][_0x298c('0x5a')](_0x4395a8(_0x12d977,'CampaignId'))[_0x298c('0x30')](function(){})[_0x298c('0x33')](_0x9222e9()));}}return _0x80373d;})[_0x298c('0x5d')]();})[_0x298c('0x33')](function(_0x144d95){logger[_0x298c('0x15')](_0x298c('0x62'),'generalCheckHopper',_0x144d95[_0x298c('0x1c')]);});}var processPromises=function(_0x46d94){return BPromise['all'](promises)['then'](function(_0x43514a){})[_0x298c('0x33')](function(_0xce1172){logger[_0x298c('0x15')](_0x298c('0x63'),JSON['stringify'](_0xce1172));})[_0x298c('0x64')](function(){socket[_0x298c('0x65')](_0x298c('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x46d94){return _0x46d94[_0x298c('0x67')]();}});};var endCsv=function(){return BPromise[_0x298c('0x68')]()[_0x298c('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x298c('0x30')](function(){socket[_0x298c('0x65')](_0x298c('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x298c('0x69')](FILEPATH);}catch(_0x404bca){logger[_0x298c('0x15')](_0x298c('0x6a'),JSON[_0x298c('0x35')](_0x404bca));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x298c('0x6b')](_0x298c('0x6c'));endCsv();});function main(){return BPromise[_0x298c('0x68')]()[_0x298c('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x298c('0x12')](',');return db['CmContact'][_0x298c('0x53')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x13fd92){var _0x251a96=fs[_0x298c('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x298c('0x6e')](_0x251a96,{'header':!![],'skipEmptyLines':!![],'step':function(_0x106699,_0x24a9ab){total+=0x1;var _0x385b49=total;promises[_0x298c('0x31')](checkRow(_0x106699,_0x13fd92,_0x385b49)[_0x298c('0x30')](function(){success+=0x1;})[_0x298c('0x33')](function(_0x3f4077){if(_0x3f4077[_0x298c('0x15')]){errors+=0x1;delete _0x3f4077['error'];}else if(_0x3f4077[_0x298c('0x2c')]){duplicates+=0x1;delete _0x3f4077[_0x298c('0x2c')];}rows[_0x298c('0x31')](_0x3f4077);}));if(total%0xc8===0x0){_0x24a9ab[_0x298c('0x6f')]();return processPromises(_0x24a9ab);}},'complete':function(){return processPromises()[_0x298c('0x30')](function(){logger[_0x298c('0x6b')](_0x298c('0x70'));endCsv();});},'error':function(_0x19c1c0,_0x1041ef){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x19c1c0));endCsv();}});})[_0x298c('0x33')](function(_0x1a8e56){logger[_0x298c('0x15')](_0x298c('0x71'),JSON['stringify'](_0x1a8e56));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d2941e0..4d7df04 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 _0xfac3=['cm_hopper_black','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','.CmListId','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','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','timezones','dialTimezone','utcOffset','set','main','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','name','_description','writeFileSync','parse','createReadStream','data','rows','errors','find','replace','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','hasOwnProperty','trim','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','campaigns','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../config/logger','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','findAll','AdditionalPhones','then','length','all','split','push','isNil','CmContactHasItem','findOne','update','updated','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','.CmListId\x20=\x20?'];(function(_0x436625,_0x1a09d8){var _0x4cb48b=function(_0x4261e8){while(--_0x4261e8){_0x436625['push'](_0x436625['shift']());}};_0x4cb48b(++_0x1a09d8);}(_0xfac3,0x7b));var _0x3fac=function(_0x41377,_0xc313a7){_0x41377=_0x41377-0x0;var _0x2cf095=_0xfac3[_0x41377];return _0x2cf095;};'use strict';var fs=require('fs');var path=require(_0x3fac('0x0'));var _=require(_0x3fac('0x1'));var Papa=require('papaparse');var util=require(_0x3fac('0x2'));var BPromise=require(_0x3fac('0x3'));var moment=require(_0x3fac('0x4'));var squel=require(_0x3fac('0x5'));var Redis=require(_0x3fac('0x6'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x3fac('0x7'))('import');config[_0x3fac('0x8')]=_[_0x3fac('0x9')](config[_0x3fac('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fac('0xa'))(new Redis(config[_0x3fac('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x3fac('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x3fac('0xc')](_0x3fac('0xb'));function isEmail(_0x1f3df5){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))*$/[_0x3fac('0xd')](_0x1f3df5);}function selectNotIn(_0x51f92a,_0x4af2dd,_0x2f99ab,_0x31f58d,_0x134f92){return squel[_0x3fac('0xe')]()[_0x3fac('0xf')](_0x3fac('0x10'))[_0x3fac('0x11')](_0x31f58d)['join'](_0x4af2dd,null,_0x4af2dd+_0x3fac('0x12')+_0x31f58d+'.'+_0x2f99ab)[_0x3fac('0x13')](_0x31f58d+'.'+_0x2f99ab+_0x3fac('0x14')+_0x51f92a+'.'+_0x2f99ab)['where'](_0x4af2dd+'.dialCheckDuplicateType\x20IN\x20('+_0x134f92[_0x3fac('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4f0420,_0x683d54){promisesAdditionalPhones=[];return db['CmContact'][_0x3fac('0x16')]({'raw':!![],'attributes':['id',_0x3fac('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x3fac('0x18')](function(_0x15f16a){if(_0x15f16a!==null){var _0x59a8ea=[];for(var _0x2c7db1=0x0;_0x2c7db1<_0x15f16a[_0x3fac('0x19')];_0x2c7db1++){var _0x1a5b1b=_0x15f16a[_0x2c7db1];_0x59a8ea['push'](insertAdditionalPhones(_0x1a5b1b));}}Promise[_0x3fac('0x1a')](_0x59a8ea)[_0x3fac('0x18')](function(){_0x4f0420({'val':0x1});});});});}function insertAdditionalPhones(_0x3266c1){return new Promise(function(_0xce6561,_0x19e538){var _0xa440ab=_0x3266c1[_0x3fac('0x17')];var _0x47571a=_0xa440ab[_0x3fac('0x1b')](';');var _0x33e07a=[];orderBy=0x0;for(var _0x2caed4=0x0;_0x2caed4<_0x47571a[_0x3fac('0x19')];_0x2caed4++){_0x33e07a[_0x3fac('0x1c')](splitAdditionalPhone(_0x3266c1['id'],_0x47571a[_0x2caed4]));}Promise[_0x3fac('0x1a')](_0x33e07a)['then'](function(){_0xce6561({'val':_0x47571a[_0x3fac('0x19')]});});});}function splitAdditionalPhone(_0x2dae58,_0x28d018){return new Promise(function(_0x4c9f19,_0x3d147b){var _0x2683ea=_0x28d018[_0x3fac('0x1b')](':');var _0x4ef561=_0x2683ea[0x0];var _0x4c9559=_0x2683ea[0x1];if(!_[_0x3fac('0x1d')](_0x4c9559)){var _0x4ca421=_0x4c9559['split']('|');var _0x55cf72=[];for(var _0x4905ec=0x0;_0x4905ec<_0x4ca421[_0x3fac('0x19')];_0x4905ec++){if(_0x4ca421[_0x4905ec]!==''){var _0x3bbce5=_['filter'](promisesAdditionalPhones,{'contactId':_0x2dae58,'phone':_0x4ca421[_0x4905ec]});if(_0x3bbce5[_0x3fac('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x3fac('0x1c')]({'contactId':_0x2dae58,'contactTypeId':_0x4ef561,'phone':_0x4ca421[_0x4905ec],'orderBy':orderBy});}}}_0x4c9f19({'ok':0x1});}else _0x4c9f19({'res':0x0});});}function createAdditionalPhone(_0x6dcf2e,_0x3e7dc7,_0x3fdcc0,_0x14a008){var _0x95047b='';var _0x5befeb='';var _0x1cf9de=_0x3fdcc0[_0x3fac('0x1b')]('§');_0x95047b=_0x1cf9de[0x0];if(_0x1cf9de[_0x3fac('0x19')]==0x2)_0x5befeb=_0x1cf9de[0x1];return new Promise(function(_0x2c1787,_0x30499d){return db[_0x3fac('0x1e')][_0x3fac('0x1f')]({'where':{'CmContactId':_0x6dcf2e,'item':_0x95047b}})[_0x3fac('0x18')](function(_0x40ce50){if(_0x40ce50){return db[_0x3fac('0x1e')][_0x3fac('0x20')]({'ItemTypeId':_0x3e7dc7,'description':_0x5befeb,'OrderBy':_0x14a008},{'where':{'CmContactId':_0x6dcf2e,'item':_0x95047b}})[_0x3fac('0x18')](function(_0x5be822){_0x2c1787({'res':_0x3fac('0x21')});});}else{return db[_0x3fac('0x1e')]['create']({'CmContactId':_0x6dcf2e,'item':_0x95047b,'description':_0x5befeb,'ItemTypeId':_0x3e7dc7,'OrderBy':_0x14a008,'ItemClass':_0x3fac('0x22')})[_0x3fac('0x18')](function(_0x174895){_0x2c1787({'res':'inserted'});});}});});}function insertCmHopper(_0x4f693e,_0x4ba1a7,_0x3887df,_0x9fbd21,_0x502a4e){var _0x2c5c28=[_0x3fac('0x23'),_0x3fac('0x24'),_0x3fac('0x25'),_0x3fac('0x26'),_0x4ba1a7+'.'+_0x9fbd21,'cm_contacts.createdAt',_0x3fac('0x27'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x502a4e+'\x22'];return squel[_0x3fac('0x28')]()[_0x3fac('0x29')](_0x3fac('0x2a'))[_0x3fac('0x2b')]([_0x3fac('0x10'),'scheduledat',_0x3fac('0x2c'),_0x3fac('0x2d'),_0x9fbd21,_0x3fac('0x2e'),_0x3fac('0x2f'),_0x3fac('0x30'),_0x3fac('0x31'),_0x3fac('0x32')],squel['select']()[_0x3fac('0x33')](_0x2c5c28)[_0x3fac('0x11')](_0x4ba1a7)[_0x3fac('0x15')](_0x3fac('0x34'),null,_0x3fac('0x35')+_0x4ba1a7+'.CmListId')[_0x3fac('0x15')](_0x3887df,null,_0x3887df+_0x3fac('0x12')+_0x4ba1a7+'.'+_0x9fbd21)[_0x3fac('0x13')](_0x4ba1a7+'.CmListId\x20=\x20?',_0x4f693e)[_0x3fac('0x13')](_0x3fac('0x36'),NOW)[_0x3fac('0x13')](_0x3fac('0x37'),selectNotIn(_0x4ba1a7,_0x3887df,_0x9fbd21,_0x3fac('0x2a'),[_0x3fac('0x38'),_0x3fac('0x39')]))[_0x3fac('0x13')](_0x3fac('0x37'),selectNotIn(_0x4ba1a7,_0x3887df,_0x9fbd21,_0x3fac('0x2a'),['\x22always\x22'])))[_0x3fac('0x3a')]();}function insertCmHopperBlack(_0x1f374c,_0x2285d2,_0x51422e,_0x4bd457){var _0x2e3e2b=[_0x3fac('0x23'),_0x3fac('0x25'),_0x3fac('0x26'),_0x2285d2+'.'+_0x4bd457,_0x3fac('0x3b'),_0x3fac('0x27')];return squel[_0x3fac('0x28')]()['into']('cm_hopper_black')[_0x3fac('0x2b')]([_0x3fac('0x10'),'ContactId',_0x3fac('0x2d'),_0x4bd457,_0x3fac('0x2e'),_0x3fac('0x2f')],squel[_0x3fac('0xe')]()['fields'](_0x2e3e2b)['from'](_0x2285d2)['join'](_0x3fac('0x34'),null,_0x3fac('0x35')+_0x2285d2+'.CmListId')[_0x3fac('0x15')](_0x51422e,null,_0x51422e+'.id\x20=\x20'+_0x2285d2+'.'+_0x4bd457)[_0x3fac('0x13')](_0x2285d2+_0x3fac('0x3c'),_0x1f374c)['where'](_0x3fac('0x36'),NOW)[_0x3fac('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x3fac('0xe')]()[_0x3fac('0xf')](_0x3fac('0x10'))['from'](_0x3fac('0x3d'))[_0x3fac('0x13')](_0x3fac('0x3e'),_0x1f374c)[_0x3fac('0x13')](_0x4bd457+_0x3fac('0x14')+_0x2285d2+'.'+_0x4bd457)))[_0x3fac('0x3a')]();}function insertTzCmHopper(_0x2bad3c,_0xcf6924,_0x226866,_0xf8d261,_0x27d682,_0x5a6834){var _0x48efb2=[_0x3fac('0x23'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x5a6834+_0x3fac('0x3f'),'cm_contacts.id',_0x3fac('0x26'),_0xcf6924+'.'+_0xf8d261,'cm_contacts.createdAt',_0x3fac('0x27'),'cm_contacts.priority',_0x3fac('0x40'),'\x22'+_0x27d682+'\x22'];var _0x59cd62=squel[_0x3fac('0x28')]()[_0x3fac('0x29')](_0x3fac('0x2a'))[_0x3fac('0x2b')](['phone','scheduledat',_0x3fac('0x2c'),_0x3fac('0x2d'),_0xf8d261,'createdAt',_0x3fac('0x2f'),_0x3fac('0x30'),_0x3fac('0x31'),_0x3fac('0x32')],squel['select']()[_0x3fac('0x33')](_0x48efb2)[_0x3fac('0x11')](_0xcf6924)[_0x3fac('0x15')](_0x3fac('0x34'),null,_0x3fac('0x35')+_0xcf6924+_0x3fac('0x41'))[_0x3fac('0x15')](_0x226866,null,_0x226866+_0x3fac('0x12')+_0xcf6924+'.'+_0xf8d261)['join'](_0x5a6834,null,_0x5a6834+_0x3fac('0x12')+_0xcf6924+'.'+_0xf8d261)['where'](_0xcf6924+_0x3fac('0x3c'),_0x2bad3c)[_0x3fac('0x13')](_0x3fac('0x36'),NOW)[_0x3fac('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xcf6924,_0x226866,_0xf8d261,'cm_hopper',[_0x3fac('0x38'),_0x3fac('0x39')]))[_0x3fac('0x13')](_0x3fac('0x37'),selectNotIn(_0xcf6924,_0x226866,_0xf8d261,_0x3fac('0x2a'),[_0x3fac('0x38')])))[_0x3fac('0x3a')]();return _0x59cd62;}function insertTzCmHopperBlack(_0x2338a3,_0x44f0a7,_0x403049,_0x1230af){var _0x2675b3=[_0x3fac('0x23'),'cm_contacts.id','cm_contacts.ListId',_0x44f0a7+'.'+_0x1230af,_0x3fac('0x3b'),_0x3fac('0x27')];return squel[_0x3fac('0x28')]()[_0x3fac('0x29')]('cm_hopper_black')[_0x3fac('0x2b')](['phone',_0x3fac('0x2c'),'ListId',_0x1230af,'createdAt',_0x3fac('0x2f')],squel[_0x3fac('0xe')]()['fields'](_0x2675b3)['from'](_0x44f0a7)[_0x3fac('0x15')](_0x3fac('0x34'),null,_0x3fac('0x35')+_0x44f0a7+'.CmListId')[_0x3fac('0x15')](_0x403049,null,_0x403049+'.id\x20=\x20'+_0x44f0a7+'.'+_0x1230af)[_0x3fac('0x13')](_0x44f0a7+'.CmListId\x20=\x20?',_0x2338a3)[_0x3fac('0x13')](_0x3fac('0x36'),NOW)['where'](_0x3fac('0x37'),squel['select']()[_0x3fac('0xf')](_0x3fac('0x10'))[_0x3fac('0x11')](_0x3fac('0x3d'))[_0x3fac('0x13')](_0x3fac('0x3e'),_0x2338a3)[_0x3fac('0x13')](_0x1230af+'\x20=\x20'+_0x44f0a7+'.'+_0x1230af)))[_0x3fac('0x3a')]();}function insertCmHopperAdditionalPhones(_0x59e2fe){var _0x12f93f=[_0x3fac('0x42'),'cm_contact_has_items.item',_0x3fac('0x43'),'cm_contact_has_items.createdAt',_0x3fac('0x44')];return squel[_0x3fac('0x28')]()[_0x3fac('0x29')]('cm_hopper_additional_phones')[_0x3fac('0x2b')](['CmHopperId','phone',_0x3fac('0x45'),_0x3fac('0x2e'),_0x3fac('0x2f')],squel[_0x3fac('0xe')]()[_0x3fac('0x33')](_0x12f93f)[_0x3fac('0x11')](_0x3fac('0x2a'))[_0x3fac('0x15')](_0x3fac('0x34'),null,_0x3fac('0x46'))[_0x3fac('0x15')](_0x3fac('0x47'),null,_0x3fac('0x48'))[_0x3fac('0x13')](_0x3fac('0x49'),_0x59e2fe)[_0x3fac('0x13')](_0x3fac('0x36'),NOW))[_0x3fac('0x3a')]();}function insertCmContact(_0x1e31cc,_0x13774d,_0x4fd167,_0x4a5223){var _0x5c58e1=_[_0x3fac('0x4a')](_[_0x3fac('0x4b')](_0x4a5223),[_0x3fac('0x2d'),_0x3fac('0x4c'),'createdAt',_0x3fac('0x2f')]);return squel[_0x3fac('0x28')]()[_0x3fac('0x29')](_0x3fac('0x34'))[_0x3fac('0x2b')](_0x5c58e1,squel[_0x3fac('0xe')]()[_0x3fac('0x33')](_0x5c58e1)['from'](_0x13774d)[_0x3fac('0x13')]('('+_0x4fd167[_0x3fac('0x15')](',')+_0x3fac('0x4d'),squel['select']()[_0x3fac('0x33')](_0x4fd167)[_0x3fac('0x11')](_0x3fac('0x34'))[_0x3fac('0x13')](_0x3fac('0x3e'),_0x1e31cc)[_0x3fac('0x13')](_0x3fac('0x4e')))['where'](_0x3fac('0x4f'),squel['select']()[_0x3fac('0xf')](_0x3fac('0x50'),_0x3fac('0x51'))[_0x3fac('0x11')](_0x13774d)[_0x3fac('0x52')](_0x4fd167[_0x3fac('0x15')](','))))[_0x3fac('0x3a')]();}function handleStop(){logger[_0x3fac('0x53')](_0x3fac('0x54'));stopped=!![];}function handleUncaughtException(_0x4b8ffb){logger[_0x3fac('0x55')](_0x4b8ffb[_0x3fac('0x56')]);process[_0x3fac('0x57')](0x1);}function handleError(_0x2cc1cd,_0x74335d){stats['errors'][_0x3fac('0x1c')]({'name':_0x74335d[_0x3fac('0x58')],'message':_0x74335d[_0x3fac('0x56')],'row':_0x2cc1cd});}function handleQuery(_0x900d71){logger[_0x3fac('0x53')](_0x900d71);return db[_0x3fac('0x59')][_0x3fac('0x5a')](_0x900d71)[_0x3fac('0x5b')](function(_0x36a2cf){results[_0x3fac('0x1c')](_0x36a2cf);})[_0x3fac('0x5c')](function(_0x4ba27b){logger[_0x3fac('0x55')](_0x4ba27b['message']);});}function updateTzCampaigns(_0x269020){return new Promise(function(_0x3d246d,_0x5b20b0){var _0x39d08a=squel[_0x3fac('0xe')]()[_0x3fac('0x33')]([_0x3fac('0x5d'),_0x3fac('0x5e')])['from']('campaigns')[_0x3fac('0x15')](_0x3fac('0x5f'),null,_0x3fac('0x60'))[_0x3fac('0x13')](_0x3fac('0x61')+_0x269020);db[_0x3fac('0x59')]['query'](_0x39d08a['toString']())['spread'](function(_0x4ef415){var _0xb76145=[];for(var _0x201692=0x0;_0x201692<_0x4ef415['length'];_0x201692++){_0xb76145[_0x3fac('0x1c')](getTimezoneData(_0x4ef415[_0x201692],tmp_campaigns));}BPromise[_0x3fac('0x1a')](_0xb76145)[_0x3fac('0x18')](function(){_0x3d246d({'val':0x1});});})[_0x3fac('0x5c')](function(_0x5cc126){logger[_0x3fac('0x55')](_0x5cc126[_0x3fac('0x56')]);_0x3d246d({'val':0x0});});});}function updateTzVoiceQueues(_0x76bc){return new Promise(function(_0x10ef56,_0x5753c4){var _0x162b89=squel[_0x3fac('0xe')]()[_0x3fac('0x33')]([_0x3fac('0x62'),_0x3fac('0x63')])[_0x3fac('0x11')](_0x3fac('0x64'))[_0x3fac('0x15')](_0x3fac('0x65'),null,_0x3fac('0x66'))['where']('voice_queues_has_cm_lists.CmListId='+_0x76bc);db[_0x3fac('0x59')][_0x3fac('0x5a')](_0x162b89['toString']())[_0x3fac('0x5b')](function(_0x17eb36){var _0x2f13f4=[];for(var _0x251465=0x0;_0x251465<_0x17eb36[_0x3fac('0x19')];_0x251465++){_0x2f13f4[_0x3fac('0x1c')](getTimezoneData(_0x17eb36[_0x251465],tmp_voice_queues));}BPromise[_0x3fac('0x1a')](_0x2f13f4)[_0x3fac('0x18')](function(){_0x10ef56({'val':0x1});});})['catch'](function(_0x3b7a42){logger[_0x3fac('0x55')](_0x3b7a42['message']);_0x10ef56({'val':0x0});});});}function getTimezoneData(_0x1662c1,_0x434e32){return new Promise(function(_0x7979b5,_0x2a2002){var _0x1c60a1=shared[_0x3fac('0x67')];var _0x4fd308=_0x1c60a1[_0x1662c1[_0x3fac('0x68')]];if(_[_0x3fac('0x1d')](_0x4fd308)){_0x7979b5({'ret':0x1});}else{var _0x5a19da=_0x4fd308[_0x3fac('0x69')];var _0x7d5443=squel[_0x3fac('0x28')]()[_0x3fac('0x29')](_0x434e32)[_0x3fac('0x6a')]('id',_0x1662c1['id'])['set']('offset',_0x5a19da)[_0x3fac('0x6a')](_0x3fac('0x68'),_0x1662c1[_0x3fac('0x68')])[_0x3fac('0x3a')]();return db[_0x3fac('0x59')][_0x3fac('0x5a')](_0x7d5443)[_0x3fac('0x5b')](function(_0x20e0ba){_0x7979b5({'ret':0x1});})[_0x3fac('0x5c')](function(_0x455b14){logger[_0x3fac('0x55')](_0x455b14[_0x3fac('0x56')]);_0x2a2002({'ret':0x1});});}});}function handleTZQuery(_0x31b39d){logger['info'](_0x31b39d);return db['sequelize'][_0x3fac('0x5a')](_0x31b39d)[_0x3fac('0x5b')](function(_0x42d8bb){})[_0x3fac('0x5c')](function(_0x3f1ab5){logger['error'](_0x3f1ab5[_0x3fac('0x56')]);});}function main(_0x4708cf,_0x22bf77,_0x1885d8,_0x561aee){logger[_0x3fac('0x53')](_0x3fac('0x6b'),_0x4708cf,JSON['stringify'](_0x22bf77));process[_0x3fac('0x6c')](_0x3fac('0x6d'));var _0x5accfc=_0x22bf77[_0x3fac('0x6e')];var _0x5da857=_[_0x3fac('0x6f')](_0x5accfc);var _0xdff13d=_0x22bf77[_0x3fac('0x70')];var _0x47f9a9=path[_0x3fac('0x15')](config[_0x3fac('0x71')],_0x3fac('0x72'),_0xdff13d+_0x3fac('0x73'));hasTZ=_['keys'](_0x5accfc)[_0x3fac('0x74')]('dialTimezone');var _0x33557d=_['keys'](_0x5accfc)[_0x3fac('0x15')]();logger[_0x3fac('0x53')](_0x3fac('0x75'),_0x33557d);db['ContactItemType'][_0x3fac('0x16')]({'raw':!![],'attributes':['id',_0x3fac('0x76')]})['then'](function(_0x25f86c){for(var _0xdab322=0x0;_0xdab322<_0x25f86c['length'];_0xdab322++){if(_0x25f86c[_0xdab322][_0x3fac('0x76')]in _0x5accfc){contactItemTypes[_0x3fac('0x1c')](_0x25f86c[_0xdab322]);delete _0x5da857[_0x25f86c[_0xdab322]['name']];hasAdditionalPhones=!![];}for(var _0x5e11e1 in _0x5accfc){if(_0x25f86c[_0xdab322][_0x3fac('0x76')]+_0x3fac('0x77')===_0x5e11e1){phoneDescriptions[_0x3fac('0x1c')]({'itemTypeId':_0x25f86c[_0xdab322]['id'],'description':_0x5e11e1});delete _0x5da857[_0x5e11e1];}}}if(hasAdditionalPhones)_0x5da857[_0x3fac('0x17')]='';var _0x4b0096=_['keys'](_0x5da857)[_0x3fac('0x15')]();logger[_0x3fac('0x53')](_0x3fac('0x75'),_0x4b0096);fs[_0x3fac('0x78')](_0x47f9a9,_0x4b0096+'\x0a');Papa[_0x3fac('0x79')](fs[_0x3fac('0x7a')](_0x4708cf),{'header':!![],'skipEmptyLines':!![],'step':function(_0x185db3,_0x5a16b1){try{for(var _0x22f5ac=0x0,_0x1250e6=[];_0x22f5ac<_0x185db3[_0x3fac('0x7b')][_0x3fac('0x19')];_0x22f5ac++){stats[_0x3fac('0x7c')]+=0x1;if(_0x185db3[_0x3fac('0x7d')][_0x22f5ac]){handleError(_0x185db3[_0x3fac('0x7b')][_0x22f5ac],_0x185db3[_0x3fac('0x7d')][_0x22f5ac]);}else{var _0x204a1d=[];var _0x52ee95=[];var _0x329f3={};for(var _0x58f384 in _0x5accfc){let _0x1309f0=contactItemTypes[_0x3fac('0x7e')](_0x317262=>_0x317262[_0x3fac('0x76')]===_0x58f384);let _0x3794ba=contactItemTypes[_0x3fac('0x7e')](_0x524356=>_0x524356[_0x3fac('0x76')]+_0x3fac('0x77')===_0x58f384);if(_[_0x3fac('0x1d')](_0x1309f0)&&_[_0x3fac('0x1d')](_0x3794ba)){if(_0x5accfc['hasOwnProperty'](_0x58f384)){if(_0x185db3[_0x3fac('0x7b')][_0x22f5ac][_0x5accfc[_0x58f384]]){var _0x194ebe=_['trim'](_0x185db3['data'][_0x22f5ac][_0x5accfc[_0x58f384]][_0x3fac('0x7f')](/"/g,'\x27'));switch(_0x58f384){case _0x3fac('0x80'):var _0x197ed7=moment(_0x194ebe,_0x3fac('0xb'),!![]);if(_0x197ed7['isValid']()){_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');}else{_0x204a1d[_0x3fac('0x1c')](_0x3fac('0x81'));}break;case _0x3fac('0x30'):var _0x2da53a=parseInt(_0x194ebe);_0x194ebe=_[_0x3fac('0x82')](_0x2da53a)||_0x2da53a<0x0||_0x2da53a>0x4?_0x561aee?0x3:0x2:_0x2da53a;_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');break;case _0x3fac('0x31'):var _0x29c95a=parseInt(_0x194ebe);if(_[_0x3fac('0x83')](_0x29c95a)&&_[_0x3fac('0x74')](_0x1885d8,_0x29c95a)){_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x29c95a+'\x22');}else{_0x204a1d[_0x3fac('0x1c')](_0x3fac('0x84'));}break;case _0x3fac('0x85'):if(isEmail(_0x194ebe)){_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');}else{_0x204a1d['push'](_0x3fac('0x86'));}break;case _0x3fac('0x87'):var _0x4d93ad=moment(_0x194ebe,_0x3fac('0x88'),!![]);if(_0x4d93ad['isValid']()){_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');}else{_0x204a1d[_0x3fac('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x2a6a3e=shared[_0x3fac('0x67')];var _0x1c7c55=_0x2a6a3e[_0x194ebe];if(!_[_0x3fac('0x1d')](_0x1c7c55)){var _0x11d9ae=_0x1c7c55[_0x3fac('0x69')];_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x11d9ae+'\x22');}break;default:_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x194ebe+'\x22');}}else{switch(_0x58f384){case'firstName':case _0x3fac('0x10'):_0x204a1d[_0x3fac('0x1c')](_0x58f384+_0x3fac('0x89'));break;default:_0x1250e6['push']('\x22\x22');}}}}else{var _0x4ea229='';if(!_[_0x3fac('0x1d')](_0x1309f0)){if(!_0x329f3[_0x3fac('0x8a')](_0x1309f0['id'])){if(!_['isNil'](_0x185db3[_0x3fac('0x7b')][_0x22f5ac][_0x5accfc[_0x58f384]])){var _0x194ebe=_[_0x3fac('0x8b')](_0x185db3['data'][_0x22f5ac][_0x5accfc[_0x58f384]]['replace'](/"/g,'\x27'));var _0x4894c1=phoneDescriptions[_0x3fac('0x7e')](_0x5b5b83=>_0x5b5b83[_0x3fac('0x8c')]===_0x1309f0['id']);if(!_[_0x3fac('0x1d')](_0x4894c1)){var _0x39a912=_[_0x3fac('0x8b')](_0x185db3[_0x3fac('0x7b')][_0x22f5ac][_0x5accfc[_0x4894c1[_0x3fac('0x8d')]]][_0x3fac('0x7f')](/"/g,'\x27'));if(!_[_0x3fac('0x1d')](_0x39a912))_0x194ebe=_0x194ebe+'§'+_0x39a912;}if(_0x4ea229=='')_0x4ea229=_0x194ebe;else _0x4ea229+='|'+_0x194ebe;}_0x52ee95[_0x3fac('0x1c')](_0x1309f0['id']+':'+_0x4ea229);_0x329f3[_0x1309f0['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1250e6[_0x3fac('0x1c')]('\x22'+_0x52ee95[_0x3fac('0x15')](';')+'\x22');}if(_0x204a1d[_0x3fac('0x19')]){handleError(_0x185db3[_0x3fac('0x7b')][_0x22f5ac],{'code':_0x3fac('0x8e'),'message':_0x204a1d['join']()});}else{fs[_0x3fac('0x8f')](_0x47f9a9,_0x1250e6[_0x3fac('0x15')]()+'\x0a');}_0x1250e6=[];}if(!(stats[_0x3fac('0x7c')]%0xc8)){socket[_0x3fac('0x90')](_0x3fac('0x91')+_0xdff13d,stats);stats['errors']=[];}}if(stopped){logger[_0x3fac('0x53')](_0x3fac('0x92'));_0x5a16b1[_0x3fac('0x93')]();}}catch(_0x152b0c){handleError(_0x185db3[_0x3fac('0x7b')][_0x22f5ac],{'code':_0x3fac('0x94'),'message':_0x152b0c['message']});logger[_0x3fac('0x55')]('step',_0x152b0c[_0x3fac('0x56')]);}},'complete':function(){try{var _0x342747=[];var _0x1522f0=[];var _0x54db0d='cm_contacts';if(_0x22bf77['duplicates']&&_0x22bf77['duplicates']['length']){_0x54db0d=_0x3fac('0x95')+_0xdff13d;_0x342747[_0x3fac('0x1c')](_0x3fac('0x96')+_0x54db0d+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x3fac('0x97')+_0xdff13d;tmp_voice_queues=_0x3fac('0x98')+_0xdff13d;_0x1522f0[_0x3fac('0x1c')](_0x3fac('0x96')+tmp_campaigns+_0x3fac('0x99'));_0x1522f0[_0x3fac('0x1c')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x3fac('0x99'));BPromise[_0x3fac('0x9a')](_0x1522f0,handleTZQuery)[_0x3fac('0x18')](function(_0x26c3ba){updateTzCampaigns(_0x22bf77[_0x3fac('0x2d')])[_0x3fac('0x18')](function(_0x282861){updateTzVoiceQueues(_0x22bf77[_0x3fac('0x2d')])[_0x3fac('0x18')](function(_0x4863ab){if(hasTZ)_0x4b0096=_0x4b0096['replace'](_0x3fac('0x68'),_0x3fac('0x9b'));var _0x5c1de6=util[_0x3fac('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x47f9a9,_0x54db0d,_0x4b0096,_0x22bf77[_0x3fac('0x2d')],_0x22bf77['CompanyId']||null,NOW,NOW);if(_[_0x3fac('0x1d')](_0x5accfc['scheduledat'])){_0x5c1de6+=_0x3fac('0x9c');}_0x342747[_0x3fac('0x1c')](_0x5c1de6);if(_0x22bf77[_0x3fac('0x9d')]&&_0x22bf77['duplicates'][_0x3fac('0x19')]){_0x342747[_0x3fac('0x1c')](insertCmContact(_0x22bf77[_0x3fac('0x2d')],_0x54db0d,_0x22bf77[_0x3fac('0x9d')],_0x5accfc));_0x342747[_0x3fac('0x1c')](_0x3fac('0x9e')+_0x54db0d+';');}BPromise[_0x3fac('0x9a')](_0x342747,handleQuery)['then'](function(_0x926a77){BPromise[_0x3fac('0x1a')]([handleAdditionalPhones()])[_0x3fac('0x18')](function(){_0x342747=[];for(var _0x2cbd5b=0x0;_0x2cbd5b\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','insert','into','cm_hopper','ContactId','ListId','createdAt','UserId','recallme','select','cm_contacts','.CmListId','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20'];(function(_0x3697cc,_0x4ddc5f){var _0x1172b5=function(_0x18154c){while(--_0x18154c){_0x3697cc['push'](_0x3697cc['shift']());}};_0x1172b5(++_0x4ddc5f);}(_0x5f32,0x12d));var _0x25f3=function(_0x418c4e,_0x6095cd){_0x418c4e=_0x418c4e-0x0;var _0x5126ac=_0x5f32[_0x418c4e];return _0x5126ac;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x25f3('0x0'));var Papa=require(_0x25f3('0x1'));var util=require(_0x25f3('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x25f3('0x3'));var Redis=require(_0x25f3('0x4'));var db=require(_0x25f3('0x5'))['db'];var config=require(_0x25f3('0x6'));var shared=require(_0x25f3('0x7'));var logger=require(_0x25f3('0x8'))(_0x25f3('0x9'));config[_0x25f3('0xa')]=_[_0x25f3('0xb')](config['redis'],{'host':_0x25f3('0xc'),'port':0x18eb});var socket=require(_0x25f3('0xd'))(new Redis(config[_0x25f3('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x25f3('0xe')](_0x25f3('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x25f3('0xe')](_0x25f3('0xf'));function isEmail(_0x1446ab){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'](_0x1446ab);}function selectNotIn(_0x21458c,_0x3b766f,_0x20555f,_0x2435bb,_0x366312){return squel['select']()[_0x25f3('0x10')](_0x25f3('0x11'))[_0x25f3('0x12')](_0x2435bb)[_0x25f3('0x13')](_0x3b766f,null,_0x3b766f+_0x25f3('0x14')+_0x2435bb+'.'+_0x20555f)[_0x25f3('0x15')](_0x2435bb+'.'+_0x20555f+_0x25f3('0x16')+_0x21458c+'.'+_0x20555f)[_0x25f3('0x15')](_0x3b766f+_0x25f3('0x17')+_0x366312[_0x25f3('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3fd5f6,_0x14edaf){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x25f3('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x25f3('0x19')](function(_0x5a0715){if(_0x5a0715!==null){var _0x5e8643=[];for(var _0x92cbcf=0x0;_0x92cbcf<_0x5a0715[_0x25f3('0x1a')];_0x92cbcf++){var _0x271c3e=_0x5a0715[_0x92cbcf];_0x5e8643['push'](insertAdditionalPhones(_0x271c3e));}}Promise['all'](_0x5e8643)[_0x25f3('0x19')](function(){_0x3fd5f6({'val':0x1});});});});}function insertAdditionalPhones(_0x2c77d4){return new Promise(function(_0x6431b2,_0x24df9a){var _0x562986=_0x2c77d4[_0x25f3('0x18')];var _0x2084d1=_0x562986['split'](';');var _0x9adbc2=[];orderBy=0x0;for(var _0x158454=0x0;_0x158454<_0x2084d1[_0x25f3('0x1a')];_0x158454++){_0x9adbc2[_0x25f3('0x1b')](splitAdditionalPhone(_0x2c77d4['id'],_0x2084d1[_0x158454]));}Promise[_0x25f3('0x1c')](_0x9adbc2)[_0x25f3('0x19')](function(){_0x6431b2({'val':_0x2084d1[_0x25f3('0x1a')]});});});}function splitAdditionalPhone(_0x2184de,_0x13aca1){return new Promise(function(_0x188b31,_0x2b2a8b){var _0x444d88=_0x13aca1[_0x25f3('0x1d')](':');var _0x9608a9=_0x444d88[0x0];var _0x3a8d60=_0x444d88[0x1];if(!_[_0x25f3('0x1e')](_0x3a8d60)){var _0xc054dc=_0x3a8d60['split']('|');var _0x54f4fd=[];for(var _0x3b06b1=0x0;_0x3b06b1<_0xc054dc['length'];_0x3b06b1++){if(_0xc054dc[_0x3b06b1]!==''){var _0x4feee2=_[_0x25f3('0x1f')](promisesAdditionalPhones,{'contactId':_0x2184de,'phone':_0xc054dc[_0x3b06b1]});if(_0x4feee2[_0x25f3('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0x25f3('0x1b')]({'contactId':_0x2184de,'contactTypeId':_0x9608a9,'phone':_0xc054dc[_0x3b06b1],'orderBy':orderBy});}}}_0x188b31({'ok':0x1});}else _0x188b31({'res':0x0});});}function createAdditionalPhone(_0x414bd3,_0x40a7cf,_0x103ec9,_0x371c73){var _0x5b9979='';var _0xbedf06='';var _0x1136ca=_0x103ec9[_0x25f3('0x1d')]('§');_0x5b9979=_0x1136ca[0x0];if(_0x1136ca[_0x25f3('0x1a')]==0x2)_0xbedf06=_0x1136ca[0x1];return new Promise(function(_0x6c2df0,_0xa7de40){return db[_0x25f3('0x20')][_0x25f3('0x21')]({'where':{'CmContactId':_0x414bd3,'item':_0x5b9979}})['then'](function(_0x2aa490){if(_0x2aa490){return db[_0x25f3('0x20')][_0x25f3('0x22')]({'ItemTypeId':_0x40a7cf,'description':_0xbedf06,'OrderBy':_0x371c73},{'where':{'CmContactId':_0x414bd3,'item':_0x5b9979}})[_0x25f3('0x19')](function(_0x37d6b6){_0x6c2df0({'res':_0x25f3('0x23')});});}else{return db['CmContactHasItem'][_0x25f3('0x24')]({'CmContactId':_0x414bd3,'item':_0x5b9979,'description':_0xbedf06,'ItemTypeId':_0x40a7cf,'OrderBy':_0x371c73,'ItemClass':_0x25f3('0x25')})[_0x25f3('0x19')](function(_0x54dca7){_0x6c2df0({'res':_0x25f3('0x26')});});}});});}function insertCmHopper(_0x40e3ac,_0x5ddfe9,_0x39a0f3,_0x170396,_0x17d0f7){var _0x24a8a7=[_0x25f3('0x27'),_0x25f3('0x28'),_0x25f3('0x29'),_0x25f3('0x2a'),_0x5ddfe9+'.'+_0x170396,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x25f3('0x2b'),'\x22'+_0x17d0f7+'\x22'];return squel[_0x25f3('0x2c')]()[_0x25f3('0x2d')](_0x25f3('0x2e'))['fromQuery'](['phone','scheduledat',_0x25f3('0x2f'),_0x25f3('0x30'),_0x170396,_0x25f3('0x31'),'updatedAt','priority',_0x25f3('0x32'),_0x25f3('0x33')],squel[_0x25f3('0x34')]()['fields'](_0x24a8a7)[_0x25f3('0x12')](_0x5ddfe9)[_0x25f3('0x13')](_0x25f3('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x5ddfe9+_0x25f3('0x36'))[_0x25f3('0x13')](_0x39a0f3,null,_0x39a0f3+_0x25f3('0x14')+_0x5ddfe9+'.'+_0x170396)[_0x25f3('0x15')](_0x5ddfe9+'.CmListId\x20=\x20?',_0x40e3ac)[_0x25f3('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x25f3('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5ddfe9,_0x39a0f3,_0x170396,_0x25f3('0x2e'),[_0x25f3('0x37'),_0x25f3('0x38')]))['where'](_0x25f3('0x39'),selectNotIn(_0x5ddfe9,_0x39a0f3,_0x170396,_0x25f3('0x2e'),[_0x25f3('0x37')])))[_0x25f3('0x3a')]();}function insertCmHopperBlack(_0x5a3eef,_0x16a978,_0x3d53c3,_0x2f0421){var _0x332c6d=[_0x25f3('0x27'),'cm_contacts.id',_0x25f3('0x2a'),_0x16a978+'.'+_0x2f0421,_0x25f3('0x3b'),_0x25f3('0x3c')];return squel[_0x25f3('0x2c')]()[_0x25f3('0x2d')](_0x25f3('0x3d'))['fromQuery']([_0x25f3('0x11'),_0x25f3('0x2f'),'ListId',_0x2f0421,_0x25f3('0x31'),'updatedAt'],squel[_0x25f3('0x34')]()[_0x25f3('0x3e')](_0x332c6d)[_0x25f3('0x12')](_0x16a978)['join'](_0x25f3('0x35'),null,_0x25f3('0x3f')+_0x16a978+_0x25f3('0x36'))[_0x25f3('0x13')](_0x3d53c3,null,_0x3d53c3+_0x25f3('0x14')+_0x16a978+'.'+_0x2f0421)[_0x25f3('0x15')](_0x16a978+_0x25f3('0x40'),_0x5a3eef)[_0x25f3('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x25f3('0x15')](_0x25f3('0x39'),squel['select']()[_0x25f3('0x10')](_0x25f3('0x11'))[_0x25f3('0x12')](_0x25f3('0x3d'))[_0x25f3('0x15')](_0x25f3('0x41'),_0x5a3eef)['where'](_0x2f0421+_0x25f3('0x16')+_0x16a978+'.'+_0x2f0421)))[_0x25f3('0x3a')]();}function insertTzCmHopper(_0x43b375,_0x1af750,_0x4ee225,_0x530e7f,_0x38ec64,_0x8b004b){var _0x342f84=[_0x25f3('0x27'),_0x25f3('0x42')+_0x8b004b+'.offset-cm_contacts.utcOffset\x20minute)',_0x25f3('0x29'),_0x25f3('0x2a'),_0x1af750+'.'+_0x530e7f,_0x25f3('0x3b'),'cm_contacts.updatedAt',_0x25f3('0x43'),'cm_contacts.UserId','\x22'+_0x38ec64+'\x22'];var _0x485d89=squel[_0x25f3('0x2c')]()[_0x25f3('0x2d')](_0x25f3('0x2e'))[_0x25f3('0x44')](['phone','scheduledat','ContactId',_0x25f3('0x30'),_0x530e7f,'createdAt','updatedAt',_0x25f3('0x45'),_0x25f3('0x32'),_0x25f3('0x33')],squel[_0x25f3('0x34')]()['fields'](_0x342f84)[_0x25f3('0x12')](_0x1af750)[_0x25f3('0x13')](_0x25f3('0x35'),null,_0x25f3('0x3f')+_0x1af750+_0x25f3('0x36'))[_0x25f3('0x13')](_0x4ee225,null,_0x4ee225+_0x25f3('0x14')+_0x1af750+'.'+_0x530e7f)[_0x25f3('0x13')](_0x8b004b,null,_0x8b004b+_0x25f3('0x14')+_0x1af750+'.'+_0x530e7f)[_0x25f3('0x15')](_0x1af750+'.CmListId\x20=\x20?',_0x43b375)[_0x25f3('0x15')](_0x25f3('0x46'),NOW)[_0x25f3('0x15')](_0x25f3('0x39'),selectNotIn(_0x1af750,_0x4ee225,_0x530e7f,'cm_hopper',[_0x25f3('0x37'),'\x22onlyIfOpen\x22']))['where'](_0x25f3('0x39'),selectNotIn(_0x1af750,_0x4ee225,_0x530e7f,_0x25f3('0x2e'),['\x22always\x22'])))['toString']();return _0x485d89;}function insertTzCmHopperBlack(_0x1fb80c,_0x2273f3,_0x269838,_0x1bb27d){var _0x5879b1=[_0x25f3('0x27'),'cm_contacts.id',_0x25f3('0x2a'),_0x2273f3+'.'+_0x1bb27d,_0x25f3('0x3b'),'cm_contacts.updatedAt'];return squel[_0x25f3('0x2c')]()['into'](_0x25f3('0x3d'))[_0x25f3('0x44')]([_0x25f3('0x11'),_0x25f3('0x2f'),'ListId',_0x1bb27d,_0x25f3('0x31'),_0x25f3('0x47')],squel[_0x25f3('0x34')]()[_0x25f3('0x3e')](_0x5879b1)[_0x25f3('0x12')](_0x2273f3)['join'](_0x25f3('0x35'),null,_0x25f3('0x3f')+_0x2273f3+'.CmListId')[_0x25f3('0x13')](_0x269838,null,_0x269838+_0x25f3('0x14')+_0x2273f3+'.'+_0x1bb27d)[_0x25f3('0x15')](_0x2273f3+'.CmListId\x20=\x20?',_0x1fb80c)[_0x25f3('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x25f3('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x25f3('0x11'))[_0x25f3('0x12')](_0x25f3('0x3d'))[_0x25f3('0x15')](_0x25f3('0x41'),_0x1fb80c)[_0x25f3('0x15')](_0x1bb27d+'\x20=\x20'+_0x2273f3+'.'+_0x1bb27d)))[_0x25f3('0x3a')]();}function insertCmHopperAdditionalPhones(_0x2682de){var _0x47032e=[_0x25f3('0x48'),_0x25f3('0x49'),'cm_contact_has_items.OrderBy',_0x25f3('0x4a'),_0x25f3('0x4b')];return squel['insert']()['into'](_0x25f3('0x4c'))['fromQuery']([_0x25f3('0x4d'),_0x25f3('0x11'),_0x25f3('0x4e'),_0x25f3('0x31'),_0x25f3('0x47')],squel[_0x25f3('0x34')]()['fields'](_0x47032e)[_0x25f3('0x12')](_0x25f3('0x2e'))['join']('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x25f3('0x13')](_0x25f3('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x25f3('0x50'),_0x2682de)[_0x25f3('0x15')](_0x25f3('0x46'),NOW))[_0x25f3('0x3a')]();}function insertCmContact(_0x4f1d2c,_0x5551db,_0x325428,_0x37ff50){var _0x38d1a9=_[_0x25f3('0x51')](_[_0x25f3('0x52')](_0x37ff50),[_0x25f3('0x30'),_0x25f3('0x53'),_0x25f3('0x31'),_0x25f3('0x47')]);return squel[_0x25f3('0x2c')]()['into']('cm_contacts')[_0x25f3('0x44')](_0x38d1a9,squel[_0x25f3('0x34')]()[_0x25f3('0x3e')](_0x38d1a9)['from'](_0x5551db)[_0x25f3('0x15')]('('+_0x325428[_0x25f3('0x13')](',')+_0x25f3('0x54'),squel[_0x25f3('0x34')]()[_0x25f3('0x3e')](_0x325428)[_0x25f3('0x12')](_0x25f3('0x35'))[_0x25f3('0x15')](_0x25f3('0x41'),_0x4f1d2c)[_0x25f3('0x15')](_0x25f3('0x55')))[_0x25f3('0x15')](_0x25f3('0x56'),squel['select']()[_0x25f3('0x10')](_0x25f3('0x57'),_0x25f3('0x58'))[_0x25f3('0x12')](_0x5551db)[_0x25f3('0x59')](_0x325428[_0x25f3('0x13')](','))))[_0x25f3('0x3a')]();}function handleStop(){logger[_0x25f3('0x5a')](_0x25f3('0x5b'));stopped=!![];}function handleUncaughtException(_0x54a295){logger[_0x25f3('0x5c')](_0x54a295[_0x25f3('0x5d')]);process[_0x25f3('0x5e')](0x1);}function handleError(_0x46490a,_0x2d937d){stats[_0x25f3('0x5f')][_0x25f3('0x1b')]({'name':_0x2d937d['code'],'message':_0x2d937d[_0x25f3('0x5d')],'row':_0x46490a});}function handleQuery(_0x5327b4){logger['info'](_0x5327b4);return db[_0x25f3('0x60')][_0x25f3('0x61')](_0x5327b4)['spread'](function(_0x431fee){results['push'](_0x431fee);})[_0x25f3('0x62')](function(_0x13d95c){logger[_0x25f3('0x5c')](_0x13d95c[_0x25f3('0x5d')]);});}function updateTzCampaigns(_0x305c47){return new Promise(function(_0x5969b0,_0x182bd1){var _0x4bdde4=squel[_0x25f3('0x34')]()['fields'](['campaigns.id',_0x25f3('0x63')])[_0x25f3('0x12')](_0x25f3('0x64'))[_0x25f3('0x13')](_0x25f3('0x65'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0x25f3('0x66')+_0x305c47);db['sequelize']['query'](_0x4bdde4[_0x25f3('0x3a')]())[_0x25f3('0x67')](function(_0x1e27fe){var _0x1f5a7f=[];for(var _0x306ed4=0x0;_0x306ed4<_0x1e27fe[_0x25f3('0x1a')];_0x306ed4++){_0x1f5a7f[_0x25f3('0x1b')](getTimezoneData(_0x1e27fe[_0x306ed4],tmp_campaigns));}BPromise[_0x25f3('0x1c')](_0x1f5a7f)[_0x25f3('0x19')](function(){_0x5969b0({'val':0x1});});})[_0x25f3('0x62')](function(_0x4e813b){logger['error'](_0x4e813b[_0x25f3('0x5d')]);_0x5969b0({'val':0x0});});});}function updateTzVoiceQueues(_0x2114b7){return new Promise(function(_0x2b32f5,_0x48bb34){var _0x422538=squel[_0x25f3('0x34')]()[_0x25f3('0x3e')]([_0x25f3('0x68'),'voice_queues.dialTimezone'])[_0x25f3('0x12')](_0x25f3('0x69'))[_0x25f3('0x13')](_0x25f3('0x6a'),null,_0x25f3('0x6b'))['where'](_0x25f3('0x6c')+_0x2114b7);db[_0x25f3('0x60')][_0x25f3('0x61')](_0x422538[_0x25f3('0x3a')]())[_0x25f3('0x67')](function(_0x193e7f){var _0x2f45a9=[];for(var _0x44e955=0x0;_0x44e955<_0x193e7f['length'];_0x44e955++){_0x2f45a9[_0x25f3('0x1b')](getTimezoneData(_0x193e7f[_0x44e955],tmp_voice_queues));}BPromise['all'](_0x2f45a9)[_0x25f3('0x19')](function(){_0x2b32f5({'val':0x1});});})[_0x25f3('0x62')](function(_0x2f454f){logger[_0x25f3('0x5c')](_0x2f454f[_0x25f3('0x5d')]);_0x2b32f5({'val':0x0});});});}function getTimezoneData(_0x54d5ee,_0x25b9ee){return new Promise(function(_0xdae79,_0x4d0ccf){var _0x5e7caa=shared[_0x25f3('0x6d')];var _0xc3662=_0x5e7caa[_0x54d5ee[_0x25f3('0x6e')]];if(_[_0x25f3('0x1e')](_0xc3662)){_0xdae79({'ret':0x1});}else{var _0x214c0f=_0xc3662['utcOffset'];var _0x451d01=squel[_0x25f3('0x2c')]()[_0x25f3('0x2d')](_0x25b9ee)[_0x25f3('0x6f')]('id',_0x54d5ee['id'])[_0x25f3('0x6f')](_0x25f3('0x70'),_0x214c0f)['set'](_0x25f3('0x6e'),_0x54d5ee[_0x25f3('0x6e')])[_0x25f3('0x3a')]();return db[_0x25f3('0x60')][_0x25f3('0x61')](_0x451d01)[_0x25f3('0x67')](function(_0x4a52bc){_0xdae79({'ret':0x1});})['catch'](function(_0x25023a){logger[_0x25f3('0x5c')](_0x25023a['message']);_0x4d0ccf({'ret':0x1});});}});}function handleTZQuery(_0x555e9c){logger[_0x25f3('0x5a')](_0x555e9c);return db[_0x25f3('0x60')][_0x25f3('0x61')](_0x555e9c)[_0x25f3('0x67')](function(_0x2da4ae){})[_0x25f3('0x62')](function(_0x38d84b){logger['error'](_0x38d84b[_0x25f3('0x5d')]);});}function main(_0x7006f1,_0x49fb7a,_0x42b66a,_0x544e64){logger[_0x25f3('0x5a')](_0x25f3('0x71'),_0x7006f1,JSON['stringify'](_0x49fb7a));process[_0x25f3('0x72')](_0x25f3('0x73'));var _0x58114b=_0x49fb7a[_0x25f3('0x74')];var _0x1c6d9c=_[_0x25f3('0x75')](_0x58114b);var _0x9b4d4b=_0x49fb7a[_0x25f3('0x76')];var _0x2e2d36=path[_0x25f3('0x13')](config[_0x25f3('0x77')],'server/files/tmp',_0x9b4d4b+_0x25f3('0x78'));hasTZ=_[_0x25f3('0x52')](_0x58114b)[_0x25f3('0x79')](_0x25f3('0x6e'));var _0x3e9e52=_[_0x25f3('0x52')](_0x58114b)[_0x25f3('0x13')]();logger['info'](_0x25f3('0x7a'),_0x3e9e52);db[_0x25f3('0x7b')][_0x25f3('0x7c')]({'raw':!![],'attributes':['id','name']})[_0x25f3('0x19')](function(_0x4e8b52){for(var _0x3823c2=0x0;_0x3823c2<_0x4e8b52['length'];_0x3823c2++){if(_0x4e8b52[_0x3823c2]['name']in _0x58114b){contactItemTypes[_0x25f3('0x1b')](_0x4e8b52[_0x3823c2]);delete _0x1c6d9c[_0x4e8b52[_0x3823c2]['name']];hasAdditionalPhones=!![];}for(var _0x47ec61 in _0x58114b){if(_0x4e8b52[_0x3823c2][_0x25f3('0x7d')]+'_description'===_0x47ec61){phoneDescriptions['push']({'itemTypeId':_0x4e8b52[_0x3823c2]['id'],'description':_0x47ec61});delete _0x1c6d9c[_0x47ec61];}}}if(hasAdditionalPhones)_0x1c6d9c[_0x25f3('0x18')]='';var _0x5b0b82=_[_0x25f3('0x52')](_0x1c6d9c)['join']();logger['info']('header',_0x5b0b82);fs['writeFileSync'](_0x2e2d36,_0x5b0b82+'\x0a');Papa[_0x25f3('0x7e')](fs[_0x25f3('0x7f')](_0x7006f1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2070ed,_0x1e6cac){try{for(var _0x3e9f5f=0x0,_0x1bb72f=[];_0x3e9f5f<_0x2070ed['data'][_0x25f3('0x1a')];_0x3e9f5f++){stats[_0x25f3('0x80')]+=0x1;if(_0x2070ed[_0x25f3('0x5f')][_0x3e9f5f]){handleError(_0x2070ed['data'][_0x3e9f5f],_0x2070ed[_0x25f3('0x5f')][_0x3e9f5f]);}else{var _0x2eec80=[];var _0x463760=[];var _0x990bf9={};for(var _0x1bc13b in _0x58114b){let _0x59c340=contactItemTypes[_0x25f3('0x81')](_0x4b6a4b=>_0x4b6a4b[_0x25f3('0x7d')]===_0x1bc13b);let _0x3c314a=contactItemTypes['find'](_0x97b843=>_0x97b843[_0x25f3('0x7d')]+_0x25f3('0x82')===_0x1bc13b);if(_[_0x25f3('0x1e')](_0x59c340)&&_[_0x25f3('0x1e')](_0x3c314a)){if(_0x58114b[_0x25f3('0x83')](_0x1bc13b)){if(_0x2070ed[_0x25f3('0x84')][_0x3e9f5f][_0x58114b[_0x1bc13b]]){var _0x1222e7=_[_0x25f3('0x85')](_0x2070ed[_0x25f3('0x84')][_0x3e9f5f][_0x58114b[_0x1bc13b]][_0x25f3('0x86')](/"/g,'\x27'));switch(_0x1bc13b){case _0x25f3('0x87'):var _0x1e0477=moment(_0x1222e7,_0x25f3('0xf'),!![]);if(_0x1e0477[_0x25f3('0x88')]()){_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x1222e7+'\x22');}else{_0x2eec80['push'](_0x25f3('0x89'));}break;case _0x25f3('0x45'):var _0x2590a6=parseInt(_0x1222e7);_0x1222e7=_[_0x25f3('0x8a')](_0x2590a6)||_0x2590a6<0x0||_0x2590a6>0x4?_0x544e64?0x3:0x2:_0x2590a6;_0x1bb72f['push']('\x22'+_0x1222e7+'\x22');break;case _0x25f3('0x32'):var _0x3d22bf=parseInt(_0x1222e7);if(_[_0x25f3('0x8b')](_0x3d22bf)&&_[_0x25f3('0x79')](_0x42b66a,_0x3d22bf)){_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x3d22bf+'\x22');}else{_0x2eec80[_0x25f3('0x1b')](_0x25f3('0x8c'));}break;case _0x25f3('0x8d'):if(isEmail(_0x1222e7)){_0x1bb72f['push']('\x22'+_0x1222e7+'\x22');}else{_0x2eec80[_0x25f3('0x1b')](_0x25f3('0x8e'));}break;case _0x25f3('0x8f'):var _0x9cea=moment(_0x1222e7,_0x25f3('0x90'),!![]);if(_0x9cea['isValid']()){_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x1222e7+'\x22');}else{_0x2eec80[_0x25f3('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x25f3('0x6e'):var _0xd0f17c=shared[_0x25f3('0x6d')];var _0x42d197=_0xd0f17c[_0x1222e7];if(!_[_0x25f3('0x1e')](_0x42d197)){var _0x2f71df=_0x42d197[_0x25f3('0x91')];_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x1222e7+'\x22');_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x2f71df+'\x22');}break;default:_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x1222e7+'\x22');}}else{switch(_0x1bc13b){case _0x25f3('0x92'):case _0x25f3('0x11'):_0x2eec80['push'](_0x1bc13b+'\x20not\x20specified');break;default:_0x1bb72f['push']('\x22\x22');}}}}else{var _0x3aed3a='';if(!_[_0x25f3('0x1e')](_0x59c340)){if(!_0x990bf9['hasOwnProperty'](_0x59c340['id'])){if(!_[_0x25f3('0x1e')](_0x2070ed[_0x25f3('0x84')][_0x3e9f5f][_0x58114b[_0x1bc13b]])){var _0x1222e7=_['trim'](_0x2070ed['data'][_0x3e9f5f][_0x58114b[_0x1bc13b]][_0x25f3('0x86')](/"/g,'\x27'));var _0x3a534e=phoneDescriptions[_0x25f3('0x81')](_0x32472e=>_0x32472e['itemTypeId']===_0x59c340['id']);if(!_['isNil'](_0x3a534e)){var _0x172d60=_[_0x25f3('0x85')](_0x2070ed[_0x25f3('0x84')][_0x3e9f5f][_0x58114b[_0x3a534e[_0x25f3('0x93')]]][_0x25f3('0x86')](/"/g,'\x27'));if(!_[_0x25f3('0x1e')](_0x172d60))_0x1222e7=_0x1222e7+'§'+_0x172d60;}if(_0x3aed3a=='')_0x3aed3a=_0x1222e7;else _0x3aed3a+='|'+_0x1222e7;}_0x463760[_0x25f3('0x1b')](_0x59c340['id']+':'+_0x3aed3a);_0x990bf9[_0x59c340['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1bb72f[_0x25f3('0x1b')]('\x22'+_0x463760[_0x25f3('0x13')](';')+'\x22');}if(_0x2eec80['length']){handleError(_0x2070ed['data'][_0x3e9f5f],{'code':_0x25f3('0x94'),'message':_0x2eec80[_0x25f3('0x13')]()});}else{fs[_0x25f3('0x95')](_0x2e2d36,_0x1bb72f[_0x25f3('0x13')]()+'\x0a');}_0x1bb72f=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x25f3('0x96')+_0x9b4d4b,stats);stats[_0x25f3('0x5f')]=[];}}if(stopped){logger['info'](_0x25f3('0x97'));_0x1e6cac[_0x25f3('0x98')]();}}catch(_0x49090a){handleError(_0x2070ed[_0x25f3('0x84')][_0x3e9f5f],{'code':_0x25f3('0x99'),'message':_0x49090a['message']});logger[_0x25f3('0x5c')](_0x25f3('0x9a'),_0x49090a['message']);}},'complete':function(){try{var _0x4463ee=[];var _0x141729=[];var _0x8f7ca5=_0x25f3('0x35');if(_0x49fb7a[_0x25f3('0x9b')]&&_0x49fb7a[_0x25f3('0x9b')][_0x25f3('0x1a')]){_0x8f7ca5=_0x25f3('0x9c')+_0x9b4d4b;_0x4463ee[_0x25f3('0x1b')](_0x25f3('0x9d')+_0x8f7ca5+_0x25f3('0x9e'));}tmp_campaigns=_0x25f3('0x9f')+_0x9b4d4b;tmp_voice_queues=_0x25f3('0xa0')+_0x9b4d4b;_0x141729[_0x25f3('0x1b')](_0x25f3('0x9d')+tmp_campaigns+_0x25f3('0xa1'));_0x141729[_0x25f3('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x25f3('0xa2')](_0x141729,handleTZQuery)['then'](function(_0x4b78f9){updateTzCampaigns(_0x49fb7a[_0x25f3('0x30')])['then'](function(_0x2e58ac){updateTzVoiceQueues(_0x49fb7a[_0x25f3('0x30')])['then'](function(_0x9c6653){if(hasTZ)_0x5b0b82=_0x5b0b82['replace']('dialTimezone','dialTimezone,utcOffset');var _0x49f58a=util[_0x25f3('0xe')]('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',_0x2e2d36,_0x8f7ca5,_0x5b0b82,_0x49fb7a[_0x25f3('0x30')],_0x49fb7a[_0x25f3('0x53')]||null,NOW,NOW);if(_['isNil'](_0x58114b[_0x25f3('0x87')])){_0x49f58a+=',\x20scheduledAt\x20=\x20NOW()';}_0x4463ee['push'](_0x49f58a);if(_0x49fb7a[_0x25f3('0x9b')]&&_0x49fb7a['duplicates'][_0x25f3('0x1a')]){_0x4463ee[_0x25f3('0x1b')](insertCmContact(_0x49fb7a[_0x25f3('0x30')],_0x8f7ca5,_0x49fb7a['duplicates'],_0x58114b));_0x4463ee[_0x25f3('0x1b')]('DROP\x20TABLE\x20'+_0x8f7ca5+';');}BPromise[_0x25f3('0xa2')](_0x4463ee,handleQuery)[_0x25f3('0x19')](function(_0x37d75e){BPromise['all']([handleAdditionalPhones()])[_0x25f3('0x19')](function(){_0x4463ee=[];for(var _0x5d6a6a=0x0;_0x5d6a6a\x20\x20','existsSync','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','all','then','split','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ListId','updatedAt','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','fromQuery','createdAt','from','cm_contacts','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','errors','code','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','body','ContactItemType','name','AdditionalPhones','header','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','itemTypeId'];(function(_0x49ab19,_0x3daeb0){var _0x15c716=function(_0x1bd9da){while(--_0x1bd9da){_0x49ab19['push'](_0x49ab19['shift']());}};_0x15c716(++_0x3daeb0);}(_0x6426,0x15b));var _0x6642=function(_0x2eab4a,_0x26b9b2){_0x2eab4a=_0x2eab4a-0x0;var _0x479832=_0x6426[_0x2eab4a];return _0x479832;};'use strict';var fs=require('fs');var path=require(_0x6642('0x0'));var _=require(_0x6642('0x1'));var Papa=require(_0x6642('0x2'));var util=require(_0x6642('0x3'));var BPromise=require(_0x6642('0x4'));var moment=require('moment');var squel=require(_0x6642('0x5'));var Redis=require(_0x6642('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x6642('0x7'));var logger=require(_0x6642('0x8'))(_0x6642('0x9'));config[_0x6642('0xa')]=_[_0x6642('0xb')](config[_0x6642('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6642('0xc'))(new Redis(config[_0x6642('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x6642('0xd')](_0x6642('0xe'));var tempTableName=_0x6642('0xf')+moment()[_0x6642('0xd')](_0x6642('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x451f34){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))*$/[_0x6642('0x11')](_0x451f34);}function selectNotIn(_0x1c4e57,_0xcb2bda,_0x573a3e,_0x2a9032,_0x588474){return squel[_0x6642('0x12')]()[_0x6642('0x13')](_0x6642('0x14'))['from'](_0x2a9032)['join'](_0xcb2bda,null,_0xcb2bda+_0x6642('0x15')+_0x2a9032+'.'+_0x573a3e)[_0x6642('0x16')](_0x2a9032+'.'+_0x573a3e+_0x6642('0x17')+_0x1c4e57+'.'+_0x573a3e)[_0x6642('0x16')](_0xcb2bda+_0x6642('0x18')+_0x588474[_0x6642('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5cd4fb,_0x381e81){promisesAdditionalPhones=[];promisesContact=[];return db[_0x6642('0x1a')][_0x6642('0x1b')](_0x6642('0x1c')+tempTableName)[_0x6642('0x1d')](function(_0x4679e1){if(_0x4679e1!==null){var _0x5c15f8=[];for(var _0x3146e5=0x0;_0x3146e5<_0x4679e1[_0x6642('0x1e')];_0x3146e5++){var _0xefdf8c=_0x4679e1[_0x3146e5];if(!_[_0x6642('0x1f')](_0xefdf8c['phone'])){if(!_[_0x6642('0x1f')](_0xefdf8c['AdditionalPhones']))_0x5c15f8[_0x6642('0x20')](insertAdditionalPhones(_0xefdf8c));promisesContact[_0x6642('0x20')]({'contact':_0xefdf8c});}}}Promise[_0x6642('0x21')](_0x5c15f8)[_0x6642('0x22')](function(){_0x5cd4fb({'val':0x1});});})['catch'](function(_0x3ef616){logger['error'](_0x3ef616['message']);});});}function insertAdditionalPhones(_0x29db40){return new Promise(function(_0x49198c,_0x5d3b71){var _0x491e8d=_0x29db40['AdditionalPhones'];if(_['isNil'](_0x491e8d))_0x5d3b71({'val':0x0});else{var _0x390e5e=_0x491e8d[_0x6642('0x23')](';');var _0x475587=[];orderBy=0x0;for(var _0x265455=0x0;_0x265455<_0x390e5e[_0x6642('0x1e')];_0x265455++){_0x475587[_0x6642('0x20')](splitAdditionalPhone(_0x29db40['id'],_0x390e5e[_0x265455]));}Promise[_0x6642('0x21')](_0x475587)[_0x6642('0x22')](function(){_0x49198c({'val':_0x390e5e[_0x6642('0x1e')]});});}});}function splitAdditionalPhone(_0x163fb1,_0x14e4c8){return new Promise(function(_0x1a21f6,_0x4187c9){var _0x85e89d=_0x14e4c8['split'](':');var _0x2fc6d5=_0x85e89d[0x0];var _0xd129fd=_0x85e89d[0x1];if(_0xd129fd!==''){var _0x354410=_0xd129fd[_0x6642('0x23')]('|');var _0x5f4366=[];for(var _0x3b6976=0x0;_0x3b6976<_0x354410['length'];_0x3b6976++){if(_0x354410[_0x3b6976]!==''){var _0x1ff1fd=_['filter'](promisesAdditionalPhones,{'contactId':_0x163fb1,'phone':_0x354410[_0x3b6976]});if(_0x1ff1fd[_0x6642('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x6642('0x20')]({'contactId':_0x163fb1,'contactTypeId':_0x2fc6d5,'phone':_0x354410[_0x3b6976],'orderBy':orderBy});}}}_0x1a21f6({'ok':0x1});}else _0x1a21f6({'res':0x0});});}function createAdditionalPhone(_0x5b8a22,_0x16c096,_0x54406c,_0x31b623){var _0x54e237='';var _0x21f773='';var _0x152674=_0x54406c[_0x6642('0x23')]('§');_0x54e237=_0x152674[0x0];if(_0x152674['length']==0x2)_0x21f773=_0x152674[0x1];return new Promise(function(_0x2aaa26,_0x5b3216){return db['CmContactHasItem'][_0x6642('0x24')]({'where':{'CmContactId':_0x5b8a22,'item':_0x54e237}})['then'](function(_0x1ba6d4){if(_0x1ba6d4){return db[_0x6642('0x25')][_0x6642('0x26')]({'ItemTypeId':_0x16c096,'description':_0x21f773,'OrderBy':_0x31b623},{'where':{'CmContactId':_0x5b8a22,'item':_0x54e237}})[_0x6642('0x22')](function(_0xf03075){_0x2aaa26({'res':_0x6642('0x27')});});}else{return db[_0x6642('0x25')][_0x6642('0x28')]({'CmContactId':_0x5b8a22,'item':_0x54e237,'ItemTypeId':_0x16c096,'description':_0x21f773,'OrderBy':_0x31b623,'ItemClass':_0x6642('0x29')})[_0x6642('0x22')](function(_0x4a8148){_0x2aaa26({'res':_0x6642('0x2a')});});}});});}function updateContact(_0x446b85){return new Promise(function(_0x27c8d2,_0x40f6bd){var _0xf285b8=_0x446b85['id'];delete _0x446b85['id'];return db[_0x6642('0x2b')][_0x6642('0x26')](_0x446b85,{'where':{'id':_0xf285b8}})[_0x6642('0x22')](function(_0x34351b){updatedRows+=0x1;return db[_0x6642('0x2c')][_0x6642('0x26')]({'phone':_0x446b85[_0x6642('0x14')]},{'where':{'ContactId':_0xf285b8}})[_0x6642('0x22')](function(_0x3e4c31){_0x27c8d2({'ret':'OK'});});});});}function insertCmHopper(_0x32fcff,_0x50f5af,_0x87c9bd,_0x1c425f,_0x3e8354){var _0x4ada8d=[_0x6642('0x2d'),_0x6642('0x2e'),'cm_contacts.id',_0x6642('0x2f'),_0x50f5af+'.'+_0x1c425f,_0x6642('0x30'),'cm_contacts.updatedAt',_0x6642('0x31'),_0x6642('0x32'),'\x22'+_0x3e8354+'\x22'];return squel[_0x6642('0x33')]()[_0x6642('0x34')](_0x6642('0x35'))['fromQuery'](['phone',_0x6642('0x36'),'ContactId',_0x6642('0x37'),_0x1c425f,'createdAt',_0x6642('0x38'),'priority',_0x6642('0x39'),'recallme'],squel['select']()[_0x6642('0x3a')](_0x4ada8d)['from'](_0x50f5af)[_0x6642('0x19')]('cm_contacts',null,_0x6642('0x3b')+_0x50f5af+_0x6642('0x3c'))[_0x6642('0x19')](_0x87c9bd,null,_0x87c9bd+_0x6642('0x15')+_0x50f5af+'.'+_0x1c425f)[_0x6642('0x16')](_0x50f5af+'.CmListId\x20=\x20?',_0x32fcff)[_0x6642('0x16')](_0x6642('0x3d'),NOW)[_0x6642('0x16')](_0x6642('0x3e'),selectNotIn(_0x50f5af,_0x87c9bd,_0x1c425f,_0x6642('0x35'),['\x22always\x22',_0x6642('0x3f')]))['where'](_0x6642('0x3e'),selectNotIn(_0x50f5af,_0x87c9bd,_0x1c425f,_0x6642('0x35'),[_0x6642('0x40')])))[_0x6642('0x41')]();}function insertCmHopperBlack(_0x566c96,_0x4c2a30,_0x2e8753,_0x278776){var _0x59c99f=[_0x6642('0x2d'),'cm_contacts.id',_0x6642('0x2f'),_0x4c2a30+'.'+_0x278776,_0x6642('0x30'),'cm_contacts.updatedAt'];return squel[_0x6642('0x33')]()[_0x6642('0x34')](_0x6642('0x42'))[_0x6642('0x43')]([_0x6642('0x14'),'ContactId',_0x6642('0x37'),_0x278776,_0x6642('0x44'),_0x6642('0x38')],squel[_0x6642('0x12')]()[_0x6642('0x3a')](_0x59c99f)[_0x6642('0x45')](_0x4c2a30)['join'](_0x6642('0x46'),null,_0x6642('0x3b')+_0x4c2a30+_0x6642('0x3c'))['join'](_0x2e8753,null,_0x2e8753+_0x6642('0x15')+_0x4c2a30+'.'+_0x278776)[_0x6642('0x16')](_0x4c2a30+_0x6642('0x47'),_0x566c96)[_0x6642('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6642('0x12')]()[_0x6642('0x13')](_0x6642('0x14'))['from']('cm_hopper_black')['where'](_0x6642('0x48'),_0x566c96)['where'](_0x278776+_0x6642('0x49'),_0x4c2a30+'.'+_0x278776)))['toString']();}function insertCmHopperAdditionalPhones(_0x5ace28){var _0xa94446=[_0x6642('0x4a'),_0x6642('0x4b'),_0x6642('0x4c'),_0x6642('0x4d'),_0x6642('0x4e')];return squel['insert']()[_0x6642('0x34')](_0x6642('0x4f'))[_0x6642('0x43')](['CmHopperId',_0x6642('0x14'),_0x6642('0x50'),_0x6642('0x44'),_0x6642('0x38')],squel[_0x6642('0x12')]()[_0x6642('0x3a')](_0xa94446)['from'](_0x6642('0x35'))[_0x6642('0x19')](_0x6642('0x46'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x6642('0x19')](_0x6642('0x51'),null,_0x6642('0x52'))[_0x6642('0x16')](_0x6642('0x53'),_0x5ace28)[_0x6642('0x16')](_0x6642('0x3d'),NOW))[_0x6642('0x41')]();}function insertCmContact(_0x33bfec,_0x1c24df,_0x28926e,_0x2a5ff0){var _0x28ac65=_[_0x6642('0x54')](_[_0x6642('0x55')](_0x2a5ff0),[_0x6642('0x37'),_0x6642('0x56'),_0x6642('0x44'),_0x6642('0x38')]);return squel[_0x6642('0x33')]()[_0x6642('0x34')](_0x6642('0x46'))[_0x6642('0x43')](_0x28ac65,squel[_0x6642('0x12')]()['fields'](_0x28ac65)[_0x6642('0x45')](_0x1c24df)[_0x6642('0x16')]('('+_0x28926e[_0x6642('0x19')](',')+_0x6642('0x57'),squel[_0x6642('0x12')]()[_0x6642('0x3a')](_0x28926e)[_0x6642('0x45')](_0x6642('0x46'))['where']('ListId\x20=\x20?',_0x33bfec))['where']('id\x20IN\x20?',squel[_0x6642('0x12')]()[_0x6642('0x13')]('MIN(id)',_0x6642('0x58'))[_0x6642('0x45')](_0x1c24df)[_0x6642('0x59')](_0x28926e[_0x6642('0x19')](','))))[_0x6642('0x41')]();}function handleStop(){logger[_0x6642('0x5a')](_0x6642('0x5b'));stopped=!![];}function handleUncaughtException(_0x2e2a1a){logger[_0x6642('0x5c')](_0x2e2a1a[_0x6642('0x5d')]);process['exit'](0x1);}function handleError(_0x42339f,_0x1adf0e){stats[_0x6642('0x5e')][_0x6642('0x20')]({'name':_0x1adf0e[_0x6642('0x5f')],'message':_0x1adf0e['message'],'row':_0x42339f});}function handleQuery(_0x59ee04){logger[_0x6642('0x5a')](_0x59ee04);return db['sequelize'][_0x6642('0x1b')](_0x59ee04)[_0x6642('0x1d')](function(_0x21bfe2){results[_0x6642('0x20')](_0x21bfe2);})['catch'](function(_0x379a87){logger[_0x6642('0x5c')](_0x379a87['message']);});}function main(_0x11471f,_0x393cee,_0x138bed,_0x2f9d07){logger[_0x6642('0x5a')](_0x6642('0x60'),_0x11471f,JSON[_0x6642('0x61')](_0x393cee));process[_0x6642('0x62')](_0x6642('0x63'));var _0x2acc5f=_0x393cee[_0x6642('0x64')];var _0x39247f=_[_0x6642('0x65')](_0x2acc5f);var _0x395ef1=_0x393cee[_0x6642('0x66')];var _0x5b6d62=path[_0x6642('0x19')](config[_0x6642('0x67')],_0x6642('0x68'),_0x395ef1+'.csv');logger[_0x6642('0x5a')](_0x6642('0x69'),_0x393cee);db[_0x6642('0x6a')]['findAll']({'raw':!![],'attributes':['id',_0x6642('0x6b')]})['then'](function(_0x52d679){for(var _0x1226ca=0x0;_0x1226ca<_0x52d679[_0x6642('0x1e')];_0x1226ca++){if(_0x52d679[_0x1226ca][_0x6642('0x6b')]in _0x2acc5f){contactItemTypes[_0x6642('0x20')](_0x52d679[_0x1226ca]);delete _0x39247f[_0x52d679[_0x1226ca][_0x6642('0x6b')]];hasAdditionalPhones=!![];}for(var _0x410afd in _0x2acc5f){if(_0x52d679[_0x1226ca][_0x6642('0x6b')]+'_description'===_0x410afd){phoneDescriptions[_0x6642('0x20')]({'itemTypeId':_0x52d679[_0x1226ca]['id'],'description':_0x410afd});delete _0x39247f[_0x410afd];}}}if(hasAdditionalPhones)_0x39247f[_0x6642('0x6c')]='';var _0x8bbbb9=_[_0x6642('0x55')](_0x39247f)[_0x6642('0x19')]();logger[_0x6642('0x5a')](_0x6642('0x6d'),_0x8bbbb9);fs['writeFileSync'](_0x5b6d62,_0x8bbbb9+'\x0a');Papa[_0x6642('0x6e')](fs[_0x6642('0x6f')](_0x11471f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3df5e4,_0x3cc82d){try{for(var _0xd7be07=0x0,_0x25f181=[];_0xd7be07<_0x3df5e4[_0x6642('0x70')]['length'];_0xd7be07++){stats[_0x6642('0x71')]+=0x1;if(_0x3df5e4[_0x6642('0x5e')][_0xd7be07]){handleError(_0x3df5e4[_0x6642('0x70')][_0xd7be07],_0x3df5e4['errors'][_0xd7be07]);}else{var _0x2bd50a=[];var _0x25ed44=[];var _0x449d92={};for(var _0x4438c7 in _0x2acc5f){let _0x56212c=contactItemTypes[_0x6642('0x72')](_0x24f4fd=>_0x24f4fd[_0x6642('0x6b')]===_0x4438c7);let _0x257a73=contactItemTypes[_0x6642('0x72')](_0x54bed6=>_0x54bed6[_0x6642('0x6b')]+_0x6642('0x73')===_0x4438c7);if(_[_0x6642('0x1f')](_0x56212c)&&_[_0x6642('0x1f')](_0x257a73)){if(_0x2acc5f[_0x6642('0x74')](_0x4438c7)){if(_0x3df5e4[_0x6642('0x70')][_0xd7be07][_0x2acc5f[_0x4438c7]]){var _0x3bb545=_[_0x6642('0x75')](_0x3df5e4['data'][_0xd7be07][_0x2acc5f[_0x4438c7]][_0x6642('0x76')](/"/g,'\x27'));switch(_0x4438c7){case'scheduledat':var _0x100349=moment(_0x3bb545,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x100349[_0x6642('0x77')]()){_0x25f181['push']('\x22'+_0x3bb545+'\x22');}else{_0x2bd50a[_0x6642('0x20')](_0x6642('0x78'));}break;case _0x6642('0x79'):var _0x2cac61=parseInt(_0x3bb545);_0x3bb545=_[_0x6642('0x7a')](_0x2cac61)||_0x2cac61<0x0||_0x2cac61>0x4?_0x2f9d07?0x3:0x2:_0x2cac61;_0x25f181[_0x6642('0x20')]('\x22'+_0x3bb545+'\x22');break;case _0x6642('0x39'):var _0x22e7d8=parseInt(_0x3bb545);if(_[_0x6642('0x7b')](_0x22e7d8)&&_[_0x6642('0x7c')](_0x138bed,_0x22e7d8)){_0x25f181[_0x6642('0x20')]('\x22'+_0x22e7d8+'\x22');}else{_0x2bd50a[_0x6642('0x20')](_0x6642('0x7d'));}break;case _0x6642('0x7e'):if(isEmail(_0x3bb545)){_0x25f181[_0x6642('0x20')]('\x22'+_0x3bb545+'\x22');}else{_0x2bd50a[_0x6642('0x20')](_0x6642('0x7f'));}break;case _0x6642('0x80'):var _0x3d84fe=moment(_0x3bb545,_0x6642('0x81'),!![]);if(_0x3d84fe[_0x6642('0x77')]()){_0x25f181[_0x6642('0x20')]('\x22'+_0x3bb545+'\x22');}else{_0x2bd50a[_0x6642('0x20')](_0x6642('0x82'));}break;default:_0x25f181[_0x6642('0x20')]('\x22'+_0x3bb545+'\x22');}}else{switch(_0x4438c7){case'firstName':case'phone':_0x2bd50a[_0x6642('0x20')](_0x4438c7+_0x6642('0x83'));break;default:_0x25f181[_0x6642('0x20')]('\x22\x22');}}}}else{var _0x4690d4='';if(!_[_0x6642('0x1f')](_0x56212c)){if(!_0x449d92[_0x6642('0x74')](_0x56212c['id'])){for(var _0x27eee6=0x0;_0x27eee6<_0x2acc5f[_0x4438c7][_0x6642('0x1e')];_0x27eee6++){var _0x3bb545=_[_0x6642('0x75')](_0x3df5e4[_0x6642('0x70')][_0xd7be07][_0x2acc5f[_0x4438c7][_0x27eee6]][_0x6642('0x76')](/"/g,'\x27'));var _0x4835ac=phoneDescriptions[_0x6642('0x72')](_0x35418d=>_0x35418d[_0x6642('0x84')]===_0x56212c['id']);if(!_[_0x6642('0x1f')](_0x4835ac)){var _0x5c469a=_[_0x6642('0x75')](_0x3df5e4[_0x6642('0x70')][_0xd7be07][_0x2acc5f[_0x4835ac[_0x6642('0x85')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x6642('0x1f')](_0x5c469a))_0x3bb545=_0x3bb545+'§'+_0x5c469a;}if(_0x4690d4=='')_0x4690d4=_0x3bb545;else _0x4690d4+='|'+_0x3bb545;}_0x25ed44[_0x6642('0x20')](_0x56212c['id']+':'+_0x4690d4);_0x449d92[_0x56212c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x25f181[_0x6642('0x20')]('\x22'+_0x25ed44[_0x6642('0x19')](';')+'\x22');}if(_0x2bd50a[_0x6642('0x1e')]){handleError(_0x3df5e4['data'][_0xd7be07],{'code':_0x6642('0x86'),'message':_0x2bd50a[_0x6642('0x19')]()});}else{fs['appendFileSync'](_0x5b6d62,_0x25f181[_0x6642('0x19')]()+'\x0a');}_0x25f181=[];}if(!(stats['rows']%0xc8)){socket[_0x6642('0x87')](_0x6642('0x88')+_0x395ef1,stats);stats[_0x6642('0x5e')]=[];}}if(stopped){logger[_0x6642('0x5a')](_0x6642('0x89'));_0x3cc82d[_0x6642('0x8a')]();}}catch(_0x88b5a4){handleError(_0x3df5e4[_0x6642('0x70')][_0xd7be07],{'code':_0x6642('0x8b'),'message':_0x88b5a4['message']});logger[_0x6642('0x5c')]('step',_0x88b5a4[_0x6642('0x5d')]);}},'complete':function(){try{var _0x28e1b9=[];var _0x2c12f7=tempTableName;_0x28e1b9['push'](_0x6642('0x8c')+_0x2c12f7+_0x6642('0x8d'));logger[_0x6642('0x5a')](_0x6642('0x8e'),contactItemTypes[_0x6642('0x1e')]);var _0x40e2bf=util[_0x6642('0xd')](_0x6642('0x8f'),_0x5b6d62,_0x2c12f7,_0x8bbbb9,_0x393cee['ListId'],_0x393cee['CompanyId']||null,NOW,NOW);if(_[_0x6642('0x1f')](_0x2acc5f[_0x6642('0x36')])){_0x40e2bf+=_0x6642('0x90');}_0x28e1b9[_0x6642('0x20')](_0x40e2bf);BPromise[_0x6642('0x91')](_0x28e1b9,handleQuery)[_0x6642('0x22')](function(_0x3df5fa){BPromise[_0x6642('0x21')]([handleAdditionalPhones()])['then'](function(){_0x28e1b9=[];for(var _0xbc27f=0x0;_0xbc27f_0x5407f5[_0xe56f('0x66')]===_0x3074e4);let _0x28ef74=contactItemTypes[_0xe56f('0x6e')](_0x22dfc4=>_0x22dfc4[_0xe56f('0x66')]+'_description'===_0x3074e4);if(_['isNil'](_0x55985f)&&_['isNil'](_0x28ef74)){if(_0x92b989['hasOwnProperty'](_0x3074e4)){if(_0x4c96ca['data'][_0x2a266d][_0x92b989[_0x3074e4]]){var _0x38019e=_['trim'](_0x4c96ca[_0xe56f('0x6b')][_0x2a266d][_0x92b989[_0x3074e4]][_0xe56f('0x6f')](/"/g,'\x27'));switch(_0x3074e4){case _0xe56f('0x32'):var _0x7755c4=moment(_0x38019e,_0xe56f('0xc'),!![]);if(_0x7755c4[_0xe56f('0x70')]()){_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x38019e+'\x22');}else{_0x310017[_0xe56f('0x1a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xe56f('0x36'):var _0xb3eb56=parseInt(_0x38019e);_0x38019e=_['isNaN'](_0xb3eb56)||_0xb3eb56<0x0||_0xb3eb56>0x4?_0x1c72f4?0x3:0x2:_0xb3eb56;_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x38019e+'\x22');break;case _0xe56f('0x37'):var _0x485dfd=parseInt(_0x38019e);if(_[_0xe56f('0x71')](_0x485dfd)&&_[_0xe56f('0x72')](_0x104d51,_0x485dfd)){_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x485dfd+'\x22');}else{_0x310017[_0xe56f('0x1a')](_0xe56f('0x73'));}break;case _0xe56f('0x74'):if(isEmail(_0x38019e)){_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x38019e+'\x22');}else{_0x310017['push'](_0xe56f('0x75'));}break;case _0xe56f('0x76'):var _0x52276e=moment(_0x38019e,_0xe56f('0x77'),!![]);if(_0x52276e['isValid']()){_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x38019e+'\x22');}else{_0x310017[_0xe56f('0x1a')](_0xe56f('0x78'));}break;default:_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x38019e+'\x22');}}else{switch(_0x3074e4){case _0xe56f('0x79'):case _0xe56f('0x10'):_0x310017[_0xe56f('0x1a')](_0x3074e4+_0xe56f('0x7a'));break;default:_0xc15eb2[_0xe56f('0x1a')]('\x22\x22');}}}}else{var _0x1dac38='';if(!_[_0xe56f('0x18')](_0x55985f)){if(!_0x256ce6[_0xe56f('0x7b')](_0x55985f['id'])){for(var _0xb783f2=0x0;_0xb783f2<_0x92b989[_0x3074e4]['length'];_0xb783f2++){var _0x38019e=_[_0xe56f('0x7c')](_0x4c96ca[_0xe56f('0x6b')][_0x2a266d][_0x92b989[_0x3074e4][_0xb783f2]][_0xe56f('0x6f')](/"/g,'\x27'));var _0x445a61=phoneDescriptions[_0xe56f('0x6e')](_0xd2dd5c=>_0xd2dd5c[_0xe56f('0x7d')]===_0x55985f['id']);if(!_['isNil'](_0x445a61)){var _0x2475e3=_[_0xe56f('0x7c')](_0x4c96ca[_0xe56f('0x6b')][_0x2a266d][_0x92b989[_0x445a61['description']][0x0]][_0xe56f('0x6f')](/"/g,'\x27'));if(!_[_0xe56f('0x18')](_0x2475e3))_0x38019e=_0x38019e+'§'+_0x2475e3;}if(_0x1dac38=='')_0x1dac38=_0x38019e;else _0x1dac38+='|'+_0x38019e;}_0x31c56b[_0xe56f('0x1a')](_0x55985f['id']+':'+_0x1dac38);_0x256ce6[_0x55985f['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc15eb2[_0xe56f('0x1a')]('\x22'+_0x31c56b['join'](';')+'\x22');}if(_0x310017[_0xe56f('0x17')]){handleError(_0x4c96ca[_0xe56f('0x6b')][_0x2a266d],{'code':_0xe56f('0x7e'),'message':_0x310017[_0xe56f('0x11')]()});}else{fs['appendFileSync'](_0x599622,_0xc15eb2[_0xe56f('0x11')]()+'\x0a');}_0xc15eb2=[];}if(!(stats[_0xe56f('0x6c')]%0xc8)){socket[_0xe56f('0x7f')]('contact:import:'+_0x58fa85,stats);stats[_0xe56f('0x6d')]=[];}}if(stopped){logger[_0xe56f('0x58')](_0xe56f('0x80'));_0x9679c9[_0xe56f('0x81')]();}}catch(_0x276b84){handleError(_0x4c96ca[_0xe56f('0x6b')][_0x2a266d],{'code':_0xe56f('0x82'),'message':_0x276b84[_0xe56f('0x5b')]});logger[_0xe56f('0x1e')]('step',_0x276b84[_0xe56f('0x5b')]);}},'complete':function(){try{var _0x29583a=[];var _0x598d06=tempTableName;_0x29583a[_0xe56f('0x1a')](_0xe56f('0x83')+_0x598d06+_0xe56f('0x84'));logger[_0xe56f('0x58')]('CIS\x20len',contactItemTypes[_0xe56f('0x17')]);var _0x53cf7c=util[_0xe56f('0xb')](_0xe56f('0x85'),_0x599622,_0x598d06,_0x3b6962,_0x277258[_0xe56f('0x33')],_0x277258[_0xe56f('0x54')]||null,NOW,NOW);if(_[_0xe56f('0x18')](_0x92b989[_0xe56f('0x32')])){_0x53cf7c+=_0xe56f('0x86');}_0x29583a[_0xe56f('0x1a')](_0x53cf7c);BPromise[_0xe56f('0x87')](_0x29583a,handleQuery)[_0xe56f('0x1c')](function(_0x1eb33f){BPromise[_0xe56f('0x1b')]([handleAdditionalPhones()])[_0xe56f('0x1c')](function(){_0x29583a=[];for(var _0x3ab009=0x0;_0x3ab009\x20\x20');}var _0x3551d5=path[_0xe56f('0x11')](config[_0xe56f('0x93')],_0xe56f('0x62'),process[_0xe56f('0x92')][0x2]);if(!fs['existsSync'](_0x3551d5)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x48de58={};try{_0x48de58=JSON[_0xe56f('0x6a')](process[_0xe56f('0x92')][0x3]);if(!_0x48de58['binding']){throw new Error(_0xe56f('0x94'));}var _0x2a6d34=0x0;if(_0x48de58[_0xe56f('0x5f')][_0xe56f('0x37')]){_0x2a6d34=0x1;}if(!_0x48de58[_0xe56f('0x33')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x40a0b9){throw new Error(_0xe56f('0x95'));}var _0x305c43=[];try{_0x305c43=_[_0xe56f('0x96')](JSON[_0xe56f('0x6a')](process['argv'][0x4]),'id');}catch(_0x52570a){logger[_0xe56f('0x58')](_0xe56f('0x97'));}main(_0x3551d5,_0x48de58,_0x305c43,_0x2a6d34);}validate();process['on']('SIGINT',handleStop);process['on'](_0xe56f('0x98'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 064e221..78eb9e5 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf7a8=['variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','voice','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','Date','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue'];(function(_0x1965a2,_0x5b4a4e){var _0x32aa72=function(_0x30c78f){while(--_0x30c78f){_0x1965a2['push'](_0x1965a2['shift']());}};_0x32aa72(++_0x5b4a4e);}(_0xf7a8,0xfb));var _0x8f7a=function(_0x43e68a,_0x19ca8a){_0x43e68a=_0x43e68a-0x0;var _0x4f5981=_0xf7a8[_0x43e68a];return _0x4f5981;};'use strict';exports[_0x8f7a('0x0')]=function(_0x14513a,_0xfc4bb9){var _0x12e3b8=[{'type':_0x8f7a('0x1'),'content':_0x8f7a('0x2'),'variableName':null}];switch(_0x14513a['toLowerCase']()){case'voice':switch(_0xfc4bb9[_0x8f7a('0x3')]()){case _0x8f7a('0x4'):_0x12e3b8[_0x8f7a('0x5')]({'type':'variable','content':'','variableName':_0x8f7a('0x6')});_0x12e3b8['push']({'type':_0x8f7a('0x7'),'content':'','variableName':_0x8f7a('0x8')});break;case _0x8f7a('0x9'):_0x12e3b8[_0x8f7a('0x5')]({'type':_0x8f7a('0x1'),'content':_0x8f7a('0xa'),'variableName':null});_0x12e3b8['push']({'type':'variable','content':'','variableName':_0x8f7a('0xb')});break;}}return _0x12e3b8;};exports[_0x8f7a('0xc')]=function(_0x2fff0b,_0x4f3680){var _0x4a3679=[];switch(_0x2fff0b['toLowerCase']()){case _0x8f7a('0xd'):switch(_0x4f3680[_0x8f7a('0x3')]()){case _0x8f7a('0x4'):_0x4a3679=[{'type':_0x8f7a('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0xf'),'keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x8')},{'type':'keyValue','content':'','key':_0x8f7a('0x10'),'keyType':_0x8f7a('0x7'),'variableName':'calleridname'},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x11'),'keyType':'variable','variableName':'destexten'},{'type':'keyValue','content':'','key':'Queue','keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x6')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x12'),'keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x13')},{'type':_0x8f7a('0xe'),'content':'','key':'Date','keyType':'variable','variableName':_0x8f7a('0x14')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x15'),'keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x16')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x17'),'keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0xb')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x8f7a('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x14')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x18'),'keyType':'variable','variableName':_0x8f7a('0x19')},{'type':_0x8f7a('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x1a')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x1b'),'keyType':'variable','variableName':_0x8f7a('0x1c')},{'type':'keyValue','content':'','key':_0x8f7a('0x1d'),'keyType':_0x8f7a('0x7'),'variableName':_0x8f7a('0x1e')}];break;case _0x8f7a('0x9'):_0x4a3679=[{'type':'string','content':_0x8f7a('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x8f7a('0x20'),'keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0xb')},{'type':_0x8f7a('0xe'),'content':'','key':'Member\x20Name','keyType':'variable','keyContent':'','variableName':_0x8f7a('0x21')},{'type':_0x8f7a('0xe'),'content':'','key':'UniqueId','keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0x13')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x22'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x8f7a('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x23'),'keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0x24')},{'type':'keyValue','content':'','key':_0x8f7a('0x25'),'keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0x26')},{'type':_0x8f7a('0xe'),'content':'','key':_0x8f7a('0x27'),'keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0x28')},{'type':'keyValue','content':'','key':_0x8f7a('0x29'),'keyType':_0x8f7a('0x7'),'keyContent':'','variableName':_0x8f7a('0x2a')}];break;}}return _0x4a3679;}; \ No newline at end of file +var _0x9a0d=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','agentcalledAt','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Member\x20Name','membername','uniqueid','Date','Answer\x20Time','answertime','endtime','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','push','calleridnum','Outbound\x20Call','variable','destcalleridnum','getDescriptions','voice'];(function(_0x582ec8,_0xd2eb75){var _0x2efd1a=function(_0x9e1741){while(--_0x9e1741){_0x582ec8['push'](_0x582ec8['shift']());}};_0x2efd1a(++_0xd2eb75);}(_0x9a0d,0x135));var _0xd9a0=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x9a0d[_0x434804];return _0x573fc8;};'use strict';exports[_0xd9a0('0x0')]=function(_0x5b50b8,_0x29dd73){var _0x4e4a7c=[{'type':_0xd9a0('0x1'),'content':_0xd9a0('0x2'),'variableName':null}];switch(_0x5b50b8[_0xd9a0('0x3')]()){case'voice':switch(_0x29dd73[_0xd9a0('0x3')]()){case'inbound':_0x4e4a7c[_0xd9a0('0x4')]({'type':'variable','content':'','variableName':'queue'});_0x4e4a7c[_0xd9a0('0x4')]({'type':'variable','content':'','variableName':_0xd9a0('0x5')});break;case'outbound':_0x4e4a7c[_0xd9a0('0x4')]({'type':'string','content':_0xd9a0('0x6'),'variableName':null});_0x4e4a7c['push']({'type':_0xd9a0('0x7'),'content':'','variableName':_0xd9a0('0x8')});break;}}return _0x4e4a7c;};exports[_0xd9a0('0x9')]=function(_0xcfe1ed,_0x1661b4){var _0x19388b=[];switch(_0xcfe1ed[_0xd9a0('0x3')]()){case _0xd9a0('0xa'):switch(_0x1661b4[_0xd9a0('0x3')]()){case'inbound':_0x19388b=[{'type':_0xd9a0('0x1'),'content':_0xd9a0('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0xd'),'keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x5')},{'type':_0xd9a0('0xc'),'content':'','key':'Caller\x20Name','keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0xe')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0xf'),'keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x10')},{'type':'keyValue','content':'','key':_0xd9a0('0x11'),'keyType':'variable','variableName':_0xd9a0('0x12')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x13'),'keyType':_0xd9a0('0x7'),'variableName':'uniqueid'},{'type':_0xd9a0('0xc'),'content':'','key':'Date','keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x14')},{'type':_0xd9a0('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xd9a0('0xc'),'content':'','key':'Agent\x20Name','keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x15')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x16'),'keyType':_0xd9a0('0x7'),'variableName':'destcalleridnum'},{'type':_0xd9a0('0x1'),'content':_0xd9a0('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x18'),'keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x14')},{'type':_0xd9a0('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0xd9a0('0x19')},{'type':_0xd9a0('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x1a')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x1b'),'keyType':'variable','variableName':_0xd9a0('0x1c')},{'type':'keyValue','content':'','key':_0xd9a0('0x1d'),'keyType':_0xd9a0('0x7'),'variableName':_0xd9a0('0x1e')}];break;case _0xd9a0('0x1f'):_0x19388b=[{'type':_0xd9a0('0x1'),'content':_0xd9a0('0xb'),'variableName':null},{'type':_0xd9a0('0xc'),'content':'','key':'Called\x20Number','keyType':_0xd9a0('0x7'),'keyContent':'','variableName':_0xd9a0('0x8')},{'type':'keyValue','content':'','key':_0xd9a0('0x20'),'keyType':_0xd9a0('0x7'),'keyContent':'','variableName':_0xd9a0('0x21')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x13'),'keyType':'variable','keyContent':'','variableName':_0xd9a0('0x22')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x23'),'keyType':_0xd9a0('0x7'),'keyContent':'','variableName':'starttime'},{'type':_0xd9a0('0x1'),'content':_0xd9a0('0x17')},{'type':_0xd9a0('0xc'),'content':'','key':_0xd9a0('0x24'),'keyType':_0xd9a0('0x7'),'keyContent':'','variableName':_0xd9a0('0x25')},{'type':_0xd9a0('0xc'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xd9a0('0x26')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xd9a0('0x7'),'keyContent':'','variableName':_0xd9a0('0x27')}];break;}}return _0x19388b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index fb83bdc..bc11ea5 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f88=['search','parseAdvancedSearchFilter','parseQueryParameters','where','body','default','filter','having','read','tags','group','i.id','ids','tag','countFilteredInteractions','length','count','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','catch','user','query','omit','phone','fax','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','getInteractionsQuery','resolve','then'];(function(_0x29f4de,_0x429e32){var _0x21c048=function(_0x42c198){while(--_0x42c198){_0x29f4de['push'](_0x29f4de['shift']());}};_0x21c048(++_0x429e32);}(_0x7f88,0x188));var _0x87f8=function(_0x29547,_0x440487){_0x29547=_0x29547-0x0;var _0x4834cb=_0x7f88[_0x29547];return _0x4834cb;};'use strict';var _=require(_0x87f8('0x0'));var sqlUtils=require(_0x87f8('0x1'));var utils=require(_0x87f8('0x2'));exports[_0x87f8('0x3')]=function(_0xa38ed3,_0x53e784,_0x341556,_0x487757,_0xff05cf){var _0x29c5b4={'count':0x0,'rows':[]};var _0x90e28b=sqlUtils[_0x87f8('0x4')](_0xa38ed3,_0x341556,_0x53e784);if(_0x90e28b){return Promise['resolve'](_0x29c5b4);}var _0x3c932c=sqlUtils[_0x87f8('0x5')](_0xa38ed3);var _0xe57cc={};return Promise[_0x87f8('0x6')]()[_0x87f8('0x7')](function(){if(_0x53e784[_0x87f8('0x8')]){return sqlUtils[_0x87f8('0x9')](_0x53e784['search'],_0xff05cf);}else{return sqlUtils[_0x87f8('0xa')](_0xa38ed3,_0x53e784,_0xff05cf);}})[_0x87f8('0x7')](function(_0x42e5d0){_0x3c932c[_0x87f8('0xb')](_0x42e5d0[_0x87f8('0xc')]);_0x3c932c['where'](_0x42e5d0['contact']);_0x3c932c[_0x87f8('0xb')](_0x42e5d0[_0x87f8('0xd')]);_0x3c932c['where'](_0x42e5d0['fields']);_0x3c932c[_0x87f8('0xb')](_0x42e5d0[_0x87f8('0xe')]);_0x3c932c[_0x87f8('0xb')](_0x42e5d0['user']);_0x3c932c[_0x87f8('0xf')](_0x42e5d0[_0x87f8('0x10')]);_0xe57cc=_0x42e5d0[_0x87f8('0x11')];return sqlUtils['checkAccountsRestrictions'](_0xa38ed3,_0x341556,_0x53e784);})[_0x87f8('0x7')](function(_0xc9c1be){_0x3c932c['where'](_0xc9c1be);_0x3c932c[_0x87f8('0x12')](_0x87f8('0x13'));var _0x3f10b1=_0x53e784[_0x87f8('0x8')]?_0xe57cc[_0x87f8('0x14')]:_0x53e784[_0x87f8('0x15')];return sqlUtils[_0x87f8('0x16')](_0x3c932c,_0x3f10b1);})['then'](function(_0x44c8d4){_0x29c5b4['count']=_0x44c8d4[_0x87f8('0x17')];if(_0x29c5b4[_0x87f8('0x18')]===0x0){return[];}_0x3c932c['having'](_0xe57cc[_0x87f8('0x19')]);if(_0x487757[_0x87f8('0x1a')]){_0x487757[_0x87f8('0x1a')][_0x87f8('0x1b')](function(_0x4e941f){var _0x33730c=_0x4e941f[0x0]===_0x87f8('0x1c')?_0x4e941f[0x0]:'i.'+_0x4e941f[0x0];_0x3c932c[_0x87f8('0x1a')](_0x33730c,_0x4e941f[0x1]===_0x87f8('0x1d')?![]:!![]);if(_0x4e941f[0x0]===_0x87f8('0x1e')){var _0xfbda4a=sqlUtils[_0x87f8('0x1f')](_0xa38ed3,_0x53e784);_0x3c932c[_0x87f8('0x1a')](_0xfbda4a,_0x4e941f[0x1]===_0x87f8('0x1d')?![]:!![]);}});}return sqlUtils[_0x87f8('0x20')](_0xa38ed3,_0x3c932c,_0x53e784,_0x487757);})['then'](function(_0x3783c8){_0x29c5b4[_0x87f8('0x21')]=_0x3783c8;return _0x29c5b4;})[_0x87f8('0x22')](function(_0x4f7f0a){throw _0x4f7f0a;});};exports['tracked']=function(_0x1c5711,_0x3517e6){return function(_0x127de7,_0xe5bdfb,_0x292e52){var _0x43f42b=_0x127de7[_0x87f8('0x23')];var _0x16f4db={};var _0x1834dd=_0x127de7[_0x87f8('0x24')];if(_0x16f4db){_0x16f4db=_['clone'](_0x127de7[_0x87f8('0xc')]);_0x16f4db=_[_0x87f8('0x25')](_0x16f4db,['body','html',_0x87f8('0x26'),_0x87f8('0x27'),'mobile']);}utils['updateUser'](_0x43f42b,_0x16f4db,_0x1834dd,_0x1c5711,_0x3517e6);_0x292e52(null);};}; \ No newline at end of file +var _0x7dd2=['checkAccountsRestrictions','group','ids','tag','countFilteredInteractions','count','clause','order','forEach','contactName','DESC','closed','getClosedOrderClause','getFilteredInteractions','catch','query','clone','omit','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','then','search','parseQueryParameters','body','where','default','filter','user','having','read'];(function(_0x5d0df8,_0x508835){var _0x46f18b=function(_0x282eec){while(--_0x282eec){_0x5d0df8['push'](_0x5d0df8['shift']());}};_0x46f18b(++_0x508835);}(_0x7dd2,0x14f));var _0x27dd=function(_0x305e5f,_0x45715f){_0x305e5f=_0x305e5f-0x0;var _0x329033=_0x7dd2[_0x305e5f];return _0x329033;};'use strict';var _=require(_0x27dd('0x0'));var sqlUtils=require(_0x27dd('0x1'));var utils=require(_0x27dd('0x2'));exports[_0x27dd('0x3')]=function(_0x3a717f,_0x2e033f,_0x260b6a,_0x47f5d7,_0x26e42d){var _0x1d780d={'count':0x0,'rows':[]};var _0x4745bc=sqlUtils[_0x27dd('0x4')](_0x3a717f,_0x260b6a,_0x2e033f);if(_0x4745bc){return Promise[_0x27dd('0x5')](_0x1d780d);}var _0x2b377c=sqlUtils['getInteractionsQuery'](_0x3a717f);var _0x431d5f={};return Promise[_0x27dd('0x5')]()[_0x27dd('0x6')](function(){if(_0x2e033f[_0x27dd('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x2e033f[_0x27dd('0x7')],_0x26e42d);}else{return sqlUtils[_0x27dd('0x8')](_0x3a717f,_0x2e033f,_0x26e42d);}})['then'](function(_0x5833bd){_0x2b377c['where'](_0x5833bd[_0x27dd('0x9')]);_0x2b377c[_0x27dd('0xa')](_0x5833bd['contact']);_0x2b377c[_0x27dd('0xa')](_0x5833bd[_0x27dd('0xb')]);_0x2b377c[_0x27dd('0xa')](_0x5833bd['fields']);_0x2b377c['where'](_0x5833bd[_0x27dd('0xc')]);_0x2b377c[_0x27dd('0xa')](_0x5833bd[_0x27dd('0xd')]);_0x2b377c[_0x27dd('0xe')](_0x5833bd[_0x27dd('0xf')]);_0x431d5f=_0x5833bd['tags'];return sqlUtils[_0x27dd('0x10')](_0x3a717f,_0x260b6a,_0x2e033f);})[_0x27dd('0x6')](function(_0x359bb3){_0x2b377c[_0x27dd('0xa')](_0x359bb3);_0x2b377c[_0x27dd('0x11')]('i.id');var _0x54bf66=_0x2e033f[_0x27dd('0x7')]?_0x431d5f[_0x27dd('0x12')]:_0x2e033f[_0x27dd('0x13')];return sqlUtils[_0x27dd('0x14')](_0x2b377c,_0x54bf66);})[_0x27dd('0x6')](function(_0x57f9ed){_0x1d780d['count']=_0x57f9ed['length'];if(_0x1d780d[_0x27dd('0x15')]===0x0){return[];}_0x2b377c[_0x27dd('0xe')](_0x431d5f[_0x27dd('0x16')]);if(_0x47f5d7[_0x27dd('0x17')]){_0x47f5d7[_0x27dd('0x17')][_0x27dd('0x18')](function(_0x46b7bc){var _0x282507=_0x46b7bc[0x0]===_0x27dd('0x19')?_0x46b7bc[0x0]:'i.'+_0x46b7bc[0x0];_0x2b377c['order'](_0x282507,_0x46b7bc[0x1]===_0x27dd('0x1a')?![]:!![]);if(_0x46b7bc[0x0]===_0x27dd('0x1b')){var _0x2aa697=sqlUtils[_0x27dd('0x1c')](_0x3a717f,_0x2e033f);_0x2b377c[_0x27dd('0x17')](_0x2aa697,_0x46b7bc[0x1]===_0x27dd('0x1a')?![]:!![]);}});}return sqlUtils[_0x27dd('0x1d')](_0x3a717f,_0x2b377c,_0x2e033f,_0x47f5d7);})[_0x27dd('0x6')](function(_0x12cfe8){_0x1d780d['rows']=_0x12cfe8;return _0x1d780d;})[_0x27dd('0x1e')](function(_0x4eb61f){throw _0x4eb61f;});};exports['tracked']=function(_0x45f5c8,_0x469b04){return function(_0x37993a,_0x103452,_0x355b0b){var _0x1ce2e1=_0x37993a[_0x27dd('0xd')];var _0xcca9e0={};var _0x2e19f1=_0x37993a[_0x27dd('0x1f')];if(_0xcca9e0){_0xcca9e0=_[_0x27dd('0x20')](_0x37993a[_0x27dd('0x9')]);_0xcca9e0=_[_0x27dd('0x21')](_0xcca9e0,[_0x27dd('0x9'),_0x27dd('0x22'),_0x27dd('0x23'),_0x27dd('0x24'),_0x27dd('0x25')]);}utils[_0x27dd('0x26')](_0x1ce2e1,_0xcca9e0,_0x2e19f1,_0x45f5c8,_0x469b04);_0x355b0b(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 8de53e0..1f4daa7 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57d4=['i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','type','value','start','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','text','keys','compact','forEach','\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','then','fields','tag','filter','get','capitalize','chat','Websites','resolve','role','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','sequelize','findOne','enableEmailPreview','all','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','agent','search','field','name','getInteractionFK','user_has_','_interactions','select','u.id','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','where','map','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax'];(function(_0x5f50eb,_0x3e7d18){var _0xb912b6=function(_0x19d99d){while(--_0x19d99d){_0x5f50eb['push'](_0x5f50eb['shift']());}};_0xb912b6(++_0x3e7d18);}(_0x57d4,0x78));var _0x457d=function(_0x2362be,_0x43cef1){_0x2362be=_0x2362be-0x0;var _0x42f965=_0x57d4[_0x2362be];return _0x42f965;};'use strict';var _=require(_0x457d('0x0'));var squel=require(_0x457d('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x457d('0x2'));var updateInteraction=require(_0x457d('0x3'))[_0x457d('0x4')];var utils=require(_0x457d('0x5'));var db=require(_0x457d('0x6'))['db'];function skipInteractionsQuery(_0x3c89b2,_0x3e2239,_0x1f5b4e){var _0x4745ed=![];var _0x247ec7=utils[_0x457d('0x7')](_0x3c89b2);if(_0x3e2239['role']===_0x457d('0x8')&&!_0x1f5b4e[_0x457d('0x9')]&&!_0x1f5b4e[_0x247ec7]){_0x4745ed=!![];}return _0x4745ed;}function getTagsQuery(){return squel['select']()['field']('id')[_0x457d('0xa')](_0x457d('0xb'))[_0x457d('0xa')]('color')['from']('tools_tags');}function getUsersQuery(_0x2214e6,_0x38ec93){var _0x449f48=utils[_0x457d('0xc')](_0x2214e6);var _0x25ae31=_0x457d('0xd')+_0x2214e6+_0x457d('0xe');var _0x24cf65=squel[_0x457d('0xf')]()['field'](_0x457d('0x10'))[_0x457d('0xa')]('u.fullname')['field'](_0x457d('0x11')+_0x449f48)[_0x457d('0x12')](_0x25ae31,'ui')[_0x457d('0x13')](_0x457d('0x14'),'u',_0x457d('0x15'));if(_0x38ec93[_0x457d('0x16')]>0x0){_0x24cf65[_0x457d('0x17')](_0x457d('0x11')+_0x449f48+'\x20IN\x20?',_[_0x457d('0x18')](_0x38ec93,'id'));}return _0x24cf65;}function getInteractionsQuery(_0x1ebc33){var _0x2c05ca=utils['getInteractionsTables'](_0x1ebc33);var _0x4919da=utils[_0x457d('0x7')](_0x1ebc33);var _0x4d988f=utils[_0x457d('0xc')](_0x1ebc33);return squel[_0x457d('0xf')]()['from'](_0x2c05ca[_0x457d('0x19')],'i')['left_join']('cm_contacts','c',_0x457d('0x1a'))[_0x457d('0x13')](_0x457d('0x14'),'o',_0x457d('0x1b'))[_0x457d('0x13')](_0x2c05ca[_0x457d('0x1c')],'a',_0x457d('0x1d')+_0x4919da)[_0x457d('0x13')](_0x2c05ca[_0x457d('0x1e')],'me',_0x457d('0x1f')+_0x4d988f+'\x20=\x20i.id')['left_join'](_0x2c05ca['interactionsTags'],'it',_0x457d('0x20')+_0x4d988f+'\x20=\x20i.id')['left_join']('tools_tags','t',_0x457d('0x21'));}function getSqlClauses(){var _0x1eedc5={'body':squel['expr'](),'contact':squel[_0x457d('0x22')](),'default':squel[_0x457d('0x22')](),'fields':squel[_0x457d('0x22')](),'filter':squel[_0x457d('0x22')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x457d('0x22')]()};return _0x1eedc5;}function parseTagParameter(_0x47feed){var _0x3d1ca7=squel[_0x457d('0x22')]();if(_0x47feed){var _0x2eb87e=utils[_0x457d('0x23')](_0x47feed);_0x2eb87e['forEach'](function(_0x298dd4){_0x3d1ca7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298dd4+',%');});}return _0x3d1ca7;}function parseReadParameter(_0x4eb5ca){var _0x1945f5='';if(_0x4eb5ca){_0x1945f5=_0x457d('0x24');if(_0x4eb5ca==='1'){_0x1945f5=_0x1945f5['replace'](_0x457d('0x25'),'=');}else{_0x1945f5=_0x1945f5[_0x457d('0x26')]('{OPERATOR}','>');}}return _0x1945f5;}function parseSearchFilter(_0xec380b,_0x41f012){var _0x4660c3=squel[_0x457d('0x22')]();if(_0x41f012){var _0x381a9d=_0x41f012[_0x457d('0x26')]('\x5c','\x5c\x5c')[_0x457d('0x26')](/'/g,'\x27\x27');if(qs[_0x457d('0x27')](_0x381a9d)){_0x4660c3['or'](_0x457d('0x28'),_0x381a9d+'%');if([_0x457d('0x29'),_0x457d('0x2a')][_0x457d('0x2b')](_0xec380b)){_0x4660c3['or'](_0x457d('0x2c'),_0x381a9d+'%');}else if(_0xec380b===_0x457d('0x2d')){_0x4660c3['or'](_0x457d('0x2e'),_0x381a9d+'%');}else if(_0xec380b===_0x457d('0x2f')){_0x4660c3['or'](_0x457d('0x30'),_0x381a9d+'%');}}else if(_0xec380b===_0x457d('0x31')&&qs['isEmail'](_0x381a9d)){_0x4660c3['or'](_0x457d('0x32'),_0x381a9d+'%');}else{if(_0xec380b===_0x457d('0x31')){_0x4660c3['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x381a9d))['or'](_0x457d('0x33'),qs[_0x457d('0x34')](_0x381a9d));}else{if(_0xec380b!=='fax'){_0x4660c3['or'](_0x457d('0x35'),qs[_0x457d('0x34')](_0x381a9d));}_0x4660c3['or'](_0x457d('0x36'),_0x381a9d+'%');}}}return _0x4660c3;}function parseAdvancedSearchFilter(_0x1076e6,_0x17eefd){var _0x36a90b=getSqlClauses();var _0x17f011=as[_0x457d('0x37')](_0x1076e6);var _0x37bc38=_0x17f011[_0x457d('0x38')];for(var _0x20bab0=0x0;_0x20bab0<_0x17f011[_0x457d('0x39')][_0x457d('0x16')];_0x20bab0++){var _0xc5a344=_0x17f011[_0x457d('0x39')][_0x20bab0];var _0x4b29a1='i';var _0x27811b=_['find'](_0x17eefd,['name',_0xc5a344['field']]);if(_0x27811b){var _0x1c2491=as['buildExpression'](_0x4b29a1,_0x27811b[_0x457d('0x3a')],_0xc5a344);_0x36a90b['default'][_0x37bc38](_0x1c2491['text'],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3c')],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3d')]);}else{switch(_0xc5a344[_0x457d('0xa')]){case _0x457d('0x3e'):var _0x23a9ee=parseReadParameter(_0xc5a344[_0x457d('0x3b')]);_0x36a90b[_0x457d('0x3f')][_0x457d('0x40')](_0x23a9ee);break;case _0x457d('0x41'):if(_0xc5a344[_0x457d('0x42')]===_0x457d('0x43')){if(_0xc5a344[_0x457d('0x3b')][_0x457d('0x44')]('\x20')[_0x457d('0x16')]>0x1){_0x36a90b[_0x457d('0x45')][_0x37bc38]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x457d('0x34')](_0xc5a344['value']),null);}else{var _0xaa8ded='%'+_0xc5a344[_0x457d('0x3b')]+'%';_0x36a90b[_0x457d('0x45')][_0x37bc38](_0x457d('0x46'),_0xaa8ded,_0xaa8ded,_0xaa8ded);}}else{_0x27811b=_[_0x457d('0x47')](_0x17eefd,['name','ContactId']);_0xc5a344[_0x457d('0xa')]='ContactId';_0x1c2491=as[_0x457d('0x48')](_0x4b29a1,_0x27811b[_0x457d('0x3a')],_0xc5a344);_0x36a90b[_0x457d('0x45')][_0x37bc38](_0x1c2491['text'],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3c')],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3d')]);}break;case _0x457d('0x49'):var _0xc61898=_0xc5a344[_0x457d('0x3b')][_0x457d('0x44')](',')[_0x457d('0x18')](function(_0x4a9896){return Number(_0x4a9896);});var _0x4b01f2=parseTagParameter(_0xc61898);_0x36a90b[_0x457d('0x4a')][_0x457d('0x4b')][_0x457d('0x40')](_0x4b01f2);_0x36a90b[_0x457d('0x4a')][_0x457d('0x4c')]=_0xc61898;break;case _0x457d('0x4d'):if(_0xc5a344['operator']===_0x457d('0x43')){_0x36a90b[_0x457d('0x4e')][_0x37bc38](_0x457d('0x4f'),'%'+_0xc5a344['value']+'%',null);}else{_0x27811b=_[_0x457d('0x47')](_0x17eefd,[_0x457d('0xb'),_0x457d('0x50')]);_0xc5a344['field']=_0x457d('0x50');_0x1c2491=as[_0x457d('0x48')](_0x4b29a1,_0x27811b[_0x457d('0x3a')],_0xc5a344);_0x36a90b[_0x457d('0x4e')][_0x37bc38](_0x1c2491['text'],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3c')],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3d')]);}break;case _0x457d('0x51'):case _0x457d('0x52'):_0x1c2491=as[_0x457d('0x48')]('me',null,_0xc5a344);_0x36a90b[_0x457d('0x51')][_0x37bc38](_0x1c2491[_0x457d('0x53')],_0x1c2491[_0x457d('0x3b')]['start'],_0x1c2491[_0x457d('0x3b')][_0x457d('0x3d')]);break;}}}return _0x36a90b;}function parseModelFields(_0x7abdf1,_0x545e67,_0x481a89){var _0x450ad7=utils[_0x457d('0x7')](_0x7abdf1);var _0x107ad7=squel[_0x457d('0x22')]();var _0x3f10a8=_(_0x545e67)[_0x457d('0x54')]()[_0x457d('0x18')](function(_0x7a1e61){return _['some'](_0x481a89,['name',_0x7a1e61])?_0x7a1e61:undefined;})[_0x457d('0x55')]()[_0x457d('0x3b')]();if(_0x3f10a8[_0x457d('0x16')]>0x0){_0x3f10a8[_0x457d('0x56')](function(_0x2ecac7){if(_0x2ecac7===_0x450ad7){_0x107ad7[_0x457d('0x40')]('i.'+_0x450ad7+_0x457d('0x57'),[][_0x457d('0x58')](_0x545e67[_0x2ecac7]));}else if(_0x2ecac7===_0x457d('0x59')){var _0x1faeaf=JSON[_0x457d('0x5a')](_0x545e67[_0x2ecac7])[_0x457d('0x5b')];var _0x19c05e=JSON[_0x457d('0x5a')](_0x545e67[_0x2ecac7])['$lte'];_0x107ad7[_0x457d('0x40')](_0x457d('0x5c'),_0x1faeaf,_0x19c05e);}else{if(_0x545e67[_0x2ecac7]===_0x457d('0x5d')){_0x107ad7[_0x457d('0x40')]('i.'+_0x2ecac7+'\x20IS\x20NULL');}else{_0x107ad7[_0x457d('0x40')]('i.'+_0x2ecac7+_0x457d('0x5e'),_0x545e67[_0x2ecac7]);}}});}return _0x107ad7;}function parseQueryParameters(_0x55b867,_0x61519d,_0x114886){var _0x3688b3=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x55b867,_0x61519d,_0x114886);})[_0x457d('0x5f')](function(_0x58642e){_0x3688b3[_0x457d('0x60')][_0x457d('0x40')](_0x58642e);return parseReadParameter(_0x61519d[_0x457d('0x3f')]);})[_0x457d('0x5f')](function(_0x2f79d8){_0x3688b3[_0x457d('0x3f')][_0x457d('0x40')](_0x2f79d8);return parseTagParameter(_0x61519d[_0x457d('0x61')]);})[_0x457d('0x5f')](function(_0xe1c287){_0x3688b3[_0x457d('0x4a')][_0x457d('0x4b')][_0x457d('0x40')](_0xe1c287);return parseSearchFilter(_0x55b867,_0x61519d[_0x457d('0x62')]);})['then'](function(_0x2969b4){_0x3688b3[_0x457d('0x62')]=_0x2969b4;return _0x3688b3;});}function checkAccountsRestrictions(_0x4e865a,_0x2af073,_0x48084f){var _0x125f6f=utils[_0x457d('0x7')](_0x4e865a);var _0x57a690=_0x457d('0x63')+_[_0x457d('0x64')](_0x4e865a)+(_0x4e865a===_0x457d('0x65')?_0x457d('0x66'):'Accounts');var _0x853fa6=squel['expr']();return Promise[_0x457d('0x67')]()['then'](function(){if(_0x48084f[_0x457d('0x9')]&&_0x2af073[_0x457d('0x68')]==='agent'){return _0x2af073[_0x57a690]({'attributes':['id'],'raw':!![]});}})[_0x457d('0x5f')](function(_0x5095d5){if(_0x5095d5){if(_0x5095d5['length']===0x0){_0x853fa6['and']('i.'+_0x125f6f+_0x457d('0x69'));}else{_0x853fa6[_0x457d('0x40')]('i.'+_0x125f6f+'\x20IN\x20?',_[_0x457d('0x18')](_0x5095d5,'id'));}}else if(!_0x48084f[_0x125f6f]){_0x853fa6[_0x457d('0x40')]('i.'+_0x125f6f+_0x457d('0x6a'));}})[_0x457d('0x5f')](function(){return _0x853fa6;});}function getClosedOrderClause(_0x1497f3,_0x463a88){var _0x3c9a87='';var _0x24a77d=[_0x457d('0x6b'),'i.secondDisposition','i.disposition'];if(_0x1497f3===_0x457d('0x31')){_0x24a77d[_0x457d('0x6c')](_0x457d('0x6d'));}if(_0x463a88[_0x457d('0x6e')]==='0'&&_0x1497f3===_0x457d('0x31')){_0x3c9a87=_0x457d('0x6d');}else{if(_0x463a88[_0x457d('0x6e')]==='1'){_0x24a77d[_0x457d('0x6f')]();}_0x3c9a87=_0x457d('0x70')+_0x24a77d[_0x457d('0x71')](',\x20')+')';}return _0x3c9a87;}function getFilteredInteractions(_0x56cfaf,_0x57316a,_0x4345f1,_0x4dc307){var _0xccaa9=utils['getInteractionFK'](_0x56cfaf);var _0x349217=_[_0x457d('0x64')](_0x56cfaf)+_0x457d('0x72');var _0x54a1e4=[];var _0x5b5385=getTagsQuery();var _0x2abe3a={'type':db[_0x457d('0x73')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1fd860=[];var _0x4526b7=[];return db['sequelize'][_0x457d('0x74')](_0x5b5385[_0x457d('0x75')](),_0x2abe3a)[_0x457d('0x5f')](function(_0x67f819){_0x54a1e4=_['keyBy'](_0x67f819,'id');_0x2abe3a=_[_0x457d('0x76')](_0x2abe3a,{'model':db[_0x349217],'mapToModel':!![],'nest':!![]});if(_0x4345f1[_0x457d('0x60')]){_0x4dc307[_0x457d('0x77')][_0x457d('0x56')](function(_0x377a5b){_0x57316a['field']('i.'+_0x377a5b);});}else{_0x57316a[_0x457d('0xa')](_0x457d('0x78'),'unreadMessages');_0x57316a['field'](_0x457d('0x79'),_0x457d('0x7a'));_0x57316a[_0x457d('0xa')](_0x457d('0x7b'),_0x457d('0x7c'));if(_0x56cfaf===_0x457d('0x31')){_0x57316a[_0x457d('0xa')](_0x457d('0x7d'),'Account.email');_0x57316a[_0x457d('0xa')](_0x457d('0x7e'),_0x457d('0x7f'));_0x57316a[_0x457d('0xa')](_0x457d('0x80'));_0x57316a['field']('i.createdAt');_0x57316a[_0x457d('0xa')]('i.updatedAt');_0x57316a['field'](_0x457d('0x81'));_0x57316a[_0x457d('0xa')](_0x457d('0x82'));_0x57316a[_0x457d('0xa')](_0x457d('0x83'));_0x57316a[_0x457d('0xa')](_0x457d('0x84'));_0x57316a[_0x457d('0xa')]('i.lastMsgDirection');_0x57316a['field'](_0x457d('0x85'));_0x57316a['field'](_0x457d('0x86'));_0x57316a[_0x457d('0xa')](_0x457d('0x87'));_0x57316a[_0x457d('0xa')]('i.thirdDisposition');_0x57316a[_0x457d('0xa')]('i.substatus');_0x57316a['field'](_0x457d('0x88'));_0x57316a['field'](_0x457d('0x89'));_0x57316a[_0x457d('0xa')](_0x457d('0x8a'));_0x57316a[_0x457d('0xa')](_0x457d('0x8b'));}else if(_0x56cfaf===_0x457d('0x2f')){_0x57316a[_0x457d('0xa')](_0x457d('0x8c'),'contactName');}else{_0x57316a[_0x457d('0xa')](_0x457d('0x8d'),_0x457d('0x7f'));}if(_0x56cfaf!==_0x457d('0x31')){_0x57316a['field']('i.*');}_0x57316a['field']('c.firstName',_0x457d('0x8e'));_0x57316a['field'](_0x457d('0x8f'),_0x457d('0x90'));_0x57316a[_0x457d('0xa')](_0x457d('0x91'),_0x457d('0x92'));_0x57316a[_0x457d('0xa')](_0x457d('0x93'),'Contact.phone');_0x57316a[_0x457d('0xa')](_0x457d('0x94'),'Contact.mobile');_0x57316a['field'](_0x457d('0x95'),_0x457d('0x96'));_0x57316a[_0x457d('0xa')]('o.fullname',_0x457d('0x97'));_0x57316a[_0x457d('0xa')](_0x457d('0x98'),_0x457d('0x99'));_0x57316a[_0x457d('0xa')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x457d('0x9a'));}if(_0x4dc307['limit']){_0x57316a[_0x457d('0x9b')](_0x4dc307[_0x457d('0x9b')]);}if(_0x4dc307[_0x457d('0x9c')]){_0x57316a['offset'](_0x4dc307[_0x457d('0x9c')]);}return db[_0x457d('0x9d')][_0x457d('0x74')](_0x57316a[_0x457d('0x75')](),_0x2abe3a);})['then'](function(_0x311507){_0x1fd860=_0x311507;var _0x38096c=getUsersQuery(_0x56cfaf,_0x1fd860);return db[_0x457d('0x9d')][_0x457d('0x74')](_0x38096c[_0x457d('0x75')](),_0x2abe3a);})[_0x457d('0x5f')](function(_0xbc99e8){_0x4526b7=_['groupBy'](_0xbc99e8,_0xccaa9);if(_0x56cfaf===_0x457d('0x31')){return db['Setting'][_0x457d('0x9e')]({'attributes':[_0x457d('0x9f')],'raw':!![]});}})[_0x457d('0x5f')](function(_0x400962){var _0x9c2df=_0x400962?_0x400962[_0x457d('0x9f')]:undefined;var _0x308916=_0x1fd860['map'](function(_0x3aac80){return updateInteraction(_0x3aac80,_0x54a1e4,_0x4526b7,_0x9c2df);});return Promise[_0x457d('0xa0')](_0x308916);});}function countFilteredInteractions(_0x30a4f3,_0x2ef71f){var _0x51da8c=_0x30a4f3['clone']();_0x51da8c[_0x457d('0xa')](_0x457d('0xa1'));_0x51da8c[_0x457d('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x445215=utils['getSelectedTags'](_0x2ef71f);if(!_[_0x457d('0xa2')](_0x445215)){_0x51da8c[_0x457d('0x17')](_0x457d('0xa3'),_0x445215);}var _0x5d55c0={'type':db[_0x457d('0x73')]['QueryTypes'][_0x457d('0xa4')],'raw':!![]};return db[_0x457d('0x9d')]['query'](_0x51da8c[_0x457d('0x75')](),_0x5d55c0);}module[_0x457d('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xb821=['enableEmailPreview','all','COUNT(*)','exports','squel','../parsers/advancedSearch','updateInteraction','getAccountFK','role','agent','search','select','field','name','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','where','map','getInteractionsTables','interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','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','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','length','conditions','find','buildExpression','type','default','text','value','start','read','and','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','end','tags','clause','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','body','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','tag','filter','chat','Websites','Accounts','\x20IS\x20NULL','\x20IN\x20?','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','mail','unshift','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','merge','fields','unreadMessages','a.key','Account.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','Setting'];(function(_0x2038bc,_0x310c9f){var _0x266da4=function(_0x150354){while(--_0x150354){_0x2038bc['push'](_0x2038bc['shift']());}};_0x266da4(++_0x310c9f);}(_0xb821,0xa7));var _0x1b82=function(_0x114a21,_0x379ac8){_0x114a21=_0x114a21-0x0;var _0x15a54a=_0xb821[_0x114a21];return _0x15a54a;};'use strict';var _=require('lodash');var squel=require(_0x1b82('0x0'));var as=require(_0x1b82('0x1'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0x1b82('0x2')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x3b1d14,_0x1403ab,_0x3fadf0){var _0x26db32=![];var _0x597ca7=utils[_0x1b82('0x3')](_0x3b1d14);if(_0x1403ab[_0x1b82('0x4')]===_0x1b82('0x5')&&!_0x3fadf0[_0x1b82('0x6')]&&!_0x3fadf0[_0x597ca7]){_0x26db32=!![];}return _0x26db32;}function getTagsQuery(){return squel[_0x1b82('0x7')]()[_0x1b82('0x8')]('id')[_0x1b82('0x8')](_0x1b82('0x9'))[_0x1b82('0x8')]('color')[_0x1b82('0xa')](_0x1b82('0xb'));}function getUsersQuery(_0x44dfd4,_0x14c57a){var _0xcffb87=utils[_0x1b82('0xc')](_0x44dfd4);var _0x739f99=_0x1b82('0xd')+_0x44dfd4+'_interactions';var _0x46007e=squel[_0x1b82('0x7')]()[_0x1b82('0x8')](_0x1b82('0xe'))['field'](_0x1b82('0xf'))['field']('ui.'+_0xcffb87)[_0x1b82('0xa')](_0x739f99,'ui')['left_join'](_0x1b82('0x10'),'u',_0x1b82('0x11'));if(_0x14c57a['length']>0x0){_0x46007e[_0x1b82('0x12')]('ui.'+_0xcffb87+'\x20IN\x20?',_[_0x1b82('0x13')](_0x14c57a,'id'));}return _0x46007e;}function getInteractionsQuery(_0x5eb8ed){var _0x111247=utils[_0x1b82('0x14')](_0x5eb8ed);var _0xf42818=utils['getAccountFK'](_0x5eb8ed);var _0x514082=utils[_0x1b82('0xc')](_0x5eb8ed);return squel['select']()[_0x1b82('0xa')](_0x111247[_0x1b82('0x15')],'i')[_0x1b82('0x16')]('cm_contacts','c',_0x1b82('0x17'))[_0x1b82('0x16')](_0x1b82('0x10'),'o',_0x1b82('0x18'))[_0x1b82('0x16')](_0x111247['accounts'],'a',_0x1b82('0x19')+_0xf42818)[_0x1b82('0x16')](_0x111247[_0x1b82('0x1a')],'me',_0x1b82('0x1b')+_0x514082+_0x1b82('0x1c'))[_0x1b82('0x16')](_0x111247[_0x1b82('0x1d')],'it','it.'+_0x514082+_0x1b82('0x1c'))[_0x1b82('0x16')]('tools_tags','t',_0x1b82('0x1e'));}function getSqlClauses(){var _0x225b81={'body':squel[_0x1b82('0x1f')](),'contact':squel['expr'](),'default':squel[_0x1b82('0x1f')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0x1b82('0x1f')](),'ids':null},'user':squel[_0x1b82('0x1f')]()};return _0x225b81;}function parseTagParameter(_0xfd00d1){var _0x257b79=squel['expr']();if(_0xfd00d1){var _0x222483=utils[_0x1b82('0x20')](_0xfd00d1);_0x222483[_0x1b82('0x21')](function(_0x7455e8){_0x257b79['or'](_0x1b82('0x22'),'%,'+_0x7455e8+',%');});}return _0x257b79;}function parseReadParameter(_0x1b8b6f){var _0x223b6a='';if(_0x1b8b6f){_0x223b6a=_0x1b82('0x23');if(_0x1b8b6f==='1'){_0x223b6a=_0x223b6a[_0x1b82('0x24')](_0x1b82('0x25'),'=');}else{_0x223b6a=_0x223b6a[_0x1b82('0x24')](_0x1b82('0x25'),'>');}}return _0x223b6a;}function parseSearchFilter(_0x466441,_0x5ea890){var _0x17b3aa=squel[_0x1b82('0x1f')]();if(_0x5ea890){var _0x155a34=_0x5ea890[_0x1b82('0x24')]('\x5c','\x5c\x5c')[_0x1b82('0x24')](/'/g,'\x27\x27');if(qs[_0x1b82('0x26')](_0x155a34)){_0x17b3aa['or'](_0x1b82('0x27'),_0x155a34+'%');if([_0x1b82('0x28'),_0x1b82('0x29')][_0x1b82('0x2a')](_0x466441)){_0x17b3aa['or']('i.phone\x20LIKE\x20?',_0x155a34+'%');}else if(_0x466441===_0x1b82('0x2b')){_0x17b3aa['or'](_0x1b82('0x2c'),_0x155a34+'%');}else if(_0x466441===_0x1b82('0x2d')){_0x17b3aa['or'](_0x1b82('0x2e'),_0x155a34+'%');}}else if(_0x466441==='mail'&&qs[_0x1b82('0x2f')](_0x155a34)){_0x17b3aa['or'](_0x1b82('0x30'),_0x155a34+'%');}else{if(_0x466441==='mail'){_0x17b3aa['or'](_0x1b82('0x31'),qs[_0x1b82('0x32')](_0x155a34))['or'](_0x1b82('0x33'),qs['getFullTextValue'](_0x155a34));}else{if(_0x466441!=='fax'){_0x17b3aa['or'](_0x1b82('0x34'),qs['getFullTextValue'](_0x155a34));}_0x17b3aa['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x155a34+'%');}}}return _0x17b3aa;}function parseAdvancedSearchFilter(_0x417795,_0x1cd22a){var _0x7fd793=getSqlClauses();var _0x592207=as[_0x1b82('0x35')](_0x417795);var _0x366db3=_0x592207[_0x1b82('0x36')];for(var _0x31607f=0x0;_0x31607f<_0x592207['conditions'][_0x1b82('0x37')];_0x31607f++){var _0x1cd7de=_0x592207[_0x1b82('0x38')][_0x31607f];var _0x5ebf6c='i';var _0x48fd54=_[_0x1b82('0x39')](_0x1cd22a,['name',_0x1cd7de[_0x1b82('0x8')]]);if(_0x48fd54){var _0x1e6a9=as[_0x1b82('0x3a')](_0x5ebf6c,_0x48fd54[_0x1b82('0x3b')],_0x1cd7de);_0x7fd793[_0x1b82('0x3c')][_0x366db3](_0x1e6a9[_0x1b82('0x3d')],_0x1e6a9[_0x1b82('0x3e')][_0x1b82('0x3f')],_0x1e6a9['value']['end']);}else{switch(_0x1cd7de[_0x1b82('0x8')]){case'unreadMessages':var _0x34890e=parseReadParameter(_0x1cd7de['value']);_0x7fd793[_0x1b82('0x40')][_0x1b82('0x41')](_0x34890e);break;case _0x1b82('0x42'):if(_0x1cd7de[_0x1b82('0x43')]===_0x1b82('0x44')){if(_0x1cd7de[_0x1b82('0x3e')]['split']('\x20')[_0x1b82('0x37')]>0x1){_0x7fd793['contact'][_0x366db3](_0x1b82('0x45'),qs['getFullTextValue'](_0x1cd7de[_0x1b82('0x3e')]),null);}else{var _0x4edc17='%'+_0x1cd7de['value']+'%';_0x7fd793[_0x1b82('0x46')][_0x366db3](_0x1b82('0x47'),_0x4edc17,_0x4edc17,_0x4edc17);}}else{_0x48fd54=_[_0x1b82('0x39')](_0x1cd22a,[_0x1b82('0x9'),_0x1b82('0x48')]);_0x1cd7de['field']=_0x1b82('0x48');_0x1e6a9=as['buildExpression'](_0x5ebf6c,_0x48fd54[_0x1b82('0x3b')],_0x1cd7de);_0x7fd793[_0x1b82('0x46')][_0x366db3](_0x1e6a9[_0x1b82('0x3d')],_0x1e6a9[_0x1b82('0x3e')][_0x1b82('0x3f')],_0x1e6a9['value'][_0x1b82('0x49')]);}break;case'Tag':var _0x318f6b=_0x1cd7de[_0x1b82('0x3e')]['split'](',')[_0x1b82('0x13')](function(_0x225f6b){return Number(_0x225f6b);});var _0x388411=parseTagParameter(_0x318f6b);_0x7fd793[_0x1b82('0x4a')][_0x1b82('0x4b')][_0x1b82('0x41')](_0x388411);_0x7fd793[_0x1b82('0x4a')]['ids']=_0x318f6b;break;case _0x1b82('0x4c'):if(_0x1cd7de['operator']===_0x1b82('0x44')){_0x7fd793[_0x1b82('0x4d')][_0x366db3](_0x1b82('0x4e'),'%'+_0x1cd7de[_0x1b82('0x3e')]+'%',null);}else{_0x48fd54=_[_0x1b82('0x39')](_0x1cd22a,[_0x1b82('0x9'),_0x1b82('0x4f')]);_0x1cd7de[_0x1b82('0x8')]=_0x1b82('0x4f');_0x1e6a9=as[_0x1b82('0x3a')](_0x5ebf6c,_0x48fd54[_0x1b82('0x3b')],_0x1cd7de);_0x7fd793[_0x1b82('0x4d')][_0x366db3](_0x1e6a9[_0x1b82('0x3d')],_0x1e6a9[_0x1b82('0x3e')]['start'],_0x1e6a9['value'][_0x1b82('0x49')]);}break;case'body':case _0x1b82('0x50'):_0x1e6a9=as[_0x1b82('0x3a')]('me',null,_0x1cd7de);_0x7fd793[_0x1b82('0x51')][_0x366db3](_0x1e6a9['text'],_0x1e6a9[_0x1b82('0x3e')]['start'],_0x1e6a9['value'][_0x1b82('0x49')]);break;}}}return _0x7fd793;}function parseModelFields(_0x2aadf7,_0x242324,_0x56b618){var _0x1e159a=utils[_0x1b82('0x3')](_0x2aadf7);var _0x538692=squel['expr']();var _0x106282=_(_0x242324)[_0x1b82('0x52')]()[_0x1b82('0x13')](function(_0x4fe1d7){return _[_0x1b82('0x53')](_0x56b618,[_0x1b82('0x9'),_0x4fe1d7])?_0x4fe1d7:undefined;})[_0x1b82('0x54')]()[_0x1b82('0x3e')]();if(_0x106282[_0x1b82('0x37')]>0x0){_0x106282[_0x1b82('0x21')](function(_0x4b6ab3){if(_0x4b6ab3===_0x1e159a){_0x538692[_0x1b82('0x41')]('i.'+_0x1e159a+'\x20IN\x20?',[][_0x1b82('0x55')](_0x242324[_0x4b6ab3]));}else if(_0x4b6ab3===_0x1b82('0x56')){var _0x5d9708=JSON[_0x1b82('0x57')](_0x242324[_0x4b6ab3])['$gte'];var _0x328973=JSON[_0x1b82('0x57')](_0x242324[_0x4b6ab3])[_0x1b82('0x58')];_0x538692[_0x1b82('0x41')](_0x1b82('0x59'),_0x5d9708,_0x328973);}else{if(_0x242324[_0x4b6ab3]===_0x1b82('0x5a')){_0x538692['and']('i.'+_0x4b6ab3+'\x20IS\x20NULL');}else{_0x538692[_0x1b82('0x41')]('i.'+_0x4b6ab3+_0x1b82('0x5b'),_0x242324[_0x4b6ab3]);}}});}return _0x538692;}function parseQueryParameters(_0x1b9e81,_0x26c1ec,_0x3db460){var _0x1f1463=getSqlClauses();return Promise[_0x1b82('0x5c')]()[_0x1b82('0x5d')](function(){return parseModelFields(_0x1b9e81,_0x26c1ec,_0x3db460);})['then'](function(_0x4cdcfe){_0x1f1463['fields'][_0x1b82('0x41')](_0x4cdcfe);return parseReadParameter(_0x26c1ec[_0x1b82('0x40')]);})[_0x1b82('0x5d')](function(_0x27ad80){_0x1f1463[_0x1b82('0x40')][_0x1b82('0x41')](_0x27ad80);return parseTagParameter(_0x26c1ec[_0x1b82('0x5e')]);})['then'](function(_0x250293){_0x1f1463[_0x1b82('0x4a')][_0x1b82('0x4b')][_0x1b82('0x41')](_0x250293);return parseSearchFilter(_0x1b9e81,_0x26c1ec[_0x1b82('0x5f')]);})[_0x1b82('0x5d')](function(_0x25ee4e){_0x1f1463[_0x1b82('0x5f')]=_0x25ee4e;return _0x1f1463;});}function checkAccountsRestrictions(_0x52d4c5,_0x2e6486,_0x23e735){var _0x39be28=utils[_0x1b82('0x3')](_0x52d4c5);var _0x2bce47='get'+_['capitalize'](_0x52d4c5)+(_0x52d4c5===_0x1b82('0x60')?_0x1b82('0x61'):_0x1b82('0x62'));var _0x362fa2=squel['expr']();return Promise[_0x1b82('0x5c')]()[_0x1b82('0x5d')](function(){if(_0x23e735[_0x1b82('0x6')]&&_0x2e6486[_0x1b82('0x4')]===_0x1b82('0x5')){return _0x2e6486[_0x2bce47]({'attributes':['id'],'raw':!![]});}})[_0x1b82('0x5d')](function(_0x3e591a){if(_0x3e591a){if(_0x3e591a[_0x1b82('0x37')]===0x0){_0x362fa2[_0x1b82('0x41')]('i.'+_0x39be28+_0x1b82('0x63'));}else{_0x362fa2['and']('i.'+_0x39be28+_0x1b82('0x64'),_[_0x1b82('0x13')](_0x3e591a,'id'));}}else if(!_0x23e735[_0x39be28]){_0x362fa2['and']('i.'+_0x39be28+_0x1b82('0x65'));}})[_0x1b82('0x5d')](function(){return _0x362fa2;});}function getClosedOrderClause(_0x1e0eaf,_0x2a5435){var _0x4b26c4='';var _0x30f13a=[_0x1b82('0x66'),_0x1b82('0x67'),_0x1b82('0x68')];if(_0x1e0eaf===_0x1b82('0x69')){_0x30f13a[_0x1b82('0x6a')]('i.substatus');}if(_0x2a5435[_0x1b82('0x6b')]==='0'&&_0x1e0eaf==='mail'){_0x4b26c4=_0x1b82('0x6c');}else{if(_0x2a5435['closed']==='1'){_0x30f13a[_0x1b82('0x6d')]();}_0x4b26c4=_0x1b82('0x6e')+_0x30f13a[_0x1b82('0x6f')](',\x20')+')';}return _0x4b26c4;}function getFilteredInteractions(_0x2db0fe,_0x412073,_0x282b3c,_0x245f20){var _0x50d123=utils[_0x1b82('0xc')](_0x2db0fe);var _0x21dbf4=_[_0x1b82('0x70')](_0x2db0fe)+_0x1b82('0x71');var _0x567b9a=[];var _0x2cf368=getTagsQuery();var _0x3153b7={'type':db[_0x1b82('0x72')][_0x1b82('0x73')][_0x1b82('0x74')],'raw':!![]};var _0x1873de=[];var _0xe31cbc=[];return db[_0x1b82('0x75')]['query'](_0x2cf368[_0x1b82('0x76')](),_0x3153b7)[_0x1b82('0x5d')](function(_0x34a231){_0x567b9a=_['keyBy'](_0x34a231,'id');_0x3153b7=_[_0x1b82('0x77')](_0x3153b7,{'model':db[_0x21dbf4],'mapToModel':!![],'nest':!![]});if(_0x282b3c[_0x1b82('0x78')]){_0x245f20['attributes'][_0x1b82('0x21')](function(_0x5cc386){_0x412073[_0x1b82('0x8')]('i.'+_0x5cc386);});}else{_0x412073['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1b82('0x79'));_0x412073[_0x1b82('0x8')](_0x1b82('0x7a'),_0x1b82('0x7b'));_0x412073[_0x1b82('0x8')]('a.mandatoryDisposition',_0x1b82('0x7c'));if(_0x2db0fe==='mail'){_0x412073[_0x1b82('0x8')](_0x1b82('0x7d'),_0x1b82('0x7e'));_0x412073[_0x1b82('0x8')](_0x1b82('0x7f'),_0x1b82('0x80'));_0x412073[_0x1b82('0x8')](_0x1b82('0x81'));_0x412073[_0x1b82('0x8')](_0x1b82('0x82'));_0x412073[_0x1b82('0x8')]('i.updatedAt');_0x412073[_0x1b82('0x8')]('i.closed');_0x412073['field'](_0x1b82('0x83'));_0x412073[_0x1b82('0x8')](_0x1b82('0x84'));_0x412073[_0x1b82('0x8')](_0x1b82('0x85'));_0x412073[_0x1b82('0x8')](_0x1b82('0x86'));_0x412073[_0x1b82('0x8')](_0x1b82('0x87'));_0x412073[_0x1b82('0x8')]('i.disposition');_0x412073[_0x1b82('0x8')]('i.secondDisposition');_0x412073[_0x1b82('0x8')]('i.thirdDisposition');_0x412073[_0x1b82('0x8')](_0x1b82('0x6c'));_0x412073[_0x1b82('0x8')](_0x1b82('0x88'));_0x412073[_0x1b82('0x8')]('i.ContactId');_0x412073[_0x1b82('0x8')]('i.MailAccountId');_0x412073['field'](_0x1b82('0x89'));}else if(_0x2db0fe===_0x1b82('0x2d')){_0x412073[_0x1b82('0x8')]('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',_0x1b82('0x80'));}else{_0x412073['field'](_0x1b82('0x8a'),'contactName');}if(_0x2db0fe!==_0x1b82('0x69')){_0x412073[_0x1b82('0x8')](_0x1b82('0x8b'));}_0x412073[_0x1b82('0x8')]('c.firstName',_0x1b82('0x8c'));_0x412073['field'](_0x1b82('0x8d'),_0x1b82('0x8e'));_0x412073[_0x1b82('0x8')](_0x1b82('0x8f'),_0x1b82('0x90'));_0x412073['field'](_0x1b82('0x91'),'Contact.phone');_0x412073[_0x1b82('0x8')]('c.mobile',_0x1b82('0x92'));_0x412073[_0x1b82('0x8')](_0x1b82('0x93'),'Contact.fax');_0x412073[_0x1b82('0x8')](_0x1b82('0x94'),_0x1b82('0x95'));_0x412073['field'](_0x1b82('0x96'),_0x1b82('0x97'));_0x412073[_0x1b82('0x8')](_0x1b82('0x98'),_0x1b82('0x99'));}if(_0x245f20['limit']){_0x412073[_0x1b82('0x9a')](_0x245f20['limit']);}if(_0x245f20['offset']){_0x412073[_0x1b82('0x9b')](_0x245f20['offset']);}return db[_0x1b82('0x75')][_0x1b82('0x9c')](_0x412073['toString'](),_0x3153b7);})[_0x1b82('0x5d')](function(_0x391207){_0x1873de=_0x391207;var _0x553ac5=getUsersQuery(_0x2db0fe,_0x1873de);return db['sequelize']['query'](_0x553ac5['toString'](),_0x3153b7);})[_0x1b82('0x5d')](function(_0x1405dd){_0xe31cbc=_[_0x1b82('0x9d')](_0x1405dd,_0x50d123);if(_0x2db0fe==='mail'){return db[_0x1b82('0x9e')]['findOne']({'attributes':[_0x1b82('0x9f')],'raw':!![]});}})[_0x1b82('0x5d')](function(_0x96910f){var _0x41f87b=_0x96910f?_0x96910f['enableEmailPreview']:undefined;var _0x168e53=_0x1873de[_0x1b82('0x13')](function(_0x14510c){return updateInteraction(_0x14510c,_0x567b9a,_0xe31cbc,_0x41f87b);});return Promise[_0x1b82('0xa0')](_0x168e53);});}function countFilteredInteractions(_0x346b6d,_0x3a4e7d){var _0x2dbcdb=_0x346b6d['clone']();_0x2dbcdb['field'](_0x1b82('0xa1'));_0x2dbcdb['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1b82('0x79'));var _0x225749=utils[_0x1b82('0x20')](_0x3a4e7d);if(!_['isEmpty'](_0x225749)){_0x2dbcdb[_0x1b82('0x12')]('t.id\x20IN\x20?',_0x225749);}var _0x385c2d={'type':db[_0x1b82('0x72')][_0x1b82('0x73')][_0x1b82('0x74')],'raw':!![]};return db['sequelize'][_0x1b82('0x9c')](_0x2dbcdb['toString'](),_0x385c2d);}module[_0x1b82('0xa2')]={'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 d049d6e..94d895b 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 _0x59f3=['catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','split','forEach','push','waiting','talking','total','closed','disposition','abandoned','unmanaged','UserId','MailMessage','findOne','plainBody','then','lastMsgText','trimStart'];(function(_0x5c113a,_0x2b2da1){var _0x143b8e=function(_0x16d275){while(--_0x16d275){_0x5c113a['push'](_0x5c113a['shift']());}};_0x143b8e(++_0x2b2da1);}(_0x59f3,0x19c));var _0x359f=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x59f3[_0x441563];return _0x2369ec;};'use strict';var _=require(_0x359f('0x0'));var db=require(_0x359f('0x1'))['db'];function getInteractionUsers(_0xa3dd23,_0x57ddbe){return new Promise(function(_0xd5d1bc,_0x245f88){try{var _0x58ad1a=[];if(_0x57ddbe[_0xa3dd23]){_0x58ad1a=_0x57ddbe[_0xa3dd23][_0x359f('0x2')](function(_0x80f529){return{'id':_0x80f529['id'],'fullname':_0x80f529['fullname']};});}return _0xd5d1bc(_0x58ad1a);}catch(_0x25add7){_0x245f88(_0x25add7);}});}function getInteractionTags(_0x905a20,_0x294259){var _0xfb74b4=[];if(_0x905a20){_0x905a20[_0x359f('0x3')](',')[_0x359f('0x4')](function(_0x31f4bc){_0xfb74b4[_0x359f('0x5')](_0x294259[_0x31f4bc]);});}return _0xfb74b4;}function updateWaitingCounter(_0x45a90b){if(_0x45a90b[_0x359f('0x6')]){_0x45a90b[_0x359f('0x6')]-=0x1;}}function updateInteractionCounters(_0x33b636){_0x33b636[_0x359f('0x6')]=0x0;_0x33b636[_0x359f('0x7')]=0x0;_0x33b636['answered']=0x0;_0x33b636['unmanaged']=0x0;_0x33b636['abandoned']=0x0;_0x33b636[_0x359f('0x8')]=0x0;if(_0x33b636[_0x359f('0x9')]){if(_0x33b636[_0x359f('0xa')]===_0x359f('0xb')){_0x33b636[_0x359f('0xb')]+=0x1;updateWaitingCounter(_0x33b636);}if(_0x33b636['UserId']){_0x33b636['answered']+=0x1;if(_0x33b636['talking']){_0x33b636['talking']-=0x1;}}else{if(_0x33b636[_0x359f('0xa')]){_0x33b636[_0x359f('0xc')]+=0x1;updateWaitingCounter(_0x33b636);}}}else{if(!_0x33b636[_0x359f('0xd')]){_0x33b636[_0x359f('0x6')]+=0x1;}if(_0x33b636[_0x359f('0xd')]){_0x33b636[_0x359f('0x7')]+=0x1;updateWaitingCounter(_0x33b636);}}_0x33b636[_0x359f('0x8')]+=0x1;return _0x33b636;}function getLastMessageText(_0x427756){return db[_0x359f('0xe')][_0x359f('0xf')]({'where':{'$and':[{'MailInteractionId':_0x427756['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x359f('0x10')],'order':'-id','raw':!![]})[_0x359f('0x11')](function(_0x53a531){if(_0x53a531&&_0x53a531[_0x359f('0x10')]){_0x427756[_0x359f('0x12')]=_[_0x359f('0x13')](_0x53a531[_0x359f('0x10')]);}return _0x427756;})[_0x359f('0x14')](function(_0x562058){throw _0x562058;});}exports[_0x359f('0x15')]=function(_0xc93931,_0x9e5e3,_0x3f29a4,_0x437424){return new Promise(function(_0x69f966,_0x34ee8d){return getInteractionUsers(_0xc93931['id'],_0x3f29a4)[_0x359f('0x11')](function(_0x4fd2f9){_0xc93931['Users']=_0x4fd2f9;return getInteractionTags(_0xc93931[_0x359f('0x16')],_0x9e5e3);})[_0x359f('0x11')](function(_0x42da7e){_0xc93931[_0x359f('0x17')]=_0x42da7e;delete _0xc93931['TagIds'];return updateInteractionCounters(_0xc93931);})[_0x359f('0x11')](function(_0x24acb4){if(_0x437424){return getLastMessageText(_0x24acb4);}else{return _0x24acb4;}})[_0x359f('0x11')](function(_0x2b8fdc){_0x69f966(_0x2b8fdc);})[_0x359f('0x14')](function(_0x4c2cbb){_0x34ee8d(_0x4c2cbb);});});}; \ No newline at end of file +var _0x7f24=['answered','unmanaged','abandoned','total','disposition','UserId','MailMessage','findOne','plainBody','then','lastMsgText','updateInteraction','Users','TagIds','Tags','catch','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f24,0xa0));var _0x47f2=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x7f24[_0x369a98];return _0x29565c;};'use strict';var _=require(_0x47f2('0x0'));var db=require(_0x47f2('0x1'))['db'];function getInteractionUsers(_0x1b1354,_0x4f6df1){return new Promise(function(_0x1913c7,_0x428d0f){try{var _0x19eae7=[];if(_0x4f6df1[_0x1b1354]){_0x19eae7=_0x4f6df1[_0x1b1354][_0x47f2('0x2')](function(_0x1d4ec5){return{'id':_0x1d4ec5['id'],'fullname':_0x1d4ec5[_0x47f2('0x3')]};});}return _0x1913c7(_0x19eae7);}catch(_0x3731c7){_0x428d0f(_0x3731c7);}});}function getInteractionTags(_0x25e01f,_0x2ba4f8){var _0xa94fff=[];if(_0x25e01f){_0x25e01f[_0x47f2('0x4')](',')[_0x47f2('0x5')](function(_0x1c53bc){_0xa94fff['push'](_0x2ba4f8[_0x1c53bc]);});}return _0xa94fff;}function updateWaitingCounter(_0x59530d){if(_0x59530d[_0x47f2('0x6')]){_0x59530d['waiting']-=0x1;}}function updateInteractionCounters(_0x34ee26){_0x34ee26['waiting']=0x0;_0x34ee26[_0x47f2('0x7')]=0x0;_0x34ee26[_0x47f2('0x8')]=0x0;_0x34ee26[_0x47f2('0x9')]=0x0;_0x34ee26[_0x47f2('0xa')]=0x0;_0x34ee26[_0x47f2('0xb')]=0x0;if(_0x34ee26['closed']){if(_0x34ee26[_0x47f2('0xc')]===_0x47f2('0xa')){_0x34ee26['abandoned']+=0x1;updateWaitingCounter(_0x34ee26);}if(_0x34ee26['UserId']){_0x34ee26[_0x47f2('0x8')]+=0x1;if(_0x34ee26[_0x47f2('0x7')]){_0x34ee26[_0x47f2('0x7')]-=0x1;}}else{if(_0x34ee26[_0x47f2('0xc')]){_0x34ee26[_0x47f2('0x9')]+=0x1;updateWaitingCounter(_0x34ee26);}}}else{if(!_0x34ee26[_0x47f2('0xd')]){_0x34ee26[_0x47f2('0x6')]+=0x1;}if(_0x34ee26[_0x47f2('0xd')]){_0x34ee26[_0x47f2('0x7')]+=0x1;updateWaitingCounter(_0x34ee26);}}_0x34ee26['total']+=0x1;return _0x34ee26;}function getLastMessageText(_0x2c2441){return db[_0x47f2('0xe')][_0x47f2('0xf')]({'where':{'$and':[{'MailInteractionId':_0x2c2441['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x47f2('0x10')],'order':'-id','raw':!![]})[_0x47f2('0x11')](function(_0x56a3ee){if(_0x56a3ee&&_0x56a3ee[_0x47f2('0x10')]){_0x2c2441[_0x47f2('0x12')]=_['trimStart'](_0x56a3ee['plainBody']);}return _0x2c2441;})['catch'](function(_0xd5efab){throw _0xd5efab;});}exports[_0x47f2('0x13')]=function(_0x58f3c1,_0x331283,_0xc87856,_0x3a346b){return new Promise(function(_0x227922,_0x1a0225){return getInteractionUsers(_0x58f3c1['id'],_0xc87856)[_0x47f2('0x11')](function(_0x44bc09){_0x58f3c1[_0x47f2('0x14')]=_0x44bc09;return getInteractionTags(_0x58f3c1[_0x47f2('0x15')],_0x331283);})[_0x47f2('0x11')](function(_0x2c9586){_0x58f3c1[_0x47f2('0x16')]=_0x2c9586;delete _0x58f3c1[_0x47f2('0x15')];return updateInteractionCounters(_0x58f3c1);})[_0x47f2('0x11')](function(_0x526910){if(_0x3a346b){return getLastMessageText(_0x526910);}else{return _0x526910;}})[_0x47f2('0x11')](function(_0x4d3b4a){_0x227922(_0x4d3b4a);})[_0x47f2('0x17')](function(_0x814392){_0x1a0225(_0x814392);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 6e48625..d9cf930 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 _0x01a6=['update','info','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify','null','Interaction','then'];(function(_0x57be59,_0x2f1d25){var _0x23d1aa=function(_0x9abad9){while(--_0x9abad9){_0x57be59['push'](_0x57be59['shift']());}};_0x23d1aa(++_0x2f1d25);}(_0x01a6,0x178));var _0x601a=function(_0x268665,_0x33c578){_0x268665=_0x268665-0x0;var _0x52f0f6=_0x01a6[_0x268665];return _0x52f0f6;};'use strict';var _=require(_0x601a('0x0'));var db=require(_0x601a('0x1'))['db'];var loggers={'openchannel':require(_0x601a('0x2'))(_0x601a('0x3')),'mail':require(_0x601a('0x2'))('mail-interactions'),'fax':require(_0x601a('0x2'))(_0x601a('0x4')),'sms':require(_0x601a('0x2'))(_0x601a('0x5')),'chat':require(_0x601a('0x2'))('chat-interactions'),'whatsapp':require(_0x601a('0x2'))(_0x601a('0x6'))};function getAccountFK(_0x4b4e11){return _[_0x601a('0x7')](_0x4b4e11)+(_0x4b4e11===_0x601a('0x8')?_0x601a('0x9'):_0x601a('0xa'))+'Id';}function getInteractionFK(_0x4ea646){return _['capitalize'](_0x4ea646)+_0x601a('0xb');}function getInteractionId(_0x54484a,_0x589eb1,_0x5c2403){if(_0x54484a&&_0x54484a[_[_0x601a('0xc')](_0x5c2403)+_0x601a('0xb')]){return _0x54484a[_[_0x601a('0xc')](_0x5c2403)+'InteractionId'];}else if(_0x54484a&&_0x54484a['id']){return _0x54484a['id'];}else if(_0x589eb1&&_0x589eb1['id']){return _0x589eb1['id'];}else{return _0x601a('0xd');}}function getInteractionsTables(_0x209ed5){return{'accounts':_0x209ed5+'_'+(_0x209ed5===_0x601a('0x8')?'websites':_0x601a('0xe')),'interactions':_0x209ed5+_0x601a('0xf'),'interactionsTags':_0x209ed5+'_interaction_has_tags','messages':_0x209ed5+_0x601a('0x10'),'userInteractions':_0x601a('0x11')+_0x209ed5+'_interactions'};}function getSelectedTags(_0x2c4665){var _0xdc77c=[];if(_0x2c4665){_0xdc77c=Array[_0x601a('0x12')](_0x2c4665)?_0x2c4665:[_0x2c4665];}return _0xdc77c;}function log(_0x31f143,_0x5db250,_0x27dc56,_0x240111,_0x2acf97,_0x4d4762){loggers[_0x2acf97[_0x601a('0x13')]()][_0x31f143]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d4762[_0x601a('0x14')](),_0x5db250?_0x5db250['id']:null,_0x5db250?_0x5db250[_0x601a('0x15')]:null,_0x5db250?_0x5db250[_0x601a('0x16')]:null,getInteractionId(_0x27dc56,_0x240111,_0x2acf97),_0x27dc56?JSON[_0x601a('0x17')](_0x27dc56):_0x601a('0x18'));}function updateUser(_0x5e20aa,_0x35f7ce,_0x44a369,_0x5c4617,_0x14e105){db[_['upperFirst'](_0x5c4617)+_0x601a('0x19')]['findOne']({'where':{'id':getInteractionId(_0x35f7ce,_0x44a369,_0x5c4617)}})[_0x601a('0x1a')](function(_0x26f462){if(_0x26f462){return _0x26f462[_0x601a('0x1b')]({'UserId':_0x5e20aa?_0x5e20aa['id']:null});}})[_0x601a('0x1a')](function(_0x416488){if(_0x416488){log(_0x601a('0x1c'),_0x5e20aa,_0x35f7ce,_0x44a369,_0x5c4617,_0x14e105);}})['catch'](function(){log(_0x601a('0x1d'),_0x5e20aa,_0x35f7ce,_0x44a369,_0x5c4617,_0x14e105);});}module[_0x601a('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xf2a7=['unknown','websites','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','name','role','null','Interaction','then','update','catch','error','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','InteractionId','upperFirst'];(function(_0xb65ffb,_0x2cc0af){var _0x58f55c=function(_0x24ba56){while(--_0x24ba56){_0xb65ffb['push'](_0xb65ffb['shift']());}};_0x58f55c(++_0x2cc0af);}(_0xf2a7,0x144));var _0x7f2a=function(_0x48b957,_0x4b5393){_0x48b957=_0x48b957-0x0;var _0x774060=_0xf2a7[_0x48b957];return _0x774060;};'use strict';var _=require(_0x7f2a('0x0'));var db=require(_0x7f2a('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x7f2a('0x2')),'mail':require(_0x7f2a('0x3'))(_0x7f2a('0x4')),'fax':require(_0x7f2a('0x3'))('fax-interactions'),'sms':require('../../config/logger')(_0x7f2a('0x5')),'chat':require(_0x7f2a('0x3'))(_0x7f2a('0x6')),'whatsapp':require(_0x7f2a('0x3'))(_0x7f2a('0x7'))};function getAccountFK(_0x390c5a){return _[_0x7f2a('0x8')](_0x390c5a)+(_0x390c5a===_0x7f2a('0x9')?'Website':'Account')+'Id';}function getInteractionFK(_0x4387b6){return _[_0x7f2a('0x8')](_0x4387b6)+_0x7f2a('0xa');}function getInteractionId(_0x432ecd,_0xd8eddc,_0x23c3cb){if(_0x432ecd&&_0x432ecd[_['upperFirst'](_0x23c3cb)+'InteractionId']){return _0x432ecd[_[_0x7f2a('0xb')](_0x23c3cb)+_0x7f2a('0xa')];}else if(_0x432ecd&&_0x432ecd['id']){return _0x432ecd['id'];}else if(_0xd8eddc&&_0xd8eddc['id']){return _0xd8eddc['id'];}else{return _0x7f2a('0xc');}}function getInteractionsTables(_0x5522ce){return{'accounts':_0x5522ce+'_'+(_0x5522ce===_0x7f2a('0x9')?_0x7f2a('0xd'):'accounts'),'interactions':_0x5522ce+_0x7f2a('0xe'),'interactionsTags':_0x5522ce+_0x7f2a('0xf'),'messages':_0x5522ce+_0x7f2a('0x10'),'userInteractions':_0x7f2a('0x11')+_0x5522ce+_0x7f2a('0xe')};}function getSelectedTags(_0x31927e){var _0x5788c9=[];if(_0x31927e){_0x5788c9=Array[_0x7f2a('0x12')](_0x31927e)?_0x31927e:[_0x31927e];}return _0x5788c9;}function log(_0xa4cc82,_0x2e1da2,_0xa133b3,_0x57a88e,_0x444a9a,_0x4bd659){loggers[_0x444a9a[_0x7f2a('0x13')]()][_0xa4cc82]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bd659['toUpperCase'](),_0x2e1da2?_0x2e1da2['id']:null,_0x2e1da2?_0x2e1da2[_0x7f2a('0x14')]:null,_0x2e1da2?_0x2e1da2[_0x7f2a('0x15')]:null,getInteractionId(_0xa133b3,_0x57a88e,_0x444a9a),_0xa133b3?JSON['stringify'](_0xa133b3):_0x7f2a('0x16'));}function updateUser(_0x2e287f,_0x1459ae,_0x12ca63,_0x3e981d,_0x2feef8){db[_[_0x7f2a('0xb')](_0x3e981d)+_0x7f2a('0x17')]['findOne']({'where':{'id':getInteractionId(_0x1459ae,_0x12ca63,_0x3e981d)}})[_0x7f2a('0x18')](function(_0x3ccf4b){if(_0x3ccf4b){return _0x3ccf4b[_0x7f2a('0x19')]({'UserId':_0x2e287f?_0x2e287f['id']:null});}})[_0x7f2a('0x18')](function(_0x43ed57){if(_0x43ed57){log('info',_0x2e287f,_0x1459ae,_0x12ca63,_0x3e981d,_0x2feef8);}})[_0x7f2a('0x1a')](function(){log(_0x7f2a('0x1b'),_0x2e287f,_0x1459ae,_0x12ca63,_0x3e981d,_0x2feef8);});}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 ec3bba8..55c80a1 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 _0xc775=['split','format','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license'];(function(_0x1a4760,_0x5f4453){var _0x433f85=function(_0x4235ef){while(--_0x4235ef){_0x1a4760['push'](_0x1a4760['shift']());}};_0x433f85(++_0x5f4453);}(_0xc775,0xe3));var _0x5c77=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc775[_0x502c7d];return _0x30b7ed;};'use strict';var crypto=require(_0x5c77('0x0'));var util=require(_0x5c77('0x1'));var compose=require(_0x5c77('0x2'));var db=require(_0x5c77('0x3'))['db'];var config=require(_0x5c77('0x4'));function getValueFromLicense(_0x5d22c4,_0x55e1d2){if(_0x5d22c4&&_0x55e1d2){if(_0x55e1d2[_0x5c77('0x5')]&&_0x55e1d2[_0x5c77('0x6')]){var _0x320a2a=_0x55e1d2[_0x5c77('0x5')];var _0x335751=_0x55e1d2['license'];var _0x344e7f=_0x320a2a[_0x5c77('0x7')]('-')[0x4];var _0x11127a=_0x320a2a[_0x5c77('0x7')]('-')[0x0];var _0x4c6667=crypto['createDecipher']('aes-256-ctr',util[_0x5c77('0x8')]('%s:%s:%s',_0x344e7f,_0x320a2a,_0x11127a));var _0x37fe04=_0x4c6667[_0x5c77('0x9')](_0x335751,_0x5c77('0xa'),_0x5c77('0xb'));_0x37fe04+=_0x4c6667[_0x5c77('0xc')]('utf8');var _0xe89a69=JSON[_0x5c77('0xd')](_0x37fe04);return _0xe89a69[_0x5c77('0xe')](_0x5d22c4)?_0xe89a69[_0x5d22c4]:null;}}return null;}function isLimit(_0x3b4503,_0x1d6e7a,_0x3fc2f4,_0x5911a8){var _0x323579=_0x1d6e7a;return compose()['use'](function(_0x2e4642,_0x2948ed,_0x11c982){return db[_0x5c77('0xf')][_0x5c77('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x5c77('0x11')](function(_0x2c277d){var _0x144719=getValueFromLicense(_0x3b4503,_0x2c277d);return _0x144719?_0x144719:_0x323579;})['then'](function(_0x43f067){_0x323579=_0x43f067;return _0x3fc2f4[_0x5c77('0x12')](_0x5911a8);})[_0x5c77('0x11')](function(_0xa55767){if(_0xa55767>=_0x323579){return _0x2948ed['status'](0x193)[_0x5c77('0x13')]({'message':util['format'](_0x5c77('0x14'),_0x3b4503)});}_0x11c982();})[_0x5c77('0x15')](function(_0x3f7ce0){_0x11c982(_0x3f7ce0);});});}function isUserLimit(){return isLimit(_0x5c77('0x16'),0x1,db[_0x5c77('0x17')],{'where':{'$or':[{'role':_0x5c77('0x18')},{'role':'user'}]}});}exports[_0x5c77('0x19')]=isUserLimit; \ No newline at end of file +var _0xb19f=['count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','composable-middleware','../../config/environment','data1','license','split','aes-256-ctr','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then'];(function(_0x16ae0d,_0x26c762){var _0xed0618=function(_0x5e6a90){while(--_0x5e6a90){_0x16ae0d['push'](_0x16ae0d['shift']());}};_0xed0618(++_0x26c762);}(_0xb19f,0x1c5));var _0xfb19=function(_0x471b36,_0x2095a9){_0x471b36=_0x471b36-0x0;var _0x1e10c6=_0xb19f[_0x471b36];return _0x1e10c6;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xfb19('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0xfb19('0x1'));function getValueFromLicense(_0x5ac6bf,_0x54bee7){if(_0x5ac6bf&&_0x54bee7){if(_0x54bee7[_0xfb19('0x2')]&&_0x54bee7[_0xfb19('0x3')]){var _0xd80074=_0x54bee7[_0xfb19('0x2')];var _0x7807c6=_0x54bee7[_0xfb19('0x3')];var _0x3ae3b8=_0xd80074['split']('-')[0x4];var _0x1ef13d=_0xd80074[_0xfb19('0x4')]('-')[0x0];var _0x407453=crypto['createDecipher'](_0xfb19('0x5'),util['format']('%s:%s:%s',_0x3ae3b8,_0xd80074,_0x1ef13d));var _0x51c602=_0x407453[_0xfb19('0x6')](_0x7807c6,_0xfb19('0x7'),_0xfb19('0x8'));_0x51c602+=_0x407453[_0xfb19('0x9')]('utf8');var _0x41ea61=JSON['parse'](_0x51c602);return _0x41ea61[_0xfb19('0xa')](_0x5ac6bf)?_0x41ea61[_0x5ac6bf]:null;}}return null;}function isLimit(_0x328e08,_0x113e00,_0x461139,_0x1199ce){var _0x47428c=_0x113e00;return compose()[_0xfb19('0xb')](function(_0x1ad65a,_0x2a6df6,_0x204e89){return db[_0xfb19('0xc')][_0xfb19('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xfb19('0xe')](function(_0x3e14f7){var _0x5b9c8f=getValueFromLicense(_0x328e08,_0x3e14f7);return _0x5b9c8f?_0x5b9c8f:_0x47428c;})[_0xfb19('0xe')](function(_0x90bafd){_0x47428c=_0x90bafd;return _0x461139[_0xfb19('0xf')](_0x1199ce);})['then'](function(_0x590e79){if(_0x590e79>=_0x47428c){return _0x2a6df6[_0xfb19('0x10')](0x193)[_0xfb19('0x11')]({'message':util[_0xfb19('0x12')](_0xfb19('0x13'),_0x328e08)});}_0x204e89();})[_0xfb19('0x14')](function(_0x115b72){_0x204e89(_0x115b72);});});}function isUserLimit(){return isLimit(_0xfb19('0x15'),0x1,db[_0xfb19('0x16')],{'where':{'$or':[{'role':_0xfb19('0x17')},{'role':_0xfb19('0x18')}]}});}exports[_0xfb19('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bff350e..4b0445e 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 _0xd6a0=['indexOf','map','conditions','push','DATE','operator','$eq','$between','includes','$lte','value','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','<\x20?','$gt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','format','utcOffset','add','hours','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xd6a0,0x104));var _0x0d6a=function(_0x1facf8,_0x4ff50d){_0x1facf8=_0x1facf8-0x0;var _0x317d7e=_0xd6a0[_0x1facf8];return _0x317d7e;};'use strict';var _=require('lodash');var moment=require(_0x0d6a('0x0'));exports[_0x0d6a('0x1')]=function(_0x1af646){var _0x3ecf3e={'conditions':[]};_0x3ecf3e[_0x0d6a('0x2')]=_[_0x0d6a('0x3')](_0x1af646,_0x0d6a('0x4'))?'or':_0x0d6a('0x5');var _0x1654b2=_0x1af646[_0x0d6a('0x6')](_0x0d6a('0x7'),'')[_0x0d6a('0x6')](_0x0d6a('0x4'),'')[_0x0d6a('0x8')]('||');for(var _0xa5a757=0x0;_0xa5a757<_0x1654b2[_0x0d6a('0x9')];_0xa5a757++){var _0x4d855e=_0x1654b2[_0xa5a757][_0x0d6a('0x8')](':=');var _0x419494=_0x4d855e[0x0];var _0x454aed=_0x4d855e[_0x0d6a('0xa')](0x1);_0x454aed[_0x0d6a('0xb')](function(_0x13feb1){var _0x22a2cb=_0x13feb1[_0x0d6a('0x8')]('[')[_0x0d6a('0xc')]();var _0x3053a9=_0x13feb1[_0x0d6a('0xd')](/\[(.*?)\]/g);_0x3053a9['forEach'](function(_0x3103ca){var _0x133e9a=_0x3103ca[_0x0d6a('0x8')]('[')[_0x0d6a('0xe')](function(_0x4db2f2){return _0x4db2f2[_0x0d6a('0xf')](']')>-0x1;})[_0x0d6a('0x10')](function(_0x2e245b){return _0x2e245b[_0x0d6a('0x8')](']')[0x0];})[0x0];_0x3ecf3e[_0x0d6a('0x11')][_0x0d6a('0x12')]({'field':_0x419494,'operator':_0x22a2cb,'value':_0x133e9a});});});}return _0x3ecf3e;};exports['buildExpression']=function(_0x58e1be,_0x958b02,_0x5ec7f0){var _0x1d5034={};if(_0x958b02===_0x0d6a('0x13')){if(_0x5ec7f0[_0x0d6a('0x14')]===_0x0d6a('0x15')){_0x5ec7f0[_0x0d6a('0x14')]=_0x0d6a('0x16');_0x5ec7f0['value']+=','+_0x5ec7f0['value'];}else if(_[_0x0d6a('0x17')](['$gt',_0x0d6a('0x18')],_0x5ec7f0['operator'])){_0x5ec7f0[_0x0d6a('0x19')]=moment(_0x5ec7f0[_0x0d6a('0x19')])['add'](0x1,'days')['format'](_0x0d6a('0x1a'));}}if(_0x5ec7f0[_0x0d6a('0x1b')]){_0x958b02=_0x5ec7f0[_0x0d6a('0x1b')];_0x1d5034[_0x0d6a('0x1c')]=_0x0d6a('0x1d')+_0x58e1be+'.'+_0x5ec7f0['field']+_0x0d6a('0x1e')+_0x5ec7f0[_0x0d6a('0x1b')]+')\x20'+parseOperator(_0x5ec7f0['operator']);}else{_0x1d5034[_0x0d6a('0x1c')]=_0x58e1be+'.'+_0x5ec7f0[_0x0d6a('0x1f')]+'\x20'+parseOperator(_0x5ec7f0[_0x0d6a('0x14')]);}if(_[_0x0d6a('0x17')]([_0x0d6a('0x20'),_0x0d6a('0x21')],_0x5ec7f0[_0x0d6a('0x14')]))_0x1d5034[_0x0d6a('0x1c')]='('+_0x1d5034[_0x0d6a('0x1c')]+_0x0d6a('0x22')+_0x58e1be+'.'+_0x5ec7f0[_0x0d6a('0x1f')]+_0x0d6a('0x23');_0x1d5034[_0x0d6a('0x19')]=parseValue(_0x958b02,_0x5ec7f0[_0x0d6a('0x14')],_0x5ec7f0['value']);return _0x1d5034;};function parseOperator(_0x2b11be){var _0x473a1a;switch(_0x2b11be){case _0x0d6a('0x24'):_0x473a1a=_0x0d6a('0x25');break;case'$notIn':_0x473a1a=_0x0d6a('0x26');break;case _0x0d6a('0x15'):_0x473a1a='=\x20?';break;case _0x0d6a('0x20'):_0x473a1a=_0x0d6a('0x27');break;case _0x0d6a('0x28'):case _0x0d6a('0x29'):case _0x0d6a('0x2a'):_0x473a1a='LIKE\x20?';break;case'$lt':_0x473a1a=_0x0d6a('0x2b');break;case _0x0d6a('0x2c'):_0x473a1a=_0x0d6a('0x2d');break;case _0x0d6a('0x18'):_0x473a1a=_0x0d6a('0x2e');break;case _0x0d6a('0x2f'):_0x473a1a='>=\x20?';break;case _0x0d6a('0x16'):_0x473a1a=_0x0d6a('0x30');break;}return _0x473a1a;}function parseValue(_0x20984e,_0xd8bb15,_0xb5d9c9){var _0x1c2167={'start':undefined,'end':undefined};switch(_0xd8bb15){case _0x0d6a('0x24'):case'$notIn':_0x1c2167['start']=_0xb5d9c9[_0x0d6a('0x8')](',');break;case'$substring':_0x1c2167['start']='%'+_0xb5d9c9+'%';break;case _0x0d6a('0x29'):_0x1c2167['start']=_0xb5d9c9+'%';break;case _0x0d6a('0x2a'):_0x1c2167[_0x0d6a('0x31')]='%'+_0xb5d9c9;break;case _0x0d6a('0x16'):var _0x4fef7e=_0xb5d9c9[_0x0d6a('0x8')](',');var _0xb5d9c9=_0x4fef7e[_0x0d6a('0xc')]();var _0x2e7c0c=_0x4fef7e['pop']();if(_0x20984e===_0x0d6a('0x13')){_0xb5d9c9=moment(_0xb5d9c9)['utcOffset'](0x0,!![])[_0x0d6a('0x32')]();_0x2e7c0c=moment(_0x2e7c0c)[_0x0d6a('0x33')](0x0,!![])[_0x0d6a('0x34')](0x17,_0x0d6a('0x35'))['add'](0x3b,'minutes')[_0x0d6a('0x34')](0x3b,_0x0d6a('0x36'))[_0x0d6a('0x32')]();}_0x1c2167={'start':_0xb5d9c9,'end':_0x2e7c0c};break;default:_0x1c2167[_0x0d6a('0x31')]=_0xb5d9c9;break;}return _0x1c2167;} \ No newline at end of file +var _0x56a4=['BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','shift','pop','utcOffset','format','add','hours','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','[$and]','replace','split','length','slice','forEach','match','indexOf','map','conditions','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','YYYY-MM-DD','castTo','text','\x20AS\x20','field','$ne','\x20OR\x20','IN\x20?','$notIn','=\x20?','<>\x20?','$substring','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?'];(function(_0x3a950d,_0x4f2ece){var _0x546dfb=function(_0x41eaff){while(--_0x41eaff){_0x3a950d['push'](_0x3a950d['shift']());}};_0x546dfb(++_0x4f2ece);}(_0x56a4,0x1bb));var _0x456a=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0x56a4[_0x3ae34a];return _0x4c9edc;};'use strict';var _=require(_0x456a('0x0'));var moment=require(_0x456a('0x1'));exports[_0x456a('0x2')]=function(_0x52d05a){var _0x8304ac={'conditions':[]};_0x8304ac['sqlOperator']=_[_0x456a('0x3')](_0x52d05a,_0x456a('0x4'))?'or':_0x456a('0x5');var _0xad87e6=_0x52d05a['replace'](_0x456a('0x6'),'')[_0x456a('0x7')]('[$or]','')[_0x456a('0x8')]('||');for(var _0x34fec2=0x0;_0x34fec2<_0xad87e6[_0x456a('0x9')];_0x34fec2++){var _0x25c863=_0xad87e6[_0x34fec2][_0x456a('0x8')](':=');var _0x37b81b=_0x25c863[0x0];var _0x39827e=_0x25c863[_0x456a('0xa')](0x1);_0x39827e[_0x456a('0xb')](function(_0x3e5db0){var _0x662758=_0x3e5db0['split']('[')['shift']();var _0x465d83=_0x3e5db0[_0x456a('0xc')](/\[(.*?)\]/g);_0x465d83[_0x456a('0xb')](function(_0x3a648e){var _0x12f3d2=_0x3a648e[_0x456a('0x8')]('[')['filter'](function(_0x1ba567){return _0x1ba567[_0x456a('0xd')](']')>-0x1;})[_0x456a('0xe')](function(_0x13ac00){return _0x13ac00[_0x456a('0x8')](']')[0x0];})[0x0];_0x8304ac[_0x456a('0xf')]['push']({'field':_0x37b81b,'operator':_0x662758,'value':_0x12f3d2});});});}return _0x8304ac;};exports['buildExpression']=function(_0x1a081d,_0x5662d1,_0x1a921f){var _0x1b1534={};if(_0x5662d1===_0x456a('0x10')){if(_0x1a921f[_0x456a('0x11')]===_0x456a('0x12')){_0x1a921f[_0x456a('0x11')]=_0x456a('0x13');_0x1a921f[_0x456a('0x14')]+=','+_0x1a921f[_0x456a('0x14')];}else if(_[_0x456a('0x15')]([_0x456a('0x16'),_0x456a('0x17')],_0x1a921f[_0x456a('0x11')])){_0x1a921f[_0x456a('0x14')]=moment(_0x1a921f[_0x456a('0x14')])['add'](0x1,_0x456a('0x18'))['format'](_0x456a('0x19'));}}if(_0x1a921f[_0x456a('0x1a')]){_0x5662d1=_0x1a921f[_0x456a('0x1a')];_0x1b1534[_0x456a('0x1b')]='CAST('+_0x1a081d+'.'+_0x1a921f['field']+_0x456a('0x1c')+_0x1a921f['castTo']+')\x20'+parseOperator(_0x1a921f[_0x456a('0x11')]);}else{_0x1b1534[_0x456a('0x1b')]=_0x1a081d+'.'+_0x1a921f[_0x456a('0x1d')]+'\x20'+parseOperator(_0x1a921f[_0x456a('0x11')]);}if(_[_0x456a('0x15')]([_0x456a('0x1e'),'$notIn'],_0x1a921f['operator']))_0x1b1534[_0x456a('0x1b')]='('+_0x1b1534[_0x456a('0x1b')]+_0x456a('0x1f')+_0x1a081d+'.'+_0x1a921f[_0x456a('0x1d')]+'\x20IS\x20NULL)';_0x1b1534['value']=parseValue(_0x5662d1,_0x1a921f[_0x456a('0x11')],_0x1a921f[_0x456a('0x14')]);return _0x1b1534;};function parseOperator(_0x36ad3b){var _0x27e16c;switch(_0x36ad3b){case'$in':_0x27e16c=_0x456a('0x20');break;case _0x456a('0x21'):_0x27e16c='NOT\x20IN\x20?';break;case'$eq':_0x27e16c=_0x456a('0x22');break;case _0x456a('0x1e'):_0x27e16c=_0x456a('0x23');break;case _0x456a('0x24'):case'$startsWith':case'$endsWith':_0x27e16c='LIKE\x20?';break;case _0x456a('0x25'):_0x27e16c=_0x456a('0x26');break;case'$gt':_0x27e16c=_0x456a('0x27');break;case _0x456a('0x17'):_0x27e16c=_0x456a('0x28');break;case _0x456a('0x29'):_0x27e16c=_0x456a('0x2a');break;case _0x456a('0x13'):_0x27e16c=_0x456a('0x2b');break;}return _0x27e16c;}function parseValue(_0x34ad3e,_0x1ff42b,_0x3d42f4){var _0x3c136d={'start':undefined,'end':undefined};switch(_0x1ff42b){case _0x456a('0x2c'):case'$notIn':_0x3c136d[_0x456a('0x2d')]=_0x3d42f4[_0x456a('0x8')](',');break;case _0x456a('0x24'):_0x3c136d[_0x456a('0x2d')]='%'+_0x3d42f4+'%';break;case'$startsWith':_0x3c136d['start']=_0x3d42f4+'%';break;case _0x456a('0x2e'):_0x3c136d['start']='%'+_0x3d42f4;break;case _0x456a('0x13'):var _0x283560=_0x3d42f4[_0x456a('0x8')](',');var _0x3d42f4=_0x283560[_0x456a('0x2f')]();var _0x265f87=_0x283560[_0x456a('0x30')]();if(_0x34ad3e===_0x456a('0x10')){_0x3d42f4=moment(_0x3d42f4)[_0x456a('0x31')](0x0,!![])[_0x456a('0x32')]();_0x265f87=moment(_0x265f87)[_0x456a('0x31')](0x0,!![])[_0x456a('0x33')](0x17,_0x456a('0x34'))[_0x456a('0x33')](0x3b,'minutes')[_0x456a('0x33')](0x3b,_0x456a('0x35'))[_0x456a('0x32')]();}_0x3c136d={'start':_0x3d42f4,'end':_0x265f87};break;default:_0x3c136d[_0x456a('0x2d')]=_0x3d42f4;break;}return _0x3c136d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4b55b99..7ebe0cc 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 _0xef17=['ASC','omit','length','isObject','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','getFullTextValue','match','query','$id','model','attributes','intersection','nolimit','limit','order','where','pick','filter','object','includes','columns','value','merge','map','type','lower','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','forOwn','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','isArray','offset','sort','indexOf','priority','cast','col','unsigned','substr'];(function(_0x65bf20,_0xa669ce){var _0x43cfb1=function(_0x58e140){while(--_0x58e140){_0x65bf20['push'](_0x65bf20['shift']());}};_0x43cfb1(++_0xa669ce);}(_0xef17,0x136));var _0x7ef1=function(_0x577a6a,_0x1bd745){_0x577a6a=_0x577a6a-0x0;var _0x5c39b1=_0xef17[_0x577a6a];return _0x5c39b1;};'use strict';var _=require(_0x7ef1('0x0'));var sequelize=require(_0x7ef1('0x1'));var moment=require(_0x7ef1('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x11f6b7){var _0x601558=['ne'];try{var _0x2c0aac=JSON[_0x7ef1('0x3')](_0x11f6b7);var _0x19a10d=Object[_0x7ef1('0x4')](_0x2c0aac)[0x0];return _0x601558['includes'](_0x19a10d);}catch(_0x1d2f83){return![];}}function getOperatorValue(_0x514b70){var _0x138ed1=JSON['parse'](_0x514b70);var _0x34a040=Object['keys'](_0x138ed1)[0x0];var _0x5aec63=_0x138ed1[_0x34a040];return{['$'+_0x34a040]:_0x5aec63};}exports[_0x7ef1('0x5')]=function(_0x3398a6){var _0x56ab07=null;if(_0x3398a6){_0x56ab07=_0x3398a6[_0x7ef1('0x6')](',');}return _0x56ab07;};exports[_0x7ef1('0x7')]=function(_0x4534fc,_0x3d47e2){var _0x2cb9b0={};if(!_[_0x7ef1('0x8')](_0x4534fc)){_[_0x7ef1('0x9')](_0x4534fc,function(_0x4bedd1,_0x4da8e8){try{if(_0x3d47e2){var _0x1d4522=_['find'](_0x3d47e2,{'name':_0x4da8e8})||{};if(hasSequelizeOperator(_0x4bedd1)){_0x2cb9b0[_0x4da8e8]=getOperatorValue(_0x4bedd1);}else if(_0x1d4522['type']==='DATE'&&_[_0x7ef1('0xa')](_0x4bedd1)){var _0x51e226=JSON[_0x7ef1('0x3')](_0x4bedd1);var _0x29c920={'$gte':moment(moment(_0x51e226[_0x7ef1('0xb')])[_0x7ef1('0xc')](_0x7ef1('0xd')))[_0x7ef1('0xe')]()[_0x7ef1('0xc')](),'$lte':moment(moment(_0x51e226[_0x7ef1('0xf')])['format']('YYYY-MM-DD'))[_0x7ef1('0xe')]()['subtract'](0x1,'s')[_0x7ef1('0xc')]()};_0x2cb9b0[_0x4da8e8]=_0x29c920;}else if(_0x1d4522[_0x7ef1('0x10')]==='uniqueid'){_0x2cb9b0[_0x4da8e8]=_0x4bedd1;}else{_0x2cb9b0[_0x4da8e8]=_['isArray'](_0x4bedd1)?_0x4bedd1:JSON['parse'](_0x4bedd1);}}else{_0x2cb9b0[_0x4da8e8]=_[_0x7ef1('0x11')](_0x4bedd1)?_0x4bedd1:JSON['parse'](_0x4bedd1);}}catch(_0x3a5835){_0x2cb9b0[_0x4da8e8]=_0x4bedd1['split'](',');}});}return _0x2cb9b0;};exports['limit']=function(_0x5b7e36){_0x5b7e36=parseInt(_0x5b7e36,0xa);if(!_0x5b7e36||_0x5b7e36<0x0){_0x5b7e36=LIMIT_VALUE;}return _0x5b7e36;};exports[_0x7ef1('0x12')]=function(_0x575a75){_0x575a75=parseInt(_0x575a75,0xa);if(!_0x575a75||_0x575a75<0x0){_0x575a75=0x0;}return _0x575a75;};exports[_0x7ef1('0x13')]=function(_0x2a8fab){var _0x5291b0,_0x568d0a=null;if(_0x2a8fab){_0x5291b0=_0x2a8fab[_0x7ef1('0x6')](',');_0x568d0a=_['map'](_0x5291b0,function(_0x458459){if(_0x458459[_0x7ef1('0x14')]('-')===0x0){return[_0x458459===_0x7ef1('0x15')?sequelize[_0x7ef1('0x16')](sequelize[_0x7ef1('0x17')](_0x7ef1('0x15')),_0x7ef1('0x18')):_0x458459[_0x7ef1('0x19')](0x1),'DESC'];}else{return[_0x458459===_0x7ef1('0x15')?sequelize[_0x7ef1('0x16')](sequelize[_0x7ef1('0x17')](_0x7ef1('0x15')),_0x7ef1('0x18')):_0x458459,_0x7ef1('0x1a')];}});}return _0x568d0a;};exports[_0x7ef1('0x1b')]=function(_0x144e74,_0x508a5f){if(_['isEmpty'](_0x144e74)){return _0x144e74;}if(_[_0x7ef1('0x11')](_0x144e74)){for(var _0x12ef5a=0x0;_0x12ef5a<_0x144e74[_0x7ef1('0x1c')];_0x12ef5a+=0x1){_0x144e74[_0x12ef5a]=this[_0x7ef1('0x1b')](_0x144e74[_0x12ef5a],_0x508a5f);}return _0x144e74;}if(!_[_0x7ef1('0x1d')](_0x144e74)){return _0x144e74;}if(_['isString'](_0x508a5f)){_0x508a5f=[_0x508a5f];}if(!_[_0x7ef1('0x11')](_0x508a5f)){return _0x144e74;}for(var _0x9eca93=0x0;_0x9eca93<_0x508a5f[_0x7ef1('0x1c')];_0x9eca93+=0x1){_[_0x7ef1('0x1e')](_0x144e74,_0x508a5f[_0x9eca93]);}for(var _0x232f4e in _0x144e74){if(_0x144e74[_0x7ef1('0x1f')](_0x232f4e)){_0x144e74[_0x232f4e]=this[_0x7ef1('0x1b')](_0x144e74[_0x232f4e],_0x508a5f);}}return _0x144e74;};exports['isNumeric']=function(_0x2e8f1b){return _0x2e8f1b['match'](RegExp(_0x7ef1('0x20')))?!![]:![];};exports[_0x7ef1('0x21')]=function(_0x4b5fde){return _0x4b5fde['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7ef1('0x22')]=function(_0x1136dc){var _0x5ab3a5=[];_0x1136dc[_0x7ef1('0x6')](/[ ,]+/)['forEach'](function(_0x3aa113){_0x3aa113=_0x3aa113['replace'](/([^:]")"+/g,'$1');_0x3aa113='+'+_0x3aa113+'*';var _0x122999=/[ `!@#$%^&*()_\-?~]/;if(_0x3aa113[_0x7ef1('0x23')](_0x122999))_0x3aa113='\x22'+_0x3aa113+'\x22';_0x5ab3a5['push'](_0x3aa113);});return _0x5ab3a5['join']('\x20');};exports['getOptions']=function(_0x5f2976,_0x1b72a1,_0x36b83f){var _0x596abe={},_0x1110f5={};if(_0x1b72a1['query']['$id']){_0x1b72a1[_0x7ef1('0x24')]['id']=_0x1b72a1['query'][_0x7ef1('0x25')];delete _0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x25')];}_0x596abe[_0x7ef1('0x26')]=_['map'](_0x5f2976,_0x7ef1('0x10'));_0x596abe[_0x7ef1('0x24')]=_['keys'](_0x1b72a1['query']);_0x596abe['filters']=_['intersection'](_0x596abe[_0x7ef1('0x26')],_0x596abe['query']);_0x1110f5[_0x7ef1('0x27')]=_[_0x7ef1('0x28')](_0x596abe[_0x7ef1('0x26')],this[_0x7ef1('0x5')](_0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x5')]));_0x1110f5[_0x7ef1('0x27')]=_0x1110f5[_0x7ef1('0x27')][_0x7ef1('0x1c')]?_0x1110f5[_0x7ef1('0x27')]:_0x596abe[_0x7ef1('0x26')];if(!_0x1b72a1['query'][_0x7ef1('0x1f')](_0x7ef1('0x29'))){_0x1110f5['limit']=this[_0x7ef1('0x2a')](_0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x2a')]);_0x1110f5[_0x7ef1('0x12')]=this[_0x7ef1('0x12')](_0x1b72a1['query'][_0x7ef1('0x12')]);}_0x1110f5[_0x7ef1('0x2b')]=this[_0x7ef1('0x13')](_0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x13')]);_0x1110f5[_0x7ef1('0x2c')]=this[_0x7ef1('0x7')](_[_0x7ef1('0x2d')](_0x1b72a1[_0x7ef1('0x24')],_0x596abe[_0x7ef1('0x7')]),_0x5f2976);if(_0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x2e')]){var _0x2da912=_0x5f2976;var _0x39b280=_0x1b72a1[_0x7ef1('0x24')]['filter'];if(typeof _0x39b280===_0x7ef1('0x2f')){_0x2da912=_[_0x7ef1('0x2e')](_0x5f2976,function(_0x302212){return _[_0x7ef1('0x30')](_0x39b280[_0x7ef1('0x31')],_0x302212[_0x7ef1('0x10')]);});_0x39b280=_0x39b280[_0x7ef1('0x32')];}_0x1110f5[_0x7ef1('0x2c')]=_[_0x7ef1('0x33')](_0x1110f5[_0x7ef1('0x2c')],{'$or':_[_0x7ef1('0x34')](_0x2da912,function(_0x374bf5){if(_0x374bf5[_0x7ef1('0x35')]!=='VIRTUAL'){if(_0x36b83f){return sequelize[_0x7ef1('0x2c')](sequelize['fn'](_0x7ef1('0x36'),sequelize[_0x7ef1('0x17')](_0x374bf5[_0x7ef1('0x10')])),{'$like':sequelize['fn'](_0x7ef1('0x36'),'%'+_0x1b72a1[_0x7ef1('0x24')]['filter']+'%')});}else{var _0x4448ca={};_0x4448ca[_0x374bf5[_0x7ef1('0x10')]]={'$like':'%'+_0x1b72a1[_0x7ef1('0x24')][_0x7ef1('0x2e')]+'%'};return _0x4448ca;}}})});}_0x1110f5=_[_0x7ef1('0x33')]({},_0x1110f5,_0x1b72a1[_0x7ef1('0x37')]);return _0x1110f5;}; \ No newline at end of file +var _0x9c5a=['YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','offset','sort','indexOf','col','priority','unsigned','substr','DESC','omit','isEmpty','length','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','replace','push','join','getOptions','query','$id','name','intersection','model','attributes','nolimit','order','filter','object','columns','value','where','VIRTUAL','lower','merge','options','lodash','sequelize','parse','keys','includes','fields','split','filters','find','type','DATE','isPlainObject','format'];(function(_0x36630e,_0x4132a4){var _0x430205=function(_0x10d242){while(--_0x10d242){_0x36630e['push'](_0x36630e['shift']());}};_0x430205(++_0x4132a4);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x23b185,_0x15dfea){_0x23b185=_0x23b185-0x0;var _0x285ab0=_0x9c5a[_0x23b185];return _0x285ab0;};'use strict';var _=require(_0xa9c5('0x0'));var sequelize=require(_0xa9c5('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x32ab4d){var _0x1cd14d=['ne'];try{var _0x1d0ee9=JSON[_0xa9c5('0x2')](_0x32ab4d);var _0x4f5552=Object[_0xa9c5('0x3')](_0x1d0ee9)[0x0];return _0x1cd14d[_0xa9c5('0x4')](_0x4f5552);}catch(_0x4e9403){return![];}}function getOperatorValue(_0x1e3c83){var _0x4d9c7a=JSON[_0xa9c5('0x2')](_0x1e3c83);var _0x3df556=Object['keys'](_0x4d9c7a)[0x0];var _0x4b6db6=_0x4d9c7a[_0x3df556];return{['$'+_0x3df556]:_0x4b6db6};}exports[_0xa9c5('0x5')]=function(_0x16f331){var _0x52afb2=null;if(_0x16f331){_0x52afb2=_0x16f331[_0xa9c5('0x6')](',');}return _0x52afb2;};exports[_0xa9c5('0x7')]=function(_0x51c14c,_0x2e4f45){var _0x40a79d={};if(!_['isEmpty'](_0x51c14c)){_['forOwn'](_0x51c14c,function(_0x38e106,_0x11421c){try{if(_0x2e4f45){var _0x45f8d8=_[_0xa9c5('0x8')](_0x2e4f45,{'name':_0x11421c})||{};if(hasSequelizeOperator(_0x38e106)){_0x40a79d[_0x11421c]=getOperatorValue(_0x38e106);}else if(_0x45f8d8[_0xa9c5('0x9')]===_0xa9c5('0xa')&&_[_0xa9c5('0xb')](_0x38e106)){var _0x42d5cf=JSON[_0xa9c5('0x2')](_0x38e106);var _0x1ea48={'$gte':moment(moment(_0x42d5cf['$gte'])[_0xa9c5('0xc')](_0xa9c5('0xd')))[_0xa9c5('0xe')]()[_0xa9c5('0xc')](),'$lte':moment(moment(_0x42d5cf[_0xa9c5('0xf')])[_0xa9c5('0xc')](_0xa9c5('0xd')))[_0xa9c5('0xe')]()[_0xa9c5('0x10')](0x1,'s')[_0xa9c5('0xc')]()};_0x40a79d[_0x11421c]=_0x1ea48;}else if(_0x45f8d8['name']===_0xa9c5('0x11')){_0x40a79d[_0x11421c]=_0x38e106;}else{_0x40a79d[_0x11421c]=_[_0xa9c5('0x12')](_0x38e106)?_0x38e106:JSON[_0xa9c5('0x2')](_0x38e106);}}else{_0x40a79d[_0x11421c]=_['isArray'](_0x38e106)?_0x38e106:JSON[_0xa9c5('0x2')](_0x38e106);}}catch(_0x1142d9){_0x40a79d[_0x11421c]=_0x38e106[_0xa9c5('0x6')](',');}});}return _0x40a79d;};exports[_0xa9c5('0x13')]=function(_0x452a9b){_0x452a9b=parseInt(_0x452a9b,0xa);if(!_0x452a9b||_0x452a9b<0x0){_0x452a9b=LIMIT_VALUE;}return _0x452a9b;};exports[_0xa9c5('0x14')]=function(_0x3b8d4d){_0x3b8d4d=parseInt(_0x3b8d4d,0xa);if(!_0x3b8d4d||_0x3b8d4d<0x0){_0x3b8d4d=0x0;}return _0x3b8d4d;};exports[_0xa9c5('0x15')]=function(_0x2c7cd5){var _0x36c486,_0x113c8f=null;if(_0x2c7cd5){_0x36c486=_0x2c7cd5[_0xa9c5('0x6')](',');_0x113c8f=_['map'](_0x36c486,function(_0x1115ad){if(_0x1115ad[_0xa9c5('0x16')]('-')===0x0){return[_0x1115ad==='priority'?sequelize['cast'](sequelize[_0xa9c5('0x17')](_0xa9c5('0x18')),_0xa9c5('0x19')):_0x1115ad[_0xa9c5('0x1a')](0x1),_0xa9c5('0x1b')];}else{return[_0x1115ad===_0xa9c5('0x18')?sequelize['cast'](sequelize['col'](_0xa9c5('0x18')),_0xa9c5('0x19')):_0x1115ad,'ASC'];}});}return _0x113c8f;};exports[_0xa9c5('0x1c')]=function(_0x424b4c,_0x306c9b){if(_[_0xa9c5('0x1d')](_0x424b4c)){return _0x424b4c;}if(_[_0xa9c5('0x12')](_0x424b4c)){for(var _0x40f08b=0x0;_0x40f08b<_0x424b4c[_0xa9c5('0x1e')];_0x40f08b+=0x1){_0x424b4c[_0x40f08b]=this['omit'](_0x424b4c[_0x40f08b],_0x306c9b);}return _0x424b4c;}if(!_['isObject'](_0x424b4c)){return _0x424b4c;}if(_[_0xa9c5('0x1f')](_0x306c9b)){_0x306c9b=[_0x306c9b];}if(!_['isArray'](_0x306c9b)){return _0x424b4c;}for(var _0x1762ac=0x0;_0x1762ac<_0x306c9b[_0xa9c5('0x1e')];_0x1762ac+=0x1){_['unset'](_0x424b4c,_0x306c9b[_0x1762ac]);}for(var _0x11a723 in _0x424b4c){if(_0x424b4c[_0xa9c5('0x20')](_0x11a723)){_0x424b4c[_0x11a723]=this['omit'](_0x424b4c[_0x11a723],_0x306c9b);}}return _0x424b4c;};exports[_0xa9c5('0x21')]=function(_0x32baf9){return _0x32baf9[_0xa9c5('0x22')](RegExp(_0xa9c5('0x23')))?!![]:![];};exports[_0xa9c5('0x24')]=function(_0x4f6e70){return _0x4f6e70[_0xa9c5('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x3c3da7){var _0x1ef388=[];_0x3c3da7[_0xa9c5('0x6')](/[ ,]+/)['forEach'](function(_0xc6d0c1){_0xc6d0c1=_0xc6d0c1[_0xa9c5('0x25')](/([^:]")"+/g,'$1');_0xc6d0c1='+'+_0xc6d0c1+'*';var _0x5bc9bb=/[ `!@#$%^&*()_\-?~]/;if(_0xc6d0c1[_0xa9c5('0x22')](_0x5bc9bb))_0xc6d0c1='\x22'+_0xc6d0c1+'\x22';_0x1ef388[_0xa9c5('0x26')](_0xc6d0c1);});return _0x1ef388[_0xa9c5('0x27')]('\x20');};exports[_0xa9c5('0x28')]=function(_0x22ee21,_0x3392d0,_0x3a66d8){var _0x4b9104={},_0x452330={};if(_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')]){_0x3392d0[_0xa9c5('0x29')]['id']=_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')];delete _0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x2a')];}_0x4b9104['model']=_['map'](_0x22ee21,_0xa9c5('0x2b'));_0x4b9104[_0xa9c5('0x29')]=_[_0xa9c5('0x3')](_0x3392d0[_0xa9c5('0x29')]);_0x4b9104[_0xa9c5('0x7')]=_[_0xa9c5('0x2c')](_0x4b9104['model'],_0x4b9104['query']);_0x452330['attributes']=_[_0xa9c5('0x2c')](_0x4b9104[_0xa9c5('0x2d')],this['fields'](_0x3392d0[_0xa9c5('0x29')]['fields']));_0x452330[_0xa9c5('0x2e')]=_0x452330[_0xa9c5('0x2e')][_0xa9c5('0x1e')]?_0x452330[_0xa9c5('0x2e')]:_0x4b9104['model'];if(!_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x20')](_0xa9c5('0x2f'))){_0x452330[_0xa9c5('0x13')]=this[_0xa9c5('0x13')](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x13')]);_0x452330[_0xa9c5('0x14')]=this['offset'](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x14')]);}_0x452330[_0xa9c5('0x30')]=this[_0xa9c5('0x15')](_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x15')]);_0x452330['where']=this[_0xa9c5('0x7')](_['pick'](_0x3392d0[_0xa9c5('0x29')],_0x4b9104['filters']),_0x22ee21);if(_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]){var _0x37fb1b=_0x22ee21;var _0x5d09c5=_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')];if(typeof _0x5d09c5===_0xa9c5('0x32')){_0x37fb1b=_[_0xa9c5('0x31')](_0x22ee21,function(_0x5914d2){return _[_0xa9c5('0x4')](_0x5d09c5[_0xa9c5('0x33')],_0x5914d2[_0xa9c5('0x2b')]);});_0x5d09c5=_0x5d09c5[_0xa9c5('0x34')];}_0x452330[_0xa9c5('0x35')]=_['merge'](_0x452330[_0xa9c5('0x35')],{'$or':_['map'](_0x37fb1b,function(_0x1de605){if(_0x1de605[_0xa9c5('0x9')]!==_0xa9c5('0x36')){if(_0x3a66d8){return sequelize[_0xa9c5('0x35')](sequelize['fn'](_0xa9c5('0x37'),sequelize[_0xa9c5('0x17')](_0x1de605[_0xa9c5('0x2b')])),{'$like':sequelize['fn'](_0xa9c5('0x37'),'%'+_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]+'%')});}else{var _0x4aa4dd={};_0x4aa4dd[_0x1de605[_0xa9c5('0x2b')]]={'$like':'%'+_0x3392d0[_0xa9c5('0x29')][_0xa9c5('0x31')]+'%'};return _0x4aa4dd;}}})});}_0x452330=_[_0xa9c5('0x38')]({},_0x452330,_0x3392d0[_0xa9c5('0x39')]);return _0x452330;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 2632965..6dc6cd2 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 _0xa24c=['startCase','Queue','getAgents','all','flatten','uniq','value','includes','idle','getAgentIdsByStatus','resolve','findAll','name','voicePause','map','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname','internal','indexOf','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','filter','length','unknown','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','busy','getAgentStatus'];(function(_0x1c91a6,_0x18e77f){var _0x1d8267=function(_0x2689a2){while(--_0x2689a2){_0x1c91a6['push'](_0x1c91a6['shift']());}};_0x1d8267(++_0x18e77f);}(_0xa24c,0x1b4));var _0xca24=function(_0x497ce2,_0x249d65){_0x497ce2=_0x497ce2-0x0;var _0x53d023=_0xa24c[_0x497ce2];return _0x53d023;};'use strict';var _=require(_0xca24('0x0'));var jayson=require(_0xca24('0x1'));var db=require(_0xca24('0x2'))['db'];var amiClient=jayson[_0xca24('0x3')][_0xca24('0x4')]({'port':0x232a});var routingClient=jayson[_0xca24('0x3')]['http']({'port':0x232c});function isAgentPaused(_0x155fc2,_0x15231d){var _0x283f79=[_0x155fc2[_0xca24('0x5')],_0x155fc2[_0xca24('0x6')],_0x155fc2[_0xca24('0x7')],_0x155fc2[_0xca24('0x8')],_0x155fc2[_0xca24('0x9')],_0x155fc2['voicePause'],_0x155fc2[_0xca24('0xa')]];if(!_0x15231d)return _[_0xca24('0xb')](_0x283f79);var _0x40d7c4=_[_0xca24('0xc')](_0x283f79);return _0x40d7c4[_0xca24('0xd')]>0x0&&_0x40d7c4[_0xca24('0xd')]<_0x283f79[_0xca24('0xd')]?!![]:![];}function isIdle(_0x46cb37){return _0x46cb37==='idle'||_0x46cb37===_0xca24('0xe')||_0x46cb37==='unavailable'||_0x46cb37===_0xca24('0xf')||_[_0xca24('0x10')](_0x46cb37);}function isAgentIdle(_0x1c343e){if(_0x1c343e[_0xca24('0x11')]!=='idle'&&_0x1c343e['voicePause']){_0x1c343e[_0xca24('0x11')]=_0xca24('0x12');return![];}return _[_0xca24('0xb')]([_0x1c343e[_0xca24('0x13')],_0x1c343e[_0xca24('0x14')],_0x1c343e[_0xca24('0x15')],_0x1c343e['openchannelStatus'],_0x1c343e[_0xca24('0x16')],_0x1c343e[_0xca24('0x11')],_0x1c343e[_0xca24('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xca24('0x18')](_0xca24('0x19'),{})[_0xca24('0x1a')](function(_0x32f181){if(_0x32f181[_0xca24('0x1b')]){throw new Error(_0xca24('0x1c'));}var _0x7e724a=_0x32f181[_0xca24('0x1d')];return routingClient[_0xca24('0x18')](_0xca24('0x19'),{})[_0xca24('0x1a')](function(_0x5f312e){if(_0x5f312e[_0xca24('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x2fce7a=_0x5f312e[_0xca24('0x1d')];return _[_0xca24('0x1e')]({},_0x7e724a,_0x2fce7a);});})[_0xca24('0x1f')](function(_0x1c9ade){throw _0x1c9ade;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4f38a5){var _0xcd5626='unknown';if(isAgentPaused(_0x4f38a5))_0xcd5626=_0xca24('0x12');else if(isAgentPaused(_0x4f38a5,!![]))_0xcd5626='*pause';else if(isAgentIdle(_0x4f38a5))_0xcd5626='idle';else _0xcd5626=_0xca24('0x20');return _0xcd5626;}exports[_0xca24('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x15dbbf,_0x33933d){var _0x34b1c6=_['isArray'](_0x15dbbf)?_0x15dbbf:[_0x15dbbf];var _0xc90164=_[_0xca24('0x22')](_0x33933d)+_0xca24('0x23');var _0x53d94f=_['map'](_0x34b1c6,function(_0xeff1a5){return db[_0xc90164]['findOne']({'where':{'id':_0xeff1a5}})[_0xca24('0x1a')](function(_0x449415){if(!_0x449415)return[];return _0x449415[_0xca24('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xca24('0x25')](_0x53d94f)[_0xca24('0x1a')](function(_0x57d7dd){var _0x5897fd=_(_0x57d7dd)[_0xca24('0x26')]()['map']('id')[_0xca24('0x27')]()[_0xca24('0x28')]();return _0x5897fd;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x12cc8d,_0x596ad4,_0x1ddcde){try{if(_0x596ad4[_0xca24('0xd')]>0x0){_0x12cc8d=_0x12cc8d[_0xca24('0xc')](function(_0x48ef93){return _0x596ad4[_0xca24('0x29')](_0x48ef93['id']);});}var _0x247e4b=_0x12cc8d[_0xca24('0xc')](function(_0x11f900){var _0x2421b6=_0xca24('0x20');if(isAgentIdle(_0x11f900)){_0x2421b6=_0xca24('0x2a');}return _0x2421b6===_0x1ddcde;});return _['map'](_0x247e4b,'id');}catch(_0x46972a){throw _0x46972a;}}exports[_0xca24('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x473b09,_0x524eec,_0x571a94){return Promise[_0xca24('0x2c')]()[_0xca24('0x1a')](function(){if(_0x524eec[_0xca24('0xd')]>0x0){_0x473b09=_0x473b09[_0xca24('0xc')](function(_0x27af64){return _0x524eec[_0xca24('0x29')](_0x27af64['id']);});}return _0x473b09;})[_0xca24('0x1a')](function(){return db['User'][_0xca24('0x2d')]({'attributes':['id',_0xca24('0x2e'),'fullname','chatPause',_0xca24('0x6'),'mailPause','openchannelPause',_0xca24('0x9'),_0xca24('0x2f'),_0xca24('0xa'),'pauseType'],'where':{'id':{'$in':_[_0xca24('0x30')](_0x473b09,'id')}},'raw':!![]});})['then'](function(_0x510e0c){return _0x510e0c[_0xca24('0x30')](function(_0xceaba1){var _0x53a9b2=_[_0xca24('0x31')](_0x473b09,['id',_0xceaba1['id']]);var _0x5419ea=filterAgentAttributes(_0x53a9b2);_[_0xca24('0x1e')](_0xceaba1,_0x5419ea);_0xceaba1[_0xca24('0x32')]=getAgentStatus(_0xceaba1);return _0xceaba1;});})[_0xca24('0x1a')](function(_0x1a6a68){var _0x452621=sortAgentsByStatus(_0x1a6a68,_0x571a94);return _[_0xca24('0x30')](_0x452621,'id');})['catch'](function(_0x3d4581){throw _0x3d4581;});}exports[_0xca24('0x33')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x54e659){var _0x1b0e73={'fields':[],'order':null};var _0x26f40b=_0x54e659[_0xca24('0x34')](',');_0x1b0e73[_0xca24('0x35')]=_[_0xca24('0xc')](_0x26f40b,function(_0x313540){if(!_0x313540[_0xca24('0x29')]('globalStatus')){return!![];}_0x1b0e73[_0xca24('0x36')]=_[_0xca24('0x37')](_0x313540,'-')?_0xca24('0x38'):_0xca24('0x39');return![];});return _0x1b0e73;}exports[_0xca24('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x2fe1fa){if(_0x2fe1fa[_0xca24('0x29')](_0xca24('0x3b'))&&!_0x2fe1fa[_0xca24('0x29')](_0xca24('0x3c'))){var _0x995c38=_0x2fe1fa['substring'](0x0,_0x2fe1fa[_0xca24('0x3d')](_0xca24('0x3b')));_0x2fe1fa+=','+_0x995c38+'internal';}return _0x2fe1fa;}exports[_0xca24('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x4b288d,_0x2e5d97){var _0x42a281=_0x4b288d[_0xca24('0x3f')](function(_0x5e3c46,_0x58b26e){if(_0x5e3c46[_0xca24('0x32')]===_0x58b26e[_0xca24('0x32')]){if(_0x5e3c46[_0xca24('0x32')]==='pause'){if(_0x2e5d97==='DESC'){return(_0x5e3c46['pauseType']||'')<(_0x58b26e[_0xca24('0x40')]||'')||_0x5e3c46[_0xca24('0x3b')][_0xca24('0x41')]()>_0x58b26e[_0xca24('0x3b')]['toLowerCase']()?0x1:-0x1;}else{return(_0x5e3c46[_0xca24('0x40')]||'')<(_0x58b26e[_0xca24('0x40')]||'')||_0x5e3c46[_0xca24('0x3b')][_0xca24('0x41')]()>_0x58b26e['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x2e5d97==='DESC'){return _0x5e3c46[_0xca24('0x3b')][_0xca24('0x41')]()<_0x58b26e[_0xca24('0x3b')]['toLowerCase']()?0x1:-0x1;}else{return _0x5e3c46[_0xca24('0x3b')][_0xca24('0x41')]()<_0x58b26e['fullname'][_0xca24('0x41')]()?-0x1:0x1;}}}else{if(_0x2e5d97===_0xca24('0x38')){return _0x5e3c46[_0xca24('0x32')]<_0x58b26e[_0xca24('0x32')]?0x1:-0x1;}else{return _0x5e3c46[_0xca24('0x32')]<_0x58b26e[_0xca24('0x32')]?-0x1:0x1;}}});return _0x42a281;}exports[_0xca24('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x4f0d1a){var _0x5dc1fa=[_0xca24('0x43'),_0xca24('0x44'),'lastLoginAt','lastPauseAt',_0xca24('0x40'),_0xca24('0x45'),_0xca24('0x3c'),_0xca24('0x46'),_0xca24('0x5'),_0xca24('0x8'),_0xca24('0x7'),_0xca24('0x9'),'whatsappPause',_0xca24('0x6'),_0xca24('0x2f'),_0xca24('0x47'),_0xca24('0x48'),'mailCapacity',_0xca24('0x49'),_0xca24('0x4a'),_0xca24('0x4b'),_0xca24('0x4c'),'openchannelCurrentCapacity',_0xca24('0x4d'),_0xca24('0x4e'),'whatsappCurrentCapacity',_0xca24('0x4f'),_0xca24('0x13'),_0xca24('0x50'),'mailStatus','smsStatus',_0xca24('0x17'),'faxStatus',_0xca24('0x11'),_0xca24('0x51'),_0xca24('0x52'),_0xca24('0x53'),_0xca24('0x54'),_0xca24('0x55'),_0xca24('0x56'),_0xca24('0x57'),_0xca24('0x58'),'destconnectedlinenum','screenrecording',_0xca24('0x59'),_0xca24('0x5a'),_0xca24('0x5b')];var _0x2d435d=[_0xca24('0x5'),_0xca24('0x8'),_0xca24('0x7'),_0xca24('0x9'),_0xca24('0xa'),_0xca24('0x6'),_0xca24('0x2f'),_0xca24('0x44')];var _0x51c44a=_(_0x4f0d1a)['omit'](_0x2d435d)[_0xca24('0x5c')](_0x5dc1fa)[_0xca24('0x28')]();return _0x51c44a;}exports[_0xca24('0x5d')]=filterAgentAttributes; \ No newline at end of file +var _0x73b3=['whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','lodash','../../mysqldb','http','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','pause','every','faxStatus','openchannelStatus','smsStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value','includes','idle','getAgentIdsByStatus','findAll','name','fullname','pauseType','merge','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','substring','indexOf','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatus','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0xd2e40d,_0x4116f4){var _0x4407cf=function(_0x361278){while(--_0x361278){_0xd2e40d['push'](_0xd2e40d['shift']());}};_0x4407cf(++_0x4116f4);}(_0x73b3,0x192));var _0x373b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x73b3[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x373b('0x0'));var jayson=require('jayson/promise');var db=require(_0x373b('0x1'))['db'];var amiClient=jayson['client'][_0x373b('0x2')]({'port':0x232a});var routingClient=jayson[_0x373b('0x3')][_0x373b('0x2')]({'port':0x232c});function isAgentPaused(_0x4181ff,_0x5894e4){var _0x46752d=[_0x4181ff[_0x373b('0x4')],_0x4181ff[_0x373b('0x5')],_0x4181ff[_0x373b('0x6')],_0x4181ff[_0x373b('0x7')],_0x4181ff[_0x373b('0x8')],_0x4181ff[_0x373b('0x9')],_0x4181ff[_0x373b('0xa')]];if(!_0x5894e4)return _['every'](_0x46752d);var _0x11c055=_[_0x373b('0xb')](_0x46752d);return _0x11c055[_0x373b('0xc')]>0x0&&_0x11c055[_0x373b('0xc')]<_0x46752d[_0x373b('0xc')]?!![]:![];}function isIdle(_0x481544){return _0x481544==='idle'||_0x481544===_0x373b('0xd')||_0x481544===_0x373b('0xe')||_0x481544===_0x373b('0xf')||_[_0x373b('0x10')](_0x481544);}function isAgentIdle(_0x3e4033){if(_0x3e4033['voiceStatus']!=='idle'&&_0x3e4033[_0x373b('0x9')]){_0x3e4033[_0x373b('0x11')]=_0x373b('0x12');return![];}return _[_0x373b('0x13')]([_0x3e4033['chatStatus'],_0x3e4033[_0x373b('0x14')],_0x3e4033['mailStatus'],_0x3e4033[_0x373b('0x15')],_0x3e4033[_0x373b('0x16')],_0x3e4033[_0x373b('0x11')],_0x3e4033['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x373b('0x17')]('Agents',{})[_0x373b('0x18')](function(_0x43e195){if(_0x43e195[_0x373b('0x19')]){throw new Error(_0x373b('0x1a'));}var _0x83275b=_0x43e195['result'];return routingClient['request'](_0x373b('0x1b'),{})[_0x373b('0x18')](function(_0x3bcea8){if(_0x3bcea8[_0x373b('0x19')]){throw new Error(_0x373b('0x1c'));}var _0x36dd22=_0x3bcea8[_0x373b('0x1d')];return _['merge']({},_0x83275b,_0x36dd22);});})[_0x373b('0x1e')](function(_0x5b9fe3){throw _0x5b9fe3;});}exports[_0x373b('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x6f47ce){var _0x4d0fec=_0x373b('0xd');if(isAgentPaused(_0x6f47ce))_0x4d0fec='pause';else if(isAgentPaused(_0x6f47ce,!![]))_0x4d0fec=_0x373b('0x20');else if(isAgentIdle(_0x6f47ce))_0x4d0fec='idle';else _0x4d0fec=_0x373b('0x21');return _0x4d0fec;}exports[_0x373b('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x52004a,_0x57580e){var _0x43e6cd=_[_0x373b('0x23')](_0x52004a)?_0x52004a:[_0x52004a];var _0x1701b0=_[_0x373b('0x24')](_0x57580e)+_0x373b('0x25');var _0x291cce=_[_0x373b('0x26')](_0x43e6cd,function(_0x321d2d){return db[_0x1701b0][_0x373b('0x27')]({'where':{'id':_0x321d2d}})['then'](function(_0x315133){if(!_0x315133)return[];return _0x315133[_0x373b('0x28')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x373b('0x29')](_0x291cce)[_0x373b('0x18')](function(_0x29a415){var _0x449294=_(_0x29a415)[_0x373b('0x2a')]()[_0x373b('0x26')]('id')[_0x373b('0x2b')]()[_0x373b('0x2c')]();return _0x449294;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3fb854,_0x241130,_0x267cdf){try{if(_0x241130['length']>0x0){_0x3fb854=_0x3fb854[_0x373b('0xb')](function(_0x38fc06){return _0x241130[_0x373b('0x2d')](_0x38fc06['id']);});}var _0x380717=_0x3fb854[_0x373b('0xb')](function(_0x52b9ae){var _0x1b7898=_0x373b('0x21');if(isAgentIdle(_0x52b9ae)){_0x1b7898=_0x373b('0x2e');}return _0x1b7898===_0x267cdf;});return _[_0x373b('0x26')](_0x380717,'id');}catch(_0x3f7b11){throw _0x3f7b11;}}exports[_0x373b('0x2f')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x56d491,_0x28d83b,_0x3c55b1){return Promise['resolve']()[_0x373b('0x18')](function(){if(_0x28d83b[_0x373b('0xc')]>0x0){_0x56d491=_0x56d491['filter'](function(_0x581d96){return _0x28d83b[_0x373b('0x2d')](_0x581d96['id']);});}return _0x56d491;})[_0x373b('0x18')](function(){return db['User'][_0x373b('0x30')]({'attributes':['id',_0x373b('0x31'),_0x373b('0x32'),_0x373b('0x4'),_0x373b('0x5'),_0x373b('0x6'),_0x373b('0x7'),_0x373b('0x8'),'voicePause',_0x373b('0xa'),_0x373b('0x33')],'where':{'id':{'$in':_[_0x373b('0x26')](_0x56d491,'id')}},'raw':!![]});})[_0x373b('0x18')](function(_0x51b298){return _0x51b298[_0x373b('0x26')](function(_0x38ce20){var _0x5dce2=_['find'](_0x56d491,['id',_0x38ce20['id']]);var _0x6fe678=filterAgentAttributes(_0x5dce2);_[_0x373b('0x34')](_0x38ce20,_0x6fe678);_0x38ce20[_0x373b('0x35')]=getAgentStatus(_0x38ce20);return _0x38ce20;});})[_0x373b('0x18')](function(_0x110254){var _0x58d766=sortAgentsByStatus(_0x110254,_0x3c55b1);return _[_0x373b('0x26')](_0x58d766,'id');})[_0x373b('0x1e')](function(_0x251331){throw _0x251331;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x12439a){var _0x949c2e={'fields':[],'order':null};var _0x105d03=_0x12439a[_0x373b('0x36')](',');_0x949c2e[_0x373b('0x37')]=_[_0x373b('0xb')](_0x105d03,function(_0x182893){if(!_0x182893[_0x373b('0x2d')]('globalStatus')){return!![];}_0x949c2e[_0x373b('0x38')]=_[_0x373b('0x39')](_0x182893,'-')?_0x373b('0x3a'):_0x373b('0x3b');return![];});return _0x949c2e;}exports[_0x373b('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x3fe3fc){if(_0x3fe3fc[_0x373b('0x2d')](_0x373b('0x32'))&&!_0x3fe3fc['includes']('internal')){var _0x2a49fa=_0x3fe3fc[_0x373b('0x3d')](0x0,_0x3fe3fc[_0x373b('0x3e')]('fullname'));_0x3fe3fc+=','+_0x2a49fa+_0x373b('0x3f');}return _0x3fe3fc;}exports[_0x373b('0x40')]=validateSortParameter;function sortAgentsByStatus(_0x1a4205,_0x372f2e){var _0x351067=_0x1a4205[_0x373b('0x41')](function(_0xfcdbe6,_0x6f3b4c){if(_0xfcdbe6[_0x373b('0x35')]===_0x6f3b4c[_0x373b('0x35')]){if(_0xfcdbe6[_0x373b('0x35')]===_0x373b('0x12')){if(_0x372f2e==='DESC'){return(_0xfcdbe6[_0x373b('0x33')]||'')<(_0x6f3b4c['pauseType']||'')||_0xfcdbe6[_0x373b('0x32')][_0x373b('0x42')]()>_0x6f3b4c[_0x373b('0x32')][_0x373b('0x42')]()?0x1:-0x1;}else{return(_0xfcdbe6[_0x373b('0x33')]||'')<(_0x6f3b4c[_0x373b('0x33')]||'')||_0xfcdbe6[_0x373b('0x32')][_0x373b('0x42')]()>_0x6f3b4c[_0x373b('0x32')][_0x373b('0x42')]()?-0x1:0x1;}}else{if(_0x372f2e==='DESC'){return _0xfcdbe6['fullname'][_0x373b('0x42')]()<_0x6f3b4c['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0xfcdbe6[_0x373b('0x32')][_0x373b('0x42')]()<_0x6f3b4c['fullname'][_0x373b('0x42')]()?-0x1:0x1;}}}else{if(_0x372f2e==='DESC'){return _0xfcdbe6['globalStatus']<_0x6f3b4c[_0x373b('0x35')]?0x1:-0x1;}else{return _0xfcdbe6['globalStatus']<_0x6f3b4c[_0x373b('0x35')]?-0x1:0x1;}}});return _0x351067;}exports[_0x373b('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x2b1e10){var _0xb17acc=[_0x373b('0x44'),'online',_0x373b('0x45'),_0x373b('0x46'),_0x373b('0x33'),'lastPauseAt',_0x373b('0x3f'),_0x373b('0x47'),'chatPause',_0x373b('0x7'),_0x373b('0x6'),_0x373b('0x8'),_0x373b('0xa'),_0x373b('0x5'),_0x373b('0x9'),_0x373b('0x48'),_0x373b('0x49'),_0x373b('0x4a'),_0x373b('0x4b'),_0x373b('0x4c'),_0x373b('0x4d'),_0x373b('0x4e'),_0x373b('0x4f'),'mailCurrentCapacity',_0x373b('0x50'),_0x373b('0x51'),'faxCurrentCapacity',_0x373b('0x52'),_0x373b('0x15'),_0x373b('0x53'),_0x373b('0x16'),'whatsappStatus',_0x373b('0x14'),_0x373b('0x11'),_0x373b('0x54'),_0x373b('0x55'),_0x373b('0x56'),_0x373b('0x57'),_0x373b('0x58'),_0x373b('0x59'),_0x373b('0x5a'),_0x373b('0x5b'),'destconnectedlinenum',_0x373b('0x5c'),_0x373b('0x5d'),_0x373b('0x5e'),'routealias'];var _0x4e0828=[_0x373b('0x4'),_0x373b('0x7'),_0x373b('0x6'),_0x373b('0x8'),_0x373b('0xa'),_0x373b('0x5'),_0x373b('0x9'),'online'];var _0x1cd2bb=_(_0x2b1e10)[_0x373b('0x5f')](_0x4e0828)[_0x373b('0x60')](_0xb17acc)[_0x373b('0x2c')]();return _0x1cd2bb;}exports[_0x373b('0x61')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 5fc0926..d44ed12 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 _0x34e1=['loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','pTalking','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','get','busy','originated','find','merge','pick','jayson/promise','util','client','http','available','loggedIn','paused','waiting','invalid'];(function(_0x4b6f8c,_0x4e0098){var _0x7ed67c=function(_0x164b10){while(--_0x164b10){_0x4b6f8c['push'](_0x4b6f8c['shift']());}};_0x7ed67c(++_0x4e0098);}(_0x34e1,0x171));var _0x134e=function(_0x4926f2,_0x266d43){_0x4926f2=_0x4926f2-0x0;var _0x16f736=_0x34e1[_0x4926f2];return _0x16f736;};'use strict';var _=require('lodash');var jayson=require(_0x134e('0x0'));var util=require(_0x134e('0x1'));var amiClient=jayson[_0x134e('0x2')][_0x134e('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x134e('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x134e('0x4'),_0x134e('0x5'),_0x134e('0x6'),_0x134e('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x134e('0x8'),_0x134e('0x9'),_0x134e('0xa'),_0x134e('0xb'),_0x134e('0xc'),_0x134e('0xd'),_0x134e('0xe'),_0x134e('0xf'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x134e('0x10'),'originated','message',_0x134e('0x11'),_0x134e('0x12'),_0x134e('0x13'),_0x134e('0x14'),_0x134e('0x15'),_0x134e('0x16'),_0x134e('0x17'),_0x134e('0x18'),'erlangAbandonmentRate',_0x134e('0x19'),_0x134e('0x1a'),_0x134e('0x1b'),_0x134e('0x1c'),_0x134e('0x1d'),_0x134e('0x1e'),_0x134e('0x1f'),_0x134e('0x20'),_0x134e('0x21'),_0x134e('0x22'),_0x134e('0x23')];function getRealtimeQueues(_0x5d62f3,_0x2aa0bb){var _0x145bd1=_0x2aa0bb===_0x134e('0x24')?amiClient:routingClient;return _0x145bd1['request'](_[_0x134e('0x25')](_0x2aa0bb)+'Queues',_0x5d62f3)[_0x134e('0x26')](function(_0x34def5){if(_0x34def5[_0x134e('0x27')])throw new Error(util[_0x134e('0x28')](_0x134e('0x29'),_0x2aa0bb));return _0x34def5[_0x134e('0x2a')];})['catch'](function(_0x4998d8){throw _0x4998d8;});}exports[_0x134e('0x2b')]=getRealtimeQueues;function initializeQueues(_0x1a9a62,_0x24b63e,_0x3d8ddc,_0x59cb05){var _0x407142=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3d8ddc===_0x134e('0x24')){if(_0x59cb05===_0x134e('0x2c')){_0x407142=_0x407142[_0x134e('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x59cb05===_0x134e('0x2e')){_0x407142=_0x407142[_0x134e('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1a9a62[_0x134e('0x2f')](function(_0x5697e4){var _0x54ba19=_0x5697e4[_0x134e('0x30')]({'plain':!![]});_0x54ba19[_0x134e('0x6')]=0x0;_0x54ba19['loggedInDb']=0x0;_0x54ba19[_0x134e('0x5')]=0x0;_0x54ba19['available']=0x0;_0x54ba19[_0x134e('0x7')]=0x0;if(_0x3d8ddc===_0x134e('0x24')){_0x54ba19[_0x134e('0xe')]=0x0;_0x54ba19[_0x134e('0x31')]=0x0;if(_0x59cb05===_0x134e('0x2e')){_0x54ba19[_0x134e('0x10')]=0x0;_0x54ba19[_0x134e('0x32')]=0x0;}}var _0x626bcd=_[_0x134e('0x33')](_0x24b63e,['id',_0x54ba19['id']]);if(_0x626bcd){_[_0x134e('0x34')](_0x54ba19,_[_0x134e('0x35')](_0x626bcd,_0x407142));}return _0x54ba19;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0xe09e=['inbound','outbound','concat','map','get','find','merge','pick','initializeQueues','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','inUse','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues'];(function(_0x589cb8,_0x43929a){var _0x1f78d5=function(_0x55957b){while(--_0x55957b){_0x589cb8['push'](_0x589cb8['shift']());}};_0x1f78d5(++_0x43929a);}(_0xe09e,0xf9));var _0xee09=function(_0x428761,_0x24666d){_0x428761=_0x428761-0x0;var _0x10fea4=_0xe09e[_0x428761];return _0x10fea4;};'use strict';var _=require('lodash');var jayson=require(_0xee09('0x0'));var util=require(_0xee09('0x1'));var amiClient=jayson[_0xee09('0x2')][_0xee09('0x3')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xee09('0x4'),_0xee09('0x5'),_0xee09('0x6'),_0xee09('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xee09('0x8'),_0xee09('0x9'),'invalid',_0xee09('0xa'),_0xee09('0xb'),_0xee09('0xc'),'ringing',_0xee09('0xd'),_0xee09('0xe'),_0xee09('0xf'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0xee09('0x10'),'statusMessage',_0xee09('0x11'),_0xee09('0x12'),_0xee09('0x13'),_0xee09('0x14'),_0xee09('0x15'),_0xee09('0x16'),'erlangCallToSecond',_0xee09('0x17'),'erlangBusyFactor','dialPredictiveInterval',_0xee09('0x18'),_0xee09('0x19'),_0xee09('0x1a'),'predictiveIntervalTotalCalls',_0xee09('0x1b'),_0xee09('0x1c'),_0xee09('0x1d'),'predictiveIntervalAvgHoldtime',_0xee09('0x1e')];function getRealtimeQueues(_0x462c04,_0x2b9338){var _0xd7bf1c=_0x2b9338===_0xee09('0x1f')?amiClient:routingClient;return _0xd7bf1c[_0xee09('0x20')](_[_0xee09('0x21')](_0x2b9338)+_0xee09('0x22'),_0x462c04)[_0xee09('0x23')](function(_0x2bd12c){if(_0x2bd12c[_0xee09('0x24')])throw new Error(util['format'](_0xee09('0x25'),_0x2b9338));return _0x2bd12c['result'];})['catch'](function(_0x27e086){throw _0x27e086;});}exports[_0xee09('0x26')]=getRealtimeQueues;function initializeQueues(_0x4d1fef,_0x35e375,_0x366c6b,_0x3e0a76){var _0x324317=DEFAULT_QUEUE_ATTRIBUTES;if(_0x366c6b===_0xee09('0x1f')){if(_0x3e0a76===_0xee09('0x27')){_0x324317=_0x324317['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3e0a76===_0xee09('0x28')){_0x324317=_0x324317[_0xee09('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4d1fef[_0xee09('0x2a')](function(_0x3ed433){var _0x54398d=_0x3ed433[_0xee09('0x2b')]({'plain':!![]});_0x54398d[_0xee09('0x6')]=0x0;_0x54398d[_0xee09('0xa')]=0x0;_0x54398d['loggedIn']=0x0;_0x54398d['available']=0x0;_0x54398d[_0xee09('0x7')]=0x0;if(_0x366c6b===_0xee09('0x1f')){_0x54398d['talking']=0x0;_0x54398d['busy']=0x0;if(_0x3e0a76===_0xee09('0x28')){_0x54398d['pTalking']=0x0;_0x54398d['originated']=0x0;}}var _0x180576=_[_0xee09('0x2c')](_0x35e375,['id',_0x54398d['id']]);if(_0x180576){_[_0xee09('0x2d')](_0x54398d,_[_0xee09('0x2e')](_0x180576,_0x324317));}return _0x54398d;});}exports[_0xee09('0x2f')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index d451fc9..50e00d7 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x18805f,_0x9973b){var _0x54edbb=function(_0x4686e8){while(--_0x4686e8){_0x18805f['push'](_0x18805f['shift']());}};_0x54edbb(++_0x9973b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 +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(_0x41fe72,_0xaa8f97){var _0x717fdf=function(_0x294ed8){while(--_0x294ed8){_0x41fe72['push'](_0x41fe72['shift']());}};_0x717fdf(++_0xaa8f97);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 1985a71..8863228 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 _0xfbf9=['lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','filter','family','IPv4','internal','head','mac','address','127.0.0.1','getFirstInterface','orderBy','map','model','join','md5','digest','hex','test','licenseToken','win32','utf8','replace','hostname','ipAddress','createHash','update','substring'];(function(_0x39a732,_0x5ac4b4){var _0x3cf9ff=function(_0x3a031a){while(--_0x3a031a){_0x39a732['push'](_0x39a732['shift']());}};_0x3cf9ff(++_0x5ac4b4);}(_0xfbf9,0x84));var _0x9fbf=function(_0x1ef2e3,_0x380ec2){_0x1ef2e3=_0x1ef2e3-0x0;var _0x173e11=_0xfbf9[_0x1ef2e3];return _0x173e11;};'use strict';var _=require(_0x9fbf('0x0'));var os=require('os');var crypto=require(_0x9fbf('0x1'));var machine=require(_0x9fbf('0x2'));var exec=require(_0x9fbf('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x515ab5=[];var _0x1c86c9=os[_0x9fbf('0x4')]();var _0x5de36e=_['orderBy'](_[_0x9fbf('0x5')](_0x1c86c9));for(var _0xa027a5=0x0;_0xa027a5<_0x5de36e[_0x9fbf('0x6')];_0xa027a5++){var _0x3be52b=_0x1c86c9[_0x5de36e[_0xa027a5]][_0x9fbf('0x7')](function(_0x906405){return _0x906405[_0x9fbf('0x8')]===_0x9fbf('0x9')&&_0x906405[_0x9fbf('0xa')]===![];});_0x515ab5=_0x515ab5['concat'](_0x3be52b);}return _0x515ab5;}function getFirstInterface(){var _0x5f03db=_[_0x9fbf('0xb')](getInterfaces());return{'macAddress':_0x5f03db&&_0x5f03db[_0x9fbf('0xc')]?_0x5f03db[_0x9fbf('0xc')]:'00:00:00:00:00:00','ipAddress':_0x5f03db&&_0x5f03db['address']?_0x5f03db[_0x9fbf('0xd')]:_0x9fbf('0xe')};}exports[_0x9fbf('0xf')]=getFirstInterface;function getCPUhash(){var _0x11e68e=_[_0x9fbf('0x10')](os['cpus']()[_0x9fbf('0x11')](function(_0x1f8cd9){return _0x1f8cd9[_0x9fbf('0x12')];}))[_0x9fbf('0x13')](':');return crypto['createHash'](_0x9fbf('0x14'))['update'](_0x11e68e)[_0x9fbf('0x15')](_0x9fbf('0x16'));}exports['getUuid']=function(){var _0x13abc5=os['platform']();var _0x1d66f6=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x1d66f6[_0x9fbf('0x17')](config[_0x9fbf('0x18')])){return config[_0x9fbf('0x18')];}else if(_0x13abc5===_0x9fbf('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x9fbf('0x1a')})[_0x9fbf('0x1b')]('\x0d\x0a','');}else{var _0x303461=getFirstInterface();var _0x16094e=getCPUhash();var _0x2b0a05=_0x16094e+'|'+os[_0x9fbf('0x1c')]()+'|'+_0x303461['macAddress']+'|'+_0x303461[_0x9fbf('0x1d')];var _0x55e192=crypto[_0x9fbf('0x1e')](_0x9fbf('0x14'))[_0x9fbf('0x1f')](_0x2b0a05)[_0x9fbf('0x15')](_0x9fbf('0x16'));return _0x55e192['substring'](0x0,0x8)+'-'+_0x55e192[_0x9fbf('0x20')](0x8,0xc)+'-'+_0x55e192['substring'](0xc,0x10)+'-'+_0x55e192[_0x9fbf('0x20')](0x10,0x14)+'-'+_0x55e192[_0x9fbf('0x20')](0x14);}}; \ No newline at end of file +var _0x1a1c=['internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','map','model','join','md5','update','digest','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','crypto','execSync','../environment','orderBy','keys','length','IPv4'];(function(_0xaea831,_0x177ba8){var _0x39bb0a=function(_0x401f58){while(--_0x401f58){_0xaea831['push'](_0xaea831['shift']());}};_0x39bb0a(++_0x177ba8);}(_0x1a1c,0x16d));var _0xc1a1=function(_0xce61ec,_0x43f9ba){_0xce61ec=_0xce61ec-0x0;var _0x348d12=_0x1a1c[_0xce61ec];return _0x348d12;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xc1a1('0x0'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xc1a1('0x1')];var config=require(_0xc1a1('0x2'));function getInterfaces(){var _0x1f0a5a=[];var _0x1a1419=os['networkInterfaces']();var _0x25c815=_[_0xc1a1('0x3')](_[_0xc1a1('0x4')](_0x1a1419));for(var _0xd0f1d7=0x0;_0xd0f1d7<_0x25c815[_0xc1a1('0x5')];_0xd0f1d7++){var _0xb90024=_0x1a1419[_0x25c815[_0xd0f1d7]]['filter'](function(_0x3eb8ad){return _0x3eb8ad['family']===_0xc1a1('0x6')&&_0x3eb8ad[_0xc1a1('0x7')]===![];});_0x1f0a5a=_0x1f0a5a[_0xc1a1('0x8')](_0xb90024);}return _0x1f0a5a;}function getFirstInterface(){var _0x177397=_[_0xc1a1('0x9')](getInterfaces());return{'macAddress':_0x177397&&_0x177397[_0xc1a1('0xa')]?_0x177397[_0xc1a1('0xa')]:_0xc1a1('0xb'),'ipAddress':_0x177397&&_0x177397[_0xc1a1('0xc')]?_0x177397[_0xc1a1('0xc')]:'127.0.0.1'};}exports[_0xc1a1('0xd')]=getFirstInterface;function getCPUhash(){var _0x306e07=_[_0xc1a1('0x3')](os['cpus']()[_0xc1a1('0xe')](function(_0x57f4e4){return _0x57f4e4[_0xc1a1('0xf')];}))[_0xc1a1('0x10')](':');return crypto['createHash'](_0xc1a1('0x11'))[_0xc1a1('0x12')](_0x306e07)[_0xc1a1('0x13')]('hex');}exports['getUuid']=function(){var _0x140f60=os[_0xc1a1('0x14')]();var _0x461ca5=/[0-9a-f-]{36}/;if(config[_0xc1a1('0x15')]&&_0x461ca5[_0xc1a1('0x16')](config[_0xc1a1('0x15')])){return config[_0xc1a1('0x15')];}else if(_0x140f60==='win32'){return exec(_0xc1a1('0x17'),{'encoding':_0xc1a1('0x18')})[_0xc1a1('0x19')]('\x0d\x0a','');}else{var _0x5e8bad=getFirstInterface();var _0x30f267=getCPUhash();var _0x95f61b=_0x30f267+'|'+os[_0xc1a1('0x1a')]()+'|'+_0x5e8bad[_0xc1a1('0x1b')]+'|'+_0x5e8bad[_0xc1a1('0x1c')];var _0x23772b=crypto['createHash'](_0xc1a1('0x11'))[_0xc1a1('0x12')](_0x95f61b)[_0xc1a1('0x13')](_0xc1a1('0x1d'));return _0x23772b['substring'](0x0,0x8)+'-'+_0x23772b[_0xc1a1('0x1e')](0x8,0xc)+'-'+_0x23772b[_0xc1a1('0x1e')](0xc,0x10)+'-'+_0x23772b['substring'](0x10,0x14)+'-'+_0x23772b[_0xc1a1('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index d3524f6..f2dcbaa 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 _0x4bcd=['DEMO\x20START\x20AT\x20%s','catch','error','finally','getUuid','findOrCreate','spread','default','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','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','info','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','days'];(function(_0x86337d,_0x2b57c3){var _0x22b2c6=function(_0x180d16){while(--_0x180d16){_0x86337d['push'](_0x86337d['shift']());}};_0x22b2c6(++_0x2b57c3);}(_0x4bcd,0x189));var _0xd4bc=function(_0x5800ba,_0x455167){_0x5800ba=_0x5800ba-0x0;var _0x58effb=_0x4bcd[_0x5800ba];return _0x58effb;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0xd4bc('0x0'));var BPromise=require(_0xd4bc('0x1'));var pkginfo=require(_0xd4bc('0x2'))(module,_0xd4bc('0x3'));var db=require(_0xd4bc('0x4'))['db'];var encryptor=require(_0xd4bc('0x5'));var hardware=require(_0xd4bc('0x6'));var logger=require('../logger')(_0xd4bc('0x7'));var HOST=_0xd4bc('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3c563c){return new BPromise(function(_0x5528c8,_0x29b5e9){var _0x333061=util[_0xd4bc('0x9')](_0xd4bc('0xa'),HOST,_0x3c563c,module[_0xd4bc('0xb')][_0xd4bc('0x3')]);if(oldToken){_0x333061=util['format'](_0xd4bc('0xc'),HOST,_0x3c563c,module[_0xd4bc('0xb')][_0xd4bc('0x3')],oldToken);}var _0x2cd5fd={'uri':_0x333061,'method':_0xd4bc('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x2cd5fd)[_0xd4bc('0xe')](function(_0x26c3d0){_0x5528c8(_0x26c3d0);})['catch'](function(_0x451a0a){_0x29b5e9(_0x451a0a);});});}function manageLicense(_0x4d699e,_0x4db138){var _0x3cbed3=_0x4db138[_0xd4bc('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x3cbed3[_0xd4bc('0x10')]!==_0x4d699e&&!_0x3cbed3[_0xd4bc('0x11')]){oldToken=_0x3cbed3[_0xd4bc('0x10')];}httpRequest(_0x4d699e)[_0xd4bc('0xe')](function(_0x46877d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x46877d['active']){isOldTokenSent=![];if(!_0x3cbed3[_0xd4bc('0x7')]&&_0x3cbed3['license']!=_0x46877d[_0xd4bc('0x7')]||_0x3cbed3[_0xd4bc('0x7')]&&_0x3cbed3['data2']){logger[_0xd4bc('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3cbed3[_0xd4bc('0x7')]&&!_0x3cbed3[_0xd4bc('0x11')]&&_0x3cbed3[_0xd4bc('0x7')]!=_0x46877d[_0xd4bc('0x7')]){logger[_0xd4bc('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3cbed3[_0xd4bc('0x7')]&&!_0x3cbed3[_0xd4bc('0x11')]&&_0x3cbed3[_0xd4bc('0x7')]==_0x46877d[_0xd4bc('0x7')]){return _0x4db138;}return _0x4db138[_0xd4bc('0x13')]({'data1':_0x4d699e,'data2':null,'license':_0x46877d['license']});}else{if(_0x46877d[_0xd4bc('0x7')]||_0x3cbed3[_0xd4bc('0x7')]){if(!_0x3cbed3[_0xd4bc('0x11')]){if(_0x3cbed3[_0xd4bc('0x10')]==_0x4d699e){GRAY_PERIOD_REASON='Disabled';logger[_0xd4bc('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xd4bc('0x14');logger['info'](_0xd4bc('0x15'),_0x3cbed3[_0xd4bc('0x10')],_0x4d699e);}logger[_0xd4bc('0x12')](_0xd4bc('0x16'),GRAY_PERIOD_REASON[_0xd4bc('0x17')](),moment()[_0xd4bc('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x4db138[_0xd4bc('0x13')]({'data2':encryptor[_0xd4bc('0x18')](moment()['format'](_0xd4bc('0x19')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x3cbed3[_0xd4bc('0x11')]),_0xd4bc('0x1a'))>DAYS){logger[_0xd4bc('0x12')](_0xd4bc('0x1b'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4db138[_0xd4bc('0x13')]({'data1':_0x4d699e,'data2':null,'license':null});}}}else{if(_0x3cbed3['data1']!=_0x4d699e){logger[_0xd4bc('0x12')](_0xd4bc('0x15'),_0x3cbed3[_0xd4bc('0x10')],_0x4d699e);return _0x4db138[_0xd4bc('0x13')]({'data1':_0x4d699e,'data2':null,'license':null});}}}return _0x4db138;})['then'](function(_0x521a81){_0x4db138=_0x521a81;})[_0xd4bc('0x1c')](function(_0x1afaf4){logger[_0xd4bc('0x1d')](_0x1afaf4['message']);})[_0xd4bc('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xd4bc('0x1f')](),_0x4db138);},TIME);});}function defaultLicense(){var _0x433bfc=hardware[_0xd4bc('0x1f')]();if(_0x433bfc){return db['License'][_0xd4bc('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x433bfc}})[_0xd4bc('0x21')](function(_0xca4926,_0x236daa){logger[_0xd4bc('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x433bfc);manageLicense(_0x433bfc,_0xca4926);})['catch'](function(_0x1ed2da){logger[_0xd4bc('0x1d')](_0x1ed2da['message']);});}}exports[_0xd4bc('0x22')]=defaultLicense; \ No newline at end of file +var _0xf61d=['error','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s'];(function(_0x55dc75,_0x19b20c){var _0x451043=function(_0x4ddc2d){while(--_0x4ddc2d){_0x55dc75['push'](_0x55dc75['shift']());}};_0x451043(++_0x19b20c);}(_0xf61d,0xf8));var _0xdf61=function(_0x49c6cc,_0x308bdb){_0x49c6cc=_0x49c6cc-0x0;var _0x22e239=_0xf61d[_0x49c6cc];return _0x22e239;};'use strict';var util=require(_0xdf61('0x0'));var moment=require(_0xdf61('0x1'));var rp=require('request-promise');var BPromise=require(_0xdf61('0x2'));var pkginfo=require(_0xdf61('0x3'))(module,'version');var db=require(_0xdf61('0x4'))['db'];var encryptor=require(_0xdf61('0x5'));var hardware=require(_0xdf61('0x6'));var logger=require(_0xdf61('0x7'))('license');var HOST=_0xdf61('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2d0e92){return new BPromise(function(_0x4c9554,_0x1cb079){var _0x13ea49=util['format'](_0xdf61('0x9'),HOST,_0x2d0e92,module[_0xdf61('0xa')][_0xdf61('0xb')]);if(oldToken){_0x13ea49=util[_0xdf61('0xc')](_0xdf61('0xd'),HOST,_0x2d0e92,module[_0xdf61('0xa')][_0xdf61('0xb')],oldToken);}var _0x392d05={'uri':_0x13ea49,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x392d05)[_0xdf61('0xe')](function(_0x46b912){_0x4c9554(_0x46b912);})[_0xdf61('0xf')](function(_0x5d6200){_0x1cb079(_0x5d6200);});});}function manageLicense(_0x572587,_0x53f671){var _0x13f915=_0x53f671[_0xdf61('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x13f915[_0xdf61('0x11')]!==_0x572587&&!_0x13f915[_0xdf61('0x12')]){oldToken=_0x13f915[_0xdf61('0x11')];}httpRequest(_0x572587)['then'](function(_0x36d0a6){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x36d0a6['active']){isOldTokenSent=![];if(!_0x13f915[_0xdf61('0x13')]&&_0x13f915['license']!=_0x36d0a6[_0xdf61('0x13')]||_0x13f915[_0xdf61('0x13')]&&_0x13f915['data2']){logger['info'](_0xdf61('0x14'));}if(_0x13f915[_0xdf61('0x13')]&&!_0x13f915['data2']&&_0x13f915['license']!=_0x36d0a6[_0xdf61('0x13')]){logger[_0xdf61('0x15')](_0xdf61('0x16'));}if(_0x13f915[_0xdf61('0x13')]&&!_0x13f915[_0xdf61('0x12')]&&_0x13f915[_0xdf61('0x13')]==_0x36d0a6[_0xdf61('0x13')]){return _0x53f671;}return _0x53f671[_0xdf61('0x17')]({'data1':_0x572587,'data2':null,'license':_0x36d0a6['license']});}else{if(_0x36d0a6[_0xdf61('0x13')]||_0x13f915[_0xdf61('0x13')]){if(!_0x13f915['data2']){if(_0x13f915[_0xdf61('0x11')]==_0x572587){GRAY_PERIOD_REASON=_0xdf61('0x18');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xdf61('0x19');logger['info'](_0xdf61('0x1a'),_0x13f915[_0xdf61('0x11')],_0x572587);}logger[_0xdf61('0x15')](_0xdf61('0x1b'),GRAY_PERIOD_REASON[_0xdf61('0x1c')](),moment()[_0xdf61('0xc')](_0xdf61('0x1d')));return _0x53f671[_0xdf61('0x17')]({'data2':encryptor['encryptString'](moment()[_0xdf61('0xc')](_0xdf61('0x1d')))});}else{if(moment()[_0xdf61('0x1e')](encryptor['decryptString'](_0x13f915[_0xdf61('0x12')]),'days')>DAYS){logger[_0xdf61('0x15')](_0xdf61('0x1f'),moment()[_0xdf61('0xc')](_0xdf61('0x1d')));isOldTokenSent=![];return _0x53f671[_0xdf61('0x17')]({'data1':_0x572587,'data2':null,'license':null});}}}else{if(_0x13f915[_0xdf61('0x11')]!=_0x572587){logger[_0xdf61('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x13f915[_0xdf61('0x11')],_0x572587);return _0x53f671['update']({'data1':_0x572587,'data2':null,'license':null});}}}return _0x53f671;})[_0xdf61('0xe')](function(_0x5f3225){_0x53f671=_0x5f3225;})[_0xdf61('0xf')](function(_0x10c03e){logger[_0xdf61('0x20')](_0x10c03e['message']);})[_0xdf61('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xdf61('0x22')](),_0x53f671);},TIME);});}function defaultLicense(){var _0x405cdf=hardware[_0xdf61('0x22')]();if(_0x405cdf){return db[_0xdf61('0x23')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x405cdf}})[_0xdf61('0x24')](function(_0x567e4c,_0x3ef8f4){logger['info'](_0xdf61('0x25'),_0x405cdf);manageLicense(_0x405cdf,_0x567e4c);})[_0xdf61('0xf')](function(_0x305099){logger[_0xdf61('0x20')](_0x305099[_0xdf61('0x26')]);});}}exports[_0xdf61('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 720f83b..304ba85 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 _0x41c7=['sequelize','COUNT','col','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','catch','lodash','bluebird','./hardware','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','defaults','then','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','parse','machineUuid','add','days','changed','disabled','User','findAll','role'];(function(_0x3be290,_0x54e769){var _0x57f423=function(_0x17abe9){while(--_0x17abe9){_0x3be290['push'](_0x3be290['shift']());}};_0x57f423(++_0x54e769);}(_0x41c7,0xd1));var _0x741c=function(_0x66733b,_0x3d1b88){_0x66733b=_0x66733b-0x0;var _0x355d45=_0x41c7[_0x66733b];return _0x355d45;};'use strict';var util=require('util');var _=require(_0x741c('0x0'));var moment=require('moment');var BPromise=require(_0x741c('0x1'));var hardware=require(_0x741c('0x2'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x741c('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x741c('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x741c('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x741c('0x5'),'machineUuid':hardware[_0x741c('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x29ac1a){return new BPromise(function(_0xd2a7e6,_0x555e60){return db[_0x741c('0x6')]['find'](_[_0x741c('0x7')](_0x29ac1a,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xebe379){return checkLicense(_0xebe379,null);})[_0x741c('0x8')](function(_0x1090d6){_0xd2a7e6(_0x1090d6);return;})['catch'](function(_0x4ad212){_0x555e60(_0x4ad212);});});}function checkLicense(_0x2c9d79,_0x2c2c2b){if(!_0x2c9d79){demoLicense[_0x741c('0x9')]=_0x2c9d79[_0x741c('0xa')];return demoLicense;}try{var _0x23f373=_0x2c2c2b||_0x2c9d79['license'];if(_[_0x741c('0xb')](_0x23f373)){throw new Error(_0x741c('0xc'));}var _0x2db2a6=_0x2c9d79[_0x741c('0xa')];var _0x551592=_0x2c9d79['data2'];var _0x30f0f5=_0x2db2a6[_0x741c('0xd')]('-')[0x4];var _0x175347=_0x2db2a6['split']('-')[0x0];var _0x5ae084=encryptor[_0x741c('0xe')](_0x23f373,util[_0x741c('0xf')]('%s:%s:%s',_0x30f0f5,_0x2db2a6,_0x175347));var _0xd83352=JSON[_0x741c('0x10')](_0x5ae084);_0xd83352['demo']=![];_0xd83352[_0x741c('0x9')]=_0x2db2a6;_0xd83352[_0x741c('0x11')]=hardware['getUuid']();if(_0x551592){var _0x5acbca=encryptor[_0x741c('0xe')](_0x551592);_0xd83352['gray']=_0x5acbca;_0xd83352['deadline']=moment(_0x5acbca)[_0x741c('0x12')](0x7,_0x741c('0x13'))[_0x741c('0xf')]();_0xd83352['grayReason']=_0xd83352['uuid']!=_0xd83352[_0x741c('0x11')]?_0x741c('0x14'):_0x741c('0x15');}return _0xd83352;}catch(_0x38537f){breakingLicense[_0x741c('0x9')]=_0x2c9d79[_0x741c('0xa')];breakingLicense['message']=_0x38537f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1a7d6e,_0x399c3b){getLicense()[_0x741c('0x8')](function(_0x4e1fdb){return db[_0x741c('0x16')][_0x741c('0x17')]({'attributes':[_0x741c('0x18'),[db[_0x741c('0x19')]['fn'](_0x741c('0x1a'),db['sequelize'][_0x741c('0x1b')]('role')),'count']],'group':_0x741c('0x18'),'where':{'role':{'$or':[_0x741c('0x1c'),_0x741c('0x1d'),_0x741c('0x1e')]}},'raw':!![]})[_0x741c('0x8')](function(_0x475ad0){var _0x5af4be={'user':_0x4e1fdb[_0x741c('0x1f')]||0x0,'telephone':_0x4e1fdb[_0x741c('0x20')]||0x0};_0x475ad0[_0x741c('0x21')](function(_0x540d1b){var _0x2dd81b=_0x540d1b[_0x741c('0x18')]===_0x741c('0x1c')?_0x741c('0x1d'):_0x540d1b[_0x741c('0x18')];_0x5af4be[_0x2dd81b]-=_0x540d1b['count'];if(_0x5af4be[_0x2dd81b]<0x0)_0x5af4be[_0x2dd81b]=0x0;});_0x1a7d6e(_0x5af4be);return;});})['catch'](function(_0x3f21c6){_0x399c3b(_0x3f21c6);});});}function checkUserLimits(_0x115b6e){return new BPromise(function(_0x10a255,_0x1d3999){getLimits()['then'](function(_0x4463b0){var _0x4619e0=_[_0x741c('0x22')](_[_0x741c('0x23')](_0x115b6e,_0x741c('0x18')),[_0x741c('0x1c'),_0x741c('0x1d'),_0x741c('0x1e')]);var _0xac4348=(_0x4619e0[_0x741c('0x1c')]||0x0)+(_0x4619e0['user']||0x0);var _0x4e0d60=_0x4619e0['telephone']||0x0;if(_0xac4348>_0x4463b0[_0x741c('0x1d')])return _0x1d3999(_0x741c('0x24'));if(_0x4e0d60>_0x4463b0[_0x741c('0x1e')])return _0x1d3999(_0x741c('0x25'));return _0x10a255();})[_0x741c('0x26')](function(_0x559908){_0x1d3999(_0x559908);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4179=['./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','find','defaults','then','catch','uuid','license','isEmpty','data1','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','days','grayReason','message','findAll','role','COUNT','sequelize','col','admin','user','telephone','users','telephones','forEach','count','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird'];(function(_0x39600c,_0x2227af){var _0x12bc11=function(_0x18fd87){while(--_0x18fd87){_0x39600c['push'](_0x39600c['shift']());}};_0x12bc11(++_0x2227af);}(_0x4179,0x89));var _0x9417=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x4179[_0x350182];return _0x4a0892;};'use strict';var util=require(_0x9417('0x0'));var _=require(_0x9417('0x1'));var moment=require(_0x9417('0x2'));var BPromise=require(_0x9417('0x3'));var hardware=require(_0x9417('0x4'));var encryptor=require(_0x9417('0x5'));var db=require(_0x9417('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9417('0x7'),'machineUuid':hardware[_0x9417('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9417('0x9'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9417('0xa'),'machineUuid':hardware[_0x9417('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x21e653){return new BPromise(function(_0x7da408,_0x3b000c){return db['License'][_0x9417('0xb')](_[_0x9417('0xc')](_0x21e653,{'raw':!![],'where':{'id':0x1}}))[_0x9417('0xd')](function(_0x24e9c9){return checkLicense(_0x24e9c9,null);})['then'](function(_0x2f6a0a){_0x7da408(_0x2f6a0a);return;})[_0x9417('0xe')](function(_0x5170cc){_0x3b000c(_0x5170cc);});});}function checkLicense(_0x18f1d2,_0x3abebf){if(!_0x18f1d2){demoLicense[_0x9417('0xf')]=_0x18f1d2['data1'];return demoLicense;}try{var _0x1d9a95=_0x3abebf||_0x18f1d2[_0x9417('0x10')];if(_[_0x9417('0x11')](_0x1d9a95)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1cef19=_0x18f1d2[_0x9417('0x12')];var _0x5d9c0f=_0x18f1d2['data2'];var _0x5092a0=_0x1cef19[_0x9417('0x13')]('-')[0x4];var _0x127296=_0x1cef19['split']('-')[0x0];var _0x37e643=encryptor[_0x9417('0x14')](_0x1d9a95,util[_0x9417('0x15')](_0x9417('0x16'),_0x5092a0,_0x1cef19,_0x127296));var _0x115bac=JSON[_0x9417('0x17')](_0x37e643);_0x115bac[_0x9417('0x18')]=![];_0x115bac['uuid']=_0x1cef19;_0x115bac[_0x9417('0x19')]=hardware[_0x9417('0x8')]();if(_0x5d9c0f){var _0x3ef276=encryptor[_0x9417('0x14')](_0x5d9c0f);_0x115bac['gray']=_0x3ef276;_0x115bac[_0x9417('0x1a')]=moment(_0x3ef276)[_0x9417('0x1b')](0x7,_0x9417('0x1c'))['format']();_0x115bac[_0x9417('0x1d')]=_0x115bac['uuid']!=_0x115bac[_0x9417('0x19')]?'changed':'disabled';}return _0x115bac;}catch(_0x41aa5d){breakingLicense[_0x9417('0xf')]=_0x18f1d2[_0x9417('0x12')];breakingLicense[_0x9417('0x1e')]=_0x41aa5d[_0x9417('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xfec5c2,_0x5aeb6d){getLicense()[_0x9417('0xd')](function(_0x1c97ee){return db['User'][_0x9417('0x1f')]({'attributes':[_0x9417('0x20'),[db['sequelize']['fn'](_0x9417('0x21'),db[_0x9417('0x22')][_0x9417('0x23')](_0x9417('0x20'))),'count']],'group':_0x9417('0x20'),'where':{'role':{'$or':[_0x9417('0x24'),_0x9417('0x25'),_0x9417('0x26')]}},'raw':!![]})[_0x9417('0xd')](function(_0x4b222c){var _0xe27e8d={'user':_0x1c97ee[_0x9417('0x27')]||0x0,'telephone':_0x1c97ee[_0x9417('0x28')]||0x0};_0x4b222c[_0x9417('0x29')](function(_0x4c2c4e){var _0x1504e6=_0x4c2c4e[_0x9417('0x20')]===_0x9417('0x24')?_0x9417('0x25'):_0x4c2c4e[_0x9417('0x20')];_0xe27e8d[_0x1504e6]-=_0x4c2c4e[_0x9417('0x2a')];if(_0xe27e8d[_0x1504e6]<0x0)_0xe27e8d[_0x1504e6]=0x0;});_0xfec5c2(_0xe27e8d);return;});})['catch'](function(_0x5e3dd4){_0x5aeb6d(_0x5e3dd4);});});}function checkUserLimits(_0x3b3fad){return new BPromise(function(_0xce62d6,_0xe84b1c){getLimits()['then'](function(_0x54ecd9){var _0x12d44f=_['pick'](_[_0x9417('0x2b')](_0x3b3fad,_0x9417('0x20')),[_0x9417('0x24'),_0x9417('0x25'),_0x9417('0x26')]);var _0x265cf5=(_0x12d44f[_0x9417('0x24')]||0x0)+(_0x12d44f[_0x9417('0x25')]||0x0);var _0xabde2c=_0x12d44f[_0x9417('0x26')]||0x0;if(_0x265cf5>_0x54ecd9[_0x9417('0x25')])return _0xe84b1c(_0x9417('0x2c'));if(_0xabde2c>_0x54ecd9[_0x9417('0x26')])return _0xe84b1c(_0x9417('0x2d'));return _0xce62d6();})[_0x9417('0xe')](function(_0x2d3f0e){_0xe84b1c(_0x2d3f0e);});});}module[_0x9417('0x2e')]={'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 ff95ad3..8b4e46c 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 _0x28f2=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x28f2,0x193));var _0x228f=function(_0xaa957,_0x48909e){_0xaa957=_0xaa957-0x0;var _0x38a586=_0x28f2[_0xaa957];return _0x38a586;};'use strict';module[_0x228f('0x0')]={'DOMAIN':_0x228f('0x1'),'SESSION_SECRET':_0x228f('0x2'),'GOOGLE_ID':_0x228f('0x3'),'GOOGLE_SECRET':_0x228f('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x6d11=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0x1798b4,_0x1fe5f3){var _0x775f8=function(_0x161451){while(--_0x161451){_0x1798b4['push'](_0x1798b4['shift']());}};_0x775f8(++_0x1fe5f3);}(_0x6d11,0xbf));var _0x16d1=function(_0x476d6e,_0x106b0f){_0x476d6e=_0x476d6e-0x0;var _0xeb9664=_0x6d11[_0x476d6e];return _0xeb9664;};'use strict';module[_0x16d1('0x0')]={'DOMAIN':_0x16d1('0x1'),'SESSION_SECRET':_0x16d1('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x16d1('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index e824eab..60f3c0f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43a0=['fileLogger','../utils/loggers'];(function(_0x4eeb3f,_0x2a67a5){var _0x40d2b9=function(_0x57bc0b){while(--_0x57bc0b){_0x4eeb3f['push'](_0x4eeb3f['shift']());}};_0x40d2b9(++_0x2a67a5);}(_0x43a0,0x1c3));var _0x043a=function(_0x3e2086,_0x4c31d8){_0x3e2086=_0x3e2086-0x0;var _0x38b7cc=_0x43a0[_0x3e2086];return _0x38b7cc;};'use strict';var fileLogger=require(_0x043a('0x0'))[_0x043a('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x4f8e=['exports','../utils/loggers'];(function(_0x504548,_0x5d9f8e){var _0x5c62f6=function(_0x5e2bf9){while(--_0x5e2bf9){_0x504548['push'](_0x504548['shift']());}};_0x5c62f6(++_0x5d9f8e);}(_0x4f8e,0x1bd));var _0xe4f8=function(_0x581b73,_0x4fa43c){_0x581b73=_0x581b73-0x0;var _0x3ea0ec=_0x4f8e[_0x581b73];return _0x3ea0ec;};'use strict';var fileLogger=require(_0xe4f8('0x0'))['fileLogger'];module[_0xe4f8('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index dec4996..840c396 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 _0x3942=['xdr','../../services/xdr/index.js','exports','../../config/environment','resolve','join','legacy-libs','../../services/express/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x1ff329,_0x33e086){var _0x28501d=function(_0x38b7c7){while(--_0x38b7c7){_0x1ff329['push'](_0x1ff329['shift']());}};_0x28501d(++_0x33e086);}(_0x3942,0x10b));var _0x2394=function(_0x4d1e8d,_0x59a100){_0x4d1e8d=_0x4d1e8d-0x0;var _0x23335c=_0x3942[_0x4d1e8d];return _0x23335c;};'use strict';var path=require('path');var cfg=require(_0x2394('0x0'));var env={'NODE_PATH':path[_0x2394('0x1')](path[_0x2394('0x2')](cfg['root'],_0x2394('0x3')))};var pm2config={'apps':[{'name':'express','script':path['join'](__dirname,_0x2394('0x4')),'env':env},{'name':'ami','script':path[_0x2394('0x2')](__dirname,'../../services/ami/index.js'),'env':env},{'name':'agi','script':path[_0x2394('0x2')](__dirname,_0x2394('0x5')),'env':env},{'name':_0x2394('0x6'),'script':path[_0x2394('0x2')](__dirname,_0x2394('0x7')),'env':env},{'name':_0x2394('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x2394('0x9'),'script':path[_0x2394('0x2')](__dirname,_0x2394('0xa')),'env':env}]};module[_0x2394('0xb')]=pm2config; \ No newline at end of file +var _0x453c=['../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../config/environment','resolve','join','root','legacy-libs','express'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x453c,0xe4));var _0xc453=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x453c[_0x419e17];return _0x1f2044;};'use strict';var path=require('path');var cfg=require(_0xc453('0x0'));var env={'NODE_PATH':path[_0xc453('0x1')](path[_0xc453('0x2')](cfg[_0xc453('0x3')],_0xc453('0x4')))};var pm2config={'apps':[{'name':_0xc453('0x5'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path['join'](__dirname,_0xc453('0x6')),'env':env},{'name':_0xc453('0x7'),'script':path[_0xc453('0x2')](__dirname,_0xc453('0x8')),'env':env},{'name':'email','script':path['join'](__dirname,_0xc453('0x9')),'env':env},{'name':_0xc453('0xa'),'script':path['join'](__dirname,_0xc453('0xb')),'env':env},{'name':_0xc453('0xc'),'script':path[_0xc453('0x2')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 9363154..32ac71b 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 _0xa85f=['list','disconnect','describe','delete','dump','saved','./config','connect','connected','then','start','stop','restart'];(function(_0x3d0d71,_0x3c4811){var _0xc3c53f=function(_0x5c08ab){while(--_0x5c08ab){_0x3d0d71['push'](_0x3d0d71['shift']());}};_0xc3c53f(++_0x3c4811);}(_0xa85f,0x1da));var _0xfa85=function(_0x1f8aeb,_0x452257){_0x1f8aeb=_0x1f8aeb-0x0;var _0x2f268c=_0xa85f[_0x1f8aeb];return _0x2f268c;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0xfa85('0x0'));function connect(){return new BPromise(function(_0x2efae1,_0x279ebd){return pm2[_0xfa85('0x1')](function(_0x2837e3){if(_0x2837e3){return _0x279ebd(_0x2837e3);}return _0x2efae1(_0xfa85('0x2'));});});};exports['start']=function(_0x17fbf0){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x244308,_0x10b5fc){return pm2[_0xfa85('0x4')](_0x17fbf0,function(_0xe1a8c7,_0x533b0b){if(_0xe1a8c7){return _0x10b5fc(_0xe1a8c7);}pm2['disconnect']();return _0x244308(_0x533b0b);});});});};exports[_0xfa85('0x5')]=function(_0x5085f1){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x252780,_0x348ed2){return pm2[_0xfa85('0x5')](_0x5085f1,function(_0x34be33,_0x422455){if(_0x34be33){return _0x348ed2(_0x34be33);}pm2['disconnect']();return _0x252780(_0x422455);});});});};exports['restart']=function(_0x3f108e){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x318a57,_0x2340b7){return pm2[_0xfa85('0x6')](_0x3f108e,function(_0x36ba27,_0x416373){if(_0x36ba27){return _0x2340b7(_0x36ba27);}pm2['disconnect']();return _0x318a57(_0x416373);});});});};exports[_0xfa85('0x7')]=function(){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x8de68d,_0x291fa2){return pm2[_0xfa85('0x7')](function(_0x3d1728,_0x57a841){if(_0x3d1728){return _0x291fa2(_0x3d1728);}pm2[_0xfa85('0x8')]();return _0x8de68d(_0x57a841);});});});};exports[_0xfa85('0x9')]=function(_0x49d4a7){return connect()['then'](function(){return new BPromise(function(_0x16bb56,_0x422c7e){return pm2['describe'](_0x49d4a7,function(_0xf62ce1,_0x3179b4){if(_0xf62ce1){return _0x422c7e(_0xf62ce1);}pm2['disconnect']();return _0x16bb56(_0x3179b4);});});});};exports['delete']=function(_0x503a2b){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x16a172,_0xb29374){return pm2[_0xfa85('0xa')](_0x503a2b,function(_0x6ed021,_0x702138){if(_0x6ed021){return _0xb29374(_0x6ed021);}pm2[_0xfa85('0x8')]();return _0x16a172(_0x702138);});});});};exports[_0xfa85('0xb')]=function(){return connect()[_0xfa85('0x3')](function(){return new BPromise(function(_0x36f650,_0x18d369){return pm2[_0xfa85('0xb')](function(_0xa9a49f){if(_0xa9a49f){return _0x18d369(_0xa9a49f);}return _0x36f650(_0xfa85('0xc'));});});});}; \ No newline at end of file +var _0x0926=['disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','connect','connected','then','stop'];(function(_0x46b75f,_0x3c6181){var _0xc5176d=function(_0x23e50e){while(--_0x23e50e){_0x46b75f['push'](_0x46b75f['shift']());}};_0xc5176d(++_0x3c6181);}(_0x0926,0x118));var _0x6092=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x0926[_0x179e11];return _0x549f04;};'use strict';var pm2=require(_0x6092('0x0'));var BPromise=require(_0x6092('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x510e8e,_0x4485a0){return pm2[_0x6092('0x2')](function(_0x152dbb){if(_0x152dbb){return _0x4485a0(_0x152dbb);}return _0x510e8e(_0x6092('0x3'));});});};exports['start']=function(_0x1e61e1){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x20dee1,_0x5ef543){return pm2['start'](_0x1e61e1,function(_0x18c29e,_0x365b5f){if(_0x18c29e){return _0x5ef543(_0x18c29e);}pm2['disconnect']();return _0x20dee1(_0x365b5f);});});});};exports['stop']=function(_0x1e6581){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x1149fa,_0x3d67e1){return pm2[_0x6092('0x5')](_0x1e6581,function(_0x3cf6d1,_0x477558){if(_0x3cf6d1){return _0x3d67e1(_0x3cf6d1);}pm2[_0x6092('0x6')]();return _0x1149fa(_0x477558);});});});};exports['restart']=function(_0x1dbd34){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x5db19f,_0x5e963e){return pm2[_0x6092('0x7')](_0x1dbd34,function(_0x1d6213,_0x2ac1ac){if(_0x1d6213){return _0x5e963e(_0x1d6213);}pm2[_0x6092('0x6')]();return _0x5db19f(_0x2ac1ac);});});});};exports[_0x6092('0x8')]=function(){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x342d16,_0x853781){return pm2[_0x6092('0x8')](function(_0x2da477,_0x15a573){if(_0x2da477){return _0x853781(_0x2da477);}pm2[_0x6092('0x6')]();return _0x342d16(_0x15a573);});});});};exports[_0x6092('0x9')]=function(_0x46b52c){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x56afc8,_0x2e34be){return pm2[_0x6092('0x9')](_0x46b52c,function(_0x1619b7,_0x19aa55){if(_0x1619b7){return _0x2e34be(_0x1619b7);}pm2[_0x6092('0x6')]();return _0x56afc8(_0x19aa55);});});});};exports[_0x6092('0xa')]=function(_0x1320ed){return connect()['then'](function(){return new BPromise(function(_0xf9c065,_0x1efa08){return pm2[_0x6092('0xa')](_0x1320ed,function(_0x4232f0,_0xfdf803){if(_0x4232f0){return _0x1efa08(_0x4232f0);}pm2[_0x6092('0x6')]();return _0xf9c065(_0xfdf803);});});});};exports['dump']=function(){return connect()[_0x6092('0x4')](function(){return new BPromise(function(_0x51683b,_0x25b059){return pm2[_0x6092('0xb')](function(_0x563fd7){if(_0x563fd7){return _0x25b059(_0x563fd7);}return _0x51683b(_0x6092('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index fa77331..97f6363 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 _0xe345=['timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','minutes','length','info','join','update','system'];(function(_0x3df9e2,_0x4554ad){var _0x2eff28=function(_0x31295b){while(--_0x31295b){_0x3df9e2['push'](_0x3df9e2['shift']());}};_0x2eff28(++_0x4554ad);}(_0xe345,0x173));var _0x5e34=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0xe345[_0x23e5ce];return _0x2ce19b;};'use strict';var _=require(_0x5e34('0x0'));var moment=require(_0x5e34('0x1'));var Redis=require(_0x5e34('0x2'));var util=require('util');var config=require(_0x5e34('0x3'));var db=require(_0x5e34('0x4'))['db'];var logger=require(_0x5e34('0x5'))('schedule');config[_0x5e34('0x6')]=_[_0x5e34('0x7')](config['redis'],{'host':_0x5e34('0x8'),'port':0x18eb});var io=require(_0x5e34('0x9'))(new Redis(config[_0x5e34('0x6')]));function closeInteractions(){var _0x2658e0=0x0;var _0x39452f=[];return db[_0x5e34('0xa')][_0x5e34('0xb')]({'raw':!![],'attributes':['id',_0x5e34('0xc')],'where':{'id':0x1}})[_0x5e34('0xd')](function(_0x1cad4e){_0x2658e0=_0x1cad4e[_0x5e34('0xc')];if(_0x2658e0){return db[_0x5e34('0xe')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x1cad4e[_0x5e34('0xc')],_0x5e34('0xf'))}}});}else{return[];}})[_0x5e34('0xd')](function(_0x1597f5){if(_0x1597f5&&_0x1597f5[_0x5e34('0x10')]){_0x39452f=_['map'](_0x1597f5||[],'id');logger[_0x5e34('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x39452f[_0x5e34('0x12')]());return db[_0x5e34('0xe')][_0x5e34('0x13')]({'closeReason':_0x5e34('0x14'),'disposition':_0x5e34('0x15'),'closed':!![],'closedAt':moment()['format'](_0x5e34('0x16'))},{'where':{'id':_0x39452f}});}})[_0x5e34('0xd')](function(){if(_0x39452f&&_0x39452f[_0x5e34('0x10')]){logger[_0x5e34('0x11')](_0x5e34('0x17'),_0x39452f['join']());for(var _0x2cf866=0x0;_0x2cf866<_0x39452f['length'];_0x2cf866++){io[_0x5e34('0x18')](_0x5e34('0x19'),{'id':_0x39452f[_0x2cf866],'closed':!![]});}}})[_0x5e34('0x1a')](function(_0x189eda){logger['error'](_0x5e34('0x1b'),_0x189eda?util['inspect'](_0x189eda,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0aa0=['../logger','schedule','redis','localhost','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','../../mysqldb'];(function(_0x500ae4,_0x109a37){var _0x11b498=function(_0x977167){while(--_0x977167){_0x500ae4['push'](_0x500ae4['shift']());}};_0x11b498(++_0x109a37);}(_0x0aa0,0x164));var _0x00aa=function(_0x2b9e48,_0x2e593c){_0x2b9e48=_0x2b9e48-0x0;var _0x440569=_0x0aa0[_0x2b9e48];return _0x440569;};'use strict';var _=require(_0x00aa('0x0'));var moment=require(_0x00aa('0x1'));var Redis=require(_0x00aa('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x00aa('0x3'))['db'];var logger=require(_0x00aa('0x4'))(_0x00aa('0x5'));config[_0x00aa('0x6')]=_['defaults'](config[_0x00aa('0x6')],{'host':_0x00aa('0x7'),'port':0x18eb});var io=require(_0x00aa('0x8'))(new Redis(config[_0x00aa('0x6')]));function closeInteractions(){var _0x3ceb08=0x0;var _0x31f349=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x00aa('0x9')],'where':{'id':0x1}})[_0x00aa('0xa')](function(_0x110245){_0x3ceb08=_0x110245[_0x00aa('0x9')];if(_0x3ceb08){return db[_0x00aa('0xb')][_0x00aa('0xc')]({'raw':!![],'attributes':['id',_0x00aa('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x00aa('0xe')](_0x110245[_0x00aa('0x9')],'minutes')}}});}else{return[];}})[_0x00aa('0xa')](function(_0x5a4b6b){if(_0x5a4b6b&&_0x5a4b6b[_0x00aa('0xf')]){_0x31f349=_[_0x00aa('0x10')](_0x5a4b6b||[],'id');logger[_0x00aa('0x11')](_0x00aa('0x12'),_0x31f349[_0x00aa('0x13')]());return db[_0x00aa('0xb')]['update']({'closeReason':_0x00aa('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x00aa('0x15')](_0x00aa('0x16'))},{'where':{'id':_0x31f349}});}})[_0x00aa('0xa')](function(){if(_0x31f349&&_0x31f349[_0x00aa('0xf')]){logger[_0x00aa('0x11')](_0x00aa('0x17'),_0x31f349[_0x00aa('0x13')]());for(var _0x52dec8=0x0;_0x52dec8<_0x31f349[_0x00aa('0xf')];_0x52dec8++){io[_0x00aa('0x18')](_0x00aa('0x19'),{'id':_0x31f349[_0x52dec8],'closed':!![]});}}})[_0x00aa('0x1a')](function(_0x56d34b){logger[_0x00aa('0x1b')](_0x00aa('0x1c'),_0x56d34b?util['inspect'](_0x56d34b,{'showHidden':![],'depth':null}):'');});}exports[_0x00aa('0x1d')]=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 3e1813d..51cbe5a 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 _0x57c4=['exports'];(function(_0x294ebc,_0x4b7d49){var _0x1f758c=function(_0x5d6499){while(--_0x5d6499){_0x294ebc['push'](_0x294ebc['shift']());}};_0x1f758c(++_0x4b7d49);}(_0x57c4,0xf5));var _0x457c=function(_0x10191d,_0x350923){_0x10191d=_0x10191d-0x0;var _0x4270c0=_0x57c4[_0x10191d];return _0x4270c0;};'use strict';function start(){var _0x43cc3d=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x43cc3d['startAllRefreshIntervals']();}module[_0x457c('0x0')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x0ac3=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0ac3,0x115));var _0x30ac=function(_0x3775e3,_0x159b92){_0x3775e3=_0x3775e3-0x0;var _0x265a20=_0x0ac3[_0x3775e3];return _0x265a20;};'use strict';function start(){var _0x3b77dc=require(_0x30ac('0x0'));return _0x3b77dc['startAllRefreshIntervals']();}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 457cabf..c869e7f 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 _0x0641=['Smtp','user','Report\x20%s\x20last\x20%s\x20%s','../../files/reports','%s.%s','basename','savename','extname','zip','join','existsSync','status','Sent','message','attachments','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','data','subtractNumber','subtractNumber\x20null\x20or\x20undefined','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','CloudProvider','jobs','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','toRun','index','my\x20id','resolve','run\x20job','cron','startAt','endAt','start','add\x20cron','active','isBetween','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','name'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x0641,0x140));var _0x1064=function(_0x47de9a,_0x40cf23){_0x47de9a=_0x47de9a-0x0;var _0x4b9d6c=_0x0641[_0x47de9a];return _0x4b9d6c;};'use strict';var fs=require('fs');var util=require(_0x1064('0x0'));var path=require(_0x1064('0x1'));var _=require(_0x1064('0x2'));var moment=require(_0x1064('0x3'));var CronJobManager=require(_0x1064('0x4'));var jayson=require(_0x1064('0x5'));var BPromise=require(_0x1064('0x6'));var logger=require(_0x1064('0x7'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x1064('0x8')][_0x1064('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3260da,_0x43f7b4){return function(){logger[_0x1064('0xa')](_0x1064('0xb'),_0x3260da[_0x1064('0xc')]);var _0x3155d1=!![];var _0x339a1f=_0x3260da[_0x1064('0xd')]['getSmtpOptions']();var _0x24a520={'account':_0x339a1f,'message':{'from':util[_0x1064('0xe')]('\x22%s\x22\x20<%s>',_0x3260da[_0x1064('0xd')][_0x1064('0xf')],_0x3260da['MailAccount'][_0x1064('0xc')]||_0x3260da[_0x1064('0xd')][_0x1064('0x10')][_0x1064('0x11')]),'to':_0x3260da[_0x1064('0xc')],'cc':_0x3260da['cc'],'bcc':_0x3260da['bcc'],'subject':util[_0x1064('0xe')](_0x1064('0x12'),_0x43f7b4[_0x1064('0xf')],_0x3260da['subtractNumber'],_0x3260da['subtractUnit'])}};var _0x593253=path['join'](__dirname,_0x1064('0x13'));var _0xb51af2=_0x43f7b4['savename'];var _0x5aa31d=util[_0x1064('0xe')](_0x1064('0x14'),path[_0x1064('0x15')](_0x43f7b4[_0x1064('0x16')],path[_0x1064('0x17')](_0x43f7b4[_0x1064('0x16')])),_0x1064('0x18'));var _0x52d9e8=path[_0x1064('0x19')](_0x593253,_0xb51af2);var _0x2cccca=path[_0x1064('0x19')](_0x593253,_0x5aa31d);if(fs[_0x1064('0x1a')](_0x52d9e8)){_0x43f7b4[_0x1064('0x1b')]=_0x1064('0x1c');_0x24a520[_0x1064('0x1d')][_0x1064('0x1e')]=[{'filename':_0xb51af2,'path':_0x52d9e8}];_0x24a520[_0x1064('0x1d')]['text']=util['format'](_0x1064('0x1f'),JSON[_0x1064('0x20')](_0x43f7b4,null,0x2));}else if(fs['existsSync'](_0x2cccca)){_0x43f7b4[_0x1064('0x1b')]=_0x1064('0x1c');_0x24a520[_0x1064('0x1d')][_0x1064('0x1e')]=[{'filename':_0x5aa31d,'path':_0x2cccca}];}else{_0x24a520[_0x1064('0x1d')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x3260da[_0x1064('0x21')]){_0x3155d1=![];logger[_0x1064('0xa')](_0x1064('0x22'));}}if(_0x3155d1){return client[_0x1064('0x23')](_0x1064('0x24'),_0x24a520)[_0x1064('0x25')](function(_0x86d636){if(_0x86d636[_0x1064('0x26')]){return logger[_0x1064('0x26')](_0x1064('0x27'),JSON['stringify'](_0x86d636));}return logger[_0x1064('0xa')]('email\x20sent');})['catch'](function(_0x2b5d5c){return logger[_0x1064('0x26')](_0x1064('0x27'),JSON['stringify'](_0x2b5d5c));});}};}function handleError(){return function(_0x4f50ba){return logger[_0x1064('0x26')](JSON[_0x1064('0x20')](_0x4f50ba));};}function handleResult(_0x1168a9){return function(_0x37d359){logger[_0x1064('0xa')](_0x1064('0x28'),JSON[_0x1064('0x20')](_0x37d359));if(_0x1168a9[_0x1064('0xd')]&&_0x1168a9[_0x1064('0xd')][_0x1064('0x10')]&&!_['isNil'](_0x1168a9[_0x1064('0xc')])){setTimeout(handleSendEmail(_0x1168a9,_0x37d359),0x3c*0x3e8);}};}function handleJob(_0x31f561){return function(){try{if(_['isNil'](_0x31f561[_0x1064('0x29')])){return logger[_0x1064('0xa')](_0x1064('0x2a'));}if(_[_0x1064('0x2b')](_0x31f561['subtractUnit'])){return logger[_0x1064('0xa')](_0x1064('0x2c'));}var _0x147f1c={'startDate':moment()[_0x1064('0x2d')](_0x31f561[_0x1064('0x29')],_0x31f561[_0x1064('0x2e')])[_0x1064('0xe')](_0x1064('0x2f')),'endDate':moment()[_0x1064('0xe')](_0x1064('0x2f')),'type':_0x1064('0x30'),'output':_0x31f561[_0x1064('0x31')],'name':_0x31f561[_0x1064('0xf')]};if(!_[_0x1064('0x2b')](_0x31f561[_0x1064('0x32')])){logger[_0x1064('0xa')](_0x1064('0x33'),_0x31f561['DefaultReportId']);return analyticDefaultReportController[_0x1064('0x34')]({'id':_0x31f561['DefaultReportId']},_0x147f1c)['then'](handleResult(_0x31f561))[_0x1064('0x35')](handleError());}if(!_[_0x1064('0x2b')](_0x31f561[_0x1064('0x36')])){logger[_0x1064('0xa')](_0x1064('0x37'),_0x31f561[_0x1064('0x36')]);return analyticCustomReportController['runReport']({'id':_0x31f561[_0x1064('0x36')]},_0x147f1c)[_0x1064('0x25')](handleResult(_0x31f561))['catch'](handleError());}}catch(_0x3cfcfa){logger[_0x1064('0x26')](JSON[_0x1064('0x20')](_0x3cfcfa));}return logger[_0x1064('0xa')]('no\x20report\x20id');};}function getJobs(_0x55ee7a){var _0xc67731={};if(_0x55ee7a){_0xc67731['id']=_0x55ee7a;}return db[_0x1064('0x38')]['findAll']({'where':_0xc67731,'include':[{'model':db[_0x1064('0xd')],'attributes':['id','name',_0x1064('0xc')],'include':[{'model':db[_0x1064('0x39')],'as':_0x1064('0x10'),'include':[{'model':db[_0x1064('0x3a')],'as':_0x1064('0x3a')}]}]}]})['then'](function(_0x3889ff){var _0x17bb99=_['keys'](manager[_0x1064('0x3b')]);var _0x52a3b2=_['map'](_0x3889ff,function(_0x4a6557){return _0x4a6557['id'][_0x1064('0x3c')]();});var _0x10e13c=_[_0x1064('0x3d')](_0x3889ff,function(_0x41779f){return _0x41779f['id'][_0x1064('0x3c')]();});var _0x6c8ac2=_0x55ee7a?_0x52a3b2:_[_0x1064('0x3e')](_0x52a3b2,_0x17bb99);var _0x3e9d4e=_[_0x1064('0x3f')](_0x52a3b2,_0x17bb99);var _0x31fd36=_[_0x1064('0x3e')](_0x17bb99,_0x52a3b2);var _0x1a0ff1;var _0x1b41d4;for(_0x1a0ff1=0x0;_0x1a0ff1<_0x31fd36[_0x1064('0x40')]&&!_0x55ee7a;_0x1a0ff1+=0x1){_0x1b41d4=_0x31fd36[_0x1a0ff1][_0x1064('0x3c')]();if(manager[_0x1064('0x41')](_0x1b41d4)){manager[_0x1064('0x42')](_0x1b41d4);manager[_0x1064('0x43')](_0x1b41d4);logger[_0x1064('0xa')]('delete\x20cron',_0x1b41d4);}}logger['info'](_0x1064('0x44'),JSON['stringify'](_0x6c8ac2));for(_0x1a0ff1=0x0;_0x1a0ff1<_0x6c8ac2[_0x1064('0x40')];_0x1a0ff1+=0x1){_0x1b41d4=_0x6c8ac2[_0x1a0ff1]['toString']();logger[_0x1064('0xa')](_0x1064('0x45'),_0x1b41d4);if(_0x55ee7a){logger['info'](_0x1064('0x46'),_0x55ee7a);logger[_0x1064('0xa')](JSON['stringify'](_0x10e13c[_0x1b41d4]));BPromise[_0x1064('0x47')]()[_0x1064('0x25')](handleJob(_0x10e13c[_0x1b41d4]));logger['info'](_0x1064('0x48'),_0x10e13c[_0x1b41d4][_0x1064('0xf')],_0x10e13c[_0x1b41d4][_0x1064('0x49')]);}else if(_0x10e13c[_0x1b41d4]['cron']&&_0x10e13c[_0x1b41d4]['active']&&moment()['isBetween'](_0x10e13c[_0x1b41d4][_0x1064('0x4a')],_0x10e13c[_0x1b41d4][_0x1064('0x4b')])){manager['add'](_0x1b41d4,_0x10e13c[_0x1b41d4][_0x1064('0x49')],handleJob(_0x10e13c[_0x1b41d4]));manager[_0x1064('0x4c')](_0x1b41d4);logger[_0x1064('0xa')](_0x1064('0x4d'),_0x10e13c[_0x1b41d4][_0x1064('0xf')],_0x10e13c[_0x1b41d4][_0x1064('0x49')]);}else if(manager[_0x1064('0x41')](_0x1b41d4)){manager[_0x1064('0x42')](_0x1b41d4);manager[_0x1064('0x43')](_0x1b41d4);logger[_0x1064('0xa')]('stop\x20cron',_0x10e13c[_0x1b41d4][_0x1064('0xf')],_0x10e13c[_0x1b41d4][_0x1064('0x49')]);}}for(_0x1a0ff1=0x0,_0x1b41d4;_0x1a0ff1<_0x3e9d4e[_0x1064('0x40')]&&!_0x55ee7a;_0x1a0ff1+=0x1){_0x1b41d4=_0x3e9d4e[_0x1a0ff1][_0x1064('0x3c')]();if(manager[_0x1064('0x41')](_0x1b41d4)){if(_0x10e13c[_0x1b41d4][_0x1064('0x49')]&&_0x10e13c[_0x1b41d4][_0x1064('0x4e')]&&moment()[_0x1064('0x4f')](_0x10e13c[_0x1b41d4]['startAt'],_0x10e13c[_0x1b41d4]['endAt'])){manager[_0x1064('0x50')](_0x1b41d4,_0x10e13c[_0x1b41d4][_0x1064('0x49')],handleJob(_0x10e13c[_0x1b41d4]));logger[_0x1064('0xa')](_0x1064('0x51'),_0x10e13c[_0x1b41d4][_0x1064('0xf')],_0x10e13c[_0x1b41d4][_0x1064('0x49')]);}else{manager[_0x1064('0x42')](_0x1b41d4);manager[_0x1064('0x43')](_0x1b41d4);logger[_0x1064('0xa')](_0x1064('0x52'),_0x10e13c[_0x1b41d4][_0x1064('0xf')],_0x10e13c[_0x1b41d4][_0x1064('0x49')]);}}}})['catch'](function(_0x57dd3b){logger[_0x1064('0x26')](JSON[_0x1064('0x20')](_0x57dd3b));});}exports[_0x1064('0x53')]=function(_0xec28){return getJobs(_0xec28);};exports[_0x1064('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x6cce=['add\x20cron','exists','stop\x20cron','isBetween','update\x20cron','run','util','path','moment','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','format','\x22%s\x22\x20<%s>','MailAccount','name','email','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','active','startAt','endAt','add','cron','start'];(function(_0x5bfaa7,_0x404773){var _0xe1b1a3=function(_0x20a344){while(--_0x20a344){_0x5bfaa7['push'](_0x5bfaa7['shift']());}};_0xe1b1a3(++_0x404773);}(_0x6cce,0x166));var _0xe6cc=function(_0x35cabc,_0xc0f89a){_0x35cabc=_0x35cabc-0x0;var _0x2af2b9=_0x6cce[_0x35cabc];return _0x2af2b9;};'use strict';var fs=require('fs');var util=require(_0xe6cc('0x0'));var path=require(_0xe6cc('0x1'));var _=require('lodash');var moment=require(_0xe6cc('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xe6cc('0x3'));var BPromise=require(_0xe6cc('0x4'));var logger=require(_0xe6cc('0x5'))('schedule');var db=require(_0xe6cc('0x6'))['db'];var analyticCustomReportController=require(_0xe6cc('0x7'));var analyticDefaultReportController=require(_0xe6cc('0x8'));var client=jayson[_0xe6cc('0x9')][_0xe6cc('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42980b,_0x5b257b){return function(){logger[_0xe6cc('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x42980b['email']);var _0x3498b5=!![];var _0x5bcefd=_0x42980b['MailAccount']['getSmtpOptions']();var _0x595b8f={'account':_0x5bcefd,'message':{'from':util[_0xe6cc('0xc')](_0xe6cc('0xd'),_0x42980b[_0xe6cc('0xe')][_0xe6cc('0xf')],_0x42980b[_0xe6cc('0xe')][_0xe6cc('0x10')]||_0x42980b[_0xe6cc('0xe')][_0xe6cc('0x11')][_0xe6cc('0x12')]),'to':_0x42980b[_0xe6cc('0x10')],'cc':_0x42980b['cc'],'bcc':_0x42980b[_0xe6cc('0x13')],'subject':util['format'](_0xe6cc('0x14'),_0x5b257b[_0xe6cc('0xf')],_0x42980b[_0xe6cc('0x15')],_0x42980b[_0xe6cc('0x16')])}};var _0x504c93=path[_0xe6cc('0x17')](__dirname,_0xe6cc('0x18'));var _0x263f42=_0x5b257b[_0xe6cc('0x19')];var _0xae198=util[_0xe6cc('0xc')](_0xe6cc('0x1a'),path['basename'](_0x5b257b['savename'],path[_0xe6cc('0x1b')](_0x5b257b[_0xe6cc('0x19')])),_0xe6cc('0x1c'));var _0xf0cacb=path[_0xe6cc('0x17')](_0x504c93,_0x263f42);var _0x2f444c=path['join'](_0x504c93,_0xae198);if(fs[_0xe6cc('0x1d')](_0xf0cacb)){_0x5b257b[_0xe6cc('0x1e')]=_0xe6cc('0x1f');_0x595b8f[_0xe6cc('0x20')][_0xe6cc('0x21')]=[{'filename':_0x263f42,'path':_0xf0cacb}];_0x595b8f[_0xe6cc('0x20')][_0xe6cc('0x22')]=util[_0xe6cc('0xc')](_0xe6cc('0x23'),JSON[_0xe6cc('0x24')](_0x5b257b,null,0x2));}else if(fs[_0xe6cc('0x1d')](_0x2f444c)){_0x5b257b[_0xe6cc('0x1e')]=_0xe6cc('0x1f');_0x595b8f['message'][_0xe6cc('0x21')]=[{'filename':_0xae198,'path':_0x2f444c}];}else{_0x595b8f[_0xe6cc('0x20')][_0xe6cc('0x22')]=_0xe6cc('0x25');if(!_0x42980b[_0xe6cc('0x26')]){_0x3498b5=![];logger['info'](_0xe6cc('0x27'));}}if(_0x3498b5){return client[_0xe6cc('0x28')](_0xe6cc('0x29'),_0x595b8f)['then'](function(_0x28b571){if(_0x28b571['error']){return logger[_0xe6cc('0x2a')](_0xe6cc('0x2b'),JSON[_0xe6cc('0x24')](_0x28b571));}return logger[_0xe6cc('0xb')](_0xe6cc('0x2c'));})[_0xe6cc('0x2d')](function(_0xdc01ce){return logger[_0xe6cc('0x2a')](_0xe6cc('0x2b'),JSON['stringify'](_0xdc01ce));});}};}function handleError(){return function(_0x51ff7c){return logger[_0xe6cc('0x2a')](JSON['stringify'](_0x51ff7c));};}function handleResult(_0x208260){return function(_0x2c68fe){logger[_0xe6cc('0xb')](_0xe6cc('0x2e'),JSON[_0xe6cc('0x24')](_0x2c68fe));if(_0x208260['MailAccount']&&_0x208260[_0xe6cc('0xe')][_0xe6cc('0x11')]&&!_['isNil'](_0x208260[_0xe6cc('0x10')])){setTimeout(handleSendEmail(_0x208260,_0x2c68fe),0x3c*0x3e8);}};}function handleJob(_0x53a436){return function(){try{if(_[_0xe6cc('0x2f')](_0x53a436[_0xe6cc('0x15')])){return logger[_0xe6cc('0xb')](_0xe6cc('0x30'));}if(_['isNil'](_0x53a436['subtractUnit'])){return logger[_0xe6cc('0xb')](_0xe6cc('0x31'));}var _0xf8b85b={'startDate':moment()['subtract'](_0x53a436[_0xe6cc('0x15')],_0x53a436['subtractUnit'])[_0xe6cc('0xc')](_0xe6cc('0x32')),'endDate':moment()[_0xe6cc('0xc')](_0xe6cc('0x32')),'type':_0xe6cc('0x33'),'output':_0x53a436['output'],'name':_0x53a436['name']};if(!_['isNil'](_0x53a436['DefaultReportId'])){logger[_0xe6cc('0xb')](_0xe6cc('0x34'),_0x53a436[_0xe6cc('0x35')]);return analyticDefaultReportController[_0xe6cc('0x36')]({'id':_0x53a436[_0xe6cc('0x35')]},_0xf8b85b)[_0xe6cc('0x37')](handleResult(_0x53a436))['catch'](handleError());}if(!_[_0xe6cc('0x2f')](_0x53a436[_0xe6cc('0x38')])){logger[_0xe6cc('0xb')](_0xe6cc('0x39'),_0x53a436[_0xe6cc('0x38')]);return analyticCustomReportController[_0xe6cc('0x36')]({'id':_0x53a436[_0xe6cc('0x38')]},_0xf8b85b)[_0xe6cc('0x37')](handleResult(_0x53a436))[_0xe6cc('0x2d')](handleError());}}catch(_0x4a46f9){logger['error'](JSON['stringify'](_0x4a46f9));}return logger[_0xe6cc('0xb')](_0xe6cc('0x3a'));};}function getJobs(_0x126c98){var _0x1fd40d={};if(_0x126c98){_0x1fd40d['id']=_0x126c98;}return db[_0xe6cc('0x3b')][_0xe6cc('0x3c')]({'where':_0x1fd40d,'include':[{'model':db[_0xe6cc('0xe')],'attributes':['id',_0xe6cc('0xf'),_0xe6cc('0x10')],'include':[{'model':db[_0xe6cc('0x3d')],'as':_0xe6cc('0x11'),'include':[{'model':db[_0xe6cc('0x3e')],'as':_0xe6cc('0x3e')}]}]}]})[_0xe6cc('0x37')](function(_0xc3d243){var _0x210967=_['keys'](manager['jobs']);var _0x5706d2=_[_0xe6cc('0x3f')](_0xc3d243,function(_0x3037cd){return _0x3037cd['id'][_0xe6cc('0x40')]();});var _0x54a4b=_[_0xe6cc('0x41')](_0xc3d243,function(_0x1ffcab){return _0x1ffcab['id'][_0xe6cc('0x40')]();});var _0x14fe8f=_0x126c98?_0x5706d2:_[_0xe6cc('0x42')](_0x5706d2,_0x210967);var _0x126da2=_[_0xe6cc('0x43')](_0x5706d2,_0x210967);var _0x40766a=_['difference'](_0x210967,_0x5706d2);var _0x466297;var _0xa045e7;for(_0x466297=0x0;_0x466297<_0x40766a[_0xe6cc('0x44')]&&!_0x126c98;_0x466297+=0x1){_0xa045e7=_0x40766a[_0x466297][_0xe6cc('0x40')]();if(manager['exists'](_0xa045e7)){manager[_0xe6cc('0x45')](_0xa045e7);manager[_0xe6cc('0x46')](_0xa045e7);logger['info'](_0xe6cc('0x47'),_0xa045e7);}}logger[_0xe6cc('0xb')](_0xe6cc('0x48'),JSON[_0xe6cc('0x24')](_0x14fe8f));for(_0x466297=0x0;_0x466297<_0x14fe8f[_0xe6cc('0x44')];_0x466297+=0x1){_0xa045e7=_0x14fe8f[_0x466297][_0xe6cc('0x40')]();logger['info'](_0xe6cc('0x49'),_0xa045e7);if(_0x126c98){logger['info'](_0xe6cc('0x4a'),_0x126c98);logger[_0xe6cc('0xb')](JSON[_0xe6cc('0x24')](_0x54a4b[_0xa045e7]));BPromise[_0xe6cc('0x4b')]()[_0xe6cc('0x37')](handleJob(_0x54a4b[_0xa045e7]));logger['info']('run\x20job',_0x54a4b[_0xa045e7][_0xe6cc('0xf')],_0x54a4b[_0xa045e7]['cron']);}else if(_0x54a4b[_0xa045e7]['cron']&&_0x54a4b[_0xa045e7][_0xe6cc('0x4c')]&&moment()['isBetween'](_0x54a4b[_0xa045e7][_0xe6cc('0x4d')],_0x54a4b[_0xa045e7][_0xe6cc('0x4e')])){manager[_0xe6cc('0x4f')](_0xa045e7,_0x54a4b[_0xa045e7][_0xe6cc('0x50')],handleJob(_0x54a4b[_0xa045e7]));manager[_0xe6cc('0x51')](_0xa045e7);logger['info'](_0xe6cc('0x52'),_0x54a4b[_0xa045e7]['name'],_0x54a4b[_0xa045e7]['cron']);}else if(manager[_0xe6cc('0x53')](_0xa045e7)){manager[_0xe6cc('0x45')](_0xa045e7);manager[_0xe6cc('0x46')](_0xa045e7);logger[_0xe6cc('0xb')](_0xe6cc('0x54'),_0x54a4b[_0xa045e7][_0xe6cc('0xf')],_0x54a4b[_0xa045e7][_0xe6cc('0x50')]);}}for(_0x466297=0x0,_0xa045e7;_0x466297<_0x126da2[_0xe6cc('0x44')]&&!_0x126c98;_0x466297+=0x1){_0xa045e7=_0x126da2[_0x466297][_0xe6cc('0x40')]();if(manager[_0xe6cc('0x53')](_0xa045e7)){if(_0x54a4b[_0xa045e7][_0xe6cc('0x50')]&&_0x54a4b[_0xa045e7][_0xe6cc('0x4c')]&&moment()[_0xe6cc('0x55')](_0x54a4b[_0xa045e7][_0xe6cc('0x4d')],_0x54a4b[_0xa045e7]['endAt'])){manager['update'](_0xa045e7,_0x54a4b[_0xa045e7][_0xe6cc('0x50')],handleJob(_0x54a4b[_0xa045e7]));logger[_0xe6cc('0xb')](_0xe6cc('0x56'),_0x54a4b[_0xa045e7][_0xe6cc('0xf')],_0x54a4b[_0xa045e7][_0xe6cc('0x50')]);}else{manager['stop'](_0xa045e7);manager[_0xe6cc('0x46')](_0xa045e7);logger[_0xe6cc('0xb')](_0xe6cc('0x54'),_0x54a4b[_0xa045e7]['name'],_0x54a4b[_0xa045e7][_0xe6cc('0x50')]);}}}})[_0xe6cc('0x2d')](function(_0x25ae52){logger['error'](JSON[_0xe6cc('0x24')](_0x25ae52));});}exports[_0xe6cc('0x57')]=function(_0xeb5c65){return getJobs(_0xeb5c65);};exports[_0xe6cc('0x51')]=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 63e5966..d392afc 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 _0x4f9b=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore','Mixed','Neutral','resolve','sentiment','Negative','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','push','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4f9b,0x6d));var _0xb4f9=function(_0x37df67,_0x2522c1){_0x37df67=_0x37df67-0x0;var _0xde3ce6=_0x4f9b[_0x37df67];return _0xde3ce6;};var _=require(_0xb4f9('0x0'));var AWS=require(_0xb4f9('0x1'));var rp=require(_0xb4f9('0x2'));var util=require(_0xb4f9('0x3'));var BPromise=require(_0xb4f9('0x4'));var db=require(_0xb4f9('0x5'))['db'];var logger=require(_0xb4f9('0x6'))(_0xb4f9('0x7'));function getTranscriptionJob(_0x5276a3,_0x59803f,_0x572714,_0x25947a){return new Promise(function(_0x38c813,_0x2fa71b){var _0x4e8f3c=new AWS[(_0xb4f9('0x8'))]({'accessKeyId':_0x59803f,'secretAccessKey':_0x5276a3,'region':_0x572714});_0x4e8f3c[_0xb4f9('0x9')]({'TranscriptionJobName':_0x25947a},function(_0x5f21cf,_0x5ecbc5){if(_0x5f21cf){return _0x2fa71b(_0x5f21cf);}else{return _0x38c813(_0x5ecbc5);}});});}function sentiment(_0x439f66,_0x3240ea,_0x4a9df3,_0x146ecf,_0x544209){return new Promise(function(_0x2ee1b5,_0x398e64){var _0xa19014=new AWS[(_0xb4f9('0xa'))]({'accessKeyId':_0x3240ea,'secretAccessKey':_0x439f66,'region':_0x4a9df3});_0xa19014[_0xb4f9('0xb')]({'Text':_0x146ecf,'LanguageCode':_0x544209[_0xb4f9('0xc')](0x0,0x2)},function(_0x191882,_0x4a056c){if(_0x191882){return _0x398e64(_0x191882);}else{return _0x2ee1b5(_0x4a056c);}});});}function checkTranscribeJob(_0x1bb8b0,_0x4475e4,_0x239d84){var _0x4927d9;return new BPromise(function(_0x5819d5,_0x1aaff5){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0xf'),_0x1bb8b0['id'],_0x1bb8b0[_0xb4f9('0x10')]));return getTranscriptionJob(_0x239d84[_0xb4f9('0x11')],_0x239d84[_0xb4f9('0x12')],_0x4475e4[_0xb4f9('0x13')],_0x1bb8b0[_0xb4f9('0x10')])[_0xb4f9('0x14')](function(_0xc6e4da){logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x15'),_0x1bb8b0['id'],_0x1bb8b0[_0xb4f9('0x10')],_0xc6e4da[_0xb4f9('0x16')][_0xb4f9('0x17')]));if(!_0x1bb8b0['fileText']){switch(_0xc6e4da['TranscriptionJob']['TranscriptionJobStatus']){case'COMPLETED':var _0x468203={'transcribeStatus':_0xc6e4da['TranscriptionJob'][_0xb4f9('0x17')],'fileUri':_0xc6e4da[_0xb4f9('0x16')]['Transcript'][_0xb4f9('0x18')]};logger['info'](util[_0xb4f9('0xe')](_0xb4f9('0x19'),_0x1bb8b0['id']));return rp({'uri':_0xc6e4da[_0xb4f9('0x16')][_0xb4f9('0x1a')][_0xb4f9('0x18')],'json':!![]})[_0xb4f9('0x14')](function(_0x4a0a9b){logger['info'](util['format'](_0xb4f9('0x1b'),_0x1bb8b0['id']));if(_0x4a0a9b&&_0x4a0a9b['results']&&_0x4a0a9b[_0xb4f9('0x1c')][_0xb4f9('0x1d')]&&_0x4a0a9b[_0xb4f9('0x1c')][_0xb4f9('0x1d')][_0xb4f9('0x1e')]){_0x468203[_0xb4f9('0x1f')]='';for(var _0x4d3b93=0x0;_0x4d3b93<_0x4a0a9b[_0xb4f9('0x1c')]['transcripts'][_0xb4f9('0x1e')];_0x4d3b93++){_0x468203[_0xb4f9('0x1f')]+=_0x4a0a9b['results']['transcripts'][_0x4d3b93][_0xb4f9('0x20')]+'';}}return _0x1bb8b0['update'](_0x468203);})[_0xb4f9('0x14')](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));if(!_0x1bb8b0[_0xb4f9('0x22')]){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x25'));}if(!_0x4475e4['sentiment']||!_0x4475e4['sentimentAccountId']||!_0x4475e4['sentimentRegion']||!_0x4475e4[_0xb4f9('0x26')]||!_0x4475e4[_0xb4f9('0x27')]){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x28'));}if(!_0x468203[_0xb4f9('0x1f')]){throw new Error(_0xb4f9('0x29'));}if(_0x4475e4[_0xb4f9('0x2a')]===_0x239d84['id']){return _0x239d84;}else{return db[_0xb4f9('0x2b')][_0xb4f9('0x2c')]({'where':{'id':_settings[_0xb4f9('0x2a')]}});}})[_0xb4f9('0x14')](function(_0x4b2a58){if(!_0x4b2a58){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x2d'));}if(!_0x4b2a58['data1']||!_0x4b2a58['data2']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x4927d9=_0x4b2a58;logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x2f'),_0x1bb8b0['id']));return sentiment(_0x4927d9[_0xb4f9('0x11')],_0x4927d9[_0xb4f9('0x12')],_0x4475e4[_0xb4f9('0x30')],_0x468203[_0xb4f9('0x1f')],_0x4475e4[_0xb4f9('0x26')]);})[_0xb4f9('0x14')](function(_0x453a7e){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x31'),_0x1bb8b0['id']));return _0x1bb8b0[_0xb4f9('0x32')]({'sentiment':_0x453a7e[_0xb4f9('0x33')],'sPositive':_0x453a7e['SentimentScore'][_0xb4f9('0x34')],'sNegative':_0x453a7e[_0xb4f9('0x35')]['Negative'],'sMixed':_0x453a7e[_0xb4f9('0x35')][_0xb4f9('0x36')],'sNeutral':_0x453a7e[_0xb4f9('0x35')][_0xb4f9('0x37')]});})['then'](function(){logger[_0xb4f9('0xd')](util['format'](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});case'FAILED':return _0x1bb8b0[_0xb4f9('0x32')]({'transcribeStatus':'FAILED','failureReason':_0xc6e4da[_0xb4f9('0x16')]['FailureReason']})[_0xb4f9('0x14')](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});default:logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1bb8b0['id']));break;}}else{return BPromise[_0xb4f9('0x38')]()[_0xb4f9('0x14')](function(){if(!_0x1bb8b0['tempSentiment']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x25'));}if(!_0x4475e4[_0xb4f9('0x39')]||!_0x4475e4[_0xb4f9('0x2a')]||!_0x4475e4[_0xb4f9('0x30')]||!_0x4475e4[_0xb4f9('0x26')]||!_0x4475e4[_0xb4f9('0x27')]){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x28'));}if(!_0x1bb8b0[_0xb4f9('0x1f')]){throw new Error(_0xb4f9('0x29'));}if(_0x4475e4[_0xb4f9('0x2a')]===_0x239d84['id']){return _0x239d84;}else{return db[_0xb4f9('0x2b')][_0xb4f9('0x2c')]({'where':{'id':_settings[_0xb4f9('0x2a')]}});}})[_0xb4f9('0x14')](function(_0x21b733){if(!_0x21b733){throw new db['Sequelize'][(_0xb4f9('0x24'))](_0xb4f9('0x2d'));}if(!_0x21b733[_0xb4f9('0x11')]||!_0x21b733['data2']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x4927d9=_0x21b733;logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x2f'),_0x1bb8b0['id']));return sentiment(_0x4927d9['data1'],_0x4927d9[_0xb4f9('0x12')],_0x4475e4['sentimentRegion'],_0x1bb8b0['fileText'],_0x4475e4[_0xb4f9('0x26')]);})[_0xb4f9('0x14')](function(_0x28cba4){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x31'),_0x1bb8b0['id']));return _0x1bb8b0[_0xb4f9('0x32')]({'sentiment':_0x28cba4['Sentiment'],'sPositive':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x34')],'sNegative':_0x28cba4['SentimentScore'][_0xb4f9('0x3a')],'sMixed':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x36')],'sNeutral':_0x28cba4[_0xb4f9('0x35')][_0xb4f9('0x37')],'transcribeStatus':_0xb4f9('0x3b')});})['then'](function(){logger[_0xb4f9('0xd')](util[_0xb4f9('0xe')](_0xb4f9('0x21'),_0x1bb8b0['id']));_0x5819d5();});}})['catch'](function(_0x42e65f){if(_0x42e65f){if(!_0x42e65f[_0xb4f9('0x3c')]||_0x42e65f['name']!==_0xb4f9('0x3d')){logger[_0xb4f9('0x3e')](util[_0xb4f9('0xe')](_0xb4f9('0x3f'),_0x1bb8b0['id']),util[_0xb4f9('0x40')](_0x42e65f,{'showHidden':![],'depth':null}));}}_0x5819d5();});});}function checkTranscribe(){var _0x526d4f;var _0x70b72f;var _0x3612b6;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0xb4f9('0x41')}})[_0xb4f9('0x14')](function(_0x3c7811){if(!_0x3c7811||!_0x3c7811['length']){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x42'));}_0x526d4f=_0x3c7811;return db['Setting'][_0xb4f9('0x2c')]({'where':{'id':0x1}});})[_0xb4f9('0x14')](function(_0x13054d){if(!_0x13054d){throw new db[(_0xb4f9('0x23'))]['ValidationError'](_0xb4f9('0x43'));}_0x70b72f=_0x13054d;if(!_0x70b72f[_0xb4f9('0x7')]||!_0x70b72f[_0xb4f9('0x44')]||!_0x70b72f['transcribeRegion']||!_0x70b72f[_0xb4f9('0x26')]||!_0x70b72f[_0xb4f9('0x27')]){throw new db['Sequelize'][(_0xb4f9('0x24'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0xb4f9('0x2c')]({'where':{'id':_0x70b72f['transcribeAccountId']}});})[_0xb4f9('0x14')](function(_0x5bbbe7){if(!_0x5bbbe7){throw new db[(_0xb4f9('0x23'))][(_0xb4f9('0x24'))](_0xb4f9('0x2d'));}if(!_0x5bbbe7['data1']||!_0x5bbbe7[_0xb4f9('0x12')]){throw new db['Sequelize'][(_0xb4f9('0x24'))](_0xb4f9('0x2e'));}_0x3612b6=_0x5bbbe7;var _0x9a402f=[];_0x526d4f['forEach'](function(_0x3bfcc8){_0x9a402f[_0xb4f9('0x45')](checkTranscribeJob(_0x3bfcc8,_0x70b72f,_0x3612b6));});return BPromise['all'](_0x9a402f);})['catch'](function(_0x4b0f68){if(_0x4b0f68){if(!_0x4b0f68['name']||_0x4b0f68[_0xb4f9('0x3c')]!=='SequelizeValidationError'){logger[_0xb4f9('0x3e')](util[_0xb4f9('0x40')](_0x4b0f68,{'showHidden':![],'depth':null}));}}});}exports[_0xb4f9('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x57f8=['findOne','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20available','Negative','Mixed','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data2','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider'];(function(_0x27058f,_0x34d929){var _0x595819=function(_0x5b2894){while(--_0x5b2894){_0x27058f['push'](_0x27058f['shift']());}};_0x595819(++_0x34d929);}(_0x57f8,0x198));var _0x857f=function(_0x519228,_0x2bcbc2){_0x519228=_0x519228-0x0;var _0xc3c605=_0x57f8[_0x519228];return _0xc3c605;};var _=require('lodash');var AWS=require(_0x857f('0x0'));var rp=require(_0x857f('0x1'));var util=require(_0x857f('0x2'));var BPromise=require(_0x857f('0x3'));var db=require(_0x857f('0x4'))['db'];var logger=require(_0x857f('0x5'))(_0x857f('0x6'));function getTranscriptionJob(_0x6f054b,_0x318050,_0xced48e,_0xf3874b){return new Promise(function(_0x369c40,_0x5d22e4){var _0x8380e8=new AWS[(_0x857f('0x7'))]({'accessKeyId':_0x318050,'secretAccessKey':_0x6f054b,'region':_0xced48e});_0x8380e8[_0x857f('0x8')]({'TranscriptionJobName':_0xf3874b},function(_0x577fc3,_0x5f6a66){if(_0x577fc3){return _0x5d22e4(_0x577fc3);}else{return _0x369c40(_0x5f6a66);}});});}function sentiment(_0x135855,_0x960b76,_0x4f2b09,_0x1e306e,_0x2ef315){return new Promise(function(_0x370126,_0x5cc993){var _0xefee53=new AWS[(_0x857f('0x9'))]({'accessKeyId':_0x960b76,'secretAccessKey':_0x135855,'region':_0x4f2b09});_0xefee53[_0x857f('0xa')]({'Text':_0x1e306e,'LanguageCode':_0x2ef315[_0x857f('0xb')](0x0,0x2)},function(_0x268f9d,_0x3eb530){if(_0x268f9d){return _0x5cc993(_0x268f9d);}else{return _0x370126(_0x3eb530);}});});}function checkTranscribeJob(_0x322192,_0x533631,_0x2e1eda){var _0x2d5e26;return new BPromise(function(_0x373333,_0x2caf29){logger[_0x857f('0xc')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x322192['id'],_0x322192[_0x857f('0xd')]));return getTranscriptionJob(_0x2e1eda['data1'],_0x2e1eda[_0x857f('0xe')],_0x533631['transcribeRegion'],_0x322192[_0x857f('0xd')])[_0x857f('0xf')](function(_0x5c3a69){logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x11'),_0x322192['id'],_0x322192[_0x857f('0xd')],_0x5c3a69[_0x857f('0x12')][_0x857f('0x13')]));if(!_0x322192[_0x857f('0x14')]){switch(_0x5c3a69[_0x857f('0x12')][_0x857f('0x13')]){case _0x857f('0x15'):var _0x8e11f1={'transcribeStatus':_0x5c3a69['TranscriptionJob'][_0x857f('0x13')],'fileUri':_0x5c3a69[_0x857f('0x12')]['Transcript'][_0x857f('0x16')]};logger[_0x857f('0xc')](util[_0x857f('0x10')]('[RECORDING:%d]\x20Get\x20transcript',_0x322192['id']));return rp({'uri':_0x5c3a69['TranscriptionJob'][_0x857f('0x17')][_0x857f('0x16')],'json':!![]})[_0x857f('0xf')](function(_0x4fa031){logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x18'),_0x322192['id']));if(_0x4fa031&&_0x4fa031['results']&&_0x4fa031[_0x857f('0x19')][_0x857f('0x1a')]&&_0x4fa031['results'][_0x857f('0x1a')][_0x857f('0x1b')]){_0x8e11f1[_0x857f('0x14')]='';for(var _0x44ff23=0x0;_0x44ff23<_0x4fa031[_0x857f('0x19')][_0x857f('0x1a')][_0x857f('0x1b')];_0x44ff23++){_0x8e11f1[_0x857f('0x14')]+=_0x4fa031[_0x857f('0x19')][_0x857f('0x1a')][_0x44ff23][_0x857f('0x1c')]+'';}}return _0x322192[_0x857f('0x1d')](_0x8e11f1);})[_0x857f('0xf')](function(){logger[_0x857f('0xc')](util['format'](_0x857f('0x1e'),_0x322192['id']));if(!_0x322192[_0x857f('0x1f')]){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x533631[_0x857f('0x22')]||!_0x533631['sentimentAccountId']||!_0x533631[_0x857f('0x23')]||!_0x533631[_0x857f('0x24')]||!_0x533631[_0x857f('0x25')]){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x26'));}if(!_0x8e11f1[_0x857f('0x14')]){throw new Error(_0x857f('0x27'));}if(_0x533631[_0x857f('0x28')]===_0x2e1eda['id']){return _0x2e1eda;}else{return db[_0x857f('0x29')][_0x857f('0x2a')]({'where':{'id':_settings[_0x857f('0x28')]}});}})[_0x857f('0xf')](function(_0x5d0317){if(!_0x5d0317){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5d0317[_0x857f('0x2b')]||!_0x5d0317[_0x857f('0xe')]){throw new db['Sequelize'][(_0x857f('0x21'))](_0x857f('0x2c'));}_0x2d5e26=_0x5d0317;logger['info'](util[_0x857f('0x10')](_0x857f('0x2d'),_0x322192['id']));return sentiment(_0x2d5e26[_0x857f('0x2b')],_0x2d5e26[_0x857f('0xe')],_0x533631['sentimentRegion'],_0x8e11f1['fileText'],_0x533631[_0x857f('0x24')]);})[_0x857f('0xf')](function(_0x4c88fa){logger[_0x857f('0xc')](util['format'](_0x857f('0x2e'),_0x322192['id']));return _0x322192[_0x857f('0x1d')]({'sentiment':_0x4c88fa[_0x857f('0x2f')],'sPositive':_0x4c88fa[_0x857f('0x30')][_0x857f('0x31')],'sNegative':_0x4c88fa['SentimentScore']['Negative'],'sMixed':_0x4c88fa[_0x857f('0x30')]['Mixed'],'sNeutral':_0x4c88fa[_0x857f('0x30')][_0x857f('0x32')]});})[_0x857f('0xf')](function(){logger['info'](util[_0x857f('0x10')](_0x857f('0x1e'),_0x322192['id']));_0x373333();});case _0x857f('0x33'):return _0x322192[_0x857f('0x1d')]({'transcribeStatus':_0x857f('0x33'),'failureReason':_0x5c3a69[_0x857f('0x12')][_0x857f('0x34')]})['then'](function(){logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x1e'),_0x322192['id']));_0x373333();});default:logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x35'),_0x322192['id']));break;}}else{return BPromise[_0x857f('0x36')]()['then'](function(){if(!_0x322192[_0x857f('0x1f')]){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x37'));}if(!_0x533631[_0x857f('0x22')]||!_0x533631[_0x857f('0x28')]||!_0x533631['sentimentRegion']||!_0x533631[_0x857f('0x24')]||!_0x533631[_0x857f('0x25')]){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x26'));}if(!_0x322192[_0x857f('0x14')]){throw new Error(_0x857f('0x27'));}if(_0x533631[_0x857f('0x28')]===_0x2e1eda['id']){return _0x2e1eda;}else{return db['CloudProvider'][_0x857f('0x2a')]({'where':{'id':_settings[_0x857f('0x28')]}});}})[_0x857f('0xf')](function(_0x158373){if(!_0x158373){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x38'));}if(!_0x158373[_0x857f('0x2b')]||!_0x158373[_0x857f('0xe')]){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x2c'));}_0x2d5e26=_0x158373;logger[_0x857f('0xc')](util[_0x857f('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x322192['id']));return sentiment(_0x2d5e26[_0x857f('0x2b')],_0x2d5e26['data2'],_0x533631[_0x857f('0x23')],_0x322192[_0x857f('0x14')],_0x533631[_0x857f('0x24')]);})[_0x857f('0xf')](function(_0x2d9bd4){logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x2e'),_0x322192['id']));return _0x322192[_0x857f('0x1d')]({'sentiment':_0x2d9bd4[_0x857f('0x2f')],'sPositive':_0x2d9bd4[_0x857f('0x30')]['Positive'],'sNegative':_0x2d9bd4['SentimentScore'][_0x857f('0x39')],'sMixed':_0x2d9bd4['SentimentScore'][_0x857f('0x3a')],'sNeutral':_0x2d9bd4['SentimentScore'][_0x857f('0x32')],'transcribeStatus':_0x857f('0x15')});})[_0x857f('0xf')](function(){logger[_0x857f('0xc')](util[_0x857f('0x10')](_0x857f('0x1e'),_0x322192['id']));_0x373333();});}})[_0x857f('0x3b')](function(_0x22264a){if(_0x22264a){if(!_0x22264a['name']||_0x22264a[_0x857f('0x3c')]!==_0x857f('0x3d')){logger[_0x857f('0x3e')](util[_0x857f('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x322192['id']),util[_0x857f('0x3f')](_0x22264a,{'showHidden':![],'depth':null}));}}_0x373333();});});}function checkTranscribe(){var _0x3dae7f;var _0x2375ca;var _0x736ef6;return db[_0x857f('0x40')]['findAll']({'where':{'transcribeStatus':_0x857f('0x41')}})[_0x857f('0xf')](function(_0x52ca92){if(!_0x52ca92||!_0x52ca92[_0x857f('0x1b')]){throw new db[(_0x857f('0x20'))]['ValidationError'](_0x857f('0x42'));}_0x3dae7f=_0x52ca92;return db['Setting'][_0x857f('0x2a')]({'where':{'id':0x1}});})[_0x857f('0xf')](function(_0x446fe9){if(!_0x446fe9){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x43'));}_0x2375ca=_0x446fe9;if(!_0x2375ca[_0x857f('0x6')]||!_0x2375ca[_0x857f('0x44')]||!_0x2375ca[_0x857f('0x45')]||!_0x2375ca[_0x857f('0x24')]||!_0x2375ca['bucket']){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x46'));}return db[_0x857f('0x29')][_0x857f('0x2a')]({'where':{'id':_0x2375ca[_0x857f('0x44')]}});})[_0x857f('0xf')](function(_0x59164a){if(!_0x59164a){throw new db[(_0x857f('0x20'))][(_0x857f('0x21'))](_0x857f('0x38'));}if(!_0x59164a[_0x857f('0x2b')]||!_0x59164a[_0x857f('0xe')]){throw new db[(_0x857f('0x20'))]['ValidationError'](_0x857f('0x2c'));}_0x736ef6=_0x59164a;var _0xe7e09b=[];_0x3dae7f[_0x857f('0x47')](function(_0x2778ac){_0xe7e09b[_0x857f('0x48')](checkTranscribeJob(_0x2778ac,_0x2375ca,_0x736ef6));});return BPromise[_0x857f('0x49')](_0xe7e09b);})[_0x857f('0x3b')](function(_0x3c6ddc){if(_0x3c6ddc){if(!_0x3c6ddc['name']||_0x3c6ddc['name']!==_0x857f('0x3d')){logger[_0x857f('0x3e')](util[_0x857f('0x3f')](_0x3c6ddc,{'showHidden':![],'depth':null}));}}});}exports[_0x857f('0x4a')]=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 7439159..05edd99 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 _0x5790=['whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5790,0xa1));var _0x0579=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5790[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x0579('0x0'));var moment=require('moment');var Redis=require(_0x0579('0x1'));var util=require(_0x0579('0x2'));var config=require(_0x0579('0x3'));var db=require(_0x0579('0x4'))['db'];var logger=require(_0x0579('0x5'))(_0x0579('0x6'));config[_0x0579('0x7')]=_[_0x0579('0x8')](config[_0x0579('0x7')],{'host':_0x0579('0x9'),'port':0x18eb});var io=require(_0x0579('0xa'))(new Redis(config[_0x0579('0x7')]));function closeInteractions(){var _0x21f27f=[];return db[_0x0579('0xb')][_0x0579('0xc')]({'raw':!![],'attributes':['id',_0x0579('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0579('0xe')](0x18,_0x0579('0xf'))}}})[_0x0579('0x10')](function(_0x57a273){if(_0x57a273&&_0x57a273['length']){_0x21f27f=_[_0x0579('0x11')](_0x57a273||[],'id');logger[_0x0579('0x12')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x21f27f[_0x0579('0x13')]());return db[_0x0579('0xb')]['update']({'closeReason':'system','disposition':_0x0579('0x14'),'closed':!![],'closedAt':moment()[_0x0579('0x15')](_0x0579('0x16'))},{'where':{'id':_0x21f27f}});}})[_0x0579('0x10')](function(){if(_0x21f27f&&_0x21f27f[_0x0579('0x17')]){logger[_0x0579('0x12')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x21f27f[_0x0579('0x13')]());for(var _0xf3cdd9=0x0;_0xf3cdd9<_0x21f27f[_0x0579('0x17')];_0xf3cdd9++){io[_0x0579('0x18')](_0x0579('0x19'),{'id':_0x21f27f[_0xf3cdd9],'closed':!![]});}}})[_0x0579('0x1a')](function(_0x3f41ee){logger[_0x0579('0x1b')](_0x0579('0x1c'),_0x3f41ee?util[_0x0579('0x1d')](_0x3f41ee,{'showHidden':![],'depth':null}):'');});}exports[_0x0579('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x66da=['moment','ioredis','util','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','join','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x66da,0x16f));var _0xa66d=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x66da[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0xa66d('0x0'));var moment=require(_0xa66d('0x1'));var Redis=require(_0xa66d('0x2'));var util=require(_0xa66d('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xa66d('0x4'));config[_0xa66d('0x5')]=_[_0xa66d('0x6')](config[_0xa66d('0x5')],{'host':_0xa66d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa66d('0x5')]));function closeInteractions(){var _0x1643d9=[];return db[_0xa66d('0x8')][_0xa66d('0x9')]({'raw':!![],'attributes':['id',_0xa66d('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa66d('0xb')](0x18,_0xa66d('0xc'))}}})[_0xa66d('0xd')](function(_0x7ee9c){if(_0x7ee9c&&_0x7ee9c[_0xa66d('0xe')]){_0x1643d9=_[_0xa66d('0xf')](_0x7ee9c||[],'id');logger[_0xa66d('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1643d9[_0xa66d('0x11')]());return db[_0xa66d('0x8')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xa66d('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1643d9}});}})[_0xa66d('0xd')](function(){if(_0x1643d9&&_0x1643d9['length']){logger[_0xa66d('0x10')](_0xa66d('0x13'),_0x1643d9['join']());for(var _0x437071=0x0;_0x437071<_0x1643d9[_0xa66d('0xe')];_0x437071++){io['emit'](_0xa66d('0x14'),{'id':_0x1643d9[_0x437071],'closed':!![]});}}})['catch'](function(_0x4c1746){logger['error'](_0xa66d('0x15'),_0x4c1746?util[_0xa66d('0x16')](_0x4c1746,{'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/seedContact.js b/server/config/seedContact.js index 776b1bc..cc63bbf 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5657=['innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','finished\x20populating','CmHopper','bulkCreate','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo'];(function(_0x139ac2,_0x56cd0b){var _0x5d6871=function(_0x331f8c){while(--_0x331f8c){_0x139ac2['push'](_0x139ac2['shift']());}};_0x5d6871(++_0x56cd0b);}(_0x5657,0xc1));var _0x7565=function(_0x8edcdc,_0x4f9b5d){_0x8edcdc=_0x8edcdc-0x0;var _0x1c9dd7=_0x5657[_0x8edcdc];return _0x1c9dd7;};'use strict';var util=require(_0x7565('0x0'));var db=require(_0x7565('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7565('0x2')]({'id':i,'firstName':_0x7565('0x3')+i,'lastName':_0x7565('0x4')+i,'phone':0xf879fb460+i,'email':_0x7565('0x5')+i+_0x7565('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7565('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7565('0x7')](),'updatedAt':Date[_0x7565('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7565('0x2')]({'id':i,'firstName':_0x7565('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7565('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7565('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7565('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7565('0x7')](),'updatedAt':Date['now']()});}db[_0x7565('0x8')][_0x7565('0x9')]({'where':{}})[_0x7565('0xa')](function(){return db[_0x7565('0x8')]['bulkCreate'](contacts);})[_0x7565('0xa')](function(){console[_0x7565('0xb')](_0x7565('0xc'),'contacts1');return db['CmHopper'][_0x7565('0x9')]({'where':{}});})['then'](function(){return db[_0x7565('0xd')][_0x7565('0xe')](hopper);})['then'](function(){console['log'](_0x7565('0xc'),_0x7565('0xf'));return db[_0x7565('0x8')][_0x7565('0xe')](contacts2);})[_0x7565('0xa')](function(){console[_0x7565('0xb')]('finished\x20populating',_0x7565('0x10'));return db[_0x7565('0xd')][_0x7565('0xe')](hopper2);})[_0x7565('0xa')](function(){console['log'](_0x7565('0xc'),'hopper2');})[_0x7565('0x11')](function(_0xcf4ea1){console['log'](_0xcf4ea1);}); \ No newline at end of file +var _0xc223=['then','finished\x20populating','CmHopper','log','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate'];(function(_0x384130,_0x4787dd){var _0x206897=function(_0x16f27f){while(--_0x16f27f){_0x384130['push'](_0x384130['shift']());}};_0x206897(++_0x4787dd);}(_0xc223,0xd9));var _0x3c22=function(_0x4a7142,_0x548cb2){_0x4a7142=_0x4a7142-0x0;var _0x18a7fc=_0xc223[_0x4a7142];return _0x18a7fc;};'use strict';var util=require(_0x3c22('0x0'));var db=require(_0x3c22('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3c22('0x2')]({'id':i,'firstName':_0x3c22('0x3')+i,'lastName':_0x3c22('0x4')+i,'phone':0xf879fb460+i,'email':_0x3c22('0x5')+i+_0x3c22('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3c22('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3c22('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c22('0x7')](),'updatedAt':Date[_0x3c22('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x3c22('0x3')+i,'lastName':_0x3c22('0x4')+i,'phone':0xf879fb460+i,'email':_0x3c22('0x5')+i+_0x3c22('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3c22('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c22('0x7')](),'updatedAt':Date[_0x3c22('0x7')]()});}db[_0x3c22('0x8')][_0x3c22('0x9')]({'where':{}})['then'](function(){return db[_0x3c22('0x8')][_0x3c22('0xa')](contacts);})[_0x3c22('0xb')](function(){console['log'](_0x3c22('0xc'),'contacts1');return db[_0x3c22('0xd')][_0x3c22('0x9')]({'where':{}});})['then'](function(){return db[_0x3c22('0xd')]['bulkCreate'](hopper);})[_0x3c22('0xb')](function(){console[_0x3c22('0xe')]('finished\x20populating',_0x3c22('0xf'));return db[_0x3c22('0x8')][_0x3c22('0xa')](contacts2);})['then'](function(){console[_0x3c22('0xe')](_0x3c22('0xc'),_0x3c22('0x10'));return db[_0x3c22('0xd')][_0x3c22('0xa')](hopper2);})[_0x3c22('0xb')](function(){console[_0x3c22('0xe')]('finished\x20populating',_0x3c22('0x11'));})[_0x3c22('0x12')](function(_0x5ed839){console[_0x3c22('0xe')](_0x5ed839);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c87ca76..15c056f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb98c=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','then','log','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss'];(function(_0x418e29,_0x33b574){var _0x291241=function(_0x11de0b){while(--_0x11de0b){_0x418e29['push'](_0x418e29['shift']());}};_0x291241(++_0x33b574);}(_0xb98c,0x100));var _0xcb98=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xb98c[_0x5ecadc];return _0x565037;};'use strict';var util=require(_0xcb98('0x0'));var db=require(_0xcb98('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcb98('0x2')]({'name':util[_0xcb98('0x3')](_0xcb98('0x4'),_0xcb98('0x5'),i),'fullname':util['format'](_0xcb98('0x4'),_0xcb98('0x5'),i),'email':util[_0xcb98('0x3')](_0xcb98('0x6'),_0xcb98('0x5'),i),'role':_0xcb98('0x5'),'password':'password','internal':0xfa0+i,'type':_0xcb98('0x7'),'transport':[_0xcb98('0x8'),'ws',_0xcb98('0x9')],'disallow':[_0xcb98('0xa')],'allow':[_0xcb98('0xb')],'defaultuser':util[_0xcb98('0x3')](_0xcb98('0x4'),'agent',i),'encryption':_0xcb98('0xc'),'avpf':_0xcb98('0xc'),'force_avp':_0xcb98('0xc'),'icesupport':_0xcb98('0xc'),'dtlsenable':_0xcb98('0xc'),'dtlsverify':'no','dtlscertfile':_0xcb98('0xd'),'dtlsprivatekey':_0xcb98('0xe'),'dtlssetup':_0xcb98('0xf'),'callerid':util[_0xcb98('0x3')]('\x22%s\x22\x20<%s>',util[_0xcb98('0x3')](_0xcb98('0x4'),_0xcb98('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xcb98('0x10')](function(){console[_0xcb98('0x11')]('add\x20user');})[_0xcb98('0x12')](function(_0x55fc38){console[_0xcb98('0x11')](_0x55fc38);}); \ No newline at end of file +var _0x4ea7=['then','add\x20user','catch','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x5974bf,_0x1817bd){var _0x5bbd7b=function(_0x12ac37){while(--_0x12ac37){_0x5974bf['push'](_0x5974bf['shift']());}};_0x5bbd7b(++_0x1817bd);}(_0x4ea7,0xae));var _0x74ea=function(_0xaa9ce8,_0x512dd2){_0xaa9ce8=_0xaa9ce8-0x0;var _0x3271f6=_0x4ea7[_0xaa9ce8];return _0x3271f6;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x74ea('0x0')]({'name':util[_0x74ea('0x1')](_0x74ea('0x2'),_0x74ea('0x3'),i),'fullname':util[_0x74ea('0x1')](_0x74ea('0x2'),_0x74ea('0x3'),i),'email':util[_0x74ea('0x1')](_0x74ea('0x4'),_0x74ea('0x3'),i),'role':_0x74ea('0x3'),'password':_0x74ea('0x5'),'internal':0xfa0+i,'type':_0x74ea('0x6'),'transport':[_0x74ea('0x7'),'ws','wss'],'disallow':[_0x74ea('0x8')],'allow':['ulaw'],'defaultuser':util[_0x74ea('0x1')]('%s%s','agent',i),'encryption':_0x74ea('0x9'),'avpf':_0x74ea('0x9'),'force_avp':_0x74ea('0x9'),'icesupport':_0x74ea('0x9'),'dtlsenable':_0x74ea('0x9'),'dtlsverify':'no','dtlscertfile':_0x74ea('0xa'),'dtlsprivatekey':_0x74ea('0xb'),'dtlssetup':_0x74ea('0xc'),'callerid':util[_0x74ea('0x1')](_0x74ea('0xd'),util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x74ea('0xe')][_0x74ea('0xf')](users)[_0x74ea('0x10')](function(){console['log'](_0x74ea('0x11'));})[_0x74ea('0x12')](function(_0x32ac56){console['log'](_0x32ac56);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 72ca842..250e9ac 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b20=['map','where','type','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','SmsQueue','WhatsappQueue','user','OpenchannelQueues','Trunk','IvrCampaigns','Campaign','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','WhatsappQueues','Telephones','findAll','Trunks','UserProfileResource','resourceId'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x04b2('0x0'));var util=require(_0x04b2('0x1'));var BPromise=require(_0x04b2('0x2'));var db=require(_0x04b2('0x3'))['db'];var config=require(_0x04b2('0x4'));var queryQueues={'attributes':['id',_0x04b2('0x5')],'include':[{'as':_0x04b2('0x6'),'model':db[_0x04b2('0x7')],'attributes':['id',_0x04b2('0x5'),_0x04b2('0x8')],'raw':!![],'where':{'role':_0x04b2('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04b2('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x04b2('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x04b2('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x04b2('0x5'),'type'],'where':{'type':_0x04b2('0xb')}};function getAssociatedResources(_0x53212e,_0x291e02,_0x48387f){return db[_0x04b2('0xc')]['findOne']({'where':{'name':_0x53212e,'userProfileId':_0x291e02},'raw':!![]})[_0x04b2('0xd')](function(_0x28a212){if(_0x28a212){if(_0x28a212[_0x04b2('0xe')]){switch(_0x53212e){case _0x04b2('0xf'):case _0x04b2('0x10'):case'FaxQueues':case _0x04b2('0x11'):case _0x04b2('0x12'):case'OpenchannelQueues':case _0x04b2('0x13'):return db[_0x48387f]['findAll'](queryQueues);case _0x04b2('0x14'):return db[_0x48387f][_0x04b2('0x15')](queryTelephones);case _0x04b2('0x16'):return db[_0x48387f][_0x04b2('0x15')](queryTrunks);case'IvrCampaigns':return db[_0x48387f][_0x04b2('0x15')](queryCampaigns);}}else{return db[_0x04b2('0x17')]['findAll']({'attributes':[_0x04b2('0x18')],'where':{'sectionId':_0x28a212['id']},'raw':!![]})[_0x04b2('0xd')](function(_0x181c2d){if(_0x181c2d){var _0x49c773={'where':{'id':_[_0x04b2('0x19')](_0x181c2d,_0x04b2('0x18'))},'raw':!![]};switch(_0x48387f){case _0x04b2('0x7'):_0x49c773[_0x04b2('0x1a')][_0x04b2('0x8')]=_0x04b2('0xa');break;case'Campaign':_0x49c773['where'][_0x04b2('0x1b')]=_0x04b2('0xb');break;}return db[_0x48387f][_0x04b2('0x15')](_0x49c773);}else{return[];}});}}else{return[];}})[_0x04b2('0xd')](function(_0x24e5ff){return _0x24e5ff;});}function joinOrLeaveQueues(_0x6dc675,_0x1f6d1c,_0x11210c,_0x311b94){_0x6dc675[_0x1f6d1c](util[_0x04b2('0x1c')](_0x04b2('0x1d'),_0x11210c,_0x311b94[_0x04b2('0x5')]));if(_0x311b94['Agents']){for(var _0x3cbdd8=0x0;_0x3cbdd8<_0x311b94[_0x04b2('0x6')][_0x04b2('0x1e')];_0x3cbdd8+=0x1){_0x6dc675[_0x1f6d1c](util[_0x04b2('0x1c')](_0x04b2('0x1f'),_0x311b94[_0x04b2('0x6')][_0x3cbdd8][_0x04b2('0x5')]));}}}function joinOrLeave(_0x5599ec,_0x17a70a,_0x4eb4e3){var _0x1432b8;if(_0x5599ec[_0x04b2('0x20')][_0x04b2('0x21')]['id']){db['User'][_0x04b2('0x22')]({'attributes':['id',_0x04b2('0x5'),'role',_0x04b2('0x23')],'where':{'id':_0x5599ec[_0x04b2('0x20')][_0x04b2('0x21')]['id']},'include':[{'model':db[_0x04b2('0x24')],'as':_0x04b2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x27')],'as':_0x04b2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x29')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x2a')],'as':_0x04b2('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x04b2('0x2c')],'as':_0x04b2('0x2d'),'attributes':['id'],'raw':!![]}]})[_0x04b2('0xd')](function(_0x1f07c4){if(_0x1f07c4){_0x1432b8=_0x1f07c4;_0x5599ec[_0x17a70a](util['format']('user:%s',_0x1f07c4['name']));var _0x5228bf=[];switch(_0x1f07c4[_0x04b2('0x8')]){case _0x04b2('0x2e'):_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a](_0x04b2('0x30'));if(queryQueues[_0x04b2('0x31')]('include')){delete queryQueues[_0x04b2('0x32')];}_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x34')]['findAll'](queryQueues));_0x5228bf['push'](db['ChatQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['FaxQueue']['findAll'](queryQueues));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x35')][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['MailQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf['push'](db['OpenchannelQueue'][_0x04b2('0x15')](queryQueues));_0x5228bf['push'](db[_0x04b2('0x36')][_0x04b2('0x15')](queryQueues));_0x5228bf[_0x04b2('0x33')](db['User'][_0x04b2('0x15')](queryTelephones));_0x5228bf['push'](db['Trunk']['findAll'](queryTrunks));_0x5228bf[_0x04b2('0x33')](db['Campaign']['findAll'](queryCampaigns));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x7')]['findAll'](queryAgents));break;case _0x04b2('0x37'):_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a]('voice:outbound');_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0xf'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x34')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x10'),_0x1f07c4['userProfileId'],'ChatQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources('FaxQueues',_0x1f07c4[_0x04b2('0x23')],'FaxQueue'));_0x5228bf['push'](getAssociatedResources(_0x04b2('0x11'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x35')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x12'),_0x1f07c4[_0x04b2('0x23')],'MailQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x38'),_0x1f07c4[_0x04b2('0x23')],'OpenchannelQueue'));_0x5228bf[_0x04b2('0x33')](getAssociatedResources('WhatsappQueues',_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x36')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x14'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x7')));_0x5228bf[_0x04b2('0x33')](getAssociatedResources(_0x04b2('0x16'),_0x1f07c4['userProfileId'],_0x04b2('0x39')));_0x5228bf['push'](getAssociatedResources(_0x04b2('0x3a'),_0x1f07c4[_0x04b2('0x23')],_0x04b2('0x3b')));_0x5228bf[_0x04b2('0x33')](db[_0x04b2('0x7')][_0x04b2('0x15')](queryAgents));break;case'agent':_0x5599ec[_0x17a70a](_0x04b2('0x2f'));_0x5599ec[_0x17a70a](_0x04b2('0x30'));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3c')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3d')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4['getFaxQueues']({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3e')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x3f')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x40')]({'attributes':['id',_0x04b2('0x5')]}));_0x5228bf[_0x04b2('0x33')](_0x1f07c4[_0x04b2('0x41')]({'attributes':['id',_0x04b2('0x5')]}));break;}return BPromise[_0x04b2('0x42')](_0x5228bf);}})[_0x04b2('0xd')](function(_0x9a90f6){if(_0x9a90f6&&_0x9a90f6[_0x04b2('0x1e')]){for(var _0x4016f5=0x0;_0x4016f5<_0x9a90f6[_0x04b2('0x1e')];_0x4016f5+=0x1){for(var _0x3b5d26=0x0;_0x3b5d26<_0x9a90f6[_0x4016f5]['length'];_0x3b5d26+=0x1){switch(_0x4016f5){case 0x0:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x43'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x1:joinOrLeaveQueues(_0x5599ec,_0x17a70a,'chat',_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x2:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x44'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x3:joinOrLeaveQueues(_0x5599ec,_0x17a70a,'sms',_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x4:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x45'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x5:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x46'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x6:joinOrLeaveQueues(_0x5599ec,_0x17a70a,_0x04b2('0x47'),_0x9a90f6[_0x4016f5][_0x3b5d26]);break;case 0x7:if(_0x1432b8['role']!==_0x04b2('0x9'))_0x5599ec[_0x17a70a](util[_0x04b2('0x1c')](_0x04b2('0x48'),_0x9a90f6[_0x4016f5][_0x3b5d26]['name']));break;case 0x8:if(_0x1432b8[_0x04b2('0x8')]!=='agent')_0x5599ec[_0x17a70a](util['format']('trunk:%s',_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x5')]));break;case 0x9:if(_0x1432b8[_0x04b2('0x8')]!=='agent')_0x5599ec[_0x17a70a](util['format'](_0x04b2('0x49'),_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x1b')],_0x9a90f6[_0x4016f5][_0x3b5d26]['name']));break;case 0xa:_0x5599ec[_0x17a70a](util['format'](_0x04b2('0x1f'),_0x9a90f6[_0x4016f5][_0x3b5d26][_0x04b2('0x5')]));break;}}}}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0xe053a0=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x25')],'id');return _0x1432b8[_0x04b2('0x4b')](_0xe053a0)['then'](function(){for(var _0x6a8903=0x0;_0x6a8903<_0xe053a0[_0x04b2('0x1e')];_0x6a8903+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x4d'),{'ChatInteractionId':Number(_0xe053a0[_0x6a8903]),'UserId':Number(_0x1432b8['id'])});}});}})['then'](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x2412d5=_['map'](_0x1432b8['MailInteractions'],'id');return _0x1432b8['removeMailInteractions'](_0x2412d5)[_0x04b2('0xd')](function(){for(var _0x1e347b=0x0;_0x1e347b<_0x2412d5[_0x04b2('0x1e')];_0x1e347b+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x4e'),{'MailInteractionId':Number(_0x2412d5[_0x1e347b]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x2655ad=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x28')],'id');return _0x1432b8[_0x04b2('0x4f')](_0x2655ad)[_0x04b2('0xd')](function(){for(var _0x2b1bf1=0x0;_0x2b1bf1<_0x2655ad['length'];_0x2b1bf1+=0x1){_0x4eb4e3['emit'](_0x04b2('0x50'),{'FaxInteractionId':Number(_0x2655ad[_0x2b1bf1]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0xd55a40=_[_0x04b2('0x19')](_0x1432b8[_0x04b2('0x51')],'id');return _0x1432b8[_0x04b2('0x52')](_0xd55a40)[_0x04b2('0xd')](function(){for(var _0x22caf3=0x0;_0x22caf3<_0xd55a40['length'];_0x22caf3+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x53'),{'SmsInteractionId':Number(_0xd55a40[_0x22caf3]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a==='leave'){var _0x7eefb=_['map'](_0x1432b8['OpenchannelInteractions'],'id');return _0x1432b8[_0x04b2('0x54')](_0x7eefb)[_0x04b2('0xd')](function(){for(var _0x147c01=0x0;_0x147c01<_0x7eefb['length'];_0x147c01+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x55'),{'OpenchannelInteractionId':Number(_0x7eefb[_0x147c01]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0xd')](function(){if(_0x17a70a===_0x04b2('0x4a')){var _0x4dd7cf=_['map'](_0x1432b8[_0x04b2('0x2d')],'id');return _0x1432b8[_0x04b2('0x56')](_0x4dd7cf)[_0x04b2('0xd')](function(){for(var _0x3d110d=0x0;_0x3d110d<_0x4dd7cf[_0x04b2('0x1e')];_0x3d110d+=0x1){_0x4eb4e3[_0x04b2('0x4c')](_0x04b2('0x57'),{'WhatsappInteractionId':Number(_0x4dd7cf[_0x3d110d]),'UserId':Number(_0x1432b8['id'])});}});}})[_0x04b2('0x58')](function(_0x410a9d){_0x5599ec[_0x04b2('0x59')](_0x410a9d);});}}function onDisconnect(_0x16f422,_0x233fa1){joinOrLeave(_0x16f422,_0x04b2('0x4a'),_0x233fa1);}function onConnect(_0x455ad4){joinOrLeave(_0x455ad4,_0x04b2('0x5a'));}exports[_0x04b2('0x5b')]=function(_0x476065){_0x476065['on'](_0x04b2('0x5c'),function(_0x15f479){_0x15f479['setMaxListeners'](0x0);_0x15f479[_0x04b2('0x5d')]=_0x15f479[_0x04b2('0x5e')][_0x04b2('0x5c')][_0x04b2('0x5f')]+':'+_0x15f479[_0x04b2('0x5e')][_0x04b2('0x5c')][_0x04b2('0x60')];_0x15f479[_0x04b2('0x61')]=new Date();_0x15f479[_0x04b2('0x59')]=function(_0x11c53c){console[_0x04b2('0x59')](_0x04b2('0x62')+_0x15f479[_0x04b2('0x63')][_0x04b2('0x5')]+'['+_0x15f479[_0x04b2('0x5d')]+']',_0x11c53c);};_0x15f479['on'](_0x04b2('0x64'),function(){onDisconnect(_0x15f479,_0x476065);_0x15f479[_0x04b2('0x59')]('DISCONNECTED');});onConnect(_0x15f479);_0x15f479[_0x04b2('0x59')]('CONNECTED');});}; \ No newline at end of file +var _0x8be3=['type','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','request','remotePort','connectedAt','log','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','name','User','role','agent','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','Telephones','IvrCampaigns','findAll','resourceId','map','where','telephone','Campaign','ivr','format','%s:queue:%s','Agents','length','find','userProfileId','handshake','query','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueue','ChatQueues','MailQueues','MailQueue','OpenchannelQueues','WhatsappQueues','getVoiceQueues','getSmsQueues','voice','sms','mail','whatsapp','campaign:%s:%s'];(function(_0x21a2da,_0x9f4c2b){var _0x3ff5da=function(_0x216564){while(--_0x216564){_0x21a2da['push'](_0x21a2da['shift']());}};_0x3ff5da(++_0x9f4c2b);}(_0x8be3,0xd1));var _0x38be=function(_0x8956eb,_0x3ee779){_0x8956eb=_0x8956eb-0x0;var _0x14fbee=_0x8be3[_0x8956eb];return _0x14fbee;};'use strict';var _=require('lodash');var util=require(_0x38be('0x0'));var BPromise=require(_0x38be('0x1'));var db=require(_0x38be('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x38be('0x3')],'include':[{'as':'Agents','model':db[_0x38be('0x4')],'attributes':['id',_0x38be('0x3'),_0x38be('0x5')],'raw':!![],'where':{'role':_0x38be('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x38be('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x38be('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x38be('0x3')],'where':{'role':_0x38be('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x38be('0x3'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x414780,_0x23d271,_0x456a9f){return db[_0x38be('0x7')][_0x38be('0x8')]({'where':{'name':_0x414780,'userProfileId':_0x23d271},'raw':!![]})[_0x38be('0x9')](function(_0x5c1a1a){if(_0x5c1a1a){if(_0x5c1a1a[_0x38be('0xa')]){switch(_0x414780){case _0x38be('0xb'):case'ChatQueues':case _0x38be('0xc'):case _0x38be('0xd'):case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x456a9f]['findAll'](queryQueues);case _0x38be('0xe'):return db[_0x456a9f]['findAll'](queryTelephones);case'Trunks':return db[_0x456a9f]['findAll'](queryTrunks);case _0x38be('0xf'):return db[_0x456a9f][_0x38be('0x10')](queryCampaigns);}}else{return db['UserProfileResource'][_0x38be('0x10')]({'attributes':[_0x38be('0x11')],'where':{'sectionId':_0x5c1a1a['id']},'raw':!![]})[_0x38be('0x9')](function(_0x50263e){if(_0x50263e){var _0x16cb31={'where':{'id':_[_0x38be('0x12')](_0x50263e,'resourceId')},'raw':!![]};switch(_0x456a9f){case _0x38be('0x4'):_0x16cb31[_0x38be('0x13')][_0x38be('0x5')]=_0x38be('0x14');break;case _0x38be('0x15'):_0x16cb31[_0x38be('0x13')]['type']=_0x38be('0x16');break;}return db[_0x456a9f][_0x38be('0x10')](_0x16cb31);}else{return[];}});}}else{return[];}})[_0x38be('0x9')](function(_0x545ab1){return _0x545ab1;});}function joinOrLeaveQueues(_0x262248,_0x10bd3e,_0x12f654,_0x9bc9b0){_0x262248[_0x10bd3e](util[_0x38be('0x17')](_0x38be('0x18'),_0x12f654,_0x9bc9b0[_0x38be('0x3')]));if(_0x9bc9b0[_0x38be('0x19')]){for(var _0x429023=0x0;_0x429023<_0x9bc9b0[_0x38be('0x19')][_0x38be('0x1a')];_0x429023+=0x1){_0x262248[_0x10bd3e](util[_0x38be('0x17')]('user:%s',_0x9bc9b0[_0x38be('0x19')][_0x429023][_0x38be('0x3')]));}}}function joinOrLeave(_0xddf97c,_0x1f375a,_0x3b8c88){var _0x57a901;if(_0xddf97c['handshake']['query']['id']){db['User'][_0x38be('0x1b')]({'attributes':['id','name',_0x38be('0x5'),_0x38be('0x1c')],'where':{'id':_0xddf97c[_0x38be('0x1d')][_0x38be('0x1e')]['id']},'include':[{'model':db[_0x38be('0x1f')],'as':_0x38be('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x38be('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x38be('0x22')],'as':_0x38be('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x38be('0x24')],'as':_0x38be('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x38be('0x26')],'as':_0x38be('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x38be('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x28a828){if(_0x28a828){_0x57a901=_0x28a828;_0xddf97c[_0x1f375a](util['format'](_0x38be('0x29'),_0x28a828[_0x38be('0x3')]));var _0x1a704f=[];switch(_0x28a828['role']){case _0x38be('0x2a'):_0xddf97c[_0x1f375a](_0x38be('0x2b'));_0xddf97c[_0x1f375a](_0x38be('0x2c'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x38be('0x2d')];}_0x1a704f['push'](db['VoiceQueue'][_0x38be('0x10')](queryQueues));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x2f')]['findAll'](queryQueues));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x30')][_0x38be('0x10')](queryQueues));_0x1a704f['push'](db[_0x38be('0x31')][_0x38be('0x10')](queryQueues));_0x1a704f[_0x38be('0x2e')](db['MailQueue'][_0x38be('0x10')](queryQueues));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x32')]['findAll'](queryQueues));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x33')][_0x38be('0x10')](queryQueues));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x4')][_0x38be('0x10')](queryTelephones));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x34')]['findAll'](queryTrunks));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x15')][_0x38be('0x10')](queryCampaigns));_0x1a704f[_0x38be('0x2e')](db['User']['findAll'](queryAgents));break;case _0x38be('0x35'):_0xddf97c[_0x1f375a](_0x38be('0x2b'));_0xddf97c[_0x1f375a](_0x38be('0x2c'));_0x1a704f['push'](getAssociatedResources(_0x38be('0xb'),_0x28a828[_0x38be('0x1c')],_0x38be('0x36')));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0x37'),_0x28a828[_0x38be('0x1c')],_0x38be('0x2f')));_0x1a704f['push'](getAssociatedResources(_0x38be('0xc'),_0x28a828['userProfileId'],_0x38be('0x30')));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0xd'),_0x28a828['userProfileId'],_0x38be('0x31')));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0x38'),_0x28a828[_0x38be('0x1c')],_0x38be('0x39')));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0x3a'),_0x28a828[_0x38be('0x1c')],_0x38be('0x32')));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0x3b'),_0x28a828['userProfileId'],_0x38be('0x33')));_0x1a704f['push'](getAssociatedResources(_0x38be('0xe'),_0x28a828[_0x38be('0x1c')],'User'));_0x1a704f[_0x38be('0x2e')](getAssociatedResources('Trunks',_0x28a828[_0x38be('0x1c')],'Trunk'));_0x1a704f[_0x38be('0x2e')](getAssociatedResources(_0x38be('0xf'),_0x28a828[_0x38be('0x1c')],_0x38be('0x15')));_0x1a704f[_0x38be('0x2e')](db[_0x38be('0x4')][_0x38be('0x10')](queryAgents));break;case _0x38be('0x6'):_0xddf97c[_0x1f375a](_0x38be('0x2b'));_0xddf97c[_0x1f375a](_0x38be('0x2c'));_0x1a704f[_0x38be('0x2e')](_0x28a828[_0x38be('0x3c')]({'attributes':['id',_0x38be('0x3')]}));_0x1a704f[_0x38be('0x2e')](_0x28a828['getChatQueues']({'attributes':['id',_0x38be('0x3')]}));_0x1a704f[_0x38be('0x2e')](_0x28a828['getFaxQueues']({'attributes':['id',_0x38be('0x3')]}));_0x1a704f[_0x38be('0x2e')](_0x28a828[_0x38be('0x3d')]({'attributes':['id',_0x38be('0x3')]}));_0x1a704f['push'](_0x28a828['getMailQueues']({'attributes':['id',_0x38be('0x3')]}));_0x1a704f['push'](_0x28a828['getOpenchannelQueues']({'attributes':['id',_0x38be('0x3')]}));_0x1a704f[_0x38be('0x2e')](_0x28a828['getWhatsappQueues']({'attributes':['id',_0x38be('0x3')]}));break;}return BPromise['all'](_0x1a704f);}})[_0x38be('0x9')](function(_0x2f752b){if(_0x2f752b&&_0x2f752b[_0x38be('0x1a')]){for(var _0x18bb5b=0x0;_0x18bb5b<_0x2f752b[_0x38be('0x1a')];_0x18bb5b+=0x1){for(var _0x5697ff=0x0;_0x5697ff<_0x2f752b[_0x18bb5b][_0x38be('0x1a')];_0x5697ff+=0x1){switch(_0x18bb5b){case 0x0:joinOrLeaveQueues(_0xddf97c,_0x1f375a,_0x38be('0x3e'),_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x1:joinOrLeaveQueues(_0xddf97c,_0x1f375a,'chat',_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x2:joinOrLeaveQueues(_0xddf97c,_0x1f375a,'fax',_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x3:joinOrLeaveQueues(_0xddf97c,_0x1f375a,_0x38be('0x3f'),_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x4:joinOrLeaveQueues(_0xddf97c,_0x1f375a,_0x38be('0x40'),_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x5:joinOrLeaveQueues(_0xddf97c,_0x1f375a,'openchannel',_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x6:joinOrLeaveQueues(_0xddf97c,_0x1f375a,_0x38be('0x41'),_0x2f752b[_0x18bb5b][_0x5697ff]);break;case 0x7:if(_0x57a901[_0x38be('0x5')]!=='agent')_0xddf97c[_0x1f375a](util['format']('telephone:%s',_0x2f752b[_0x18bb5b][_0x5697ff][_0x38be('0x3')]));break;case 0x8:if(_0x57a901[_0x38be('0x5')]!=='agent')_0xddf97c[_0x1f375a](util['format']('trunk:%s',_0x2f752b[_0x18bb5b][_0x5697ff][_0x38be('0x3')]));break;case 0x9:if(_0x57a901[_0x38be('0x5')]!=='agent')_0xddf97c[_0x1f375a](util[_0x38be('0x17')](_0x38be('0x42'),_0x2f752b[_0x18bb5b][_0x5697ff][_0x38be('0x43')],_0x2f752b[_0x18bb5b][_0x5697ff]['name']));break;case 0xa:_0xddf97c[_0x1f375a](util[_0x38be('0x17')](_0x38be('0x29'),_0x2f752b[_0x18bb5b][_0x5697ff]['name']));break;}}}}})['then'](function(){if(_0x1f375a===_0x38be('0x44')){var _0x46223f=_[_0x38be('0x12')](_0x57a901[_0x38be('0x20')],'id');return _0x57a901['removeChatInteractions'](_0x46223f)[_0x38be('0x9')](function(){for(var _0x4ab5a2=0x0;_0x4ab5a2<_0x46223f[_0x38be('0x1a')];_0x4ab5a2+=0x1){_0x3b8c88[_0x38be('0x45')](_0x38be('0x46'),{'ChatInteractionId':Number(_0x46223f[_0x4ab5a2]),'UserId':Number(_0x57a901['id'])});}});}})['then'](function(){if(_0x1f375a==='leave'){var _0xb175f1=_['map'](_0x57a901[_0x38be('0x21')],'id');return _0x57a901[_0x38be('0x47')](_0xb175f1)[_0x38be('0x9')](function(){for(var _0x424b56=0x0;_0x424b56<_0xb175f1[_0x38be('0x1a')];_0x424b56+=0x1){_0x3b8c88['emit'](_0x38be('0x48'),{'MailInteractionId':Number(_0xb175f1[_0x424b56]),'UserId':Number(_0x57a901['id'])});}});}})['then'](function(){if(_0x1f375a===_0x38be('0x44')){var _0x3a3734=_[_0x38be('0x12')](_0x57a901[_0x38be('0x23')],'id');return _0x57a901[_0x38be('0x49')](_0x3a3734)[_0x38be('0x9')](function(){for(var _0x49e435=0x0;_0x49e435<_0x3a3734[_0x38be('0x1a')];_0x49e435+=0x1){_0x3b8c88[_0x38be('0x45')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3a3734[_0x49e435]),'UserId':Number(_0x57a901['id'])});}});}})['then'](function(){if(_0x1f375a===_0x38be('0x44')){var _0x28030c=_[_0x38be('0x12')](_0x57a901[_0x38be('0x25')],'id');return _0x57a901[_0x38be('0x4a')](_0x28030c)['then'](function(){for(var _0x1f08bc=0x0;_0x1f08bc<_0x28030c[_0x38be('0x1a')];_0x1f08bc+=0x1){_0x3b8c88[_0x38be('0x45')](_0x38be('0x4b'),{'SmsInteractionId':Number(_0x28030c[_0x1f08bc]),'UserId':Number(_0x57a901['id'])});}});}})[_0x38be('0x9')](function(){if(_0x1f375a===_0x38be('0x44')){var _0x264a2a=_['map'](_0x57a901[_0x38be('0x27')],'id');return _0x57a901[_0x38be('0x4c')](_0x264a2a)['then'](function(){for(var _0x2b152e=0x0;_0x2b152e<_0x264a2a[_0x38be('0x1a')];_0x2b152e+=0x1){_0x3b8c88[_0x38be('0x45')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x264a2a[_0x2b152e]),'UserId':Number(_0x57a901['id'])});}});}})[_0x38be('0x9')](function(){if(_0x1f375a===_0x38be('0x44')){var _0x4da96f=_[_0x38be('0x12')](_0x57a901[_0x38be('0x28')],'id');return _0x57a901['removeWhatsappInteractions'](_0x4da96f)[_0x38be('0x9')](function(){for(var _0x170597=0x0;_0x170597<_0x4da96f[_0x38be('0x1a')];_0x170597+=0x1){_0x3b8c88[_0x38be('0x45')](_0x38be('0x4d'),{'WhatsappInteractionId':Number(_0x4da96f[_0x170597]),'UserId':Number(_0x57a901['id'])});}});}})[_0x38be('0x4e')](function(_0x2b31fb){_0xddf97c['log'](_0x2b31fb);});}}function onDisconnect(_0x15c60d,_0x540a1d){joinOrLeave(_0x15c60d,'leave',_0x540a1d);}function onConnect(_0x6425a5){joinOrLeave(_0x6425a5,_0x38be('0x4f'));}exports[_0x38be('0x50')]=function(_0x58a318){_0x58a318['on'](_0x38be('0x51'),function(_0x1f09c7){_0x1f09c7['setMaxListeners'](0x0);_0x1f09c7['address']=_0x1f09c7[_0x38be('0x52')][_0x38be('0x51')]['remoteAddress']+':'+_0x1f09c7[_0x38be('0x52')][_0x38be('0x51')][_0x38be('0x53')];_0x1f09c7[_0x38be('0x54')]=new Date();_0x1f09c7[_0x38be('0x55')]=function(_0x5e2d34){console[_0x38be('0x55')](_0x38be('0x56')+_0x1f09c7[_0x38be('0x57')][_0x38be('0x3')]+'['+_0x1f09c7[_0x38be('0x58')]+']',_0x5e2d34);};_0x1f09c7['on'](_0x38be('0x59'),function(){onDisconnect(_0x1f09c7,_0x58a318);_0x1f09c7[_0x38be('0x55')](_0x38be('0x5a'));});onConnect(_0x1f09c7);_0x1f09c7[_0x38be('0x55')](_0x38be('0x5b'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index bb23b13..e7a922e 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 _0x4b6f=['fullname','email','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','jayson/promise','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','motionChannel','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','UserId','undefined','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','interface','changed','closed','substatus','query','Sequelize','AfterUpdate','User'];(function(_0x40971c,_0x163458){var _0x411c0b=function(_0x1c96e5){while(--_0x1c96e5){_0x40971c['push'](_0x40971c['shift']());}};_0x411c0b(++_0x163458);}(_0x4b6f,0x97));var _0xf4b6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4b6f[_0x209941];return _0x1e8729;};'use strict';var util=require(_0xf4b6('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf4b6('0x1'));var logger=require('../logger')(_0xf4b6('0x2'));var client=jayson[_0xf4b6('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0xf4b6('0x4'),'model':_0xf4b6('0x5'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0x7'),'callback':afterCreate},{'channel':_0xf4b6('0x4'),'model':_0xf4b6('0x5'),'event':'afterUpdate','condition':_0xf4b6('0x8'),'callback':afterUpdate},{'channel':_0xf4b6('0x4'),'model':_0xf4b6('0x9'),'event':'afterCreate','condition':_0xf4b6('0xa'),'callback':afterCreateMessage},{'channel':_0xf4b6('0x4'),'model':_0xf4b6('0xb'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0xa'),'callback':afterCreateOfflineMessage},{'channel':_0xf4b6('0xc'),'model':_0xf4b6('0xd'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0x7'),'callback':afterCreate},{'channel':_0xf4b6('0xc'),'model':_0xf4b6('0xd'),'event':_0xf4b6('0xe'),'condition':_0xf4b6('0x8'),'callback':afterUpdate},{'channel':_0xf4b6('0xc'),'model':_0xf4b6('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf4b6('0x10'),'model':'WhatsappInteraction','event':_0xf4b6('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xf4b6('0x10'),'model':_0xf4b6('0x11'),'event':_0xf4b6('0xe'),'condition':_0xf4b6('0x8'),'callback':afterUpdate},{'channel':_0xf4b6('0x10'),'model':_0xf4b6('0x12'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0xa'),'callback':afterCreateMessage},{'channel':_0xf4b6('0x13'),'model':'FaxInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xf4b6('0x13'),'model':'FaxInteraction','event':_0xf4b6('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf4b6('0x13'),'model':'FaxMessage','event':_0xf4b6('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xf4b6('0x14'),'model':_0xf4b6('0x15'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0x7'),'callback':afterCreate},{'channel':_0xf4b6('0x14'),'model':_0xf4b6('0x15'),'event':_0xf4b6('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf4b6('0x14'),'model':'MailMessage','event':_0xf4b6('0x6'),'condition':_0xf4b6('0xa'),'callback':afterCreateMessage},{'channel':_0xf4b6('0x16'),'model':_0xf4b6('0x17'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0xf4b6('0xe'),'condition':_0xf4b6('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xf4b6('0x18'),'event':_0xf4b6('0x6'),'condition':_0xf4b6('0xa'),'callback':afterCreateMessage}];function request(_0x22669a){return client[_0xf4b6('0x19')](_0xf4b6('0x1a'),_0x22669a)[_0xf4b6('0x1b')](function(_0x4d6c45){logger['info'](_0xf4b6('0x1c'),_0xf4b6('0x1a'),_0x4d6c45);if(_0x4d6c45[_0xf4b6('0x1d')]){if(_0x4d6c45[_0xf4b6('0x1d')][_0xf4b6('0x1e')]===0x1f4){logger['error'](_0xf4b6('0x1c'),_0xf4b6('0x1a'),_0x4d6c45[_0xf4b6('0x1d')]);}}})[_0xf4b6('0x1f')](function(_0x2959ca){logger['error'](_0xf4b6('0x1c'),_0xf4b6('0x1a'),_0x2959ca);});}function afterCreateMessage(_0x101d4b){return function(_0x2d595b){_0x2d595b=_0x2d595b[_0xf4b6('0x20')]({'plain':!![]});_0x2d595b['channel']=_0x101d4b;_0x2d595b[_0xf4b6('0x21')]=_0x101d4b;_0x2d595b[_0xf4b6('0x22')]=_0x2d595b[_0xf4b6('0x23')];Promise[_0xf4b6('0x24')]()[_0xf4b6('0x1b')](function(){if(typeof _0x2d595b[_0xf4b6('0x25')]==='undefined')return null;var _0x5a06b9=_0xf4b6('0x26')+_0x2d595b[_0xf4b6('0x25')];return db[_0xf4b6('0x27')]['query'](_0x5a06b9,{'type':db['Sequelize'][_0xf4b6('0x28')][_0xf4b6('0x29')],'raw':!![]});})[_0xf4b6('0x1b')](function(_0x1ea66a){if(_0x1ea66a){_0x2d595b[_0xf4b6('0x2a')]=_0x1ea66a[0x0];}if(typeof _0x2d595b[_0xf4b6('0x2b')]===_0xf4b6('0x2c'))return;return getAgent(_0x2d595b['UserId']);})[_0xf4b6('0x1b')](function(_0x25fb46){if(_0x25fb46){_0x2d595b['interface']=util[_0xf4b6('0x2d')](_0xf4b6('0x2e'),_0x25fb46[_0xf4b6('0x2f')]);_0x2d595b[_0xf4b6('0x30')]=_0x25fb46;_0x2d595b[_0xf4b6('0x31')]=_0x101d4b;return request({'event':_0xf4b6('0x32'),'message':_0x2d595b});}else{return request({'event':_0xf4b6('0x33'),'message':_0x2d595b});}})[_0xf4b6('0x1f')](function(_0x5adc89){logger[_0xf4b6('0x1d')](_0xf4b6('0x1c'),_0xf4b6('0x34'),_0x5adc89);});};}function afterCreateOfflineMessage(_0x538b7f){return function(_0x20fa30){_0x20fa30=_0x20fa30[_0xf4b6('0x20')]({'plain':!![]});_0x20fa30[_0xf4b6('0x31')]=_0x538b7f;_0x20fa30[_0xf4b6('0x21')]=_0x538b7f;_0x20fa30[_0xf4b6('0x22')]=_0xf4b6('0x35');return request({'event':_0x20fa30[_0xf4b6('0x22')],'message':_0x20fa30});};}function afterCreate(_0x5e4f8e,_0x112fe4){return function(_0x3f434a){_0x3f434a=_0x3f434a['get']({'plain':!![]});_0x3f434a[_0xf4b6('0x31')]=_0x5e4f8e;_0x3f434a[_0xf4b6('0x21')]=_0x5e4f8e;_0x3f434a[_0xf4b6('0x22')]='opened';Promise[_0xf4b6('0x24')]()[_0xf4b6('0x1b')](function(){var _0x5a289f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f434a[_0xf4b6('0x25')];return db['sequelize']['query'](_0x5a289f,{'type':db['Sequelize']['QueryTypes'][_0xf4b6('0x29')],'raw':!![]});})[_0xf4b6('0x1b')](function(_0x3e0d4d){if(_0x3e0d4d){_0x3f434a[_0xf4b6('0x2a')]=_0x3e0d4d[0x0];}if(typeof _0x3f434a[_0xf4b6('0x2b')]===_0xf4b6('0x2c'))return;return getAgent(_0x3f434a['UserId']);})[_0xf4b6('0x1b')](function(_0x8c29b5){if(_0x8c29b5){_0x3f434a[_0xf4b6('0x36')]=util['format'](_0xf4b6('0x2e'),_0x8c29b5[_0xf4b6('0x2f')]);_0x3f434a[_0xf4b6('0x30')]=_0x8c29b5;}return request({'event':_0x112fe4,'message':_0x3f434a});})[_0xf4b6('0x1f')](function(_0x1fed05){logger['error'](_0xf4b6('0x1c'),'AfterCreate',_0x1fed05);});};}function afterUpdate(_0xb20217){return function(_0x1dcfc7){var _0x3bceae=_0x1dcfc7[_0xf4b6('0x37')](_0xf4b6('0x38'))&&_0x1dcfc7[_0xf4b6('0x38')];var _0x344a84=_0x1dcfc7[_0xf4b6('0x37')](_0xf4b6('0x39'));if(_0x3bceae||_0x344a84){var _0xd00fb6=_0x3bceae?_0xf4b6('0x8'):'substatus';var _0x34add9=_0x1dcfc7[_0xf4b6('0x20')]({'plain':!![]});_0x34add9['channel']=_0xb20217;_0x34add9[_0xf4b6('0x21')]=_0xb20217;_0x34add9[_0xf4b6('0x22')]=_0x3bceae?_0xf4b6('0x38'):_0xf4b6('0x39');var _0x4211b6=_0xf4b6('0x26')+_0x34add9[_0xf4b6('0x25')];return db[_0xf4b6('0x27')][_0xf4b6('0x3a')](_0x4211b6,{'type':db[_0xf4b6('0x3b')][_0xf4b6('0x28')][_0xf4b6('0x29')],'raw':!![]})[_0xf4b6('0x1b')](function(_0x3899fc){if(_0x3899fc){_0x34add9[_0xf4b6('0x2a')]=_0x3899fc[0x0];}if(typeof _0x34add9[_0xf4b6('0x2b')]==='undefined')return;return getAgent(_0x34add9[_0xf4b6('0x2b')]);})['then'](function(_0x3d060a){if(_0x3d060a){_0x34add9[_0xf4b6('0x36')]=util[_0xf4b6('0x2d')](_0xf4b6('0x2e'),_0x3d060a[_0xf4b6('0x2f')]);_0x34add9['agent']=_0x3d060a;}return request({'event':_0xd00fb6,'message':_0x34add9});})[_0xf4b6('0x1f')](function(_0x20d51d){logger[_0xf4b6('0x1d')](_0xf4b6('0x1c'),_0xf4b6('0x3c'),_0x20d51d);});}};}function getAgent(_0x295e5e){return db[_0xf4b6('0x3d')]['find']({'where':{'id':_0x295e5e},'attributes':['id',_0xf4b6('0x2f'),_0xf4b6('0x3e'),_0xf4b6('0x3f'),'internal'],'raw':!![]})['then'](function(_0x341c70){return _0x341c70;});}exports[_0xf4b6('0x40')]=function(){for(var _0x352706=0x0;_0x352706=_0x57c740[_0xc542('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0xbf9e5d(_0x52f247);})[_0xc542('0x15')](function(_0x143d56){_0x5da116(_0x143d56);});});}; \ No newline at end of file +var _0xe44a=['chat','fax','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','User','agent','then','agents','catch','bluebird','../mysqldb','./license/util','voice','mail'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe44a,0xa3));var _0xae44=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe44a[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var BPromise=require(_0xae44('0x0'));var db=require(_0xae44('0x1'))['db'];var util=require(_0xae44('0x2'));var channels=[_0xae44('0x3'),_0xae44('0x4'),_0xae44('0x5'),_0xae44('0x6'),'sms',_0xae44('0x7'),_0xae44('0x8')];exports[_0xae44('0x9')]=function(){return channels;};exports[_0xae44('0xa')]=function(_0x54711a){_0x54711a=_0x54711a[_0xae44('0xb')]();return _[_0xae44('0xc')](channels,_0x54711a);};exports[_0xae44('0xd')]=function(_0x27ac7b,_0x213a37,_0x237b60,_0x211202){var _0x976b6e={'loginAttempts':_0x213a37,'blocked':_0x237b60};if(!_[_0xae44('0xe')](_0x211202)){_0x976b6e[_0xae44('0xf')]=_0x211202;}return _0x27ac7b[_0xae44('0x10')](_0x976b6e);};exports[_0xae44('0x11')]=function(_0x5ae9c8){return new BPromise(function(_0x460e4c,_0x20a5c8){var _0x5536ea=0x0;if(_0x5ae9c8[_0xae44('0x12')]!=='agent'){_0x460e4c(_0x5ae9c8);}db[_0xae44('0x13')]['count']({'where':{'role':_0xae44('0x14'),'online':!![],'id':{'$ne':_0x5ae9c8['id']}}})[_0xae44('0x15')](function(_0x1dfd7b){_0x5536ea=_0x1dfd7b;return util[_0xae44('0x11')]();})[_0xae44('0x15')](function(_0x5464c5){if(_0x5464c5&&_0x5464c5[_0xae44('0x16')]&&_0x5536ea>=_0x5464c5[_0xae44('0x16')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x460e4c(_0x5ae9c8);})[_0xae44('0x17')](function(_0x139478){_0x20a5c8(_0x139478);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 2328d84..c8f9ec7 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','stack','name','status','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x5b1c50,_0x56e694){var _0x2d379b=function(_0x981b9c){while(--_0x981b9c){_0x5b1c50['push'](_0x5b1c50['shift']());}};_0x2d379b(++_0x56e694);}(_0x5b02,0xe9));var _0x25b0=function(_0x26054b,_0x422fbc){_0x26054b=_0x26054b-0x0;var _0x49aef6=_0x5b02[_0x26054b];return _0x49aef6;};'use strict';var util=require(_0x25b0('0x0'));var logger=require(_0x25b0('0x1'))(_0x25b0('0x2'));var APIError=function(_0x1c3295,_0x4ef71c){this['message']=_0x1c3295||_0x25b0('0x3');this['name']=_0x4ef71c||_0x25b0('0x4');util[_0x25b0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x38dc14){this[_0x25b0('0x6')]=_0x38dc14||_0x25b0('0x7');this['name']=_0x25b0('0x7');util[_0x25b0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x49ef3a){this[_0x25b0('0x6')]=_0x49ef3a||'Entity\x20not\x20found';this['name']=_0x25b0('0x8');util[_0x25b0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x358af0){switch(_0x358af0){case'Bad\x20Request':return 0x190;case _0x25b0('0x9'),_0x25b0('0xa'):return 0x193;case _0x25b0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x250d31){return function(_0x2c72f3){logger[_0x25b0('0xb')](_0x2c72f3[_0x25b0('0xc')]);var _0x10c3fb=getStatusCode(_0x2c72f3[_0x25b0('0xd')]);if(_0x2c72f3[_0x25b0('0xd')])delete _0x2c72f3[_0x25b0('0xd')];return _0x250d31[_0x25b0('0xe')](_0x10c3fb)[_0x25b0('0xf')](_0x2c72f3);};}module[_0x25b0('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x8b4963,_0x5ae6ff){var _0x2c4582=function(_0x21f082){while(--_0x21f082){_0x8b4963['push'](_0x8b4963['shift']());}};_0x2c4582(++_0x5ae6ff);}(_0xb821,0xa7));var _0x1b82=function(_0x1012fe,_0x49089b){_0x1012fe=_0x1012fe-0x0;var _0x4f9d94=_0xb821[_0x1012fe];return _0x4f9d94;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('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 47cff64..dc2f64f 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x858f=['404','status','render','json','send'];(function(_0x34951f,_0x277327){var _0x487db1=function(_0x452a5f){while(--_0x452a5f){_0x34951f['push'](_0x34951f['shift']());}};_0x487db1(++_0x277327);}(_0x858f,0xeb));var _0xf858=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x858f[_0x207a02];return _0xd995c3;};'use strict';module['exports'][0x194]=function pageNotFound(_0x5b2688,_0x41837d){var _0x521dba=_0xf858('0x0');var _0x3998e4=0x194;var _0x3ded64={'status':_0x3998e4};_0x41837d[_0xf858('0x1')](_0x3ded64['status']);_0x41837d[_0xf858('0x2')](_0x521dba,{},function(_0x3463f0,_0x4f6d8c){if(_0x3463f0){return _0x41837d[_0xf858('0x1')](_0x3ded64['status'])[_0xf858('0x3')](_0x3ded64);}_0x41837d[_0xf858('0x4')](_0x4f6d8c);});}; \ No newline at end of file +var _0xc193=['json','exports','status','render'];(function(_0x2682ec,_0x44632b){var _0x564dcf=function(_0x1fe3c5){while(--_0x1fe3c5){_0x2682ec['push'](_0x2682ec['shift']());}};_0x564dcf(++_0x44632b);}(_0xc193,0xc1));var _0x3c19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc193[_0x2641f9];return _0x585741;};'use strict';module[_0x3c19('0x0')][0x194]=function pageNotFound(_0x45f920,_0x58ba32){var _0x4fc563='404';var _0x47b190=0x194;var _0x4c8829={'status':_0x47b190};_0x58ba32['status'](_0x4c8829[_0x3c19('0x1')]);_0x58ba32[_0x3c19('0x2')](_0x4fc563,{},function(_0x1245e3,_0x32cd5b){if(_0x1245e3){return _0x58ba32[_0x3c19('0x1')](_0x4c8829[_0x3c19('0x1')])[_0x3c19('0x3')](_0x4c8829);}_0x58ba32['send'](_0x32cd5b);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 87bf151..1ba57d8 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcab1=['../api/trunk/trunk.model','VoiceTransferReport','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','Cdr','Schedule','../api/schedule/schedule.model','Tag','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','Team','../api/license/license.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','userSetting','cascade','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','CmContact','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceMusicOnHold','Sound','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','HopperBlacks','Trunk','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','Teams','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','Account','TagId','MailQueueReport','FaxApplication','Applications','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','SmsAccountId','SmsMessage','SmsApplication','mandatoryDispositionPauseId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','Contacts','Phones','HopperHistories','JscriptySessions','Company','CompanyId','cm_contact_has_tags','CmHopperId','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','AutomationAnyId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','Mohs','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','CmHopperAdditionalPhone','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','AccountId','SugarcrmField','int_desk_configuration_has_tags','ZendeskConfiguration','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FromId','ToId','JscriptyQuestionReport','SessionId','ProjectId','VoiceQueues','team_has_fax_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProject','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Queues','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model'];(function(_0x256da0,_0x2d1a68){var _0x34d171=function(_0x104f60){while(--_0x104f60){_0x256da0['push'](_0x256da0['shift']());}};_0x34d171(++_0x2d1a68);}(_0xcab1,0x1d2));var _0x1cab=function(_0x4484d9,_0xd84f88){_0x4484d9=_0x4484d9-0x0;var _0x57f5cf=_0xcab1[_0x4484d9];return _0x57f5cf;};'use strict';var config=require(_0x1cab('0x0'));var Sequelize=require('sequelize');var _=require(_0x1cab('0x1'));var jstz=require(_0x1cab('0x2'));var timezone=jstz[_0x1cab('0x3')]();config['sequelize']=_[_0x1cab('0x4')](config[_0x1cab('0x5')],{'database':_0x1cab('0x6'),'username':_0x1cab('0x7'),'password':_0x1cab('0x8'),'options':{'host':_0x1cab('0x9'),'port':0xcea,'dialect':_0x1cab('0xa'),'dialectOptions':{'charset':_0x1cab('0xb')},'logging':![],'timezone':timezone[_0x1cab('0xc')](),'define':{'charset':_0x1cab('0xd'),'collate':_0x1cab('0xe')}}});config[_0x1cab('0xf')]=_[_0x1cab('0x4')](config['sequelizeHistory'],{'database':_0x1cab('0x6'),'username':_0x1cab('0x7'),'password':_0x1cab('0x8'),'options':{'host':_0x1cab('0x9'),'port':0xcea,'dialect':_0x1cab('0xa'),'dialectOptions':{'charset':_0x1cab('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x1cab('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x1cab('0x10')],config['sequelize'][_0x1cab('0x11')],config['sequelize']['password'],config[_0x1cab('0x5')][_0x1cab('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1cab('0xf')][_0x1cab('0x10')],config[_0x1cab('0xf')]['username'],config[_0x1cab('0xf')][_0x1cab('0x13')],config[_0x1cab('0xf')][_0x1cab('0x12')])};db[_0x1cab('0x14')]=db['sequelize']['import'](_0x1cab('0x15'));db['VoiceChanSpy']=db[_0x1cab('0x5')]['import'](_0x1cab('0x16'));db[_0x1cab('0x17')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/voiceContext/voiceContext.model');db[_0x1cab('0x19')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x1a'));db['VoiceMusicOnHold']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x1cab('0x1b')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x1c'));db[_0x1cab('0x1d')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x1e'));db['ScreenRecording']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/screenRecording/screenRecording.model');db[_0x1cab('0x1f')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/voiceMail/voiceMail.model');db[_0x1cab('0x20')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x21'));db[_0x1cab('0x22')]=db['sequelize'][_0x1cab('0x18')]('../api/voiceCallReport/voiceCallReport.model');db[_0x1cab('0x23')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x24'));db[_0x1cab('0x25')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x26'));db[_0x1cab('0x27')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x28'));db[_0x1cab('0x29')]=db['sequelize']['import'](_0x1cab('0x2a'));db['Trunk']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x2b'));db[_0x1cab('0x2c')]=db[_0x1cab('0x5')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x1cab('0x5')]['import'](_0x1cab('0x2d'));db[_0x1cab('0x2e')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x2f'));db[_0x1cab('0x30')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x31'));db[_0x1cab('0x32')]=db[_0x1cab('0x5')]['import'](_0x1cab('0x33'));db[_0x1cab('0x34')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x35'));db[_0x1cab('0x36')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x37'));db[_0x1cab('0x38')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x39'));db['UserWhatsappQueue']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x3a'));db[_0x1cab('0x3b')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x3c'));db['MailServerOut']=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x3d'));db[_0x1cab('0x3e')]=db[_0x1cab('0x5')]['import']('../api/mailAccount/mailAccount.model');db[_0x1cab('0x3f')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x40'));db[_0x1cab('0x41')]=db[_0x1cab('0x5')]['import'](_0x1cab('0x42'));db[_0x1cab('0x43')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/mailInteraction/mailInteraction.model');db[_0x1cab('0x44')]=db[_0x1cab('0x5')]['import']('../api/mailMessage/mailMessage.model');db[_0x1cab('0x45')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x46'));db['MailQueueReport']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/mailQueueReport/mailQueueReport.model');db[_0x1cab('0x47')]=db[_0x1cab('0x5')]['import']('../api/dashboard/dashboard.model');db[_0x1cab('0x48')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x49'));db[_0x1cab('0x4a')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x4b'));db['FaxApplication']=db[_0x1cab('0x5')]['import'](_0x1cab('0x4c'));db[_0x1cab('0x4d')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x4e'));db['FaxMessage']=db[_0x1cab('0x5')]['import'](_0x1cab('0x4f'));db['FaxQueue']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x50'));db[_0x1cab('0x51')]=db['sequelize'][_0x1cab('0x18')]('../api/faxQueueReport/faxQueueReport.model');db[_0x1cab('0x52')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x53'));db[_0x1cab('0x54')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x55'));db['SmsMessage']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x56'));db[_0x1cab('0x57')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x58'));db['OpenchannelAccount']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x59'));db[_0x1cab('0x5a')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x5b'));db['OpenchannelInteraction']=db[_0x1cab('0x5')]['import'](_0x1cab('0x5c'));db['OpenchannelMessage']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x5d'));db[_0x1cab('0x5e')]=db['sequelize']['import'](_0x1cab('0x5f'));db[_0x1cab('0x60')]=db['sequelize']['import'](_0x1cab('0x61'));db[_0x1cab('0x62')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x63'));db[_0x1cab('0x64')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x65'));db['ChatInteraction']=db['sequelize'][_0x1cab('0x18')]('../api/chatInteraction/chatInteraction.model');db[_0x1cab('0x66')]=db[_0x1cab('0x5')]['import']('../api/chatMessage/chatMessage.model');db[_0x1cab('0x67')]=db[_0x1cab('0x5')]['import'](_0x1cab('0x68'));db[_0x1cab('0x69')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x6a'));db['ChatGroup']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x6b'));db[_0x1cab('0x6c')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x6d'));db[_0x1cab('0x6e')]=db[_0x1cab('0x5')]['import'](_0x1cab('0x6f'));db['CmContact']=db[_0x1cab('0x5')]['import'](_0x1cab('0x70'));db[_0x1cab('0x71')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x72'));db[_0x1cab('0x73')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x74'));db[_0x1cab('0x75')]=db['sequelize'][_0x1cab('0x18')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x1cab('0x76')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x77'));db[_0x1cab('0x78')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x79'));db[_0x1cab('0x7a')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/action/action.model');db[_0x1cab('0x7b')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x7c'));db[_0x1cab('0x7d')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x7e'));db[_0x1cab('0x7f')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x80'));db['Condition']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/condition/condition.model');db[_0x1cab('0x81')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x82'));db[_0x1cab('0x83')]=db['sequelize'][_0x1cab('0x18')]('../api/pause/pause.model');db[_0x1cab('0x84')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x1cab('0x85')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x86'));db['Sound']=db['sequelize'][_0x1cab('0x18')]('../api/sound/sound.model');db[_0x1cab('0x87')]=db[_0x1cab('0x5')]['import']('../api/tag/tag.model');db['ContactItemType']=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x88'));db[_0x1cab('0x89')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/cmContactHasItem/cmContactHasItem.model');db['CmHopperAdditionalPhone']=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x8a'));db['Template']=db[_0x1cab('0x5')]['import'](_0x1cab('0x8b'));db[_0x1cab('0x8c')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x8d'));db[_0x1cab('0x8e')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x8f'));db[_0x1cab('0x90')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x91'));db[_0x1cab('0x92')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x93'));db['AnalyticCustomReport']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x94'));db[_0x1cab('0x95')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x1cab('0x96')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x97'));db[_0x1cab('0x98')]=db[_0x1cab('0x5')]['import'](_0x1cab('0x99'));db['AnalyticFieldReport']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x1cab('0x5')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x1cab('0x9a')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x9b'));db[_0x1cab('0x9c')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x9d'));db[_0x1cab('0x9e')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x9f'));db[_0x1cab('0xa0')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xa1'));db[_0x1cab('0xa2')]=db[_0x1cab('0x5')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xa3'));db[_0x1cab('0xa4')]=db['sequelize']['import'](_0x1cab('0xa5'));db[_0x1cab('0xa6')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xa7'));db[_0x1cab('0xa8')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intDeskField/intDeskField.model');db[_0x1cab('0xa9')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intZohoAccount/intZohoAccount.model');db[_0x1cab('0xaa')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x1cab('0xab')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xac'));db['ZendeskAccount']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xad'));db['ZendeskConfiguration']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xae'));db[_0x1cab('0xaf')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xb0'));db[_0x1cab('0xb1')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x1cab('0xb2')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xb3'));db[_0x1cab('0xb4')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xb5'));db[_0x1cab('0xb6')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xb7'));db[_0x1cab('0xb8')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x1cab('0xb9')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xba'));db[_0x1cab('0xbb')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xbc'));db[_0x1cab('0xbd')]=db[_0x1cab('0x5')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x1cab('0xbe')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xbf'));db[_0x1cab('0xc0')]=db[_0x1cab('0x5')]['import'](_0x1cab('0xc1'));db[_0x1cab('0xc2')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xc3'));db[_0x1cab('0xc4')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xc5'));db[_0x1cab('0xc6')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x1cab('0xc7')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x1cab('0xc8')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xc9'));db[_0x1cab('0x90')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/integration/integration.model');db[_0x1cab('0xca')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xcb'));db[_0x1cab('0xcc')]=db['sequelize']['import'](_0x1cab('0xcd'));db[_0x1cab('0xce')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xcf'));db[_0x1cab('0xd0')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xd1'));db['JscriptyQuestionReport']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x1cab('0xd2')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xd3'));db[_0x1cab('0xd4')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xd5'));db[_0x1cab('0xd6')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db[_0x1cab('0xd7')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/squareReportDetail/squareReportDetail.model');db[_0x1cab('0xd8')]=db[_0x1cab('0x5')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xd9'));db['SquareOdbc']=db[_0x1cab('0x5')]['import'](_0x1cab('0xda'));db['SquareProject']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xdb'));db[_0x1cab('0xdc')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/squareMessage/squareMessage.model');db[_0x1cab('0xdd')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/team/team.model');db['License']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xde'));db['Campaign']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/campaign/campaign.model');db['Migration']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xdf'));db['Attachment']=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x1cab('0xe0')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xe1'));db[_0x1cab('0xe2')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xe3'));db[_0x1cab('0xe4')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/chatTransferReport/chatTransferReport.model');db[_0x1cab('0xe5')]=db[_0x1cab('0x5')]['import'](_0x1cab('0xe6'));db['OpenchannelTransferReport']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xe7'));db[_0x1cab('0xe8')]=db[_0x1cab('0x5')]['import'](_0x1cab('0xe9'));db[_0x1cab('0xea')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/cmList/cmList.model');db[_0x1cab('0xeb')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xec'));db[_0x1cab('0xed')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xee'));db['UserProfileSection']=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/userProfileSection/userProfileSection.model');db[_0x1cab('0xef')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xf0'));db['UserNotification']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xf1'));db['WhatsappAccount']=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xf2'));db[_0x1cab('0xf3')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xf4'));db[_0x1cab('0xf5')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0xf6'));db[_0x1cab('0xf7')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xf8'));db[_0x1cab('0xf9')]=db[_0x1cab('0x5')]['import'](_0x1cab('0xfa'));db[_0x1cab('0xfb')]=db[_0x1cab('0x5')]['import'](_0x1cab('0xfc'));db[_0x1cab('0xfd')]=db[_0x1cab('0x5')][_0x1cab('0x18')]('../api/whatsappQueue/whatsappQueue.model');db[_0x1cab('0xfe')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0xff'));db['TeamVoiceQueue']=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x100'));db[_0x1cab('0x101')]=db['sequelize'][_0x1cab('0x18')](_0x1cab('0x102'));db[_0x1cab('0x103')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x104'));db[_0x1cab('0x105')]=db[_0x1cab('0x5')][_0x1cab('0x18')](_0x1cab('0x106'));db[_0x1cab('0x14')][_0x1cab('0x107')](db['VoiceMail'],{'as':_0x1cab('0x1f'),'onDelete':'cascade','foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x107')](db[_0x1cab('0x105')],{'as':_0x1cab('0x109'),'onDelete':_0x1cab('0x10a'),'foreignKey':'UserId'});db[_0x1cab('0x14')]['hasMany'](db[_0x1cab('0x1d')],{'as':'Recordings','foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0x10c')],{'as':_0x1cab('0x10d'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0x19')],{'as':_0x1cab('0x10e'),'onDelete':_0x1cab('0x10a'),'hooks':!![]});db[_0x1cab('0x14')][_0x1cab('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0x76')],{'as':_0x1cab('0x10f'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0x78')],{'as':_0x1cab('0x78'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db['OpenchannelInteraction'],{'as':_0x1cab('0x110'),'foreignKey':_0x1cab('0x108')});db['User'][_0x1cab('0x10b')](db[_0x1cab('0x111')],{'as':_0x1cab('0x112'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')]['hasMany'](db['SmsInteraction'],{'as':_0x1cab('0x113'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0x4d')],{'as':_0x1cab('0x114'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db['MailInteraction'],{'as':_0x1cab('0x115'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')][_0x1cab('0x10b')](db[_0x1cab('0xf5')],{'as':_0x1cab('0x116'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14')]['hasMany'](db[_0x1cab('0x117')],{'as':_0x1cab('0x118'),'foreignKey':_0x1cab('0x119')});db[_0x1cab('0x14')][_0x1cab('0x11a')](db['UserProfile'],{'as':_0x1cab('0xed'),'foreignKey':'userProfileId'});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x11c')],{'as':_0x1cab('0x11d'),'through':_0x1cab('0x11e')});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x11f')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0x1cab('0x14')][_0x1cab('0x11b')](db['CmList'],{'as':'Lists','through':_0x1cab('0x120')});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0xdd')],{'through':_0x1cab('0x121')});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x43')],{'as':_0x1cab('0x115'),'through':_0x1cab('0x122')});db[_0x1cab('0x14')]['belongsToMany'](db[_0x1cab('0x111')],{'as':_0x1cab('0x112'),'through':'user_has_chat_interactions'});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x4d')],{'as':_0x1cab('0x114'),'through':'user_has_fax_interactions'});db[_0x1cab('0x14')][_0x1cab('0x11b')](db['SmsInteraction'],{'as':_0x1cab('0x113'),'through':_0x1cab('0x123')});db['User'][_0x1cab('0x11b')](db[_0x1cab('0x124')],{'as':_0x1cab('0x110'),'through':_0x1cab('0x125')});db[_0x1cab('0x14')]['belongsToMany'](db['WhatsappInteraction'],{'as':_0x1cab('0x116'),'through':_0x1cab('0x126')});db['User'][_0x1cab('0x11b')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x1cab('0x2e'),'required':![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0xeb')],{'as':_0x1cab('0x127'),'through':_0x1cab('0x103'),'required':![]});db[_0x1cab('0x14')]['belongsToMany'](db['MailQueue'],{'as':_0x1cab('0x128'),'through':_0x1cab('0x32'),'required':![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x69')],{'as':_0x1cab('0x129'),'through':_0x1cab('0x30'),'required':![],'hooks':!![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x12a')],{'as':_0x1cab('0x12b'),'through':'UserFaxQueue','required':![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db['SmsQueue'],{'as':_0x1cab('0x12c'),'through':_0x1cab('0x36'),'required':![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x5e')],{'as':_0x1cab('0x12d'),'through':'UserOpenchannelQueue','required':![]});db[_0x1cab('0x14')][_0x1cab('0x11b')](db['WhatsappQueue'],{'as':_0x1cab('0x12e'),'through':_0x1cab('0x12f'),'required':![]});db[_0x1cab('0x14')]['belongsToMany'](db[_0x1cab('0xea')],{'through':_0x1cab('0x120')});db[_0x1cab('0x14')]['belongsToMany'](db[_0x1cab('0x60')],{'as':_0x1cab('0x130'),'through':'user_has_chat_websites'});db[_0x1cab('0x14')]['belongsToMany'](db[_0x1cab('0x4a')],{'as':_0x1cab('0x131'),'through':_0x1cab('0x132')});db['User'][_0x1cab('0x11b')](db[_0x1cab('0x3e')],{'as':_0x1cab('0x133'),'through':_0x1cab('0x134')});db['User'][_0x1cab('0x11b')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x1cab('0x135')});db['User'][_0x1cab('0x11b')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x1cab('0x136')});db[_0x1cab('0x14')][_0x1cab('0x11b')](db[_0x1cab('0x137')],{'as':'WhatsappAccounts','through':_0x1cab('0x138')});db['VoiceChanSpy'][_0x1cab('0x10b')](db[_0x1cab('0x19')],{'as':_0x1cab('0x139'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x13a')});db[_0x1cab('0x17')][_0x1cab('0x10b')](db[_0x1cab('0x19')],{'onDelete':_0x1cab('0x10a')});db[_0x1cab('0x19')][_0x1cab('0x10b')](db['VoiceExtension'],{'as':'Applications','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x13b')][_0x1cab('0x11b')](db[_0x1cab('0x13c')],{'as':'Sounds','through':_0x1cab('0x13d')});db[_0x1cab('0x1b')]['hasMany'](db[_0x1cab('0x10c')],{'as':_0x1cab('0x13e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x1cab('0x10b')](db['CmHopper'],{'as':_0x1cab('0x13f'),'foreignKey':_0x1cab('0x140')});db['VoiceQueue'][_0x1cab('0x10b')](db[_0x1cab('0x75')],{'as':_0x1cab('0x141'),'foreignKey':_0x1cab('0x140')});db[_0x1cab('0x1b')][_0x1cab('0x10b')](db[_0x1cab('0x76')],{'as':'HopperHistories','foreignKey':_0x1cab('0x140')});db[_0x1cab('0x1b')][_0x1cab('0x10b')](db[_0x1cab('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x1cab('0x140')});db[_0x1cab('0x1b')][_0x1cab('0x10b')](db[_0x1cab('0x73')],{'as':_0x1cab('0x142'),'foreignKey':_0x1cab('0x140')});db[_0x1cab('0x1b')][_0x1cab('0x10b')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x1cab('0x140')});db['VoiceQueue']['belongsTo'](db[_0x1cab('0x143')],{'as':'Trunk','foreignKey':_0x1cab('0x144')});db[_0x1cab('0x1b')][_0x1cab('0x11a')](db[_0x1cab('0x143')],{'as':_0x1cab('0x145'),'foreignKey':'TrunkBackupId'});db[_0x1cab('0x1b')][_0x1cab('0x11a')](db['Interval'],{'as':'Interval','foreignKey':_0x1cab('0x146')});db[_0x1cab('0x1b')][_0x1cab('0x11a')](db[_0x1cab('0x83')],{'as':_0x1cab('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1cab('0x1b')][_0x1cab('0x11b')](db[_0x1cab('0xea')],{'as':'Lists','through':_0x1cab('0x148')});db[_0x1cab('0x1b')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':'UserVoiceQueue'});db[_0x1cab('0x1b')]['belongsToMany'](db[_0x1cab('0xdd')],{'as':'Teams','through':_0x1cab('0x14a')});db['VoiceQueue'][_0x1cab('0x11b')](db[_0x1cab('0xea')],{'as':_0x1cab('0x14b'),'through':_0x1cab('0x14c')});db['VoiceRecording']['belongsTo'](db[_0x1cab('0x14')],{'as':_0x1cab('0x14'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x14d')]['belongsTo'](db[_0x1cab('0x14')],{'as':_0x1cab('0x14'),'foreignKey':_0x1cab('0x108')});db['VoiceMail'][_0x1cab('0x10b')](db[_0x1cab('0x20')],{'as':_0x1cab('0x14e'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x14f'),'sourceKey':_0x1cab('0x150')});db[_0x1cab('0x20')][_0x1cab('0x11a')](db[_0x1cab('0x1f')],{'foreignKey':_0x1cab('0x14f'),'targetKey':_0x1cab('0x150')});db[_0x1cab('0x22')]['hasMany'](db[_0x1cab('0x27')],{'as':_0x1cab('0x151'),'foreignKey':_0x1cab('0x152'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x1cab('0x25')],{'as':_0x1cab('0x153'),'foreignKey':_0x1cab('0x152'),'constraints':![]});db[_0x1cab('0x22')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x14'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x22')]['belongsTo'](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x3b')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'as':'MailAccount','foreignKey':_0x1cab('0x156')});db[_0x1cab('0x3b')][_0x1cab('0x11a')](db[_0x1cab('0xfe')],{'as':_0x1cab('0xfe'),'foreignKey':_0x1cab('0x157'),'onDelete':'restrict'});db[_0x1cab('0x158')]['belongsTo'](db[_0x1cab('0x3e')],{'as':_0x1cab('0x3e'),'foreignKey':_0x1cab('0x156')});db[_0x1cab('0x158')][_0x1cab('0x11a')](db['CloudProvider'],{'as':_0x1cab('0xfe'),'foreignKey':_0x1cab('0x157'),'onDelete':_0x1cab('0x159')});db['MailAccount']['hasOne'](db[_0x1cab('0x3b')],{'as':_0x1cab('0x15a'),'onDelete':_0x1cab('0x10a')});db['MailAccount'][_0x1cab('0x107')](db[_0x1cab('0x158')],{'as':_0x1cab('0x15b'),'onDelete':_0x1cab('0x10a')});db['MailAccount'][_0x1cab('0x10b')](db[_0x1cab('0x7f')],{'as':_0x1cab('0x15c'),'foreignKey':'MailAccountId','onDelete':_0x1cab('0x10a')});db['MailAccount'][_0x1cab('0x10b')](db['CannedAnswer'],{'as':_0x1cab('0x15d'),'foreignKey':_0x1cab('0x156')});db[_0x1cab('0x3e')][_0x1cab('0x10b')](db[_0x1cab('0x44')],{'as':_0x1cab('0x14e'),'foreignKey':_0x1cab('0x156')});db[_0x1cab('0x3e')]['hasMany'](db[_0x1cab('0x43')],{'as':_0x1cab('0x15e')});db['MailAccount'][_0x1cab('0x10b')](db[_0x1cab('0x45')],{'as':'Applications'});db[_0x1cab('0x3e')][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x3e')][_0x1cab('0x11a')](db[_0x1cab('0x161')],{'as':_0x1cab('0x161'),'foreignKey':_0x1cab('0x162')});db[_0x1cab('0x3e')][_0x1cab('0x11a')](db[_0x1cab('0x83')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db['User'],{'as':_0x1cab('0x149'),'through':_0x1cab('0x134')});db[_0x1cab('0x3f')][_0x1cab('0x11b')](db['User'],{'as':_0x1cab('0x149'),'through':_0x1cab('0x32')});db['MailQueue']['belongsToMany'](db[_0x1cab('0xdd')],{'through':_0x1cab('0x163'),'as':_0x1cab('0x164')});db[_0x1cab('0x43')][_0x1cab('0x10b')](db[_0x1cab('0x44')],{'as':_0x1cab('0x14e'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x165')});db['MailInteraction'][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'as':'Account','foreignKey':_0x1cab('0x156')});db[_0x1cab('0x43')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x43')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x166'),'foreignKey':_0x1cab('0x108')});db['MailInteraction'][_0x1cab('0x11b')](db['Tag'],{'through':_0x1cab('0x167'),'as':_0x1cab('0x168')});db[_0x1cab('0x43')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':'mail_interaction_has_tags','as':_0x1cab('0x169')});db[_0x1cab('0x43')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x16a'),'through':_0x1cab('0x122'),'foreignKey':'MailInteractionId'});db[_0x1cab('0x44')]['hasMany'](db[_0x1cab('0x16b')],{'as':_0x1cab('0x16c'),'onDelete':'cascade'});db['MailMessage']['belongsTo'](db['User'],{'as':_0x1cab('0x14')});db['MailMessage'][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x154')});db[_0x1cab('0x44')][_0x1cab('0x11a')](db[_0x1cab('0x43')],{'as':_0x1cab('0x16d'),'foreignKey':_0x1cab('0x165')});db[_0x1cab('0x44')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'as':_0x1cab('0x16e'),'foreignKey':'MailAccountId'});db[_0x1cab('0x44')]['belongsTo'](db[_0x1cab('0x60')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x1cab('0x44')][_0x1cab('0x11a')](db[_0x1cab('0x67')],{'as':_0x1cab('0x67'),'foreignKey':'ChatOfflineMessageId'});db[_0x1cab('0x45')]['belongsTo'](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x45')][_0x1cab('0x11a')](db[_0x1cab('0x3f')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x45')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x45')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'onDelete':'restrict','foreignKey':_0x1cab('0x146')});db[_0x1cab('0x45')][_0x1cab('0x11a')](db[_0x1cab('0x87')],{'onDelete':'restrict','foreignKey':_0x1cab('0x16f')});db[_0x1cab('0x170')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{});db['MailQueueReport'][_0x1cab('0x11a')](db['CmList'],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x170')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db['MailQueueReport'][_0x1cab('0x11a')](db[_0x1cab('0x43')],{});db[_0x1cab('0x170')][_0x1cab('0x11a')](db['MailMessage'],{});db[_0x1cab('0x170')][_0x1cab('0x11a')](db['User'],{});db[_0x1cab('0x170')][_0x1cab('0x11a')](db[_0x1cab('0x3f')],{});db[_0x1cab('0x47')][_0x1cab('0x10b')](db[_0x1cab('0x48')],{'as':'Items','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x4a')][_0x1cab('0x10b')](db[_0x1cab('0x7f')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x4a')]['hasMany'](db[_0x1cab('0x7d')],{'as':_0x1cab('0x15d'),'foreignKey':'FaxAccountId'});db[_0x1cab('0x4a')][_0x1cab('0x10b')](db[_0x1cab('0x4d')],{'as':'Interactions'});db['FaxAccount'][_0x1cab('0x10b')](db[_0x1cab('0x171')],{'as':_0x1cab('0x172')});db['FaxAccount'][_0x1cab('0x10b')](db['VoiceExtension'],{'as':_0x1cab('0x173'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0x1cab('0x174')],{'as':'Messages'});db['FaxAccount']['belongsTo'](db[_0x1cab('0x143')],{'as':_0x1cab('0x143')});db[_0x1cab('0x4a')][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x4a')]['belongsTo'](db[_0x1cab('0x83')],{'as':_0x1cab('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1cab('0x4a')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x171')][_0x1cab('0x11a')](db[_0x1cab('0x12a')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x171')][_0x1cab('0x11a')](db[_0x1cab('0x4a')],{'onDelete':_0x1cab('0x159')});db['FaxApplication'][_0x1cab('0x11a')](db['Tag'],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x16f')});db['FaxInteraction'][_0x1cab('0x10b')](db[_0x1cab('0x174')],{'as':_0x1cab('0x14e'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x175')});db['FaxInteraction']['belongsTo'](db[_0x1cab('0x4a')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x1cab('0x4d')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0x4d')]['belongsTo'](db[_0x1cab('0x14')],{'as':'Owner','foreignKey':_0x1cab('0x108')});db[_0x1cab('0x4d')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':'fax_interaction_has_tags','as':_0x1cab('0x168')});db[_0x1cab('0x4d')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x176'),'as':_0x1cab('0x169')});db[_0x1cab('0x4d')][_0x1cab('0x11b')](db['User'],{'as':'Users','through':_0x1cab('0x177'),'foreignKey':_0x1cab('0x175')});db['FaxMessage'][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x14')});db[_0x1cab('0x174')][_0x1cab('0x11a')](db[_0x1cab('0x4d')],{'as':_0x1cab('0x16d'),'foreignKey':_0x1cab('0x175')});db[_0x1cab('0x174')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x154')});db[_0x1cab('0x174')]['belongsTo'](db[_0x1cab('0x16b')],{'as':_0x1cab('0x16b'),'foreignKey':'AttachmentId'});db[_0x1cab('0x174')][_0x1cab('0x11a')](db[_0x1cab('0x4a')],{'as':_0x1cab('0x16e'),'foreignKey':'FaxAccountId'});db[_0x1cab('0x12a')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':'Agents','through':_0x1cab('0x34')});db['FaxQueue'][_0x1cab('0x11b')](db[_0x1cab('0xdd')],{'through':'team_has_fax_queues','as':_0x1cab('0x164')});db[_0x1cab('0x51')]['belongsTo'](db[_0x1cab('0x4a')],{});db[_0x1cab('0x51')][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':'ListId'});db[_0x1cab('0x51')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0x51')][_0x1cab('0x11a')](db['FaxInteraction'],{});db[_0x1cab('0x51')][_0x1cab('0x11a')](db['FaxMessage'],{});db['FaxQueueReport'][_0x1cab('0x11a')](db[_0x1cab('0x14')],{});db[_0x1cab('0x51')][_0x1cab('0x11a')](db['FaxQueue'],{});db[_0x1cab('0x52')]['hasMany'](db[_0x1cab('0x7f')],{'as':'Dispositions','foreignKey':_0x1cab('0x178'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0x52')]['hasMany'](db['CannedAnswer'],{'as':_0x1cab('0x15d'),'foreignKey':_0x1cab('0x178')});db[_0x1cab('0x52')][_0x1cab('0x10b')](db[_0x1cab('0x179')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x1cab('0x52')]['hasMany'](db[_0x1cab('0x54')],{'as':_0x1cab('0x15e')});db[_0x1cab('0x52')]['hasMany'](db[_0x1cab('0x17a')],{'as':_0x1cab('0x172')});db['SmsAccount'][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x52')][_0x1cab('0x11a')](db[_0x1cab('0x83')],{'as':_0x1cab('0x147'),'foreignKey':_0x1cab('0x17b')});db[_0x1cab('0x52')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':'user_has_sms_accounts'});db[_0x1cab('0x17a')]['belongsTo'](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x159')});db['SmsApplication'][_0x1cab('0x11a')](db[_0x1cab('0x57')],{'onDelete':_0x1cab('0x159')});db['SmsApplication'][_0x1cab('0x11a')](db['SmsAccount'],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x17a')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x146')});db[_0x1cab('0x17a')][_0x1cab('0x11a')](db[_0x1cab('0x87')],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x16f')});db[_0x1cab('0x54')]['hasMany'](db['SmsMessage'],{'as':_0x1cab('0x14e'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x17c')});db[_0x1cab('0x54')][_0x1cab('0x11a')](db['SmsAccount'],{'as':'Account','foreignKey':_0x1cab('0x178')});db[_0x1cab('0x54')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x54')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x166'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x54')]['belongsToMany'](db[_0x1cab('0x87')],{'through':_0x1cab('0x17d'),'as':_0x1cab('0x168')});db[_0x1cab('0x54')][_0x1cab('0x11b')](db['Tag'],{'through':_0x1cab('0x17d'),'as':_0x1cab('0x169')});db[_0x1cab('0x54')]['belongsToMany'](db[_0x1cab('0x14')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x1cab('0x179')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':'User'});db[_0x1cab('0x179')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x154')});db[_0x1cab('0x179')]['belongsTo'](db[_0x1cab('0x54')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x1cab('0x17c')});db[_0x1cab('0x179')][_0x1cab('0x11a')](db[_0x1cab('0x52')],{'as':_0x1cab('0x16e'),'foreignKey':'SmsAccountId'});db[_0x1cab('0x57')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':_0x1cab('0x36'),'foreignKey':_0x1cab('0x17e')});db[_0x1cab('0x57')][_0x1cab('0x11b')](db['Team'],{'through':_0x1cab('0x17f'),'as':_0x1cab('0x164')});db[_0x1cab('0x180')]['hasMany'](db['Disposition'],{'as':_0x1cab('0x15c'),'foreignKey':_0x1cab('0x181'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0x180')][_0x1cab('0x10b')](db[_0x1cab('0x7d')],{'as':_0x1cab('0x15d'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x1cab('0x10b')](db[_0x1cab('0x124')],{'as':_0x1cab('0x15e'),'foreignKey':_0x1cab('0x181')});db[_0x1cab('0x180')]['hasMany'](db[_0x1cab('0x182')],{'as':_0x1cab('0x14e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x1cab('0x5a')],{'as':_0x1cab('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0x1cab('0x180')]['belongsTo'](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':'ListId'});db[_0x1cab('0x180')][_0x1cab('0x11a')](db[_0x1cab('0x83')],{'as':_0x1cab('0x147'),'foreignKey':_0x1cab('0x17b')});db[_0x1cab('0x180')]['belongsToMany'](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0x5a')][_0x1cab('0x11a')](db['OpenchannelQueue'],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x183')});db['OpenchannelApplication'][_0x1cab('0x11a')](db[_0x1cab('0x180')],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x181')});db[_0x1cab('0x5a')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'onDelete':'restrict','foreignKey':_0x1cab('0x146')});db[_0x1cab('0x5a')]['belongsTo'](db[_0x1cab('0x87')],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x16f')});db[_0x1cab('0x124')][_0x1cab('0x10b')](db[_0x1cab('0x182')],{'as':_0x1cab('0x14e'),'onDelete':'cascade','foreignKey':_0x1cab('0x184')});db[_0x1cab('0x124')][_0x1cab('0x11a')](db[_0x1cab('0x180')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x181')});db['OpenchannelInteraction']['belongsTo'](db['CmContact'],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0x124')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x166'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x124')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x185'),'as':_0x1cab('0x168')});db['OpenchannelInteraction']['belongsToMany'](db[_0x1cab('0x87')],{'through':_0x1cab('0x185'),'as':_0x1cab('0x169')});db[_0x1cab('0x124')]['belongsToMany'](db[_0x1cab('0x14')],{'as':_0x1cab('0x16a'),'through':_0x1cab('0x125'),'foreignKey':_0x1cab('0x184')});db[_0x1cab('0x182')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x14')});db['OpenchannelMessage'][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':'cascade','as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0x1cab('0x124')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x16d'),'foreignKey':_0x1cab('0x184')});db['OpenchannelMessage'][_0x1cab('0x11a')](db[_0x1cab('0x16b')],{'as':_0x1cab('0x16b'),'foreignKey':_0x1cab('0x186')});db['OpenchannelMessage'][_0x1cab('0x11a')](db[_0x1cab('0x180')],{'as':_0x1cab('0x16e'),'foreignKey':'OpenchannelAccountId'});db[_0x1cab('0x5e')][_0x1cab('0x11b')](db['User'],{'as':_0x1cab('0x149'),'through':'UserOpenchannelQueue','foreignKey':_0x1cab('0x183')});db['OpenchannelQueue'][_0x1cab('0x11b')](db['Team'],{'through':_0x1cab('0x187'),'as':'Teams'});db[_0x1cab('0x60')][_0x1cab('0x10b')](db['Disposition'],{'as':_0x1cab('0x15c'),'foreignKey':_0x1cab('0x188'),'onDelete':'cascade'});db[_0x1cab('0x60')][_0x1cab('0x10b')](db[_0x1cab('0x7d')],{'as':_0x1cab('0x15d'),'foreignKey':_0x1cab('0x188')});db[_0x1cab('0x60')][_0x1cab('0x10b')](db['ChatProactiveAction'],{'as':_0x1cab('0x189')});db[_0x1cab('0x60')][_0x1cab('0x10b')](db[_0x1cab('0x111')],{'as':'Interactions'});db[_0x1cab('0x60')][_0x1cab('0x10b')](db[_0x1cab('0x64')],{'as':'Applications'});db['ChatWebsite'][_0x1cab('0x10b')](db[_0x1cab('0x66')],{'as':_0x1cab('0x14e')});db['ChatWebsite']['belongsTo'](db[_0x1cab('0xea')],{'as':'List','foreignKey':'ListId'});db[_0x1cab('0x60')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'as':_0x1cab('0x81'),'foreignKey':'IntervalId'});db[_0x1cab('0x60')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'as':_0x1cab('0x3e'),'foreignKey':_0x1cab('0x156')});db[_0x1cab('0x60')]['belongsTo'](db[_0x1cab('0x83')],{'as':_0x1cab('0x147'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1cab('0x60')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':_0x1cab('0x18a')});db[_0x1cab('0x62')][_0x1cab('0x11a')](db[_0x1cab('0x180')],{});db[_0x1cab('0x62')][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x62')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':'Contact','foreignKey':_0x1cab('0x155')});db[_0x1cab('0x62')][_0x1cab('0x11a')](db['OpenchannelInteraction'],{});db[_0x1cab('0x62')][_0x1cab('0x11a')](db[_0x1cab('0x182')],{});db[_0x1cab('0x62')][_0x1cab('0x11a')](db['User'],{});db[_0x1cab('0x62')][_0x1cab('0x11a')](db[_0x1cab('0x5e')],{});db['ChatApplication']['belongsTo'](db[_0x1cab('0x14')],{'as':_0x1cab('0x18b'),'foreignKey':_0x1cab('0x108'),'onDelete':'restrict'});db['ChatApplication'][_0x1cab('0x11a')](db[_0x1cab('0x69')],{'as':_0x1cab('0x18c'),'foreignKey':_0x1cab('0x18d'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0x64')][_0x1cab('0x11a')](db[_0x1cab('0x60')],{'as':_0x1cab('0x18e'),'foreignKey':_0x1cab('0x188'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0x64')][_0x1cab('0x11a')](db['Tag'],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x16f')});db['ChatInteraction'][_0x1cab('0x10b')](db[_0x1cab('0x66')],{'as':_0x1cab('0x14e'),'onDelete':_0x1cab('0x10a'),'foreignKey':'ChatInteractionId'});db[_0x1cab('0x111')][_0x1cab('0x11a')](db[_0x1cab('0x60')],{'as':_0x1cab('0x16e'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x111')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x166'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x111')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x18f'),'as':_0x1cab('0x168')});db[_0x1cab('0x111')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':'chat_interaction_has_tags','as':_0x1cab('0x169')});db[_0x1cab('0x111')][_0x1cab('0x11b')](db['User'],{'as':'Users','through':_0x1cab('0x190'),'foreignKey':_0x1cab('0x191')});db[_0x1cab('0x66')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x10a'),'as':_0x1cab('0x14')});db[_0x1cab('0x66')]['belongsTo'](db[_0x1cab('0x11f')],{'onDelete':'cascade','as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0x66')]['belongsTo'](db[_0x1cab('0x111')],{'onDelete':_0x1cab('0x10a'),'as':'Interaction','foreignKey':_0x1cab('0x191')});db['ChatMessage']['belongsTo'](db[_0x1cab('0x16b')],{'as':_0x1cab('0x16b'),'foreignKey':_0x1cab('0x186')});db[_0x1cab('0x66')][_0x1cab('0x11a')](db[_0x1cab('0x60')],{'as':_0x1cab('0x16e'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x1cab('0x10b')](db[_0x1cab('0x16b')],{'as':_0x1cab('0x16c'),'foreignKey':_0x1cab('0x192'),'onDelete':'cascade','hooks':!![]});db[_0x1cab('0x67')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':'cascade','as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x67')][_0x1cab('0x11a')](db[_0x1cab('0x60')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x188')});db[_0x1cab('0x69')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':'UserChatQueue','hooks':!![]});db[_0x1cab('0x69')][_0x1cab('0x11b')](db[_0x1cab('0xdd')],{'through':_0x1cab('0x193'),'as':_0x1cab('0x164')});db[_0x1cab('0x11c')][_0x1cab('0x10b')](db['ChatInternalMessage'],{'as':_0x1cab('0x14e'),'foreignKey':_0x1cab('0x194'),'onDelete':'cascade'});db[_0x1cab('0x11c')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x13e'),'through':'chat_group_has_users'});db[_0x1cab('0x6c')]['belongsTo'](db[_0x1cab('0x60')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x1cab('0x6e')][_0x1cab('0x10b')](db['CmContact'],{'as':_0x1cab('0x195'),'foreignKey':'CompanyId'});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db[_0x1cab('0x89')],{'as':_0x1cab('0x196'),'foreignKey':'CmContactId'});db['CmContact'][_0x1cab('0x10b')](db[_0x1cab('0x71')],{'as':'Hoppers','foreignKey':_0x1cab('0x155')});db[_0x1cab('0x11f')]['hasMany'](db[_0x1cab('0x75')],{'as':'HopperFinals','foreignKey':_0x1cab('0x155')});db[_0x1cab('0x11f')]['hasMany'](db[_0x1cab('0x76')],{'as':_0x1cab('0x197'),'foreignKey':'ContactId'});db['CmContact'][_0x1cab('0x10b')](db[_0x1cab('0x78')],{'as':_0x1cab('0x78'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db[_0x1cab('0xd2')],{'as':_0x1cab('0x198'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db[_0x1cab('0x124')],{'as':'OpenchannelInteractions','foreignKey':_0x1cab('0x155'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db['ChatInteraction'],{'as':_0x1cab('0x112'),'foreignKey':'ContactId','onDelete':_0x1cab('0x159')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db[_0x1cab('0x54')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x1cab('0x159')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db[_0x1cab('0x4d')],{'as':'FaxInteractions','foreignKey':_0x1cab('0x155'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0x11f')][_0x1cab('0x10b')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x1cab('0x155'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0x11f')]['belongsTo'](db[_0x1cab('0x6e')],{'as':_0x1cab('0x199'),'foreignKey':_0x1cab('0x19a')});db[_0x1cab('0x11f')]['belongsTo'](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160'),'onDelete':'cascade'});db['CmContact'][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x16a'),'through':'cm_user_has_contacts'});db[_0x1cab('0x11f')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'as':_0x1cab('0x168'),'through':_0x1cab('0x19b')});db[_0x1cab('0x11f')]['belongsToMany'](db[_0x1cab('0x87')],{'through':'cm_contact_has_tags','as':_0x1cab('0x169')});db[_0x1cab('0x71')]['hasMany'](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0x1cab('0x19c')});db[_0x1cab('0x71')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':'ContactId','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x71')][_0x1cab('0x11a')](db['CmList'],{'as':'List','foreignKey':_0x1cab('0x160'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0x71')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x18b'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0x71')]['belongsTo'](db[_0x1cab('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x71')][_0x1cab('0x11a')](db[_0x1cab('0x19d')],{'as':_0x1cab('0x19d'),'foreignKey':_0x1cab('0x19e'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0x71')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':'Owner','foreignKey':_0x1cab('0x19f')});db[_0x1cab('0x73')]['belongsTo'](db[_0x1cab('0x11f')],{'as':'Contact','foreignKey':_0x1cab('0x155'),'onDelete':_0x1cab('0x10a')});db['CmHopperBlack']['belongsTo'](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160'),'onDelete':'cascade'});db[_0x1cab('0x73')][_0x1cab('0x11a')](db['VoiceQueue'],{'as':_0x1cab('0x18c'),'foreignKey':_0x1cab('0x140'),'onDelete':'cascade'});db['CmHopperBlack'][_0x1cab('0x11a')](db[_0x1cab('0x19d')],{'as':_0x1cab('0x19d'),'foreignKey':_0x1cab('0x19e'),'onDelete':'cascade'});db['Automation']['hasMany'](db[_0x1cab('0x1a0')],{'as':{'plural':_0x1cab('0x1a1'),'singular':_0x1cab('0x1a2')},'foreignKey':_0x1cab('0x1a3'),'onDelete':_0x1cab('0x10a'),'hooks':!![]});db[_0x1cab('0x7b')]['hasMany'](db['Condition'],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x1cab('0x1a4'),'onDelete':_0x1cab('0x10a'),'hooks':!![]});db[_0x1cab('0x7b')][_0x1cab('0x10b')](db[_0x1cab('0x7a')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x1cab('0x10a'),'hooks':!![]});db['Disposition'][_0x1cab('0x10b')](db[_0x1cab('0x7f')],{'as':_0x1cab('0x15c'),'foreignKey':'ParentId','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x81')][_0x1cab('0x10b')](db[_0x1cab('0x81')],{'as':_0x1cab('0x1a5'),'foreignKey':_0x1cab('0x146'),'onDelete':_0x1cab('0x10a'),'hooks':!![],'required':![]});db[_0x1cab('0x81')][_0x1cab('0x10b')](db[_0x1cab('0x19')],{'as':_0x1cab('0x10e'),'foreignKey':_0x1cab('0x146'),'onDelete':'restrict'});db['Interval']['hasMany'](db[_0x1cab('0x45')],{'as':_0x1cab('0x1a6'),'foreignKey':_0x1cab('0x146')});db[_0x1cab('0x81')][_0x1cab('0x10b')](db['ChatApplication'],{'as':_0x1cab('0x1a7'),'foreignKey':_0x1cab('0x146')});db[_0x1cab('0x81')][_0x1cab('0x10b')](db[_0x1cab('0x171')],{'as':_0x1cab('0x1a8'),'foreignKey':_0x1cab('0x146')});db[_0x1cab('0x81')][_0x1cab('0x10b')](db[_0x1cab('0x17a')],{'as':_0x1cab('0x1a9'),'foreignKey':_0x1cab('0x146')});db['Schedule'][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{});db[_0x1cab('0x85')][_0x1cab('0x11a')](db[_0x1cab('0x95')],{'foreignKey':_0x1cab('0x1aa')});db[_0x1cab('0x85')][_0x1cab('0x11a')](db[_0x1cab('0x1ab')],{'foreignKey':'CustomReportId'});db[_0x1cab('0x13c')][_0x1cab('0x11b')](db[_0x1cab('0x13b')],{'as':_0x1cab('0x1ac'),'through':_0x1cab('0x13d'),'onDelete':_0x1cab('0x159')});db['Tag'][_0x1cab('0x11b')](db['CmContact'],{'through':_0x1cab('0x19b')});db[_0x1cab('0x87')]['belongsToMany'](db[_0x1cab('0x111')],{'through':_0x1cab('0x18f')});db[_0x1cab('0x87')]['belongsToMany'](db[_0x1cab('0x43')],{'through':_0x1cab('0x167')});db[_0x1cab('0x87')][_0x1cab('0x11b')](db[_0x1cab('0x54')],{'through':_0x1cab('0x17d')});db[_0x1cab('0x87')]['belongsToMany'](db['FaxInteraction'],{'through':_0x1cab('0x176')});db['Tag']['belongsToMany'](db[_0x1cab('0x124')],{'through':'openchannel_interaction_has_tags'});db[_0x1cab('0x87')][_0x1cab('0x11b')](db[_0x1cab('0xf5')],{'through':_0x1cab('0x1ad')});db[_0x1cab('0x89')][_0x1cab('0x11a')](db[_0x1cab('0x1ae')],{'as':_0x1cab('0x1af'),'foreignKey':_0x1cab('0x1b0')});db[_0x1cab('0x1b1')][_0x1cab('0x11a')](db[_0x1cab('0x71')],{'as':'Hopper','foreignKey':_0x1cab('0x19c')});db[_0x1cab('0x89')]['belongsTo'](db['CmContact'],{'as':_0x1cab('0x154'),'foreignKey':'CmContactId'});db[_0x1cab('0x8c')][_0x1cab('0x10b')](db[_0x1cab('0x1a0')],{'as':{'plural':'AllConditions','singular':_0x1cab('0x1b2')},'foreignKey':'TriggerAllId','onDelete':_0x1cab('0x10a'),'hooks':!![]});db['Trigger'][_0x1cab('0x10b')](db[_0x1cab('0x1a0')],{'as':{'plural':_0x1cab('0x1b3'),'singular':_0x1cab('0x1b4')},'foreignKey':_0x1cab('0x1b5'),'onDelete':'cascade','hooks':!![]});db[_0x1cab('0x8c')][_0x1cab('0x10b')](db['Action'],{'as':_0x1cab('0x1b6'),'foreignKey':_0x1cab('0x1b7'),'onDelete':_0x1cab('0x10a'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x1cab('0x1b8')],{'as':'Fields','onDelete':_0x1cab('0x10a'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x1cab('0x95')][_0x1cab('0x10b')](db[_0x1cab('0x1b8')],{'as':'Fields','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1aa')});db[_0x1cab('0x98')][_0x1cab('0x10b')](db[_0x1cab('0x1b8')],{'as':_0x1cab('0x1b9'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1ba')});db[_0x1cab('0x1b8')]['belongsTo'](db[_0x1cab('0x98')],{'foreignKey':'MetricId'});db[_0x1cab('0x9a')][_0x1cab('0x10b')](db['SalesforceConfiguration'],{'as':_0x1cab('0x1bb'),'onDelete':_0x1cab('0x10a'),'foreignKey':'AccountId'});db[_0x1cab('0x9c')]['hasMany'](db[_0x1cab('0x9e')],{'as':_0x1cab('0x1bc'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0x9c')][_0x1cab('0x10b')](db[_0x1cab('0x9e')],{'as':_0x1cab('0x1be'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bf')});db['SalesforceConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0x9e')],{'as':'Fields','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0x9c')]['belongsTo'](db[_0x1cab('0x9a')],{'as':_0x1cab('0x16e'),'foreignKey':'AccountId'});db[_0x1cab('0x9e')]['hasMany'](db[_0x1cab('0x9e')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0x9e')][_0x1cab('0x10b')](db[_0x1cab('0x9e')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0x9e')]['hasMany'](db[_0x1cab('0x9e')],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db['SalesforceField'][_0x1cab('0x11a')](db['Variable'],{'as':_0x1cab('0x8e'),'foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xa0')][_0x1cab('0x10b')](db[_0x1cab('0xa2')],{'as':_0x1cab('0x1bb'),'onDelete':'cascade','foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xa2')]['hasMany'](db[_0x1cab('0x1c6')],{'as':_0x1cab('0x1bc'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xa2')]['hasMany'](db[_0x1cab('0x1c6')],{'as':_0x1cab('0x1be'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bf')});db['SugarcrmConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0x1c6')],{'as':_0x1cab('0x1b9'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xa2')][_0x1cab('0x11a')](db['SugarcrmAccount'],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0x1c6')][_0x1cab('0x10b')](db[_0x1cab('0x1c6')],{'as':'Subject','foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0x1c6')][_0x1cab('0x10b')](db[_0x1cab('0x1c6')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0x1c6')][_0x1cab('0x10b')](db[_0x1cab('0x1c6')],{'as':_0x1cab('0x1c3'),'foreignKey':'FieldId'});db[_0x1cab('0x1c6')][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':_0x1cab('0x8e'),'foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xa4')][_0x1cab('0x10b')](db[_0x1cab('0xa6')],{'as':_0x1cab('0x1bb'),'onDelete':_0x1cab('0x10a'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0xa8')],{'as':_0x1cab('0x1bc'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bd')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':_0x1cab('0x10a'),'foreignKey':'DescriptionId'});db[_0x1cab('0xa6')][_0x1cab('0x10b')](db[_0x1cab('0xa8')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x1cab('0xa6')][_0x1cab('0x11a')](db[_0x1cab('0xa4')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xa6')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x1c7')});db[_0x1cab('0xa8')][_0x1cab('0x10b')](db[_0x1cab('0xa8')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xa8')][_0x1cab('0x10b')](db[_0x1cab('0xa8')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db['DeskField'][_0x1cab('0x10b')](db[_0x1cab('0xa8')],{'as':_0x1cab('0x1c3'),'foreignKey':'FieldId'});db['DeskField'][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':'Variable','foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xa9')][_0x1cab('0x10b')](db[_0x1cab('0xaa')],{'as':_0x1cab('0x1bb'),'onDelete':_0x1cab('0x10a'),'foreignKey':'AccountId'});db[_0x1cab('0xaa')]['hasMany'](db['ZohoField'],{'as':_0x1cab('0x1bc'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bd')});db['ZohoConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0xab')],{'as':_0x1cab('0x1be'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xaa')][_0x1cab('0x10b')](db[_0x1cab('0xab')],{'as':_0x1cab('0x1b9'),'onDelete':_0x1cab('0x10a'),'foreignKey':'FieldId'});db[_0x1cab('0xaa')][_0x1cab('0x11a')](db[_0x1cab('0xa9')],{'as':'Account','foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xab')]['hasMany'](db[_0x1cab('0xab')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xab')]['hasMany'](db[_0x1cab('0xab')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x1cab('0xab')]['hasMany'](db[_0x1cab('0xab')],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xab')][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':_0x1cab('0x8e'),'foreignKey':'VariableId'});db['ZendeskAccount']['hasMany'](db[_0x1cab('0x1c8')],{'as':_0x1cab('0x1bb'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0x1c8')]['hasMany'](db['ZendeskField'],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0xaf')],{'as':_0x1cab('0x1be'),'foreignKey':'DescriptionId'});db[_0x1cab('0x1c8')][_0x1cab('0x10b')](db['ZendeskField'],{'as':_0x1cab('0x1b9'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0x1c8')]['belongsTo'](db[_0x1cab('0x1c9')],{'as':'Account','foreignKey':'AccountId'});db[_0x1cab('0x1c8')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x1ca')});db['ZendeskField'][_0x1cab('0x10b')](db['ZendeskField'],{'as':_0x1cab('0x1c1'),'foreignKey':'SubjectId'});db[_0x1cab('0xaf')][_0x1cab('0x10b')](db[_0x1cab('0xaf')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xaf')][_0x1cab('0x10b')](db['ZendeskField'],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xaf')][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':_0x1cab('0x8e'),'foreignKey':_0x1cab('0x1c4')});db['FreshdeskAccount']['hasMany'](db[_0x1cab('0xb2')],{'as':'Configurations','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c5')});db['FreshdeskConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0xb4')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xb2')][_0x1cab('0x10b')](db[_0x1cab('0xb4')],{'as':'Descriptions','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xb2')][_0x1cab('0x10b')](db['FreshdeskField'],{'as':_0x1cab('0x1b9'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xb2')][_0x1cab('0x11a')](db['FreshdeskAccount'],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xb2')][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x1cb')});db[_0x1cab('0xb4')]['hasMany'](db[_0x1cab('0xb4')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xb4')][_0x1cab('0x10b')](db[_0x1cab('0xb4')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xb4')]['hasMany'](db[_0x1cab('0xb4')],{'as':'Field','foreignKey':_0x1cab('0x1c0')});db['FreshdeskField'][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':'Variable','foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xb6')][_0x1cab('0x10b')](db[_0x1cab('0xb8')],{'as':_0x1cab('0x1bb'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c5')});db['VtigerConfiguration'][_0x1cab('0x10b')](db[_0x1cab('0xb9')],{'as':'Subjects','foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xb8')][_0x1cab('0x10b')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xb8')]['hasMany'](db[_0x1cab('0xb9')],{'as':_0x1cab('0x1b9'),'foreignKey':_0x1cab('0x1c0')});db['VtigerConfiguration'][_0x1cab('0x11a')](db[_0x1cab('0xb6')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db['VtigerField']['hasMany'](db[_0x1cab('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db['VtigerField'][_0x1cab('0x10b')](db[_0x1cab('0xb9')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xb9')][_0x1cab('0x10b')](db['VtigerField'],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xb9')][_0x1cab('0x11a')](db['Variable'],{'as':'Variable','foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xbb')][_0x1cab('0x10b')](db[_0x1cab('0xbd')],{'as':'Configurations','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xbd')]['hasMany'](db['ServicenowField'],{'as':_0x1cab('0x1bc'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xbd')][_0x1cab('0x10b')](db[_0x1cab('0xbe')],{'as':_0x1cab('0x1be'),'foreignKey':'DescriptionId'});db[_0x1cab('0xbd')][_0x1cab('0x10b')](db['ServicenowField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x1cab('0xbd')][_0x1cab('0x11a')](db[_0x1cab('0xbb')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xbe')][_0x1cab('0x10b')](db[_0x1cab('0xbe')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xbe')][_0x1cab('0x10b')](db[_0x1cab('0xbe')],{'as':'Description','foreignKey':_0x1cab('0x1bf')});db['ServicenowField'][_0x1cab('0x10b')](db['ServicenowField'],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db['ServicenowField'][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':_0x1cab('0x8e'),'foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xc0')][_0x1cab('0x10b')](db[_0x1cab('0xc2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xc0')]['belongsTo'](db[_0x1cab('0xfe')],{'as':_0x1cab('0xfe'),'foreignKey':_0x1cab('0x157')});db['Dynamics365Configuration'][_0x1cab('0x10b')](db[_0x1cab('0xc4')],{'as':_0x1cab('0x1bc'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x1cab('0xc2')][_0x1cab('0x10b')](db[_0x1cab('0xc4')],{'as':_0x1cab('0x1be'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xc2')][_0x1cab('0x10b')](db[_0x1cab('0xc4')],{'as':_0x1cab('0x1b9'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xc2')][_0x1cab('0x11a')](db[_0x1cab('0xc0')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xc4')][_0x1cab('0x10b')](db[_0x1cab('0xc4')],{'as':_0x1cab('0x1c1'),'foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xc4')]['hasMany'](db[_0x1cab('0xc4')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xc4')][_0x1cab('0x10b')](db['Dynamics365Field'],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x1cab('0x11a')](db[_0x1cab('0x8e')],{'as':'Variable','foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xc6')][_0x1cab('0x10b')](db[_0x1cab('0xc7')],{'as':'Configurations','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1c5')});db['FreshsalesConfiguration']['hasMany'](db[_0x1cab('0xc8')],{'as':'Subjects','foreignKey':_0x1cab('0x1bd')});db[_0x1cab('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x1cab('0x1be'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xc7')][_0x1cab('0x10b')](db[_0x1cab('0xc8')],{'as':_0x1cab('0x1b9'),'foreignKey':'FieldId'});db[_0x1cab('0xc7')]['belongsTo'](db[_0x1cab('0xc6')],{'as':_0x1cab('0x16e'),'foreignKey':_0x1cab('0x1c5')});db[_0x1cab('0xc8')]['hasMany'](db[_0x1cab('0xc8')],{'as':_0x1cab('0x1c1'),'foreignKey':'SubjectId'});db[_0x1cab('0xc8')][_0x1cab('0x10b')](db[_0x1cab('0xc8')],{'as':_0x1cab('0x1c2'),'foreignKey':_0x1cab('0x1bf')});db[_0x1cab('0xc8')][_0x1cab('0x10b')](db[_0x1cab('0xc8')],{'as':_0x1cab('0x1c3'),'foreignKey':_0x1cab('0x1c0')});db[_0x1cab('0xc8')][_0x1cab('0x11a')](db['Variable'],{'as':_0x1cab('0x8e'),'foreignKey':_0x1cab('0x1c4')});db[_0x1cab('0xcc')][_0x1cab('0x11a')](db['ChatWebsite'],{});db[_0x1cab('0xcc')][_0x1cab('0x11a')](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xcc')]['belongsTo'](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0xcc')][_0x1cab('0x11a')](db[_0x1cab('0x111')],{});db[_0x1cab('0xcc')][_0x1cab('0x11a')](db['ChatMessage'],{});db[_0x1cab('0xcc')]['belongsTo'](db['User'],{});db[_0x1cab('0xcc')][_0x1cab('0x11a')](db[_0x1cab('0x69')],{});db[_0x1cab('0xce')]['belongsTo'](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1cc')});db['ChatInternalMessage'][_0x1cab('0x11a')](db['User'],{'onDelete':'cascade','foreignKey':_0x1cab('0x1cd')});db[_0x1cab('0xd2')][_0x1cab('0x10b')](db[_0x1cab('0x1ce')],{'foreignKey':_0x1cab('0x1cf'),'onDelete':'cascade'});db['JscriptySessionReport']['hasMany'](db[_0x1cab('0xd0')],{'foreignKey':_0x1cab('0x1cf'),'onDelete':_0x1cab('0x10a')});db['SmsQueueReport']['belongsTo'](db[_0x1cab('0x52')],{});db[_0x1cab('0xd4')]['belongsTo'](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xd4')][_0x1cab('0x11a')](db['CmContact'],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0xd4')][_0x1cab('0x11a')](db[_0x1cab('0x54')],{});db[_0x1cab('0xd4')][_0x1cab('0x11a')](db['SmsMessage'],{});db[_0x1cab('0xd4')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{});db['SmsQueueReport']['belongsTo'](db[_0x1cab('0x57')],{});db[_0x1cab('0xd8')][_0x1cab('0x10b')](db[_0x1cab('0xd2')],{'foreignKey':_0x1cab('0x1d0')});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0x1cab('0xd8')][_0x1cab('0x10b')](db[_0x1cab('0xd0')],{'foreignKey':_0x1cab('0x1d0')});db[_0x1cab('0xdd')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':_0x1cab('0x121')});db[_0x1cab('0xdd')]['belongsToMany'](db[_0x1cab('0x1b')],{'through':'TeamVoiceQueue','as':_0x1cab('0x1d1')});db['Team'][_0x1cab('0x11b')](db[_0x1cab('0x3f')],{'through':_0x1cab('0x163'),'as':_0x1cab('0x128')});db[_0x1cab('0xdd')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x1cab('0x129')});db[_0x1cab('0xdd')]['belongsToMany'](db[_0x1cab('0x12a')],{'through':_0x1cab('0x1d2'),'as':'FaxQueues'});db[_0x1cab('0xdd')][_0x1cab('0x11b')](db[_0x1cab('0x57')],{'through':_0x1cab('0x17f'),'as':_0x1cab('0x12c')});db['Team'][_0x1cab('0x11b')](db[_0x1cab('0x5e')],{'through':_0x1cab('0x187'),'as':_0x1cab('0x12d')});db[_0x1cab('0xdd')][_0x1cab('0x11b')](db[_0x1cab('0xfd')],{'through':_0x1cab('0x1d3'),'as':'WhatsappQueues'});db[_0x1cab('0xdd')][_0x1cab('0x11b')](db['VoicePrefix'],{'through':_0x1cab('0x101'),'as':_0x1cab('0x127')});db[_0x1cab('0x19d')][_0x1cab('0x10b')](db[_0x1cab('0x71')],{'as':_0x1cab('0x13f'),'foreignKey':'CampaignId'});db[_0x1cab('0x19d')][_0x1cab('0x10b')](db[_0x1cab('0x75')],{'as':_0x1cab('0x141'),'foreignKey':_0x1cab('0x19e')});db[_0x1cab('0x19d')][_0x1cab('0x10b')](db[_0x1cab('0x76')],{'as':_0x1cab('0x197'),'foreignKey':_0x1cab('0x19e')});db[_0x1cab('0x19d')][_0x1cab('0x10b')](db[_0x1cab('0x73')],{'as':_0x1cab('0x142'),'foreignKey':_0x1cab('0x19e')});db[_0x1cab('0x19d')][_0x1cab('0x11a')](db[_0x1cab('0x143')],{'as':_0x1cab('0x143'),'foreignKey':_0x1cab('0x144')});db[_0x1cab('0x19d')][_0x1cab('0x11a')](db[_0x1cab('0x143')],{'as':_0x1cab('0x145'),'foreignKey':_0x1cab('0x1d4')});db[_0x1cab('0x19d')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'as':_0x1cab('0x81'),'foreignKey':_0x1cab('0x146')});db[_0x1cab('0x19d')][_0x1cab('0x11a')](db[_0x1cab('0x1d5')],{'as':_0x1cab('0x1d5'),'foreignKey':'SquareProjectId'});db[_0x1cab('0x19d')][_0x1cab('0x11b')](db[_0x1cab('0xea')],{'as':_0x1cab('0x1d6'),'through':_0x1cab('0x1d7')});db[_0x1cab('0x19d')][_0x1cab('0x11b')](db[_0x1cab('0xea')],{'as':_0x1cab('0x14b'),'through':_0x1cab('0x1d8')});db[_0x1cab('0x16b')]['belongsTo'](db[_0x1cab('0x67')],{'as':_0x1cab('0x67'),'foreignKey':'ChatOfflineMessageId'});db[_0x1cab('0xe2')][_0x1cab('0x11a')](db[_0x1cab('0x44')],{});db['MailTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x43')],{});db[_0x1cab('0xe2')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'foreignKey':_0x1cab('0x1d9'),'as':_0x1cab('0x1da')});db[_0x1cab('0xe2')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1db'),'as':_0x1cab('0x1dc')});db[_0x1cab('0xe2')]['belongsTo'](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1dd'),'as':'ToAgent'});db[_0x1cab('0xe2')][_0x1cab('0x11a')](db[_0x1cab('0x3f')],{'foreignKey':_0x1cab('0x1de'),'as':_0x1cab('0x1df')});db[_0x1cab('0xe2')][_0x1cab('0x11a')](db[_0x1cab('0x3e')],{'foreignKey':_0x1cab('0x1e0'),'as':_0x1cab('0x1e1')});db[_0x1cab('0xe4')][_0x1cab('0x11a')](db[_0x1cab('0x66')],{});db['ChatTransferReport']['belongsTo'](db[_0x1cab('0x111')],{});db[_0x1cab('0xe4')][_0x1cab('0x11a')](db['ChatWebsite'],{'foreignKey':_0x1cab('0x1e2'),'as':'FromAccount'});db['ChatTransferReport'][_0x1cab('0x11a')](db['User'],{'foreignKey':_0x1cab('0x1db'),'as':_0x1cab('0x1dc')});db['ChatTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':'ToUserId','as':_0x1cab('0x1e3')});db[_0x1cab('0xe4')]['belongsTo'](db[_0x1cab('0x69')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x1cab('0xe4')]['belongsTo'](db[_0x1cab('0x60')],{'foreignKey':_0x1cab('0x1e4'),'as':_0x1cab('0x1e1')});db['FaxTransferReport']['belongsTo'](db[_0x1cab('0x174')],{});db['FaxTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x4d')],{});db[_0x1cab('0xe5')][_0x1cab('0x11a')](db['FaxAccount'],{'foreignKey':_0x1cab('0x1e5'),'as':_0x1cab('0x1da')});db[_0x1cab('0xe5')][_0x1cab('0x11a')](db['User'],{'foreignKey':_0x1cab('0x1db'),'as':_0x1cab('0x1dc')});db[_0x1cab('0xe5')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1dd'),'as':_0x1cab('0x1e3')});db[_0x1cab('0xe5')][_0x1cab('0x11a')](db[_0x1cab('0x12a')],{'foreignKey':_0x1cab('0x1e6'),'as':_0x1cab('0x1df')});db[_0x1cab('0xe5')][_0x1cab('0x11a')](db[_0x1cab('0x4a')],{'foreignKey':_0x1cab('0x1e7'),'as':_0x1cab('0x1e1')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x124')],{});db['OpenchannelTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x180')],{'foreignKey':_0x1cab('0x1e8'),'as':_0x1cab('0x1da')});db[_0x1cab('0x1e9')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1db'),'as':_0x1cab('0x1dc')});db[_0x1cab('0x1e9')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':'ToUserId','as':_0x1cab('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0x1cab('0x5e')],{'foreignKey':_0x1cab('0x1ea'),'as':_0x1cab('0x1df')});db['OpenchannelTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x180')],{'foreignKey':_0x1cab('0x1eb'),'as':_0x1cab('0x1e1')});db[_0x1cab('0xe8')][_0x1cab('0x11a')](db[_0x1cab('0x179')],{});db[_0x1cab('0xe8')]['belongsTo'](db[_0x1cab('0x54')],{});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x1cab('0x1ec'),'as':_0x1cab('0x1da')});db[_0x1cab('0xe8')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1db'),'as':_0x1cab('0x1dc')});db[_0x1cab('0xe8')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1dd'),'as':_0x1cab('0x1e3')});db['SmsTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x57')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0x52')],{'foreignKey':_0x1cab('0x1ed'),'as':'ToAccount'});db['CmList'][_0x1cab('0x10b')](db['Disposition'],{'as':_0x1cab('0x15c'),'foreignKey':_0x1cab('0x160'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0xea')][_0x1cab('0x10b')](db[_0x1cab('0x1ee')],{'as':_0x1cab('0x1ef'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xea')][_0x1cab('0x10b')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x195'),'onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xea')]['hasMany'](db[_0x1cab('0x75')],{'as':_0x1cab('0x141'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xea')][_0x1cab('0x10b')](db[_0x1cab('0x76')],{'as':_0x1cab('0x10f'),'foreignKey':_0x1cab('0x160')});db['CmList'][_0x1cab('0x10b')](db[_0x1cab('0x78')],{'as':_0x1cab('0x78'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xea')][_0x1cab('0x11b')](db[_0x1cab('0x1b')],{'as':_0x1cab('0x1f0'),'through':_0x1cab('0x148')});db[_0x1cab('0xea')]['belongsToMany'](db['User'],{'as':_0x1cab('0x149'),'through':_0x1cab('0x120')});db[_0x1cab('0xeb')][_0x1cab('0x10b')](db[_0x1cab('0x19')],{'as':_0x1cab('0x10e'),'onDelete':_0x1cab('0x10a')});db[_0x1cab('0xeb')]['belongsToMany'](db['User'],{'as':_0x1cab('0x149'),'through':'UserVoicePrefix'});db['VoicePrefix']['belongsToMany'](db[_0x1cab('0xdd')],{'through':'TeamVoicePrefix','as':_0x1cab('0x164')});db[_0x1cab('0xed')][_0x1cab('0x10b')](db['User'],{'as':'Users','foreignKey':_0x1cab('0x1f1')});db[_0x1cab('0xed')]['hasMany'](db[_0x1cab('0x1f2')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x1cab('0x10a')});db[_0x1cab('0x1f2')][_0x1cab('0x10b')](db[_0x1cab('0xef')],{'as':_0x1cab('0x1f3'),'foreignKey':_0x1cab('0x1f4'),'onDelete':_0x1cab('0x10a')});db['WhatsappAccount'][_0x1cab('0x10b')](db[_0x1cab('0x7f')],{'as':_0x1cab('0x15c'),'foreignKey':_0x1cab('0x1f5'),'onDelete':'cascade'});db[_0x1cab('0x137')][_0x1cab('0x10b')](db[_0x1cab('0x7d')],{'as':_0x1cab('0x15d'),'foreignKey':_0x1cab('0x1f5')});db[_0x1cab('0x137')][_0x1cab('0x10b')](db[_0x1cab('0xf7')],{'as':_0x1cab('0x14e'),'foreignKey':_0x1cab('0x1f5')});db[_0x1cab('0x137')][_0x1cab('0x10b')](db[_0x1cab('0xf5')],{'as':_0x1cab('0x15e')});db['WhatsappAccount']['hasMany'](db[_0x1cab('0xf3')],{'as':_0x1cab('0x172')});db[_0x1cab('0x137')]['belongsTo'](db[_0x1cab('0xea')],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0x137')][_0x1cab('0x11a')](db[_0x1cab('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x1cab('0x17b')});db[_0x1cab('0x137')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':_0x1cab('0x138')});db[_0x1cab('0xf3')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'onDelete':_0x1cab('0x159')});db['WhatsappApplication']['belongsTo'](db['WhatsappQueue'],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0xf3')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x1cab('0x159')});db[_0x1cab('0xf3')][_0x1cab('0x11a')](db[_0x1cab('0x81')],{'onDelete':_0x1cab('0x159'),'foreignKey':'IntervalId'});db[_0x1cab('0xf3')][_0x1cab('0x11a')](db['Tag'],{'onDelete':_0x1cab('0x159'),'foreignKey':_0x1cab('0x16f')});db[_0x1cab('0xf5')][_0x1cab('0x10b')](db[_0x1cab('0xf7')],{'as':'Messages','onDelete':_0x1cab('0x10a'),'foreignKey':_0x1cab('0x1f6')});db[_0x1cab('0xf5')][_0x1cab('0x11a')](db[_0x1cab('0x137')],{'as':'Account','foreignKey':_0x1cab('0x1f5')});db[_0x1cab('0xf5')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':'ContactId'});db[_0x1cab('0xf5')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x166'),'foreignKey':_0x1cab('0x108')});db[_0x1cab('0xf5')]['belongsToMany'](db['Tag'],{'through':_0x1cab('0x1ad'),'as':_0x1cab('0x168')});db['WhatsappInteraction'][_0x1cab('0x11b')](db[_0x1cab('0x87')],{'through':_0x1cab('0x1ad'),'as':_0x1cab('0x169')});db[_0x1cab('0xf5')][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x16a'),'through':_0x1cab('0x126'),'foreignKey':_0x1cab('0x1f6')});db[_0x1cab('0xf7')][_0x1cab('0x11a')](db['User'],{'as':_0x1cab('0x14')});db['WhatsappMessage'][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'onDelete':'cascade','as':_0x1cab('0x154')});db[_0x1cab('0xf7')][_0x1cab('0x11a')](db['WhatsappInteraction'],{'onDelete':_0x1cab('0x10a'),'as':'Interaction','foreignKey':_0x1cab('0x1f6')});db[_0x1cab('0xf7')][_0x1cab('0x11a')](db[_0x1cab('0x137')],{'as':_0x1cab('0x16e'),'foreignKey':'WhatsappAccountId'});db[_0x1cab('0xf9')][_0x1cab('0x11a')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x1cab('0x11a')](db['CmList'],{'as':_0x1cab('0x15f'),'foreignKey':_0x1cab('0x160')});db[_0x1cab('0xf9')][_0x1cab('0x11a')](db[_0x1cab('0x11f')],{'as':_0x1cab('0x154'),'foreignKey':_0x1cab('0x155')});db[_0x1cab('0xf9')][_0x1cab('0x11a')](db['WhatsappInteraction'],{});db[_0x1cab('0xf9')][_0x1cab('0x11a')](db[_0x1cab('0xfd')],{});db[_0x1cab('0xf9')]['belongsTo'](db[_0x1cab('0xf7')],{});db[_0x1cab('0xf9')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{});db[_0x1cab('0xfb')][_0x1cab('0x11a')](db[_0x1cab('0xf7')],{});db[_0x1cab('0xfb')][_0x1cab('0x11a')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x1cab('0x11a')](db['WhatsappAccount'],{'foreignKey':_0x1cab('0x1f7'),'as':'FromAccount'});db[_0x1cab('0xfb')][_0x1cab('0x11a')](db[_0x1cab('0x137')],{'foreignKey':_0x1cab('0x1f8'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x1cab('0x11a')](db[_0x1cab('0xfd')],{'foreignKey':_0x1cab('0x1f9'),'as':_0x1cab('0x1df')});db[_0x1cab('0xfb')]['belongsTo'](db[_0x1cab('0x14')],{'foreignKey':'FromUserId','as':_0x1cab('0x1dc')});db[_0x1cab('0xfb')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'foreignKey':_0x1cab('0x1dd'),'as':_0x1cab('0x1e3')});db['WhatsappQueue'][_0x1cab('0x11b')](db[_0x1cab('0x14')],{'as':_0x1cab('0x149'),'through':_0x1cab('0x12f'),'foreignKey':_0x1cab('0x1fa')});db[_0x1cab('0xfd')][_0x1cab('0x11b')](db[_0x1cab('0xdd')],{'through':_0x1cab('0x1d3'),'as':'Teams'});db[_0x1cab('0x105')][_0x1cab('0x11a')](db[_0x1cab('0x14')],{'as':_0x1cab('0x1fb'),'foreignKey':'UserId','onDelete':_0x1cab('0x10a'),'hooks':!![]});db[_0x1cab('0xfe')][_0x1cab('0x107')](db[_0x1cab('0xc0')],{'as':_0x1cab('0xc0'),'onDelete':_0x1cab('0x159')});db[_0x1cab('0xfe')][_0x1cab('0x107')](db[_0x1cab('0x3b')],{'as':_0x1cab('0x15a'),'onDelete':_0x1cab('0x159')});db['CloudProvider'][_0x1cab('0x107')](db[_0x1cab('0x158')],{'as':_0x1cab('0x15b'),'onDelete':_0x1cab('0x159')});module[_0x1cab('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xbd08=['AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.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','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','userSetting','cascade','UserId','VoiceRecording','Recordings','VoiceQueuesRt','hasMany','HopperFinals','CmHopperHistory','HopperHistory','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','UserFaxQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Sound','Sounds','Members','VoiceQueueId','CmHopper','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Agents','UserVoiceQueue','TeamVoiceQueue','BlackLists','Messages','mailboxuser','VoiceQueueReport','QueueCalls','uniqueid','VoiceCallReport','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','restrict','CloudProviderId','Smtp','Dispositions','Interactions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','Teams','MailInteractionId','Account','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','Items','FaxAccountId','Applications','Trunk','user_has_fax_accounts','TagId','FaxInteractionId','Owner','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccount','Answers','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Interaction','UserSmsQueue','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatApplication','ChatQueueId','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','Website','Contacts','CompanyId','Phones','CmContactId','Hoppers','JscriptySessions','OpenchannelInteractions','ChatInteractions','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemTypeId','CmHopperId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Variable','VariableId','int_desk_configuration_has_tags','Field','ZendeskAccount','FreshdeskAccount','FreshdeskField','ServicenowAccount','Dynamics365Account','Dynamics365Configuration','FromId','SessionId','ProjectId','team_has_sms_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','ToUserId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','Extensions','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','ToWhatsappAccountId','UserWhatsappQueue','WhatsappQueueId','user','Imap','exports','../config/environment','lodash','jstz','sequelize','defaultsDeep','motion2','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','name','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../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','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbd08,0x162));var _0x8bd0=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xbd08[_0x176329];return _0x31997c;};'use strict';var config=require(_0x8bd0('0x0'));var Sequelize=require('sequelize');var _=require(_0x8bd0('0x1'));var jstz=require(_0x8bd0('0x2'));var timezone=jstz['determine']();config[_0x8bd0('0x3')]=_[_0x8bd0('0x4')](config['sequelize'],{'database':_0x8bd0('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x8bd0('0x6'),'port':0xcea,'dialect':_0x8bd0('0x7'),'dialectOptions':{'charset':_0x8bd0('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8bd0('0x9'),'collate':'utf8_general_ci'}}});config[_0x8bd0('0xa')]=_[_0x8bd0('0x4')](config[_0x8bd0('0xa')],{'database':_0x8bd0('0x5'),'username':'xcall','password':'xC@LL1234','options':{'host':_0x8bd0('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8bd0('0x8')},'logging':![],'timezone':timezone[_0x8bd0('0xb')](),'define':{'charset':_0x8bd0('0x9'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8bd0('0x3')][_0x8bd0('0xc')],config[_0x8bd0('0x3')][_0x8bd0('0xd')],config['sequelize'][_0x8bd0('0xe')],config[_0x8bd0('0x3')][_0x8bd0('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8bd0('0xa')]['database'],config[_0x8bd0('0xa')]['username'],config[_0x8bd0('0xa')]['password'],config[_0x8bd0('0xa')][_0x8bd0('0xf')])};db['User']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/user/user.model');db[_0x8bd0('0x11')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x12'));db[_0x8bd0('0x13')]=db['sequelize']['import'](_0x8bd0('0x14'));db[_0x8bd0('0x15')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x16'));db[_0x8bd0('0x17')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x18'));db[_0x8bd0('0x19')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x1a'));db['VoiceRecording']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x1b'));db[_0x8bd0('0x1c')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x1d'));db[_0x8bd0('0x1e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x1f'));db['VoiceCallReport']=db['sequelize'][_0x8bd0('0x10')]('../api/voiceCallReport/voiceCallReport.model');db[_0x8bd0('0x20')]=db['sequelize']['import'](_0x8bd0('0x21'));db[_0x8bd0('0x22')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x23'));db['VoiceQueueReport']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x24'));db[_0x8bd0('0x25')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x26'));db['Trunk']=db[_0x8bd0('0x3')]['import']('../api/trunk/trunk.model');db[_0x8bd0('0x27')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x28'));db[_0x8bd0('0x29')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x2a'));db['UserVoiceQueue']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x2b'));db[_0x8bd0('0x2c')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x2d'));db[_0x8bd0('0x2e')]=db['sequelize'][_0x8bd0('0x10')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x2f'));db['UserSmsQueue']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x30'));db[_0x8bd0('0x31')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize'][_0x8bd0('0x10')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x8bd0('0x32')]=db['sequelize'][_0x8bd0('0x10')]('../api/mailServerIn/mailServerIn.model');db[_0x8bd0('0x33')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x34'));db[_0x8bd0('0x35')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x36'));db[_0x8bd0('0x37')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x38'));db[_0x8bd0('0x39')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x3a'));db[_0x8bd0('0x3b')]=db[_0x8bd0('0x3')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x8bd0('0x3c')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x3d'));db[_0x8bd0('0x3e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x3f'));db[_0x8bd0('0x40')]=db['sequelize']['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x8bd0('0x41')]=db[_0x8bd0('0x3')]['import']('../api/dashboard/dashboard.model');db[_0x8bd0('0x42')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x43'));db[_0x8bd0('0x44')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x45'));db[_0x8bd0('0x46')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x47'));db[_0x8bd0('0x48')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x49'));db[_0x8bd0('0x4a')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x4b'));db[_0x8bd0('0x4c')]=db[_0x8bd0('0x3')]['import']('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x4d'));db['SmsAccount']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/smsAccount/smsAccount.model');db[_0x8bd0('0x4e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x4f'));db[_0x8bd0('0x50')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x51'));db[_0x8bd0('0x52')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x53'));db[_0x8bd0('0x54')]=db[_0x8bd0('0x3')]['import']('../api/smsQueue/smsQueue.model');db[_0x8bd0('0x55')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x56'));db['OpenchannelApplication']=db['sequelize']['import'](_0x8bd0('0x57'));db[_0x8bd0('0x58')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x59'));db['OpenchannelMessage']=db['sequelize']['import'](_0x8bd0('0x5a'));db[_0x8bd0('0x5b')]=db[_0x8bd0('0x3')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0x8bd0('0x5c')]=db['sequelize']['import'](_0x8bd0('0x5d'));db[_0x8bd0('0x5e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x5f'));db[_0x8bd0('0x60')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x61'));db['ChatMessage']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x62'));db['ChatOfflineMessage']=db['sequelize']['import'](_0x8bd0('0x63'));db[_0x8bd0('0x64')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x65'));db[_0x8bd0('0x66')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x67'));db[_0x8bd0('0x68')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x69'));db[_0x8bd0('0x6a')]=db['sequelize']['import'](_0x8bd0('0x6b'));db[_0x8bd0('0x6c')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x6d'));db['CmHopper']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x6e'));db[_0x8bd0('0x6f')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x8bd0('0x70')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x71'));db['CmHopperHistory']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x72'));db[_0x8bd0('0x73')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x74'));db[_0x8bd0('0x75')]=db['sequelize'][_0x8bd0('0x10')]('../api/cmCustomField/cmCustomField.model');db[_0x8bd0('0x76')]=db[_0x8bd0('0x3')]['import']('../api/action/action.model');db[_0x8bd0('0x77')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x78'));db[_0x8bd0('0x79')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x7a'));db[_0x8bd0('0x7b')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x7c'));db[_0x8bd0('0x7d')]=db[_0x8bd0('0x3')]['import']('../api/condition/condition.model');db[_0x8bd0('0x7e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/interval/interval.model');db[_0x8bd0('0x7f')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x80'));db[_0x8bd0('0x81')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x82'));db[_0x8bd0('0x83')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x84'));db[_0x8bd0('0x85')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x86'));db['Sound']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x87'));db[_0x8bd0('0x88')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x89'));db[_0x8bd0('0x8a')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x8b'));db[_0x8bd0('0x8c')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x8d'));db['CmHopperAdditionalPhone']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x8e'));db['Template']=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x8f'));db[_0x8bd0('0x90')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/trigger/trigger.model');db['Variable']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x91'));db['Integration']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x92'));db[_0x8bd0('0x93')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/integrationReport/integrationReport.model');db[_0x8bd0('0x94')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x95'));db[_0x8bd0('0x96')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x97'));db[_0x8bd0('0x98')]=db['sequelize']['import'](_0x8bd0('0x99'));db[_0x8bd0('0x9a')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x8bd0('0x9b')]=db['sequelize']['import'](_0x8bd0('0x9c'));db['SalesforceAccount']=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x9d'));db[_0x8bd0('0x9e')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x9f'));db['SalesforceField']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xa0'));db[_0x8bd0('0xa1')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xa2'));db[_0x8bd0('0xa3')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xa4'));db[_0x8bd0('0xa5')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xa6'));db[_0x8bd0('0xa7')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xa8'));db[_0x8bd0('0xa9')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xaa'));db[_0x8bd0('0xab')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xac'));db[_0x8bd0('0xad')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xae'));db[_0x8bd0('0xaf')]=db['sequelize']['import'](_0x8bd0('0xb0'));db[_0x8bd0('0xb1')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xb2'));db['ZendeskAccount']=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xb3'));db[_0x8bd0('0xb4')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xb5'));db[_0x8bd0('0xb6')]=db['sequelize'][_0x8bd0('0x10')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xb7'));db[_0x8bd0('0xb8')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xb9'));db[_0x8bd0('0xba')]=db['sequelize'][_0x8bd0('0x10')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8bd0('0xbb')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xbc'));db[_0x8bd0('0xbd')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xbe'));db['ServicenowAccount']=db['sequelize'][_0x8bd0('0x10')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x8bd0('0xbf')]=db['sequelize']['import'](_0x8bd0('0xc0'));db[_0x8bd0('0xc1')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db['sequelize']['import'](_0x8bd0('0xc2'));db['Dynamics365Configuration']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x8bd0('0xc3')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xc4'));db[_0x8bd0('0xc5')]=db['sequelize']['import'](_0x8bd0('0xc6'));db[_0x8bd0('0xc7')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x8bd0('0xc8')]=db['sequelize']['import'](_0x8bd0('0xc9'));db['Integration']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/integration/integration.model');db[_0x8bd0('0xca')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xcb'));db[_0x8bd0('0xcc')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xcd'));db[_0x8bd0('0xce')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xcf'));db[_0x8bd0('0xd0')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xd1'));db[_0x8bd0('0xd2')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xd3'));db[_0x8bd0('0xd4')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xd5'));db[_0x8bd0('0xd6')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xd7'));db['SquareReport']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/squareReport/squareReport.model');db[_0x8bd0('0xd8')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/squareReportDetail/squareReportDetail.model');db[_0x8bd0('0xd9')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xda'));db[_0x8bd0('0xdb')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xdc'));db['SquareOdbc']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/squareOdbc/squareOdbc.model');db[_0x8bd0('0xdd')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xde'));db[_0x8bd0('0xdf')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xe0'));db['SquareMessage']=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xe1'));db[_0x8bd0('0xe2')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xe3'));db[_0x8bd0('0xe4')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xe5'));db['Campaign']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/campaign/campaign.model');db[_0x8bd0('0xe6')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xe7'));db[_0x8bd0('0xe8')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xe9'));db[_0x8bd0('0xea')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xeb'));db[_0x8bd0('0xec')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xed'));db['ChatTransferReport']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/chatTransferReport/chatTransferReport.model');db[_0x8bd0('0xee')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xef'));db['OpenchannelTransferReport']=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0xf0'));db[_0x8bd0('0xf1')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xf2'));db[_0x8bd0('0xf3')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xf4'));db[_0x8bd0('0xf5')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xf6'));db[_0x8bd0('0xf7')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xf8'));db[_0x8bd0('0xf9')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xfa'));db[_0x8bd0('0xfb')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0xfc'));db[_0x8bd0('0xfd')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0xfe'));db[_0x8bd0('0xff')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x100'));db[_0x8bd0('0x101')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x102'));db['WhatsappInteraction']=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x103'));db[_0x8bd0('0x104')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x105'));db['WhatsappQueueReport']=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x106'));db[_0x8bd0('0x107')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x108'));db[_0x8bd0('0x109')]=db['sequelize'][_0x8bd0('0x10')](_0x8bd0('0x10a'));db['CloudProvider']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x8bd0('0x3')][_0x8bd0('0x10')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x8bd0('0x10b')]=db[_0x8bd0('0x3')][_0x8bd0('0x10')](_0x8bd0('0x10c'));db[_0x8bd0('0x10d')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x10e'));db[_0x8bd0('0x10f')]=db[_0x8bd0('0x3')]['import'](_0x8bd0('0x110'));db[_0x8bd0('0x111')]['hasOne'](db[_0x8bd0('0x1c')],{'as':_0x8bd0('0x1c'),'onDelete':'cascade','foreignKey':'UserId'});db[_0x8bd0('0x111')][_0x8bd0('0x112')](db['UserSetting'],{'as':_0x8bd0('0x113'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x115')});db['User']['hasMany'](db[_0x8bd0('0x116')],{'as':_0x8bd0('0x117'),'foreignKey':'UserId'});db[_0x8bd0('0x111')]['hasMany'](db[_0x8bd0('0x29')],{'as':_0x8bd0('0x118'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x8bd0('0x114'),'hooks':!![]});db['User'][_0x8bd0('0x119')](db[_0x8bd0('0x70')],{'as':_0x8bd0('0x11a'),'foreignKey':'UserId'});db[_0x8bd0('0x111')]['hasMany'](db[_0x8bd0('0x11b')],{'as':_0x8bd0('0x11c'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x111')]['hasMany'](db['ReportAgentPreview'],{'as':_0x8bd0('0x73'),'foreignKey':'UserId'});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db[_0x8bd0('0x58')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8bd0('0x115')});db['User']['hasMany'](db[_0x8bd0('0x50')],{'as':_0x8bd0('0x11d'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db[_0x8bd0('0x48')],{'as':_0x8bd0('0x11e'),'foreignKey':'UserId'});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db[_0x8bd0('0x3b')],{'as':_0x8bd0('0x11f'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x111')]['hasMany'](db[_0x8bd0('0x120')],{'as':'WhatsappInteractions','foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x111')][_0x8bd0('0x119')](db[_0x8bd0('0xfd')],{'as':_0x8bd0('0x121'),'foreignKey':_0x8bd0('0x122')});db[_0x8bd0('0x111')][_0x8bd0('0x123')](db[_0x8bd0('0xf7')],{'as':_0x8bd0('0xf7'),'foreignKey':_0x8bd0('0x124')});db['User'][_0x8bd0('0x125')](db[_0x8bd0('0x66')],{'as':_0x8bd0('0x126'),'through':'chat_group_has_users'});db[_0x8bd0('0x111')]['belongsToMany'](db[_0x8bd0('0x6c')],{'as':'Contacts','through':_0x8bd0('0x127')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x128'),'through':'cm_user_has_lists'});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x129')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db['MailInteraction'],{'as':_0x8bd0('0x11f'),'through':_0x8bd0('0x12a')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x60')],{'as':'ChatInteractions','through':_0x8bd0('0x12b')});db[_0x8bd0('0x111')]['belongsToMany'](db[_0x8bd0('0x48')],{'as':'FaxInteractions','through':_0x8bd0('0x12c')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x50')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x58')],{'as':'OpenchannelInteractions','through':_0x8bd0('0x12d')});db['User'][_0x8bd0('0x125')](db[_0x8bd0('0x120')],{'as':_0x8bd0('0x12e'),'through':_0x8bd0('0x12f')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x19')],{'as':_0x8bd0('0x130'),'through':'UserVoiceQueue','required':![]});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db['VoicePrefix'],{'as':_0x8bd0('0x131'),'through':_0x8bd0('0x10d'),'required':![]});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x37')],{'as':'MailQueues','through':_0x8bd0('0x2e'),'required':![]});db['User']['belongsToMany'](db[_0x8bd0('0x64')],{'as':_0x8bd0('0x132'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x4c')],{'as':_0x8bd0('0x133'),'through':_0x8bd0('0x134'),'required':![]});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db['SmsQueue'],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x8bd0('0x111')]['belongsToMany'](db[_0x8bd0('0x5b')],{'as':_0x8bd0('0x135'),'through':'UserOpenchannelQueue','required':![]});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db['WhatsappQueue'],{'as':_0x8bd0('0x136'),'through':'UserWhatsappQueue','required':![]});db[_0x8bd0('0x111')]['belongsToMany'](db['CmList'],{'through':_0x8bd0('0x137')});db[_0x8bd0('0x111')]['belongsToMany'](db[_0x8bd0('0x5c')],{'as':_0x8bd0('0x138'),'through':_0x8bd0('0x139')});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db['FaxAccount'],{'as':_0x8bd0('0x13a'),'through':'user_has_fax_accounts'});db[_0x8bd0('0x111')][_0x8bd0('0x125')](db[_0x8bd0('0x35')],{'as':_0x8bd0('0x13b'),'through':_0x8bd0('0x13c')});db[_0x8bd0('0x111')]['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0x8bd0('0x13d')});db['User'][_0x8bd0('0x125')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x8bd0('0x13e')});db['User'][_0x8bd0('0x125')](db[_0x8bd0('0xff')],{'as':_0x8bd0('0x13f'),'through':_0x8bd0('0x140')});db['VoiceChanSpy'][_0x8bd0('0x119')](db[_0x8bd0('0x15')],{'as':_0x8bd0('0x141'),'onDelete':_0x8bd0('0x114'),'foreignKey':'ChanSpyId'});db[_0x8bd0('0x13')][_0x8bd0('0x119')](db[_0x8bd0('0x15')],{'onDelete':'cascade'});db['VoiceExtension']['hasMany'](db[_0x8bd0('0x15')],{'as':'Applications','onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x17')]['belongsToMany'](db[_0x8bd0('0x142')],{'as':_0x8bd0('0x143'),'through':'moh_has_sounds'});db[_0x8bd0('0x19')][_0x8bd0('0x119')](db['UserVoiceQueueRt'],{'as':_0x8bd0('0x144'),'foreignKey':_0x8bd0('0x145')});db['VoiceQueue'][_0x8bd0('0x119')](db[_0x8bd0('0x146')],{'as':'Hoppers','foreignKey':_0x8bd0('0x145')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':_0x8bd0('0x11a'),'foreignKey':_0x8bd0('0x145')});db[_0x8bd0('0x19')]['hasMany'](db[_0x8bd0('0x11b')],{'as':_0x8bd0('0x147'),'foreignKey':_0x8bd0('0x145')});db[_0x8bd0('0x19')][_0x8bd0('0x119')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x8bd0('0x145')});db[_0x8bd0('0x19')]['hasMany'](db['CmHopperBlack'],{'as':_0x8bd0('0x148'),'foreignKey':'VoiceQueueId'});db[_0x8bd0('0x19')][_0x8bd0('0x119')](db[_0x8bd0('0xd4')],{'as':'JscriptySessions','foreignKey':_0x8bd0('0x145')});db[_0x8bd0('0x19')][_0x8bd0('0x123')](db['Trunk'],{'as':'Trunk','foreignKey':_0x8bd0('0x149')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x8bd0('0x14a'),'foreignKey':_0x8bd0('0x14b')});db[_0x8bd0('0x19')][_0x8bd0('0x123')](db[_0x8bd0('0x7e')],{'as':_0x8bd0('0x7e'),'foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x19')]['belongsTo'](db[_0x8bd0('0x7f')],{'as':_0x8bd0('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x8bd0('0x125')](db['CmList'],{'as':_0x8bd0('0x128'),'through':'voice_queues_has_cm_lists'});db[_0x8bd0('0x19')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x14f')});db[_0x8bd0('0x19')][_0x8bd0('0x125')](db['Team'],{'as':'Teams','through':_0x8bd0('0x150')});db[_0x8bd0('0x19')][_0x8bd0('0x125')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x151'),'through':'voice_queues_has_cm_blacklists'});db[_0x8bd0('0x116')]['belongsTo'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x111'),'foreignKey':'UserId'});db['ScreenRecording'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x111'),'foreignKey':'UserId'});db['VoiceMail'][_0x8bd0('0x119')](db[_0x8bd0('0x1e')],{'as':_0x8bd0('0x152'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x8bd0('0x1e')]['belongsTo'](db[_0x8bd0('0x1c')],{'foreignKey':_0x8bd0('0x153'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0x8bd0('0x154')],{'as':_0x8bd0('0x155'),'foreignKey':_0x8bd0('0x156'),'constraints':![]});db[_0x8bd0('0x157')][_0x8bd0('0x119')](db[_0x8bd0('0x22')],{'as':_0x8bd0('0x158'),'foreignKey':_0x8bd0('0x156'),'constraints':![]});db[_0x8bd0('0x157')][_0x8bd0('0x123')](db['User'],{'as':_0x8bd0('0x111'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x157')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x32')]['belongsTo'](db[_0x8bd0('0x35')],{'as':_0x8bd0('0x35'),'foreignKey':_0x8bd0('0x15b')});db[_0x8bd0('0x32')]['belongsTo'](db[_0x8bd0('0x15c')],{'as':_0x8bd0('0x15c'),'foreignKey':'CloudProviderId','onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x33')][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{'as':'MailAccount','foreignKey':_0x8bd0('0x15b')});db[_0x8bd0('0x33')][_0x8bd0('0x123')](db[_0x8bd0('0x15c')],{'as':_0x8bd0('0x15c'),'foreignKey':_0x8bd0('0x15e'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x35')][_0x8bd0('0x112')](db[_0x8bd0('0x32')],{'as':'Imap','onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x35')]['hasOne'](db[_0x8bd0('0x33')],{'as':_0x8bd0('0x15f'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x35')]['hasMany'](db[_0x8bd0('0x7b')],{'as':_0x8bd0('0x160'),'foreignKey':_0x8bd0('0x15b'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x35')][_0x8bd0('0x119')](db[_0x8bd0('0x79')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x8bd0('0x35')][_0x8bd0('0x119')](db['MailMessage'],{'as':'Messages','foreignKey':_0x8bd0('0x15b')});db[_0x8bd0('0x35')][_0x8bd0('0x119')](db[_0x8bd0('0x3b')],{'as':_0x8bd0('0x161')});db[_0x8bd0('0x35')][_0x8bd0('0x119')](db[_0x8bd0('0x3e')],{'as':'Applications'});db[_0x8bd0('0x35')][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0x35')][_0x8bd0('0x123')](db[_0x8bd0('0x164')],{'as':'Template','foreignKey':_0x8bd0('0x165')});db[_0x8bd0('0x35')]['belongsTo'](db[_0x8bd0('0x7f')],{'as':_0x8bd0('0x14d'),'foreignKey':_0x8bd0('0x166')});db[_0x8bd0('0x35')]['belongsToMany'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x13c')});db['MailQueue'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x2e')});db[_0x8bd0('0x37')][_0x8bd0('0x125')](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x167'),'as':_0x8bd0('0x168')});db[_0x8bd0('0x3b')]['hasMany'](db[_0x8bd0('0x3c')],{'as':'Messages','onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x169')});db[_0x8bd0('0x3b')][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{'as':_0x8bd0('0x16a'),'foreignKey':'MailAccountId'});db[_0x8bd0('0x3b')]['belongsTo'](db['CmContact'],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x3b')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':'Owner','foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x3b')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x8bd0('0x16b')});db['MailInteraction'][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x16c'),'as':_0x8bd0('0x16d')});db['MailInteraction'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x16e'),'through':_0x8bd0('0x12a'),'foreignKey':_0x8bd0('0x169')});db['MailMessage'][_0x8bd0('0x119')](db['Attachment'],{'as':_0x8bd0('0x16f'),'onDelete':'cascade'});db[_0x8bd0('0x3c')][_0x8bd0('0x123')](db['User'],{'as':'User'});db[_0x8bd0('0x3c')]['belongsTo'](db[_0x8bd0('0x6c')],{'onDelete':_0x8bd0('0x114'),'as':_0x8bd0('0x159')});db['MailMessage'][_0x8bd0('0x123')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x8bd0('0x169')});db[_0x8bd0('0x3c')]['belongsTo'](db[_0x8bd0('0x35')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x15b')});db['MailMessage'][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{'as':_0x8bd0('0x5c'),'foreignKey':_0x8bd0('0x170')});db[_0x8bd0('0x3c')][_0x8bd0('0x123')](db[_0x8bd0('0x171')],{'as':'ChatOfflineMessage','foreignKey':_0x8bd0('0x172')});db[_0x8bd0('0x3e')]['belongsTo'](db[_0x8bd0('0x111')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x3e')][_0x8bd0('0x123')](db[_0x8bd0('0x37')],{'onDelete':'restrict'});db['MailApplication'][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{'onDelete':'restrict'});db[_0x8bd0('0x3e')]['belongsTo'](db[_0x8bd0('0x7e')],{'onDelete':'restrict','foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x3e')][_0x8bd0('0x123')](db[_0x8bd0('0x88')],{'onDelete':_0x8bd0('0x15d'),'foreignKey':'TagId'});db[_0x8bd0('0x40')][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{});db[_0x8bd0('0x40')][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':'List','foreignKey':_0x8bd0('0x163')});db['MailQueueReport'][_0x8bd0('0x123')](db['CmContact'],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db['MailQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x3b')],{});db[_0x8bd0('0x40')][_0x8bd0('0x123')](db[_0x8bd0('0x3c')],{});db[_0x8bd0('0x40')][_0x8bd0('0x123')](db['User'],{});db[_0x8bd0('0x40')][_0x8bd0('0x123')](db[_0x8bd0('0x37')],{});db[_0x8bd0('0x41')][_0x8bd0('0x119')](db[_0x8bd0('0x42')],{'as':_0x8bd0('0x173'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x44')][_0x8bd0('0x119')](db[_0x8bd0('0x7b')],{'as':'Dispositions','foreignKey':_0x8bd0('0x174'),'onDelete':_0x8bd0('0x114')});db['FaxAccount'][_0x8bd0('0x119')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8bd0('0x174')});db[_0x8bd0('0x44')][_0x8bd0('0x119')](db[_0x8bd0('0x48')],{'as':'Interactions'});db[_0x8bd0('0x44')][_0x8bd0('0x119')](db[_0x8bd0('0x46')],{'as':_0x8bd0('0x175')});db[_0x8bd0('0x44')]['hasMany'](db[_0x8bd0('0x15')],{'as':'Exntensions','onDelete':_0x8bd0('0x114')});db['FaxAccount'][_0x8bd0('0x119')](db[_0x8bd0('0x4a')],{'as':_0x8bd0('0x152')});db[_0x8bd0('0x44')][_0x8bd0('0x123')](db[_0x8bd0('0x176')],{'as':_0x8bd0('0x176')});db[_0x8bd0('0x44')]['belongsTo'](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db['FaxAccount'][_0x8bd0('0x123')](db[_0x8bd0('0x7f')],{'as':_0x8bd0('0x14d'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':'Agents','through':_0x8bd0('0x177')});db[_0x8bd0('0x46')]['belongsTo'](db[_0x8bd0('0x111')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x46')][_0x8bd0('0x123')](db[_0x8bd0('0x4c')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x46')]['belongsTo'](db['FaxAccount'],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x46')]['belongsTo'](db[_0x8bd0('0x88')],{'onDelete':_0x8bd0('0x15d'),'foreignKey':_0x8bd0('0x178')});db[_0x8bd0('0x48')][_0x8bd0('0x119')](db['FaxMessage'],{'as':_0x8bd0('0x152'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x179')});db[_0x8bd0('0x48')]['belongsTo'](db[_0x8bd0('0x44')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x174')});db[_0x8bd0('0x48')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':'Contact','foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x48')][_0x8bd0('0x123')](db['User'],{'as':_0x8bd0('0x17a'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x48')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x8bd0('0x48')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0x8bd0('0x48')]['belongsToMany'](db[_0x8bd0('0x111')],{'as':'Users','through':_0x8bd0('0x12c'),'foreignKey':_0x8bd0('0x179')});db[_0x8bd0('0x4a')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'onDelete':'cascade','as':_0x8bd0('0x111')});db[_0x8bd0('0x4a')][_0x8bd0('0x123')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x8bd0('0x179')});db[_0x8bd0('0x4a')][_0x8bd0('0x123')](db['CmContact'],{'onDelete':_0x8bd0('0x114'),'as':'Contact'});db[_0x8bd0('0x4a')][_0x8bd0('0x123')](db[_0x8bd0('0xe8')],{'as':_0x8bd0('0xe8'),'foreignKey':_0x8bd0('0x17b')});db[_0x8bd0('0x4a')]['belongsTo'](db['FaxAccount'],{'as':_0x8bd0('0x16a'),'foreignKey':'FaxAccountId'});db[_0x8bd0('0x4c')]['belongsToMany'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':'UserFaxQueue'});db[_0x8bd0('0x4c')][_0x8bd0('0x125')](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x17c'),'as':_0x8bd0('0x168')});db[_0x8bd0('0x17d')]['belongsTo'](db[_0x8bd0('0x44')],{});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0x48')],{});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0x4a')],{});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{});db[_0x8bd0('0x17d')][_0x8bd0('0x123')](db[_0x8bd0('0x4c')],{});db[_0x8bd0('0x17e')][_0x8bd0('0x119')](db[_0x8bd0('0x7b')],{'as':_0x8bd0('0x160'),'foreignKey':'SmsAccountId','onDelete':_0x8bd0('0x114')});db['SmsAccount'][_0x8bd0('0x119')](db[_0x8bd0('0x79')],{'as':_0x8bd0('0x17f'),'foreignKey':_0x8bd0('0x180')});db['SmsAccount']['hasMany'](db[_0x8bd0('0x52')],{'as':_0x8bd0('0x152'),'foreignKey':_0x8bd0('0x180')});db[_0x8bd0('0x17e')][_0x8bd0('0x119')](db[_0x8bd0('0x50')],{'as':_0x8bd0('0x161')});db[_0x8bd0('0x17e')][_0x8bd0('0x119')](db[_0x8bd0('0x4e')],{'as':_0x8bd0('0x175')});db['SmsAccount']['belongsTo'](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0x17e')][_0x8bd0('0x123')](db[_0x8bd0('0x7f')],{'as':_0x8bd0('0x14d'),'foreignKey':_0x8bd0('0x166')});db['SmsAccount'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x13e')});db['SmsApplication'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x4e')][_0x8bd0('0x123')](db[_0x8bd0('0x54')],{'onDelete':_0x8bd0('0x15d')});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x4e')][_0x8bd0('0x123')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x4e')][_0x8bd0('0x123')](db[_0x8bd0('0x88')],{'onDelete':'restrict','foreignKey':_0x8bd0('0x178')});db[_0x8bd0('0x50')][_0x8bd0('0x119')](db['SmsMessage'],{'as':'Messages','onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x181')});db[_0x8bd0('0x50')]['belongsTo'](db[_0x8bd0('0x17e')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x180')});db[_0x8bd0('0x50')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db['SmsInteraction'][_0x8bd0('0x123')](db['User'],{'as':_0x8bd0('0x17a'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x50')]['belongsToMany'](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x182'),'as':_0x8bd0('0x16b')});db['SmsInteraction'][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x182'),'as':'ThroughTags'});db[_0x8bd0('0x50')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x16e'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x8bd0('0x52')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x111')});db[_0x8bd0('0x52')][_0x8bd0('0x123')](db['CmContact'],{'onDelete':_0x8bd0('0x114'),'as':'Contact'});db[_0x8bd0('0x52')][_0x8bd0('0x123')](db[_0x8bd0('0x50')],{'onDelete':_0x8bd0('0x114'),'as':_0x8bd0('0x183'),'foreignKey':_0x8bd0('0x181')});db[_0x8bd0('0x52')][_0x8bd0('0x123')](db[_0x8bd0('0x17e')],{'as':'Account','foreignKey':_0x8bd0('0x180')});db[_0x8bd0('0x54')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x184'),'foreignKey':_0x8bd0('0x185')});db[_0x8bd0('0x54')][_0x8bd0('0x125')](db[_0x8bd0('0xe2')],{'through':'team_has_sms_queues','as':_0x8bd0('0x168')});db[_0x8bd0('0x55')][_0x8bd0('0x119')](db['Disposition'],{'as':_0x8bd0('0x160'),'foreignKey':_0x8bd0('0x186'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x55')][_0x8bd0('0x119')](db[_0x8bd0('0x79')],{'as':_0x8bd0('0x17f'),'foreignKey':_0x8bd0('0x186')});db['OpenchannelAccount'][_0x8bd0('0x119')](db[_0x8bd0('0x58')],{'as':_0x8bd0('0x161'),'foreignKey':_0x8bd0('0x186')});db[_0x8bd0('0x55')][_0x8bd0('0x119')](db[_0x8bd0('0x187')],{'as':_0x8bd0('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0x8bd0('0x55')][_0x8bd0('0x119')](db['OpenchannelApplication'],{'as':_0x8bd0('0x175'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0x55')][_0x8bd0('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8bd0('0x55')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x8bd0('0x188')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x188')][_0x8bd0('0x123')](db[_0x8bd0('0x5b')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x8bd0('0x123')](db[_0x8bd0('0x55')],{'onDelete':'restrict','foreignKey':_0x8bd0('0x186')});db[_0x8bd0('0x188')][_0x8bd0('0x123')](db['Interval'],{'onDelete':_0x8bd0('0x15d'),'foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x188')][_0x8bd0('0x123')](db[_0x8bd0('0x88')],{'onDelete':_0x8bd0('0x15d'),'foreignKey':_0x8bd0('0x178')});db['OpenchannelInteraction']['hasMany'](db[_0x8bd0('0x187')],{'as':_0x8bd0('0x152'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x8bd0('0x58')][_0x8bd0('0x123')](db['OpenchannelAccount'],{'as':_0x8bd0('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':'Contact','foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x58')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x17a'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x58')]['belongsToMany'](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x189'),'as':_0x8bd0('0x16b')});db[_0x8bd0('0x58')][_0x8bd0('0x125')](db['Tag'],{'through':_0x8bd0('0x189'),'as':_0x8bd0('0x16d')});db[_0x8bd0('0x58')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x16e'),'through':_0x8bd0('0x12d'),'foreignKey':_0x8bd0('0x18a')});db[_0x8bd0('0x187')]['belongsTo'](db[_0x8bd0('0x111')],{'onDelete':'cascade','as':_0x8bd0('0x111')});db['OpenchannelMessage'][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'onDelete':'cascade','as':_0x8bd0('0x159')});db['OpenchannelMessage'][_0x8bd0('0x123')](db[_0x8bd0('0x58')],{'onDelete':_0x8bd0('0x114'),'as':'Interaction','foreignKey':_0x8bd0('0x18a')});db[_0x8bd0('0x187')]['belongsTo'](db[_0x8bd0('0xe8')],{'as':_0x8bd0('0xe8'),'foreignKey':'AttachmentId'});db[_0x8bd0('0x187')][_0x8bd0('0x123')](db['OpenchannelAccount'],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x186')});db[_0x8bd0('0x5b')][_0x8bd0('0x125')](db['User'],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x31'),'foreignKey':_0x8bd0('0x18b')});db[_0x8bd0('0x5b')]['belongsToMany'](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x18c'),'as':_0x8bd0('0x168')});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db[_0x8bd0('0x7b')],{'as':_0x8bd0('0x160'),'foreignKey':_0x8bd0('0x170'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db[_0x8bd0('0x79')],{'as':_0x8bd0('0x17f'),'foreignKey':_0x8bd0('0x170')});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db[_0x8bd0('0x68')],{'as':'ProactiveActions'});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db['ChatInteraction'],{'as':'Interactions'});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db[_0x8bd0('0x18d')],{'as':_0x8bd0('0x175')});db[_0x8bd0('0x5c')][_0x8bd0('0x119')](db['ChatMessage'],{'as':_0x8bd0('0x152')});db[_0x8bd0('0x5c')]['belongsTo'](db['CmList'],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db['ChatWebsite'][_0x8bd0('0x123')](db['Interval'],{'as':_0x8bd0('0x7e'),'foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x5c')]['belongsTo'](db[_0x8bd0('0x35')],{'as':'MailAccount','foreignKey':_0x8bd0('0x15b')});db[_0x8bd0('0x5c')][_0x8bd0('0x123')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x8bd0('0x166')});db[_0x8bd0('0x5c')]['belongsToMany'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x139')});db['OpenchannelQueueReport']['belongsTo'](db[_0x8bd0('0x55')],{});db[_0x8bd0('0x5e')][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':'List','foreignKey':_0x8bd0('0x163')});db['OpenchannelQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x5e')]['belongsTo'](db[_0x8bd0('0x58')],{});db[_0x8bd0('0x5e')][_0x8bd0('0x123')](db['OpenchannelMessage'],{});db[_0x8bd0('0x5e')][_0x8bd0('0x123')](db['User'],{});db[_0x8bd0('0x5e')][_0x8bd0('0x123')](db['OpenchannelQueue'],{});db[_0x8bd0('0x18d')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':'Agent','foreignKey':_0x8bd0('0x115'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x18d')][_0x8bd0('0x123')](db[_0x8bd0('0x64')],{'as':'Queue','foreignKey':_0x8bd0('0x18e'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x18d')]['belongsTo'](db[_0x8bd0('0x5c')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x18d')]['belongsTo'](db['Tag'],{'onDelete':_0x8bd0('0x15d'),'foreignKey':_0x8bd0('0x178')});db[_0x8bd0('0x60')]['hasMany'](db[_0x8bd0('0x18f')],{'as':_0x8bd0('0x152'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x190')});db['ChatInteraction'][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{'as':_0x8bd0('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x8bd0('0x60')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x60')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x17a'),'foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x60')][_0x8bd0('0x125')](db['Tag'],{'through':_0x8bd0('0x191'),'as':_0x8bd0('0x16b')});db['ChatInteraction']['belongsToMany'](db[_0x8bd0('0x88')],{'through':'chat_interaction_has_tags','as':_0x8bd0('0x16d')});db['ChatInteraction'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0x8bd0('0x190')});db[_0x8bd0('0x18f')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'onDelete':'cascade','as':_0x8bd0('0x111')});db[_0x8bd0('0x18f')][_0x8bd0('0x123')](db['CmContact'],{'onDelete':_0x8bd0('0x114'),'as':'Contact','foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x18f')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0x8bd0('0x183'),'foreignKey':_0x8bd0('0x190')});db[_0x8bd0('0x18f')][_0x8bd0('0x123')](db['Attachment'],{'as':'Attachment','foreignKey':_0x8bd0('0x17b')});db[_0x8bd0('0x18f')][_0x8bd0('0x123')](db['ChatWebsite'],{'as':_0x8bd0('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0x8bd0('0x171')][_0x8bd0('0x119')](db[_0x8bd0('0xe8')],{'as':'Attachments','foreignKey':_0x8bd0('0x172'),'onDelete':'cascade','hooks':!![]});db[_0x8bd0('0x171')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'onDelete':_0x8bd0('0x114'),'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x171')][_0x8bd0('0x123')](db['ChatWebsite'],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x170')});db[_0x8bd0('0x64')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x2c'),'hooks':!![]});db[_0x8bd0('0x64')][_0x8bd0('0x125')](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x192'),'as':_0x8bd0('0x168')});db[_0x8bd0('0x66')][_0x8bd0('0x119')](db[_0x8bd0('0xce')],{'as':_0x8bd0('0x152'),'foreignKey':'ChatGroupId','onDelete':_0x8bd0('0x114')});db['ChatGroup'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x144'),'through':'chat_group_has_users'});db[_0x8bd0('0x68')][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{'as':_0x8bd0('0x193'),'foreignKey':'ChatWebsiteId'});db[_0x8bd0('0x6a')][_0x8bd0('0x119')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x194'),'foreignKey':_0x8bd0('0x195')});db['CmContact'][_0x8bd0('0x119')](db[_0x8bd0('0x8c')],{'as':_0x8bd0('0x196'),'foreignKey':_0x8bd0('0x197')});db[_0x8bd0('0x6c')]['hasMany'](db[_0x8bd0('0x146')],{'as':_0x8bd0('0x198'),'foreignKey':_0x8bd0('0x15a')});db['CmContact'][_0x8bd0('0x119')](db['CmHopperFinal'],{'as':_0x8bd0('0x11a'),'foreignKey':_0x8bd0('0x15a')});db['CmContact'][_0x8bd0('0x119')](db[_0x8bd0('0x11b')],{'as':_0x8bd0('0x147'),'foreignKey':_0x8bd0('0x15a')});db['CmContact'][_0x8bd0('0x119')](db[_0x8bd0('0x73')],{'as':_0x8bd0('0x73'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0x6c')][_0x8bd0('0x119')](db[_0x8bd0('0xd4')],{'as':_0x8bd0('0x199'),'foreignKey':'ContactId'});db[_0x8bd0('0x6c')]['hasMany'](db[_0x8bd0('0x58')],{'as':_0x8bd0('0x19a'),'foreignKey':_0x8bd0('0x15a'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x6c')][_0x8bd0('0x119')](db[_0x8bd0('0x60')],{'as':_0x8bd0('0x19b'),'foreignKey':_0x8bd0('0x15a'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x6c')][_0x8bd0('0x119')](db[_0x8bd0('0x50')],{'as':_0x8bd0('0x11d'),'foreignKey':'ContactId','onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x6c')]['hasMany'](db[_0x8bd0('0x48')],{'as':_0x8bd0('0x11e'),'foreignKey':_0x8bd0('0x15a'),'onDelete':'restrict'});db[_0x8bd0('0x6c')][_0x8bd0('0x119')](db[_0x8bd0('0x3b')],{'as':'MailInteractions','foreignKey':_0x8bd0('0x15a'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x6c')]['belongsTo'](db['CmCompany'],{'as':_0x8bd0('0x19c'),'foreignKey':_0x8bd0('0x195')});db[_0x8bd0('0x6c')]['belongsTo'](db['CmList'],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x6c')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x16e'),'through':_0x8bd0('0x127')});db[_0x8bd0('0x6c')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'as':_0x8bd0('0x16b'),'through':_0x8bd0('0x19d')});db[_0x8bd0('0x6c')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x19d'),'as':'ThroughTags'});db['CmHopper'][_0x8bd0('0x119')](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0x8bd0('0x146')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':'Contact','foreignKey':_0x8bd0('0x15a'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x146')][_0x8bd0('0x123')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x146')][_0x8bd0('0x123')](db['User'],{'as':'Agent','foreignKey':_0x8bd0('0x115')});db[_0x8bd0('0x146')][_0x8bd0('0x123')](db[_0x8bd0('0x19')],{'as':_0x8bd0('0x19e'),'foreignKey':_0x8bd0('0x145'),'onDelete':'cascade'});db[_0x8bd0('0x146')][_0x8bd0('0x123')](db[_0x8bd0('0x19f')],{'as':_0x8bd0('0x19f'),'foreignKey':_0x8bd0('0x1a0'),'onDelete':_0x8bd0('0x114')});db['CmHopper'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x17a'),'foreignKey':_0x8bd0('0x1a1')});db[_0x8bd0('0x6f')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a'),'onDelete':_0x8bd0('0x114')});db['CmHopperBlack']['belongsTo'](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x8bd0('0x19')],{'as':'Queue','foreignKey':_0x8bd0('0x145'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x6f')][_0x8bd0('0x123')](db[_0x8bd0('0x19f')],{'as':'Campaign','foreignKey':_0x8bd0('0x1a0'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x77')][_0x8bd0('0x119')](db['Condition'],{'as':{'plural':'All','singular':_0x8bd0('0x1a2')},'foreignKey':_0x8bd0('0x1a3'),'onDelete':_0x8bd0('0x114'),'hooks':!![]});db[_0x8bd0('0x77')][_0x8bd0('0x119')](db['Condition'],{'as':{'plural':'Any','singular':_0x8bd0('0x1a4')},'foreignKey':_0x8bd0('0x1a5'),'onDelete':'cascade','hooks':!![]});db[_0x8bd0('0x77')][_0x8bd0('0x119')](db[_0x8bd0('0x76')],{'as':_0x8bd0('0x1a6'),'foreignKey':'AutomationId','onDelete':_0x8bd0('0x114'),'hooks':!![]});db[_0x8bd0('0x7b')][_0x8bd0('0x119')](db[_0x8bd0('0x7b')],{'as':_0x8bd0('0x160'),'foreignKey':_0x8bd0('0x1a7'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0x7e')][_0x8bd0('0x119')](db[_0x8bd0('0x7e')],{'as':_0x8bd0('0x1a8'),'foreignKey':_0x8bd0('0x14c'),'onDelete':_0x8bd0('0x114'),'hooks':!![],'required':![]});db[_0x8bd0('0x7e')][_0x8bd0('0x119')](db[_0x8bd0('0x15')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x8bd0('0x15d')});db['Interval'][_0x8bd0('0x119')](db[_0x8bd0('0x3e')],{'as':_0x8bd0('0x1a9'),'foreignKey':'IntervalId'});db[_0x8bd0('0x7e')][_0x8bd0('0x119')](db[_0x8bd0('0x18d')],{'as':_0x8bd0('0x1aa'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db[_0x8bd0('0x46')],{'as':'FaxApplications','foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x7e')][_0x8bd0('0x119')](db[_0x8bd0('0x4e')],{'as':'SmsApplications','foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x85')][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{});db[_0x8bd0('0x85')][_0x8bd0('0x123')](db['AnalyticDefaultReport'],{'foreignKey':_0x8bd0('0x1ab')});db[_0x8bd0('0x85')][_0x8bd0('0x123')](db[_0x8bd0('0x94')],{'foreignKey':_0x8bd0('0x1ac')});db[_0x8bd0('0x142')]['belongsToMany'](db[_0x8bd0('0x17')],{'as':_0x8bd0('0x1ad'),'through':_0x8bd0('0x1ae'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x88')]['belongsToMany'](db[_0x8bd0('0x6c')],{'through':'cm_contact_has_tags'});db[_0x8bd0('0x88')][_0x8bd0('0x125')](db[_0x8bd0('0x60')],{'through':_0x8bd0('0x191')});db[_0x8bd0('0x88')][_0x8bd0('0x125')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x8bd0('0x88')][_0x8bd0('0x125')](db[_0x8bd0('0x50')],{'through':'sms_interaction_has_tags'});db[_0x8bd0('0x88')]['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x8bd0('0x88')][_0x8bd0('0x125')](db['OpenchannelInteraction'],{'through':_0x8bd0('0x189')});db[_0x8bd0('0x88')][_0x8bd0('0x125')](db[_0x8bd0('0x120')],{'through':_0x8bd0('0x1af')});db[_0x8bd0('0x8c')][_0x8bd0('0x123')](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x8bd0('0x1b0')});db['CmHopperAdditionalPhone'][_0x8bd0('0x123')](db[_0x8bd0('0x146')],{'as':'Hopper','foreignKey':_0x8bd0('0x1b1')});db[_0x8bd0('0x8c')]['belongsTo'](db['CmContact'],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x197')});db[_0x8bd0('0x90')]['hasMany'](db[_0x8bd0('0x7d')],{'as':{'plural':_0x8bd0('0x1b2'),'singular':_0x8bd0('0x1b3')},'foreignKey':'TriggerAllId','onDelete':_0x8bd0('0x114'),'hooks':!![]});db['Trigger'][_0x8bd0('0x119')](db[_0x8bd0('0x7d')],{'as':{'plural':_0x8bd0('0x1b4'),'singular':_0x8bd0('0x1b5')},'foreignKey':_0x8bd0('0x1b6'),'onDelete':_0x8bd0('0x114'),'hooks':!![]});db[_0x8bd0('0x90')][_0x8bd0('0x119')](db[_0x8bd0('0x76')],{'as':_0x8bd0('0x1a6'),'foreignKey':_0x8bd0('0x1b7'),'onDelete':_0x8bd0('0x114'),'hooks':!![]});db['AnalyticCustomReport'][_0x8bd0('0x119')](db[_0x8bd0('0x1b8')],{'as':_0x8bd0('0x1b9'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1ac'),'hooks':!![]});db[_0x8bd0('0x96')][_0x8bd0('0x119')](db[_0x8bd0('0x1b8')],{'as':_0x8bd0('0x1b9'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1ab')});db[_0x8bd0('0x9a')]['hasMany'](db[_0x8bd0('0x1b8')],{'as':_0x8bd0('0x1b9'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1ba')});db[_0x8bd0('0x1b8')][_0x8bd0('0x123')](db[_0x8bd0('0x9a')],{'foreignKey':_0x8bd0('0x1ba')});db[_0x8bd0('0x1bb')]['hasMany'](db[_0x8bd0('0x9e')],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0x9e')][_0x8bd0('0x119')](db[_0x8bd0('0x1be')],{'as':_0x8bd0('0x1bf'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c0')});db['SalesforceConfiguration']['hasMany'](db[_0x8bd0('0x1be')],{'as':_0x8bd0('0x1c1'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0x9e')][_0x8bd0('0x119')](db[_0x8bd0('0x1be')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0x9e')][_0x8bd0('0x123')](db[_0x8bd0('0x1bb')],{'as':_0x8bd0('0x16a'),'foreignKey':'AccountId'});db[_0x8bd0('0x1be')][_0x8bd0('0x119')](db[_0x8bd0('0x1be')],{'as':_0x8bd0('0x1c4'),'foreignKey':'SubjectId'});db['SalesforceField'][_0x8bd0('0x119')](db['SalesforceField'],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0x1be')][_0x8bd0('0x119')](db['SalesforceField'],{'as':'Field','foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0x1be')][_0x8bd0('0x123')](db['Variable'],{'as':_0x8bd0('0x1c6'),'foreignKey':'VariableId'});db[_0x8bd0('0xa1')][_0x8bd0('0x119')](db[_0x8bd0('0xa3')],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xa3')][_0x8bd0('0x119')](db[_0x8bd0('0xa5')],{'as':_0x8bd0('0x1bf'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xa3')][_0x8bd0('0x119')](db[_0x8bd0('0xa5')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8bd0('0xa3')][_0x8bd0('0x119')](db[_0x8bd0('0xa5')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0x8bd0('0xa3')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x8bd0('0x16a'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x8bd0('0x119')](db[_0x8bd0('0xa5')],{'as':_0x8bd0('0x1c4'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xa5')]['hasMany'](db[_0x8bd0('0xa5')],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db['SugarcrmField'][_0x8bd0('0x119')](db['SugarcrmField'],{'as':'Field','foreignKey':'FieldId'});db[_0x8bd0('0xa5')]['belongsTo'](db['Variable'],{'as':_0x8bd0('0x1c6'),'foreignKey':_0x8bd0('0x1c7')});db[_0x8bd0('0xa7')][_0x8bd0('0x119')](db[_0x8bd0('0xa9')],{'as':_0x8bd0('0x1bc'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1bd')});db['DeskConfiguration'][_0x8bd0('0x119')](db['DeskField'],{'as':_0x8bd0('0x1bf'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8bd0('0xa9')][_0x8bd0('0x119')](db[_0x8bd0('0xab')],{'as':_0x8bd0('0x1c1'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xa9')]['hasMany'](db[_0x8bd0('0xab')],{'as':_0x8bd0('0x1b9'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xa9')]['belongsTo'](db[_0x8bd0('0xa7')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xa9')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x1c8')});db[_0x8bd0('0xab')][_0x8bd0('0x119')](db[_0x8bd0('0xab')],{'as':_0x8bd0('0x1c4'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xab')][_0x8bd0('0x119')](db['DeskField'],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xab')]['hasMany'](db[_0x8bd0('0xab')],{'as':_0x8bd0('0x1c9'),'foreignKey':'FieldId'});db[_0x8bd0('0xab')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8bd0('0xad')][_0x8bd0('0x119')](db['ZohoConfiguration'],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xaf')][_0x8bd0('0x119')](db[_0x8bd0('0xb1')],{'as':_0x8bd0('0x1bf'),'onDelete':_0x8bd0('0x114'),'foreignKey':'SubjectId'});db[_0x8bd0('0xaf')][_0x8bd0('0x119')](db[_0x8bd0('0xb1')],{'as':_0x8bd0('0x1c1'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c2')});db['ZohoConfiguration'][_0x8bd0('0x119')](db['ZohoField'],{'as':_0x8bd0('0x1b9'),'onDelete':_0x8bd0('0x114'),'foreignKey':'FieldId'});db[_0x8bd0('0xaf')][_0x8bd0('0x123')](db[_0x8bd0('0xad')],{'as':'Account','foreignKey':_0x8bd0('0x1bd')});db['ZohoField'][_0x8bd0('0x119')](db[_0x8bd0('0xb1')],{'as':'Subject','foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xb1')][_0x8bd0('0x119')](db['ZohoField'],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xb1')]['hasMany'](db[_0x8bd0('0xb1')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xb1')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8bd0('0x1ca')][_0x8bd0('0x119')](db['ZendeskConfiguration'],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x8bd0('0x119')](db[_0x8bd0('0xb6')],{'as':_0x8bd0('0x1bf'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xb4')][_0x8bd0('0x119')](db[_0x8bd0('0xb6')],{'as':_0x8bd0('0x1c1'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xb4')]['hasMany'](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x8bd0('0xb4')][_0x8bd0('0x123')](db[_0x8bd0('0x1ca')],{'as':'Account','foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xb4')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8bd0('0x119')](db['ZendeskField'],{'as':_0x8bd0('0x1c4'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xb6')][_0x8bd0('0x119')](db[_0x8bd0('0xb6')],{'as':_0x8bd0('0x1c5'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0x8bd0('0xb6')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xb6')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':_0x8bd0('0x1c6'),'foreignKey':_0x8bd0('0x1c7')});db[_0x8bd0('0x1cb')][_0x8bd0('0x119')](db[_0x8bd0('0xb8')],{'as':_0x8bd0('0x1bc'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xb8')]['hasMany'](db[_0x8bd0('0x1cc')],{'as':_0x8bd0('0x1bf'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c0')});db['FreshdeskConfiguration'][_0x8bd0('0x119')](db[_0x8bd0('0x1cc')],{'as':_0x8bd0('0x1c1'),'onDelete':_0x8bd0('0x114'),'foreignKey':'DescriptionId'});db[_0x8bd0('0xb8')][_0x8bd0('0x119')](db[_0x8bd0('0x1cc')],{'as':_0x8bd0('0x1b9'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c3')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xb8')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x8bd0('0x1cc')][_0x8bd0('0x119')](db[_0x8bd0('0x1cc')],{'as':_0x8bd0('0x1c4'),'foreignKey':'SubjectId'});db[_0x8bd0('0x1cc')][_0x8bd0('0x119')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8bd0('0x1cc')][_0x8bd0('0x119')](db[_0x8bd0('0x1cc')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0x1cc')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':'Variable','foreignKey':_0x8bd0('0x1c7')});db[_0x8bd0('0xba')][_0x8bd0('0x119')](db['VtigerConfiguration'],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xbb')][_0x8bd0('0x119')](db[_0x8bd0('0xbd')],{'as':_0x8bd0('0x1bf'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xbb')]['hasMany'](db[_0x8bd0('0xbd')],{'as':_0x8bd0('0x1c1'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xbb')][_0x8bd0('0x119')](db[_0x8bd0('0xbd')],{'as':_0x8bd0('0x1b9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xbb')][_0x8bd0('0x123')](db[_0x8bd0('0xba')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xbd')][_0x8bd0('0x119')](db['VtigerField'],{'as':'Subject','foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xbd')][_0x8bd0('0x119')](db['VtigerField'],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db['VtigerField'][_0x8bd0('0x119')](db[_0x8bd0('0xbd')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xbd')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':'Variable','foreignKey':_0x8bd0('0x1c7')});db['ServicenowAccount'][_0x8bd0('0x119')](db['ServicenowConfiguration'],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':'AccountId'});db[_0x8bd0('0xbf')]['hasMany'](db['ServicenowField'],{'as':_0x8bd0('0x1bf'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xbf')]['hasMany'](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xbf')][_0x8bd0('0x119')](db[_0x8bd0('0xc1')],{'as':_0x8bd0('0x1b9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xbf')][_0x8bd0('0x123')](db[_0x8bd0('0x1cd')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xc1')][_0x8bd0('0x119')](db[_0x8bd0('0xc1')],{'as':'Subject','foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0xc1')]['hasMany'](db[_0x8bd0('0xc1')],{'as':'Description','foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xc1')][_0x8bd0('0x119')](db[_0x8bd0('0xc1')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db['ServicenowField'][_0x8bd0('0x123')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x8bd0('0x1ce')][_0x8bd0('0x119')](db[_0x8bd0('0x1cf')],{'as':_0x8bd0('0x1bc'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db['Dynamics365Account'][_0x8bd0('0x123')](db['CloudProvider'],{'as':_0x8bd0('0x15c'),'foreignKey':_0x8bd0('0x15e')});db['Dynamics365Configuration'][_0x8bd0('0x119')](db['Dynamics365Field'],{'as':_0x8bd0('0x1bf'),'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1c0')});db[_0x8bd0('0x1cf')]['hasMany'](db[_0x8bd0('0xc3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x8bd0('0x119')](db['Dynamics365Field'],{'as':_0x8bd0('0x1b9'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1c3')});db['Dynamics365Configuration']['belongsTo'](db['Dynamics365Account'],{'as':_0x8bd0('0x16a'),'foreignKey':'AccountId'});db[_0x8bd0('0xc3')][_0x8bd0('0x119')](db[_0x8bd0('0xc3')],{'as':_0x8bd0('0x1c4'),'foreignKey':'SubjectId'});db[_0x8bd0('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xc3')][_0x8bd0('0x119')](db[_0x8bd0('0xc3')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xc3')][_0x8bd0('0x123')](db[_0x8bd0('0x1c6')],{'as':'Variable','foreignKey':_0x8bd0('0x1c7')});db[_0x8bd0('0xc5')][_0x8bd0('0x119')](db[_0x8bd0('0xc7')],{'as':'Configurations','onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xc7')]['hasMany'](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1bf'),'foreignKey':_0x8bd0('0x1c0')});db['FreshsalesConfiguration'][_0x8bd0('0x119')](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1c1'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x8bd0('0x119')](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1b9'),'foreignKey':'FieldId'});db[_0x8bd0('0xc7')][_0x8bd0('0x123')](db[_0x8bd0('0xc5')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x1bd')});db[_0x8bd0('0xc8')][_0x8bd0('0x119')](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1c4'),'foreignKey':'SubjectId'});db['FreshsalesField'][_0x8bd0('0x119')](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1c5'),'foreignKey':_0x8bd0('0x1c2')});db[_0x8bd0('0xc8')]['hasMany'](db[_0x8bd0('0xc8')],{'as':_0x8bd0('0x1c9'),'foreignKey':_0x8bd0('0x1c3')});db[_0x8bd0('0xc8')][_0x8bd0('0x123')](db['Variable'],{'as':_0x8bd0('0x1c6'),'foreignKey':'VariableId'});db[_0x8bd0('0xcc')][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{});db['ChatQueueReport']['belongsTo'](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xcc')][_0x8bd0('0x123')](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0xcc')][_0x8bd0('0x123')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x18f')],{});db[_0x8bd0('0xcc')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{});db['ChatQueueReport']['belongsTo'](db['ChatQueue'],{});db[_0x8bd0('0xce')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'onDelete':_0x8bd0('0x114'),'foreignKey':_0x8bd0('0x1d0')});db[_0x8bd0('0xce')][_0x8bd0('0x123')](db['User'],{'onDelete':_0x8bd0('0x114'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0x8bd0('0x119')](db[_0x8bd0('0xd2')],{'foreignKey':'SessionId','onDelete':_0x8bd0('0x114')});db[_0x8bd0('0xd4')]['hasMany'](db[_0x8bd0('0xd0')],{'foreignKey':_0x8bd0('0x1d1'),'onDelete':'cascade'});db['SmsQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x17e')],{});db[_0x8bd0('0xd6')][_0x8bd0('0x123')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xd6')]['belongsTo'](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db[_0x8bd0('0xd6')][_0x8bd0('0x123')](db[_0x8bd0('0x50')],{});db['SmsQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x52')],{});db[_0x8bd0('0xd6')]['belongsTo'](db[_0x8bd0('0x111')],{});db['SmsQueueReport'][_0x8bd0('0x123')](db[_0x8bd0('0x54')],{});db['JscriptyProject'][_0x8bd0('0x119')](db[_0x8bd0('0xd4')],{'foreignKey':'ProjectId'});db[_0x8bd0('0xd9')][_0x8bd0('0x119')](db['JscriptyQuestionReport'],{'foreignKey':_0x8bd0('0x1d2')});db['JscriptyProject'][_0x8bd0('0x119')](db[_0x8bd0('0xd0')],{'foreignKey':_0x8bd0('0x1d2')});db[_0x8bd0('0xe2')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x129')});db[_0x8bd0('0xe2')]['belongsToMany'](db[_0x8bd0('0x19')],{'through':'TeamVoiceQueue','as':_0x8bd0('0x130')});db['Team'][_0x8bd0('0x125')](db[_0x8bd0('0x37')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team']['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db['Team'][_0x8bd0('0x125')](db[_0x8bd0('0x4c')],{'through':_0x8bd0('0x17c'),'as':_0x8bd0('0x133')});db['Team'][_0x8bd0('0x125')](db[_0x8bd0('0x54')],{'through':_0x8bd0('0x1d3'),'as':'SmsQueues'});db[_0x8bd0('0xe2')][_0x8bd0('0x125')](db[_0x8bd0('0x5b')],{'through':_0x8bd0('0x18c'),'as':_0x8bd0('0x135')});db['Team'][_0x8bd0('0x125')](db[_0x8bd0('0x109')],{'through':_0x8bd0('0x1d4'),'as':_0x8bd0('0x136')});db['Team'][_0x8bd0('0x125')](db['VoicePrefix'],{'through':_0x8bd0('0x10b'),'as':_0x8bd0('0x131')});db[_0x8bd0('0x19f')][_0x8bd0('0x119')](db[_0x8bd0('0x146')],{'as':_0x8bd0('0x198'),'foreignKey':_0x8bd0('0x1a0')});db[_0x8bd0('0x19f')][_0x8bd0('0x119')](db[_0x8bd0('0x70')],{'as':_0x8bd0('0x11a'),'foreignKey':_0x8bd0('0x1a0')});db[_0x8bd0('0x19f')][_0x8bd0('0x119')](db[_0x8bd0('0x11b')],{'as':'HopperHistories','foreignKey':_0x8bd0('0x1a0')});db[_0x8bd0('0x19f')]['hasMany'](db['CmHopperBlack'],{'as':_0x8bd0('0x148'),'foreignKey':_0x8bd0('0x1a0')});db[_0x8bd0('0x19f')][_0x8bd0('0x123')](db['Trunk'],{'as':'Trunk','foreignKey':_0x8bd0('0x149')});db[_0x8bd0('0x19f')][_0x8bd0('0x123')](db[_0x8bd0('0x176')],{'as':_0x8bd0('0x14a'),'foreignKey':'TrunkBackupId'});db[_0x8bd0('0x19f')][_0x8bd0('0x123')](db[_0x8bd0('0x7e')],{'as':'Interval','foreignKey':_0x8bd0('0x14c')});db[_0x8bd0('0x19f')][_0x8bd0('0x123')](db[_0x8bd0('0xdd')],{'as':'SquareProject','foreignKey':_0x8bd0('0x1d5')});db[_0x8bd0('0x19f')][_0x8bd0('0x125')](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x128'),'through':_0x8bd0('0x1d6')});db[_0x8bd0('0x19f')]['belongsToMany'](db['CmList'],{'as':_0x8bd0('0x151'),'through':_0x8bd0('0x1d7')});db[_0x8bd0('0xe8')]['belongsTo'](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x8bd0('0x172')});db[_0x8bd0('0xec')][_0x8bd0('0x123')](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x8bd0('0x3b')],{});db[_0x8bd0('0xec')][_0x8bd0('0x123')](db['MailAccount'],{'foreignKey':_0x8bd0('0x1d8'),'as':_0x8bd0('0x1d9')});db['MailTransferReport'][_0x8bd0('0x123')](db['User'],{'foreignKey':_0x8bd0('0x1da'),'as':_0x8bd0('0x1db')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x8bd0('0x1dc')});db[_0x8bd0('0xec')]['belongsTo'](db[_0x8bd0('0x37')],{'foreignKey':_0x8bd0('0x1dd'),'as':_0x8bd0('0x1de')});db[_0x8bd0('0xec')][_0x8bd0('0x123')](db[_0x8bd0('0x35')],{'foreignKey':_0x8bd0('0x1df'),'as':'ToAccount'});db['ChatTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x18f')],{});db['ChatTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x60')],{});db[_0x8bd0('0x1e0')][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{'foreignKey':_0x8bd0('0x1e1'),'as':_0x8bd0('0x1d9')});db[_0x8bd0('0x1e0')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':_0x8bd0('0x1da'),'as':_0x8bd0('0x1db')});db[_0x8bd0('0x1e0')]['belongsTo'](db['User'],{'foreignKey':_0x8bd0('0x1e2'),'as':_0x8bd0('0x1dc')});db['ChatTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x64')],{'foreignKey':'ToChatQueueId','as':_0x8bd0('0x1de')});db['ChatTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x5c')],{'foreignKey':_0x8bd0('0x1e3'),'as':_0x8bd0('0x1e4')});db['FaxTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x4a')],{});db[_0x8bd0('0xee')][_0x8bd0('0x123')](db[_0x8bd0('0x48')],{});db[_0x8bd0('0xee')][_0x8bd0('0x123')](db[_0x8bd0('0x44')],{'foreignKey':_0x8bd0('0x1e5'),'as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x8bd0('0x1db')});db[_0x8bd0('0xee')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':_0x8bd0('0x1e2'),'as':'ToAgent'});db[_0x8bd0('0xee')][_0x8bd0('0x123')](db['FaxQueue'],{'foreignKey':_0x8bd0('0x1e6'),'as':_0x8bd0('0x1de')});db[_0x8bd0('0xee')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x8bd0('0x1e7'),'as':_0x8bd0('0x1e4')});db['OpenchannelTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x187')],{});db[_0x8bd0('0x1e8')][_0x8bd0('0x123')](db['OpenchannelInteraction'],{});db[_0x8bd0('0x1e8')]['belongsTo'](db[_0x8bd0('0x55')],{'foreignKey':_0x8bd0('0x1e9'),'as':_0x8bd0('0x1d9')});db[_0x8bd0('0x1e8')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':_0x8bd0('0x1da'),'as':_0x8bd0('0x1db')});db['OpenchannelTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':_0x8bd0('0x1e2'),'as':_0x8bd0('0x1dc')});db[_0x8bd0('0x1e8')][_0x8bd0('0x123')](db[_0x8bd0('0x5b')],{'foreignKey':'ToOpenchannelQueueId','as':_0x8bd0('0x1de')});db['OpenchannelTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x55')],{'foreignKey':_0x8bd0('0x1ea'),'as':_0x8bd0('0x1e4')});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db[_0x8bd0('0x52')],{});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db[_0x8bd0('0x50')],{});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db['SmsAccount'],{'foreignKey':_0x8bd0('0x1eb'),'as':_0x8bd0('0x1d9')});db['SmsTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':'FromUserId','as':_0x8bd0('0x1db')});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':_0x8bd0('0x1e2'),'as':_0x8bd0('0x1dc')});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db['SmsQueue'],{'foreignKey':_0x8bd0('0x1ec'),'as':_0x8bd0('0x1de')});db[_0x8bd0('0xf1')][_0x8bd0('0x123')](db[_0x8bd0('0x17e')],{'foreignKey':'ToSmsAccountId','as':_0x8bd0('0x1e4')});db[_0x8bd0('0xf3')]['hasMany'](db[_0x8bd0('0x7b')],{'as':'Dispositions','foreignKey':_0x8bd0('0x163'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0xf3')]['hasMany'](db[_0x8bd0('0x75')],{'as':_0x8bd0('0x1ed'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xf3')]['hasMany'](db[_0x8bd0('0x6c')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xf3')][_0x8bd0('0x119')](db[_0x8bd0('0x70')],{'as':_0x8bd0('0x11a'),'foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xf3')][_0x8bd0('0x119')](db[_0x8bd0('0x11b')],{'as':'HopperHistory','foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0xf3')]['hasMany'](db[_0x8bd0('0x73')],{'as':_0x8bd0('0x73'),'foreignKey':_0x8bd0('0x163')});db['CmList'][_0x8bd0('0x125')](db[_0x8bd0('0x19')],{'as':_0x8bd0('0x1ee'),'through':_0x8bd0('0x1ef')});db['CmList']['belongsToMany'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x137')});db[_0x8bd0('0xf5')][_0x8bd0('0x119')](db[_0x8bd0('0x15')],{'as':_0x8bd0('0x1f0'),'onDelete':'cascade'});db[_0x8bd0('0xf5')][_0x8bd0('0x125')](db['User'],{'as':_0x8bd0('0x14e'),'through':'UserVoicePrefix'});db[_0x8bd0('0xf5')]['belongsToMany'](db['Team'],{'through':'TeamVoicePrefix','as':_0x8bd0('0x168')});db['UserProfile'][_0x8bd0('0x119')](db[_0x8bd0('0x111')],{'as':'Users','foreignKey':_0x8bd0('0x124')});db[_0x8bd0('0xf7')]['hasMany'](db[_0x8bd0('0xf9')],{'as':_0x8bd0('0x1f1'),'foreignKey':'userProfileId','onDelete':_0x8bd0('0x114')});db[_0x8bd0('0xf9')][_0x8bd0('0x119')](db['UserProfileResource'],{'as':_0x8bd0('0x1f2'),'foreignKey':_0x8bd0('0x1f3'),'onDelete':_0x8bd0('0x114')});db[_0x8bd0('0xff')][_0x8bd0('0x119')](db[_0x8bd0('0x7b')],{'as':_0x8bd0('0x160'),'foreignKey':_0x8bd0('0x1f4'),'onDelete':'cascade'});db['WhatsappAccount'][_0x8bd0('0x119')](db[_0x8bd0('0x79')],{'as':_0x8bd0('0x17f'),'foreignKey':'WhatsappAccountId'});db[_0x8bd0('0xff')][_0x8bd0('0x119')](db['WhatsappMessage'],{'as':_0x8bd0('0x152'),'foreignKey':_0x8bd0('0x1f4')});db['WhatsappAccount'][_0x8bd0('0x119')](db[_0x8bd0('0x120')],{'as':_0x8bd0('0x161')});db[_0x8bd0('0xff')][_0x8bd0('0x119')](db['WhatsappApplication'],{'as':_0x8bd0('0x175')});db['WhatsappAccount']['belongsTo'](db[_0x8bd0('0xf3')],{'as':_0x8bd0('0x162'),'foreignKey':_0x8bd0('0x163')});db['WhatsappAccount']['belongsTo'](db[_0x8bd0('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8bd0('0xff')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x140')});db[_0x8bd0('0x101')]['belongsTo'](db[_0x8bd0('0x111')],{'onDelete':'restrict'});db[_0x8bd0('0x101')][_0x8bd0('0x123')](db[_0x8bd0('0x109')],{'onDelete':'restrict'});db[_0x8bd0('0x101')][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x101')][_0x8bd0('0x123')](db[_0x8bd0('0x7e')],{'onDelete':_0x8bd0('0x15d'),'foreignKey':'IntervalId'});db[_0x8bd0('0x101')]['belongsTo'](db['Tag'],{'onDelete':_0x8bd0('0x15d'),'foreignKey':_0x8bd0('0x178')});db[_0x8bd0('0x120')][_0x8bd0('0x119')](db[_0x8bd0('0x104')],{'as':_0x8bd0('0x152'),'onDelete':'cascade','foreignKey':_0x8bd0('0x1f5')});db[_0x8bd0('0x120')][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{'as':'Account','foreignKey':_0x8bd0('0x1f4')});db[_0x8bd0('0x120')]['belongsTo'](db[_0x8bd0('0x6c')],{'as':_0x8bd0('0x159'),'foreignKey':_0x8bd0('0x15a')});db['WhatsappInteraction'][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'as':'Owner','foreignKey':'UserId'});db[_0x8bd0('0x120')][_0x8bd0('0x125')](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x1af'),'as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0x8bd0('0x88')],{'through':_0x8bd0('0x1af'),'as':_0x8bd0('0x16d')});db[_0x8bd0('0x120')][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x16e'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x111')});db[_0x8bd0('0x104')]['belongsTo'](db[_0x8bd0('0x6c')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0x8bd0('0x123')](db[_0x8bd0('0x120')],{'onDelete':'cascade','as':_0x8bd0('0x183'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{'as':_0x8bd0('0x16a'),'foreignKey':_0x8bd0('0x1f4')});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db['CmList'],{'as':'List','foreignKey':_0x8bd0('0x163')});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db['CmContact'],{'as':_0x8bd0('0x159'),'foreignKey':'ContactId'});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db[_0x8bd0('0x120')],{});db[_0x8bd0('0x1f6')]['belongsTo'](db[_0x8bd0('0x109')],{});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db[_0x8bd0('0x104')],{});db[_0x8bd0('0x1f6')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{});db[_0x8bd0('0x107')]['belongsTo'](db[_0x8bd0('0x104')],{});db[_0x8bd0('0x107')][_0x8bd0('0x123')](db[_0x8bd0('0x120')],{});db[_0x8bd0('0x107')][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{'foreignKey':'FromWhatsappAccountId','as':_0x8bd0('0x1d9')});db[_0x8bd0('0x107')][_0x8bd0('0x123')](db[_0x8bd0('0xff')],{'foreignKey':_0x8bd0('0x1f7'),'as':_0x8bd0('0x1e4')});db['WhatsappTransferReport'][_0x8bd0('0x123')](db[_0x8bd0('0x109')],{'foreignKey':'ToQueueId','as':_0x8bd0('0x1de')});db[_0x8bd0('0x107')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8bd0('0x107')][_0x8bd0('0x123')](db[_0x8bd0('0x111')],{'foreignKey':'ToUserId','as':_0x8bd0('0x1dc')});db['WhatsappQueue'][_0x8bd0('0x125')](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x14e'),'through':_0x8bd0('0x1f8'),'foreignKey':_0x8bd0('0x1f9')});db[_0x8bd0('0x109')]['belongsToMany'](db[_0x8bd0('0xe2')],{'through':_0x8bd0('0x1d4'),'as':_0x8bd0('0x168')});db[_0x8bd0('0x10f')]['belongsTo'](db[_0x8bd0('0x111')],{'as':_0x8bd0('0x1fa'),'foreignKey':_0x8bd0('0x115'),'onDelete':'cascade','hooks':!![]});db['CloudProvider'][_0x8bd0('0x112')](db['Dynamics365Account'],{'as':_0x8bd0('0x1ce'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x15c')][_0x8bd0('0x112')](db[_0x8bd0('0x32')],{'as':_0x8bd0('0x1fb'),'onDelete':_0x8bd0('0x15d')});db[_0x8bd0('0x15c')][_0x8bd0('0x112')](db[_0x8bd0('0x33')],{'as':_0x8bd0('0x15f'),'onDelete':'restrict'});module[_0x8bd0('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d55bf12..5a282be 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7efe=['./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.1.0','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','use','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/disposition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts'];(function(_0x13557b,_0x1a1138){var _0xd193e7=function(_0x150e08){while(--_0x150e08){_0x13557b['push'](_0x13557b['shift']());}};_0xd193e7(++_0x1a1138);}(_0x7efe,0x8c));var _0xe7ef=function(_0x3cb338,_0xa94edc){_0x3cb338=_0x3cb338-0x0;var _0x5b23d6=_0x7efe[_0x3cb338];return _0x5b23d6;};'use strict';var path=require(_0xe7ef('0x0'));var express=require(_0xe7ef('0x1'));var errors=require(_0xe7ef('0x2'));var config=require(_0xe7ef('0x3'));var setupLoggers=require(_0xe7ef('0x4'))['setupLoggers'];var clientSideLogs=require(_0xe7ef('0x5'));exports[_0xe7ef('0x6')]=function(_0x24e414){return setupLoggers(_0x24e414)['then'](function(){_0x24e414[_0xe7ef('0x7')]('/api/users',require(_0xe7ef('0x8')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x9'),require(_0xe7ef('0xa')));_0x24e414[_0xe7ef('0x7')]('/api/voice/contexts',require(_0xe7ef('0xb')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc'),require(_0xe7ef('0xd')));_0x24e414[_0xe7ef('0x7')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x24e414['use'](_0xe7ef('0xe'),require('./api/voiceQueue'));_0x24e414[_0xe7ef('0x7')]('/api/voice/recordings',require(_0xe7ef('0xf')));_0x24e414['use'](_0xe7ef('0x10'),require(_0xe7ef('0x11')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x12'),require(_0xe7ef('0x13')));_0x24e414[_0xe7ef('0x7')]('/api/voice/mails/messages',require(_0xe7ef('0x14')));_0x24e414['use']('/api/voice/calls/reports',require(_0xe7ef('0x15')));_0x24e414['use'](_0xe7ef('0x16'),require(_0xe7ef('0x17')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x18'),require(_0xe7ef('0x19')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x1a'),require('./api/voiceQueueReport'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x1b'),require(_0xe7ef('0x1c')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x1d'),require(_0xe7ef('0x1e')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x1f'),require(_0xe7ef('0x20')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x21'),require('./api/mailServerOut'));_0x24e414[_0xe7ef('0x7')]('/api/mail/accounts',require(_0xe7ef('0x22')));_0x24e414['use'](_0xe7ef('0x23'),require(_0xe7ef('0x24')));_0x24e414['use'](_0xe7ef('0x25'),require('./api/mailSubstatus'));_0x24e414[_0xe7ef('0x7')]('/api/mail/interactions',require(_0xe7ef('0x26')));_0x24e414[_0xe7ef('0x7')]('/api/mail/messages',require(_0xe7ef('0x27')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x28'),require('./api/mailApplication'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x29'),require(_0xe7ef('0x2a')));_0x24e414['use'](_0xe7ef('0x2b'),require(_0xe7ef('0x2c')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x2d'),require(_0xe7ef('0x2e')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x2f'),require(_0xe7ef('0x30')));_0x24e414['use'](_0xe7ef('0x31'),require(_0xe7ef('0x32')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x33'),require('./api/faxInteraction'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x34'),require(_0xe7ef('0x35')));_0x24e414[_0xe7ef('0x7')]('/api/fax/queues',require(_0xe7ef('0x36')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x37'),require(_0xe7ef('0x38')));_0x24e414['use'](_0xe7ef('0x39'),require('./api/smsAccount'));_0x24e414[_0xe7ef('0x7')]('/api/sms/applications',require('./api/smsApplication'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x3a'),require(_0xe7ef('0x3b')));_0x24e414['use'](_0xe7ef('0x3c'),require(_0xe7ef('0x3d')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x3e'),require(_0xe7ef('0x3f')));_0x24e414[_0xe7ef('0x7')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x24e414['use'](_0xe7ef('0x40'),require(_0xe7ef('0x41')));_0x24e414['use']('/api/openchannel/interactions',require(_0xe7ef('0x42')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x43'),require(_0xe7ef('0x44')));_0x24e414[_0xe7ef('0x7')]('/api/openchannel/queues',require(_0xe7ef('0x45')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x46'),require(_0xe7ef('0x47')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x48'),require(_0xe7ef('0x49')));_0x24e414[_0xe7ef('0x7')]('/api/chat/applications',require('./api/chatApplication'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x4a'),require(_0xe7ef('0x4b')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x4c'),require(_0xe7ef('0x4d')));_0x24e414[_0xe7ef('0x7')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x4e'),require(_0xe7ef('0x4f')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x50'),require(_0xe7ef('0x51')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x52'),require(_0xe7ef('0x53')));_0x24e414[_0xe7ef('0x7')]('/api/cm/companies',require(_0xe7ef('0x54')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x55'),require('./api/cmContact'));_0x24e414['use'](_0xe7ef('0x56'),require(_0xe7ef('0x57')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x58'),require(_0xe7ef('0x59')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x5a'),require(_0xe7ef('0x5b')));_0x24e414['use']('/api/cm/hopper_history',require(_0xe7ef('0x5c')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x5d'),require('./api/cmCustomField'));_0x24e414[_0xe7ef('0x7')]('/api/actions',require(_0xe7ef('0x5e')));_0x24e414['use'](_0xe7ef('0x5f'),require(_0xe7ef('0x60')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x61'),require('./api/cannedAnswer'));_0x24e414[_0xe7ef('0x7')]('/api/dispositions',require(_0xe7ef('0x62')));_0x24e414[_0xe7ef('0x7')]('/api/conditions',require('./api/condition'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x63'),require(_0xe7ef('0x64')));_0x24e414[_0xe7ef('0x7')]('/api/pauses',require(_0xe7ef('0x65')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x66'),require(_0xe7ef('0x67')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x68'),require(_0xe7ef('0x69')));_0x24e414[_0xe7ef('0x7')]('/api/schedules',require(_0xe7ef('0x6a')));_0x24e414['use'](_0xe7ef('0x6b'),require('./api/sound'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x6c'),require(_0xe7ef('0x6d')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x6e'),require('./api/contactItemType'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x6f'),require(_0xe7ef('0x70')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x71'),require('./api/cmHopperAdditionalPhone'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x72'),require(_0xe7ef('0x73')));_0x24e414['use'](_0xe7ef('0x74'),require('./api/trigger'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x75'),require(_0xe7ef('0x76')));_0x24e414['use'](_0xe7ef('0x77'),require(_0xe7ef('0x78')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x79'),require(_0xe7ef('0x7a')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x7b'),require('./api/analyticCustomReport'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x7c'),require(_0xe7ef('0x7d')));_0x24e414['use'](_0xe7ef('0x7e'),require(_0xe7ef('0x7f')));_0x24e414['use'](_0xe7ef('0x80'),require(_0xe7ef('0x81')));_0x24e414['use'](_0xe7ef('0x82'),require('./api/analyticFieldReport'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x83'),require(_0xe7ef('0x84')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x85'),require(_0xe7ef('0x86')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x87'),require('./api/intSalesforceConfiguration'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x88'),require(_0xe7ef('0x89')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x8a'),require(_0xe7ef('0x8b')));_0x24e414[_0xe7ef('0x7')]('/api/integrations/sugarcrm/configurations',require(_0xe7ef('0x8c')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x8d'),require(_0xe7ef('0x8e')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x8f'),require(_0xe7ef('0x90')));_0x24e414['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x24e414['use']('/api/integrations/desk/fields',require(_0xe7ef('0x91')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x92'),require(_0xe7ef('0x93')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x94'),require(_0xe7ef('0x95')));_0x24e414['use']('/api/integrations/zoho/fields',require(_0xe7ef('0x96')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x97'),require(_0xe7ef('0x98')));_0x24e414['use'](_0xe7ef('0x99'),require(_0xe7ef('0x9a')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x9b'),require(_0xe7ef('0x9c')));_0x24e414['use'](_0xe7ef('0x9d'),require(_0xe7ef('0x9e')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x9f'),require('./api/intFreshdeskConfiguration'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xa0'),require(_0xe7ef('0xa1')));_0x24e414[_0xe7ef('0x7')]('/api/integrations/vtiger/accounts',require(_0xe7ef('0xa2')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xa3'),require(_0xe7ef('0xa4')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xa5'),require(_0xe7ef('0xa6')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xa7'),require('./api/intServicenowAccount'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xa8'),require(_0xe7ef('0xa9')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xaa'),require(_0xe7ef('0xab')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xac'),require(_0xe7ef('0xad')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xae'),require(_0xe7ef('0xaf')));_0x24e414[_0xe7ef('0x7')]('/api/integrations/dynamics365/fields',require(_0xe7ef('0xb0')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xb1'),require(_0xe7ef('0xb2')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xb3'),require('./api/intFreshsalesConfiguration'));_0x24e414['use'](_0xe7ef('0xb4'),require('./api/intFreshsalesField'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xb5'),require(_0xe7ef('0xb6')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xb7'),require(_0xe7ef('0xb8')));_0x24e414[_0xe7ef('0x7')]('/api/chat/internal/messages',require(_0xe7ef('0xb9')));_0x24e414[_0xe7ef('0x7')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x24e414['use']('/api/jscripty/questions/reports',require(_0xe7ef('0xba')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xbb'),require('./api/jscriptySessionReport'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xbc'),require(_0xe7ef('0xbd')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xbe'),require(_0xe7ef('0xbf')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc0'),require(_0xe7ef('0xc1')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc2'),require(_0xe7ef('0xc3')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc4'),require(_0xe7ef('0xc5')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc6'),require('./api/squareOdbc'));_0x24e414['use']('/api/square/projects',require(_0xe7ef('0xc7')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc8'),require('./api/squareRecording'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xc9'),require(_0xe7ef('0xca')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xcb'),require('./api/team'));_0x24e414['use'](_0xe7ef('0xcc'),require(_0xe7ef('0xcd')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xce'),require(_0xe7ef('0xcf')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xd0'),require(_0xe7ef('0xd1')));_0x24e414[_0xe7ef('0x7')]('/api/attachments',require(_0xe7ef('0xd2')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xd3'),require(_0xe7ef('0xd4')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xd5'),require(_0xe7ef('0xd6')));_0x24e414['use']('/api/chat/reports/transfer',require(_0xe7ef('0xd7')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xd8'),require(_0xe7ef('0xd9')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xda'),require(_0xe7ef('0xdb')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xdc'),require('./api/smsTransferReport'));_0x24e414[_0xe7ef('0x7')]('/api/cm/lists',require(_0xe7ef('0xdd')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xde'),require(_0xe7ef('0xdf')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xe0'),require(_0xe7ef('0xe1')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xe2'),require(_0xe7ef('0xe3')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xe4'),require(_0xe7ef('0xe5')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xe6'),require(_0xe7ef('0xe7')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xe8'),require('./api/whatsappAccount'));_0x24e414['use']('/api/whatsapp/applications',require(_0xe7ef('0xe9')));_0x24e414['use'](_0xe7ef('0xea'),require(_0xe7ef('0xeb')));_0x24e414['use'](_0xe7ef('0xec'),require(_0xe7ef('0xed')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xee'),require(_0xe7ef('0xef')));_0x24e414[_0xe7ef('0x7')]('/api/whatsapp/reports/transfer',require(_0xe7ef('0xf0')));_0x24e414[_0xe7ef('0x7')]('/api/whatsapp/queues',require(_0xe7ef('0xf1')));_0x24e414['use'](_0xe7ef('0xf2'),require(_0xe7ef('0xf3')));_0x24e414[_0xe7ef('0x7')]('/api/realtime',require(_0xe7ef('0xf4')));_0x24e414['use'](_0xe7ef('0xf5'),require(_0xe7ef('0xf6')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xf7'),require(_0xe7ef('0xf8')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xf9'),require(_0xe7ef('0xfa')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xfb'),require(_0xe7ef('0xfc')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0xfd'),require(_0xe7ef('0xfe')));_0x24e414['use'](_0xe7ef('0xff'),require(_0xe7ef('0x100')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x101'),require(_0xe7ef('0x102')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x103'),require('./api/system'));_0x24e414['use']('/api/pm2',require(_0xe7ef('0x104')));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x105'),require('./api/webbar'));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x106'),clientSideLogs);_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x107'),express[_0xe7ef('0x108')](path['join'](config[_0xe7ef('0x109')],_0xe7ef('0x107'))));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x10a'),express['static'](path[_0xe7ef('0x10b')](config[_0xe7ef('0x109')],_0xe7ef('0x10a'))));_0x24e414['use']('/demo',express[_0xe7ef('0x108')](path[_0xe7ef('0x10b')](config['root'],_0xe7ef('0x10c'))));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x10d'),express['static'](path['join'](config['root'],_0xe7ef('0x10e'),_0xe7ef('0x10f'))));_0x24e414[_0xe7ef('0x7')](_0xe7ef('0x110'),express[_0xe7ef('0x108')](path[_0xe7ef('0x10b')](config[_0xe7ef('0x109')],'/server/files/plugins')));_0x24e414['route'](_0xe7ef('0x111'))[_0xe7ef('0x112')](errors[0x194]);_0x24e414[_0xe7ef('0x113')]('/*')[_0xe7ef('0x112')](function(_0x2fbef0,_0x394ccf){_0x394ccf[_0xe7ef('0x114')](path[_0xe7ef('0x115')](_0x24e414[_0xe7ef('0x112')]('appPath')+_0xe7ef('0x116')));});return _0x24e414;});}; \ No newline at end of file +var _0x922d=['./api/pm2','/api/logs','static','join','root','/www','/demo','/snippet','snippet','3.1.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/smsAccount','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./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/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2'];(function(_0x417ed2,_0x1ab762){var _0x1c42c0=function(_0x43e88d){while(--_0x43e88d){_0x417ed2['push'](_0x417ed2['shift']());}};_0x1c42c0(++_0x1ab762);}(_0x922d,0x117));var _0xd922=function(_0x33c228,_0x5dd746){_0x33c228=_0x33c228-0x0;var _0x4cc4b8=_0x922d[_0x33c228];return _0x4cc4b8;};'use strict';var path=require(_0xd922('0x0'));var express=require(_0xd922('0x1'));var errors=require(_0xd922('0x2'));var config=require(_0xd922('0x3'));var setupLoggers=require(_0xd922('0x4'))[_0xd922('0x5')];var clientSideLogs=require(_0xd922('0x6'));exports['default']=function(_0x40d79d){return setupLoggers(_0x40d79d)[_0xd922('0x7')](function(){_0x40d79d[_0xd922('0x8')]('/api/users',require(_0xd922('0x9')));_0x40d79d['use'](_0xd922('0xa'),require('./api/voiceChanSpy'));_0x40d79d['use'](_0xd922('0xb'),require(_0xd922('0xc')));_0x40d79d[_0xd922('0x8')]('/api/voice/extensions',require('./api/voiceExtension'));_0x40d79d[_0xd922('0x8')](_0xd922('0xd'),require('./api/voiceMusicOnHold'));_0x40d79d[_0xd922('0x8')](_0xd922('0xe'),require('./api/voiceQueue'));_0x40d79d[_0xd922('0x8')](_0xd922('0xf'),require('./api/voiceRecording'));_0x40d79d[_0xd922('0x8')](_0xd922('0x10'),require(_0xd922('0x11')));_0x40d79d[_0xd922('0x8')]('/api/voice/mails',require('./api/voiceMail'));_0x40d79d[_0xd922('0x8')](_0xd922('0x12'),require(_0xd922('0x13')));_0x40d79d[_0xd922('0x8')](_0xd922('0x14'),require(_0xd922('0x15')));_0x40d79d[_0xd922('0x8')]('/api/voice/dials/reports',require(_0xd922('0x16')));_0x40d79d[_0xd922('0x8')]('/api/voice/agents/reports',require(_0xd922('0x17')));_0x40d79d['use'](_0xd922('0x18'),require(_0xd922('0x19')));_0x40d79d[_0xd922('0x8')]('/api/members/reports',require('./api/memberReport'));_0x40d79d[_0xd922('0x8')](_0xd922('0x1a'),require(_0xd922('0x1b')));_0x40d79d[_0xd922('0x8')](_0xd922('0x1c'),require(_0xd922('0x1d')));_0x40d79d[_0xd922('0x8')](_0xd922('0x1e'),require(_0xd922('0x1f')));_0x40d79d[_0xd922('0x8')](_0xd922('0x20'),require('./api/mailAccount'));_0x40d79d[_0xd922('0x8')](_0xd922('0x21'),require('./api/mailQueue'));_0x40d79d[_0xd922('0x8')](_0xd922('0x22'),require('./api/mailSubstatus'));_0x40d79d[_0xd922('0x8')](_0xd922('0x23'),require('./api/mailInteraction'));_0x40d79d[_0xd922('0x8')]('/api/mail/messages',require(_0xd922('0x24')));_0x40d79d[_0xd922('0x8')](_0xd922('0x25'),require(_0xd922('0x26')));_0x40d79d[_0xd922('0x8')](_0xd922('0x27'),require(_0xd922('0x28')));_0x40d79d['use'](_0xd922('0x29'),require(_0xd922('0x2a')));_0x40d79d[_0xd922('0x8')](_0xd922('0x2b'),require('./api/dashboardItem'));_0x40d79d[_0xd922('0x8')](_0xd922('0x2c'),require(_0xd922('0x2d')));_0x40d79d[_0xd922('0x8')](_0xd922('0x2e'),require('./api/faxApplication'));_0x40d79d['use'](_0xd922('0x2f'),require(_0xd922('0x30')));_0x40d79d[_0xd922('0x8')](_0xd922('0x31'),require(_0xd922('0x32')));_0x40d79d[_0xd922('0x8')](_0xd922('0x33'),require('./api/faxQueue'));_0x40d79d[_0xd922('0x8')](_0xd922('0x34'),require('./api/faxQueueReport'));_0x40d79d[_0xd922('0x8')]('/api/sms/accounts',require(_0xd922('0x35')));_0x40d79d['use']('/api/sms/applications',require('./api/smsApplication'));_0x40d79d[_0xd922('0x8')](_0xd922('0x36'),require(_0xd922('0x37')));_0x40d79d[_0xd922('0x8')](_0xd922('0x38'),require(_0xd922('0x39')));_0x40d79d[_0xd922('0x8')]('/api/sms/queues',require(_0xd922('0x3a')));_0x40d79d[_0xd922('0x8')]('/api/openchannel/accounts',require(_0xd922('0x3b')));_0x40d79d[_0xd922('0x8')]('/api/openchannel/applications',require(_0xd922('0x3c')));_0x40d79d[_0xd922('0x8')](_0xd922('0x3d'),require('./api/openchannelInteraction'));_0x40d79d[_0xd922('0x8')](_0xd922('0x3e'),require(_0xd922('0x3f')));_0x40d79d[_0xd922('0x8')](_0xd922('0x40'),require('./api/openchannelQueue'));_0x40d79d[_0xd922('0x8')]('/api/chat/websites',require(_0xd922('0x41')));_0x40d79d[_0xd922('0x8')](_0xd922('0x42'),require(_0xd922('0x43')));_0x40d79d[_0xd922('0x8')](_0xd922('0x44'),require(_0xd922('0x45')));_0x40d79d[_0xd922('0x8')](_0xd922('0x46'),require(_0xd922('0x47')));_0x40d79d[_0xd922('0x8')](_0xd922('0x48'),require(_0xd922('0x49')));_0x40d79d['use']('/api/chat/offline_messages',require(_0xd922('0x4a')));_0x40d79d[_0xd922('0x8')](_0xd922('0x4b'),require('./api/chatQueue'));_0x40d79d[_0xd922('0x8')]('/api/chat/groups',require(_0xd922('0x4c')));_0x40d79d[_0xd922('0x8')](_0xd922('0x4d'),require('./api/chatProactiveAction'));_0x40d79d[_0xd922('0x8')](_0xd922('0x4e'),require(_0xd922('0x4f')));_0x40d79d[_0xd922('0x8')](_0xd922('0x50'),require(_0xd922('0x51')));_0x40d79d[_0xd922('0x8')]('/api/cm/hopper',require('./api/cmHopper'));_0x40d79d[_0xd922('0x8')]('/api/cm/hopper_black',require(_0xd922('0x52')));_0x40d79d[_0xd922('0x8')](_0xd922('0x53'),require(_0xd922('0x54')));_0x40d79d[_0xd922('0x8')](_0xd922('0x55'),require(_0xd922('0x56')));_0x40d79d[_0xd922('0x8')](_0xd922('0x57'),require(_0xd922('0x58')));_0x40d79d['use'](_0xd922('0x59'),require(_0xd922('0x5a')));_0x40d79d['use'](_0xd922('0x5b'),require(_0xd922('0x5c')));_0x40d79d[_0xd922('0x8')](_0xd922('0x5d'),require('./api/cannedAnswer'));_0x40d79d[_0xd922('0x8')](_0xd922('0x5e'),require(_0xd922('0x5f')));_0x40d79d['use'](_0xd922('0x60'),require(_0xd922('0x61')));_0x40d79d[_0xd922('0x8')](_0xd922('0x62'),require(_0xd922('0x63')));_0x40d79d['use'](_0xd922('0x64'),require('./api/pause'));_0x40d79d[_0xd922('0x8')](_0xd922('0x65'),require(_0xd922('0x66')));_0x40d79d[_0xd922('0x8')](_0xd922('0x67'),require(_0xd922('0x68')));_0x40d79d['use'](_0xd922('0x69'),require(_0xd922('0x6a')));_0x40d79d[_0xd922('0x8')](_0xd922('0x6b'),require('./api/sound'));_0x40d79d[_0xd922('0x8')](_0xd922('0x6c'),require(_0xd922('0x6d')));_0x40d79d[_0xd922('0x8')]('/api/contact_item_types',require(_0xd922('0x6e')));_0x40d79d[_0xd922('0x8')]('/api/cm_contact_has_items',require(_0xd922('0x6f')));_0x40d79d['use']('/api/cm_hopper_additional_phones',require(_0xd922('0x70')));_0x40d79d[_0xd922('0x8')](_0xd922('0x71'),require(_0xd922('0x72')));_0x40d79d[_0xd922('0x8')]('/api/triggers',require(_0xd922('0x73')));_0x40d79d[_0xd922('0x8')](_0xd922('0x74'),require(_0xd922('0x75')));_0x40d79d['use']('/api/integrations',require(_0xd922('0x76')));_0x40d79d[_0xd922('0x8')](_0xd922('0x77'),require('./api/integrationReport'));_0x40d79d[_0xd922('0x8')](_0xd922('0x78'),require(_0xd922('0x79')));_0x40d79d[_0xd922('0x8')]('/api/analytics/default_reports',require(_0xd922('0x7a')));_0x40d79d[_0xd922('0x8')](_0xd922('0x7b'),require(_0xd922('0x7c')));_0x40d79d[_0xd922('0x8')](_0xd922('0x7d'),require(_0xd922('0x7e')));_0x40d79d[_0xd922('0x8')](_0xd922('0x7f'),require(_0xd922('0x80')));_0x40d79d[_0xd922('0x8')](_0xd922('0x81'),require('./api/analyticTreeReport'));_0x40d79d[_0xd922('0x8')]('/api/integrations/salesforce/accounts',require(_0xd922('0x82')));_0x40d79d['use'](_0xd922('0x83'),require(_0xd922('0x84')));_0x40d79d[_0xd922('0x8')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x40d79d['use']('/api/integrations/sugarcrm/accounts',require(_0xd922('0x85')));_0x40d79d['use'](_0xd922('0x86'),require(_0xd922('0x87')));_0x40d79d[_0xd922('0x8')](_0xd922('0x88'),require(_0xd922('0x89')));_0x40d79d[_0xd922('0x8')](_0xd922('0x8a'),require('./api/intDeskAccount'));_0x40d79d[_0xd922('0x8')]('/api/integrations/desk/configurations',require(_0xd922('0x8b')));_0x40d79d[_0xd922('0x8')](_0xd922('0x8c'),require(_0xd922('0x8d')));_0x40d79d[_0xd922('0x8')]('/api/integrations/zoho/accounts',require(_0xd922('0x8e')));_0x40d79d['use']('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x40d79d[_0xd922('0x8')](_0xd922('0x8f'),require(_0xd922('0x90')));_0x40d79d[_0xd922('0x8')](_0xd922('0x91'),require('./api/intZendeskAccount'));_0x40d79d[_0xd922('0x8')](_0xd922('0x92'),require(_0xd922('0x93')));_0x40d79d['use'](_0xd922('0x94'),require('./api/intZendeskField'));_0x40d79d['use']('/api/integrations/freshdesk/accounts',require(_0xd922('0x95')));_0x40d79d[_0xd922('0x8')](_0xd922('0x96'),require(_0xd922('0x97')));_0x40d79d[_0xd922('0x8')](_0xd922('0x98'),require(_0xd922('0x99')));_0x40d79d[_0xd922('0x8')](_0xd922('0x9a'),require(_0xd922('0x9b')));_0x40d79d[_0xd922('0x8')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x40d79d[_0xd922('0x8')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x40d79d[_0xd922('0x8')](_0xd922('0x9c'),require('./api/intServicenowAccount'));_0x40d79d[_0xd922('0x8')](_0xd922('0x9d'),require('./api/intServicenowConfiguration'));_0x40d79d[_0xd922('0x8')](_0xd922('0x9e'),require(_0xd922('0x9f')));_0x40d79d['use'](_0xd922('0xa0'),require(_0xd922('0xa1')));_0x40d79d[_0xd922('0x8')](_0xd922('0xa2'),require('./api/intDynamics365Configuration'));_0x40d79d['use'](_0xd922('0xa3'),require('./api/intDynamics365Field'));_0x40d79d[_0xd922('0x8')]('/api/integrations/freshsales/accounts',require(_0xd922('0xa4')));_0x40d79d[_0xd922('0x8')](_0xd922('0xa5'),require(_0xd922('0xa6')));_0x40d79d[_0xd922('0x8')](_0xd922('0xa7'),require(_0xd922('0xa8')));_0x40d79d[_0xd922('0x8')](_0xd922('0xa9'),require(_0xd922('0xaa')));_0x40d79d[_0xd922('0x8')](_0xd922('0xab'),require(_0xd922('0xac')));_0x40d79d[_0xd922('0x8')](_0xd922('0xad'),require(_0xd922('0xae')));_0x40d79d[_0xd922('0x8')](_0xd922('0xaf'),require(_0xd922('0xb0')));_0x40d79d['use'](_0xd922('0xb1'),require(_0xd922('0xb2')));_0x40d79d[_0xd922('0x8')](_0xd922('0xb3'),require(_0xd922('0xb4')));_0x40d79d[_0xd922('0x8')](_0xd922('0xb5'),require('./api/smsQueueReport'));_0x40d79d[_0xd922('0x8')](_0xd922('0xb6'),require(_0xd922('0xb7')));_0x40d79d[_0xd922('0x8')]('/api/square/details/reports',require(_0xd922('0xb8')));_0x40d79d['use'](_0xd922('0xb9'),require(_0xd922('0xba')));_0x40d79d[_0xd922('0x8')](_0xd922('0xbb'),require('./api/setting'));_0x40d79d[_0xd922('0x8')](_0xd922('0xbc'),require(_0xd922('0xbd')));_0x40d79d['use'](_0xd922('0xbe'),require(_0xd922('0xbf')));_0x40d79d[_0xd922('0x8')](_0xd922('0xc0'),require(_0xd922('0xc1')));_0x40d79d[_0xd922('0x8')](_0xd922('0xc2'),require(_0xd922('0xc3')));_0x40d79d['use'](_0xd922('0xc4'),require('./api/team'));_0x40d79d[_0xd922('0x8')](_0xd922('0xc5'),require('./api/license'));_0x40d79d[_0xd922('0x8')](_0xd922('0xc6'),require('./api/campaign'));_0x40d79d[_0xd922('0x8')](_0xd922('0xc7'),require('./api/migration'));_0x40d79d['use'](_0xd922('0xc8'),require(_0xd922('0xc9')));_0x40d79d[_0xd922('0x8')]('/api/plugins',require(_0xd922('0xca')));_0x40d79d[_0xd922('0x8')](_0xd922('0xcb'),require('./api/mailTransferReport'));_0x40d79d[_0xd922('0x8')](_0xd922('0xcc'),require('./api/chatTransferReport'));_0x40d79d['use'](_0xd922('0xcd'),require(_0xd922('0xce')));_0x40d79d[_0xd922('0x8')]('/api/openchannel/reports/transfer',require(_0xd922('0xcf')));_0x40d79d[_0xd922('0x8')](_0xd922('0xd0'),require(_0xd922('0xd1')));_0x40d79d[_0xd922('0x8')](_0xd922('0xd2'),require(_0xd922('0xd3')));_0x40d79d['use'](_0xd922('0xd4'),require(_0xd922('0xd5')));_0x40d79d[_0xd922('0x8')](_0xd922('0xd6'),require(_0xd922('0xd7')));_0x40d79d[_0xd922('0x8')]('/api/userProfile/sections',require(_0xd922('0xd8')));_0x40d79d[_0xd922('0x8')](_0xd922('0xd9'),require(_0xd922('0xda')));_0x40d79d[_0xd922('0x8')]('/api/userNotifications',require(_0xd922('0xdb')));_0x40d79d[_0xd922('0x8')](_0xd922('0xdc'),require('./api/whatsappAccount'));_0x40d79d[_0xd922('0x8')](_0xd922('0xdd'),require('./api/whatsappApplication'));_0x40d79d[_0xd922('0x8')](_0xd922('0xde'),require(_0xd922('0xdf')));_0x40d79d[_0xd922('0x8')](_0xd922('0xe0'),require(_0xd922('0xe1')));_0x40d79d['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x40d79d['use'](_0xd922('0xe2'),require(_0xd922('0xe3')));_0x40d79d['use'](_0xd922('0xe4'),require(_0xd922('0xe5')));_0x40d79d[_0xd922('0x8')](_0xd922('0xe6'),require('./api/cloudProvider'));_0x40d79d[_0xd922('0x8')](_0xd922('0xe7'),require(_0xd922('0xe8')));_0x40d79d[_0xd922('0x8')](_0xd922('0xe9'),require(_0xd922('0xea')));_0x40d79d['use'](_0xd922('0xeb'),require('./api/authLocal'));_0x40d79d[_0xd922('0x8')](_0xd922('0xec'),require(_0xd922('0xed')));_0x40d79d[_0xd922('0x8')](_0xd922('0xee'),require(_0xd922('0xef')));_0x40d79d[_0xd922('0x8')](_0xd922('0xf0'),require(_0xd922('0xf1')));_0x40d79d['use'](_0xd922('0xf2'),require(_0xd922('0xf3')));_0x40d79d['use'](_0xd922('0xf4'),require('./api/version'));_0x40d79d[_0xd922('0x8')](_0xd922('0xf5'),require('./api/system'));_0x40d79d[_0xd922('0x8')](_0xd922('0xf6'),require(_0xd922('0xf7')));_0x40d79d[_0xd922('0x8')]('/api/webbar',require('./api/webbar'));_0x40d79d[_0xd922('0x8')](_0xd922('0xf8'),clientSideLogs);_0x40d79d['use']('/apidoc',express[_0xd922('0xf9')](path[_0xd922('0xfa')](config[_0xd922('0xfb')],'/apidoc')));_0x40d79d['use'](_0xd922('0xfc'),express[_0xd922('0xf9')](path[_0xd922('0xfa')](config[_0xd922('0xfb')],_0xd922('0xfc'))));_0x40d79d[_0xd922('0x8')](_0xd922('0xfd'),express[_0xd922('0xf9')](path[_0xd922('0xfa')](config['root'],_0xd922('0xfd'))));_0x40d79d[_0xd922('0x8')](_0xd922('0xfe'),express[_0xd922('0xf9')](path[_0xd922('0xfa')](config[_0xd922('0xfb')],_0xd922('0xff'),_0xd922('0x100'))));_0x40d79d[_0xd922('0x8')](_0xd922('0x101'),express[_0xd922('0xf9')](path[_0xd922('0xfa')](config[_0xd922('0xfb')],'/server/files/plugins')));_0x40d79d[_0xd922('0x102')](_0xd922('0x103'))[_0xd922('0x104')](errors[0x194]);_0x40d79d[_0xd922('0x102')]('/*')[_0xd922('0x104')](function(_0x38eb6f,_0x14e94b){_0x14e94b['sendFile'](path[_0xd922('0x105')](_0x40d79d[_0xd922('0x104')]('appPath')+_0xd922('0x106')));});return _0x40d79d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 31a6f37..71edc4e 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe714=['../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/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/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0x1b6417,_0x409dde){var _0x3b323=function(_0x103c8e){while(--_0x103c8e){_0x1b6417['push'](_0x1b6417['shift']());}};_0x3b323(++_0x409dde);}(_0xe714,0xe2));var _0x4e71=function(_0x247a05,_0x32da68){_0x247a05=_0x247a05-0x0;var _0x16a181=_0xe714[_0x247a05];return _0x16a181;};'use strict';var jayson=require(_0x4e71('0x0'));var _=require('lodash');var config=require(_0x4e71('0x1'));exports[_0x4e71('0x2')]=function(){return new Promise(function(_0xe0504f,_0x28abe0){var _0x5c5974={};_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/user/user.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x4')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x5')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x6')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x7')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x8')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x9')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0xa')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0xb')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0xc')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0xd')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0xe')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0xf')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/mailQueue/mailQueue.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x10')));_0x5c5974=_['merge'](_0x5c5974,require('../api/mailMessage/mailMessage.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/mailApplication/mailApplication.rpc'));_0x5c5974=_['merge'](_0x5c5974,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x11')));_0x5c5974=_['merge'](_0x5c5974,require('../api/faxApplication/faxApplication.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x12')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x13')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x14')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x15')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/smsAccount/smsAccount.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x16')));_0x5c5974=_['merge'](_0x5c5974,require('../api/smsMessage/smsMessage.rpc'));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x17')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x18')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x19')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x1a')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x1b')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x1c')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/chatInteraction/chatInteraction.rpc'));_0x5c5974=_['merge'](_0x5c5974,require('../api/chatMessage/chatMessage.rpc'));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x1d')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x1e')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x1f')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x20')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x21')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x22')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x23')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x24')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/sound/sound.rpc'));_0x5c5974=_['merge'](_0x5c5974,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x25')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x26')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x27')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x28')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x29')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x2a')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x2b')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x2c')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x2d')));_0x5c5974=_['merge'](_0x5c5974,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x2e')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x2f')));_0x5c5974=_['merge'](_0x5c5974,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x30')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x31')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x32')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/squareOdbc/squareOdbc.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x33')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x34')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/squareMessage/squareMessage.rpc'));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x35')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x36')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require('../api/plugin/plugin.rpc'));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x37')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x38')));_0x5c5974=_[_0x4e71('0x3')](_0x5c5974,require(_0x4e71('0x39')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x3a')));_0x5c5974=_['merge'](_0x5c5974,require(_0x4e71('0x3b')));var _0x4edcf0=jayson[_0x4e71('0x3c')](_0x5c5974)[_0x4e71('0x3d')]();var _0x52f144=config[_0x4e71('0x3e')][_0x4e71('0x3f')]||config[_0x4e71('0x3f')]+0x1;var _0x698e5c=config[_0x4e71('0x3e')]['ip']||_0x4e71('0x40');_0x4edcf0['on'](_0x4e71('0x41'),function(_0x2bae8a){return _0x28abe0(_0x2bae8a);});_0x4edcf0[_0x4e71('0x2')](_0x52f144,_0x698e5c,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x698e5c,_0x52f144);require(_0x4e71('0x42'))[_0x4e71('0x43')]();return _0xe0504f(_0x4e71('0x44')+_0x698e5c+':'+_0x52f144);});});}; \ No newline at end of file +var _0xd983=['../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','http','port','rpc','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc'];(function(_0x11caa3,_0x7f2ae6){var _0x4fb170=function(_0x568829){while(--_0x568829){_0x11caa3['push'](_0x11caa3['shift']());}};_0x4fb170(++_0x7f2ae6);}(_0xd983,0x7d));var _0x3d98=function(_0x569892,_0x26a674){_0x569892=_0x569892-0x0;var _0xa70981=_0xd983[_0x569892];return _0xa70981;};'use strict';var jayson=require(_0x3d98('0x0'));var _=require(_0x3d98('0x1'));var config=require(_0x3d98('0x2'));exports['listen']=function(){return new Promise(function(_0x282341,_0x1d5601){var _0x1cb3ca={};_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x4')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x5')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x6')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x7')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x8')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x9')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0xa')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0xb')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0xc')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0xd')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/mailServerIn/mailServerIn.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0xe')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0xf')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x10')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x11')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x12')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x13')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x14')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/faxApplication/faxApplication.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x15')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/faxMessage/faxMessage.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x16')));_0x1cb3ca=_['merge'](_0x1cb3ca,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/smsAccount/smsAccount.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x17')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x18')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/smsQueue/smsQueue.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x19')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x1a')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x1b')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/chatInteraction/chatInteraction.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x1c')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x1d')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x1e')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x1f')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x20')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x21')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x22')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x23')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x24')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x25')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x26')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x27')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x28')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x29')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x2a')));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x2b')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x2c')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x2d')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x2e')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x2f')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x30')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x31')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x32')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x33')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x34')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x35')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/squareOdbc/squareOdbc.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x36')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x37')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x38')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x39')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/attachment/attachment.rpc'));_0x1cb3ca=_['merge'](_0x1cb3ca,require(_0x3d98('0x3a')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require(_0x3d98('0x3b')));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1cb3ca=_[_0x3d98('0x3')](_0x1cb3ca,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x2a1f18=jayson['server'](_0x1cb3ca)[_0x3d98('0x3c')]();var _0x312e3d=config['rpc']['port']||config[_0x3d98('0x3d')]+0x1;var _0x31e41b=config[_0x3d98('0x3e')]['ip']||_0x3d98('0x3f');_0x2a1f18['on'](_0x3d98('0x40'),function(_0x37b149){return _0x1d5601(_0x37b149);});_0x2a1f18[_0x3d98('0x41')](_0x312e3d,_0x31e41b,function(){console[_0x3d98('0x42')](_0x3d98('0x43'),_0x31e41b,_0x312e3d);require(_0x3d98('0x44'))[_0x3d98('0x45')]();return _0x282341(_0x3d98('0x46')+_0x31e41b+':'+_0x312e3d);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 12ca392..d7bf10d 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 _0x07fa=['write','inherits','prototype','sendRequest','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','indexOf','substr','startsWith','length','match','close','E_AGI_SOCKET_CLOSE','timeout','destroy','command'];(function(_0x3cff41,_0x6d45b6){var _0x16ab1f=function(_0x3c30cc){while(--_0x3c30cc){_0x3cff41['push'](_0x3cff41['shift']());}};_0x16ab1f(++_0x6d45b6);}(_0x07fa,0x177));var _0xa07f=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x07fa[_0x56916d];return _0x2b7f1f;};'use strict';var util=require('util');var _=require(_0xa07f('0x0'));var EventEmitter=require(_0xa07f('0x1'))[_0xa07f('0x2')];var AGIReply=require(_0xa07f('0x3'));var AGIError=require(_0xa07f('0x4'));function AGIChannel(_0x56c63d){var _0x4517a5=this,_0x22ed59=new AGIReply(),_0x573aa3=![],_0x4ceab6={};EventEmitter['call'](_0x4517a5);_0x56c63d[_0xa07f('0x5')](_0xa07f('0x6'));_0x56c63d['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x22ed59[_0xa07f('0x5')]('utf8');_0x22ed59['on']('headers',function(_0x5d82e9){for(var _0x5cac85 in _0x5d82e9){_0x4517a5[_0x5cac85]=_0x5d82e9[_0x5cac85];}_0x4517a5[_0xa07f('0x7')](_0xa07f('0x8'));});_0x22ed59['on']('line',function(_0xd3bdbf){if(_0xd3bdbf[_0xa07f('0x9')]()==_0xa07f('0xa')){_0x4517a5[_0xa07f('0x7')](_0xa07f('0xa'));return;}if(_0xd3bdbf[_0xa07f('0xb')](0x0,0xb)==_0xa07f('0xc')){_0x573aa3=!![];}if(_0x573aa3){_0x4ceab6['rx']+=_0xd3bdbf+'\x0a';if(_0xd3bdbf[_0xa07f('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x573aa3=![];}}else{_0x4ceab6['rx']=_0xd3bdbf;}if(_0x573aa3){return;}if(typeof _0x4ceab6['cb']==_0xa07f('0xe')){var _0x31b5c1=_0x4ceab6['rx'][_0xa07f('0xb')](0x0,0x3),_0x5500a6=null,_0x2baafc=null;_0x31b5c1=parseInt(_0x31b5c1);if(isNaN(_0x31b5c1)){_0x4ceab6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa07f('0xf')});return;}if(_0x31b5c1!=0xc8){_0x4ceab6['cb'](null,{'code':_0x31b5c1,'result':-0x1,'extra':'KO'});return;}_0x5500a6=_0x4ceab6['rx']['substring'](0x4)[_0xa07f('0x10')]('result=','');if(_0x5500a6[_0xa07f('0x11')]('\x20')!=-0x1){_0x5500a6=_0x5500a6[_0xa07f('0x12')](0x0,_0x5500a6[_0xa07f('0x11')]('\x20'));}if(_[_0xa07f('0x13')](_0x5500a6,'-1')){_0x5500a6=parseInt(_0x5500a6);}_0x2baafc=_0x4ceab6['rx']['split']('\x20');if(_0x2baafc[_0xa07f('0x14')]==0x3){_0x2baafc=_0x2baafc[0x2][_0xa07f('0xb')](0x1,_0x2baafc[0x2][_0xa07f('0x14')]-0x1);}else if(_0x2baafc[_0xa07f('0x14')]>0x3){var _0x4090a1=/\((.+)\)/;var _0x5da71c=_0x4ceab6['rx'][_0xa07f('0x15')](_0x4090a1);if(_0x5da71c){_0x2baafc=_0x5da71c[0x1];}else{_0x2baafc=null;}}else{_0x2baafc=null;}_0x4ceab6['cb'](null,{'code':_0x31b5c1,'result':_0x5500a6,'extra':_0x2baafc});}});_0x56c63d['on']('error',function(_0x5450a9){_0x4517a5['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x5450a9['code']));});_0x56c63d['on'](_0xa07f('0x16'),function(){_0x4517a5[_0xa07f('0x7')](_0xa07f('0x16'),new AGIError(_0xa07f('0x17')));});_0x56c63d['on'](_0xa07f('0x18'),function(){_0x4517a5[_0xa07f('0x7')](_0xa07f('0x18'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x56c63d[_0xa07f('0x19')]();});_0x56c63d['pipe'](_0x22ed59);this[_0xa07f('0x1a')]=function(_0x55a481,_0x587d58){var _0x55a481=_0x55a481||'',_0x587d58=typeof _0x587d58==_0xa07f('0xe')?_0x587d58:new Function();_0x4ceab6={'tx':_0x55a481,'rx':'','cb':_0x587d58};_0x56c63d[_0xa07f('0x1b')](_0x55a481+'\x0a');},this['close']=function(){_0x56c63d[_0xa07f('0x19')]();};}util[_0xa07f('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0xa07f('0x1d')][_0xa07f('0x1e')]=function(_0x24c1e2){return this[_0xa07f('0x1a')]['sync'](this,_0x24c1e2);};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x1f')]=function(){return this[_0xa07f('0x1e')](_0xa07f('0x20'));};AGIChannel[_0xa07f('0x1d')]['getData']=function(_0x48f809,_0x280380,_0x2cdd67){_0x48f809=_0x48f809===undefined?'beep':_0x48f809;_0x280380=_0x280380===undefined?'5':_0x280380;_0x2cdd67=_0x2cdd67===undefined?'1':_0x2cdd67;return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x22'),_0x48f809,_0x280380*0x3e8,_0x2cdd67));};AGIChannel['prototype'][_0xa07f('0x23')]=function(_0x1c0099){_0x1c0099=_0x1c0099||'NO\x20MESSAGE';return this['sendRequest'](util[_0xa07f('0x21')](_0xa07f('0x24'),_0x1c0099));};AGIChannel[_0xa07f('0x1d')]['exec']=function(_0x438569,_0x2d1431){if(_['isArray'](_0x2d1431)){return this['sendRequest'](util[_0xa07f('0x21')]('EXEC\x20%s\x20%s',_0x438569,_0x2d1431[_0xa07f('0x25')](',')));}return this[_0xa07f('0x1e')](util['format'](_0xa07f('0x26'),_0x438569,_0x2d1431));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x27')]=function(_0x4cc602){return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x28'),_0x4cc602));};AGIChannel[_0xa07f('0x1d')]['setExtension']=function(_0x1fe2f8){return this['sendRequest'](util['format'](_0xa07f('0x29'),_0x1fe2f8));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x2a')]=function(_0x592399){return this['sendRequest'](util[_0xa07f('0x21')](_0xa07f('0x2b'),_0x592399));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0xa')]=function(){return this[_0xa07f('0x1e')](_0xa07f('0x2c'));};AGIChannel[_0xa07f('0x1d')]['setVariable']=function(_0x42815a,_0x10d7d7){var _0x215ae8=_[_0xa07f('0x2d')](_0x10d7d7)||_['isNumber'](_0x10d7d7)?_0x10d7d7['toString']():_0x10d7d7;return this[_0xa07f('0x1e')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x42815a,_0x215ae8?_0x215ae8[_0xa07f('0x2e')]()[_0xa07f('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xa07f('0x2f')]=function(_0x4eae63,_0x2788a7){return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x30'),_0x4eae63,_0x2788a7));};AGIChannel[_0xa07f('0x1d')]['sayDigits']=function(_0x58adde,_0x42d7d6){return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x31'),_0x58adde,_0x42d7d6));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x32')]=function(_0x304404,_0x4c5bc6){return this[_0xa07f('0x1e')](util[_0xa07f('0x21')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x304404,_0x4c5bc6));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x33')]=function(_0x55f7b8,_0xfa9caf,_0x1e2b56){_0xfa9caf=_0xfa9caf||this['extension'];_0x1e2b56=_0x1e2b56||0x1;this[_0xa07f('0x27')](_0x55f7b8);this['setExtension'](_0xfa9caf);this[_0xa07f('0x2a')](_0x1e2b56);return this[_0xa07f('0x23')](util[_0xa07f('0x21')](_0xa07f('0x34'),_0x55f7b8,_0xfa9caf,_0x1e2b56));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x35')]=function(_0x52513f){return this['sendRequest'](util[_0xa07f('0x21')]('GET\x20VARIABLE\x20\x22%s\x22',_0x52513f));};AGIChannel[_0xa07f('0x1d')]['recordFile']=function(_0x59add3,_0x28e268,_0x53bf27,_0x22f482,_0x244071,_0xb0bb7a){_0x28e268=_0x28e268||_0xa07f('0x36');_0x53bf27=_0x53bf27||'';_0x22f482=_0x22f482===undefined?-0x1:_0x22f482==='-1'?-0x1:_0x22f482*0x3e8;_0x244071=_0x244071===undefined?'':'s='+_0x244071;_0xb0bb7a=_0xb0bb7a?'BEEP':'';return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x37'),_0x59add3,_0x28e268,_0x53bf27,_0x22f482,_0xb0bb7a,_0x244071));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x38')]=function(_0x4f8e3c,_0x5a1915){_0x5a1915=_0x5a1915||'';return this[_0xa07f('0x1e')](util[_0xa07f('0x21')](_0xa07f('0x39'),_0x4f8e3c,_0x5a1915));};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x3a')]=function(_0x1d29a4){return this['exec'](_0xa07f('0x3b'),_0x1d29a4);};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x3c')]=function(_0x5a4ce8){return this[_0xa07f('0x3d')](_0xa07f('0x3e'),_0x5a4ce8);};AGIChannel[_0xa07f('0x1d')][_0xa07f('0x3f')]=function(_0xf6008a,_0x5f5733){this['noop'](util[_0xa07f('0x21')](_0xa07f('0x40'),_0xf6008a['id'],_0xf6008a[_0xa07f('0x41')],_0x5f5733));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xa07f('0x42')]=AGIChannel; \ No newline at end of file +var _0xd9db=['split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','HANGUP','setVariable','isBoolean','isNumber','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','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith'];(function(_0x396145,_0x4c46cc){var _0x163af7=function(_0x54383f){while(--_0x54383f){_0x396145['push'](_0x396145['shift']());}};_0x163af7(++_0x4c46cc);}(_0xd9db,0x8a));var _0xbd9d=function(_0xbd300c,_0x2daccf){_0xbd300c=_0xbd300c-0x0;var _0x4216a5=_0xd9db[_0xbd300c];return _0x4216a5;};'use strict';var util=require(_0xbd9d('0x0'));var _=require(_0xbd9d('0x1'));var EventEmitter=require('events')[_0xbd9d('0x2')];var AGIReply=require(_0xbd9d('0x3'));var AGIError=require(_0xbd9d('0x4'));function AGIChannel(_0x2e2a1b){var _0x11af25=this,_0x284c2b=new AGIReply(),_0x363833=![],_0x126901={};EventEmitter[_0xbd9d('0x5')](_0x11af25);_0x2e2a1b[_0xbd9d('0x6')](_0xbd9d('0x7'));_0x2e2a1b['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x284c2b['setEncoding'](_0xbd9d('0x7'));_0x284c2b['on'](_0xbd9d('0x8'),function(_0x1b71e7){for(var _0x59d653 in _0x1b71e7){_0x11af25[_0x59d653]=_0x1b71e7[_0x59d653];}_0x11af25[_0xbd9d('0x9')](_0xbd9d('0xa'));});_0x284c2b['on'](_0xbd9d('0xb'),function(_0x3a0414){if(_0x3a0414[_0xbd9d('0xc')]()==_0xbd9d('0xd')){_0x11af25[_0xbd9d('0x9')](_0xbd9d('0xd'));return;}if(_0x3a0414[_0xbd9d('0xe')](0x0,0xb)==_0xbd9d('0xf')){_0x363833=!![];}if(_0x363833){_0x126901['rx']+=_0x3a0414+'\x0a';if(_0x3a0414[_0xbd9d('0x10')](_0xbd9d('0x11'))!=-0x1){_0x363833=![];}}else{_0x126901['rx']=_0x3a0414;}if(_0x363833){return;}if(typeof _0x126901['cb']==_0xbd9d('0x12')){var _0x53da90=_0x126901['rx']['substring'](0x0,0x3),_0xf5f13=null,_0x1820b9=null;_0x53da90=parseInt(_0x53da90);if(isNaN(_0x53da90)){_0x126901['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xbd9d('0x13')});return;}if(_0x53da90!=0xc8){_0x126901['cb'](null,{'code':_0x53da90,'result':-0x1,'extra':'KO'});return;}_0xf5f13=_0x126901['rx']['substring'](0x4)[_0xbd9d('0x14')]('result=','');if(_0xf5f13[_0xbd9d('0x15')]('\x20')!=-0x1){_0xf5f13=_0xf5f13[_0xbd9d('0x16')](0x0,_0xf5f13[_0xbd9d('0x15')]('\x20'));}if(_[_0xbd9d('0x17')](_0xf5f13,'-1')){_0xf5f13=parseInt(_0xf5f13);}_0x1820b9=_0x126901['rx'][_0xbd9d('0x18')]('\x20');if(_0x1820b9[_0xbd9d('0x19')]==0x3){_0x1820b9=_0x1820b9[0x2][_0xbd9d('0xe')](0x1,_0x1820b9[0x2][_0xbd9d('0x19')]-0x1);}else if(_0x1820b9['length']>0x3){var _0x1e56ae=/\((.+)\)/;var _0xa0de52=_0x126901['rx']['match'](_0x1e56ae);if(_0xa0de52){_0x1820b9=_0xa0de52[0x1];}else{_0x1820b9=null;}}else{_0x1820b9=null;}_0x126901['cb'](null,{'code':_0x53da90,'result':_0xf5f13,'extra':_0x1820b9});}});_0x2e2a1b['on'](_0xbd9d('0x1a'),function(_0x4cce3c){_0x11af25['emit'](_0xbd9d('0x1a'),new AGIError(_0xbd9d('0x1b'),_0x4cce3c[_0xbd9d('0x1c')]));});_0x2e2a1b['on'](_0xbd9d('0x1d'),function(){_0x11af25[_0xbd9d('0x9')]('close',new AGIError(_0xbd9d('0x1e')));});_0x2e2a1b['on'](_0xbd9d('0x1f'),function(){_0x11af25[_0xbd9d('0x9')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2e2a1b[_0xbd9d('0x20')]();});_0x2e2a1b[_0xbd9d('0x21')](_0x284c2b);this[_0xbd9d('0x22')]=function(_0x58af8e,_0x358fdf){var _0x58af8e=_0x58af8e||'',_0x358fdf=typeof _0x358fdf=='function'?_0x358fdf:new Function();_0x126901={'tx':_0x58af8e,'rx':'','cb':_0x358fdf};_0x2e2a1b[_0xbd9d('0x23')](_0x58af8e+'\x0a');},this[_0xbd9d('0x1d')]=function(){_0x2e2a1b[_0xbd9d('0x20')]();};}util[_0xbd9d('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x26')]=function(_0x3f125e){return this[_0xbd9d('0x22')][_0xbd9d('0x27')](this,_0x3f125e);};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x28')]=function(){return this[_0xbd9d('0x26')](_0xbd9d('0x29'));};AGIChannel['prototype'][_0xbd9d('0x2a')]=function(_0x30efbc,_0x123654,_0x188b64){_0x30efbc=_0x30efbc===undefined?_0xbd9d('0x2b'):_0x30efbc;_0x123654=_0x123654===undefined?'5':_0x123654;_0x188b64=_0x188b64===undefined?'1':_0x188b64;return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x2d'),_0x30efbc,_0x123654*0x3e8,_0x188b64));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x2e')]=function(_0x77fef8){_0x77fef8=_0x77fef8||'NO\x20MESSAGE';return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x2f'),_0x77fef8));};AGIChannel[_0xbd9d('0x25')]['exec']=function(_0x2c1a54,_0x1a1074){if(_[_0xbd9d('0x30')](_0x1a1074)){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x31'),_0x2c1a54,_0x1a1074['join'](',')));}return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x31'),_0x2c1a54,_0x1a1074));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x32')]=function(_0x5af60c){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x33'),_0x5af60c));};AGIChannel['prototype'][_0xbd9d('0x34')]=function(_0x3e96c2){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')]('SET\x20EXTENSION\x20%s',_0x3e96c2));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x35')]=function(_0x536463){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')]('SET\x20PRIORITY\x20%s',_0x536463));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0xd')]=function(){return this[_0xbd9d('0x26')](_0xbd9d('0x36'));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x37')]=function(_0x4aee9f,_0x4697a7){var _0x1598e8=_[_0xbd9d('0x38')](_0x4697a7)||_[_0xbd9d('0x39')](_0x4697a7)?_0x4697a7[_0xbd9d('0x3a')]():_0x4697a7;return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4aee9f,_0x1598e8?_0x1598e8[_0xbd9d('0x3a')]()[_0xbd9d('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x3b')]=function(_0x4c5a18,_0x1d40d2){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x3c'),_0x4c5a18,_0x1d40d2));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x3d')]=function(_0x530475,_0x8a16a4){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x3e'),_0x530475,_0x8a16a4));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x3f')]=function(_0x5739e2,_0x36e96f){return this[_0xbd9d('0x26')](util[_0xbd9d('0x2c')](_0xbd9d('0x40'),_0x5739e2,_0x36e96f));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x41')]=function(_0x31a21b,_0x1d5c4e,_0x31c105){_0x1d5c4e=_0x1d5c4e||this['extension'];_0x31c105=_0x31c105||0x1;this['setContext'](_0x31a21b);this[_0xbd9d('0x34')](_0x1d5c4e);this[_0xbd9d('0x35')](_0x31c105);return this[_0xbd9d('0x2e')](util[_0xbd9d('0x2c')](_0xbd9d('0x42'),_0x31a21b,_0x1d5c4e,_0x31c105));};AGIChannel['prototype'][_0xbd9d('0x43')]=function(_0x1f7ec6){return this['sendRequest'](util[_0xbd9d('0x2c')](_0xbd9d('0x44'),_0x1f7ec6));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x45')]=function(_0x1935f4,_0x2e5d44,_0x18073e,_0x60c281,_0xc08ccf,_0x43d6c4){_0x2e5d44=_0x2e5d44||_0xbd9d('0x46');_0x18073e=_0x18073e||'';_0x60c281=_0x60c281===undefined?-0x1:_0x60c281==='-1'?-0x1:_0x60c281*0x3e8;_0xc08ccf=_0xc08ccf===undefined?'':'s='+_0xc08ccf;_0x43d6c4=_0x43d6c4?_0xbd9d('0x47'):'';return this[_0xbd9d('0x26')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x1935f4,_0x2e5d44,_0x18073e,_0x60c281,_0x43d6c4,_0xc08ccf));};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x48')]=function(_0x2d4316,_0x252dee){_0x252dee=_0x252dee||'';return this['sendRequest'](util[_0xbd9d('0x2c')](_0xbd9d('0x49'),_0x2d4316,_0x252dee));};AGIChannel['prototype'][_0xbd9d('0x4a')]=function(_0xc36d05){return this['exec'](_0xbd9d('0x4b'),_0xc36d05);};AGIChannel[_0xbd9d('0x25')][_0xbd9d('0x4c')]=function(_0x5717bd){return this[_0xbd9d('0x4d')](_0xbd9d('0x4e'),_0x5717bd);};AGIChannel['prototype'][_0xbd9d('0x1a')]=function(_0x2f3c99,_0x13a737){this[_0xbd9d('0x2e')](util[_0xbd9d('0x2c')](_0xbd9d('0x4f'),_0x2f3c99['id'],_0x2f3c99[_0xbd9d('0x50')],_0x13a737));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d20b064..af3f8cd 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 _0xffb2=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x492cc9,_0x3b8720){var _0x25b7e2=function(_0x2e8a99){while(--_0x2e8a99){_0x492cc9['push'](_0x492cc9['shift']());}};_0x25b7e2(++_0x3b8720);}(_0xffb2,0x16b));var _0x2ffb=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xffb2[_0x5cb97e];return _0x1714b4;};'use strict';var util=require(_0x2ffb('0x0'));var error={'E_AGI_UNDEFINED':_0x2ffb('0x1'),'E_AGI_ARGUMENT_PORT':_0x2ffb('0x2'),'E_AGI_SERVER_ERROR':_0x2ffb('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x2ffb('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x2ffb('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x2ffb('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2ffb('0x7'),'E_AGI_IVR_ENTRY':_0x2ffb('0x8')};function AGIError(_0x5f460e){var _0x5f460e=_0x5f460e||null,_0x40e3f5=_0x40e3f5||[],_0xda3874=0x1,_0x5cbd64='';if(!error[_0x5f460e]){_0x5f460e=_0x2ffb('0x9');}_0x40e3f5['push'](error[_0x5f460e]);while(arguments[_0xda3874]){_0x40e3f5[_0x2ffb('0xa')](arguments[_0xda3874]);_0xda3874++;}_0x5cbd64=util[_0x2ffb('0xb')]['apply'](util,_0x40e3f5);this[_0x2ffb('0xc')]=_0x5cbd64;this[_0x2ffb('0xd')]=_0x5f460e;}module[_0x2ffb('0xe')]=AGIError; \ No newline at end of file +var _0xbcda=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x9b5ab4,_0x456641){var _0x1a56da=function(_0x5c534e){while(--_0x5c534e){_0x9b5ab4['push'](_0x9b5ab4['shift']());}};_0x1a56da(++_0x456641);}(_0xbcda,0x107));var _0xabcd=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xbcda[_0x3054be];return _0x3df150;};'use strict';var util=require(_0xabcd('0x0'));var error={'E_AGI_UNDEFINED':_0xabcd('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xabcd('0x2'),'E_AGI_SERVER_CLOSE':_0xabcd('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xabcd('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xabcd('0x5'),'E_AGI_SOCKET_ERROR':_0xabcd('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xabcd('0x7'),'E_AGI_COMMAND_EMPTY':_0xabcd('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xabcd('0x9'),'E_AGI_IVR_ENTRY':_0xabcd('0xa')};function AGIError(_0x4192bf){var _0x4192bf=_0x4192bf||null,_0x34e099=_0x34e099||[],_0x5395bc=0x1,_0x35baa6='';if(!error[_0x4192bf]){_0x4192bf=_0xabcd('0xb');}_0x34e099['push'](error[_0x4192bf]);while(arguments[_0x5395bc]){_0x34e099[_0xabcd('0xc')](arguments[_0x5395bc]);_0x5395bc++;}_0x35baa6=util[_0xabcd('0xd')][_0xabcd('0xe')](util,_0x34e099);this[_0xabcd('0xf')]=_0x35baa6;this[_0xabcd('0x10')]=_0x4192bf;}module[_0xabcd('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index bd1e20b..d88d464 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 _0xfe53=['exports','lodash','EventEmitter','./error','redis','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate'];(function(_0x397bfa,_0x3484a4){var _0x40132e=function(_0x5d10eb){while(--_0x5d10eb){_0x397bfa['push'](_0x397bfa['shift']());}};_0x40132e(++_0x3484a4);}(_0xfe53,0x12d));var _0x3fe5=function(_0x56fb73,_0x491492){_0x56fb73=_0x56fb73-0x0;var _0xa9dd3=_0xfe53[_0x56fb73];return _0xa9dd3;};'use strict';var _=require(_0x3fe5('0x0'));var EventEmitter=require('events')[_0x3fe5('0x1')];var Redis=require('ioredis');var AGIError=require(_0x3fe5('0x2'));var config=require('../../config/environment');config['redis']=_['defaults'](config[_0x3fe5('0x3')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x3fe5('0x3')]);sub['subscribe'](_0x3fe5('0x4'),function(_0x310f8d){if(_0x310f8d)return eventEmitter[_0x3fe5('0x5')](_0x3fe5('0x6'),new AGIError(_0x3fe5('0x7'),_0x310f8d));});sub['on'](_0x3fe5('0x8'),function(_0x471818,_0x1a3e73){if(_0x471818!==_0x3fe5('0x4'))return;try{var _0x11ee8f=JSON[_0x3fe5('0x9')](_0x1a3e73);eventEmitter[_0x3fe5('0x5')](_0x3fe5('0xa'),_0x11ee8f);}catch(_0x491662){eventEmitter[_0x3fe5('0x5')]('error',new AGIError(_0x3fe5('0x7'),_0x491662));}});module[_0x3fe5('0xb')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xdc3a=['../../config/environment','redis','subscribe','emit','E_AGI_SERVER_ERROR','message','agi','parse','error','exports','lodash','events'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xdc3a,0xfa));var _0xadc3=function(_0x520129,_0xb5bb86){_0x520129=_0x520129-0x0;var _0xd52628=_0xdc3a[_0x520129];return _0xd52628;};'use strict';var _=require(_0xadc3('0x0'));var EventEmitter=require(_0xadc3('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require('./error');var config=require(_0xadc3('0x2'));config[_0xadc3('0x3')]=_['defaults'](config[_0xadc3('0x3')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xadc3('0x3')]);sub[_0xadc3('0x4')]('agi',function(_0x3bc712){if(_0x3bc712)return eventEmitter[_0xadc3('0x5')]('error',new AGIError(_0xadc3('0x6'),_0x3bc712));});sub['on'](_0xadc3('0x7'),function(_0x2159a8,_0x162f21){if(_0x2159a8!==_0xadc3('0x8'))return;try{var _0x346df0=JSON[_0xadc3('0x9')](_0x162f21);eventEmitter[_0xadc3('0x5')]('projectUpdate',_0x346df0);}catch(_0x5aef38){eventEmitter[_0xadc3('0x5')](_0xadc3('0xa'),new AGIError(_0xadc3('0x6'),_0x5aef38));}});module[_0xadc3('0xb')]={'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 71f3c65..4b1f640 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 _0x1fc7=['menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','target','agicommand','invalid','vswitch','includes','condition\x20not\x20found','lodash','../../../config/logger','agi'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1fc7,0x8e));var _0x71fc=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x1fc7[_0x166742];return _0xb7814a;};'use strict';var _=require(_0x71fc('0x0'));var logger=require(_0x71fc('0x1'))(_0x71fc('0x2'));var verticesWithRetry=[_0x71fc('0x3'),_0x71fc('0x4'),_0x71fc('0x5')];var Graph=function(){this[_0x71fc('0x6')]={};this[_0x71fc('0x7')]={};this[_0x71fc('0x8')]=0x0;};Graph['prototype'][_0x71fc('0x9')]=function(_0x2e15f4){this[_0x71fc('0x6')][_0x2e15f4['id']]=_0x2e15f4;this[_0x71fc('0x7')][_0x2e15f4['id']]=[];};Graph[_0x71fc('0xa')][_0x71fc('0xb')]=function(_0x4912fe,_0x4ceb94,_0x42d628){this[_0x71fc('0x7')][_0x4912fe][_0x71fc('0xc')]({'target':_0x4ceb94,'condition':_0x42d628});this[_0x71fc('0x8')]+=0x1;};Graph[_0x71fc('0xa')][_0x71fc('0xd')]=function(){return _[_0x71fc('0xd')](this[_0x71fc('0x6')]);};Graph['prototype'][_0x71fc('0xe')]=function(){return this['numberOfEdges'];};Graph[_0x71fc('0xa')][_0x71fc('0xf')]=function(_0x5ac914){return this['vertices'][_0x5ac914];};Graph[_0x71fc('0xa')][_0x71fc('0x10')]=function(_0x30918b,_0x1e7560){if(!this[_0x71fc('0x6')][_0x30918b]){return logger[_0x71fc('0x11')]('no\x20vertex\x20found');}var _0x3c640c=_0x1e7560(this[_0x71fc('0x6')][_0x30918b]);if(!_0x3c640c){return logger[_0x71fc('0x11')](_0x71fc('0x12'));}if(this[_0x71fc('0x7')][_0x30918b][_0x71fc('0x13')]===0x0){return logger[_0x71fc('0x11')](_0x71fc('0x14'));}for(var _0x265173=0x0,_0x2da117=[],_0x5a7a73=![];_0x265173\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','initialize','getLicense','then','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','listening','connection','lodash','util','../../config/logger','agi','./rpc','./project','EventEmitter','127.0.0.1','error','stack','findIndex','deleted','splice','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','calleridname','dnid','uniqueid'];(function(_0x138036,_0x33d0f5){var _0x432a83=function(_0xddb71c){while(--_0xddb71c){_0x138036['push'](_0x138036['shift']());}};_0x432a83(++_0x33d0f5);}(_0xa8fb,0x1d5));var _0xba8f=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xa8fb[_0x3e44fa];return _0x2a0aba;};'use strict';var _=require(_0xba8f('0x0'));var syncho=require('syncho');var util=require(_0xba8f('0x1'));var config=require('../../config/environment');var logger=require(_0xba8f('0x2'))(_0xba8f('0x3'));var utilLicense=require('../../config/license/util');var rpc=require(_0xba8f('0x4'));var Project=require(_0xba8f('0x5'));var AGIEmitter=require('./events')[_0xba8f('0x6')];var projects=[];config[_0xba8f('0x3')]=_['defaults'](config[_0xba8f('0x3')],{'ip':_0xba8f('0x7'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x4edcd6){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4edcd6);agiHandler(_0x4edcd6);}catch(_0x300507){logger[_0xba8f('0x8')](_0x300507[_0xba8f('0x9')]);}});});}function projectUpdateHandler(_0x4648e9){try{var _0x278cb0=_[_0xba8f('0xa')](projects,['id',_0x4648e9['id']]);if(_0x278cb0>-0x1){if(_0x4648e9[_0xba8f('0xb')]===!![]){projects[_0xba8f('0xc')](_0x278cb0,0x1);}else{projects[_0x278cb0]=_0x4648e9;}}else{projects['push'](_0x4648e9);}}catch(_0x4ff134){logger['error'](_0x4ff134[_0xba8f('0x9')]);}}function listeningHandler(){console['log'](_0xba8f('0xd'),config[_0xba8f('0x3')][_0xba8f('0xe')]);logger[_0xba8f('0xf')](util[_0xba8f('0x10')](_0xba8f('0x11'),config['agi']['ip'],config[_0xba8f('0x3')][_0xba8f('0xe')]));}function errorHandler(_0x13dfd0){if(_0x13dfd0&&_0x13dfd0[_0xba8f('0x12')]&&_0x13dfd0['message']){logger['error'](util['format'](_0xba8f('0x13'),_0x13dfd0[_0xba8f('0x12')],_0x13dfd0[_0xba8f('0x14')]));}else{logger['error'](util['format'](_0xba8f('0x15'),_0x13dfd0['stack']));}}function closeHandler(){logger[_0xba8f('0xf')](util[_0xba8f('0x10')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xba8f('0x16')],this[_0xba8f('0x17')],this['callerid'],this[_0xba8f('0x18')],this[_0xba8f('0x19')]));try{createSquareReport(this);}catch(_0x38ddaa){logger[_0xba8f('0x8')](_0x38ddaa[_0xba8f('0x9')]);}}function timeoutHandler(){logger['info'](util[_0xba8f('0x10')](_0xba8f('0x1a'),this['arg_1'],this[_0xba8f('0x17')],this[_0xba8f('0x1b')],this[_0xba8f('0x18')],this[_0xba8f('0x19')]));}function hangupHandler(){logger[_0xba8f('0xf')](util[_0xba8f('0x10')](_0xba8f('0x1c'),this['arg_1'],this[_0xba8f('0x17')],this[_0xba8f('0x1b')],this['dnid'],this[_0xba8f('0x19')]));this[_0xba8f('0x1d')]=!![];}function createSquareReport(_0xe1ec59,_0x2fd6a5){rpc[_0xba8f('0x1e')](_0xe1ec59)['then'](function(_0x4098c3){if(_0x2fd6a5){_0x2fd6a5(null,_0x4098c3);}})[_0xba8f('0x1f')](function(_0x1b981e){if(_0x2fd6a5){_0x2fd6a5(null,_0x1b981e);}});}function setChannelVariables(_0x3ea59f){for(var _0x4dda74 in _0x3ea59f){if(_0x3ea59f[_0xba8f('0x20')](_0x4dda74)){if(_0x4dda74['indexOf'](_0xba8f('0x21'))===0x0){_0x3ea59f[_0x4dda74[_0xba8f('0x22')](0x4)]=_0x3ea59f[_0x4dda74];delete _0x3ea59f[_0x4dda74];}}}}function agiHandler(_0xb7e72){logger[_0xba8f('0x23')]('variables',JSON[_0xba8f('0x24')](_0xb7e72,null,0x2));logger[_0xba8f('0xf')](util['format'](_0xba8f('0x25'),_0xb7e72[_0xba8f('0x16')],_0xb7e72[_0xba8f('0x17')],_0xb7e72[_0xba8f('0x1b')],_0xb7e72['dnid'],_0xb7e72['uniqueid']));_0xb7e72['on']('error',errorHandler);_0xb7e72['on'](_0xba8f('0x26'),closeHandler);_0xb7e72['on'](_0xba8f('0x27'),timeoutHandler);_0xb7e72['evtHangup']=![];_0xb7e72['on'](_0xba8f('0x28'),hangupHandler);var _0x31ff2e=_[_0xba8f('0x29')](projects,['name',_0xb7e72[_0xba8f('0x16')]]);if(!_0x31ff2e)return Project[_0xba8f('0x2a')](_0xb7e72);if(!_0x31ff2e[_0xba8f('0x2b')])return Project['handleUnpublished'](_0xb7e72);return Project[_0xba8f('0x2c')](_0x31ff2e,_0xb7e72);}function main(){var _0x290311;return utilLicense[_0xba8f('0x2d')]()[_0xba8f('0x2e')](function(_0x3225ed){if(!_0x3225ed)return;if(_0x3225ed['voice']){if(_0x3225ed[_0xba8f('0x2f')]&&_0x3225ed[_0xba8f('0x2f')]>0x0){logger[_0xba8f('0xf')](util[_0xba8f('0x10')](_0xba8f('0x30'),_0x3225ed[_0xba8f('0x2f')]));_0x290311=_0x3225ed['callysquare'];}else{logger['info'](_0xba8f('0x31'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x290311=-0x1;}})[_0xba8f('0x2e')](function(){return Project[_0xba8f('0x32')]();})['then'](function(_0x494aaa){projects=_0x494aaa;return;})[_0xba8f('0x1f')](function(_0x331d86){logger[_0xba8f('0x8')](_0xba8f('0x33'),_0x331d86[_0xba8f('0x9')]);})[_0xba8f('0x34')](function(){var _0x67a04d=require('./server')(config['agi'][_0xba8f('0xe')],config[_0xba8f('0x3')]['ip'],_0x290311);_0x67a04d['on'](_0xba8f('0x8'),errorHandler);_0x67a04d['on'](_0xba8f('0x35'),listeningHandler);_0x67a04d['on'](_0xba8f('0x36'),connectionHandler);_0x67a04d['on'](_0xba8f('0x26'),closeHandler);});}main(); \ No newline at end of file +var _0xdf67=['format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','stack','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','connection','lodash','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','EventEmitter','projectUpdate','error','findIndex','deleted','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info'];(function(_0x33c529,_0x15bd67){var _0x1ff5ef=function(_0x5b78b1){while(--_0x5b78b1){_0x33c529['push'](_0x33c529['shift']());}};_0x1ff5ef(++_0x15bd67);}(_0xdf67,0x1b1));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7df6('0x0'));var syncho=require(_0x7df6('0x1'));var util=require(_0x7df6('0x2'));var config=require(_0x7df6('0x3'));var logger=require('../../config/logger')(_0x7df6('0x4'));var utilLicense=require(_0x7df6('0x5'));var rpc=require(_0x7df6('0x6'));var Project=require('./project');var AGIEmitter=require('./events')[_0x7df6('0x7')];var projects=[];config[_0x7df6('0x4')]=_['defaults'](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x7df6('0x8'),projectUpdateHandler);function connectionHandler(_0x1b16bf){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1b16bf);agiHandler(_0x1b16bf);}catch(_0x506284){logger[_0x7df6('0x9')](_0x506284['stack']);}});});}function projectUpdateHandler(_0x2de2d4){try{var _0x4dc401=_[_0x7df6('0xa')](projects,['id',_0x2de2d4['id']]);if(_0x4dc401>-0x1){if(_0x2de2d4[_0x7df6('0xb')]===!![]){projects['splice'](_0x4dc401,0x1);}else{projects[_0x4dc401]=_0x2de2d4;}}else{projects['push'](_0x2de2d4);}}catch(_0x4e2c70){logger[_0x7df6('0x9')](_0x4e2c70['stack']);}}function listeningHandler(){console['log'](_0x7df6('0xc'),config[_0x7df6('0x4')][_0x7df6('0xd')]);logger[_0x7df6('0xe')](util[_0x7df6('0xf')](_0x7df6('0x10'),config['agi']['ip'],config[_0x7df6('0x4')][_0x7df6('0xd')]));}function errorHandler(_0x491497){if(_0x491497&&_0x491497['name']&&_0x491497[_0x7df6('0x11')]){logger['error'](util[_0x7df6('0xf')](_0x7df6('0x12'),_0x491497[_0x7df6('0x13')],_0x491497[_0x7df6('0x11')]));}else{logger[_0x7df6('0x9')](util[_0x7df6('0xf')](_0x7df6('0x14'),_0x491497[_0x7df6('0x15')]));}}function closeHandler(){logger['info'](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x7df6('0x16')],this['callerid'],this[_0x7df6('0x17')],this[_0x7df6('0x18')]));try{createSquareReport(this);}catch(_0x4f7e1c){logger[_0x7df6('0x9')](_0x4f7e1c[_0x7df6('0x15')]);}}function timeoutHandler(){logger[_0x7df6('0xe')](util[_0x7df6('0xf')](_0x7df6('0x19'),this['arg_1'],this['calleridname'],this[_0x7df6('0x1a')],this[_0x7df6('0x17')],this[_0x7df6('0x18')]));}function hangupHandler(){logger[_0x7df6('0xe')](util[_0x7df6('0xf')](_0x7df6('0x1b'),this[_0x7df6('0x1c')],this[_0x7df6('0x16')],this[_0x7df6('0x1a')],this['dnid'],this['uniqueid']));this[_0x7df6('0x1d')]=!![];}function createSquareReport(_0x108a8c,_0x3c4586){rpc[_0x7df6('0x1e')](_0x108a8c)[_0x7df6('0x1f')](function(_0x3364d5){if(_0x3c4586){_0x3c4586(null,_0x3364d5);}})[_0x7df6('0x20')](function(_0x4ee13f){if(_0x3c4586){_0x3c4586(null,_0x4ee13f);}});}function setChannelVariables(_0x4e9a66){for(var _0x538e6c in _0x4e9a66){if(_0x4e9a66[_0x7df6('0x21')](_0x538e6c)){if(_0x538e6c[_0x7df6('0x22')](_0x7df6('0x23'))===0x0){_0x4e9a66[_0x538e6c[_0x7df6('0x24')](0x4)]=_0x4e9a66[_0x538e6c];delete _0x4e9a66[_0x538e6c];}}}}function agiHandler(_0x4954d3){logger[_0x7df6('0x25')](_0x7df6('0x26'),JSON[_0x7df6('0x27')](_0x4954d3,null,0x2));logger[_0x7df6('0xe')](util[_0x7df6('0xf')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4954d3[_0x7df6('0x1c')],_0x4954d3[_0x7df6('0x16')],_0x4954d3[_0x7df6('0x1a')],_0x4954d3[_0x7df6('0x17')],_0x4954d3[_0x7df6('0x18')]));_0x4954d3['on']('error',errorHandler);_0x4954d3['on'](_0x7df6('0x28'),closeHandler);_0x4954d3['on']('timeout',timeoutHandler);_0x4954d3[_0x7df6('0x1d')]=![];_0x4954d3['on'](_0x7df6('0x29'),hangupHandler);var _0x3402bc=_[_0x7df6('0x2a')](projects,[_0x7df6('0x13'),_0x4954d3[_0x7df6('0x1c')]]);if(!_0x3402bc)return Project[_0x7df6('0x2b')](_0x4954d3);if(!_0x3402bc['production'])return Project[_0x7df6('0x2c')](_0x4954d3);return Project[_0x7df6('0x2d')](_0x3402bc,_0x4954d3);}function main(){var _0x544bc2;return utilLicense[_0x7df6('0x2e')]()[_0x7df6('0x1f')](function(_0x2b407a){if(!_0x2b407a)return;if(_0x2b407a[_0x7df6('0x2f')]){if(_0x2b407a[_0x7df6('0x30')]&&_0x2b407a[_0x7df6('0x30')]>0x0){logger[_0x7df6('0xe')](util[_0x7df6('0xf')](_0x7df6('0x31'),_0x2b407a[_0x7df6('0x30')]));_0x544bc2=_0x2b407a[_0x7df6('0x30')];}else{logger['info'](_0x7df6('0x32'));}}else{logger['info'](_0x7df6('0x33'));_0x544bc2=-0x1;}})[_0x7df6('0x1f')](function(){return Project['getAll']();})['then'](function(_0x154ffc){projects=_0x154ffc;return;})[_0x7df6('0x20')](function(_0x16a78b){logger[_0x7df6('0x9')](_0x7df6('0x34'),_0x16a78b[_0x7df6('0x15')]);})[_0x7df6('0x35')](function(){var _0x578aef=require(_0x7df6('0x36'))(config[_0x7df6('0x4')][_0x7df6('0xd')],config[_0x7df6('0x4')]['ip'],_0x544bc2);_0x578aef['on'](_0x7df6('0x9'),errorHandler);_0x578aef['on']('listening',listeningHandler);_0x578aef['on'](_0x7df6('0x37'),connectionHandler);_0x578aef['on'](_0x7df6('0x28'),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 8b98112..41dd7cf 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 _0xa9e8=['result','catch','SendMail','bluebird','jayson/promise','http','then','error','message'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0xa9e8,0x111));var _0x8a9e=function(_0x44922b,_0x1cc2a9){_0x44922b=_0x44922b-0x0;var _0x244e49=_0xa9e8[_0x44922b];return _0x244e49;};'use strict';var BPromise=require(_0x8a9e('0x0'));var jayson=require(_0x8a9e('0x1'));var client=jayson['client'][_0x8a9e('0x2')]({'port':0x232b});function request(_0x44103a,_0x5cda39){return new BPromise(function(_0x543c36,_0x29c3d4){return client['request'](_0x44103a,_0x5cda39)[_0x8a9e('0x3')](function(_0x52de97){if(_0x52de97[_0x8a9e('0x4')]){return _0x29c3d4(_0x52de97[_0x8a9e('0x4')][_0x8a9e('0x5')]);}else{return _0x543c36(_0x52de97[_0x8a9e('0x6')]);}})[_0x8a9e('0x7')](function(_0x476088){return _0x29c3d4(_0x476088);});});}exports['sendMailMessage']=function(_0x13cf79,_0x429972){return request(_0x8a9e('0x8'),{'account':_0x13cf79,'message':_0x429972});}; \ No newline at end of file +var _0x8193=['request','then','error','message','result','catch','SendMail','bluebird','jayson/promise','http'];(function(_0x8bfc96,_0x239475){var _0x2001b3=function(_0x2aef9d){while(--_0x2aef9d){_0x8bfc96['push'](_0x8bfc96['shift']());}};_0x2001b3(++_0x239475);}(_0x8193,0x115));var _0x3819=function(_0x11611e,_0x595b41){_0x11611e=_0x11611e-0x0;var _0x1a3024=_0x8193[_0x11611e];return _0x1a3024;};'use strict';var BPromise=require(_0x3819('0x0'));var jayson=require(_0x3819('0x1'));var client=jayson['client'][_0x3819('0x2')]({'port':0x232b});function request(_0x107420,_0x241ef1){return new BPromise(function(_0x394381,_0x59a7c6){return client[_0x3819('0x3')](_0x107420,_0x241ef1)[_0x3819('0x4')](function(_0x1bb928){if(_0x1bb928[_0x3819('0x5')]){return _0x59a7c6(_0x1bb928[_0x3819('0x5')][_0x3819('0x6')]);}else{return _0x394381(_0x1bb928[_0x3819('0x7')]);}})[_0x3819('0x8')](function(_0x1c1310){return _0x59a7c6(_0x1c1310);});});}exports['sendMailMessage']=function(_0x2cf074,_0x3bc7ce){return request(_0x3819('0x9'),{'account':_0x2cf074,'message':_0x3bc7ce});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 9fb9b15..fe59938 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 _0xb8a7=['uniqueid','traverseBFS','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','error','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','agi','./mailRpc','./vertices','getSquareProjects','stack','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','addEdge','mxGraphModel','root','inspect','start','debug','stringify','format','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'];(function(_0x21d66c,_0x5d69c3){var _0x4f0eba=function(_0x472730){while(--_0x472730){_0x21d66c['push'](_0x21d66c['shift']());}};_0x4f0eba(++_0x5d69c3);}(_0xb8a7,0x1da));var _0x7b8a=function(_0x2776fd,_0x229ab3){_0x2776fd=_0x2776fd-0x0;var _0x14189a=_0xb8a7[_0x2776fd];return _0x14189a;};'use strict';var _=require(_0x7b8a('0x0'));var moment=require('moment');var parser=require(_0x7b8a('0x1'));var util=require(_0x7b8a('0x2'));var logger=require('../../config/logger')(_0x7b8a('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x7b8a('0x4'));var Graph=require('./graph');var Vertices=require(_0x7b8a('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x7b8a('0x6')]()['catch'](function(_0x44950f){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x44950f[_0x7b8a('0x7')]);return[];});}function addVertex(_0x104727,_0x357817,_0x4c663d){_0x357817['agicommand']=_0x4c663d;if(_0x357817['hasOwnProperty'](_0x7b8a('0x8'))){_0x357817[_0x7b8a('0x9')]=parseInt(_0x357817[_0x7b8a('0x8')],0xa);}_0x104727[_0x7b8a('0xa')](_[_0x7b8a('0xb')](_0x357817,_0x7b8a('0xc')));}function initGraph(_0x401962,_0x671752){var _0x13edc8=new Graph();for(var _0x421886 in _0x401962){if(_0x401962['hasOwnProperty'](_0x421886)){if(_[_0x7b8a('0xd')](_0x401962[_0x421886])){for(var _0x41ff42=0x0;_0x41ff42<_0x401962[_0x421886][_0x7b8a('0xe')];_0x41ff42+=0x1){addVertex(_0x13edc8,_0x401962[_0x421886][_0x41ff42],_0x421886);}}else{addVertex(_0x13edc8,_0x401962[_0x421886],_0x421886);}}}for(var _0x2354c1=0x0;_0x2354c1<_0x671752[_0x7b8a('0xe')];_0x2354c1+=0x1){if(_0x671752[_0x2354c1][_0x7b8a('0xf')]&&_0x671752[_0x2354c1]['target']){_0x13edc8[_0x7b8a('0x10')](_0x671752[_0x2354c1][_0x7b8a('0xf')],_0x671752[_0x2354c1]['target'],_0x671752[_0x2354c1]['value']);}}return _0x13edc8;}function getRoot(_0x3aae5d){return parser['toJson'](_0x3aae5d,{'object':!![]})[_0x7b8a('0x11')][_0x7b8a('0x12')];}function inspect(_0x118ba5){return util[_0x7b8a('0x13')](_0x118ba5,{'showHidden':![],'depth':null});}function initialize(_0x2abf29,_0x1b49f5){var _0x3b42bf=getRoot(_0x2abf29['production']);if(!_0x3b42bf||!_0x3b42bf[_0x7b8a('0x14')])return;var _0x180ac2,_0x28bf16,_0x387f14;logger[_0x7b8a('0x15')](_0x7b8a('0x12'),JSON[_0x7b8a('0x16')](_0x3b42bf,null,0x2));_0x1b49f5['joinAt']=moment()[_0x7b8a('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x180ac2=initGraph(_[_0x7b8a('0xb')](_0x3b42bf,'mxCell'),_0x3b42bf['mxCell']);_0x28bf16=new Vertices(_0x1b49f5,rpc,mailRpc);logger[_0x7b8a('0x18')](util[_0x7b8a('0x17')](_0x7b8a('0x19'),_0x1b49f5[_0x7b8a('0x1a')],_0x1b49f5[_0x7b8a('0x1b')],_0x1b49f5[_0x7b8a('0x1c')],_0x1b49f5[_0x7b8a('0x1d')],_0x1b49f5[_0x7b8a('0x1e')]));_0x180ac2[_0x7b8a('0x1f')](_0x3b42bf[_0x7b8a('0x14')]['id'],function(_0x3f7f88){try{_0x3f7f88=_0x28bf16[_0x7b8a('0x20')](_0x3f7f88);logger[_0x7b8a('0x15')]('vertex',JSON[_0x7b8a('0x16')](_0x3f7f88,null,0x2));if(_0x3f7f88[_0x7b8a('0x21')]===_0x7b8a('0x22')){logger['info'](_0x7b8a('0x23'));_0x1b49f5[_0x7b8a('0x24')]=_0x3f7f88[_0x7b8a('0x24')]||_0x1b49f5[_0x7b8a('0x24')];_0x1b49f5['extension']=_0x3f7f88[_0x7b8a('0x25')];_0x1b49f5[_0x7b8a('0x26')]=_0x3f7f88['priority']?_0x3f7f88[_0x7b8a('0x26')]-0x1:0x1;return null;}else if(_0x3f7f88&&_0x28bf16[_0x3f7f88[_0x7b8a('0x21')]]){_0x387f14=_0x28bf16[_0x3f7f88['agicommand']](_0x3f7f88);logger['info'](_0x7b8a('0x27'),JSON[_0x7b8a('0x16')](_0x387f14,null,0x2));if(_0x387f14&&_0x387f14[_0x7b8a('0x28')]===AGI_CODE_SUCCESS&&_0x387f14[_0x7b8a('0x29')]!==AGI_RESULT_ERROR&&!_0x1b49f5[_0x7b8a('0x2a')]){logger[_0x7b8a('0x15')](_0x7b8a('0x27'),inspect(_0x387f14));return _[_0x7b8a('0x2b')](_0x387f14[_0x7b8a('0x29')])?null:_0x387f14['result'][_0x7b8a('0x2c')]();}else{logger[_0x7b8a('0x2d')]('response',inspect(_0x387f14));return null;}}else{logger[_0x7b8a('0x2d')](_0x7b8a('0x2e'));return null;}}catch(_0x2c982f){logger[_0x7b8a('0x2d')](_0x2c982f[_0x7b8a('0x7')]);return null;}});if(_0x3b42bf['finally']){logger[_0x7b8a('0x18')](util[_0x7b8a('0x17')](_0x7b8a('0x2f'),_0x1b49f5[_0x7b8a('0x1a')],_0x1b49f5[_0x7b8a('0x1b')],_0x1b49f5[_0x7b8a('0x1c')],_0x1b49f5['dnid'],_0x1b49f5[_0x7b8a('0x1e')]));_0x180ac2[_0x7b8a('0x1f')](_0x3b42bf[_0x7b8a('0x30')]['id'],function(_0x43cab8){try{_0x43cab8=_0x28bf16['clear'](_0x43cab8);logger[_0x7b8a('0x15')](_0x7b8a('0x31'),JSON[_0x7b8a('0x16')](_0x43cab8,null,0x2));if(_0x43cab8&&_0x28bf16[_0x43cab8[_0x7b8a('0x21')]]){_0x387f14=_0x28bf16[_0x43cab8[_0x7b8a('0x21')]](_0x43cab8);if(_0x387f14){logger['debug'](_0x7b8a('0x27'),inspect(_0x387f14));return _[_0x7b8a('0x2b')](_0x387f14[_0x7b8a('0x29')])?null:_0x387f14[_0x7b8a('0x29')][_0x7b8a('0x2c')]();}else{logger[_0x7b8a('0x2d')](_0x7b8a('0x27'),inspect(_0x387f14));return null;}}else{logger[_0x7b8a('0x2d')]('agicommand\x20not\x20found');return null;}}catch(_0x3f5ad3){logger[_0x7b8a('0x2d')](_0x3f5ad3[_0x7b8a('0x7')]);return null;}});}logger[_0x7b8a('0x18')](util[_0x7b8a('0x17')](_0x7b8a('0x32'),_0x1b49f5['arg_1'],_0x1b49f5[_0x7b8a('0x1b')],_0x1b49f5[_0x7b8a('0x1c')],_0x1b49f5[_0x7b8a('0x1d')],_0x1b49f5[_0x7b8a('0x1e')]));logger[_0x7b8a('0x18')](util[_0x7b8a('0x17')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1b49f5['context'],_0x1b49f5[_0x7b8a('0x25')],parseInt(_0x1b49f5['priority'],0xa)+0x1));_0x1b49f5[_0x7b8a('0x33')](_0x1b49f5[_0x7b8a('0x24')],_0x1b49f5[_0x7b8a('0x25')],parseInt(_0x1b49f5['priority'],0xa)+0x1);_0x1b49f5[_0x7b8a('0x34')]();}function handleNotFound(_0x12c2b0){logger[_0x7b8a('0x2d')](util[_0x7b8a('0x17')](_0x7b8a('0x35'),_0x12c2b0[_0x7b8a('0x1a')]));_0x12c2b0[_0x7b8a('0x33')](_0x12c2b0[_0x7b8a('0x24')],_0x12c2b0[_0x7b8a('0x25')],parseInt(_0x12c2b0['priority'],0xa)+0x1);_0x12c2b0[_0x7b8a('0x34')]();}function handleUnpublished(_0x3694c0){logger['error'](util[_0x7b8a('0x17')](_0x7b8a('0x36'),_0x3694c0['arg_1']));_0x3694c0['continueAt'](_0x3694c0[_0x7b8a('0x24')],_0x3694c0[_0x7b8a('0x25')],parseInt(_0x3694c0[_0x7b8a('0x26')],0xa)+0x1);_0x3694c0[_0x7b8a('0x34')]();}module[_0x7b8a('0x37')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xa241=['uniqueid','traverseBFS','clear','vertex','stringify','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','dnid','finally','[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','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./mailRpc','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','source','target','value','toJson','mxGraphModel','debug','root','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid'];(function(_0x455a49,_0x441ef7){var _0x2c1e7a=function(_0x3e4d77){while(--_0x3e4d77){_0x455a49['push'](_0x455a49['shift']());}};_0x2c1e7a(++_0x441ef7);}(_0xa241,0x1af));var _0x1a24=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa241[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1a24('0x0'));var moment=require(_0x1a24('0x1'));var parser=require(_0x1a24('0x2'));var util=require(_0x1a24('0x3'));var logger=require(_0x1a24('0x4'))(_0x1a24('0x5'));var rpc=require('./rpc');var mailRpc=require(_0x1a24('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x1a24('0x7')](function(_0x46f659){logger[_0x1a24('0x8')](_0x1a24('0x9'),_0x46f659[_0x1a24('0xa')]);return[];});}function addVertex(_0x45b0bd,_0x345ae5,_0x26469a){_0x345ae5[_0x1a24('0xb')]=_0x26469a;if(_0x345ae5[_0x1a24('0xc')](_0x1a24('0xd'))){_0x345ae5[_0x1a24('0xe')]=parseInt(_0x345ae5[_0x1a24('0xd')],0xa);}_0x45b0bd[_0x1a24('0xf')](_[_0x1a24('0x10')](_0x345ae5,_0x1a24('0x11')));}function initGraph(_0x538d21,_0x105ad9){var _0x1bbc7c=new Graph();for(var _0x2bf4d9 in _0x538d21){if(_0x538d21[_0x1a24('0xc')](_0x2bf4d9)){if(_['isArray'](_0x538d21[_0x2bf4d9])){for(var _0x5f430b=0x0;_0x5f430b<_0x538d21[_0x2bf4d9]['length'];_0x5f430b+=0x1){addVertex(_0x1bbc7c,_0x538d21[_0x2bf4d9][_0x5f430b],_0x2bf4d9);}}else{addVertex(_0x1bbc7c,_0x538d21[_0x2bf4d9],_0x2bf4d9);}}}for(var _0x52b179=0x0;_0x52b179<_0x105ad9['length'];_0x52b179+=0x1){if(_0x105ad9[_0x52b179][_0x1a24('0x12')]&&_0x105ad9[_0x52b179][_0x1a24('0x13')]){_0x1bbc7c['addEdge'](_0x105ad9[_0x52b179][_0x1a24('0x12')],_0x105ad9[_0x52b179]['target'],_0x105ad9[_0x52b179][_0x1a24('0x14')]);}}return _0x1bbc7c;}function getRoot(_0x33008f){return parser[_0x1a24('0x15')](_0x33008f,{'object':!![]})[_0x1a24('0x16')]['root'];}function inspect(_0x1d38bd){return util['inspect'](_0x1d38bd,{'showHidden':![],'depth':null});}function initialize(_0x3ef0c8,_0x285f94){var _0x4379cd=getRoot(_0x3ef0c8['production']);if(!_0x4379cd||!_0x4379cd['start'])return;var _0x195c2f,_0x38bc8d,_0x37f702;logger[_0x1a24('0x17')](_0x1a24('0x18'),JSON['stringify'](_0x4379cd,null,0x2));_0x285f94[_0x1a24('0x19')]=moment()[_0x1a24('0x1a')](_0x1a24('0x1b'));_0x195c2f=initGraph(_[_0x1a24('0x10')](_0x4379cd,'mxCell'),_0x4379cd[_0x1a24('0x11')]);_0x38bc8d=new Vertices(_0x285f94,rpc,mailRpc);logger[_0x1a24('0x1c')](util[_0x1a24('0x1a')](_0x1a24('0x1d'),_0x285f94[_0x1a24('0x1e')],_0x285f94[_0x1a24('0x1f')],_0x285f94[_0x1a24('0x20')],_0x285f94['dnid'],_0x285f94[_0x1a24('0x21')]));_0x195c2f[_0x1a24('0x22')](_0x4379cd['start']['id'],function(_0x37c057){try{_0x37c057=_0x38bc8d[_0x1a24('0x23')](_0x37c057);logger[_0x1a24('0x17')](_0x1a24('0x24'),JSON[_0x1a24('0x25')](_0x37c057,null,0x2));if(_0x37c057[_0x1a24('0xb')]==='gotoc'){logger[_0x1a24('0x1c')](_0x1a24('0x26'));_0x285f94['context']=_0x37c057[_0x1a24('0x27')]||_0x285f94[_0x1a24('0x27')];_0x285f94[_0x1a24('0x28')]=_0x37c057[_0x1a24('0x28')];_0x285f94[_0x1a24('0x29')]=_0x37c057[_0x1a24('0x29')]?_0x37c057[_0x1a24('0x29')]-0x1:0x1;return null;}else if(_0x37c057&&_0x38bc8d[_0x37c057['agicommand']]){_0x37f702=_0x38bc8d[_0x37c057[_0x1a24('0xb')]](_0x37c057);logger[_0x1a24('0x1c')](_0x1a24('0x2a'),JSON[_0x1a24('0x25')](_0x37f702,null,0x2));if(_0x37f702&&_0x37f702[_0x1a24('0x2b')]===AGI_CODE_SUCCESS&&_0x37f702[_0x1a24('0x2c')]!==AGI_RESULT_ERROR&&!_0x285f94[_0x1a24('0x2d')]){logger[_0x1a24('0x17')](_0x1a24('0x2a'),inspect(_0x37f702));return _[_0x1a24('0x2e')](_0x37f702['result'])?null:_0x37f702[_0x1a24('0x2c')][_0x1a24('0x2f')]();}else{logger[_0x1a24('0x8')](_0x1a24('0x2a'),inspect(_0x37f702));return null;}}else{logger[_0x1a24('0x8')](_0x1a24('0x30'));return null;}}catch(_0x3abb25){logger['error'](_0x3abb25[_0x1a24('0xa')]);return null;}});if(_0x4379cd['finally']){logger['info'](util[_0x1a24('0x1a')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x285f94[_0x1a24('0x1e')],_0x285f94[_0x1a24('0x1f')],_0x285f94[_0x1a24('0x20')],_0x285f94[_0x1a24('0x31')],_0x285f94[_0x1a24('0x21')]));_0x195c2f[_0x1a24('0x22')](_0x4379cd[_0x1a24('0x32')]['id'],function(_0x3cb489){try{_0x3cb489=_0x38bc8d[_0x1a24('0x23')](_0x3cb489);logger[_0x1a24('0x17')]('vertex',JSON['stringify'](_0x3cb489,null,0x2));if(_0x3cb489&&_0x38bc8d[_0x3cb489['agicommand']]){_0x37f702=_0x38bc8d[_0x3cb489['agicommand']](_0x3cb489);if(_0x37f702){logger['debug']('response',inspect(_0x37f702));return _['isUndefined'](_0x37f702['result'])?null:_0x37f702[_0x1a24('0x2c')]['toString']();}else{logger[_0x1a24('0x8')](_0x1a24('0x2a'),inspect(_0x37f702));return null;}}else{logger[_0x1a24('0x8')](_0x1a24('0x30'));return null;}}catch(_0x3b19e6){logger[_0x1a24('0x8')](_0x3b19e6[_0x1a24('0xa')]);return null;}});}logger['info'](util[_0x1a24('0x1a')](_0x1a24('0x33'),_0x285f94[_0x1a24('0x1e')],_0x285f94[_0x1a24('0x1f')],_0x285f94[_0x1a24('0x20')],_0x285f94['dnid'],_0x285f94['uniqueid']));logger[_0x1a24('0x1c')](util[_0x1a24('0x1a')](_0x1a24('0x34'),_0x285f94[_0x1a24('0x27')],_0x285f94['extension'],parseInt(_0x285f94[_0x1a24('0x29')],0xa)+0x1));_0x285f94['continueAt'](_0x285f94['context'],_0x285f94['extension'],parseInt(_0x285f94[_0x1a24('0x29')],0xa)+0x1);_0x285f94[_0x1a24('0x35')]();}function handleNotFound(_0x267a00){logger[_0x1a24('0x8')](util[_0x1a24('0x1a')](_0x1a24('0x36'),_0x267a00[_0x1a24('0x1e')]));_0x267a00[_0x1a24('0x37')](_0x267a00[_0x1a24('0x27')],_0x267a00[_0x1a24('0x28')],parseInt(_0x267a00[_0x1a24('0x29')],0xa)+0x1);_0x267a00['close']();}function handleUnpublished(_0x5bbdfd){logger[_0x1a24('0x8')](util[_0x1a24('0x1a')](_0x1a24('0x38'),_0x5bbdfd[_0x1a24('0x1e')]));_0x5bbdfd['continueAt'](_0x5bbdfd[_0x1a24('0x27')],_0x5bbdfd['extension'],parseInt(_0x5bbdfd[_0x1a24('0x29')],0xa)+0x1);_0x5bbdfd['close']();}module[_0x1a24('0x39')]={'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 70af9d8..2d3d146 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 _0x422f=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_inBody','indexOf','substring','length','split','slice','trim','emit','line','util','Transform','call','_localBuffer'];(function(_0x4d7fe4,_0x219869){var _0x265025=function(_0x1f2e5f){while(--_0x1f2e5f){_0x4d7fe4['push'](_0x4d7fe4['shift']());}};_0x265025(++_0x219869);}(_0x422f,0xd9));var _0xf422=function(_0x1b72c7,_0x2dac06){_0x1b72c7=_0x1b72c7-0x0;var _0x1c1f20=_0x422f[_0x1b72c7];return _0x1c1f20;};'use strict';var util=require(_0xf422('0x0'));var Transform=require('stream')[_0xf422('0x1')];function AGIReply(_0x77eab){Transform[_0xf422('0x2')](this,_0x77eab);this[_0xf422('0x3')]='';this['_inBody']=![];}util[_0xf422('0x4')](AGIReply,Transform);AGIReply[_0xf422('0x5')][_0xf422('0x6')]=function(_0x457b77,_0x4a98d6,_0x3e1912){var _0xf773d7='\x0a',_0x3df250=['\x0a\x0a',_0xf422('0x7')],_0x3b667b=-0x1,_0x44e391=-0x1,_0x3f6f26='',_0x4b88de=0x0,_0x416bae='',_0x11b036='';this[_0xf422('0x3')]+=_0x457b77['toString']();_0x416bae=this[_0xf422('0x3')];if(!this[_0xf422('0x8')]){_0x4b88de=0x0;while(_0x3df250[_0x4b88de]){while((_0x44e391=_0x416bae[_0xf422('0x9')](_0x3df250[_0x4b88de]))!=-0x1){_0x3f6f26=_0x3df250[_0x4b88de];_0x11b036=_0x416bae[_0xf422('0xa')](0x0,_0x44e391);_0x416bae=_0x416bae[_0xf422('0xa')](_0x44e391+_0x3f6f26[_0xf422('0xb')]);var _0x205f11=_0x11b036[_0xf422('0xc')](_0xf773d7),_0x297962=0x0,_0x1bbd79={},_0x25e76b='',_0x13a632='',_0x58fb19=-0x1;while(_0x205f11[_0x297962]){_0x58fb19=_0x205f11[_0x297962][_0xf422('0x9')](':');if(_0x58fb19!=-0x1){_0x25e76b=_0x205f11[_0x297962][_0xf422('0xd')](0x0,_0x58fb19)[_0xf422('0xe')]();_0x13a632=_0x205f11[_0x297962][_0xf422('0xd')](_0x58fb19+0x1)[_0xf422('0xe')]();if(_0x25e76b[_0xf422('0xb')]>0x0){_0x1bbd79[_0x25e76b]=_0x13a632;}}else{}_0x297962++;}this[_0xf422('0xf')]('headers',_0x1bbd79);this[_0xf422('0x8')]=!![];}_0x4b88de++;}this[_0xf422('0x3')]=_0x416bae;}else{while((_0x3b667b=_0x416bae[_0xf422('0x9')](_0xf773d7))!=-0x1){_0x11b036=_0x416bae[_0xf422('0xa')](0x0,_0x3b667b);this[_0xf422('0xf')](_0xf422('0x10'),_0x11b036);_0x416bae=_0x416bae[_0xf422('0xa')](_0x3b667b+_0xf773d7[_0xf422('0xb')]);}this[_0xf422('0x3')]=_0x416bae;}_0x3e1912();};module['exports']=AGIReply; \ No newline at end of file +var _0x17bd=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','split','slice','trim','length','emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x17bd,0xfb));var _0xd17b=function(_0xfdb9e0,_0x3ce65a){_0xfdb9e0=_0xfdb9e0-0x0;var _0x38a65e=_0x17bd[_0xfdb9e0];return _0x38a65e;};'use strict';var util=require(_0xd17b('0x0'));var Transform=require(_0xd17b('0x1'))[_0xd17b('0x2')];function AGIReply(_0x5ef066){Transform[_0xd17b('0x3')](this,_0x5ef066);this[_0xd17b('0x4')]='';this[_0xd17b('0x5')]=![];}util[_0xd17b('0x6')](AGIReply,Transform);AGIReply[_0xd17b('0x7')][_0xd17b('0x8')]=function(_0x10895b,_0x4d11f6,_0x125454){var _0x219a19='\x0a',_0x347c89=['\x0a\x0a',_0xd17b('0x9')],_0x1c7ef1=-0x1,_0x24594c=-0x1,_0x4a28ce='',_0x17e791=0x0,_0x511852='',_0x31e4e5='';this[_0xd17b('0x4')]+=_0x10895b[_0xd17b('0xa')]();_0x511852=this['_localBuffer'];if(!this[_0xd17b('0x5')]){_0x17e791=0x0;while(_0x347c89[_0x17e791]){while((_0x24594c=_0x511852[_0xd17b('0xb')](_0x347c89[_0x17e791]))!=-0x1){_0x4a28ce=_0x347c89[_0x17e791];_0x31e4e5=_0x511852[_0xd17b('0xc')](0x0,_0x24594c);_0x511852=_0x511852[_0xd17b('0xc')](_0x24594c+_0x4a28ce['length']);var _0x17fd00=_0x31e4e5[_0xd17b('0xd')](_0x219a19),_0x4d4dfa=0x0,_0x467904={},_0x2362ac='',_0x2258e3='',_0x482264=-0x1;while(_0x17fd00[_0x4d4dfa]){_0x482264=_0x17fd00[_0x4d4dfa][_0xd17b('0xb')](':');if(_0x482264!=-0x1){_0x2362ac=_0x17fd00[_0x4d4dfa][_0xd17b('0xe')](0x0,_0x482264)[_0xd17b('0xf')]();_0x2258e3=_0x17fd00[_0x4d4dfa][_0xd17b('0xe')](_0x482264+0x1)['trim']();if(_0x2362ac[_0xd17b('0x10')]>0x0){_0x467904[_0x2362ac]=_0x2258e3;}}else{}_0x4d4dfa++;}this[_0xd17b('0x11')](_0xd17b('0x12'),_0x467904);this[_0xd17b('0x5')]=!![];}_0x17e791++;}this['_localBuffer']=_0x511852;}else{while((_0x1c7ef1=_0x511852['indexOf'](_0x219a19))!=-0x1){_0x31e4e5=_0x511852['substring'](0x0,_0x1c7ef1);this[_0xd17b('0x11')]('line',_0x31e4e5);_0x511852=_0x511852[_0xd17b('0xc')](_0x1c7ef1+_0x219a19[_0xd17b('0x10')]);}this['_localBuffer']=_0x511852;}_0x125454();};module[_0xd17b('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9bacbf8..fe45277 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 _0x3613=['createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','LoginUser','agentUnpause','agentLogout','lodash','moment','jayson/promise','client','http','then','error','message','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSquareDetailsReport'];(function(_0xd89fde,_0x4d2417){var _0xe67f58=function(_0x4b21f9){while(--_0x4b21f9){_0xd89fde['push'](_0xd89fde['shift']());}};_0xe67f58(++_0x4d2417);}(_0x3613,0x198));var _0x3361=function(_0x39e36a,_0xbfb0cf){_0x39e36a=_0x39e36a-0x0;var _0x18dcff=_0x3613[_0x39e36a];return _0x18dcff;};'use strict';var _=require(_0x3361('0x0'));var moment=require(_0x3361('0x1'));var jayson=require(_0x3361('0x2'));var client=jayson[_0x3361('0x3')][_0x3361('0x4')]({'port':0x2329});function request(_0x3ccef0,_0x259413){return new Promise(function(_0x56bafb,_0xe6f993){return client['request'](_0x3ccef0,_0x259413)[_0x3361('0x5')](function(_0x3221e2){if(_0x3221e2[_0x3361('0x6')]){return _0xe6f993(_0x3221e2[_0x3361('0x6')][_0x3361('0x7')]);}else{return _0x56bafb(_0x3221e2['result']);}})[_0x3361('0x8')](function(_0x501219){return _0xe6f993(_0x501219);});});}exports[_0x3361('0x9')]=function(){return request(_0x3361('0xa'),{'options':{'raw':![],'attributes':['id',_0x3361('0xb'),_0x3361('0xc')]}});};exports[_0x3361('0xd')]=function(_0x4955c0){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4955c0},'attributes':['production']}});};exports['getMailAccountById']=function(_0x574498){return request(_0x3361('0xe'),{'options':{'raw':![],'where':{'id':_0x574498},'include':[{'model':_0x3361('0xf'),'as':_0x3361('0x10'),'include':[{'model':_0x3361('0x11'),'as':_0x3361('0x11')}]}],'attributes':['id','name',_0x3361('0x12')],'smtp':!![]}});};exports[_0x3361('0x13')]=function(_0x208693){return request('ShowSquareProject',{'options':{'where':{'id':_0x208693},'attributes':[_0x3361('0xb')]}});};exports[_0x3361('0x14')]=function(_0x4669ee){return request(_0x3361('0x15'),{'options':{'where':{'id':_0x4669ee},'attributes':[_0x3361('0xb')]}});};exports[_0x3361('0x16')]=function(_0x53f08c){return request(_0x3361('0x17'),{'options':{'where':{'id':_0x53f08c},'attributes':[_0x3361('0xb')]}});};exports[_0x3361('0x18')]=function(_0x12e969){return request(_0x3361('0x19'),{'options':{'where':{'id':_0x12e969},'attributes':[_0x3361('0x1a')]}});};exports[_0x3361('0x1b')]=function(_0x2bd93f){return request(_0x3361('0x1c'),{'options':{'where':{'id':_0x2bd93f},'attributes':[_0x3361('0xb')]}});};exports[_0x3361('0x1d')]=function(_0x26ab60){return request(_0x3361('0x1e'),{'options':{'where':{'phone':_0x26ab60[_0x3361('0x1f')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x516262){return request(_0x3361('0x20'),{'options':{'where':{'id':_0x516262},'attributes':[_0x3361('0xb')]}});};exports[_0x3361('0x21')]=function(_0x414955){return request('ShowSound',{'options':{'where':{'id':_0x414955},'attributes':[_0x3361('0x22')]}});};exports['getIntervalById']=function(_0x1044f3){return request(_0x3361('0x23'),{'options':{'raw':![],'where':{'id':_0x1044f3},'include':[{'model':_0x3361('0x24'),'as':'Intervals'}]}});};exports[_0x3361('0x25')]=function(_0x455842){return request('ShowSmsAccount',{'options':{'where':{'id':_0x455842},'attributes':['id','name']}});};exports[_0x3361('0x26')]=function(_0x49ed84){return request('CreateSmsMessage',{'body':_0x49ed84});};exports['createSquareDetailsReport']=function(_0x223313){return request(_0x3361('0x27'),{'body':_0x223313});};exports[_0x3361('0x28')]=function(_0x3baf20){return request(_0x3361('0x29'),{'body':_[_0x3361('0x2a')](_0x3baf20,{'project_name':_0x3baf20[_0x3361('0x2b')],'prev_project_name':_0x3baf20[_0x3361('0x2c')]||'','is_subproject':_0x3baf20[_0x3361('0x2c')]?!![]:![],'leaveAt':moment()[_0x3361('0x2d')](_0x3361('0x2e'))})});};exports['createSquareRecording']=function(_0x5383b4){return request('CreateSquareRecording',{'body':_0x5383b4});};exports[_0x3361('0x2f')]=function(_0x2e11d3){return request(_0x3361('0x30'),{'body':_0x2e11d3});};exports[_0x3361('0x31')]=function(_0x3a3525){return request(_0x3361('0x32'),{'options':{'raw':![],'where':{'phone':_0x3a3525[_0x3361('0x1f')],'ListId':_0x3a3525[_0x3361('0x33')]}}})[_0x3361('0x5')](function(_0xe4b546){if(_0xe4b546){return _0xe4b546;}return request(_0x3361('0x34'),{'body':_0x3a3525});});};exports['getPauseById']=function(_0x51b82){return request('ShowPause',{'options':{'where':{'id':_0x51b82},'attributes':[_0x3361('0xb')]}});};exports['agentLogin']=function(_0x572450,_0x12c588){return request(_0x3361('0x35'),{'body':{'interface':_0x12c588},'options':{'where':_0x572450}});};exports['agentPause']=function(_0x40f9f6,_0x25a047,_0x36f34e){return request('PauseUser',{'body':{'type':_0x25a047,'uniqueid':_0x36f34e},'options':{'where':_0x40f9f6}});};exports[_0x3361('0x36')]=function(_0xa2e73f){return request('UnpauseUser',{'body':{},'options':{'where':_0xa2e73f}});};exports[_0x3361('0x37')]=function(_0x530a39){return request('LogoutUser',{'body':{},'options':{'where':_0x530a39}});}; \ No newline at end of file +var _0x3667=['Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','phone','getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createCmContact','CreateCmContact','getPauseById','agentLogin','PauseUser','UnpauseUser','agentLogout','lodash','moment','jayson/promise','client','http','request','then','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut'];(function(_0x1238e0,_0x16bd9b){var _0x59dfc8=function(_0x3cd547){while(--_0x3cd547){_0x1238e0['push'](_0x1238e0['shift']());}};_0x59dfc8(++_0x16bd9b);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var moment=require(_0x7366('0x1'));var jayson=require(_0x7366('0x2'));var client=jayson[_0x7366('0x3')][_0x7366('0x4')]({'port':0x2329});function request(_0x5d1072,_0x27a90d){return new Promise(function(_0x1cfcc9,_0x4b32a7){return client[_0x7366('0x5')](_0x5d1072,_0x27a90d)[_0x7366('0x6')](function(_0x1a35f8){if(_0x1a35f8[_0x7366('0x7')]){return _0x4b32a7(_0x1a35f8[_0x7366('0x7')]['message']);}else{return _0x1cfcc9(_0x1a35f8[_0x7366('0x8')]);}})[_0x7366('0x9')](function(_0x2dd32b){return _0x4b32a7(_0x2dd32b);});});}exports[_0x7366('0xa')]=function(){return request(_0x7366('0xb'),{'options':{'raw':![],'attributes':['id',_0x7366('0xc'),_0x7366('0xd')]}});};exports[_0x7366('0xe')]=function(_0x18aee5){return request(_0x7366('0xf'),{'options':{'raw':![],'where':{'name':_0x18aee5},'attributes':[_0x7366('0xd')]}});};exports[_0x7366('0x10')]=function(_0x57ea7f){return request(_0x7366('0x11'),{'options':{'raw':![],'where':{'id':_0x57ea7f},'include':[{'model':_0x7366('0x12'),'as':_0x7366('0x13'),'include':[{'model':_0x7366('0x14'),'as':_0x7366('0x14')}]}],'attributes':['id',_0x7366('0xc'),_0x7366('0x15')],'smtp':!![]}});};exports[_0x7366('0x16')]=function(_0x37e47e){return request(_0x7366('0xf'),{'options':{'where':{'id':_0x37e47e},'attributes':[_0x7366('0xc')]}});};exports[_0x7366('0x17')]=function(_0x27500c){return request(_0x7366('0x18'),{'options':{'where':{'id':_0x27500c},'attributes':[_0x7366('0xc')]}});};exports['getVariableById']=function(_0x23e763){return request(_0x7366('0x19'),{'options':{'where':{'id':_0x23e763},'attributes':[_0x7366('0xc')]}});};exports[_0x7366('0x1a')]=function(_0xe2c87b){return request(_0x7366('0x1b'),{'options':{'where':{'id':_0xe2c87b},'attributes':[_0x7366('0x1c')]}});};exports[_0x7366('0x1d')]=function(_0x83e5d5){return request(_0x7366('0x1e'),{'options':{'where':{'id':_0x83e5d5},'attributes':[_0x7366('0xc')]}});};exports['getContactByPhone']=function(_0x208ac8){return request('GetContactByPhone',{'options':{'where':{'phone':_0x208ac8[_0x7366('0x1f')]},'attributes':['id']}});};exports[_0x7366('0x20')]=function(_0x3f23cd){return request('ShowTrunk',{'options':{'where':{'id':_0x3f23cd},'attributes':[_0x7366('0xc')]}});};exports[_0x7366('0x21')]=function(_0x3cfde9){return request('ShowSound',{'options':{'where':{'id':_0x3cfde9},'attributes':[_0x7366('0x22')]}});};exports[_0x7366('0x23')]=function(_0x482946){return request(_0x7366('0x24'),{'options':{'raw':![],'where':{'id':_0x482946},'include':[{'model':_0x7366('0x25'),'as':_0x7366('0x26')}]}});};exports[_0x7366('0x27')]=function(_0x3c30a2){return request(_0x7366('0x28'),{'options':{'where':{'id':_0x3c30a2},'attributes':['id',_0x7366('0xc')]}});};exports[_0x7366('0x29')]=function(_0x2095a1){return request(_0x7366('0x2a'),{'body':_0x2095a1});};exports[_0x7366('0x2b')]=function(_0x1dc875){return request(_0x7366('0x2c'),{'body':_0x1dc875});};exports['createSquareReport']=function(_0xb63a21){return request('CreateSquareReport',{'body':_[_0x7366('0x2d')](_0xb63a21,{'project_name':_0xb63a21['arg_1'],'prev_project_name':_0xb63a21['arg_2']||'','is_subproject':_0xb63a21[_0x7366('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0x7366('0x2f'))})});};exports['createSquareRecording']=function(_0x256633){return request(_0x7366('0x30'),{'body':_0x256633});};exports['createSquareMessage']=function(_0x6d196a){return request('CreateSquareMessage',{'body':_0x6d196a});};exports[_0x7366('0x31')]=function(_0x2b61af){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x2b61af[_0x7366('0x1f')],'ListId':_0x2b61af['ListId']}}})[_0x7366('0x6')](function(_0x46f80f){if(_0x46f80f){return _0x46f80f;}return request(_0x7366('0x32'),{'body':_0x2b61af});});};exports[_0x7366('0x33')]=function(_0x2dda4b){return request('ShowPause',{'options':{'where':{'id':_0x2dda4b},'attributes':[_0x7366('0xc')]}});};exports[_0x7366('0x34')]=function(_0x538d42,_0x4a0863){return request('LoginUser',{'body':{'interface':_0x4a0863},'options':{'where':_0x538d42}});};exports['agentPause']=function(_0x2a1d46,_0x43d487,_0x163a29){return request(_0x7366('0x35'),{'body':{'type':_0x43d487,'uniqueid':_0x163a29},'options':{'where':_0x2a1d46}});};exports['agentUnpause']=function(_0x3ca5e6){return request(_0x7366('0x36'),{'body':{},'options':{'where':_0x3ca5e6}});};exports[_0x7366('0x37')]=function(_0x21547f){return request('LogoutUser',{'body':{},'options':{'where':_0x21547f}});}; \ 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 82baee2..c560f9b 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 _0x1c23=['exports','./polly','./lex'];(function(_0x10783e,_0x11ac71){var _0x59c114=function(_0x2c689d){while(--_0x2c689d){_0x10783e['push'](_0x10783e['shift']());}};_0x59c114(++_0x11ac71);}(_0x1c23,0x1d5));var _0x31c2=function(_0x4c3008,_0x9cf103){_0x4c3008=_0x4c3008-0x0;var _0x1c21e5=_0x1c23[_0x4c3008];return _0x1c21e5;};var polly=require(_0x31c2('0x0'));var lex=require(_0x31c2('0x1'));module[_0x31c2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9bb8=['exports','./polly','./lex'];(function(_0xb19de0,_0x28572e){var _0x4d39ec=function(_0x15114d){while(--_0x15114d){_0xb19de0['push'](_0xb19de0['shift']());}};_0x4d39ec(++_0x28572e);}(_0x9bb8,0x1ae));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};var polly=require(_0x89bb('0x0'));var lex=require(_0x89bb('0x1'));module[_0x89bb('0x2')]={'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 1de88a7..3edee99 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 _0x6324=['./lib/api','exports'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x6324,0x142));var _0x4632=function(_0x13fe35,_0x537cee){_0x13fe35=_0x13fe35-0x0;var _0x4875a8=_0x6324[_0x13fe35];return _0x4875a8;};'use strict';var lex=require(_0x4632('0x0'));module[_0x4632('0x1')]=function(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40){return lex(_0xb0927d,_0x2fc528,_0x551054,_0x1805c5,_0x48e508,_0x3bea40);}; \ No newline at end of file +var _0x6e6c=['exports','./lib/api'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);}; \ 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 f971375..7555bc9 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(_0x4ac6a8,_0xffc36e){var _0x298874=function(_0x27d30c){while(--_0x27d30c){_0x4ac6a8['push'](_0x4ac6a8['shift']());}};_0x298874(++_0xffc36e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x282132,_0x54cbdb){var _0x3d464e=function(_0x24ac42){while(--_0x24ac42){_0x282132['push'](_0x282132['shift']());}};_0x3d464e(++_0x54cbdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 7a6b6bf..c5a1dbf 100644 --- a/server/services/agi/scripts/aws/polly/index.js +++ b/server/services/agi/scripts/aws/polly/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0969=['exports'];(function(_0x17d613,_0x335c58){var _0xae9fbb=function(_0x4aa394){while(--_0x4aa394){_0x17d613['push'](_0x17d613['shift']());}};_0xae9fbb(++_0x335c58);}(_0x0969,0xe4));var _0x9096=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0969[_0x4fc9e6];return _0x551d28;};'use strict';var polly=require('./lib/api');module[_0x9096('0x0')]=function(_0x210b98,_0x5dfea8,_0x2bd8d7,_0x4c3171,_0x5a7e3e,_0x2c3f8d,_0x3b8c06){return polly(_0x210b98,_0x5dfea8,_0x2bd8d7,_0x4c3171,_0x5a7e3e,_0x2c3f8d,_0x3b8c06);}; \ No newline at end of file +var _0xd52b=['exports'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xd52b,0xa7));var _0xbd52=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd52b[_0x501510];return _0x1e6ee5;};'use strict';var polly=require('./lib/api');module[_0xbd52('0x0')]=function(_0x2e1fcb,_0x38cda5,_0x47eda8,_0x50e45a,_0x40141d,_0x5d88cd,_0x1a065e){return polly(_0x2e1fcb,_0x38cda5,_0x47eda8,_0x50e45a,_0x40141d,_0x5d88cd,_0x1a065e);}; \ 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 1277a52..a89b425 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 _0x28d0=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','path','randomstring','aws-sdk','AudioStream','writeFile'];(function(_0x23cf27,_0x53ee14){var _0x5cae52=function(_0x2454a0){while(--_0x2454a0){_0x23cf27['push'](_0x23cf27['shift']());}};_0x5cae52(++_0x53ee14);}(_0x28d0,0x1ea));var _0x028d=function(_0x5034b3,_0x20a25a){_0x5034b3=_0x5034b3-0x0;var _0x2aec85=_0x28d0[_0x5034b3];return _0x2aec85;};'use strict';var fs=require('fs');var path=require(_0x028d('0x0'));var BPromise=require('bluebird');var rs=require(_0x028d('0x1'));var AWS=require(_0x028d('0x2'));function pollyResult(_0x473d81,_0x18e77b,_0x2045d7){return new BPromise(function(_0x2daea9,_0x2b78f9){_0x473d81['synthesizeSpeech'](_0x18e77b,function(_0x5a0c3f,_0x3a140c){if(_0x5a0c3f){_0x2b78f9(_0x5a0c3f);}else if(_0x3a140c){if(_0x3a140c[_0x028d('0x3')]instanceof Buffer){fs[_0x028d('0x4')](_0x2045d7,_0x3a140c[_0x028d('0x3')],function(_0x24823b){if(_0x24823b){_0x2b78f9(_0x24823b);}else{_0x2daea9();}});}else{_0x2b78f9(new Error(_0x028d('0x5')));}}else{_0x2b78f9(new Error(_0x028d('0x6')));}});});}module['exports']=function(_0x458d42,_0x582cde,_0x4df61a,_0x12c77c,_0xbbfd27,_0x4b5954,_0xcc2bf4){var _0x29909a=new AWS[(_0x028d('0x7'))]({'accessKeyId':_0x458d42,'secretAccessKey':_0x582cde,'region':_0x4df61a});var _0x253cea={'Text':_0xbbfd27,'TextType':_0x4b5954||_0x028d('0x8'),'OutputFormat':'mp3','VoiceId':_0x12c77c};return pollyResult(_0x29909a,_0x253cea,_0xcc2bf4);}; \ No newline at end of file +var _0x4823=['exports','Polly','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4823,0xa8));var _0x3482=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x4823[_0x2a5099];return _0x2802f1;};'use strict';var fs=require('fs');var path=require(_0x3482('0x0'));var BPromise=require(_0x3482('0x1'));var rs=require(_0x3482('0x2'));var AWS=require(_0x3482('0x3'));function pollyResult(_0x56232b,_0x44626b,_0x58fbc3){return new BPromise(function(_0x4862a0,_0x117eeb){_0x56232b[_0x3482('0x4')](_0x44626b,function(_0xeb09dc,_0xbae4ae){if(_0xeb09dc){_0x117eeb(_0xeb09dc);}else if(_0xbae4ae){if(_0xbae4ae[_0x3482('0x5')]instanceof Buffer){fs[_0x3482('0x6')](_0x58fbc3,_0xbae4ae['AudioStream'],function(_0x2365dd){if(_0x2365dd){_0x117eeb(_0x2365dd);}else{_0x4862a0();}});}else{_0x117eeb(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x117eeb(new Error(_0x3482('0x7')));}});});}module[_0x3482('0x8')]=function(_0x13409b,_0x36ee5f,_0x33aedc,_0x28896e,_0x114dcb,_0x5f2440,_0x9d8fac){var _0x137c01=new AWS[(_0x3482('0x9'))]({'accessKeyId':_0x13409b,'secretAccessKey':_0x36ee5f,'region':_0x33aedc});var _0xadf727={'Text':_0x114dcb,'TextType':_0x5f2440||'text','OutputFormat':_0x3482('0xa'),'VoiceId':_0x28896e};return pollyResult(_0x137c01,_0xadf727,_0x9d8fac);}; \ 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 66297e4..5b11b80 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 _0x9dd3=['./lib/api','exports'];(function(_0x9c3c46,_0xe82aac){var _0x239f30=function(_0x472082){while(--_0x472082){_0x9c3c46['push'](_0x9c3c46['shift']());}};_0x239f30(++_0xe82aac);}(_0x9dd3,0xe0));var _0x39dd=function(_0x134b99,_0x242666){_0x134b99=_0x134b99-0x0;var _0x524e1b=_0x9dd3[_0x134b99];return _0x524e1b;};'use strict';var asr=require(_0x39dd('0x0'));module[_0x39dd('0x1')]=function(_0x2f0448,_0x45e941,_0x46407e,_0x351a87){return asr(_0x2f0448,_0x45e941,_0x46407e);}; \ No newline at end of file +var _0xc955=['./lib/api'];(function(_0x5f2c2c,_0x1c2005){var _0x4a2da6=function(_0x21121e){while(--_0x21121e){_0x5f2c2c['push'](_0x5f2c2c['shift']());}};_0x4a2da6(++_0x1c2005);}(_0xc955,0x1eb));var _0x5c95=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xc955[_0x53cf8e];return _0x459197;};'use strict';var asr=require(_0x5c95('0x0'));module['exports']=function(_0x322388,_0x2d6212,_0x1e2dcc,_0x5a0bdb){return asr(_0x322388,_0x2d6212,_0x1e2dcc);}; \ 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 0b09908..ab655b8 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 _0xb4e6=['length','filepath\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','https://speech.googleapis.com','exports','string'];(function(_0x24398c,_0x3dc9ec){var _0x113a9f=function(_0x149e29){while(--_0x149e29){_0x24398c['push'](_0x24398c['shift']());}};_0x113a9f(++_0x3dc9ec);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xb4e6[_0x21205e];return _0x136ebb;};'use strict';var url=require(_0x6b4e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6b4e('0x1');module[_0x6b4e('0x2')]=function(_0x365912,_0x25ffcb,_0x44e781){return new BPromise(function(_0x31e8ad,_0x1929b8){var _0x52313b;if(typeof _0x365912!==_0x6b4e('0x3')||_0x365912[_0x6b4e('0x4')]===0x0){return _0x1929b8(_0x6b4e('0x5'));}if(typeof _0x25ffcb!=='string'||_0x25ffcb[_0x6b4e('0x4')]===0x0){return _0x1929b8('key\x20should\x20be\x20a\x20string');}if(typeof _0x44e781!=='undefined'&&(typeof _0x44e781!==_0x6b4e('0x3')||_0x44e781['length']===0x0)){return _0x1929b8('lang\x20should\x20be\x20a\x20string');}try{_0x52313b=fs[_0x6b4e('0x6')](_0x365912)[_0x6b4e('0x7')](_0x6b4e('0x8'));}catch(_0x39ed74){return _0x1929b8(_0x39ed74);}return _0x31e8ad({'method':_0x6b4e('0x9'),'uri':host+_0x6b4e('0xa')+_0x25ffcb,'body':{'config':{'encoding':_0x6b4e('0xb'),'sampleRateHertz':'8000','languageCode':_0x44e781},'audio':{'content':_0x52313b}},'json':!![]});});}; \ No newline at end of file +var _0x4157=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x5d7e9b,_0xa47817){var _0x409583=function(_0x27af69){while(--_0x27af69){_0x5d7e9b['push'](_0x5d7e9b['shift']());}};_0x409583(++_0xa47817);}(_0x4157,0xf3));var _0x7415=function(_0x58e06b,_0x29849e){_0x58e06b=_0x58e06b-0x0;var _0x5e89be=_0x4157[_0x58e06b];return _0x5e89be;};'use strict';var url=require(_0x7415('0x0'));var BPromise=require(_0x7415('0x1'));var fs=require('fs');var host=_0x7415('0x2');module[_0x7415('0x3')]=function(_0x4509ca,_0x4c49e7,_0x3efb60){return new BPromise(function(_0x3bef76,_0x311038){var _0x341b12;if(typeof _0x4509ca!==_0x7415('0x4')||_0x4509ca[_0x7415('0x5')]===0x0){return _0x311038(_0x7415('0x6'));}if(typeof _0x4c49e7!==_0x7415('0x4')||_0x4c49e7[_0x7415('0x5')]===0x0){return _0x311038('key\x20should\x20be\x20a\x20string');}if(typeof _0x3efb60!==_0x7415('0x7')&&(typeof _0x3efb60!=='string'||_0x3efb60[_0x7415('0x5')]===0x0)){return _0x311038('lang\x20should\x20be\x20a\x20string');}try{_0x341b12=fs[_0x7415('0x8')](_0x4509ca)[_0x7415('0x9')](_0x7415('0xa'));}catch(_0xb023fa){return _0x311038(_0xb023fa);}return _0x3bef76({'method':_0x7415('0xb'),'uri':host+_0x7415('0xc')+_0x4c49e7,'body':{'config':{'encoding':_0x7415('0xd'),'sampleRateHertz':'8000','languageCode':_0x3efb60},'audio':{'content':_0x341b12}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 10cb4be..3427ac4 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x9a25=['./asr','exports'];(function(_0x501093,_0x52d61e){var _0x10556c=function(_0x284cba){while(--_0x284cba){_0x501093['push'](_0x501093['shift']());}};_0x10556c(++_0x52d61e);}(_0x9a25,0x1e8));var _0x59a2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9a25[_0x501510];return _0x1e6ee5;};var asr=require(_0x59a2('0x0'));module[_0x59a2('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 cf69b7d..44260f4 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 _0xf764=['AudioFromTts','Data','dirName','bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','get','data','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','voice','audioConfig','text:synthesize','POST','generate','writeFile','tmp','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','CustomAction','channelData','CustomActionData'];(function(_0x5c90ee,_0x5d77d7){var _0x249ffb=function(_0xa5dea2){while(--_0xa5dea2){_0x5c90ee['push'](_0x5c90ee['shift']());}};_0x249ffb(++_0x5d77d7);}(_0xf764,0x10d));var _0x4f76=function(_0x81425d,_0x404e62){_0x81425d=_0x81425d-0x0;var _0x404dc1=_0xf764[_0x81425d];return _0x404dc1;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x4f76('0x0'));var dialogflow=require(_0x4f76('0x1'));var fs=require('fs');var http=require(_0x4f76('0x2'));var https=require('https');var md5=require(_0x4f76('0x3'));var path=require(_0x4f76('0x4'));var querystring=require(_0x4f76('0x5'));var rp=require(_0x4f76('0x6'));var rs=require(_0x4f76('0x7'));var sox=require('sox');var tts=require(_0x4f76('0x8'));var urlParse=require(_0x4f76('0x9'))[_0x4f76('0xa')];var util=require(_0x4f76('0xb'));var aws=require(_0x4f76('0xc'));var google=require('./google');var sestek=require(_0x4f76('0xd'));var tilde=require(_0x4f76('0xe'));var logger=require(_0x4f76('0xf'))(_0x4f76('0x10'));var ISPEECH_API=_0x4f76('0x11');function downloadFile(_0x29f6f8,_0x10df6d){return new BPromise(function(_0x4d54b1,_0x25c4d5){var _0x241936=urlParse(_0x29f6f8);var _0x29cd6f=_0x241936[_0x4f76('0x12')]===_0x4f76('0x13')?https:http;var _0xe97b90={'host':_0x241936[_0x4f76('0x14')],'path':_0x241936[_0x4f76('0x4')],'headers':{'user-agent':_0x4f76('0x15')}};_0x29cd6f['get'](_0xe97b90,function(_0x46a8bf){if(_0x46a8bf[_0x4f76('0x16')]!==0xc8){logger[_0x4f76('0x17')](_0x4f76('0x18')+_0x29f6f8+_0x4f76('0x19')+_0x46a8bf[_0x4f76('0x16')]+'\x20('+_0x46a8bf[_0x4f76('0x1a')]+')');_0x25c4d5(new Error(_0x4f76('0x18')+_0x29f6f8+_0x4f76('0x19')+_0x46a8bf[_0x4f76('0x16')]+'\x20('+_0x46a8bf[_0x4f76('0x1a')]+')'));return;}var _0x11b4ce=fs['createWriteStream'](_0x10df6d);_0x11b4ce['on'](_0x4f76('0x1b'),function(){logger[_0x4f76('0x1c')](_0x4f76('0x1d'));_0x11b4ce[_0x4f76('0x1e')](_0x4d54b1);});_0x11b4ce['on'](_0x4f76('0x17'),function(_0x576249){fs[_0x4f76('0x1f')](_0x10df6d);logger[_0x4f76('0x17')](_0x4f76('0x20'),_0x576249);_0x25c4d5(_0x576249);});_0x46a8bf[_0x4f76('0x21')](_0x11b4ce);})['on'](_0x4f76('0x17'),function(_0x20bae5){logger['error'](_0x20bae5);_0x25c4d5(_0x20bae5);})[_0x4f76('0x22')]();});}function uploadFile(_0x4d2d2a){return new BPromise(function(_0x418812,_0x35c30c){var _0x392142=urlParse(_0x4d2d2a);var _0x28abe1=_0x392142[_0x4f76('0x12')]===_0x4f76('0x13')?https:http;var _0x1a6879={'host':_0x392142[_0x4f76('0x14')],'path':_0x392142[_0x4f76('0x4')],'headers':{'user-agent':_0x4f76('0x15')}};_0x28abe1[_0x4f76('0x23')](_0x1a6879,function(_0x3287d3){if(_0x3287d3[_0x4f76('0x16')]!==0xc8){_0x35c30c(new Error('request\x20to\x20'+_0x4d2d2a+_0x4f76('0x19')+_0x3287d3['statusCode']+'\x20('+_0x3287d3[_0x4f76('0x1a')]+')'));return;}var _0x4aac3a='';_0x3287d3['on'](_0x4f76('0x24'),function(_0x14b5e8){_0x4aac3a+=_0x14b5e8;});_0x3287d3['on'](_0x4f76('0x22'),function(){_0x418812(_0x4aac3a);});})['on'](_0x4f76('0x17'),function(_0x13229d){_0x35c30c(_0x13229d);})[_0x4f76('0x22')]();});}function convertFile(_0x4ef10c,_0x376c41){return new BPromise(function(_0x30dda2,_0x4c38e7){var _0x598ce5=sox['transcode'](_0x4ef10c,_0x376c41,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x598ce5['on'](_0x4f76('0x17'),function(_0x444e30){logger[_0x4f76('0x17')](_0x4f76('0x25'),_0x444e30);_0x4c38e7(_0x444e30);});_0x598ce5['on']('end',function(){logger[_0x4f76('0x1c')](_0x4f76('0x26'));_0x30dda2();});_0x598ce5[_0x4f76('0x27')]();});}function base64Decode(_0x45b0f4,_0xfa0b2d){var _0x15bd3a=path[_0x4f76('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0x4f76('0x29'));fs[_0x4f76('0x2a')](_0x15bd3a,_0x45b0f4,_0x4f76('0x2b'));return convertFile(_0x15bd3a,_0xfa0b2d)[_0x4f76('0x2c')](function(){try{fs[_0x4f76('0x1f')](_0x15bd3a);fs[_0x4f76('0x2d')](_0xfa0b2d,_0x4f76('0x2e'));}catch(_0x3fba19){logger[_0x4f76('0x17')](_0x3fba19);}return _0xfa0b2d[_0x4f76('0x2f')]('.')[0x0];});}function base64Encode(_0xada0eb){var _0x1bd211=fs[_0x4f76('0x30')](_0xada0eb);return new Buffer(_0x1bd211)[_0x4f76('0x31')]('base64');}exports[_0x4f76('0x32')]=function(_0x49c64e,_0x1505eb,_0x500221,_0x20f69b,_0x5b00ab,_0x16197a){var _0x559ea2,_0x533ded;var _0x2f78ea='https://texttospeech.googleapis.com/v1/';var _0x45e0f3=_0x4f76('0x33')+_0x49c64e;var _0x40678b={};if(_0x1505eb==='ssml'){_0x40678b['input']={'ssml':_0x500221};}else{_0x40678b[_0x4f76('0x34')]={'text':_0x500221};};_0x40678b[_0x4f76('0x35')]={'languageCode':_0x20f69b,'ssmlGender':_0x5b00ab};_0x40678b[_0x4f76('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x214a74={'url':_0x2f78ea+_0x4f76('0x37')+_0x45e0f3,'method':_0x4f76('0x38'),'json':!![],'body':_0x40678b};return rp(_0x214a74)[_0x4f76('0x2c')](function(_0x339523){return new BPromise(function(_0x4e7abe,_0x28b110){_0x559ea2=path['resolve'](__dirname,'tmp',rs[_0x4f76('0x39')](0x4)+'.mp3');var _0x34592d=Buffer['from'](_0x339523['audioContent'],'base64');return fs[_0x4f76('0x3a')](_0x559ea2,_0x34592d,function(_0x4c5d96){_0x28b110(_0x4c5d96);},function(_0x523368){fs[_0x4f76('0x2d')](_0x559ea2,'777');_0x4e7abe(_0x523368);});});})[_0x4f76('0x2c')](function(_0x2f2c18){_0x533ded=path['resolve'](__dirname,_0x4f76('0x3b'),rs[_0x4f76('0x39')](0x4)+_0x4f76('0x29'));return convertFile(_0x559ea2,_0x533ded);})[_0x4f76('0x2c')](function(){try{fs[_0x4f76('0x1f')](_0x559ea2);fs[_0x4f76('0x2d')](_0x533ded,'777');}catch(_0x899988){logger[_0x4f76('0x17')](_0x899988);}logger[_0x4f76('0x1c')]('googleCloudTTS\x20path',_0x533ded[_0x4f76('0x2f')]('.')[0x0]);return _0x533ded[_0x4f76('0x2f')]('.')[0x0];});};exports[_0x4f76('0x3c')]=function(_0x41a733,_0x4ce9c8){var _0x5a58c9=_0x4f76('0x3d');var _0x597933,_0x3d0a3a;var _0x3b9a2;var _0xbada56={'encoding':_0x4f76('0x3e'),'method':'POST','timeout':0x2710,'url':_0x5a58c9,'headers':{'Content-Type':_0x4f76('0x3f')},'body':'f.req='+encodeURIComponent(JSON[_0x4f76('0x40')]([[['jQ1olc',JSON['stringify']([_0x41a733,_0x4ce9c8||'en',![],_0x4f76('0x41')]),null,'generic']]]))};return rp(_0xbada56)['then'](function(_0x13fc82){try{_0x3b9a2=eval(_0x13fc82['slice'](0x5))[0x0][0x2];}catch(_0x45dce3){throw new Error(_0x4f76('0x42')+_0x13fc82[_0x4f76('0x24')]);}if(!_0x3b9a2){if(_0x41a733['length']>0xc8){throw new Error(_0x4f76('0x43'));}else{throw new Error(_0x4f76('0x44')+_0x4ce9c8+'\x22\x20might\x20not\x20exist');}}try{_0x3b9a2=eval(_0x3b9a2)[0x0];}catch(_0x20ca24){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x4f76('0x24')]);}const _0x1bae8=_0x3b9a2;_0x597933=path[_0x4f76('0x28')](__dirname,'tmp',rs[_0x4f76('0x39')](0x4)+_0x4f76('0x45'));fs[_0x4f76('0x2a')](_0x597933,_0x3b9a2,{'encoding':'base64'});_0x3d0a3a=path[_0x4f76('0x28')](__dirname,_0x4f76('0x3b'),rs[_0x4f76('0x39')](0x4)+'.wav');return convertFile(_0x597933,_0x3d0a3a);})['then'](function(){try{fs['unlink'](_0x597933);fs[_0x4f76('0x2d')](_0x3d0a3a,_0x4f76('0x2e'));}catch(_0x152ae7){logger['error'](_0x152ae7);}logger[_0x4f76('0x1c')](_0x4f76('0x46'),_0x3d0a3a[_0x4f76('0x2f')]('.')[0x0]);return _0x3d0a3a[_0x4f76('0x2f')]('.')[0x0];});};exports[_0x4f76('0x47')]=function(_0x47dca7,_0x405efb,_0x34f76c){return google[_0x4f76('0x48')](_0x47dca7,_0x405efb,_0x34f76c)[_0x4f76('0x2c')](function(_0x280cb0){logger[_0x4f76('0x1c')](_0x280cb0[_0x4f76('0x49')]);return rp(_0x280cb0);})[_0x4f76('0x2c')](function(_0xafe53c){var _0x4ca234='';var _0x18afd3=0x0;try{fs['unlink'](_0x47dca7);}catch(_0x4ee652){logger[_0x4f76('0x17')](_0x4ee652);}if(_0xafe53c&&_0xafe53c[_0x4f76('0x4a')]){_0x4ca234=_0xafe53c[_0x4f76('0x4a')][_0x4f76('0x4b')](function(_0x5593f6){return _0x5593f6&&_0x5593f6[_0x4f76('0x4c')][0x0]&&_0x5593f6[_0x4f76('0x4c')][0x0]['transcript']?_0x5593f6[_0x4f76('0x4c')][0x0][_0x4f76('0x4d')]:'';})[_0x4f76('0x4e')]('\x0a');_0x18afd3=_0xafe53c[_0x4f76('0x4a')][_0x4f76('0x4b')](function(_0x4d47a3){return _0x4d47a3&&_0x4d47a3['alternatives'][0x0]&&_0x4d47a3[_0x4f76('0x4c')][0x0][_0x4f76('0x4f')]?_0x4d47a3[_0x4f76('0x4c')][0x0][_0x4f76('0x4f')]:0x0;})['join']('\x0a');}logger[_0x4f76('0x1c')](_0x4f76('0x50'),_0x4ca234);logger[_0x4f76('0x1c')](_0x4f76('0x51'),_0x18afd3);return{'transcript':_0x4ca234,'confidence':_0x18afd3};})[_0x4f76('0x52')](function(_0x33c32d){logger[_0x4f76('0x17')]('[%s]\x20%s:%s',_0x33c32d[_0x4f76('0x16')],_0x33c32d[_0x4f76('0x53')],_0x33c32d[_0x4f76('0x54')]);});};exports['googleDialogflow']=function(_0x9cbbee,_0x436a8b,_0x2e25bf,_0x956b93){var _0x2690f8=apiai(_0x436a8b,{'language':_0x956b93||'en'});return _0x2690f8['textRequest'](_0x2e25bf,{'sessionId':md5(_0x9cbbee)})['then'](function(_0x10a916){logger[_0x4f76('0x1c')](JSON[_0x4f76('0x40')](_0x10a916));return{'source':_0x10a916[_0x4f76('0x55')][_0x4f76('0x56')],'resolvedQuery':_0x10a916[_0x4f76('0x55')][_0x4f76('0x57')],'action':_0x10a916[_0x4f76('0x55')][_0x4f76('0x58')],'actionIncomplete':_0x10a916[_0x4f76('0x55')][_0x4f76('0x59')],'speech':_0x10a916['result'][_0x4f76('0x5a')][_0x4f76('0x5b')],'score':_0x10a916['result'][_0x4f76('0x5c')],'statusCode':_0x10a916[_0x4f76('0x5d')][_0x4f76('0x5e')],'endConversation':_0x10a916[_0x4f76('0x55')][_0x4f76('0x5f')][_0x4f76('0x60')]||![],'isFallbackIntent':_0x10a916[_0x4f76('0x55')]['metadata'][_0x4f76('0x61')]};});};exports[_0x4f76('0x62')]=function(_0x35040b,_0x52cf3d,_0x49bf8e,_0x2e8d7a,_0x15eb89,_0x112ad8){var _0x5871c6=_0x2e8d7a[_0x4f76('0x63')](/\\n/g,'\x0a');var _0x129e06={'credentials':{'private_key':_0x5871c6,'client_email':_0x49bf8e}};var _0x27390f=new dialogflow[(_0x4f76('0x64'))](_0x129e06);var _0x463fb0=_0x27390f[_0x4f76('0x65')](_0x52cf3d,md5(_0x35040b));var _0x4f17ac={'session':_0x463fb0,'queryInput':{'text':{'text':_0x15eb89,'languageCode':_0x112ad8}}};return _0x27390f[_0x4f76('0x66')](_0x4f17ac)[_0x4f76('0x2c')](function(_0x49d07f){if(_0x49d07f&&_0x49d07f['length']){logger[_0x4f76('0x1c')](_0x4f76('0x67'),JSON[_0x4f76('0x40')](_0x49d07f));var _0x30017a=_0x49d07f[0x0];if(_0x30017a){var _0x35c54b={'action':_0x30017a[_0x4f76('0x68')][_0x4f76('0x58')],'allRequiredParamsPresent':_0x30017a[_0x4f76('0x68')]['allRequiredParamsPresent'],'endConversation':_0x30017a[_0x4f76('0x68')][_0x4f76('0x69')]&&_0x30017a[_0x4f76('0x68')][_0x4f76('0x69')][_0x4f76('0x6a')]?_0x30017a['queryResult'][_0x4f76('0x69')][_0x4f76('0x6a')][_0x4f76('0x6b')][_0x4f76('0x6c')]:![],'fulfillmentText':_0x30017a[_0x4f76('0x68')][_0x4f76('0x6d')],'intentName':_0x30017a[_0x4f76('0x68')][_0x4f76('0x6e')][_0x4f76('0x53')],'intentDisplayName':_0x30017a['queryResult'][_0x4f76('0x6e')][_0x4f76('0x6f')],'isFallbackIntent':_0x30017a['queryResult'][_0x4f76('0x6e')][_0x4f76('0x70')],'languageCode':_0x30017a[_0x4f76('0x68')][_0x4f76('0x71')],'queryText':_0x30017a[_0x4f76('0x68')][_0x4f76('0x72')],'responseId':_0x30017a[_0x4f76('0x73')],'score':_0x30017a['queryResult']['intentDetectionConfidence'],'speech':_0x30017a['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x4f76('0x40')](_0x49d07f)};return _0x35c54b;}}});};exports['tildeASR']=function(_0x13f29e,_0x2db3fb,_0x4ed28f,_0x51e95b){return tilde['asr'](_0x13f29e,_0x2db3fb,_0x4ed28f,_0x51e95b)[_0x4f76('0x2c')](function(_0x2a3450){try{fs[_0x4f76('0x1f')](_0x13f29e);}catch(_0x49e84a){logger[_0x4f76('0x17')](_0x49e84a);}logger[_0x4f76('0x1c')]('Tilde\x20ASR\x20transcription',_0x2a3450[_0x4f76('0x4d')]);logger[_0x4f76('0x1c')](_0x4f76('0x74'),_0x2a3450[_0x4f76('0x4f')]);return _0x2a3450;});};exports[_0x4f76('0x75')]=function(_0x331daf,_0xa109b1,_0x5a9c4c,_0x57af0f,_0x3522b,_0x46182e){var _0x2ab927=path[_0x4f76('0x28')](__dirname,_0x4f76('0x3b'),rs['generate'](0x4)+_0x4f76('0x45'));var _0x192251;return aws[_0x4f76('0x76')](_0x331daf,_0xa109b1,_0x5a9c4c,_0x57af0f,_0x3522b,_0x46182e,_0x2ab927)[_0x4f76('0x2c')](function(){_0x192251=path[_0x4f76('0x28')](__dirname,'tmp',rs[_0x4f76('0x39')](0x4)+_0x4f76('0x29'));return convertFile(_0x2ab927,_0x192251);})[_0x4f76('0x2c')](function(){try{fs[_0x4f76('0x1f')](_0x2ab927);fs[_0x4f76('0x2d')](_0x192251,'777');}catch(_0x32e7da){logger[_0x4f76('0x17')](_0x32e7da);}return _0x192251[_0x4f76('0x2f')]('.')[0x0];});};exports['awsLex']=function(_0x2df97b,_0xd35878,_0x54a91a,_0x5178ad,_0xb29439,_0x1b9889){return aws[_0x4f76('0x77')](_0x2df97b,_0xd35878,_0x54a91a,_0x5178ad,_0xb29439,_0x1b9889)['then'](function(_0x2dac43){logger[_0x4f76('0x1c')](JSON[_0x4f76('0x40')](_0x2dac43));return _0x2dac43;});};exports['ispeechTTS']=function(_0x229a94,_0x597a00,_0x3fad45,_0x5e7c0b){var _0x29f4be=util['format'](_0x4f76('0x78'),ISPEECH_API,_0x229a94,encodeURIComponent(_0x597a00),_0x3fad45,_0x5e7c0b);var _0x54b5be=path[_0x4f76('0x28')](__dirname,_0x4f76('0x3b'),rs[_0x4f76('0x39')](0x4)+_0x4f76('0x45'));var _0x528394;return downloadFile(_0x29f4be,_0x54b5be)['then'](function(){_0x528394=path[_0x4f76('0x28')](__dirname,_0x4f76('0x3b'),rs[_0x4f76('0x39')](0x4)+_0x4f76('0x29'));return convertFile(_0x54b5be,_0x528394);})[_0x4f76('0x2c')](function(){try{fs['unlink'](_0x54b5be);fs[_0x4f76('0x2d')](_0x528394,_0x4f76('0x2e'));}catch(_0x56bc6e){logger[_0x4f76('0x17')](_0x56bc6e);}return _0x528394['split']('.')[0x0];});};exports['ispeechASR']=function(_0x42aa84,_0x29beb5,_0x551eea,_0x479217){var _0x632df4=util[_0x4f76('0x79')](_0x4f76('0x7a'),ISPEECH_API,_0x29beb5,_0x551eea,base64Encode(_0x42aa84),_0x479217?util[_0x4f76('0x79')](_0x4f76('0x7b'),encodeURIComponent(_0x479217)):_0x4f76('0x7c'));return uploadFile(_0x632df4)[_0x4f76('0x2c')](function(_0x31b0be){return querystring[_0x4f76('0xa')](_0x31b0be);});};exports[_0x4f76('0x7d')]=function(_0x39191c,_0x4768e0){return sestek[_0x4f76('0x7e')](_0x39191c,_0x4768e0)[_0x4f76('0x2c')](function(_0x12e75b){logger[_0x4f76('0x1c')](JSON[_0x4f76('0x40')](_0x12e75b));var _0x4135c4={'speech':_0x12e75b['text'],'action':_0x12e75b['channelData']?_0x12e75b['channelData'][_0x4f76('0x7f')]:undefined,'actiondata':_0x12e75b[_0x4f76('0x80')]?_0x12e75b[_0x4f76('0x80')][_0x4f76('0x81')]:undefined};if(_0x12e75b[_0x4f76('0x80')]&&_0x12e75b[_0x4f76('0x80')][_0x4f76('0x82')]){return base64Decode(_0x12e75b[_0x4f76('0x80')][_0x4f76('0x82')][_0x4f76('0x83')],path['resolve'](__dirname,_0x4f76('0x3b'),rs[_0x4f76('0x39')](0x4)+'.wav'))[_0x4f76('0x2c')](function(_0x200bf8){_0x4135c4['audiofile']=_0x200bf8;return _0x4135c4;});}return _0x4135c4;});};exports[_0x4f76('0x84')]=function(){return __dirname;}; \ No newline at end of file +var _0x6e0d=['https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','writeFile','chmodSync','777','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','data','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','metadata','replace','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','error','pipe','transcode','wav','end','info','resolve','tmp','generate','.wav','writeFileSync','base64','then','unlink','split','readFileSync','toString','googleCloudTTS'];(function(_0x33898d,_0x2ec079){var _0x330c08=function(_0x112667){while(--_0x112667){_0x33898d['push'](_0x33898d['shift']());}};_0x330c08(++_0x2ec079);}(_0x6e0d,0x1e3));var _0xd6e0=function(_0x222092,_0x44c427){_0x222092=_0x222092-0x0;var _0x37947e=_0x6e0d[_0x222092];return _0x37947e;};'use strict';var apiai=require(_0xd6e0('0x0'));var BPromise=require(_0xd6e0('0x1'));var dialogflow=require(_0xd6e0('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xd6e0('0x3'));var md5=require(_0xd6e0('0x4'));var path=require(_0xd6e0('0x5'));var querystring=require(_0xd6e0('0x6'));var rp=require(_0xd6e0('0x7'));var rs=require(_0xd6e0('0x8'));var sox=require(_0xd6e0('0x9'));var tts=require(_0xd6e0('0xa'));var urlParse=require(_0xd6e0('0xb'))[_0xd6e0('0xc')];var util=require('util');var aws=require('./aws');var google=require(_0xd6e0('0xd'));var sestek=require(_0xd6e0('0xe'));var tilde=require(_0xd6e0('0xf'));var logger=require(_0xd6e0('0x10'))(_0xd6e0('0x11'));var ISPEECH_API=_0xd6e0('0x12');function downloadFile(_0x44ceda,_0x9d88d0){return new BPromise(function(_0x417a3f,_0xf621bc){var _0x20a473=urlParse(_0x44ceda);var _0x1165d9=_0x20a473[_0xd6e0('0x13')]===_0xd6e0('0x14')?https:http;var _0x2ba99a={'host':_0x20a473['host'],'path':_0x20a473[_0xd6e0('0x5')],'headers':{'user-agent':_0xd6e0('0x15')}};_0x1165d9[_0xd6e0('0x16')](_0x2ba99a,function(_0x3beb77){if(_0x3beb77['statusCode']!==0xc8){logger['error'](_0xd6e0('0x17')+_0x44ceda+_0xd6e0('0x18')+_0x3beb77[_0xd6e0('0x19')]+'\x20('+_0x3beb77[_0xd6e0('0x1a')]+')');_0xf621bc(new Error(_0xd6e0('0x17')+_0x44ceda+_0xd6e0('0x18')+_0x3beb77[_0xd6e0('0x19')]+'\x20('+_0x3beb77['statusMessage']+')'));return;}var _0x31b230=fs[_0xd6e0('0x1b')](_0x9d88d0);_0x31b230['on'](_0xd6e0('0x1c'),function(){logger['info'](_0xd6e0('0x1d'));_0x31b230[_0xd6e0('0x1e')](_0x417a3f);});_0x31b230['on'](_0xd6e0('0x1f'),function(_0x5207a0){fs['unlink'](_0x9d88d0);logger[_0xd6e0('0x1f')]('download\x20error',_0x5207a0);_0xf621bc(_0x5207a0);});_0x3beb77[_0xd6e0('0x20')](_0x31b230);})['on'](_0xd6e0('0x1f'),function(_0xfa2bd7){logger[_0xd6e0('0x1f')](_0xfa2bd7);_0xf621bc(_0xfa2bd7);})['end']();});}function uploadFile(_0x4a0252){return new BPromise(function(_0x46cec9,_0x3ef788){var _0x483bd0=urlParse(_0x4a0252);var _0x272fbb=_0x483bd0[_0xd6e0('0x13')]===_0xd6e0('0x14')?https:http;var _0x13f8ea={'host':_0x483bd0['host'],'path':_0x483bd0['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x272fbb[_0xd6e0('0x16')](_0x13f8ea,function(_0x302c45){if(_0x302c45[_0xd6e0('0x19')]!==0xc8){_0x3ef788(new Error(_0xd6e0('0x17')+_0x4a0252+_0xd6e0('0x18')+_0x302c45[_0xd6e0('0x19')]+'\x20('+_0x302c45[_0xd6e0('0x1a')]+')'));return;}var _0xf406e2='';_0x302c45['on']('data',function(_0xdf48bb){_0xf406e2+=_0xdf48bb;});_0x302c45['on']('end',function(){_0x46cec9(_0xf406e2);});})['on']('error',function(_0x3532ae){_0x3ef788(_0x3532ae);})['end']();});}function convertFile(_0x51e377,_0x5e8752){return new BPromise(function(_0x49d20b,_0x28fe2f){var _0x3b9834=sox[_0xd6e0('0x21')](_0x51e377,_0x5e8752,{'sampleRate':0x1f40,'format':_0xd6e0('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b9834['on'](_0xd6e0('0x1f'),function(_0x56ff2a){logger[_0xd6e0('0x1f')]('error\x20convert',_0x56ff2a);_0x28fe2f(_0x56ff2a);});_0x3b9834['on'](_0xd6e0('0x23'),function(){logger[_0xd6e0('0x24')]('finish\x20to\x20convert');_0x49d20b();});_0x3b9834['start']();});}function base64Decode(_0x2fb2f0,_0x89f6ce){var _0xf11975=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x28'));fs[_0xd6e0('0x29')](_0xf11975,_0x2fb2f0,_0xd6e0('0x2a'));return convertFile(_0xf11975,_0x89f6ce)[_0xd6e0('0x2b')](function(){try{fs[_0xd6e0('0x2c')](_0xf11975);fs['chmodSync'](_0x89f6ce,'777');}catch(_0x2b5374){logger['error'](_0x2b5374);}return _0x89f6ce[_0xd6e0('0x2d')]('.')[0x0];});}function base64Encode(_0x59209f){var _0x4811ae=fs[_0xd6e0('0x2e')](_0x59209f);return new Buffer(_0x4811ae)[_0xd6e0('0x2f')]('base64');}exports[_0xd6e0('0x30')]=function(_0x7de9a4,_0x191f7b,_0x4bf685,_0x2da065,_0x202ec7,_0x533c42){var _0x489543,_0x297a65;var _0x2777cb=_0xd6e0('0x31');var _0x2d48c3='?key='+_0x7de9a4;var _0x2116eb={};if(_0x191f7b===_0xd6e0('0x32')){_0x2116eb['input']={'ssml':_0x4bf685};}else{_0x2116eb[_0xd6e0('0x33')]={'text':_0x4bf685};};_0x2116eb[_0xd6e0('0x34')]={'languageCode':_0x2da065,'ssmlGender':_0x202ec7};_0x2116eb[_0xd6e0('0x35')]={'audioEncoding':_0xd6e0('0x36'),'sampleRateHertz':0x1f40};var _0x2c030f={'url':_0x2777cb+_0xd6e0('0x37')+_0x2d48c3,'method':_0xd6e0('0x38'),'json':!![],'body':_0x2116eb};return rp(_0x2c030f)[_0xd6e0('0x2b')](function(_0x4e8b4d){return new BPromise(function(_0x559de0,_0x433da6){_0x489543=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x39'));var _0x5ed3c4=Buffer['from'](_0x4e8b4d['audioContent'],_0xd6e0('0x2a'));return fs[_0xd6e0('0x3a')](_0x489543,_0x5ed3c4,function(_0x42f9f9){_0x433da6(_0x42f9f9);},function(_0x2cf243){fs[_0xd6e0('0x3b')](_0x489543,_0xd6e0('0x3c'));_0x559de0(_0x2cf243);});});})[_0xd6e0('0x2b')](function(_0xb116fa){_0x297a65=path[_0xd6e0('0x25')](__dirname,'tmp',rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x28'));return convertFile(_0x489543,_0x297a65);})['then'](function(){try{fs[_0xd6e0('0x2c')](_0x489543);fs[_0xd6e0('0x3b')](_0x297a65,_0xd6e0('0x3c'));}catch(_0x3d3d4a){logger[_0xd6e0('0x1f')](_0x3d3d4a);}logger[_0xd6e0('0x24')](_0xd6e0('0x3d'),_0x297a65[_0xd6e0('0x2d')]('.')[0x0]);return _0x297a65[_0xd6e0('0x2d')]('.')[0x0];});};exports[_0xd6e0('0x3e')]=function(_0xb898ca,_0x524e40){var _0x4840fc='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x438e90,_0x1e057a;var _0x45369d;var _0x114244={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x4840fc,'headers':{'Content-Type':_0xd6e0('0x3f')},'body':_0xd6e0('0x40')+encodeURIComponent(JSON[_0xd6e0('0x41')]([[[_0xd6e0('0x42'),JSON[_0xd6e0('0x41')]([_0xb898ca,_0x524e40||'en',![],_0xd6e0('0x43')]),null,_0xd6e0('0x44')]]]))};return rp(_0x114244)['then'](function(_0x1cb7f8){try{_0x45369d=eval(_0x1cb7f8['slice'](0x5))[0x0][0x2];}catch(_0x2fe33b){throw new Error('parse\x20response\x20failed:\x0a'+_0x1cb7f8[_0xd6e0('0x45')]);}if(!_0x45369d){if(_0xb898ca['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xd6e0('0x46')+_0x524e40+_0xd6e0('0x47'));}}try{_0x45369d=eval(_0x45369d)[0x0];}catch(_0x4b500c){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xd6e0('0x45')]);}const _0x41940e=_0x45369d;_0x438e90=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs['generate'](0x4)+'.mp3');fs[_0xd6e0('0x29')](_0x438e90,_0x45369d,{'encoding':_0xd6e0('0x2a')});_0x1e057a=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x28'));return convertFile(_0x438e90,_0x1e057a);})['then'](function(){try{fs[_0xd6e0('0x2c')](_0x438e90);fs['chmodSync'](_0x1e057a,'777');}catch(_0x19493a){logger[_0xd6e0('0x1f')](_0x19493a);}logger[_0xd6e0('0x24')]('goggleTTS\x20path',_0x1e057a[_0xd6e0('0x2d')]('.')[0x0]);return _0x1e057a[_0xd6e0('0x2d')]('.')[0x0];});};exports[_0xd6e0('0x48')]=function(_0x38b85a,_0xcd7d54,_0x55eb4){return google[_0xd6e0('0x49')](_0x38b85a,_0xcd7d54,_0x55eb4)[_0xd6e0('0x2b')](function(_0x4fb303){logger[_0xd6e0('0x24')](_0x4fb303[_0xd6e0('0x4a')]);return rp(_0x4fb303);})['then'](function(_0x40ccc9){var _0xdfc652='';var _0xf04bef=0x0;try{fs[_0xd6e0('0x2c')](_0x38b85a);}catch(_0x3aa174){logger[_0xd6e0('0x1f')](_0x3aa174);}if(_0x40ccc9&&_0x40ccc9[_0xd6e0('0x4b')]){_0xdfc652=_0x40ccc9[_0xd6e0('0x4b')][_0xd6e0('0x4c')](function(_0x3c59ca){return _0x3c59ca&&_0x3c59ca[_0xd6e0('0x4d')][0x0]&&_0x3c59ca[_0xd6e0('0x4d')][0x0]['transcript']?_0x3c59ca[_0xd6e0('0x4d')][0x0][_0xd6e0('0x4e')]:'';})[_0xd6e0('0x4f')]('\x0a');_0xf04bef=_0x40ccc9['results'][_0xd6e0('0x4c')](function(_0x3fc6ea){return _0x3fc6ea&&_0x3fc6ea[_0xd6e0('0x4d')][0x0]&&_0x3fc6ea[_0xd6e0('0x4d')][0x0]['confidence']?_0x3fc6ea[_0xd6e0('0x4d')][0x0][_0xd6e0('0x50')]:0x0;})[_0xd6e0('0x4f')]('\x0a');}logger[_0xd6e0('0x24')](_0xd6e0('0x51'),_0xdfc652);logger['info'](_0xd6e0('0x52'),_0xf04bef);return{'transcript':_0xdfc652,'confidence':_0xf04bef};})[_0xd6e0('0x53')](function(_0x420f30){logger[_0xd6e0('0x1f')]('[%s]\x20%s:%s',_0x420f30[_0xd6e0('0x19')],_0x420f30[_0xd6e0('0x54')],_0x420f30[_0xd6e0('0x55')]);});};exports[_0xd6e0('0x56')]=function(_0x5646e8,_0x1a65cb,_0x574c78,_0x3144ec){var _0x2e1cee=apiai(_0x1a65cb,{'language':_0x3144ec||'en'});return _0x2e1cee['textRequest'](_0x574c78,{'sessionId':md5(_0x5646e8)})[_0xd6e0('0x2b')](function(_0x1e6e8c){logger['info'](JSON[_0xd6e0('0x41')](_0x1e6e8c));return{'source':_0x1e6e8c[_0xd6e0('0x57')][_0xd6e0('0x58')],'resolvedQuery':_0x1e6e8c[_0xd6e0('0x57')][_0xd6e0('0x59')],'action':_0x1e6e8c['result'][_0xd6e0('0x5a')],'actionIncomplete':_0x1e6e8c['result'][_0xd6e0('0x5b')],'speech':_0x1e6e8c[_0xd6e0('0x57')]['fulfillment'][_0xd6e0('0x5c')],'score':_0x1e6e8c['result'][_0xd6e0('0x5d')],'statusCode':_0x1e6e8c[_0xd6e0('0x5e')]['code'],'endConversation':_0x1e6e8c[_0xd6e0('0x57')][_0xd6e0('0x5f')]['endConversation']||![],'isFallbackIntent':_0x1e6e8c[_0xd6e0('0x57')][_0xd6e0('0x5f')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x405e6e,_0x3ba879,_0x1599d0,_0x13ae37,_0x594d6d,_0x1dceb5){var _0x46bcc4=_0x13ae37[_0xd6e0('0x60')](/\\n/g,'\x0a');var _0x543781={'credentials':{'private_key':_0x46bcc4,'client_email':_0x1599d0}};var _0x1e5f3c=new dialogflow['SessionsClient'](_0x543781);var _0x42dd88=_0x1e5f3c[_0xd6e0('0x61')](_0x3ba879,md5(_0x405e6e));var _0x1d869e={'session':_0x42dd88,'queryInput':{'text':{'text':_0x594d6d,'languageCode':_0x1dceb5}}};return _0x1e5f3c[_0xd6e0('0x62')](_0x1d869e)[_0xd6e0('0x2b')](function(_0x58f1a1){if(_0x58f1a1&&_0x58f1a1[_0xd6e0('0x63')]){logger[_0xd6e0('0x24')](_0xd6e0('0x64'),JSON['stringify'](_0x58f1a1));var _0x29cc4f=_0x58f1a1[0x0];if(_0x29cc4f){var _0x5ef531={'action':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x5a')],'allRequiredParamsPresent':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x66')],'endConversation':_0x29cc4f['queryResult'][_0xd6e0('0x67')]&&_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x67')]['fields']?_0x29cc4f['queryResult'][_0xd6e0('0x67')][_0xd6e0('0x68')]['end_conversation'][_0xd6e0('0x69')]:![],'fulfillmentText':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x6a')],'intentName':_0x29cc4f[_0xd6e0('0x65')]['intent'][_0xd6e0('0x54')],'intentDisplayName':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x6b')][_0xd6e0('0x6c')],'isFallbackIntent':_0x29cc4f[_0xd6e0('0x65')]['intent']['isFallback'],'languageCode':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x6d')],'queryText':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x6e')],'responseId':_0x29cc4f[_0xd6e0('0x6f')],'score':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x70')],'speech':_0x29cc4f[_0xd6e0('0x65')][_0xd6e0('0x6a')],'providerResponse':JSON[_0xd6e0('0x41')](_0x58f1a1)};return _0x5ef531;}}});};exports['tildeASR']=function(_0x395829,_0x4c3aa9,_0x40bf34,_0x573b66){return tilde['asr'](_0x395829,_0x4c3aa9,_0x40bf34,_0x573b66)['then'](function(_0xbd8ff2){try{fs[_0xd6e0('0x2c')](_0x395829);}catch(_0x446a94){logger[_0xd6e0('0x1f')](_0x446a94);}logger[_0xd6e0('0x24')]('Tilde\x20ASR\x20transcription',_0xbd8ff2[_0xd6e0('0x4e')]);logger[_0xd6e0('0x24')]('Tilde\x20ASR\x20confidence',_0xbd8ff2[_0xd6e0('0x50')]);return _0xbd8ff2;});};exports[_0xd6e0('0x71')]=function(_0x292fd3,_0x1933fa,_0x37f9ed,_0x44078e,_0x4df417,_0x181458){var _0x24847a=path['resolve'](__dirname,'tmp',rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x39'));var _0x4a14c3;return aws[_0xd6e0('0x72')](_0x292fd3,_0x1933fa,_0x37f9ed,_0x44078e,_0x4df417,_0x181458,_0x24847a)['then'](function(){_0x4a14c3=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x28'));return convertFile(_0x24847a,_0x4a14c3);})[_0xd6e0('0x2b')](function(){try{fs[_0xd6e0('0x2c')](_0x24847a);fs[_0xd6e0('0x3b')](_0x4a14c3,'777');}catch(_0x361e4f){logger[_0xd6e0('0x1f')](_0x361e4f);}return _0x4a14c3[_0xd6e0('0x2d')]('.')[0x0];});};exports[_0xd6e0('0x73')]=function(_0x4b6fcf,_0x3596f3,_0x3dbcf5,_0x46455a,_0x4ffa25,_0x418a43){return aws[_0xd6e0('0x74')](_0x4b6fcf,_0x3596f3,_0x3dbcf5,_0x46455a,_0x4ffa25,_0x418a43)[_0xd6e0('0x2b')](function(_0x11bd0b){logger[_0xd6e0('0x24')](JSON[_0xd6e0('0x41')](_0x11bd0b));return _0x11bd0b;});};exports[_0xd6e0('0x75')]=function(_0x52f69a,_0xb74b4b,_0x275edb,_0x56ab97){var _0x2b8090=util['format'](_0xd6e0('0x76'),ISPEECH_API,_0x52f69a,encodeURIComponent(_0xb74b4b),_0x275edb,_0x56ab97);var _0x4900ed=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+'.mp3');var _0x4e159e;return downloadFile(_0x2b8090,_0x4900ed)[_0xd6e0('0x2b')](function(){_0x4e159e=path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+'.wav');return convertFile(_0x4900ed,_0x4e159e);})[_0xd6e0('0x2b')](function(){try{fs[_0xd6e0('0x2c')](_0x4900ed);fs[_0xd6e0('0x3b')](_0x4e159e,_0xd6e0('0x3c'));}catch(_0x3c7bb1){logger['error'](_0x3c7bb1);}return _0x4e159e[_0xd6e0('0x2d')]('.')[0x0];});};exports[_0xd6e0('0x77')]=function(_0x2daa23,_0x3e4a40,_0x5dc508,_0x2b9132){var _0x25f3ba=util[_0xd6e0('0x78')](_0xd6e0('0x79'),ISPEECH_API,_0x3e4a40,_0x5dc508,base64Encode(_0x2daa23),_0x2b9132?util['format'](_0xd6e0('0x7a'),encodeURIComponent(_0x2b9132)):_0xd6e0('0x7b'));return uploadFile(_0x25f3ba)[_0xd6e0('0x2b')](function(_0x234360){return querystring[_0xd6e0('0xc')](_0x234360);});};exports[_0xd6e0('0x7c')]=function(_0x40d9f8,_0x1901be){return sestek[_0xd6e0('0x7d')](_0x40d9f8,_0x1901be)[_0xd6e0('0x2b')](function(_0x268733){logger['info'](JSON['stringify'](_0x268733));var _0x2c96d4={'speech':_0x268733[_0xd6e0('0x7e')],'action':_0x268733[_0xd6e0('0x7f')]?_0x268733[_0xd6e0('0x7f')][_0xd6e0('0x80')]:undefined,'actiondata':_0x268733[_0xd6e0('0x7f')]?_0x268733[_0xd6e0('0x7f')][_0xd6e0('0x81')]:undefined};if(_0x268733[_0xd6e0('0x7f')]&&_0x268733[_0xd6e0('0x7f')][_0xd6e0('0x82')]){return base64Decode(_0x268733[_0xd6e0('0x7f')][_0xd6e0('0x82')]['Data'],path[_0xd6e0('0x25')](__dirname,_0xd6e0('0x26'),rs[_0xd6e0('0x27')](0x4)+_0xd6e0('0x28')))['then'](function(_0x274963){_0x2c96d4[_0xd6e0('0x83')]=_0x274963;return _0x2c96d4;});}return _0x2c96d4;});};exports[_0xd6e0('0x84')]=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 27ac691..8f34e03 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 _0xaeb4=['exports','./nda'];(function(_0x26b2a2,_0x3aafe1){var _0x23990f=function(_0xf6b5a7){while(--_0xf6b5a7){_0x26b2a2['push'](_0x26b2a2['shift']());}};_0x23990f(++_0x3aafe1);}(_0xaeb4,0x11d));var _0x4aeb=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xaeb4[_0x2aecb2];return _0x3ebb80;};var nda=require(_0x4aeb('0x0'));module[_0x4aeb('0x1')]={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'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 eb7a393..10b94f8 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 _0xcd31=['dnid','extension','text','Bearer\x20','project','channelData','ProjectName','AudioOutputSettings','audio/wav','body','CustomAction','custom_action','stringify','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x40f563,_0x4a7141){var _0x3ad8c9=function(_0x27cdac){while(--_0x27cdac){_0x40f563['push'](_0x40f563['shift']());}};_0x3ad8c9(++_0x4a7141);}(_0xcd31,0x15d));var _0x1cd3=function(_0x1e035c,_0xf906b){_0x1e035c=_0x1e035c-0x0;var _0x3a63f0=_0xcd31[_0x1e035c];return _0x3a63f0;};'use strict';var rp=require('request-promise');var url=require(_0x1cd3('0x0'));var logger=require(_0x1cd3('0x1'))(_0x1cd3('0x2'));module['exports']=function(_0x3da1e3,_0x19dd0c){var _0x2526ea={'method':_0x1cd3('0x3'),'uri':url[_0x1cd3('0x4')](_0x19dd0c[_0x1cd3('0x5')],'/token'),'form':{'grant_type':_0x1cd3('0x6'),'username':_0x19dd0c[_0x1cd3('0x7')],'password':_0x19dd0c[_0x1cd3('0x6')]},'json':!![]};return rp(_0x2526ea)['then'](function(_0x45cc24){var _0x11b139={'method':_0x1cd3('0x3'),'uri':url['resolve'](_0x19dd0c[_0x1cd3('0x8')],_0x1cd3('0x9')),'body':{'type':_0x19dd0c[_0x1cd3('0xa')]||_0x1cd3('0xb'),'channelId':_0x1cd3('0xc'),'conversation':{'id':_0x3da1e3[_0x1cd3('0xd')]},'from':{'id':_0x3da1e3[_0x1cd3('0xe')],'name':_0x3da1e3['calleridname']},'recipient':{'id':_0x3da1e3[_0x1cd3('0xf')],'name':_0x3da1e3[_0x1cd3('0x10')]},'text':_0x19dd0c[_0x1cd3('0x11')],'channelData':{}},'headers':{'Authorization':_0x1cd3('0x12')+_0x45cc24['access_token']},'json':!![]};if(_0x19dd0c[_0x1cd3('0x13')]){_0x11b139['body'][_0x1cd3('0x14')][_0x1cd3('0x15')]=_0x19dd0c[_0x1cd3('0x13')];}if(_0x19dd0c['ndagenerate_audio']=='1'){_0x11b139['body'][_0x1cd3('0x14')][_0x1cd3('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1cd3('0x17')};}if(_0x19dd0c['custom_action']){_0x11b139[_0x1cd3('0x18')][_0x1cd3('0x14')][_0x1cd3('0x19')]=_0x19dd0c[_0x1cd3('0x1a')];if(_0x19dd0c['custom_action_data']){_0x11b139['body']['channelData']['CustomActionData']=_0x19dd0c['custom_action_data'];}}logger['info'](JSON[_0x1cd3('0x1b')](_0x11b139));return rp(_0x11b139);});}; \ No newline at end of file +var _0xb98f=['ndaactivity_type','message','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password'];(function(_0x48c612,_0x432076){var _0x5f0583=function(_0x2ebc92){while(--_0x2ebc92){_0x48c612['push'](_0x48c612['shift']());}};_0x5f0583(++_0x432076);}(_0xb98f,0xce));var _0xfb98=function(_0x1e1e9a,_0x1cfcc9){_0x1e1e9a=_0x1e1e9a-0x0;var _0x1d3b57=_0xb98f[_0x1e1e9a];return _0x1d3b57;};'use strict';var rp=require(_0xfb98('0x0'));var url=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));module[_0xfb98('0x4')]=function(_0x4f16b2,_0x5570ce){var _0x593d54={'method':_0xfb98('0x5'),'uri':url[_0xfb98('0x6')](_0x5570ce[_0xfb98('0x7')],_0xfb98('0x8')),'form':{'grant_type':'password','username':_0x5570ce[_0xfb98('0x9')],'password':_0x5570ce[_0xfb98('0xa')]},'json':!![]};return rp(_0x593d54)['then'](function(_0x27b394){var _0x4d06fc={'method':'POST','uri':url['resolve'](_0x5570ce['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5570ce[_0xfb98('0xb')]||_0xfb98('0xc'),'channelId':'Nda','conversation':{'id':_0x4f16b2['uniqueid']},'from':{'id':_0x4f16b2[_0xfb98('0xd')],'name':_0x4f16b2['calleridname']},'recipient':{'id':_0x4f16b2[_0xfb98('0xe')],'name':_0x4f16b2[_0xfb98('0xf')]},'text':_0x5570ce[_0xfb98('0x10')],'channelData':{}},'headers':{'Authorization':_0xfb98('0x11')+_0x27b394[_0xfb98('0x12')]},'json':!![]};if(_0x5570ce[_0xfb98('0x13')]){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x16')]=_0x5570ce[_0xfb98('0x13')];}if(_0x5570ce[_0xfb98('0x17')]=='1'){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5570ce[_0xfb98('0x19')]){_0x4d06fc['body'][_0xfb98('0x15')][_0xfb98('0x1a')]=_0x5570ce[_0xfb98('0x19')];if(_0x5570ce[_0xfb98('0x1b')]){_0x4d06fc[_0xfb98('0x14')]['channelData'][_0xfb98('0x1c')]=_0x5570ce[_0xfb98('0x1b')];}}logger[_0xfb98('0x1d')](JSON[_0xfb98('0x1e')](_0x4d06fc));return rp(_0x4d06fc);});}; \ 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 1b3204c..ef75689 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x420c57,_0x4b7cf4,_0x51cb5c,_0x29a902){return asr(_0x420c57,_0x4b7cf4,_0x51cb5c,_0x29a902);}; \ No newline at end of file +var _0x4870=['exports','./lib/api'];(function(_0x4b8bf0,_0x19323c){var _0x56db6a=function(_0x4d704f){while(--_0x4d704f){_0x4b8bf0['push'](_0x4b8bf0['shift']());}};_0x56db6a(++_0x19323c);}(_0x4870,0x8f));var _0x0487=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4870[_0x40a045];return _0x1a687c;};'use strict';var asr=require(_0x0487('0x0'));module[_0x0487('0x1')]=function(_0xeb7296,_0x14e11a,_0x375f0a,_0x4bd782){return asr(_0xeb7296,_0x14e11a,_0x375f0a,_0x4bd782);}; \ 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 7c4494f..eb87581 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 _0x292a=['result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','crypto','../../../../../../config/logger','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status'];(function(_0x27a773,_0x4d6eb2){var _0x31655e=function(_0x5f4744){while(--_0x5f4744){_0x27a773['push'](_0x27a773['shift']());}};_0x31655e(++_0x4d6eb2);}(_0x292a,0x7b));var _0xa292=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0x292a[_0x5ac0f0];return _0x4aceec;};'use strict';var BPromise=require('bluebird');var _=require(_0xa292('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xa292('0x1'));var logger=require(_0xa292('0x2'))('agi');module[_0xa292('0x3')]=function(_0x1536f6,_0x2671aa,_0x454340,_0x30b0f5){return new BPromise(function(_0x3d8d23,_0x308979){logger['info']('Tilde\x20URI',_0x30b0f5||_0xa292('0x4'));var _0x245455=new WebSocket(_0x30b0f5||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x27b757='';var _0x5d6ebf='0';var _0x38307d='1';var _0xb0980f=_0xa292('0x5');function _0x43861a(_0x35c050){var _0x598ea4=crypto['createHash'](_0xa292('0x6'));_0x598ea4[_0xa292('0x7')](_0x35c050);return _0x598ea4[_0xa292('0x8')](_0xa292('0x9'));}function _0x38ad92(){try{logger[_0xa292('0xa')](_0xa292('0xb'));var _0x5a92a1=moment()[_0xa292('0xc')]();var _0x2e06a8=_0x43861a(_0x5a92a1+_0x2671aa+_0x454340);_0x245455[_0xa292('0xd')](JSON['stringify']({'appID':_0x2671aa,'timestamp':_0x5a92a1,'appKey':_0x2e06a8}));var _0x48db0f=fs['createReadStream'](_0x1536f6);_0x48db0f['on']('data',function(_0x58b630){_0x245455[_0xa292('0xd')](_0x58b630);});_0x48db0f['on'](_0xa292('0xe'),function(){_0x245455[_0xa292('0xd')](_0xa292('0xf'));});}catch(_0x27b5ad){logger[_0xa292('0x10')](_0xa292('0x11'),JSON[_0xa292('0x12')](_0x27b5ad));_0x245455[_0xa292('0x13')]();}}function _0x471070(_0x2065d1){try{if(_0x2065d1){var _0x194295=JSON['parse'](_0x2065d1);switch(_0x194295[_0xa292('0x14')]){case 0x0:if(_0x194295[_0xa292('0x15')]){if(_0x194295['result'][_0xa292('0x16')]){logger['info'](_0xa292('0x17'),JSON['stringify'](_0x194295['result']['hypotheses']));_0x27b757=_0x194295[_0xa292('0x15')][_0xa292('0x18')][0x0][_0xa292('0x19')];_0x5d6ebf=_0x194295['result']['hypotheses'][0x0][_0xa292('0x1a')];_0x38307d='0';_0xb0980f='Success.';_0x245455['terminate']();}}break;case 0x1:logger[_0xa292('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x38307d='1';_0xb0980f=_0xa292('0x5');break;case 0x2:logger[_0xa292('0xa')](_0xa292('0x1b'));_0x38307d='2';_0xb0980f=_0xa292('0x1b');break;case 0x9:logger[_0xa292('0xa')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x38307d='9';_0xb0980f=_0xa292('0x1c');break;case 0xa:logger[_0xa292('0xa')](_0xa292('0x1d'));_0x38307d='10';_0xb0980f=_0xa292('0x1d');break;case 0xb:logger[_0xa292('0xa')](_0xa292('0x1e'));_0x38307d='11';_0xb0980f=_0xa292('0x1e');}}}catch(_0x176485){logger[_0xa292('0x10')](_0xa292('0x1f'),JSON[_0xa292('0x12')](_0x176485));_0x245455['terminate']();}}function _0x51253f(){logger[_0xa292('0xa')]('Close\x20Tilde\x20ASR\x20socket');_0x3d8d23({'transcript':_0x27b757,'confidence':_0x5d6ebf,'status':_0x38307d,'status_message':_0xb0980f});}function _0x571f10(_0x486df9){logger[_0xa292('0x10')](_0xa292('0x20'));if(!_['isNil'](_0x486df9)){logger[_0xa292('0x10')](_[_0xa292('0x21')](_0x486df9)?JSON['stringify'](_0x486df9):_0x486df9);}}_0x245455['on'](_0xa292('0x22'),_0x38ad92);_0x245455['on'](_0xa292('0x23'),_0x471070);_0x245455['on'](_0xa292('0xe'),_0x51253f);_0x245455['on'](_0xa292('0x10'),_0x571f10);});}; \ No newline at end of file +var _0xa4e0=['parse','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','moment','crypto','../../../../../../config/logger','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','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','close','error','terminate'];(function(_0x1e6dc4,_0xc37ed6){var _0x5409cb=function(_0x5955ef){while(--_0x5955ef){_0x1e6dc4['push'](_0x1e6dc4['shift']());}};_0x5409cb(++_0xc37ed6);}(_0xa4e0,0xc4));var _0x0a4e=function(_0x5aab0d,_0x5f328c){_0x5aab0d=_0x5aab0d-0x0;var _0x272b83=_0xa4e0[_0x5aab0d];return _0x272b83;};'use strict';var BPromise=require(_0x0a4e('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0a4e('0x1'));var crypto=require(_0x0a4e('0x2'));var logger=require(_0x0a4e('0x3'))('agi');module[_0x0a4e('0x4')]=function(_0x34b5b9,_0x29fa8e,_0x5b7506,_0x222803){return new BPromise(function(_0x211911,_0x26d76f){logger[_0x0a4e('0x5')](_0x0a4e('0x6'),_0x222803||_0x0a4e('0x7'));var _0x4ebdb1=new WebSocket(_0x222803||_0x0a4e('0x7'),{'perMessageDeflate':![]});var _0x5a647a='';var _0x3e46d6='0';var _0x1eefe8='1';var _0x1d2582=_0x0a4e('0x8');function _0x41b267(_0x532239){var _0x2600d2=crypto['createHash']('sha1');_0x2600d2[_0x0a4e('0x9')](_0x532239);return _0x2600d2[_0x0a4e('0xa')](_0x0a4e('0xb'));}function _0x31ea3a(){try{logger[_0x0a4e('0x5')](_0x0a4e('0xc'));var _0x3c1b52=moment()['unix']();var _0x199853=_0x41b267(_0x3c1b52+_0x29fa8e+_0x5b7506);_0x4ebdb1[_0x0a4e('0xd')](JSON[_0x0a4e('0xe')]({'appID':_0x29fa8e,'timestamp':_0x3c1b52,'appKey':_0x199853}));var _0xa7cad9=fs[_0x0a4e('0xf')](_0x34b5b9);_0xa7cad9['on'](_0x0a4e('0x10'),function(_0x34dd42){_0x4ebdb1[_0x0a4e('0xd')](_0x34dd42);});_0xa7cad9['on'](_0x0a4e('0x11'),function(){_0x4ebdb1['send']('EOS');});}catch(_0x27dbb4){logger[_0x0a4e('0x12')]('Tilde\x20ASR\x20send\x20error',JSON[_0x0a4e('0xe')](_0x27dbb4));_0x4ebdb1[_0x0a4e('0x13')]();}}function _0x3ceb56(_0x39a95f){try{if(_0x39a95f){var _0x237535=JSON[_0x0a4e('0x14')](_0x39a95f);switch(_0x237535['status']){case 0x0:if(_0x237535[_0x0a4e('0x15')]){if(_0x237535[_0x0a4e('0x15')][_0x0a4e('0x16')]){logger[_0x0a4e('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x0a4e('0xe')](_0x237535[_0x0a4e('0x15')][_0x0a4e('0x17')]));_0x5a647a=_0x237535[_0x0a4e('0x15')][_0x0a4e('0x17')][0x0][_0x0a4e('0x18')];_0x3e46d6=_0x237535['result']['hypotheses'][0x0][_0x0a4e('0x19')];_0x1eefe8='0';_0x1d2582=_0x0a4e('0x1a');_0x4ebdb1[_0x0a4e('0x13')]();}}break;case 0x1:logger[_0x0a4e('0x5')](_0x0a4e('0x8'));_0x1eefe8='1';_0x1d2582=_0x0a4e('0x8');break;case 0x2:logger[_0x0a4e('0x5')](_0x0a4e('0x1b'));_0x1eefe8='2';_0x1d2582='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x0a4e('0x1c'));_0x1eefe8='9';_0x1d2582='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x0a4e('0x5')]('Authentication\x20failed.');_0x1eefe8='10';_0x1d2582=_0x0a4e('0x1d');break;case 0xb:logger[_0x0a4e('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1eefe8='11';_0x1d2582=_0x0a4e('0x1e');}}}catch(_0x41edb8){logger[_0x0a4e('0x12')](_0x0a4e('0x1f'),JSON[_0x0a4e('0xe')](_0x41edb8));_0x4ebdb1[_0x0a4e('0x13')]();}}function _0x53a9d9(){logger['info'](_0x0a4e('0x20'));_0x211911({'transcript':_0x5a647a,'confidence':_0x3e46d6,'status':_0x1eefe8,'status_message':_0x1d2582});}function _0x3253aa(_0x1d56cb){logger[_0x0a4e('0x12')](_0x0a4e('0x21'));if(!_[_0x0a4e('0x22')](_0x1d56cb)){logger[_0x0a4e('0x12')](_['isObject'](_0x1d56cb)?JSON['stringify'](_0x1d56cb):_0x1d56cb);}}_0x4ebdb1['on']('open',_0x31ea3a);_0x4ebdb1['on'](_0x0a4e('0x23'),_0x3ceb56);_0x4ebdb1['on'](_0x0a4e('0x11'),_0x53a9d9);_0x4ebdb1['on'](_0x0a4e('0x12'),_0x3253aa);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 10cb4be..b3dd631 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0xcda3=['exports','./asr'];(function(_0x26fe11,_0x3baf26){var _0x481bf5=function(_0x390017){while(--_0x390017){_0x26fe11['push'](_0x26fe11['shift']());}};_0x481bf5(++_0x3baf26);}(_0xcda3,0x183));var _0x3cda=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xcda3[_0x2fc012];return _0x2891f9;};var asr=require(_0x3cda('0x0'));module[_0x3cda('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index de5a5f3..535ac9e 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x46c9cc,_0xd27dca){var _0x21b46e=function(_0x33b2f5){while(--_0x33b2f5){_0x46c9cc['push'](_0x46c9cc['shift']());}};_0x21b46e(++_0xd27dca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x3a2e4c,_0x538db2){var _0x237c2c=function(_0xc1e9f5){while(--_0xc1e9f5){_0x3a2e4c['push'](_0x3a2e4c['shift']());}};_0x237c2c(++_0x538db2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 5bcbd97..0f54745 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 _0x9c5e=['no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','FIND\x20AGENT\x20%s\x20BY\x20%s','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Response:','%s_STATUS_CODE','200','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','shelljs','odbc','randomstring','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getSoundById','getSoundPath','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%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','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','callback','Callback\x20scheduled\x20at\x20','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','number','timeout','includes','POST','method','body','rawBody','parse','computedVariables','sync','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','length','isPlainObject','%s.%s','saveRestApiResult','setVariable','replaceAllVariables','split','replaceAll','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','result','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','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','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s'];(function(_0x3cce4c,_0x2ebb5b){var _0x387d76=function(_0x588d1f){while(--_0x588d1f){_0x3cce4c['push'](_0x3cce4c['shift']());}};_0x387d76(++_0x2ebb5b);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x1f2dc0,_0x58ddca){_0x1f2dc0=_0x1f2dc0-0x0;var _0x23098b=_0x9c5e[_0x1f2dc0];return _0x23098b;};'use strict';var fs=require('fs');var util=require(_0xe9c5('0x0'));var _=require(_0xe9c5('0x1'));var sh=require(_0xe9c5('0x2'));var odbc=require(_0xe9c5('0x3'))();var rs=require(_0xe9c5('0x4'));var moment=require('moment');var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0xe9c5('0x5'))(_0xe9c5('0x6'));var config=require('../../config/environment');var shared=require(_0xe9c5('0x7'));var scripts=require(_0xe9c5('0x8'));var FILES_PATH=_0xe9c5('0x9');var recursiveMapAttributes=[_0xe9c5('0xa'),'rawBody'];var verticesWithRetry=[_0xe9c5('0xb'),_0xe9c5('0xc'),_0xe9c5('0xd')];var AGIVertices=function(_0x38218c,_0x4a2b0b,_0x596f4c){this[_0xe9c5('0xe')]=_0x38218c;this[_0xe9c5('0xf')]=_0x4a2b0b;this[_0xe9c5('0x10')]=_0x596f4c;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x12')]=function(_0x39c057,_0x2bf224){this[_0xe9c5('0xf')][_0xe9c5('0x13')](_0x39c057)[_0xe9c5('0x14')](function(_0x46dc68){_0x2bf224(null,_0x46dc68?_0x46dc68[_0xe9c5('0x15')]:![]);})[_0xe9c5('0x16')](function(_0x25ff11){_0x2bf224(_0x25ff11);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x17')]=function(_0x509978,_0x3cce36){this[_0xe9c5('0xf')][_0xe9c5('0x18')](_0x509978)[_0xe9c5('0x14')](function(_0x211eec){_0x3cce36(null,_0x211eec?_0x211eec[_0xe9c5('0x15')]:![]);})['catch'](function(_0x163253){_0x3cce36(_0x163253);});};AGIVertices[_0xe9c5('0x11')]['getSquareProject']=function(_0x3aa80b,_0x45d18d){this[_0xe9c5('0xf')][_0xe9c5('0x19')](_0x3aa80b)[_0xe9c5('0x14')](function(_0x4d9c7d){_0x45d18d(null,_0x4d9c7d?_0x4d9c7d[_0xe9c5('0x15')]:![]);})[_0xe9c5('0x16')](function(_0x2f050b){_0x45d18d(_0x2f050b);});};AGIVertices[_0xe9c5('0x11')]['getSquareOdbc']=function(_0x26492a,_0x9d93d){this[_0xe9c5('0xf')][_0xe9c5('0x1a')](_0x26492a)[_0xe9c5('0x14')](function(_0x58fbad){_0x9d93d(null,_0x58fbad?_0x58fbad['dsn']:![]);})[_0xe9c5('0x16')](function(_0x57818d){_0x9d93d(_0x57818d);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1b')]=function(_0x21b02a,_0x4d16bc){this['rpc'][_0xe9c5('0x1c')](_0x21b02a)[_0xe9c5('0x14')](function(_0x37fb90){_0x4d16bc(null,_0x37fb90?_0x37fb90[_0xe9c5('0x15')]:![]);})[_0xe9c5('0x16')](function(_0x245161){_0x4d16bc(_0x245161);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1d')]=function(_0x1cd9c4,_0x402f59){this['rpc']['getTrunkById'](_0x1cd9c4)[_0xe9c5('0x14')](function(_0x3dd39d){_0x402f59(null,_0x3dd39d?_0x3dd39d[_0xe9c5('0x15')]:![]);})[_0xe9c5('0x16')](function(_0x33fe71){_0x402f59(_0x33fe71);});};AGIVertices[_0xe9c5('0x11')]['getSound']=function(_0x2c3fcb,_0x480187){var _0x3fa00b=this;this['rpc'][_0xe9c5('0x1e')](_0x2c3fcb)[_0xe9c5('0x14')](function(_0x52d008){_0x480187(null,_0x52d008?_0x3fa00b[_0xe9c5('0x1f')](_0x52d008[_0xe9c5('0x20')]):![]);})[_0xe9c5('0x16')](function(_0x37cfa5){_0x480187(_0x37cfa5);});};AGIVertices[_0xe9c5('0x11')]['getMailAccount']=function(_0xe3464c,_0x4fcabd){this[_0xe9c5('0xf')]['getMailAccountById'](_0xe3464c)[_0xe9c5('0x14')](function(_0x32e267){_0x4fcabd(null,_0x32e267?_0x32e267:![]);})[_0xe9c5('0x16')](function(_0x288d67){_0x4fcabd(_0x288d67);});};AGIVertices[_0xe9c5('0x11')]['sendMailMessage']=function(_0x23dc05,_0x12f47c,_0x140adf){this[_0xe9c5('0x10')][_0xe9c5('0x21')](_0x23dc05,_0x12f47c)['then'](function(){_0x140adf(null);})['catch'](function(_0x35b318){_0x140adf(_0x35b318);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x22')]=function(_0x22ce7c,_0x44a369){this[_0xe9c5('0xf')][_0xe9c5('0x23')](_0x22ce7c)[_0xe9c5('0x14')](function(_0x4feba2){if(_0x4feba2){if(_0x4feba2[_0xe9c5('0x24')]){_0x44a369(null,[_0x4feba2[_0xe9c5('0x25')]]);}else{_0x44a369(null,_['map'](_0x4feba2[_0xe9c5('0x26')],'interval'));}}else{_0x44a369(null,![]);}})[_0xe9c5('0x16')](function(_0x2642cc){_0x44a369(_0x2642cc);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1f')]=function(_0x258528){return util[_0xe9c5('0x27')](_0xe9c5('0x28'),FILES_PATH,_0x258528);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x29')]=function(_0x46f76d,_0x2a1056,_0x133c2a){odbc[_0xe9c5('0x2a')](_0x46f76d,function(_0x3aae58){if(_0x3aae58){logger[_0xe9c5('0x2b')](_0xe9c5('0x2c'),_0x3aae58);_0x133c2a(_0x3aae58);}else{logger[_0xe9c5('0x2d')](_0xe9c5('0x2e'));odbc[_0xe9c5('0x2f')](_0x2a1056,function(_0x55cd00,_0x2a1a28){if(_0x55cd00){logger[_0xe9c5('0x2d')](_0xe9c5('0x30'),_0x2a1056);_0x133c2a(_0x55cd00);}else{logger[_0xe9c5('0x2d')](_0xe9c5('0x31'),_0x2a1056);odbc[_0xe9c5('0x32')](function(_0x579e38){if(_0x579e38){logger[_0xe9c5('0x2b')](_0xe9c5('0x33'),_0x579e38);}_0x133c2a(null,_0x2a1a28);});}});}});};AGIVertices[_0xe9c5('0x11')]['getSmsAccount']=function(_0x34eb01,_0x1bf7c5){this[_0xe9c5('0xf')][_0xe9c5('0x34')](_0x34eb01)[_0xe9c5('0x14')](function(_0x3ad23f){_0x1bf7c5(null,_0x3ad23f?_0x3ad23f:![]);})[_0xe9c5('0x16')](function(_0x1fdf92){_0x1bf7c5(_0x1fdf92);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x35')]=function(_0xbe4c98,_0x479346){this['rpc'][_0xe9c5('0x35')](_0xbe4c98)[_0xe9c5('0x14')](function(_0x21bc80){_0x479346(null,_0x21bc80);})[_0xe9c5('0x16')](function(_0x4ca4b0){_0x479346(_0x4ca4b0);});};AGIVertices['prototype'][_0xe9c5('0x36')]=function(_0x144e85,_0x539bae,_0x5ae013){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel'][_0xe9c5('0x37')],'node':_0x144e85[_0xe9c5('0x38')],'application':_0x144e85[_0xe9c5('0x39')],'data':_0x539bae||null,'project_name':this[_0xe9c5('0xe')]['arg_1'],'callerid':this[_0xe9c5('0xe')][_0xe9c5('0x3a')]})[_0xe9c5('0x14')](function(_0x2e8867){if(_0x5ae013){_0x5ae013(null,_0x2e8867);}})[_0xe9c5('0x16')](function(_0xecc0c){if(_0x5ae013){_0x5ae013(_0xecc0c);}});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x3b')]=function(_0x5445c0,_0x2a4a29,_0x427e00,_0xd25a37){this[_0xe9c5('0xf')][_0xe9c5('0x3b')]({'uniqueid':this[_0xe9c5('0xe')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0xe9c5('0x3c')],'context':this[_0xe9c5('0xe')][_0xe9c5('0x3d')],'extension':this['channel'][_0xe9c5('0x3e')],'priority':this[_0xe9c5('0xe')][_0xe9c5('0x3f')],'accountcode':this[_0xe9c5('0xe')][_0xe9c5('0x40')],'dnid':this[_0xe9c5('0xe')]['dnid'],'projectName':this[_0xe9c5('0xe')][_0xe9c5('0x41')],'saveName':_0x2a4a29,'filename':_0x5445c0[_0xe9c5('0x42')]||_0x2a4a29,'savePath':_0x427e00})[_0xe9c5('0x14')](function(_0x4f0caa){_0xd25a37(null,_0x4f0caa);})[_0xe9c5('0x16')](function(_0x2c8bd3){_0xd25a37(_0x2c8bd3);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x43')]=function(_0x38396f,_0x298347,_0x53311d,_0x38af95,_0xe6a73f){this[_0xe9c5('0xf')][_0xe9c5('0x43')]({'uniqueid':this['channel'][_0xe9c5('0x37')],'body':_0x38396f,'direction':_0x298347,'providerName':_0x53311d,'providerResponse':_0x38af95})[_0xe9c5('0x14')](function(_0xeb662e){if(_0xe6a73f){_0xe6a73f(null,_0xeb662e);}})[_0xe9c5('0x16')](function(_0x254f41){if(_0xe6a73f){_0xe6a73f(_0x254f41);}});};AGIVertices[_0xe9c5('0x11')]['createCmContact']=function(_0x4b59fd,_0x1235c3){this[_0xe9c5('0xf')][_0xe9c5('0x44')]({'firstName':_[_0xe9c5('0x45')](_0x4b59fd[_0xe9c5('0x15')])||_[_0xe9c5('0x46')](_0x4b59fd[_0xe9c5('0x15')])?_0xe9c5('0x47')+Math[_0xe9c5('0x48')]():_0x4b59fd[_0xe9c5('0x15')],'lastName':_[_0xe9c5('0x45')](_0x4b59fd[_0xe9c5('0x49')])||_[_0xe9c5('0x46')](_0x4b59fd[_0xe9c5('0x49')])?null:_0x4b59fd[_0xe9c5('0x49')],'phone':_0x4b59fd[_0xe9c5('0x4a')],'ListId':_0x4b59fd['list_id'],'scheduledat':_0x4b59fd['scheduledAt'],'callbackUniqueid':this['channel'][_0xe9c5('0x37')],'tags':_0xe9c5('0x4b'),'description':_0xe9c5('0x4c')+_0x4b59fd['scheduledAt'][_0xe9c5('0x4d')](),'priority':_0x4b59fd['callback_priority']})[_0xe9c5('0x14')](function(_0xbac8ef){_0x1235c3(null,_0xbac8ef);})[_0xe9c5('0x16')](function(_0x1260cc){_0x1235c3(_0x1260cc);});};AGIVertices[_0xe9c5('0x11')]['getPause']=function(_0x2d1d5e,_0x1b4515){this['rpc'][_0xe9c5('0x4e')](_0x2d1d5e)[_0xe9c5('0x14')](function(_0x25f717){_0x1b4515(null,_0x25f717?_0x25f717[_0xe9c5('0x15')]:![]);})['catch'](function(_0x37ac57){_0x1b4515(_0x37ac57);});};AGIVertices['prototype'][_0xe9c5('0x4f')]=function(_0x40c555,_0x277323,_0x212a98){var _0x5ab663={'role':_0xe9c5('0x50')};_0x5ab663[_0x40c555]=this[_0xe9c5('0xe')][_0xe9c5('0x3a')];this[_0xe9c5('0xf')][_0xe9c5('0x4f')](_0x5ab663,_0x277323,this[_0xe9c5('0xe')]['uniqueid'])[_0xe9c5('0x14')](function(_0x181a9c){_0x212a98(null,_['isNil'](_0x181a9c)?![]:!![]);})[_0xe9c5('0x16')](function(_0x591bc5){logger[_0xe9c5('0x2b')](_0x591bc5);_0x212a98(null,![]);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x51')]=function(_0xede6fe,_0x2c0cfe){var _0x121859={'role':_0xe9c5('0x50')};_0x121859[_0xede6fe]=this['channel'][_0xe9c5('0x3a')];this[_0xe9c5('0xf')][_0xe9c5('0x51')](_0x121859)['then'](function(_0x377a0d){_0x2c0cfe(null,_['isNil'](_0x377a0d)?![]:!![]);})['catch'](function(_0xc1fc42){logger[_0xe9c5('0x2b')](_0xc1fc42);_0x2c0cfe(null,![]);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x52')]=function(_0x4712d1,_0x1bd2f5){var _0x3c4280={'role':_0xe9c5('0x50')};_0x3c4280[_0x4712d1]=this[_0xe9c5('0xe')][_0xe9c5('0x3a')];this['rpc'][_0xe9c5('0x52')](_0x3c4280)[_0xe9c5('0x14')](function(_0x257a96){_0x1bd2f5(null,_[_0xe9c5('0x46')](_0x257a96)?![]:!![]);})[_0xe9c5('0x16')](function(_0x1551c8){logger[_0xe9c5('0x2b')](_0x1551c8);_0x1bd2f5(null,![]);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x53')]=function(_0x5dbc73,_0x3f9758){var _0x1caca3={'role':_0xe9c5('0x50')};_0x1caca3[_0x5dbc73]=this[_0xe9c5('0xe')][_0xe9c5('0x3a')];var _0xd29c74=_0x5dbc73!=_0xe9c5('0x54')?util['format'](_0xe9c5('0x55'),_0xe9c5('0x56'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')]):undefined;this[_0xe9c5('0xf')]['agentLogin'](_0x1caca3,_0xd29c74)[_0xe9c5('0x14')](function(_0x5c15b8){_0x3f9758(null,_['isNil'](_0x5c15b8)?![]:!![]);})[_0xe9c5('0x16')](function(_0x2f07fc){logger['error'](_0x2f07fc);_0x3f9758(null,![]);});};AGIVertices['prototype'][_0xe9c5('0x57')]=function(_0x583369,_0x476fee){sh[_0xe9c5('0x58')](_['trim'](_0x583369),function(_0x3a984e,_0x207665){var _0x394aa4=_0x207665[_0xe9c5('0x59')](/(\r\n|\n|\r)/gm,'');_0x476fee(null,_0x394aa4);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x5a')]=function(_0x58b9b2,_0x2bf347){scripts[_0xe9c5('0x5a')](_0x58b9b2[_0xe9c5('0x5b')],_0x58b9b2[_0xe9c5('0x5c')]||_0xe9c5('0x5d'),_0x58b9b2[_0xe9c5('0x5d')],_0x58b9b2['languageCode']||_0xe9c5('0x5e'),_0x58b9b2[_0xe9c5('0x5f')]||'MALE',_0x58b9b2[_0xe9c5('0x60')]||_0xe9c5('0x61'))[_0xe9c5('0x14')](function(_0x107647){_0x2bf347(null,_0x107647);})[_0xe9c5('0x16')](function(_0x9115c8){_0x2bf347(_0x9115c8);});};AGIVertices['prototype'][_0xe9c5('0x62')]=function(_0x5b1fc4,_0x55fa7c){scripts['googleTTS'](_0x5b1fc4[_0xe9c5('0x5d')],_0x5b1fc4[_0xe9c5('0x63')]||'en',0x1)[_0xe9c5('0x14')](function(_0x1616dc){_0x55fa7c(null,_0x1616dc);})[_0xe9c5('0x16')](function(_0x6a4e21){_0x55fa7c(_0x6a4e21);});};AGIVertices['prototype'][_0xe9c5('0x64')]=function(_0x44baeb,_0x344e61){var _0x355b46={'uri':_0x44baeb[_0xe9c5('0x65')],'method':_0x44baeb['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44baeb['timeout'])===_0xe9c5('0x66')&&parseInt(_0x44baeb[_0xe9c5('0x67')])>=0x1?parseInt(_0x44baeb[_0xe9c5('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xe9c5('0x68')]([_0xe9c5('0x69'),'PUT'],_0x355b46[_0xe9c5('0x6a')]['toUpperCase']())){try{_0x355b46[_0xe9c5('0x6b')]=_0x44baeb[_0xe9c5('0x6c')]?JSON[_0xe9c5('0x6d')](_0x44baeb['rawBody']):{};}catch(_0x516087){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x516087);}}try{_0x355b46['headers']=_0x44baeb[_0xe9c5('0xa')]?JSON[_0xe9c5('0x6d')](_0x44baeb[_0xe9c5('0xa')]):{};}catch(_0x413729){logger[_0xe9c5('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x413729);}if(_0x44baeb[_0xe9c5('0x6e')]){try{var _0x492fff=require(_0x44baeb['computedVariables'])[_0xe9c5('0x6f')](this,_0x355b46);_0x355b46['uri']=Mustache['render'](_0x44baeb['url'],_0x492fff,{},['$$','$$']);if(_0x355b46[_0xe9c5('0x70')]){_0x355b46['headers']=JSON[_0xe9c5('0x6d')](Mustache['render'](JSON[_0xe9c5('0x71')](_0x355b46[_0xe9c5('0x70')]),_0x492fff,{},['$$','$$']));}if(_0x355b46[_0xe9c5('0x6b')]){_0x355b46[_0xe9c5('0x6b')]=JSON['parse'](Mustache['render'](JSON[_0xe9c5('0x71')](_0x355b46[_0xe9c5('0x6b')]),_0x492fff,{},['$$','$$']));}}catch(_0x1e7709){logger['error'](_0xe9c5('0x72'),_0x1e7709);}}rp(_0x355b46)['then'](function(_0x56b451){var _0x3a7d01={'statusCode':_0x56b451[_0xe9c5('0x73')]||0xc8,'statusMessage':_0x56b451[_0xe9c5('0x74')]||'OK','headers':_0x56b451['headers']||{},'body':_0x56b451[_0xe9c5('0x6b')]||{}};_0x344e61(null,_0x3a7d01);})[_0xe9c5('0x16')](function(_0x21eaca){var _0x478709={'statusCode':_0x21eaca['statusCode']||0x1f4,'statusMessage':_0x21eaca['message']||_0xe9c5('0x75'),'headers':_0x21eaca[_0xe9c5('0x76')]['headers']||{},'body':_0x21eaca[_0xe9c5('0x76')][_0xe9c5('0x6b')]||{}};_0x344e61(null,_0x478709);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x77')]=function(_0x4d0e82,_0x163a8b){scripts[_0xe9c5('0x77')](this['channel'][_0xe9c5('0x37')],_0x4d0e82[_0xe9c5('0x78')],_0x4d0e82[_0xe9c5('0x5d')],_0x4d0e82['dialogflow_language']||'en')[_0xe9c5('0x14')](function(_0x48e943){_0x163a8b(null,_0x48e943);})[_0xe9c5('0x16')](function(_0x4ecaff){_0x163a8b(_0x4ecaff);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x79')]=function(_0x3242f3,_0x409d05){scripts[_0xe9c5('0x79')](this[_0xe9c5('0xe')][_0xe9c5('0x37')],_0x3242f3[_0xe9c5('0x7a')],_0x3242f3['client_email'],_0x3242f3[_0xe9c5('0x7b')],_0x3242f3[_0xe9c5('0x5d')],_0x3242f3[_0xe9c5('0x7c')]||'en')[_0xe9c5('0x14')](function(_0x237404){_0x409d05(null,_0x237404);})[_0xe9c5('0x16')](function(_0x315543){_0x409d05(_0x315543);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x7d')]=function(_0x36e66e,_0x2f0380){scripts['sestekNDA'](this[_0xe9c5('0xe')],_0x36e66e)[_0xe9c5('0x14')](function(_0x2f77b3){_0x2f0380(null,_0x2f77b3);})['catch'](function(_0x5579ee){_0x2f0380(_0x5579ee);});};AGIVertices[_0xe9c5('0x11')]['ispeechTTS']=function(_0x136ad9,_0x14d0f5){scripts['ispeechTTS'](_0x136ad9['key'],_0x136ad9[_0xe9c5('0x5d')],_0x136ad9[_0xe9c5('0x7e')]||_0xe9c5('0x5e'),_0x136ad9[_0xe9c5('0x7f')])[_0xe9c5('0x14')](function(_0x354ac6){_0x14d0f5(null,_0x354ac6);})[_0xe9c5('0x16')](function(_0x239e7d){_0x14d0f5(_0x239e7d);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x80')]=function(_0x51810c,_0x5626a7,_0x32b0fd){scripts[_0xe9c5('0x80')](_0x5626a7,_0x51810c[_0xe9c5('0x78')],_0x51810c['ispeech_asr_language']||'en-US',this['isConfigured'](_0x51810c[_0xe9c5('0x81')])?_0x51810c[_0xe9c5('0x81')]:undefined)[_0xe9c5('0x14')](function(_0x14d234){_0x32b0fd(null,_0x14d234);})[_0xe9c5('0x16')](function(_0x239e09){_0x32b0fd(_0x239e09);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x82')]=function(_0x50da7e,_0x56a94e){scripts[_0xe9c5('0x82')](_0x50da7e[_0xe9c5('0x83')],_0x50da7e[_0xe9c5('0x84')],_0x50da7e[_0xe9c5('0x85')],_0x50da7e[_0xe9c5('0x86')]||'Amy',_0x50da7e['text'],_0x50da7e[_0xe9c5('0x87')]||_0xe9c5('0x5d'))[_0xe9c5('0x14')](function(_0x3c89be){_0x56a94e(null,_0x3c89be);})['catch'](function(_0x26bdc1){_0x56a94e(_0x26bdc1);});};AGIVertices['prototype'][_0xe9c5('0x88')]=function(_0x2f3991,_0x5b4fa3){scripts[_0xe9c5('0x88')](this[_0xe9c5('0xe')][_0xe9c5('0x37')],_0x2f3991[_0xe9c5('0x83')],_0x2f3991[_0xe9c5('0x84')],_0x2f3991[_0xe9c5('0x89')],_0x2f3991[_0xe9c5('0x5d')],_0x2f3991[_0xe9c5('0x8a')])['then'](function(_0x2833fd){_0x5b4fa3(null,_0x2833fd);})[_0xe9c5('0x16')](function(_0x468e01){_0x5b4fa3(_0x468e01);});};AGIVertices['prototype'][_0xe9c5('0x8b')]=function(_0x50fa8b,_0x3067b5,_0x56f39e){scripts[_0xe9c5('0x8b')](_0x3067b5,_0x50fa8b[_0xe9c5('0x78')],_0x50fa8b[_0xe9c5('0x8c')]||_0xe9c5('0x5e'))[_0xe9c5('0x14')](function(_0x27c59e){_0x56f39e(null,_0x27c59e);})[_0xe9c5('0x16')](function(_0x28d8bb){_0x56f39e(_0x28d8bb);});};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x8d')]=function(_0x3201f3,_0x360388,_0x42284b){scripts[_0xe9c5('0x8d')](_0x360388,_0x3201f3[_0xe9c5('0x8e')],_0x3201f3[_0xe9c5('0x8f')],_0x3201f3[_0xe9c5('0x90')])['then'](function(_0x1d89a9){_0x42284b(null,_0x1d89a9);})[_0xe9c5('0x16')](function(_0x4224ee){_0x42284b(_0x4224ee);});};AGIVertices['prototype'][_0xe9c5('0x91')]=function(_0x262bea){var _0x59adcc=_[_0xe9c5('0x68')](verticesWithRetry,_0x262bea[_0xe9c5('0x39')])?_0x262bea:_[_0xe9c5('0x92')](_0x262bea);for(var _0x1e64ad in _0x59adcc){if(_0x59adcc[_0xe9c5('0x93')](_0x1e64ad)){if(_0x59adcc[_0x1e64ad]&&_[_0xe9c5('0x94')](_0x59adcc[_0x1e64ad])){if(_[_0xe9c5('0x68')](recursiveMapAttributes,_0x1e64ad)){_0x59adcc[_0x1e64ad]=this[_0xe9c5('0x95')](_0x59adcc[_0x1e64ad]);}else{_0x59adcc[_0x1e64ad]=this['replaceAllVariables'](_0x59adcc[_0x1e64ad]);}}}}return _0x59adcc;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x96')]=function(_0x29b76b){for(var _0x5ed916 in _0x29b76b){if(_0x29b76b[_0xe9c5('0x93')](_0x5ed916)){if(_['isPlainObject'](_0x29b76b[_0x5ed916])){this[_0xe9c5('0x96')](_0x29b76b[_0x5ed916]);}else if(_['isArray'](_0x29b76b[_0x5ed916])){for(var _0x1fa1f8=0x0;_0x1fa1f8<_0x29b76b[_0x5ed916][_0xe9c5('0x97')];_0x1fa1f8++){this['recursiveNodeIndex'](_0x29b76b[_0x5ed916][_0x1fa1f8]);}}else if(_[_0xe9c5('0x94')](_0x29b76b[_0x5ed916])){_0x29b76b[_0x5ed916]=this['replaceAllVariables'](_0x29b76b[_0x5ed916]);}}}};AGIVertices[_0xe9c5('0x11')]['saveRestApiResult']=function(_0x5c9587,_0x709fae){for(var _0x2a1e14 in _0x5c9587){if(_0x5c9587[_0xe9c5('0x93')](_0x2a1e14)){if(_[_0xe9c5('0x98')](_0x5c9587[_0x2a1e14])){if(!_[_0xe9c5('0x45')](_0x5c9587[_0x2a1e14])){this['saveRestApiResult'](_0x5c9587[_0x2a1e14],util[_0xe9c5('0x27')](_0xe9c5('0x99'),_0x709fae,_0x2a1e14));}}else if(_['isArray'](_0x5c9587[_0x2a1e14])){for(var _0x3fec13=0x0;_0x3fec13<_0x5c9587[_0x2a1e14]['length'];_0x3fec13++){this[_0xe9c5('0x9a')](_0x5c9587[_0x2a1e14][_0x3fec13],util[_0xe9c5('0x27')]('%s.%s',_0x709fae,_0x2a1e14+'['+_0x3fec13+']'));}}else{if(!_['isNil'](_0x5c9587[_0x2a1e14])){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0x99'),_0x709fae,_0x2a1e14),_0x5c9587[_0x2a1e14]);}}}}};AGIVertices[_0xe9c5('0x11')]['replaceObjectAllVariables']=function(_0x24f472){try{var _0x49a38f=JSON[_0xe9c5('0x6d')](_0x24f472);this[_0xe9c5('0x96')](_0x49a38f);return JSON[_0xe9c5('0x71')](_0x49a38f);}catch(_0x17dcb1){return this[_0xe9c5('0x9c')](_0x24f472);}};AGIVertices['prototype'][_0xe9c5('0x9c')]=function(_0x345d24){var _0x53a7f4=_0x345d24[_0xe9c5('0x9d')]('{');for(var _0x5cd08a=0x1;_0x5cd08a<_0x53a7f4[_0xe9c5('0x97')];_0x5cd08a+=0x1){var _0x3e5238=_0x53a7f4[_0x5cd08a][_0xe9c5('0x9d')]('}');if(_0x3e5238['length']>0x1){_0x345d24=_0x345d24[_0xe9c5('0x9e')]('{'+_0x3e5238[0x0]+'}',this[_0xe9c5('0xe')][_0xe9c5('0x12')](_0x3e5238[0x0])[_0xe9c5('0x9f')]||_0x3e5238[0x0]);}}if(_0x53a7f4['length']===0x1){return _0x345d24['toString']();}return this[_0xe9c5('0x9c')](_0x345d24);};AGIVertices[_0xe9c5('0x11')]['getAndSetVariable']=function(_0x192033,_0x324ee1){var _0x590f8b=this[_0xe9c5('0xe')][_0xe9c5('0x12')](_0x192033);if(_0x590f8b['result']===-0x1){return _0x590f8b;}logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xa0'),_0x324ee1,_0x590f8b[_0xe9c5('0x9f')]));return this[_0xe9c5('0xe')][_0xe9c5('0x9b')](_0x324ee1,_0x590f8b[_0xe9c5('0x9f')]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xa1')]=function(_0x3054a5){return _0x3054a5&&_0x3054a5!=='0'&&_0x3054a5!=='-1'&&_0x3054a5!=='';};AGIVertices['prototype']['maxRetry']=function(_0x4b93dd){this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x4b93dd,'-');_0x4b93dd['retry']=_0x4b93dd[_0xe9c5('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xa3')]=function(_0x28c50f){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x28c50f[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x28c50f['text'])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}var _0x2be88a='\x22'+_0x28c50f[_0xe9c5('0x5d')]+'\x22';if(this[_0xe9c5('0xa1')](_0x28c50f[_0xe9c5('0x76')])){_0x2be88a+=','+_0x28c50f[_0xe9c5('0x76')];}var _0x149207=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0xe9c5('0xa6'),_0x2be88a);if(_0x149207['result']===-0x1){return _0x149207;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2be88a));};AGIVertices[_0xe9c5('0x11')]['mrcprecog']=function(_0x288e96){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0xa7'),_0x288e96[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x288e96['grammar'])){return this[_0xe9c5('0xe')]['noop'](_0xe9c5('0xa8'));}var _0x111d57=_0x288e96['grammar'];if(this[_0xe9c5('0xa1')](_0x288e96[_0xe9c5('0x76')])){_0x111d57+=','+_0x288e96[_0xe9c5('0x76')];}var _0x54c0bc=this['channel'][_0xe9c5('0x58')]('MRCPRecog',_0x111d57);if(_0x54c0bc[_0xe9c5('0xa9')]===-0x1){return _0x54c0bc;}var _0x310835=this[_0xe9c5('0xaa')](_0xe9c5('0xab'),_0xe9c5('0xac'));if(_0x310835[_0xe9c5('0xa9')]===-0x1){return _0x310835;}var _0x3bb0ee=this[_0xe9c5('0xaa')](_0xe9c5('0xad'),_0xe9c5('0xae'));if(_0x3bb0ee[_0xe9c5('0xa9')]===-0x1){return _0x3bb0ee;}var _0x3fda23=this[_0xe9c5('0xaa')](_0xe9c5('0xaf'),'MRCP_RECOG_INSTANCE');if(_0x3fda23['result']===-0x1){return _0x3fda23;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xb0'),_0x111d57));};AGIVertices['prototype'][_0xe9c5('0x6')]=function(_0x25d3d2){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xb1'),_0x25d3d2[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0x6')]([_0x25d3d2[_0xe9c5('0xb2')],_0x25d3d2[_0xe9c5('0xb3')]]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xb4')]=function(_0xba7ae){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xb5'),_0xba7ae[_0xe9c5('0x38')]));if(this[_0xe9c5('0xa1')](_0xba7ae[_0xe9c5('0x67')])){logger['info'](util['format'](_0xe9c5('0xb6'),_0xba7ae['timeout']));var _0x2a7acf=this[_0xe9c5('0xe')][_0xe9c5('0xb7')](_0xba7ae[_0xe9c5('0x67')]);if(_0x2a7acf[_0xe9c5('0xa9')]===-0x1){return _0x2a7acf;}}return this['channel'][_0xe9c5('0xb4')]();};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x4b')]=function(_0x2a4f00){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0xb8'),_0x2a4f00['label']));if(!this['isConfigured'](_0x2a4f00['list_id'])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x2a4f00,_0xe9c5('0xb9'));}_0x2a4f00[_0xe9c5('0xba')]=moment();if(this['isConfigured'](_0x2a4f00[_0xe9c5('0xbb')])){_0x2a4f00['scheduledAt']=moment()['add'](_0x2a4f00[_0xe9c5('0xbb')],'minutes');}if(!this[_0xe9c5('0xa1')](_0x2a4f00[_0xe9c5('0xbc')])){_0x2a4f00[_0xe9c5('0xbc')]=0x2;}this[_0xe9c5('0x44')]['sync'](this,_0x2a4f00);return this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xbd'),_0x2a4f00[_0xe9c5('0x4a')],_0x2a4f00['list_id'],_0x2a4f00['scheduledAt']));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xbe')]=function(_0x23a0dd){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0xbf'),_0x23a0dd[_0xe9c5('0x38')]));var _0x45d1ce=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0x23a0dd[_0xe9c5('0xc0')],_0x23a0dd[_0xe9c5('0x76')]);if(_0x45d1ce['result']===-0x1){return _0x45d1ce;}return this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xc1'),_0x23a0dd[_0xe9c5('0xc0')],_0x23a0dd[_0xe9c5('0x76')]));};AGIVertices[_0xe9c5('0x11')]['lumenvoxtts']=function(_0x4833b4){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xc2'),_0x4833b4['label']));if(!this['isConfigured'](_0x4833b4[_0xe9c5('0x5d')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}var _0x4b00c9='\x22'+_0x4833b4[_0xe9c5('0x5d')]+'\x22';if(this[_0xe9c5('0xa1')](_0x4833b4['options'])){_0x4b00c9+=','+_0x4833b4['options'];}var _0x3d8131=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0xe9c5('0xa6'),_0x4b00c9);if(_0x3d8131[_0xe9c5('0xa9')]===-0x1){return _0x3d8131;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4b00c9));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xc3')]=function(_0x5b9ed6){logger['info'](util[_0xe9c5('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5b9ed6[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x5b9ed6['text'])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}var _0xbf442b='\x22'+_0x5b9ed6[_0xe9c5('0x5d')]+'\x22';if(this[_0xe9c5('0xa1')](_0x5b9ed6['options'])){_0xbf442b+=','+_0x5b9ed6[_0xe9c5('0x76')];}var _0xeb7ad3=this['channel']['exec'](_0xe9c5('0xa6'),_0xbf442b);if(_0xeb7ad3[_0xe9c5('0xa9')]===-0x1){return _0xeb7ad3;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0xc4'),_0xbf442b));};AGIVertices[_0xe9c5('0x11')]['lumenvoxasr']=function(_0x1b1c4c){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xc5'),_0x1b1c4c['label']));if(!this[_0xe9c5('0xa1')](_0x1b1c4c['grammar'])){return this['channel'][_0xe9c5('0xa4')]('no\x20grammar\x20configured');}var _0xf6be01=_0x1b1c4c[_0xe9c5('0xc6')];if(this[_0xe9c5('0xa1')](_0x1b1c4c['options'])){_0xf6be01+=','+_0x1b1c4c['options'];}var _0x223828=this['channel']['exec']('MRCPRecog',_0xf6be01);if(_0x223828['result']===-0x1){return _0x223828;}var _0x1e8ced=this[_0xe9c5('0xaa')](_0xe9c5('0xab'),_0xe9c5('0xc7'));if(_0x1e8ced[_0xe9c5('0xa9')]===-0x1){return _0x1e8ced;}var _0x5a0ee5=this[_0xe9c5('0xaa')](_0xe9c5('0xad'),_0xe9c5('0xc8'));if(_0x5a0ee5[_0xe9c5('0xa9')]===-0x1){return _0x5a0ee5;}var _0x3f1e52=this[_0xe9c5('0xaa')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x3f1e52['result']===-0x1){return _0x3f1e52;}return this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xb0'),_0xf6be01));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xc9')]=function(_0x3107d6){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0xca'),_0x3107d6[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x3107d6[_0xe9c5('0xc6')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xa8'));}var _0x10e1c6=_0x3107d6[_0xe9c5('0xc6')];if(this[_0xe9c5('0xa1')](_0x3107d6[_0xe9c5('0x76')])){_0x10e1c6+=','+_0x3107d6[_0xe9c5('0x76')];}var _0x1865dd=this[_0xe9c5('0xe')]['exec'](_0xe9c5('0xcb'),_0x10e1c6);if(_0x1865dd[_0xe9c5('0xa9')]===-0x1){return _0x1865dd;}var _0x325b82=this[_0xe9c5('0xaa')]('RECOG_CONFIDENCE()',_0xe9c5('0xcc'));if(_0x325b82[_0xe9c5('0xa9')]===-0x1){return _0x325b82;}var _0x27e9f6=this[_0xe9c5('0xaa')](_0xe9c5('0xad'),'SESTEK_ASR_TRANSCRIPT');if(_0x27e9f6[_0xe9c5('0xa9')]===-0x1){return _0x27e9f6;}var _0x443276=this[_0xe9c5('0xaa')](_0xe9c5('0xaf'),_0xe9c5('0xcd'));if(_0x443276[_0xe9c5('0xa9')]===-0x1){return _0x443276;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xb0'),_0x10e1c6));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xce')]=function(_0x150899){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0xcf'),_0x150899[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x150899['odbc_id'])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x150899,_0xe9c5('0xd0'));}var _0xe04461=this[_0xe9c5('0xd1')][_0xe9c5('0x6f')](this,_0x150899['odbc_id']);if(!_0xe04461){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x150899,_0xe9c5('0xd2'));}if(!this[_0xe9c5('0xa1')](_0x150899[_0xe9c5('0x2f')])){return this[_0xe9c5('0xe')]['error'](_0x150899,'no\x20query\x20configured');}var _0x349e6a=_0x150899[_0xe9c5('0x2f')][_0xe9c5('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xd3'),_0x349e6a));var _0x574c5a=this[_0xe9c5('0x29')]['sync'](this,_0xe04461,_0x349e6a);this['createSquareDetailsReport'][_0xe9c5('0x6f')](this,_0x150899,_0x349e6a);if(!this[_0xe9c5('0xa1')](_0x150899[_0xe9c5('0xd4')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xd5'));}var _0x1e36ab=this[_0xe9c5('0x12')][_0xe9c5('0x6f')](this,_0x150899['variable_id']);if(!_0x1e36ab){return this[_0xe9c5('0xe')]['error'](_0x150899,_0xe9c5('0xd6'));}var _0x3b2027=this;_0x574c5a['forEach'](function(_0x42e446,_0x48af31){Object[_0xe9c5('0xd7')](_0x42e446)['forEach'](function(_0xeec3ef){_0x3b2027[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0xd8'),_0x1e36ab,_0x48af31,_0xeec3ef),_0x42e446[_0xeec3ef]);});});this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0xd9'),_0x1e36ab),_0x574c5a[_0xe9c5('0x97')]);return this[_0xe9c5('0xe')]['noop'](util['format'](_0xe9c5('0xda'),_0x1e36ab));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xdb')]=function(_0x156c32){logger[_0xe9c5('0xdc')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x156c32[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x156c32[_0xe9c5('0xdd')])){return this[_0xe9c5('0xe')]['error'](_0x156c32,_0xe9c5('0xde'));}var _0x589704=this[_0xe9c5('0x1b')][_0xe9c5('0x6f')](this,_0x156c32[_0xe9c5('0xdd')]);if(!_0x589704){return this['channel'][_0xe9c5('0x2b')](_0x156c32,'no\x20user\x20found');}var _0x220968=this['channel'][_0xe9c5('0x58')](_0xe9c5('0xdf'),[util[_0xe9c5('0x27')](_0xe9c5('0xe0'),_0x589704),_0x156c32[_0xe9c5('0x67')],_0x156c32[_0xe9c5('0xe1')],_0x156c32[_0xe9c5('0x65')]]);if(_0x220968['result']===-0x1){return _0x220968;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xe2'),_0xe9c5('0xdf')));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xe3')]=function(_0x7faad2){logger[_0xe9c5('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x7faad2[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x7faad2['key'])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20key\x20configured');}if(!this[_0xe9c5('0xa1')](_0x7faad2[_0xe9c5('0x5d')])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}this[_0xe9c5('0xe')][_0xe9c5('0xe4')]=!![];this[_0xe9c5('0x36')](_0x7faad2);this[_0xe9c5('0x43')](_0x7faad2[_0xe9c5('0x5d')],'in','','');this['channel']['noop'](util[_0xe9c5('0x27')](_0xe9c5('0xe5'),_0x7faad2[_0xe9c5('0x5d')]));var _0x5bf52a=this['googleDialogflow'][_0xe9c5('0x6f')](this,_0x7faad2);if(_0x5bf52a){for(var _0x3f35bf in _0x5bf52a){if(_0x5bf52a[_0xe9c5('0x93')](_0x3f35bf)){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0xe6'),_0x3f35bf['toUpperCase']()),_0x5bf52a[_0x3f35bf]);}}this['createSquareMessage'](_0x5bf52a[_0xe9c5('0xe7')],_0xe9c5('0xe8'),_0xe9c5('0xe3'),'');return this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0xe9'),_0x5bf52a[_0xe9c5('0xe7')]));}return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x7faad2,_0xe9c5('0xea'));};AGIVertices['prototype'][_0xe9c5('0xeb')]=function(_0x305b56){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0xec'),_0x305b56[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x305b56[_0xe9c5('0x7a')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xed'));}if(!this[_0xe9c5('0xa1')](_0x305b56[_0xe9c5('0xee')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xef'));}if(!this[_0xe9c5('0xa1')](_0x305b56['private_key'])){return this['channel']['noop'](_0xe9c5('0xf0'));}if(!this[_0xe9c5('0xa1')](_0x305b56[_0xe9c5('0x7c')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20anguage\x20configured');}if(!this[_0xe9c5('0xa1')](_0x305b56[_0xe9c5('0x5d')])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}this[_0xe9c5('0xe')][_0xe9c5('0xe4')]=!![];this[_0xe9c5('0x36')](_0x305b56);this[_0xe9c5('0x43')](_0x305b56[_0xe9c5('0x5d')],'in','','');this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xf1'),_0x305b56[_0xe9c5('0x5d')]));var _0x457e55=this[_0xe9c5('0x79')][_0xe9c5('0x6f')](this,_0x305b56);if(_0x457e55){for(var _0xf48dc3 in _0x457e55){if(_0x457e55[_0xe9c5('0x93')](_0xf48dc3)){if(_0xf48dc3!==_0xe9c5('0xf2')){this[_0xe9c5('0xe')]['setVariable'](util[_0xe9c5('0x27')]('DIALOGFLOW_%s',_0xf48dc3[_0xe9c5('0xf3')]()),_0x457e55[_0xf48dc3]);}}}this[_0xe9c5('0x43')](_0x457e55['speech'],_0xe9c5('0xe8'),_0xe9c5('0xeb'),_0x457e55[_0xe9c5('0xf2')]);return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0xf4'),_0x457e55[_0xe9c5('0xe7')]));}return this['channel'][_0xe9c5('0x2b')](_0x305b56,_0xe9c5('0xf5'));};AGIVertices['prototype'][_0xe9c5('0xf6')]=function(_0x4d8983){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0xf7'),_0x4d8983[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x4d8983['ndauth_url'])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0xf8'));}if(!this[_0xe9c5('0xa1')](_0x4d8983['username'])){return this['channel']['noop'](_0xe9c5('0xf9'));}if(!this[_0xe9c5('0xa1')](_0x4d8983[_0xe9c5('0xfa')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xfb'));}if(!this[_0xe9c5('0xa1')](_0x4d8983[_0xe9c5('0xfc')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}this['channel'][_0xe9c5('0xe4')]=!![];this['createSquareDetailsReport'](_0x4d8983);this['createSquareMessage'](_0x4d8983[_0xe9c5('0x5d')],'in','','');this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0xfd'),_0x4d8983[_0xe9c5('0x5d')]));var _0x109d82=this[_0xe9c5('0x7d')][_0xe9c5('0x6f')](this,_0x4d8983);if(_0x109d82){for(var _0x2d83fe in _0x109d82){if(_0x109d82['hasOwnProperty'](_0x2d83fe)){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0xfe'),_0x2d83fe[_0xe9c5('0xf3')]()),_0x109d82[_0x2d83fe]);}}this[_0xe9c5('0x43')](_0x109d82['speech'],_0xe9c5('0xe8'),_0xe9c5('0xf6'),'');if(_0x109d82[_0xe9c5('0xff')]){this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x100'),_0x109d82[_0xe9c5('0xff')]));var _0x37f9fc=this[_0xe9c5('0xe')][_0xe9c5('0x101')](_0x109d82[_0xe9c5('0xff')]);try{fs[_0xe9c5('0x102')](_0x109d82[_0xe9c5('0xff')]+_0xe9c5('0x103'));}catch(_0x44922f){logger[_0xe9c5('0x2b')](_0x44922f);}return _0x37f9fc;}else{return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x104'),_0x109d82['speech']));}}return this['channel']['error'](_0x4d8983,_0xe9c5('0x105'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x106')]=function(_0x1d75aa){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20END\x20(%s)\x20block',_0x1d75aa[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x425069){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x107'),_0x425069[_0xe9c5('0x38')]));var _0x8b55bf='';if(_0x425069['trunk_id']){if(!this[_0xe9c5('0xa1')](_0x425069[_0xe9c5('0x108')])){return this['channel'][_0xe9c5('0x2b')](_0x425069,'no\x20trunk\x20selected');}else{var _0x22ade4=parseInt(_0x425069[_0xe9c5('0x108')],0xa);if(isNaN(_0x22ade4)){_0x8b55bf=_0x425069[_0xe9c5('0x108')];}else{_0x8b55bf=this[_0xe9c5('0x1d')][_0xe9c5('0x6f')](this,_0x425069['trunk_id']);if(!_0x8b55bf){return this[_0xe9c5('0xe')]['error'](_0x425069,_0xe9c5('0x109'));}}}}else if(_0x425069['trunk_name']){_0x8b55bf=_0x425069[_0xe9c5('0x10a')];}else{return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x425069,'no\x20trunk\x20selected');}var _0x11c717=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0xe9c5('0xdf'),[util['format']('SIP/%s/%s',_0x8b55bf,_0x425069[_0xe9c5('0x4a')]),_0x425069[_0xe9c5('0x67')],_0x425069[_0xe9c5('0xe1')],_0x425069[_0xe9c5('0x65')]]);if(_0x11c717['result']===-0x1){return _0x11c717;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xe2'),_0xe9c5('0xdf')));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x10b')]=function(_0x3ed6ab){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x10c'),_0x3ed6ab[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('finally');};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xc')]=function(_0x11fc27){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x10d'),_0x11fc27[_0xe9c5('0x38')]));if(_0x11fc27[_0xe9c5('0x10e')]===0x0){return this[_0xe9c5('0xa2')](_0x11fc27);}_0x11fc27[_0xe9c5('0x10e')]-=0x1;if(!this[_0xe9c5('0xa1')](_0x11fc27['file_id'])){return this[_0xe9c5('0xe')]['error'](_0x11fc27,_0xe9c5('0x10f'));}var _0x3eb98b=this[_0xe9c5('0x110')][_0xe9c5('0x6f')](this,_0x11fc27[_0xe9c5('0x111')]);if(!_0x3eb98b){return this[_0xe9c5('0xe')]['error'](_0x11fc27,_0xe9c5('0x112'));}if(!this[_0xe9c5('0xa1')](_0x11fc27[_0xe9c5('0xd4')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0xe9c5('0xd5'));}var _0x5f4d23=this[_0xe9c5('0xe')][_0xe9c5('0x113')](_0x3eb98b,_0x11fc27['response'],_0x11fc27['maxdigit']);var _0x549a16=_0x5f4d23[_0xe9c5('0xa9')]?_0x5f4d23[_0xe9c5('0xa9')][_0xe9c5('0x4d')]():'';logger['info']('test',JSON[_0xe9c5('0x71')](_0x5f4d23));if(_0x5f4d23[_0xe9c5('0xa9')]===-0x1){this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x11fc27,_0x549a16);return _0x5f4d23;}else if(_0x5f4d23[_0xe9c5('0x9f')]==='timeout'){_0x5f4d23[_0xe9c5('0xa9')]=_0x549a16[_0xe9c5('0x97')]>=parseInt(_0x11fc27[_0xe9c5('0x114')])?'x':'i';}else{_0x5f4d23['result']=_0x549a16['length']>=parseInt(_0x11fc27[_0xe9c5('0x114')])&&_0x549a16['length']<=parseInt(_0x11fc27[_0xe9c5('0x115')])?'x':'i';}var _0x5426f7=this[_0xe9c5('0x12')][_0xe9c5('0x6f')](this,_0x11fc27['variable_id']);if(!_0x5426f7){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x11fc27,_0xe9c5('0xd6'));}this[_0xe9c5('0xe')]['setVariable'](_0x5426f7,_0x549a16);if(this['isConfigured'](_0x11fc27[_0xe9c5('0x116')])){var _0x19c719=parseInt(_0x11fc27[_0xe9c5('0x116')],0xa);var _0x5d3eec=rs[_0xe9c5('0x117')]({'charset':'*','length':_0x19c719});var _0x1165a3=_0x549a16[_0xe9c5('0x97')];if(_0x1165a3>0x0){if(_0x1165a3>_0x19c719){this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x11fc27,_0x11fc27[_0xe9c5('0x118')]===_0xe9c5('0x119')?_0x5d3eec+_0x549a16[_0xe9c5('0x11a')](_0x19c719):_0x549a16[_0xe9c5('0x11a')](0x0,_0x1165a3-_0x19c719)+_0x5d3eec);}else{this['createSquareDetailsReport'][_0xe9c5('0x6f')](this,_0x11fc27,rs[_0xe9c5('0x117')]({'charset':'*','length':_0x1165a3}));}}else{this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x11fc27,'');}}else{this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x11fc27,_0x549a16);}return _0x5f4d23;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0xd')]=function(_0x3a5a62){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x11b'),_0x3a5a62['label']));return this[_0xe9c5('0xc')](_0x3a5a62);};AGIVertices[_0xe9c5('0x11')]['goal']=function(_0x78adcd){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x11c'),_0x78adcd[_0xe9c5('0x38')]));this[_0xe9c5('0x36')]['sync'](this,_0x78adcd,_0x78adcd['goalname']);return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x11d'),_0x78adcd[_0xe9c5('0x11e')]));};AGIVertices['prototype'][_0xe9c5('0x11f')]=function(_0x1df46b){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1df46b[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x1df46b[_0xe9c5('0x83')])||!this[_0xe9c5('0xa1')](_0x1df46b[_0xe9c5('0x84')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0x120'));}if(!this[_0xe9c5('0xa1')](_0x1df46b[_0xe9c5('0x5d')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x121'),_0x1df46b['text']));var _0x1e20d3=this[_0xe9c5('0x82')]['sync'](this,_0x1df46b);if(_0x1e20d3){this['channel']['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x122'),_0x1e20d3));var _0x14aa4e=this[_0xe9c5('0xe')][_0xe9c5('0x101')](_0x1e20d3);try{fs[_0xe9c5('0x102')](_0x1e20d3+_0xe9c5('0x103'));}catch(_0x49078b){logger[_0xe9c5('0x2b')](_0x49078b);}return _0x14aa4e;}return this[_0xe9c5('0xe')]['error'](_0x1df46b,_0xe9c5('0x123'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x124')]=function(_0x59917b){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x125'),_0x59917b['label']));if(!this[_0xe9c5('0xa1')](_0x59917b[_0xe9c5('0x83')])||!this[_0xe9c5('0xa1')](_0x59917b['aws_secret_access_key'])){return this['channel']['noop'](_0xe9c5('0x120'));}if(!this['isConfigured'](_0x59917b['aws_bot_name'])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0x126'));}if(!this[_0xe9c5('0xa1')](_0x59917b['text'])){return this[_0xe9c5('0xe')]['noop'](_0xe9c5('0xa5'));}this['channel'][_0xe9c5('0xe4')]=!![];this[_0xe9c5('0x36')](_0x59917b);this[_0xe9c5('0x43')](_0x59917b['text'],'in','','');this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x127'),_0x59917b[_0xe9c5('0x5d')]));var _0x20765a=this[_0xe9c5('0x88')][_0xe9c5('0x6f')](this,_0x59917b);if(_0x20765a){for(var _0x3b3924 in _0x20765a){if(_0x20765a[_0xe9c5('0x93')](_0x3b3924)&&_[_0xe9c5('0x94')](_0x20765a[_0x3b3924])){this['channel'][_0xe9c5('0x9b')](util['format'](_0xe9c5('0x128'),_0x3b3924[_0xe9c5('0xf3')]()),_0x20765a[_0x3b3924]);}}if(_[_0xe9c5('0x46')](_0x20765a[_0xe9c5('0x129')])){return this[_0xe9c5('0xe')]['noop'](_0xe9c5('0x12a'));}else{this[_0xe9c5('0x43')](_0x20765a[_0xe9c5('0x129')],'out',_0xe9c5('0x12b'),'');return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x20765a[_0xe9c5('0x129')]));}}return this['channel'][_0xe9c5('0x2b')](_0x59917b,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype']['googleasr']=function(_0x2a248c){logger['info'](util['format'](_0xe9c5('0x12c'),_0x2a248c[_0xe9c5('0x38')],_0x2a248c['timeout']));if(!this[_0xe9c5('0xa1')](_0x2a248c[_0xe9c5('0x78')])){return this[_0xe9c5('0xe')]['noop'](_0xe9c5('0x12d'));}var _0x549999=_0xe9c5('0x12e');var _0x261ca6=util[_0xe9c5('0x27')](_0xe9c5('0x12f'),FILES_PATH,rs[_0xe9c5('0x117')](0x4));var _0x23d233=util['format'](_0xe9c5('0x99'),_0x261ca6,_0x549999);var _0x1ddbcc=!![];if(_0x2a248c[_0xe9c5('0x130')]===_0xe9c5('0x131')){_0x1ddbcc=![];}var _0x2c862a=this[_0xe9c5('0xe')][_0xe9c5('0x132')](_0x261ca6,_0x549999,_0x2a248c[_0xe9c5('0x133')],_0x2a248c['timeout'],undefined,_0x1ddbcc);if(_0x2c862a[_0xe9c5('0xa9')]!==-0x1){this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x134'),_0x23d233));var _0x38e3ce=this[_0xe9c5('0x8b')][_0xe9c5('0x6f')](this,_0x2a248c,_0x23d233);if(_0x38e3ce){for(var _0x1f0dfd in _0x38e3ce){if(_0x38e3ce['hasOwnProperty'](_0x1f0dfd)){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util['format'](_0xe9c5('0x135'),_0x1f0dfd[_0xe9c5('0xf3')]()),_0x38e3ce[_0x1f0dfd]);}}return this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x136'),JSON[_0xe9c5('0x71')](_0x38e3ce)));}}return _0x2c862a;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x137')]=function(_0x3e6551){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3e6551['label']));if(!this['isConfigured'](_0x3e6551[_0xe9c5('0x8e')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x3e6551[_0xe9c5('0x8f')])){return this[_0xe9c5('0xe')]['noop'](_0xe9c5('0x138'));}var _0x4e466d='wav';var _0x5e760c=util[_0xe9c5('0x27')](_0xe9c5('0x12f'),FILES_PATH,rs[_0xe9c5('0x117')](0x4));var _0xb1bec9=util[_0xe9c5('0x27')](_0xe9c5('0x99'),_0x5e760c,_0x4e466d);var _0x12d219=!![];if(_0x3e6551[_0xe9c5('0x130')]==='NOBEEP'){_0x12d219=![];}var _0x35fd54=this['channel'][_0xe9c5('0x132')](_0x5e760c,_0x4e466d,_0x3e6551['intKey'],_0x3e6551[_0xe9c5('0x67')],undefined,_0x12d219);if(_0x35fd54[_0xe9c5('0xa9')]!==-0x1){this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')]('tilde\x20%s\x20file\x20created',_0xb1bec9));var _0x3786a7=this['tildeASR']['sync'](this,_0x3e6551,_0xb1bec9);if(_0x3786a7){for(var _0x5c1eab in _0x3786a7){if(_0x3786a7[_0xe9c5('0x93')](_0x5c1eab)){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util['format'](_0xe9c5('0x139'),_0x5c1eab[_0xe9c5('0xf3')]()),_0x3786a7[_0x5c1eab]);}}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0x13a'),JSON[_0xe9c5('0x71')](_0x3786a7)));}}return _0x35fd54;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x13b')]=function(_0x5492d7){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5492d7[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0x13c')](_0x5492d7[_0xe9c5('0x3d')],_0x5492d7['extension'],_0x5492d7[_0xe9c5('0x3f')]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x13d')]=function(_0x1f4809){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x13e'),_0x1f4809[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x1f4809[_0xe9c5('0x13f')])){return this[_0xe9c5('0xe')]['error'](_0x1f4809,'no\x20condition\x20configured');}try{var _0x5e763e=eval(_0x1f4809['condition'])?_0xe9c5('0x140'):'false';this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x141'),_0x1f4809[_0xe9c5('0x13f')],_0x5e763e));return{'code':0xc8,'result':_0x5e763e};}catch(_0x3fdfae){return{'code':0xc8,'result':_0xe9c5('0x142')};}};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x143')]=function(_0x445a14){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x144'),_0x445a14[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x445a14[_0xe9c5('0x145')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x445a14,_0xe9c5('0x146'));}var _0x5522e4=this['getIntervals'][_0xe9c5('0x6f')](this,_0x445a14[_0xe9c5('0x145')]);if(!_0x5522e4){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x445a14,'no\x20intervals\x20found');}for(var _0x3b9e08=0x0;_0x3b9e08<_0x5522e4[_0xe9c5('0x97')];_0x3b9e08+=0x1){var _0x3e60d0=this['channel'][_0xe9c5('0x12')](util[_0xe9c5('0x27')](_0xe9c5('0x147'),_0x5522e4[_0x3b9e08]));if(_0x3e60d0[_0xe9c5('0xa9')]===-0x1){return _0x3e60d0;}logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x148'),_0x5522e4[_0x3b9e08],_0x3e60d0['extra']));if(_0x3e60d0[_0xe9c5('0x9f')]===_0xe9c5('0x140')){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x148'),_0x5522e4[_0x3b9e08],'true'));this['channel'][_0xe9c5('0xa4')](util['format'](_0xe9c5('0x148'),_0x5522e4[_0x3b9e08],_0xe9c5('0x140')));return{'code':0xc8,'result':_0xe9c5('0x140')};}else{logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x148'),_0x5522e4[_0x3b9e08],_0xe9c5('0x142')));this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0x148'),_0x5522e4[_0x3b9e08],_0xe9c5('0x142')));}}return{'code':0xc8,'result':_0xe9c5('0x142')};};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x149')]=function(_0x6e63e8){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x14a'),_0x6e63e8[_0xe9c5('0x38')]));return this['channel'][_0xe9c5('0x149')]();};AGIVertices['prototype'][_0xe9c5('0x14b')]=function(_0x4608f5){logger[_0xe9c5('0x2d')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4608f5[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x4608f5[_0xe9c5('0x78')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20key\x20configured');}var _0x330fe9='wav';var _0xd7ee54=util[_0xe9c5('0x27')](_0xe9c5('0x12f'),FILES_PATH,rs[_0xe9c5('0x117')](0x4));var _0x15ca09=util[_0xe9c5('0x27')]('%s.%s',_0xd7ee54,_0x330fe9);var _0x1508da=!![];if(_0x4608f5[_0xe9c5('0x130')]==='NOBEEP'){_0x1508da=![];}var _0x89463a=this[_0xe9c5('0xe')][_0xe9c5('0x132')](_0xd7ee54,_0x330fe9,_0x4608f5['intKey'],_0x4608f5[_0xe9c5('0x67')],undefined,_0x1508da);if(_0x89463a['result']!==-0x1){this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')]('ispeech\x20%s\x20file\x20created',_0x15ca09));var _0x4e9105=this['ispeechASR'][_0xe9c5('0x6f')](this,_0x4608f5,_0x15ca09);if(_0x4e9105){for(var _0x81aa6a in _0x4e9105){if(_0x4e9105['hasOwnProperty'](_0x81aa6a)){this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0x14c'),_0x81aa6a[_0xe9c5('0xf3')]()),_0x4e9105[_0x81aa6a]);}}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x14d'),JSON['stringify'](_0x4e9105)));}}return _0x89463a;};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x14e')]=function(_0x1cebf5){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x14f'),_0x1cebf5[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x1cebf5[_0xe9c5('0x78')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0x12d'));}if(!this[_0xe9c5('0xa1')](_0x1cebf5[_0xe9c5('0x5d')])){return this['channel'][_0xe9c5('0xa4')]('no\x20text\x20configured');}this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x150'),_0x1cebf5[_0xe9c5('0x5d')]));var _0x42e51f=this[_0xe9c5('0x151')]['sync'](this,_0x1cebf5);if(_0x42e51f){this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')]('ispeech\x20%s\x20file\x20created',_0x42e51f));var _0x56feb1=this[_0xe9c5('0xe')]['streamFile'](_0x42e51f,_0x1cebf5[_0xe9c5('0x133')]);try{fs[_0xe9c5('0x102')](_0x42e51f+'.wav');}catch(_0x4d9d23){logger[_0xe9c5('0x2b')](_0x4d9d23);}return _0x56feb1;}return this['channel']['error'](_0x1cebf5,_0xe9c5('0x152'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x153')]=function(_0x16dfab){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x154'),_0x16dfab['label']));if(!this[_0xe9c5('0xa1')](_0x16dfab[_0xe9c5('0x155')])){return this['channel'][_0xe9c5('0x2b')](_0x16dfab,_0xe9c5('0x156'));}logger['info'](util[_0xe9c5('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xe9c5('0x3a')],_0x16dfab[_0xe9c5('0x155')]));var _0xedfbef=this[_0xe9c5('0x53')][_0xe9c5('0x6f')](this,_0x16dfab[_0xe9c5('0x155')]);if(_0xedfbef){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x16dfab['findBy']));this[_0xe9c5('0xe')]['noop'](util['format'](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x16dfab[_0xe9c5('0x155')]));return{'code':0xc8,'result':_0xe9c5('0x158')};}else{logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x159'),this['channel'][_0xe9c5('0x3a')],_0x16dfab[_0xe9c5('0x155')]));this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe9c5('0xe')]['callerid'],_0x16dfab[_0xe9c5('0x155')]));return{'code':0xc8,'result':_0xe9c5('0x15a')};}};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x15b')]=function(_0x533f84){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x15c'),_0x533f84[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x533f84[_0xe9c5('0x155')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x533f84,_0xe9c5('0x156'));}logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x533f84[_0xe9c5('0x155')]));var _0x287286=this['agentLogout'][_0xe9c5('0x6f')](this,_0x533f84[_0xe9c5('0x155')]);if(_0x287286){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x533f84[_0xe9c5('0x155')]));this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x533f84['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x533f84[_0xe9c5('0x155')]));this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x159'),this['channel']['callerid'],_0x533f84[_0xe9c5('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe9c5('0x11')]['math']=function(_0x426396){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x15d'),_0x426396[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x426396[_0xe9c5('0x15e')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x426396,'no\x20operation\x20configured');}this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x15f'),_0x426396[_0xe9c5('0x15e')]));var _0x2b93d8=eval(_0x426396[_0xe9c5('0x15e')]);if(!this['isConfigured'](_0x426396[_0xe9c5('0xd4')])){return this['channel'][_0xe9c5('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x39b16e=this[_0xe9c5('0x12')][_0xe9c5('0x6f')](this,_0x426396[_0xe9c5('0xd4')]);if(!_0x39b16e){return this[_0xe9c5('0xe')]['error'](_0x426396,'no\x20variable\x20found');}if(_['isArray'](_0x2b93d8)){var _0x563841=this;_0x2b93d8[_0xe9c5('0x160')](function(_0x4861b0,_0x3de18d){_0x563841['channel'][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0x161'),_0x39b16e,_0x3de18d),_0x4861b0);});return this['channel']['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x162'),_0x39b16e));}else{return this[_0xe9c5('0xe')]['setVariable'](_0x39b16e,_0x2b93d8);}};AGIVertices['prototype'][_0xe9c5('0xb')]=function(_0x21cd3d){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x21cd3d[_0xe9c5('0x38')]));if(_0x21cd3d['retry']===0x0){return this['maxRetry'](_0x21cd3d);}_0x21cd3d[_0xe9c5('0x10e')]-=0x1;if(!this[_0xe9c5('0xa1')](_0x21cd3d[_0xe9c5('0x111')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x21cd3d,_0xe9c5('0x10f'));}var _0x29dc04=this[_0xe9c5('0x110')]['sync'](this,_0x21cd3d[_0xe9c5('0x111')]);if(!_0x29dc04){return this[_0xe9c5('0xe')]['error'](_0x21cd3d,_0xe9c5('0x112'));}var _0x2f4fc8=this[_0xe9c5('0xe')][_0xe9c5('0x113')](_0x29dc04,_0x21cd3d[_0xe9c5('0x163')],_0x21cd3d[_0xe9c5('0x164')]);var _0x3273b5=_0x2f4fc8[_0xe9c5('0xa9')];if(_0x2f4fc8[_0xe9c5('0xa9')]===-0x1){this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x21cd3d,'-1');return _0x2f4fc8;}else if(_0x2f4fc8[_0xe9c5('0x9f')]===_0xe9c5('0x67')){_0x2f4fc8[_0xe9c5('0xa9')]=_0x2f4fc8['result'][_0xe9c5('0x97')]>0x0?_0x2f4fc8[_0xe9c5('0xa9')]:'t';}else if(_[_0xe9c5('0x45')](_0x2f4fc8[_0xe9c5('0xa9')])){_0x2f4fc8[_0xe9c5('0xa9')]='#';_0x3273b5='#';}if(!this[_0xe9c5('0xa1')](_0x21cd3d['variable_id'])){this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xd5'));}else{var _0x253b9b=this[_0xe9c5('0x12')]['sync'](this,_0x21cd3d[_0xe9c5('0xd4')]);if(!_0x253b9b){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x21cd3d,_0xe9c5('0xd6'));}this[_0xe9c5('0xe')]['setVariable'](_0x253b9b,_0x3273b5);}this[_0xe9c5('0x36')]['sync'](this,_0x21cd3d,_0x3273b5);return _0x2f4fc8;};AGIVertices['prototype'][_0xe9c5('0xa4')]=function(_0x577934){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x165'),_0x577934['label']));return this[_0xe9c5('0xe')]['noop'](_0x577934[_0xe9c5('0x166')]||_0x577934[_0xe9c5('0x38')]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x167')]=function(_0x3b90d6){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3b90d6[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x3b90d6[_0xe9c5('0x155')])){return this['channel'][_0xe9c5('0x2b')](_0x3b90d6,_0xe9c5('0x156'));}logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x168'),this[_0xe9c5('0xe')]['callerid'],_0x3b90d6[_0xe9c5('0x155')]));var _0x48121d=this[_0xe9c5('0x169')][_0xe9c5('0x6f')](this,_0x3b90d6[_0xe9c5('0x16a')]);var _0x26bdc4=this[_0xe9c5('0x4f')][_0xe9c5('0x6f')](this,_0x3b90d6[_0xe9c5('0x155')],_0x48121d);if(_0x26bdc4){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x3b90d6[_0xe9c5('0x155')]));this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x3b90d6[_0xe9c5('0x155')]));return{'code':0xc8,'result':_0xe9c5('0x158')};}else{logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x159'),this['channel']['callerid'],_0x3b90d6[_0xe9c5('0x155')]));this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x3b90d6['findBy']));return{'code':0xc8,'result':_0xe9c5('0x15a')};}};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x16b')]=function(_0x3e7f7c){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x16c'),_0x3e7f7c[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x3e7f7c[_0xe9c5('0x111')])){return this['channel'][_0xe9c5('0x2b')](_0x3e7f7c,_0xe9c5('0x10f'));}var _0x15a102=this[_0xe9c5('0x110')][_0xe9c5('0x6f')](this,_0x3e7f7c[_0xe9c5('0x111')]);if(!_0x15a102){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x3e7f7c,_0xe9c5('0x112'));}var _0x405ee0=this[_0xe9c5('0xe')][_0xe9c5('0x58')]('PLAYBACK',[_0x15a102,_0x3e7f7c[_0xe9c5('0xe1')]]);if(_0x405ee0['result']===-0x1){return _0x405ee0;}return this['channel']['noop'](util[_0xe9c5('0x27')](_0xe9c5('0xc1'),'PLAYBACK',_0x15a102));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x16d')]=function(_0x5386ce){logger['info'](util['format'](_0xe9c5('0x16e'),_0x5386ce[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x5386ce['queue_id'])){return this['channel'][_0xe9c5('0x2b')](_0x5386ce,_0xe9c5('0x16f'));}var _0x5d4952='';var _0x438483=parseInt(_0x5386ce['queue_id'],0xa);if(isNaN(_0x438483)){_0x5d4952=_0x5386ce[_0xe9c5('0x170')];}else{_0x5d4952=this[_0xe9c5('0x17')]['sync'](this,_0x5386ce['queue_id']);if(!_0x5d4952){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x5386ce,'no\x20queue\x20found');}}var _0x398efc='';if(this['isConfigured'](_0x5386ce[_0xe9c5('0x111')])){var _0xa4522=this['getSound']['sync'](this,_0x5386ce[_0xe9c5('0x111')]);if(_0xa4522){_0x398efc=_0xa4522;}}this['createSquareDetailsReport'][_0xe9c5('0x6f')](this,_0x5386ce,_0x5d4952);if(_0x5386ce[_0xe9c5('0xe1')][_0xe9c5('0x171')]('x')<0x0){_0x5386ce[_0xe9c5('0xe1')]+='x';}if(_0x5386ce[_0xe9c5('0xe1')][_0xe9c5('0x171')]('X')<0x0){_0x5386ce[_0xe9c5('0xe1')]+='X';}this[_0xe9c5('0xe')][_0xe9c5('0x9b')](_0xe9c5('0x172'),_0x5d4952?_0x5d4952[_0xe9c5('0x173')]():'');var _0x4e1e91=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0xe9c5('0x174'),[_0x5d4952,_0x5386ce[_0xe9c5('0xe1')],_0x5386ce[_0xe9c5('0x65')],_0x398efc,_0x5386ce[_0xe9c5('0x67')],_0x5386ce['agi'],_0x5386ce[_0xe9c5('0x175')],_0x5386ce['gosub'],'',_0x5386ce[_0xe9c5('0x176')]]);if(_0x4e1e91['result']===-0x1){return _0x4e1e91;}return this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xc1'),'QUEUE',_0x5d4952));};AGIVertices['prototype'][_0xe9c5('0x177')]=function(_0x7e278){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x7e278['label']));var _0x1c1b4e=_0x7e278[_0xe9c5('0x178')]||_0xe9c5('0x12e');var _0x537ff2=util[_0xe9c5('0x27')](_0xe9c5('0x179'),this[_0xe9c5('0xe')][_0xe9c5('0x37')],rs[_0xe9c5('0x117')](0x5));var _0x22d095=util[_0xe9c5('0x27')](_0xe9c5('0x17a'),FILES_PATH,_0x537ff2,_0x1c1b4e);var _0x5283cb=util[_0xe9c5('0x27')](_0xe9c5('0x12f'),FILES_PATH,_0x537ff2);this[_0xe9c5('0x3b')][_0xe9c5('0x6f')](this,_0x7e278,_0x537ff2,_0x22d095);this['channel'][_0xe9c5('0x9b')](_0xe9c5('0x17b'),_0x537ff2);logger[_0xe9c5('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5283cb,_0x1c1b4e,_0x7e278[_0xe9c5('0x17c')],_0x7e278['timeout']);return this[_0xe9c5('0xe')][_0xe9c5('0x132')](_0x5283cb,_0x1c1b4e,_0x7e278[_0xe9c5('0x17c')],_0x7e278[_0xe9c5('0x67')],undefined,!![]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x17d')]=function(_0x532985){logger[_0xe9c5('0x2d')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x532985['label']));if(!this[_0xe9c5('0xa1')](_0x532985[_0xe9c5('0x65')])){return this['channel'][_0xe9c5('0xa4')]('no\x20url\x20configured');}var _0x4dc48c=this[_0xe9c5('0x64')]['sync'](this,_0x532985);logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x17e'),util['inspect'](_0x4dc48c,{'showHidden':![],'depth':null})));if(!this[_0xe9c5('0xa1')](_0x532985[_0xe9c5('0xd4')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1849d5=this['getVariable']['sync'](this,_0x532985[_0xe9c5('0xd4')]);if(!_0x1849d5){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x532985,_0xe9c5('0xd6'));}this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util[_0xe9c5('0x27')](_0xe9c5('0x17f'),_0x1849d5),_0x4dc48c['statusCode']?_0x4dc48c[_0xe9c5('0x73')]:_0xe9c5('0x180'));this[_0xe9c5('0xe')][_0xe9c5('0x9b')](util['format']('%s_STATUS_MESSAGE',_0x1849d5),_0x4dc48c[_0xe9c5('0x74')]?_0x4dc48c['statusMessage']:'OK');if(_0x4dc48c['body']){try{this[_0xe9c5('0x9a')](_0x4dc48c[_0xe9c5('0x6b')],_0x1849d5);}catch(_0x1f3288){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x1849d5));}}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')]('variable\x20%s\x20set',_0x1849d5));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x181')]=function(_0x4ab6b2){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x182'),_0x4ab6b2[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0x183')](_0x4ab6b2[_0xe9c5('0x184')]['replace'](/\s+/g,''),_0x4ab6b2['escape_digits']);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x185')]=function(_0x24aa08){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x186'),_0x24aa08[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0x187')](_0x24aa08['number'][_0xe9c5('0x59')](/\s+/g,''),_0x24aa08['escape_digits']);};AGIVertices[_0xe9c5('0x11')]['sayphonetic']=function(_0x1a0957){logger['info'](util[_0xe9c5('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x1a0957[_0xe9c5('0x38')]));return this[_0xe9c5('0xe')][_0xe9c5('0x188')](_0x1a0957[_0xe9c5('0x5d')],_0x1a0957[_0xe9c5('0x17c')]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x189')]=function(_0x12b72a){logger['info'](util[_0xe9c5('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x12b72a[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x12b72a[_0xe9c5('0x18a')])){return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0x18b'));}var _0x3cdfc8=this['getMailAccount'][_0xe9c5('0x6f')](this,_0x12b72a[_0xe9c5('0x18a')]);if(!_0x3cdfc8||!_0x3cdfc8['Smtp']){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x12b72a,_0xe9c5('0x18c'));}var _0x5016f1={'from':util[_0xe9c5('0x27')](_0xe9c5('0x18d'),_0x3cdfc8['name'],_0x3cdfc8[_0xe9c5('0x18e')]||_0x3cdfc8[_0xe9c5('0x18f')][_0xe9c5('0x190')]),'to':_0x12b72a['to']||'','cc':_0x12b72a['cc']||'','bcc':_0x12b72a[_0xe9c5('0x191')]||'','subject':_0x12b72a[_0xe9c5('0x192')],'html':_0x12b72a[_0xe9c5('0x5d')],'text':_0x12b72a[_0xe9c5('0x5d')]};if(this[_0xe9c5('0xa1')](_0x12b72a[_0xe9c5('0x193')])){}logger[_0xe9c5('0xdc')](_0xe9c5('0x194'),JSON[_0xe9c5('0x71')](_0x5016f1));this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x12b72a,_0x12b72a[_0xe9c5('0x18a')]);this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x195'),_0x3cdfc8[_0xe9c5('0x15')]));this[_0xe9c5('0x21')][_0xe9c5('0x6f')](this,_0x3cdfc8[_0xe9c5('0x196')],_0x5016f1);return this['channel'][_0xe9c5('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xe9c5('0x197')]=function(_0x2b57cb){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x198'),_0x2b57cb['label']));return this['channel']['noop'](_0xe9c5('0x199'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x19a')]=function(_0x38d400){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x38d400[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x38d400[_0xe9c5('0x19b')])){return this['channel'][_0xe9c5('0xa4')]('no\x20sms\x20account\x20configured');}var _0x1f8271=this[_0xe9c5('0x19c')][_0xe9c5('0x6f')](this,_0x38d400['sms_account_id']);if(!_0x1f8271){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x38d400,_0xe9c5('0x19d'));}var _0x278e99={'body':_0x38d400[_0xe9c5('0x19e')],'phone':_0x38d400['to']||'','SmsAccountId':_0x1f8271['id']};logger[_0xe9c5('0xdc')](_0xe9c5('0x19f'),JSON['stringify'](_0x278e99));this['createSquareDetailsReport'][_0xe9c5('0x6f')](this,_0x38d400,_0x38d400[_0xe9c5('0x19b')]);this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x1a0'),_0x1f8271['name']));this[_0xe9c5('0x35')][_0xe9c5('0x6f')](this,_0x278e99);return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0x1a1'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1a2')]=function(_0x2511ee){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1a3'),_0x2511ee[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x2511ee['variable_id'])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x2511ee,'no\x20variable\x20selected');}var _0x5a710c=this[_0xe9c5('0x12')]['sync'](this,_0x2511ee[_0xe9c5('0xd4')]);if(!_0x5a710c){return this['channel'][_0xe9c5('0x2b')](_0x2511ee,_0xe9c5('0xd6'));}return this[_0xe9c5('0xe')][_0xe9c5('0x9b')](_0x5a710c,_0x2511ee[_0xe9c5('0x1a4')]);};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1a5')]=function(_0x45efdf){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1a6'),_0x45efdf[_0xe9c5('0x38')]));this['channel'][_0xe9c5('0xa4')](_0xe9c5('0x1a7'));if(_0x45efdf['answer']==='yes'){this['channel'][_0xe9c5('0xa4')](_0xe9c5('0x1a8'));return this[_0xe9c5('0xe')][_0xe9c5('0xb4')]();}return this['channel'][_0xe9c5('0xa4')](_0xe9c5('0x1a9'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1aa')]=function(_0x5c6a96){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1ab'),_0x5c6a96['label']));if(!this[_0xe9c5('0xa1')](_0x5c6a96['project_id'])){return this['channel'][_0xe9c5('0x2b')](_0x5c6a96,_0xe9c5('0x1ac'));}var _0x646f=this[_0xe9c5('0x1ad')][_0xe9c5('0x6f')](this,_0x5c6a96[_0xe9c5('0x1ae')]);if(!this['isConfigured'](_0x646f)){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x5c6a96,util[_0xe9c5('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5c6a96[_0xe9c5('0x1ae')]));}if(_0x646f===this['channel']['arg_1']){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x5c6a96,_0xe9c5('0x1af'));}this[_0xe9c5('0x36')][_0xe9c5('0x6f')](this,_0x5c6a96,_0x646f);var _0x2b573b=this['channel'][_0xe9c5('0x58')]('AGI',util[_0xe9c5('0x27')](_0xe9c5('0x1b0'),config[_0xe9c5('0x6')][_0xe9c5('0x1b1')]||_0xe9c5('0x1b2'),_0x646f,this[_0xe9c5('0xe')][_0xe9c5('0x41')]));if(_0x2b573b['result']===-0x1){return _0x2b573b;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0xc1'),_0xe9c5('0x1b3'),_0x646f));};AGIVertices['prototype'][_0xe9c5('0x1b4')]=function(_0x12ba24){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1b5'),_0x12ba24[_0xe9c5('0x38')]));var _0x396fa2=this[_0xe9c5('0x57')][_0xe9c5('0x6f')](this,_0x12ba24[_0xe9c5('0xb2')]);this['createSquareDetailsReport'][_0xe9c5('0x6f')](this,_0x12ba24,_0x12ba24[_0xe9c5('0xb2')]);if(this[_0xe9c5('0xa1')](_0x12ba24['variable_id'])){var _0x50edf3=this[_0xe9c5('0x12')]['sync'](this,_0x12ba24[_0xe9c5('0xd4')]);if(_0x50edf3){this[_0xe9c5('0xe')]['setVariable'](_0x50edf3,_0x396fa2);return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format'](_0xe9c5('0x1b6'),_0x12ba24['command'],_0x50edf3));}}return this['channel'][_0xe9c5('0xa4')](util['format'](_0xe9c5('0x1b7'),_0x12ba24[_0xe9c5('0xb2')]));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1b8')]=function(_0xba8bb1){logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x1b9'),_0xba8bb1[_0xe9c5('0x38')]));_0xba8bb1[_0xe9c5('0x5d')]=_0xba8bb1[_0xe9c5('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe9c5('0xa1')](_0xba8bb1['apiKey'])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0xe9c5('0xa1')](_0xba8bb1[_0xe9c5('0x5d')])){return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](_0xe9c5('0xa5'));}this[_0xe9c5('0xe')]['noop'](util[_0xe9c5('0x27')](_0xe9c5('0x1ba'),_0xba8bb1['text']));var _0x4ee31a=this['googleCloudTTS']['sync'](this,_0xba8bb1);if(_0x4ee31a){this['channel'][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x1bb'),_0x4ee31a));var _0x365345=this['channel'][_0xe9c5('0x101')](_0x4ee31a);try{fs['unlink'](_0x4ee31a+_0xe9c5('0x103'));}catch(_0x26dd9d){logger[_0xe9c5('0x2b')](_0x26dd9d);}return _0x365345;}return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0xba8bb1,_0xe9c5('0x1bc'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1bd')]=function(_0x56cd29){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1be'),_0x56cd29['label']));_0x56cd29[_0xe9c5('0x5d')]=_0x56cd29[_0xe9c5('0x5d')][_0xe9c5('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe9c5('0xa1')](_0x56cd29[_0xe9c5('0x5d')])){return this[_0xe9c5('0xe')]['noop']('no\x20text\x20configured');}this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x1bf'),_0x56cd29[_0xe9c5('0x5d')]));var _0x2a4167=this[_0xe9c5('0x62')][_0xe9c5('0x6f')](this,_0x56cd29);if(_0x2a4167){this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2a4167));var _0x35c5b6=this['channel'][_0xe9c5('0x101')](_0x2a4167);try{fs[_0xe9c5('0x102')](_0x2a4167+_0xe9c5('0x103'));}catch(_0x418400){logger[_0xe9c5('0x2b')](_0x418400);}return _0x35c5b6;}return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x56cd29,_0xe9c5('0x1c0'));};AGIVertices[_0xe9c5('0x11')][_0xe9c5('0x1c1')]=function(_0x586c62){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x586c62[_0xe9c5('0x38')]));if(!this[_0xe9c5('0xa1')](_0x586c62[_0xe9c5('0x155')])){return this[_0xe9c5('0xe')]['error'](_0x586c62,_0xe9c5('0x156'));}logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x168'),this['channel'][_0xe9c5('0x3a')],_0x586c62['findBy']));var _0x581a66=this[_0xe9c5('0x51')]['sync'](this,_0x586c62[_0xe9c5('0x155')]);if(_0x581a66){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x157'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x586c62[_0xe9c5('0x155')]));this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x157'),this['channel'][_0xe9c5('0x3a')],_0x586c62[_0xe9c5('0x155')]));return{'code':0xc8,'result':_0xe9c5('0x158')};}else{logger['info'](util[_0xe9c5('0x27')](_0xe9c5('0x159'),this[_0xe9c5('0xe')][_0xe9c5('0x3a')],_0x586c62[_0xe9c5('0x155')]));this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util[_0xe9c5('0x27')](_0xe9c5('0x159'),this[_0xe9c5('0xe')]['callerid'],_0x586c62[_0xe9c5('0x155')]));return{'code':0xc8,'result':_0xe9c5('0x15a')};}};AGIVertices[_0xe9c5('0x11')]['voicemail']=function(_0x22c942){logger[_0xe9c5('0x2d')](util['format'](_0xe9c5('0x1c2'),_0x22c942[_0xe9c5('0x38')]));var _0x1ee8e5=this[_0xe9c5('0xe')][_0xe9c5('0x58')](_0xe9c5('0x1c3'),[_0x22c942['mailbox'],_0x22c942[_0xe9c5('0x76')]]);if(_0x1ee8e5[_0xe9c5('0xa9')]===-0x1){return _0x1ee8e5;}return this[_0xe9c5('0xe')][_0xe9c5('0xa4')](util['format']('Executed\x20command\x20%s\x20%s',_0xe9c5('0x1c3'),_0x22c942[_0xe9c5('0x1c4')]));};AGIVertices['prototype'][_0xe9c5('0x1c5')]=function(_0x2ad635){logger[_0xe9c5('0x2d')](util[_0xe9c5('0x27')](_0xe9c5('0x1c6'),_0x2ad635[_0xe9c5('0x38')]));if(!this['isConfigured'](_0x2ad635[_0xe9c5('0xd4')])){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x2ad635,_0xe9c5('0x1c7'));}var _0xebfa51=this[_0xe9c5('0x12')][_0xe9c5('0x6f')](this,_0x2ad635[_0xe9c5('0xd4')]);if(!_0xebfa51){return this[_0xe9c5('0xe')][_0xe9c5('0x2b')](_0x2ad635,_0xe9c5('0xd6'));}var _0x443441=this[_0xe9c5('0xe')][_0xe9c5('0x12')](_0xebfa51);return{'code':0xc8,'result':_0x443441[_0xe9c5('0x9f')]?_0x443441[_0xe9c5('0x9f')]:'-'};};String[_0xe9c5('0x11')]['replaceAll']=function(_0x33485b,_0x12d315){return this[_0xe9c5('0x9d')](_0x33485b)[_0xe9c5('0x1c8')](_0x12d315);};module['exports']=AGIVertices; \ No newline at end of file +var _0xae87=['VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','randomstring','moment','request-promise','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','mailRpc','prototype','rpc','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','sendMailMessage','interval','map','Intervals','format','getQueryOdbc','open','error','info','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','method','timeout','includes','POST','PUT','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','headers','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','stringify','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','wav','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','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block'];(function(_0xcadbdc,_0x3d830e){var _0x280408=function(_0xd1c38e){while(--_0xd1c38e){_0xcadbdc['push'](_0xcadbdc['shift']());}};_0x280408(++_0x3d830e);}(_0xae87,0x1ce));var _0x7ae8=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xae87[_0x45e98e];return _0x374dba;};'use strict';var fs=require('fs');var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x7ae8('0x0'));var moment=require(_0x7ae8('0x1'));var Mustache=require('mustache');var rp=require(_0x7ae8('0x2'));var logger=require('../../config/logger')('agi');var config=require(_0x7ae8('0x3'));var shared=require(_0x7ae8('0x4'));var scripts=require(_0x7ae8('0x5'));var FILES_PATH=_0x7ae8('0x6');var recursiveMapAttributes=['rawHeaders',_0x7ae8('0x7')];var verticesWithRetry=[_0x7ae8('0x8'),_0x7ae8('0x9'),_0x7ae8('0xa')];var AGIVertices=function(_0x1f049b,_0x45dfc2,_0x2138eb){this['channel']=_0x1f049b;this['rpc']=_0x45dfc2;this[_0x7ae8('0xb')]=_0x2138eb;};AGIVertices[_0x7ae8('0xc')]['getVariable']=function(_0xa3fb7a,_0x4aa39f){this[_0x7ae8('0xd')]['getVariableById'](_0xa3fb7a)[_0x7ae8('0xe')](function(_0x4bf950){_0x4aa39f(null,_0x4bf950?_0x4bf950[_0x7ae8('0xf')]:![]);})[_0x7ae8('0x10')](function(_0x3e41c1){_0x4aa39f(_0x3e41c1);});};AGIVertices['prototype'][_0x7ae8('0x11')]=function(_0x3b5605,_0x47b913){this[_0x7ae8('0xd')][_0x7ae8('0x12')](_0x3b5605)[_0x7ae8('0xe')](function(_0x381211){_0x47b913(null,_0x381211?_0x381211[_0x7ae8('0xf')]:![]);})[_0x7ae8('0x10')](function(_0xcf3a3d){_0x47b913(_0xcf3a3d);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x13')]=function(_0x107f39,_0x712147){this[_0x7ae8('0xd')]['getSquareProjectById'](_0x107f39)[_0x7ae8('0xe')](function(_0x252334){_0x712147(null,_0x252334?_0x252334['name']:![]);})[_0x7ae8('0x10')](function(_0x1ae8c5){_0x712147(_0x1ae8c5);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x14')]=function(_0x510aea,_0x4f21c0){this['rpc'][_0x7ae8('0x15')](_0x510aea)[_0x7ae8('0xe')](function(_0x587d0a){_0x4f21c0(null,_0x587d0a?_0x587d0a[_0x7ae8('0x16')]:![]);})['catch'](function(_0xddd2f5){_0x4f21c0(_0xddd2f5);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x17')]=function(_0x35cbed,_0x41116e){this[_0x7ae8('0xd')][_0x7ae8('0x18')](_0x35cbed)[_0x7ae8('0xe')](function(_0x3566f3){_0x41116e(null,_0x3566f3?_0x3566f3[_0x7ae8('0xf')]:![]);})[_0x7ae8('0x10')](function(_0x26d043){_0x41116e(_0x26d043);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x19')]=function(_0x2e11d9,_0x525b88){this['rpc'][_0x7ae8('0x1a')](_0x2e11d9)['then'](function(_0x5b2423){_0x525b88(null,_0x5b2423?_0x5b2423[_0x7ae8('0xf')]:![]);})['catch'](function(_0x33faec){_0x525b88(_0x33faec);});};AGIVertices[_0x7ae8('0xc')]['getSound']=function(_0x3fa339,_0xa9f18a){var _0x45e15c=this;this[_0x7ae8('0xd')][_0x7ae8('0x1b')](_0x3fa339)[_0x7ae8('0xe')](function(_0x4ff980){_0xa9f18a(null,_0x4ff980?_0x45e15c[_0x7ae8('0x1c')](_0x4ff980['save_name']):![]);})[_0x7ae8('0x10')](function(_0x14d1a6){_0xa9f18a(_0x14d1a6);});};AGIVertices[_0x7ae8('0xc')]['getMailAccount']=function(_0x3af383,_0x31d933){this[_0x7ae8('0xd')]['getMailAccountById'](_0x3af383)[_0x7ae8('0xe')](function(_0x39d750){_0x31d933(null,_0x39d750?_0x39d750:![]);})[_0x7ae8('0x10')](function(_0x1c76cd){_0x31d933(_0x1c76cd);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1d')]=function(_0x63cc2c,_0x4c86e8,_0x2be8b7){this[_0x7ae8('0xb')][_0x7ae8('0x1d')](_0x63cc2c,_0x4c86e8)['then'](function(){_0x2be8b7(null);})[_0x7ae8('0x10')](function(_0x40edfd){_0x2be8b7(_0x40edfd);});};AGIVertices[_0x7ae8('0xc')]['getIntervals']=function(_0x24d111,_0x56614a){this['rpc']['getIntervalById'](_0x24d111)[_0x7ae8('0xe')](function(_0x2a44c3){if(_0x2a44c3){if(_0x2a44c3['IntervalId']){_0x56614a(null,[_0x2a44c3[_0x7ae8('0x1e')]]);}else{_0x56614a(null,_[_0x7ae8('0x1f')](_0x2a44c3[_0x7ae8('0x20')],_0x7ae8('0x1e')));}}else{_0x56614a(null,![]);}})['catch'](function(_0x136cc9){_0x56614a(_0x136cc9);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1c')]=function(_0x52e056){return util[_0x7ae8('0x21')]('%s/sounds/converted/%s',FILES_PATH,_0x52e056);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x22')]=function(_0x11629f,_0x29cb06,_0x513f3c){odbc[_0x7ae8('0x23')](_0x11629f,function(_0x4359b2){if(_0x4359b2){logger[_0x7ae8('0x24')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x4359b2);_0x513f3c(_0x4359b2);}else{logger[_0x7ae8('0x25')]('ODBC\x20connection\x20successfully');odbc['query'](_0x29cb06,function(_0x8aa4a4,_0x4f5a24){if(_0x8aa4a4){logger['info'](_0x7ae8('0x26'),_0x29cb06);_0x513f3c(_0x8aa4a4);}else{logger[_0x7ae8('0x25')]('Query\x20executed\x20correctly\x20%s',_0x29cb06);odbc[_0x7ae8('0x27')](function(_0x623827){if(_0x623827){logger[_0x7ae8('0x24')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x623827);}_0x513f3c(null,_0x4f5a24);});}});}});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x28')]=function(_0x2a8861,_0x2f5630){this['rpc'][_0x7ae8('0x29')](_0x2a8861)[_0x7ae8('0xe')](function(_0x3e17c9){_0x2f5630(null,_0x3e17c9?_0x3e17c9:![]);})[_0x7ae8('0x10')](function(_0x2ecce3){_0x2f5630(_0x2ecce3);});};AGIVertices['prototype']['createSmsMessage']=function(_0x59bb66,_0x454721){this[_0x7ae8('0xd')][_0x7ae8('0x2a')](_0x59bb66)[_0x7ae8('0xe')](function(_0x4e2adb){_0x454721(null,_0x4e2adb);})[_0x7ae8('0x10')](function(_0x3e17b4){_0x454721(_0x3e17b4);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x2b')]=function(_0x3883c5,_0x3f5176,_0x15fb49){this[_0x7ae8('0xd')][_0x7ae8('0x2b')]({'uniqueid':this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],'node':_0x3883c5[_0x7ae8('0x2e')],'application':_0x3883c5[_0x7ae8('0x2f')],'data':_0x3f5176||null,'project_name':this[_0x7ae8('0x2c')][_0x7ae8('0x30')],'callerid':this[_0x7ae8('0x2c')][_0x7ae8('0x31')]})[_0x7ae8('0xe')](function(_0x3649d8){if(_0x15fb49){_0x15fb49(null,_0x3649d8);}})['catch'](function(_0x20f30e){if(_0x15fb49){_0x15fb49(_0x20f30e);}});};AGIVertices['prototype'][_0x7ae8('0x32')]=function(_0x1f521b,_0x34ba44,_0x6db21e,_0x3d83d){this[_0x7ae8('0xd')]['createSquareRecording']({'uniqueid':this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],'callerid':this[_0x7ae8('0x2c')][_0x7ae8('0x31')],'calleridname':this[_0x7ae8('0x2c')][_0x7ae8('0x33')],'context':this[_0x7ae8('0x2c')]['context'],'extension':this[_0x7ae8('0x2c')][_0x7ae8('0x34')],'priority':this[_0x7ae8('0x2c')][_0x7ae8('0x35')],'accountcode':this['channel'][_0x7ae8('0x36')],'dnid':this[_0x7ae8('0x2c')]['dnid'],'projectName':this[_0x7ae8('0x2c')][_0x7ae8('0x30')],'saveName':_0x34ba44,'filename':_0x1f521b['file']||_0x34ba44,'savePath':_0x6db21e})[_0x7ae8('0xe')](function(_0x63c528){_0x3d83d(null,_0x63c528);})[_0x7ae8('0x10')](function(_0x58ac5e){_0x3d83d(_0x58ac5e);});};AGIVertices['prototype']['createSquareMessage']=function(_0x52a373,_0xe01ccd,_0x338390,_0x5c832e,_0x46de0b){this[_0x7ae8('0xd')][_0x7ae8('0x37')]({'uniqueid':this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],'body':_0x52a373,'direction':_0xe01ccd,'providerName':_0x338390,'providerResponse':_0x5c832e})[_0x7ae8('0xe')](function(_0xa8ee86){if(_0x46de0b){_0x46de0b(null,_0xa8ee86);}})['catch'](function(_0x4781b5){if(_0x46de0b){_0x46de0b(_0x4781b5);}});};AGIVertices['prototype'][_0x7ae8('0x38')]=function(_0x43904a,_0x597d15){this[_0x7ae8('0xd')]['createCmContact']({'firstName':_[_0x7ae8('0x39')](_0x43904a[_0x7ae8('0xf')])||_[_0x7ae8('0x3a')](_0x43904a[_0x7ae8('0xf')])?_0x7ae8('0x3b')+Math['random']():_0x43904a[_0x7ae8('0xf')],'lastName':_['isEmpty'](_0x43904a[_0x7ae8('0x3c')])||_[_0x7ae8('0x3a')](_0x43904a[_0x7ae8('0x3c')])?null:_0x43904a[_0x7ae8('0x3c')],'phone':_0x43904a[_0x7ae8('0x3d')],'ListId':_0x43904a['list_id'],'scheduledat':_0x43904a['scheduledAt'],'callbackUniqueid':this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],'tags':_0x7ae8('0x3e'),'description':_0x7ae8('0x3f')+_0x43904a[_0x7ae8('0x40')][_0x7ae8('0x41')](),'priority':_0x43904a[_0x7ae8('0x42')]})[_0x7ae8('0xe')](function(_0x24dfa3){_0x597d15(null,_0x24dfa3);})[_0x7ae8('0x10')](function(_0x251c25){_0x597d15(_0x251c25);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x43')]=function(_0x5f33bf,_0x4515bc){this[_0x7ae8('0xd')][_0x7ae8('0x44')](_0x5f33bf)[_0x7ae8('0xe')](function(_0x1e669c){_0x4515bc(null,_0x1e669c?_0x1e669c[_0x7ae8('0xf')]:![]);})[_0x7ae8('0x10')](function(_0xc05c31){_0x4515bc(_0xc05c31);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x45')]=function(_0x35be88,_0x195a84,_0x3cc3de){var _0x327884={'role':'agent'};_0x327884[_0x35be88]=this['channel'][_0x7ae8('0x31')];this['rpc']['agentPause'](_0x327884,_0x195a84,this[_0x7ae8('0x2c')]['uniqueid'])[_0x7ae8('0xe')](function(_0x646339){_0x3cc3de(null,_[_0x7ae8('0x3a')](_0x646339)?![]:!![]);})[_0x7ae8('0x10')](function(_0x1a9a88){logger[_0x7ae8('0x24')](_0x1a9a88);_0x3cc3de(null,![]);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x46')]=function(_0x565313,_0x1e8ebe){var _0x477ac6={'role':_0x7ae8('0x47')};_0x477ac6[_0x565313]=this[_0x7ae8('0x2c')]['callerid'];this[_0x7ae8('0xd')][_0x7ae8('0x46')](_0x477ac6)[_0x7ae8('0xe')](function(_0x42527a){_0x1e8ebe(null,_['isNil'](_0x42527a)?![]:!![]);})['catch'](function(_0x3c3ea2){logger[_0x7ae8('0x24')](_0x3c3ea2);_0x1e8ebe(null,![]);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x48')]=function(_0x4042fd,_0x39eb7a){var _0x10b139={'role':_0x7ae8('0x47')};_0x10b139[_0x4042fd]=this[_0x7ae8('0x2c')][_0x7ae8('0x31')];this[_0x7ae8('0xd')][_0x7ae8('0x48')](_0x10b139)[_0x7ae8('0xe')](function(_0x30bb3e){_0x39eb7a(null,_[_0x7ae8('0x3a')](_0x30bb3e)?![]:!![]);})['catch'](function(_0x2e25ae){logger[_0x7ae8('0x24')](_0x2e25ae);_0x39eb7a(null,![]);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x49')]=function(_0x208ef6,_0x12249d){var _0x2323cb={'role':_0x7ae8('0x47')};_0x2323cb[_0x208ef6]=this[_0x7ae8('0x2c')][_0x7ae8('0x31')];var _0x56d44d=_0x208ef6!='internal'?util[_0x7ae8('0x21')](_0x7ae8('0x4a'),_0x7ae8('0x4b'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')]):undefined;this[_0x7ae8('0xd')]['agentLogin'](_0x2323cb,_0x56d44d)[_0x7ae8('0xe')](function(_0x3abe95){_0x12249d(null,_[_0x7ae8('0x3a')](_0x3abe95)?![]:!![]);})['catch'](function(_0x1767d1){logger[_0x7ae8('0x24')](_0x1767d1);_0x12249d(null,![]);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x4c')]=function(_0x4fb753,_0x462729){sh[_0x7ae8('0x4d')](_[_0x7ae8('0x4e')](_0x4fb753),function(_0x509da2,_0x1763f5){var _0x4fe4d7=_0x1763f5[_0x7ae8('0x4f')](/(\r\n|\n|\r)/gm,'');_0x462729(null,_0x4fe4d7);});};AGIVertices[_0x7ae8('0xc')]['googleCloudTTS']=function(_0x287b97,_0x3abba6){scripts[_0x7ae8('0x50')](_0x287b97[_0x7ae8('0x51')],_0x287b97['google_cloud_tts_text_type']||_0x7ae8('0x52'),_0x287b97[_0x7ae8('0x52')],_0x287b97[_0x7ae8('0x53')]||_0x7ae8('0x54'),_0x287b97[_0x7ae8('0x55')]||_0x7ae8('0x56'),_0x287b97['audioEncoding']||_0x7ae8('0x57'))[_0x7ae8('0xe')](function(_0x59fbd3){_0x3abba6(null,_0x59fbd3);})[_0x7ae8('0x10')](function(_0x47ab02){_0x3abba6(_0x47ab02);});};AGIVertices['prototype']['googleTTS']=function(_0x192f63,_0x477987){scripts[_0x7ae8('0x58')](_0x192f63[_0x7ae8('0x52')],_0x192f63[_0x7ae8('0x59')]||'en',0x1)['then'](function(_0x5d6189){_0x477987(null,_0x5d6189);})['catch'](function(_0x3b1a9e){_0x477987(_0x3b1a9e);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x5a')]=function(_0x165d9a,_0x14d22c){var _0x193a5d={'uri':_0x165d9a['url'],'method':_0x165d9a[_0x7ae8('0x5b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x165d9a[_0x7ae8('0x5c')])==='number'&&parseInt(_0x165d9a['timeout'])>=0x1?parseInt(_0x165d9a[_0x7ae8('0x5c')])*0x3e8:0x5*0x3e8};if(_[_0x7ae8('0x5d')]([_0x7ae8('0x5e'),_0x7ae8('0x5f')],_0x193a5d[_0x7ae8('0x5b')]['toUpperCase']())){try{_0x193a5d['body']=_0x165d9a[_0x7ae8('0x7')]?JSON[_0x7ae8('0x60')](_0x165d9a[_0x7ae8('0x7')]):{};}catch(_0x1cca53){logger['error'](_0x7ae8('0x61'),_0x1cca53);}}try{_0x193a5d['headers']=_0x165d9a[_0x7ae8('0x62')]?JSON[_0x7ae8('0x60')](_0x165d9a[_0x7ae8('0x62')]):{};}catch(_0x38d0f4){logger['error'](_0x7ae8('0x63'),_0x38d0f4);}if(_0x165d9a['computedVariables']){try{var _0xaab303=require(_0x165d9a[_0x7ae8('0x64')])['sync'](this,_0x193a5d);_0x193a5d[_0x7ae8('0x65')]=Mustache[_0x7ae8('0x66')](_0x165d9a[_0x7ae8('0x67')],_0xaab303,{},['$$','$$']);if(_0x193a5d['headers']){_0x193a5d[_0x7ae8('0x68')]=JSON[_0x7ae8('0x60')](Mustache[_0x7ae8('0x66')](JSON['stringify'](_0x193a5d[_0x7ae8('0x68')]),_0xaab303,{},['$$','$$']));}if(_0x193a5d[_0x7ae8('0x69')]){_0x193a5d[_0x7ae8('0x69')]=JSON['parse'](Mustache[_0x7ae8('0x66')](JSON['stringify'](_0x193a5d[_0x7ae8('0x69')]),_0xaab303,{},['$$','$$']));}}catch(_0x35c1b1){logger[_0x7ae8('0x24')](_0x7ae8('0x6a'),_0x35c1b1);}}rp(_0x193a5d)[_0x7ae8('0xe')](function(_0x5d18e9){var _0x402af4={'statusCode':_0x5d18e9[_0x7ae8('0x6b')]||0xc8,'statusMessage':_0x5d18e9[_0x7ae8('0x6c')]||'OK','headers':_0x5d18e9[_0x7ae8('0x68')]||{},'body':_0x5d18e9[_0x7ae8('0x69')]||{}};_0x14d22c(null,_0x402af4);})[_0x7ae8('0x10')](function(_0x4b7672){var _0x4c57e6={'statusCode':_0x4b7672[_0x7ae8('0x6b')]||0x1f4,'statusMessage':_0x4b7672[_0x7ae8('0x6d')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4b7672['options'][_0x7ae8('0x68')]||{},'body':_0x4b7672[_0x7ae8('0x6e')][_0x7ae8('0x69')]||{}};_0x14d22c(null,_0x4c57e6);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x6f')]=function(_0x1926df,_0x2f81a3){scripts[_0x7ae8('0x6f')](this['channel'][_0x7ae8('0x2d')],_0x1926df[_0x7ae8('0x70')],_0x1926df[_0x7ae8('0x52')],_0x1926df[_0x7ae8('0x71')]||'en')[_0x7ae8('0xe')](function(_0xbb0375){_0x2f81a3(null,_0xbb0375);})[_0x7ae8('0x10')](function(_0x21618b){_0x2f81a3(_0x21618b);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x72')]=function(_0x54d270,_0x326ab7){scripts[_0x7ae8('0x72')](this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],_0x54d270[_0x7ae8('0x73')],_0x54d270['client_email'],_0x54d270[_0x7ae8('0x74')],_0x54d270[_0x7ae8('0x52')],_0x54d270['dialogflowV2_language']||'en')[_0x7ae8('0xe')](function(_0x53f786){_0x326ab7(null,_0x53f786);})[_0x7ae8('0x10')](function(_0x37a420){_0x326ab7(_0x37a420);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x75')]=function(_0x210208,_0x5606e4){scripts['sestekNDA'](this[_0x7ae8('0x2c')],_0x210208)[_0x7ae8('0xe')](function(_0x29d7c7){_0x5606e4(null,_0x29d7c7);})[_0x7ae8('0x10')](function(_0x3fab25){_0x5606e4(_0x3fab25);});};AGIVertices['prototype'][_0x7ae8('0x76')]=function(_0x245981,_0x4e4bea){scripts[_0x7ae8('0x76')](_0x245981['key'],_0x245981[_0x7ae8('0x52')],_0x245981[_0x7ae8('0x77')]||'en-US',_0x245981[_0x7ae8('0x78')])[_0x7ae8('0xe')](function(_0x29c624){_0x4e4bea(null,_0x29c624);})[_0x7ae8('0x10')](function(_0x12623e){_0x4e4bea(_0x12623e);});};AGIVertices[_0x7ae8('0xc')]['ispeechASR']=function(_0x5bdc8f,_0x8bab09,_0x180f5f){scripts[_0x7ae8('0x79')](_0x8bab09,_0x5bdc8f[_0x7ae8('0x70')],_0x5bdc8f['ispeech_asr_language']||'en-US',this[_0x7ae8('0x7a')](_0x5bdc8f['model'])?_0x5bdc8f[_0x7ae8('0x7b')]:undefined)['then'](function(_0x4512e8){_0x180f5f(null,_0x4512e8);})[_0x7ae8('0x10')](function(_0x17d63b){_0x180f5f(_0x17d63b);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x7c')]=function(_0x246cf7,_0x3bb8ec){scripts[_0x7ae8('0x7c')](_0x246cf7['aws_access_key_id'],_0x246cf7[_0x7ae8('0x7d')],_0x246cf7['aws_polly_region'],_0x246cf7[_0x7ae8('0x7e')]||_0x7ae8('0x7f'),_0x246cf7['text'],_0x246cf7[_0x7ae8('0x80')]||_0x7ae8('0x52'))[_0x7ae8('0xe')](function(_0xc49a1e){_0x3bb8ec(null,_0xc49a1e);})[_0x7ae8('0x10')](function(_0x1ff159){_0x3bb8ec(_0x1ff159);});};AGIVertices['prototype'][_0x7ae8('0x81')]=function(_0x55e8f3,_0x256d30){scripts[_0x7ae8('0x81')](this[_0x7ae8('0x2c')][_0x7ae8('0x2d')],_0x55e8f3[_0x7ae8('0x82')],_0x55e8f3[_0x7ae8('0x7d')],_0x55e8f3[_0x7ae8('0x83')],_0x55e8f3[_0x7ae8('0x52')],_0x55e8f3[_0x7ae8('0x84')])['then'](function(_0x809057){_0x256d30(null,_0x809057);})[_0x7ae8('0x10')](function(_0x154325){_0x256d30(_0x154325);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x85')]=function(_0x72e2c3,_0x1e8b7a,_0x46e979){scripts['googleASR'](_0x1e8b7a,_0x72e2c3[_0x7ae8('0x70')],_0x72e2c3['google_asr_language']||_0x7ae8('0x54'))['then'](function(_0x37b712){_0x46e979(null,_0x37b712);})[_0x7ae8('0x10')](function(_0x1e561c){_0x46e979(_0x1e561c);});};AGIVertices['prototype'][_0x7ae8('0x86')]=function(_0xc668c1,_0x53e628,_0x15bf75){scripts[_0x7ae8('0x86')](_0x53e628,_0xc668c1[_0x7ae8('0x87')],_0xc668c1[_0x7ae8('0x88')],_0xc668c1[_0x7ae8('0x65')])[_0x7ae8('0xe')](function(_0x210be5){_0x15bf75(null,_0x210be5);})[_0x7ae8('0x10')](function(_0x2a6224){_0x15bf75(_0x2a6224);});};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x89')]=function(_0x29623a){var _0x438df1=_[_0x7ae8('0x5d')](verticesWithRetry,_0x29623a[_0x7ae8('0x2f')])?_0x29623a:_[_0x7ae8('0x8a')](_0x29623a);for(var _0x5bf395 in _0x438df1){if(_0x438df1[_0x7ae8('0x8b')](_0x5bf395)){if(_0x438df1[_0x5bf395]&&_[_0x7ae8('0x8c')](_0x438df1[_0x5bf395])){if(_[_0x7ae8('0x5d')](recursiveMapAttributes,_0x5bf395)){_0x438df1[_0x5bf395]=this[_0x7ae8('0x8d')](_0x438df1[_0x5bf395]);}else{_0x438df1[_0x5bf395]=this[_0x7ae8('0x8e')](_0x438df1[_0x5bf395]);}}}}return _0x438df1;};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x8f')]=function(_0x4d5064){for(var _0x5c116b in _0x4d5064){if(_0x4d5064[_0x7ae8('0x8b')](_0x5c116b)){if(_[_0x7ae8('0x90')](_0x4d5064[_0x5c116b])){this[_0x7ae8('0x8f')](_0x4d5064[_0x5c116b]);}else if(_[_0x7ae8('0x91')](_0x4d5064[_0x5c116b])){for(var _0xcc1fec=0x0;_0xcc1fec<_0x4d5064[_0x5c116b]['length'];_0xcc1fec++){this['recursiveNodeIndex'](_0x4d5064[_0x5c116b][_0xcc1fec]);}}else if(_[_0x7ae8('0x8c')](_0x4d5064[_0x5c116b])){_0x4d5064[_0x5c116b]=this['replaceAllVariables'](_0x4d5064[_0x5c116b]);}}}};AGIVertices[_0x7ae8('0xc')]['saveRestApiResult']=function(_0x51e76a,_0x480545){for(var _0x3a0dc0 in _0x51e76a){if(_0x51e76a[_0x7ae8('0x8b')](_0x3a0dc0)){if(_['isPlainObject'](_0x51e76a[_0x3a0dc0])){if(!_[_0x7ae8('0x39')](_0x51e76a[_0x3a0dc0])){this[_0x7ae8('0x92')](_0x51e76a[_0x3a0dc0],util['format'](_0x7ae8('0x93'),_0x480545,_0x3a0dc0));}}else if(_[_0x7ae8('0x91')](_0x51e76a[_0x3a0dc0])){for(var _0x3d97d8=0x0;_0x3d97d8<_0x51e76a[_0x3a0dc0][_0x7ae8('0x94')];_0x3d97d8++){this[_0x7ae8('0x92')](_0x51e76a[_0x3a0dc0][_0x3d97d8],util['format']('%s.%s',_0x480545,_0x3a0dc0+'['+_0x3d97d8+']'));}}else{if(!_['isNil'](_0x51e76a[_0x3a0dc0])){this['channel'][_0x7ae8('0x95')](util['format'](_0x7ae8('0x93'),_0x480545,_0x3a0dc0),_0x51e76a[_0x3a0dc0]);}}}}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x8d')]=function(_0x53f81e){try{var _0x4c61b7=JSON['parse'](_0x53f81e);this[_0x7ae8('0x8f')](_0x4c61b7);return JSON[_0x7ae8('0x96')](_0x4c61b7);}catch(_0x4ad3b8){return this[_0x7ae8('0x8e')](_0x53f81e);}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x8e')]=function(_0x3cabed){var _0x4b935b=_0x3cabed['split']('{');for(var _0x2f988b=0x1;_0x2f988b<_0x4b935b[_0x7ae8('0x94')];_0x2f988b+=0x1){var _0x472c85=_0x4b935b[_0x2f988b][_0x7ae8('0x97')]('}');if(_0x472c85[_0x7ae8('0x94')]>0x1){_0x3cabed=_0x3cabed[_0x7ae8('0x98')]('{'+_0x472c85[0x0]+'}',this['channel'][_0x7ae8('0x99')](_0x472c85[0x0])[_0x7ae8('0x9a')]||_0x472c85[0x0]);}}if(_0x4b935b['length']===0x1){return _0x3cabed['toString']();}return this[_0x7ae8('0x8e')](_0x3cabed);};AGIVertices['prototype'][_0x7ae8('0x9b')]=function(_0xfa1db7,_0x3f55eb){var _0x533407=this[_0x7ae8('0x2c')]['getVariable'](_0xfa1db7);if(_0x533407[_0x7ae8('0x9c')]===-0x1){return _0x533407;}logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x9d'),_0x3f55eb,_0x533407[_0x7ae8('0x9a')]));return this[_0x7ae8('0x2c')][_0x7ae8('0x95')](_0x3f55eb,_0x533407['extra']);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x7a')]=function(_0x3819b2){return _0x3819b2&&_0x3819b2!=='0'&&_0x3819b2!=='-1'&&_0x3819b2!=='';};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x9e')]=function(_0x1378a0){this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x1378a0,'-');_0x1378a0[_0x7ae8('0xa0')]=_0x1378a0[_0x7ae8('0x9e')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xa1')]=function(_0x24e8a0){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xa2'),_0x24e8a0[_0x7ae8('0x2e')]));if(!this['isConfigured'](_0x24e8a0['text'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}var _0x522e61='\x22'+_0x24e8a0['text']+'\x22';if(this[_0x7ae8('0x7a')](_0x24e8a0['options'])){_0x522e61+=','+_0x24e8a0['options'];}var _0x1f0d39=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0xa5'),_0x522e61);if(_0x1f0d39['result']===-0x1){return _0x1f0d39;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0xa6'),_0x522e61));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xa7')]=function(_0x11c47e){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xa8'),_0x11c47e['label']));if(!this[_0x7ae8('0x7a')](_0x11c47e[_0x7ae8('0xa9')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xaa'));}var _0x3ffd1a=_0x11c47e[_0x7ae8('0xa9')];if(this[_0x7ae8('0x7a')](_0x11c47e[_0x7ae8('0x6e')])){_0x3ffd1a+=','+_0x11c47e['options'];}var _0x5a2f4f=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0xab'),_0x3ffd1a);if(_0x5a2f4f[_0x7ae8('0x9c')]===-0x1){return _0x5a2f4f;}var _0x103313=this[_0x7ae8('0x9b')](_0x7ae8('0xac'),_0x7ae8('0xad'));if(_0x103313[_0x7ae8('0x9c')]===-0x1){return _0x103313;}var _0x456a51=this[_0x7ae8('0x9b')]('RECOG_INPUT()',_0x7ae8('0xae'));if(_0x456a51['result']===-0x1){return _0x456a51;}var _0x594a7a=this[_0x7ae8('0x9b')](_0x7ae8('0xaf'),_0x7ae8('0xb0'));if(_0x594a7a[_0x7ae8('0x9c')]===-0x1){return _0x594a7a;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0xb1'),_0x3ffd1a));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xb2')]=function(_0x1fd833){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xb3'),_0x1fd833[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')][_0x7ae8('0xb2')]([_0x1fd833['command'],_0x1fd833[_0x7ae8('0xb4')]]);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xb5')]=function(_0x356026){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0xb6'),_0x356026[_0x7ae8('0x2e')]));if(this[_0x7ae8('0x7a')](_0x356026[_0x7ae8('0x5c')])){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xb7'),_0x356026[_0x7ae8('0x5c')]));var _0x9cb6d2=this[_0x7ae8('0x2c')][_0x7ae8('0xb8')](_0x356026[_0x7ae8('0x5c')]);if(_0x9cb6d2[_0x7ae8('0x9c')]===-0x1){return _0x9cb6d2;}}return this['channel'][_0x7ae8('0xb5')]();};AGIVertices['prototype'][_0x7ae8('0x3e')]=function(_0x1e6a5f){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xb9'),_0x1e6a5f['label']));if(!this[_0x7ae8('0x7a')](_0x1e6a5f['list_id'])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x1e6a5f,'no\x20list\x20selected');}_0x1e6a5f[_0x7ae8('0x40')]=moment();if(this[_0x7ae8('0x7a')](_0x1e6a5f['delay'])){_0x1e6a5f[_0x7ae8('0x40')]=moment()[_0x7ae8('0xba')](_0x1e6a5f[_0x7ae8('0xbb')],_0x7ae8('0xbc'));}if(!this[_0x7ae8('0x7a')](_0x1e6a5f['callback_priority'])){_0x1e6a5f[_0x7ae8('0x42')]=0x2;}this[_0x7ae8('0x38')][_0x7ae8('0x9f')](this,_0x1e6a5f);return this['channel']['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xbd'),_0x1e6a5f[_0x7ae8('0x3d')],_0x1e6a5f[_0x7ae8('0xbe')],_0x1e6a5f['scheduledAt']));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xbf')]=function(_0x34550d){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xc0'),_0x34550d['label']));var _0x2890e2=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x34550d[_0x7ae8('0xc1')],_0x34550d[_0x7ae8('0x6e')]);if(_0x2890e2[_0x7ae8('0x9c')]===-0x1){return _0x2890e2;}return this['channel']['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xc2'),_0x34550d[_0x7ae8('0xc1')],_0x34550d[_0x7ae8('0x6e')]));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xc3')]=function(_0x105d44){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xc4'),_0x105d44[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x105d44[_0x7ae8('0x52')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}var _0x53881c='\x22'+_0x105d44['text']+'\x22';if(this['isConfigured'](_0x105d44['options'])){_0x53881c+=','+_0x105d44[_0x7ae8('0x6e')];}var _0x913f7=this[_0x7ae8('0x2c')]['exec'](_0x7ae8('0xa5'),_0x53881c);if(_0x913f7['result']===-0x1){return _0x913f7;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xa6'),_0x53881c));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xc5')]=function(_0x401eb4){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x401eb4[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x401eb4['text'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}var _0xcbeab8='\x22'+_0x401eb4[_0x7ae8('0x52')]+'\x22';if(this[_0x7ae8('0x7a')](_0x401eb4[_0x7ae8('0x6e')])){_0xcbeab8+=','+_0x401eb4['options'];}var _0x14751a=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0xa5'),_0xcbeab8);if(_0x14751a['result']===-0x1){return _0x14751a;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xa6'),_0xcbeab8));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xc6')]=function(_0x193f29){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xc7'),_0x193f29[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x193f29['grammar'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xaa'));}var _0xd5c525=_0x193f29[_0x7ae8('0xa9')];if(this['isConfigured'](_0x193f29['options'])){_0xd5c525+=','+_0x193f29['options'];}var _0x1728ef=this[_0x7ae8('0x2c')]['exec']('MRCPRecog',_0xd5c525);if(_0x1728ef[_0x7ae8('0x9c')]===-0x1){return _0x1728ef;}var _0x2dc38f=this[_0x7ae8('0x9b')](_0x7ae8('0xac'),_0x7ae8('0xc8'));if(_0x2dc38f[_0x7ae8('0x9c')]===-0x1){return _0x2dc38f;}var _0x46e414=this[_0x7ae8('0x9b')](_0x7ae8('0xc9'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x46e414['result']===-0x1){return _0x46e414;}var _0x175380=this[_0x7ae8('0x9b')](_0x7ae8('0xaf'),_0x7ae8('0xca'));if(_0x175380['result']===-0x1){return _0x175380;}return this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xb1'),_0xd5c525));};AGIVertices[_0x7ae8('0xc')]['sestekasr']=function(_0x469977){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0xcb'),_0x469977[_0x7ae8('0x2e')]));if(!this['isConfigured'](_0x469977['grammar'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xaa'));}var _0x501cb3=_0x469977[_0x7ae8('0xa9')];if(this[_0x7ae8('0x7a')](_0x469977[_0x7ae8('0x6e')])){_0x501cb3+=','+_0x469977[_0x7ae8('0x6e')];}var _0x32730a=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0xab'),_0x501cb3);if(_0x32730a[_0x7ae8('0x9c')]===-0x1){return _0x32730a;}var _0x2f4e57=this[_0x7ae8('0x9b')](_0x7ae8('0xac'),'SESTEK_ASR_CONFIDENCE');if(_0x2f4e57[_0x7ae8('0x9c')]===-0x1){return _0x2f4e57;}var _0x1e85a5=this[_0x7ae8('0x9b')](_0x7ae8('0xc9'),_0x7ae8('0xcc'));if(_0x1e85a5['result']===-0x1){return _0x1e85a5;}var _0x42d0d8=this[_0x7ae8('0x9b')](_0x7ae8('0xaf'),_0x7ae8('0xcd'));if(_0x42d0d8['result']===-0x1){return _0x42d0d8;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('Executed\x20command\x20MRCPRecog\x20%s',_0x501cb3));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xce')]=function(_0x3e3651){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xcf'),_0x3e3651[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x3e3651['odbc_id'])){return this[_0x7ae8('0x2c')]['error'](_0x3e3651,'no\x20database\x20selected');}var _0x3fbb38=this[_0x7ae8('0x14')]['sync'](this,_0x3e3651[_0x7ae8('0xd0')]);if(!_0x3fbb38){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x3e3651,'no\x20odbc\x20database\x20found');}if(!this[_0x7ae8('0x7a')](_0x3e3651['query'])){return this[_0x7ae8('0x2c')]['error'](_0x3e3651,_0x7ae8('0xd1'));}var _0x48b225=_0x3e3651[_0x7ae8('0xd2')][_0x7ae8('0x4f')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xd3'),_0x48b225));var _0x5aae1e=this['getQueryOdbc'][_0x7ae8('0x9f')](this,_0x3fbb38,_0x48b225);this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x3e3651,_0x48b225);if(!this[_0x7ae8('0x7a')](_0x3e3651['variable_id'])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xd4'));}var _0x55b077=this[_0x7ae8('0x99')][_0x7ae8('0x9f')](this,_0x3e3651[_0x7ae8('0xd5')]);if(!_0x55b077){return this[_0x7ae8('0x2c')]['error'](_0x3e3651,_0x7ae8('0xd6'));}var _0x9a87b9=this;_0x5aae1e[_0x7ae8('0xd7')](function(_0x163812,_0x5a2cde){Object[_0x7ae8('0xd8')](_0x163812)[_0x7ae8('0xd7')](function(_0x525856){_0x9a87b9[_0x7ae8('0x2c')][_0x7ae8('0x95')](util[_0x7ae8('0x21')](_0x7ae8('0xd9'),_0x55b077,_0x5a2cde,_0x525856),_0x163812[_0x525856]);});});this['channel'][_0x7ae8('0x95')](util[_0x7ae8('0x21')]('%s_ROWS_COUNT',_0x55b077),_0x5aae1e[_0x7ae8('0x94')]);return this[_0x7ae8('0x2c')]['noop'](util['format'](_0x7ae8('0xda'),_0x55b077));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xdb')]=function(_0x261c05){logger[_0x7ae8('0xdc')](util['format'](_0x7ae8('0xdd'),_0x261c05[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x261c05[_0x7ae8('0xde')])){return this[_0x7ae8('0x2c')]['error'](_0x261c05,_0x7ae8('0xdf'));}var _0x714684=this[_0x7ae8('0x17')][_0x7ae8('0x9f')](this,_0x261c05[_0x7ae8('0xde')]);if(!_0x714684){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x261c05,_0x7ae8('0xe0'));}var _0x464dcb=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0xe1'),[util[_0x7ae8('0x21')]('SIP/%s',_0x714684),_0x261c05[_0x7ae8('0x5c')],_0x261c05['opts'],_0x261c05[_0x7ae8('0x67')]]);if(_0x464dcb['result']===-0x1){return _0x464dcb;}return this['channel']['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xe2'),'DIAL'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xe3')]=function(_0x51cc35){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xe4'),_0x51cc35[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x51cc35['key'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xe5'));}if(!this[_0x7ae8('0x7a')](_0x51cc35[_0x7ae8('0x52')])){return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}this['channel'][_0x7ae8('0xe6')]=!![];this[_0x7ae8('0x2b')](_0x51cc35);this['createSquareMessage'](_0x51cc35[_0x7ae8('0x52')],'in','','');this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xe7'),_0x51cc35['text']));var _0x10160b=this[_0x7ae8('0x6f')][_0x7ae8('0x9f')](this,_0x51cc35);if(_0x10160b){for(var _0x4fe4cb in _0x10160b){if(_0x10160b[_0x7ae8('0x8b')](_0x4fe4cb)){this[_0x7ae8('0x2c')]['setVariable'](util[_0x7ae8('0x21')](_0x7ae8('0xe8'),_0x4fe4cb[_0x7ae8('0xe9')]()),_0x10160b[_0x4fe4cb]);}}this[_0x7ae8('0x37')](_0x10160b[_0x7ae8('0xea')],_0x7ae8('0xeb'),'dialogflow','');return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xec'),_0x10160b[_0x7ae8('0xea')]));}return this[_0x7ae8('0x2c')]['error'](_0x51cc35,_0x7ae8('0xed'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0xee')]=function(_0x233404){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0xef'),_0x233404[_0x7ae8('0x2e')]));if(!this['isConfigured'](_0x233404[_0x7ae8('0x73')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xf0'));}if(!this[_0x7ae8('0x7a')](_0x233404[_0x7ae8('0xf1')])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xf2'));}if(!this[_0x7ae8('0x7a')](_0x233404['private_key'])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xf3'));}if(!this[_0x7ae8('0x7a')](_0x233404['dialogflowV2_language'])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xf4'));}if(!this[_0x7ae8('0x7a')](_0x233404[_0x7ae8('0x52')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}this[_0x7ae8('0x2c')][_0x7ae8('0xe6')]=!![];this[_0x7ae8('0x2b')](_0x233404);this[_0x7ae8('0x37')](_0x233404[_0x7ae8('0x52')],'in','','');this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0xf5'),_0x233404[_0x7ae8('0x52')]));var _0x4202a8=this[_0x7ae8('0x72')][_0x7ae8('0x9f')](this,_0x233404);if(_0x4202a8){for(var _0x4edc6b in _0x4202a8){if(_0x4202a8[_0x7ae8('0x8b')](_0x4edc6b)){if(_0x4edc6b!=='providerResponse'){this[_0x7ae8('0x2c')][_0x7ae8('0x95')](util[_0x7ae8('0x21')]('DIALOGFLOW_%s',_0x4edc6b[_0x7ae8('0xe9')]()),_0x4202a8[_0x4edc6b]);}}}this[_0x7ae8('0x37')](_0x4202a8[_0x7ae8('0xea')],_0x7ae8('0xeb'),_0x7ae8('0xee'),_0x4202a8[_0x7ae8('0xf6')]);return this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xf7'),_0x4202a8['speech']));}return this['channel'][_0x7ae8('0x24')](_0x233404,_0x7ae8('0xf8'));};AGIVertices['prototype'][_0x7ae8('0xf9')]=function(_0x171401){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x171401['label']));if(!this['isConfigured'](_0x171401[_0x7ae8('0xfa')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xfb'));}if(!this[_0x7ae8('0x7a')](_0x171401['username'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xfc'));}if(!this[_0x7ae8('0x7a')](_0x171401['password'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xfd'));}if(!this[_0x7ae8('0x7a')](_0x171401[_0x7ae8('0xfe')])){return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}this['channel']['bot']=!![];this[_0x7ae8('0x2b')](_0x171401);this[_0x7ae8('0x37')](_0x171401[_0x7ae8('0x52')],'in','','');this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xff'),_0x171401['text']));var _0x592967=this[_0x7ae8('0x75')]['sync'](this,_0x171401);if(_0x592967){for(var _0x361f7a in _0x592967){if(_0x592967[_0x7ae8('0x8b')](_0x361f7a)){this['channel'][_0x7ae8('0x95')](util['format'](_0x7ae8('0x100'),_0x361f7a[_0x7ae8('0xe9')]()),_0x592967[_0x361f7a]);}}this['createSquareMessage'](_0x592967[_0x7ae8('0xea')],'out',_0x7ae8('0xf9'),'');if(_0x592967[_0x7ae8('0x101')]){this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x102'),_0x592967[_0x7ae8('0x101')]));var _0xed9c5c=this[_0x7ae8('0x2c')][_0x7ae8('0x103')](_0x592967[_0x7ae8('0x101')]);try{fs[_0x7ae8('0x104')](_0x592967[_0x7ae8('0x101')]+_0x7ae8('0x105'));}catch(_0x4a9906){logger[_0x7ae8('0x24')](_0x4a9906);}return _0xed9c5c;}else{return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x106'),_0x592967[_0x7ae8('0xea')]));}}return this['channel'][_0x7ae8('0x24')](_0x171401,_0x7ae8('0x107'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x108')]=function(_0x2f8bdd){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x109'),_0x2f8bdd[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')]('end');};AGIVertices[_0x7ae8('0xc')]['ext_dial']=function(_0x411ffc){logger['info'](util['format'](_0x7ae8('0x10a'),_0x411ffc['label']));var _0x58506f='';if(_0x411ffc[_0x7ae8('0x10b')]){if(!this[_0x7ae8('0x7a')](_0x411ffc[_0x7ae8('0x10b')])){return this[_0x7ae8('0x2c')]['error'](_0x411ffc,_0x7ae8('0x10c'));}else{var _0x57b96d=parseInt(_0x411ffc[_0x7ae8('0x10b')],0xa);if(isNaN(_0x57b96d)){_0x58506f=_0x411ffc[_0x7ae8('0x10b')];}else{_0x58506f=this[_0x7ae8('0x19')][_0x7ae8('0x9f')](this,_0x411ffc[_0x7ae8('0x10b')]);if(!_0x58506f){return this['channel']['error'](_0x411ffc,'no\x20trunk\x20found');}}}}else if(_0x411ffc['trunk_name']){_0x58506f=_0x411ffc[_0x7ae8('0x10d')];}else{return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x411ffc,_0x7ae8('0x10c'));}var _0x414eab=this[_0x7ae8('0x2c')]['exec'](_0x7ae8('0xe1'),[util[_0x7ae8('0x21')]('SIP/%s/%s',_0x58506f,_0x411ffc[_0x7ae8('0x3d')]),_0x411ffc['timeout'],_0x411ffc[_0x7ae8('0x10e')],_0x411ffc[_0x7ae8('0x67')]]);if(_0x414eab[_0x7ae8('0x9c')]===-0x1){return _0x414eab;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0xe2'),_0x7ae8('0xe1')));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x10f')]=function(_0x40a2c0){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x110'),_0x40a2c0[_0x7ae8('0x2e')]));return this['channel'][_0x7ae8('0xa3')]('finally');};AGIVertices[_0x7ae8('0xc')]['getdigits']=function(_0x29b3f2){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x29b3f2[_0x7ae8('0x2e')]));if(_0x29b3f2[_0x7ae8('0xa0')]===0x0){return this['maxRetry'](_0x29b3f2);}_0x29b3f2[_0x7ae8('0xa0')]-=0x1;if(!this['isConfigured'](_0x29b3f2[_0x7ae8('0x111')])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x29b3f2,_0x7ae8('0x112'));}var _0x54a59f=this[_0x7ae8('0x113')][_0x7ae8('0x9f')](this,_0x29b3f2[_0x7ae8('0x111')]);if(!_0x54a59f){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x29b3f2,_0x7ae8('0x114'));}if(!this[_0x7ae8('0x7a')](_0x29b3f2[_0x7ae8('0xd5')])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x7ae8('0xd4'));}var _0x179f9e=this[_0x7ae8('0x2c')][_0x7ae8('0x115')](_0x54a59f,_0x29b3f2[_0x7ae8('0x116')],_0x29b3f2[_0x7ae8('0x117')]);var _0x263017=_0x179f9e[_0x7ae8('0x9c')]?_0x179f9e[_0x7ae8('0x9c')][_0x7ae8('0x41')]():'';logger['info']('test',JSON['stringify'](_0x179f9e));if(_0x179f9e[_0x7ae8('0x9c')]===-0x1){this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x29b3f2,_0x263017);return _0x179f9e;}else if(_0x179f9e[_0x7ae8('0x9a')]===_0x7ae8('0x5c')){_0x179f9e[_0x7ae8('0x9c')]=_0x263017[_0x7ae8('0x94')]>=parseInt(_0x29b3f2['mindigit'])?'x':'i';}else{_0x179f9e[_0x7ae8('0x9c')]=_0x263017[_0x7ae8('0x94')]>=parseInt(_0x29b3f2['mindigit'])&&_0x263017[_0x7ae8('0x94')]<=parseInt(_0x29b3f2[_0x7ae8('0x117')])?'x':'i';}var _0x2d1a48=this[_0x7ae8('0x99')]['sync'](this,_0x29b3f2[_0x7ae8('0xd5')]);if(!_0x2d1a48){return this[_0x7ae8('0x2c')]['error'](_0x29b3f2,_0x7ae8('0xd6'));}this[_0x7ae8('0x2c')][_0x7ae8('0x95')](_0x2d1a48,_0x263017);if(this[_0x7ae8('0x7a')](_0x29b3f2['hiddendigitsnum'])){var _0x2b9a85=parseInt(_0x29b3f2['hiddendigitsnum'],0xa);var _0xbb5971=rs[_0x7ae8('0x118')]({'charset':'*','length':_0x2b9a85});var _0x4697cf=_0x263017[_0x7ae8('0x94')];if(_0x4697cf>0x0){if(_0x4697cf>_0x2b9a85){this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x29b3f2,_0x29b3f2[_0x7ae8('0x119')]===_0x7ae8('0x11a')?_0xbb5971+_0x263017[_0x7ae8('0x11b')](_0x2b9a85):_0x263017[_0x7ae8('0x11b')](0x0,_0x4697cf-_0x2b9a85)+_0xbb5971);}else{this['createSquareDetailsReport']['sync'](this,_0x29b3f2,rs[_0x7ae8('0x118')]({'charset':'*','length':_0x4697cf}));}}else{this['createSquareDetailsReport']['sync'](this,_0x29b3f2,'');}}else{this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x29b3f2,_0x263017);}return _0x179f9e;};AGIVertices['prototype'][_0x7ae8('0xa')]=function(_0x176297){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x11c'),_0x176297['label']));return this[_0x7ae8('0x9')](_0x176297);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x11d')]=function(_0x38f2c7){logger[_0x7ae8('0x25')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x38f2c7[_0x7ae8('0x2e')]));this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x38f2c7,_0x38f2c7['goalname']);return this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x11e'),_0x38f2c7[_0x7ae8('0x11f')]));};AGIVertices[_0x7ae8('0xc')]['awspolly']=function(_0x5c8d1f){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x120'),_0x5c8d1f[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x5c8d1f[_0x7ae8('0x82')])||!this[_0x7ae8('0x7a')](_0x5c8d1f['aws_secret_access_key'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x121'));}if(!this[_0x7ae8('0x7a')](_0x5c8d1f[_0x7ae8('0x52')])){return this['channel'][_0x7ae8('0xa3')]('no\x20text\x20configured');}this[_0x7ae8('0x2c')]['noop'](util['format'](_0x7ae8('0x122'),_0x5c8d1f[_0x7ae8('0x52')]));var _0xbb257d=this[_0x7ae8('0x7c')]['sync'](this,_0x5c8d1f);if(_0xbb257d){this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x123'),_0xbb257d));var _0x134c70=this[_0x7ae8('0x2c')][_0x7ae8('0x103')](_0xbb257d);try{fs[_0x7ae8('0x104')](_0xbb257d+_0x7ae8('0x105'));}catch(_0x41a277){logger[_0x7ae8('0x24')](_0x41a277);}return _0x134c70;}return this[_0x7ae8('0x2c')]['error'](_0x5c8d1f,_0x7ae8('0x124'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x125')]=function(_0x3a050a){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x126'),_0x3a050a[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x3a050a['aws_access_key_id'])||!this[_0x7ae8('0x7a')](_0x3a050a[_0x7ae8('0x7d')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x121'));}if(!this[_0x7ae8('0x7a')](_0x3a050a['aws_bot_name'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')]('no\x20bot\x20name\x20configured');}if(!this[_0x7ae8('0x7a')](_0x3a050a[_0x7ae8('0x52')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xa4'));}this['channel'][_0x7ae8('0xe6')]=!![];this[_0x7ae8('0x2b')](_0x3a050a);this['createSquareMessage'](_0x3a050a['text'],'in','','');this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3a050a[_0x7ae8('0x52')]));var _0x508bac=this['awsLex'][_0x7ae8('0x9f')](this,_0x3a050a);if(_0x508bac){for(var _0x4439e2 in _0x508bac){if(_0x508bac[_0x7ae8('0x8b')](_0x4439e2)&&_[_0x7ae8('0x8c')](_0x508bac[_0x4439e2])){this[_0x7ae8('0x2c')]['setVariable'](util['format'](_0x7ae8('0x127'),_0x4439e2[_0x7ae8('0xe9')]()),_0x508bac[_0x4439e2]);}}if(_[_0x7ae8('0x3a')](_0x508bac[_0x7ae8('0x6d')])){return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0x128'));}else{this['createSquareMessage'](_0x508bac[_0x7ae8('0x6d')],_0x7ae8('0xeb'),'amazonlex','');return this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x129'),_0x508bac[_0x7ae8('0x6d')]));}}return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x3a050a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x7ae8('0xc')]['googleasr']=function(_0x5125ac){logger['info'](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5125ac['label'],_0x5125ac[_0x7ae8('0x5c')]));if(!this[_0x7ae8('0x7a')](_0x5125ac[_0x7ae8('0x70')])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xe5'));}var _0xed3e7f=_0x7ae8('0x12a');var _0x7ea84e=util[_0x7ae8('0x21')]('%s/recordings/%s',FILES_PATH,rs[_0x7ae8('0x118')](0x4));var _0x548d4d=util[_0x7ae8('0x21')](_0x7ae8('0x93'),_0x7ea84e,_0xed3e7f);var _0xc79861=!![];if(_0x5125ac[_0x7ae8('0x12b')]==='NOBEEP'){_0xc79861=![];}var _0x2dde13=this[_0x7ae8('0x2c')][_0x7ae8('0x12c')](_0x7ea84e,_0xed3e7f,_0x5125ac[_0x7ae8('0x12d')],_0x5125ac[_0x7ae8('0x5c')],undefined,_0xc79861);if(_0x2dde13['result']!==-0x1){this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0x12e'),_0x548d4d));var _0x12cee3=this[_0x7ae8('0x85')][_0x7ae8('0x9f')](this,_0x5125ac,_0x548d4d);if(_0x12cee3){for(var _0x533ebe in _0x12cee3){if(_0x12cee3['hasOwnProperty'](_0x533ebe)){this[_0x7ae8('0x2c')][_0x7ae8('0x95')](util['format'](_0x7ae8('0x12f'),_0x533ebe[_0x7ae8('0xe9')]()),_0x12cee3[_0x533ebe]);}}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x130'),JSON[_0x7ae8('0x96')](_0x12cee3)));}}return _0x2dde13;};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x131')]=function(_0x41ef63){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x132'),_0x41ef63[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x41ef63[_0x7ae8('0x87')])){return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0x133'));}if(!this['isConfigured'](_0x41ef63[_0x7ae8('0x88')])){return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0x134'));}var _0x4830fa=_0x7ae8('0x12a');var _0x578f2e=util[_0x7ae8('0x21')]('%s/recordings/%s',FILES_PATH,rs[_0x7ae8('0x118')](0x4));var _0x47e34f=util[_0x7ae8('0x21')]('%s.%s',_0x578f2e,_0x4830fa);var _0x420d67=!![];if(_0x41ef63[_0x7ae8('0x12b')]===_0x7ae8('0x135')){_0x420d67=![];}var _0x3ff7d1=this[_0x7ae8('0x2c')][_0x7ae8('0x12c')](_0x578f2e,_0x4830fa,_0x41ef63['intKey'],_0x41ef63['timeout'],undefined,_0x420d67);if(_0x3ff7d1['result']!==-0x1){this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x136'),_0x47e34f));var _0x134814=this[_0x7ae8('0x86')]['sync'](this,_0x41ef63,_0x47e34f);if(_0x134814){for(var _0xd15ed3 in _0x134814){if(_0x134814[_0x7ae8('0x8b')](_0xd15ed3)){this[_0x7ae8('0x2c')][_0x7ae8('0x95')](util[_0x7ae8('0x21')](_0x7ae8('0x137'),_0xd15ed3[_0x7ae8('0xe9')]()),_0x134814[_0xd15ed3]);}}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x138'),JSON[_0x7ae8('0x96')](_0x134814)));}}return _0x3ff7d1;};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x139')]=function(_0x39f414){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x13a'),_0x39f414[_0x7ae8('0x2e')]));return this['channel'][_0x7ae8('0x13b')](_0x39f414[_0x7ae8('0x13c')],_0x39f414['extension'],_0x39f414[_0x7ae8('0x35')]);};AGIVertices[_0x7ae8('0xc')]['gotoif']=function(_0x2a33cd){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2a33cd[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x2a33cd[_0x7ae8('0x13d')])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x2a33cd,_0x7ae8('0x13e'));}try{var _0x2e8f0e=eval(_0x2a33cd['condition'])?_0x7ae8('0x13f'):_0x7ae8('0x140');this['channel']['noop'](util[_0x7ae8('0x21')](_0x7ae8('0x141'),_0x2a33cd[_0x7ae8('0x13d')],_0x2e8f0e));return{'code':0xc8,'result':_0x2e8f0e};}catch(_0x97aa01){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x142')]=function(_0x2ac217){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x143'),_0x2ac217[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x2ac217[_0x7ae8('0x144')])){return this['channel'][_0x7ae8('0x24')](_0x2ac217,_0x7ae8('0x145'));}var _0x4cecfb=this[_0x7ae8('0x146')][_0x7ae8('0x9f')](this,_0x2ac217[_0x7ae8('0x144')]);if(!_0x4cecfb){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x2ac217,'no\x20intervals\x20found');}for(var _0x4faeb9=0x0;_0x4faeb9<_0x4cecfb[_0x7ae8('0x94')];_0x4faeb9+=0x1){var _0x3e1513=this[_0x7ae8('0x2c')][_0x7ae8('0x99')](util['format'](_0x7ae8('0x147'),_0x4cecfb[_0x4faeb9]));if(_0x3e1513[_0x7ae8('0x9c')]===-0x1){return _0x3e1513;}logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x148'),_0x4cecfb[_0x4faeb9],_0x3e1513['extra']));if(_0x3e1513[_0x7ae8('0x9a')]===_0x7ae8('0x13f')){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x148'),_0x4cecfb[_0x4faeb9],_0x7ae8('0x13f')));this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x148'),_0x4cecfb[_0x4faeb9],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util['format'](_0x7ae8('0x148'),_0x4cecfb[_0x4faeb9],_0x7ae8('0x140')));this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0x148'),_0x4cecfb[_0x4faeb9],_0x7ae8('0x140')));}}return{'code':0xc8,'result':_0x7ae8('0x140')};};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x149')]=function(_0x4ec3f4){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x14a'),_0x4ec3f4[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')]['hangup']();};AGIVertices['prototype'][_0x7ae8('0x14b')]=function(_0x362a50){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x14c'),_0x362a50['label']));if(!this[_0x7ae8('0x7a')](_0x362a50[_0x7ae8('0x70')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xe5'));}var _0x3f3a08='wav';var _0x52ea11=util[_0x7ae8('0x21')](_0x7ae8('0x14d'),FILES_PATH,rs[_0x7ae8('0x118')](0x4));var _0x74b752=util['format'](_0x7ae8('0x93'),_0x52ea11,_0x3f3a08);var _0x43e28b=!![];if(_0x362a50[_0x7ae8('0x12b')]===_0x7ae8('0x135')){_0x43e28b=![];}var _0x52b611=this['channel'][_0x7ae8('0x12c')](_0x52ea11,_0x3f3a08,_0x362a50['intKey'],_0x362a50[_0x7ae8('0x5c')],undefined,_0x43e28b);if(_0x52b611[_0x7ae8('0x9c')]!==-0x1){this['channel']['noop'](util[_0x7ae8('0x21')](_0x7ae8('0x14e'),_0x74b752));var _0x69e393=this[_0x7ae8('0x79')]['sync'](this,_0x362a50,_0x74b752);if(_0x69e393){for(var _0x23cf9a in _0x69e393){if(_0x69e393['hasOwnProperty'](_0x23cf9a)){this[_0x7ae8('0x2c')][_0x7ae8('0x95')](util[_0x7ae8('0x21')](_0x7ae8('0x14f'),_0x23cf9a[_0x7ae8('0xe9')]()),_0x69e393[_0x23cf9a]);}}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('IspeechASR\x20Result\x20%s',JSON[_0x7ae8('0x96')](_0x69e393)));}}return _0x52b611;};AGIVertices['prototype'][_0x7ae8('0x150')]=function(_0x22912e){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x151'),_0x22912e['label']));if(!this['isConfigured'](_0x22912e['key'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xe5'));}if(!this[_0x7ae8('0x7a')](_0x22912e[_0x7ae8('0x52')])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xa4'));}this['channel'][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x152'),_0x22912e[_0x7ae8('0x52')]));var _0x853912=this['ispeechTTS'][_0x7ae8('0x9f')](this,_0x22912e);if(_0x853912){this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x14e'),_0x853912));var _0x23e5ce=this['channel'][_0x7ae8('0x103')](_0x853912,_0x22912e[_0x7ae8('0x12d')]);try{fs['unlink'](_0x853912+_0x7ae8('0x105'));}catch(_0x51caf8){logger[_0x7ae8('0x24')](_0x51caf8);}return _0x23e5ce;}return this[_0x7ae8('0x2c')]['error'](_0x22912e,_0x7ae8('0x153'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x154')]=function(_0x2a94cd){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x155'),_0x2a94cd[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x2a94cd[_0x7ae8('0x156')])){return this['channel'][_0x7ae8('0x24')](_0x2a94cd,_0x7ae8('0x157'));}logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x158'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x2a94cd[_0x7ae8('0x156')]));var _0x1173ee=this[_0x7ae8('0x49')][_0x7ae8('0x9f')](this,_0x2a94cd['findBy']);if(_0x1173ee){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x2a94cd[_0x7ae8('0x156')]));this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x159'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x2a94cd['findBy']));return{'code':0xc8,'result':_0x7ae8('0x15a')};}else{logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x15b'),this['channel'][_0x7ae8('0x31')],_0x2a94cd[_0x7ae8('0x156')]));this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')]['callerid'],_0x2a94cd[_0x7ae8('0x156')]));return{'code':0xc8,'result':_0x7ae8('0x15c')};}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x15d')]=function(_0x431e79){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x15e'),_0x431e79[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x431e79[_0x7ae8('0x156')])){return this['channel'][_0x7ae8('0x24')](_0x431e79,_0x7ae8('0x157'));}logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x158'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x431e79[_0x7ae8('0x156')]));var _0x32868b=this['agentLogout'][_0x7ae8('0x9f')](this,_0x431e79[_0x7ae8('0x156')]);if(_0x32868b){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x431e79[_0x7ae8('0x156')]));this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x431e79[_0x7ae8('0x156')]));return{'code':0xc8,'result':_0x7ae8('0x15a')};}else{logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x431e79[_0x7ae8('0x156')]));this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x431e79[_0x7ae8('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x15f')]=function(_0x2f6928){logger['info'](util['format'](_0x7ae8('0x160'),_0x2f6928['label']));if(!this['isConfigured'](_0x2f6928['operation'])){return this[_0x7ae8('0x2c')]['error'](_0x2f6928,_0x7ae8('0x161'));}this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('math\x20%s',_0x2f6928[_0x7ae8('0x162')]));var _0x38de44=eval(_0x2f6928[_0x7ae8('0x162')]);if(!this[_0x7ae8('0x7a')](_0x2f6928[_0x7ae8('0xd5')])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xd4'));}var _0x2898b5=this['getVariable'][_0x7ae8('0x9f')](this,_0x2f6928[_0x7ae8('0xd5')]);if(!_0x2898b5){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x2f6928,_0x7ae8('0xd6'));}if(_[_0x7ae8('0x91')](_0x38de44)){var _0x586af7=this;_0x38de44[_0x7ae8('0xd7')](function(_0x28c264,_0x4bc24e){_0x586af7[_0x7ae8('0x2c')][_0x7ae8('0x95')](util[_0x7ae8('0x21')](_0x7ae8('0x163'),_0x2898b5,_0x4bc24e),_0x28c264);});return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x164'),_0x2898b5));}else{return this['channel'][_0x7ae8('0x95')](_0x2898b5,_0x38de44);}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x8')]=function(_0x53cad4){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x165'),_0x53cad4[_0x7ae8('0x2e')]));if(_0x53cad4[_0x7ae8('0xa0')]===0x0){return this['maxRetry'](_0x53cad4);}_0x53cad4[_0x7ae8('0xa0')]-=0x1;if(!this[_0x7ae8('0x7a')](_0x53cad4['file_id'])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x53cad4,'no\x20file\x20audio\x20selected');}var _0x3b85fe=this[_0x7ae8('0x113')][_0x7ae8('0x9f')](this,_0x53cad4[_0x7ae8('0x111')]);if(!_0x3b85fe){return this[_0x7ae8('0x2c')]['error'](_0x53cad4,_0x7ae8('0x114'));}var _0x191866=this[_0x7ae8('0x2c')][_0x7ae8('0x115')](_0x3b85fe,_0x53cad4[_0x7ae8('0x116')],_0x53cad4['digit']);var _0x2d3602=_0x191866['result'];if(_0x191866[_0x7ae8('0x9c')]===-0x1){this['createSquareDetailsReport'][_0x7ae8('0x9f')](this,_0x53cad4,'-1');return _0x191866;}else if(_0x191866[_0x7ae8('0x9a')]===_0x7ae8('0x5c')){_0x191866['result']=_0x191866['result'][_0x7ae8('0x94')]>0x0?_0x191866[_0x7ae8('0x9c')]:'t';}else if(_['isEmpty'](_0x191866[_0x7ae8('0x9c')])){_0x191866[_0x7ae8('0x9c')]='#';_0x2d3602='#';}if(!this[_0x7ae8('0x7a')](_0x53cad4[_0x7ae8('0xd5')])){this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0xd4'));}else{var _0x293f86=this['getVariable'][_0x7ae8('0x9f')](this,_0x53cad4[_0x7ae8('0xd5')]);if(!_0x293f86){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x53cad4,_0x7ae8('0xd6'));}this[_0x7ae8('0x2c')]['setVariable'](_0x293f86,_0x2d3602);}this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x53cad4,_0x2d3602);return _0x191866;};AGIVertices['prototype'][_0x7ae8('0xa3')]=function(_0x145dad){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x166'),_0x145dad[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')]['noop'](_0x145dad[_0x7ae8('0x167')]||_0x145dad[_0x7ae8('0x2e')]);};AGIVertices['prototype'][_0x7ae8('0x168')]=function(_0x3e4ca0){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x169'),_0x3e4ca0[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x3e4ca0['findBy'])){return this[_0x7ae8('0x2c')]['error'](_0x3e4ca0,'no\x20find\x20by\x20configured');}logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x158'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x3e4ca0[_0x7ae8('0x156')]));var _0x344190=this['getPause'][_0x7ae8('0x9f')](this,_0x3e4ca0[_0x7ae8('0x16a')]);var _0x2b782a=this['agentPause']['sync'](this,_0x3e4ca0['findBy'],_0x344190);if(_0x2b782a){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this['channel'][_0x7ae8('0x31')],_0x3e4ca0[_0x7ae8('0x156')]));this[_0x7ae8('0x2c')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x3e4ca0[_0x7ae8('0x156')]));return{'code':0xc8,'result':_0x7ae8('0x15a')};}else{logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x3e4ca0['findBy']));this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this['channel'][_0x7ae8('0x31')],_0x3e4ca0[_0x7ae8('0x156')]));return{'code':0xc8,'result':_0x7ae8('0x15c')};}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x16b')]=function(_0x2e23bd){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x16c'),_0x2e23bd[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x2e23bd['file_id'])){return this[_0x7ae8('0x2c')]['error'](_0x2e23bd,'no\x20file\x20audio\x20selected');}var _0x190e29=this['getSound']['sync'](this,_0x2e23bd['file_id']);if(!_0x190e29){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x2e23bd,_0x7ae8('0x114'));}var _0x1fbeef=this[_0x7ae8('0x2c')]['exec'](_0x7ae8('0x16d'),[_0x190e29,_0x2e23bd[_0x7ae8('0x10e')]]);if(_0x1fbeef[_0x7ae8('0x9c')]===-0x1){return _0x1fbeef;}return this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xc2'),_0x7ae8('0x16d'),_0x190e29));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x16e')]=function(_0x4dd6f3){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x16f'),_0x4dd6f3['label']));if(!this[_0x7ae8('0x7a')](_0x4dd6f3['queue_id'])){return this['channel']['error'](_0x4dd6f3,_0x7ae8('0x170'));}var _0x6d8f38='';var _0x2487a1=parseInt(_0x4dd6f3['queue_id'],0xa);if(isNaN(_0x2487a1)){_0x6d8f38=_0x4dd6f3[_0x7ae8('0x171')];}else{_0x6d8f38=this['getVoiceQueue']['sync'](this,_0x4dd6f3[_0x7ae8('0x171')]);if(!_0x6d8f38){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x4dd6f3,_0x7ae8('0x172'));}}var _0x2e788f='';if(this[_0x7ae8('0x7a')](_0x4dd6f3[_0x7ae8('0x111')])){var _0x5ee24b=this['getSound'][_0x7ae8('0x9f')](this,_0x4dd6f3[_0x7ae8('0x111')]);if(_0x5ee24b){_0x2e788f=_0x5ee24b;}}this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x4dd6f3,_0x6d8f38);if(_0x4dd6f3[_0x7ae8('0x10e')][_0x7ae8('0x173')]('x')<0x0){_0x4dd6f3[_0x7ae8('0x10e')]+='x';}if(_0x4dd6f3[_0x7ae8('0x10e')][_0x7ae8('0x173')]('X')<0x0){_0x4dd6f3[_0x7ae8('0x10e')]+='X';}this[_0x7ae8('0x2c')][_0x7ae8('0x95')]('XMCS-QUEUE',_0x6d8f38?_0x6d8f38[_0x7ae8('0x174')]():'');var _0x507ee5=this[_0x7ae8('0x2c')]['exec'](_0x7ae8('0x175'),[_0x6d8f38,_0x4dd6f3[_0x7ae8('0x10e')],_0x4dd6f3['url'],_0x2e788f,_0x4dd6f3['timeout'],_0x4dd6f3[_0x7ae8('0xb2')],_0x4dd6f3['macro'],_0x4dd6f3['gosub'],'',_0x4dd6f3[_0x7ae8('0x176')]]);if(_0x507ee5[_0x7ae8('0x9c')]===-0x1){return _0x507ee5;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('Executed\x20command\x20%s\x20%s',_0x7ae8('0x175'),_0x6d8f38));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x177')]=function(_0x1f4ebb){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x178'),_0x1f4ebb[_0x7ae8('0x2e')]));var _0x1405d7=_0x1f4ebb[_0x7ae8('0x179')]||'wav';var _0x25bd56=util[_0x7ae8('0x21')](_0x7ae8('0x17a'),this['channel'][_0x7ae8('0x2d')],rs['generate'](0x5));var _0x20da7b=util[_0x7ae8('0x21')](_0x7ae8('0x17b'),FILES_PATH,_0x25bd56,_0x1405d7);var _0x57ba55=util['format'](_0x7ae8('0x14d'),FILES_PATH,_0x25bd56);this[_0x7ae8('0x32')][_0x7ae8('0x9f')](this,_0x1f4ebb,_0x25bd56,_0x20da7b);this[_0x7ae8('0x2c')][_0x7ae8('0x95')](_0x7ae8('0x17c'),_0x25bd56);logger['info'](_0x7ae8('0x17d'),_0x57ba55,_0x1405d7,_0x1f4ebb[_0x7ae8('0x17e')],_0x1f4ebb[_0x7ae8('0x5c')]);return this[_0x7ae8('0x2c')][_0x7ae8('0x12c')](_0x57ba55,_0x1405d7,_0x1f4ebb[_0x7ae8('0x17e')],_0x1f4ebb[_0x7ae8('0x5c')],undefined,!![]);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x17f')]=function(_0x4c460e){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x180'),_0x4c460e[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x4c460e[_0x7ae8('0x67')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x181'));}var _0xd7bad6=this['restAPI'][_0x7ae8('0x9f')](this,_0x4c460e);logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x182'),util[_0x7ae8('0x183')](_0xd7bad6,{'showHidden':![],'depth':null})));if(!this[_0x7ae8('0x7a')](_0x4c460e['variable_id'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x54946b=this[_0x7ae8('0x99')][_0x7ae8('0x9f')](this,_0x4c460e['variable_id']);if(!_0x54946b){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x4c460e,_0x7ae8('0xd6'));}this[_0x7ae8('0x2c')]['setVariable'](util[_0x7ae8('0x21')](_0x7ae8('0x184'),_0x54946b),_0xd7bad6[_0x7ae8('0x6b')]?_0xd7bad6[_0x7ae8('0x6b')]:_0x7ae8('0x185'));this[_0x7ae8('0x2c')][_0x7ae8('0x95')](util['format'](_0x7ae8('0x186'),_0x54946b),_0xd7bad6['statusMessage']?_0xd7bad6[_0x7ae8('0x6c')]:'OK');if(_0xd7bad6[_0x7ae8('0x69')]){try{this[_0x7ae8('0x92')](_0xd7bad6[_0x7ae8('0x69')],_0x54946b);}catch(_0x213711){logger[_0x7ae8('0x24')](util[_0x7ae8('0x21')](_0x7ae8('0x187'),_0x54946b));}}return this[_0x7ae8('0x2c')]['noop'](util['format'](_0x7ae8('0xda'),_0x54946b));};AGIVertices['prototype'][_0x7ae8('0x188')]=function(_0x31c52f){logger[_0x7ae8('0x25')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x31c52f[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')][_0x7ae8('0x189')](_0x31c52f['digits'][_0x7ae8('0x4f')](/\s+/g,''),_0x31c52f[_0x7ae8('0x17e')]);};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x18a')]=function(_0x2c68e0){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x18b'),_0x2c68e0[_0x7ae8('0x2e')]));return this['channel'][_0x7ae8('0x18c')](_0x2c68e0[_0x7ae8('0x18d')][_0x7ae8('0x4f')](/\s+/g,''),_0x2c68e0['escape_digits']);};AGIVertices[_0x7ae8('0xc')]['sayphonetic']=function(_0x3b3ae1){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x18e'),_0x3b3ae1[_0x7ae8('0x2e')]));return this[_0x7ae8('0x2c')]['sayPhonetic'](_0x3b3ae1[_0x7ae8('0x52')],_0x3b3ae1[_0x7ae8('0x17e')]);};AGIVertices['prototype'][_0x7ae8('0x18f')]=function(_0x374aa9){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x190'),_0x374aa9[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x374aa9['account_id'])){return this['channel']['noop'](_0x7ae8('0x191'));}var _0x4879ce=this[_0x7ae8('0x192')][_0x7ae8('0x9f')](this,_0x374aa9['account_id']);if(!_0x4879ce||!_0x4879ce[_0x7ae8('0x193')]){return this[_0x7ae8('0x2c')]['error'](_0x374aa9,'no\x20mail\x20account\x20found');}var _0x5ae85d={'from':util[_0x7ae8('0x21')](_0x7ae8('0x194'),_0x4879ce[_0x7ae8('0xf')],_0x4879ce[_0x7ae8('0x195')]||_0x4879ce[_0x7ae8('0x193')][_0x7ae8('0x196')]),'to':_0x374aa9['to']||'','cc':_0x374aa9['cc']||'','bcc':_0x374aa9[_0x7ae8('0x197')]||'','subject':_0x374aa9['subject'],'html':_0x374aa9['text'],'text':_0x374aa9['text']};if(this[_0x7ae8('0x7a')](_0x374aa9[_0x7ae8('0x198')])){}logger[_0x7ae8('0xdc')](_0x7ae8('0x199'),JSON[_0x7ae8('0x96')](_0x5ae85d));this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x374aa9,_0x374aa9[_0x7ae8('0x19a')]);this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x19b'),_0x4879ce[_0x7ae8('0xf')]));this['sendMailMessage'][_0x7ae8('0x9f')](this,_0x4879ce['smtpOptions'],_0x5ae85d);return this['channel'][_0x7ae8('0xa3')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x7ae8('0xc')]['sendFax']=function(_0x24dd61){logger['info'](util['format'](_0x7ae8('0x19c'),_0x24dd61[_0x7ae8('0x2e')]));return this['channel'][_0x7ae8('0xa3')](_0x7ae8('0x19d'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x19e')]=function(_0x42f1ac){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x19f'),_0x42f1ac['label']));if(!this['isConfigured'](_0x42f1ac['sms_account_id'])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x1a0'));}var _0x108f41=this['getSmsAccount'][_0x7ae8('0x9f')](this,_0x42f1ac[_0x7ae8('0x1a1')]);if(!_0x108f41){return this['channel'][_0x7ae8('0x24')](_0x42f1ac,_0x7ae8('0x1a2'));}var _0x214514={'body':_0x42f1ac[_0x7ae8('0x1a3')],'phone':_0x42f1ac['to']||'','SmsAccountId':_0x108f41['id']};logger[_0x7ae8('0xdc')]('sendSMS\x20message',JSON['stringify'](_0x214514));this[_0x7ae8('0x2b')]['sync'](this,_0x42f1ac,_0x42f1ac[_0x7ae8('0x1a1')]);this['channel']['noop'](util[_0x7ae8('0x21')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x108f41[_0x7ae8('0xf')]));this[_0x7ae8('0x2a')][_0x7ae8('0x9f')](this,_0x214514);return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x1a4'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1a5')]=function(_0x3092f5){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x1a6'),_0x3092f5['label']));if(!this[_0x7ae8('0x7a')](_0x3092f5['variable_id'])){return this[_0x7ae8('0x2c')]['error'](_0x3092f5,_0x7ae8('0x1a7'));}var _0x376a6e=this['getVariable'][_0x7ae8('0x9f')](this,_0x3092f5['variable_id']);if(!_0x376a6e){return this[_0x7ae8('0x2c')]['error'](_0x3092f5,'no\x20variable\x20found');}return this['channel'][_0x7ae8('0x95')](_0x376a6e,_0x3092f5['variable_value']);};AGIVertices[_0x7ae8('0xc')]['start']=function(_0x41f92e){logger[_0x7ae8('0x25')](util['format'](_0x7ae8('0x1a8'),_0x41f92e[_0x7ae8('0x2e')]));this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0x1a9'));if(_0x41f92e['answer']==='yes'){this['channel'][_0x7ae8('0xa3')](_0x7ae8('0x1aa'));return this[_0x7ae8('0x2c')][_0x7ae8('0xb5')]();}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x1ab'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1ac')]=function(_0x5b0123){logger['info'](util['format'](_0x7ae8('0x1ad'),_0x5b0123[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x5b0123['project_id'])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x5b0123,_0x7ae8('0x1ae'));}var _0x3979b6=this['getSquareProject'][_0x7ae8('0x9f')](this,_0x5b0123[_0x7ae8('0x1af')]);if(!this[_0x7ae8('0x7a')](_0x3979b6)){return this[_0x7ae8('0x2c')]['error'](_0x5b0123,util[_0x7ae8('0x21')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5b0123['project_id']));}if(_0x3979b6===this[_0x7ae8('0x2c')][_0x7ae8('0x30')]){return this['channel']['error'](_0x5b0123,_0x7ae8('0x1b0'));}this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x5b0123,_0x3979b6);var _0x26a9a8=this[_0x7ae8('0x2c')]['exec'](_0x7ae8('0x1b1'),util[_0x7ae8('0x21')](_0x7ae8('0x1b2'),config[_0x7ae8('0xb2')][_0x7ae8('0x1b3')]||'127.0.0.1',_0x3979b6,this[_0x7ae8('0x2c')][_0x7ae8('0x30')]));if(_0x26a9a8[_0x7ae8('0x9c')]===-0x1){return _0x26a9a8;}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util['format'](_0x7ae8('0xc2'),_0x7ae8('0x1b1'),_0x3979b6));};AGIVertices[_0x7ae8('0xc')]['system']=function(_0x5666cd){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x1b4'),_0x5666cd['label']));var _0x2cb584=this[_0x7ae8('0x4c')][_0x7ae8('0x9f')](this,_0x5666cd[_0x7ae8('0x1b5')]);this[_0x7ae8('0x2b')][_0x7ae8('0x9f')](this,_0x5666cd,_0x5666cd[_0x7ae8('0x1b5')]);if(this[_0x7ae8('0x7a')](_0x5666cd['variable_id'])){var _0x1092ee=this['getVariable']['sync'](this,_0x5666cd[_0x7ae8('0xd5')]);if(_0x1092ee){this['channel'][_0x7ae8('0x95')](_0x1092ee,_0x2cb584);return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x1b6'),_0x5666cd[_0x7ae8('0x1b5')],_0x1092ee));}}return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x1b7'),_0x5666cd['command']));};AGIVertices[_0x7ae8('0xc')]['google_cloud_tts']=function(_0x119d8b){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x1b8'),_0x119d8b[_0x7ae8('0x2e')]));_0x119d8b['text']=_0x119d8b['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x119d8b[_0x7ae8('0x51')])){return this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](_0x7ae8('0x1b9'));}if(!this[_0x7ae8('0x7a')](_0x119d8b[_0x7ae8('0x52')])){return this[_0x7ae8('0x2c')]['noop'](_0x7ae8('0xa4'));}this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x1ba'),_0x119d8b[_0x7ae8('0x52')]));var _0x124283=this[_0x7ae8('0x50')]['sync'](this,_0x119d8b);if(_0x124283){this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x1bb'),_0x124283));var _0xa7ee4c=this[_0x7ae8('0x2c')][_0x7ae8('0x103')](_0x124283);try{fs[_0x7ae8('0x104')](_0x124283+_0x7ae8('0x105'));}catch(_0x56993e){logger[_0x7ae8('0x24')](_0x56993e);}return _0xa7ee4c;}return this[_0x7ae8('0x2c')]['error'](_0x119d8b,_0x7ae8('0x1bc'));};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1bd')]=function(_0x6a8b66){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x6a8b66[_0x7ae8('0x2e')]));_0x6a8b66[_0x7ae8('0x52')]=_0x6a8b66[_0x7ae8('0x52')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7ae8('0x7a')](_0x6a8b66[_0x7ae8('0x52')])){return this['channel'][_0x7ae8('0xa3')]('no\x20text\x20configured');}this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x1be'),_0x6a8b66[_0x7ae8('0x52')]));var _0x535ead=this[_0x7ae8('0x58')][_0x7ae8('0x9f')](this,_0x6a8b66);if(_0x535ead){this['channel'][_0x7ae8('0xa3')](util['format'](_0x7ae8('0x1bf'),_0x535ead));var _0x3d64e0=this['channel']['streamFile'](_0x535ead);try{fs[_0x7ae8('0x104')](_0x535ead+_0x7ae8('0x105'));}catch(_0x512d62){logger[_0x7ae8('0x24')](_0x512d62);}return _0x3d64e0;}return this[_0x7ae8('0x2c')]['error'](_0x6a8b66,_0x7ae8('0x1c0'));};AGIVertices[_0x7ae8('0xc')]['unpause']=function(_0x13c54c){logger['info'](util['format'](_0x7ae8('0x1c1'),_0x13c54c[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x13c54c[_0x7ae8('0x156')])){return this[_0x7ae8('0x2c')][_0x7ae8('0x24')](_0x13c54c,_0x7ae8('0x157'));}logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x158'),this[_0x7ae8('0x2c')]['callerid'],_0x13c54c['findBy']));var _0x116d70=this['agentUnpause']['sync'](this,_0x13c54c[_0x7ae8('0x156')]);if(_0x116d70){logger[_0x7ae8('0x25')](util[_0x7ae8('0x21')](_0x7ae8('0x159'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x13c54c[_0x7ae8('0x156')]));this['channel'][_0x7ae8('0xa3')](util[_0x7ae8('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7ae8('0x31')],_0x13c54c['findBy']));return{'code':0xc8,'result':_0x7ae8('0x15a')};}else{logger['info'](util['format'](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')]['callerid'],_0x13c54c[_0x7ae8('0x156')]));this[_0x7ae8('0x2c')][_0x7ae8('0xa3')](util[_0x7ae8('0x21')](_0x7ae8('0x15b'),this[_0x7ae8('0x2c')][_0x7ae8('0x31')],_0x13c54c['findBy']));return{'code':0xc8,'result':_0x7ae8('0x15c')};}};AGIVertices[_0x7ae8('0xc')][_0x7ae8('0x1c2')]=function(_0x9e5d8f){logger['info'](util[_0x7ae8('0x21')](_0x7ae8('0x1c3'),_0x9e5d8f[_0x7ae8('0x2e')]));var _0x5e51f4=this[_0x7ae8('0x2c')][_0x7ae8('0x4d')](_0x7ae8('0x1c4'),[_0x9e5d8f[_0x7ae8('0x1c5')],_0x9e5d8f[_0x7ae8('0x6e')]]);if(_0x5e51f4[_0x7ae8('0x9c')]===-0x1){return _0x5e51f4;}return this[_0x7ae8('0x2c')]['noop'](util[_0x7ae8('0x21')](_0x7ae8('0xc2'),_0x7ae8('0x1c4'),_0x9e5d8f[_0x7ae8('0x1c5')]));};AGIVertices['prototype']['vswitch']=function(_0x2b5754){logger['info'](util['format'](_0x7ae8('0x1c6'),_0x2b5754[_0x7ae8('0x2e')]));if(!this[_0x7ae8('0x7a')](_0x2b5754[_0x7ae8('0xd5')])){return this['channel'][_0x7ae8('0x24')](_0x2b5754,_0x7ae8('0x1a7'));}var _0x186eab=this[_0x7ae8('0x99')][_0x7ae8('0x9f')](this,_0x2b5754[_0x7ae8('0xd5')]);if(!_0x186eab){return this[_0x7ae8('0x2c')]['error'](_0x2b5754,_0x7ae8('0xd6'));}var _0x60449e=this[_0x7ae8('0x2c')]['getVariable'](_0x186eab);return{'code':0xc8,'result':_0x60449e[_0x7ae8('0x9a')]?_0x60449e[_0x7ae8('0x9a')]:'-'};};String[_0x7ae8('0xc')][_0x7ae8('0x98')]=function(_0x5b77b7,_0x57bca5){return this[_0x7ae8('0x97')](_0x5b77b7)[_0x7ae8('0x1c7')](_0x57bca5);};module[_0x7ae8('0x1c8')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c5150bc..ca7f3a6 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 _0x9d7c=['update','catch','[ACW][TIMERS]','stringify','message','syncAgentConnect','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','interface','queue','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x32cefc,_0xdae63f){var _0x5e1823=function(_0x216025){while(--_0x216025){_0x32cefc['push'](_0x32cefc['shift']());}};_0x5e1823(++_0xdae63f);}(_0x9d7c,0x6c));var _0xc9d7=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0x9d7c[_0x3a723e];return _0x3e9c03;};'use strict';var _=require('lodash');var moment=require(_0xc9d7('0x0'));var ami=require(_0xc9d7('0x1'));var logger=require(_0xc9d7('0x2'))(_0xc9d7('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xc9d7('0x4'));function Acw(_0x1562b3){this[_0xc9d7('0x5')]=_0x1562b3['voiceQueues'];this[_0xc9d7('0x6')]=_0x1562b3['agents'];this[_0xc9d7('0x7')]=_0x1562b3['timers'];this[_0xc9d7('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xc9d7('0x9')](this));ami['on'](_0xc9d7('0xa'),this[_0xc9d7('0xb')][_0xc9d7('0x9')](this));ami['on'](_0xc9d7('0xc'),this[_0xc9d7('0xd')][_0xc9d7('0x9')](this));ami['on'](_0xc9d7('0xe'),this[_0xc9d7('0xf')][_0xc9d7('0x9')](this));ami['on']('attendedtransfer',this[_0xc9d7('0x10')][_0xc9d7('0x9')](this));ami['on'](_0xc9d7('0x11'),this[_0xc9d7('0x12')]['bind'](this));ami['on'](_0xc9d7('0x13'),this[_0xc9d7('0x14')][_0xc9d7('0x9')](this));}function getDiff(_0x3c011c){var _0x11db6e=moment()['milliseconds'](0x0);var _0x487421=moment(_0x3c011c)[_0xc9d7('0x15')](0x0);return _0x11db6e['diff'](_0x487421,_0xc9d7('0x16'));}Acw[_0xc9d7('0x17')]['startAcw']=function(_0x2a427a){try{var _0x5f2c3a=this;var _0x59d4ea=this[_0xc9d7('0x8')][_0x2a427a][_0xc9d7('0x18')];var _0x48f296=this['channels'][_0x2a427a][_0xc9d7('0x19')];var _0x476a29=this['voiceQueues'][_0x48f296];var _0x190902=![];var _0x46b727='ACW';if(_0x476a29['mandatoryDisposition']){if(_0x476a29[_0xc9d7('0x1a')][_0xc9d7('0x1b')]){_0x190902=!![];_0x46b727=_0x476a29[_0xc9d7('0x1a')][_0xc9d7('0x1b')];}}return ami[_0xc9d7('0x1c')]({'action':_0xc9d7('0x1d'),'interface':_0x59d4ea,'paused':!![],'reason':_0x46b727})[_0xc9d7('0x1e')](function(){if(_0x5f2c3a[_0xc9d7('0x6')][_0x59d4ea]){return RpcUser[_0xc9d7('0x1f')](_0x5f2c3a[_0xc9d7('0x6')][_0x59d4ea]['id'])[_0xc9d7('0x1e')](function(_0xaf2d9e){if(_0xaf2d9e&&!_0xaf2d9e[_0xc9d7('0x20')]){logger[_0xc9d7('0x21')](_0xc9d7('0x22'),_0x2a427a,_0x59d4ea,_0x48f296);var _0x15b885=_0x5f2c3a['channels'][_0x2a427a][_0xc9d7('0x23')]&&_0x5f2c3a[_0xc9d7('0x8')][_0x2a427a][_0xc9d7('0x24')]?_0x5f2c3a[_0xc9d7('0x8')][_0x2a427a][_0xc9d7('0x24')]:_0x2a427a;return RpcUser[_0xc9d7('0x25')](_0x5f2c3a['agents'][_0x59d4ea],_0x46b727,_0x15b885)[_0xc9d7('0x1e')](function(){if(!_0x190902){_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea]={};logger[_0xc9d7('0x21')](_0xc9d7('0x26'),_0x2a427a,_0x5f2c3a[_0xc9d7('0x5')][_0x48f296][_0xc9d7('0x27')],_0x59d4ea,_0x48f296);_0x5f2c3a['timers'][_0x59d4ea][_0xc9d7('0x28')]=setTimeout(_0x5f2c3a['stopAcw']['bind'](_0x5f2c3a,_0x59d4ea),_0x5f2c3a[_0xc9d7('0x5')][_0x48f296][_0xc9d7('0x27')]*0x3e8);_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea][_0xc9d7('0x29')]=moment()[_0xc9d7('0x2a')](_0xc9d7('0x2b'));_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea][_0xc9d7('0x2c')]=_0x2a427a;_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea]['queue']=_0x48f296;_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea][_0xc9d7('0x2d')]=function(){var _0x592952=getDiff(_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea][_0xc9d7('0x29')]);clearTimeout(_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea][_0xc9d7('0x28')]);_0x5f2c3a['timers'][_0x59d4ea]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x592952},_0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea]['uniqueid'],_0x59d4ea)[_0xc9d7('0x1e')](function(_0xeb506e){logger[_0xc9d7('0x21')](_0xc9d7('0x2e'),_0x2a427a,_0x592952,_0xeb506e);})['catch'](function(_0xa952cf){logger[_0xc9d7('0x2f')](_0xc9d7('0x30'),_0x2a427a,_0xa952cf);});delete _0x5f2c3a[_0xc9d7('0x7')][_0x59d4ea];};}});}else{logger[_0xc9d7('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a427a,_0x59d4ea,_0x48f296);}});}})['catch'](function(){logger[_0xc9d7('0x2f')](_0xc9d7('0x26'),_0x2a427a,_0x5f2c3a['voiceQueues'][_0x48f296]['acwTimeout'],_0x59d4ea,_0x48f296);})['finally'](function(){delete _0x5f2c3a['channels'][_0x2a427a];});}catch(_0x28bafd){logger[_0xc9d7('0x2f')]('[ACW][START]\x20%s',_0x28bafd['message']);}};Acw[_0xc9d7('0x17')][_0xc9d7('0x31')]=function(_0xa45b54){try{var _0x58fdb3=this;if(_0x58fdb3['timers'][_0xa45b54]){_0x58fdb3[_0xc9d7('0x7')][_0xa45b54][_0xc9d7('0x28')]=![];var _0x5be7b1=_0x58fdb3[_0xc9d7('0x7')][_0xa45b54][_0xc9d7('0x2c')];var _0x5f3353=_0x58fdb3[_0xc9d7('0x7')][_0xa45b54][_0xc9d7('0x19')];var _0x4d3c51=_0x58fdb3[_0xc9d7('0x5')][_0x5f3353][_0xc9d7('0x27')];logger[_0xc9d7('0x21')](_0xc9d7('0x32'),_0x5be7b1,_0xa45b54);RpcUser[_0xc9d7('0x33')](this[_0xc9d7('0x6')][_0xa45b54]);RpcVoiceAgentReport[_0xc9d7('0x34')]({'acwtime':_0x4d3c51,'agentacw':!![]},_0x5be7b1,_0xa45b54)[_0xc9d7('0x1e')](function(_0x2a50ea){logger[_0xc9d7('0x21')](_0xc9d7('0x2e'),_0x5be7b1,_0x4d3c51,_0x2a50ea);})[_0xc9d7('0x35')](function(_0xc7e04e){logger[_0xc9d7('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x5be7b1,_0xc7e04e);});}else{logger[_0xc9d7('0x2f')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xa45b54);if(_0x58fdb3['timers']){logger['info'](_0xc9d7('0x36'),JSON[_0xc9d7('0x37')](_0x58fdb3['timers']));}}}catch(_0x7b95b4){logger[_0xc9d7('0x2f')]('[ACW][STOP]\x20%s',_0x7b95b4[_0xc9d7('0x38')]);}};Acw[_0xc9d7('0x17')][_0xc9d7('0x39')]=function(_0x416164){try{if(this['voiceQueues'][_0x416164[_0xc9d7('0x19')]]&&(this[_0xc9d7('0x5')][_0x416164[_0xc9d7('0x19')]][_0xc9d7('0x3')]||this[_0xc9d7('0x5')][_0x416164[_0xc9d7('0x19')]][_0xc9d7('0x3a')])){if(this[_0xc9d7('0x6')][_0x416164['interface']]){this[_0xc9d7('0x8')][_0x416164[_0xc9d7('0x2c')]]={'queue':_0x416164[_0xc9d7('0x19')],'interface':_0x416164[_0xc9d7('0x18')],'destlinkedid':_0x416164[_0xc9d7('0x24')]};}}}catch(_0x1d8df4){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1d8df4[_0xc9d7('0x38')]);}};Acw[_0xc9d7('0x17')][_0xc9d7('0x14')]=function(_0x278a76){try{if(this[_0xc9d7('0x5')][_0x278a76[_0xc9d7('0x19')]]&&(this['voiceQueues'][_0x278a76[_0xc9d7('0x19')]][_0xc9d7('0x3')]||this['voiceQueues'][_0x278a76[_0xc9d7('0x19')]][_0xc9d7('0x3a')])){if(this[_0xc9d7('0x6')][_0x278a76[_0xc9d7('0x18')]]){this['channels'][_0x278a76[_0xc9d7('0x2c')]]={'queue':_0x278a76[_0xc9d7('0x19')],'interface':_0x278a76[_0xc9d7('0x18')]};}}}catch(_0x52ce92){logger[_0xc9d7('0x2f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x52ce92['message']);}};Acw['prototype'][_0xc9d7('0xb')]=function(_0x1b62ad){try{if(this[_0xc9d7('0x8')][_0x1b62ad[_0xc9d7('0x2c')]]&&_[_0xc9d7('0x3b')](this[_0xc9d7('0x8')][_0x1b62ad[_0xc9d7('0x2c')]][_0xc9d7('0x23')])){logger[_0xc9d7('0x21')](_0xc9d7('0x3c'),_0x1b62ad['uniqueid']);this[_0xc9d7('0x3d')](_0x1b62ad['uniqueid']);}else if(this['channels'][_0x1b62ad[_0xc9d7('0x3e')]]&&_[_0xc9d7('0x3b')](this['channels'][_0x1b62ad['linkedid']][_0xc9d7('0x23')])){logger['info'](_0xc9d7('0x3f'),_0x1b62ad[_0xc9d7('0x3e')]);this[_0xc9d7('0x3d')](_0x1b62ad[_0xc9d7('0x3e')]);}}catch(_0x5ead11){logger['error'](_0xc9d7('0x40'),_0x5ead11[_0xc9d7('0x38')]);}};Acw['prototype']['syncHangup']=function(_0x559267){try{if(this[_0xc9d7('0x8')][_0x559267[_0xc9d7('0x2c')]]&&this[_0xc9d7('0x8')][_0x559267[_0xc9d7('0x2c')]][_0xc9d7('0x23')]){logger['info'](_0xc9d7('0x41'),_0x559267['uniqueid']);this['startAcw'](_0x559267[_0xc9d7('0x2c')]);}else if(this[_0xc9d7('0x8')][_0x559267[_0xc9d7('0x3e')]]&&this[_0xc9d7('0x8')][_0x559267[_0xc9d7('0x3e')]][_0xc9d7('0x23')]){logger[_0xc9d7('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x559267[_0xc9d7('0x3e')]);this[_0xc9d7('0x3d')](_0x559267[_0xc9d7('0x3e')]);}}catch(_0x437d2f){logger['error']('[ACW][syncHangup]\x20%s',_0x437d2f[_0xc9d7('0x38')]);}};Acw[_0xc9d7('0x17')]['syncAttendedTransfer']=function(_0x3679bf){try{if(!_[_0xc9d7('0x42')](this[_0xc9d7('0x8')][_0x3679bf['transfereeuniqueid']])){this[_0xc9d7('0x3d')](_0x3679bf[_0xc9d7('0x43')]);if(this['channels'][_0x3679bf['secondtransfereruniqueid']]){this['channels'][_0x3679bf[_0xc9d7('0x44')]][_0xc9d7('0x23')]=!![];this[_0xc9d7('0x8')][_0x3679bf['transfertargetuniqueid']]=this[_0xc9d7('0x8')][_0x3679bf[_0xc9d7('0x44')]];delete this['channels'][_0x3679bf[_0xc9d7('0x44')]];}}else if(!_[_0xc9d7('0x42')](this['channels'][_0x3679bf[_0xc9d7('0x45')]])){this[_0xc9d7('0x3d')](_0x3679bf['transfertargetuniqueid']);if(this[_0xc9d7('0x8')][_0x3679bf['origtransfereruniqueid']]){this[_0xc9d7('0x8')][_0x3679bf[_0xc9d7('0x46')]][_0xc9d7('0x23')]=!![];this['channels'][_0x3679bf['transfereeuniqueid']]=this[_0xc9d7('0x8')][_0x3679bf[_0xc9d7('0x46')]];delete this[_0xc9d7('0x8')][_0x3679bf['origtransfereruniqueid']];}}}catch(_0x2ce60d){logger[_0xc9d7('0x2f')](_0xc9d7('0x47'),_0x2ce60d[_0xc9d7('0x38')]);}};Acw[_0xc9d7('0x17')][_0xc9d7('0x12')]=function(_0x27a4b7){try{if(this[_0xc9d7('0x8')][_0x27a4b7['transfereruniqueid']]){logger[_0xc9d7('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x27a4b7[_0xc9d7('0x48')]));this[_0xc9d7('0x3d')](_0x27a4b7[_0xc9d7('0x48')]);}else if(this['channels'][_0x27a4b7[_0xc9d7('0x49')]]){logger[_0xc9d7('0x21')](_0xc9d7('0x4a'),JSON[_0xc9d7('0x37')](_0x27a4b7['transfererlinkedid']));this[_0xc9d7('0x3d')](_0x27a4b7[_0xc9d7('0x49')]);}}catch(_0x327060){logger[_0xc9d7('0x2f')](_0xc9d7('0x4b'),_0x327060[_0xc9d7('0x38')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x135ba8){try{if(this[_0xc9d7('0x5')][_0x135ba8[_0xc9d7('0x19')]]&&this[_0xc9d7('0x5')][_0x135ba8[_0xc9d7('0x19')]]['autopause']===_0xc9d7('0x4c')){if(this[_0xc9d7('0x6')][_0x135ba8[_0xc9d7('0x18')]]){logger[_0xc9d7('0x21')](_0xc9d7('0x4d'),_0x135ba8[_0xc9d7('0x2c')],_0x135ba8[_0xc9d7('0x18')],_0x135ba8[_0xc9d7('0x19')]);return RpcUser[_0xc9d7('0x25')](this['agents'][_0x135ba8[_0xc9d7('0x18')]],_0xc9d7('0x4e'),_0x135ba8['uniqueid']);}}}catch(_0x1ffd46){logger[_0xc9d7('0x2f')](_0xc9d7('0x4f'),_0x1ffd46[_0xc9d7('0x38')]);}};module['exports']=Acw; \ No newline at end of file +var _0x40f3=['attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','hanguprequest','hangup','syncHangup','bind','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','interface','queue','ACW','mandatoryDisposition','name','Action','then','info','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x45806b,_0x53eeae){var _0x3e228e=function(_0x3ee031){while(--_0x3ee031){_0x45806b['push'](_0x45806b['shift']());}};_0x3e228e(++_0x53eeae);}(_0x40f3,0x86));var _0x340f=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x40f3[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require(_0x340f('0x0'));var moment=require(_0x340f('0x1'));var ami=require(_0x340f('0x2'));var logger=require(_0x340f('0x3'))(_0x340f('0x4'));var RpcUser=require(_0x340f('0x5'));var RpcVoiceAgentReport=require(_0x340f('0x6'));function Acw(_0x930cbc){this[_0x340f('0x7')]=_0x930cbc['voiceQueues'];this[_0x340f('0x8')]=_0x930cbc['agents'];this['timers']=_0x930cbc[_0x340f('0x9')];this[_0x340f('0xa')]={};ami['on'](_0x340f('0xb'),this['syncAgentConnect']['bind'](this));ami['on'](_0x340f('0xc'),this['syncHangupRequest']['bind'](this));ami['on'](_0x340f('0xd'),this[_0x340f('0xe')][_0x340f('0xf')](this));ami['on'](_0x340f('0x10'),this[_0x340f('0x11')]['bind'](this));ami['on'](_0x340f('0x12'),this[_0x340f('0x13')][_0x340f('0xf')](this));ami['on'](_0x340f('0x14'),this[_0x340f('0x15')][_0x340f('0xf')](this));ami['on'](_0x340f('0x16'),this[_0x340f('0x17')]['bind'](this));}function getDiff(_0x1d4b3f){var _0x5a2bb3=moment()[_0x340f('0x18')](0x0);var _0x255bea=moment(_0x1d4b3f)[_0x340f('0x18')](0x0);return _0x5a2bb3['diff'](_0x255bea,_0x340f('0x19'));}Acw[_0x340f('0x1a')]['startAcw']=function(_0xcea813){try{var _0x3addb5=this;var _0x24c160=this['channels'][_0xcea813][_0x340f('0x1b')];var _0x449b6c=this['channels'][_0xcea813][_0x340f('0x1c')];var _0x79fa46=this['voiceQueues'][_0x449b6c];var _0xa28f81=![];var _0x4ca6bb=_0x340f('0x1d');if(_0x79fa46[_0x340f('0x1e')]){if(_0x79fa46['mandatoryDispositionPause'][_0x340f('0x1f')]){_0xa28f81=!![];_0x4ca6bb=_0x79fa46['mandatoryDispositionPause'][_0x340f('0x1f')];}}return ami[_0x340f('0x20')]({'action':'QueuePause','interface':_0x24c160,'paused':!![],'reason':_0x4ca6bb})[_0x340f('0x21')](function(){if(_0x3addb5[_0x340f('0x8')][_0x24c160]){return RpcUser['getAgent'](_0x3addb5[_0x340f('0x8')][_0x24c160]['id'])['then'](function(_0x3c5f93){if(_0x3c5f93&&!_0x3c5f93['voicePause']){logger[_0x340f('0x22')](_0x340f('0x23'),_0xcea813,_0x24c160,_0x449b6c);var _0x387a54=_0x3addb5[_0x340f('0xa')][_0xcea813][_0x340f('0x24')]&&_0x3addb5[_0x340f('0xa')][_0xcea813][_0x340f('0x25')]?_0x3addb5[_0x340f('0xa')][_0xcea813]['destlinkedid']:_0xcea813;return RpcUser[_0x340f('0x26')](_0x3addb5[_0x340f('0x8')][_0x24c160],_0x4ca6bb,_0x387a54)['then'](function(){if(!_0xa28f81){_0x3addb5[_0x340f('0x9')][_0x24c160]={};logger['info'](_0x340f('0x27'),_0xcea813,_0x3addb5[_0x340f('0x7')][_0x449b6c][_0x340f('0x28')],_0x24c160,_0x449b6c);_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x29')]=setTimeout(_0x3addb5[_0x340f('0x2a')][_0x340f('0xf')](_0x3addb5,_0x24c160),_0x3addb5[_0x340f('0x7')][_0x449b6c]['acwTimeout']*0x3e8);_0x3addb5[_0x340f('0x9')][_0x24c160]['lastPauseAt']=moment()['format'](_0x340f('0x2b'));_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x2c')]=_0xcea813;_0x3addb5['timers'][_0x24c160]['queue']=_0x449b6c;_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x2d')]=function(){var _0x412145=getDiff(_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x2e')]);clearTimeout(_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x29')]);_0x3addb5['timers'][_0x24c160][_0x340f('0x29')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x412145},_0x3addb5[_0x340f('0x9')][_0x24c160][_0x340f('0x2c')],_0x24c160)[_0x340f('0x21')](function(_0x3b8224){logger[_0x340f('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0xcea813,_0x412145,_0x3b8224);})[_0x340f('0x2f')](function(_0x3f00d9){logger['error'](_0x340f('0x30'),_0xcea813,_0x3f00d9);});delete _0x3addb5[_0x340f('0x9')][_0x24c160];};}});}else{logger[_0x340f('0x22')](_0x340f('0x31'),_0xcea813,_0x24c160,_0x449b6c);}});}})[_0x340f('0x2f')](function(){logger[_0x340f('0x32')](_0x340f('0x27'),_0xcea813,_0x3addb5['voiceQueues'][_0x449b6c][_0x340f('0x28')],_0x24c160,_0x449b6c);})[_0x340f('0x33')](function(){delete _0x3addb5['channels'][_0xcea813];});}catch(_0x34d683){logger['error'](_0x340f('0x34'),_0x34d683[_0x340f('0x35')]);}};Acw[_0x340f('0x1a')][_0x340f('0x2a')]=function(_0x129f3c){try{var _0x5209d0=this;if(_0x5209d0[_0x340f('0x9')][_0x129f3c]){_0x5209d0[_0x340f('0x9')][_0x129f3c][_0x340f('0x29')]=![];var _0x128bce=_0x5209d0[_0x340f('0x9')][_0x129f3c][_0x340f('0x2c')];var _0x1ef89d=_0x5209d0['timers'][_0x129f3c][_0x340f('0x1c')];var _0x3253b8=_0x5209d0['voiceQueues'][_0x1ef89d][_0x340f('0x28')];logger[_0x340f('0x22')](_0x340f('0x36'),_0x128bce,_0x129f3c);RpcUser[_0x340f('0x37')](this[_0x340f('0x8')][_0x129f3c]);RpcVoiceAgentReport[_0x340f('0x38')]({'acwtime':_0x3253b8,'agentacw':!![]},_0x128bce,_0x129f3c)['then'](function(_0x221fb9){logger['info'](_0x340f('0x39'),_0x128bce,_0x3253b8,_0x221fb9);})[_0x340f('0x2f')](function(_0x21dd9a){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x128bce,_0x21dd9a);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x129f3c);if(_0x5209d0['timers']){logger[_0x340f('0x22')]('[ACW][TIMERS]',JSON[_0x340f('0x3a')](_0x5209d0[_0x340f('0x9')]));}}}catch(_0x373ac6){logger[_0x340f('0x32')]('[ACW][STOP]\x20%s',_0x373ac6[_0x340f('0x35')]);}};Acw[_0x340f('0x1a')][_0x340f('0x3b')]=function(_0x162f9f){try{if(this['voiceQueues'][_0x162f9f['queue']]&&(this[_0x340f('0x7')][_0x162f9f[_0x340f('0x1c')]]['acw']||this[_0x340f('0x7')][_0x162f9f[_0x340f('0x1c')]]['mandatoryDisposition'])){if(this[_0x340f('0x8')][_0x162f9f[_0x340f('0x1b')]]){this[_0x340f('0xa')][_0x162f9f['uniqueid']]={'queue':_0x162f9f[_0x340f('0x1c')],'interface':_0x162f9f[_0x340f('0x1b')],'destlinkedid':_0x162f9f['destlinkedid']};}}}catch(_0x5882f6){logger[_0x340f('0x32')](_0x340f('0x3c'),_0x5882f6[_0x340f('0x35')]);}};Acw[_0x340f('0x1a')][_0x340f('0x17')]=function(_0x4768b4){try{if(this[_0x340f('0x7')][_0x4768b4[_0x340f('0x1c')]]&&(this['voiceQueues'][_0x4768b4[_0x340f('0x1c')]][_0x340f('0x4')]||this[_0x340f('0x7')][_0x4768b4[_0x340f('0x1c')]]['mandatoryDisposition'])){if(this[_0x340f('0x8')][_0x4768b4[_0x340f('0x1b')]]){this[_0x340f('0xa')][_0x4768b4[_0x340f('0x2c')]]={'queue':_0x4768b4[_0x340f('0x1c')],'interface':_0x4768b4[_0x340f('0x1b')]};}}}catch(_0x49e0a8){logger[_0x340f('0x32')](_0x340f('0x3d'),_0x49e0a8[_0x340f('0x35')]);}};Acw[_0x340f('0x1a')]['syncHangupRequest']=function(_0x8dde4c){try{if(this[_0x340f('0xa')][_0x8dde4c[_0x340f('0x2c')]]&&_[_0x340f('0x3e')](this[_0x340f('0xa')][_0x8dde4c['uniqueid']]['attended'])){logger[_0x340f('0x22')](_0x340f('0x3f'),_0x8dde4c[_0x340f('0x2c')]);this['startAcw'](_0x8dde4c[_0x340f('0x2c')]);}else if(this[_0x340f('0xa')][_0x8dde4c[_0x340f('0x40')]]&&_['isUndefined'](this[_0x340f('0xa')][_0x8dde4c[_0x340f('0x40')]]['attended'])){logger[_0x340f('0x22')](_0x340f('0x41'),_0x8dde4c[_0x340f('0x40')]);this['startAcw'](_0x8dde4c['linkedid']);}}catch(_0x4bf662){logger[_0x340f('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x4bf662[_0x340f('0x35')]);}};Acw['prototype']['syncHangup']=function(_0x26f4c7){try{if(this[_0x340f('0xa')][_0x26f4c7['uniqueid']]&&this[_0x340f('0xa')][_0x26f4c7['uniqueid']]['attended']){logger[_0x340f('0x22')](_0x340f('0x42'),_0x26f4c7[_0x340f('0x2c')]);this[_0x340f('0x43')](_0x26f4c7['uniqueid']);}else if(this['channels'][_0x26f4c7[_0x340f('0x40')]]&&this['channels'][_0x26f4c7[_0x340f('0x40')]][_0x340f('0x24')]){logger['info'](_0x340f('0x44'),_0x26f4c7[_0x340f('0x40')]);this[_0x340f('0x43')](_0x26f4c7[_0x340f('0x40')]);}}catch(_0x1563c5){logger[_0x340f('0x32')](_0x340f('0x45'),_0x1563c5['message']);}};Acw[_0x340f('0x1a')][_0x340f('0x13')]=function(_0x32f44a){try{if(!_[_0x340f('0x46')](this[_0x340f('0xa')][_0x32f44a[_0x340f('0x47')]])){this['startAcw'](_0x32f44a[_0x340f('0x47')]);if(this[_0x340f('0xa')][_0x32f44a[_0x340f('0x48')]]){this[_0x340f('0xa')][_0x32f44a[_0x340f('0x48')]][_0x340f('0x24')]=!![];this['channels'][_0x32f44a[_0x340f('0x49')]]=this[_0x340f('0xa')][_0x32f44a['secondtransfereruniqueid']];delete this[_0x340f('0xa')][_0x32f44a[_0x340f('0x48')]];}}else if(!_[_0x340f('0x46')](this[_0x340f('0xa')][_0x32f44a['transfertargetuniqueid']])){this[_0x340f('0x43')](_0x32f44a['transfertargetuniqueid']);if(this[_0x340f('0xa')][_0x32f44a[_0x340f('0x4a')]]){this[_0x340f('0xa')][_0x32f44a[_0x340f('0x4a')]]['attended']=!![];this['channels'][_0x32f44a['transfereeuniqueid']]=this[_0x340f('0xa')][_0x32f44a['origtransfereruniqueid']];delete this[_0x340f('0xa')][_0x32f44a[_0x340f('0x4a')]];}}}catch(_0x27517f){logger[_0x340f('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x27517f[_0x340f('0x35')]);}};Acw[_0x340f('0x1a')]['syncBlindTransfer']=function(_0x481988){try{if(this[_0x340f('0xa')][_0x481988['transfereruniqueid']]){logger[_0x340f('0x22')](_0x340f('0x4b'),JSON['stringify'](_0x481988[_0x340f('0x4c')]));this[_0x340f('0x43')](_0x481988[_0x340f('0x4c')]);}else if(this[_0x340f('0xa')][_0x481988[_0x340f('0x4d')]]){logger[_0x340f('0x22')](_0x340f('0x4e'),JSON['stringify'](_0x481988[_0x340f('0x4d')]));this[_0x340f('0x43')](_0x481988['transfererlinkedid']);}}catch(_0xcfd93b){logger[_0x340f('0x32')](_0x340f('0x4f'),_0xcfd93b[_0x340f('0x35')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x169d7f){try{if(this[_0x340f('0x7')][_0x169d7f[_0x340f('0x1c')]]&&this[_0x340f('0x7')][_0x169d7f[_0x340f('0x1c')]][_0x340f('0x50')]===_0x340f('0x51')){if(this[_0x340f('0x8')][_0x169d7f['interface']]){logger['info'](_0x340f('0x52'),_0x169d7f[_0x340f('0x2c')],_0x169d7f['interface'],_0x169d7f[_0x340f('0x1c')]);return RpcUser[_0x340f('0x26')](this[_0x340f('0x8')][_0x169d7f['interface']],_0x340f('0x53'),_0x169d7f['uniqueid']);}}}catch(_0x10b989){logger[_0x340f('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x10b989[_0x340f('0x35')]);}};module[_0x340f('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e70750f..cc5d7f8 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 _0x31b1=['promisify','action','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','info','format','once','close','connect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','bluebird','util','../../config/logger','ami','asterisk','port','username','password','keepConnected'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x31b1,0xa1));var _0x131b=function(_0x522409,_0x3b13b9){_0x522409=_0x522409-0x0;var _0xfa3182=_0x31b1[_0x522409];return _0xfa3182;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x131b('0x0'));var util=require(_0x131b('0x1'));var logger=require(_0x131b('0x2'))(_0x131b('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x131b('0x4')][_0x131b('0x5')],config[_0x131b('0x4')]['ip'],config['asterisk'][_0x131b('0x6')],config[_0x131b('0x4')][_0x131b('0x7')],!![]);ami[_0x131b('0x8')]();ami['Action']=BPromise[_0x131b('0x9')](ami[_0x131b('0xa')]);function error(_0x16e77b){logger['error'](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x131b('0x4')][_0x131b('0x6')],config[_0x131b('0x4')]['ip'],config['asterisk'][_0x131b('0x5')],util[_0x131b('0xb')](_0x16e77b,![],null)));}function close(){logger[_0x131b('0xc')](util['format'](_0x131b('0xd'),config[_0x131b('0x4')][_0x131b('0x6')],config[_0x131b('0x4')]['ip'],config[_0x131b('0x4')][_0x131b('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x131b('0xe')]({'action':_0x131b('0xf')});};};ami[_0x131b('0x10')]=function(){return function(){return ami[_0x131b('0xe')]({'action':_0x131b('0x11')});};};ami[_0x131b('0x12')]=function(){return function(){return ami[_0x131b('0xe')]({'action':_0x131b('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x131b('0xe')]({'action':_0x131b('0x14')});};};ami[_0x131b('0x15')]=function(){return function(){return ami[_0x131b('0xe')]({'action':'coreshowchannels'});};};function connect(){logger[_0x131b('0x16')](util[_0x131b('0x17')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x131b('0x6')],config['asterisk']['ip'],config['asterisk']['port']));ami[_0x131b('0x18')](_0x131b('0xc'),error);ami[_0x131b('0x18')](_0x131b('0x19'),close);}ami['on'](_0x131b('0x1a'),connect);ami['on']('shutdown',function(_0x387bec){logger[_0x131b('0x16')](util[_0x131b('0x17')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x131b('0x6')],config[_0x131b('0x4')]['ip'],config[_0x131b('0x4')][_0x131b('0x5')],util['inspect'](_0x387bec,![],null)));});ami['on'](_0x131b('0x1b'),function(){logger[_0x131b('0x16')](util[_0x131b('0x17')](_0x131b('0x1c'),config[_0x131b('0x4')]['username'],config[_0x131b('0x4')]['ip'],config['asterisk'][_0x131b('0x5')]));return Promise[_0x131b('0x1d')]()[_0x131b('0x1e')](ami[_0x131b('0x1f')]())[_0x131b('0x1e')](ami[_0x131b('0x10')]())[_0x131b('0x1e')](ami[_0x131b('0x12')]())['then'](ami['actionQueueSummary']())[_0x131b('0x1e')](ami[_0x131b('0x15')]())[_0x131b('0x20')](function(_0x53db89){logger[_0x131b('0xc')](_0x131b('0x21'),util[_0x131b('0xb')](_0x53db89,{'showHidden':![],'depth':null}));});});ami[_0x131b('0x18')](_0x131b('0xc'),error);ami[_0x131b('0x18')](_0x131b('0x19'),close);module['exports']=ami; \ No newline at end of file +var _0xed25=['password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','actionQueueSummary','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xed25,0x97));var _0x5ed2=function(_0x5c3cfd,_0x491545){_0x5c3cfd=_0x5c3cfd-0x0;var _0x3488f1=_0xed25[_0x5c3cfd];return _0x3488f1;};'use strict';var Manager=require(_0x5ed2('0x0'));var BPromise=require(_0x5ed2('0x1'));var util=require(_0x5ed2('0x2'));var logger=require(_0x5ed2('0x3'))(_0x5ed2('0x4'));var config=require(_0x5ed2('0x5'));var ami=new Manager(config[_0x5ed2('0x6')][_0x5ed2('0x7')],config[_0x5ed2('0x6')]['ip'],config[_0x5ed2('0x6')][_0x5ed2('0x8')],config[_0x5ed2('0x6')][_0x5ed2('0x9')],!![]);ami[_0x5ed2('0xa')]();ami['Action']=BPromise['promisify'](ami[_0x5ed2('0xb')]);function error(_0x7b20){logger[_0x5ed2('0xc')](util[_0x5ed2('0xd')](_0x5ed2('0xe'),config[_0x5ed2('0x6')][_0x5ed2('0x8')],config[_0x5ed2('0x6')]['ip'],config[_0x5ed2('0x6')]['port'],util['inspect'](_0x7b20,![],null)));}function close(){logger['error'](util[_0x5ed2('0xd')](_0x5ed2('0xf'),config[_0x5ed2('0x6')][_0x5ed2('0x8')],config[_0x5ed2('0x6')]['ip'],config[_0x5ed2('0x6')][_0x5ed2('0x7')]));}ami[_0x5ed2('0x10')]=function(){return function(){return ami[_0x5ed2('0x11')]({'action':_0x5ed2('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x5ed2('0x11')]({'action':_0x5ed2('0x13')});};};ami[_0x5ed2('0x14')]=function(){return function(){return ami[_0x5ed2('0x11')]({'action':_0x5ed2('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x5ed2('0x11')]({'action':_0x5ed2('0x16')});};};ami[_0x5ed2('0x17')]=function(){return function(){return ami['Action']({'action':_0x5ed2('0x18')});};};function connect(){logger[_0x5ed2('0x19')](util['format'](_0x5ed2('0x1a'),config[_0x5ed2('0x6')][_0x5ed2('0x8')],config[_0x5ed2('0x6')]['ip'],config['asterisk']['port']));ami[_0x5ed2('0x1b')](_0x5ed2('0xc'),error);ami['once'](_0x5ed2('0x1c'),close);}ami['on'](_0x5ed2('0x1d'),connect);ami['on'](_0x5ed2('0x1e'),function(_0x4510e6){logger[_0x5ed2('0x19')](util['format'](_0x5ed2('0x1f'),config[_0x5ed2('0x6')][_0x5ed2('0x8')],config[_0x5ed2('0x6')]['ip'],config['asterisk'][_0x5ed2('0x7')],util[_0x5ed2('0x20')](_0x4510e6,![],null)));});ami['on'](_0x5ed2('0x21'),function(){logger['info'](util[_0x5ed2('0xd')](_0x5ed2('0x22'),config[_0x5ed2('0x6')]['username'],config['asterisk']['ip'],config[_0x5ed2('0x6')][_0x5ed2('0x7')]));return Promise['resolve']()[_0x5ed2('0x23')](ami['actionSipShowRegistry']())[_0x5ed2('0x23')](ami[_0x5ed2('0x24')]())['then'](ami[_0x5ed2('0x14')]())[_0x5ed2('0x23')](ami[_0x5ed2('0x25')]())['then'](ami[_0x5ed2('0x17')]())[_0x5ed2('0x26')](function(_0x331267){logger['error'](_0x5ed2('0x27'),util[_0x5ed2('0x20')](_0x331267,{'showHidden':![],'depth':null}));});});ami[_0x5ed2('0x1b')](_0x5ed2('0xc'),error);ami[_0x5ed2('0x1b')](_0x5ed2('0x1c'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7e6d412..4c86c45 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x4e291f,_0x202c9){var _0x3b2d52=function(_0x2004a8){while(--_0x2004a8){_0x4e291f['push'](_0x4e291f['shift']());}};_0x3b2d52(++_0x202c9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x505578,_0x46a4f0){_0x505578=_0x505578-0x0;var _0x333fc8=_0xf4eb[_0x505578];return _0x333fc8;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file +var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x161299,_0x4991c7){var _0x293d51=function(_0x44f04d){while(--_0x44f04d){_0x161299['push'](_0x161299['shift']());}};_0x293d51(++_0x4991c7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x46fc27,_0x4ff2c0){_0x46fc27=_0x46fc27-0x0;var _0x4caf32=_0xb43b[_0x46fc27];return _0x4caf32;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 4b6f420..7be2fa4 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 _0x352b=['dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnosuchnumberretry','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','floor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','temp','checkContactEmpty','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','checkIsBlackList','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','Umin\x20=\x20','exports','lodash','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/voiceQueueRt','../rpc/interval','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','emit','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startProgressive\x20value\x20cleared','debug','startPredictive\x20value\x20cleared','handlePredictive','stack','error','checkContactLowerLimitOriginate','contactsRescheduled','contacts','message','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Intervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','isArray','length','push','command','timezones','content','indexOf','true','catch','Action','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','reason','agent','agiafterat','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','countabandonedretry','CampaignId','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','syncQueueMember','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','roundrobin','idHopper','isEmpty','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','resolve','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','reachable','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','[uniqueid]','[actions]','clearZombieChannels','sequence','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','UserId','[emptyContact][createHistory]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','callerid','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim'];(function(_0x59bb62,_0x244086){var _0x4157d3=function(_0x5d106b){while(--_0x5d106b){_0x59bb62['push'](_0x59bb62['shift']());}};_0x4157d3(++_0x244086);}(_0x352b,0x96));var _0xb352=function(_0x4a63af,_0x526bdb){_0x4a63af=_0x4a63af-0x0;var _0x5caa78=_0x352b[_0x4a63af];return _0x5caa78;};'use strict';var util=require('util');var _=require(_0xb352('0x0'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0xb352('0x1'));var utils=require(_0xb352('0x2'));var hopperUtils=require(_0xb352('0x3'));var ut=require(_0xb352('0x4'));var config=require(_0xb352('0x5'));var logger=require(_0xb352('0x6'))(_0xb352('0x7'));var loggerBooked=require(_0xb352('0x6'))('booked');var loggerPredictive=require(_0xb352('0x6'))(_0xb352('0x8'));var loggerPredictiveCalls=require(_0xb352('0x6'))(_0xb352('0x9'));var loggerSyncQueueSummary=require(_0xb352('0x6'))(_0xb352('0xa'));var ami=require(_0xb352('0xb'));config[_0xb352('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb352('0xd'))(new Redis(config[_0xb352('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xb352('0xe'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xb352('0xf'));var Action=require('./models/action');var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xb352('0x10'));var Hangup=require('./models/hangup');var ipAgi=process[_0xb352('0x11')][_0xb352('0x12')]||_0xb352('0x13');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb352('0x14')][_0xb352('0x15')]=function(_0xd637d5){this[_0xb352('0x16')]=this['tail']?this[_0xb352('0x16')][_0xb352('0x17')](_0xd637d5):_0xd637d5();};function Dialer(_0x27f964,_0x251fb4){this['sequence']=new Sequence();this[_0xb352('0x18')]=_0x251fb4;this[_0xb352('0x19')]=_0x27f964[_0xb352('0x19')];this[_0xb352('0x1a')]=_0x27f964[_0xb352('0x1a')];this[_0xb352('0x1b')]=_0x27f964[_0xb352('0x1b')];this[_0xb352('0x1c')]=_0x27f964[_0xb352('0x1c')];this['maxNumberOriginate']=config[_0xb352('0x1d')]||0x2;this[_0xb352('0x1e')]={};this['actions']={};this[_0xb352('0x1f')]={};this[_0xb352('0x20')]={};this[_0xb352('0x21')]={};this[_0xb352('0x22')]={};this[_0xb352('0x23')]={};this[_0xb352('0x24')]={};this[_0xb352('0x25')]={};this[_0xb352('0x26')]={};this[_0xb352('0x27')]={};ami['on'](_0xb352('0x28'),this[_0xb352('0x29')][_0xb352('0x2a')](this));ami['on']('queuecallerabandon',this[_0xb352('0x2b')][_0xb352('0x2a')](this));ami['on']('originateresponse',this[_0xb352('0x2c')][_0xb352('0x2a')](this));ami['on'](_0xb352('0x2d'),this[_0xb352('0x2e')][_0xb352('0x2a')](this));ami['on'](_0xb352('0x2f'),this[_0xb352('0xa')]['bind'](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0xb352('0x2a')](this));ami['on'](_0xb352('0x30'),this[_0xb352('0x31')][_0xb352('0x2a')](this));ami['on'](_0xb352('0x32'),this['syncNewExten'][_0xb352('0x2a')](this));ami['on']('varset',this[_0xb352('0x33')]['bind'](this));ami['on'](_0xb352('0x34'),this['syncQueueMember'][_0xb352('0x2a')](this));ami['on'](_0xb352('0x35'),this[_0xb352('0x36')]['bind'](this));this[_0xb352('0x37')]();this[_0xb352('0x38')]();RpcSetting['getSettings']()[_0xb352('0x39')](function(_0x3e1863){previewRecallmeReminderInterval=_0x3e1863['previewRecallmeReminderInterval'];});}function isNotNull(_0x5061ba){return _0x5061ba!==null&&!_['isUndefined'](_0x5061ba);}function msgResponse(_0x343c8d,_0x52ccfa,_0x4defe8){return{'action':_0x343c8d,'response':_0x52ccfa,'message':_0x4defe8,'stack':_0x4defe8};}function emit(_0x15a6de,_0x19ab62,_0x1719e4){io['to'](_0x15a6de)[_0xb352('0x3a')](_0x19ab62,_0x1719e4);}function emitOutboundVoiceQueueSummary(_0xb2a9a2){if(_0xb2a9a2[_0xb352('0x3b')]===_0xb352('0x3c')){logger['debug'](_0xb352('0x3d'),util[_0xb352('0x3e')](_0xb2a9a2,{'showHidden':![],'depth':null}));emit(util[_0xb352('0x3f')](_0xb352('0x40'),_0xb2a9a2[_0xb352('0x41')]),_0xb352('0x42'),_0xb2a9a2);}}function checkGetDataPredictive(_0x45a3bf){if(isNotNull(_0x45a3bf)&&!_['isEmpty'](_0x45a3bf)){loggerPredictive[_0xb352('0x43')](_0xb352('0x44'));loggerPredictive[_0xb352('0x43')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45a3bf['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0xb352('0x45'),_0x45a3bf[_0xb352('0x46')]);loggerPredictive[_0xb352('0x43')](_0xb352('0x47'),_0x45a3bf[_0xb352('0x48')]);loggerPredictive[_0xb352('0x43')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45a3bf[_0xb352('0x49')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45a3bf[_0xb352('0x4a')]);loggerPredictive[_0xb352('0x43')](_0xb352('0x4b'),_0x45a3bf['predictiveIntervalAvgTalktime']);loggerPredictive[_0xb352('0x43')]('---------------------------');if(_0x45a3bf[_0xb352('0x4c')]>0x0){if(!_[_0xb352('0x4d')](_0x45a3bf[_0xb352('0x4e')])&&_0x45a3bf[_0xb352('0x4e')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xb352('0x4d')](_0x45a3bf[_0xb352('0x4a')])&&_0x45a3bf[_0xb352('0x4a')]>0x0){return!![];}loggerPredictive[_0xb352('0x43')](_0xb352('0x4f'));}else{loggerPredictive[_0xb352('0x43')](_0xb352('0x50'));}}else{loggerPredictive[_0xb352('0x43')](_0xb352('0x51'));}return![];}function mergeDataErlangB(_0x4622bd){return function(_0x50010e){loggerPredictive[_0xb352('0x43')](_0xb352('0x52'));loggerPredictive[_0xb352('0x43')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50010e[_0xb352('0x53')]);loggerPredictive[_0xb352('0x43')](_0xb352('0x54'),_0x50010e['erlangCallToSecond']);loggerPredictive[_0xb352('0x43')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50010e[_0xb352('0x55')]);loggerPredictive[_0xb352('0x43')](_0xb352('0x56'),_0x50010e[_0xb352('0x57')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x50010e[_0xb352('0x55')]);loggerPredictive[_0xb352('0x43')]('---------------------------');_[_0xb352('0x58')](_0x4622bd,_0x50010e);};}function ifInterval(_0x2070f0,_0x181991){if(_[_0xb352('0x4d')](_0x181991)){return![];}return utils[_0xb352('0x59')](undefined,_0x181991)<_0x2070f0*0x3c;}function clearPredictiveAttributes(_0x14caed){if(_0x14caed[_0xb352('0x23')]){_0x14caed[_0xb352('0x23')]=undefined;loggerPredictive['debug'](_0x14caed[_0xb352('0x41')],_0xb352('0x5a'));}if(_0x14caed[_0xb352('0x22')]){_0x14caed[_0xb352('0x22')]=undefined;loggerPredictive[_0xb352('0x5b')](_0x14caed[_0xb352('0x41')],_0xb352('0x5c'));}if(_0x14caed[_0xb352('0x5d')]){clearInterval(_0x14caed[_0xb352('0x5d')]);_0x14caed[_0xb352('0x5d')]=undefined;loggerPredictive['debug'](_0x14caed[_0xb352('0x41')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x1fa490,_0xc7ad35){return function(_0x1e8a4e){loggerPredictive['error'](_0xc7ad35[_0xb352('0x41')],_0x1fa490);loggerPredictive['error'](_0x1e8a4e[_0xb352('0x5e')]);clearPredictiveAttributes(_0xc7ad35);};}function loggerCatch(_0x4493ca){return function(_0x4f9533){logger[_0xb352('0x5f')](_0x4493ca,util['inspect'](_0x4f9533,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2331a4,_0x57524d,_0x304414){return function(_0x1ed802){utils[_0xb352('0x60')](_0x57524d,_0x304414,0x0);logger[_0xb352('0x5f')](_0x2331a4,util[_0xb352('0x3e')](_0x1ed802,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2816d3){return function(_0x5f527d){if(isNotNull(_0x5f527d)&&isNotNull(_0x5f527d[0x0])){if(_0x5f527d[0x0][_0xb352('0x61')]>0x0){_0x2816d3['message']=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0xb352('0x43')]('[getContactDialer2][ReScheduled]'+_0x2816d3[_0xb352('0x41')],_0x5f527d[0x0][_0xb352('0x61')],_0xb352('0x62'));}else{_0x2816d3[_0xb352('0x63')]=utils[_0xb352('0x64')][_0xb352('0x65')];logger['info']('[getContactDialer2][Empty]'+_0x2816d3['name']);}}};}function createObjHistory(_0x14784e,_0x3fbb12,_0x4035a6,_0x47d16b,_0x1e7fad){_0x14784e[_0xb352('0x63')]=_0x4035a6;var _0x2a214d=new Action(_0x14784e,_0x3fbb12);var _0x51fe3f=new History(_0x2a214d);_0x51fe3f[_0xb352('0x66')]=_0x47d16b;_0x51fe3f[_0xb352('0x67')]=_0x1e7fad;_0x51fe3f[_0xb352('0x68')]=_0x2a214d[_0xb352('0x69')];return _0x51fe3f;}function unlockQueueStatus(_0x4c6526,_0x546365){setTimeout(function(){if(_['isUndefined'](_0x4c6526['queueStatusComplete'])){loggerBooked[_0xb352('0x5f')](_0xb352('0x6a'),_0x546365);}_0x4c6526[_0xb352('0x6b')]=!![];loggerBooked[_0xb352('0x43')](_0xb352('0x6c'),_0x546365,JSON[_0xb352('0x6d')](_[_0xb352('0x6e')](_0x4c6526,['name',_0xb352('0x6b')])));},0x1f3);}function checkInterval(_0x300f78){return function(){if(!isNotNull(_0x300f78[_0xb352('0x6f')])){_0x300f78['message']=utils[_0xb352('0x64')]['NULL_INTERVAL'];throw _0x300f78['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x300f78['Interval']['Intervals'])){_0x300f78['message']=utils[_0xb352('0x64')][_0xb352('0x70')];throw _0x300f78[_0xb352('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x300f78[_0xb352('0x6f')]['Intervals']))){_0x300f78[_0xb352('0x63')]=utils[_0xb352('0x64')]['NULL_INTERVAL'];throw _0x300f78[_0xb352('0x41')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x8bc20b){return function(){if(!utils[_0xb352('0x71')](_0x8bc20b)){_0x8bc20b['message']=utils[_0xb352('0x64')][_0xb352('0x72')];throw _0x8bc20b[_0xb352('0x41')]+_0xb352('0x73');}};}function emitCampaignSummary(_0x5a008e){if(utils[_0xb352('0x74')](_0x5a008e)){emit(util[_0xb352('0x3f')](_0xb352('0x75'),_0x5a008e['name']),_0xb352('0x76'),_0x5a008e);}}function loggerCatchQueueSummary(_0x50b204,_0x179a28){return function(_0x3f1ede){clearPredictiveAttributes(_0x179a28);emitCampaignSummary(_0x179a28);loggerSyncQueueSummary[_0xb352('0x5b')](_0x50b204,util[_0xb352('0x3e')](_0x3f1ede,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x22b525){if(_0x22b525[_0xb352('0x77')]){if(_0x22b525[_0xb352('0x78')]===0x0){_0x22b525['sendMessageOneNotActive']=![];_0x22b525[_0xb352('0x63')]=utils['CAMPAIGN_STATUS'][_0xb352('0x72')];loggerSyncQueueSummary[_0xb352('0x5b')](_0xb352('0x79'),_0x22b525[_0xb352('0x41')],_0xb352('0x7a'));}else{_0x22b525[_0xb352('0x63')]=utils[_0xb352('0x64')][_0xb352('0x7b')];loggerSyncQueueSummary[_0xb352('0x5b')](_0xb352('0x79'),_0x22b525['name'],_0xb352('0x7c'));}emitCampaignSummary(_0x22b525);}}function myreject(_0x4aacf9){return function(_0x5a78ae){return _0x4aacf9(msgResponse(_0xb352('0x7d'),_0xb352('0x7e'),JSON[_0xb352('0x6d')](_0x5a78ae)));};}Dialer['prototype'][_0xb352('0x7f')]=function(_0x1653ad){return!_[_0xb352('0x4d')](_0x1653ad)&&_0x1653ad&&!_['isUndefined'](_0x1653ad['name'])&&!_[_0xb352('0x4d')](_0x1653ad['active'])&&_0x1653ad['active']&&(this[_0xb352('0x1c')][util['format'](_0xb352('0x80'),_0x1653ad[_0xb352('0x41')])][_0xb352('0x81')]==='reachable'||this[_0xb352('0x1c')][util[_0xb352('0x3f')](_0xb352('0x80'),_0x1653ad[_0xb352('0x41')])][_0xb352('0x81')]===_0xb352('0x82'));};Dialer[_0xb352('0x14')][_0xb352('0x83')]=function(_0x4029da){var _0xcfbfca=this;return function(){if(!_0xcfbfca[_0xb352('0x7f')](_0x4029da[_0xb352('0x84')])){if(!_0xcfbfca[_0xb352('0x7f')](_0x4029da[_0xb352('0x85')])){_0x4029da[_0xb352('0x63')]=utils['CAMPAIGN_STATUS'][_0xb352('0x86')];throw _0x4029da[_0xb352('0x41')]+_0xb352('0x87');}}};};Dialer['prototype'][_0xb352('0x88')]=function(_0x1cb060,_0x3c7433,_0x37800b,_0x5cac1b){var _0x13b6f9=this;return function(){var _0x336b02=!![];return _0x13b6f9[_0xb352('0x89')](_0x1cb060,_0x3c7433,_0x37800b,_0x5cac1b,_0x336b02);};};Dialer[_0xb352('0x14')]['checkIfTimeIntervals']=function(_0x397764,_0xda8cde,_0x407ecb,_0x33f486){var _0x5cdacb=this;return function(){var _0x2f8d5c=![];return _0x5cdacb['ifTimeIvr'](_0x397764[_0xb352('0x8a')],_0xda8cde,_0x407ecb,_0x33f486,_0x2f8d5c);};};Dialer[_0xb352('0x14')]['ifTimeIvr']=function(_0x434f38,_0x4be30f,_0x43e299,_0x15d55b,_0x4cad36){var _0x52951b=[];return new Promise(function(_0x483011,_0x5c5769){if(!isNotNull(_0x434f38)){_0x15d55b[_0xb352('0x63')]=utils[_0xb352('0x64')][_0xb352('0x70')];return _0x5c5769(msgResponse(_0xb352('0x8b'),_0xb352('0x8c'),_0x43e299+_0xb352('0x8d')));}if(_['isEmpty'](_0x434f38)){_0x15d55b[_0xb352('0x63')]=utils[_0xb352('0x64')][_0xb352('0x8e')];return _0x5c5769(msgResponse(_0xb352('0x8b'),_0xb352('0x8c'),_0x43e299+_0xb352('0x8f')));}if(_0x4be30f&&_[_0xb352('0x4d')](config['timezones'][_0x4be30f])){_0x15d55b['message']=utils[_0xb352('0x64')][_0xb352('0x90')];return _0x5c5769(msgResponse('ifTime',_0xb352('0x8c'),_0x43e299+'\x20Timezone\x20unknow\x20'+_0x4be30f));}if(_[_0xb352('0x91')](_0x434f38)){for(var _0x4814e0=0x0;_0x4814e0<_0x434f38[_0xb352('0x92')];_0x4814e0+=0x1){_0x52951b[_0xb352('0x93')](ami['Action']({'action':_0xb352('0x94'),'command':util[_0xb352('0x3f')]('iftime\x20%s,%s',_0x434f38[_0x4814e0]['interval'],!_[_0xb352('0x4d')](config[_0xb352('0x95')][_0x4be30f])?_0x4be30f:'')})[_0xb352('0x39')](function(_0x2ba214){return _0x2ba214[_0xb352('0x96')][_0xb352('0x97')](_0xb352('0x98'))>=0x0;})[_0xb352('0x99')](myreject(_0x5c5769)));}}else{_0x52951b[_0xb352('0x93')](ami[_0xb352('0x9a')]({'action':_0xb352('0x94'),'command':util[_0xb352('0x3f')](_0xb352('0x9b'),_0x434f38,!_[_0xb352('0x4d')](config[_0xb352('0x95')][_0x4be30f])?_0x4be30f:'')})[_0xb352('0x39')](function(_0x4b6ff1){return _0x4b6ff1[_0xb352('0x96')]['indexOf']('true')>=0x0;})['catch'](myreject(_0x5c5769)));}Promise[_0xb352('0x9c')](_0x52951b)[_0xb352('0x39')](function(_0x4f697d){var _0x117287=_[_0xb352('0x9d')](_0x4f697d);if(_0x117287){return _0x483011(_0x117287);}else{_0x15d55b['message']=_0x4cad36?utils['CAMPAIGN_STATUS'][_0xb352('0x9e')]:utils[_0xb352('0x64')][_0xb352('0x9f')];return _0x5c5769(msgResponse(_0xb352('0xa0'),'Failure',_0xb352('0xa1')+_0x4cad36+'\x20'+_0x43e299+_0xb352('0xa2')+util[_0xb352('0x3e')](_0x434f38,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4be30f));}})['catch'](function(_0x84d064){return _0x5c5769(msgResponse(_0xb352('0x8b'),_0xb352('0x8c'),JSON[_0xb352('0x6d')](_0x84d064)));});});};Dialer[_0xb352('0x14')]['loopCampaigns']=function(){var _0x5a6cec=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0xb352('0x39')](function(){setInterval(function(){_0x5a6cec[_0xb352('0xa3')]();},0x3e8);});};Dialer['prototype'][_0xb352('0xa3')]=function(){var _0x1fbd1c=this;var _0x20bb0e;for(var _0x236ff4 in this[_0xb352('0x1a')]){if(typeof this[_0xb352('0x1a')][_0x236ff4]!==_0xb352('0xa4')){_0x20bb0e=this[_0xb352('0x1a')][_0x236ff4];if(utils['isIVRCampaign'](_0x20bb0e)&&utils[_0xb352('0x71')](_0x20bb0e)){_0x20bb0e[_0xb352('0x77')]=!![];Promise['resolve']()[_0xb352('0x39')](checkIsIVRCampaignActive(_0x20bb0e))[_0xb352('0x39')](checkInterval(_0x20bb0e))[_0xb352('0x39')](_0x1fbd1c[_0xb352('0x83')](_0x20bb0e))[_0xb352('0x39')](_0x1fbd1c[_0xb352('0x88')](_0x20bb0e[_0xb352('0xa5')],_0x20bb0e[_0xb352('0xa6')],_0x20bb0e[_0xb352('0x41')],_0x20bb0e))[_0xb352('0x39')](_0x1fbd1c['checkIfTimeIntervals'](_0x20bb0e[_0xb352('0x6f')],_0x20bb0e[_0xb352('0xa6')],_0x20bb0e[_0xb352('0x41')],_0x20bb0e))[_0xb352('0x39')](_0x1fbd1c[_0xb352('0xa7')](_0x20bb0e))[_0xb352('0x99')](loggerCatchQueueSummary(_0xb352('0xa8'),_0x20bb0e));}else{notSendMessagesCampaign(_0x20bb0e);}}}};Dialer['prototype']['checkDialMethod']=function(_0x2852e8){if(_0x2852e8[_0xb352('0xa9')]!==_0xb352('0x8')){clearPredictiveAttributes(_0x2852e8);}switch(_0x2852e8[_0xb352('0xa9')]){case _0xb352('0xaa'):this[_0xb352('0xab')](_0x2852e8,0x1);break;case _0xb352('0xac'):this[_0xb352('0xab')](_0x2852e8,_0x2852e8[_0xb352('0xad')]);break;case _0xb352('0x8'):this[_0xb352('0x8')](_0x2852e8);break;case _0xb352('0xae'):this['handlePower'](_0x2852e8,0x1);break;default:logger[_0xb352('0x5f')](_0xb352('0xaf'),_0x2852e8[_0xb352('0x41')],_0xb352('0xb0'));}};Dialer[_0xb352('0x14')][_0xb352('0x8b')]=function(_0x5d8b11,_0x57a073){var _0x5a7176=_0x5d8b11[_0xb352('0xa6')];var _0x36fc98=_0x57a073?_0x5d8b11[_0xb352('0xa5')]:_0x5d8b11[_0xb352('0x6f')][_0xb352('0x8a')];logger[_0xb352('0xb1')](_0xb352('0xb2'),_0x36fc98,_0x5a7176,_0x5d8b11['name'],util[_0xb352('0x3f')](_0xb352('0xb3'),_0x5d8b11[_0xb352('0x41')],_0x5d8b11['id']));var _0x715b1e=null;return Interval[_0xb352('0xb4')](_0x36fc98,_0x5a7176)[_0xb352('0x39')](function(_0x5f2702){if(_0x5f2702===!![]){return _0x5f2702;}else{_0x5d8b11[_0xb352('0x63')]=_0x57a073?utils[_0xb352('0x64')][_0xb352('0x9e')]:utils[_0xb352('0x64')][_0xb352('0x9f')];_0x715b1e=msgResponse(_0xb352('0xa0'),'Failure',_0xb352('0xa1')+_0x57a073+'\x20'+_0x5d8b11[_0xb352('0x41')]+_0xb352('0xa2')+util[_0xb352('0x3e')](_0x36fc98,{'showHidden':![],'depth':null})+_0xb352('0xb5')+_0x5a7176);}if(_0x715b1e!==null){logger[_0xb352('0xb1')](_0xb352('0xb6'),_0x715b1e);_0x715b1e[_0xb352('0xb7')]=_0x57a073;throw _0x715b1e;}})[_0xb352('0x99')](function(_0x753a3c){logger[_0xb352('0x5f')](_0xb352('0xb8'),_0x753a3c);throw msgResponse(_0xb352('0x7d'),_0xb352('0x7e'),util[_0xb352('0x3e')](_0x753a3c,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xb352('0x29')]=function(_0x368d8f){if(this[_0xb352('0x19')][_0x368d8f['queue']]){if(this[_0xb352('0x20')][_0x368d8f['uniqueid']]&&this['uniqueId'][_0x368d8f['uniqueid']][_0xb352('0x3b')]!=='ivr'){this['updateOriginated'](this[_0xb352('0x19')][_0x368d8f[_0xb352('0xb9')]]);this[_0xb352('0x20')][_0x368d8f[_0xb352('0xba')]][_0xb352('0xbb')]=moment()[_0xb352('0x3f')](_0xb352('0xbc'));}}};Dialer['prototype'][_0xb352('0x2e')]=function(_0x3be902){var _0x54bbf3=this[_0xb352('0x20')][_0x3be902[_0xb352('0xba')]];if(this['voiceQueues'][_0x3be902['queue']]){if(_0x54bbf3&&_0x54bbf3[_0xb352('0x3b')]!==_0xb352('0xbd')){delete this[_0xb352('0x20')][_0x3be902[_0xb352('0xba')]];this['voiceQueues'][_0x3be902['queue']][_0xb352('0xbe')]+=0x1;var _0x24cc1e=new AgentComplete(_0x54bbf3,_0x3be902);if(_0x3be902[_0xb352('0xbf')]===_0xb352('0xc0')){_0x24cc1e[_0xb352('0xc1')]=this[_0xb352('0x19')][_0x3be902[_0xb352('0xb9')]]['dialQueueProject2']&&this['voiceQueues'][_0x3be902[_0xb352('0xb9')]]['dialAgiAfterHangupAgent']?moment()[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xb352('0xc2')](_0x24cc1e)[_0xb352('0x99')](loggerCatch(_0xb352('0xc3')));hopperUtils[_0xb352('0xc4')](_0x24cc1e)[_0xb352('0x99')](loggerCatch(_0xb352('0xc5')));}}};Dialer[_0xb352('0x14')][_0xb352('0x2b')]=function(_0x4c7460){var _0x4e83f3=this[_0xb352('0x20')][_0x4c7460[_0xb352('0xba')]];var _0x1a01b9=this;var _0x4b0214=![];var _0x5c5519;var _0x2faccb;if(this['voiceQueues'][_0x4c7460[_0xb352('0xb9')]]){if(_0x4e83f3&&_0x4e83f3[_0xb352('0x3b')]!==_0xb352('0xbd')){delete this[_0xb352('0x20')][_0x4c7460[_0xb352('0xba')]];this[_0xb352('0xc6')](this[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]]);_0x4e83f3['droptime']=moment()[_0xb352('0x3f')](_0xb352('0xbc'));var _0x1bfb2a=new QueueCallerAbandon(_0x4e83f3,_0x4c7460);if(utils[_0xb352('0x59')](_0x4e83f3['droptime'],_0x4e83f3[_0xb352('0xc7')])>=_0x4e83f3[_0xb352('0xc8')]){this[_0xb352('0x19')][_0x4c7460['queue']][_0xb352('0x48')]+=0x1;this['voiceQueues'][_0x4c7460['queue']][_0xb352('0xc9')]+=0x1;this[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xca')]+=0x1;_0x1bfb2a['state']=0xa;_0x1bfb2a[_0xb352('0x67')]=_0xb352('0xcb');_0x1bfb2a[_0xb352('0xcc')]=_0xb352('0xcd');_0x1bfb2a[_0xb352('0xc1')]=this[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]]['dialQueueProject2']?moment()['format'](_0xb352('0xbc')):undefined;_0x1bfb2a[_0xb352('0xce')]+=0x1;_0x1bfb2a[_0xb352('0xcf')]+=0x1;_0x5c5519=this[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xd0')];_0x2faccb=this[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xd1')];hopperUtils[_0xb352('0xd2')](_0x1bfb2a,_0x1bfb2a[_0xb352('0x66')],_0x4e83f3[_0xb352('0xd3')])[_0xb352('0x39')](function(_0xa02d64){_0x4b0214=_0xa02d64['additional']==0x1;if(_0x1bfb2a['countdropretry']>=_0x1a01b9['voiceQueues'][_0x4c7460['queue']][_0xb352('0xd4')]){_0x1a01b9[_0xb352('0xd5')](_0x1bfb2a,_0xa02d64[_0xb352('0xd6')]);}else{hopperUtils[_0xb352('0xd7')]({'active':![],'countdropretry':_0x1bfb2a[_0xb352('0xce')],'scheduledat':moment()[_0xb352('0xd8')](_0x1a01b9[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xd0')],_0xb352('0xd9'))[_0xb352('0x3f')](_0xb352('0xbc')),'ContactId':_0x4e83f3[_0xb352('0xda')],'ListId':_0x4e83f3[_0xb352('0xdb')],'VoiceQueueId':_0x4e83f3[_0xb352('0xdc')]||undefined,'CampaignId':_0x4e83f3['CampaignId']||undefined})['catch'](loggerCatch(_0xb352('0xdd')));var _0x403f53=new History(_0x1bfb2a);_0x403f53[_0xb352('0x66')]=0xa;_0x403f53['statedesc']='Drop';_0x403f53[_0xb352('0x69')]=moment()[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x403f53[_0xb352('0x68')]=_0x403f53['starttime'];_0x403f53[_0xb352('0xde')]=_0x1bfb2a[_0xb352('0xde')];_0x403f53[_0xb352('0xdf')]=_0x1bfb2a[_0xb352('0xdf')];hopperUtils[_0xb352('0xc2')](_0x403f53)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0xb352('0x39')](function(){if(_0x4b0214)hopperUtils[_0xb352('0xe0')](_0x1bfb2a,_0x5c5519,_0x2faccb)[_0xb352('0x39')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4c7460['queue']][_0xb352('0x49')]+=0x1;this['voiceQueues'][_0x4c7460[_0xb352('0xb9')]]['outboundDropCallsDayCallersExit']+=0x1;_0x1bfb2a[_0xb352('0x66')]=0xb;_0x1bfb2a[_0xb352('0x67')]='Abandoned';_0x1bfb2a[_0xb352('0xcc')]=_0xb352('0xe1');_0x1bfb2a['countabandonedretry']+=0x1;_0x1bfb2a[_0xb352('0xcf')]+=0x1;_0x5c5519=this['voiceQueues'][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xe2')];_0x2faccb=this[_0xb352('0x19')][_0x4c7460['queue']][_0xb352('0xd1')];hopperUtils[_0xb352('0xd2')](_0x1bfb2a,_0x1bfb2a[_0xb352('0x66')],_0x4e83f3['voiceQueue'])[_0xb352('0x39')](function(_0x528494){if(_0x1bfb2a['countabandonedretry']>=_0x1a01b9[_0xb352('0x19')][_0x4c7460[_0xb352('0xb9')]][_0xb352('0xe3')]){_0x1a01b9[_0xb352('0xd5')](_0x1bfb2a,_0x528494[_0xb352('0xd6')]);}else{hopperUtils[_0xb352('0xd7')]({'active':![],'countabandonedretry':_0x1bfb2a[_0xb352('0xe4')],'scheduledat':moment()[_0xb352('0xd8')](_0x1a01b9['voiceQueues'][_0x4c7460['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4e83f3['ContactId'],'ListId':_0x4e83f3['ListId'],'VoiceQueueId':_0x4e83f3['VoiceQueueId']||undefined,'CampaignId':_0x4e83f3[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x35a3bd=new History(_0x1bfb2a);_0x35a3bd['state']=0xb;_0x35a3bd[_0xb352('0x67')]=_0xb352('0xe6');_0x35a3bd[_0xb352('0x69')]=moment()['format'](_0xb352('0xbc'));_0x35a3bd['endtime']=_0x35a3bd[_0xb352('0x69')];_0x35a3bd[_0xb352('0xde')]=_0x1bfb2a['calleridname'];_0x35a3bd[_0xb352('0xdf')]=_0x1bfb2a[_0xb352('0xdf')];hopperUtils[_0xb352('0xc2')](_0x35a3bd)['catch'](loggerCatch(_0xb352('0xe7')));}})[_0xb352('0x39')](function(){if(_0x4b0214)hopperUtils[_0xb352('0xe0')](_0x1bfb2a,_0x5c5519,_0x2faccb)['then'](function(){return 0x1;});});}}}};Dialer[_0xb352('0x14')][_0xb352('0xe8')]=function(_0x151a8f){if(this[_0xb352('0xe9')][_0x151a8f[_0xb352('0xba')]]){this['actions'][_0x151a8f[_0xb352('0xba')]]['channel']=_0x151a8f[_0xb352('0xea')];}if(this[_0xb352('0x20')][_0x151a8f[_0xb352('0xba')]]){this[_0xb352('0x20')][_0x151a8f[_0xb352('0xba')]][_0xb352('0xea')]=_0x151a8f[_0xb352('0xea')];}};Dialer[_0xb352('0x14')][_0xb352('0xeb')]=function(_0x38e7a0){if(!this[_0xb352('0xe9')][_0x38e7a0[_0xb352('0xec')]]){return;}var _0xd89aa8=this['voiceQueues'][this[_0xb352('0xe9')][_0x38e7a0['actionid']][_0xb352('0xb9')]][_0xb352('0xed')]||_0xb352('0xee');if(_0xd89aa8==='roundrobin'){if(this[_0xb352('0xe9')][_0x38e7a0['actionid']]&&_[_0xb352('0xef')](this[_0xb352('0xe9')][_0x38e7a0[_0xb352('0xec')]][_0xb352('0xf0')])&&_0x38e7a0[_0xb352('0x81')]==='1'&&_0x38e7a0[_0xb352('0xf1')]==='0'){if(this[_0xb352('0x1b')][_0x38e7a0[_0xb352('0xf2')]]){if(!this[_0xb352('0x1b')][_0x38e7a0[_0xb352('0xf2')]]['locked']){this[_0xb352('0x1b')][_0x38e7a0[_0xb352('0xf2')]][_0xb352('0xf0')]=!![];this[_0xb352('0xe9')][_0x38e7a0['actionid']][_0xb352('0xf0')]=!![];this['actions'][_0x38e7a0[_0xb352('0xec')]][_0xb352('0xf2')]=_0x38e7a0[_0xb352('0xf2')];}}}}else if(_0xd89aa8==='rrmemory'){if(this[_0xb352('0xe9')][_0x38e7a0['actionid']]){if(this[_0xb352('0x1b')][_0x38e7a0[_0xb352('0xf2')]]){this[_0xb352('0xe9')][_0x38e7a0['actionid']][_0xb352('0xf2')]=_0x38e7a0[_0xb352('0xf2')];if(_[_0xb352('0xef')](this['queueBooked'][this['actions'][_0x38e7a0[_0xb352('0xec')]][_0xb352('0xb9')]])){this['queueBooked'][this['actions'][_0x38e7a0[_0xb352('0xec')]]['queue']]=[];}this['queueBooked'][this[_0xb352('0xe9')][_0x38e7a0[_0xb352('0xec')]][_0xb352('0xb9')]][_0xb352('0x93')](_[_0xb352('0x58')](_['pick'](this[_0xb352('0xe9')][_0x38e7a0[_0xb352('0xec')]],['idHopper',_0xb352('0xf2')]),{'status':_0x38e7a0['status'],'paused':_0x38e7a0['paused']}));}}}};Dialer[_0xb352('0x14')][_0xb352('0x36')]=function(_0xeb338f){if(!this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]){return;}var _0x365f93=this;var _0x43db50=this[_0xb352('0x19')][this[_0xb352('0xe9')][_0xeb338f['actionid']][_0xb352('0xb9')]];var _0x29b609=_0x43db50[_0xb352('0xed')]||_0xb352('0xee');if(_0x29b609===_0xb352('0xf3')){if(this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]&&this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xf2')]){this['preview']['run'](this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xf4')],this[_0xb352('0xe9')][_0xeb338f['actionid']][_0xb352('0xf2')])['catch'](function(_0x33943a){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xb352('0x3e')](_0x33943a,{'showHidden':![],'depth':null}));})['finally'](function(){_0x365f93[_0xb352('0xc6')](_0x365f93[_0xb352('0x19')][_0x365f93['actions'][_0xeb338f[_0xb352('0xec')]]['queue']]);_0x365f93[_0xb352('0x1b')][_0x365f93[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xf2')]][_0xb352('0xf0')]=![];delete _0x365f93[_0xb352('0xe9')][_0xeb338f['actionid']];unlockQueueStatus(_0x43db50);});}else{this['updateOriginated'](this[_0xb352('0x19')][this['actions'][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0xeb338f['actionid']]['ContactId'],'ListId':this['actions'][_0xeb338f['actionid']]['ListId'],'VoiceQueueId':this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xdc')]||undefined,'CampaignId':this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]['CampaignId']||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]];unlockQueueStatus(_0x43db50);}}else if(_0x29b609===_0xb352('0xee')){var _0x3ad264;if(this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]&&!_[_0xb352('0xf5')](this[_0xb352('0x25')][this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]['queue']])){if(this[_0xb352('0x26')][_0x365f93[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]]){this[_0xb352('0x26')][_0x365f93[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]]['queue']]=this[_0xb352('0x26')][this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]]?this[_0xb352('0x26')][this[_0xb352('0xe9')][_0xeb338f['actionid']][_0xb352('0xb9')]]:this['queueBooked'][this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]]?this['queueBooked'][this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]][_0xb352('0xf6')]||0x0:0x0;}this['queueBooked'][this['actions'][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]]['_rr']=this['queueBookedRR'][this[_0xb352('0xe9')][_0xeb338f[_0xb352('0xec')]][_0xb352('0xb9')]];for(var _0x4dcf14=0x0;_0x4dcf14=_0x152426[_0xb352('0x11e')]){_0x2d09a9[_0xb352('0x11f')](_0xe158b,_0x1ba5cd,_0x35d1db,_0xb352('0x120'));}else{if(_0xe158b[_0xb352('0x119')]>=_0x152426[_0xb352('0x121')]){_0x2d09a9[_0xb352('0x122')](_0xe158b,_0x1ba5cd,_0x35d1db,_0xb352('0x123'));}else{hopperUtils[_0xb352('0xd7')]({'active':![],'countmachineretry':_0xe158b[_0xb352('0x119')],'scheduledat':moment()[_0xb352('0xd8')](_0x152426[_0xb352('0x124')],'minutes')['format'](_0xb352('0xbc')),'ContactId':_0xe158b[_0xb352('0xda')],'ListId':_0xe158b[_0xb352('0xdb')],'VoiceQueueId':_0xe158b['VoiceQueueId']||undefined,'CampaignId':_0xe158b[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch('[rescheduleContact][Machine]'));_0x1ba5cd({'reschedule':0x1});}}});}if(_0x3a9df7[_0xb352('0x3b')]===_0xb352('0xbd')&&this[_0xb352('0x1a')][_0x3a9df7[_0xb352('0xb9')]]['dialAMDActive']&&_0x560b8f[_0xb352('0x10c')]==='HANGUP'){delete this[_0xb352('0x20')][_0x560b8f[_0xb352('0xba')]];this[_0xb352('0xc6')](this['campaigns'][_0x3a9df7['queue']]);_0x28ee8d=new Hangup(_0x3a9df7,_0x560b8f);_0x28ee8d[_0xb352('0x66')]=0x12;_0x28ee8d[_0xb352('0x67')]=_0xb352('0x10f');_0x28ee8d[_0xb352('0x118')]='AMD';ami[_0xb352('0x3a')](_0xb352('0x111'),ut['buildObj'](_0x28ee8d,'amd'));this['saveInDb'](_0x28ee8d,_0xb352('0x125'),_0xb352('0x126'));}if(_0x3a9df7[_0xb352('0x3b')]===_0xb352('0xbd')&&this[_0xb352('0x1a')][_0x3a9df7[_0xb352('0xb9')]][_0xb352('0x10b')]&&_0x560b8f[_0xb352('0x10c')]===_0xb352('0x116')){return new Promise(function(_0x4bca91,_0x490e37){delete _0x2d09a9[_0xb352('0x20')][_0x560b8f[_0xb352('0xba')]];_0x2d09a9[_0xb352('0xc6')](_0x2d09a9[_0xb352('0x1a')][_0x3a9df7[_0xb352('0xb9')]]);_0x2d09a9[_0xb352('0x1a')][_0x3a9df7['queue']]['outboundAnswerCallsDay']+=0x1;_0x2d09a9['campaigns'][_0x3a9df7[_0xb352('0xb9')]][_0xb352('0x10e')]+=0x1;var _0x5222f3=_0x2d09a9[_0xb352('0x1a')][_0x3a9df7['queue']];var _0x160fdf=new Hangup(_0x3a9df7,_0x560b8f);_0x160fdf[_0xb352('0x66')]=0x13;_0x160fdf[_0xb352('0x67')]='Machine';_0x160fdf['membername']=_0xb352('0x110');_0x160fdf[_0xb352('0x119')]+=0x1;_0x160fdf[_0xb352('0xcf')]+=0x1;_0x160fdf[_0xb352('0x113')]=!![];ami[_0xb352('0x3a')](_0xb352('0x111'),ut[_0xb352('0x112')](_0x160fdf,'amd'));hopperUtils[_0xb352('0xc2')](_0x160fdf)[_0xb352('0x99')](loggerCatch(_0xb352('0x11a')));if(_0x160fdf[_0xb352('0x11b')]+_0x160fdf['countcongestionretry']+_0x160fdf[_0xb352('0x11d')]+_0x160fdf['countnosuchnumberretry']+_0x160fdf[_0xb352('0xce')]+_0x160fdf[_0xb352('0xe4')]+_0x160fdf[_0xb352('0x119')]+_0x160fdf['countagentrejectretry']>=_0x5222f3['dialGlobalMaxRetry']){_0x2d09a9[_0xb352('0x11f')](_0x160fdf,_0x4bca91,_0x490e37,'reason19\x20machine....');}else{if(_0x160fdf['countmachineretry']>=_0x5222f3[_0xb352('0x121')]){_0x2d09a9['createStateFinal'](_0x160fdf,_0x4bca91,_0x490e37,'reason\x2019\x20machine....');}else{hopperUtils[_0xb352('0xd7')]({'active':![],'countmachineretry':_0x160fdf['countmachineretry'],'scheduledat':moment()[_0xb352('0xd8')](_0x5222f3['dialMachineRetryFrequency'],'minutes')[_0xb352('0x3f')](_0xb352('0xbc')),'ContactId':_0x160fdf[_0xb352('0xda')],'ListId':_0x160fdf[_0xb352('0xdb')],'VoiceQueueId':_0x160fdf['VoiceQueueId']||undefined,'CampaignId':_0x160fdf[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x127')));_0x4bca91({'reschedule':0x1});}}});}}};Dialer[_0xb352('0x14')][_0xb352('0x31')]=function(_0x24e9e4){var _0x17d148=this[_0xb352('0x20')][_0x24e9e4['uniqueid']];var _0x2620d5;if(_0x17d148&&_0x17d148[_0xb352('0x3b')]===_0xb352('0xbd')){delete this['uniqueId'][_0x24e9e4['uniqueid']];this['updateOriginated'](this[_0xb352('0x1a')][_0x17d148[_0xb352('0xb9')]]);this['campaigns'][_0x17d148['queue']][_0xb352('0x128')]+=0x1;_0x2620d5=new Hangup(_0x17d148,_0x24e9e4);hopperUtils[_0xb352('0xc2')](_0x2620d5)[_0xb352('0x99')](loggerCatch(_0xb352('0x129')));hopperUtils[_0xb352('0xc4')](_0x2620d5)[_0xb352('0x99')](loggerCatch(_0xb352('0x12a')));}if(_0x17d148&&_0x17d148['type']!==_0xb352('0xbd')&&isNotNull(this[_0xb352('0x19')][_0x17d148[_0xb352('0xb9')]]['dialQueueProject'])){delete this[_0xb352('0x20')][_0x24e9e4[_0xb352('0xba')]];this[_0xb352('0xc6')](this[_0xb352('0x19')][_0x17d148['queue']]);this['voiceQueues'][_0x17d148['queue']][_0xb352('0xbe')]+=0x1;this[_0xb352('0x19')][_0x17d148[_0xb352('0xb9')]][_0xb352('0x10e')]+=0x1;_0x2620d5=new Hangup(_0x17d148,_0x24e9e4);_0x2620d5[_0xb352('0x66')]=0x10;_0x2620d5['statedesc']=_0xb352('0x12b');_0x2620d5[_0xb352('0x118')]=_0xb352('0x12c');hopperUtils[_0xb352('0xc2')](_0x2620d5)[_0xb352('0x99')](loggerCatch(_0xb352('0x129')));hopperUtils[_0xb352('0xc4')](_0x2620d5)['catch'](loggerCatch(_0xb352('0x12a')));}if(_0x17d148&&_0x17d148['type']!=='ivr'&&!isNotNull(this[_0xb352('0x19')][_0x17d148['queue']][_0xb352('0x12d')])){delete this[_0xb352('0x20')][_0x24e9e4[_0xb352('0xba')]];this[_0xb352('0xc6')](this[_0xb352('0x19')][_0x17d148[_0xb352('0xb9')]]);this[_0xb352('0x19')][_0x17d148[_0xb352('0xb9')]][_0xb352('0x12e')]+=0x1;_0x2620d5=new Hangup(_0x17d148,_0x24e9e4);_0x2620d5[_0xb352('0x66')]=0xc;_0x2620d5[_0xb352('0x67')]=_0x24e9e4[_0xb352('0x12f')];_0x2620d5[_0xb352('0x118')]=_0xb352('0x130');hopperUtils['createHistory'](_0x2620d5)[_0xb352('0x99')](loggerCatch(_0xb352('0x129')));hopperUtils['moveContactManagedDialer'](_0x2620d5)[_0xb352('0x99')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xb352('0x14')][_0xb352('0xa')]=function(_0x27b165){var _0xa2d02a=this;if(!_0xa2d02a[_0xb352('0x27')][_0x27b165['name']]){_0xa2d02a['queuesSummary'][_0x27b165[_0xb352('0x41')]]={'running':![]};}else if(_0xa2d02a[_0xb352('0x27')][_0x27b165[_0xb352('0x41')]]['running']===!![]){return;}else if(_0xa2d02a[_0xb352('0x27')][_0x27b165[_0xb352('0x41')]][_0xb352('0x131')]===![]){_0xa2d02a[_0xb352('0x27')][_0x27b165['name']][_0xb352('0x131')]=!![];}var _0x515f53=_0xa2d02a[_0xb352('0x19')][_0x27b165[_0xb352('0x41')]];var _0x1bd5a5=_0x515f53[_0xb352('0x63')]!==utils[_0xb352('0x64')][_0xb352('0x72')];var _0x3a0500=utils['isPreviewCampaign'](_0x515f53);_0x515f53[_0xb352('0x132')]=utils['getQueueCampaignStatusMessage'](_0x515f53,_0xa2d02a[_0xb352('0x1c')]);Promise[_0xb352('0x133')]()[_0xb352('0x39')](function(){if(_0x515f53['statusMessage']===utils[_0xb352('0x64')][_0xb352('0x72')]){if(_0x1bd5a5){clearPredictiveAttributes(_0x515f53);_0x27b165['startPredictive']=undefined;_0x27b165['startProgressive']=undefined;}if(_0x515f53[_0xb352('0x132')]===utils[_0xb352('0x64')]['INACTIVE']){_0x27b165[_0xb352('0x134')]=0x0;_0x27b165['paused']=0x0;_0x27b165['inUse']=0x0;_0x27b165[_0xb352('0x135')]=0x0;_0x27b165[_0xb352('0x136')]=0x0;}}else if(_0x515f53[_0xb352('0x132')]===utils[_0xb352('0x64')][_0xb352('0x137')]&&!_0x3a0500){return _0xa2d02a[_0xb352('0x8b')](_0x515f53,!![])[_0xb352('0x39')](function(){return _0xa2d02a[_0xb352('0x8b')](_0x515f53,![]);})[_0xb352('0x39')](function(){return _0xa2d02a['checkDialMethod'](_0x515f53);})['catch'](function(_0x2cea29){loggerSyncQueueSummary[_0xb352('0x5b')](_0xb352('0x138'),util[_0xb352('0x3e')](_0x2cea29,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x515f53);});}else{clearPredictiveAttributes(_0x515f53);}})[_0xb352('0x39')](function(){var _0x4490d5=_0x27b165[_0xb352('0x139')](_0x515f53);if(_0x4490d5||_0x515f53[_0xb352('0x13a')]){_0x515f53[_0xb352('0x13a')]=![];_0x27b165[_0xb352('0x13b')](_0x515f53);Object['assign'](_0x515f53,_0x27b165);emitOutboundVoiceQueueSummary(_0x27b165);}_0xa2d02a[_0xb352('0x27')][_0x515f53[_0xb352('0x41')]][_0xb352('0x131')]=![];})[_0xb352('0x99')](function(_0x1eebde){logger[_0xb352('0x5f')](_0xb352('0x138'),util['inspect'](_0x1eebde,{'showHidden':![],'depth':null}));_0xa2d02a[_0xb352('0x27')][_0x515f53[_0xb352('0x41')]][_0xb352('0x131')]=![];});};Dialer['prototype'][_0xb352('0x13c')]=_[_0xb352('0x13d')](function(){var _0x4c2382=_['filter'](this['voiceQueues'],function(_0x1e82ea){return _0x1e82ea[_0xb352('0x13e')];});var _0x44b36b=_[_0xb352('0x13f')](this[_0xb352('0x1b')],function(_0x361d6e){return _0x361d6e['online']&&_0x361d6e['status']===_0xb352('0x140');});if(_0x4c2382[_0xb352('0x92')]>0x0&&_0x44b36b['length']>0x0){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0xb352('0x141')](_0x4c2382,'id'),previewRecallmeReminderInterval,_['map'](_0x44b36b,'id')))['then'](function(_0x5512b2){for(var _0x221ea4=0x0;_0x221ea4<_0x5512b2['length'];_0x221ea4++){var _0x14c5df=_0x5512b2[_0x221ea4]['Agent'][_0xb352('0x41')];if(_0x14c5df)io['to'](util['format'](_0xb352('0x142'),_0x14c5df))['emit'](_0xb352('0x143'),{'hopper':_0x5512b2[_0x221ea4]});}})[_0xb352('0x99')](function(_0x3286ed){logger[_0xb352('0x5f')](_0xb352('0x144'),_0x3286ed);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xb352('0x14')]['loopClearZombieChannels']=function(){var _0x3522a9=this;setInterval(function(){_0x3522a9['clearZombieChannels'](_0x3522a9[_0xb352('0x20')],_0xb352('0x145'));_0x3522a9['clearZombieChannels'](_0x3522a9['actions'],_0xb352('0x146'));},0x32c8);};Dialer[_0xb352('0x14')][_0xb352('0x147')]=function(_0x4444bc,_0x1cb30d){var _0x264888=this;for(var _0x1af103 in _0x4444bc){if(typeof _0x4444bc[_0x1af103]!==_0xb352('0xa4')){this[_0xb352('0x148')]['enqueue'](function(){if(!_[_0xb352('0xef')](_0x4444bc[_0x1af103])){return ami['Action']({'action':'status','channel':_0x4444bc[_0x1af103][_0xb352('0xea')]})['catch'](function(_0x41fe6d){if(_0x41fe6d[_0xb352('0x63')]===_0xb352('0x149')){setTimeout(function(){if(_0x4444bc[_0x1af103]&&_0x4444bc[_0x1af103][_0xb352('0x3b')]!==_0xb352('0xbd')){_0x264888[_0xb352('0xc6')](_0x264888[_0xb352('0x19')][_0x4444bc[_0x1af103][_0xb352('0xb9')]]);logger[_0xb352('0x5f')]('[Dialer][checkChannel]',_0x1cb30d,_0x1af103,_0x4444bc[_0x1af103][_0xb352('0xb9')]);delete _0x4444bc[_0x1af103];}if(_0x4444bc[_0x1af103]&&_0x4444bc[_0x1af103]['type']===_0xb352('0xbd')){_0x264888['updateOriginated'](_0x264888[_0xb352('0x1a')][_0x4444bc[_0x1af103][_0xb352('0xb9')]]);logger[_0xb352('0x5f')](_0xb352('0x14a'),_0x1cb30d,_0x1af103,_0x4444bc[_0x1af103]['queue']);delete _0x4444bc[_0x1af103];}},0x2328);}});}});}}};Dialer[_0xb352('0x14')][_0xb352('0x14b')]=function(_0x40d128){return Promise['resolve']()[_0xb352('0x39')](voiceQueueRt[_0xb352('0x14b')](_0x40d128))[_0xb352('0x99')](loggerCatch(_0xb352('0x14c')));};Dialer[_0xb352('0x14')]['updateOriginated']=function(_0x4b036a){if(!_['isUndefined'](_0x4b036a)&&_0x4b036a!==null){if(typeof _0x4b036a[_0xb352('0x78')]!==_0xb352('0xa4')){if(_0x4b036a[_0xb352('0x78')]>0x0){_0x4b036a['originated']-=0x1;}else{logger[_0xb352('0x5f')](_0xb352('0x14d'));}}}else{logger['error'](_0xb352('0x14e'));}};Dialer[_0xb352('0x14')]['loggerHandler']=function(_0x5d51cd,_0xe340e){var _0x12af5f=this;return function(_0x1d8a61){_0x12af5f[_0xb352('0xc6')](_0xe340e);logger[_0xb352('0x5f')](_0x5d51cd,util['inspect'](_0x1d8a61,{'showHidden':![],'depth':null}));};};Dialer[_0xb352('0x14')]['emptyContact']=function(_0x59e6b1,_0xec3e12,_0x2a1dd7){var _0xb27899={'state':0x19,'statedesc':_0xb352('0x14f')};this[_0xb352('0xc6')](_0xec3e12);this['saveInDb'](_[_0xb352('0x58')](_0xb27899,_[_0xb352('0x6e')](_0x2a1dd7,[_0xb352('0xda'),_0xb352('0xdb'),_0xb352('0x150'),_0xb352('0xdc'),_0xb352('0xe5')])),_0xb352('0x151'),'[emptyContact]');logger[_0xb352('0x5f')](_0x59e6b1);};Dialer['prototype'][_0xb352('0x114')]=function(_0x39c81b,_0x369184,_0x4fbea7){hopperUtils[_0xb352('0xc2')](_0x39c81b)[_0xb352('0x99')](loggerCatch(_0x369184));hopperUtils[_0xb352('0xc4')](_0x39c81b)[_0xb352('0x99')](loggerCatch(_0x4fbea7));};Dialer[_0xb352('0x14')][_0xb352('0xd5')]=function(_0x2ddeb9,_0x456c93){hopperUtils['createHistory'](_0x2ddeb9)[_0xb352('0x99')](loggerCatch(_0xb352('0xc3')));if(_0x456c93==0x0){hopperUtils[_0xb352('0xc4')](_0x2ddeb9)[_0xb352('0x99')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xb352('0x14')][_0xb352('0x144')]=function(_0x401284){return Promise['resolve']()[_0xb352('0x39')](cmHopper['handlePreviewRecallNotifications'](_0x401284['id'],previewRecallmeReminderInterval))[_0xb352('0x39')](function(_0x239a11){for(var _0x36282c=0x0;_0x36282c<_0x239a11[_0xb352('0x92')];_0x36282c++){var _0x21322c=_0x239a11[_0x36282c]['Agent'][_0xb352('0x41')];if(_0x21322c)io['to'](util[_0xb352('0x3f')](_0xb352('0x142'),_0x21322c))[_0xb352('0x3a')]('user:dialPreviewRecallReminder',{'hopper':_0x239a11[_0x36282c]});}})[_0xb352('0x99')](function(){});};Dialer[_0xb352('0x14')]['launchHandleIvr']=function(_0xff51de){var _0x5ae43e=this;return function(){_0x5ae43e[_0xb352('0x152')](_0xff51de);};};Dialer[_0xb352('0x14')][_0xb352('0x153')]=function(_0xbbeb5c,_0x4d2ae1){var _0x2d4b47=this;var _0x30d7d1=uuid['v4']();this[_0xb352('0xe9')][_0x30d7d1]=new Action(_0xbbeb5c,_0x4d2ae1,_0x30d7d1);return new Promise(function(_0x3fe841,_0x4171af){if(_['isUndefined'](_0xbbeb5c)&&typeof _0xbbeb5c!==_0xb352('0x154')){return _0x4171af(msgResponse(_0xb352('0x155'),'Failure',_0xb352('0x156')));}if(_['isUndefined'](_0x4d2ae1[_0xb352('0x157')])||_0x4d2ae1[_0xb352('0x157')]===null){return _0x4171af(msgResponse('originate',_0xb352('0x8c'),_0xb352('0x158')));}var _0x2051c5={'XMD-CALLERID':_0x2d4b47[_0xb352('0xe9')][_0x30d7d1][_0xb352('0x159')](),'XMD-AGI':_0xbbeb5c[_0xb352('0x12d')]?util[_0xb352('0x3f')](_0xb352('0x15a'),ipAgi,_0xbbeb5c[_0xb352('0x12d')]):'NONE','XMD-AGIAFTER':_0xbbeb5c[_0xb352('0x15b')]?util['format'](_0xb352('0x15a'),ipAgi,_0xbbeb5c[_0xb352('0x15b')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0xbbeb5c)?util[_0xb352('0x3f')](_0xb352('0x15c'),_0xbbeb5c['name'],_0xbbeb5c[_0xb352('0x15d')]||'',_0xbbeb5c['dialAgiAfterHangupAgent']?'c':'',_0xbbeb5c[_0xb352('0xc8')]||0x3):'NONE','XMD-CONTACTID':_0x4d2ae1['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d4b47['actions'][_0x30d7d1]['getCaller'](),'XMD-AMD':_0xbbeb5c[_0xb352('0x10b')]?'ACTIVE':_0xb352('0x15e'),'XMD-DESTINATION':_0xb352('0x10a')};if(_0xbbeb5c[_0xb352('0x10b')]){_0x2051c5[_0xb352('0x15f')]=_0xbbeb5c[_0xb352('0x160')]||0x9c4;_0x2051c5[_0xb352('0x161')]=_0xbbeb5c['dialAMDGreeting']||0x5dc;_0x2051c5['XMD-AMDAFTERGREETINGSILENCE']=_0xbbeb5c[_0xb352('0x162')]||0x320;_0x2051c5[_0xb352('0x163')]=_0xbbeb5c[_0xb352('0x164')]||0x1388;_0x2051c5[_0xb352('0x165')]=_0xbbeb5c[_0xb352('0x166')]||0x64;_0x2051c5['XMD-AMDBETWEENWORDSSILENCE']=_0xbbeb5c[_0xb352('0x167')]||0x32;_0x2051c5[_0xb352('0x168')]=_0xbbeb5c['dialAMDMaximumNumberOfWords']||0x3;_0x2051c5[_0xb352('0x169')]=_0xbbeb5c['dialAMDSilenceThreshold']||0x100;_0x2051c5[_0xb352('0x16a')]=_0xbbeb5c[_0xb352('0x16b')]||0x1388;}if(utils['isOutboundQueue'](_0xbbeb5c)){_0x2051c5[_0xb352('0x16c')]=_0x4d2ae1['VoiceQueueId'];}else{_0x2051c5['XMD-CAMPAIGNID']=_0x4d2ae1[_0xb352('0xe5')];}for(var _0x31ea86 in _0x4d2ae1[_0xb352('0x16d')]){if(typeof _0x4d2ae1[_0xb352('0x16d')][_0x31ea86]!==_0xb352('0xa4')){if(isNotNull(_0x4d2ae1[_0xb352('0x16d')][_0x31ea86])&&_0x31ea86!=='id'&&_0x31ea86!==_0xb352('0x16e')&&_0x31ea86!=='createdAt'&&_0x31ea86!==_0xb352('0x16f')){_0x2051c5[util[_0xb352('0x3f')](_0xb352('0x170'),_0xb352('0x171'),_['toUpper'](_0x31ea86))]=_0x4d2ae1['Contact'][_0x31ea86];}}}var _0x392193=_0x2d4b47[_0xb352('0x7f')](_0xbbeb5c['Trunk'])?utils['getCallerId'](_0xbbeb5c[_0xb352('0x84')]['callerid'],_0xbbeb5c[_0xb352('0x172')],_0xbbeb5c[_0xb352('0x173')]>0x0?utils[_0xb352('0x174')](_0xbbeb5c[_0xb352('0x175')],_0xbbeb5c[_0xb352('0x173')]):_0xbbeb5c[_0xb352('0x175')]):utils[_0xb352('0x176')](_[_0xb352('0xef')](_0xbbeb5c[_0xb352('0x85')])?_0xbbeb5c[_0xb352('0x84')][_0xb352('0x177')]:_0xbbeb5c[_0xb352('0x85')][_0xb352('0x177')],_0xbbeb5c[_0xb352('0x172')],_0xbbeb5c[_0xb352('0x173')]>0x0?utils[_0xb352('0x174')](_0xbbeb5c[_0xb352('0x175')],_0xbbeb5c[_0xb352('0x173')]):_0xbbeb5c['dialOriginateCallerIdNumber']);if(_0x392193){_0x2051c5['XMD-ORIGINATECALLERIDNAME']=_0x2d4b47[_0xb352('0xe9')][_0x30d7d1][_0xb352('0x178')]=utils[_0xb352('0x179')](_0x392193);_0x2051c5[_0xb352('0x17a')]=_0x4d2ae1[_0xb352('0x157')];}_0xbbeb5c[_0xb352('0x17b')]=_0x2051c5;return ami[_0xb352('0x9a')]({'actionid':_0x30d7d1,'action':'originate','channel':_0x2d4b47[_0xb352('0x7f')](_0xbbeb5c[_0xb352('0x84')])?util[_0xb352('0x3f')](_0xb352('0x17c'),_0xbbeb5c[_0xb352('0x84')][_0xb352('0x41')],isNotNull(_0xbbeb5c[_0xb352('0x17d')])?_0xbbeb5c[_0xb352('0x17d')][_0xb352('0x17e')]()||'':'',_0xbbeb5c[_0xb352('0x17f')]>0x0?_0x4d2ae1['phone'][_0xb352('0x180')](_0xbbeb5c[_0xb352('0x17f')]):_0x4d2ae1['phone']):util['format'](_0xb352('0x17c'),_['isNil'](_0xbbeb5c['TrunkBackup'])?_0xbbeb5c[_0xb352('0x84')]['name']:_0xbbeb5c['TrunkBackup'][_0xb352('0x41')],isNotNull(_0xbbeb5c['dialPrefix'])?_0xbbeb5c[_0xb352('0x17d')][_0xb352('0x17e')]()||'':'',_0xbbeb5c['dialCutDigit']>0x0?_0x4d2ae1[_0xb352('0x157')]['substring'](_0xbbeb5c[_0xb352('0x17f')]):_0x4d2ae1[_0xb352('0x157')]),'callerid':_0x392193,'Exten':_0xb352('0x10a'),'Context':_0xb352('0x181'),'Priority':'1','variable':_0x2051c5,'timeout':(_0xbbeb5c[_0xb352('0x182')]||0x1e)*0x3e8,'async':!![],'channelid':_0x30d7d1})[_0xb352('0x39')](function(_0x51d2a6){return _0x3fe841(_0x51d2a6);})[_0xb352('0x99')](function(_0x157146){_0xbbeb5c[_0xb352('0x183')]+=0x1;var _0x80950e=new History(_0x2d4b47[_0xb352('0xe9')][_0x30d7d1]);logger['error'](util[_0xb352('0x3f')](_0xb352('0x184'),JSON['stringify'](_0x157146)));_0x80950e[_0xb352('0x66')]=0xe;_0x80950e['statedesc']='OriginateError';_0x80950e['starttime']=moment()[_0xb352('0x3f')](_0xb352('0xbc'));_0x80950e[_0xb352('0x68')]=_0x80950e['starttime'];hopperUtils[_0xb352('0xc2')](_0x80950e)['catch'](loggerCatch(_0xb352('0x185')));_0x2d4b47[_0xb352('0xc4')](_0x80950e)['catch'](loggerCatch(_0xb352('0x185')))['finally'](function(){delete _0x2d4b47[_0xb352('0xe9')][_0x30d7d1];return _0x4171af(msgResponse(_0xb352('0x155'),_0xb352('0x7e'),_0xb352('0x186')));});});});};Dialer[_0xb352('0x14')][_0xb352('0x187')]=function(_0x1fd15a,_0x19637e,_0x276e19){var _0x588eae=new History(_0x19637e);if(_0x588eae['countbusyretry']+_0x588eae[_0xb352('0x11c')]+_0x588eae[_0xb352('0x11d')]+_0x588eae[_0xb352('0x188')]+_0x588eae[_0xb352('0xce')]+_0x588eae[_0xb352('0xe4')]+_0x588eae['countmachineretry']+_0x588eae[_0xb352('0x189')]>=_0x276e19['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1fd15a){case 0x3:if(_0x588eae[_0xb352('0x11d')]>=_0x276e19[_0xb352('0x18a')]-0x1){return!![];}hopperUtils[_0xb352('0xd7')]({'active':![],'countnoanswerretry':_0x588eae[_0xb352('0x11d')]+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19[_0xb352('0x18b')],'minutes')[_0xb352('0x3f')](_0xb352('0xbc')),'ContactId':_0x588eae['ContactId'],'ListId':_0x588eae['ListId'],'VoiceQueueId':_0x588eae['VoiceQueueId']||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x18c')));break;case 0x5:if(_0x588eae[_0xb352('0x11b')]>=_0x276e19['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0xb352('0xd7')]({'active':![],'countbusyretry':_0x588eae[_0xb352('0x11b')]+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19['dialBusyRetryFrequency'],_0xb352('0xd9'))['format'](_0xb352('0xbc')),'ContactId':_0x588eae['ContactId'],'ListId':_0x588eae[_0xb352('0xdb')],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x18d')));break;case 0x8:if(_0x588eae[_0xb352('0x11c')]>=_0x276e19[_0xb352('0x18e')]-0x1){return!![];}hopperUtils[_0xb352('0xd7')]({'active':![],'countcongestionretry':_0x588eae[_0xb352('0x11c')]+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19['dialCongestionRetryFrequency'],_0xb352('0xd9'))['format'](_0xb352('0xbc')),'ContactId':_0x588eae['ContactId'],'ListId':_0x588eae[_0xb352('0xdb')],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x588eae['countnosuchnumberretry']>=_0x276e19[_0xb352('0x18f')]-0x1){return!![];}else{hopperUtils[_0xb352('0xd7')]({'active':![],'countnosuchnumberretry':_0x588eae[_0xb352('0x188')]+=0x1,'scheduledat':moment()['add'](_0x276e19[_0xb352('0x190')],_0xb352('0xd9'))[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588eae[_0xb352('0xda')],'ListId':_0x588eae[_0xb352('0xdb')],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})['catch'](loggerCatch(_0xb352('0x191')));}break;case 0xa:if(_0x588eae[_0xb352('0xce')]>=_0x276e19[_0xb352('0xd4')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x588eae[_0xb352('0xce')]+=0x1,'scheduledat':moment()['add'](_0x276e19[_0xb352('0xd0')],_0xb352('0xd9'))[_0xb352('0x3f')](_0xb352('0xbc')),'ContactId':_0x588eae[_0xb352('0xda')],'ListId':_0x588eae['ListId'],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x588eae[_0xb352('0xe4')]>=_0x276e19[_0xb352('0xe3')]-0x1){return!![];}hopperUtils[_0xb352('0xd7')]({'active':![],'countabandonedretry':_0x588eae['countabandonedretry']+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19[_0xb352('0xe2')],_0xb352('0xd9'))[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588eae[_0xb352('0xda')],'ListId':_0x588eae[_0xb352('0xdb')],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae['CampaignId']||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x192')));break;case 0x13:if(_0x588eae[_0xb352('0x119')]>=_0x276e19[_0xb352('0x121')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x588eae['countmachineretry']+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19[_0xb352('0x124')],'minutes')[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588eae[_0xb352('0xda')],'ListId':_0x588eae['ListId'],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x127')));break;case 0x14:if(_0x588eae[_0xb352('0x189')]>=_0x276e19['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xb352('0xd7')]({'active':![],'countagentrejectretry':_0x588eae[_0xb352('0x189')]+=0x1,'scheduledat':moment()[_0xb352('0xd8')](_0x276e19[_0xb352('0x193')],_0xb352('0xd9'))[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588eae['ContactId'],'ListId':_0x588eae[_0xb352('0xdb')],'VoiceQueueId':_0x588eae[_0xb352('0xdc')]||undefined,'CampaignId':_0x588eae[_0xb352('0xe5')]||undefined})[_0xb352('0x99')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xb352('0x194')]=function(_0x2f760d,_0x51420d,_0x1f58e4){var _0x157474=this;var _0x3e8ef3=new History(_0x2f760d);var _0x58d883=![];var _0x244b66;var _0x21b68c;return new Promise(function(_0x5b542e,_0x3494f3){if(_[_0xb352('0x4d')](_0x51420d)&&typeof _0x51420d!==_0xb352('0x154')){return _0x3494f3(msgResponse(_0xb352('0x195'),'Failure','entity\x20is\x20undefine'));}if(_[_0xb352('0x4d')](_0x1f58e4)&&typeof _0x1f58e4!==_0xb352('0x154')){return _0x3494f3(msgResponse(_0xb352('0x195'),_0xb352('0x8c'),_0xb352('0x196')));}hopperUtils[_0xb352('0xd2')](_0x3e8ef3,_0x1f58e4['reason'],_0x51420d)[_0xb352('0x39')](function(_0x48ff71){if(_0x48ff71[_0xb352('0xd6')]==0x1)_0x58d883=!![];switch(_0x1f58e4[_0xb352('0xbf')]){case'0':_0x51420d[_0xb352('0x197')]+=0x1;_0x3e8ef3[_0xb352('0x66')]=0x0;_0x3e8ef3[_0xb352('0x67')]=_0xb352('0x198');_0x3e8ef3['countnosuchnumberretry']+=0x1;_0x3e8ef3[_0xb352('0xcf')]+=0x1;ami[_0xb352('0x3a')](_0xb352('0x199'),ut['buildObj'](_0x2f760d,_0xb352('0x19a')));_0x244b66=_0x51420d['dialNoSuchNumberRetryFrequency'];_0x21b68c=_0x51420d[_0xb352('0xd1')];hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch(_0xb352('0x11a')));if(_0x157474[_0xb352('0x187')](0x0,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3['countnosuchnumberretry']>=_0x51420d['dialNoSuchNumberMaxRetry']){_0x157474['createStateFinal'](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x19b'));}else{_0x157474[_0xb352('0x11f')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x19b'));}}break;case'3':_0x51420d[_0xb352('0x19c')]+=0x1;_0x3e8ef3[_0xb352('0x66')]=0x3;_0x3e8ef3[_0xb352('0x67')]=_0xb352('0x19d');_0x3e8ef3[_0xb352('0x11d')]+=0x1;_0x3e8ef3[_0xb352('0xcf')]+=0x1;var _0x524100=ut[_0xb352('0x19e')](_0x2f760d,_0x51420d);ami[_0xb352('0x3a')](_0xb352('0x19f'),_0x524100);_0x244b66=_0x51420d[_0xb352('0x18b')];_0x21b68c=_0x51420d[_0xb352('0xd1')];hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x157474['checkRetriveMax'](0x3,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0x11d')]>=_0x51420d[_0xb352('0x18a')]){_0x157474[_0xb352('0x122')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1a0'));}else{_0x157474['stateGlobal'](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1a0'));}}break;case'5':_0x51420d[_0xb352('0x1a1')]+=0x1;_0x3e8ef3[_0xb352('0x66')]=0x5;_0x3e8ef3[_0xb352('0x67')]=_0xb352('0x1a2');_0x3e8ef3[_0xb352('0x11b')]+=0x1;_0x3e8ef3[_0xb352('0xcf')]+=0x1;ami[_0xb352('0x3a')](_0xb352('0x1a3'),ut[_0xb352('0x112')](_0x2f760d,_0xb352('0x1a4')));_0x244b66=_0x51420d[_0xb352('0x1a5')];_0x21b68c=_0x51420d[_0xb352('0xd1')];hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch(_0xb352('0x1a6')));if(_0x157474[_0xb352('0x187')](0x5,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0x11b')]>=_0x51420d[_0xb352('0x1a7')]){_0x157474[_0xb352('0x122')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1a8'));}else{_0x157474[_0xb352('0x11f')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1a8'));}}break;case'8':_0x51420d[_0xb352('0x1a9')]+=0x1;_0x3e8ef3[_0xb352('0x66')]=0x8;_0x3e8ef3[_0xb352('0x67')]='Congestion';_0x3e8ef3['countcongestionretry']+=0x1;_0x3e8ef3[_0xb352('0xcf')]+=0x1;_0x244b66=_0x51420d[_0xb352('0x1aa')];_0x21b68c=_0x51420d[_0xb352('0xd1')];ami['emit']('custom:agentcongestion',ut[_0xb352('0x112')](_0x2f760d,_0xb352('0x1ab')));hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch(_0xb352('0x1ac')));if(_0x157474['checkRetriveMax'](0x8,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0x11c')]>=_0x51420d[_0xb352('0x18e')]){_0x157474['createStateFinal'](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1ad'));}else{_0x157474['stateGlobal'](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1ad'));}}break;case'11':_0x51420d[_0xb352('0x1ae')]+=0x1;_0x3e8ef3['state']=0xb;_0x3e8ef3[_0xb352('0x67')]=_0xb352('0xe6');_0x3e8ef3[_0xb352('0xe4')]+=0x1;_0x3e8ef3['countglobal']+=0x1;_0x244b66=_0x51420d[_0xb352('0xe2')];_0x21b68c=_0x51420d[_0xb352('0xd1')];hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x157474['checkRetriveMax'](0xb,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0xe4')]>=_0x51420d[_0xb352('0xe3')]){_0x157474[_0xb352('0x122')](_0x3e8ef3,_0x5b542e,_0x3494f3,'reason\x2011\x20abandoned');}else{_0x157474[_0xb352('0x11f')](_0x3e8ef3,_0x5b542e,_0x3494f3,'reason\x2011\x20abandoned');}}break;case'20':_0x51420d['outboundRejectCallsDay']+=0x1;_0x3e8ef3[_0xb352('0x66')]=0x14;_0x3e8ef3['statedesc']='AgentReject';_0x3e8ef3[_0xb352('0x189')]+=0x1;_0x3e8ef3[_0xb352('0xcf')]+=0x1;_0x244b66=_0x51420d[_0xb352('0x193')];_0x21b68c=_0x51420d[_0xb352('0xd1')];ami[_0xb352('0x3a')](_0xb352('0x1af'),ut[_0xb352('0x112')](_0x2f760d,'agentreject'));hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch(_0xb352('0x1b0')));if(_0x157474[_0xb352('0x187')](0x14,_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0x189')]>=_0x51420d[_0xb352('0x1b1')]){_0x157474['createStateFinal'](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1b2'));}else{_0x157474[_0xb352('0x11f')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0xb352('0x1b2'));}}break;default:_0x51420d[_0xb352('0x12e')]+=0x1;_0x3e8ef3['state']=0xc;_0x3e8ef3['statedesc']=_0x1f58e4[_0xb352('0xbf')];_0x244b66=_0x51420d['dialAgentRejectRetryFrequency'];_0x21b68c=_0x51420d[_0xb352('0xd1')];hopperUtils[_0xb352('0xc2')](_0x3e8ef3)[_0xb352('0x99')](loggerCatch(_0xb352('0x1b3')));if(_0x157474[_0xb352('0x187')](_0x1f58e4[_0xb352('0xbf')],_0x2f760d,_0x51420d)&&!_0x58d883){if(_0x3e8ef3[_0xb352('0x11b')]+_0x3e8ef3[_0xb352('0x11c')]+_0x3e8ef3[_0xb352('0x11d')]+_0x3e8ef3[_0xb352('0x188')]+_0x3e8ef3['countdropretry']+_0x3e8ef3['countabandonedretry']+_0x3e8ef3['countmachineretry']+_0x3e8ef3[_0xb352('0x189')]>=_0x51420d[_0xb352('0x11e')]){_0x157474[_0xb352('0x11f')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0x1f58e4[_0xb352('0xbf')]);}else{_0x157474[_0xb352('0x122')](_0x3e8ef3,_0x5b542e,_0x3494f3,_0x1f58e4[_0xb352('0xbf')]);}}}})[_0xb352('0x39')](function(){if(_0x58d883){hopperUtils[_0xb352('0xe0')](_0x3e8ef3,_0x244b66,_0x21b68c)[_0xb352('0x39')](function(){return _0x5b542e(0x1);});}});});};Dialer[_0xb352('0x14')][_0xb352('0x11f')]=function(_0x3f0d0e,_0x22d982,_0x282537,_0x19d350){var _0x54ef36=new Final(_0x3f0d0e);_0x54ef36[_0xb352('0x66')]=0xf;_0x54ef36[_0xb352('0x67')]=_0xb352('0x1b4');this[_0xb352('0x122')](_0x54ef36,_0x22d982,_0x282537,_0x19d350);};Dialer[_0xb352('0x14')][_0xb352('0x122')]=function(_0x4a8639,_0x38d57f,_0x836a2f,_0x5ed810){hopperUtils[_0xb352('0xc4')](_0x4a8639)[_0xb352('0x39')](function(){return _0x38d57f(msgResponse(_0xb352('0x195'),'Success',_0x5ed810));})[_0xb352('0x99')](function(){return _0x836a2f(msgResponse(_0xb352('0x1b5'),'Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0xb352('0x8')]=function(_0x59a798){var _0x200127=_0x59a798[_0xb352('0x1b6')]/0x64;var _0x3a9491=_0x59a798[_0xb352('0xc9')]/(_0x59a798['outboundDropCallsDayTimeout']+_0x59a798[_0xb352('0xbe')]);var _0x5b6e01=Math[_0xb352('0x1b7')](_0x59a798[_0xb352('0x1b8')]*(_0x59a798[_0xb352('0x1b9')]/0x64));var _0x201e12=Math[_0xb352('0x1b7')](_0x59a798[_0xb352('0x1b8')]*(_0x59a798['predictiveIntervalMinThreshold']/0x64));var _0x1b3879=_0x59a798[_0xb352('0x134')]+_0x59a798['talking'];var _0x11012=Math['floor'](_0x59a798[_0xb352('0x53')]*_0x59a798['erlangAbandonmentRate']*_0x59a798['predictiveIntervalHitRate']*_0x59a798[_0xb352('0x1ba')]);if(_['isUndefined'](_0x59a798[_0xb352('0x23')])){if(!_[_0xb352('0x4d')](_0x59a798[_0xb352('0x22')])){_0x59a798[_0xb352('0x22')]=undefined;loggerPredictive[_0xb352('0x5f')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xb352('0x4d')](_0x59a798['handlePredictive'])){loggerPredictive[_0xb352('0x5f')](_0xb352('0x1bb'),_0xb352('0x1bc'));clearInterval(_0x59a798['handlePredictive']);_0x59a798['handlePredictive']=undefined;}_0x59a798[_0xb352('0x23')]=moment()['format'](_0xb352('0xbc'));loggerPredictive[_0xb352('0x43')](_0x59a798[_0xb352('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x59a798[_0xb352('0x23')]);this['handlePower'](_0x59a798,0x1);}else if(ifInterval(_0x59a798[_0xb352('0x1bd')],_0x59a798[_0xb352('0x23')])){this[_0xb352('0xab')](_0x59a798,0x1);loggerPredictiveCalls[_0xb352('0x43')](_0xb352('0x1be'),_0x59a798[_0xb352('0x23')],_0x59a798[_0xb352('0x41')]);_0x59a798[_0xb352('0x53')]=0x0;_0x59a798['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x200127<_0x3a9491&&_0x59a798[_0xb352('0x1bf')]==='dropRate'){clearPredictiveAttributes(_0x59a798);loggerPredictive[_0xb352('0x43')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x3a9491,_0xb352('0x23'),_0x59a798['name']);}else if(_0x11012<_0x59a798[_0xb352('0xca')]&&_0x59a798['dialPredictiveOptimization']===_0xb352('0x1c0')){clearPredictiveAttributes(_0x59a798);loggerPredictive[_0xb352('0x43')](_0xb352('0x1c1'),'Max\x20Drop\x20',_0x11012,_0xb352('0x1c2'),_0x59a798['predictiveIntervalErlangCallsDroppedCalls'],_0xb352('0x23'),_0x59a798[_0xb352('0x41')]);}else if(!ifInterval(_0x59a798[_0xb352('0x1bd')],_0x59a798[_0xb352('0x23')])&&_[_0xb352('0x4d')](_0x59a798[_0xb352('0x22')])&&!_[_0xb352('0x4d')](_0x59a798[_0xb352('0x23')])){_0x59a798['startPredictive']=moment()[_0xb352('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xb352('0x43')](_0x59a798[_0xb352('0x41')],_0xb352('0x1c3'),_0x59a798['startPredictive']);hopperUtils['avgHandleTime'](_0x59a798['dialPredictiveInterval'])[_0xb352('0x39')](this[_0xb352('0x1c4')](_0x59a798))[_0xb352('0x39')](mergeDataErlangB(_0x59a798))['then'](this[_0xb352('0x1c5')](_0x59a798))[_0xb352('0x99')](loggerCatchPredictive(_0xb352('0x1c6'),_0x59a798));}else if(!ifInterval(_0x59a798[_0xb352('0x1bd')],_0x59a798[_0xb352('0x22')])){_0x59a798['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x59a798[_0xb352('0x22')]=moment()[_0xb352('0x3f')](_0xb352('0xbc'));loggerPredictive[_0xb352('0x43')](_0x59a798[_0xb352('0x41')],_0xb352('0x1c7'),_0x59a798[_0xb352('0x22')]);clearInterval(_0x59a798[_0xb352('0x5d')]);_0x59a798[_0xb352('0x5d')]=undefined;hopperUtils[_0xb352('0x1c8')](_0x59a798[_0xb352('0x1bd')])[_0xb352('0x39')](this[_0xb352('0x1c4')](_0x59a798))[_0xb352('0x39')](mergeDataErlangB(_0x59a798))[_0xb352('0x39')](this[_0xb352('0x1c5')](_0x59a798))[_0xb352('0x99')](loggerCatchPredictive(_0xb352('0x1c9'),_0x59a798));}else if(_0x59a798[_0xb352('0x1b8')]&&_0x1b3879<_0x59a798[_0xb352('0x1b8')]-_0x201e12){clearPredictiveAttributes(_0x59a798);loggerPredictive['info'](_0x59a798['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1b3879,_0xb352('0x1ca'),_0x59a798[_0xb352('0x1b8')],'-',_0x201e12,'=',_0x59a798[_0xb352('0x1b8')]-_0x201e12,')');}else if(_0x59a798[_0xb352('0x1b8')]&&_0x1b3879>_0x59a798[_0xb352('0x1b8')]+_0x5b6e01){clearPredictiveAttributes(_0x59a798);loggerPredictive[_0xb352('0x43')](_0x59a798[_0xb352('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1b3879,')\x20are\x20more\x20than\x20threshold\x20(',_0x59a798[_0xb352('0x1b8')],'+',_0x5b6e01,'=',_0x59a798[_0xb352('0x1b8')]+_0x5b6e01,')');}};Dialer[_0xb352('0x14')]['getDataPredictive']=function(_0x384ffd){var _0xf4450f=this;return function(_0x56056f){return new Promise(function(_0x34ab73,_0x1739de){_[_0xb352('0x58')](_0x384ffd,_0x56056f[0x0]);if(checkGetDataPredictive(_0x56056f[0x0])){var _0x166ec2=_0x384ffd[_0xb352('0x1b8')]=_0x384ffd[_0xb352('0x135')]+_0x384ffd[_0xb352('0x134')];var _0x1b8308=_0x384ffd[_0xb352('0x1bd')]*0x3c;var _0x4da624=_0x56056f[0x0][_0xb352('0x4e')]+_0x56056f[0x0][_0xb352('0x4a')];var _0x3a6065=(_0x56056f[0x0]['predictiveIntervalAnsweredCalls']+_0x56056f[0x0][_0xb352('0x48')]+_0x56056f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x56056f[0x0][_0xb352('0x4c')];_0x384ffd[_0xb352('0x1cb')]=_0x3a6065>0x0?_0x3a6065:0x1;switch(_0x384ffd[_0xb352('0x1bf')]){case _0xb352('0x1c0'):var _0x2f6889=_0x384ffd['dialPredictiveOptimizationPercentage']/0x64;return _0xf4450f[_0xb352('0x1cc')](_0x166ec2,_0x1b8308,_0x4da624,_0x3a6065,_0x2f6889)['then'](function(_0x55939d){return _0x34ab73(_0x55939d);});case'agentBusyFactor':var _0x1e6955=_0x384ffd['dialPredictiveOptimizationPercentage']/0x64;return _0xf4450f[_0xb352('0x1cd')](_0x166ec2,_0x1b8308,_0x4da624,_0x3a6065,_0x1e6955)['then'](function(_0x2b06cd){return _0x34ab73(_0x2b06cd);});default:return _0x1739de(msgResponse(_0xb352('0x1ce'),_0xb352('0x8c'),_0xb352('0x1cf')));}}else{return _0x1739de(msgResponse(_0xb352('0x1ce'),'Failure',_0xb352('0x1d0')));}});};};Dialer[_0xb352('0x14')][_0xb352('0x1d1')]=function(_0x1bdc7a){var _0x47481e=this;return function(_0x3c0444){return new Promise(function(_0x32cb56,_0x57567e){_['merge'](_0x1bdc7a,_0x3c0444[0x0]);if(checkGetDataPredictive(_0x3c0444[0x0])){loggerPredictive[_0xb352('0x43')](JSON['stringify'](_0x3c0444[0x0]));if(_0x1bdc7a[_0xb352('0x1bf')]==='dropRate'){return _0x47481e[_0xb352('0x14b')](_0x1bdc7a['id'])[_0xb352('0x39')](function(_0x5a2c9c){var _0x235bbd=_0x1bdc7a[_0xb352('0x1d2')]-_0x5a2c9c[0x0][_0xb352('0x1d3')];var _0x1885f6=_0x1bdc7a['dialPredictiveInterval']*0x3c;var _0x1aaddb=_0x3c0444[0x0]['predictiveIntervalAvgTalktime']+_0x3c0444[0x0][_0xb352('0x4a')];var _0x5d14d5=(_0x3c0444[0x0][_0xb352('0x46')]+_0x3c0444[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3c0444[0x0][_0xb352('0x49')])/_0x3c0444[0x0][_0xb352('0x4c')];var _0x5e9427=_0x1bdc7a[_0xb352('0x1b6')]/0x64;_0x1bdc7a[_0xb352('0x1d4')]=_0x5a2c9c[0x0]['outboundQueuePauses']||0x0;_0x1bdc7a[_0xb352('0x1cb')]=_0x5d14d5>0x0?_0x5d14d5:0x1;return _0x47481e[_0xb352('0x1cc')](_0x235bbd,_0x1885f6,_0x1aaddb,_0x5d14d5,_0x5e9427);})[_0xb352('0x39')](function(_0x1a4a11){return _0x32cb56(_0x1a4a11);})[_0xb352('0x99')](function(_0x41666c){return _0x57567e(msgResponse(_0xb352('0x1d5'),_0xb352('0x8c'),JSON['stringify'](_0x41666c)));});}if(_0x1bdc7a[_0xb352('0x1bf')]===_0xb352('0x1d6')){return _0x47481e['getVoiceQueueRtPauses'](_0x1bdc7a['id'])['then'](function(_0x4eed39){var _0x95afcf=_0x1bdc7a[_0xb352('0x1d2')]-_0x4eed39[0x0][_0xb352('0x1d3')];var _0x1d8753=_0x1bdc7a['dialPredictiveInterval']*0x3c;var _0x21cf83=_0x3c0444[0x0]['predictiveIntervalAvgTalktime']+_0x3c0444[0x0][_0xb352('0x4a')];var _0x284919=(_0x3c0444[0x0][_0xb352('0x46')]+_0x3c0444[0x0][_0xb352('0x48')]+_0x3c0444[0x0][_0xb352('0x49')])/_0x3c0444[0x0][_0xb352('0x4c')];var _0x2da352=_0x1bdc7a['dialPredictiveOptimizationPercentage']/0x64;_0x1bdc7a[_0xb352('0x1d4')]=_0x4eed39[0x0][_0xb352('0x1d3')]||0x0;_0x1bdc7a[_0xb352('0x1cb')]=_0x284919>0x0?_0x284919:0x1;return _0x47481e[_0xb352('0x1cd')](_0x95afcf,_0x1d8753,_0x21cf83,_0x284919,_0x2da352);})[_0xb352('0x39')](function(_0x5f57ef){return _0x32cb56(_0x5f57ef);})[_0xb352('0x99')](function(_0x3ef52b){return _0x57567e(msgResponse('[CatchErlangB]',_0xb352('0x8c'),JSON[_0xb352('0x6d')](_0x3ef52b)));});}}else{return _0x57567e(msgResponse(_0xb352('0x1ce'),'Failure',_0xb352('0x1d0')));}});};};Dialer[_0xb352('0x14')][_0xb352('0x1c5')]=function(_0x112e5b){var _0x1e49b5=this;return function(){var _0x2cca82=0x0;var _0x2aa0b8=Math[_0xb352('0x1d7')](_0x112e5b[_0xb352('0x1d8')]*0x3e8);if(_0x2aa0b8>0x0){_0x2aa0b8=_0x2aa0b8<0x64?0x64:_0x2aa0b8;loggerPredictive[_0xb352('0x43')](_0x112e5b[_0xb352('0x41')],_0xb352('0x1d9'),_0x2aa0b8,_0xb352('0x1da'));_0x112e5b[_0xb352('0x5d')]=setInterval(function(){_0x1e49b5[_0xb352('0x5d')](_0x112e5b);loggerPredictiveCalls[_0xb352('0x43')](_0xb352('0x1db'),_0x2cca82+=0x1);},_0x2aa0b8);}else{loggerPredictive[_0xb352('0x43')](_0x112e5b['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xb352('0x1dc')]=function(_0x33aaaa,_0x305ab6){var _0x509fd4=this;return function(_0x14e62c){if(_['isEmpty'](_0x14e62c)){if(_[_0xb352('0xef')](_0x305ab6[_0xb352('0x150')])||!_0x305ab6[_0xb352('0x1dd')]){if(_0x33aaaa[_0xb352('0xa9')]===_0xb352('0xae')){_0x33aaaa[_0xb352('0x6b')]=_[_0xb352('0x4d')](_0x33aaaa['queueStatusComplete'])?!![]:_0x33aaaa[_0xb352('0x6b')];var _0x163b9e=uuid['v4']();_0x509fd4[_0xb352('0xe9')][_0x163b9e]=new Action(_0x33aaaa,_0x305ab6,_0x163b9e);loggerBooked['info']('[booked][checkContactBlack]',_0x163b9e,_0xb352('0x1de'),JSON['stringify'](_0x33aaaa['queueStatusComplete']),_0xb352('0x1df'),_0x33aaaa['name']);if(_0x33aaaa['queueStatusComplete']){_0x33aaaa[_0xb352('0x6b')]=![];_0x509fd4[_0xb352('0x25')][_0x509fd4['actions'][_0x163b9e][_0xb352('0xb9')]]=[];ami['Action']({'actionid':_0x163b9e,'action':_0xb352('0x1e0'),'queue':_0x33aaaa['name']})['catch'](function(){_0x509fd4['updateOriginated'](_0x33aaaa);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xda')],'ListId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xdb')],'VoiceQueueId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xdc')]||undefined,'CampaignId':_0x509fd4['actions'][_0x163b9e]['CampaignId']||undefined})[_0xb352('0x99')](loggerCatch(_0xb352('0x1e1')));delete _0x509fd4[_0xb352('0xe9')][_0x163b9e];});}else{loggerBooked['info'](_0xb352('0x1e2'),JSON[_0xb352('0x6d')](_0x33aaaa[_0xb352('0x6b')]),_0xb352('0x1df'),_0x33aaaa[_0xb352('0x41')]);_0x509fd4[_0xb352('0xc6')](_0x33aaaa);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xda')],'ListId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xdb')],'VoiceQueueId':_0x509fd4[_0xb352('0xe9')][_0x163b9e][_0xb352('0xdc')]||undefined,'CampaignId':_0x509fd4[_0xb352('0xe9')][_0x163b9e]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x509fd4['actions'][_0x163b9e];}}else{return _0x509fd4[_0xb352('0x153')](_0x33aaaa,_0x305ab6);}}else{if(utils['getSeconds'](undefined,_0x305ab6[_0xb352('0x1e3')])<_0x33aaaa[_0xb352('0x1e4')]*0x3c){if(_0x305ab6[_0xb352('0x1e5')]&&!_0x305ab6['Agent'][_0xb352('0x1e6')]){_0x509fd4['preview'][_0xb352('0xfb')](_0x305ab6['id'])[_0xb352('0x17')](function(){_0x509fd4[_0xb352('0xc6')](_0x33aaaa);});}else{hopperUtils[_0xb352('0x1e7')]({'active':![]},_0x305ab6['id'],0x1)[_0xb352('0x17')](function(){_0x509fd4[_0xb352('0xc6')](_0x33aaaa);});}}else{_0x33aaaa[_0xb352('0x1e8')]+=0x1;_0x509fd4[_0xb352('0xc6')](_0x33aaaa);if(_0x33aaaa['dialRecallInQueue']){hopperUtils[_0xb352('0xd7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x305ab6['ContactId'],'ListId':_0x305ab6['ListId'],'VoiceQueueId':_0x305ab6[_0xb352('0xdc')]||undefined,'CampaignId':_0x305ab6[_0xb352('0xe5')]||undefined})['catch'](loggerCatch(_0xb352('0x1e9')));hopperUtils[_0xb352('0xc2')](createObjHistory(_0x33aaaa,_0x305ab6,utils[_0xb352('0x64')][_0xb352('0x1ea')],0x17,_0xb352('0x1eb')))[_0xb352('0x99')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x509fd4[_0xb352('0x114')](createObjHistory(_0x33aaaa,_0x305ab6,utils[_0xb352('0x64')][_0xb352('0x1ec')],0x16,'RecallFailedTimeout'),_0xb352('0x1ed'),_0xb352('0x1ee'));}}}}else{_0x33aaaa['outboundBlacklistCallsDay']+=0x1;_0x509fd4[_0xb352('0x114')](createObjHistory(_0x33aaaa,_0x305ab6,utils[_0xb352('0x64')][_0xb352('0x1ef')],0xd,'Blacklist'),_0xb352('0x1f0'),'[Originate][MoveBlacklist]');throw _0xb352('0x1f1');}};};Dialer[_0xb352('0x14')][_0xb352('0x152')]=function(_0x40afe3){var _0x9f1bf5=this;var _0x454056=_0x40afe3['limitCalls']-_0x40afe3['originated']-_0x40afe3[_0xb352('0x1f2')];emitCampaignSummary(_0x40afe3);if(_0x454056>0x0){if(_0x454056>this[_0xb352('0x1d')]){_0x454056=this[_0xb352('0x1d')];}_0x40afe3[_0xb352('0x1f2')]+=_0x454056;hopperUtils['getContactDialerIvr'](_0x40afe3['id'],_0x454056,_0x40afe3['dialOrderByScheduledAt'],_0x40afe3)[_0xb352('0x39')](function(_0x1ed4c7){_0x40afe3[_0xb352('0x1f2')]-=_0x454056;_0x40afe3[_0xb352('0x1f2')]=_0x40afe3[_0xb352('0x1f2')]>0x0?_0x40afe3[_0xb352('0x1f2')]:0x0;if(!utils[_0xb352('0x1f3')](_0x1ed4c7)){_0x40afe3['message']=utils[_0xb352('0x64')][_0xb352('0x65')];logger[_0xb352('0x43')]('[getContactCampaign2][Empty]'+_0x40afe3[_0xb352('0x41')]);}else{_0x40afe3[_0xb352('0x78')]+=_0x1ed4c7['length'];_0x40afe3[_0xb352('0x63')]=utils[_0xb352('0x64')][_0xb352('0x1f4')];for(var _0x3406e2=0x0;_0x3406e2<_0x1ed4c7['length'];_0x3406e2+=0x1){_0x40afe3[_0xb352('0x1f5')]+=0x1;if(_[_0xb352('0xef')](_0x1ed4c7[_0x3406e2])||_[_0xb352('0xef')](_0x1ed4c7[_0x3406e2][_0xb352('0x16d')])||_['isNil'](_0x1ed4c7[_0x3406e2][_0xb352('0x157')])){_0x9f1bf5[_0xb352('0x1f6')](_0xb352('0x1f7'),_0x40afe3,_0x1ed4c7[_0x3406e2]);}else{hopperUtils[_0xb352('0x1f8')](_['pick'](_0x1ed4c7[_0x3406e2],[_0xb352('0xe5'),'phone']))['then'](_0x9f1bf5['checkContactBlack'](_0x40afe3,_0x1ed4c7[_0x3406e2]))[_0xb352('0x99')](_0x9f1bf5[_0xb352('0x1f9')]('[actionOriginateIvr]\x20',_0x40afe3));}}}})[_0xb352('0x99')](loggerGetContactDialer(_0xb352('0x1fa'),_0x40afe3,_0x454056));}};Dialer['prototype']['handlePower']=function(_0x3dff4a,_0x7f809a){var _0x5d1a9b=this;var _0x53dc81=[];if(_0x7f809a<0x1||_0x3dff4a[_0xb352('0xa9')]===_0xb352('0xae')){_0x7f809a=0x1;}var _0x1cc7c3=Math[_0xb352('0x1d7')](_0x3dff4a[_0xb352('0x134')]*_0x7f809a)-_0x3dff4a[_0xb352('0x78')]-_0x3dff4a[_0xb352('0x1f2')];if(_0x3dff4a['dialLimitQueue']>0x0){var _0x5de324=_0x3dff4a[_0xb352('0x1fb')]-_0x3dff4a[_0xb352('0x78')]-_0x3dff4a[_0xb352('0x135')]-_0x3dff4a[_0xb352('0x1f2')]-_0x3dff4a[_0xb352('0x136')];if(_0x1cc7c3>_0x5de324){_0x1cc7c3=_0x5de324;}}if(_0x1cc7c3>0x0){if(_0x3dff4a['dialMethod']===_0xb352('0xae')){_0x1cc7c3=0x1;}if(_0x1cc7c3>this[_0xb352('0x1d')]){_0x1cc7c3=this[_0xb352('0x1d')];}_0x3dff4a['temp']+=_0x1cc7c3;for(var _0x9ea6ca in this['agents']){if(typeof this[_0xb352('0x1b')][_0x9ea6ca]!=='undefined'){if(this[_0xb352('0x1b')][_0x9ea6ca]['state']===_0xb352('0x1fc')&&this[_0xb352('0x1b')][_0x9ea6ca][_0xb352('0x81')]===_0xb352('0x140')){_0x53dc81[_0xb352('0x93')](this['agents'][_0x9ea6ca]['id']);}}}hopperUtils[_0xb352('0x1fd')](_0x3dff4a,_0x53dc81,_0x1cc7c3)[_0xb352('0x39')](function(_0x54b13e){_0x3dff4a[_0xb352('0x1f2')]-=_0x1cc7c3;_0x3dff4a[_0xb352('0x1f2')]=_0x3dff4a[_0xb352('0x1f2')]>0x0?_0x3dff4a[_0xb352('0x1f2')]:0x0;if(!utils[_0xb352('0x1f3')](_0x54b13e)){hopperUtils['countReScheduled'](_0x3dff4a)[_0xb352('0x39')](sendMessageReschedule(_0x3dff4a))[_0xb352('0x99')](loggerCatch('[countReScheduled]\x20'));}else{_0x3dff4a[_0xb352('0x78')]+=_0x54b13e[_0xb352('0x92')];_0x3dff4a[_0xb352('0x63')]=_0x3dff4a[_0xb352('0xa9')]==='booked'?utils[_0xb352('0x64')]['ACTIVE']:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x37d696=0x0;_0x37d696<_0x54b13e['length'];_0x37d696+=0x1){if(_['isNil'](_0x54b13e[_0x37d696])||_['isNil'](_0x54b13e[_0x37d696]['Contact'])||_[_0xb352('0xef')](_0x54b13e[_0x37d696][_0xb352('0x157')])){_0x5d1a9b[_0xb352('0x1f6')](_0xb352('0x1f7'),_0x3dff4a,_0x54b13e[_0x37d696]);}else{hopperUtils['checkIsBlackList'](_[_0xb352('0x6e')](_0x54b13e[_0x37d696],['VoiceQueueId','phone']))[_0xb352('0x39')](_0x5d1a9b[_0xb352('0x1dc')](_0x3dff4a,_0x54b13e[_0x37d696]))[_0xb352('0x99')](_0x5d1a9b[_0xb352('0x1f9')](_0xb352('0x1f7'),_0x3dff4a));}}}})[_0xb352('0x99')](loggerGetContactDialer(_0xb352('0x1fe'),_0x3dff4a,_0x1cc7c3));}};Dialer[_0xb352('0x14')]['handlePredictive']=function(_0x5868fa){if(_0x5868fa[_0xb352('0x1fb')]>0x0){var _0x118402=_0x5868fa[_0xb352('0x1fb')]-_0x5868fa[_0xb352('0x78')]-_0x5868fa[_0xb352('0x135')];if(_0x118402>0x0){this[_0xb352('0x1ff')](_0x5868fa);}else{loggerPredictiveCalls[_0xb352('0x43')](_0xb352('0x200'));}}else{this[_0xb352('0x1ff')](_0x5868fa);}};Dialer[_0xb352('0x14')][_0xb352('0x1ff')]=function(_0x188316){var _0x4fcf29=this;var _0x46284f=[];_0x188316[_0xb352('0x78')]+=0x1;for(var _0x1a5a34 in this['agents']){if(typeof this['agents'][_0x1a5a34]!==_0xb352('0xa4')){if(this[_0xb352('0x1b')][_0x1a5a34]['state']===_0xb352('0x1fc')&&this[_0xb352('0x1b')][_0x1a5a34][_0xb352('0x81')]===_0xb352('0x140')){_0x46284f[_0xb352('0x93')](this[_0xb352('0x1b')][_0x1a5a34]['id']);}}}return this[_0xb352('0x1fd')](_0x188316['id'],_0x46284f,0x1,_0x188316[_0xb352('0x201')],_0x188316)[_0xb352('0x39')](function(_0x2fa496){if(!utils['checkContactEmpty'](_0x2fa496)){utils[_0xb352('0x60')](_0x188316,0x1,0x0);return hopperUtils['countReScheduled'](_0x188316)[_0xb352('0x39')](sendMessageReschedule(_0x188316))['catch'](loggerCatch(_0xb352('0x202')));}else{_0x188316['message']=utils['CAMPAIGN_STATUS'][_0xb352('0x1f4')];if(_[_0xb352('0xef')](_0x2fa496[0x0])||_[_0xb352('0xef')](_0x2fa496[0x0]['Contact'])||_[_0xb352('0xef')](_0x2fa496[0x0]['phone'])){_0x4fcf29[_0xb352('0x1f6')](_0xb352('0x1f7'),_0x188316,_0x2fa496[0x0]);}else{return hopperUtils[_0xb352('0x203')](_[_0xb352('0x6e')](_0x2fa496[0x0],[_0xb352('0xdc'),_0xb352('0x157')]))[_0xb352('0x39')](_0x4fcf29[_0xb352('0x1dc')](_0x188316,_0x2fa496[0x0]))[_0xb352('0x99')](_0x4fcf29[_0xb352('0x1f9')]('[actionOriginatePredictive]\x20',_0x188316));}}})[_0xb352('0x99')](loggerGetContactDialer('[getContactDialerPredictive]',_0x188316,0x1));};Dialer[_0xb352('0x14')][_0xb352('0x1cc')]=function(_0x4e3c10,_0x5e90b6,_0x3de690,_0x57d208,_0x37501e,_0x1f1558){loggerPredictive[_0xb352('0x43')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xb352('0x43')](_0xb352('0x204'),_0x4e3c10);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5e90b6);loggerPredictive[_0xb352('0x43')](_0xb352('0x205'),_0x3de690);loggerPredictive[_0xb352('0x43')](_0xb352('0x206'),_0x57d208);loggerPredictive['info'](_0xb352('0x207'),_0x37501e);loggerPredictive[_0xb352('0x43')]('---------------------------');return new Promise(function(_0x47c2e0,_0x4efb9f){if(_0x4e3c10<=0x0||isNaN(_0x4e3c10)){return _0x4efb9f(msgResponse(_0xb352('0x208'),_0xb352('0x7e'),_0xb352('0x209')+_0x4e3c10));}if(_0x3de690<=0x0||isNaN(_0x3de690)){return _0x4efb9f(msgResponse(_0xb352('0x208'),_0xb352('0x7e'),'Ts\x20=\x20'+_0x3de690));}if(_0x57d208<=0x0||isNaN(_0x57d208)){return _0x4efb9f(msgResponse('[abandonmentRate]','Error',_0xb352('0x20a')+_0x57d208));}if(_0x5e90b6<=0x0||isNaN(_0x5e90b6)){return _0x4efb9f(msgResponse(_0xb352('0x208'),_0xb352('0x7e'),_0xb352('0x20b')+_0x5e90b6));}if(_0x37501e<=0x0||isNaN(_0x37501e)){return _0x4efb9f(msgResponse('[abandonmentRate]','Error',_0xb352('0x20c')+_0x37501e));}_0x1f1558=_0x1f1558||0x0;var _0x53ce32=0x1/_0x3de690;var _0x21140f=0x0;var _0x4e4124=0x0;var _0x9ef58=0x0;var _0x43cf24=0x0;for(var _0x493ff0=0x0;_0x9ef58<_0x37501e;_0x493ff0+=0x1){_0x4e4124=_0x493ff0/_0x5e90b6;_0x21140f=(_0x57d208*_0x4e4124+_0x1f1558)/_0x53ce32;_0x9ef58=utils[_0xb352('0x20d')](_0x21140f,_0x4e3c10);_0x43cf24=_0x21140f/_0x4e3c10*(0x1-utils[_0xb352('0x20d')](_0x21140f,_0x4e3c10));}return _0x47c2e0({'erlangCalls':_0x493ff0,'erlangCallToSecond':_0x5e90b6/_0x493ff0,'erlangAbandonmentRate':_0x9ef58,'erlangBusyFactor':_0x43cf24});});};Dialer[_0xb352('0x14')][_0xb352('0x1cd')]=function(_0x2c5d1f,_0x21e609,_0x51c627,_0x486af3,_0x461eb9,_0xc5d888){loggerPredictive['info'](_0xb352('0x20e'));loggerPredictive[_0xb352('0x43')](_0xb352('0x204'),_0x2c5d1f);loggerPredictive[_0xb352('0x43')](_0xb352('0x20f'),_0x21e609);loggerPredictive[_0xb352('0x43')](_0xb352('0x205'),_0x51c627);loggerPredictive[_0xb352('0x43')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x486af3);loggerPredictive[_0xb352('0x43')](_0xb352('0x210'),_0x461eb9);loggerPredictive['info'](_0xb352('0x211'));return new Promise(function(_0x2e0272,_0x5756d4){if(_0x2c5d1f<=0x0||isNaN(_0x2c5d1f)){return _0x5756d4(msgResponse('[busyFactor]',_0xb352('0x7e'),_0xb352('0x209')+_0x2c5d1f));}if(_0x51c627<=0x0||isNaN(_0x51c627)){return _0x5756d4(msgResponse(_0xb352('0x212'),'Error','Ts\x20=\x20'+_0x51c627));}if(_0x486af3<=0x0||isNaN(_0x486af3)){return _0x5756d4(msgResponse(_0xb352('0x212'),_0xb352('0x7e'),_0xb352('0x20a')+_0x486af3));}if(_0x21e609<=0x0||isNaN(_0x21e609)){return _0x5756d4(msgResponse(_0xb352('0x212'),_0xb352('0x7e'),_0xb352('0x20b')+_0x21e609));}if(_0x461eb9<=0x0||isNaN(_0x461eb9)){return _0x5756d4(msgResponse('[busyFactor]',_0xb352('0x7e'),_0xb352('0x213')+_0x461eb9));}_0xc5d888=_0xc5d888||0x0;var _0x2524b0=0x1/_0x51c627;var _0x48ab9a=0x0;var _0x5830c9=0x0;var _0x3fe78e=0x0;var _0x7907ee=0x0;for(var _0x58159b=0x0;_0x7907ee<_0x461eb9;_0x58159b+=0x1){_0x5830c9=_0x58159b/_0x21e609;_0x48ab9a=(_0x486af3*_0x5830c9+_0xc5d888)/_0x2524b0;_0x3fe78e=utils[_0xb352('0x20d')](_0x48ab9a,_0x2c5d1f);_0x7907ee=_0x48ab9a/_0x2c5d1f*(0x1-utils[_0xb352('0x20d')](_0x48ab9a,_0x2c5d1f));}return _0x2e0272({'erlangCalls':_0x58159b,'erlangCallToSecond':_0x21e609/_0x58159b,'erlangAbandonmentRate':_0x3fe78e,'erlangBusyFactor':_0x7907ee});});};module[_0xb352('0x214')]=Dialer; \ No newline at end of file +var _0xf154=['countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','dialDropRetryFrequency','ContactId','ListId','CampaignId','Drop','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','add','minutes','VoiceQueueId','[rescheduleContact][Abandoned]','endtime','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','roundrobin','locked','paused','agents','stateinterface','isNil','idHopper','syncQueueStatusComplete','run','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','Success','callProgressDetecting','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','[syncHangupInAMDIvr]','outboundAnswerCallsDay','createStateFinal','[syncHangupIvr]','dialQueueProject','AnswerAGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','reachable','map','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact]','checkPreviewRecallReminder','Agent','handleIvr','actionOriginate','object','phone','originate','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','callerid','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','from-sip','[originateError]:\x20%s','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','Predictive\x20after\x20first\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at','avgHandleTime','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','dialMethod','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','./models/final','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\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','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','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','Interval','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','format','campaign:ivr:%s','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[ifTime][Action]','Error','isTrunkReachable','active','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','ifTime','timezones','UNKNOWN_TIMEZONE','isArray','push','Action','iftime\x20%s,%s','interval','then','content','indexOf','true','catch','command','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','progressive','power','dialPowerLevel','handlePower','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','reason','agent','agiafterat','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','dropreason','TIMEOUT','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xf154,0x147));var _0x4f15=function(_0xeaac0d,_0x1d121f){_0xeaac0d=_0xeaac0d-0x0;var _0x59efcc=_0xf154[_0xeaac0d];return _0x59efcc;};'use strict';var util=require(_0x4f15('0x0'));var _=require('lodash');var uuid=require(_0x4f15('0x1'));var moment=require(_0x4f15('0x2'));var rr=require('rr');var Redis=require(_0x4f15('0x3'));var utils=require(_0x4f15('0x4'));var hopperUtils=require(_0x4f15('0x5'));var ut=require(_0x4f15('0x6'));var config=require(_0x4f15('0x7'));var logger=require(_0x4f15('0x8'))(_0x4f15('0x9'));var loggerBooked=require(_0x4f15('0x8'))(_0x4f15('0xa'));var loggerPredictive=require(_0x4f15('0x8'))(_0x4f15('0xb'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x4f15('0xc'));var ami=require(_0x4f15('0xd'));config[_0x4f15('0xe')]=_[_0x4f15('0xf')](config[_0x4f15('0xe')],{'host':_0x4f15('0x10'),'port':0x18eb});var io=require(_0x4f15('0x11'))(new Redis(config[_0x4f15('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x4f15('0x12'));var RpcSetting=require(_0x4f15('0x13'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require('./models/history');var Final=require(_0x4f15('0x14'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x4f15('0x15'));var Hangup=require(_0x4f15('0x16'));var ipAgi=process[_0x4f15('0x17')][_0x4f15('0x18')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4f15('0x19')][_0x4f15('0x1a')]=function(_0x93403d){this[_0x4f15('0x1b')]=this[_0x4f15('0x1b')]?this[_0x4f15('0x1b')][_0x4f15('0x1c')](_0x93403d):_0x93403d();};function Dialer(_0x2d573f,_0x167337){this[_0x4f15('0x1d')]=new Sequence();this[_0x4f15('0x1e')]=_0x167337;this[_0x4f15('0x1f')]=_0x2d573f[_0x4f15('0x1f')];this[_0x4f15('0x20')]=_0x2d573f[_0x4f15('0x20')];this['agents']=_0x2d573f['agents'];this[_0x4f15('0x21')]=_0x2d573f['trunks'];this[_0x4f15('0x22')]=config[_0x4f15('0x22')]||0x2;this[_0x4f15('0x23')]={};this['actions']={};this[_0x4f15('0x24')]={};this[_0x4f15('0x25')]={};this[_0x4f15('0x26')]={};this[_0x4f15('0x27')]={};this[_0x4f15('0x28')]={};this[_0x4f15('0x29')]={};this[_0x4f15('0x2a')]={};this[_0x4f15('0x2b')]={};this[_0x4f15('0x2c')]={};ami['on'](_0x4f15('0x2d'),this[_0x4f15('0x2e')][_0x4f15('0x2f')](this));ami['on']('queuecallerabandon',this[_0x4f15('0x30')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x31'),this[_0x4f15('0x32')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x33'),this[_0x4f15('0x34')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x35'),this[_0x4f15('0xc')][_0x4f15('0x2f')](this));ami['on']('custom:queuesummarycomplete',this[_0x4f15('0x36')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x37'),this[_0x4f15('0x38')]['bind'](this));ami['on'](_0x4f15('0x39'),this[_0x4f15('0x3a')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x3b'),this[_0x4f15('0x3c')][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x3d'),this['syncQueueMember'][_0x4f15('0x2f')](this));ami['on'](_0x4f15('0x3e'),this['syncQueueStatusComplete']['bind'](this));this['loopCampaigns']();this[_0x4f15('0x3f')]();RpcSetting[_0x4f15('0x40')]()['then'](function(_0x311ca3){previewRecallmeReminderInterval=_0x311ca3[_0x4f15('0x41')];});}function isNotNull(_0x196d55){return _0x196d55!==null&&!_[_0x4f15('0x42')](_0x196d55);}function msgResponse(_0x198e97,_0x280fea,_0x398684){return{'action':_0x198e97,'response':_0x280fea,'message':_0x398684,'stack':_0x398684};}function emit(_0x21a86d,_0x18a8a0,_0x37f802){io['to'](_0x21a86d)[_0x4f15('0x43')](_0x18a8a0,_0x37f802);}function emitOutboundVoiceQueueSummary(_0x270fdb){if(_0x270fdb[_0x4f15('0x44')]===_0x4f15('0x45')){logger[_0x4f15('0x46')](_0x4f15('0x47'),util[_0x4f15('0x48')](_0x270fdb,{'showHidden':![],'depth':null}));emit(util['format'](_0x4f15('0x49'),_0x270fdb['name']),_0x4f15('0x4a'),_0x270fdb);}}function checkGetDataPredictive(_0x8a025a){if(isNotNull(_0x8a025a)&&!_[_0x4f15('0x4b')](_0x8a025a)){loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x4d'));loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x4e'),_0x8a025a['predictiveIntervalTotalCalls']);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x4f'),_0x8a025a['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x4f15('0x50'),_0x8a025a[_0x4f15('0x51')]);loggerPredictive['info'](_0x4f15('0x52'),_0x8a025a[_0x4f15('0x53')]);loggerPredictive['info'](_0x4f15('0x54'),_0x8a025a['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x55'),_0x8a025a[_0x4f15('0x56')]);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x57'));if(_0x8a025a[_0x4f15('0x58')]>0x0){if(!_[_0x4f15('0x42')](_0x8a025a[_0x4f15('0x56')])&&_0x8a025a[_0x4f15('0x56')]>0x0){return!![];}loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x59'));if(!_[_0x4f15('0x42')](_0x8a025a['predictiveIntervalAvgHoldtime'])&&_0x8a025a[_0x4f15('0x5a')]>0x0){return!![];}loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x5b'));}else{loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x5c'));}}else{loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x5d'));}return![];}function mergeDataErlangB(_0x4278f7){return function(_0x408d1b){loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x5e'));loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x5f'),_0x408d1b[_0x4f15('0x60')]);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x61'),_0x408d1b['erlangCallToSecond']);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x62'),_0x408d1b[_0x4f15('0x63')]);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x64'),_0x408d1b[_0x4f15('0x65')]);loggerPredictive['info'](_0x4f15('0x62'),_0x408d1b[_0x4f15('0x63')]);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x57'));_['merge'](_0x4278f7,_0x408d1b);};}function ifInterval(_0x250d01,_0x1dbe8d){if(_[_0x4f15('0x42')](_0x1dbe8d)){return![];}return utils[_0x4f15('0x66')](undefined,_0x1dbe8d)<_0x250d01*0x3c;}function clearPredictiveAttributes(_0xdf6a4){if(_0xdf6a4[_0x4f15('0x28')]){_0xdf6a4[_0x4f15('0x28')]=undefined;loggerPredictive['debug'](_0xdf6a4[_0x4f15('0x67')],_0x4f15('0x68'));}if(_0xdf6a4[_0x4f15('0x27')]){_0xdf6a4[_0x4f15('0x27')]=undefined;loggerPredictive[_0x4f15('0x46')](_0xdf6a4[_0x4f15('0x67')],_0x4f15('0x69'));}if(_0xdf6a4[_0x4f15('0x6a')]){clearInterval(_0xdf6a4['handlePredictive']);_0xdf6a4[_0x4f15('0x6a')]=undefined;loggerPredictive[_0x4f15('0x46')](_0xdf6a4['name'],_0x4f15('0x6b'));}}function loggerCatchPredictive(_0x1c286d,_0x5490f9){return function(_0x27c171){loggerPredictive[_0x4f15('0x6c')](_0x5490f9[_0x4f15('0x67')],_0x1c286d);loggerPredictive[_0x4f15('0x6c')](_0x27c171[_0x4f15('0x6d')]);clearPredictiveAttributes(_0x5490f9);};}function loggerCatch(_0x1f8ccf){return function(_0x2a9cfe){logger['error'](_0x1f8ccf,util[_0x4f15('0x48')](_0x2a9cfe,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x3a68ea,_0x242d1f,_0xc897a4){return function(_0x384631){utils['checkContactLowerLimitOriginate'](_0x242d1f,_0xc897a4,0x0);logger[_0x4f15('0x6c')](_0x3a68ea,util['inspect'](_0x384631,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3a4445){return function(_0x4af93b){if(isNotNull(_0x4af93b)&&isNotNull(_0x4af93b[0x0])){if(_0x4af93b[0x0][_0x4f15('0x6e')]>0x0){_0x3a4445[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x71')];logger[_0x4f15('0x4c')]('[getContactDialer2][ReScheduled]'+_0x3a4445[_0x4f15('0x67')],_0x4af93b[0x0][_0x4f15('0x6e')],'contacts');}else{_0x3a4445[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x72')];logger[_0x4f15('0x4c')](_0x4f15('0x73')+_0x3a4445[_0x4f15('0x67')]);}}};}function createObjHistory(_0x592960,_0x1a14e3,_0x2cf59e,_0x5d2826,_0x51343b){_0x592960['message']=_0x2cf59e;var _0x2bf493=new Action(_0x592960,_0x1a14e3);var _0x15cc60=new History(_0x2bf493);_0x15cc60[_0x4f15('0x74')]=_0x5d2826;_0x15cc60[_0x4f15('0x75')]=_0x51343b;_0x15cc60['endtime']=_0x2bf493[_0x4f15('0x76')];return _0x15cc60;}function unlockQueueStatus(_0x5ad833,_0x4cd658){setTimeout(function(){if(_['isUndefined'](_0x5ad833[_0x4f15('0x77')])){loggerBooked['error'](_0x4f15('0x78'),_0x4cd658);}_0x5ad833[_0x4f15('0x77')]=!![];loggerBooked[_0x4f15('0x4c')](_0x4f15('0x79'),_0x4cd658,JSON[_0x4f15('0x7a')](_[_0x4f15('0x7b')](_0x5ad833,[_0x4f15('0x67'),_0x4f15('0x77')])));},0x1f3);}function checkInterval(_0x4a3168){return function(){if(!isNotNull(_0x4a3168['Interval'])){_0x4a3168[_0x4f15('0x6f')]=utils['CAMPAIGN_STATUS'][_0x4f15('0x7c')];throw _0x4a3168['name']+_0x4f15('0x7d');}if(!isNotNull(_0x4a3168['Interval'][_0x4f15('0x7e')])){_0x4a3168[_0x4f15('0x6f')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x4a3168[_0x4f15('0x67')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x4f15('0x4b')](_0x4a3168[_0x4f15('0x7f')][_0x4f15('0x7e')]))){_0x4a3168['message']=utils[_0x4f15('0x70')]['NULL_INTERVAL'];throw _0x4a3168['name']+_0x4f15('0x7d');}};}function checkIsIVRCampaignActive(_0x2e6324){return function(){if(!utils[_0x4f15('0x80')](_0x2e6324)){_0x2e6324[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x81')];throw _0x2e6324[_0x4f15('0x67')]+_0x4f15('0x82');}};}function emitCampaignSummary(_0x204648){if(utils['isIVRCampaign'](_0x204648)){emit(util[_0x4f15('0x83')](_0x4f15('0x84'),_0x204648['name']),'campaign:save',_0x204648);}}function loggerCatchQueueSummary(_0x26627b,_0x2e881d){return function(_0x240735){clearPredictiveAttributes(_0x2e881d);emitCampaignSummary(_0x2e881d);loggerSyncQueueSummary['debug'](_0x26627b,util['inspect'](_0x240735,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4a4c84){if(_0x4a4c84[_0x4f15('0x85')]){if(_0x4a4c84[_0x4f15('0x86')]===0x0){_0x4a4c84[_0x4f15('0x85')]=![];_0x4a4c84['message']=utils[_0x4f15('0x70')][_0x4f15('0x81')];loggerSyncQueueSummary[_0x4f15('0x46')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4a4c84[_0x4f15('0x67')],_0x4f15('0x87'));}else{_0x4a4c84[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x88')];loggerSyncQueueSummary[_0x4f15('0x46')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4a4c84[_0x4f15('0x67')],'is\x20disactive');}emitCampaignSummary(_0x4a4c84);}}function myreject(_0x4c87f9){return function(_0x2243bd){return _0x4c87f9(msgResponse(_0x4f15('0x89'),_0x4f15('0x8a'),JSON[_0x4f15('0x7a')](_0x2243bd)));};}Dialer[_0x4f15('0x19')][_0x4f15('0x8b')]=function(_0x1dd589){return!_[_0x4f15('0x42')](_0x1dd589)&&_0x1dd589&&!_[_0x4f15('0x42')](_0x1dd589[_0x4f15('0x67')])&&!_['isUndefined'](_0x1dd589[_0x4f15('0x8c')])&&_0x1dd589['active']&&(this[_0x4f15('0x21')][util['format']('SIP/%s',_0x1dd589[_0x4f15('0x67')])][_0x4f15('0x8d')]==='reachable'||this[_0x4f15('0x21')][util[_0x4f15('0x83')]('SIP/%s',_0x1dd589[_0x4f15('0x67')])]['status']===_0x4f15('0x8e'));};Dialer[_0x4f15('0x19')][_0x4f15('0x8f')]=function(_0xc4d817){var _0xbd1bb4=this;return function(){if(!_0xbd1bb4['isTrunkReachable'](_0xc4d817[_0x4f15('0x90')])){if(!_0xbd1bb4[_0x4f15('0x8b')](_0xc4d817[_0x4f15('0x91')])){_0xc4d817[_0x4f15('0x6f')]=utils[_0x4f15('0x70')]['TRUNK_NOT_REACHABLE'];throw _0xc4d817[_0x4f15('0x67')]+_0x4f15('0x92');}}};};Dialer[_0x4f15('0x19')][_0x4f15('0x93')]=function(_0x129f00,_0x458b9d,_0x472f33,_0x9c7055){var _0x36d85b=this;return function(){var _0x416f91=!![];return _0x36d85b['ifTimeIvr'](_0x129f00,_0x458b9d,_0x472f33,_0x9c7055,_0x416f91);};};Dialer[_0x4f15('0x19')][_0x4f15('0x94')]=function(_0x2c81ca,_0x4908f9,_0x4cb9fe,_0x2baeae){var _0x3bf5b7=this;return function(){var _0x1fd56c=![];return _0x3bf5b7['ifTimeIvr'](_0x2c81ca['Intervals'],_0x4908f9,_0x4cb9fe,_0x2baeae,_0x1fd56c);};};Dialer[_0x4f15('0x19')][_0x4f15('0x95')]=function(_0x4037fc,_0x4fed9d,_0x11dec4,_0x5c87d2,_0x32f017){var _0x33246c=[];return new Promise(function(_0x220222,_0x5867b8){if(!isNotNull(_0x4037fc)){_0x5c87d2[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x7c')];return _0x5867b8(msgResponse('ifTime',_0x4f15('0x96'),_0x11dec4+_0x4f15('0x97')));}if(_[_0x4f15('0x4b')](_0x4037fc)){_0x5c87d2[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x98')];return _0x5867b8(msgResponse(_0x4f15('0x99'),_0x4f15('0x96'),_0x11dec4+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4fed9d&&_['isUndefined'](config[_0x4f15('0x9a')][_0x4fed9d])){_0x5c87d2[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x9b')];return _0x5867b8(msgResponse(_0x4f15('0x99'),'Failure',_0x11dec4+'\x20Timezone\x20unknow\x20'+_0x4fed9d));}if(_[_0x4f15('0x9c')](_0x4037fc)){for(var _0x31f6ce=0x0;_0x31f6ce<_0x4037fc['length'];_0x31f6ce+=0x1){_0x33246c[_0x4f15('0x9d')](ami[_0x4f15('0x9e')]({'action':'command','command':util[_0x4f15('0x83')](_0x4f15('0x9f'),_0x4037fc[_0x31f6ce][_0x4f15('0xa0')],!_[_0x4f15('0x42')](config['timezones'][_0x4fed9d])?_0x4fed9d:'')})[_0x4f15('0xa1')](function(_0xe0ece7){return _0xe0ece7[_0x4f15('0xa2')][_0x4f15('0xa3')](_0x4f15('0xa4'))>=0x0;})[_0x4f15('0xa5')](myreject(_0x5867b8)));}}else{_0x33246c['push'](ami[_0x4f15('0x9e')]({'action':_0x4f15('0xa6'),'command':util[_0x4f15('0x83')](_0x4f15('0x9f'),_0x4037fc,!_[_0x4f15('0x42')](config[_0x4f15('0x9a')][_0x4fed9d])?_0x4fed9d:'')})['then'](function(_0x529df6){return _0x529df6[_0x4f15('0xa2')][_0x4f15('0xa3')](_0x4f15('0xa4'))>=0x0;})['catch'](myreject(_0x5867b8)));}Promise[_0x4f15('0xa7')](_0x33246c)[_0x4f15('0xa1')](function(_0x22e08e){var _0x3f3fdb=_[_0x4f15('0xa8')](_0x22e08e);if(_0x3f3fdb){return _0x220222(_0x3f3fdb);}else{_0x5c87d2['message']=_0x32f017?utils[_0x4f15('0x70')][_0x4f15('0xa9')]:utils[_0x4f15('0x70')]['OVERTIME_INTERVAL'];return _0x5867b8(msgResponse(_0x4f15('0xaa'),_0x4f15('0x96'),_0x4f15('0xab')+_0x32f017+'\x20'+_0x11dec4+_0x4f15('0xac')+util['inspect'](_0x4037fc,{'showHidden':![],'depth':null})+_0x4f15('0xad')+_0x4fed9d));}})['catch'](function(_0x139bc8){return _0x5867b8(msgResponse(_0x4f15('0x99'),_0x4f15('0x96'),JSON['stringify'](_0x139bc8)));});});};Dialer[_0x4f15('0x19')][_0x4f15('0xae')]=function(){var _0x7051d0=this;return cmHopper[_0x4f15('0xaf')]({'active':![]},{'where':{'active':!![]}})[_0x4f15('0xa1')](function(){setInterval(function(){_0x7051d0[_0x4f15('0xb0')]();},0x3e8);});};Dialer[_0x4f15('0x19')][_0x4f15('0xb0')]=function(){var _0x309020=this;var _0x378b8e;for(var _0x46f67e in this[_0x4f15('0x20')]){if(typeof this['campaigns'][_0x46f67e]!==_0x4f15('0xb1')){_0x378b8e=this['campaigns'][_0x46f67e];if(utils['isIVRCampaign'](_0x378b8e)&&utils[_0x4f15('0x80')](_0x378b8e)){_0x378b8e[_0x4f15('0x85')]=!![];Promise[_0x4f15('0xb2')]()[_0x4f15('0xa1')](checkIsIVRCampaignActive(_0x378b8e))['then'](checkInterval(_0x378b8e))[_0x4f15('0xa1')](_0x309020[_0x4f15('0x8f')](_0x378b8e))[_0x4f15('0xa1')](_0x309020['checkIfTime'](_0x378b8e[_0x4f15('0xb3')],_0x378b8e[_0x4f15('0xb4')],_0x378b8e[_0x4f15('0x67')],_0x378b8e))['then'](_0x309020[_0x4f15('0x94')](_0x378b8e[_0x4f15('0x7f')],_0x378b8e[_0x4f15('0xb4')],_0x378b8e[_0x4f15('0x67')],_0x378b8e))[_0x4f15('0xa1')](_0x309020[_0x4f15('0xb5')](_0x378b8e))[_0x4f15('0xa5')](loggerCatchQueueSummary('[syncCampaigns]',_0x378b8e));}else{notSendMessagesCampaign(_0x378b8e);}}}};Dialer['prototype'][_0x4f15('0xb6')]=function(_0x2063e1){if(_0x2063e1['dialMethod']!==_0x4f15('0xb')){clearPredictiveAttributes(_0x2063e1);}switch(_0x2063e1['dialMethod']){case _0x4f15('0xb7'):this['handlePower'](_0x2063e1,0x1);break;case _0x4f15('0xb8'):this['handlePower'](_0x2063e1,_0x2063e1[_0x4f15('0xb9')]);break;case'predictive':this['predictive'](_0x2063e1);break;case _0x4f15('0xa'):this[_0x4f15('0xba')](_0x2063e1,0x1);break;default:logger[_0x4f15('0x6c')](_0x4f15('0xbb'),_0x2063e1['name'],_0x4f15('0xbc'));}};Dialer[_0x4f15('0x19')][_0x4f15('0x99')]=function(_0x45ba40,_0x23d6dd){var _0x397ff8=_0x45ba40[_0x4f15('0xb4')];var _0xd76a3a=_0x23d6dd?_0x45ba40['dialGlobalInterval']:_0x45ba40['Interval'][_0x4f15('0x7e')];logger[_0x4f15('0xbd')]('Dialer::ifTime()',_0xd76a3a,_0x397ff8,_0x45ba40[_0x4f15('0x67')],util[_0x4f15('0x83')](_0x4f15('0xbe'),_0x45ba40['name'],_0x45ba40['id']));var _0x1d9c98=null;return Interval[_0x4f15('0xbf')](_0xd76a3a,_0x397ff8)[_0x4f15('0xa1')](function(_0x40989b){if(_0x40989b===!![]){return _0x40989b;}else{_0x45ba40['message']=_0x23d6dd?utils['CAMPAIGN_STATUS'][_0x4f15('0xa9')]:utils[_0x4f15('0x70')][_0x4f15('0xc0')];_0x1d9c98=msgResponse(_0x4f15('0xaa'),'Failure',_0x4f15('0xab')+_0x23d6dd+'\x20'+_0x45ba40['name']+_0x4f15('0xac')+util['inspect'](_0xd76a3a,{'showHidden':![],'depth':null})+_0x4f15('0xad')+_0x397ff8);}if(_0x1d9c98!==null){logger[_0x4f15('0xbd')](_0x4f15('0xc1'),_0x1d9c98);_0x1d9c98['isGlobal']=_0x23d6dd;throw _0x1d9c98;}})[_0x4f15('0xa5')](function(_0x27170e){logger[_0x4f15('0x6c')](_0x4f15('0xc2'),_0x27170e);throw msgResponse('[ifTime][Action]',_0x4f15('0x8a'),util['inspect'](_0x27170e,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x4f15('0x2e')]=function(_0x299b25){if(this['voiceQueues'][_0x299b25[_0x4f15('0xc3')]]){if(this[_0x4f15('0x25')][_0x299b25[_0x4f15('0xc4')]]&&this[_0x4f15('0x25')][_0x299b25[_0x4f15('0xc4')]][_0x4f15('0x44')]!==_0x4f15('0xc5')){this[_0x4f15('0xc6')](this[_0x4f15('0x1f')][_0x299b25[_0x4f15('0xc3')]]);this[_0x4f15('0x25')][_0x299b25[_0x4f15('0xc4')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x4f15('0x19')]['syncAgentComplete']=function(_0x59c4c1){var _0x1eb061=this[_0x4f15('0x25')][_0x59c4c1[_0x4f15('0xc4')]];if(this[_0x4f15('0x1f')][_0x59c4c1[_0x4f15('0xc3')]]){if(_0x1eb061&&_0x1eb061[_0x4f15('0x44')]!==_0x4f15('0xc5')){delete this[_0x4f15('0x25')][_0x59c4c1[_0x4f15('0xc4')]];this[_0x4f15('0x1f')][_0x59c4c1[_0x4f15('0xc3')]]['outboundAnswerCallsDay']+=0x1;var _0x463359=new AgentComplete(_0x1eb061,_0x59c4c1);if(_0x59c4c1[_0x4f15('0xc7')]===_0x4f15('0xc8')){_0x463359[_0x4f15('0xc9')]=this[_0x4f15('0x1f')][_0x59c4c1[_0x4f15('0xc3')]]['dialQueueProject2']&&this[_0x4f15('0x1f')][_0x59c4c1[_0x4f15('0xc3')]]['dialAgiAfterHangupAgent']?moment()[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x4f15('0xca')](_0x463359)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0xcb')));hopperUtils[_0x4f15('0xcc')](_0x463359)['catch'](loggerCatch(_0x4f15('0xcd')));}}};Dialer['prototype'][_0x4f15('0x30')]=function(_0x62dc84){var _0xfbf34e=this[_0x4f15('0x25')][_0x62dc84[_0x4f15('0xc4')]];var _0x397350=this;var _0x377028=![];var _0x5a8bda;var _0x1f3278;if(this[_0x4f15('0x1f')][_0x62dc84['queue']]){if(_0xfbf34e&&_0xfbf34e[_0x4f15('0x44')]!=='ivr'){delete this['uniqueId'][_0x62dc84[_0x4f15('0xc4')]];this[_0x4f15('0xc6')](this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]]);_0xfbf34e[_0x4f15('0xce')]=moment()[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4b59f8=new QueueCallerAbandon(_0xfbf34e,_0x62dc84);if(utils[_0x4f15('0x66')](_0xfbf34e['droptime'],_0xfbf34e[_0x4f15('0xcf')])>=_0xfbf34e[_0x4f15('0xd0')]){this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]][_0x4f15('0x51')]+=0x1;this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]][_0x4f15('0xd1')]+=0x1;this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4b59f8[_0x4f15('0x74')]=0xa;_0x4b59f8[_0x4f15('0x75')]='Drop';_0x4b59f8[_0x4f15('0xd2')]=_0x4f15('0xd3');_0x4b59f8['agiafterat']=this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]]['dialQueueProject2']?moment()['format'](_0x4f15('0xd4')):undefined;_0x4b59f8[_0x4f15('0xd5')]+=0x1;_0x4b59f8[_0x4f15('0xd6')]+=0x1;_0x5a8bda=this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]]['dialDropRetryFrequency'];_0x1f3278=this[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x4f15('0xd7')](_0x4b59f8,_0x4b59f8[_0x4f15('0x74')],_0xfbf34e[_0x4f15('0xd8')])[_0x4f15('0xa1')](function(_0x5e559d){_0x377028=_0x5e559d[_0x4f15('0xd9')]==0x1;if(_0x4b59f8[_0x4f15('0xd5')]>=_0x397350['voiceQueues'][_0x62dc84[_0x4f15('0xc3')]]['dialDropMaxRetry']){_0x397350[_0x4f15('0xda')](_0x4b59f8,_0x5e559d['additional']);}else{hopperUtils[_0x4f15('0xdb')]({'active':![],'countdropretry':_0x4b59f8[_0x4f15('0xd5')],'scheduledat':moment()['add'](_0x397350['voiceQueues'][_0x62dc84[_0x4f15('0xc3')]][_0x4f15('0xdc')],'minutes')[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xfbf34e[_0x4f15('0xdd')],'ListId':_0xfbf34e[_0x4f15('0xde')],'VoiceQueueId':_0xfbf34e['VoiceQueueId']||undefined,'CampaignId':_0xfbf34e[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact][Drop]'));var _0x1466a1=new History(_0x4b59f8);_0x1466a1[_0x4f15('0x74')]=0xa;_0x1466a1[_0x4f15('0x75')]=_0x4f15('0xe0');_0x1466a1['starttime']=moment()[_0x4f15('0x83')](_0x4f15('0xd4'));_0x1466a1['endtime']=_0x1466a1[_0x4f15('0x76')];_0x1466a1[_0x4f15('0xe1')]=_0x4b59f8[_0x4f15('0xe1')];_0x1466a1[_0x4f15('0xe2')]=_0x4b59f8[_0x4f15('0xe2')];hopperUtils[_0x4f15('0xca')](_0x1466a1)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x4f15('0xa1')](function(){if(_0x377028)hopperUtils[_0x4f15('0xe3')](_0x4b59f8,_0x5a8bda,_0x1f3278)[_0x4f15('0xa1')](function(){return 0x1;});});}else{this[_0x4f15('0x1f')][_0x62dc84['queue']][_0x4f15('0x53')]+=0x1;this['voiceQueues'][_0x62dc84[_0x4f15('0xc3')]][_0x4f15('0xe4')]+=0x1;_0x4b59f8['state']=0xb;_0x4b59f8[_0x4f15('0x75')]=_0x4f15('0xe5');_0x4b59f8[_0x4f15('0xd2')]='CALLEREXIT';_0x4b59f8[_0x4f15('0xe6')]+=0x1;_0x4b59f8[_0x4f15('0xd6')]+=0x1;_0x5a8bda=this[_0x4f15('0x1f')][_0x62dc84['queue']][_0x4f15('0xe7')];_0x1f3278=this[_0x4f15('0x1f')][_0x62dc84['queue']][_0x4f15('0xe8')];hopperUtils[_0x4f15('0xd7')](_0x4b59f8,_0x4b59f8[_0x4f15('0x74')],_0xfbf34e[_0x4f15('0xd8')])[_0x4f15('0xa1')](function(_0x4a1f47){if(_0x4b59f8[_0x4f15('0xe6')]>=_0x397350[_0x4f15('0x1f')][_0x62dc84[_0x4f15('0xc3')]][_0x4f15('0xe9')]){_0x397350[_0x4f15('0xda')](_0x4b59f8,_0x4a1f47[_0x4f15('0xd9')]);}else{hopperUtils[_0x4f15('0xdb')]({'active':![],'countabandonedretry':_0x4b59f8[_0x4f15('0xe6')],'scheduledat':moment()[_0x4f15('0xea')](_0x397350[_0x4f15('0x1f')][_0x62dc84['queue']][_0x4f15('0xe7')],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0xfbf34e['ContactId'],'ListId':_0xfbf34e[_0x4f15('0xde')],'VoiceQueueId':_0xfbf34e[_0x4f15('0xec')]||undefined,'CampaignId':_0xfbf34e[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch(_0x4f15('0xed')));var _0x44e648=new History(_0x4b59f8);_0x44e648[_0x4f15('0x74')]=0xb;_0x44e648[_0x4f15('0x75')]=_0x4f15('0xe5');_0x44e648['starttime']=moment()['format'](_0x4f15('0xd4'));_0x44e648[_0x4f15('0xee')]=_0x44e648[_0x4f15('0x76')];_0x44e648['calleridname']=_0x4b59f8['calleridname'];_0x44e648[_0x4f15('0xe2')]=_0x4b59f8['calleridnum'];hopperUtils['createHistory'](_0x44e648)['catch'](loggerCatch(_0x4f15('0xef')));}})[_0x4f15('0xa1')](function(){if(_0x377028)hopperUtils[_0x4f15('0xe3')](_0x4b59f8,_0x5a8bda,_0x1f3278)[_0x4f15('0xa1')](function(){return 0x1;});});}}}};Dialer[_0x4f15('0x19')]['syncNewExten']=function(_0x12e759){if(this[_0x4f15('0xf0')][_0x12e759['uniqueid']]){this['actions'][_0x12e759[_0x4f15('0xc4')]][_0x4f15('0xf1')]=_0x12e759['channel'];}if(this[_0x4f15('0x25')][_0x12e759[_0x4f15('0xc4')]]){this[_0x4f15('0x25')][_0x12e759['uniqueid']][_0x4f15('0xf1')]=_0x12e759['channel'];}};Dialer[_0x4f15('0x19')]['syncQueueMember']=function(_0x5e29ca){if(!this['actions'][_0x5e29ca[_0x4f15('0xf2')]]){return;}var _0x957524=this[_0x4f15('0x1f')][this[_0x4f15('0xf0')][_0x5e29ca['actionid']][_0x4f15('0xc3')]][_0x4f15('0xf3')]||_0x4f15('0xf4');if(_0x957524===_0x4f15('0xf5')){if(this[_0x4f15('0xf0')][_0x5e29ca[_0x4f15('0xf2')]]&&_['isNil'](this[_0x4f15('0xf0')][_0x5e29ca[_0x4f15('0xf2')]][_0x4f15('0xf6')])&&_0x5e29ca[_0x4f15('0x8d')]==='1'&&_0x5e29ca[_0x4f15('0xf7')]==='0'){if(this[_0x4f15('0xf8')][_0x5e29ca[_0x4f15('0xf9')]]){if(!this[_0x4f15('0xf8')][_0x5e29ca['stateinterface']][_0x4f15('0xf6')]){this[_0x4f15('0xf8')][_0x5e29ca[_0x4f15('0xf9')]][_0x4f15('0xf6')]=!![];this['actions'][_0x5e29ca[_0x4f15('0xf2')]][_0x4f15('0xf6')]=!![];this[_0x4f15('0xf0')][_0x5e29ca['actionid']][_0x4f15('0xf9')]=_0x5e29ca[_0x4f15('0xf9')];}}}}else if(_0x957524===_0x4f15('0xf4')){if(this[_0x4f15('0xf0')][_0x5e29ca[_0x4f15('0xf2')]]){if(this['agents'][_0x5e29ca[_0x4f15('0xf9')]]){this[_0x4f15('0xf0')][_0x5e29ca[_0x4f15('0xf2')]][_0x4f15('0xf9')]=_0x5e29ca[_0x4f15('0xf9')];if(_[_0x4f15('0xfa')](this[_0x4f15('0x2a')][this['actions'][_0x5e29ca['actionid']][_0x4f15('0xc3')]])){this[_0x4f15('0x2a')][this[_0x4f15('0xf0')][_0x5e29ca['actionid']]['queue']]=[];}this[_0x4f15('0x2a')][this['actions'][_0x5e29ca[_0x4f15('0xf2')]][_0x4f15('0xc3')]][_0x4f15('0x9d')](_['merge'](_['pick'](this[_0x4f15('0xf0')][_0x5e29ca[_0x4f15('0xf2')]],[_0x4f15('0xfb'),'stateinterface']),{'status':_0x5e29ca['status'],'paused':_0x5e29ca['paused']}));}}}};Dialer['prototype'][_0x4f15('0xfc')]=function(_0x4544ed){if(!this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]]){return;}var _0x3bea4c=this;var _0x2042b3=this['voiceQueues'][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]]['queue']];var _0x10d8ce=_0x2042b3[_0x4f15('0xf3')]||_0x4f15('0xf4');if(_0x10d8ce===_0x4f15('0xf5')){if(this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]]&&this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]]['stateinterface']){this[_0x4f15('0x1e')][_0x4f15('0xfd')](this['actions'][_0x4544ed['actionid']][_0x4f15('0xfb')],this['actions'][_0x4544ed['actionid']][_0x4f15('0xf9')])[_0x4f15('0xa5')](function(_0x46c68e){logger[_0x4f15('0x6c')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x4f15('0x48')](_0x46c68e,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3bea4c['updateOriginated'](_0x3bea4c[_0x4f15('0x1f')][_0x3bea4c[_0x4f15('0xf0')][_0x4544ed['actionid']][_0x4f15('0xc3')]]);_0x3bea4c[_0x4f15('0xf8')][_0x3bea4c[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xf9')]][_0x4f15('0xf6')]=![];delete _0x3bea4c[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]];unlockQueueStatus(_0x2042b3);});}else{this['updateOriginated'](this[_0x4f15('0x1f')][this['actions'][_0x4544ed['actionid']]['queue']]);hopperUtils[_0x4f15('0xdb')]({'active':![],'ContactId':this['actions'][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xdd')],'ListId':this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xde')],'VoiceQueueId':this[_0x4f15('0xf0')][_0x4544ed['actionid']][_0x4f15('0xec')]||undefined,'CampaignId':this['actions'][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]];unlockQueueStatus(_0x2042b3);}}else if(_0x10d8ce===_0x4f15('0xf4')){var _0x153185;if(this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]]&&!_['isEmpty'](this[_0x4f15('0x2a')][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xc3')]])){if(this[_0x4f15('0x2b')][_0x3bea4c[_0x4f15('0xf0')][_0x4544ed['actionid']][_0x4f15('0xc3')]]){this['queueBookedRR'][_0x3bea4c['actions'][_0x4544ed[_0x4f15('0xf2')]]['queue']]=this[_0x4f15('0x2b')][this['actions'][_0x4544ed[_0x4f15('0xf2')]]['queue']]?this[_0x4f15('0x2b')][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xc3')]]:this['queueBooked'][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xc3')]]?this[_0x4f15('0x2a')][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xc3')]][_0x4f15('0xfe')]||0x0:0x0;}this[_0x4f15('0x2a')][this[_0x4f15('0xf0')][_0x4544ed[_0x4f15('0xf2')]][_0x4f15('0xc3')]]['_rr']=this[_0x4f15('0x2b')][this[_0x4f15('0xf0')][_0x4544ed['actionid']][_0x4f15('0xc3')]];for(var _0x4892c1=0x0;_0x4892c1=_0x551c82[_0x4f15('0x126')]){_0x23b4ad[_0x4f15('0x127')](_0x1d0387,_0x310ef0,_0x57d68d,_0x4f15('0x128'));}else{if(_0x1d0387[_0x4f15('0x11f')]>=_0x551c82[_0x4f15('0x129')]){_0x23b4ad['createStateFinal'](_0x1d0387,_0x310ef0,_0x57d68d,_0x4f15('0x12a'));}else{hopperUtils[_0x4f15('0xdb')]({'active':![],'countmachineretry':_0x1d0387['countmachineretry'],'scheduledat':moment()[_0x4f15('0xea')](_0x551c82['dialMachineRetryFrequency'],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0x1d0387['ContactId'],'ListId':_0x1d0387[_0x4f15('0xde')],'VoiceQueueId':_0x1d0387[_0x4f15('0xec')]||undefined,'CampaignId':_0x1d0387['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x310ef0({'reschedule':0x1});}}});}if(_0x5041a5[_0x4f15('0x44')]===_0x4f15('0xc5')&&this['campaigns'][_0x5041a5['queue']]['dialAMDActive']&&_0x1b95a7[_0x4f15('0x111')]==='HANGUP'){delete this[_0x4f15('0x25')][_0x1b95a7[_0x4f15('0xc4')]];this[_0x4f15('0xc6')](this[_0x4f15('0x20')][_0x5041a5[_0x4f15('0xc3')]]);_0x4bae45=new Hangup(_0x5041a5,_0x1b95a7);_0x4bae45[_0x4f15('0x74')]=0x12;_0x4bae45[_0x4f15('0x75')]=_0x4f15('0x113');_0x4bae45[_0x4f15('0x114')]=_0x4f15('0x115');ami[_0x4f15('0x43')](_0x4f15('0x116'),ut[_0x4f15('0x117')](_0x4bae45,_0x4f15('0x118')));this[_0x4f15('0x119')](_0x4bae45,'[syncHangupInAMDIvr][createHistory]',_0x4f15('0x12b'));}if(_0x5041a5[_0x4f15('0x44')]===_0x4f15('0xc5')&&this[_0x4f15('0x20')][_0x5041a5['queue']]['dialAMDActive']&&_0x1b95a7[_0x4f15('0x111')]===_0x4f15('0x11c')){return new Promise(function(_0x2ccc5c,_0x3dfa14){delete _0x23b4ad[_0x4f15('0x25')][_0x1b95a7['uniqueid']];_0x23b4ad[_0x4f15('0xc6')](_0x23b4ad['campaigns'][_0x5041a5['queue']]);_0x23b4ad[_0x4f15('0x20')][_0x5041a5[_0x4f15('0xc3')]][_0x4f15('0x12c')]+=0x1;_0x23b4ad[_0x4f15('0x20')][_0x5041a5[_0x4f15('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x4e2dcc=_0x23b4ad['campaigns'][_0x5041a5[_0x4f15('0xc3')]];var _0x1e4c88=new Hangup(_0x5041a5,_0x1b95a7);_0x1e4c88[_0x4f15('0x74')]=0x13;_0x1e4c88[_0x4f15('0x75')]='Machine';_0x1e4c88['membername']='AMD';_0x1e4c88[_0x4f15('0x11f')]+=0x1;_0x1e4c88[_0x4f15('0xd6')]+=0x1;_0x1e4c88[_0x4f15('0x118')]=!![];ami[_0x4f15('0x43')]('custom:amd',ut[_0x4f15('0x117')](_0x1e4c88,_0x4f15('0x118')));hopperUtils[_0x4f15('0xca')](_0x1e4c88)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1e4c88[_0x4f15('0x121')]+_0x1e4c88['countcongestionretry']+_0x1e4c88[_0x4f15('0x123')]+_0x1e4c88[_0x4f15('0x124')]+_0x1e4c88[_0x4f15('0xd5')]+_0x1e4c88[_0x4f15('0xe6')]+_0x1e4c88[_0x4f15('0x11f')]+_0x1e4c88[_0x4f15('0x125')]>=_0x4e2dcc[_0x4f15('0x126')]){_0x23b4ad['stateGlobal'](_0x1e4c88,_0x2ccc5c,_0x3dfa14,_0x4f15('0x128'));}else{if(_0x1e4c88[_0x4f15('0x11f')]>=_0x4e2dcc[_0x4f15('0x129')]){_0x23b4ad[_0x4f15('0x12d')](_0x1e4c88,_0x2ccc5c,_0x3dfa14,_0x4f15('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1e4c88[_0x4f15('0x11f')],'scheduledat':moment()[_0x4f15('0xea')](_0x4e2dcc['dialMachineRetryFrequency'],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0x1e4c88[_0x4f15('0xdd')],'ListId':_0x1e4c88['ListId'],'VoiceQueueId':_0x1e4c88[_0x4f15('0xec')]||undefined,'CampaignId':_0x1e4c88[_0x4f15('0xdf')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x2ccc5c({'reschedule':0x1});}}});}}};Dialer[_0x4f15('0x19')][_0x4f15('0x38')]=function(_0x31cc50){var _0x359f59=this['uniqueId'][_0x31cc50[_0x4f15('0xc4')]];var _0x5de12d;if(_0x359f59&&_0x359f59[_0x4f15('0x44')]==='ivr'){delete this['uniqueId'][_0x31cc50[_0x4f15('0xc4')]];this[_0x4f15('0xc6')](this['campaigns'][_0x359f59[_0x4f15('0xc3')]]);this[_0x4f15('0x20')][_0x359f59[_0x4f15('0xc3')]]['ivrAnswerCallsDay']+=0x1;_0x5de12d=new Hangup(_0x359f59,_0x31cc50);hopperUtils['createHistory'](_0x5de12d)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x4f15('0xcc')](_0x5de12d)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x12e')));}if(_0x359f59&&_0x359f59[_0x4f15('0x44')]!=='ivr'&&isNotNull(this[_0x4f15('0x1f')][_0x359f59[_0x4f15('0xc3')]][_0x4f15('0x12f')])){delete this[_0x4f15('0x25')][_0x31cc50['uniqueid']];this['updateOriginated'](this[_0x4f15('0x1f')][_0x359f59[_0x4f15('0xc3')]]);this[_0x4f15('0x1f')][_0x359f59['queue']][_0x4f15('0x12c')]+=0x1;this[_0x4f15('0x1f')][_0x359f59[_0x4f15('0xc3')]][_0x4f15('0x11d')]+=0x1;_0x5de12d=new Hangup(_0x359f59,_0x31cc50);_0x5de12d[_0x4f15('0x74')]=0x10;_0x5de12d[_0x4f15('0x75')]=_0x4f15('0x130');_0x5de12d[_0x4f15('0x114')]='AGI';hopperUtils[_0x4f15('0xca')](_0x5de12d)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x131')));hopperUtils[_0x4f15('0xcc')](_0x5de12d)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x12e')));}if(_0x359f59&&_0x359f59[_0x4f15('0x44')]!==_0x4f15('0xc5')&&!isNotNull(this[_0x4f15('0x1f')][_0x359f59['queue']][_0x4f15('0x12f')])){delete this['uniqueId'][_0x31cc50[_0x4f15('0xc4')]];this[_0x4f15('0xc6')](this[_0x4f15('0x1f')][_0x359f59[_0x4f15('0xc3')]]);this['voiceQueues'][_0x359f59[_0x4f15('0xc3')]]['outboundUnknownCallsDay']+=0x1;_0x5de12d=new Hangup(_0x359f59,_0x31cc50);_0x5de12d['state']=0xc;_0x5de12d['statedesc']=_0x31cc50[_0x4f15('0x132')];_0x5de12d[_0x4f15('0x114')]=_0x4f15('0x133');hopperUtils[_0x4f15('0xca')](_0x5de12d)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x131')));hopperUtils[_0x4f15('0xcc')](_0x5de12d)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x12e')));}};Dialer[_0x4f15('0x19')]['syncQueueSummary']=function(_0x3bf948){var _0x1eb5c9=this;if(!_0x1eb5c9[_0x4f15('0x2c')][_0x3bf948[_0x4f15('0x67')]]){_0x1eb5c9[_0x4f15('0x2c')][_0x3bf948[_0x4f15('0x67')]]={'running':![]};}else if(_0x1eb5c9[_0x4f15('0x2c')][_0x3bf948['name']][_0x4f15('0x134')]===!![]){return;}else if(_0x1eb5c9['queuesSummary'][_0x3bf948['name']][_0x4f15('0x134')]===![]){_0x1eb5c9[_0x4f15('0x2c')][_0x3bf948[_0x4f15('0x67')]][_0x4f15('0x134')]=!![];}var _0x45dadd=_0x1eb5c9[_0x4f15('0x1f')][_0x3bf948[_0x4f15('0x67')]];var _0x2e104e=_0x45dadd[_0x4f15('0x6f')]!==utils['CAMPAIGN_STATUS'][_0x4f15('0x81')];var _0x7df32f=utils[_0x4f15('0x135')](_0x45dadd);_0x45dadd[_0x4f15('0x136')]=utils[_0x4f15('0x137')](_0x45dadd,_0x1eb5c9['trunks']);Promise[_0x4f15('0xb2')]()[_0x4f15('0xa1')](function(){if(_0x45dadd[_0x4f15('0x136')]===utils[_0x4f15('0x70')][_0x4f15('0x81')]){if(_0x2e104e){clearPredictiveAttributes(_0x45dadd);_0x3bf948[_0x4f15('0x27')]=undefined;_0x3bf948[_0x4f15('0x28')]=undefined;}if(_0x45dadd['statusMessage']===utils[_0x4f15('0x70')][_0x4f15('0x81')]){_0x3bf948[_0x4f15('0x138')]=0x0;_0x3bf948[_0x4f15('0xf7')]=0x0;_0x3bf948['inUse']=0x0;_0x3bf948[_0x4f15('0x139')]=0x0;_0x3bf948[_0x4f15('0x13a')]=0x0;}}else if(_0x45dadd[_0x4f15('0x136')]===utils[_0x4f15('0x70')][_0x4f15('0x13b')]&&!_0x7df32f){return _0x1eb5c9[_0x4f15('0x99')](_0x45dadd,!![])[_0x4f15('0xa1')](function(){return _0x1eb5c9[_0x4f15('0x99')](_0x45dadd,![]);})[_0x4f15('0xa1')](function(){return _0x1eb5c9[_0x4f15('0xb6')](_0x45dadd);})[_0x4f15('0xa5')](function(_0x2c7169){loggerSyncQueueSummary['debug'](_0x4f15('0x13c'),util[_0x4f15('0x48')](_0x2c7169,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x45dadd);});}else{clearPredictiveAttributes(_0x45dadd);}})[_0x4f15('0xa1')](function(){var _0x1182c3=_0x3bf948[_0x4f15('0x13d')](_0x45dadd);if(_0x1182c3||_0x45dadd[_0x4f15('0x13e')]){_0x45dadd[_0x4f15('0x13e')]=![];_0x3bf948[_0x4f15('0x13f')](_0x45dadd);Object[_0x4f15('0x140')](_0x45dadd,_0x3bf948);emitOutboundVoiceQueueSummary(_0x3bf948);}_0x1eb5c9[_0x4f15('0x2c')][_0x45dadd[_0x4f15('0x67')]]['running']=![];})[_0x4f15('0xa5')](function(_0x479e58){logger[_0x4f15('0x6c')]('[syncQueueSummary]',util[_0x4f15('0x48')](_0x479e58,{'showHidden':![],'depth':null}));_0x1eb5c9[_0x4f15('0x2c')][_0x45dadd[_0x4f15('0x67')]][_0x4f15('0x134')]=![];});};Dialer['prototype']['syncQueueSummaryComplete']=_[_0x4f15('0x141')](function(){var _0x5a6089=_[_0x4f15('0x142')](this[_0x4f15('0x1f')],function(_0x4bf122){return _0x4bf122[_0x4f15('0x143')];});var _0x31be21=_[_0x4f15('0x142')](this[_0x4f15('0xf8')],function(_0x5a8dbc){return _0x5a8dbc['online']&&_0x5a8dbc[_0x4f15('0x8d')]===_0x4f15('0x144');});if(_0x5a6089[_0x4f15('0xff')]>0x0&&_0x31be21[_0x4f15('0xff')]>0x0){return Promise['resolve']()[_0x4f15('0xa1')](cmHopper['handlePreviewRecallNotifications'](_[_0x4f15('0x145')](_0x5a6089,'id'),previewRecallmeReminderInterval,_[_0x4f15('0x145')](_0x31be21,'id')))[_0x4f15('0xa1')](function(_0x4d7876){for(var _0x4c90ea=0x0;_0x4c90ea<_0x4d7876[_0x4f15('0xff')];_0x4c90ea++){var _0x4b4e24=_0x4d7876[_0x4c90ea]['Agent'][_0x4f15('0x67')];if(_0x4b4e24)io['to'](util[_0x4f15('0x83')](_0x4f15('0x146'),_0x4b4e24))[_0x4f15('0x43')](_0x4f15('0x147'),{'hopper':_0x4d7876[_0x4c90ea]});}})[_0x4f15('0xa5')](function(_0x214492){logger[_0x4f15('0x6c')]('checkPreviewRecallReminder',_0x214492);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x4f15('0x19')][_0x4f15('0x3f')]=function(){var _0x459ed7=this;setInterval(function(){_0x459ed7[_0x4f15('0x148')](_0x459ed7[_0x4f15('0x25')],_0x4f15('0x149'));_0x459ed7[_0x4f15('0x148')](_0x459ed7[_0x4f15('0xf0')],_0x4f15('0x14a'));},0x32c8);};Dialer[_0x4f15('0x19')][_0x4f15('0x148')]=function(_0x40928f,_0xfdb152){var _0x2b7649=this;for(var _0x27bbea in _0x40928f){if(typeof _0x40928f[_0x27bbea]!==_0x4f15('0xb1')){this[_0x4f15('0x1d')][_0x4f15('0x1a')](function(){if(!_[_0x4f15('0xfa')](_0x40928f[_0x27bbea])){return ami[_0x4f15('0x9e')]({'action':_0x4f15('0x8d'),'channel':_0x40928f[_0x27bbea]['channel']})[_0x4f15('0xa5')](function(_0x48229b){if(_0x48229b[_0x4f15('0x6f')]===_0x4f15('0x14b')){setTimeout(function(){if(_0x40928f[_0x27bbea]&&_0x40928f[_0x27bbea][_0x4f15('0x44')]!==_0x4f15('0xc5')){_0x2b7649[_0x4f15('0xc6')](_0x2b7649['voiceQueues'][_0x40928f[_0x27bbea][_0x4f15('0xc3')]]);logger[_0x4f15('0x6c')](_0x4f15('0x14c'),_0xfdb152,_0x27bbea,_0x40928f[_0x27bbea]['queue']);delete _0x40928f[_0x27bbea];}if(_0x40928f[_0x27bbea]&&_0x40928f[_0x27bbea][_0x4f15('0x44')]===_0x4f15('0xc5')){_0x2b7649[_0x4f15('0xc6')](_0x2b7649[_0x4f15('0x20')][_0x40928f[_0x27bbea]['queue']]);logger[_0x4f15('0x6c')](_0x4f15('0x14d'),_0xfdb152,_0x27bbea,_0x40928f[_0x27bbea][_0x4f15('0xc3')]);delete _0x40928f[_0x27bbea];}},0x2328);}});}});}}};Dialer['prototype'][_0x4f15('0x14e')]=function(_0x54c0c5){return Promise[_0x4f15('0xb2')]()[_0x4f15('0xa1')](voiceQueueRt[_0x4f15('0x14e')](_0x54c0c5))[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x14f')));};Dialer[_0x4f15('0x19')][_0x4f15('0xc6')]=function(_0xb68259){if(!_['isUndefined'](_0xb68259)&&_0xb68259!==null){if(typeof _0xb68259['originated']!==_0x4f15('0xb1')){if(_0xb68259[_0x4f15('0x86')]>0x0){_0xb68259[_0x4f15('0x86')]-=0x1;}else{logger[_0x4f15('0x6c')](_0x4f15('0x150'));}}}else{logger[_0x4f15('0x6c')](_0x4f15('0x151'));}};Dialer[_0x4f15('0x19')][_0x4f15('0x152')]=function(_0xdd264b,_0x3c4bb5){var _0x4710b2=this;return function(_0x2f9209){_0x4710b2[_0x4f15('0xc6')](_0x3c4bb5);logger[_0x4f15('0x6c')](_0xdd264b,util[_0x4f15('0x48')](_0x2f9209,{'showHidden':![],'depth':null}));};};Dialer[_0x4f15('0x19')]['emptyContact']=function(_0x1a6001,_0xb38ec4,_0x424fc5){var _0x192627={'state':0x19,'statedesc':_0x4f15('0x153')};this[_0x4f15('0xc6')](_0xb38ec4);this[_0x4f15('0x119')](_['merge'](_0x192627,_[_0x4f15('0x7b')](_0x424fc5,[_0x4f15('0xdd'),'ListId',_0x4f15('0x154'),_0x4f15('0xec'),_0x4f15('0xdf')])),'[emptyContact][createHistory]',_0x4f15('0x155'));logger[_0x4f15('0x6c')](_0x1a6001);};Dialer[_0x4f15('0x19')][_0x4f15('0x119')]=function(_0x53284f,_0x5e1358,_0x1b6cb7){hopperUtils[_0x4f15('0xca')](_0x53284f)[_0x4f15('0xa5')](loggerCatch(_0x5e1358));hopperUtils[_0x4f15('0xcc')](_0x53284f)[_0x4f15('0xa5')](loggerCatch(_0x1b6cb7));};Dialer[_0x4f15('0x19')]['queueCallerAbandonCreateState']=function(_0x1487cd,_0x2832a6){hopperUtils[_0x4f15('0xca')](_0x1487cd)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x2832a6==0x0){hopperUtils[_0x4f15('0xcc')](_0x1487cd)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0x4f15('0x156')]=function(_0x55283a){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0x55283a['id'],previewRecallmeReminderInterval))[_0x4f15('0xa1')](function(_0x44d271){for(var _0x59a5a0=0x0;_0x59a5a0<_0x44d271[_0x4f15('0xff')];_0x59a5a0++){var _0x33fa3f=_0x44d271[_0x59a5a0][_0x4f15('0x157')][_0x4f15('0x67')];if(_0x33fa3f)io['to'](util[_0x4f15('0x83')](_0x4f15('0x146'),_0x33fa3f))[_0x4f15('0x43')](_0x4f15('0x147'),{'hopper':_0x44d271[_0x59a5a0]});}})[_0x4f15('0xa5')](function(){});};Dialer['prototype'][_0x4f15('0xb5')]=function(_0x126825){var _0x1bef09=this;return function(){_0x1bef09[_0x4f15('0x158')](_0x126825);};};Dialer['prototype'][_0x4f15('0x159')]=function(_0x2c8aee,_0xedd4fa){var _0x524d89=this;var _0x25422d=uuid['v4']();this['actions'][_0x25422d]=new Action(_0x2c8aee,_0xedd4fa,_0x25422d);return new Promise(function(_0xb3b86e,_0x2216cd){if(_[_0x4f15('0x42')](_0x2c8aee)&&typeof _0x2c8aee!==_0x4f15('0x15a')){return _0x2216cd(msgResponse('originate',_0x4f15('0x96'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0xedd4fa[_0x4f15('0x15b')])||_0xedd4fa[_0x4f15('0x15b')]===null){return _0x2216cd(msgResponse(_0x4f15('0x15c'),_0x4f15('0x96'),'contact\x20is\x20undefine'));}var _0x1b0236={'XMD-CALLERID':_0x524d89[_0x4f15('0xf0')][_0x25422d][_0x4f15('0x15d')](),'XMD-AGI':_0x2c8aee[_0x4f15('0x12f')]?util[_0x4f15('0x83')](_0x4f15('0x15e'),ipAgi,_0x2c8aee['dialQueueProject']):_0x4f15('0x15f'),'XMD-AGIAFTER':_0x2c8aee[_0x4f15('0x160')]?util[_0x4f15('0x83')](_0x4f15('0x15e'),ipAgi,_0x2c8aee[_0x4f15('0x160')]):_0x4f15('0x15f'),'XMD-QUEUE':utils[_0x4f15('0x161')](_0x2c8aee)?util[_0x4f15('0x83')]('\x22%s,%s%s,,,%s\x22',_0x2c8aee[_0x4f15('0x67')],_0x2c8aee[_0x4f15('0x162')]||'',_0x2c8aee[_0x4f15('0x163')]?'c':'',_0x2c8aee[_0x4f15('0xd0')]||0x3):'NONE','XMD-CONTACTID':_0xedd4fa[_0x4f15('0xdd')],'XMD-CDRTYPE':_0x4f15('0x9'),'CALLERID(all)':_0x524d89[_0x4f15('0xf0')][_0x25422d][_0x4f15('0x15d')](),'XMD-AMD':_0x2c8aee[_0x4f15('0x11b')]?_0x4f15('0x13b'):_0x4f15('0x15f'),'XMD-DESTINATION':_0x4f15('0x110')};if(_0x2c8aee['dialAMDActive']){_0x1b0236[_0x4f15('0x164')]=_0x2c8aee[_0x4f15('0x165')]||0x9c4;_0x1b0236['XMD-AMDGREETING']=_0x2c8aee['dialAMDGreeting']||0x5dc;_0x1b0236[_0x4f15('0x166')]=_0x2c8aee[_0x4f15('0x167')]||0x320;_0x1b0236[_0x4f15('0x168')]=_0x2c8aee[_0x4f15('0x169')]||0x1388;_0x1b0236['XMD-AMDMINWORDLENGTH']=_0x2c8aee[_0x4f15('0x16a')]||0x64;_0x1b0236[_0x4f15('0x16b')]=_0x2c8aee[_0x4f15('0x16c')]||0x32;_0x1b0236[_0x4f15('0x16d')]=_0x2c8aee[_0x4f15('0x16e')]||0x3;_0x1b0236[_0x4f15('0x16f')]=_0x2c8aee['dialAMDSilenceThreshold']||0x100;_0x1b0236[_0x4f15('0x170')]=_0x2c8aee['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x4f15('0x161')](_0x2c8aee)){_0x1b0236[_0x4f15('0x171')]=_0xedd4fa[_0x4f15('0xec')];}else{_0x1b0236['XMD-CAMPAIGNID']=_0xedd4fa[_0x4f15('0xdf')];}for(var _0x1673cc in _0xedd4fa[_0x4f15('0x172')]){if(typeof _0xedd4fa['Contact'][_0x1673cc]!==_0x4f15('0xb1')){if(isNotNull(_0xedd4fa[_0x4f15('0x172')][_0x1673cc])&&_0x1673cc!=='id'&&_0x1673cc!==_0x4f15('0x173')&&_0x1673cc!==_0x4f15('0x174')&&_0x1673cc!==_0x4f15('0x175')){_0x1b0236[util['format'](_0x4f15('0x176'),_0x4f15('0x177'),_['toUpper'](_0x1673cc))]=_0xedd4fa['Contact'][_0x1673cc];}}}var _0x1ff246=_0x524d89[_0x4f15('0x8b')](_0x2c8aee[_0x4f15('0x90')])?utils['getCallerId'](_0x2c8aee['Trunk']['callerid'],_0x2c8aee[_0x4f15('0x178')],_0x2c8aee[_0x4f15('0x179')]>0x0?utils[_0x4f15('0x17a')](_0x2c8aee[_0x4f15('0x17b')],_0x2c8aee[_0x4f15('0x179')]):_0x2c8aee['dialOriginateCallerIdNumber']):utils[_0x4f15('0x17c')](_[_0x4f15('0xfa')](_0x2c8aee['TrunkBackup'])?_0x2c8aee['Trunk']['callerid']:_0x2c8aee[_0x4f15('0x91')][_0x4f15('0x17d')],_0x2c8aee['dialOriginateCallerIdName'],_0x2c8aee[_0x4f15('0x179')]>0x0?utils[_0x4f15('0x17a')](_0x2c8aee['dialOriginateCallerIdNumber'],_0x2c8aee[_0x4f15('0x179')]):_0x2c8aee[_0x4f15('0x17b')]);if(_0x1ff246){_0x1b0236[_0x4f15('0x17e')]=_0x524d89['actions'][_0x25422d]['originatecalleridname']=utils[_0x4f15('0x17f')](_0x1ff246);_0x1b0236[_0x4f15('0x180')]=_0xedd4fa[_0x4f15('0x15b')];}_0x2c8aee[_0x4f15('0x181')]=_0x1b0236;return ami['Action']({'actionid':_0x25422d,'action':_0x4f15('0x15c'),'channel':_0x524d89['isTrunkReachable'](_0x2c8aee[_0x4f15('0x90')])?util[_0x4f15('0x83')](_0x4f15('0x182'),_0x2c8aee[_0x4f15('0x90')][_0x4f15('0x67')],isNotNull(_0x2c8aee['dialPrefix'])?_0x2c8aee[_0x4f15('0x183')][_0x4f15('0x184')]()||'':'',_0x2c8aee[_0x4f15('0x185')]>0x0?_0xedd4fa[_0x4f15('0x15b')]['substring'](_0x2c8aee[_0x4f15('0x185')]):_0xedd4fa[_0x4f15('0x15b')]):util[_0x4f15('0x83')]('SIP/%s/%s%s',_['isNil'](_0x2c8aee[_0x4f15('0x91')])?_0x2c8aee[_0x4f15('0x90')]['name']:_0x2c8aee[_0x4f15('0x91')][_0x4f15('0x67')],isNotNull(_0x2c8aee['dialPrefix'])?_0x2c8aee[_0x4f15('0x183')][_0x4f15('0x184')]()||'':'',_0x2c8aee['dialCutDigit']>0x0?_0xedd4fa[_0x4f15('0x15b')]['substring'](_0x2c8aee['dialCutDigit']):_0xedd4fa[_0x4f15('0x15b')]),'callerid':_0x1ff246,'Exten':_0x4f15('0x110'),'Context':_0x4f15('0x186'),'Priority':'1','variable':_0x1b0236,'timeout':(_0x2c8aee['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x25422d})['then'](function(_0x34d59f){return _0xb3b86e(_0x34d59f);})['catch'](function(_0x8678a4){_0x2c8aee['outboundOriginateFailureCallsDay']+=0x1;var _0x2717f9=new History(_0x524d89[_0x4f15('0xf0')][_0x25422d]);logger[_0x4f15('0x6c')](util[_0x4f15('0x83')](_0x4f15('0x187'),JSON[_0x4f15('0x7a')](_0x8678a4)));_0x2717f9[_0x4f15('0x74')]=0xe;_0x2717f9[_0x4f15('0x75')]='OriginateError';_0x2717f9['starttime']=moment()[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss');_0x2717f9[_0x4f15('0xee')]=_0x2717f9['starttime'];hopperUtils[_0x4f15('0xca')](_0x2717f9)[_0x4f15('0xa5')](loggerCatch('[originate][error]'));_0x524d89[_0x4f15('0xcc')](_0x2717f9)[_0x4f15('0xa5')](loggerCatch('[originate][error]'))[_0x4f15('0x1c')](function(){delete _0x524d89[_0x4f15('0xf0')][_0x25422d];return _0x2216cd(msgResponse(_0x4f15('0x15c'),_0x4f15('0x8a'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x4f15('0x188')]=function(_0x4fc30f,_0x567adc,_0x15c428){var _0xa648ef=new History(_0x567adc);if(_0xa648ef[_0x4f15('0x121')]+_0xa648ef['countcongestionretry']+_0xa648ef[_0x4f15('0x123')]+_0xa648ef[_0x4f15('0x124')]+_0xa648ef['countdropretry']+_0xa648ef['countabandonedretry']+_0xa648ef[_0x4f15('0x11f')]+_0xa648ef[_0x4f15('0x125')]>=_0x15c428['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x4fc30f){case 0x3:if(_0xa648ef[_0x4f15('0x123')]>=_0x15c428[_0x4f15('0x189')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0xa648ef[_0x4f15('0x123')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428[_0x4f15('0x18a')],'minutes')[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa648ef[_0x4f15('0xdd')],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef['VoiceQueueId']||undefined,'CampaignId':_0xa648ef['CampaignId']||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xa648ef['countbusyretry']>=_0x15c428[_0x4f15('0x18b')]-0x1){return!![];}hopperUtils[_0x4f15('0xdb')]({'active':![],'countbusyretry':_0xa648ef[_0x4f15('0x121')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428['dialBusyRetryFrequency'],_0x4f15('0xeb'))['format'](_0x4f15('0xd4')),'ContactId':_0xa648ef[_0x4f15('0xdd')],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef[_0x4f15('0xec')]||undefined,'CampaignId':_0xa648ef['CampaignId']||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0xa648ef[_0x4f15('0x122')]>=_0x15c428[_0x4f15('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0xa648ef['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x15c428['dialCongestionRetryFrequency'],_0x4f15('0xeb'))['format'](_0x4f15('0xd4')),'ContactId':_0xa648ef[_0x4f15('0xdd')],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef[_0x4f15('0xec')]||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xa648ef[_0x4f15('0x124')]>=_0x15c428[_0x4f15('0x18d')]-0x1){return!![];}else{hopperUtils[_0x4f15('0xdb')]({'active':![],'countnosuchnumberretry':_0xa648ef[_0x4f15('0x124')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428[_0x4f15('0x18e')],'minutes')[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa648ef[_0x4f15('0xdd')],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef['VoiceQueueId']||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})['catch'](loggerCatch(_0x4f15('0x18f')));}break;case 0xa:if(_0xa648ef[_0x4f15('0xd5')]>=_0x15c428[_0x4f15('0x190')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0xa648ef[_0x4f15('0xd5')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428[_0x4f15('0xdc')],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0xa648ef['ContactId'],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef[_0x4f15('0xec')]||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x191')));break;case 0xb:if(_0xa648ef[_0x4f15('0xe6')]>=_0x15c428[_0x4f15('0xe9')]-0x1){return!![];}hopperUtils[_0x4f15('0xdb')]({'active':![],'countabandonedretry':_0xa648ef[_0x4f15('0xe6')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428[_0x4f15('0xe7')],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0xa648ef['ContactId'],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef[_0x4f15('0xec')]||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0xa648ef[_0x4f15('0x11f')]>=_0x15c428[_0x4f15('0x129')]-0x1){return!![];}hopperUtils[_0x4f15('0xdb')]({'active':![],'countmachineretry':_0xa648ef[_0x4f15('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x15c428[_0x4f15('0x192')],'minutes')[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa648ef[_0x4f15('0xdd')],'ListId':_0xa648ef[_0x4f15('0xde')],'VoiceQueueId':_0xa648ef['VoiceQueueId']||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0xa648ef[_0x4f15('0x125')]>=_0x15c428[_0x4f15('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0xa648ef[_0x4f15('0x125')]+=0x1,'scheduledat':moment()[_0x4f15('0xea')](_0x15c428[_0x4f15('0x194')],_0x4f15('0xeb'))[_0x4f15('0x83')](_0x4f15('0xd4')),'ContactId':_0xa648ef['ContactId'],'ListId':_0xa648ef['ListId'],'VoiceQueueId':_0xa648ef[_0x4f15('0xec')]||undefined,'CampaignId':_0xa648ef[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x195')));break;default:return!![];}};Dialer['prototype'][_0x4f15('0x10d')]=function(_0x3026bb,_0xbbd181,_0xee39b1){var _0x297c38=this;var _0x4124de=new History(_0x3026bb);var _0x1c416a=![];var _0x8864f0;var _0x67bdc2;return new Promise(function(_0x22d6d5,_0x28caa2){if(_[_0x4f15('0x42')](_0xbbd181)&&typeof _0xbbd181!=='object'){return _0x28caa2(msgResponse(_0x4f15('0x196'),_0x4f15('0x96'),_0x4f15('0x197')));}if(_[_0x4f15('0x42')](_0xee39b1)&&typeof _0xee39b1!==_0x4f15('0x15a')){return _0x28caa2(msgResponse(_0x4f15('0x196'),_0x4f15('0x96'),_0x4f15('0x198')));}hopperUtils[_0x4f15('0xd7')](_0x4124de,_0xee39b1[_0x4f15('0xc7')],_0xbbd181)[_0x4f15('0xa1')](function(_0x391715){if(_0x391715[_0x4f15('0xd9')]==0x1)_0x1c416a=!![];switch(_0xee39b1[_0x4f15('0xc7')]){case'0':_0xbbd181[_0x4f15('0x199')]+=0x1;_0x4124de[_0x4f15('0x74')]=0x0;_0x4124de['statedesc']=_0x4f15('0x19a');_0x4124de[_0x4f15('0x124')]+=0x1;_0x4124de[_0x4f15('0xd6')]+=0x1;ami['emit'](_0x4f15('0x19b'),ut['buildObj'](_0x3026bb,_0x4f15('0x19c')));_0x8864f0=_0xbbd181[_0x4f15('0x18e')];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];hopperUtils[_0x4f15('0xca')](_0x4124de)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x120')));if(_0x297c38['checkRetriveMax'](0x0,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x124')]>=_0xbbd181[_0x4f15('0x18d')]){_0x297c38[_0x4f15('0x12d')](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x19d'));}else{_0x297c38[_0x4f15('0x127')](_0x4124de,_0x22d6d5,_0x28caa2,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xbbd181[_0x4f15('0x19e')]+=0x1;_0x4124de[_0x4f15('0x74')]=0x3;_0x4124de[_0x4f15('0x75')]=_0x4f15('0x19f');_0x4124de[_0x4f15('0x123')]+=0x1;_0x4124de[_0x4f15('0xd6')]+=0x1;var _0x48fad7=ut['buildNoAnswerEventPayload'](_0x3026bb,_0xbbd181);ami[_0x4f15('0x43')](_0x4f15('0x1a0'),_0x48fad7);_0x8864f0=_0xbbd181[_0x4f15('0x18a')];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];hopperUtils[_0x4f15('0xca')](_0x4124de)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x297c38['checkRetriveMax'](0x3,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x123')]>=_0xbbd181[_0x4f15('0x189')]){_0x297c38['createStateFinal'](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1a1'));}else{_0x297c38['stateGlobal'](_0x4124de,_0x22d6d5,_0x28caa2,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0xbbd181[_0x4f15('0x1a2')]+=0x1;_0x4124de[_0x4f15('0x74')]=0x5;_0x4124de[_0x4f15('0x75')]=_0x4f15('0x1a3');_0x4124de[_0x4f15('0x121')]+=0x1;_0x4124de[_0x4f15('0xd6')]+=0x1;ami[_0x4f15('0x43')](_0x4f15('0x1a4'),ut['buildObj'](_0x3026bb,_0x4f15('0x1a5')));_0x8864f0=_0xbbd181[_0x4f15('0x1a6')];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];hopperUtils[_0x4f15('0xca')](_0x4124de)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x297c38[_0x4f15('0x188')](0x5,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x121')]>=_0xbbd181[_0x4f15('0x18b')]){_0x297c38[_0x4f15('0x12d')](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1a7'));}else{_0x297c38[_0x4f15('0x127')](_0x4124de,_0x22d6d5,_0x28caa2,'reason\x205\x20busy');}}break;case'8':_0xbbd181[_0x4f15('0x1a8')]+=0x1;_0x4124de['state']=0x8;_0x4124de[_0x4f15('0x75')]=_0x4f15('0x1a9');_0x4124de[_0x4f15('0x122')]+=0x1;_0x4124de['countglobal']+=0x1;_0x8864f0=_0xbbd181[_0x4f15('0x1aa')];_0x67bdc2=_0xbbd181['callAdditionalPhoneAfterMin'];ami[_0x4f15('0x43')]('custom:agentcongestion',ut[_0x4f15('0x117')](_0x3026bb,'congestion'));hopperUtils['createHistory'](_0x4124de)['catch'](loggerCatch(_0x4f15('0x1ab')));if(_0x297c38[_0x4f15('0x188')](0x8,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x122')]>=_0xbbd181[_0x4f15('0x18c')]){_0x297c38['createStateFinal'](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1ac'));}else{_0x297c38[_0x4f15('0x127')](_0x4124de,_0x22d6d5,_0x28caa2,'reason\x208\x20congestion');}}break;case'11':_0xbbd181['outboundAbandonedCallsDay']+=0x1;_0x4124de[_0x4f15('0x74')]=0xb;_0x4124de[_0x4f15('0x75')]='Abandoned';_0x4124de['countabandonedretry']+=0x1;_0x4124de[_0x4f15('0xd6')]+=0x1;_0x8864f0=_0xbbd181[_0x4f15('0xe7')];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];hopperUtils['createHistory'](_0x4124de)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x297c38[_0x4f15('0x188')](0xb,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de['countabandonedretry']>=_0xbbd181['dialAbandonedMaxRetry']){_0x297c38['createStateFinal'](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1ad'));}else{_0x297c38['stateGlobal'](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1ad'));}}break;case'20':_0xbbd181[_0x4f15('0x1ae')]+=0x1;_0x4124de[_0x4f15('0x74')]=0x14;_0x4124de[_0x4f15('0x75')]=_0x4f15('0x1af');_0x4124de[_0x4f15('0x125')]+=0x1;_0x4124de['countglobal']+=0x1;_0x8864f0=_0xbbd181['dialAgentRejectRetryFrequency'];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];ami[_0x4f15('0x43')](_0x4f15('0x1b0'),ut['buildObj'](_0x3026bb,_0x4f15('0x1b1')));hopperUtils['createHistory'](_0x4124de)[_0x4f15('0xa5')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x297c38[_0x4f15('0x188')](0x14,_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x125')]>=_0xbbd181[_0x4f15('0x193')]){_0x297c38['createStateFinal'](_0x4124de,_0x22d6d5,_0x28caa2,'reason\x2020\x20agentreject');}else{_0x297c38[_0x4f15('0x127')](_0x4124de,_0x22d6d5,_0x28caa2,_0x4f15('0x1b2'));}}break;default:_0xbbd181[_0x4f15('0x1b3')]+=0x1;_0x4124de[_0x4f15('0x74')]=0xc;_0x4124de[_0x4f15('0x75')]=_0xee39b1[_0x4f15('0xc7')];_0x8864f0=_0xbbd181['dialAgentRejectRetryFrequency'];_0x67bdc2=_0xbbd181[_0x4f15('0xe8')];hopperUtils['createHistory'](_0x4124de)[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x1b4')));if(_0x297c38[_0x4f15('0x188')](_0xee39b1[_0x4f15('0xc7')],_0x3026bb,_0xbbd181)&&!_0x1c416a){if(_0x4124de[_0x4f15('0x121')]+_0x4124de['countcongestionretry']+_0x4124de['countnoanswerretry']+_0x4124de[_0x4f15('0x124')]+_0x4124de['countdropretry']+_0x4124de[_0x4f15('0xe6')]+_0x4124de[_0x4f15('0x11f')]+_0x4124de[_0x4f15('0x125')]>=_0xbbd181[_0x4f15('0x126')]){_0x297c38[_0x4f15('0x127')](_0x4124de,_0x22d6d5,_0x28caa2,_0xee39b1[_0x4f15('0xc7')]);}else{_0x297c38[_0x4f15('0x12d')](_0x4124de,_0x22d6d5,_0x28caa2,_0xee39b1[_0x4f15('0xc7')]);}}}})['then'](function(){if(_0x1c416a){hopperUtils[_0x4f15('0xe3')](_0x4124de,_0x8864f0,_0x67bdc2)[_0x4f15('0xa1')](function(){return _0x22d6d5(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x5185f4,_0x2277dd,_0x45bfed,_0x46db11){var _0x3938dc=new Final(_0x5185f4);_0x3938dc[_0x4f15('0x74')]=0xf;_0x3938dc[_0x4f15('0x75')]=_0x4f15('0x1b5');this[_0x4f15('0x12d')](_0x3938dc,_0x2277dd,_0x45bfed,_0x46db11);};Dialer[_0x4f15('0x19')][_0x4f15('0x12d')]=function(_0x24bb3c,_0x2618cf,_0x1c6063,_0x4e2ede){hopperUtils['moveContactManagedDialer'](_0x24bb3c)[_0x4f15('0xa1')](function(){return _0x2618cf(msgResponse('[callProgressDetecting]','Success',_0x4e2ede));})[_0x4f15('0xa5')](function(){return _0x1c6063(msgResponse(_0x4f15('0x1b6'),_0x4f15('0x96'),'contact\x20not\x20moved'));});};Dialer[_0x4f15('0x19')][_0x4f15('0xb')]=function(_0x5937de){var _0x5ea880=_0x5937de[_0x4f15('0x1b7')]/0x64;var _0x3eb913=_0x5937de[_0x4f15('0xd1')]/(_0x5937de[_0x4f15('0xd1')]+_0x5937de[_0x4f15('0x12c')]);var _0x5b35ec=Math[_0x4f15('0x1b8')](_0x5937de[_0x4f15('0x1b9')]*(_0x5937de['predictiveIntervalMaxThreshold']/0x64));var _0x46c38d=Math[_0x4f15('0x1b8')](_0x5937de[_0x4f15('0x1b9')]*(_0x5937de[_0x4f15('0x1ba')]/0x64));var _0x53ef93=_0x5937de[_0x4f15('0x138')]+_0x5937de['talking'];var _0x120496=Math['floor'](_0x5937de[_0x4f15('0x60')]*_0x5937de['erlangAbandonmentRate']*_0x5937de[_0x4f15('0x1bb')]*_0x5937de[_0x4f15('0x1bc')]);if(_[_0x4f15('0x42')](_0x5937de[_0x4f15('0x28')])){if(!_[_0x4f15('0x42')](_0x5937de[_0x4f15('0x27')])){_0x5937de[_0x4f15('0x27')]=undefined;loggerPredictive[_0x4f15('0x6c')](_0x4f15('0x1bd'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x4f15('0x42')](_0x5937de[_0x4f15('0x6a')])){loggerPredictive[_0x4f15('0x6c')](_0x4f15('0x1bd'),_0x4f15('0x1be'));clearInterval(_0x5937de['handlePredictive']);_0x5937de[_0x4f15('0x6a')]=undefined;}_0x5937de[_0x4f15('0x28')]=moment()[_0x4f15('0x83')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4f15('0x4c')](_0x5937de[_0x4f15('0x67')],_0x4f15('0x1bf'),_0x5937de[_0x4f15('0x28')]);this[_0x4f15('0xba')](_0x5937de,0x1);}else if(ifInterval(_0x5937de['dialPredictiveInterval'],_0x5937de['startProgressive'])){this[_0x4f15('0xba')](_0x5937de,0x1);loggerPredictiveCalls['info'](_0x4f15('0x1c0'),_0x5937de[_0x4f15('0x28')],_0x5937de[_0x4f15('0x67')]);_0x5937de[_0x4f15('0x60')]=0x0;_0x5937de[_0x4f15('0x1c1')]=0x0;}else if(_0x5ea880<_0x3eb913&&_0x5937de[_0x4f15('0x1c2')]===_0x4f15('0x1c3')){clearPredictiveAttributes(_0x5937de);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x1c4'),_0x4f15('0x1c5'),_0x3eb913,_0x4f15('0x28'),_0x5937de[_0x4f15('0x67')]);}else if(_0x120496<_0x5937de[_0x4f15('0x1c1')]&&_0x5937de[_0x4f15('0x1c2')]===_0x4f15('0x1c3')){clearPredictiveAttributes(_0x5937de);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x1c6'),'Max\x20Drop\x20',_0x120496,_0x4f15('0x1c7'),_0x5937de['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x5937de[_0x4f15('0x67')]);}else if(!ifInterval(_0x5937de['dialPredictiveInterval'],_0x5937de[_0x4f15('0x28')])&&_[_0x4f15('0x42')](_0x5937de[_0x4f15('0x27')])&&!_[_0x4f15('0x42')](_0x5937de[_0x4f15('0x28')])){_0x5937de[_0x4f15('0x27')]=moment()[_0x4f15('0x83')](_0x4f15('0xd4'));loggerPredictive[_0x4f15('0x4c')](_0x5937de[_0x4f15('0x67')],'started\x20in\x20predictive\x20at',_0x5937de['startPredictive']);hopperUtils['avgHandleTime'](_0x5937de['dialPredictiveInterval'])[_0x4f15('0xa1')](this[_0x4f15('0x1c8')](_0x5937de))[_0x4f15('0xa1')](mergeDataErlangB(_0x5937de))[_0x4f15('0xa1')](this['startMethodPredictive'](_0x5937de))['catch'](loggerCatchPredictive(_0x4f15('0x1c9'),_0x5937de));}else if(!ifInterval(_0x5937de[_0x4f15('0x1ca')],_0x5937de[_0x4f15('0x27')])){_0x5937de[_0x4f15('0x1c1')]=0x0;_0x5937de[_0x4f15('0x27')]=moment()['format'](_0x4f15('0xd4'));loggerPredictive[_0x4f15('0x4c')](_0x5937de['name'],_0x4f15('0x1cb'),_0x5937de[_0x4f15('0x27')]);clearInterval(_0x5937de['handlePredictive']);_0x5937de[_0x4f15('0x6a')]=undefined;hopperUtils[_0x4f15('0x1cc')](_0x5937de[_0x4f15('0x1ca')])[_0x4f15('0xa1')](this[_0x4f15('0x1c8')](_0x5937de))[_0x4f15('0xa1')](mergeDataErlangB(_0x5937de))['then'](this[_0x4f15('0x1cd')](_0x5937de))[_0x4f15('0xa5')](loggerCatchPredictive(_0x4f15('0x1ce'),_0x5937de));}else if(_0x5937de[_0x4f15('0x1b9')]&&_0x53ef93<_0x5937de[_0x4f15('0x1b9')]-_0x46c38d){clearPredictiveAttributes(_0x5937de);loggerPredictive['info'](_0x5937de[_0x4f15('0x67')],_0x4f15('0x1cf'),_0x53ef93,_0x4f15('0x1d0'),_0x5937de['predictiveIntervalAvailable'],'-',_0x46c38d,'=',_0x5937de['predictiveIntervalAvailable']-_0x46c38d,')');}else if(_0x5937de['predictiveIntervalAvailable']&&_0x53ef93>_0x5937de['predictiveIntervalAvailable']+_0x5b35ec){clearPredictiveAttributes(_0x5937de);loggerPredictive[_0x4f15('0x4c')](_0x5937de[_0x4f15('0x67')],_0x4f15('0x1cf'),_0x53ef93,_0x4f15('0x1d1'),_0x5937de[_0x4f15('0x1b9')],'+',_0x5b35ec,'=',_0x5937de[_0x4f15('0x1b9')]+_0x5b35ec,')');}};Dialer['prototype'][_0x4f15('0x1c8')]=function(_0xc84660){var _0x519c66=this;return function(_0x25a0a9){return new Promise(function(_0x230cf9,_0x257fea){_[_0x4f15('0x1d2')](_0xc84660,_0x25a0a9[0x0]);if(checkGetDataPredictive(_0x25a0a9[0x0])){var _0x2d4be8=_0xc84660['predictiveIntervalAvailable']=_0xc84660[_0x4f15('0x139')]+_0xc84660[_0x4f15('0x138')];var _0xb0d043=_0xc84660[_0x4f15('0x1ca')]*0x3c;var _0x1e13a3=_0x25a0a9[0x0][_0x4f15('0x56')]+_0x25a0a9[0x0][_0x4f15('0x5a')];var _0x5cacc5=(_0x25a0a9[0x0]['predictiveIntervalAnsweredCalls']+_0x25a0a9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x25a0a9[0x0][_0x4f15('0x53')])/_0x25a0a9[0x0][_0x4f15('0x58')];_0xc84660[_0x4f15('0x1bb')]=_0x5cacc5>0x0?_0x5cacc5:0x1;switch(_0xc84660[_0x4f15('0x1c2')]){case _0x4f15('0x1c3'):var _0x3090ba=_0xc84660[_0x4f15('0x1b7')]/0x64;return _0x519c66[_0x4f15('0x1d3')](_0x2d4be8,_0xb0d043,_0x1e13a3,_0x5cacc5,_0x3090ba)[_0x4f15('0xa1')](function(_0x216f1f){return _0x230cf9(_0x216f1f);});case'agentBusyFactor':var _0x5ee580=_0xc84660['dialPredictiveOptimizationPercentage']/0x64;return _0x519c66[_0x4f15('0x1d4')](_0x2d4be8,_0xb0d043,_0x1e13a3,_0x5cacc5,_0x5ee580)[_0x4f15('0xa1')](function(_0x1c28c7){return _0x230cf9(_0x1c28c7);});default:return _0x257fea(msgResponse(_0x4f15('0x1d5'),_0x4f15('0x96'),_0x4f15('0x1d6')));}}else{return _0x257fea(msgResponse(_0x4f15('0x1d5'),_0x4f15('0x96'),_0x4f15('0x1d7')));}});};};Dialer[_0x4f15('0x19')]['getDataPredictiveOld']=function(_0x1c171e){var _0x2eb696=this;return function(_0x349e23){return new Promise(function(_0x3dd2d3,_0x3b65fb){_[_0x4f15('0x1d2')](_0x1c171e,_0x349e23[0x0]);if(checkGetDataPredictive(_0x349e23[0x0])){loggerPredictive['info'](JSON[_0x4f15('0x7a')](_0x349e23[0x0]));if(_0x1c171e['dialPredictiveOptimization']===_0x4f15('0x1c3')){return _0x2eb696[_0x4f15('0x14e')](_0x1c171e['id'])[_0x4f15('0xa1')](function(_0x18da86){var _0x3d6342=_0x1c171e[_0x4f15('0x1d8')]-_0x18da86[0x0][_0x4f15('0x1d9')];var _0xad693e=_0x1c171e[_0x4f15('0x1ca')]*0x3c;var _0x214b72=_0x349e23[0x0][_0x4f15('0x56')]+_0x349e23[0x0][_0x4f15('0x5a')];var _0x3b9cc1=(_0x349e23[0x0][_0x4f15('0x1da')]+_0x349e23[0x0][_0x4f15('0x51')]+_0x349e23[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x349e23[0x0][_0x4f15('0x58')];var _0x5f2fd8=_0x1c171e[_0x4f15('0x1b7')]/0x64;_0x1c171e['predictiveIntervalPauses']=_0x18da86[0x0][_0x4f15('0x1d9')]||0x0;_0x1c171e['predictiveIntervalHitRate']=_0x3b9cc1>0x0?_0x3b9cc1:0x1;return _0x2eb696[_0x4f15('0x1d3')](_0x3d6342,_0xad693e,_0x214b72,_0x3b9cc1,_0x5f2fd8);})[_0x4f15('0xa1')](function(_0x4ab9c9){return _0x3dd2d3(_0x4ab9c9);})[_0x4f15('0xa5')](function(_0x51bc7d){return _0x3b65fb(msgResponse('[CatchErlangB]',_0x4f15('0x96'),JSON[_0x4f15('0x7a')](_0x51bc7d)));});}if(_0x1c171e[_0x4f15('0x1c2')]==='agentBusyFactor'){return _0x2eb696[_0x4f15('0x14e')](_0x1c171e['id'])[_0x4f15('0xa1')](function(_0x378aa9){var _0x533f54=_0x1c171e[_0x4f15('0x1d8')]-_0x378aa9[0x0][_0x4f15('0x1d9')];var _0x463296=_0x1c171e[_0x4f15('0x1ca')]*0x3c;var _0x1fdf94=_0x349e23[0x0]['predictiveIntervalAvgTalktime']+_0x349e23[0x0]['predictiveIntervalAvgHoldtime'];var _0x4f0747=(_0x349e23[0x0][_0x4f15('0x1da')]+_0x349e23[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x349e23[0x0][_0x4f15('0x53')])/_0x349e23[0x0][_0x4f15('0x58')];var _0x1b179f=_0x1c171e[_0x4f15('0x1b7')]/0x64;_0x1c171e[_0x4f15('0x1db')]=_0x378aa9[0x0][_0x4f15('0x1d9')]||0x0;_0x1c171e[_0x4f15('0x1bb')]=_0x4f0747>0x0?_0x4f0747:0x1;return _0x2eb696['busyFactor'](_0x533f54,_0x463296,_0x1fdf94,_0x4f0747,_0x1b179f);})[_0x4f15('0xa1')](function(_0x5d4312){return _0x3dd2d3(_0x5d4312);})[_0x4f15('0xa5')](function(_0x5916d2){return _0x3b65fb(msgResponse(_0x4f15('0x1dc'),_0x4f15('0x96'),JSON[_0x4f15('0x7a')](_0x5916d2)));});}}else{return _0x3b65fb(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x28a36e){var _0x5e09ac=this;return function(){var _0x22c342=0x0;var _0x27df39=Math['floor'](_0x28a36e[_0x4f15('0x1dd')]*0x3e8);if(_0x27df39>0x0){_0x27df39=_0x27df39<0x64?0x64:_0x27df39;loggerPredictive[_0x4f15('0x4c')](_0x28a36e['name'],_0x4f15('0x1de'),_0x27df39,_0x4f15('0x1df'));_0x28a36e[_0x4f15('0x6a')]=setInterval(function(){_0x5e09ac['handlePredictive'](_0x28a36e);loggerPredictiveCalls['info'](_0x4f15('0x1e0'),_0x22c342+=0x1);},_0x27df39);}else{loggerPredictive[_0x4f15('0x4c')](_0x28a36e[_0x4f15('0x67')],_0x4f15('0x1e1'));}};};Dialer['prototype'][_0x4f15('0x1e2')]=function(_0x35890c,_0x32f8af){var _0x4e13ff=this;return function(_0x26f324){if(_[_0x4f15('0x4b')](_0x26f324)){if(_[_0x4f15('0xfa')](_0x32f8af[_0x4f15('0x154')])||!_0x32f8af['recallme']){if(_0x35890c[_0x4f15('0x1e3')]===_0x4f15('0xa')){_0x35890c[_0x4f15('0x77')]=_[_0x4f15('0x42')](_0x35890c[_0x4f15('0x77')])?!![]:_0x35890c[_0x4f15('0x77')];var _0xb73cec=uuid['v4']();_0x4e13ff['actions'][_0xb73cec]=new Action(_0x35890c,_0x32f8af,_0xb73cec);loggerBooked[_0x4f15('0x4c')](_0x4f15('0x1e4'),_0xb73cec,'queueStatusComplete:\x20',JSON['stringify'](_0x35890c[_0x4f15('0x77')]),_0x4f15('0x1e5'),_0x35890c[_0x4f15('0x67')]);if(_0x35890c[_0x4f15('0x77')]){_0x35890c[_0x4f15('0x77')]=![];_0x4e13ff[_0x4f15('0x2a')][_0x4e13ff[_0x4f15('0xf0')][_0xb73cec][_0x4f15('0xc3')]]=[];ami[_0x4f15('0x9e')]({'actionid':_0xb73cec,'action':_0x4f15('0x1e6'),'queue':_0x35890c[_0x4f15('0x67')]})[_0x4f15('0xa5')](function(){_0x4e13ff[_0x4f15('0xc6')](_0x35890c);hopperUtils[_0x4f15('0xdb')]({'active':![],'ContactId':_0x4e13ff[_0x4f15('0xf0')][_0xb73cec]['ContactId'],'ListId':_0x4e13ff[_0x4f15('0xf0')][_0xb73cec]['ListId'],'VoiceQueueId':_0x4e13ff[_0x4f15('0xf0')][_0xb73cec][_0x4f15('0xec')]||undefined,'CampaignId':_0x4e13ff['actions'][_0xb73cec][_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x1e7')));delete _0x4e13ff['actions'][_0xb73cec];});}else{loggerBooked[_0x4f15('0x4c')]('[booked][checkContactBlack][else]',JSON[_0x4f15('0x7a')](_0x35890c[_0x4f15('0x77')]),_0x4f15('0x1e5'),_0x35890c[_0x4f15('0x67')]);_0x4e13ff[_0x4f15('0xc6')](_0x35890c);hopperUtils[_0x4f15('0xdb')]({'active':![],'ContactId':_0x4e13ff['actions'][_0xb73cec][_0x4f15('0xdd')],'ListId':_0x4e13ff['actions'][_0xb73cec][_0x4f15('0xde')],'VoiceQueueId':_0x4e13ff[_0x4f15('0xf0')][_0xb73cec]['VoiceQueueId']||undefined,'CampaignId':_0x4e13ff[_0x4f15('0xf0')][_0xb73cec][_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x1e7')));delete _0x4e13ff[_0x4f15('0xf0')][_0xb73cec];}}else{return _0x4e13ff[_0x4f15('0x159')](_0x35890c,_0x32f8af);}}else{if(utils[_0x4f15('0x66')](undefined,_0x32f8af[_0x4f15('0x1e8')])<_0x35890c['dialRecallMeTimeout']*0x3c){if(_0x32f8af['Agent']&&!_0x32f8af[_0x4f15('0x157')][_0x4f15('0x1e9')]){_0x4e13ff[_0x4f15('0x1e')][_0x4f15('0xfd')](_0x32f8af['id'])[_0x4f15('0x1c')](function(){_0x4e13ff[_0x4f15('0xc6')](_0x35890c);});}else{hopperUtils[_0x4f15('0x1ea')]({'active':![]},_0x32f8af['id'],0x1)[_0x4f15('0x1c')](function(){_0x4e13ff[_0x4f15('0xc6')](_0x35890c);});}}else{_0x35890c[_0x4f15('0x1eb')]+=0x1;_0x4e13ff[_0x4f15('0xc6')](_0x35890c);if(_0x35890c[_0x4f15('0x1ec')]){hopperUtils[_0x4f15('0xdb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x32f8af['ContactId'],'ListId':_0x32f8af[_0x4f15('0xde')],'VoiceQueueId':_0x32f8af[_0x4f15('0xec')]||undefined,'CampaignId':_0x32f8af[_0x4f15('0xdf')]||undefined})[_0x4f15('0xa5')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils['createHistory'](createObjHistory(_0x35890c,_0x32f8af,utils['CAMPAIGN_STATUS'][_0x4f15('0x1ed')],0x17,_0x4f15('0x1ee')))[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x1ef')));}else{_0x4e13ff[_0x4f15('0x119')](createObjHistory(_0x35890c,_0x32f8af,utils[_0x4f15('0x70')][_0x4f15('0x1f0')],0x16,'RecallFailedTimeout'),_0x4f15('0x1f1'),'[Originate][HistoryRecallClose]');}}}}else{_0x35890c['outboundBlacklistCallsDay']+=0x1;_0x4e13ff[_0x4f15('0x119')](createObjHistory(_0x35890c,_0x32f8af,utils[_0x4f15('0x70')][_0x4f15('0x1f2')],0xd,_0x4f15('0x1f3')),'[Originate][historyBlacklist]',_0x4f15('0x1f4'));throw _0x4f15('0x1f5');}};};Dialer['prototype'][_0x4f15('0x158')]=function(_0xeb279b){var _0x17c8ec=this;var _0x4ffec2=_0xeb279b[_0x4f15('0x1f6')]-_0xeb279b[_0x4f15('0x86')]-_0xeb279b[_0x4f15('0x1f7')];emitCampaignSummary(_0xeb279b);if(_0x4ffec2>0x0){if(_0x4ffec2>this[_0x4f15('0x22')]){_0x4ffec2=this[_0x4f15('0x22')];}_0xeb279b['temp']+=_0x4ffec2;hopperUtils['getContactDialerIvr'](_0xeb279b['id'],_0x4ffec2,_0xeb279b['dialOrderByScheduledAt'],_0xeb279b)[_0x4f15('0xa1')](function(_0x5b7fc2){_0xeb279b['temp']-=_0x4ffec2;_0xeb279b[_0x4f15('0x1f7')]=_0xeb279b[_0x4f15('0x1f7')]>0x0?_0xeb279b[_0x4f15('0x1f7')]:0x0;if(!utils['checkContactEmpty'](_0x5b7fc2)){_0xeb279b[_0x4f15('0x6f')]=utils[_0x4f15('0x70')]['NO_AVAILABLE_CONTACTS'];logger[_0x4f15('0x4c')](_0x4f15('0x1f8')+_0xeb279b['name']);}else{_0xeb279b[_0x4f15('0x86')]+=_0x5b7fc2[_0x4f15('0xff')];_0xeb279b['message']=utils['CAMPAIGN_STATUS'][_0x4f15('0x1f9')];for(var _0x4ee326=0x0;_0x4ee326<_0x5b7fc2[_0x4f15('0xff')];_0x4ee326+=0x1){_0xeb279b[_0x4f15('0x1fa')]+=0x1;if(_[_0x4f15('0xfa')](_0x5b7fc2[_0x4ee326])||_[_0x4f15('0xfa')](_0x5b7fc2[_0x4ee326][_0x4f15('0x172')])||_[_0x4f15('0xfa')](_0x5b7fc2[_0x4ee326][_0x4f15('0x15b')])){_0x17c8ec[_0x4f15('0x1fb')](_0x4f15('0x1fc'),_0xeb279b,_0x5b7fc2[_0x4ee326]);}else{hopperUtils[_0x4f15('0x1fd')](_[_0x4f15('0x7b')](_0x5b7fc2[_0x4ee326],[_0x4f15('0xdf'),_0x4f15('0x15b')]))['then'](_0x17c8ec[_0x4f15('0x1e2')](_0xeb279b,_0x5b7fc2[_0x4ee326]))[_0x4f15('0xa5')](_0x17c8ec[_0x4f15('0x152')](_0x4f15('0x1fe'),_0xeb279b));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0xeb279b,_0x4ffec2));}};Dialer[_0x4f15('0x19')][_0x4f15('0xba')]=function(_0x3ba8c6,_0x2ba537){var _0x55a8be=this;var _0x41560e=[];if(_0x2ba537<0x1||_0x3ba8c6[_0x4f15('0x1e3')]==='booked'){_0x2ba537=0x1;}var _0x2ac90a=Math[_0x4f15('0x1ff')](_0x3ba8c6['available']*_0x2ba537)-_0x3ba8c6[_0x4f15('0x86')]-_0x3ba8c6['temp'];if(_0x3ba8c6[_0x4f15('0x200')]>0x0){var _0x5eaa01=_0x3ba8c6[_0x4f15('0x200')]-_0x3ba8c6[_0x4f15('0x86')]-_0x3ba8c6[_0x4f15('0x139')]-_0x3ba8c6['temp']-_0x3ba8c6['pTalking'];if(_0x2ac90a>_0x5eaa01){_0x2ac90a=_0x5eaa01;}}if(_0x2ac90a>0x0){if(_0x3ba8c6[_0x4f15('0x1e3')]==='booked'){_0x2ac90a=0x1;}if(_0x2ac90a>this[_0x4f15('0x22')]){_0x2ac90a=this[_0x4f15('0x22')];}_0x3ba8c6[_0x4f15('0x1f7')]+=_0x2ac90a;for(var _0x5ef45e in this[_0x4f15('0xf8')]){if(typeof this[_0x4f15('0xf8')][_0x5ef45e]!==_0x4f15('0xb1')){if(this[_0x4f15('0xf8')][_0x5ef45e][_0x4f15('0x74')]===_0x4f15('0x201')&&this[_0x4f15('0xf8')][_0x5ef45e][_0x4f15('0x8d')]==='reachable'){_0x41560e[_0x4f15('0x9d')](this[_0x4f15('0xf8')][_0x5ef45e]['id']);}}}hopperUtils[_0x4f15('0x202')](_0x3ba8c6,_0x41560e,_0x2ac90a)[_0x4f15('0xa1')](function(_0xb822e6){_0x3ba8c6[_0x4f15('0x1f7')]-=_0x2ac90a;_0x3ba8c6[_0x4f15('0x1f7')]=_0x3ba8c6['temp']>0x0?_0x3ba8c6['temp']:0x0;if(!utils[_0x4f15('0x203')](_0xb822e6)){hopperUtils[_0x4f15('0x204')](_0x3ba8c6)[_0x4f15('0xa1')](sendMessageReschedule(_0x3ba8c6))[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x205')));}else{_0x3ba8c6[_0x4f15('0x86')]+=_0xb822e6['length'];_0x3ba8c6[_0x4f15('0x6f')]=_0x3ba8c6[_0x4f15('0x1e3')]==='booked'?utils[_0x4f15('0x70')][_0x4f15('0x13b')]:utils['CAMPAIGN_STATUS'][_0x4f15('0x1f9')];for(var _0x4f3443=0x0;_0x4f3443<_0xb822e6['length'];_0x4f3443+=0x1){if(_['isNil'](_0xb822e6[_0x4f3443])||_['isNil'](_0xb822e6[_0x4f3443]['Contact'])||_[_0x4f15('0xfa')](_0xb822e6[_0x4f3443][_0x4f15('0x15b')])){_0x55a8be[_0x4f15('0x1fb')](_0x4f15('0x1fc'),_0x3ba8c6,_0xb822e6[_0x4f3443]);}else{hopperUtils[_0x4f15('0x206')](_['pick'](_0xb822e6[_0x4f3443],['VoiceQueueId',_0x4f15('0x15b')]))['then'](_0x55a8be[_0x4f15('0x1e2')](_0x3ba8c6,_0xb822e6[_0x4f3443]))[_0x4f15('0xa5')](_0x55a8be[_0x4f15('0x152')]('[actionOriginate]\x20',_0x3ba8c6));}}}})[_0x4f15('0xa5')](loggerGetContactDialer(_0x4f15('0x207'),_0x3ba8c6,_0x2ac90a));}};Dialer[_0x4f15('0x19')][_0x4f15('0x6a')]=function(_0x3c5059){if(_0x3c5059[_0x4f15('0x200')]>0x0){var _0x3da5ca=_0x3c5059[_0x4f15('0x200')]-_0x3c5059[_0x4f15('0x86')]-_0x3c5059[_0x4f15('0x139')];if(_0x3da5ca>0x0){this['tryOriginatePredictive'](_0x3c5059);}else{loggerPredictiveCalls['info'](_0x4f15('0x208'));}}else{this['tryOriginatePredictive'](_0x3c5059);}};Dialer['prototype'][_0x4f15('0x209')]=function(_0x15924e){var _0x363824=this;var _0x45bbfc=[];_0x15924e[_0x4f15('0x86')]+=0x1;for(var _0x3f2017 in this[_0x4f15('0xf8')]){if(typeof this[_0x4f15('0xf8')][_0x3f2017]!==_0x4f15('0xb1')){if(this['agents'][_0x3f2017]['state']===_0x4f15('0x201')&&this['agents'][_0x3f2017][_0x4f15('0x8d')]===_0x4f15('0x144')){_0x45bbfc[_0x4f15('0x9d')](this[_0x4f15('0xf8')][_0x3f2017]['id']);}}}return this['getContactDialer'](_0x15924e['id'],_0x45bbfc,0x1,_0x15924e[_0x4f15('0x20a')],_0x15924e)[_0x4f15('0xa1')](function(_0x522f76){if(!utils[_0x4f15('0x203')](_0x522f76)){utils['checkContactLowerLimitOriginate'](_0x15924e,0x1,0x0);return hopperUtils['countReScheduled'](_0x15924e)[_0x4f15('0xa1')](sendMessageReschedule(_0x15924e))[_0x4f15('0xa5')](loggerCatch(_0x4f15('0x205')));}else{_0x15924e[_0x4f15('0x6f')]=utils[_0x4f15('0x70')][_0x4f15('0x1f9')];if(_[_0x4f15('0xfa')](_0x522f76[0x0])||_[_0x4f15('0xfa')](_0x522f76[0x0][_0x4f15('0x172')])||_[_0x4f15('0xfa')](_0x522f76[0x0][_0x4f15('0x15b')])){_0x363824[_0x4f15('0x1fb')](_0x4f15('0x1fc'),_0x15924e,_0x522f76[0x0]);}else{return hopperUtils[_0x4f15('0x206')](_[_0x4f15('0x7b')](_0x522f76[0x0],[_0x4f15('0xec'),_0x4f15('0x15b')]))[_0x4f15('0xa1')](_0x363824[_0x4f15('0x1e2')](_0x15924e,_0x522f76[0x0]))[_0x4f15('0xa5')](_0x363824[_0x4f15('0x152')](_0x4f15('0x20b'),_0x15924e));}}})[_0x4f15('0xa5')](loggerGetContactDialer(_0x4f15('0x20c'),_0x15924e,0x1));};Dialer[_0x4f15('0x19')][_0x4f15('0x1d3')]=function(_0x9fc316,_0xf01e05,_0xc02159,_0x326b66,_0x5e22f2,_0x49e5e8){loggerPredictive[_0x4f15('0x4c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x4f15('0x20d'),_0x9fc316);loggerPredictive[_0x4f15('0x4c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf01e05);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x20e'),_0xc02159);loggerPredictive['info'](_0x4f15('0x20f'),_0x326b66);loggerPredictive['info'](_0x4f15('0x210'),_0x5e22f2);loggerPredictive[_0x4f15('0x4c')]('---------------------------');return new Promise(function(_0x39e37a,_0x20818d){if(_0x9fc316<=0x0||isNaN(_0x9fc316)){return _0x20818d(msgResponse(_0x4f15('0x211'),'Error','m\x20=\x20'+_0x9fc316));}if(_0xc02159<=0x0||isNaN(_0xc02159)){return _0x20818d(msgResponse(_0x4f15('0x211'),_0x4f15('0x8a'),_0x4f15('0x212')+_0xc02159));}if(_0x326b66<=0x0||isNaN(_0x326b66)){return _0x20818d(msgResponse(_0x4f15('0x211'),'Error',_0x4f15('0x213')+_0x326b66));}if(_0xf01e05<=0x0||isNaN(_0xf01e05)){return _0x20818d(msgResponse('[abandonmentRate]',_0x4f15('0x8a'),_0x4f15('0x214')+_0xf01e05));}if(_0x5e22f2<=0x0||isNaN(_0x5e22f2)){return _0x20818d(msgResponse(_0x4f15('0x211'),_0x4f15('0x8a'),_0x4f15('0x215')+_0x5e22f2));}_0x49e5e8=_0x49e5e8||0x0;var _0x3a01cb=0x1/_0xc02159;var _0x15f4ba=0x0;var _0x2d8b49=0x0;var _0x64ad72=0x0;var _0x43676b=0x0;for(var _0x2af0c9=0x0;_0x64ad72<_0x5e22f2;_0x2af0c9+=0x1){_0x2d8b49=_0x2af0c9/_0xf01e05;_0x15f4ba=(_0x326b66*_0x2d8b49+_0x49e5e8)/_0x3a01cb;_0x64ad72=utils[_0x4f15('0x216')](_0x15f4ba,_0x9fc316);_0x43676b=_0x15f4ba/_0x9fc316*(0x1-utils[_0x4f15('0x216')](_0x15f4ba,_0x9fc316));}return _0x39e37a({'erlangCalls':_0x2af0c9,'erlangCallToSecond':_0xf01e05/_0x2af0c9,'erlangAbandonmentRate':_0x64ad72,'erlangBusyFactor':_0x43676b});});};Dialer[_0x4f15('0x19')]['busyFactor']=function(_0x2f6f2e,_0x3623ed,_0x1cd07d,_0x4a1830,_0x513f1a,_0x55a061){loggerPredictive[_0x4f15('0x4c')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x4f15('0x20d'),_0x2f6f2e);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x217'),_0x3623ed);loggerPredictive[_0x4f15('0x4c')]('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',_0x1cd07d);loggerPredictive[_0x4f15('0x4c')]('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',_0x4a1830);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x218'),_0x513f1a);loggerPredictive[_0x4f15('0x4c')](_0x4f15('0x57'));return new Promise(function(_0x1ead14,_0x2f91ab){if(_0x2f6f2e<=0x0||isNaN(_0x2f6f2e)){return _0x2f91ab(msgResponse(_0x4f15('0x219'),_0x4f15('0x8a'),_0x4f15('0x21a')+_0x2f6f2e));}if(_0x1cd07d<=0x0||isNaN(_0x1cd07d)){return _0x2f91ab(msgResponse(_0x4f15('0x219'),_0x4f15('0x8a'),'Ts\x20=\x20'+_0x1cd07d));}if(_0x4a1830<=0x0||isNaN(_0x4a1830)){return _0x2f91ab(msgResponse(_0x4f15('0x219'),_0x4f15('0x8a'),_0x4f15('0x213')+_0x4a1830));}if(_0x3623ed<=0x0||isNaN(_0x3623ed)){return _0x2f91ab(msgResponse(_0x4f15('0x219'),_0x4f15('0x8a'),_0x4f15('0x214')+_0x3623ed));}if(_0x513f1a<=0x0||isNaN(_0x513f1a)){return _0x2f91ab(msgResponse(_0x4f15('0x219'),_0x4f15('0x8a'),_0x4f15('0x21b')+_0x513f1a));}_0x55a061=_0x55a061||0x0;var _0x1f9214=0x1/_0x1cd07d;var _0x205d65=0x0;var _0x6f7b68=0x0;var _0x599b42=0x0;var _0x35ad8e=0x0;for(var _0x3b96ba=0x0;_0x35ad8e<_0x513f1a;_0x3b96ba+=0x1){_0x6f7b68=_0x3b96ba/_0x3623ed;_0x205d65=(_0x4a1830*_0x6f7b68+_0x55a061)/_0x1f9214;_0x599b42=utils[_0x4f15('0x216')](_0x205d65,_0x2f6f2e);_0x35ad8e=_0x205d65/_0x2f6f2e*(0x1-utils[_0x4f15('0x216')](_0x205d65,_0x2f6f2e));}return _0x1ead14({'erlangCalls':_0x3b96ba,'erlangCallToSecond':_0x3623ed/_0x3b96ba,'erlangAbandonmentRate':_0x599b42,'erlangBusyFactor':_0x35ad8e});});};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 efae7ed..42bc18a 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 _0x7d3e=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','phone','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','Contact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x1e3bb9,_0x2ee873){var _0x59e08d=function(_0x17cecd){while(--_0x17cecd){_0x1e3bb9['push'](_0x1e3bb9['shift']());}};_0x59e08d(++_0x2ee873);}(_0x7d3e,0x174));var _0xe7d3=function(_0x5b9512,_0x5bec1a){_0x5b9512=_0x5b9512-0x0;var _0x37802f=_0x7d3e[_0x5b9512];return _0x37802f;};'use strict';var util=require(_0xe7d3('0x0'));var _=require(_0xe7d3('0x1'));var moment=require('moment');function checkNameSurname(_0x22c1b8,_0x12adcb,_0x429bbe){var _0x3a65dc='';if(!_[_0xe7d3('0x2')](_0x12adcb)&&_0xe7d3('0x3')===typeof _0x12adcb){_0x3a65dc+=_0x12adcb;}if(!_['isNil'](_0x429bbe)&&_0xe7d3('0x3')===typeof _0x429bbe){_0x3a65dc+='\x20'+_0x429bbe;}if(_0x3a65dc!==''){return _0x3a65dc;}return _0x22c1b8;}function Action(_0x347d5c,_0x41487b,_0x19d0a9){this[_0xe7d3('0x4')]=_0x347d5c;this[_0xe7d3('0x5')]=_0x19d0a9||undefined;this[_0xe7d3('0x6')]=checkNameSurname(_0x41487b['Contact'][_0xe7d3('0x7')],_0x41487b['Contact'][_0xe7d3('0x8')],_0x41487b['Contact']['lastName']);this['number']=_0x41487b[_0xe7d3('0x7')];this[_0xe7d3('0x9')]=_0x347d5c[_0xe7d3('0x6')];this['active']=_0x41487b[_0xe7d3('0xa')]||![];this[_0xe7d3('0xb')]=_0x347d5c[_0xe7d3('0xb')];this[_0xe7d3('0xc')]=_0x347d5c[_0xe7d3('0xc')]||0x3;this[_0xe7d3('0xd')]=_0x41487b[_0xe7d3('0xd')];this[_0xe7d3('0xe')]=_0x41487b[_0xe7d3('0xe')];this[_0xe7d3('0xf')]=_0x41487b[_0xe7d3('0xf')];this['countnoanswerretry']=_0x41487b[_0xe7d3('0x10')];this[_0xe7d3('0x11')]=_0x41487b[_0xe7d3('0x11')];this['countdropretry']=_0x41487b[_0xe7d3('0x12')];this[_0xe7d3('0x13')]=_0x41487b['countabandonedretry'];this[_0xe7d3('0x14')]=_0x41487b[_0xe7d3('0x14')];this['countagentrejectretry']=_0x41487b[_0xe7d3('0x15')];this[_0xe7d3('0x16')]=_0x41487b['ContactId'];this[_0xe7d3('0x17')]=_0x41487b[_0xe7d3('0x17')];this[_0xe7d3('0x18')]=_0x41487b[_0xe7d3('0x18')];this[_0xe7d3('0x19')]=_0x41487b['VoiceQueueId'];this[_0xe7d3('0x1a')]=_0x41487b[_0xe7d3('0x1a')];this['idHopper']=_0x41487b['id'];this[_0xe7d3('0x1b')]=_0x41487b[_0xe7d3('0x1c')][_0xe7d3('0x8')]||'';this[_0xe7d3('0x1d')]=moment()[_0xe7d3('0x1e')](_0xe7d3('0x1f'));this[_0xe7d3('0x20')]=_0x41487b[_0xe7d3('0x20')];this[_0xe7d3('0x21')]=_0x41487b['callbackuniqueid'];this[_0xe7d3('0x22')]=_0x41487b[_0xe7d3('0x22')];this[_0xe7d3('0x23')]=_0x41487b['recallme'];this[_0xe7d3('0x24')]='';this[_0xe7d3('0x25')]='';}Action[_0xe7d3('0x26')][_0xe7d3('0x27')]=function(){return util[_0xe7d3('0x1e')](_0xe7d3('0x28'),this[_0xe7d3('0x6')],this['voiceQueue'][_0xe7d3('0x29')]>0x0?this['number'][_0xe7d3('0x2a')](this[_0xe7d3('0x4')][_0xe7d3('0x29')]):this['number']);};Action[_0xe7d3('0x26')][_0xe7d3('0x2b')]=function(){return this[_0xe7d3('0x9')];};module[_0xe7d3('0x2c')]=Action; \ No newline at end of file +var _0x086b=['originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','string','isNil','voiceQueue','uniqueid','name','phone','firstName','Contact','lastName','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x49bb5f,_0x12574a){var _0x1af88a=function(_0x43ec77){while(--_0x43ec77){_0x49bb5f['push'](_0x49bb5f['shift']());}};_0x1af88a(++_0x12574a);}(_0x086b,0xeb));var _0xb086=function(_0x206a01,_0x352cd9){_0x206a01=_0x206a01-0x0;var _0xacf93d=_0x086b[_0x206a01];return _0xacf93d;};'use strict';var util=require(_0xb086('0x0'));var _=require(_0xb086('0x1'));var moment=require(_0xb086('0x2'));function checkNameSurname(_0x4120a7,_0x3cbba1,_0x1008c8){var _0x29d775='';if(!_['isNil'](_0x3cbba1)&&_0xb086('0x3')===typeof _0x3cbba1){_0x29d775+=_0x3cbba1;}if(!_[_0xb086('0x4')](_0x1008c8)&&'string'===typeof _0x1008c8){_0x29d775+='\x20'+_0x1008c8;}if(_0x29d775!==''){return _0x29d775;}return _0x4120a7;}function Action(_0xf0353f,_0x1afdf2,_0x45998c){this[_0xb086('0x5')]=_0xf0353f;this[_0xb086('0x6')]=_0x45998c||undefined;this[_0xb086('0x7')]=checkNameSurname(_0x1afdf2['Contact'][_0xb086('0x8')],_0x1afdf2['Contact'][_0xb086('0x9')],_0x1afdf2[_0xb086('0xa')][_0xb086('0xb')]);this['number']=_0x1afdf2[_0xb086('0x8')];this['queue']=_0xf0353f['name'];this['active']=_0x1afdf2['active']||![];this['type']=_0xf0353f['type'];this[_0xb086('0xc')]=_0xf0353f[_0xb086('0xc')]||0x3;this[_0xb086('0xd')]=_0x1afdf2[_0xb086('0xd')];this['countbusyretry']=_0x1afdf2[_0xb086('0xe')];this[_0xb086('0xf')]=_0x1afdf2['countcongestionretry'];this[_0xb086('0x10')]=_0x1afdf2['countnoanswerretry'];this[_0xb086('0x11')]=_0x1afdf2['countnosuchnumberretry'];this[_0xb086('0x12')]=_0x1afdf2['countdropretry'];this[_0xb086('0x13')]=_0x1afdf2[_0xb086('0x13')];this[_0xb086('0x14')]=_0x1afdf2['countmachineretry'];this[_0xb086('0x15')]=_0x1afdf2[_0xb086('0x15')];this[_0xb086('0x16')]=_0x1afdf2[_0xb086('0x16')];this[_0xb086('0x17')]=_0x1afdf2[_0xb086('0x17')];this[_0xb086('0x18')]=_0x1afdf2[_0xb086('0x18')];this['VoiceQueueId']=_0x1afdf2[_0xb086('0x19')];this[_0xb086('0x1a')]=_0x1afdf2[_0xb086('0x1a')];this[_0xb086('0x1b')]=_0x1afdf2['id'];this['ContactFirstName']=_0x1afdf2[_0xb086('0xa')][_0xb086('0x9')]||'';this[_0xb086('0x1c')]=moment()[_0xb086('0x1d')](_0xb086('0x1e'));this[_0xb086('0x1f')]=_0x1afdf2[_0xb086('0x1f')];this[_0xb086('0x20')]=_0x1afdf2[_0xb086('0x20')];this[_0xb086('0x21')]=_0x1afdf2[_0xb086('0x21')];this[_0xb086('0x22')]=_0x1afdf2[_0xb086('0x22')];this[_0xb086('0x23')]='';this[_0xb086('0x24')]='';}Action[_0xb086('0x25')][_0xb086('0x26')]=function(){return util[_0xb086('0x1d')](_0xb086('0x27'),this[_0xb086('0x7')],this[_0xb086('0x5')][_0xb086('0x28')]>0x0?this[_0xb086('0x29')][_0xb086('0x2a')](this['voiceQueue'][_0xb086('0x28')]):this[_0xb086('0x29')]);};Action[_0xb086('0x25')][_0xb086('0x2b')]=function(){return this['queue'];};module[_0xb086('0x2c')]=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 95a7bf3..9fb6bb6 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 _0x264d=['agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','answertime','format','ringtime','holdtime','getSeconds','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x4c2f67,_0x4f700a){var _0x2e091e=function(_0x401414){while(--_0x401414){_0x4c2f67['push'](_0x4c2f67['shift']());}};_0x2e091e(++_0x4f700a);}(_0x264d,0x116));var _0xd264=function(_0xe2ae2b,_0x48d240){_0xe2ae2b=_0xe2ae2b-0x0;var _0xa5cac5=_0x264d[_0xe2ae2b];return _0xa5cac5;};'use strict';var moment=require(_0xd264('0x0'));var utils=require(_0xd264('0x1'));function AgentComplete(_0x3d0c48,_0x3af781){this[_0xd264('0x2')]=0x4;this[_0xd264('0x3')]=_0xd264('0x4');this['scheduledat']=_0x3d0c48[_0xd264('0x5')];this[_0xd264('0x6')]=_0x3d0c48[_0xd264('0x6')];this[_0xd264('0x7')]=_0x3d0c48[_0xd264('0x6')]===_0xd264('0x8')?_0xd264('0x9'):_0x3d0c48['type'];this['countbusyretry']=_0x3d0c48[_0xd264('0xa')];this[_0xd264('0xb')]=_0x3d0c48['countcongestionretry'];this['countnoanswerretry']=_0x3d0c48[_0xd264('0xc')];this[_0xd264('0xd')]=_0x3d0c48[_0xd264('0xa')]+_0x3d0c48[_0xd264('0xb')]+_0x3d0c48[_0xd264('0xc')]+_0x3d0c48[_0xd264('0xe')]+_0x3d0c48['countdropretry']+_0x3d0c48[_0xd264('0xf')]+_0x3d0c48['countmachineretry']+_0x3d0c48[_0xd264('0x10')];this[_0xd264('0xe')]=_0x3d0c48[_0xd264('0xe')];this[_0xd264('0x11')]=_0x3d0c48[_0xd264('0x11')];this['countabandonedretry']=_0x3d0c48[_0xd264('0xf')];this['countmachineretry']=_0x3d0c48[_0xd264('0x12')];this['countagentrejectretry']=_0x3d0c48[_0xd264('0x10')];this[_0xd264('0x13')]=_0x3af781[_0xd264('0x13')];this[_0xd264('0x14')]=_0x3d0c48[_0xd264('0x15')];this['calleridnum']=_0x3d0c48['number'];this[_0xd264('0x16')]=_0x3d0c48[_0xd264('0x16')];this[_0xd264('0x17')]=_0x3d0c48[_0xd264('0x17')];this[_0xd264('0x18')]=_0x3d0c48[_0xd264('0x18')];this['endtime']=moment()[_0xd264('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd264('0x1a')]=utils['getSeconds'](_0x3d0c48['responsetime'],_0x3d0c48[_0xd264('0x16')]);this[_0xd264('0x1b')]=utils[_0xd264('0x1c')](_0x3d0c48[_0xd264('0x18')],_0x3d0c48[_0xd264('0x17')]);this[_0xd264('0x1d')]=utils[_0xd264('0x1c')](this[_0xd264('0x1e')],_0x3d0c48['answertime']);this[_0xd264('0x9')]=_0x3af781[_0xd264('0x9')];this['membername']=_0x3af781[_0xd264('0x1f')];this[_0xd264('0x20')]=_0x3af781[_0xd264('0x20')];this[_0xd264('0x21')]=_0x3d0c48[_0xd264('0x21')];this[_0xd264('0x22')]=_0x3d0c48[_0xd264('0x22')];this[_0xd264('0x23')]=_0x3d0c48[_0xd264('0x23')];this['recallme']=_0x3d0c48[_0xd264('0x24')];this['ContactId']=_0x3d0c48[_0xd264('0x25')];this[_0xd264('0x26')]=_0x3d0c48[_0xd264('0x26')];this[_0xd264('0x27')]=_0x3d0c48[_0xd264('0x27')];this[_0xd264('0x28')]=_0x3d0c48[_0xd264('0x28')];this[_0xd264('0x29')]=_0x3d0c48['CampaignId'];this['originatecalleridnum']=_0x3d0c48[_0xd264('0x2a')]||'';this[_0xd264('0x2b')]=_0x3d0c48[_0xd264('0x2b')]||'';this[_0xd264('0x2c')]=_0x3d0c48['agiafterat'];}module[_0xd264('0x2d')]=AgentComplete; \ No newline at end of file +var _0x691b=['agiafterat','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x46974b,_0x1edcf5){var _0x4dc881=function(_0x51634f){while(--_0x51634f){_0x46974b['push'](_0x46974b['shift']());}};_0x4dc881(++_0x1edcf5);}(_0x691b,0x88));var _0xb691=function(_0x3ed29f,_0x1a2d3e){_0x3ed29f=_0x3ed29f-0x0;var _0x18e33d=_0x691b[_0x3ed29f];return _0x18e33d;};'use strict';var moment=require(_0xb691('0x0'));var utils=require(_0xb691('0x1'));function AgentComplete(_0x142104,_0x8b5aac){this[_0xb691('0x2')]=0x4;this[_0xb691('0x3')]=_0xb691('0x4');this[_0xb691('0x5')]=_0x142104[_0xb691('0x5')];this[_0xb691('0x6')]=_0x142104[_0xb691('0x6')];this[_0xb691('0x7')]=_0x142104[_0xb691('0x6')]===_0xb691('0x8')?_0xb691('0x9'):_0x142104[_0xb691('0x6')];this[_0xb691('0xa')]=_0x142104[_0xb691('0xa')];this[_0xb691('0xb')]=_0x142104[_0xb691('0xb')];this[_0xb691('0xc')]=_0x142104[_0xb691('0xc')];this[_0xb691('0xd')]=_0x142104[_0xb691('0xa')]+_0x142104[_0xb691('0xb')]+_0x142104[_0xb691('0xc')]+_0x142104[_0xb691('0xe')]+_0x142104[_0xb691('0xf')]+_0x142104['countabandonedretry']+_0x142104[_0xb691('0x10')]+_0x142104[_0xb691('0x11')];this[_0xb691('0xe')]=_0x142104['countnosuchnumberretry'];this[_0xb691('0xf')]=_0x142104[_0xb691('0xf')];this[_0xb691('0x12')]=_0x142104[_0xb691('0x12')];this[_0xb691('0x10')]=_0x142104['countmachineretry'];this['countagentrejectretry']=_0x142104[_0xb691('0x11')];this[_0xb691('0x13')]=_0x8b5aac[_0xb691('0x13')];this['calleridname']=_0x142104[_0xb691('0x14')];this[_0xb691('0x15')]=_0x142104[_0xb691('0x16')];this['starttime']=_0x142104[_0xb691('0x17')];this[_0xb691('0x18')]=_0x142104[_0xb691('0x18')];this['answertime']=_0x142104[_0xb691('0x19')];this[_0xb691('0x1a')]=moment()[_0xb691('0x1b')](_0xb691('0x1c'));this['ringtime']=utils[_0xb691('0x1d')](_0x142104[_0xb691('0x18')],_0x142104[_0xb691('0x17')]);this[_0xb691('0x1e')]=utils[_0xb691('0x1d')](_0x142104['answertime'],_0x142104[_0xb691('0x18')]);this[_0xb691('0x1f')]=utils['getSeconds'](this['endtime'],_0x142104[_0xb691('0x19')]);this[_0xb691('0x9')]=_0x8b5aac[_0xb691('0x9')];this[_0xb691('0x20')]=_0x8b5aac[_0xb691('0x20')];this['reason']=_0x8b5aac['reason'];this[_0xb691('0x21')]=_0x142104[_0xb691('0x21')];this[_0xb691('0x22')]=_0x142104[_0xb691('0x22')];this[_0xb691('0x23')]=_0x142104['callbackat'];this[_0xb691('0x24')]=_0x142104[_0xb691('0x24')];this[_0xb691('0x25')]=_0x142104['ContactId'];this[_0xb691('0x26')]=_0x142104[_0xb691('0x26')];this[_0xb691('0x27')]=_0x142104[_0xb691('0x27')];this[_0xb691('0x28')]=_0x142104['VoiceQueueId'];this[_0xb691('0x29')]=_0x142104['CampaignId'];this[_0xb691('0x2a')]=_0x142104[_0xb691('0x2a')]||'';this[_0xb691('0x2b')]=_0x142104['originatecalleridname']||'';this[_0xb691('0x2c')]=_0x142104[_0xb691('0x2c')];}module['exports']=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 d164294..cd5a361 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 _0x875d=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId'];(function(_0x1f7110,_0x3faac0){var _0x1343d1=function(_0x118bc2){while(--_0x118bc2){_0x1f7110['push'](_0x1f7110['shift']());}};_0x1343d1(++_0x3faac0);}(_0x875d,0xbc));var _0xd875=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x875d[_0x543084];return _0x306a57;};'use strict';function Final(_0x46a12d){this[_0xd875('0x0')]=_0x46a12d[_0xd875('0x0')];this['scheduledat']=_0x46a12d[_0xd875('0x1')];this[_0xd875('0x2')]=_0x46a12d[_0xd875('0x2')];this[_0xd875('0x3')]=_0x46a12d[_0xd875('0x2')]===_0xd875('0x4')?'queue':_0x46a12d[_0xd875('0x2')];this[_0xd875('0x5')]=_0x46a12d['countbusyretry'];this[_0xd875('0x6')]=_0x46a12d[_0xd875('0x6')];this[_0xd875('0x7')]=_0x46a12d[_0xd875('0x7')];this[_0xd875('0x8')]=_0x46a12d[_0xd875('0x5')]+_0x46a12d['countcongestionretry']+_0x46a12d[_0xd875('0x7')]+_0x46a12d[_0xd875('0x9')]+_0x46a12d['countdropretry']+_0x46a12d[_0xd875('0xa')]+_0x46a12d[_0xd875('0xb')]+_0x46a12d[_0xd875('0xc')];this[_0xd875('0x9')]=_0x46a12d['countnosuchnumberretry'];this[_0xd875('0xd')]=_0x46a12d[_0xd875('0xd')];this['countabandonedretry']=_0x46a12d[_0xd875('0xa')];this[_0xd875('0xb')]=_0x46a12d[_0xd875('0xb')];this[_0xd875('0xc')]=_0x46a12d[_0xd875('0xc')];this[_0xd875('0xe')]=_0x46a12d['queue'];this[_0xd875('0xf')]=_0x46a12d['calleridname'];this[_0xd875('0x10')]=_0x46a12d[_0xd875('0x10')];this[_0xd875('0x11')]=_0x46a12d[_0xd875('0x11')];this[_0xd875('0x12')]=_0x46a12d[_0xd875('0x12')];this[_0xd875('0x13')]=_0x46a12d[_0xd875('0x12')];this['ringtime']=_0x46a12d[_0xd875('0x14')]||0x0;this[_0xd875('0x15')]=_0x46a12d[_0xd875('0x15')]||0x0;this[_0xd875('0x16')]=_0x46a12d['talktime']||0x0;this[_0xd875('0x17')]=_0x46a12d[_0xd875('0x17')];this['callbackuniqueid']=_0x46a12d[_0xd875('0x18')];this['callbackat']=_0x46a12d['callbackat'];this['recallme']=_0x46a12d[_0xd875('0x19')];this[_0xd875('0x1a')]=_0x46a12d[_0xd875('0x1a')];this[_0xd875('0x1b')]=_0x46a12d[_0xd875('0x1b')];this[_0xd875('0x1c')]=_0x46a12d[_0xd875('0x1c')];this['VoiceQueueId']=_0x46a12d[_0xd875('0x1d')];this[_0xd875('0x1e')]=_0x46a12d['CampaignId'];this[_0xd875('0x1f')]=_0x46a12d[_0xd875('0x1f')]||'';this['originatecalleridname']=_0x46a12d[_0xd875('0x20')]||'';this[_0xd875('0x21')]=_0x46a12d['state'];this[_0xd875('0x22')]=_0x46a12d[_0xd875('0x22')];}module[_0xd875('0x23')]=Final; \ No newline at end of file +var _0x872a=['statedesc','exports','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state'];(function(_0x25e4ad,_0x5559f2){var _0x37f874=function(_0x206bc4){while(--_0x206bc4){_0x25e4ad['push'](_0x25e4ad['shift']());}};_0x37f874(++_0x5559f2);}(_0x872a,0x8a));var _0xa872=function(_0x250193,_0x596adb){_0x250193=_0x250193-0x0;var _0x5c2f3f=_0x872a[_0x250193];return _0x5c2f3f;};'use strict';function Final(_0x1045e3){this[_0xa872('0x0')]=_0x1045e3[_0xa872('0x0')];this[_0xa872('0x1')]=_0x1045e3[_0xa872('0x1')];this[_0xa872('0x2')]=_0x1045e3[_0xa872('0x2')];this['campaigntype']=_0x1045e3[_0xa872('0x2')]==='outbound'?_0xa872('0x3'):_0x1045e3[_0xa872('0x2')];this[_0xa872('0x4')]=_0x1045e3[_0xa872('0x4')];this['countcongestionretry']=_0x1045e3[_0xa872('0x5')];this[_0xa872('0x6')]=_0x1045e3[_0xa872('0x6')];this['countglobal']=_0x1045e3[_0xa872('0x4')]+_0x1045e3[_0xa872('0x5')]+_0x1045e3['countnoanswerretry']+_0x1045e3[_0xa872('0x7')]+_0x1045e3[_0xa872('0x8')]+_0x1045e3[_0xa872('0x9')]+_0x1045e3['countmachineretry']+_0x1045e3[_0xa872('0xa')];this[_0xa872('0x7')]=_0x1045e3['countnosuchnumberretry'];this['countdropretry']=_0x1045e3[_0xa872('0x8')];this[_0xa872('0x9')]=_0x1045e3[_0xa872('0x9')];this['countmachineretry']=_0x1045e3[_0xa872('0xb')];this[_0xa872('0xa')]=_0x1045e3[_0xa872('0xa')];this[_0xa872('0x3')]=_0x1045e3[_0xa872('0x3')];this[_0xa872('0xc')]=_0x1045e3['calleridname'];this[_0xa872('0xd')]=_0x1045e3[_0xa872('0xd')];this[_0xa872('0xe')]=_0x1045e3[_0xa872('0xe')];this[_0xa872('0xf')]=_0x1045e3[_0xa872('0xf')];this[_0xa872('0x10')]=_0x1045e3[_0xa872('0xf')];this[_0xa872('0x11')]=_0x1045e3[_0xa872('0x11')]||0x0;this[_0xa872('0x12')]=_0x1045e3[_0xa872('0x12')]||0x0;this['talktime']=_0x1045e3[_0xa872('0x13')]||0x0;this[_0xa872('0x14')]=_0x1045e3[_0xa872('0x14')];this['callbackuniqueid']=_0x1045e3[_0xa872('0x15')];this[_0xa872('0x16')]=_0x1045e3[_0xa872('0x16')];this['recallme']=_0x1045e3[_0xa872('0x17')];this['ContactId']=_0x1045e3[_0xa872('0x18')];this['ListId']=_0x1045e3[_0xa872('0x19')];this[_0xa872('0x1a')]=_0x1045e3['UserId'];this['VoiceQueueId']=_0x1045e3[_0xa872('0x1b')];this['CampaignId']=_0x1045e3[_0xa872('0x1c')];this[_0xa872('0x1d')]=_0x1045e3['originatecalleridnum']||'';this['originatecalleridname']=_0x1045e3[_0xa872('0x1e')]||'';this[_0xa872('0x1f')]=_0x1045e3[_0xa872('0x1f')];this[_0xa872('0x20')]=_0x1045e3[_0xa872('0x20')];}module[_0xa872('0x21')]=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 69ccf51..865257b 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 _0xaf8a=['VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x56410f,_0x68b85c){var _0x3dc3af=function(_0x209769){while(--_0x209769){_0x56410f['push'](_0x56410f['shift']());}};_0x3dc3af(++_0x68b85c);}(_0xaf8a,0xcf));var _0xaaf8=function(_0x2a8e4f,_0x28ca0c){_0x2a8e4f=_0x2a8e4f-0x0;var _0x2950c5=_0xaf8a[_0x2a8e4f];return _0x2950c5;};'use strict';var moment=require(_0xaaf8('0x0'));var utils=require(_0xaaf8('0x1'));function Hangup(_0x1348c1,_0x35e570){this[_0xaaf8('0x2')]=0x4;this[_0xaaf8('0x3')]=_0xaaf8('0x4');this[_0xaaf8('0x5')]=_0x1348c1[_0xaaf8('0x5')];this[_0xaaf8('0x6')]=_0x1348c1['type'];this['campaigntype']=_0x1348c1[_0xaaf8('0x6')]===_0xaaf8('0x7')?_0xaaf8('0x8'):_0x1348c1[_0xaaf8('0x6')];this[_0xaaf8('0x9')]=_0x1348c1[_0xaaf8('0x9')]||![];this[_0xaaf8('0xa')]=_0x1348c1[_0xaaf8('0xa')];this['countcongestionretry']=_0x1348c1[_0xaaf8('0xb')];this[_0xaaf8('0xc')]=_0x1348c1[_0xaaf8('0xc')];this[_0xaaf8('0xd')]=_0x1348c1[_0xaaf8('0xa')]+_0x1348c1[_0xaaf8('0xb')]+_0x1348c1['countnoanswerretry']+_0x1348c1[_0xaaf8('0xe')]+_0x1348c1[_0xaaf8('0xf')]+_0x1348c1[_0xaaf8('0x10')]+_0x1348c1['countmachineretry']+_0x1348c1[_0xaaf8('0x11')];this['countnosuchnumberretry']=_0x1348c1[_0xaaf8('0xe')];this['countdropretry']=_0x1348c1[_0xaaf8('0xf')];this[_0xaaf8('0x10')]=_0x1348c1[_0xaaf8('0x10')];this['countmachineretry']=_0x1348c1[_0xaaf8('0x12')];this[_0xaaf8('0x11')]=_0x1348c1[_0xaaf8('0x11')];this['uniqueid']=_0x35e570['uniqueid'];this['calleridname']=_0x1348c1[_0xaaf8('0x13')];this[_0xaaf8('0x14')]=_0x1348c1[_0xaaf8('0x15')];this[_0xaaf8('0x16')]=_0x1348c1[_0xaaf8('0x16')];this[_0xaaf8('0x17')]=_0x1348c1[_0xaaf8('0x17')];this[_0xaaf8('0x18')]=moment()[_0xaaf8('0x19')](_0xaaf8('0x1a'));this[_0xaaf8('0x1b')]=utils[_0xaaf8('0x1c')](_0x1348c1[_0xaaf8('0x17')],_0x1348c1[_0xaaf8('0x16')]);this[_0xaaf8('0x1d')]=0x0;this[_0xaaf8('0x1e')]=utils['getSeconds'](this[_0xaaf8('0x18')],_0x1348c1[_0xaaf8('0x17')]);this['queue']=_0x1348c1['queue'];this['membername']=_0xaaf8('0x1f');this['reason']=_0x35e570[_0xaaf8('0x20')];this[_0xaaf8('0x21')]=_0x1348c1[_0xaaf8('0x21')];this['callbackuniqueid']=_0x1348c1[_0xaaf8('0x22')];this['callbackat']=_0x1348c1[_0xaaf8('0x23')];this[_0xaaf8('0x24')]=_0x1348c1[_0xaaf8('0x24')];this[_0xaaf8('0x25')]=_0x1348c1[_0xaaf8('0x25')];this['ListId']=_0x1348c1[_0xaaf8('0x26')];this['UserId']=_0x1348c1['UserId'];this[_0xaaf8('0x27')]=_0x1348c1[_0xaaf8('0x27')];this[_0xaaf8('0x28')]=_0x1348c1['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0xfc75=['campaigntype','outbound','queue','amd','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','scheduledat','type'];(function(_0x59778f,_0xc4c8c7){var _0x4896d1=function(_0x4dde86){while(--_0x4dde86){_0x59778f['push'](_0x59778f['shift']());}};_0x4896d1(++_0xc4c8c7);}(_0xfc75,0x8b));var _0x5fc7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfc75[_0x17d9e3];return _0x14192d;};'use strict';var moment=require(_0x5fc7('0x0'));var utils=require(_0x5fc7('0x1'));function Hangup(_0x54903e,_0x2a0dda){this['state']=0x4;this[_0x5fc7('0x2')]='Answer';this['scheduledat']=_0x54903e[_0x5fc7('0x3')];this['type']=_0x54903e[_0x5fc7('0x4')];this[_0x5fc7('0x5')]=_0x54903e['type']===_0x5fc7('0x6')?_0x5fc7('0x7'):_0x54903e[_0x5fc7('0x4')];this['amd']=_0x54903e[_0x5fc7('0x8')]||![];this['countbusyretry']=_0x54903e['countbusyretry'];this['countcongestionretry']=_0x54903e[_0x5fc7('0x9')];this[_0x5fc7('0xa')]=_0x54903e[_0x5fc7('0xa')];this['countglobal']=_0x54903e[_0x5fc7('0xb')]+_0x54903e[_0x5fc7('0x9')]+_0x54903e['countnoanswerretry']+_0x54903e['countnosuchnumberretry']+_0x54903e[_0x5fc7('0xc')]+_0x54903e[_0x5fc7('0xd')]+_0x54903e[_0x5fc7('0xe')]+_0x54903e['countagentrejectretry'];this[_0x5fc7('0xf')]=_0x54903e[_0x5fc7('0xf')];this[_0x5fc7('0xc')]=_0x54903e['countdropretry'];this[_0x5fc7('0xd')]=_0x54903e[_0x5fc7('0xd')];this[_0x5fc7('0xe')]=_0x54903e[_0x5fc7('0xe')];this['countagentrejectretry']=_0x54903e[_0x5fc7('0x10')];this[_0x5fc7('0x11')]=_0x2a0dda[_0x5fc7('0x11')];this['calleridname']=_0x54903e[_0x5fc7('0x12')];this['calleridnum']=_0x54903e['number'];this[_0x5fc7('0x13')]=_0x54903e[_0x5fc7('0x13')];this[_0x5fc7('0x14')]=_0x54903e['responsetime'];this[_0x5fc7('0x15')]=moment()[_0x5fc7('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5fc7('0x17')]=utils[_0x5fc7('0x18')](_0x54903e['responsetime'],_0x54903e[_0x5fc7('0x13')]);this[_0x5fc7('0x19')]=0x0;this['talktime']=utils[_0x5fc7('0x18')](this['endtime'],_0x54903e[_0x5fc7('0x14')]);this[_0x5fc7('0x7')]=_0x54903e[_0x5fc7('0x7')];this['membername']='IVR';this['reason']=_0x2a0dda[_0x5fc7('0x1a')];this['callback']=_0x54903e[_0x5fc7('0x1b')];this['callbackuniqueid']=_0x54903e[_0x5fc7('0x1c')];this[_0x5fc7('0x1d')]=_0x54903e[_0x5fc7('0x1d')];this[_0x5fc7('0x1e')]=_0x54903e[_0x5fc7('0x1e')];this[_0x5fc7('0x1f')]=_0x54903e['ContactId'];this['ListId']=_0x54903e[_0x5fc7('0x20')];this['UserId']=_0x54903e['UserId'];this[_0x5fc7('0x21')]=_0x54903e[_0x5fc7('0x21')];this[_0x5fc7('0x22')]=_0x54903e[_0x5fc7('0x22')];}module[_0x5fc7('0x23')]=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 2eafbd0..6c07f2a 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 _0x3ca6=['scheduledat','type','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','../utils','uniqueid'];(function(_0x347d49,_0x518b3b){var _0x4d2df2=function(_0x213231){while(--_0x213231){_0x347d49['push'](_0x347d49['shift']());}};_0x4d2df2(++_0x518b3b);}(_0x3ca6,0x101));var _0x63ca=function(_0x918967,_0x1161f8){_0x918967=_0x918967-0x0;var _0x36d11a=_0x3ca6[_0x918967];return _0x36d11a;};'use strict';var utils=require(_0x63ca('0x0'));function History(_0x4f7036){this[_0x63ca('0x1')]=_0x4f7036[_0x63ca('0x1')];this[_0x63ca('0x2')]=_0x4f7036[_0x63ca('0x2')]||undefined;this[_0x63ca('0x3')]=_0x4f7036['type'];this['campaigntype']=_0x4f7036[_0x63ca('0x3')]===_0x63ca('0x4')?'queue':_0x4f7036[_0x63ca('0x3')];this[_0x63ca('0x5')]=_0x4f7036[_0x63ca('0x5')];this['countcongestionretry']=_0x4f7036[_0x63ca('0x6')];this['countnoanswerretry']=_0x4f7036['countnoanswerretry'];this[_0x63ca('0x7')]=_0x4f7036[_0x63ca('0x5')]+_0x4f7036['countcongestionretry']+_0x4f7036[_0x63ca('0x8')]+_0x4f7036[_0x63ca('0x9')]+_0x4f7036[_0x63ca('0xa')]+_0x4f7036[_0x63ca('0xb')]+_0x4f7036[_0x63ca('0xc')]+_0x4f7036[_0x63ca('0xd')];this[_0x63ca('0x9')]=_0x4f7036['countnosuchnumberretry'];this[_0x63ca('0xa')]=_0x4f7036[_0x63ca('0xa')];this[_0x63ca('0xb')]=_0x4f7036[_0x63ca('0xb')];this[_0x63ca('0xc')]=_0x4f7036[_0x63ca('0xc')];this[_0x63ca('0xd')]=_0x4f7036[_0x63ca('0xd')];this['queue']=_0x4f7036[_0x63ca('0xe')];this[_0x63ca('0xf')]=_0x4f7036[_0x63ca('0x10')];this[_0x63ca('0x11')]=_0x4f7036['number'];this[_0x63ca('0x12')]=_0x4f7036['starttime'];this[_0x63ca('0x13')]=_0x4f7036[_0x63ca('0x13')];this[_0x63ca('0x14')]=_0x4f7036[_0x63ca('0x13')];this[_0x63ca('0x15')]=utils[_0x63ca('0x16')](_0x4f7036[_0x63ca('0x13')],_0x4f7036[_0x63ca('0x12')]);this['holdtime']=0x0;this[_0x63ca('0x17')]=0x0;this[_0x63ca('0x18')]=_0x4f7036['callback'];this[_0x63ca('0x19')]=_0x4f7036[_0x63ca('0x19')];this[_0x63ca('0x1a')]=_0x4f7036[_0x63ca('0x1a')];this[_0x63ca('0x1b')]=_0x4f7036[_0x63ca('0x1b')];this[_0x63ca('0x1c')]=_0x4f7036[_0x63ca('0x1c')];this[_0x63ca('0x1d')]=_0x4f7036[_0x63ca('0x1d')];this[_0x63ca('0x1e')]=_0x4f7036['UserId'];this[_0x63ca('0x1f')]=_0x4f7036[_0x63ca('0x1f')];this[_0x63ca('0x20')]=_0x4f7036[_0x63ca('0x20')];this['originatecalleridnum']=_0x4f7036['originatecalleridnum']||'';this[_0x63ca('0x21')]=_0x4f7036['originatecalleridname']||'';this[_0x63ca('0x22')]=_0x4f7036[_0x63ca('0x22')];this['statedesc']=_0x4f7036[_0x63ca('0x23')];}module[_0x63ca('0x24')]=History; \ No newline at end of file +var _0xa662=['responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','exports','../utils','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','calleridname','name','calleridnum','number','starttime'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xa662,0x131));var _0x2a66=function(_0x42bb3a,_0xe72028){_0x42bb3a=_0x42bb3a-0x0;var _0x1993e9=_0xa662[_0x42bb3a];return _0x1993e9;};'use strict';var utils=require(_0x2a66('0x0'));function History(_0x3e3c46){this['uniqueid']=_0x3e3c46[_0x2a66('0x1')];this['scheduledat']=_0x3e3c46[_0x2a66('0x2')]||undefined;this[_0x2a66('0x3')]=_0x3e3c46[_0x2a66('0x3')];this[_0x2a66('0x4')]=_0x3e3c46[_0x2a66('0x3')]==='outbound'?'queue':_0x3e3c46[_0x2a66('0x3')];this[_0x2a66('0x5')]=_0x3e3c46['countbusyretry'];this[_0x2a66('0x6')]=_0x3e3c46[_0x2a66('0x6')];this[_0x2a66('0x7')]=_0x3e3c46[_0x2a66('0x7')];this['countglobal']=_0x3e3c46[_0x2a66('0x5')]+_0x3e3c46['countcongestionretry']+_0x3e3c46[_0x2a66('0x7')]+_0x3e3c46[_0x2a66('0x8')]+_0x3e3c46['countdropretry']+_0x3e3c46['countabandonedretry']+_0x3e3c46[_0x2a66('0x9')]+_0x3e3c46[_0x2a66('0xa')];this[_0x2a66('0x8')]=_0x3e3c46[_0x2a66('0x8')];this[_0x2a66('0xb')]=_0x3e3c46[_0x2a66('0xb')];this['countabandonedretry']=_0x3e3c46[_0x2a66('0xc')];this['countmachineretry']=_0x3e3c46[_0x2a66('0x9')];this[_0x2a66('0xa')]=_0x3e3c46[_0x2a66('0xa')];this[_0x2a66('0xd')]=_0x3e3c46[_0x2a66('0xd')];this[_0x2a66('0xe')]=_0x3e3c46[_0x2a66('0xf')];this[_0x2a66('0x10')]=_0x3e3c46[_0x2a66('0x11')];this['starttime']=_0x3e3c46[_0x2a66('0x12')];this[_0x2a66('0x13')]=_0x3e3c46[_0x2a66('0x13')];this[_0x2a66('0x14')]=_0x3e3c46[_0x2a66('0x13')];this[_0x2a66('0x15')]=utils[_0x2a66('0x16')](_0x3e3c46[_0x2a66('0x13')],_0x3e3c46[_0x2a66('0x12')]);this['holdtime']=0x0;this[_0x2a66('0x17')]=0x0;this[_0x2a66('0x18')]=_0x3e3c46[_0x2a66('0x18')];this[_0x2a66('0x19')]=_0x3e3c46['callbackuniqueid'];this[_0x2a66('0x1a')]=_0x3e3c46['callbackat'];this[_0x2a66('0x1b')]=_0x3e3c46[_0x2a66('0x1b')];this[_0x2a66('0x1c')]=_0x3e3c46[_0x2a66('0x1c')];this[_0x2a66('0x1d')]=_0x3e3c46['ListId'];this['UserId']=_0x3e3c46[_0x2a66('0x1e')];this[_0x2a66('0x1f')]=_0x3e3c46[_0x2a66('0x1f')];this[_0x2a66('0x20')]=_0x3e3c46[_0x2a66('0x20')];this[_0x2a66('0x21')]=_0x3e3c46[_0x2a66('0x21')]||'';this['originatecalleridname']=_0x3e3c46['originatecalleridname']||'';this[_0x2a66('0x22')]=_0x3e3c46[_0x2a66('0x22')];this['statedesc']=_0x3e3c46['statedesc'];}module[_0x2a66('0x23')]=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 c3f3a55..bef76f5 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 _0xedf1=['countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','responsetime','dropreason','endtime','droptime','getSeconds','starttime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x4f42c2,_0x50f054){var _0x2d978b=function(_0x357ea9){while(--_0x357ea9){_0x4f42c2['push'](_0x4f42c2['shift']());}};_0x2d978b(++_0x50f054);}(_0xedf1,0x1cf));var _0x1edf=function(_0x47247b,_0x155701){_0x47247b=_0x47247b-0x0;var _0x52c97e=_0xedf1[_0x47247b];return _0x52c97e;};'use strict';var utils=require(_0x1edf('0x0'));function QueueCallerAbandon(_0x510463,_0x50ceec){this[_0x1edf('0x1')]=_0x510463[_0x1edf('0x1')];this[_0x1edf('0x2')]=_0x510463[_0x1edf('0x2')];this[_0x1edf('0x3')]=_0x510463[_0x1edf('0x2')]===_0x1edf('0x4')?_0x1edf('0x5'):_0x510463[_0x1edf('0x2')];this[_0x1edf('0x6')]=_0x510463['countbusyretry'];this[_0x1edf('0x7')]=_0x510463[_0x1edf('0x7')];this[_0x1edf('0x8')]=_0x510463[_0x1edf('0x8')];this[_0x1edf('0x9')]=_0x510463['countbusyretry']+_0x510463[_0x1edf('0x7')]+_0x510463[_0x1edf('0x8')]+_0x510463[_0x1edf('0xa')]+_0x510463[_0x1edf('0xb')]+_0x510463['countabandonedretry']+_0x510463[_0x1edf('0xc')]+_0x510463[_0x1edf('0xd')];this[_0x1edf('0xa')]=_0x510463[_0x1edf('0xa')];this[_0x1edf('0xb')]=_0x510463[_0x1edf('0xb')];this[_0x1edf('0xe')]=_0x510463['countabandonedretry'];this[_0x1edf('0xc')]=_0x510463[_0x1edf('0xc')];this[_0x1edf('0xd')]=_0x510463[_0x1edf('0xd')];this[_0x1edf('0xf')]=_0x50ceec[_0x1edf('0xf')];this[_0x1edf('0x10')]=_0x510463['name'];this[_0x1edf('0x11')]=_0x510463[_0x1edf('0x12')];this['starttime']=_0x510463['starttime'];this['responsetime']=_0x510463[_0x1edf('0x13')];this['droptime']=_0x510463['droptime'];this['dropreason']=_0x510463[_0x1edf('0x14')];this[_0x1edf('0x15')]=this[_0x1edf('0x16')];this['ringtime']=utils[_0x1edf('0x17')](_0x510463['responsetime'],_0x510463[_0x1edf('0x18')]);this[_0x1edf('0x19')]=utils['getSeconds'](this['droptime'],_0x510463['responsetime']);this['talktime']=0x0;this['queue']=_0x50ceec[_0x1edf('0x5')];this[_0x1edf('0x1a')]=_0x50ceec[_0x1edf('0x1b')];this[_0x1edf('0x1c')]=_0x50ceec[_0x1edf('0x1c')];this[_0x1edf('0x1d')]=_0x510463[_0x1edf('0x1d')];this[_0x1edf('0x1e')]=_0x510463[_0x1edf('0x1e')];this[_0x1edf('0x1f')]=_0x510463['callbackat'];this[_0x1edf('0x20')]=_0x510463[_0x1edf('0x20')];this[_0x1edf('0x21')]=_0x510463[_0x1edf('0x21')];this[_0x1edf('0x22')]=_0x510463[_0x1edf('0x22')];this[_0x1edf('0x23')]=_0x510463['UserId'];this[_0x1edf('0x24')]=_0x510463[_0x1edf('0x24')];this[_0x1edf('0x25')]=_0x510463['CampaignId'];this['originatecalleridnum']=_0x510463[_0x1edf('0x26')]||'';this[_0x1edf('0x27')]=_0x510463[_0x1edf('0x27')]||'';this[_0x1edf('0x28')]=_0x510463[_0x1edf('0x28')];this['state']=_0x510463['state'];this['statedesc']=_0x510463[_0x1edf('0x29')];}module[_0x1edf('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xf6c3=['statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state'];(function(_0x1ed366,_0x4a1c6e){var _0x151b50=function(_0x3315d1){while(--_0x3315d1){_0x1ed366['push'](_0x1ed366['shift']());}};_0x151b50(++_0x4a1c6e);}(_0xf6c3,0x16a));var _0x3f6c=function(_0x3e065b,_0x42fe6a){_0x3e065b=_0x3e065b-0x0;var _0x2a6eb3=_0xf6c3[_0x3e065b];return _0x2a6eb3;};'use strict';var utils=require(_0x3f6c('0x0'));function QueueCallerAbandon(_0x30a0c6,_0x91d2a){this['scheduledat']=_0x30a0c6[_0x3f6c('0x1')];this[_0x3f6c('0x2')]=_0x30a0c6[_0x3f6c('0x2')];this[_0x3f6c('0x3')]=_0x30a0c6['type']===_0x3f6c('0x4')?'queue':_0x30a0c6[_0x3f6c('0x2')];this['countbusyretry']=_0x30a0c6[_0x3f6c('0x5')];this[_0x3f6c('0x6')]=_0x30a0c6[_0x3f6c('0x6')];this[_0x3f6c('0x7')]=_0x30a0c6[_0x3f6c('0x7')];this[_0x3f6c('0x8')]=_0x30a0c6[_0x3f6c('0x5')]+_0x30a0c6['countcongestionretry']+_0x30a0c6[_0x3f6c('0x7')]+_0x30a0c6[_0x3f6c('0x9')]+_0x30a0c6['countdropretry']+_0x30a0c6[_0x3f6c('0xa')]+_0x30a0c6['countmachineretry']+_0x30a0c6[_0x3f6c('0xb')];this[_0x3f6c('0x9')]=_0x30a0c6['countnosuchnumberretry'];this[_0x3f6c('0xc')]=_0x30a0c6[_0x3f6c('0xc')];this[_0x3f6c('0xa')]=_0x30a0c6['countabandonedretry'];this[_0x3f6c('0xd')]=_0x30a0c6['countmachineretry'];this[_0x3f6c('0xb')]=_0x30a0c6[_0x3f6c('0xb')];this[_0x3f6c('0xe')]=_0x91d2a[_0x3f6c('0xe')];this[_0x3f6c('0xf')]=_0x30a0c6[_0x3f6c('0x10')];this[_0x3f6c('0x11')]=_0x30a0c6[_0x3f6c('0x12')];this[_0x3f6c('0x13')]=_0x30a0c6[_0x3f6c('0x13')];this[_0x3f6c('0x14')]=_0x30a0c6[_0x3f6c('0x14')];this[_0x3f6c('0x15')]=_0x30a0c6[_0x3f6c('0x15')];this['dropreason']=_0x30a0c6[_0x3f6c('0x16')];this[_0x3f6c('0x17')]=this[_0x3f6c('0x15')];this['ringtime']=utils[_0x3f6c('0x18')](_0x30a0c6['responsetime'],_0x30a0c6[_0x3f6c('0x13')]);this[_0x3f6c('0x19')]=utils[_0x3f6c('0x18')](this[_0x3f6c('0x15')],_0x30a0c6[_0x3f6c('0x14')]);this[_0x3f6c('0x1a')]=0x0;this[_0x3f6c('0x1b')]=_0x91d2a[_0x3f6c('0x1b')];this[_0x3f6c('0x1c')]=_0x91d2a[_0x3f6c('0x1d')];this[_0x3f6c('0x1e')]=_0x91d2a['reason'];this['callback']=_0x30a0c6[_0x3f6c('0x1f')];this[_0x3f6c('0x20')]=_0x30a0c6['callbackuniqueid'];this[_0x3f6c('0x21')]=_0x30a0c6[_0x3f6c('0x21')];this[_0x3f6c('0x22')]=_0x30a0c6[_0x3f6c('0x22')];this['ContactId']=_0x30a0c6['ContactId'];this[_0x3f6c('0x23')]=_0x30a0c6[_0x3f6c('0x23')];this[_0x3f6c('0x24')]=_0x30a0c6[_0x3f6c('0x24')];this[_0x3f6c('0x25')]=_0x30a0c6[_0x3f6c('0x25')];this[_0x3f6c('0x26')]=_0x30a0c6[_0x3f6c('0x26')];this[_0x3f6c('0x27')]=_0x30a0c6[_0x3f6c('0x27')]||'';this[_0x3f6c('0x28')]=_0x30a0c6['originatecalleridname']||'';this[_0x3f6c('0x29')]=_0x30a0c6[_0x3f6c('0x29')];this[_0x3f6c('0x2a')]=_0x30a0c6[_0x3f6c('0x2a')];this['statedesc']=_0x30a0c6[_0x3f6c('0x2b')];}module[_0x3f6c('0x2c')]=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 bb512a8..118f668 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(_0x1e593f,_0xded5fd){var _0x57963c=function(_0xc1e0ea){while(--_0xc1e0ea){_0x1e593f['push'](_0x1e593f['shift']());}};_0x57963c(++_0xded5fd);}(_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(_0xb3b301,_0xbcc5c9){var _0x354665=function(_0x42c049){while(--_0x42c049){_0xb3b301['push'](_0xb3b301['shift']());}};_0x354665(++_0xbcc5c9);}(_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 1342610..7071c8d 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 _0xf705=['originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','status','TrunkBackup','includes','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactLowerLimitOriginate','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','isIVRCampaign','outbound','active','milliseconds','seconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xf705,0x17c));var _0x5f70=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xf705[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var moment=require(_0x5f70('0x0'));var util=require(_0x5f70('0x1'));var logger=require(_0x5f70('0x2'))(_0x5f70('0x3'));var timezones=require(_0x5f70('0x4'))[_0x5f70('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x5f70('0x6'),'CONTACTS_RESCHEDULED':_0x5f70('0x7'),'DEACTIVATED':_0x5f70('0x8'),'DISACTIVED':_0x5f70('0x9'),'EMPTY_INTERVAL':_0x5f70('0xa'),'INACTIVE':_0x5f70('0xb'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x5f70('0xc'),'NULL_INTERVAL':_0x5f70('0xd'),'OVERTIME_INTERVAL':_0x5f70('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x5f70('0xf'),'QUEUE_RECALL':_0x5f70('0x10'),'RECALL_TIMEOUT':_0x5f70('0x11'),'RUNNING':_0x5f70('0x12'),'UNKNOWN_TIMEZONE':_0x5f70('0x13'),'UNREACHABLE_TRUNK':_0x5f70('0x14')};exports[_0x5f70('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x212d53){return _0x212d53[_0x5f70('0x16')]==='preview';}exports[_0x5f70('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x5380b2){return _0x5380b2[_0x5f70('0x18')]==='ivr';}exports[_0x5f70('0x19')]=isIVRCampaign;function isOutboundQueue(_0x3a87fd){return _0x3a87fd[_0x5f70('0x18')]===_0x5f70('0x1a');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x27d173){return _0x27d173['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x456b93){return _0x456b93[_0x5f70('0x1b')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x5a9c5b,_0x36e82f){var _0x1fb216=moment(_0x5a9c5b)[_0x5f70('0x1c')](0x0);var _0x5cef1e=moment(_0x36e82f)['milliseconds'](0x0);return _0x1fb216['diff'](_0x5cef1e,_0x5f70('0x1d'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x444a86,_0xd90a5a){var _0x9ad34f=![];var _0x3afee3=_0x444a86['dialMethod']!==_0xd90a5a[_0x5f70('0x16')]||_0x444a86[_0x5f70('0x1e')]!==_0xd90a5a[_0x5f70('0x1e')]||_0x444a86[_0x5f70('0x1f')]!==_0xd90a5a[_0x5f70('0x1f')];var _0x1c4c77=_0x444a86['available']!==_0xd90a5a[_0x5f70('0x20')]||_0x444a86[_0x5f70('0x21')]!==_0xd90a5a['loggedIn']||_0x444a86['loggedInDb']!==_0xd90a5a[_0x5f70('0x22')]||_0x444a86[_0x5f70('0x23')]!==_0xd90a5a['paused']||_0x444a86[_0x5f70('0x24')]!==_0xd90a5a['talking']||_0x444a86[_0x5f70('0x25')]!==_0xd90a5a[_0x5f70('0x25')]||_0x444a86[_0x5f70('0x26')]!==_0xd90a5a[_0x5f70('0x26')]||_0x444a86['inUse']!==_0xd90a5a[_0x5f70('0x27')]||_0x444a86[_0x5f70('0x28')]!==_0xd90a5a[_0x5f70('0x28')];if(_0x444a86[_0x5f70('0x29')]&&_0xd90a5a[_0x5f70('0x29')]){_0x9ad34f=_0x444a86['Trunk'][_0x5f70('0x2a')]!==_0xd90a5a[_0x5f70('0x29')][_0x5f70('0x2a')]||_0x444a86[_0x5f70('0x29')]['active']!==_0xd90a5a[_0x5f70('0x29')][_0x5f70('0x1b')];}return _0x3afee3||_0x1c4c77||_0x9ad34f;}exports[_0x5f70('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x52f206){var _0xcce38c=null;var _0x3ee8aa=_0x52f206[_0x5f70('0x2c')];if(_[_0x5f70('0x2d')](_0x52f206[_0x5f70('0x2e')])||_[_0x5f70('0x2d')](_0x52f206[_0x5f70('0x2f')])||_[_0x5f70('0x2d')](_0x52f206['Interval']['Intervals'])){_0xcce38c=CAMPAIGN_STATUS[_0x5f70('0x30')];}else if(_[_0x5f70('0x31')](_0x52f206[_0x5f70('0x2e')])||_[_0x5f70('0x31')](_0x52f206[_0x5f70('0x2f')][_0x5f70('0x32')])){_0xcce38c=CAMPAIGN_STATUS[_0x5f70('0x33')];}else if(_0x3ee8aa&&!timezones[_0x3ee8aa]){_0xcce38c=CAMPAIGN_STATUS[_0x5f70('0x34')];}return _0xcce38c;}function checkAnyValidTrunk(_0x40e41b,_0x3c3cbd){var _0x2bd516=null;var _0x4d441c=_0x5f70('0x35');var _0x2d3b50=['reachable',_0x5f70('0x36')];var _0x331b0d=!![];if(_0x40e41b[_0x5f70('0x29')]&&_0x40e41b[_0x5f70('0x29')][_0x5f70('0x1b')]){_0x4d441c+=_0x40e41b[_0x5f70('0x29')][_0x5f70('0x2a')];_0x2bd516=_0x3c3cbd[_0x4d441c];_0x331b0d=_0x2d3b50['includes'](_0x2bd516[_0x5f70('0x37')]);}else if(_0x40e41b['TrunkBackup']&&_0x40e41b[_0x5f70('0x38')]['active']){_0x4d441c+=_0x40e41b[_0x5f70('0x38')][_0x5f70('0x2a')];_0x2bd516=_0x3c3cbd[_0x4d441c];_0x331b0d=_0x2d3b50[_0x5f70('0x39')](_0x2bd516[_0x5f70('0x37')]);}return _0x331b0d;}function getQueueCampaignStatusMessage(_0x1a0141,_0x304db7){var _0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3a')];var _0x403d5c=isPreviewCampaign(_0x1a0141);if(!isQueueCampaignActive(_0x1a0141)){if(_0x403d5c){_0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3b')];}else{if(_0x1a0141[_0x5f70('0x28')]===0x0&&_0x1a0141[_0x5f70('0x24')]===0x0&&_0x1a0141[_0x5f70('0x26')]===0x0&&(_0x1a0141[_0x5f70('0x25')]||0x0)===0x0){_0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3b')];}else{_0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3c')];}}}else if(_0x1a0141[_0x5f70('0x21')]===0x0){_0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3d')];}else if(!checkAnyValidTrunk(_0x1a0141,_0x304db7)){_0x25d627=CAMPAIGN_STATUS[_0x5f70('0x3e')];}else if(!isPreviewCampaign(_0x1a0141)){var _0x3c39a5=checkAnyValidQueueCampaignInterval(_0x1a0141);if(_0x3c39a5){_0x25d627=_0x3c39a5;}}return _0x25d627;}exports[_0x5f70('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x47fca4){var _0x457d79=CAMPAIGN_STATUS[_0x5f70('0x3c')];if(_0x47fca4[_0x5f70('0x28')]===0x0&&_0x47fca4[_0x5f70('0x24')]===0x0&&_0x47fca4[_0x5f70('0x26')]===0x0&&(_0x47fca4[_0x5f70('0x25')]||0x0)===0x0){_0x457d79=CAMPAIGN_STATUS[_0x5f70('0x3b')];}return _0x457d79;}exports[_0x5f70('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x406145){var _0x12fe4a=_0x406145[_0x5f70('0x41')](/"(.*?)"/);return _0x12fe4a?_0x12fe4a[0x1]:_0x406145;}exports[_0x5f70('0x42')]=extractCalleridName;function getCallerId(_0x51b1da,_0x2f6964,_0x2cc41a){if(!_[_0x5f70('0x43')](_0x2cc41a)&&typeof _0x2cc41a==='string'&&!_[_0x5f70('0x31')](_0x2cc41a)){if(!_[_0x5f70('0x43')](_0x2f6964)&&typeof _0x2f6964===_0x5f70('0x44')&&!_[_0x5f70('0x31')](_0x2f6964)){return util[_0x5f70('0x45')](_0x5f70('0x46'),_0x2f6964,_0x2cc41a);}return util['format'](_0x5f70('0x46'),_0x2cc41a,_0x2cc41a);}if(!_['isUndefined'](_0x51b1da)&&typeof _0x51b1da===_0x5f70('0x44')&&!_[_0x5f70('0x31')](_0x51b1da)){return _0x51b1da;}return _0x5f70('0x47');}exports[_0x5f70('0x48')]=getCallerId;function getCallerIdRandom(_0x396628,_0x1ad3bb){var _0x3b8060;var _0x50f489;var _0x4087fa;if(_0x1ad3bb<=0x0){_0x1ad3bb=0x1;}_0x3b8060=new RegExp(_0x5f70('0x49')+_0x1ad3bb+'}$');_0x50f489=Math['pow'](0xa,_0x1ad3bb-0x1);_0x4087fa=Math[_0x5f70('0x4a')](0xa,_0x1ad3bb)-0x1;return util[_0x5f70('0x45')]('%s',_[_0x5f70('0x4b')](_0x396628,_0x3b8060,_[_0x5f70('0x4c')](_0x50f489,_0x4087fa)[_0x5f70('0x4d')]()));}exports[_0x5f70('0x4e')]=getCallerIdRandom;function decrementOriginate(_0xc4f784){if(_0xc4f784[_0x5f70('0x28')]&&_0xc4f784[_0x5f70('0x28')]>0x0){_0xc4f784['originated']-=0x1;}else{logger[_0x5f70('0x4f')](_0x5f70('0x50'));}}exports[_0x5f70('0x51')]=decrementOriginate;function checkContactEmpty(_0x43958e){return _0x43958e&&_0x43958e[_0x5f70('0x52')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x461f04,_0x22d4c0){if(_0x22d4c0===0x0){return 0x0;}var _0x4029d0=0x1;for(var _0x56a9ce=0x1;_0x56a9ce<=_0x22d4c0;_0x56a9ce+=0x1){_0x4029d0=0x1+_0x4029d0*_0x56a9ce/_0x461f04;}return 0x1/_0x4029d0;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x399219,_0x1cbea7,_0x1383f4){if(_0x1cbea7>_0x1383f4){for(var _0x2bb50e=0x0;_0x2bb50e<_0x1cbea7-_0x1383f4;_0x2bb50e+=0x1){decrementOriginate(_0x399219);}}}exports[_0x5f70('0x53')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x57af=['dialer','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','toString','getCallerIdRandom','decrementOriginate','erlangb','checkContactLowerLimitOriginate','lodash','util','../../../../config/logger'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x57af,0x99));var _0xf57a=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x57af[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xf57a('0x0'));var moment=require('moment');var util=require(_0xf57a('0x1'));var logger=require(_0xf57a('0x2'))(_0xf57a('0x3'));var timezones=require('../../../../config/environment/shared')[_0xf57a('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xf57a('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xf57a('0x6'),'DEACTIVATED':_0xf57a('0x7'),'DISACTIVED':_0xf57a('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xf57a('0x9'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xf57a('0xa'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xf57a('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0xf57a('0xc'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xf57a('0xd'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xf57a('0xe'),'UNREACHABLE_TRUNK':_0xf57a('0xf')};exports[_0xf57a('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1dcbbf){return _0x1dcbbf[_0xf57a('0x11')]===_0xf57a('0x12');}exports[_0xf57a('0x13')]=isPreviewCampaign;function isIVRCampaign(_0xee31c6){return _0xee31c6[_0xf57a('0x14')]===_0xf57a('0x15');}exports[_0xf57a('0x16')]=isIVRCampaign;function isOutboundQueue(_0x3e28b0){return _0x3e28b0[_0xf57a('0x14')]===_0xf57a('0x17');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0xc2aa89){return _0xc2aa89['dialActive'];}exports[_0xf57a('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x43bf58){return _0x43bf58[_0xf57a('0x19')];}exports[_0xf57a('0x1a')]=isIVRCampaignActive;function getSeconds(_0x16b550,_0x4130d9){var _0x300192=moment(_0x16b550)[_0xf57a('0x1b')](0x0);var _0x223276=moment(_0x4130d9)[_0xf57a('0x1b')](0x0);return _0x300192[_0xf57a('0x1c')](_0x223276,_0xf57a('0x1d'));}exports[_0xf57a('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x526f99,_0xbb6ef4){var _0x2661cc=![];var _0x5e8fce=_0x526f99[_0xf57a('0x11')]!==_0xbb6ef4[_0xf57a('0x11')]||_0x526f99[_0xf57a('0x1f')]!==_0xbb6ef4[_0xf57a('0x1f')]||_0x526f99[_0xf57a('0x20')]!==_0xbb6ef4[_0xf57a('0x20')];var _0xe88806=_0x526f99[_0xf57a('0x21')]!==_0xbb6ef4[_0xf57a('0x21')]||_0x526f99[_0xf57a('0x22')]!==_0xbb6ef4[_0xf57a('0x22')]||_0x526f99[_0xf57a('0x23')]!==_0xbb6ef4[_0xf57a('0x23')]||_0x526f99[_0xf57a('0x24')]!==_0xbb6ef4[_0xf57a('0x24')]||_0x526f99[_0xf57a('0x25')]!==_0xbb6ef4['talking']||_0x526f99[_0xf57a('0x26')]!==_0xbb6ef4[_0xf57a('0x26')]||_0x526f99[_0xf57a('0x27')]!==_0xbb6ef4[_0xf57a('0x27')]||_0x526f99[_0xf57a('0x28')]!==_0xbb6ef4[_0xf57a('0x28')]||_0x526f99[_0xf57a('0x29')]!==_0xbb6ef4[_0xf57a('0x29')];if(_0x526f99[_0xf57a('0x2a')]&&_0xbb6ef4[_0xf57a('0x2a')]){_0x2661cc=_0x526f99[_0xf57a('0x2a')][_0xf57a('0x2b')]!==_0xbb6ef4[_0xf57a('0x2a')][_0xf57a('0x2b')]||_0x526f99[_0xf57a('0x2a')][_0xf57a('0x19')]!==_0xbb6ef4[_0xf57a('0x2a')]['active'];}return _0x5e8fce||_0xe88806||_0x2661cc;}exports[_0xf57a('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2e012b){var _0x31ce95=null;var _0x55022e=_0x2e012b['dialTimezone'];if(_[_0xf57a('0x2d')](_0x2e012b[_0xf57a('0x2e')])||_[_0xf57a('0x2d')](_0x2e012b[_0xf57a('0x2f')])||_['isNil'](_0x2e012b[_0xf57a('0x2f')][_0xf57a('0x30')])){_0x31ce95=CAMPAIGN_STATUS[_0xf57a('0x31')];}else if(_[_0xf57a('0x32')](_0x2e012b[_0xf57a('0x2e')])||_[_0xf57a('0x32')](_0x2e012b[_0xf57a('0x2f')][_0xf57a('0x30')])){_0x31ce95=CAMPAIGN_STATUS[_0xf57a('0x33')];}else if(_0x55022e&&!timezones[_0x55022e]){_0x31ce95=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x31ce95;}function checkAnyValidTrunk(_0x422910,_0x1367c0){var _0xf0d5f5=null;var _0x342312=_0xf57a('0x34');var _0x107646=['reachable',_0xf57a('0x35')];var _0x34aaa8=!![];if(_0x422910[_0xf57a('0x2a')]&&_0x422910[_0xf57a('0x2a')][_0xf57a('0x19')]){_0x342312+=_0x422910[_0xf57a('0x2a')][_0xf57a('0x2b')];_0xf0d5f5=_0x1367c0[_0x342312];_0x34aaa8=_0x107646[_0xf57a('0x36')](_0xf0d5f5[_0xf57a('0x37')]);}else if(_0x422910[_0xf57a('0x38')]&&_0x422910[_0xf57a('0x38')]['active']){_0x342312+=_0x422910['TrunkBackup'][_0xf57a('0x2b')];_0xf0d5f5=_0x1367c0[_0x342312];_0x34aaa8=_0x107646[_0xf57a('0x36')](_0xf0d5f5[_0xf57a('0x37')]);}return _0x34aaa8;}function getQueueCampaignStatusMessage(_0x2c53fb,_0x489bdf){var _0x175e21=CAMPAIGN_STATUS[_0xf57a('0x5')];var _0x3cf789=isPreviewCampaign(_0x2c53fb);if(!isQueueCampaignActive(_0x2c53fb)){if(_0x3cf789){_0x175e21=CAMPAIGN_STATUS[_0xf57a('0x39')];}else{if(_0x2c53fb['originated']===0x0&&_0x2c53fb[_0xf57a('0x25')]===0x0&&_0x2c53fb[_0xf57a('0x27')]===0x0&&(_0x2c53fb['pTalking']||0x0)===0x0){_0x175e21=CAMPAIGN_STATUS['INACTIVE'];}else{_0x175e21=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x2c53fb[_0xf57a('0x22')]===0x0){_0x175e21=CAMPAIGN_STATUS[_0xf57a('0x3a')];}else if(!checkAnyValidTrunk(_0x2c53fb,_0x489bdf)){_0x175e21=CAMPAIGN_STATUS[_0xf57a('0x3b')];}else if(!isPreviewCampaign(_0x2c53fb)){var _0x5a25c4=checkAnyValidQueueCampaignInterval(_0x2c53fb);if(_0x5a25c4){_0x175e21=_0x5a25c4;}}return _0x175e21;}exports[_0xf57a('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x335803){var _0x1c8da3=CAMPAIGN_STATUS[_0xf57a('0x3d')];if(_0x335803[_0xf57a('0x29')]===0x0&&_0x335803[_0xf57a('0x25')]===0x0&&_0x335803[_0xf57a('0x27')]===0x0&&(_0x335803[_0xf57a('0x26')]||0x0)===0x0){_0x1c8da3=CAMPAIGN_STATUS[_0xf57a('0x39')];}return _0x1c8da3;}exports[_0xf57a('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5e2099){var _0x30a78a=_0x5e2099['match'](/"(.*?)"/);return _0x30a78a?_0x30a78a[0x1]:_0x5e2099;}exports[_0xf57a('0x3f')]=extractCalleridName;function getCallerId(_0x5da7c7,_0x2b2115,_0x9a1277){if(!_[_0xf57a('0x40')](_0x9a1277)&&typeof _0x9a1277==='string'&&!_[_0xf57a('0x32')](_0x9a1277)){if(!_[_0xf57a('0x40')](_0x2b2115)&&typeof _0x2b2115===_0xf57a('0x41')&&!_[_0xf57a('0x32')](_0x2b2115)){return util['format'](_0xf57a('0x42'),_0x2b2115,_0x9a1277);}return util[_0xf57a('0x43')](_0xf57a('0x42'),_0x9a1277,_0x9a1277);}if(!_[_0xf57a('0x40')](_0x5da7c7)&&typeof _0x5da7c7===_0xf57a('0x41')&&!_[_0xf57a('0x32')](_0x5da7c7)){return _0x5da7c7;}return _0xf57a('0x44');}exports[_0xf57a('0x45')]=getCallerId;function getCallerIdRandom(_0x4191b1,_0xdee39){var _0x28805a;var _0x1a9bbe;var _0x3bd08;if(_0xdee39<=0x0){_0xdee39=0x1;}_0x28805a=new RegExp(_0xf57a('0x46')+_0xdee39+'}$');_0x1a9bbe=Math[_0xf57a('0x47')](0xa,_0xdee39-0x1);_0x3bd08=Math[_0xf57a('0x47')](0xa,_0xdee39)-0x1;return util['format']('%s',_[_0xf57a('0x48')](_0x4191b1,_0x28805a,_['random'](_0x1a9bbe,_0x3bd08)[_0xf57a('0x49')]()));}exports[_0xf57a('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x505878){if(_0x505878[_0xf57a('0x29')]&&_0x505878[_0xf57a('0x29')]>0x0){_0x505878[_0xf57a('0x29')]-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xf57a('0x4b')]=decrementOriginate;function checkContactEmpty(_0x5b528e){return _0x5b528e&&_0x5b528e['length']>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x33dba1,_0x2b4996){if(_0x2b4996===0x0){return 0x0;}var _0x2b5a0a=0x1;for(var _0x38add4=0x1;_0x38add4<=_0x2b4996;_0x38add4+=0x1){_0x2b5a0a=0x1+_0x2b5a0a*_0x38add4/_0x33dba1;}return 0x1/_0x2b5a0a;}exports[_0xf57a('0x4c')]=erlangb;function checkContactLowerLimitOriginate(_0x433e18,_0x1d0f10,_0x2fae96){if(_0x1d0f10>_0x2fae96){for(var _0xd4b74a=0x0;_0xd4b74a<_0x1d0f10-_0x2fae96;_0xd4b74a+=0x1){decrementOriginate(_0x433e18);}}}exports[_0xf57a('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 87956aa..f75d61d 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(_0x151aa8,_0x569144){var _0x4242e3=function(_0x4e37d2){while(--_0x4e37d2){_0x151aa8['push'](_0x151aa8['shift']());}};_0x4242e3(++_0x569144);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x1b2f84,_0x21951c){var _0x2e2f25=function(_0xc80e8e){while(--_0xc80e8e){_0x1b2f84['push'](_0x1b2f84['shift']());}};_0x2e2f25(++_0x21951c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 c393d3d..0104caf 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 _0xaed9=['AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','catch','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment','path','tiff2pdf','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','syncVarSet','newstate','bind','syncNewExten','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason'];(function(_0x10c20b,_0x4a2f1d){var _0x1d9f2c=function(_0x2ea225){while(--_0x2ea225){_0x10c20b['push'](_0x10c20b['shift']());}};_0x1d9f2c(++_0x4a2f1d);}(_0xaed9,0x11e));var _0x9aed=function(_0x42c381,_0x276f0d){_0x42c381=_0x42c381-0x0;var _0x2f52ee=_0xaed9[_0x42c381];return _0x2f52ee;};'use strict';var util=require(_0x9aed('0x0'));var _=require(_0x9aed('0x1'));var BPromise=require(_0x9aed('0x2'));var uuid=require(_0x9aed('0x3'));var moment=require(_0x9aed('0x4'));var path=require(_0x9aed('0x5'));var tiff2pdf=require(_0x9aed('0x6'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x9aed('0x7'));var ami=require(_0x9aed('0x8'));var rpcDb=require(_0x9aed('0x9'));var Channel=require(_0x9aed('0xa'));var ut=require(_0x9aed('0xb'));var Action=require(_0x9aed('0xc'));var faxAccount=require(_0x9aed('0xd'));var attachment=require(_0x9aed('0xe'));var faxMessage=require(_0x9aed('0xf'));function Fax(_0x1b01d0){this[_0x9aed('0x10')]={};this[_0x9aed('0x11')]=_0x1b01d0[_0x9aed('0x11')];this[_0x9aed('0x12')]=_0x1b01d0[_0x9aed('0x12')];this[_0x9aed('0x13')]={};ami['on'](_0x9aed('0x14'),this[_0x9aed('0x15')]['bind'](this));ami['on']('varset',this[_0x9aed('0x16')]['bind'](this));ami['on'](_0x9aed('0x17'),this['syncNewState'][_0x9aed('0x18')](this));ami['on']('newexten',this[_0x9aed('0x19')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus'][_0x9aed('0x18')](this));ami['on'](_0x9aed('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0x9aed('0x1b'),this[_0x9aed('0x1c')][_0x9aed('0x18')](this));ami['on'](_0x9aed('0x1d'),this[_0x9aed('0x1e')][_0x9aed('0x18')](this));}Fax[_0x9aed('0x1f')]['syncNewchannel']=function(_0x4a59eb){if(_0x4a59eb[_0x9aed('0x20')]===_0x9aed('0x21')){for(var _0x49c391 in this['faxAccounts']){if(this[_0x9aed('0x11')]['hasOwnProperty'](_0x49c391)){if(_0x4a59eb['exten']===this['faxAccounts'][_0x49c391][_0x9aed('0x22')]){this[_0x9aed('0x10')][_0x4a59eb[_0x9aed('0x23')]]={};this[_0x9aed('0x10')][_0x4a59eb[_0x9aed('0x23')]][_0x9aed('0x24')]=_0x4a59eb[_0x9aed('0x24')];this[_0x9aed('0x10')][_0x4a59eb[_0x9aed('0x23')]]['id']=this[_0x9aed('0x11')][_0x49c391]['id'];this['channels'][_0x4a59eb['uniqueid']]['name']=this[_0x9aed('0x11')][_0x49c391][_0x9aed('0x25')];logger[_0x9aed('0x26')](_0x4a59eb['uniqueid'],_0x9aed('0x27'));}}}}if(this['actions'][_0x4a59eb[_0x9aed('0x23')]]){this[_0x9aed('0x10')][_0x4a59eb[_0x9aed('0x23')]]={};this[_0x9aed('0x10')][_0x4a59eb['uniqueid']]['channel']=_0x4a59eb[_0x9aed('0x24')];logger['info'](_0x4a59eb['uniqueid'],_0x9aed('0x27'));}};Fax[_0x9aed('0x1f')][_0x9aed('0x16')]=function(_0x55a406){if(this[_0x9aed('0x10')][_0x55a406['uniqueid']]){for(var _0x4aeb25 in _0x55a406[_0x9aed('0x28')]){if(_0x55a406[_0x9aed('0x28')][_0x9aed('0x29')](_0x4aeb25)){this[_0x9aed('0x10')][_0x55a406['uniqueid']][_0x4aeb25]=_0x55a406['value'];}}}};Fax[_0x9aed('0x1f')]['syncNewState']=function(_0x14ef78){if(this[_0x9aed('0x10')][_0x14ef78[_0x9aed('0x23')]]){this['channels'][_0x14ef78[_0x9aed('0x23')]][_0x9aed('0x2a')]=_0x14ef78[_0x9aed('0x2a')];this[_0x9aed('0x10')][_0x14ef78[_0x9aed('0x23')]][_0x9aed('0x2b')]=_0x14ef78[_0x9aed('0x2b')];}};Fax[_0x9aed('0x1f')][_0x9aed('0x19')]=function(_0x5d3293){if(this[_0x9aed('0x10')][_0x5d3293[_0x9aed('0x23')]]){for(var _0x1301d6 in _0x5d3293[_0x9aed('0x28')]){if(_0x5d3293[_0x9aed('0x28')][_0x9aed('0x29')](_0x1301d6)){this['channels'][_0x5d3293[_0x9aed('0x23')]][_0x1301d6]=_0x5d3293[_0x9aed('0x2c')];}}}};Fax[_0x9aed('0x1f')][_0x9aed('0x2d')]=function(_0x5058cc){if(this[_0x9aed('0x10')][_0x5058cc['uniqueid']]){this['channels'][_0x5058cc[_0x9aed('0x23')]][_0x9aed('0x2e')]=_0x5058cc['operation'];this[_0x9aed('0x10')][_0x5058cc[_0x9aed('0x23')]]['status']=_0x5058cc[_0x9aed('0x2f')];this[_0x9aed('0x10')][_0x5058cc[_0x9aed('0x23')]][_0x9aed('0x22')]=_0x5058cc['localstationid'];this[_0x9aed('0x10')][_0x5058cc['uniqueid']][_0x9aed('0x30')]=_0x5058cc[_0x9aed('0x30')];logger['info'](_0x5058cc[_0x9aed('0x23')],_0x9aed('0x31'));}};Fax[_0x9aed('0x1f')][_0x9aed('0x32')]=function(_0x2ac2f6){var _0x535b8e=this;if(this[_0x9aed('0x10')][_0x2ac2f6['uniqueid']]){var _0x39afcd=this[_0x9aed('0x10')][_0x2ac2f6[_0x9aed('0x23')]]['id'];this[_0x9aed('0x10')][_0x2ac2f6[_0x9aed('0x23')]][_0x9aed('0x33')]=_0x2ac2f6[_0x9aed('0x33')];this[_0x9aed('0x10')][_0x2ac2f6['uniqueid']][_0x9aed('0x34')]=_0x2ac2f6['pagestransferred'];this[_0x9aed('0x10')][_0x2ac2f6[_0x9aed('0x23')]][_0x9aed('0x22')]=_0x2ac2f6['localstationid'];this['channels'][_0x2ac2f6[_0x9aed('0x23')]]['resolution']=_0x2ac2f6[_0x9aed('0x35')];this['channels'][_0x2ac2f6[_0x9aed('0x23')]][_0x9aed('0x36')]=_0x2ac2f6['transferrate'];this[_0x9aed('0x10')][_0x2ac2f6['uniqueid']][_0x9aed('0x30')]=_0x2ac2f6[_0x9aed('0x30')];this[_0x9aed('0x10')][_0x2ac2f6[_0x9aed('0x23')]][_0x9aed('0x37')]=_0x2ac2f6[_0x9aed('0x37')];if(this['channels'][_0x2ac2f6['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x2ac2f6[_0x9aed('0x30')],_0x9aed('0x38'),function(_0x4f2a0f){logger[_0x9aed('0x26')](_0x2ac2f6[_0x9aed('0x23')],_0x9aed('0x39'),_0x4f2a0f['message']);attachment[_0x9aed('0x3a')]({'name':path[_0x9aed('0x3b')](_0x2ac2f6['filename'])['name'],'basename':path['parse'](_0x2ac2f6[_0x9aed('0x30')])[_0x9aed('0x25')]+_0x9aed('0x3c'),'type':_0x9aed('0x3d')})[_0x9aed('0x3e')](function(_0x50cd13){faxAccount[_0x9aed('0x3f')](_0x39afcd,{'from':_0x2ac2f6[_0x9aed('0x37')],'mapKey':_0x9aed('0x7'),'body':path['parse'](_0x2ac2f6[_0x9aed('0x30')])[_0x9aed('0x25')]+_0x9aed('0x3c'),'AttachmentId':_0x50cd13['id']})['catch'](function(_0x31a659){logger[_0x9aed('0x40')](_0x2ac2f6[_0x9aed('0x23')],_0x9aed('0x41'),JSON[_0x9aed('0x42')](_0x31a659));});})['catch'](function(_0x1c49ed){logger[_0x9aed('0x40')](_0x2ac2f6[_0x9aed('0x23')],_0x9aed('0x43'),JSON['stringify'](_0x1c49ed));});});}logger['info'](_0x2ac2f6[_0x9aed('0x23')],'\x20receiveFax\x20');}};Fax['prototype'][_0x9aed('0x1e')]=function(_0x9ae781){if(this[_0x9aed('0x13')][_0x9ae781[_0x9aed('0x23')]]){_[_0x9aed('0x44')](this['channels'][_0x9ae781[_0x9aed('0x23')]],_['pick'](_0x9ae781,[_0x9aed('0x45'),_0x9aed('0x46')]));}};function updateStatus(_0x5613ba){if(_0x5613ba[_0x9aed('0x47')]){faxMessage[_0x9aed('0x48')](_0x5613ba['AttachmentId'],{'failMessage':_0x9aed('0x49')})[_0x9aed('0x3e')](function(_0x555fad){ut['logger'](_0x9aed('0x4a'),_0x555fad);})[_0x9aed('0x4b')](function(_0x341c34){ut[_0x9aed('0x4c')](_0x9aed('0x4d'),_0x341c34);});}else{ut[_0x9aed('0x4c')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x9aed('0x1f')][_0x9aed('0x4e')]=function(_0xe8be8e,_0x2b242d,_0x46c3ed){var _0x5843b5=this;var _0x24fc41={};if(_0x2b242d){_0x24fc41={'read':_0x2b242d};}else{_0x24fc41={'failMessage':_0x46c3ed};}if(this[_0x9aed('0x13')][_0xe8be8e]['AttachmentId']){faxMessage[_0x9aed('0x48')](this[_0x9aed('0x13')][_0xe8be8e][_0x9aed('0x47')],_0x24fc41)[_0x9aed('0x3e')](function(_0x366c6d){ut['logger'](_0x9aed('0x4f'),_0x366c6d);})[_0x9aed('0x4b')](function(_0x5e20be){ut[_0x9aed('0x4c')](_0x9aed('0x50'),_0x5e20be);})[_0x9aed('0x51')](function(){delete _0x5843b5[_0x9aed('0x10')][_0xe8be8e];delete _0x5843b5[_0x9aed('0x13')][_0xe8be8e];});}else{ut['logger'](_0x9aed('0x52'));delete this[_0x9aed('0x10')][_0xe8be8e];delete this[_0x9aed('0x13')][_0xe8be8e];}};Fax[_0x9aed('0x1f')][_0x9aed('0x1c')]=function(_0x2391b4){var _0x354474=this;if(this[_0x9aed('0x10')][_0x2391b4[_0x9aed('0x23')]]){if(this[_0x9aed('0x13')][_0x2391b4[_0x9aed('0x23')]]){this['channels'][_0x2391b4[_0x9aed('0x23')]]['id']=this['actions'][_0x2391b4[_0x9aed('0x23')]]['id'];this[_0x9aed('0x10')][_0x2391b4[_0x9aed('0x23')]][_0x9aed('0x25')]=this[_0x9aed('0x13')][_0x2391b4[_0x9aed('0x23')]][_0x9aed('0x25')];}logger[_0x9aed('0x26')](_0x2391b4[_0x9aed('0x23')],this[_0x9aed('0x13')][_0x2391b4[_0x9aed('0x23')]]?_0x9aed('0x53'):_0x9aed('0x54'),JSON['stringify'](this['channels'][_0x2391b4['uniqueid']]));if(this[_0x9aed('0x13')][_0x2391b4['uniqueid']]){if(this[_0x9aed('0x10')][_0x2391b4[_0x9aed('0x23')]][_0x9aed('0x55')]>0x0&&this[_0x9aed('0x10')][_0x2391b4['uniqueid']][_0x9aed('0x56')]===_0x9aed('0x57')){this[_0x9aed('0x4e')](_0x2391b4['uniqueid'],!![]);}else{this[_0x9aed('0x4e')](_0x2391b4['uniqueid'],![],this['channels'][_0x2391b4[_0x9aed('0x23')]][_0x9aed('0x58')]?_0x9aed('0x59')+this[_0x9aed('0x10')][_0x2391b4[_0x9aed('0x23')]][_0x9aed('0x58')]:_0x9aed('0x5a'));}}}};Fax[_0x9aed('0x1f')][_0x9aed('0x5b')]=function(_0x322881){var _0x33064f=this;return new BPromise(function(_0x4d5a4,_0x504918){_0x33064f['execOriginate'](_0x322881,_0x33064f[_0x9aed('0x11')][_0x322881[_0x9aed('0x5c')]])[_0x9aed('0x3e')](function(_0x347af4){ut[_0x9aed('0x4c')](_0x9aed('0x5d'),_0x347af4);_0x4d5a4(ut[_0x9aed('0x5e')](_0x9aed('0x5f')));})['catch'](function(_0x3fa3c0){ut[_0x9aed('0x4c')]('[Fax][execOriginate][failure]',_0x3fa3c0);updateStatus(_0x322881);_0x504918(ut[_0x9aed('0x5e')](_0x9aed('0x60')));});});};Fax[_0x9aed('0x1f')]['checkAfterSend']=function(_0x16e2e0){var _0x18e061=this;return new BPromise(function(_0x275a9e,_0x1695d3){var _0x570a0c=_0x18e061[_0x9aed('0x61')](_0x18e061['faxAccounts'][_0x16e2e0[_0x9aed('0x5c')]]['Trunk'],_0x16e2e0);if(_0x570a0c[_0x9aed('0x62')]){_0x275a9e(ut[_0x9aed('0x5e')](_0x9aed('0x63')));}else{_0x1695d3(ut[_0x9aed('0x5e')](_0x570a0c[_0x9aed('0x5e')]));}});};function originate(_0x2d96db,_0x415836,_0x43bf41){return new BPromise(function(_0x320202,_0x405aef){if(_0x43bf41){var _0x49815a=util[_0x9aed('0x64')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x2d96db[_0x9aed('0x5')])[_0x9aed('0x25')],_0x2d96db[_0x9aed('0x5')]);gs['execute'](_0x49815a)[_0x9aed('0x3e')](function(){_0x2d96db[_0x9aed('0x5')]=util[_0x9aed('0x64')]('%s/%s.tif',path['parse'](_0x2d96db[_0x9aed('0x5')])[_0x9aed('0x65')],path[_0x9aed('0x3b')](_0x2d96db[_0x9aed('0x5')])[_0x9aed('0x25')]);_0x415836[_0x9aed('0x66')]=_0x2d96db[_0x9aed('0x5')];ut[_0x9aed('0x4c')](_0x9aed('0x67'),'');ami[_0x9aed('0x68')](ut[_0x9aed('0x69')](_0x2d96db,_0x415836))['then'](function(_0x147388){_0x320202(_0x147388);})[_0x9aed('0x4b')](function(_0x2cb80c){_0x405aef(_0x2cb80c);});})[_0x9aed('0x4b')](function(_0x5a5b73){_0x405aef(_0x5a5b73);});}else{ami['Action'](ut[_0x9aed('0x69')](_0x2d96db,_0x415836))[_0x9aed('0x3e')](function(_0x182243){_0x320202(_0x182243);})[_0x9aed('0x4b')](function(_0x18676c){_0x405aef(_0x18676c);});}});}Fax[_0x9aed('0x1f')][_0x9aed('0x6a')]=function(_0x5b9459,_0x589656){var _0xd7f39a=this;return new BPromise(function(_0x1a5e04,_0x56643e){var _0x355637=uuid['v4']();var _0x1e578c=ut[_0x9aed('0x6b')](_0x5b9459,_0x589656);_0xd7f39a['actions'][_0x355637]=new Action(_0x355637,_0x589656,_0x5b9459);var _0x169f40=_0xd7f39a[_0x9aed('0x13')][_0x355637];if(path['parse'](_0x5b9459[_0x9aed('0x5')])['ext']==='.pdf'){originate(_0x169f40,_0x1e578c,!![])[_0x9aed('0x3e')](function(_0x23343d){_0x1a5e04(_0x23343d);})['catch'](function(_0x44c782){_0x56643e(_0x44c782);});}else{originate(_0x169f40,_0x1e578c,![])[_0x9aed('0x3e')](function(_0x27555f){_0x1a5e04(_0x27555f);})[_0x9aed('0x4b')](function(_0x32dec3){_0x56643e(_0x32dec3);});}});};Fax[_0x9aed('0x1f')][_0x9aed('0x6c')]=function(_0x2c3534){return!_[_0x9aed('0x6d')](_0x2c3534)&&!_['isNil'](_0x2c3534[_0x9aed('0x25')])&&!_[_0x9aed('0x6d')](_0x2c3534['active'])&&_0x2c3534[_0x9aed('0x6e')]&&!_['isNil'](this[_0x9aed('0x12')][util[_0x9aed('0x64')]('SIP/%s',_0x2c3534[_0x9aed('0x25')])])&&!_[_0x9aed('0x6d')](this['trunks'][util[_0x9aed('0x64')](_0x9aed('0x6f'),_0x2c3534['name'])][_0x9aed('0x2f')])&&(this['trunks'][util[_0x9aed('0x64')](_0x9aed('0x6f'),_0x2c3534[_0x9aed('0x25')])][_0x9aed('0x2f')]==='reachable'||this[_0x9aed('0x12')][util[_0x9aed('0x64')]('SIP/%s',_0x2c3534[_0x9aed('0x25')])][_0x9aed('0x2f')]===_0x9aed('0x70'));};Fax[_0x9aed('0x1f')][_0x9aed('0x61')]=function(_0x32c4d6,_0x2b0300){if(!this[_0x9aed('0x6c')](_0x32c4d6)){ut[_0x9aed('0x4c')](_0x9aed('0x71'),_[_0x9aed('0x6d')](_0x32c4d6)?'':_0x32c4d6[_0x9aed('0x25')]+_0x9aed('0x72'));return{'isValid':![],'message':_0x9aed('0x73')};}if(_[_0x9aed('0x6d')](_0x2b0300[_0x9aed('0x7')])){ut[_0x9aed('0x4c')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x2b0300));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x2b0300[_0x9aed('0x5')])){ut[_0x9aed('0x4c')](_0x9aed('0x74'),JSON[_0x9aed('0x42')](_0x2b0300));return{'isValid':![],'message':_0x9aed('0x75')};}return{'isValid':!![],'message':_0x9aed('0x76')};};module['exports']=Fax; \ No newline at end of file +var _0x0b81=['isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','hasOwnProperty','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','fax','catch','error','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','execute','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables'];(function(_0x223354,_0x590668){var _0x34475a=function(_0x535e10){while(--_0x535e10){_0x223354['push'](_0x223354['shift']());}};_0x34475a(++_0x590668);}(_0x0b81,0x1db));var _0x10b8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b81[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x10b8('0x0'));var _=require(_0x10b8('0x1'));var BPromise=require(_0x10b8('0x2'));var uuid=require(_0x10b8('0x3'));var moment=require(_0x10b8('0x4'));var path=require(_0x10b8('0x5'));var tiff2pdf=require(_0x10b8('0x6'));var gs=require(_0x10b8('0x7'));var logger=require(_0x10b8('0x8'))('fax');var ami=require('../ami');var rpcDb=require(_0x10b8('0x9'));var Channel=require(_0x10b8('0xa'));var ut=require(_0x10b8('0xb'));var Action=require(_0x10b8('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x10b8('0xd'));function Fax(_0x22e978){this[_0x10b8('0xe')]={};this[_0x10b8('0xf')]=_0x22e978[_0x10b8('0xf')];this[_0x10b8('0x10')]=_0x22e978[_0x10b8('0x10')];this[_0x10b8('0x11')]={};ami['on'](_0x10b8('0x12'),this[_0x10b8('0x13')][_0x10b8('0x14')](this));ami['on']('varset',this[_0x10b8('0x15')][_0x10b8('0x14')](this));ami['on'](_0x10b8('0x16'),this[_0x10b8('0x17')][_0x10b8('0x14')](this));ami['on'](_0x10b8('0x18'),this['syncNewExten'][_0x10b8('0x14')](this));ami['on'](_0x10b8('0x19'),this[_0x10b8('0x1a')][_0x10b8('0x14')](this));ami['on']('receivefax',this[_0x10b8('0x1b')][_0x10b8('0x14')](this));ami['on'](_0x10b8('0x1c'),this[_0x10b8('0x1d')][_0x10b8('0x14')](this));ami['on'](_0x10b8('0x1e'),this['syncOriginateResponse'][_0x10b8('0x14')](this));}Fax[_0x10b8('0x1f')][_0x10b8('0x13')]=function(_0x3f8a48){if(_0x3f8a48[_0x10b8('0x20')]===_0x10b8('0x21')){for(var _0x58106c in this[_0x10b8('0xf')]){if(this[_0x10b8('0xf')]['hasOwnProperty'](_0x58106c)){if(_0x3f8a48[_0x10b8('0x22')]===this[_0x10b8('0xf')][_0x58106c][_0x10b8('0x23')]){this['channels'][_0x3f8a48['uniqueid']]={};this['channels'][_0x3f8a48[_0x10b8('0x24')]][_0x10b8('0x25')]=_0x3f8a48['channel'];this[_0x10b8('0xe')][_0x3f8a48[_0x10b8('0x24')]]['id']=this['faxAccounts'][_0x58106c]['id'];this[_0x10b8('0xe')][_0x3f8a48[_0x10b8('0x24')]][_0x10b8('0x26')]=this[_0x10b8('0xf')][_0x58106c][_0x10b8('0x26')];logger['info'](_0x3f8a48[_0x10b8('0x24')],_0x10b8('0x27'));}}}}if(this[_0x10b8('0x11')][_0x3f8a48[_0x10b8('0x24')]]){this['channels'][_0x3f8a48[_0x10b8('0x24')]]={};this['channels'][_0x3f8a48[_0x10b8('0x24')]][_0x10b8('0x25')]=_0x3f8a48['channel'];logger[_0x10b8('0x28')](_0x3f8a48[_0x10b8('0x24')],_0x10b8('0x27'));}};Fax[_0x10b8('0x1f')][_0x10b8('0x15')]=function(_0x5b32ed){if(this[_0x10b8('0xe')][_0x5b32ed[_0x10b8('0x24')]]){for(var _0x24fe0f in _0x5b32ed[_0x10b8('0x29')]){if(_0x5b32ed['variable']['hasOwnProperty'](_0x24fe0f)){this['channels'][_0x5b32ed[_0x10b8('0x24')]][_0x24fe0f]=_0x5b32ed[_0x10b8('0x2a')];}}}};Fax[_0x10b8('0x1f')][_0x10b8('0x17')]=function(_0x2ce332){if(this['channels'][_0x2ce332[_0x10b8('0x24')]]){this[_0x10b8('0xe')][_0x2ce332[_0x10b8('0x24')]][_0x10b8('0x2b')]=_0x2ce332[_0x10b8('0x2b')];this['channels'][_0x2ce332[_0x10b8('0x24')]][_0x10b8('0x2c')]=_0x2ce332[_0x10b8('0x2c')];}};Fax[_0x10b8('0x1f')]['syncNewExten']=function(_0x4024da){if(this[_0x10b8('0xe')][_0x4024da['uniqueid']]){for(var _0x4bf568 in _0x4024da[_0x10b8('0x29')]){if(_0x4024da['variable'][_0x10b8('0x2d')](_0x4bf568)){this[_0x10b8('0xe')][_0x4024da[_0x10b8('0x24')]][_0x4bf568]=_0x4024da[_0x10b8('0x2a')];}}}};Fax['prototype'][_0x10b8('0x1a')]=function(_0x184d40){if(this[_0x10b8('0xe')][_0x184d40['uniqueid']]){this[_0x10b8('0xe')][_0x184d40[_0x10b8('0x24')]]['operation']=_0x184d40[_0x10b8('0x2e')];this['channels'][_0x184d40[_0x10b8('0x24')]][_0x10b8('0x2f')]=_0x184d40[_0x10b8('0x2f')];this[_0x10b8('0xe')][_0x184d40[_0x10b8('0x24')]]['localstationid']=_0x184d40[_0x10b8('0x23')];this[_0x10b8('0xe')][_0x184d40[_0x10b8('0x24')]][_0x10b8('0x30')]=_0x184d40[_0x10b8('0x30')];logger[_0x10b8('0x28')](_0x184d40[_0x10b8('0x24')],_0x10b8('0x31'));}};Fax[_0x10b8('0x1f')][_0x10b8('0x1b')]=function(_0x5b71f3){var _0x1a06ef=this;if(this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]]){var _0x527eae=this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]]['id'];this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x32')]=_0x5b71f3[_0x10b8('0x32')];this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x33')]=_0x5b71f3[_0x10b8('0x33')];this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x23')]=_0x5b71f3[_0x10b8('0x23')];this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x34')]=_0x5b71f3['resolution'];this[_0x10b8('0xe')][_0x5b71f3['uniqueid']][_0x10b8('0x35')]=_0x5b71f3[_0x10b8('0x35')];this['channels'][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x30')]=_0x5b71f3[_0x10b8('0x30')];this[_0x10b8('0xe')][_0x5b71f3[_0x10b8('0x24')]][_0x10b8('0x36')]=_0x5b71f3['calleridnum'];if(this['channels'][_0x5b71f3['uniqueid']][_0x10b8('0x33')]>0x0){tiff2pdf(_0x5b71f3[_0x10b8('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x432947){logger[_0x10b8('0x28')](_0x5b71f3[_0x10b8('0x24')],_0x10b8('0x37'),_0x432947['message']);attachment[_0x10b8('0x38')]({'name':path['parse'](_0x5b71f3['filename'])['name'],'basename':path[_0x10b8('0x39')](_0x5b71f3[_0x10b8('0x30')])[_0x10b8('0x26')]+_0x10b8('0x3a'),'type':_0x10b8('0x3b')})[_0x10b8('0x3c')](function(_0x203586){faxAccount['notify'](_0x527eae,{'from':_0x5b71f3[_0x10b8('0x36')],'mapKey':_0x10b8('0x3d'),'body':path[_0x10b8('0x39')](_0x5b71f3[_0x10b8('0x30')])[_0x10b8('0x26')]+_0x10b8('0x3a'),'AttachmentId':_0x203586['id']})[_0x10b8('0x3e')](function(_0x159b76){logger[_0x10b8('0x3f')](_0x5b71f3['uniqueid'],'\x20notify\x20',JSON[_0x10b8('0x40')](_0x159b76));});})['catch'](function(_0xd512c0){logger[_0x10b8('0x3f')](_0x5b71f3[_0x10b8('0x24')],_0x10b8('0x41'),JSON['stringify'](_0xd512c0));});});}logger[_0x10b8('0x28')](_0x5b71f3[_0x10b8('0x24')],_0x10b8('0x41'));}};Fax[_0x10b8('0x1f')][_0x10b8('0x42')]=function(_0x169401){if(this[_0x10b8('0x11')][_0x169401[_0x10b8('0x24')]]){_[_0x10b8('0x43')](this[_0x10b8('0xe')][_0x169401[_0x10b8('0x24')]],_[_0x10b8('0x44')](_0x169401,[_0x10b8('0x45'),_0x10b8('0x46')]));}};function updateStatus(_0x371a78){if(_0x371a78[_0x10b8('0x47')]){faxMessage[_0x10b8('0x48')](_0x371a78[_0x10b8('0x47')],{'failMessage':_0x10b8('0x49')})[_0x10b8('0x3c')](function(_0x3b88f8){ut[_0x10b8('0x4a')](_0x10b8('0x4b'),_0x3b88f8);})[_0x10b8('0x3e')](function(_0x2d3e3c){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x2d3e3c);});}else{ut[_0x10b8('0x4a')](_0x10b8('0x4c'));}}Fax[_0x10b8('0x1f')][_0x10b8('0x4d')]=function(_0x46b212,_0x509faf,_0x5df8de){var _0x293309=this;var _0x24b181={};if(_0x509faf){_0x24b181={'read':_0x509faf};}else{_0x24b181={'failMessage':_0x5df8de};}if(this[_0x10b8('0x11')][_0x46b212][_0x10b8('0x47')]){faxMessage[_0x10b8('0x48')](this[_0x10b8('0x11')][_0x46b212][_0x10b8('0x47')],_0x24b181)[_0x10b8('0x3c')](function(_0x251a5d){ut[_0x10b8('0x4a')](_0x10b8('0x4e'),_0x251a5d);})['catch'](function(_0x4e1e75){ut['logger']('[Fax][Message][NoUpdate1]',_0x4e1e75);})[_0x10b8('0x4f')](function(){delete _0x293309[_0x10b8('0xe')][_0x46b212];delete _0x293309['actions'][_0x46b212];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x10b8('0xe')][_0x46b212];delete this[_0x10b8('0x11')][_0x46b212];}};Fax['prototype'][_0x10b8('0x1d')]=function(_0x490609){var _0x2aec85=this;if(this[_0x10b8('0xe')][_0x490609[_0x10b8('0x24')]]){if(this[_0x10b8('0x11')][_0x490609[_0x10b8('0x24')]]){this['channels'][_0x490609[_0x10b8('0x24')]]['id']=this['actions'][_0x490609[_0x10b8('0x24')]]['id'];this[_0x10b8('0xe')][_0x490609[_0x10b8('0x24')]]['name']=this[_0x10b8('0x11')][_0x490609['uniqueid']][_0x10b8('0x26')];}logger[_0x10b8('0x28')](_0x490609[_0x10b8('0x24')],this[_0x10b8('0x11')][_0x490609[_0x10b8('0x24')]]?_0x10b8('0x50'):_0x10b8('0x51'),JSON[_0x10b8('0x40')](this[_0x10b8('0xe')][_0x490609['uniqueid']]));if(this['actions'][_0x490609[_0x10b8('0x24')]]){if(this[_0x10b8('0xe')][_0x490609[_0x10b8('0x24')]][_0x10b8('0x52')]>0x0&&this['channels'][_0x490609['uniqueid']]['faxstatus']===_0x10b8('0x53')){this[_0x10b8('0x4d')](_0x490609[_0x10b8('0x24')],!![]);}else{this[_0x10b8('0x4d')](_0x490609[_0x10b8('0x24')],![],this[_0x10b8('0xe')][_0x490609[_0x10b8('0x24')]][_0x10b8('0x54')]?_0x10b8('0x55')+this[_0x10b8('0xe')][_0x490609[_0x10b8('0x24')]]['faxstatusstring']:_0x10b8('0x56'));}}}};Fax[_0x10b8('0x1f')][_0x10b8('0x57')]=function(_0x558b61){var _0x3f5f61=this;return new BPromise(function(_0x1adb8f,_0x280c36){_0x3f5f61[_0x10b8('0x58')](_0x558b61,_0x3f5f61[_0x10b8('0xf')][_0x558b61[_0x10b8('0x59')]])[_0x10b8('0x3c')](function(_0x31b53c){ut[_0x10b8('0x4a')](_0x10b8('0x5a'),_0x31b53c);_0x1adb8f(ut[_0x10b8('0x5b')](_0x10b8('0x5c')));})['catch'](function(_0x3c7163){ut[_0x10b8('0x4a')](_0x10b8('0x5d'),_0x3c7163);updateStatus(_0x558b61);_0x280c36(ut['message'](_0x10b8('0x5e')));});});};Fax['prototype'][_0x10b8('0x5f')]=function(_0x2c0335){var _0x2e1687=this;return new BPromise(function(_0x4c710d,_0x348052){var _0x327264=_0x2e1687[_0x10b8('0x60')](_0x2e1687[_0x10b8('0xf')][_0x2c0335['FaxAccountId']][_0x10b8('0x61')],_0x2c0335);if(_0x327264['isValid']){_0x4c710d(ut[_0x10b8('0x5b')](_0x10b8('0x62')));}else{_0x348052(ut[_0x10b8('0x5b')](_0x327264[_0x10b8('0x5b')]));}});};function originate(_0x1b07e8,_0x1ac79c,_0x5c8ae9){return new BPromise(function(_0x20e9ce,_0x43619f){if(_0x5c8ae9){var _0x5a923d=util[_0x10b8('0x63')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x1b07e8['path'])[_0x10b8('0x26')],_0x1b07e8['path']);gs[_0x10b8('0x64')](_0x5a923d)[_0x10b8('0x3c')](function(){_0x1b07e8[_0x10b8('0x5')]=util['format']('%s/%s.tif',path['parse'](_0x1b07e8[_0x10b8('0x5')])['dir'],path[_0x10b8('0x39')](_0x1b07e8[_0x10b8('0x5')])['name']);_0x1ac79c['XMF-PATH']=_0x1b07e8[_0x10b8('0x5')];ut[_0x10b8('0x4a')](_0x10b8('0x65'),'');ami['Action'](ut[_0x10b8('0x66')](_0x1b07e8,_0x1ac79c))[_0x10b8('0x3c')](function(_0x3807b6){_0x20e9ce(_0x3807b6);})['catch'](function(_0x1c80a9){_0x43619f(_0x1c80a9);});})[_0x10b8('0x3e')](function(_0x4ec430){_0x43619f(_0x4ec430);});}else{ami[_0x10b8('0x67')](ut[_0x10b8('0x66')](_0x1b07e8,_0x1ac79c))['then'](function(_0x5475b1){_0x20e9ce(_0x5475b1);})['catch'](function(_0x421876){_0x43619f(_0x421876);});}});}Fax[_0x10b8('0x1f')][_0x10b8('0x58')]=function(_0x517a72,_0x254e15){var _0x2fb266=this;return new BPromise(function(_0x5a6d6e,_0x223bae){var _0x5e92ca=uuid['v4']();var _0x373638=ut[_0x10b8('0x68')](_0x517a72,_0x254e15);_0x2fb266[_0x10b8('0x11')][_0x5e92ca]=new Action(_0x5e92ca,_0x254e15,_0x517a72);var _0x25c09a=_0x2fb266['actions'][_0x5e92ca];if(path[_0x10b8('0x39')](_0x517a72[_0x10b8('0x5')])['ext']===_0x10b8('0x3a')){originate(_0x25c09a,_0x373638,!![])['then'](function(_0x3f2d24){_0x5a6d6e(_0x3f2d24);})[_0x10b8('0x3e')](function(_0x20ba73){_0x223bae(_0x20ba73);});}else{originate(_0x25c09a,_0x373638,![])['then'](function(_0x5bc621){_0x5a6d6e(_0x5bc621);})[_0x10b8('0x3e')](function(_0x201b66){_0x223bae(_0x201b66);});}});};Fax[_0x10b8('0x1f')]['isTrunkReachable']=function(_0x2028f7){return!_[_0x10b8('0x69')](_0x2028f7)&&!_[_0x10b8('0x69')](_0x2028f7['name'])&&!_['isNil'](_0x2028f7['active'])&&_0x2028f7[_0x10b8('0x6a')]&&!_['isNil'](this[_0x10b8('0x10')][util['format']('SIP/%s',_0x2028f7[_0x10b8('0x26')])])&&!_[_0x10b8('0x69')](this[_0x10b8('0x10')][util[_0x10b8('0x63')]('SIP/%s',_0x2028f7[_0x10b8('0x26')])][_0x10b8('0x2f')])&&(this[_0x10b8('0x10')][util[_0x10b8('0x63')](_0x10b8('0x6b'),_0x2028f7[_0x10b8('0x26')])]['status']==='reachable'||this[_0x10b8('0x10')][util[_0x10b8('0x63')](_0x10b8('0x6b'),_0x2028f7[_0x10b8('0x26')])][_0x10b8('0x2f')]===_0x10b8('0x6c'));};Fax[_0x10b8('0x1f')][_0x10b8('0x60')]=function(_0x2cb12b,_0x10c625){if(!this[_0x10b8('0x6d')](_0x2cb12b)){ut[_0x10b8('0x4a')](_0x10b8('0x6e'),_[_0x10b8('0x69')](_0x2cb12b)?'':_0x2cb12b[_0x10b8('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x10b8('0x6f')};}if(_[_0x10b8('0x69')](_0x10c625[_0x10b8('0x3d')])){ut['logger'](_0x10b8('0x70'),JSON[_0x10b8('0x40')](_0x10c625));return{'isValid':![],'message':_0x10b8('0x71')};}if(_[_0x10b8('0x69')](_0x10c625['path'])){ut[_0x10b8('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x10b8('0x40')](_0x10c625));return{'isValid':![],'message':_0x10b8('0x72')};}return{'isValid':!![],'message':_0x10b8('0x73')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2b12298..13463b8 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 _0xfaf9=['then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','inspect','resolve'];(function(_0x552ea8,_0x2d9fda){var _0x4353ac=function(_0x2611e){while(--_0x2611e){_0x552ea8['push'](_0x552ea8['shift']());}};_0x4353ac(++_0x2d9fda);}(_0xfaf9,0x143));var _0x9faf=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xfaf9[_0x53cf8e];return _0x459197;};'use strict';var util=require(_0x9faf('0x0'));var BPromise=require(_0x9faf('0x1'));var logger=require(_0x9faf('0x2'))(_0x9faf('0x3'));var _=require(_0x9faf('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x4025d5){return function(_0x3b00ed){logger['error'](_0x4025d5,util[_0x9faf('0x5')](_0x3b00ed,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x433579,_0x48430c){return BPromise[_0x9faf('0x6')]()[_0x9faf('0x7')](faxAccount[_0x9faf('0x8')](_0x433579,_0x48430c))[_0x9faf('0x9')](loggerCatch(_0x9faf('0xa')));}; \ No newline at end of file +var _0x50b9=['notify','resolve','then','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x50b9,0x14e));var _0x950b=function(_0x24dbad,_0x38302c){_0x24dbad=_0x24dbad-0x0;var _0x8624ac=_0x50b9[_0x24dbad];return _0x8624ac;};'use strict';var util=require('util');var BPromise=require(_0x950b('0x0'));var logger=require(_0x950b('0x1'))(_0x950b('0x2'));var _=require(_0x950b('0x3'));var faxAccount=require(_0x950b('0x4'));function loggerCatch(_0xe25414){return function(_0x2e6e22){logger[_0x950b('0x5')](_0xe25414,util['inspect'](_0x2e6e22,{'showHidden':![],'depth':null}));};}exports[_0x950b('0x6')]=function(_0x43c220,_0x4235d3){return BPromise[_0x950b('0x7')]()[_0x950b('0x8')](faxAccount['notify'](_0x43c220,_0x4235d3))['catch'](loggerCatch(_0x950b('0x9')));}; \ 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 77d21f0..caaaa63 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 _0xae58=['fax','bluebird','exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util'];(function(_0x5eedbb,_0x5d4226){var _0x5c1188=function(_0x142101){while(--_0x142101){_0x5eedbb['push'](_0x5eedbb['shift']());}};_0x5c1188(++_0x5d4226);}(_0xae58,0xe9));var _0x8ae5=function(_0x20d54d,_0x1adc8e){_0x20d54d=_0x20d54d-0x0;var _0x516e8b=_0xae58[_0x20d54d];return _0x516e8b;};'use strict';var util=require(_0x8ae5('0x0'));var logger=require('../../../../config/logger')(_0x8ae5('0x1'));var BPromise=require(_0x8ae5('0x2'));var exec=require('child_process')[_0x8ae5('0x3')];exports[_0x8ae5('0x4')]=function(_0x2a1a0){return new BPromise(function(_0x278e16,_0x25bb3c){exec(_0x2a1a0,function(_0x36cb33,_0x4a55d3,_0x4e2730){logger['info'](_0x8ae5('0x5'),_0x4a55d3);if(_0x36cb33){logger[_0x8ae5('0x6')](_0x8ae5('0x5'),_0x8ae5('0x7'),util[_0x8ae5('0x8')](_0x36cb33,{'showHidden':![],'depth':null}),_0x4a55d3,_0x4e2730);_0x25bb3c(_0x36cb33);}_0x278e16(_0x4a55d3);});});}; \ No newline at end of file +var _0xbdbd=['util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x28edc8,_0x2d2749){var _0x3c24fc=function(_0x214d21){while(--_0x214d21){_0x28edc8['push'](_0x28edc8['shift']());}};_0x3c24fc(++_0x2d2749);}(_0xbdbd,0x1c3));var _0xdbdb=function(_0x47b3e2,_0x53155e){_0x47b3e2=_0x47b3e2-0x0;var _0x11918e=_0xbdbd[_0x47b3e2];return _0x11918e;};'use strict';var util=require(_0xdbdb('0x0'));var logger=require(_0xdbdb('0x1'))(_0xdbdb('0x2'));var BPromise=require(_0xdbdb('0x3'));var exec=require(_0xdbdb('0x4'))[_0xdbdb('0x5')];exports[_0xdbdb('0x6')]=function(_0x463e16){return new BPromise(function(_0x542528,_0x2ccae3){exec(_0x463e16,function(_0x163738,_0x537944,_0x443062){logger[_0xdbdb('0x7')](_0xdbdb('0x8'),_0x537944);if(_0x163738){logger[_0xdbdb('0x7')](_0xdbdb('0x8'),_0xdbdb('0x9'),util[_0xdbdb('0xa')](_0x163738,{'showHidden':![],'depth':null}),_0x537944,_0x443062);_0x2ccae3(_0x163738);}_0x542528(_0x537944);});});}; \ 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 09f998e..27024b8 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 _0xec26=['variablesAction','uniqueid','originate','xcally-motion-fax','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xec26,0x1df));var _0x6ec2=function(_0x356a68,_0x168ebe){_0x356a68=_0x356a68-0x0;var _0x3542a6=_0xec26[_0x356a68];return _0x3542a6;};'use strict';var util=require(_0x6ec2('0x0'));var _=require(_0x6ec2('0x1'));var moment=require(_0x6ec2('0x2'));var logger=require(_0x6ec2('0x3'))('fax');exports[_0x6ec2('0x4')]=function(_0x33587a){return{'message':_0x33587a};};exports[_0x6ec2('0x5')]=function(_0x528beb,_0x2d81cc){logger[_0x6ec2('0x6')](_0x528beb,util[_0x6ec2('0x7')](_0x2d81cc,{'showHidden':![],'depth':null}));};exports[_0x6ec2('0x8')]=function(_0x4e08e7,_0x378d2e){var _0x251b63={'XMF-ECM':_0x378d2e[_0x6ec2('0x9')],'XMF-HEADERINFO':_0x378d2e[_0x6ec2('0xa')],'XMF-MINRATE':_0x378d2e[_0x6ec2('0xb')],'XMF-MAXRATE':_0x378d2e[_0x6ec2('0xc')],'XMF-MODEM':util[_0x6ec2('0xd')](_0x6ec2('0xe'),_0x378d2e[_0x6ec2('0xf')]),'XMF-GATEWAY':_0x378d2e[_0x6ec2('0x10')],'XMF-FAXDETECT':_0x378d2e[_0x6ec2('0x11')],'XMF-T38TIMEOUT':_0x378d2e[_0x6ec2('0x12')],'XMF-LOCALSTATIONID':_0x378d2e[_0x6ec2('0x13')],'XMF-PATH':_0x4e08e7[_0x6ec2('0x14')]};return _0x251b63;};exports[_0x6ec2('0x15')]=function(_0x1a8b00,_0x10dfd5){return{'actionid':_0x1a8b00[_0x6ec2('0x16')],'action':_0x6ec2('0x17'),'channel':_0x1a8b00['channel'],'Exten':_0x6ec2('0x18'),'Context':'from-sip','Priority':'1','callerid':util[_0x6ec2('0xd')]('\x22%s\x22\x20<%s>',_0x1a8b00[_0x6ec2('0xa')]?_0x1a8b00[_0x6ec2('0xa')]:'',_0x1a8b00[_0x6ec2('0x13')]),'variable':_0x10dfd5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a8b00[_0x6ec2('0x16')]};}; \ No newline at end of file +var _0x4aa8=['gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem'];(function(_0x3bd347,_0x8ad864){var _0x7f0254=function(_0x20cf7e){while(--_0x20cf7e){_0x3bd347['push'](_0x3bd347['shift']());}};_0x7f0254(++_0x8ad864);}(_0x4aa8,0xeb));var _0x84aa=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x4aa8[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0x84aa('0x0'));var _=require(_0x84aa('0x1'));var moment=require(_0x84aa('0x2'));var logger=require(_0x84aa('0x3'))(_0x84aa('0x4'));exports[_0x84aa('0x5')]=function(_0x1beb1d){return{'message':_0x1beb1d};};exports[_0x84aa('0x6')]=function(_0x530360,_0x5d1340){logger[_0x84aa('0x7')](_0x530360,util[_0x84aa('0x8')](_0x5d1340,{'showHidden':![],'depth':null}));};exports[_0x84aa('0x9')]=function(_0x4e9f4a,_0x285f6b){var _0x16bcbd={'XMF-ECM':_0x285f6b[_0x84aa('0xa')],'XMF-HEADERINFO':_0x285f6b[_0x84aa('0xb')],'XMF-MINRATE':_0x285f6b[_0x84aa('0xc')],'XMF-MAXRATE':_0x285f6b[_0x84aa('0xd')],'XMF-MODEM':util[_0x84aa('0xe')](_0x84aa('0xf'),_0x285f6b[_0x84aa('0x10')]),'XMF-GATEWAY':_0x285f6b[_0x84aa('0x11')],'XMF-FAXDETECT':_0x285f6b[_0x84aa('0x12')],'XMF-T38TIMEOUT':_0x285f6b[_0x84aa('0x13')],'XMF-LOCALSTATIONID':_0x285f6b[_0x84aa('0x14')],'XMF-PATH':_0x4e9f4a[_0x84aa('0x15')]};return _0x16bcbd;};exports[_0x84aa('0x16')]=function(_0x4d528c,_0x5a703a){return{'actionid':_0x4d528c[_0x84aa('0x17')],'action':_0x84aa('0x18'),'channel':_0x4d528c[_0x84aa('0x19')],'Exten':_0x84aa('0x1a'),'Context':'from-sip','Priority':'1','callerid':util[_0x84aa('0xe')](_0x84aa('0x1b'),_0x4d528c[_0x84aa('0xb')]?_0x4d528c[_0x84aa('0xb')]:'',_0x4d528c[_0x84aa('0x14')]),'variable':_0x5a703a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4d528c['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 92cb036..63d5399 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 _0x188d=['getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers'];(function(_0x58c923,_0x2267cb){var _0x50c70e=function(_0xb9edfb){while(--_0xb9edfb){_0x58c923['push'](_0x58c923['shift']());}};_0x50c70e(++_0x2267cb);}(_0x188d,0x146));var _0xd188=function(_0x2a275e,_0x5aa79b){_0x2a275e=_0x2a275e-0x0;var _0x2287fe=_0x188d[_0x2a275e];return _0x2287fe;};'use strict';var util=require(_0xd188('0x0'));var moment=require(_0xd188('0x1'));var server=require(_0xd188('0x2'));var Realtime=require(_0xd188('0x3'));var Report=require(_0xd188('0x4'));var Acw=require(_0xd188('0x5'));var Trigger=require('./trigger');var Dialer=require(_0xd188('0x6'));var Preview=require('./preview');var Fax=require(_0xd188('0x7'));var user=require(_0xd188('0x8'));var voiceQueue=require(_0xd188('0x9'));var voiceQueueReport=require(_0xd188('0xa'));var voiceCallReport=require(_0xd188('0xb'));var trunk=require(_0xd188('0xc'));var trigger=require(_0xd188('0xd'));var template=require(_0xd188('0xe'));var cmHopperHistory=require(_0xd188('0xf'));var campaign=require(_0xd188('0x10'));var voiceExtension=require(_0xd188('0x11'));var faxAccount=require(_0xd188('0x12'));var zendesk=require(_0xd188('0x13'));var salesforce=require(_0xd188('0x14'));var sugarcrm=require(_0xd188('0x15'));var freshdesk=require(_0xd188('0x16'));var desk=require(_0xd188('0x17'));var zoho=require(_0xd188('0x18'));var vtiger=require(_0xd188('0x19'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xd188('0x1a'))(_0xd188('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xd188('0x1c')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xd188('0x1c')](_0xd188('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0xd188('0x1e')](user[_0xd188('0x1f')]())['then'](realtime[_0xd188('0x20')]())['then'](user['getTelephones']())[_0xd188('0x1e')](realtime['initTelephones']())['then'](trunk[_0xd188('0x21')]())[_0xd188('0x1e')](realtime[_0xd188('0x22')]())[_0xd188('0x1e')](voiceQueue[_0xd188('0x23')]())[_0xd188('0x1e')](realtime[_0xd188('0x24')]())[_0xd188('0x1e')](trigger[_0xd188('0x25')]())[_0xd188('0x1e')](realtime[_0xd188('0x26')]())[_0xd188('0x1e')](template[_0xd188('0x27')]())[_0xd188('0x1e')](realtime[_0xd188('0x28')]())['then'](zendesk['getZendeskAccounts']())[_0xd188('0x1e')](realtime[_0xd188('0x29')]())['then'](salesforce[_0xd188('0x2a')]())[_0xd188('0x1e')](realtime[_0xd188('0x2b')]())[_0xd188('0x1e')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xd188('0x2c')]())['then'](freshdesk[_0xd188('0x2d')]())[_0xd188('0x1e')](realtime[_0xd188('0x2e')]())[_0xd188('0x1e')](desk[_0xd188('0x2f')]())['then'](realtime[_0xd188('0x30')]())['then'](zoho[_0xd188('0x31')]())['then'](realtime['initZohoAccounts']())[_0xd188('0x1e')](vtiger[_0xd188('0x32')]())['then'](realtime['initVtigerAccounts']())[_0xd188('0x1e')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xd188('0x33')]())['then'](servicenow[_0xd188('0x34')]())[_0xd188('0x1e')](realtime[_0xd188('0x35')]())['then'](dynamics365[_0xd188('0x36')]())[_0xd188('0x1e')](realtime[_0xd188('0x37')]())[_0xd188('0x1e')](campaign[_0xd188('0x38')]())['then'](realtime[_0xd188('0x39')]())[_0xd188('0x1e')](voiceExtension[_0xd188('0x3a')]())[_0xd188('0x1e')](realtime['initVoiceExtensions']())[_0xd188('0x1e')](faxAccount[_0xd188('0x3b')]())[_0xd188('0x1e')](realtime[_0xd188('0x3c')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xd188('0x1e')](voiceQueueReport[_0xd188('0x3d')]())[_0xd188('0x1e')](realtime[_0xd188('0x3e')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0xd188('0x1e')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0xd188('0x3f')]())['then'](realtime[_0xd188('0x40')]())[_0xd188('0x1e')](voiceCallReport[_0xd188('0x41')]())['then'](realtime[_0xd188('0x42')]())[_0xd188('0x43')](function(_0x2fc9ff){logger[_0xd188('0x44')](_0xd188('0x45'),util[_0xd188('0x46')](_0x2fc9ff,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xd188('0x1e')](function(){return initRealtime();})[_0xd188('0x1e')](function(){return initParams();})[_0xd188('0x1e')](function(){report[_0xd188('0x47')]();setInterval(initRealtime,0x1388);})[_0xd188('0x43')](function(_0xb98f96){logger[_0xd188('0x44')](_0xd188('0x48'),util['inspect'](_0xb98f96,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x5a65=['getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0x5a65,0xa0));var _0x55a6=function(_0x10e546,_0x3c11a6){_0x10e546=_0x10e546-0x0;var _0x17e93d=_0x5a65[_0x10e546];return _0x17e93d;};'use strict';var util=require(_0x55a6('0x0'));var moment=require(_0x55a6('0x1'));var server=require(_0x55a6('0x2'));var Realtime=require(_0x55a6('0x3'));var Report=require(_0x55a6('0x4'));var Acw=require(_0x55a6('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x55a6('0x6'));var Preview=require(_0x55a6('0x7'));var Fax=require(_0x55a6('0x8'));var user=require(_0x55a6('0x9'));var voiceQueue=require(_0x55a6('0xa'));var voiceQueueReport=require(_0x55a6('0xb'));var voiceCallReport=require(_0x55a6('0xc'));var trunk=require(_0x55a6('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x55a6('0xe'));var cmHopperHistory=require(_0x55a6('0xf'));var campaign=require(_0x55a6('0x10'));var voiceExtension=require(_0x55a6('0x11'));var faxAccount=require(_0x55a6('0x12'));var zendesk=require(_0x55a6('0x13'));var salesforce=require(_0x55a6('0x14'));var sugarcrm=require(_0x55a6('0x15'));var freshdesk=require(_0x55a6('0x16'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x55a6('0x17'));var vtiger=require(_0x55a6('0x18'));var freshsales=require(_0x55a6('0x19'));var servicenow=require(_0x55a6('0x1a'));var dynamics365=require(_0x55a6('0x1b'));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(_0x55a6('0x1c'))(_0x55a6('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x55a6('0x1e')](_0x55a6('0x1f'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x55a6('0x1e')](_0x55a6('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x55a6('0x20')]()[_0x55a6('0x21')](user[_0x55a6('0x22')]())[_0x55a6('0x21')](realtime[_0x55a6('0x23')]())[_0x55a6('0x21')](user[_0x55a6('0x24')]())[_0x55a6('0x21')](realtime[_0x55a6('0x25')]())[_0x55a6('0x21')](trunk[_0x55a6('0x26')]())[_0x55a6('0x21')](realtime['initTrunks']())[_0x55a6('0x21')](voiceQueue[_0x55a6('0x27')]())[_0x55a6('0x21')](realtime[_0x55a6('0x28')]())[_0x55a6('0x21')](trigger[_0x55a6('0x29')]())['then'](realtime[_0x55a6('0x2a')]())[_0x55a6('0x21')](template['getTemplates']())[_0x55a6('0x21')](realtime['initTemplates']())['then'](zendesk[_0x55a6('0x2b')]())['then'](realtime['initZendeskAccounts']())[_0x55a6('0x21')](salesforce[_0x55a6('0x2c')]())[_0x55a6('0x21')](realtime[_0x55a6('0x2d')]())['then'](sugarcrm[_0x55a6('0x2e')]())['then'](realtime[_0x55a6('0x2f')]())[_0x55a6('0x21')](freshdesk['getFreshdeskAccounts']())[_0x55a6('0x21')](realtime[_0x55a6('0x30')]())[_0x55a6('0x21')](desk[_0x55a6('0x31')]())[_0x55a6('0x21')](realtime[_0x55a6('0x32')]())[_0x55a6('0x21')](zoho[_0x55a6('0x33')]())[_0x55a6('0x21')](realtime['initZohoAccounts']())[_0x55a6('0x21')](vtiger[_0x55a6('0x34')]())['then'](realtime[_0x55a6('0x35')]())[_0x55a6('0x21')](freshsales['getFreshsalesAccounts']())[_0x55a6('0x21')](realtime['initFreshsalesAccounts']())[_0x55a6('0x21')](servicenow[_0x55a6('0x36')]())[_0x55a6('0x21')](realtime[_0x55a6('0x37')]())['then'](dynamics365[_0x55a6('0x38')]())['then'](realtime['initDynamics365Accounts']())[_0x55a6('0x21')](campaign[_0x55a6('0x39')]())['then'](realtime['initCampaigns']())[_0x55a6('0x21')](voiceExtension[_0x55a6('0x3a')]())[_0x55a6('0x21')](realtime[_0x55a6('0x3b')]())[_0x55a6('0x21')](faxAccount[_0x55a6('0x3c')]())[_0x55a6('0x21')](realtime[_0x55a6('0x3d')]())[_0x55a6('0x21')](function(){return realtime;});}function initParams(){return Promise[_0x55a6('0x20')]()[_0x55a6('0x21')](voiceQueueReport[_0x55a6('0x3e')]())[_0x55a6('0x21')](realtime[_0x55a6('0x3f')]())[_0x55a6('0x21')](cmHopperHistory[_0x55a6('0x40')]())[_0x55a6('0x21')](realtime[_0x55a6('0x41')]())['then'](cmHopperHistory[_0x55a6('0x42')]())[_0x55a6('0x21')](realtime['initCampaignHopperHistory']())[_0x55a6('0x21')](voiceCallReport[_0x55a6('0x43')]())[_0x55a6('0x21')](realtime[_0x55a6('0x44')]())['catch'](function(_0x49c207){logger[_0x55a6('0x45')](_0x55a6('0x46'),util[_0x55a6('0x47')](_0x49c207,{'showHidden':![],'depth':null}));});}function main(){return server[_0x55a6('0x48')](realtime,preview,fax)[_0x55a6('0x21')](function(){return initRealtime();})[_0x55a6('0x21')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x392a3c){logger['error'](_0x55a6('0x49'),util[_0x55a6('0x47')](_0x392a3c,{'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 b136514..84b14fa 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 _0xa322=['voiceStatusTime','voiceStatusCallerIdNumber','stringify','emit','user:presence','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xa322,0x15c));var _0x2a32=function(_0x4eb582,_0x330781){_0x4eb582=_0x4eb582-0x0;var _0x32d5de=_0xa322[_0x4eb582];return _0x32d5de;};'use strict';var _=require(_0x2a32('0x0'));var util=require(_0x2a32('0x1'));var moment=require(_0x2a32('0x2'));var md5=require(_0x2a32('0x3'));var Redis=require('ioredis');var config=require(_0x2a32('0x4'));config[_0x2a32('0x5')]=_[_0x2a32('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a32('0x5')]));function Agent(_0x4bf3a8){this['id']=_0x4bf3a8['id']||0x0;this[_0x2a32('0x7')]=_0x4bf3a8['name']||'';this['email']=_0x4bf3a8[_0x2a32('0x8')]||'';this[_0x2a32('0x9')]=_0x4bf3a8[_0x2a32('0x9')]||'';this['fullname']=_0x4bf3a8[_0x2a32('0xa')]||'';this[_0x2a32('0xb')]='unknown';this[_0x2a32('0xc')]=0x0;this[_0x2a32('0xd')]=_0x2a32('0xe');this[_0x2a32('0xf')]='';this[_0x2a32('0x10')]='';this[_0x2a32('0x11')]='';this[_0x2a32('0x12')]='';this[_0x2a32('0x13')]=_0x4bf3a8[_0x2a32('0x13')]||![];this[_0x2a32('0x14')]=_0x2a32('0xe');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x2a32('0x15')]='';this[_0x2a32('0x16')]=![];this[_0x2a32('0x17')]=![];this[_0x2a32('0x3')]='';}Agent[_0x2a32('0x18')][_0x2a32('0x19')]=function(_0xf0195){var _0x1b9305;if(_0xf0195&&_0xf0195['state']){_0x1b9305=_0xf0195[_0x2a32('0xb')][_0x2a32('0x1a')]();switch(_0x1b9305){case _0x2a32('0x1b'):_0x1b9305=_0x2a32('0x1c');break;case _0x2a32('0x1d'):_0x1b9305=_0x2a32('0x1e');break;}}if(_0x1b9305&&this[_0x2a32('0x14')]!==_0x1b9305||_0xf0195[_0x2a32('0x1f')]){this['voiceStatusTime']=_['toNumber'](moment()['format']('x'));}if(_0x1b9305){this[_0x2a32('0x14')]=_0x1b9305;}var _0x47fc19={'id':this['id'],'name':this['name'],'email':this[_0x2a32('0x8')],'accountcode':this[_0x2a32('0x9')],'fullname':this['fullname'],'state':this[_0x2a32('0xb')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x2a32('0xf')],'online':this['online'],'voiceStatus':this[_0x2a32('0x14')],'voiceStatusTime':this[_0x2a32('0x20')],'voiceStatusCallerIdNumber':this[_0x2a32('0x21')],'voiceStatusQueue':this[_0x2a32('0x15')],'interface':this[_0x2a32('0x12')],'onhold':this[_0x2a32('0x16')]};var _0x41fc2d=md5(JSON[_0x2a32('0x22')](_0x47fc19));if(this[_0x2a32('0x3')]!==_0x41fc2d){this[_0x2a32('0x3')]=_0x41fc2d;io['to'](util['format']('user:%s',_0x47fc19[_0x2a32('0x7')]))[_0x2a32('0x23')]('user:save',_0x47fc19);io[_0x2a32('0x23')](_0x2a32('0x24'),_0x47fc19);}};module[_0x2a32('0x25')]=Agent; \ No newline at end of file +var _0x67da=['state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','stringify','emit','user:save','user:presence','exports','lodash','util','moment','redis','defaults','localhost','name','email','accountcode','fullname'];(function(_0x2fd8fb,_0x20e366){var _0x107495=function(_0x10e832){while(--_0x10e832){_0x2fd8fb['push'](_0x2fd8fb['shift']());}};_0x107495(++_0x20e366);}(_0x67da,0x198));var _0xa67d=function(_0x1a1947,_0x54798f){_0x1a1947=_0x1a1947-0x0;var _0x5781ec=_0x67da[_0x1a1947];return _0x5781ec;};'use strict';var _=require(_0xa67d('0x0'));var util=require(_0xa67d('0x1'));var moment=require(_0xa67d('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa67d('0x3')]=_[_0xa67d('0x4')](config[_0xa67d('0x3')],{'host':_0xa67d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa67d('0x3')]));function Agent(_0x578a75){this['id']=_0x578a75['id']||0x0;this[_0xa67d('0x6')]=_0x578a75[_0xa67d('0x6')]||'';this[_0xa67d('0x7')]=_0x578a75[_0xa67d('0x7')]||'';this[_0xa67d('0x8')]=_0x578a75[_0xa67d('0x8')]||'';this[_0xa67d('0x9')]=_0x578a75[_0xa67d('0x9')]||'';this[_0xa67d('0xa')]=_0xa67d('0xb');this[_0xa67d('0xc')]=0x0;this[_0xa67d('0xd')]=_0xa67d('0xb');this[_0xa67d('0xe')]='';this[_0xa67d('0xf')]='';this[_0xa67d('0x10')]='';this[_0xa67d('0x11')]='';this[_0xa67d('0x12')]=_0x578a75[_0xa67d('0x12')]||![];this[_0xa67d('0x13')]=_0xa67d('0xb');this[_0xa67d('0x14')]=0x0;this[_0xa67d('0x15')]='';this[_0xa67d('0x16')]='';this[_0xa67d('0x17')]=![];this['local']=![];this[_0xa67d('0x18')]='';}Agent[_0xa67d('0x19')][_0xa67d('0x1a')]=function(_0xe43fa7){var _0x1feba6;if(_0xe43fa7&&_0xe43fa7[_0xa67d('0xa')]){_0x1feba6=_0xe43fa7[_0xa67d('0xa')]['toLowerCase']();switch(_0x1feba6){case _0xa67d('0x1b'):_0x1feba6='idle';break;case _0xa67d('0x1c'):_0x1feba6=_0xa67d('0x1d');break;}}if(_0x1feba6&&this[_0xa67d('0x13')]!==_0x1feba6||_0xe43fa7[_0xa67d('0x1e')]){this['voiceStatusTime']=_[_0xa67d('0x1f')](moment()[_0xa67d('0x20')]('x'));}if(_0x1feba6){this[_0xa67d('0x13')]=_0x1feba6;}var _0x386cd2={'id':this['id'],'name':this[_0xa67d('0x6')],'email':this[_0xa67d('0x7')],'accountcode':this[_0xa67d('0x8')],'fullname':this[_0xa67d('0x9')],'state':this['state'],'stateTime':this[_0xa67d('0xc')],'status':this[_0xa67d('0xd')],'address':this[_0xa67d('0xe')],'online':this[_0xa67d('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xa67d('0x15')],'voiceStatusQueue':this[_0xa67d('0x16')],'interface':this[_0xa67d('0x11')],'onhold':this[_0xa67d('0x17')]};var _0x2d38b1=md5(JSON[_0xa67d('0x21')](_0x386cd2));if(this[_0xa67d('0x18')]!==_0x2d38b1){this['md5']=_0x2d38b1;io['to'](util[_0xa67d('0x20')]('user:%s',_0x386cd2[_0xa67d('0x6')]))[_0xa67d('0x22')](_0xa67d('0x23'),_0x386cd2);io[_0xa67d('0x22')](_0xa67d('0x24'),_0x386cd2);}};module[_0xa67d('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 282e585..f31641d 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 _0x248d=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x1daeaa,_0x102077){var _0x21e49e=function(_0x17628c){while(--_0x17628c){_0x1daeaa['push'](_0x1daeaa['shift']());}};_0x21e49e(++_0x102077);}(_0x248d,0x14a));var _0xd248=function(_0x38b71d,_0x142312){_0x38b71d=_0x38b71d-0x0;var _0xf5d097=_0x248d[_0x38b71d];return _0xf5d097;};'use strict';function Campaign(_0x39d531){this['id']=_0x39d531['id']||0x0;this[_0xd248('0x0')]=_0x39d531[_0xd248('0x0')]||'';this['type']=_0x39d531[_0xd248('0x1')]||'campaign';this[_0xd248('0x2')]=0x0;this[_0xd248('0x3')]=0x0;this[_0xd248('0x4')]=0x0;this[_0xd248('0x5')]=0x0;this['message']='';this[_0xd248('0x6')]=!![];this[_0xd248('0x7')]=_0x39d531[_0xd248('0x7')];this[_0xd248('0x8')]=_0x39d531['limitCalls'];this['dialTimezone']=_0x39d531[_0xd248('0x9')]||null;this[_0xd248('0xa')]=_0x39d531['dialGlobalInterval']?_0x39d531[_0xd248('0xa')]:null;this['dialOriginateCallerIdName']=_0x39d531[_0xd248('0xb')];this[_0xd248('0xc')]=_0x39d531[_0xd248('0xc')];this[_0xd248('0xd')]=_0x39d531[_0xd248('0xd')]||0x1e;this[_0xd248('0xe')]=_0x39d531[_0xd248('0xe')];this[_0xd248('0xf')]=_0x39d531[_0xd248('0xf')];this[_0xd248('0x10')]=_0x39d531['dialBusyMaxRetry'];this[_0xd248('0x11')]=_0x39d531[_0xd248('0x11')];this['dialNoAnswerMaxRetry']=_0x39d531[_0xd248('0x12')];this[_0xd248('0x13')]=_0x39d531[_0xd248('0x13')];this[_0xd248('0x14')]=_0x39d531[_0xd248('0x14')];this['dialNoSuchNumberMaxRetry']=_0x39d531[_0xd248('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x39d531['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd248('0x16')]=_0x39d531['dialDropMaxRetry']||0x3;this[_0xd248('0x17')]=_0x39d531[_0xd248('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x39d531[_0xd248('0x18')]||0x3;this[_0xd248('0x19')]=_0x39d531[_0xd248('0x19')]||0x96;this[_0xd248('0x1a')]=_0x39d531[_0xd248('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x39d531[_0xd248('0x1b')]||0x96;this[_0xd248('0x1c')]=_0x39d531[_0xd248('0x1c')]||0x3;this[_0xd248('0x1d')]=_0x39d531[_0xd248('0x1d')]||0x96;this[_0xd248('0x1e')]=_0x39d531[_0xd248('0x1e')]||_0xd248('0x1f');this[_0xd248('0x20')]=_0x39d531[_0xd248('0x20')]||undefined;this[_0xd248('0x21')]=_0x39d531[_0xd248('0x21')]||undefined;this[_0xd248('0x22')]=_0x39d531['dialCutDigit']||undefined;this['TrunkBackup']=_0x39d531[_0xd248('0x23')]?_0x39d531['TrunkBackup']:undefined;this[_0xd248('0x24')]=_0x39d531[_0xd248('0x24')]?_0x39d531[_0xd248('0x24')]:undefined;this[_0xd248('0x25')]=_0x39d531[_0xd248('0x25')]?_0x39d531[_0xd248('0x25')]:undefined;this['SquareProject']=_0x39d531[_0xd248('0x26')]?_0x39d531[_0xd248('0x26')]:undefined;this[_0xd248('0x27')]=_0x39d531[_0xd248('0x26')]?_0x39d531['SquareProject'][_0xd248('0x0')]:undefined;this['dialAMDActive']=_0x39d531[_0xd248('0x28')]||![];this[_0xd248('0x29')]=_0x39d531[_0xd248('0x29')];this[_0xd248('0x2a')]=_0x39d531[_0xd248('0x2a')];this[_0xd248('0x2b')]=_0x39d531[_0xd248('0x2b')];this['dialAMDTotalAnalysisTime']=_0x39d531[_0xd248('0x2c')];this[_0xd248('0x2d')]=_0x39d531[_0xd248('0x2d')];this['dialAMDBetweenWordsSilence']=_0x39d531['dialAMDBetweenWordsSilence'];this[_0xd248('0x2e')]=_0x39d531['dialAMDMaximumNumberOfWords'];this[_0xd248('0x2f')]=_0x39d531[_0xd248('0x2f')];this['dialAMDMaximumWordLength']=_0x39d531[_0xd248('0x30')];}module[_0xd248('0x31')]=Campaign; \ No newline at end of file +var _0x91ce=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x42cccc,_0x2890f6){var _0x18ad85=function(_0x15216e){while(--_0x15216e){_0x42cccc['push'](_0x42cccc['shift']());}};_0x18ad85(++_0x2890f6);}(_0x91ce,0xf1));var _0xe91c=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x91ce[_0x18b344];return _0x5ef6bb;};'use strict';function Campaign(_0x2ad285){this['id']=_0x2ad285['id']||0x0;this[_0xe91c('0x0')]=_0x2ad285[_0xe91c('0x0')]||'';this[_0xe91c('0x1')]=_0x2ad285[_0xe91c('0x1')]||'campaign';this['originated']=0x0;this['temp']=0x0;this[_0xe91c('0x2')]=0x0;this[_0xe91c('0x3')]=0x0;this['message']='';this[_0xe91c('0x4')]=!![];this[_0xe91c('0x5')]=_0x2ad285['active'];this[_0xe91c('0x6')]=_0x2ad285[_0xe91c('0x6')];this[_0xe91c('0x7')]=_0x2ad285[_0xe91c('0x7')]||null;this[_0xe91c('0x8')]=_0x2ad285[_0xe91c('0x8')]?_0x2ad285[_0xe91c('0x8')]:null;this[_0xe91c('0x9')]=_0x2ad285[_0xe91c('0x9')];this[_0xe91c('0xa')]=_0x2ad285[_0xe91c('0xa')];this[_0xe91c('0xb')]=_0x2ad285[_0xe91c('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x2ad285[_0xe91c('0xc')];this['dialCongestionRetryFrequency']=_0x2ad285[_0xe91c('0xd')];this[_0xe91c('0xe')]=_0x2ad285[_0xe91c('0xe')];this['dialBusyRetryFrequency']=_0x2ad285[_0xe91c('0xf')];this[_0xe91c('0x10')]=_0x2ad285[_0xe91c('0x10')];this[_0xe91c('0x11')]=_0x2ad285[_0xe91c('0x11')];this[_0xe91c('0x12')]=_0x2ad285[_0xe91c('0x12')];this[_0xe91c('0x13')]=_0x2ad285[_0xe91c('0x13')]||0x3;this[_0xe91c('0x14')]=_0x2ad285[_0xe91c('0x14')]||0x96;this[_0xe91c('0x15')]=_0x2ad285[_0xe91c('0x15')]||0x3;this['dialDropRetryFrequency']=_0x2ad285[_0xe91c('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x2ad285[_0xe91c('0x17')]||0x3;this[_0xe91c('0x18')]=_0x2ad285[_0xe91c('0x18')]||0x96;this[_0xe91c('0x19')]=_0x2ad285[_0xe91c('0x19')]||0x3;this[_0xe91c('0x1a')]=_0x2ad285['dialMachineRetryFrequency']||0x96;this[_0xe91c('0x1b')]=_0x2ad285[_0xe91c('0x1b')]||0x3;this[_0xe91c('0x1c')]=_0x2ad285[_0xe91c('0x1c')]||0x96;this[_0xe91c('0x1d')]=_0x2ad285[_0xe91c('0x1d')]||_0xe91c('0x1e');this[_0xe91c('0x1f')]=_0x2ad285['dialPrefix']||undefined;this[_0xe91c('0x20')]=_0x2ad285[_0xe91c('0x20')]||undefined;this['dialCutDigit']=_0x2ad285['dialCutDigit']||undefined;this['TrunkBackup']=_0x2ad285[_0xe91c('0x21')]?_0x2ad285[_0xe91c('0x21')]:undefined;this[_0xe91c('0x22')]=_0x2ad285[_0xe91c('0x22')]?_0x2ad285[_0xe91c('0x22')]:undefined;this[_0xe91c('0x23')]=_0x2ad285[_0xe91c('0x23')]?_0x2ad285[_0xe91c('0x23')]:undefined;this[_0xe91c('0x24')]=_0x2ad285[_0xe91c('0x24')]?_0x2ad285[_0xe91c('0x24')]:undefined;this[_0xe91c('0x25')]=_0x2ad285['SquareProject']?_0x2ad285[_0xe91c('0x24')][_0xe91c('0x0')]:undefined;this['dialAMDActive']=_0x2ad285[_0xe91c('0x26')]||![];this[_0xe91c('0x27')]=_0x2ad285['dialAMDInitialSilence'];this[_0xe91c('0x28')]=_0x2ad285[_0xe91c('0x28')];this[_0xe91c('0x29')]=_0x2ad285[_0xe91c('0x29')];this[_0xe91c('0x2a')]=_0x2ad285[_0xe91c('0x2a')];this['dialAMDMinWordLength']=_0x2ad285[_0xe91c('0x2b')];this[_0xe91c('0x2c')]=_0x2ad285[_0xe91c('0x2c')];this[_0xe91c('0x2d')]=_0x2ad285[_0xe91c('0x2d')];this[_0xe91c('0x2e')]=_0x2ad285['dialAMDSilenceThreshold'];this[_0xe91c('0x2f')]=_0x2ad285[_0xe91c('0x2f')];}module[_0xe91c('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index d4cc521..4b5a5f0 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 _0xdfb1=['transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag','monitor','monitorFilename','queue','monitors'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x2b5e09,_0x5e15d8){_0x2b5e09=_0x2b5e09-0x0;var _0x5ae0cc=_0xdfb1[_0x2b5e09];return _0x5ae0cc;};'use strict';function Channel(){this[_0x1dfb('0x0')]=null;this[_0x1dfb('0x1')]='';this[_0x1dfb('0x2')]='';this[_0x1dfb('0x3')]=0x0;this['calleridname']='';this[_0x1dfb('0x4')]=undefined;this[_0x1dfb('0x5')]=undefined;this[_0x1dfb('0x6')]=0x0;this[_0x1dfb('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x1dfb('0x8')]=![];this[_0x1dfb('0x9')]=null;this[_0x1dfb('0xa')]=null;this['unmanaged']=![];this[_0x1dfb('0xb')]=![];this[_0x1dfb('0xc')]='';this[_0x1dfb('0xd')]='';this[_0x1dfb('0xe')]=0x0;this['billableseconds']=0x0;this[_0x1dfb('0xf')]=0x0;this[_0x1dfb('0x10')]=null;this[_0x1dfb('0x11')]=null;this['disposition']=null;this[_0x1dfb('0x12')]=![];this[_0x1dfb('0x13')]=null;this[_0x1dfb('0x14')]=null;this[_0x1dfb('0x15')]=[];this[_0x1dfb('0x16')]=undefined;this[_0x1dfb('0x17')]=undefined;this[_0x1dfb('0x18')]=undefined;this[_0x1dfb('0x19')]=0x0;}module[_0x1dfb('0x1a')]=Channel; \ No newline at end of file +var _0x8227=['unmanaged','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','channel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime'];(function(_0x58389d,_0x3137df){var _0x2be20a=function(_0x2b6f46){while(--_0x2b6f46){_0x58389d['push'](_0x58389d['shift']());}};_0x2be20a(++_0x3137df);}(_0x8227,0x146));var _0x7822=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8227[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this['starttime']=null;this[_0x7822('0x0')]='';this['destinationchannel']='';this[_0x7822('0x1')]=0x0;this[_0x7822('0x2')]='';this[_0x7822('0x3')]=undefined;this[_0x7822('0x4')]=undefined;this['accountcode']=0x0;this[_0x7822('0x5')]='';this[_0x7822('0x6')]=0x0;this[_0x7822('0x7')]=0x0;this[_0x7822('0x8')]=0x0;this[_0x7822('0x9')]=![];this[_0x7822('0xa')]=null;this[_0x7822('0xb')]=null;this[_0x7822('0xc')]=![];this['abandoned']=![];this[_0x7822('0xd')]='';this['lastdata']='';this[_0x7822('0xe')]=0x0;this[_0x7822('0xf')]=0x0;this[_0x7822('0x10')]=0x0;this[_0x7822('0x11')]=null;this[_0x7822('0x12')]=null;this[_0x7822('0x13')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x7822('0x14')]=null;this['monitors']=[];this[_0x7822('0x15')]=undefined;this[_0x7822('0x16')]=undefined;this[_0x7822('0x17')]=undefined;this[_0x7822('0x18')]=0x0;}module[_0x7822('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 7ddd46a..25f8114 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 _0x035e=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x566da6,_0x1db6a1){var _0x35dd63=function(_0x4670a8){while(--_0x4670a8){_0x566da6['push'](_0x566da6['shift']());}};_0x35dd63(++_0x1db6a1);}(_0x035e,0x1ac));var _0xe035=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x035e[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x37e7bf){this['id']=_0x37e7bf['id']||0x0;this[_0xe035('0x0')]=_0x37e7bf[_0xe035('0x0')]||'';this[_0xe035('0x1')]=_0x37e7bf['username']||'';this['remoteUri']=_0x37e7bf[_0xe035('0x2')]||'';this[_0xe035('0x3')]=_0x37e7bf[_0xe035('0x3')]||'';this['password']=_0x37e7bf[_0xe035('0x4')]||'';this[_0xe035('0x5')]=_0x37e7bf['consumerKey']||'';this[_0xe035('0x6')]=_0x37e7bf[_0xe035('0x6')]||'';this[_0xe035('0x7')]=_0x37e7bf[_0xe035('0x7')]||'';this[_0xe035('0x8')]=_0x37e7bf[_0xe035('0x8')]||'';this[_0xe035('0x9')]=_0x37e7bf[_0xe035('0x9')]||'';this[_0xe035('0xa')]=_0x37e7bf[_0xe035('0xa')]||'';this[_0xe035('0xb')]=_0x37e7bf[_0xe035('0xb')]||{};}module[_0xe035('0xc')]=DeskAccount; \ No newline at end of file +var _0x430e=['exports','username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x19dcb5,_0x38a067){var _0x490ba0=function(_0xb13da5){while(--_0xb13da5){_0x19dcb5['push'](_0x19dcb5['shift']());}};_0x490ba0(++_0x38a067);}(_0x430e,0xa6));var _0xe430=function(_0x203387,_0x25ee77){_0x203387=_0x203387-0x0;var _0x358e6b=_0x430e[_0x203387];return _0x358e6b;};'use strict';function DeskAccount(_0x18d602){this['id']=_0x18d602['id']||0x0;this['name']=_0x18d602['name']||'';this[_0xe430('0x0')]=_0x18d602[_0xe430('0x0')]||'';this[_0xe430('0x1')]=_0x18d602[_0xe430('0x1')]||'';this[_0xe430('0x2')]=_0x18d602['authType']||'';this[_0xe430('0x3')]=_0x18d602[_0xe430('0x3')]||'';this['consumerKey']=_0x18d602['consumerKey']||'';this[_0xe430('0x4')]=_0x18d602[_0xe430('0x4')]||'';this[_0xe430('0x5')]=_0x18d602['token']||'';this[_0xe430('0x6')]=_0x18d602[_0xe430('0x6')]||'';this[_0xe430('0x7')]=_0x18d602['type']||'';this[_0xe430('0x8')]=_0x18d602[_0xe430('0x8')]||'';this[_0xe430('0x9')]=_0x18d602[_0xe430('0x9')]||{};}module[_0xe430('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index aa4fdc8..ac6dc4f 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 _0x8c4d=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name'];(function(_0x46fe9d,_0x393461){var _0x3387cf=function(_0x2deee9){while(--_0x2deee9){_0x46fe9d['push'](_0x46fe9d['shift']());}};_0x3387cf(++_0x393461);}(_0x8c4d,0x180));var _0xd8c4=function(_0x40b48b,_0x5c29e7){_0x40b48b=_0x40b48b-0x0;var _0x5cbd32=_0x8c4d[_0x40b48b];return _0x5cbd32;};'use strict';function Dynamics365Account(_0x54d66c){this['id']=_0x54d66c['id']||0x0;this[_0xd8c4('0x0')]=_0x54d66c['name']||'';this[_0xd8c4('0x1')]=_0x54d66c[_0xd8c4('0x1')]||'';this['password']=_0x54d66c[_0xd8c4('0x2')]||'';this['remoteUri']=_0x54d66c[_0xd8c4('0x3')]||'';this[_0xd8c4('0x4')]=_0x54d66c['tenantId']||'';this[_0xd8c4('0x5')]=_0x54d66c[_0xd8c4('0x5')]||'';this[_0xd8c4('0x6')]=_0x54d66c[_0xd8c4('0x6')]||{};this[_0xd8c4('0x7')]=_0x54d66c[_0xd8c4('0x7')]||'';this[_0xd8c4('0x8')]=_0x54d66c[_0xd8c4('0x8')]||![];this[_0xd8c4('0x9')]=_0x54d66c[_0xd8c4('0x9')]||{};this[_0xd8c4('0xa')]=_0x54d66c[_0xd8c4('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x8ea2=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x24a5c7,_0x1bb162){var _0x3c6bbd=function(_0x12145f){while(--_0x12145f){_0x24a5c7['push'](_0x24a5c7['shift']());}};_0x3c6bbd(++_0x1bb162);}(_0x8ea2,0x165));var _0x28ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea2[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x5bf92c){this['id']=_0x5bf92c['id']||0x0;this[_0x28ea('0x0')]=_0x5bf92c[_0x28ea('0x0')]||'';this[_0x28ea('0x1')]=_0x5bf92c[_0x28ea('0x1')]||'';this[_0x28ea('0x2')]=_0x5bf92c[_0x28ea('0x2')]||'';this['remoteUri']=_0x5bf92c[_0x28ea('0x3')]||'';this[_0x28ea('0x4')]=_0x5bf92c[_0x28ea('0x4')]||'';this[_0x28ea('0x5')]=_0x5bf92c[_0x28ea('0x5')]||'';this[_0x28ea('0x6')]=_0x5bf92c['clientSecret']||{};this[_0x28ea('0x7')]=_0x5bf92c[_0x28ea('0x7')]||'';this[_0x28ea('0x8')]=_0x5bf92c[_0x28ea('0x8')]||![];this[_0x28ea('0x9')]=_0x5bf92c[_0x28ea('0x9')]||{};this['CloudProvider']=_0x5bf92c[_0x28ea('0xa')]||{};}module[_0x28ea('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 852b917..b8cc7e3 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 _0x4c18=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x4c18,0x11a));var _0x84c1=function(_0x10b357,_0x43b0f4){_0x10b357=_0x10b357-0x0;var _0x250421=_0x4c18[_0x10b357];return _0x250421;};'use strict';function FaxAccount(_0x59660a){this['id']=_0x59660a['id']||0x0;this[_0x84c1('0x0')]=_0x59660a['name']||'';this[_0x84c1('0x1')]=_0x59660a[_0x84c1('0x1')];this[_0x84c1('0x2')]=_0x59660a[_0x84c1('0x2')];this[_0x84c1('0x3')]=_0x59660a[_0x84c1('0x3')];this[_0x84c1('0x4')]=_0x59660a[_0x84c1('0x4')];this[_0x84c1('0x5')]=_0x59660a[_0x84c1('0x5')]||0x960;this['maxrate']=_0x59660a['maxrate']||0x3840;this[_0x84c1('0x6')]=_0x59660a[_0x84c1('0x6')]||_0x84c1('0x7');this[_0x84c1('0x8')]=_0x59660a['gateway']||'no';this[_0x84c1('0x9')]=_0x59660a[_0x84c1('0x9')]||'no';this[_0x84c1('0xa')]=_0x59660a[_0x84c1('0xa')]||0x1388;this[_0x84c1('0xb')]=_0x59660a[_0x84c1('0xb')]||'SIP';this[_0x84c1('0xc')]=_0x59660a[_0x84c1('0xc')]?_0x59660a[_0x84c1('0xc')]:undefined;this[_0x84c1('0xd')]=_0x59660a[_0x84c1('0xd')];this[_0x84c1('0xe')]=_0x59660a[_0x84c1('0xe')];}module[_0x84c1('0xf')]=FaxAccount; \ No newline at end of file +var _0xf16f=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x53a48e,_0x9f806c){var _0x15aa47=function(_0xf816f6){while(--_0xf816f6){_0x53a48e['push'](_0x53a48e['shift']());}};_0x15aa47(++_0x9f806c);}(_0xf16f,0x141));var _0xff16=function(_0x358724,_0x6c8594){_0x358724=_0x358724-0x0;var _0x2afe85=_0xf16f[_0x358724];return _0x2afe85;};'use strict';function FaxAccount(_0x49e16b){this['id']=_0x49e16b['id']||0x0;this[_0xff16('0x0')]=_0x49e16b[_0xff16('0x0')]||'';this[_0xff16('0x1')]=_0x49e16b['description'];this[_0xff16('0x2')]=_0x49e16b[_0xff16('0x2')];this[_0xff16('0x3')]=_0x49e16b[_0xff16('0x3')];this[_0xff16('0x4')]=_0x49e16b[_0xff16('0x4')];this[_0xff16('0x5')]=_0x49e16b[_0xff16('0x5')]||0x960;this[_0xff16('0x6')]=_0x49e16b[_0xff16('0x6')]||0x3840;this[_0xff16('0x7')]=_0x49e16b[_0xff16('0x7')]||_0xff16('0x8');this[_0xff16('0x9')]=_0x49e16b[_0xff16('0x9')]||'no';this[_0xff16('0xa')]=_0x49e16b[_0xff16('0xa')]||'no';this[_0xff16('0xb')]=_0x49e16b[_0xff16('0xb')]||0x1388;this[_0xff16('0xc')]=_0x49e16b[_0xff16('0xc')]||_0xff16('0xd');this[_0xff16('0xe')]=_0x49e16b['Trunk']?_0x49e16b[_0xff16('0xe')]:undefined;this[_0xff16('0xf')]=_0x49e16b['ListId'];this[_0xff16('0x10')]=_0x49e16b['key'];}module[_0xff16('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b5a0ba2..ca333c2 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 _0x5821=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5b74e6,_0x45fb0c){var _0x18c866=function(_0x133831){while(--_0x133831){_0x5b74e6['push'](_0x5b74e6['shift']());}};_0x18c866(++_0x45fb0c);}(_0x5821,0x1cc));var _0x1582=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5821[_0x5b644e];return _0x49c6bf;};'use strict';function FreshdeskAccount(_0x204037){this['id']=_0x204037['id']||0x0;this[_0x1582('0x0')]=_0x204037[_0x1582('0x0')]||'';this[_0x1582('0x1')]=_0x204037[_0x1582('0x1')]||'';this[_0x1582('0x2')]=_0x204037['token']||'';this['remoteUri']=_0x204037[_0x1582('0x3')]||'';this['serverUrl']=_0x204037[_0x1582('0x4')]||'';this[_0x1582('0x5')]=_0x204037[_0x1582('0x5')]||{};}module[_0x1582('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x56a3=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x5b6bf7,_0xa75fd8){var _0x2eeb02=function(_0x410ea6){while(--_0x410ea6){_0x5b6bf7['push'](_0x5b6bf7['shift']());}};_0x2eeb02(++_0xa75fd8);}(_0x56a3,0xe7));var _0x356a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56a3[_0x20a584];return _0x4b41a8;};'use strict';function FreshdeskAccount(_0x447cc9){this['id']=_0x447cc9['id']||0x0;this['name']=_0x447cc9['name']||'';this['username']=_0x447cc9[_0x356a('0x0')]||'';this[_0x356a('0x1')]=_0x447cc9[_0x356a('0x2')]||'';this[_0x356a('0x3')]=_0x447cc9['remoteUri']||'';this[_0x356a('0x4')]=_0x447cc9[_0x356a('0x4')]||'';this[_0x356a('0x5')]=_0x447cc9[_0x356a('0x5')]||{};}module[_0x356a('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 84423f1..c47a63e 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 _0x7722=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0x7722,0x14e));var _0x2772=function(_0x300d0e,_0x4fcd1b){_0x300d0e=_0x300d0e-0x0;var _0x1903cb=_0x7722[_0x300d0e];return _0x1903cb;};'use strict';function FreshsalesAccount(_0xb85768){this['id']=_0xb85768['id']||0x0;this[_0x2772('0x0')]=_0xb85768[_0x2772('0x0')]||'';this[_0x2772('0x1')]=_0xb85768[_0x2772('0x1')]||'';this[_0x2772('0x2')]=_0xb85768[_0x2772('0x3')]||'';this[_0x2772('0x4')]=_0xb85768[_0x2772('0x4')]||'';this['serverUrl']=_0xb85768[_0x2772('0x5')]||'';this['Configurations']=_0xb85768[_0x2772('0x6')]||{};}module[_0x2772('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xfafd=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x1deb48,_0x30ea89){var _0x4b957f=function(_0x4f7dc8){while(--_0x4f7dc8){_0x1deb48['push'](_0x1deb48['shift']());}};_0x4b957f(++_0x30ea89);}(_0xfafd,0xcc));var _0xdfaf=function(_0x2ce19f,_0x409b83){_0x2ce19f=_0x2ce19f-0x0;var _0x16a0c5=_0xfafd[_0x2ce19f];return _0x16a0c5;};'use strict';function FreshsalesAccount(_0x500079){this['id']=_0x500079['id']||0x0;this[_0xdfaf('0x0')]=_0x500079[_0xdfaf('0x0')]||'';this[_0xdfaf('0x1')]=_0x500079[_0xdfaf('0x1')]||'';this[_0xdfaf('0x2')]=_0x500079[_0xdfaf('0x3')]||'';this[_0xdfaf('0x4')]=_0x500079[_0xdfaf('0x4')]||'';this[_0xdfaf('0x5')]=_0x500079[_0xdfaf('0x5')]||'';this[_0xdfaf('0x6')]=_0x500079[_0xdfaf('0x6')]||{};}module[_0xdfaf('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c7b1866..8200aed 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 _0x4cff=['queuecallercomplete','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','priority','holdtime','assigned','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt'];(function(_0x1a4982,_0x34e5b8){var _0x419e9e=function(_0x543ee8){while(--_0x543ee8){_0x1a4982['push'](_0x1a4982['shift']());}};_0x419e9e(++_0x34e5b8);}(_0x4cff,0x1d2));var _0xf4cf=function(_0x46fb38,_0x19c297){_0x46fb38=_0x46fb38-0x0;var _0x9c345e=_0x4cff[_0x46fb38];return _0x9c345e;};'use strict';function QueueReport(){this[_0xf4cf('0x0')]=_0xf4cf('0x1');this['uniqueid']='';this[_0xf4cf('0x2')]='';this[_0xf4cf('0x3')]='';this[_0xf4cf('0x4')]='';this[_0xf4cf('0x5')]=null;this[_0xf4cf('0x6')]=null;this['position']=0x1;this[_0xf4cf('0x7')]=0x1;this['queuecallerabandon']=![];this[_0xf4cf('0x8')]=null;this[_0xf4cf('0x9')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xf4cf('0xa')]=null;this[_0xf4cf('0xb')]=0x1;this['channel']='';this[_0xf4cf('0xc')]='';this[_0xf4cf('0xd')]='';this[_0xf4cf('0xe')]='';this[_0xf4cf('0xf')]='';this['exten']='';this[_0xf4cf('0x10')]='';this[_0xf4cf('0x11')]=0x0;this[_0xf4cf('0x12')]=![];this['lastAssignedTo']='';this[_0xf4cf('0x13')]=_0xf4cf('0x14');this[_0xf4cf('0x15')]=null;this[_0xf4cf('0x16')]=0x0;this[_0xf4cf('0x17')]={};}module[_0xf4cf('0x18')]=QueueReport; \ No newline at end of file +var _0xb2b0=['queue','queuecallerjoinAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','context','exten','priority','holdtime','voice','routealias','mohtime','exports','type','uniqueid','calleridnum','calleridname'];(function(_0x22b3ce,_0xd1bc5a){var _0x56b648=function(_0x5c1e7e){while(--_0x5c1e7e){_0x22b3ce['push'](_0x22b3ce['shift']());}};_0x56b648(++_0xd1bc5a);}(_0xb2b0,0x110));var _0x0b2b=function(_0x1ad87e,_0x7628c7){_0x1ad87e=_0x1ad87e-0x0;var _0x3fcb10=_0xb2b0[_0x1ad87e];return _0x3fcb10;};'use strict';function QueueReport(){this[_0x0b2b('0x0')]='inbound';this[_0x0b2b('0x1')]='';this[_0x0b2b('0x2')]='';this[_0x0b2b('0x3')]='';this[_0x0b2b('0x4')]='';this[_0x0b2b('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x0b2b('0x6')]=0x1;this['count']=0x1;this[_0x0b2b('0x7')]=![];this[_0x0b2b('0x8')]=null;this[_0x0b2b('0x9')]=![];this[_0x0b2b('0xa')]=null;this[_0x0b2b('0xb')]=![];this[_0x0b2b('0xc')]=null;this['originalposition']=0x1;this['channel']='';this[_0x0b2b('0xd')]='';this[_0x0b2b('0xe')]='';this['accountcode']='';this[_0x0b2b('0xf')]='';this[_0x0b2b('0x10')]='';this[_0x0b2b('0x11')]='';this[_0x0b2b('0x12')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this['motionChannel']=_0x0b2b('0x13');this[_0x0b2b('0x14')]=null;this[_0x0b2b('0x15')]=0x0;this['variables']={};}module[_0x0b2b('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 7a93584..e3c190b 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 _0x7355=['clientId','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x32fde0,_0x13318b){var _0x4e6f8e=function(_0xc3d4b8){while(--_0xc3d4b8){_0x32fde0['push'](_0x32fde0['shift']());}};_0x4e6f8e(++_0x13318b);}(_0x7355,0x7e));var _0x5735=function(_0x23f42d,_0x3e1072){_0x23f42d=_0x23f42d-0x0;var _0x22aea4=_0x7355[_0x23f42d];return _0x22aea4;};'use strict';function SalesforceAccount(_0x584e7f){this['id']=_0x584e7f['id']||0x0;this[_0x5735('0x0')]=_0x584e7f[_0x5735('0x0')]||'';this['username']=_0x584e7f[_0x5735('0x1')]||'';this[_0x5735('0x2')]=_0x584e7f[_0x5735('0x2')]||'';this['password']=_0x584e7f[_0x5735('0x3')]||'';this[_0x5735('0x4')]=_0x584e7f[_0x5735('0x4')]||'';this['clientSecret']=_0x584e7f['clientSecret']||'';this[_0x5735('0x5')]=_0x584e7f[_0x5735('0x5')]||'';this[_0x5735('0x6')]=_0x584e7f[_0x5735('0x6')]||'integrationTab';this['serverUrl']=_0x584e7f[_0x5735('0x7')]||'';this[_0x5735('0x8')]=_0x584e7f[_0x5735('0x8')]||{};}module[_0x5735('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x260d=['password','clientId','clientSecret','securityToken','type','Configurations','exports','username','remoteUri'];(function(_0x52fe8d,_0x49ecf2){var _0x5819ce=function(_0x891ba7){while(--_0x891ba7){_0x52fe8d['push'](_0x52fe8d['shift']());}};_0x5819ce(++_0x49ecf2);}(_0x260d,0xc4));var _0xd260=function(_0x40c202,_0x1038fd){_0x40c202=_0x40c202-0x0;var _0x5803ef=_0x260d[_0x40c202];return _0x5803ef;};'use strict';function SalesforceAccount(_0x3b49b1){this['id']=_0x3b49b1['id']||0x0;this['name']=_0x3b49b1['name']||'';this[_0xd260('0x0')]=_0x3b49b1['username']||'';this['remoteUri']=_0x3b49b1[_0xd260('0x1')]||'';this[_0xd260('0x2')]=_0x3b49b1['password']||'';this[_0xd260('0x3')]=_0x3b49b1[_0xd260('0x3')]||'';this[_0xd260('0x4')]=_0x3b49b1['clientSecret']||'';this[_0xd260('0x5')]=_0x3b49b1[_0xd260('0x5')]||'';this[_0xd260('0x6')]=_0x3b49b1[_0xd260('0x6')]||'integrationTab';this['serverUrl']=_0x3b49b1['serverUrl']||'';this[_0xd260('0x7')]=_0x3b49b1[_0xd260('0x7')]||{};}module[_0xd260('0x8')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 1ba3fa0..d10966f 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 _0x446d=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x11a314,_0x1a6157){var _0x454609=function(_0x287720){while(--_0x287720){_0x11a314['push'](_0x11a314['shift']());}};_0x454609(++_0x1a6157);}(_0x446d,0x135));var _0xd446=function(_0x4450ae,_0x520665){_0x4450ae=_0x4450ae-0x0;var _0x3f34d0=_0x446d[_0x4450ae];return _0x3f34d0;};'use strict';function ServicenowAccount(_0x105928){this['id']=_0x105928['id']||0x0;this[_0xd446('0x0')]=_0x105928[_0xd446('0x0')]||'';this[_0xd446('0x1')]=_0x105928[_0xd446('0x1')]||'';this['password']=_0x105928[_0xd446('0x2')]||'';this[_0xd446('0x3')]=_0x105928[_0xd446('0x3')]||'';this[_0xd446('0x4')]=_0x105928[_0xd446('0x4')]||'';this[_0xd446('0x5')]=_0x105928[_0xd446('0x5')]||{};}module[_0xd446('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf81e=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x46c4f9,_0x48dbaf){var _0x4b1374=function(_0x5890be){while(--_0x5890be){_0x46c4f9['push'](_0x46c4f9['shift']());}};_0x4b1374(++_0x48dbaf);}(_0xf81e,0x6a));var _0xef81=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf81e[_0x3b380d];return _0x54502b;};'use strict';function ServicenowAccount(_0x3dbe1e){this['id']=_0x3dbe1e['id']||0x0;this[_0xef81('0x0')]=_0x3dbe1e[_0xef81('0x0')]||'';this['username']=_0x3dbe1e['username']||'';this[_0xef81('0x1')]=_0x3dbe1e['password']||'';this[_0xef81('0x2')]=_0x3dbe1e[_0xef81('0x2')]||'';this[_0xef81('0x3')]=_0x3dbe1e['serverUrl']||'';this[_0xef81('0x4')]=_0x3dbe1e['Configurations']||{};}module[_0xef81('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 19f79ff..d7f3c05 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 _0x0207=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x0207,0x162));var _0x7020=function(_0x2c3d82,_0x24cb41){_0x2c3d82=_0x2c3d82-0x0;var _0x17b428=_0x0207[_0x2c3d82];return _0x17b428;};'use strict';function SugarcrmAccount(_0x289598){this['id']=_0x289598['id']||0x0;this[_0x7020('0x0')]=_0x289598['name']||'';this['username']=_0x289598[_0x7020('0x1')]||'';this[_0x7020('0x2')]=_0x289598[_0x7020('0x2')]||'';this[_0x7020('0x3')]=_0x289598[_0x7020('0x3')]||'';this[_0x7020('0x4')]=_0x289598[_0x7020('0x4')]||'';this['Configurations']=_0x289598['Configurations']||{};}module[_0x7020('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xacbd=['name','username','password','remoteUri','serverUrl','exports'];(function(_0x61bb05,_0x47421f){var _0x3ceb3e=function(_0x54b8f7){while(--_0x54b8f7){_0x61bb05['push'](_0x61bb05['shift']());}};_0x3ceb3e(++_0x47421f);}(_0xacbd,0x8a));var _0xdacb=function(_0xfaa27a,_0xb2062e){_0xfaa27a=_0xfaa27a-0x0;var _0x13d978=_0xacbd[_0xfaa27a];return _0x13d978;};'use strict';function SugarcrmAccount(_0x451d2e){this['id']=_0x451d2e['id']||0x0;this['name']=_0x451d2e[_0xdacb('0x0')]||'';this[_0xdacb('0x1')]=_0x451d2e[_0xdacb('0x1')]||'';this[_0xdacb('0x2')]=_0x451d2e['password']||'';this[_0xdacb('0x3')]=_0x451d2e[_0xdacb('0x3')]||'';this[_0xdacb('0x4')]=_0x451d2e[_0xdacb('0x4')]||'';this['Configurations']=_0x451d2e['Configurations']||{};}module[_0xdacb('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 40c339f..e600377 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 _0x8127=['unknown','status','address','name','accountcode','state'];(function(_0xae1a6c,_0x36effd){var _0x1c168e=function(_0x55c7a1){while(--_0x55c7a1){_0xae1a6c['push'](_0xae1a6c['shift']());}};_0x1c168e(++_0x36effd);}(_0x8127,0x1d1));var _0x7812=function(_0x36ccac,_0x11dd0c){_0x36ccac=_0x36ccac-0x0;var _0x2942d2=_0x8127[_0x36ccac];return _0x2942d2;};'use strict';function Telephone(_0x138483){this['id']=_0x138483['id']||0x0;this[_0x7812('0x0')]=_0x138483[_0x7812('0x0')]||'';this[_0x7812('0x1')]=_0x138483[_0x7812('0x1')]||'';this[_0x7812('0x2')]=_0x7812('0x3');this['stateTime']=0x0;this[_0x7812('0x4')]=_0x7812('0x3');this[_0x7812('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x87a2=['name','accountcode','state','unknown','stateTime','status'];(function(_0x3c92db,_0x52057a){var _0x47424a=function(_0x178e3f){while(--_0x178e3f){_0x3c92db['push'](_0x3c92db['shift']());}};_0x47424a(++_0x52057a);}(_0x87a2,0x14a));var _0x287a=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x87a2[_0x1ee9a1];return _0x21270f;};'use strict';function Telephone(_0x3e6b8f){this['id']=_0x3e6b8f['id']||0x0;this[_0x287a('0x0')]=_0x3e6b8f[_0x287a('0x0')]||'';this['accountcode']=_0x3e6b8f[_0x287a('0x1')]||'';this[_0x287a('0x2')]=_0x287a('0x3');this[_0x287a('0x4')]=0x0;this[_0x287a('0x5')]=_0x287a('0x3');this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 201f9c8..b931f00 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 _0xb10b=['name','html'];(function(_0x351b7f,_0x385f57){var _0x26d4ae=function(_0x57d95f){while(--_0x57d95f){_0x351b7f['push'](_0x351b7f['shift']());}};_0x26d4ae(++_0x385f57);}(_0xb10b,0x12a));var _0xbb10=function(_0x51f012,_0x629f0d){_0x51f012=_0x51f012-0x0;var _0x1e3e8f=_0xb10b[_0x51f012];return _0x1e3e8f;};'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 +var _0xb10b=['name','html'];(function(_0x1083fe,_0x50d37c){var _0x1f5403=function(_0x717c2f){while(--_0x717c2f){_0x1083fe['push'](_0x1083fe['shift']());}};_0x1f5403(++_0x50d37c);}(_0xb10b,0x12a));var _0xbb10=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0xb10b[_0x4536a4];return _0x4fd1c1;};'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 c91399b..eebd19a 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 _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x18a4f7,_0x3f915c){_0x18a4f7=_0x18a4f7-0x0;var _0x368cf3=_0x0b0e[_0x18a4f7];return _0x368cf3;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 837dc94..b6978d2 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 _0xedf2=['registry','indexOf','port','domain','refresh','stateRegistry','address','defaultuser','exports','active','name','unknown','status'];(function(_0x93de0b,_0x1fddb1){var _0x43719c=function(_0x4cc896){while(--_0x4cc896){_0x93de0b['push'](_0x93de0b['shift']());}};_0x43719c(++_0x1fddb1);}(_0xedf2,0x98));var _0x2edf=function(_0x12dca9,_0x28434a){_0x12dca9=_0x12dca9-0x0;var _0x786644=_0xedf2[_0x12dca9];return _0x786644;};'use strict';function Trunk(_0x483488){this['id']=_0x483488['id']||0x0;this[_0x2edf('0x0')]=_0x483488[_0x2edf('0x0')]||![];this[_0x2edf('0x1')]=_0x483488['name']||'';this['state']=_0x2edf('0x2');this['stateTime']=0x0;this[_0x2edf('0x3')]=_0x2edf('0x2');this[_0x2edf('0x4')]=_0x483488[_0x2edf('0x4')]&&_0x483488[_0x2edf('0x4')][_0x2edf('0x5')](':')?_0x483488[_0x2edf('0x4')]['split'](':')[0x0]:'';this['host']='';this[_0x2edf('0x6')]='';this[_0x2edf('0x7')]='';this['domainport']='';this[_0x2edf('0x8')]='';this[_0x2edf('0x9')]=_0x2edf('0x2');this['registrationtime']='';this[_0x2edf('0xa')]='';this[_0x2edf('0xb')]=_0x483488[_0x2edf('0xb')]||'';}module[_0x2edf('0xc')]=Trunk; \ No newline at end of file +var _0x5d62=['status','unknown','registry','indexOf','port','domain','domainport','refresh','address','defaultuser','exports','active','name'];(function(_0x5b8906,_0x329fc5){var _0xfe5c0d=function(_0x5a8af8){while(--_0x5a8af8){_0x5b8906['push'](_0x5b8906['shift']());}};_0xfe5c0d(++_0x329fc5);}(_0x5d62,0x66));var _0x25d6=function(_0xa72c46,_0x5d6163){_0xa72c46=_0xa72c46-0x0;var _0x2cc7a6=_0x5d62[_0xa72c46];return _0x2cc7a6;};'use strict';function Trunk(_0x4a30be){this['id']=_0x4a30be['id']||0x0;this[_0x25d6('0x0')]=_0x4a30be[_0x25d6('0x0')]||![];this[_0x25d6('0x1')]=_0x4a30be[_0x25d6('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0x25d6('0x2')]=_0x25d6('0x3');this['registry']=_0x4a30be[_0x25d6('0x4')]&&_0x4a30be[_0x25d6('0x4')][_0x25d6('0x5')](':')?_0x4a30be[_0x25d6('0x4')]['split'](':')[0x0]:'';this['host']='';this[_0x25d6('0x6')]='';this[_0x25d6('0x7')]='';this[_0x25d6('0x8')]='';this[_0x25d6('0x9')]='';this['stateRegistry']=_0x25d6('0x3');this['registrationtime']='';this[_0x25d6('0xa')]='';this[_0x25d6('0xb')]=_0x4a30be['defaultuser']||'';}module[_0x25d6('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index db0769b..de79d24 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 _0x5022=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5022,0x189));var _0x2502=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5022[_0x17928f];return _0x500b63;};'use strict';function voiceExtension(_0xef535b){this['id']=_0xef535b['id']||0x0;this[_0x2502('0x0')]=_0xef535b[_0x2502('0x0')]||'';this[_0x2502('0x1')]=_0xef535b[_0x2502('0x1')]||_0x2502('0x2');this[_0x2502('0x3')]=_0xef535b['mandatoryDisposition']||![];}module[_0x2502('0x4')]=voiceExtension; \ No newline at end of file +var _0x8184=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8184,0x1a8));var _0x4818=function(_0xd637a3,_0x19b904){_0xd637a3=_0xd637a3-0x0;var _0x180a84=_0x8184[_0xd637a3];return _0x180a84;};'use strict';function voiceExtension(_0x51815f){this['id']=_0x51815f['id']||0x0;this[_0x4818('0x0')]=_0x51815f[_0x4818('0x0')]||'';this['recordingFormat']=_0x51815f[_0x4818('0x1')]||_0x4818('0x2');this[_0x4818('0x3')]=_0x51815f['mandatoryDisposition']||![];}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 3bac91e..ee58f34 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 _0x6d7d=['unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','gsm','fewestcalls','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','paused','ringing','ringInUse','talking','unavailable'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0x6d7d,0x178));var _0xd6d7=function(_0x41d2b3,_0x2c2a1d){_0x41d2b3=_0x41d2b3-0x0;var _0x9e595a=_0x6d7d[_0x41d2b3];return _0x9e595a;};'use strict';var monitorFormat={'wav':_0xd6d7('0x0'),'wav49':'wav49','gsm':_0xd6d7('0x1')};var strategy={'fewestcalls':_0xd6d7('0x2'),'leastrecent':'leastrecent','linear':_0xd6d7('0x3'),'random':_0xd6d7('0x4'),'ringall':_0xd6d7('0x5'),'rr':_0xd6d7('0x6'),'rrmemory':_0xd6d7('0x7'),'rrordered':_0xd6d7('0x8'),'wrandom':_0xd6d7('0x9')};function VoiceQueue(_0x33ea00){this['id']=_0x33ea00['id']||0x0;this['name']=_0x33ea00[_0xd6d7('0xa')]||'';this['monitor_format']=_0x33ea00[_0xd6d7('0xb')]||'';this[_0xd6d7('0xc')]=_0x33ea00['type']||_0xd6d7('0xd');this[_0xd6d7('0xe')]=0x0;this['total']=0x0;this[_0xd6d7('0xf')]=0x0;this[_0xd6d7('0x10')]=0x0;this[_0xd6d7('0x11')]=0x0;this[_0xd6d7('0x12')]=0x0;this[_0xd6d7('0x13')]=0x0;this[_0xd6d7('0x14')]=0x0;this[_0xd6d7('0x15')]=0x0;this[_0xd6d7('0x16')]=0x0;this[_0xd6d7('0x17')]=0x0;this[_0xd6d7('0x18')]=0x0;this[_0xd6d7('0x19')]=0x0;this[_0xd6d7('0x1a')]=0x0;this['onHold']=0x0;this[_0xd6d7('0x1b')]=0x0;this[_0xd6d7('0x1c')]=0x0;this[_0xd6d7('0x1d')]=0x0;this[_0xd6d7('0x1e')]=0x0;this[_0xd6d7('0x1f')]=0x0;this[_0xd6d7('0x20')]=0x0;this['acw']=_0x33ea00[_0xd6d7('0x21')]||![];this[_0xd6d7('0x22')]=_0x33ea00['acwTimeout']||0xa;this[_0xd6d7('0x23')]=_0x33ea00['autopause']||'no';this[_0xd6d7('0x24')]=!![];this[_0xd6d7('0x25')]='';this[_0xd6d7('0x26')]='';this['originated']=0x0;this[_0xd6d7('0x27')]=0x0;this['dialTimezone']=_0x33ea00['dialTimezone']||null;this[_0xd6d7('0x28')]=_0x33ea00[_0xd6d7('0x28')]?_0x33ea00[_0xd6d7('0x28')]:null;this['dialActive']=_0x33ea00[_0xd6d7('0x29')];this[_0xd6d7('0x2a')]=_0x33ea00[_0xd6d7('0x2a')]||_0xd6d7('0x2b');this['dialLimitChannel']=_0x33ea00[_0xd6d7('0x2c')]||0x0;this[_0xd6d7('0x2d')]=_0x33ea00[_0xd6d7('0x2d')]||0x0;this[_0xd6d7('0x2e')]=_0x33ea00['dialPowerLevel']||0x1;this[_0xd6d7('0x2f')]=_0x33ea00['dialPredictiveOptimization']||_0xd6d7('0x30');this[_0xd6d7('0x31')]=_0x33ea00[_0xd6d7('0x31')]||0.03;this[_0xd6d7('0x32')]=_0x33ea00[_0xd6d7('0x32')]||0x258;this[_0xd6d7('0x33')]=_0x33ea00[_0xd6d7('0x33')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x33ea00[_0xd6d7('0x34')]||_0xd6d7('0x35');this['dialOriginateTimeout']=_0x33ea00['dialOriginateTimeout']||0x1e;this[_0xd6d7('0x36')]=_0x33ea00[_0xd6d7('0x36')]||_0xd6d7('0x37');this['dialQueueTimeout']=_0x33ea00[_0xd6d7('0x38')]||0x3;this[_0xd6d7('0x39')]=_0x33ea00[_0xd6d7('0x39')]||undefined;this[_0xd6d7('0x3a')]=_0x33ea00['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x33ea00[_0xd6d7('0x3b')]||0x96;this[_0xd6d7('0x3c')]=_0x33ea00[_0xd6d7('0x3c')]||0x3;this['dialBusyRetryFrequency']=_0x33ea00[_0xd6d7('0x3d')]||0x96;this[_0xd6d7('0x3e')]=_0x33ea00[_0xd6d7('0x3e')]||0x3;this[_0xd6d7('0x3f')]=_0x33ea00['dialNoAnswerRetryFrequency']||0x96;this[_0xd6d7('0x40')]=_0x33ea00[_0xd6d7('0x40')]||0x3;this[_0xd6d7('0x41')]=_0x33ea00[_0xd6d7('0x41')]||0x96;this['dialDropMaxRetry']=_0x33ea00[_0xd6d7('0x42')]||0x3;this[_0xd6d7('0x43')]=_0x33ea00[_0xd6d7('0x43')]||0x96;this[_0xd6d7('0x44')]=_0x33ea00[_0xd6d7('0x44')]||0x3;this[_0xd6d7('0x45')]=_0x33ea00['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x33ea00[_0xd6d7('0x46')]||0x3;this['dialMachineRetryFrequency']=_0x33ea00[_0xd6d7('0x47')]||0x96;this[_0xd6d7('0x48')]=_0x33ea00[_0xd6d7('0x48')]||0x3;this[_0xd6d7('0x49')]=_0x33ea00['dialAgentRejectRetryFrequency']||0x96;this[_0xd6d7('0x4a')]=_0x33ea00[_0xd6d7('0x4a')]||0x3;this['dialGlobalMaxRetry']=_0x33ea00['dialGlobalMaxRetry']||0x4;this[_0xd6d7('0x4b')]=_0x33ea00[_0xd6d7('0x4b')]?_0x33ea00[_0xd6d7('0x4b')]:undefined;this['TrunkBackup']=_0x33ea00[_0xd6d7('0x4c')]?_0x33ea00['TrunkBackup']:undefined;this[_0xd6d7('0x4d')]=_0x33ea00[_0xd6d7('0x4d')]||undefined;this['Interval']=_0x33ea00[_0xd6d7('0x4e')]?_0x33ea00[_0xd6d7('0x4e')]:undefined;this['dialOrderByScheduledAt']=_0x33ea00['dialOrderByScheduledAt']||_0xd6d7('0x4f');this['dialRandomLastDigitCallerIdNumber']=_0x33ea00[_0xd6d7('0x50')]||undefined;this['dialCutDigit']=_0x33ea00[_0xd6d7('0x51')]||undefined;this[_0xd6d7('0x52')]=strategy[_0x33ea00['strategy']];this[_0xd6d7('0x53')]=!![];this[_0xd6d7('0x54')]=_0x33ea00[_0xd6d7('0x54')]||![];this['dialAMDInitialSilence']=_0x33ea00[_0xd6d7('0x55')];this['dialAMDGreeting']=_0x33ea00[_0xd6d7('0x56')];this[_0xd6d7('0x57')]=_0x33ea00[_0xd6d7('0x57')];this['dialAMDTotalAnalysisTime']=_0x33ea00['dialAMDTotalAnalysisTime'];this[_0xd6d7('0x58')]=_0x33ea00[_0xd6d7('0x58')];this[_0xd6d7('0x59')]=_0x33ea00[_0xd6d7('0x59')];this[_0xd6d7('0x5a')]=_0x33ea00[_0xd6d7('0x5a')];this[_0xd6d7('0x5b')]=_0x33ea00['dialAMDSilenceThreshold'];this[_0xd6d7('0x5c')]=_0x33ea00[_0xd6d7('0x5c')];this[_0xd6d7('0x5d')]=0x0;this[_0xd6d7('0x5e')]=0x0;this['timeout']=_0x33ea00[_0xd6d7('0x5f')];this['outboundAnswerCallsDay']=0x0;this[_0xd6d7('0x60')]=0x0;this[_0xd6d7('0x61')]=0x0;this[_0xd6d7('0x62')]=0x0;this[_0xd6d7('0x63')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xd6d7('0x64')]=0x0;this[_0xd6d7('0x65')]=0x0;this[_0xd6d7('0x66')]=0x0;this[_0xd6d7('0x67')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xd6d7('0x68')]=0x0;this[_0xd6d7('0x69')]=0x0;this[_0xd6d7('0x6a')]=0x0;this['startProgressive']=undefined;this[_0xd6d7('0x6b')]=undefined;this[_0xd6d7('0x6c')]=undefined;this[_0xd6d7('0x6d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xd6d7('0x6e')]=0x0;this[_0xd6d7('0x6f')]=0x0;this[_0xd6d7('0x70')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xd6d7('0x71')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xd6d7('0x72')]=0x0;this[_0xd6d7('0x73')]=_0x33ea00['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xd6d7('0x74')]=_0x33ea00[_0xd6d7('0x75')]||0xa;this[_0xd6d7('0x76')]=0x0;this[_0xd6d7('0x77')]=0x0;this[_0xd6d7('0x78')]=0x1;this[_0xd6d7('0x79')]=0x0;this[_0xd6d7('0x7a')]=0x0;this[_0xd6d7('0x7b')]=0x0;this[_0xd6d7('0x7c')]=0x0;this['dialRecallMeTimeout']=_0x33ea00[_0xd6d7('0x7d')]||0x1e;this[_0xd6d7('0x7e')]=_0x33ea00[_0xd6d7('0x7e')]||![];this['dialPreviewAutoRecallMe']=!!_0x33ea00[_0xd6d7('0x7f')]||![];this[_0xd6d7('0x80')]=!!_0x33ea00[_0xd6d7('0x80')]||![];this[_0xd6d7('0x81')]=_0x33ea00[_0xd6d7('0x81')]||undefined;this[_0xd6d7('0x82')]=_0x33ea00[_0xd6d7('0x82')]||![];this[_0xd6d7('0x83')]=_0x33ea00[_0xd6d7('0x83')]||![];this[_0xd6d7('0xb')]=monitorFormat[_0x33ea00[_0xd6d7('0xb')]]?monitorFormat[_0x33ea00[_0xd6d7('0xb')]]:undefined;this[_0xd6d7('0x84')]=_0x33ea00[_0xd6d7('0x84')]||![];this[_0xd6d7('0x85')]=_0x33ea00[_0xd6d7('0x85')]?_0x33ea00[_0xd6d7('0x85')]:undefined;this[_0xd6d7('0x86')]=![];}module[_0xd6d7('0x87')]=VoiceQueue; \ No newline at end of file +var _0xd8eb=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','leastrecent','random','roundrobin','rrmemory','wrandom','name','monitor_format','type','waiting','total','sumHoldTime','sumBillable','unmanaged','abandoned','busy','invalid','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0xd8eb,0x128));var _0xbd8e=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xd8eb[_0x152121];return _0x592a85;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xbd8e('0x0'),'gsm':_0xbd8e('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xbd8e('0x2'),'linear':'linear','random':_0xbd8e('0x3'),'ringall':'ringall','rr':_0xbd8e('0x4'),'rrmemory':_0xbd8e('0x5'),'rrordered':'rrordered','wrandom':_0xbd8e('0x6')};function VoiceQueue(_0x1247bd){this['id']=_0x1247bd['id']||0x0;this[_0xbd8e('0x7')]=_0x1247bd['name']||'';this[_0xbd8e('0x8')]=_0x1247bd[_0xbd8e('0x8')]||'';this[_0xbd8e('0x9')]=_0x1247bd[_0xbd8e('0x9')]||'inbound';this[_0xbd8e('0xa')]=0x0;this[_0xbd8e('0xb')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xbd8e('0xc')]=0x0;this[_0xbd8e('0xd')]=0x0;this[_0xbd8e('0xe')]=0x0;this[_0xbd8e('0xf')]=0x0;this['available']=0x0;this[_0xbd8e('0x10')]=0x0;this['inUse']=0x0;this[_0xbd8e('0x11')]=0x0;this['loggedIn']=0x0;this[_0xbd8e('0x12')]=0x0;this[_0xbd8e('0x13')]=0x0;this[_0xbd8e('0x14')]=0x0;this[_0xbd8e('0x15')]=0x0;this[_0xbd8e('0x16')]=0x0;this[_0xbd8e('0x17')]=0x0;this[_0xbd8e('0x18')]=0x0;this[_0xbd8e('0x19')]=0x0;this['acw']=_0x1247bd[_0xbd8e('0x1a')]||![];this[_0xbd8e('0x1b')]=_0x1247bd[_0xbd8e('0x1b')]||0xa;this[_0xbd8e('0x1c')]=_0x1247bd['autopause']||'no';this[_0xbd8e('0x1d')]=!![];this[_0xbd8e('0x1e')]='';this[_0xbd8e('0x1f')]='';this['originated']=0x0;this['temp']=0x0;this['dialTimezone']=_0x1247bd[_0xbd8e('0x20')]||null;this[_0xbd8e('0x21')]=_0x1247bd[_0xbd8e('0x21')]?_0x1247bd[_0xbd8e('0x21')]:null;this[_0xbd8e('0x22')]=_0x1247bd[_0xbd8e('0x22')];this[_0xbd8e('0x23')]=_0x1247bd[_0xbd8e('0x23')]||_0xbd8e('0x24');this[_0xbd8e('0x25')]=_0x1247bd['dialLimitChannel']||0x0;this[_0xbd8e('0x26')]=_0x1247bd[_0xbd8e('0x26')]||0x0;this[_0xbd8e('0x27')]=_0x1247bd[_0xbd8e('0x27')]||0x1;this[_0xbd8e('0x28')]=_0x1247bd['dialPredictiveOptimization']||'dropRate';this[_0xbd8e('0x29')]=_0x1247bd[_0xbd8e('0x29')]||0.03;this['dialPredictiveInterval']=_0x1247bd[_0xbd8e('0x2a')]||0x258;this[_0xbd8e('0x2b')]=_0x1247bd[_0xbd8e('0x2b')]||_0xbd8e('0x2c');this[_0xbd8e('0x2d')]=_0x1247bd[_0xbd8e('0x2d')]||_0xbd8e('0x2c');this['dialOriginateTimeout']=_0x1247bd[_0xbd8e('0x2e')]||0x1e;this['dialQueueOptions']=_0x1247bd['dialQueueOptions']||'tTxX';this[_0xbd8e('0x2f')]=_0x1247bd['dialQueueTimeout']||0x3;this[_0xbd8e('0x30')]=_0x1247bd[_0xbd8e('0x30')]||undefined;this[_0xbd8e('0x31')]=_0x1247bd['dialCongestionMaxRetry']||0x3;this[_0xbd8e('0x32')]=_0x1247bd['dialCongestionRetryFrequency']||0x96;this[_0xbd8e('0x33')]=_0x1247bd[_0xbd8e('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x1247bd[_0xbd8e('0x34')]||0x96;this[_0xbd8e('0x35')]=_0x1247bd[_0xbd8e('0x35')]||0x3;this[_0xbd8e('0x36')]=_0x1247bd[_0xbd8e('0x36')]||0x96;this[_0xbd8e('0x37')]=_0x1247bd[_0xbd8e('0x37')]||0x3;this[_0xbd8e('0x38')]=_0x1247bd[_0xbd8e('0x38')]||0x96;this[_0xbd8e('0x39')]=_0x1247bd[_0xbd8e('0x39')]||0x3;this[_0xbd8e('0x3a')]=_0x1247bd['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x1247bd[_0xbd8e('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x1247bd[_0xbd8e('0x3c')]||0x96;this[_0xbd8e('0x3d')]=_0x1247bd[_0xbd8e('0x3d')]||0x3;this['dialMachineRetryFrequency']=_0x1247bd[_0xbd8e('0x3e')]||0x96;this['dialAgentRejectMaxRetry']=_0x1247bd['dialAgentRejectMaxRetry']||0x3;this[_0xbd8e('0x3f')]=_0x1247bd[_0xbd8e('0x3f')]||0x96;this['callAdditionalPhoneAfterMin']=_0x1247bd[_0xbd8e('0x40')]||0x3;this[_0xbd8e('0x41')]=_0x1247bd[_0xbd8e('0x41')]||0x4;this['Trunk']=_0x1247bd[_0xbd8e('0x42')]?_0x1247bd['Trunk']:undefined;this[_0xbd8e('0x43')]=_0x1247bd[_0xbd8e('0x43')]?_0x1247bd[_0xbd8e('0x43')]:undefined;this[_0xbd8e('0x44')]=_0x1247bd[_0xbd8e('0x44')]||undefined;this[_0xbd8e('0x45')]=_0x1247bd[_0xbd8e('0x45')]?_0x1247bd[_0xbd8e('0x45')]:undefined;this[_0xbd8e('0x46')]=_0x1247bd[_0xbd8e('0x46')]||_0xbd8e('0x47');this[_0xbd8e('0x48')]=_0x1247bd[_0xbd8e('0x48')]||undefined;this[_0xbd8e('0x49')]=_0x1247bd[_0xbd8e('0x49')]||undefined;this[_0xbd8e('0x4a')]=strategy[_0x1247bd[_0xbd8e('0x4a')]];this[_0xbd8e('0x4b')]=!![];this[_0xbd8e('0x4c')]=_0x1247bd[_0xbd8e('0x4c')]||![];this[_0xbd8e('0x4d')]=_0x1247bd['dialAMDInitialSilence'];this[_0xbd8e('0x4e')]=_0x1247bd[_0xbd8e('0x4e')];this[_0xbd8e('0x4f')]=_0x1247bd['dialAMDAfterGreetingSilence'];this[_0xbd8e('0x50')]=_0x1247bd[_0xbd8e('0x50')];this[_0xbd8e('0x51')]=_0x1247bd[_0xbd8e('0x51')];this['dialAMDBetweenWordsSilence']=_0x1247bd[_0xbd8e('0x52')];this[_0xbd8e('0x53')]=_0x1247bd[_0xbd8e('0x53')];this[_0xbd8e('0x54')]=_0x1247bd[_0xbd8e('0x54')];this[_0xbd8e('0x55')]=_0x1247bd[_0xbd8e('0x55')];this['outboundRejectCallsDay']=0x0;this[_0xbd8e('0x56')]=0x0;this[_0xbd8e('0x57')]=_0x1247bd['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xbd8e('0x58')]=0x0;this[_0xbd8e('0x59')]=0x0;this[_0xbd8e('0x5a')]=0x0;this[_0xbd8e('0x5b')]=0x0;this[_0xbd8e('0x5c')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xbd8e('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xbd8e('0x5e')]=0x0;this[_0xbd8e('0x5f')]=0x0;this[_0xbd8e('0x60')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0xbd8e('0x61')]=1.05;this[_0xbd8e('0x62')]=0x0;this[_0xbd8e('0x63')]=0x0;this[_0xbd8e('0x64')]=0x0;this[_0xbd8e('0x65')]=0x0;this[_0xbd8e('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xbd8e('0x67')]=0x0;this[_0xbd8e('0x68')]=0x0;this[_0xbd8e('0x69')]=_0x1247bd[_0xbd8e('0x6a')]||0x14;this[_0xbd8e('0x6b')]=_0x1247bd[_0xbd8e('0x6a')]||0xa;this[_0xbd8e('0x6c')]=0x0;this[_0xbd8e('0x6d')]=0x0;this[_0xbd8e('0x6e')]=0x1;this['erlangCalls']=0x0;this[_0xbd8e('0x6f')]=0x0;this[_0xbd8e('0x70')]=0x0;this['erlangBusyFactor']=0x0;this[_0xbd8e('0x71')]=_0x1247bd[_0xbd8e('0x71')]||0x1e;this[_0xbd8e('0x72')]=_0x1247bd['dialRecallInQueue']||![];this[_0xbd8e('0x73')]=!!_0x1247bd[_0xbd8e('0x73')]||![];this['dialPreviewRecallmeReminder']=!!_0x1247bd[_0xbd8e('0x74')]||![];this[_0xbd8e('0x75')]=_0x1247bd[_0xbd8e('0x75')]||undefined;this[_0xbd8e('0x76')]=_0x1247bd['dialAgiAfterHangupClient']||![];this[_0xbd8e('0x77')]=_0x1247bd[_0xbd8e('0x77')]||![];this[_0xbd8e('0x8')]=monitorFormat[_0x1247bd[_0xbd8e('0x8')]]?monitorFormat[_0x1247bd[_0xbd8e('0x8')]]:undefined;this[_0xbd8e('0x78')]=_0x1247bd[_0xbd8e('0x78')]||![];this[_0xbd8e('0x79')]=_0x1247bd[_0xbd8e('0x79')]?_0x1247bd['mandatoryDispositionPause']:undefined;this[_0xbd8e('0x7a')]=![];}module[_0xbd8e('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 3e75ba9..50e7189 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 _0xd13e=['dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','unknown','queue','dialer','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','statusMessage','updateReportFromOutboundQueue','outboundAbandonedCallsDay','exports','available','loggedIn','loggedInDb','paused','talking','inUse','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unmanaged','waiting','outbound','dialActive','dialMethod'];(function(_0x138d02,_0xf96da2){var _0x104f43=function(_0x22513d){while(--_0x22513d){_0x138d02['push'](_0x138d02['shift']());}};_0x104f43(++_0xf96da2);}(_0xd13e,0x193));var _0xed13=function(_0x510a9c,_0x8ad8b5){_0x510a9c=_0x510a9c-0x0;var _0x290590=_0xd13e[_0x510a9c];return _0x290590;};'use strict';var INBOUND_COUNTERS=[_0xed13('0x0'),_0xed13('0x1'),_0xed13('0x2'),_0xed13('0x3'),'ringing',_0xed13('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0xed13('0x0'),'answered',_0xed13('0x5'),_0xed13('0x1'),'loggedInDb','originated','outboundAbandonedCallsDay',_0xed13('0x6'),_0xed13('0x7'),_0xed13('0x8'),_0xed13('0x9'),_0xed13('0xa'),_0xed13('0xb'),_0xed13('0xc'),_0xed13('0xd'),_0xed13('0xe'),'paused',_0xed13('0xf'),_0xed13('0x4'),_0xed13('0x10'),_0xed13('0x11'),_0xed13('0x12'),'waiting'];function VoiceQueueSummary(_0x2731d1){this['id']=_0x2731d1['id'];this[_0xed13('0x13')]=_0x2731d1[_0xed13('0x13')];this[_0xed13('0x14')]=_0x2731d1[_0xed13('0x14')];this[_0xed13('0x15')]=_0x2731d1['abandoned']||0x0;this[_0xed13('0x16')]=_0x2731d1['answered']||0x0;this[_0xed13('0x0')]=_0x2731d1['available']||0x0;this[_0xed13('0x17')]=_0x2731d1['busy']||0x0;this[_0xed13('0x5')]=_0x2731d1['inUse']||0x0;this[_0xed13('0x18')]=_0x2731d1[_0xed13('0x18')]||0x0;this[_0xed13('0x1')]=_0x2731d1[_0xed13('0x1')]||0x0;this[_0xed13('0x2')]=_0x2731d1[_0xed13('0x2')]||0x0;this[_0xed13('0x19')]=_0x2731d1[_0xed13('0x19')]||0x0;this[_0xed13('0x1a')]=_0x2731d1[_0xed13('0x1a')]||0x0;this[_0xed13('0x3')]=_0x2731d1[_0xed13('0x3')]||0x0;this[_0xed13('0x1b')]=_0x2731d1[_0xed13('0x1b')]||0x0;this[_0xed13('0x1c')]=_0x2731d1[_0xed13('0x1c')];this['sumBillable']=_0x2731d1['sumBillable'];this[_0xed13('0x11')]=_0x2731d1[_0xed13('0x11')];this['sumHoldTime']=_0x2731d1[_0xed13('0x1d')]||0x0;this['talking']=_0x2731d1['talking']||0x0;this[_0xed13('0x12')]=_0x2731d1[_0xed13('0x12')]||0x0;this[_0xed13('0x1e')]=_0x2731d1[_0xed13('0x1e')];this[_0xed13('0x1f')]=_0x2731d1[_0xed13('0x1f')]||0x0;this['unknown']=_0x2731d1['unknown']||0x0;this['unmanaged']=_0x2731d1[_0xed13('0x20')]||0x0;this[_0xed13('0x21')]=_0x2731d1[_0xed13('0x21')]||0x0;if(_0x2731d1[_0xed13('0x1e')]===_0xed13('0x22')){this[_0xed13('0xf')]=_0x2731d1[_0xed13('0xf')]||0x0;this[_0xed13('0x23')]=_0x2731d1[_0xed13('0x23')];this[_0xed13('0x24')]=_0x2731d1[_0xed13('0x24')];this[_0xed13('0x25')]=_0x2731d1[_0xed13('0x25')];this[_0xed13('0x26')]=_0x2731d1['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x2731d1[_0xed13('0x27')];this[_0xed13('0x28')]=_0x2731d1['dialPrefix'];this[_0xed13('0x29')]=_0x2731d1[_0xed13('0x29')];this['outboundAnswerAgiCallsDay']=_0x2731d1[_0xed13('0x2a')];this[_0xed13('0x6')]=_0x2731d1[_0xed13('0x6')];this['outboundBlacklistCallsDay']=_0x2731d1[_0xed13('0x7')];this[_0xed13('0x8')]=_0x2731d1['outboundBusyCallsDay'];this[_0xed13('0x9')]=_0x2731d1[_0xed13('0x9')];this['outboundDropCallsDayACS']=_0x2731d1[_0xed13('0x2b')];this[_0xed13('0x2c')]=_0x2731d1[_0xed13('0x2c')];this[_0xed13('0x2d')]=_0x2731d1[_0xed13('0x2d')];this[_0xed13('0xa')]=_0x2731d1[_0xed13('0xa')];this['outboundNoSuchCallsDay']=_0x2731d1[_0xed13('0xb')];this['outboundOriginateFailureCallsDay']=_0x2731d1['outboundOriginateFailureCallsDay'];this[_0xed13('0xc')]=_0x2731d1[_0xed13('0xc')];this[_0xed13('0xd')]=_0x2731d1['outboundRejectCallsDay'];this[_0xed13('0xe')]=_0x2731d1[_0xed13('0xe')];this[_0xed13('0x2e')]=_0x2731d1['predictiveIntervalAnsweredCalls'];this[_0xed13('0x2f')]=_0x2731d1[_0xed13('0x2f')];this[_0xed13('0x30')]=_0x2731d1[_0xed13('0x30')];this['predictiveIntervalDroppedCallsCallersExit']=_0x2731d1[_0xed13('0x31')];this[_0xed13('0x32')]=_0x2731d1[_0xed13('0x32')];this[_0xed13('0x33')]=_0x2731d1[_0xed13('0x33')];this[_0xed13('0x34')]=_0x2731d1[_0xed13('0x34')];this[_0xed13('0x35')]=_0x2731d1[_0xed13('0x35')];this[_0xed13('0x36')]=_0x2731d1['predictiveIntervalMultiplicativeFactor'];this[_0xed13('0x37')]=_0x2731d1[_0xed13('0x37')];this['predictiveIntervalAvailable']=_0x2731d1['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x2731d1[_0xed13('0x38')];this[_0xed13('0x39')]=_0x2731d1['originated'];this['erlangCalls']=_0x2731d1[_0xed13('0x3a')];this[_0xed13('0x3b')]=_0x2731d1[_0xed13('0x3b')];this[_0xed13('0x3c')]=_0x2731d1[_0xed13('0x3c')];this['erlangBusyFactor']=_0x2731d1['erlangBusyFactor'];this[_0xed13('0x3d')]=_0x2731d1['startPredictive'];this[_0xed13('0x3e')]=_0x2731d1['startProgressive'];this[_0xed13('0x3f')]=_0x2731d1['message'];this['statusMessage']=_0x2731d1['statusMessage'];}if(_0x2731d1[_0xed13('0x40')]){this[_0xed13('0x40')]={'id':_0x2731d1[_0xed13('0x40')]['id'],'name':_0x2731d1[_0xed13('0x40')][_0xed13('0x13')],'active':_0x2731d1['Trunk'][_0xed13('0x41')],'callerid':_0x2731d1[_0xed13('0x40')][_0xed13('0x42')]};}}VoiceQueueSummary[_0xed13('0x43')][_0xed13('0x44')]=function(_0x5a8cfb,_0x1623c7,_0x34df0d,_0x24f4ba){this[_0xed13('0x2')]=0x0;this[_0xed13('0x4')]=0x0;this[_0xed13('0x3')]=0x0;this['unknown']=0x0;this[_0xed13('0x1a')]=0x0;this[_0xed13('0x5')]=0x0;this[_0xed13('0x17')]=0x0;this[_0xed13('0x18')]=0x0;this[_0xed13('0x1f')]=0x0;this[_0xed13('0x1b')]=0x0;this[_0xed13('0x1c')]=0x0;this[_0xed13('0x19')]=0x0;if(_0x34df0d){if(_0x34df0d[_0xed13('0x0')]){this[_0xed13('0x0')]=Number(_0x34df0d[_0xed13('0x0')]);}if(_0x34df0d[_0xed13('0x45')]){this[_0xed13('0x1')]=Number(_0x34df0d[_0xed13('0x45')]);}if(_0x34df0d['callers']){this[_0xed13('0x21')]=Number(_0x34df0d[_0xed13('0x46')]);}}for(var _0x51e5ba=0x0;_0x51e5ba<_0x5a8cfb[_0xed13('0x47')];_0x51e5ba++){var _0xbcaba0=_0x1623c7[_0xed13('0x48')+_0x5a8cfb[_0x51e5ba]['name']];if(_0xbcaba0&&_0xbcaba0[_0xed13('0x49')]){this[_0xed13('0x2')]+=0x1;}if(_0x5a8cfb[_0x51e5ba][_0xed13('0x4a')]==='1'){this['talking']+=0x1;}if(_0x5a8cfb[_0x51e5ba]['paused']==='1'&&!['2','7','8'][_0xed13('0x4b')](_0x5a8cfb[_0x51e5ba][_0xed13('0x4c')])){this['paused']+=0x1;}switch(_0x5a8cfb[_0x51e5ba][_0xed13('0x4c')]){case'0':this[_0xed13('0x4d')]+=0x1;break;case'1':this[_0xed13('0x1a')]+=0x1;break;case'2':this[_0xed13('0x5')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xed13('0x18')]+=0x1;break;case'5':this[_0xed13('0x1f')]+=0x1;break;case'6':this[_0xed13('0x1b')]+=0x1;break;case'7':this[_0xed13('0x1c')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0xed13('0x24')]==='booked'){var _0x46dcef=Object['keys'](_0x24f4ba);for(var _0x5a0828=0x0;_0x5a0828<_0x46dcef[_0xed13('0x47')];_0x5a0828++){var _0x3c13ee=_0x46dcef[_0x5a0828];var _0x54a979=_0x24f4ba[_0x3c13ee];if(_0x54a979[_0xed13('0x4e')]===this[_0xed13('0x13')]&&_0x54a979[_0xed13('0x1e')]===_0xed13('0x4f')&&_0x54a979['exten']===_0xed13('0x50')){this['talking']+=0x1;}}if(this[_0xed13('0x4')]>this[_0xed13('0x5')]){this[_0xed13('0x4')]=this[_0xed13('0x5')];}this[_0xed13('0xf')]=0x0;}return this;};VoiceQueueSummary[_0xed13('0x43')][_0xed13('0x51')]=function(_0x35c934){var _0x504080=![];if(_0x35c934){_0x504080=INBOUND_COUNTERS[_0xed13('0x52')](function(_0x38f66d){return this[_0x38f66d]!==_0x35c934[_0x38f66d];},this);}return _0x504080;};VoiceQueueSummary[_0xed13('0x43')][_0xed13('0x53')]=function(_0x54d6bc){var _0x283844=![];var _0x4d4926=![];var _0xc2d85=![];if(_0x54d6bc){_0x283844=this['dialMethod']!==_0x54d6bc['dialMethod']||this['dialActive']!==_0x54d6bc[_0xed13('0x23')]||this[_0xed13('0x3f')]!==_0x54d6bc[_0xed13('0x3f')]||this['statusMessage']!==_0x54d6bc[_0xed13('0x54')];_0x4d4926=OUTBOUND_COUNTERS[_0xed13('0x52')](function(_0x20dafb){return this[_0x20dafb]!==_0x54d6bc[_0x20dafb];},this);if(this[_0xed13('0x40')]&&_0x54d6bc[_0xed13('0x40')]){_0xc2d85=this['Trunk'][_0xed13('0x13')]!==_0x54d6bc[_0xed13('0x40')][_0xed13('0x13')]||this[_0xed13('0x40')]['active']!==_0x54d6bc[_0xed13('0x40')][_0xed13('0x41')];}}return _0x283844||_0x4d4926||_0xc2d85;};VoiceQueueSummary[_0xed13('0x43')][_0xed13('0x55')]=function(_0x170752){this[_0xed13('0x16')]=_0x170752[_0xed13('0x16')];this['message']=_0x170752[_0xed13('0x3f')];this['statusMessage']=_0x170752[_0xed13('0x54')];this['originated']=_0x170752[_0xed13('0x39')];this[_0xed13('0x56')]=_0x170752[_0xed13('0x56')];this[_0xed13('0x6')]=_0x170752[_0xed13('0x6')];this['outboundBlacklistCallsDay']=_0x170752['outboundBlacklistCallsDay'];this[_0xed13('0x8')]=_0x170752[_0xed13('0x8')];this[_0xed13('0x9')]=_0x170752[_0xed13('0x9')];this[_0xed13('0xa')]=_0x170752[_0xed13('0xa')];this[_0xed13('0xb')]=_0x170752[_0xed13('0xb')];this[_0xed13('0xc')]=_0x170752['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x170752['outboundRejectCallsDay'];this[_0xed13('0xe')]=_0x170752[_0xed13('0xe')];this[_0xed13('0x10')]=_0x170752['sumBillable'];this['sumDuration']=_0x170752[_0xed13('0x11')];this[_0xed13('0x12')]=_0x170752[_0xed13('0x12')];if(this['dialMethod']==='preview'){this['pTalking']=_0x170752['pTalking'];}};module[_0xed13('0x57')]=VoiceQueueSummary; \ No newline at end of file +var _0xbc8d=['updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','ringing','talking','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','invalid','loggedIn','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','compareToInboundQueue','some','compareToOutboundQueue'];(function(_0x44a8d7,_0x29ec48){var _0x32dd7b=function(_0x308741){while(--_0x308741){_0x44a8d7['push'](_0x44a8d7['shift']());}};_0x32dd7b(++_0x29ec48);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var INBOUND_COUNTERS=[_0xdbc8('0x0'),'loggedIn',_0xdbc8('0x1'),_0xdbc8('0x2'),_0xdbc8('0x3'),_0xdbc8('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0xdbc8('0x0'),_0xdbc8('0x5'),_0xdbc8('0x6'),'loggedIn',_0xdbc8('0x1'),_0xdbc8('0x7'),_0xdbc8('0x8'),'outboundAnswerCallsDay',_0xdbc8('0x9'),'outboundBusyCallsDay',_0xdbc8('0xa'),_0xdbc8('0xb'),'outboundNoSuchCallsDay',_0xdbc8('0xc'),_0xdbc8('0xd'),_0xdbc8('0xe'),_0xdbc8('0x2'),_0xdbc8('0xf'),_0xdbc8('0x4'),_0xdbc8('0x10'),_0xdbc8('0x11'),_0xdbc8('0x12'),_0xdbc8('0x13')];function VoiceQueueSummary(_0x606d56){this['id']=_0x606d56['id'];this[_0xdbc8('0x14')]=_0x606d56[_0xdbc8('0x14')];this[_0xdbc8('0x15')]=_0x606d56[_0xdbc8('0x15')];this['abandoned']=_0x606d56[_0xdbc8('0x16')]||0x0;this['answered']=_0x606d56[_0xdbc8('0x5')]||0x0;this[_0xdbc8('0x0')]=_0x606d56[_0xdbc8('0x0')]||0x0;this[_0xdbc8('0x17')]=_0x606d56[_0xdbc8('0x17')]||0x0;this[_0xdbc8('0x6')]=_0x606d56[_0xdbc8('0x6')]||0x0;this[_0xdbc8('0x18')]=_0x606d56[_0xdbc8('0x18')]||0x0;this[_0xdbc8('0x19')]=_0x606d56[_0xdbc8('0x19')]||0x0;this[_0xdbc8('0x1')]=_0x606d56[_0xdbc8('0x1')]||0x0;this[_0xdbc8('0x1a')]=_0x606d56['onHold']||0x0;this[_0xdbc8('0x1b')]=_0x606d56['notInUse']||0x0;this['paused']=_0x606d56['paused']||0x0;this['ringing']=_0x606d56[_0xdbc8('0x3')]||0x0;this[_0xdbc8('0x1c')]=_0x606d56[_0xdbc8('0x1c')];this[_0xdbc8('0x10')]=_0x606d56[_0xdbc8('0x10')];this[_0xdbc8('0x11')]=_0x606d56[_0xdbc8('0x11')];this[_0xdbc8('0x1d')]=_0x606d56[_0xdbc8('0x1d')]||0x0;this[_0xdbc8('0x4')]=_0x606d56[_0xdbc8('0x4')]||0x0;this[_0xdbc8('0x12')]=_0x606d56[_0xdbc8('0x12')]||0x0;this[_0xdbc8('0x1e')]=_0x606d56[_0xdbc8('0x1e')];this[_0xdbc8('0x1f')]=_0x606d56[_0xdbc8('0x1f')]||0x0;this[_0xdbc8('0x20')]=_0x606d56[_0xdbc8('0x20')]||0x0;this['unmanaged']=_0x606d56[_0xdbc8('0x21')]||0x0;this[_0xdbc8('0x13')]=_0x606d56[_0xdbc8('0x13')]||0x0;if(_0x606d56[_0xdbc8('0x1e')]===_0xdbc8('0x22')){this[_0xdbc8('0xf')]=_0x606d56[_0xdbc8('0xf')]||0x0;this[_0xdbc8('0x23')]=_0x606d56[_0xdbc8('0x23')];this[_0xdbc8('0x24')]=_0x606d56[_0xdbc8('0x24')];this[_0xdbc8('0x25')]=_0x606d56[_0xdbc8('0x25')];this['dialOriginateCallerIdNumber']=_0x606d56[_0xdbc8('0x26')];this[_0xdbc8('0x27')]=_0x606d56[_0xdbc8('0x27')];this[_0xdbc8('0x28')]=_0x606d56[_0xdbc8('0x28')];this['temp']=_0x606d56[_0xdbc8('0x29')];this['outboundAnswerAgiCallsDay']=_0x606d56[_0xdbc8('0x2a')];this[_0xdbc8('0x2b')]=_0x606d56[_0xdbc8('0x2b')];this['outboundBlacklistCallsDay']=_0x606d56[_0xdbc8('0x9')];this[_0xdbc8('0x2c')]=_0x606d56[_0xdbc8('0x2c')];this['outboundCongestionCallsDay']=_0x606d56[_0xdbc8('0xa')];this[_0xdbc8('0x2d')]=_0x606d56[_0xdbc8('0x2d')];this[_0xdbc8('0x2e')]=_0x606d56[_0xdbc8('0x2e')];this['outboundDropCallsDayTimeout']=_0x606d56['outboundDropCallsDayTimeout'];this[_0xdbc8('0xb')]=_0x606d56['outboundNoAnswerCallsDay'];this[_0xdbc8('0x2f')]=_0x606d56['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x606d56[_0xdbc8('0x30')];this['outboundReCallsDay']=_0x606d56[_0xdbc8('0xc')];this[_0xdbc8('0xd')]=_0x606d56[_0xdbc8('0xd')];this[_0xdbc8('0xe')]=_0x606d56[_0xdbc8('0xe')];this[_0xdbc8('0x31')]=_0x606d56['predictiveIntervalAnsweredCalls'];this[_0xdbc8('0x32')]=_0x606d56[_0xdbc8('0x32')];this['predictiveIntervalAvgTalktime']=_0x606d56[_0xdbc8('0x33')];this[_0xdbc8('0x34')]=_0x606d56[_0xdbc8('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x606d56[_0xdbc8('0x35')];this[_0xdbc8('0x36')]=_0x606d56[_0xdbc8('0x36')];this[_0xdbc8('0x37')]=_0x606d56[_0xdbc8('0x37')];this['predictiveIntervalHitRate']=_0x606d56['predictiveIntervalHitRate'];this[_0xdbc8('0x38')]=_0x606d56[_0xdbc8('0x38')];this[_0xdbc8('0x39')]=_0x606d56[_0xdbc8('0x39')];this[_0xdbc8('0x3a')]=_0x606d56['predictiveIntervalAvailable'];this[_0xdbc8('0x3b')]=_0x606d56[_0xdbc8('0x3b')];this[_0xdbc8('0x7')]=_0x606d56[_0xdbc8('0x7')];this['erlangCalls']=_0x606d56[_0xdbc8('0x3c')];this['erlangCallToSecond']=_0x606d56['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x606d56['erlangAbandonmentRate'];this[_0xdbc8('0x3d')]=_0x606d56[_0xdbc8('0x3d')];this['startPredictive']=_0x606d56[_0xdbc8('0x3e')];this[_0xdbc8('0x3f')]=_0x606d56[_0xdbc8('0x3f')];this['message']=_0x606d56[_0xdbc8('0x40')];this[_0xdbc8('0x41')]=_0x606d56[_0xdbc8('0x41')];}if(_0x606d56[_0xdbc8('0x42')]){this[_0xdbc8('0x42')]={'id':_0x606d56[_0xdbc8('0x42')]['id'],'name':_0x606d56[_0xdbc8('0x42')][_0xdbc8('0x14')],'active':_0x606d56[_0xdbc8('0x42')][_0xdbc8('0x43')],'callerid':_0x606d56[_0xdbc8('0x42')]['callerid']};}}VoiceQueueSummary[_0xdbc8('0x44')][_0xdbc8('0x45')]=function(_0x54700b,_0x485283,_0x3e27c0,_0x9c07e6){this[_0xdbc8('0x1')]=0x0;this[_0xdbc8('0x4')]=0x0;this[_0xdbc8('0x2')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0xdbc8('0x6')]=0x0;this[_0xdbc8('0x17')]=0x0;this[_0xdbc8('0x18')]=0x0;this['unavailable']=0x0;this[_0xdbc8('0x3')]=0x0;this['ringInUse']=0x0;this[_0xdbc8('0x1a')]=0x0;if(_0x3e27c0){if(_0x3e27c0[_0xdbc8('0x0')]){this[_0xdbc8('0x0')]=Number(_0x3e27c0[_0xdbc8('0x0')]);}if(_0x3e27c0[_0xdbc8('0x46')]){this[_0xdbc8('0x19')]=Number(_0x3e27c0['loggedin']);}if(_0x3e27c0['callers']){this[_0xdbc8('0x13')]=Number(_0x3e27c0[_0xdbc8('0x47')]);}}for(var _0x222c6c=0x0;_0x222c6c<_0x54700b[_0xdbc8('0x48')];_0x222c6c++){var _0x2dea85=_0x485283[_0xdbc8('0x49')+_0x54700b[_0x222c6c]['name']];if(_0x2dea85&&_0x2dea85[_0xdbc8('0x4a')]){this['loggedInDb']+=0x1;}if(_0x54700b[_0x222c6c][_0xdbc8('0x4b')]==='1'){this[_0xdbc8('0x4')]+=0x1;}if(_0x54700b[_0x222c6c]['paused']==='1'&&!['2','7','8'][_0xdbc8('0x4c')](_0x54700b[_0x222c6c][_0xdbc8('0x4d')])){this[_0xdbc8('0x2')]+=0x1;}switch(_0x54700b[_0x222c6c]['status']){case'0':this[_0xdbc8('0x20')]+=0x1;break;case'1':this[_0xdbc8('0x1b')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xdbc8('0x17')]+=0x1;break;case'4':this[_0xdbc8('0x18')]+=0x1;break;case'5':this[_0xdbc8('0x1f')]+=0x1;break;case'6':this[_0xdbc8('0x3')]+=0x1;break;case'7':this[_0xdbc8('0x1c')]+=0x1;break;case'8':this[_0xdbc8('0x1a')]+=0x1;break;}}if(this[_0xdbc8('0x24')]===_0xdbc8('0x4e')){var _0x101cf9=Object[_0xdbc8('0x4f')](_0x9c07e6);for(var _0x426efc=0x0;_0x426efc<_0x101cf9[_0xdbc8('0x48')];_0x426efc++){var _0x9df905=_0x101cf9[_0x426efc];var _0x5b5593=_0x9c07e6[_0x9df905];if(_0x5b5593['queue']===this[_0xdbc8('0x14')]&&_0x5b5593['type']==='dialer'&&_0x5b5593['exten']==='xcally-motion-preview'){this[_0xdbc8('0x4')]+=0x1;}}if(this[_0xdbc8('0x4')]>this[_0xdbc8('0x6')]){this['talking']=this[_0xdbc8('0x6')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xdbc8('0x44')][_0xdbc8('0x50')]=function(_0x54f7d6){var _0x21590f=![];if(_0x54f7d6){_0x21590f=INBOUND_COUNTERS[_0xdbc8('0x51')](function(_0x127ec3){return this[_0x127ec3]!==_0x54f7d6[_0x127ec3];},this);}return _0x21590f;};VoiceQueueSummary[_0xdbc8('0x44')][_0xdbc8('0x52')]=function(_0x3fa624){var _0x246a94=![];var _0x412304=![];var _0xb67941=![];if(_0x3fa624){_0x246a94=this['dialMethod']!==_0x3fa624[_0xdbc8('0x24')]||this[_0xdbc8('0x23')]!==_0x3fa624[_0xdbc8('0x23')]||this['message']!==_0x3fa624['message']||this['statusMessage']!==_0x3fa624[_0xdbc8('0x41')];_0x412304=OUTBOUND_COUNTERS[_0xdbc8('0x51')](function(_0x5dbd09){return this[_0x5dbd09]!==_0x3fa624[_0x5dbd09];},this);if(this[_0xdbc8('0x42')]&&_0x3fa624[_0xdbc8('0x42')]){_0xb67941=this['Trunk'][_0xdbc8('0x14')]!==_0x3fa624['Trunk'][_0xdbc8('0x14')]||this[_0xdbc8('0x42')][_0xdbc8('0x43')]!==_0x3fa624[_0xdbc8('0x42')][_0xdbc8('0x43')];}}return _0x246a94||_0x412304||_0xb67941;};VoiceQueueSummary[_0xdbc8('0x44')][_0xdbc8('0x53')]=function(_0x278589){this[_0xdbc8('0x5')]=_0x278589[_0xdbc8('0x5')];this[_0xdbc8('0x40')]=_0x278589['message'];this[_0xdbc8('0x41')]=_0x278589['statusMessage'];this['originated']=_0x278589['originated'];this[_0xdbc8('0x8')]=_0x278589[_0xdbc8('0x8')];this[_0xdbc8('0x2b')]=_0x278589[_0xdbc8('0x2b')];this[_0xdbc8('0x9')]=_0x278589['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x278589[_0xdbc8('0x2c')];this[_0xdbc8('0xa')]=_0x278589['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x278589[_0xdbc8('0xb')];this[_0xdbc8('0x2f')]=_0x278589[_0xdbc8('0x2f')];this[_0xdbc8('0xc')]=_0x278589[_0xdbc8('0xc')];this[_0xdbc8('0xd')]=_0x278589[_0xdbc8('0xd')];this[_0xdbc8('0xe')]=_0x278589[_0xdbc8('0xe')];this[_0xdbc8('0x10')]=_0x278589[_0xdbc8('0x10')];this[_0xdbc8('0x11')]=_0x278589['sumDuration'];this['total']=_0x278589[_0xdbc8('0x12')];if(this[_0xdbc8('0x24')]===_0xdbc8('0x54')){this[_0xdbc8('0xf')]=_0x278589[_0xdbc8('0xf')];}};module[_0xdbc8('0x55')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c05ee66..00817da 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 _0xc102=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x1407e4,_0x549875){var _0xa5b40b=function(_0x429941){while(--_0x429941){_0x1407e4['push'](_0x1407e4['shift']());}};_0xa5b40b(++_0x549875);}(_0xc102,0x9d));var _0x2c10=function(_0x1f313c,_0x2bede1){_0x1f313c=_0x1f313c-0x0;var _0x25af9b=_0xc102[_0x1f313c];return _0x25af9b;};'use strict';function VtigerAccount(_0x2b9912){this['id']=_0x2b9912['id']||0x0;this[_0x2c10('0x0')]=_0x2b9912['name']||'';this[_0x2c10('0x1')]=_0x2b9912[_0x2c10('0x1')]||'';this[_0x2c10('0x2')]=_0x2b9912['accessKey']||'';this[_0x2c10('0x3')]=_0x2b9912[_0x2c10('0x3')]||'';this[_0x2c10('0x4')]=_0x2b9912[_0x2c10('0x4')]||'';this[_0x2c10('0x5')]=_0x2b9912[_0x2c10('0x5')]||{};}module[_0x2c10('0x6')]=VtigerAccount; \ No newline at end of file +var _0xf722=['username','accessKey','remoteUri','serverUrl','exports','name'];(function(_0x19bb8d,_0x35cbd5){var _0x201bb6=function(_0x56b528){while(--_0x56b528){_0x19bb8d['push'](_0x19bb8d['shift']());}};_0x201bb6(++_0x35cbd5);}(_0xf722,0x197));var _0x2f72=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf722[_0x618414];return _0x21c19a;};'use strict';function VtigerAccount(_0x4a887a){this['id']=_0x4a887a['id']||0x0;this[_0x2f72('0x0')]=_0x4a887a[_0x2f72('0x0')]||'';this['username']=_0x4a887a[_0x2f72('0x1')]||'';this[_0x2f72('0x2')]=_0x4a887a['accessKey']||'';this[_0x2f72('0x3')]=_0x4a887a[_0x2f72('0x3')]||'';this['serverUrl']=_0x4a887a[_0x2f72('0x4')]||'';this['Configurations']=_0x4a887a['Configurations']||{};}module[_0x2f72('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index bdaba20..5c66f9c 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 _0x2f4e=['exports','name','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0xbed8cc,_0x502449){var _0x144e56=function(_0x45e603){while(--_0x45e603){_0xbed8cc['push'](_0xbed8cc['shift']());}};_0x144e56(++_0x502449);}(_0x2f4e,0x187));var _0xe2f4=function(_0x4dc25b,_0xfe20cd){_0x4dc25b=_0x4dc25b-0x0;var _0x4eb444=_0x2f4e[_0x4dc25b];return _0x4eb444;};'use strict';function ZendeskAccount(_0x36a474){this['id']=_0x36a474['id']||0x0;this[_0xe2f4('0x0')]=_0x36a474[_0xe2f4('0x0')]||'';this['username']=_0x36a474['username']||'';this[_0xe2f4('0x1')]=_0x36a474[_0xe2f4('0x1')]||'';this[_0xe2f4('0x2')]=_0x36a474[_0xe2f4('0x2')]||'';this[_0xe2f4('0x3')]=_0x36a474[_0xe2f4('0x3')]||'';this['authType']=_0x36a474[_0xe2f4('0x4')]||'';this['type']=_0x36a474[_0xe2f4('0x5')]||_0xe2f4('0x6');this[_0xe2f4('0x7')]=_0x36a474[_0xe2f4('0x7')]||'';this['Configurations']=_0x36a474[_0xe2f4('0x8')]||{};}module[_0xe2f4('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x3fc0=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','authType'];(function(_0x573725,_0x3d0257){var _0x3c40fe=function(_0xde5d70){while(--_0xde5d70){_0x573725['push'](_0x573725['shift']());}};_0x3c40fe(++_0x3d0257);}(_0x3fc0,0x181));var _0x03fc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fc0[_0x14add3];return _0x4a174f;};'use strict';function ZendeskAccount(_0x442faf){this['id']=_0x442faf['id']||0x0;this[_0x03fc('0x0')]=_0x442faf[_0x03fc('0x0')]||'';this[_0x03fc('0x1')]=_0x442faf['username']||'';this[_0x03fc('0x2')]=_0x442faf[_0x03fc('0x2')]||'';this[_0x03fc('0x3')]=_0x442faf[_0x03fc('0x3')]||'';this['remoteUri']=_0x442faf['remoteUri']||'';this['authType']=_0x442faf[_0x03fc('0x4')]||'';this[_0x03fc('0x5')]=_0x442faf[_0x03fc('0x5')]||_0x03fc('0x6');this[_0x03fc('0x7')]=_0x442faf[_0x03fc('0x7')]||'';this[_0x03fc('0x8')]=_0x442faf[_0x03fc('0x8')]||{};}module[_0x03fc('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 4204fcf..a4ebb9e 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 _0x3395=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description'];(function(_0x47aaa8,_0x22ba7a){var _0x21199c=function(_0x5eec66){while(--_0x5eec66){_0x47aaa8['push'](_0x47aaa8['shift']());}};_0x21199c(++_0x22ba7a);}(_0x3395,0x9e));var _0x5339=function(_0x5a8477,_0x3d5391){_0x5a8477=_0x5a8477-0x0;var _0x5ac831=_0x3395[_0x5a8477];return _0x5ac831;};'use strict';function ZohoAccount(_0x254643){this['id']=_0x254643['id']||0x0;this[_0x5339('0x0')]=_0x254643[_0x5339('0x0')]||'';this['description']=_0x254643[_0x5339('0x1')]||'';this[_0x5339('0x2')]=_0x254643[_0x5339('0x2')]||'';this[_0x5339('0x3')]=_0x254643[_0x5339('0x3')]||'';this['clientId']=_0x254643[_0x5339('0x4')]||'';this['clientSecret']=_0x254643[_0x5339('0x5')]||'';this[_0x5339('0x6')]=_0x254643[_0x5339('0x6')]||'';this[_0x5339('0x7')]=_0x254643[_0x5339('0x7')]||'';this[_0x5339('0x8')]=_0x254643[_0x5339('0x8')]||'';this[_0x5339('0x9')]=_0x254643[_0x5339('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x44dc=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x5c6f64,_0x3d7aa0){var _0x23a835=function(_0x183159){while(--_0x183159){_0x5c6f64['push'](_0x5c6f64['shift']());}};_0x23a835(++_0x3d7aa0);}(_0x44dc,0x64));var _0xc44d=function(_0x169639,_0x146136){_0x169639=_0x169639-0x0;var _0x277351=_0x44dc[_0x169639];return _0x277351;};'use strict';function ZohoAccount(_0x2d16de){this['id']=_0x2d16de['id']||0x0;this[_0xc44d('0x0')]=_0x2d16de['name']||'';this[_0xc44d('0x1')]=_0x2d16de['description']||'';this[_0xc44d('0x2')]=_0x2d16de[_0xc44d('0x2')]||'';this[_0xc44d('0x3')]=_0x2d16de[_0xc44d('0x3')]||'';this[_0xc44d('0x4')]=_0x2d16de[_0xc44d('0x4')]||'';this[_0xc44d('0x5')]=_0x2d16de[_0xc44d('0x5')]||'';this[_0xc44d('0x6')]=_0x2d16de['serverUrl']||'';this['code']=_0x2d16de[_0xc44d('0x7')]||'';this[_0xc44d('0x8')]=_0x2d16de[_0xc44d('0x8')]||'';this[_0xc44d('0x9')]=_0x2d16de[_0xc44d('0x9')]||{};}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 2b48db6..30d7211 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 _0x1399=['type','queue','dialAnswer','Agent','name','channelAgent','membername','calleridname','phone','Contact','firstName','active','scheduledat','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','idContact'];(function(_0x21aaec,_0x7783ad){var _0x408cdf=function(_0x25f2c2){while(--_0x25f2c2){_0x21aaec['push'](_0x21aaec['shift']());}};_0x408cdf(++_0x7783ad);}(_0x1399,0x16c));var _0x9139=function(_0x509e05,_0x23c205){_0x509e05=_0x509e05-0x0;var _0x2adacf=_0x1399[_0x509e05];return _0x2adacf;};'use strict';var util=require(_0x9139('0x0'));var _=require(_0x9139('0x1'));var moment=require('moment');function checkNameSurname(_0x474911,_0x4f01ae,_0x10c98f){var _0x8bba08='';if(!_[_0x9139('0x2')](_0x4f01ae)&&_0x9139('0x3')===typeof _0x4f01ae){_0x8bba08+=_0x4f01ae;}if(!_[_0x9139('0x2')](_0x10c98f)&&_0x9139('0x3')===typeof _0x10c98f){_0x8bba08+='\x20'+_0x10c98f;}if(_0x8bba08!==''){return _0x8bba08;}return _0x474911;}function Action(_0x5ac80b,_0x54af2d,_0x8f086b,_0x11d2ed,_0x4d5d1e){this['uniqueid']=_0x8f086b||undefined;this[_0x9139('0x4')]=_0x5ac80b['id'];this['queue']=_0x54af2d['name'];this[_0x9139('0x5')]=_0x54af2d[_0x9139('0x5')];this['campaigntype']=_0x9139('0x6');this[_0x9139('0x7')]=![];this['membername']=_['isNil'](_0x5ac80b[_0x9139('0x8')])?undefined:_0x5ac80b[_0x9139('0x8')][_0x9139('0x9')];this[_0x9139('0xa')]=this[_0x9139('0xb')]?util['format']('SIP/%s',this['membername']):_0x11d2ed||undefined;this[_0x9139('0xc')]=checkNameSurname(_0x5ac80b['Contact'][_0x9139('0xd')],_0x5ac80b[_0x9139('0xe')][_0x9139('0xf')],_0x5ac80b[_0x9139('0xe')]['lastName']);this[_0x9139('0x10')]=_0x5ac80b['active']||![];this['calleridnum']=_0x5ac80b['phone'];this[_0x9139('0x11')]=_0x5ac80b[_0x9139('0x11')];this[_0x9139('0x12')]=_0x5ac80b[_0x9139('0x12')]||0x0;this[_0x9139('0x13')]=_0x5ac80b[_0x9139('0x13')]||0x0;this['countnoanswerretry']=_0x5ac80b['countnoanswerretry']||0x0;this[_0x9139('0x14')]=(_0x5ac80b[_0x9139('0x12')]||0x0)+(_0x5ac80b['countcongestionretry']||0x0)+(_0x5ac80b['countnoanswerretry']||0x0)+(_0x5ac80b[_0x9139('0x15')]||0x0)+(_0x5ac80b[_0x9139('0x16')]||0x0)+(_0x5ac80b['countabandonedretry']||0x0)+(_0x5ac80b[_0x9139('0x17')]||0x0)+(_0x5ac80b[_0x9139('0x18')]||0x0);this[_0x9139('0x15')]=_0x5ac80b[_0x9139('0x15')]||0x0;this[_0x9139('0x16')]=_0x5ac80b[_0x9139('0x16')]||0x0;this[_0x9139('0x19')]=_0x5ac80b[_0x9139('0x19')]||0x0;this[_0x9139('0x17')]=_0x5ac80b[_0x9139('0x17')]||0x0;this[_0x9139('0x18')]=_0x5ac80b[_0x9139('0x18')]||0x0;this[_0x9139('0x1a')]=_0x5ac80b[_0x9139('0x1a')];this[_0x9139('0x1b')]=_0x5ac80b[_0x9139('0x1b')];this[_0x9139('0x1c')]=_0x5ac80b[_0x9139('0x1c')];this[_0x9139('0x1d')]=_0x5ac80b['recallme'];this[_0x9139('0x1e')]=_0x5ac80b[_0x9139('0x1e')];this['ListId']=_0x5ac80b[_0x9139('0x1f')];this[_0x9139('0x20')]=_[_0x9139('0x2')](_0x5ac80b['Agent'])?_0x5ac80b[_0x9139('0x20')]:_0x5ac80b[_0x9139('0x8')]['id'];this['VoiceQueueId']=_0x5ac80b[_0x9139('0x21')];this[_0x9139('0x22')]='';this[_0x9139('0x23')]='';}Action['prototype'][_0x9139('0x24')]=function(){return util[_0x9139('0x25')](_0x9139('0x26'),this[_0x9139('0xc')],this[_0x9139('0x27')]);};module[_0x9139('0x28')]=Action; \ No newline at end of file +var _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x12a9f6,_0xcf352a){var _0x243b7b=function(_0x4c95a2){while(--_0x4c95a2){_0x12a9f6['push'](_0x12a9f6['shift']());}};_0x243b7b(++_0xcf352a);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x1eba[_0x3c4f1f];return _0x19cb69;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ac0cfa1..6c81da6 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 _0x008c=['called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlock','recallme','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','dialActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerIdRandom','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','lookAgent','logLookAgent','isFailure','response','unlockContact','custom:agentringnoanswer','Answer','[syncHangup][talking]','cause','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','addVariable','syncVarSet','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','dialend','syncDialEnd','newexten','attendedtransfer','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','emit','sendMessageOneNotActive','originated','pTalking','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','message','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','agents','then','isNil','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','totalGlobal','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','buildAcw','custom:agentcomplete','complete','total','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','sumBillable','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','swapAdditionalPhones','outboundCongestionCallsDay','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','Busy','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled'];(function(_0x461d52,_0x43604b){var _0x25d252=function(_0x3bdc91){while(--_0x3bdc91){_0x461d52['push'](_0x461d52['shift']());}};_0x25d252(++_0x43604b);}(_0x008c,0x188));var _0xc008=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x008c[_0x1c8c28];return _0x1f59b4;};'use strict';var util=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var uuid=require(_0xc008('0x2'));var moment=require(_0xc008('0x3'));var Redis=require(_0xc008('0x4'));var config=require('../../../config/environment');var logger=require(_0xc008('0x5'))(_0xc008('0x6'));var loggerAction=require(_0xc008('0x5'))(_0xc008('0x7'));var ami=require(_0xc008('0x8'));var rpcDb=require(_0xc008('0x9'));var cmHopperAdditionalPhone=require(_0xc008('0xa'));var Action=require(_0xc008('0xb'));var ut=require(_0xc008('0xc'));var utils=require('../dialer/utils');config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc008('0xd')]));var Sequence=function(){};Sequence[_0xc008('0xe')]['enqueue']=function(_0x51ba7d){this['tail']=this[_0xc008('0xf')]?this[_0xc008('0xf')]['finally'](_0x51ba7d):_0x51ba7d();};function Preview(_0xae2dab){this[_0xc008('0x10')]=new Sequence();this[_0xc008('0x11')]=_0xae2dab[_0xc008('0x12')];this[_0xc008('0x13')]=_0xae2dab[_0xc008('0x13')];this[_0xc008('0x14')]={};this['agents']=_0xae2dab['agents'];this[_0xc008('0x15')]=0x0;ami['on']('originateresponse',this[_0xc008('0x16')][_0xc008('0x17')](this));ami['on'](_0xc008('0x18'),this[_0xc008('0x19')][_0xc008('0x17')](this));ami['on']('hanguprequest',this['syncHangupRequest']['bind'](this));ami['on'](_0xc008('0x1a'),this[_0xc008('0x1b')][_0xc008('0x17')](this));ami['on'](_0xc008('0x1c'),this['syncNewExten']['bind'](this));ami['on']('varset',this['syncVarSet'][_0xc008('0x17')](this));ami['on'](_0xc008('0x1d'),this['syncAttendedTransfer'][_0xc008('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this['loopCampaigns'](this[_0xc008('0x11')]);}function emit(_0x4b9726,_0x5560b1,_0x590a71){io['to'](_0x4b9726)['emit'](_0x5560b1,_0x590a71);}function emitVoiceQueueChannelRemove(_0x5a58bd){logger[_0xc008('0x1e')](_0xc008('0x1f'),JSON[_0xc008('0x20')](_0x5a58bd));emit(util[_0xc008('0x21')](_0xc008('0x22'),_0x5a58bd[_0xc008('0x23')]),'voice_queue_channel:remove',_0x5a58bd);io[_0xc008('0x24')]('voice_queue_presence:remove',_0x5a58bd);}function notSendMessagesQueue(_0x58a6ea){if(_0x58a6ea[_0xc008('0x25')]){if(_0x58a6ea[_0xc008('0x26')]===0x0&&_0x58a6ea[_0xc008('0x27')]===0x0){_0x58a6ea[_0xc008('0x25')]=![];_0x58a6ea['available']=0x0;_0x58a6ea['paused']=0x0;_0x58a6ea['message']=utils[_0xc008('0x28')][_0xc008('0x29')];ut[_0xc008('0x2a')](_0xc008('0x2b'),_0x58a6ea['name']+'\x20is\x20not\x20active');}else{_0x58a6ea['message']=utils['CAMPAIGN_STATUS']['DEACTIVATED'];ut[_0xc008('0x2a')](_0xc008('0x2b'),_0x58a6ea[_0xc008('0x23')]+'\x20is\x20deactivated');}}}Preview[_0xc008('0xe')][_0xc008('0x2c')]=function(){var _0x209591=this;setInterval(function(){_0x209591[_0xc008('0x2d')]();},0x7cf);};Preview['prototype'][_0xc008('0x2d')]=function(){var _0x2e0b4e=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x539766 in _0x2e0b4e){if(_0x2e0b4e[_0xc008('0x2e')](_0x539766)&&(_0x2e0b4e[_0x539766][_0xc008('0x2f')]===_0xc008('0x6')||_0x2e0b4e[_0x539766][_0xc008('0x2f')]===_0xc008('0x30'))&&_0x2e0b4e[_0x539766][_0xc008('0x31')]===_0xc008('0x32')){if(this[_0xc008('0x15')]>0x7){this[_0xc008('0x15')]=0x0;this[_0xc008('0x33')]();}}if(_0x2e0b4e[_0xc008('0x2e')](_0x539766)&&_0x2e0b4e[_0x539766][_0xc008('0x2f')]==='preview'&&_0x2e0b4e[_0x539766][_0xc008('0x31')]===_0xc008('0x32')){if(_0x2e0b4e[_0x539766]['dialActive']){this[_0xc008('0x34')](_0x2e0b4e[_0x539766]);if(_0x2e0b4e[_0x539766][_0xc008('0x35')])this[_0xc008('0x36')](_0x2e0b4e[_0x539766]);}else{notSendMessagesQueue(_0x2e0b4e[_0x539766]);}}}};Preview[_0xc008('0xe')][_0xc008('0x37')]=function(_0x3cd878){var _0x7cfbc5=this;this[_0xc008('0x10')][_0xc008('0x38')](function(){if(!_['isNil'](_0x7cfbc5[_0xc008('0x14')][_0x3cd878])){loggerAction[_0xc008('0x1e')](_0xc008('0x39'),_0x3cd878,_0xc008('0x3a'),_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3b')],_0xc008('0x3c'),JSON['stringify'](_0x7cfbc5[_0xc008('0x11')][_0x7cfbc5[_0xc008('0x14')][_0x3cd878]['queue']][_0xc008('0x26')]),_0xc008('0x3d'),JSON['stringify'](_0x7cfbc5[_0xc008('0x11')][_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3b')]]['pTalking']),JSON['stringify'](_0x7cfbc5['actions'][_0x3cd878][_0xc008('0x3e')]),JSON['stringify'](_[_0xc008('0x3f')](_0x7cfbc5[_0xc008('0x14')][_0x3cd878],[_0xc008('0x40'),_0xc008('0x41'),_0xc008('0x42'),_0xc008('0x43')])));return ami[_0xc008('0x44')]({'action':_0xc008('0x45'),'channel':_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x46')]})[_0xc008('0x47')](function(_0xdfca2e){if(_0xdfca2e[_0xc008('0x48')]===_0xc008('0x49')){setTimeout(function(){if(_0x7cfbc5['actions'][_0x3cd878]){ut[_0xc008('0x4a')](_0x7cfbc5[_0xc008('0x11')][_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3b')]],'[clearZombieChannel]');if(_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3e')]===!![]){ut[_0xc008('0x4b')](_0x7cfbc5[_0xc008('0x11')][_0x7cfbc5[_0xc008('0x14')][_0x3cd878]['queue']],_0xc008('0x4c'));ut[_0xc008('0x4d')](_0xc008('0x4e')+_0x3cd878,_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3b')]);}ut['loggerError'](_0xc008('0x4f')+_0x3cd878,_0x7cfbc5[_0xc008('0x14')][_0x3cd878][_0xc008('0x3b')]);delete _0x7cfbc5[_0xc008('0x14')][_0x3cd878];}},0x2328);}});}});};Preview['prototype'][_0xc008('0x33')]=function(){var _0xe37446=this;loggerAction[_0xc008('0x1e')]('[action]',_[_0xc008('0x50')](this['actions']));for(var _0x3dd097 in this['actions']){if(_0xe37446[_0xc008('0x14')][_0xc008('0x2e')](_0x3dd097)){_0xe37446['clearZombieChannel'](_0x3dd097);}}};Preview[_0xc008('0xe')][_0xc008('0x36')]=function(_0x6d6d4c){var _0x5caaa2=this;rpcDb[_0xc008('0x51')](_0x6d6d4c['id'],ut[_0xc008('0x52')](this[_0xc008('0x53')]))[_0xc008('0x54')](function(_0x347629){if(!_[_0xc008('0x55')](_0x347629)){for(var _0x59ca2b=0x0;_0x59ca2b<_0x347629['length'];_0x59ca2b+=0x1){if(ut['getDiff'](_0x347629[_0x59ca2b][_0xc008('0x56')])<_0x6d6d4c[_0xc008('0x57')]*0x3c){if(_0x347629[_0x59ca2b][_0xc008('0x58')]&&!_0x347629[_0x59ca2b][_0xc008('0x58')][_0xc008('0x59')]){_0x5caaa2[_0xc008('0x5a')](_0x347629[_0x59ca2b]['id'])[_0xc008('0x54')](ut[_0xc008('0x5b')]('[RecallMe]'))['catch'](ut['logger2'](_0xc008('0x5c')));}else{rpcDb[_0xc008('0x5d')](_0x347629[_0x59ca2b]['id']);}}else{var _0x158eae=new Action(_0x347629[_0x59ca2b],_0x6d6d4c);_0x158eae['starttime']=moment()[_0xc008('0x21')](_0xc008('0x5e'));_0x6d6d4c[_0xc008('0x5f')]+=0x1;ut[_0xc008('0x60')](_0x158eae,0x17,_0xc008('0x61'));if(_0x6d6d4c[_0xc008('0x62')]){rpcDb[_0xc008('0x63')](ut[_0xc008('0x64')](_0x347629[_0x59ca2b]));rpcDb[_0xc008('0x65')](_0x158eae,_0xc008('0x66'));}else{ut['logCustomer'](_0x158eae,0x16,'RecallFailedTimeout');rpcDb[_0xc008('0x65')](_0x158eae,'[HistoryRecallClose]');rpcDb[_0xc008('0x67')](_0x158eae,_0xc008('0x68'));}}}}})[_0xc008('0x47')](ut['logger2'](_0xc008('0x69')));};Preview[_0xc008('0xe')][_0xc008('0x34')]=function(_0x8b9775){_0x8b9775[_0xc008('0x25')]=!![];if(ut['IsNotLoggedIn'](_0x8b9775[_0xc008('0x6a')])){_0x8b9775[_0xc008('0x48')]=utils['CAMPAIGN_STATUS'][_0xc008('0x6b')];}else if(!ut[_0xc008('0x6c')](_0x8b9775['dialActive'])){_0x8b9775['message']=utils[_0xc008('0x28')][_0xc008('0x29')];}else if(!this[_0xc008('0x6d')](_0x8b9775[_0xc008('0x6e')])){if(!this[_0xc008('0x6d')](_0x8b9775['TrunkBackup'])){_0x8b9775['message']=utils[_0xc008('0x28')]['UNREACHABLE_TRUNK'];}else{_0x8b9775[_0xc008('0x48')]=utils[_0xc008('0x28')][_0xc008('0x6f')];}}else{_0x8b9775[_0xc008('0x48')]=utils[_0xc008('0x28')][_0xc008('0x6f')];}};Preview['prototype'][_0xc008('0x70')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){var _0x4424f5=this;var _0x5aa385=this[_0xc008('0x14')][_0x9a7abc];var _0x4fdab4=this['campaignsPreview'][_0x5aa385['queue']];var _0x89bb20;var _0x1bcbb1=![];var _0x5dfb69=0x2;var _0x5f58d7=0x3;if(_0x4fdab4){switch(_0x2b350c){case'1':_0x4fdab4[_0xc008('0x71')]+=0x1;_0x5aa385[_0xc008('0x72')]+=0x1;_0x5aa385[_0xc008('0x73')]=ut['totalGlobal'](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x0,_0xc008('0x74'));ami[_0xc008('0x24')](_0xc008('0x75'),ut['buildObj'](_0x5aa385,_0xc008('0x76')));rpcDb['createCustomerHistory'](_0x5aa385,_0xc008('0x77'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'0',_0x4fdab4)[_0xc008('0x54')](function(_0x943c91){_0x1bcbb1=_0x943c91[_0xc008('0x79')]==0x1;_0x5dfb69=_0x4fdab4[_0xc008('0x7a')];_0x5f58d7=_0x4fdab4['callAdditionalPhoneAfterMin'];if(!_0x1bcbb1){if(ut[_0xc008('0x7b')](_0x5aa385)>=_0x4fdab4['dialGlobalMaxRetry']){_0x89bb20=ut['cloneAction'](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb[_0xc008('0x67')](_0x89bb20,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x5aa385[_0xc008('0x72')]>=_0x4fdab4[_0xc008('0x7d')]){rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0x7e'));}else{rpcDb[_0xc008('0x7f')](ut[_0xc008('0x80')](_0x5aa385,_0xc008('0x72'),_0x4fdab4['dialNoSuchNumberRetryFrequency']),_0x5aa385[_0xc008('0x81')],_0x5aa385[_0xc008('0x82')]);}}delete this[_0xc008('0x14')][_0xbd7422[_0xc008('0x83')]];}else{_0x5aa385[_0xc008('0x72')]++;logger[_0xc008('0x1e')](_0xc008('0x84'),_0x5aa385[_0xc008('0x72')]);logger[_0xc008('0x1e')]('id',_0x5aa385[_0xc008('0x85')]);_0x4424f5[_0xc008('0x86')]({'id':_0x5aa385[_0xc008('0x85')],'field':{'countnosuchnumberretry':_0x5aa385[_0xc008('0x72')]}})[_0xc008('0x54')](function(){_0x4424f5['swapAdditionalPhones'](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});break;case _0xc008('0x87'):var _0x3d3a7e=moment()['format'](_0xc008('0x5e'));_0x5aa385[_0xc008('0x88')]=_0x3d3a7e;_0x5aa385['answertime']=_0x3d3a7e;_0x5aa385['dialAnswer']=!![];_0x4fdab4[_0xc008('0x27')]+=0x1;logger[_0xc008('0x1e')](_0xc008('0x89'),_0x5aa385[_0xc008('0x8a')],_0xc008('0x8b'),_0x4fdab4[_0xc008('0x23')],_0xc008('0x3d'),_0x4fdab4[_0xc008('0x27')]);ami[_0xc008('0x24')](_0xc008('0x8c'),ut[_0xc008('0x8d')](_0x5aa385,'connect',this[_0xc008('0x11')][_0x5aa385[_0xc008('0x3b')]]));if(_0x4fdab4[_0xc008('0x8e')]){ami[_0xc008('0x24')]('custom:agentConnectPreview',ut[_0xc008('0x8f')](_0x5aa385));}break;case'16':ami['emit'](_0xc008('0x90'),ut[_0xc008('0x8d')](_0x5aa385,_0xc008('0x91'),this['campaignsPreview'][_0x5aa385[_0xc008('0x3b')]]));emitVoiceQueueChannelRemove(ut[_0xc008('0x8d')](_0x5aa385,_0xc008('0x91')));_0x4fdab4['outboundAnswerCallsDay']+=0x1;_0x4fdab4[_0xc008('0x92')]+=0x1;_0x4fdab4['answered']+=0x1;ut[_0xc008('0x4b')](_0x4fdab4,_0xc008('0x93'));_0x5aa385[_0xc008('0x73')]=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x4,'Answer');rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0x94'));rpcDb['createCustomerFinal'](_0x5aa385,_0xc008('0x95'));rpcDb['crateCustomerReportQueue'](_0x5aa385);_0x4fdab4[_0xc008('0x96')]+=_0x5aa385['talktime'];_0x4fdab4[_0xc008('0x97')]+=_0x5aa385['talktime'];logger[_0xc008('0x1e')](_0xc008('0x98'),_0x5aa385[_0xc008('0x8a')],_0xc008('0x8b'),_0x4fdab4['name'],_0xc008('0x3d'),_0x4fdab4[_0xc008('0x27')]);delete this[_0xc008('0x14')][_0xbd7422[_0xc008('0x83')]];break;case _0xc008('0x99'):_0x4fdab4[_0xc008('0x9a')]+=0x1;_0x5aa385[_0xc008('0x9b')]+=0x1;_0x5aa385[_0xc008('0x73')]=ut['totalGlobal'](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x5,'Busy');_0x5dfb69=_0x4fdab4['dialBusyRetryFrequency'];_0x5f58d7=_0x4fdab4['callAdditionalPhoneAfterMin'];ami[_0xc008('0x24')](_0xc008('0x9c'),ut[_0xc008('0x8d')](_0x5aa385,_0xc008('0x9d')));rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0x9e'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'5',_0x4fdab4)[_0xc008('0x54')](function(_0x127bdf){_0x1bcbb1=_0x127bdf['additional']==0x1;if(!_0x1bcbb1){if(ut[_0xc008('0x7b')](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb[_0xc008('0x67')](_0x89bb20,_0xc008('0xa1'));}else{if(_0x5aa385[_0xc008('0x9b')]>=_0x4fdab4[_0xc008('0xa2')]){rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0x9e'));}else{rpcDb[_0xc008('0x7f')](ut[_0xc008('0x80')](_0x5aa385,'countbusyretry',_0x4fdab4['dialBusyRetryFrequency']),_0x5aa385[_0xc008('0x81')],_0x5aa385[_0xc008('0x82')]);}}}else{_0x5aa385[_0xc008('0x9b')]++;_0x4424f5['incrementPreviewCounters']({'id':_0x5aa385[_0xc008('0x85')],'field':{'countbusyretry':_0x5aa385[_0xc008('0x9b')]}})['then'](function(){_0x4424f5['swapAdditionalPhones'](_0x5aa385,_0x5dfb69,_0x5f58d7)['then'](function(){});});}});break;case _0xc008('0xa3'):_0x4fdab4[_0xc008('0xa4')]+=0x1;_0x5aa385[_0xc008('0xa5')]+=0x1;_0x5aa385[_0xc008('0x73')]=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x3,_0xc008('0xa6'));_0x5dfb69=_0x4fdab4[_0xc008('0xa7')];_0x5f58d7=_0x4fdab4[_0xc008('0xa8')];var _0x1e7a11=ut['buildNoAnswerEventPayload'](_0x5aa385,_0x4fdab4);ami['emit'](_0xc008('0xa9'),_0x1e7a11);rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0xaa'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'3',_0x4fdab4)[_0xc008('0x54')](function(_0x37fc2c){_0x1bcbb1=_0x37fc2c['additional']==0x1;if(!_0x1bcbb1){if(ut['totalGlobal'](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb['createCustomerFinal'](_0x89bb20,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x5aa385['countnoanswerretry']>=_0x4fdab4['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x5aa385,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xc008('0x7f')](ut['scheduledAt'](_0x5aa385,_0xc008('0xa5'),_0x4fdab4['dialNoAnswerRetryFrequency']),_0x5aa385[_0xc008('0x81')],_0x5aa385[_0xc008('0x82')]);}}}else{_0x5aa385[_0xc008('0xa5')]++;_0x4424f5['incrementPreviewCounters']({'id':_0x5aa385['idContact'],'field':{'countnoanswerretry':_0x5aa385[_0xc008('0xa5')]}})['then'](function(){_0x4424f5[_0xc008('0xab')](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});break;case'CONGESTION':_0x4fdab4[_0xc008('0xac')]+=0x1;_0x5aa385['countcongestionretry']+=0x1;_0x5aa385['countglobal']=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x8,'Congestion');_0x5dfb69=_0x4fdab4[_0xc008('0xad')];_0x5f58d7=_0x4fdab4[_0xc008('0xa8')];ami[_0xc008('0x24')]('custom:agentcongestion',ut[_0xc008('0x8d')](_0x5aa385,_0xc008('0xae')));rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0xaf'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'8',_0x4fdab4)[_0xc008('0x54')](function(_0x5db7bc){_0x1bcbb1=_0x5db7bc[_0xc008('0x79')]==0x1;if(!_0x1bcbb1){if(ut[_0xc008('0x7b')](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut['cloneAction'](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb[_0xc008('0x67')](_0x89bb20,_0xc008('0xb0'));}else{if(_0x5aa385['countcongestionretry']>=_0x4fdab4['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x5aa385,_0xc008('0xaf'));}else{rpcDb[_0xc008('0x7f')](ut[_0xc008('0x80')](_0x5aa385,_0xc008('0xb1'),_0x4fdab4[_0xc008('0xb2')]),_0x5aa385[_0xc008('0x81')],_0x5aa385[_0xc008('0x82')]);}}}else{_0x5aa385[_0xc008('0xb1')]++;_0x4424f5['incrementPreviewCounters']({'id':_0x5aa385[_0xc008('0x85')],'field':{'countcongestionretry':_0x5aa385[_0xc008('0xb1')]}})['then'](function(){_0x4424f5['swapAdditionalPhones'](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});break;case _0xc008('0xb3'):_0x4fdab4[_0xc008('0xb4')]+=0x1;_0x5aa385[_0xc008('0xb5')]+=0x1;_0x5aa385[_0xc008('0x73')]=ut['totalGlobal'](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x14,_0xc008('0xb6'));_0x5dfb69=_0x4fdab4['dialAgentRejectRetryFrequency'];_0x5f58d7=_0x4fdab4[_0xc008('0xa8')];ami[_0xc008('0x24')](_0xc008('0xb7'),ut[_0xc008('0x8d')](_0x5aa385,'agentreject'));rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0xb8'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'20',_0x4fdab4)[_0xc008('0x54')](function(_0x59b3bb){_0x1bcbb1=_0x59b3bb[_0xc008('0x79')]==0x1;if(!_0x1bcbb1){if(ut[_0xc008('0x7b')](_0x5aa385)>=_0x4fdab4['dialGlobalMaxRetry']){_0x89bb20=ut['cloneAction'](_0x5aa385,0x14,_0xc008('0xb6'));rpcDb['createCustomerFinal'](_0x89bb20,_0xc008('0xb9'));}else{if(_0x5aa385[_0xc008('0xb5')]>=_0x4fdab4['dialAgentRejectMaxRetry']){rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0xb9'));}else{rpcDb[_0xc008('0x7f')](ut[_0xc008('0x80')](_0x5aa385,_0xc008('0xb5'),_0x4fdab4[_0xc008('0xba')]),_0x5aa385[_0xc008('0x81')],_0x5aa385[_0xc008('0x82')]);}}}else{_0x5aa385[_0xc008('0xa5')]++;_0x4424f5[_0xc008('0x86')]({'id':_0x5aa385['idContact'],'field':{'countnoanswerretry':_0x5aa385['countnoanswerretry']}})[_0xc008('0x54')](function(){_0x4424f5[_0xc008('0xab')](_0x5aa385,_0x5dfb69,_0x5f58d7)['then'](function(){});});}});break;case _0xc008('0xbb'):_0x4fdab4[_0xc008('0xbc')]+=0x1;_0x5aa385[_0xc008('0xbd')]+=0x1;_0x5aa385['countglobal']=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0xb,_0xc008('0xbe'));rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0xbf'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'11',_0x4fdab4)[_0xc008('0x54')](function(_0x5bd010){_0x1bcbb1=_0x5bd010[_0xc008('0x79')]==0x1;if(!_0x1bcbb1){if(ut['totalGlobal'](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb['createCustomerFinal'](_0x89bb20,_0xc008('0xbf'));}else{if(_0x5aa385[_0xc008('0xc0')]>=_0x4fdab4[_0xc008('0xc1')]){rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0xbf'));}else{rpcDb[_0xc008('0x7f')](ut[_0xc008('0x80')](_0x5aa385,_0xc008('0xbd'),_0x4fdab4[_0xc008('0xc2')]),_0x5aa385[_0xc008('0x81')],_0x5aa385['activeContact']);}}}else{_0x5aa385[_0xc008('0xa5')]++;_0x4424f5[_0xc008('0x86')]({'id':_0x5aa385[_0xc008('0x85')],'field':{'countnoanswerretry':_0x5aa385[_0xc008('0xa5')]}})[_0xc008('0x54')](function(){_0x4424f5['swapAdditionalPhones'](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});break;case'18':_0x4fdab4[_0xc008('0xc3')]+=0x1;_0x5aa385[_0xc008('0xc4')]+=0x1;_0x5aa385[_0xc008('0x73')]=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x12,_0xbd7422[_0xc008('0xc5')]||_0xbd7422[_0xc008('0xc6')]);ami[_0xc008('0x24')](_0xc008('0xc7'),ut[_0xc008('0x8d')](_0x5aa385,_0xc008('0xc8')));rpcDb[_0xc008('0x65')](_0x5aa385,_0xc008('0xc9'));_0x4424f5[_0xc008('0x78')](_0x5aa385,'18',_0x4fdab4)['then'](function(_0x5e2610){_0x1bcbb1=_0x5e2610[_0xc008('0x79')]==0x1;if(!_0x1bcbb1){if(ut[_0xc008('0x7b')](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0x12,_0xc008('0x7c'));rpcDb[_0xc008('0x67')](_0x89bb20,_0xc008('0xc9'));}else{rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0xc9'));}}else{_0x5aa385['countnoanswerretry']++;_0x4424f5[_0xc008('0x86')]({'id':_0x5aa385[_0xc008('0x85')],'field':{'countnoanswerretry':_0x5aa385['countnoanswerretry']}})[_0xc008('0x54')](function(){_0x4424f5[_0xc008('0xab')](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});delete this[_0xc008('0x14')][_0xbd7422[_0xc008('0x83')]];break;case'19':_0x4fdab4[_0xc008('0xc3')]+=0x1;_0x5aa385['countglobal']=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0x13,_0xbd7422[_0xc008('0xc5')]||_0xbd7422[_0xc008('0xc6')]);ami['emit'](_0xc008('0xc7'),ut['buildObj'](_0x5aa385,_0xc008('0xc8')));rpcDb[_0xc008('0x65')](_0x5aa385,'[callProgressDetectingCustomer][machine]');_0x4424f5[_0xc008('0x78')](_0x5aa385,'18',_0x4fdab4)['then'](function(_0xc35f69){_0x1bcbb1=_0xc35f69['additional']==0x1;if(!_0x1bcbb1){if(ut['totalGlobal'](_0x5aa385)>=_0x4fdab4['dialGlobalMaxRetry']){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb['createCustomerFinal'](_0x89bb20,_0xc008('0xca'));}else{rpcDb[_0xc008('0x67')](_0x5aa385,'[callProgressDetectingCustomer][machine]');}}else{_0x5aa385[_0xc008('0xa5')]++;_0x4424f5[_0xc008('0x86')]({'id':_0x5aa385[_0xc008('0x85')],'field':{'countnoanswerretry':_0x5aa385['countnoanswerretry']}})[_0xc008('0x54')](function(){_0x4424f5[_0xc008('0xab')](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});});}});delete this[_0xc008('0x14')][_0xbd7422[_0xc008('0x83')]];break;default:if(_0x5aa385[_0xc008('0x3e')]){ut[_0xc008('0x4b')](_0x4fdab4,_0xc008('0xcb'));ut[_0xc008('0x4d')](_0xc008('0xcc')+_0x4fdab4[_0xc008('0x23')],_0xbd7422);}_0x4fdab4['outboundUnknownCallsDay']+=0x1;_0x5aa385[_0xc008('0x73')]=ut[_0xc008('0x7b')](_0x5aa385);ut[_0xc008('0x60')](_0x5aa385,0xc,_0xbd7422['cause-txt']||_0xbd7422[_0xc008('0xc6')]);_0x5dfb69=_0x4fdab4[_0xc008('0xba')];_0x5f58d7=_0x4fdab4[_0xc008('0xa8')];rpcDb['createCustomerHistory'](_0x5aa385,_0xc008('0xcd'));_0x4424f5['verifyAdditionalPhones'](_0x5aa385,'20',_0x4fdab4)[_0xc008('0x54')](function(_0x8bdd89){_0x1bcbb1=_0x8bdd89[_0xc008('0x79')]==0x1;if(!_0x1bcbb1){if(ut['totalGlobal'](_0x5aa385)>=_0x4fdab4[_0xc008('0x9f')]){_0x89bb20=ut[_0xc008('0xa0')](_0x5aa385,0xf,_0xc008('0x7c'));rpcDb[_0xc008('0x67')](_0x89bb20,_0xc008('0xce'));}else{rpcDb[_0xc008('0x67')](_0x5aa385,_0xc008('0xce'));}delete this['actions'][_0xbd7422[_0xc008('0x83')]];}else{_0x4424f5[_0xc008('0xab')](_0x5aa385,_0x5dfb69,_0x5f58d7)[_0xc008('0x54')](function(){});}});}if(!(_0x5aa385[_0xc008('0x3e')]&&_0x2b350c==='16')){ut['updateOriginated'](_0x4fdab4,_0xc008('0xcf'));logger['info'](_0xc008('0xd0'),_0x5aa385[_0xc008('0x8a')],_0xc008('0x8b'),_0x4fdab4[_0xc008('0x23')],_0xc008('0x3c'),_0x4fdab4[_0xc008('0x26')]);}if(_0x2b350c!==_0xc008('0x87')){delete this['actions'][_0xbd7422[_0xc008('0x83')]];delete this[_0xc008('0x14')][_0xbd7422[_0xc008('0xd1')]];}_0x4fdab4[_0xc008('0xd2')]=!![];}};Preview['prototype'][_0xc008('0xd3')]=function(_0x493e24,_0x2ea298,_0x3b2e99){if(_[_0xc008('0xd4')](_0x2ea298)&&'object'!==typeof _0x2ea298){return;}if(_['isUndefined'](_0x3b2e99)&&_0xc008('0xd5')!==typeof _0x3b2e99){return;}switch(_0x3b2e99['reason']){case'0':ut[_0xc008('0xd6')](_0x493e24,0x0,_0xc008('0x74'));rpcDb[_0xc008('0xd7')](_0x493e24,_0xc008('0xd8'));break;case'3':ut['logAgent'](_0x493e24,0x3,_0xc008('0xa6'));rpcDb[_0xc008('0xd7')](_0x493e24,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x493e24,0x5,_0xc008('0xd9'));rpcDb[_0xc008('0xd7')](_0x493e24,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xc008('0xd6')](_0x493e24,0x8,_0xc008('0xda'));rpcDb[_0xc008('0xd7')](_0x493e24,_0xc008('0xdb'));break;case'22':ut['logAgent'](_0x493e24,0x16,_0xc008('0xdc'));rpcDb[_0xc008('0xd7')](_0x493e24,_0xc008('0xdd'));break;default:ut[_0xc008('0xd6')](_0x493e24,0xc,_0x3b2e99[_0xc008('0xde')]);rpcDb[_0xc008('0xd7')](_0x493e24,_0xc008('0xdb'));}ut[_0xc008('0x4a')](_0x2ea298,_0xc008('0xdf'));logger[_0xc008('0x1e')](_0xc008('0xe0'),_0x493e24[_0xc008('0x8a')],_0xc008('0x8b'),_0x2ea298['name'],'originated:\x20',_0x2ea298[_0xc008('0x26')]);delete this[_0xc008('0x14')][_0x493e24[_0xc008('0x8a')]];};Preview[_0xc008('0xe')][_0xc008('0x78')]=function(_0x201674,_0xe5d226,_0x4b18d0){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x201674,_0xe5d226,_0x4b18d0)[_0xc008('0x47')](logger[_0xc008('0x1e')](_0xc008('0xe1')));};Preview['prototype'][_0xc008('0xab')]=function(_0x136124,_0x1190b3,_0x40a737){return cmHopperAdditionalPhone[_0xc008('0xab')](_0x136124,_0x1190b3,_0x40a737)[_0xc008('0x47')](logger[_0xc008('0x1e')](_0xc008('0xe2')));};Preview[_0xc008('0xe')][_0xc008('0x86')]=function(_0x3e4a01){return Promise[_0xc008('0xe3')]()['then'](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x3e4a01))[_0xc008('0x47')](logger[_0xc008('0x1e')]('[incrementPreviewCounters]\x20'));};Preview[_0xc008('0xe')][_0xc008('0xe4')]=function(_0x20e0b0,_0x15b272,_0x1cea87,_0x7a5ef9,_0x44bc80){var _0x2e7505=this;return new Promise(function(_0x3f916b,_0x48d2d7){if(_['isNil'](_0x15b272)||_['isNil'](_0x15b272[_0xc008('0xe5')])||_['isNil'](_0x15b272[_0xc008('0xe6')])||_[_0xc008('0x55')](_0x15b272[_0xc008('0x42')])){_0x48d2d7(ut[_0xc008('0x48')](_0xc008('0xe7'),_0x7a5ef9,_0x44bc80));return;}var _0x2073be=uuid['v4']();var _0x293fc5=_0x2e7505[_0xc008('0x11')][_0x15b272[_0xc008('0x3a')][_0xc008('0x23')]];var _0x2b819f=_0x1cea87?_0x2e7505[_0xc008('0x53')][_0x1cea87]['id']:undefined;_0x2e7505[_0xc008('0x14')][_0x2073be]=new Action(_0x15b272,_0x293fc5,_0x2073be,_0x1cea87,_0x2b819f);var _0x304083=_0x2e7505[_0xc008('0x14')][_0x2073be];_0x304083[_0xc008('0x81')]=_0x7a5ef9;_0x304083[_0xc008('0x82')]=_0x44bc80;_0x304083['lookAgent']=_0x1cea87;if(_[_0xc008('0xe8')](_0x20e0b0)){_0x2e7505['execCall'](_0x304083,_0x293fc5,_0x15b272,_0x1cea87)[_0xc008('0x54')](function(_0x176dc8){logger[_0xc008('0x1e')]('[Preview][execCall][success]',_0xc008('0xe9')+_0x304083[_0xc008('0x3b')]+_0xc008('0xea')+_0x304083[_0xc008('0x85')],JSON[_0xc008('0x20')](_0x176dc8));ami[_0xc008('0x24')](_0xc008('0xeb'),ut['buildObj'](_0x304083,_0xc008('0xec'),_0x2e7505[_0xc008('0x11')][_0x304083[_0xc008('0x3b')]]));_0x3f916b(ut[_0xc008('0x48')]('Calling'));})['catch'](function(_0x4f971d){ut['logger'](_0xc008('0xed'),_0x4f971d);_0x48d2d7(ut[_0xc008('0x48')](_0xc008('0xee'),_0x7a5ef9,_0x44bc80));});}else{_0x293fc5[_0xc008('0xef')]+=0x1;ut['logBlacklist'](_0x304083);rpcDb[_0xc008('0xf0')](_0x304083,_0xc008('0xf1'));delete _0x2e7505[_0xc008('0x14')][_0x2073be];_0x48d2d7(ut['message'](_0xc008('0xf2'),_0x7a5ef9,_0x44bc80));}});};Preview['prototype'][_0xc008('0x6d')]=function(_0x48862b){return!_[_0xc008('0x55')](_0x48862b)&&!_[_0xc008('0x55')](_0x48862b[_0xc008('0x23')])&&!_[_0xc008('0x55')](_0x48862b['active'])&&_0x48862b[_0xc008('0xf3')]&&!_[_0xc008('0x55')](this[_0xc008('0x13')][util[_0xc008('0x21')](_0xc008('0xf4'),_0x48862b[_0xc008('0x23')])])&&!_[_0xc008('0x55')](this['trunks'][util[_0xc008('0x21')](_0xc008('0xf4'),_0x48862b[_0xc008('0x23')])]['status'])&&(this['trunks'][util[_0xc008('0x21')](_0xc008('0xf4'),_0x48862b[_0xc008('0x23')])][_0xc008('0x45')]==='reachable'||this[_0xc008('0x13')][util[_0xc008('0x21')]('SIP/%s',_0x48862b['name'])]['status']===_0xc008('0xf5'));};Preview['prototype'][_0xc008('0x5a')]=function(_0x4a5ff4,_0x1e1d9f){return this[_0xc008('0xf6')](_0x4a5ff4,_0x1e1d9f)[_0xc008('0x54')](function(_0x120890){return _['pick'](_0x120890,['message']);})[_0xc008('0x47')](function(_0x274739){if(_0x274739[_0xc008('0xf7')]){rpcDb['unlockContact'](_0x4a5ff4);}if(_0x274739[_0xc008('0xf3')]){rpcDb[_0xc008('0x5d')](_0x4a5ff4);}throw _[_0xc008('0x3f')](_0x274739,[_0xc008('0x48')]);});};Preview[_0xc008('0xe')][_0xc008('0xf6')]=function(_0x3a2943,_0x2087b3){var _0x3994ea=this;var _0x19305c,_0xc7cb80;return rpcDb['getContactPreview'](_0x3a2943)['then'](function(_0x2f8ef9){if(!_['isNil'](_0x2f8ef9[0x0])){_0xc7cb80=_0x2f8ef9[0x0][_0xc008('0xf8')]?![]:!![];_0x19305c=_0x2f8ef9[0x0][_0xc008('0xf8')]?!![]:![];_0x19305c=_0x2087b3?!![]:_0x19305c;}var _0x4a7268=_0x3994ea['validateContact'](_0x2f8ef9);if(_0x4a7268[_0xc008('0xf9')]){rpcDb[_0xc008('0xfa')](_[_0xc008('0x3f')](_0x2f8ef9[0x0],[_0xc008('0x42'),_0xc008('0xe6')]))[_0xc008('0x54')](function(_0x536a81){_0x3994ea[_0xc008('0xe4')](_0x536a81,_0x2f8ef9[0x0],_0x2087b3,_0xc7cb80,_0x19305c)[_0xc008('0x54')](function(_0x62e889){return _0x62e889;})['catch'](function(_0x21a898){throw _0x21a898;});})[_0xc008('0x47')](function(_0xcef0e4){ut[_0xc008('0x2a')]('[Preview][checkIsBlackList]',_0xcef0e4);throw ut['message'](_0xc008('0xfb'),_0xc7cb80,_0x19305c);});}else{throw ut['message'](_0x4a7268[_0xc008('0x48')],_0xc7cb80,_0x19305c);}})[_0xc008('0x47')](function(_0x222a5d){ut[_0xc008('0x2a')](_0xc008('0xfc'),_0x222a5d);throw ut['message']('Call\x20unsuccessful',![],!![]);});};Preview[_0xc008('0xe')][_0xc008('0xfd')]=function(_0xa51fe7){if(_[_0xc008('0x55')](_0xa51fe7)||_[_0xc008('0xe8')](_0xa51fe7)||!_[_0xc008('0x55')](_0xa51fe7[0x0][_0xc008('0x58')])&&_['isNil'](_0xa51fe7[0x0][_0xc008('0x58')][_0xc008('0x23')])){ut[_0xc008('0x2a')](_0xc008('0xfe'),_0xa51fe7);return{'isValid':![],'message':_0xc008('0xff')};}var _0x1c2263=this[_0xc008('0x11')][_0xa51fe7[0x0][_0xc008('0x3a')][_0xc008('0x23')]];_0x1c2263[_0xc008('0x48')]=utils[_0xc008('0x28')][_0xc008('0x6f')];if(_['isNil'](_0x1c2263)){ut[_0xc008('0x2a')](_0xc008('0x100'),_0x1c2263);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xc008('0x6d')](_0x1c2263[_0xc008('0x6e')])){ut[_0xc008('0x2a')](_0xc008('0x101'),_0xc008('0x102')+_0x1c2263[_0xc008('0x23')]+_0xc008('0x103'));if(!this[_0xc008('0x6d')](_0x1c2263[_0xc008('0x104')])){ut[_0xc008('0x2a')](_0xc008('0x101'),_0x1c2263['name']+_0xc008('0x105'));return{'isValid':![],'message':_0xc008('0x106')};}}if(!ut[_0xc008('0x6c')](_0x1c2263[_0xc008('0x107')])){ut[_0xc008('0x2a')](_0xc008('0x108'),_0x1c2263[_0xc008('0x23')]+_0xc008('0x109'));return{'isValid':![],'message':_0xc008('0x102')+_0x1c2263[_0xc008('0x23')]+_0xc008('0x109')};}return{'isValid':!![],'message':_0xc008('0x10a')};};Preview[_0xc008('0xe')][_0xc008('0x10b')]=function(_0x26b5c8,_0x194e6a,_0x5c358b,_0x49688b){var _0x51fd86=this;return new Promise(function(_0x10778f,_0x237ffb){var _0x3f80f4=_0x26b5c8[_0xc008('0x8a')];var _0x1a0565=_0x51fd86[_0xc008('0x6d')](_0x194e6a[_0xc008('0x6e')])?util['format'](_0xc008('0x10c'),_0x194e6a['Trunk']['name'],_[_0xc008('0x55')](_0x194e6a[_0xc008('0x10d')])?'':_0x194e6a['dialPrefix'][_0xc008('0x10e')]()||'',_0x194e6a[_0xc008('0x10f')]>0x0?_0x5c358b[_0xc008('0xe6')]['substring'](_0x194e6a[_0xc008('0x10f')]):_0x5c358b[_0xc008('0xe6')]):util[_0xc008('0x21')]('SIP/%s/%s%s',_[_0xc008('0x55')](_0x194e6a[_0xc008('0x104')])?_0x194e6a[_0xc008('0x6e')][_0xc008('0x23')]:_0x194e6a[_0xc008('0x104')][_0xc008('0x23')],_[_0xc008('0x55')](_0x194e6a[_0xc008('0x10d')])?'':_0x194e6a['dialPrefix'][_0xc008('0x10e')]()||'',_0x194e6a[_0xc008('0x10f')]>0x0?_0x5c358b[_0xc008('0xe6')][_0xc008('0x110')](_0x194e6a[_0xc008('0x10f')]):_0x5c358b['phone']);var _0xb04a1c=_0x51fd86[_0xc008('0x6d')](_0x194e6a[_0xc008('0x6e')])?ut[_0xc008('0x111')](_0x194e6a[_0xc008('0x6e')][_0xc008('0x112')],_0x194e6a[_0xc008('0x113')],_0x194e6a[_0xc008('0x114')]>0x0?ut['getCallerIdRandom'](_0x194e6a[_0xc008('0x115')],_0x194e6a[_0xc008('0x114')]):_0x194e6a[_0xc008('0x115')]):ut[_0xc008('0x111')](_['isNil'](_0x194e6a['TrunkBackup'])?_0x194e6a[_0xc008('0x6e')][_0xc008('0x112')]:_0x194e6a['TrunkBackup'][_0xc008('0x112')],_0x194e6a[_0xc008('0x113')],_0x194e6a[_0xc008('0x114')]>0x0?ut[_0xc008('0x116')](_0x194e6a[_0xc008('0x115')],_0x194e6a[_0xc008('0x114')]):_0x194e6a[_0xc008('0x115')]);if(_0xb04a1c){_0x26b5c8['originatecalleridname']=ut['extractCalleridName'](_0xb04a1c);_0x26b5c8[_0xc008('0x117')]=ut['extractCalleridNumber'](_0xb04a1c);}var _0x1e981e=ut[_0xc008('0x118')](_0x194e6a,_0x5c358b,_0x1a0565,_0xb04a1c,_0x3f80f4,_0x26b5c8);_[_0xc008('0x119')](_0x26b5c8,ut[_0xc008('0x11a')](_0x1e981e));_0x26b5c8[_0xc008('0x11b')]=moment()[_0xc008('0x21')](_0xc008('0x5e'));_0x194e6a[_0xc008('0x11c')]=_0x1e981e;var _0x367873=ut[_0xc008('0x11d')](_0x26b5c8,_0x194e6a,_0x1e981e,_0x26b5c8[_0xc008('0x82')],_0x49688b);return ami['Action'](_0x367873)[_0xc008('0x54')](function(_0x39fd43){_0x194e6a[_0xc008('0x26')]+=0x1;logger[_0xc008('0x1e')](_0xc008('0x11e'),_0x3f80f4,_0xc008('0x8b'),_0x194e6a[_0xc008('0x23')],'originated:\x20',_0x194e6a[_0xc008('0x26')]);_0x10778f(_0x39fd43);})[_0xc008('0x47')](function(_0x3c537b){ut['logAgent'](_0x26b5c8,0xe,_0xc008('0x11f'));rpcDb[_0xc008('0xd7')](_0x26b5c8,_0xc008('0x120'));_0x237ffb(_0x3c537b);});});};Preview[_0xc008('0xe')][_0xc008('0x121')]=function(_0x122b28){if(this['actions'][_0x122b28['linkedid']]){this[_0xc008('0x14')][_0x122b28[_0xc008('0x83')]][_0xc008('0x46')]=_0x122b28[_0xc008('0x46')];}};Preview[_0xc008('0xe')]['syncOriginateResponse']=function(_0x7c1bf8){var _0x569ac1=this;var _0x15cdd1=this[_0xc008('0x14')][_0x7c1bf8['actionid']];if(_0x15cdd1){if(_0x15cdd1[_0xc008('0x122')]&&this[_0xc008('0x53')][_0x15cdd1[_0xc008('0x122')]]){ut[_0xc008('0x123')](_0x15cdd1,this['agents'][_0x15cdd1[_0xc008('0x122')]][_0xc008('0x23')],this[_0xc008('0x53')][_0x15cdd1[_0xc008('0x122')]]['id']);}var _0x157b26=_['clone'](_0x15cdd1);_0x157b26[_0xc008('0x88')]=moment()[_0xc008('0x21')](_0xc008('0x5e'));var _0x4ca3fa=_0x569ac1[_0xc008('0x11')][_0x15cdd1[_0xc008('0x3b')]];if(ut[_0xc008('0x124')](_0x7c1bf8[_0xc008('0x125')])){if(_0x15cdd1['unlockAgent']){rpcDb[_0xc008('0x126')](_0x15cdd1[_0xc008('0x85')]);}if(_0x15cdd1[_0xc008('0x82')]){rpcDb[_0xc008('0x5d')](_0x15cdd1[_0xc008('0x85')]);}ami['emit'](_0xc008('0x127'),ut['buildObj'](_0x15cdd1,'rejected',this[_0xc008('0x11')][_0x15cdd1['queue']]));this[_0xc008('0xd3')](_0x157b26,_0x4ca3fa,_0x7c1bf8);}else{_0x15cdd1[_0xc008('0x11b')]=moment()[_0xc008('0x21')](_0xc008('0x5e'));ut[_0xc008('0xd6')](_0x157b26,0x4,_0xc008('0x128'));rpcDb[_0xc008('0xd7')](_0x157b26,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xc008('0xe')][_0xc008('0x19')]=function(_0x267756){var _0x45fe90=this[_0xc008('0x14')][_0x267756[_0xc008('0x83')]];var _0x59b5b9;if(_0x45fe90){_0x59b5b9=this[_0xc008('0x11')][_0x45fe90[_0xc008('0x3b')]];logger[_0xc008('0x1e')](_0xc008('0x129'),_0x267756[_0xc008('0x83')],_0xc008('0x8b'),_0x59b5b9[_0xc008('0x23')],_0xc008('0x3d'),_0x59b5b9['pTalking']);}if(this['actions'][_0x267756[_0xc008('0x83')]]&&_0x267756[_0xc008('0x83')]!==_0x267756['uniqueid']){if(_0x267756[_0xc008('0x12a')]==='16'&&this['actions'][_0x267756[_0xc008('0x83')]][_0xc008('0x3e')]){this[_0xc008('0x70')](_0x267756,_0x267756[_0xc008('0x83')],_0x267756[_0xc008('0x12a')]);}else if(this[_0xc008('0x14')][_0x267756[_0xc008('0x83')]]['dialAnswer']){logger[_0xc008('0x1e')]('[syncHangup][talking][cause]',_0x267756[_0xc008('0x83')],_0x267756[_0xc008('0x12a')],_0xc008('0x8b'),_0x59b5b9[_0xc008('0x23')],_0xc008('0x3d'),_0x59b5b9[_0xc008('0x27')]);this[_0xc008('0x70')](_0x267756,_0x267756['linkedid'],_0x267756[_0xc008('0x12a')]);}}else if(_0x45fe90&&_[_0xc008('0x55')](_0x45fe90['statedesc'])&&_0x59b5b9[_0xc008('0x12b')]&&_0x267756[_0xc008('0x83')]===_0x267756[_0xc008('0x8a')]&&_[_0xc008('0x55')](_0x267756[_0xc008('0xde')])&&_0x267756[_0xc008('0x12a')]==='16'&&_0x267756['channelstate']==='6'&&_[_0xc008('0xd4')](_0x45fe90[_0xc008('0x12c')])){if(_0x45fe90[_0xc008('0x81')]){rpcDb[_0xc008('0x126')](_0x45fe90['idContact']);}if(_0x45fe90['activeContact']){rpcDb['disableContact'](_0x45fe90[_0xc008('0x85')]);}_0x267756[_0xc008('0xde')]='22';this['callProgressDetectingAgent'](_0x45fe90,_0x59b5b9,_0x267756);}else if(_0x45fe90&&_0x45fe90['transfer']){if(_0x267756['cause']==='16'&&this['actions'][_0x267756[_0xc008('0x83')]][_0xc008('0x3e')]){logger['info'](_0xc008('0x12d'),_0x267756[_0xc008('0x83')],_0x267756[_0xc008('0x12a')],_0xc008('0x8b'),_0x59b5b9[_0xc008('0x23')],'pTalking:\x20',_0x59b5b9['pTalking']);this[_0xc008('0x70')](_0x267756,_0x267756[_0xc008('0x83')],_0x267756[_0xc008('0x12a')]);}else if(this[_0xc008('0x14')][_0x267756[_0xc008('0x83')]][_0xc008('0x3e')]){logger[_0xc008('0x1e')]('[syncHangup][talking][cause]',_0x267756[_0xc008('0x83')],_0x267756[_0xc008('0x12a')],_0xc008('0x8b'),_0x59b5b9[_0xc008('0x23')],_0xc008('0x3d'),_0x59b5b9[_0xc008('0x27')]);this[_0xc008('0x70')](_0x267756,_0x267756['linkedid'],_0x267756['cause']);}}};Preview[_0xc008('0xe')][_0xc008('0x1b')]=function(_0x11bcba){if(this[_0xc008('0x14')][_0x11bcba[_0xc008('0xd1')]]&&_0x11bcba[_0xc008('0xd1')]!==_0x11bcba[_0xc008('0x12e')]){this[_0xc008('0x70')](_0x11bcba,_0x11bcba[_0xc008('0xd1')],_0x11bcba[_0xc008('0xc6')]);}};Preview[_0xc008('0xe')][_0xc008('0x12f')]=function(_0x37e1f2){if(this['actions'][_0x37e1f2['linkedid']]&&_0x37e1f2[_0xc008('0x83')]!==_0x37e1f2[_0xc008('0x8a')]&&!this[_0xc008('0x14')][_0x37e1f2[_0xc008('0x83')]][_0xc008('0x3e')]){if(_0x37e1f2[_0xc008('0x12a')]==='1'){this[_0xc008('0x70')](_0x37e1f2,_0x37e1f2['linkedid'],_0x37e1f2['cause']);}}};Preview['prototype'][_0xc008('0x130')]=function(_0x4b7132,_0x4dd095,_0x4b37c6){if(this[_0xc008('0x14')][_0x4b7132]){if(_[_0xc008('0x55')](this[_0xc008('0x14')][_0x4b7132][_0xc008('0x11c')])){this[_0xc008('0x14')][_0x4b7132][_0xc008('0x11c')]={};}this[_0xc008('0x14')][_0x4b7132][_0xc008('0x11c')][_0x4dd095]=_0x4b37c6;}};Preview[_0xc008('0xe')][_0xc008('0x131')]=function(_0x355b1d){try{if(!_[_0xc008('0x55')](_0x355b1d)){if(ut['filterKey'](_['keys'](_0x355b1d[_0xc008('0x132')])[0x0])){this[_0xc008('0x130')](_0x355b1d[_0xc008('0x8a')],_[_0xc008('0x133')](_0x355b1d[_0xc008('0x132')])[0x0],_0x355b1d[_0xc008('0x134')]);}}}catch(_0xcdba52){logger[_0xc008('0x135')]('[syncVarSet][Preview]',util[_0xc008('0x136')](_0xcdba52,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x5c7afe){if(_0x5c7afe){if(this['actions'][_0x5c7afe[_0xc008('0x137')]]){this['actions'][_0x5c7afe[_0xc008('0x137')]][_0xc008('0x12c')]=!![];}}};Preview[_0xc008('0xe')]['syncBlindTransfer']=function(_0x4e33e3){if(_0x4e33e3){if(this[_0xc008('0x14')][_0x4e33e3[_0xc008('0x138')]]){this['actions'][_0x4e33e3[_0xc008('0x138')]][_0xc008('0x12c')]=!![];}}};module[_0xc008('0x139')]=Preview; \ No newline at end of file +var _0x3e74=['unmonitored','run','execRun','unlock','unlockContact','getContactPreview','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20working\x20correctly','dialActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','Action','[originated][increment]','OriginateError','syncNewExten','actionid','logLookAgent','YYYY-MM-DD\x20HH:mm:ss','response','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','util','uuid','moment','ioredis','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','../dialer/utils','redis','defaults','localhost','tail','sequence','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','prototype','syncCampaigns','hasOwnProperty','dialMethod','type','outbound','clearZombieChannels','recallMe','clearZombieChannel','queue','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','Agent','voicePause','[RecallMe]','disableContact','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','logger2','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','dialBusyRetryFrequency','busy','additional','Global','dialBusyMaxRetry','countbusyretry','incrementPreviewCounters','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Queue','agents','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable'];(function(_0x51fb53,_0x337b2f){var _0x4c0fb5=function(_0x21287b){while(--_0x21287b){_0x51fb53['push'](_0x51fb53['shift']());}};_0x4c0fb5(++_0x337b2f);}(_0x3e74,0x175));var _0x43e7=function(_0x258750,_0x1cda2d){_0x258750=_0x258750-0x0;var _0x3613d5=_0x3e74[_0x258750];return _0x3613d5;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var uuid=require(_0x43e7('0x1'));var moment=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x43e7('0x4'));var loggerAction=require('../../../config/logger')(_0x43e7('0x5'));var ami=require(_0x43e7('0x6'));var rpcDb=require(_0x43e7('0x7'));var cmHopperAdditionalPhone=require(_0x43e7('0x8'));var Action=require(_0x43e7('0x9'));var ut=require('./util/util');var utils=require(_0x43e7('0xa'));config[_0x43e7('0xb')]=_[_0x43e7('0xc')](config[_0x43e7('0xb')],{'host':_0x43e7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x39c8bd){this[_0x43e7('0xe')]=this['tail']?this[_0x43e7('0xe')]['finally'](_0x39c8bd):_0x39c8bd();};function Preview(_0xf7c520){this[_0x43e7('0xf')]=new Sequence();this['campaignsPreview']=_0xf7c520[_0x43e7('0x10')];this[_0x43e7('0x11')]=_0xf7c520[_0x43e7('0x11')];this[_0x43e7('0x12')]={};this['agents']=_0xf7c520['agents'];this[_0x43e7('0x13')]=0x0;ami['on'](_0x43e7('0x14'),this[_0x43e7('0x15')]['bind'](this));ami['on']('hangup',this[_0x43e7('0x16')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x18'),this[_0x43e7('0x19')]['bind'](this));ami['on']('dialend',this[_0x43e7('0x1a')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x43e7('0x1c'),this[_0x43e7('0x1d')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1e'),this[_0x43e7('0x1f')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x20'),this[_0x43e7('0x21')][_0x43e7('0x17')](this));this[_0x43e7('0x22')](this[_0x43e7('0x23')]);}function emit(_0x177ee1,_0x4b5d64,_0xef1a5a){io['to'](_0x177ee1)[_0x43e7('0x24')](_0x4b5d64,_0xef1a5a);}function emitVoiceQueueChannelRemove(_0x4b386b){logger[_0x43e7('0x25')](_0x43e7('0x26'),JSON[_0x43e7('0x27')](_0x4b386b));emit(util[_0x43e7('0x28')](_0x43e7('0x29'),_0x4b386b[_0x43e7('0x2a')]),'voice_queue_channel:remove',_0x4b386b);io[_0x43e7('0x24')]('voice_queue_presence:remove',_0x4b386b);}function notSendMessagesQueue(_0x4c9df3){if(_0x4c9df3[_0x43e7('0x2b')]){if(_0x4c9df3[_0x43e7('0x2c')]===0x0&&_0x4c9df3['pTalking']===0x0){_0x4c9df3[_0x43e7('0x2b')]=![];_0x4c9df3['available']=0x0;_0x4c9df3[_0x43e7('0x2d')]=0x0;_0x4c9df3['message']=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3['name']+'\x20is\x20not\x20active');}else{_0x4c9df3[_0x43e7('0x32')]=utils['CAMPAIGN_STATUS'][_0x43e7('0x33')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3[_0x43e7('0x2a')]+'\x20is\x20deactivated');}}}Preview[_0x43e7('0x34')][_0x43e7('0x22')]=function(){var _0x45b675=this;setInterval(function(){_0x45b675[_0x43e7('0x35')]();},0x7cf);};Preview[_0x43e7('0x34')][_0x43e7('0x35')]=function(){var _0x2b85a5=this[_0x43e7('0x23')];this[_0x43e7('0x13')]+=0x1;for(var _0x35dbcd in _0x2b85a5){if(_0x2b85a5[_0x43e7('0x36')](_0x35dbcd)&&(_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')||_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]==='booked')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(this[_0x43e7('0x13')]>0x7){this[_0x43e7('0x13')]=0x0;this[_0x43e7('0x3a')]();}}if(_0x2b85a5['hasOwnProperty'](_0x35dbcd)&&_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(_0x2b85a5[_0x35dbcd]['dialActive']){this['setMessage'](_0x2b85a5[_0x35dbcd]);if(_0x2b85a5[_0x35dbcd]['dialPreviewAutoRecallMe'])this[_0x43e7('0x3b')](_0x2b85a5[_0x35dbcd]);}else{notSendMessagesQueue(_0x2b85a5[_0x35dbcd]);}}}};Preview[_0x43e7('0x34')][_0x43e7('0x3c')]=function(_0x234fe6){var _0x108313=this;this[_0x43e7('0xf')]['enqueue'](function(){if(!_['isNil'](_0x108313['actions'][_0x234fe6])){loggerAction['info']('[clearZombieChannels][talking]',_0x234fe6,'Queue',_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')],'originated:\x20',JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]][_0x43e7('0x2c')]),_0x43e7('0x3e'),JSON[_0x43e7('0x27')](_0x108313['campaignsPreview'][_0x108313['actions'][_0x234fe6]['queue']][_0x43e7('0x3f')]),JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]),JSON[_0x43e7('0x27')](_[_0x43e7('0x41')](_0x108313[_0x43e7('0x12')][_0x234fe6],[_0x43e7('0x42'),'UserId',_0x43e7('0x43'),_0x43e7('0x44')])));return ami['Action']({'action':_0x43e7('0x45'),'channel':_0x108313['actions'][_0x234fe6][_0x43e7('0x46')]})[_0x43e7('0x47')](function(_0x1c6f45){if(_0x1c6f45[_0x43e7('0x32')]===_0x43e7('0x48')){setTimeout(function(){if(_0x108313[_0x43e7('0x12')][_0x234fe6]){ut['updateOriginated'](_0x108313['campaignsPreview'][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]],_0x43e7('0x49'));if(_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]===!![]){ut['decrementTalkink'](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']],_0x43e7('0x49'));ut['loggerError'](_0x43e7('0x4a')+_0x234fe6,_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')]);}ut[_0x43e7('0x4b')](_0x43e7('0x4c')+_0x234fe6,_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']);delete _0x108313['actions'][_0x234fe6];}},0x2328);}});}});};Preview[_0x43e7('0x34')][_0x43e7('0x3a')]=function(){var _0xe979b5=this;loggerAction[_0x43e7('0x25')]('[action]',_['size'](this['actions']));for(var _0x35e4fb in this['actions']){if(_0xe979b5[_0x43e7('0x12')]['hasOwnProperty'](_0x35e4fb)){_0xe979b5['clearZombieChannel'](_0x35e4fb);}}};Preview[_0x43e7('0x34')]['recallMe']=function(_0x2de14f){var _0x39db7f=this;rpcDb[_0x43e7('0x4d')](_0x2de14f['id'],ut[_0x43e7('0x4e')](this['agents']))[_0x43e7('0x4f')](function(_0x2b9046){if(!_[_0x43e7('0x50')](_0x2b9046)){for(var _0x1fd277=0x0;_0x1fd277<_0x2b9046[_0x43e7('0x51')];_0x1fd277+=0x1){if(ut[_0x43e7('0x52')](_0x2b9046[_0x1fd277]['scheduledat'])<_0x2de14f['dialRecallMeTimeout']*0x3c){if(_0x2b9046[_0x1fd277][_0x43e7('0x53')]&&!_0x2b9046[_0x1fd277][_0x43e7('0x53')][_0x43e7('0x54')]){_0x39db7f['run'](_0x2b9046[_0x1fd277]['id'])['then'](ut['logger2'](_0x43e7('0x55')))[_0x43e7('0x47')](ut['logger2'](_0x43e7('0x55')));}else{rpcDb[_0x43e7('0x56')](_0x2b9046[_0x1fd277]['id']);}}else{var _0x3c96fe=new Action(_0x2b9046[_0x1fd277],_0x2de14f);_0x3c96fe['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2de14f['outboundReCallsDay']+=0x1;ut[_0x43e7('0x57')](_0x3c96fe,0x17,_0x43e7('0x58'));if(_0x2de14f['dialRecallInQueue']){rpcDb[_0x43e7('0x59')](ut[_0x43e7('0x5a')](_0x2b9046[_0x1fd277]));rpcDb[_0x43e7('0x5b')](_0x3c96fe,_0x43e7('0x5c'));}else{ut['logCustomer'](_0x3c96fe,0x16,_0x43e7('0x5d'));rpcDb['createCustomerHistory'](_0x3c96fe,'[HistoryRecallClose]');rpcDb[_0x43e7('0x5e')](_0x3c96fe,_0x43e7('0x5f'));}}}}})[_0x43e7('0x47')](ut[_0x43e7('0x60')](_0x43e7('0x61')));};Preview[_0x43e7('0x34')][_0x43e7('0x62')]=function(_0x256ddd){_0x256ddd[_0x43e7('0x2b')]=!![];if(ut[_0x43e7('0x63')](_0x256ddd['loggedIn'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')]['NO_AGENTS_LOGGED'];}else if(!ut[_0x43e7('0x64')](_0x256ddd['dialActive'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];}else if(!this[_0x43e7('0x65')](_0x256ddd[_0x43e7('0x66')])){if(!this['isTrunkReachable'](_0x256ddd['TrunkBackup'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x67')];}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}};Preview[_0x43e7('0x34')][_0x43e7('0x69')]=function(_0x4ace49,_0x1ec35a,_0x2da2f3){var _0x50a3fa=this;var _0x4314d8=this[_0x43e7('0x12')][_0x1ec35a];var _0x2d0052=this['campaignsPreview'][_0x4314d8['queue']];var _0x459c13;var _0x3d9a29=![];var _0x4ebdde=0x2;var _0x283dd8=0x3;if(_0x2d0052){switch(_0x2da2f3){case'1':_0x2d0052['outboundNoSuchCallsDay']+=0x1;_0x4314d8['countnosuchnumberretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x0,_0x43e7('0x6c'));ami[_0x43e7('0x24')]('custom:agentnosuchnumber',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x6e')));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0x6f'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'0',_0x2d0052)[_0x43e7('0x4f')](function(_0x5bb536){_0x3d9a29=_0x5bb536['additional']==0x1;_0x4ebdde=_0x2d0052['dialNoSuchNumberRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0x74'));}else{if(_0x4314d8[_0x43e7('0x75')]>=_0x2d0052[_0x43e7('0x76')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x75'),_0x2d0052[_0x43e7('0x79')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x4314d8[_0x43e7('0x75')]++;logger[_0x43e7('0x25')](_0x43e7('0x7d'),_0x4314d8['countnosuchnumberretry']);logger['info']('id',_0x4314d8[_0x43e7('0x7e')]);_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8['idContact'],'field':{'countnosuchnumberretry':_0x4314d8['countnosuchnumberretry']}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});break;case _0x43e7('0x80'):var _0x135791=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x4314d8[_0x43e7('0x81')]=_0x135791;_0x4314d8[_0x43e7('0x82')]=_0x135791;_0x4314d8[_0x43e7('0x40')]=!![];_0x2d0052[_0x43e7('0x3f')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x83'),_0x4314d8[_0x43e7('0x84')],'\x20Queue',_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);ami['emit']('custom:agentconnect',ut[_0x43e7('0x6d')](_0x4314d8,'connect',this['campaignsPreview'][_0x4314d8[_0x43e7('0x3d')]]));if(_0x2d0052[_0x43e7('0x85')]){ami['emit'](_0x43e7('0x86'),ut[_0x43e7('0x87')](_0x4314d8));}break;case'16':ami[_0x43e7('0x24')](_0x43e7('0x88'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89'),this[_0x43e7('0x23')][_0x4314d8['queue']]));emitVoiceQueueChannelRemove(ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89')));_0x2d0052['outboundAnswerCallsDay']+=0x1;_0x2d0052[_0x43e7('0x8a')]+=0x1;_0x2d0052['answered']+=0x1;ut[_0x43e7('0x8b')](_0x2d0052,_0x43e7('0x8c'));_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x4,_0x43e7('0x8d'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0x8e'));rpcDb['createCustomerFinal'](_0x4314d8,_0x43e7('0x8f'));rpcDb[_0x43e7('0x90')](_0x4314d8);_0x2d0052[_0x43e7('0x91')]+=_0x4314d8[_0x43e7('0x92')];_0x2d0052[_0x43e7('0x93')]+=_0x4314d8['talktime'];logger[_0x43e7('0x25')](_0x43e7('0x94'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);delete this['actions'][_0x4ace49['linkedid']];break;case _0x43e7('0x96'):_0x2d0052['outboundBusyCallsDay']+=0x1;_0x4314d8['countbusyretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x5,_0x43e7('0x97'));_0x4ebdde=_0x2d0052[_0x43e7('0x98')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentbusy',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x99')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'5',_0x2d0052)[_0x43e7('0x4f')](function(_0x184ae3){_0x3d9a29=_0x184ae3[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4314d8['countbusyretry']>=_0x2d0052[_0x43e7('0x9c')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x9d'),_0x2d0052[_0x43e7('0x98')]),_0x4314d8['unlockAgent'],_0x4314d8['activeContact']);}}}else{_0x4314d8['countbusyretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countbusyretry':_0x4314d8['countbusyretry']}})['then'](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0x9f'):_0x2d0052['outboundNoAnswerCallsDay']+=0x1;_0x4314d8[_0x43e7('0xa0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x3,'NoAnswer');_0x4ebdde=_0x2d0052[_0x43e7('0xa1')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];var _0xa66309=ut[_0x43e7('0xa2')](_0x4314d8,_0x2d0052);ami[_0x43e7('0x24')](_0x43e7('0xa3'),_0xa66309);rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xa4'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'3',_0x2d0052)['then'](function(_0x109c86){_0x3d9a29=_0x109c86[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xa5'));}else{if(_0x4314d8['countnoanswerretry']>=_0x2d0052[_0x43e7('0xa6')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xa4'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xa0'),_0x2d0052[_0x43e7('0xa1')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xa7'):_0x2d0052['outboundCongestionCallsDay']+=0x1;_0x4314d8['countcongestionretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x8,_0x43e7('0xa8'));_0x4ebdde=_0x2d0052[_0x43e7('0xa9')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];ami['emit'](_0x43e7('0xaa'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xab')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xac'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'8',_0x2d0052)['then'](function(_0x403276){_0x3d9a29=_0x403276[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xad'));}else{if(_0x4314d8[_0x43e7('0xae')]>=_0x2d0052['dialCongestionMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xac'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xae'),_0x2d0052['dialBusyRetryFrequency']),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8['countcongestionretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countcongestionretry':_0x4314d8[_0x43e7('0xae')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'CANCEL':_0x2d0052[_0x43e7('0xaf')]+=0x1;_0x4314d8[_0x43e7('0xb0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x14,_0x43e7('0xb1'));_0x4ebdde=_0x2d0052[_0x43e7('0xb2')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentreject',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xb3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xb4'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'20',_0x2d0052)['then'](function(_0x2c5bf9){_0x3d9a29=_0x2c5bf9[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4314d8[_0x43e7('0xb0')]>=_0x2d0052['dialAgentRejectMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xb5'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xb0'),_0x2d0052['dialAgentRejectRetryFrequency']),_0x4314d8['unlockAgent'],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xb6'):_0x2d0052[_0x43e7('0xb7')]+=0x1;_0x4314d8[_0x43e7('0xb8')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xb,_0x43e7('0xb9'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xba'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'11',_0x2d0052)[_0x43e7('0x4f')](function(_0x3286b1){_0x3d9a29=_0x3286b1[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xba'));}else{if(_0x4314d8[_0x43e7('0xbb')]>=_0x2d0052[_0x43e7('0xbc')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x43e7('0x77')](ut['scheduledAt'](_0x4314d8,_0x43e7('0xb8'),_0x2d0052[_0x43e7('0xbd')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'18':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countmachineretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x12,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami[_0x43e7('0x24')](_0x43e7('0xc1'),ut['buildObj'](_0x4314d8,'amd'));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0xc2'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'18',_0x2d0052)['then'](function(_0x4d7f0f){_0x3d9a29=_0x4d7f0f[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x12,'Global');rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc2'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc2'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];break;case'19':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut['totalGlobal'](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x13,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami['emit'](_0x43e7('0xc1'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xc3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][machine]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'18',_0x2d0052)['then'](function(_0x299086){_0x3d9a29=_0x299086[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut['totalGlobal'](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc4'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc4'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});delete this['actions'][_0x4ace49[_0x43e7('0x7c')]];break;default:if(_0x4314d8[_0x43e7('0x40')]){ut[_0x43e7('0x8b')](_0x2d0052,'[default]');ut[_0x43e7('0x4b')](_0x43e7('0xc5')+_0x2d0052[_0x43e7('0x2a')],_0x4ace49);}_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xc,_0x4ace49['cause-txt']||_0x4ace49['dialstatus']);_0x4ebdde=_0x2d0052['dialAgentRejectRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xc6'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'20',_0x2d0052)[_0x43e7('0x4f')](function(_0x40019e){_0x3d9a29=_0x40019e[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc7'));}else{rpcDb['createCustomerFinal'](_0x4314d8,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});}});}if(!(_0x4314d8['dialAnswer']&&_0x2da2f3==='16')){ut[_0x43e7('0xc8')](_0x2d0052,_0x43e7('0xc9'));logger[_0x43e7('0x25')](_0x43e7('0xca'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052['name'],_0x43e7('0xcb'),_0x2d0052['originated']);}if(_0x2da2f3!=='ANSWER'){delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];delete this['actions'][_0x4ace49['destlinkedid']];}_0x2d0052[_0x43e7('0xcc')]=!![];}};Preview[_0x43e7('0x34')]['callProgressDetectingAgent']=function(_0x189c38,_0x156a3c,_0x302138){if(_[_0x43e7('0xcd')](_0x156a3c)&&'object'!==typeof _0x156a3c){return;}if(_['isUndefined'](_0x302138)&&_0x43e7('0xce')!==typeof _0x302138){return;}switch(_0x302138[_0x43e7('0xcf')]){case'0':ut[_0x43e7('0xd0')](_0x189c38,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x189c38,_0x43e7('0xd1'));break;case'3':ut[_0x43e7('0xd0')](_0x189c38,0x3,_0x43e7('0xd2'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd4'));break;case'5':ut[_0x43e7('0xd0')](_0x189c38,0x5,_0x43e7('0x97'));rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x189c38,0x8,'Congestion');rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x43e7('0xd0')](_0x189c38,0x16,_0x43e7('0xd5'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd6'));break;default:ut[_0x43e7('0xd0')](_0x189c38,0xc,_0x302138['reason']);rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd7'));}ut[_0x43e7('0xc8')](_0x156a3c,_0x43e7('0xd8'));logger['info'](_0x43e7('0xd9'),_0x189c38[_0x43e7('0x84')],_0x43e7('0x95'),_0x156a3c[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x156a3c[_0x43e7('0x2c')]);delete this[_0x43e7('0x12')][_0x189c38['uniqueid']];};Preview[_0x43e7('0x34')][_0x43e7('0x70')]=function(_0x20fab2,_0x3637d9,_0x3c52d3){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20fab2,_0x3637d9,_0x3c52d3)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[verifyAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x7f')]=function(_0x577ac6,_0x235418,_0x368c57){return cmHopperAdditionalPhone[_0x43e7('0x7f')](_0x577ac6,_0x235418,_0x368c57)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[swapAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x9e')]=function(_0x1e5d48){return Promise['resolve']()[_0x43e7('0x4f')](cmHopperAdditionalPhone[_0x43e7('0x9e')](_0x1e5d48))['catch'](logger[_0x43e7('0x25')](_0x43e7('0xda')));};Preview[_0x43e7('0x34')][_0x43e7('0xdb')]=function(_0x15b04a,_0x3b5f39,_0x4d5736,_0xcbdb35,_0xa5981f){var _0x19ddfa=this;return new Promise(function(_0x4a4031,_0x5a7f2e){if(_[_0x43e7('0x50')](_0x3b5f39)||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdc')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdd')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0x43')])){_0x5a7f2e(ut[_0x43e7('0x32')]('Contact\x20is\x20undefined',_0xcbdb35,_0xa5981f));return;}var _0x723c7=uuid['v4']();var _0xfbdb90=_0x19ddfa[_0x43e7('0x23')][_0x3b5f39[_0x43e7('0xde')][_0x43e7('0x2a')]];var _0x114e00=_0x4d5736?_0x19ddfa[_0x43e7('0xdf')][_0x4d5736]['id']:undefined;_0x19ddfa[_0x43e7('0x12')][_0x723c7]=new Action(_0x3b5f39,_0xfbdb90,_0x723c7,_0x4d5736,_0x114e00);var _0x51e17c=_0x19ddfa[_0x43e7('0x12')][_0x723c7];_0x51e17c[_0x43e7('0x7a')]=_0xcbdb35;_0x51e17c[_0x43e7('0x7b')]=_0xa5981f;_0x51e17c[_0x43e7('0xe0')]=_0x4d5736;if(_[_0x43e7('0xe1')](_0x15b04a)){_0x19ddfa['execCall'](_0x51e17c,_0xfbdb90,_0x3b5f39,_0x4d5736)[_0x43e7('0x4f')](function(_0x186e57){logger[_0x43e7('0x25')](_0x43e7('0xe2'),_0x43e7('0xe3')+_0x51e17c['queue']+_0x43e7('0xe4')+_0x51e17c['idContact'],JSON[_0x43e7('0x27')](_0x186e57));ami[_0x43e7('0x24')](_0x43e7('0xe5'),ut[_0x43e7('0x6d')](_0x51e17c,'called',_0x19ddfa[_0x43e7('0x23')][_0x51e17c[_0x43e7('0x3d')]]));_0x4a4031(ut[_0x43e7('0x32')](_0x43e7('0xe6')));})[_0x43e7('0x47')](function(_0x27bbd6){ut[_0x43e7('0x30')](_0x43e7('0xe7'),_0x27bbd6);_0x5a7f2e(ut[_0x43e7('0x32')](_0x43e7('0xe8'),_0xcbdb35,_0xa5981f));});}else{_0xfbdb90[_0x43e7('0xe9')]+=0x1;ut['logBlacklist'](_0x51e17c);rpcDb['createHistory'](_0x51e17c,_0x43e7('0xea'));delete _0x19ddfa['actions'][_0x723c7];_0x5a7f2e(ut['message'](_0x43e7('0xeb'),_0xcbdb35,_0xa5981f));}});};Preview[_0x43e7('0x34')]['isTrunkReachable']=function(_0x143be2){return!_['isNil'](_0x143be2)&&!_['isNil'](_0x143be2['name'])&&!_[_0x43e7('0x50')](_0x143be2[_0x43e7('0xec')])&&_0x143be2[_0x43e7('0xec')]&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])])&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')])&&(this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')]===_0x43e7('0xee')||this['trunks'][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2['name'])][_0x43e7('0x45')]===_0x43e7('0xef'));};Preview[_0x43e7('0x34')][_0x43e7('0xf0')]=function(_0x49441c,_0x31797a){return this[_0x43e7('0xf1')](_0x49441c,_0x31797a)['then'](function(_0x43500a){return _[_0x43e7('0x41')](_0x43500a,[_0x43e7('0x32')]);})['catch'](function(_0x22b824){if(_0x22b824[_0x43e7('0xf2')]){rpcDb[_0x43e7('0xf3')](_0x49441c);}if(_0x22b824[_0x43e7('0xec')]){rpcDb[_0x43e7('0x56')](_0x49441c);}throw _['pick'](_0x22b824,[_0x43e7('0x32')]);});};Preview[_0x43e7('0x34')]['execRun']=function(_0x1d31f5,_0x47b03b){var _0x4bf8ad=this;var _0x55baca,_0x5486a6;return rpcDb[_0x43e7('0xf4')](_0x1d31f5)[_0x43e7('0x4f')](function(_0x7f518f){if(!_[_0x43e7('0x50')](_0x7f518f[0x0])){_0x5486a6=_0x7f518f[0x0]['recallme']?![]:!![];_0x55baca=_0x7f518f[0x0]['recallme']?!![]:![];_0x55baca=_0x47b03b?!![]:_0x55baca;}var _0x267b26=_0x4bf8ad['validateContact'](_0x7f518f);if(_0x267b26[_0x43e7('0xf5')]){rpcDb['checkIsBlackList'](_[_0x43e7('0x41')](_0x7f518f[0x0],['VoiceQueueId','phone']))['then'](function(_0x5653b0){_0x4bf8ad[_0x43e7('0xdb')](_0x5653b0,_0x7f518f[0x0],_0x47b03b,_0x5486a6,_0x55baca)[_0x43e7('0x4f')](function(_0x574658){return _0x574658;})['catch'](function(_0x466aa7){throw _0x466aa7;});})[_0x43e7('0x47')](function(_0x517289){ut['logger'](_0x43e7('0xf6'),_0x517289);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),_0x5486a6,_0x55baca);});}else{throw ut[_0x43e7('0x32')](_0x267b26['message'],_0x5486a6,_0x55baca);}})[_0x43e7('0x47')](function(_0x536b7d){ut[_0x43e7('0x30')](_0x43e7('0xf8'),_0x536b7d);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),![],!![]);});};Preview[_0x43e7('0x34')][_0x43e7('0xf9')]=function(_0x2cbbda){if(_['isNil'](_0x2cbbda)||_[_0x43e7('0xe1')](_0x2cbbda)||!_[_0x43e7('0x50')](_0x2cbbda[0x0]['Agent'])&&_[_0x43e7('0x50')](_0x2cbbda[0x0][_0x43e7('0x53')][_0x43e7('0x2a')])){ut[_0x43e7('0x30')](_0x43e7('0xfa'),_0x2cbbda);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3fd573=this['campaignsPreview'][_0x2cbbda[0x0][_0x43e7('0xde')]['name']];_0x3fd573[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];if(_[_0x43e7('0x50')](_0x3fd573)){ut[_0x43e7('0x30')]('[Preview][validateContact][Empty\x20Campaign]',_0x3fd573);return{'isValid':![],'message':_0x43e7('0xfb')};}if(!this['isTrunkReachable'](_0x3fd573[_0x43e7('0x66')])){ut[_0x43e7('0x30')](_0x43e7('0xfc'),'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0xfd'));if(!this[_0x43e7('0x65')](_0x3fd573[_0x43e7('0xfe')])){ut[_0x43e7('0x30')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x3fd573[_0x43e7('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x43e7('0xff')};}}if(!ut[_0x43e7('0x64')](_0x3fd573[_0x43e7('0x100')])){ut[_0x43e7('0x30')](_0x43e7('0x101'),_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0x102'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x43e7('0x103')};};Preview[_0x43e7('0x34')][_0x43e7('0x104')]=function(_0xbc6e18,_0x16c757,_0xf9178f,_0x3bb7ab){var _0x2be8c7=this;return new Promise(function(_0x2bb14d,_0x57f7ea){var _0x240478=_0xbc6e18['uniqueid'];var _0x2b7b33=_0x2be8c7[_0x43e7('0x65')](_0x16c757['Trunk'])?util[_0x43e7('0x28')](_0x43e7('0x105'),_0x16c757['Trunk'][_0x43e7('0x2a')],_[_0x43e7('0x50')](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757[_0x43e7('0x108')]>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]):util[_0x43e7('0x28')](_0x43e7('0x105'),_['isNil'](_0x16c757[_0x43e7('0xfe')])?_0x16c757[_0x43e7('0x66')]['name']:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x2a')],_['isNil'](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757['dialCutDigit']>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]);var _0x2ed5e0=_0x2be8c7[_0x43e7('0x65')](_0x16c757[_0x43e7('0x66')])?ut['getCallerId'](_0x16c757['Trunk'][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757[_0x43e7('0x10c')]>0x0?ut[_0x43e7('0x10d')](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]):ut[_0x43e7('0x10f')](_[_0x43e7('0x50')](_0x16c757['TrunkBackup'])?_0x16c757[_0x43e7('0x66')][_0x43e7('0x10a')]:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]);if(_0x2ed5e0){_0xbc6e18[_0x43e7('0x110')]=ut['extractCalleridName'](_0x2ed5e0);_0xbc6e18[_0x43e7('0x111')]=ut['extractCalleridNumber'](_0x2ed5e0);}var _0x1c7f6a=ut[_0x43e7('0x112')](_0x16c757,_0xf9178f,_0x2b7b33,_0x2ed5e0,_0x240478,_0xbc6e18);_[_0x43e7('0x113')](_0xbc6e18,ut[_0x43e7('0x114')](_0x1c7f6a));_0xbc6e18[_0x43e7('0x115')]=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x16c757[_0x43e7('0x116')]=_0x1c7f6a;var _0x202421=ut[_0x43e7('0x117')](_0xbc6e18,_0x16c757,_0x1c7f6a,_0xbc6e18[_0x43e7('0x7b')],_0x3bb7ab);return ami[_0x43e7('0x118')](_0x202421)[_0x43e7('0x4f')](function(_0x4637f6){_0x16c757[_0x43e7('0x2c')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x119'),_0x240478,_0x43e7('0x95'),_0x16c757[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x16c757['originated']);_0x2bb14d(_0x4637f6);})[_0x43e7('0x47')](function(_0x24d6e4){ut['logAgent'](_0xbc6e18,0xe,_0x43e7('0x11a'));rpcDb[_0x43e7('0xd3')](_0xbc6e18,'[originateFailure][logOriginateFailure]');_0x57f7ea(_0x24d6e4);});});};Preview[_0x43e7('0x34')][_0x43e7('0x11b')]=function(_0x2b9cf9){if(this['actions'][_0x2b9cf9['linkedid']]){this[_0x43e7('0x12')][_0x2b9cf9[_0x43e7('0x7c')]][_0x43e7('0x46')]=_0x2b9cf9[_0x43e7('0x46')];}};Preview[_0x43e7('0x34')][_0x43e7('0x15')]=function(_0x25b5a2){var _0xfe77ea=this;var _0x5d2cb0=this[_0x43e7('0x12')][_0x25b5a2[_0x43e7('0x11c')]];if(_0x5d2cb0){if(_0x5d2cb0[_0x43e7('0xe0')]&&this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]){ut[_0x43e7('0x11d')](_0x5d2cb0,this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]][_0x43e7('0x2a')],this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]['id']);}var _0x218743=_['clone'](_0x5d2cb0);_0x218743[_0x43e7('0x81')]=moment()[_0x43e7('0x28')](_0x43e7('0x11e'));var _0x21c8b9=_0xfe77ea[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]];if(ut['isFailure'](_0x25b5a2[_0x43e7('0x11f')])){if(_0x5d2cb0['unlockAgent']){rpcDb[_0x43e7('0xf3')](_0x5d2cb0[_0x43e7('0x7e')]);}if(_0x5d2cb0[_0x43e7('0x7b')]){rpcDb['disableContact'](_0x5d2cb0[_0x43e7('0x7e')]);}ami[_0x43e7('0x24')]('custom:agentringnoanswer',ut[_0x43e7('0x6d')](_0x5d2cb0,'rejected',this[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]]));this[_0x43e7('0x120')](_0x218743,_0x21c8b9,_0x25b5a2);}else{_0x5d2cb0[_0x43e7('0x115')]=moment()['format'](_0x43e7('0x11e'));ut[_0x43e7('0xd0')](_0x218743,0x4,_0x43e7('0x8d'));rpcDb['createAgentHistory'](_0x218743,_0x43e7('0x121'));}}};Preview[_0x43e7('0x34')][_0x43e7('0x16')]=function(_0x431345){var _0x77c2f=this[_0x43e7('0x12')][_0x431345['linkedid']];var _0x3f057e;if(_0x77c2f){_0x3f057e=this['campaignsPreview'][_0x77c2f[_0x43e7('0x3d')]];logger[_0x43e7('0x25')]('[syncHangup][talking]',_0x431345[_0x43e7('0x7c')],_0x43e7('0x95'),_0x3f057e['name'],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);}if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]]&&_0x431345['linkedid']!==_0x431345['uniqueid']){if(_0x431345[_0x43e7('0x122')]==='16'&&this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345['linkedid']][_0x43e7('0x40')]){logger[_0x43e7('0x25')]('[syncHangup][talking][cause]',_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],_0x43e7('0x95'),_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345['linkedid'],_0x431345[_0x43e7('0x122')]);}}else if(_0x77c2f&&_['isNil'](_0x77c2f[_0x43e7('0x123')])&&_0x3f057e[_0x43e7('0x124')]&&_0x431345['linkedid']===_0x431345[_0x43e7('0x84')]&&_['isNil'](_0x431345[_0x43e7('0xcf')])&&_0x431345[_0x43e7('0x122')]==='16'&&_0x431345[_0x43e7('0x125')]==='6'&&_['isUndefined'](_0x77c2f['transfer'])){if(_0x77c2f[_0x43e7('0x7a')]){rpcDb[_0x43e7('0xf3')](_0x77c2f['idContact']);}if(_0x77c2f[_0x43e7('0x7b')]){rpcDb[_0x43e7('0x56')](_0x77c2f[_0x43e7('0x7e')]);}_0x431345['reason']='22';this[_0x43e7('0x120')](_0x77c2f,_0x3f057e,_0x431345);}else if(_0x77c2f&&_0x77c2f[_0x43e7('0x126')]){if(_0x431345[_0x43e7('0x122')]==='16'&&this['actions'][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x127'),_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],'\x20Queue',_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x128'),_0x431345[_0x43e7('0x7c')],_0x431345['cause'],'\x20Queue',_0x3f057e['name'],'pTalking:\x20',_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')][_0x43e7('0x1a')]=function(_0x51dc07){if(this['actions'][_0x51dc07[_0x43e7('0x129')]]&&_0x51dc07[_0x43e7('0x129')]!==_0x51dc07['destuniqueid']){this['callProgressDetectingCustomer'](_0x51dc07,_0x51dc07[_0x43e7('0x129')],_0x51dc07[_0x43e7('0xc0')]);}};Preview['prototype'][_0x43e7('0x19')]=function(_0x57bcab){if(this['actions'][_0x57bcab[_0x43e7('0x7c')]]&&_0x57bcab[_0x43e7('0x7c')]!==_0x57bcab['uniqueid']&&!this['actions'][_0x57bcab[_0x43e7('0x7c')]][_0x43e7('0x40')]){if(_0x57bcab[_0x43e7('0x122')]==='1'){this[_0x43e7('0x69')](_0x57bcab,_0x57bcab['linkedid'],_0x57bcab[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')]['addVariable']=function(_0x560373,_0x4cdb87,_0x4eaf92){if(this[_0x43e7('0x12')][_0x560373]){if(_[_0x43e7('0x50')](this['actions'][_0x560373]['variables'])){this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')]={};}this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')][_0x4cdb87]=_0x4eaf92;}};Preview[_0x43e7('0x34')]['syncVarSet']=function(_0x3836e7){try{if(!_[_0x43e7('0x50')](_0x3836e7)){if(ut[_0x43e7('0x12a')](_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0])){this['addVariable'](_0x3836e7[_0x43e7('0x84')],_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0],_0x3836e7[_0x43e7('0x12d')]);}}}catch(_0x5564b4){logger[_0x43e7('0x12e')](_0x43e7('0x12f'),util[_0x43e7('0x130')](_0x5564b4,{'showHidden':![],'depth':null}));}};Preview[_0x43e7('0x34')][_0x43e7('0x1f')]=function(_0x308403){if(_0x308403){if(this['actions'][_0x308403[_0x43e7('0x131')]]){this[_0x43e7('0x12')][_0x308403[_0x43e7('0x131')]][_0x43e7('0x126')]=!![];}}};Preview['prototype'][_0x43e7('0x21')]=function(_0x48c784){if(_0x48c784){if(this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']]){this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']][_0x43e7('0x126')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 5dc5bf0..66d60f2 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 _0x3411=['type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercomplete','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x3411,0xaf));var _0x1341=function(_0x2d5e56,_0x339bdd){_0x2d5e56=_0x2d5e56-0x0;var _0x3f3baf=_0x3411[_0x2d5e56];return _0x3f3baf;};'use strict';var util=require('util');var BPromise=require(_0x1341('0x0'));var logger=require(_0x1341('0x1'))(_0x1341('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x1341('0x3'));var cmHopperBlack=require(_0x1341('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x1341('0x5'));function loggerCatch(_0x2693ed){return function(_0x4ddd3c){logger[_0x1341('0x6')](_0x2693ed,util['inspect'](_0x4ddd3c,{'showHidden':![],'depth':null}));};}function create(_0x3122c7){return cmHopperHistory[_0x1341('0x7')](_0x3122c7)[_0x1341('0x8')](loggerCatch(_0x1341('0x9')));}function createAgent(_0x48657d){return BPromise[_0x1341('0xa')]()[_0x1341('0xb')](agentReportPreview[_0x1341('0x7')](_0x48657d))['catch'](loggerCatch(_0x1341('0x9')));}function moveContact(_0x3a7270){return cmHopper[_0x1341('0xc')](_0x3a7270,!![])[_0x1341('0x8')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x5dc7d6){return cmHopperBlack[_0x1341('0xd')](_0x5dc7d6)['catch'](loggerCatch(_0x1341('0xe')));};exports[_0x1341('0xf')]=function(_0x5b1f68){return BPromise[_0x1341('0xa')]()['then'](cmHopper[_0x1341('0xf')](_0x5b1f68))['catch'](loggerCatch(_0x1341('0x10')));};exports[_0x1341('0x7')]=function(_0x279cd5,_0x4ab050){create(_0x279cd5)['catch'](loggerCatch(_0x4ab050));moveContact(_0x279cd5)['catch'](loggerCatch(_0x4ab050));};exports[_0x1341('0x11')]=function(_0x28349b,_0x2a3510){createAgent(_0x28349b)['catch'](loggerCatch(_0x2a3510));};exports[_0x1341('0x12')]=function(_0x3f1748,_0x541ce0){create(_0x3f1748)['catch'](loggerCatch(_0x541ce0));};exports[_0x1341('0x13')]=function(_0x53bbfd,_0x406faa){moveContact(_0x53bbfd)['catch'](loggerCatch(_0x406faa));};exports[_0x1341('0x14')]=function(_0x5159d2,_0x180f5a,_0x20b5a1){if(_0x180f5a){_0x5159d2[_0x1341('0x15')]=null;}if(_0x20b5a1){_0x5159d2['active']=![];}return cmHopper[_0x1341('0x14')](_0x5159d2)[_0x1341('0x8')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x1341('0x16')]=function(_0x374480){return cmHopper[_0x1341('0x16')](_0x374480)['catch'](loggerCatch(_0x1341('0x17')));};exports[_0x1341('0x18')]=function(_0x3cd085){return cmHopper[_0x1341('0x18')]({'UserId':null},_0x3cd085,0x1)[_0x1341('0x8')](loggerCatch(_0x1341('0x19')));};exports[_0x1341('0x1a')]=function(_0x43af87){return cmHopper[_0x1341('0x18')]({'active':![]},_0x43af87,0x1)[_0x1341('0x8')](loggerCatch(_0x1341('0x1b')));};exports[_0x1341('0x1c')]=function(_0x315781){var _0x1d8fe0={};_0x1d8fe0[_0x1341('0x1d')]=_0x315781[_0x1341('0x1d')];_0x1d8fe0[_0x1341('0x1e')]=_0x315781[_0x1341('0x1e')];_0x1d8fe0['calleridnum']=_0x315781[_0x1341('0x1f')];_0x1d8fe0['calleridname']=_0x315781[_0x1341('0x20')];_0x1d8fe0[_0x1341('0x21')]=_0x315781[_0x1341('0x21')];_0x1d8fe0['queuecallerjoinAt']=_0x315781['answertime'];_0x1d8fe0[_0x1341('0x22')]=_0x315781[_0x1341('0x23')];_0x1d8fe0[_0x1341('0x24')]=0x1;_0x1d8fe0['queuecallercompleteAt']=_0x315781['endtime'];_0x1d8fe0[_0x1341('0x25')]=_0x315781[_0x1341('0x26')];_0x1d8fe0[_0x1341('0x27')]=_0x1341('0x28');_0x1d8fe0[_0x1341('0x29')]=_0x1341('0x2a');_0x1d8fe0[_0x1341('0x2b')]=0x0;_0x1d8fe0['assigned']=0x1;_0x1d8fe0[_0x1341('0x2c')]=_0x315781[_0x1341('0x26')];_0x1d8fe0['queuecallerexitreason']='COMPLETED';return BPromise[_0x1341('0xa')]()[_0x1341('0xb')](voiceQueueReport[_0x1341('0x2d')](_0x1d8fe0))[_0x1341('0x8')](loggerCatch(_0x1341('0x2e')));};exports['getContactRecallMe']=function(_0x2734f2,_0x49302b){return BPromise[_0x1341('0xa')]()[_0x1341('0xb')](cmHopper[_0x1341('0x2f')](_0x2734f2,_0x49302b))['catch'](loggerCatch(_0x1341('0x30')));};exports[_0x1341('0x31')]=function(_0x2d0bd2){return cmHopper[_0x1341('0x14')](_0x2d0bd2,!![],!![])[_0x1341('0x8')](loggerCatch(_0x1341('0x32')));}; \ No newline at end of file +var _0x0792=['../rpc/cmHopperHistory','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview'];(function(_0xbfec58,_0x5f4153){var _0x3dc84d=function(_0x498ef6){while(--_0x498ef6){_0xbfec58['push'](_0xbfec58['shift']());}};_0x3dc84d(++_0x5f4153);}(_0x0792,0x17d));var _0x2079=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x0792[_0x35a274];return _0x40d905;};'use strict';var util=require(_0x2079('0x0'));var BPromise=require(_0x2079('0x1'));var logger=require(_0x2079('0x2'))(_0x2079('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x2079('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x2079('0x5'));var voiceQueueReport=require(_0x2079('0x6'));function loggerCatch(_0x3189cb){return function(_0x3c01ed){logger[_0x2079('0x7')](_0x3189cb,util['inspect'](_0x3c01ed,{'showHidden':![],'depth':null}));};}function create(_0x5aad8f){return cmHopperHistory[_0x2079('0x8')](_0x5aad8f)[_0x2079('0x9')](loggerCatch(_0x2079('0xa')));}function createAgent(_0x466d2f){return BPromise[_0x2079('0xb')]()[_0x2079('0xc')](agentReportPreview[_0x2079('0x8')](_0x466d2f))[_0x2079('0x9')](loggerCatch(_0x2079('0xa')));}function moveContact(_0x27c848){return cmHopper[_0x2079('0xd')](_0x27c848,!![])[_0x2079('0x9')](loggerCatch(_0x2079('0xe')));}exports[_0x2079('0xf')]=function(_0x1e0622){return cmHopperBlack[_0x2079('0xf')](_0x1e0622)[_0x2079('0x9')](loggerCatch(_0x2079('0x10')));};exports[_0x2079('0x11')]=function(_0x21b413){return BPromise['resolve']()['then'](cmHopper[_0x2079('0x11')](_0x21b413))['catch'](loggerCatch(_0x2079('0x12')));};exports[_0x2079('0x8')]=function(_0x161a4e,_0x560e3e){create(_0x161a4e)['catch'](loggerCatch(_0x560e3e));moveContact(_0x161a4e)['catch'](loggerCatch(_0x560e3e));};exports[_0x2079('0x13')]=function(_0x378467,_0x5e3f4f){createAgent(_0x378467)[_0x2079('0x9')](loggerCatch(_0x5e3f4f));};exports[_0x2079('0x14')]=function(_0x5835af,_0x474e87){create(_0x5835af)['catch'](loggerCatch(_0x474e87));};exports['createCustomerFinal']=function(_0x4e70a5,_0x162245){moveContact(_0x4e70a5)[_0x2079('0x9')](loggerCatch(_0x162245));};exports[_0x2079('0x15')]=function(_0x1b8ab8,_0x1755af,_0x479735){if(_0x1755af){_0x1b8ab8[_0x2079('0x16')]=null;}if(_0x479735){_0x1b8ab8[_0x2079('0x17')]=![];}return cmHopper[_0x2079('0x15')](_0x1b8ab8)['catch'](loggerCatch(_0x2079('0x18')));};exports['countReScheduled']=function(_0x2e3079){return cmHopper[_0x2079('0x19')](_0x2e3079)[_0x2079('0x9')](loggerCatch(_0x2079('0x1a')));};exports[_0x2079('0x1b')]=function(_0x512ea8){return cmHopper['unlockContact']({'UserId':null},_0x512ea8,0x1)[_0x2079('0x9')](loggerCatch(_0x2079('0x1c')));};exports[_0x2079('0x1d')]=function(_0x1543ed){return cmHopper['unlockContact']({'active':![]},_0x1543ed,0x1)['catch'](loggerCatch(_0x2079('0x1e')));};exports[_0x2079('0x1f')]=function(_0x321f60){var _0x55257b={};_0x55257b[_0x2079('0x20')]=_0x321f60[_0x2079('0x20')];_0x55257b[_0x2079('0x21')]=_0x321f60[_0x2079('0x21')];_0x55257b['calleridnum']=_0x321f60['calleridnum'];_0x55257b[_0x2079('0x22')]=_0x321f60[_0x2079('0x22')];_0x55257b[_0x2079('0x23')]=_0x321f60['queue'];_0x55257b['queuecallerjoinAt']=_0x321f60[_0x2079('0x24')];_0x55257b[_0x2079('0x25')]=_0x321f60[_0x2079('0x24')];_0x55257b['queuecallercomplete']=0x1;_0x55257b['queuecallercompleteAt']=_0x321f60[_0x2079('0x26')];_0x55257b[_0x2079('0x27')]=_0x321f60[_0x2079('0x28')];_0x55257b[_0x2079('0x29')]=_0x2079('0x2a');_0x55257b[_0x2079('0x2b')]=_0x2079('0x2c');_0x55257b[_0x2079('0x2d')]=0x0;_0x55257b[_0x2079('0x2e')]=0x1;_0x55257b[_0x2079('0x2f')]=_0x321f60[_0x2079('0x28')];_0x55257b[_0x2079('0x30')]=_0x2079('0x31');return BPromise['resolve']()['then'](voiceQueueReport[_0x2079('0x32')](_0x55257b))[_0x2079('0x9')](loggerCatch(_0x2079('0x33')));};exports[_0x2079('0x34')]=function(_0x567be6,_0x2fa6f2){return BPromise[_0x2079('0xb')]()[_0x2079('0xc')](cmHopper[_0x2079('0x34')](_0x567be6,_0x2fa6f2))[_0x2079('0x9')](loggerCatch(_0x2079('0x35')));};exports[_0x2079('0x36')]=function(_0x204ec4){return cmHopper[_0x2079('0x15')](_0x204ec4,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index b31b872..f5ff000 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 _0x9402=['format','string','\x22\x22\x20<>','isNil','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','getSeconds','logLookAgent','membername','logCustomer','talktime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','interface','channelAgent','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','type','dialAnswer','active','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','extractCalleridNumber','match','keys','variables','forEach','buildNoAnswerEventPayload','util','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','loggerCatch','inspect','loggerError','error','logger2','info','message','isUndefined','isEmpty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9402,0x120));var _0x2940=function(_0x12201c,_0x51d333){_0x12201c=_0x12201c-0x0;var _0x285ca2=_0x9402[_0x12201c];return _0x285ca2;};'use strict';var util=require(_0x2940('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2940('0x1'))(_0x2940('0x2'));var ipAgi=process['env'][_0x2940('0x3')]||_0x2940('0x4');var utils=require('../../dialer/utils');exports[_0x2940('0x5')]=function(_0x5fd491){return function(_0x52248f){logger['error'](_0x5fd491,util[_0x2940('0x6')](_0x52248f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x5cdb39,_0x36dd5d){logger['info'](_0x5cdb39,util[_0x2940('0x6')](_0x36dd5d,{'showHidden':![],'depth':null}));};exports[_0x2940('0x7')]=function(_0x4f27b4,_0x3c09a5){logger[_0x2940('0x8')](_0x4f27b4,util['inspect'](_0x3c09a5,{'showHidden':![],'depth':null}));};exports[_0x2940('0x9')]=function(_0x137e5e){return function(_0x4e4d12){logger[_0x2940('0xa')](_0x137e5e,util[_0x2940('0x6')](_0x4e4d12,{'showHidden':![],'depth':null}));};};exports[_0x2940('0xb')]=function(_0x3c2c94,_0x35983e,_0x541631){return{'message':_0x3c2c94,'unlock':_0x35983e,'active':_0x541631};};exports['getCallerId']=function(_0x1c2920,_0x1486ac,_0x3615e4){if(!_[_0x2940('0xc')](_0x3615e4)&&'string'===typeof _0x3615e4&&!_['isEmpty'](_0x3615e4)){if(!_[_0x2940('0xc')](_0x1486ac)&&'string'===typeof _0x1486ac&&!_[_0x2940('0xd')](_0x1486ac)){return util[_0x2940('0xe')]('\x22%s\x22\x20<%s>',_0x1486ac,_0x3615e4);}return util[_0x2940('0xe')]('\x22%s\x22\x20<%s>',_0x3615e4,_0x3615e4);}if(!_[_0x2940('0xc')](_0x1c2920)&&_0x2940('0xf')===typeof _0x1c2920&&!_[_0x2940('0xd')](_0x1c2920)){return _0x1c2920;}return _0x2940('0x10');};exports['isActive']=function(_0x2098a9){if(_[_0x2940('0x11')](_0x2098a9)){return![];}return _0x2098a9;};exports['addVariables']=function(_0x20100e,_0x3f9b18,_0x42fbd5,_0x4db420,_0xd25fc,_0x58d0bd){var _0x4d7d6b={'XMD-QUEUE':_0x3f9b18['Queue']?_0x3f9b18['Queue'][_0x2940('0x12')]:'','XMD-CALLERID':_0x4db420,'XMD-CALLERID-PREVIEW':_0x58d0bd?util[_0x2940('0xe')](_0x2940('0x13'),_0x58d0bd[_0x2940('0x14')],_0x58d0bd[_0x2940('0x15')]):_0x4db420,'XMD-DIALID':_0xd25fc,'XMD-CONTACTID':_0x3f9b18[_0x2940('0x16')],'XMD-CDRTYPE':_0x2940('0x17'),'CALLERID(all)':_0x4db420,'XMD-VOICEQUEUEID':_0x3f9b18[_0x2940('0x18')],'XMD-DIALCHANNEL':_0x42fbd5,'XMD-DIALTIMEOUT':_0x20100e[_0x2940('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x2940('0xe')](_0x2940('0x1a'),_0x20100e[_0x2940('0x1b')]?'g':'',_[_0x2940('0xd')](_0x20100e[_0x2940('0x1c')])?'':_0x2940('0x1d')),'XMD-DIALURL':_0x20100e[_0x2940('0x1e')]||'','XMD-AGI':_0x20100e['dialQueueProject']?util[_0x2940('0xe')]('\x22agi://%s/square,%s\x22',ipAgi,_0x20100e['dialQueueProject']):_0x2940('0x1f'),'XMD-AGIAFTER':_0x20100e['dialQueueProject2']?util[_0x2940('0xe')](_0x2940('0x20'),ipAgi,_0x20100e[_0x2940('0x1b')]):_0x2940('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x58d0bd?_0x58d0bd[_0x2940('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x58d0bd?_0x58d0bd[_0x2940('0x22')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x2940('0x23')};if(!_['isEmpty'](_0x20100e[_0x2940('0x1c')])){_0x4d7d6b[util[_0x2940('0xe')]('%s',_0x2940('0x24'))]=_0x20100e[_0x2940('0x1c')];_0x4d7d6b[util[_0x2940('0xe')]('%s',_0x2940('0x25'))]=_0xd25fc;}if(_0x3f9b18&&_0x3f9b18['Contact']){for(var _0x20c888 in _0x3f9b18[_0x2940('0x26')]){if(_0x3f9b18['Contact'][_0x2940('0x27')](_0x20c888)){if(!_[_0x2940('0x11')](_0x3f9b18[_0x2940('0x26')][_0x20c888])&&_0x20c888!=='id'&&_0x20c888!==_0x2940('0x28')&&_0x20c888!==_0x2940('0x29')&&_0x20c888!==_0x2940('0x2a')){_0x4d7d6b[util['format'](_0x2940('0x2b'),_0x2940('0x2c'),_['toUpper'](_0x20c888))]=_0x3f9b18[_0x2940('0x26')][_0x20c888];}}}}return _0x4d7d6b;};exports[_0x2940('0x2d')]=function(_0x8de41f){var _0x5bdd94={};for(var _0x41f97a in _0x8de41f){if(_0x8de41f[_0x2940('0x27')](_0x41f97a)){_0x5bdd94[util[_0x2940('0xe')]('%s',_[_0x2940('0x2e')](_0x41f97a))]=_0x8de41f[_0x41f97a];}}return{'variables':_0x5bdd94};};exports[_0x2940('0x2f')]=function(_0x1b20f7,_0x477b7b){if(!_[_0x2940('0x11')](_0x1b20f7)){if(_0x1b20f7[_0x2940('0x27')]('originated')){if(_0x1b20f7['originated']>0x0){_0x1b20f7[_0x2940('0x30')]-=0x1;}else{logger['error'](_0x2940('0x31'),_0x477b7b);}}}else{logger[_0x2940('0x8')](_0x2940('0x32'),_0x477b7b);}};exports[_0x2940('0x33')]=function(_0x40dab0){var _0xbb6595=moment()[_0x2940('0xe')](_0x2940('0x34'));_0x40dab0[_0x2940('0x35')]=0xd;_0x40dab0['statedesc']=_0x2940('0x36');_0x40dab0[_0x2940('0x37')]=_0xbb6595;_0x40dab0[_0x2940('0x38')]=_0xbb6595;_0x40dab0[_0x2940('0x39')]=_0xbb6595;};exports[_0x2940('0x3a')]=function(_0x2404d3,_0x2e9782,_0x2e1d68){var _0x4cc554=moment()[_0x2940('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x2404d3[_0x2940('0x35')]=_0x2e9782;_0x2404d3[_0x2940('0x3b')]=_0x2e1d68;_0x2404d3[_0x2940('0x38')]=_0x4cc554;_0x2404d3[_0x2940('0x3c')]=utils[_0x2940('0x3d')](_0x2404d3[_0x2940('0x38')],_0x2404d3[_0x2940('0x37')]);};exports[_0x2940('0x3e')]=function(_0x2fc05a,_0x2bd788,_0x3bea69){_0x2fc05a[_0x2940('0x3f')]=_0x2bd788;_0x2fc05a['UserId']=_0x3bea69;};exports[_0x2940('0x40')]=function(_0x3a46a6,_0x1eb343,_0x55260a){var _0x725c30=moment()[_0x2940('0xe')](_0x2940('0x34'));_0x3a46a6['state']=_0x1eb343;_0x3a46a6[_0x2940('0x3b')]=_0x55260a;_0x3a46a6[_0x2940('0x38')]=_0x3a46a6[_0x2940('0x38')]?_0x3a46a6[_0x2940('0x38')]:_0x725c30;_0x3a46a6[_0x2940('0x39')]=_0x3a46a6[_0x2940('0x39')]?_0x3a46a6[_0x2940('0x39')]:_0x725c30;_0x3a46a6[_0x2940('0x3c')]=utils[_0x2940('0x3d')](_0x3a46a6[_0x2940('0x38')]||0x0,_0x3a46a6['starttime']||0x0);_0x3a46a6[_0x2940('0x41')]=_0x3a46a6['answertime']?utils[_0x2940('0x3d')](_0x3a46a6[_0x2940('0x39')],_0x3a46a6['answertime']):0x0;};exports['isFailure']=function(_0x52d977){return _0x52d977===_0x2940('0x42');};exports[_0x2940('0x43')]=function(_0x18e11e,_0x5475a6,_0x3b8105,_0x1f825f,_0x359897){var _0xdd6ee3=_0x1f825f?_0x2940('0x44'):_0x18e11e[_0x2940('0x14')];_0xdd6ee3=_0x359897?_0x2940('0x45'):_0xdd6ee3;return{'actionid':_0x18e11e[_0x2940('0x46')],'action':_0x2940('0x47'),'channel':_0x18e11e['channelAgent'],'callerid':util[_0x2940('0xe')](_0x2940('0x13'),_0xdd6ee3,_0x18e11e[_0x2940('0x15')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x3b8105,'timeout':(_0x5475a6[_0x2940('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x18e11e[_0x2940('0x46')]};};exports[_0x2940('0x49')]=function(_0x32abe1){return _0x32abe1[_0x2940('0x4a')]+_0x32abe1[_0x2940('0x4b')]+_0x32abe1[_0x2940('0x4c')]+_0x32abe1[_0x2940('0x4d')]+_0x32abe1['countnosuchnumberretry'];};exports[_0x2940('0x4e')]=function(_0x2cc53c){var _0x2857ef=_[_0x2940('0x4f')](_0x2cc53c);_0x2857ef[_0x2940('0x35')]=0xf;_0x2857ef[_0x2940('0x3b')]=_0x2940('0x50');return _0x2857ef;};exports[_0x2940('0x51')]=function(_0xf6dde1,_0x4b9da3,_0x535ab8){var _0x57b82c={};_0x57b82c[_0x4b9da3]=_0xf6dde1[_0x4b9da3];_0x57b82c['active']=![];_0x57b82c[_0x2940('0x52')]=moment()[_0x2940('0x53')](_0x535ab8,_0x2940('0x54'))[_0x2940('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x57b82c[_0x2940('0x16')]=_0xf6dde1[_0x2940('0x16')];_0x57b82c[_0x2940('0x55')]=_0xf6dde1[_0x2940('0x55')];_0x57b82c[_0x2940('0x18')]=_0xf6dde1[_0x2940('0x18')]||undefined;return _0x57b82c;};exports[_0x2940('0x56')]=function(_0x2303b2,_0x6fa194){if(!_['isNil'](_0x2303b2)){if(_0x2303b2[_0x2940('0x57')]>0x0){_0x2303b2[_0x2940('0x57')]-=0x1;}else{logger[_0x2940('0x8')](_0x6fa194,_0x2940('0x58'));}}else{logger[_0x2940('0x8')](_0x6fa194,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x2940('0x59')]=function(_0xe0564d){if(_0xe0564d<=0x0){return!![];}return![];};function buildObj(_0x38cea6,_0x30a13a,_0x57a713){_0x38cea6[_0x2940('0x5a')]=_0x30a13a;_0x38cea6[_0x2940('0x12')]=_0x38cea6[_0x2940('0x5b')];_0x38cea6['interface']=_0x38cea6['channelAgent'];_0x38cea6[_0x2940('0x5c')]=_0x2940('0x5d');if(_0x57a713){_0x38cea6['mandatoryDisposition']=_0x57a713[_0x2940('0x5e')];}return _0x38cea6;}exports[_0x2940('0x5f')]=buildObj;exports[_0x2940('0x60')]=function(_0x4404a3){var _0x47d8f1={};_0x47d8f1[_0x2940('0x5b')]=_0x4404a3['queue'];_0x47d8f1[_0x2940('0x61')]=_0x4404a3[_0x2940('0x62')];_0x47d8f1[_0x2940('0x46')]=_0x4404a3['uniqueid'];return _0x47d8f1;};exports[_0x2940('0x63')]=function(_0x117fa1){var _0x489bd1=[];for(var _0x10e222 in _0x117fa1){if(_0x117fa1[_0x2940('0x27')](_0x10e222)){if(!_['isNil'](_0x117fa1[_0x10e222])&&_0x117fa1[_0x10e222][_0x2940('0x35')]===_0x2940('0x64')&&_0x117fa1[_0x10e222][_0x2940('0x65')]==='reachable'){_0x489bd1[_0x2940('0x66')](_0x117fa1[_0x10e222]['id']);}}}return _0x489bd1;};exports[_0x2940('0x67')]=function(_0xeba8a8){var _0x3e1391=moment()[_0x2940('0x68')](0x0);var _0x9d848=moment(_0xeba8a8)['milliseconds'](0x0);return _0x3e1391[_0x2940('0x69')](_0x9d848,_0x2940('0x6a'));};exports['createBody']=function(_0x404a5f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x404a5f[_0x2940('0x16')],'ListId':_0x404a5f[_0x2940('0x55')],'VoiceQueueId':_0x404a5f['VoiceQueueId']||undefined,'CampaignId':_0x404a5f[_0x2940('0x6b')]||undefined};};exports[_0x2940('0x6c')]=function(_0x815811){if(_0x815811===_0x2940('0x46')||_0x815811===_0x2940('0x6d')||_0x815811==='queue'||_0x815811===_0x2940('0x6e')||_0x815811==='campaigntype'||_0x815811===_0x2940('0x6f')||_0x815811==='membername'||_0x815811===_0x2940('0x62')||_0x815811===_0x2940('0x14')||_0x815811===_0x2940('0x70')||_0x815811===_0x2940('0x15')||_0x815811===_0x2940('0x52')||_0x815811===_0x2940('0x4a')||_0x815811===_0x2940('0x4b')||_0x815811===_0x2940('0x4c')||_0x815811===_0x2940('0x71')||_0x815811===_0x2940('0x72')||_0x815811===_0x2940('0x73')||_0x815811===_0x2940('0x74')||_0x815811===_0x2940('0x75')||_0x815811==='ContactId'||_0x815811===_0x2940('0x55')||_0x815811===_0x2940('0x76')||_0x815811==='VoiceQueueId'||_0x815811===_0x2940('0x77')||_0x815811==='xmd-voicequeueid'||_0x815811===_0x2940('0x78')||_0x815811===_0x2940('0x79')||_0x815811==='xmd-listid'||_0x815811===_0x2940('0x7a')||_0x815811===_0x2940('0x7b')||_0x815811===_0x2940('0x7c')||_0x815811===_0x2940('0x7d')||_0x815811==='xmd-dialchannel'||_0x815811===_0x2940('0x7e')||_0x815811===_0x2940('0x7f')||_0x815811===_0x2940('0x80')||_0x815811===_0x2940('0x81')||_0x815811===_0x2940('0x82')||_0x815811===_0x2940('0x83')||_0x815811===_0x2940('0x84')||_0x815811===_0x2940('0x85')||_0x815811===_0x2940('0x86')||_0x815811===_0x2940('0x87')||_0x815811===_0x2940('0x88')||_0x815811===_0x2940('0x89')||_0x815811==='rtpaudioqosrttbridged'||_0x815811===_0x2940('0x83')||_0x815811==='rtpaudioqosbridged'||_0x815811===_0x2940('0x85')||_0x815811===_0x2940('0x86')||_0x815811==='rtpaudioqosloss'||_0x815811===_0x2940('0x88')||_0x815811===_0x2940('0x89')||_0x815811==='rtpaudioqosrttbridged'||_0x815811===_0x2940('0x8a')||_0x815811===_0x2940('0x8b')||_0x815811===_0x2940('0x35')||_0x815811===_0x2940('0x3b')){return![];}return!![];};exports[_0x2940('0x8c')]=function(_0x5ae921,_0x7e212e){var _0x1bc726,_0x3a5127,_0x2e4fd3;if(_0x7e212e<=0x0){_0x7e212e=0x1;}_0x1bc726=new RegExp('\x5cw{0,'+_0x7e212e+'}$');_0x3a5127=Math[_0x2940('0x8d')](0xa,_0x7e212e-0x1);_0x2e4fd3=Math[_0x2940('0x8d')](0xa,_0x7e212e)-0x1;return util['format']('%s',_[_0x2940('0x8e')](_0x5ae921,_0x1bc726,_[_0x2940('0x8f')](_0x3a5127,_0x2e4fd3)));};exports[_0x2940('0x90')]=function(_0x24c679){var _0x2459cb=_0x24c679['match'](/"(.*?)"/);return _0x2459cb?_0x2459cb[0x1]:_0x24c679;};exports[_0x2940('0x91')]=function(_0x1ca650){var _0x2986a1=_0x1ca650[_0x2940('0x92')](/<(.*?)>/);return _0x2986a1?_0x2986a1[0x1]:_0x1ca650;};function buildNoAnswerEventPayload(_0x24d0f4,_0x1b69f5){var _0x428be2=buildObj(_0x24d0f4,'noanswer');if(!_[_0x2940('0xd')](_0x1b69f5['variables'])){Object[_0x2940('0x93')](_0x1b69f5[_0x2940('0x94')])[_0x2940('0x95')](function(_0x15be88){_0x428be2[_0x15be88['toLowerCase']()]=_0x1b69f5['variables'][_0x15be88];});}return _0x428be2;}exports[_0x2940('0x96')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x722f=['noanswer','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','logger','info','loggerError','error','logger2','inspect','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','name','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','CampaignId','idContact','type','campaigntype','dialAnswer','active','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber'];(function(_0x33923a,_0x2115bb){var _0x365b2c=function(_0x18c177){while(--_0x18c177){_0x33923a['push'](_0x33923a['shift']());}};_0x365b2c(++_0x2115bb);}(_0x722f,0x13d));var _0xf722=function(_0x18af1a,_0x1595a0){_0x18af1a=_0x18af1a-0x0;var _0x5e4a08=_0x722f[_0x18af1a];return _0x5e4a08;};'use strict';var util=require(_0xf722('0x0'));var _=require(_0xf722('0x1'));var moment=require(_0xf722('0x2'));var logger=require(_0xf722('0x3'))(_0xf722('0x4'));var ipAgi=process[_0xf722('0x5')][_0xf722('0x6')]||_0xf722('0x7');var utils=require('../../dialer/utils');exports[_0xf722('0x8')]=function(_0xc7fd4){return function(_0x268e1e){logger['error'](_0xc7fd4,util['inspect'](_0x268e1e,{'showHidden':![],'depth':null}));};};exports[_0xf722('0x9')]=function(_0x58f6b8,_0x38a8b2){logger[_0xf722('0xa')](_0x58f6b8,util['inspect'](_0x38a8b2,{'showHidden':![],'depth':null}));};exports[_0xf722('0xb')]=function(_0x266ecd,_0x1eac32){logger[_0xf722('0xc')](_0x266ecd,util['inspect'](_0x1eac32,{'showHidden':![],'depth':null}));};exports[_0xf722('0xd')]=function(_0x4e5e20){return function(_0x59476c){logger[_0xf722('0xa')](_0x4e5e20,util[_0xf722('0xe')](_0x59476c,{'showHidden':![],'depth':null}));};};exports[_0xf722('0xf')]=function(_0x656526,_0x46932b,_0x312ee0){return{'message':_0x656526,'unlock':_0x46932b,'active':_0x312ee0};};exports[_0xf722('0x10')]=function(_0x6c3988,_0x3d5168,_0x447ded){if(!_[_0xf722('0x11')](_0x447ded)&&_0xf722('0x12')===typeof _0x447ded&&!_[_0xf722('0x13')](_0x447ded)){if(!_['isUndefined'](_0x3d5168)&&_0xf722('0x12')===typeof _0x3d5168&&!_[_0xf722('0x13')](_0x3d5168)){return util[_0xf722('0x14')](_0xf722('0x15'),_0x3d5168,_0x447ded);}return util[_0xf722('0x14')](_0xf722('0x15'),_0x447ded,_0x447ded);}if(!_[_0xf722('0x11')](_0x6c3988)&&_0xf722('0x12')===typeof _0x6c3988&&!_[_0xf722('0x13')](_0x6c3988)){return _0x6c3988;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x3c66b5){if(_[_0xf722('0x16')](_0x3c66b5)){return![];}return _0x3c66b5;};exports[_0xf722('0x17')]=function(_0x54a8a3,_0x15630c,_0x1c253c,_0x509d1a,_0x50c9bb,_0x4f3785){var _0x510a61={'XMD-QUEUE':_0x15630c[_0xf722('0x18')]?_0x15630c[_0xf722('0x18')]['name']:'','XMD-CALLERID':_0x509d1a,'XMD-CALLERID-PREVIEW':_0x4f3785?util[_0xf722('0x14')](_0xf722('0x15'),_0x4f3785[_0xf722('0x19')],_0x4f3785['calleridnum']):_0x509d1a,'XMD-DIALID':_0x50c9bb,'XMD-CONTACTID':_0x15630c[_0xf722('0x1a')],'XMD-CDRTYPE':_0xf722('0x1b'),'CALLERID(all)':_0x509d1a,'XMD-VOICEQUEUEID':_0x15630c[_0xf722('0x1c')],'XMD-DIALCHANNEL':_0x1c253c,'XMD-DIALTIMEOUT':_0x54a8a3[_0xf722('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xf722('0x14')](_0xf722('0x1e'),_0x54a8a3[_0xf722('0x1f')]?'g':'',_['isEmpty'](_0x54a8a3[_0xf722('0x20')])?'':_0xf722('0x21')),'XMD-DIALURL':_0x54a8a3[_0xf722('0x22')]||'','XMD-AGI':_0x54a8a3[_0xf722('0x23')]?util[_0xf722('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x54a8a3[_0xf722('0x23')]):'NONE','XMD-AGIAFTER':_0x54a8a3[_0xf722('0x1f')]?util['format'](_0xf722('0x24'),ipAgi,_0x54a8a3['dialQueueProject2']):_0xf722('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x4f3785?_0x4f3785[_0xf722('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x4f3785?_0x4f3785[_0xf722('0x27')]:'','XMD-DESTINATION':_0xf722('0x28'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xf722('0x13')](_0x54a8a3[_0xf722('0x20')])){_0x510a61[util[_0xf722('0x14')]('%s',_0xf722('0x29'))]=_0x54a8a3[_0xf722('0x20')];_0x510a61[util[_0xf722('0x14')]('%s',_0xf722('0x2a'))]=_0x50c9bb;}if(_0x15630c&&_0x15630c[_0xf722('0x2b')]){for(var _0x2c3bc1 in _0x15630c['Contact']){if(_0x15630c[_0xf722('0x2b')]['hasOwnProperty'](_0x2c3bc1)){if(!_[_0xf722('0x16')](_0x15630c[_0xf722('0x2b')][_0x2c3bc1])&&_0x2c3bc1!=='id'&&_0x2c3bc1!==_0xf722('0x2c')&&_0x2c3bc1!==_0xf722('0x2d')&&_0x2c3bc1!==_0xf722('0x2e')){_0x510a61[util[_0xf722('0x14')](_0xf722('0x2f'),_0xf722('0x30'),_[_0xf722('0x31')](_0x2c3bc1))]=_0x15630c['Contact'][_0x2c3bc1];}}}}return _0x510a61;};exports[_0xf722('0x32')]=function(_0xb9e30f){var _0x58354b={};for(var _0xcb5993 in _0xb9e30f){if(_0xb9e30f[_0xf722('0x33')](_0xcb5993)){_0x58354b[util['format']('%s',_[_0xf722('0x34')](_0xcb5993))]=_0xb9e30f[_0xcb5993];}}return{'variables':_0x58354b};};exports['updateOriginated']=function(_0x5bf448,_0x88d630){if(!_[_0xf722('0x16')](_0x5bf448)){if(_0x5bf448[_0xf722('0x33')](_0xf722('0x35'))){if(_0x5bf448[_0xf722('0x35')]>0x0){_0x5bf448['originated']-=0x1;}else{logger[_0xf722('0xc')](_0xf722('0x36'),_0x88d630);}}}else{logger['error'](_0xf722('0x37'),_0x88d630);}};exports['logBlacklist']=function(_0xba51cf){var _0x43aa84=moment()['format'](_0xf722('0x38'));_0xba51cf[_0xf722('0x39')]=0xd;_0xba51cf[_0xf722('0x3a')]=_0xf722('0x3b');_0xba51cf[_0xf722('0x3c')]=_0x43aa84;_0xba51cf[_0xf722('0x3d')]=_0x43aa84;_0xba51cf[_0xf722('0x3e')]=_0x43aa84;};exports[_0xf722('0x3f')]=function(_0x10daf3,_0x13633d,_0x3b13e0){var _0x4b73d5=moment()[_0xf722('0x14')](_0xf722('0x38'));_0x10daf3['state']=_0x13633d;_0x10daf3[_0xf722('0x3a')]=_0x3b13e0;_0x10daf3[_0xf722('0x3d')]=_0x4b73d5;_0x10daf3[_0xf722('0x40')]=utils['getSeconds'](_0x10daf3[_0xf722('0x3d')],_0x10daf3[_0xf722('0x3c')]);};exports[_0xf722('0x41')]=function(_0x3da284,_0x285f94,_0x1a9c14){_0x3da284[_0xf722('0x42')]=_0x285f94;_0x3da284[_0xf722('0x43')]=_0x1a9c14;};exports[_0xf722('0x44')]=function(_0x1a25f5,_0x4ae350,_0x1f8e39){var _0x5bfcc3=moment()[_0xf722('0x14')](_0xf722('0x38'));_0x1a25f5[_0xf722('0x39')]=_0x4ae350;_0x1a25f5[_0xf722('0x3a')]=_0x1f8e39;_0x1a25f5['responsetime']=_0x1a25f5[_0xf722('0x3d')]?_0x1a25f5[_0xf722('0x3d')]:_0x5bfcc3;_0x1a25f5[_0xf722('0x3e')]=_0x1a25f5['endtime']?_0x1a25f5[_0xf722('0x3e')]:_0x5bfcc3;_0x1a25f5['ringtime']=utils[_0xf722('0x45')](_0x1a25f5[_0xf722('0x3d')]||0x0,_0x1a25f5['starttime']||0x0);_0x1a25f5[_0xf722('0x46')]=_0x1a25f5[_0xf722('0x47')]?utils[_0xf722('0x45')](_0x1a25f5[_0xf722('0x3e')],_0x1a25f5[_0xf722('0x47')]):0x0;};exports[_0xf722('0x48')]=function(_0x1e4acd){return _0x1e4acd===_0xf722('0x49');};exports[_0xf722('0x4a')]=function(_0x470d2d,_0x586826,_0x4728dc,_0x4d50d1,_0x230f11){var _0x4c306c=_0x4d50d1?'RECALL':_0x470d2d[_0xf722('0x19')];_0x4c306c=_0x230f11?_0xf722('0x4b'):_0x4c306c;return{'actionid':_0x470d2d[_0xf722('0x4c')],'action':_0xf722('0x4d'),'channel':_0x470d2d[_0xf722('0x4e')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x4c306c,_0x470d2d[_0xf722('0x4f')]),'Exten':'xcally-motion-preview','Context':_0xf722('0x50'),'Priority':'1','variable':_0x4728dc,'timeout':(_0x586826['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x470d2d[_0xf722('0x4c')]};};exports[_0xf722('0x51')]=function(_0x2c00f4){return _0x2c00f4[_0xf722('0x52')]+_0x2c00f4[_0xf722('0x53')]+_0x2c00f4[_0xf722('0x54')]+_0x2c00f4[_0xf722('0x55')]+_0x2c00f4[_0xf722('0x56')];};exports[_0xf722('0x57')]=function(_0x1b1d5f){var _0x5393ed=_[_0xf722('0x58')](_0x1b1d5f);_0x5393ed[_0xf722('0x39')]=0xf;_0x5393ed['statedesc']=_0xf722('0x59');return _0x5393ed;};exports[_0xf722('0x5a')]=function(_0x5f1b12,_0x450302,_0x23407c){var _0x1bd8f5={};_0x1bd8f5[_0x450302]=_0x5f1b12[_0x450302];_0x1bd8f5['active']=![];_0x1bd8f5[_0xf722('0x5b')]=moment()[_0xf722('0x5c')](_0x23407c,'minutes')[_0xf722('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x1bd8f5[_0xf722('0x1a')]=_0x5f1b12[_0xf722('0x1a')];_0x1bd8f5[_0xf722('0x5d')]=_0x5f1b12['ListId'];_0x1bd8f5['VoiceQueueId']=_0x5f1b12['VoiceQueueId']||undefined;return _0x1bd8f5;};exports[_0xf722('0x5e')]=function(_0xc64115,_0x3bbd1a){if(!_['isNil'](_0xc64115)){if(_0xc64115[_0xf722('0x5f')]>0x0){_0xc64115['pTalking']-=0x1;}else{logger['error'](_0x3bbd1a,_0xf722('0x60'));}}else{logger[_0xf722('0xc')](_0x3bbd1a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xf722('0x61')]=function(_0x462496){if(_0x462496<=0x0){return!![];}return![];};function buildObj(_0xd4c8da,_0x205701,_0x128628){_0xd4c8da[_0xf722('0x62')]=_0x205701;_0xd4c8da[_0xf722('0x63')]=_0xd4c8da[_0xf722('0x64')];_0xd4c8da[_0xf722('0x65')]=_0xd4c8da['channelAgent'];_0xd4c8da[_0xf722('0x66')]=_0xf722('0x67');if(_0x128628){_0xd4c8da[_0xf722('0x68')]=_0x128628[_0xf722('0x68')];}return _0xd4c8da;}exports[_0xf722('0x69')]=buildObj;exports[_0xf722('0x6a')]=function(_0x56709e){var _0x3e2fab={};_0x3e2fab[_0xf722('0x64')]=_0x56709e['queue'];_0x3e2fab[_0xf722('0x65')]=_0x56709e['channelAgent'];_0x3e2fab[_0xf722('0x4c')]=_0x56709e[_0xf722('0x4c')];return _0x3e2fab;};exports[_0xf722('0x6b')]=function(_0x3369a1){var _0x5d0704=[];for(var _0x4acab7 in _0x3369a1){if(_0x3369a1[_0xf722('0x33')](_0x4acab7)){if(!_[_0xf722('0x16')](_0x3369a1[_0x4acab7])&&_0x3369a1[_0x4acab7][_0xf722('0x39')]===_0xf722('0x6c')&&_0x3369a1[_0x4acab7][_0xf722('0x6d')]===_0xf722('0x6e')){_0x5d0704[_0xf722('0x6f')](_0x3369a1[_0x4acab7]['id']);}}}return _0x5d0704;};exports[_0xf722('0x70')]=function(_0x2eed8c){var _0xfa8137=moment()[_0xf722('0x71')](0x0);var _0x1ec67f=moment(_0x2eed8c)[_0xf722('0x71')](0x0);return _0xfa8137[_0xf722('0x72')](_0x1ec67f,_0xf722('0x73'));};exports['createBody']=function(_0x5eab13){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5eab13[_0xf722('0x1a')],'ListId':_0x5eab13['ListId'],'VoiceQueueId':_0x5eab13[_0xf722('0x1c')]||undefined,'CampaignId':_0x5eab13[_0xf722('0x74')]||undefined};};exports['filterKey']=function(_0x16251d){if(_0x16251d==='uniqueid'||_0x16251d===_0xf722('0x75')||_0x16251d===_0xf722('0x64')||_0x16251d===_0xf722('0x76')||_0x16251d===_0xf722('0x77')||_0x16251d===_0xf722('0x78')||_0x16251d==='membername'||_0x16251d===_0xf722('0x4e')||_0x16251d===_0xf722('0x19')||_0x16251d===_0xf722('0x79')||_0x16251d===_0xf722('0x4f')||_0x16251d==='scheduledat'||_0x16251d===_0xf722('0x52')||_0x16251d===_0xf722('0x53')||_0x16251d==='countnoanswerretry'||_0x16251d==='countglobal'||_0x16251d===_0xf722('0x7a')||_0x16251d==='callbackuniqueid'||_0x16251d===_0xf722('0x7b')||_0x16251d==='recallme'||_0x16251d===_0xf722('0x1a')||_0x16251d===_0xf722('0x5d')||_0x16251d===_0xf722('0x43')||_0x16251d==='VoiceQueueId'||_0x16251d===_0xf722('0x7c')||_0x16251d===_0xf722('0x7d')||_0x16251d===_0xf722('0x7e')||_0x16251d===_0xf722('0x7f')||_0x16251d==='xmd-listid'||_0x16251d==='xmd-dialurl'||_0x16251d==='xmd-dialtimeout'||_0x16251d===_0xf722('0x80')||_0x16251d===_0xf722('0x81')||_0x16251d===_0xf722('0x82')||_0x16251d===_0xf722('0x83')||_0x16251d===_0xf722('0x84')||_0x16251d===_0xf722('0x85')||_0x16251d===_0xf722('0x86')||_0x16251d===_0xf722('0x87')||_0x16251d==='rtpaudioqos'||_0x16251d===_0xf722('0x88')||_0x16251d==='rtpaudioqosjitter'||_0x16251d==='rtpaudioqosjitterbridged'||_0x16251d===_0xf722('0x89')||_0x16251d===_0xf722('0x8a')||_0x16251d==='rtpaudioqosrtt'||_0x16251d==='rtpaudioqosrttbridged'||_0x16251d===_0xf722('0x8b')||_0x16251d===_0xf722('0x88')||_0x16251d===_0xf722('0x8c')||_0x16251d===_0xf722('0x8d')||_0x16251d===_0xf722('0x89')||_0x16251d===_0xf722('0x8a')||_0x16251d===_0xf722('0x8e')||_0x16251d===_0xf722('0x8f')||_0x16251d==='bridgepeer'||_0x16251d===_0xf722('0x90')||_0x16251d==='state'||_0x16251d===_0xf722('0x3a')){return![];}return!![];};exports[_0xf722('0x91')]=function(_0x1d2ba0,_0x20e9fc){var _0x495afe,_0x5d9c98,_0x26788b;if(_0x20e9fc<=0x0){_0x20e9fc=0x1;}_0x495afe=new RegExp('\x5cw{0,'+_0x20e9fc+'}$');_0x5d9c98=Math[_0xf722('0x92')](0xa,_0x20e9fc-0x1);_0x26788b=Math[_0xf722('0x92')](0xa,_0x20e9fc)-0x1;return util[_0xf722('0x14')]('%s',_[_0xf722('0x93')](_0x1d2ba0,_0x495afe,_[_0xf722('0x94')](_0x5d9c98,_0x26788b)));};exports['extractCalleridName']=function(_0x1604a){var _0x27c125=_0x1604a[_0xf722('0x95')](/"(.*?)"/);return _0x27c125?_0x27c125[0x1]:_0x1604a;};exports[_0xf722('0x96')]=function(_0x4c6788){var _0x1c7a59=_0x4c6788[_0xf722('0x95')](/<(.*?)>/);return _0x1c7a59?_0x1c7a59[0x1]:_0x4c6788;};function buildNoAnswerEventPayload(_0x3732e0,_0xaa51b8){var _0x5cf7d7=buildObj(_0x3732e0,_0xf722('0x97'));if(!_[_0xf722('0x13')](_0xaa51b8[_0xf722('0x98')])){Object[_0xf722('0x99')](_0xaa51b8[_0xf722('0x98')])[_0xf722('0x9a')](function(_0x21be99){_0x5cf7d7[_0x21be99[_0xf722('0x9b')]()]=_0xaa51b8[_0xf722('0x98')][_0x21be99];});}return _0x5cf7d7;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index cf3111a..e14d9b1 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 _0x3a86=['string','number','queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd'];(function(_0x1e2e4f,_0x52a6bf){var _0x559774=function(_0x24a4a6){while(--_0x24a4a6){_0x1e2e4f['push'](_0x1e2e4f['shift']());}};_0x559774(++_0x52a6bf);}(_0x3a86,0x1ad));var _0x63a8=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x3a86[_0x30cd7e];return _0x462a02;};'use strict';exports[_0x63a8('0x0')]={'queue':{'type':_0x63a8('0x1'),'required':!![]},'interface':{'type':_0x63a8('0x1'),'required':!![]},'membername':{'type':_0x63a8('0x1'),'required':!![]},'penalty':{'type':_0x63a8('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x63a8('0x3')]={'queue':{'type':_0x63a8('0x1'),'required':!![]},'interface':{'type':_0x63a8('0x1'),'required':!![]}};exports[_0x63a8('0x4')]={'interface':{'type':_0x63a8('0x1'),'required':!![]},'paused':{'type':_0x63a8('0x5')},'reason':{'type':'string','required':![]}};exports[_0x63a8('0x6')]={'module':{'type':'string','required':![]}};exports[_0x63a8('0x7')]={'uniqueid':{'type':_0x63a8('0x1'),'required':!![]}};exports[_0x63a8('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x63a8('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x63a8('0x9')]={'uniqueid':{'type':_0x63a8('0x1'),'required':!![]},'exten':{'type':_0x63a8('0x1'),'required':!![]},'context':{'type':_0x63a8('0x1')}}; \ No newline at end of file +var _0xa827=['string','number','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd'];(function(_0x195441,_0x5f0364){var _0x20b9ae=function(_0x13eae2){while(--_0x13eae2){_0x195441['push'](_0x195441['shift']());}};_0x20b9ae(++_0x5f0364);}(_0xa827,0x167));var _0x7a82=function(_0x2acff0,_0x13f6c7){_0x2acff0=_0x2acff0-0x0;var _0xf55bdc=_0xa827[_0x2acff0];return _0xf55bdc;};'use strict';exports[_0x7a82('0x0')]={'queue':{'type':_0x7a82('0x1'),'required':!![]},'interface':{'type':_0x7a82('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x7a82('0x2'),'required':![]},'paused':{'type':_0x7a82('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7a82('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x7a82('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x7a82('0x1'),'required':![]}};exports[_0x7a82('0x4')]={'module':{'type':'string','required':![]}};exports[_0x7a82('0x5')]={'uniqueid':{'type':_0x7a82('0x1'),'required':!![]}};exports[_0x7a82('0x6')]={'uniqueid':{'type':_0x7a82('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x7a82('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x7a82('0x7')]={'uniqueid':{'type':_0x7a82('0x1'),'required':!![]}};exports[_0x7a82('0x8')]={'uniqueid':{'type':_0x7a82('0x1'),'required':!![]},'exten':{'type':_0x7a82('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e627a33..cb18828 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 _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(_0x2f36c6,_0x47f0b1){var _0x2e5255=function(_0x115fb9){while(--_0x115fb9){_0x2f36c6['push'](_0x2f36c6['shift']());}};_0x2e5255(++_0x47f0b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b5b42,_0x17696f){_0x1b5b42=_0x1b5b42-0x0;var _0x3cca24=_0x5f2f[_0x1b5b42];return _0x3cca24;};'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 +var _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x337551,_0x20111b){var _0x1f9671=function(_0x4fa062){while(--_0x4fa062){_0x337551['push'](_0x337551['shift']());}};_0x1f9671(++_0x20111b);}(_0xb10b,0x12a));var _0xbb10=function(_0x962de1,_0x361057){_0x962de1=_0x962de1-0x0;var _0x14085a=_0xb10b[_0x962de1];return _0x14085a;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 93c5017..86dbfe1 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 _0x9c95=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x20de6f,_0x16f903){var _0x496976=function(_0x2fd061){while(--_0x2fd061){_0x20de6f['push'](_0x20de6f['shift']());}};_0x496976(++_0x16f903);}(_0x9c95,0x10e));var _0x59c9=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x9c95[_0x172747];return _0x509692;};'use strict';function mergeDBDataToRealtime(_0x23998e,_0x140f26){var _0x492cfd=Object['assign']({},_0x23998e);for(var _0x3192ee in _0x140f26){if(_0x492cfd[_0x59c9('0x0')](_0x3192ee)){_0x492cfd[_0x3192ee]=_0x140f26[_0x3192ee];}}return _0x492cfd;}exports[_0x59c9('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xd1f7=['mergeDBDataToRealtime','hasOwnProperty'];(function(_0x2c74f6,_0x34efe8){var _0x11c101=function(_0x5c21fa){while(--_0x5c21fa){_0x2c74f6['push'](_0x2c74f6['shift']());}};_0x11c101(++_0x34efe8);}(_0xd1f7,0xcf));var _0x7d1f=function(_0x415ba5,_0x54bcc0){_0x415ba5=_0x415ba5-0x0;var _0x30423e=_0xd1f7[_0x415ba5];return _0x30423e;};'use strict';function mergeDBDataToRealtime(_0x5d7510,_0x1e9c53){var _0x135b92=Object['assign']({},_0x5d7510);for(var _0x261bb5 in _0x1e9c53){if(_0x135b92[_0x7d1f('0x0')](_0x261bb5)){_0x135b92[_0x261bb5]=_0x1e9c53[_0x261bb5];}}return _0x135b92;}exports[_0x7d1f('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b5ec764..3145d4b 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 _0xf67f=['interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','destination','type','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','uniqueid','getCallType','UserId','membername','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil'];(function(_0x1a5927,_0x1faaf0){var _0x115ea6=function(_0xe8db03){while(--_0xe8db03){_0x1a5927['push'](_0x1a5927['shift']());}};_0x115ea6(++_0x1faaf0);}(_0xf67f,0xeb));var _0xff67=function(_0x32da04,_0x255b7b){_0x32da04=_0x32da04-0x0;var _0x468bac=_0xf67f[_0x32da04];return _0x468bac;};'use strict';var _=require(_0xff67('0x0'));var moment=require(_0xff67('0x1'));var util=require(_0xff67('0x2'));var config=require(_0xff67('0x3'));var ami=require(_0xff67('0x4'));var RpcVoiceAgentReport=require(_0xff67('0x5'));var RpcVoiceCallReport=require(_0xff67('0x6'));var RpcVoiceDialReport=require(_0xff67('0x7'));var RpcMemberReport=require(_0xff67('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xff67('0x9'));var RpcVoiceTransferReport=require(_0xff67('0xa'));var VoiceQueueReport=require(_0xff67('0xb'));var VoiceCallReport=require(_0xff67('0xc'));var VoiceAgentReport=require(_0xff67('0xd'));var VoiceDialReport=require(_0xff67('0xe'));var UserReport=require(_0xff67('0xf'));function Report(_0x581490){this['realtime']=_0x581490;this[_0xff67('0x10')]=_0x581490[_0xff67('0x10')];this['telephones']=_0x581490[_0xff67('0x11')];}Report[_0xff67('0x12')][_0xff67('0x13')]=function(_0xedb5fd){var _0xda8545=new VoiceQueueReport(this[_0xff67('0x14')]);var _0x2a2e13=new VoiceAgentReport(this['realtime']);var _0x1cd222=new VoiceDialReport(this['realtime']);var _0x2f6e5b=new VoiceCallReport(this['realtime']);var _0x3b853a=new UserReport(this['realtime']);if(config[_0xff67('0x15')]&&config[_0xff67('0x15')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xff67('0x16')][_0xff67('0x17')](this));ami['on'](_0xff67('0x18'),this[_0xff67('0x19')]['bind'](this));ami['on'](_0xff67('0x1a'),this[_0xff67('0x1b')][_0xff67('0x17')](this));ami['on']('custom:voiceDialReport',this[_0xff67('0x1c')][_0xff67('0x17')](this));ami['on'](_0xff67('0x1d'),this[_0xff67('0x1e')]['bind'](this));ami['on'](_0xff67('0x1f'),this[_0xff67('0x20')]['bind'](this));}};Report['prototype'][_0xff67('0x21')]=function(_0x33d556){var _0x476f49;_0x476f49=_[_0xff67('0x22')](this[_0xff67('0x10')],function(_0x2828ba){return _0x2828ba[_0xff67('0x23')]==_0x33d556||_0x2828ba[_0xff67('0x24')]==_0x33d556;});if(_[_0xff67('0x25')](_0x476f49)){var _0x27a9a5=_[_0xff67('0x22')](this[_0xff67('0x11')],function(_0x3cb8e7){return _0x3cb8e7['accountcode']==_0x33d556||_0x3cb8e7[_0xff67('0x24')]==_0x33d556;});if(_0x27a9a5){_0x476f49=_[_0xff67('0x22')](this[_0xff67('0x10')],function(_0x2a510e){return _0x2a510e[_0xff67('0x26')]==util[_0xff67('0x27')](_0xff67('0x28'),_0x27a9a5['name']);});}}return _0x476f49;};Report[_0xff67('0x12')][_0xff67('0x16')]=function(_0x5f0403){for(var _0x301527=0x0;_0x301527<_0x5f0403[_0xff67('0x29')];_0x301527+=0x1){var _0x48e6e7=this[_0xff67('0x21')](_0x5f0403[_0x301527][_0xff67('0x2a')]);if(_0x48e6e7){_0x5f0403[_0x301527][_0xff67('0x23')]=_0x48e6e7[_0xff67('0x23')];_0x5f0403[_0x301527][_0xff67('0x2b')]=!![];_0x5f0403[_0x301527][_0xff67('0x2c')]=_0x48e6e7['name'];_0x5f0403[_0x301527][_0xff67('0x26')]=_['isNil'](_0x48e6e7[_0xff67('0x26')])?util[_0xff67('0x27')]('SIP/%s',_0x48e6e7[_0xff67('0x24')]):_0x48e6e7[_0xff67('0x26')];if(_0x5f0403[_0x301527]['queuecallercomplete']){_0x5f0403[_0x301527][_0xff67('0x2d')]=moment()[_0xff67('0x27')](_0xff67('0x2e'));}if(_0x5f0403[_0x301527]['queuecallerexit']){_0x5f0403[_0x301527][_0xff67('0x2f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x5f0403[_0x301527]);}RpcVoiceQueueReport[_0xff67('0x30')](_0x5f0403[_0x301527]);}};function extractCalleridNumber(_0x4290e6){var _0x452b73=_0x4290e6[_0xff67('0x31')](/<(.*?)>/);return _0x452b73?_0x452b73[0x1]:_0x4290e6;}Report[_0xff67('0x12')][_0xff67('0x32')]=function(_0x48ccf0){for(var _0x186083=0x0;_0x186083','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','UserId','membername','create','monitors','monitorFilename','filename','createdAt','connectedlinename','connectedlinenum','exten','voiceAgentReport','forEach','Local','substring','mobile','indexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents'];(function(_0x3dcefe,_0x1568e6){var _0x2284e5=function(_0x4cd9b2){while(--_0x4cd9b2){_0x3dcefe['push'](_0x3dcefe['shift']());}};_0x2284e5(++_0x1568e6);}(_0xde50,0xfe));var _0x0de5=function(_0x5e4d21,_0x47145b){_0x5e4d21=_0x5e4d21-0x0;var _0x479038=_0xde50[_0x5e4d21];return _0x479038;};'use strict';var _=require(_0x0de5('0x0'));var moment=require('moment');var util=require(_0x0de5('0x1'));var config=require(_0x0de5('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x0de5('0x3'));var RpcVoiceDialReport=require(_0x0de5('0x4'));var RpcMemberReport=require(_0x0de5('0x5'));var RpcVoiceQueueReport=require(_0x0de5('0x6'));var RpcVoiceRecording=require(_0x0de5('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x0de5('0x8'));var VoiceCallReport=require(_0x0de5('0x9'));var VoiceAgentReport=require(_0x0de5('0xa'));var VoiceDialReport=require(_0x0de5('0xb'));var UserReport=require('./userReport');function Report(_0x1f98d2){this['realtime']=_0x1f98d2;this[_0x0de5('0xc')]=_0x1f98d2[_0x0de5('0xc')];this[_0x0de5('0xd')]=_0x1f98d2['telephones'];}Report[_0x0de5('0xe')][_0x0de5('0xf')]=function(_0x2a011f){var _0x1145af=new VoiceQueueReport(this[_0x0de5('0x10')]);var _0x5d1ce4=new VoiceAgentReport(this[_0x0de5('0x10')]);var _0x240029=new VoiceDialReport(this[_0x0de5('0x10')]);var _0x13051a=new VoiceCallReport(this[_0x0de5('0x10')]);var _0xc26aac=new UserReport(this[_0x0de5('0x10')]);if(config[_0x0de5('0x11')]&&config[_0x0de5('0x11')][_0x0de5('0x12')]){ami['on'](_0x0de5('0x13'),this[_0x0de5('0x14')][_0x0de5('0x15')](this));ami['on'](_0x0de5('0x16'),this[_0x0de5('0x17')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0x0de5('0x15')](this));ami['on'](_0x0de5('0x18'),this[_0x0de5('0x19')]['bind'](this));ami['on']('blindtransfer',this[_0x0de5('0x1a')][_0x0de5('0x15')](this));ami['on']('attendedtransfer',this[_0x0de5('0x1b')][_0x0de5('0x15')](this));}};Report[_0x0de5('0xe')][_0x0de5('0x1c')]=function(_0x1d9425){var _0x1e4ae5;_0x1e4ae5=_[_0x0de5('0x1d')](this[_0x0de5('0xc')],function(_0x22bf6b){return _0x22bf6b['accountcode']==_0x1d9425||_0x22bf6b[_0x0de5('0x1e')]==_0x1d9425;});if(_[_0x0de5('0x1f')](_0x1e4ae5)){var _0x1c9406=_['find'](this[_0x0de5('0xd')],function(_0x5aac09){return _0x5aac09[_0x0de5('0x20')]==_0x1d9425||_0x5aac09['name']==_0x1d9425;});if(_0x1c9406){_0x1e4ae5=_[_0x0de5('0x1d')](this[_0x0de5('0xc')],function(_0x58f74f){return _0x58f74f[_0x0de5('0x21')]==util['format']('SIP/%s',_0x1c9406[_0x0de5('0x1e')]);});}}return _0x1e4ae5;};Report['prototype']['voiceQueueReport']=function(_0x11040f){for(var _0x4d7f50=0x0;_0x4d7f50<_0x11040f['length'];_0x4d7f50+=0x1){var _0x4ef233=this[_0x0de5('0x1c')](_0x11040f[_0x4d7f50]['connectedlinenum']);if(_0x4ef233){_0x11040f[_0x4d7f50][_0x0de5('0x20')]=_0x4ef233[_0x0de5('0x20')];_0x11040f[_0x4d7f50][_0x0de5('0x22')]=!![];_0x11040f[_0x4d7f50][_0x0de5('0x23')]=_0x4ef233[_0x0de5('0x1e')];_0x11040f[_0x4d7f50][_0x0de5('0x21')]=_[_0x0de5('0x1f')](_0x4ef233[_0x0de5('0x21')])?util[_0x0de5('0x24')](_0x0de5('0x25'),_0x4ef233[_0x0de5('0x1e')]):_0x4ef233[_0x0de5('0x21')];if(_0x11040f[_0x4d7f50][_0x0de5('0x26')]){_0x11040f[_0x4d7f50][_0x0de5('0x27')]=moment()[_0x0de5('0x24')](_0x0de5('0x28'));}if(_0x11040f[_0x4d7f50]['queuecallerexit']){_0x11040f[_0x4d7f50][_0x0de5('0x29')]=moment()[_0x0de5('0x24')](_0x0de5('0x28'));}RpcMemberReport[_0x0de5('0x14')](_0x11040f[_0x4d7f50]);}RpcVoiceQueueReport['create'](_0x11040f[_0x4d7f50]);}};function extractCalleridNumber(_0x3d5fc7){var _0x5bb2db=_0x3d5fc7[_0x0de5('0x2a')](/<(.*?)>/);return _0x5bb2db?_0x5bb2db[0x1]:_0x3d5fc7;}Report['prototype']['getAgentByInternal']=function(_0x785121){for(var _0x5ace40=0x0;_0x5ace400x0?!![]:![];if(!_0x3c9be8){return this['syncQueueSummaryComplete'](this[_0x2310('0x16')][_0x2310('0x79')]);}};VoiceQueueReport['prototype'][_0x2310('0x1d')]=function(_0x49829f){var _0x1b0162=this['summary']['id'];if(this[_0x2310('0x16')]['queuestatus'][_0x1b0162]&&this[_0x2310('0x16')][_0x2310('0x75')][_0x1b0162][_0x49829f[_0x2310('0x6d')]]){this[_0x2310('0x16')][_0x2310('0x75')][_0x1b0162][_0x49829f[_0x2310('0x6d')]]['agents']['push'](_0x49829f);}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0x18')]=function(_0x1aa1f9){var _0x1cc180=this;try{if(this[_0x2310('0x66')](_0x1aa1f9)&&this[_0x2310('0x66')](_0x1aa1f9['queue'])){logger[_0x2310('0x62')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x2310('0x4b')](_0x1aa1f9,{'showHidden':![],'depth':null}));var _0x7da5fa=this['voiceQueues'][_0x1aa1f9[_0x2310('0x54')]];if(_0x7da5fa){logger[_0x2310('0x7a')](_0x2310('0x7b'),_0x7da5fa[_0x2310('0x64')]);this[_0x2310('0x16')]['queues'][_0x7da5fa[_0x2310('0x64')]]={'summaryEvent':_0x1aa1f9};this[_0x2310('0x16')]['statusRequests']+=0x1;return ami[_0x2310('0x44')]({'action':'queuestatus','queue':_0x7da5fa[_0x2310('0x64')]})['then'](function(_0x14ee7a){if(!_0x1cc180[_0x2310('0x16')][_0x2310('0x75')][_0x1aa1f9['actionid']]){_0x1cc180[_0x2310('0x16')][_0x2310('0x75')][_0x1aa1f9['actionid']]={};}_0x1cc180[_0x2310('0x16')]['queuestatus'][_0x1aa1f9[_0x2310('0x6d')]][_0x14ee7a['actionid']]={'queue':_0x7da5fa[_0x2310('0x64')],'agents':[]};})['catch'](function(_0x45998a){throw _0x45998a;});}}}catch(_0x20161c){logger[_0x2310('0x4a')](_0x2310('0x6e'),util[_0x2310('0x4b')](_0x20161c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xdab0ff){if(this[_0x2310('0x16')][_0x2310('0x78')]>0x0){this[_0x2310('0x16')][_0x2310('0x79')]=_0xdab0ff;return;}logger[_0x2310('0x62')](_0x2310('0x7c'),util['inspect'](_0xdab0ff,{'showHidden':![],'depth':null}));this[_0x2310('0x16')]=initializeSummary();ami[_0x2310('0x52')](_0x2310('0x7d'),{});};VoiceQueueReport[_0x2310('0xb')][_0x2310('0x21')]=function(_0x562955){try{if(this[_0x2310('0x66')](_0x562955)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x562955[_0x2310('0x59')],util[_0x2310('0x4b')](_0x562955,{'showHidden':![],'depth':null}));if(_[_0x2310('0x67')](this['queueReports'][_0x562955[_0x2310('0x59')]])){this['queueReports'][_0x562955[_0x2310('0x59')]]=[];}if(_['isUndefined'](this['channels'][_0x562955[_0x2310('0x59')]])){this[_0x2310('0x12')][_0x562955[_0x2310('0x59')]]={};}var _0x2d6304=new QueueReport();_0x2d6304['queue']=_0x562955['queue'];_0x2d6304[_0x2310('0x60')]=this[_0x2310('0x14')][_0x2d6304[_0x2310('0x54')]]&&this[_0x2310('0x14')][_0x2d6304[_0x2310('0x54')]]['type']?this[_0x2310('0x14')][_0x2d6304[_0x2310('0x54')]][_0x2310('0x60')]||_0x2310('0x61'):_0x2310('0x61');_0x2d6304[_0x2310('0x7e')]=moment()['format'](_0x2310('0x7f'));_0x2d6304[_0x2310('0x80')]=_0x562955[_0x2310('0x80')];_0x2d6304['count']=_0x562955[_0x2310('0x81')];_0x2d6304[_0x2310('0x59')]=_0x562955[_0x2310('0x59')];_0x2d6304[_0x2310('0x82')]=this[_0x2310('0x12')][_0x562955['uniqueid']][_0x2310('0x82')];logger[_0x2310('0x7a')](_0x2310('0x83'),_0x2d6304[_0x2310('0x54')],_0x2d6304[_0x2310('0x60')]);_[_0x2310('0x84')](_0x2d6304,_[_0x2310('0x85')](_0x562955,_['keys'](_0x2d6304)));this[_0x2310('0xf')][_0x562955['uniqueid']][_0x2310('0x86')](_0x2d6304);this[_0x2310('0x12')][_0x562955[_0x2310('0x59')]]=_0x2d6304;this[_0x2310('0x50')](_0x2d6304,_0x2310('0x20'));}}catch(_0x16bb6b){logger[_0x2310('0x4a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x562955[_0x2310('0x59')],util[_0x2310('0x4b')](_0x16bb6b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0x23')]=function(_0x237df7){try{if(this[_0x2310('0x66')](_0x237df7)){logger[_0x2310('0x62')]('[%s][voiceQueueReport][queuecallerabandon]',_0x237df7[_0x2310('0x59')],util[_0x2310('0x4b')](_0x237df7,{'showHidden':![],'depth':null}));if(this[_0x2310('0xf')][_0x237df7[_0x2310('0x59')]]){var _0xdf3ae7=_[_0x2310('0x87')](this[_0x2310('0xf')][_0x237df7[_0x2310('0x59')]]);_0xdf3ae7['queuecallercomplete']=![];_0xdf3ae7[_0x2310('0x88')]=null;_0xdf3ae7[_0x2310('0x89')]=_0x237df7['holdtime'];_0xdf3ae7[_0x2310('0x8a')]=_0x237df7[_0x2310('0x8a')];_0xdf3ae7[_0x2310('0x22')]=!![];_0xdf3ae7['queuecallerabandonAt']=moment()[_0x2310('0x5c')](_0x2310('0x7f'));_0xdf3ae7[_0x2310('0x5a')]=_0x2310('0x8b');_0xdf3ae7['lastAssignedTo']=null;logger['info'](_0x2310('0x8c'),_0xdf3ae7['queue'],_0xdf3ae7[_0x2310('0x60')]);this[_0x2310('0x12')][_0x237df7[_0x2310('0x59')]]=_0xdf3ae7;this[_0x2310('0x4f')](_0xdf3ae7,_0x2310('0x22'));}}}catch(_0x3f6640){logger[_0x2310('0x4a')](_0x2310('0x8d'),_0x237df7['uniqueid'],util[_0x2310('0x4b')](_0x3f6640,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2310('0xb')]['syncQueueCallerLeave']=function(_0x3c8d82){try{if(this[_0x2310('0x66')](_0x3c8d82)){logger[_0x2310('0x62')](_0x2310('0x8e'),_0x3c8d82['uniqueid'],util[_0x2310('0x4b')](_0x3c8d82,{'showHidden':![],'depth':null}));if(this[_0x2310('0xf')][_0x3c8d82[_0x2310('0x59')]]){var _0x38ecfc=_[_0x2310('0x87')](this[_0x2310('0xf')][_0x3c8d82['uniqueid']]);_0x38ecfc['queuecallerleaveAt']=moment()['format'](_0x2310('0x7f'));_0x38ecfc['connectedlinenum']=_0x3c8d82[_0x2310('0x8f')];_0x38ecfc[_0x2310('0x90')]=_0x3c8d82[_0x2310('0x90')];logger[_0x2310('0x7a')](_0x2310('0x91'),_0x38ecfc[_0x2310('0x54')],_0x38ecfc['type'],_0x3c8d82[_0x2310('0x8f')],_0x3c8d82['connectedlinename']);this[_0x2310('0x12')][_0x3c8d82[_0x2310('0x59')]]=_0x38ecfc;this[_0x2310('0x50')](_0x38ecfc,_0x2310('0x24'));}}}catch(_0x5f41f8){logger['error'](_0x2310('0x8e'),_0x3c8d82[_0x2310('0x59')],util[_0x2310('0x4b')](_0x5f41f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0x92')]=function(_0x486507){try{if(this[_0x2310('0x66')](_0x486507)){logger[_0x2310('0x62')]('[%s][voiceQueueReport][agentconnect]',_0x486507[_0x2310('0x59')],util[_0x2310('0x4b')](_0x486507,{'showHidden':![],'depth':null}));if(this[_0x2310('0xf')][_0x486507[_0x2310('0x59')]]){var _0x5773d0=_[_0x2310('0x87')](this[_0x2310('0xf')][_0x486507[_0x2310('0x59')]]);_0x5773d0[_0x2310('0x93')]=!![];_0x5773d0[_0x2310('0x5a')]='COMPLETEDBYAGENT';logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5773d0[_0x2310('0x54')],_0x5773d0[_0x2310('0x60')]);}}}catch(_0x1873b1){logger[_0x2310('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x486507['uniqueid'],util['inspect'](_0x1873b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2310('0x27')]=function(_0x292a89){try{if(this[_0x2310('0x66')](_0x292a89)){logger[_0x2310('0x62')]('[%s][voiceQueueReport][agentcomplete]',_0x292a89['uniqueid'],util[_0x2310('0x4b')](_0x292a89,{'showHidden':![],'depth':null}));if(this[_0x2310('0xf')][_0x292a89[_0x2310('0x59')]]){var _0x3d32f9=_['last'](this[_0x2310('0xf')][_0x292a89[_0x2310('0x59')]]);_0x3d32f9['queuecallerabandon']=![];_0x3d32f9[_0x2310('0x94')]=null;_0x3d32f9['assigned']=!![];_0x3d32f9['lastAssignedTo']=_0x292a89[_0x2310('0x95')];_0x3d32f9[_0x2310('0x89')]=_0x292a89[_0x2310('0x89')];_0x3d32f9[_0x2310('0x93')]=!![];_0x3d32f9[_0x2310('0x96')]=![];_0x3d32f9[_0x2310('0x97')]=null;if(!_0x3d32f9[_0x2310('0x98')]){if(_0x292a89[_0x2310('0x99')]==_0x2310('0x98')){_0x3d32f9['queuecallerexitreason']='COMPLETED';logger[_0x2310('0x7a')](_0x2310('0x9a'),_0x3d32f9['queue'],_0x3d32f9['type']);}else{if(_[_0x2310('0x9b')](_0x292a89[_0x2310('0x46')]['toLowerCase'](),_0x2310('0x9c'))){if(this[_0x2310('0xf')][_0x292a89[_0x2310('0x9d')]]){var _0x4d918c=_['last'](this['queueReports'][_0x292a89[_0x2310('0x9d')]]);_0x4d918c[_0x2310('0x93')]=![];_0x4d918c[_0x2310('0x96')]=!![];_0x4d918c[_0x2310('0x97')]=moment(_0x3d32f9[_0x2310('0x7e')])[_0x2310('0x9e')](_0x292a89[_0x2310('0x89')],'seconds')['format'](_0x2310('0x7f'));_0x4d918c[_0x2310('0x5a')]=_0x2310('0x9f');_0x4d918c[_0x2310('0x98')]=!![];_0x4d918c[_0x2310('0xa0')]=_0x2310('0xa1');_0x4d918c[_0x2310('0xa2')]=_0x292a89[_0x2310('0xa3')];_0x4d918c[_0x2310('0xa4')]=_0x292a89[_0x2310('0x59')];logger[_0x2310('0x7a')](_0x2310('0xa5'),_0x4d918c[_0x2310('0x54')],_0x4d918c[_0x2310('0x60')]);var _0x2ffae6=this[_0x2310('0xf')][_0x292a89[_0x2310('0x9d')]];this[_0x2310('0xf')][_0x292a89[_0x2310('0x9d')]]=this[_0x2310('0xf')][_0x292a89[_0x2310('0x59')]];this[_0x2310('0xf')][_0x292a89['uniqueid']]=_0x2ffae6;}}else{_0x3d32f9[_0x2310('0x5a')]=_0x2310('0xa6')+_0x292a89[_0x2310('0x99')][_0x2310('0xa7')]();logger[_0x2310('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3d32f9[_0x2310('0x54')],_0x3d32f9[_0x2310('0x60')],_0x3d32f9[_0x2310('0x5a')]);}}}this[_0x2310('0x12')][_0x292a89[_0x2310('0x59')]]=_0x3d32f9;this['emitVoiceQueueChannelRemove'](_0x3d32f9,'agentcomplete');}}}catch(_0x388fee){logger[_0x2310('0x4a')](_0x2310('0xa8'),_0x292a89[_0x2310('0x59')],util['inspect'](_0x388fee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0x29')]=function(_0x9c57b1){try{if(this[_0x2310('0x66')](_0x9c57b1)){logger[_0x2310('0x62')](_0x2310('0xa9'),_0x9c57b1['uniqueid'],util['inspect'](_0x9c57b1,{'showHidden':![],'depth':null}));this[_0x2310('0xaa')](_0x9c57b1['uniqueid'],_[_0x2310('0xab')](_0x9c57b1['variable'])[0x0],_0x9c57b1[_0x2310('0xac')]);if(this[_0x2310('0xf')][_0x9c57b1[_0x2310('0x59')]]){var _0x2d26dc=_[_0x2310('0x87')](this[_0x2310('0xf')][_0x9c57b1[_0x2310('0x59')]]);if(_0x2d26dc){if(this[_0x2310('0x66')](_0x9c57b1[_0x2310('0xad')])&&this[_0x2310('0x66')](_0x9c57b1[_0x2310('0xad')][_0x2310('0x75')])){switch(_0x9c57b1['value']){case _0x2310('0xae'):_0x2d26dc[_0x2310('0x96')]=![];_0x2d26dc[_0x2310('0x97')]=null;break;case'TIMEOUT':_0x2d26dc[_0x2310('0xaf')]='timeout';_0x2d26dc['queuecallerexit']=!![];_0x2d26dc[_0x2310('0x97')]=moment()[_0x2310('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d26dc[_0x2310('0xb0')]=moment()[_0x2310('0x5c')](_0x2310('0x7f'));logger[_0x2310('0x62')](_0x2310('0xb1'),_0x9c57b1['uniqueid'],util['inspect'](_0x2d26dc,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x2d26dc);break;default:_0x2d26dc['queuecallerexit']=!![];_0x2d26dc['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d26dc[_0x2310('0xb0')]=moment()[_0x2310('0x5c')](_0x2310('0x7f'));}_0x2d26dc[_0x2310('0x22')]=![];_0x2d26dc[_0x2310('0x94')]=null;_0x2d26dc[_0x2310('0x5a')]=_0x9c57b1[_0x2310('0xac')];this[_0x2310('0x12')][_0x9c57b1[_0x2310('0x59')]]=_0x2d26dc;this[_0x2310('0x4f')](_0x2d26dc,'varset');}else if(this[_0x2310('0x66')](_0x9c57b1[_0x2310('0xad')])&&this[_0x2310('0x66')](_0x9c57b1[_0x2310('0xad')][_0x2310('0xb2')])){if(!_0x2d26dc[_0x2310('0x22')]){_0x2d26dc[_0x2310('0x96')]=!![];_0x2d26dc['queuecallerexitAt']=moment()[_0x2310('0x5c')](_0x2310('0x7f'));_0x2d26dc[_0x2310('0x5a')]='EXITWITHKEY';_0x2d26dc[_0x2310('0xb0')]=moment()[_0x2310('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2310('0x12')][_0x9c57b1[_0x2310('0x59')]]=_0x2d26dc;}}logger[_0x2310('0x7a')](_0x2310('0xb3'),_0x9c57b1[_0x2310('0x59')],_0x2d26dc[_0x2310('0x54')],_0x2d26dc[_0x2310('0x60')],_[_0x2310('0xab')](_0x9c57b1['variable'])[0x0],_0x9c57b1['value']);_0x2d26dc['variables']=this[_0x2310('0x17')][_0x9c57b1[_0x2310('0x59')]];}}}}catch(_0x4c7498){logger[_0x2310('0x4a')]('[%s][voiceQueueReport][varset]',_0x9c57b1[_0x2310('0x59')],util[_0x2310('0x4b')](_0x4c7498,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0xaa')]=function(_0x2b28bb,_0x241b0f,_0x1a276c){var _0x16028c=[_0x2310('0xb4'),_0x2310('0xb5'),_0x2310('0xb6'),_0x2310('0xb7'),'rtpaudioqosloss',_0x2310('0xb8'),_0x2310('0xb9'),'rtpaudioqosrttbridged',_0x2310('0xba'),_0x2310('0xbb'),_0x2310('0xbc'),'bridgepvtcallid',_0x2310('0xbd'),_0x2310('0xbe'),_0x2310('0xbf'),'memberlastcall','membername',_0x2310('0xc0'),_0x2310('0xc1')];if(!_[_0x2310('0x43')](_0x241b0f)&&!_[_0x2310('0xc2')](_0x16028c,_0x241b0f)){if(_[_0x2310('0x67')](this[_0x2310('0x17')][_0x2b28bb])){this[_0x2310('0x17')][_0x2b28bb]={};}this[_0x2310('0x17')][_0x2b28bb][_0x241b0f]=_0x1a276c;}};VoiceQueueReport[_0x2310('0xb')][_0x2310('0xc3')]=function(_0x2e905f,_0x22d643,_0x1ee5f8){var _0x2480f9={};for(var _0x38267d=0x0;_0x38267d0x0?!![]:![];if(!_0x535a46){return this[_0x7c07('0x18')](this[_0x7c07('0x14')][_0x7c07('0x6b')]);}};VoiceQueueReport[_0x7c07('0xb')]['syncQueueMember']=function(_0xc7a35f){var _0x319f8a=this[_0x7c07('0x14')]['id'];if(this[_0x7c07('0x14')][_0x7c07('0x5d')][_0x319f8a]&&this[_0x7c07('0x14')][_0x7c07('0x5d')][_0x319f8a][_0xc7a35f[_0x7c07('0x5b')]]){this[_0x7c07('0x14')][_0x7c07('0x5d')][_0x319f8a][_0xc7a35f[_0x7c07('0x5b')]][_0x7c07('0x10')]['push'](_0xc7a35f);}};VoiceQueueReport['prototype'][_0x7c07('0x17')]=function(_0x2faed1){var _0x4eec2f=this;try{if(this['isNotNull'](_0x2faed1)&&this['isNotNull'](_0x2faed1[_0x7c07('0x4e')])){logger[_0x7c07('0x47')](_0x7c07('0x6c'),util[_0x7c07('0x41')](_0x2faed1,{'showHidden':![],'depth':null}));var _0x478b0b=this[_0x7c07('0x12')][_0x2faed1[_0x7c07('0x4e')]];if(_0x478b0b){logger[_0x7c07('0x6d')](_0x7c07('0x6e'),_0x478b0b[_0x7c07('0x61')]);this[_0x7c07('0x14')][_0x7c07('0x60')][_0x478b0b[_0x7c07('0x61')]]={'summaryEvent':_0x2faed1};this[_0x7c07('0x14')][_0x7c07('0x6a')]+=0x1;return ami[_0x7c07('0x3b')]({'action':_0x7c07('0x5d'),'queue':_0x478b0b[_0x7c07('0x61')]})['then'](function(_0x5b2ab2){if(!_0x4eec2f['summary']['queuestatus'][_0x2faed1[_0x7c07('0x5b')]]){_0x4eec2f['summary'][_0x7c07('0x5d')][_0x2faed1['actionid']]={};}_0x4eec2f[_0x7c07('0x14')][_0x7c07('0x5d')][_0x2faed1[_0x7c07('0x5b')]][_0x5b2ab2[_0x7c07('0x5b')]]={'queue':_0x478b0b[_0x7c07('0x61')],'agents':[]};})['catch'](function(_0x544588){throw _0x544588;});}}}catch(_0x43a507){logger['error']('[voiceQueueReport][queuesummary]',util[_0x7c07('0x41')](_0x43a507,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')][_0x7c07('0x18')]=function(_0x27837f){if(this[_0x7c07('0x14')][_0x7c07('0x6a')]>0x0){this[_0x7c07('0x14')][_0x7c07('0x6b')]=_0x27837f;return;}logger['debug'](_0x7c07('0x6f'),util['inspect'](_0x27837f,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x7c07('0x4b')](_0x7c07('0x70'),{});};VoiceQueueReport['prototype'][_0x7c07('0x1e')]=function(_0x38fccc){try{if(this['isNotNull'](_0x38fccc)){logger[_0x7c07('0x47')]('[%s][voiceQueueReport][queuecallerjoin]',_0x38fccc[_0x7c07('0x4a')],util['inspect'](_0x38fccc,{'showHidden':![],'depth':null}));if(_[_0x7c07('0x71')](this[_0x7c07('0xe')][_0x38fccc[_0x7c07('0x4a')]])){this[_0x7c07('0xe')][_0x38fccc['uniqueid']]=[];}if(_[_0x7c07('0x71')](this['channels'][_0x38fccc['uniqueid']])){this[_0x7c07('0x38')][_0x38fccc[_0x7c07('0x4a')]]={};}var _0x23cf40=new QueueReport();_0x23cf40[_0x7c07('0x4e')]=_0x38fccc[_0x7c07('0x4e')];_0x23cf40[_0x7c07('0x68')]=this[_0x7c07('0x12')][_0x23cf40[_0x7c07('0x4e')]]&&this[_0x7c07('0x12')][_0x23cf40[_0x7c07('0x4e')]][_0x7c07('0x68')]?this[_0x7c07('0x12')][_0x23cf40[_0x7c07('0x4e')]]['type']||_0x7c07('0x56'):'inbound';_0x23cf40['queuecallerjoinAt']=moment()['format'](_0x7c07('0x72'));_0x23cf40[_0x7c07('0x73')]=_0x38fccc[_0x7c07('0x73')];_0x23cf40['count']=_0x38fccc[_0x7c07('0x74')];_0x23cf40['uniqueid']=_0x38fccc[_0x7c07('0x4a')];_0x23cf40[_0x7c07('0x75')]=this[_0x7c07('0x38')][_0x38fccc[_0x7c07('0x4a')]][_0x7c07('0x75')];logger['info'](_0x7c07('0x76'),_0x23cf40[_0x7c07('0x4e')],_0x23cf40[_0x7c07('0x68')]);_['merge'](_0x23cf40,_[_0x7c07('0x77')](_0x38fccc,_[_0x7c07('0x78')](_0x23cf40)));this[_0x7c07('0xe')][_0x38fccc[_0x7c07('0x4a')]][_0x7c07('0x79')](_0x23cf40);this[_0x7c07('0x38')][_0x38fccc[_0x7c07('0x4a')]]=_0x23cf40;this[_0x7c07('0x46')](_0x23cf40,_0x7c07('0x1d'));}}catch(_0x2a09b3){logger[_0x7c07('0x3f')](_0x7c07('0x7a'),_0x38fccc[_0x7c07('0x4a')],util['inspect'](_0x2a09b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')]['syncQueueCallerAbandon']=function(_0x5e2002){try{if(this[_0x7c07('0x7b')](_0x5e2002)){logger['debug'](_0x7c07('0x7c'),_0x5e2002[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x5e2002,{'showHidden':![],'depth':null}));if(this[_0x7c07('0xe')][_0x5e2002[_0x7c07('0x4a')]]){var _0x49f7f9=_[_0x7c07('0x7d')](this[_0x7c07('0xe')][_0x5e2002['uniqueid']]);_0x49f7f9[_0x7c07('0x7e')]=![];_0x49f7f9[_0x7c07('0x7f')]=null;_0x49f7f9[_0x7c07('0x80')]=_0x5e2002[_0x7c07('0x80')];_0x49f7f9[_0x7c07('0x81')]=_0x5e2002[_0x7c07('0x81')];_0x49f7f9[_0x7c07('0x82')]=!![];_0x49f7f9[_0x7c07('0x83')]=moment()[_0x7c07('0x4c')](_0x7c07('0x72'));_0x49f7f9[_0x7c07('0x53')]=_0x7c07('0x84');_0x49f7f9[_0x7c07('0x85')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x49f7f9[_0x7c07('0x4e')],_0x49f7f9[_0x7c07('0x68')]);this['channels'][_0x5e2002[_0x7c07('0x4a')]]=_0x49f7f9;this[_0x7c07('0x51')](_0x49f7f9,'queuecallerabandon');}}}catch(_0x4b69db){logger[_0x7c07('0x3f')](_0x7c07('0x7c'),_0x5e2002[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x4b69db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')][_0x7c07('0x21')]=function(_0x3e558b){try{if(this['isNotNull'](_0x3e558b)){logger[_0x7c07('0x47')](_0x7c07('0x86'),_0x3e558b[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x3e558b,{'showHidden':![],'depth':null}));if(this[_0x7c07('0xe')][_0x3e558b['uniqueid']]){var _0x1023ff=_[_0x7c07('0x7d')](this[_0x7c07('0xe')][_0x3e558b['uniqueid']]);_0x1023ff[_0x7c07('0x87')]=moment()[_0x7c07('0x4c')](_0x7c07('0x72'));_0x1023ff['connectedlinenum']=_0x3e558b[_0x7c07('0x88')];_0x1023ff[_0x7c07('0x89')]=_0x3e558b['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1023ff[_0x7c07('0x4e')],_0x1023ff[_0x7c07('0x68')],_0x3e558b[_0x7c07('0x88')],_0x3e558b['connectedlinename']);this[_0x7c07('0x38')][_0x3e558b[_0x7c07('0x4a')]]=_0x1023ff;this[_0x7c07('0x46')](_0x1023ff,_0x7c07('0x20'));}}}catch(_0x11757b){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x3e558b[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x11757b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')][_0x7c07('0x25')]=function(_0x884d8e){try{if(this[_0x7c07('0x7b')](_0x884d8e)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x884d8e['uniqueid'],util['inspect'](_0x884d8e,{'showHidden':![],'depth':null}));if(this[_0x7c07('0xe')][_0x884d8e[_0x7c07('0x4a')]]){var _0x5c4512=_[_0x7c07('0x7d')](this[_0x7c07('0xe')][_0x884d8e['uniqueid']]);_0x5c4512[_0x7c07('0x7e')]=!![];_0x5c4512[_0x7c07('0x53')]=_0x7c07('0x8a');logger[_0x7c07('0x6d')](_0x7c07('0x8b'),_0x5c4512[_0x7c07('0x4e')],_0x5c4512[_0x7c07('0x68')]);}}}catch(_0x353c50){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x884d8e['uniqueid'],util[_0x7c07('0x41')](_0x353c50,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')]['syncAgentComplete']=function(_0x58acf9){try{if(this['isNotNull'](_0x58acf9)){logger[_0x7c07('0x47')]('[%s][voiceQueueReport][agentcomplete]',_0x58acf9[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x58acf9,{'showHidden':![],'depth':null}));if(this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x4a')]]){var _0x1995d8=_[_0x7c07('0x7d')](this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x4a')]]);_0x1995d8[_0x7c07('0x82')]=![];_0x1995d8[_0x7c07('0x83')]=null;_0x1995d8['assigned']=!![];_0x1995d8['lastAssignedTo']=_0x58acf9[_0x7c07('0x8c')];_0x1995d8[_0x7c07('0x80')]=_0x58acf9[_0x7c07('0x80')];_0x1995d8[_0x7c07('0x7e')]=!![];_0x1995d8[_0x7c07('0x8d')]=![];_0x1995d8[_0x7c07('0x8e')]=null;if(!_0x1995d8[_0x7c07('0x8f')]){if(_0x58acf9[_0x7c07('0x90')]==_0x7c07('0x8f')){_0x1995d8['queuecallerexitreason']=_0x7c07('0x91');logger[_0x7c07('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1995d8['queue'],_0x1995d8[_0x7c07('0x68')]);}else{if(_[_0x7c07('0x92')](_0x58acf9[_0x7c07('0x3d')][_0x7c07('0x93')](),'local/')){if(this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x94')]]){var _0x8722ff=_[_0x7c07('0x7d')](this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x94')]]);_0x8722ff[_0x7c07('0x7e')]=![];_0x8722ff[_0x7c07('0x8d')]=!![];_0x8722ff[_0x7c07('0x8e')]=moment(_0x1995d8[_0x7c07('0x95')])['add'](_0x58acf9[_0x7c07('0x80')],_0x7c07('0x96'))[_0x7c07('0x4c')](_0x7c07('0x72'));_0x8722ff[_0x7c07('0x53')]=_0x7c07('0x97');_0x8722ff[_0x7c07('0x8f')]=!![];_0x8722ff[_0x7c07('0x98')]=_0x7c07('0x99');_0x8722ff[_0x7c07('0x9a')]=_0x58acf9[_0x7c07('0x9b')];_0x8722ff[_0x7c07('0x9c')]=_0x58acf9['uniqueid'];logger[_0x7c07('0x6d')](_0x7c07('0x9d'),_0x8722ff['queue'],_0x8722ff[_0x7c07('0x68')]);var _0x21e0ae=this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x94')]];this['queueReports'][_0x58acf9[_0x7c07('0x94')]]=this['queueReports'][_0x58acf9[_0x7c07('0x4a')]];this[_0x7c07('0xe')][_0x58acf9[_0x7c07('0x4a')]]=_0x21e0ae;}}else{_0x1995d8['queuecallerexitreason']=_0x7c07('0x9e')+_0x58acf9['reason'][_0x7c07('0x9f')]();logger[_0x7c07('0x6d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x1995d8[_0x7c07('0x4e')],_0x1995d8['type'],_0x1995d8[_0x7c07('0x53')]);}}}this[_0x7c07('0x38')][_0x58acf9[_0x7c07('0x4a')]]=_0x1995d8;this['emitVoiceQueueChannelRemove'](_0x1995d8,'agentcomplete');}}}catch(_0x319883){logger[_0x7c07('0x3f')](_0x7c07('0xa0'),_0x58acf9['uniqueid'],util['inspect'](_0x319883,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')][_0x7c07('0x27')]=function(_0x14dcca){try{if(this[_0x7c07('0x7b')](_0x14dcca)){logger[_0x7c07('0x47')](_0x7c07('0xa1'),_0x14dcca[_0x7c07('0x4a')],util[_0x7c07('0x41')](_0x14dcca,{'showHidden':![],'depth':null}));this['addVariable'](_0x14dcca[_0x7c07('0x4a')],_[_0x7c07('0x78')](_0x14dcca[_0x7c07('0xa2')])[0x0],_0x14dcca[_0x7c07('0xa3')]);if(this['queueReports'][_0x14dcca[_0x7c07('0x4a')]]){var _0x3002a2=_[_0x7c07('0x7d')](this['queueReports'][_0x14dcca['uniqueid']]);if(_0x3002a2){if(this[_0x7c07('0x7b')](_0x14dcca[_0x7c07('0xa2')])&&this[_0x7c07('0x7b')](_0x14dcca[_0x7c07('0xa2')][_0x7c07('0x5d')])){switch(_0x14dcca[_0x7c07('0xa3')]){case _0x7c07('0xa4'):_0x3002a2[_0x7c07('0x8d')]=![];_0x3002a2[_0x7c07('0x8e')]=null;break;case _0x7c07('0xa5'):_0x3002a2[_0x7c07('0xa6')]=_0x7c07('0xa7');_0x3002a2[_0x7c07('0x8d')]=!![];_0x3002a2['queuecallerexitAt']=moment()[_0x7c07('0x4c')](_0x7c07('0x72'));_0x3002a2[_0x7c07('0x87')]=moment()['format'](_0x7c07('0x72'));logger[_0x7c07('0x47')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x14dcca['uniqueid'],util['inspect'](_0x3002a2,{'showHidden':![],'depth':null}));ami[_0x7c07('0x4b')](_0x7c07('0xa8'),_0x3002a2);break;default:_0x3002a2[_0x7c07('0x8d')]=!![];_0x3002a2[_0x7c07('0x8e')]=moment()[_0x7c07('0x4c')](_0x7c07('0x72'));_0x3002a2['queuecallerleaveAt']=moment()[_0x7c07('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3002a2[_0x7c07('0x82')]=![];_0x3002a2[_0x7c07('0x83')]=null;_0x3002a2[_0x7c07('0x53')]=_0x14dcca[_0x7c07('0xa3')];this['channels'][_0x14dcca[_0x7c07('0x4a')]]=_0x3002a2;this['emitVoiceQueueChannelRemove'](_0x3002a2,'varset');}else if(this[_0x7c07('0x7b')](_0x14dcca[_0x7c07('0xa2')])&&this[_0x7c07('0x7b')](_0x14dcca[_0x7c07('0xa2')][_0x7c07('0xa9')])){if(!_0x3002a2[_0x7c07('0x82')]){_0x3002a2[_0x7c07('0x8d')]=!![];_0x3002a2[_0x7c07('0x8e')]=moment()['format'](_0x7c07('0x72'));_0x3002a2[_0x7c07('0x53')]=_0x7c07('0xaa');_0x3002a2[_0x7c07('0x87')]=moment()[_0x7c07('0x4c')](_0x7c07('0x72'));this['channels'][_0x14dcca[_0x7c07('0x4a')]]=_0x3002a2;}}logger['info'](_0x7c07('0xab'),_0x14dcca[_0x7c07('0x4a')],_0x3002a2[_0x7c07('0x4e')],_0x3002a2[_0x7c07('0x68')],_['keys'](_0x14dcca[_0x7c07('0xa2')])[0x0],_0x14dcca['value']);_0x3002a2[_0x7c07('0x15')]=this[_0x7c07('0x15')][_0x14dcca[_0x7c07('0x4a')]];}}}}catch(_0x5edd47){logger[_0x7c07('0x3f')](_0x7c07('0xa1'),_0x14dcca[_0x7c07('0x4a')],util['inspect'](_0x5edd47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7c07('0xb')]['addVariable']=function(_0x5a6aa1,_0x52c980,_0x242721){var _0x5f3358=[_0x7c07('0xac'),_0x7c07('0xad'),_0x7c07('0xae'),_0x7c07('0xaf'),'rtpaudioqosloss',_0x7c07('0xb0'),_0x7c07('0xb1'),_0x7c07('0xb2'),'sipcallid',_0x7c07('0xb3'),'bridgepeer',_0x7c07('0xb4'),_0x7c07('0xb5'),_0x7c07('0xb6'),_0x7c07('0xb7'),_0x7c07('0xb8'),_0x7c07('0x8c'),'memberpenalty',_0x7c07('0xb9')];if(!_[_0x7c07('0xba')](_0x52c980)&&!_[_0x7c07('0xbb')](_0x5f3358,_0x52c980)){if(_[_0x7c07('0x71')](this[_0x7c07('0x15')][_0x5a6aa1])){this['variables'][_0x5a6aa1]={};}this[_0x7c07('0x15')][_0x5a6aa1][_0x52c980]=_0x242721;}};VoiceQueueReport[_0x7c07('0xb')][_0x7c07('0xbc')]=function(_0x1fa0cc,_0x42631c,_0x249814){var _0x563f3f={};for(var _0x16ae38=0x0;_0x16ae38=0x0?moment(_0x43971c[_0xc3d8('0x17')])[_0xc3d8('0xb')](_0x43971c[_0xc3d8('0x16')],'seconds'):null,'data1':_0xc3d8('0x19'),'data2':_0x43971c['accountcode'],'data3':_0x43971c['exten'],'data4':_0x43971c['dialstring']||null,'role':_0xc3d8('0xf'),'internal':_0x43971c['accountcode']?_[_0xc3d8('0x11')](_0x43971c['accountcode']):undefined,'uniqueid':_0x43971c[_0xc3d8('0x12')]},'log':_0xc3d8('0x6')});}; \ No newline at end of file +var _0x1d96=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','seconds','outbound','lodash','util','../client','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x30d496,_0x17cefc){var _0xf751f9=function(_0x4b77f7){while(--_0x4b77f7){_0x30d496['push'](_0x30d496['shift']());}};_0xf751f9(++_0x17cefc);}(_0x1d96,0xd1));var _0x61d9=function(_0x1b388d,_0x159c83){_0x1b388d=_0x1b388d-0x0;var _0xf31097=_0x1d96[_0x1b388d];return _0xf31097;};'use strict';var moment=require('moment');var _=require(_0x61d9('0x0'));var util=require(_0x61d9('0x1'));var client=require(_0x61d9('0x2'));exports['voiceQueueReport']=function(_0x42c448){var _0x25f8b2=_0x42c448['queuecallercompleteAt']||_0x42c448[_0x61d9('0x3')];return client[_0x61d9('0x4')](_0x61d9('0x5'),{'body':{'channel':_0x61d9('0x6'),'membername':_0x42c448[_0x61d9('0x7')],'interface':_[_0x61d9('0x8')](_0x42c448[_0x61d9('0x9')])?util[_0x61d9('0xa')](_0x61d9('0xb'),_0x42c448[_0x61d9('0x7')]):_0x42c448['interface'],'type':_0x61d9('0xc'),'enterAt':_0x42c448[_0x61d9('0xd')],'exitAt':_0x25f8b2,'duration':moment(_0x25f8b2)[_0x61d9('0xe')](_0x42c448[_0x61d9('0xd')],'seconds'),'data1':'inbound','data2':_0x42c448['calleridnum'],'data3':_0x42c448[_0x61d9('0xf')],'data4':null,'data5':_0x42c448[_0x61d9('0x10')],'role':_0x61d9('0x11'),'internal':_0x42c448['accountcode']?_[_0x61d9('0x12')](_0x42c448[_0x61d9('0x13')]):undefined,'uniqueid':_0x42c448[_0x61d9('0x14')]},'log':'CreateMemberReport'});};exports[_0x61d9('0x15')]=function(_0x5a91a0){return client[_0x61d9('0x4')]('CreateMemberReport',{'body':{'channel':_0x61d9('0x6'),'membername':_0x5a91a0[_0x61d9('0x16')],'interface':_0x5a91a0[_0x61d9('0x9')],'type':_0x61d9('0xc'),'enterAt':_0x5a91a0[_0x61d9('0x17')],'exitAt':_0x5a91a0[_0x61d9('0x18')],'duration':moment(_0x5a91a0['endtime'])[_0x61d9('0xe')](_0x5a91a0[_0x61d9('0x17')],'seconds')>=0x0?moment(_0x5a91a0[_0x61d9('0x18')])[_0x61d9('0xe')](_0x5a91a0[_0x61d9('0x17')],_0x61d9('0x19')):null,'data1':_0x61d9('0x1a'),'data2':_0x5a91a0[_0x61d9('0x13')],'data3':_0x5a91a0[_0x61d9('0xf')],'data4':_0x5a91a0['dialstring']||null,'role':_0x61d9('0x11'),'internal':_0x5a91a0[_0x61d9('0x13')]?_[_0x61d9('0x12')](_0x5a91a0[_0x61d9('0x13')]):undefined,'uniqueid':_0x5a91a0[_0x61d9('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 83ff7bc..d1e6b05 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 _0x3940=['GetSettings','../client','getSettings','ShowSetting','previewRecallmeReminderInterval'];(function(_0x42a78a,_0x448e89){var _0x398d4e=function(_0x6138){while(--_0x6138){_0x42a78a['push'](_0x42a78a['shift']());}};_0x398d4e(++_0x448e89);}(_0x3940,0xa6));var _0x0394=function(_0x1a13b8,_0x351661){_0x1a13b8=_0x1a13b8-0x0;var _0x4f8aed=_0x3940[_0x1a13b8];return _0x4f8aed;};'use strict';var client=require(_0x0394('0x0'));exports[_0x0394('0x1')]=function(){return client['Request'](_0x0394('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x0394('0x3')]},'log':_0x0394('0x4')});}; \ No newline at end of file +var _0x75e3=['getSettings','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0xe802e4,_0x9e6543){var _0x2e3a2c=function(_0x3e32ff){while(--_0x3e32ff){_0xe802e4['push'](_0xe802e4['shift']());}};_0x2e3a2c(++_0x9e6543);}(_0x75e3,0x104));var _0x375e=function(_0x29bc1f,_0x22b424){_0x29bc1f=_0x29bc1f-0x0;var _0x2e332c=_0x75e3[_0x29bc1f];return _0x2e332c;};'use strict';var client=require('../client');exports[_0x375e('0x0')]=function(){return client[_0x375e('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x375e('0x2'),_0x375e('0x3')]},'log':_0x375e('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 20be600..9f57522 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 _0xc462=['../client','Request','GetTemplate','name','html'];(function(_0x50d8da,_0xe56e5b){var _0x1b55bb=function(_0x5c15eb){while(--_0x5c15eb){_0x50d8da['push'](_0x50d8da['shift']());}};_0x1b55bb(++_0xe56e5b);}(_0xc462,0x1d6));var _0x2c46=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc462[_0x1969a7];return _0x3d665f;};'use strict';var client=require(_0x2c46('0x0'));exports['getTemplates']=function(_0x216110){return function(_0x4d1f26){return client[_0x2c46('0x1')](_0x2c46('0x2'),{'options':{'raw':!![],'attributes':['id',_0x2c46('0x3'),_0x2c46('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x0444=['name','../client','Request','GetTemplate'];(function(_0x11b1ff,_0x22498b){var _0x1529c9=function(_0x36c610){while(--_0x36c610){_0x11b1ff['push'](_0x11b1ff['shift']());}};_0x1529c9(++_0x22498b);}(_0x0444,0xbd));var _0x4044=function(_0x53c918,_0x4f7a4c){_0x53c918=_0x53c918-0x0;var _0x2466d9=_0x0444[_0x53c918];return _0x2466d9;};'use strict';var client=require(_0x4044('0x0'));exports['getTemplates']=function(_0x4fe379){return function(_0x139226){return client[_0x4044('0x1')](_0x4044('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4044('0x3'),'html']},'log':_0x4044('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index e7f80ed..a92edb5 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 _0xcb9c=['action','data1','data2','data3','data4','data5','data6','../client','Request','GetTrigger','name','status','Condition','field','operator','value','AnyConditions','Action','Actions'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcb9c,0x9f));var _0xccb9=function(_0x430a4b,_0x40e7fe){_0x430a4b=_0x430a4b-0x0;var _0x3f7e9a=_0xcb9c[_0x430a4b];return _0x3f7e9a;};'use strict';var client=require(_0xccb9('0x0'));exports['getTriggers']=function(_0x19a666){return function(_0x126103){return client[_0xccb9('0x1')](_0xccb9('0x2'),{'options':{'raw':![],'attributes':['id',_0xccb9('0x3'),'channel',_0xccb9('0x4')],'include':[{'model':_0xccb9('0x5'),'as':'AllConditions','attributes':['id',_0xccb9('0x6'),_0xccb9('0x7'),_0xccb9('0x8')]},{'model':_0xccb9('0x5'),'as':_0xccb9('0x9'),'attributes':['id','field',_0xccb9('0x7'),'value']},{'model':_0xccb9('0xa'),'as':_0xccb9('0xb'),'attributes':['id',_0xccb9('0xc'),_0xccb9('0xd'),_0xccb9('0xe'),_0xccb9('0xf'),_0xccb9('0x10'),_0xccb9('0x11'),_0xccb9('0x12'),'data7']}]},'log':_0xccb9('0x2')});};}; \ No newline at end of file +var _0x31d7=['data5','GetTrigger','../client','Request','name','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data3','data4'];(function(_0x59b583,_0x354f2a){var _0x15844a=function(_0x5a4d2e){while(--_0x5a4d2e){_0x59b583['push'](_0x59b583['shift']());}};_0x15844a(++_0x354f2a);}(_0x31d7,0xb6));var _0x731d=function(_0x561da1,_0x1cb5d7){_0x561da1=_0x561da1-0x0;var _0x550bb3=_0x31d7[_0x561da1];return _0x550bb3;};'use strict';var client=require(_0x731d('0x0'));exports['getTriggers']=function(_0x526c97){return function(_0x1138e6){return client[_0x731d('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x731d('0x2'),'channel',_0x731d('0x3')],'include':[{'model':_0x731d('0x4'),'as':_0x731d('0x5'),'attributes':['id',_0x731d('0x6'),_0x731d('0x7'),_0x731d('0x8')]},{'model':'Condition','as':_0x731d('0x9'),'attributes':['id',_0x731d('0x6'),_0x731d('0x7'),_0x731d('0x8')]},{'model':_0x731d('0xa'),'as':_0x731d('0xb'),'attributes':['id',_0x731d('0xc'),_0x731d('0xd'),'data2',_0x731d('0xe'),_0x731d('0xf'),_0x731d('0x10'),'data6','data7']}]},'log':_0x731d('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index c39e0ac..b45fb99 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 _0xdcdc=['../client','getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x41ce19,_0x3f26d2){var _0x1a6eeb=function(_0x283d74){while(--_0x283d74){_0x41ce19['push'](_0x41ce19['shift']());}};_0x1a6eeb(++_0x3f26d2);}(_0xdcdc,0x8c));var _0xcdcd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcdc[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xcdcd('0x0'));exports[_0xcdcd('0x1')]=function(_0x33f233){return function(_0x2a3eef){return client[_0xcdcd('0x2')](_0xcdcd('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcdcd('0x4'),_0xcdcd('0x5'),_0xcdcd('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xea03=['GetTrunk','name','../client','Request'];(function(_0x122938,_0x1223d0){var _0x1363cc=function(_0x683697){while(--_0x683697){_0x122938['push'](_0x122938['shift']());}};_0x1363cc(++_0x1223d0);}(_0xea03,0x1ba));var _0x3ea0=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xea03[_0xdaab62];return _0x13d767;};'use strict';var client=require(_0x3ea0('0x0'));exports['getTrunks']=function(_0x19d13f){return function(_0x1e8b44){return client[_0x3ea0('0x1')](_0x3ea0('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3ea0('0x3'),'registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 6537760..95edbbe 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x342d00,_0x458344){var _0xc4bd64=function(_0x5ee7bf){while(--_0x5ee7bf){_0x342d00['push'](_0x342d00['shift']());}};_0xc4bd64(++_0x458344);}(_0xedd9,0xfc));var _0x9edd=function(_0x3f5f4f,_0x550228){_0x3f5f4f=_0x3f5f4f-0x0;var _0x4690ba=_0xedd9[_0x3f5f4f];return _0x4690ba;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0xca8ee6,_0x500814){var _0x338251=function(_0x5ef912){while(--_0x5ef912){_0xca8ee6['push'](_0xca8ee6['shift']());}};_0x338251(++_0x500814);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xcb91[_0x1911ed];return _0x11edaa;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 4533fe1..63fe123 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 _0xea70=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','create'];(function(_0x2d3149,_0x417841){var _0x108b8b=function(_0x14c1a8){while(--_0x14c1a8){_0x2d3149['push'](_0x2d3149['shift']());}};_0x108b8b(++_0x417841);}(_0xea70,0x117));var _0x0ea7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xea70[_0x4565bf];return _0x5610ba;};'use strict';var client=require('../client');exports[_0x0ea7('0x0')]=function(_0x3066f8){return client[_0x0ea7('0x1')]('CreateVoiceAgentReport',{'body':_0x3066f8,'log':_0x0ea7('0x2')});};exports[_0x0ea7('0x3')]=function(_0x5a420e,_0x5de33d,_0x3fd8c9){return client['Request']('UpdateVoiceAgentReport',{'body':_0x5a420e,'options':{'where':{'uniqueid':_0x5de33d,'interface':_0x3fd8c9,'agentcomplete':!![]}},'log':_0x0ea7('0x4')});}; \ No newline at end of file +var _0xb915=['../client','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0xb915,0x145));var _0x5b91=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb915[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x5b91('0x0'));exports['create']=function(_0x35815d){return client['Request'](_0x5b91('0x1'),{'body':_0x35815d,'log':_0x5b91('0x1')});};exports[_0x5b91('0x2')]=function(_0x4eedd4,_0x599ff5,_0x4d77ec){return client[_0x5b91('0x3')](_0x5b91('0x4'),{'body':_0x4eedd4,'options':{'where':{'uniqueid':_0x599ff5,'interface':_0x4d77ec,'agentcomplete':!![]}},'log':_0x5b91('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2137f03..7e9ba8d 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 _0x2af5=['calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x1693f4,_0x1d20d8){var _0x147e20=function(_0x24ff2e){while(--_0x24ff2e){_0x1693f4['push'](_0x1693f4['shift']());}};_0x147e20(++_0x1d20d8);}(_0x2af5,0x7d));var _0x52af=function(_0x412b6e,_0x4245c8){_0x412b6e=_0x412b6e-0x0;var _0xd9b9d5=_0x2af5[_0x412b6e];return _0xd9b9d5;};'use strict';var moment=require(_0x52af('0x0'));var util=require('util');var _=require(_0x52af('0x1'));var client=require(_0x52af('0x2'));exports[_0x52af('0x3')]=function(_0x544cfc){return client[_0x52af('0x4')](_0x52af('0x5'),{'body':_[_0x52af('0x6')](_0x544cfc,{'source':_0x544cfc[_0x52af('0x7')],'destinationcontext':_0x544cfc[_0x52af('0x8')],'callerid':_0x544cfc[_0x52af('0x9')],'amaflags':_0x52af('0xa')}),'log':_0x52af('0x5')});};exports[_0x52af('0xb')]=function(){return function(){return client[_0x52af('0x4')](_0x52af('0xc'),{'options':{'where':{'type':[_0x52af('0xd')],'createdAt':{'$between':[moment()[_0x52af('0xe')](_0x52af('0xf'))[_0x52af('0x10')](_0x52af('0x11')),moment()['endOf'](_0x52af('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x52af('0x12'),_0x52af('0x13'),_0x52af('0x14'),_0x52af('0x15')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x72e5=['GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x72e5,0x137));var _0x572e=function(_0x26d5ec,_0x30160b){_0x26d5ec=_0x26d5ec-0x0;var _0xce9696=_0x72e5[_0x26d5ec];return _0xce9696;};'use strict';var moment=require(_0x572e('0x0'));var util=require(_0x572e('0x1'));var _=require('lodash');var client=require(_0x572e('0x2'));exports[_0x572e('0x3')]=function(_0x30b2b2){return client[_0x572e('0x4')](_0x572e('0x5'),{'body':_[_0x572e('0x6')](_0x30b2b2,{'source':_0x30b2b2['calleridnum'],'destinationcontext':_0x30b2b2[_0x572e('0x7')],'callerid':_0x30b2b2[_0x572e('0x8')],'amaflags':_0x572e('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x572e('0xa')]=function(){return function(){return client[_0x572e('0x4')](_0x572e('0xb'),{'options':{'where':{'type':[_0x572e('0xc')],'createdAt':{'$between':[moment()[_0x572e('0xd')](_0x572e('0xe'))[_0x572e('0xf')](_0x572e('0x10')),moment()[_0x572e('0x11')](_0x572e('0xe'))[_0x572e('0xf')](_0x572e('0x10'))]}},'attributes':[_0x572e('0x12'),_0x572e('0x13'),_0x572e('0x14'),_0x572e('0x15')]},'log':_0x572e('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index b97f3c3..6b487bf 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 _0x4c3e=['../client','create','Request','CreateVoiceDialReport'];(function(_0xb46fb6,_0x33dfb5){var _0x1fc563=function(_0x4d2d92){while(--_0x4d2d92){_0xb46fb6['push'](_0xb46fb6['shift']());}};_0x1fc563(++_0x33dfb5);}(_0x4c3e,0xd8));var _0xe4c3=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x4c3e[_0x29b609];return _0x54c952;};'use strict';var client=require(_0xe4c3('0x0'));exports[_0xe4c3('0x1')]=function(_0x2a7f6a){return client[_0xe4c3('0x2')](_0xe4c3('0x3'),{'body':_0x2a7f6a,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x4662=['Request','create'];(function(_0x11cd17,_0x489e02){var _0x3343ad=function(_0xfb1588){while(--_0xfb1588){_0x11cd17['push'](_0x11cd17['shift']());}};_0x3343ad(++_0x489e02);}(_0x4662,0x103));var _0x2466=function(_0x241894,_0x14c936){_0x241894=_0x241894-0x0;var _0x17ff86=_0x4662[_0x241894];return _0x17ff86;};'use strict';var client=require('../client');exports[_0x2466('0x0')]=function(_0x493c73){return client[_0x2466('0x1')]('CreateVoiceDialReport',{'body':_0x493c73,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f3aac8a..b3b5787 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 _0x9c44=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x27092f,_0x90f7d9){var _0x47b478=function(_0x2184d8){while(--_0x2184d8){_0x27092f['push'](_0x27092f['shift']());}};_0x47b478(++_0x90f7d9);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x49c4('0x4')});};}; \ No newline at end of file +var _0xe130=['../client','getVoiceExtensions','GetVoiceExtension','exten','recordingFormat'];(function(_0x4a3e5d,_0x256331){var _0xf3ae2f=function(_0x4b6778){while(--_0x4b6778){_0x4a3e5d['push'](_0x4a3e5d['shift']());}};_0xf3ae2f(++_0x256331);}(_0xe130,0x127));var _0x0e13=function(_0x19b09b,_0x517eca){_0x19b09b=_0x19b09b-0x0;var _0x37a0f8=_0xe130[_0x19b09b];return _0x37a0f8;};'use strict';var client=require(_0x0e13('0x0'));exports[_0x0e13('0x1')]=function(){return function(){return client['Request'](_0x0e13('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0e13('0x3'),_0x0e13('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x0e13('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e65b26d..2bd599a 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 _0x5d0b=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialPrefix','dialAMDActive','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName'];(function(_0xd69266,_0x219cab){var _0x28bc95=function(_0x5f5959){while(--_0x5f5959){_0xd69266['push'](_0xd69266['shift']());}};_0x28bc95(++_0x219cab);}(_0x5d0b,0x16b));var _0xb5d0=function(_0xe34ce5,_0x1a08c7){_0xe34ce5=_0xe34ce5-0x0;var _0x3067ec=_0x5d0b[_0xe34ce5];return _0x3067ec;};'use strict';var client=require(_0xb5d0('0x0'));exports[_0xb5d0('0x1')]=function(){return function(){return client[_0xb5d0('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb5d0('0x3'),'acw',_0xb5d0('0x4'),_0xb5d0('0x5'),_0xb5d0('0x6'),_0xb5d0('0x7'),_0xb5d0('0x8'),_0xb5d0('0x9'),_0xb5d0('0xa'),'dialLimitQueue','dialPowerLevel',_0xb5d0('0xb'),_0xb5d0('0xc'),_0xb5d0('0xd'),_0xb5d0('0xe'),_0xb5d0('0xf'),_0xb5d0('0x10'),_0xb5d0('0x11'),_0xb5d0('0x12'),_0xb5d0('0x13'),_0xb5d0('0x14'),_0xb5d0('0x15'),'dialBusyMaxRetry',_0xb5d0('0x16'),'dialNoAnswerMaxRetry',_0xb5d0('0x17'),_0xb5d0('0x18'),'dialTimezone','dialGlobalInterval',_0xb5d0('0x19'),'dialCheckDuplicateType',_0xb5d0('0x1a'),'dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence',_0xb5d0('0x1b'),_0xb5d0('0x1c'),_0xb5d0('0x1d'),_0xb5d0('0x1e'),_0xb5d0('0x1f'),_0xb5d0('0x20'),'timeout',_0xb5d0('0x21'),'dialRecallInQueue',_0xb5d0('0x22'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xb5d0('0x23'),_0xb5d0('0x6'),_0xb5d0('0x24'),'dialRandomLastDigitCallerIdNumber',_0xb5d0('0x25'),_0xb5d0('0x26'),'dialNoSuchNumberRetryFrequency',_0xb5d0('0x27'),_0xb5d0('0x28'),_0xb5d0('0x29'),'dialAbandonedRetryFrequency',_0xb5d0('0x2a'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0xb5d0('0x2b'),_0xb5d0('0x2c'),_0xb5d0('0x2d'),_0xb5d0('0x2e'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':_0xb5d0('0x2f'),'as':'Trunk','attributes':['id',_0xb5d0('0x3'),'callerid',_0xb5d0('0x30')]},{'model':_0xb5d0('0x31'),'as':'mandatoryDispositionPause','attributes':['id',_0xb5d0('0x3')]},{'model':_0xb5d0('0x2f'),'as':_0xb5d0('0x32'),'attributes':['id','name',_0xb5d0('0x33'),_0xb5d0('0x30')]},{'model':_0xb5d0('0x34'),'as':_0xb5d0('0x34'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xb5d0('0x35'),'attributes':['id',_0xb5d0('0x3'),'interval']}]}]},'log':_0xb5d0('0x1')});};}; \ No newline at end of file +var _0xa175=['dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x5b7f48,_0x4d8a1d){var _0x2424b0=function(_0x21b28b){while(--_0x21b28b){_0x5b7f48['push'](_0x5b7f48['shift']());}};_0x2424b0(++_0x4d8a1d);}(_0xa175,0x15d));var _0x5a17=function(_0x3d4ce3,_0x5c584f){_0x3d4ce3=_0x3d4ce3-0x0;var _0x140c76=_0xa175[_0x3d4ce3];return _0x140c76;};'use strict';var client=require('../client');exports[_0x5a17('0x0')]=function(){return function(){return client[_0x5a17('0x1')](_0x5a17('0x2'),{'options':{'raw':![],'attributes':['id',_0x5a17('0x3'),_0x5a17('0x4'),'acwTimeout',_0x5a17('0x5'),'monitor_format',_0x5a17('0x6'),_0x5a17('0x7'),_0x5a17('0x8'),_0x5a17('0x9'),_0x5a17('0xa'),_0x5a17('0xb'),'dialPredictiveOptimization',_0x5a17('0xc'),_0x5a17('0xd'),_0x5a17('0xe'),'dialOriginateCallerIdNumber',_0x5a17('0xf'),_0x5a17('0x10'),'dialQueueTimeout',_0x5a17('0x11'),_0x5a17('0x12'),_0x5a17('0x13'),_0x5a17('0x14'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x5a17('0x15'),_0x5a17('0x16'),_0x5a17('0x17'),_0x5a17('0x18'),_0x5a17('0x19'),_0x5a17('0x1a'),_0x5a17('0x1b'),_0x5a17('0x1c'),_0x5a17('0x1d'),_0x5a17('0x1e'),'dialAMDTotalAnalysisTime',_0x5a17('0x1f'),_0x5a17('0x20'),_0x5a17('0x21'),_0x5a17('0x22'),_0x5a17('0x23'),_0x5a17('0x24'),_0x5a17('0x25'),_0x5a17('0x26'),'dialOrderByScheduledAt',_0x5a17('0x27'),'dialAgiAfterHangupClient',_0x5a17('0x28'),_0x5a17('0x29'),'strategy',_0x5a17('0x2a'),_0x5a17('0x2b'),'dialNoSuchNumberMaxRetry',_0x5a17('0x2c'),_0x5a17('0x2d'),'dialDropRetryFrequency',_0x5a17('0x2e'),_0x5a17('0x2f'),'dialMachineMaxRetry',_0x5a17('0x30'),'dialAgentRejectMaxRetry',_0x5a17('0x31'),_0x5a17('0x32'),_0x5a17('0x33'),_0x5a17('0x34'),_0x5a17('0x35'),_0x5a17('0x36')],'include':[{'model':_0x5a17('0x37'),'as':'Trunk','attributes':['id','name','callerid',_0x5a17('0x38')]},{'model':_0x5a17('0x39'),'as':_0x5a17('0x3a'),'attributes':['id',_0x5a17('0x3')]},{'model':_0x5a17('0x37'),'as':_0x5a17('0x3b'),'attributes':['id',_0x5a17('0x3'),'callerid',_0x5a17('0x38')]},{'model':'Interval','as':_0x5a17('0x3c'),'attributes':['id',_0x5a17('0x3')],'include':[{'model':_0x5a17('0x3c'),'as':'Intervals','attributes':['id',_0x5a17('0x3'),_0x5a17('0x3d')]}]}]},'log':_0x5a17('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d8293e2..7598532 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(_0x166bde,_0x1a36e8){var _0x1b0334=function(_0x31762c){while(--_0x31762c){_0x166bde['push'](_0x166bde['shift']());}};_0x1b0334(++_0x1a36e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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(_0x1278f9,_0x14c7ab){var _0x1efcc3=function(_0x1be486){while(--_0x1be486){_0x1278f9['push'](_0x1278f9['shift']());}};_0x1efcc3(++_0x14c7ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 5488b84..85923e9 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 _0x63bc=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0xab632,_0x100609){var _0x45aa86=function(_0x50d358){while(--_0x50d358){_0xab632['push'](_0xab632['shift']());}};_0x45aa86(++_0x100609);}(_0x63bc,0x10f));var _0xc63b=function(_0x2d07b6,_0xfcc3c0){_0x2d07b6=_0x2d07b6-0x0;var _0x453af2=_0x63bc[_0x2d07b6];return _0x453af2;};'use strict';var client=require('../client');exports[_0xc63b('0x0')]=function(_0x5f247d){return function(){return client[_0xc63b('0x1')](_0xc63b('0x2'),{'options':{'where':{'VoiceQueueId':_0x5f247d,'paused':!![]},'raw':!![]},'log':_0xc63b('0x0')});};}; \ No newline at end of file +var _0x33ee=['getVoiceQueueRtPauses','Request'];(function(_0x36e3ba,_0x1912e8){var _0x7972c7=function(_0x52e712){while(--_0x52e712){_0x36e3ba['push'](_0x36e3ba['shift']());}};_0x7972c7(++_0x1912e8);}(_0x33ee,0x151));var _0xe33e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x33ee[_0x4fbfd9];return _0x31dc94;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x72b1bb){return function(){return client[_0xe33e('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x72b1bb,'paused':!![]},'raw':!![]},'log':_0xe33e('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ca8d00b..6222528 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x199206,_0xa788bd){var _0x2c868a=function(_0x2266e6){while(--_0x2266e6){_0x199206['push'](_0x199206['shift']());}};_0x2c868a(++_0xa788bd);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x339b2d,_0x159f80){var _0x1cbbbc=function(_0x3c206a){while(--_0x3c206a){_0x339b2d['push'](_0x339b2d['shift']());}};_0x1cbbbc(++_0x159f80);}(_0x7a54,0x106));var _0x47a5=function(_0xad7fa8,_0x4eb4b1){_0xad7fa8=_0xad7fa8-0x0;var _0x186c4c=_0x7a54[_0xad7fa8];return _0x186c4c;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2589598..4f34ed1 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 _0x4647=['result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport'];(function(_0x2b3a97,_0x31164d){var _0xbdd2c5=function(_0x487dec){while(--_0x487dec){_0x2b3a97['push'](_0x2b3a97['shift']());}};_0xbdd2c5(++_0x31164d);}(_0x4647,0x149));var _0x7464=function(_0x3eff16,_0x260fd5){_0x3eff16=_0x3eff16-0x0;var _0x1bed6f=_0x4647[_0x3eff16];return _0x1bed6f;};'use strict';var client=require(_0x7464('0x0'));exports[_0x7464('0x1')]={};exports[_0x7464('0x2')]=function(_0x4d67db){return client['Request'](_0x7464('0x3'),{'body':{'result':_0x4d67db[_0x7464('0x4')],'transfererchannel':_0x4d67db[_0x7464('0x5')],'transferercalleridnum':_0x4d67db['transferercalleridnum'],'transferercalleridname':_0x4d67db[_0x7464('0x6')],'transfererconnectedlinenum':_0x4d67db[_0x7464('0x7')],'transfererconnectedlinename':_0x4d67db[_0x7464('0x8')],'transfereraccountcode':_0x4d67db[_0x7464('0x9')],'transferercontext':_0x4d67db[_0x7464('0xa')],'transfererexten':_0x4d67db['transfererexten'],'transfererlinkedid':_0x4d67db[_0x7464('0xb')],'transfereechannel':_0x4d67db[_0x7464('0xc')],'transfereecalleridnum':_0x4d67db[_0x7464('0xd')],'transfereecalleridname':_0x4d67db[_0x7464('0xe')],'transfereeconnectedlinenum':_0x4d67db[_0x7464('0xf')],'transfereeconnectedlinename':_0x4d67db[_0x7464('0x10')],'transfereeaccountcode':_0x4d67db[_0x7464('0x11')],'transfereecontext':_0x4d67db[_0x7464('0x12')],'transfereeexten':_0x4d67db['transfereeexten'],'transfereelinkedid':_0x4d67db[_0x7464('0x13')],'isexternal':_0x4d67db[_0x7464('0x14')],'context':_0x4d67db[_0x7464('0x15')],'extension':_0x4d67db[_0x7464('0x16')],'type':_0x7464('0x17')},'log':_0x7464('0x3')});};exports[_0x7464('0x18')]=function(_0x433169){return client[_0x7464('0x19')](_0x7464('0x3'),{'body':{'result':_0x433169[_0x7464('0x4')],'transfererchannel':_0x433169['origtransfererchannel'],'transferercalleridnum':_0x433169[_0x7464('0x1a')],'transferercalleridname':_0x433169['origtransferercalleridname'],'transfererconnectedlinenum':_0x433169[_0x7464('0x1b')],'transfererconnectedlinename':_0x433169['secondtransfererconnectedlinename'],'transfereraccountcode':_0x433169['origtransfereraccountcode'],'transferercontext':_0x433169[_0x7464('0x1c')],'transfererexten':_0x433169['secondtransfererexten'],'transfererlinkedid':_0x433169[_0x7464('0x1d')],'transfereechannel':_0x433169[_0x7464('0x1e')],'transfereecalleridnum':_0x433169[_0x7464('0x1f')],'transfereecalleridname':_0x433169['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x433169[_0x7464('0x20')],'transfereeconnectedlinename':_0x433169['transfertargetconnectedlinename'],'transfereeaccountcode':_0x433169['transfertargetaccountcode'],'transfereecontext':_0x433169['transfertargetcontext'],'transfereeexten':_0x433169['transfertargetexten'],'transfereelinkedid':_0x433169[_0x7464('0x21')],'isexternal':_0x433169['isexternal'],'context':_0x433169[_0x7464('0x22')],'extension':_0x433169[_0x7464('0x23')],'type':_0x7464('0x24')},'log':_0x7464('0x3')});}; \ No newline at end of file +var _0x74f8=['transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereelinkedid','isexternal','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel'];(function(_0x388550,_0x3fd74b){var _0x735860=function(_0x50783c){while(--_0x50783c){_0x388550['push'](_0x388550['shift']());}};_0x735860(++_0x3fd74b);}(_0x74f8,0x68));var _0x874f=function(_0x4daed5,_0x59660c){_0x4daed5=_0x4daed5-0x0;var _0xd2eec1=_0x74f8[_0x4daed5];return _0xd2eec1;};'use strict';var client=require(_0x874f('0x0'));exports[_0x874f('0x1')]={};exports[_0x874f('0x2')]=function(_0x280968){return client[_0x874f('0x3')](_0x874f('0x4'),{'body':{'result':_0x280968[_0x874f('0x5')],'transfererchannel':_0x280968[_0x874f('0x6')],'transferercalleridnum':_0x280968[_0x874f('0x7')],'transferercalleridname':_0x280968[_0x874f('0x8')],'transfererconnectedlinenum':_0x280968[_0x874f('0x9')],'transfererconnectedlinename':_0x280968[_0x874f('0xa')],'transfereraccountcode':_0x280968[_0x874f('0xb')],'transferercontext':_0x280968[_0x874f('0xc')],'transfererexten':_0x280968[_0x874f('0xd')],'transfererlinkedid':_0x280968[_0x874f('0xe')],'transfereechannel':_0x280968[_0x874f('0xf')],'transfereecalleridnum':_0x280968[_0x874f('0x10')],'transfereecalleridname':_0x280968[_0x874f('0x11')],'transfereeconnectedlinenum':_0x280968[_0x874f('0x12')],'transfereeconnectedlinename':_0x280968[_0x874f('0x13')],'transfereeaccountcode':_0x280968[_0x874f('0x14')],'transfereecontext':_0x280968['transfereecontext'],'transfereeexten':_0x280968['transfereeexten'],'transfereelinkedid':_0x280968[_0x874f('0x15')],'isexternal':_0x280968[_0x874f('0x16')],'context':_0x280968['context'],'extension':_0x280968['extension'],'type':'blind'},'log':_0x874f('0x4')});};exports[_0x874f('0x17')]=function(_0x237d6f){return client[_0x874f('0x3')](_0x874f('0x4'),{'body':{'result':_0x237d6f[_0x874f('0x5')],'transfererchannel':_0x237d6f['origtransfererchannel'],'transferercalleridnum':_0x237d6f[_0x874f('0x18')],'transferercalleridname':_0x237d6f['origtransferercalleridname'],'transfererconnectedlinenum':_0x237d6f[_0x874f('0x19')],'transfererconnectedlinename':_0x237d6f[_0x874f('0x1a')],'transfereraccountcode':_0x237d6f[_0x874f('0x1b')],'transferercontext':_0x237d6f[_0x874f('0x1c')],'transfererexten':_0x237d6f[_0x874f('0x1d')],'transfererlinkedid':_0x237d6f[_0x874f('0x1e')],'transfereechannel':_0x237d6f['transfertargetchannel'],'transfereecalleridnum':_0x237d6f[_0x874f('0x1f')],'transfereecalleridname':_0x237d6f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x237d6f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x237d6f[_0x874f('0x20')],'transfereeaccountcode':_0x237d6f['transfertargetaccountcode'],'transfereecontext':_0x237d6f['transfertargetcontext'],'transfereeexten':_0x237d6f[_0x874f('0x21')],'transfereelinkedid':_0x237d6f[_0x874f('0x22')],'isexternal':_0x237d6f['isexternal'],'context':_0x237d6f['origtransferercontext'],'extension':_0x237d6f[_0x874f('0x23')],'type':_0x874f('0x24')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 291f761..014f4a8 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 _0xca9e=['voicechannel','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','isNil','mixmonitorid','status','rec','MixMonitor\x20Success','toLowerCase','resolve','StopMixMonitor','destinationchannel','monitors','stop','Channel\x20doesn\x27t\x20exist','type','inbound','includes','filter','rows','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','exten','context','values','telephones','trunks','campaigns','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Action','then','message','command','Command','content','catch','voiceQueues','hasOwnProperty','push','length','find','omit','channels'];(function(_0x57c783,_0x5c39ec){var _0x423b1d=function(_0x5ae549){while(--_0x5ae549){_0x57c783['push'](_0x57c783['shift']());}};_0x423b1d(++_0x5c39ec);}(_0xca9e,0x136));var _0xeca9=function(_0xf44586,_0x4dee16){_0xf44586=_0xf44586-0x0;var _0x5bf2ec=_0xca9e[_0xf44586];return _0x5bf2ec;};'use strict';var _=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var jayson=require(_0xeca9('0x2'));var schema=require(_0xeca9('0x3'));var moment=require(_0xeca9('0x4'));var config=require(_0xeca9('0x5'));var properties=require(_0xeca9('0x6'));var ami=require(_0xeca9('0x7'));var VoiceQueueSummary=require(_0xeca9('0x8'));exports[_0xeca9('0x9')]=function(_0x3aba81,_0x1c4ce6,_0x186a47){return new Promise(function(_0x305dc5,_0x483e41){var _0x369f5e={'QueuePause':function(_0x1774f3){return new Promise(function(_0x4d57ee){var _0x4eaf49=util[_0xeca9('0xa')](_0xeca9('0xb'),_0xeca9('0xc'),_0x1774f3['name']);if(_0x3aba81[_0xeca9('0xd')]&&_0x3aba81[_0xeca9('0xd')][_0x4eaf49]&&_0x3aba81[_0xeca9('0xd')][_0x4eaf49][_0xeca9('0xe')]){_0x3aba81[_0xeca9('0xd')][_0x4eaf49][_0xeca9('0xf')]();}if(_0x3aba81['agents'][_0x4eaf49]){_0x3aba81[_0xeca9('0x10')][_0x4eaf49][_0xeca9('0x11')]({'statePause':_0x1774f3['pause']?!![]:![]});}_0x4d57ee({'code':0xc8,'message':_0xeca9('0x12')});});},'Reload':function(_0x4b2ae1){var _0x3c6cc7=this;return new Promise(function(_0x5e7e73,_0x543958){if(ami[_0xeca9('0x13')]()==![]){return _0x543958(_0x3c6cc7[_0xeca9('0x14')](0x1f4,[config[_0xeca9('0x15')]['ip'],config['asterisk'][_0xeca9('0x16')],_0xeca9('0x17')][_0xeca9('0x18')]('\x20')));}_0x4b2ae1=_[_0xeca9('0x19')](_0x4b2ae1,_['keys'](properties['reload'][_0xeca9('0x1a')]));_0x4b2ae1[_0xeca9('0x1b')]='Reload';return ami[_0xeca9('0x1c')](_0x4b2ae1)[_0xeca9('0x1d')](function(_0x4fbe8a){_0x5e7e73({'code':0xc8,'message':_0x4fbe8a['message']});})['catch'](function(_0x132008){_0x543958(_0x3c6cc7[_0xeca9('0x14')](0x1f5,_0x132008[_0xeca9('0x1e')]));});});},'Command':function(_0x5dde5f){var _0xf1ef9f=this;return new Promise(function(_0x5a5c52,_0x5bbdce){if(ami[_0xeca9('0x13')]()==![]){return _0x5bbdce(_0xf1ef9f['error'](0x1f4,[config[_0xeca9('0x15')]['ip'],config[_0xeca9('0x15')]['username'],_0xeca9('0x17')][_0xeca9('0x18')]('\x20')));}_0x5dde5f=_['pick'](_0x5dde5f,_0xeca9('0x1f'));_0x5dde5f['action']=_0xeca9('0x20');return ami[_0xeca9('0x1c')](_0x5dde5f)[_0xeca9('0x1d')](function(_0x5c3495){_0x5a5c52({'code':0xc8,'message':_0x5c3495[_0xeca9('0x21')]});})[_0xeca9('0x22')](function(_0x515e63){_0x5bbdce(_0xf1ef9f[_0xeca9('0x14')](0x1f5,_0x515e63[_0xeca9('0x1e')]));});});},'VoiceQueues':function(){return new Promise(function(_0x2b2c70){var _0x26bb0c=[];for(var _0x498f4a in _0x3aba81[_0xeca9('0x23')]){if(_0x3aba81['voiceQueues'][_0xeca9('0x24')](_0x498f4a)){var _0x251ce4=_0x3aba81[_0xeca9('0x23')][_0x498f4a];var _0x3e41df=new VoiceQueueSummary(_0x251ce4);_0x26bb0c[_0xeca9('0x25')](_0x3e41df);}}_0x2b2c70({'count':_0x26bb0c[_0xeca9('0x26')],'rows':_0x26bb0c});});},'UpdateVoiceQueue':function(_0x85cbd4){return new Promise(function(_0x7fcf4b,_0x467979){var _0x271720=_[_0xeca9('0x27')](_0x3aba81[_0xeca9('0x23')],{'id':parseInt(_0x85cbd4['id'])});var _0x424f7b=_[_0xeca9('0x28')](_0x85cbd4,['id']);if(_0x271720){for(var _0x8d9a8d in _0x424f7b){if(typeof _0x424f7b[_0x8d9a8d]!=='undefined'&&typeof _0x271720[_0x8d9a8d]!=='undefined'){_0x271720[_0x8d9a8d]=_0x424f7b[_0x8d9a8d];}}_0x7fcf4b(_0x271720);}else{_0x467979();}});},'VoiceChannels':function(){return new Promise(function(_0x4c9b32){var _0x6607bd=_['values'](_0x3aba81[_0xeca9('0x29')]);_0x4c9b32({'count':_0x6607bd[_0xeca9('0x26')],'rows':_0x6607bd});});},'VoiceChannelMixMonitor':function(_0x2898dc){var _0x36e75e=this;return new Promise(function(_0x24e96e,_0x2d263a){if(ami['isConnected']()==![]){return _0x2d263a(_0x36e75e[_0xeca9('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xeca9('0x15')][_0xeca9('0x16')],_0xeca9('0x17')]['join']('\x20')));}var _0x21357d=schema(properties[_0xeca9('0x2a')])[_0xeca9('0x3')](_0x2898dc);if(_0x21357d[_0xeca9('0x26')]>0x0){return _0x2d263a(_0x36e75e['error'](0x1f4,_[_0xeca9('0x2b')](_0x21357d,'message')[_0xeca9('0x18')](',\x20')));}var _0x42983f=_[_0xeca9('0x27')](_0x3aba81[_0xeca9('0x29')],{'uniqueid':_0x2898dc[_0xeca9('0x2c')]});if(_0x42983f&&_0x42983f[_0xeca9('0x2d')]){var _0x565912=util[_0xeca9('0xa')](_0xeca9('0x2e'),_0x2898dc[_0xeca9('0x2f')]||_0x2898dc[_0xeca9('0x2c')],_0x2898dc[_0xeca9('0xa')]||_0xeca9('0x30'));return ami[_0xeca9('0x1c')]({'action':'MixMonitor','channel':_0x42983f[_0xeca9('0x2d')],'file':_0x565912,'options':_0xeca9('0x31')})[_0xeca9('0x1d')](function(_0x178bd4){var _0x3995fd=_[_0xeca9('0x27')](_0x42983f['monitors'],{'filename':_0xeca9('0x32')+_0x565912['toLowerCase']()});if(_[_0xeca9('0x33')](_0x3995fd)){_0x42983f['monitors'][_0xeca9('0x25')]({'filename':_0xeca9('0x32')+_0x565912['toLowerCase'](),'createdAt':moment()[_0xeca9('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x178bd4[_0xeca9('0x34')],'status':'rec'});}else{_0x3995fd[_0xeca9('0x34')]=_0x178bd4['mixmonitorid'];_0x3995fd[_0xeca9('0x35')]=_0xeca9('0x36');}_0x24e96e({'code':0xc8,'message':[_0x2898dc['uniqueid'],_0xeca9('0x37'),_0x178bd4[_0xeca9('0x34')]]['join']('\x20'),'mixmonitorid':_0x178bd4[_0xeca9('0x34')]});})[_0xeca9('0x22')](function(_0x3fd0d2){_0x2d263a(_0x36e75e[_0xeca9('0x14')](0x1f5,[_0x2898dc[_0xeca9('0x2c')],_0x3fd0d2[_0xeca9('0x1e')][_0xeca9('0x38')]()][_0xeca9('0x18')]('\x20')));});}else{return _0x2d263a(_0x36e75e[_0xeca9('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x380aa2){var _0x37197b=this;return new Promise(function(_0x15ef4e,_0x35ac2f){if(ami[_0xeca9('0x13')]()==![]){return _0x35ac2f(_0x37197b[_0xeca9('0x14')](0x1f4,[config[_0xeca9('0x15')]['ip'],config['asterisk'][_0xeca9('0x16')],_0xeca9('0x17')][_0xeca9('0x18')]('\x20')));}var _0x1d40a7=schema(properties[_0xeca9('0x2a')])['validate'](_0x380aa2);if(_0x1d40a7[_0xeca9('0x26')]>0x0){return _0x35ac2f(_0x37197b[_0xeca9('0x14')](0x1f4,_[_0xeca9('0x2b')](_0x1d40a7,_0xeca9('0x1e'))['join'](',\x20')));}var _0x427a5c=_[_0xeca9('0x27')](_0x3aba81['channels'],{'uniqueid':_0x380aa2[_0xeca9('0x2c')]});if(_0x427a5c){return Promise[_0xeca9('0x39')]()[_0xeca9('0x1d')](function(){if(_0x427a5c[_0xeca9('0x2d')]){return ami[_0xeca9('0x1c')]({'action':_0xeca9('0x3a'),'channel':_0x427a5c[_0xeca9('0x2d')],'mixmonitorid':_0x380aa2[_0xeca9('0x34')]})[_0xeca9('0x22')](function(){});}})[_0xeca9('0x1d')](function(){if(_0x427a5c[_0xeca9('0x3b')]){return ami[_0xeca9('0x1c')]({'action':_0xeca9('0x3a'),'channel':_0x427a5c[_0xeca9('0x3b')],'mixmonitorid':_0x380aa2[_0xeca9('0x34')]})['catch'](function(){});}})[_0xeca9('0x1d')](function(){var _0x2467be=_[_0xeca9('0x27')](_0x427a5c[_0xeca9('0x3c')],{'mixmonitorid':_0x380aa2['mixmonitorid']});if(_0x2467be){_0x2467be[_0xeca9('0x35')]=_0xeca9('0x3d');}})['then'](function(){var _0x5e6dc2=util[_0xeca9('0xa')](_0xeca9('0x2e'),_0x380aa2[_0xeca9('0x2f')]||_0x380aa2[_0xeca9('0x2c')],_0x380aa2['format']||_0xeca9('0x30'));var _0xa4faf9=_[_0xeca9('0x27')](_0x427a5c[_0xeca9('0x3c')],{'filename':_0xeca9('0x32')+_0x5e6dc2[_0xeca9('0x38')]()});if(_0xa4faf9){_0xa4faf9[_0xeca9('0x35')]=_0xeca9('0x3d');}})[_0xeca9('0x1d')](function(){_0x15ef4e({'code':0xc8,'message':[_0x380aa2['uniqueid'],'StopMixMonitor\x20Success'][_0xeca9('0x18')]('\x20')});})[_0xeca9('0x22')](function(_0x5c4dcf){_0x35ac2f(_0x37197b[_0xeca9('0x14')](0x1f5,[_0x380aa2[_0xeca9('0x2c')],_0x5c4dcf[_0xeca9('0x1e')][_0xeca9('0x38')]()][_0xeca9('0x18')]('\x20')));});}else{return _0x35ac2f(_0x37197b[_0xeca9('0x14')](0x1f5,_0xeca9('0x3e')));}});},'VoiceQueuesChannels':function(_0x3150b2){var _0x3db16a=this;return new Promise(function(_0x56a212){var _0x5cd84d=_['values'](_0x3aba81['queueChannels']);var _0x3bbb64={'count':_0x5cd84d['length'],'rows':_0x5cd84d};if(_0x3150b2&&_0x3150b2[_0xeca9('0x3f')]){if(![_0xeca9('0x40'),'outbound'][_0xeca9('0x41')](_0x3150b2[_0xeca9('0x3f')])){return _0x483e41(_0x3db16a[_0xeca9('0x14')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x5e4423=_[_0xeca9('0x42')](_0x5cd84d,function(_0xe98d30){return _0xe98d30[_0xeca9('0x3f')]===_0x3150b2[_0xeca9('0x3f')];});_0x3bbb64['count']=_0x5e4423[_0xeca9('0x26')];_0x3bbb64[_0xeca9('0x43')]=_0x5e4423;}_0x56a212(_0x3bbb64);});},'VoiceQueuesChannel':function(_0x746485){var _0x1a046d=this;return new Promise(function(_0xc1ffaf,_0x2ffbb9){var _0x187c92=schema(properties[_0xeca9('0x44')])[_0xeca9('0x3')](_0x746485);if(_0x187c92[_0xeca9('0x26')]>0x0){return _0x2ffbb9(_0x1a046d[_0xeca9('0x14')](0x1f4,_[_0xeca9('0x2b')](_0x187c92,_0xeca9('0x1e'))[_0xeca9('0x18')](',\x20')));}var _0x45bc51=_[_0xeca9('0x27')](_0x3aba81['queueChannels'],{'uniqueid':_0x746485[_0xeca9('0x2c')]});if(_0x45bc51){_0xc1ffaf(_0x45bc51);}else{return _0x2ffbb9(_0x1a046d[_0xeca9('0x14')](0x1f5,_0xeca9('0x3e')));}});},'VoiceQueuesChannelHangup':function(_0x3afc92){var _0x5bece2=this;return new Promise(function(_0x27cd12,_0x3035b2){if(ami['isConnected']()==![]){return _0x3035b2(_0x5bece2[_0xeca9('0x14')](0x1f4,[config[_0xeca9('0x15')]['ip'],config[_0xeca9('0x15')][_0xeca9('0x16')],_0xeca9('0x17')]['join']('\x20')));}var _0x20161f=schema(properties[_0xeca9('0x45')])['validate'](_0x3afc92);if(_0x20161f[_0xeca9('0x26')]>0x0){return _0x3035b2(_0x5bece2[_0xeca9('0x14')](0x1f4,_[_0xeca9('0x2b')](_0x20161f,_0xeca9('0x1e'))[_0xeca9('0x18')](',\x20')));}var _0x3dacc3=_[_0xeca9('0x27')](_0x3aba81[_0xeca9('0x46')],{'uniqueid':_0x3afc92['uniqueid']});if(_0x3dacc3&&_0x3dacc3['channel']){return ami['Action']({'action':_0xeca9('0x47'),'channel':_0x3dacc3[_0xeca9('0x2d')]})[_0xeca9('0x1d')](function(_0x47a454){_0x27cd12({'code':0xc8,'message':[_0x3afc92[_0xeca9('0x2c')],_0x47a454[_0xeca9('0x1e')][_0xeca9('0x38')]()][_0xeca9('0x18')]('\x20')});})[_0xeca9('0x22')](function(_0x23618f){_0x3035b2(_0x5bece2[_0xeca9('0x14')](0x1f5,[_0x3afc92['uniqueid'],_0x23618f['message']['toLowerCase']()][_0xeca9('0x18')]('\x20')));});}else{return _0x3035b2(_0x5bece2[_0xeca9('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x13efa9){var _0x5c5438=this;return new Promise(function(_0x33760f,_0x28bbf7){if(ami[_0xeca9('0x13')]()==![]){return _0x28bbf7(_0x5c5438[_0xeca9('0x14')](0x1f4,[config[_0xeca9('0x15')]['ip'],config['asterisk'][_0xeca9('0x16')],_0xeca9('0x17')][_0xeca9('0x18')]('\x20')));}var _0x1cd614=schema(properties[_0xeca9('0x48')])[_0xeca9('0x3')](_0x13efa9);if(_0x1cd614[_0xeca9('0x26')]>0x0){return _0x28bbf7(_0x5c5438[_0xeca9('0x14')](0x1f4,_['map'](_0x1cd614,_0xeca9('0x1e'))['join'](',\x20')));}var _0x232e34=_[_0xeca9('0x27')](_0x3aba81[_0xeca9('0x46')],{'uniqueid':_0x13efa9[_0xeca9('0x2c')]});if(_0x232e34&&_0x232e34[_0xeca9('0x2d')]){return ami[_0xeca9('0x1c')]({'action':'Redirect','channel':_0x232e34[_0xeca9('0x2d')],'exten':_0x13efa9[_0xeca9('0x49')],'context':_0x13efa9[_0xeca9('0x4a')]||_0x232e34['context'],'priority':0x1})[_0xeca9('0x1d')](function(_0x17bd7e){_0x33760f({'code':0xc8,'message':[_0x13efa9[_0xeca9('0x2c')],_0x17bd7e[_0xeca9('0x1e')][_0xeca9('0x38')]()][_0xeca9('0x18')]('\x20')});})[_0xeca9('0x22')](function(_0xd6bfd3){_0x28bbf7(_0x5c5438['error'](0x1f5,[_0x13efa9[_0xeca9('0x2c')],_0xd6bfd3[_0xeca9('0x1e')][_0xeca9('0x38')]()][_0xeca9('0x18')]('\x20')));});}else{return _0x28bbf7(_0x5c5438[_0xeca9('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x5226dd){return new Promise(function(_0x19a04b){var _0x9f078b=_[_0xeca9('0x4b')](_0x3aba81[_0xeca9('0x10')]);if(_0x5226dd&&_0x5226dd['id']){var _0x5b0b1a=_[_0xeca9('0x27')](_0x9f078b,function(_0x1c7cca){return _0x1c7cca['id']===_0x5226dd['id'];});_0x19a04b(_0x5b0b1a);}else{_0x19a04b({'count':_0x9f078b[_0xeca9('0x26')],'rows':_0x9f078b});}});},'Telephones':function(){return new Promise(function(_0x46c3a3){var _0x5fb274=_[_0xeca9('0x4b')](_0x3aba81[_0xeca9('0x4c')]);_0x46c3a3({'count':_0x5fb274[_0xeca9('0x26')],'rows':_0x5fb274});});},'Trunks':function(){return new Promise(function(_0x448695){var _0x2c8d49=_['values'](_0x3aba81[_0xeca9('0x4d')]);_0x448695({'count':_0x2c8d49[_0xeca9('0x26')],'rows':_0x2c8d49});});},'OutboundChannels':function(){return new Promise(function(_0x9b5506){var _0x4a2f6f=_['values'](_0x3aba81['outboundChannels']);_0x9b5506({'count':_0x4a2f6f[_0xeca9('0x26')],'rows':_0x4a2f6f});});},'Outbound':function(){return new Promise(function(_0x360a9a){_0x360a9a(_0x3aba81['outbound']);});},'Campaigns':function(){return new Promise(function(_0x109f28){var _0x3d85cc=_[_0xeca9('0x4b')](_0x3aba81[_0xeca9('0x4e')]);_0x109f28({'count':_0x3d85cc['length'],'rows':_0x3d85cc});});},'VoiceQueuesPreview':function(_0x17e50d){var _0xfb9250=this;return new Promise(function(_0x48a310,_0x494bfb){_0x1c4ce6['run'](_0x17e50d['id'])[_0xeca9('0x1d')](function(_0x4455d7){_0x48a310({'code':0xc8,'message':_0x4455d7[_0xeca9('0x1e')]});})['catch'](function(_0x46a493){_0x494bfb(_0xfb9250['error'](0x1f4,_0x46a493[_0xeca9('0x1e')]));});});},'EventManager':function(_0xbc11b7){var _0x3bd3d9=this;return new Promise(function(_0x3a2666,_0xab7042){if(!_0xbc11b7['event']){return _0xab7042(_0x3bd3d9[_0xeca9('0x14')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xeca9('0x4f')]('custom:'+_0xbc11b7['event'],_0xbc11b7['message']);_0x3a2666({'code':0xc8,'message':_0xbc11b7});});},'FaxAccounts':function(){return new Promise(function(_0x4ecec4){var _0x4e248b=_[_0xeca9('0x4b')](_0x3aba81[_0xeca9('0x50')]);_0x4ecec4({'count':_0x4e248b[_0xeca9('0x26')],'rows':_0x4e248b});});},'SendFax':function(_0x30e115){var _0x31de1f=this;return new Promise(function(_0x3efee3,_0x5aac23){_0x186a47[_0xeca9('0x51')](_0x30e115)[_0xeca9('0x1d')](function(_0x19dabb){_0x3efee3({'code':0xc8,'message':_0x19dabb[_0xeca9('0x1e')]});})[_0xeca9('0x22')](function(_0x12966c){_0x5aac23(_0x31de1f[_0xeca9('0x14')](0x1f4,_0x12966c[_0xeca9('0x1e')]));});});},'CheckAfterSend':function(_0x5f14df){var _0x3bc532=this;return new Promise(function(_0x2647cc,_0x314fcf){_0x186a47[_0xeca9('0x52')](_0x5f14df)[_0xeca9('0x1d')](function(_0x53d8a5){_0x2647cc({'code':0xc8,'message':_0x53d8a5[_0xeca9('0x1e')]});})[_0xeca9('0x22')](function(_0x1ad010){_0x314fcf(_0x3bc532[_0xeca9('0x14')](0x1f4,_0x1ad010[_0xeca9('0x1e')]));});});}};var _0x5573b7=jayson[_0xeca9('0x53')](_0x369f5e)[_0xeca9('0x54')]();_0x5573b7['on'](_0xeca9('0x14'),function(_0x4554ab){return _0x483e41(_0x4554ab);});_0x5573b7[_0xeca9('0x9')](0x232a,_0xeca9('0x55'),function(){console[_0xeca9('0x56')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x305dc5(_0xeca9('0x57')+0x232a);});});}; \ No newline at end of file +var _0x7fbe=['omit','undefined','values','voicechannel','join','channels','uniqueid','channel','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','catch','destinationchannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','type','includes','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','custom:','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','pick','reload','module','action','Reload','then','message','isConnected','command','Action','voiceQueues','hasOwnProperty','push','length','find'];(function(_0x3bc87e,_0x2402c0){var _0x574f94=function(_0x18a508){while(--_0x18a508){_0x3bc87e['push'](_0x3bc87e['shift']());}};_0x574f94(++_0x2402c0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0x7fbe[_0x50c16c];return _0x24dc5f;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0xe7fb('0x0'));var schema=require(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var config=require(_0xe7fb('0x3'));var properties=require(_0xe7fb('0x4'));var ami=require(_0xe7fb('0x5'));var VoiceQueueSummary=require(_0xe7fb('0x6'));exports[_0xe7fb('0x7')]=function(_0x36ab90,_0x5dbf04,_0x290172){return new Promise(function(_0x12d1b0,_0x24cd67){var _0x1f943f={'QueuePause':function(_0x5ad75b){return new Promise(function(_0x213ebc){var _0x228f6b=util[_0xe7fb('0x8')](_0xe7fb('0x9'),'SIP',_0x5ad75b['name']);if(_0x36ab90[_0xe7fb('0xa')]&&_0x36ab90[_0xe7fb('0xa')][_0x228f6b]&&_0x36ab90[_0xe7fb('0xa')][_0x228f6b][_0xe7fb('0xb')]){_0x36ab90[_0xe7fb('0xa')][_0x228f6b][_0xe7fb('0xc')]();}if(_0x36ab90[_0xe7fb('0xd')][_0x228f6b]){_0x36ab90[_0xe7fb('0xd')][_0x228f6b][_0xe7fb('0xe')]({'statePause':_0x5ad75b[_0xe7fb('0xf')]?!![]:![]});}_0x213ebc({'code':0xc8,'message':_0xe7fb('0x10')});});},'Reload':function(_0x188e1d){var _0xdf9760=this;return new Promise(function(_0x45fe75,_0x7fe4d3){if(ami['isConnected']()==![]){return _0x7fe4d3(_0xdf9760[_0xe7fb('0x11')](0x1f4,[config[_0xe7fb('0x12')]['ip'],config['asterisk'][_0xe7fb('0x13')],_0xe7fb('0x14')]['join']('\x20')));}_0x188e1d=_[_0xe7fb('0x15')](_0x188e1d,_['keys'](properties[_0xe7fb('0x16')][_0xe7fb('0x17')]));_0x188e1d[_0xe7fb('0x18')]=_0xe7fb('0x19');return ami['Action'](_0x188e1d)[_0xe7fb('0x1a')](function(_0x5ebc87){_0x45fe75({'code':0xc8,'message':_0x5ebc87[_0xe7fb('0x1b')]});})['catch'](function(_0x1e77fd){_0x7fe4d3(_0xdf9760[_0xe7fb('0x11')](0x1f5,_0x1e77fd[_0xe7fb('0x1b')]));});});},'Command':function(_0x182269){var _0x5df1a1=this;return new Promise(function(_0x44466e,_0x5d1c87){if(ami[_0xe7fb('0x1c')]()==![]){return _0x5d1c87(_0x5df1a1['error'](0x1f4,[config[_0xe7fb('0x12')]['ip'],config['asterisk'][_0xe7fb('0x13')],_0xe7fb('0x14')]['join']('\x20')));}_0x182269=_[_0xe7fb('0x15')](_0x182269,_0xe7fb('0x1d'));_0x182269[_0xe7fb('0x18')]='Command';return ami[_0xe7fb('0x1e')](_0x182269)[_0xe7fb('0x1a')](function(_0x5da3d9){_0x44466e({'code':0xc8,'message':_0x5da3d9['content']});})['catch'](function(_0x35e4db){_0x5d1c87(_0x5df1a1['error'](0x1f5,_0x35e4db['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x4026b1){var _0x32e8b2=[];for(var _0x2996ae in _0x36ab90['voiceQueues']){if(_0x36ab90[_0xe7fb('0x1f')][_0xe7fb('0x20')](_0x2996ae)){var _0x390f32=_0x36ab90[_0xe7fb('0x1f')][_0x2996ae];var _0x392d75=new VoiceQueueSummary(_0x390f32);_0x32e8b2[_0xe7fb('0x21')](_0x392d75);}}_0x4026b1({'count':_0x32e8b2[_0xe7fb('0x22')],'rows':_0x32e8b2});});},'UpdateVoiceQueue':function(_0x59e015){return new Promise(function(_0x5df9f2,_0x1086e6){var _0x3bdee9=_[_0xe7fb('0x23')](_0x36ab90['voiceQueues'],{'id':parseInt(_0x59e015['id'])});var _0xb1f2f4=_[_0xe7fb('0x24')](_0x59e015,['id']);if(_0x3bdee9){for(var _0xd3fffe in _0xb1f2f4){if(typeof _0xb1f2f4[_0xd3fffe]!==_0xe7fb('0x25')&&typeof _0x3bdee9[_0xd3fffe]!==_0xe7fb('0x25')){_0x3bdee9[_0xd3fffe]=_0xb1f2f4[_0xd3fffe];}}_0x5df9f2(_0x3bdee9);}else{_0x1086e6();}});},'VoiceChannels':function(){return new Promise(function(_0x1256d4){var _0x1d57a7=_[_0xe7fb('0x26')](_0x36ab90['channels']);_0x1256d4({'count':_0x1d57a7[_0xe7fb('0x22')],'rows':_0x1d57a7});});},'VoiceChannelMixMonitor':function(_0x1742f3){var _0x29d1ca=this;return new Promise(function(_0x547a04,_0x517d70){if(ami[_0xe7fb('0x1c')]()==![]){return _0x517d70(_0x29d1ca['error'](0x1f4,[config[_0xe7fb('0x12')]['ip'],config[_0xe7fb('0x12')][_0xe7fb('0x13')],_0xe7fb('0x14')]['join']('\x20')));}var _0x1af472=schema(properties[_0xe7fb('0x27')])[_0xe7fb('0x1')](_0x1742f3);if(_0x1af472[_0xe7fb('0x22')]>0x0){return _0x517d70(_0x29d1ca[_0xe7fb('0x11')](0x1f4,_['map'](_0x1af472,_0xe7fb('0x1b'))[_0xe7fb('0x28')](',\x20')));}var _0x209eaa=_[_0xe7fb('0x23')](_0x36ab90[_0xe7fb('0x29')],{'uniqueid':_0x1742f3[_0xe7fb('0x2a')]});if(_0x209eaa&&_0x209eaa[_0xe7fb('0x2b')]){var _0x147eb1=util[_0xe7fb('0x8')]('%s.%s',_0x1742f3[_0xe7fb('0x2c')]||_0x1742f3[_0xe7fb('0x2a')],_0x1742f3[_0xe7fb('0x8')]||'wav');return ami[_0xe7fb('0x1e')]({'action':_0xe7fb('0x2d'),'channel':_0x209eaa[_0xe7fb('0x2b')],'file':_0x147eb1,'options':_0xe7fb('0x2e')})[_0xe7fb('0x1a')](function(_0x35b828){var _0xfeefb1=_[_0xe7fb('0x23')](_0x209eaa[_0xe7fb('0x2f')],{'filename':_0xe7fb('0x30')+_0x147eb1[_0xe7fb('0x31')]()});if(_[_0xe7fb('0x32')](_0xfeefb1)){_0x209eaa[_0xe7fb('0x2f')][_0xe7fb('0x21')]({'filename':_0xe7fb('0x30')+_0x147eb1[_0xe7fb('0x31')](),'createdAt':moment()[_0xe7fb('0x8')](_0xe7fb('0x33')),'mixmonitorid':_0x35b828[_0xe7fb('0x34')],'status':'rec'});}else{_0xfeefb1[_0xe7fb('0x34')]=_0x35b828[_0xe7fb('0x34')];_0xfeefb1[_0xe7fb('0x35')]=_0xe7fb('0x36');}_0x547a04({'code':0xc8,'message':[_0x1742f3['uniqueid'],_0xe7fb('0x37'),_0x35b828[_0xe7fb('0x34')]][_0xe7fb('0x28')]('\x20'),'mixmonitorid':_0x35b828[_0xe7fb('0x34')]});})['catch'](function(_0x2f976f){_0x517d70(_0x29d1ca[_0xe7fb('0x11')](0x1f5,[_0x1742f3[_0xe7fb('0x2a')],_0x2f976f[_0xe7fb('0x1b')][_0xe7fb('0x31')]()][_0xe7fb('0x28')]('\x20')));});}else{return _0x517d70(_0x29d1ca['error'](0x1f5,_0xe7fb('0x38')));}});},'VoiceChannelStopMixMonitor':function(_0x35139f){var _0x3a96cd=this;return new Promise(function(_0x4b263d,_0x36a341){if(ami[_0xe7fb('0x1c')]()==![]){return _0x36a341(_0x3a96cd['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xe7fb('0x28')]('\x20')));}var _0x957ca3=schema(properties[_0xe7fb('0x27')])['validate'](_0x35139f);if(_0x957ca3[_0xe7fb('0x22')]>0x0){return _0x36a341(_0x3a96cd['error'](0x1f4,_[_0xe7fb('0x39')](_0x957ca3,_0xe7fb('0x1b'))['join'](',\x20')));}var _0x108a16=_[_0xe7fb('0x23')](_0x36ab90[_0xe7fb('0x29')],{'uniqueid':_0x35139f[_0xe7fb('0x2a')]});if(_0x108a16){return Promise['resolve']()[_0xe7fb('0x1a')](function(){if(_0x108a16[_0xe7fb('0x2b')]){return ami[_0xe7fb('0x1e')]({'action':'StopMixMonitor','channel':_0x108a16[_0xe7fb('0x2b')],'mixmonitorid':_0x35139f[_0xe7fb('0x34')]})[_0xe7fb('0x3a')](function(){});}})[_0xe7fb('0x1a')](function(){if(_0x108a16[_0xe7fb('0x3b')]){return ami['Action']({'action':_0xe7fb('0x3c'),'channel':_0x108a16['destinationchannel'],'mixmonitorid':_0x35139f[_0xe7fb('0x34')]})[_0xe7fb('0x3a')](function(){});}})[_0xe7fb('0x1a')](function(){var _0x1ecbfd=_[_0xe7fb('0x23')](_0x108a16['monitors'],{'mixmonitorid':_0x35139f[_0xe7fb('0x34')]});if(_0x1ecbfd){_0x1ecbfd['status']='stop';}})[_0xe7fb('0x1a')](function(){var _0x3d740f=util[_0xe7fb('0x8')]('%s.%s',_0x35139f[_0xe7fb('0x2c')]||_0x35139f[_0xe7fb('0x2a')],_0x35139f['format']||'wav');var _0x284bcb=_[_0xe7fb('0x23')](_0x108a16[_0xe7fb('0x2f')],{'filename':_0xe7fb('0x30')+_0x3d740f[_0xe7fb('0x31')]()});if(_0x284bcb){_0x284bcb[_0xe7fb('0x35')]=_0xe7fb('0x3d');}})[_0xe7fb('0x1a')](function(){_0x4b263d({'code':0xc8,'message':[_0x35139f['uniqueid'],_0xe7fb('0x3e')]['join']('\x20')});})[_0xe7fb('0x3a')](function(_0x102da9){_0x36a341(_0x3a96cd['error'](0x1f5,[_0x35139f[_0xe7fb('0x2a')],_0x102da9['message'][_0xe7fb('0x31')]()]['join']('\x20')));});}else{return _0x36a341(_0x3a96cd[_0xe7fb('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x467c5a){var _0x59158c=this;return new Promise(function(_0x1fff6c){var _0x1b6442=_[_0xe7fb('0x26')](_0x36ab90[_0xe7fb('0x3f')]);var _0xb8179a={'count':_0x1b6442[_0xe7fb('0x22')],'rows':_0x1b6442};if(_0x467c5a&&_0x467c5a[_0xe7fb('0x40')]){if(!['inbound','outbound'][_0xe7fb('0x41')](_0x467c5a['type'])){return _0x24cd67(_0x59158c['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x50b8df=_['filter'](_0x1b6442,function(_0x18773c){return _0x18773c[_0xe7fb('0x40')]===_0x467c5a[_0xe7fb('0x40')];});_0xb8179a[_0xe7fb('0x42')]=_0x50b8df['length'];_0xb8179a[_0xe7fb('0x43')]=_0x50b8df;}_0x1fff6c(_0xb8179a);});},'VoiceQueuesChannel':function(_0x236b35){var _0x195e52=this;return new Promise(function(_0x4a9372,_0x56c512){var _0x2f3b72=schema(properties[_0xe7fb('0x44')])[_0xe7fb('0x1')](_0x236b35);if(_0x2f3b72['length']>0x0){return _0x56c512(_0x195e52[_0xe7fb('0x11')](0x1f4,_[_0xe7fb('0x39')](_0x2f3b72,_0xe7fb('0x1b'))[_0xe7fb('0x28')](',\x20')));}var _0x548cd4=_['find'](_0x36ab90[_0xe7fb('0x3f')],{'uniqueid':_0x236b35[_0xe7fb('0x2a')]});if(_0x548cd4){_0x4a9372(_0x548cd4);}else{return _0x56c512(_0x195e52[_0xe7fb('0x11')](0x1f5,_0xe7fb('0x38')));}});},'VoiceQueuesChannelHangup':function(_0x3b0147){var _0x5dd7c8=this;return new Promise(function(_0x9c45a,_0x349a2a){if(ami[_0xe7fb('0x1c')]()==![]){return _0x349a2a(_0x5dd7c8['error'](0x1f4,[config['asterisk']['ip'],config[_0xe7fb('0x12')][_0xe7fb('0x13')],_0xe7fb('0x14')][_0xe7fb('0x28')]('\x20')));}var _0x40f546=schema(properties[_0xe7fb('0x45')])['validate'](_0x3b0147);if(_0x40f546[_0xe7fb('0x22')]>0x0){return _0x349a2a(_0x5dd7c8[_0xe7fb('0x11')](0x1f4,_[_0xe7fb('0x39')](_0x40f546,_0xe7fb('0x1b'))[_0xe7fb('0x28')](',\x20')));}var _0x1e0d69=_['find'](_0x36ab90[_0xe7fb('0x3f')],{'uniqueid':_0x3b0147['uniqueid']});if(_0x1e0d69&&_0x1e0d69[_0xe7fb('0x2b')]){return ami[_0xe7fb('0x1e')]({'action':_0xe7fb('0x46'),'channel':_0x1e0d69[_0xe7fb('0x2b')]})['then'](function(_0x47ac92){_0x9c45a({'code':0xc8,'message':[_0x3b0147[_0xe7fb('0x2a')],_0x47ac92[_0xe7fb('0x1b')][_0xe7fb('0x31')]()][_0xe7fb('0x28')]('\x20')});})[_0xe7fb('0x3a')](function(_0x50dc34){_0x349a2a(_0x5dd7c8[_0xe7fb('0x11')](0x1f5,[_0x3b0147['uniqueid'],_0x50dc34[_0xe7fb('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x349a2a(_0x5dd7c8[_0xe7fb('0x11')](0x1f5,_0xe7fb('0x38')));}});},'VoiceQueuesChannelRedirect':function(_0x1b2fc7){var _0x5da884=this;return new Promise(function(_0x475716,_0x34b7a5){if(ami[_0xe7fb('0x1c')]()==![]){return _0x34b7a5(_0x5da884[_0xe7fb('0x11')](0x1f4,[config[_0xe7fb('0x12')]['ip'],config['asterisk'][_0xe7fb('0x13')],_0xe7fb('0x14')]['join']('\x20')));}var _0x4136ae=schema(properties[_0xe7fb('0x47')])['validate'](_0x1b2fc7);if(_0x4136ae[_0xe7fb('0x22')]>0x0){return _0x34b7a5(_0x5da884['error'](0x1f4,_[_0xe7fb('0x39')](_0x4136ae,_0xe7fb('0x1b'))[_0xe7fb('0x28')](',\x20')));}var _0x5c0104=_[_0xe7fb('0x23')](_0x36ab90[_0xe7fb('0x3f')],{'uniqueid':_0x1b2fc7[_0xe7fb('0x2a')]});if(_0x5c0104&&_0x5c0104[_0xe7fb('0x2b')]){return ami[_0xe7fb('0x1e')]({'action':_0xe7fb('0x48'),'channel':_0x5c0104[_0xe7fb('0x2b')],'exten':_0x1b2fc7[_0xe7fb('0x49')],'context':_0x1b2fc7['context']||_0x5c0104['context'],'priority':0x1})[_0xe7fb('0x1a')](function(_0x3a674e){_0x475716({'code':0xc8,'message':[_0x1b2fc7[_0xe7fb('0x2a')],_0x3a674e['message']['toLowerCase']()][_0xe7fb('0x28')]('\x20')});})[_0xe7fb('0x3a')](function(_0xad7c53){_0x34b7a5(_0x5da884[_0xe7fb('0x11')](0x1f5,[_0x1b2fc7[_0xe7fb('0x2a')],_0xad7c53[_0xe7fb('0x1b')][_0xe7fb('0x31')]()][_0xe7fb('0x28')]('\x20')));});}else{return _0x34b7a5(_0x5da884[_0xe7fb('0x11')](0x1f5,_0xe7fb('0x38')));}});},'Agents':function(_0x1ff5e7){return new Promise(function(_0xf423ab){var _0x12b91f=_['values'](_0x36ab90['agents']);if(_0x1ff5e7&&_0x1ff5e7['id']){var _0x125427=_[_0xe7fb('0x23')](_0x12b91f,function(_0x178395){return _0x178395['id']===_0x1ff5e7['id'];});_0xf423ab(_0x125427);}else{_0xf423ab({'count':_0x12b91f[_0xe7fb('0x22')],'rows':_0x12b91f});}});},'Telephones':function(){return new Promise(function(_0x8dd368){var _0x562493=_[_0xe7fb('0x26')](_0x36ab90[_0xe7fb('0x4a')]);_0x8dd368({'count':_0x562493[_0xe7fb('0x22')],'rows':_0x562493});});},'Trunks':function(){return new Promise(function(_0x1457fc){var _0x16553c=_[_0xe7fb('0x26')](_0x36ab90[_0xe7fb('0x4b')]);_0x1457fc({'count':_0x16553c[_0xe7fb('0x22')],'rows':_0x16553c});});},'OutboundChannels':function(){return new Promise(function(_0xa7fa61){var _0x51eaec=_[_0xe7fb('0x26')](_0x36ab90['outboundChannels']);_0xa7fa61({'count':_0x51eaec[_0xe7fb('0x22')],'rows':_0x51eaec});});},'Outbound':function(){return new Promise(function(_0x2f13f2){_0x2f13f2(_0x36ab90[_0xe7fb('0x4c')]);});},'Campaigns':function(){return new Promise(function(_0x31c159){var _0x318d06=_['values'](_0x36ab90[_0xe7fb('0x4d')]);_0x31c159({'count':_0x318d06[_0xe7fb('0x22')],'rows':_0x318d06});});},'VoiceQueuesPreview':function(_0x4fd57a){var _0x2bf4aa=this;return new Promise(function(_0x15d881,_0x172547){_0x5dbf04[_0xe7fb('0x4e')](_0x4fd57a['id'])[_0xe7fb('0x1a')](function(_0x3d139f){_0x15d881({'code':0xc8,'message':_0x3d139f[_0xe7fb('0x1b')]});})[_0xe7fb('0x3a')](function(_0x14b028){_0x172547(_0x2bf4aa[_0xe7fb('0x11')](0x1f4,_0x14b028[_0xe7fb('0x1b')]));});});},'EventManager':function(_0x52b8a1){var _0x4b5f7e=this;return new Promise(function(_0x48a015,_0x13265b){if(!_0x52b8a1[_0xe7fb('0x4f')]){return _0x13265b(_0x4b5f7e[_0xe7fb('0x11')](0x1f4,_0xe7fb('0x50')));}ami['emit'](_0xe7fb('0x51')+_0x52b8a1[_0xe7fb('0x4f')],_0x52b8a1[_0xe7fb('0x1b')]);_0x48a015({'code':0xc8,'message':_0x52b8a1});});},'FaxAccounts':function(){return new Promise(function(_0x138a5e){var _0x5982f9=_[_0xe7fb('0x26')](_0x36ab90['faxAccounts']);_0x138a5e({'count':_0x5982f9[_0xe7fb('0x22')],'rows':_0x5982f9});});},'SendFax':function(_0x325c51){var _0xd49119=this;return new Promise(function(_0x1d278d,_0x7c3f19){_0x290172['send'](_0x325c51)[_0xe7fb('0x1a')](function(_0x5b8f3e){_0x1d278d({'code':0xc8,'message':_0x5b8f3e[_0xe7fb('0x1b')]});})['catch'](function(_0x2aeeed){_0x7c3f19(_0xd49119[_0xe7fb('0x11')](0x1f4,_0x2aeeed['message']));});});},'CheckAfterSend':function(_0x2b6d69){var _0x31642f=this;return new Promise(function(_0xb19e94,_0x4181fd){_0x290172['checkAfterSend'](_0x2b6d69)[_0xe7fb('0x1a')](function(_0x277335){_0xb19e94({'code':0xc8,'message':_0x277335[_0xe7fb('0x1b')]});})['catch'](function(_0x11d5b6){_0x4181fd(_0x31642f['error'](0x1f4,_0x11d5b6['message']));});});}};var _0x511bdc=jayson[_0xe7fb('0x52')](_0x1f943f)[_0xe7fb('0x53')]();_0x511bdc['on']('error',function(_0xf40e0a){return _0x24cd67(_0xf40e0a);});_0x511bdc[_0xe7fb('0x7')](0x232a,_0xe7fb('0x54'),function(){console[_0xe7fb('0x55')](_0xe7fb('0x56'),0x232a);return _0x12d1b0(_0xe7fb('0x57')+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 17009bb..ccf3d24 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 _0x9eac=['../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','merge','lodash','ioredis','util'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x9eac,0x6b));var _0xc9ea=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x9eac[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0xc9ea('0x0'));var BPromise=require('bluebird');var Redis=require(_0xc9ea('0x1'));var util=require(_0xc9ea('0x2'));var config=require(_0xc9ea('0x3'));var logger=require('../../../../config/logger')(_0xc9ea('0x4'));var cmContactRpc=require(_0xc9ea('0x5'));config[_0xc9ea('0x6')]=_[_0xc9ea('0x7')](config[_0xc9ea('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xc9ea('0x8'))(new Redis(config[_0xc9ea('0x6')]));function emit(_0x4d6c6e,_0x43fb56,_0x1f677c,_0x8e3996,_0x38ca43){logger[_0xc9ea('0x9')]('[CM][%s][%s]',_0x4d6c6e,_0x43fb56['id'],_0x1f677c,_0x8e3996,JSON[_0xc9ea('0xa')](_0x38ca43));io['to'](_0x1f677c)[_0xc9ea('0xb')](_0x8e3996,_0x38ca43);}exports['exec']=function(_0x2ca139,_0xad8235,_0x127325,_0x363b94){var _0x5c51d6,_0x1d3b72;var _0x2a0179={};var _0x3c88b6;var _0xd84e95=Number(_0x127325['data1']);var _0x17572a=_0x127325[_0xc9ea('0xc')]?Boolean(Number(_0x127325[_0xc9ea('0xc')])):![];var _0x481cdb;var _0x5964ef=![];if(!_[_0xc9ea('0xd')](_0x127325[_0xc9ea('0xe')])){if(_0x127325[_0xc9ea('0xe')]=='1')_0x5964ef=!![];}if(!_0x5964ef){if(_0x363b94[_0xc9ea('0xf')]){_0x2a0179['id']=_0x363b94[_0xc9ea('0xf')];}}if(!_0x2a0179['id']){_0x2a0179[_0xc9ea('0x10')]=_0xd84e95;_0x481cdb=_0x127325['data3']&&_0x127325['data3']!=='0'?_0x127325[_0xc9ea('0x11')]['split'](','):[_0xc9ea('0x12')];_0x2a0179[_0xc9ea('0x13')]=_[_0xc9ea('0x14')](_0x481cdb,function(_0xd5f435){var _0x214181={};_0x214181[_0xd5f435]=_0x363b94['routeId']?_0x363b94[_0xc9ea('0x15')]:_0x363b94[_0xc9ea('0x16')];return _0x214181;});_0x3c88b6=_0x363b94['routeId']?_0x363b94[_0xc9ea('0x15')]:_0x363b94[_0xc9ea('0x16')];}var _0x2b0f0f=['id',_0xc9ea('0x17'),_0xc9ea('0x18'),_0xc9ea('0x12'),_0xc9ea('0x19'),_0xc9ea('0x1a'),_0xc9ea('0x10'),_0xc9ea('0x1b'),_0xc9ea('0x1c'),_0xc9ea('0x1d')];var _0x385377=_[_0xc9ea('0x1e')](_0x2b0f0f,_0x481cdb);BPromise[_0xc9ea('0x1f')]()[_0xc9ea('0x20')](cmContactRpc[_0xc9ea('0x21')]({'attributes':_0x385377,'where':_0x2a0179,'phone':_0x3c88b6}))[_0xc9ea('0x20')](function(_0xbf65f){_0x1d3b72=_0xbf65f;if(!_[_0xc9ea('0x22')](_0x1d3b72)){if(_0x1d3b72[_0xc9ea('0x23')]===0x1){_0x5c51d6=_0x1d3b72[0x0];logger[_0xc9ea('0x9')](_0xc9ea('0x24'),_0x363b94['uniqueid'],_0xad8235['id'],_0x5c51d6['id']);}else{logger[_0xc9ea('0x9')](_0xc9ea('0x25'),_0x363b94['uniqueid'],_0xad8235['id'],_[_0xc9ea('0x14')](_0x1d3b72,'id')[_0xc9ea('0x26')](','));}return;}else{logger[_0xc9ea('0x9')](_0xc9ea('0x27'),_0x363b94[_0xc9ea('0x28')],_0xad8235['id']);var _0x3d588e={'ListId':_0xd84e95};var _0x8d938d=_0x127325[_0xc9ea('0x29')]&&_0x127325['data4']!=='0'?_0x127325[_0xc9ea('0x29')]:_0xc9ea('0x12');if(_0x17572a){logger[_0xc9ea('0x9')](_0xc9ea('0x2a'),_0x363b94[_0xc9ea('0x28')],_0xad8235['id']);_0x3d588e[_0x8d938d]=_['isNil'](_0x363b94['routeId'])?_0x363b94['calleridnum']:_0x363b94[_0xc9ea('0x15')];if(_['isNil'](_0x363b94[_0xc9ea('0x2b')])){_0x3d588e[_0xc9ea('0x17')]=_0x363b94[_0xc9ea('0x2c')]&&_0x363b94[_0xc9ea('0x2c')]!==_0xc9ea('0x2d')?_0x363b94['calleridname']:_0xc9ea('0x2e');}else{_0x3d588e[_0xc9ea('0x17')]=_0x363b94['destcalleridname']&&_0x363b94['destcalleridname']!==_0xc9ea('0x2d')?_0x363b94[_0xc9ea('0x2f')]:_0xc9ea('0x2e');}return BPromise[_0xc9ea('0x1f')]()[_0xc9ea('0x20')](cmContactRpc[_0xc9ea('0x30')](_0x3d588e))[_0xc9ea('0x20')](function(_0x434ab3){_0x5c51d6=_0x434ab3;_0x1d3b72[_0xc9ea('0x31')](_0x434ab3);if(_0x5c51d6){logger[_0xc9ea('0x9')](_0xc9ea('0x32'),_0x363b94['uniqueid'],_0xad8235['id'],_0x5c51d6['id']);}return;});}else{logger[_0xc9ea('0x9')](_0xc9ea('0x33'),_0x363b94['uniqueid'],_0xad8235['id']);_0x3d588e[_0x8d938d]=_['isNil'](_0x363b94[_0xc9ea('0x2b')])?_0x363b94[_0xc9ea('0x16')]:_0x363b94['destcalleridnum'];if(_[_0xc9ea('0xd')](_0x363b94[_0xc9ea('0x2b')])){_0x3d588e['firstName']=_0x363b94[_0xc9ea('0x2c')]&&_0x363b94[_0xc9ea('0x2c')]!==''?_0x363b94['calleridname']:_0xc9ea('0x2e');}else{_0x3d588e['firstName']=_0x363b94['destcalleridname']&&_0x363b94[_0xc9ea('0x2f')]!==_0xc9ea('0x2d')?_0x363b94[_0xc9ea('0x2f')]:_0xc9ea('0x2e');}_0x5c51d6=_0x3d588e;_0x1d3b72['push'](_0x3d588e);return;}}})[_0xc9ea('0x20')](function(){if(_0x2ca139){emit(_0x363b94['uniqueid'],_0xad8235,util[_0xc9ea('0x34')](_0xc9ea('0x35'),_0x2ca139['name']),util[_0xc9ea('0x34')]('trigger:%s',_0x127325['action']['toLowerCase']()),{'evt':_[_0xc9ea('0x36')](_0x363b94,{'autoCreate':_0x17572a}),'contact':_0x5c51d6===undefined?{}:_0x5c51d6,'contacts':_0x1d3b72[_0xc9ea('0x23')]===0x0?undefined:_0x1d3b72});}});}; \ No newline at end of file +var _0x20a2=['calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','data3','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled'];(function(_0x134d29,_0x12d260){var _0x27f0c4=function(_0x13e82a){while(--_0x13e82a){_0x134d29['push'](_0x134d29['shift']());}};_0x27f0c4(++_0x12d260);}(_0x20a2,0xf2));var _0x220a=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x20a2[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x220a('0x0'));var BPromise=require(_0x220a('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x220a('0x2'));var logger=require(_0x220a('0x3'))(_0x220a('0x4'));var cmContactRpc=require(_0x220a('0x5'));config[_0x220a('0x6')]=_[_0x220a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x220a('0x8'))(new Redis(config[_0x220a('0x6')]));function emit(_0x2eeae8,_0x232828,_0x66fa55,_0x57030d,_0x2970ac){logger[_0x220a('0x9')](_0x220a('0xa'),_0x2eeae8,_0x232828['id'],_0x66fa55,_0x57030d,JSON[_0x220a('0xb')](_0x2970ac));io['to'](_0x66fa55)[_0x220a('0xc')](_0x57030d,_0x2970ac);}exports[_0x220a('0xd')]=function(_0x23aadc,_0x45782f,_0x298cda,_0xaef9b1){var _0x5368e9,_0x237bef;var _0x13dbb3={};var _0x565e36;var _0x1e675b=Number(_0x298cda['data1']);var _0x21c426=_0x298cda[_0x220a('0xe')]?Boolean(Number(_0x298cda[_0x220a('0xe')])):![];var _0x89d350;var _0x4803c6=![];if(!_[_0x220a('0xf')](_0x298cda[_0x220a('0x10')])){if(_0x298cda['data5']=='1')_0x4803c6=!![];}if(!_0x4803c6){if(_0xaef9b1[_0x220a('0x11')]){_0x13dbb3['id']=_0xaef9b1[_0x220a('0x11')];}}if(!_0x13dbb3['id']){_0x13dbb3['ListId']=_0x1e675b;_0x89d350=_0x298cda[_0x220a('0x12')]&&_0x298cda[_0x220a('0x12')]!=='0'?_0x298cda[_0x220a('0x12')]['split'](','):[_0x220a('0x13')];_0x13dbb3['$or']=_[_0x220a('0x14')](_0x89d350,function(_0x124c28){var _0x2a1b42={};_0x2a1b42[_0x124c28]=_0xaef9b1[_0x220a('0x15')]?_0xaef9b1[_0x220a('0x16')]:_0xaef9b1[_0x220a('0x17')];return _0x2a1b42;});_0x565e36=_0xaef9b1[_0x220a('0x15')]?_0xaef9b1[_0x220a('0x16')]:_0xaef9b1['calleridnum'];}var _0x417980=['id',_0x220a('0x18'),_0x220a('0x19'),_0x220a('0x13'),_0x220a('0x1a'),_0x220a('0x1b'),_0x220a('0x1c'),_0x220a('0x1d'),_0x220a('0x1e'),_0x220a('0x1f')];var _0x5be1fb=_['union'](_0x417980,_0x89d350);BPromise[_0x220a('0x20')]()[_0x220a('0x21')](cmContactRpc[_0x220a('0x22')]({'attributes':_0x5be1fb,'where':_0x13dbb3,'phone':_0x565e36}))[_0x220a('0x21')](function(_0x2dae9f){_0x237bef=_0x2dae9f;if(!_[_0x220a('0x23')](_0x237bef)){if(_0x237bef[_0x220a('0x24')]===0x1){_0x5368e9=_0x237bef[0x0];logger[_0x220a('0x9')](_0x220a('0x25'),_0xaef9b1['uniqueid'],_0x45782f['id'],_0x5368e9['id']);}else{logger[_0x220a('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xaef9b1[_0x220a('0x26')],_0x45782f['id'],_['map'](_0x237bef,'id')[_0x220a('0x27')](','));}return;}else{logger[_0x220a('0x9')](_0x220a('0x28'),_0xaef9b1[_0x220a('0x26')],_0x45782f['id']);var _0x4378b2={'ListId':_0x1e675b};var _0x3ca893=_0x298cda['data4']&&_0x298cda[_0x220a('0x29')]!=='0'?_0x298cda['data4']:_0x220a('0x13');if(_0x21c426){logger[_0x220a('0x9')](_0x220a('0x2a'),_0xaef9b1[_0x220a('0x26')],_0x45782f['id']);_0x4378b2[_0x3ca893]=_[_0x220a('0xf')](_0xaef9b1[_0x220a('0x15')])?_0xaef9b1[_0x220a('0x17')]:_0xaef9b1[_0x220a('0x16')];if(_[_0x220a('0xf')](_0xaef9b1[_0x220a('0x15')])){_0x4378b2[_0x220a('0x18')]=_0xaef9b1[_0x220a('0x2b')]&&_0xaef9b1[_0x220a('0x2b')]!==_0x220a('0x2c')?_0xaef9b1[_0x220a('0x2b')]:_0x220a('0x2d');}else{_0x4378b2[_0x220a('0x18')]=_0xaef9b1[_0x220a('0x2e')]&&_0xaef9b1[_0x220a('0x2e')]!==_0x220a('0x2c')?_0xaef9b1['destcalleridname']:_0x220a('0x2d');}return BPromise[_0x220a('0x20')]()['then'](cmContactRpc[_0x220a('0x2f')](_0x4378b2))[_0x220a('0x21')](function(_0x3c9de7){_0x5368e9=_0x3c9de7;_0x237bef['push'](_0x3c9de7);if(_0x5368e9){logger['info'](_0x220a('0x30'),_0xaef9b1[_0x220a('0x26')],_0x45782f['id'],_0x5368e9['id']);}return;});}else{logger[_0x220a('0x9')](_0x220a('0x31'),_0xaef9b1[_0x220a('0x26')],_0x45782f['id']);_0x4378b2[_0x3ca893]=_[_0x220a('0xf')](_0xaef9b1[_0x220a('0x15')])?_0xaef9b1[_0x220a('0x17')]:_0xaef9b1['destcalleridnum'];if(_[_0x220a('0xf')](_0xaef9b1['routeId'])){_0x4378b2[_0x220a('0x18')]=_0xaef9b1[_0x220a('0x2b')]&&_0xaef9b1[_0x220a('0x2b')]!==_0x220a('0x2c')?_0xaef9b1[_0x220a('0x2b')]:_0x220a('0x2d');}else{_0x4378b2[_0x220a('0x18')]=_0xaef9b1[_0x220a('0x2e')]&&_0xaef9b1[_0x220a('0x2e')]!==_0x220a('0x2c')?_0xaef9b1[_0x220a('0x2e')]:_0x220a('0x2d');}_0x5368e9=_0x4378b2;_0x237bef[_0x220a('0x32')](_0x4378b2);return;}}})[_0x220a('0x21')](function(){if(_0x23aadc){emit(_0xaef9b1['uniqueid'],_0x45782f,util['format'](_0x220a('0x33'),_0x23aadc[_0x220a('0x34')]),util['format'](_0x220a('0x35'),_0x298cda[_0x220a('0x36')][_0x220a('0x37')]()),{'evt':_[_0x220a('0x38')](_0xaef9b1,{'autoCreate':_0x21c426}),'contact':_0x5368e9===undefined?{}:_0x5368e9,'contacts':_0x237bef[_0x220a('0x24')]===0x0?undefined:_0x237bef});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e89b9b2..fb5830c 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 _0x2015=['ChatWebsiteId','operator','AccountId','value','upperFirst','interaction','event','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','deskAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','info','stringify','emit','prototype','clone','undefined','motionChannel','voice','interface','checkTriggers','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data4','location','uriLocation','windowWidth','data5','data6','600','winArguments','data3','format','user:%s','trigger:%s:%s','jscripty','name','trigger:%s','integration','exec','queue','routeId','urlforward','parse','query','replace','channel','every','checkConditions','AnyConditions','some','field','account'];(function(_0x327e3e,_0x327f25){var _0x542de0=function(_0x406af6){while(--_0x406af6){_0x327e3e['push'](_0x327e3e['shift']());}};_0x542de0(++_0x327f25);}(_0x2015,0x193));var _0x5201=function(_0x5650e2,_0x1ff53b){_0x5650e2=_0x5650e2-0x0;var _0x596dae=_0x2015[_0x5650e2];return _0x596dae;};'use strict';var util=require(_0x5201('0x0'));var _=require(_0x5201('0x1'));var url=require(_0x5201('0x2'));var Mustache=require(_0x5201('0x3'));var Redis=require(_0x5201('0x4'));var urlforward=require(_0x5201('0x5'));var integration=require(_0x5201('0x6'));var cmContact=require(_0x5201('0x7'));var script=require('./script');var config=require(_0x5201('0x8'));var logger=require(_0x5201('0x9'))(_0x5201('0xa'));var ami=require(_0x5201('0xb'));config[_0x5201('0xc')]=_[_0x5201('0xd')](config[_0x5201('0xc')],{'host':_0x5201('0xe'),'port':0x18eb});var io=require(_0x5201('0xf'))(new Redis(config[_0x5201('0xc')]));var operators={'equals':function(_0x516b4e,_0x4100e9){return _0x516b4e==_0x4100e9;},'not_equals':function(_0x17d8f3,_0x48b93d){return _0x17d8f3!=_0x48b93d;}};var barAndWebActions=[_0x5201('0x10'),_0x5201('0x2'),_0x5201('0x11')];function Trigger(_0x47aa66){this[_0x5201('0x12')]=_0x47aa66[_0x5201('0x12')];this[_0x5201('0x13')]=_0x47aa66[_0x5201('0x13')];this[_0x5201('0x14')]=_0x47aa66[_0x5201('0x14')];this[_0x5201('0x15')]=_0x47aa66[_0x5201('0x15')];this[_0x5201('0x16')]=_0x47aa66[_0x5201('0x16')];this[_0x5201('0x17')]=_0x47aa66[_0x5201('0x17')];this['freshdeskAccounts']=_0x47aa66[_0x5201('0x18')];this[_0x5201('0x19')]=_0x47aa66['salesforceAccounts'];this['sugarcrmAccounts']=_0x47aa66[_0x5201('0x1a')];this[_0x5201('0x1b')]=_0x47aa66[_0x5201('0x1b')];this['deskAccounts']=_0x47aa66['deskAccounts'];this[_0x5201('0x1c')]=_0x47aa66['vtigerAccounts'];this[_0x5201('0x1d')]=_0x47aa66['servicenowAccounts'];this[_0x5201('0x1e')]=_0x47aa66['dynamics365Accounts'];this[_0x5201('0x1f')]=_0x47aa66[_0x5201('0x1f')];this[_0x5201('0x20')]={'zendesk':this[_0x5201('0x17')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x5201('0x1a')],'zoho':this[_0x5201('0x1b')],'desk':this[_0x5201('0x21')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x5201('0x1e')],'freshsales':this[_0x5201('0x1f')],'servicenow':this[_0x5201('0x1d')]};ami['on'](_0x5201('0x22'),this[_0x5201('0x23')]['bind'](this));ami['on'](_0x5201('0x24'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x26'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x27'),this['syncCustomEvent'][_0x5201('0x25')](this));ami['on'](_0x5201('0x28'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x29'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x2a'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on']('custom:agentcongestion',this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on']('custom:agentreject',this[_0x5201('0x23')]['bind'](this));ami['on']('custom:amd',this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5201('0x2c'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x2d'),this['syncAgentDial'][_0x5201('0x25')](this));ami['on'](_0x5201('0x2e'),this[_0x5201('0x2f')][_0x5201('0x25')](this));ami['on'](_0x5201('0x30'),this['syncAgentDial']['bind'](this));ami['on'](_0x5201('0x31'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x32'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x33'),this['syncCustomEvent'][_0x5201('0x25')](this));ami['on'](_0x5201('0x34'),this[_0x5201('0x23')]['bind'](this));ami['on'](_0x5201('0x35'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x36'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x37'),this[_0x5201('0x23')][_0x5201('0x25')](this));ami['on'](_0x5201('0x38'),this[_0x5201('0x23')][_0x5201('0x25')](this));}Trigger['prototype']['emit']=function(_0xe0a16e,_0xdc5ac4,_0x23d939){logger[_0x5201('0x39')](_0xe0a16e,_0xdc5ac4,JSON[_0x5201('0x3a')](_0x23d939));io['to'](_0xe0a16e)[_0x5201('0x3b')](_0xdc5ac4,_0x23d939);};Trigger[_0x5201('0x3c')]['syncCustomEvent']=function(_0x4311fa){var _0x111501=_[_0x5201('0x3d')](_0x4311fa);if(typeof _0x111501['motionChannel']===_0x5201('0x3e')){_0x111501[_0x5201('0x3f')]=_0x5201('0x40');}this['checkTriggers'](_0x111501);};Trigger[_0x5201('0x3c')][_0x5201('0x2f')]=function(_0x56049f){if(this['agents'][_0x56049f[_0x5201('0x41')]]){this[_0x5201('0x23')](_0x56049f);}};Trigger[_0x5201('0x3c')][_0x5201('0x42')]=function(_0x235841){var _0x3db6db;for(var _0x4db6a3 in this[_0x5201('0x12')]){if(this['triggers']['hasOwnProperty'](_0x4db6a3)){if(this[_0x5201('0x12')][_0x4db6a3][_0x5201('0x43')]){_0x3db6db=this[_0x5201('0x44')](this[_0x5201('0x12')][_0x4db6a3],_0x235841);if(_0x3db6db){_[_0x5201('0x45')](_0x235841,_0x235841['variables']);for(var _0x21d83a=0x0,_0x4a34b8,_0x161769,_0x2cdf39;_0x21d83a0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','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:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x2e4482,_0x476611){_0x2e4482=_0x2e4482-0x0;var _0x2589ed=_0xe14b[_0x2e4482];return _0x2589ed;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_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 diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 609295a..3c9d8f0 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 _0xacd3=['callDirection','queue','phonecalls','Subjects','Descriptions','ticketType','headers','ticketId','format','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','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','destcalleridnum','calleridnum','odata-entityid','substring','lastIndexOf','enduserId','outbound','contacts?$select=','replace','%2b','contactid','nothing','includes','string','picklist','type','nameField','customField','indexOf','content','incident','incidents','assign','getString','/contacts(','phonecall','/systemusers('];(function(_0x14474e,_0x575e9c){var _0x16f5f8=function(_0x6f211a){while(--_0x6f211a){_0x14474e['push'](_0x14474e['shift']());}};_0x16f5f8(++_0x575e9c);}(_0xacd3,0x1c0));var _0x3acd=function(_0x289996,_0x1e0940){_0x289996=_0x289996-0x0;var _0x2ac9dc=_0xacd3[_0x289996];return _0x2ac9dc;};'use strict';var _=require(_0x3acd('0x0'));var rp=require('request-promise');var util=require(_0x3acd('0x1'));var intUtil=require('./util');var md5=require(_0x3acd('0x2'));var Redis=require(_0x3acd('0x3'));var logger=require(_0x3acd('0x4'))(_0x3acd('0x5'));var config=require(_0x3acd('0x6'));config[_0x3acd('0x7')]=_[_0x3acd('0x8')](config[_0x3acd('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3acd('0x9'))(new Redis(config['redis']));function getAuthToken(_0x1aedba,_0x4532ee,_0x2561c7){if(_0x1aedba[_0x3acd('0xa')]){_0x1aedba[_0x3acd('0xb')]=_0x1aedba[_0x3acd('0xc')][_0x3acd('0xd')];_0x1aedba[_0x3acd('0xe')]=_0x1aedba[_0x3acd('0xc')][_0x3acd('0xf')];return Promise[_0x3acd('0x10')](_0x1aedba[_0x3acd('0xc')]['data5']);}var _0x307ab6={'method':_0x3acd('0x11'),'uri':_0x4532ee,'form':{'client_id':_0x1aedba[_0x3acd('0x12')],'resource':_0x1aedba[_0x3acd('0xb')],'username':_0x1aedba[_0x3acd('0x13')],'password':_0x1aedba[_0x3acd('0x14')],'grant_type':_0x3acd('0x14'),'client_secret':_0x1aedba[_0x3acd('0x15')]},'json':!![]};return rp(_0x307ab6)[_0x3acd('0x16')](function(_0x4577dd){return _0x4577dd[_0x3acd('0x17')];})[_0x3acd('0x18')](function(_0x645f39){logger[_0x3acd('0x19')]('['+[_0x2561c7[_0x3acd('0x1a')]()]+_0x3acd('0x1b'));return _0x645f39[_0x3acd('0x1c')];});}function getUser(_0x8d092e,_0x594929,_0x1850eb,_0x6cc946,_0x51bc12,_0x59c158){return new Promise(function(_0x24c4f3,_0x432b1b){return getAuthToken(_0x594929,_0x6cc946,_0x59c158)[_0x3acd('0x16')](function(_0xcb2885){var _0x373f65={'method':_0x3acd('0x1d'),'uri':_0x51bc12+_0x3acd('0x1e'),'headers':{'Authorization':_0x3acd('0x1f')+_0xcb2885,'OData-Version':_0x3acd('0x20')},'json':!![]};return rp(_0x373f65);})[_0x3acd('0x16')](function(_0x3c16d1){var _0x37a9cc=_0x3c16d1[_0x3acd('0x21')];var _0x2e8ad6=![];var _0x1417f7=null;if(!_['isNil'](_0x1850eb)){if(intUtil[_0x3acd('0x22')](_0x1850eb[_0x3acd('0x23')])){_0x8d092e[_0x3acd('0x24')]=_0x1850eb[_0x3acd('0x23')];for(_0x1417f7=0x0;_0x1417f7<_0x37a9cc[_0x3acd('0x25')];_0x1417f7++){if(_0x37a9cc[_0x1417f7][_0x3acd('0x26')]===_0x1850eb[_0x3acd('0x23')]&&!_0x37a9cc[_0x1417f7]['isdisabled']){_0x2e8ad6=!![];logger[_0x3acd('0x27')]('['+[_0x59c158[_0x3acd('0x1a')]()]+_0x3acd('0x28')+_0x37a9cc[_0x1417f7][_0x3acd('0x29')]+'!');_0x8d092e['userId']=_0x37a9cc[_0x1417f7]['systemuserid'];}}}}if(!_0x2e8ad6){logger[_0x3acd('0x27')]('['+[_0x59c158[_0x3acd('0x1a')]()]+_0x3acd('0x2a'));_0x8d092e[_0x3acd('0x24')]=_0x594929[_0x3acd('0x13')];for(_0x1417f7=0x0;_0x1417f7<_0x37a9cc[_0x3acd('0x25')];_0x1417f7++){if(_0x37a9cc[_0x1417f7][_0x3acd('0x26')]===_0x594929['username']){_0x8d092e[_0x3acd('0x2b')]=_0x37a9cc[_0x1417f7][_0x3acd('0x29')];}}}_0x24c4f3(_0x8d092e);})[_0x3acd('0x18')](function(_0x5ce20b){_0x432b1b(_0x5ce20b[_0x3acd('0x1c')]);});});}function createEndUser(_0x4f5a7f,_0x375b6b,_0x414278,_0x5ec892,_0x1fd70a,_0x58f56e,_0x590a5c){return new Promise(function(_0xfad6cf,_0x1bfb93){return getAuthToken(_0x375b6b,_0x414278,_0x58f56e)['then'](function(_0x44e9e7){var _0xf32346=_0x58f56e[_0x3acd('0x2c')]()==='outbound'?_0x1fd70a[_0x3acd('0x2d')]:_0x1fd70a[_0x3acd('0x2e')];var _0x27dd24={'method':_0x3acd('0x11'),'uri':_0x5ec892+'contacts','body':{'fullname':_0xf32346,'firstname':_0xf32346,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4f5a7f[_0x3acd('0x2b')]+')'},'headers':{'Authorization':_0x3acd('0x1f')+_0x44e9e7,'OData-Version':_0x3acd('0x20')},'json':!![],'resolveWithFullResponse':!![]};_0x27dd24['body'][_0x590a5c]=_0xf32346;return rp(_0x27dd24);})[_0x3acd('0x16')](function(_0x4c47d6){var _0x29b634=_0x4c47d6['headers'][_0x3acd('0x2f')];var _0xa95af5=_0x29b634[_0x3acd('0x30')](_0x29b634[_0x3acd('0x31')]('(')+0x1,_0x29b634[_0x3acd('0x31')](')'));_0x4f5a7f[_0x3acd('0x32')]=_0xa95af5;_0xfad6cf(_0x4f5a7f);})['catch'](function(_0x186d3b){_0x1bfb93(_0x186d3b[_0x3acd('0x1c')]);});});}function getEndUser(_0x10e26f,_0xbbe01,_0x5c1126,_0x27fd07,_0x16dc88,_0x2a0249,_0x89ed1,_0x4ec44e){var _0x56449d=_0x2a0249[_0x3acd('0x2c')]()===_0x3acd('0x33')?_0x16dc88[_0x3acd('0x2d')]:_0x16dc88[_0x3acd('0x2e')];return getAuthToken(_0xbbe01,_0x5c1126,_0x2a0249)[_0x3acd('0x16')](function(_0x3dad2c){_0x4ec44e=_0x4ec44e?_0x4ec44e:'telephone1';var _0x341578={'method':'GET','uri':_0x27fd07+_0x3acd('0x34')+_0x4ec44e+'&$filter='+_0x4ec44e+'\x20eq\x20\x27'+_0x56449d[_0x3acd('0x35')]('+',_0x3acd('0x36'))+'\x27','headers':{'Authorization':_0x3acd('0x1f')+_0x3dad2c,'If-None-Match':null,'OData-Version':_0x3acd('0x20')},'json':!![]};return rp(_0x341578);})[_0x3acd('0x16')](function(_0x8cce67){var _0x147304=![];if(!_0x8cce67)return _0x147304;var _0x23b1ae=_0x8cce67[_0x3acd('0x21')];for(var _0x23f6df=0x0;_0x23f6df<_0x23b1ae[_0x3acd('0x25')];_0x23f6df++){if(_0x23b1ae[_0x23f6df][_0x4ec44e]===_0x56449d){_0x147304=!![];_0x10e26f[_0x3acd('0x32')]=_0x23b1ae[_0x23f6df][_0x3acd('0x37')];}}return _0x147304;})['then'](function(_0x1548d5){if(_0x1548d5)return _0x10e26f;if(_0x89ed1===_0x3acd('0x38')){logger['info']('['+[_0x2a0249['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x10e26f;}return createEndUser(_0x10e26f,_0xbbe01,_0x5c1126,_0x27fd07,_0x16dc88,_0x2a0249,_0x4ec44e)[_0x3acd('0x16')](function(_0x4c3a1e){logger[_0x3acd('0x27')]('['+[_0x2a0249['toUpperCase']()]+']\x20Enduser\x20created!',_0x4c3a1e['enduserId']);return _0x4c3a1e;});});}function getCustomFields(_0x72fe60,_0x323e44,_0x4a5527){var _0x13c466={};if(_0x72fe60[_0x3acd('0x25')]>0x0){_['forEach'](_0x72fe60,function(_0x4b539c){if(_[_0x3acd('0x39')]([_0x3acd('0x3a'),_0x3acd('0x3b')],_0x4b539c[_0x3acd('0x3c')])&&_0x4b539c[_0x3acd('0x3d')]&&!_0x4b539c[_0x3acd('0x3e')]){var _0x4defc4=_0x4b539c['idField']['toLowerCase']();var _0x548614=_0x4defc4['substring'](0x0,_0x4defc4[_0x3acd('0x3f')]('_'));var _0x4039ec=_0x4defc4[_0x3acd('0x30')](_0x4defc4['indexOf']('_')+0x1);if(_0x548614===_0x4a5527){_0x13c466[_0x4039ec]=_0x4b539c[_0x3acd('0x40')];}}});}return _0x13c466;}function getTicket(_0x20f6c3,_0x20b0ed,_0x1e4378,_0x9d74b8,_0x1974df,_0xf55f55,_0x42d7f5){return new Promise(function(_0x99c235,_0x54ee4f){var _0x3a75a6;return getAuthToken(_0x20b0ed,_0x1e4378,_0x42d7f5)['then'](function(_0x5c3440){if(_0xf55f55['ticketType']===_0x3acd('0x41')){_0x3a75a6={'method':'POST','uri':_0x9d74b8+_0x3acd('0x42'),'body':Object[_0x3acd('0x43')]({},{'title':intUtil['getString'](_0xf55f55['Subjects'],_0x1974df,'\x20'),'description':intUtil[_0x3acd('0x44')](_0xf55f55['Descriptions'],_0x1974df,'\x0a'),'customerid_contact@odata.bind':_0x20f6c3[_0x3acd('0x32')]?_0x3acd('0x45')+_0x20f6c3['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x20f6c3[_0x3acd('0x2b')]+')','caseorigincode':'1'},getCustomFields(_0xf55f55['Fields'],_0x1974df,_0xf55f55['ticketType'])),'headers':{'Authorization':_0x3acd('0x1f')+_0x5c3440,'OData-Version':_0x3acd('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xf55f55['ticketType']===_0x3acd('0x46')){var _0x188c5b=_0x20f6c3[_0x3acd('0x32')]?[{'partyid_systemuser@odata.bind':_0x3acd('0x47')+_0x20f6c3['userId']+')','participationtypemask':_0x20f6c3[_0x3acd('0x48')]===_0x3acd('0x49')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x20f6c3['enduserId']+')','participationtypemask':_0x20f6c3[_0x3acd('0x48')]===_0x3acd('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3acd('0x47')+_0x20f6c3[_0x3acd('0x2b')]+')','participationtypemask':_0x20f6c3[_0x3acd('0x48')]===_0x3acd('0x49')?0x2:0x1}];_0x3a75a6={'method':_0x3acd('0x11'),'uri':_0x9d74b8+_0x3acd('0x4a'),'body':Object['assign']({},{'subject':intUtil['getString'](_0xf55f55[_0x3acd('0x4b')],_0x1974df,'\x20'),'phonenumber':String(_0x1974df['calleridnum']),'description':intUtil[_0x3acd('0x44')](_0xf55f55[_0x3acd('0x4c')],_0x1974df,'\x0a'),'regardingobjectid_contact@odata.bind':_0x20f6c3[_0x3acd('0x32')]?_0x3acd('0x45')+_0x20f6c3['enduserId']+')':undefined,'ownerid@odata.bind':_0x3acd('0x47')+_0x20f6c3['userId']+')','directioncode':_0x20f6c3[_0x3acd('0x48')]===_0x3acd('0x49')?![]:!![],'phonecall_activity_parties':_0x188c5b},getCustomFields(_0xf55f55['Fields'],_0x1974df,_0xf55f55[_0x3acd('0x4d')])),'headers':{'Authorization':'Bearer\x20'+_0x5c3440,'OData-Version':_0x3acd('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3a75a6);})[_0x3acd('0x16')](function(_0x32603b){var _0x2e5e27=_0x32603b[_0x3acd('0x4e')][_0x3acd('0x2f')];var _0x3e11e5=_0x2e5e27[_0x3acd('0x30')](_0x2e5e27['lastIndexOf']('(')+0x1,_0x2e5e27[_0x3acd('0x31')](')'));_0x20f6c3[_0x3acd('0x4f')]=_0x3e11e5;_0x99c235(_0x20f6c3);})[_0x3acd('0x18')](function(_0x2864bb){_0x54ee4f(_0x2864bb['message']);});});}function emit(_0x74a098,_0x4cac5a,_0x12241f,_0x236f9e){var _0x1a2172={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x74a098,_0x12241f,_0x236f9e)};io['to'](util[_0x3acd('0x50')](_0x3acd('0x51'),_0x4cac5a))[_0x3acd('0x52')](_0x3acd('0x53'),_0x1a2172);}exports['cs']=function(_0x13ef7a,_0x2b8a39,_0x2cdc43,_0x512aab,_0x2815de,_0x2e39ca,_0x30e2b9,_0x23c36e){var _0x54b37a={};_0x2e39ca[_0x3acd('0xb')]=_0x2e39ca[_0x3acd('0xa')]?intUtil[_0x3acd('0x54')](_0x2e39ca[_0x3acd('0xc')][_0x3acd('0xd')]):intUtil[_0x3acd('0x54')](_0x2e39ca[_0x3acd('0xb')]);_0x2e39ca[_0x3acd('0x55')]=intUtil[_0x3acd('0x54')](_0x2e39ca[_0x3acd('0x55')]);_0x54b37a[_0x3acd('0x48')]=_0x23c36e===_0x3acd('0x49')||_0x23c36e===_0x3acd('0x56')?'queue':_0x3acd('0x33');var _0x27d793=_0x2e39ca[_0x3acd('0xa')]?util[_0x3acd('0x50')](_0x3acd('0x57'),_0x2e39ca[_0x3acd('0xc')][_0x3acd('0xd')]):util[_0x3acd('0x50')](_0x3acd('0x57'),_0x2e39ca['remoteUri']);var _0x46df5c=util[_0x3acd('0x50')](_0x3acd('0x58'),_0x2e39ca[_0x3acd('0xe')]);var _0x31e8bd=util[_0x3acd('0x50')](_0x3acd('0x59'),_0x2e39ca[_0x3acd('0x55')],_0x2b8a39[_0x3acd('0x5a')],md5(_0x2b8a39[_0x3acd('0x5a')]));if(_0x2815de&&_0x2815de['monitor_format']){logger['info'](_0x3acd('0x5b'),_0x3acd('0x5c'));_0x2b8a39['recordingURL']=_0x31e8bd;}else if(_0x30e2b9&&_0x30e2b9[_0x3acd('0x5d')]&&_0x30e2b9['recordingFormat']!==_0x3acd('0x5e')){logger[_0x3acd('0x27')](_0x3acd('0x5f'),'Recording\x20is\x20enabled!');_0x2b8a39[_0x3acd('0x60')]=_0x31e8bd;}else{_0x2b8a39['recordingURL']='';}return getUser(_0x54b37a,_0x2e39ca,_0x512aab,_0x46df5c,_0x27d793,_0x23c36e)[_0x3acd('0x16')](function(_0x3551b){logger[_0x3acd('0x27')]('['+_0x23c36e[_0x3acd('0x1a')]()+']\x20The\x20User\x20ID\x20is:',_0x3551b[_0x3acd('0x2b')]);logger[_0x3acd('0x27')]('['+_0x23c36e[_0x3acd('0x1a')]()+']\x20The\x20User\x20email\x20is:',_0x3551b[_0x3acd('0x24')]);return getEndUser(_0x3551b,_0x2e39ca,_0x46df5c,_0x27d793,_0x2b8a39,_0x23c36e,_0x2cdc43[_0x3acd('0x61')],_0x2cdc43[_0x3acd('0x62')]);})['then'](function(_0x5ec18b){logger[_0x3acd('0x27')]('['+_0x23c36e['toUpperCase']()+_0x3acd('0x63'),_0x5ec18b['enduserId']);logger[_0x3acd('0x27')]('['+_0x23c36e[_0x3acd('0x1a')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x2b8a39[_0x3acd('0x2e')]);return getTicket(_0x5ec18b,_0x2e39ca,_0x46df5c,_0x27d793,_0x2b8a39,_0x2cdc43,_0x23c36e);})[_0x3acd('0x16')](function(_0x50ef6c){logger[_0x3acd('0x27')](util[_0x3acd('0x50')]('['+_0x23c36e[_0x3acd('0x1a')]()+_0x3acd('0x64'),_0x2cdc43[_0x3acd('0x4d')],_0x50ef6c['ticketId']));logger[_0x3acd('0x27')](util[_0x3acd('0x50')]('['+_0x23c36e['toUpperCase']()+_0x3acd('0x65'),_0x23c36e));if(_0x23c36e!=='unmanaged'&&_0x2cdc43['openNewTab']){logger[_0x3acd('0x27')]('['+_0x23c36e[_0x3acd('0x1a')]()+']',_0x3acd('0x66'));emit(_0x2e39ca['remoteUri'],_0x512aab['name'],_0x2cdc43[_0x3acd('0x4d')],_0x50ef6c[_0x3acd('0x4f')]);}})[_0x3acd('0x18')](function(_0x596a79){logger[_0x3acd('0x19')]('['+_0x23c36e[_0x3acd('0x1a')]()+_0x3acd('0x67'),_0x596a79[_0x3acd('0x1c')]);console[_0x3acd('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x596a79);});}; \ No newline at end of file +var _0x572e=[']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','resolve','CloudProvider','data5','POST','clientId','username','password','then','access_token','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','outbound','destcalleridnum','calleridnum','/systemusers(','userId','Bearer\x20','body','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','customField','idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','assign','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name'];(function(_0x364597,_0x1bfb47){var _0x4cf5a3=function(_0x14245d){while(--_0x14245d){_0x364597['push'](_0x364597['shift']());}};_0x4cf5a3(++_0x1bfb47);}(_0x572e,0x71));var _0xe572=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x572e[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xe572('0x0'));var rp=require(_0xe572('0x1'));var util=require(_0xe572('0x2'));var intUtil=require(_0xe572('0x3'));var md5=require(_0xe572('0x4'));var Redis=require(_0xe572('0x5'));var logger=require(_0xe572('0x6'))(_0xe572('0x7'));var config=require(_0xe572('0x8'));config['redis']=_[_0xe572('0x9')](config[_0xe572('0xa')],{'host':_0xe572('0xb'),'port':0x18eb});var io=require(_0xe572('0xc'))(new Redis(config[_0xe572('0xa')]));function getAuthToken(_0x257f58,_0x50648a,_0x368bd7){if(_0x257f58[_0xe572('0xd')]){_0x257f58[_0xe572('0xe')]=_0x257f58['CloudProvider'][_0xe572('0xf')];_0x257f58['tenantId']=_0x257f58['CloudProvider']['data2'];return Promise[_0xe572('0x10')](_0x257f58[_0xe572('0x11')][_0xe572('0x12')]);}var _0x16d437={'method':_0xe572('0x13'),'uri':_0x50648a,'form':{'client_id':_0x257f58[_0xe572('0x14')],'resource':_0x257f58[_0xe572('0xe')],'username':_0x257f58[_0xe572('0x15')],'password':_0x257f58[_0xe572('0x16')],'grant_type':_0xe572('0x16'),'client_secret':_0x257f58['clientSecret']},'json':!![]};return rp(_0x16d437)[_0xe572('0x17')](function(_0x43afef){return _0x43afef[_0xe572('0x18')];})['catch'](function(_0x2969d9){logger[_0xe572('0x19')]('['+[_0x368bd7['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x2969d9[_0xe572('0x1a')];});}function getUser(_0x3b5f7f,_0x33519b,_0x32851a,_0x3835dc,_0x5d9925,_0x5a40bf){return new Promise(function(_0x36476d,_0x4ef558){return getAuthToken(_0x33519b,_0x3835dc,_0x5a40bf)[_0xe572('0x17')](function(_0x1fb7ba){var _0x391647={'method':_0xe572('0x1b'),'uri':_0x5d9925+_0xe572('0x1c'),'headers':{'Authorization':'Bearer\x20'+_0x1fb7ba,'OData-Version':_0xe572('0x1d')},'json':!![]};return rp(_0x391647);})[_0xe572('0x17')](function(_0x59dde9){var _0x2fb5a2=_0x59dde9[_0xe572('0x1e')];var _0x33a4e9=![];var _0x15bbee=null;if(!_['isNil'](_0x32851a)){if(intUtil[_0xe572('0x1f')](_0x32851a['email'])){_0x3b5f7f[_0xe572('0x20')]=_0x32851a[_0xe572('0x21')];for(_0x15bbee=0x0;_0x15bbee<_0x2fb5a2[_0xe572('0x22')];_0x15bbee++){if(_0x2fb5a2[_0x15bbee][_0xe572('0x23')]===_0x32851a[_0xe572('0x21')]&&!_0x2fb5a2[_0x15bbee][_0xe572('0x24')]){_0x33a4e9=!![];logger[_0xe572('0x25')]('['+[_0x5a40bf[_0xe572('0x26')]()]+_0xe572('0x27')+_0x2fb5a2[_0x15bbee][_0xe572('0x28')]+'!');_0x3b5f7f['userId']=_0x2fb5a2[_0x15bbee]['systemuserid'];}}}}if(!_0x33a4e9){logger[_0xe572('0x25')]('['+[_0x5a40bf[_0xe572('0x26')]()]+_0xe572('0x29'));_0x3b5f7f[_0xe572('0x20')]=_0x33519b[_0xe572('0x15')];for(_0x15bbee=0x0;_0x15bbee<_0x2fb5a2[_0xe572('0x22')];_0x15bbee++){if(_0x2fb5a2[_0x15bbee][_0xe572('0x23')]===_0x33519b['username']){_0x3b5f7f['userId']=_0x2fb5a2[_0x15bbee]['systemuserid'];}}}_0x36476d(_0x3b5f7f);})[_0xe572('0x2a')](function(_0x25bc3f){_0x4ef558(_0x25bc3f[_0xe572('0x1a')]);});});}function createEndUser(_0x43ff72,_0x45b977,_0x29e9a4,_0x1d8ca0,_0x115051,_0xb15f96,_0x5bd3ce){return new Promise(function(_0x30246f,_0x2fe155){return getAuthToken(_0x45b977,_0x29e9a4,_0xb15f96)[_0xe572('0x17')](function(_0x3def88){var _0x1a3e68=_0xb15f96['toLowerCase']()===_0xe572('0x2b')?_0x115051[_0xe572('0x2c')]:_0x115051[_0xe572('0x2d')];var _0x512537={'method':_0xe572('0x13'),'uri':_0x1d8ca0+'contacts','body':{'fullname':_0x1a3e68,'firstname':_0x1a3e68,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe572('0x2e')+_0x43ff72[_0xe572('0x2f')]+')'},'headers':{'Authorization':_0xe572('0x30')+_0x3def88,'OData-Version':_0xe572('0x1d')},'json':!![],'resolveWithFullResponse':!![]};_0x512537[_0xe572('0x31')][_0x5bd3ce]=_0x1a3e68;return rp(_0x512537);})[_0xe572('0x17')](function(_0x2abb91){var _0x5dc0dc=_0x2abb91['headers'][_0xe572('0x32')];var _0x4d8d42=_0x5dc0dc[_0xe572('0x33')](_0x5dc0dc[_0xe572('0x34')]('(')+0x1,_0x5dc0dc[_0xe572('0x34')](')'));_0x43ff72[_0xe572('0x35')]=_0x4d8d42;_0x30246f(_0x43ff72);})[_0xe572('0x2a')](function(_0x4b117a){_0x2fe155(_0x4b117a[_0xe572('0x1a')]);});});}function getEndUser(_0x252a6f,_0x566af8,_0x198b1f,_0x3c34e0,_0x550994,_0x3daa7c,_0x2207ea,_0x935dd6){var _0x5a2327=_0x3daa7c[_0xe572('0x36')]()===_0xe572('0x2b')?_0x550994[_0xe572('0x2c')]:_0x550994['calleridnum'];return getAuthToken(_0x566af8,_0x198b1f,_0x3daa7c)['then'](function(_0x42bfcd){_0x935dd6=_0x935dd6?_0x935dd6:_0xe572('0x37');var _0x71b35a={'method':_0xe572('0x1b'),'uri':_0x3c34e0+_0xe572('0x38')+_0x935dd6+_0xe572('0x39')+_0x935dd6+'\x20eq\x20\x27'+_0x5a2327[_0xe572('0x3a')]('+',_0xe572('0x3b'))+'\x27','headers':{'Authorization':_0xe572('0x30')+_0x42bfcd,'If-None-Match':null,'OData-Version':_0xe572('0x1d')},'json':!![]};return rp(_0x71b35a);})[_0xe572('0x17')](function(_0x16aafe){var _0x2cad16=![];if(!_0x16aafe)return _0x2cad16;var _0x1e4d7c=_0x16aafe[_0xe572('0x1e')];for(var _0x59d6a9=0x0;_0x59d6a9<_0x1e4d7c[_0xe572('0x22')];_0x59d6a9++){if(_0x1e4d7c[_0x59d6a9][_0x935dd6]===_0x5a2327){_0x2cad16=!![];_0x252a6f[_0xe572('0x35')]=_0x1e4d7c[_0x59d6a9][_0xe572('0x3c')];}}return _0x2cad16;})[_0xe572('0x17')](function(_0x154cc7){if(_0x154cc7)return _0x252a6f;if(_0x2207ea==='nothing'){logger['info']('['+[_0x3daa7c[_0xe572('0x26')]()]+_0xe572('0x3d'));return _0x252a6f;}return createEndUser(_0x252a6f,_0x566af8,_0x198b1f,_0x3c34e0,_0x550994,_0x3daa7c,_0x935dd6)[_0xe572('0x17')](function(_0x38beaf){logger['info']('['+[_0x3daa7c[_0xe572('0x26')]()]+_0xe572('0x3e'),_0x38beaf[_0xe572('0x35')]);return _0x38beaf;});});}function getCustomFields(_0x5c98a2,_0x4d0620,_0x3fc686){var _0x2bfafc={};if(_0x5c98a2[_0xe572('0x22')]>0x0){_[_0xe572('0x3f')](_0x5c98a2,function(_0x1f9ff9){if(_['includes']([_0xe572('0x40'),'picklist'],_0x1f9ff9[_0xe572('0x41')])&&_0x1f9ff9['nameField']&&!_0x1f9ff9[_0xe572('0x42')]){var _0x2218a9=_0x1f9ff9[_0xe572('0x43')]['toLowerCase']();var _0x34190d=_0x2218a9['substring'](0x0,_0x2218a9[_0xe572('0x44')]('_'));var _0x9a8da=_0x2218a9[_0xe572('0x33')](_0x2218a9[_0xe572('0x44')]('_')+0x1);if(_0x34190d===_0x3fc686){_0x2bfafc[_0x9a8da]=_0x1f9ff9[_0xe572('0x45')];}}});}return _0x2bfafc;}function getTicket(_0x515124,_0x401e58,_0x4fef54,_0x30d4da,_0x26e3c9,_0x5ed032,_0x2c9ff1){return new Promise(function(_0x347d2d,_0x527887){var _0x52cfb7;return getAuthToken(_0x401e58,_0x4fef54,_0x2c9ff1)[_0xe572('0x17')](function(_0x542c40){if(_0x5ed032[_0xe572('0x46')]===_0xe572('0x47')){_0x52cfb7={'method':_0xe572('0x13'),'uri':_0x30d4da+_0xe572('0x48'),'body':Object['assign']({},{'title':intUtil[_0xe572('0x49')](_0x5ed032[_0xe572('0x4a')],_0x26e3c9,'\x20'),'description':intUtil['getString'](_0x5ed032[_0xe572('0x4b')],_0x26e3c9,'\x0a'),'customerid_contact@odata.bind':_0x515124[_0xe572('0x35')]?_0xe572('0x4c')+_0x515124[_0xe572('0x35')]+')':undefined,'ownerid@odata.bind':_0xe572('0x2e')+_0x515124[_0xe572('0x2f')]+')','caseorigincode':'1'},getCustomFields(_0x5ed032[_0xe572('0x4d')],_0x26e3c9,_0x5ed032[_0xe572('0x46')])),'headers':{'Authorization':_0xe572('0x30')+_0x542c40,'OData-Version':_0xe572('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5ed032[_0xe572('0x46')]===_0xe572('0x4e')){var _0x1734b2=_0x515124[_0xe572('0x35')]?[{'partyid_systemuser@odata.bind':_0xe572('0x2e')+_0x515124['userId']+')','participationtypemask':_0x515124['callDirection']===_0xe572('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x515124['enduserId']+')','participationtypemask':_0x515124[_0xe572('0x50')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe572('0x2e')+_0x515124['userId']+')','participationtypemask':_0x515124['callDirection']===_0xe572('0x4f')?0x2:0x1}];_0x52cfb7={'method':_0xe572('0x13'),'uri':_0x30d4da+'phonecalls','body':Object[_0xe572('0x51')]({},{'subject':intUtil['getString'](_0x5ed032[_0xe572('0x4a')],_0x26e3c9,'\x20'),'phonenumber':String(_0x26e3c9['calleridnum']),'description':intUtil['getString'](_0x5ed032[_0xe572('0x4b')],_0x26e3c9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x515124[_0xe572('0x35')]?'/contacts('+_0x515124[_0xe572('0x35')]+')':undefined,'ownerid@odata.bind':_0xe572('0x2e')+_0x515124[_0xe572('0x2f')]+')','directioncode':_0x515124[_0xe572('0x50')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1734b2},getCustomFields(_0x5ed032[_0xe572('0x4d')],_0x26e3c9,_0x5ed032[_0xe572('0x46')])),'headers':{'Authorization':'Bearer\x20'+_0x542c40,'OData-Version':_0xe572('0x1d')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x52cfb7);})[_0xe572('0x17')](function(_0x3c04c4){var _0x5575cf=_0x3c04c4['headers']['odata-entityid'];var _0x1d51d5=_0x5575cf[_0xe572('0x33')](_0x5575cf['lastIndexOf']('(')+0x1,_0x5575cf[_0xe572('0x34')](')'));_0x515124['ticketId']=_0x1d51d5;_0x347d2d(_0x515124);})['catch'](function(_0x182d7f){_0x527887(_0x182d7f['message']);});});}function emit(_0x2bb7b7,_0x16300a,_0x55ecce,_0x3db5f7){var _0x453822={'uri':util[_0xe572('0x52')](_0xe572('0x53'),_0x2bb7b7,_0x55ecce,_0x3db5f7)};io['to'](util['format'](_0xe572('0x54'),_0x16300a))['emit'](_0xe572('0x55'),_0x453822);}exports['cs']=function(_0x310b6f,_0x2653a7,_0xfed87b,_0x1a49d7,_0x4fcc72,_0x58debb,_0x2444ce,_0x1b00dd){var _0x291af5={};_0x58debb[_0xe572('0xe')]=_0x58debb['modernAuthentication']?intUtil[_0xe572('0x56')](_0x58debb[_0xe572('0x11')][_0xe572('0xf')]):intUtil[_0xe572('0x56')](_0x58debb[_0xe572('0xe')]);_0x58debb[_0xe572('0x57')]=intUtil[_0xe572('0x56')](_0x58debb[_0xe572('0x57')]);_0x291af5[_0xe572('0x50')]=_0x1b00dd===_0xe572('0x4f')||_0x1b00dd===_0xe572('0x58')?_0xe572('0x4f'):_0xe572('0x2b');var _0x2a578d=_0x58debb[_0xe572('0xd')]?util[_0xe572('0x52')](_0xe572('0x59'),_0x58debb[_0xe572('0x11')][_0xe572('0xf')]):util[_0xe572('0x52')](_0xe572('0x59'),_0x58debb[_0xe572('0xe')]);var _0x2abb21=util[_0xe572('0x52')](_0xe572('0x5a'),_0x58debb['tenantId']);var _0x39693f=util[_0xe572('0x52')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58debb['serverUrl'],_0x2653a7['uniqueid'],md5(_0x2653a7[_0xe572('0x5b')]));if(_0x4fcc72&&_0x4fcc72[_0xe572('0x5c')]){logger[_0xe572('0x25')](_0xe572('0x5d'),'Recording\x20is\x20enabled!');_0x2653a7[_0xe572('0x5e')]=_0x39693f;}else if(_0x2444ce&&_0x2444ce[_0xe572('0x5f')]&&_0x2444ce[_0xe572('0x5f')]!=='none'){logger['info'](_0xe572('0x60'),_0xe572('0x61'));_0x2653a7[_0xe572('0x5e')]=_0x39693f;}else{_0x2653a7['recordingURL']='';}return getUser(_0x291af5,_0x58debb,_0x1a49d7,_0x2abb21,_0x2a578d,_0x1b00dd)[_0xe572('0x17')](function(_0x19afa1){logger[_0xe572('0x25')]('['+_0x1b00dd[_0xe572('0x26')]()+_0xe572('0x62'),_0x19afa1[_0xe572('0x2f')]);logger[_0xe572('0x25')]('['+_0x1b00dd['toUpperCase']()+_0xe572('0x63'),_0x19afa1[_0xe572('0x20')]);return getEndUser(_0x19afa1,_0x58debb,_0x2abb21,_0x2a578d,_0x2653a7,_0x1b00dd,_0xfed87b[_0xe572('0x64')],_0xfed87b['additionalSearchContact']);})[_0xe572('0x17')](function(_0x32a21a){logger[_0xe572('0x25')]('['+_0x1b00dd['toUpperCase']()+_0xe572('0x65'),_0x32a21a['enduserId']);logger['info']('['+_0x1b00dd[_0xe572('0x26')]()+_0xe572('0x66'),_0x2653a7[_0xe572('0x2d')]);return getTicket(_0x32a21a,_0x58debb,_0x2abb21,_0x2a578d,_0x2653a7,_0xfed87b,_0x1b00dd);})[_0xe572('0x17')](function(_0x3b1f20){logger[_0xe572('0x25')](util[_0xe572('0x52')]('['+_0x1b00dd[_0xe572('0x26')]()+_0xe572('0x67'),_0xfed87b['ticketType'],_0x3b1f20[_0xe572('0x68')]));logger[_0xe572('0x25')](util['format']('['+_0x1b00dd['toUpperCase']()+_0xe572('0x69'),_0x1b00dd));if(_0x1b00dd!=='unmanaged'&&_0xfed87b[_0xe572('0x6a')]){logger[_0xe572('0x25')]('['+_0x1b00dd[_0xe572('0x26')]()+']',_0xe572('0x6b'));emit(_0x58debb[_0xe572('0xe')],_0x1a49d7[_0xe572('0x6c')],_0xfed87b[_0xe572('0x46')],_0x3b1f20[_0xe572('0x68')]);}})['catch'](function(_0x323b46){logger[_0xe572('0x19')]('['+_0x1b00dd[_0xe572('0x26')]()+_0xe572('0x6d'),_0x323b46['message']);console[_0xe572('0x19')](_0xe572('0x6e'),_0x323b46);});}; \ 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 ed833d0..645de3d 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 _0xd176=['find','contact','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','string','idField','content','variable','variableName','customVariable','push','Variable','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','uniqueid','email','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','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','error','monitor_format','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','format','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','Agent\x20found!'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0xd176,0xe8));var _0x6d17=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xd176[_0x257a28];return _0x13bccc;};'use strict';var _=require('lodash');var rp=require(_0x6d17('0x0'));var md5=require(_0x6d17('0x1'));var util=require(_0x6d17('0x2'));var Redis=require(_0x6d17('0x3'));var intUtil=require(_0x6d17('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6d17('0x5'))(_0x6d17('0x6'));config[_0x6d17('0x7')]=_['defaults'](config[_0x6d17('0x7')],{'host':_0x6d17('0x8'),'port':0x18eb});var io=require(_0x6d17('0x9'))(new Redis(config[_0x6d17('0x7')]));var headers={'Content-Type':_0x6d17('0xa'),'Accept':_0x6d17('0xa')};function emit(_0x38e3de,_0x4352bf,_0x28a979){io['to'](_0x38e3de)[_0x6d17('0xb')](_0x4352bf,_0x28a979);}function getTicket(_0x496987,_0x210c2d,_0x32ab7c,_0x29b66e,_0x2cfc0d){logger[_0x6d17('0xc')]('Creating\x20new\x20ticket...');var _0x50bef6=_['merge']({'responder_id':_0x210c2d['id'],'requester_id':_0x32ab7c['id'],'name':util[_0x6d17('0xd')]('Caller\x20-\x20%s',_0x2cfc0d[_0x6d17('0xe')]),'phone':_0x2cfc0d[_0x6d17('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6d17('0x10')](_0x29b66e[_0x6d17('0x11')],_0x2cfc0d,'\x20'),'description':intUtil['getString'](_0x29b66e[_0x6d17('0x12')],_0x2cfc0d,'
'),'tags':getTags(_0x29b66e[_0x6d17('0x13')],_0x6d17('0x14'))},getCustomFields(_0x29b66e[_0x6d17('0x15')],_0x2cfc0d));_0x50bef6[_0x6d17('0x16')]=_['mapValues'](_[_0x6d17('0x17')](_0x50bef6[_0x6d17('0x16')],'id'),'value');return request({'uri':util[_0x6d17('0xd')](_0x6d17('0x18'),_0x496987[_0x6d17('0x19')]),'method':_0x6d17('0x1a'),'body':_0x50bef6})['then'](function(_0x573d4b){logger[_0x6d17('0xc')](_0x6d17('0x1b'));return _0x573d4b;});}function getUser(_0x5eac6e,_0x2f2551){if(intUtil[_0x6d17('0x1c')](_0x2f2551)){return request({'uri':util[_0x6d17('0xd')]('%s/api/v2/agents',_0x5eac6e[_0x6d17('0x19')]),'qs':{'email':_0x2f2551}})[_0x6d17('0x1d')](function(_0x5e8665){if(_0x5e8665[_0x6d17('0x1e')]){logger[_0x6d17('0xc')](_0x6d17('0x1f'));return _[_0x6d17('0x20')](_0x5e8665,function(_0x35073b){return _0x35073b[_0x6d17('0x21')]['email']===_0x2f2551;});}else{logger[_0x6d17('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x6d17('0xd')](_0x6d17('0x22'),_0x5eac6e[_0x6d17('0x19')])})[_0x6d17('0x1d')](function(_0x93595a){logger[_0x6d17('0xc')]('Admin\x20account\x20selected.');return _0x93595a;});}});}else{logger['info'](_0x6d17('0x23'));return request({'uri':util[_0x6d17('0xd')](_0x6d17('0x22'),_0x5eac6e[_0x6d17('0x19')])})[_0x6d17('0x1d')](function(_0xba69ab){logger[_0x6d17('0xc')]('Admin\x20account\x20selected.');return _0xba69ab;});}}function getEndUser(_0x1ea6dd,_0x22519f,_0x2036d0){logger[_0x6d17('0xc')]('Searching\x20enduser\x20with\x20phone',_0x2036d0);return request({'uri':util['format'](_0x6d17('0x24'),_0x1ea6dd['remoteUri']),'qs':{'phone':_0x2036d0}})[_0x6d17('0x1d')](function(_0x5bffc3){if(_0x5bffc3['length']){logger[_0x6d17('0xc')](_0x6d17('0x25'));return _['find'](_0x5bffc3,{'phone':_0x2036d0});}else{logger[_0x6d17('0xc')](_0x6d17('0x26'));return request({'uri':util[_0x6d17('0xd')]('%s/api/v2/contacts',_0x1ea6dd[_0x6d17('0x19')]),'method':'POST','body':{'name':_0x22519f,'phone':_0x2036d0}})[_0x6d17('0x1d')](function(_0x40a2db){logger[_0x6d17('0xc')]('Enduser\x20created.');return _0x40a2db;});}});}function getAuth(_0x4c057a){return util[_0x6d17('0xd')]('Basic\x20%s',new Buffer(_0x4c057a[_0x6d17('0x27')]+':X')['toString'](_0x6d17('0x28')));}function request(_0x2bbd4f){logger[_0x6d17('0x29')](_0x6d17('0x2a'),JSON[_0x6d17('0x2b')](_0x2bbd4f));return rp(_[_0x6d17('0x2c')](_0x2bbd4f,{'method':_0x6d17('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x4c0d68,_0x3f50d0){var _0x404922=[];if(_0x4c0d68&&_0x4c0d68['length']>0x0){_0x404922=_[_0x6d17('0x2e')](_0x4c0d68,_0x3f50d0);}return _0x404922;}function getCustomFields(_0x5e86cd,_0x4f0dcb){var _0x127a38=[];var _0x2b3ccf={'custom_fields':[]};if(_0x5e86cd[_0x6d17('0x1e')]>0x0){_[_0x6d17('0x2f')](_0x5e86cd,function(_0x57d094){if(_[_0x6d17('0x30')](['string',_0x6d17('0x31')],_0x57d094[_0x6d17('0x32')])&&_0x57d094[_0x6d17('0x33')]&&!_0x57d094[_0x6d17('0x34')]){_0x2b3ccf[_0x57d094[_0x6d17('0x33')][_0x6d17('0x35')]()]=_0x57d094['content'][_0x6d17('0x36')]();}else if(_['includes']([_0x6d17('0x37'),_0x6d17('0x31')],_0x57d094[_0x6d17('0x32')])&&_0x57d094[_0x6d17('0x38')]&&_0x57d094[_0x6d17('0x34')]){_0x2b3ccf['custom_fields']['push']({'id':_0x57d094[_0x6d17('0x38')],'value':_0x57d094[_0x6d17('0x39')][_0x6d17('0x36')]()});}else if(_0x57d094[_0x6d17('0x32')]===_0x6d17('0x3a')&&_0x57d094[_0x6d17('0x3b')]&&_0x57d094[_0x6d17('0x38')]&&_0x57d094[_0x6d17('0x34')]){_0x4f0dcb[_0x57d094[_0x6d17('0x3b')]]&&_0x2b3ccf[_0x6d17('0x16')]['push']({'id':_0x57d094['idField'],'value':_0x4f0dcb[_0x57d094['variableName']][_0x6d17('0x36')]()});}else if(_0x57d094[_0x6d17('0x32')]===_0x6d17('0x3c')&&_0x57d094['Variable']&&_0x57d094['Variable'][_0x6d17('0x14')]&&_0x57d094[_0x6d17('0x38')]&&_0x57d094[_0x6d17('0x34')]){_0x4f0dcb[_0x57d094['Variable']['name'][_0x6d17('0x35')]()]&&_0x2b3ccf[_0x6d17('0x16')][_0x6d17('0x3d')]({'id':_0x57d094[_0x6d17('0x38')],'value':_0x4f0dcb[_0x57d094[_0x6d17('0x3e')][_0x6d17('0x14')][_0x6d17('0x35')]()]['toString']()});}});}return _0x2b3ccf;}exports['queue']=function(_0x5d028e,_0x4b0a2b,_0x4ed182,_0x270eb3,_0x2b83e9,_0x126fd0){var _0x389e2b,_0x120129;_0x126fd0[_0x6d17('0x19')]=intUtil['stripTrailingSlash'](_0x126fd0[_0x6d17('0x19')]);_0x126fd0['serverUrl']=intUtil[_0x6d17('0x3f')](_0x126fd0[_0x6d17('0x40')]);if(_0x2b83e9&&_0x2b83e9['monitor_format']){logger['info'](_0x6d17('0x41'),'Recording\x20is\x20enabled!');_0x4b0a2b[_0x6d17('0x42')]=util[_0x6d17('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x126fd0[_0x6d17('0x40')],_0x4b0a2b['uniqueid'],md5(_0x4b0a2b[_0x6d17('0x43')]));}else{_0x4b0a2b[_0x6d17('0x42')]='';}headers['Authorization']=getAuth(_0x126fd0);return getUser(_0x126fd0,_0x270eb3[_0x6d17('0x44')])[_0x6d17('0x1d')](function(_0x2ae603){_0x389e2b=_0x2ae603;logger[_0x6d17('0xc')]('The\x20User\x20ID\x20is:',_0x389e2b['id']);return getEndUser(_0x126fd0,_0x4b0a2b[_0x6d17('0xe')],_0x4b0a2b[_0x6d17('0xf')]);})['then'](function(_0xa5e416){_0x120129=_0xa5e416;logger['info'](_0x6d17('0x45'),_0x120129['id']);return getTicket(_0x126fd0,_0x389e2b,_0x120129,_0x4ed182,_0x4b0a2b);})['then'](function(_0x18a1ce){if(_0x18a1ce&&_0x18a1ce['id']){logger[_0x6d17('0xc')](_0x6d17('0x1b'));logger[_0x6d17('0xc')](_0x6d17('0x46'),_0x18a1ce['id']);logger[_0x6d17('0xc')](_0x6d17('0x41'),_0x6d17('0x47'));emit(util['format'](_0x6d17('0x48'),_0x270eb3[_0x6d17('0x14')]),_0x6d17('0x49'),{'uri':util['format'](_0x6d17('0x4a'),_0x126fd0[_0x6d17('0x19')],_0x18a1ce['id'])});}})[_0x6d17('0x4b')](function(_0x481acc){logger['error']('[QUEUE]',JSON[_0x6d17('0x2b')](_0x481acc));});};exports['outbound']=function(_0x2d38ef,_0x1c0de2,_0x1b9bd1,_0x511be6,_0x43b85e,_0x242ac2,_0x471a7d){var _0xa4b5f1,_0x10202c;_0x242ac2[_0x6d17('0x19')]=intUtil[_0x6d17('0x3f')](_0x242ac2[_0x6d17('0x19')]);_0x242ac2[_0x6d17('0x40')]=intUtil['stripTrailingSlash'](_0x242ac2[_0x6d17('0x40')]);if(_0x471a7d&&_0x471a7d[_0x6d17('0x4c')]&&_0x471a7d[_0x6d17('0x4c')]!==_0x6d17('0x4d')){logger[_0x6d17('0xc')](_0x6d17('0x4e'),_0x6d17('0x4f'));_0x1c0de2[_0x6d17('0x42')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x242ac2[_0x6d17('0x40')],_0x1c0de2['uniqueid'],md5(_0x1c0de2[_0x6d17('0x43')]));}headers[_0x6d17('0x50')]=getAuth(_0x242ac2);return getUser(_0x242ac2,_0x511be6['email'])[_0x6d17('0x1d')](function(_0x4d96a1){_0xa4b5f1=_0x4d96a1;logger[_0x6d17('0xc')]('The\x20User\x20ID\x20is:',_0xa4b5f1['id']);return getEndUser(_0x242ac2,_0x1c0de2[_0x6d17('0x51')],_0x1c0de2[_0x6d17('0x52')]);})[_0x6d17('0x1d')](function(_0x30cbab){_0x10202c=_0x30cbab;logger[_0x6d17('0xc')](_0x6d17('0x45'),_0x10202c['id']);return getTicket(_0x242ac2,_0xa4b5f1,_0x10202c,_0x1b9bd1,_0x1c0de2);})[_0x6d17('0x1d')](function(_0x5de812){if(_0x5de812&&_0x5de812['id']){logger['info'](_0x6d17('0x1b'));logger[_0x6d17('0xc')](_0x6d17('0x46'),_0x5de812['id']);logger[_0x6d17('0xc')](_0x6d17('0x4e'),_0x6d17('0x47'));emit(util[_0x6d17('0xd')]('user:%s',_0x511be6[_0x6d17('0x14')]),_0x6d17('0x49'),{'uri':util[_0x6d17('0xd')](_0x6d17('0x4a'),_0x242ac2['remoteUri'],_0x5de812['id'])});}})[_0x6d17('0x4b')](function(_0x5dc70f){logger[_0x6d17('0x53')](_0x6d17('0x4e'),JSON[_0x6d17('0x2b')](_0x5dc70f));});};exports['unmanaged']=function(_0x19e998,_0x380d55,_0x122659,_0x28030b,_0x431867,_0x5d5dba){var _0x2d2e35,_0x35a1e9;_0x5d5dba[_0x6d17('0x19')]=intUtil[_0x6d17('0x3f')](_0x5d5dba['remoteUri']);_0x5d5dba[_0x6d17('0x40')]=intUtil['stripTrailingSlash'](_0x5d5dba['serverUrl']);if(_0x431867&&_0x431867[_0x6d17('0x54')]){logger[_0x6d17('0xc')]('['+_0x380d55['lastevent'][_0x6d17('0x55')]()+']',_0x6d17('0x4f'));_0x380d55[_0x6d17('0x42')]=util[_0x6d17('0xd')](_0x6d17('0x56'),_0x5d5dba['serverUrl'],_0x380d55['uniqueid'],md5(_0x380d55[_0x6d17('0x43')]));}else{_0x380d55[_0x6d17('0x42')]='';}headers[_0x6d17('0x50')]=getAuth(_0x5d5dba);return getUser(_0x5d5dba,'')[_0x6d17('0x1d')](function(_0x45d961){_0x2d2e35=_0x45d961;logger[_0x6d17('0xc')]('The\x20User\x20ID\x20is:',_0x2d2e35['id']);return getEndUser(_0x5d5dba,_0x380d55[_0x6d17('0xe')],_0x380d55[_0x6d17('0xf')]);})[_0x6d17('0x1d')](function(_0x2249f8){_0x35a1e9=_0x2249f8;logger['info'](_0x6d17('0x45'),_0x35a1e9['id']);return getTicket(_0x5d5dba,_0x2d2e35,_0x35a1e9,_0x122659,_0x380d55);})[_0x6d17('0x1d')](function(_0x20cd02){if(_0x20cd02){logger[_0x6d17('0xc')](_0x6d17('0x1b'));logger['info'](_0x6d17('0x46'),_0x20cd02['id']);}})[_0x6d17('0x4b')](function(_0x2ed086){logger['error']('['+_0x380d55[_0x6d17('0x57')][_0x6d17('0x55')]()+']',JSON['stringify'](_0x2ed086));});}; \ No newline at end of file +var _0xc47d=['Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','trigger:browser:url','toUpperCase','calleridname','lastevent','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','info','merge','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','keyBy','value','format','%s/api/v2/tickets','%s/api/v2/agents','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','remoteUri','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','string','picklist','nameField','toLowerCase','content','type','idField','push','variableName','customField','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x3a0afe,_0x24e3f6){var _0x41db6d=function(_0x134336){while(--_0x134336){_0x3a0afe['push'](_0x3a0afe['shift']());}};_0x41db6d(++_0x24e3f6);}(_0xc47d,0x1cb));var _0xdc47=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc47d[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var rp=require(_0xdc47('0x0'));var md5=require(_0xdc47('0x1'));var util=require(_0xdc47('0x2'));var Redis=require(_0xdc47('0x3'));var intUtil=require(_0xdc47('0x4'));var config=require('../../../../config/environment');var logger=require(_0xdc47('0x5'))(_0xdc47('0x6'));config[_0xdc47('0x7')]=_['defaults'](config['redis'],{'host':_0xdc47('0x8'),'port':0x18eb});var io=require(_0xdc47('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0xdc47('0xa'),'Accept':'application/json'};function emit(_0x3f83ce,_0xaaf852,_0x22d130){io['to'](_0x3f83ce)['emit'](_0xaaf852,_0x22d130);}function getTicket(_0x5defca,_0x484262,_0x355fb4,_0x21abff,_0x2b4227){logger[_0xdc47('0xb')]('Creating\x20new\x20ticket...');var _0x3ebcc0=_[_0xdc47('0xc')]({'responder_id':_0x484262['id'],'requester_id':_0x355fb4['id'],'name':util['format']('Caller\x20-\x20%s',_0x2b4227['calleridname']),'phone':_0x2b4227[_0xdc47('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdc47('0xe')](_0x21abff[_0xdc47('0xf')],_0x2b4227,'\x20'),'description':intUtil[_0xdc47('0xe')](_0x21abff[_0xdc47('0x10')],_0x2b4227,_0xdc47('0x11')),'tags':getTags(_0x21abff[_0xdc47('0x12')],'name')},getCustomFields(_0x21abff[_0xdc47('0x13')],_0x2b4227));_0x3ebcc0[_0xdc47('0x14')]=_['mapValues'](_[_0xdc47('0x15')](_0x3ebcc0[_0xdc47('0x14')],'id'),_0xdc47('0x16'));return request({'uri':util[_0xdc47('0x17')](_0xdc47('0x18'),_0x5defca['remoteUri']),'method':'POST','body':_0x3ebcc0})['then'](function(_0x380495){logger[_0xdc47('0xb')]('Ticket\x20created!');return _0x380495;});}function getUser(_0x54c938,_0x5aed0a){if(intUtil['validateEmail'](_0x5aed0a)){return request({'uri':util['format'](_0xdc47('0x19'),_0x54c938['remoteUri']),'qs':{'email':_0x5aed0a}})['then'](function(_0x706478){if(_0x706478['length']){logger[_0xdc47('0xb')](_0xdc47('0x1a'));return _[_0xdc47('0x1b')](_0x706478,function(_0x19869a){return _0x19869a[_0xdc47('0x1c')]['email']===_0x5aed0a;});}else{logger[_0xdc47('0xb')](_0xdc47('0x1d'));return request({'uri':util[_0xdc47('0x17')](_0xdc47('0x1e'),_0x54c938['remoteUri'])})[_0xdc47('0x1f')](function(_0x52b1ed){logger[_0xdc47('0xb')]('Admin\x20account\x20selected.');return _0x52b1ed;});}});}else{logger[_0xdc47('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdc47('0x17')](_0xdc47('0x1e'),_0x54c938['remoteUri'])})[_0xdc47('0x1f')](function(_0x5d8497){logger[_0xdc47('0xb')]('Admin\x20account\x20selected.');return _0x5d8497;});}}function getEndUser(_0x399f51,_0xbce3ee,_0x531d16){logger[_0xdc47('0xb')](_0xdc47('0x20'),_0x531d16);return request({'uri':util[_0xdc47('0x17')](_0xdc47('0x21'),_0x399f51['remoteUri']),'qs':{'phone':_0x531d16}})[_0xdc47('0x1f')](function(_0x902296){if(_0x902296[_0xdc47('0x22')]){logger[_0xdc47('0xb')](_0xdc47('0x23'));return _[_0xdc47('0x1b')](_0x902296,{'phone':_0x531d16});}else{logger[_0xdc47('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdc47('0x17')]('%s/api/v2/contacts',_0x399f51[_0xdc47('0x24')]),'method':'POST','body':{'name':_0xbce3ee,'phone':_0x531d16}})['then'](function(_0x216a01){logger[_0xdc47('0xb')]('Enduser\x20created.');return _0x216a01;});}});}function getAuth(_0x239175){return util[_0xdc47('0x17')](_0xdc47('0x25'),new Buffer(_0x239175['apiKey']+':X')[_0xdc47('0x26')](_0xdc47('0x27')));}function request(_0x2398dd){logger[_0xdc47('0x28')](_0xdc47('0x29'),JSON[_0xdc47('0x2a')](_0x2398dd));return rp(_['defaults'](_0x2398dd,{'method':_0xdc47('0x2b'),'headers':headers,'json':!![]}));}function getTags(_0x162c0e,_0x17e749){var _0x2e7e8d=[];if(_0x162c0e&&_0x162c0e[_0xdc47('0x22')]>0x0){_0x2e7e8d=_['map'](_0x162c0e,_0x17e749);}return _0x2e7e8d;}function getCustomFields(_0x67f3fd,_0x212530){var _0x46d674=[];var _0x505a0d={'custom_fields':[]};if(_0x67f3fd[_0xdc47('0x22')]>0x0){_[_0xdc47('0x2c')](_0x67f3fd,function(_0x1df5ce){if(_['includes']([_0xdc47('0x2d'),_0xdc47('0x2e')],_0x1df5ce['type'])&&_0x1df5ce[_0xdc47('0x2f')]&&!_0x1df5ce['customField']){_0x505a0d[_0x1df5ce[_0xdc47('0x2f')][_0xdc47('0x30')]()]=_0x1df5ce[_0xdc47('0x31')][_0xdc47('0x26')]();}else if(_['includes']([_0xdc47('0x2d'),_0xdc47('0x2e')],_0x1df5ce[_0xdc47('0x32')])&&_0x1df5ce[_0xdc47('0x33')]&&_0x1df5ce['customField']){_0x505a0d['custom_fields'][_0xdc47('0x34')]({'id':_0x1df5ce[_0xdc47('0x33')],'value':_0x1df5ce['content'][_0xdc47('0x26')]()});}else if(_0x1df5ce['type']==='variable'&&_0x1df5ce[_0xdc47('0x35')]&&_0x1df5ce[_0xdc47('0x33')]&&_0x1df5ce[_0xdc47('0x36')]){_0x212530[_0x1df5ce[_0xdc47('0x35')]]&&_0x505a0d[_0xdc47('0x14')][_0xdc47('0x34')]({'id':_0x1df5ce[_0xdc47('0x33')],'value':_0x212530[_0x1df5ce[_0xdc47('0x35')]][_0xdc47('0x26')]()});}else if(_0x1df5ce['type']===_0xdc47('0x37')&&_0x1df5ce[_0xdc47('0x38')]&&_0x1df5ce[_0xdc47('0x38')][_0xdc47('0x39')]&&_0x1df5ce[_0xdc47('0x33')]&&_0x1df5ce['customField']){_0x212530[_0x1df5ce[_0xdc47('0x38')]['name']['toLowerCase']()]&&_0x505a0d[_0xdc47('0x14')][_0xdc47('0x34')]({'id':_0x1df5ce[_0xdc47('0x33')],'value':_0x212530[_0x1df5ce[_0xdc47('0x38')]['name'][_0xdc47('0x30')]()]['toString']()});}});}return _0x505a0d;}exports[_0xdc47('0x3a')]=function(_0x4080b3,_0x452df1,_0xfc1cc,_0x21d9ec,_0x4fcebb,_0x4127cb){var _0x3d5f2e,_0x113378;_0x4127cb['remoteUri']=intUtil[_0xdc47('0x3b')](_0x4127cb[_0xdc47('0x24')]);_0x4127cb[_0xdc47('0x3c')]=intUtil['stripTrailingSlash'](_0x4127cb[_0xdc47('0x3c')]);if(_0x4fcebb&&_0x4fcebb[_0xdc47('0x3d')]){logger[_0xdc47('0xb')](_0xdc47('0x3e'),_0xdc47('0x3f'));_0x452df1['recordingURL']=util['format'](_0xdc47('0x40'),_0x4127cb['serverUrl'],_0x452df1[_0xdc47('0x41')],md5(_0x452df1[_0xdc47('0x41')]));}else{_0x452df1[_0xdc47('0x42')]='';}headers[_0xdc47('0x43')]=getAuth(_0x4127cb);return getUser(_0x4127cb,_0x21d9ec[_0xdc47('0x44')])[_0xdc47('0x1f')](function(_0x2552fe){_0x3d5f2e=_0x2552fe;logger['info'](_0xdc47('0x45'),_0x3d5f2e['id']);return getEndUser(_0x4127cb,_0x452df1['calleridname'],_0x452df1[_0xdc47('0xd')]);})[_0xdc47('0x1f')](function(_0x2691ed){_0x113378=_0x2691ed;logger[_0xdc47('0xb')](_0xdc47('0x46'),_0x113378['id']);return getTicket(_0x4127cb,_0x3d5f2e,_0x113378,_0xfc1cc,_0x452df1);})[_0xdc47('0x1f')](function(_0x4bab25){if(_0x4bab25&&_0x4bab25['id']){logger[_0xdc47('0xb')](_0xdc47('0x47'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4bab25['id']);logger[_0xdc47('0xb')](_0xdc47('0x3e'),_0xdc47('0x48'));emit(util['format'](_0xdc47('0x49'),_0x21d9ec[_0xdc47('0x39')]),'trigger:browser:url',{'uri':util[_0xdc47('0x17')](_0xdc47('0x4a'),_0x4127cb[_0xdc47('0x24')],_0x4bab25['id'])});}})[_0xdc47('0x4b')](function(_0x3953f1){logger[_0xdc47('0x4c')](_0xdc47('0x3e'),JSON[_0xdc47('0x2a')](_0x3953f1));});};exports[_0xdc47('0x4d')]=function(_0x25150c,_0x380d94,_0x32387e,_0xbeb5ae,_0x3e184a,_0x2fcbbe,_0x25649e){var _0x4bc404,_0x5677ed;_0x2fcbbe['remoteUri']=intUtil['stripTrailingSlash'](_0x2fcbbe['remoteUri']);_0x2fcbbe[_0xdc47('0x3c')]=intUtil[_0xdc47('0x3b')](_0x2fcbbe[_0xdc47('0x3c')]);if(_0x25649e&&_0x25649e[_0xdc47('0x4e')]&&_0x25649e[_0xdc47('0x4e')]!==_0xdc47('0x4f')){logger[_0xdc47('0xb')](_0xdc47('0x50'),_0xdc47('0x3f'));_0x380d94[_0xdc47('0x42')]=util[_0xdc47('0x17')](_0xdc47('0x40'),_0x2fcbbe[_0xdc47('0x3c')],_0x380d94[_0xdc47('0x41')],md5(_0x380d94[_0xdc47('0x41')]));}headers[_0xdc47('0x43')]=getAuth(_0x2fcbbe);return getUser(_0x2fcbbe,_0xbeb5ae[_0xdc47('0x44')])[_0xdc47('0x1f')](function(_0x12d3d7){_0x4bc404=_0x12d3d7;logger['info'](_0xdc47('0x45'),_0x4bc404['id']);return getEndUser(_0x2fcbbe,_0x380d94[_0xdc47('0x51')],_0x380d94['destcalleridnum']);})['then'](function(_0x30afd9){_0x5677ed=_0x30afd9;logger[_0xdc47('0xb')](_0xdc47('0x46'),_0x5677ed['id']);return getTicket(_0x2fcbbe,_0x4bc404,_0x5677ed,_0x32387e,_0x380d94);})[_0xdc47('0x1f')](function(_0x5d5f23){if(_0x5d5f23&&_0x5d5f23['id']){logger[_0xdc47('0xb')](_0xdc47('0x47'));logger[_0xdc47('0xb')](_0xdc47('0x52'),_0x5d5f23['id']);logger[_0xdc47('0xb')]('[OUTBOUND]',_0xdc47('0x48'));emit(util['format']('user:%s',_0xbeb5ae['name']),_0xdc47('0x53'),{'uri':util[_0xdc47('0x17')]('%s/helpdesk/tickets/%d',_0x2fcbbe[_0xdc47('0x24')],_0x5d5f23['id'])});}})['catch'](function(_0x5984cf){logger[_0xdc47('0x4c')](_0xdc47('0x50'),JSON[_0xdc47('0x2a')](_0x5984cf));});};exports['unmanaged']=function(_0x571d42,_0x323b1c,_0x1f7952,_0x28db2c,_0x370789,_0xb0a28e){var _0x2946cd,_0x613e88;_0xb0a28e[_0xdc47('0x24')]=intUtil[_0xdc47('0x3b')](_0xb0a28e[_0xdc47('0x24')]);_0xb0a28e[_0xdc47('0x3c')]=intUtil[_0xdc47('0x3b')](_0xb0a28e[_0xdc47('0x3c')]);if(_0x370789&&_0x370789[_0xdc47('0x3d')]){logger[_0xdc47('0xb')]('['+_0x323b1c['lastevent'][_0xdc47('0x54')]()+']',_0xdc47('0x3f'));_0x323b1c[_0xdc47('0x42')]=util[_0xdc47('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb0a28e[_0xdc47('0x3c')],_0x323b1c['uniqueid'],md5(_0x323b1c[_0xdc47('0x41')]));}else{_0x323b1c[_0xdc47('0x42')]='';}headers[_0xdc47('0x43')]=getAuth(_0xb0a28e);return getUser(_0xb0a28e,'')[_0xdc47('0x1f')](function(_0x1f8671){_0x2946cd=_0x1f8671;logger[_0xdc47('0xb')]('The\x20User\x20ID\x20is:',_0x2946cd['id']);return getEndUser(_0xb0a28e,_0x323b1c[_0xdc47('0x55')],_0x323b1c[_0xdc47('0xd')]);})[_0xdc47('0x1f')](function(_0x230e0e){_0x613e88=_0x230e0e;logger[_0xdc47('0xb')]('The\x20Enduser\x20ID\x20is:',_0x613e88['id']);return getTicket(_0xb0a28e,_0x2946cd,_0x613e88,_0x1f7952,_0x323b1c);})[_0xdc47('0x1f')](function(_0x1f88cf){if(_0x1f88cf){logger[_0xdc47('0xb')](_0xdc47('0x47'));logger[_0xdc47('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1f88cf['id']);}})[_0xdc47('0x4b')](function(_0x309e8d){logger[_0xdc47('0x4c')]('['+_0x323b1c[_0xdc47('0x56')][_0xdc47('0x54')]()+']',JSON['stringify'](_0x309e8d));});}; \ 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 93775af..9c16e4b 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 _0xfb75=['YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','ticketId','Task\x20created:','/contacts/','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','destcalleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','localhost','socket.io-emitter','redis','GET','headers','info','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','/api/selector/owners','then','agentEmail','email','userId','User\x20found:','Admin\x20selected','userEmail','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts'];(function(_0x45dc76,_0x376bb3){var _0x439965=function(_0x5108df){while(--_0x5108df){_0x45dc76['push'](_0x45dc76['shift']());}};_0x439965(++_0x376bb3);}(_0xfb75,0x1a4));var _0x5fb7=function(_0x461380,_0x3c51d1){_0x461380=_0x461380-0x0;var _0x3b9036=_0xfb75[_0x461380];return _0x3b9036;};'use strict';var _=require(_0x5fb7('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x5fb7('0x1'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x5fb7('0x2'));var intUtil=require(_0x5fb7('0x3'));var config=require(_0x5fb7('0x4'));var logger=require(_0x5fb7('0x5'))(_0x5fb7('0x6'));config['redis']=_[_0x5fb7('0x7')](config['redis'],{'host':_0x5fb7('0x8'),'port':0x18eb});var io=require(_0x5fb7('0x9'))(new Redis(config[_0x5fb7('0xa')]));function getAdminId(_0x5231ee,_0x3965a7,_0x4deef5,_0x210212){return new Promise(function(_0x401ca4,_0x16327a){var _0xf73a93=![];var _0x275d06={'method':_0x5fb7('0xb'),'uri':_0x210212+'/api/selector/owners','json':!![]};_0x275d06[_0x5fb7('0xc')]=_0x4deef5;logger[_0x5fb7('0xd')]('Getting\x20admin\x20information');return rp(_0x275d06)['then'](function(_0x4144bc){if(_0x4144bc){var _0x147640=_0x4144bc[_0x5fb7('0xe')];var _0x113499=null;for(_0x113499=0x0;_0x113499<_0x147640[_0x5fb7('0xf')];_0x113499++){if(_0x147640[_0x113499]['email']===_0x5231ee[_0x5fb7('0x10')]){_0x5231ee[_0x5fb7('0x11')]=_0x147640[_0x113499]['id'];_0xf73a93=!![];}}if(_0xf73a93){logger[_0x5fb7('0xd')]('Admin\x20found:',_0x5231ee[_0x5fb7('0x11')]);_0x401ca4(_0x5231ee);}else{_0x16327a({'statusCode':0x194,'message':_0x5fb7('0x12')});}}else{_0x16327a({'statusCode':0x194,'message':_0x5fb7('0x12')});}})[_0x5fb7('0x13')](function(_0x313734){logger[_0x5fb7('0x14')]('['+[_0x3965a7[_0x5fb7('0x15')]()]+']',_0x313734['message']);_0x16327a(_0x313734);});});}function getUser(_0x50585f,_0x2da270,_0x362d25){return function(_0x29760d){return new Promise(function(_0x294a4f,_0x38f8b7){var _0x24b54a={'method':_0x5fb7('0xb'),'uri':_0x362d25+_0x5fb7('0x16'),'json':!![]};_0x24b54a[_0x5fb7('0xc')]=_0x2da270;logger[_0x5fb7('0xd')]('Getting\x20user\x20list');return rp(_0x24b54a)[_0x5fb7('0x17')](function(_0x1cad59){if(_0x1cad59){var _0xdcfb59=_0x1cad59[_0x5fb7('0xe')];var _0x616e03=![];var _0x57e22d=null;if(_0x29760d[_0x5fb7('0x18')]!==null){logger[_0x5fb7('0xd')]('Getting\x20user\x20with\x20email',_0x29760d[_0x5fb7('0x18')]);_0x29760d['userEmail']=_0x29760d[_0x5fb7('0x18')];for(_0x57e22d=0x0;_0x57e22d<_0xdcfb59[_0x5fb7('0xf')];_0x57e22d++){if(_0xdcfb59[_0x57e22d][_0x5fb7('0x19')]===_0x29760d[_0x5fb7('0x18')]){_0x616e03=!![];_0x29760d[_0x5fb7('0x1a')]=_0xdcfb59[_0x57e22d]['id'];logger[_0x5fb7('0xd')](_0x5fb7('0x1b'),_0x29760d[_0x5fb7('0x1a')]);}}}if(!_0x616e03){logger[_0x5fb7('0xd')](_0x5fb7('0x1c'));_0x29760d[_0x5fb7('0x1d')]=_0x29760d[_0x5fb7('0x10')];_0x29760d[_0x5fb7('0x1a')]=_0x29760d[_0x5fb7('0x11')];_0x616e03=!![];}if(_0x616e03){_0x294a4f(_0x29760d);}else{_0x38f8b7({'statusCode':0x194,'message':_0x5fb7('0x12')});}}else{_0x38f8b7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0xefb260){logger[_0x5fb7('0x14')]('['+[_0x50585f[_0x5fb7('0x15')]()]+']',_0xefb260['message']);_0x38f8b7(_0xefb260);});});};}function searchContact(_0x15f248,_0xa60ce8,_0x5b22b1,_0x3ef567){return new Promise(function(_0x4e3dd3,_0x2eaf5d){var _0x46921f={'method':_0x5fb7('0xb'),'headers':_0xa60ce8,'uri':_0x15f248+'/api/lookup?q='+_0x3ef567+_0x5fb7('0x1e')+_0x5b22b1+_0x5fb7('0x1f'),'json':!![]};rp(_0x46921f)[_0x5fb7('0x17')](function(_0x35bf25){var _0x1f265f=_['find'](_0x35bf25['contacts'][_0x5fb7('0x20')],[_0x5b22b1,_0x3ef567]);_0x4e3dd3(_0x1f265f);})[_0x5fb7('0x13')](function(_0x4bd66a){_0x2eaf5d(_0x4bd66a);});});}function getEndUser(_0x2c2f57,_0x109414,_0x34dee2){return function(_0x27d569){return new Promise(function(_0x12d8b8,_0x296476){logger[_0x5fb7('0xd')](util[_0x5fb7('0x21')](_0x5fb7('0x22'),_0x27d569['contactNumber']));searchContact(_0x34dee2,_0x109414,'mobile_number',_0x27d569[_0x5fb7('0x23')])[_0x5fb7('0x17')](function(_0x4ac289){if(_0x4ac289){_0x27d569[_0x5fb7('0x24')]=_0x4ac289['id'];logger[_0x5fb7('0xd')](_0x5fb7('0x25'),_0x27d569[_0x5fb7('0x24')]);return _0x12d8b8(_0x27d569);}searchContact(_0x34dee2,_0x109414,_0x5fb7('0x26'),_0x27d569[_0x5fb7('0x23')])[_0x5fb7('0x17')](function(_0x576969){if(_0x576969){_0x27d569[_0x5fb7('0x24')]=_0x576969['id'];logger[_0x5fb7('0xd')](_0x5fb7('0x27'),_0x27d569[_0x5fb7('0x24')]);return _0x12d8b8(_0x27d569);}createEndUser(_0x27d569,_0x2c2f57,_0x109414,_0x34dee2)['then'](function(_0x1c98b6){logger[_0x5fb7('0xd')]('Contact\x20created:',_0x1c98b6[_0x5fb7('0x24')]);return _0x12d8b8(_0x1c98b6);});});})[_0x5fb7('0x13')](function(_0x367514){_0x296476(_0x367514);});});};}function createEndUser(_0x146228,_0x2f1e5c,_0x217fae,_0x528a33){return new Promise(function(_0x2d062c,_0x31307e){var _0x3acc57=moment();var _0x3a6893={'method':_0x5fb7('0x28'),'uri':_0x528a33+_0x5fb7('0x29'),'body':{'contact':{'last_name':_0x146228[_0x5fb7('0x23')],'work_number':_0x146228[_0x5fb7('0x23')],'mobile_number':_0x146228[_0x5fb7('0x23')],'owner_id':_0x146228[_0x5fb7('0x1a')],'created_at':_0x3acc57[_0x5fb7('0x21')](_0x5fb7('0x2a'))}},'json':!![]};_0x3a6893[_0x5fb7('0xc')]=_0x217fae;logger[_0x5fb7('0xd')](_0x5fb7('0x2b'));return rp(_0x3a6893)[_0x5fb7('0x17')](function(_0x1f7112){_0x146228['endUserId']=_0x1f7112[_0x5fb7('0x2c')]['id'];_0x2d062c(_0x146228);})[_0x5fb7('0x13')](function(_0x375016){logger['error']('['+[_0x2f1e5c[_0x5fb7('0x15')]()]+']',_0x375016[_0x5fb7('0x2d')]);_0x31307e(_0x375016['message']);});});}function getTicket(_0x135331,_0x4bd4e0,_0x51a2f7,_0x26e788,_0x550fcd){return function(_0x37cda3){logger[_0x5fb7('0xd')](_0x5fb7('0x2e'));return new Promise(function(_0x266518,_0x135b30){var _0x1e5dd8=moment();var _0x54f7c3={'method':_0x5fb7('0x28'),'uri':_0x51a2f7+_0x5fb7('0x2f'),'body':{'title':intUtil[_0x5fb7('0x30')](_0x26e788[_0x5fb7('0x31')],_0x550fcd,'\x20'),'description':intUtil[_0x5fb7('0x30')](_0x26e788['Descriptions'],_0x550fcd,'\x0a'),'owner_id':_0x37cda3[_0x5fb7('0x1a')],'creater_id':_0x37cda3[_0x5fb7('0x11')],'targetable_id':_0x37cda3[_0x5fb7('0x24')],'targetable_type':_0x5fb7('0x32'),'created_at':_0x1e5dd8[_0x5fb7('0x21')](_0x5fb7('0x2a')),'due_date':_0x1e5dd8['add'](0x1e,'m')[_0x5fb7('0x21')](_0x5fb7('0x2a'))},'json':!![]};_0x54f7c3[_0x5fb7('0xc')]=_0x4bd4e0;return rp(_0x54f7c3)[_0x5fb7('0x17')](function(_0x3de7da){_0x37cda3[_0x5fb7('0x33')]=_0x3de7da['task']['id'];logger[_0x5fb7('0xd')](_0x5fb7('0x34'),_0x37cda3[_0x5fb7('0x33')]);_0x266518(_0x37cda3);})[_0x5fb7('0x13')](function(_0x184d1a){logger[_0x5fb7('0x14')]('['+[_0x135331[_0x5fb7('0x15')]()]+']',_0x184d1a[_0x5fb7('0x2d')]);_0x135b30(_0x184d1a[_0x5fb7('0x2d')]);});});};}function emit(_0x70dab6,_0x2bdebb,_0x5462bd){var _0xa01b26={'uri':_0x70dab6+_0x5fb7('0x35')+_0x5462bd};io['to'](util[_0x5fb7('0x21')]('user:%s',_0x2bdebb))['emit']('trigger:browser:url',_0xa01b26);}exports['cs']=function(_0x48afe9,_0x10af5a,_0x55756,_0x5647b7,_0x4a3cca,_0x33d035,_0x4703ff,_0x38f970){var _0x26e4a5={};var _0x454db3={'Authorization':_0x5fb7('0x36')+_0x33d035[_0x5fb7('0x37')]};_0x33d035['remoteUri']=intUtil[_0x5fb7('0x38')](_0x33d035[_0x5fb7('0x39')]);_0x33d035[_0x5fb7('0x3a')]=intUtil[_0x5fb7('0x38')](_0x33d035['serverUrl']);var _0xb81951=_0x33d035['remoteUri'];_0x26e4a5[_0x5fb7('0x10')]=_0x33d035['username'];_0x26e4a5['contactNumber']=_0x38f970['toLowerCase']()==='outbound'?_0x10af5a[_0x5fb7('0x3b')]:_0x10af5a['calleridnum'];_0x26e4a5[_0x5fb7('0x3c')]=_0x38f970===_0x5fb7('0x3d')||_0x38f970==='unmanaged'?_0x5fb7('0x3d'):_0x5fb7('0x3e');if(_0x5647b7){_0x26e4a5[_0x5fb7('0x18')]=_0x5647b7['email'];}var _0x5a193e=util['format'](_0x5fb7('0x3f'),_0x33d035[_0x5fb7('0x3a')],_0x10af5a[_0x5fb7('0x40')],md5(_0x10af5a[_0x5fb7('0x40')]));if(_0x4a3cca&&_0x4a3cca[_0x5fb7('0x41')]){logger['info'](_0x5fb7('0x42'),_0x5fb7('0x43'));_0x10af5a[_0x5fb7('0x44')]=_0x5a193e;}else if(_0x4703ff&&_0x4703ff[_0x5fb7('0x45')]&&_0x4703ff[_0x5fb7('0x45')]!==_0x5fb7('0x46')){logger[_0x5fb7('0xd')](_0x5fb7('0x47'),_0x5fb7('0x43'));_0x10af5a[_0x5fb7('0x44')]=_0x5a193e;}else{_0x10af5a[_0x5fb7('0x44')]='';}return getAdminId(_0x26e4a5,_0x38f970,_0x454db3,_0xb81951)['then'](getUser(_0x38f970,_0x454db3,_0xb81951))[_0x5fb7('0x17')](getEndUser(_0x38f970,_0x454db3,_0xb81951))[_0x5fb7('0x17')](getTicket(_0x38f970,_0x454db3,_0xb81951,_0x55756,_0x10af5a))['then'](function(_0x75307b){logger[_0x5fb7('0xd')](util[_0x5fb7('0x21')](_0x5fb7('0x48'),_0x75307b[_0x5fb7('0x33')]));if(_0x38f970!==_0x5fb7('0x49')){logger[_0x5fb7('0xd')]('['+[_0x38f970[_0x5fb7('0x15')]()]+']',_0x5fb7('0x4a'));emit(_0xb81951,_0x5647b7[_0x5fb7('0x4b')],_0x75307b[_0x5fb7('0x24')]);}})[_0x5fb7('0x13')](function(_0x228583){logger['error']('['+[_0x38f970[_0x5fb7('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x5fb7('0x4c')](_0x228583,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2c66=['GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Admin\x20found:','catch','error','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','userId','Admin\x20selected','Requested\x20Resource\x20not\x20Found','toUpperCase','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','ioredis','./util','../../../../config/environment','freshsales','defaults','redis','socket.io-emitter'];(function(_0x2ea445,_0x1da228){var _0x390525=function(_0x29664b){while(--_0x29664b){_0x2ea445['push'](_0x2ea445['shift']());}};_0x390525(++_0x1da228);}(_0x2c66,0xea));var _0x62c6=function(_0x33007f,_0x4b38d2){_0x33007f=_0x33007f-0x0;var _0x10d38c=_0x2c66[_0x33007f];return _0x10d38c;};'use strict';var _=require('lodash');var rp=require(_0x62c6('0x0'));var md5=require(_0x62c6('0x1'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x62c6('0x2'));var intUtil=require(_0x62c6('0x3'));var config=require(_0x62c6('0x4'));var logger=require('../../../../config/logger')(_0x62c6('0x5'));config['redis']=_[_0x62c6('0x6')](config[_0x62c6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x62c6('0x8'))(new Redis(config[_0x62c6('0x7')]));function getAdminId(_0x1248ee,_0x1c4ede,_0x5c9706,_0x4a58b6){return new Promise(function(_0x43bfd4,_0x161345){var _0x870321=![];var _0x2119ac={'method':_0x62c6('0x9'),'uri':_0x4a58b6+_0x62c6('0xa'),'json':!![]};_0x2119ac[_0x62c6('0xb')]=_0x5c9706;logger[_0x62c6('0xc')](_0x62c6('0xd'));return rp(_0x2119ac)[_0x62c6('0xe')](function(_0x2ac5f1){if(_0x2ac5f1){var _0x3643ae=_0x2ac5f1[_0x62c6('0xf')];var _0x4c8510=null;for(_0x4c8510=0x0;_0x4c8510<_0x3643ae[_0x62c6('0x10')];_0x4c8510++){if(_0x3643ae[_0x4c8510]['email']===_0x1248ee[_0x62c6('0x11')]){_0x1248ee[_0x62c6('0x12')]=_0x3643ae[_0x4c8510]['id'];_0x870321=!![];}}if(_0x870321){logger[_0x62c6('0xc')](_0x62c6('0x13'),_0x1248ee['adminId']);_0x43bfd4(_0x1248ee);}else{_0x161345({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x161345({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x62c6('0x14')](function(_0x2f52cd){logger[_0x62c6('0x15')]('['+[_0x1c4ede['toUpperCase']()]+']',_0x2f52cd[_0x62c6('0x16')]);_0x161345(_0x2f52cd);});});}function getUser(_0x4fe268,_0x3f3801,_0x4a39ff){return function(_0x255e7a){return new Promise(function(_0x6b9eb2,_0x128ab8){var _0x46c499={'method':_0x62c6('0x9'),'uri':_0x4a39ff+_0x62c6('0xa'),'json':!![]};_0x46c499[_0x62c6('0xb')]=_0x3f3801;logger[_0x62c6('0xc')](_0x62c6('0x17'));return rp(_0x46c499)[_0x62c6('0xe')](function(_0x3cd691){if(_0x3cd691){var _0x426dad=_0x3cd691[_0x62c6('0xf')];var _0x1b55b3=![];var _0x58eb7f=null;if(_0x255e7a['agentEmail']!==null){logger['info'](_0x62c6('0x18'),_0x255e7a[_0x62c6('0x19')]);_0x255e7a[_0x62c6('0x1a')]=_0x255e7a[_0x62c6('0x19')];for(_0x58eb7f=0x0;_0x58eb7f<_0x426dad['length'];_0x58eb7f++){if(_0x426dad[_0x58eb7f][_0x62c6('0x1b')]===_0x255e7a[_0x62c6('0x19')]){_0x1b55b3=!![];_0x255e7a['userId']=_0x426dad[_0x58eb7f]['id'];logger[_0x62c6('0xc')]('User\x20found:',_0x255e7a[_0x62c6('0x1c')]);}}}if(!_0x1b55b3){logger[_0x62c6('0xc')](_0x62c6('0x1d'));_0x255e7a[_0x62c6('0x1a')]=_0x255e7a[_0x62c6('0x11')];_0x255e7a[_0x62c6('0x1c')]=_0x255e7a[_0x62c6('0x12')];_0x1b55b3=!![];}if(_0x1b55b3){_0x6b9eb2(_0x255e7a);}else{_0x128ab8({'statusCode':0x194,'message':_0x62c6('0x1e')});}}else{_0x128ab8({'statusCode':0x194,'message':_0x62c6('0x1e')});}})[_0x62c6('0x14')](function(_0x1684a4){logger[_0x62c6('0x15')]('['+[_0x4fe268[_0x62c6('0x1f')]()]+']',_0x1684a4[_0x62c6('0x16')]);_0x128ab8(_0x1684a4);});});};}function searchContact(_0x3caf79,_0x9fcbc3,_0x2a2cbf,_0x2a6c10){return new Promise(function(_0x4e6801,_0x4ca41c){var _0x26b647={'method':'GET','headers':_0x9fcbc3,'uri':_0x3caf79+'/api/lookup?q='+_0x2a6c10+'&f='+_0x2a2cbf+_0x62c6('0x20'),'json':!![]};rp(_0x26b647)[_0x62c6('0xe')](function(_0x2e03d4){var _0x12c7c9=_[_0x62c6('0x21')](_0x2e03d4[_0x62c6('0x22')][_0x62c6('0x22')],[_0x2a2cbf,_0x2a6c10]);_0x4e6801(_0x12c7c9);})[_0x62c6('0x14')](function(_0x447d89){_0x4ca41c(_0x447d89);});});}function getEndUser(_0x42213c,_0x4476cf,_0x1fc49b){return function(_0x1fcbf9){return new Promise(function(_0x596caf,_0x1d43e6){logger['info'](util[_0x62c6('0x23')](_0x62c6('0x24'),_0x1fcbf9[_0x62c6('0x25')]));searchContact(_0x1fc49b,_0x4476cf,_0x62c6('0x26'),_0x1fcbf9[_0x62c6('0x25')])[_0x62c6('0xe')](function(_0x197209){if(_0x197209){_0x1fcbf9['endUserId']=_0x197209['id'];logger['info'](_0x62c6('0x27'),_0x1fcbf9[_0x62c6('0x28')]);return _0x596caf(_0x1fcbf9);}searchContact(_0x1fc49b,_0x4476cf,_0x62c6('0x29'),_0x1fcbf9[_0x62c6('0x25')])['then'](function(_0x106d97){if(_0x106d97){_0x1fcbf9[_0x62c6('0x28')]=_0x106d97['id'];logger['info'](_0x62c6('0x2a'),_0x1fcbf9[_0x62c6('0x28')]);return _0x596caf(_0x1fcbf9);}createEndUser(_0x1fcbf9,_0x42213c,_0x4476cf,_0x1fc49b)[_0x62c6('0xe')](function(_0x7571fa){logger[_0x62c6('0xc')]('Contact\x20created:',_0x7571fa[_0x62c6('0x28')]);return _0x596caf(_0x7571fa);});});})[_0x62c6('0x14')](function(_0x278eb6){_0x1d43e6(_0x278eb6);});});};}function createEndUser(_0x155bf8,_0x3175b1,_0x4e3b74,_0x57bb3c){return new Promise(function(_0x1c6036,_0x39666c){var _0x368d76=moment();var _0x39d4a2={'method':_0x62c6('0x2b'),'uri':_0x57bb3c+_0x62c6('0x2c'),'body':{'contact':{'last_name':_0x155bf8[_0x62c6('0x25')],'work_number':_0x155bf8[_0x62c6('0x25')],'mobile_number':_0x155bf8['contactNumber'],'owner_id':_0x155bf8['userId'],'created_at':_0x368d76[_0x62c6('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x39d4a2[_0x62c6('0xb')]=_0x4e3b74;logger[_0x62c6('0xc')](_0x62c6('0x2d'));return rp(_0x39d4a2)[_0x62c6('0xe')](function(_0x5cda41){_0x155bf8[_0x62c6('0x28')]=_0x5cda41[_0x62c6('0x2e')]['id'];_0x1c6036(_0x155bf8);})['catch'](function(_0x5a2946){logger[_0x62c6('0x15')]('['+[_0x3175b1[_0x62c6('0x1f')]()]+']',_0x5a2946['message']);_0x39666c(_0x5a2946[_0x62c6('0x16')]);});});}function getTicket(_0xaecf73,_0x441936,_0x29a2a8,_0x12f910,_0x3f505c){return function(_0x28e2c2){logger[_0x62c6('0xc')](_0x62c6('0x2f'));return new Promise(function(_0x45bec9,_0x56bcc4){var _0x293eba=moment();var _0xb4456a={'method':_0x62c6('0x2b'),'uri':_0x29a2a8+_0x62c6('0x30'),'body':{'title':intUtil[_0x62c6('0x31')](_0x12f910[_0x62c6('0x32')],_0x3f505c,'\x20'),'description':intUtil[_0x62c6('0x31')](_0x12f910['Descriptions'],_0x3f505c,'\x0a'),'owner_id':_0x28e2c2[_0x62c6('0x1c')],'creater_id':_0x28e2c2['adminId'],'targetable_id':_0x28e2c2[_0x62c6('0x28')],'targetable_type':'Contact','created_at':_0x293eba[_0x62c6('0x23')](_0x62c6('0x33')),'due_date':_0x293eba[_0x62c6('0x34')](0x1e,'m')[_0x62c6('0x23')](_0x62c6('0x33'))},'json':!![]};_0xb4456a[_0x62c6('0xb')]=_0x441936;return rp(_0xb4456a)['then'](function(_0x46d7ea){_0x28e2c2[_0x62c6('0x35')]=_0x46d7ea['task']['id'];logger[_0x62c6('0xc')]('Task\x20created:',_0x28e2c2[_0x62c6('0x35')]);_0x45bec9(_0x28e2c2);})[_0x62c6('0x14')](function(_0x40f4eb){logger[_0x62c6('0x15')]('['+[_0xaecf73[_0x62c6('0x1f')]()]+']',_0x40f4eb[_0x62c6('0x16')]);_0x56bcc4(_0x40f4eb['message']);});});};}function emit(_0x3fa604,_0x1ea1b1,_0x320a42){var _0x42a8fb={'uri':_0x3fa604+_0x62c6('0x36')+_0x320a42};io['to'](util[_0x62c6('0x23')](_0x62c6('0x37'),_0x1ea1b1))[_0x62c6('0x38')](_0x62c6('0x39'),_0x42a8fb);}exports['cs']=function(_0x4bda63,_0x4662c4,_0x28374c,_0x5876e7,_0x16f207,_0x361374,_0x3483d8,_0x4a8836){var _0x41a318={};var _0x4b8500={'Authorization':_0x62c6('0x3a')+_0x361374['apiKey']};_0x361374[_0x62c6('0x3b')]=intUtil['stripTrailingSlash'](_0x361374[_0x62c6('0x3b')]);_0x361374[_0x62c6('0x3c')]=intUtil[_0x62c6('0x3d')](_0x361374[_0x62c6('0x3c')]);var _0x1ec9dd=_0x361374[_0x62c6('0x3b')];_0x41a318[_0x62c6('0x11')]=_0x361374[_0x62c6('0x3e')];_0x41a318['contactNumber']=_0x4a8836[_0x62c6('0x3f')]()==='outbound'?_0x4662c4['destcalleridnum']:_0x4662c4[_0x62c6('0x40')];_0x41a318[_0x62c6('0x41')]=_0x4a8836===_0x62c6('0x42')||_0x4a8836===_0x62c6('0x43')?_0x62c6('0x42'):'outbound';if(_0x5876e7){_0x41a318[_0x62c6('0x19')]=_0x5876e7[_0x62c6('0x1b')];}var _0x79ba4f=util[_0x62c6('0x23')](_0x62c6('0x44'),_0x361374[_0x62c6('0x3c')],_0x4662c4[_0x62c6('0x45')],md5(_0x4662c4[_0x62c6('0x45')]));if(_0x16f207&&_0x16f207[_0x62c6('0x46')]){logger[_0x62c6('0xc')](_0x62c6('0x47'),_0x62c6('0x48'));_0x4662c4[_0x62c6('0x49')]=_0x79ba4f;}else if(_0x3483d8&&_0x3483d8[_0x62c6('0x4a')]&&_0x3483d8['recordingFormat']!=='none'){logger['info'](_0x62c6('0x4b'),_0x62c6('0x48'));_0x4662c4[_0x62c6('0x49')]=_0x79ba4f;}else{_0x4662c4[_0x62c6('0x49')]='';}return getAdminId(_0x41a318,_0x4a8836,_0x4b8500,_0x1ec9dd)[_0x62c6('0xe')](getUser(_0x4a8836,_0x4b8500,_0x1ec9dd))['then'](getEndUser(_0x4a8836,_0x4b8500,_0x1ec9dd))[_0x62c6('0xe')](getTicket(_0x4a8836,_0x4b8500,_0x1ec9dd,_0x28374c,_0x4662c4))[_0x62c6('0xe')](function(_0x291cb2){logger[_0x62c6('0xc')](util[_0x62c6('0x23')](_0x62c6('0x4c'),_0x291cb2['ticketId']));if(_0x4a8836!==_0x62c6('0x43')){logger['info']('['+[_0x4a8836[_0x62c6('0x1f')]()]+']',_0x62c6('0x4d'));emit(_0x1ec9dd,_0x5876e7[_0x62c6('0x4e')],_0x291cb2[_0x62c6('0x28')]);}})[_0x62c6('0x14')](function(_0x497a04){logger[_0x62c6('0x15')]('['+[_0x4a8836[_0x62c6('0x1f')]()]+_0x62c6('0x4f'),util[_0x62c6('0x50')](_0x497a04,{'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 d2b62c4..3cd4350 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 _0xe25f=['./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue','routeId','outbound','unmanaged','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./vtiger','./servicenow'];(function(_0x26b5a0,_0x3e4fc2){var _0x11c7dc=function(_0x15b25a){while(--_0x15b25a){_0x26b5a0['push'](_0x26b5a0['shift']());}};_0x11c7dc(++_0x3e4fc2);}(_0xe25f,0x64));var _0xfe25=function(_0x59459b,_0x200eab){_0x59459b=_0x59459b-0x0;var _0x41fa22=_0xe25f[_0x59459b];return _0x41fa22;};'use strict';var _=require(_0xfe25('0x0'));var util=require(_0xfe25('0x1'));var zendesk=require(_0xfe25('0x2'));var salesforce=require(_0xfe25('0x3'));var sugarcrm=require(_0xfe25('0x4'));var freshdesk=require(_0xfe25('0x5'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0xfe25('0x6'));var servicenow=require(_0xfe25('0x7'));var dynamics365=require(_0xfe25('0x8'));var freshsales=require(_0xfe25('0x9'));var integrations=[_0xfe25('0xa'),_0xfe25('0xb'),_0xfe25('0xc'),_0xfe25('0xd'),_0xfe25('0xe'),_0xfe25('0xf'),_0xfe25('0x10'),'dynamics365','freshsales',_0xfe25('0x11')];exports[_0xfe25('0x12')]=function(_0x3501cc,_0x14829d,_0x59ae0c,_0x311b5c,_0x210baa,_0x215a0b){if(_0x59ae0c){if(_[_0xfe25('0x13')](integrations,_0x3501cc['data1'][_0xfe25('0x14')]())){try{var _0x30da87=null;var _0xf83a27='';var _0x2de7e9=_0x59ae0c[_0x3501cc[_0xfe25('0x15')][_0xfe25('0x14')]()];if(_0x2de7e9){var _0x3b2f01=_0x2de7e9[_0x3501cc['data2']];if(_0x3b2f01){var _0x247746=_[_0xfe25('0x16')](_0x3b2f01[_0xfe25('0x17')],{'id':parseInt(_0x3501cc[_0xfe25('0x18')],0xa)});if(_0x247746){if(_0x311b5c){if(_0x210baa&&_0x14829d[_0xfe25('0x19')]){_0xf83a27=_0xfe25('0x19');}else if(_0x14829d[_0xfe25('0x1a')]){_0xf83a27=_0xfe25('0x1b');}else{console['log']('EVENT\x20UNKNOWN',_0x14829d);}}else{_0xf83a27=_0xfe25('0x1c');}switch(_0x3501cc['data1']['toLowerCase']()){case _0xfe25('0xa'):zendesk[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case'salesforce':salesforce[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case'sugarcrm':sugarcrm[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case _0xfe25('0xd'):freshdesk[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case _0xfe25('0xe'):zoho[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case _0xfe25('0xf'):desk[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case _0xfe25('0x10'):vtiger[_0xf83a27](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b);break;case'freshsales':freshsales['cs'](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b,_0xf83a27);break;case _0xfe25('0x11'):servicenow['cs'](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b,_0xf83a27);break;case'dynamics365':dynamics365['cs'](_0x3501cc,_0x14829d,_0x247746,_0x311b5c,_0x210baa,_0x3b2f01,_0x215a0b,_0xf83a27);break;default:console['log']('unknown\x20integration');}}else{_0x30da87=require(_0xfe25('0x1d'))(_0x3501cc[_0xfe25('0x15')]['toLowerCase']());_0x30da87[_0xfe25('0x1e')](_0xfe25('0x1f'),util[_0xfe25('0x20')](_0xfe25('0x21'),_0x3501cc[_0xfe25('0x15')][_0xfe25('0x14')](),_0x3501cc[_0xfe25('0x18')]));}}else{_0x30da87=require(_0xfe25('0x1d'))(_0x3501cc[_0xfe25('0x15')]['toLowerCase']());_0x30da87['error'](_0xfe25('0x1f'),util['format'](_0xfe25('0x22'),_0x3501cc[_0xfe25('0x15')]['toLowerCase'](),_0x3501cc[_0xfe25('0x23')]));}}else{}}catch(_0x5768d3){console['error'](_0x5768d3);}}}}; \ No newline at end of file +var _0x8c6f=['./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','vtiger','dynamics365','freshsales','includes','data1','data2','find','data3','queue','routeId','log','unmanaged','toLowerCase','sugarcrm','freshdesk','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util'];(function(_0x56f02c,_0x3d0a76){var _0x18baf2=function(_0x5d1666){while(--_0x5d1666){_0x56f02c['push'](_0x56f02c['shift']());}};_0x18baf2(++_0x3d0a76);}(_0x8c6f,0x8b));var _0xf8c6=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x8c6f[_0x29d915];return _0x160f86;};'use strict';var _=require('lodash');var util=require(_0xf8c6('0x0'));var zendesk=require(_0xf8c6('0x1'));var salesforce=require(_0xf8c6('0x2'));var sugarcrm=require(_0xf8c6('0x3'));var freshdesk=require(_0xf8c6('0x4'));var zoho=require(_0xf8c6('0x5'));var desk=require(_0xf8c6('0x6'));var vtiger=require(_0xf8c6('0x7'));var servicenow=require(_0xf8c6('0x8'));var dynamics365=require(_0xf8c6('0x9'));var freshsales=require(_0xf8c6('0xa'));var integrations=[_0xf8c6('0xb'),_0xf8c6('0xc'),'sugarcrm','freshdesk','zoho','desk',_0xf8c6('0xd'),_0xf8c6('0xe'),_0xf8c6('0xf'),'servicenow'];exports['exec']=function(_0x3fcaf7,_0x76d8c8,_0x52c165,_0x3401ea,_0x3d4c57,_0x47f4c8){if(_0x52c165){if(_[_0xf8c6('0x10')](integrations,_0x3fcaf7['data1']['toLowerCase']())){try{var _0x22bfa0=null;var _0x15b24d='';var _0x39a281=_0x52c165[_0x3fcaf7[_0xf8c6('0x11')]['toLowerCase']()];if(_0x39a281){var _0x303add=_0x39a281[_0x3fcaf7[_0xf8c6('0x12')]];if(_0x303add){var _0x426a61=_[_0xf8c6('0x13')](_0x303add['Configurations'],{'id':parseInt(_0x3fcaf7[_0xf8c6('0x14')],0xa)});if(_0x426a61){if(_0x3401ea){if(_0x3d4c57&&_0x76d8c8[_0xf8c6('0x15')]){_0x15b24d=_0xf8c6('0x15');}else if(_0x76d8c8[_0xf8c6('0x16')]){_0x15b24d='outbound';}else{console[_0xf8c6('0x17')]('EVENT\x20UNKNOWN',_0x76d8c8);}}else{_0x15b24d=_0xf8c6('0x18');}switch(_0x3fcaf7[_0xf8c6('0x11')][_0xf8c6('0x19')]()){case _0xf8c6('0xb'):zendesk[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case'salesforce':salesforce[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case _0xf8c6('0x1a'):sugarcrm[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case _0xf8c6('0x1b'):freshdesk[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case'zoho':zoho[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case _0xf8c6('0x1c'):desk[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case _0xf8c6('0xd'):vtiger[_0x15b24d](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8);break;case _0xf8c6('0xf'):freshsales['cs'](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8,_0x15b24d);break;case'servicenow':servicenow['cs'](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8,_0x15b24d);break;case _0xf8c6('0xe'):dynamics365['cs'](_0x3fcaf7,_0x76d8c8,_0x426a61,_0x3401ea,_0x3d4c57,_0x303add,_0x47f4c8,_0x15b24d);break;default:console['log'](_0xf8c6('0x1d'));}}else{_0x22bfa0=require(_0xf8c6('0x1e'))(_0x3fcaf7['data1']['toLowerCase']());_0x22bfa0[_0xf8c6('0x1f')](_0xf8c6('0x20'),util[_0xf8c6('0x21')](_0xf8c6('0x22'),_0x3fcaf7[_0xf8c6('0x11')][_0xf8c6('0x19')](),_0x3fcaf7[_0xf8c6('0x14')]));}}else{_0x22bfa0=require(_0xf8c6('0x1e'))(_0x3fcaf7[_0xf8c6('0x11')][_0xf8c6('0x19')]());_0x22bfa0['error'](_0xf8c6('0x20'),util[_0xf8c6('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x3fcaf7['data1']['toLowerCase'](),_0x3fcaf7[_0xf8c6('0x12')]));}}else{}}catch(_0x595be8){console[_0xf8c6('0x1f')](_0x595be8);}}}}; \ 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 410e462..d75d342 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 _0x80aa=['user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Contact','contact','first','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','LastName','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','string','picklist','idField','toString','variable','variableName','Variable','name','toLowerCase','Connection','remoteUri','https://login.salesforce.com','clientId','username','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','error','[OUTBOUND]','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','socket.io-emitter','emit','assign','Subjects','getString','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','lead','endUserType','WhatId','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve'];(function(_0x1ec9d1,_0x35ecaf){var _0x4b6bc2=function(_0x2695c6){while(--_0x2695c6){_0x1ec9d1['push'](_0x1ec9d1['shift']());}};_0x4b6bc2(++_0x35ecaf);}(_0x80aa,0x1cc));var _0xa80a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80aa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa80a('0x0'));var rp=require(_0xa80a('0x1'));var moment=require('moment');var BPromise=require(_0xa80a('0x2'));var md5=require(_0xa80a('0x3'));var jsforce=require(_0xa80a('0x4'));var util=require(_0xa80a('0x5'));var Redis=require(_0xa80a('0x6'));var intUtil=require(_0xa80a('0x7'));var config=require(_0xa80a('0x8'));var logger=require(_0xa80a('0x9'))(_0xa80a('0xa'));config[_0xa80a('0xb')]=_['defaults'](config[_0xa80a('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xa80a('0xc'))(new Redis(config[_0xa80a('0xb')]));function emit(_0x402ee4,_0xad511d,_0x6e49af){io['to'](_0x402ee4)[_0xa80a('0xd')](_0xad511d,_0x6e49af);}function getTicket(_0x5c9636,_0x1301d1,_0x490f0f,_0x53661c,_0xd9991c,_0x464c5e,_0x4357af,_0x2da8b9){var _0xc67cb4=Object[_0xa80a('0xe')]({},{'OwnerId':_0x1301d1['id'],'Subject':intUtil['getString'](_0x53661c[_0xa80a('0xf')],_0xd9991c,'\x20'),'Description':intUtil[_0xa80a('0x10')](_0x53661c[_0xa80a('0x11')],_0xd9991c,'\x0a')},getCustomFields(_0x464c5e,_0xd9991c));if(_0x490f0f){if(_0x53661c[_0xa80a('0x12')]===_0xa80a('0x13')){_0xc67cb4['ActivityDate']=moment[_0xa80a('0x14')]();_0xc67cb4[_0xa80a('0x15')]=![];_0xc67cb4[_0xa80a('0x16')]=![];if(_0x490f0f['endUserType']==='contact'||_0x490f0f['endUserType']===_0xa80a('0x17')){_0xc67cb4['WhoId']=_0x490f0f['id'];}else if(_0x490f0f[_0xa80a('0x18')]==='account'){_0xc67cb4[_0xa80a('0x19')]=_0x490f0f['id'];}}else if(_0x53661c[_0xa80a('0x12')]===_0xa80a('0x1a')){if(_0x490f0f[_0xa80a('0x18')]==='contact'){_0xc67cb4[_0xa80a('0x1b')]=_0x490f0f['id'];}else if(_0x490f0f['endUserType']===_0xa80a('0x1c')){_0xc67cb4[_0xa80a('0x1d')]=_0x490f0f['id'];}else if(_0x490f0f['endUserType']==='lead'&&_0x53661c[_0xa80a('0x1e')]){_0xc67cb4[_0x53661c[_0xa80a('0x1e')]]=_0x490f0f['id'];}else{logger[_0xa80a('0x1f')](_0xa80a('0x20'));}}}return _0x4357af[_0xa80a('0x21')](_0x53661c['ticketType'])[_0xa80a('0x22')](_0xc67cb4);}function getUser(_0x504ab8,_0x591037,_0xac59fc){if(!_[_0xa80a('0x23')](_0x591037)&&intUtil[_0xa80a('0x24')](_0x591037)){var _0xb7bc23={'Email':_0x591037};var _0x2413c7={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xac59fc[_0xa80a('0x21')](_0xa80a('0x25'))[_0xa80a('0x26')](_0xb7bc23,_0x2413c7)[_0xa80a('0x27')]()[_0xa80a('0x28')](function(_0x3d6030){if(_0x3d6030[_0xa80a('0x29')]){var _0x1d69b5=_['find'](_0x3d6030,function(_0x31a72b){return _0x31a72b[_0xa80a('0x2a')]===_0x591037;});if(_0x1d69b5){logger[_0xa80a('0x1f')](_0xa80a('0x2b'),_0x591037);return BPromise['resolve']({'id':_0x1d69b5['Id'],'name':_0x1d69b5[_0xa80a('0x2c')]});}}else{logger[_0xa80a('0x1f')](_0xa80a('0x2d'),_0x591037);return _0xac59fc[_0xa80a('0x2e')]()[_0xa80a('0x28')](function(_0x2b8eec){return BPromise[_0xa80a('0x2f')]({'id':_0x2b8eec[_0xa80a('0x30')],'name':_0x2b8eec['display_name']});});}});}else{logger[_0xa80a('0x1f')](_0xa80a('0x2d'),_0x591037);return _0xac59fc[_0xa80a('0x2e')]()[_0xa80a('0x28')](function(_0x2348a5){return BPromise['resolve']({'id':_0x2348a5[_0xa80a('0x30')],'name':_0x2348a5[_0xa80a('0x31')]});});}}function getEndUser(_0x172a21,_0x1c077b,_0x25fc85,_0x3e38f2,_0x58e16c){var _0x394d1f={'$or':{'Phone':_0x3e38f2}};var _0x5ef7a6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xa80a('0x1f')](_0xa80a('0x32'),_0x3e38f2,_0x1c077b[_0xa80a('0x33')]);switch(_0x1c077b['moduleSearch']){case _0xa80a('0x34'):var _0x4ab6dc=_[_0xa80a('0x35')](_0x394d1f);if(_0x1c077b['additionalSearchContact']){var _0xb22443={};_0xb22443[_0x1c077b[_0xa80a('0x36')]]=_0x3e38f2;_[_0xa80a('0x37')](_0x4ab6dc[_0xa80a('0x38')],_0xb22443);}return _0x58e16c[_0xa80a('0x21')]('Contact')[_0xa80a('0x26')](_0x4ab6dc,_0x5ef7a6)['execute']()[_0xa80a('0x28')](function(_0x1a529e){if(_0x1a529e&&_0x1a529e[_0xa80a('0x29')]){return _0x1a529e;}else{var _0x57cada=_[_0xa80a('0x35')](_0x394d1f);if(_0x1c077b[_0xa80a('0x39')]){var _0x4502ce={};_0x4502ce[_0x1c077b[_0xa80a('0x39')]]=_0x3e38f2;_[_0xa80a('0x37')](_0x57cada['$or'],_0x4502ce);}return _0x58e16c[_0xa80a('0x21')]('Lead')['find'](_0x57cada,_0x5ef7a6);}});case _0xa80a('0x3a'):var _0x57360a=_['cloneDeep'](_0x394d1f);if(_0x1c077b['additionalSearchAccount']){var _0xb22443={};_0xb22443[_0x1c077b[_0xa80a('0x3b')]]=_0x3e38f2;_[_0xa80a('0x37')](_0x57360a['$or'],_0xb22443);}return _0x58e16c[_0xa80a('0x21')](_0xa80a('0x3c'))[_0xa80a('0x26')](_0x57360a,_0x5ef7a6)['execute']()[_0xa80a('0x28')](function(_0x2f9622){if(_0x2f9622&&_0x2f9622[_0xa80a('0x29')]){return _0x2f9622;}else{var _0xc58649=_[_0xa80a('0x35')](_0x394d1f);if(_0x1c077b[_0xa80a('0x36')]){var _0xcb8ebf={};_0xcb8ebf[_0x1c077b[_0xa80a('0x36')]]=_0x3e38f2;_[_0xa80a('0x37')](_0xc58649[_0xa80a('0x38')],_0xcb8ebf);}return _0x58e16c['sobject'](_0xa80a('0x3d'))[_0xa80a('0x26')](_0xc58649,_0x5ef7a6)[_0xa80a('0x28')](function(_0xa891ee){if(_0xa891ee&&_0xa891ee['length']){return _0xa891ee;}else{var _0x4436d7=_[_0xa80a('0x35')](_0x394d1f);if(_0x1c077b[_0xa80a('0x39')]){var _0x392cc9={};_0x392cc9[_0x1c077b[_0xa80a('0x39')]]=_0x3e38f2;_[_0xa80a('0x37')](_0x4436d7[_0xa80a('0x38')],_0x392cc9);}return _0x58e16c['sobject']('Lead')[_0xa80a('0x26')](_0x4436d7,_0x5ef7a6);}});}});case _0xa80a('0x3e'):var _0x4ab6dc=_['cloneDeep'](_0x394d1f);if(_0x1c077b['additionalSearchContact']){var _0xb22443={};_0xb22443[_0x1c077b[_0xa80a('0x36')]]=_0x3e38f2;_[_0xa80a('0x37')](_0x4ab6dc[_0xa80a('0x38')],_0xb22443);}return _0x58e16c['sobject'](_0xa80a('0x3d'))[_0xa80a('0x26')](_0x4ab6dc,_0x5ef7a6)[_0xa80a('0x27')]();case _0xa80a('0x17'):var _0xb88ab4=_['cloneDeep'](_0x394d1f);if(_0x1c077b[_0xa80a('0x39')]){var _0xb22443={};_0xb22443[_0x1c077b[_0xa80a('0x39')]]=_0x3e38f2;_[_0xa80a('0x37')](_0xb88ab4['$or'],_0xb22443);}return _0x58e16c[_0xa80a('0x21')]('Lead')[_0xa80a('0x26')](_0xb88ab4,_0x5ef7a6);case _0xa80a('0x1c'):var _0x57360a=_[_0xa80a('0x35')](_0x394d1f);if(_0x1c077b[_0xa80a('0x3b')]){var _0xb22443={};_0xb22443[_0x1c077b[_0xa80a('0x3b')]]=_0x3e38f2;_['merge'](_0x57360a[_0xa80a('0x38')],_0xb22443);}return _0x58e16c[_0xa80a('0x21')](_0xa80a('0x3c'))['find'](_0x57360a,_0x5ef7a6);default:return null;}})['then'](function(_0x148207){if(_0x148207&&_0x148207['length']){var _0x58b3bf=_[_0xa80a('0x3f')](_0x148207);if(_0x58b3bf){return BPromise[_0xa80a('0x2f')]({'id':_0x58b3bf['Id'],'name':_0x58b3bf[_0xa80a('0x2c')],'phone':_0x58b3bf['Phone'],'endUserType':_0x58b3bf['attributes'][_0xa80a('0x40')]['toLowerCase']()});}}})[_0xa80a('0x28')](function(_0x40e72b){if(_0x40e72b){logger['info'](_0xa80a('0x41'),_0x40e72b[_0xa80a('0x18')],_0x3e38f2);return BPromise[_0xa80a('0x2f')](_0x40e72b);}else{logger['info'](_0xa80a('0x42'),_0x3e38f2);var _0x24ea8c={'Phone':_0x3e38f2};if(_0x1c077b['moduleCreate']){if(_0x1c077b[_0xa80a('0x43')]===_0xa80a('0x3e')){logger[_0xa80a('0x1f')](_0xa80a('0x44'),_0x3e38f2,_0x1c077b[_0xa80a('0x43')]);_0x24ea8c['LastName']=_0x25fc85!==_0xa80a('0x45')?_0x25fc85:util[_0xa80a('0x46')]('Caller\x20-\x20%s',_0x3e38f2);}else if(_0x1c077b[_0xa80a('0x43')]===_0xa80a('0x17')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3e38f2,_0x1c077b[_0xa80a('0x43')]);_0x24ea8c[_0xa80a('0x47')]=_0x25fc85!==_0xa80a('0x45')?_0x25fc85:util[_0xa80a('0x46')](_0xa80a('0x48'),_0x3e38f2);_0x24ea8c[_0xa80a('0x49')]=_0xa80a('0x4a');}else if(_0x1c077b[_0xa80a('0x43')]===_0xa80a('0x1c')){logger[_0xa80a('0x1f')](_0xa80a('0x44'),_0x3e38f2,_0x1c077b[_0xa80a('0x43')]);_0x24ea8c[_0xa80a('0x2c')]=_0x25fc85!==''?_0x25fc85:util[_0xa80a('0x46')](_0xa80a('0x48'),_0x3e38f2);}else{return null;}}return _0x58e16c[_0xa80a('0x21')](_['upperFirst'](_0x1c077b[_0xa80a('0x43')]))['create'](_0x24ea8c)['then'](function(_0xbae55){return BPromise[_0xa80a('0x2f')]({'id':_0xbae55['id'],'endUserType':_0x1c077b['moduleCreate']});});}});}function getCustomFields(_0x5be3a0,_0x2590a6){var _0x4f3c01={};if(_0x5be3a0[_0xa80a('0x29')]>0x0){_[_0xa80a('0x4b')](_0x5be3a0,function(_0x3d5f6b){if(_[_0xa80a('0x4c')]([_0xa80a('0x4d'),_0xa80a('0x4e')],_0x3d5f6b[_0xa80a('0x40')])&&_0x3d5f6b['idField']){_0x4f3c01[_0x3d5f6b[_0xa80a('0x4f')]]=_0x3d5f6b['content'][_0xa80a('0x50')]();}else if(_0x3d5f6b['type']===_0xa80a('0x51')&&_0x3d5f6b[_0xa80a('0x52')]&&_0x3d5f6b['idField']){_0x2590a6[_0x3d5f6b['variableName']]&&(_0x4f3c01[_0x3d5f6b['idField']]=_0x2590a6[_0x3d5f6b[_0xa80a('0x52')]][_0xa80a('0x50')]());}else if(_0x3d5f6b[_0xa80a('0x40')]==='customVariable'&&_0x3d5f6b[_0xa80a('0x53')]&&_0x3d5f6b[_0xa80a('0x53')][_0xa80a('0x54')]&&_0x3d5f6b[_0xa80a('0x4f')]){_0x2590a6[_0x3d5f6b[_0xa80a('0x53')]['name'][_0xa80a('0x55')]()]&&(_0x4f3c01[_0x3d5f6b[_0xa80a('0x4f')]]=_0x2590a6[_0x3d5f6b[_0xa80a('0x53')][_0xa80a('0x54')][_0xa80a('0x55')]()][_0xa80a('0x50')]());}});}return _0x4f3c01;}function getConnection(_0x1a43b5){var _0x3871a0=_0x1a43b5['password']['concat'](_0x1a43b5['securityToken']);var _0x5391cd=new jsforce[(_0xa80a('0x56'))]({'oauth2':{'loginUrl':_0x1a43b5[_0xa80a('0x57')]||_0xa80a('0x58'),'clientId':_0x1a43b5[_0xa80a('0x59')],'clientSecret':_0x1a43b5['clientSecret']}});return _0x5391cd['login'](_0x1a43b5[_0xa80a('0x5a')],_0x3871a0)[_0xa80a('0x28')](function(){logger[_0xa80a('0x1f')]('Connection\x20established.');return _0x5391cd;});}exports[_0xa80a('0x5b')]=function(_0x361cb3,_0x226ed7,_0x4f61a7,_0x46bb15,_0x49ad94,_0xbd435e){var _0x25526b,_0x2d4f8c,_0x2d2b6e,_0x3a79d7;_0xbd435e[_0xa80a('0x5c')]=intUtil[_0xa80a('0x5d')](_0xbd435e[_0xa80a('0x5c')]);_0xbd435e['remoteUri']=intUtil[_0xa80a('0x5d')](_0xbd435e[_0xa80a('0x57')]);if(_0x49ad94&&_0x49ad94['monitor_format']){logger[_0xa80a('0x1f')](_0xa80a('0x5e'),_0xa80a('0x5f'));_0x226ed7[_0xa80a('0x60')]=util['format'](_0xa80a('0x61'),_0xbd435e[_0xa80a('0x5c')],_0x226ed7[_0xa80a('0x62')],md5(_0x226ed7[_0xa80a('0x62')]));}else{_0x226ed7['recordingURL']='';}return getConnection(_0xbd435e)[_0xa80a('0x28')](function(_0x18b533){_0x3a79d7=_0x18b533;return getUser(_0xbd435e,_0x46bb15['email'],_0x3a79d7);})[_0xa80a('0x28')](function(_0x50fda3){_0x25526b=_0x50fda3;return getEndUser(_0xbd435e,_0x4f61a7,_0x226ed7[_0xa80a('0x63')],_0x226ed7[_0xa80a('0x64')],_0x3a79d7);})[_0xa80a('0x28')](function(_0x3de30d){_0x2d4f8c=_0x3de30d;return getTicket(_0xbd435e,_0x25526b,_0x2d4f8c,_0x4f61a7,_0x226ed7,_0x4f61a7['Fields'],_0x3a79d7,_0xa80a('0x5b'));})[_0xa80a('0x28')](function(_0x1212eb){_0x2d2b6e=_0x1212eb;logger[_0xa80a('0x1f')](_0xa80a('0x65'),_0x2d2b6e['id']);logger[_0xa80a('0x1f')](_0xa80a('0x66'),_0x2d2b6e['id'],_0x46bb15['name'],_0xbd435e['type']);switch(_0xbd435e[_0xa80a('0x40')]){case _0xa80a('0x67'):emit(util[_0xa80a('0x46')](_0xa80a('0x68'),_0x46bb15[_0xa80a('0x54')]),_0xa80a('0x69'),{'recordId':_0x2d2b6e['id']});break;case _0xa80a('0x6a'):emit(util[_0xa80a('0x46')](_0xa80a('0x68'),_0x46bb15[_0xa80a('0x54')]),_0xa80a('0x6b'),{'uri':util[_0xa80a('0x46')](_0xa80a('0x6c'),_0x3a79d7[_0xa80a('0x6d')],_0x2d2b6e['id'])});break;default:logger['error'](_0xa80a('0x6e'));}})[_0xa80a('0x6f')](function(_0x2a1095){logger['error'](_0xa80a('0x5e'),_0x2a1095);});};exports[_0xa80a('0x70')]=function(_0x112d7f,_0x12b911,_0x5f263c,_0x1dcf8e,_0xfb3025,_0x3f0227,_0x22d655){var _0x3b1081,_0x2b4f7d,_0x13f489,_0x1d08ba;_0x3f0227[_0xa80a('0x5c')]=intUtil[_0xa80a('0x5d')](_0x3f0227['serverUrl']);_0x3f0227[_0xa80a('0x57')]=intUtil[_0xa80a('0x5d')](_0x3f0227[_0xa80a('0x57')]);if(_0x22d655&&_0x22d655[_0xa80a('0x71')]&&_0x22d655[_0xa80a('0x71')]!==_0xa80a('0x72')){logger['info']('[OUTBOUND]',_0xa80a('0x5f'));_0x12b911[_0xa80a('0x60')]=util[_0xa80a('0x46')](_0xa80a('0x61'),_0x3f0227[_0xa80a('0x5c')],_0x12b911[_0xa80a('0x62')],md5(_0x12b911[_0xa80a('0x62')]));}return getConnection(_0x3f0227)[_0xa80a('0x28')](function(_0x425ef4){_0x1d08ba=_0x425ef4;return getUser(_0x3f0227,_0x1dcf8e[_0xa80a('0x73')],_0x1d08ba);})[_0xa80a('0x28')](function(_0xa9bdf3){_0x3b1081=_0xa9bdf3;return getEndUser(_0x3f0227,_0x5f263c,_0x12b911[_0xa80a('0x74')],_0x12b911[_0xa80a('0x75')],_0x1d08ba);})['then'](function(_0x2d5d66){_0x2b4f7d=_0x2d5d66;return getTicket(_0x3f0227,_0x3b1081,_0x2b4f7d,_0x5f263c,_0x12b911,_0x5f263c[_0xa80a('0x76')],_0x1d08ba,_0xa80a('0x70'));})[_0xa80a('0x28')](function(_0x4205c9){_0x13f489=_0x4205c9;logger['info'](_0xa80a('0x77'),_0x13f489['id']);logger[_0xa80a('0x1f')](_0xa80a('0x78'),_0x13f489['id'],_0x1dcf8e[_0xa80a('0x54')],_0x3f0227['type']);switch(_0x3f0227['type']){case'integrationTab':emit(util[_0xa80a('0x46')](_0xa80a('0x68'),_0x1dcf8e[_0xa80a('0x54')]),_0xa80a('0x69'),{'recordId':_0x13f489['id']});break;case _0xa80a('0x6a'):emit(util[_0xa80a('0x46')](_0xa80a('0x68'),_0x1dcf8e[_0xa80a('0x54')]),_0xa80a('0x6b'),{'uri':util[_0xa80a('0x46')](_0xa80a('0x6c'),_0x1d08ba[_0xa80a('0x6d')],_0x13f489['id'])});break;default:logger[_0xa80a('0x79')](_0xa80a('0x7a'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x4b7246){logger['error'](_0xa80a('0x7a'),_0x4b7246);});};exports[_0xa80a('0x7b')]=function(_0x46e6b7,_0x1dab07,_0x41d4b7,_0x17e647,_0x1c9e41,_0x1eeaef){var _0x558ed6,_0x2da9e8,_0x42095b,_0x1bc298;_0x1eeaef[_0xa80a('0x5c')]=intUtil['stripTrailingSlash'](_0x1eeaef[_0xa80a('0x5c')]);_0x1eeaef[_0xa80a('0x57')]=intUtil[_0xa80a('0x5d')](_0x1eeaef['remoteUri']);if(_0x1c9e41&&_0x1c9e41['monitor_format']){logger['info']('['+_0x1dab07[_0xa80a('0x7c')][_0xa80a('0x7d')]()+']',_0xa80a('0x5f'));_0x1dab07[_0xa80a('0x60')]=util[_0xa80a('0x46')](_0xa80a('0x61'),_0x1eeaef[_0xa80a('0x5c')],_0x1dab07['uniqueid'],md5(_0x1dab07[_0xa80a('0x62')]));}else{_0x1dab07[_0xa80a('0x60')]='';}return getConnection(_0x1eeaef)['then'](function(_0x1393e0){_0x1bc298=_0x1393e0;if(!_[_0xa80a('0x23')](_0x17e647)){return getUser(_0x1eeaef,_0x17e647[_0xa80a('0x54')],_0x1bc298);}else{return getUser(_0x1eeaef,null,_0x1bc298);}})[_0xa80a('0x28')](function(_0x18ea56){_0x558ed6=_0x18ea56;return getEndUser(_0x1eeaef,_0x41d4b7,_0x1dab07[_0xa80a('0x63')],_0x1dab07[_0xa80a('0x64')],_0x1bc298);})[_0xa80a('0x28')](function(_0x21bcc0){_0x2da9e8=_0x21bcc0;return getTicket(_0x1eeaef,_0x558ed6,_0x2da9e8,_0x41d4b7,_0x1dab07,_0x41d4b7[_0xa80a('0x76')],_0x1bc298);})['then'](function(_0x5770af){_0x42095b=_0x5770af;logger['info']('['+_0x1dab07[_0xa80a('0x7c')][_0xa80a('0x7d')]()+']\x20Ticket\x20%s\x20created.',_0x42095b['id']);logger['info']('['+_0x1dab07[_0xa80a('0x7c')][_0xa80a('0x7d')]()+_0xa80a('0x7e'),_0x1eeaef['type']);})['catch'](function(_0x4e2dff){logger['error']('['+_0x1dab07[_0xa80a('0x7c')][_0xa80a('0x7d')]()+']',_0x4e2dff);});}; \ No newline at end of file +var _0x1462=['util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','lead','account','WhatId','Case','endUserType','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','find','execute','then','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','length','additionalSearchLead','merge','Lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','Company','','upperFirst','create','forEach','includes','string','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce'];(function(_0x3996e2,_0x5a4ed5){var _0x586f0c=function(_0x45a867){while(--_0x45a867){_0x3996e2['push'](_0x3996e2['shift']());}};_0x586f0c(++_0x5a4ed5);}(_0x1462,0x7a));var _0x2146=function(_0x5246e5,_0x376853){_0x5246e5=_0x5246e5-0x0;var _0xcaa328=_0x1462[_0x5246e5];return _0xcaa328;};'use strict';var _=require(_0x2146('0x0'));var rp=require(_0x2146('0x1'));var moment=require(_0x2146('0x2'));var BPromise=require(_0x2146('0x3'));var md5=require(_0x2146('0x4'));var jsforce=require(_0x2146('0x5'));var util=require(_0x2146('0x6'));var Redis=require(_0x2146('0x7'));var intUtil=require(_0x2146('0x8'));var config=require('../../../../config/environment');var logger=require(_0x2146('0x9'))(_0x2146('0xa'));config[_0x2146('0xb')]=_[_0x2146('0xc')](config[_0x2146('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x2146('0xd'))(new Redis(config[_0x2146('0xb')]));function emit(_0x474aeb,_0x5a02b6,_0x3687ad){io['to'](_0x474aeb)[_0x2146('0xe')](_0x5a02b6,_0x3687ad);}function getTicket(_0x450131,_0x109ef2,_0x5e820f,_0x45a472,_0x4c1aaf,_0x5b80d0,_0xa57e9c,_0x24234e){var _0x2d633d=Object[_0x2146('0xf')]({},{'OwnerId':_0x109ef2['id'],'Subject':intUtil[_0x2146('0x10')](_0x45a472[_0x2146('0x11')],_0x4c1aaf,'\x20'),'Description':intUtil[_0x2146('0x10')](_0x45a472[_0x2146('0x12')],_0x4c1aaf,'\x0a')},getCustomFields(_0x5b80d0,_0x4c1aaf));if(_0x5e820f){if(_0x45a472[_0x2146('0x13')]===_0x2146('0x14')){_0x2d633d[_0x2146('0x15')]=moment[_0x2146('0x16')]();_0x2d633d[_0x2146('0x17')]=![];_0x2d633d[_0x2146('0x18')]=![];if(_0x5e820f['endUserType']===_0x2146('0x19')||_0x5e820f['endUserType']===_0x2146('0x1a')){_0x2d633d['WhoId']=_0x5e820f['id'];}else if(_0x5e820f['endUserType']===_0x2146('0x1b')){_0x2d633d[_0x2146('0x1c')]=_0x5e820f['id'];}}else if(_0x45a472[_0x2146('0x13')]===_0x2146('0x1d')){if(_0x5e820f[_0x2146('0x1e')]===_0x2146('0x19')){_0x2d633d['ContactId']=_0x5e820f['id'];}else if(_0x5e820f[_0x2146('0x1e')]===_0x2146('0x1b')){_0x2d633d[_0x2146('0x1f')]=_0x5e820f['id'];}else if(_0x5e820f['endUserType']==='lead'&&_0x45a472['leadId']){_0x2d633d[_0x45a472[_0x2146('0x20')]]=_0x5e820f['id'];}else{logger[_0x2146('0x21')](_0x2146('0x22'));}}}return _0xa57e9c['sobject'](_0x45a472[_0x2146('0x13')])['create'](_0x2d633d);}function getUser(_0x14558b,_0x5e7934,_0x48093b){if(!_[_0x2146('0x23')](_0x5e7934)&&intUtil[_0x2146('0x24')](_0x5e7934)){var _0x273a87={'Email':_0x5e7934};var _0x13f1e6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x48093b[_0x2146('0x25')]('User')[_0x2146('0x26')](_0x273a87,_0x13f1e6)[_0x2146('0x27')]()[_0x2146('0x28')](function(_0x5155a4){if(_0x5155a4['length']){var _0x22d2c6=_[_0x2146('0x26')](_0x5155a4,function(_0x5351c0){return _0x5351c0['Email']===_0x5e7934;});if(_0x22d2c6){logger['info'](_0x2146('0x29'),_0x5e7934);return BPromise[_0x2146('0x2a')]({'id':_0x22d2c6['Id'],'name':_0x22d2c6[_0x2146('0x2b')]});}}else{logger[_0x2146('0x21')](_0x2146('0x2c'),_0x5e7934);return _0x48093b[_0x2146('0x2d')]()[_0x2146('0x28')](function(_0x38766d){return BPromise['resolve']({'id':_0x38766d[_0x2146('0x2e')],'name':_0x38766d[_0x2146('0x2f')]});});}});}else{logger[_0x2146('0x21')](_0x2146('0x2c'),_0x5e7934);return _0x48093b['identity']()[_0x2146('0x28')](function(_0x4b03b9){return BPromise[_0x2146('0x2a')]({'id':_0x4b03b9[_0x2146('0x2e')],'name':_0x4b03b9[_0x2146('0x2f')]});});}}function getEndUser(_0x5b7186,_0xe7bfbd,_0x580890,_0x89ebd2,_0x3216b9){var _0x244c58={'$or':{'Phone':_0x89ebd2}};var _0x22731a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2146('0x2a')]()[_0x2146('0x28')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x89ebd2,_0xe7bfbd[_0x2146('0x30')]);switch(_0xe7bfbd['moduleSearch']){case _0x2146('0x31'):var _0x300350=_[_0x2146('0x32')](_0x244c58);if(_0xe7bfbd[_0x2146('0x33')]){var _0x494a9e={};_0x494a9e[_0xe7bfbd[_0x2146('0x33')]]=_0x89ebd2;_['merge'](_0x300350[_0x2146('0x34')],_0x494a9e);}return _0x3216b9[_0x2146('0x25')](_0x2146('0x35'))[_0x2146('0x26')](_0x300350,_0x22731a)['execute']()[_0x2146('0x28')](function(_0x436efe){if(_0x436efe&&_0x436efe[_0x2146('0x36')]){return _0x436efe;}else{var _0x5a29a7=_[_0x2146('0x32')](_0x244c58);if(_0xe7bfbd[_0x2146('0x37')]){var _0x263c1c={};_0x263c1c[_0xe7bfbd['additionalSearchLead']]=_0x89ebd2;_[_0x2146('0x38')](_0x5a29a7['$or'],_0x263c1c);}return _0x3216b9['sobject'](_0x2146('0x39'))[_0x2146('0x26')](_0x5a29a7,_0x22731a);}});case'account_contact_lead':var _0x21c55a=_['cloneDeep'](_0x244c58);if(_0xe7bfbd[_0x2146('0x3a')]){var _0x494a9e={};_0x494a9e[_0xe7bfbd[_0x2146('0x3a')]]=_0x89ebd2;_[_0x2146('0x38')](_0x21c55a['$or'],_0x494a9e);}return _0x3216b9[_0x2146('0x25')](_0x2146('0x3b'))[_0x2146('0x26')](_0x21c55a,_0x22731a)[_0x2146('0x27')]()['then'](function(_0x2a40ce){if(_0x2a40ce&&_0x2a40ce[_0x2146('0x36')]){return _0x2a40ce;}else{var _0x556301=_['cloneDeep'](_0x244c58);if(_0xe7bfbd[_0x2146('0x33')]){var _0x864cd3={};_0x864cd3[_0xe7bfbd[_0x2146('0x33')]]=_0x89ebd2;_[_0x2146('0x38')](_0x556301[_0x2146('0x34')],_0x864cd3);}return _0x3216b9[_0x2146('0x25')]('Contact')[_0x2146('0x26')](_0x556301,_0x22731a)[_0x2146('0x28')](function(_0x3dbe16){if(_0x3dbe16&&_0x3dbe16[_0x2146('0x36')]){return _0x3dbe16;}else{var _0x253833=_[_0x2146('0x32')](_0x244c58);if(_0xe7bfbd['additionalSearchLead']){var _0x4cdcfb={};_0x4cdcfb[_0xe7bfbd[_0x2146('0x37')]]=_0x89ebd2;_[_0x2146('0x38')](_0x253833[_0x2146('0x34')],_0x4cdcfb);}return _0x3216b9['sobject'](_0x2146('0x39'))[_0x2146('0x26')](_0x253833,_0x22731a);}});}});case _0x2146('0x19'):var _0x300350=_[_0x2146('0x32')](_0x244c58);if(_0xe7bfbd['additionalSearchContact']){var _0x494a9e={};_0x494a9e[_0xe7bfbd[_0x2146('0x33')]]=_0x89ebd2;_['merge'](_0x300350['$or'],_0x494a9e);}return _0x3216b9[_0x2146('0x25')](_0x2146('0x35'))['find'](_0x300350,_0x22731a)[_0x2146('0x27')]();case _0x2146('0x1a'):var _0x21d89c=_['cloneDeep'](_0x244c58);if(_0xe7bfbd['additionalSearchLead']){var _0x494a9e={};_0x494a9e[_0xe7bfbd[_0x2146('0x37')]]=_0x89ebd2;_[_0x2146('0x38')](_0x21d89c[_0x2146('0x34')],_0x494a9e);}return _0x3216b9[_0x2146('0x25')](_0x2146('0x39'))[_0x2146('0x26')](_0x21d89c,_0x22731a);case _0x2146('0x1b'):var _0x21c55a=_[_0x2146('0x32')](_0x244c58);if(_0xe7bfbd[_0x2146('0x3a')]){var _0x494a9e={};_0x494a9e[_0xe7bfbd[_0x2146('0x3a')]]=_0x89ebd2;_['merge'](_0x21c55a[_0x2146('0x34')],_0x494a9e);}return _0x3216b9[_0x2146('0x25')](_0x2146('0x3b'))[_0x2146('0x26')](_0x21c55a,_0x22731a);default:return null;}})[_0x2146('0x28')](function(_0x43f7b1){if(_0x43f7b1&&_0x43f7b1[_0x2146('0x36')]){var _0x463f22=_['first'](_0x43f7b1);if(_0x463f22){return BPromise[_0x2146('0x2a')]({'id':_0x463f22['Id'],'name':_0x463f22[_0x2146('0x2b')],'phone':_0x463f22[_0x2146('0x3c')],'endUserType':_0x463f22[_0x2146('0x3d')][_0x2146('0x3e')][_0x2146('0x3f')]()});}}})['then'](function(_0x2cc3b3){if(_0x2cc3b3){logger[_0x2146('0x21')](_0x2146('0x40'),_0x2cc3b3[_0x2146('0x1e')],_0x89ebd2);return BPromise[_0x2146('0x2a')](_0x2cc3b3);}else{logger[_0x2146('0x21')](_0x2146('0x41'),_0x89ebd2);var _0x30ab2e={'Phone':_0x89ebd2};if(_0xe7bfbd[_0x2146('0x42')]){if(_0xe7bfbd['moduleCreate']==='contact'){logger['info'](_0x2146('0x43'),_0x89ebd2,_0xe7bfbd[_0x2146('0x42')]);_0x30ab2e[_0x2146('0x44')]=_0x580890!==''?_0x580890:util[_0x2146('0x45')](_0x2146('0x46'),_0x89ebd2);}else if(_0xe7bfbd[_0x2146('0x42')]===_0x2146('0x1a')){logger[_0x2146('0x21')](_0x2146('0x43'),_0x89ebd2,_0xe7bfbd['moduleCreate']);_0x30ab2e[_0x2146('0x44')]=_0x580890!==''?_0x580890:util[_0x2146('0x45')](_0x2146('0x46'),_0x89ebd2);_0x30ab2e[_0x2146('0x47')]='No\x20Company';}else if(_0xe7bfbd[_0x2146('0x42')]===_0x2146('0x1b')){logger[_0x2146('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x89ebd2,_0xe7bfbd[_0x2146('0x42')]);_0x30ab2e['Name']=_0x580890!==_0x2146('0x48')?_0x580890:util[_0x2146('0x45')](_0x2146('0x46'),_0x89ebd2);}else{return null;}}return _0x3216b9['sobject'](_[_0x2146('0x49')](_0xe7bfbd[_0x2146('0x42')]))[_0x2146('0x4a')](_0x30ab2e)['then'](function(_0x17a852){return BPromise[_0x2146('0x2a')]({'id':_0x17a852['id'],'endUserType':_0xe7bfbd[_0x2146('0x42')]});});}});}function getCustomFields(_0x15462f,_0x556e28){var _0x201764={};if(_0x15462f[_0x2146('0x36')]>0x0){_[_0x2146('0x4b')](_0x15462f,function(_0xf56828){if(_[_0x2146('0x4c')]([_0x2146('0x4d'),'picklist'],_0xf56828['type'])&&_0xf56828[_0x2146('0x4e')]){_0x201764[_0xf56828[_0x2146('0x4e')]]=_0xf56828[_0x2146('0x4f')][_0x2146('0x50')]();}else if(_0xf56828[_0x2146('0x3e')]===_0x2146('0x51')&&_0xf56828[_0x2146('0x52')]&&_0xf56828['idField']){_0x556e28[_0xf56828[_0x2146('0x52')]]&&(_0x201764[_0xf56828['idField']]=_0x556e28[_0xf56828[_0x2146('0x52')]][_0x2146('0x50')]());}else if(_0xf56828[_0x2146('0x3e')]==='customVariable'&&_0xf56828[_0x2146('0x53')]&&_0xf56828[_0x2146('0x53')][_0x2146('0x54')]&&_0xf56828[_0x2146('0x4e')]){_0x556e28[_0xf56828[_0x2146('0x53')]['name'][_0x2146('0x3f')]()]&&(_0x201764[_0xf56828['idField']]=_0x556e28[_0xf56828[_0x2146('0x53')]['name'][_0x2146('0x3f')]()][_0x2146('0x50')]());}});}return _0x201764;}function getConnection(_0x543011){var _0x53ddd6=_0x543011[_0x2146('0x55')][_0x2146('0x56')](_0x543011[_0x2146('0x57')]);var _0x22c8e2=new jsforce[(_0x2146('0x58'))]({'oauth2':{'loginUrl':_0x543011[_0x2146('0x59')]||_0x2146('0x5a'),'clientId':_0x543011[_0x2146('0x5b')],'clientSecret':_0x543011[_0x2146('0x5c')]}});return _0x22c8e2['login'](_0x543011['username'],_0x53ddd6)[_0x2146('0x28')](function(){logger[_0x2146('0x21')](_0x2146('0x5d'));return _0x22c8e2;});}exports[_0x2146('0x5e')]=function(_0x1e2b9b,_0xa320a4,_0x56d01c,_0x4f9844,_0x39ba1d,_0x5754e6){var _0x3e9196,_0x58eb57,_0x4809cf,_0x159545;_0x5754e6['serverUrl']=intUtil['stripTrailingSlash'](_0x5754e6[_0x2146('0x5f')]);_0x5754e6[_0x2146('0x59')]=intUtil[_0x2146('0x60')](_0x5754e6[_0x2146('0x59')]);if(_0x39ba1d&&_0x39ba1d['monitor_format']){logger[_0x2146('0x21')](_0x2146('0x61'),'Recording\x20is\x20enabled!');_0xa320a4[_0x2146('0x62')]=util[_0x2146('0x45')](_0x2146('0x63'),_0x5754e6[_0x2146('0x5f')],_0xa320a4[_0x2146('0x64')],md5(_0xa320a4[_0x2146('0x64')]));}else{_0xa320a4['recordingURL']='';}return getConnection(_0x5754e6)[_0x2146('0x28')](function(_0x59ba29){_0x159545=_0x59ba29;return getUser(_0x5754e6,_0x4f9844[_0x2146('0x65')],_0x159545);})[_0x2146('0x28')](function(_0x50c4df){_0x3e9196=_0x50c4df;return getEndUser(_0x5754e6,_0x56d01c,_0xa320a4[_0x2146('0x66')],_0xa320a4[_0x2146('0x67')],_0x159545);})[_0x2146('0x28')](function(_0x2414c8){_0x58eb57=_0x2414c8;return getTicket(_0x5754e6,_0x3e9196,_0x58eb57,_0x56d01c,_0xa320a4,_0x56d01c['Fields'],_0x159545,_0x2146('0x5e'));})[_0x2146('0x28')](function(_0x28e238){_0x4809cf=_0x28e238;logger[_0x2146('0x21')](_0x2146('0x68'),_0x4809cf['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4809cf['id'],_0x4f9844[_0x2146('0x54')],_0x5754e6[_0x2146('0x3e')]);switch(_0x5754e6[_0x2146('0x3e')]){case _0x2146('0x69'):emit(util[_0x2146('0x45')](_0x2146('0x6a'),_0x4f9844[_0x2146('0x54')]),_0x2146('0x6b'),{'recordId':_0x4809cf['id']});break;case _0x2146('0x6c'):emit(util[_0x2146('0x45')](_0x2146('0x6a'),_0x4f9844[_0x2146('0x54')]),_0x2146('0x6d'),{'uri':util['format'](_0x2146('0x6e'),_0x159545[_0x2146('0x6f')],_0x4809cf['id'])});break;default:logger[_0x2146('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x2146('0x71')](function(_0x4a7073){logger[_0x2146('0x70')](_0x2146('0x61'),_0x4a7073);});};exports['outbound']=function(_0x409bd6,_0x32dcdc,_0x37592e,_0x14fa8a,_0x58a5f5,_0x292e62,_0x50da78){var _0x1f23fd,_0x6630b,_0x3c6a49,_0x39970f;_0x292e62['serverUrl']=intUtil[_0x2146('0x60')](_0x292e62[_0x2146('0x5f')]);_0x292e62[_0x2146('0x59')]=intUtil[_0x2146('0x60')](_0x292e62['remoteUri']);if(_0x50da78&&_0x50da78[_0x2146('0x72')]&&_0x50da78[_0x2146('0x72')]!==_0x2146('0x73')){logger[_0x2146('0x21')](_0x2146('0x74'),_0x2146('0x75'));_0x32dcdc['recordingURL']=util[_0x2146('0x45')](_0x2146('0x63'),_0x292e62[_0x2146('0x5f')],_0x32dcdc[_0x2146('0x64')],md5(_0x32dcdc[_0x2146('0x64')]));}return getConnection(_0x292e62)['then'](function(_0x2d7dd8){_0x39970f=_0x2d7dd8;return getUser(_0x292e62,_0x14fa8a[_0x2146('0x65')],_0x39970f);})['then'](function(_0x203d3b){_0x1f23fd=_0x203d3b;return getEndUser(_0x292e62,_0x37592e,_0x32dcdc[_0x2146('0x76')],_0x32dcdc['destcalleridnum'],_0x39970f);})[_0x2146('0x28')](function(_0x33149d){_0x6630b=_0x33149d;return getTicket(_0x292e62,_0x1f23fd,_0x6630b,_0x37592e,_0x32dcdc,_0x37592e[_0x2146('0x77')],_0x39970f,_0x2146('0x78'));})[_0x2146('0x28')](function(_0x25235c){_0x3c6a49=_0x25235c;logger[_0x2146('0x21')](_0x2146('0x79'),_0x3c6a49['id']);logger['info'](_0x2146('0x7a'),_0x3c6a49['id'],_0x14fa8a[_0x2146('0x54')],_0x292e62[_0x2146('0x3e')]);switch(_0x292e62['type']){case _0x2146('0x69'):emit(util[_0x2146('0x45')](_0x2146('0x6a'),_0x14fa8a[_0x2146('0x54')]),_0x2146('0x6b'),{'recordId':_0x3c6a49['id']});break;case _0x2146('0x6c'):emit(util[_0x2146('0x45')](_0x2146('0x6a'),_0x14fa8a[_0x2146('0x54')]),_0x2146('0x6d'),{'uri':util[_0x2146('0x45')](_0x2146('0x6e'),_0x39970f['instanceUrl'],_0x3c6a49['id'])});break;default:logger[_0x2146('0x70')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x2146('0x71')](function(_0x51f9c7){logger[_0x2146('0x70')](_0x2146('0x74'),_0x51f9c7);});};exports[_0x2146('0x7b')]=function(_0x34f8d3,_0x20246c,_0x22ac72,_0x33a5b4,_0x498e40,_0x2af254){var _0x4bb47e,_0xc30a31,_0x226901,_0x5a0598;_0x2af254[_0x2146('0x5f')]=intUtil['stripTrailingSlash'](_0x2af254[_0x2146('0x5f')]);_0x2af254['remoteUri']=intUtil[_0x2146('0x60')](_0x2af254['remoteUri']);if(_0x498e40&&_0x498e40[_0x2146('0x7c')]){logger[_0x2146('0x21')]('['+_0x20246c[_0x2146('0x7d')][_0x2146('0x7e')]()+']','Recording\x20is\x20enabled!');_0x20246c[_0x2146('0x62')]=util[_0x2146('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2af254[_0x2146('0x5f')],_0x20246c[_0x2146('0x64')],md5(_0x20246c[_0x2146('0x64')]));}else{_0x20246c['recordingURL']='';}return getConnection(_0x2af254)[_0x2146('0x28')](function(_0x1d0955){_0x5a0598=_0x1d0955;if(!_[_0x2146('0x23')](_0x33a5b4)){return getUser(_0x2af254,_0x33a5b4[_0x2146('0x54')],_0x5a0598);}else{return getUser(_0x2af254,null,_0x5a0598);}})[_0x2146('0x28')](function(_0x214240){_0x4bb47e=_0x214240;return getEndUser(_0x2af254,_0x22ac72,_0x20246c[_0x2146('0x66')],_0x20246c[_0x2146('0x67')],_0x5a0598);})[_0x2146('0x28')](function(_0x21ec2f){_0xc30a31=_0x21ec2f;return getTicket(_0x2af254,_0x4bb47e,_0xc30a31,_0x22ac72,_0x20246c,_0x22ac72[_0x2146('0x77')],_0x5a0598);})['then'](function(_0x130cf6){_0x226901=_0x130cf6;logger[_0x2146('0x21')]('['+_0x20246c[_0x2146('0x7d')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x226901['id']);logger['info']('['+_0x20246c[_0x2146('0x7d')][_0x2146('0x7e')]()+_0x2146('0x7f'),_0x2af254[_0x2146('0x3e')]);})['catch'](function(_0x136655){logger[_0x2146('0x70')]('['+_0x20246c['lastevent'][_0x2146('0x7e')]()+']',_0x136655);});}; \ 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 4646ef6..1275530 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 _0x23f0=['remoteUri','serverUrl','%s/api/now/table/','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','./util','../../../../config/logger','servicenow','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','length','result','sys_id','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','info','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminId','sys_user?','endUserNumber','user','System','endUserId','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','toString','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','stripTrailingSlash'];(function(_0xcfb8da,_0x5bc5ea){var _0x401156=function(_0x371187){while(--_0x371187){_0xcfb8da['push'](_0xcfb8da['shift']());}};_0x401156(++_0x5bc5ea);}(_0x23f0,0xe8));var _0x023f=function(_0x28e3cc,_0x4068b8){_0x28e3cc=_0x28e3cc-0x0;var _0x3f3b80=_0x23f0[_0x28e3cc];return _0x3f3b80;};'use strict';var _=require(_0x023f('0x0'));var Promise=require(_0x023f('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x023f('0x2'));var Redis=require('ioredis');var intUtil=require(_0x023f('0x3'));var config=require('../../../../config/environment');var logger=require(_0x023f('0x4'))(_0x023f('0x5'));config[_0x023f('0x6')]=_['defaults'](config[_0x023f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x023f('0x7'))(new Redis(config['redis']));function getAdminUser(_0x3162e2,_0x30b266,_0x146f35,_0x4b6c93,_0xaa6d47,_0x5bfb71){return new Promise(function(_0x3bf6a1,_0x1f93ae){var _0x281d98={'method':_0x023f('0x8'),'uri':_0x4b6c93+_0x023f('0x9')+'&'+_0xaa6d47+'&'+_0x5bfb71,'auth':_0x30b266,'json':!![]};return rp(_0x281d98)['then'](function(_0x45d361){if(_0x45d361['result'][_0x023f('0xa')]>0x0){_0x146f35['adminId']=_0x45d361[_0x023f('0xb')][0x0][_0x023f('0xc')];}logger['info']('['+[_0x3162e2['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x146f35);_0x3bf6a1(_0x146f35);})['catch'](function(_0xc9c5d3){logger['error']('['+[_0x3162e2[_0x023f('0xd')]()]+']',_0xc9c5d3[_0x023f('0xe')]);_0x1f93ae(_0xc9c5d3[_0x023f('0xe')]);});});}function getUser(_0x2deb52,_0x257bdf,_0x4ed06a,_0x307069,_0x44d208){return function(_0x5710b0){logger['info']('['+[_0x2deb52['toUpperCase']()]+_0x023f('0xf'),_0x5710b0);return new Promise(function(_0xde2c6b,_0x2ecd92){if(intUtil[_0x023f('0x10')](_0x5710b0[_0x023f('0x11')])){var _0x496134={'method':_0x023f('0x8'),'uri':_0x4ed06a+_0x023f('0x12')+_0x5710b0['userEmail']+'&'+_0x307069+'&'+_0x44d208,'auth':_0x257bdf,'json':!![]};logger[_0x023f('0x13')]('['+[_0x2deb52[_0x023f('0xd')]()]+_0x023f('0x14'),_0x496134);return rp(_0x496134)[_0x023f('0x15')](function(_0x2d0fcd){logger[_0x023f('0x13')]('['+[_0x2deb52[_0x023f('0xd')]()]+_0x023f('0x16'),_0x2d0fcd);if(_0x2d0fcd[_0x023f('0xb')][_0x023f('0xa')]>0x0&&String(_0x2d0fcd[_0x023f('0xb')][0x0][_0x023f('0x17')])===_0x023f('0x18')){_0x5710b0['userId']=_0x2d0fcd['result'][0x0][_0x023f('0xc')];}else{_0x5710b0[_0x023f('0x19')]=_0x5710b0['adminId'];_0x5710b0[_0x023f('0x11')]=_0x5710b0[_0x023f('0x1a')];}logger['info']('['+[_0x2deb52[_0x023f('0xd')]()]+_0x023f('0x1b'),_0x5710b0);_0xde2c6b(_0x5710b0);})['catch'](function(_0x5d0445){logger[_0x023f('0x1c')]('['+[_0x2deb52[_0x023f('0xd')]()]+']',_0x5d0445['message']);_0x2ecd92(_0x5d0445[_0x023f('0xe')]);});}else{logger[_0x023f('0x13')]('['+[_0x2deb52['toUpperCase']()]+_0x023f('0x1d'));_0x5710b0[_0x023f('0x19')]=_0x5710b0[_0x023f('0x1e')];_0x5710b0[_0x023f('0x11')]=_0x5710b0['adminEmail'];_0xde2c6b(_0x5710b0);}});};}function createEndUser(_0x3ee07e,_0xe3115,_0x21d66e,_0x94f29,_0x29fe7e){logger[_0x023f('0x13')]('['+[_0x3ee07e[_0x023f('0xd')]()]+'],\x20createEndUser\x20input\x20crm',_0x21d66e);return new Promise(function(_0x10c040,_0x5690a5){var _0x32157e={'method':'POST','uri':_0x94f29+_0x023f('0x1f')+_0x29fe7e,'body':{'user_name':_0x21d66e[_0x023f('0x20')],'roles':_0x023f('0x21'),'first_name':_0x21d66e['endUserNumber'],'active':_0x023f('0x18'),'date_format':_0x023f('0x22'),'phone':_0x21d66e[_0x023f('0x20')]},'auth':_0xe3115,'json':!![]};return rp(_0x32157e)[_0x023f('0x15')](function(_0x16fa0a){logger[_0x023f('0x13')]('['+[_0x3ee07e['toUpperCase']()]+'],\x20EndUser\x20schema',_0x16fa0a[_0x023f('0xb')]);_0x21d66e[_0x023f('0x23')]=_0x16fa0a[_0x023f('0xb')][_0x023f('0xc')];_0x10c040(_0x21d66e);})[_0x023f('0x24')](function(_0x45030f){logger[_0x023f('0x1c')]('['+[_0x3ee07e['toUpperCase']()]+']',_0x45030f[_0x023f('0xe')]);_0x5690a5(_0x45030f[_0x023f('0xe')]);});});}function getEndUser(_0x3f44c6,_0x112825,_0x2fc94a,_0x20b29a,_0x3aba58){return function(_0x4425e7){logger[_0x023f('0x13')]('['+[_0x3f44c6[_0x023f('0xd')]()]+_0x023f('0x25'),_0x4425e7);return new Promise(function(_0x2bd6b8,_0x4baa9f){var _0x1212ec={'method':_0x023f('0x8'),'uri':_0x2fc94a+_0x023f('0x26')+_0x4425e7[_0x023f('0x20')]+'&'+_0x20b29a+'&'+_0x3aba58,'auth':_0x112825,'json':!![]};return rp(_0x1212ec)['then'](function(_0x121f60){if(_0x121f60[_0x023f('0xb')][_0x023f('0xa')]>0x0){_0x4425e7[_0x023f('0x23')]=_0x121f60['result'][0x0][_0x023f('0xc')];logger[_0x023f('0x13')]('['+[_0x3f44c6[_0x023f('0xd')]()]+_0x023f('0x27'),_0x4425e7);_0x2bd6b8(_0x4425e7);}else{return createEndUser(_0x3f44c6,_0x112825,_0x4425e7,_0x2fc94a,_0x20b29a)[_0x023f('0x15')](function(_0x269f5e){logger[_0x023f('0x13')]('['+[_0x3f44c6[_0x023f('0xd')]()]+_0x023f('0x28'),_0x269f5e);_0x2bd6b8(_0x269f5e);});}})[_0x023f('0x24')](function(_0x56dad1){logger['error']('['+[_0x3f44c6[_0x023f('0xd')]()]+']',_0x56dad1[_0x023f('0xe')]);_0x4baa9f(_0x56dad1[_0x023f('0xe')]);});});};}function getCustomFields(_0x5c8fcd,_0x523732){var _0x24d98d={};if(_0x5c8fcd[_0x023f('0xa')]>0x0){_[_0x023f('0x29')](_0x5c8fcd,function(_0x569829){if(_[_0x023f('0x2a')]([_0x023f('0x2b'),_0x023f('0x2c')],_0x569829[_0x023f('0x2d')])&&_0x569829[_0x023f('0x2e')]&&!_0x569829['customField']){_0x24d98d[_0x569829['nameField'][_0x023f('0x2f')]()]=_0x569829[_0x023f('0x30')]['toString']();}else if(_[_0x023f('0x2a')]([_0x023f('0x2b'),_0x023f('0x2c')],_0x569829[_0x023f('0x2d')])&&_0x569829[_0x023f('0x31')]&&_0x569829[_0x023f('0x32')]){_0x24d98d[_0x569829[_0x023f('0x31')][_0x023f('0x2f')]()]=_0x569829[_0x023f('0x30')][_0x023f('0x33')]();}else if(_0x569829[_0x023f('0x2d')]==='variable'&&_0x569829[_0x023f('0x34')]&&_0x569829[_0x023f('0x31')]&&_0x569829['customField']){_0x24d98d[_0x569829[_0x023f('0x31')][_0x023f('0x2f')]()]=_0x523732[_0x569829['variableName']]['toString']();}else if(_0x569829['type']===_0x023f('0x35')&&_0x569829['Variable']&&_0x569829[_0x023f('0x36')]['name']&&_0x569829[_0x023f('0x31')]&&_0x569829[_0x023f('0x32')]){_0x24d98d[_0x569829[_0x023f('0x31')][_0x023f('0x2f')]()]=_0x523732[_0x569829[_0x023f('0x36')][_0x023f('0x37')][_0x023f('0x2f')]()][_0x023f('0x33')]();}});}return _0x24d98d;}function getTicket(_0x75ab90,_0x1545e1,_0x19cab1,_0x422bde,_0x3131d7,_0x1c63f7){return function(_0x3ddfc0){logger['info']('['+[_0x75ab90[_0x023f('0xd')]()]+_0x023f('0x38'),_0x3ddfc0);return new Promise(function(_0x7133a1,_0x31e63b){var _0x467502=_0x75ab90['toLowerCase']()===_0x023f('0x39')?_0x3ddfc0['userId']:_0x3ddfc0[_0x023f('0x23')];var _0x112937={'method':_0x023f('0x3a'),'uri':_0x19cab1+'incident'+'?'+_0x1c63f7,'body':Object[_0x023f('0x3b')]({},{'active':_0x023f('0x18'),'caller_id':_0x467502,'assigned_to':_0x3ddfc0[_0x023f('0x19')],'short_description':intUtil[_0x023f('0x3c')](_0x422bde[_0x023f('0x3d')],_0x3131d7,'\x20'),'description':intUtil[_0x023f('0x3c')](_0x422bde['Descriptions'],_0x3131d7,'\x0a')},getCustomFields(_0x422bde[_0x023f('0x3e')],_0x3131d7)),'auth':_0x1545e1,'json':!![]};return rp(_0x112937)[_0x023f('0x15')](function(_0xb1c186){logger[_0x023f('0x13')]('['+[_0x75ab90['toUpperCase']()]+_0x023f('0x3f'),_0xb1c186[_0x023f('0xb')]);_0x3ddfc0[_0x023f('0x40')]=_0xb1c186[_0x023f('0xb')][_0x023f('0xc')];_0x3ddfc0[_0x023f('0x41')]=_0xb1c186['result'][_0x023f('0x42')];logger[_0x023f('0x13')]('['+[_0x75ab90[_0x023f('0xd')]()]+']\x20getTicket\x20crm',_0x3ddfc0);_0x7133a1(_0x3ddfc0);})[_0x023f('0x24')](function(_0x2a72fb){logger['error']('['+[_0x75ab90[_0x023f('0xd')]()]+']',_0x2a72fb[_0x023f('0xe')]);_0x31e63b(_0x2a72fb[_0x023f('0xe')]);});});};}function createRemoteTag(_0x341eed,_0x2fbdea,_0x1e05fb,_0x25c431){return new Promise(function(_0x36cb59,_0x375bee){var _0x5a80be={'method':'POST','uri':_0x1e05fb+_0x023f('0x43')+'?'+_0x25c431,'body':{'short_description':_0x341eed,'global':!![],'active':!![],'name':_0x341eed},'auth':_0x2fbdea,'json':!![]};return rp(_0x5a80be)['then'](function(_0x2e3c31){var _0xf84e8b=_0x2e3c31[_0x023f('0xb')]['sys_id'];_0x36cb59(_0xf84e8b);});});}function getRemoteTag(_0x50e743,_0x23c20a,_0x4e5f52,_0x921e93,_0x365a4e){return new Promise(function(_0x2845c1,_0x14b462){var _0x51aeb3={'method':_0x023f('0x8'),'uri':_0x4e5f52+_0x023f('0x43')+_0x023f('0x44')+_0x50e743+'&'+_0x921e93,'auth':_0x23c20a,'json':!![]};return rp(_0x51aeb3)[_0x023f('0x15')](function(_0x517531){if(_0x517531[_0x023f('0xb')][_0x023f('0xa')]>0x0){var _0x516da0=_0x517531['result'][0x0][_0x023f('0xc')];_0x2845c1(_0x516da0);}else{return createRemoteTag(_0x50e743,_0x23c20a,_0x4e5f52,_0x921e93)[_0x023f('0x15')](function(_0x5be893){_0x2845c1(_0x5be893);});}});});}function assignTagToIncident(_0xbc4b5b,_0x385787,_0x429bae,_0xe6a15e,_0x5530b0){return new Promise(function(_0xc89e07,_0xacb411){var _0x16656c={'method':_0x023f('0x3a'),'uri':_0x429bae+_0x023f('0x45')+'?'+_0x5530b0,'body':{'label':_0xbc4b5b,'table':'incident','id_type':'Incident','table_key':_0xe6a15e[_0x023f('0x40')],'title':'Incident\x20-\x20'+_0xe6a15e[_0x023f('0x41')],'id_display':_0xe6a15e['ticketNumber']},'auth':_0x385787,'json':!![]};return rp(_0x16656c)[_0x023f('0x15')](function(_0x464445){_0xc89e07();})[_0x023f('0x24')](function(){_0xc89e07();});});}function manageTags(_0x157207,_0x5049ad,_0x3a8afd,_0xbc376e,_0x4c7581,_0x4f15e5,_0x4db7bc){return new Promise(function(_0x45ed00,_0x33d538){var _0x1aa173=[];_0x5049ad[_0x023f('0x29')](function(_0x4ce191){_0x1aa173[_0x023f('0x46')](getRemoteTag(_0x4ce191,_0x3a8afd,_0xbc376e,_0x4f15e5,_0x4db7bc));});return Promise[_0x023f('0x47')](_0x1aa173)[_0x023f('0x15')](function(_0x11351c){if(_0x11351c[_0x023f('0xa')]){logger[_0x023f('0x13')]('['+[_0x157207[_0x023f('0xd')]()]+_0x023f('0x48'),_0x11351c);var _0x13d2bd=[];_0x11351c[_0x023f('0x29')](function(_0x4fb5c5){_0x13d2bd[_0x023f('0x46')](assignTagToIncident(_0x4fb5c5,_0x3a8afd,_0xbc376e,_0x4c7581,_0x4f15e5));});return Promise[_0x023f('0x47')](_0x13d2bd)[_0x023f('0x15')](function(){_0x45ed00();})[_0x023f('0x24')](function(){_0x45ed00();});}else{_0x45ed00();}});});}function getTags(_0x260f44,_0x2507a5,_0x52ec3d,_0x1794bc,_0x5d25e7,_0x59bcae){return function(_0xa4d7a){return new Promise(function(_0x201c76,_0xfd00a7){var _0x517c54=[];var _0x1c05b0=_0x1794bc[_0x023f('0x49')];if(_0x1c05b0&&_0x1c05b0[_0x023f('0xa')]>0x0){_0x517c54=_['map'](_0x1c05b0,_0x023f('0x37'));}if(_0x517c54[_0x023f('0xa')]>0x0){return manageTags(_0x260f44,_0x517c54,_0x2507a5,_0x52ec3d,_0xa4d7a,_0x5d25e7,_0x59bcae)[_0x023f('0x15')](function(){_0x201c76(_0xa4d7a);});}else{_0x201c76(_0xa4d7a);}});};}function emit(_0x2eab4d,_0x3e85b2,_0x5d095e){var _0x806421=_0x023f('0x4a')+_0x023f('0x4b')+_0x023f('0x4c')+_0x023f('0x4d');var _0x2ede02={'uri':_0x2eab4d+_0x023f('0x4e')+_0x5d095e+_0x806421};io['to'](util[_0x023f('0x4f')](_0x023f('0x50'),_0x3e85b2))[_0x023f('0x51')](_0x023f('0x52'),_0x2ede02);}exports['cs']=function(_0x221109,_0x5b0061,_0x2fc562,_0x3479f9,_0x2ae6dc,_0x4f426e,_0x55a8a6,_0x4e659b){var _0x1ca2ce={};var _0x1640fd={'user':_0x4f426e[_0x023f('0x53')],'pass':_0x4f426e[_0x023f('0x54')]};var _0x34aebf='sysparm_limit=1';var _0x365d09='sysparm_display_value=true';_0x4f426e['remoteUri']=intUtil[_0x023f('0x55')](_0x4f426e[_0x023f('0x56')]);_0x4f426e[_0x023f('0x57')]=intUtil[_0x023f('0x55')](_0x4f426e[_0x023f('0x57')]);var _0x2e9d13=util['format'](_0x023f('0x58'),_0x4f426e['remoteUri']);_0x1ca2ce[_0x023f('0x11')]=!_['isNil'](_0x3479f9)?_0x3479f9['email']:null;_0x1ca2ce[_0x023f('0x1a')]=_0x4f426e['email'];_0x1ca2ce[_0x023f('0x20')]=_0x4e659b['toLowerCase']()==='outbound'?_0x5b0061[_0x023f('0x59')]:_0x5b0061[_0x023f('0x5a')];_0x1ca2ce['callDirection']=_0x4e659b==='queue'||_0x4e659b===_0x023f('0x5b')?_0x023f('0x5c'):_0x023f('0x39');var _0x462940=util['format'](_0x023f('0x5d'),_0x4f426e['serverUrl'],_0x5b0061[_0x023f('0x5e')],md5(_0x5b0061[_0x023f('0x5e')]));if(_0x2ae6dc&&_0x2ae6dc[_0x023f('0x5f')]){logger[_0x023f('0x13')](_0x023f('0x60'),'Recording\x20is\x20enabled!');_0x5b0061[_0x023f('0x61')]=_0x462940;}else if(_0x55a8a6&&_0x55a8a6[_0x023f('0x62')]&&_0x55a8a6[_0x023f('0x62')]!==_0x023f('0x63')){logger['info'](_0x023f('0x64'),_0x023f('0x65'));_0x5b0061['recordingURL']=_0x462940;}else{_0x5b0061[_0x023f('0x61')]='';}return getAdminUser(_0x4e659b,_0x1640fd,_0x1ca2ce,_0x2e9d13,_0x365d09,_0x34aebf)['then'](getUser(_0x4e659b,_0x1640fd,_0x2e9d13,_0x365d09,_0x34aebf))[_0x023f('0x15')](getEndUser(_0x4e659b,_0x1640fd,_0x2e9d13,_0x365d09,_0x34aebf))[_0x023f('0x15')](getTicket(_0x4e659b,_0x1640fd,_0x2e9d13,_0x2fc562,_0x5b0061,_0x365d09))[_0x023f('0x15')](function(_0x56320b){logger[_0x023f('0x13')](util[_0x023f('0x4f')](_0x023f('0x66'),_0x56320b[_0x023f('0x40')]));logger[_0x023f('0x13')](util[_0x023f('0x4f')]('call\x20direction:\x20%s',_0x4e659b));if(_0x4e659b!==_0x023f('0x5b')){logger['info']('['+[_0x4e659b[_0x023f('0xd')]()]+']',_0x023f('0x67'));emit(_0x4f426e[_0x023f('0x56')],_0x3479f9['name'],_0x56320b[_0x023f('0x40')]);}})['catch'](function(_0x59cd86){logger['error']('['+[_0x4e659b[_0x023f('0xd')]()]+_0x023f('0x68'),util[_0x023f('0x69')](_0x59cd86,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2019=['toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','length','active','userId','adminId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','nameField','customField','content','includes','idField','toLowerCase','toString','variable','variableName','type','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','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','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','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','ioredis','../../../../config/logger','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2019,0x19b));var _0x9201=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x2019[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x9201('0x0'));var Promise=require(_0x9201('0x1'));var rp=require('request-promise');var util=require(_0x9201('0x2'));var md5=require(_0x9201('0x3'));var Redis=require(_0x9201('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9201('0x5'))('servicenow');config[_0x9201('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9201('0x7'))(new Redis(config[_0x9201('0x6')]));function getAdminUser(_0x314ffe,_0x6fc147,_0x49a1e7,_0x9311f7,_0x2e4752,_0x11c409){return new Promise(function(_0x441e0e,_0x345360){var _0x52be61={'method':_0x9201('0x8'),'uri':_0x9311f7+_0x9201('0x9')+'&'+_0x2e4752+'&'+_0x11c409,'auth':_0x6fc147,'json':!![]};return rp(_0x52be61)[_0x9201('0xa')](function(_0x2471da){if(_0x2471da[_0x9201('0xb')]['length']>0x0){_0x49a1e7['adminId']=_0x2471da[_0x9201('0xb')][0x0][_0x9201('0xc')];}logger['info']('['+[_0x314ffe[_0x9201('0xd')]()]+_0x9201('0xe'),_0x49a1e7);_0x441e0e(_0x49a1e7);})[_0x9201('0xf')](function(_0xf5ed33){logger[_0x9201('0x10')]('['+[_0x314ffe[_0x9201('0xd')]()]+']',_0xf5ed33[_0x9201('0x11')]);_0x345360(_0xf5ed33[_0x9201('0x11')]);});});}function getUser(_0x40fe5e,_0x4a04b2,_0x175c29,_0x484387,_0x447293){return function(_0x5d930d){logger[_0x9201('0x12')]('['+[_0x40fe5e['toUpperCase']()]+_0x9201('0x13'),_0x5d930d);return new Promise(function(_0xa75682,_0x5aa409){if(intUtil[_0x9201('0x14')](_0x5d930d[_0x9201('0x15')])){var _0x2d7d75={'method':_0x9201('0x8'),'uri':_0x175c29+'sys_user?sysparm_query=email%3D'+_0x5d930d[_0x9201('0x15')]+'&'+_0x484387+'&'+_0x447293,'auth':_0x4a04b2,'json':!![]};logger[_0x9201('0x12')]('['+[_0x40fe5e['toUpperCase']()]+_0x9201('0x16'),_0x2d7d75);return rp(_0x2d7d75)[_0x9201('0xa')](function(_0x4759b9){logger[_0x9201('0x12')]('['+[_0x40fe5e[_0x9201('0xd')]()]+'],\x20getUser\x20entity',_0x4759b9);if(_0x4759b9[_0x9201('0xb')][_0x9201('0x17')]>0x0&&String(_0x4759b9[_0x9201('0xb')][0x0][_0x9201('0x18')])==='true'){_0x5d930d['userId']=_0x4759b9[_0x9201('0xb')][0x0]['sys_id'];}else{_0x5d930d[_0x9201('0x19')]=_0x5d930d[_0x9201('0x1a')];_0x5d930d[_0x9201('0x15')]=_0x5d930d[_0x9201('0x1b')];}logger[_0x9201('0x12')]('['+[_0x40fe5e[_0x9201('0xd')]()]+'],\x20getUser\x20crm',_0x5d930d);_0xa75682(_0x5d930d);})[_0x9201('0xf')](function(_0x485b9c){logger[_0x9201('0x10')]('['+[_0x40fe5e['toUpperCase']()]+']',_0x485b9c[_0x9201('0x11')]);_0x5aa409(_0x485b9c[_0x9201('0x11')]);});}else{logger['info']('['+[_0x40fe5e[_0x9201('0xd')]()]+']\x20using\x20admin\x20profile');_0x5d930d['userId']=_0x5d930d[_0x9201('0x1a')];_0x5d930d[_0x9201('0x15')]=_0x5d930d[_0x9201('0x1b')];_0xa75682(_0x5d930d);}});};}function createEndUser(_0x4d2c26,_0x5a4493,_0xc995f0,_0x1db3b1,_0x5243a4){logger[_0x9201('0x12')]('['+[_0x4d2c26[_0x9201('0xd')]()]+_0x9201('0x1c'),_0xc995f0);return new Promise(function(_0x3eeb81,_0x5d7712){var _0x127ae2={'method':_0x9201('0x1d'),'uri':_0x1db3b1+'sys_user?'+_0x5243a4,'body':{'user_name':_0xc995f0['endUserNumber'],'roles':_0x9201('0x1e'),'first_name':_0xc995f0[_0x9201('0x1f')],'active':'true','date_format':_0x9201('0x20'),'phone':_0xc995f0[_0x9201('0x1f')]},'auth':_0x5a4493,'json':!![]};return rp(_0x127ae2)['then'](function(_0x177536){logger[_0x9201('0x12')]('['+[_0x4d2c26[_0x9201('0xd')]()]+_0x9201('0x21'),_0x177536['result']);_0xc995f0['endUserId']=_0x177536[_0x9201('0xb')][_0x9201('0xc')];_0x3eeb81(_0xc995f0);})['catch'](function(_0x174f56){logger[_0x9201('0x10')]('['+[_0x4d2c26[_0x9201('0xd')]()]+']',_0x174f56[_0x9201('0x11')]);_0x5d7712(_0x174f56[_0x9201('0x11')]);});});}function getEndUser(_0x283a85,_0x391a54,_0xf837cf,_0x1724d1,_0x1c63ab){return function(_0xb7770e){logger[_0x9201('0x12')]('['+[_0x283a85[_0x9201('0xd')]()]+_0x9201('0x22'),_0xb7770e);return new Promise(function(_0x4638ee,_0x265aed){var _0x45c36d={'method':_0x9201('0x8'),'uri':_0xf837cf+'sys_user?sysparm_query=phone%3D'+_0xb7770e['endUserNumber']+'&'+_0x1724d1+'&'+_0x1c63ab,'auth':_0x391a54,'json':!![]};return rp(_0x45c36d)[_0x9201('0xa')](function(_0x1d6ce4){if(_0x1d6ce4[_0x9201('0xb')][_0x9201('0x17')]>0x0){_0xb7770e[_0x9201('0x23')]=_0x1d6ce4['result'][0x0][_0x9201('0xc')];logger[_0x9201('0x12')]('['+[_0x283a85[_0x9201('0xd')]()]+_0x9201('0x24'),_0xb7770e);_0x4638ee(_0xb7770e);}else{return createEndUser(_0x283a85,_0x391a54,_0xb7770e,_0xf837cf,_0x1724d1)[_0x9201('0xa')](function(_0x205db3){logger[_0x9201('0x12')]('['+[_0x283a85[_0x9201('0xd')]()]+_0x9201('0x25'),_0x205db3);_0x4638ee(_0x205db3);});}})[_0x9201('0xf')](function(_0x26409f){logger['error']('['+[_0x283a85[_0x9201('0xd')]()]+']',_0x26409f[_0x9201('0x11')]);_0x265aed(_0x26409f[_0x9201('0x11')]);});});};}function getCustomFields(_0x12f80a,_0x1caabd){var _0x295242={};if(_0x12f80a[_0x9201('0x17')]>0x0){_[_0x9201('0x26')](_0x12f80a,function(_0x4f3360){if(_['includes']([_0x9201('0x27'),_0x9201('0x28')],_0x4f3360['type'])&&_0x4f3360[_0x9201('0x29')]&&!_0x4f3360[_0x9201('0x2a')]){_0x295242[_0x4f3360[_0x9201('0x29')]['toLowerCase']()]=_0x4f3360[_0x9201('0x2b')]['toString']();}else if(_[_0x9201('0x2c')](['string','picklist'],_0x4f3360['type'])&&_0x4f3360['idField']&&_0x4f3360['customField']){_0x295242[_0x4f3360[_0x9201('0x2d')][_0x9201('0x2e')]()]=_0x4f3360[_0x9201('0x2b')][_0x9201('0x2f')]();}else if(_0x4f3360['type']===_0x9201('0x30')&&_0x4f3360[_0x9201('0x31')]&&_0x4f3360[_0x9201('0x2d')]&&_0x4f3360['customField']){_0x295242[_0x4f3360[_0x9201('0x2d')][_0x9201('0x2e')]()]=_0x1caabd[_0x4f3360['variableName']]['toString']();}else if(_0x4f3360[_0x9201('0x32')]===_0x9201('0x33')&&_0x4f3360[_0x9201('0x34')]&&_0x4f3360[_0x9201('0x34')][_0x9201('0x35')]&&_0x4f3360['idField']&&_0x4f3360[_0x9201('0x2a')]){_0x295242[_0x4f3360[_0x9201('0x2d')][_0x9201('0x2e')]()]=_0x1caabd[_0x4f3360[_0x9201('0x34')][_0x9201('0x35')][_0x9201('0x2e')]()][_0x9201('0x2f')]();}});}return _0x295242;}function getTicket(_0x8db3eb,_0x3ee039,_0x2ceccb,_0x55e806,_0x1e0bfe,_0x233447){return function(_0x4d3c35){logger[_0x9201('0x12')]('['+[_0x8db3eb[_0x9201('0xd')]()]+_0x9201('0x36'),_0x4d3c35);return new Promise(function(_0x230802,_0x517a09){var _0x1adcfc=_0x8db3eb[_0x9201('0x2e')]()===_0x9201('0x37')?_0x4d3c35[_0x9201('0x19')]:_0x4d3c35[_0x9201('0x23')];var _0x5343b1={'method':_0x9201('0x1d'),'uri':_0x2ceccb+_0x9201('0x38')+'?'+_0x233447,'body':Object[_0x9201('0x39')]({},{'active':'true','caller_id':_0x1adcfc,'assigned_to':_0x4d3c35[_0x9201('0x19')],'short_description':intUtil[_0x9201('0x3a')](_0x55e806[_0x9201('0x3b')],_0x1e0bfe,'\x20'),'description':intUtil[_0x9201('0x3a')](_0x55e806[_0x9201('0x3c')],_0x1e0bfe,'\x0a')},getCustomFields(_0x55e806['Fields'],_0x1e0bfe)),'auth':_0x3ee039,'json':!![]};return rp(_0x5343b1)[_0x9201('0xa')](function(_0x1b4bd){logger['info']('['+[_0x8db3eb[_0x9201('0xd')]()]+_0x9201('0x3d'),_0x1b4bd[_0x9201('0xb')]);_0x4d3c35[_0x9201('0x3e')]=_0x1b4bd[_0x9201('0xb')][_0x9201('0xc')];_0x4d3c35[_0x9201('0x3f')]=_0x1b4bd[_0x9201('0xb')][_0x9201('0x40')];logger[_0x9201('0x12')]('['+[_0x8db3eb[_0x9201('0xd')]()]+']\x20getTicket\x20crm',_0x4d3c35);_0x230802(_0x4d3c35);})['catch'](function(_0x5f1d09){logger[_0x9201('0x10')]('['+[_0x8db3eb[_0x9201('0xd')]()]+']',_0x5f1d09[_0x9201('0x11')]);_0x517a09(_0x5f1d09[_0x9201('0x11')]);});});};}function createRemoteTag(_0x256546,_0x3cd6b7,_0x43b88c,_0x54e2b6){return new Promise(function(_0x266ed3,_0x5b018f){var _0x270508={'method':'POST','uri':_0x43b88c+_0x9201('0x41')+'?'+_0x54e2b6,'body':{'short_description':_0x256546,'global':!![],'active':!![],'name':_0x256546},'auth':_0x3cd6b7,'json':!![]};return rp(_0x270508)[_0x9201('0xa')](function(_0x26adb0){var _0x3605c8=_0x26adb0[_0x9201('0xb')]['sys_id'];_0x266ed3(_0x3605c8);});});}function getRemoteTag(_0x1e9d34,_0x5a62c8,_0x44f445,_0x3c10fe,_0x19e978){return new Promise(function(_0x449350,_0x1831c8){var _0xa2231b={'method':_0x9201('0x8'),'uri':_0x44f445+_0x9201('0x41')+_0x9201('0x42')+_0x1e9d34+'&'+_0x3c10fe,'auth':_0x5a62c8,'json':!![]};return rp(_0xa2231b)[_0x9201('0xa')](function(_0x388f8b){if(_0x388f8b[_0x9201('0xb')][_0x9201('0x17')]>0x0){var _0xa20c8f=_0x388f8b[_0x9201('0xb')][0x0][_0x9201('0xc')];_0x449350(_0xa20c8f);}else{return createRemoteTag(_0x1e9d34,_0x5a62c8,_0x44f445,_0x3c10fe)[_0x9201('0xa')](function(_0x110662){_0x449350(_0x110662);});}});});}function assignTagToIncident(_0x504602,_0xbfa61a,_0x285913,_0x4417bf,_0x3362f3){return new Promise(function(_0x340791,_0x40a49e){var _0x2d3f3b={'method':'POST','uri':_0x285913+_0x9201('0x43')+'?'+_0x3362f3,'body':{'label':_0x504602,'table':_0x9201('0x38'),'id_type':_0x9201('0x44'),'table_key':_0x4417bf[_0x9201('0x3e')],'title':_0x9201('0x45')+_0x4417bf[_0x9201('0x3f')],'id_display':_0x4417bf[_0x9201('0x3f')]},'auth':_0xbfa61a,'json':!![]};return rp(_0x2d3f3b)[_0x9201('0xa')](function(_0x179221){_0x340791();})[_0x9201('0xf')](function(){_0x340791();});});}function manageTags(_0x33e608,_0x1c3377,_0x518e40,_0x35b3b5,_0x12d03f,_0x25a93b,_0x4bd5c5){return new Promise(function(_0x31d536,_0x397dde){var _0x293b4e=[];_0x1c3377[_0x9201('0x26')](function(_0x44e782){_0x293b4e[_0x9201('0x46')](getRemoteTag(_0x44e782,_0x518e40,_0x35b3b5,_0x25a93b,_0x4bd5c5));});return Promise[_0x9201('0x47')](_0x293b4e)[_0x9201('0xa')](function(_0x3394a6){if(_0x3394a6[_0x9201('0x17')]){logger[_0x9201('0x12')]('['+[_0x33e608[_0x9201('0xd')]()]+_0x9201('0x48'),_0x3394a6);var _0x5e7e92=[];_0x3394a6[_0x9201('0x26')](function(_0x1d51f1){_0x5e7e92['push'](assignTagToIncident(_0x1d51f1,_0x518e40,_0x35b3b5,_0x12d03f,_0x25a93b));});return Promise[_0x9201('0x47')](_0x5e7e92)[_0x9201('0xa')](function(){_0x31d536();})[_0x9201('0xf')](function(){_0x31d536();});}else{_0x31d536();}});});}function getTags(_0x1b5a3e,_0x486c7e,_0x58edbe,_0x1ee044,_0x1bd23f,_0x12c8e9){return function(_0x664123){return new Promise(function(_0x1270ba,_0x55db6b){var _0xf8cd58=[];var _0x41d56c=_0x1ee044[_0x9201('0x49')];if(_0x41d56c&&_0x41d56c[_0x9201('0x17')]>0x0){_0xf8cd58=_[_0x9201('0x4a')](_0x41d56c,_0x9201('0x35'));}if(_0xf8cd58[_0x9201('0x17')]>0x0){return manageTags(_0x1b5a3e,_0xf8cd58,_0x486c7e,_0x58edbe,_0x664123,_0x1bd23f,_0x12c8e9)[_0x9201('0xa')](function(){_0x1270ba(_0x664123);});}else{_0x1270ba(_0x664123);}});};}function emit(_0x3611d1,_0x24ba72,_0x23310a){var _0x2d06fc=_0x9201('0x4b')+_0x9201('0x4c')+_0x9201('0x4d')+_0x9201('0x4e');var _0x234540={'uri':_0x3611d1+_0x9201('0x4f')+_0x23310a+_0x2d06fc};io['to'](util[_0x9201('0x50')]('user:%s',_0x24ba72))[_0x9201('0x51')](_0x9201('0x52'),_0x234540);}exports['cs']=function(_0x5823a6,_0x526a36,_0x2df770,_0x372382,_0x55583b,_0x97e295,_0x5c69ee,_0x4b33e4){var _0x424129={};var _0x1ddd09={'user':_0x97e295['username'],'pass':_0x97e295['password']};var _0xe47abb=_0x9201('0x53');var _0x457677=_0x9201('0x54');_0x97e295[_0x9201('0x55')]=intUtil[_0x9201('0x56')](_0x97e295[_0x9201('0x55')]);_0x97e295['serverUrl']=intUtil['stripTrailingSlash'](_0x97e295[_0x9201('0x57')]);var _0x376587=util[_0x9201('0x50')](_0x9201('0x58'),_0x97e295[_0x9201('0x55')]);_0x424129[_0x9201('0x15')]=!_['isNil'](_0x372382)?_0x372382[_0x9201('0x59')]:null;_0x424129['adminEmail']=_0x97e295['email'];_0x424129['endUserNumber']=_0x4b33e4[_0x9201('0x2e')]()===_0x9201('0x37')?_0x526a36[_0x9201('0x5a')]:_0x526a36[_0x9201('0x5b')];_0x424129[_0x9201('0x5c')]=_0x4b33e4===_0x9201('0x5d')||_0x4b33e4===_0x9201('0x5e')?_0x9201('0x5d'):_0x9201('0x37');var _0x14731f=util['format'](_0x9201('0x5f'),_0x97e295[_0x9201('0x57')],_0x526a36['uniqueid'],md5(_0x526a36[_0x9201('0x60')]));if(_0x55583b&&_0x55583b[_0x9201('0x61')]){logger['info']('[QUEUE]',_0x9201('0x62'));_0x526a36[_0x9201('0x63')]=_0x14731f;}else if(_0x5c69ee&&_0x5c69ee[_0x9201('0x64')]&&_0x5c69ee['recordingFormat']!==_0x9201('0x65')){logger[_0x9201('0x12')]('[OUTBOUND]',_0x9201('0x62'));_0x526a36[_0x9201('0x63')]=_0x14731f;}else{_0x526a36[_0x9201('0x63')]='';}return getAdminUser(_0x4b33e4,_0x1ddd09,_0x424129,_0x376587,_0x457677,_0xe47abb)['then'](getUser(_0x4b33e4,_0x1ddd09,_0x376587,_0x457677,_0xe47abb))[_0x9201('0xa')](getEndUser(_0x4b33e4,_0x1ddd09,_0x376587,_0x457677,_0xe47abb))[_0x9201('0xa')](getTicket(_0x4b33e4,_0x1ddd09,_0x376587,_0x2df770,_0x526a36,_0x457677))[_0x9201('0xa')](function(_0x3929b2){logger['info'](util[_0x9201('0x50')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3929b2['ticketId']));logger[_0x9201('0x12')](util[_0x9201('0x50')](_0x9201('0x66'),_0x4b33e4));if(_0x4b33e4!==_0x9201('0x5e')){logger['info']('['+[_0x4b33e4[_0x9201('0xd')]()]+']',_0x9201('0x67'));emit(_0x97e295[_0x9201('0x55')],_0x372382['name'],_0x3929b2[_0x9201('0x3e')]);}})[_0x9201('0xf')](function(_0x48877a){logger[_0x9201('0x10')]('['+[_0x4b33e4[_0x9201('0xd')]()]+_0x9201('0x68'),util[_0x9201('0x69')](_0x48877a,{'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 c0e7bed..a0f742a 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 _0xdb77=['resolve','value','user_id','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','','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','toLowerCase','content','toString','string','customField','custom_fields','push','variable','variableName','customVariable','Variable','login','username','password','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%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','[OUTBOUND]','destcalleridnum','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','calleridname','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','socket.io-emitter','redis','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','Contacts','length','forEach','idField','set_entry','JSON','Calls','Basic\x20%s','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','Agent\x20found!'];(function(_0x5d6d28,_0x14d669){var _0x4d2ad1=function(_0x5c3ed2){while(--_0x5c3ed2){_0x5d6d28['push'](_0x5d6d28['shift']());}};_0x4d2ad1(++_0x14d669);}(_0xdb77,0xbb));var _0x7db7=function(_0x3b2006,_0x1a78aa){_0x3b2006=_0x3b2006-0x0;var _0x24f03e=_0xdb77[_0x3b2006];return _0x24f03e;};'use strict';var _=require('lodash');var rp=require(_0x7db7('0x0'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x7db7('0x1'));var Redis=require(_0x7db7('0x2'));var intUtil=require(_0x7db7('0x3'));var config=require(_0x7db7('0x4'));var logger=require(_0x7db7('0x5'))('sugarcrm');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7db7('0x6'))(new Redis(config[_0x7db7('0x7')]));var def={'method':_0x7db7('0x8'),'json':!![]};function emit(_0x3f91c6,_0x14a496,_0x49f577){io['to'](_0x3f91c6)['emit'](_0x14a496,_0x49f577);}function getTicket(_0x455292,_0x2b111e,_0xbcc5a4,_0x56ada5,_0x341f88,_0x5d58d3,_0x5c6de3,_0xf70eed){logger[_0x7db7('0x9')](_0x7db7('0xa'));var _0x5f1703=new Date();var _0x43463a=[{'name':_0x7db7('0xb'),'value':intUtil[_0x7db7('0xc')](_0x56ada5[_0x7db7('0xd')],_0x341f88,'\x20')},{'name':_0x7db7('0xe'),'value':_0x2b111e['id']},{'name':_0x7db7('0xf'),'value':_0x2b111e['id']},{'name':_0x7db7('0x10'),'value':intUtil[_0x7db7('0xc')](_0x56ada5[_0x7db7('0x11')],_0x341f88,'\x0a')},{'name':_0x7db7('0x12'),'value':_0x5f1703[_0x7db7('0x13')]()[_0x7db7('0x14')](0x0,0x13)[_0x7db7('0x15')]('T','\x20')},{'name':_0x7db7('0x16'),'value':'0'},{'name':_0x7db7('0x17'),'value':'15'},{'name':'parent_id','value':_0xbcc5a4['id']},{'name':'parent_type','value':_0x7db7('0x18')},{'name':'parent_name','value':_0xbcc5a4['name']},{'name':'direction','value':_0xf70eed}];if(_0x5d58d3[_0x7db7('0x19')]){_[_0x7db7('0x1a')](_0x5d58d3,function(_0x59b2f8){if(_0x341f88[_0x59b2f8['variableName']]){_0x43463a['push']({'name':_0x59b2f8[_0x7db7('0x1b')],'value':_0x341f88[_0x59b2f8['variableName']]});}});}return request({'form':{'method':_0x7db7('0x1c'),'input_type':_0x7db7('0x1d'),'response_type':_0x7db7('0x1d'),'rest_data':JSON['stringify']({'session':_0x5c6de3['id'],'module_name':_0x7db7('0x1e'),'name_value_list':_0x43463a})}});}function getAuth(_0x38e6c6){return util['format'](_0x7db7('0x1f'),new Buffer(_0x38e6c6['apiKey']+':X')['toString'](_0x7db7('0x20')));}function getServerInfo(_0xab1d3f){return request({'form':{'method':_0x7db7('0x21'),'input_type':'JSON','response_type':_0x7db7('0x1d'),'rest_data':JSON[_0x7db7('0x22')]({'session':_0xab1d3f['id']})}});}function getUser(_0x38a9c1,_0x466a46,_0xdf7df3){if(!_[_0x7db7('0x23')](_0x466a46)){logger['info'](_0x7db7('0x24'),_0x466a46);return request({'form':{'method':_0x7db7('0x25'),'input_type':'JSON','response_type':_0x7db7('0x1d'),'rest_data':JSON[_0x7db7('0x22')]({'session':_0xdf7df3['id'],'module_name':_0x7db7('0x26'),'query':util[_0x7db7('0x27')](_0x7db7('0x28'),_0x466a46),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7db7('0x29')](function(_0xc54a49){if(_0xc54a49[_0x7db7('0x2a')]['length']){var _0xc09f67=_[_0x7db7('0x2b')](_0xc54a49[_0x7db7('0x2a')],function(_0x16443e){return _0x16443e[_0x7db7('0x2c')][_0x7db7('0x2d')]['value']===_0x466a46;});if(_0xc09f67){logger[_0x7db7('0x9')](_0x7db7('0x2e'));return BPromise[_0x7db7('0x2f')]({'id':_0xc09f67[_0x7db7('0x2c')]['id'][_0x7db7('0x30')],'name':_0xc09f67[_0x7db7('0x2c')][_0x7db7('0xb')][_0x7db7('0x30')]});}}logger[_0x7db7('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0xdf7df3['name_value_list'][_0x7db7('0x31')][_0x7db7('0x30')],'name':_0xdf7df3[_0x7db7('0x2c')][_0x7db7('0x2d')][_0x7db7('0x30')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7db7('0x2f')]({'id':_0xdf7df3[_0x7db7('0x2c')][_0x7db7('0x31')][_0x7db7('0x30')],'name':_0xdf7df3[_0x7db7('0x2c')]['user_name'][_0x7db7('0x30')]});}}function getEndUser(_0x240e3a,_0x4ab9ed,_0x3f0500,_0x29efc3){logger[_0x7db7('0x9')](_0x7db7('0x32'),_0x3f0500);return request({'form':{'method':_0x7db7('0x25'),'input_type':_0x7db7('0x1d'),'response_type':_0x7db7('0x1d'),'rest_data':JSON['stringify']({'session':_0x29efc3['id'],'module_name':_0x7db7('0x18'),'query':util[_0x7db7('0x27')](_0x7db7('0x33'),_0x3f0500),'order_by':'','offset':'0','select_fields':['id',_0x7db7('0xb'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7db7('0x29')](function(_0x2a13c4){if(_0x2a13c4[_0x7db7('0x2a')][_0x7db7('0x19')]){var _0x57a06d=_[_0x7db7('0x2b')](_0x2a13c4[_0x7db7('0x2a')],function(_0x316cef){return _0x316cef[_0x7db7('0x2c')][_0x7db7('0x34')]['value']===_0x3f0500;});if(_0x57a06d){logger[_0x7db7('0x9')](_0x7db7('0x35'));return BPromise[_0x7db7('0x2f')]({'id':_0x57a06d[_0x7db7('0x2c')]['id'][_0x7db7('0x30')],'name':_0x57a06d[_0x7db7('0x2c')]['name'][_0x7db7('0x30')],'phone':_0x57a06d[_0x7db7('0x2c')][_0x7db7('0x34')][_0x7db7('0x30')]});}}else{logger['info'](_0x7db7('0x36'));return request({'form':{'method':_0x7db7('0x1c'),'input_type':_0x7db7('0x1d'),'response_type':'JSON','rest_data':JSON[_0x7db7('0x22')]({'session':_0x29efc3['id'],'module_name':_0x7db7('0x18'),'name_value_list':[{'name':_0x7db7('0x37'),'value':_0x4ab9ed!==_0x7db7('0x38')?_0x4ab9ed:util[_0x7db7('0x27')]('Caller\x20-\x20%s',_0x3f0500)},{'name':_0x7db7('0x34'),'value':_0x3f0500}]})}})[_0x7db7('0x29')](function(_0x1b483f){logger['info'](_0x7db7('0x39'));return BPromise[_0x7db7('0x2f')]({'id':_0x1b483f['id'],'name':_0x1b483f[_0x7db7('0x2a')]['first_name']['value'],'phone':_0x1b483f['entry_list'][_0x7db7('0x34')]['value']});});}});}function request(_0x4b715e){logger[_0x7db7('0x3a')](_0x7db7('0x3b'),JSON[_0x7db7('0x22')](_0x4b715e));return rp(_[_0x7db7('0x3c')](def,_0x4b715e));}function getTags(_0x3eb661,_0x5ea889){var _0x1bf9b3=[];if(_0x3eb661&&_0x3eb661[_0x7db7('0x19')]>0x0){_0x1bf9b3=_[_0x7db7('0x3d')](_0x3eb661,_0x5ea889);}return _0x1bf9b3;}function getCustomFields(_0x3d8ae4,_0x2b96e8){var _0x89ecf8=[];var _0xeade54={'custom_fields':[]};if(_0x3d8ae4[_0x7db7('0x19')]>0x0){_[_0x7db7('0x1a')](_0x3d8ae4,function(_0x1ae9e4){if(_0x1ae9e4[_0x7db7('0x3e')]==='string'&&_0x1ae9e4[_0x7db7('0x3f')]&&!_0x1ae9e4['customField']){_0xeade54[_0x1ae9e4[_0x7db7('0x3f')][_0x7db7('0x40')]()]=_0x1ae9e4[_0x7db7('0x41')][_0x7db7('0x42')]();}else if(_0x1ae9e4[_0x7db7('0x3e')]===_0x7db7('0x43')&&_0x1ae9e4[_0x7db7('0x1b')]&&_0x1ae9e4[_0x7db7('0x44')]){_0xeade54[_0x7db7('0x45')][_0x7db7('0x46')]({'id':_0x1ae9e4['idField'],'value':_0x1ae9e4[_0x7db7('0x41')][_0x7db7('0x42')]()});}else if(_0x1ae9e4[_0x7db7('0x3e')]===_0x7db7('0x47')&&_0x1ae9e4[_0x7db7('0x48')]&&_0x1ae9e4[_0x7db7('0x1b')]&&_0x1ae9e4['customField']){_0x2b96e8[_0x1ae9e4[_0x7db7('0x48')]]&&_0xeade54[_0x7db7('0x45')][_0x7db7('0x46')]({'id':_0x1ae9e4[_0x7db7('0x1b')],'value':_0x2b96e8[_0x1ae9e4[_0x7db7('0x48')]]['toString']()});}else if(_0x1ae9e4['type']===_0x7db7('0x49')&&_0x1ae9e4['Variable']&&_0x1ae9e4['Variable']['name']&&_0x1ae9e4[_0x7db7('0x1b')]&&_0x1ae9e4['customField']){_0x2b96e8[_0x1ae9e4[_0x7db7('0x4a')][_0x7db7('0xb')][_0x7db7('0x40')]()]&&_0xeade54['custom_fields'][_0x7db7('0x46')]({'id':_0x1ae9e4[_0x7db7('0x1b')],'value':_0x2b96e8[_0x1ae9e4[_0x7db7('0x4a')][_0x7db7('0xb')][_0x7db7('0x40')]()][_0x7db7('0x42')]()});}});}return _0xeade54;}function getConnection(_0x5c6f8d){return request({'method':'POST','form':{'method':_0x7db7('0x4b'),'input_type':_0x7db7('0x1d'),'response_type':_0x7db7('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c6f8d[_0x7db7('0x4c')],'password':_0x5c6f8d[_0x7db7('0x4d')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x442b9f){var _0xf0e80=_0x442b9f;if(_0xf0e80['id']){def['sessionID']=_0xf0e80['id'];return BPromise[_0x7db7('0x2f')](_0xf0e80);}else{throw new Error(util[_0x7db7('0x27')](_0x7db7('0x4e'),_0x5c6f8d['id']));}});}function setRelationship(_0xddbbe2,_0x48d2bb,_0x4c6559,_0x530359){return request({'form':{'method':_0x7db7('0x4f'),'input_type':_0x7db7('0x1d'),'response_type':_0x7db7('0x1d'),'rest_data':JSON[_0x7db7('0x22')]({'session':_0xddbbe2['id'],'module_name':_0x7db7('0x1e'),'module_id':_0x4c6559['id'],'link_field_name':_0x530359,'related_ids':[_0x48d2bb['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7db7('0x50')]=function(_0x4e2cac,_0x59d298,_0x307a6d,_0x45a909,_0x3082d1,_0x26ef2f){var _0x3bda59,_0x5e5dea,_0x26a154,_0x2b7852;_0x26ef2f[_0x7db7('0x51')]=intUtil[_0x7db7('0x52')](_0x26ef2f[_0x7db7('0x51')]);_0x26ef2f['serverUrl']=intUtil[_0x7db7('0x52')](_0x26ef2f[_0x7db7('0x53')]);def[_0x7db7('0x54')]=util[_0x7db7('0x27')](_0x7db7('0x55'),_0x26ef2f['remoteUri']);if(_0x3082d1&&_0x3082d1[_0x7db7('0x56')]){logger[_0x7db7('0x9')](_0x7db7('0x57'),_0x7db7('0x58'));_0x59d298['recordingURL']=util[_0x7db7('0x27')](_0x7db7('0x59'),_0x26ef2f[_0x7db7('0x53')],_0x59d298[_0x7db7('0x5a')],md5(_0x59d298[_0x7db7('0x5a')]));}else{_0x59d298[_0x7db7('0x5b')]='';}return getConnection(_0x26ef2f)[_0x7db7('0x29')](function(_0x6ba8f5){_0x2b7852=_0x6ba8f5;return getUser(_0x26ef2f,_0x45a909[_0x7db7('0xb')],_0x2b7852);})[_0x7db7('0x29')](function(_0xdbaead){_0x3bda59=_0xdbaead;logger['info'](_0x7db7('0x5c'),_0x3bda59['id']);return getEndUser(_0x26ef2f,_0x59d298['calleridname'],_0x59d298[_0x7db7('0x5d')],_0x2b7852);})['then'](function(_0x47b2e5){_0x5e5dea=_0x47b2e5;logger[_0x7db7('0x9')](_0x7db7('0x5e'),_0x5e5dea['id']);return getTicket(_0x26ef2f,_0x3bda59,_0x5e5dea,_0x307a6d,_0x59d298,_0x307a6d[_0x7db7('0x5f')],_0x2b7852,_0x7db7('0x60'));})[_0x7db7('0x29')](function(_0x152da4){_0x26a154=_0x152da4;logger[_0x7db7('0x9')](_0x7db7('0x61'));logger[_0x7db7('0x9')](_0x7db7('0x62'),_0x26a154['id']);return setRelationship(_0x2b7852,_0x3bda59,_0x26a154,_0x7db7('0x63'));})[_0x7db7('0x29')](function(){return setRelationship(_0x2b7852,_0x5e5dea,_0x26a154,_0x7db7('0x64'));})[_0x7db7('0x29')](function(){return getServerInfo(_0x2b7852);})['then'](function(_0x16df9b){var _0x59f3bf=parseInt(_0x16df9b[_0x7db7('0x65')]['charAt'](0x0));var _0x4903d2=util[_0x7db7('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x26ef2f[_0x7db7('0x51')],_0x26a154['id']);if(_0x59f3bf>0x6){_0x4903d2=util[_0x7db7('0x27')](_0x7db7('0x66'),_0x26ef2f[_0x7db7('0x51')],_0x26a154['id']);}logger[_0x7db7('0x9')](_0x7db7('0x57'),_0x7db7('0x67'));emit(util[_0x7db7('0x27')](_0x7db7('0x68'),_0x45a909[_0x7db7('0xb')]),_0x7db7('0x69'),{'uri':_0x4903d2});})[_0x7db7('0x6a')](function(_0x29e5cd){logger[_0x7db7('0x6b')](_0x7db7('0x57'),JSON[_0x7db7('0x22')](_0x29e5cd));});};exports[_0x7db7('0x6c')]=function(_0x5b8b1a,_0x31cc07,_0x491527,_0x47b640,_0xdd8312,_0x21e2f5,_0x312418){var _0x4b8bda,_0x18bbcd,_0x148835,_0x3cbfe4;_0x21e2f5['remoteUri']=intUtil[_0x7db7('0x52')](_0x21e2f5[_0x7db7('0x51')]);_0x21e2f5[_0x7db7('0x53')]=intUtil['stripTrailingSlash'](_0x21e2f5[_0x7db7('0x53')]);def[_0x7db7('0x54')]=util[_0x7db7('0x27')]('%s/service/v4_1/rest.php',_0x21e2f5['remoteUri']);if(_0x312418&&_0x312418['recordingFormat']&&_0x312418['recordingFormat']!=='none'){logger['info'](_0x7db7('0x6d'),_0x7db7('0x58'));_0x31cc07[_0x7db7('0x5b')]=util[_0x7db7('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21e2f5[_0x7db7('0x53')],_0x31cc07[_0x7db7('0x5a')],md5(_0x31cc07['uniqueid']));}return getConnection(_0x21e2f5)[_0x7db7('0x29')](function(_0x3716e6){_0x3cbfe4=_0x3716e6;return getUser(_0x21e2f5,_0x47b640[_0x7db7('0xb')],_0x3cbfe4);})['then'](function(_0xe9d710){_0x4b8bda=_0xe9d710;logger[_0x7db7('0x9')]('The\x20User\x20ID\x20is:',_0x4b8bda['id']);return getEndUser(_0x21e2f5,_0x31cc07['destcalleridname'],_0x31cc07[_0x7db7('0x6e')],_0x3cbfe4);})[_0x7db7('0x29')](function(_0x105cd3){_0x18bbcd=_0x105cd3;logger['info'](_0x7db7('0x5e'),_0x18bbcd['id']);return getTicket(_0x21e2f5,_0x4b8bda,_0x18bbcd,_0x491527,_0x31cc07,_0x491527['Fields'],_0x3cbfe4,_0x7db7('0x6f'));})[_0x7db7('0x29')](function(_0x1897af){_0x148835=_0x1897af;logger[_0x7db7('0x9')]('Ticket\x20created!');logger[_0x7db7('0x9')](_0x7db7('0x62'),_0x148835['id']);return setRelationship(_0x3cbfe4,_0x4b8bda,_0x148835,_0x7db7('0x63'));})[_0x7db7('0x29')](function(){return setRelationship(_0x3cbfe4,_0x18bbcd,_0x148835,'contacts');})[_0x7db7('0x29')](function(){return getServerInfo(_0x3cbfe4);})[_0x7db7('0x29')](function(_0x35484b){var _0x1623c9=parseInt(_0x35484b[_0x7db7('0x65')]['charAt'](0x0));var _0x49527c=util['format'](_0x7db7('0x70'),_0x21e2f5[_0x7db7('0x51')],_0x148835['id']);if(_0x1623c9>0x6){_0x49527c=util[_0x7db7('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x21e2f5['remoteUri'],_0x148835['id']);}logger['info'](_0x7db7('0x6d'),_0x7db7('0x67'));emit(util[_0x7db7('0x27')](_0x7db7('0x68'),_0x47b640[_0x7db7('0xb')]),_0x7db7('0x69'),{'uri':_0x49527c});})['catch'](function(_0x5e7737){logger[_0x7db7('0x6b')]('[OUTBOUND]',JSON[_0x7db7('0x22')](_0x5e7737));});};exports[_0x7db7('0x71')]=function(_0x29e4d8,_0x471544,_0x54fe94,_0x2e4212,_0x250b7c,_0x3abfc5){var _0x54ad60,_0x59ff8a,_0xea2e9d,_0x6b17f6;_0x3abfc5['remoteUri']=intUtil[_0x7db7('0x52')](_0x3abfc5[_0x7db7('0x51')]);_0x3abfc5['serverUrl']=intUtil[_0x7db7('0x52')](_0x3abfc5[_0x7db7('0x53')]);def['uri']=util[_0x7db7('0x27')]('%s/service/v4_1/rest.php',_0x3abfc5[_0x7db7('0x51')]);if(_0x250b7c&&_0x250b7c['monitor_format']){logger[_0x7db7('0x9')]('['+_0x471544[_0x7db7('0x72')][_0x7db7('0x73')]()+']',_0x7db7('0x58'));_0x471544[_0x7db7('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3abfc5[_0x7db7('0x53')],_0x471544[_0x7db7('0x5a')],md5(_0x471544[_0x7db7('0x5a')]));}else{_0x471544['recordingURL']='';}return getConnection(_0x3abfc5)[_0x7db7('0x29')](function(_0x12165c){_0x6b17f6=_0x12165c;if(!_[_0x7db7('0x23')](_0x2e4212)){return getUser(_0x3abfc5,_0x2e4212[_0x7db7('0xb')],_0x6b17f6);}else{return getUser(_0x3abfc5,null,_0x6b17f6);}})[_0x7db7('0x29')](function(_0x1f94d5){_0x54ad60=_0x1f94d5;logger[_0x7db7('0x9')](_0x7db7('0x5c'),_0x54ad60['id']);return getEndUser(_0x3abfc5,_0x471544[_0x7db7('0x74')],_0x471544['calleridnum'],_0x6b17f6);})[_0x7db7('0x29')](function(_0x348a53){_0x59ff8a=_0x348a53;logger['info'](_0x7db7('0x5e'),_0x59ff8a['id']);return getTicket(_0x3abfc5,_0x54ad60,_0x59ff8a,_0x54fe94,_0x471544,_0x54fe94[_0x7db7('0x5f')],_0x6b17f6,_0x7db7('0x60'));})['then'](function(_0x613d92){_0xea2e9d=_0x613d92;logger[_0x7db7('0x9')](_0x7db7('0x61'));logger['info'](_0x7db7('0x62'),_0xea2e9d['id']);return setRelationship(_0x6b17f6,_0x54ad60,_0xea2e9d,'users');})[_0x7db7('0x29')](function(){return setRelationship(_0x6b17f6,_0x59ff8a,_0xea2e9d,'contacts');})[_0x7db7('0x29')](function(){return getServerInfo(_0x6b17f6);})[_0x7db7('0x6a')](function(_0xfe6c2f){logger['error']('['+_0x471544[_0x7db7('0x72')][_0x7db7('0x73')]()+']',JSON[_0x7db7('0x22')](_0xfe6c2f));});}; \ No newline at end of file +var _0x3355=['contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','toUpperCase','lodash','bluebird','util','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','map','forEach','type','string','nameField','customField','toLowerCase','content','variable','custom_fields','customVariable','Variable','POST','login','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x3355,0x17d));var _0x5335=function(_0x4ff753,_0x113391){_0x4ff753=_0x4ff753-0x0;var _0x469ac8=_0x3355[_0x4ff753];return _0x469ac8;};'use strict';var _=require(_0x5335('0x0'));var rp=require('request-promise');var BPromise=require(_0x5335('0x1'));var md5=require('md5');var util=require(_0x5335('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x5335('0x3'));config[_0x5335('0x4')]=_[_0x5335('0x5')](config[_0x5335('0x4')],{'host':_0x5335('0x6'),'port':0x18eb});var io=require(_0x5335('0x7'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x14a21e,_0x2bab08,_0x33283f){io['to'](_0x14a21e)[_0x5335('0x8')](_0x2bab08,_0x33283f);}function getTicket(_0x4bf8fc,_0x31dc73,_0x3ef796,_0xaf44bb,_0x257687,_0x36ef7e,_0x3649c8,_0x3127be){logger[_0x5335('0x9')]('Creating\x20new\x20ticket...');var _0xf5252b=new Date();var _0x2111eb=[{'name':'name','value':intUtil[_0x5335('0xa')](_0xaf44bb[_0x5335('0xb')],_0x257687,'\x20')},{'name':_0x5335('0xc'),'value':_0x31dc73['id']},{'name':_0x5335('0xd'),'value':_0x31dc73['id']},{'name':_0x5335('0xe'),'value':intUtil[_0x5335('0xa')](_0xaf44bb[_0x5335('0xf')],_0x257687,'\x0a')},{'name':'date_start','value':_0xf5252b[_0x5335('0x10')]()[_0x5335('0x11')](0x0,0x13)[_0x5335('0x12')]('T','\x20')},{'name':_0x5335('0x13'),'value':'0'},{'name':_0x5335('0x14'),'value':'15'},{'name':_0x5335('0x15'),'value':_0x3ef796['id']},{'name':_0x5335('0x16'),'value':_0x5335('0x17')},{'name':_0x5335('0x18'),'value':_0x3ef796[_0x5335('0x19')]},{'name':'direction','value':_0x3127be}];if(_0x36ef7e['length']){_['forEach'](_0x36ef7e,function(_0x25d7ff){if(_0x257687[_0x25d7ff[_0x5335('0x1a')]]){_0x2111eb[_0x5335('0x1b')]({'name':_0x25d7ff[_0x5335('0x1c')],'value':_0x257687[_0x25d7ff['variableName']]});}});}return request({'form':{'method':_0x5335('0x1d'),'input_type':_0x5335('0x1e'),'response_type':_0x5335('0x1e'),'rest_data':JSON[_0x5335('0x1f')]({'session':_0x3649c8['id'],'module_name':'Calls','name_value_list':_0x2111eb})}});}function getAuth(_0x3b7b1c){return util[_0x5335('0x20')](_0x5335('0x21'),new Buffer(_0x3b7b1c[_0x5335('0x22')]+':X')[_0x5335('0x23')](_0x5335('0x24')));}function getServerInfo(_0x565fb8){return request({'form':{'method':_0x5335('0x25'),'input_type':_0x5335('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x565fb8['id']})}});}function getUser(_0x5914fc,_0x4abf4e,_0x5c1c05){if(!_[_0x5335('0x26')](_0x4abf4e)){logger[_0x5335('0x9')]('Getting\x20agent\x20with\x20name',_0x4abf4e);return request({'form':{'method':'get_entry_list','input_type':_0x5335('0x1e'),'response_type':_0x5335('0x1e'),'rest_data':JSON[_0x5335('0x1f')]({'session':_0x5c1c05['id'],'module_name':_0x5335('0x27'),'query':util[_0x5335('0x20')](_0x5335('0x28'),_0x4abf4e),'order_by':'','offset':'0','select_fields':['id',_0x5335('0x19'),_0x5335('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5335('0x2a')](function(_0x2572b9){if(_0x2572b9[_0x5335('0x2b')]['length']){var _0x1cb0c5=_[_0x5335('0x2c')](_0x2572b9[_0x5335('0x2b')],function(_0x2d7c40){return _0x2d7c40['name_value_list'][_0x5335('0x29')][_0x5335('0x2d')]===_0x4abf4e;});if(_0x1cb0c5){logger[_0x5335('0x9')](_0x5335('0x2e'));return BPromise[_0x5335('0x2f')]({'id':_0x1cb0c5[_0x5335('0x30')]['id']['value'],'name':_0x1cb0c5[_0x5335('0x30')][_0x5335('0x19')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5c1c05[_0x5335('0x30')][_0x5335('0x31')]['value'],'name':_0x5c1c05[_0x5335('0x30')][_0x5335('0x29')][_0x5335('0x2d')]});});}else{logger[_0x5335('0x9')](_0x5335('0x32'));return BPromise[_0x5335('0x2f')]({'id':_0x5c1c05[_0x5335('0x30')]['user_id'][_0x5335('0x2d')],'name':_0x5c1c05[_0x5335('0x30')]['user_name']['value']});}}function getEndUser(_0x5a8656,_0x5409ef,_0x405162,_0xdadf10){logger[_0x5335('0x9')](_0x5335('0x33'),_0x405162);return request({'form':{'method':_0x5335('0x34'),'input_type':_0x5335('0x1e'),'response_type':'JSON','rest_data':JSON[_0x5335('0x1f')]({'session':_0xdadf10['id'],'module_name':_0x5335('0x17'),'query':util[_0x5335('0x20')](_0x5335('0x35'),_0x405162),'order_by':'','offset':'0','select_fields':['id',_0x5335('0x19'),_0x5335('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2f4171){if(_0x2f4171['entry_list'][_0x5335('0x37')]){var _0x18ec3c=_['find'](_0x2f4171[_0x5335('0x2b')],function(_0x2eadd3){return _0x2eadd3[_0x5335('0x30')][_0x5335('0x36')][_0x5335('0x2d')]===_0x405162;});if(_0x18ec3c){logger['info'](_0x5335('0x38'));return BPromise['resolve']({'id':_0x18ec3c[_0x5335('0x30')]['id'][_0x5335('0x2d')],'name':_0x18ec3c[_0x5335('0x30')][_0x5335('0x19')][_0x5335('0x2d')],'phone':_0x18ec3c[_0x5335('0x30')][_0x5335('0x36')]['value']});}}else{logger[_0x5335('0x9')](_0x5335('0x39'));return request({'form':{'method':_0x5335('0x1d'),'input_type':_0x5335('0x1e'),'response_type':_0x5335('0x1e'),'rest_data':JSON[_0x5335('0x1f')]({'session':_0xdadf10['id'],'module_name':_0x5335('0x17'),'name_value_list':[{'name':_0x5335('0x3a'),'value':_0x5409ef!==_0x5335('0x3b')?_0x5409ef:util[_0x5335('0x20')](_0x5335('0x3c'),_0x405162)},{'name':'phone_home','value':_0x405162}]})}})[_0x5335('0x2a')](function(_0x9104ec){logger[_0x5335('0x9')](_0x5335('0x3d'));return BPromise[_0x5335('0x2f')]({'id':_0x9104ec['id'],'name':_0x9104ec[_0x5335('0x2b')][_0x5335('0x3a')][_0x5335('0x2d')],'phone':_0x9104ec[_0x5335('0x2b')]['phone_home'][_0x5335('0x2d')]});});}});}function request(_0x38e94c){logger['debug']('[HTTP]',JSON[_0x5335('0x1f')](_0x38e94c));return rp(_['merge'](def,_0x38e94c));}function getTags(_0x17298c,_0x2719a6){var _0x32b30d=[];if(_0x17298c&&_0x17298c[_0x5335('0x37')]>0x0){_0x32b30d=_[_0x5335('0x3e')](_0x17298c,_0x2719a6);}return _0x32b30d;}function getCustomFields(_0x5375a2,_0x2287f1){var _0x56f969=[];var _0x1257fd={'custom_fields':[]};if(_0x5375a2[_0x5335('0x37')]>0x0){_[_0x5335('0x3f')](_0x5375a2,function(_0x349b9a){if(_0x349b9a[_0x5335('0x40')]===_0x5335('0x41')&&_0x349b9a[_0x5335('0x42')]&&!_0x349b9a[_0x5335('0x43')]){_0x1257fd[_0x349b9a[_0x5335('0x42')][_0x5335('0x44')]()]=_0x349b9a[_0x5335('0x45')]['toString']();}else if(_0x349b9a[_0x5335('0x40')]===_0x5335('0x41')&&_0x349b9a[_0x5335('0x1c')]&&_0x349b9a['customField']){_0x1257fd['custom_fields'][_0x5335('0x1b')]({'id':_0x349b9a[_0x5335('0x1c')],'value':_0x349b9a[_0x5335('0x45')]['toString']()});}else if(_0x349b9a[_0x5335('0x40')]===_0x5335('0x46')&&_0x349b9a['variableName']&&_0x349b9a['idField']&&_0x349b9a['customField']){_0x2287f1[_0x349b9a[_0x5335('0x1a')]]&&_0x1257fd[_0x5335('0x47')]['push']({'id':_0x349b9a['idField'],'value':_0x2287f1[_0x349b9a[_0x5335('0x1a')]][_0x5335('0x23')]()});}else if(_0x349b9a[_0x5335('0x40')]===_0x5335('0x48')&&_0x349b9a[_0x5335('0x49')]&&_0x349b9a[_0x5335('0x49')][_0x5335('0x19')]&&_0x349b9a['idField']&&_0x349b9a[_0x5335('0x43')]){_0x2287f1[_0x349b9a[_0x5335('0x49')]['name'][_0x5335('0x44')]()]&&_0x1257fd[_0x5335('0x47')][_0x5335('0x1b')]({'id':_0x349b9a[_0x5335('0x1c')],'value':_0x2287f1[_0x349b9a['Variable'][_0x5335('0x19')][_0x5335('0x44')]()][_0x5335('0x23')]()});}});}return _0x1257fd;}function getConnection(_0x5a6918){return request({'method':_0x5335('0x4a'),'form':{'method':_0x5335('0x4b'),'input_type':'JSON','response_type':_0x5335('0x1e'),'rest_data':JSON[_0x5335('0x1f')]({'user_auth':{'user_name':_0x5a6918[_0x5335('0x4c')],'password':_0x5a6918[_0x5335('0x4d')],'encryption':_0x5335('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x5335('0x2a')](function(_0x37d1b4){var _0x37aeea=_0x37d1b4;if(_0x37aeea['id']){def['sessionID']=_0x37aeea['id'];return BPromise[_0x5335('0x2f')](_0x37aeea);}else{throw new Error(util['format'](_0x5335('0x4f'),_0x5a6918['id']));}});}function setRelationship(_0x5b3b7b,_0x21e7c1,_0x4ad658,_0x4b0695){return request({'form':{'method':_0x5335('0x50'),'input_type':_0x5335('0x1e'),'response_type':_0x5335('0x1e'),'rest_data':JSON['stringify']({'session':_0x5b3b7b['id'],'module_name':_0x5335('0x51'),'module_id':_0x4ad658['id'],'link_field_name':_0x4b0695,'related_ids':[_0x21e7c1['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x2ce6f3,_0x4c2bba,_0x4311e9,_0x3d56ed,_0xedd47d,_0x1601ca){var _0xc27118,_0x17e5b8,_0x49d47c,_0x1e0e10;_0x1601ca['remoteUri']=intUtil[_0x5335('0x52')](_0x1601ca['remoteUri']);_0x1601ca['serverUrl']=intUtil['stripTrailingSlash'](_0x1601ca[_0x5335('0x53')]);def[_0x5335('0x54')]=util[_0x5335('0x20')](_0x5335('0x55'),_0x1601ca[_0x5335('0x56')]);if(_0xedd47d&&_0xedd47d['monitor_format']){logger[_0x5335('0x9')]('[QUEUE]',_0x5335('0x57'));_0x4c2bba['recordingURL']=util[_0x5335('0x20')](_0x5335('0x58'),_0x1601ca[_0x5335('0x53')],_0x4c2bba[_0x5335('0x59')],md5(_0x4c2bba['uniqueid']));}else{_0x4c2bba[_0x5335('0x5a')]='';}return getConnection(_0x1601ca)[_0x5335('0x2a')](function(_0xbc62bd){_0x1e0e10=_0xbc62bd;return getUser(_0x1601ca,_0x3d56ed['name'],_0x1e0e10);})[_0x5335('0x2a')](function(_0x38863b){_0xc27118=_0x38863b;logger[_0x5335('0x9')](_0x5335('0x5b'),_0xc27118['id']);return getEndUser(_0x1601ca,_0x4c2bba[_0x5335('0x5c')],_0x4c2bba[_0x5335('0x5d')],_0x1e0e10);})[_0x5335('0x2a')](function(_0x86b8b6){_0x17e5b8=_0x86b8b6;logger[_0x5335('0x9')]('The\x20Enduser\x20ID\x20is:',_0x17e5b8['id']);return getTicket(_0x1601ca,_0xc27118,_0x17e5b8,_0x4311e9,_0x4c2bba,_0x4311e9[_0x5335('0x5e')],_0x1e0e10,_0x5335('0x5f'));})['then'](function(_0x545fc1){_0x49d47c=_0x545fc1;logger[_0x5335('0x9')](_0x5335('0x60'));logger['info'](_0x5335('0x61'),_0x49d47c['id']);return setRelationship(_0x1e0e10,_0xc27118,_0x49d47c,_0x5335('0x62'));})[_0x5335('0x2a')](function(){return setRelationship(_0x1e0e10,_0x17e5b8,_0x49d47c,_0x5335('0x63'));})[_0x5335('0x2a')](function(){return getServerInfo(_0x1e0e10);})['then'](function(_0xd51df2){var _0x15b41d=parseInt(_0xd51df2[_0x5335('0x64')][_0x5335('0x65')](0x0));var _0x7260fe=util[_0x5335('0x20')](_0x5335('0x66'),_0x1601ca[_0x5335('0x56')],_0x49d47c['id']);if(_0x15b41d>0x6){_0x7260fe=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1601ca[_0x5335('0x56')],_0x49d47c['id']);}logger['info'](_0x5335('0x67'),_0x5335('0x68'));emit(util[_0x5335('0x20')](_0x5335('0x69'),_0x3d56ed[_0x5335('0x19')]),_0x5335('0x6a'),{'uri':_0x7260fe});})['catch'](function(_0x13171){logger[_0x5335('0x6b')]('[QUEUE]',JSON['stringify'](_0x13171));});};exports[_0x5335('0x6c')]=function(_0x1ac1c0,_0x22eba5,_0x14fef1,_0x2791cc,_0x10f90c,_0x515164,_0x509bbb){var _0x35cedf,_0x2bcea2,_0x522c3b,_0x1c4928;_0x515164[_0x5335('0x56')]=intUtil[_0x5335('0x52')](_0x515164[_0x5335('0x56')]);_0x515164[_0x5335('0x53')]=intUtil['stripTrailingSlash'](_0x515164[_0x5335('0x53')]);def[_0x5335('0x54')]=util[_0x5335('0x20')](_0x5335('0x55'),_0x515164[_0x5335('0x56')]);if(_0x509bbb&&_0x509bbb[_0x5335('0x6d')]&&_0x509bbb[_0x5335('0x6d')]!==_0x5335('0x6e')){logger[_0x5335('0x9')](_0x5335('0x6f'),_0x5335('0x57'));_0x22eba5[_0x5335('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x515164['serverUrl'],_0x22eba5[_0x5335('0x59')],md5(_0x22eba5[_0x5335('0x59')]));}return getConnection(_0x515164)[_0x5335('0x2a')](function(_0x476053){_0x1c4928=_0x476053;return getUser(_0x515164,_0x2791cc[_0x5335('0x19')],_0x1c4928);})['then'](function(_0x2d1c51){_0x35cedf=_0x2d1c51;logger['info']('The\x20User\x20ID\x20is:',_0x35cedf['id']);return getEndUser(_0x515164,_0x22eba5[_0x5335('0x70')],_0x22eba5[_0x5335('0x71')],_0x1c4928);})[_0x5335('0x2a')](function(_0x33c656){_0x2bcea2=_0x33c656;logger['info'](_0x5335('0x72'),_0x2bcea2['id']);return getTicket(_0x515164,_0x35cedf,_0x2bcea2,_0x14fef1,_0x22eba5,_0x14fef1['Fields'],_0x1c4928,_0x5335('0x73'));})[_0x5335('0x2a')](function(_0xb1a8aa){_0x522c3b=_0xb1a8aa;logger[_0x5335('0x9')]('Ticket\x20created!');logger[_0x5335('0x9')](_0x5335('0x61'),_0x522c3b['id']);return setRelationship(_0x1c4928,_0x35cedf,_0x522c3b,_0x5335('0x62'));})[_0x5335('0x2a')](function(){return setRelationship(_0x1c4928,_0x2bcea2,_0x522c3b,_0x5335('0x63'));})['then'](function(){return getServerInfo(_0x1c4928);})[_0x5335('0x2a')](function(_0x4383a9){var _0x8357cb=parseInt(_0x4383a9[_0x5335('0x64')][_0x5335('0x65')](0x0));var _0x15c68b=util[_0x5335('0x20')](_0x5335('0x66'),_0x515164['remoteUri'],_0x522c3b['id']);if(_0x8357cb>0x6){_0x15c68b=util[_0x5335('0x20')](_0x5335('0x74'),_0x515164[_0x5335('0x56')],_0x522c3b['id']);}logger[_0x5335('0x9')](_0x5335('0x6f'),_0x5335('0x68'));emit(util['format'](_0x5335('0x69'),_0x2791cc[_0x5335('0x19')]),_0x5335('0x6a'),{'uri':_0x15c68b});})['catch'](function(_0xd40655){logger[_0x5335('0x6b')](_0x5335('0x6f'),JSON[_0x5335('0x1f')](_0xd40655));});};exports[_0x5335('0x75')]=function(_0x5e021d,_0x3f401d,_0x184da8,_0x42f932,_0xc26036,_0x57d139){var _0x20141d,_0x5de2f5,_0x4b3a95,_0x140fbe;_0x57d139[_0x5335('0x56')]=intUtil[_0x5335('0x52')](_0x57d139[_0x5335('0x56')]);_0x57d139[_0x5335('0x53')]=intUtil[_0x5335('0x52')](_0x57d139[_0x5335('0x53')]);def[_0x5335('0x54')]=util['format'](_0x5335('0x55'),_0x57d139['remoteUri']);if(_0xc26036&&_0xc26036['monitor_format']){logger[_0x5335('0x9')]('['+_0x3f401d[_0x5335('0x76')]['toUpperCase']()+']',_0x5335('0x57'));_0x3f401d[_0x5335('0x5a')]=util[_0x5335('0x20')](_0x5335('0x58'),_0x57d139[_0x5335('0x53')],_0x3f401d[_0x5335('0x59')],md5(_0x3f401d[_0x5335('0x59')]));}else{_0x3f401d[_0x5335('0x5a')]='';}return getConnection(_0x57d139)[_0x5335('0x2a')](function(_0x593d88){_0x140fbe=_0x593d88;if(!_[_0x5335('0x26')](_0x42f932)){return getUser(_0x57d139,_0x42f932[_0x5335('0x19')],_0x140fbe);}else{return getUser(_0x57d139,null,_0x140fbe);}})[_0x5335('0x2a')](function(_0x4e1795){_0x20141d=_0x4e1795;logger[_0x5335('0x9')]('The\x20User\x20ID\x20is:',_0x20141d['id']);return getEndUser(_0x57d139,_0x3f401d[_0x5335('0x5c')],_0x3f401d[_0x5335('0x5d')],_0x140fbe);})['then'](function(_0xae407a){_0x5de2f5=_0xae407a;logger[_0x5335('0x9')](_0x5335('0x72'),_0x5de2f5['id']);return getTicket(_0x57d139,_0x20141d,_0x5de2f5,_0x184da8,_0x3f401d,_0x184da8[_0x5335('0x5e')],_0x140fbe,_0x5335('0x5f'));})[_0x5335('0x2a')](function(_0x4fed53){_0x4b3a95=_0x4fed53;logger[_0x5335('0x9')](_0x5335('0x60'));logger['info'](_0x5335('0x61'),_0x4b3a95['id']);return setRelationship(_0x140fbe,_0x20141d,_0x4b3a95,'users');})[_0x5335('0x2a')](function(){return setRelationship(_0x140fbe,_0x5de2f5,_0x4b3a95,_0x5335('0x63'));})[_0x5335('0x2a')](function(){return getServerInfo(_0x140fbe);})['catch'](function(_0x195512){logger[_0x5335('0x6b')]('['+_0x3f401d[_0x5335('0x76')][_0x5335('0x77')]()+']',JSON[_0x5335('0x1f')](_0x195512));});}; \ 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 6f40221..017ae48 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 _0xc439=['slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','string','push','content','variable','variableName','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','customVariable','join'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xc439,0x14a));var _0x9c43=function(_0x542283,_0x3688f2){_0x542283=_0x542283-0x0;var _0x49149b=_0xc439[_0x542283];return _0x49149b;};'use strict';var _=require(_0x9c43('0x0'));var util=require(_0x9c43('0x1'));exports[_0x9c43('0x2')]=function(_0x22b571,_0x19ea65,_0x46038e){var _0x1ed414=[];if(_0x22b571[_0x9c43('0x3')]>0x0){var _0x2c84d1=_['sortBy'](_0x22b571,['id']);for(var _0x4c1f8b=0x0;_0x4c1f8b<_0x2c84d1[_0x9c43('0x3')];_0x4c1f8b++){var _0x1a9edf=_0x2c84d1[_0x4c1f8b];if(_0x1a9edf[_0x9c43('0x4')]===_0x9c43('0x5')){_0x1ed414[_0x9c43('0x6')](_0x1a9edf[_0x9c43('0x7')]);}else if(_0x1a9edf[_0x9c43('0x4')]===_0x9c43('0x8')&&_0x1a9edf['variableName']){_0x19ea65[_0x1a9edf[_0x9c43('0x9')]]&&_0x1ed414[_0x9c43('0x6')](_0x19ea65[_0x1a9edf['variableName']]['toString']());}else if(_0x1a9edf[_0x9c43('0x4')]==='customVariable'&&_0x1a9edf[_0x9c43('0xa')]&&_0x1a9edf[_0x9c43('0xa')]['name']){_0x19ea65[_0x1a9edf[_0x9c43('0xa')][_0x9c43('0xb')][_0x9c43('0xc')]()]&&_0x1ed414[_0x9c43('0x6')](_0x19ea65[_0x1a9edf[_0x9c43('0xa')][_0x9c43('0xb')][_0x9c43('0xc')]()]['toString']());}else if(_0x1a9edf[_0x9c43('0x4')]===_0x9c43('0xd')){if(_0x1a9edf['keyType']==='string'&&_0x1a9edf[_0x9c43('0xe')]){_0x1ed414[_0x9c43('0x6')](util[_0x9c43('0xf')](_0x9c43('0x10'),_0x1a9edf[_0x9c43('0xe')],_0x1a9edf[_0x9c43('0x11')]));}else if(_0x1a9edf[_0x9c43('0x12')]===_0x9c43('0x8')&&_0x1a9edf['variableName']&&_0x1a9edf[_0x9c43('0xe')]){_0x19ea65[_0x1a9edf[_0x9c43('0x9')]]&&_0x1ed414[_0x9c43('0x6')](util[_0x9c43('0xf')](_0x9c43('0x10'),_0x1a9edf['key'],_0x19ea65[_0x1a9edf[_0x9c43('0x9')]]));}else if(_0x1a9edf['keyType']===_0x9c43('0x13')&&_0x1a9edf[_0x9c43('0xa')]&&_0x1a9edf['Variable']['name']&&_0x1a9edf[_0x9c43('0xe')]){_0x19ea65[_0x1a9edf[_0x9c43('0xa')][_0x9c43('0xb')][_0x9c43('0xc')]()]&&_0x1ed414['push'](util[_0x9c43('0xf')]('%s:\x20%s',_0x1a9edf[_0x9c43('0xe')],_0x19ea65[_0x1a9edf['Variable']['name'][_0x9c43('0xc')]()]));}}}}return _0x1ed414[_0x9c43('0x14')](_0x46038e);};exports['stripTrailingSlash']=function(_0x33cd5f){var _0xbde00a=_0x33cd5f[_0x9c43('0x15')](-0x1);if(_0xbde00a==='/'){_0x33cd5f=_0x33cd5f[_0x9c43('0x16')](0x0,_0x33cd5f[_0x9c43('0x17')](_0xbde00a));}return _0x33cd5f;};exports[_0x9c43('0x18')]=function(_0x2d4d7a){if(!_[_0x9c43('0x19')](_0x2d4d7a)&&_0x2d4d7a!==''){var _0x5cfdb7=/^(([^<>()\[\]\\.,;:\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 _0x5cfdb7[_0x9c43('0x1a')](String(_0x2d4d7a)[_0x9c43('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x455d=['keyValue','keyType','key','format','%s:\x20%s','variableName','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','util','sortBy','type','string','push','variable','toString','customVariable','Variable','name','toLowerCase'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x455d,0x1bd));var _0xd455=function(_0x5046a6,_0x36001c){_0x5046a6=_0x5046a6-0x0;var _0x4a0b70=_0x455d[_0x5046a6];return _0x4a0b70;};'use strict';var _=require('lodash');var util=require(_0xd455('0x0'));exports['getString']=function(_0x8d5e3d,_0x18d2fd,_0x12d296){var _0x3fd641=[];if(_0x8d5e3d['length']>0x0){var _0x4e5eed=_[_0xd455('0x1')](_0x8d5e3d,['id']);for(var _0x377768=0x0;_0x377768<_0x4e5eed['length'];_0x377768++){var _0x1771d6=_0x4e5eed[_0x377768];if(_0x1771d6[_0xd455('0x2')]===_0xd455('0x3')){_0x3fd641[_0xd455('0x4')](_0x1771d6['content']);}else if(_0x1771d6[_0xd455('0x2')]===_0xd455('0x5')&&_0x1771d6['variableName']){_0x18d2fd[_0x1771d6['variableName']]&&_0x3fd641[_0xd455('0x4')](_0x18d2fd[_0x1771d6['variableName']][_0xd455('0x6')]());}else if(_0x1771d6[_0xd455('0x2')]===_0xd455('0x7')&&_0x1771d6['Variable']&&_0x1771d6[_0xd455('0x8')]['name']){_0x18d2fd[_0x1771d6['Variable']['name']['toLowerCase']()]&&_0x3fd641[_0xd455('0x4')](_0x18d2fd[_0x1771d6[_0xd455('0x8')][_0xd455('0x9')][_0xd455('0xa')]()][_0xd455('0x6')]());}else if(_0x1771d6['type']===_0xd455('0xb')){if(_0x1771d6[_0xd455('0xc')]===_0xd455('0x3')&&_0x1771d6[_0xd455('0xd')]){_0x3fd641[_0xd455('0x4')](util[_0xd455('0xe')](_0xd455('0xf'),_0x1771d6[_0xd455('0xd')],_0x1771d6['keyContent']));}else if(_0x1771d6['keyType']===_0xd455('0x5')&&_0x1771d6[_0xd455('0x10')]&&_0x1771d6[_0xd455('0xd')]){_0x18d2fd[_0x1771d6[_0xd455('0x10')]]&&_0x3fd641[_0xd455('0x4')](util[_0xd455('0xe')](_0xd455('0xf'),_0x1771d6[_0xd455('0xd')],_0x18d2fd[_0x1771d6[_0xd455('0x10')]]));}else if(_0x1771d6[_0xd455('0xc')]===_0xd455('0x7')&&_0x1771d6[_0xd455('0x8')]&&_0x1771d6[_0xd455('0x8')][_0xd455('0x9')]&&_0x1771d6['key']){_0x18d2fd[_0x1771d6[_0xd455('0x8')]['name'][_0xd455('0xa')]()]&&_0x3fd641[_0xd455('0x4')](util[_0xd455('0xe')]('%s:\x20%s',_0x1771d6['key'],_0x18d2fd[_0x1771d6['Variable'][_0xd455('0x9')][_0xd455('0xa')]()]));}}}}return _0x3fd641[_0xd455('0x11')](_0x12d296);};exports[_0xd455('0x12')]=function(_0x3d38c6){var _0x439115=_0x3d38c6[_0xd455('0x13')](-0x1);if(_0x439115==='/'){_0x3d38c6=_0x3d38c6['substring'](0x0,_0x3d38c6[_0xd455('0x14')](_0x439115));}return _0x3d38c6;};exports[_0xd455('0x15')]=function(_0x21e36a){if(!_[_0xd455('0x16')](_0x21e36a)&&_0x21e36a!==''){var _0x5b2d83=/^(([^<>()\[\]\\.,;:\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 _0x5b2d83[_0xd455('0x17')](String(_0x21e36a)[_0xd455('0xa')]());}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 8dfeb73..a7a1df2 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(_0x35452e,_0x30eb8b){var _0x11a7ec=function(_0x38935f){while(--_0x38935f){_0x35452e['push'](_0x35452e['shift']());}};_0x11a7ec(++_0x30eb8b);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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(_0x372203,_0x478c75){var _0x4d387c=function(_0x1e367a){while(--_0x1e367a){_0x372203['push'](_0x372203['shift']());}};_0x4d387c(++_0x478c75);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'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 284aacf..20cfd3b 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 _0xa2b8=['Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','%s/search.json','remoteUri','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','catch','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','The\x20Enduser\x20ID\x20is:','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','../../../../config/environment','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','Tags','name','getString','Subjects','Descriptions','Fields','then'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0xa2b8,0x19f));var _0x8a2b=function(_0x19f418,_0x106db3){_0x19f418=_0x19f418-0x0;var _0x5871cb=_0xa2b8[_0x19f418];return _0x5871cb;};'use strict';var _=require('lodash');var rp=require(_0x8a2b('0x0'));var md5=require('md5');var util=require(_0x8a2b('0x1'));var Redis=require(_0x8a2b('0x2'));var intUtil=require('./util');var config=require(_0x8a2b('0x3'));var logger=require('../../../../config/logger')(_0x8a2b('0x4'));config[_0x8a2b('0x5')]=_['defaults'](config[_0x8a2b('0x5')],{'host':_0x8a2b('0x6'),'port':0x18eb});var io=require(_0x8a2b('0x7'))(new Redis(config[_0x8a2b('0x5')]));function emit(_0x4da66f,_0x37b850,_0x292dcf){io['to'](_0x4da66f)[_0x8a2b('0x8')](_0x37b850,_0x292dcf);}var headers={'Content-Type':_0x8a2b('0x9'),'Accept':'application/json'};function getTicket(_0x3d7cf5,_0x3110c9,_0x4ae214,_0x132236,_0x1adecb){logger[_0x8a2b('0xa')](_0x8a2b('0xb'));return request({'uri':util['format'](_0x8a2b('0xc'),_0x3d7cf5['remoteUri']),'method':_0x8a2b('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x4ae214['id'],'submitter_id':_0x3110c9?_0x3110c9['id']:undefined,'assignee_id':_0x3110c9?_0x3110c9['id']:undefined,'tags':getTags(_0x132236[_0x8a2b('0xe')],_0x8a2b('0xf')),'subject':intUtil[_0x8a2b('0x10')](_0x132236[_0x8a2b('0x11')],_0x1adecb,'\x20'),'description':intUtil[_0x8a2b('0x10')](_0x132236['Descriptions'],_0x1adecb,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8a2b('0x10')](_0x132236[_0x8a2b('0x12')],_0x1adecb,'\x0a')}},getCustomFields(_0x132236[_0x8a2b('0x13')],_0x1adecb))}})[_0x8a2b('0x14')](function(_0x55fb6e){logger[_0x8a2b('0xa')](_0x8a2b('0x15'));return _0x55fb6e[_0x8a2b('0x16')];});}function getUser(_0x3507a5,_0x387722){if(intUtil['validateEmail'](_0x387722)){logger[_0x8a2b('0xa')](_0x8a2b('0x17'),_0x387722);return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x19'),_0x3507a5[_0x8a2b('0x1a')]),'qs':{'query':util[_0x8a2b('0x18')]('type:user\x20role:agent\x20email:%s',_0x387722)}})[_0x8a2b('0x14')](function(_0x43114f){if(_0x43114f[_0x8a2b('0x1b')]){logger['info']('Agent\x20found!');return _[_0x8a2b('0x1c')](_0x43114f['results'],{'email':_0x387722,'role':_0x8a2b('0x1d')});}else{logger[_0x8a2b('0xa')](_0x8a2b('0x1e'));return request({'uri':util[_0x8a2b('0x18')]('%s/users/me.json',_0x3507a5['remoteUri'])})['then'](function(_0x247e4f){logger[_0x8a2b('0xa')](_0x8a2b('0x1f'));return _0x247e4f[_0x8a2b('0x20')];});}});}else{logger[_0x8a2b('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x21'),_0x3507a5['remoteUri'])})['then'](function(_0x214871){logger[_0x8a2b('0xa')]('Admin\x20account\x20selected.');return _0x214871[_0x8a2b('0x20')];});}}function getEndUser(_0x41f3b4,_0x4ac664,_0x14f1a0){logger['info'](_0x8a2b('0x22'),_0x14f1a0);return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x19'),_0x41f3b4[_0x8a2b('0x1a')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x14f1a0)}})[_0x8a2b('0x14')](function(_0x4adb11){var _0x20408d;if(_0x4adb11[_0x8a2b('0x23')]['length']){_0x4adb11['results']=_[_0x8a2b('0x24')](_0x4adb11['results'],{'suspended':![],'role':_0x8a2b('0x25')});if(_0x4adb11['results'][_0x8a2b('0x26')]){_0x20408d=_[_0x8a2b('0x27')](_0x4adb11['results']);}}if(_0x20408d){logger[_0x8a2b('0xa')](_0x8a2b('0x28'));return _0x20408d;}else{logger[_0x8a2b('0xa')](_0x8a2b('0x29'));return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x2a'),_0x41f3b4[_0x8a2b('0x1a')]),'method':_0x8a2b('0xd'),'body':{'user':{'role':_0x8a2b('0x25'),'name':util[_0x8a2b('0x18')](_0x8a2b('0x2b'),_0x4ac664||_0x14f1a0),'phone':_0x14f1a0}}})['then'](function(_0x31a6d6){logger[_0x8a2b('0xa')]('Enduser\x20created.');return _0x31a6d6[_0x8a2b('0x20')];});}});}function getAuth(_0x386fe9){var _0x4f9242;if(_0x386fe9[_0x8a2b('0x2c')]===_0x8a2b('0x2d')){_0x4f9242=util['format'](_0x8a2b('0x2e'),_0x386fe9[_0x8a2b('0x2f')],_0x386fe9[_0x8a2b('0x2d')]);}else if(_0x386fe9[_0x8a2b('0x2c')]==='token'){_0x4f9242=util[_0x8a2b('0x18')](_0x8a2b('0x30'),_0x386fe9['username'],_0x386fe9['token']);}return util[_0x8a2b('0x18')](_0x8a2b('0x31'),new Buffer(_0x4f9242)[_0x8a2b('0x32')](_0x8a2b('0x33')));}function request(_0x306ad1){logger['debug'](_0x8a2b('0x34'),JSON[_0x8a2b('0x35')](_0x306ad1));return rp(_[_0x8a2b('0x36')](_0x306ad1,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x14cdea,_0x4ac9b1){var _0x5a6c87=[];if(_0x14cdea&&_0x14cdea[_0x8a2b('0x26')]>0x0){_0x5a6c87=_[_0x8a2b('0x37')](_0x14cdea,_0x4ac9b1);}return _0x5a6c87;}function getCustomFields(_0x458c85,_0x1567f8){var _0x190237=[];var _0x4f902e={'custom_fields':[]};if(_0x458c85[_0x8a2b('0x26')]>0x0){_[_0x8a2b('0x38')](_0x458c85,function(_0x31c79d){if(_[_0x8a2b('0x39')]([_0x8a2b('0x3a'),_0x8a2b('0x3b')],_0x31c79d[_0x8a2b('0x3c')])&&_0x31c79d[_0x8a2b('0x3d')]&&!_0x31c79d[_0x8a2b('0x3e')]){_0x4f902e[_0x31c79d['nameField'][_0x8a2b('0x3f')]()]=_0x31c79d[_0x8a2b('0x40')]['toString']();}else if(_[_0x8a2b('0x39')](['string',_0x8a2b('0x3b')],_0x31c79d[_0x8a2b('0x3c')])&&_0x31c79d[_0x8a2b('0x41')]&&_0x31c79d[_0x8a2b('0x3e')]){_0x4f902e[_0x8a2b('0x42')][_0x8a2b('0x43')]({'id':_0x31c79d[_0x8a2b('0x41')],'value':_0x31c79d[_0x8a2b('0x40')]['toString']()});}else if(_0x31c79d[_0x8a2b('0x3c')]===_0x8a2b('0x44')&&_0x31c79d[_0x8a2b('0x45')]&&_0x31c79d[_0x8a2b('0x41')]&&_0x31c79d[_0x8a2b('0x3e')]){_0x1567f8[_0x31c79d[_0x8a2b('0x45')]]&&_0x4f902e[_0x8a2b('0x42')]['push']({'id':_0x31c79d[_0x8a2b('0x41')],'value':_0x1567f8[_0x31c79d[_0x8a2b('0x45')]][_0x8a2b('0x32')]()});}else if(_0x31c79d['type']===_0x8a2b('0x46')&&_0x31c79d['Variable']&&_0x31c79d['Variable'][_0x8a2b('0xf')]&&_0x31c79d[_0x8a2b('0x41')]&&_0x31c79d['customField']){_0x1567f8[_0x31c79d[_0x8a2b('0x47')]['name'][_0x8a2b('0x3f')]()]&&_0x4f902e[_0x8a2b('0x42')][_0x8a2b('0x43')]({'id':_0x31c79d[_0x8a2b('0x41')],'value':_0x1567f8[_0x31c79d[_0x8a2b('0x47')][_0x8a2b('0xf')][_0x8a2b('0x3f')]()][_0x8a2b('0x32')]()});}});}return _0x4f902e;}exports['queue']=function(_0x325246,_0x15b29a,_0x1c8770,_0x14d2d5,_0x27e8fc,_0xae95a3){var _0x2dec05,_0x82cd5f;_0xae95a3[_0x8a2b('0x1a')]=intUtil[_0x8a2b('0x48')](_0xae95a3[_0x8a2b('0x1a')]);_0xae95a3[_0x8a2b('0x49')]=intUtil['stripTrailingSlash'](_0xae95a3[_0x8a2b('0x49')]);if(_0x27e8fc&&_0x27e8fc['monitor_format']){logger['info'](_0x8a2b('0x4a'),_0x8a2b('0x4b'));_0x15b29a['recordingURL']=util[_0x8a2b('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xae95a3['serverUrl'],_0x15b29a['uniqueid'],md5(_0x15b29a[_0x8a2b('0x4c')]));}else{_0x15b29a[_0x8a2b('0x4d')]='';}headers[_0x8a2b('0x4e')]=getAuth(_0xae95a3);return getUser(_0xae95a3,_0x14d2d5['email'])[_0x8a2b('0x14')](function(_0xd88d44){_0x2dec05=_0xd88d44;logger[_0x8a2b('0xa')](_0x8a2b('0x4f'),_0x2dec05['id']);return getEndUser(_0xae95a3,_0x15b29a[_0x8a2b('0x50')],_0x15b29a['calleridnum']);})['then'](function(_0x1a4835){_0x82cd5f=_0x1a4835;logger[_0x8a2b('0xa')]('The\x20Enduser\x20ID\x20is:',_0x82cd5f['id']);return getTicket(_0xae95a3,_0x2dec05,_0x82cd5f,_0x1c8770,_0x15b29a);})[_0x8a2b('0x14')](function(_0x37057e){if(_0x37057e){logger[_0x8a2b('0xa')](_0x8a2b('0x51'),_0x37057e['id']);switch(_0xae95a3['type']){case _0x8a2b('0x52'):logger[_0x8a2b('0xa')]('[QUEUE]',_0x8a2b('0x53'));return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x54'),_0xae95a3[_0x8a2b('0x1a')],_0x2dec05['id'],_0x37057e['id']),'method':_0x8a2b('0xd')});case _0x8a2b('0x55'):logger[_0x8a2b('0xa')](_0x8a2b('0x4a'),_0x8a2b('0x56'));emit(util['format'](_0x8a2b('0x57'),_0x14d2d5['name']),_0x8a2b('0x58'),{'uri':util[_0x8a2b('0x18')](_0x8a2b('0x59'),_0xae95a3[_0x8a2b('0x1a')]['replace'](_0x8a2b('0x5a'),''),_0x37057e['id'])});break;default:logger[_0x8a2b('0x5b')](_0x8a2b('0x4a'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x8a2b('0x5c')](function(_0x168c1c){logger[_0x8a2b('0x5b')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x168c1c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x7a24f0,_0x383588,_0x52bb52,_0x519c14,_0x2227b6,_0x30a55c,_0x448181){var _0x1e8bf5,_0x28d46c;_0x30a55c[_0x8a2b('0x1a')]=intUtil[_0x8a2b('0x48')](_0x30a55c[_0x8a2b('0x1a')]);_0x30a55c[_0x8a2b('0x49')]=intUtil['stripTrailingSlash'](_0x30a55c['serverUrl']);if(_0x448181&&_0x448181[_0x8a2b('0x5d')]&&_0x448181[_0x8a2b('0x5d')]!==_0x8a2b('0x5e')){logger['info'](_0x8a2b('0x5f'),_0x8a2b('0x4b'));_0x383588[_0x8a2b('0x4d')]=util['format'](_0x8a2b('0x60'),_0x30a55c[_0x8a2b('0x49')],_0x383588[_0x8a2b('0x4c')],md5(_0x383588['uniqueid']));}headers['Authorization']=getAuth(_0x30a55c);return getUser(_0x30a55c,_0x519c14[_0x8a2b('0x61')])[_0x8a2b('0x14')](function(_0xbb1c6b){_0x1e8bf5=_0xbb1c6b;logger[_0x8a2b('0xa')](_0x8a2b('0x4f'),_0x1e8bf5['id']);return getEndUser(_0x30a55c,_0x383588[_0x8a2b('0x62')],_0x383588['destcalleridnum']);})[_0x8a2b('0x14')](function(_0x2affea){_0x28d46c=_0x2affea;logger[_0x8a2b('0xa')](_0x8a2b('0x63'),_0x28d46c['id']);return getTicket(_0x30a55c,_0x1e8bf5,_0x28d46c,_0x52bb52,_0x383588);})[_0x8a2b('0x14')](function(_0x1d6de8){if(_0x1d6de8){logger[_0x8a2b('0xa')](_0x8a2b('0x51'),_0x1d6de8['id']);switch(_0x30a55c['type']){case _0x8a2b('0x52'):logger[_0x8a2b('0xa')]('[OUTBOUND]',_0x8a2b('0x53'));return request({'uri':util[_0x8a2b('0x18')](_0x8a2b('0x54'),_0x30a55c[_0x8a2b('0x1a')],_0x1e8bf5['id'],_0x1d6de8['id']),'method':_0x8a2b('0xd')});case'newTab':logger[_0x8a2b('0xa')](_0x8a2b('0x5f'),_0x8a2b('0x56'));emit(util[_0x8a2b('0x18')](_0x8a2b('0x57'),_0x519c14['name']),_0x8a2b('0x58'),{'uri':util[_0x8a2b('0x18')](_0x8a2b('0x59'),_0x30a55c[_0x8a2b('0x1a')][_0x8a2b('0x64')](_0x8a2b('0x5a'),''),_0x1d6de8['id'])});break;default:logger[_0x8a2b('0x5b')](_0x8a2b('0x5f'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x8a2b('0x5c')](function(_0x7060bd){logger[_0x8a2b('0x5b')](_0x8a2b('0x65'),util[_0x8a2b('0x66')](_0x7060bd,{'showHidden':!![],'depth':null}));});};exports[_0x8a2b('0x67')]=function(_0x57b0c0,_0x142397,_0x24e050,_0x72307a,_0x3a9253,_0x5af77e){var _0x3ea63c,_0x303e87;_0x5af77e[_0x8a2b('0x1a')]=intUtil['stripTrailingSlash'](_0x5af77e['remoteUri']);_0x5af77e[_0x8a2b('0x49')]=intUtil[_0x8a2b('0x48')](_0x5af77e[_0x8a2b('0x49')]);if(_0x3a9253&&_0x3a9253[_0x8a2b('0x68')]){logger['info']('['+_0x142397['lastevent'][_0x8a2b('0x69')]()+']',_0x8a2b('0x4b'));_0x142397[_0x8a2b('0x4d')]=util[_0x8a2b('0x18')](_0x8a2b('0x60'),_0x5af77e[_0x8a2b('0x49')],_0x142397[_0x8a2b('0x4c')],md5(_0x142397['uniqueid']));}else{_0x142397[_0x8a2b('0x4d')]='';}headers[_0x8a2b('0x4e')]=getAuth(_0x5af77e);return getUser(_0x5af77e)[_0x8a2b('0x14')](function(_0x1e3174){_0x3ea63c=_0x1e3174;logger[_0x8a2b('0xa')](_0x8a2b('0x4f'),_0x3ea63c['id']);return getEndUser(_0x5af77e,_0x142397[_0x8a2b('0x50')],_0x142397[_0x8a2b('0x6a')]);})[_0x8a2b('0x14')](function(_0x4754e1){_0x303e87=_0x4754e1;logger[_0x8a2b('0xa')](_0x8a2b('0x63'),_0x303e87['id']);return getTicket(_0x5af77e,_0x3ea63c,_0x303e87,_0x24e050,_0x142397);})[_0x8a2b('0x14')](function(_0x1c8a43){if(_0x1c8a43){logger[_0x8a2b('0xa')](_0x8a2b('0x51'),_0x1c8a43['id']);}})[_0x8a2b('0x5c')](function(_0x43ba00){logger[_0x8a2b('0x5b')]('['+_0x142397[_0x8a2b('0x6b')][_0x8a2b('0x69')]()+']'+_0x8a2b('0x6c'),util[_0x8a2b('0x66')](_0x43ba00,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3ba9=['Displaying\x20ticket\x20to\x20agent...','newTab','[QUEUE]','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','Recording\x20is\x20enabled!','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','application/json','info','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','username','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','custom_fields','push','idField','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab'];(function(_0xcc8f00,_0x9fe352){var _0x32c498=function(_0x5f2fff){while(--_0x5f2fff){_0xcc8f00['push'](_0xcc8f00['shift']());}};_0x32c498(++_0x9fe352);}(_0x3ba9,0x102));var _0x93ba=function(_0x542f2f,_0x16cbd2){_0x542f2f=_0x542f2f-0x0;var _0x115950=_0x3ba9[_0x542f2f];return _0x115950;};'use strict';var _=require(_0x93ba('0x0'));var rp=require(_0x93ba('0x1'));var md5=require(_0x93ba('0x2'));var util=require(_0x93ba('0x3'));var Redis=require(_0x93ba('0x4'));var intUtil=require('./util');var config=require(_0x93ba('0x5'));var logger=require(_0x93ba('0x6'))(_0x93ba('0x7'));config['redis']=_[_0x93ba('0x8')](config[_0x93ba('0x9')],{'host':_0x93ba('0xa'),'port':0x18eb});var io=require(_0x93ba('0xb'))(new Redis(config[_0x93ba('0x9')]));function emit(_0x3006fe,_0x480037,_0x4a0761){io['to'](_0x3006fe)['emit'](_0x480037,_0x4a0761);}var headers={'Content-Type':_0x93ba('0xc'),'Accept':_0x93ba('0xc')};function getTicket(_0x1eb0d6,_0xf45346,_0xb3dca4,_0x2619dc,_0x14b228){logger[_0x93ba('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x93ba('0xe'),_0x1eb0d6[_0x93ba('0xf')]),'method':'POST','body':{'ticket':_[_0x93ba('0x10')]({'requester_id':_0xb3dca4['id'],'submitter_id':_0xf45346?_0xf45346['id']:undefined,'assignee_id':_0xf45346?_0xf45346['id']:undefined,'tags':getTags(_0x2619dc[_0x93ba('0x11')],_0x93ba('0x12')),'subject':intUtil[_0x93ba('0x13')](_0x2619dc[_0x93ba('0x14')],_0x14b228,'\x20'),'description':intUtil['getString'](_0x2619dc['Descriptions'],_0x14b228,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2619dc[_0x93ba('0x15')],_0x14b228,'\x0a')}},getCustomFields(_0x2619dc['Fields'],_0x14b228))}})[_0x93ba('0x16')](function(_0x59e26b){logger[_0x93ba('0xd')](_0x93ba('0x17'));return _0x59e26b[_0x93ba('0x18')];});}function getUser(_0x32b9b4,_0xc41c29){if(intUtil[_0x93ba('0x19')](_0xc41c29)){logger[_0x93ba('0xd')]('Getting\x20agent\x20with\x20email',_0xc41c29);return request({'uri':util[_0x93ba('0x1a')](_0x93ba('0x1b'),_0x32b9b4[_0x93ba('0xf')]),'qs':{'query':util[_0x93ba('0x1a')](_0x93ba('0x1c'),_0xc41c29)}})[_0x93ba('0x16')](function(_0xc7946e){if(_0xc7946e[_0x93ba('0x1d')]){logger[_0x93ba('0xd')](_0x93ba('0x1e'));return _[_0x93ba('0x1f')](_0xc7946e['results'],{'email':_0xc41c29,'role':_0x93ba('0x20')});}else{logger[_0x93ba('0xd')](_0x93ba('0x21'));return request({'uri':util[_0x93ba('0x1a')]('%s/users/me.json',_0x32b9b4[_0x93ba('0xf')])})[_0x93ba('0x16')](function(_0x577fac){logger[_0x93ba('0xd')]('Admin\x20account\x20selected.');return _0x577fac['user'];});}});}else{logger[_0x93ba('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x93ba('0x1a')](_0x93ba('0x22'),_0x32b9b4[_0x93ba('0xf')])})[_0x93ba('0x16')](function(_0x651182){logger[_0x93ba('0xd')](_0x93ba('0x23'));return _0x651182['user'];});}}function getEndUser(_0x5853fa,_0x1fb076,_0x12eadd){logger[_0x93ba('0xd')](_0x93ba('0x24'),_0x12eadd);return request({'uri':util[_0x93ba('0x1a')](_0x93ba('0x1b'),_0x5853fa[_0x93ba('0xf')]),'qs':{'query':util[_0x93ba('0x1a')](_0x93ba('0x25'),_0x12eadd)}})[_0x93ba('0x16')](function(_0x4864cc){var _0x54580f;if(_0x4864cc[_0x93ba('0x26')][_0x93ba('0x27')]){_0x4864cc[_0x93ba('0x26')]=_[_0x93ba('0x28')](_0x4864cc[_0x93ba('0x26')],{'suspended':![],'role':_0x93ba('0x29')});if(_0x4864cc[_0x93ba('0x26')][_0x93ba('0x27')]){_0x54580f=_['first'](_0x4864cc[_0x93ba('0x26')]);}}if(_0x54580f){logger['info']('Enduser\x20found!');return _0x54580f;}else{logger[_0x93ba('0xd')](_0x93ba('0x2a'));return request({'uri':util[_0x93ba('0x1a')](_0x93ba('0x2b'),_0x5853fa[_0x93ba('0xf')]),'method':_0x93ba('0x2c'),'body':{'user':{'role':'end-user','name':util[_0x93ba('0x1a')](_0x93ba('0x2d'),_0x1fb076||_0x12eadd),'phone':_0x12eadd}}})[_0x93ba('0x16')](function(_0x1bc0bc){logger[_0x93ba('0xd')](_0x93ba('0x2e'));return _0x1bc0bc[_0x93ba('0x2f')];});}});}function getAuth(_0x14fc7f){var _0x19b5d2;if(_0x14fc7f[_0x93ba('0x30')]===_0x93ba('0x31')){_0x19b5d2=util[_0x93ba('0x1a')]('%s:%s',_0x14fc7f[_0x93ba('0x32')],_0x14fc7f['password']);}else if(_0x14fc7f[_0x93ba('0x30')]==='token'){_0x19b5d2=util[_0x93ba('0x1a')](_0x93ba('0x33'),_0x14fc7f[_0x93ba('0x32')],_0x14fc7f['token']);}return util[_0x93ba('0x1a')](_0x93ba('0x34'),new Buffer(_0x19b5d2)[_0x93ba('0x35')](_0x93ba('0x36')));}function request(_0x162bfc){logger[_0x93ba('0x37')](_0x93ba('0x38'),JSON['stringify'](_0x162bfc));return rp(_[_0x93ba('0x8')](_0x162bfc,{'method':_0x93ba('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x275a60,_0x51114e){var _0x42f37e=[];if(_0x275a60&&_0x275a60[_0x93ba('0x27')]>0x0){_0x42f37e=_[_0x93ba('0x3a')](_0x275a60,_0x51114e);}return _0x42f37e;}function getCustomFields(_0x3cd725,_0x4e45a6){var _0x3d21d7=[];var _0x4f5443={'custom_fields':[]};if(_0x3cd725['length']>0x0){_[_0x93ba('0x3b')](_0x3cd725,function(_0xfcb0b6){if(_[_0x93ba('0x3c')]([_0x93ba('0x3d'),'picklist'],_0xfcb0b6[_0x93ba('0x3e')])&&_0xfcb0b6['nameField']&&!_0xfcb0b6[_0x93ba('0x3f')]){_0x4f5443[_0xfcb0b6[_0x93ba('0x40')][_0x93ba('0x41')]()]=_0xfcb0b6[_0x93ba('0x42')][_0x93ba('0x35')]();}else if(_['includes'](['string',_0x93ba('0x43')],_0xfcb0b6[_0x93ba('0x3e')])&&_0xfcb0b6['idField']&&_0xfcb0b6[_0x93ba('0x3f')]){_0x4f5443[_0x93ba('0x44')][_0x93ba('0x45')]({'id':_0xfcb0b6[_0x93ba('0x46')],'value':_0xfcb0b6['content'][_0x93ba('0x35')]()});}else if(_0xfcb0b6['type']===_0x93ba('0x47')&&_0xfcb0b6[_0x93ba('0x48')]&&_0xfcb0b6[_0x93ba('0x46')]&&_0xfcb0b6[_0x93ba('0x3f')]){_0x4e45a6[_0xfcb0b6['variableName']]&&_0x4f5443[_0x93ba('0x44')][_0x93ba('0x45')]({'id':_0xfcb0b6[_0x93ba('0x46')],'value':_0x4e45a6[_0xfcb0b6[_0x93ba('0x48')]][_0x93ba('0x35')]()});}else if(_0xfcb0b6[_0x93ba('0x3e')]===_0x93ba('0x49')&&_0xfcb0b6[_0x93ba('0x4a')]&&_0xfcb0b6[_0x93ba('0x4a')][_0x93ba('0x12')]&&_0xfcb0b6[_0x93ba('0x46')]&&_0xfcb0b6[_0x93ba('0x3f')]){_0x4e45a6[_0xfcb0b6[_0x93ba('0x4a')][_0x93ba('0x12')][_0x93ba('0x41')]()]&&_0x4f5443['custom_fields']['push']({'id':_0xfcb0b6[_0x93ba('0x46')],'value':_0x4e45a6[_0xfcb0b6['Variable'][_0x93ba('0x12')][_0x93ba('0x41')]()][_0x93ba('0x35')]()});}});}return _0x4f5443;}exports['queue']=function(_0x2ea47b,_0x5bac30,_0x3fba0f,_0x400f96,_0x35e5de,_0x4ce2ac){var _0xf897bf,_0x21428d;_0x4ce2ac['remoteUri']=intUtil[_0x93ba('0x4b')](_0x4ce2ac[_0x93ba('0xf')]);_0x4ce2ac[_0x93ba('0x4c')]=intUtil[_0x93ba('0x4b')](_0x4ce2ac[_0x93ba('0x4c')]);if(_0x35e5de&&_0x35e5de[_0x93ba('0x4d')]){logger[_0x93ba('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5bac30['recordingURL']=util[_0x93ba('0x1a')](_0x93ba('0x4e'),_0x4ce2ac[_0x93ba('0x4c')],_0x5bac30[_0x93ba('0x4f')],md5(_0x5bac30[_0x93ba('0x4f')]));}else{_0x5bac30[_0x93ba('0x50')]='';}headers[_0x93ba('0x51')]=getAuth(_0x4ce2ac);return getUser(_0x4ce2ac,_0x400f96['email'])[_0x93ba('0x16')](function(_0x28ac36){_0xf897bf=_0x28ac36;logger[_0x93ba('0xd')](_0x93ba('0x52'),_0xf897bf['id']);return getEndUser(_0x4ce2ac,_0x5bac30[_0x93ba('0x53')],_0x5bac30[_0x93ba('0x54')]);})['then'](function(_0x1d41e9){_0x21428d=_0x1d41e9;logger[_0x93ba('0xd')]('The\x20Enduser\x20ID\x20is:',_0x21428d['id']);return getTicket(_0x4ce2ac,_0xf897bf,_0x21428d,_0x3fba0f,_0x5bac30);})['then'](function(_0x558d37){if(_0x558d37){logger['info'](_0x93ba('0x55'),_0x558d37['id']);switch(_0x4ce2ac[_0x93ba('0x3e')]){case _0x93ba('0x56'):logger['info']('[QUEUE]',_0x93ba('0x57'));return request({'uri':util[_0x93ba('0x1a')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4ce2ac[_0x93ba('0xf')],_0xf897bf['id'],_0x558d37['id']),'method':'POST'});case _0x93ba('0x58'):logger[_0x93ba('0xd')](_0x93ba('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x93ba('0x1a')](_0x93ba('0x5a'),_0x400f96[_0x93ba('0x12')]),_0x93ba('0x5b'),{'uri':util['format'](_0x93ba('0x5c'),_0x4ce2ac[_0x93ba('0xf')][_0x93ba('0x5d')](_0x93ba('0x5e'),''),_0x558d37['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x93ba('0x5f')](function(_0x284b9c){logger[_0x93ba('0x60')](_0x93ba('0x61'),util['inspect'](_0x284b9c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x141a6b,_0x3e11d6,_0x567bf9,_0x5b9b1c,_0xd8baa9,_0x512552,_0x2b3691){var _0x52facc,_0x3a4eac;_0x512552[_0x93ba('0xf')]=intUtil['stripTrailingSlash'](_0x512552[_0x93ba('0xf')]);_0x512552[_0x93ba('0x4c')]=intUtil[_0x93ba('0x4b')](_0x512552[_0x93ba('0x4c')]);if(_0x2b3691&&_0x2b3691['recordingFormat']&&_0x2b3691[_0x93ba('0x62')]!==_0x93ba('0x63')){logger[_0x93ba('0xd')](_0x93ba('0x64'),'Recording\x20is\x20enabled!');_0x3e11d6[_0x93ba('0x50')]=util[_0x93ba('0x1a')](_0x93ba('0x4e'),_0x512552[_0x93ba('0x4c')],_0x3e11d6[_0x93ba('0x4f')],md5(_0x3e11d6[_0x93ba('0x4f')]));}headers[_0x93ba('0x51')]=getAuth(_0x512552);return getUser(_0x512552,_0x5b9b1c[_0x93ba('0x65')])[_0x93ba('0x16')](function(_0x13ae9d){_0x52facc=_0x13ae9d;logger[_0x93ba('0xd')](_0x93ba('0x52'),_0x52facc['id']);return getEndUser(_0x512552,_0x3e11d6[_0x93ba('0x66')],_0x3e11d6[_0x93ba('0x67')]);})[_0x93ba('0x16')](function(_0x22fadd){_0x3a4eac=_0x22fadd;logger[_0x93ba('0xd')](_0x93ba('0x68'),_0x3a4eac['id']);return getTicket(_0x512552,_0x52facc,_0x3a4eac,_0x567bf9,_0x3e11d6);})[_0x93ba('0x16')](function(_0x4a6e19){if(_0x4a6e19){logger[_0x93ba('0xd')](_0x93ba('0x55'),_0x4a6e19['id']);switch(_0x512552[_0x93ba('0x3e')]){case'integrationTab':logger[_0x93ba('0xd')](_0x93ba('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x93ba('0x69'),_0x512552['remoteUri'],_0x52facc['id'],_0x4a6e19['id']),'method':_0x93ba('0x2c')});case _0x93ba('0x58'):logger[_0x93ba('0xd')]('[OUTBOUND]',_0x93ba('0x6a'));emit(util['format']('user:%s',_0x5b9b1c[_0x93ba('0x12')]),_0x93ba('0x5b'),{'uri':util['format'](_0x93ba('0x5c'),_0x512552[_0x93ba('0xf')][_0x93ba('0x5d')](_0x93ba('0x5e'),''),_0x4a6e19['id'])});break;default:logger['error'](_0x93ba('0x64'),_0x93ba('0x6b'));}}})['catch'](function(_0x524e22){logger[_0x93ba('0x60')](_0x93ba('0x6c'),util[_0x93ba('0x6d')](_0x524e22,{'showHidden':!![],'depth':null}));});};exports[_0x93ba('0x6e')]=function(_0x6a260e,_0xe6f0f1,_0x505732,_0x3f04d9,_0x3164fe,_0x3c9732){var _0x2b1ba8,_0xd7c76f;_0x3c9732[_0x93ba('0xf')]=intUtil[_0x93ba('0x4b')](_0x3c9732['remoteUri']);_0x3c9732[_0x93ba('0x4c')]=intUtil[_0x93ba('0x4b')](_0x3c9732[_0x93ba('0x4c')]);if(_0x3164fe&&_0x3164fe[_0x93ba('0x4d')]){logger[_0x93ba('0xd')]('['+_0xe6f0f1[_0x93ba('0x6f')]['toUpperCase']()+']',_0x93ba('0x70'));_0xe6f0f1[_0x93ba('0x50')]=util[_0x93ba('0x1a')](_0x93ba('0x4e'),_0x3c9732[_0x93ba('0x4c')],_0xe6f0f1['uniqueid'],md5(_0xe6f0f1['uniqueid']));}else{_0xe6f0f1[_0x93ba('0x50')]='';}headers[_0x93ba('0x51')]=getAuth(_0x3c9732);return getUser(_0x3c9732)[_0x93ba('0x16')](function(_0x1b8139){_0x2b1ba8=_0x1b8139;logger[_0x93ba('0xd')]('The\x20User\x20ID\x20is:',_0x2b1ba8['id']);return getEndUser(_0x3c9732,_0xe6f0f1[_0x93ba('0x53')],_0xe6f0f1[_0x93ba('0x54')]);})['then'](function(_0x231e2d){_0xd7c76f=_0x231e2d;logger[_0x93ba('0xd')](_0x93ba('0x68'),_0xd7c76f['id']);return getTicket(_0x3c9732,_0x2b1ba8,_0xd7c76f,_0x505732,_0xe6f0f1);})[_0x93ba('0x16')](function(_0x58361e){if(_0x58361e){logger['info'](_0x93ba('0x55'),_0x58361e['id']);}})[_0x93ba('0x5f')](function(_0x1a0147){logger['error']('['+_0xe6f0f1[_0x93ba('0x6f')][_0x93ba('0x71')]()+']'+_0x93ba('0x72'),util[_0x93ba('0x6d')](_0x1a0147,{'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 908c372..9f9b71b 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 _0x14e0=['access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','findIndex','email','Using\x20the\x20admin\x20account!','users','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Creating\x20new\x20call...','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','complete','connect','rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','merge','POST','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridnum','Inbound','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','zoho.eu','destcalleridname','destcalleridnum','Outbound','unmanaged','/api/voice/recordings/','The\x20Call\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil'];(function(_0x572998,_0x365570){var _0x53d433=function(_0x140de3){while(--_0x140de3){_0x572998['push'](_0x572998['shift']());}};_0x53d433(++_0x365570);}(_0x14e0,0x11d));var _0x014e=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x14e0[_0x2cef86];return _0x46dfd6;};'use strict';var _=require(_0x014e('0x0'));var rp=require(_0x014e('0x1'));var md5=require(_0x014e('0x2'));var util=require(_0x014e('0x3'));var intUtil=require(_0x014e('0x4'));var moment=require(_0x014e('0x5'));var Redis=require(_0x014e('0x6'));var BPromise=require(_0x014e('0x7'));var config=require('../../../../config/environment');var logger=require(_0x014e('0x8'))(_0x014e('0x9'));config[_0x014e('0xa')]=_[_0x014e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x014e('0xa')]));function emit(_0x115cd0,_0x18bc18,_0x18531d){io['to'](_0x115cd0)[_0x014e('0xc')](_0x18bc18,_0x18531d);}function request(_0x2e0510){logger[_0x014e('0xd')](_0x014e('0xe'),JSON[_0x014e('0xf')](_0x2e0510));return rp(_0x2e0510);}function getCustomFields(_0x3fa266,_0x38e01c){var _0x3f4075={};if(_0x3fa266['length']>0x0){_[_0x014e('0x10')](_0x3fa266,function(_0x470de1){if(_[_0x014e('0x11')]([_0x014e('0x12'),_0x014e('0x13')],_0x470de1[_0x014e('0x14')])&&_0x470de1[_0x014e('0x15')]){_0x3f4075[_0x470de1[_0x014e('0x15')]]=_0x470de1['content']['toString']();}else if(_0x470de1[_0x014e('0x14')]===_0x014e('0x16')&&_0x470de1[_0x014e('0x17')]&&_0x470de1[_0x014e('0x15')]&&_0x38e01c[_0x470de1[_0x014e('0x17')]]){_0x3f4075[_0x470de1[_0x014e('0x15')]]=_0x38e01c[_0x470de1[_0x014e('0x17')]][_0x014e('0x18')]();}else if(_0x470de1[_0x014e('0x14')]==='customVariable'&&_0x470de1[_0x014e('0x19')]&&_0x470de1['Variable'][_0x014e('0x1a')]&&_0x470de1[_0x014e('0x15')]&&_0x38e01c[_0x470de1[_0x014e('0x19')][_0x014e('0x1a')][_0x014e('0x1b')]()]){_0x3f4075[_0x470de1['idField']]=_0x38e01c[_0x470de1[_0x014e('0x19')]['name'][_0x014e('0x1b')]()]['toString']();}});}return _0x3f4075;}function getName(_0x5d369e){if(_0x5d369e[_0x014e('0x1c')]('\x20')>0x0){var _0x3c49b0=_0x5d369e[_0x014e('0x1d')](/ (.+)/);if(_0x3c49b0[0x1]){return _0x3c49b0;}}return[_0x5d369e,_0x5d369e];}var accountsTokens={};function getAccessToken(_0x476826){return new Promise(function(_0x5ec6cc,_0x40c62d){if(!_[_0x014e('0x1e')](accountsTokens[_0x476826['id']])&&!_['isNil'](accountsTokens[_0x476826['id']][_0x014e('0x1f')])){if(moment()[_0x014e('0x20')](accountsTokens[_0x476826['id']][_0x014e('0x21')])){_0x5ec6cc(accountsTokens[_0x476826['id']][_0x014e('0x1f')]);}}var _0x1682a7;switch(_0x476826[_0x014e('0x22')]){case'US':_0x1682a7=_0x014e('0x23');break;case'AU':_0x1682a7=_0x014e('0x24');break;case'EU':_0x1682a7=_0x014e('0x25');break;case'IN':_0x1682a7=_0x014e('0x26');break;case'CN':_0x1682a7=_0x014e('0x27');break;default:_0x1682a7=_0x014e('0x25');break;}var _0x45f451={'method':'POST','uri':_0x1682a7+_0x014e('0x28'),'qs':{'refresh_token':_0x476826[_0x014e('0x29')],'client_id':_0x476826[_0x014e('0x2a')],'client_secret':_0x476826[_0x014e('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x45f451)[_0x014e('0x2c')](function(_0x16c0a8){accountsTokens[_0x476826['id']]={'access_token':_0x16c0a8['access_token'],'expires_in':moment()[_0x014e('0x2d')](_0x16c0a8[_0x014e('0x21')],_0x014e('0x2e'))};_0x5ec6cc(_0x16c0a8['access_token']);})[_0x014e('0x2f')](function(_0x1f42e6){logger[_0x014e('0x30')](_0x014e('0x31'),_0x1f42e6['stack']);_0x40c62d(_0x1f42e6);});});}function getUser(_0xed68ec,_0x4c4d78,_0xd401d8,_0x4328f3){logger[_0x014e('0x32')](_0x014e('0x33'));return request({'method':_0x014e('0x34'),'uri':util[_0x014e('0x35')](_0x014e('0x36'),_0x4c4d78),'qs':{'type':_0x014e('0x37')},'headers':{'Authorization':_0x014e('0x38')+_0xed68ec},'json':!![]})[_0x014e('0x2c')](function(_0x5d7b28){if(_0x5d7b28['users']){var _0x3e4e4b=-0x1;if(_['isArrayLikeObject'](_0x5d7b28['users'])){if(!_[_0x014e('0x1e')](_0x4328f3)){_0x3e4e4b=_[_0x014e('0x39')](_0x5d7b28['users'],function(_0x111a78){return _0x111a78[_0x014e('0x3a')]===_0x4328f3;});}if(_0x3e4e4b>=0x0){logger[_0x014e('0x32')]('Agent\x20found!');}else{logger['info'](_0x014e('0x3b'));_0x3e4e4b=_[_0x014e('0x39')](_0x5d7b28[_0x014e('0x3c')],function(_0x4021f2){return _0x4021f2['profile'][_0x014e('0x1a')]===_0x014e('0x3d');});}return _0x5d7b28[_0x014e('0x3c')][_0x3e4e4b];}else{if(_0x5d7b28[_0x014e('0x3e')]['profile']['name']===_0x014e('0x3d')){logger['info'](_0x014e('0x3b'));user=_0x5d7b28[_0x014e('0x3e')];return user;}else{logger[_0x014e('0x30')]('The\x20failing\x20result\x20is',JSON[_0x014e('0xf')](_0x5d7b28));throw new Error(_0x014e('0x3f')+JSON[_0x014e('0xf')](_0x5d7b28));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x014e('0xf')](_0x5d7b28));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x014e('0xf')](_0x5d7b28));}})[_0x014e('0x2f')](function(_0x38a515){console[_0x014e('0x30')](_0x38a515);});}function getZohoUser(_0x54f536,_0x57e247){return new BPromise(function(_0x477b43,_0x3198eb){request(_0x54f536)[_0x014e('0x2c')](function(_0x5ae685){var _0x2a2098=null;if(_0x5ae685){_0x2a2098=_0x5ae685[_0x014e('0x40')][0x0];_0x2a2098[_0x014e('0x41')]=_0x57e247;}_0x477b43(_0x2a2098);})[_0x014e('0x2f')](function(_0x12165b){_0x3198eb(_0x12165b);});});}function createEndUser(_0x1c8427,_0x499a7a,_0x47fe36,_0x4760d9,_0x47b6ad,_0x45f1b7){var _0x47fe36=getName(_0x47fe36);return request({'method':'POST','uri':_0x014e('0x42')+_0x499a7a+_0x014e('0x43')+_[_0x014e('0x44')](_0x45f1b7[_0x014e('0x45')])+'s','body':{'data':[{'Last_Name':_0x47fe36[0x1],'First_Name':_0x47fe36[0x0],'Phone':_0x4760d9,'Owner':{'name':!_[_0x014e('0x1e')](_0x47b6ad[_0x014e('0x46')][_0x014e('0x1a')])?_0x47b6ad[_0x014e('0x46')]['name']:!_['isNil'](_0x47b6ad[_0x014e('0x47')])?_0x47b6ad[_0x014e('0x47')]+'\x20'+_0x47b6ad[_0x014e('0x48')]:_0x47b6ad[_0x014e('0x48')],'id':_0x47b6ad['id']}}]},'headers':{'Authorization':_0x014e('0x38')+_0x1c8427},'json':!![]})[_0x014e('0x2c')](function(_0xb42dff){if(_0xb42dff&&_0xb42dff[_0x014e('0x40')][0x0][_0x014e('0x49')]===_0x014e('0x4a')){var _0x2dc4ce=_0xb42dff[_0x014e('0x40')][0x0][_0x014e('0x4b')];_0x2dc4ce[_0x014e('0x41')]=_[_0x014e('0x44')](_0x45f1b7['moduleCreate'])+'s';return _0x2dc4ce;}logger['error'](_0x014e('0x4c'),JSON['stringify'](data));throw new Error(_0x014e('0x4d')+JSON[_0x014e('0xf')](data));})[_0x014e('0x2f')](function(_0x1f0640){console[_0x014e('0x4e')](_0x014e('0x4f'),_0x1f0640);});}function getEndUser(_0x193212,_0x2d01ab,_0x4ca08f,_0x42ae58,_0x2bfe40,_0x3450f2,_0x2c4a30){var _0x47cddc={'method':_0x014e('0x34'),'uri':'','headers':{'Authorization':_0x014e('0x38')+_0x193212},'json':!![]};switch(_0x2c4a30[_0x014e('0x50')]){case _0x014e('0x51'):_0x47cddc[_0x014e('0x52')]='https://www.zohoapis.'+_0x2d01ab+_0x014e('0x53')+_0x2bfe40+'))';return getZohoUser(_0x47cddc,_0x014e('0x54'))[_0x014e('0x2c')](function(_0x408139){if(_0x408139)return _0x408139;_0x47cddc['uri']='https://www.zohoapis.'+_0x2d01ab+_0x014e('0x55')+_0x2bfe40+'))';return getZohoUser(_0x47cddc,_0x014e('0x56'))[_0x014e('0x2c')](function(_0x337087){if(_0x337087)return _0x337087;if(_0x2c4a30[_0x014e('0x45')]!=_0x014e('0x57')){return createEndUser(_0x193212,_0x2d01ab,_0x42ae58,_0x2bfe40,_0x3450f2,_0x2c4a30);}else{return{};}});});break;case _0x014e('0x58'):_0x47cddc[_0x014e('0x52')]='https://www.zohoapis.'+_0x2d01ab+_0x014e('0x53')+_0x2bfe40+'))';return getZohoUser(_0x47cddc,_0x014e('0x54'))[_0x014e('0x2c')](function(_0xbf5517){if(_0xbf5517)return _0xbf5517;if(_0x2c4a30['moduleCreate']!=_0x014e('0x57')){return createEndUser(_0x193212,_0x2d01ab,_0x42ae58,_0x2bfe40,_0x3450f2,_0x2c4a30);}else{return{};}});break;case'lead':_0x47cddc[_0x014e('0x52')]=_0x014e('0x42')+_0x2d01ab+_0x014e('0x55')+_0x2bfe40+'))';return getZohoUser(_0x47cddc,_0x014e('0x56'))[_0x014e('0x2c')](function(_0x33dd2a){if(_0x33dd2a)return _0x33dd2a;if(_0x2c4a30[_0x014e('0x45')]!=_0x014e('0x57')){return createEndUser(_0x193212,_0x2d01ab,_0x42ae58,_0x2bfe40,_0x3450f2,_0x2c4a30);}else{return{};}});break;}}function getCall(_0x4115c0,_0x2e0f20,_0x7f2972,_0x267f39,_0xf7601a,_0x49c32e,_0xb3caa4,_0x11a00d){logger[_0x014e('0x32')](_0x014e('0x59'));var _0x506f79={};_0x506f79['Owner']={'name':!_[_0x014e('0x1e')](_0x267f39[_0x014e('0x46')][_0x014e('0x1a')])&&!_['isNil'](_0x267f39['profile']['name'])&&_0x267f39[_0x014e('0x5a')][_0x014e('0x1a')]===_0x014e('0x5b')?_0x267f39[_0x014e('0x46')][_0x014e('0x1a')]:!_[_0x014e('0x1e')](_0x267f39[_0x014e('0x47')])?_0x267f39[_0x014e('0x47')]+'\x20'+_0x267f39[_0x014e('0x48')]:_0x267f39[_0x014e('0x48')],'id':_0x267f39['id']};_0x506f79[_0x014e('0x5c')]=intUtil[_0x014e('0x5d')](_0x49c32e[_0x014e('0x5e')],_0xb3caa4,'\x20');_0x506f79[_0x014e('0x5f')]=intUtil[_0x014e('0x5d')](_0x49c32e[_0x014e('0x60')],_0xb3caa4,'\x0a');if(_0xf7601a[_0x014e('0x41')]===_0x014e('0x54')){_0x506f79[_0x014e('0x61')]={'name':!_[_0x014e('0x1e')](_0xf7601a[_0x014e('0x62')])?_0xf7601a[_0x014e('0x62')]:!_['isNil'](_0xf7601a[_0x014e('0x63')])?_0xf7601a[_0x014e('0x63')]+'\x20'+_0xf7601a[_0x014e('0x64')]:_0xf7601a[_0x014e('0x64')],'id':_0xf7601a['id']};}if(_0xf7601a[_0x014e('0x41')]===_0x014e('0x56')){_0x506f79[_0x014e('0x65')]={'name':!_[_0x014e('0x1e')](_0xf7601a['Full_Name'])?_0xf7601a[_0x014e('0x62')]:!_[_0x014e('0x1e')](_0xf7601a[_0x014e('0x63')])?_0xf7601a[_0x014e('0x63')]+'\x20'+_0xf7601a['Last_Name']:_0xf7601a['Last_Name'],'id':_0xf7601a['id']};_0x506f79[_0x014e('0x66')]=_[_0x014e('0x44')](_0xf7601a['enduserType']);}if(_0xb3caa4[_0x014e('0x67')]){_0x506f79['Call_Duration']=moment['utc'](parseInt(_0xb3caa4['talktime'])*0x3e8)[_0x014e('0x35')](_0x014e('0x68'));}else if(_0xb3caa4[_0x014e('0x69')]&&_0xb3caa4['endtime']){_0x506f79['Call_Duration']=moment[_0x014e('0x6a')](moment(_0xb3caa4['endtime'],_0x014e('0x6b'))[_0x014e('0x6c')](moment(_0xb3caa4[_0x014e('0x6d')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x014e('0x68'));}switch(_0xb3caa4[_0x014e('0x6e')]){case _0x014e('0x6f'):_0x506f79[_0x014e('0x70')]='Called';break;case _0x014e('0x71'):case _0x014e('0x72'):_0x506f79[_0x014e('0x70')]='Answered';break;case _0x014e('0x73'):_0x506f79[_0x014e('0x70')]='Rejected';break;case _0x014e('0x74'):_0x506f79[_0x014e('0x70')]=_0x014e('0x75');break;case _0x014e('0x76'):_0x506f79['Call_Result']=_0x014e('0x77');default:}_0x506f79['Call_Start_Time']=(_0x11a00d===_0x014e('0x78')?moment(_0xb3caa4[_0x014e('0x6d')])['format'](_0x014e('0x6b')):moment(_0xb3caa4[_0x014e('0x79')])[_0x014e('0x35')](_0x014e('0x6b')))||moment()[_0x014e('0x35')](_0x014e('0x6b'));_0x506f79[_0x014e('0x7a')]=_0x11a00d||'Inbound';_0x506f79=_[_0x014e('0x7b')](_0x506f79,getCustomFields(_0x49c32e['Fields'],_0xb3caa4));return request({'method':_0x014e('0x7c'),'uri':_0x014e('0x42')+_0x2e0f20+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4115c0},'body':{'data':[_0x506f79]},'json':!![]})['then'](function(_0x300a2e){if(_0x300a2e&&_0x300a2e[_0x014e('0x40')][0x0][_0x014e('0x49')]===_0x014e('0x4a')){logger[_0x014e('0x32')](_0x014e('0x7d'));return{'id':_0x300a2e[_0x014e('0x40')][0x0][_0x014e('0x4b')]['id']};}})[_0x014e('0x2f')](function(_0x5b1d1b){logger[_0x014e('0x32')](_0x014e('0x7e'),_0x5b1d1b[_0x014e('0x7f')]);console[_0x014e('0x4e')](_0x014e('0x7e'),_0x5b1d1b);});}exports[_0x014e('0x80')]=function(_0x1ddb11,_0x325c22,_0x325779,_0x1889a0,_0x146510,_0x25aa4c){var _0x26196d,_0xe7413f,_0x4a8a7d;_0x25aa4c[_0x014e('0x81')]=intUtil[_0x014e('0x82')](_0x25aa4c[_0x014e('0x81')]);_0x25aa4c[_0x014e('0x83')]=intUtil['stripTrailingSlash'](_0x25aa4c[_0x014e('0x83')]);if(_0x146510&&_0x146510[_0x014e('0x84')]){logger[_0x014e('0x32')]('[QUEUE]','Recording\x20is\x20enabled!');_0x325c22[_0x014e('0x85')]=_0x25aa4c[_0x014e('0x83')]+'/api/voice/recordings/'+_0x325c22['uniqueid']+_0x014e('0x86')+md5(_0x325c22[_0x014e('0x87')]);}else{_0x325c22[_0x014e('0x85')]='';}var _0x3f3263=_0x25aa4c[_0x014e('0x81')]==='zoho.eu'?'eu':_0x014e('0x88');return getAccessToken(_0x25aa4c)[_0x014e('0x2c')](function(_0x5014f6){_0x4a8a7d=_0x5014f6;return getUser(_0x4a8a7d,_0x3f3263,_0x25aa4c,_0x1889a0[_0x014e('0x3a')]);})[_0x014e('0x2c')](function(_0xd87b7a){_0x26196d=_0xd87b7a;logger[_0x014e('0x32')](_0x014e('0x89'),_0x26196d['id']);return getEndUser(_0x4a8a7d,_0x3f3263,_0x25aa4c,_0x325c22['calleridname'],_0x325c22[_0x014e('0x8a')],_0x26196d,_0x325779);})[_0x014e('0x2c')](function(_0x14585d){_0xe7413f=_0x14585d;return getCall(_0x4a8a7d,_0x3f3263,_0x25aa4c,_0x26196d,_0xe7413f,_0x325779,_0x325c22,_0x014e('0x8b'));})[_0x014e('0x2c')](function(_0x13ca2c){if(_0x13ca2c){logger[_0x014e('0x32')]('The\x20Call\x20ID\x20is:',_0x13ca2c['id']);logger['info'](_0x014e('0x8c'),_0x014e('0x8d'));emit(util[_0x014e('0x35')](_0x014e('0x8e'),_0x1889a0['name']),_0x014e('0x8f'),{'uri':_0x014e('0x90')+_0x25aa4c[_0x014e('0x81')]+_0x014e('0x91')+_0x13ca2c['id']});}})[_0x014e('0x2f')](function(_0x45b317){logger[_0x014e('0x30')](_0x014e('0x8c'),JSON[_0x014e('0xf')](_0x45b317));});};exports[_0x014e('0x78')]=function(_0x2bae9a,_0x9a73b8,_0x2826b3,_0xaf537a,_0x381c4b,_0x40cb21,_0x4d461d){var _0x1f4271,_0x412dde,_0x4b040f;_0x40cb21[_0x014e('0x81')]=intUtil[_0x014e('0x82')](_0x40cb21['host']);_0x40cb21[_0x014e('0x83')]=intUtil['stripTrailingSlash'](_0x40cb21[_0x014e('0x83')]);if(_0x4d461d&&_0x4d461d['recordingFormat']&&_0x4d461d[_0x014e('0x92')]!==_0x014e('0x93')){logger['info'](_0x014e('0x94'),_0x014e('0x95'));_0x9a73b8['recordingURL']=_0x40cb21[_0x014e('0x83')]+'/api/voice/recordings/'+_0x9a73b8[_0x014e('0x87')]+'/downloads?type=uniqueid&token='+md5(_0x9a73b8[_0x014e('0x87')]);}var _0x1e40e4=_0x40cb21[_0x014e('0x81')]===_0x014e('0x96')?'eu':_0x014e('0x88');return getAccessToken(_0x40cb21)['then'](function(_0x1451db){_0x4b040f=_0x1451db;return getUser(_0x4b040f,_0x1e40e4,_0x40cb21,_0xaf537a[_0x014e('0x3a')]);})[_0x014e('0x2c')](function(_0x5b3006){_0x1f4271=_0x5b3006;logger['info'](_0x014e('0x89'),_0x1f4271['id']);return getEndUser(_0x4b040f,_0x1e40e4,_0x40cb21,_0x9a73b8[_0x014e('0x97')],_0x9a73b8[_0x014e('0x98')],_0x1f4271,_0x2826b3);})[_0x014e('0x2c')](function(_0x59bc6e){_0x412dde=_0x59bc6e;return getCall(_0x4b040f,_0x1e40e4,_0x40cb21,_0x1f4271,_0x412dde,_0x2826b3,_0x9a73b8,_0x014e('0x99'));})['then'](function(_0x2ccdb3){if(_0x2ccdb3){logger['info']('The\x20Call\x20ID\x20is:',_0x2ccdb3['id']);logger[_0x014e('0x32')]('[OUTBOUND]',_0x014e('0x8d'));emit(util[_0x014e('0x35')](_0x014e('0x8e'),_0xaf537a[_0x014e('0x1a')]),_0x014e('0x8f'),{'uri':_0x014e('0x90')+_0x40cb21[_0x014e('0x81')]+_0x014e('0x91')+_0x2ccdb3['id']});}})[_0x014e('0x2f')](function(_0x46c68b){logger[_0x014e('0x30')](_0x014e('0x94'),JSON['stringify'](_0x46c68b));});};exports[_0x014e('0x9a')]=function(_0x4c1d87,_0x570a5a,_0x4a1152,_0x3848cc,_0x28e086,_0xe201b9){var _0x3f0982,_0x32df5d,_0x4613f6;_0xe201b9[_0x014e('0x81')]=intUtil[_0x014e('0x82')](_0xe201b9[_0x014e('0x81')]);_0xe201b9['serverUrl']=intUtil['stripTrailingSlash'](_0xe201b9['serverUrl']);if(_0x28e086&&_0x28e086[_0x014e('0x84')]){logger[_0x014e('0x32')]('['+_0x570a5a[_0x014e('0x6e')]['toUpperCase']()+']',_0x014e('0x95'));_0x570a5a[_0x014e('0x85')]=_0xe201b9[_0x014e('0x83')]+_0x014e('0x9b')+_0x570a5a[_0x014e('0x87')]+_0x014e('0x86')+md5(_0x570a5a[_0x014e('0x87')]);}else{_0x570a5a[_0x014e('0x85')]='';}var _0x10f1b7=_0xe201b9['host']===_0x014e('0x96')?'eu':_0x014e('0x88');return getAccessToken(_0xe201b9)['then'](function(_0x5b7089){_0x4613f6=_0x5b7089;return getUser(_0x4613f6,_0x10f1b7,_0xe201b9);})[_0x014e('0x2c')](function(_0x47dd1c){_0x3f0982=_0x47dd1c;logger['info']('The\x20User\x20ID\x20is:',_0x3f0982['id']);return getEndUser(_0x4613f6,_0x10f1b7,_0xe201b9,_0x570a5a['calleridname'],_0x570a5a[_0x014e('0x8a')],_0x3f0982,_0x4a1152);})[_0x014e('0x2c')](function(_0x561f7b){_0x32df5d=_0x561f7b;return getCall(_0x4613f6,_0x10f1b7,_0xe201b9,_0x3f0982,_0x32df5d,_0x4a1152,_0x570a5a,_0x014e('0x8b'));})[_0x014e('0x2c')](function(_0x5c1f1e){if(_0x5c1f1e){logger[_0x014e('0x32')](_0x014e('0x9c'),_0x5c1f1e['id']);}})['catch'](function(_0x2b6705){logger[_0x014e('0x30')]('['+_0x570a5a[_0x014e('0x6e')][_0x014e('0x9d')]()+']',JSON['stringify'](_0x2b6705));});}; \ No newline at end of file +var _0x42bd=['Full_Name','First_Name','Last_Name','Leads','What_Id','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','recordingURL','email','destcalleridname','destcalleridnum','The\x20Call\x20ID\x20is:','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','md5','util','./util','moment','ioredis','bluebird','redis','localhost','socket.io-emitter','emit','debug','stringify','forEach','string','picklist','type','content','toString','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','details','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x42bd,0xd9));var _0xd42b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x42bd[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xd42b('0x0'));var util=require(_0xd42b('0x1'));var intUtil=require(_0xd42b('0x2'));var moment=require(_0xd42b('0x3'));var Redis=require(_0xd42b('0x4'));var BPromise=require(_0xd42b('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config[_0xd42b('0x6')]=_['defaults'](config[_0xd42b('0x6')],{'host':_0xd42b('0x7'),'port':0x18eb});var io=require(_0xd42b('0x8'))(new Redis(config[_0xd42b('0x6')]));function emit(_0x135898,_0x343d09,_0x4e7373){io['to'](_0x135898)[_0xd42b('0x9')](_0x343d09,_0x4e7373);}function request(_0xf1943f){logger[_0xd42b('0xa')]('[HTTP]',JSON[_0xd42b('0xb')](_0xf1943f));return rp(_0xf1943f);}function getCustomFields(_0x9cc65e,_0x38a933){var _0x50dd59={};if(_0x9cc65e['length']>0x0){_[_0xd42b('0xc')](_0x9cc65e,function(_0x5288bf){if(_['includes']([_0xd42b('0xd'),_0xd42b('0xe')],_0x5288bf[_0xd42b('0xf')])&&_0x5288bf['idField']){_0x50dd59[_0x5288bf['idField']]=_0x5288bf[_0xd42b('0x10')][_0xd42b('0x11')]();}else if(_0x5288bf['type']==='variable'&&_0x5288bf[_0xd42b('0x12')]&&_0x5288bf[_0xd42b('0x13')]&&_0x38a933[_0x5288bf['variableName']]){_0x50dd59[_0x5288bf['idField']]=_0x38a933[_0x5288bf[_0xd42b('0x12')]][_0xd42b('0x11')]();}else if(_0x5288bf[_0xd42b('0xf')]===_0xd42b('0x14')&&_0x5288bf[_0xd42b('0x15')]&&_0x5288bf[_0xd42b('0x15')][_0xd42b('0x16')]&&_0x5288bf[_0xd42b('0x13')]&&_0x38a933[_0x5288bf['Variable'][_0xd42b('0x16')]['toLowerCase']()]){_0x50dd59[_0x5288bf[_0xd42b('0x13')]]=_0x38a933[_0x5288bf[_0xd42b('0x15')][_0xd42b('0x16')][_0xd42b('0x17')]()][_0xd42b('0x11')]();}});}return _0x50dd59;}function getName(_0x246c67){if(_0x246c67[_0xd42b('0x18')]('\x20')>0x0){var _0x133ff5=_0x246c67[_0xd42b('0x19')](/ (.+)/);if(_0x133ff5[0x1]){return _0x133ff5;}}return[_0x246c67,_0x246c67];}var accountsTokens={};function getAccessToken(_0x4295d0){return new Promise(function(_0x150b53,_0x4e8320){if(!_[_0xd42b('0x1a')](accountsTokens[_0x4295d0['id']])&&!_[_0xd42b('0x1a')](accountsTokens[_0x4295d0['id']][_0xd42b('0x1b')])){if(moment()[_0xd42b('0x1c')](accountsTokens[_0x4295d0['id']][_0xd42b('0x1d')])){_0x150b53(accountsTokens[_0x4295d0['id']][_0xd42b('0x1b')]);}}var _0x46e55f;switch(_0x4295d0[_0xd42b('0x1e')]){case'US':_0x46e55f=_0xd42b('0x1f');break;case'AU':_0x46e55f=_0xd42b('0x20');break;case'EU':_0x46e55f=_0xd42b('0x21');break;case'IN':_0x46e55f=_0xd42b('0x22');break;case'CN':_0x46e55f=_0xd42b('0x23');break;default:_0x46e55f='https://accounts.zoho.eu';break;}var _0x5c8bda={'method':_0xd42b('0x24'),'uri':_0x46e55f+_0xd42b('0x25'),'qs':{'refresh_token':_0x4295d0['refreshToken'],'client_id':_0x4295d0[_0xd42b('0x26')],'client_secret':_0x4295d0[_0xd42b('0x27')],'grant_type':_0xd42b('0x28')},'json':!![]};return rp(_0x5c8bda)[_0xd42b('0x29')](function(_0xc78cc){accountsTokens[_0x4295d0['id']]={'access_token':_0xc78cc[_0xd42b('0x1b')],'expires_in':moment()[_0xd42b('0x2a')](_0xc78cc['expires_in'],_0xd42b('0x2b'))};_0x150b53(_0xc78cc[_0xd42b('0x1b')]);})[_0xd42b('0x2c')](function(_0x4d57c7){logger['error'](_0xd42b('0x2d'),_0x4d57c7[_0xd42b('0x2e')]);_0x4e8320(_0x4d57c7);});});}function getUser(_0x38197f,_0x37c09a,_0x39a452,_0x57b480){logger[_0xd42b('0x2f')](_0xd42b('0x30'));return request({'method':_0xd42b('0x31'),'uri':util['format'](_0xd42b('0x32'),_0x37c09a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xd42b('0x33')+_0x38197f},'json':!![]})[_0xd42b('0x29')](function(_0x4d09b3){if(_0x4d09b3[_0xd42b('0x34')]){var _0x5d666b=-0x1;if(_[_0xd42b('0x35')](_0x4d09b3[_0xd42b('0x34')])){if(!_[_0xd42b('0x1a')](_0x57b480)){_0x5d666b=_[_0xd42b('0x36')](_0x4d09b3[_0xd42b('0x34')],function(_0x28e9a9){return _0x28e9a9['email']===_0x57b480;});}if(_0x5d666b>=0x0){logger['info'](_0xd42b('0x37'));}else{logger[_0xd42b('0x2f')]('Using\x20the\x20admin\x20account!');_0x5d666b=_['findIndex'](_0x4d09b3[_0xd42b('0x34')],function(_0x3185a2){return _0x3185a2[_0xd42b('0x38')][_0xd42b('0x16')]===_0xd42b('0x39');});}return _0x4d09b3[_0xd42b('0x34')][_0x5d666b];}else{if(_0x4d09b3[_0xd42b('0x3a')][_0xd42b('0x38')]['name']===_0xd42b('0x39')){logger[_0xd42b('0x2f')](_0xd42b('0x3b'));user=_0x4d09b3[_0xd42b('0x3a')];return user;}else{logger['error'](_0xd42b('0x3c'),JSON[_0xd42b('0xb')](_0x4d09b3));throw new Error(_0xd42b('0x3d')+JSON[_0xd42b('0xb')](_0x4d09b3));}}}else{logger[_0xd42b('0x3e')](_0xd42b('0x3c'),JSON[_0xd42b('0xb')](_0x4d09b3));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xd42b('0xb')](_0x4d09b3));}})[_0xd42b('0x2c')](function(_0x378bd8){console[_0xd42b('0x3e')](_0x378bd8);});}function getZohoUser(_0x33e57a,_0xd81e2a){return new BPromise(function(_0x11f9d2,_0x2f9718){request(_0x33e57a)[_0xd42b('0x29')](function(_0x2ec9b5){var _0x32e0c2=null;if(_0x2ec9b5){_0x32e0c2=_0x2ec9b5[_0xd42b('0x3f')][0x0];_0x32e0c2[_0xd42b('0x40')]=_0xd81e2a;}_0x11f9d2(_0x32e0c2);})['catch'](function(_0x3542ac){_0x2f9718(_0x3542ac);});});}function createEndUser(_0x2baa19,_0x903579,_0x411bbe,_0x5a6ebc,_0x1e01e3,_0x122d42){var _0x411bbe=getName(_0x411bbe);return request({'method':_0xd42b('0x24'),'uri':_0xd42b('0x41')+_0x903579+'/crm/v2/'+_[_0xd42b('0x42')](_0x122d42[_0xd42b('0x43')])+'s','body':{'data':[{'Last_Name':_0x411bbe[0x1],'First_Name':_0x411bbe[0x0],'Phone':_0x5a6ebc,'Owner':{'name':!_[_0xd42b('0x1a')](_0x1e01e3[_0xd42b('0x44')]['name'])?_0x1e01e3[_0xd42b('0x44')][_0xd42b('0x16')]:!_[_0xd42b('0x1a')](_0x1e01e3['first_name'])?_0x1e01e3[_0xd42b('0x45')]+'\x20'+_0x1e01e3[_0xd42b('0x46')]:_0x1e01e3['last_name'],'id':_0x1e01e3['id']}}]},'headers':{'Authorization':_0xd42b('0x33')+_0x2baa19},'json':!![]})[_0xd42b('0x29')](function(_0x176849){if(_0x176849&&_0x176849[_0xd42b('0x3f')][0x0][_0xd42b('0x47')]==='SUCCESS'){var _0x53e8ba=_0x176849[_0xd42b('0x3f')][0x0][_0xd42b('0x48')];_0x53e8ba[_0xd42b('0x40')]=_['startCase'](_0x122d42['moduleCreate'])+'s';return _0x53e8ba;}logger[_0xd42b('0x3e')](_0xd42b('0x3c'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0xd42b('0xb')](data));})['catch'](function(_0x432f78){console[_0xd42b('0x49')](_0xd42b('0x4a'),_0x432f78);});}function getEndUser(_0x95271a,_0x2cf1d6,_0x55e2fb,_0x399b75,_0x2db88c,_0x255065,_0x2b4665){var _0x39d304={'method':_0xd42b('0x31'),'uri':'','headers':{'Authorization':_0xd42b('0x33')+_0x95271a},'json':!![]};switch(_0x2b4665[_0xd42b('0x4b')]){case'contact_lead':_0x39d304[_0xd42b('0x4c')]=_0xd42b('0x41')+_0x2cf1d6+_0xd42b('0x4d')+_0x2db88c+'))';return getZohoUser(_0x39d304,'Contacts')[_0xd42b('0x29')](function(_0x4ffaba){if(_0x4ffaba)return _0x4ffaba;_0x39d304[_0xd42b('0x4c')]='https://www.zohoapis.'+_0x2cf1d6+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2db88c+'))';return getZohoUser(_0x39d304,'Leads')[_0xd42b('0x29')](function(_0x17b3e2){if(_0x17b3e2)return _0x17b3e2;if(_0x2b4665[_0xd42b('0x43')]!=_0xd42b('0x4e')){return createEndUser(_0x95271a,_0x2cf1d6,_0x399b75,_0x2db88c,_0x255065,_0x2b4665);}else{return{};}});});break;case _0xd42b('0x4f'):_0x39d304[_0xd42b('0x4c')]=_0xd42b('0x41')+_0x2cf1d6+_0xd42b('0x4d')+_0x2db88c+'))';return getZohoUser(_0x39d304,_0xd42b('0x50'))[_0xd42b('0x29')](function(_0x102e8b){if(_0x102e8b)return _0x102e8b;if(_0x2b4665[_0xd42b('0x43')]!='nothing'){return createEndUser(_0x95271a,_0x2cf1d6,_0x399b75,_0x2db88c,_0x255065,_0x2b4665);}else{return{};}});break;case _0xd42b('0x51'):_0x39d304[_0xd42b('0x4c')]=_0xd42b('0x41')+_0x2cf1d6+_0xd42b('0x52')+_0x2db88c+'))';return getZohoUser(_0x39d304,'Leads')[_0xd42b('0x29')](function(_0x29b14b){if(_0x29b14b)return _0x29b14b;if(_0x2b4665['moduleCreate']!=_0xd42b('0x4e')){return createEndUser(_0x95271a,_0x2cf1d6,_0x399b75,_0x2db88c,_0x255065,_0x2b4665);}else{return{};}});break;}}function getCall(_0x5f1514,_0x2d6e14,_0x4c9c94,_0x513623,_0x239b8a,_0x56a170,_0x3ee30d,_0x148bb5){logger[_0xd42b('0x2f')]('Creating\x20new\x20call...');var _0x583bca={};_0x583bca[_0xd42b('0x53')]={'name':!_[_0xd42b('0x1a')](_0x513623[_0xd42b('0x44')][_0xd42b('0x16')])&&!_[_0xd42b('0x1a')](_0x513623[_0xd42b('0x38')][_0xd42b('0x16')])&&_0x513623[_0xd42b('0x38')][_0xd42b('0x16')]===_0xd42b('0x54')?_0x513623[_0xd42b('0x44')]['name']:!_[_0xd42b('0x1a')](_0x513623['first_name'])?_0x513623[_0xd42b('0x45')]+'\x20'+_0x513623['last_name']:_0x513623[_0xd42b('0x46')],'id':_0x513623['id']};_0x583bca[_0xd42b('0x55')]=intUtil[_0xd42b('0x56')](_0x56a170[_0xd42b('0x57')],_0x3ee30d,'\x20');_0x583bca[_0xd42b('0x58')]=intUtil[_0xd42b('0x56')](_0x56a170[_0xd42b('0x59')],_0x3ee30d,'\x0a');if(_0x239b8a[_0xd42b('0x40')]===_0xd42b('0x50')){_0x583bca[_0xd42b('0x5a')]={'name':!_['isNil'](_0x239b8a[_0xd42b('0x5b')])?_0x239b8a[_0xd42b('0x5b')]:!_['isNil'](_0x239b8a[_0xd42b('0x5c')])?_0x239b8a['First_Name']+'\x20'+_0x239b8a['Last_Name']:_0x239b8a[_0xd42b('0x5d')],'id':_0x239b8a['id']};}if(_0x239b8a[_0xd42b('0x40')]===_0xd42b('0x5e')){_0x583bca[_0xd42b('0x5f')]={'name':!_[_0xd42b('0x1a')](_0x239b8a[_0xd42b('0x5b')])?_0x239b8a['Full_Name']:!_['isNil'](_0x239b8a[_0xd42b('0x5c')])?_0x239b8a[_0xd42b('0x5c')]+'\x20'+_0x239b8a['Last_Name']:_0x239b8a['Last_Name'],'id':_0x239b8a['id']};_0x583bca['$se_module']=_['startCase'](_0x239b8a[_0xd42b('0x40')]);}if(_0x3ee30d[_0xd42b('0x60')]){_0x583bca[_0xd42b('0x61')]=moment[_0xd42b('0x62')](parseInt(_0x3ee30d[_0xd42b('0x60')])*0x3e8)['format'](_0xd42b('0x63'));}else if(_0x3ee30d['answertime']&&_0x3ee30d[_0xd42b('0x64')]){_0x583bca[_0xd42b('0x61')]=moment[_0xd42b('0x62')](moment(_0x3ee30d[_0xd42b('0x64')],_0xd42b('0x65'))['diff'](moment(_0x3ee30d[_0xd42b('0x66')],_0xd42b('0x65'))))[_0xd42b('0x67')](_0xd42b('0x63'));}switch(_0x3ee30d[_0xd42b('0x68')]){case _0xd42b('0x69'):_0x583bca['Call_Result']=_0xd42b('0x6a');break;case _0xd42b('0x6b'):case _0xd42b('0x6c'):_0x583bca[_0xd42b('0x6d')]=_0xd42b('0x6e');break;case _0xd42b('0x6f'):_0x583bca[_0xd42b('0x6d')]=_0xd42b('0x70');break;case _0xd42b('0x71'):_0x583bca[_0xd42b('0x6d')]=_0xd42b('0x72');break;case _0xd42b('0x73'):_0x583bca['Call_Result']=_0xd42b('0x74');default:}_0x583bca['Call_Start_Time']=(_0x148bb5===_0xd42b('0x75')?moment(_0x3ee30d[_0xd42b('0x66')])[_0xd42b('0x67')](_0xd42b('0x65')):moment(_0x3ee30d['agentcalledAt'])[_0xd42b('0x67')](_0xd42b('0x65')))||moment()[_0xd42b('0x67')](_0xd42b('0x65'));_0x583bca[_0xd42b('0x76')]=_0x148bb5||_0xd42b('0x77');_0x583bca=_[_0xd42b('0x78')](_0x583bca,getCustomFields(_0x56a170[_0xd42b('0x79')],_0x3ee30d));return request({'method':_0xd42b('0x24'),'uri':_0xd42b('0x41')+_0x2d6e14+_0xd42b('0x7a'),'headers':{'Authorization':_0xd42b('0x33')+_0x5f1514},'body':{'data':[_0x583bca]},'json':!![]})[_0xd42b('0x29')](function(_0x46aa4e){if(_0x46aa4e&&_0x46aa4e[_0xd42b('0x3f')][0x0]['code']===_0xd42b('0x7b')){logger[_0xd42b('0x2f')](_0xd42b('0x7c'));return{'id':_0x46aa4e['data'][0x0][_0xd42b('0x48')]['id']};}})[_0xd42b('0x2c')](function(_0xb95564){logger[_0xd42b('0x2f')](_0xd42b('0x7d'),_0xb95564[_0xd42b('0x2e')]);console[_0xd42b('0x49')](_0xd42b('0x7d'),_0xb95564);});}exports[_0xd42b('0x7e')]=function(_0x422457,_0x558ec0,_0x1fcea8,_0x50993f,_0x5ca193,_0x10ce51){var _0x292399,_0x5b625d,_0x44b560;_0x10ce51['host']=intUtil['stripTrailingSlash'](_0x10ce51[_0xd42b('0x7f')]);_0x10ce51['serverUrl']=intUtil['stripTrailingSlash'](_0x10ce51[_0xd42b('0x80')]);if(_0x5ca193&&_0x5ca193[_0xd42b('0x81')]){logger[_0xd42b('0x2f')](_0xd42b('0x82'),_0xd42b('0x83'));_0x558ec0['recordingURL']=_0x10ce51[_0xd42b('0x80')]+_0xd42b('0x84')+_0x558ec0['uniqueid']+_0xd42b('0x85')+md5(_0x558ec0[_0xd42b('0x86')]);}else{_0x558ec0['recordingURL']='';}var _0x22c2f4=_0x10ce51[_0xd42b('0x7f')]===_0xd42b('0x87')?'eu':_0xd42b('0x88');return getAccessToken(_0x10ce51)[_0xd42b('0x29')](function(_0x5a109e){_0x44b560=_0x5a109e;return getUser(_0x44b560,_0x22c2f4,_0x10ce51,_0x50993f['email']);})[_0xd42b('0x29')](function(_0x5f22d9){_0x292399=_0x5f22d9;logger['info'](_0xd42b('0x89'),_0x292399['id']);return getEndUser(_0x44b560,_0x22c2f4,_0x10ce51,_0x558ec0['calleridname'],_0x558ec0[_0xd42b('0x8a')],_0x292399,_0x1fcea8);})['then'](function(_0x701398){_0x5b625d=_0x701398;return getCall(_0x44b560,_0x22c2f4,_0x10ce51,_0x292399,_0x5b625d,_0x1fcea8,_0x558ec0,_0xd42b('0x77'));})[_0xd42b('0x29')](function(_0x40e6ab){if(_0x40e6ab){logger[_0xd42b('0x2f')]('The\x20Call\x20ID\x20is:',_0x40e6ab['id']);logger[_0xd42b('0x2f')](_0xd42b('0x82'),_0xd42b('0x8b'));emit(util[_0xd42b('0x67')](_0xd42b('0x8c'),_0x50993f[_0xd42b('0x16')]),_0xd42b('0x8d'),{'uri':'https://crm.'+_0x10ce51[_0xd42b('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x40e6ab['id']});}})[_0xd42b('0x2c')](function(_0x51accf){logger[_0xd42b('0x3e')](_0xd42b('0x82'),JSON[_0xd42b('0xb')](_0x51accf));});};exports[_0xd42b('0x75')]=function(_0x556d57,_0xd88bc,_0x54bfbb,_0x167d40,_0x55c1eb,_0x302cfe,_0x33c9be){var _0x2b6c80,_0x1d11b0,_0x3c7f8f;_0x302cfe['host']=intUtil[_0xd42b('0x8e')](_0x302cfe['host']);_0x302cfe[_0xd42b('0x80')]=intUtil[_0xd42b('0x8e')](_0x302cfe['serverUrl']);if(_0x33c9be&&_0x33c9be[_0xd42b('0x8f')]&&_0x33c9be['recordingFormat']!==_0xd42b('0x90')){logger[_0xd42b('0x2f')](_0xd42b('0x91'),_0xd42b('0x83'));_0xd88bc[_0xd42b('0x92')]=_0x302cfe['serverUrl']+_0xd42b('0x84')+_0xd88bc[_0xd42b('0x86')]+_0xd42b('0x85')+md5(_0xd88bc[_0xd42b('0x86')]);}var _0x4bea2b=_0x302cfe[_0xd42b('0x7f')]===_0xd42b('0x87')?'eu':'com';return getAccessToken(_0x302cfe)[_0xd42b('0x29')](function(_0x2766c8){_0x3c7f8f=_0x2766c8;return getUser(_0x3c7f8f,_0x4bea2b,_0x302cfe,_0x167d40[_0xd42b('0x93')]);})[_0xd42b('0x29')](function(_0x2d5db0){_0x2b6c80=_0x2d5db0;logger[_0xd42b('0x2f')](_0xd42b('0x89'),_0x2b6c80['id']);return getEndUser(_0x3c7f8f,_0x4bea2b,_0x302cfe,_0xd88bc[_0xd42b('0x94')],_0xd88bc[_0xd42b('0x95')],_0x2b6c80,_0x54bfbb);})[_0xd42b('0x29')](function(_0x36ad20){_0x1d11b0=_0x36ad20;return getCall(_0x3c7f8f,_0x4bea2b,_0x302cfe,_0x2b6c80,_0x1d11b0,_0x54bfbb,_0xd88bc,'Outbound');})[_0xd42b('0x29')](function(_0x1cc2d4){if(_0x1cc2d4){logger['info'](_0xd42b('0x96'),_0x1cc2d4['id']);logger[_0xd42b('0x2f')](_0xd42b('0x91'),_0xd42b('0x8b'));emit(util[_0xd42b('0x67')](_0xd42b('0x8c'),_0x167d40[_0xd42b('0x16')]),_0xd42b('0x8d'),{'uri':'https://crm.'+_0x302cfe[_0xd42b('0x7f')]+_0xd42b('0x97')+_0x1cc2d4['id']});}})[_0xd42b('0x2c')](function(_0xce199f){logger['error'](_0xd42b('0x91'),JSON[_0xd42b('0xb')](_0xce199f));});};exports[_0xd42b('0x98')]=function(_0x10ff6f,_0xcb93c3,_0x1c6153,_0x3943d3,_0x275b50,_0x2a427a){var _0x12627f,_0x3ffa47,_0x54294b;_0x2a427a[_0xd42b('0x7f')]=intUtil[_0xd42b('0x8e')](_0x2a427a[_0xd42b('0x7f')]);_0x2a427a['serverUrl']=intUtil['stripTrailingSlash'](_0x2a427a[_0xd42b('0x80')]);if(_0x275b50&&_0x275b50[_0xd42b('0x81')]){logger['info']('['+_0xcb93c3['lastevent'][_0xd42b('0x99')]()+']',_0xd42b('0x83'));_0xcb93c3['recordingURL']=_0x2a427a[_0xd42b('0x80')]+_0xd42b('0x84')+_0xcb93c3['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0xcb93c3['uniqueid']);}else{_0xcb93c3[_0xd42b('0x92')]='';}var _0x5e1fa5=_0x2a427a[_0xd42b('0x7f')]===_0xd42b('0x87')?'eu':_0xd42b('0x88');return getAccessToken(_0x2a427a)[_0xd42b('0x29')](function(_0x2cd5ab){_0x54294b=_0x2cd5ab;return getUser(_0x54294b,_0x5e1fa5,_0x2a427a);})[_0xd42b('0x29')](function(_0x194620){_0x12627f=_0x194620;logger['info']('The\x20User\x20ID\x20is:',_0x12627f['id']);return getEndUser(_0x54294b,_0x5e1fa5,_0x2a427a,_0xcb93c3['calleridname'],_0xcb93c3['calleridnum'],_0x12627f,_0x1c6153);})[_0xd42b('0x29')](function(_0xa63fb0){_0x3ffa47=_0xa63fb0;return getCall(_0x54294b,_0x5e1fa5,_0x2a427a,_0x12627f,_0x3ffa47,_0x1c6153,_0xcb93c3,_0xd42b('0x77'));})[_0xd42b('0x29')](function(_0x302871){if(_0x302871){logger['info'](_0xd42b('0x96'),_0x302871['id']);}})[_0xd42b('0x2c')](function(_0x45d8a4){logger[_0xd42b('0x3e')]('['+_0xcb93c3['lastevent'][_0xd42b('0x99')]()+']',JSON[_0xd42b('0xb')](_0x45d8a4));});}; \ 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 4ad593d..bd4af86 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 _0x9bdf=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','data2','Script','render','data3'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0x9bdf,0x154));var _0xf9bd=function(_0x33481a,_0x5d4316){_0x33481a=_0x33481a-0x0;var _0x408ab9=_0x9bdf[_0x33481a];return _0x408ab9;};'use strict';var util=require(_0xf9bd('0x0'));var sh=require('shelljs');var Mustache=require(_0xf9bd('0x1'));var logger=require(_0xf9bd('0x2'))(_0xf9bd('0x3'));exports['exec']=function(_0x1cb448,_0x3b47e0){var _0x1fc1a8=_0x1cb448[_0xf9bd('0x4')]?_0x1cb448[_0xf9bd('0x4')]:_0xf9bd('0x5');var _0x4655b9=_0x1cb448['data3']?Mustache[_0xf9bd('0x6')](_0x1cb448[_0xf9bd('0x7')],_0x3b47e0):_0x3b47e0;sh['exec'](_0x4655b9,function(_0x137101,_0x3008ad,_0x4a478e){if(_0x137101!==0x0){logger['error'](util[_0xf9bd('0x8')](_0xf9bd('0x9'),_0x1fc1a8,_0x4655b9,_0x137101,_0x4a478e));}else{logger[_0xf9bd('0xa')](util[_0xf9bd('0x8')](_0xf9bd('0xb'),_0x1fc1a8,_0x4655b9,_0x3008ad));}});}; \ No newline at end of file +var _0xaedb=['mustache','../../../../config/logger','trigger','data2','Script','data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs'];(function(_0x4f46a3,_0x1bf5a8){var _0x3d3d5a=function(_0x44a584){while(--_0x44a584){_0x4f46a3['push'](_0x4f46a3['shift']());}};_0x3d3d5a(++_0x1bf5a8);}(_0xaedb,0xc3));var _0xbaed=function(_0x3836d5,_0x24e547){_0x3836d5=_0x3836d5-0x0;var _0x434c74=_0xaedb[_0x3836d5];return _0x434c74;};'use strict';var util=require('util');var sh=require(_0xbaed('0x0'));var Mustache=require(_0xbaed('0x1'));var logger=require(_0xbaed('0x2'))(_0xbaed('0x3'));exports['exec']=function(_0x3cb18e,_0x1e4144){var _0x4acf54=_0x3cb18e[_0xbaed('0x4')]?_0x3cb18e[_0xbaed('0x4')]:_0xbaed('0x5');var _0x268786=_0x3cb18e[_0xbaed('0x6')]?Mustache[_0xbaed('0x7')](_0x3cb18e['data3'],_0x1e4144):_0x1e4144;sh[_0xbaed('0x8')](_0x268786,function(_0x136391,_0x3c185a,_0x2d0bce){if(_0x136391!==0x0){logger[_0xbaed('0x9')](util[_0xbaed('0xa')](_0xbaed('0xb'),_0x4acf54,_0x268786,_0x136391,_0x2d0bce));}else{logger[_0xbaed('0xc')](util[_0xbaed('0xa')](_0xbaed('0xd'),_0x4acf54,_0x268786,_0x3c185a));}});}; \ 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 5e120c3..b685b54 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 _0x0361=['%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','lodash','mustache','trigger','exec','data1','toUpperCase','data2','data5','data6','parse','stack','PUT','data7','render','body','error','info','format'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x0361,0xc6));var _0x1036=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0361[_0x3ab51d];return _0x29a04e;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x1036('0x0'));var Mustache=require(_0x1036('0x1'));var logger=require('../../../../config/logger')(_0x1036('0x2'));exports[_0x1036('0x3')]=function(_0x1eea08,_0x11eccd){var _0x58227c,_0x1ee612;var _0x45ba2a={'method':_0x1eea08[_0x1036('0x4')][_0x1036('0x5')](),'uri':Mustache['render'](_0x1eea08[_0x1036('0x6')],_0x11eccd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1eea08[_0x1036('0x7')])==='number'&&parseInt(_0x1eea08[_0x1036('0x7')])>=0x1&&parseInt(_0x1eea08[_0x1036('0x7')])<=0xa?parseInt(_0x1eea08[_0x1036('0x7')])*0x3e8:0x5*0x3e8};try{_0x45ba2a['headers']=_0x1eea08[_0x1036('0x8')]?JSON[_0x1036('0x9')](Mustache['render'](_0x1eea08[_0x1036('0x8')],_0x11eccd)):{};}catch(_0x36342f){logger['error'](_0x36342f[_0x1036('0xa')]);}switch(_0x1eea08[_0x1036('0x4')]['toUpperCase']()){case'GET':case'DELETE':_0x58227c=null;_0x45ba2a['qs']=_0x11eccd;break;case'POST':case _0x1036('0xb'):if(_0x1eea08[_0x1036('0xc')]){try{_0x58227c=JSON[_0x1036('0x9')](Mustache[_0x1036('0xd')](_0x1eea08['data7'],_0x11eccd));_0x45ba2a[_0x1036('0xe')]=_0x58227c;}catch(_0x46ecc0){logger['error'](_0x46ecc0[_0x1036('0xa')]);logger[_0x1036('0xf')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x58227c=_0x11eccd;_0x45ba2a[_0x1036('0xe')]=_0x58227c;}break;}logger[_0x1036('0x10')](util[_0x1036('0x11')](_0x1036('0x12'),_0x1eea08['data1'],_0x1eea08[_0x1036('0x6')],JSON['stringify'](_0x45ba2a)));rp(_0x45ba2a)['then'](function(_0x2e320d){_0x58227c=!_[_0x1036('0x13')](_0x58227c)?_0x1036('0x14')+_0x58227c:'';_0x1ee612=typeof _0x2e320d[_0x1036('0xe')]===_0x1036('0x15')?JSON[_0x1036('0x16')](_0x2e320d[_0x1036('0xe')]):_0x2e320d[_0x1036('0xe')];logger[_0x1036('0x10')](util['format'](_0x1036('0x17'),_0x1eea08[_0x1036('0x4')],_0x1eea08['data2'],_0x2e320d[_0x1036('0x18')],_0x1ee612));})[_0x1036('0x19')](function(_0x24c4a3){logger[_0x1036('0xf')](util[_0x1036('0x11')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1eea08[_0x1036('0x4')],_0x1eea08[_0x1036('0x6')],_0x24c4a3[_0x1036('0x18')],_0x24c4a3['name'],_0x24c4a3[_0x1036('0x1a')]));});}; \ No newline at end of file +var _0xbf07=['format','data2','then',',\x20request\x20body:\x20','object','stringify','%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','../../../../config/logger','trigger','toUpperCase','render','number','data5','headers','data6','parse','error','data1','GET','DELETE','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info'];(function(_0x5cf2ce,_0x45403d){var _0x510e1d=function(_0x1c08ec){while(--_0x1c08ec){_0x5cf2ce['push'](_0x5cf2ce['shift']());}};_0x510e1d(++_0x45403d);}(_0xbf07,0x14c));var _0x7bf0=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0xbf07[_0x3e5bc8];return _0xfd84bc;};'use strict';var rp=require(_0x7bf0('0x0'));var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x7bf0('0x1'))(_0x7bf0('0x2'));exports['exec']=function(_0x3f934d,_0x54af25){var _0x341709,_0x58f1d4;var _0x4df967={'method':_0x3f934d['data1'][_0x7bf0('0x3')](),'uri':Mustache[_0x7bf0('0x4')](_0x3f934d['data2'],_0x54af25),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3f934d['data5'])===_0x7bf0('0x5')&&parseInt(_0x3f934d[_0x7bf0('0x6')])>=0x1&&parseInt(_0x3f934d[_0x7bf0('0x6')])<=0xa?parseInt(_0x3f934d[_0x7bf0('0x6')])*0x3e8:0x5*0x3e8};try{_0x4df967[_0x7bf0('0x7')]=_0x3f934d[_0x7bf0('0x8')]?JSON[_0x7bf0('0x9')](Mustache[_0x7bf0('0x4')](_0x3f934d[_0x7bf0('0x8')],_0x54af25)):{};}catch(_0x3686a1){logger[_0x7bf0('0xa')](_0x3686a1['stack']);}switch(_0x3f934d[_0x7bf0('0xb')][_0x7bf0('0x3')]()){case _0x7bf0('0xc'):case _0x7bf0('0xd'):_0x341709=null;_0x4df967['qs']=_0x54af25;break;case'POST':case _0x7bf0('0xe'):if(_0x3f934d[_0x7bf0('0xf')]){try{_0x341709=JSON[_0x7bf0('0x9')](Mustache['render'](_0x3f934d[_0x7bf0('0xf')],_0x54af25));_0x4df967[_0x7bf0('0x10')]=_0x341709;}catch(_0x2325d7){logger['error'](_0x2325d7[_0x7bf0('0x11')]);logger['error'](_0x7bf0('0x12'));}}else{_0x341709=_0x54af25;_0x4df967[_0x7bf0('0x10')]=_0x341709;}break;}logger[_0x7bf0('0x13')](util[_0x7bf0('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3f934d[_0x7bf0('0xb')],_0x3f934d[_0x7bf0('0x15')],JSON['stringify'](_0x4df967)));rp(_0x4df967)[_0x7bf0('0x16')](function(_0x18427e){_0x341709=!_['isNil'](_0x341709)?_0x7bf0('0x17')+_0x341709:'';_0x58f1d4=typeof _0x18427e[_0x7bf0('0x10')]===_0x7bf0('0x18')?JSON[_0x7bf0('0x19')](_0x18427e[_0x7bf0('0x10')]):_0x18427e[_0x7bf0('0x10')];logger[_0x7bf0('0x13')](util[_0x7bf0('0x14')](_0x7bf0('0x1a'),_0x3f934d[_0x7bf0('0xb')],_0x3f934d[_0x7bf0('0x15')],_0x18427e[_0x7bf0('0x1b')],_0x58f1d4));})[_0x7bf0('0x1c')](function(_0x3a22eb){logger['error'](util[_0x7bf0('0x14')](_0x7bf0('0x1d'),_0x3f934d[_0x7bf0('0xb')],_0x3f934d[_0x7bf0('0x15')],_0x3a22eb[_0x7bf0('0x1b')],_0x3a22eb[_0x7bf0('0x1e')],_0x3a22eb[_0x7bf0('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d1f6f08..7cea994 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 _0x7b73=['request','then','debug','rpc','error','routing','message','result','catch','exports','jayson/promise','bluebird','http','Request'];(function(_0x12b1b2,_0x25000c){var _0x51f080=function(_0x5f24fb){while(--_0x5f24fb){_0x12b1b2['push'](_0x12b1b2['shift']());}};_0x51f080(++_0x25000c);}(_0x7b73,0x1f4));var _0x37b7=function(_0x2d6375,_0x149216){_0x2d6375=_0x2d6375-0x0;var _0x29186f=_0x7b73[_0x2d6375];return _0x29186f;};'use strict';var jayson=require(_0x37b7('0x0'));var BPromise=require(_0x37b7('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0x37b7('0x2')]({'port':0x2329});client[_0x37b7('0x3')]=function(_0x2ecf3d,_0x3bc819){return new BPromise(function(_0x52cc4d,_0x5051f3){return client[_0x37b7('0x4')](_0x2ecf3d,_0x3bc819)[_0x37b7('0x5')](function(_0x1081bd){logger[_0x37b7('0x6')](_0x37b7('0x7'),'routing',_0x2ecf3d,_0x3bc819,_0x1081bd);if(_0x1081bd[_0x37b7('0x8')]){logger['error'](_0x37b7('0x7'),_0x37b7('0x9'),_0x2ecf3d,_0x1081bd[_0x37b7('0x8')][_0x37b7('0xa')],_0x3bc819);return _0x5051f3(_0x1081bd[_0x37b7('0x8')][_0x37b7('0xa')]);}else{return _0x52cc4d(_0x1081bd[_0x37b7('0xb')]);}})[_0x37b7('0xc')](function(_0x2f6efa){logger[_0x37b7('0x8')]('rpc','routing',_0x2ecf3d,_0x2f6efa,_0x3bc819);return _0x5051f3(_0x2f6efa);});});};module[_0x37b7('0xd')]=client; \ No newline at end of file +var _0x8a08=['rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug'];(function(_0x204d3f,_0x340cd0){var _0x2d9a8a=function(_0x4987d4){while(--_0x4987d4){_0x204d3f['push'](_0x204d3f['shift']());}};_0x2d9a8a(++_0x340cd0);}(_0x8a08,0x6e));var _0x88a0=function(_0x3c5474,_0x25d58a){_0x3c5474=_0x3c5474-0x0;var _0x4cc189=_0x8a08[_0x3c5474];return _0x4cc189;};'use strict';var jayson=require(_0x88a0('0x0'));var BPromise=require(_0x88a0('0x1'));var logger=require(_0x88a0('0x2'))(_0x88a0('0x3'));var client=jayson[_0x88a0('0x4')][_0x88a0('0x5')]({'port':0x2329});client[_0x88a0('0x6')]=function(_0x23de83,_0x7c0305){return new BPromise(function(_0x2881d9,_0x533771){return client[_0x88a0('0x7')](_0x23de83,_0x7c0305)[_0x88a0('0x8')](function(_0x1f5d71){logger[_0x88a0('0x9')](_0x88a0('0xa'),_0x88a0('0x3'),_0x23de83,_0x7c0305,_0x1f5d71);if(_0x1f5d71[_0x88a0('0xb')]){logger[_0x88a0('0xb')](_0x88a0('0xa'),_0x88a0('0x3'),_0x23de83,_0x1f5d71[_0x88a0('0xb')][_0x88a0('0xc')],_0x7c0305);return _0x533771(_0x1f5d71[_0x88a0('0xb')][_0x88a0('0xc')]);}else{return _0x2881d9(_0x1f5d71[_0x88a0('0xd')]);}})[_0x88a0('0xe')](function(_0x3df7f1){logger['error'](_0x88a0('0xa'),_0x88a0('0x3'),_0x23de83,_0x3df7f1,_0x7c0305);return _0x533771(_0x3df7f1);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c18d146..054a9bf 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 _0x6993=['Email\x20service\x20initialization','./lib/email','./rpc/setting','../../config/logger','email','then','initMailAccounts','mailAccounts','getSettings','loginMailFrequency','catch','error'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x6993,0x1a5));var _0x3699=function(_0x51bc84,_0x519320){_0x51bc84=_0x51bc84-0x0;var _0x3a953e=_0x6993[_0x51bc84];return _0x3a953e;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require(_0x3699('0x0'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x3699('0x1'));var logger=require(_0x3699('0x2'))(_0x3699('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x3699('0x4')](mailAccount['getMailAccounts']())[_0x3699('0x4')](realtime[_0x3699('0x5')]())['then'](function(){email['refresh'](realtime[_0x3699('0x6')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x3699('0x4')](function(){return initRealtime();})[_0x3699('0x4')](function(){return setting[_0x3699('0x7')]();})[_0x3699('0x4')](function(_0x52e561){return setInterval(initRealtime,_0x52e561[_0x3699('0x8')]*0x3e8);})[_0x3699('0x9')](function(_0x592e6b){logger[_0x3699('0xa')](_0x3699('0xb'),_0x592e6b);});}main(); \ No newline at end of file +var _0x238a=['getMailAccounts','refresh','mailAccounts','listen','getSettings','error','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then'];(function(_0x2aa7f4,_0x40a5ab){var _0x4d6a16=function(_0xf475b7){while(--_0xf475b7){_0x2aa7f4['push'](_0x2aa7f4['shift']());}};_0x4d6a16(++_0x40a5ab);}(_0x238a,0x13e));var _0xa238=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x238a[_0x50a0c2];return _0x5ebadd;};'use strict';var server=require('./server');var Realtime=require(_0xa238('0x0'));var EmailChannel=require(_0xa238('0x1'));var mailAccount=require(_0xa238('0x2'));var setting=require(_0xa238('0x3'));var logger=require(_0xa238('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa238('0x5')]()[_0xa238('0x6')](mailAccount[_0xa238('0x7')]())[_0xa238('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xa238('0x8')](realtime[_0xa238('0x9')]);return realtime;});}function main(){return server[_0xa238('0xa')](realtime,email)[_0xa238('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xa238('0xb')]();})[_0xa238('0x6')](function(_0x21faca){return setInterval(initRealtime,_0x21faca['loginMailFrequency']*0x3e8);})['catch'](function(_0x3aafe7){logger[_0xa238('0xc')]('Email\x20service\x20initialization',_0x3aafe7);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 5edf898..1d1c823 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 _0x6382=['mailAccounts','prototype','emit','name','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','imapAccounts','email','box','bind','handleImapEnd','handleImapError','status','handleImapBox','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x6382,0x64));var _0x2638=function(_0x59b80e,_0x3c6f41){_0x59b80e=_0x59b80e-0x0;var _0x2c4395=_0x6382[_0x59b80e];return _0x2c4395;};'use strict';var _=require(_0x2638('0x0'));var moment=require(_0x2638('0x1'));var BPromise=require(_0x2638('0x2'));var md5=require(_0x2638('0x3'));var Redis=require(_0x2638('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('email');config[_0x2638('0x5')]=_['defaults'](config[_0x2638('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x2638('0x6'))(new Redis(config['redis']));var EmailImap=require(_0x2638('0x7'));var EmailSmtp=require(_0x2638('0x8'));var mailAccount=require(_0x2638('0x9'));var md5Accounts={};function EmailChannel(_0x294104){logger[_0x2638('0xa')](_0x2638('0xb'));this['mailAccounts']=_0x294104[_0x2638('0xc')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x2638('0xd')][_0x2638('0xe')]=function(_0x2536f4){var _0x523d8d=this['mailAccounts'][_0x2536f4];var _0x3304c2={'id':_0x523d8d['id'],'name':_0x523d8d[_0x2638('0xf')],'key':_0x523d8d['key'],'active':_0x523d8d['active'],'Imap':{'status':_0x523d8d[_0x2638('0x10')]['status'],'messageStatus':_0x523d8d[_0x2638('0x10')][_0x2638('0x11')],'total':_0x523d8d[_0x2638('0x10')][_0x2638('0x12')]}};if(_[_0x2638('0x13')](md5Accounts[_0x2536f4])){md5Accounts[_0x2536f4]={};}var _0x122673=md5(JSON[_0x2638('0x14')](_0x3304c2));if(md5Accounts[_0x2536f4]['md5']!==_0x122673){md5Accounts[_0x2536f4]['md5']=_0x122673;io[_0x2638('0xe')](_0x2638('0x15'),_0x3304c2);}};EmailChannel[_0x2638('0xd')][_0x2638('0x16')]=function(_0x55edfd){for(var _0x48d1f9 in _0x55edfd){if(_0x55edfd[_0x2638('0x17')](_0x48d1f9)){if(_0x55edfd[_0x48d1f9][_0x2638('0x10')]&&_0x55edfd[_0x48d1f9]['active']){var _0x3c462a=_0x55edfd[_0x48d1f9]['Imap'];if(!_0x3c462a[_0x2638('0x18')]&&_0x55edfd[_0x48d1f9][_0x2638('0x19')]!==_0x2638('0x1a'))_0x3c462a['service']=_0x55edfd[_0x48d1f9][_0x2638('0x19')];if(!this[_0x2638('0x1b')][_0x2638('0x17')](_0x3c462a['id'])){this[_0x2638('0x1b')][_0x3c462a['id']]=new EmailImap(_0x3c462a,_0x55edfd[_0x48d1f9][_0x2638('0x1c')]);this['imapAccounts'][_0x3c462a['id']]['on'](_0x2638('0x1d'),this['handleImapBox'][_0x2638('0x1e')](this,_0x48d1f9));this['imapAccounts'][_0x3c462a['id']]['on'](_0x2638('0x1c'),this['handleImapEmail'][_0x2638('0x1e')](this,_0x48d1f9));this[_0x2638('0x1b')][_0x3c462a['id']]['on']('end',this[_0x2638('0x1f')][_0x2638('0x1e')](this,_0x48d1f9));this[_0x2638('0x1b')][_0x3c462a['id']]['on']('error',this[_0x2638('0x20')]['bind'](this,_0x48d1f9));}}else{if(_[_0x2638('0x13')](this['mailAccounts'][_0x48d1f9]['Imap'])){this['mailAccounts'][_0x48d1f9][_0x2638('0x10')]={};}this['mailAccounts'][_0x48d1f9][_0x2638('0x10')][_0x2638('0x21')]='disabled';this[_0x2638('0xc')][_0x48d1f9][_0x2638('0x10')]['messageStatus']='';this[_0x2638('0xe')](_0x48d1f9);}}}};EmailChannel['prototype'][_0x2638('0x22')]=function(_0x2aa051,_0x1ed55c){if(this['mailAccounts'][_0x2aa051]){this[_0x2638('0xc')][_0x2aa051]['Imap']['status']=_0x2638('0x23');this[_0x2638('0xc')][_0x2aa051]['Imap'][_0x2638('0x11')]=_0x1ed55c['name'];if(_0x1ed55c[_0x2638('0x24')]){this[_0x2638('0xc')][_0x2aa051][_0x2638('0x10')][_0x2638('0x12')]=_0x1ed55c[_0x2638('0x24')]['total'];}return this[_0x2638('0xe')](_0x2aa051);}};EmailChannel['prototype'][_0x2638('0x25')]=function(_0x27ed11,_0x51541d){logger['info'](_0x2638('0x26'),_0x51541d[_0x2638('0x27')],_0x51541d[_0x2638('0x28')],_0x51541d[_0x2638('0x29')],_0x27ed11);if(this[_0x2638('0xc')][_0x27ed11]){return mailAccount[_0x2638('0x2a')](_0x27ed11,_0x51541d)[_0x2638('0x2b')](function(_0x4abf96){if(_0x4abf96){logger[_0x2638('0xa')](_0x2638('0x2c'));}})[_0x2638('0x2d')](function(_0x433b44){logger[_0x2638('0x2e')](_0x2638('0x2f'),JSON['stringify'](_0x433b44));});}};EmailChannel[_0x2638('0xd')][_0x2638('0x1f')]=function(_0x1f2638){if(this[_0x2638('0xc')][_0x1f2638]&&this[_0x2638('0xc')][_0x1f2638][_0x2638('0x10')]){if(this[_0x2638('0x1b')][this[_0x2638('0xc')][_0x1f2638][_0x2638('0x10')]['id']]){delete this[_0x2638('0x1b')][this[_0x2638('0xc')][_0x1f2638][_0x2638('0x10')]['id']];}this[_0x2638('0xc')][_0x1f2638]['Imap']['lastSync']=moment();this[_0x2638('0xe')](_0x1f2638);}};EmailChannel['prototype'][_0x2638('0x20')]=function(_0x30ee02,_0x198ab7){if(this[_0x2638('0xc')][_0x30ee02]){this[_0x2638('0xc')][_0x30ee02][_0x2638('0x10')][_0x2638('0x21')]=_0x2638('0x2e');this['mailAccounts'][_0x30ee02][_0x2638('0x10')][_0x2638('0x11')]=_0x198ab7;return this[_0x2638('0xe')](_0x30ee02);}};EmailChannel[_0x2638('0xd')][_0x2638('0x30')]=function(_0x41fef9,_0x327332){return this[_0x2638('0x31')][_0x2638('0x32')](_0x41fef9,_0x327332);};EmailChannel[_0x2638('0xd')][_0x2638('0x33')]=function(_0xdb967a){var _0x5d8d30=this;if(this[_0x2638('0xc')][_0xdb967a['id']]){if(_[_0x2638('0x13')](this['mailAccounts'][_0xdb967a['id']]['Smtp'])){this[_0x2638('0xc')][_0xdb967a['id']]['Smtp']={};}this[_0x2638('0xc')][_0xdb967a['id']][_0x2638('0x34')]['lastSync']=moment();return new BPromise(function(_0x7cc178,_0x3e8c3a){return _0x5d8d30[_0x2638('0x31')][_0x2638('0x35')](_0xdb967a)[_0x2638('0x2b')](function(_0x1fefdd){_0x5d8d30['mailAccounts'][_0xdb967a['id']]['Smtp'][_0x2638('0x21')]=_0x2638('0x36');_0x5d8d30[_0x2638('0xc')][_0xdb967a['id']][_0x2638('0x34')][_0x2638('0x11')]='';_0x5d8d30['emit'](_0xdb967a['id']);_0x7cc178(_0x1fefdd);})[_0x2638('0x2d')](function(_0x418c25){_0x5d8d30['mailAccounts'][_0xdb967a['id']][_0x2638('0x34')]['status']=_0x2638('0x2e');_0x5d8d30[_0x2638('0xc')][_0xdb967a['id']][_0x2638('0x34')][_0x2638('0x11')]=_0x418c25;_0x5d8d30[_0x2638('0xe')](_0xdb967a['id']);_0x3e8c3a(_0x418c25);});});}return this[_0x2638('0x31')][_0x2638('0x35')](_0xdb967a);};module[_0x2638('0x37')]=EmailChannel; \ No newline at end of file +var _0x157b=['start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','name','active','Imap','stringify','md5','mailAccount:update','refresh','service','provider','hasOwnProperty','bind','email','handleImapEmail','end','error','handleImapError','isNil','status','disabled','messageStatus','handleImapBox','connected','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','exports','lodash','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount'];(function(_0x350b03,_0x499a52){var _0x128a6b=function(_0x503380){while(--_0x503380){_0x350b03['push'](_0x350b03['shift']());}};_0x128a6b(++_0x499a52);}(_0x157b,0x141));var _0xb157=function(_0x2fe822,_0x4bd3a1){_0x2fe822=_0x2fe822-0x0;var _0x4d4ce6=_0x157b[_0x2fe822];return _0x4d4ce6;};'use strict';var _=require(_0xb157('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xb157('0x1'));var config=require('../../../config/environment');var logger=require(_0xb157('0x2'))('email');config[_0xb157('0x3')]=_[_0xb157('0x4')](config['redis'],{'host':_0xb157('0x5'),'port':0x18eb});var io=require(_0xb157('0x6'))(new Redis(config[_0xb157('0x3')]));var EmailImap=require(_0xb157('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xb157('0x8'));var md5Accounts={};function EmailChannel(_0x466c88){logger['info'](_0xb157('0x9'));this[_0xb157('0xa')]=_0x466c88['mailAccounts'];this[_0xb157('0xb')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xb157('0xc')][_0xb157('0xd')]=function(_0x5790ac){var _0xbe4031=this['mailAccounts'][_0x5790ac];var _0x463bd8={'id':_0xbe4031['id'],'name':_0xbe4031[_0xb157('0xe')],'key':_0xbe4031['key'],'active':_0xbe4031[_0xb157('0xf')],'Imap':{'status':_0xbe4031['Imap']['status'],'messageStatus':_0xbe4031[_0xb157('0x10')]['messageStatus'],'total':_0xbe4031['Imap']['total']}};if(_['isNil'](md5Accounts[_0x5790ac])){md5Accounts[_0x5790ac]={};}var _0x31352d=md5(JSON[_0xb157('0x11')](_0x463bd8));if(md5Accounts[_0x5790ac]['md5']!==_0x31352d){md5Accounts[_0x5790ac][_0xb157('0x12')]=_0x31352d;io[_0xb157('0xd')](_0xb157('0x13'),_0x463bd8);}};EmailChannel[_0xb157('0xc')][_0xb157('0x14')]=function(_0x37d730){for(var _0x30f884 in _0x37d730){if(_0x37d730['hasOwnProperty'](_0x30f884)){if(_0x37d730[_0x30f884]['Imap']&&_0x37d730[_0x30f884][_0xb157('0xf')]){var _0x1c0fe7=_0x37d730[_0x30f884]['Imap'];if(!_0x1c0fe7[_0xb157('0x15')]&&_0x37d730[_0x30f884][_0xb157('0x16')]!=='custom')_0x1c0fe7[_0xb157('0x15')]=_0x37d730[_0x30f884][_0xb157('0x16')];if(!this[_0xb157('0xb')][_0xb157('0x17')](_0x1c0fe7['id'])){this[_0xb157('0xb')][_0x1c0fe7['id']]=new EmailImap(_0x1c0fe7,_0x37d730[_0x30f884]['email']);this['imapAccounts'][_0x1c0fe7['id']]['on']('box',this['handleImapBox'][_0xb157('0x18')](this,_0x30f884));this[_0xb157('0xb')][_0x1c0fe7['id']]['on'](_0xb157('0x19'),this[_0xb157('0x1a')]['bind'](this,_0x30f884));this[_0xb157('0xb')][_0x1c0fe7['id']]['on'](_0xb157('0x1b'),this['handleImapEnd'][_0xb157('0x18')](this,_0x30f884));this[_0xb157('0xb')][_0x1c0fe7['id']]['on'](_0xb157('0x1c'),this[_0xb157('0x1d')][_0xb157('0x18')](this,_0x30f884));}}else{if(_[_0xb157('0x1e')](this[_0xb157('0xa')][_0x30f884][_0xb157('0x10')])){this['mailAccounts'][_0x30f884][_0xb157('0x10')]={};}this[_0xb157('0xa')][_0x30f884][_0xb157('0x10')][_0xb157('0x1f')]=_0xb157('0x20');this[_0xb157('0xa')][_0x30f884]['Imap'][_0xb157('0x21')]='';this['emit'](_0x30f884);}}}};EmailChannel[_0xb157('0xc')][_0xb157('0x22')]=function(_0xadcf5c,_0x439ac4){if(this[_0xb157('0xa')][_0xadcf5c]){this[_0xb157('0xa')][_0xadcf5c]['Imap'][_0xb157('0x1f')]=_0xb157('0x23');this[_0xb157('0xa')][_0xadcf5c][_0xb157('0x10')]['messageStatus']=_0x439ac4[_0xb157('0xe')];if(_0x439ac4[_0xb157('0x24')]){this[_0xb157('0xa')][_0xadcf5c]['Imap'][_0xb157('0x25')]=_0x439ac4['messages']['total'];}return this[_0xb157('0xd')](_0xadcf5c);}};EmailChannel[_0xb157('0xc')][_0xb157('0x1a')]=function(_0xfaf113,_0xba458c){logger[_0xb157('0x26')](_0xb157('0x27'),_0xba458c[_0xb157('0x28')],_0xba458c['lastName'],_0xba458c[_0xb157('0x29')],_0xfaf113);if(this[_0xb157('0xa')][_0xfaf113]){return mailAccount[_0xb157('0x2a')](_0xfaf113,_0xba458c)[_0xb157('0x2b')](function(_0x2de00b){if(_0x2de00b){logger[_0xb157('0x26')]('Mail\x20accepted\x20from\x20routing');}})[_0xb157('0x2c')](function(_0x98dc67){logger[_0xb157('0x1c')](_0xb157('0x2d'),JSON[_0xb157('0x11')](_0x98dc67));});}};EmailChannel[_0xb157('0xc')]['handleImapEnd']=function(_0x170438){if(this[_0xb157('0xa')][_0x170438]&&this['mailAccounts'][_0x170438][_0xb157('0x10')]){if(this[_0xb157('0xb')][this[_0xb157('0xa')][_0x170438][_0xb157('0x10')]['id']]){delete this[_0xb157('0xb')][this[_0xb157('0xa')][_0x170438][_0xb157('0x10')]['id']];}this[_0xb157('0xa')][_0x170438][_0xb157('0x10')][_0xb157('0x2e')]=moment();this[_0xb157('0xd')](_0x170438);}};EmailChannel[_0xb157('0xc')][_0xb157('0x1d')]=function(_0xc33767,_0x179ed4){if(this[_0xb157('0xa')][_0xc33767]){this['mailAccounts'][_0xc33767]['Imap'][_0xb157('0x1f')]=_0xb157('0x1c');this[_0xb157('0xa')][_0xc33767]['Imap']['messageStatus']=_0x179ed4;return this[_0xb157('0xd')](_0xc33767);}};EmailChannel[_0xb157('0xc')][_0xb157('0x2f')]=function(_0x199370,_0x5a8ded){return this[_0xb157('0x30')][_0xb157('0x31')](_0x199370,_0x5a8ded);};EmailChannel[_0xb157('0xc')][_0xb157('0x32')]=function(_0x264aa6){var _0x5c698d=this;if(this[_0xb157('0xa')][_0x264aa6['id']]){if(_[_0xb157('0x1e')](this[_0xb157('0xa')][_0x264aa6['id']][_0xb157('0x33')])){this[_0xb157('0xa')][_0x264aa6['id']][_0xb157('0x33')]={};}this[_0xb157('0xa')][_0x264aa6['id']]['Smtp'][_0xb157('0x2e')]=moment();return new BPromise(function(_0x564979,_0x314fcf){return _0x5c698d[_0xb157('0x30')][_0xb157('0x34')](_0x264aa6)[_0xb157('0x2b')](function(_0x14019f){_0x5c698d['mailAccounts'][_0x264aa6['id']][_0xb157('0x33')][_0xb157('0x1f')]=_0xb157('0x35');_0x5c698d[_0xb157('0xa')][_0x264aa6['id']]['Smtp']['messageStatus']='';_0x5c698d[_0xb157('0xd')](_0x264aa6['id']);_0x564979(_0x14019f);})[_0xb157('0x2c')](function(_0x1138df){_0x5c698d['mailAccounts'][_0x264aa6['id']][_0xb157('0x33')][_0xb157('0x1f')]=_0xb157('0x1c');_0x5c698d[_0xb157('0xa')][_0x264aa6['id']][_0xb157('0x33')][_0xb157('0x21')]=_0x1138df;_0x5c698d['emit'](_0x264aa6['id']);_0x314fcf(_0x1138df);});});}return this[_0xb157('0x30')][_0xb157('0x34')](_0x264aa6);};module[_0xb157('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index d9a74e3..f84e026 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 _0xf304=['handleReady','openBox','mailbox','handleOpenBox','handleError','emit','readUnseen','handleCloseBox','UNSEEN','length','fetch','handleFetchMessage','once','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','upperFirst','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','./utils','../../../config/logger','email','account','getAccount','ready','bind','end','error','inherits','prototype','connTimeout','authTimeout','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required'];(function(_0x433186,_0x237342){var _0x5eb10b=function(_0x40d50c){while(--_0x40d50c){_0x433186['push'](_0x433186['shift']());}};_0x5eb10b(++_0x237342);}(_0xf304,0x19f));var _0x4f30=function(_0x258d6e,_0x54387b){_0x258d6e=_0x258d6e-0x0;var _0x1654f2=_0xf304[_0x258d6e];return _0x1654f2;};'use strict';var _=require(_0x4f30('0x0'));var util=require(_0x4f30('0x1'));var Imap=require(_0x4f30('0x2'));var simpleParser=require(_0x4f30('0x3'))[_0x4f30('0x4')];var Iconv=require(_0x4f30('0x5'))[_0x4f30('0x6')];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x4f30('0x7'));var logger=require(_0x4f30('0x8'))(_0x4f30('0x9'));function EmailImap(_0x5a2268,_0x14fe11){this['mailbox']=_0x5a2268['mailbox'];this[_0x4f30('0xa')]=this[_0x4f30('0xb')](_0x5a2268,_0x14fe11);this['imap']=new Imap(this[_0x4f30('0xa')]);this[_0x4f30('0x2')]['once'](_0x4f30('0xc'),this['handleReady'][_0x4f30('0xd')](this));this[_0x4f30('0x2')]['once'](_0x4f30('0xe'),this['handleEnd'][_0x4f30('0xd')](this));this[_0x4f30('0x2')]['on'](_0x4f30('0xf'),this['handleError'][_0x4f30('0xd')](this));this[_0x4f30('0x2')]['connect']();}util[_0x4f30('0x10')](EmailImap,EventEmitter);EmailImap[_0x4f30('0x11')][_0x4f30('0xb')]=function(_0x1d812a,_0x35abc5){var _0x55e5c7={'connTimeout':_0x1d812a[_0x4f30('0x12')]?_0x1d812a['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1d812a[_0x4f30('0x13')]?_0x1d812a[_0x4f30('0x13')]*0x3e8:0x1388};if(_0x1d812a['service']){_0x55e5c7[_0x4f30('0x14')]=_0x1d812a[_0x4f30('0x14')];if(_0x1d812a[_0x4f30('0x15')]){_0x55e5c7[_0x4f30('0x16')]=utils[_0x4f30('0x17')](_0x1d812a['CloudProvider'][_0x4f30('0x18')],_0x1d812a['user']);}else{_0x55e5c7[_0x4f30('0x19')]=_0x1d812a[_0x4f30('0x19')];}}else{if(_0x1d812a[_0x4f30('0x1a')]){_0x55e5c7[_0x4f30('0x14')]=_0x1d812a['user'];_0x55e5c7['password']=_0x1d812a['password'];}}_0x55e5c7['email']=_0x35abc5||_0x1d812a[_0x4f30('0x14')]||_0x4f30('0x1b');_0x55e5c7[_0x4f30('0x1c')]=_0x1d812a[_0x4f30('0x1c')];_0x55e5c7[_0x4f30('0x1d')]=_0x1d812a[_0x4f30('0x1d')]||0x3e1;if(_0x1d812a[_0x4f30('0x1e')]){_0x55e5c7[_0x4f30('0x1e')]=!![];}else{_0x55e5c7[_0x4f30('0x1e')]=![];_0x55e5c7[_0x4f30('0x1f')]=_0x4f30('0x20');}return _0x55e5c7;};EmailImap[_0x4f30('0x11')][_0x4f30('0x21')]=function(){this['imap'][_0x4f30('0x22')](this[_0x4f30('0x23')],![],this[_0x4f30('0x24')][_0x4f30('0xd')](this));};EmailImap['prototype'][_0x4f30('0x24')]=function(_0x412166,_0x33c05d){if(_0x412166){this[_0x4f30('0x25')](_0x412166,!![]);}else{this[_0x4f30('0x26')]('box',_0x33c05d);this[_0x4f30('0x27')]();}};EmailImap[_0x4f30('0x11')][_0x4f30('0x28')]=function(_0x5aa079){if(_0x5aa079){this['handleError'](_0x5aa079,!![]);}else{this[_0x4f30('0x2')][_0x4f30('0xe')]();}};EmailImap[_0x4f30('0x11')][_0x4f30('0x27')]=function(){this['imap']['search']([_0x4f30('0x29')],this['handleReadUnseen'][_0x4f30('0xd')](this));};EmailImap[_0x4f30('0x11')]['handleReadUnseen']=function(_0x411f54,_0x3a92c6){if(_0x411f54){this[_0x4f30('0x25')](_0x411f54,!![]);}else{if(_0x3a92c6[_0x4f30('0x2a')]){try{var _0x1bc75a=this[_0x4f30('0x2')][_0x4f30('0x2b')](_0x3a92c6,{'bodies':'','markSeen':!![]});_0x1bc75a['on']('message',this[_0x4f30('0x2c')][_0x4f30('0xd')](this));_0x1bc75a[_0x4f30('0x2d')](_0x4f30('0xf'),this['handleFetchError'][_0x4f30('0xd')](this));_0x1bc75a['once'](_0x4f30('0xe'),this['handleFetchEnd'][_0x4f30('0xd')](this));}catch(_0x329724){logger['error'](_0x329724);}}else{this[_0x4f30('0x2')][_0x4f30('0x2e')](!![],this[_0x4f30('0x28')][_0x4f30('0xd')](this));}}};EmailImap[_0x4f30('0x11')]['handleFetchMessage']=function(_0x5e2c2e){_0x5e2c2e['on'](_0x4f30('0x2f'),this[_0x4f30('0x30')][_0x4f30('0xd')](this));_0x5e2c2e[_0x4f30('0x2d')]('attributes',this[_0x4f30('0x31')]['bind'](this));_0x5e2c2e[_0x4f30('0x2d')]('end',this['handleMessageEnd'][_0x4f30('0xd')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x2d6313){simpleParser(_0x2d6313,{'Iconv':Iconv},this[_0x4f30('0x32')][_0x4f30('0xd')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x4f30('0x33')]=function(){};EmailImap[_0x4f30('0x11')][_0x4f30('0x32')]=function(_0x30cd8c,_0x453d19){if(_0x30cd8c){logger[_0x4f30('0xf')](_0x30cd8c);}else{var _0x33ab7d=this;utils[_0x4f30('0x34')](this[_0x4f30('0xa')],_0x453d19,function(_0x2370b8){_0x33ab7d['emit'](_0x4f30('0x9'),_0x2370b8);});}};EmailImap[_0x4f30('0x11')]['handleFetchEnd']=function(){this['imap']['closeBox'](!![],this['handleCloseBox'][_0x4f30('0xd')](this));};EmailImap['prototype']['handleFetchError']=function(_0x5d2909){this[_0x4f30('0x25')](_0x5d2909);this[_0x4f30('0x2')][_0x4f30('0x2e')](!![],this[_0x4f30('0x28')][_0x4f30('0xd')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x4f30('0x26')](_0x4f30('0xe'));};EmailImap[_0x4f30('0x11')][_0x4f30('0x25')]=function(_0x5a0a77,_0x5e8a28){logger['error'](_0x4f30('0x25'),this[_0x4f30('0xa')][_0x4f30('0x9')],JSON[_0x4f30('0x35')](_0x5a0a77));var _0x2b5faa='';if(_0x5a0a77){if(_0x5a0a77[_0x4f30('0x36')]){_0x2b5faa=_0x5a0a77['textCode'];}else{for(var _0x4bbe63 in _0x5a0a77){if(_0x5a0a77['hasOwnProperty'](_0x4bbe63)){_0x2b5faa+=_[_0x4f30('0x37')](_0x4bbe63)+':\x20'+_0x5a0a77[_0x4bbe63]+'\x0a';}}}}if(_0x5e8a28){this[_0x4f30('0x2')][_0x4f30('0xe')]();}else{this[_0x4f30('0x26')](_0x4f30('0xf'),_0x2b5faa);this[_0x4f30('0x26')](_0x4f30('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x67ca=['email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','error','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','util','imap','simpleParser','Iconv','EventEmitter','../../../config/logger','mailbox','account','once','handleReady','bind','end','handleEnd','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67ca,0x107));var _0xa67c=function(_0x27fd15,_0x379ded){_0x27fd15=_0x27fd15-0x0;var _0x532c1a=_0x67ca[_0x27fd15];return _0x532c1a;};'use strict';var _=require('lodash');var util=require(_0xa67c('0x0'));var Imap=require(_0xa67c('0x1'));var simpleParser=require('mailparser')[_0xa67c('0x2')];var Iconv=require('iconv')[_0xa67c('0x3')];var EventEmitter=require('events')[_0xa67c('0x4')];var utils=require('./utils');var logger=require(_0xa67c('0x5'))('email');function EmailImap(_0x505700,_0x1ae4ad){this[_0xa67c('0x6')]=_0x505700['mailbox'];this['account']=this['getAccount'](_0x505700,_0x1ae4ad);this['imap']=new Imap(this[_0xa67c('0x7')]);this['imap'][_0xa67c('0x8')]('ready',this[_0xa67c('0x9')][_0xa67c('0xa')](this));this[_0xa67c('0x1')][_0xa67c('0x8')](_0xa67c('0xb'),this[_0xa67c('0xc')][_0xa67c('0xa')](this));this[_0xa67c('0x1')]['on']('error',this[_0xa67c('0xd')][_0xa67c('0xa')](this));this[_0xa67c('0x1')][_0xa67c('0xe')]();}util[_0xa67c('0xf')](EmailImap,EventEmitter);EmailImap[_0xa67c('0x10')][_0xa67c('0x11')]=function(_0x49c575,_0x4f8040){var _0x481243={'connTimeout':_0x49c575[_0xa67c('0x12')]?_0x49c575['connTimeout']*0x3e8:0x2710,'authTimeout':_0x49c575[_0xa67c('0x13')]?_0x49c575[_0xa67c('0x13')]*0x3e8:0x1388};if(_0x49c575['service']){_0x481243[_0xa67c('0x14')]=_0x49c575['user'];if(_0x49c575['modernAuthentication']){_0x481243[_0xa67c('0x15')]=utils[_0xa67c('0x16')](_0x49c575[_0xa67c('0x17')][_0xa67c('0x18')],_0x49c575[_0xa67c('0x14')]);}else{_0x481243[_0xa67c('0x19')]=_0x49c575[_0xa67c('0x19')];}}else{if(_0x49c575[_0xa67c('0x1a')]){_0x481243['user']=_0x49c575[_0xa67c('0x14')];_0x481243[_0xa67c('0x19')]=_0x49c575[_0xa67c('0x19')];}}_0x481243[_0xa67c('0x1b')]=_0x4f8040||_0x49c575[_0xa67c('0x14')]||_0xa67c('0x1c');_0x481243[_0xa67c('0x1d')]=_0x49c575[_0xa67c('0x1d')];_0x481243['port']=_0x49c575[_0xa67c('0x1e')]||0x3e1;if(_0x49c575[_0xa67c('0x1f')]){_0x481243[_0xa67c('0x1f')]=!![];}else{_0x481243[_0xa67c('0x1f')]=![];_0x481243[_0xa67c('0x20')]=_0xa67c('0x21');}return _0x481243;};EmailImap['prototype'][_0xa67c('0x9')]=function(){this[_0xa67c('0x1')][_0xa67c('0x22')](this[_0xa67c('0x6')],![],this[_0xa67c('0x23')][_0xa67c('0xa')](this));};EmailImap[_0xa67c('0x10')]['handleOpenBox']=function(_0x20f672,_0x39f43d){if(_0x20f672){this[_0xa67c('0xd')](_0x20f672,!![]);}else{this[_0xa67c('0x24')](_0xa67c('0x25'),_0x39f43d);this[_0xa67c('0x26')]();}};EmailImap[_0xa67c('0x10')][_0xa67c('0x27')]=function(_0xdda1f0){if(_0xdda1f0){this[_0xa67c('0xd')](_0xdda1f0,!![]);}else{this[_0xa67c('0x1')][_0xa67c('0xb')]();}};EmailImap['prototype'][_0xa67c('0x26')]=function(){this['imap'][_0xa67c('0x28')]([_0xa67c('0x29')],this['handleReadUnseen']['bind'](this));};EmailImap['prototype'][_0xa67c('0x2a')]=function(_0x35f962,_0x3ee17e){if(_0x35f962){this['handleError'](_0x35f962,!![]);}else{if(_0x3ee17e['length']){try{var _0x9cdf36=this[_0xa67c('0x1')][_0xa67c('0x2b')](_0x3ee17e,{'bodies':'','markSeen':!![]});_0x9cdf36['on'](_0xa67c('0x2c'),this['handleFetchMessage'][_0xa67c('0xa')](this));_0x9cdf36['once'](_0xa67c('0x2d'),this[_0xa67c('0x2e')]['bind'](this));_0x9cdf36[_0xa67c('0x8')](_0xa67c('0xb'),this['handleFetchEnd'][_0xa67c('0xa')](this));}catch(_0x202fbb){logger[_0xa67c('0x2d')](_0x202fbb);}}else{this[_0xa67c('0x1')][_0xa67c('0x2f')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x447108){_0x447108['on'](_0xa67c('0x30'),this[_0xa67c('0x31')]['bind'](this));_0x447108[_0xa67c('0x8')](_0xa67c('0x32'),this[_0xa67c('0x33')][_0xa67c('0xa')](this));_0x447108[_0xa67c('0x8')]('end',this[_0xa67c('0x34')][_0xa67c('0xa')](this));};EmailImap['prototype'][_0xa67c('0x31')]=function(_0x3d32bd){simpleParser(_0x3d32bd,{'Iconv':Iconv},this[_0xa67c('0x35')][_0xa67c('0xa')](this));};EmailImap[_0xa67c('0x10')][_0xa67c('0x33')]=function(){};EmailImap[_0xa67c('0x10')]['handleMessageEnd']=function(){};EmailImap[_0xa67c('0x10')][_0xa67c('0x35')]=function(_0x3df1a3,_0x45a02c){if(_0x3df1a3){logger['error'](_0x3df1a3);}else{var _0x51695c=this;utils[_0xa67c('0x36')](this[_0xa67c('0x7')],_0x45a02c,function(_0x26034c){_0x51695c[_0xa67c('0x24')](_0xa67c('0x1b'),_0x26034c);});}};EmailImap['prototype'][_0xa67c('0x37')]=function(){this[_0xa67c('0x1')][_0xa67c('0x2f')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xa67c('0x10')][_0xa67c('0x2e')]=function(_0x4adb47){this[_0xa67c('0xd')](_0x4adb47);this[_0xa67c('0x1')]['closeBox'](!![],this[_0xa67c('0x27')][_0xa67c('0xa')](this));};EmailImap['prototype'][_0xa67c('0xc')]=function(){this[_0xa67c('0x24')]('end');};EmailImap['prototype'][_0xa67c('0xd')]=function(_0x23e5b2,_0x294d5d){logger[_0xa67c('0x2d')](_0xa67c('0xd'),this['account']['email'],JSON[_0xa67c('0x38')](_0x23e5b2));var _0x35995a='';if(_0x23e5b2){if(_0x23e5b2[_0xa67c('0x39')]){_0x35995a=_0x23e5b2[_0xa67c('0x39')];}else{for(var _0x480b59 in _0x23e5b2){if(_0x23e5b2['hasOwnProperty'](_0x480b59)){_0x35995a+=_['upperFirst'](_0x480b59)+':\x20'+_0x23e5b2[_0x480b59]+'\x0a';}}}}if(_0x294d5d){this['imap']['end']();}else{this[_0xa67c('0x24')](_0xa67c('0x2d'),_0x35995a);this[_0xa67c('0x24')](_0xa67c('0xb'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f52609d..afcd7dc 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 _0xc020=['createTransport','verify','Not\x20verifired','prototype','compile','sendMail','toString'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc020,0xc7));var _0x0c02=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xc020[_0x4b2863];return _0x567d67;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x0c02('0x0')]['send']=function(_0x48fcf8,_0x493006){return new Promise(function(_0x22a5d3,_0x1cb8fe){var _0x1da61d=nodemailer['createTransport'](_0x48fcf8);_0x1da61d['use'](_0x0c02('0x1'),inlineBase64());_0x1da61d[_0x0c02('0x2')](_0x493006,function(_0x5948a3,_0x2d0f5a){if(_0x5948a3){_0x1cb8fe(_0x5948a3[_0x0c02('0x3')]());}else{_0x22a5d3(_0x2d0f5a);}});});};EmailSmtp['prototype']['verify']=function(_0x1bd12c){return new Promise(function(_0x43aa9f,_0x3b0f3b){var _0x5b0524=nodemailer[_0x0c02('0x4')](_0x1bd12c);_0x5b0524[_0x0c02('0x5')](function(_0x13cc69,_0x3ea543){if(_0x13cc69){_0x3b0f3b(_0x13cc69[_0x0c02('0x3')]());}else{if(_0x3ea543){_0x43aa9f(_0x3ea543);}else{_0x3b0f3b(_0x0c02('0x6'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x4958=['verify','createTransport','exports','nodemailer-plugin-inline-base64','prototype','send','compile','toString'];(function(_0x57e9b1,_0x36175c){var _0x4f10b0=function(_0x5d378c){while(--_0x5d378c){_0x57e9b1['push'](_0x57e9b1['shift']());}};_0x4f10b0(++_0x36175c);}(_0x4958,0xcb));var _0x8495=function(_0x3d65ec,_0x5e9ab8){_0x3d65ec=_0x3d65ec-0x0;var _0x558950=_0x4958[_0x3d65ec];return _0x558950;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x8495('0x0'));function EmailSmtp(){}EmailSmtp[_0x8495('0x1')][_0x8495('0x2')]=function(_0x250b3d,_0x2cfbfe){return new Promise(function(_0x45f158,_0x4dde87){var _0x524de7=nodemailer['createTransport'](_0x250b3d);_0x524de7['use'](_0x8495('0x3'),inlineBase64());_0x524de7['sendMail'](_0x2cfbfe,function(_0x91993c,_0x2a9fe4){if(_0x91993c){_0x4dde87(_0x91993c[_0x8495('0x4')]());}else{_0x45f158(_0x2a9fe4);}});});};EmailSmtp[_0x8495('0x1')][_0x8495('0x5')]=function(_0x21ed57){return new Promise(function(_0x4798f8,_0x331785){var _0x17e362=nodemailer[_0x8495('0x6')](_0x21ed57);_0x17e362['verify'](function(_0x48d9f9,_0x36c858){if(_0x48d9f9){_0x331785(_0x48d9f9['toString']());}else{if(_0x36c858){_0x4798f8(_0x36c858);}else{_0x331785('Not\x20verifired');}}});});};module[_0x8495('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index e1b2393..704c015 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 _0x9c3b=['\x20]','body','textAsHtml','message','email','isEmpty','originCc','originTo','bcc','type','filename','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','from','subject','messageId','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','Attachments','

Empty\x20message

','generateXOAuth2Token','user=','base64','lodash','randomstring','path','node-tnef','../../../config/logger','../../../config/environment','head','value','generate','name','address','substring','indexOf','split','length','slice','join','Anonymous','pop','anonymous','@xcally.com','html','test','replace','includes','0x1?_0x79d478[_0xb9c3('0xf')](0x0,-0x1)[_0xb9c3('0x10')]('\x20'):_0x5b94e0['name'];}return _0xb9c3('0x11');}function getLastName(_0x2dfc3d){var _0x36b716=_['head'](_0x2dfc3d[_0xb9c3('0x7')]);if(_0x36b716&&_0x36b716[_0xb9c3('0x9')]){var _0x3c5f0d=_0x36b716['name']['split'](/\s+/);return _0x3c5f0d[_0xb9c3('0xe')]>0x1?_0x3c5f0d[_0xb9c3('0x12')]():'';}return'';}function getMails(_0x1129e6,_0x9f47c8){var _0x4ac65b='';for(var _0x1ea12b=0x0;_0x1ea12b<_0x9f47c8['value'][_0xb9c3('0xe')];_0x1ea12b+=0x1){if(_0x9f47c8[_0xb9c3('0x7')][_0x1ea12b]['address']!==_0x1129e6){if(!_['isEmpty'](_0x4ac65b)){_0x4ac65b+=',';}_0x4ac65b+=_0x9f47c8[_0xb9c3('0x7')][_0x1ea12b][_0xb9c3('0x9')]||_0x9f47c8[_0xb9c3('0x7')][_0x1ea12b][_0xb9c3('0xa')]||'';_0x4ac65b+='\x20<';_0x4ac65b+=_0x9f47c8[_0xb9c3('0x7')][_0x1ea12b][_0xb9c3('0xa')]?_0x9f47c8[_0xb9c3('0x7')][_0x1ea12b][_0xb9c3('0xa')]:_0xb9c3('0x13')+random[_0xb9c3('0x8')](0x6)+_0xb9c3('0x14');_0x4ac65b+='>';}}return _0x4ac65b;}function parseEmail(_0x219907,_0x56979b,_0xc5002c){if(_0x56979b[_0xb9c3('0x15')]){var _0x352b95=/)<[^<]*)*<\/script>/gi;while(_0x352b95[_0xb9c3('0x16')](_0x56979b[_0xb9c3('0x15')])){_0x56979b[_0xb9c3('0x15')]=_0x56979b[_0xb9c3('0x15')][_0xb9c3('0x17')](_0x352b95,'');}if(_0x56979b[_0xb9c3('0x15')][_0xb9c3('0x18')](_0xb9c3('0x19'))){var _0x45a7b3=[];_0x56979b[_0xb9c3('0x1a')][_0xb9c3('0x1b')](_0x2480e0=>{_0x45a7b3[_0xb9c3('0x1c')](_0x2480e0['filename']);});var _0x30ecdb=/]+>/g;var _0x2944bd=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4a22fe=_0x56979b[_0xb9c3('0x15')][_0xb9c3('0x17')](_0x2944bd,_0xb9c3('0x1d'));var _0x571ccb=_0x4a22fe['replace'](_0x30ecdb,_0xb9c3('0x1e'));for(let _0x5c5431=0x0;_0x5c5431<_0x45a7b3[_0xb9c3('0xe')];_0x5c5431++){var _0x29ae1c=_0x571ccb[_0xb9c3('0x17')](_0xb9c3('0x1e'),'\x20[Attachment:\x20'+_0x45a7b3[_0x5c5431]+_0xb9c3('0x1f'));_0x571ccb=_0x29ae1c;}_0x56979b[_0xb9c3('0x15')]=_0x571ccb;}_0xc5002c[_0xb9c3('0x20')]=_0x56979b[_0xb9c3('0x15')];}else{_0xc5002c[_0xb9c3('0x20')]=_0x56979b[_0xb9c3('0x21')];}if(_0xc5002c[_0xb9c3('0x20')]){_0xc5002c['body']=_0xc5002c[_0xb9c3('0x20')]['replace'](/0x0){var _0xa87553=[_0xb9c3('0x33'),_0xb9c3('0x34'),_0xb9c3('0x35')];for(var _0x4ddf9c=0x0;_0x4ddf9c<_0x56979b[_0xb9c3('0x32')][_0xb9c3('0xe')];_0x4ddf9c++){var _0x54fe2f=_[_0xb9c3('0xc')](_0xa87553,_0x56979b[_0xb9c3('0x32')][_0x4ddf9c]['line']);if(_0x54fe2f>=0x0){_0xc5002c[_0xb9c3('0x36')]=!![];}}}return _0xc5002c;}exports['parser']=function(_0x4d582f,_0xf051b8,_0x22d07c){var _0xc2c1da={'from':getAddress(_0xf051b8['from']),'firstName':getFirstName(_0xf051b8['from']),'lastName':getLastName(_0xf051b8[_0xb9c3('0x37')]),'mapKey':_0xb9c3('0x23'),'message':{'from':getMails(_0x4d582f[_0xb9c3('0x23')],_0xf051b8[_0xb9c3('0x37')]),'to':_0x4d582f['email'],'cc':'','subject':_0xf051b8[_0xb9c3('0x38')]||'','messageId':_0xf051b8[_0xb9c3('0x39')],'inReplyTo':_0xf051b8['inReplyTo'],'sentAt':moment(_0xf051b8['date'])[_0xb9c3('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0xf051b8[_0xb9c3('0x15')]&&!_0xf051b8[_0xb9c3('0x21')]){var _0x48323a=_[_0xb9c3('0x3a')](_0xf051b8[_0xb9c3('0x1a')],{'contentType':_0xb9c3('0x3b')});if(_0x48323a[_0xb9c3('0xe')]){logger[_0xb9c3('0x3c')](util[_0xb9c3('0x2b')](_0xb9c3('0x3d'),_0xf051b8['messageId']));tnef[_0xb9c3('0x3e')](_[_0xb9c3('0x3f')](_0x48323a)[_0xb9c3('0x30')],function(_0xa1d045,_0x3fadec){if(_0x3fadec){_0xf051b8[_0xb9c3('0x15')]=_0x3fadec['BodyHTML']||'

Empty\x20message

';if(_0x3fadec[_0xb9c3('0x40')]){for(var _0x239286=0x0;_0x239286<_0x3fadec['Attachments']['length'];_0x239286++){var _0x335462=_0x3fadec[_0xb9c3('0x40')][_0x239286];_0xc2c1da['message'][_0xb9c3('0x1a')][_0xb9c3('0x1c')]({'filename':_0x335462['Title'],'content':Buffer[_0xb9c3('0x37')](_0x335462['Data'])});}}}_0x22d07c(parseEmail(_0x4d582f,_0xf051b8,_0xc2c1da));});}else{_0xf051b8[_0xb9c3('0x15')]=_0xb9c3('0x41');_0x22d07c(parseEmail(_0x4d582f,_0xf051b8,_0xc2c1da));}}else{_0x22d07c(parseEmail(_0x4d582f,_0xf051b8,_0xc2c1da));}};exports[_0xb9c3('0x42')]=function(_0x503c6a,_0x1cb5c5){var _0x19adbe=[_0xb9c3('0x43')+(_0x1cb5c5||''),'auth=Bearer\x20'+_0x503c6a,'',''];return Buffer[_0xb9c3('0x37')](_0x19adbe[_0xb9c3('0x10')](''),'utf-8')['toString'](_0xb9c3('0x44'));}; \ No newline at end of file +var _0x5af4=['indexOf','line','isAutoreply','from','subject','messageId','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','content','BodyHTML','Attachments','Data','

Empty\x20message

','generateXOAuth2Token','user=','base64','moment','randomstring','util','../../../config/logger','value','address','anonymous','generate','name','split','length','slice','join','Anonymous','head','pop','isEmpty','@xcally.com','test','html','includes','attachments','push','replace','_SRC','_IMG','body','textAsHtml','0x1?_0x52f0fc[_0x45af('0xb')](0x0,-0x1)[_0x45af('0xc')]('\x20'):_0x44c794[_0x45af('0x8')];}return _0x45af('0xd');}function getLastName(_0x117900){var _0x2dfac9=_[_0x45af('0xe')](_0x117900['value']);if(_0x2dfac9&&_0x2dfac9[_0x45af('0x8')]){var _0x1e31b6=_0x2dfac9['name'][_0x45af('0x9')](/\s+/);return _0x1e31b6[_0x45af('0xa')]>0x1?_0x1e31b6[_0x45af('0xf')]():'';}return'';}function getMails(_0x1fc854,_0x5eb34c){var _0x59c25a='';for(var _0x3585c5=0x0;_0x3585c5<_0x5eb34c[_0x45af('0x4')][_0x45af('0xa')];_0x3585c5+=0x1){if(_0x5eb34c[_0x45af('0x4')][_0x3585c5][_0x45af('0x5')]!==_0x1fc854){if(!_[_0x45af('0x10')](_0x59c25a)){_0x59c25a+=',';}_0x59c25a+=_0x5eb34c['value'][_0x3585c5][_0x45af('0x8')]||_0x5eb34c['value'][_0x3585c5]['address']||'';_0x59c25a+='\x20<';_0x59c25a+=_0x5eb34c[_0x45af('0x4')][_0x3585c5]['address']?_0x5eb34c['value'][_0x3585c5][_0x45af('0x5')]:_0x45af('0x6')+random[_0x45af('0x7')](0x6)+_0x45af('0x11');_0x59c25a+='>';}}return _0x59c25a;}function parseEmail(_0x25f9e2,_0x41078b,_0x144fa5){if(_0x41078b['html']){var _0x4fd73b=/)<[^<]*)*<\/script>/gi;while(_0x4fd73b[_0x45af('0x12')](_0x41078b[_0x45af('0x13')])){_0x41078b['html']=_0x41078b[_0x45af('0x13')]['replace'](_0x4fd73b,'');}if(_0x41078b[_0x45af('0x13')][_0x45af('0x14')]('{_0x5af860[_0x45af('0x16')](_0x4f487d['filename']);});var _0x34140b=/]+>/g;var _0x35303f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3a15c5=_0x41078b['html'][_0x45af('0x17')](_0x35303f,_0x45af('0x18'));var _0x139670=_0x3a15c5[_0x45af('0x17')](_0x34140b,_0x45af('0x19'));for(let _0x4b4149=0x0;_0x4b4149<_0x5af860[_0x45af('0xa')];_0x4b4149++){var _0x3337cd=_0x139670[_0x45af('0x17')](_0x45af('0x19'),'\x20[Attachment:\x20'+_0x5af860[_0x4b4149]+'\x20]');_0x139670=_0x3337cd;}_0x41078b[_0x45af('0x13')]=_0x139670;}_0x144fa5[_0x45af('0x1a')]=_0x41078b[_0x45af('0x13')];}else{_0x144fa5[_0x45af('0x1a')]=_0x41078b[_0x45af('0x1b')];}if(_0x144fa5[_0x45af('0x1a')]){_0x144fa5[_0x45af('0x1a')]=_0x144fa5[_0x45af('0x1a')][_0x45af('0x17')](/0x0){var _0x5e129f=['Auto-Submitted:\x20auto-replied',_0x45af('0x2b'),_0x45af('0x2c')];for(var _0x14e8af=0x0;_0x14e8af<_0x41078b['headerLines'][_0x45af('0xa')];_0x14e8af++){var _0x281f3a=_[_0x45af('0x2d')](_0x5e129f,_0x41078b[_0x45af('0x2a')][_0x14e8af][_0x45af('0x2e')]);if(_0x281f3a>=0x0){_0x144fa5[_0x45af('0x2f')]=!![];}}}return _0x144fa5;}exports['parser']=function(_0x4fd0b9,_0x1a0b5e,_0x3d5296){var _0xfe7ca9={'from':getAddress(_0x1a0b5e[_0x45af('0x30')]),'firstName':getFirstName(_0x1a0b5e[_0x45af('0x30')]),'lastName':getLastName(_0x1a0b5e[_0x45af('0x30')]),'mapKey':_0x45af('0x20'),'message':{'from':getMails(_0x4fd0b9[_0x45af('0x20')],_0x1a0b5e[_0x45af('0x30')]),'to':_0x4fd0b9[_0x45af('0x20')],'cc':'','subject':_0x1a0b5e[_0x45af('0x31')]||'','messageId':_0x1a0b5e[_0x45af('0x32')],'inReplyTo':_0x1a0b5e['inReplyTo'],'sentAt':moment(_0x1a0b5e['date'])[_0x45af('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x1a0b5e[_0x45af('0x13')]&&!_0x1a0b5e[_0x45af('0x1b')]){var _0x497a5f=_['filter'](_0x1a0b5e['attachments'],{'contentType':_0x45af('0x33')});if(_0x497a5f[_0x45af('0xa')]){logger[_0x45af('0x34')](util[_0x45af('0x25')](_0x45af('0x35'),_0x1a0b5e[_0x45af('0x32')]));tnef[_0x45af('0x36')](_['first'](_0x497a5f)[_0x45af('0x37')],function(_0x12566f,_0x24f9c8){if(_0x24f9c8){_0x1a0b5e['html']=_0x24f9c8[_0x45af('0x38')]||'

Empty\x20message

';if(_0x24f9c8[_0x45af('0x39')]){for(var _0x306eb6=0x0;_0x306eb6<_0x24f9c8[_0x45af('0x39')][_0x45af('0xa')];_0x306eb6++){var _0x56df1e=_0x24f9c8['Attachments'][_0x306eb6];_0xfe7ca9[_0x45af('0x1d')][_0x45af('0x15')]['push']({'filename':_0x56df1e['Title'],'content':Buffer[_0x45af('0x30')](_0x56df1e[_0x45af('0x3a')])});}}}_0x3d5296(parseEmail(_0x4fd0b9,_0x1a0b5e,_0xfe7ca9));});}else{_0x1a0b5e[_0x45af('0x13')]=_0x45af('0x3b');_0x3d5296(parseEmail(_0x4fd0b9,_0x1a0b5e,_0xfe7ca9));}}else{_0x3d5296(parseEmail(_0x4fd0b9,_0x1a0b5e,_0xfe7ca9));}};exports[_0x45af('0x3c')]=function(_0x4ce22e,_0x4a3591){var _0x401fd7=[_0x45af('0x3d')+(_0x4a3591||''),'auth=Bearer\x20'+_0x4ce22e,'',''];return Buffer[_0x45af('0x30')](_0x401fd7[_0x45af('0xc')](''),'utf-8')['toString'](_0x45af('0x3e'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 677b62d..8262048 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 _0x0516=['key','SERV','active','Imap','exports','lodash','name'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0x0516,0x171));var _0x6051=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x0516[_0x34325b];return _0x3da348;};'use strict';var _=require(_0x6051('0x0'));function MailAccount(_0x9a3ef1){this['id']=_0x9a3ef1['id']||0x0;this[_0x6051('0x1')]=_0x9a3ef1[_0x6051('0x1')]||'Service';this[_0x6051('0x2')]=_0x9a3ef1[_0x6051('0x2')]||_0x6051('0x3');this[_0x6051('0x4')]=_0x9a3ef1[_0x6051('0x4')]||![];this[_0x6051('0x5')]=_0x9a3ef1['Imap']||[];this['Smtp']=_0x9a3ef1['Smtp']||[];}module[_0x6051('0x6')]=MailAccount; \ No newline at end of file +var _0x8326=['SERV','active','Imap','Smtp','lodash','name','Service','key'];(function(_0x33c797,_0x430c30){var _0x514ff7=function(_0x17920c){while(--_0x17920c){_0x33c797['push'](_0x33c797['shift']());}};_0x514ff7(++_0x430c30);}(_0x8326,0x144));var _0x6832=function(_0x23fd1b,_0x469cab){_0x23fd1b=_0x23fd1b-0x0;var _0x304e83=_0x8326[_0x23fd1b];return _0x304e83;};'use strict';var _=require(_0x6832('0x0'));function MailAccount(_0x59bec8){this['id']=_0x59bec8['id']||0x0;this[_0x6832('0x1')]=_0x59bec8[_0x6832('0x1')]||_0x6832('0x2');this[_0x6832('0x3')]=_0x59bec8[_0x6832('0x3')]||_0x6832('0x4');this[_0x6832('0x5')]=_0x59bec8[_0x6832('0x5')]||![];this[_0x6832('0x6')]=_0x59bec8[_0x6832('0x6')]||[];this[_0x6832('0x7')]=_0x59bec8[_0x6832('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 82772a3..c45ecb8 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 _0x5005=['initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x5910ea,_0x537674){var _0x3ef685=function(_0x55a66a){while(--_0x55a66a){_0x5910ea['push'](_0x5910ea['shift']());}};_0x3ef685(++_0x537674);}(_0x5005,0x90));var _0x5500=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x5005[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0x5500('0x0'));var MailAccount=require(_0x5500('0x1'));var Realtime=function(){this[_0x5500('0x2')]={};};function freeIsNotKey(_0x37d579,_0x42f1d0,_0x4209f3){var _0x595043=_['mapKeys'](_0x37d579,function(_0x35f568,_0x21519b){return _0x35f568[_0x4209f3];});for(var _0x5a1859 in _0x42f1d0){if(_0x42f1d0[_0x5500('0x3')](_0x5a1859)){if(!_0x595043[_0x5a1859]){delete _0x42f1d0[_0x5a1859];}}}}Realtime[_0x5500('0x4')][_0x5500('0x5')]=function(_0x26ff42,_0x4d6808){for(var _0x1e3708 in _0x4d6808){if(_0x26ff42[_0x5500('0x3')](_0x1e3708)){_0x26ff42[_0x1e3708]=_0x4d6808[_0x1e3708];}}};Realtime['prototype'][_0x5500('0x6')]=function(){var _0x12dd0c=this;return function(_0x7e27b9){if(_0x7e27b9){freeIsNotKey(_0x7e27b9,_0x12dd0c['mailAccounts'],'id');for(var _0x71056a=0x0,_0x338962={},_0x53faa7={};_0x71056a<_0x7e27b9[_0x5500('0x7')];_0x71056a+=0x1){_0x338962=_0x7e27b9[_0x71056a];if(_[_0x5500('0x8')](_0x12dd0c['mailAccounts'][_0x338962['id']])){_0x12dd0c['mailAccounts'][_0x338962['id']]=new MailAccount(_0x338962);}else{_['merge'](_0x12dd0c[_0x5500('0x2')][_0x338962['id']],_0x338962);}}}return _0x12dd0c[_0x5500('0x2')];};};module[_0x5500('0x9')]=Realtime; \ No newline at end of file +var _0xb33c=['prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0xa335e6,_0x207280){var _0x3ffdd8=function(_0x4a4f6e){while(--_0x4a4f6e){_0xa335e6['push'](_0xa335e6['shift']());}};_0x3ffdd8(++_0x207280);}(_0xb33c,0xac));var _0xcb33=function(_0x147a64,_0x21ed26){_0x147a64=_0x147a64-0x0;var _0x4a2767=_0xb33c[_0x147a64];return _0x4a2767;};'use strict';var _=require(_0xcb33('0x0'));var MailAccount=require(_0xcb33('0x1'));var Realtime=function(){this[_0xcb33('0x2')]={};};function freeIsNotKey(_0x3f5556,_0x4c4d91,_0x132174){var _0xed386b=_[_0xcb33('0x3')](_0x3f5556,function(_0x32827e,_0x3b255e){return _0x32827e[_0x132174];});for(var _0x542b6b in _0x4c4d91){if(_0x4c4d91['hasOwnProperty'](_0x542b6b)){if(!_0xed386b[_0x542b6b]){delete _0x4c4d91[_0x542b6b];}}}}Realtime[_0xcb33('0x4')][_0xcb33('0x5')]=function(_0x13107b,_0x4d7ea6){for(var _0x39318e in _0x4d7ea6){if(_0x13107b[_0xcb33('0x6')](_0x39318e)){_0x13107b[_0x39318e]=_0x4d7ea6[_0x39318e];}}};Realtime[_0xcb33('0x4')][_0xcb33('0x7')]=function(){var _0x4f93d8=this;return function(_0x5a22f2){if(_0x5a22f2){freeIsNotKey(_0x5a22f2,_0x4f93d8[_0xcb33('0x2')],'id');for(var _0xe6d3c0=0x0,_0x47396b={},_0x41ad67={};_0xe6d3c0<_0x5a22f2[_0xcb33('0x8')];_0xe6d3c0+=0x1){_0x47396b=_0x5a22f2[_0xe6d3c0];if(_['isUndefined'](_0x4f93d8['mailAccounts'][_0x47396b['id']])){_0x4f93d8[_0xcb33('0x2')][_0x47396b['id']]=new MailAccount(_0x47396b);}else{_[_0xcb33('0x9')](_0x4f93d8[_0xcb33('0x2')][_0x47396b['id']],_0x47396b);}}}return _0x4f93d8[_0xcb33('0x2')];};};module[_0xcb33('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a3c6e99..01affe0 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 _0x36e0=['service','MailServerOut','Smtp','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','email','active','ListId','TemplateId','MailServerIn','Imap','CloudProvider'];(function(_0x20f07f,_0x369c76){var _0x260e71=function(_0x502e15){while(--_0x502e15){_0x20f07f['push'](_0x20f07f['shift']());}};_0x260e71(++_0x369c76);}(_0x36e0,0x15c));var _0x036e=function(_0x1d4722,_0x2539a3){_0x1d4722=_0x1d4722-0x0;var _0x120705=_0x36e0[_0x1d4722];return _0x120705;};'use strict';var client=require(_0x036e('0x0'));exports[_0x036e('0x1')]=function(){return function(){return client['Request'](_0x036e('0x2'),{'options':{'attributes':['id',_0x036e('0x3'),_0x036e('0x4'),'service',_0x036e('0x5'),_0x036e('0x6'),'key',_0x036e('0x7'),_0x036e('0x8')],'raw':![],'include':[{'model':_0x036e('0x9'),'as':_0x036e('0xa'),'include':[{'model':_0x036e('0xb'),'attributes':['id',_0x036e('0x3'),_0x036e('0xc'),'type','data5'],'as':_0x036e('0xb')}]},{'model':_0x036e('0xd'),'as':_0x036e('0xe'),'include':[{'model':_0x036e('0xb'),'attributes':['id','name','service','type',_0x036e('0xf')],'as':_0x036e('0xb')}]}]},'log':_0x036e('0x10')});};};exports[_0x036e('0x11')]=function(_0x553688,_0x234239){return client[_0x036e('0x12')]('NotifyMailAccount',{'account':{'id':_0x553688},'body':_0x234239,'log':_0x036e('0x13')});}; \ No newline at end of file +var _0x74af=['notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','active','key','ListId','TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','getMailAccount'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x74af,0x178));var _0xf74a=function(_0x2700b8,_0x1f1a88){_0x2700b8=_0x2700b8-0x0;var _0x4afc0f=_0x74af[_0x2700b8];return _0x4afc0f;};'use strict';var client=require(_0xf74a('0x0'));exports[_0xf74a('0x1')]=function(){return function(){return client[_0xf74a('0x2')](_0xf74a('0x3'),{'options':{'attributes':['id',_0xf74a('0x4'),_0xf74a('0x5'),'service',_0xf74a('0x6'),_0xf74a('0x7'),_0xf74a('0x8'),_0xf74a('0x9'),_0xf74a('0xa')],'raw':![],'include':[{'model':_0xf74a('0xb'),'as':_0xf74a('0xc'),'include':[{'model':'CloudProvider','attributes':['id',_0xf74a('0x4'),_0xf74a('0xd'),_0xf74a('0xe'),_0xf74a('0xf')],'as':_0xf74a('0x10')}]},{'model':_0xf74a('0x11'),'as':_0xf74a('0x12'),'include':[{'model':_0xf74a('0x10'),'attributes':['id',_0xf74a('0x4'),_0xf74a('0xd'),_0xf74a('0xe'),_0xf74a('0xf')],'as':_0xf74a('0x10')}]}]},'log':_0xf74a('0x13')});};};exports[_0xf74a('0x14')]=function(_0x548260,_0x1289b1){return client['Request'](_0xf74a('0x15'),{'account':{'id':_0x548260},'body':_0x1289b1,'log':_0xf74a('0x15')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 25de891..dfabdc2 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 _0x4505=['ShowSetting','../client','Request'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0x4505,0x18a));var _0x5450=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4505[_0xdea41a];return _0x15d0d8;};'use strict';var client=require(_0x5450('0x0'));exports['getSettings']=function(){return client[_0x5450('0x1')](_0x5450('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file +var _0xa1b2=['getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x4d4db5,_0x3bcc08){var _0x5d5e6e=function(_0x266c11){while(--_0x266c11){_0x4d4db5['push'](_0x4d4db5['shift']());}};_0x5d5e6e(++_0x3bcc08);}(_0xa1b2,0x7c));var _0x2a1b=function(_0x4db577,_0x50ed06){_0x4db577=_0x4db577-0x0;var _0x33b938=_0xa1b2[_0x4db577];return _0x33b938;};'use strict';var client=require('../client');exports[_0x2a1b('0x0')]=function(){return client[_0x2a1b('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2a1b('0x2')]},'log':_0x2a1b('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d34f499..0f6bb66 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 4c0dba7..d603778 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 _0x4bf2=['adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','defaults','redis','localhost'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4bf2,0x178));var _0x24bf=function(_0x2616bc,_0x41c5e3){_0x2616bc=_0x2616bc-0x0;var _0x58e842=_0x4bf2[_0x2616bc];return _0x58e842;};'use strict';var _=require(_0x24bf('0x0'));var http=require(_0x24bf('0x1'));var express=require(_0x24bf('0x2'));var sticky=require(_0x24bf('0x3'));var Redis=require(_0x24bf('0x4'));var config=require(_0x24bf('0x5'));var app=express();var server=http[_0x24bf('0x6')](app);server[_0x24bf('0x7')]=0xdbba0;if(sticky[_0x24bf('0x8')](server,config[_0x24bf('0x9')])){var socketio=require(_0x24bf('0xa'))(server,{'transports':['websocket','polling']});config['redis']=_[_0x24bf('0xb')](config[_0x24bf('0xc')],{'host':_0x24bf('0xd'),'port':0x18eb});socketio[_0x24bf('0xe')](require(_0x24bf('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x24bf('0xc')])}));require(_0x24bf('0x10'))[_0x24bf('0x11')]();require(_0x24bf('0x12'))['default'](socketio);require(_0x24bf('0x13'))[_0x24bf('0x11')](app);require(_0x24bf('0x14'))['default'](app);}else{server[_0x24bf('0x15')](_0x24bf('0x16'),function(){console[_0x24bf('0x17')](_0x24bf('0x18'),config['port']);});}exports=module[_0x24bf('0x19')]=app; \ No newline at end of file +var _0xe845=['timeout','listen','port','socket.io','websocket','polling','redis','defaults','../../config/socketio','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','../../config/environment'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe845,0xa6));var _0x5e84=function(_0xfca055,_0x10db1c){_0xfca055=_0xfca055-0x0;var _0x172894=_0xe845[_0xfca055];return _0x172894;};'use strict';var _=require('lodash');var http=require(_0x5e84('0x0'));var express=require(_0x5e84('0x1'));var sticky=require('sticky-session');var Redis=require(_0x5e84('0x2'));var config=require(_0x5e84('0x3'));var app=express();var server=http['createServer'](app);server[_0x5e84('0x4')]=0xdbba0;if(sticky[_0x5e84('0x5')](server,config[_0x5e84('0x6')])){var socketio=require(_0x5e84('0x7'))(server,{'transports':[_0x5e84('0x8'),_0x5e84('0x9')]});config[_0x5e84('0xa')]=_[_0x5e84('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x5e84('0xa')]),'subClient':new Redis(config[_0x5e84('0xa')])}));require('../../config/triggers')['default']();require(_0x5e84('0xc'))['default'](socketio);require('../../config/express')['default'](app);require('../../routes')['default'](app);}else{server['once'](_0x5e84('0xd'),function(){console[_0x5e84('0xe')](_0x5e84('0xf'),config[_0x5e84('0x6')]);});}exports=module[_0x5e84('0x10')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fef8098..67d770c 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 _0xb6d2=['client','http','Request','request','then','rpc','error','message','result','catch','bluebird','../../config/logger','routing'];(function(_0x1d31d4,_0x38e515){var _0x58aa03=function(_0x3f8895){while(--_0x3f8895){_0x1d31d4['push'](_0x1d31d4['shift']());}};_0x58aa03(++_0x38e515);}(_0xb6d2,0xb3));var _0x2b6d=function(_0x531baa,_0x2a66ef){_0x531baa=_0x531baa-0x0;var _0x5b2248=_0xb6d2[_0x531baa];return _0x5b2248;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2b6d('0x0'));var logger=require(_0x2b6d('0x1'))(_0x2b6d('0x2'));var client=jayson[_0x2b6d('0x3')][_0x2b6d('0x4')]({'port':0x2329});client[_0x2b6d('0x5')]=function(_0x45e655,_0x3659fc){return new BPromise(function(_0x53b5f8,_0x23be2a){return client[_0x2b6d('0x6')](_0x45e655,_0x3659fc)[_0x2b6d('0x7')](function(_0x39e507){logger['debug'](_0x2b6d('0x8'),_0x2b6d('0x2'),_0x45e655,_0x3659fc,_0x39e507);if(_0x39e507[_0x2b6d('0x9')]){logger[_0x2b6d('0x9')](_0x2b6d('0x8'),_0x2b6d('0x2'),_0x45e655,_0x39e507[_0x2b6d('0x9')][_0x2b6d('0xa')],_0x3659fc);return _0x23be2a(_0x39e507[_0x2b6d('0x9')][_0x2b6d('0xa')]);}else{return _0x53b5f8(_0x39e507[_0x2b6d('0xb')]);}})[_0x2b6d('0xc')](function(_0xc8ea9b){logger[_0x2b6d('0x9')](_0x2b6d('0x8'),_0x2b6d('0x2'),_0x45e655,_0xc8ea9b,_0x3659fc);return _0x23be2a(_0xc8ea9b);});});};module['exports']=client; \ No newline at end of file +var _0x2412=['client','http','Request','request','debug','error','rpc','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x244047,_0x32f924){var _0xfe8007=function(_0x60d786){while(--_0x60d786){_0x244047['push'](_0x244047['shift']());}};_0xfe8007(++_0x32f924);}(_0x2412,0x74));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x2241('0x0'));var BPromise=require(_0x2241('0x1'));var logger=require(_0x2241('0x2'))(_0x2241('0x3'));var client=jayson[_0x2241('0x4')][_0x2241('0x5')]({'port':0x2329});client[_0x2241('0x6')]=function(_0x55939b,_0x8dd8d9){return new BPromise(function(_0x4ea142,_0x596a50){return client[_0x2241('0x7')](_0x55939b,_0x8dd8d9)['then'](function(_0x4c9861){logger[_0x2241('0x8')]('rpc',_0x2241('0x3'),_0x55939b,_0x8dd8d9,_0x4c9861);if(_0x4c9861[_0x2241('0x9')]){logger[_0x2241('0x9')](_0x2241('0xa'),'routing',_0x55939b,_0x4c9861['error'][_0x2241('0xb')],_0x8dd8d9);return _0x596a50(_0x4c9861[_0x2241('0x9')][_0x2241('0xb')]);}else{return _0x4ea142(_0x4c9861[_0x2241('0xc')]);}})[_0x2241('0xd')](function(_0x22d3ba){logger[_0x2241('0x9')]('rpc',_0x2241('0x3'),_0x55939b,_0x22d3ba,_0x8dd8d9);return _0x596a50(_0x22d3ba);});});};module[_0x2241('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 5cadead..ddbe060 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 _0x5c18=['./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird'];(function(_0x1e7f00,_0xd391aa){var _0x22ca61=function(_0x5ea3ad){while(--_0x5ea3ad){_0x1e7f00['push'](_0x1e7f00['shift']());}};_0x22ca61(++_0xd391aa);}(_0x5c18,0xa7));var _0x85c1=function(_0x2f4a61,_0x1d5a99){_0x2f4a61=_0x2f4a61-0x0;var _0x17c87e=_0x5c18[_0x2f4a61];return _0x17c87e;};'use strict';var BPromise=require(_0x85c1('0x0'));var server=require(_0x85c1('0x1'));var Realtime=require(_0x85c1('0x2'));var user=require(_0x85c1('0x3'));var interval=require(_0x85c1('0x4'));var openchannelQueue=require(_0x85c1('0x5'));var chatQueue=require(_0x85c1('0x6'));var smsQueue=require(_0x85c1('0x7'));var mailQueue=require(_0x85c1('0x8'));var faxQueue=require(_0x85c1('0x9'));var whatsappQueue=require(_0x85c1('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x85c1('0xb')]()[_0x85c1('0xc')](user[_0x85c1('0xd')]())[_0x85c1('0xc')](realtime['initAgents']())[_0x85c1('0xc')](interval[_0x85c1('0xe')]())[_0x85c1('0xc')](realtime[_0x85c1('0xf')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0x85c1('0xc')](realtime[_0x85c1('0x10')]())[_0x85c1('0xc')](chatQueue[_0x85c1('0x11')]())[_0x85c1('0xc')](realtime[_0x85c1('0x12')]())[_0x85c1('0xc')](smsQueue['getSmsQueues']())[_0x85c1('0xc')](realtime[_0x85c1('0x13')]())[_0x85c1('0xc')](mailQueue[_0x85c1('0x14')]())[_0x85c1('0xc')](realtime[_0x85c1('0x15')]())['then'](faxQueue[_0x85c1('0x16')]())[_0x85c1('0xc')](realtime[_0x85c1('0x17')]())['then'](whatsappQueue[_0x85c1('0x18')]())[_0x85c1('0xc')](realtime[_0x85c1('0x19')]())[_0x85c1('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x5c5066){return initRealtime();})[_0x85c1('0xc')](function(_0x1669fe){return setInterval(initRealtime,0x1388);})[_0x85c1('0x1a')](function(_0x1fbd13){console[_0x85c1('0x1b')](_0x1fbd13);});}main(); \ No newline at end of file +var _0x21bf=['./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server'];(function(_0x2d6919,_0x514f66){var _0x9057e5=function(_0x563448){while(--_0x563448){_0x2d6919['push'](_0x2d6919['shift']());}};_0x9057e5(++_0x514f66);}(_0x21bf,0x7b));var _0xf21b=function(_0x6d967,_0x3bddfd){_0x6d967=_0x6d967-0x0;var _0x383869=_0x21bf[_0x6d967];return _0x383869;};'use strict';var BPromise=require(_0xf21b('0x0'));var server=require(_0xf21b('0x1'));var Realtime=require('./realtime');var user=require(_0xf21b('0x2'));var interval=require(_0xf21b('0x3'));var openchannelQueue=require(_0xf21b('0x4'));var chatQueue=require(_0xf21b('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xf21b('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xf21b('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xf21b('0x8')]()[_0xf21b('0x9')](user[_0xf21b('0xa')]())['then'](realtime[_0xf21b('0xb')]())['then'](interval[_0xf21b('0xc')]())[_0xf21b('0x9')](realtime[_0xf21b('0xd')]())[_0xf21b('0x9')](openchannelQueue['getOpenchannelQueues']())[_0xf21b('0x9')](realtime[_0xf21b('0xe')]())[_0xf21b('0x9')](chatQueue[_0xf21b('0xf')]())['then'](realtime[_0xf21b('0x10')]())[_0xf21b('0x9')](smsQueue['getSmsQueues']())[_0xf21b('0x9')](realtime['initSmsQueues']())['then'](mailQueue[_0xf21b('0x11')]())[_0xf21b('0x9')](realtime[_0xf21b('0x12')]())[_0xf21b('0x9')](faxQueue['getFaxQueues']())[_0xf21b('0x9')](realtime[_0xf21b('0x13')]())[_0xf21b('0x9')](whatsappQueue[_0xf21b('0x14')]())[_0xf21b('0x9')](realtime[_0xf21b('0x15')]())[_0xf21b('0x9')](function(){return realtime;});}function main(){return server[_0xf21b('0x16')](realtime)[_0xf21b('0x9')](function(_0x133b28){return initRealtime();})['then'](function(_0x1b944d){return setInterval(initRealtime,0x1388);})[_0xf21b('0x17')](function(_0x15ca7e){console[_0xf21b('0x18')](_0x15ca7e);});}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 12843d1..cc206f4 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 _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x153ed8,_0x5103b9){var _0xa62e50=function(_0xf1449c){while(--_0xf1449c){_0x153ed8['push'](_0x153ed8['shift']());}};_0xa62e50(++_0x5103b9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x1870f8,_0x207d93){var _0x1d7bf7=function(_0x3e7d3a){while(--_0x3e7d3a){_0x1870f8['push'](_0x1870f8['shift']());}};_0x1d7bf7(++_0x207d93);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index d79c6f4..f3bba41 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 _0xb8ee=['client','http','request','then','error','message','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8ee,0x102));var _0xeb8e=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0xb8ee[_0x3f8a03];return _0x147fb2;};'use strict';var BPromise=require(_0xeb8e('0x0'));var jayson=require(_0xeb8e('0x1'));var client=jayson[_0xeb8e('0x2')][_0xeb8e('0x3')]({'port':0x232b});function request(_0x306d72,_0x4d046b){return new BPromise(function(_0x3051d4,_0x9bd580){return client[_0xeb8e('0x4')](_0x306d72,_0x4d046b)[_0xeb8e('0x5')](function(_0x223c71){if(_0x223c71['error']){return _0x9bd580(_0x223c71[_0xeb8e('0x6')][_0xeb8e('0x7')]);}else{return _0x3051d4(_0x223c71['result']);}})[_0xeb8e('0x8')](function(_0x18979c){return _0x9bd580(_0x18979c);});});}exports[_0xeb8e('0x9')]=function(_0x3cb33f,_0x5d2c90){return request('SendMail',{'account':_0x3cb33f,'message':_0x5d2c90});}; \ No newline at end of file +var _0x6f4d=['message','result','catch','SendMail','bluebird','jayson/promise','request','then','error'];(function(_0x116a41,_0x46e23b){var _0x348cb3=function(_0x40647d){while(--_0x40647d){_0x116a41['push'](_0x116a41['shift']());}};_0x348cb3(++_0x46e23b);}(_0x6f4d,0x1ab));var _0xd6f4=function(_0x170bcd,_0xf33f75){_0x170bcd=_0x170bcd-0x0;var _0x39cb12=_0x6f4d[_0x170bcd];return _0x39cb12;};'use strict';var BPromise=require(_0xd6f4('0x0'));var jayson=require(_0xd6f4('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x167bcf,_0x5b5163){return new BPromise(function(_0x4c1c57,_0xfa9bc1){return client[_0xd6f4('0x2')](_0x167bcf,_0x5b5163)[_0xd6f4('0x3')](function(_0xf09cd1){if(_0xf09cd1[_0xd6f4('0x4')]){return _0xfa9bc1(_0xf09cd1[_0xd6f4('0x4')][_0xd6f4('0x5')]);}else{return _0x4c1c57(_0xf09cd1[_0xd6f4('0x6')]);}})[_0xd6f4('0x7')](function(_0x30dd78){return _0xfa9bc1(_0x30dd78);});});}exports['sendMailMessage']=function(_0x54f70f,_0x4d7c5e){return request(_0xd6f4('0x8'),{'account':_0x54f70f,'message':_0x4d7c5e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 73b3035..ffbf64a 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 _0xdc42=['faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','updateRealtime','chat','openchannel','sms','length','StatusTime','toNumber','format','Status','mailCapacity','faxStatusTime','busy','smsWaitingInteractions','stringify','emit','exports','md5','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause'];(function(_0x21a99e,_0x28b022){var _0x2d6f08=function(_0x5eafda){while(--_0x5eafda){_0x21a99e['push'](_0x21a99e['shift']());}};_0x2d6f08(++_0x28b022);}(_0xdc42,0x1e6));var _0x2dc4=function(_0x4f63f4,_0x302cce){_0x4f63f4=_0x4f63f4-0x0;var _0x52fcaf=_0xdc42[_0x4f63f4];return _0x52fcaf;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x2dc4('0x0'));var Redis=require(_0x2dc4('0x1'));var config=require(_0x2dc4('0x2'));config[_0x2dc4('0x3')]=_['defaults'](config['redis'],{'host':_0x2dc4('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x3f8dbc){this['id']=_0x3f8dbc['id']||0x0;this[_0x2dc4('0x5')]=_0x3f8dbc['name']||'';this[_0x2dc4('0x6')]=_0x3f8dbc[_0x2dc4('0x6')]||!![];this['voicePause']=_0x3f8dbc[_0x2dc4('0x7')]||![];this[_0x2dc4('0x8')]=_0x3f8dbc[_0x2dc4('0x8')]||![];this['mailPause']=_0x3f8dbc[_0x2dc4('0x9')]||![];this[_0x2dc4('0xa')]=_0x3f8dbc[_0x2dc4('0xa')]||![];this[_0x2dc4('0xb')]=_0x3f8dbc[_0x2dc4('0xb')]||![];this[_0x2dc4('0xc')]=_0x3f8dbc[_0x2dc4('0xc')]||![];this[_0x2dc4('0xd')]=_0x2dc4('0xe');this[_0x2dc4('0xf')]=0x0;this[_0x2dc4('0x10')]=_0x3f8dbc[_0x2dc4('0x10')]||0x0;this[_0x2dc4('0x11')]=0x0;this[_0x2dc4('0x12')]=_0x2dc4('0xe');this[_0x2dc4('0x13')]=0x0;this['mailCapacity']=_0x3f8dbc['mailCapacity']||0x0;this[_0x2dc4('0x14')]=0x0;this['faxStatus']=_0x2dc4('0xe');this['faxStatusTime']=0x0;this[_0x2dc4('0x15')]=_0x3f8dbc['faxCapacity']||0x0;this[_0x2dc4('0x16')]=0x0;this[_0x2dc4('0x17')]=_0x2dc4('0xe');this[_0x2dc4('0x18')]=0x0;this[_0x2dc4('0x19')]=_0x3f8dbc[_0x2dc4('0x19')]||0x0;this[_0x2dc4('0x1a')]=0x0;this[_0x2dc4('0x1b')]=_0x2dc4('0xe');this[_0x2dc4('0x1c')]=0x0;this['whatsappCapacity']=_0x3f8dbc[_0x2dc4('0x1d')]||0x0;this[_0x2dc4('0x1e')]=0x0;this[_0x2dc4('0x1f')]=_0x2dc4('0xe');this[_0x2dc4('0x20')]=0x0;this['openchannelCapacity']=_0x3f8dbc[_0x2dc4('0x21')]||0x0;this[_0x2dc4('0x22')]=0x0;this['busy']=![];this[_0x2dc4('0x23')]=undefined;this[_0x2dc4('0x0')]='';this[_0x2dc4('0x24')]={};this[_0x2dc4('0x25')]={};this[_0x2dc4('0x26')]={};this[_0x2dc4('0x27')]={};this['smsWaitingInteractions']={};this[_0x2dc4('0x28')]={};this['updateRealtime']();}Agent[_0x2dc4('0x29')][_0x2dc4('0x2a')]=function(_0x392ded){if(this[_0x392ded+_0x2dc4('0x2b')]>0x0){if(this[_0x392ded+'Capacity']>0x0&&this[_0x392ded+'CurrentCapacity']>=this[_0x392ded+_0x2dc4('0x2c')]){return _0x2dc4('0x2d');}else{return'working';}}else{return'idle';}};Agent[_0x2dc4('0x29')][_0x2dc4('0x2e')]=function(){var _0x3dd875=['mail',_0x2dc4('0x2f'),_0x2dc4('0x30'),'fax',_0x2dc4('0x31'),'whatsapp'];for(var _0x5cd939=0x0;_0x5cd939<_0x3dd875[_0x2dc4('0x32')];_0x5cd939+=0x1){var _0x2d23eb=this[_0x2dc4('0x2a')](_0x3dd875[_0x5cd939]);if(this[_0x3dd875[_0x5cd939]+'Status']!==_0x2d23eb){this[_0x3dd875[_0x5cd939]+_0x2dc4('0x33')]=_[_0x2dc4('0x34')](moment()[_0x2dc4('0x35')]('x'));}this[_0x3dd875[_0x5cd939]+_0x2dc4('0x36')]=_0x2d23eb;}var _0x2cdc93={'id':this['id'],'name':this[_0x2dc4('0x5')],'online':this[_0x2dc4('0x6')],'voicePause':this['voicePause'],'chatPause':this[_0x2dc4('0x8')],'mailPause':this[_0x2dc4('0x9')],'smsPause':this[_0x2dc4('0xb')],'faxPause':this[_0x2dc4('0xa')],'openchannelPause':this[_0x2dc4('0xc')],'chatStatus':this[_0x2dc4('0xd')],'chatStatusTime':this[_0x2dc4('0xf')],'chatCapacity':this[_0x2dc4('0x10')],'chatCurrentCapacity':this[_0x2dc4('0x11')],'mailStatus':this[_0x2dc4('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x2dc4('0x37')],'mailCurrentCapacity':this[_0x2dc4('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x2dc4('0x38')],'faxCapacity':this[_0x2dc4('0x15')],'faxCurrentCapacity':this[_0x2dc4('0x16')],'smsStatus':this[_0x2dc4('0x17')],'smsStatusTime':this[_0x2dc4('0x18')],'smsCapacity':this[_0x2dc4('0x19')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x2dc4('0x1b')],'whatsappStatusTime':this[_0x2dc4('0x1c')],'whatsappCapacity':this[_0x2dc4('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2dc4('0x1f')],'openchannelStatusTime':this[_0x2dc4('0x20')],'openchannelCapacity':this[_0x2dc4('0x21')],'openchannelCurrentCapacity':this[_0x2dc4('0x22')],'busy':this[_0x2dc4('0x39')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x2dc4('0x24')],'faxWaitingInteractions':this[_0x2dc4('0x25')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x2dc4('0x3a')],'whatsappWaitingInteractions':this[_0x2dc4('0x28')]};var _0x3bcf5c=md5(JSON[_0x2dc4('0x3b')](_0x2cdc93));if(this[_0x2dc4('0x0')]!==_0x3bcf5c){this[_0x2dc4('0x0')]=_0x3bcf5c;io[_0x2dc4('0x3c')]('user:save',_0x2cdc93);}};module[_0x2dc4('0x3d')]=Agent; \ No newline at end of file +var _0xece7=['faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','mail','chat','openchannel','fax','sms','Status','StatusTime','toNumber','format','chatStatus','smsStatus','openchannelStatus','openchannelWaitingInteractions','whatsappWaitingInteractions','stringify','emit','exports','lodash','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity'];(function(_0x559720,_0x4d3062){var _0x4c51ff=function(_0x4fc989){while(--_0x4fc989){_0x559720['push'](_0x559720['shift']());}};_0x4c51ff(++_0x4d3062);}(_0xece7,0x1ee));var _0x7ece=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0xece7[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x7ece('0x0'));var moment=require(_0x7ece('0x1'));var md5=require('md5');var Redis=require(_0x7ece('0x2'));var config=require('../../../config/environment');config[_0x7ece('0x3')]=_[_0x7ece('0x4')](config['redis'],{'host':_0x7ece('0x5'),'port':0x18eb});var io=require(_0x7ece('0x6'))(new Redis(config[_0x7ece('0x3')]));function Agent(_0x121fde){this['id']=_0x121fde['id']||0x0;this[_0x7ece('0x7')]=_0x121fde[_0x7ece('0x7')]||'';this[_0x7ece('0x8')]=_0x121fde[_0x7ece('0x8')]||!![];this['voicePause']=_0x121fde[_0x7ece('0x9')]||![];this['chatPause']=_0x121fde[_0x7ece('0xa')]||![];this[_0x7ece('0xb')]=_0x121fde[_0x7ece('0xb')]||![];this[_0x7ece('0xc')]=_0x121fde[_0x7ece('0xc')]||![];this[_0x7ece('0xd')]=_0x121fde[_0x7ece('0xd')]||![];this[_0x7ece('0xe')]=_0x121fde[_0x7ece('0xe')]||![];this['chatStatus']=_0x7ece('0xf');this[_0x7ece('0x10')]=0x0;this[_0x7ece('0x11')]=_0x121fde[_0x7ece('0x11')]||0x0;this[_0x7ece('0x12')]=0x0;this[_0x7ece('0x13')]=_0x7ece('0xf');this[_0x7ece('0x14')]=0x0;this[_0x7ece('0x15')]=_0x121fde['mailCapacity']||0x0;this[_0x7ece('0x16')]=0x0;this[_0x7ece('0x17')]='unknown';this[_0x7ece('0x18')]=0x0;this[_0x7ece('0x19')]=_0x121fde[_0x7ece('0x19')]||0x0;this[_0x7ece('0x1a')]=0x0;this['smsStatus']=_0x7ece('0xf');this[_0x7ece('0x1b')]=0x0;this[_0x7ece('0x1c')]=_0x121fde[_0x7ece('0x1c')]||0x0;this[_0x7ece('0x1d')]=0x0;this[_0x7ece('0x1e')]='unknown';this[_0x7ece('0x1f')]=0x0;this['whatsappCapacity']=_0x121fde[_0x7ece('0x20')]||0x0;this[_0x7ece('0x21')]=0x0;this['openchannelStatus']=_0x7ece('0xf');this[_0x7ece('0x22')]=0x0;this[_0x7ece('0x23')]=_0x121fde[_0x7ece('0x23')]||0x0;this[_0x7ece('0x24')]=0x0;this['busy']=![];this[_0x7ece('0x25')]=undefined;this[_0x7ece('0x26')]='';this['chatWaitingInteractions']={};this[_0x7ece('0x27')]={};this[_0x7ece('0x28')]={};this['openchannelWaitingInteractions']={};this[_0x7ece('0x29')]={};this['whatsappWaitingInteractions']={};this[_0x7ece('0x2a')]();}Agent[_0x7ece('0x2b')][_0x7ece('0x2c')]=function(_0x78efc8){if(this[_0x78efc8+_0x7ece('0x2d')]>0x0){if(this[_0x78efc8+'Capacity']>0x0&&this[_0x78efc8+_0x7ece('0x2d')]>=this[_0x78efc8+'Capacity']){return _0x7ece('0x2e');}else{return _0x7ece('0x2f');}}else{return'idle';}};Agent['prototype']['updateRealtime']=function(){var _0x19b4dd=[_0x7ece('0x30'),_0x7ece('0x31'),_0x7ece('0x32'),_0x7ece('0x33'),_0x7ece('0x34'),'whatsapp'];for(var _0x59c2fb=0x0;_0x59c2fb<_0x19b4dd['length'];_0x59c2fb+=0x1){var _0x4e31b4=this['getChannelStatus'](_0x19b4dd[_0x59c2fb]);if(this[_0x19b4dd[_0x59c2fb]+_0x7ece('0x35')]!==_0x4e31b4){this[_0x19b4dd[_0x59c2fb]+_0x7ece('0x36')]=_[_0x7ece('0x37')](moment()[_0x7ece('0x38')]('x'));}this[_0x19b4dd[_0x59c2fb]+'Status']=_0x4e31b4;}var _0x3d5ff5={'id':this['id'],'name':this['name'],'online':this[_0x7ece('0x8')],'voicePause':this[_0x7ece('0x9')],'chatPause':this[_0x7ece('0xa')],'mailPause':this[_0x7ece('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x7ece('0xc')],'openchannelPause':this[_0x7ece('0xe')],'chatStatus':this[_0x7ece('0x39')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x7ece('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x7ece('0x13')],'mailStatusTime':this[_0x7ece('0x14')],'mailCapacity':this[_0x7ece('0x15')],'mailCurrentCapacity':this[_0x7ece('0x16')],'faxStatus':this[_0x7ece('0x17')],'faxStatusTime':this[_0x7ece('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x7ece('0x3a')],'smsStatusTime':this[_0x7ece('0x1b')],'smsCapacity':this[_0x7ece('0x1c')],'smsCurrentCapacity':this[_0x7ece('0x1d')],'whatsappStatus':this[_0x7ece('0x1e')],'whatsappStatusTime':this[_0x7ece('0x1f')],'whatsappCapacity':this[_0x7ece('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x7ece('0x3b')],'openchannelStatusTime':this[_0x7ece('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x7ece('0x24')],'busy':this['busy'],'busyQueue':this[_0x7ece('0x25')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x7ece('0x27')],'mailWaitingInteractions':this[_0x7ece('0x28')],'openchannelWaitingInteractions':this[_0x7ece('0x3c')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0x7ece('0x3d')]};var _0x542170=md5(JSON[_0x7ece('0x3e')](_0x3d5ff5));if(this[_0x7ece('0x26')]!==_0x542170){this[_0x7ece('0x26')]=_0x542170;io[_0x7ece('0x3f')]('user:save',_0x3d5ff5);}};module[_0x7ece('0x40')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ec91316..cd477c8 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 _0xf3c5=['chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','chatPause','available','stringify','chat:queue:%s'];(function(_0x4db241,_0x4c10db){var _0x180802=function(_0x322bed){while(--_0x322bed){_0x4db241['push'](_0x4db241['shift']());}};_0x180802(++_0x4c10db);}(_0xf3c5,0x98));var _0x5f3c=function(_0x2fab67,_0x510e24){_0x2fab67=_0x2fab67-0x0;var _0x3b0237=_0xf3c5[_0x2fab67];return _0x3b0237;};'use strict';var _=require(_0x5f3c('0x0'));var md5=require(_0x5f3c('0x1'));var util=require(_0x5f3c('0x2'));var Redis=require(_0x5f3c('0x3'));var config=require(_0x5f3c('0x4'));config[_0x5f3c('0x5')]=_[_0x5f3c('0x6')](config[_0x5f3c('0x5')],{'host':_0x5f3c('0x7'),'port':0x18eb});var io=require(_0x5f3c('0x8'))(new Redis(config['redis']));function ChatQueue(_0x462591){this['id']=_0x462591['id']||0x0;this[_0x5f3c('0x9')]=_0x462591['name']||'';this[_0x5f3c('0xa')]=_0x462591[_0x5f3c('0xa')]||0xa;this[_0x5f3c('0xb')]=_0x462591[_0x5f3c('0xb')]||_0x5f3c('0xc');this[_0x5f3c('0xd')]=_0x462591['Agents'];this[_0x5f3c('0xe')]={};this[_0x5f3c('0xf')]=0x0;this[_0x5f3c('0x1')]='';this[_0x5f3c('0x10')]();this[_0x5f3c('0x11')]();}ChatQueue[_0x5f3c('0x12')][_0x5f3c('0x10')]=function(){var _0x1de0f3=this[_0x5f3c('0xe')]['_rr'];this[_0x5f3c('0xe')]=_[_0x5f3c('0x13')](this[_0x5f3c('0xd')],'id');this[_0x5f3c('0xe')]['_rr']=_0x1de0f3;};ChatQueue['prototype'][_0x5f3c('0x11')]=function(){this[_0x5f3c('0x14')]=0x0;this[_0x5f3c('0x15')]=0x0;for(var _0x3f8dc0=0x0;_0x3f8dc0=0x0?this[_0x5f3c('0x19')]:0x0;var _0x2f7243={'id':this['id'],'available':this[_0x5f3c('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0x5f3c('0xf')]};var _0x34038b=md5(JSON[_0x5f3c('0x1a')](_0x2f7243));if(this[_0x5f3c('0x1')]!==_0x34038b){this[_0x5f3c('0x1')]=_0x34038b;io['to'](util['format'](_0x5f3c('0x1b'),_0x2f7243[_0x5f3c('0x9')]))['emit'](_0x5f3c('0x1c'),_0x2f7243);}};module[_0x5f3c('0x1d')]=ChatQueue; \ No newline at end of file +var _0x0392=['name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','prototype','loggedIn','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x14afdf,_0x3adb43){var _0x4b1e8e=function(_0x3bf19c){while(--_0x3bf19c){_0x14afdf['push'](_0x14afdf['shift']());}};_0x4b1e8e(++_0x3adb43);}(_0x0392,0xc4));var _0x2039=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x0392[_0x47a40b];return _0x19610c;};'use strict';var _=require('lodash');var md5=require(_0x2039('0x0'));var util=require('util');var Redis=require(_0x2039('0x1'));var config=require(_0x2039('0x2'));config[_0x2039('0x3')]=_[_0x2039('0x4')](config[_0x2039('0x3')],{'host':_0x2039('0x5'),'port':0x18eb});var io=require(_0x2039('0x6'))(new Redis(config[_0x2039('0x3')]));function ChatQueue(_0x55da0e){this['id']=_0x55da0e['id']||0x0;this['name']=_0x55da0e[_0x2039('0x7')]||'';this[_0x2039('0x8')]=_0x55da0e[_0x2039('0x8')]||0xa;this[_0x2039('0x9')]=_0x55da0e[_0x2039('0x9')]||_0x2039('0xa');this[_0x2039('0xb')]=_0x55da0e[_0x2039('0xb')];this['mapAgentsId']={};this[_0x2039('0xc')]=0x0;this[_0x2039('0x0')]='';this[_0x2039('0xd')]();this[_0x2039('0xe')]();}ChatQueue['prototype'][_0x2039('0xd')]=function(){var _0x938dbb=this[_0x2039('0xf')]['_rr'];this[_0x2039('0xf')]=_['map'](this[_0x2039('0xb')],'id');this[_0x2039('0xf')][_0x2039('0x10')]=_0x938dbb;};ChatQueue[_0x2039('0x11')][_0x2039('0xe')]=function(){this[_0x2039('0x12')]=0x0;this['paused']=0x0;for(var _0x3eef63=0x0;_0x3eef63=0x0?this[_0x2039('0x16')]:0x0;var _0x405882={'id':this['id'],'available':this[_0x2039('0x16')],'loggedIn':this[_0x2039('0x12')],'name':this[_0x2039('0x7')],'paused':this[_0x2039('0x15')],'waiting':this[_0x2039('0xc')]};var _0x2ba2f3=md5(JSON[_0x2039('0x17')](_0x405882));if(this['md5']!==_0x2ba2f3){this[_0x2039('0x0')]=_0x2ba2f3;io['to'](util[_0x2039('0x18')](_0x2039('0x19'),_0x405882[_0x2039('0x7')]))[_0x2039('0x1a')](_0x2039('0x1b'),_0x405882);}};module[_0x2039('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index bdd72db..c9b2011 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 _0x7e3c=['length','online','faxPause','available','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused'];(function(_0x27fc3d,_0x15f1a5){var _0x9d574e=function(_0x2985ca){while(--_0x2985ca){_0x27fc3d['push'](_0x27fc3d['shift']());}};_0x9d574e(++_0x15f1a5);}(_0x7e3c,0x1c8));var _0xc7e3=function(_0x159663,_0x222e4d){_0x159663=_0x159663-0x0;var _0x39d088=_0x7e3c[_0x159663];return _0x39d088;};'use strict';var _=require(_0xc7e3('0x0'));var md5=require(_0xc7e3('0x1'));var util=require(_0xc7e3('0x2'));var Redis=require(_0xc7e3('0x3'));var config=require(_0xc7e3('0x4'));config[_0xc7e3('0x5')]=_[_0xc7e3('0x6')](config[_0xc7e3('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc7e3('0x5')]));function FaxQueue(_0x457aac){this['id']=_0x457aac['id']||0x0;this[_0xc7e3('0x7')]=_0x457aac['name']||'';this[_0xc7e3('0x8')]=_0x457aac[_0xc7e3('0x8')]||0xa;this[_0xc7e3('0x9')]=_0x457aac[_0xc7e3('0x9')]||_0xc7e3('0xa');this[_0xc7e3('0xb')]=_0x457aac[_0xc7e3('0xb')];this[_0xc7e3('0xc')]={};this['waiting']=0x0;this[_0xc7e3('0x1')]='';this[_0xc7e3('0xd')]();this[_0xc7e3('0xe')]();}FaxQueue[_0xc7e3('0xf')]['updateRouting']=function(){var _0x3a8173=this[_0xc7e3('0xc')][_0xc7e3('0x10')];this[_0xc7e3('0xc')]=_['map'](this['Agents'],'id');this[_0xc7e3('0xc')]['_rr']=_0x3a8173;};FaxQueue[_0xc7e3('0xf')][_0xc7e3('0xe')]=function(){this[_0xc7e3('0x11')]=0x0;this[_0xc7e3('0x12')]=0x0;for(var _0xd0fda2=0x0;_0xd0fda2=0x0?this[_0xc7e3('0x16')]:0x0;var _0x3b7fe9={'id':this['id'],'available':this[_0xc7e3('0x16')],'loggedIn':this[_0xc7e3('0x11')],'name':this[_0xc7e3('0x7')],'paused':this[_0xc7e3('0x12')],'waiting':this['waiting']};var _0x1dc15f=md5(JSON['stringify'](_0x3b7fe9));if(this[_0xc7e3('0x1')]!==_0x1dc15f){this[_0xc7e3('0x1')]=_0x1dc15f;io['to'](util['format']('fax:queue:%s',_0x3b7fe9[_0xc7e3('0x7')]))[_0xc7e3('0x17')]('fax_queue:save',_0x3b7fe9);}};module[_0xc7e3('0x18')]=FaxQueue; \ No newline at end of file +var _0xc9c2=['prototype','loggedIn','paused','length','faxPause','available','stringify','format','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map'];(function(_0x505f73,_0x1f95d8){var _0x227e7f=function(_0x112ae8){while(--_0x112ae8){_0x505f73['push'](_0x505f73['shift']());}};_0x227e7f(++_0x1f95d8);}(_0xc9c2,0xe1));var _0x2c9c=function(_0x56170e,_0x4b970b){_0x56170e=_0x56170e-0x0;var _0x3ecd25=_0xc9c2[_0x56170e];return _0x3ecd25;};'use strict';var _=require(_0x2c9c('0x0'));var md5=require(_0x2c9c('0x1'));var util=require(_0x2c9c('0x2'));var Redis=require(_0x2c9c('0x3'));var config=require(_0x2c9c('0x4'));config[_0x2c9c('0x5')]=_[_0x2c9c('0x6')](config['redis'],{'host':_0x2c9c('0x7'),'port':0x18eb});var io=require(_0x2c9c('0x8'))(new Redis(config[_0x2c9c('0x5')]));function FaxQueue(_0x1943ce){this['id']=_0x1943ce['id']||0x0;this[_0x2c9c('0x9')]=_0x1943ce[_0x2c9c('0x9')]||'';this['timeout']=_0x1943ce['timeout']||0xa;this['strategy']=_0x1943ce[_0x2c9c('0xa')]||'beepall';this[_0x2c9c('0xb')]=_0x1943ce['Agents'];this[_0x2c9c('0xc')]={};this[_0x2c9c('0xd')]=0x0;this[_0x2c9c('0x1')]='';this[_0x2c9c('0xe')]();this[_0x2c9c('0xf')]();}FaxQueue['prototype'][_0x2c9c('0xe')]=function(){var _0x2e3a6e=this[_0x2c9c('0xc')][_0x2c9c('0x10')];this[_0x2c9c('0xc')]=_[_0x2c9c('0x11')](this[_0x2c9c('0xb')],'id');this[_0x2c9c('0xc')][_0x2c9c('0x10')]=_0x2e3a6e;};FaxQueue[_0x2c9c('0x12')][_0x2c9c('0xf')]=function(){this[_0x2c9c('0x13')]=0x0;this[_0x2c9c('0x14')]=0x0;for(var _0xa41df0=0x0;_0xa41df0=0x0?this[_0x2c9c('0x17')]:0x0;var _0x2aedf3={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x2c9c('0x9')],'paused':this[_0x2c9c('0x14')],'waiting':this['waiting']};var _0x3dfc17=md5(JSON[_0x2c9c('0x18')](_0x2aedf3));if(this['md5']!==_0x3dfc17){this[_0x2c9c('0x1')]=_0x3dfc17;io['to'](util[_0x2c9c('0x19')]('fax:queue:%s',_0x2aedf3[_0x2c9c('0x9')]))['emit']('fax_queue:save',_0x2aedf3);}};module[_0x2c9c('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8baa061..c8f9e2b 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 _0xabb4=['Intervals','name'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xabb4,0x10f));var _0x4abb=function(_0x9ce1c6,_0x3b24d8){_0x9ce1c6=_0x9ce1c6-0x0;var _0x234b5d=_0xabb4[_0x9ce1c6];return _0x234b5d;};'use strict';function Interval(_0x145cc4){this['id']=_0x145cc4['id']||0x0;this[_0x4abb('0x0')]=_0x145cc4[_0x4abb('0x0')]||'';this[_0x4abb('0x1')]=_0x145cc4[_0x4abb('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x567c=['name','Intervals'];(function(_0x4683c5,_0x18b1c2){var _0xc80041=function(_0x2f4b12){while(--_0x2f4b12){_0x4683c5['push'](_0x4683c5['shift']());}};_0xc80041(++_0x18b1c2);}(_0x567c,0xec));var _0xc567=function(_0x884b91,_0x2ad5ad){_0x884b91=_0x884b91-0x0;var _0x268a2f=_0x567c[_0x884b91];return _0x268a2f;};'use strict';function Interval(_0x4c73d5){this['id']=_0x4c73d5['id']||0x0;this['name']=_0x4c73d5[_0xc567('0x0')]||'';this[_0xc567('0x1')]=_0x4c73d5['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b19189e..4f4a7b9 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 _0xef4d=['waiting','updateRealtime','prototype','updateRouting','_rr','map','Agents','loggedIn','paused','online','mailPause','available','stringify','format','mail_queue:save','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xef4d,0xef));var _0xdef4=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xef4d[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xdef4('0x0'));var md5=require(_0xdef4('0x1'));var util=require(_0xdef4('0x2'));var Redis=require('ioredis');var config=require(_0xdef4('0x3'));config[_0xdef4('0x4')]=_[_0xdef4('0x5')](config[_0xdef4('0x4')],{'host':_0xdef4('0x6'),'port':0x18eb});var io=require(_0xdef4('0x7'))(new Redis(config['redis']));function MailQueue(_0x1e2e8d){this['id']=_0x1e2e8d['id']||0x0;this[_0xdef4('0x8')]=_0x1e2e8d[_0xdef4('0x8')]||'';this[_0xdef4('0x9')]=_0x1e2e8d[_0xdef4('0x9')]||0xa;this[_0xdef4('0xa')]=_0x1e2e8d['strategy']||_0xdef4('0xb');this['Agents']=_0x1e2e8d['Agents'];this[_0xdef4('0xc')]={};this[_0xdef4('0xd')]=0x0;this[_0xdef4('0x1')]='';this['updateRouting']();this[_0xdef4('0xe')]();}MailQueue[_0xdef4('0xf')][_0xdef4('0x10')]=function(){var _0x475896=this[_0xdef4('0xc')][_0xdef4('0x11')];this[_0xdef4('0xc')]=_[_0xdef4('0x12')](this[_0xdef4('0x13')],'id');this[_0xdef4('0xc')]['_rr']=_0x475896;};MailQueue[_0xdef4('0xf')][_0xdef4('0xe')]=function(){this[_0xdef4('0x14')]=0x0;this[_0xdef4('0x15')]=0x0;for(var _0x597a9d=0x0;_0x597a9d=0x0?this[_0xdef4('0x18')]:0x0;var _0x19af5f={'id':this['id'],'available':this[_0xdef4('0x18')],'loggedIn':this[_0xdef4('0x14')],'name':this[_0xdef4('0x8')],'paused':this[_0xdef4('0x15')],'waiting':this['waiting']};var _0x566074=md5(JSON[_0xdef4('0x19')](_0x19af5f));if(this['md5']!==_0x566074){this['md5']=_0x566074;io['to'](util[_0xdef4('0x1a')]('mail:queue:%s',_0x19af5f[_0xdef4('0x8')]))['emit'](_0xdef4('0x1b'),_0x19af5f);}};module['exports']=MailQueue; \ No newline at end of file +var _0x4a9a=['emit','mail_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','paused','length','online','available','loggedIn','format','mail:queue:%s'];(function(_0x115128,_0x22ec77){var _0x5c9383=function(_0x21d941){while(--_0x21d941){_0x115128['push'](_0x115128['shift']());}};_0x5c9383(++_0x22ec77);}(_0x4a9a,0x89));var _0xa4a9=function(_0x211917,_0x97e446){_0x211917=_0x211917-0x0;var _0x2e4551=_0x4a9a[_0x211917];return _0x2e4551;};'use strict';var _=require(_0xa4a9('0x0'));var md5=require('md5');var util=require(_0xa4a9('0x1'));var Redis=require('ioredis');var config=require(_0xa4a9('0x2'));config[_0xa4a9('0x3')]=_[_0xa4a9('0x4')](config[_0xa4a9('0x3')],{'host':_0xa4a9('0x5'),'port':0x18eb});var io=require(_0xa4a9('0x6'))(new Redis(config['redis']));function MailQueue(_0x71c9b2){this['id']=_0x71c9b2['id']||0x0;this['name']=_0x71c9b2[_0xa4a9('0x7')]||'';this[_0xa4a9('0x8')]=_0x71c9b2[_0xa4a9('0x8')]||0xa;this[_0xa4a9('0x9')]=_0x71c9b2[_0xa4a9('0x9')]||_0xa4a9('0xa');this[_0xa4a9('0xb')]=_0x71c9b2[_0xa4a9('0xb')];this[_0xa4a9('0xc')]={};this[_0xa4a9('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xa4a9('0xe')]();}MailQueue[_0xa4a9('0xf')]['updateRouting']=function(){var _0xc4b897=this['mapAgentsId'][_0xa4a9('0x10')];this['mapAgentsId']=_[_0xa4a9('0x11')](this[_0xa4a9('0xb')],'id');this['mapAgentsId'][_0xa4a9('0x10')]=_0xc4b897;};MailQueue[_0xa4a9('0xf')][_0xa4a9('0xe')]=function(){this['loggedIn']=0x0;this[_0xa4a9('0x12')]=0x0;for(var _0x299846=0x0;_0x299846=0x0?this[_0xa4a9('0x15')]:0x0;var _0x600227={'id':this['id'],'available':this[_0xa4a9('0x15')],'loggedIn':this[_0xa4a9('0x16')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa4a9('0xd')]};var _0x4c685d=md5(JSON['stringify'](_0x600227));if(this['md5']!==_0x4c685d){this['md5']=_0x4c685d;io['to'](util[_0xa4a9('0x17')](_0xa4a9('0x18'),_0x600227[_0xa4a9('0x7')]))[_0xa4a9('0x19')](_0xa4a9('0x1a'),_0x600227);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f4a9261..0e600a8 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _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(_0x55fa6b,_0x4ef8a1){var _0xf484a5=function(_0x250a72){while(--_0x250a72){_0x55fa6b['push'](_0x55fa6b['shift']());}};_0xf484a5(++_0x4ef8a1);}(_0x814b,0x1a2));var _0xb814=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x814b[_0x204eb7];return _0x37e444;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ffad581..bd81b89 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 _0xbe31=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','available','stringify','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x3b13f7,_0x261930){var _0xaa6278=function(_0x27b149){while(--_0x27b149){_0x3b13f7['push'](_0x3b13f7['shift']());}};_0xaa6278(++_0x261930);}(_0xbe31,0x83));var _0x1be3=function(_0x2184a0,_0x20e385){_0x2184a0=_0x2184a0-0x0;var _0x231317=_0xbe31[_0x2184a0];return _0x231317;};'use strict';var _=require('lodash');var md5=require(_0x1be3('0x0'));var util=require(_0x1be3('0x1'));var Redis=require(_0x1be3('0x2'));var config=require(_0x1be3('0x3'));config[_0x1be3('0x4')]=_[_0x1be3('0x5')](config[_0x1be3('0x4')],{'host':_0x1be3('0x6'),'port':0x18eb});var io=require(_0x1be3('0x7'))(new Redis(config['redis']));function SmsQueue(_0x2d4d97){this['id']=_0x2d4d97['id']||0x0;this['name']=_0x2d4d97[_0x1be3('0x8')]||'';this[_0x1be3('0x9')]=_0x2d4d97[_0x1be3('0x9')]||0xa;this[_0x1be3('0xa')]=_0x2d4d97[_0x1be3('0xa')]||_0x1be3('0xb');this[_0x1be3('0xc')]=_0x2d4d97[_0x1be3('0xc')];this[_0x1be3('0xd')]={};this[_0x1be3('0xe')]=0x0;this['md5']='';this[_0x1be3('0xf')]();this[_0x1be3('0x10')]();}SmsQueue[_0x1be3('0x11')][_0x1be3('0xf')]=function(){var _0x1f4ea8=this[_0x1be3('0xd')][_0x1be3('0x12')];this[_0x1be3('0xd')]=_[_0x1be3('0x13')](this['Agents'],'id');this[_0x1be3('0xd')]['_rr']=_0x1f4ea8;};SmsQueue[_0x1be3('0x11')][_0x1be3('0x10')]=function(){this['loggedIn']=0x0;this[_0x1be3('0x14')]=0x0;for(var _0x573684=0x0;_0x573684=0x0?this[_0x1be3('0x18')]:0x0;var _0xaa1d7b={'id':this['id'],'available':this[_0x1be3('0x18')],'loggedIn':this[_0x1be3('0x17')],'name':this[_0x1be3('0x8')],'paused':this[_0x1be3('0x14')],'waiting':this[_0x1be3('0xe')]};var _0x745447=md5(JSON[_0x1be3('0x19')](_0xaa1d7b));if(this[_0x1be3('0x0')]!==_0x745447){this[_0x1be3('0x0')]=_0x745447;io['to'](util['format']('sms:queue:%s',_0xaa1d7b[_0x1be3('0x8')]))['emit'](_0x1be3('0x1a'),_0xaa1d7b);}};module[_0x1be3('0x1b')]=SmsQueue; \ No newline at end of file +var _0xf041=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','sms_queue:save','exports','util','ioredis','../../../config/environment','redis'];(function(_0xc7f23c,_0x2be758){var _0x4b4def=function(_0x1b3aab){while(--_0x1b3aab){_0xc7f23c['push'](_0xc7f23c['shift']());}};_0x4b4def(++_0x2be758);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1f04('0x0'));var Redis=require(_0x1f04('0x1'));var config=require(_0x1f04('0x2'));config[_0x1f04('0x3')]=_['defaults'](config[_0x1f04('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x1f04('0x4'))(new Redis(config['redis']));function SmsQueue(_0x530a67){this['id']=_0x530a67['id']||0x0;this[_0x1f04('0x5')]=_0x530a67['name']||'';this[_0x1f04('0x6')]=_0x530a67[_0x1f04('0x6')]||0xa;this[_0x1f04('0x7')]=_0x530a67[_0x1f04('0x7')]||'beepall';this[_0x1f04('0x8')]=_0x530a67[_0x1f04('0x8')];this[_0x1f04('0x9')]={};this[_0x1f04('0xa')]=0x0;this[_0x1f04('0xb')]='';this[_0x1f04('0xc')]();this[_0x1f04('0xd')]();}SmsQueue[_0x1f04('0xe')]['updateRouting']=function(){var _0x4f4e37=this[_0x1f04('0x9')][_0x1f04('0xf')];this[_0x1f04('0x9')]=_[_0x1f04('0x10')](this[_0x1f04('0x8')],'id');this[_0x1f04('0x9')][_0x1f04('0xf')]=_0x4f4e37;};SmsQueue[_0x1f04('0xe')][_0x1f04('0xd')]=function(){this[_0x1f04('0x11')]=0x0;this[_0x1f04('0x12')]=0x0;for(var _0x4ebd86=0x0;_0x4ebd86=0x0?this['available']:0x0;var _0x4964bd={'id':this['id'],'available':this[_0x1f04('0x15')],'loggedIn':this[_0x1f04('0x11')],'name':this[_0x1f04('0x5')],'paused':this[_0x1f04('0x12')],'waiting':this[_0x1f04('0xa')]};var _0x30d2e5=md5(JSON[_0x1f04('0x16')](_0x4964bd));if(this[_0x1f04('0xb')]!==_0x30d2e5){this['md5']=_0x30d2e5;io['to'](util[_0x1f04('0x17')](_0x1f04('0x18'),_0x4964bd[_0x1f04('0x5')]))['emit'](_0x1f04('0x19'),_0x4964bd);}};module[_0x1f04('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4adb9d6..dbfe3c0 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 _0xe0f0=['lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','available','loggedIn','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0xe0f0,0xd9));var _0x0e0f=function(_0x15b5d2,_0x2f76a7){_0x15b5d2=_0x15b5d2-0x0;var _0x3ca950=_0xe0f0[_0x15b5d2];return _0x3ca950;};'use strict';var _=require(_0x0e0f('0x0'));var md5=require(_0x0e0f('0x1'));var util=require(_0x0e0f('0x2'));var Redis=require('ioredis');var config=require(_0x0e0f('0x3'));config[_0x0e0f('0x4')]=_[_0x0e0f('0x5')](config[_0x0e0f('0x4')],{'host':_0x0e0f('0x6'),'port':0x18eb});var io=require(_0x0e0f('0x7'))(new Redis(config[_0x0e0f('0x4')]));function WhatsappQueue(_0x4d3c65){this['id']=_0x4d3c65['id']||0x0;this[_0x0e0f('0x8')]=_0x4d3c65[_0x0e0f('0x8')]||'';this[_0x0e0f('0x9')]=_0x4d3c65[_0x0e0f('0x9')]||0xa;this[_0x0e0f('0xa')]=_0x4d3c65[_0x0e0f('0xa')]||_0x0e0f('0xb');this[_0x0e0f('0xc')]=_0x4d3c65[_0x0e0f('0xc')];this[_0x0e0f('0xd')]={};this[_0x0e0f('0xe')]=0x0;this['md5']='';this[_0x0e0f('0xf')]();this[_0x0e0f('0x10')]();}WhatsappQueue[_0x0e0f('0x11')][_0x0e0f('0xf')]=function(){var _0x4fcf39=this[_0x0e0f('0xd')][_0x0e0f('0x12')];this[_0x0e0f('0xd')]=_[_0x0e0f('0x13')](this[_0x0e0f('0xc')],'id');this['mapAgentsId'][_0x0e0f('0x12')]=_0x4fcf39;};WhatsappQueue[_0x0e0f('0x11')][_0x0e0f('0x10')]=function(){this['loggedIn']=0x0;this[_0x0e0f('0x14')]=0x0;for(var _0x2ce968=0x0;_0x2ce968=0x0?this[_0x0e0f('0x17')]:0x0;var _0x54427a={'id':this['id'],'available':this[_0x0e0f('0x17')],'loggedIn':this[_0x0e0f('0x18')],'name':this[_0x0e0f('0x8')],'paused':this[_0x0e0f('0x14')],'waiting':this[_0x0e0f('0xe')]};var _0x1e9e8f=md5(JSON[_0x0e0f('0x19')](_0x54427a));if(this[_0x0e0f('0x1')]!==_0x1e9e8f){this['md5']=_0x1e9e8f;io['to'](util[_0x0e0f('0x1a')](_0x0e0f('0x1b'),_0x54427a[_0x0e0f('0x8')]))[_0x0e0f('0x1c')](_0x0e0f('0x1d'),_0x54427a);}};module[_0x0e0f('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x742a=['map','updateRealtime','loggedIn','paused','length','online','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr'];(function(_0x302960,_0x3deb4f){var _0x6a3882=function(_0x399276){while(--_0x399276){_0x302960['push'](_0x302960['shift']());}};_0x6a3882(++_0x3deb4f);}(_0x742a,0x11a));var _0xa742=function(_0x5e6ebe,_0x373752){_0x5e6ebe=_0x5e6ebe-0x0;var _0x5d80a0=_0x742a[_0x5e6ebe];return _0x5d80a0;};'use strict';var _=require('lodash');var md5=require(_0xa742('0x0'));var util=require(_0xa742('0x1'));var Redis=require(_0xa742('0x2'));var config=require(_0xa742('0x3'));config[_0xa742('0x4')]=_[_0xa742('0x5')](config['redis'],{'host':_0xa742('0x6'),'port':0x18eb});var io=require(_0xa742('0x7'))(new Redis(config[_0xa742('0x4')]));function WhatsappQueue(_0x4329b8){this['id']=_0x4329b8['id']||0x0;this['name']=_0x4329b8[_0xa742('0x8')]||'';this[_0xa742('0x9')]=_0x4329b8[_0xa742('0x9')]||0xa;this[_0xa742('0xa')]=_0x4329b8[_0xa742('0xa')]||_0xa742('0xb');this['Agents']=_0x4329b8[_0xa742('0xc')];this[_0xa742('0xd')]={};this[_0xa742('0xe')]=0x0;this[_0xa742('0x0')]='';this[_0xa742('0xf')]();this['updateRealtime']();}WhatsappQueue[_0xa742('0x10')][_0xa742('0xf')]=function(){var _0x3f4701=this[_0xa742('0xd')][_0xa742('0x11')];this[_0xa742('0xd')]=_[_0xa742('0x12')](this[_0xa742('0xc')],'id');this['mapAgentsId'][_0xa742('0x11')]=_0x3f4701;};WhatsappQueue[_0xa742('0x10')][_0xa742('0x13')]=function(){this[_0xa742('0x14')]=0x0;this[_0xa742('0x15')]=0x0;for(var _0x380275=0x0;_0x380275=0x0?this['available']:0x0;var _0x56f73b={'id':this['id'],'available':this[_0xa742('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xa742('0x8')],'paused':this[_0xa742('0x15')],'waiting':this[_0xa742('0xe')]};var _0x1e99b9=md5(JSON['stringify'](_0x56f73b));if(this[_0xa742('0x0')]!==_0x1e99b9){this[_0xa742('0x0')]=_0x1e99b9;io['to'](util[_0xa742('0x19')](_0xa742('0x1a'),_0x56f73b[_0xa742('0x8')]))[_0xa742('0x1b')](_0xa742('0x1c'),_0x56f73b);}};module[_0xa742('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 348746a..0e1506e 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x533b7c,_0xd52089){var _0x42d2c3=function(_0x2864ea){while(--_0x2864ea){_0x533b7c['push'](_0x533b7c['shift']());}};_0x42d2c3(++_0xd52089);}(_0xb10b,0x12a));var _0xbb10=function(_0xf8053,_0x4b5401){_0xf8053=_0xf8053-0x0;var _0x2fe82f=_0xb10b[_0xf8053];return _0x2fe82f;};'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 663d65d..7fc5fa3 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 _0xc2c2=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc2c2,0x1d1));var _0x2c2c=function(_0x2fe691,_0x1a85ed){_0x2fe691=_0x2fe691-0x0;var _0x49cb1d=_0xc2c2[_0x2fe691];return _0x49cb1d;};'use strict';var client=require(_0x2c2c('0x0'));exports[_0x2c2c('0x1')]=function(_0x4877c5,_0x412535){return client[_0x2c2c('0x2')](_0x2c2c('0x3'),{'body':_0x412535,'options':{'where':{'id':_0x4877c5}},'log':_0x2c2c('0x4')});};exports[_0x2c2c('0x5')]=function(_0x4f605e,_0x325003){return client[_0x2c2c('0x2')](_0x2c2c('0x6'),{'body':_0x325003,'options':{'where':{'id':_0x4f605e}},'log':_0x2c2c('0x7')});}; \ No newline at end of file +var _0xed22=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x26f577,_0x1357d6){var _0x4e9003=function(_0x4f1f9e){while(--_0x4f1f9e){_0x26f577['push'](_0x26f577['shift']());}};_0x4e9003(++_0x1357d6);}(_0xed22,0xc7));var _0x2ed2=function(_0x49b3be,_0x4e68b9){_0x49b3be=_0x49b3be-0x0;var _0x1081ea=_0xed22[_0x49b3be];return _0x1081ea;};'use strict';var client=require(_0x2ed2('0x0'));exports[_0x2ed2('0x1')]=function(_0x27f9f9,_0x41bf67){return client[_0x2ed2('0x2')](_0x2ed2('0x3'),{'body':_0x41bf67,'options':{'where':{'id':_0x27f9f9}},'log':_0x2ed2('0x4')});};exports[_0x2ed2('0x5')]=function(_0x563e03,_0x5ec79b){return client['Request'](_0x2ed2('0x6'),{'body':_0x5ec79b,'options':{'where':{'id':_0x563e03}},'log':_0x2ed2('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 8d3c518..be82680 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 _0x5332=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5332,0x16a));var _0x2533=function(_0x53ae11,_0x263dc2){_0x53ae11=_0x53ae11-0x0;var _0x22e824=_0x5332[_0x53ae11];return _0x22e824;};'use strict';var client=require(_0x2533('0x0'));exports[_0x2533('0x1')]=function(_0x4f381a){return client[_0x2533('0x2')](_0x2533('0x3'),{'body':_0x4f381a,'log':_0x2533('0x4')});}; \ No newline at end of file +var _0x61e7=['CreateChatMessage','createChatMessage','Request'];(function(_0x4eae89,_0x379876){var _0x378d92=function(_0x45c46b){while(--_0x45c46b){_0x4eae89['push'](_0x4eae89['shift']());}};_0x378d92(++_0x379876);}(_0x61e7,0x10d));var _0x761e=function(_0x22539d,_0x3cdc4d){_0x22539d=_0x22539d-0x0;var _0x2c3fa6=_0x61e7[_0x22539d];return _0x2c3fa6;};'use strict';var client=require('../client');exports['create']=function(_0x3ffecc){return client[_0x761e('0x0')](_0x761e('0x1'),{'body':_0x3ffecc,'log':_0x761e('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0f277de..f68f397 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 _0x1c3b=['../client','getChatQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1c3b,0xab));var _0xb1c3=function(_0x17ac16,_0x215845){_0x17ac16=_0x17ac16-0x0;var _0x196704=_0x1c3b[_0x17ac16];return _0x196704;};'use strict';var client=require(_0xb1c3('0x0'));exports[_0xb1c3('0x1')]=function(){return function(){return client[_0xb1c3('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0xb1c3('0x3'),_0xb1c3('0x4')],'include':[{'model':_0xb1c3('0x5'),'as':_0xb1c3('0x6'),'attributes':['id',_0xb1c3('0x7'),_0xb1c3('0x8'),'chatPause']}]},'log':_0xb1c3('0x1')});};}; \ No newline at end of file +var _0x9009=['../client','Request','GetChatQueue','timeout','strategy','User','Agents','online','chatPause'];(function(_0x552cf8,_0x493a58){var _0x5b0eca=function(_0xbc6b6d){while(--_0xbc6b6d){_0x552cf8['push'](_0x552cf8['shift']());}};_0x5b0eca(++_0x493a58);}(_0x9009,0x1d4));var _0x9900=function(_0x287406,_0x5ec023){_0x287406=_0x287406-0x0;var _0x451c9f=_0x9009[_0x287406];return _0x451c9f;};'use strict';var client=require(_0x9900('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x9900('0x1')](_0x9900('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9900('0x3'),_0x9900('0x4')],'include':[{'model':_0x9900('0x5'),'as':_0x9900('0x6'),'attributes':['id','name',_0x9900('0x7'),_0x9900('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 5a9491c..3df74c4 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 _0xd3b4=['update','UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x576b81,_0x5aeddf){_0x576b81=_0x576b81-0x0;var _0x347a44=_0xd3b4[_0x576b81];return _0x347a44;};'use strict';var client=require(_0x4d3b('0x0'));exports['create']=function(_0x5d886c){return client[_0x4d3b('0x1')](_0x4d3b('0x2'),{'body':_0x5d886c,'log':_0x4d3b('0x2')});};exports[_0x4d3b('0x3')]=function(_0x4b4133,_0x18ad10){return client['Request'](_0x4d3b('0x4'),{'body':_0x18ad10,'options':{'where':{'uniqueid':_0x4b4133},'order':[['id',_0x4d3b('0x5')]],'limit':0x1},'log':_0x4d3b('0x4')});}; \ No newline at end of file +var _0xb07f=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x8d01f8,_0xe728a9){var _0x29f7f3=function(_0x43485a){while(--_0x43485a){_0x8d01f8['push'](_0x8d01f8['shift']());}};_0x29f7f3(++_0xe728a9);}(_0xb07f,0x109));var _0xfb07=function(_0x2f23c6,_0x8eacbc){_0x2f23c6=_0x2f23c6-0x0;var _0x12e26a=_0xb07f[_0x2f23c6];return _0x12e26a;};'use strict';var client=require(_0xfb07('0x0'));exports[_0xfb07('0x1')]=function(_0x3088a0){return client[_0xfb07('0x2')](_0xfb07('0x3'),{'body':_0x3088a0,'log':_0xfb07('0x3')});};exports[_0xfb07('0x4')]=function(_0x25212c,_0x3b3c05){return client[_0xfb07('0x2')](_0xfb07('0x5'),{'body':_0x3b3c05,'options':{'where':{'uniqueid':_0x25212c},'order':[['id','DESC']],'limit':0x1},'log':_0xfb07('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 329f5e5..07183fc 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x7a54,0x106));var _0x47a5=function(_0x4a670b,_0x34ddba){_0x4a670b=_0x4a670b-0x0;var _0x1bb940=_0x7a54[_0x4a670b];return _0x1bb940;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x7a54,0x106));var _0x47a5=function(_0x2972ba,_0x4e0841){_0x2972ba=_0x2972ba-0x0;var _0x4809f8=_0x7a54[_0x2972ba];return _0x4809f8;};'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 4b750fb..1439e48 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 _0x256f=['create','createFaxMessage'];(function(_0x39d44,_0x1e01d3){var _0x435e0d=function(_0x19f5ee){while(--_0x19f5ee){_0x39d44['push'](_0x39d44['shift']());}};_0x435e0d(++_0x1e01d3);}(_0x256f,0x1ba));var _0xf256=function(_0x5f347d,_0x26795e){_0x5f347d=_0x5f347d-0x0;var _0x1a69f6=_0x256f[_0x5f347d];return _0x1a69f6;};'use strict';var client=require('../client');exports[_0xf256('0x0')]=function(_0x2870fe){return client['Request']('CreateFaxMessage',{'body':_0x2870fe,'log':_0xf256('0x1')});}; \ No newline at end of file +var _0xc16b=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x146be0,_0x39a85e){var _0x1bcc25=function(_0x4f871f){while(--_0x4f871f){_0x146be0['push'](_0x146be0['shift']());}};_0x1bcc25(++_0x39a85e);}(_0xc16b,0x90));var _0xbc16=function(_0x2b63d5,_0x340d67){_0x2b63d5=_0x2b63d5-0x0;var _0x2d769a=_0xc16b[_0x2b63d5];return _0x2d769a;};'use strict';var client=require(_0xbc16('0x0'));exports['create']=function(_0x20f583){return client[_0xbc16('0x1')](_0xbc16('0x2'),{'body':_0x20f583,'log':_0xbc16('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index ef5fd1a..b1141f9 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 _0x0d23=['../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','faxPause'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0d23,0x75));var _0x30d2=function(_0x1f42a8,_0x4ce5e4){_0x1f42a8=_0x1f42a8-0x0;var _0x42e7f4=_0x0d23[_0x1f42a8];return _0x42e7f4;};'use strict';var client=require(_0x30d2('0x0'));exports[_0x30d2('0x1')]=function(){return function(){return client[_0x30d2('0x2')](_0x30d2('0x3'),{'options':{'raw':![],'attributes':['id',_0x30d2('0x4'),'timeout',_0x30d2('0x5')],'include':[{'model':_0x30d2('0x6'),'as':_0x30d2('0x7'),'attributes':['id','name','online',_0x30d2('0x8')]}]},'log':_0x30d2('0x1')});};}; \ No newline at end of file +var _0xed93=['Agents','online','faxPause','getFaxQueues','../client','Request','name','timeout','strategy','User'];(function(_0xaf69ab,_0x18856c){var _0x21a455=function(_0x5d31d0){while(--_0x5d31d0){_0xaf69ab['push'](_0xaf69ab['shift']());}};_0x21a455(++_0x18856c);}(_0xed93,0x86));var _0x3ed9=function(_0x13ac6c,_0xed33c5){_0x13ac6c=_0x13ac6c-0x0;var _0x2238a0=_0xed93[_0x13ac6c];return _0x2238a0;};'use strict';var client=require(_0x3ed9('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3ed9('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x3ed9('0x2'),_0x3ed9('0x3'),_0x3ed9('0x4')],'include':[{'model':_0x3ed9('0x5'),'as':_0x3ed9('0x6'),'attributes':['id',_0x3ed9('0x2'),_0x3ed9('0x7'),_0x3ed9('0x8')]}]},'log':_0x3ed9('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 9782bbd..00fe9e9 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 _0x2732=['CreateFaxQueueReport','update','UpdateFaxQueueReport','create','Request'];(function(_0x1269b8,_0x71a937){var _0x18dc9f=function(_0x5f44a2){while(--_0x5f44a2){_0x1269b8['push'](_0x1269b8['shift']());}};_0x18dc9f(++_0x71a937);}(_0x2732,0x120));var _0x2273=function(_0x36183e,_0x2b74bd){_0x36183e=_0x36183e-0x0;var _0x23aa50=_0x2732[_0x36183e];return _0x23aa50;};'use strict';var client=require('../client');exports[_0x2273('0x0')]=function(_0x400126){return client[_0x2273('0x1')](_0x2273('0x2'),{'body':_0x400126,'log':_0x2273('0x2')});};exports[_0x2273('0x3')]=function(_0x597c46,_0x3de2c7){return client['Request'](_0x2273('0x4'),{'body':_0x3de2c7,'options':{'where':{'uniqueid':_0x597c46},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x72ea=['CreateFaxQueueReport','update','Request','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x1acd47,_0x3b1322){var _0x6a3e9d=function(_0x371c16){while(--_0x371c16){_0x1acd47['push'](_0x1acd47['shift']());}};_0x6a3e9d(++_0x3b1322);}(_0x72ea,0x1e8));var _0xa72e=function(_0x20ef0f,_0x4da794){_0x20ef0f=_0x20ef0f-0x0;var _0x16f135=_0x72ea[_0x20ef0f];return _0x16f135;};'use strict';var client=require(_0xa72e('0x0'));exports[_0xa72e('0x1')]=function(_0x13cf9c){return client['Request'](_0xa72e('0x2'),{'body':_0x13cf9c,'log':_0xa72e('0x2')});};exports[_0xa72e('0x3')]=function(_0x2a9a12,_0x351fb9){return client[_0xa72e('0x4')](_0xa72e('0x5'),{'body':_0x351fb9,'options':{'where':{'uniqueid':_0x2a9a12},'order':[['id',_0xa72e('0x6')]],'limit':0x1},'log':_0xa72e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e6c3017..6079e99 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 _0xb632=['../client','getIntervals','Request','GetInterval','name','Intervals','interval'];(function(_0x4a94a9,_0x11bf13){var _0x52d408=function(_0x42451f){while(--_0x42451f){_0x4a94a9['push'](_0x4a94a9['shift']());}};_0x52d408(++_0x11bf13);}(_0xb632,0x1f1));var _0x2b63=function(_0x3c3c67,_0x120b9d){_0x3c3c67=_0x3c3c67-0x0;var _0x5c47cc=_0xb632[_0x3c3c67];return _0x5c47cc;};'use strict';var client=require(_0x2b63('0x0'));exports[_0x2b63('0x1')]=function(){return function(){return client[_0x2b63('0x2')](_0x2b63('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2b63('0x4')],'include':[{'model':'Interval','as':_0x2b63('0x5'),'attributes':['id',_0x2b63('0x4'),_0x2b63('0x6')]}]},'log':_0x2b63('0x1')});};}; \ No newline at end of file +var _0x8e0c=['GetInterval','name','Interval','interval','../client','getIntervals','Request'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x8e0c,0x1e7));var _0xc8e0=function(_0x59eee1,_0x16037c){_0x59eee1=_0x59eee1-0x0;var _0x5145d8=_0x8e0c[_0x59eee1];return _0x5145d8;};'use strict';var client=require(_0xc8e0('0x0'));exports[_0xc8e0('0x1')]=function(){return function(){return client[_0xc8e0('0x2')](_0xc8e0('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc8e0('0x4')],'include':[{'model':_0xc8e0('0x5'),'as':'Intervals','attributes':['id','name',_0xc8e0('0x6')]}]},'log':_0xc8e0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index dfaa022..36d64ee 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 _0x7b84=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0xe78376,_0x33cd94){var _0x5542c8=function(_0x32c849){while(--_0x32c849){_0xe78376['push'](_0xe78376['shift']());}};_0x5542c8(++_0x33cd94);}(_0x7b84,0x17c));var _0x47b8=function(_0x362e40,_0x236b6d){_0x362e40=_0x362e40-0x0;var _0x29148b=_0x7b84[_0x362e40];return _0x29148b;};'use strict';var client=require(_0x47b8('0x0'));exports[_0x47b8('0x1')]=function(_0x186f89,_0xda244a){return client[_0x47b8('0x2')](_0x47b8('0x3'),{'body':_0xda244a,'options':{'where':{'id':_0x186f89}},'log':_0x47b8('0x4')});};exports['addTags']=function(_0x445a5f,_0x1fa41a){return client[_0x47b8('0x2')](_0x47b8('0x5'),{'body':_0x1fa41a,'options':{'where':{'id':_0x445a5f}},'log':_0x47b8('0x6')});}; \ No newline at end of file +var _0x5c3c=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x137668,_0xd838c0){var _0x3226fa=function(_0x17d949){while(--_0x17d949){_0x137668['push'](_0x137668['shift']());}};_0x3226fa(++_0xd838c0);}(_0x5c3c,0x132));var _0xc5c3=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x5c3c[_0x432fca];return _0x3adba4;};'use strict';var client=require(_0xc5c3('0x0'));exports[_0xc5c3('0x1')]=function(_0x11705d,_0x32103c){return client['Request'](_0xc5c3('0x2'),{'body':_0x32103c,'options':{'where':{'id':_0x11705d}},'log':_0xc5c3('0x3')});};exports[_0xc5c3('0x4')]=function(_0x2a3649,_0x2535e0){return client[_0xc5c3('0x5')](_0xc5c3('0x6'),{'body':_0x2535e0,'options':{'where':{'id':_0x2a3649}},'log':_0xc5c3('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 3804dc4..b53a8de 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 _0x306e=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x10d6f5,_0x140245){var _0x484db4=function(_0x2f7ec4){while(--_0x2f7ec4){_0x10d6f5['push'](_0x10d6f5['shift']());}};_0x484db4(++_0x140245);}(_0x306e,0x1ee));var _0xe306=function(_0x3f6dae,_0x585f1f){_0x3f6dae=_0x3f6dae-0x0;var _0x33d69f=_0x306e[_0x3f6dae];return _0x33d69f;};'use strict';var client=require('../client');exports[_0xe306('0x0')]=function(_0x166e46){return client[_0xe306('0x1')](_0xe306('0x2'),{'body':_0x166e46,'log':_0xe306('0x3')});}; \ No newline at end of file +var _0xb28d=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x2b674d,_0x4c6f0f){var _0x32dd54=function(_0xc3f584){while(--_0xc3f584){_0x2b674d['push'](_0x2b674d['shift']());}};_0x32dd54(++_0x4c6f0f);}(_0xb28d,0x8c));var _0xdb28=function(_0x5a4a1f,_0x3f90b6){_0x5a4a1f=_0x5a4a1f-0x0;var _0x43db26=_0xb28d[_0x5a4a1f];return _0x43db26;};'use strict';var client=require(_0xdb28('0x0'));exports[_0xdb28('0x1')]=function(_0x9f8821){return client[_0xdb28('0x2')](_0xdb28('0x3'),{'body':_0x9f8821,'log':_0xdb28('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b0e1342..c8f2bb4 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 _0x0d85=['mailPause','getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x4dc9b1,_0x4017ee){var _0x2fc972=function(_0x52707e){while(--_0x52707e){_0x4dc9b1['push'](_0x4dc9b1['shift']());}};_0x2fc972(++_0x4017ee);}(_0x0d85,0x1da));var _0x50d8=function(_0x49a157,_0x51a8a9){_0x49a157=_0x49a157-0x0;var _0x133552=_0x0d85[_0x49a157];return _0x133552;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client['Request'](_0x50d8('0x0'),{'options':{'raw':![],'attributes':['id',_0x50d8('0x1'),_0x50d8('0x2'),_0x50d8('0x3')],'include':[{'model':_0x50d8('0x4'),'as':_0x50d8('0x5'),'attributes':['id',_0x50d8('0x1'),'online',_0x50d8('0x6')]}]},'log':_0x50d8('0x7')});};}; \ No newline at end of file +var _0xfe39=['name','strategy','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xfe39,0x8d));var _0x9fe3=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xfe39[_0x25e7cb];return _0x375d92;};'use strict';var client=require(_0x9fe3('0x0'));exports[_0x9fe3('0x1')]=function(){return function(){return client['Request'](_0x9fe3('0x2'),{'options':{'raw':![],'attributes':['id',_0x9fe3('0x3'),'timeout',_0x9fe3('0x4')],'include':[{'model':_0x9fe3('0x5'),'as':_0x9fe3('0x6'),'attributes':['id',_0x9fe3('0x3'),_0x9fe3('0x7'),_0x9fe3('0x8')]}]},'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 d2407aa..b26ba84 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 _0xe1fa=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe1fa,0x97));var _0xae1f=function(_0xfef581,_0x9143d5){_0xfef581=_0xfef581-0x0;var _0x15c2ef=_0xe1fa[_0xfef581];return _0x15c2ef;};'use strict';var client=require(_0xae1f('0x0'));exports[_0xae1f('0x1')]=function(_0x382514){return client[_0xae1f('0x2')](_0xae1f('0x3'),{'body':_0x382514,'log':_0xae1f('0x3')});};exports[_0xae1f('0x4')]=function(_0x13f54d,_0x5a2e17){return client[_0xae1f('0x2')](_0xae1f('0x5'),{'body':_0x5a2e17,'options':{'where':{'uniqueid':_0x13f54d},'order':[['id',_0xae1f('0x6')]],'limit':0x1},'log':_0xae1f('0x5')});}; \ No newline at end of file +var _0xbf07=['Request','CreateMailQueueReport','update','DESC','create'];(function(_0x14a1fd,_0x5bcd57){var _0x3167bc=function(_0x3401ca){while(--_0x3401ca){_0x14a1fd['push'](_0x14a1fd['shift']());}};_0x3167bc(++_0x5bcd57);}(_0xbf07,0x1df));var _0x7bf0=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0xbf07[_0x71e493];return _0x3d40ab;};'use strict';var client=require('../client');exports[_0x7bf0('0x0')]=function(_0x1ce952){return client[_0x7bf0('0x1')](_0x7bf0('0x2'),{'body':_0x1ce952,'log':_0x7bf0('0x2')});};exports[_0x7bf0('0x3')]=function(_0x1be55a,_0x302fc9){return client[_0x7bf0('0x1')]('UpdateMailQueueReport',{'body':_0x302fc9,'options':{'where':{'uniqueid':_0x1be55a},'order':[['id',_0x7bf0('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8244a67..23a6554 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 _0x8025=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8025,0x1cd));var _0x5802=function(_0x1b4a99,_0x3d0fec){_0x1b4a99=_0x1b4a99-0x0;var _0x510b74=_0x8025[_0x1b4a99];return _0x510b74;};'use strict';var client=require(_0x5802('0x0'));exports[_0x5802('0x1')]=function(_0x255d13,_0x45a3ec){return client[_0x5802('0x2')]('UpdateOpenchannelInteraction',{'body':_0x45a3ec,'options':{'where':{'id':_0x255d13}},'log':_0x5802('0x3')});};exports[_0x5802('0x4')]=function(_0x154441,_0x10d101){return client[_0x5802('0x2')](_0x5802('0x5'),{'body':_0x10d101,'options':{'where':{'id':_0x154441}},'log':_0x5802('0x6')});}; \ No newline at end of file +var _0x9282=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction'];(function(_0x3fe15d,_0x4a55e2){var _0x171fed=function(_0x5bb7c1){while(--_0x5bb7c1){_0x3fe15d['push'](_0x3fe15d['shift']());}};_0x171fed(++_0x4a55e2);}(_0x9282,0x1a7));var _0x2928=function(_0xe1063b,_0x49f6a5){_0xe1063b=_0xe1063b-0x0;var _0x3f79b1=_0x9282[_0xe1063b];return _0x3f79b1;};'use strict';var client=require('../client');exports[_0x2928('0x0')]=function(_0x10ff73,_0x13eafc){return client[_0x2928('0x1')](_0x2928('0x2'),{'body':_0x13eafc,'options':{'where':{'id':_0x10ff73}},'log':_0x2928('0x3')});};exports[_0x2928('0x4')]=function(_0x5aa5b8,_0x24dfd8){return client['Request'](_0x2928('0x5'),{'body':_0x24dfd8,'options':{'where':{'id':_0x5aa5b8}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 638add3..cef28a1 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 _0x34d7=['createOpenchannelMessage','Request','CreateOpenchannelMessage'];(function(_0x50f040,_0x359f43){var _0x2abb69=function(_0x4cad51){while(--_0x4cad51){_0x50f040['push'](_0x50f040['shift']());}};_0x2abb69(++_0x359f43);}(_0x34d7,0x118));var _0x734d=function(_0x20b0e3,_0x1f492d){_0x20b0e3=_0x20b0e3-0x0;var _0x472742=_0x34d7[_0x20b0e3];return _0x472742;};'use strict';var client=require('../client');exports['create']=function(_0x3e8489){return client[_0x734d('0x0')](_0x734d('0x1'),{'body':_0x3e8489,'log':_0x734d('0x2')});}; \ No newline at end of file +var _0x71c3=['CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2a771b,_0x11867a){var _0x58283d=function(_0x150af5){while(--_0x150af5){_0x2a771b['push'](_0x2a771b['shift']());}};_0x58283d(++_0x11867a);}(_0x71c3,0x16c));var _0x371c=function(_0x5d582f,_0x557bd6){_0x5d582f=_0x5d582f-0x0;var _0x22695c=_0x71c3[_0x5d582f];return _0x22695c;};'use strict';var client=require('../client');exports['create']=function(_0x14f0d3){return client['Request'](_0x371c('0x0'),{'body':_0x14f0d3,'log':_0x371c('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index c94ca88..614d4c4 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 _0xc511=['../client','Request','GetOpenchannelQueue','name','timeout','Agents','getOpenchannelQueues'];(function(_0x4afc6b,_0x5e8afd){var _0x42d3fe=function(_0x5503cc){while(--_0x5503cc){_0x4afc6b['push'](_0x4afc6b['shift']());}};_0x42d3fe(++_0x5e8afd);}(_0xc511,0x10a));var _0x1c51=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xc511[_0x4c7935];return _0x30651d;};'use strict';var client=require(_0x1c51('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x1c51('0x1')](_0x1c51('0x2'),{'options':{'raw':![],'attributes':['id',_0x1c51('0x3'),_0x1c51('0x4'),'strategy'],'include':[{'model':'User','as':_0x1c51('0x5'),'attributes':['id','name','online','openchannelPause']}]},'log':_0x1c51('0x6')});};}; \ No newline at end of file +var _0x1770=['strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name'];(function(_0x26c7d7,_0x569883){var _0x1bd372=function(_0x7c7ff3){while(--_0x7c7ff3){_0x26c7d7['push'](_0x26c7d7['shift']());}};_0x1bd372(++_0x569883);}(_0x1770,0x6c));var _0x0177=function(_0x3c38c7,_0x14dd97){_0x3c38c7=_0x3c38c7-0x0;var _0x4aa4b1=_0x1770[_0x3c38c7];return _0x4aa4b1;};'use strict';var client=require(_0x0177('0x0'));exports[_0x0177('0x1')]=function(){return function(){return client['Request'](_0x0177('0x2'),{'options':{'raw':![],'attributes':['id',_0x0177('0x3'),'timeout',_0x0177('0x4')],'include':[{'model':_0x0177('0x5'),'as':_0x0177('0x6'),'attributes':['id',_0x0177('0x3'),'online',_0x0177('0x7')]}]},'log':_0x0177('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6f822ad..1cd3dc7 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 _0xc4b0=['DESC','../client','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xc4b0,0xfb));var _0x0c4b=function(_0x24fe48,_0x10e97e){_0x24fe48=_0x24fe48-0x0;var _0x51e7d5=_0xc4b0[_0x24fe48];return _0x51e7d5;};'use strict';var client=require(_0x0c4b('0x0'));exports['create']=function(_0x3eba0b){return client[_0x0c4b('0x1')](_0x0c4b('0x2'),{'body':_0x3eba0b,'log':_0x0c4b('0x2')});};exports['update']=function(_0xa04c22,_0xc8918e){return client[_0x0c4b('0x1')](_0x0c4b('0x3'),{'body':_0xc8918e,'options':{'where':{'uniqueid':_0xa04c22},'order':[['id',_0x0c4b('0x4')]],'limit':0x1},'log':_0x0c4b('0x3')});}; \ No newline at end of file +var _0xe0dd=['Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xe0dd,0x163));var _0xde0d=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xe0dd[_0x2d8fc2];return _0x3a9e53;};'use strict';var client=require(_0xde0d('0x0'));exports[_0xde0d('0x1')]=function(_0x50e4cd){return client[_0xde0d('0x2')](_0xde0d('0x3'),{'body':_0x50e4cd,'log':_0xde0d('0x3')});};exports[_0xde0d('0x4')]=function(_0x14b459,_0x21700d){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x21700d,'options':{'where':{'uniqueid':_0x14b459},'order':[['id',_0xde0d('0x5')]],'limit':0x1},'log':_0xde0d('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0ca72cd..fd626b0 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 _0x873a=['../client','update','Request','addTags','AddTagsToSmsInteraction'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x873a,0x1c2));var _0xa873=function(_0x82cc96,_0x4959cc){_0x82cc96=_0x82cc96-0x0;var _0x49966b=_0x873a[_0x82cc96];return _0x49966b;};'use strict';var client=require(_0xa873('0x0'));exports[_0xa873('0x1')]=function(_0x1bf738,_0x52186c){return client[_0xa873('0x2')]('UpdateSmsInteraction',{'body':_0x52186c,'options':{'where':{'id':_0x1bf738}},'log':'updateSmsInteraction'});};exports[_0xa873('0x3')]=function(_0x46971d,_0x5a0d23){return client[_0xa873('0x2')](_0xa873('0x4'),{'body':_0x5a0d23,'options':{'where':{'id':_0x46971d}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x4453=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','updateSmsInteraction','addTags'];(function(_0x137177,_0x151028){var _0x487c48=function(_0x5a2e88){while(--_0x5a2e88){_0x137177['push'](_0x137177['shift']());}};_0x487c48(++_0x151028);}(_0x4453,0x9c));var _0x3445=function(_0x5ee936,_0x5775c0){_0x5ee936=_0x5ee936-0x0;var _0x2cf998=_0x4453[_0x5ee936];return _0x2cf998;};'use strict';var client=require(_0x3445('0x0'));exports[_0x3445('0x1')]=function(_0x4b8f62,_0x298f9e){return client[_0x3445('0x2')]('UpdateSmsInteraction',{'body':_0x298f9e,'options':{'where':{'id':_0x4b8f62}},'log':_0x3445('0x3')});};exports[_0x3445('0x4')]=function(_0xfff5,_0x22c15c){return client[_0x3445('0x2')](_0x3445('0x5'),{'body':_0x22c15c,'options':{'where':{'id':_0xfff5}},'log':_0x3445('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 5dd3ff2..e5c81e8 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 _0x7e6a=['createSmsMessage','CreateSmsMessage'];(function(_0x4f7a97,_0x14f986){var _0x2d97cb=function(_0x4323b6){while(--_0x4323b6){_0x4f7a97['push'](_0x4f7a97['shift']());}};_0x2d97cb(++_0x14f986);}(_0x7e6a,0x137));var _0xa7e6=function(_0x40bbfc,_0x31a04b){_0x40bbfc=_0x40bbfc-0x0;var _0x41ae4a=_0x7e6a[_0x40bbfc];return _0x41ae4a;};'use strict';var client=require('../client');exports['create']=function(_0x21f40e){return client['Request'](_0xa7e6('0x0'),{'body':_0x21f40e,'log':_0xa7e6('0x1')});}; \ No newline at end of file +var _0x69d5=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x69d5,0x1e9));var _0x569d=function(_0x1725ed,_0x479706){_0x1725ed=_0x1725ed-0x0;var _0x29e8ca=_0x69d5[_0x1725ed];return _0x29e8ca;};'use strict';var client=require('../client');exports[_0x569d('0x0')]=function(_0xffb8aa){return client[_0x569d('0x1')](_0x569d('0x2'),{'body':_0xffb8aa,'log':_0x569d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 70c7b63..deb9010 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 _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x7db51b,_0x1cc9e4){var _0x32c0a6=function(_0x1c7305){while(--_0x1c7305){_0x7db51b['push'](_0x7db51b['shift']());}};_0x32c0a6(++_0x1cc9e4);}(_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 +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3cb532,_0x5b59e5){var _0x181fa4=function(_0xa61d48){while(--_0xa61d48){_0x3cb532['push'](_0x3cb532['shift']());}};_0x181fa4(++_0x5b59e5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcb91[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 33ef7c0..76c679c 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(_0x19e419,_0x1f0492){var _0x5579fb=function(_0x4bf508){while(--_0x4bf508){_0x19e419['push'](_0x19e419['shift']());}};_0x5579fb(++_0x1f0492);}(_0x70e0,0x17b));var _0x070e=function(_0x2dd930,_0x59efac){_0x2dd930=_0x2dd930-0x0;var _0xedfa23=_0x70e0[_0x2dd930];return _0xedfa23;};'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 _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x319bc0,_0x34f937){var _0x51d912=function(_0x3d5d71){while(--_0x3d5d71){_0x319bc0['push'](_0x319bc0['shift']());}};_0x51d912(++_0x34f937);}(_0x55ca,0x126));var _0xa55c=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x55ca[_0x5fa520];return _0x1bf6c4;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2e01541..96f4098 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(_0x2a93bc,_0xc50cc2){var _0xc087=function(_0x363f8f){while(--_0x363f8f){_0x2a93bc['push'](_0x2a93bc['shift']());}};_0xc087(++_0xc50cc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x160142,_0x23a880){var _0x58a624=function(_0x389097){while(--_0x389097){_0x160142['push'](_0x160142['shift']());}};_0x58a624(++_0x23a880);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 8f5a3ff..bfdb3a7 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 _0xc1fc=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x431a4d,_0x474639){var _0x78961e=function(_0xd0c27e){while(--_0xd0c27e){_0x431a4d['push'](_0x431a4d['shift']());}};_0x78961e(++_0x474639);}(_0xc1fc,0x93));var _0xcc1f=function(_0xdad066,_0x828b7){_0xdad066=_0xdad066-0x0;var _0x50193d=_0xc1fc[_0xdad066];return _0x50193d;};'use strict';var client=require('../client');exports[_0xcc1f('0x0')]=function(_0x39fcfb,_0x496619){return client[_0xcc1f('0x1')](_0xcc1f('0x2'),{'body':_0x496619,'options':{'where':{'id':_0x39fcfb}},'log':_0xcc1f('0x3')});};exports[_0xcc1f('0x4')]=function(_0x26d3b2,_0x52703d){return client[_0xcc1f('0x1')](_0xcc1f('0x5'),{'body':_0x52703d,'options':{'where':{'id':_0x26d3b2}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xdfa0=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0xdfa0,0x69));var _0x0dfa=function(_0x3c10f7,_0x16480e){_0x3c10f7=_0x3c10f7-0x0;var _0x1b15d5=_0xdfa0[_0x3c10f7];return _0x1b15d5;};'use strict';var client=require(_0x0dfa('0x0'));exports['update']=function(_0x277084,_0x37ab88){return client['Request'](_0x0dfa('0x1'),{'body':_0x37ab88,'options':{'where':{'id':_0x277084}},'log':_0x0dfa('0x2')});};exports[_0x0dfa('0x3')]=function(_0x4dbbab,_0x373c4e){return client['Request'](_0x0dfa('0x4'),{'body':_0x373c4e,'options':{'where':{'id':_0x4dbbab}},'log':_0x0dfa('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index fb9f373..258d938 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 _0x86ff=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x86ff,0x173));var _0xf86f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x86ff[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf86f('0x0'));exports[_0xf86f('0x1')]=function(_0x83af40){return client[_0xf86f('0x2')](_0xf86f('0x3'),{'body':_0x83af40,'log':_0xf86f('0x4')});}; \ No newline at end of file +var _0x4f36=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x43eca7,_0x3861c8){var _0x151255=function(_0x184742){while(--_0x184742){_0x43eca7['push'](_0x43eca7['shift']());}};_0x151255(++_0x3861c8);}(_0x4f36,0x169));var _0x64f3=function(_0x57d370,_0x3ed0f6){_0x57d370=_0x57d370-0x0;var _0x550fd2=_0x4f36[_0x57d370];return _0x550fd2;};'use strict';var client=require(_0x64f3('0x0'));exports[_0x64f3('0x1')]=function(_0x5b37eb){return client[_0x64f3('0x2')](_0x64f3('0x3'),{'body':_0x5b37eb,'log':_0x64f3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 39a0f05..b575d96 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 _0xd6e6=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0xd6e6,0x118));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x6d6e('0x0'));exports[_0x6d6e('0x1')]=function(){return function(){return client[_0x6d6e('0x2')](_0x6d6e('0x3'),{'options':{'raw':![],'attributes':['id',_0x6d6e('0x4'),_0x6d6e('0x5'),_0x6d6e('0x6')],'include':[{'model':_0x6d6e('0x7'),'as':_0x6d6e('0x8'),'attributes':['id',_0x6d6e('0x4'),_0x6d6e('0x9'),_0x6d6e('0xa')]}]},'log':_0x6d6e('0x1')});};}; \ No newline at end of file +var _0xd8aa=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause'];(function(_0x2e9334,_0x3addc8){var _0x35306e=function(_0x197deb){while(--_0x197deb){_0x2e9334['push'](_0x2e9334['shift']());}};_0x35306e(++_0x3addc8);}(_0xd8aa,0x118));var _0xad8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xad8a('0x0'));exports[_0xad8a('0x1')]=function(){return function(){return client[_0xad8a('0x2')](_0xad8a('0x3'),{'options':{'raw':![],'attributes':['id',_0xad8a('0x4'),'timeout',_0xad8a('0x5')],'include':[{'model':_0xad8a('0x6'),'as':_0xad8a('0x7'),'attributes':['id',_0xad8a('0x4'),_0xad8a('0x8'),_0xad8a('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index b459147..eacbbb3 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 _0x37b3=['../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x9af22c,_0x59a592){var _0x1d65ce=function(_0x25df2d){while(--_0x25df2d){_0x9af22c['push'](_0x9af22c['shift']());}};_0x1d65ce(++_0x59a592);}(_0x37b3,0x1d4));var _0x337b=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x37b3[_0x50e593];return _0x3821d0;};'use strict';var client=require(_0x337b('0x0'));exports[_0x337b('0x1')]=function(_0x58ba21){return client[_0x337b('0x2')](_0x337b('0x3'),{'body':_0x58ba21,'log':'CreateWhatsappQueueReport'});};exports[_0x337b('0x4')]=function(_0x543ad8,_0x4c9778){return client[_0x337b('0x2')](_0x337b('0x5'),{'body':_0x4c9778,'options':{'where':{'uniqueid':_0x543ad8},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xd8c6=['../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x230447,_0x95aeee){var _0x208fd5=function(_0xdf38b3){while(--_0xdf38b3){_0x230447['push'](_0x230447['shift']());}};_0x208fd5(++_0x95aeee);}(_0xd8c6,0xd7));var _0x6d8c=function(_0x10784b,_0x59bd34){_0x10784b=_0x10784b-0x0;var _0x3123b4=_0xd8c6[_0x10784b];return _0x3123b4;};'use strict';var client=require(_0x6d8c('0x0'));exports['create']=function(_0x5ea5f1){return client[_0x6d8c('0x1')](_0x6d8c('0x2'),{'body':_0x5ea5f1,'log':_0x6d8c('0x2')});};exports[_0x6d8c('0x3')]=function(_0xd18a42,_0x5a8c10){return client[_0x6d8c('0x1')]('UpdateWhatsappQueueReport',{'body':_0x5a8c10,'options':{'where':{'uniqueid':_0xd18a42},'order':[['id','DESC']],'limit':0x1},'log':_0x6d8c('0x4')});}; \ 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 4d14586..614823b 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 _0xd07f=['map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','rules','end','close','complete','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s'];(function(_0x368f58,_0xcabf62){var _0x2af140=function(_0x44100e){while(--_0x44100e){_0x368f58['push'](_0x368f58['shift']());}};_0x2af140(++_0xcabf62);}(_0xd07f,0x17d));var _0xfd07=function(_0x1b03fe,_0x3572b1){_0x1b03fe=_0x1b03fe-0x0;var _0x5b0d40=_0xd07f[_0x1b03fe];return _0x5b0d40;};'use strict';var schema=require(_0xfd07('0x0'));var _=require(_0xfd07('0x1'));var util=require(_0xfd07('0x2'));var seqqueue=require(_0xfd07('0x3'));var logger=require(_0xfd07('0x4'))(_0xfd07('0x5'));var strategy=require(_0xfd07('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xfd07('0x7'),'message':_0xfd07('0x8')}});function writeLog(_0x5baf6f,_0x54a6f8,_0x3a686b){return logger[_0xfd07('0x9')](util['format'](_0xfd07('0xa'),_0x5baf6f,_0x54a6f8[_0xfd07('0xb')],_0x3a686b));}function handleFindAgent(_0x1a8708){return function(_0x5d1ed8){return _0x5d1ed8['name'][_0xfd07('0xc')]()===_0x1a8708[_0xfd07('0xc')]();};}exports[_0xfd07('0xd')]=function(_0x4eee14,_0x1a4671,_0x525577,_0x180c54){return function(_0x591dc8){try{var _0x57a07b={'name':_0x1a4671[0x0],'timeout':_0x1a4671[0x1]};var _0x58d860=queue['validate'](_0x57a07b,{'typecast':!![]});if(_0x58d860['length']){logger['error'](_0xfd07('0xe'),_0x4eee14,_[_0xfd07('0xf')](_0x58d860,_0xfd07('0x10'))[_0xfd07('0x11')](',\x20'));_0x591dc8[_0xfd07('0x12')]();}else{var _0x929556=_[_0xfd07('0x13')](_0x525577[_0xfd07('0x14')],handleFindAgent(_0x57a07b[_0xfd07('0xb')]));if(_0x929556){var _0x1b0443=(_0x57a07b[_0xfd07('0x15')]||0xa)*0x3e8;var _0x2bf99e,_0x419d8d;var _0x45fbaa=seqqueue[_0xfd07('0x16')](_0x1b0443);_0x45fbaa['id']=_0x4eee14;_0x45fbaa[_0xfd07('0x17')]=_0x1b0443;_0x45fbaa[_0xfd07('0x18')]=_0x180c54['channel'];writeLog(_0x4eee14,_0x929556,util[_0xfd07('0x19')]('START:%s',_0x1b0443));_0x525577[_0xfd07('0x1a')][_0x4eee14]['on'](_0xfd07('0x1b'),function(){logger[_0xfd07('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x4eee14);clearTimeout(_0x419d8d);_0x419d8d=undefined;_0x45fbaa[_0xfd07('0x1c')]();if(_0x525577[_0xfd07('0x1a')][_0x4eee14]){delete _0x525577[_0xfd07('0x1a')][_0x4eee14];}_0x591dc8[_0xfd07('0x12')]();});_0x525577['rules'][_0x4eee14]['on'](_0xfd07('0x1d'),function(){if(_0x525577[_0xfd07('0x1a')][_0x4eee14]){delete _0x525577['rules'][_0x4eee14];}});_0x419d8d=setTimeout(function(){logger[_0xfd07('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x4eee14);clearTimeout(_0x419d8d);_0x45fbaa['close']();_0x591dc8['next']();},_0x1b0443);strategy[_0xfd07('0x1e')](_0x45fbaa,_0x929556,_0x525577,_0x180c54);}else{logger[_0xfd07('0x1f')](_0xfd07('0x20'),_0x4eee14,_0x57a07b['name']);_0x591dc8['stop']();}}}catch(_0x41f269){console[_0xfd07('0x21')](_0x41f269);logger[_0xfd07('0x1f')](_0xfd07('0x22'),_0x4eee14,_0x41f269[_0xfd07('0x23')]);_0x591dc8[_0xfd07('0x12')]();}};}; \ No newline at end of file +var _0x1b29=['timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','string','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents'];(function(_0x557f77,_0x2ff13f){var _0x166ce5=function(_0x153405){while(--_0x153405){_0x557f77['push'](_0x557f77['shift']());}};_0x166ce5(++_0x2ff13f);}(_0x1b29,0x116));var _0x91b2=function(_0x2faf38,_0x43b0ec){_0x2faf38=_0x2faf38-0x0;var _0x35ced6=_0x1b29[_0x2faf38];return _0x35ced6;};'use strict';var schema=require(_0x91b2('0x0'));var _=require(_0x91b2('0x1'));var util=require(_0x91b2('0x2'));var seqqueue=require(_0x91b2('0x3'));var logger=require(_0x91b2('0x4'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0x91b2('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x257e75,_0x67d578,_0x88b65d){return logger[_0x91b2('0x6')](util['format'](_0x91b2('0x7'),_0x257e75,_0x67d578[_0x91b2('0x8')],_0x88b65d));}function handleFindAgent(_0x2fdcbb){return function(_0x36d679){return _0x36d679[_0x91b2('0x8')][_0x91b2('0x9')]()===_0x2fdcbb['toLowerCase']();};}exports[_0x91b2('0xa')]=function(_0x5cc9dd,_0x109949,_0x232e76,_0x125164){return function(_0x194612){try{var _0x39a0a9={'name':_0x109949[0x0],'timeout':_0x109949[0x1]};var _0x81b61a=queue[_0x91b2('0x0')](_0x39a0a9,{'typecast':!![]});if(_0x81b61a['length']){logger[_0x91b2('0xb')](_0x91b2('0xc'),_0x5cc9dd,_[_0x91b2('0xd')](_0x81b61a,_0x91b2('0xe'))[_0x91b2('0xf')](',\x20'));_0x194612[_0x91b2('0x10')]();}else{var _0x218044=_[_0x91b2('0x11')](_0x232e76[_0x91b2('0x12')],handleFindAgent(_0x39a0a9[_0x91b2('0x8')]));if(_0x218044){var _0x230588=(_0x39a0a9[_0x91b2('0x13')]||0xa)*0x3e8;var _0x1bc5d5,_0x11f61b;var _0xce979e=seqqueue[_0x91b2('0x14')](_0x230588);_0xce979e['id']=_0x5cc9dd;_0xce979e['atimeout']=_0x230588;_0xce979e[_0x91b2('0x15')]=_0x125164[_0x91b2('0x15')];writeLog(_0x5cc9dd,_0x218044,util['format'](_0x91b2('0x16'),_0x230588));_0x232e76[_0x91b2('0x17')][_0x5cc9dd]['on'](_0x91b2('0x18'),function(){logger[_0x91b2('0x6')](_0x91b2('0x19'),_0x5cc9dd);clearTimeout(_0x11f61b);_0x11f61b=undefined;_0xce979e[_0x91b2('0x1a')]();if(_0x232e76['rules'][_0x5cc9dd]){delete _0x232e76['rules'][_0x5cc9dd];}_0x194612[_0x91b2('0x10')]();});_0x232e76[_0x91b2('0x17')][_0x5cc9dd]['on'](_0x91b2('0x1b'),function(){if(_0x232e76[_0x91b2('0x17')][_0x5cc9dd]){delete _0x232e76[_0x91b2('0x17')][_0x5cc9dd];}});_0x11f61b=setTimeout(function(){logger[_0x91b2('0x6')]('[%s][AGENT]\x20ROUTING\x20END',_0x5cc9dd);clearTimeout(_0x11f61b);_0xce979e[_0x91b2('0x1a')]();_0x194612[_0x91b2('0x1c')]();},_0x230588);strategy[_0x91b2('0x1d')](_0xce979e,_0x218044,_0x232e76,_0x125164);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x5cc9dd,_0x39a0a9[_0x91b2('0x8')]);_0x194612[_0x91b2('0x10')]();}}}catch(_0x7667eb){console[_0x91b2('0x1e')](_0x7667eb);logger[_0x91b2('0xb')](_0x91b2('0x1f'),_0x5cc9dd,_0x7667eb[_0x91b2('0x20')]);_0x194612[_0x91b2('0x10')]();}};}; \ 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 8ec7ea7..50bb7b1 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 _0xc57d=['out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerResponse','dialogState','Failed','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b202f,_0x1bfb11){var _0x2743e5=function(_0x552223){while(--_0x552223){_0x5b202f['push'](_0x5b202f['shift']());}};_0x2743e5(++_0x1bfb11);}(_0xc57d,0x15a));var _0xdc57=function(_0x3f3bd5,_0x12f6b0){_0x3f3bd5=_0x3f3bd5-0x0;var _0x24b04c=_0xc57d[_0x3f3bd5];return _0x24b04c;};'use strict';var _=require(_0xdc57('0x0'));var moment=require(_0xdc57('0x1'));var AWS=require('aws-sdk');var utils=require(_0xdc57('0x2'));var logger=require('../../../../config/logger')(_0xdc57('0x3'));var rpc={'chatMessage':require(_0xdc57('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xdc57('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdc57('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdc57('0x7')]=function(_0x3f5e08,_0x2e7553){return function(_0x13606d){try{if(!_[_0xdc57('0x8')](this[_0xdc57('0x9')]['UserId'])){logger[_0xdc57('0xa')](_0xdc57('0xb'),_0x3f5e08,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x13606d['next']();}var _0x5305e4={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdc57('0xc')](_0xdc57('0xd')),'direction':_0xdc57('0xe')};if(this[_0xdc57('0xf')]===_0xdc57('0x10')||this[_0xdc57('0xf')]==='whatsapp'){_0x5305e4['phone']=this[_0xdc57('0x9')][_0xdc57('0x11')];}var _0x44420e=this[_0xdc57('0xf')];if(_0x44420e===_0xdc57('0x12')){_0x5305e4[_0xdc57('0x13')]=this[_0xdc57('0x14')]['id'];}else{_0x5305e4[_[_0xdc57('0x15')](_0x44420e)+_0xdc57('0x16')]=this[_0xdc57('0x14')]['id'];}_0x5305e4[_[_0xdc57('0x15')](_0x44420e)+_0xdc57('0x17')]=this[_0xdc57('0x9')]['id'];if(this[_0xdc57('0x9')]['created']){var _0x6aae61=_0x2e7553[0x4];if(!_['isEmpty'](_0x6aae61)){_0x5305e4['body']=utils['getMustacheRender'](_0x6aae61,this);return rpc[_0x44420e+_0xdc57('0x18')][_0xdc57('0x19')](_0x5305e4)[_0xdc57('0x1a')](function(_0x4c5fba){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3f5e08,_0x5305e4[_0xdc57('0x1b')]);})[_0xdc57('0x1c')](function(_0x4ab37b){logger[_0xdc57('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3f5e08,JSON[_0xdc57('0x1e')](_0x4ab37b));})[_0xdc57('0x1f')](function(){logger[_0xdc57('0xa')](_0xdc57('0x20'),_0x3f5e08);_0x13606d[_0xdc57('0x21')]();});}else{logger['info'](_0xdc57('0x22'),_0x3f5e08);_0x13606d[_0xdc57('0x21')]();}}else{var _0x1bc138=this;var _0x363d7c=new AWS[(_0xdc57('0x23'))]({'accessKeyId':_0x2e7553[0x0],'secretAccessKey':_0x2e7553[0x1],'region':_0x2e7553[0x2]});var _0x640ddb={'botAlias':_0xdc57('0x24'),'botName':_0x2e7553[0x3],'inputText':this[_0xdc57('0x25')][_0xdc57('0x1b')],'userId':this['channel']+':'+this[_0xdc57('0x9')]['id'][_0xdc57('0x26')]()};_0x363d7c[_0xdc57('0x27')](_0x640ddb,function(_0x5d0ee1,_0x3e6376){if(_0x5d0ee1){logger[_0xdc57('0x1d')](_0xdc57('0xb'),_0x3f5e08,_0x5d0ee1['message']);_0x13606d[_0xdc57('0x28')]();}else if(_0x3e6376&&_0x3e6376['message']){_0x1bc138['body'][_0xdc57('0x29')]=_0x3e6376;_0x5305e4[_0xdc57('0x1b')]=_0x3e6376[_0xdc57('0x25')];_0x5305e4['providerName']=_0xdc57('0x29');_0x5305e4[_0xdc57('0x2a')]=JSON[_0xdc57('0x1e')](_0x3e6376);return rpc[_0x44420e+_0xdc57('0x18')][_0xdc57('0x19')](_0x5305e4)[_0xdc57('0x1a')](function(_0x29a8a2){logger[_0xdc57('0xa')](_0xdc57('0xb'),_0x3f5e08,_0x5305e4[_0xdc57('0x1b')]);if(_0x3e6376[_0xdc57('0x2b')]==_0xdc57('0x2c')){_0x13606d[_0xdc57('0x28')]();}else{_0x13606d[_0xdc57('0x21')]();}})[_0xdc57('0x1c')](function(_0x93a735){logger[_0xdc57('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x3f5e08,JSON[_0xdc57('0x1e')](_0x93a735));_0x13606d[_0xdc57('0x28')]();});}else{_0x13606d['next']();}});}}catch(_0x3c2756){logger[_0xdc57('0x1d')](_0xdc57('0xb'),_0x3f5e08,JSON['stringify'](_0x3c2756));_0x13606d['stop']();}};}; \ No newline at end of file +var _0x9b4b=['sms','phone','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','Message','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message','body','amazonlex','providerResponse','create','dialogState','Failed','lodash','moment','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x16f07d,_0x278463){var _0x1b38d5=function(_0x575740){while(--_0x575740){_0x16f07d['push'](_0x16f07d['shift']());}};_0x1b38d5(++_0x278463);}(_0x9b4b,0x9f));var _0xb9b4=function(_0x592307,_0x2b8719){_0x592307=_0x592307-0x0;var _0x244eb8=_0x9b4b[_0x592307];return _0x244eb8;};'use strict';var _=require(_0xb9b4('0x0'));var moment=require(_0xb9b4('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xb9b4('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xb9b4('0x3')),'faxMessage':require(_0xb9b4('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0xcafce,_0x2d89be){return function(_0x446a32){try{if(!_[_0xb9b4('0x5')](this[_0xb9b4('0x6')][_0xb9b4('0x7')])){logger[_0xb9b4('0x8')](_0xb9b4('0x9'),_0xcafce,_0xb9b4('0xa'));return _0x446a32[_0xb9b4('0xb')]();}var _0x4fed39={'ContactId':this[_0xb9b4('0xc')]['id'],'sentAt':moment()[_0xb9b4('0xd')](_0xb9b4('0xe')),'direction':_0xb9b4('0xf')};if(this[_0xb9b4('0x10')]===_0xb9b4('0x11')||this[_0xb9b4('0x10')]==='whatsapp'){_0x4fed39[_0xb9b4('0x12')]=this[_0xb9b4('0x6')][_0xb9b4('0x12')];}var _0x507eb3=this[_0xb9b4('0x10')];if(_0x507eb3==='chat'){_0x4fed39[_0xb9b4('0x13')]=this[_0xb9b4('0x14')]['id'];}else{_0x4fed39[_['upperFirst'](_0x507eb3)+_0xb9b4('0x15')]=this['account']['id'];}_0x4fed39[_[_0xb9b4('0x16')](_0x507eb3)+'InteractionId']=this['interaction']['id'];if(this[_0xb9b4('0x6')][_0xb9b4('0x17')]){var _0x3fcb66=_0x2d89be[0x4];if(!_[_0xb9b4('0x18')](_0x3fcb66)){_0x4fed39['body']=utils['getMustacheRender'](_0x3fcb66,this);return rpc[_0x507eb3+_0xb9b4('0x19')]['create'](_0x4fed39)[_0xb9b4('0x1a')](function(_0x4dda86){logger[_0xb9b4('0x8')](_0xb9b4('0x9'),_0xcafce,_0x4fed39['body']);})[_0xb9b4('0x1b')](function(_0x43c4a9){logger[_0xb9b4('0x1c')]('[%s][AMAZONLEX]\x20%s',_0xcafce,JSON[_0xb9b4('0x1d')](_0x43c4a9));})[_0xb9b4('0x1e')](function(){logger[_0xb9b4('0x8')](_0xb9b4('0x1f'),_0xcafce);_0x446a32[_0xb9b4('0x20')]();});}else{logger[_0xb9b4('0x8')](_0xb9b4('0x21'),_0xcafce);_0x446a32[_0xb9b4('0x20')]();}}else{var _0x52acb7=this;var _0x5eb3f2=new AWS[(_0xb9b4('0x22'))]({'accessKeyId':_0x2d89be[0x0],'secretAccessKey':_0x2d89be[0x1],'region':_0x2d89be[0x2]});var _0x3cd541={'botAlias':'$LATEST','botName':_0x2d89be[0x3],'inputText':this['message']['body'],'userId':this[_0xb9b4('0x10')]+':'+this[_0xb9b4('0x6')]['id'][_0xb9b4('0x23')]()};_0x5eb3f2[_0xb9b4('0x24')](_0x3cd541,function(_0x3b7725,_0x5c08f0){if(_0x3b7725){logger[_0xb9b4('0x1c')](_0xb9b4('0x9'),_0xcafce,_0x3b7725[_0xb9b4('0x25')]);_0x446a32[_0xb9b4('0xb')]();}else if(_0x5c08f0&&_0x5c08f0['message']){_0x52acb7[_0xb9b4('0x26')]['amazonlex']=_0x5c08f0;_0x4fed39[_0xb9b4('0x26')]=_0x5c08f0[_0xb9b4('0x25')];_0x4fed39['providerName']=_0xb9b4('0x27');_0x4fed39[_0xb9b4('0x28')]=JSON[_0xb9b4('0x1d')](_0x5c08f0);return rpc[_0x507eb3+'Message'][_0xb9b4('0x29')](_0x4fed39)[_0xb9b4('0x1a')](function(_0x63c844){logger[_0xb9b4('0x8')](_0xb9b4('0x9'),_0xcafce,_0x4fed39[_0xb9b4('0x26')]);if(_0x5c08f0[_0xb9b4('0x2a')]==_0xb9b4('0x2b')){_0x446a32[_0xb9b4('0xb')]();}else{_0x446a32['stop']();}})[_0xb9b4('0x1b')](function(_0xf6fcbf){logger['error'](_0xb9b4('0x9'),_0xcafce,JSON['stringify'](_0xf6fcbf));_0x446a32[_0xb9b4('0xb')]();});}else{_0x446a32[_0xb9b4('0xb')]();}});}}catch(_0x3e22f9){logger[_0xb9b4('0x1c')](_0xb9b4('0x9'),_0xcafce,JSON[_0xb9b4('0x1d')](_0x3e22f9));_0x446a32['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index a8f1386..720aaca 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 _0x1b3d=['info','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','messageId','replace',''+_[_0xd1b3('0x2d')](_0x1eec15[_0xd1b3('0x13')],_0xd1b3('0x2e'),_0xd1b3('0x2f'))+'';_0x1eec15[_0xd1b3('0x30')]={'Auto-Submitted':_0xd1b3('0x31'),'X-Auto-Response-Suppress':_0xd1b3('0x32'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0xd1b3('0x29')][_0xd1b3('0x33')],_0x1eec15)['then'](function(_0x28aae7){logger[_0xd1b3('0x19')](_0xd1b3('0x34'),_0x1bf4e0);_0x1eec15[_0xd1b3('0x2c')]=_0x28aae7[_0xd1b3('0x20')][_0xd1b3('0x2c')];return rpc[_0x133aa1+_0xd1b3('0x35')][_0xd1b3('0x36')](_0x1eec15);})[_0xd1b3('0x37')](function(_0x12bd01){logger[_0xd1b3('0x19')](_0xd1b3('0x14'),_0x1bf4e0,JSON[_0xd1b3('0x38')](_0x12bd01));})[_0xd1b3('0x39')](function(_0x567af7){logger[_0xd1b3('0x3a')](_0xd1b3('0x3b'),_0x1bf4e0,JSON['stringify'](_0x567af7));})[_0xd1b3('0x3c')](function(){Promise['resolve']()[_0xd1b3('0x37')](function(){if(_0x1c2a55[0x0]!=='2'||_0x5e2e60[_0xd1b3('0x1b')])return;return rpc[_0x133aa1+'Interaction'][_0xd1b3('0x3d')](_0x5e2e60['id'],{'autoreplyExecuted':!![]})[_0xd1b3('0x37')](function(_0x41a386){logger[_0xd1b3('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1bf4e0,JSON[_0xd1b3('0x38')](_0x41a386));})[_0xd1b3('0x39')](function(_0x552930){logger[_0xd1b3('0x3a')](_0xd1b3('0x3e'),_0x1bf4e0,JSON['stringify'](_0x552930));});})[_0xd1b3('0x37')](function(){_0x8022e1[_0xd1b3('0x16')]();});});}else{return rpc[this[_0xd1b3('0x11')]+_0xd1b3('0x35')][_0xd1b3('0x36')](_0x1eec15)['then'](function(){logger['info']('[%s][AUTOREPLY]\x20%s',_0x1bf4e0,_0x1eec15[_0xd1b3('0x13')]);})['catch'](function(_0x21ee09){logger['error'](_0xd1b3('0x14'),_0x1bf4e0,JSON[_0xd1b3('0x38')](_0x21ee09));})[_0xd1b3('0x3c')](function(){Promise[_0xd1b3('0x3f')]()['then'](function(){if(_0x1c2a55[0x0]!=='2'||_0x5e2e60['autoreplyExecuted'])return;return rpc[_0x133aa1+_0xd1b3('0x40')][_0xd1b3('0x3d')](_0x5e2e60['id'],{'autoreplyExecuted':!![]})[_0xd1b3('0x37')](function(_0x3d552b){logger[_0xd1b3('0x19')](_0xd1b3('0x1c'),_0x1bf4e0,JSON[_0xd1b3('0x38')](_0x3d552b));})[_0xd1b3('0x39')](function(_0x54e40e){logger[_0xd1b3('0x3a')](_0xd1b3('0x3e'),_0x1bf4e0,JSON['stringify'](_0x54e40e));});})[_0xd1b3('0x37')](function(){_0x8022e1['next']();});});}}}catch(_0x41e152){logger[_0xd1b3('0x3a')]('[%s][AUTOREPLY]\x20%s',_0x1bf4e0,JSON[_0xd1b3('0x38')](_0x41e152));_0x8022e1[_0xd1b3('0x41')]();}};}; \ No newline at end of file +var _0x9051=['html','','','headers','auto-replied','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','then','catch','error','stringify','finally','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','body','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','message','from','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','InteractionId','inReplyTo'];(function(_0x40ceac,_0x493dc7){var _0x2945da=function(_0x3624a7){while(--_0x3624a7){_0x40ceac['push'](_0x40ceac['shift']());}};_0x2945da(++_0x493dc7);}(_0x9051,0xdf));var _0x1905=function(_0x1289e7,_0x1d2b99){_0x1289e7=_0x1289e7-0x0;var _0x1a1999=_0x9051[_0x1289e7];return _0x1a1999;};'use strict';var _=require(_0x1905('0x0'));var moment=require(_0x1905('0x1'));var utils=require(_0x1905('0x2'));var logger=require(_0x1905('0x3'))(_0x1905('0x4'));var rpc={'chatMessage':require(_0x1905('0x5')),'openchannelMessage':require(_0x1905('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1905('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x1905('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x1905('0x9')),'smsInteraction':require(_0x1905('0xa')),'faxInteraction':require(_0x1905('0xb')),'whatsappInteraction':require(_0x1905('0xc'))};var mailRpc=require(_0x1905('0xd'));exports[_0x1905('0xe')]=function(_0x2e4323,_0x2e9cf7,_0x2af1db,_0x48fa26){return function(_0x2bfef2){try{var _0x3008a3=this['channel'];if(_0x3008a3==='mail'&&_0x48fa26[_0x1905('0xf')]['isAutoreply']){logger[_0x1905('0x10')](_0x1905('0x11'),_0x2e4323,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x2bfef2[_0x1905('0x12')]();}if(_0x2e9cf7[0x0]==='1'&&(_[_0x1905('0x13')](this[_0x1905('0x14')][_0x1905('0x15')])||!this[_0x1905('0x14')]['created'])){logger[_0x1905('0x10')]('[%s][AUTOREPLY]\x20%s',_0x2e4323,_0x1905('0x16'));return _0x2bfef2[_0x1905('0x12')]();}if(_0x2e9cf7[0x0]==='2'&&this[_0x1905('0x14')][_0x1905('0x17')]){logger[_0x1905('0x10')](_0x1905('0x18'),_0x2e4323,_0x1905('0x19'));return _0x2bfef2['next']();}var _0x4c079e={'ContactId':this[_0x1905('0x1a')]['id'],'sentAt':moment()['format'](_0x1905('0x1b')),'direction':_0x1905('0x1c')};if(this[_0x1905('0x1d')]===_0x1905('0x1e')){_0x4c079e[_0x1905('0xf')]=utils[_0x1905('0x1f')](_0x2e9cf7[0x2],this);}else{_0x4c079e[_0x1905('0xf')]=utils[_0x1905('0x1f')](_0x2e9cf7[0x1],this);}if(this[_0x1905('0x20')]){_0x4c079e['to']=this['message']['from']||'';if(this['channel']===_0x1905('0x1e')&&_0x2e9cf7[0x1]==='1'){_0x4c079e['cc']=this['message']['cc']||'';}_0x4c079e[_0x1905('0x21')]=this['message']['to']||'';_0x4c079e['phone']=this[_0x1905('0x20')]['phone']||'';_0x4c079e[_0x1905('0x22')]=!![];if(this[_0x1905('0x20')][_0x1905('0x23')]){_0x4c079e[_0x1905('0x23')]='';_0x4c079e['subject']+=_[_0x1905('0x24')](this[_0x1905('0x20')][_0x1905('0x23')],_0x1905('0x25'))?'':_0x1905('0x26');_0x4c079e[_0x1905('0x23')]+=this[_0x1905('0x20')][_0x1905('0x23')];}}if(this[_0x1905('0x1d')]===_0x1905('0x27')){_0x4c079e[_0x1905('0x28')]=this[_0x1905('0x29')]['id'];}else{_0x4c079e[_[_0x1905('0x2a')](this['channel'])+'AccountId']=this[_0x1905('0x29')]['id'];}_0x4c079e[_['upperFirst'](this[_0x1905('0x1d')])+_0x1905('0x2b')]=this[_0x1905('0x14')]['id'];var _0x2c6fc6=this['interaction'];if(rpc[this[_0x1905('0x1d')]+'Message']){if(this[_0x1905('0x1d')]===_0x1905('0x1e')){_0x4c079e[_0x1905('0x2c')]=this['message']['messageId'];_0x4c079e[_0x1905('0x2d')]=_0x1905('0x2e')+_['replace'](_0x4c079e[_0x1905('0xf')],']+(>|$)/g,''),'priorityTrue':_0x42e71e[0x1],'priorityFalse':_0x42e71e[0x2]};var _0x2bdbb1=gotoif[_0x3d79('0x0')](_0x2ee44c,{'typecast':!![]});if(_0x2bdbb1[_0x3d79('0xc')]){logger[_0x3d79('0xd')](_0x3d79('0xe'),_0x4082b1,_[_0x3d79('0xf')](_0x2bdbb1,_0x3d79('0x10'))[_0x3d79('0x11')](',\x20'));_0x244867[_0x3d79('0x12')]();}else{try{var _0x2905d7=eval('('+_0x2ee44c[_0x3d79('0x13')]+')');var _0x790ac4=_0x2905d7?_0x2ee44c['priorityTrue']:_0x2ee44c['priorityFalse'];logger[_0x3d79('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4082b1,_0x2ee44c['condition'],_0x2905d7,_0x790ac4||_0x3d79('0x15'));if(_0x790ac4){var _0x394ebd=_[_0x3d79('0x16')](_0x244867[_0x3d79('0x17')](),{'p':_0x790ac4});if(_0x394ebd>=0x0){logger[_0x3d79('0x14')](_0x3d79('0x18'),_0x4082b1,_0x790ac4||_0x3d79('0x15'),_0x394ebd);_0x244867[_0x3d79('0x15')](_0x394ebd);}else{logger[_0x3d79('0x14')](_0x3d79('0x19'),_0x4082b1,_0x790ac4||_0x3d79('0x15'));_0x244867[_0x3d79('0x12')]();}}else{_0x244867[_0x3d79('0x15')]();}}catch(_0x3f36c7){logger['error'](_0x3d79('0x1a'),_0x4082b1,_0x3f36c7['message']);_0x244867['stop']();}}}catch(_0x39c842){logger[_0x3d79('0xd')](_0x3d79('0xe'),_0x4082b1,JSON[_0x3d79('0x1b')](_0x39c842));_0x244867[_0x3d79('0x12')]();}};}; \ No newline at end of file +var _0xd7f3=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','map','message','stop','priorityTrue','priorityFalse','info','next'];(function(_0xd7affc,_0x510735){var _0x212bbf=function(_0x5d75f4){while(--_0x5d75f4){_0xd7affc['push'](_0xd7affc['shift']());}};_0x212bbf(++_0x510735);}(_0xd7f3,0xa5));var _0x3d7f=function(_0x562f0a,_0x1593f5){_0x562f0a=_0x562f0a-0x0;var _0x1b2cba=_0xd7f3[_0x562f0a];return _0x1b2cba;};'use strict';var schema=require(_0x3d7f('0x0'));var _=require(_0x3d7f('0x1'));var htmlToText=require(_0x3d7f('0x2'));var utils=require(_0x3d7f('0x3'));var logger=require(_0x3d7f('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3d7f('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3d7f('0x5'),'message':_0x3d7f('0x6')}});exports[_0x3d7f('0x7')]=function(_0x199d1d,_0x1ad902){return function(_0x4ecf53){try{var _0x3dcd21={'condition':htmlToText['fromString'](utils[_0x3d7f('0x8')](_0x1ad902[0x0],this),{'wordwrap':![]})[_0x3d7f('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ad902[0x1],'priorityFalse':_0x1ad902[0x2]};var _0x11b80f=gotoif[_0x3d7f('0x0')](_0x3dcd21,{'typecast':!![]});if(_0x11b80f[_0x3d7f('0xa')]){logger[_0x3d7f('0xb')]('[%s][GOTOIF]\x20%s',_0x199d1d,_[_0x3d7f('0xc')](_0x11b80f,_0x3d7f('0xd'))['join'](',\x20'));_0x4ecf53[_0x3d7f('0xe')]();}else{try{var _0x227829=eval('('+_0x3dcd21['condition']+')');var _0x5eaaad=_0x227829?_0x3dcd21[_0x3d7f('0xf')]:_0x3dcd21[_0x3d7f('0x10')];logger[_0x3d7f('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x199d1d,_0x3dcd21['condition'],_0x227829,_0x5eaaad||_0x3d7f('0x12'));if(_0x5eaaad){var _0x20bf98=_['findIndex'](_0x4ecf53['rules'](),{'p':_0x5eaaad});if(_0x20bf98>=0x0){logger['info'](_0x3d7f('0x13'),_0x199d1d,_0x5eaaad||'next',_0x20bf98);_0x4ecf53[_0x3d7f('0x12')](_0x20bf98);}else{logger[_0x3d7f('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x199d1d,_0x5eaaad||_0x3d7f('0x12'));_0x4ecf53[_0x3d7f('0xe')]();}}else{_0x4ecf53[_0x3d7f('0x12')]();}}catch(_0x380732){logger[_0x3d7f('0xb')](_0x3d7f('0x14'),_0x199d1d,_0x380732[_0x3d7f('0xd')]);_0x4ecf53[_0x3d7f('0xe')]();}}}catch(_0x23aa33){logger['error'](_0x3d7f('0x15'),_0x199d1d,JSON[_0x3d7f('0x16')](_0x23aa33));_0x4ecf53['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index ba54778..e1af0b4 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 _0x1b06=['stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','message'];(function(_0x45c0cf,_0x5d38c7){var _0x234fb9=function(_0x522dcd){while(--_0x522dcd){_0x45c0cf['push'](_0x45c0cf['shift']());}};_0x234fb9(++_0x5d38c7);}(_0x1b06,0xd5));var _0x61b0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1b06[_0x2dafbe];return _0x58a45a;};'use strict';var schema=require(_0x61b0('0x0'));var _=require(_0x61b0('0x1'));var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x61b0('0x2'),'required':!![],'message':_0x61b0('0x3')}});exports[_0x61b0('0x4')]=function(_0xb4952c,_0x49c3d3){return function(_0x30ebc6){try{var _0x57b024={'priority':_0x49c3d3[0x0]};var _0x7f48d5=gotop[_0x61b0('0x0')](_0x57b024,{'typecast':!![]});if(_0x7f48d5['length']){logger[_0x61b0('0x5')](_0x61b0('0x6'),_0xb4952c,_['map'](_0x7f48d5,_0x61b0('0x7'))['join'](',\x20'));_0x30ebc6[_0x61b0('0x8')]();}else{logger['info'](_0x61b0('0x9'),_0xb4952c,_0x57b024[_0x61b0('0xa')]);if(_0x57b024[_0x61b0('0xa')]){var _0x2564d8=_[_0x61b0('0xb')](_0x30ebc6[_0x61b0('0xc')](),{'p':_0x57b024[_0x61b0('0xa')]});if(_0x2564d8>=0x0){logger[_0x61b0('0xd')](_0x61b0('0xe'),_0xb4952c,_0x57b024[_0x61b0('0xa')]||_0x61b0('0xf'),_0x2564d8);_0x30ebc6[_0x61b0('0xf')](_0x2564d8);}else{logger[_0x61b0('0xd')](_0x61b0('0x10'),_0xb4952c,_0x57b024[_0x61b0('0xa')]||_0x61b0('0xf'));_0x30ebc6[_0x61b0('0x8')]();}}else{_0x30ebc6[_0x61b0('0xf')]();}}}catch(_0x374467){logger[_0x61b0('0x5')](_0x61b0('0x6'),_0xb4952c,JSON['stringify'](_0x374467));_0x30ebc6['stop']();}};}; \ No newline at end of file +var _0x5e91=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','error','validate','lodash','../../../../config/logger','routing','number'];(function(_0xa71f02,_0x5c9690){var _0x19798a=function(_0x8b592c){while(--_0x8b592c){_0xa71f02['push'](_0xa71f02['shift']());}};_0x19798a(++_0x5c9690);}(_0x5e91,0x187));var _0x15e9=function(_0xee4b51,_0x82653a){_0xee4b51=_0xee4b51-0x0;var _0x5c4317=_0x5e91[_0xee4b51];return _0x5c4317;};'use strict';var schema=require(_0x15e9('0x0'));var _=require(_0x15e9('0x1'));var logger=require(_0x15e9('0x2'))(_0x15e9('0x3'));var gotop=schema({'priority':{'type':_0x15e9('0x4'),'required':!![],'message':_0x15e9('0x5')}});exports[_0x15e9('0x6')]=function(_0x3a2db7,_0x275a03){return function(_0x449c79){try{var _0x2062bc={'priority':_0x275a03[0x0]};var _0x57ade0=gotop[_0x15e9('0x0')](_0x2062bc,{'typecast':!![]});if(_0x57ade0[_0x15e9('0x7')]){logger['error'](_0x15e9('0x8'),_0x3a2db7,_[_0x15e9('0x9')](_0x57ade0,_0x15e9('0xa'))['join'](',\x20'));_0x449c79[_0x15e9('0xb')]();}else{logger[_0x15e9('0xc')](_0x15e9('0xd'),_0x3a2db7,_0x2062bc[_0x15e9('0xe')]);if(_0x2062bc[_0x15e9('0xe')]){var _0x3f0b44=_[_0x15e9('0xf')](_0x449c79['rules'](),{'p':_0x2062bc[_0x15e9('0xe')]});if(_0x3f0b44>=0x0){logger[_0x15e9('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3a2db7,_0x2062bc[_0x15e9('0xe')]||_0x15e9('0x10'),_0x3f0b44);_0x449c79[_0x15e9('0x10')](_0x3f0b44);}else{logger[_0x15e9('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3a2db7,_0x2062bc[_0x15e9('0xe')]||_0x15e9('0x10'));_0x449c79['stop']();}}else{_0x449c79[_0x15e9('0x10')]();}}}catch(_0x4a23be){logger[_0x15e9('0x11')](_0x15e9('0x8'),_0x3a2db7,JSON['stringify'](_0x4a23be));_0x449c79[_0x15e9('0xb')]();}};}; \ 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 4cf7502..abbc9f1 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 _0x187c=['../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','AccountId','InteractionId','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../rpc/chatMessage'];(function(_0x4cce81,_0x252735){var _0xad14bc=function(_0x53bc1e){while(--_0x53bc1e){_0x4cce81['push'](_0x4cce81['shift']());}};_0xad14bc(++_0x252735);}(_0x187c,0x11d));var _0xc187=function(_0x1cfe7c,_0x4ba448){_0x1cfe7c=_0x1cfe7c-0x0;var _0x3feac9=_0x187c[_0x1cfe7c];return _0x3feac9;};'use strict';var _=require(_0xc187('0x0'));var utils=require(_0xc187('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xc187('0x2')),'openchannelMessage':require(_0xc187('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xc187('0x4')),'whatsappMessage':require(_0xc187('0x5'))};exports[_0xc187('0x6')]=function(_0x20b6b5,_0x330de5){return function(_0x1e47d4){try{var _0x2e6d12={'body':utils['getMustacheRender'](_0x330de5[0x0],this),'ContactId':this[_0xc187('0x7')]['id']};if(this[_0xc187('0x8')]===_0xc187('0x9')){_0x2e6d12[_0xc187('0xa')]=this[_0xc187('0xb')]['id'];}else{_0x2e6d12[_['upperFirst'](this['channel'])+_0xc187('0xc')]=this['account']['id'];}_0x2e6d12[_['upperFirst'](this[_0xc187('0x8')])+_0xc187('0xd')]=this['interaction']['id'];if(rpc[this[_0xc187('0x8')]+_0xc187('0xe')]){return rpc[this[_0xc187('0x8')]+_0xc187('0xe')][_0xc187('0xf')](_0x2e6d12)[_0xc187('0x10')](function(_0x153157){logger['info'](_0xc187('0x11'),_0x20b6b5,_0x2e6d12[_0xc187('0x12')]);_0x1e47d4[_0xc187('0x13')]();})[_0xc187('0x14')](function(_0x3c7046){logger[_0xc187('0x15')]('[%s][MESSAGE]\x20%s',_0x20b6b5,JSON[_0xc187('0x16')](_0x3c7046));_0x1e47d4[_0xc187('0x17')]();});}}catch(_0x25bdda){logger[_0xc187('0x15')]('[%s][MESSAGE]\x20%s',_0x20b6b5,JSON[_0xc187('0x16')](_0x25bdda));_0x1e47d4[_0xc187('0x17')]();}};}; \ No newline at end of file +var _0x95c7=['info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','then'];(function(_0x2c61f1,_0x32bcf0){var _0x24c91c=function(_0x29ab38){while(--_0x29ab38){_0x2c61f1['push'](_0x2c61f1['shift']());}};_0x24c91c(++_0x32bcf0);}(_0x95c7,0x1a7));var _0x795c=function(_0x19b7ee,_0x22d9a1){_0x19b7ee=_0x19b7ee-0x0;var _0x2f14cc=_0x95c7[_0x19b7ee];return _0x2f14cc;};'use strict';var _=require(_0x795c('0x0'));var utils=require(_0x795c('0x1'));var logger=require(_0x795c('0x2'))(_0x795c('0x3'));var rpc={'chatMessage':require(_0x795c('0x4')),'openchannelMessage':require(_0x795c('0x5')),'mailMessage':require(_0x795c('0x6')),'smsMessage':require(_0x795c('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x29a610,_0x539589){return function(_0x1cdcda){try{var _0x1de00c={'body':utils['getMustacheRender'](_0x539589[0x0],this),'ContactId':this[_0x795c('0x8')]['id']};if(this[_0x795c('0x9')]===_0x795c('0xa')){_0x1de00c[_0x795c('0xb')]=this[_0x795c('0xc')]['id'];}else{_0x1de00c[_[_0x795c('0xd')](this[_0x795c('0x9')])+_0x795c('0xe')]=this[_0x795c('0xc')]['id'];}_0x1de00c[_[_0x795c('0xd')](this[_0x795c('0x9')])+_0x795c('0xf')]=this['interaction']['id'];if(rpc[this[_0x795c('0x9')]+'Message']){return rpc[this[_0x795c('0x9')]+_0x795c('0x10')][_0x795c('0x11')](_0x1de00c)[_0x795c('0x12')](function(_0x1db4fe){logger[_0x795c('0x13')](_0x795c('0x14'),_0x29a610,_0x1de00c[_0x795c('0x15')]);_0x1cdcda['next']();})[_0x795c('0x16')](function(_0x7e3962){logger[_0x795c('0x17')](_0x795c('0x14'),_0x29a610,JSON[_0x795c('0x18')](_0x7e3962));_0x1cdcda['stop']();});}}catch(_0x5b88bb){logger['error'](_0x795c('0x14'),_0x29a610,JSON[_0x795c('0x18')](_0x5b88bb));_0x1cdcda[_0x795c('0x19')]();}};}; \ 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 7ced3a1..cfadc63 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 _0xe41f=['[%s][NOOP]\x20%s','next','stringify','stop','./utils','consequence','info'];(function(_0xa7242e,_0x22572b){var _0x55dbc4=function(_0x54d6f6){while(--_0x54d6f6){_0xa7242e['push'](_0xa7242e['shift']());}};_0x55dbc4(++_0x22572b);}(_0xe41f,0xdd));var _0xfe41=function(_0x2f6c25,_0xe26db){_0x2f6c25=_0x2f6c25-0x0;var _0x377275=_0xe41f[_0x2f6c25];return _0x377275;};'use strict';var utils=require(_0xfe41('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0xfe41('0x1')]=function(_0x33ff89,_0x298e17){return function(_0xc992a4){try{logger[_0xfe41('0x2')](_0xfe41('0x3'),_0x33ff89,utils['getMustacheRender'](_0x298e17[0x0],this));_0xc992a4[_0xfe41('0x4')]();}catch(_0x4da322){logger['error'](_0xfe41('0x3'),_0x33ff89,JSON[_0xfe41('0x5')](_0x4da322));_0xc992a4[_0xfe41('0x6')]();}};}; \ No newline at end of file +var _0x02b4=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x343a58,_0x7dc868){var _0x3992e4=function(_0x1f2d63){while(--_0x1f2d63){_0x343a58['push'](_0x343a58['shift']());}};_0x3992e4(++_0x7dc868);}(_0x02b4,0x110));var _0x402b=function(_0x8b26f3,_0x222928){_0x8b26f3=_0x8b26f3-0x0;var _0x453699=_0x02b4[_0x8b26f3];return _0x453699;};'use strict';var utils=require(_0x402b('0x0'));var logger=require(_0x402b('0x1'))(_0x402b('0x2'));exports[_0x402b('0x3')]=function(_0x25db18,_0x51666f){return function(_0x193b26){try{logger[_0x402b('0x4')](_0x402b('0x5'),_0x25db18,utils[_0x402b('0x6')](_0x51666f[0x0],this));_0x193b26[_0x402b('0x7')]();}catch(_0x617073){logger[_0x402b('0x8')](_0x402b('0x5'),_0x25db18,JSON[_0x402b('0x9')](_0x617073));_0x193b26[_0x402b('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 94ea0f7..26aa044 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 _0xd2a2=['defaults','localhost','socket.io-emitter','queue_id','account','queue','emit','clone','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','list','channel','interaction','upperFirst','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xd2a2,0x9b));var _0x2d2a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd2a2[_0x2dafbe];return _0x58a45a;};'use strict';var schema=require(_0x2d2a('0x0'));var _=require(_0x2d2a('0x1'));var util=require(_0x2d2a('0x2'));var seqqueue=require(_0x2d2a('0x3'));var moment=require(_0x2d2a('0x4'));var Redis=require(_0x2d2a('0x5'));var config=require(_0x2d2a('0x6'));var logger=require(_0x2d2a('0x7'))(_0x2d2a('0x8'));var strategy=require(_0x2d2a('0x9'));config[_0x2d2a('0xa')]=_[_0x2d2a('0xb')](config[_0x2d2a('0xa')],{'host':_0x2d2a('0xc'),'port':0x18eb});var io=require(_0x2d2a('0xd'))(new Redis(config['redis']));var attributes=['id',_0x2d2a('0xe'),_0x2d2a('0xf'),_0x2d2a('0x10'),'from','joinAt'];function emit(_0x258aad,_0x43b832,_0x985423){io['to'](_0x258aad)[_0x2d2a('0x11')](_0x43b832,_0x985423);}function emitChannelQueueInteraction(_0x1c8ebb,_0x29b84a,_0x788e8b,_0x1cfa72,_0x299828,_0x1d21bc,_0x410be6,_0x3125a2){var _0x5c2104=_[_0x2d2a('0x12')](_0x788e8b);_0x5c2104['queue_id']=_0x3125a2;_0x5c2104[_0x2d2a('0x10')]=_0x29b84a;_0x5c2104[_0x2d2a('0xf')]=_0x1cfa72;_0x5c2104['id']=_0x299828;if(_0x1d21bc){attributes[_0x2d2a('0x13')](_[_0x2d2a('0x14')](_0x1c8ebb)+_0x2d2a('0x15'));_0x410be6[util[_0x2d2a('0x16')]('%sQueuesWaitingInteractions',_0x1c8ebb)][_0x299828]=_[_0x2d2a('0x17')](_0x5c2104,attributes);}else{delete _0x410be6[util['format'](_0x2d2a('0x18'),_0x1c8ebb)][_0x299828];}emit(util[_0x2d2a('0x16')](_0x2d2a('0x19'),_0x1c8ebb,_0x29b84a),util[_0x2d2a('0x16')](_0x2d2a('0x1a'),_0x1c8ebb,_0x1d21bc?_0x2d2a('0x1b'):_0x2d2a('0x1c')),_['pick'](_0x5c2104,attributes));}var rpc={'openchannelQueueReport':require(_0x2d2a('0x1d')),'mailQueueReport':require(_0x2d2a('0x1e')),'chatQueueReport':require(_0x2d2a('0x1f')),'smsQueueReport':require(_0x2d2a('0x20')),'faxQueueReport':require(_0x2d2a('0x21')),'whatsappQueueReport':require(_0x2d2a('0x22'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x2d2a('0x23')},'timeout':{'type':_0x2d2a('0x24'),'message':_0x2d2a('0x25')}});function startRouting(_0x5a7555,_0x12fcba,_0x3e1f5a,_0x34b9bb){if(_0x5a7555&&_0x12fcba&&_0x3e1f5a){_0x12fcba[_0x2d2a('0x26')]+=0x1;var _0xbff0ac={'uniqueid':_0x5a7555,'from':_0x3e1f5a[_0x2d2a('0x27')]?_0x3e1f5a[_0x2d2a('0x27')][_0x2d2a('0x28')]:'','joinAt':moment()[_0x2d2a('0x16')](_0x2d2a('0x29')),'ContactId':_0x3e1f5a['contact']?_0x3e1f5a['contact']['id']:null,'ListId':_0x3e1f5a['list']?_0x3e1f5a[_0x2d2a('0x2a')]['id']:null};_0xbff0ac[_['upperFirst'](_0x3e1f5a[_0x2d2a('0x2b')])+'QueueId']=_0x12fcba['id']||null;_0xbff0ac[_['upperFirst'](_0x3e1f5a[_0x2d2a('0x2b')])+'InteractionId']=_0x3e1f5a['interaction']?_0x3e1f5a[_0x2d2a('0x2c')]['id']:null;_0xbff0ac[_[_0x2d2a('0x2d')](_0x3e1f5a['channel'])+'MessageId']=_0x3e1f5a[_0x2d2a('0x2e')]?_0x3e1f5a[_0x2d2a('0x2e')]['id']:null;_0xbff0ac[_[_0x2d2a('0x2d')](_0x3e1f5a[_0x2d2a('0x2b')])+(_0x3e1f5a[_0x2d2a('0x2b')]!==_0x2d2a('0x2f')?_0x2d2a('0x30'):_0x2d2a('0x31'))]=_0x3e1f5a['account']?_0x3e1f5a['account']['id']:null;logger['info'](util[_0x2d2a('0x16')](_0x2d2a('0x32'),_0x5a7555,_0x12fcba[_0x2d2a('0x33')]));emitChannelQueueInteraction(_0x3e1f5a[_0x2d2a('0x2b')],_0x12fcba[_0x2d2a('0x33')],_0xbff0ac,_0x3e1f5a[_0x2d2a('0xf')][_0x2d2a('0x33')],_0x3e1f5a[_0x2d2a('0x2e')]['id'],!![],_0x34b9bb,_0x12fcba['id']);if(rpc[_0x3e1f5a[_0x2d2a('0x2b')]+_0x2d2a('0x34')]){return rpc[_0x3e1f5a['channel']+_0x2d2a('0x34')][_0x2d2a('0x35')](_0xbff0ac)[_0x2d2a('0x36')](function(_0x2f160f){logger['error'](_0x2d2a('0x37'));});}}}function stopRouting(_0x35cf67,_0x54a437,_0x3a9aad,_0x16f049){if(_0x35cf67&&_0x54a437){_0x54a437[_0x2d2a('0x26')]-=0x1;var _0x1ce05a={'leaveAt':moment()['format'](_0x2d2a('0x29')),'acceptAt':moment()[_0x2d2a('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2d2a('0x38')};logger[_0x2d2a('0x39')](util[_0x2d2a('0x16')](_0x2d2a('0x3a'),_0x35cf67,_0x54a437[_0x2d2a('0x33')]));emitChannelQueueInteraction(_0x3a9aad[_0x2d2a('0x2b')],_0x54a437['name'],_0x3a9aad[_0x2d2a('0x27')],_0x3a9aad[_0x2d2a('0xf')][_0x2d2a('0x33')],_0x3a9aad[_0x2d2a('0x2e')]['id'],![],_0x16f049,_0x54a437['id']);if(rpc[_0x3a9aad['channel']+_0x2d2a('0x34')]){return rpc[_0x3a9aad[_0x2d2a('0x2b')]+_0x2d2a('0x34')]['update'](_0x35cf67,_0x1ce05a)[_0x2d2a('0x36')](function(_0x32ff61){logger[_0x2d2a('0x3b')](_0x2d2a('0x3c'));});}}}function endRouting(_0xeda305,_0x50fae9,_0x20353d,_0x5da32f){if(_0xeda305&&_0x50fae9){_0x50fae9[_0x2d2a('0x26')]-=0x1;var _0x4dd0ed={'leaveAt':moment()[_0x2d2a('0x16')](_0x2d2a('0x29')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2d2a('0x3d')};logger[_0x2d2a('0x39')](util[_0x2d2a('0x16')](_0x2d2a('0x3e'),_0xeda305,_0x50fae9[_0x2d2a('0x33')]));emitChannelQueueInteraction(_0x20353d['channel'],_0x50fae9['name'],_0x20353d[_0x2d2a('0x27')],_0x20353d[_0x2d2a('0xf')]['name'],_0x20353d[_0x2d2a('0x2e')]['id'],![],_0x5da32f);if(rpc[_0x20353d['channel']+_0x2d2a('0x34')]){return rpc[_0x20353d[_0x2d2a('0x2b')]+_0x2d2a('0x34')]['update'](_0xeda305,_0x4dd0ed)['catch'](function(_0x533820){logger['error'](_0x2d2a('0x3c'));});}}}function handleFindQueue(_0x4ed819){return function(_0x1763ad){return _0x1763ad[_0x2d2a('0x33')][_0x2d2a('0x3f')]()===_0x4ed819['toLowerCase']();};}exports[_0x2d2a('0x40')]=function(_0x350a11,_0x2a9557,_0x10696d,_0x2b1e6a){return function(_0x22377d){try{var _0x427be7={'name':_0x2a9557[0x0],'timeout':_0x2a9557[0x1]};var _0x363589=queue[_0x2d2a('0x0')](_0x427be7,{'typecast':!![]});if(_0x363589[_0x2d2a('0x41')]){logger[_0x2d2a('0x3b')](_0x2d2a('0x42'),_0x350a11,_[_0x2d2a('0x43')](_0x363589,_0x2d2a('0x2e'))[_0x2d2a('0x44')](',\x20'));_0x22377d[_0x2d2a('0x45')]();}else{var _0x400680=_[_0x2d2a('0x46')](_0x10696d[_0x2b1e6a['channel']+_0x2d2a('0x47')],handleFindQueue(_0x427be7['name']));if(_0x400680){startRouting(_0x350a11,_0x400680,_0x2b1e6a,_0x10696d);var _0x44edd9=(_0x400680[_0x2d2a('0x3d')]||0xa)*0x3e8;var _0x4c0fd5=(_0x427be7[_0x2d2a('0x3d')]||0x14)*0x3e8;var _0xe83cbc;if(_0x44edd9>_0x4c0fd5){_0x4c0fd5=_0x44edd9;}var _0x2f8410=seqqueue[_0x2d2a('0x48')](_0x44edd9);_0x2f8410['id']=_0x350a11;_0x2f8410[_0x2d2a('0x49')]=_0x44edd9;_0x2f8410[_0x2d2a('0x4a')]=_0x4c0fd5;_0x2f8410[_0x2d2a('0x2b')]=_0x2b1e6a['channel'];_0x10696d[_0x2d2a('0x4b')][_0x350a11]['on']('end',function(){logger[_0x2d2a('0x39')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x350a11);stopRouting(_0x350a11,_0x400680,_0x2b1e6a,_0x10696d);clearTimeout(_0xe83cbc);_0xe83cbc=undefined;_0x2f8410[_0x2d2a('0x4c')](!![]);if(_0x10696d[_0x2d2a('0x4b')][_0x350a11]){delete _0x10696d[_0x2d2a('0x4b')][_0x350a11];}_0x22377d[_0x2d2a('0x45')]();});_0x10696d[_0x2d2a('0x4b')][_0x350a11]['on'](_0x2d2a('0x4d'),function(){if(_0x10696d[_0x2d2a('0x4b')][_0x350a11]){delete _0x10696d[_0x2d2a('0x4b')][_0x350a11];}});_0xe83cbc=setTimeout(function(){logger[_0x2d2a('0x39')](_0x2d2a('0x4e'),_0x350a11);endRouting(_0x350a11,_0x400680,_0x2b1e6a,_0x10696d);clearTimeout(_0xe83cbc);_0x2f8410[_0x2d2a('0x4c')](!![]);_0x22377d[_0x2d2a('0x4f')]();},_0x4c0fd5);switch(_0x400680[_0x2d2a('0x50')]){case'rrmemory':strategy['rrmemory'](_0x2f8410,_0x400680,_0x10696d,_0x2b1e6a);break;default:strategy['beepall'](_0x2f8410,_0x400680,_0x10696d,_0x2b1e6a);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x350a11,_0x427be7[_0x2d2a('0x33')]);_0x22377d[_0x2d2a('0x45')]();}}}catch(_0x476951){console[_0x2d2a('0x51')](_0x476951);logger[_0x2d2a('0x3b')](_0x2d2a('0x42'),_0x350a11,_0x476951[_0x2d2a('0x52')]);_0x22377d[_0x2d2a('0x45')]();}};}; \ No newline at end of file +var _0xbb22=['Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','strategy','rrmemory','beepall','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','info','[%s][END:QUEUE][NAME:%s]','body','update\x20queue\x20report','[%s][QUEUE]\x20%s','map','join','find'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0xbb22,0x1ef));var _0x2bb2=function(_0x2e6611,_0x144c74){_0x2e6611=_0x2e6611-0x0;var _0x1737ab=_0xbb22[_0x2e6611];return _0x1737ab;};'use strict';var schema=require('validate');var _=require(_0x2bb2('0x0'));var util=require(_0x2bb2('0x1'));var seqqueue=require(_0x2bb2('0x2'));var moment=require(_0x2bb2('0x3'));var Redis=require(_0x2bb2('0x4'));var config=require(_0x2bb2('0x5'));var logger=require(_0x2bb2('0x6'))(_0x2bb2('0x7'));var strategy=require(_0x2bb2('0x8'));config['redis']=_['defaults'](config[_0x2bb2('0x9')],{'host':_0x2bb2('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x2bb2('0xb'),_0x2bb2('0xc'),_0x2bb2('0xd'),'from','joinAt'];function emit(_0x24ee5b,_0x370abe,_0x5e42f4){io['to'](_0x24ee5b)['emit'](_0x370abe,_0x5e42f4);}function emitChannelQueueInteraction(_0x670e6f,_0x5d8128,_0x291172,_0x418cbb,_0x5e44b3,_0x2e80b6,_0x371052,_0x17bd1b){var _0x3ed329=_[_0x2bb2('0xe')](_0x291172);_0x3ed329[_0x2bb2('0xb')]=_0x17bd1b;_0x3ed329[_0x2bb2('0xd')]=_0x5d8128;_0x3ed329[_0x2bb2('0xc')]=_0x418cbb;_0x3ed329['id']=_0x5e44b3;if(_0x2e80b6){attributes[_0x2bb2('0xf')](_[_0x2bb2('0x10')](_0x670e6f)+_0x2bb2('0x11'));_0x371052[util[_0x2bb2('0x12')](_0x2bb2('0x13'),_0x670e6f)][_0x5e44b3]=_[_0x2bb2('0x14')](_0x3ed329,attributes);}else{delete _0x371052[util[_0x2bb2('0x12')](_0x2bb2('0x13'),_0x670e6f)][_0x5e44b3];}emit(util['format'](_0x2bb2('0x15'),_0x670e6f,_0x5d8128),util[_0x2bb2('0x12')](_0x2bb2('0x16'),_0x670e6f,_0x2e80b6?_0x2bb2('0x17'):_0x2bb2('0x18')),_[_0x2bb2('0x14')](_0x3ed329,attributes));}var rpc={'openchannelQueueReport':require(_0x2bb2('0x19')),'mailQueueReport':require(_0x2bb2('0x1a')),'chatQueueReport':require(_0x2bb2('0x1b')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x2bb2('0x1c')),'whatsappQueueReport':require(_0x2bb2('0x1d'))};var queue=schema({'name':{'type':_0x2bb2('0x1e'),'required':!![],'message':_0x2bb2('0x1f')},'timeout':{'type':_0x2bb2('0x20'),'message':_0x2bb2('0x21')}});function startRouting(_0x47af42,_0x147891,_0x30e363,_0x5239b7){if(_0x47af42&&_0x147891&&_0x30e363){_0x147891[_0x2bb2('0x22')]+=0x1;var _0x1857cc={'uniqueid':_0x47af42,'from':_0x30e363['body']?_0x30e363['body']['from']:'','joinAt':moment()[_0x2bb2('0x12')](_0x2bb2('0x23')),'ContactId':_0x30e363[_0x2bb2('0x24')]?_0x30e363[_0x2bb2('0x24')]['id']:null,'ListId':_0x30e363['list']?_0x30e363[_0x2bb2('0x25')]['id']:null};_0x1857cc[_[_0x2bb2('0x26')](_0x30e363[_0x2bb2('0x27')])+_0x2bb2('0x28')]=_0x147891['id']||null;_0x1857cc[_[_0x2bb2('0x26')](_0x30e363[_0x2bb2('0x27')])+_0x2bb2('0x11')]=_0x30e363[_0x2bb2('0x29')]?_0x30e363['interaction']['id']:null;_0x1857cc[_[_0x2bb2('0x26')](_0x30e363[_0x2bb2('0x27')])+'MessageId']=_0x30e363[_0x2bb2('0x2a')]?_0x30e363[_0x2bb2('0x2a')]['id']:null;_0x1857cc[_[_0x2bb2('0x26')](_0x30e363[_0x2bb2('0x27')])+(_0x30e363[_0x2bb2('0x27')]!==_0x2bb2('0x2b')?_0x2bb2('0x2c'):_0x2bb2('0x2d'))]=_0x30e363[_0x2bb2('0xc')]?_0x30e363['account']['id']:null;logger['info'](util['format'](_0x2bb2('0x2e'),_0x47af42,_0x147891['name']));emitChannelQueueInteraction(_0x30e363[_0x2bb2('0x27')],_0x147891[_0x2bb2('0x2f')],_0x1857cc,_0x30e363[_0x2bb2('0xc')][_0x2bb2('0x2f')],_0x30e363[_0x2bb2('0x2a')]['id'],!![],_0x5239b7,_0x147891['id']);if(rpc[_0x30e363[_0x2bb2('0x27')]+_0x2bb2('0x30')]){return rpc[_0x30e363[_0x2bb2('0x27')]+_0x2bb2('0x30')][_0x2bb2('0x31')](_0x1857cc)[_0x2bb2('0x32')](function(_0x364e37){logger[_0x2bb2('0x33')](_0x2bb2('0x34'));});}}}function stopRouting(_0xb5d65e,_0x504438,_0xe5eed2,_0x41a27b){if(_0xb5d65e&&_0x504438){_0x504438[_0x2bb2('0x22')]-=0x1;var _0x5910b7={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x2bb2('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2bb2('0x35')};logger['info'](util['format'](_0x2bb2('0x36'),_0xb5d65e,_0x504438[_0x2bb2('0x2f')]));emitChannelQueueInteraction(_0xe5eed2[_0x2bb2('0x27')],_0x504438[_0x2bb2('0x2f')],_0xe5eed2['body'],_0xe5eed2[_0x2bb2('0xc')][_0x2bb2('0x2f')],_0xe5eed2[_0x2bb2('0x2a')]['id'],![],_0x41a27b,_0x504438['id']);if(rpc[_0xe5eed2[_0x2bb2('0x27')]+'QueueReport']){return rpc[_0xe5eed2[_0x2bb2('0x27')]+_0x2bb2('0x30')][_0x2bb2('0x37')](_0xb5d65e,_0x5910b7)[_0x2bb2('0x32')](function(_0x27334d){logger[_0x2bb2('0x33')]('update\x20queue\x20report');});}}}function endRouting(_0x458b4f,_0xaf7e09,_0x518099,_0x4d4724){if(_0x458b4f&&_0xaf7e09){_0xaf7e09[_0x2bb2('0x22')]-=0x1;var _0x564bae={'leaveAt':moment()['format'](_0x2bb2('0x23')),'exitAt':moment()['format'](_0x2bb2('0x23')),'reason':_0x2bb2('0x38')};logger[_0x2bb2('0x39')](util[_0x2bb2('0x12')](_0x2bb2('0x3a'),_0x458b4f,_0xaf7e09[_0x2bb2('0x2f')]));emitChannelQueueInteraction(_0x518099[_0x2bb2('0x27')],_0xaf7e09[_0x2bb2('0x2f')],_0x518099[_0x2bb2('0x3b')],_0x518099[_0x2bb2('0xc')][_0x2bb2('0x2f')],_0x518099['message']['id'],![],_0x4d4724);if(rpc[_0x518099[_0x2bb2('0x27')]+_0x2bb2('0x30')]){return rpc[_0x518099[_0x2bb2('0x27')]+'QueueReport'][_0x2bb2('0x37')](_0x458b4f,_0x564bae)[_0x2bb2('0x32')](function(_0xd6911c){logger['error'](_0x2bb2('0x3c'));});}}}function handleFindQueue(_0x41e994){return function(_0x162102){return _0x162102['name']['toLowerCase']()===_0x41e994['toLowerCase']();};}exports['consequence']=function(_0x1710a1,_0x2e3816,_0x48fbd6,_0x3dafcf){return function(_0x3c77b4){try{var _0x427efb={'name':_0x2e3816[0x0],'timeout':_0x2e3816[0x1]};var _0x1562ea=queue['validate'](_0x427efb,{'typecast':!![]});if(_0x1562ea['length']){logger[_0x2bb2('0x33')](_0x2bb2('0x3d'),_0x1710a1,_[_0x2bb2('0x3e')](_0x1562ea,_0x2bb2('0x2a'))[_0x2bb2('0x3f')](',\x20'));_0x3c77b4['stop']();}else{var _0x1c3f82=_[_0x2bb2('0x40')](_0x48fbd6[_0x3dafcf[_0x2bb2('0x27')]+_0x2bb2('0x41')],handleFindQueue(_0x427efb[_0x2bb2('0x2f')]));if(_0x1c3f82){startRouting(_0x1710a1,_0x1c3f82,_0x3dafcf,_0x48fbd6);var _0x2c0fa0=(_0x1c3f82[_0x2bb2('0x38')]||0xa)*0x3e8;var _0x163735=(_0x427efb[_0x2bb2('0x38')]||0x14)*0x3e8;var _0x1d97c2;if(_0x2c0fa0>_0x163735){_0x163735=_0x2c0fa0;}var _0x43c8ba=seqqueue[_0x2bb2('0x42')](_0x2c0fa0);_0x43c8ba['id']=_0x1710a1;_0x43c8ba[_0x2bb2('0x43')]=_0x2c0fa0;_0x43c8ba[_0x2bb2('0x44')]=_0x163735;_0x43c8ba[_0x2bb2('0x27')]=_0x3dafcf[_0x2bb2('0x27')];_0x48fbd6[_0x2bb2('0x45')][_0x1710a1]['on'](_0x2bb2('0x46'),function(){logger[_0x2bb2('0x39')](_0x2bb2('0x47'),_0x1710a1);stopRouting(_0x1710a1,_0x1c3f82,_0x3dafcf,_0x48fbd6);clearTimeout(_0x1d97c2);_0x1d97c2=undefined;_0x43c8ba[_0x2bb2('0x48')](!![]);if(_0x48fbd6[_0x2bb2('0x45')][_0x1710a1]){delete _0x48fbd6[_0x2bb2('0x45')][_0x1710a1];}_0x3c77b4[_0x2bb2('0x49')]();});_0x48fbd6[_0x2bb2('0x45')][_0x1710a1]['on'](_0x2bb2('0x4a'),function(){if(_0x48fbd6['rules'][_0x1710a1]){delete _0x48fbd6[_0x2bb2('0x45')][_0x1710a1];}});_0x1d97c2=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x1710a1);endRouting(_0x1710a1,_0x1c3f82,_0x3dafcf,_0x48fbd6);clearTimeout(_0x1d97c2);_0x43c8ba[_0x2bb2('0x48')](!![]);_0x3c77b4['next']();},_0x163735);switch(_0x1c3f82[_0x2bb2('0x4b')]){case _0x2bb2('0x4c'):strategy['rrmemory'](_0x43c8ba,_0x1c3f82,_0x48fbd6,_0x3dafcf);break;default:strategy[_0x2bb2('0x4d')](_0x43c8ba,_0x1c3f82,_0x48fbd6,_0x3dafcf);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x1710a1,_0x427efb[_0x2bb2('0x2f')]);_0x3c77b4[_0x2bb2('0x49')]();}}}catch(_0x5956cf){console[_0x2bb2('0x4e')](_0x5956cf);logger[_0x2bb2('0x33')]('[%s][QUEUE]\x20%s',_0x1710a1,_0x5956cf[_0x2bb2('0x4f')]);_0x3c77b4[_0x2bb2('0x49')]();}};}; \ 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 e8bdc1f..002a6a7 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 _0x68fc=['timeout','drained','prototype','push','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','squeue','agent','realtime','routing','handleRun','bind','handleTimeout'];(function(_0x28e72b,_0x5e16ab){var _0x77418f=function(_0xe6d89d){while(--_0xe6d89d){_0x28e72b['push'](_0x28e72b['shift']());}};_0x77418f(++_0x5e16ab);}(_0x68fc,0xa5));var _0xc68f=function(_0x3c3cb4,_0x12cb83){_0x3c3cb4=_0x3c3cb4-0x0;var _0x8d6e07=_0x68fc[_0x3c3cb4];return _0x8d6e07;};'use strict';var _=require(_0xc68f('0x0'));var uuid=require(_0xc68f('0x1'));var util=require(_0xc68f('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x26513f,_0x506fb5,_0xe70787,_0x593648){this['notificationId']=uuid['v4']();this[_0xc68f('0x3')]=_0x26513f;this[_0xc68f('0x4')]=_0x506fb5;this[_0xc68f('0x5')]=_0xe70787;this[_0xc68f('0x6')]=_0x593648;this['squeue']['push'](this[_0xc68f('0x7')][_0xc68f('0x8')](this),this[_0xc68f('0x9')][_0xc68f('0x8')](this));this[_0xc68f('0x3')]['on'](_0xc68f('0xa'),this[_0xc68f('0x9')][_0xc68f('0x8')](this));this[_0xc68f('0x3')]['on'](_0xc68f('0xb'),this['handleDrained'][_0xc68f('0x8')](this));};Agent[_0xc68f('0xc')][_0xc68f('0xd')]=function(){this[_0xc68f('0x3')][_0xc68f('0xd')](this[_0xc68f('0x7')][_0xc68f('0x8')](this),this[_0xc68f('0x9')][_0xc68f('0x8')](this));};Agent[_0xc68f('0xc')][_0xc68f('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0xc68f('0xc')][_0xc68f('0x7')]=function(){logger[_0xc68f('0xf')](_0xc68f('0x10'),this[_0xc68f('0x3')]['id'],this[_0xc68f('0x4')]['id']);if(_[_0xc68f('0x11')](this[_0xc68f('0x5')][_0xc68f('0x12')][this['agent']['id']])){logger['debug'](_0xc68f('0x13'),this[_0xc68f('0x3')]['id'],this[_0xc68f('0x4')]['id']);setTimeout(this[_0xc68f('0xd')][_0xc68f('0x8')](this),0x3e8);}else{if(this[_0xc68f('0x6')]['forcedOwnership']||util[_0xc68f('0x14')](this[_0xc68f('0x3')]['id'],this[_0xc68f('0x5')][_0xc68f('0x12')][this[_0xc68f('0x4')]['id']],this[_0xc68f('0x3')][_0xc68f('0x15')],![])){this[_0xc68f('0x5')]['agents'][this[_0xc68f('0x4')]['id']][_0xc68f('0x16')]=!![];this[_0xc68f('0x5')]['agents'][this[_0xc68f('0x4')]['id']][_0xc68f('0x17')]=undefined;util[_0xc68f('0x18')](this[_0xc68f('0x5')],this[_0xc68f('0x6')],this[_0xc68f('0x4')],this[_0xc68f('0x3')]['channel']);util[_0xc68f('0x19')](this[_0xc68f('0x1a')],this['squeue']['id'],this[_0xc68f('0x5')][_0xc68f('0x12')][this[_0xc68f('0x4')]['id']],null,this[_0xc68f('0x6')]);util[_0xc68f('0x1b')](this['squeue']['id'],this[_0xc68f('0x5')][_0xc68f('0x12')][this['agent']['id']],_0xc68f('0x1c')+(this[_0xc68f('0x6')]['forcedOwnership']?_0xc68f('0x1d'):''));}else{logger[_0xc68f('0xf')](_0xc68f('0x1e'),this[_0xc68f('0x3')]['id'],this['agent']['id']);setTimeout(this[_0xc68f('0xd')][_0xc68f('0x8')](this),0x3e8);}}};Agent[_0xc68f('0xc')][_0xc68f('0x9')]=function(_0x1ba1ac){if(_[_0xc68f('0x11')](this[_0xc68f('0x5')][_0xc68f('0x12')][this['agent']['id']])){return logger[_0xc68f('0xf')](_0xc68f('0x13'),this['squeue']['id'],this[_0xc68f('0x4')]['id']);}else{logger[_0xc68f('0xf')](_0xc68f('0x1f'),this[_0xc68f('0x3')]['id'],this['agent']['id']);util[_0xc68f('0x20')](this[_0xc68f('0x1a')],this['squeue']['id'],this[_0xc68f('0x5')][_0xc68f('0x12')][this[_0xc68f('0x4')]['id']],null,this[_0xc68f('0x6')]);this[_0xc68f('0x5')]['agents'][this['agent']['id']][_0xc68f('0x16')]=![];this[_0xc68f('0x5')][_0xc68f('0x12')][this[_0xc68f('0x4')]['id']][_0xc68f('0x17')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0xc68f('0x6')],this['agent'],this[_0xc68f('0x3')][_0xc68f('0x15')]);util[_0xc68f('0x1b')](this[_0xc68f('0x3')]['id'],this[_0xc68f('0x5')][_0xc68f('0x12')][this[_0xc68f('0x4')]['id']],_0x1ba1ac?'STOP':_0xc68f('0x21'));}if(!_0x1ba1ac){setTimeout(this[_0xc68f('0xd')][_0xc68f('0x8')](this),0x3e8);}};function agent(_0x360810,_0xc12ffb,_0x2555c0,_0x3c36f1){return new Agent(_0x360810,_0xc12ffb,_0x2555c0,_0x3c36f1);}module[_0xc68f('0x22')]=agent; \ No newline at end of file +var _0x00bb=['bind','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','realtime','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agent','forcedOwnership','agents','busy','busyQueue','channel','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','push','handleRun'];(function(_0x4d0d10,_0x5638d1){var _0x2a3db1=function(_0x201542){while(--_0x201542){_0x4d0d10['push'](_0x4d0d10['shift']());}};_0x2a3db1(++_0x5638d1);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xb00b('0x0'));var uuid=require(_0xb00b('0x1'));var util=require(_0xb00b('0x2'));var logger=require('../../../../../config/logger')(_0xb00b('0x3'));var Agent=function(_0x47a3bf,_0x278c5e,_0x464fe7,_0x582ef9){this[_0xb00b('0x4')]=uuid['v4']();this[_0xb00b('0x5')]=_0x47a3bf;this['agent']=_0x278c5e;this['realtime']=_0x464fe7;this['routing']=_0x582ef9;this[_0xb00b('0x5')][_0xb00b('0x6')](this[_0xb00b('0x7')][_0xb00b('0x8')](this),this[_0xb00b('0x9')][_0xb00b('0x8')](this));this['squeue']['on']('timeout',this[_0xb00b('0x9')][_0xb00b('0x8')](this));this[_0xb00b('0x5')]['on'](_0xb00b('0xa'),this[_0xb00b('0xb')]['bind'](this));};Agent[_0xb00b('0xc')]['push']=function(){this['squeue']['push'](this[_0xb00b('0x7')][_0xb00b('0x8')](this),this[_0xb00b('0x9')][_0xb00b('0x8')](this));};Agent[_0xb00b('0xc')][_0xb00b('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0xb00b('0xc')][_0xb00b('0x7')]=function(){logger['debug'](_0xb00b('0xd'),this[_0xb00b('0x5')]['id'],this['agent']['id']);if(_['isNil'](this[_0xb00b('0xe')]['agents'][this['agent']['id']])){logger[_0xb00b('0xf')](_0xb00b('0x10'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);setTimeout(this['push'][_0xb00b('0x8')](this),0x3e8);}else{if(this['routing'][_0xb00b('0x12')]||util['isAgentAvailable'](this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],this['squeue']['channel'],![])){this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']][_0xb00b('0x14')]=!![];this[_0xb00b('0xe')][_0xb00b('0x13')][this['agent']['id']][_0xb00b('0x15')]=undefined;util['saveWaitingNotification'](this[_0xb00b('0xe')],this[_0xb00b('0x3')],this['agent'],this[_0xb00b('0x5')][_0xb00b('0x16')]);util['showNotification'](this[_0xb00b('0x4')],this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],null,this[_0xb00b('0x3')]);util[_0xb00b('0x17')](this['squeue']['id'],this['realtime'][_0xb00b('0x13')][this['agent']['id']],'RINGING'+(this['routing'][_0xb00b('0x12')]?_0xb00b('0x18'):''));}else{logger[_0xb00b('0xf')](_0xb00b('0x19'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);setTimeout(this[_0xb00b('0x6')]['bind'](this),0x3e8);}}};Agent[_0xb00b('0xc')]['handleTimeout']=function(_0x450129){if(_[_0xb00b('0x1a')](this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']])){return logger[_0xb00b('0xf')](_0xb00b('0x10'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);}else{logger[_0xb00b('0xf')](_0xb00b('0x1b'),this[_0xb00b('0x5')]['id'],this[_0xb00b('0x11')]['id']);util['hideNotification'](this[_0xb00b('0x4')],this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],null,this['routing']);this[_0xb00b('0xe')]['agents'][this[_0xb00b('0x11')]['id']][_0xb00b('0x14')]=![];this[_0xb00b('0xe')][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']][_0xb00b('0x15')]=undefined;util[_0xb00b('0x1c')](this['realtime'],this['routing'],this['agent'],this[_0xb00b('0x5')][_0xb00b('0x16')]);util[_0xb00b('0x17')](this[_0xb00b('0x5')]['id'],this['realtime'][_0xb00b('0x13')][this[_0xb00b('0x11')]['id']],_0x450129?_0xb00b('0x1d'):_0xb00b('0x1e'));}if(!_0x450129){setTimeout(this[_0xb00b('0x6')][_0xb00b('0x8')](this),0x3e8);}};function agent(_0x8785ec,_0x3302ac,_0x5efc18,_0x55451e){return new Agent(_0x8785ec,_0x3302ac,_0x5efc18,_0x55451e);}module[_0xb00b('0x1f')]=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 ac5e69c..c7798ab 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 _0x2f88=['bind','timeout','drained','prototype','isNil','queue','Agents','length','agents','debug','isAgentAvailable','channel','busy','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','busyQueue','removeWaitingNotification','lodash','uuid','./util','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout'];(function(_0xee209,_0x4858f4){var _0x48cd8c=function(_0x5e3eda){while(--_0x5e3eda){_0xee209['push'](_0xee209['shift']());}};_0x48cd8c(++_0x4858f4);}(_0x2f88,0x16c));var _0x82f8=function(_0x2f410d,_0x3c256b){_0x2f410d=_0x2f410d-0x0;var _0x550534=_0x2f88[_0x2f410d];return _0x550534;};'use strict';var _=require(_0x82f8('0x0'));var uuid=require(_0x82f8('0x1'));var util=require(_0x82f8('0x2'));var logger=require('../../../../../config/logger')(_0x82f8('0x3'));var Beepall=function(_0x1eb692,_0x7e710b,_0x4266c3,_0x4d198b){this[_0x82f8('0x4')]=uuid['v4']();this[_0x82f8('0x5')]=_0x1eb692;this['queue']=_0x7e710b;this[_0x82f8('0x6')]=_0x4266c3;this[_0x82f8('0x3')]=_0x4d198b;this[_0x82f8('0x5')][_0x82f8('0x7')](this[_0x82f8('0x8')]['bind'](this),this[_0x82f8('0x9')][_0x82f8('0xa')](this));this['squeue']['on'](_0x82f8('0xb'),this[_0x82f8('0x9')]['bind'](this));this[_0x82f8('0x5')]['on'](_0x82f8('0xc'),this['handleDrained'][_0x82f8('0xa')](this));};Beepall[_0x82f8('0xd')][_0x82f8('0x7')]=function(){this[_0x82f8('0x5')][_0x82f8('0x7')](this[_0x82f8('0x8')][_0x82f8('0xa')](this),this['handleTimeout']['bind'](this));};Beepall[_0x82f8('0xd')]['handleDrained']=function(){this[_0x82f8('0x9')](!![]);};Beepall[_0x82f8('0xd')][_0x82f8('0x8')]=function(){var _0x362053=!![];if(!_[_0x82f8('0xe')](this[_0x82f8('0xf')])&&!_[_0x82f8('0xe')](this['queue'][_0x82f8('0x10')])&&this[_0x82f8('0xf')][_0x82f8('0x10')][_0x82f8('0x11')]>0x0){for(var _0x3422e7=0x0,_0x18f99e;_0x3422e70x0){for(var _0x3da34f=0x0,_0x5d6208;_0x3da34f0x0&&_0x1ccb32[_0x17b84e+_0x0b2b('0x25')]>=_0x1ccb32[_0x17b84e+'Capacity']){writeLog(_0x344571,_0x1ccb32,_0x17b84e[_0x0b2b('0x26')]()+_0x0b2b('0x27'));return![];}}return!![];};exports[_0x0b2b('0x28')]=function(_0x8c79d3,_0x1a2321,_0x32076b,_0xf98ef,_0x24b5cb){return sendNotification(!![],_0x8c79d3,_0x1a2321,_0x32076b,_0xf98ef,_0x24b5cb);};exports[_0x0b2b('0x29')]=function(_0x53bba9,_0x2de227,_0x3cbfa2,_0x5e8731,_0x43b0ef){return sendNotification(![],_0x53bba9,_0x2de227,_0x3cbfa2,_0x5e8731,_0x43b0ef);};exports[_0x0b2b('0x2a')]=function(_0x30c746,_0x146ca9,_0x30936f){var _0x2474a6=_0x146ca9[_0x0b2b('0x2b')]['UserId'];if(!_0x2474a6&&_0x30936f){_0x2474a6=_0x30936f['id'];}var _0x5c47a4=_[_0x0b2b('0x2c')](_0x30c746[_0x146ca9[_0x0b2b('0x2d')]+_0x0b2b('0x2e')],function(_0x2b92a2){var _0x9913a1=_['capitalize'](_0x146ca9[_0x0b2b('0x2d')])+_0x0b2b('0x2f');return _0x2b92a2[_0x9913a1]===_0x146ca9['interaction']['id'];});if(!_0x5c47a4&&_0x2474a6){_0x5c47a4=_[_0x0b2b('0x2c')](_0x30c746[_0x0b2b('0x30')][_0x2474a6][_0x146ca9[_0x0b2b('0x2d')]+_0x0b2b('0x31')],function(_0x4ca1b9){return _0x4ca1b9['id']===_0x146ca9[_0x0b2b('0x2b')]['id'];});}return _0x5c47a4;};exports[_0x0b2b('0x32')]=function(_0x5d412a,_0x31872a,_0x413004,_0xf4aa1){_0x5d412a[_0x0b2b('0x30')][_0x413004['id']][_0xf4aa1+'WaitingInteractions'][_0x31872a['message']['id']]={'id':_0x31872a[_0x0b2b('0x2b')]['id']};};exports[_0x0b2b('0x33')]=function(_0x1575a6,_0x352365,_0x2ab961,_0x4cd1db){delete _0x1575a6[_0x0b2b('0x30')][_0x2ab961['id']][_0x4cd1db+_0x0b2b('0x31')][_0x352365[_0x0b2b('0x18')]['id']];};exports[_0x0b2b('0x34')]=writeLog; \ No newline at end of file +var _0x7daf=['emit','user:save','account','notificationSound','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','message','notification:%s','remove','debug','isAgentAvailable','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','InteractionId','saveWaitingNotification','agents','WaitingInteractions','removeWaitingNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','format','user:%s','name'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x7daf,0x12f));var _0xf7da=function(_0x485cd4,_0x506e1b){_0x485cd4=_0x485cd4-0x0;var _0x528199=_0x7daf[_0x485cd4];return _0x528199;};'use strict';var _=require(_0xf7da('0x0'));var util=require(_0xf7da('0x1'));var utils=require(_0xf7da('0x2'));var Redis=require(_0xf7da('0x3'));var config=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));config[_0xf7da('0x7')]=_['defaults'](config[_0xf7da('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf7da('0x8'))(new Redis(config['redis']));function sendNotification(_0x4289f6,_0x1b1553,_0xea9884,_0x11efb5,_0xef56f1,_0x23af16){io['to'](util[_0xf7da('0x9')](_0xf7da('0xa'),_0x11efb5[_0xf7da('0xb')]))[_0xf7da('0xc')](_0xf7da('0xd'),_0x11efb5);var _0x44b4f9=_0x23af16||{};var _0xe561aa=_0xea9884['split']('.');var _0x8a6ee2={'uniqueid':_0x1b1553,'channel':_0xe561aa[0x0],'id':_0xe561aa[0x1],'title':_0xe561aa[0x0]+'\x20interaction','interactionId':_0xe561aa[0x2],'queue':_0xef56f1?_0xef56f1['name']:null,'sound':_0x44b4f9[_0xf7da('0xe')][_0xf7da('0xf')],'shake':_0x44b4f9[_0xf7da('0xe')]['notificationShake']};try{if(!_0x44b4f9['body']){_0x44b4f9[_0xf7da('0x10')]={};}if(_0xef56f1){_0x44b4f9[_0xf7da('0x10')][_0xf7da('0x11')]=_0xef56f1;}else if(_0x44b4f9[_0xf7da('0x10')]['queue']){delete _0x44b4f9['body']['queue'];}_0x8a6ee2[_0xf7da('0x12')]=utils['getMustacheRender'](_0x44b4f9['account'][_0xf7da('0x13')],_0x44b4f9);}catch(_0x1102b4){_0x8a6ee2['msg']=_0xf7da('0x14');logger['error'](util[_0xf7da('0x9')]('[%s][QUEUE]\x20%s',_0x1b1553,_0x1102b4[_0xf7da('0x15')]));}io['to'](util['format'](_0xf7da('0xa'),_0x11efb5[_0xf7da('0xb')]))[_0xf7da('0xc')](util[_0xf7da('0x9')](_0xf7da('0x16'),_0x4289f6?'save':_0xf7da('0x17')),_0x8a6ee2);}function writeLog(_0x1b9760,_0x45b2de,_0x553ab1){return logger[_0xf7da('0x18')](util[_0xf7da('0x9')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x1b9760,_0x45b2de[_0xf7da('0xb')],_0x553ab1));}exports[_0xf7da('0x19')]=function(_0x58236d,_0x16291d,_0x383ce5,_0xc578d2){if(_0x16291d[_0xf7da('0x1a')]){writeLog(_0x58236d,_0x16291d,'BUSY');return![];}if(!_0x16291d[_0xf7da('0x1b')]){writeLog(_0x58236d,_0x16291d,_0xf7da('0x1c'));return![];}if(_0x16291d[_0x383ce5+_0xf7da('0x1d')]){writeLog(_0x58236d,_0x16291d,_0xf7da('0x1e'));return![];}if(_0xc578d2&&_0x16291d[_0xf7da('0x1f')](_0x383ce5+_0xf7da('0x20'))&&_0x16291d[_0xf7da('0x1f')](_0x383ce5+_0xf7da('0x21'))){if(_0x16291d[_0x383ce5+_0xf7da('0x20')]>0x0&&_0x16291d[_0x383ce5+'CurrentCapacity']>=_0x16291d[_0x383ce5+_0xf7da('0x20')]){writeLog(_0x58236d,_0x16291d,_0x383ce5['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0xbfdac8,_0x5ba876,_0x2b9392,_0x4118b4,_0x12f839){return sendNotification(!![],_0xbfdac8,_0x5ba876,_0x2b9392,_0x4118b4,_0x12f839);};exports[_0xf7da('0x22')]=function(_0x5aef96,_0x58f2f1,_0x174ecc,_0x4075f4,_0x41960c){return sendNotification(![],_0x5aef96,_0x58f2f1,_0x174ecc,_0x4075f4,_0x41960c);};exports[_0xf7da('0x23')]=function(_0x42fbec,_0x4c693c,_0x3e1979){var _0x3f6d0b=_0x4c693c[_0xf7da('0x24')][_0xf7da('0x25')];if(!_0x3f6d0b&&_0x3e1979){_0x3f6d0b=_0x3e1979['id'];}var _0x396ff1=_[_0xf7da('0x26')](_0x42fbec[_0x4c693c[_0xf7da('0x27')]+'QueuesWaitingInteractions'],function(_0x240813){var _0x2b4d71=_['capitalize'](_0x4c693c[_0xf7da('0x27')])+_0xf7da('0x28');return _0x240813[_0x2b4d71]===_0x4c693c[_0xf7da('0x24')]['id'];});if(!_0x396ff1&&_0x3f6d0b){_0x396ff1=_[_0xf7da('0x26')](_0x42fbec['agents'][_0x3f6d0b][_0x4c693c[_0xf7da('0x27')]+'WaitingInteractions'],function(_0x5cb711){return _0x5cb711['id']===_0x4c693c['interaction']['id'];});}return _0x396ff1;};exports[_0xf7da('0x29')]=function(_0x5adc63,_0x451906,_0x1eab9a,_0x2a501d){_0x5adc63[_0xf7da('0x2a')][_0x1eab9a['id']][_0x2a501d+_0xf7da('0x2b')][_0x451906[_0xf7da('0x15')]['id']]={'id':_0x451906['interaction']['id']};};exports[_0xf7da('0x2c')]=function(_0x2d96b1,_0x2b9e8b,_0x341c68,_0x1762d5){delete _0x2d96b1['agents'][_0x341c68['id']][_0x1762d5+_0xf7da('0x2b')][_0x2b9e8b[_0xf7da('0x15')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 9af36ea..dba15b3 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 _0xe07c=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%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','length','error','[%s][SYSTEM]\x20%s','map','message','join'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xe07c,0x1f3));var _0xce07=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe07c[_0x27af45];return _0x18df21;};'use strict';var schema=require(_0xce07('0x0'));var sh=require(_0xce07('0x1'));var _=require(_0xce07('0x2'));var utils=require(_0xce07('0x3'));var logger=require(_0xce07('0x4'))(_0xce07('0x5'));var system=schema({'command':{'type':_0xce07('0x6'),'required':!![],'message':_0xce07('0x7')}});exports['consequence']=function(_0x337b78,_0x1bf2a8){return function(_0x1a871c){try{var _0x220497={'command':_0x1bf2a8[0x0]};var _0x402ce1=system[_0xce07('0x0')](_0x220497,{'typecast':!![]});if(_0x402ce1[_0xce07('0x8')]){logger[_0xce07('0x9')](_0xce07('0xa'),_0x337b78,_[_0xce07('0xb')](_0x402ce1,_0xce07('0xc'))[_0xce07('0xd')](',\x20'));logger[_0xce07('0xe')](_0xce07('0xf'),_0x337b78);_0x1a871c[_0xce07('0x10')]();}else{var _0x140c3e=this;var _0x57d108=utils[_0xce07('0x11')](_0x1bf2a8[0x0],this);logger[_0xce07('0xe')](_0xce07('0x12'),_0x337b78,_0x57d108);sh['exec'](_[_0xce07('0x13')](_0x57d108),function(_0x3c5c37,_0x44a16f){logger[_0xce07('0xe')](_0xce07('0x14'),_0x337b78,_0x3c5c37);if(_0x3c5c37==0x0){var _0x487732=_0x44a16f[_0xce07('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0xce07('0x16')](_0x1bf2a8[0x1])||_[_0xce07('0x17')](_0x1bf2a8[0x1])){logger[_0xce07('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0x337b78);_0x140c3e['body'][_0x1bf2a8[0x1]]=_0x487732;}else{logger[_0xce07('0xe')](_0xce07('0x18'),_0x337b78,_0x1bf2a8[0x1],_0x487732);_0x140c3e['body'][_0x1bf2a8[0x1]]=_0x487732;}}_0x1a871c[_0xce07('0x10')]();});}}catch(_0x1d0171){logger['error']('[%s][SYSTEM]\x20%s',_0x337b78,_[_0xce07('0x19')](_0x1d0171)?JSON[_0xce07('0x1a')](_0x1d0171):_0x1d0171);logger[_0xce07('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x337b78);_0x1a871c[_0xce07('0x10')]();}};}; \ No newline at end of file +var _0xcda7=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xcda7,0xce));var _0x7cda=function(_0x345190,_0x3f6649){_0x345190=_0x345190-0x0;var _0x397ddf=_0xcda7[_0x345190];return _0x397ddf;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0x7cda('0x0'));var logger=require(_0x7cda('0x1'))(_0x7cda('0x2'));var system=schema({'command':{'type':_0x7cda('0x3'),'required':!![],'message':_0x7cda('0x4')}});exports[_0x7cda('0x5')]=function(_0x160848,_0x53da0d){return function(_0x282cd5){try{var _0x369ad3={'command':_0x53da0d[0x0]};var _0x5699e5=system['validate'](_0x369ad3,{'typecast':!![]});if(_0x5699e5[_0x7cda('0x6')]){logger[_0x7cda('0x7')](_0x7cda('0x8'),_0x160848,_[_0x7cda('0x9')](_0x5699e5,_0x7cda('0xa'))[_0x7cda('0xb')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x160848);_0x282cd5[_0x7cda('0xc')]();}else{var _0x2e65b0=this;var _0x4a3957=utils[_0x7cda('0xd')](_0x53da0d[0x0],this);logger['info'](_0x7cda('0xe'),_0x160848,_0x4a3957);sh['exec'](_[_0x7cda('0xf')](_0x4a3957),function(_0x4cf67c,_0x32aca1){logger[_0x7cda('0x10')](_0x7cda('0x11'),_0x160848,_0x4cf67c);if(_0x4cf67c==0x0){var _0x15601a=_0x32aca1[_0x7cda('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x7cda('0x13')](_0x53da0d[0x1])||_[_0x7cda('0x14')](_0x53da0d[0x1])){logger['info'](_0x7cda('0x15'),_0x160848);_0x2e65b0[_0x7cda('0x16')][_0x53da0d[0x1]]=_0x15601a;}else{logger[_0x7cda('0x10')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x160848,_0x53da0d[0x1],_0x15601a);_0x2e65b0[_0x7cda('0x16')][_0x53da0d[0x1]]=_0x15601a;}}_0x282cd5[_0x7cda('0xc')]();});}}catch(_0x18b8fd){logger[_0x7cda('0x7')](_0x7cda('0x8'),_0x160848,_[_0x7cda('0x17')](_0x18b8fd)?JSON[_0x7cda('0x18')](_0x18b8fd):_0x18b8fd);logger[_0x7cda('0x10')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x160848);_0x282cd5[_0x7cda('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index e7bb7ad..050aab9 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 _0x834e=['interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','addTags'];(function(_0x229128,_0x273558){var _0x1875b9=function(_0x275e35){while(--_0x275e35){_0x229128['push'](_0x229128['shift']());}};_0x1875b9(++_0x273558);}(_0x834e,0x18c));var _0xe834=function(_0x3a45b7,_0x2f4d40){_0x3a45b7=_0x3a45b7-0x0;var _0xa9782d=_0x834e[_0x3a45b7];return _0xa9782d;};'use strict';var schema=require(_0xe834('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xe834('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe834('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xe834('0x3')),'whatsappInteraction':require(_0xe834('0x4'))};var logger=require('../../../../config/logger')(_0xe834('0x5'));var tag=schema({'tag':{'type':_0xe834('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xe834('0x7')]=function(_0x74ea76,_0x96fc2f,_0x4822ab,_0x5de8f0){return function(_0x4aed70){try{var _0x37cff8={'tag':_0x96fc2f[0x0]};var _0x2d3638=tag[_0xe834('0x0')](_0x37cff8,{'typecast':!![]});if(_0x2d3638[_0xe834('0x8')]){logger[_0xe834('0x9')](_0xe834('0xa'),_0x74ea76,_[_0xe834('0xb')](_0x2d3638,'message')['join'](',\x20'));logger[_0xe834('0xc')](_0xe834('0xd'),_0x74ea76);_0x4aed70[_0xe834('0xe')]();}else{var _0x4df2e2={'ids':[_0x96fc2f[0x0]]};if(rpc[_0x5de8f0['channel']+_0xe834('0xf')]){rpc[_0x5de8f0[_0xe834('0x10')]+_0xe834('0xf')][_0xe834('0x11')](_0x5de8f0[_0xe834('0x12')]['id'],_0x4df2e2)['then'](function(_0x45ba31){logger[_0xe834('0xc')](_0xe834('0x13'),_0x74ea76,_0x96fc2f[0x1],_0x5de8f0[_0xe834('0x10')],_0x5de8f0[_0xe834('0x12')]['id']);})[_0xe834('0x14')](function(_0x3bdd4e){logger[_0xe834('0x9')]('[%s][TAG]\x20%s',_0x74ea76,JSON[_0xe834('0x15')](_0x3bdd4e));logger[_0xe834('0xc')](_0xe834('0xd'),_0x74ea76);})['finally'](function(){_0x4aed70[_0xe834('0xe')]();});}}}catch(_0x1e5aab){logger[_0xe834('0x9')](_0xe834('0xa'),_0x74ea76,_[_0xe834('0x16')](_0x1e5aab)?JSON[_0xe834('0x15')](_0x1e5aab):_0x1e5aab);logger['info'](_0xe834('0xd'),_0x74ea76);_0x4aed70[_0xe834('0xe')]();}};}; \ No newline at end of file +var _0xb14f=['../../rpc/whatsappInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','next','isObject','stringify','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x5ad9c9,_0x323a20){var _0x5082d9=function(_0x2bdd4f){while(--_0x2bdd4f){_0x5ad9c9['push'](_0x5ad9c9['shift']());}};_0x5082d9(++_0x323a20);}(_0xb14f,0x14b));var _0xfb14=function(_0x33d807,_0x2dc7fc){_0x33d807=_0x33d807-0x0;var _0x299f13=_0xb14f[_0x33d807];return _0x299f13;};'use strict';var schema=require(_0xfb14('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0xfb14('0x1')),'openchannelInteraction':require(_0xfb14('0x2')),'smsInteraction':require(_0xfb14('0x3')),'mailInteraction':require(_0xfb14('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xfb14('0x5'))};var logger=require('../../../../config/logger')(_0xfb14('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xfb14('0x7')}});exports[_0xfb14('0x8')]=function(_0x2a3199,_0x2fb1c7,_0x3f2bee,_0x3f832){return function(_0x99a6ee){try{var _0x5827d0={'tag':_0x2fb1c7[0x0]};var _0x13688c=tag[_0xfb14('0x0')](_0x5827d0,{'typecast':!![]});if(_0x13688c['length']){logger[_0xfb14('0x9')](_0xfb14('0xa'),_0x2a3199,_[_0xfb14('0xb')](_0x13688c,_0xfb14('0xc'))['join'](',\x20'));logger[_0xfb14('0xd')](_0xfb14('0xe'),_0x2a3199);_0x99a6ee['next']();}else{var _0x521ed8={'ids':[_0x2fb1c7[0x0]]};if(rpc[_0x3f832[_0xfb14('0xf')]+_0xfb14('0x10')]){rpc[_0x3f832[_0xfb14('0xf')]+_0xfb14('0x10')][_0xfb14('0x11')](_0x3f832['interaction']['id'],_0x521ed8)[_0xfb14('0x12')](function(_0x40d2ec){logger['info'](_0xfb14('0x13'),_0x2a3199,_0x2fb1c7[0x1],_0x3f832['channel'],_0x3f832['interaction']['id']);})['catch'](function(_0x47d399){logger[_0xfb14('0x9')]('[%s][TAG]\x20%s',_0x2a3199,JSON['stringify'](_0x47d399));logger['info'](_0xfb14('0xe'),_0x2a3199);})[_0xfb14('0x14')](function(){_0x99a6ee[_0xfb14('0x15')]();});}}}catch(_0x5ebf09){logger[_0xfb14('0x9')](_0xfb14('0xa'),_0x2a3199,_[_0xfb14('0x16')](_0x5ebf09)?JSON[_0xfb14('0x17')](_0x5ebf09):_0x5ebf09);logger[_0xfb14('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2a3199);_0x99a6ee[_0xfb14('0x15')]();}};}; \ 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 ef20937..62a6014 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 _0xf790=['parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','push','?params=','title','jsonrpc','2.0','login','params','stringify','utf8','application/json-rpc','then'];(function(_0xbb46f9,_0x259741){var _0x212134=function(_0x5d4236){while(--_0x5d4236){_0xbb46f9['push'](_0xbb46f9['shift']());}};_0x212134(++_0x259741);}(_0xf790,0x19b));var _0x0f79=function(_0x846538,_0x569f00){_0x846538=_0x846538-0x0;var _0x40c2a1=_0xf790[_0x846538];return _0x40c2a1;};'use strict';var rp=require(_0x0f79('0x0'));var logger=require(_0x0f79('0x1'))('routing');var _=require(_0x0f79('0x2'));var arr=[];exports[_0x0f79('0x3')]=function(_0x17d741,_0x28fa40){return function(_0x5255b2){var _0x5a399d=_0x28fa40[0xa];var _0x1005f7=_0x28fa40[0xb];var _0x526581=_0x28fa40[0xc];var _0x318c85=_0x28fa40[0xd];var _0x26ba5f=_0x28fa40[0xe];var _0x412ad5=_0x28fa40[0xf][_0x0f79('0x4')](/\n/g,_0x0f79('0x5'));var _0x5c6682=_0x28fa40[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x0f79('0x6')](_0x1005f7)){arr[_0x0f79('0x7')](_0x1005f7);var _0x8ad7e8=_0x28fa40[0x3];var _0x56fc82=_0x28fa40[0x4];var _0x3f3be6=_0x28fa40[0x1];var _0x1a0d27=_0x28fa40[0x0];var _0x1298de={};_0x1298de['urlOnAnswer']=_0x28fa40[0x8]+'?params='+_0x526581+'|'+_0x5a399d+'|'+_0x318c85+'|'+_0x1005f7+'|'+_0x26ba5f;_0x1298de['urlOnRing']=_0x28fa40[0x7]+_0x0f79('0x8')+_0x526581+'|'+_0x5a399d+'|'+_0x318c85+'|'+_0x1005f7+'|'+_0x26ba5f+'|'+_0x412ad5+'|'+_0x5c6682;_0x1298de[_0x0f79('0x9')]=_0x28fa40[0x9];var _0x24e763={};_0x24e763[_0x0f79('0xa')]=_0x0f79('0xb');_0x24e763['method']=_0x0f79('0xc');var _0x40fd8b=[];_0x40fd8b[_0x0f79('0x7')](_0x28fa40[0x2]);_0x40fd8b['push'](_0x28fa40[0x5]);_0x40fd8b[_0x0f79('0x7')](_0x28fa40[0x6]);_0x24e763[_0x0f79('0xd')]=_0x40fd8b;_0x24e763['id']=0x1;var _0x184471=JSON[_0x0f79('0xe')](_0x24e763);var _0x1ed72a={'encoding':_0x0f79('0xf'),'method':'POST','timeout':0x2710,'url':_0x8ad7e8,'headers':{'Content-Type':_0x0f79('0x10')},'body':_0x184471};return rp(_0x1ed72a)[_0x0f79('0x11')](function(_0x2ae810){const _0x4d23ef=JSON[_0x0f79('0x12')](_0x2ae810);if(!_0x4d23ef['result'][_0x0f79('0x13')]){throw new Error(_0x0f79('0x14'));}var _0xc2532f=_0x1005f7;var _0x43289e=_0x0f79('0x15')+_0x3f3be6+_0x0f79('0x16')+_0x1a0d27+_0x0f79('0x17')+_0xc2532f+_0x0f79('0x18')+JSON[_0x0f79('0xe')](_0x1298de);var _0x3504ab=_0x56fc82+'?'+_0x43289e;return rp(_0x3504ab);})[_0x0f79('0x11')](function(_0x4da8a7){logger[_0x0f79('0x19')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x17d741,_0x4da8a7);_0x5255b2[_0x0f79('0x1a')]();})[_0x0f79('0x1b')](function(_0x3b4cf3){logger[_0x0f79('0x1c')](_0x0f79('0x1d'),_0x17d741,_[_0x0f79('0x1e')](_0x3b4cf3)?JSON[_0x0f79('0xe')](_0x3b4cf3):_0x3b4cf3);_0x5255b2[_0x0f79('0x1a')]();});}else{logger[_0x0f79('0x19')](_0x0f79('0x1f'),_0x17d741);_0x5255b2[_0x0f79('0x20')]();}};}; \ No newline at end of file +var _0xa3da=['logged','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','includes','push','urlOnAnswer','?params=','title','2.0','method','login','stringify','utf8','POST','application/json-rpc','then','parse','result'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0xa3da,0x10b));var _0xaa3d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa3da[_0x2b10c6];return _0x3789d2;};'use strict';var rp=require(_0xaa3d('0x0'));var logger=require(_0xaa3d('0x1'))(_0xaa3d('0x2'));var _=require(_0xaa3d('0x3'));var arr=[];exports[_0xaa3d('0x4')]=function(_0x905db5,_0x5c57f7){return function(_0x1fec33){var _0x31b374=_0x5c57f7[0xa];var _0x3b0f59=_0x5c57f7[0xb];var _0x1a390f=_0x5c57f7[0xc];var _0x2a546f=_0x5c57f7[0xd];var _0x812f66=_0x5c57f7[0xe];var _0xfc0e56=_0x5c57f7[0xf]['replace'](/\n/g,_0xaa3d('0x5'));var _0x3286a9=_0x5c57f7[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xaa3d('0x6')](_0x3b0f59)){arr[_0xaa3d('0x7')](_0x3b0f59);var _0x207ee3=_0x5c57f7[0x3];var _0x4ae364=_0x5c57f7[0x4];var _0x492be8=_0x5c57f7[0x1];var _0x3417ab=_0x5c57f7[0x0];var _0x28f9a3={};_0x28f9a3[_0xaa3d('0x8')]=_0x5c57f7[0x8]+_0xaa3d('0x9')+_0x1a390f+'|'+_0x31b374+'|'+_0x2a546f+'|'+_0x3b0f59+'|'+_0x812f66;_0x28f9a3['urlOnRing']=_0x5c57f7[0x7]+_0xaa3d('0x9')+_0x1a390f+'|'+_0x31b374+'|'+_0x2a546f+'|'+_0x3b0f59+'|'+_0x812f66+'|'+_0xfc0e56+'|'+_0x3286a9;_0x28f9a3[_0xaa3d('0xa')]=_0x5c57f7[0x9];var _0x248899={};_0x248899['jsonrpc']=_0xaa3d('0xb');_0x248899[_0xaa3d('0xc')]=_0xaa3d('0xd');var _0x18b9a7=[];_0x18b9a7[_0xaa3d('0x7')](_0x5c57f7[0x2]);_0x18b9a7[_0xaa3d('0x7')](_0x5c57f7[0x5]);_0x18b9a7[_0xaa3d('0x7')](_0x5c57f7[0x6]);_0x248899['params']=_0x18b9a7;_0x248899['id']=0x1;var _0x273bc0=JSON[_0xaa3d('0xe')](_0x248899);var _0x3b54cf={'encoding':_0xaa3d('0xf'),'method':_0xaa3d('0x10'),'timeout':0x2710,'url':_0x207ee3,'headers':{'Content-Type':_0xaa3d('0x11')},'body':_0x273bc0};return rp(_0x3b54cf)[_0xaa3d('0x12')](function(_0x255edd){const _0x38ec2e=JSON[_0xaa3d('0x13')](_0x255edd);if(!_0x38ec2e[_0xaa3d('0x14')][_0xaa3d('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x8de063=_0x3b0f59;var _0x394e7f=_0xaa3d('0x16')+_0x492be8+_0xaa3d('0x17')+_0x3417ab+'&sessionId='+_0x8de063+_0xaa3d('0x18')+JSON['stringify'](_0x28f9a3);var _0x19b20d=_0x4ae364+'?'+_0x394e7f;return rp(_0x19b20d);})[_0xaa3d('0x12')](function(_0x53a796){logger['info'](_0xaa3d('0x19'),_0x905db5,_0x53a796);_0x1fec33[_0xaa3d('0x1a')]();})[_0xaa3d('0x1b')](function(_0x16f085){logger['error'](_0xaa3d('0x1c'),_0x905db5,_['isObject'](_0x16f085)?JSON[_0xaa3d('0xe')](_0x16f085):_0x16f085);_0x1fec33[_0xaa3d('0x1a')]();});}else{logger[_0xaa3d('0x1d')](_0xaa3d('0x1e'),_0x905db5);_0x1fec33[_0xaa3d('0x1f')]();}};}; \ 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 b14ef79..f1cdc12 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x8da167,_0x333ddb){var _0x2f451b=function(_0x7410be){while(--_0x7410be){_0x8da167['push'](_0x8da167['shift']());}};_0x2f451b(++_0x333ddb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x426c23,_0x34814f){var _0x27dd03=function(_0x54d472){while(--_0x54d472){_0x426c23['push'](_0x426c23['shift']());}};_0x27dd03(++_0x34814f);}(_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 ab7f94b..4c577a9 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 _0x21c4=['No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','QueueReport','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','./applications/utils','../../../config/logger','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','TagId','tvox','account','ChatWebsiteId','body','%s:%s:%s','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x21c4,0x8a));var _0x421c=function(_0x9a29ea,_0x5b8b29){_0x9a29ea=_0x9a29ea-0x0;var _0x11f261=_0x21c4[_0x9a29ea];return _0x11f261;};'use strict';var _=require(_0x421c('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x421c('0x1'));var BPromise=require('bluebird');var utils=require(_0x421c('0x2'));var sUtils=require('./applications/strategy/util');var logger=require(_0x421c('0x3'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x421c('0x4')),'chatQueueReport':require(_0x421c('0x5')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x421c('0x6')),'whatsappQueueReport':require(_0x421c('0x7'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x58bd14,_0x25c4ee,_0x1b5662){return util[_0x421c('0x8')]('%s.%s.%s',_0x58bd14,_0x25c4ee||0x0,_0x1b5662||0x0);}function getIntervals(_0x5610ba,_0x551ab7){var _0x375660=[];if(!_[_0x421c('0x9')](_0x551ab7[_0x421c('0xa')])&&!_[_0x421c('0x9')](_0x5610ba[_0x551ab7[_0x421c('0xa')]])&&!_[_0x421c('0x9')](_0x5610ba[_0x551ab7[_0x421c('0xa')]][_0x421c('0xb')])){_0x375660=_[_0x421c('0xc')](_0x5610ba[_0x551ab7[_0x421c('0xa')]][_0x421c('0xb')],_0x421c('0xd'));}else if(!_[_0x421c('0x9')](_0x551ab7[_0x421c('0xd')])){_0x375660=[_0x551ab7[_0x421c('0xd')]];}return _0x375660;}exports['listen']=function(_0x21e2a6){_0x21e2a6[_0x421c('0xe')]={};return new BPromise(function(_0x201625,_0x51435b){var _0x389f96={'Start':function(_0x3c090b){var _0x217b39=this;return new Promise(function(_0x5d52eb,_0x3102bc){if(_0x3c090b){try{var _0x2ffcfb=[];var _0x1965f2=getId(_0x3c090b[_0x421c('0xf')],_0x3c090b[_0x421c('0x10')]?_0x3c090b[_0x421c('0x10')]['id']:0x0,_0x3c090b[_0x421c('0x11')]?_0x3c090b[_0x421c('0x11')]['id']:0x0);var _0x1924bd=sUtils[_0x421c('0x12')](_0x21e2a6,_0x3c090b);if(!_0x1924bd&&_0x3c090b['applications']&&_[_0x421c('0x13')](_0x3c090b['applications'])&&_0x3c090b[_0x421c('0x14')]['length']){for(var _0xb49b48=0x0;_0xb49b48<_0x3c090b[_0x421c('0x14')][_0x421c('0x15')];_0xb49b48+=0x1){var _0x3df09b=_0x3c090b['applications'][_0xb49b48];if(fs[_0x421c('0x16')](path[_0x421c('0x17')](__dirname,_0x421c('0x14'),_0x3df09b[_0x421c('0x18')]+_0x421c('0x19')))){var _0x575553=[];switch(_0x3df09b[_0x421c('0x18')][_0x421c('0x1a')]()){case'autoreply':var _0x371fe3=_0x3df09b[_0x421c('0x1b')][_0x421c('0x1c')](',');if(_0x3c090b[_0x421c('0xf')]==='mail'){_0x575553[_0x421c('0x1d')](_0x371fe3[0x0]);_0x575553[_0x421c('0x1d')](_0x371fe3[0x1]);_0x575553['push'](_0x371fe3[_0x421c('0x1e')](0x2,_0x371fe3[_0x421c('0x15')])['join'](','));}else{_0x575553[_0x421c('0x1d')](_0x371fe3[0x0]);_0x575553[_0x421c('0x1d')](_0x371fe3['slice'](0x1,_0x371fe3[_0x421c('0x15')])[_0x421c('0x17')](','));}break;case _0x421c('0x1f'):var _0x1d5ed7=_0x3df09b[_0x421c('0x1b')][_0x421c('0x1c')](',');_0x575553['push'](_0x1d5ed7[0x0]);_0x575553[_0x421c('0x1d')](_0x1d5ed7[0x1]);_0x575553['push'](_0x1d5ed7[_0x421c('0x1e')](0x2,_0x1d5ed7[_0x421c('0x15')])['join'](','));break;case _0x421c('0x20'):var _0x3bb3d6=_0x3df09b[_0x421c('0x1b')][_0x421c('0x1c')](',');_0x575553['push'](_0x3bb3d6[0x0]);_0x575553[_0x421c('0x1d')](_0x3bb3d6[0x1]);_0x575553[_0x421c('0x1d')](_0x3bb3d6[0x2]);_0x575553[_0x421c('0x1d')](_0x3bb3d6[0x3]);_0x575553[_0x421c('0x1d')](_0x3bb3d6[_0x421c('0x1e')](0x4,_0x3bb3d6['length'])[_0x421c('0x17')](','));break;case'amazonlex':var _0x424117=_0x3df09b[_0x421c('0x1b')][_0x421c('0x1c')](',');_0x575553[_0x421c('0x1d')](_0x424117[0x0]);_0x575553['push'](_0x424117[0x1]);_0x575553['push'](_0x424117[0x2]);_0x575553[_0x421c('0x1d')](_0x424117[0x3]);_0x575553[_0x421c('0x1d')](_0x424117['slice'](0x4,_0x424117['length'])[_0x421c('0x17')](','));break;case _0x421c('0x10'):_0x575553[_0x421c('0x1d')](_0x3df09b['appdata']);break;case'tag':_0x575553[_0x421c('0x1d')](_0x3df09b[_0x421c('0x21')]);_0x575553['push'](_0x3df09b[_0x421c('0x1b')]);break;case _0x421c('0x22'):var _0x187f1c=utils['getMustacheRender'](_0x3c090b[_0x421c('0x23')]['notificationTemplate'],_0x3c090b);var _0x9a9785=_0x3df09b[_0x421c('0x1b')]['split'](',');_0x575553[_0x421c('0x1d')](_0x9a9785[0x0]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x1]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x2]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x3]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x4]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x5]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x6]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x7]);_0x575553['push'](_0x9a9785[0x8]);_0x575553[_0x421c('0x1d')](_0x9a9785[0x9]);_0x575553[_0x421c('0x1d')](_0x9a9785[0xa]);_0x575553['push'](_0x3c090b[_0x421c('0x11')]['id']);_0x575553[_0x421c('0x1d')](_0x3c090b[_0x421c('0x10')]['id']);_0x575553[_0x421c('0x1d')](_0x3df09b[_0x421c('0x24')]);_0x575553[_0x421c('0x1d')](_0x3c090b['interaction']['ContactId']);_0x575553[_0x421c('0x1d')](_0x3c090b[_0x421c('0x25')][_0x421c('0x25')]);_0x575553['push'](_0x187f1c);break;default:_0x575553=_['isNil'](_0x3df09b[_0x421c('0x1b')])?[]:_0x3df09b[_0x421c('0x1b')][_0x421c('0x1c')](',');}var _0x437746={'id':util[_0x421c('0x8')](_0x421c('0x26'),_0x1965f2,_0x3df09b['id'],_0x3df09b['app']),'condition':require('./interval')['condition'](_0x1965f2,getIntervals(_0x21e2a6[_0x421c('0x27')],_0x3df09b),_0x21e2a6),'consequence':require(_0x421c('0x28')+_0x3df09b[_0x421c('0x18')])[_0x421c('0x29')](_0x1965f2,_0x575553,_0x21e2a6,_0x3c090b),'p':_0x3df09b[_0x421c('0x2a')]||0x0};logger[_0x421c('0x2b')](_0x421c('0x2c'),_0x437746['id'],'on\x20interval',getIntervals(_0x21e2a6[_0x421c('0x27')],_0x3df09b)[_0x421c('0x17')](_0x421c('0x2d')));_0x2ffcfb[_0x421c('0x1d')](_0x437746);}else{logger[_0x421c('0x2e')](_0x421c('0x2f'),path[_0x421c('0x17')](__dirname,_0x421c('0x14'),_0x3df09b['app']+_0x421c('0x19')));}}_0x21e2a6[_0x421c('0xe')][_0x1965f2]=new RuleEngine(_0x2ffcfb);_0x21e2a6[_0x421c('0xe')][_0x1965f2][_0x421c('0x30')](_0x3c090b,function(_0x26c5f3){logger['info'](_0x421c('0x31'),JSON[_0x421c('0x32')](_0x26c5f3['matchPath']));if(_0x21e2a6[_0x421c('0xe')][_0x1965f2]){_0x21e2a6[_0x421c('0xe')][_0x1965f2][_0x421c('0x33')](_0x421c('0x34'));}});return _0x5d52eb({'code':0xc8,'message':_0x3c090b});}else{if(_0x1924bd){logger[_0x421c('0x2b')](util[_0x421c('0x8')](_0x421c('0x35'),_0x1965f2));}else{logger[_0x421c('0x2b')](_0x421c('0x36'));}return _0x5d52eb({'code':0xc8,'message':_0x3c090b});}}catch(_0x382951){logger[_0x421c('0x2e')](_0x382951[_0x421c('0x37')]);return _0x3102bc(_0x217b39['error'](0x1f4,_0x382951));}}return _0x3102bc(_0x421c('0x38'));});},'AcceptMessage':function(_0x1d262b){var _0x496626=this;return new Promise(function(_0x59cd13,_0xe97a03){if(_0x1d262b['agent']&&_0x1d262b[_0x421c('0x39')]['id']){if(_0x21e2a6[_0x421c('0x3a')][_0x1d262b[_0x421c('0x39')]['id']]){_0x21e2a6['agents'][_0x1d262b[_0x421c('0x39')]['id']][_0x421c('0x3b')]=![];_0x21e2a6[_0x421c('0x3a')][_0x1d262b[_0x421c('0x39')]['id']]['busyQueue']=undefined;}}if(_0x1d262b[_0x421c('0x10')]&&_0x1d262b[_0x421c('0x10')]['id']){try{var _0x308ca2=getId(_0x1d262b['channel'],_0x1d262b[_0x421c('0x10')]?_0x1d262b[_0x421c('0x10')]['id']:0x0,_0x1d262b[_0x421c('0x11')]?_0x1d262b[_0x421c('0x11')]['id']:0x0);if(_0x21e2a6[_0x421c('0xe')][_0x308ca2]){_0x21e2a6[_0x421c('0xe')][_0x308ca2][_0x421c('0x33')]('end');if(rpc[_0x1d262b[_0x421c('0xf')]+_0x421c('0x3c')]){rpc[_0x1d262b['channel']+_0x421c('0x3c')]['update'](_0x308ca2,{'UserId':_0x1d262b['message']['UserId']})['catch'](function(){logger[_0x421c('0x2e')](_0x421c('0x3d'));});}}return _0x59cd13({'code':0xc8,'message':_0x1d262b});}catch(_0x5286ac){logger[_0x421c('0x2e')](_0x5286ac[_0x421c('0x37')]);return _0xe97a03(_0x496626[_0x421c('0x2e')](0x1f4,_0x5286ac));}}logger['error'](_0x421c('0x3e'));return _0xe97a03(_0x496626[_0x421c('0x2e')](0x1f4,_0x421c('0x3e')));});},'RejectMessage':function(_0x5e340e){var _0x383ed5=this;return new Promise(function(_0x9c6fb9,_0x34420b){if(_0x5e340e[_0x421c('0x39')]&&_0x5e340e['agent']['id']){try{if(_0x21e2a6['agents'][_0x5e340e[_0x421c('0x39')]['id']]){_0x21e2a6[_0x421c('0x3a')][_0x5e340e[_0x421c('0x39')]['id']][_0x421c('0x3b')]=![];_0x21e2a6[_0x421c('0x3a')][_0x5e340e[_0x421c('0x39')]['id']][_0x421c('0x3f')]=undefined;}return _0x9c6fb9({'code':0xc8,'message':_0x5e340e});}catch(_0x5bfa6f){logger[_0x421c('0x2e')](_0x5bfa6f[_0x421c('0x37')]);return _0x34420b(_0x383ed5[_0x421c('0x2e')](0x1f4,_0x5bfa6f));}}logger[_0x421c('0x2e')](_0x421c('0x3e'));return _0x34420b(_0x383ed5[_0x421c('0x2e')](0x1f4,_0x421c('0x3e')));});},'AbandonInteraction':function(_0x1c3de1){var _0x342595=this;return new Promise(function(_0x59f4e4,_0x43e8fc){if(_0x1c3de1[_0x421c('0xf')]&&_0x1c3de1['interaction']&&_0x1c3de1[_0x421c('0x11')]['id']){try{var _0x482051=getId(_0x1c3de1[_0x421c('0xf')],_0x1c3de1[_0x421c('0x10')]?_0x1c3de1[_0x421c('0x10')]['id']:0x0,_0x1c3de1[_0x421c('0x11')]?_0x1c3de1[_0x421c('0x11')]['id']:0x0);if(_0x21e2a6[_0x421c('0xe')][_0x482051]){_0x21e2a6['rules'][_0x482051][_0x421c('0x33')](_0x421c('0x40'));}return _0x59f4e4({'code':0xc8,'message':_0x1c3de1});}catch(_0x404584){logger['error'](_0x404584[_0x421c('0x37')]);return _0x43e8fc(_0x342595[_0x421c('0x2e')](0x1f4,_0x404584));}}logger[_0x421c('0x2e')](_0x421c('0x3e'));return _0x43e8fc(_0x342595[_0x421c('0x2e')](0x1f4,_0x421c('0x3e')));});},'AgentCapacity':function(_0x15faeb){var _0x4673ef=this;return new Promise(function(_0x3c5ef7,_0x108757){if(_0x21e2a6[_0x421c('0x3a')]['hasOwnProperty'](_0x15faeb['id'])){for(var _0xd5b4c3 in _0x15faeb[_0x421c('0x41')]){if(_0x15faeb['capacity'][_0x421c('0x42')](_0xd5b4c3)){if(_0x21e2a6[_0x421c('0x3a')][_0x15faeb['id']][_0x421c('0x42')](_0xd5b4c3+_0x421c('0x43'))){_0x21e2a6[_0x421c('0x3a')][_0x15faeb['id']][_0xd5b4c3+_0x421c('0x43')]=parseInt(_0x15faeb[_0x421c('0x41')][_0xd5b4c3],0xa);}}}_0x21e2a6[_0x421c('0x3a')][_0x15faeb['id']][_0x421c('0x44')]();return _0x3c5ef7({'code':0xc8,'message':_0x21e2a6['agents'][_0x15faeb['id']]});}else{return _0x108757(_0x4673ef[_0x421c('0x2e')](0x1f4,_0x421c('0x45')));}});},'Agents':function(_0x439cca){return new Promise(function(_0x233013){var _0x150c3d=_['values'](_0x21e2a6[_0x421c('0x3a')]);if(_0x439cca&&_0x439cca['id']){var _0x5118a2=_[_0x421c('0x46')](_0x150c3d,function(_0x3dc58c){return _0x3dc58c['id']===_0x439cca['id'];});_0x233013(_0x5118a2);}else{_0x233013({'count':_0x150c3d[_0x421c('0x15')],'rows':_0x150c3d});}});},'ChatQueues':function(){return new Promise(function(_0x152c9d){var _0x58c91c=[];for(var _0x17493f in _0x21e2a6[_0x421c('0x47')]){if(_0x21e2a6[_0x421c('0x47')][_0x421c('0x42')](_0x17493f)){var _0x540fbf=_0x21e2a6[_0x421c('0x47')][_0x17493f];var _0x765d52={'id':_0x540fbf['id'],'available':_0x540fbf[_0x421c('0x48')],'loggedIn':_0x540fbf[_0x421c('0x49')],'name':_0x540fbf[_0x421c('0x4a')],'paused':_0x540fbf['paused'],'waiting':_0x540fbf[_0x421c('0x4b')]};_0x58c91c['push'](_0x765d52);}}_0x152c9d({'count':_0x58c91c[_0x421c('0x15')],'rows':_0x58c91c});});},'MailQueues':function(){return new Promise(function(_0x63f658){var _0x345a6e=[];for(var _0x4f63ce in _0x21e2a6[_0x421c('0x4c')]){if(_0x21e2a6[_0x421c('0x4c')]['hasOwnProperty'](_0x4f63ce)){var _0x3a4bc3=_0x21e2a6[_0x421c('0x4c')][_0x4f63ce];var _0x240d9e={'id':_0x3a4bc3['id'],'available':_0x3a4bc3[_0x421c('0x48')],'loggedIn':_0x3a4bc3['loggedIn'],'name':_0x3a4bc3[_0x421c('0x4a')],'paused':_0x3a4bc3[_0x421c('0x4d')],'waiting':_0x3a4bc3[_0x421c('0x4b')]};_0x345a6e[_0x421c('0x1d')](_0x240d9e);}}_0x63f658({'count':_0x345a6e['length'],'rows':_0x345a6e});});},'OpenchannelQueues':function(){return new Promise(function(_0x3c7722){var _0x5afcfb=[];for(var _0x11c11f in _0x21e2a6[_0x421c('0x4e')]){if(_0x21e2a6[_0x421c('0x4e')][_0x421c('0x42')](_0x11c11f)){var _0x315a20=_0x21e2a6[_0x421c('0x4e')][_0x11c11f];var _0x1ecc47={'id':_0x315a20['id'],'available':_0x315a20[_0x421c('0x48')],'loggedIn':_0x315a20[_0x421c('0x49')],'name':_0x315a20[_0x421c('0x4a')],'paused':_0x315a20[_0x421c('0x4d')],'waiting':_0x315a20['waiting']};_0x5afcfb[_0x421c('0x1d')](_0x1ecc47);}}_0x3c7722({'count':_0x5afcfb[_0x421c('0x15')],'rows':_0x5afcfb});});},'SmsQueues':function(){return new Promise(function(_0x172c1e){var _0x473966=[];for(var _0x5b4a44 in _0x21e2a6[_0x421c('0x4f')]){if(_0x21e2a6[_0x421c('0x4f')][_0x421c('0x42')](_0x5b4a44)){var _0x587d91=_0x21e2a6[_0x421c('0x4f')][_0x5b4a44];var _0x1675f4={'id':_0x587d91['id'],'available':_0x587d91[_0x421c('0x48')],'loggedIn':_0x587d91['loggedIn'],'name':_0x587d91['name'],'paused':_0x587d91[_0x421c('0x4d')],'waiting':_0x587d91[_0x421c('0x4b')]};_0x473966[_0x421c('0x1d')](_0x1675f4);}}_0x172c1e({'count':_0x473966[_0x421c('0x15')],'rows':_0x473966});});},'FaxQueues':function(){return new Promise(function(_0x4e4d87){var _0xbe51cc=[];for(var _0x40b3c0 in _0x21e2a6[_0x421c('0x50')]){if(_0x21e2a6['faxQueues'][_0x421c('0x42')](_0x40b3c0)){var _0x465740=_0x21e2a6[_0x421c('0x50')][_0x40b3c0];var _0x1e331b={'id':_0x465740['id'],'available':_0x465740[_0x421c('0x48')],'loggedIn':_0x465740[_0x421c('0x49')],'name':_0x465740[_0x421c('0x4a')],'paused':_0x465740[_0x421c('0x4d')],'waiting':_0x465740[_0x421c('0x4b')]};_0xbe51cc[_0x421c('0x1d')](_0x1e331b);}}_0x4e4d87({'count':_0xbe51cc[_0x421c('0x15')],'rows':_0xbe51cc});});},'WhatsappQueues':function(){return new Promise(function(_0x7bcbef){var _0x20e423=[];for(var _0xea9d7a in _0x21e2a6[_0x421c('0x51')]){if(_0x21e2a6[_0x421c('0x51')][_0x421c('0x42')](_0xea9d7a)){var _0x2cf0c2=_0x21e2a6['whatsappQueues'][_0xea9d7a];var _0x2f1397={'id':_0x2cf0c2['id'],'available':_0x2cf0c2[_0x421c('0x48')],'loggedIn':_0x2cf0c2['loggedIn'],'name':_0x2cf0c2[_0x421c('0x4a')],'paused':_0x2cf0c2['paused'],'waiting':_0x2cf0c2['waiting']};_0x20e423['push'](_0x2f1397);}}_0x7bcbef({'count':_0x20e423[_0x421c('0x15')],'rows':_0x20e423});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x532dab){var _0x202665=_[_0x421c('0x52')](_0x21e2a6[_0x421c('0x53')]);_0x532dab({'count':_0x202665[_0x421c('0x15')],'rows':_0x202665});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4cf5f0){var _0x3be848=_[_0x421c('0x52')](_0x21e2a6[_0x421c('0x54')]);_0x4cf5f0({'count':_0x3be848[_0x421c('0x15')],'rows':_0x3be848});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x49ec67){var _0x31810b=_[_0x421c('0x52')](_0x21e2a6[_0x421c('0x55')]);_0x49ec67({'count':_0x31810b[_0x421c('0x15')],'rows':_0x31810b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x375251){var _0x35a3f7=_[_0x421c('0x52')](_0x21e2a6[_0x421c('0x56')]);_0x375251({'count':_0x35a3f7[_0x421c('0x15')],'rows':_0x35a3f7});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3f13c9){var _0x8cd889=_[_0x421c('0x52')](_0x21e2a6[_0x421c('0x57')]);_0x3f13c9({'count':_0x8cd889[_0x421c('0x15')],'rows':_0x8cd889});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5c92e6){var _0x270a11=_['values'](_0x21e2a6[_0x421c('0x58')]);_0x5c92e6({'count':_0x270a11['length'],'rows':_0x270a11});});}};var _0x4088c8=jayson[_0x421c('0x59')](_0x389f96)[_0x421c('0x5a')]();_0x4088c8['on']('error',function(_0x3bb8ce){logger[_0x421c('0x2e')](JSON[_0x421c('0x32')](_0x3bb8ce));return _0x51435b(_0x3bb8ce);});_0x4088c8[_0x421c('0x5b')](0x232c,_0x421c('0x5c'),function(){console[_0x421c('0x5d')](_0x421c('0x5e'),0x232c);return _0x201625(_0x421c('0x5f')+0x232c);});});}; \ No newline at end of file +var _0xadaf=['openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','./applications/utils','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','interaction','applications','isArray','length','join','app','autoreply','split','mail','push','slice','dialogflow','amazonlex','appdata','tag','tvox','getMustacheRender','account','notificationTemplate','message','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','emit','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions'];(function(_0xb77190,_0x228d17){var _0x4a699d=function(_0x2c4cf0){while(--_0x2c4cf0){_0xb77190['push'](_0xb77190['shift']());}};_0x4a699d(++_0x228d17);}(_0xadaf,0x123));var _0xfada=function(_0x3b6787,_0x3ab0c3){_0x3b6787=_0x3b6787-0x0;var _0x23b539=_0xadaf[_0x3b6787];return _0x23b539;};'use strict';var _=require(_0xfada('0x0'));var util=require(_0xfada('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0xfada('0x2'));var sUtils=require('./applications/strategy/util');var logger=require(_0xfada('0x3'))('routing');var rpc={'openchannelQueueReport':require(_0xfada('0x4')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xfada('0x5')),'smsQueueReport':require(_0xfada('0x6')),'faxQueueReport':require(_0xfada('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xfada('0x8'));function getId(_0x21d01f,_0x2ce1eb,_0x50d3df){return util[_0xfada('0x9')](_0xfada('0xa'),_0x21d01f,_0x2ce1eb||0x0,_0x50d3df||0x0);}function getIntervals(_0x53ca81,_0x4a4a46){var _0x98d959=[];if(!_['isNil'](_0x4a4a46[_0xfada('0xb')])&&!_[_0xfada('0xc')](_0x53ca81[_0x4a4a46[_0xfada('0xb')]])&&!_['isNil'](_0x53ca81[_0x4a4a46[_0xfada('0xb')]][_0xfada('0xd')])){_0x98d959=_[_0xfada('0xe')](_0x53ca81[_0x4a4a46[_0xfada('0xb')]][_0xfada('0xd')],_0xfada('0xf'));}else if(!_[_0xfada('0xc')](_0x4a4a46[_0xfada('0xf')])){_0x98d959=[_0x4a4a46[_0xfada('0xf')]];}return _0x98d959;}exports[_0xfada('0x10')]=function(_0x495899){_0x495899[_0xfada('0x11')]={};return new BPromise(function(_0x773d20,_0xba8f9a){var _0x542089={'Start':function(_0x23d27e){var _0x1eb47c=this;return new Promise(function(_0x5cf601,_0x275f3b){if(_0x23d27e){try{var _0x395281=[];var _0x20eecb=getId(_0x23d27e[_0xfada('0x12')],_0x23d27e['message']?_0x23d27e['message']['id']:0x0,_0x23d27e[_0xfada('0x13')]?_0x23d27e['interaction']['id']:0x0);var _0x3f675e=sUtils['checkWaitingNotifications'](_0x495899,_0x23d27e);if(!_0x3f675e&&_0x23d27e[_0xfada('0x14')]&&_[_0xfada('0x15')](_0x23d27e[_0xfada('0x14')])&&_0x23d27e[_0xfada('0x14')][_0xfada('0x16')]){for(var _0x11ef05=0x0;_0x11ef05<_0x23d27e['applications'][_0xfada('0x16')];_0x11ef05+=0x1){var _0x3bb0a5=_0x23d27e[_0xfada('0x14')][_0x11ef05];if(fs['existsSync'](path[_0xfada('0x17')](__dirname,'applications',_0x3bb0a5['app']+'.js'))){var _0x12296c=[];switch(_0x3bb0a5[_0xfada('0x18')]['toLowerCase']()){case _0xfada('0x19'):var _0x1f1d25=_0x3bb0a5['appdata'][_0xfada('0x1a')](',');if(_0x23d27e[_0xfada('0x12')]===_0xfada('0x1b')){_0x12296c['push'](_0x1f1d25[0x0]);_0x12296c[_0xfada('0x1c')](_0x1f1d25[0x1]);_0x12296c[_0xfada('0x1c')](_0x1f1d25[_0xfada('0x1d')](0x2,_0x1f1d25[_0xfada('0x16')])[_0xfada('0x17')](','));}else{_0x12296c[_0xfada('0x1c')](_0x1f1d25[0x0]);_0x12296c['push'](_0x1f1d25[_0xfada('0x1d')](0x1,_0x1f1d25[_0xfada('0x16')])[_0xfada('0x17')](','));}break;case _0xfada('0x1e'):var _0x213b85=_0x3bb0a5['appdata'][_0xfada('0x1a')](',');_0x12296c[_0xfada('0x1c')](_0x213b85[0x0]);_0x12296c[_0xfada('0x1c')](_0x213b85[0x1]);_0x12296c[_0xfada('0x1c')](_0x213b85['slice'](0x2,_0x213b85[_0xfada('0x16')])[_0xfada('0x17')](','));break;case'dialogflowv2':var _0xda0fa4=_0x3bb0a5['appdata']['split'](',');_0x12296c[_0xfada('0x1c')](_0xda0fa4[0x0]);_0x12296c['push'](_0xda0fa4[0x1]);_0x12296c[_0xfada('0x1c')](_0xda0fa4[0x2]);_0x12296c[_0xfada('0x1c')](_0xda0fa4[0x3]);_0x12296c['push'](_0xda0fa4[_0xfada('0x1d')](0x4,_0xda0fa4['length'])[_0xfada('0x17')](','));break;case _0xfada('0x1f'):var _0x1530a3=_0x3bb0a5[_0xfada('0x20')][_0xfada('0x1a')](',');_0x12296c[_0xfada('0x1c')](_0x1530a3[0x0]);_0x12296c['push'](_0x1530a3[0x1]);_0x12296c[_0xfada('0x1c')](_0x1530a3[0x2]);_0x12296c[_0xfada('0x1c')](_0x1530a3[0x3]);_0x12296c[_0xfada('0x1c')](_0x1530a3[_0xfada('0x1d')](0x4,_0x1530a3['length'])[_0xfada('0x17')](','));break;case'message':_0x12296c[_0xfada('0x1c')](_0x3bb0a5[_0xfada('0x20')]);break;case _0xfada('0x21'):_0x12296c[_0xfada('0x1c')](_0x3bb0a5['TagId']);_0x12296c[_0xfada('0x1c')](_0x3bb0a5['appdata']);break;case _0xfada('0x22'):var _0xf1cea4=utils[_0xfada('0x23')](_0x23d27e[_0xfada('0x24')][_0xfada('0x25')],_0x23d27e);var _0x53e280=_0x3bb0a5[_0xfada('0x20')]['split'](',');_0x12296c[_0xfada('0x1c')](_0x53e280[0x0]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x1]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x2]);_0x12296c['push'](_0x53e280[0x3]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x4]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x5]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x6]);_0x12296c['push'](_0x53e280[0x7]);_0x12296c['push'](_0x53e280[0x8]);_0x12296c[_0xfada('0x1c')](_0x53e280[0x9]);_0x12296c[_0xfada('0x1c')](_0x53e280[0xa]);_0x12296c[_0xfada('0x1c')](_0x23d27e[_0xfada('0x13')]['id']);_0x12296c[_0xfada('0x1c')](_0x23d27e[_0xfada('0x26')]['id']);_0x12296c[_0xfada('0x1c')](_0x3bb0a5[_0xfada('0x27')]);_0x12296c['push'](_0x23d27e[_0xfada('0x13')][_0xfada('0x28')]);_0x12296c[_0xfada('0x1c')](_0x23d27e[_0xfada('0x29')][_0xfada('0x29')]);_0x12296c[_0xfada('0x1c')](_0xf1cea4);break;default:_0x12296c=_[_0xfada('0xc')](_0x3bb0a5['appdata'])?[]:_0x3bb0a5['appdata'][_0xfada('0x1a')](',');}var _0x297d66={'id':util[_0xfada('0x9')](_0xfada('0x2a'),_0x20eecb,_0x3bb0a5['id'],_0x3bb0a5[_0xfada('0x18')]),'condition':require('./interval')[_0xfada('0x2b')](_0x20eecb,getIntervals(_0x495899['intervals'],_0x3bb0a5),_0x495899),'consequence':require(_0xfada('0x2c')+_0x3bb0a5[_0xfada('0x18')])[_0xfada('0x2d')](_0x20eecb,_0x12296c,_0x495899,_0x23d27e),'p':_0x3bb0a5[_0xfada('0x2e')]||0x0};logger[_0xfada('0x2f')](_0xfada('0x30'),_0x297d66['id'],'on\x20interval',getIntervals(_0x495899['intervals'],_0x3bb0a5)['join'](_0xfada('0x31')));_0x395281['push'](_0x297d66);}else{logger[_0xfada('0x32')](_0xfada('0x33'),path['join'](__dirname,_0xfada('0x14'),_0x3bb0a5[_0xfada('0x18')]+'.js'));}}_0x495899[_0xfada('0x11')][_0x20eecb]=new RuleEngine(_0x395281);_0x495899[_0xfada('0x11')][_0x20eecb][_0xfada('0x34')](_0x23d27e,function(_0x13c072){logger[_0xfada('0x2f')]('Applications\x20executed',JSON[_0xfada('0x35')](_0x13c072[_0xfada('0x36')]));if(_0x495899[_0xfada('0x11')][_0x20eecb]){_0x495899[_0xfada('0x11')][_0x20eecb]['emit']('complete');}});return _0x5cf601({'code':0xc8,'message':_0x23d27e});}else{if(_0x3f675e){logger['info'](util['format'](_0xfada('0x37'),_0x20eecb));}else{logger[_0xfada('0x2f')](_0xfada('0x38'));}return _0x5cf601({'code':0xc8,'message':_0x23d27e});}}catch(_0x5c83cd){logger[_0xfada('0x32')](_0x5c83cd[_0xfada('0x39')]);return _0x275f3b(_0x1eb47c[_0xfada('0x32')](0x1f4,_0x5c83cd));}}return _0x275f3b(_0xfada('0x3a'));});},'AcceptMessage':function(_0x30e758){var _0x427ab5=this;return new Promise(function(_0x4c5e85,_0x476924){if(_0x30e758['agent']&&_0x30e758[_0xfada('0x3b')]['id']){if(_0x495899[_0xfada('0x3c')][_0x30e758[_0xfada('0x3b')]['id']]){_0x495899[_0xfada('0x3c')][_0x30e758[_0xfada('0x3b')]['id']][_0xfada('0x3d')]=![];_0x495899[_0xfada('0x3c')][_0x30e758[_0xfada('0x3b')]['id']]['busyQueue']=undefined;}}if(_0x30e758['message']&&_0x30e758[_0xfada('0x26')]['id']){try{var _0x429f77=getId(_0x30e758[_0xfada('0x12')],_0x30e758[_0xfada('0x26')]?_0x30e758['message']['id']:0x0,_0x30e758[_0xfada('0x13')]?_0x30e758[_0xfada('0x13')]['id']:0x0);if(_0x495899['rules'][_0x429f77]){_0x495899[_0xfada('0x11')][_0x429f77][_0xfada('0x3e')](_0xfada('0x3f'));if(rpc[_0x30e758[_0xfada('0x12')]+'QueueReport']){rpc[_0x30e758[_0xfada('0x12')]+_0xfada('0x40')][_0xfada('0x41')](_0x429f77,{'UserId':_0x30e758[_0xfada('0x26')]['UserId']})[_0xfada('0x42')](function(){logger[_0xfada('0x32')](_0xfada('0x43'));});}}return _0x4c5e85({'code':0xc8,'message':_0x30e758});}catch(_0x47b606){logger[_0xfada('0x32')](_0x47b606[_0xfada('0x39')]);return _0x476924(_0x427ab5[_0xfada('0x32')](0x1f4,_0x47b606));}}logger[_0xfada('0x32')](_0xfada('0x44'));return _0x476924(_0x427ab5[_0xfada('0x32')](0x1f4,_0xfada('0x44')));});},'RejectMessage':function(_0x36f95c){var _0x503b3d=this;return new Promise(function(_0x2f2399,_0x2ac443){if(_0x36f95c[_0xfada('0x3b')]&&_0x36f95c['agent']['id']){try{if(_0x495899[_0xfada('0x3c')][_0x36f95c['agent']['id']]){_0x495899['agents'][_0x36f95c[_0xfada('0x3b')]['id']]['busy']=![];_0x495899[_0xfada('0x3c')][_0x36f95c[_0xfada('0x3b')]['id']]['busyQueue']=undefined;}return _0x2f2399({'code':0xc8,'message':_0x36f95c});}catch(_0x4c2832){logger['error'](_0x4c2832[_0xfada('0x39')]);return _0x2ac443(_0x503b3d[_0xfada('0x32')](0x1f4,_0x4c2832));}}logger['error'](_0xfada('0x44'));return _0x2ac443(_0x503b3d['error'](0x1f4,_0xfada('0x44')));});},'AbandonInteraction':function(_0x6a696d){var _0x4048e6=this;return new Promise(function(_0x46bb88,_0x4296a5){if(_0x6a696d[_0xfada('0x12')]&&_0x6a696d[_0xfada('0x13')]&&_0x6a696d[_0xfada('0x13')]['id']){try{var _0x2fe1a4=getId(_0x6a696d[_0xfada('0x12')],_0x6a696d[_0xfada('0x26')]?_0x6a696d[_0xfada('0x26')]['id']:0x0,_0x6a696d[_0xfada('0x13')]?_0x6a696d[_0xfada('0x13')]['id']:0x0);if(_0x495899['rules'][_0x2fe1a4]){_0x495899[_0xfada('0x11')][_0x2fe1a4][_0xfada('0x3e')](_0xfada('0x3f'));}return _0x46bb88({'code':0xc8,'message':_0x6a696d});}catch(_0x564b61){logger['error'](_0x564b61[_0xfada('0x39')]);return _0x4296a5(_0x4048e6[_0xfada('0x32')](0x1f4,_0x564b61));}}logger['error'](_0xfada('0x44'));return _0x4296a5(_0x4048e6[_0xfada('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x19d008){var _0xbcab4f=this;return new Promise(function(_0x5bb73e,_0x223e73){if(_0x495899['agents'][_0xfada('0x45')](_0x19d008['id'])){for(var _0x232d1c in _0x19d008['capacity']){if(_0x19d008[_0xfada('0x46')]['hasOwnProperty'](_0x232d1c)){if(_0x495899['agents'][_0x19d008['id']]['hasOwnProperty'](_0x232d1c+_0xfada('0x47'))){_0x495899[_0xfada('0x3c')][_0x19d008['id']][_0x232d1c+_0xfada('0x47')]=parseInt(_0x19d008['capacity'][_0x232d1c],0xa);}}}_0x495899[_0xfada('0x3c')][_0x19d008['id']][_0xfada('0x48')]();return _0x5bb73e({'code':0xc8,'message':_0x495899['agents'][_0x19d008['id']]});}else{return _0x223e73(_0xbcab4f[_0xfada('0x32')](0x1f4,_0xfada('0x49')));}});},'Agents':function(_0x3c2deb){return new Promise(function(_0x194919){var _0xd36c6=_[_0xfada('0x4a')](_0x495899[_0xfada('0x3c')]);if(_0x3c2deb&&_0x3c2deb['id']){var _0x12b517=_[_0xfada('0x4b')](_0xd36c6,function(_0x503064){return _0x503064['id']===_0x3c2deb['id'];});_0x194919(_0x12b517);}else{_0x194919({'count':_0xd36c6[_0xfada('0x16')],'rows':_0xd36c6});}});},'ChatQueues':function(){return new Promise(function(_0x46c6e0){var _0x22cb30=[];for(var _0x394acb in _0x495899[_0xfada('0x4c')]){if(_0x495899[_0xfada('0x4c')][_0xfada('0x45')](_0x394acb)){var _0x298247=_0x495899[_0xfada('0x4c')][_0x394acb];var _0x5ea10a={'id':_0x298247['id'],'available':_0x298247[_0xfada('0x4d')],'loggedIn':_0x298247[_0xfada('0x4e')],'name':_0x298247[_0xfada('0x4f')],'paused':_0x298247[_0xfada('0x50')],'waiting':_0x298247[_0xfada('0x51')]};_0x22cb30['push'](_0x5ea10a);}}_0x46c6e0({'count':_0x22cb30[_0xfada('0x16')],'rows':_0x22cb30});});},'MailQueues':function(){return new Promise(function(_0x3d820a){var _0x2d8ad7=[];for(var _0x492a23 in _0x495899['mailQueues']){if(_0x495899[_0xfada('0x52')][_0xfada('0x45')](_0x492a23)){var _0x4729dd=_0x495899['mailQueues'][_0x492a23];var _0xeb28b2={'id':_0x4729dd['id'],'available':_0x4729dd['available'],'loggedIn':_0x4729dd['loggedIn'],'name':_0x4729dd[_0xfada('0x4f')],'paused':_0x4729dd['paused'],'waiting':_0x4729dd[_0xfada('0x51')]};_0x2d8ad7[_0xfada('0x1c')](_0xeb28b2);}}_0x3d820a({'count':_0x2d8ad7[_0xfada('0x16')],'rows':_0x2d8ad7});});},'OpenchannelQueues':function(){return new Promise(function(_0x244060){var _0x2e9f6b=[];for(var _0x3579a0 in _0x495899['openchannelQueues']){if(_0x495899[_0xfada('0x53')][_0xfada('0x45')](_0x3579a0)){var _0x1dbe8b=_0x495899[_0xfada('0x53')][_0x3579a0];var _0x57119e={'id':_0x1dbe8b['id'],'available':_0x1dbe8b['available'],'loggedIn':_0x1dbe8b[_0xfada('0x4e')],'name':_0x1dbe8b[_0xfada('0x4f')],'paused':_0x1dbe8b['paused'],'waiting':_0x1dbe8b[_0xfada('0x51')]};_0x2e9f6b[_0xfada('0x1c')](_0x57119e);}}_0x244060({'count':_0x2e9f6b[_0xfada('0x16')],'rows':_0x2e9f6b});});},'SmsQueues':function(){return new Promise(function(_0xaff7f8){var _0x444dd9=[];for(var _0x3bb0e5 in _0x495899[_0xfada('0x54')]){if(_0x495899['smsQueues']['hasOwnProperty'](_0x3bb0e5)){var _0x2f47a5=_0x495899['smsQueues'][_0x3bb0e5];var _0x4a01eb={'id':_0x2f47a5['id'],'available':_0x2f47a5[_0xfada('0x4d')],'loggedIn':_0x2f47a5['loggedIn'],'name':_0x2f47a5[_0xfada('0x4f')],'paused':_0x2f47a5['paused'],'waiting':_0x2f47a5[_0xfada('0x51')]};_0x444dd9['push'](_0x4a01eb);}}_0xaff7f8({'count':_0x444dd9['length'],'rows':_0x444dd9});});},'FaxQueues':function(){return new Promise(function(_0x29a1fb){var _0x138f4f=[];for(var _0xb7507f in _0x495899['faxQueues']){if(_0x495899[_0xfada('0x55')]['hasOwnProperty'](_0xb7507f)){var _0x5bca3c=_0x495899[_0xfada('0x55')][_0xb7507f];var _0x296dc0={'id':_0x5bca3c['id'],'available':_0x5bca3c['available'],'loggedIn':_0x5bca3c[_0xfada('0x4e')],'name':_0x5bca3c[_0xfada('0x4f')],'paused':_0x5bca3c[_0xfada('0x50')],'waiting':_0x5bca3c[_0xfada('0x51')]};_0x138f4f['push'](_0x296dc0);}}_0x29a1fb({'count':_0x138f4f['length'],'rows':_0x138f4f});});},'WhatsappQueues':function(){return new Promise(function(_0x38e478){var _0x26b68f=[];for(var _0x2fb5f3 in _0x495899[_0xfada('0x56')]){if(_0x495899[_0xfada('0x56')][_0xfada('0x45')](_0x2fb5f3)){var _0x4a1225=_0x495899['whatsappQueues'][_0x2fb5f3];var _0xdb3ac6={'id':_0x4a1225['id'],'available':_0x4a1225[_0xfada('0x4d')],'loggedIn':_0x4a1225[_0xfada('0x4e')],'name':_0x4a1225['name'],'paused':_0x4a1225[_0xfada('0x50')],'waiting':_0x4a1225['waiting']};_0x26b68f[_0xfada('0x1c')](_0xdb3ac6);}}_0x38e478({'count':_0x26b68f['length'],'rows':_0x26b68f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xbf50d){var _0x3e8f52=_[_0xfada('0x4a')](_0x495899[_0xfada('0x57')]);_0xbf50d({'count':_0x3e8f52[_0xfada('0x16')],'rows':_0x3e8f52});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2e04eb){var _0x586713=_['values'](_0x495899[_0xfada('0x58')]);_0x2e04eb({'count':_0x586713['length'],'rows':_0x586713});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x16ce18){var _0x12ec49=_[_0xfada('0x4a')](_0x495899[_0xfada('0x59')]);_0x16ce18({'count':_0x12ec49[_0xfada('0x16')],'rows':_0x12ec49});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x2fbd50){var _0x415295=_['values'](_0x495899['smsQueuesWaitingInteractions']);_0x2fbd50({'count':_0x415295[_0xfada('0x16')],'rows':_0x415295});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x217292){var _0x33c41f=_[_0xfada('0x4a')](_0x495899[_0xfada('0x5a')]);_0x217292({'count':_0x33c41f[_0xfada('0x16')],'rows':_0x33c41f});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x109bd4){var _0x4583a5=_['values'](_0x495899[_0xfada('0x5b')]);_0x109bd4({'count':_0x4583a5[_0xfada('0x16')],'rows':_0x4583a5});});}};var _0x5983c6=jayson['server'](_0x542089)['http']();_0x5983c6['on'](_0xfada('0x32'),function(_0x5ca004){logger['error'](JSON[_0xfada('0x35')](_0x5ca004));return _0xba8f9a(_0x5ca004);});_0x5983c6[_0xfada('0x10')](0x232c,_0xfada('0x5c'),function(){console[_0xfada('0x5d')](_0xfada('0x5e'),0x232c);return _0x773d20('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 501be1b..7d639a4 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 _0xc21f=['rules','info','stop','length','push','Command','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','lodash','../../../config/logger','client','then','error','message','catch','condition'];(function(_0x141131,_0x52b412){var _0x3287e7=function(_0x24f1d9){while(--_0x24f1d9){_0x141131['push'](_0x141131['shift']());}};_0x3287e7(++_0x52b412);}(_0xc21f,0x1b9));var _0xfc21=function(_0x3dec4e,_0x46a9e0){_0x3dec4e=_0x3dec4e-0x0;var _0xdfb095=_0xc21f[_0x3dec4e];return _0xdfb095;};'use strict';var util=require(_0xfc21('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0xfc21('0x1'));var logger=require(_0xfc21('0x2'))('routing');var client=jayson[_0xfc21('0x3')]['http']({'port':0x232a});function request(_0x3aec10,_0x112b6f){return new BPromise(function(_0x514409,_0xcfe5fc){return client['request'](_0x3aec10,_0x112b6f)[_0xfc21('0x4')](function(_0x568c33){if(_0x568c33[_0xfc21('0x5')]){return _0xcfe5fc(_0x568c33[_0xfc21('0x5')][_0xfc21('0x6')]);}else{return _0x514409(_0x568c33['result']);}})[_0xfc21('0x7')](function(_0x56861d){return _0xcfe5fc(_0x56861d);});});}exports[_0xfc21('0x8')]=function(_0x491cd9,_0x5f3d3f,_0x3204d7){return function(_0x28aae2){if(_0x3204d7[_0xfc21('0x9')]&&!_0x3204d7[_0xfc21('0x9')][_0x491cd9]){logger[_0xfc21('0xa')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x491cd9);return _0x28aae2[_0xfc21('0xb')]();}var _0x235420=[];for(var _0x5d2da6=0x0;_0x5d2da6<_0x5f3d3f[_0xfc21('0xc')];_0x5d2da6+=0x1){_0x235420[_0xfc21('0xd')](request(_0xfc21('0xe'),{'command':util['format'](_0xfc21('0xf'),_0x5f3d3f[_0x5d2da6])})[_0xfc21('0x4')](function(_0x305729){return _0x305729&&_0x305729[_0xfc21('0x6')]&&_0x305729[_0xfc21('0x6')][_0xfc21('0x10')]('true')>=0x0?!![]:![];})['catch'](function(_0x37b3c0){logger[_0xfc21('0x5')](_0xfc21('0x11'),_0x491cd9,_0x5f3d3f[_0x5d2da6]);}));}BPromise[_0xfc21('0x12')](_0x235420)[_0xfc21('0x4')](function(_0x41ad98){var _0x1ad792=_['some'](_0x41ad98);logger['info'](_0xfc21('0x13'),_0x491cd9,_0x5f3d3f[_0xfc21('0x14')](_0xfc21('0x15')),_0x1ad792);_0x28aae2[_0xfc21('0x16')](_0x1ad792);})[_0xfc21('0x7')](function(_0x134190){console[_0xfc21('0x17')](_0x134190);logger[_0xfc21('0x5')](_0xfc21('0x13'),_0x491cd9,_0x5f3d3f[_0xfc21('0x14')](_0xfc21('0x15')),_0x134190[_0xfc21('0x18')]);_0x28aae2[_0xfc21('0xb')]();});};}; \ No newline at end of file +var _0x6ef5=['jayson/promise','lodash','routing','client','http','request','then','error','message','rules','info','stop','Command','format','iftime\x20%s','indexOf','true','catch','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util'];(function(_0x1ae975,_0x70b40e){var _0x2576ca=function(_0x1b4e97){while(--_0x1b4e97){_0x1ae975['push'](_0x1ae975['shift']());}};_0x2576ca(++_0x70b40e);}(_0x6ef5,0xcf));var _0x56ef=function(_0x369be5,_0x33bd84){_0x369be5=_0x369be5-0x0;var _0x1c608a=_0x6ef5[_0x369be5];return _0x1c608a;};'use strict';var util=require(_0x56ef('0x0'));var BPromise=require('bluebird');var jayson=require(_0x56ef('0x1'));var _=require(_0x56ef('0x2'));var logger=require('../../../config/logger')(_0x56ef('0x3'));var client=jayson[_0x56ef('0x4')][_0x56ef('0x5')]({'port':0x232a});function request(_0x1d31cc,_0x794bb5){return new BPromise(function(_0x567ffa,_0x52d303){return client[_0x56ef('0x6')](_0x1d31cc,_0x794bb5)[_0x56ef('0x7')](function(_0x360cf2){if(_0x360cf2[_0x56ef('0x8')]){return _0x52d303(_0x360cf2[_0x56ef('0x8')][_0x56ef('0x9')]);}else{return _0x567ffa(_0x360cf2['result']);}})['catch'](function(_0x198ee5){return _0x52d303(_0x198ee5);});});}exports['condition']=function(_0x1fe69f,_0x548bf8,_0x5f60e3){return function(_0x2b8f43){if(_0x5f60e3[_0x56ef('0xa')]&&!_0x5f60e3[_0x56ef('0xa')][_0x1fe69f]){logger[_0x56ef('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1fe69f);return _0x2b8f43[_0x56ef('0xc')]();}var _0x2fffa3=[];for(var _0x6ace33=0x0;_0x6ace33<_0x548bf8['length'];_0x6ace33+=0x1){_0x2fffa3['push'](request(_0x56ef('0xd'),{'command':util[_0x56ef('0xe')](_0x56ef('0xf'),_0x548bf8[_0x6ace33])})['then'](function(_0xc500b8){return _0xc500b8&&_0xc500b8[_0x56ef('0x9')]&&_0xc500b8[_0x56ef('0x9')][_0x56ef('0x10')](_0x56ef('0x11'))>=0x0?!![]:![];})[_0x56ef('0x12')](function(_0x81419f){logger[_0x56ef('0x8')]('[%s][INTERVAL]\x20%s',_0x1fe69f,_0x548bf8[_0x6ace33]);}));}BPromise[_0x56ef('0x13')](_0x2fffa3)[_0x56ef('0x7')](function(_0xb27cf6){var _0xc21cea=_[_0x56ef('0x14')](_0xb27cf6);logger[_0x56ef('0xb')](_0x56ef('0x15'),_0x1fe69f,_0x548bf8[_0x56ef('0x16')](_0x56ef('0x17')),_0xc21cea);_0x2b8f43[_0x56ef('0x18')](_0xc21cea);})['catch'](function(_0x452b33){console[_0x56ef('0x19')](_0x452b33);logger['error'](_0x56ef('0x15'),_0x1fe69f,_0x548bf8[_0x56ef('0x16')]('\x20|\x20'),_0x452b33['stack']);_0x2b8f43[_0x56ef('0xc')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 263a6cb..39ed25c 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 _0x1339=['talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','error','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','clone','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime'];(function(_0x6465b0,_0x45653a){var _0x4884fe=function(_0x427085){while(--_0x427085){_0x6465b0['push'](_0x6465b0['shift']());}};_0x4884fe(++_0x45653a);}(_0x1339,0x1ed));var _0x9133=function(_0xd7fdc7,_0x2a1ca6){_0xd7fdc7=_0xd7fdc7-0x0;var _0x1944fb=_0x1339[_0xd7fdc7];return _0x1944fb;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9133('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2a91b2,_0x4611be){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3'),_0x2a91b2[_0x9133('0x4')],_0x2a91b2[_0x9133('0x5')],_0x2a91b2['queue'],_0x2a91b2[_0x9133('0x6')],_0x2a91b2[_0x9133('0x7')],_0x2a91b2[_0x9133('0x8')],_0x2a91b2['connectedlinenum'],_0x2a91b2[_0x9133('0x9')]));if(_0x2a91b2[_0x9133('0xa')]){utils[_0x9133('0xb')](_0x2a91b2[_0x9133('0xa')])[_0x9133('0xc')](function(_0x3a7a80){if(_0x3a7a80){_0x2a91b2[_0x9133('0xd')]=_0x3a7a80[_0x9133('0xd')];_0x2a91b2[_0x9133('0xe')]=_0x2a91b2[_0x9133('0xf')]?_0x3a7a80['acw']:![];_0x2a91b2[_0x9133('0x10')]=_0x2a91b2[_0x9133('0xe')]?_0x3a7a80[_0x9133('0x11')]:0x0;}utils[_0x9133('0x12')](_0x9133('0x13'),_0x2a91b2);});}else{utils[_0x9133('0x12')]('CreateVoiceAgentReport',_0x2a91b2);}if(_0x4611be){delete transfers[_0x2a91b2[_0x9133('0x4')]];}else{delete agents[_0x2a91b2[_0x9133('0x14')]];}}exports['agentcalled']=function(_0x5283a3){try{utils[_0x9133('0x15')](util['format'](_0x9133('0x16'),_0x5283a3[_0x9133('0x4')]),_0x5283a3);agents[_0x5283a3[_0x9133('0x14')]]=_0x5283a3;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();agents[_0x5283a3['destuniqueid']][_0x9133('0x9')]=_0x9133('0x19');agents[_0x5283a3['destuniqueid']][_0x9133('0x1a')]=null;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x1b')]=null;utils[_0x9133('0x1')](util['format'](_0x9133('0x1c'),_0x5283a3['uniqueid'],agents[_0x5283a3[_0x9133('0x14')]]['membername'],_0x5283a3[_0x9133('0x14')]));}catch(_0x1d6d0b){utils['error'](util[_0x9133('0x2')]('[%s][agents][agentcalled]',_0x5283a3[_0x9133('0x4')]),_0x1d6d0b);}};exports['agentringnoanswer']=function(_0x5e4f0c){try{if(!_[_0x9133('0x1d')](agents[_0x5e4f0c['destuniqueid']])){utils[_0x9133('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x5e4f0c['uniqueid']),_0x5e4f0c);utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5e4f0c[_0x9133('0x4')],agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x6')],_0x5e4f0c[_0x9133('0x14')]));agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1e')]=!![];agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1f')]=utils[_0x9133('0x18')]();agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x21')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x22')]=_0x5e4f0c['ringtime']?parseInt(_0x5e4f0c['ringtime'])/0x3e8:0x0;agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x23')]=0x0;unanswered[_0x9133('0x24')](_0x5e4f0c[_0x9133('0x14')]);}}catch(_0x4de894){utils['error'](util[_0x9133('0x2')](_0x9133('0x25'),_0x5e4f0c[_0x9133('0x4')]),_0x4de894);}};exports[_0x9133('0x26')]=function(_0x390f50){try{_[_0x9133('0x27')](agents,function(_0x48c713,_0x58afe0){if(_0x48c713['uniqueid']==_0x390f50[_0x9133('0x4')]&&!_['includes'](unanswered,_0x48c713[_0x9133('0x14')])){utils[_0x9133('0x15')](util['format'](_0x9133('0x28'),_0x390f50['uniqueid']),_0x390f50);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x29'),_0x390f50['uniqueid'],_0x48c713[_0x9133('0x6')],_0x48c713[_0x9133('0x14')]));_0x48c713[_0x9133('0x1e')]=!![];_0x48c713['agentringnoanswerAt']=utils[_0x9133('0x18')]();_0x48c713[_0x9133('0x9')]=_0x9133('0x2a');_0x48c713['reason']=_0x9133('0x2a');_0x48c713[_0x9133('0x22')]=_0x390f50[_0x9133('0x22')];_0x48c713[_0x9133('0x23')]=0x0;writeDB(_0x48c713);}});}catch(_0x5e4d5e){utils[_0x9133('0x2b')](util[_0x9133('0x2')]('[%s][agents][queuecallerabandon]',_0x390f50[_0x9133('0x4')]),_0x5e4d5e);}};exports[_0x9133('0x2c')]=function(_0x593fbe){try{if(agents[_0x593fbe[_0x9133('0x14')]]){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x2d'),_0x593fbe[_0x9133('0x4')]),_0x593fbe);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x2e'),_0x593fbe['uniqueid'],agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x6')],_0x593fbe['destuniqueid']));agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x2f')]=utils[_0x9133('0x18')]();agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x1a')]=_0x593fbe[_0x9133('0x1a')];agents[_0x593fbe['destuniqueid']]['connectedlinename']=_0x593fbe[_0x9133('0x1b')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x22')]=_0x593fbe[_0x9133('0x30')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x31');_[_0x9133('0x27')](agents,function(_0x720048,_0x5a3f73){if(_0x720048[_0x9133('0x14')]!=_0x593fbe[_0x9133('0x14')]&&_0x720048[_0x9133('0x4')]==_0x593fbe[_0x9133('0x4')]){_0x720048[_0x9133('0x23')]=0x0;_0x720048['holdtime']=_0x593fbe[_0x9133('0x30')];_0x720048[_0x9133('0x1e')]=!![];_0x720048[_0x9133('0x1f')]=utils[_0x9133('0x18')]();_0x720048['lastevent']=_0x9133('0x32');_0x720048[_0x9133('0x21')]=_0x9133('0x32');_0x720048[_0x9133('0x33')]=_0x593fbe[_0x9133('0x14')];_0x720048[_0x9133('0x34')]=_0x593fbe[_0x9133('0x6')];writeDB(_0x720048);}});}}catch(_0x4ca1a3){utils[_0x9133('0x2b')](util['format']('[%s][agents][agentconnect]',_0x593fbe[_0x9133('0x4')]),_0x4ca1a3);}};exports[_0x9133('0xf')]=function(_0x46156d){try{if(!_[_0x9133('0x1d')](agents[_0x46156d[_0x9133('0x14')]])){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x46156d);utils['info'](util[_0x9133('0x2')](_0x9133('0x36'),_0x46156d[_0x9133('0x4')],agents[_0x46156d['destuniqueid']]['membername'],_0x46156d[_0x9133('0x14')]));agents[_0x46156d[_0x9133('0x14')]]['agentcomplete']=!![];agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x23')]=utils['diffTime'](agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')],agents[_0x46156d[_0x9133('0x14')]]['agentconnectAt']);agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x21')]=_0x46156d['reason'];agents[_0x46156d['destuniqueid']][_0x9133('0x9')]=_0x9133('0x38');writeDB(agents[_0x46156d[_0x9133('0x14')]]);}}catch(_0x41fea9){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x41fea9);}};exports[_0x9133('0x39')]=function(_0xf07fbb){try{if(!_[_0x9133('0x1d')](agents[_0xf07fbb[_0x9133('0x3a')]])){utils['debug'](util['format'](_0x9133('0x3b'),_0xf07fbb['uniqueid']),_0xf07fbb);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3c'),_0xf07fbb[_0x9133('0x4')],agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x6')],agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x4')]));agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x3d')]=!![];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x3e')]='blind';agents[_0xf07fbb[_0x9133('0x3a')]]['transferexten']=_0xf07fbb[_0x9133('0x3f')];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x40')]=agents[_0xf07fbb[_0x9133('0x3a')]]['uniqueid'];}}catch(_0x4a346c){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x3b'),_0xf07fbb[_0x9133('0x4')]),_0x4a346c);}};exports[_0x9133('0x41')]=function(_0x565920){try{utils['debug'](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920['origtransfereruniqueid']),_0x565920);if(_0x565920[_0x9133('0x43')]==_0x565920[_0x9133('0x44')]){if(!_['isNil'](agents[_0x565920['secondtransfereruniqueid']])){utils['info'](util[_0x9133('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x45')]][_0x9133('0x6')]));agents[_0x565920[_0x9133('0x45')]]['transfer']=!![];agents[_0x565920[_0x9133('0x45')]]['transfertype']=_0x9133('0x46');agents[_0x565920[_0x9133('0x45')]][_0x9133('0x47')]=_0x565920[_0x9133('0x48')];agents[_0x565920[_0x9133('0x45')]][_0x9133('0x40')]=_0x565920['origtransfereruniqueid'];}if(_0x565920['transfereeuniqueid']&&agents[_0x565920['transfereeuniqueid']]){agents[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x49')]]=_['clone'](agents[_0x565920[_0x9133('0x49')]]);transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x45')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x45')]]['calleridname'];transfers[_0x565920[_0x9133('0x49')]]['agentcalledAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']][_0x9133('0x2f')]=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x2;}}else if(_0x565920[_0x9133('0x45')]==_0x565920[_0x9133('0x4c')]){if(!_[_0x9133('0x1d')](agents[_0x565920[_0x9133('0x43')]])){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x4d'),_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x43')]]['membername']));agents[_0x565920[_0x9133('0x43')]]['transfer']=!![];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x3e')]=_0x9133('0x46');agents[_0x565920[_0x9133('0x43')]][_0x9133('0x47')]=_0x565920['secondtransfererexten'];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x40')]=_0x565920[_0x9133('0x45')];}if(_0x565920[_0x9133('0x4e')]&&agents[_0x565920['transfertargetuniqueid']]){agents[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x4e')]]=_[_0x9133('0x4f')](agents[_0x565920['transfertargetuniqueid']]);transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x43')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x43')]]['calleridname'];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();transfers[_0x565920[_0x9133('0x4e')]]['agentconnectAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x22')]=0x0;transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x2;}}}catch(_0x39b46d){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920[_0x9133('0x43')]),_0x39b46d);}};exports['hangup']=function(_0x23bd83){try{utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x50'),_0x23bd83[_0x9133('0x4')]),_0x23bd83);if(agents[_0x23bd83['uniqueid']]&&agents[_0x23bd83['uniqueid']]['reason']===_0x9133('0x20')){if(_0x23bd83[_0x9133('0x51')]==='21'){agents[_0x23bd83[_0x9133('0x4')]]['reason']=_0x9133('0x52');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x52');}utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83[_0x9133('0x4')],agents[_0x23bd83['uniqueid']][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]]['reason'],agents[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);var _0x439352=unanswered[_0x9133('0x54')](_0x23bd83[_0x9133('0x4')]);if(_0x439352>-0x1){unanswered[_0x9133('0x55')](_0x439352,0x1);}}if(transfers[_0x23bd83['uniqueid']]){transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')]=utils['now']();transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x23')]=utils[_0x9133('0x56')](transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')]=_0x9133('0x57');transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83['uniqueid'],transfers[_0x23bd83[_0x9133('0x4')]]['membername'],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(transfers[_0x23bd83[_0x9133('0x4')]],!![]);}if(agents[_0x23bd83[_0x9133('0x4')]]&&agents[_0x23bd83[_0x9133('0x4')]]['agentconnectAt']){agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];agents[_0x23bd83['uniqueid']][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x23bd83[_0x9133('0x4')]]['talktime']=utils[_0x9133('0x56')](agents[_0x23bd83['uniqueid']][_0x9133('0x37')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);agents[_0x23bd83['uniqueid']][_0x9133('0x21')]=agents[_0x23bd83['uniqueid']][_0x9133('0x3d')]?_0x9133('0x3d'):_0x9133('0x57');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x23bd83[_0x9133('0x4')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],agents[_0x23bd83['uniqueid']][_0x9133('0x9')]));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);}}catch(_0x1b66d0){utils[_0x9133('0x2b')](util['format'](_0x9133('0x50'),_0x23bd83['uniqueid']),_0x1b66d0);}}; \ No newline at end of file +var _0xe706=['then','type','agentacw','agentcomplete','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','now','called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','agentcalledAt','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName'];(function(_0x9fe800,_0x3b6171){var _0x50cafc=function(_0x4d74b6){while(--_0x4d74b6){_0x9fe800['push'](_0x9fe800['shift']());}};_0x50cafc(++_0x3b6171);}(_0xe706,0xa3));var _0x6e70=function(_0x5d949e,_0x555707){_0x5d949e=_0x5d949e-0x0;var _0x445c1e=_0xe706[_0x5d949e];return _0x445c1e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var utils=require(_0x6e70('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e8446,_0x2cae77){utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x5'),_0x5e8446[_0x6e70('0x6')],_0x5e8446[_0x6e70('0x7')],_0x5e8446[_0x6e70('0x8')],_0x5e8446[_0x6e70('0x9')],_0x5e8446[_0x6e70('0xa')],_0x5e8446[_0x6e70('0xb')],_0x5e8446[_0x6e70('0xc')],_0x5e8446[_0x6e70('0xd')]));if(_0x5e8446[_0x6e70('0x8')]){utils[_0x6e70('0xe')](_0x5e8446[_0x6e70('0x8')])[_0x6e70('0xf')](function(_0x954545){if(_0x954545){_0x5e8446[_0x6e70('0x10')]=_0x954545[_0x6e70('0x10')];_0x5e8446[_0x6e70('0x11')]=_0x5e8446[_0x6e70('0x12')]?_0x954545[_0x6e70('0x13')]:![];_0x5e8446[_0x6e70('0x14')]=_0x5e8446[_0x6e70('0x11')]?_0x954545['acwTimeout']:0x0;}utils['request'](_0x6e70('0x15'),_0x5e8446);});}else{utils[_0x6e70('0x16')](_0x6e70('0x15'),_0x5e8446);}if(_0x2cae77){delete transfers[_0x5e8446[_0x6e70('0x6')]];}else{delete agents[_0x5e8446[_0x6e70('0x17')]];}}exports[_0x6e70('0x18')]=function(_0xa1eb74){try{utils[_0x6e70('0x19')](util['format']('[%s][agents][agentcalled]',_0xa1eb74['uniqueid']),_0xa1eb74);agents[_0xa1eb74[_0x6e70('0x17')]]=_0xa1eb74;agents[_0xa1eb74['destuniqueid']]['agentcalledAt']=utils[_0x6e70('0x1a')]();agents[_0xa1eb74[_0x6e70('0x17')]]['lastevent']=_0x6e70('0x1b');agents[_0xa1eb74['destuniqueid']][_0x6e70('0xc')]=null;agents[_0xa1eb74[_0x6e70('0x17')]]['connectedlinename']=null;utils['info'](util[_0x6e70('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0xa1eb74[_0x6e70('0x6')],agents[_0xa1eb74[_0x6e70('0x17')]]['membername'],_0xa1eb74['destuniqueid']));}catch(_0xc238ba){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x1d'),_0xa1eb74[_0x6e70('0x6')]),_0xc238ba);}};exports[_0x6e70('0x1e')]=function(_0x1b2453){try{if(!_[_0x6e70('0x1f')](agents[_0x1b2453[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x1b2453);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x21'),_0x1b2453[_0x6e70('0x6')],agents[_0x1b2453[_0x6e70('0x17')]]['membername'],_0x1b2453[_0x6e70('0x17')]));agents[_0x1b2453['destuniqueid']]['agentringnoanswer']=!![];agents[_0x1b2453['destuniqueid']][_0x6e70('0x22')]=utils[_0x6e70('0x1a')]();agents[_0x1b2453['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x23');agents[_0x1b2453['destuniqueid']][_0x6e70('0x24')]=_0x6e70('0x23');agents[_0x1b2453[_0x6e70('0x17')]]['holdtime']=_0x1b2453['ringtime']?parseInt(_0x1b2453[_0x6e70('0x25')])/0x3e8:0x0;agents[_0x1b2453[_0x6e70('0x17')]][_0x6e70('0x26')]=0x0;unanswered[_0x6e70('0x27')](_0x1b2453[_0x6e70('0x17')]);}}catch(_0x5d772a){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x20'),_0x1b2453[_0x6e70('0x6')]),_0x5d772a);}};exports[_0x6e70('0x28')]=function(_0x20a225){try{_[_0x6e70('0x29')](agents,function(_0x24114a,_0x3a0821){if(_0x24114a[_0x6e70('0x6')]==_0x20a225['uniqueid']&&!_[_0x6e70('0x2a')](unanswered,_0x24114a['destuniqueid'])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x2b'),_0x20a225[_0x6e70('0x6')]),_0x20a225);utils[_0x6e70('0x3')](util['format'](_0x6e70('0x2c'),_0x20a225[_0x6e70('0x6')],_0x24114a['membername'],_0x24114a[_0x6e70('0x17')]));_0x24114a[_0x6e70('0x1e')]=!![];_0x24114a['agentringnoanswerAt']=utils[_0x6e70('0x1a')]();_0x24114a[_0x6e70('0xd')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x24')]=_0x6e70('0x2d');_0x24114a[_0x6e70('0x2e')]=_0x20a225[_0x6e70('0x2e')];_0x24114a[_0x6e70('0x26')]=0x0;writeDB(_0x24114a);}});}catch(_0xf146fd){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x2b'),_0x20a225['uniqueid']),_0xf146fd);}};exports[_0x6e70('0x2f')]=function(_0x3222a2){try{if(agents[_0x3222a2[_0x6e70('0x17')]]){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x30'),_0x3222a2[_0x6e70('0x6')]),_0x3222a2);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x31'),_0x3222a2[_0x6e70('0x6')],agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x9')],_0x3222a2['destuniqueid']));agents[_0x3222a2['destuniqueid']]['agentconnectAt']=utils[_0x6e70('0x1a')]();agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xc')]=_0x3222a2[_0x6e70('0xc')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x32')]=_0x3222a2['connectedlinename'];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];agents[_0x3222a2[_0x6e70('0x17')]][_0x6e70('0xd')]=_0x6e70('0x33');_[_0x6e70('0x29')](agents,function(_0x16fc7d,_0x5be100){if(_0x16fc7d[_0x6e70('0x17')]!=_0x3222a2[_0x6e70('0x17')]&&_0x16fc7d[_0x6e70('0x6')]==_0x3222a2[_0x6e70('0x6')]){_0x16fc7d[_0x6e70('0x26')]=0x0;_0x16fc7d[_0x6e70('0x2e')]=_0x3222a2[_0x6e70('0x25')];_0x16fc7d['agentringnoanswer']=!![];_0x16fc7d['agentringnoanswerAt']=utils['now']();_0x16fc7d[_0x6e70('0xd')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x24')]=_0x6e70('0x34');_0x16fc7d[_0x6e70('0x35')]=_0x3222a2['destuniqueid'];_0x16fc7d[_0x6e70('0x36')]=_0x3222a2[_0x6e70('0x9')];writeDB(_0x16fc7d);}});}}catch(_0x2a2aca){utils['error'](util['format']('[%s][agents][agentconnect]',_0x3222a2[_0x6e70('0x6')]),_0x2a2aca);}};exports['agentcomplete']=function(_0x42f49a){try{if(!_[_0x6e70('0x1f')](agents[_0x42f49a[_0x6e70('0x17')]])){utils[_0x6e70('0x19')](util['format'](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x42f49a);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x38'),_0x42f49a[_0x6e70('0x6')],agents[_0x42f49a['destuniqueid']][_0x6e70('0x9')],_0x42f49a[_0x6e70('0x17')]));agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x12')]=!![];agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')]=utils[_0x6e70('0x1a')]();agents[_0x42f49a['destuniqueid']][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x39')],agents[_0x42f49a[_0x6e70('0x17')]][_0x6e70('0x3b')]);agents[_0x42f49a[_0x6e70('0x17')]]['reason']=_0x42f49a[_0x6e70('0x24')];agents[_0x42f49a['destuniqueid']][_0x6e70('0xd')]=_0x6e70('0x3c');writeDB(agents[_0x42f49a['destuniqueid']]);}}catch(_0x53efc3){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x37'),_0x42f49a['uniqueid']),_0x53efc3);}};exports['blindtransfer']=function(_0x238ebb){try{if(!_[_0x6e70('0x1f')](agents[_0x238ebb[_0x6e70('0x3d')]])){utils[_0x6e70('0x19')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb['uniqueid']),_0x238ebb);utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x3f'),_0x238ebb[_0x6e70('0x6')],agents[_0x238ebb[_0x6e70('0x3d')]]['membername'],agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')]));agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x40')]=!![];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x41')]='blind';agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x42')]=_0x238ebb[_0x6e70('0x43')];agents[_0x238ebb[_0x6e70('0x3d')]][_0x6e70('0x44')]=agents[_0x238ebb['transfereruniqueid']][_0x6e70('0x6')];}}catch(_0x1dd242){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x3e'),_0x238ebb[_0x6e70('0x6')]),_0x1dd242);}};exports['attendedtransfer']=function(_0x40e7c6){try{utils[_0x6e70('0x19')](util['format'](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x40e7c6);if(_0x40e7c6['origtransfereruniqueid']==_0x40e7c6[_0x6e70('0x47')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x48')]])){utils[_0x6e70('0x3')](util[_0x6e70('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x9')]));agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x40')]=!![];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x41')]=_0x6e70('0x49');agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x42')]=_0x40e7c6[_0x6e70('0x4a')];agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x46')];}if(_0x40e7c6[_0x6e70('0x4b')]&&agents[_0x40e7c6[_0x6e70('0x4b')]]){agents[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x4b')]]=_[_0x6e70('0x4d')](agents[_0x40e7c6['transfereeuniqueid']]);transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x48')]][_0x6e70('0xb')];transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4e')]=agents[_0x40e7c6['secondtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x4b')]]['agentcalledAt']=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x3b')]=utils['now']();transfers[_0x40e7c6['transfereeuniqueid']][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x4b')]][_0x6e70('0x4c')]=0x2;}}else if(_0x40e7c6[_0x6e70('0x48')]==_0x40e7c6[_0x6e70('0x4f')]){if(!_[_0x6e70('0x1f')](agents[_0x40e7c6[_0x6e70('0x46')]])){utils['info'](util['format'](_0x6e70('0x50'),_0x40e7c6[_0x6e70('0x46')],agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x9')]));agents[_0x40e7c6['origtransfereruniqueid']]['transfer']=!![];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x41')]='ATTENDED';agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x42')]=_0x40e7c6['secondtransfererexten'];agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0x44')]=_0x40e7c6[_0x6e70('0x48')];}if(_0x40e7c6[_0x6e70('0x51')]&&agents[_0x40e7c6[_0x6e70('0x51')]]){agents[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x1;transfers[_0x40e7c6[_0x6e70('0x51')]]=_['clone'](agents[_0x40e7c6[_0x6e70('0x51')]]);transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0xb')]=agents[_0x40e7c6[_0x6e70('0x46')]][_0x6e70('0xb')];transfers[_0x40e7c6['transfertargetuniqueid']]['calleridname']=agents[_0x40e7c6['origtransfereruniqueid']][_0x6e70('0x4e')];transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x52')]=utils['now']();transfers[_0x40e7c6['transfertargetuniqueid']][_0x6e70('0x3b')]=utils[_0x6e70('0x1a')]();transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x2e')]=0x0;transfers[_0x40e7c6[_0x6e70('0x51')]][_0x6e70('0x4c')]=0x2;}}}catch(_0x5eb6f0){utils[_0x6e70('0x1c')](util[_0x6e70('0x4')](_0x6e70('0x45'),_0x40e7c6[_0x6e70('0x46')]),_0x5eb6f0);}};exports['hangup']=function(_0xce964b){try{utils['debug'](util['format'](_0x6e70('0x53'),_0xce964b[_0x6e70('0x6')]),_0xce964b);if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]===_0x6e70('0x23')){if(_0xce964b['cause']==='21'){agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x54');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x54');}utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')],agents[_0xce964b['uniqueid']]['lastevent']));writeDB(agents[_0xce964b[_0x6e70('0x6')]]);var _0x18ecf0=unanswered[_0x6e70('0x56')](_0xce964b[_0x6e70('0x6')]);if(_0x18ecf0>-0x1){unanswered[_0x6e70('0x57')](_0x18ecf0,0x1);}}if(transfers[_0xce964b['uniqueid']]){transfers[_0xce964b['uniqueid']][_0x6e70('0x12')]=!![];transfers[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x3b')]);transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=_0x6e70('0x58');transfers[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils['info'](util['format'](_0x6e70('0x55'),_0xce964b['uniqueid'],transfers[_0xce964b[_0x6e70('0x6')]]['membername'],transfers[_0xce964b['uniqueid']][_0x6e70('0x24')],transfers[_0xce964b['uniqueid']]['lastevent']));writeDB(transfers[_0xce964b[_0x6e70('0x6')]],!![]);}if(agents[_0xce964b[_0x6e70('0x6')]]&&agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']){agents[_0xce964b['uniqueid']]['agentcomplete']=!![];agents[_0xce964b[_0x6e70('0x6')]]['agentcompleteAt']=utils[_0x6e70('0x1a')]();agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x26')]=utils[_0x6e70('0x3a')](agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x39')],agents[_0xce964b[_0x6e70('0x6')]]['agentconnectAt']);agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0x24')]=agents[_0xce964b[_0x6e70('0x6')]]['transfer']?_0x6e70('0x40'):_0x6e70('0x58');agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]=_0x6e70('0x3c');utils[_0x6e70('0x3')](util[_0x6e70('0x4')](_0x6e70('0x55'),_0xce964b[_0x6e70('0x6')],agents[_0xce964b['uniqueid']][_0x6e70('0x9')],agents[_0xce964b[_0x6e70('0x6')]]['reason'],agents[_0xce964b[_0x6e70('0x6')]][_0x6e70('0xd')]));writeDB(agents[_0xce964b['uniqueid']]);}}catch(_0x596d71){utils[_0x6e70('0x1c')](util['format'](_0x6e70('0x53'),_0xce964b['uniqueid']),_0x596d71);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 50b74d8..197ffcc 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 _0xea7e=['sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x1703b5,_0x43b249){var _0x16792c=function(_0x14d0c2){while(--_0x14d0c2){_0x1703b5['push'](_0x1703b5['shift']());}};_0x16792c(++_0x43b249);}(_0xea7e,0x143));var _0xeea7=function(_0x54c6ce,_0x5194e2){_0x54c6ce=_0x54c6ce-0x0;var _0x260983=_0xea7e[_0x54c6ce];return _0x260983;};'use strict';var _=require('lodash');var util=require(_0xeea7('0x0'));var utils=require(_0xeea7('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0xeea7('0x2'),_0xeea7('0x3'),_0xeea7('0x3'),'NO\x20ANSWER',_0xeea7('0x2'),_0xeea7('0x2'),_0xeea7('0x4'),_0xeea7('0x5'),_0xeea7('0x3'),_0xeea7('0x3'),_0xeea7('0x3')];var channels={};function writeDB(_0xe52304){var _0x3583d2;if(transfers[_0xeea7('0x6')][_0xe52304[_0xeea7('0x7')]]){_0x3583d2=_0xe52304['uniqueid'];_0xe52304[_0xeea7('0x7')]=transfers[_0xeea7('0x6')][_0xe52304[_0xeea7('0x7')]]['transfereeuniqueid'];}utils[_0xeea7('0x8')](util[_0xeea7('0x9')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0xe52304[_0xeea7('0x7')],_0xe52304[_0xeea7('0xa')],_0xe52304[_0xeea7('0xb')],_0xe52304[_0xeea7('0xc')],_0xe52304[_0xeea7('0xd')],_0xe52304[_0xeea7('0xe')],_0xe52304[_0xeea7('0xf')],_0xe52304['lastevent']));if(_0xe52304['accountcode']){utils['getUserByInternal'](_0xe52304[_0xeea7('0x10')])[_0xeea7('0x11')](function(_0x534dac){if(_0x534dac){_0xe52304[_0xeea7('0x12')]=_0x534dac['id'];}utils[_0xeea7('0x13')](_0xeea7('0x14'),_0xe52304);});}else{utils['request'](_0xeea7('0x14'),_0xe52304);}if(channels[_0xe52304['uniqueid']]){delete channels[_0xe52304[_0xeea7('0x7')]];}else if(_0x3583d2&&channels[_0x3583d2]){if(!transfers['blinds'][_0x3583d2]['recording'])delete transfers[_0xeea7('0x6')][_0x3583d2];delete channels[_0x3583d2];}}exports[_0xeea7('0x15')]=function(_0x468c62){try{utils[_0xeea7('0x16')](util[_0xeea7('0x9')](_0xeea7('0x17'),_0x468c62[_0xeea7('0x7')]),_0x468c62);if(_0x468c62['uniqueid']==_0x468c62[_0xeea7('0x18')]&&_0x468c62['channel']!=_0xeea7('0x19')){utils['info'](util[_0xeea7('0x9')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x468c62[_0xeea7('0x7')],_0x468c62['context'],_0x468c62[_0xeea7('0x1a')]));channels[_0x468c62[_0xeea7('0x7')]]={'uniqueid':_0x468c62[_0xeea7('0x7')],'accountcode':_0x468c62[_0xeea7('0x10')],'source':_0x468c62[_0xeea7('0xe')],'destination':_0x468c62[_0xeea7('0x1a')],'destinationcontext':_0x468c62[_0xeea7('0x1b')],'channel':_0x468c62[_0xeea7('0xa')],'starttime':utils[_0xeea7('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xeea7('0x1d')};}}catch(_0x1ac42c){utils['error'](util[_0xeea7('0x9')]('[%s][calls][newchannel]',_0x468c62[_0xeea7('0x7')]),_0x1ac42c);}};exports[_0xeea7('0x1e')]=function(_0xeb0454){try{utils['debug'](util[_0xeea7('0x9')](_0xeea7('0x1f'),_0xeb0454[_0xeea7('0x7')]),_0xeb0454);if(!_[_0xeea7('0x20')](channels[_0xeb0454[_0xeea7('0x7')]])&&_0xeb0454[_0xeea7('0x21')]==0x6){utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x22'),_0xeb0454[_0xeea7('0x7')],_0xeb0454[_0xeea7('0x1b')],_0xeb0454['channel']));if(_['isNil'](channels[_0xeb0454[_0xeea7('0x7')]]['systemanswertime'])){channels[_0xeb0454[_0xeea7('0x7')]][_0xeea7('0x23')]=utils['now']();}}else if(!_[_0xeea7('0x20')](channels[_0xeb0454[_0xeea7('0x18')]])&&_0xeb0454[_0xeea7('0x21')]==0x6&&_0xeb0454[_0xeea7('0x1b')]!='transfer'){utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x24'),_0xeb0454['uniqueid'],_0xeb0454[_0xeea7('0x18')],_0xeb0454[_0xeea7('0x1b')],_0xeb0454['channel']));channels[_0xeb0454[_0xeea7('0x18')]]['accountcode']=_0xeb0454[_0xeea7('0x10')];channels[_0xeb0454['linkedid']][_0xeea7('0x25')]=_0xeb0454[_0xeea7('0xa')];if(_[_0xeea7('0x20')](channels[_0xeb0454['linkedid']][_0xeea7('0x26')])){channels[_0xeb0454[_0xeea7('0x18')]]['answertime']=utils[_0xeea7('0x1c')]();}channels[_0xeb0454['linkedid']][_0xeea7('0x27')]=dispositions[_[_0xeea7('0x28')](_0xeb0454[_0xeea7('0x21')])]||_0xeea7('0x4');}}catch(_0x1cf8aa){utils[_0xeea7('0x29')](util['format'](_0xeea7('0x1f'),_0xeb0454[_0xeea7('0x7')]),_0x1cf8aa);}};exports[_0xeea7('0x2a')]=function(_0x168e62){try{if(!_[_0xeea7('0x20')](channels[_0x168e62[_0xeea7('0x7')]])){utils[_0xeea7('0x16')](util[_0xeea7('0x9')]('[%s][calls][hangup]',_0x168e62[_0xeea7('0x7')]),_0x168e62);if(_[_0xeea7('0x20')](channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x2b')])){channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x2b')]=_0x168e62['calleridname']+'\x20<'+_0x168e62[_0xeea7('0xe')]+'>';}utils['info'](util[_0xeea7('0x9')](_0xeea7('0x2c'),_0x168e62[_0xeea7('0x7')],channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x2b')],_0x168e62['cause-txt']));channels[_0x168e62['uniqueid']][_0xeea7('0x2d')]=utils[_0xeea7('0x1c')]();channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x2e')]=utils[_0xeea7('0x2f')](channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x2d')],channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x30')]);channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x31')]=channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x26')]?utils['diffTime'](channels[_0x168e62['uniqueid']][_0xeea7('0x2d')],channels[_0x168e62[_0xeea7('0x7')]][_0xeea7('0x26')]):0x0;writeDB(channels[_0x168e62['uniqueid']]);}}catch(_0x199ab2){utils[_0xeea7('0x29')](util[_0xeea7('0x9')](_0xeea7('0x32'),_0x168e62[_0xeea7('0x7')]),_0x199ab2);}};exports[_0xeea7('0x33')]=function(_0xbe47f0){try{if(!_[_0xeea7('0x20')](channels[_0xbe47f0[_0xeea7('0x34')]])){utils[_0xeea7('0x16')](util[_0xeea7('0x9')]('[%s][calls][attendedtransfer]',_0xbe47f0[_0xeea7('0x35')]),_0xbe47f0);if(channels[_0xbe47f0['localtwolinkedid']]['channel']==_0xbe47f0[_0xeea7('0x36')]){utils['info'](util[_0xeea7('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xbe47f0[_0xeea7('0x35')],_0xbe47f0[_0xeea7('0x34')],_0xbe47f0['secondtransfererchannel']));channels[_0xbe47f0['localtwolinkedid']][_0xeea7('0x25')]=_0xbe47f0[_0xeea7('0x37')];channels[_0xbe47f0['localtwolinkedid']][_0xeea7('0x38')]=_0xeea7('0x39');}else if(channels[_0xbe47f0[_0xeea7('0x34')]][_0xeea7('0xa')]=_0xbe47f0[_0xeea7('0x3a')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xbe47f0[_0xeea7('0x35')],_0xbe47f0[_0xeea7('0x34')],_0xbe47f0[_0xeea7('0x3b')]));channels[_0xbe47f0['localtwolinkedid']][_0xeea7('0x25')]=_0xbe47f0[_0xeea7('0x3b')];channels[_0xbe47f0[_0xeea7('0x34')]][_0xeea7('0x38')]='_attended';}}}catch(_0x221c39){utils[_0xeea7('0x29')](util[_0xeea7('0x9')]('[%s][calls][attendedtransfer]',_0xbe47f0[_0xeea7('0x35')]),_0x221c39);}};exports[_0xeea7('0x3c')]=function(_0x316299){try{if(!_[_0xeea7('0x20')](channels[_0x316299[_0xeea7('0x7')]])){utils[_0xeea7('0x16')](util[_0xeea7('0x9')](_0xeea7('0x3d'),_0x316299[_0xeea7('0x7')]),_0x316299);channels[_0x316299['uniqueid']][_0xeea7('0x3e')]=utils['now']();utils['info'](util[_0xeea7('0x9')](_0xeea7('0x3f'),_0x316299[_0xeea7('0x7')],channels[_0x316299['uniqueid']][_0xeea7('0x3e')]));}}catch(_0x53616d){utils[_0xeea7('0x29')](util[_0xeea7('0x9')](_0xeea7('0x3d'),_0x316299[_0xeea7('0x7')]),_0x53616d);}};exports[_0xeea7('0x40')]=function(_0xd9692e){try{if(!_[_0xeea7('0x20')](channels[_0xd9692e[_0xeea7('0x7')]])){utils[_0xeea7('0x16')](util[_0xeea7('0x9')](_0xeea7('0x41'),_0xd9692e[_0xeea7('0x7')]),_0xd9692e);if(!_[_0xeea7('0x20')](channels[_0xd9692e[_0xeea7('0x7')]][_0xeea7('0x3e')])){channels[_0xd9692e[_0xeea7('0x7')]][_0xeea7('0x42')]+=utils[_0xeea7('0x2f')](utils[_0xeea7('0x1c')](),channels[_0xd9692e[_0xeea7('0x7')]][_0xeea7('0x3e')]);utils['info'](util['format'](_0xeea7('0x43'),_0xd9692e[_0xeea7('0x7')],channels[_0xd9692e[_0xeea7('0x7')]][_0xeea7('0x42')]));delete channels[_0xd9692e[_0xeea7('0x7')]][_0xeea7('0x3e')];}}}catch(_0x2e3e48){utils[_0xeea7('0x29')](util[_0xeea7('0x9')](_0xeea7('0x41'),_0xd9692e[_0xeea7('0x7')]),_0x2e3e48);}};exports[_0xeea7('0x44')]=function(_0x55733c){try{if(!_[_0xeea7('0x20')](channels[_0x55733c[_0xeea7('0x7')]])){utils[_0xeea7('0x16')](util['format'](_0xeea7('0x45'),_0x55733c[_0xeea7('0x7')]),_0x55733c);if(!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')]['xmd-originatecalleridnum'])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x55733c[_0xeea7('0x7')],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c[_0xeea7('0x7')]][_0xeea7('0x48')]=_0x55733c[_0xeea7('0x47')];}if(!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')][_0xeea7('0x49')])){utils[_0xeea7('0x8')](util['format'](_0xeea7('0x4a'),_0x55733c[_0xeea7('0x7')],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']][_0xeea7('0x4b')]=_0x55733c[_0xeea7('0x47')];channels[_0x55733c['uniqueid']]['callerid']='\x22'+_0x55733c['value']+_0xeea7('0x4c')+_0x55733c[_0xeea7('0x47')]+'>';}if(!_[_0xeea7('0x20')](_0x55733c['variable'][_0xeea7('0x4d')])||!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')]['xmd-callerid'])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x4e'),_0x55733c[_0xeea7('0x7')],!_['isNil'](_0x55733c[_0xeea7('0x46')][_0xeea7('0x4d')])?_0xeea7('0x4d'):'xmd-callerid',_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']]['callerid']=_0x55733c['value'];}if(!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')][_0xeea7('0x4f')])||!_['isNil'](_0x55733c['variable'][_0xeea7('0x50')])){utils['info'](util[_0xeea7('0x9')](_0xeea7('0x4e'),_0x55733c[_0xeea7('0x7')],!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')][_0xeea7('0x4f')])?'xmd-queue':_0xeea7('0x50'),_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']][_0xeea7('0x51')]='Queue';channels[_0x55733c[_0xeea7('0x7')]][_0xeea7('0x52')]=_0x55733c['value'];channels[_0x55733c[_0xeea7('0x7')]]['queue']=!![];}if(!_['isNil'](_0x55733c['variable'][_0xeea7('0x53')])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x55733c[_0xeea7('0x7')],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']][_0xeea7('0x54')]=_0x55733c[_0xeea7('0x47')];}if(!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')][_0xeea7('0x55')])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x55733c['uniqueid'],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']][_0xeea7('0x56')]=_0x55733c[_0xeea7('0x47')];}if(!_['isNil'](_0x55733c[_0xeea7('0x46')][_0xeea7('0x57')])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x58'),_0x55733c[_0xeea7('0x7')],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c[_0xeea7('0x7')]]['routeid']=_0x55733c[_0xeea7('0x47')];}if(!_[_0xeea7('0x20')](_0x55733c[_0xeea7('0x46')][_0xeea7('0x59')])){utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x5a'),_0x55733c[_0xeea7('0x7')],_0x55733c[_0xeea7('0x47')]));channels[_0x55733c['uniqueid']][_0xeea7('0x59')]=_0x55733c[_0xeea7('0x47')];}}}catch(_0x22aa9e){utils['error'](util['format'](_0xeea7('0x45'),_0x55733c['uniqueid']),_0x22aa9e);}};exports['newexten']=function(_0x557dc0){try{if(!_[_0xeea7('0x20')](channels[_0x557dc0[_0xeea7('0x7')]])){utils['debug'](util[_0xeea7('0x9')](_0xeea7('0x5b'),_0x557dc0[_0xeea7('0x7')]),_0x557dc0);utils[_0xeea7('0x8')](util[_0xeea7('0x9')](_0xeea7('0x5c'),_0x557dc0[_0xeea7('0x7')],_0x557dc0[_0xeea7('0x5d')],_0x557dc0[_0xeea7('0x5e')]));if(_0x557dc0['application'][_0xeea7('0x5f')]()==_0xeea7('0x60')&&_[_0xeea7('0x61')](_0x557dc0[_0xeea7('0x5e')][_0xeea7('0x5f')](),'cdr')){var _0x2bce24=_0x557dc0[_0xeea7('0x5e')][_0xeea7('0x62')]('=');var _0x2a9eac=_0x2bce24[0x0][_0xeea7('0x63')](_0x2bce24[0x0]['lastIndexOf']('(')+0x1,_0x2bce24[0x0][_0xeea7('0x64')](')'));var _0xcfd5ac=_0x2bce24[0x1];channels[_0x557dc0[_0xeea7('0x7')]][_0x2a9eac]=_0xcfd5ac;}if(!_[_0xeea7('0x65')]([_0xeea7('0x2a'),'noop','execif','set',_0xeea7('0x66')],_0x557dc0[_0xeea7('0x5d')][_0xeea7('0x5f')]())){channels[_0x557dc0[_0xeea7('0x7')]][_0xeea7('0x51')]=_0x557dc0[_0xeea7('0x5d')];channels[_0x557dc0['uniqueid']][_0xeea7('0x52')]=_0x557dc0[_0xeea7('0x5e')];}}}catch(_0x477d1f){utils['error'](util[_0xeea7('0x9')](_0xeea7('0x5b'),_0x557dc0[_0xeea7('0x7')]),_0x477d1f);}}; \ No newline at end of file +var _0xa899=['lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','lastevent','accountcode','UserId','CreateVoiceCallReport','request','blinds','recording','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','calleridnum','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','attendedtransfer','localtwolinkedid','transfereechannel','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue'];(function(_0x599c3e,_0x3c1970){var _0x3bd178=function(_0x1ccfb0){while(--_0x1ccfb0){_0x599c3e['push'](_0x599c3e['shift']());}};_0x3bd178(++_0x3c1970);}(_0xa899,0x155));var _0x9a89=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0xa899[_0x879e31];return _0x3467e8;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var utils=require(_0x9a89('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x9a89('0x3'),_0x9a89('0x4'),_0x9a89('0x4'),_0x9a89('0x3'),_0x9a89('0x3'),_0x9a89('0x3'),_0x9a89('0x5'),_0x9a89('0x6'),_0x9a89('0x4'),_0x9a89('0x4'),_0x9a89('0x4')];var channels={};function writeDB(_0x995cf7){var _0x5e5454;if(transfers['blinds'][_0x995cf7['uniqueid']]){_0x5e5454=_0x995cf7[_0x9a89('0x7')];_0x995cf7[_0x9a89('0x7')]=transfers['blinds'][_0x995cf7[_0x9a89('0x7')]]['transfereeuniqueid'];}utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0xa'),_0x995cf7[_0x9a89('0x7')],_0x995cf7[_0x9a89('0xb')],_0x995cf7[_0x9a89('0xc')],_0x995cf7[_0x9a89('0xd')],_0x995cf7['interface'],_0x995cf7['calleridnum'],_0x995cf7[_0x9a89('0xe')],_0x995cf7[_0x9a89('0xf')]));if(_0x995cf7[_0x9a89('0x10')]){utils['getUserByInternal'](_0x995cf7['accountcode'])['then'](function(_0x1c66a3){if(_0x1c66a3){_0x995cf7[_0x9a89('0x11')]=_0x1c66a3['id'];}utils['request'](_0x9a89('0x12'),_0x995cf7);});}else{utils[_0x9a89('0x13')](_0x9a89('0x12'),_0x995cf7);}if(channels[_0x995cf7[_0x9a89('0x7')]]){delete channels[_0x995cf7['uniqueid']];}else if(_0x5e5454&&channels[_0x5e5454]){if(!transfers[_0x9a89('0x14')][_0x5e5454][_0x9a89('0x15')])delete transfers['blinds'][_0x5e5454];delete channels[_0x5e5454];}}exports['newchannel']=function(_0x35221f){try{utils['debug'](util[_0x9a89('0x9')](_0x9a89('0x16'),_0x35221f['uniqueid']),_0x35221f);if(_0x35221f[_0x9a89('0x7')]==_0x35221f['linkedid']&&_0x35221f[_0x9a89('0xb')]!=_0x9a89('0x17')){utils['info'](util[_0x9a89('0x9')](_0x9a89('0x18'),_0x35221f[_0x9a89('0x7')],_0x35221f[_0x9a89('0x19')],_0x35221f[_0x9a89('0x1a')]));channels[_0x35221f[_0x9a89('0x7')]]={'uniqueid':_0x35221f[_0x9a89('0x7')],'accountcode':_0x35221f[_0x9a89('0x10')],'source':_0x35221f['calleridnum'],'destination':_0x35221f['exten'],'destinationcontext':_0x35221f[_0x9a89('0x19')],'channel':_0x35221f[_0x9a89('0xb')],'starttime':utils[_0x9a89('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9a89('0x3'),'amaflags':_0x9a89('0x1c')};}}catch(_0x3cc288){utils['error'](util['format'](_0x9a89('0x16'),_0x35221f['uniqueid']),_0x3cc288);}};exports[_0x9a89('0x1d')]=function(_0x2cca01){try{utils[_0x9a89('0x1e')](util[_0x9a89('0x9')](_0x9a89('0x1f'),_0x2cca01[_0x9a89('0x7')]),_0x2cca01);if(!_[_0x9a89('0x20')](channels[_0x2cca01['uniqueid']])&&_0x2cca01[_0x9a89('0x21')]==0x6){utils['info'](util[_0x9a89('0x9')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x2cca01['uniqueid'],_0x2cca01[_0x9a89('0x19')],_0x2cca01[_0x9a89('0xb')]));if(_['isNil'](channels[_0x2cca01[_0x9a89('0x7')]]['systemanswertime'])){channels[_0x2cca01[_0x9a89('0x7')]][_0x9a89('0x22')]=utils[_0x9a89('0x1b')]();}}else if(!_[_0x9a89('0x20')](channels[_0x2cca01[_0x9a89('0x23')]])&&_0x2cca01[_0x9a89('0x21')]==0x6&&_0x2cca01[_0x9a89('0x19')]!='transfer'){utils['info'](util['format'](_0x9a89('0x24'),_0x2cca01['uniqueid'],_0x2cca01[_0x9a89('0x23')],_0x2cca01[_0x9a89('0x19')],_0x2cca01[_0x9a89('0xb')]));channels[_0x2cca01['linkedid']][_0x9a89('0x10')]=_0x2cca01['accountcode'];channels[_0x2cca01[_0x9a89('0x23')]][_0x9a89('0x25')]=_0x2cca01[_0x9a89('0xb')];if(_[_0x9a89('0x20')](channels[_0x2cca01[_0x9a89('0x23')]]['answertime'])){channels[_0x2cca01[_0x9a89('0x23')]][_0x9a89('0x26')]=utils[_0x9a89('0x1b')]();}channels[_0x2cca01[_0x9a89('0x23')]][_0x9a89('0x27')]=dispositions[_[_0x9a89('0x28')](_0x2cca01[_0x9a89('0x21')])]||_0x9a89('0x5');}}catch(_0x330f2c){utils['error'](util[_0x9a89('0x9')](_0x9a89('0x1f'),_0x2cca01[_0x9a89('0x7')]),_0x330f2c);}};exports[_0x9a89('0x29')]=function(_0x36b137){try{if(!_[_0x9a89('0x20')](channels[_0x36b137[_0x9a89('0x7')]])){utils[_0x9a89('0x1e')](util[_0x9a89('0x9')](_0x9a89('0x2a'),_0x36b137['uniqueid']),_0x36b137);if(_[_0x9a89('0x20')](channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x2b')])){channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x2b')]=_0x36b137[_0x9a89('0x2c')]+'\x20<'+_0x36b137[_0x9a89('0x2d')]+'>';}utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x2e'),_0x36b137[_0x9a89('0x7')],channels[_0x36b137[_0x9a89('0x7')]]['callerid'],_0x36b137[_0x9a89('0x2f')]));channels[_0x36b137['uniqueid']][_0x9a89('0x30')]=utils[_0x9a89('0x1b')]();channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x31')]=utils[_0x9a89('0x32')](channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x30')],channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x33')]);channels[_0x36b137['uniqueid']][_0x9a89('0x34')]=channels[_0x36b137[_0x9a89('0x7')]][_0x9a89('0x26')]?utils[_0x9a89('0x32')](channels[_0x36b137['uniqueid']]['endtime'],channels[_0x36b137[_0x9a89('0x7')]]['answertime']):0x0;writeDB(channels[_0x36b137[_0x9a89('0x7')]]);}}catch(_0x2f5a78){utils[_0x9a89('0x35')](util[_0x9a89('0x9')](_0x9a89('0x2a'),_0x36b137[_0x9a89('0x7')]),_0x2f5a78);}};exports[_0x9a89('0x36')]=function(_0x23974a){try{if(!_['isNil'](channels[_0x23974a['localtwolinkedid']])){utils['debug'](util[_0x9a89('0x9')]('[%s][calls][attendedtransfer]',_0x23974a['origtransfereruniqueid']),_0x23974a);if(channels[_0x23974a[_0x9a89('0x37')]][_0x9a89('0xb')]==_0x23974a[_0x9a89('0x38')]){utils['info'](util[_0x9a89('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x23974a[_0x9a89('0x39')],_0x23974a['localtwolinkedid'],_0x23974a[_0x9a89('0x3a')]));channels[_0x23974a[_0x9a89('0x37')]][_0x9a89('0x25')]=_0x23974a['secondtransfererchannel'];channels[_0x23974a[_0x9a89('0x37')]][_0x9a89('0x3b')]=_0x9a89('0x3c');}else if(channels[_0x23974a['localtwolinkedid']]['channel']=_0x23974a[_0x9a89('0x3d')]){utils['info'](util[_0x9a89('0x9')](_0x9a89('0x3e'),_0x23974a['origtransfereruniqueid'],_0x23974a[_0x9a89('0x37')],_0x23974a[_0x9a89('0x3f')]));channels[_0x23974a['localtwolinkedid']]['destinationchannel']=_0x23974a[_0x9a89('0x3f')];channels[_0x23974a[_0x9a89('0x37')]]['userfield']=_0x9a89('0x3c');}}}catch(_0x483c02){utils[_0x9a89('0x35')](util[_0x9a89('0x9')](_0x9a89('0x40'),_0x23974a[_0x9a89('0x39')]),_0x483c02);}};exports[_0x9a89('0x41')]=function(_0x4f9b7b){try{if(!_[_0x9a89('0x20')](channels[_0x4f9b7b['uniqueid']])){utils[_0x9a89('0x1e')](util[_0x9a89('0x9')]('[%s][calls][musiconholdstart]',_0x4f9b7b[_0x9a89('0x7')]),_0x4f9b7b);channels[_0x4f9b7b[_0x9a89('0x7')]][_0x9a89('0x42')]=utils[_0x9a89('0x1b')]();utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x43'),_0x4f9b7b[_0x9a89('0x7')],channels[_0x4f9b7b[_0x9a89('0x7')]][_0x9a89('0x42')]));}}catch(_0x293fb5){utils['error'](util[_0x9a89('0x9')](_0x9a89('0x44'),_0x4f9b7b[_0x9a89('0x7')]),_0x293fb5);}};exports['musiconholdstop']=function(_0x2f20c9){try{if(!_[_0x9a89('0x20')](channels[_0x2f20c9['uniqueid']])){utils['debug'](util[_0x9a89('0x9')](_0x9a89('0x45'),_0x2f20c9[_0x9a89('0x7')]),_0x2f20c9);if(!_['isNil'](channels[_0x2f20c9[_0x9a89('0x7')]][_0x9a89('0x42')])){channels[_0x2f20c9[_0x9a89('0x7')]]['mohtime']+=utils[_0x9a89('0x32')](utils['now'](),channels[_0x2f20c9[_0x9a89('0x7')]]['musiconholdstartAt']);utils['info'](util[_0x9a89('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x2f20c9['uniqueid'],channels[_0x2f20c9['uniqueid']]['mohtime']));delete channels[_0x2f20c9['uniqueid']]['musiconholdstartAt'];}}}catch(_0x348925){utils['error'](util[_0x9a89('0x9')](_0x9a89('0x45'),_0x2f20c9['uniqueid']),_0x348925);}};exports[_0x9a89('0x46')]=function(_0x5c7215){try{if(!_['isNil'](channels[_0x5c7215[_0x9a89('0x7')]])){utils[_0x9a89('0x1e')](util[_0x9a89('0x9')](_0x9a89('0x47'),_0x5c7215['uniqueid']),_0x5c7215);if(!_[_0x9a89('0x20')](_0x5c7215['variable'][_0x9a89('0x48')])){utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x49'),_0x5c7215[_0x9a89('0x7')],_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0x4b')]=_0x5c7215[_0x9a89('0x4a')];}if(!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')]['xmd-phone'])){utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x4d'),_0x5c7215[_0x9a89('0x7')],_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215['uniqueid']]['destination']=_0x5c7215[_0x9a89('0x4a')];channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0x2b')]='\x22'+_0x5c7215['value']+'\x22\x20<'+_0x5c7215['value']+'>';}if(!_['isNil'](_0x5c7215['variable'][_0x9a89('0x4e')])||!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')]['xmd-callerid'])){utils['info'](util[_0x9a89('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5c7215['uniqueid'],!_[_0x9a89('0x20')](_0x5c7215['variable'][_0x9a89('0x4e')])?_0x9a89('0x4e'):'xmd-callerid',_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215[_0x9a89('0x7')]]['callerid']=_0x5c7215[_0x9a89('0x4a')];}if(!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')]['xmd-queue'])||!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')]['xmcs-queue'])){utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x4f'),_0x5c7215['uniqueid'],!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')][_0x9a89('0x50')])?_0x9a89('0x50'):'xmcs-queue',_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215['uniqueid']][_0x9a89('0x51')]=_0x9a89('0x52');channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0x53')]=_0x5c7215[_0x9a89('0x4a')];channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0xc')]=!![];}if(!_[_0x9a89('0x20')](_0x5c7215['variable']['xmd-contactid'])){utils[_0x9a89('0x8')](util['format'](_0x9a89('0x54'),_0x5c7215[_0x9a89('0x7')],_0x5c7215['value']));channels[_0x5c7215['uniqueid']][_0x9a89('0x55')]=_0x5c7215[_0x9a89('0x4a')];}if(!_[_0x9a89('0x20')](_0x5c7215[_0x9a89('0x4c')][_0x9a89('0x56')])){utils[_0x9a89('0x8')](util[_0x9a89('0x9')](_0x9a89('0x57'),_0x5c7215[_0x9a89('0x7')],_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215['uniqueid']][_0x9a89('0x58')]=_0x5c7215[_0x9a89('0x4a')];}if(!_['isNil'](_0x5c7215[_0x9a89('0x4c')]['outboundrouteid'])){utils['info'](util[_0x9a89('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5c7215[_0x9a89('0x7')],_0x5c7215[_0x9a89('0x4a')]));channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0x59')]=_0x5c7215[_0x9a89('0x4a')];}if(!_['isNil'](_0x5c7215['variable'][_0x9a89('0x5a')])){utils['info'](util[_0x9a89('0x9')](_0x9a89('0x5b'),_0x5c7215[_0x9a89('0x7')],_0x5c7215['value']));channels[_0x5c7215[_0x9a89('0x7')]][_0x9a89('0x5a')]=_0x5c7215[_0x9a89('0x4a')];}}}catch(_0x461445){utils['error'](util[_0x9a89('0x9')](_0x9a89('0x47'),_0x5c7215[_0x9a89('0x7')]),_0x461445);}};exports[_0x9a89('0x5c')]=function(_0x56c375){try{if(!_[_0x9a89('0x20')](channels[_0x56c375[_0x9a89('0x7')]])){utils[_0x9a89('0x1e')](util[_0x9a89('0x9')](_0x9a89('0x5d'),_0x56c375[_0x9a89('0x7')]),_0x56c375);utils['info'](util[_0x9a89('0x9')](_0x9a89('0x5e'),_0x56c375['uniqueid'],_0x56c375[_0x9a89('0x5f')],_0x56c375[_0x9a89('0x60')]));if(_0x56c375[_0x9a89('0x5f')][_0x9a89('0x61')]()==_0x9a89('0x62')&&_[_0x9a89('0x63')](_0x56c375[_0x9a89('0x60')][_0x9a89('0x61')](),'cdr')){var _0x2474f0=_0x56c375[_0x9a89('0x60')][_0x9a89('0x64')]('=');var _0x1a3959=_0x2474f0[0x0][_0x9a89('0x65')](_0x2474f0[0x0][_0x9a89('0x66')]('(')+0x1,_0x2474f0[0x0]['lastIndexOf'](')'));var _0x50ade8=_0x2474f0[0x1];channels[_0x56c375['uniqueid']][_0x1a3959]=_0x50ade8;}if(!_['includes'](['hangup',_0x9a89('0x67'),_0x9a89('0x68'),_0x9a89('0x62'),_0x9a89('0x69')],_0x56c375[_0x9a89('0x5f')][_0x9a89('0x61')]())){channels[_0x56c375[_0x9a89('0x7')]]['lastapplication']=_0x56c375[_0x9a89('0x5f')];channels[_0x56c375[_0x9a89('0x7')]]['lastdata']=_0x56c375['appdata'];}}}catch(_0x35b864){utils[_0x9a89('0x35')](util[_0x9a89('0x9')](_0x9a89('0x5d'),_0x56c375[_0x9a89('0x7')]),_0x35b864);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 9372dd9..36bbf3b 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 _0xcde3=['info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xcde3,0x14e));var _0x3cde=function(_0x35c2fc,_0xabea37){_0x35c2fc=_0x35c2fc-0x0;var _0x4727fd=_0xcde3[_0x35c2fc];return _0x4727fd;};'use strict';var utils=require(_0x3cde('0x0'));exports[_0x3cde('0x1')]=function(){utils[_0x3cde('0x2')]('[core]\x20connected');};exports[_0x3cde('0x3')]=function(){utils[_0x3cde('0x2')](_0x3cde('0x4'));};exports[_0x3cde('0x5')]=function(){utils[_0x3cde('0x2')](_0x3cde('0x6'));};exports[_0x3cde('0x7')]=function(_0x376918){utils[_0x3cde('0x7')](_0x3cde('0x8'),_0x376918);};exports[_0x3cde('0x9')]=function(){utils[_0x3cde('0x2')](_0x3cde('0xa'));};exports[_0x3cde('0xb')]=function(_0x57ee33){}; \ No newline at end of file +var _0xf273=['close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x347cae,_0x528d86){var _0x1843bc=function(_0x42bb31){while(--_0x42bb31){_0x347cae['push'](_0x347cae['shift']());}};_0x1843bc(++_0x528d86);}(_0xf273,0xce));var _0x3f27=function(_0x44fc6c,_0x43aea8){_0x44fc6c=_0x44fc6c-0x0;var _0x23d3d6=_0xf273[_0x44fc6c];return _0x23d3d6;};'use strict';var utils=require(_0x3f27('0x0'));exports[_0x3f27('0x1')]=function(){utils[_0x3f27('0x2')](_0x3f27('0x3'));};exports[_0x3f27('0x4')]=function(){utils['info'](_0x3f27('0x5'));};exports[_0x3f27('0x6')]=function(){utils[_0x3f27('0x2')](_0x3f27('0x7'));};exports[_0x3f27('0x8')]=function(_0x5eb457){utils[_0x3f27('0x8')](_0x3f27('0x9'),_0x5eb457);};exports[_0x3f27('0xa')]=function(){utils[_0x3f27('0x2')]('[core]\x20close');};exports[_0x3f27('0xb')]=function(_0x892cc){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 7a86675..9e9b1de 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 _0x07fc=['[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x07fc,0x17c));var _0xc07f=function(_0x53cadf,_0x1f5afb){_0x53cadf=_0x53cadf-0x0;var _0x123026=_0x07fc[_0x53cadf];return _0x123026;};'use strict';var _=require('lodash');var util=require(_0xc07f('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x5f1b30){utils[_0xc07f('0x1')](util[_0xc07f('0x2')](_0xc07f('0x3'),_0x5f1b30['uniqueid'],_0x5f1b30[_0xc07f('0x4')],_0x5f1b30[_0xc07f('0x5')],_0x5f1b30[_0xc07f('0x6')],_0x5f1b30[_0xc07f('0x7')],_0x5f1b30[_0xc07f('0x8')]));utils[_0xc07f('0x9')](_0xc07f('0xa'),_0x5f1b30);delete dials[_0x5f1b30[_0xc07f('0xb')]];}exports[_0xc07f('0xc')]=function(_0x548ca3){try{utils[_0xc07f('0xd')](util[_0xc07f('0x2')]('[%s][dials][newexten]',_0x548ca3[_0xc07f('0xb')]),_0x548ca3);utils[_0xc07f('0x1')](util[_0xc07f('0x2')](_0xc07f('0xe'),_0x548ca3[_0xc07f('0xb')],_0x548ca3[_0xc07f('0xf')],_0x548ca3['appdata']));if(_0x548ca3[_0xc07f('0xf')][_0xc07f('0x10')]()==_0xc07f('0x11')&&_[_0xc07f('0x12')](_0x548ca3[_0xc07f('0x13')][_0xc07f('0x10')](),_0xc07f('0x14'))){var _0x43fae3=_0x548ca3[_0xc07f('0x13')][_0xc07f('0x15')]('=');dials[_0x548ca3[_0xc07f('0xb')]]={'routeId':_0x43fae3[0x1]};}}catch(_0x2dea43){utils[_0xc07f('0x16')](util[_0xc07f('0x2')](_0xc07f('0x17'),_0x548ca3[_0xc07f('0xb')]),_0x2dea43);}};exports[_0xc07f('0x18')]=function(_0x2a0776){try{utils[_0xc07f('0xd')](util['format'](_0xc07f('0x19'),_0x2a0776[_0xc07f('0xb')]),_0x2a0776);if(!_['isNil'](_0x2a0776[_0xc07f('0x1a')]['outboundrouteid'])){utils['info'](util['format'](_0xc07f('0x1b'),_0x2a0776[_0xc07f('0xb')],_0x2a0776[_0xc07f('0x1c')]));dials[_0x2a0776[_0xc07f('0xb')]]={'routeId':_0x2a0776[_0xc07f('0x1c')]};}}catch(_0x9d980e){utils[_0xc07f('0x16')](util[_0xc07f('0x2')]('[%s][dials][varset]',_0x2a0776[_0xc07f('0xb')]),_0x9d980e);}};exports['dialbegin']=function(_0x5332dc){try{if(!_[_0xc07f('0x1d')](dials[_0x5332dc[_0xc07f('0xb')]])){utils[_0xc07f('0xd')](util[_0xc07f('0x2')](_0xc07f('0x1e'),_0x5332dc['uniqueid']),_0x5332dc);dials[_0x5332dc[_0xc07f('0xb')]]=_[_0xc07f('0x1f')](dials[_0x5332dc[_0xc07f('0xb')]],_0x5332dc);dials[_0x5332dc[_0xc07f('0xb')]]['starttime']=utils[_0xc07f('0x20')]();dials[_0x5332dc[_0xc07f('0xb')]]['lastevent']=_0xc07f('0x21');utils[_0xc07f('0x1')](util[_0xc07f('0x2')](_0xc07f('0x22'),_0x5332dc[_0xc07f('0xb')],dials[_0x5332dc[_0xc07f('0xb')]][_0xc07f('0x23')]));}}catch(_0x21d093){utils[_0xc07f('0x16')](util[_0xc07f('0x2')](_0xc07f('0x1e'),_0x5332dc[_0xc07f('0xb')]),_0x21d093);}};exports[_0xc07f('0x24')]=function(_0xdf4008){try{if(!_[_0xc07f('0x1d')](dials[_0xdf4008[_0xc07f('0xb')]])){utils[_0xc07f('0xd')](util[_0xc07f('0x2')]('[%s][dials][dialend]',_0xdf4008[_0xc07f('0xb')]),_0xdf4008);dials[_0xdf4008[_0xc07f('0xb')]]['dialstatus']=_0xdf4008[_0xc07f('0x8')];if(_0xdf4008[_0xc07f('0x8')]==_0xc07f('0x25')){dials[_0xdf4008[_0xc07f('0xb')]]=_['assign'](dials[_0xdf4008['uniqueid']],_0xdf4008);dials[_0xdf4008[_0xc07f('0xb')]][_0xc07f('0x26')]=utils[_0xc07f('0x20')]();dials[_0xdf4008[_0xc07f('0xb')]]['lastevent']=_0xc07f('0x27');utils[_0xc07f('0x1')](util[_0xc07f('0x2')](_0xc07f('0x28'),_0xdf4008[_0xc07f('0xb')],_0xdf4008[_0xc07f('0x8')],dials[_0xdf4008[_0xc07f('0xb')]][_0xc07f('0x26')]));}else{utils[_0xc07f('0x1')](util['format'](_0xc07f('0x29'),_0xdf4008[_0xc07f('0xb')],_0xdf4008[_0xc07f('0x8')]));}}}catch(_0x55d431){utils[_0xc07f('0x16')](util[_0xc07f('0x2')](_0xc07f('0x2a'),_0xdf4008[_0xc07f('0xb')]),_0x55d431);}};exports[_0xc07f('0x2b')]=function(_0x45466f){try{if(!_['isNil'](dials[_0x45466f[_0xc07f('0xb')]])){utils[_0xc07f('0xd')](util[_0xc07f('0x2')]('[%s][dials][hangup]',_0x45466f[_0xc07f('0xb')]),_0x45466f);utils[_0xc07f('0x1')](util['format'](_0xc07f('0x2c'),_0x45466f[_0xc07f('0xb')],_0x45466f[_0xc07f('0x6')],_0x45466f['calleridname'],_0x45466f[_0xc07f('0x2d')]));dials[_0x45466f[_0xc07f('0xb')]]=_['assign'](dials[_0x45466f[_0xc07f('0xb')]],{'endtime':utils[_0xc07f('0x20')](),'lastevent':_0xc07f('0x2e')});dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x2f')]=utils[_0xc07f('0x30')](dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x31')],dials[_0x45466f['uniqueid']]['starttime']);dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x32')]=utils[_0xc07f('0x30')](dials[_0x45466f[_0xc07f('0xb')]]['answertime']||dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x31')],dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x23')]);dials[_0x45466f['uniqueid']][_0xc07f('0x33')]=dials[_0x45466f['uniqueid']]['answertime']?utils[_0xc07f('0x30')](dials[_0x45466f[_0xc07f('0xb')]]['endtime'],dials[_0x45466f[_0xc07f('0xb')]][_0xc07f('0x26')]):0x0;writeDB(dials[_0x45466f[_0xc07f('0xb')]]);}}catch(_0x3bf214){utils[_0xc07f('0x16')](util[_0xc07f('0x2')](_0xc07f('0x34'),_0x45466f['uniqueid']),_0x3bf214);}}; \ No newline at end of file +var _0x50bf=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','[%s][dials][dialbegin]','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','assign','lastevent','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x50bf,0xa3));var _0xf50b=function(_0x10868f,_0x59dc1d){_0x10868f=_0x10868f-0x0;var _0x209138=_0x50bf[_0x10868f];return _0x209138;};'use strict';var _=require('lodash');var util=require(_0xf50b('0x0'));var utils=require(_0xf50b('0x1'));var dials={};function writeDB(_0x4cde97){utils['info'](util['format'](_0xf50b('0x2'),_0x4cde97[_0xf50b('0x3')],_0x4cde97[_0xf50b('0x4')],_0x4cde97[_0xf50b('0x5')],_0x4cde97['calleridnum'],_0x4cde97[_0xf50b('0x6')],_0x4cde97[_0xf50b('0x7')]));utils[_0xf50b('0x8')](_0xf50b('0x9'),_0x4cde97);delete dials[_0x4cde97[_0xf50b('0x3')]];}exports['newexten']=function(_0x1d998f){try{utils[_0xf50b('0xa')](util['format'](_0xf50b('0xb'),_0x1d998f[_0xf50b('0x3')]),_0x1d998f);utils[_0xf50b('0xc')](util[_0xf50b('0xd')](_0xf50b('0xe'),_0x1d998f[_0xf50b('0x3')],_0x1d998f['application'],_0x1d998f[_0xf50b('0xf')]));if(_0x1d998f[_0xf50b('0x10')][_0xf50b('0x11')]()==_0xf50b('0x12')&&_['startsWith'](_0x1d998f[_0xf50b('0xf')][_0xf50b('0x11')](),_0xf50b('0x13'))){var _0x26d4d5=_0x1d998f[_0xf50b('0xf')][_0xf50b('0x14')]('=');dials[_0x1d998f['uniqueid']]={'routeId':_0x26d4d5[0x1]};}}catch(_0x195211){utils[_0xf50b('0x15')](util['format'](_0xf50b('0xb'),_0x1d998f['uniqueid']),_0x195211);}};exports[_0xf50b('0x16')]=function(_0x5c8d32){try{utils[_0xf50b('0xa')](util[_0xf50b('0xd')](_0xf50b('0x17'),_0x5c8d32[_0xf50b('0x3')]),_0x5c8d32);if(!_[_0xf50b('0x18')](_0x5c8d32[_0xf50b('0x19')][_0xf50b('0x1a')])){utils[_0xf50b('0xc')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x5c8d32[_0xf50b('0x3')],_0x5c8d32[_0xf50b('0x1b')]));dials[_0x5c8d32[_0xf50b('0x3')]]={'routeId':_0x5c8d32[_0xf50b('0x1b')]};}}catch(_0x14b98f){utils['error'](util[_0xf50b('0xd')](_0xf50b('0x17'),_0x5c8d32[_0xf50b('0x3')]),_0x14b98f);}};exports[_0xf50b('0x1c')]=function(_0x27ad92){try{if(!_[_0xf50b('0x18')](dials[_0x27ad92[_0xf50b('0x3')]])){utils[_0xf50b('0xa')](util[_0xf50b('0xd')](_0xf50b('0x1d'),_0x27ad92['uniqueid']),_0x27ad92);dials[_0x27ad92[_0xf50b('0x3')]]=_['assign'](dials[_0x27ad92[_0xf50b('0x3')]],_0x27ad92);dials[_0x27ad92['uniqueid']][_0xf50b('0x1e')]=utils[_0xf50b('0x1f')]();dials[_0x27ad92['uniqueid']]['lastevent']='called';utils[_0xf50b('0xc')](util[_0xf50b('0xd')](_0xf50b('0x20'),_0x27ad92[_0xf50b('0x3')],dials[_0x27ad92[_0xf50b('0x3')]][_0xf50b('0x1e')]));}}catch(_0x1042a9){utils[_0xf50b('0x15')](util[_0xf50b('0xd')](_0xf50b('0x1d'),_0x27ad92[_0xf50b('0x3')]),_0x1042a9);}};exports[_0xf50b('0x21')]=function(_0x4c210f){try{if(!_[_0xf50b('0x18')](dials[_0x4c210f[_0xf50b('0x3')]])){utils[_0xf50b('0xa')](util[_0xf50b('0xd')]('[%s][dials][dialend]',_0x4c210f['uniqueid']),_0x4c210f);dials[_0x4c210f[_0xf50b('0x3')]]['dialstatus']=_0x4c210f[_0xf50b('0x7')];if(_0x4c210f[_0xf50b('0x7')]==_0xf50b('0x22')){dials[_0x4c210f[_0xf50b('0x3')]]=_[_0xf50b('0x23')](dials[_0x4c210f['uniqueid']],_0x4c210f);dials[_0x4c210f[_0xf50b('0x3')]]['answertime']=utils[_0xf50b('0x1f')]();dials[_0x4c210f['uniqueid']][_0xf50b('0x24')]=_0xf50b('0x25');utils['info'](util[_0xf50b('0xd')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4c210f[_0xf50b('0x3')],_0x4c210f['dialstatus'],dials[_0x4c210f[_0xf50b('0x3')]][_0xf50b('0x26')]));}else{utils[_0xf50b('0xc')](util[_0xf50b('0xd')](_0xf50b('0x27'),_0x4c210f['uniqueid'],_0x4c210f[_0xf50b('0x7')]));}}}catch(_0x5fda17){utils[_0xf50b('0x15')](util[_0xf50b('0xd')](_0xf50b('0x28'),_0x4c210f[_0xf50b('0x3')]),_0x5fda17);}};exports['hangup']=function(_0x1e9499){try{if(!_[_0xf50b('0x18')](dials[_0x1e9499[_0xf50b('0x3')]])){utils[_0xf50b('0xa')](util[_0xf50b('0xd')](_0xf50b('0x29'),_0x1e9499[_0xf50b('0x3')]),_0x1e9499);utils[_0xf50b('0xc')](util[_0xf50b('0xd')](_0xf50b('0x2a'),_0x1e9499[_0xf50b('0x3')],_0x1e9499[_0xf50b('0x2b')],_0x1e9499[_0xf50b('0x2c')],_0x1e9499[_0xf50b('0x2d')]));dials[_0x1e9499[_0xf50b('0x3')]]=_[_0xf50b('0x23')](dials[_0x1e9499['uniqueid']],{'endtime':utils[_0xf50b('0x1f')](),'lastevent':_0xf50b('0x2e')});dials[_0x1e9499['uniqueid']][_0xf50b('0x2f')]=utils[_0xf50b('0x30')](dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x31')],dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x1e')]);dials[_0x1e9499[_0xf50b('0x3')]]['holdtime']=utils[_0xf50b('0x30')](dials[_0x1e9499[_0xf50b('0x3')]]['answertime']||dials[_0x1e9499['uniqueid']][_0xf50b('0x31')],dials[_0x1e9499['uniqueid']][_0xf50b('0x1e')]);dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x32')]=dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x26')]?utils['diffTime'](dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x31')],dials[_0x1e9499[_0xf50b('0x3')]][_0xf50b('0x26')]):0x0;writeDB(dials[_0x1e9499['uniqueid']]);}}catch(_0x33d373){utils[_0xf50b('0x15')](util[_0xf50b('0xd')](_0xf50b('0x29'),_0x1e9499[_0xf50b('0x3')]),_0x33d373);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index f92a809..c911c8f 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 _0x1f20=['[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','xdr','disabled','production','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1f20,0xdd));var _0x01f2=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1f20[_0x40a045];return _0x1a687c;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x01f2('0x0'));var util=require('util');var isXDREnabled=config[_0x01f2('0x1')]&&config[_0x01f2('0x1')]['disabled']?!config[_0x01f2('0x1')][_0x01f2('0x2')]:!![];var isProduction=config['env']===_0x01f2('0x3')||![];var isLocalAsterisk=config[_0x01f2('0x1')]&&config['xdr']['local']===!![]||![];var ami=new AsteriskManager(config[_0x01f2('0x4')][_0x01f2('0x5')],config[_0x01f2('0x4')]['ip'],config[_0x01f2('0x4')][_0x01f2('0x6')],config[_0x01f2('0x4')][_0x01f2('0x7')],!![]);ami[_0x01f2('0x8')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x01f2('0x9')](_0x01f2('0xa'));}else{var agents=require(_0x01f2('0xb'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x01f2('0xc'));var members=require(_0x01f2('0xd'));var dials=require(_0x01f2('0xe'));var transfers=require(_0x01f2('0xf'));var core=require(_0x01f2('0x10'));ami['on'](_0x01f2('0x11'),core[_0x01f2('0x11')]);ami['on'](_0x01f2('0x12'),core[_0x01f2('0x12')]);ami['on'](_0x01f2('0x13'),core[_0x01f2('0x13')]);ami['on'](_0x01f2('0x14'),core['error']);ami['on'](_0x01f2('0x15'),core[_0x01f2('0x15')]);ami['on'](_0x01f2('0x16'),core['managerevent']);ami['on'](_0x01f2('0x17'),function(_0x168356){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x1a'),_0x168356['device']),_0x168356);members[_0x01f2('0x17')](_0x168356);}catch(_0x58e541){utils[_0x01f2('0x14')](util['format'](_0x01f2('0x1a'),_0x168356[_0x01f2('0x1b')]),_0x58e541);}});ami['on'](_0x01f2('0x1c'),function(_0x5e04f9){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x1d'),_0x5e04f9[_0x01f2('0x1e')]),_0x5e04f9);agents[_0x01f2('0x1c')](_0x5e04f9);}catch(_0x54e1f8){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x1d'),_0x5e04f9['uniqueid']),_0x54e1f8);}});ami['on'](_0x01f2('0x1f'),function(_0x448f0a){try{utils[_0x01f2('0x18')](util['format']('[%s][index][agentringnoanswer]',_0x448f0a[_0x01f2('0x1e')]),_0x448f0a);agents[_0x01f2('0x1f')](_0x448f0a);}catch(_0x32c9d7){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x20'),_0x448f0a[_0x01f2('0x1e')]),_0x32c9d7);}});ami['on']('agentconnect',function(_0x2e497c){try{utils[_0x01f2('0x18')](util['format'](_0x01f2('0x21'),_0x2e497c['uniqueid']),_0x2e497c);agents[_0x01f2('0x22')](_0x2e497c);queues[_0x01f2('0x22')](_0x2e497c);}catch(_0x736b17){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x21'),_0x2e497c[_0x01f2('0x1e')]),_0x736b17);}});ami['on']('agentcomplete',function(_0x355d26){try{utils['debug'](util[_0x01f2('0x19')](_0x01f2('0x23'),_0x355d26[_0x01f2('0x1e')]),_0x355d26);agents[_0x01f2('0x24')](_0x355d26);queues['agentcomplete'](_0x355d26);members[_0x01f2('0x24')](_0x355d26);}catch(_0x3e2bb5){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x23'),_0x355d26[_0x01f2('0x1e')]),_0x3e2bb5);}});ami['on'](_0x01f2('0x25'),function(_0x2f44b4){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x26'),_0x2f44b4[_0x01f2('0x1e')]),_0x2f44b4);agents[_0x01f2('0x25')](_0x2f44b4);queues['queuecallerabandon'](_0x2f44b4);}catch(_0x22bf9e){utils[_0x01f2('0x14')](util['format'](_0x01f2('0x26'),_0x2f44b4[_0x01f2('0x1e')]),_0x22bf9e);}});ami['on'](_0x01f2('0x27'),function(_0x2ae740){try{utils['debug'](util[_0x01f2('0x19')](_0x01f2('0x28'),_0x2ae740[_0x01f2('0x1e')]),_0x2ae740);queues[_0x01f2('0x27')](_0x2ae740);recordings[_0x01f2('0x27')](_0x2ae740);}catch(_0x27e122){utils['error'](util[_0x01f2('0x19')](_0x01f2('0x28'),_0x2ae740[_0x01f2('0x1e')]),_0x27e122);}});ami['on'](_0x01f2('0x29'),function(_0x5dca7d){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x2a'),_0x5dca7d['uniqueid']),_0x5dca7d);queues[_0x01f2('0x29')](_0x5dca7d);}catch(_0x17487a){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x2a'),_0x5dca7d[_0x01f2('0x1e')]),_0x17487a);}});ami['on'](_0x01f2('0x2b'),function(_0x493348){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')]('[%s][index][musiconholdstart]',_0x493348[_0x01f2('0x1e')]),_0x493348);queues['musiconholdstart'](_0x493348);calls[_0x01f2('0x2b')](_0x493348);}catch(_0x18e808){utils[_0x01f2('0x14')](util[_0x01f2('0x19')]('[%s][index][musiconholdstart]',_0x493348[_0x01f2('0x1e')]),_0x18e808);}});ami['on'](_0x01f2('0x2c'),function(_0xcba296){try{utils['debug'](util[_0x01f2('0x19')](_0x01f2('0x2d'),_0xcba296[_0x01f2('0x1e')]),_0xcba296);queues[_0x01f2('0x2c')](_0xcba296);calls[_0x01f2('0x2c')](_0xcba296);}catch(_0x249342){utils[_0x01f2('0x14')](util[_0x01f2('0x19')]('[%s][index][musiconholdstop]',_0xcba296[_0x01f2('0x1e')]),_0x249342);}});ami['on']('newstate',function(_0x3a82e3){try{utils[_0x01f2('0x18')](util['format']('[%s][index][newstate]',_0x3a82e3['uniqueid']),_0x3a82e3);calls['newstate'](_0x3a82e3);recordings[_0x01f2('0x2e')](_0x3a82e3);}catch(_0x4af68d){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x2f'),_0x3a82e3[_0x01f2('0x1e')]),_0x4af68d);}});ami['on'](_0x01f2('0x30'),function(_0x54d164){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x31'),_0x54d164[_0x01f2('0x1e')]),_0x54d164);calls[_0x01f2('0x30')](_0x54d164);recordings[_0x01f2('0x30')](_0x54d164);dials[_0x01f2('0x30')](_0x54d164);agents['hangup'](_0x54d164);queues[_0x01f2('0x30')](_0x54d164);}catch(_0x50a0a0){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x31'),_0x54d164[_0x01f2('0x1e')]),_0x50a0a0);}});ami['on'](_0x01f2('0x32'),function(_0x1435ab){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x33'),_0x1435ab[_0x01f2('0x1e')]),_0x1435ab);members[_0x01f2('0x32')](_0x1435ab);}catch(_0x4c6b4c){utils['error'](util[_0x01f2('0x19')](_0x01f2('0x33'),_0x1435ab[_0x01f2('0x1e')]),_0x4c6b4c);}});ami['on'](_0x01f2('0x34'),function(_0x32aa6e){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x35'),_0x32aa6e['uniqueid']),_0x32aa6e);queues['blindtransfer'](_0x32aa6e);agents[_0x01f2('0x34')](_0x32aa6e);transfers[_0x01f2('0x34')](_0x32aa6e);recordings[_0x01f2('0x34')](_0x32aa6e);}catch(_0x3dca05){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x35'),_0x32aa6e[_0x01f2('0x1e')]),_0x3dca05);}});ami['on'](_0x01f2('0x36'),function(_0x5592d4){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x37'),_0x5592d4[_0x01f2('0x38')]),_0x5592d4);queues[_0x01f2('0x36')](_0x5592d4);transfers[_0x01f2('0x36')](_0x5592d4);agents[_0x01f2('0x36')](_0x5592d4);calls['attendedtransfer'](_0x5592d4);}catch(_0xf0f6ed){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x37'),_0x5592d4[_0x01f2('0x38')]),_0xf0f6ed);}});ami['on'](_0x01f2('0x39'),function(_0x22cbf3){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')]('[%s][index][varset]',_0x22cbf3[_0x01f2('0x1e')]),_0x22cbf3);queues[_0x01f2('0x39')](_0x22cbf3);recordings[_0x01f2('0x39')](_0x22cbf3);calls[_0x01f2('0x39')](_0x22cbf3);dials[_0x01f2('0x39')](_0x22cbf3);}catch(_0x462e1d){utils['error'](util[_0x01f2('0x19')](_0x01f2('0x3a'),_0x22cbf3[_0x01f2('0x1e')]),_0x462e1d);}});ami['on'](_0x01f2('0x3b'),function(_0x15f7f0){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x3c'),_0x15f7f0[_0x01f2('0x1e')]),_0x15f7f0);calls[_0x01f2('0x3b')](_0x15f7f0);recordings[_0x01f2('0x3b')](_0x15f7f0);dials['newexten'](_0x15f7f0);}catch(_0x5cffca){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x3c'),_0x15f7f0[_0x01f2('0x1e')]),_0x5cffca);}});ami['on'](_0x01f2('0x3d'),function(_0x574c2a){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')](_0x01f2('0x3e'),_0x574c2a['uniqueid']),_0x574c2a);calls[_0x01f2('0x3d')](_0x574c2a);recordings['newchannel'](_0x574c2a);}catch(_0x4bbaa9){utils[_0x01f2('0x14')](util['format'](_0x01f2('0x3e'),_0x574c2a[_0x01f2('0x1e')]),_0x4bbaa9);}});ami['on'](_0x01f2('0x3f'),function(_0x3da440){try{utils['debug'](util['format'](_0x01f2('0x40'),_0x3da440[_0x01f2('0x1e')]),_0x3da440);dials['dialbegin'](_0x3da440);}catch(_0x1b476a){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x41'),_0x3da440[_0x01f2('0x1e')]),_0x1b476a);}});ami['on'](_0x01f2('0x42'),function(_0xbf6fbf){try{utils[_0x01f2('0x18')](util[_0x01f2('0x19')]('[%s][index][dialend]',_0xbf6fbf[_0x01f2('0x1e')]),_0xbf6fbf);dials[_0x01f2('0x42')](_0xbf6fbf);}catch(_0xcffb11){utils[_0x01f2('0x14')](util[_0x01f2('0x19')](_0x01f2('0x43'),_0xbf6fbf[_0x01f2('0x1e')]),_0xcffb11);}});} \ No newline at end of file +var _0x7433=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','[%s][index][varset]','varset','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup'];(function(_0x10677d,_0x5d2e53){var _0x1bcfab=function(_0x22a8e5){while(--_0x22a8e5){_0x10677d['push'](_0x10677d['shift']());}};_0x1bcfab(++_0x5d2e53);}(_0x7433,0x17e));var _0x3743=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x7433[_0x4d2993];return _0x427374;};var AsteriskManager=require(_0x3743('0x0'));var config=require(_0x3743('0x1'));var utils=require(_0x3743('0x2'));var util=require(_0x3743('0x3'));var isXDREnabled=config[_0x3743('0x4')]&&config[_0x3743('0x4')]['disabled']?!config[_0x3743('0x4')][_0x3743('0x5')]:!![];var isProduction=config[_0x3743('0x6')]===_0x3743('0x7')||![];var isLocalAsterisk=config[_0x3743('0x4')]&&config[_0x3743('0x4')][_0x3743('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3743('0x9')],config['asterisk']['ip'],config[_0x3743('0xa')][_0x3743('0xb')],config[_0x3743('0xa')][_0x3743('0xc')],!![]);ami[_0x3743('0xd')]();if(!isXDREnabled){utils[_0x3743('0xe')](_0x3743('0xf'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3743('0xe')](_0x3743('0x10'));}else{var agents=require(_0x3743('0x11'));var calls=require('./calls.controller');var queues=require(_0x3743('0x12'));var recordings=require('./recordings.controller');var members=require(_0x3743('0x13'));var dials=require(_0x3743('0x14'));var transfers=require(_0x3743('0x15'));var core=require(_0x3743('0x16'));ami['on'](_0x3743('0x17'),core[_0x3743('0x17')]);ami['on'](_0x3743('0x18'),core[_0x3743('0x18')]);ami['on'](_0x3743('0x19'),core[_0x3743('0x19')]);ami['on'](_0x3743('0x1a'),core['error']);ami['on'](_0x3743('0x1b'),core[_0x3743('0x1b')]);ami['on'](_0x3743('0x1c'),core[_0x3743('0x1c')]);ami['on'](_0x3743('0x1d'),function(_0x22c70f){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x20'),_0x22c70f[_0x3743('0x21')]),_0x22c70f);members[_0x3743('0x1d')](_0x22c70f);}catch(_0x3b7a5b){utils[_0x3743('0x1a')](util[_0x3743('0x1f')]('[%s][index][devicestatechange]',_0x22c70f['device']),_0x3b7a5b);}});ami['on'](_0x3743('0x22'),function(_0x37b42a){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x23'),_0x37b42a[_0x3743('0x24')]),_0x37b42a);agents[_0x3743('0x22')](_0x37b42a);}catch(_0x12e64f){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x23'),_0x37b42a['uniqueid']),_0x12e64f);}});ami['on'](_0x3743('0x25'),function(_0x4de052){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x26'),_0x4de052[_0x3743('0x24')]),_0x4de052);agents[_0x3743('0x25')](_0x4de052);}catch(_0x50106e){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x26'),_0x4de052[_0x3743('0x24')]),_0x50106e);}});ami['on'](_0x3743('0x27'),function(_0x5bb2ec){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')]('[%s][index][agentconnect]',_0x5bb2ec[_0x3743('0x24')]),_0x5bb2ec);agents['agentconnect'](_0x5bb2ec);queues[_0x3743('0x27')](_0x5bb2ec);}catch(_0x273798){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x28'),_0x5bb2ec[_0x3743('0x24')]),_0x273798);}});ami['on'](_0x3743('0x29'),function(_0x5f311d){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x2a'),_0x5f311d[_0x3743('0x24')]),_0x5f311d);agents[_0x3743('0x29')](_0x5f311d);queues[_0x3743('0x29')](_0x5f311d);members[_0x3743('0x29')](_0x5f311d);}catch(_0x9a65d0){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x2a'),_0x5f311d['uniqueid']),_0x9a65d0);}});ami['on'](_0x3743('0x2b'),function(_0x4eefa9){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x2c'),_0x4eefa9['uniqueid']),_0x4eefa9);agents[_0x3743('0x2b')](_0x4eefa9);queues[_0x3743('0x2b')](_0x4eefa9);}catch(_0xb84cc0){utils[_0x3743('0x1a')](util['format'](_0x3743('0x2c'),_0x4eefa9[_0x3743('0x24')]),_0xb84cc0);}});ami['on']('queuecallerjoin',function(_0x87cf82){try{utils['debug'](util[_0x3743('0x1f')](_0x3743('0x2d'),_0x87cf82[_0x3743('0x24')]),_0x87cf82);queues['queuecallerjoin'](_0x87cf82);recordings[_0x3743('0x2e')](_0x87cf82);}catch(_0x39642b){utils['error'](util[_0x3743('0x1f')]('[%s][index][queuecallerjoin]',_0x87cf82['uniqueid']),_0x39642b);}});ami['on'](_0x3743('0x2f'),function(_0x5b46cb){try{utils['debug'](util[_0x3743('0x1f')](_0x3743('0x30'),_0x5b46cb[_0x3743('0x24')]),_0x5b46cb);queues['queuecallerleave'](_0x5b46cb);}catch(_0x1cf874){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x30'),_0x5b46cb[_0x3743('0x24')]),_0x1cf874);}});ami['on']('musiconholdstart',function(_0x9b18d5){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x31'),_0x9b18d5['uniqueid']),_0x9b18d5);queues[_0x3743('0x32')](_0x9b18d5);calls[_0x3743('0x32')](_0x9b18d5);}catch(_0x3208bd){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x31'),_0x9b18d5['uniqueid']),_0x3208bd);}});ami['on'](_0x3743('0x33'),function(_0x4b0c04){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')]('[%s][index][musiconholdstop]',_0x4b0c04['uniqueid']),_0x4b0c04);queues[_0x3743('0x33')](_0x4b0c04);calls[_0x3743('0x33')](_0x4b0c04);}catch(_0x4209d7){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x34'),_0x4b0c04['uniqueid']),_0x4209d7);}});ami['on'](_0x3743('0x35'),function(_0x4c585c){try{utils['debug'](util['format'](_0x3743('0x36'),_0x4c585c[_0x3743('0x24')]),_0x4c585c);calls[_0x3743('0x35')](_0x4c585c);recordings[_0x3743('0x35')](_0x4c585c);}catch(_0x4dc7b6){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x36'),_0x4c585c['uniqueid']),_0x4dc7b6);}});ami['on'](_0x3743('0x37'),function(_0x264a83){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x38'),_0x264a83[_0x3743('0x24')]),_0x264a83);calls[_0x3743('0x37')](_0x264a83);recordings[_0x3743('0x37')](_0x264a83);dials[_0x3743('0x37')](_0x264a83);agents[_0x3743('0x37')](_0x264a83);queues[_0x3743('0x37')](_0x264a83);}catch(_0x42ca39){utils['error'](util[_0x3743('0x1f')](_0x3743('0x38'),_0x264a83['uniqueid']),_0x42ca39);}});ami['on'](_0x3743('0x39'),function(_0x534c72){try{utils[_0x3743('0x1e')](util['format']('[%s][index][cdr]',_0x534c72[_0x3743('0x24')]),_0x534c72);members[_0x3743('0x39')](_0x534c72);}catch(_0x22382d){utils[_0x3743('0x1a')](util['format'](_0x3743('0x3a'),_0x534c72['uniqueid']),_0x22382d);}});ami['on'](_0x3743('0x3b'),function(_0x148b67){try{utils[_0x3743('0x1e')](util['format'](_0x3743('0x3c'),_0x148b67[_0x3743('0x24')]),_0x148b67);queues[_0x3743('0x3b')](_0x148b67);agents[_0x3743('0x3b')](_0x148b67);transfers[_0x3743('0x3b')](_0x148b67);recordings['blindtransfer'](_0x148b67);}catch(_0x42b73e){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x3c'),_0x148b67[_0x3743('0x24')]),_0x42b73e);}});ami['on'](_0x3743('0x3d'),function(_0xf5d44f){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x3e'),_0xf5d44f['origtransfereruniqueid']),_0xf5d44f);queues[_0x3743('0x3d')](_0xf5d44f);transfers[_0x3743('0x3d')](_0xf5d44f);agents['attendedtransfer'](_0xf5d44f);calls['attendedtransfer'](_0xf5d44f);}catch(_0x4952ad){utils[_0x3743('0x1a')](util['format']('[%s][index][attendedtransfer]',_0xf5d44f['origtransfereruniqueid']),_0x4952ad);}});ami['on']('varset',function(_0x58a575){try{utils[_0x3743('0x1e')](util[_0x3743('0x1f')](_0x3743('0x3f'),_0x58a575['uniqueid']),_0x58a575);queues[_0x3743('0x40')](_0x58a575);recordings['varset'](_0x58a575);calls['varset'](_0x58a575);dials[_0x3743('0x40')](_0x58a575);}catch(_0xb8175b){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x3f'),_0x58a575['uniqueid']),_0xb8175b);}});ami['on']('newexten',function(_0x1783d3){try{utils[_0x3743('0x1e')](util['format'](_0x3743('0x41'),_0x1783d3[_0x3743('0x24')]),_0x1783d3);calls[_0x3743('0x42')](_0x1783d3);recordings[_0x3743('0x42')](_0x1783d3);dials[_0x3743('0x42')](_0x1783d3);}catch(_0x410892){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x41'),_0x1783d3['uniqueid']),_0x410892);}});ami['on'](_0x3743('0x43'),function(_0x1bc55e){try{utils['debug'](util[_0x3743('0x1f')](_0x3743('0x44'),_0x1bc55e[_0x3743('0x24')]),_0x1bc55e);calls[_0x3743('0x43')](_0x1bc55e);recordings[_0x3743('0x43')](_0x1bc55e);}catch(_0x218360){utils['error'](util[_0x3743('0x1f')](_0x3743('0x44'),_0x1bc55e['uniqueid']),_0x218360);}});ami['on'](_0x3743('0x45'),function(_0x3ff5b0){try{utils[_0x3743('0x1e')](util['format'](_0x3743('0x46'),_0x3ff5b0['uniqueid']),_0x3ff5b0);dials[_0x3743('0x45')](_0x3ff5b0);}catch(_0x41aae7){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x47'),_0x3ff5b0[_0x3743('0x24')]),_0x41aae7);}});ami['on']('dialend',function(_0x2e5702){try{utils['debug'](util[_0x3743('0x1f')](_0x3743('0x48'),_0x2e5702[_0x3743('0x24')]),_0x2e5702);dials['dialend'](_0x2e5702);}catch(_0x56d7f4){utils[_0x3743('0x1a')](util[_0x3743('0x1f')](_0x3743('0x48'),_0x2e5702[_0x3743('0x24')]),_0x56d7f4);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index fb4d60b..5d3be69 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 _0x84e6=['channel','membername','then','name','internal','request','split','CreateMemberReport','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent','NOT_INUSE','isNil','exitAt','now','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','data2','type','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','info','uniqueid','interface'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x84e6,0x8f));var _0x684e=function(_0x28a48d,_0x201dbf){_0x28a48d=_0x28a48d-0x0;var _0x2a0d4d=_0x84e6[_0x28a48d];return _0x2a0d4d;};'use strict';var _=require(_0x684e('0x0'));var util=require(_0x684e('0x1'));var utils=require(_0x684e('0x2'));var members={};var exclude=[_0x684e('0x3'),'Queue:'];function writeDB(_0x5c0eb3){utils[_0x684e('0x4')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5c0eb3[_0x684e('0x5')],_0x5c0eb3[_0x684e('0x6')],_0x5c0eb3[_0x684e('0x7')],_0x5c0eb3['data2'],_0x5c0eb3[_0x684e('0x8')],_0x5c0eb3['type']));if(_0x5c0eb3[_0x684e('0x6')]){utils['getUserByInterface'](_0x5c0eb3['interface'])[_0x684e('0x9')](function(_0xd35552){if(_0xd35552){_0x5c0eb3[_0x684e('0x8')]=_0xd35552[_0x684e('0xa')];_0x5c0eb3[_0x684e('0xb')]=_0xd35552[_0x684e('0xb')];utils[_0x684e('0xc')]('CreateMemberReport',_0x5c0eb3);}else{utils['getUserByName'](_0x5c0eb3[_0x684e('0x6')][_0x684e('0xd')]('/')[0x1])['then'](function(_0x102836){if(_0x102836){_0x5c0eb3[_0x684e('0x8')]=_0x102836['name'];_0x5c0eb3[_0x684e('0xb')]=_0x102836['internal'];utils[_0x684e('0xc')](_0x684e('0xe'),_0x5c0eb3);}});}})[_0x684e('0xf')](function(_0x175ecc){utils[_0x684e('0x10')](util[_0x684e('0x11')](_0x684e('0x12'),_0x5c0eb3[_0x684e('0x5')]),_0x175ecc);});}delete members[_0x5c0eb3[_0x684e('0x6')]];}function startsWith(_0x25f095,_0x255926){return _[_0x684e('0x13')](_0x25f095,function(_0x2a8e90){return _[_0x684e('0x14')](_0x255926,_0x2a8e90);});}exports[_0x684e('0x15')]=function(_0x8fa67b){try{utils[_0x684e('0x16')](util[_0x684e('0x11')]('[%s][members][devicestatechange]',members[_0x8fa67b['device']]?members[_0x8fa67b[_0x684e('0x17')]][_0x684e('0x5')]:_0x8fa67b['device']),_0x8fa67b);utils[_0x684e('0x4')](util[_0x684e('0x11')](_0x684e('0x18'),members[_0x8fa67b[_0x684e('0x17')]]?members[_0x8fa67b['device']][_0x684e('0x5')]:_0x8fa67b['device'],_0x8fa67b[_0x684e('0x19')],_0x8fa67b[_0x684e('0x17')]));switch(_0x8fa67b[_0x684e('0x19')]){case _0x684e('0x1a'):case _0x684e('0x1b'):if(!startsWith(exclude,_0x8fa67b['device'])){members[_0x8fa67b[_0x684e('0x17')]]={'channel':_0x684e('0x1c'),'interface':_0x8fa67b['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0x684e('0x1d')};}break;case _0x684e('0x1e'):if(!_[_0x684e('0x1f')](members[_0x8fa67b[_0x684e('0x17')]])){members[_0x8fa67b['device']][_0x684e('0x20')]=utils[_0x684e('0x21')]();members[_0x8fa67b[_0x684e('0x17')]]['duration']=utils[_0x684e('0x22')](members[_0x8fa67b['device']][_0x684e('0x20')],members[_0x8fa67b[_0x684e('0x17')]][_0x684e('0x23')]);if(members[_0x8fa67b[_0x684e('0x17')]][_0x684e('0x5')]){writeDB(members[_0x8fa67b[_0x684e('0x17')]]);}}break;default:break;}}catch(_0x50ee80){utils[_0x684e('0x10')](util['format'](_0x684e('0x24'),members[_0x8fa67b[_0x684e('0x17')]]?members[_0x8fa67b[_0x684e('0x17')]][_0x684e('0x5')]:_0x8fa67b[_0x684e('0x17')]),_0x50ee80);}};exports[_0x684e('0x25')]=function(_0x2406fd){try{if(!_[_0x684e('0x1f')](members[_0x2406fd['interface']])){utils[_0x684e('0x16')](util[_0x684e('0x11')](_0x684e('0x26'),_0x2406fd[_0x684e('0x5')]),_0x2406fd);utils[_0x684e('0x4')](util[_0x684e('0x11')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2406fd['uniqueid'],_0x2406fd['interface'],_0x2406fd[_0x684e('0x27')]));members[_0x2406fd['interface']]=_[_0x684e('0x28')](members[_0x2406fd[_0x684e('0x6')]],{'data4':_0x2406fd[_0x684e('0x27')],'uniqueid':_0x2406fd['uniqueid']});}}catch(_0x486be9){utils[_0x684e('0x10')](util['format'](_0x684e('0x26'),_0x2406fd['uniqueid']),_0x486be9);}};exports[_0x684e('0x29')]=function(_0x285c0a){try{utils[_0x684e('0x16')](util[_0x684e('0x11')]('[%s][members][cdr]',_0x285c0a[_0x684e('0x5')]),_0x285c0a);if(_0x285c0a[_0x684e('0x7')]){var _0x228fb0=_0x285c0a[_0x684e('0x7')][_0x684e('0xd')]('-')[0x0];if(!_['isNil'](members[_0x228fb0])){members[_0x228fb0]=_[_0x684e('0x28')](members[_0x228fb0],{'data1':members[_0x228fb0]['data1']||_0x285c0a['type'],'data2':members[_0x228fb0]['data2']||_0x285c0a[_0x684e('0x2a')],'data3':members[_0x228fb0][_0x684e('0x2b')]||_0x285c0a[_0x684e('0x2c')],'uniqueid':members[_0x228fb0][_0x684e('0x5')]||_0x285c0a[_0x684e('0x5')]});utils[_0x684e('0x4')](util[_0x684e('0x11')](_0x684e('0x2d'),_0x285c0a[_0x684e('0x5')],members[_0x228fb0][_0x684e('0x2e')],members[_0x228fb0][_0x684e('0x2f')],members[_0x228fb0][_0x684e('0x2b')]));if(members[_0x228fb0]['exitAt']){writeDB(members[_0x228fb0]);}}}if(_0x285c0a['destinationchannel']){var _0x3e8819=_0x285c0a['destinationchannel'][_0x684e('0xd')]('-')[0x0];if(!_[_0x684e('0x1f')](members[_0x3e8819])){members[_0x3e8819]=_[_0x684e('0x28')](members[_0x3e8819],{'data1':members[_0x3e8819][_0x684e('0x2e')]||_0x285c0a[_0x684e('0x30')],'data2':members[_0x3e8819][_0x684e('0x2f')]||_0x285c0a['source'],'data3':members[_0x3e8819]['data3']||_0x285c0a[_0x684e('0x2c')],'uniqueid':members[_0x3e8819][_0x684e('0x5')]||_0x285c0a[_0x684e('0x5')]});utils[_0x684e('0x4')](util[_0x684e('0x11')](_0x684e('0x2d'),_0x285c0a[_0x684e('0x5')],members[_0x3e8819][_0x684e('0x2e')],members[_0x3e8819][_0x684e('0x2f')],members[_0x3e8819][_0x684e('0x2b')]));if(members[_0x3e8819]['exitAt']){writeDB(members[_0x3e8819]);}}}}catch(_0x3e3d4e){utils['error'](util[_0x684e('0x11')](_0x684e('0x31'),_0x285c0a[_0x684e('0x5')]),_0x3e3d4e);}}; \ No newline at end of file +var _0xf875=['source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','split','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','info','format','interface','channel','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','now','agent','NOT_INUSE','exitAt','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','type'];(function(_0x13e779,_0x4f3ea1){var _0x2751db=function(_0x399a94){while(--_0x399a94){_0x13e779['push'](_0x13e779['shift']());}};_0x2751db(++_0x4f3ea1);}(_0xf875,0x138));var _0x5f87=function(_0x1b2540,_0x197222){_0x1b2540=_0x1b2540-0x0;var _0x35dc3f=_0xf875[_0x1b2540];return _0x35dc3f;};'use strict';var _=require(_0x5f87('0x0'));var util=require('util');var utils=require(_0x5f87('0x1'));var members={};var exclude=[_0x5f87('0x2'),_0x5f87('0x3')];function writeDB(_0x515edb){utils[_0x5f87('0x4')](util[_0x5f87('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x515edb['uniqueid'],_0x515edb[_0x5f87('0x6')],_0x515edb[_0x5f87('0x7')],_0x515edb[_0x5f87('0x8')],_0x515edb[_0x5f87('0x9')],_0x515edb['type']));if(_0x515edb['interface']){utils[_0x5f87('0xa')](_0x515edb['interface'])['then'](function(_0xb4cafb){if(_0xb4cafb){_0x515edb[_0x5f87('0x9')]=_0xb4cafb[_0x5f87('0xb')];_0x515edb[_0x5f87('0xc')]=_0xb4cafb['internal'];utils[_0x5f87('0xd')](_0x5f87('0xe'),_0x515edb);}else{utils[_0x5f87('0xf')](_0x515edb[_0x5f87('0x6')]['split']('/')[0x1])['then'](function(_0x112b6e){if(_0x112b6e){_0x515edb[_0x5f87('0x9')]=_0x112b6e['name'];_0x515edb[_0x5f87('0xc')]=_0x112b6e[_0x5f87('0xc')];utils[_0x5f87('0xd')](_0x5f87('0xe'),_0x515edb);}});}})[_0x5f87('0x10')](function(_0x35f80f){utils[_0x5f87('0x11')](util[_0x5f87('0x5')](_0x5f87('0x12'),_0x515edb[_0x5f87('0x13')]),_0x35f80f);});}delete members[_0x515edb[_0x5f87('0x6')]];}function startsWith(_0x4e7ad1,_0x139178){return _[_0x5f87('0x14')](_0x4e7ad1,function(_0x2048ea){return _[_0x5f87('0x15')](_0x139178,_0x2048ea);});}exports['devicestatechange']=function(_0x4acfe6){try{utils[_0x5f87('0x16')](util[_0x5f87('0x5')](_0x5f87('0x17'),members[_0x4acfe6['device']]?members[_0x4acfe6['device']][_0x5f87('0x13')]:_0x4acfe6[_0x5f87('0x18')]),_0x4acfe6);utils[_0x5f87('0x4')](util[_0x5f87('0x5')](_0x5f87('0x19'),members[_0x4acfe6[_0x5f87('0x18')]]?members[_0x4acfe6[_0x5f87('0x18')]][_0x5f87('0x13')]:_0x4acfe6[_0x5f87('0x18')],_0x4acfe6[_0x5f87('0x1a')],_0x4acfe6['device']));switch(_0x4acfe6[_0x5f87('0x1a')]){case _0x5f87('0x1b'):case _0x5f87('0x1c'):if(!startsWith(exclude,_0x4acfe6['device'])){members[_0x4acfe6['device']]={'channel':_0x5f87('0x1d'),'interface':_0x4acfe6[_0x5f87('0x18')],'type':'TALKING','enterAt':utils[_0x5f87('0x1e')](),'role':_0x5f87('0x1f')};}break;case _0x5f87('0x20'):if(!_['isNil'](members[_0x4acfe6[_0x5f87('0x18')]])){members[_0x4acfe6['device']][_0x5f87('0x21')]=utils['now']();members[_0x4acfe6[_0x5f87('0x18')]]['duration']=utils[_0x5f87('0x22')](members[_0x4acfe6[_0x5f87('0x18')]][_0x5f87('0x21')],members[_0x4acfe6['device']][_0x5f87('0x23')]);if(members[_0x4acfe6['device']]['uniqueid']){writeDB(members[_0x4acfe6[_0x5f87('0x18')]]);}}break;default:break;}}catch(_0x3a1725){utils[_0x5f87('0x11')](util['format'](_0x5f87('0x17'),members[_0x4acfe6[_0x5f87('0x18')]]?members[_0x4acfe6[_0x5f87('0x18')]][_0x5f87('0x13')]:_0x4acfe6[_0x5f87('0x18')]),_0x3a1725);}};exports[_0x5f87('0x24')]=function(_0x10fd3c){try{if(!_[_0x5f87('0x25')](members[_0x10fd3c[_0x5f87('0x6')]])){utils['debug'](util[_0x5f87('0x5')](_0x5f87('0x26'),_0x10fd3c['uniqueid']),_0x10fd3c);utils[_0x5f87('0x4')](util['format'](_0x5f87('0x27'),_0x10fd3c[_0x5f87('0x13')],_0x10fd3c[_0x5f87('0x6')],_0x10fd3c[_0x5f87('0x28')]));members[_0x10fd3c[_0x5f87('0x6')]]=_[_0x5f87('0x29')](members[_0x10fd3c['interface']],{'data4':_0x10fd3c[_0x5f87('0x28')],'uniqueid':_0x10fd3c[_0x5f87('0x13')]});}}catch(_0x5b8294){utils['error'](util[_0x5f87('0x5')]('[%s][members][agentcomplete]',_0x10fd3c[_0x5f87('0x13')]),_0x5b8294);}};exports[_0x5f87('0x2a')]=function(_0x47d337){try{utils[_0x5f87('0x16')](util['format']('[%s][members][cdr]',_0x47d337[_0x5f87('0x13')]),_0x47d337);if(_0x47d337[_0x5f87('0x7')]){var _0x3356d5=_0x47d337[_0x5f87('0x7')]['split']('-')[0x0];if(!_[_0x5f87('0x25')](members[_0x3356d5])){members[_0x3356d5]=_[_0x5f87('0x29')](members[_0x3356d5],{'data1':members[_0x3356d5][_0x5f87('0x2b')]||_0x47d337[_0x5f87('0x2c')],'data2':members[_0x3356d5][_0x5f87('0x8')]||_0x47d337[_0x5f87('0x2d')],'data3':members[_0x3356d5]['data3']||_0x47d337['destination'],'uniqueid':members[_0x3356d5][_0x5f87('0x13')]||_0x47d337['uniqueid']});utils[_0x5f87('0x4')](util[_0x5f87('0x5')](_0x5f87('0x2e'),_0x47d337[_0x5f87('0x13')],members[_0x3356d5][_0x5f87('0x2b')],members[_0x3356d5][_0x5f87('0x8')],members[_0x3356d5][_0x5f87('0x2f')]));if(members[_0x3356d5]['exitAt']){writeDB(members[_0x3356d5]);}}}if(_0x47d337[_0x5f87('0x30')]){var _0x2563b7=_0x47d337[_0x5f87('0x30')][_0x5f87('0x31')]('-')[0x0];if(!_[_0x5f87('0x25')](members[_0x2563b7])){members[_0x2563b7]=_['assign'](members[_0x2563b7],{'data1':members[_0x2563b7][_0x5f87('0x2b')]||_0x47d337['type'],'data2':members[_0x2563b7][_0x5f87('0x8')]||_0x47d337['source'],'data3':members[_0x2563b7]['data3']||_0x47d337['destination'],'uniqueid':members[_0x2563b7][_0x5f87('0x13')]||_0x47d337[_0x5f87('0x13')]});utils[_0x5f87('0x4')](util[_0x5f87('0x5')](_0x5f87('0x2e'),_0x47d337['uniqueid'],members[_0x2563b7][_0x5f87('0x2b')],members[_0x2563b7][_0x5f87('0x8')],members[_0x2563b7]['data3']));if(members[_0x2563b7][_0x5f87('0x21')]){writeDB(members[_0x2563b7]);}}}}catch(_0x36ff8d){utils[_0x5f87('0x11')](util[_0x5f87('0x5')](_0x5f87('0x32'),_0x47d337['uniqueid']),_0x36ff8d);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2e38065..8a70497 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 _0xaa30=['assigned','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','origtransfererlinkedid','transfereelinkedid','clone','calleridname','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','diffTime','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','toUpperCase','CONTINUE','queuecallerexitAt','value','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','queuecallerjoinAt','count','connectedlinename','error','agentconnect','[%s][queues][agentconnect]','destaccountcode'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0xaa30,0x96));var _0x0aa3=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xaa30[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0aa3('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0xb6030f){utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x3'),_0xb6030f['uniqueid'],_0xb6030f[_0x0aa3('0x4')],_0xb6030f[_0x0aa3('0x5')],_0xb6030f[_0x0aa3('0x6')],_0xb6030f[_0x0aa3('0x7')],_0xb6030f[_0x0aa3('0x8')],_0xb6030f[_0x0aa3('0x9')]));if(_0xb6030f[_0x0aa3('0x5')]){utils[_0x0aa3('0xa')](_0xb6030f[_0x0aa3('0x5')])[_0x0aa3('0xb')](function(_0x5c506d){if(_0x5c506d){_0xb6030f['type']=_0x5c506d[_0x0aa3('0xc')];}utils[_0x0aa3('0xd')](_0x0aa3('0xe'),_0xb6030f);});}else{utils[_0x0aa3('0xd')]('CreateVoiceQueueReport',_0xb6030f);}if(_0xb6030f['transfereduniqueid']){delete queues[_0xb6030f['transfereduniqueid']];}else{delete queues[_0xb6030f[_0x0aa3('0xf')]];}}exports[_0x0aa3('0x10')]=function(_0xe0464e){try{utils[_0x0aa3('0x11')](util['format'](_0x0aa3('0x12'),_0xe0464e['uniqueid']),_0xe0464e);utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x13'),_0xe0464e[_0x0aa3('0xf')],_0xe0464e[_0x0aa3('0x5')],_0xe0464e['position']));queues[_0xe0464e[_0x0aa3('0xf')]]=_[_0x0aa3('0x14')](_0xe0464e,{'originalposition':_0xe0464e[_0x0aa3('0x15')],'queuecallerjoinAt':utils[_0x0aa3('0x16')](),'mohtime':0x0});}catch(_0x155210){utils['error'](util[_0x0aa3('0x2')](_0x0aa3('0x12'),_0xe0464e[_0x0aa3('0xf')]),_0x155210);}};exports[_0x0aa3('0x17')]=function(_0x4153cb){try{if(!_['isNil'](queues[_0x4153cb['uniqueid']])){utils[_0x0aa3('0x11')](util[_0x0aa3('0x2')](_0x0aa3('0x18'),_0x4153cb[_0x0aa3('0xf')]),_0x4153cb);if(queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x19')]){if(!queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1a')]&&!queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1b')]){queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1c')]=!![];queues[_0x4153cb['uniqueid']][_0x0aa3('0x1d')]=utils[_0x0aa3('0x16')]();queues[_0x4153cb['uniqueid']][_0x0aa3('0x9')]='COMPLETEDBYAGENT';}utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x1e'),_0x4153cb[_0x0aa3('0xf')],queues[_0x4153cb[_0x0aa3('0xf')]]['name'],queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x9')]));writeDB(queues[_0x4153cb[_0x0aa3('0xf')]]);}else if(queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1f')]){utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x20'),_0x4153cb[_0x0aa3('0xf')],queues[_0x4153cb['uniqueid']][_0x0aa3('0x21')],queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1f')]));queues[queues[_0x4153cb[_0x0aa3('0xf')]][_0x0aa3('0x1f')]]=queues[_0x4153cb['uniqueid']];queues[queues[_0x4153cb['uniqueid']][_0x0aa3('0x1f')]][_0x0aa3('0x22')]=0x2;delete queues[_0x4153cb['uniqueid']];}}}catch(_0x55dda5){utils['error'](util['format']('[%s][queues][hangup]',_0x4153cb[_0x0aa3('0xf')]),_0x55dda5);}};exports[_0x0aa3('0x23')]=function(_0x15e4cd){try{utils[_0x0aa3('0x11')](util[_0x0aa3('0x2')](_0x0aa3('0x24'),_0x15e4cd[_0x0aa3('0xf')]),_0x15e4cd);if(!_[_0x0aa3('0x25')](_0x15e4cd[_0x0aa3('0x26')][_0x0aa3('0x27')])&&_0x15e4cd['value'][_0x0aa3('0x28')]()!==_0x0aa3('0x29')){if(!_[_0x0aa3('0x25')](queues[_0x15e4cd[_0x0aa3('0xf')]])){queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x1a')]=![];queues[_0x15e4cd['uniqueid']]['queuecallerabandonAt']=null;queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x1b')]=!![];queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x2a')]=utils[_0x0aa3('0x16')]();queues[_0x15e4cd['uniqueid']][_0x0aa3('0x9')]=_0x15e4cd[_0x0aa3('0x2b')][_0x0aa3('0x28')]();utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x15e4cd[_0x0aa3('0xf')],queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x21')],_0x15e4cd[_0x0aa3('0x2b')],queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x9')]));writeDB(queues[_0x15e4cd[_0x0aa3('0xf')]]);}}else if(!_['isNil'](_0x15e4cd[_0x0aa3('0x26')][_0x0aa3('0x2c')])){if(!_[_0x0aa3('0x25')](queues[_0x15e4cd[_0x0aa3('0xf')]])&&!queues[_0x15e4cd['uniqueid']][_0x0aa3('0x1a')]){queues[_0x15e4cd[_0x0aa3('0xf')]]['queuecallerabandon']=![];queues[_0x15e4cd[_0x0aa3('0xf')]]['queuecallerabandonAt']=null;queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x1b')]=!![];queues[_0x15e4cd[_0x0aa3('0xf')]]['queuecallerexitAt']=utils[_0x0aa3('0x16')]();queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x9')]='EXITWITHKEY';utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x2d'),_0x15e4cd[_0x0aa3('0xf')],queues[_0x15e4cd[_0x0aa3('0xf')]][_0x0aa3('0x21')],_0x15e4cd['value'],queues[_0x15e4cd[_0x0aa3('0xf')]]['queuecallerexitreason']));}}}catch(_0x3f2e55){utils['error'](util[_0x0aa3('0x2')]('[%s][queues][varset]',_0x15e4cd[_0x0aa3('0xf')]),_0x3f2e55);}};exports[_0x0aa3('0x1a')]=function(_0x3dd35a){try{if(!_['isNil'](queues[_0x3dd35a['uniqueid']])){utils[_0x0aa3('0x11')](util[_0x0aa3('0x2')](_0x0aa3('0x2e'),_0x3dd35a['uniqueid']),_0x3dd35a);queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x1b')]=![];queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x2a')]=null;queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x1a')]=!![];queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x2f')]=utils['now']();queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x9')]=_0x0aa3('0x30');utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x31'),_0x3dd35a['uniqueid'],queues[_0x3dd35a[_0x0aa3('0xf')]][_0x0aa3('0x21')],queues[_0x3dd35a[_0x0aa3('0xf')]]['queuecallerexitreason']));}}catch(_0xf551ef){utils['error'](util[_0x0aa3('0x2')](_0x0aa3('0x2e'),_0x3dd35a['uniqueid']),_0xf551ef);}};exports[_0x0aa3('0x32')]=function(_0x1f8edf){try{if(!_[_0x0aa3('0x25')](queues[_0x1f8edf[_0x0aa3('0xf')]])){utils[_0x0aa3('0x11')](util['format'](_0x0aa3('0x33'),_0x1f8edf['uniqueid']),_0x1f8edf);utils['info'](util[_0x0aa3('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1f8edf[_0x0aa3('0xf')],queues[_0x1f8edf[_0x0aa3('0xf')]][_0x0aa3('0x21')],_0x1f8edf[_0x0aa3('0x34')],_0x1f8edf['connectedlinename']));queues[_0x1f8edf[_0x0aa3('0xf')]][_0x0aa3('0x32')]=!![];queues[_0x1f8edf['uniqueid']][_0x0aa3('0x19')]=utils[_0x0aa3('0x16')]();queues[_0x1f8edf[_0x0aa3('0xf')]]['holdtime']=utils['diffTime'](queues[_0x1f8edf['uniqueid']][_0x0aa3('0x19')],queues[_0x1f8edf[_0x0aa3('0xf')]][_0x0aa3('0x35')]);queues[_0x1f8edf['uniqueid']][_0x0aa3('0x15')]=_0x1f8edf[_0x0aa3('0x15')];queues[_0x1f8edf[_0x0aa3('0xf')]]['count']=_0x1f8edf[_0x0aa3('0x36')];queues[_0x1f8edf[_0x0aa3('0xf')]][_0x0aa3('0x34')]=_0x1f8edf[_0x0aa3('0x34')];queues[_0x1f8edf[_0x0aa3('0xf')]][_0x0aa3('0x37')]=_0x1f8edf[_0x0aa3('0x37')];}}catch(_0x8830ab){utils[_0x0aa3('0x38')](util[_0x0aa3('0x2')](_0x0aa3('0x33'),_0x1f8edf['uniqueid']),_0x8830ab);}};exports[_0x0aa3('0x39')]=function(_0x31064e){try{if(!_[_0x0aa3('0x25')](queues[_0x31064e[_0x0aa3('0xf')]])){utils['debug'](util[_0x0aa3('0x2')](_0x0aa3('0x3a'),_0x31064e[_0x0aa3('0xf')]),_0x31064e);utils['info'](util[_0x0aa3('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x31064e[_0x0aa3('0xf')],queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x21')],_0x31064e['membername'],_0x31064e[_0x0aa3('0x3b')]));queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x1a')]=![];queues[_0x31064e['uniqueid']]['queuecallerabandon']=![];queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x2f')]=null;queues[_0x31064e['uniqueid']][_0x0aa3('0x1b')]=![];queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x9')]=null;queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x2a')]=null;queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x3c')]=!![];queues[_0x31064e[_0x0aa3('0xf')]][_0x0aa3('0x8')]=_0x31064e[_0x0aa3('0x3b')];queues[_0x31064e[_0x0aa3('0xf')]]['lastAssignedTo']=_0x31064e[_0x0aa3('0x3d')];}}catch(_0x33742d){utils[_0x0aa3('0x38')](util[_0x0aa3('0x2')]('[%s][queues][agentconnect]',_0x31064e[_0x0aa3('0xf')]),_0x33742d);}};exports[_0x0aa3('0x3e')]=function(_0x3da0af){try{if(!_[_0x0aa3('0x25')](queues[_0x3da0af[_0x0aa3('0xf')]])){if(queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x19')]){utils[_0x0aa3('0x11')](util[_0x0aa3('0x2')](_0x0aa3('0x3f'),_0x3da0af[_0x0aa3('0xf')]),_0x3da0af);queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x1a')]=![];queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x1a')]=![];queues[_0x3da0af['uniqueid']][_0x0aa3('0x2f')]=null;queues[_0x3da0af['uniqueid']][_0x0aa3('0x1b')]=![];queues[_0x3da0af['uniqueid']]['queuecallerexitAt']=null;queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x3c')]=!![];queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x6')]=_0x3da0af[_0x0aa3('0x3d')];queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x1c')]=!![];queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x1d')]=utils[_0x0aa3('0x16')]();if(_0x3da0af[_0x0aa3('0x40')]==_0x0aa3('0x41')){if(!queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x41')]){queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x9')]=_0x0aa3('0x42');}}else{queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x9')]=_0x0aa3('0x43')+_0x3da0af[_0x0aa3('0x40')][_0x0aa3('0x28')]();}utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x44'),_0x3da0af['uniqueid'],queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x21')],_0x3da0af[_0x0aa3('0x3d')],queues[_0x3da0af[_0x0aa3('0xf')]][_0x0aa3('0x9')]));writeDB(queues[_0x3da0af[_0x0aa3('0xf')]]);}}}catch(_0xf31884){utils[_0x0aa3('0x38')](util[_0x0aa3('0x2')](_0x0aa3('0x3f'),_0x3da0af[_0x0aa3('0xf')]),_0xf31884);}};exports['blindtransfer']=function(_0x54ba6b){try{if(!_['isNil'](queues[_0x54ba6b[_0x0aa3('0x45')]])){utils[_0x0aa3('0x11')](util['format']('[%s][queues][blindtransfer]',_0x54ba6b[_0x0aa3('0xf')]),_0x54ba6b);queues[_0x54ba6b[_0x0aa3('0x45')]][_0x0aa3('0x41')]=!![];queues[_0x54ba6b['transfereeuniqueid']]['transfertype']=_0x0aa3('0x46');queues[_0x54ba6b['transfereeuniqueid']][_0x0aa3('0x47')]=_0x54ba6b[_0x0aa3('0x48')];queues[_0x54ba6b['transfereeuniqueid']][_0x0aa3('0x49')]=_0x54ba6b['transfereeuniqueid'];queues[_0x54ba6b['transfereeuniqueid']][_0x0aa3('0x9')]=_0x0aa3('0x4a');utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x4b'),_0x54ba6b[_0x0aa3('0xf')],queues[_0x54ba6b['transfereeuniqueid']][_0x0aa3('0x21')],_0x54ba6b['transfereeuniqueid'],_0x54ba6b[_0x0aa3('0x48')]));}}catch(_0x585c1e){utils['error'](util[_0x0aa3('0x2')](_0x0aa3('0x4c'),_0x54ba6b[_0x0aa3('0xf')]),_0x585c1e);}};exports[_0x0aa3('0x4d')]=function(_0x126c5b){try{utils['debug'](util[_0x0aa3('0x2')]('[%s][queues][attendedtransfer]',_0x126c5b[_0x0aa3('0x4e')]),_0x126c5b);if(_0x126c5b[_0x0aa3('0x4e')]==_0x126c5b['origtransfererlinkedid']){if(!_[_0x0aa3('0x25')](queues[_0x126c5b[_0x0aa3('0x4f')]])){utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x50'),_0x126c5b[_0x0aa3('0x4e')],queues[_0x126c5b['secondtransfererlinkedid']][_0x0aa3('0x21')],_0x126c5b[_0x0aa3('0x51')]));queues[_0x126c5b['secondtransfererlinkedid']][_0x0aa3('0x41')]=!![];queues[_0x126c5b['secondtransfererlinkedid']][_0x0aa3('0x52')]=_0x0aa3('0x53');queues[_0x126c5b[_0x0aa3('0x4f')]][_0x0aa3('0x47')]=_0x126c5b[_0x0aa3('0x51')];queues[_0x126c5b[_0x0aa3('0x4f')]]['transferuniqueid']=_0x126c5b[_0x0aa3('0x4e')];queues[_0x126c5b[_0x0aa3('0x4f')]][_0x0aa3('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x0aa3('0x25')](queues[_0x126c5b[_0x0aa3('0x54')]])){if(_0x126c5b[_0x0aa3('0x55')]&&queues[_0x126c5b[_0x0aa3('0x55')]]){queues[_0x126c5b[_0x0aa3('0x55')]][_0x0aa3('0x22')]=0x1;queues[_0x126c5b['transfereeuniqueid']]=_[_0x0aa3('0x56')](queues[_0x126c5b[_0x0aa3('0x55')]]);queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x1f')]=_0x126c5b['transfertargetuniqueid'];queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x22')]=0x2;queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x7')]=queues[_0x126c5b[_0x0aa3('0x4f')]][_0x0aa3('0x7')];queues[_0x126c5b[_0x0aa3('0x45')]]['calleridname']=queues[_0x126c5b['secondtransfererlinkedid']][_0x0aa3('0x57')];queues[_0x126c5b['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x0aa3('0x16')]();queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x19')]=utils[_0x0aa3('0x16')]();queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x58')]=0x0;queues[_0x126c5b[_0x0aa3('0x45')]]['mohtime']=0x0;utils[_0x0aa3('0x1')](util['format'](_0x0aa3('0x59'),_0x126c5b[_0x0aa3('0x4e')],queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x21')],queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x7')],queues[_0x126c5b[_0x0aa3('0x45')]][_0x0aa3('0x57')]));}else{utils[_0x0aa3('0x1')](util['format'](_0x0aa3('0x5a'),_0x126c5b[_0x0aa3('0x4e')],queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x21')],_0x126c5b[_0x0aa3('0x4f')]));queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x1f')]=_0x126c5b[_0x0aa3('0x4f')];}}}else if(_0x126c5b['secondtransfereruniqueid']==_0x126c5b[_0x0aa3('0x4f')]){if(!_['isNil'](queues[_0x126c5b[_0x0aa3('0x54')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x126c5b[_0x0aa3('0x4e')],queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x21')],_0x126c5b[_0x0aa3('0x5b')],_0x126c5b[_0x0aa3('0x5c')]));queues[_0x126c5b['origtransfererlinkedid']][_0x0aa3('0x41')]=!![];queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x52')]='ATTENDED';queues[_0x126c5b[_0x0aa3('0x54')]]['transferexten']=_0x126c5b[_0x0aa3('0x5c')];queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x49')]=_0x126c5b['secondtransfereruniqueid'];queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x9')]=_0x0aa3('0x5d');}if(!_[_0x0aa3('0x25')](queues[_0x126c5b[_0x0aa3('0x4f')]])){if(_0x126c5b[_0x0aa3('0x5e')]&&queues[_0x126c5b[_0x0aa3('0x5e')]]){queues[_0x126c5b[_0x0aa3('0x5e')]][_0x0aa3('0x22')]=0x1;queues[_0x126c5b[_0x0aa3('0x5f')]]=_[_0x0aa3('0x56')](queues[_0x126c5b[_0x0aa3('0x5e')]]);queues[_0x126c5b[_0x0aa3('0x5f')]][_0x0aa3('0x1f')]=_0x126c5b[_0x0aa3('0x5f')];queues[_0x126c5b['transfertargetuniqueid']][_0x0aa3('0x22')]=0x2;queues[_0x126c5b['transfertargetuniqueid']][_0x0aa3('0x7')]=queues[_0x126c5b[_0x0aa3('0x54')]]['calleridnum'];queues[_0x126c5b['transfertargetuniqueid']][_0x0aa3('0x57')]=queues[_0x126c5b[_0x0aa3('0x54')]][_0x0aa3('0x57')];queues[_0x126c5b[_0x0aa3('0x5f')]][_0x0aa3('0x35')]=utils[_0x0aa3('0x16')]();queues[_0x126c5b['transfertargetuniqueid']][_0x0aa3('0x19')]=utils[_0x0aa3('0x16')]();queues[_0x126c5b[_0x0aa3('0x5f')]][_0x0aa3('0x58')]=0x0;queues[_0x126c5b[_0x0aa3('0x5f')]]['mohtime']=0x0;utils[_0x0aa3('0x1')](util['format'](_0x0aa3('0x60'),_0x126c5b['origtransfereruniqueid'],queues[_0x126c5b[_0x0aa3('0x5f')]][_0x0aa3('0x21')],queues[_0x126c5b['transfertargetuniqueid']][_0x0aa3('0x1f')],queues[_0x126c5b[_0x0aa3('0x5f')]]['calleridnum'],queues[_0x126c5b[_0x0aa3('0x5f')]][_0x0aa3('0x57')]));}else{utils['info'](util[_0x0aa3('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x126c5b['origtransfereruniqueid'],queues[_0x126c5b[_0x0aa3('0x4f')]]['name'],_0x126c5b[_0x0aa3('0x54')]));queues[_0x126c5b[_0x0aa3('0x4f')]][_0x0aa3('0x1f')]=_0x126c5b['origtransfererlinkedid'];}}}}catch(_0x3c206c){utils[_0x0aa3('0x38')](util[_0x0aa3('0x2')](_0x0aa3('0x61'),_0x126c5b[_0x0aa3('0x4e')]),_0x3c206c);}};exports['musiconholdstart']=function(_0x43502a){try{if(!_[_0x0aa3('0x25')](queues[_0x43502a[_0x0aa3('0xf')]])){utils[_0x0aa3('0x11')](util[_0x0aa3('0x2')](_0x0aa3('0x62'),_0x43502a[_0x0aa3('0xf')]),_0x43502a);queues[_0x43502a[_0x0aa3('0xf')]][_0x0aa3('0x63')]=utils[_0x0aa3('0x16')]();utils[_0x0aa3('0x1')](util[_0x0aa3('0x2')](_0x0aa3('0x64'),_0x43502a[_0x0aa3('0xf')],queues[_0x43502a['uniqueid']][_0x0aa3('0x21')],queues[_0x43502a[_0x0aa3('0xf')]][_0x0aa3('0x63')]));}}catch(_0x23a553){utils[_0x0aa3('0x38')](util['format'](_0x0aa3('0x62'),_0x43502a[_0x0aa3('0xf')]),_0x23a553);}};exports[_0x0aa3('0x65')]=function(_0x46c3c4){try{if(!_[_0x0aa3('0x25')](queues[_0x46c3c4['uniqueid']])){if(!_[_0x0aa3('0x25')](queues[_0x46c3c4[_0x0aa3('0xf')]][_0x0aa3('0x63')])){utils[_0x0aa3('0x11')](util['format'](_0x0aa3('0x66'),_0x46c3c4[_0x0aa3('0xf')]),_0x46c3c4);queues[_0x46c3c4[_0x0aa3('0xf')]][_0x0aa3('0x67')]+=utils[_0x0aa3('0x68')](utils[_0x0aa3('0x16')](),queues[_0x46c3c4[_0x0aa3('0xf')]][_0x0aa3('0x63')]);utils[_0x0aa3('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x46c3c4['uniqueid'],queues[_0x46c3c4['uniqueid']][_0x0aa3('0x21')],queues[_0x46c3c4[_0x0aa3('0xf')]]['mohtime']));delete queues[_0x46c3c4[_0x0aa3('0xf')]][_0x0aa3('0x63')];}}}catch(_0x8e657){utils[_0x0aa3('0x38')](util['format'](_0x0aa3('0x66'),_0x46c3c4[_0x0aa3('0xf')]),_0x8e657);}}; \ No newline at end of file +var _0x0bc4=['mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','assign','position','now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','error','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','[%s][queues][agentconnect]','agentcomplete','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','calleridnum','calleridname','holdtime'];(function(_0x3d883a,_0x14b667){var _0x2a0299=function(_0x2a3875){while(--_0x2a3875){_0x3d883a['push'](_0x3d883a['shift']());}};_0x2a0299(++_0x14b667);}(_0x0bc4,0x136));var _0x40bc=function(_0x3ea40b,_0x44e4f6){_0x3ea40b=_0x3ea40b-0x0;var _0x49dca9=_0x0bc4[_0x3ea40b];return _0x49dca9;};'use strict';var _=require(_0x40bc('0x0'));var util=require(_0x40bc('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x12150d){utils[_0x40bc('0x2')](util['format'](_0x40bc('0x3'),_0x12150d[_0x40bc('0x4')],_0x12150d['channel'],_0x12150d[_0x40bc('0x5')],_0x12150d['lastAssignedTo'],_0x12150d['calleridnum'],_0x12150d[_0x40bc('0x6')],_0x12150d[_0x40bc('0x7')]));if(_0x12150d[_0x40bc('0x5')]){utils[_0x40bc('0x8')](_0x12150d[_0x40bc('0x5')])['then'](function(_0x1757d7){if(_0x1757d7){_0x12150d['type']=_0x1757d7[_0x40bc('0x9')];}utils[_0x40bc('0xa')](_0x40bc('0xb'),_0x12150d);});}else{utils['request'](_0x40bc('0xb'),_0x12150d);}if(_0x12150d[_0x40bc('0xc')]){delete queues[_0x12150d[_0x40bc('0xc')]];}else{delete queues[_0x12150d[_0x40bc('0x4')]];}}exports[_0x40bc('0xd')]=function(_0x5de479){try{utils[_0x40bc('0xe')](util[_0x40bc('0xf')](_0x40bc('0x10'),_0x5de479['uniqueid']),_0x5de479);utils[_0x40bc('0x2')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x5de479[_0x40bc('0x4')],_0x5de479['queue'],_0x5de479['position']));queues[_0x5de479[_0x40bc('0x4')]]=_[_0x40bc('0x11')](_0x5de479,{'originalposition':_0x5de479[_0x40bc('0x12')],'queuecallerjoinAt':utils[_0x40bc('0x13')](),'mohtime':0x0});}catch(_0x38eb0c){utils['error'](util['format'](_0x40bc('0x10'),_0x5de479[_0x40bc('0x4')]),_0x38eb0c);}};exports[_0x40bc('0x14')]=function(_0x4442b5){try{if(!_[_0x40bc('0x15')](queues[_0x4442b5[_0x40bc('0x4')]])){utils['debug'](util[_0x40bc('0xf')](_0x40bc('0x16'),_0x4442b5[_0x40bc('0x4')]),_0x4442b5);if(queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x17')]){if(!queues[_0x4442b5['uniqueid']]['queuecallerabandon']&&!queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x18')]){queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x19')]=!![];queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x1a')]=utils['now']();queues[_0x4442b5[_0x40bc('0x4')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x40bc('0x2')](util[_0x40bc('0xf')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4442b5[_0x40bc('0x4')],queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x1b')],queues[_0x4442b5[_0x40bc('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x4442b5[_0x40bc('0x4')]]);}else if(queues[_0x4442b5[_0x40bc('0x4')]]['transfereduniqueid']){utils[_0x40bc('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4442b5[_0x40bc('0x4')],queues[_0x4442b5[_0x40bc('0x4')]][_0x40bc('0x1b')],queues[_0x4442b5[_0x40bc('0x4')]]['transfereduniqueid']));queues[queues[_0x4442b5[_0x40bc('0x4')]]['transfereduniqueid']]=queues[_0x4442b5[_0x40bc('0x4')]];queues[queues[_0x4442b5[_0x40bc('0x4')]]['transfereduniqueid']][_0x40bc('0x1c')]=0x2;delete queues[_0x4442b5[_0x40bc('0x4')]];}}}catch(_0x188b23){utils['error'](util[_0x40bc('0xf')](_0x40bc('0x16'),_0x4442b5[_0x40bc('0x4')]),_0x188b23);}};exports[_0x40bc('0x1d')]=function(_0x34951a){try{utils[_0x40bc('0xe')](util['format']('[%s][queues][varset]',_0x34951a[_0x40bc('0x4')]),_0x34951a);if(!_[_0x40bc('0x15')](_0x34951a[_0x40bc('0x1e')][_0x40bc('0x1f')])&&_0x34951a[_0x40bc('0x20')][_0x40bc('0x21')]()!==_0x40bc('0x22')){if(!_[_0x40bc('0x15')](queues[_0x34951a[_0x40bc('0x4')]])){queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x24')]=null;queues[_0x34951a[_0x40bc('0x4')]]['queuecallerexit']=!![];queues[_0x34951a['uniqueid']]['queuecallerexitAt']=utils[_0x40bc('0x13')]();queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x7')]=_0x34951a['value'][_0x40bc('0x21')]();utils[_0x40bc('0x2')](util[_0x40bc('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x34951a['uniqueid'],queues[_0x34951a[_0x40bc('0x4')]]['name'],_0x34951a['value'],queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x7')]));writeDB(queues[_0x34951a[_0x40bc('0x4')]]);}}else if(!_[_0x40bc('0x15')](_0x34951a[_0x40bc('0x1e')]['queueposition'])){if(!_[_0x40bc('0x15')](queues[_0x34951a[_0x40bc('0x4')]])&&!queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x23')]){queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x34951a[_0x40bc('0x4')]]['queuecallerabandonAt']=null;queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x18')]=!![];queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x25')]=utils[_0x40bc('0x13')]();queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x7')]=_0x40bc('0x26');utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x27'),_0x34951a['uniqueid'],queues[_0x34951a[_0x40bc('0x4')]][_0x40bc('0x1b')],_0x34951a[_0x40bc('0x20')],queues[_0x34951a[_0x40bc('0x4')]]['queuecallerexitreason']));}}}catch(_0x598355){utils['error'](util[_0x40bc('0xf')](_0x40bc('0x28'),_0x34951a['uniqueid']),_0x598355);}};exports[_0x40bc('0x23')]=function(_0x1a9225){try{if(!_[_0x40bc('0x15')](queues[_0x1a9225[_0x40bc('0x4')]])){utils[_0x40bc('0xe')](util[_0x40bc('0xf')](_0x40bc('0x29'),_0x1a9225[_0x40bc('0x4')]),_0x1a9225);queues[_0x1a9225[_0x40bc('0x4')]][_0x40bc('0x18')]=![];queues[_0x1a9225[_0x40bc('0x4')]][_0x40bc('0x25')]=null;queues[_0x1a9225['uniqueid']]['queuecallerabandon']=!![];queues[_0x1a9225['uniqueid']][_0x40bc('0x24')]=utils[_0x40bc('0x13')]();queues[_0x1a9225[_0x40bc('0x4')]][_0x40bc('0x7')]=_0x40bc('0x2a');utils[_0x40bc('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x1a9225[_0x40bc('0x4')],queues[_0x1a9225[_0x40bc('0x4')]][_0x40bc('0x1b')],queues[_0x1a9225['uniqueid']][_0x40bc('0x7')]));}}catch(_0x54ec23){utils[_0x40bc('0x2b')](util[_0x40bc('0xf')](_0x40bc('0x29'),_0x1a9225[_0x40bc('0x4')]),_0x54ec23);}};exports['queuecallerleave']=function(_0xd279ed){try{if(!_['isNil'](queues[_0xd279ed[_0x40bc('0x4')]])){utils[_0x40bc('0xe')](util[_0x40bc('0xf')](_0x40bc('0x2c'),_0xd279ed[_0x40bc('0x4')]),_0xd279ed);utils[_0x40bc('0x2')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xd279ed[_0x40bc('0x4')],queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x1b')],_0xd279ed[_0x40bc('0x2d')],_0xd279ed[_0x40bc('0x2e')]));queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x2f')]=!![];queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x17')]=utils['now']();queues[_0xd279ed[_0x40bc('0x4')]]['holdtime']=utils[_0x40bc('0x30')](queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x17')],queues[_0xd279ed['uniqueid']][_0x40bc('0x31')]);queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x12')]=_0xd279ed['position'];queues[_0xd279ed[_0x40bc('0x4')]]['count']=_0xd279ed[_0x40bc('0x32')];queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x2d')]=_0xd279ed[_0x40bc('0x2d')];queues[_0xd279ed[_0x40bc('0x4')]][_0x40bc('0x2e')]=_0xd279ed[_0x40bc('0x2e')];}}catch(_0x196c0d){utils[_0x40bc('0x2b')](util['format'](_0x40bc('0x2c'),_0xd279ed[_0x40bc('0x4')]),_0x196c0d);}};exports['agentconnect']=function(_0x1e7f1f){try{if(!_[_0x40bc('0x15')](queues[_0x1e7f1f[_0x40bc('0x4')]])){utils[_0x40bc('0xe')](util[_0x40bc('0xf')]('[%s][queues][agentconnect]',_0x1e7f1f[_0x40bc('0x4')]),_0x1e7f1f);utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x33'),_0x1e7f1f['uniqueid'],queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x1b')],_0x1e7f1f[_0x40bc('0x34')],_0x1e7f1f[_0x40bc('0x35')]));queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x24')]=null;queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x18')]=![];queues[_0x1e7f1f['uniqueid']][_0x40bc('0x7')]=null;queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x25')]=null;queues[_0x1e7f1f[_0x40bc('0x4')]]['assigned']=!![];queues[_0x1e7f1f[_0x40bc('0x4')]][_0x40bc('0x6')]=_0x1e7f1f[_0x40bc('0x35')];queues[_0x1e7f1f[_0x40bc('0x4')]]['lastAssignedTo']=_0x1e7f1f[_0x40bc('0x34')];}}catch(_0x40dc74){utils[_0x40bc('0x2b')](util[_0x40bc('0xf')](_0x40bc('0x36'),_0x1e7f1f[_0x40bc('0x4')]),_0x40dc74);}};exports[_0x40bc('0x37')]=function(_0x47f81e){try{if(!_[_0x40bc('0x15')](queues[_0x47f81e[_0x40bc('0x4')]])){if(queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x17')]){utils[_0x40bc('0xe')](util[_0x40bc('0xf')]('[%s][queues][agentcomplete]',_0x47f81e[_0x40bc('0x4')]),_0x47f81e);queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x23')]=![];queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x24')]=null;queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x18')]=![];queues[_0x47f81e[_0x40bc('0x4')]]['queuecallerexitAt']=null;queues[_0x47f81e[_0x40bc('0x4')]]['assigned']=!![];queues[_0x47f81e[_0x40bc('0x4')]]['lastAssignedTo']=_0x47f81e[_0x40bc('0x34')];queues[_0x47f81e[_0x40bc('0x4')]]['queuecallercomplete']=!![];queues[_0x47f81e[_0x40bc('0x4')]]['queuecallercompleteAt']=utils[_0x40bc('0x13')]();if(_0x47f81e['reason']==_0x40bc('0x38')){if(!queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x38')]){queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x7')]=_0x40bc('0x39');}}else{queues[_0x47f81e['uniqueid']]['queuecallerexitreason']=_0x40bc('0x3a')+_0x47f81e[_0x40bc('0x3b')][_0x40bc('0x21')]();}utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x3c'),_0x47f81e[_0x40bc('0x4')],queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x1b')],_0x47f81e['membername'],queues[_0x47f81e[_0x40bc('0x4')]][_0x40bc('0x7')]));writeDB(queues[_0x47f81e[_0x40bc('0x4')]]);}}}catch(_0x300f59){utils['error'](util[_0x40bc('0xf')](_0x40bc('0x3d'),_0x47f81e[_0x40bc('0x4')]),_0x300f59);}};exports['blindtransfer']=function(_0x35705f){try{if(!_[_0x40bc('0x15')](queues[_0x35705f['transfereeuniqueid']])){utils[_0x40bc('0xe')](util[_0x40bc('0xf')](_0x40bc('0x3e'),_0x35705f['uniqueid']),_0x35705f);queues[_0x35705f['transfereeuniqueid']][_0x40bc('0x38')]=!![];queues[_0x35705f[_0x40bc('0x3f')]][_0x40bc('0x40')]=_0x40bc('0x41');queues[_0x35705f[_0x40bc('0x3f')]][_0x40bc('0x42')]=_0x35705f[_0x40bc('0x43')];queues[_0x35705f[_0x40bc('0x3f')]][_0x40bc('0x44')]=_0x35705f['transfereeuniqueid'];queues[_0x35705f[_0x40bc('0x3f')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x45'),_0x35705f[_0x40bc('0x4')],queues[_0x35705f[_0x40bc('0x3f')]][_0x40bc('0x1b')],_0x35705f[_0x40bc('0x3f')],_0x35705f['extension']));}}catch(_0x5cf4c3){utils[_0x40bc('0x2b')](util[_0x40bc('0xf')](_0x40bc('0x3e'),_0x35705f[_0x40bc('0x4')]),_0x5cf4c3);}};exports[_0x40bc('0x46')]=function(_0xd910a2){try{utils[_0x40bc('0xe')](util[_0x40bc('0xf')](_0x40bc('0x47'),_0xd910a2['origtransfereruniqueid']),_0xd910a2);if(_0xd910a2[_0x40bc('0x48')]==_0xd910a2[_0x40bc('0x49')]){if(!_[_0x40bc('0x15')](queues[_0xd910a2['secondtransfererlinkedid']])){utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x4a'),_0xd910a2[_0x40bc('0x48')],queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0x1b')],_0xd910a2['origtransfererexten']));queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0x38')]=!![];queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0x40')]=_0x40bc('0x4c');queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0x42')]=_0xd910a2['origtransfererexten'];queues[_0xd910a2['secondtransfererlinkedid']][_0x40bc('0x44')]=_0xd910a2['origtransfereruniqueid'];queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0x7')]=_0x40bc('0x4d');}if(!_[_0x40bc('0x15')](queues[_0xd910a2[_0x40bc('0x49')]])){if(_0xd910a2[_0x40bc('0x4e')]&&queues[_0xd910a2[_0x40bc('0x4e')]]){queues[_0xd910a2[_0x40bc('0x4e')]][_0x40bc('0x1c')]=0x1;queues[_0xd910a2[_0x40bc('0x3f')]]=_['clone'](queues[_0xd910a2[_0x40bc('0x4e')]]);queues[_0xd910a2['transfereeuniqueid']][_0x40bc('0xc')]=_0xd910a2['transfertargetuniqueid'];queues[_0xd910a2['transfereeuniqueid']][_0x40bc('0x1c')]=0x2;queues[_0xd910a2['transfereeuniqueid']][_0x40bc('0x4f')]=queues[_0xd910a2[_0x40bc('0x4b')]]['calleridnum'];queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x50')]=queues[_0xd910a2[_0x40bc('0x4b')]]['calleridname'];queues[_0xd910a2[_0x40bc('0x3f')]]['queuecallerjoinAt']=utils[_0x40bc('0x13')]();queues[_0xd910a2['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x40bc('0x13')]();queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x51')]=0x0;queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x52')]=0x0;utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x53'),_0xd910a2['origtransfereruniqueid'],queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x1b')],queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x4f')],queues[_0xd910a2[_0x40bc('0x3f')]][_0x40bc('0x50')]));}else{utils[_0x40bc('0x2')](util['format'](_0x40bc('0x54'),_0xd910a2[_0x40bc('0x48')],queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x1b')],_0xd910a2[_0x40bc('0x4b')]));queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0xc')]=_0xd910a2['secondtransfererlinkedid'];}}}else if(_0xd910a2[_0x40bc('0x55')]==_0xd910a2[_0x40bc('0x4b')]){if(!_[_0x40bc('0x15')](queues[_0xd910a2[_0x40bc('0x49')]])){utils[_0x40bc('0x2')](util['format'](_0x40bc('0x56'),_0xd910a2[_0x40bc('0x48')],queues[_0xd910a2['origtransfererlinkedid']][_0x40bc('0x1b')],_0xd910a2['secondtransfereruniqueid'],_0xd910a2[_0x40bc('0x57')]));queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x38')]=!![];queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x40')]='ATTENDED';queues[_0xd910a2['origtransfererlinkedid']][_0x40bc('0x42')]=_0xd910a2[_0x40bc('0x57')];queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x44')]=_0xd910a2[_0x40bc('0x55')];queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x40bc('0x15')](queues[_0xd910a2[_0x40bc('0x4b')]])){if(_0xd910a2[_0x40bc('0x58')]&&queues[_0xd910a2[_0x40bc('0x58')]]){queues[_0xd910a2['transfertargetlinkedid']][_0x40bc('0x1c')]=0x1;queues[_0xd910a2[_0x40bc('0x59')]]=_[_0x40bc('0x5a')](queues[_0xd910a2[_0x40bc('0x58')]]);queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0xc')]=_0xd910a2['transfertargetuniqueid'];queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x1c')]=0x2;queues[_0xd910a2[_0x40bc('0x59')]][_0x40bc('0x4f')]=queues[_0xd910a2[_0x40bc('0x49')]][_0x40bc('0x4f')];queues[_0xd910a2[_0x40bc('0x59')]]['calleridname']=queues[_0xd910a2['origtransfererlinkedid']][_0x40bc('0x50')];queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x31')]=utils[_0x40bc('0x13')]();queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x17')]=utils[_0x40bc('0x13')]();queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x51')]=0x0;queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x52')]=0x0;utils[_0x40bc('0x2')](util[_0x40bc('0xf')](_0x40bc('0x5b'),_0xd910a2[_0x40bc('0x48')],queues[_0xd910a2['transfertargetuniqueid']][_0x40bc('0x1b')],queues[_0xd910a2['transfertargetuniqueid']]['transfereduniqueid'],queues[_0xd910a2[_0x40bc('0x59')]][_0x40bc('0x4f')],queues[_0xd910a2['transfertargetuniqueid']]['calleridname']));}else{utils[_0x40bc('0x2')](util['format'](_0x40bc('0x54'),_0xd910a2['origtransfereruniqueid'],queues[_0xd910a2['secondtransfererlinkedid']][_0x40bc('0x1b')],_0xd910a2[_0x40bc('0x49')]));queues[_0xd910a2[_0x40bc('0x4b')]][_0x40bc('0xc')]=_0xd910a2[_0x40bc('0x49')];}}}}catch(_0x843509){utils[_0x40bc('0x2b')](util['format']('[%s][queues][attendedtransfer]',_0xd910a2[_0x40bc('0x48')]),_0x843509);}};exports[_0x40bc('0x5c')]=function(_0x3822a2){try{if(!_[_0x40bc('0x15')](queues[_0x3822a2['uniqueid']])){utils[_0x40bc('0xe')](util['format'](_0x40bc('0x5d'),_0x3822a2[_0x40bc('0x4')]),_0x3822a2);queues[_0x3822a2[_0x40bc('0x4')]][_0x40bc('0x5e')]=utils['now']();utils['info'](util[_0x40bc('0xf')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3822a2[_0x40bc('0x4')],queues[_0x3822a2[_0x40bc('0x4')]][_0x40bc('0x1b')],queues[_0x3822a2[_0x40bc('0x4')]][_0x40bc('0x5e')]));}}catch(_0x3ba8eb){utils['error'](util[_0x40bc('0xf')](_0x40bc('0x5d'),_0x3822a2[_0x40bc('0x4')]),_0x3ba8eb);}};exports[_0x40bc('0x5f')]=function(_0x5385bd){try{if(!_['isNil'](queues[_0x5385bd[_0x40bc('0x4')]])){if(!_[_0x40bc('0x15')](queues[_0x5385bd[_0x40bc('0x4')]][_0x40bc('0x5e')])){utils[_0x40bc('0xe')](util[_0x40bc('0xf')]('[%s][queues][musiconholdstop]',_0x5385bd[_0x40bc('0x4')]),_0x5385bd);queues[_0x5385bd[_0x40bc('0x4')]][_0x40bc('0x52')]+=utils[_0x40bc('0x30')](utils[_0x40bc('0x13')](),queues[_0x5385bd['uniqueid']][_0x40bc('0x5e')]);utils['info'](util[_0x40bc('0xf')](_0x40bc('0x60'),_0x5385bd[_0x40bc('0x4')],queues[_0x5385bd[_0x40bc('0x4')]][_0x40bc('0x1b')],queues[_0x5385bd[_0x40bc('0x4')]][_0x40bc('0x52')]));delete queues[_0x5385bd[_0x40bc('0x4')]]['musiconholdstartAt'];}}}catch(_0x49b229){utils[_0x40bc('0x2b')](util[_0x40bc('0xf')](_0x40bc('0x61'),_0x5385bd[_0x40bc('0x4')]),_0x49b229);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a506706..25d32ac 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 _0x2e57=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','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','connectedlinename','type','outbound','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','split','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','UserId','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate'];(function(_0x44b656,_0x23cdae){var _0x30fdd9=function(_0x58ebb2){while(--_0x58ebb2){_0x44b656['push'](_0x44b656['shift']());}};_0x30fdd9(++_0x23cdae);}(_0x2e57,0x75));var _0x72e5=function(_0x57da2e,_0x2a33a8){_0x57da2e=_0x57da2e-0x0;var _0x47ac5a=_0x2e57[_0x57da2e];return _0x47ac5a;};'use strict';var _=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var utils=require(_0x72e5('0x2'));var transfers=require(_0x72e5('0x3'));var recordings={};function writeDB(_0x1c823c){var _0x335b3f;utils[_0x72e5('0x4')](util[_0x72e5('0x5')]('[%s][recordings][writeDB]',_0x1c823c[_0x72e5('0x6')]));if(transfers[_0x72e5('0x7')][_0x1c823c[_0x72e5('0x6')]]){_0x335b3f=_0x1c823c[_0x72e5('0x6')];_0x1c823c[_0x72e5('0x6')]=transfers[_0x72e5('0x7')][_0x1c823c[_0x72e5('0x6')]][_0x72e5('0x8')];}if(_0x1c823c['accountcode']){utils['getUserByInternal'](_0x1c823c[_0x72e5('0x9')])[_0x72e5('0xa')](function(_0xd7236c){if(_0xd7236c){_0x1c823c[_0x72e5('0xb')]=_0xd7236c[_0x72e5('0xc')];_0x1c823c[_0x72e5('0xd')]=_0xd7236c['id'];}utils['request'](_0x72e5('0xe'),_0x1c823c);});}else{utils['request'](_0x72e5('0xe'),_0x1c823c);}if(_0x335b3f)delete transfers[_0x72e5('0x7')][_0x335b3f];}exports['newchannel']=function(_0x4b9ad2){try{utils[_0x72e5('0xf')](util[_0x72e5('0x5')](_0x72e5('0x10'),_0x4b9ad2['uniqueid']),_0x4b9ad2);if(_0x4b9ad2['uniqueid']==_0x4b9ad2[_0x72e5('0x11')]){utils[_0x72e5('0x4')](util['format'](_0x72e5('0x12'),_0x4b9ad2[_0x72e5('0x6')],_0x4b9ad2[_0x72e5('0x13')],_0x4b9ad2['exten']));recordings[_0x4b9ad2[_0x72e5('0x6')]]={'uniqueid':_0x4b9ad2[_0x72e5('0x6')],'accountcode':_0x4b9ad2[_0x72e5('0x9')],'exten':_0x4b9ad2[_0x72e5('0x14')],'context':_0x4b9ad2[_0x72e5('0x13')],'channel':_0x4b9ad2[_0x72e5('0x15')],'monitors':[]};}}catch(_0x130c61){utils[_0x72e5('0x16')](util[_0x72e5('0x5')]('[%s][recordings][newchannel]',_0x4b9ad2[_0x72e5('0x6')]),_0x130c61);}};exports[_0x72e5('0x17')]=function(_0x365af9){try{utils[_0x72e5('0xf')](util[_0x72e5('0x5')](_0x72e5('0x18'),_0x365af9[_0x72e5('0x6')]),_0x365af9);if(!_[_0x72e5('0x19')](recordings[_0x365af9[_0x72e5('0x6')]])&&_0x365af9['channelstate']==0x6){utils[_0x72e5('0x4')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x365af9[_0x72e5('0x6')],_0x365af9[_0x72e5('0x13')],_0x365af9[_0x72e5('0x15')]));}else if(!_[_0x72e5('0x19')](recordings[_0x365af9['linkedid']])&&_0x365af9[_0x72e5('0x1a')]==0x6&&_0x365af9[_0x72e5('0x13')]!='transfer'){utils[_0x72e5('0x4')](util[_0x72e5('0x5')](_0x72e5('0x1b'),_0x365af9[_0x72e5('0x6')],_0x365af9[_0x72e5('0x11')],_0x365af9[_0x72e5('0x13')],_0x365af9[_0x72e5('0x15')]));recordings[_0x365af9[_0x72e5('0x11')]][_0x72e5('0x9')]=_0x365af9['accountcode'];}}catch(_0x49f344){utils['error'](util[_0x72e5('0x5')](_0x72e5('0x18'),_0x365af9[_0x72e5('0x6')]),_0x49f344);}};exports['varset']=function(_0x904b25){try{if(!_[_0x72e5('0x19')](_0x904b25[_0x72e5('0x1c')])&&!_['isNil'](_0x904b25[_0x72e5('0x1c')][_0x72e5('0x1d')])){utils['debug'](util[_0x72e5('0x5')](_0x72e5('0x1e'),_0x904b25[_0x72e5('0x6')]),_0x904b25);utils[_0x72e5('0x4')](util['format'](_0x72e5('0x1f'),_0x904b25[_0x72e5('0x6')],_0x904b25[_0x72e5('0x1c')],_0x904b25[_0x72e5('0x20')]));if(_[_0x72e5('0x21')](_0x904b25[_0x72e5('0x20')],'.wav49')){_0x904b25[_0x72e5('0x20')]=_0x904b25[_0x72e5('0x20')][_0x72e5('0x22')](_0x72e5('0x23'),_0x72e5('0x24'));}if(recordings[_0x904b25[_0x72e5('0x11')]]){var _0x44992e=_[_0x72e5('0x25')](recordings[_0x904b25[_0x72e5('0x11')]][_0x72e5('0x26')],{'value':_0x904b25['value']});if(_[_0x72e5('0x19')](_0x44992e)){recordings[_0x904b25[_0x72e5('0x11')]][_0x72e5('0x26')]['push']({'value':_0x904b25['value']});}}}}catch(_0x42615c){utils[_0x72e5('0x16')](util[_0x72e5('0x5')](_0x72e5('0x1e'),_0x904b25[_0x72e5('0x6')]),_0x42615c);}};exports[_0x72e5('0x27')]=function(_0x329f12){try{if(!_['isNil'](recordings[_0x329f12[_0x72e5('0x6')]])){utils[_0x72e5('0xf')](util[_0x72e5('0x5')]('[%s][recordings][hangup]',_0x329f12[_0x72e5('0x6')]),_0x329f12);utils['info'](util[_0x72e5('0x5')](_0x72e5('0x28'),_0x329f12[_0x72e5('0x6')],_0x329f12[_0x72e5('0x29')],_0x329f12[_0x72e5('0x2a')],_0x329f12[_0x72e5('0x2b')]));recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x29')]=_0x329f12[_0x72e5('0x29')];recordings[_0x329f12[_0x72e5('0x6')]]['calleridname']=_0x329f12[_0x72e5('0x2a')];recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x2c')]=_0x329f12[_0x72e5('0x2c')];recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x2d')]=_0x329f12[_0x72e5('0x2d')];if(recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x2e')]==_0x72e5('0x2f')&&recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x9')]){recordings[_0x329f12[_0x72e5('0x6')]]['connectedlinenum']=recordings[_0x329f12[_0x72e5('0x6')]][_0x72e5('0x9')];recordings[_0x329f12[_0x72e5('0x6')]]['connectedlinename']='';}recordings[_0x329f12['uniqueid']][_0x72e5('0x26')]['forEach'](function(_0x205c88){var _0x2e705f=_[_0x72e5('0x30')](recordings[_0x329f12[_0x72e5('0x6')]]);_0x2e705f[_0x72e5('0x20')]=_0x205c88[_0x72e5('0x20')];writeDB(_0x2e705f);});delete recordings[_0x329f12[_0x72e5('0x6')]];}}catch(_0x5f0d18){utils[_0x72e5('0x16')](util[_0x72e5('0x5')](_0x72e5('0x31'),_0x329f12[_0x72e5('0x6')]),_0x5f0d18);}};exports[_0x72e5('0x32')]=function(_0x148086){try{if(!_[_0x72e5('0x19')](recordings[_0x148086[_0x72e5('0x6')]])){utils[_0x72e5('0xf')](util['format']('[%s][recordings][newexten]',_0x148086[_0x72e5('0x6')]),_0x148086);utils['info'](util[_0x72e5('0x5')](_0x72e5('0x33'),_0x148086[_0x72e5('0x6')],_0x148086[_0x72e5('0x34')],_0x148086[_0x72e5('0x35')]));if(_0x148086[_0x72e5('0x34')][_0x72e5('0x36')]()==_0x72e5('0x37')&&_[_0x72e5('0x38')](_0x148086[_0x72e5('0x35')][_0x72e5('0x36')](),'cdr')){var _0x5cccea=_0x148086[_0x72e5('0x35')][_0x72e5('0x39')]('=');var _0x23fdb3=_0x5cccea[0x0]['substring'](_0x5cccea[0x0][_0x72e5('0x3a')]('(')+0x1,_0x5cccea[0x0][_0x72e5('0x3a')](')'));var _0x2df188=_0x5cccea[0x1];recordings[_0x148086[_0x72e5('0x6')]][_0x23fdb3]=_0x2df188;}}}catch(_0x5ed9cb){utils[_0x72e5('0x16')](util['format'](_0x72e5('0x3b'),_0x148086[_0x72e5('0x6')]),_0x5ed9cb);}};exports[_0x72e5('0x3c')]=function(_0x3dc8c3){try{if(!_[_0x72e5('0x19')](recordings[_0x3dc8c3[_0x72e5('0x6')]])){utils[_0x72e5('0xf')](util[_0x72e5('0x5')]('[%s][recordings][queuecallerjoin]',_0x3dc8c3['uniqueid']),_0x3dc8c3);utils[_0x72e5('0x4')](util[_0x72e5('0x5')](_0x72e5('0x3d'),_0x3dc8c3['uniqueid'],_0x3dc8c3[_0x72e5('0x3e')]));recordings[_0x3dc8c3[_0x72e5('0x6')]][_0x72e5('0x3e')]=_0x3dc8c3['queue'];}}catch(_0x2be291){utils['error'](util[_0x72e5('0x5')](_0x72e5('0x3f'),_0x3dc8c3[_0x72e5('0x6')]),_0x2be291);}};exports[_0x72e5('0x40')]=function(_0x4c247e){try{utils[_0x72e5('0xf')](util[_0x72e5('0x5')](_0x72e5('0x41'),_0x4c247e['uniqueid']),_0x4c247e);utils[_0x72e5('0x4')](util[_0x72e5('0x5')](_0x72e5('0x42'),_0x4c247e[_0x72e5('0x6')],_0x4c247e[_0x72e5('0x43')],_0x4c247e[_0x72e5('0x44')],_0x4c247e['transfereecalleridnum'],_0x4c247e[_0x72e5('0x45')]));if(recordings[_0x4c247e['transfereruniqueid']]&&transfers[_0x72e5('0x7')][_0x4c247e[_0x72e5('0x46')]]){transfers[_0x72e5('0x7')][_0x4c247e['transfereruniqueid']][_0x72e5('0x47')]=!![];}}catch(_0x56ef88){utils[_0x72e5('0x16')](util['format']('[%s][recordings][blindtransfer]',_0x4c247e['uniqueid']),_0x56ef88);}}; \ No newline at end of file +var _0x5add=['./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','channel','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','.wav49','value','replace','.WAV','find','monitors','push','error','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','application','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','./utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5add,0xd9));var _0xd5ad=function(_0x273dcf,_0x20de05){_0x273dcf=_0x273dcf-0x0;var _0x5cb01e=_0x5add[_0x273dcf];return _0x5cb01e;};'use strict';var _=require(_0xd5ad('0x0'));var util=require('util');var utils=require(_0xd5ad('0x1'));var transfers=require(_0xd5ad('0x2'));var recordings={};function writeDB(_0x463fae){var _0x24572d;utils[_0xd5ad('0x3')](util[_0xd5ad('0x4')](_0xd5ad('0x5'),_0x463fae[_0xd5ad('0x6')]));if(transfers['blinds'][_0x463fae[_0xd5ad('0x6')]]){_0x24572d=_0x463fae[_0xd5ad('0x6')];_0x463fae[_0xd5ad('0x6')]=transfers['blinds'][_0x463fae[_0xd5ad('0x6')]][_0xd5ad('0x7')];}if(_0x463fae[_0xd5ad('0x8')]){utils[_0xd5ad('0x9')](_0x463fae[_0xd5ad('0x8')])[_0xd5ad('0xa')](function(_0x57fc65){if(_0x57fc65){_0x463fae[_0xd5ad('0xb')]=_0x57fc65[_0xd5ad('0xc')];_0x463fae[_0xd5ad('0xd')]=_0x57fc65['id'];}utils[_0xd5ad('0xe')]('CreateVoiceRecording',_0x463fae);});}else{utils[_0xd5ad('0xe')](_0xd5ad('0xf'),_0x463fae);}if(_0x24572d)delete transfers[_0xd5ad('0x10')][_0x24572d];}exports[_0xd5ad('0x11')]=function(_0x4a98b6){try{utils[_0xd5ad('0x12')](util[_0xd5ad('0x4')](_0xd5ad('0x13'),_0x4a98b6[_0xd5ad('0x6')]),_0x4a98b6);if(_0x4a98b6[_0xd5ad('0x6')]==_0x4a98b6['linkedid']){utils[_0xd5ad('0x3')](util['format'](_0xd5ad('0x14'),_0x4a98b6[_0xd5ad('0x6')],_0x4a98b6[_0xd5ad('0x15')],_0x4a98b6['exten']));recordings[_0x4a98b6[_0xd5ad('0x6')]]={'uniqueid':_0x4a98b6['uniqueid'],'accountcode':_0x4a98b6[_0xd5ad('0x8')],'exten':_0x4a98b6['exten'],'context':_0x4a98b6[_0xd5ad('0x15')],'channel':_0x4a98b6[_0xd5ad('0x16')],'monitors':[]};}}catch(_0x13dd09){utils['error'](util[_0xd5ad('0x4')](_0xd5ad('0x13'),_0x4a98b6['uniqueid']),_0x13dd09);}};exports[_0xd5ad('0x17')]=function(_0x2f11da){try{utils[_0xd5ad('0x12')](util[_0xd5ad('0x4')](_0xd5ad('0x18'),_0x2f11da[_0xd5ad('0x6')]),_0x2f11da);if(!_[_0xd5ad('0x19')](recordings[_0x2f11da[_0xd5ad('0x6')]])&&_0x2f11da['channelstate']==0x6){utils['info'](util[_0xd5ad('0x4')](_0xd5ad('0x1a'),_0x2f11da['uniqueid'],_0x2f11da[_0xd5ad('0x15')],_0x2f11da['channel']));}else if(!_[_0xd5ad('0x19')](recordings[_0x2f11da[_0xd5ad('0x1b')]])&&_0x2f11da[_0xd5ad('0x1c')]==0x6&&_0x2f11da[_0xd5ad('0x15')]!=_0xd5ad('0x1d')){utils[_0xd5ad('0x3')](util[_0xd5ad('0x4')](_0xd5ad('0x1e'),_0x2f11da['uniqueid'],_0x2f11da['linkedid'],_0x2f11da[_0xd5ad('0x15')],_0x2f11da['channel']));recordings[_0x2f11da[_0xd5ad('0x1b')]][_0xd5ad('0x8')]=_0x2f11da[_0xd5ad('0x8')];}}catch(_0x206d41){utils['error'](util['format'](_0xd5ad('0x18'),_0x2f11da[_0xd5ad('0x6')]),_0x206d41);}};exports[_0xd5ad('0x1f')]=function(_0x336244){try{if(!_[_0xd5ad('0x19')](_0x336244[_0xd5ad('0x20')])&&!_['isNil'](_0x336244[_0xd5ad('0x20')][_0xd5ad('0x21')])){utils[_0xd5ad('0x12')](util['format'](_0xd5ad('0x22'),_0x336244[_0xd5ad('0x6')]),_0x336244);utils[_0xd5ad('0x3')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x336244[_0xd5ad('0x6')],_0x336244[_0xd5ad('0x20')],_0x336244['value']));if(_[_0xd5ad('0x23')](_0x336244['value'],_0xd5ad('0x24'))){_0x336244[_0xd5ad('0x25')]=_0x336244[_0xd5ad('0x25')][_0xd5ad('0x26')](_0xd5ad('0x24'),_0xd5ad('0x27'));}if(recordings[_0x336244['linkedid']]){var _0x2215e5=_[_0xd5ad('0x28')](recordings[_0x336244[_0xd5ad('0x1b')]][_0xd5ad('0x29')],{'value':_0x336244['value']});if(_[_0xd5ad('0x19')](_0x2215e5)){recordings[_0x336244['linkedid']][_0xd5ad('0x29')][_0xd5ad('0x2a')]({'value':_0x336244['value']});}}}}catch(_0x257d38){utils[_0xd5ad('0x2b')](util[_0xd5ad('0x4')](_0xd5ad('0x22'),_0x336244[_0xd5ad('0x6')]),_0x257d38);}};exports[_0xd5ad('0x2c')]=function(_0x3f9909){try{if(!_[_0xd5ad('0x19')](recordings[_0x3f9909['uniqueid']])){utils[_0xd5ad('0x12')](util[_0xd5ad('0x4')]('[%s][recordings][hangup]',_0x3f9909[_0xd5ad('0x6')]),_0x3f9909);utils[_0xd5ad('0x3')](util['format'](_0xd5ad('0x2d'),_0x3f9909[_0xd5ad('0x6')],_0x3f9909[_0xd5ad('0x2e')],_0x3f9909[_0xd5ad('0x2f')],_0x3f9909[_0xd5ad('0x30')]));recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x2e')]=_0x3f9909['calleridnum'];recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x2f')]=_0x3f9909[_0xd5ad('0x2f')];recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x31')]=_0x3f9909[_0xd5ad('0x31')];recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x32')]=_0x3f9909[_0xd5ad('0x32')];if(recordings[_0x3f9909['uniqueid']][_0xd5ad('0x33')]==_0xd5ad('0x34')&&recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x8')]){recordings[_0x3f9909[_0xd5ad('0x6')]][_0xd5ad('0x31')]=recordings[_0x3f9909['uniqueid']][_0xd5ad('0x8')];recordings[_0x3f9909['uniqueid']][_0xd5ad('0x32')]='';}recordings[_0x3f9909['uniqueid']][_0xd5ad('0x29')][_0xd5ad('0x35')](function(_0x245ce2){var _0x49b54b=_[_0xd5ad('0x36')](recordings[_0x3f9909['uniqueid']]);_0x49b54b['value']=_0x245ce2['value'];writeDB(_0x49b54b);});delete recordings[_0x3f9909[_0xd5ad('0x6')]];}}catch(_0x5aa49c){utils[_0xd5ad('0x2b')](util[_0xd5ad('0x4')]('[%s][recordings][hangup]',_0x3f9909[_0xd5ad('0x6')]),_0x5aa49c);}};exports['newexten']=function(_0x38ec01){try{if(!_['isNil'](recordings[_0x38ec01['uniqueid']])){utils[_0xd5ad('0x12')](util[_0xd5ad('0x4')](_0xd5ad('0x37'),_0x38ec01[_0xd5ad('0x6')]),_0x38ec01);utils[_0xd5ad('0x3')](util[_0xd5ad('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x38ec01['uniqueid'],_0x38ec01[_0xd5ad('0x38')],_0x38ec01['appdata']));if(_0x38ec01['application'][_0xd5ad('0x39')]()=='set'&&_['startsWith'](_0x38ec01['appdata'][_0xd5ad('0x39')](),_0xd5ad('0x3a'))){var _0xef159a=_0x38ec01['appdata'][_0xd5ad('0x3b')]('=');var _0x50a34f=_0xef159a[0x0][_0xd5ad('0x3c')](_0xef159a[0x0]['lastIndexOf']('(')+0x1,_0xef159a[0x0][_0xd5ad('0x3d')](')'));var _0x3cf705=_0xef159a[0x1];recordings[_0x38ec01[_0xd5ad('0x6')]][_0x50a34f]=_0x3cf705;}}}catch(_0x3e5670){utils[_0xd5ad('0x2b')](util['format'](_0xd5ad('0x37'),_0x38ec01[_0xd5ad('0x6')]),_0x3e5670);}};exports[_0xd5ad('0x3e')]=function(_0x523598){try{if(!_[_0xd5ad('0x19')](recordings[_0x523598[_0xd5ad('0x6')]])){utils[_0xd5ad('0x12')](util['format'](_0xd5ad('0x3f'),_0x523598[_0xd5ad('0x6')]),_0x523598);utils['info'](util[_0xd5ad('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x523598[_0xd5ad('0x6')],_0x523598[_0xd5ad('0x40')]));recordings[_0x523598['uniqueid']][_0xd5ad('0x40')]=_0x523598['queue'];}}catch(_0x5f5b60){utils[_0xd5ad('0x2b')](util['format'](_0xd5ad('0x3f'),_0x523598[_0xd5ad('0x6')]),_0x5f5b60);}};exports[_0xd5ad('0x41')]=function(_0x17086c){try{utils['debug'](util[_0xd5ad('0x4')]('[%s][recordings][blindtransfer]',_0x17086c[_0xd5ad('0x6')]),_0x17086c);utils[_0xd5ad('0x3')](util['format'](_0xd5ad('0x42'),_0x17086c['uniqueid'],_0x17086c['transferercalleridnum'],_0x17086c[_0xd5ad('0x43')],_0x17086c[_0xd5ad('0x44')],_0x17086c[_0xd5ad('0x45')]));if(recordings[_0x17086c[_0xd5ad('0x46')]]&&transfers[_0xd5ad('0x10')][_0x17086c[_0xd5ad('0x46')]]){transfers['blinds'][_0x17086c[_0xd5ad('0x46')]][_0xd5ad('0x47')]=!![];}}catch(_0x2d91de){utils[_0xd5ad('0x2b')](util[_0xd5ad('0x4')](_0xd5ad('0x48'),_0x17086c['uniqueid']),_0x2d91de);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 60da59c..7ee1fa0 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 _0x03a2=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','lodash','util','info','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','format','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03a2,0x78));var _0x203a=function(_0x221191,_0x3e1f7d){_0x221191=_0x221191-0x0;var _0x27fa45=_0x03a2[_0x221191];return _0x27fa45;};'use strict';var _=require(_0x203a('0x0'));var util=require(_0x203a('0x1'));var utils=require('./utils');function writeDB(_0x2704ea){utils[_0x203a('0x2')](util['format'](_0x203a('0x3'),_0x2704ea[_0x203a('0x4')]===_0x203a('0x5')?_0x2704ea[_0x203a('0x6')]:_0x2704ea[_0x203a('0x7')],_0x2704ea['type']));utils['request'](_0x203a('0x8'),_0x2704ea);}exports[_0x203a('0x9')]={};exports[_0x203a('0xa')]=function(_0x1cade3){try{utils[_0x203a('0xb')](util['format'](_0x203a('0xc'),_0x1cade3[_0x203a('0x7')]),_0x1cade3);utils['info'](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1cade3['uniqueid'],_0x1cade3[_0x203a('0xd')],_0x1cade3[_0x203a('0xe')],_0x1cade3[_0x203a('0xf')],_0x1cade3['transfereecalleridname']));_0x1cade3[_0x203a('0x4')]=_0x203a('0x10');exports[_0x203a('0x9')][_0x1cade3[_0x203a('0x11')]]=_0x1cade3;writeDB(_0x1cade3);}catch(_0x5e57da){utils[_0x203a('0x12')](util['format'](_0x203a('0xc'),_0x1cade3['uniqueid']),_0x5e57da);}};exports[_0x203a('0x13')]=function(_0x349646){try{utils[_0x203a('0xb')](util[_0x203a('0x14')](_0x203a('0x15'),_0x349646[_0x203a('0x6')]),_0x349646);utils['info'](util[_0x203a('0x14')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x349646[_0x203a('0x6')],_0x349646[_0x203a('0x16')],_0x349646[_0x203a('0x17')],_0x349646[_0x203a('0x18')],_0x349646[_0x203a('0x19')]));_0x349646=_[_0x203a('0x1a')](_0x349646,{'transfererchannel':_0x349646['origtransfererchannel'],'transferercalleridnum':_0x349646['origtransferercalleridnum'],'transferercalleridname':_0x349646[_0x203a('0x17')],'transfererconnectedlinenum':_0x349646[_0x203a('0x1b')],'transfererconnectedlinename':_0x349646[_0x203a('0x1c')],'transfereraccountcode':_0x349646[_0x203a('0x1d')],'transferercontext':_0x349646['secondtransferercontext'],'transfererexten':_0x349646[_0x203a('0x1e')],'transfererlinkedid':_0x349646[_0x203a('0x1f')],'context':_0x349646[_0x203a('0x20')],'extension':_0x349646[_0x203a('0x21')],'type':_0x203a('0x5')});if(_[_0x203a('0x22')](_0x349646['transfereechannel'])){_0x349646=_[_0x203a('0x1a')](_0x349646,{'transfereechannel':_0x349646[_0x203a('0x23')],'transfereecalleridnum':_0x349646[_0x203a('0x18')],'transfereecalleridname':_0x349646['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x349646[_0x203a('0x24')],'transfereeconnectedlinename':_0x349646[_0x203a('0x25')],'transfereeaccountcode':_0x349646['transfertargetaccountcode'],'transfereecontext':_0x349646['transfertargetcontext'],'transfereeexten':_0x349646[_0x203a('0x26')],'transfereelinkedid':_0x349646['transfertargetlinkedid']});}writeDB(_0x349646);}catch(_0x572a08){utils[_0x203a('0x12')](util[_0x203a('0x14')](_0x203a('0x15'),_0x349646[_0x203a('0x6')]),_0x572a08);}}; \ No newline at end of file +var _0xed42=['[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','type','CreateVoiceTransferReport','blinds','debug'];(function(_0x3ec448,_0x4694df){var _0x4f6618=function(_0x29a447){while(--_0x29a447){_0x3ec448['push'](_0x3ec448['shift']());}};_0x4f6618(++_0x4694df);}(_0xed42,0x11a));var _0x2ed4=function(_0x26e359,_0x33f445){_0x26e359=_0x26e359-0x0;var _0x99b90=_0xed42[_0x26e359];return _0x99b90;};'use strict';var _=require(_0x2ed4('0x0'));var util=require(_0x2ed4('0x1'));var utils=require(_0x2ed4('0x2'));function writeDB(_0x3b4f05){utils[_0x2ed4('0x3')](util[_0x2ed4('0x4')](_0x2ed4('0x5'),_0x3b4f05['type']===_0x2ed4('0x6')?_0x3b4f05[_0x2ed4('0x7')]:_0x3b4f05['uniqueid'],_0x3b4f05[_0x2ed4('0x8')]));utils['request'](_0x2ed4('0x9'),_0x3b4f05);}exports[_0x2ed4('0xa')]={};exports['blindtransfer']=function(_0xd55b0b){try{utils[_0x2ed4('0xb')](util[_0x2ed4('0x4')](_0x2ed4('0xc'),_0xd55b0b[_0x2ed4('0xd')]),_0xd55b0b);utils[_0x2ed4('0x3')](util[_0x2ed4('0x4')](_0x2ed4('0xe'),_0xd55b0b[_0x2ed4('0xd')],_0xd55b0b[_0x2ed4('0xf')],_0xd55b0b[_0x2ed4('0x10')],_0xd55b0b['transfereecalleridnum'],_0xd55b0b[_0x2ed4('0x11')]));_0xd55b0b[_0x2ed4('0x8')]=_0x2ed4('0x12');exports[_0x2ed4('0xa')][_0xd55b0b['transfereruniqueid']]=_0xd55b0b;writeDB(_0xd55b0b);}catch(_0x901d4){utils['error'](util[_0x2ed4('0x4')](_0x2ed4('0xc'),_0xd55b0b[_0x2ed4('0xd')]),_0x901d4);}};exports[_0x2ed4('0x13')]=function(_0x1e8d86){try{utils[_0x2ed4('0xb')](util[_0x2ed4('0x4')](_0x2ed4('0x14'),_0x1e8d86[_0x2ed4('0x7')]),_0x1e8d86);utils[_0x2ed4('0x3')](util[_0x2ed4('0x4')](_0x2ed4('0x15'),_0x1e8d86[_0x2ed4('0x7')],_0x1e8d86[_0x2ed4('0x16')],_0x1e8d86[_0x2ed4('0x17')],_0x1e8d86[_0x2ed4('0x18')],_0x1e8d86['transfertargetcalleridname']));_0x1e8d86=_['assign'](_0x1e8d86,{'transfererchannel':_0x1e8d86['origtransfererchannel'],'transferercalleridnum':_0x1e8d86[_0x2ed4('0x16')],'transferercalleridname':_0x1e8d86[_0x2ed4('0x17')],'transfererconnectedlinenum':_0x1e8d86[_0x2ed4('0x19')],'transfererconnectedlinename':_0x1e8d86['secondtransfererconnectedlinename'],'transfereraccountcode':_0x1e8d86[_0x2ed4('0x1a')],'transferercontext':_0x1e8d86['secondtransferercontext'],'transfererexten':_0x1e8d86[_0x2ed4('0x1b')],'transfererlinkedid':_0x1e8d86[_0x2ed4('0x1c')],'context':_0x1e8d86[_0x2ed4('0x1d')],'extension':_0x1e8d86[_0x2ed4('0x1e')],'type':_0x2ed4('0x6')});if(_[_0x2ed4('0x1f')](_0x1e8d86[_0x2ed4('0x20')])){_0x1e8d86=_[_0x2ed4('0x21')](_0x1e8d86,{'transfereechannel':_0x1e8d86[_0x2ed4('0x22')],'transfereecalleridnum':_0x1e8d86[_0x2ed4('0x18')],'transfereecalleridname':_0x1e8d86['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1e8d86[_0x2ed4('0x23')],'transfereeconnectedlinename':_0x1e8d86[_0x2ed4('0x24')],'transfereeaccountcode':_0x1e8d86[_0x2ed4('0x25')],'transfereecontext':_0x1e8d86[_0x2ed4('0x26')],'transfereeexten':_0x1e8d86[_0x2ed4('0x27')],'transfereelinkedid':_0x1e8d86[_0x2ed4('0x28')]});}writeDB(_0x1e8d86);}catch(_0x2106ea){utils[_0x2ed4('0x29')](util[_0x2ed4('0x4')](_0x2ed4('0x14'),_0x1e8d86['origtransfereruniqueid']),_0x2106ea);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index cc66320..60697cf 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 _0x5c10=['request','internal','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','then','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diff','sumTime','now','isAfter','isBefore','bluebird','moment','http','../../config/logger','info','inspect','debug','error','[utils][request]\x20name:%s'];(function(_0x14eb61,_0x430de5){var _0x3ab5a0=function(_0x1d54d6){while(--_0x1d54d6){_0x14eb61['push'](_0x14eb61['shift']());}};_0x3ab5a0(++_0x430de5);}(_0x5c10,0x183));var _0x05c1=function(_0x178c92,_0x3760e0){_0x178c92=_0x178c92-0x0;var _0x509937=_0x5c10[_0x178c92];return _0x509937;};'use strict';var BPromise=require(_0x05c1('0x0'));var jayson=require('jayson/promise');var moment=require(_0x05c1('0x1'));var util=require('util');var client=jayson['client'][_0x05c1('0x2')]({'port':0x2329});var logger=require(_0x05c1('0x3'))('xdr');exports[_0x05c1('0x4')]=function(_0xf1f78e,_0x542deb){logger[_0x05c1('0x4')](_0xf1f78e,_0x542deb?util[_0x05c1('0x5')](_0x542deb,{'showHidden':![],'depth':null}):'');};exports[_0x05c1('0x6')]=function(_0x399a18,_0x51d30e){logger[_0x05c1('0x6')](_0x399a18,_0x51d30e?util['inspect'](_0x51d30e,{'showHidden':![],'depth':null}):'');};exports[_0x05c1('0x7')]=function(_0x49c5ee,_0x4ed2db){logger[_0x05c1('0x7')](_0x49c5ee,_0x4ed2db?util['inspect'](_0x4ed2db,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x42a1b7,_0x348340){return client['request'](_0x42a1b7,{'body':_0x348340})['then'](function(_0x5b3bc4){logger[_0x05c1('0x6')](_0x05c1('0x8'),_0x42a1b7,_0x5b3bc4?util['inspect'](_0x5b3bc4,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5f4896){logger['error'](_0x05c1('0x8'),_0x42a1b7,_0x5f4896?util['inspect'](_0x5f4896,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4f86a7){return client[_0x05c1('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x05c1('0xa'),'name',_0x05c1('0xb')],'where':_0x4f86a7,'limit':0x1}})['then'](function(_0x83f51){logger['debug'](_0x05c1('0xc'),JSON[_0x05c1('0xd')](_0x4f86a7),_0x83f51?util[_0x05c1('0x5')](_0x83f51,{'showHidden':![],'depth':null}):'');return _0x83f51[_0x05c1('0xe')][_0x05c1('0xf')]?_0x83f51[_0x05c1('0xe')][0x0]:null;});}exports[_0x05c1('0x10')]=function(_0x575b8d){return new BPromise(function(_0x4501b0,_0xce58b7){if(_0x575b8d){return getUser({'internal':_0x575b8d})[_0x05c1('0x11')](function(_0x53074c){logger[_0x05c1('0x4')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x575b8d,_0x53074c?_0x05c1('0x12'):_0x05c1('0x13'));return _0x4501b0(_0x53074c);})[_0x05c1('0x14')](function(_0x26708f){logger[_0x05c1('0x7')](_0x05c1('0x15'),_0x26708f?util[_0x05c1('0x5')](_0x26708f,{'showHidden':![],'depth':null}):'');return _0x4501b0(null);});}return _0x4501b0(null);});};exports['getUserByInterface']=function(_0xc637ae){return new BPromise(function(_0x51b862,_0x4e61c0){if(_0xc637ae){return getUser({'interface':_0xc637ae})[_0x05c1('0x11')](function(_0xbc07f9){logger[_0x05c1('0x4')](_0x05c1('0x16'),_0xc637ae,_0xbc07f9?'found':'notfound');return _0x51b862(_0xbc07f9);})['catch'](function(_0x461fdb){logger['error'](_0x05c1('0x17'),_0x461fdb?util['inspect'](_0x461fdb,{'showHidden':![],'depth':null}):'');return _0x51b862(null);});}return _0x51b862(null);});};exports[_0x05c1('0x18')]=function(_0x481006){return new BPromise(function(_0x6ed77d,_0x41720d){if(_0x481006){return getUser({'name':_0x481006})['then'](function(_0x833a6b){logger[_0x05c1('0x4')](_0x05c1('0x19'),_0x481006,_0x833a6b?_0x05c1('0x12'):_0x05c1('0x13'));return _0x6ed77d(_0x833a6b);})[_0x05c1('0x14')](function(_0x39f1a7){logger[_0x05c1('0x7')](_0x05c1('0x1a'),_0x39f1a7?util[_0x05c1('0x5')](_0x39f1a7,{'showHidden':![],'depth':null}):'');return _0x6ed77d(null);});}return _0x6ed77d(null);});};exports['getVoiceQueueByName']=function(_0x233577){return new BPromise(function(_0x239255,_0x1d199b){if(_0x233577){return client['request'](_0x05c1('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x05c1('0x1c'),_0x05c1('0x1d'),_0x05c1('0x1e'),_0x05c1('0x1f')],'where':{'name':_0x233577},'limit':0x1}})['then'](function(_0x156e6c){logger[_0x05c1('0x6')](_0x05c1('0x20'),_0x233577,_0x156e6c?util[_0x05c1('0x5')](_0x156e6c,{'showHidden':![],'depth':null}):'');logger[_0x05c1('0x4')](_0x05c1('0x21'),_0x233577,_0x156e6c?_0x05c1('0x12'):_0x05c1('0x13'));return _0x239255(_0x156e6c[_0x05c1('0xe')][_0x05c1('0xf')]?_0x156e6c[_0x05c1('0xe')][0x0]:null);})[_0x05c1('0x14')](function(_0x29e690){logger[_0x05c1('0x7')]('[utils][getVoiceQueueByName]',_0x29e690?util[_0x05c1('0x5')](_0x29e690,{'showHidden':![],'depth':null}):'');return _0x239255(null);});}return _0x239255(null);});};exports[_0x05c1('0x22')]=function(_0x22266d,_0x23a4ac){return moment(_0x22266d)[_0x05c1('0x23')](_0x23a4ac,_0x05c1('0x24'))[_0x05c1('0x25')](_0x05c1('0x26'));};exports['subtractTime']=function(_0x11324e,_0x473fc7){return moment(_0x11324e)['subtract'](_0x473fc7,_0x05c1('0x24'))[_0x05c1('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x20bd4b,_0xae5559){return moment(_0x20bd4b)[_0x05c1('0x27')](moment(_0xae5559),_0x05c1('0x24'));};exports[_0x05c1('0x28')]=function(_0x9b3796,_0x3c139e){return parseInt(_0x9b3796,0xa)+parseInt(_0x3c139e,0xa);};exports[_0x05c1('0x29')]=function(){return moment()[_0x05c1('0x25')](_0x05c1('0x26'));};exports[_0x05c1('0x2a')]=function(_0x113ce3,_0x33379a){if(_0x33379a){return moment(_0x113ce3)[_0x05c1('0x2a')](_0x33379a);}return!![];};exports[_0x05c1('0x2b')]=function(_0x1857d3,_0x57397b){if(_0x57397b){return moment(_0x1857d3)[_0x05c1('0x2b')](_0x57397b);}else if(_0x1857d3){return!![];}return![];}; \ No newline at end of file +var _0xa6ce=['then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','http','../../config/logger','info','inspect','debug','error','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa6ce,0x15e));var _0xea6c=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xa6ce[_0x500419];return _0x241c1a;};'use strict';var BPromise=require(_0xea6c('0x0'));var jayson=require('jayson/promise');var moment=require(_0xea6c('0x1'));var util=require(_0xea6c('0x2'));var client=jayson['client'][_0xea6c('0x3')]({'port':0x2329});var logger=require(_0xea6c('0x4'))('xdr');exports['info']=function(_0x2ac723,_0x1eea8f){logger[_0xea6c('0x5')](_0x2ac723,_0x1eea8f?util[_0xea6c('0x6')](_0x1eea8f,{'showHidden':![],'depth':null}):'');};exports[_0xea6c('0x7')]=function(_0x8a751f,_0x5c3ba1){logger[_0xea6c('0x7')](_0x8a751f,_0x5c3ba1?util[_0xea6c('0x6')](_0x5c3ba1,{'showHidden':![],'depth':null}):'');};exports[_0xea6c('0x8')]=function(_0x202528,_0x29b813){logger[_0xea6c('0x8')](_0x202528,_0x29b813?util[_0xea6c('0x6')](_0x29b813,{'showHidden':![],'depth':null}):'');};exports[_0xea6c('0x9')]=function(_0x2c414a,_0x3b70a4){return client[_0xea6c('0x9')](_0x2c414a,{'body':_0x3b70a4})[_0xea6c('0xa')](function(_0xfc7a5e){logger[_0xea6c('0x7')]('[utils][request]\x20name:%s',_0x2c414a,_0xfc7a5e?util[_0xea6c('0x6')](_0xfc7a5e,{'showHidden':![],'depth':null}):'');})[_0xea6c('0xb')](function(_0x36c0a8){logger['error'](_0xea6c('0xc'),_0x2c414a,_0x36c0a8?util[_0xea6c('0x6')](_0x36c0a8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4db782){return client[_0xea6c('0x9')](_0xea6c('0xd'),{'options':{'raw':!![],'attributes':['id',_0xea6c('0xe'),_0xea6c('0xf'),_0xea6c('0x10')],'where':_0x4db782,'limit':0x1}})[_0xea6c('0xa')](function(_0x5a51f9){logger[_0xea6c('0x7')]('[utils][getUser]\x20where:%s',JSON[_0xea6c('0x11')](_0x4db782),_0x5a51f9?util[_0xea6c('0x6')](_0x5a51f9,{'showHidden':![],'depth':null}):'');return _0x5a51f9[_0xea6c('0x12')][_0xea6c('0x13')]?_0x5a51f9[_0xea6c('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x2dbbcb){return new BPromise(function(_0x2f4bd0,_0x254f8e){if(_0x2dbbcb){return getUser({'internal':_0x2dbbcb})[_0xea6c('0xa')](function(_0x9ba42b){logger[_0xea6c('0x5')](_0xea6c('0x14'),_0x2dbbcb,_0x9ba42b?_0xea6c('0x15'):_0xea6c('0x16'));return _0x2f4bd0(_0x9ba42b);})[_0xea6c('0xb')](function(_0x52a322){logger[_0xea6c('0x8')]('[utils][getUserByInternal]',_0x52a322?util[_0xea6c('0x6')](_0x52a322,{'showHidden':![],'depth':null}):'');return _0x2f4bd0(null);});}return _0x2f4bd0(null);});};exports['getUserByInterface']=function(_0x204e07){return new BPromise(function(_0x341139,_0x1d3eca){if(_0x204e07){return getUser({'interface':_0x204e07})['then'](function(_0x417cfa){logger[_0xea6c('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x204e07,_0x417cfa?'found':_0xea6c('0x16'));return _0x341139(_0x417cfa);})['catch'](function(_0x540406){logger[_0xea6c('0x8')](_0xea6c('0x17'),_0x540406?util[_0xea6c('0x6')](_0x540406,{'showHidden':![],'depth':null}):'');return _0x341139(null);});}return _0x341139(null);});};exports[_0xea6c('0x18')]=function(_0x303303){return new BPromise(function(_0x4fa0ea,_0x3bfe88){if(_0x303303){return getUser({'name':_0x303303})['then'](function(_0x5df5e9){logger[_0xea6c('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x303303,_0x5df5e9?_0xea6c('0x15'):_0xea6c('0x16'));return _0x4fa0ea(_0x5df5e9);})[_0xea6c('0xb')](function(_0x269b48){logger[_0xea6c('0x8')](_0xea6c('0x19'),_0x269b48?util[_0xea6c('0x6')](_0x269b48,{'showHidden':![],'depth':null}):'');return _0x4fa0ea(null);});}return _0x4fa0ea(null);});};exports[_0xea6c('0x1a')]=function(_0x348a38){return new BPromise(function(_0x118385,_0x15327f){if(_0x348a38){return client[_0xea6c('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xea6c('0xf'),_0xea6c('0x1b'),'acw','acwTimeout'],'where':{'name':_0x348a38},'limit':0x1}})['then'](function(_0x434fa7){logger[_0xea6c('0x7')](_0xea6c('0x1c'),_0x348a38,_0x434fa7?util[_0xea6c('0x6')](_0x434fa7,{'showHidden':![],'depth':null}):'');logger[_0xea6c('0x5')](_0xea6c('0x1d'),_0x348a38,_0x434fa7?_0xea6c('0x15'):_0xea6c('0x16'));return _0x118385(_0x434fa7[_0xea6c('0x12')]['length']?_0x434fa7[_0xea6c('0x12')][0x0]:null);})[_0xea6c('0xb')](function(_0x439013){logger[_0xea6c('0x8')](_0xea6c('0x1e'),_0x439013?util[_0xea6c('0x6')](_0x439013,{'showHidden':![],'depth':null}):'');return _0x118385(null);});}return _0x118385(null);});};exports['addTime']=function(_0xc0c5b9,_0x18c59e){return moment(_0xc0c5b9)['add'](_0x18c59e,_0xea6c('0x1f'))[_0xea6c('0x20')](_0xea6c('0x21'));};exports['subtractTime']=function(_0x5ef27c,_0x4fa399){return moment(_0x5ef27c)['subtract'](_0x4fa399,'seconds')[_0xea6c('0x20')](_0xea6c('0x21'));};exports[_0xea6c('0x22')]=function(_0x151c66,_0x507d35){return moment(_0x151c66)[_0xea6c('0x23')](moment(_0x507d35),_0xea6c('0x1f'));};exports[_0xea6c('0x24')]=function(_0x525861,_0x1d8794){return parseInt(_0x525861,0xa)+parseInt(_0x1d8794,0xa);};exports[_0xea6c('0x25')]=function(){return moment()['format'](_0xea6c('0x21'));};exports[_0xea6c('0x26')]=function(_0x3033da,_0x261082){if(_0x261082){return moment(_0x3033da)[_0xea6c('0x26')](_0x261082);}return!![];};exports[_0xea6c('0x27')]=function(_0x1fbb3d,_0x3259aa){if(_0x3259aa){return moment(_0x1fbb3d)[_0xea6c('0x27')](_0x3259aa);}else if(_0x1fbb3d){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 9a984a0..c04b333 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 _0xa9a9=['x-forwarded-for','connection','responseTime','name','use','device','remoteAddress','url','other','agent_id','agent_name','express-winston','path','util','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','role','ensureDir','then','catch','user','no-user','data','timestamp','error','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers'];(function(_0x21be21,_0x248ea2){var _0x3007da=function(_0x4b285a){while(--_0x4b285a){_0x21be21['push'](_0x21be21['shift']());}};_0x3007da(++_0x248ea2);}(_0xa9a9,0xe2));var _0x9a9a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa9a9[_0x321bb2];return _0x9c12ed;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x9a9a('0x0'));var path=require(_0x9a9a('0x1'));var util=require(_0x9a9a('0x2'));var fileLogger=require(_0x9a9a('0x3'))[_0x9a9a('0x4')];var safeTemplate=require('./safe-template')[_0x9a9a('0x5')];var maskSensitiveData=require(_0x9a9a('0x6'))[_0x9a9a('0x7')];function ClientSideLogger(){function _0x5536f2(_0x20fdf2){var _0x34eb45=path['join'](_0x9a9a('0x8'),_0x9a9a('0x9'),_0x9a9a('0xa'));var _0x2c6258=path[_0x9a9a('0xb')](_0x9a9a('0xc'),_0x20fdf2[_0x9a9a('0xd')]+'-'+_0x20fdf2['name']);return fs[_0x9a9a('0xe')](path[_0x9a9a('0xb')](_0x34eb45,_0x2c6258))[_0x9a9a('0xf')](function(){var _0x464119=fileLogger(_0x9a9a('0xc'),path[_0x9a9a('0xb')](_0x34eb45,_0x2c6258));return _0x464119;})[_0x9a9a('0x10')](function(_0x41c242){throw _0x41c242;});}this[_0x9a9a('0x9')]=function(_0x32f1e1,_0x316c06,_0xe51f10,_0x50fd90){return _0x5536f2(_0x32f1e1['user'])['then'](function(_0x4f794b){var _0x17d968=_0x4f794b[_0x316c06];return _0x17d968;})[_0x9a9a('0xf')](function(_0x11fe90){var _0x4f84f4=_0x32f1e1[_0x9a9a('0x11')]?_0x32f1e1['user']['id']:_0x9a9a('0x12');var _0x4d1a2e=_0x50fd90[_0x9a9a('0x13')];var _0x1b58ad=_0x50fd90[_0x9a9a('0x14')];var _0x50ee50=new Date(Number(_0x1b58ad));return _0x11fe90(_0x4f84f4,_0x50ee50,_0xe51f10,_0x4d1a2e);})['catch'](function(_0x5a8ea7){fileLogger(_0x9a9a('0xc'))[_0x9a9a('0x15')](_0x5a8ea7);});};}function setupLoggers(_0x463317){return new Promise(function(_0x416435){var _0x599295=new ClientSideLogger();var _0x96a7c1=fileLogger('api');var _0xe37142=fileLogger('auth');_0x463317[_0x9a9a('0x16')](_0x9a9a('0x17'),_0x599295);_0x463317['use'](ewinston[_0x9a9a('0x18')]({'winstonInstance':_0x96a7c1,'meta':![],'statusLevels':!![],'msg':function(_0x801f25,_0x109a5d){var _0x174665=_0x9a9a('0x19');if(!_[_0x9a9a('0x1a')](_0x801f25[_0x9a9a('0x1b')])){_0x174665+=_0x9a9a('0x1c');var _0x3d8520=_0x801f25['body'];maskSensitiveData(_0x3d8520);}return safeTemplate(util[_0x9a9a('0x1d')](_0x174665,_0x801f25[_0x9a9a('0x1e')],_0x801f25[_0x9a9a('0x1f')][_0x9a9a('0x20')]?_0x801f25['headers'][_0x9a9a('0x20')]:_0x801f25[_0x9a9a('0x21')]['remoteAddress']||_0x801f25['ip'],_0x801f25['url'],_0x109a5d['statusCode'],_0x109a5d[_0x9a9a('0x22')],_0x801f25['user']?_0x801f25[_0x9a9a('0x11')]['id']:null,_0x801f25[_0x9a9a('0x11')]?_0x801f25[_0x9a9a('0x11')][_0x9a9a('0x23')]:null,_0x801f25[_0x9a9a('0x11')]?_0x801f25[_0x9a9a('0x11')][_0x9a9a('0xd')]:null,_0x3d8520?util['inspect'](_0x3d8520,![],null):''));}}));_0x463317[_0x9a9a('0x24')](ewinston[_0x9a9a('0x18')]({'winstonInstance':_0xe37142,'meta':![],'statusLevels':!![],'msg':function(_0x1a366e,_0x4f5ff4){var _0x4d49b6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1a366e[_0x9a9a('0x1b')]&&_0x1a366e[_0x9a9a('0x1b')][_0x9a9a('0x25')]&&_0x1a366e[_0x9a9a('0x1b')]['agent_id']){_0x4d49b6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x9a9a('0x1d')](_0x4d49b6,_0x1a366e[_0x9a9a('0x1e')],_0x1a366e[_0x9a9a('0x1f')][_0x9a9a('0x20')]?_0x1a366e[_0x9a9a('0x1f')][_0x9a9a('0x20')]:_0x1a366e[_0x9a9a('0x21')][_0x9a9a('0x26')]||_0x1a366e['ip'],_0x1a366e[_0x9a9a('0x27')],_0x4f5ff4['statusCode'],_0x4f5ff4[_0x9a9a('0x22')],_0x1a366e[_0x9a9a('0x11')]?_0x1a366e[_0x9a9a('0x11')]['id']:null,_0x1a366e['user']?_0x1a366e[_0x9a9a('0x11')][_0x9a9a('0x23')]:null,_0x1a366e[_0x9a9a('0x11')]?_0x1a366e[_0x9a9a('0x11')][_0x9a9a('0xd')]:null,_0x1a366e[_0x9a9a('0x1b')]&&_0x1a366e['body']['device']?_0x1a366e[_0x9a9a('0x1b')]['device']:_0x9a9a('0x28'),_0x1a366e[_0x9a9a('0x1b')]&&_0x1a366e[_0x9a9a('0x1b')][_0x9a9a('0x29')]?_0x1a366e[_0x9a9a('0x1b')]['agent_id']:'',_0x1a366e[_0x9a9a('0x1b')]&&_0x1a366e[_0x9a9a('0x1b')][_0x9a9a('0x2a')]?_0x1a366e['body'][_0x9a9a('0x2a')]:'');},'ignoreRoute':function(_0x460a97){var _0x1d853f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1d853f['test'](_0x460a97[_0x9a9a('0x27')]);}}));return _0x416435();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xa4d9=['other','agent_name','test','setupLoggers','express-winston','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','then','user','data','catch','error','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','inspect','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)','connection'];(function(_0x515866,_0x288ed8){var _0x18fd28=function(_0x430574){while(--_0x430574){_0x515866['push'](_0x515866['shift']());}};_0x18fd28(++_0x288ed8);}(_0xa4d9,0x88));var _0x9a4d=function(_0x591c22,_0x342884){_0x591c22=_0x591c22-0x0;var _0x53d5a7=_0xa4d9[_0x591c22];return _0x53d5a7;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x9a4d('0x0'));var path=require(_0x9a4d('0x1'));var util=require(_0x9a4d('0x2'));var fileLogger=require('./loggers')[_0x9a4d('0x3')];var safeTemplate=require(_0x9a4d('0x4'))[_0x9a4d('0x5')];var maskSensitiveData=require(_0x9a4d('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x4c0ac4(_0xf39b19){var _0x3139b1=path[_0x9a4d('0x7')](_0x9a4d('0x8'),_0x9a4d('0x9'),_0x9a4d('0xa'));var _0x279e23=path[_0x9a4d('0x7')](_0x9a4d('0xb'),_0xf39b19[_0x9a4d('0xc')]+'-'+_0xf39b19[_0x9a4d('0xd')]);return fs[_0x9a4d('0xe')](path['join'](_0x3139b1,_0x279e23))[_0x9a4d('0xf')](function(){var _0x1e95e2=fileLogger(_0x9a4d('0xb'),path[_0x9a4d('0x7')](_0x3139b1,_0x279e23));return _0x1e95e2;})['catch'](function(_0x1b451a){throw _0x1b451a;});}this[_0x9a4d('0x9')]=function(_0x52825a,_0x487701,_0x4e7dfa,_0x5a6b3c){return _0x4c0ac4(_0x52825a[_0x9a4d('0x10')])[_0x9a4d('0xf')](function(_0x3bd6fe){var _0x56f807=_0x3bd6fe[_0x487701];return _0x56f807;})[_0x9a4d('0xf')](function(_0x3c9f98){var _0x85555a=_0x52825a[_0x9a4d('0x10')]?_0x52825a[_0x9a4d('0x10')]['id']:'no-user';var _0xe56392=_0x5a6b3c[_0x9a4d('0x11')];var _0x119ff8=_0x5a6b3c['timestamp'];var _0x3ef580=new Date(Number(_0x119ff8));return _0x3c9f98(_0x85555a,_0x3ef580,_0x4e7dfa,_0xe56392);})[_0x9a4d('0x12')](function(_0x4e9536){fileLogger(_0x9a4d('0xb'))[_0x9a4d('0x13')](_0x4e9536);});};}function setupLoggers(_0x59e2f1){return new Promise(function(_0x29b5ac){var _0x17f397=new ClientSideLogger();var _0x3ced97=fileLogger('api');var _0x220e0f=fileLogger(_0x9a4d('0x14'));_0x59e2f1[_0x9a4d('0x15')]('client-side-logger',_0x17f397);_0x59e2f1[_0x9a4d('0x16')](ewinston[_0x9a4d('0x17')]({'winstonInstance':_0x3ced97,'meta':![],'statusLevels':!![],'msg':function(_0x819086,_0x2b6221){var _0x57305c=_0x9a4d('0x18');if(!_['isEmpty'](_0x819086[_0x9a4d('0x19')])){_0x57305c+=_0x9a4d('0x1a');var _0x56f160=_0x819086['body'];maskSensitiveData(_0x56f160);}return safeTemplate(util[_0x9a4d('0x1b')](_0x57305c,_0x819086[_0x9a4d('0x1c')],_0x819086[_0x9a4d('0x1d')][_0x9a4d('0x1e')]?_0x819086[_0x9a4d('0x1d')][_0x9a4d('0x1e')]:_0x819086['connection'][_0x9a4d('0x1f')]||_0x819086['ip'],_0x819086[_0x9a4d('0x20')],_0x2b6221[_0x9a4d('0x21')],_0x2b6221[_0x9a4d('0x22')],_0x819086['user']?_0x819086[_0x9a4d('0x10')]['id']:null,_0x819086[_0x9a4d('0x10')]?_0x819086[_0x9a4d('0x10')]['name']:null,_0x819086[_0x9a4d('0x10')]?_0x819086[_0x9a4d('0x10')][_0x9a4d('0xc')]:null,_0x56f160?util[_0x9a4d('0x23')](_0x56f160,![],null):''));}}));_0x59e2f1['use'](ewinston[_0x9a4d('0x17')]({'winstonInstance':_0x220e0f,'meta':![],'statusLevels':!![],'msg':function(_0x486c36,_0x1a74e0){var _0x5d7bcb='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x486c36[_0x9a4d('0x19')]&&_0x486c36['body'][_0x9a4d('0x24')]&&_0x486c36[_0x9a4d('0x19')][_0x9a4d('0x25')]){_0x5d7bcb=_0x9a4d('0x26');}return util[_0x9a4d('0x1b')](_0x5d7bcb,_0x486c36['method'],_0x486c36[_0x9a4d('0x1d')][_0x9a4d('0x1e')]?_0x486c36['headers'][_0x9a4d('0x1e')]:_0x486c36[_0x9a4d('0x27')][_0x9a4d('0x1f')]||_0x486c36['ip'],_0x486c36['url'],_0x1a74e0[_0x9a4d('0x21')],_0x1a74e0[_0x9a4d('0x22')],_0x486c36[_0x9a4d('0x10')]?_0x486c36['user']['id']:null,_0x486c36['user']?_0x486c36[_0x9a4d('0x10')][_0x9a4d('0xd')]:null,_0x486c36[_0x9a4d('0x10')]?_0x486c36[_0x9a4d('0x10')][_0x9a4d('0xc')]:null,_0x486c36[_0x9a4d('0x19')]&&_0x486c36['body'][_0x9a4d('0x24')]?_0x486c36[_0x9a4d('0x19')][_0x9a4d('0x24')]:_0x9a4d('0x28'),_0x486c36[_0x9a4d('0x19')]&&_0x486c36[_0x9a4d('0x19')][_0x9a4d('0x25')]?_0x486c36[_0x9a4d('0x19')][_0x9a4d('0x25')]:'',_0x486c36[_0x9a4d('0x19')]&&_0x486c36[_0x9a4d('0x19')][_0x9a4d('0x29')]?_0x486c36['body']['agent_name']:'');},'ignoreRoute':function(_0x4846f2){var _0x58b05f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x58b05f[_0x9a4d('0x2a')](_0x4846f2['url']);}}));return _0x29b5ac();});}exports[_0x9a4d('0x2b')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 646fd35..daaec53 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbec=['guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','minutes','clone','hours','isBefore','endOf','day','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','max','min','domCompare','MMM','monthCompare'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0xbbec,0x180));var _0xcbbe=function(_0x13eea0,_0x40ad68){_0x13eea0=_0x13eea0-0x0;var _0x5a2e49=_0xbbec[_0x13eea0];return _0x5a2e49;};var _=require(_0xcbbe('0x0'));var moment=require(_0xcbbe('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][_0xcbbe('0x2')](function(_0x5d36fc){return _0x5d36fc['source'];})[_0xcbbe('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xcbbe('0x4');var EINVALID_DATE=_0xcbbe('0x5');function throwIfDateNotValid(_0x143a51){if(!_0x143a51[_0xcbbe('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3e0c2e){var _0xb7baa5=_0x3e0c2e[_0xcbbe('0x7')](':')[_0xcbbe('0x2')](function(_0x358d97){return parseInt(_0x358d97,0xa);});var _0x5db1e3=_0xb7baa5[0x0];var _0x285ce5=_0xb7baa5[0x1];if(_0x5db1e3<0x0||_0x5db1e3>0x17||_0x285ce5<0x0||_0x285ce5>0x3b){throw new Error(EINVALID_DATE);}return[_0x5db1e3,_0x285ce5];}function circularDoWInterval(_0x370644,_0x55f81f){if(_0x370644===_0x55f81f){return[_0x370644];}else{var _0x17ae20=moment['locale']();moment[_0xcbbe('0x8')]('en');var _0x359e7c=moment[_0xcbbe('0x9')]()[_0xcbbe('0x2')](function(_0xb70a27){return _0xb70a27[_0xcbbe('0xa')]();});moment[_0xcbbe('0x8')](_0x17ae20);var _0x3f9e20=_0x359e7c[_0xcbbe('0xb')](_0x370644);var _0x28b60c=_0x359e7c['indexOf'](_0x55f81f);if(_0x28b60c>_0x3f9e20){return _0x359e7c[_0xcbbe('0xc')](_0x3f9e20,_0x28b60c+0x1);}else{var _0x332c99=_0x359e7c[_0xcbbe('0xc')](0x0,_0x28b60c+0x1);var _0x18ae53=_0x359e7c['slice'](_0x3f9e20);return _0x18ae53[_0xcbbe('0xd')](_0x332c99);}}}module[_0xcbbe('0xe')][_0xcbbe('0xf')]=circularDoWInterval;function circularMonthInterval(_0x2a52f4,_0x41eef4){if(_0x2a52f4===_0x41eef4){return[_0x2a52f4];}else{var _0x3fed84=moment[_0xcbbe('0x8')]();moment['locale']('en');var _0x2c018e=moment[_0xcbbe('0x10')]()[_0xcbbe('0x2')](function(_0x3b8dab){return _0x3b8dab[_0xcbbe('0xa')]();});moment[_0xcbbe('0x8')](_0x3fed84);var _0x54fe60=_0x2c018e[_0xcbbe('0xb')](_0x2a52f4);var _0x5d5828=_0x2c018e['indexOf'](_0x41eef4);if(_0x5d5828>_0x54fe60){return _0x2c018e[_0xcbbe('0xc')](_0x54fe60,_0x5d5828+0x1);}else{var _0x315964=_0x2c018e[_0xcbbe('0xc')](0x0,_0x5d5828+0x1);var _0x15720a=_0x2c018e[_0xcbbe('0xc')](_0x54fe60);return _0x15720a[_0xcbbe('0xd')](_0x315964);}}}module[_0xcbbe('0xe')][_0xcbbe('0x11')]=circularMonthInterval;function parseDom(_0x854f49){var _0x571bea=parseInt(_0x854f49,0xa);if(_0x571bea<0x1||_0x571bea>0x1f){throw new Error(EINVALID_DATE);}return _0x571bea;}function timeCompare(_0x3096d9,_0x33741b,_0x36f9c9){var _0x364b2a=_0x3096d9['clone']();var _0x26ad4c=extractTime(_0x33741b);var _0x2a08a7=_0x26ad4c[0x0];var _0x4f87bd=_0x26ad4c[0x1];var _0x35676c=_0x3096d9['clone']()['hours'](_0x2a08a7)[_0xcbbe('0x12')](_0x4f87bd);throwIfDateNotValid(_0x35676c);var _0x2f5248=extractTime(_0x36f9c9);var _0x3ef2d0=_0x2f5248[0x0];var _0x10d7f3=_0x2f5248[0x1];var _0x37b503=_0x3096d9[_0xcbbe('0x13')]()[_0xcbbe('0x14')](_0x3ef2d0)[_0xcbbe('0x12')](_0x10d7f3);throwIfDateNotValid(_0x37b503);if(_0x37b503[_0xcbbe('0x15')](_0x35676c)){var _0x1a9c58=_0x364b2a[_0xcbbe('0x13')]()['startOf']('day');var _0x49be9d=_0x364b2a[_0xcbbe('0x13')]()[_0xcbbe('0x16')](_0xcbbe('0x17'));return _0x364b2a[_0xcbbe('0x18')](_0x35676c,_0x49be9d,undefined,'[]')||_0x364b2a['isBetween'](_0x1a9c58,_0x37b503,undefined,'[]');}else{return _0x364b2a[_0xcbbe('0x18')](_0x35676c,_0x37b503,undefined,'[]');}}module['exports'][_0xcbbe('0x19')]=timeCompare;function dowCompare(_0x469bac,_0x40a8b2,_0x56e285){var _0x3aa07c=_0x469bac[_0xcbbe('0x8')]('en')[_0xcbbe('0x1a')](_0xcbbe('0x1b'))['toLowerCase']();return circularDoWInterval(_0x40a8b2,_0x56e285)[_0xcbbe('0x1c')](_0x3aa07c);}module[_0xcbbe('0xe')]['dowCompare']=dowCompare;function domCompare(_0x4271ac,_0xccb203,_0x2b3f48){var _0x296862=_0x4271ac[_0xcbbe('0x1d')]();if(_0xccb203===_0x2b3f48){return _0x296862===_0xccb203;}else{var _0x333b49=_0x4271ac[_0xcbbe('0x1e')]();var _0x1838ce=_0xccb203<_0x2b3f48;let _0x3fa628=![];var _0x50cfaf=0x0;var _0x1772d9=0x0;if(_0x1838ce){_0x50cfaf=Math[_0xcbbe('0x1f')](0x1,_0xccb203);_0x1772d9=Math[_0xcbbe('0x20')](_0x2b3f48,_0x333b49);_0x3fa628=_0x296862>=_0x50cfaf&&_0x296862<=_0x1772d9;}else{_0x50cfaf=Math[_0xcbbe('0x20')](_0xccb203,_0x333b49);_0x1772d9=Math[_0xcbbe('0x1f')](0x1,_0x2b3f48);_0x3fa628=_0x296862>=_0x50cfaf||_0x296862<=_0x1772d9;}return _0x3fa628;}}module[_0xcbbe('0xe')][_0xcbbe('0x21')]=domCompare;function monthCompare(_0x59c221,_0x37ff79,_0x1dc044){var _0x555ac5=_0x59c221[_0xcbbe('0x8')]('en')[_0xcbbe('0x1a')](_0xcbbe('0x22'))[_0xcbbe('0xa')]();return circularMonthInterval(_0x37ff79,_0x1dc044)['includes'](_0x555ac5);}module[_0xcbbe('0xe')][_0xcbbe('0x23')]=monthCompare;function iftime(_0xa525e4,_0x1f25b4=moment['tz'][_0xcbbe('0x24')](),_0xb863cd=moment()){if(!validateRx[_0xcbbe('0x25')](_0xa525e4)){throw new Error(EINVALID_STRING);}else{var _0xee07e0=(moment[_0xcbbe('0x26')](_0xb863cd)?_0xb863cd[_0xcbbe('0x13')]():moment(_0xb863cd))['tz'](_0x1f25b4)[_0xcbbe('0x8')]('en');throwIfDateNotValid(_0xee07e0);var _0x459626=_0xa525e4[_0xcbbe('0x7')](',');var _0x1c8bd5=_0x459626[0x0];var _0x2696e2=_0x459626[0x1];var _0x40994d=_0x459626[0x2];var _0x401058=_0x459626[0x3];let _0x37bd69=!![];if(_0x1c8bd5!=='*'){var _0x264074=_0x1c8bd5[_0xcbbe('0x7')]('-');var _0xb5532b=_[_0xcbbe('0x27')](_0x264074[0x0],0x5,'0');var _0x4a04a4=_0x264074[_0xcbbe('0x28')]===0x2?_['padStart'](_0x264074[0x1],0x5,'0'):_0xb5532b;_0x37bd69=timeCompare(_0xee07e0,_0xb5532b,_0x4a04a4);}let _0x3d82a7=!![];if(_0x2696e2!=='*'){var _0x36ed02=_0x2696e2[_0xcbbe('0x7')]('-');var _0x33376e=_0x36ed02[0x0];var _0x574c9a=_0x36ed02[_0xcbbe('0x28')]===0x2?_0x36ed02[0x1]:_0x33376e;_0x3d82a7=dowCompare(_0xee07e0,_0x33376e,_0x574c9a);}let _0x4e55b0=!![];if(_0x40994d!=='*'){var _0x5b6a15=_0x40994d[_0xcbbe('0x7')]('-');var _0x1c054a=parseDom(_0x5b6a15[0x0]);var _0x5632ad=_0x5b6a15[_0xcbbe('0x28')]===0x2?parseDom(_0x5b6a15[0x1]):_0x1c054a;_0x4e55b0=domCompare(_0xee07e0,_0x1c054a,_0x5632ad);}let _0x3efd70=!![];if(_0x401058!=='*'){var _0x34ef8f=_0x401058[_0xcbbe('0x7')]('-');var _0x127015=_0x34ef8f[0x0];var _0x456e65=_0x34ef8f[_0xcbbe('0x28')]===0x2?_0x34ef8f[0x1]:_0x34ef8f[0x0];_0x3efd70=monthCompare(_0xee07e0,_0x127015,_0x456e65);}return _0x37bd69&&_0x3d82a7&&_0x4e55b0&&_0x3efd70;}}module[_0xcbbe('0xe')][_0xcbbe('0x29')]=iftime; \ No newline at end of file +var _0x1045=['lodash','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','toLowerCase','indexOf','slice','concat','exports','monthsShort','circularMonthInterval','clone','minutes','hours','isBefore','day','endOf','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime'];(function(_0x14915d,_0x46bdd6){var _0x4852d8=function(_0x5c46fc){while(--_0x5c46fc){_0x14915d['push'](_0x14915d['shift']());}};_0x4852d8(++_0x46bdd6);}(_0x1045,0xbe));var _0x5104=function(_0x3aaaef,_0x17845c){_0x3aaaef=_0x3aaaef-0x0;var _0x287b68=_0x1045[_0x3aaaef];return _0x287b68;};var _=require(_0x5104('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x9fdd95){return _0x9fdd95[_0x5104('0x1')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5104('0x2');var EINVALID_DATE=_0x5104('0x3');function throwIfDateNotValid(_0xd770c0){if(!_0xd770c0['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3d8029){var _0xa06f76=_0x3d8029[_0x5104('0x4')](':')[_0x5104('0x5')](function(_0x303650){return parseInt(_0x303650,0xa);});var _0xc6839a=_0xa06f76[0x0];var _0x3f4168=_0xa06f76[0x1];if(_0xc6839a<0x0||_0xc6839a>0x17||_0x3f4168<0x0||_0x3f4168>0x3b){throw new Error(EINVALID_DATE);}return[_0xc6839a,_0x3f4168];}function circularDoWInterval(_0x1ed199,_0x1dcc80){if(_0x1ed199===_0x1dcc80){return[_0x1ed199];}else{var _0x76e68c=moment[_0x5104('0x6')]();moment['locale']('en');var _0x4c74f6=moment['weekdaysShort']()['map'](function(_0x23dea6){return _0x23dea6[_0x5104('0x7')]();});moment['locale'](_0x76e68c);var _0x473efc=_0x4c74f6['indexOf'](_0x1ed199);var _0x4e117e=_0x4c74f6[_0x5104('0x8')](_0x1dcc80);if(_0x4e117e>_0x473efc){return _0x4c74f6['slice'](_0x473efc,_0x4e117e+0x1);}else{var _0x5b7988=_0x4c74f6[_0x5104('0x9')](0x0,_0x4e117e+0x1);var _0x24e840=_0x4c74f6['slice'](_0x473efc);return _0x24e840[_0x5104('0xa')](_0x5b7988);}}}module[_0x5104('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x3ff52e,_0x4b1246){if(_0x3ff52e===_0x4b1246){return[_0x3ff52e];}else{var _0xc4d399=moment[_0x5104('0x6')]();moment[_0x5104('0x6')]('en');var _0x1c6b0a=moment[_0x5104('0xc')]()[_0x5104('0x5')](function(_0x12faf8){return _0x12faf8[_0x5104('0x7')]();});moment[_0x5104('0x6')](_0xc4d399);var _0xc81904=_0x1c6b0a[_0x5104('0x8')](_0x3ff52e);var _0x5f5aae=_0x1c6b0a['indexOf'](_0x4b1246);if(_0x5f5aae>_0xc81904){return _0x1c6b0a['slice'](_0xc81904,_0x5f5aae+0x1);}else{var _0x1620d7=_0x1c6b0a[_0x5104('0x9')](0x0,_0x5f5aae+0x1);var _0x3dcbb2=_0x1c6b0a['slice'](_0xc81904);return _0x3dcbb2[_0x5104('0xa')](_0x1620d7);}}}module[_0x5104('0xb')][_0x5104('0xd')]=circularMonthInterval;function parseDom(_0x45d47f){var _0x30bb3d=parseInt(_0x45d47f,0xa);if(_0x30bb3d<0x1||_0x30bb3d>0x1f){throw new Error(EINVALID_DATE);}return _0x30bb3d;}function timeCompare(_0x11d867,_0x1cb4ab,_0x1015df){var _0x14a02b=_0x11d867[_0x5104('0xe')]();var _0x2c2144=extractTime(_0x1cb4ab);var _0x5d79d2=_0x2c2144[0x0];var _0x3a731f=_0x2c2144[0x1];var _0x1860e9=_0x11d867[_0x5104('0xe')]()['hours'](_0x5d79d2)[_0x5104('0xf')](_0x3a731f);throwIfDateNotValid(_0x1860e9);var _0x28dfba=extractTime(_0x1015df);var _0xa4c018=_0x28dfba[0x0];var _0x28062e=_0x28dfba[0x1];var _0x3be607=_0x11d867[_0x5104('0xe')]()[_0x5104('0x10')](_0xa4c018)[_0x5104('0xf')](_0x28062e);throwIfDateNotValid(_0x3be607);if(_0x3be607[_0x5104('0x11')](_0x1860e9)){var _0x244a4d=_0x14a02b['clone']()['startOf'](_0x5104('0x12'));var _0x2db374=_0x14a02b[_0x5104('0xe')]()[_0x5104('0x13')](_0x5104('0x12'));return _0x14a02b[_0x5104('0x14')](_0x1860e9,_0x2db374,undefined,'[]')||_0x14a02b[_0x5104('0x14')](_0x244a4d,_0x3be607,undefined,'[]');}else{return _0x14a02b['isBetween'](_0x1860e9,_0x3be607,undefined,'[]');}}module['exports'][_0x5104('0x15')]=timeCompare;function dowCompare(_0xf51ac8,_0x37c781,_0x5417a4){var _0x39d5b7=_0xf51ac8[_0x5104('0x6')]('en')[_0x5104('0x16')](_0x5104('0x17'))[_0x5104('0x7')]();return circularDoWInterval(_0x37c781,_0x5417a4)[_0x5104('0x18')](_0x39d5b7);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x22c530,_0x47e61f,_0x3557af){var _0x50db11=_0x22c530[_0x5104('0x19')]();if(_0x47e61f===_0x3557af){return _0x50db11===_0x47e61f;}else{var _0x48bce0=_0x22c530[_0x5104('0x1a')]();var _0x440bd4=_0x47e61f<_0x3557af;let _0x98d17f=![];var _0x21bad1=0x0;var _0x218b57=0x0;if(_0x440bd4){_0x21bad1=Math[_0x5104('0x1b')](0x1,_0x47e61f);_0x218b57=Math[_0x5104('0x1c')](_0x3557af,_0x48bce0);_0x98d17f=_0x50db11>=_0x21bad1&&_0x50db11<=_0x218b57;}else{_0x21bad1=Math[_0x5104('0x1c')](_0x47e61f,_0x48bce0);_0x218b57=Math['max'](0x1,_0x3557af);_0x98d17f=_0x50db11>=_0x21bad1||_0x50db11<=_0x218b57;}return _0x98d17f;}}module[_0x5104('0xb')][_0x5104('0x1d')]=domCompare;function monthCompare(_0x1b5fb9,_0x30b79b,_0x180cb2){var _0x4bc445=_0x1b5fb9['locale']('en')[_0x5104('0x16')](_0x5104('0x1e'))[_0x5104('0x7')]();return circularMonthInterval(_0x30b79b,_0x180cb2)[_0x5104('0x18')](_0x4bc445);}module[_0x5104('0xb')][_0x5104('0x1f')]=monthCompare;function iftime(_0x223f03,_0x3824fb=moment['tz'][_0x5104('0x20')](),_0x5d1ec1=moment()){if(!validateRx[_0x5104('0x21')](_0x223f03)){throw new Error(EINVALID_STRING);}else{var _0x56ca6b=(moment[_0x5104('0x22')](_0x5d1ec1)?_0x5d1ec1[_0x5104('0xe')]():moment(_0x5d1ec1))['tz'](_0x3824fb)[_0x5104('0x6')]('en');throwIfDateNotValid(_0x56ca6b);var _0x103a1c=_0x223f03[_0x5104('0x4')](',');var _0x2d6219=_0x103a1c[0x0];var _0x4a9153=_0x103a1c[0x1];var _0x4ea44b=_0x103a1c[0x2];var _0x16a851=_0x103a1c[0x3];let _0x4ba648=!![];if(_0x2d6219!=='*'){var _0x100590=_0x2d6219[_0x5104('0x4')]('-');var _0x2c740e=_[_0x5104('0x23')](_0x100590[0x0],0x5,'0');var _0x59e5e1=_0x100590[_0x5104('0x24')]===0x2?_[_0x5104('0x23')](_0x100590[0x1],0x5,'0'):_0x2c740e;_0x4ba648=timeCompare(_0x56ca6b,_0x2c740e,_0x59e5e1);}let _0x18d6bb=!![];if(_0x4a9153!=='*'){var _0x48f866=_0x4a9153[_0x5104('0x4')]('-');var _0x416279=_0x48f866[0x0];var _0x10df91=_0x48f866['length']===0x2?_0x48f866[0x1]:_0x416279;_0x18d6bb=dowCompare(_0x56ca6b,_0x416279,_0x10df91);}let _0x16ef30=!![];if(_0x4ea44b!=='*'){var _0x342a94=_0x4ea44b['split']('-');var _0x2c0513=parseDom(_0x342a94[0x0]);var _0x1210ce=_0x342a94[_0x5104('0x24')]===0x2?parseDom(_0x342a94[0x1]):_0x2c0513;_0x16ef30=domCompare(_0x56ca6b,_0x2c0513,_0x1210ce);}let _0x5081bb=!![];if(_0x16a851!=='*'){var _0x1a77e8=_0x16a851[_0x5104('0x4')]('-');var _0x35ff1c=_0x1a77e8[0x0];var _0xf54309=_0x1a77e8[_0x5104('0x24')]===0x2?_0x1a77e8[0x1]:_0x1a77e8[0x0];_0x5081bb=monthCompare(_0x56ca6b,_0x35ff1c,_0xf54309);}return _0x4ba648&&_0x18d6bb&&_0x16ef30&&_0x5081bb;}}module[_0x5104('0xb')][_0x5104('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 6c988a4..9a4d128 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4e2=['debugLevel','toLowerCase','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0xe4e2,0xe5));var _0x2e4e=function(_0x1843b2,_0x15cfd4){_0x1843b2=_0x1843b2-0x0;var _0x2d070d=_0xe4e2[_0x1843b2];return _0x2d070d;};'use strict';var path=require(_0x2e4e('0x0'));var util=require(_0x2e4e('0x1'));var moment=require(_0x2e4e('0x2'));var winston=require(_0x2e4e('0x3'));var config=require(_0x2e4e('0x4'));var debugLevel=config[_0x2e4e('0x5')]?config[_0x2e4e('0x5')][_0x2e4e('0x6')]():'info';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':_0x2e4e('0x7'),'error':'red','warn':_0x2e4e('0x8'),'info':_0x2e4e('0x9'),'print':_0x2e4e('0xa'),'success':_0x2e4e('0xb'),'http':_0x2e4e('0xc'),'verbose':_0x2e4e('0xd'),'debug':_0x2e4e('0xe'),'silly':_0x2e4e('0xf')};winston[_0x2e4e('0x10')](XC_LOG_COLORS);function getLogFileName(_0x59421f,_0x26f9c2,_0x390fb7){var _0x43076f=_0x59421f||_0x2e4e('0x11');return path['join'](_0x43076f,util[_0x2e4e('0x12')]('%s-%s.log',_0x26f9c2,_0x390fb7));}function formatter(_0x52a31d,_0xd0afd0){_0xd0afd0[_0x2e4e('0x13')]=_0xd0afd0[_0x2e4e('0x13')]['replace'](/@@{/g,'{{{')[_0x2e4e('0x14')](/}@@/g,_0x2e4e('0x15'))[_0x2e4e('0x14')](/@{/g,'{{')[_0x2e4e('0x14')](/}@/g,'}}');return util['format'](_0x2e4e('0x16'),moment()[_0x2e4e('0x12')](_0x2e4e('0x17')),_0xd0afd0[_0x2e4e('0x18')][_0x2e4e('0x19')](),_0x52a31d,_0xd0afd0[_0x2e4e('0x13')]);}function fileFormat(_0xddc0c2,_0x468b63){_0x468b63['message']=_0x468b63[_0x2e4e('0x13')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x2e4e('0x15'))[_0x2e4e('0x14')](/@{/g,'{{')[_0x2e4e('0x14')](/}@/g,'}}');var _0x54bb5e=_0x468b63[_0x2e4e('0x1a')]&&Object[_0x2e4e('0x1b')](_0x468b63['meta'])['length']?'\x0a\x09'+JSON[_0x2e4e('0x1c')](_0x468b63[_0x2e4e('0x1a')]):'';return util[_0x2e4e('0x12')](_0x2e4e('0x1d'),moment()[_0x2e4e('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),_0x468b63['level']['toUpperCase'](),_0xddc0c2,_0x468b63[_0x2e4e('0x13')],_0x54bb5e);}function consoleLogger(){var _0x1fec4d=new winston[(_0x2e4e('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2e4e('0x1f'))]['Console']({'level':_0x2e4e('0x20'),'json':![],'formatter':function(_0x133837){return formatter('',_0x133837);}})]});return _0x1fec4d;}function fileLogger(_0x27a847,_0x390abf){var _0x59c43f=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2e4e('0x1f'))][(_0x2e4e('0x21'))]({'name':util['format'](_0x2e4e('0x22'),_0x27a847,_0x2e4e('0x23')),'filename':getLogFileName(_0x390abf,_0x27a847,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x120dbc){return fileFormat(_0x27a847,_0x120dbc);}}),new winston[(_0x2e4e('0x1f'))][(_0x2e4e('0x21'))]({'name':util[_0x2e4e('0x12')](_0x2e4e('0x22'),_0x27a847,debugLevel),'filename':getLogFileName(_0x390abf,_0x27a847,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbafd30){return fileFormat(_0x27a847,_0xbafd30);}}),new winston['transports'][(_0x2e4e('0x24'))]({'level':'warn','json':![],'formatter':function(_0x2387bf){return fileFormat(_0x27a847,_0x2387bf);}})]});return _0x59c43f;}exports[_0x2e4e('0x25')]=consoleLogger;exports[_0x2e4e('0x26')]=fileLogger; \ No newline at end of file +var _0xb33a=['join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','level','Logger','transports','Console','warn','%s-%s','error','File','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally'];(function(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xb33a,0x188));var _0xab33=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xb33a[_0x26b622];return _0x58a028;};'use strict';var path=require(_0xab33('0x0'));var util=require(_0xab33('0x1'));var moment=require(_0xab33('0x2'));var winston=require(_0xab33('0x3'));var config=require(_0xab33('0x4'));var debugLevel=config[_0xab33('0x5')]?config[_0xab33('0x5')][_0xab33('0x6')]():_0xab33('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':_0xab33('0x8'),'error':_0xab33('0x9'),'warn':_0xab33('0xa'),'info':_0xab33('0xb'),'print':'bold\x20white','success':_0xab33('0xc'),'http':_0xab33('0xd'),'verbose':_0xab33('0xe'),'debug':'bold\x20blue','silly':_0xab33('0xf')};winston[_0xab33('0x10')](XC_LOG_COLORS);function getLogFileName(_0x24e761,_0x56c51d,_0x2fd47e){var _0x432536=_0x24e761||_0xab33('0x11');return path[_0xab33('0x12')](_0x432536,util[_0xab33('0x13')](_0xab33('0x14'),_0x56c51d,_0x2fd47e));}function formatter(_0x313b70,_0x4bae3f){_0x4bae3f[_0xab33('0x15')]=_0x4bae3f[_0xab33('0x15')][_0xab33('0x16')](/@@{/g,_0xab33('0x17'))[_0xab33('0x16')](/}@@/g,_0xab33('0x18'))[_0xab33('0x16')](/@{/g,'{{')[_0xab33('0x16')](/}@/g,'}}');return util[_0xab33('0x13')](_0xab33('0x19'),moment()[_0xab33('0x13')](_0xab33('0x1a')),_0x4bae3f['level'][_0xab33('0x1b')](),_0x313b70,_0x4bae3f[_0xab33('0x15')]);}function fileFormat(_0x49b5cb,_0x478478){_0x478478[_0xab33('0x15')]=_0x478478[_0xab33('0x15')][_0xab33('0x16')](/@@{/g,_0xab33('0x17'))[_0xab33('0x16')](/}@@/g,'}}}')[_0xab33('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x578302=_0x478478[_0xab33('0x1c')]&&Object[_0xab33('0x1d')](_0x478478[_0xab33('0x1c')])[_0xab33('0x1e')]?'\x0a\x09'+JSON[_0xab33('0x1f')](_0x478478[_0xab33('0x1c')]):'';return util[_0xab33('0x13')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xab33('0x13')](_0xab33('0x1a')),_0x478478[_0xab33('0x20')][_0xab33('0x1b')](),_0x49b5cb,_0x478478[_0xab33('0x15')],_0x578302);}function consoleLogger(){var _0x571fa9=new winston[(_0xab33('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xab33('0x22'))][(_0xab33('0x23'))]({'level':_0xab33('0x24'),'json':![],'formatter':function(_0x4f095d){return formatter('',_0x4f095d);}})]});return _0x571fa9;}function fileLogger(_0x4b5b41,_0x5df7f3){var _0x11dea8=new winston[(_0xab33('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xab33('0x22'))]['File']({'name':util[_0xab33('0x13')](_0xab33('0x25'),_0x4b5b41,_0xab33('0x26')),'filename':getLogFileName(_0x5df7f3,_0x4b5b41,_0xab33('0x26')),'level':_0xab33('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38506f){return fileFormat(_0x4b5b41,_0x38506f);}}),new winston[(_0xab33('0x22'))][(_0xab33('0x27'))]({'name':util['format'](_0xab33('0x25'),_0x4b5b41,debugLevel),'filename':getLogFileName(_0x5df7f3,_0x4b5b41,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4eb691){return fileFormat(_0x4b5b41,_0x4eb691);}}),new winston[(_0xab33('0x22'))]['Console']({'level':_0xab33('0x24'),'json':![],'formatter':function(_0x44ec8c){return fileFormat(_0x4b5b41,_0x44ec8c);}})]});return _0x11dea8;}exports['consoleLogger']=consoleLogger;exports[_0xab33('0x28')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 7446fc6..2a0fe9d 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 _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4975,0x86));var _0x5497=function(_0x1ae401,_0x5af4eb){_0x1ae401=_0x1ae401-0x0;var _0x412378=_0x4975[_0x1ae401];return _0x412378;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file +var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x57ca,0x108));var _0xa57c=function(_0x1269f8,_0xf0b86b){_0x1269f8=_0x1269f8-0x0;var _0x441e03=_0x57ca[_0x1269f8];return _0x441e03;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 58b593e..12a55c3 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 _0x5c3c=['\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce','safeTemplate','lodash','{\x20{\x20'];(function(_0x4b2fc5,_0x3948ee){var _0x506fa7=function(_0x23b3cd){while(--_0x23b3cd){_0x4b2fc5['push'](_0x4b2fc5['shift']());}};_0x506fa7(++_0x3948ee);}(_0x5c3c,0x132));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};var _=require(_0xc5c3('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x40ad71){return _0x40ad71==='{{'?_0xc5c3('0x1'):_0xc5c3('0x2');}function safeTemplate(_0x4b9233){var _0x400726=_0x4b9233;if(typeof _0x4b9233===_0xc5c3('0x3')){_0x400726=_0x4b9233[_0xc5c3('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc5c3('0x5')](_0x4b9233)){_0x400726=_0x4b9233[_0xc5c3('0x6')](function(_0x36525d){return safeTemplate(_0x36525d);});}else if(_[_0xc5c3('0x7')](_0x4b9233)){_0x400726=Object[_0xc5c3('0x8')](_0x4b9233)[_0xc5c3('0x9')](function(_0x5a392b,_0x4b8404){_0x5a392b[_0x4b8404]=safeTemplate(_0x4b9233[_0x4b8404]);return _0x5a392b;},{});}return _0x400726;}module['exports'][_0xc5c3('0xa')]=safeTemplate; \ No newline at end of file +var _0xb10b=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x538a7e,_0x2d2733){var _0x3ac90f=function(_0x3ab40a){while(--_0x3ab40a){_0x538a7e['push'](_0x538a7e['shift']());}};_0x3ac90f(++_0x2d2733);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ff332,_0x145564){_0x3ff332=_0x3ff332-0x0;var _0x5a2264=_0xb10b[_0x3ff332];return _0x5a2264;};var _=require(_0xbb10('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4bb7bb){return _0x4bb7bb==='{{'?_0xbb10('0x1'):_0xbb10('0x2');}function safeTemplate(_0x1dcb08){var _0x4d688c=_0x1dcb08;if(typeof _0x1dcb08===_0xbb10('0x3')){_0x4d688c=_0x1dcb08[_0xbb10('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xbb10('0x5')](_0x1dcb08)){_0x4d688c=_0x1dcb08[_0xbb10('0x6')](function(_0x49baf4){return safeTemplate(_0x49baf4);});}else if(_[_0xbb10('0x7')](_0x1dcb08)){_0x4d688c=Object['keys'](_0x1dcb08)[_0xbb10('0x8')](function(_0x3cdd53,_0x513741){_0x3cdd53[_0x513741]=safeTemplate(_0x1dcb08[_0x513741]);return _0x3cdd53;},{});}return _0x4d688c;}module[_0xbb10('0x9')][_0xbb10('0xa')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 99068b8..b9af092 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x366b=['then','readJSON','updated','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x366b,0xb6));var _0xb366=function(_0x4d4611,_0x5907aa){_0x4d4611=_0x4d4611-0x0;var _0x15d1f0=_0x366b[_0x4d4611];return _0x15d1f0;};var fs=require(_0xb366('0x0'));var path=require(_0xb366('0x1'));var config=require(_0xb366('0x2'));var root=config[_0xb366('0x3')];var APP_JSON_PATH=path[_0xb366('0x4')](root,_0xb366('0x5'));var NODEPATH=path[_0xb366('0x4')](root,_0xb366('0x6'));function setLegacyLibsNodeEnvPath(_0x5ec9a5){let _0x307f1f=![];if(Array[_0xb366('0x7')](_0x5ec9a5[_0xb366('0x8')])){var _0x1c09e4=_0x5ec9a5[_0xb366('0x8')][_0xb366('0x9')](function(_0x5e0888){return _0x5e0888[_0xb366('0xa')]===_0xb366('0xb');});if(_0x1c09e4>-0x1){var _0x41afde=_0x5ec9a5['apps'][_0x1c09e4];if(typeof _0x41afde[_0xb366('0xc')][_0xb366('0xd')]!==_0xb366('0xe')){_0x41afde[_0xb366('0xc')]['NODE_PATH']=NODEPATH;_0x307f1f=!![];}}return{'appConfig':_0x5ec9a5,'updated':_0x307f1f};}}function updateAppConfig(_0x3cb32b){return fs[_0xb366('0xf')](APP_JSON_PATH)[_0xb366('0x10')](function(_0x368e17){if(_0x368e17){return fs[_0xb366('0x11')](APP_JSON_PATH)['then'](function(_0x6a8b1c){var _0x1243a3=setLegacyLibsNodeEnvPath(_0x6a8b1c);if(_0x1243a3[_0xb366('0x12')]){_0x3cb32b['info'](_0xb366('0x13'));return fs[_0xb366('0x14')](APP_JSON_PATH,_0x6a8b1c,{'spaces':0x2});}else{return Promise[_0xb366('0x4')]();}});}else{return Promise[_0xb366('0x4')]();}});}module[_0xb366('0x15')]=updateAppConfig; \ No newline at end of file +var _0x23f9=['root','resolve','server/app.json','legacy-libs','isArray','apps','motion2','env','NODE_PATH','string','pathExists','then','updated','info','writeJSON','exports','fs-extra'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x23f9,0x1ec));var _0x923f=function(_0x5d7f3e,_0x50fa6a){_0x5d7f3e=_0x5d7f3e-0x0;var _0x1d4fae=_0x23f9[_0x5d7f3e];return _0x1d4fae;};var fs=require(_0x923f('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0x923f('0x1')];var APP_JSON_PATH=path[_0x923f('0x2')](root,_0x923f('0x3'));var NODEPATH=path[_0x923f('0x2')](root,_0x923f('0x4'));function setLegacyLibsNodeEnvPath(_0x25d45d){let _0x210e1b=![];if(Array[_0x923f('0x5')](_0x25d45d[_0x923f('0x6')])){var _0x3951d4=_0x25d45d['apps']['findIndex'](function(_0x33d4fa){return _0x33d4fa['name']===_0x923f('0x7');});if(_0x3951d4>-0x1){var _0x231f78=_0x25d45d[_0x923f('0x6')][_0x3951d4];if(typeof _0x231f78[_0x923f('0x8')][_0x923f('0x9')]!==_0x923f('0xa')){_0x231f78[_0x923f('0x8')][_0x923f('0x9')]=NODEPATH;_0x210e1b=!![];}}return{'appConfig':_0x25d45d,'updated':_0x210e1b};}}function updateAppConfig(_0x1b1917){return fs[_0x923f('0xb')](APP_JSON_PATH)[_0x923f('0xc')](function(_0xdc5a52){if(_0xdc5a52){return fs['readJSON'](APP_JSON_PATH)[_0x923f('0xc')](function(_0x22da1a){var _0x54a604=setLegacyLibsNodeEnvPath(_0x22da1a);if(_0x54a604[_0x923f('0xd')]){_0x1b1917[_0x923f('0xe')]('Updating\x20app.json');return fs[_0x923f('0xf')](APP_JSON_PATH,_0x22da1a,{'spaces':0x2});}else{return Promise[_0x923f('0x2')]();}});}else{return Promise['resolve']();}});}module[_0x923f('0x10')]=updateAppConfig; \ No newline at end of file -- 1.7.1